From: Andrea Bianco Date: Tue, 9 Jun 2020 10:05:44 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.4.18 X-Git-Tag: 2.4.19~1 X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=4bc06bbc8fa83e22e737721bfd4231951a8da599;p=motion2.git Built motion from commit (unavailable).|2.4.18 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 2b523f8..cf4e92f 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-06-09T09:46:38.476Z", + "time": "2020-06-09T09:57:35.385Z", "url": "http://apidocjs.com", "version": "0.20.1" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index fb96c4f..084e315 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-06-09T09:46:38.476Z", + "time": "2020-06-09T09:57:35.385Z", "url": "http://apidocjs.com", "version": "0.20.1" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index f7a10c6..93744d1 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 _0xdab0=['TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]'];(function(_0x5f72ad,_0x5eaae9){var _0x21d654=function(_0x383fa5){while(--_0x383fa5){_0x5f72ad['push'](_0x5f72ad['shift']());}};_0x21d654(++_0x5eaae9);}(_0xdab0,0xab));var _0x0dab=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xdab0[_0x2aec52];return _0x3b8835;};'use strict';var Sequelize=require(_0x0dab('0x0'));module[_0x0dab('0x1')]={'name':{'type':Sequelize[_0x0dab('0x2')],'get':function(_0xad89b6){return this[_0x0dab('0x3')](_0x0dab('0x4'));}},'action':{'type':Sequelize[_0x0dab('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x0dab('0x6'),_0x0dab('0x7'),'motionbar',_0x0dab('0x8'),'urlForward',_0x0dab('0x9'),_0x0dab('0xa'),_0x0dab('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x0dab('0xc')},'data1':{'type':Sequelize[_0x0dab('0x5')](0x1000),'comment':_0x0dab('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x0dab('0xe')},'data3':{'type':Sequelize[_0x0dab('0x5')](0x1000),'comment':_0x0dab('0xf')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0x0dab('0x5')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0x0dab('0x10')]}}; \ No newline at end of file +var _0xb529=['motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','VIRTUAL','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0xb529,0x110));var _0x9b52=function(_0x4957d3,_0x2fb7b5){_0x4957d3=_0x4957d3-0x0;var _0x354835=_0xb529[_0x4957d3];return _0x354835;};'use strict';var Sequelize=require(_0x9b52('0x0'));module['exports']={'name':{'type':Sequelize[_0x9b52('0x1')],'get':function(_0x192297){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x9b52('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x9b52('0x3'),_0x9b52('0x4'),_0x9b52('0x5'),_0x9b52('0x6'),_0x9b52('0x7'),_0x9b52('0x8'),_0x9b52('0x9'),_0x9b52('0xa')]],'msg':_0x9b52('0xb')}},'comment':_0x9b52('0xb')},'data1':{'type':Sequelize[_0x9b52('0x2')](0x1000),'comment':_0x9b52('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x9b52('0x2')](0x1000),'comment':_0x9b52('0xd')},'data4':{'type':Sequelize[_0x9b52('0x2')](0x1000)},'data5':{'type':Sequelize[_0x9b52('0x2')](0x1000)},'data6':{'type':Sequelize[_0x9b52('0x2')]},'data7':{'type':Sequelize[_0x9b52('0xe')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index dad5625..929bd67 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 _0xe602=['Content-Range','apply','reject','save','then','stack','name','update','body','Action','find','params','catch','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit'];(function(_0x16c401,_0x2fddd9){var _0x2348bb=function(_0x58fdbd){while(--_0x58fdbd){_0x16c401['push'](_0x16c401['shift']());}};_0x2348bb(++_0x2fddd9);}(_0xe602,0x12c));var _0x2e60=function(_0x2d7e2f,_0x41bde1){_0x2d7e2f=_0x2d7e2f-0x0;var _0x40d935=_0xe602[_0x2d7e2f];return _0x40d935;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2e60('0x0'));var rimraf=require(_0x2e60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2e60('0x2'));var BPromise=require(_0x2e60('0x3'));var Mustache=require(_0x2e60('0x4'));var util=require(_0x2e60('0x5'));var path=require(_0x2e60('0x6'));var sox=require(_0x2e60('0x7'));var csv=require(_0x2e60('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2e60('0x9'));var squel=require(_0x2e60('0xa'));var crypto=require(_0x2e60('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2e60('0xc'));var toCsv=require(_0x2e60('0x8'));var querystring=require(_0x2e60('0xd'));var Papa=require('papaparse');var Redis=require(_0x2e60('0xe'));var authService=require(_0x2e60('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2e60('0x10'));var hardwareService=require(_0x2e60('0x11'));var logger=require(_0x2e60('0x12'))(_0x2e60('0x13'));var utils=require('../../config/utils');var config=require(_0x2e60('0x14'));var db=require(_0x2e60('0x15'))['db'];function respondWithStatusCode(_0x377fcf,_0x540a87){_0x540a87=_0x540a87||0xcc;return function(_0x597730){if(_0x597730){return _0x377fcf[_0x2e60('0x16')](_0x540a87);}return _0x377fcf[_0x2e60('0x17')](_0x540a87)[_0x2e60('0x18')]();};}function respondWithResult(_0x44d1a6,_0x49b7cb){_0x49b7cb=_0x49b7cb||0xc8;return function(_0x564652){if(_0x564652){return _0x44d1a6[_0x2e60('0x17')](_0x49b7cb)['json'](_0x564652);}};}function respondWithFilteredResult(_0x3b26b8,_0x49892a){return function(_0x314ab4){if(_0x314ab4){var _0x35456e=_0x314ab4[_0x2e60('0x19')],_0x3eb7e3=_0x49892a[_0x2e60('0x1a')],_0x5e6ff8=_0x49892a[_0x2e60('0x1a')]+_0x49892a[_0x2e60('0x1b')],_0x5b86da;if(_0x5e6ff8>=_0x35456e){_0x5e6ff8=_0x35456e;_0x5b86da=0xc8;}else{_0x5b86da=0xce;}_0x3b26b8['status'](_0x5b86da);return _0x3b26b8['set'](_0x2e60('0x1c'),_0x3eb7e3+'-'+_0x5e6ff8+'/'+_0x35456e)['json'](_0x314ab4);}return null;};}function patchUpdates(_0x23edd6){return function(_0x7cd760){try{jsonpatch[_0x2e60('0x1d')](_0x7cd760,_0x23edd6,!![]);}catch(_0x3ea222){return BPromise[_0x2e60('0x1e')](_0x3ea222);}return _0x7cd760[_0x2e60('0x1f')]();};}function saveUpdates(_0x51f84c,_0x54ca21){return function(_0x23c8cf){if(_0x23c8cf){return _0x23c8cf['update'](_0x51f84c)[_0x2e60('0x20')](function(_0x2c7e80){return _0x2c7e80;});}return null;};}function removeEntity(_0x2e9358,_0x1d799f){return function(_0x4a75ff){if(_0x4a75ff){return _0x4a75ff['destroy']()[_0x2e60('0x20')](function(){_0x2e9358[_0x2e60('0x17')](0xcc)[_0x2e60('0x18')]();});}};}function handleEntityNotFound(_0x206d76,_0x3c9b7c){return function(_0x4f4f03){if(!_0x4f4f03){_0x206d76[_0x2e60('0x16')](0x194);}return _0x4f4f03;};}function handleError(_0x18ea13,_0x546844){_0x546844=_0x546844||0x1f4;return function(_0x5f294f){logger['error'](_0x5f294f[_0x2e60('0x21')]);if(_0x5f294f['name']){delete _0x5f294f[_0x2e60('0x22')];}_0x18ea13['status'](_0x546844)['send'](_0x5f294f);};}exports[_0x2e60('0x23')]=function(_0x1d09f1,_0x41dcc7){if(_0x1d09f1[_0x2e60('0x24')]['id']){delete _0x1d09f1[_0x2e60('0x24')]['id'];}return db[_0x2e60('0x25')][_0x2e60('0x26')]({'where':{'id':_0x1d09f1[_0x2e60('0x27')]['id']}})[_0x2e60('0x20')](handleEntityNotFound(_0x41dcc7,null))['then'](saveUpdates(_0x1d09f1[_0x2e60('0x24')],null))[_0x2e60('0x20')](respondWithResult(_0x41dcc7,null))[_0x2e60('0x28')](handleError(_0x41dcc7,null));};exports['destroy']=function(_0xb98464,_0x349eff){return db[_0x2e60('0x25')]['find']({'where':{'id':_0xb98464[_0x2e60('0x27')]['id']}})[_0x2e60('0x20')](handleEntityNotFound(_0x349eff,null))[_0x2e60('0x20')](removeEntity(_0x349eff,null))[_0x2e60('0x28')](handleError(_0x349eff,null));}; \ No newline at end of file +var _0xa009=['update','destroy','then','end','error','stack','name','send','body','Action','find','catch','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','reject','save'];(function(_0x3a7e76,_0x378760){var _0x2cc4b7=function(_0x26e30c){while(--_0x26e30c){_0x3a7e76['push'](_0x3a7e76['shift']());}};_0x2cc4b7(++_0x378760);}(_0xa009,0x8d));var _0x9a00=function(_0x929c7e,_0x38c4cc){_0x929c7e=_0x929c7e-0x0;var _0x5de099=_0xa009[_0x929c7e];return _0x5de099;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9a00('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a00('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9a00('0x2'));var moment=require(_0x9a00('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9a00('0x4'));var util=require(_0x9a00('0x5'));var path=require(_0x9a00('0x6'));var sox=require(_0x9a00('0x7'));var csv=require(_0x9a00('0x8'));var ejs=require(_0x9a00('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9a00('0xa'));var crypto=require(_0x9a00('0xb'));var jsforce=require(_0x9a00('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9a00('0x8'));var querystring=require('querystring');var Papa=require(_0x9a00('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9a00('0xe'));var as=require(_0x9a00('0xf'));var hardwareService=require(_0x9a00('0x10'));var logger=require(_0x9a00('0x11'))(_0x9a00('0x12'));var utils=require(_0x9a00('0x13'));var config=require(_0x9a00('0x14'));var db=require(_0x9a00('0x15'))['db'];function respondWithStatusCode(_0x30f6f9,_0x27fa8f){_0x27fa8f=_0x27fa8f||0xcc;return function(_0x72dae4){if(_0x72dae4){return _0x30f6f9[_0x9a00('0x16')](_0x27fa8f);}return _0x30f6f9[_0x9a00('0x17')](_0x27fa8f)['end']();};}function respondWithResult(_0xd4b39c,_0x5e1eab){_0x5e1eab=_0x5e1eab||0xc8;return function(_0x5c54c3){if(_0x5c54c3){return _0xd4b39c['status'](_0x5e1eab)[_0x9a00('0x18')](_0x5c54c3);}};}function respondWithFilteredResult(_0x4886a3,_0x3ab4fb){return function(_0x4fe23a){if(_0x4fe23a){var _0x3037f4=_0x4fe23a[_0x9a00('0x19')],_0x76d6ac=_0x3ab4fb['offset'],_0x347754=_0x3ab4fb[_0x9a00('0x1a')]+_0x3ab4fb[_0x9a00('0x1b')],_0x5a84b0;if(_0x347754>=_0x3037f4){_0x347754=_0x3037f4;_0x5a84b0=0xc8;}else{_0x5a84b0=0xce;}_0x4886a3['status'](_0x5a84b0);return _0x4886a3['set']('Content-Range',_0x76d6ac+'-'+_0x347754+'/'+_0x3037f4)['json'](_0x4fe23a);}return null;};}function patchUpdates(_0x1673f8){return function(_0x486b55){try{jsonpatch[_0x9a00('0x1c')](_0x486b55,_0x1673f8,!![]);}catch(_0x39cc56){return BPromise[_0x9a00('0x1d')](_0x39cc56);}return _0x486b55[_0x9a00('0x1e')]();};}function saveUpdates(_0x478d0a,_0x23eec7){return function(_0xdb7bdd){if(_0xdb7bdd){return _0xdb7bdd[_0x9a00('0x1f')](_0x478d0a)['then'](function(_0x1eddf3){return _0x1eddf3;});}return null;};}function removeEntity(_0x22fa2e,_0x3e1368){return function(_0x2c9267){if(_0x2c9267){return _0x2c9267[_0x9a00('0x20')]()[_0x9a00('0x21')](function(){_0x22fa2e[_0x9a00('0x17')](0xcc)[_0x9a00('0x22')]();});}};}function handleEntityNotFound(_0x40854f,_0x251d0e){return function(_0x320762){if(!_0x320762){_0x40854f[_0x9a00('0x16')](0x194);}return _0x320762;};}function handleError(_0x131222,_0x33bc35){_0x33bc35=_0x33bc35||0x1f4;return function(_0x45e2d2){logger[_0x9a00('0x23')](_0x45e2d2[_0x9a00('0x24')]);if(_0x45e2d2[_0x9a00('0x25')]){delete _0x45e2d2['name'];}_0x131222['status'](_0x33bc35)[_0x9a00('0x26')](_0x45e2d2);};}exports[_0x9a00('0x1f')]=function(_0x1e4f3c,_0x4d33b9){if(_0x1e4f3c[_0x9a00('0x27')]['id']){delete _0x1e4f3c[_0x9a00('0x27')]['id'];}return db[_0x9a00('0x28')][_0x9a00('0x29')]({'where':{'id':_0x1e4f3c['params']['id']}})[_0x9a00('0x21')](handleEntityNotFound(_0x4d33b9,null))[_0x9a00('0x21')](saveUpdates(_0x1e4f3c[_0x9a00('0x27')],null))['then'](respondWithResult(_0x4d33b9,null))[_0x9a00('0x2a')](handleError(_0x4d33b9,null));};exports[_0x9a00('0x20')]=function(_0x4d4787,_0x4cfb6d){return db['Action']['find']({'where':{'id':_0x4d4787['params']['id']}})[_0x9a00('0x21')](handleEntityNotFound(_0x4cfb6d,null))[_0x9a00('0x21')](removeEntity(_0x4cfb6d,null))[_0x9a00('0x2a')](handleError(_0x4cfb6d,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 6fa7c86..1c43428 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 _0x21dc=['tools_actions','../../config/logger','api','bluebird','request-promise','path','rimraf','./action.attributes','exports','Action'];(function(_0x45493c,_0x39478b){var _0xe89240=function(_0x45dee9){while(--_0x45dee9){_0x45493c['push'](_0x45493c['shift']());}};_0xe89240(++_0x39478b);}(_0x21dc,0x65));var _0xc21d=function(_0x30f17b,_0x231b6d){_0x30f17b=_0x30f17b-0x0;var _0x4dd3c9=_0x21dc[_0x30f17b];return _0x4dd3c9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc21d('0x0'))(_0xc21d('0x1'));var moment=require('moment');var BPromise=require(_0xc21d('0x2'));var rp=require(_0xc21d('0x3'));var fs=require('fs');var path=require(_0xc21d('0x4'));var rimraf=require(_0xc21d('0x5'));var config=require('../../config/environment');var attributes=require(_0xc21d('0x6'));module[_0xc21d('0x7')]=function(_0x373efb,_0x3b8a8d){return _0x373efb['define'](_0xc21d('0x8'),attributes,{'tableName':_0xc21d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3df=['Action','tools_actions','lodash','util','api','moment','path','rimraf','../../config/environment','./action.attributes','define'];(function(_0x26018a,_0x3423da){var _0x1b47b1=function(_0x6bbf70){while(--_0x6bbf70){_0x26018a['push'](_0x26018a['shift']());}};_0x1b47b1(++_0x3423da);}(_0xc3df,0x16d));var _0xfc3d=function(_0x3bc5a1,_0x530b19){_0x3bc5a1=_0x3bc5a1-0x0;var _0x5d23a3=_0xc3df[_0x3bc5a1];return _0x5d23a3;};'use strict';var _=require(_0xfc3d('0x0'));var util=require(_0xfc3d('0x1'));var logger=require('../../config/logger')(_0xfc3d('0x2'));var moment=require(_0xfc3d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc3d('0x4'));var rimraf=require(_0xfc3d('0x5'));var config=require(_0xfc3d('0x6'));var attributes=require(_0xfc3d('0x7'));module['exports']=function(_0x163ce6,_0x315d62){return _0x163ce6[_0xfc3d('0x8')](_0xfc3d('0x9'),attributes,{'tableName':_0xfc3d('0xa'),'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 969c522..3e7e191 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s'];(function(_0x1e7292,_0x75796d){var _0x52ebf7=function(_0x143407){while(--_0x143407){_0x1e7292['push'](_0x1e7292['shift']());}};_0x52ebf7(++_0x75796d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x413aac,_0x5e2430){_0x413aac=_0x413aac-0x0;var _0x569b11=_0xcb91[_0x413aac];return _0x569b11;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('Action,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s'];(function(_0x4404a2,_0x4fab6d){var _0x418ffa=function(_0x2fb427){while(--_0x2fb427){_0x4404a2['push'](_0x4404a2['shift']());}};_0x418ffa(++_0x4fab6d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xcb91[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('Action,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 9b6ddfb..8c53613 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 _0x586c=['../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x586c,0xbe));var _0xc586=function(_0xd336fa,_0x39d1b2){_0xd336fa=_0xd336fa-0x0;var _0x3370b1=_0x586c[_0xd336fa];return _0x3370b1;};'use strict';var multer=require('multer');var util=require(_0xc586('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc586('0x1'));var router=express[_0xc586('0x2')]();var auth=require(_0xc586('0x3'));var interaction=require(_0xc586('0x4'));var config=require(_0xc586('0x5'));var controller=require('./action.controller');router[_0xc586('0x6')](_0xc586('0x7'),auth[_0xc586('0x8')](),controller[_0xc586('0x9')]);router[_0xc586('0xa')](_0xc586('0x7'),auth[_0xc586('0x8')](),controller[_0xc586('0xb')]);module[_0xc586('0xc')]=router; \ No newline at end of file +var _0x43e8=['update','delete','destroy','util','path','Router','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','isAuthenticated'];(function(_0x44fde7,_0x13bca8){var _0x729ad3=function(_0x57c4dc){while(--_0x57c4dc){_0x44fde7['push'](_0x44fde7['shift']());}};_0x729ad3(++_0x13bca8);}(_0x43e8,0x1bf));var _0x843e=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x43e8[_0x1a36a5];return _0x746243;};'use strict';var multer=require('multer');var util=require(_0x843e('0x0'));var path=require(_0x843e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x843e('0x2')]();var auth=require(_0x843e('0x3'));var interaction=require(_0x843e('0x4'));var config=require('../../config/environment');var controller=require(_0x843e('0x5'));router[_0x843e('0x6')](_0x843e('0x7'),auth[_0x843e('0x8')](),controller[_0x843e('0x9')]);router[_0x843e('0xa')](_0x843e('0x7'),auth[_0x843e('0x8')](),controller[_0x843e('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 87aa37c..0e8e244 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 _0xc40f=['exports','STRING','TEXT'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xc40f,0x1d7));var _0xfc40=function(_0x7d42c9,_0x53721d){_0x7d42c9=_0x7d42c9-0x0;var _0x542f15=_0xc40f[_0x7d42c9];return _0x542f15;};'use strict';var Sequelize=require('sequelize');module[_0xfc40('0x0')]={'name':{'type':Sequelize[_0xfc40('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xfc40('0x1')]},'table':{'type':Sequelize[_0xfc40('0x1')]},'conditions':{'type':Sequelize[_0xfc40('0x2')]},'joins':{'type':Sequelize[_0xfc40('0x2')]}}; \ No newline at end of file +var _0x233f=['STRING','TEXT','sequelize','exports'];(function(_0x2f9de8,_0x4f8d46){var _0x259b83=function(_0x20ac87){while(--_0x20ac87){_0x2f9de8['push'](_0x2f9de8['shift']());}};_0x259b83(++_0x4f8d46);}(_0x233f,0x152));var _0xf233=function(_0xa1e3ca,_0x559022){_0xa1e3ca=_0xa1e3ca-0x0;var _0x5005ab=_0x233f[_0xa1e3ca];return _0x5005ab;};'use strict';var Sequelize=require(_0xf233('0x0'));module[_0xf233('0x1')]={'name':{'type':Sequelize[_0xf233('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xf233('0x2')]},'table':{'type':Sequelize[_0xf233('0x2')]},'conditions':{'type':Sequelize[_0xf233('0x3')]},'joins':{'type':Sequelize[_0xf233('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index c2aeafe..c6c177f 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 _0x3366=['metric','toString','SELECT','No\x20available\x20data','output','web','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','count','offset','limit','set','Content-Range','reject','update','then','get','CustomReports','UserProfileResource','destroy','end','error','stack','name','send','index','map','AnalyticCustomReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','from','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','sequelize','QueryTypes','right_join','GROUP_CONCAT(%s)','condition','AnalyticMetric','keyBy','select'];(function(_0x1ad852,_0x5c43b5){var _0xf38eae=function(_0x13020a){while(--_0x13020a){_0x1ad852['push'](_0x1ad852['shift']());}};_0xf38eae(++_0x5c43b5);}(_0x3366,0xc5));var _0x6336=function(_0x3d34da,_0x3abcc1){_0x3d34da=_0x3d34da-0x0;var _0xcf6af8=_0x3366[_0x3d34da];return _0xcf6af8;};'use strict';var pdf=require(_0x6336('0x0'));var emlformat=require(_0x6336('0x1'));var rimraf=require(_0x6336('0x2'));var zipdir=require(_0x6336('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6336('0x4'));var moment=require(_0x6336('0x5'));var BPromise=require(_0x6336('0x6'));var Mustache=require(_0x6336('0x7'));var util=require(_0x6336('0x8'));var path=require(_0x6336('0x9'));var sox=require('sox');var csv=require(_0x6336('0xa'));var ejs=require(_0x6336('0xb'));var fs=require('fs');var _=require(_0x6336('0xc'));var squel=require('squel');var crypto=require(_0x6336('0xd'));var jsforce=require(_0x6336('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6336('0xa'));var querystring=require(_0x6336('0xf'));var Papa=require(_0x6336('0x10'));var Redis=require(_0x6336('0x11'));var authService=require(_0x6336('0x12'));var qs=require(_0x6336('0x13'));var as=require(_0x6336('0x14'));var hardwareService=require(_0x6336('0x15'));var logger=require(_0x6336('0x16'))(_0x6336('0x17'));var utils=require(_0x6336('0x18'));var config=require('../../config/environment');var db=require(_0x6336('0x19'))['db'];function respondWithStatusCode(_0x534e5d,_0xf4398b){_0xf4398b=_0xf4398b||0xcc;return function(_0x48fc85){if(_0x48fc85){return _0x534e5d['sendStatus'](_0xf4398b);}return _0x534e5d[_0x6336('0x1a')](_0xf4398b)['end']();};}function respondWithResult(_0x5b1e5b,_0x54130c){_0x54130c=_0x54130c||0xc8;return function(_0x4faa05){if(_0x4faa05){return _0x5b1e5b['status'](_0x54130c)[_0x6336('0x1b')](_0x4faa05);}};}function respondWithFilteredResult(_0x18cf80,_0x13c6b2){return function(_0x4b2030){if(_0x4b2030){var _0x3d67b0=_0x4b2030[_0x6336('0x1c')],_0x5747b0=_0x13c6b2[_0x6336('0x1d')],_0x3c81a1=_0x13c6b2[_0x6336('0x1d')]+_0x13c6b2[_0x6336('0x1e')],_0x157cc9;if(_0x3c81a1>=_0x3d67b0){_0x3c81a1=_0x3d67b0;_0x157cc9=0xc8;}else{_0x157cc9=0xce;}_0x18cf80[_0x6336('0x1a')](_0x157cc9);return _0x18cf80[_0x6336('0x1f')](_0x6336('0x20'),_0x5747b0+'-'+_0x3c81a1+'/'+_0x3d67b0)['json'](_0x4b2030);}return null;};}function patchUpdates(_0x7cc184){return function(_0x56c98f){try{jsonpatch['apply'](_0x56c98f,_0x7cc184,!![]);}catch(_0x456226){return BPromise[_0x6336('0x21')](_0x456226);}return _0x56c98f['save']();};}function saveUpdates(_0xee1f87,_0x262920){return function(_0x159627){if(_0x159627){return _0x159627[_0x6336('0x22')](_0xee1f87)['then'](function(_0x55b9eb){return _0x55b9eb;});}return null;};}function removeEntity(_0x31545a,_0x429910){return function(_0x3cfa28){if(_0x3cfa28){return _0x3cfa28['destroy']()[_0x6336('0x23')](function(){var _0x5211a0=_0x3cfa28[_0x6336('0x24')]({'plain':!![]});var _0x459e05=_0x6336('0x25');return db[_0x6336('0x26')][_0x6336('0x27')]({'where':{'type':_0x459e05,'resourceId':_0x5211a0['id']}})[_0x6336('0x23')](function(){return _0x3cfa28;});})[_0x6336('0x23')](function(){_0x31545a[_0x6336('0x1a')](0xcc)[_0x6336('0x28')]();});}};}function handleEntityNotFound(_0x43e1d4,_0x2aa53b){return function(_0x3b1141){if(!_0x3b1141){_0x43e1d4['sendStatus'](0x194);}return _0x3b1141;};}function handleError(_0x182662,_0x5baa59){_0x5baa59=_0x5baa59||0x1f4;return function(_0x44d07a){logger[_0x6336('0x29')](_0x44d07a[_0x6336('0x2a')]);if(_0x44d07a['name']){delete _0x44d07a[_0x6336('0x2b')];}_0x182662[_0x6336('0x1a')](_0x5baa59)[_0x6336('0x2c')](_0x44d07a);};}exports[_0x6336('0x2d')]=function(_0x4a6c7c,_0x2b4067){var _0x3468c0={},_0x40fea3={},_0x132b13={'count':0x0,'rows':[]};var _0x475a6e=_[_0x6336('0x2e')](db[_0x6336('0x2f')]['rawAttributes'],function(_0xf0f6c6){return{'name':_0xf0f6c6['fieldName'],'type':_0xf0f6c6[_0x6336('0x30')][_0x6336('0x31')]};});_0x40fea3[_0x6336('0x32')]=_[_0x6336('0x2e')](_0x475a6e,_0x6336('0x2b'));_0x40fea3[_0x6336('0x33')]=_[_0x6336('0x34')](_0x4a6c7c[_0x6336('0x33')]);_0x40fea3[_0x6336('0x35')]=_[_0x6336('0x36')](_0x40fea3['model'],_0x40fea3[_0x6336('0x33')]);_0x3468c0[_0x6336('0x37')]=_[_0x6336('0x36')](_0x40fea3[_0x6336('0x32')],qs['fields'](_0x4a6c7c[_0x6336('0x33')][_0x6336('0x38')]));_0x3468c0['attributes']=_0x3468c0[_0x6336('0x37')]['length']?_0x3468c0['attributes']:_0x40fea3[_0x6336('0x32')];if(!_0x4a6c7c['query'][_0x6336('0x39')](_0x6336('0x3a'))){_0x3468c0[_0x6336('0x1e')]=qs[_0x6336('0x1e')](_0x4a6c7c[_0x6336('0x33')][_0x6336('0x1e')]);_0x3468c0[_0x6336('0x1d')]=qs[_0x6336('0x1d')](_0x4a6c7c['query']['offset']);}_0x3468c0[_0x6336('0x3b')]=qs[_0x6336('0x3c')](_0x4a6c7c[_0x6336('0x33')][_0x6336('0x3c')]);_0x3468c0['where']=qs[_0x6336('0x35')](_[_0x6336('0x3d')](_0x4a6c7c['query'],_0x40fea3['filters']));if(_0x4a6c7c['query'][_0x6336('0x3e')]){_0x3468c0[_0x6336('0x3f')]=_[_0x6336('0x40')](_0x3468c0['where'],{'$or':_['map'](_0x475a6e,function(_0x3a6ec8){if(_0x3a6ec8[_0x6336('0x30')]!=='VIRTUAL'){var _0x55af22={};_0x55af22[_0x3a6ec8[_0x6336('0x2b')]]={'$like':'%'+_0x4a6c7c[_0x6336('0x33')][_0x6336('0x3e')]+'%'};return _0x55af22;}})});}_0x3468c0=_[_0x6336('0x40')]({},_0x3468c0,_0x4a6c7c[_0x6336('0x41')]);var _0x1d82c7={'where':_0x3468c0['where']};return db[_0x6336('0x2f')][_0x6336('0x1c')](_0x1d82c7)[_0x6336('0x23')](function(_0x4e251c){_0x132b13[_0x6336('0x1c')]=_0x4e251c;if(_0x4a6c7c[_0x6336('0x33')][_0x6336('0x42')]){_0x3468c0[_0x6336('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x6336('0x44')](_0x3468c0);})['then'](function(_0x51661d){_0x132b13[_0x6336('0x45')]=_0x51661d;return _0x132b13;})[_0x6336('0x23')](respondWithFilteredResult(_0x2b4067,_0x3468c0))[_0x6336('0x46')](handleError(_0x2b4067,null));};exports[_0x6336('0x47')]=function(_0x352d8e,_0x5e857b){var _0xcebbc9={'raw':![],'where':{'id':_0x352d8e[_0x6336('0x48')]['id']}},_0x5692f6={};_0x5692f6[_0x6336('0x32')]=_[_0x6336('0x34')](db[_0x6336('0x2f')][_0x6336('0x49')]);_0x5692f6[_0x6336('0x33')]=_[_0x6336('0x34')](_0x352d8e[_0x6336('0x33')]);_0x5692f6[_0x6336('0x35')]=_[_0x6336('0x36')](_0x5692f6['model'],_0x5692f6[_0x6336('0x33')]);_0xcebbc9[_0x6336('0x37')]=_[_0x6336('0x36')](_0x5692f6[_0x6336('0x32')],qs[_0x6336('0x38')](_0x352d8e[_0x6336('0x33')][_0x6336('0x38')]));_0xcebbc9[_0x6336('0x37')]=_0xcebbc9[_0x6336('0x37')][_0x6336('0x4a')]?_0xcebbc9[_0x6336('0x37')]:_0x5692f6[_0x6336('0x32')];if(_0x352d8e['query'][_0x6336('0x42')]){_0xcebbc9[_0x6336('0x43')]=[{'all':!![]}];}_0xcebbc9=_[_0x6336('0x40')]({},_0xcebbc9,_0x352d8e[_0x6336('0x41')]);return db['AnalyticCustomReport']['find'](_0xcebbc9)[_0x6336('0x23')](handleEntityNotFound(_0x5e857b,null))[_0x6336('0x23')](respondWithResult(_0x5e857b,null))['catch'](handleError(_0x5e857b,null));};exports[_0x6336('0x4b')]=function(_0x580d70,_0x2aeff0){return db[_0x6336('0x2f')][_0x6336('0x4b')](_0x580d70['body'],{})[_0x6336('0x23')](function(_0x5467d9){var _0x110638=_0x580d70[_0x6336('0x4c')][_0x6336('0x24')]({'plain':!![]});if(!_0x110638)throw new Error(_0x6336('0x4d'));if(_0x110638[_0x6336('0x4e')]==='user'){var _0x1dff09=_0x5467d9['get']({'plain':!![]});var _0x43382c=_0x6336('0x4f');return db[_0x6336('0x50')]['find']({'where':{'name':_0x43382c,'userProfileId':_0x110638[_0x6336('0x51')]},'raw':!![]})[_0x6336('0x23')](function(_0x4e89b4){if(_0x4e89b4&&_0x4e89b4['autoAssociation']===0x0){return db[_0x6336('0x26')][_0x6336('0x4b')]({'name':_0x1dff09[_0x6336('0x2b')],'resourceId':_0x1dff09['id'],'type':_0x6336('0x25'),'sectionId':_0x4e89b4['id']},{})[_0x6336('0x23')](function(){return _0x5467d9;});}else{return _0x5467d9;}})['catch'](function(_0x10eca9){logger[_0x6336('0x29')](_0x6336('0x52'),_0x10eca9);throw _0x10eca9;});}return _0x5467d9;})['then'](respondWithResult(_0x2aeff0,0xc9))['catch'](handleError(_0x2aeff0,null));};exports[_0x6336('0x22')]=function(_0xcea3d3,_0x23a519){if(_0xcea3d3[_0x6336('0x53')]['id']){delete _0xcea3d3[_0x6336('0x53')]['id'];}return db['AnalyticCustomReport'][_0x6336('0x54')]({'where':{'id':_0xcea3d3[_0x6336('0x48')]['id']}})[_0x6336('0x23')](handleEntityNotFound(_0x23a519,null))['then'](saveUpdates(_0xcea3d3[_0x6336('0x53')],null))[_0x6336('0x23')](respondWithResult(_0x23a519,null))[_0x6336('0x46')](handleError(_0x23a519,null));};exports[_0x6336('0x27')]=function(_0x59072d,_0xe30544){return db[_0x6336('0x2f')][_0x6336('0x54')]({'where':{'id':_0x59072d[_0x6336('0x48')]['id']}})['then'](handleEntityNotFound(_0xe30544,null))['then'](removeEntity(_0xe30544,null))[_0x6336('0x46')](handleError(_0xe30544,null));};exports[_0x6336('0x55')]=function(_0x347b84,_0x4cbd8b){var _0x45db61=0xa;var _0x10274b=[_0x6336('0x56'),_0x6336('0x57'),'right_join',_0x6336('0x58')];var _0x38e3d8={'SUM':_0x6336('0x59'),'COUNT':_0x6336('0x5a'),'COUNT DISTINCT':_0x6336('0x5b'),'MAX':_0x6336('0x5c'),'MIN':_0x6336('0x5d'),'AVG':_0x6336('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x6336('0x5f'),'GROUP_CONCAT DESC':_0x6336('0x60')};var _0x11a17f={'SEC_TO_TIME':_0x6336('0x61'),'DATE':'DATE(%s)','HOUR':_0x6336('0x62'),'ROUND':_0x6336('0x63'),'UNIX_TIMESTAMP':_0x6336('0x64')};var _0x1cc27a=function(_0x5aeafa){return!_[_0x6336('0x65')]([_0x6336('0x66'),_0x6336('0x67'),_0x6336('0x68'),_0x6336('0x69')],_0x5aeafa);};var _0x191573=function(_0x4b7fb5){if(!_0x4b7fb5||!_0x4b7fb5[_0x6336('0x6a')][_0x6336('0x4a')]){return'';}for(var _0x730385='(',_0x4991e6=0x0;_0x4991e6<_0x4b7fb5[_0x6336('0x6a')][_0x6336('0x4a')];_0x4991e6+=0x1){_0x4991e6>0x0&&(_0x730385+='\x20'+_0x4b7fb5[_0x6336('0x6b')]+'\x20');_0x730385+=_0x4b7fb5['rules'][_0x4991e6][_0x6336('0x6c')]?_0x191573(_0x4b7fb5[_0x6336('0x6a')][_0x4991e6][_0x6336('0x6c')]):_0x4b7fb5[_0x6336('0x6a')][_0x4991e6][_0x6336('0x6d')]+'\x20'+_0x4b7fb5['rules'][_0x4991e6]['condition']+(_0x1cc27a(_0x4b7fb5['rules'][_0x4991e6]['condition'])?'\x20'+_0x4b7fb5['rules'][_0x4991e6][_0x6336('0x6e')]:'');}return _0x730385+')';};var _0x51e59c={'where':{'id':_0x347b84[_0x6336('0x48')]['id']}},_0x3d9154,_0x525fdf,_0x400d27,_0x95d89c,_0xb4b2a5;_0x51e59c=_[_0x6336('0x40')]({},_0x51e59c,_0x347b84['options']);return db[_0x6336('0x2f')][_0x6336('0x54')](_0x51e59c)[_0x6336('0x23')](function(_0x1fd271){if(_0x1fd271){_0x3d9154=_0x1fd271;return _0x1fd271[_0x6336('0x6f')]();}return null;})['then'](function(_0x4b2f5f){if(_0x4b2f5f){if(!_0x4b2f5f[_0x6336('0x4a')]){throw new db[(_0x6336('0x70'))][(_0x6336('0x71'))](_0x6336('0x72'),0x193);}_0x525fdf=_0x4b2f5f;return db['AnalyticMetric'][_0x6336('0x44')]({'raw':!![]});}return null;})[_0x6336('0x23')](function(_0x148e92){if(_0x148e92){_0x400d27=_['keyBy'](_0x148e92,'id');var _0x6251ff;var _0xb18a5a=squel['select']();_0xb18a5a[_0x6336('0x73')](_0x3d9154['table']);for(var _0x56de21=0x0;_0x56de21<_0x525fdf['length'];_0x56de21+=0x1){_0x6251ff=_0x525fdf[_0x56de21][_0x6336('0x74')]?_0x400d27[_0x525fdf[_0x56de21][_0x6336('0x74')]]['metric']:_0x525fdf[_0x56de21][_0x6336('0x6d')];_0x6251ff=_0x525fdf[_0x56de21][_0x6336('0x75')]?_[_0x6336('0x76')](_0x38e3d8[_0x525fdf[_0x56de21][_0x6336('0x75')]],'%s',_0x6251ff):_0x6251ff;_0x6251ff=_0x525fdf[_0x56de21]['format']?_[_0x6336('0x76')](_0x11a17f[_0x525fdf[_0x56de21][_0x6336('0x77')]],'%s',_0x6251ff):_0x6251ff;if(_0x525fdf[_0x56de21][_0x6336('0x78')]){_0xb18a5a[_0x6336('0x6c')](_0x6251ff);}_0x525fdf[_0x56de21][_0x6336('0x79')]&&_0xb18a5a['order'](_0x6251ff,_0x525fdf[_0x56de21][_0x6336('0x79')]===_0x6336('0x7a')?![]:!![]);_0xb18a5a[_0x6336('0x6d')](_0x6251ff,_0x525fdf[_0x56de21][_0x6336('0x7b')]||_0x6251ff);}if(_0x3d9154['joins']){_0x3d9154[_0x6336('0x7c')]=JSON[_0x6336('0x7d')](_0x3d9154[_0x6336('0x7c')]);for(var _0x220ec6=0x0;_0x220ec6<_0x3d9154[_0x6336('0x7c')][_0x6336('0x4a')];_0x220ec6+=0x1){if(_0x3d9154[_0x6336('0x7c')][_0x220ec6][_0x6336('0x30')]&&_[_0x6336('0x65')](_0x10274b,_0x3d9154[_0x6336('0x7c')][_0x220ec6][_0x6336('0x30')])&&_0x3d9154[_0x6336('0x7c')][_0x220ec6][_0x6336('0x7e')]&&_0x3d9154[_0x6336('0x7c')][_0x220ec6][_0x6336('0x7f')]&&_0x3d9154['joins'][_0x220ec6][_0x6336('0x80')]){_0xb18a5a[_0x3d9154[_0x6336('0x7c')][_0x220ec6][_0x6336('0x30')]](_0x3d9154[_0x6336('0x7c')][_0x220ec6][_0x6336('0x7f')],null,util[_0x6336('0x77')](_0x6336('0x81'),_0x3d9154[_0x6336('0x82')],_0x3d9154['joins'][_0x220ec6][_0x6336('0x7e')],_0x3d9154[_0x6336('0x7c')][_0x220ec6]['foreignTable'],_0x3d9154[_0x6336('0x7c')][_0x220ec6][_0x6336('0x80')]));}}}if(_0x3d9154[_0x6336('0x83')]){_0x3d9154[_0x6336('0x83')]=JSON[_0x6336('0x7d')](_0x3d9154[_0x6336('0x83')]);_0xb18a5a['where'](_0x191573(_0x3d9154[_0x6336('0x83')]['group']));}_0xb4b2a5=_0xb18a5a[_0x6336('0x84')]();_0xb18a5a['limit'](_0x45db61);_0xb18a5a['offset'](0x0);logger[_0x6336('0x85')](_0x6336('0x86'),_0xb18a5a['toString']());return db[_0x6336('0x87')][_0x6336('0x33')](_0xb18a5a['toString'](),{'type':db[_0x6336('0x87')][_0x6336('0x88')]['SELECT']});}})['then'](respondWithResult(_0x4cbd8b,null))['catch'](handleError(_0x4cbd8b,null));};function runReport(_0x17848e,_0x1f1025,_0x1bffbd){var _0x3edc16=_0x1f1025[_0x6336('0x2b')];var _0x5cab2b=0xa;var _0x274ab4=[_0x6336('0x56'),'left_join',_0x6336('0x89'),'cross_join'];var _0x5624a3={'SUM':_0x6336('0x59'),'COUNT':_0x6336('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x6336('0x5c'),'MIN':_0x6336('0x5d'),'AVG':_0x6336('0x5e'),'GROUP_CONCAT':_0x6336('0x8a'),'GROUP_CONCAT ASC':_0x6336('0x5f'),'GROUP_CONCAT DESC':_0x6336('0x60')};var _0x59adc3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x6336('0x62'),'ROUND':_0x6336('0x63'),'UNIX_TIMESTAMP':_0x6336('0x64')};var _0x1db8c7=function(_0x1f4fa8){return!_[_0x6336('0x65')](['IS\x20NULL',_0x6336('0x67'),_0x6336('0x68'),'IS\x20NOT\x20EMPTY'],_0x1f4fa8);};var _0x4a0e4f=function(_0xa9a9e7){if(!_0xa9a9e7||!_0xa9a9e7[_0x6336('0x6a')][_0x6336('0x4a')]){return'';}for(var _0x14e6d8='(',_0x4839ed=0x0;_0x4839ed<_0xa9a9e7['rules'][_0x6336('0x4a')];_0x4839ed+=0x1){_0x4839ed>0x0&&(_0x14e6d8+='\x20'+_0xa9a9e7[_0x6336('0x6b')]+'\x20');_0x14e6d8+=_0xa9a9e7[_0x6336('0x6a')][_0x4839ed][_0x6336('0x6c')]?_0x4a0e4f(_0xa9a9e7[_0x6336('0x6a')][_0x4839ed][_0x6336('0x6c')]):_0xa9a9e7[_0x6336('0x6a')][_0x4839ed]['field']+'\x20'+_0xa9a9e7['rules'][_0x4839ed]['condition']+(_0x1db8c7(_0xa9a9e7['rules'][_0x4839ed][_0x6336('0x8b')])?'\x20'+_0xa9a9e7[_0x6336('0x6a')][_0x4839ed][_0x6336('0x6e')]:'');}return _0x14e6d8+')';};var _0x46aaf1={'where':{'id':_0x17848e['id']}},_0xd8bc76,_0x4a724d,_0x25fd49,_0x41a7cd,_0x488001;_0x46aaf1=_[_0x6336('0x40')]({},_0x46aaf1,_0x1bffbd);return db[_0x6336('0x2f')]['find'](_0x46aaf1)['then'](function(_0xc8df25){if(_0xc8df25){_0xd8bc76=_0xc8df25;return _0xc8df25[_0x6336('0x6f')]();}return null;})[_0x6336('0x23')](function(_0xb44adf){if(_0xb44adf){if(!_0xb44adf[_0x6336('0x4a')]){throw new db[(_0x6336('0x70'))][(_0x6336('0x71'))](_0x6336('0x72'),0x193);}_0x4a724d=_0xb44adf;return db[_0x6336('0x8c')][_0x6336('0x44')]({'raw':!![]});}return null;})[_0x6336('0x23')](function(_0x1c3195){if(_0x1c3195){_0x25fd49=_[_0x6336('0x8d')](_0x1c3195,'id');var _0x20da65;var _0x491882=squel[_0x6336('0x8e')]();_0x491882[_0x6336('0x73')](_0xd8bc76[_0x6336('0x82')]);for(var _0x5ceaf5=0x0;_0x5ceaf5<_0x4a724d[_0x6336('0x4a')];_0x5ceaf5+=0x1){_0x20da65=_0x4a724d[_0x5ceaf5]['MetricId']?_0x25fd49[_0x4a724d[_0x5ceaf5][_0x6336('0x74')]][_0x6336('0x8f')]:_0x4a724d[_0x5ceaf5][_0x6336('0x6d')];_0x20da65=_0x4a724d[_0x5ceaf5]['function']?_['replace'](_0x5624a3[_0x4a724d[_0x5ceaf5][_0x6336('0x75')]],'%s',_0x20da65):_0x20da65;_0x20da65=_0x4a724d[_0x5ceaf5]['format']?_[_0x6336('0x76')](_0x59adc3[_0x4a724d[_0x5ceaf5]['format']],'%s',_0x20da65):_0x20da65;if(_0x4a724d[_0x5ceaf5][_0x6336('0x78')]){_0x491882[_0x6336('0x6c')](_0x20da65);}_0x4a724d[_0x5ceaf5][_0x6336('0x79')]&&_0x491882['order'](_0x20da65,_0x4a724d[_0x5ceaf5][_0x6336('0x79')]===_0x6336('0x7a')?![]:!![]);_0x491882['field'](_0x20da65,_0x4a724d[_0x5ceaf5][_0x6336('0x7b')]||_0x20da65);}if(_0xd8bc76[_0x6336('0x7c')]){_0xd8bc76[_0x6336('0x7c')]=JSON[_0x6336('0x7d')](_0xd8bc76[_0x6336('0x7c')]);for(var _0x3be0cf=0x0;_0x3be0cf<_0xd8bc76[_0x6336('0x7c')][_0x6336('0x4a')];_0x3be0cf+=0x1){if(_0xd8bc76[_0x6336('0x7c')][_0x3be0cf]['type']&&_[_0x6336('0x65')](_0x274ab4,_0xd8bc76[_0x6336('0x7c')][_0x3be0cf][_0x6336('0x30')])&&_0xd8bc76[_0x6336('0x7c')][_0x3be0cf]['parentKey']&&_0xd8bc76[_0x6336('0x7c')][_0x3be0cf][_0x6336('0x7f')]&&_0xd8bc76[_0x6336('0x7c')][_0x3be0cf][_0x6336('0x80')]){_0x491882[_0xd8bc76[_0x6336('0x7c')][_0x3be0cf][_0x6336('0x30')]](_0xd8bc76[_0x6336('0x7c')][_0x3be0cf][_0x6336('0x7f')],null,util['format'](_0x6336('0x81'),_0xd8bc76['table'],_0xd8bc76[_0x6336('0x7c')][_0x3be0cf]['parentKey'],_0xd8bc76[_0x6336('0x7c')][_0x3be0cf]['foreignTable'],_0xd8bc76[_0x6336('0x7c')][_0x3be0cf][_0x6336('0x80')]));}}}if(_0xd8bc76[_0x6336('0x83')]){_0xd8bc76[_0x6336('0x83')]=JSON[_0x6336('0x7d')](_0xd8bc76[_0x6336('0x83')]);_0x491882['where'](_0x4a0e4f(_0xd8bc76[_0x6336('0x83')][_0x6336('0x6c')]));}_0x488001=_0x491882[_0x6336('0x84')]();_0x491882[_0x6336('0x1e')](_0x5cab2b);_0x491882[_0x6336('0x1d')](0x0);logger[_0x6336('0x85')]('Limited\x20Query:',_0x491882[_0x6336('0x90')]());return db[_0x6336('0x87')]['query'](_0x491882[_0x6336('0x90')](),{'type':db[_0x6336('0x87')]['QueryTypes'][_0x6336('0x91')]});}})[_0x6336('0x23')](function(_0x144c48){if(!_0x144c48[_0x6336('0x4a')]){throw new db['Sequelize'][(_0x6336('0x71'))](_0x6336('0x92'),0xcc);}if(_0x1f1025[_0x6336('0x93')]===_0x6336('0x94')){return null;}var _0x54ab44=_[_0x6336('0x40')](_0x1f1025,{'name':_0x1f1025['fullPath']||_0x1f1025[_0x6336('0x2b')]||_0xd8bc76['name'],'basename':_0x3edc16,'savename':util[_0x6336('0x77')]('%s-%s.%s',_0x1f1025[_0x6336('0x2b')]||_0xd8bc76['name'],require(_0x6336('0x95'))[_0x6336('0x96')](0x4),_0x1f1025[_0x6336('0x93')]||_0x6336('0x97')),'reportId':_0xd8bc76['id'],'reportType':_0x6336('0x98')});return db[_0x6336('0x99')][_0x6336('0x4b')](_0x54ab44,{'raw':!![]});})[_0x6336('0x23')](function(_0x30e1a0){if(_0xd8bc76[_0x6336('0x82')]===_0x6336('0x9a')){_0x488001['where'](_0xd8bc76[_0x6336('0x82')]+_0x6336('0x9b'),_0x1f1025[_0x6336('0x9c')],_0x1f1025['endDate']);}else{_0x488001['where'](_0xd8bc76[_0x6336('0x82')]+_0x6336('0x9d'),_0x1f1025[_0x6336('0x9c')],_0x1f1025[_0x6336('0x9e')]);}if(_0x30e1a0){logger[_0x6336('0x9f')](_0x6336('0xa0'),_0x488001[_0x6336('0x90')]());require(_0x6336('0xa1'))[_0x6336('0xa2')](path[_0x6336('0x56')](__dirname,_0x6336('0xa3'),_0x30e1a0[_0x6336('0x93')]),[_0x30e1a0['id'],_0x488001['toString'](),path[_0x6336('0x56')](__dirname,_0x6336('0xa4'),_0x30e1a0[_0x6336('0xa5')]),_0x3edc16]);return _0x30e1a0;}else{var _0x26ff50=squel[_0x6336('0x8e')]();_0x26ff50[_0x6336('0x73')]('('+_0x488001[_0x6336('0x90')]()+')',_0x6336('0xa6'));_0x26ff50['field'](_0x6336('0xa7'),_0x6336('0x1c'));_0x488001[_0x6336('0x1e')](_0x1f1025[_0x6336('0x1e')]||_0x5cab2b);_0x488001[_0x6336('0x1d')](_0x1f1025['offset']||0x0);return db[_0x6336('0x87')][_0x6336('0x33')](_0x26ff50[_0x6336('0x90')](),{'type':db['sequelize'][_0x6336('0x88')]['SELECT']})[_0x6336('0x23')](function(_0x3b4822){if(!_0x3b4822[_0x6336('0x4a')]){_0x41a7cd=0x0;}else{_0x41a7cd=_0x3b4822[0x0]['count']||0x0;}return db[_0x6336('0x87')][_0x6336('0x33')](_0x488001[_0x6336('0x90')](),{'type':db[_0x6336('0x87')]['QueryTypes'][_0x6336('0x91')]});})[_0x6336('0x23')](function(_0x4595d0){return{'rows':_0x4595d0||[],'count':_0x41a7cd};});}});}exports[_0x6336('0xa8')]=function(_0x2cca95,_0x3307f2){return runReport(_0x2cca95['params'],_0x2cca95[_0x6336('0x33')],_0x2cca95[_0x6336('0x41')])[_0x6336('0x23')](respondWithResult(_0x3307f2,null))['catch'](handleError(_0x3307f2,null));};exports[_0x6336('0xa9')]=runReport;exports[_0x6336('0x33')]=function(_0x3d94cd,_0x5a760b){var _0x28336d=0xa;var _0x17f78d=['join',_0x6336('0x57'),'right_join',_0x6336('0x58')];var _0x158993={'SUM':'SUM(%s)','COUNT':_0x6336('0x5a'),'COUNT DISTINCT':_0x6336('0x5b'),'MAX':_0x6336('0x5c'),'MIN':_0x6336('0x5d'),'AVG':_0x6336('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6336('0x60')};var _0x8859c8={'SEC_TO_TIME':_0x6336('0x61'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x6336('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x47379a=function(_0x19548d){return!_['includes']([_0x6336('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x6336('0x69')],_0x19548d);};var _0x49f0f2=function(_0x4272ea){if(!_0x4272ea||!_0x4272ea[_0x6336('0x6a')]['length']){return'';}for(var _0x3ae3d0='(',_0x27ad79=0x0;_0x27ad79<_0x4272ea[_0x6336('0x6a')][_0x6336('0x4a')];_0x27ad79+=0x1){_0x27ad79>0x0&&(_0x3ae3d0+='\x20'+_0x4272ea[_0x6336('0x6b')]+'\x20');_0x3ae3d0+=_0x4272ea[_0x6336('0x6a')][_0x27ad79][_0x6336('0x6c')]?_0x49f0f2(_0x4272ea[_0x6336('0x6a')][_0x27ad79][_0x6336('0x6c')]):_0x4272ea[_0x6336('0x6a')][_0x27ad79][_0x6336('0x6d')]+'\x20'+_0x4272ea[_0x6336('0x6a')][_0x27ad79][_0x6336('0x8b')]+(_0x47379a(_0x4272ea[_0x6336('0x6a')][_0x27ad79][_0x6336('0x8b')])?'\x20'+_0x4272ea[_0x6336('0x6a')][_0x27ad79]['value']:'');}return _0x3ae3d0+')';};var _0x5e719b={'where':{'id':_0x3d94cd[_0x6336('0x48')]['id']}},_0x50b739,_0x389881,_0x1a9fe1,_0x552c8e,_0x342329;_0x5e719b=_[_0x6336('0x40')]({},_0x5e719b,_0x3d94cd[_0x6336('0x41')]);return db[_0x6336('0x2f')]['find'](_0x5e719b)[_0x6336('0x23')](function(_0x39c3e1){if(_0x39c3e1){_0x50b739=_0x39c3e1;return _0x39c3e1[_0x6336('0x6f')]();}return null;})[_0x6336('0x23')](function(_0x293e60){if(_0x293e60){if(!_0x293e60[_0x6336('0x4a')]){throw new db[(_0x6336('0x70'))][(_0x6336('0x71'))](_0x6336('0x72'),0x193);}_0x389881=_0x293e60;return db[_0x6336('0x8c')][_0x6336('0x44')]({'raw':!![]});}return null;})[_0x6336('0x23')](function(_0x5b15bd){if(_0x5b15bd){_0x1a9fe1=_['keyBy'](_0x5b15bd,'id');var _0x229bef;var _0x2dd1a3=squel[_0x6336('0x8e')]();_0x2dd1a3[_0x6336('0x73')](_0x50b739[_0x6336('0x82')]);for(var _0x43151c=0x0;_0x43151c<_0x389881[_0x6336('0x4a')];_0x43151c+=0x1){_0x229bef=_0x389881[_0x43151c]['MetricId']?_0x1a9fe1[_0x389881[_0x43151c][_0x6336('0x74')]][_0x6336('0x8f')]:_0x389881[_0x43151c][_0x6336('0x6d')];_0x229bef=_0x389881[_0x43151c][_0x6336('0x75')]?_[_0x6336('0x76')](_0x158993[_0x389881[_0x43151c][_0x6336('0x75')]],'%s',_0x229bef):_0x229bef;_0x229bef=_0x389881[_0x43151c][_0x6336('0x77')]?_[_0x6336('0x76')](_0x8859c8[_0x389881[_0x43151c]['format']],'%s',_0x229bef):_0x229bef;if(_0x389881[_0x43151c][_0x6336('0x78')]){_0x2dd1a3[_0x6336('0x6c')](_0x229bef);}_0x389881[_0x43151c][_0x6336('0x79')]&&_0x2dd1a3[_0x6336('0x3b')](_0x229bef,_0x389881[_0x43151c]['orderBy']===_0x6336('0x7a')?![]:!![]);_0x2dd1a3[_0x6336('0x6d')](_0x229bef,_0x389881[_0x43151c]['alias']||_0x229bef);}if(_0x50b739[_0x6336('0x7c')]){_0x50b739[_0x6336('0x7c')]=JSON[_0x6336('0x7d')](_0x50b739[_0x6336('0x7c')]);for(var _0x378a5a=0x0;_0x378a5a<_0x50b739[_0x6336('0x7c')]['length'];_0x378a5a+=0x1){if(_0x50b739[_0x6336('0x7c')][_0x378a5a][_0x6336('0x30')]&&_[_0x6336('0x65')](_0x17f78d,_0x50b739[_0x6336('0x7c')][_0x378a5a][_0x6336('0x30')])&&_0x50b739[_0x6336('0x7c')][_0x378a5a][_0x6336('0x7e')]&&_0x50b739[_0x6336('0x7c')][_0x378a5a][_0x6336('0x7f')]&&_0x50b739[_0x6336('0x7c')][_0x378a5a]['foreignKey']){_0x2dd1a3[_0x50b739[_0x6336('0x7c')][_0x378a5a][_0x6336('0x30')]](_0x50b739[_0x6336('0x7c')][_0x378a5a][_0x6336('0x7f')],null,util[_0x6336('0x77')](_0x6336('0x81'),_0x50b739[_0x6336('0x82')],_0x50b739[_0x6336('0x7c')][_0x378a5a][_0x6336('0x7e')],_0x50b739[_0x6336('0x7c')][_0x378a5a][_0x6336('0x7f')],_0x50b739[_0x6336('0x7c')][_0x378a5a][_0x6336('0x80')]));}}}if(_0x50b739['conditions']){_0x50b739[_0x6336('0x83')]=JSON['parse'](_0x50b739[_0x6336('0x83')]);_0x2dd1a3[_0x6336('0x3f')](_0x49f0f2(_0x50b739[_0x6336('0x83')][_0x6336('0x6c')]));}_0x342329=_0x2dd1a3[_0x6336('0x84')]();_0x2dd1a3[_0x6336('0x1e')](_0x28336d);_0x2dd1a3[_0x6336('0x1d')](0x0);logger[_0x6336('0x85')]('Limited\x20Query:',_0x2dd1a3[_0x6336('0x90')]());return db[_0x6336('0x87')][_0x6336('0x33')](_0x2dd1a3[_0x6336('0x90')](),{'type':db['sequelize'][_0x6336('0x88')][_0x6336('0x91')]});}})[_0x6336('0x23')](function(){return{'sql':_0x342329[_0x6336('0x90')]()};})['then'](respondWithResult(_0x5a760b,null))[_0x6336('0x46')](handleError(_0x5a760b,null));}; \ No newline at end of file +var _0x54bb=['stack','name','send','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','AnalyticCustomReport','includeAll','include','catch','params','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','findAll','keyBy','from','table','MetricId','metric','field','function','replace','format','orderBy','alias','joins','parse','includes','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ROUND(%s)','AnalyticMetric','select','No\x20available\x20data','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','../../components/export/','output','../../files/reports','savename','COUNT(*)','run','Please\x20insert\x20at\x20least\x20one\x20field','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus'];(function(_0x4e90e3,_0x570a1d){var _0x295e5b=function(_0x754043){while(--_0x754043){_0x4e90e3['push'](_0x4e90e3['shift']());}};_0x295e5b(++_0x570a1d);}(_0x54bb,0x7c));var _0xb54b=function(_0x11963b,_0x5d2da7){_0x11963b=_0x11963b-0x0;var _0x5d451e=_0x54bb[_0x11963b];return _0x5d451e;};'use strict';var pdf=require(_0xb54b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb54b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb54b('0x2'));var rp=require(_0xb54b('0x3'));var moment=require(_0xb54b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb54b('0x5'));var util=require(_0xb54b('0x6'));var path=require('path');var sox=require(_0xb54b('0x7'));var csv=require('to-csv');var ejs=require(_0xb54b('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb54b('0x9'));var crypto=require('crypto');var jsforce=require(_0xb54b('0xa'));var deskjs=require(_0xb54b('0xb'));var toCsv=require(_0xb54b('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb54b('0xd'));var authService=require(_0xb54b('0xe'));var qs=require(_0xb54b('0xf'));var as=require(_0xb54b('0x10'));var hardwareService=require(_0xb54b('0x11'));var logger=require(_0xb54b('0x12'))(_0xb54b('0x13'));var utils=require(_0xb54b('0x14'));var config=require('../../config/environment');var db=require(_0xb54b('0x15'))['db'];function respondWithStatusCode(_0x4165ff,_0x36bd92){_0x36bd92=_0x36bd92||0xcc;return function(_0x4afee3){if(_0x4afee3){return _0x4165ff['sendStatus'](_0x36bd92);}return _0x4165ff['status'](_0x36bd92)[_0xb54b('0x16')]();};}function respondWithResult(_0xfd7437,_0x52cef2){_0x52cef2=_0x52cef2||0xc8;return function(_0x511a2d){if(_0x511a2d){return _0xfd7437[_0xb54b('0x17')](_0x52cef2)['json'](_0x511a2d);}};}function respondWithFilteredResult(_0x3a72a7,_0x5b4831){return function(_0x502d31){if(_0x502d31){var _0x32660b=_0x502d31[_0xb54b('0x18')],_0x3ace3c=_0x5b4831['offset'],_0x379d8f=_0x5b4831[_0xb54b('0x19')]+_0x5b4831[_0xb54b('0x1a')],_0x17861b;if(_0x379d8f>=_0x32660b){_0x379d8f=_0x32660b;_0x17861b=0xc8;}else{_0x17861b=0xce;}_0x3a72a7[_0xb54b('0x17')](_0x17861b);return _0x3a72a7[_0xb54b('0x1b')](_0xb54b('0x1c'),_0x3ace3c+'-'+_0x379d8f+'/'+_0x32660b)['json'](_0x502d31);}return null;};}function patchUpdates(_0x2e176d){return function(_0x4b5bc8){try{jsonpatch[_0xb54b('0x1d')](_0x4b5bc8,_0x2e176d,!![]);}catch(_0x49c964){return BPromise[_0xb54b('0x1e')](_0x49c964);}return _0x4b5bc8[_0xb54b('0x1f')]();};}function saveUpdates(_0x4c8dda,_0x2c8e95){return function(_0x52727e){if(_0x52727e){return _0x52727e[_0xb54b('0x20')](_0x4c8dda)[_0xb54b('0x21')](function(_0x3bd987){return _0x3bd987;});}return null;};}function removeEntity(_0x5be84b,_0x3e1a1e){return function(_0x48cc4c){if(_0x48cc4c){return _0x48cc4c[_0xb54b('0x22')]()[_0xb54b('0x21')](function(){var _0x4f8506=_0x48cc4c[_0xb54b('0x23')]({'plain':!![]});var _0xe60bc3='CustomReports';return db[_0xb54b('0x24')][_0xb54b('0x22')]({'where':{'type':_0xe60bc3,'resourceId':_0x4f8506['id']}})[_0xb54b('0x21')](function(){return _0x48cc4c;});})[_0xb54b('0x21')](function(){_0x5be84b[_0xb54b('0x17')](0xcc)[_0xb54b('0x16')]();});}};}function handleEntityNotFound(_0x3cf25a,_0x386c8e){return function(_0x230c54){if(!_0x230c54){_0x3cf25a[_0xb54b('0x25')](0x194);}return _0x230c54;};}function handleError(_0x5bbf60,_0x5f1f10){_0x5f1f10=_0x5f1f10||0x1f4;return function(_0x3781af){logger['error'](_0x3781af[_0xb54b('0x26')]);if(_0x3781af[_0xb54b('0x27')]){delete _0x3781af['name'];}_0x5bbf60['status'](_0x5f1f10)[_0xb54b('0x28')](_0x3781af);};}exports['index']=function(_0x45c514,_0x3c9669){var _0x2300df={},_0x3b0964={},_0x312f7e={'count':0x0,'rows':[]};var _0x414cdd=_[_0xb54b('0x29')](db['AnalyticCustomReport'][_0xb54b('0x2a')],function(_0x215ac5){return{'name':_0x215ac5[_0xb54b('0x2b')],'type':_0x215ac5[_0xb54b('0x2c')][_0xb54b('0x2d')]};});_0x3b0964['model']=_['map'](_0x414cdd,'name');_0x3b0964['query']=_['keys'](_0x45c514[_0xb54b('0x2e')]);_0x3b0964[_0xb54b('0x2f')]=_[_0xb54b('0x30')](_0x3b0964['model'],_0x3b0964[_0xb54b('0x2e')]);_0x2300df[_0xb54b('0x31')]=_[_0xb54b('0x30')](_0x3b0964['model'],qs[_0xb54b('0x32')](_0x45c514['query'][_0xb54b('0x32')]));_0x2300df[_0xb54b('0x31')]=_0x2300df[_0xb54b('0x31')][_0xb54b('0x33')]?_0x2300df[_0xb54b('0x31')]:_0x3b0964[_0xb54b('0x34')];if(!_0x45c514[_0xb54b('0x2e')][_0xb54b('0x35')](_0xb54b('0x36'))){_0x2300df['limit']=qs[_0xb54b('0x1a')](_0x45c514[_0xb54b('0x2e')]['limit']);_0x2300df[_0xb54b('0x19')]=qs[_0xb54b('0x19')](_0x45c514[_0xb54b('0x2e')][_0xb54b('0x19')]);}_0x2300df[_0xb54b('0x37')]=qs['sort'](_0x45c514['query'][_0xb54b('0x38')]);_0x2300df['where']=qs[_0xb54b('0x2f')](_['pick'](_0x45c514[_0xb54b('0x2e')],_0x3b0964['filters']));if(_0x45c514[_0xb54b('0x2e')][_0xb54b('0x39')]){_0x2300df[_0xb54b('0x3a')]=_['merge'](_0x2300df['where'],{'$or':_[_0xb54b('0x29')](_0x414cdd,function(_0x48404e){if(_0x48404e['type']!==_0xb54b('0x3b')){var _0x1f4e4a={};_0x1f4e4a[_0x48404e[_0xb54b('0x27')]]={'$like':'%'+_0x45c514[_0xb54b('0x2e')][_0xb54b('0x39')]+'%'};return _0x1f4e4a;}})});}_0x2300df=_[_0xb54b('0x3c')]({},_0x2300df,_0x45c514['options']);var _0x75d064={'where':_0x2300df['where']};return db[_0xb54b('0x3d')]['count'](_0x75d064)[_0xb54b('0x21')](function(_0x431e95){_0x312f7e[_0xb54b('0x18')]=_0x431e95;if(_0x45c514[_0xb54b('0x2e')][_0xb54b('0x3e')]){_0x2300df[_0xb54b('0x3f')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x2300df);})[_0xb54b('0x21')](function(_0x4ef66d){_0x312f7e['rows']=_0x4ef66d;return _0x312f7e;})[_0xb54b('0x21')](respondWithFilteredResult(_0x3c9669,_0x2300df))[_0xb54b('0x40')](handleError(_0x3c9669,null));};exports['show']=function(_0x11b52a,_0x22efea){var _0x43e92c={'raw':![],'where':{'id':_0x11b52a[_0xb54b('0x41')]['id']}},_0x48abe1={};_0x48abe1['model']=_[_0xb54b('0x42')](db[_0xb54b('0x3d')][_0xb54b('0x2a')]);_0x48abe1['query']=_['keys'](_0x11b52a['query']);_0x48abe1[_0xb54b('0x2f')]=_[_0xb54b('0x30')](_0x48abe1['model'],_0x48abe1[_0xb54b('0x2e')]);_0x43e92c[_0xb54b('0x31')]=_[_0xb54b('0x30')](_0x48abe1['model'],qs[_0xb54b('0x32')](_0x11b52a[_0xb54b('0x2e')][_0xb54b('0x32')]));_0x43e92c[_0xb54b('0x31')]=_0x43e92c['attributes'][_0xb54b('0x33')]?_0x43e92c[_0xb54b('0x31')]:_0x48abe1['model'];if(_0x11b52a[_0xb54b('0x2e')][_0xb54b('0x3e')]){_0x43e92c[_0xb54b('0x3f')]=[{'all':!![]}];}_0x43e92c=_[_0xb54b('0x3c')]({},_0x43e92c,_0x11b52a[_0xb54b('0x43')]);return db[_0xb54b('0x3d')][_0xb54b('0x44')](_0x43e92c)[_0xb54b('0x21')](handleEntityNotFound(_0x22efea,null))[_0xb54b('0x21')](respondWithResult(_0x22efea,null))[_0xb54b('0x40')](handleError(_0x22efea,null));};exports['create']=function(_0x5be37a,_0x7cbe37){return db['AnalyticCustomReport'][_0xb54b('0x45')](_0x5be37a['body'],{})[_0xb54b('0x21')](function(_0x37200d){var _0xe87dc7=_0x5be37a[_0xb54b('0x46')][_0xb54b('0x23')]({'plain':!![]});if(!_0xe87dc7)throw new Error(_0xb54b('0x47'));if(_0xe87dc7[_0xb54b('0x48')]==='user'){var _0x570f26=_0x37200d[_0xb54b('0x23')]({'plain':!![]});var _0x4d1b5a=_0xb54b('0x49');return db['UserProfileSection'][_0xb54b('0x44')]({'where':{'name':_0x4d1b5a,'userProfileId':_0xe87dc7[_0xb54b('0x4a')]},'raw':!![]})[_0xb54b('0x21')](function(_0x1653d0){if(_0x1653d0&&_0x1653d0[_0xb54b('0x4b')]===0x0){return db[_0xb54b('0x24')]['create']({'name':_0x570f26['name'],'resourceId':_0x570f26['id'],'type':_0xb54b('0x4c'),'sectionId':_0x1653d0['id']},{})['then'](function(){return _0x37200d;});}else{return _0x37200d;}})[_0xb54b('0x40')](function(_0x131993){logger[_0xb54b('0x4d')](_0xb54b('0x4e'),_0x131993);throw _0x131993;});}return _0x37200d;})['then'](respondWithResult(_0x7cbe37,0xc9))['catch'](handleError(_0x7cbe37,null));};exports[_0xb54b('0x20')]=function(_0xde9348,_0x55a99f){if(_0xde9348['body']['id']){delete _0xde9348['body']['id'];}return db[_0xb54b('0x3d')][_0xb54b('0x44')]({'where':{'id':_0xde9348[_0xb54b('0x41')]['id']}})['then'](handleEntityNotFound(_0x55a99f,null))[_0xb54b('0x21')](saveUpdates(_0xde9348[_0xb54b('0x4f')],null))[_0xb54b('0x21')](respondWithResult(_0x55a99f,null))[_0xb54b('0x40')](handleError(_0x55a99f,null));};exports[_0xb54b('0x22')]=function(_0x4d2ccf,_0x1caa95){return db['AnalyticCustomReport'][_0xb54b('0x44')]({'where':{'id':_0x4d2ccf[_0xb54b('0x41')]['id']}})[_0xb54b('0x21')](handleEntityNotFound(_0x1caa95,null))['then'](removeEntity(_0x1caa95,null))[_0xb54b('0x40')](handleError(_0x1caa95,null));};exports[_0xb54b('0x50')]=function(_0x26690e,_0xb67bd9){var _0x56485f=0xa;var _0x1e086b=[_0xb54b('0x51'),'left_join',_0xb54b('0x52'),_0xb54b('0x53')];var _0x1d055a={'SUM':_0xb54b('0x54'),'COUNT':_0xb54b('0x55'),'COUNT DISTINCT':_0xb54b('0x56'),'MAX':_0xb54b('0x57'),'MIN':_0xb54b('0x58'),'AVG':_0xb54b('0x59'),'GROUP_CONCAT':_0xb54b('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb54b('0x5b')};var _0x1a8b6b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb54b('0x5c'),'HOUR':_0xb54b('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb54b('0x5e')};var _0x13eb55=function(_0x510e5c){return!_['includes']([_0xb54b('0x5f'),_0xb54b('0x60'),_0xb54b('0x61'),_0xb54b('0x62')],_0x510e5c);};var _0x15ca3d=function(_0x5ce3ce){if(!_0x5ce3ce||!_0x5ce3ce['rules'][_0xb54b('0x33')]){return'';}for(var _0x34abdd='(',_0x52de06=0x0;_0x52de06<_0x5ce3ce[_0xb54b('0x63')][_0xb54b('0x33')];_0x52de06+=0x1){_0x52de06>0x0&&(_0x34abdd+='\x20'+_0x5ce3ce[_0xb54b('0x64')]+'\x20');_0x34abdd+=_0x5ce3ce[_0xb54b('0x63')][_0x52de06][_0xb54b('0x65')]?_0x15ca3d(_0x5ce3ce['rules'][_0x52de06][_0xb54b('0x65')]):_0x5ce3ce[_0xb54b('0x63')][_0x52de06]['field']+'\x20'+_0x5ce3ce[_0xb54b('0x63')][_0x52de06][_0xb54b('0x66')]+(_0x13eb55(_0x5ce3ce['rules'][_0x52de06][_0xb54b('0x66')])?'\x20'+_0x5ce3ce[_0xb54b('0x63')][_0x52de06][_0xb54b('0x67')]:'');}return _0x34abdd+')';};var _0x2248dd={'where':{'id':_0x26690e[_0xb54b('0x41')]['id']}},_0x51dd5d,_0xb761d5,_0x5f191d,_0xaa2a7e,_0x4dc513;_0x2248dd=_[_0xb54b('0x3c')]({},_0x2248dd,_0x26690e[_0xb54b('0x43')]);return db[_0xb54b('0x3d')][_0xb54b('0x44')](_0x2248dd)['then'](function(_0x46fd76){if(_0x46fd76){_0x51dd5d=_0x46fd76;return _0x46fd76[_0xb54b('0x68')]();}return null;})['then'](function(_0x2af366){if(_0x2af366){if(!_0x2af366[_0xb54b('0x33')]){throw new db[(_0xb54b('0x69'))][(_0xb54b('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xb761d5=_0x2af366;return db['AnalyticMetric'][_0xb54b('0x6b')]({'raw':!![]});}return null;})[_0xb54b('0x21')](function(_0x127d66){if(_0x127d66){_0x5f191d=_[_0xb54b('0x6c')](_0x127d66,'id');var _0x430b7d;var _0x54ad90=squel['select']();_0x54ad90[_0xb54b('0x6d')](_0x51dd5d[_0xb54b('0x6e')]);for(var _0x59acf1=0x0;_0x59acf1<_0xb761d5[_0xb54b('0x33')];_0x59acf1+=0x1){_0x430b7d=_0xb761d5[_0x59acf1][_0xb54b('0x6f')]?_0x5f191d[_0xb761d5[_0x59acf1]['MetricId']][_0xb54b('0x70')]:_0xb761d5[_0x59acf1][_0xb54b('0x71')];_0x430b7d=_0xb761d5[_0x59acf1][_0xb54b('0x72')]?_[_0xb54b('0x73')](_0x1d055a[_0xb761d5[_0x59acf1][_0xb54b('0x72')]],'%s',_0x430b7d):_0x430b7d;_0x430b7d=_0xb761d5[_0x59acf1]['format']?_[_0xb54b('0x73')](_0x1a8b6b[_0xb761d5[_0x59acf1][_0xb54b('0x74')]],'%s',_0x430b7d):_0x430b7d;if(_0xb761d5[_0x59acf1]['groupBy']){_0x54ad90[_0xb54b('0x65')](_0x430b7d);}_0xb761d5[_0x59acf1][_0xb54b('0x75')]&&_0x54ad90[_0xb54b('0x37')](_0x430b7d,_0xb761d5[_0x59acf1]['orderBy']==='DESC'?![]:!![]);_0x54ad90[_0xb54b('0x71')](_0x430b7d,_0xb761d5[_0x59acf1][_0xb54b('0x76')]||_0x430b7d);}if(_0x51dd5d['joins']){_0x51dd5d[_0xb54b('0x77')]=JSON[_0xb54b('0x78')](_0x51dd5d[_0xb54b('0x77')]);for(var _0x504af1=0x0;_0x504af1<_0x51dd5d[_0xb54b('0x77')][_0xb54b('0x33')];_0x504af1+=0x1){if(_0x51dd5d[_0xb54b('0x77')][_0x504af1][_0xb54b('0x2c')]&&_[_0xb54b('0x79')](_0x1e086b,_0x51dd5d[_0xb54b('0x77')][_0x504af1][_0xb54b('0x2c')])&&_0x51dd5d[_0xb54b('0x77')][_0x504af1][_0xb54b('0x7a')]&&_0x51dd5d[_0xb54b('0x77')][_0x504af1]['foreignTable']&&_0x51dd5d[_0xb54b('0x77')][_0x504af1][_0xb54b('0x7b')]){_0x54ad90[_0x51dd5d[_0xb54b('0x77')][_0x504af1]['type']](_0x51dd5d['joins'][_0x504af1][_0xb54b('0x7c')],null,util[_0xb54b('0x74')](_0xb54b('0x7d'),_0x51dd5d[_0xb54b('0x6e')],_0x51dd5d['joins'][_0x504af1]['parentKey'],_0x51dd5d['joins'][_0x504af1][_0xb54b('0x7c')],_0x51dd5d[_0xb54b('0x77')][_0x504af1][_0xb54b('0x7b')]));}}}if(_0x51dd5d[_0xb54b('0x7e')]){_0x51dd5d[_0xb54b('0x7e')]=JSON['parse'](_0x51dd5d[_0xb54b('0x7e')]);_0x54ad90[_0xb54b('0x3a')](_0x15ca3d(_0x51dd5d[_0xb54b('0x7e')][_0xb54b('0x65')]));}_0x4dc513=_0x54ad90[_0xb54b('0x7f')]();_0x54ad90[_0xb54b('0x1a')](_0x56485f);_0x54ad90['offset'](0x0);logger[_0xb54b('0x80')](_0xb54b('0x81'),_0x54ad90[_0xb54b('0x82')]());return db[_0xb54b('0x83')][_0xb54b('0x2e')](_0x54ad90[_0xb54b('0x82')](),{'type':db[_0xb54b('0x83')][_0xb54b('0x84')][_0xb54b('0x85')]});}})[_0xb54b('0x21')](respondWithResult(_0xb67bd9,null))[_0xb54b('0x40')](handleError(_0xb67bd9,null));};function runReport(_0x27c31e,_0x3b32dc,_0x1005b3){var _0x326dba=_0x3b32dc[_0xb54b('0x27')];var _0x138faf=0xa;var _0x42338b=['join',_0xb54b('0x86'),_0xb54b('0x52'),_0xb54b('0x53')];var _0x37e226={'SUM':_0xb54b('0x54'),'COUNT':_0xb54b('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb54b('0x57'),'MIN':_0xb54b('0x58'),'AVG':_0xb54b('0x59'),'GROUP_CONCAT':_0xb54b('0x5a'),'GROUP_CONCAT ASC':_0xb54b('0x87'),'GROUP_CONCAT DESC':_0xb54b('0x5b')};var _0x57beb8={'SEC_TO_TIME':_0xb54b('0x88'),'DATE':_0xb54b('0x5c'),'HOUR':_0xb54b('0x5d'),'ROUND':_0xb54b('0x89'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc504be=function(_0x2dc0c3){return!_[_0xb54b('0x79')]([_0xb54b('0x5f'),'IS\x20NOT\x20NULL',_0xb54b('0x61'),_0xb54b('0x62')],_0x2dc0c3);};var _0x1a5000=function(_0x248b20){if(!_0x248b20||!_0x248b20[_0xb54b('0x63')][_0xb54b('0x33')]){return'';}for(var _0x33fd70='(',_0x49c78c=0x0;_0x49c78c<_0x248b20[_0xb54b('0x63')]['length'];_0x49c78c+=0x1){_0x49c78c>0x0&&(_0x33fd70+='\x20'+_0x248b20[_0xb54b('0x64')]+'\x20');_0x33fd70+=_0x248b20[_0xb54b('0x63')][_0x49c78c][_0xb54b('0x65')]?_0x1a5000(_0x248b20[_0xb54b('0x63')][_0x49c78c][_0xb54b('0x65')]):_0x248b20[_0xb54b('0x63')][_0x49c78c]['field']+'\x20'+_0x248b20[_0xb54b('0x63')][_0x49c78c][_0xb54b('0x66')]+(_0xc504be(_0x248b20[_0xb54b('0x63')][_0x49c78c][_0xb54b('0x66')])?'\x20'+_0x248b20['rules'][_0x49c78c][_0xb54b('0x67')]:'');}return _0x33fd70+')';};var _0x5f013a={'where':{'id':_0x27c31e['id']}},_0x1bbd1b,_0x557713,_0x1e091f,_0x119584,_0xf41b8e;_0x5f013a=_[_0xb54b('0x3c')]({},_0x5f013a,_0x1005b3);return db['AnalyticCustomReport'][_0xb54b('0x44')](_0x5f013a)[_0xb54b('0x21')](function(_0x1e584e){if(_0x1e584e){_0x1bbd1b=_0x1e584e;return _0x1e584e[_0xb54b('0x68')]();}return null;})[_0xb54b('0x21')](function(_0x46d099){if(_0x46d099){if(!_0x46d099[_0xb54b('0x33')]){throw new db[(_0xb54b('0x69'))][(_0xb54b('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x557713=_0x46d099;return db[_0xb54b('0x8a')]['findAll']({'raw':!![]});}return null;})[_0xb54b('0x21')](function(_0x3ec49f){if(_0x3ec49f){_0x1e091f=_[_0xb54b('0x6c')](_0x3ec49f,'id');var _0x325ae2;var _0x30a6ff=squel[_0xb54b('0x8b')]();_0x30a6ff[_0xb54b('0x6d')](_0x1bbd1b['table']);for(var _0x1868c2=0x0;_0x1868c2<_0x557713[_0xb54b('0x33')];_0x1868c2+=0x1){_0x325ae2=_0x557713[_0x1868c2][_0xb54b('0x6f')]?_0x1e091f[_0x557713[_0x1868c2][_0xb54b('0x6f')]][_0xb54b('0x70')]:_0x557713[_0x1868c2][_0xb54b('0x71')];_0x325ae2=_0x557713[_0x1868c2]['function']?_[_0xb54b('0x73')](_0x37e226[_0x557713[_0x1868c2][_0xb54b('0x72')]],'%s',_0x325ae2):_0x325ae2;_0x325ae2=_0x557713[_0x1868c2][_0xb54b('0x74')]?_[_0xb54b('0x73')](_0x57beb8[_0x557713[_0x1868c2]['format']],'%s',_0x325ae2):_0x325ae2;if(_0x557713[_0x1868c2]['groupBy']){_0x30a6ff[_0xb54b('0x65')](_0x325ae2);}_0x557713[_0x1868c2]['orderBy']&&_0x30a6ff[_0xb54b('0x37')](_0x325ae2,_0x557713[_0x1868c2][_0xb54b('0x75')]==='DESC'?![]:!![]);_0x30a6ff[_0xb54b('0x71')](_0x325ae2,_0x557713[_0x1868c2][_0xb54b('0x76')]||_0x325ae2);}if(_0x1bbd1b[_0xb54b('0x77')]){_0x1bbd1b[_0xb54b('0x77')]=JSON[_0xb54b('0x78')](_0x1bbd1b['joins']);for(var _0x2d61b9=0x0;_0x2d61b9<_0x1bbd1b[_0xb54b('0x77')][_0xb54b('0x33')];_0x2d61b9+=0x1){if(_0x1bbd1b[_0xb54b('0x77')][_0x2d61b9]['type']&&_[_0xb54b('0x79')](_0x42338b,_0x1bbd1b[_0xb54b('0x77')][_0x2d61b9][_0xb54b('0x2c')])&&_0x1bbd1b[_0xb54b('0x77')][_0x2d61b9][_0xb54b('0x7a')]&&_0x1bbd1b[_0xb54b('0x77')][_0x2d61b9][_0xb54b('0x7c')]&&_0x1bbd1b[_0xb54b('0x77')][_0x2d61b9][_0xb54b('0x7b')]){_0x30a6ff[_0x1bbd1b['joins'][_0x2d61b9][_0xb54b('0x2c')]](_0x1bbd1b[_0xb54b('0x77')][_0x2d61b9][_0xb54b('0x7c')],null,util[_0xb54b('0x74')](_0xb54b('0x7d'),_0x1bbd1b[_0xb54b('0x6e')],_0x1bbd1b['joins'][_0x2d61b9][_0xb54b('0x7a')],_0x1bbd1b[_0xb54b('0x77')][_0x2d61b9]['foreignTable'],_0x1bbd1b[_0xb54b('0x77')][_0x2d61b9][_0xb54b('0x7b')]));}}}if(_0x1bbd1b[_0xb54b('0x7e')]){_0x1bbd1b[_0xb54b('0x7e')]=JSON[_0xb54b('0x78')](_0x1bbd1b['conditions']);_0x30a6ff[_0xb54b('0x3a')](_0x1a5000(_0x1bbd1b[_0xb54b('0x7e')][_0xb54b('0x65')]));}_0xf41b8e=_0x30a6ff[_0xb54b('0x7f')]();_0x30a6ff[_0xb54b('0x1a')](_0x138faf);_0x30a6ff[_0xb54b('0x19')](0x0);logger[_0xb54b('0x80')](_0xb54b('0x81'),_0x30a6ff[_0xb54b('0x82')]());return db[_0xb54b('0x83')][_0xb54b('0x2e')](_0x30a6ff[_0xb54b('0x82')](),{'type':db[_0xb54b('0x83')][_0xb54b('0x84')][_0xb54b('0x85')]});}})[_0xb54b('0x21')](function(_0x307512){if(!_0x307512['length']){throw new db[(_0xb54b('0x69'))][(_0xb54b('0x6a'))](_0xb54b('0x8c'),0xcc);}if(_0x3b32dc['output']===_0xb54b('0x8d')){return null;}var _0xb5267a=_['merge'](_0x3b32dc,{'name':_0x3b32dc[_0xb54b('0x8e')]||_0x3b32dc[_0xb54b('0x27')]||_0x1bbd1b['name'],'basename':_0x326dba,'savename':util[_0xb54b('0x74')](_0xb54b('0x8f'),_0x3b32dc[_0xb54b('0x27')]||_0x1bbd1b[_0xb54b('0x27')],require(_0xb54b('0x90'))[_0xb54b('0x91')](0x4),_0x3b32dc['output']||_0xb54b('0x92')),'reportId':_0x1bbd1b['id'],'reportType':_0xb54b('0x93')});return db['AnalyticExtractedReport'][_0xb54b('0x45')](_0xb5267a,{'raw':!![]});})[_0xb54b('0x21')](function(_0x1c678a){if(_0x1bbd1b[_0xb54b('0x6e')]===_0xb54b('0x94')){_0xf41b8e[_0xb54b('0x3a')](_0x1bbd1b[_0xb54b('0x6e')]+_0xb54b('0x95'),_0x3b32dc[_0xb54b('0x96')],_0x3b32dc[_0xb54b('0x97')]);}else{_0xf41b8e[_0xb54b('0x3a')](_0x1bbd1b[_0xb54b('0x6e')]+_0xb54b('0x98'),_0x3b32dc['startDate'],_0x3b32dc['endDate']);}if(_0x1c678a){logger[_0xb54b('0x99')](_0xb54b('0x9a'),_0xf41b8e['toString']());require('child_process')['fork'](path[_0xb54b('0x51')](__dirname,_0xb54b('0x9b'),_0x1c678a[_0xb54b('0x9c')]),[_0x1c678a['id'],_0xf41b8e[_0xb54b('0x82')](),path[_0xb54b('0x51')](__dirname,_0xb54b('0x9d'),_0x1c678a[_0xb54b('0x9e')]),_0x326dba]);return _0x1c678a;}else{var _0x58ac8b=squel['select']();_0x58ac8b[_0xb54b('0x6d')]('('+_0xf41b8e[_0xb54b('0x82')]()+')','countTable');_0x58ac8b[_0xb54b('0x71')](_0xb54b('0x9f'),'count');_0xf41b8e['limit'](_0x3b32dc[_0xb54b('0x1a')]||_0x138faf);_0xf41b8e['offset'](_0x3b32dc[_0xb54b('0x19')]||0x0);return db[_0xb54b('0x83')][_0xb54b('0x2e')](_0x58ac8b[_0xb54b('0x82')](),{'type':db[_0xb54b('0x83')][_0xb54b('0x84')]['SELECT']})[_0xb54b('0x21')](function(_0x2bca00){if(!_0x2bca00[_0xb54b('0x33')]){_0x119584=0x0;}else{_0x119584=_0x2bca00[0x0]['count']||0x0;}return db['sequelize'][_0xb54b('0x2e')](_0xf41b8e[_0xb54b('0x82')](),{'type':db[_0xb54b('0x83')][_0xb54b('0x84')][_0xb54b('0x85')]});})[_0xb54b('0x21')](function(_0x4ac86c){return{'rows':_0x4ac86c||[],'count':_0x119584};});}});}exports[_0xb54b('0xa0')]=function(_0x269eba,_0x51909e){return runReport(_0x269eba[_0xb54b('0x41')],_0x269eba[_0xb54b('0x2e')],_0x269eba[_0xb54b('0x43')])[_0xb54b('0x21')](respondWithResult(_0x51909e,null))[_0xb54b('0x40')](handleError(_0x51909e,null));};exports['runReport']=runReport;exports[_0xb54b('0x2e')]=function(_0x3307d1,_0x3c7ef5){var _0x11bd34=0xa;var _0xf01f59=[_0xb54b('0x51'),_0xb54b('0x86'),_0xb54b('0x52'),_0xb54b('0x53')];var _0x54485d={'SUM':_0xb54b('0x54'),'COUNT':_0xb54b('0x55'),'COUNT DISTINCT':_0xb54b('0x56'),'MAX':_0xb54b('0x57'),'MIN':_0xb54b('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb54b('0x87'),'GROUP_CONCAT DESC':_0xb54b('0x5b')};var _0x39ff73={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xb54b('0x5d'),'ROUND':_0xb54b('0x89'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2f20c3=function(_0x74aa89){return!_[_0xb54b('0x79')]([_0xb54b('0x5f'),_0xb54b('0x60'),_0xb54b('0x61'),_0xb54b('0x62')],_0x74aa89);};var _0x1b0961=function(_0x1f9c86){if(!_0x1f9c86||!_0x1f9c86[_0xb54b('0x63')][_0xb54b('0x33')]){return'';}for(var _0xf50939='(',_0x4085ce=0x0;_0x4085ce<_0x1f9c86[_0xb54b('0x63')][_0xb54b('0x33')];_0x4085ce+=0x1){_0x4085ce>0x0&&(_0xf50939+='\x20'+_0x1f9c86['operator']+'\x20');_0xf50939+=_0x1f9c86[_0xb54b('0x63')][_0x4085ce][_0xb54b('0x65')]?_0x1b0961(_0x1f9c86[_0xb54b('0x63')][_0x4085ce][_0xb54b('0x65')]):_0x1f9c86[_0xb54b('0x63')][_0x4085ce]['field']+'\x20'+_0x1f9c86[_0xb54b('0x63')][_0x4085ce][_0xb54b('0x66')]+(_0x2f20c3(_0x1f9c86[_0xb54b('0x63')][_0x4085ce][_0xb54b('0x66')])?'\x20'+_0x1f9c86[_0xb54b('0x63')][_0x4085ce][_0xb54b('0x67')]:'');}return _0xf50939+')';};var _0x2b0134={'where':{'id':_0x3307d1[_0xb54b('0x41')]['id']}},_0x53fcec,_0x3c9a21,_0x27290c,_0x4e2daf,_0x28b91f;_0x2b0134=_[_0xb54b('0x3c')]({},_0x2b0134,_0x3307d1[_0xb54b('0x43')]);return db[_0xb54b('0x3d')][_0xb54b('0x44')](_0x2b0134)[_0xb54b('0x21')](function(_0x36b978){if(_0x36b978){_0x53fcec=_0x36b978;return _0x36b978['getFields']();}return null;})[_0xb54b('0x21')](function(_0xfb16c3){if(_0xfb16c3){if(!_0xfb16c3['length']){throw new db[(_0xb54b('0x69'))][(_0xb54b('0x6a'))](_0xb54b('0xa1'),0x193);}_0x3c9a21=_0xfb16c3;return db[_0xb54b('0x8a')][_0xb54b('0x6b')]({'raw':!![]});}return null;})[_0xb54b('0x21')](function(_0x3fa762){if(_0x3fa762){_0x27290c=_[_0xb54b('0x6c')](_0x3fa762,'id');var _0x200b0e;var _0x43c454=squel[_0xb54b('0x8b')]();_0x43c454[_0xb54b('0x6d')](_0x53fcec['table']);for(var _0x5b2452=0x0;_0x5b2452<_0x3c9a21[_0xb54b('0x33')];_0x5b2452+=0x1){_0x200b0e=_0x3c9a21[_0x5b2452][_0xb54b('0x6f')]?_0x27290c[_0x3c9a21[_0x5b2452]['MetricId']][_0xb54b('0x70')]:_0x3c9a21[_0x5b2452][_0xb54b('0x71')];_0x200b0e=_0x3c9a21[_0x5b2452][_0xb54b('0x72')]?_['replace'](_0x54485d[_0x3c9a21[_0x5b2452][_0xb54b('0x72')]],'%s',_0x200b0e):_0x200b0e;_0x200b0e=_0x3c9a21[_0x5b2452][_0xb54b('0x74')]?_['replace'](_0x39ff73[_0x3c9a21[_0x5b2452][_0xb54b('0x74')]],'%s',_0x200b0e):_0x200b0e;if(_0x3c9a21[_0x5b2452]['groupBy']){_0x43c454[_0xb54b('0x65')](_0x200b0e);}_0x3c9a21[_0x5b2452][_0xb54b('0x75')]&&_0x43c454[_0xb54b('0x37')](_0x200b0e,_0x3c9a21[_0x5b2452][_0xb54b('0x75')]==='DESC'?![]:!![]);_0x43c454[_0xb54b('0x71')](_0x200b0e,_0x3c9a21[_0x5b2452][_0xb54b('0x76')]||_0x200b0e);}if(_0x53fcec[_0xb54b('0x77')]){_0x53fcec[_0xb54b('0x77')]=JSON[_0xb54b('0x78')](_0x53fcec[_0xb54b('0x77')]);for(var _0x3e5ee4=0x0;_0x3e5ee4<_0x53fcec[_0xb54b('0x77')][_0xb54b('0x33')];_0x3e5ee4+=0x1){if(_0x53fcec[_0xb54b('0x77')][_0x3e5ee4][_0xb54b('0x2c')]&&_[_0xb54b('0x79')](_0xf01f59,_0x53fcec[_0xb54b('0x77')][_0x3e5ee4]['type'])&&_0x53fcec[_0xb54b('0x77')][_0x3e5ee4][_0xb54b('0x7a')]&&_0x53fcec[_0xb54b('0x77')][_0x3e5ee4][_0xb54b('0x7c')]&&_0x53fcec[_0xb54b('0x77')][_0x3e5ee4][_0xb54b('0x7b')]){_0x43c454[_0x53fcec[_0xb54b('0x77')][_0x3e5ee4]['type']](_0x53fcec[_0xb54b('0x77')][_0x3e5ee4]['foreignTable'],null,util[_0xb54b('0x74')](_0xb54b('0x7d'),_0x53fcec[_0xb54b('0x6e')],_0x53fcec['joins'][_0x3e5ee4][_0xb54b('0x7a')],_0x53fcec[_0xb54b('0x77')][_0x3e5ee4]['foreignTable'],_0x53fcec['joins'][_0x3e5ee4][_0xb54b('0x7b')]));}}}if(_0x53fcec[_0xb54b('0x7e')]){_0x53fcec[_0xb54b('0x7e')]=JSON[_0xb54b('0x78')](_0x53fcec[_0xb54b('0x7e')]);_0x43c454[_0xb54b('0x3a')](_0x1b0961(_0x53fcec[_0xb54b('0x7e')][_0xb54b('0x65')]));}_0x28b91f=_0x43c454[_0xb54b('0x7f')]();_0x43c454[_0xb54b('0x1a')](_0x11bd34);_0x43c454['offset'](0x0);logger['debug'](_0xb54b('0x81'),_0x43c454[_0xb54b('0x82')]());return db[_0xb54b('0x83')]['query'](_0x43c454[_0xb54b('0x82')](),{'type':db[_0xb54b('0x83')][_0xb54b('0x84')]['SELECT']});}})[_0xb54b('0x21')](function(){return{'sql':_0x28b91f[_0xb54b('0x82')]()};})[_0xb54b('0x21')](respondWithResult(_0x3c7ef5,null))['catch'](handleError(_0x3c7ef5,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index e06c4c4..9180218 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 _0x3a52=['../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','api','moment','bluebird','request-promise','path'];(function(_0x2bebd9,_0x11df41){var _0x39f6d0=function(_0x3f6ac1){while(--_0x3f6ac1){_0x2bebd9['push'](_0x2bebd9['shift']());}};_0x39f6d0(++_0x11df41);}(_0x3a52,0xf7));var _0x23a5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a52[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x23a5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x23a5('0x1'));var moment=require(_0x23a5('0x2'));var BPromise=require(_0x23a5('0x3'));var rp=require(_0x23a5('0x4'));var fs=require('fs');var path=require(_0x23a5('0x5'));var rimraf=require('rimraf');var config=require(_0x23a5('0x6'));var attributes=require(_0x23a5('0x7'));module[_0x23a5('0x8')]=function(_0x2cf056,_0x4326ad){return _0x2cf056[_0x23a5('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x23a5('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad9f=['request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','moment'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xad9f,0x98));var _0xfad9=function(_0x48832c,_0x278d06){_0x48832c=_0x48832c-0x0;var _0x41db6d=_0xad9f[_0x48832c];return _0x41db6d;};'use strict';var _=require('lodash');var util=require(_0xfad9('0x0'));var logger=require(_0xfad9('0x1'))(_0xfad9('0x2'));var moment=require(_0xfad9('0x3'));var BPromise=require('bluebird');var rp=require(_0xfad9('0x4'));var fs=require('fs');var path=require(_0xfad9('0x5'));var rimraf=require('rimraf');var config=require(_0xfad9('0x6'));var attributes=require(_0xfad9('0x7'));module[_0xfad9('0x8')]=function(_0x44e01b,_0x311929){return _0x44e01b[_0xfad9('0x9')](_0xfad9('0xa'),attributes,{'tableName':_0xfad9('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index dee7184..477995a 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 _0xf91f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x88f819,_0x3e14c1){var _0x54082d=function(_0x2f0ef8){while(--_0x2f0ef8){_0x88f819['push'](_0x88f819['shift']());}};_0x54082d(++_0x3e14c1);}(_0xf91f,0x159));var _0xff91=function(_0x50b4f0,_0x5aa6a6){_0x50b4f0=_0x50b4f0-0x0;var _0x1eb091=_0xf91f[_0x50b4f0];return _0x1eb091;};'use strict';var _=require('lodash');var util=require(_0xff91('0x0'));var moment=require(_0xff91('0x1'));var BPromise=require(_0xff91('0x2'));var rs=require(_0xff91('0x3'));var fs=require('fs');var Redis=require(_0xff91('0x4'));var db=require(_0xff91('0x5'))['db'];var utils=require(_0xff91('0x6'));var logger=require(_0xff91('0x7'))(_0xff91('0x8'));var config=require(_0xff91('0x9'));var jayson=require(_0xff91('0xa'));var client=jayson['client'][_0xff91('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x392049,_0x42bc73,_0x1ea582){return new BPromise(function(_0x2d96d5,_0x17036c){return client[_0xff91('0xc')](_0x392049,_0x1ea582)[_0xff91('0xd')](function(_0x32851a){logger[_0xff91('0xe')](_0xff91('0xf'),_0x42bc73,_0xff91('0x10'));logger[_0xff91('0x11')](_0xff91('0x12'),_0x42bc73,_0xff91('0x10'),JSON[_0xff91('0x13')](_0x32851a));if(_0x32851a[_0xff91('0x14')]){if(_0x32851a[_0xff91('0x14')][_0xff91('0x15')]===0x1f4){logger[_0xff91('0x14')](_0xff91('0xf'),_0x42bc73,_0x32851a[_0xff91('0x14')][_0xff91('0x16')]);return _0x17036c(_0x32851a[_0xff91('0x14')][_0xff91('0x16')]);}logger[_0xff91('0x14')](_0xff91('0xf'),_0x42bc73,_0x32851a[_0xff91('0x14')][_0xff91('0x16')]);return _0x2d96d5(_0x32851a[_0xff91('0x14')][_0xff91('0x16')]);}else{logger[_0xff91('0xe')](_0xff91('0xf'),_0x42bc73,_0xff91('0x10'));_0x2d96d5(_0x32851a[_0xff91('0x17')][_0xff91('0x16')]);}})[_0xff91('0x18')](function(_0x305a59){logger[_0xff91('0x14')](_0xff91('0xf'),_0x42bc73,_0x305a59);_0x17036c(_0x305a59);});});} \ No newline at end of file +var _0x8918=['client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x21c9b5,_0x224108){var _0x11549f=function(_0x533fb7){while(--_0x533fb7){_0x21c9b5['push'](_0x21c9b5['shift']());}};_0x11549f(++_0x224108);}(_0x8918,0x97));var _0x8891=function(_0x16539a,_0x31409a){_0x16539a=_0x16539a-0x0;var _0x200796=_0x8918[_0x16539a];return _0x200796;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8891('0x0'));var rs=require(_0x8891('0x1'));var fs=require('fs');var Redis=require(_0x8891('0x2'));var db=require(_0x8891('0x3'))['db'];var utils=require(_0x8891('0x4'));var logger=require(_0x8891('0x5'))(_0x8891('0x6'));var config=require(_0x8891('0x7'));var jayson=require(_0x8891('0x8'));var client=jayson[_0x8891('0x9')][_0x8891('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2102de,_0x28146d,_0x5c5a42){return new BPromise(function(_0x4e50f5,_0x5bc7c0){return client[_0x8891('0xb')](_0x2102de,_0x5c5a42)['then'](function(_0x2ebbf8){logger[_0x8891('0xc')](_0x8891('0xd'),_0x28146d,_0x8891('0xe'));logger['debug'](_0x8891('0xf'),_0x28146d,_0x8891('0xe'),JSON[_0x8891('0x10')](_0x2ebbf8));if(_0x2ebbf8['error']){if(_0x2ebbf8[_0x8891('0x11')]['code']===0x1f4){logger[_0x8891('0x11')](_0x8891('0xd'),_0x28146d,_0x2ebbf8['error'][_0x8891('0x12')]);return _0x5bc7c0(_0x2ebbf8['error'][_0x8891('0x12')]);}logger[_0x8891('0x11')](_0x8891('0xd'),_0x28146d,_0x2ebbf8[_0x8891('0x11')]['message']);return _0x4e50f5(_0x2ebbf8[_0x8891('0x11')][_0x8891('0x12')]);}else{logger['info'](_0x8891('0xd'),_0x28146d,_0x8891('0xe'));_0x4e50f5(_0x2ebbf8['result'][_0x8891('0x12')]);}})[_0x8891('0x13')](function(_0x29c87e){logger['error'](_0x8891('0xd'),_0x28146d,_0x29c87e);_0x5bc7c0(_0x29c87e);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 8bbf7e0..34b3cff 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 _0xe70c=['delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','/:id','update'];(function(_0x49962f,_0x5ce12f){var _0x27c485=function(_0x31fd7c){while(--_0x31fd7c){_0x49962f['push'](_0x49962f['shift']());}};_0x27c485(++_0x5ce12f);}(_0xe70c,0xb3));var _0xce70=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xe70c[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0xce70('0x0'));var util=require('util');var path=require(_0xce70('0x1'));var timeout=require('connect-timeout');var express=require(_0xce70('0x2'));var router=express[_0xce70('0x3')]();var auth=require(_0xce70('0x4'));var interaction=require(_0xce70('0x5'));var config=require(_0xce70('0x6'));var controller=require('./analyticCustomReport.controller');router[_0xce70('0x7')]('/',auth[_0xce70('0x8')](),controller['index']);router[_0xce70('0x7')]('/:id',auth[_0xce70('0x8')](),controller[_0xce70('0x9')]);router[_0xce70('0x7')](_0xce70('0xa'),auth[_0xce70('0x8')](),controller[_0xce70('0xb')]);router['get'](_0xce70('0xc'),auth['isAuthenticated'](),controller[_0xce70('0xd')]);router[_0xce70('0x7')](_0xce70('0xe'),auth[_0xce70('0x8')](),controller[_0xce70('0xf')]);router[_0xce70('0x10')]('/',auth[_0xce70('0x8')](),controller['create']);router['put'](_0xce70('0x11'),auth[_0xce70('0x8')](),controller[_0xce70('0x12')]);router[_0xce70('0x13')](_0xce70('0x11'),auth[_0xce70('0x8')](),controller[_0xce70('0x14')]);module[_0xce70('0x15')]=router; \ No newline at end of file +var _0x2440=['destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','update','delete'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0x2440,0xa3));var _0x0244=function(_0x11753c,_0x347fdd){_0x11753c=_0x11753c-0x0;var _0x238abd=_0x2440[_0x11753c];return _0x238abd;};'use strict';var multer=require(_0x0244('0x0'));var util=require(_0x0244('0x1'));var path=require('path');var timeout=require(_0x0244('0x2'));var express=require('express');var router=express[_0x0244('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0244('0x4'));var config=require(_0x0244('0x5'));var controller=require('./analyticCustomReport.controller');router[_0x0244('0x6')]('/',auth[_0x0244('0x7')](),controller[_0x0244('0x8')]);router[_0x0244('0x6')](_0x0244('0x9'),auth['isAuthenticated'](),controller[_0x0244('0xa')]);router[_0x0244('0x6')](_0x0244('0xb'),auth['isAuthenticated'](),controller[_0x0244('0xc')]);router[_0x0244('0x6')](_0x0244('0xd'),auth[_0x0244('0x7')](),controller[_0x0244('0xe')]);router[_0x0244('0x6')](_0x0244('0xf'),auth[_0x0244('0x7')](),controller[_0x0244('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0244('0x11')]);router[_0x0244('0x12')](_0x0244('0x9'),auth[_0x0244('0x7')](),controller[_0x0244('0x13')]);router[_0x0244('0x14')](_0x0244('0x9'),auth[_0x0244('0x7')](),controller[_0x0244('0x15')]);module[_0x0244('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index c2c8336..3401aeb 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 _0x82f1=['STRING','TEXT','exports'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x82f1,0x149));var _0x182f=function(_0x248264,_0x578638){_0x248264=_0x248264-0x0;var _0x41f60c=_0x82f1[_0x248264];return _0x41f60c;};'use strict';var Sequelize=require('sequelize');module[_0x182f('0x0')]={'name':{'type':Sequelize[_0x182f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x182f('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x182f('0x2')]},'joins':{'type':Sequelize[_0x182f('0x2')]}}; \ No newline at end of file +var _0x03ea=['STRING','TEXT','sequelize'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x03ea,0xfb));var _0xa03e=function(_0x61f2fa,_0x88b9ad){_0x61f2fa=_0x61f2fa-0x0;var _0x516b66=_0x03ea[_0x61f2fa];return _0x516b66;};'use strict';var Sequelize=require(_0xa03e('0x0'));module['exports']={'name':{'type':Sequelize[_0xa03e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa03e('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa03e('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xa03e('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 29beed3..ac825ed 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 _0xb2b1=['intersection','model','fields','length','attributes','hasOwnProperty','limit','order','sort','where','filters','filter','merge','type','includeAll','include','findAll','rows','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','destroy','join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','field','function','format','replace','group','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','IS\x20NULL','keyBy','from','debug','No\x20available\x20data','output','web','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','create','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','options','runReport','IS\x20NOT\x20EMPTY','DESC','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','json','count','offset','set','Content-Range','reject','then','get','DefaultReports','UserProfileResource','status','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','key','query','keys'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0xb2b1,0x72));var _0x1b2b=function(_0x2ae709,_0x394275){_0x2ae709=_0x2ae709-0x0;var _0x3d4ac3=_0xb2b1[_0x2ae709];return _0x3d4ac3;};'use strict';var pdf=require(_0x1b2b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1b2b('0x1'));var zipdir=require(_0x1b2b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b2b('0x3'));var moment=require('moment');var BPromise=require(_0x1b2b('0x4'));var Mustache=require(_0x1b2b('0x5'));var util=require(_0x1b2b('0x6'));var path=require(_0x1b2b('0x7'));var sox=require(_0x1b2b('0x8'));var csv=require(_0x1b2b('0x9'));var ejs=require(_0x1b2b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1b2b('0xb'));var jsforce=require(_0x1b2b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1b2b('0xd'));var Papa=require(_0x1b2b('0xe'));var Redis=require(_0x1b2b('0xf'));var authService=require(_0x1b2b('0x10'));var qs=require(_0x1b2b('0x11'));var as=require(_0x1b2b('0x12'));var hardwareService=require(_0x1b2b('0x13'));var logger=require(_0x1b2b('0x14'))('api');var utils=require(_0x1b2b('0x15'));var config=require(_0x1b2b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34f27b,_0x47af7d){_0x47af7d=_0x47af7d||0xcc;return function(_0x3b1cca){if(_0x3b1cca){return _0x34f27b['sendStatus'](_0x47af7d);}return _0x34f27b['status'](_0x47af7d)[_0x1b2b('0x17')]();};}function respondWithResult(_0x5e23c1,_0x490206){_0x490206=_0x490206||0xc8;return function(_0xb5a482){if(_0xb5a482){return _0x5e23c1['status'](_0x490206)[_0x1b2b('0x18')](_0xb5a482);}};}function respondWithFilteredResult(_0x4215f9,_0x365593){return function(_0x5dc3db){if(_0x5dc3db){var _0x2350d1=_0x5dc3db[_0x1b2b('0x19')],_0x282c11=_0x365593[_0x1b2b('0x1a')],_0x1ab757=_0x365593[_0x1b2b('0x1a')]+_0x365593['limit'],_0x5bf8c0;if(_0x1ab757>=_0x2350d1){_0x1ab757=_0x2350d1;_0x5bf8c0=0xc8;}else{_0x5bf8c0=0xce;}_0x4215f9['status'](_0x5bf8c0);return _0x4215f9[_0x1b2b('0x1b')](_0x1b2b('0x1c'),_0x282c11+'-'+_0x1ab757+'/'+_0x2350d1)['json'](_0x5dc3db);}return null;};}function patchUpdates(_0x438aa2){return function(_0x153091){try{jsonpatch['apply'](_0x153091,_0x438aa2,!![]);}catch(_0x2e02ad){return BPromise[_0x1b2b('0x1d')](_0x2e02ad);}return _0x153091['save']();};}function saveUpdates(_0xe3b82e,_0x4cfcbc){return function(_0x2e783c){if(_0x2e783c){return _0x2e783c['update'](_0xe3b82e)[_0x1b2b('0x1e')](function(_0x1fe839){return _0x1fe839;});}return null;};}function removeEntity(_0x3df2dc,_0x1240e7){return function(_0x599718){if(_0x599718){return _0x599718['destroy']()[_0x1b2b('0x1e')](function(){var _0x49d614=_0x599718[_0x1b2b('0x1f')]({'plain':!![]});var _0x4012be=_0x1b2b('0x20');return db[_0x1b2b('0x21')]['destroy']({'where':{'type':_0x4012be,'resourceId':_0x49d614['id']}})[_0x1b2b('0x1e')](function(){return _0x599718;});})[_0x1b2b('0x1e')](function(){_0x3df2dc[_0x1b2b('0x22')](0xcc)[_0x1b2b('0x17')]();});}};}function handleEntityNotFound(_0x2f5270,_0x2d607e){return function(_0xb843c3){if(!_0xb843c3){_0x2f5270[_0x1b2b('0x23')](0x194);}return _0xb843c3;};}function handleError(_0x21a35b,_0x1df4bf){_0x1df4bf=_0x1df4bf||0x1f4;return function(_0x4dc7b6){logger[_0x1b2b('0x24')](_0x4dc7b6['stack']);if(_0x4dc7b6[_0x1b2b('0x25')]){delete _0x4dc7b6['name'];}_0x21a35b[_0x1b2b('0x22')](_0x1df4bf)[_0x1b2b('0x26')](_0x4dc7b6);};}exports[_0x1b2b('0x27')]=function(_0x49a975,_0x5a0702){var _0x1ac8f3={},_0x574021={},_0x487386={'count':0x0,'rows':[]};var _0x38146a=_[_0x1b2b('0x28')](db[_0x1b2b('0x29')][_0x1b2b('0x2a')],function(_0x5aa03f){return{'name':_0x5aa03f[_0x1b2b('0x2b')],'type':_0x5aa03f['type'][_0x1b2b('0x2c')]};});_0x574021['model']=_['map'](_0x38146a,_0x1b2b('0x25'));_0x574021[_0x1b2b('0x2d')]=_[_0x1b2b('0x2e')](_0x49a975[_0x1b2b('0x2d')]);_0x574021['filters']=_[_0x1b2b('0x2f')](_0x574021[_0x1b2b('0x30')],_0x574021[_0x1b2b('0x2d')]);_0x1ac8f3['attributes']=_[_0x1b2b('0x2f')](_0x574021[_0x1b2b('0x30')],qs[_0x1b2b('0x31')](_0x49a975[_0x1b2b('0x2d')][_0x1b2b('0x31')]));_0x1ac8f3['attributes']=_0x1ac8f3['attributes'][_0x1b2b('0x32')]?_0x1ac8f3[_0x1b2b('0x33')]:_0x574021[_0x1b2b('0x30')];if(!_0x49a975['query'][_0x1b2b('0x34')]('nolimit')){_0x1ac8f3[_0x1b2b('0x35')]=qs[_0x1b2b('0x35')](_0x49a975[_0x1b2b('0x2d')]['limit']);_0x1ac8f3[_0x1b2b('0x1a')]=qs[_0x1b2b('0x1a')](_0x49a975[_0x1b2b('0x2d')][_0x1b2b('0x1a')]);}_0x1ac8f3[_0x1b2b('0x36')]=qs[_0x1b2b('0x37')](_0x49a975[_0x1b2b('0x2d')][_0x1b2b('0x37')]);_0x1ac8f3[_0x1b2b('0x38')]=qs[_0x1b2b('0x39')](_['pick'](_0x49a975['query'],_0x574021[_0x1b2b('0x39')]));if(_0x49a975[_0x1b2b('0x2d')][_0x1b2b('0x3a')]){_0x1ac8f3[_0x1b2b('0x38')]=_[_0x1b2b('0x3b')](_0x1ac8f3[_0x1b2b('0x38')],{'$or':_[_0x1b2b('0x28')](_0x38146a,function(_0x22459b){if(_0x22459b[_0x1b2b('0x3c')]!=='VIRTUAL'){var _0x565df0={};_0x565df0[_0x22459b[_0x1b2b('0x25')]]={'$like':'%'+_0x49a975[_0x1b2b('0x2d')]['filter']+'%'};return _0x565df0;}})});}_0x1ac8f3=_['merge']({},_0x1ac8f3,_0x49a975['options']);var _0x4238ff={'where':_0x1ac8f3['where']};return db[_0x1b2b('0x29')][_0x1b2b('0x19')](_0x4238ff)['then'](function(_0x29a118){_0x487386['count']=_0x29a118;if(_0x49a975['query'][_0x1b2b('0x3d')]){_0x1ac8f3[_0x1b2b('0x3e')]=[{'all':!![]}];}return db[_0x1b2b('0x29')][_0x1b2b('0x3f')](_0x1ac8f3);})[_0x1b2b('0x1e')](function(_0x1a1dc5){_0x487386[_0x1b2b('0x40')]=_0x1a1dc5;return _0x487386;})['then'](respondWithFilteredResult(_0x5a0702,_0x1ac8f3))[_0x1b2b('0x41')](handleError(_0x5a0702,null));};exports['show']=function(_0x56ef78,_0x322aae){var _0x47e35e={'raw':!![],'where':{'id':_0x56ef78['params']['id']}},_0x1bc045={};_0x1bc045[_0x1b2b('0x30')]=_[_0x1b2b('0x2e')](db[_0x1b2b('0x29')]['rawAttributes']);_0x1bc045[_0x1b2b('0x2d')]=_[_0x1b2b('0x2e')](_0x56ef78['query']);_0x1bc045[_0x1b2b('0x39')]=_[_0x1b2b('0x2f')](_0x1bc045[_0x1b2b('0x30')],_0x1bc045[_0x1b2b('0x2d')]);_0x47e35e[_0x1b2b('0x33')]=_[_0x1b2b('0x2f')](_0x1bc045[_0x1b2b('0x30')],qs['fields'](_0x56ef78['query'][_0x1b2b('0x31')]));_0x47e35e[_0x1b2b('0x33')]=_0x47e35e['attributes']['length']?_0x47e35e['attributes']:_0x1bc045[_0x1b2b('0x30')];if(_0x56ef78[_0x1b2b('0x2d')][_0x1b2b('0x3d')]){_0x47e35e[_0x1b2b('0x3e')]=[{'all':!![]}];}_0x47e35e=_['merge']({},_0x47e35e,_0x56ef78['options']);return db[_0x1b2b('0x29')]['find'](_0x47e35e)[_0x1b2b('0x1e')](handleEntityNotFound(_0x322aae,null))[_0x1b2b('0x1e')](respondWithResult(_0x322aae,null))[_0x1b2b('0x41')](handleError(_0x322aae,null));};exports['create']=function(_0x4a4703,_0x45cff6){return db['AnalyticDefaultReport']['create'](_0x4a4703['body'],{})['then'](function(_0x1e8b9f){var _0x208bb3=_0x4a4703[_0x1b2b('0x42')][_0x1b2b('0x1f')]({'plain':!![]});if(!_0x208bb3)throw new Error(_0x1b2b('0x43'));if(_0x208bb3[_0x1b2b('0x44')]===_0x1b2b('0x42')){var _0x450b8d=_0x1e8b9f[_0x1b2b('0x1f')]({'plain':!![]});var _0x2edfaf=_0x1b2b('0x45');return db[_0x1b2b('0x46')][_0x1b2b('0x47')]({'where':{'name':_0x2edfaf,'userProfileId':_0x208bb3[_0x1b2b('0x48')]},'raw':!![]})[_0x1b2b('0x1e')](function(_0x38317d){if(_0x38317d&&_0x38317d['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x450b8d[_0x1b2b('0x25')],'resourceId':_0x450b8d['id'],'type':'DefaultReports','sectionId':_0x38317d['id']},{})[_0x1b2b('0x1e')](function(){return _0x1e8b9f;});}else{return _0x1e8b9f;}})[_0x1b2b('0x41')](function(_0x45ed1e){logger[_0x1b2b('0x24')](_0x1b2b('0x49'),_0x45ed1e);throw _0x45ed1e;});}return _0x1e8b9f;})['then'](respondWithResult(_0x45cff6,0xc9))[_0x1b2b('0x41')](handleError(_0x45cff6,null));};exports[_0x1b2b('0x4a')]=function(_0x158a25,_0x3ecb40){if(_0x158a25[_0x1b2b('0x4b')]['id']){delete _0x158a25['body']['id'];}return db[_0x1b2b('0x29')][_0x1b2b('0x47')]({'where':{'id':_0x158a25[_0x1b2b('0x4c')]['id']}})[_0x1b2b('0x1e')](handleEntityNotFound(_0x3ecb40,null))[_0x1b2b('0x1e')](saveUpdates(_0x158a25[_0x1b2b('0x4b')],null))[_0x1b2b('0x1e')](respondWithResult(_0x3ecb40,null))[_0x1b2b('0x41')](handleError(_0x3ecb40,null));};exports[_0x1b2b('0x4d')]=function(_0x53adbe,_0x4ef1b4){return db[_0x1b2b('0x29')][_0x1b2b('0x47')]({'where':{'id':_0x53adbe[_0x1b2b('0x4c')]['id']}})[_0x1b2b('0x1e')](handleEntityNotFound(_0x4ef1b4,null))[_0x1b2b('0x1e')](removeEntity(_0x4ef1b4,null))[_0x1b2b('0x41')](handleError(_0x4ef1b4,null));};exports['preview']=function(_0x465788,_0x18b189){var _0x2cdb85=0xa;var _0x4bc5a8=[_0x1b2b('0x4e'),'left_join',_0x1b2b('0x4f'),_0x1b2b('0x50')];var _0x2dbe50={'SUM':_0x1b2b('0x51'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1b2b('0x52'),'MIN':_0x1b2b('0x53'),'AVG':_0x1b2b('0x54'),'GROUP_CONCAT':_0x1b2b('0x55'),'GROUP_CONCAT ASC':_0x1b2b('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4e2cc6={'SEC_TO_TIME':_0x1b2b('0x57'),'DATE':'DATE(%s)','HOUR':_0x1b2b('0x58'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1b2b('0x59')};var _0x5c2109=function(_0x4573ff){return!_[_0x1b2b('0x5a')](['IS\x20NULL',_0x1b2b('0x5b'),_0x1b2b('0x5c'),'IS\x20NOT\x20EMPTY'],_0x4573ff);};var _0xad4443=function(_0x1e43cd){if(!_0x1e43cd||!_0x1e43cd[_0x1b2b('0x5d')]['length']){return'';}for(var _0x9be498='(',_0x1e6d76=0x0;_0x1e6d76<_0x1e43cd[_0x1b2b('0x5d')][_0x1b2b('0x32')];_0x1e6d76+=0x1){_0x1e6d76>0x0&&(_0x9be498+='\x20'+_0x1e43cd[_0x1b2b('0x5e')]+'\x20');_0x9be498+=_0x1e43cd[_0x1b2b('0x5d')][_0x1e6d76]['group']?_0xad4443(_0x1e43cd[_0x1b2b('0x5d')][_0x1e6d76]['group']):_0x1e43cd[_0x1b2b('0x5d')][_0x1e6d76]['field']+'\x20'+_0x1e43cd[_0x1b2b('0x5d')][_0x1e6d76][_0x1b2b('0x5f')]+(_0x5c2109(_0x1e43cd[_0x1b2b('0x5d')][_0x1e6d76][_0x1b2b('0x5f')])?'\x20'+_0x1e43cd['rules'][_0x1e6d76][_0x1b2b('0x60')]:'');}return _0x9be498+')';};var _0x51acf1={'where':{'id':_0x465788[_0x1b2b('0x4c')]['id']}},_0x4d9d33,_0x37bd9a,_0x41d661,_0x3fadb4,_0x20cffa;_0x51acf1=_[_0x1b2b('0x3b')]({},_0x51acf1,_0x465788['options']);return db['AnalyticDefaultReport']['find'](_0x51acf1)[_0x1b2b('0x1e')](function(_0x1445c5){if(_0x1445c5){_0x4d9d33=_0x1445c5;return _0x1445c5[_0x1b2b('0x61')]();}return null;})[_0x1b2b('0x1e')](function(_0x45079c){if(_0x45079c){if(!_0x45079c[_0x1b2b('0x32')]){throw new db[(_0x1b2b('0x62'))][(_0x1b2b('0x63'))](_0x1b2b('0x64'),0x193);}_0x37bd9a=_0x45079c;return db[_0x1b2b('0x65')][_0x1b2b('0x3f')]({'raw':!![]});}return null;})[_0x1b2b('0x1e')](function(_0x11a9e2){if(_0x11a9e2){_0x41d661=_['keyBy'](_0x11a9e2,'id');var _0x54d84f;var _0x476c33=squel[_0x1b2b('0x66')]();_0x476c33['from'](_0x4d9d33[_0x1b2b('0x67')]);for(var _0x58883e=0x0;_0x58883e<_0x37bd9a[_0x1b2b('0x32')];_0x58883e+=0x1){_0x54d84f=_0x37bd9a[_0x58883e][_0x1b2b('0x68')]?_0x41d661[_0x37bd9a[_0x58883e][_0x1b2b('0x68')]][_0x1b2b('0x69')]:_0x37bd9a[_0x58883e][_0x1b2b('0x6a')];_0x54d84f=_0x37bd9a[_0x58883e]['function']?_['replace'](_0x2dbe50[_0x37bd9a[_0x58883e][_0x1b2b('0x6b')]],'%s',_0x54d84f):_0x54d84f;_0x54d84f=_0x37bd9a[_0x58883e][_0x1b2b('0x6c')]?_[_0x1b2b('0x6d')](_0x4e2cc6[_0x37bd9a[_0x58883e][_0x1b2b('0x6c')]],'%s',_0x54d84f):_0x54d84f;if(_0x37bd9a[_0x58883e]['groupBy']){_0x476c33[_0x1b2b('0x6e')](_0x54d84f);}_0x37bd9a[_0x58883e][_0x1b2b('0x6f')]&&_0x476c33['order'](_0x54d84f,_0x37bd9a[_0x58883e][_0x1b2b('0x6f')]==='DESC'?![]:!![]);_0x476c33[_0x1b2b('0x6a')](_0x54d84f,_0x37bd9a[_0x58883e][_0x1b2b('0x70')]||_0x54d84f);}if(_0x4d9d33[_0x1b2b('0x71')]){_0x4d9d33[_0x1b2b('0x71')]=JSON[_0x1b2b('0x72')](_0x4d9d33[_0x1b2b('0x71')]);for(var _0x463211=0x0;_0x463211<_0x4d9d33[_0x1b2b('0x71')]['length'];_0x463211+=0x1){if(_0x4d9d33[_0x1b2b('0x71')][_0x463211]['type']&&_['includes'](_0x4bc5a8,_0x4d9d33['joins'][_0x463211][_0x1b2b('0x3c')])&&_0x4d9d33[_0x1b2b('0x71')][_0x463211][_0x1b2b('0x73')]&&_0x4d9d33[_0x1b2b('0x71')][_0x463211][_0x1b2b('0x74')]&&_0x4d9d33[_0x1b2b('0x71')][_0x463211][_0x1b2b('0x75')]){_0x476c33[_0x4d9d33[_0x1b2b('0x71')][_0x463211][_0x1b2b('0x3c')]](_0x4d9d33[_0x1b2b('0x71')][_0x463211]['foreignTable'],null,util['format'](_0x1b2b('0x76'),_0x4d9d33[_0x1b2b('0x67')],_0x4d9d33['joins'][_0x463211][_0x1b2b('0x73')],_0x4d9d33[_0x1b2b('0x71')][_0x463211][_0x1b2b('0x74')],_0x4d9d33[_0x1b2b('0x71')][_0x463211]['foreignKey']));}}}if(_0x4d9d33[_0x1b2b('0x77')]){_0x4d9d33['conditions']=JSON['parse'](_0x4d9d33[_0x1b2b('0x77')]);_0x476c33[_0x1b2b('0x38')](_0xad4443(_0x4d9d33[_0x1b2b('0x77')][_0x1b2b('0x6e')]));}_0x20cffa=_0x476c33[_0x1b2b('0x78')]();_0x476c33[_0x1b2b('0x35')](_0x2cdb85);_0x476c33['offset'](0x0);logger['debug'](_0x1b2b('0x79'),_0x476c33[_0x1b2b('0x7a')]());return db[_0x1b2b('0x7b')]['query'](_0x476c33['toString'](),{'type':db[_0x1b2b('0x7b')][_0x1b2b('0x7c')][_0x1b2b('0x7d')]});}})[_0x1b2b('0x1e')](respondWithResult(_0x18b189,null))[_0x1b2b('0x41')](handleError(_0x18b189,null));};function runReport(_0x21c7aa,_0x1716ac,_0x4e0de5){var _0x1239ad=_0x1716ac[_0x1b2b('0x25')];var _0xdceae4=0xa;var _0x32f858=[_0x1b2b('0x4e'),_0x1b2b('0x7e'),_0x1b2b('0x4f'),'cross_join'];var _0x34095d={'SUM':'SUM(%s)','COUNT':_0x1b2b('0x7f'),'COUNT DISTINCT':_0x1b2b('0x80'),'MAX':_0x1b2b('0x52'),'MIN':_0x1b2b('0x53'),'AVG':_0x1b2b('0x54'),'GROUP_CONCAT':_0x1b2b('0x55'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x1b2b('0x81')};var _0x27eeb6={'SEC_TO_TIME':_0x1b2b('0x57'),'DATE':_0x1b2b('0x82'),'HOUR':_0x1b2b('0x58'),'ROUND':_0x1b2b('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x229ad1=function(_0x113898){return!_[_0x1b2b('0x5a')]([_0x1b2b('0x84'),_0x1b2b('0x5b'),_0x1b2b('0x5c'),'IS\x20NOT\x20EMPTY'],_0x113898);};var _0x28a984=function(_0xbdafcb){if(!_0xbdafcb||!_0xbdafcb[_0x1b2b('0x5d')]['length']){return'';}for(var _0x228f37='(',_0x4d215e=0x0;_0x4d215e<_0xbdafcb[_0x1b2b('0x5d')][_0x1b2b('0x32')];_0x4d215e+=0x1){_0x4d215e>0x0&&(_0x228f37+='\x20'+_0xbdafcb['operator']+'\x20');_0x228f37+=_0xbdafcb['rules'][_0x4d215e][_0x1b2b('0x6e')]?_0x28a984(_0xbdafcb[_0x1b2b('0x5d')][_0x4d215e]['group']):_0xbdafcb['rules'][_0x4d215e][_0x1b2b('0x6a')]+'\x20'+_0xbdafcb[_0x1b2b('0x5d')][_0x4d215e][_0x1b2b('0x5f')]+(_0x229ad1(_0xbdafcb[_0x1b2b('0x5d')][_0x4d215e][_0x1b2b('0x5f')])?'\x20'+_0xbdafcb[_0x1b2b('0x5d')][_0x4d215e][_0x1b2b('0x60')]:'');}return _0x228f37+')';};var _0x38e27c={'where':{'id':_0x21c7aa['id']}},_0x2b74ab,_0x490044,_0x2631d3,_0x41fc7f,_0x2f0e8c;_0x38e27c=_[_0x1b2b('0x3b')]({},_0x38e27c,_0x4e0de5);return db['AnalyticDefaultReport'][_0x1b2b('0x47')](_0x38e27c)['then'](function(_0x485bbf){if(_0x485bbf){_0x2b74ab=_0x485bbf;return _0x485bbf[_0x1b2b('0x61')]();}return null;})['then'](function(_0x2987ca){if(_0x2987ca){if(!_0x2987ca['length']){throw new db[(_0x1b2b('0x62'))]['ValidationErrorItem'](_0x1b2b('0x64'),0x193);}_0x490044=_0x2987ca;return db[_0x1b2b('0x65')][_0x1b2b('0x3f')]({'raw':!![]});}return null;})['then'](function(_0xfb5a81){if(_0xfb5a81){_0x2631d3=_[_0x1b2b('0x85')](_0xfb5a81,'id');var _0x4735b1;var _0x3320f7=squel['select']();_0x3320f7[_0x1b2b('0x86')](_0x2b74ab[_0x1b2b('0x67')]);for(var _0x432da8=0x0;_0x432da8<_0x490044[_0x1b2b('0x32')];_0x432da8+=0x1){_0x4735b1=_0x490044[_0x432da8][_0x1b2b('0x68')]?_0x2631d3[_0x490044[_0x432da8][_0x1b2b('0x68')]][_0x1b2b('0x69')]:_0x490044[_0x432da8]['field'];_0x4735b1=_0x490044[_0x432da8][_0x1b2b('0x6b')]?_[_0x1b2b('0x6d')](_0x34095d[_0x490044[_0x432da8]['function']],'%s',_0x4735b1):_0x4735b1;_0x4735b1=_0x490044[_0x432da8][_0x1b2b('0x6c')]?_[_0x1b2b('0x6d')](_0x27eeb6[_0x490044[_0x432da8][_0x1b2b('0x6c')]],'%s',_0x4735b1):_0x4735b1;if(_0x490044[_0x432da8]['groupBy']){_0x3320f7[_0x1b2b('0x6e')](_0x4735b1);}_0x490044[_0x432da8][_0x1b2b('0x6f')]&&_0x3320f7[_0x1b2b('0x36')](_0x4735b1,_0x490044[_0x432da8][_0x1b2b('0x6f')]==='DESC'?![]:!![]);_0x3320f7[_0x1b2b('0x6a')](_0x4735b1,_0x490044[_0x432da8][_0x1b2b('0x70')]||_0x4735b1);}if(_0x2b74ab[_0x1b2b('0x71')]){_0x2b74ab[_0x1b2b('0x71')]=JSON['parse'](_0x2b74ab[_0x1b2b('0x71')]);for(var _0xb1892=0x0;_0xb1892<_0x2b74ab[_0x1b2b('0x71')][_0x1b2b('0x32')];_0xb1892+=0x1){if(_0x2b74ab[_0x1b2b('0x71')][_0xb1892][_0x1b2b('0x3c')]&&_['includes'](_0x32f858,_0x2b74ab[_0x1b2b('0x71')][_0xb1892]['type'])&&_0x2b74ab[_0x1b2b('0x71')][_0xb1892]['parentKey']&&_0x2b74ab[_0x1b2b('0x71')][_0xb1892][_0x1b2b('0x74')]&&_0x2b74ab[_0x1b2b('0x71')][_0xb1892]['foreignKey']){_0x3320f7[_0x2b74ab['joins'][_0xb1892][_0x1b2b('0x3c')]](_0x2b74ab[_0x1b2b('0x71')][_0xb1892]['foreignTable'],null,util[_0x1b2b('0x6c')](_0x1b2b('0x76'),_0x2b74ab[_0x1b2b('0x67')],_0x2b74ab[_0x1b2b('0x71')][_0xb1892][_0x1b2b('0x73')],_0x2b74ab[_0x1b2b('0x71')][_0xb1892][_0x1b2b('0x74')],_0x2b74ab[_0x1b2b('0x71')][_0xb1892]['foreignKey']));}}}if(_0x2b74ab[_0x1b2b('0x77')]){_0x2b74ab[_0x1b2b('0x77')]=JSON[_0x1b2b('0x72')](_0x2b74ab[_0x1b2b('0x77')]);_0x3320f7[_0x1b2b('0x38')](_0x28a984(_0x2b74ab['conditions'][_0x1b2b('0x6e')]));}_0x2f0e8c=_0x3320f7[_0x1b2b('0x78')]();_0x3320f7[_0x1b2b('0x35')](_0xdceae4);_0x3320f7[_0x1b2b('0x1a')](0x0);logger[_0x1b2b('0x87')]('Limited\x20Query:',_0x3320f7[_0x1b2b('0x7a')]());return db[_0x1b2b('0x7b')][_0x1b2b('0x2d')](_0x3320f7[_0x1b2b('0x7a')](),{'type':db[_0x1b2b('0x7b')]['QueryTypes']['SELECT']});}})[_0x1b2b('0x1e')](function(_0x5dbad1){if(!_0x5dbad1[_0x1b2b('0x32')]){throw new db[(_0x1b2b('0x62'))][(_0x1b2b('0x63'))](_0x1b2b('0x88'),0xcc);}if(_0x1716ac[_0x1b2b('0x89')]===_0x1b2b('0x8a')){return null;}var _0x2f6f38=_['merge'](_0x1716ac,{'name':_0x1716ac['fullPath']||_0x1716ac[_0x1b2b('0x25')]||_0x2b74ab[_0x1b2b('0x25')],'basename':_0x1239ad,'savename':util[_0x1b2b('0x6c')](_0x1b2b('0x8b'),_0x1716ac['name']||_0x2b74ab[_0x1b2b('0x25')],require(_0x1b2b('0x8c'))[_0x1b2b('0x8d')](0x4),_0x1716ac['output']||_0x1b2b('0x8e')),'reportId':_0x2b74ab['id'],'reportType':'default'});return db[_0x1b2b('0x8f')][_0x1b2b('0x90')](_0x2f6f38,{'raw':!![]});})[_0x1b2b('0x1e')](function(_0x5fe2ee){if(_0x2b74ab['table']===_0x1b2b('0x91')){_0x2f0e8c[_0x1b2b('0x38')](_0x2b74ab[_0x1b2b('0x67')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1716ac[_0x1b2b('0x92')],_0x1716ac['endDate']);}else{_0x2f0e8c[_0x1b2b('0x38')](_0x2b74ab[_0x1b2b('0x67')]+_0x1b2b('0x93'),_0x1716ac['startDate'],_0x1716ac[_0x1b2b('0x94')]);}if(_0x5fe2ee){logger['info'](_0x1b2b('0x95'),_0x2f0e8c['toString']());require(_0x1b2b('0x96'))['fork'](path[_0x1b2b('0x4e')](__dirname,_0x1b2b('0x97'),_0x5fe2ee[_0x1b2b('0x89')]),[_0x5fe2ee['id'],_0x2f0e8c[_0x1b2b('0x7a')](),path[_0x1b2b('0x4e')](__dirname,_0x1b2b('0x98'),_0x5fe2ee[_0x1b2b('0x99')]),_0x1239ad]);return _0x5fe2ee;}else{var _0xf486c=squel[_0x1b2b('0x66')]();_0xf486c[_0x1b2b('0x86')]('('+_0x2f0e8c[_0x1b2b('0x7a')]()+')',_0x1b2b('0x9a'));_0xf486c[_0x1b2b('0x6a')](_0x1b2b('0x9b'),_0x1b2b('0x19'));_0x2f0e8c['limit'](_0x1716ac[_0x1b2b('0x35')]||_0xdceae4);_0x2f0e8c[_0x1b2b('0x1a')](_0x1716ac[_0x1b2b('0x1a')]||0x0);return db[_0x1b2b('0x7b')][_0x1b2b('0x2d')](_0xf486c[_0x1b2b('0x7a')](),{'type':db[_0x1b2b('0x7b')]['QueryTypes'][_0x1b2b('0x7d')]})['then'](function(_0x1868dd){if(!_0x1868dd[_0x1b2b('0x32')]){_0x41fc7f=0x0;}else{_0x41fc7f=_0x1868dd[0x0][_0x1b2b('0x19')]||0x0;}return db[_0x1b2b('0x7b')][_0x1b2b('0x2d')](_0x2f0e8c[_0x1b2b('0x7a')](),{'type':db[_0x1b2b('0x7b')][_0x1b2b('0x7c')][_0x1b2b('0x7d')]});})[_0x1b2b('0x1e')](function(_0x1d85ce){return{'rows':_0x1d85ce||[],'count':_0x41fc7f};});}});}exports[_0x1b2b('0x9c')]=function(_0x350601,_0xd94d04){return runReport(_0x350601[_0x1b2b('0x4c')],_0x350601[_0x1b2b('0x2d')],_0x350601[_0x1b2b('0x9d')])[_0x1b2b('0x1e')](respondWithResult(_0xd94d04,null))['catch'](handleError(_0xd94d04,null));};exports[_0x1b2b('0x9e')]=runReport;exports['query']=function(_0x364bc8,_0x30c033){var _0x167efc=0xa;var _0x51793c=[_0x1b2b('0x4e'),'left_join','right_join','cross_join'];var _0x430b13={'SUM':_0x1b2b('0x51'),'COUNT':_0x1b2b('0x7f'),'COUNT DISTINCT':_0x1b2b('0x80'),'MAX':_0x1b2b('0x52'),'MIN':_0x1b2b('0x53'),'AVG':_0x1b2b('0x54'),'GROUP_CONCAT':_0x1b2b('0x55'),'GROUP_CONCAT ASC':_0x1b2b('0x56'),'GROUP_CONCAT DESC':_0x1b2b('0x81')};var _0x75bdbd={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1b2b('0x82'),'HOUR':_0x1b2b('0x58'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1b2b('0x59')};var _0x11624d=function(_0x33dc54){return!_[_0x1b2b('0x5a')]([_0x1b2b('0x84'),'IS\x20NOT\x20NULL',_0x1b2b('0x5c'),_0x1b2b('0x9f')],_0x33dc54);};var _0x951e9a=function(_0x4da954){if(!_0x4da954||!_0x4da954[_0x1b2b('0x5d')][_0x1b2b('0x32')]){return'';}for(var _0x4b34ba='(',_0x536973=0x0;_0x536973<_0x4da954[_0x1b2b('0x5d')][_0x1b2b('0x32')];_0x536973+=0x1){_0x536973>0x0&&(_0x4b34ba+='\x20'+_0x4da954['operator']+'\x20');_0x4b34ba+=_0x4da954[_0x1b2b('0x5d')][_0x536973][_0x1b2b('0x6e')]?_0x951e9a(_0x4da954[_0x1b2b('0x5d')][_0x536973][_0x1b2b('0x6e')]):_0x4da954[_0x1b2b('0x5d')][_0x536973][_0x1b2b('0x6a')]+'\x20'+_0x4da954[_0x1b2b('0x5d')][_0x536973]['condition']+(_0x11624d(_0x4da954[_0x1b2b('0x5d')][_0x536973][_0x1b2b('0x5f')])?'\x20'+_0x4da954[_0x1b2b('0x5d')][_0x536973]['value']:'');}return _0x4b34ba+')';};var _0xb270ff={'where':{'id':_0x364bc8[_0x1b2b('0x4c')]['id']}},_0x238db9,_0x3aed5f,_0xa83d4a,_0x514a6b,_0x1a8997;_0xb270ff=_[_0x1b2b('0x3b')]({},_0xb270ff,_0x364bc8[_0x1b2b('0x9d')]);return db[_0x1b2b('0x29')][_0x1b2b('0x47')](_0xb270ff)[_0x1b2b('0x1e')](function(_0x2f5cfa){if(_0x2f5cfa){_0x238db9=_0x2f5cfa;return _0x2f5cfa['getFields']();}return null;})['then'](function(_0x15c147){if(_0x15c147){if(!_0x15c147[_0x1b2b('0x32')]){throw new db[(_0x1b2b('0x62'))][(_0x1b2b('0x63'))](_0x1b2b('0x64'),0x193);}_0x3aed5f=_0x15c147;return db[_0x1b2b('0x65')][_0x1b2b('0x3f')]({'raw':!![]});}return null;})[_0x1b2b('0x1e')](function(_0xc7ffd6){if(_0xc7ffd6){_0xa83d4a=_[_0x1b2b('0x85')](_0xc7ffd6,'id');var _0x491316;var _0x4dd929=squel[_0x1b2b('0x66')]();_0x4dd929[_0x1b2b('0x86')](_0x238db9[_0x1b2b('0x67')]);for(var _0x393914=0x0;_0x393914<_0x3aed5f[_0x1b2b('0x32')];_0x393914+=0x1){_0x491316=_0x3aed5f[_0x393914][_0x1b2b('0x68')]?_0xa83d4a[_0x3aed5f[_0x393914][_0x1b2b('0x68')]][_0x1b2b('0x69')]:_0x3aed5f[_0x393914][_0x1b2b('0x6a')];_0x491316=_0x3aed5f[_0x393914][_0x1b2b('0x6b')]?_[_0x1b2b('0x6d')](_0x430b13[_0x3aed5f[_0x393914][_0x1b2b('0x6b')]],'%s',_0x491316):_0x491316;_0x491316=_0x3aed5f[_0x393914][_0x1b2b('0x6c')]?_['replace'](_0x75bdbd[_0x3aed5f[_0x393914]['format']],'%s',_0x491316):_0x491316;if(_0x3aed5f[_0x393914]['groupBy']){_0x4dd929[_0x1b2b('0x6e')](_0x491316);}_0x3aed5f[_0x393914][_0x1b2b('0x6f')]&&_0x4dd929[_0x1b2b('0x36')](_0x491316,_0x3aed5f[_0x393914][_0x1b2b('0x6f')]===_0x1b2b('0xa0')?![]:!![]);_0x4dd929[_0x1b2b('0x6a')](_0x491316,_0x3aed5f[_0x393914][_0x1b2b('0x70')]||_0x491316);}if(_0x238db9[_0x1b2b('0x71')]){_0x238db9[_0x1b2b('0x71')]=JSON[_0x1b2b('0x72')](_0x238db9[_0x1b2b('0x71')]);for(var _0x32d103=0x0;_0x32d103<_0x238db9[_0x1b2b('0x71')]['length'];_0x32d103+=0x1){if(_0x238db9[_0x1b2b('0x71')][_0x32d103][_0x1b2b('0x3c')]&&_['includes'](_0x51793c,_0x238db9[_0x1b2b('0x71')][_0x32d103][_0x1b2b('0x3c')])&&_0x238db9[_0x1b2b('0x71')][_0x32d103][_0x1b2b('0x73')]&&_0x238db9[_0x1b2b('0x71')][_0x32d103][_0x1b2b('0x74')]&&_0x238db9['joins'][_0x32d103][_0x1b2b('0x75')]){_0x4dd929[_0x238db9[_0x1b2b('0x71')][_0x32d103][_0x1b2b('0x3c')]](_0x238db9[_0x1b2b('0x71')][_0x32d103][_0x1b2b('0x74')],null,util['format'](_0x1b2b('0x76'),_0x238db9[_0x1b2b('0x67')],_0x238db9['joins'][_0x32d103][_0x1b2b('0x73')],_0x238db9['joins'][_0x32d103]['foreignTable'],_0x238db9[_0x1b2b('0x71')][_0x32d103]['foreignKey']));}}}if(_0x238db9[_0x1b2b('0x77')]){_0x238db9[_0x1b2b('0x77')]=JSON[_0x1b2b('0x72')](_0x238db9[_0x1b2b('0x77')]);_0x4dd929[_0x1b2b('0x38')](_0x951e9a(_0x238db9[_0x1b2b('0x77')]['group']));}_0x1a8997=_0x4dd929[_0x1b2b('0x78')]();_0x4dd929['limit'](_0x167efc);_0x4dd929[_0x1b2b('0x1a')](0x0);logger[_0x1b2b('0x87')]('Limited\x20Query:',_0x4dd929[_0x1b2b('0x7a')]());return db[_0x1b2b('0x7b')]['query'](_0x4dd929[_0x1b2b('0x7a')](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})[_0x1b2b('0x1e')](function(){return{'sql':_0x1a8997[_0x1b2b('0x7a')]()};})[_0x1b2b('0x1e')](respondWithResult(_0x30c033,null))[_0x1b2b('0x41')](handleError(_0x30c033,null));}; \ No newline at end of file +var _0xce69=['../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','SEC_TO_TIME(%s)','keyBy','groupBy','debug','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','AnalyticDefaultReport','count','includeAll','include','findAll','rows','catch','params','keys','find','create','body','user','get','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','operator','group','rules','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','from','table','MetricId','metric','format','DESC','alias','joins','parse','type','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','field','getFields','Please\x20insert\x20at\x20least\x20one\x20field','select','function','replace','orderBy','SELECT','No\x20available\x20data','output','web','fullPath','%s-%s.%s','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork'];(function(_0x2fbea3,_0xaf2e7c){var _0x314060=function(_0x557670){while(--_0x557670){_0x2fbea3['push'](_0x2fbea3['shift']());}};_0x314060(++_0xaf2e7c);}(_0xce69,0xb1));var _0x9ce6=function(_0x1d426f,_0x37e919){_0x1d426f=_0x1d426f-0x0;var _0x17f71a=_0xce69[_0x1d426f];return _0x17f71a;};'use strict';var pdf=require(_0x9ce6('0x0'));var emlformat=require(_0x9ce6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9ce6('0x2'));var jsonpatch=require(_0x9ce6('0x3'));var rp=require(_0x9ce6('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9ce6('0x5'));var util=require(_0x9ce6('0x6'));var path=require(_0x9ce6('0x7'));var sox=require(_0x9ce6('0x8'));var csv=require('to-csv');var ejs=require(_0x9ce6('0x9'));var fs=require('fs');var _=require(_0x9ce6('0xa'));var squel=require(_0x9ce6('0xb'));var crypto=require(_0x9ce6('0xc'));var jsforce=require(_0x9ce6('0xd'));var deskjs=require(_0x9ce6('0xe'));var toCsv=require(_0x9ce6('0xf'));var querystring=require(_0x9ce6('0x10'));var Papa=require(_0x9ce6('0x11'));var Redis=require('ioredis');var authService=require(_0x9ce6('0x12'));var qs=require(_0x9ce6('0x13'));var as=require(_0x9ce6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9ce6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x9ce6('0x16'));var db=require(_0x9ce6('0x17'))['db'];function respondWithStatusCode(_0x5107c1,_0x396114){_0x396114=_0x396114||0xcc;return function(_0x2177aa){if(_0x2177aa){return _0x5107c1[_0x9ce6('0x18')](_0x396114);}return _0x5107c1['status'](_0x396114)[_0x9ce6('0x19')]();};}function respondWithResult(_0x37028c,_0x5ca15b){_0x5ca15b=_0x5ca15b||0xc8;return function(_0x1b2662){if(_0x1b2662){return _0x37028c[_0x9ce6('0x1a')](_0x5ca15b)[_0x9ce6('0x1b')](_0x1b2662);}};}function respondWithFilteredResult(_0x5386c5,_0xbb281b){return function(_0x5c0d2e){if(_0x5c0d2e){var _0x46e616=_0x5c0d2e['count'],_0xc03463=_0xbb281b['offset'],_0x1d0d9b=_0xbb281b[_0x9ce6('0x1c')]+_0xbb281b['limit'],_0x189204;if(_0x1d0d9b>=_0x46e616){_0x1d0d9b=_0x46e616;_0x189204=0xc8;}else{_0x189204=0xce;}_0x5386c5[_0x9ce6('0x1a')](_0x189204);return _0x5386c5[_0x9ce6('0x1d')](_0x9ce6('0x1e'),_0xc03463+'-'+_0x1d0d9b+'/'+_0x46e616)[_0x9ce6('0x1b')](_0x5c0d2e);}return null;};}function patchUpdates(_0xb413f0){return function(_0x107a2a){try{jsonpatch[_0x9ce6('0x1f')](_0x107a2a,_0xb413f0,!![]);}catch(_0x2547e7){return BPromise[_0x9ce6('0x20')](_0x2547e7);}return _0x107a2a[_0x9ce6('0x21')]();};}function saveUpdates(_0x5d6fa6,_0x45efcc){return function(_0x2b52ca){if(_0x2b52ca){return _0x2b52ca[_0x9ce6('0x22')](_0x5d6fa6)[_0x9ce6('0x23')](function(_0xd27ddf){return _0xd27ddf;});}return null;};}function removeEntity(_0x1a70a6,_0x4d5f65){return function(_0x487992){if(_0x487992){return _0x487992[_0x9ce6('0x24')]()[_0x9ce6('0x23')](function(){var _0x5654d7=_0x487992['get']({'plain':!![]});var _0x5a8b7a=_0x9ce6('0x25');return db[_0x9ce6('0x26')][_0x9ce6('0x24')]({'where':{'type':_0x5a8b7a,'resourceId':_0x5654d7['id']}})[_0x9ce6('0x23')](function(){return _0x487992;});})['then'](function(){_0x1a70a6[_0x9ce6('0x1a')](0xcc)[_0x9ce6('0x19')]();});}};}function handleEntityNotFound(_0x406396,_0x2cf33c){return function(_0x5158a0){if(!_0x5158a0){_0x406396[_0x9ce6('0x18')](0x194);}return _0x5158a0;};}function handleError(_0x5bfa35,_0x2c6449){_0x2c6449=_0x2c6449||0x1f4;return function(_0x49e19a){logger[_0x9ce6('0x27')](_0x49e19a[_0x9ce6('0x28')]);if(_0x49e19a[_0x9ce6('0x29')]){delete _0x49e19a[_0x9ce6('0x29')];}_0x5bfa35[_0x9ce6('0x1a')](_0x2c6449)[_0x9ce6('0x2a')](_0x49e19a);};}exports[_0x9ce6('0x2b')]=function(_0x204249,_0x5755ea){var _0x8e53e0={},_0x496b02={},_0x4d855b={'count':0x0,'rows':[]};var _0x267d1e=_[_0x9ce6('0x2c')](db['AnalyticDefaultReport'][_0x9ce6('0x2d')],function(_0x2e63a0){return{'name':_0x2e63a0['fieldName'],'type':_0x2e63a0['type']['key']};});_0x496b02['model']=_['map'](_0x267d1e,_0x9ce6('0x29'));_0x496b02[_0x9ce6('0x2e')]=_['keys'](_0x204249[_0x9ce6('0x2e')]);_0x496b02[_0x9ce6('0x2f')]=_[_0x9ce6('0x30')](_0x496b02[_0x9ce6('0x31')],_0x496b02[_0x9ce6('0x2e')]);_0x8e53e0[_0x9ce6('0x32')]=_[_0x9ce6('0x30')](_0x496b02['model'],qs[_0x9ce6('0x33')](_0x204249[_0x9ce6('0x2e')][_0x9ce6('0x33')]));_0x8e53e0[_0x9ce6('0x32')]=_0x8e53e0[_0x9ce6('0x32')][_0x9ce6('0x34')]?_0x8e53e0[_0x9ce6('0x32')]:_0x496b02[_0x9ce6('0x31')];if(!_0x204249[_0x9ce6('0x2e')][_0x9ce6('0x35')](_0x9ce6('0x36'))){_0x8e53e0[_0x9ce6('0x37')]=qs['limit'](_0x204249[_0x9ce6('0x2e')][_0x9ce6('0x37')]);_0x8e53e0['offset']=qs['offset'](_0x204249[_0x9ce6('0x2e')][_0x9ce6('0x1c')]);}_0x8e53e0[_0x9ce6('0x38')]=qs[_0x9ce6('0x39')](_0x204249[_0x9ce6('0x2e')]['sort']);_0x8e53e0['where']=qs[_0x9ce6('0x2f')](_[_0x9ce6('0x3a')](_0x204249[_0x9ce6('0x2e')],_0x496b02[_0x9ce6('0x2f')]));if(_0x204249['query'][_0x9ce6('0x3b')]){_0x8e53e0[_0x9ce6('0x3c')]=_['merge'](_0x8e53e0[_0x9ce6('0x3c')],{'$or':_[_0x9ce6('0x2c')](_0x267d1e,function(_0x296b57){if(_0x296b57['type']!==_0x9ce6('0x3d')){var _0x111a94={};_0x111a94[_0x296b57[_0x9ce6('0x29')]]={'$like':'%'+_0x204249[_0x9ce6('0x2e')]['filter']+'%'};return _0x111a94;}})});}_0x8e53e0=_[_0x9ce6('0x3e')]({},_0x8e53e0,_0x204249[_0x9ce6('0x3f')]);var _0x3719d1={'where':_0x8e53e0[_0x9ce6('0x3c')]};return db[_0x9ce6('0x40')][_0x9ce6('0x41')](_0x3719d1)[_0x9ce6('0x23')](function(_0x3b0b5c){_0x4d855b[_0x9ce6('0x41')]=_0x3b0b5c;if(_0x204249[_0x9ce6('0x2e')][_0x9ce6('0x42')]){_0x8e53e0[_0x9ce6('0x43')]=[{'all':!![]}];}return db[_0x9ce6('0x40')][_0x9ce6('0x44')](_0x8e53e0);})[_0x9ce6('0x23')](function(_0x386ce4){_0x4d855b[_0x9ce6('0x45')]=_0x386ce4;return _0x4d855b;})[_0x9ce6('0x23')](respondWithFilteredResult(_0x5755ea,_0x8e53e0))[_0x9ce6('0x46')](handleError(_0x5755ea,null));};exports['show']=function(_0xd50c12,_0x516709){var _0x31a1ff={'raw':!![],'where':{'id':_0xd50c12[_0x9ce6('0x47')]['id']}},_0x229702={};_0x229702[_0x9ce6('0x31')]=_[_0x9ce6('0x48')](db[_0x9ce6('0x40')][_0x9ce6('0x2d')]);_0x229702[_0x9ce6('0x2e')]=_[_0x9ce6('0x48')](_0xd50c12[_0x9ce6('0x2e')]);_0x229702['filters']=_[_0x9ce6('0x30')](_0x229702[_0x9ce6('0x31')],_0x229702['query']);_0x31a1ff[_0x9ce6('0x32')]=_[_0x9ce6('0x30')](_0x229702[_0x9ce6('0x31')],qs[_0x9ce6('0x33')](_0xd50c12['query'][_0x9ce6('0x33')]));_0x31a1ff[_0x9ce6('0x32')]=_0x31a1ff[_0x9ce6('0x32')][_0x9ce6('0x34')]?_0x31a1ff[_0x9ce6('0x32')]:_0x229702['model'];if(_0xd50c12['query'][_0x9ce6('0x42')]){_0x31a1ff['include']=[{'all':!![]}];}_0x31a1ff=_[_0x9ce6('0x3e')]({},_0x31a1ff,_0xd50c12[_0x9ce6('0x3f')]);return db[_0x9ce6('0x40')][_0x9ce6('0x49')](_0x31a1ff)[_0x9ce6('0x23')](handleEntityNotFound(_0x516709,null))[_0x9ce6('0x23')](respondWithResult(_0x516709,null))[_0x9ce6('0x46')](handleError(_0x516709,null));};exports[_0x9ce6('0x4a')]=function(_0x4808d7,_0x18baba){return db[_0x9ce6('0x40')][_0x9ce6('0x4a')](_0x4808d7[_0x9ce6('0x4b')],{})[_0x9ce6('0x23')](function(_0x20d51b){var _0x245959=_0x4808d7[_0x9ce6('0x4c')][_0x9ce6('0x4d')]({'plain':!![]});if(!_0x245959)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x245959[_0x9ce6('0x4e')]===_0x9ce6('0x4c')){var _0x4c0c17=_0x20d51b[_0x9ce6('0x4d')]({'plain':!![]});var _0x69f596=_0x9ce6('0x4f');return db[_0x9ce6('0x50')][_0x9ce6('0x49')]({'where':{'name':_0x69f596,'userProfileId':_0x245959[_0x9ce6('0x51')]},'raw':!![]})[_0x9ce6('0x23')](function(_0x12afb6){if(_0x12afb6&&_0x12afb6[_0x9ce6('0x52')]===0x0){return db[_0x9ce6('0x26')][_0x9ce6('0x4a')]({'name':_0x4c0c17[_0x9ce6('0x29')],'resourceId':_0x4c0c17['id'],'type':_0x9ce6('0x25'),'sectionId':_0x12afb6['id']},{})[_0x9ce6('0x23')](function(){return _0x20d51b;});}else{return _0x20d51b;}})['catch'](function(_0x247c99){logger[_0x9ce6('0x27')](_0x9ce6('0x53'),_0x247c99);throw _0x247c99;});}return _0x20d51b;})[_0x9ce6('0x23')](respondWithResult(_0x18baba,0xc9))['catch'](handleError(_0x18baba,null));};exports['update']=function(_0x341342,_0xc11cd1){if(_0x341342[_0x9ce6('0x4b')]['id']){delete _0x341342[_0x9ce6('0x4b')]['id'];}return db['AnalyticDefaultReport'][_0x9ce6('0x49')]({'where':{'id':_0x341342[_0x9ce6('0x47')]['id']}})[_0x9ce6('0x23')](handleEntityNotFound(_0xc11cd1,null))[_0x9ce6('0x23')](saveUpdates(_0x341342['body'],null))[_0x9ce6('0x23')](respondWithResult(_0xc11cd1,null))[_0x9ce6('0x46')](handleError(_0xc11cd1,null));};exports[_0x9ce6('0x24')]=function(_0x30980c,_0x4dc8db){return db[_0x9ce6('0x40')]['find']({'where':{'id':_0x30980c[_0x9ce6('0x47')]['id']}})[_0x9ce6('0x23')](handleEntityNotFound(_0x4dc8db,null))[_0x9ce6('0x23')](removeEntity(_0x4dc8db,null))['catch'](handleError(_0x4dc8db,null));};exports[_0x9ce6('0x54')]=function(_0x33ea21,_0x127087){var _0x20ac07=0xa;var _0x26f07b=[_0x9ce6('0x55'),_0x9ce6('0x56'),_0x9ce6('0x57'),_0x9ce6('0x58')];var _0xefdfae={'SUM':_0x9ce6('0x59'),'COUNT':_0x9ce6('0x5a'),'COUNT DISTINCT':_0x9ce6('0x5b'),'MAX':'MAX(%s)','MIN':_0x9ce6('0x5c'),'AVG':_0x9ce6('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x422370={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9ce6('0x5e'),'HOUR':_0x9ce6('0x5f'),'ROUND':_0x9ce6('0x60'),'UNIX_TIMESTAMP':_0x9ce6('0x61')};var _0x2c7dd1=function(_0x4d4ce0){return!_[_0x9ce6('0x62')]([_0x9ce6('0x63'),_0x9ce6('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x4d4ce0);};var _0x52d386=function(_0x10c693){if(!_0x10c693||!_0x10c693['rules'][_0x9ce6('0x34')]){return'';}for(var _0x41d905='(',_0xfa9093=0x0;_0xfa9093<_0x10c693['rules'][_0x9ce6('0x34')];_0xfa9093+=0x1){_0xfa9093>0x0&&(_0x41d905+='\x20'+_0x10c693[_0x9ce6('0x65')]+'\x20');_0x41d905+=_0x10c693['rules'][_0xfa9093][_0x9ce6('0x66')]?_0x52d386(_0x10c693['rules'][_0xfa9093][_0x9ce6('0x66')]):_0x10c693[_0x9ce6('0x67')][_0xfa9093]['field']+'\x20'+_0x10c693[_0x9ce6('0x67')][_0xfa9093]['condition']+(_0x2c7dd1(_0x10c693[_0x9ce6('0x67')][_0xfa9093][_0x9ce6('0x68')])?'\x20'+_0x10c693['rules'][_0xfa9093][_0x9ce6('0x69')]:'');}return _0x41d905+')';};var _0x1b3289={'where':{'id':_0x33ea21[_0x9ce6('0x47')]['id']}},_0x2f6d58,_0xbac449,_0x75ceaa,_0x55b290,_0x54819f;_0x1b3289=_[_0x9ce6('0x3e')]({},_0x1b3289,_0x33ea21[_0x9ce6('0x3f')]);return db['AnalyticDefaultReport']['find'](_0x1b3289)['then'](function(_0x11f91f){if(_0x11f91f){_0x2f6d58=_0x11f91f;return _0x11f91f['getFields']();}return null;})[_0x9ce6('0x23')](function(_0x2dde88){if(_0x2dde88){if(!_0x2dde88[_0x9ce6('0x34')]){throw new db[(_0x9ce6('0x6a'))][(_0x9ce6('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xbac449=_0x2dde88;return db[_0x9ce6('0x6c')][_0x9ce6('0x44')]({'raw':!![]});}return null;})[_0x9ce6('0x23')](function(_0x5de91d){if(_0x5de91d){_0x75ceaa=_['keyBy'](_0x5de91d,'id');var _0x533ad6;var _0x171fc9=squel['select']();_0x171fc9[_0x9ce6('0x6d')](_0x2f6d58[_0x9ce6('0x6e')]);for(var _0x2230b4=0x0;_0x2230b4<_0xbac449[_0x9ce6('0x34')];_0x2230b4+=0x1){_0x533ad6=_0xbac449[_0x2230b4]['MetricId']?_0x75ceaa[_0xbac449[_0x2230b4][_0x9ce6('0x6f')]][_0x9ce6('0x70')]:_0xbac449[_0x2230b4]['field'];_0x533ad6=_0xbac449[_0x2230b4]['function']?_['replace'](_0xefdfae[_0xbac449[_0x2230b4]['function']],'%s',_0x533ad6):_0x533ad6;_0x533ad6=_0xbac449[_0x2230b4][_0x9ce6('0x71')]?_['replace'](_0x422370[_0xbac449[_0x2230b4][_0x9ce6('0x71')]],'%s',_0x533ad6):_0x533ad6;if(_0xbac449[_0x2230b4]['groupBy']){_0x171fc9[_0x9ce6('0x66')](_0x533ad6);}_0xbac449[_0x2230b4]['orderBy']&&_0x171fc9[_0x9ce6('0x38')](_0x533ad6,_0xbac449[_0x2230b4]['orderBy']===_0x9ce6('0x72')?![]:!![]);_0x171fc9['field'](_0x533ad6,_0xbac449[_0x2230b4][_0x9ce6('0x73')]||_0x533ad6);}if(_0x2f6d58[_0x9ce6('0x74')]){_0x2f6d58[_0x9ce6('0x74')]=JSON[_0x9ce6('0x75')](_0x2f6d58[_0x9ce6('0x74')]);for(var _0x4e7d81=0x0;_0x4e7d81<_0x2f6d58[_0x9ce6('0x74')]['length'];_0x4e7d81+=0x1){if(_0x2f6d58[_0x9ce6('0x74')][_0x4e7d81]['type']&&_['includes'](_0x26f07b,_0x2f6d58[_0x9ce6('0x74')][_0x4e7d81][_0x9ce6('0x76')])&&_0x2f6d58['joins'][_0x4e7d81]['parentKey']&&_0x2f6d58['joins'][_0x4e7d81][_0x9ce6('0x77')]&&_0x2f6d58[_0x9ce6('0x74')][_0x4e7d81][_0x9ce6('0x78')]){_0x171fc9[_0x2f6d58[_0x9ce6('0x74')][_0x4e7d81]['type']](_0x2f6d58[_0x9ce6('0x74')][_0x4e7d81][_0x9ce6('0x77')],null,util[_0x9ce6('0x71')](_0x9ce6('0x79'),_0x2f6d58[_0x9ce6('0x6e')],_0x2f6d58[_0x9ce6('0x74')][_0x4e7d81][_0x9ce6('0x7a')],_0x2f6d58['joins'][_0x4e7d81][_0x9ce6('0x77')],_0x2f6d58[_0x9ce6('0x74')][_0x4e7d81]['foreignKey']));}}}if(_0x2f6d58[_0x9ce6('0x7b')]){_0x2f6d58[_0x9ce6('0x7b')]=JSON[_0x9ce6('0x75')](_0x2f6d58[_0x9ce6('0x7b')]);_0x171fc9['where'](_0x52d386(_0x2f6d58[_0x9ce6('0x7b')][_0x9ce6('0x66')]));}_0x54819f=_0x171fc9[_0x9ce6('0x7c')]();_0x171fc9['limit'](_0x20ac07);_0x171fc9['offset'](0x0);logger['debug'](_0x9ce6('0x7d'),_0x171fc9[_0x9ce6('0x7e')]());return db[_0x9ce6('0x7f')][_0x9ce6('0x2e')](_0x171fc9[_0x9ce6('0x7e')](),{'type':db[_0x9ce6('0x7f')][_0x9ce6('0x80')]['SELECT']});}})[_0x9ce6('0x23')](respondWithResult(_0x127087,null))[_0x9ce6('0x46')](handleError(_0x127087,null));};function runReport(_0x3ab690,_0xe3148c,_0x148912){var _0x1a1c4a=_0xe3148c[_0x9ce6('0x29')];var _0x5594ac=0xa;var _0xfb9d80=[_0x9ce6('0x55'),_0x9ce6('0x56'),_0x9ce6('0x57'),'cross_join'];var _0x1d9d7c={'SUM':_0x9ce6('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9ce6('0x5b'),'MAX':_0x9ce6('0x81'),'MIN':_0x9ce6('0x5c'),'AVG':_0x9ce6('0x5d'),'GROUP_CONCAT':_0x9ce6('0x82'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9ce6('0x83')};var _0xcf01cd={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9ce6('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x9ce6('0x60'),'UNIX_TIMESTAMP':_0x9ce6('0x61')};var _0x4f8469=function(_0x129510){return!_[_0x9ce6('0x62')]([_0x9ce6('0x63'),_0x9ce6('0x64'),_0x9ce6('0x84'),_0x9ce6('0x85')],_0x129510);};var _0x52c26e=function(_0x289bd8){if(!_0x289bd8||!_0x289bd8[_0x9ce6('0x67')][_0x9ce6('0x34')]){return'';}for(var _0x105397='(',_0x8823f3=0x0;_0x8823f3<_0x289bd8['rules'][_0x9ce6('0x34')];_0x8823f3+=0x1){_0x8823f3>0x0&&(_0x105397+='\x20'+_0x289bd8[_0x9ce6('0x65')]+'\x20');_0x105397+=_0x289bd8[_0x9ce6('0x67')][_0x8823f3][_0x9ce6('0x66')]?_0x52c26e(_0x289bd8[_0x9ce6('0x67')][_0x8823f3][_0x9ce6('0x66')]):_0x289bd8[_0x9ce6('0x67')][_0x8823f3][_0x9ce6('0x86')]+'\x20'+_0x289bd8[_0x9ce6('0x67')][_0x8823f3][_0x9ce6('0x68')]+(_0x4f8469(_0x289bd8[_0x9ce6('0x67')][_0x8823f3][_0x9ce6('0x68')])?'\x20'+_0x289bd8[_0x9ce6('0x67')][_0x8823f3][_0x9ce6('0x69')]:'');}return _0x105397+')';};var _0x570eab={'where':{'id':_0x3ab690['id']}},_0x5bd8d9,_0x320d17,_0x551902,_0x33900c,_0x4637eb;_0x570eab=_[_0x9ce6('0x3e')]({},_0x570eab,_0x148912);return db[_0x9ce6('0x40')][_0x9ce6('0x49')](_0x570eab)[_0x9ce6('0x23')](function(_0x590e49){if(_0x590e49){_0x5bd8d9=_0x590e49;return _0x590e49[_0x9ce6('0x87')]();}return null;})['then'](function(_0x6e2d7d){if(_0x6e2d7d){if(!_0x6e2d7d[_0x9ce6('0x34')]){throw new db['Sequelize']['ValidationErrorItem'](_0x9ce6('0x88'),0x193);}_0x320d17=_0x6e2d7d;return db[_0x9ce6('0x6c')][_0x9ce6('0x44')]({'raw':!![]});}return null;})['then'](function(_0x535aac){if(_0x535aac){_0x551902=_['keyBy'](_0x535aac,'id');var _0x57ad4e;var _0x188902=squel[_0x9ce6('0x89')]();_0x188902[_0x9ce6('0x6d')](_0x5bd8d9[_0x9ce6('0x6e')]);for(var _0x549804=0x0;_0x549804<_0x320d17[_0x9ce6('0x34')];_0x549804+=0x1){_0x57ad4e=_0x320d17[_0x549804]['MetricId']?_0x551902[_0x320d17[_0x549804][_0x9ce6('0x6f')]]['metric']:_0x320d17[_0x549804][_0x9ce6('0x86')];_0x57ad4e=_0x320d17[_0x549804][_0x9ce6('0x8a')]?_[_0x9ce6('0x8b')](_0x1d9d7c[_0x320d17[_0x549804][_0x9ce6('0x8a')]],'%s',_0x57ad4e):_0x57ad4e;_0x57ad4e=_0x320d17[_0x549804][_0x9ce6('0x71')]?_[_0x9ce6('0x8b')](_0xcf01cd[_0x320d17[_0x549804]['format']],'%s',_0x57ad4e):_0x57ad4e;if(_0x320d17[_0x549804]['groupBy']){_0x188902[_0x9ce6('0x66')](_0x57ad4e);}_0x320d17[_0x549804][_0x9ce6('0x8c')]&&_0x188902['order'](_0x57ad4e,_0x320d17[_0x549804][_0x9ce6('0x8c')]==='DESC'?![]:!![]);_0x188902[_0x9ce6('0x86')](_0x57ad4e,_0x320d17[_0x549804][_0x9ce6('0x73')]||_0x57ad4e);}if(_0x5bd8d9['joins']){_0x5bd8d9['joins']=JSON[_0x9ce6('0x75')](_0x5bd8d9[_0x9ce6('0x74')]);for(var _0x306273=0x0;_0x306273<_0x5bd8d9[_0x9ce6('0x74')][_0x9ce6('0x34')];_0x306273+=0x1){if(_0x5bd8d9[_0x9ce6('0x74')][_0x306273]['type']&&_[_0x9ce6('0x62')](_0xfb9d80,_0x5bd8d9[_0x9ce6('0x74')][_0x306273]['type'])&&_0x5bd8d9[_0x9ce6('0x74')][_0x306273][_0x9ce6('0x7a')]&&_0x5bd8d9[_0x9ce6('0x74')][_0x306273]['foreignTable']&&_0x5bd8d9[_0x9ce6('0x74')][_0x306273][_0x9ce6('0x78')]){_0x188902[_0x5bd8d9[_0x9ce6('0x74')][_0x306273][_0x9ce6('0x76')]](_0x5bd8d9['joins'][_0x306273][_0x9ce6('0x77')],null,util[_0x9ce6('0x71')](_0x9ce6('0x79'),_0x5bd8d9[_0x9ce6('0x6e')],_0x5bd8d9[_0x9ce6('0x74')][_0x306273][_0x9ce6('0x7a')],_0x5bd8d9[_0x9ce6('0x74')][_0x306273][_0x9ce6('0x77')],_0x5bd8d9[_0x9ce6('0x74')][_0x306273]['foreignKey']));}}}if(_0x5bd8d9[_0x9ce6('0x7b')]){_0x5bd8d9[_0x9ce6('0x7b')]=JSON[_0x9ce6('0x75')](_0x5bd8d9[_0x9ce6('0x7b')]);_0x188902[_0x9ce6('0x3c')](_0x52c26e(_0x5bd8d9[_0x9ce6('0x7b')][_0x9ce6('0x66')]));}_0x4637eb=_0x188902[_0x9ce6('0x7c')]();_0x188902[_0x9ce6('0x37')](_0x5594ac);_0x188902[_0x9ce6('0x1c')](0x0);logger['debug'](_0x9ce6('0x7d'),_0x188902[_0x9ce6('0x7e')]());return db[_0x9ce6('0x7f')][_0x9ce6('0x2e')](_0x188902[_0x9ce6('0x7e')](),{'type':db[_0x9ce6('0x7f')][_0x9ce6('0x80')][_0x9ce6('0x8d')]});}})[_0x9ce6('0x23')](function(_0x5cbca2){if(!_0x5cbca2[_0x9ce6('0x34')]){throw new db[(_0x9ce6('0x6a'))]['ValidationErrorItem'](_0x9ce6('0x8e'),0xcc);}if(_0xe3148c[_0x9ce6('0x8f')]===_0x9ce6('0x90')){return null;}var _0x5e2e06=_[_0x9ce6('0x3e')](_0xe3148c,{'name':_0xe3148c[_0x9ce6('0x91')]||_0xe3148c[_0x9ce6('0x29')]||_0x5bd8d9[_0x9ce6('0x29')],'basename':_0x1a1c4a,'savename':util[_0x9ce6('0x71')](_0x9ce6('0x92'),_0xe3148c[_0x9ce6('0x29')]||_0x5bd8d9[_0x9ce6('0x29')],require('randomstring')['generate'](0x4),_0xe3148c[_0x9ce6('0x8f')]||_0x9ce6('0x93')),'reportId':_0x5bd8d9['id'],'reportType':'default'});return db[_0x9ce6('0x94')][_0x9ce6('0x4a')](_0x5e2e06,{'raw':!![]});})[_0x9ce6('0x23')](function(_0xb3b6ca){if(_0x5bd8d9[_0x9ce6('0x6e')]==='cdr'){_0x4637eb[_0x9ce6('0x3c')](_0x5bd8d9['table']+_0x9ce6('0x95'),_0xe3148c['startDate'],_0xe3148c[_0x9ce6('0x96')]);}else{_0x4637eb[_0x9ce6('0x3c')](_0x5bd8d9[_0x9ce6('0x6e')]+_0x9ce6('0x97'),_0xe3148c['startDate'],_0xe3148c[_0x9ce6('0x96')]);}if(_0xb3b6ca){logger[_0x9ce6('0x98')](_0x9ce6('0x99'),_0x4637eb[_0x9ce6('0x7e')]());require('child_process')[_0x9ce6('0x9a')](path[_0x9ce6('0x55')](__dirname,_0x9ce6('0x9b'),_0xb3b6ca[_0x9ce6('0x8f')]),[_0xb3b6ca['id'],_0x4637eb[_0x9ce6('0x7e')](),path[_0x9ce6('0x55')](__dirname,_0x9ce6('0x9c'),_0xb3b6ca[_0x9ce6('0x9d')]),_0x1a1c4a]);return _0xb3b6ca;}else{var _0x56cd7d=squel['select']();_0x56cd7d[_0x9ce6('0x6d')]('('+_0x4637eb['toString']()+')',_0x9ce6('0x9e'));_0x56cd7d[_0x9ce6('0x86')](_0x9ce6('0x9f'),_0x9ce6('0x41'));_0x4637eb['limit'](_0xe3148c[_0x9ce6('0x37')]||_0x5594ac);_0x4637eb[_0x9ce6('0x1c')](_0xe3148c[_0x9ce6('0x1c')]||0x0);return db[_0x9ce6('0x7f')][_0x9ce6('0x2e')](_0x56cd7d[_0x9ce6('0x7e')](),{'type':db[_0x9ce6('0x7f')]['QueryTypes'][_0x9ce6('0x8d')]})[_0x9ce6('0x23')](function(_0x2f97dd){if(!_0x2f97dd['length']){_0x33900c=0x0;}else{_0x33900c=_0x2f97dd[0x0]['count']||0x0;}return db[_0x9ce6('0x7f')][_0x9ce6('0x2e')](_0x4637eb[_0x9ce6('0x7e')](),{'type':db[_0x9ce6('0x7f')]['QueryTypes'][_0x9ce6('0x8d')]});})['then'](function(_0x48a0d0){return{'rows':_0x48a0d0||[],'count':_0x33900c};});}});}exports[_0x9ce6('0xa0')]=function(_0x1c774c,_0x171c49){return runReport(_0x1c774c[_0x9ce6('0x47')],_0x1c774c['query'],_0x1c774c['options'])[_0x9ce6('0x23')](respondWithResult(_0x171c49,null))[_0x9ce6('0x46')](handleError(_0x171c49,null));};exports[_0x9ce6('0xa1')]=runReport;exports['query']=function(_0x5b695a,_0x188edb){var _0x301c47=0xa;var _0x2a8e38=[_0x9ce6('0x55'),_0x9ce6('0x56'),_0x9ce6('0x57'),_0x9ce6('0x58')];var _0x5c1a4f={'SUM':_0x9ce6('0x59'),'COUNT':_0x9ce6('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9ce6('0x81'),'MIN':_0x9ce6('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9ce6('0x82'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9ce6('0x83')};var _0x9853eb={'SEC_TO_TIME':_0x9ce6('0xa2'),'DATE':'DATE(%s)','HOUR':_0x9ce6('0x5f'),'ROUND':_0x9ce6('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2b4705=function(_0x2f6be4){return!_['includes']([_0x9ce6('0x63'),_0x9ce6('0x64'),_0x9ce6('0x84'),_0x9ce6('0x85')],_0x2f6be4);};var _0x1efe0e=function(_0x15fca6){if(!_0x15fca6||!_0x15fca6['rules'][_0x9ce6('0x34')]){return'';}for(var _0x563b23='(',_0x1241fc=0x0;_0x1241fc<_0x15fca6['rules'][_0x9ce6('0x34')];_0x1241fc+=0x1){_0x1241fc>0x0&&(_0x563b23+='\x20'+_0x15fca6[_0x9ce6('0x65')]+'\x20');_0x563b23+=_0x15fca6[_0x9ce6('0x67')][_0x1241fc]['group']?_0x1efe0e(_0x15fca6[_0x9ce6('0x67')][_0x1241fc]['group']):_0x15fca6['rules'][_0x1241fc]['field']+'\x20'+_0x15fca6[_0x9ce6('0x67')][_0x1241fc][_0x9ce6('0x68')]+(_0x2b4705(_0x15fca6[_0x9ce6('0x67')][_0x1241fc][_0x9ce6('0x68')])?'\x20'+_0x15fca6['rules'][_0x1241fc][_0x9ce6('0x69')]:'');}return _0x563b23+')';};var _0x5b7556={'where':{'id':_0x5b695a[_0x9ce6('0x47')]['id']}},_0x1a892b,_0x264b41,_0xdb5124,_0x1161f2,_0x2c0c2f;_0x5b7556=_['merge']({},_0x5b7556,_0x5b695a['options']);return db[_0x9ce6('0x40')]['find'](_0x5b7556)[_0x9ce6('0x23')](function(_0x10472f){if(_0x10472f){_0x1a892b=_0x10472f;return _0x10472f['getFields']();}return null;})[_0x9ce6('0x23')](function(_0x47101c){if(_0x47101c){if(!_0x47101c[_0x9ce6('0x34')]){throw new db[(_0x9ce6('0x6a'))][(_0x9ce6('0x6b'))](_0x9ce6('0x88'),0x193);}_0x264b41=_0x47101c;return db[_0x9ce6('0x6c')][_0x9ce6('0x44')]({'raw':!![]});}return null;})['then'](function(_0x1de9e7){if(_0x1de9e7){_0xdb5124=_[_0x9ce6('0xa3')](_0x1de9e7,'id');var _0x31830a;var _0x42d434=squel[_0x9ce6('0x89')]();_0x42d434[_0x9ce6('0x6d')](_0x1a892b['table']);for(var _0x460b96=0x0;_0x460b96<_0x264b41[_0x9ce6('0x34')];_0x460b96+=0x1){_0x31830a=_0x264b41[_0x460b96][_0x9ce6('0x6f')]?_0xdb5124[_0x264b41[_0x460b96][_0x9ce6('0x6f')]][_0x9ce6('0x70')]:_0x264b41[_0x460b96][_0x9ce6('0x86')];_0x31830a=_0x264b41[_0x460b96][_0x9ce6('0x8a')]?_['replace'](_0x5c1a4f[_0x264b41[_0x460b96][_0x9ce6('0x8a')]],'%s',_0x31830a):_0x31830a;_0x31830a=_0x264b41[_0x460b96][_0x9ce6('0x71')]?_[_0x9ce6('0x8b')](_0x9853eb[_0x264b41[_0x460b96]['format']],'%s',_0x31830a):_0x31830a;if(_0x264b41[_0x460b96][_0x9ce6('0xa4')]){_0x42d434['group'](_0x31830a);}_0x264b41[_0x460b96]['orderBy']&&_0x42d434[_0x9ce6('0x38')](_0x31830a,_0x264b41[_0x460b96][_0x9ce6('0x8c')]===_0x9ce6('0x72')?![]:!![]);_0x42d434[_0x9ce6('0x86')](_0x31830a,_0x264b41[_0x460b96][_0x9ce6('0x73')]||_0x31830a);}if(_0x1a892b[_0x9ce6('0x74')]){_0x1a892b[_0x9ce6('0x74')]=JSON[_0x9ce6('0x75')](_0x1a892b['joins']);for(var _0x49357c=0x0;_0x49357c<_0x1a892b[_0x9ce6('0x74')]['length'];_0x49357c+=0x1){if(_0x1a892b[_0x9ce6('0x74')][_0x49357c][_0x9ce6('0x76')]&&_[_0x9ce6('0x62')](_0x2a8e38,_0x1a892b[_0x9ce6('0x74')][_0x49357c][_0x9ce6('0x76')])&&_0x1a892b[_0x9ce6('0x74')][_0x49357c][_0x9ce6('0x7a')]&&_0x1a892b[_0x9ce6('0x74')][_0x49357c][_0x9ce6('0x77')]&&_0x1a892b[_0x9ce6('0x74')][_0x49357c][_0x9ce6('0x78')]){_0x42d434[_0x1a892b[_0x9ce6('0x74')][_0x49357c]['type']](_0x1a892b['joins'][_0x49357c][_0x9ce6('0x77')],null,util[_0x9ce6('0x71')](_0x9ce6('0x79'),_0x1a892b[_0x9ce6('0x6e')],_0x1a892b[_0x9ce6('0x74')][_0x49357c][_0x9ce6('0x7a')],_0x1a892b[_0x9ce6('0x74')][_0x49357c][_0x9ce6('0x77')],_0x1a892b['joins'][_0x49357c][_0x9ce6('0x78')]));}}}if(_0x1a892b[_0x9ce6('0x7b')]){_0x1a892b[_0x9ce6('0x7b')]=JSON[_0x9ce6('0x75')](_0x1a892b[_0x9ce6('0x7b')]);_0x42d434[_0x9ce6('0x3c')](_0x1efe0e(_0x1a892b[_0x9ce6('0x7b')][_0x9ce6('0x66')]));}_0x2c0c2f=_0x42d434[_0x9ce6('0x7c')]();_0x42d434[_0x9ce6('0x37')](_0x301c47);_0x42d434[_0x9ce6('0x1c')](0x0);logger[_0x9ce6('0xa5')](_0x9ce6('0x7d'),_0x42d434[_0x9ce6('0x7e')]());return db['sequelize']['query'](_0x42d434[_0x9ce6('0x7e')](),{'type':db['sequelize'][_0x9ce6('0x80')]['SELECT']});}})[_0x9ce6('0x23')](function(){return{'sql':_0x2c0c2f['toString']()};})[_0x9ce6('0x23')](respondWithResult(_0x188edb,null))[_0x9ce6('0x46')](handleError(_0x188edb,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 69195c5..bac0eb8 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 _0x75e0=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0x75e0,0x1c8));var _0x075e=function(_0x15cdf6,_0x3c3513){_0x15cdf6=_0x15cdf6-0x0;var _0x867f96=_0x75e0[_0x15cdf6];return _0x867f96;};'use strict';var _=require(_0x075e('0x0'));var util=require(_0x075e('0x1'));var logger=require(_0x075e('0x2'))('api');var moment=require(_0x075e('0x3'));var BPromise=require(_0x075e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x075e('0x5'));var rimraf=require('rimraf');var config=require(_0x075e('0x6'));var attributes=require(_0x075e('0x7'));module[_0x075e('0x8')]=function(_0x17a2ff,_0x379b0e){return _0x17a2ff[_0x075e('0x9')](_0x075e('0xa'),attributes,{'tableName':_0x075e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4156=['path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0x4156,0xf1));var _0x6415=function(_0x5ad6bd,_0x32c25a){_0x5ad6bd=_0x5ad6bd-0x0;var _0x12e34b=_0x4156[_0x5ad6bd];return _0x12e34b;};'use strict';var _=require(_0x6415('0x0'));var util=require(_0x6415('0x1'));var logger=require(_0x6415('0x2'))(_0x6415('0x3'));var moment=require(_0x6415('0x4'));var BPromise=require('bluebird');var rp=require(_0x6415('0x5'));var fs=require('fs');var path=require(_0x6415('0x6'));var rimraf=require(_0x6415('0x7'));var config=require(_0x6415('0x8'));var attributes=require(_0x6415('0x9'));module[_0x6415('0xa')]=function(_0x192a98,_0x496a42){return _0x192a98[_0x6415('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0x6415('0xc'),'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 4aaf117..3a0c707 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 _0xc7a7=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x3d7a30,_0x32b595){var _0x3a8df5=function(_0x826d04){while(--_0x826d04){_0x3d7a30['push'](_0x3d7a30['shift']());}};_0x3a8df5(++_0x32b595);}(_0xc7a7,0x171));var _0x7c7a=function(_0x2fdb15,_0xf60263){_0x2fdb15=_0x2fdb15-0x0;var _0xc7032e=_0xc7a7[_0x2fdb15];return _0xc7032e;};'use strict';var _=require(_0x7c7a('0x0'));var util=require(_0x7c7a('0x1'));var moment=require(_0x7c7a('0x2'));var BPromise=require('bluebird');var rs=require(_0x7c7a('0x3'));var fs=require('fs');var Redis=require(_0x7c7a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c7a('0x5'));var logger=require(_0x7c7a('0x6'))(_0x7c7a('0x7'));var config=require(_0x7c7a('0x8'));var jayson=require(_0x7c7a('0x9'));var client=jayson[_0x7c7a('0xa')][_0x7c7a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19467e,_0x5992cf,_0x361567){return new BPromise(function(_0x43e2af,_0x33637d){return client['request'](_0x19467e,_0x361567)[_0x7c7a('0xc')](function(_0x19070c){logger[_0x7c7a('0xd')](_0x7c7a('0xe'),_0x5992cf,_0x7c7a('0xf'));logger[_0x7c7a('0x10')](_0x7c7a('0x11'),_0x5992cf,_0x7c7a('0xf'),JSON['stringify'](_0x19070c));if(_0x19070c[_0x7c7a('0x12')]){if(_0x19070c[_0x7c7a('0x12')][_0x7c7a('0x13')]===0x1f4){logger[_0x7c7a('0x12')](_0x7c7a('0xe'),_0x5992cf,_0x19070c[_0x7c7a('0x12')][_0x7c7a('0x14')]);return _0x33637d(_0x19070c['error'][_0x7c7a('0x14')]);}logger[_0x7c7a('0x12')](_0x7c7a('0xe'),_0x5992cf,_0x19070c[_0x7c7a('0x12')][_0x7c7a('0x14')]);return _0x43e2af(_0x19070c['error'][_0x7c7a('0x14')]);}else{logger['info'](_0x7c7a('0xe'),_0x5992cf,_0x7c7a('0xf'));_0x43e2af(_0x19070c[_0x7c7a('0x15')][_0x7c7a('0x14')]);}})[_0x7c7a('0x16')](function(_0x4687f2){logger[_0x7c7a('0x12')](_0x7c7a('0xe'),_0x5992cf,_0x4687f2);_0x33637d(_0x4687f2);});});} \ No newline at end of file +var _0x980c=['../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x531c12,_0x538d2c){var _0x2a5d7a=function(_0x26c7b7){while(--_0x26c7b7){_0x531c12['push'](_0x531c12['shift']());}};_0x2a5d7a(++_0x538d2c);}(_0x980c,0x100));var _0xc980=function(_0x45735f,_0x32c051){_0x45735f=_0x45735f-0x0;var _0x2cabf1=_0x980c[_0x45735f];return _0x2cabf1;};'use strict';var _=require(_0xc980('0x0'));var util=require(_0xc980('0x1'));var moment=require(_0xc980('0x2'));var BPromise=require(_0xc980('0x3'));var rs=require(_0xc980('0x4'));var fs=require('fs');var Redis=require(_0xc980('0x5'));var db=require(_0xc980('0x6'))['db'];var utils=require(_0xc980('0x7'));var logger=require(_0xc980('0x8'))(_0xc980('0x9'));var config=require(_0xc980('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc980('0xb')][_0xc980('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36d2dd,_0x3175e7,_0x389546){return new BPromise(function(_0x4523c0,_0x355bfa){return client['request'](_0x36d2dd,_0x389546)['then'](function(_0x5b99c8){logger[_0xc980('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3175e7,_0xc980('0xe'));logger[_0xc980('0xf')](_0xc980('0x10'),_0x3175e7,'request\x20sent',JSON[_0xc980('0x11')](_0x5b99c8));if(_0x5b99c8[_0xc980('0x12')]){if(_0x5b99c8[_0xc980('0x12')]['code']===0x1f4){logger[_0xc980('0x12')](_0xc980('0x13'),_0x3175e7,_0x5b99c8[_0xc980('0x12')][_0xc980('0x14')]);return _0x355bfa(_0x5b99c8[_0xc980('0x12')][_0xc980('0x14')]);}logger[_0xc980('0x12')](_0xc980('0x13'),_0x3175e7,_0x5b99c8[_0xc980('0x12')][_0xc980('0x14')]);return _0x4523c0(_0x5b99c8[_0xc980('0x12')][_0xc980('0x14')]);}else{logger[_0xc980('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3175e7,'request\x20sent');_0x4523c0(_0x5b99c8[_0xc980('0x15')]['message']);}})['catch'](function(_0x1d1de0){logger[_0xc980('0x12')](_0xc980('0x13'),_0x3175e7,_0x1d1de0);_0x355bfa(_0x1d1de0);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 4460a99..6b56250 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 _0xb493=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb493,0x1bd));var _0x3b49=function(_0x18944f,_0x5b8ff3){_0x18944f=_0x18944f-0x0;var _0x3f4fe5=_0xb493[_0x18944f];return _0x3f4fe5;};'use strict';var multer=require(_0x3b49('0x0'));var util=require(_0x3b49('0x1'));var path=require(_0x3b49('0x2'));var timeout=require('connect-timeout');var express=require(_0x3b49('0x3'));var router=express[_0x3b49('0x4')]();var auth=require(_0x3b49('0x5'));var interaction=require(_0x3b49('0x6'));var config=require(_0x3b49('0x7'));var controller=require(_0x3b49('0x8'));router[_0x3b49('0x9')]('/',auth[_0x3b49('0xa')](),controller[_0x3b49('0xb')]);router[_0x3b49('0x9')]('/:id',auth[_0x3b49('0xa')](),controller['show']);router['get'](_0x3b49('0xc'),auth[_0x3b49('0xa')](),controller['preview']);router[_0x3b49('0x9')](_0x3b49('0xd'),auth[_0x3b49('0xa')](),controller[_0x3b49('0xe')]);router[_0x3b49('0x9')](_0x3b49('0xf'),auth[_0x3b49('0xa')](),controller[_0x3b49('0x10')]);router[_0x3b49('0x11')]('/',auth[_0x3b49('0xa')](),controller[_0x3b49('0x12')]);router[_0x3b49('0x13')](_0x3b49('0x14'),auth[_0x3b49('0xa')](),controller[_0x3b49('0x15')]);router[_0x3b49('0x16')]('/:id',auth[_0x3b49('0xa')](),controller[_0x3b49('0x17')]);module[_0x3b49('0x18')]=router; \ No newline at end of file +var _0x75fb=['update','delete','/:id','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','get','show','/:id/preview','preview','/:id/run','run','query','create','put'];(function(_0x4f98c6,_0x39e6c6){var _0x37f22b=function(_0x3b8ff9){while(--_0x3b8ff9){_0x4f98c6['push'](_0x4f98c6['shift']());}};_0x37f22b(++_0x39e6c6);}(_0x75fb,0x8e));var _0xb75f=function(_0x439a86,_0x58fe51){_0x439a86=_0x439a86-0x0;var _0x3f8f96=_0x75fb[_0x439a86];return _0x3f8f96;};'use strict';var multer=require(_0xb75f('0x0'));var util=require(_0xb75f('0x1'));var path=require('path');var timeout=require(_0xb75f('0x2'));var express=require(_0xb75f('0x3'));var router=express[_0xb75f('0x4')]();var auth=require(_0xb75f('0x5'));var interaction=require(_0xb75f('0x6'));var config=require(_0xb75f('0x7'));var controller=require(_0xb75f('0x8'));router['get']('/',auth[_0xb75f('0x9')](),controller['index']);router[_0xb75f('0xa')]('/:id',auth[_0xb75f('0x9')](),controller[_0xb75f('0xb')]);router[_0xb75f('0xa')](_0xb75f('0xc'),auth[_0xb75f('0x9')](),controller[_0xb75f('0xd')]);router[_0xb75f('0xa')](_0xb75f('0xe'),auth[_0xb75f('0x9')](),controller[_0xb75f('0xf')]);router[_0xb75f('0xa')]('/:id/query',auth[_0xb75f('0x9')](),controller[_0xb75f('0x10')]);router['post']('/',auth[_0xb75f('0x9')](),controller[_0xb75f('0x11')]);router[_0xb75f('0x12')]('/:id',auth[_0xb75f('0x9')](),controller[_0xb75f('0x13')]);router[_0xb75f('0x14')](_0xb75f('0x15'),auth[_0xb75f('0x9')](),controller[_0xb75f('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index bbb300c..a59b045 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 _0xa9e2=['xlsx','Loading','manual','scheduled','UNSIGNED','sequelize','moment','exports','STRING','ENUM'];(function(_0x2777b0,_0x2a5ef7){var _0x4a15ed=function(_0x2c6e0e){while(--_0x2c6e0e){_0x2777b0['push'](_0x2777b0['shift']());}};_0x4a15ed(++_0x2a5ef7);}(_0xa9e2,0x1d1));var _0x2a9e=function(_0x43f180,_0x1c7ce4){_0x43f180=_0x43f180-0x0;var _0x552742=_0xa9e2[_0x43f180];return _0x552742;};'use strict';var Sequelize=require(_0x2a9e('0x0'));var moment=require(_0x2a9e('0x1'));module[_0x2a9e('0x2')]={'name':{'type':Sequelize[_0x2a9e('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2a9e('0x4')]('csv','pdf',_0x2a9e('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x2a9e('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x2a9e('0x3')],'defaultValue':_0x2a9e('0x6')},'type':{'type':Sequelize[_0x2a9e('0x4')](_0x2a9e('0x7'),_0x2a9e('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x2a9e('0x9')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf23f=['STRING','ENUM','pdf','xlsx','csv','DATE','scheduled','manual','INTEGER','UNSIGNED','sequelize','moment','exports'];(function(_0x335d2d,_0x26e065){var _0x379073=function(_0x51f553){while(--_0x51f553){_0x335d2d['push'](_0x335d2d['shift']());}};_0x379073(++_0x26e065);}(_0xf23f,0x15c));var _0xff23=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0xf23f[_0x3a6e4b];return _0x36572d;};'use strict';var Sequelize=require(_0xff23('0x0'));var moment=require(_0xff23('0x1'));module[_0xff23('0x2')]={'name':{'type':Sequelize[_0xff23('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xff23('0x4')]('csv',_0xff23('0x5'),_0xff23('0x6')),'allowNull':![],'defaultValue':_0xff23('0x7')},'savename':{'type':Sequelize[_0xff23('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xff23('0x8')]},'endDate':{'type':Sequelize[_0xff23('0x8')]},'status':{'type':Sequelize[_0xff23('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xff23('0x4')]('manual',_0xff23('0x9')),'allowNull':![],'defaultValue':_0xff23('0xa')},'reportId':{'type':Sequelize[_0xff23('0xb')](0xb)[_0xff23('0xc')]},'reportType':{'type':Sequelize[_0xff23('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 772abcb..19d497b 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 _0xac6b=['get','ExtractedReports','sendStatus','stack','name','send','index','rawAttributes','type','key','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','AnalyticExtractedReport','include','findAll','rows','catch','show','params','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','savename','format','%s.%s','basename','toLowerCase','html-pdf','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','status','end','count','offset','limit','set','json','apply','save','then','destroy'];(function(_0x3dfa7d,_0x2b1622){var _0x5a0a42=function(_0x5cdd10){while(--_0x5cdd10){_0x3dfa7d['push'](_0x3dfa7d['shift']());}};_0x5a0a42(++_0x2b1622);}(_0xac6b,0x9a));var _0xbac6=function(_0x51b9aa,_0x330a93){_0x51b9aa=_0x51b9aa-0x0;var _0x1f5bae=_0xac6b[_0x51b9aa];return _0x1f5bae;};'use strict';var pdf=require(_0xbac6('0x0'));var emlformat=require(_0xbac6('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbac6('0x2'));var moment=require(_0xbac6('0x3'));var BPromise=require(_0xbac6('0x4'));var Mustache=require(_0xbac6('0x5'));var util=require('util');var path=require(_0xbac6('0x6'));var sox=require(_0xbac6('0x7'));var csv=require(_0xbac6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbac6('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbac6('0xa'));var deskjs=require(_0xbac6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbac6('0xc'));var Papa=require(_0xbac6('0xd'));var Redis=require(_0xbac6('0xe'));var authService=require(_0xbac6('0xf'));var qs=require(_0xbac6('0x10'));var as=require(_0xbac6('0x11'));var hardwareService=require(_0xbac6('0x12'));var logger=require(_0xbac6('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xbac6('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ea313,_0x47fa49){_0x47fa49=_0x47fa49||0xcc;return function(_0x1f5af2){if(_0x1f5af2){return _0x4ea313['sendStatus'](_0x47fa49);}return _0x4ea313[_0xbac6('0x15')](_0x47fa49)[_0xbac6('0x16')]();};}function respondWithResult(_0x189133,_0x19d2e9){_0x19d2e9=_0x19d2e9||0xc8;return function(_0x20a6ff){if(_0x20a6ff){return _0x189133[_0xbac6('0x15')](_0x19d2e9)['json'](_0x20a6ff);}};}function respondWithFilteredResult(_0x4479b5,_0x421370){return function(_0x2e172b){if(_0x2e172b){var _0x288077=_0x2e172b[_0xbac6('0x17')],_0x262b5f=_0x421370['offset'],_0x15ae5f=_0x421370[_0xbac6('0x18')]+_0x421370[_0xbac6('0x19')],_0x4be4f1;if(_0x15ae5f>=_0x288077){_0x15ae5f=_0x288077;_0x4be4f1=0xc8;}else{_0x4be4f1=0xce;}_0x4479b5[_0xbac6('0x15')](_0x4be4f1);return _0x4479b5[_0xbac6('0x1a')]('Content-Range',_0x262b5f+'-'+_0x15ae5f+'/'+_0x288077)[_0xbac6('0x1b')](_0x2e172b);}return null;};}function patchUpdates(_0xae3cce){return function(_0x15ea69){try{jsonpatch[_0xbac6('0x1c')](_0x15ea69,_0xae3cce,!![]);}catch(_0x4ab49c){return BPromise['reject'](_0x4ab49c);}return _0x15ea69[_0xbac6('0x1d')]();};}function saveUpdates(_0x39fbb4,_0x4d97cb){return function(_0x3c23f1){if(_0x3c23f1){return _0x3c23f1['update'](_0x39fbb4)[_0xbac6('0x1e')](function(_0x8a1b92){return _0x8a1b92;});}return null;};}function removeEntity(_0x436c26,_0x393ab0){return function(_0x370b99){if(_0x370b99){return _0x370b99[_0xbac6('0x1f')]()[_0xbac6('0x1e')](function(){var _0x3390fd=_0x370b99[_0xbac6('0x20')]({'plain':!![]});var _0x11eba7=_0xbac6('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x11eba7,'resourceId':_0x3390fd['id']}})[_0xbac6('0x1e')](function(){return _0x370b99;});})['then'](function(){_0x436c26[_0xbac6('0x15')](0xcc)[_0xbac6('0x16')]();});}};}function handleEntityNotFound(_0xcbe443,_0x300807){return function(_0x556e2d){if(!_0x556e2d){_0xcbe443[_0xbac6('0x22')](0x194);}return _0x556e2d;};}function handleError(_0x784578,_0x510f23){_0x510f23=_0x510f23||0x1f4;return function(_0x2636c4){logger['error'](_0x2636c4[_0xbac6('0x23')]);if(_0x2636c4['name']){delete _0x2636c4[_0xbac6('0x24')];}_0x784578[_0xbac6('0x15')](_0x510f23)[_0xbac6('0x25')](_0x2636c4);};}exports[_0xbac6('0x26')]=function(_0x483c28,_0x376270){var _0x26fd82={},_0x19698a={},_0x271d22={'count':0x0,'rows':[]};var _0x1cbf8d=_['map'](db['AnalyticExtractedReport'][_0xbac6('0x27')],function(_0xf2d32f){return{'name':_0xf2d32f['fieldName'],'type':_0xf2d32f[_0xbac6('0x28')][_0xbac6('0x29')]};});_0x19698a['model']=_[_0xbac6('0x2a')](_0x1cbf8d,'name');_0x19698a[_0xbac6('0x2b')]=_[_0xbac6('0x2c')](_0x483c28[_0xbac6('0x2b')]);_0x19698a[_0xbac6('0x2d')]=_[_0xbac6('0x2e')](_0x19698a['model'],_0x19698a[_0xbac6('0x2b')]);_0x26fd82[_0xbac6('0x2f')]=_[_0xbac6('0x2e')](_0x19698a[_0xbac6('0x30')],qs[_0xbac6('0x31')](_0x483c28['query'][_0xbac6('0x31')]));_0x26fd82[_0xbac6('0x2f')]=_0x26fd82[_0xbac6('0x2f')]['length']?_0x26fd82[_0xbac6('0x2f')]:_0x19698a[_0xbac6('0x30')];if(!_0x483c28[_0xbac6('0x2b')][_0xbac6('0x32')](_0xbac6('0x33'))){_0x26fd82['limit']=qs['limit'](_0x483c28[_0xbac6('0x2b')]['limit']);_0x26fd82[_0xbac6('0x18')]=qs[_0xbac6('0x18')](_0x483c28['query'][_0xbac6('0x18')]);}_0x26fd82[_0xbac6('0x34')]=qs[_0xbac6('0x35')](_0x483c28[_0xbac6('0x2b')]['sort']);_0x26fd82[_0xbac6('0x36')]=qs[_0xbac6('0x2d')](_[_0xbac6('0x37')](_0x483c28[_0xbac6('0x2b')],_0x19698a[_0xbac6('0x2d')]));if(_0x483c28[_0xbac6('0x2b')][_0xbac6('0x38')]){_0x26fd82[_0xbac6('0x36')]=_['merge'](_0x26fd82[_0xbac6('0x36')],{'$or':_[_0xbac6('0x2a')](_0x1cbf8d,function(_0x45dd27){if(_0x45dd27['type']!=='VIRTUAL'){var _0x1463ab={};_0x1463ab[_0x45dd27[_0xbac6('0x24')]]={'$like':'%'+_0x483c28['query']['filter']+'%'};return _0x1463ab;}})});}_0x26fd82=_[_0xbac6('0x39')]({},_0x26fd82,_0x483c28[_0xbac6('0x3a')]);var _0x440e89={'where':_0x26fd82[_0xbac6('0x36')]};return db[_0xbac6('0x3b')][_0xbac6('0x17')](_0x440e89)[_0xbac6('0x1e')](function(_0x168ae5){_0x271d22[_0xbac6('0x17')]=_0x168ae5;if(_0x483c28[_0xbac6('0x2b')]['includeAll']){_0x26fd82[_0xbac6('0x3c')]=[{'all':!![]}];}return db[_0xbac6('0x3b')][_0xbac6('0x3d')](_0x26fd82);})[_0xbac6('0x1e')](function(_0x483ec6){_0x271d22[_0xbac6('0x3e')]=_0x483ec6;return _0x271d22;})['then'](respondWithFilteredResult(_0x376270,_0x26fd82))[_0xbac6('0x3f')](handleError(_0x376270,null));};exports[_0xbac6('0x40')]=function(_0x557bb8,_0x54e06e){var _0x73b57={'raw':!![],'where':{'id':_0x557bb8[_0xbac6('0x41')]['id']}},_0x48a077={};_0x48a077[_0xbac6('0x30')]=_['keys'](db[_0xbac6('0x3b')][_0xbac6('0x27')]);_0x48a077[_0xbac6('0x2b')]=_[_0xbac6('0x2c')](_0x557bb8['query']);_0x48a077[_0xbac6('0x2d')]=_[_0xbac6('0x2e')](_0x48a077[_0xbac6('0x30')],_0x48a077['query']);_0x73b57[_0xbac6('0x2f')]=_[_0xbac6('0x2e')](_0x48a077[_0xbac6('0x30')],qs[_0xbac6('0x31')](_0x557bb8['query'][_0xbac6('0x31')]));_0x73b57[_0xbac6('0x2f')]=_0x73b57[_0xbac6('0x2f')]['length']?_0x73b57[_0xbac6('0x2f')]:_0x48a077['model'];if(_0x557bb8[_0xbac6('0x2b')][_0xbac6('0x42')]){_0x73b57['include']=[{'all':!![]}];}_0x73b57=_[_0xbac6('0x39')]({},_0x73b57,_0x557bb8[_0xbac6('0x3a')]);return db[_0xbac6('0x3b')]['find'](_0x73b57)['then'](handleEntityNotFound(_0x54e06e,null))[_0xbac6('0x1e')](respondWithResult(_0x54e06e,null))[_0xbac6('0x3f')](handleError(_0x54e06e,null));};exports[_0xbac6('0x43')]=function(_0x41da51,_0x175fa9){return db[_0xbac6('0x3b')][_0xbac6('0x43')](_0x41da51[_0xbac6('0x44')],{})['then'](function(_0x26ea62){var _0x4005f7=_0x41da51['user'][_0xbac6('0x20')]({'plain':!![]});if(!_0x4005f7)throw new Error(_0xbac6('0x45'));if(_0x4005f7[_0xbac6('0x46')]==='user'){var _0x46fed2=_0x26ea62['get']({'plain':!![]});var _0x525ca1=_0xbac6('0x21');return db[_0xbac6('0x47')][_0xbac6('0x48')]({'where':{'name':_0x525ca1,'userProfileId':_0x4005f7[_0xbac6('0x49')]},'raw':!![]})[_0xbac6('0x1e')](function(_0xfabdcf){if(_0xfabdcf&&_0xfabdcf[_0xbac6('0x4a')]===0x0){return db['UserProfileResource'][_0xbac6('0x43')]({'name':_0x46fed2[_0xbac6('0x24')],'resourceId':_0x46fed2['id'],'type':_0xfabdcf['name'],'sectionId':_0xfabdcf['id']},{})['then'](function(){return _0x26ea62;});}else{return _0x26ea62;}})[_0xbac6('0x3f')](function(_0x4825ba){logger[_0xbac6('0x4b')](_0xbac6('0x4c'),_0x4825ba);throw _0x4825ba;});}return _0x26ea62;})[_0xbac6('0x1e')](respondWithResult(_0x175fa9,0xc9))['catch'](handleError(_0x175fa9,null));};exports[_0xbac6('0x4d')]=function(_0x4c362a,_0x55f1dc){if(_0x4c362a[_0xbac6('0x44')]['id']){delete _0x4c362a[_0xbac6('0x44')]['id'];}return db[_0xbac6('0x3b')][_0xbac6('0x48')]({'where':{'id':_0x4c362a[_0xbac6('0x41')]['id']}})[_0xbac6('0x1e')](handleEntityNotFound(_0x55f1dc,null))[_0xbac6('0x1e')](saveUpdates(_0x4c362a[_0xbac6('0x44')],null))[_0xbac6('0x1e')](respondWithResult(_0x55f1dc,null))[_0xbac6('0x3f')](handleError(_0x55f1dc,null));};exports['destroy']=function(_0x368dea,_0x177a9e){return db[_0xbac6('0x3b')]['find']({'where':{'id':_0x368dea['params']['id']}})[_0xbac6('0x1e')](handleEntityNotFound(_0x177a9e,null))[_0xbac6('0x1e')](removeEntity(_0x177a9e,null))[_0xbac6('0x3f')](handleError(_0x177a9e,null));};exports[_0xbac6('0x4e')]=function(_0x26a017,_0x52d7bb,_0x553645){return db[_0xbac6('0x3b')][_0xbac6('0x48')]({'where':{'id':_0x26a017[_0xbac6('0x41')]['id']},'attributes':[_0xbac6('0x24'),'basename','savename',_0xbac6('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x52d7bb,null))[_0xbac6('0x1e')](function(_0x31952f){if(_0x31952f){if(!fs[_0xbac6('0x50')](path[_0xbac6('0x51')](config[_0xbac6('0x52')],_0xbac6('0x53'),_0x31952f['savename']))){throw new db[(_0xbac6('0x54'))][(_0xbac6('0x55'))](_0xbac6('0x56'));}if(_0x26a017[_0xbac6('0x2b')][_0xbac6('0x57')]){return _0x52d7bb[_0xbac6('0x22')](0xc8);}return _0x52d7bb[_0xbac6('0x4e')](path[_0xbac6('0x51')](config[_0xbac6('0x52')],_0xbac6('0x53'),_0x31952f[_0xbac6('0x58')]),util[_0xbac6('0x59')](_0xbac6('0x5a'),_0x31952f[_0xbac6('0x5b')]||_0x31952f[_0xbac6('0x24')],_0x31952f['output'][_0xbac6('0x5c')]()));}})[_0xbac6('0x3f')](handleError(_0x52d7bb,null));}; \ No newline at end of file +var _0x38af=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','apply','reject','then','destroy','get','ExtractedReports','end','sendStatus','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','findAll','rows','catch','params','includeAll','include','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','papaparse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x38af,0x100));var _0xf38a=function(_0x3bbfb3,_0x580078){_0x3bbfb3=_0x3bbfb3-0x0;var _0x2e9326=_0x38af[_0x3bbfb3];return _0x2e9326;};'use strict';var pdf=require(_0xf38a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf38a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf38a('0x2'));var rp=require(_0xf38a('0x3'));var moment=require('moment');var BPromise=require(_0xf38a('0x4'));var Mustache=require(_0xf38a('0x5'));var util=require(_0xf38a('0x6'));var path=require(_0xf38a('0x7'));var sox=require('sox');var csv=require(_0xf38a('0x8'));var ejs=require(_0xf38a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf38a('0xa'));var crypto=require(_0xf38a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf38a('0xc'));var toCsv=require(_0xf38a('0x8'));var querystring=require('querystring');var Papa=require(_0xf38a('0xd'));var Redis=require(_0xf38a('0xe'));var authService=require(_0xf38a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf38a('0x10'));var hardwareService=require(_0xf38a('0x11'));var logger=require('../../config/logger')(_0xf38a('0x12'));var utils=require('../../config/utils');var config=require(_0xf38a('0x13'));var db=require(_0xf38a('0x14'))['db'];function respondWithStatusCode(_0xeb7dc6,_0xd285af){_0xd285af=_0xd285af||0xcc;return function(_0x1d2042){if(_0x1d2042){return _0xeb7dc6['sendStatus'](_0xd285af);}return _0xeb7dc6[_0xf38a('0x15')](_0xd285af)['end']();};}function respondWithResult(_0x187725,_0xdd8e2b){_0xdd8e2b=_0xdd8e2b||0xc8;return function(_0x9fbca3){if(_0x9fbca3){return _0x187725[_0xf38a('0x15')](_0xdd8e2b)[_0xf38a('0x16')](_0x9fbca3);}};}function respondWithFilteredResult(_0xf3baea,_0x13b144){return function(_0x1bcaa0){if(_0x1bcaa0){var _0x3be48f=_0x1bcaa0[_0xf38a('0x17')],_0x37aa5d=_0x13b144['offset'],_0x268c32=_0x13b144[_0xf38a('0x18')]+_0x13b144[_0xf38a('0x19')],_0x45fb5f;if(_0x268c32>=_0x3be48f){_0x268c32=_0x3be48f;_0x45fb5f=0xc8;}else{_0x45fb5f=0xce;}_0xf3baea[_0xf38a('0x15')](_0x45fb5f);return _0xf3baea[_0xf38a('0x1a')]('Content-Range',_0x37aa5d+'-'+_0x268c32+'/'+_0x3be48f)[_0xf38a('0x16')](_0x1bcaa0);}return null;};}function patchUpdates(_0x3b57f1){return function(_0x1acb6d){try{jsonpatch[_0xf38a('0x1b')](_0x1acb6d,_0x3b57f1,!![]);}catch(_0x9198e0){return BPromise[_0xf38a('0x1c')](_0x9198e0);}return _0x1acb6d['save']();};}function saveUpdates(_0x594cdd,_0x7cdd5){return function(_0x57d09e){if(_0x57d09e){return _0x57d09e['update'](_0x594cdd)[_0xf38a('0x1d')](function(_0x580269){return _0x580269;});}return null;};}function removeEntity(_0x4c243a,_0x491422){return function(_0x396d14){if(_0x396d14){return _0x396d14[_0xf38a('0x1e')]()[_0xf38a('0x1d')](function(){var _0x47bcca=_0x396d14[_0xf38a('0x1f')]({'plain':!![]});var _0x4bc6e8=_0xf38a('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x4bc6e8,'resourceId':_0x47bcca['id']}})[_0xf38a('0x1d')](function(){return _0x396d14;});})[_0xf38a('0x1d')](function(){_0x4c243a[_0xf38a('0x15')](0xcc)[_0xf38a('0x21')]();});}};}function handleEntityNotFound(_0x1c24a0,_0x164417){return function(_0xf6724a){if(!_0xf6724a){_0x1c24a0[_0xf38a('0x22')](0x194);}return _0xf6724a;};}function handleError(_0x31f5c0,_0x698bb7){_0x698bb7=_0x698bb7||0x1f4;return function(_0x2c5c5c){logger[_0xf38a('0x23')](_0x2c5c5c[_0xf38a('0x24')]);if(_0x2c5c5c[_0xf38a('0x25')]){delete _0x2c5c5c[_0xf38a('0x25')];}_0x31f5c0[_0xf38a('0x15')](_0x698bb7)['send'](_0x2c5c5c);};}exports[_0xf38a('0x26')]=function(_0x767600,_0xef1e2){var _0x3f20f3={},_0x262d09={},_0x5ba20d={'count':0x0,'rows':[]};var _0x4645ef=_[_0xf38a('0x27')](db[_0xf38a('0x28')][_0xf38a('0x29')],function(_0x3d3e93){return{'name':_0x3d3e93[_0xf38a('0x2a')],'type':_0x3d3e93[_0xf38a('0x2b')][_0xf38a('0x2c')]};});_0x262d09[_0xf38a('0x2d')]=_[_0xf38a('0x27')](_0x4645ef,_0xf38a('0x25'));_0x262d09[_0xf38a('0x2e')]=_[_0xf38a('0x2f')](_0x767600['query']);_0x262d09[_0xf38a('0x30')]=_['intersection'](_0x262d09[_0xf38a('0x2d')],_0x262d09['query']);_0x3f20f3[_0xf38a('0x31')]=_[_0xf38a('0x32')](_0x262d09['model'],qs[_0xf38a('0x33')](_0x767600[_0xf38a('0x2e')][_0xf38a('0x33')]));_0x3f20f3[_0xf38a('0x31')]=_0x3f20f3[_0xf38a('0x31')][_0xf38a('0x34')]?_0x3f20f3[_0xf38a('0x31')]:_0x262d09['model'];if(!_0x767600['query'][_0xf38a('0x35')](_0xf38a('0x36'))){_0x3f20f3[_0xf38a('0x19')]=qs['limit'](_0x767600[_0xf38a('0x2e')]['limit']);_0x3f20f3[_0xf38a('0x18')]=qs[_0xf38a('0x18')](_0x767600['query']['offset']);}_0x3f20f3[_0xf38a('0x37')]=qs['sort'](_0x767600[_0xf38a('0x2e')][_0xf38a('0x38')]);_0x3f20f3[_0xf38a('0x39')]=qs['filters'](_['pick'](_0x767600[_0xf38a('0x2e')],_0x262d09[_0xf38a('0x30')]));if(_0x767600[_0xf38a('0x2e')]['filter']){_0x3f20f3['where']=_[_0xf38a('0x3a')](_0x3f20f3['where'],{'$or':_['map'](_0x4645ef,function(_0x25773a){if(_0x25773a[_0xf38a('0x2b')]!==_0xf38a('0x3b')){var _0x5a2a83={};_0x5a2a83[_0x25773a[_0xf38a('0x25')]]={'$like':'%'+_0x767600[_0xf38a('0x2e')][_0xf38a('0x3c')]+'%'};return _0x5a2a83;}})});}_0x3f20f3=_[_0xf38a('0x3a')]({},_0x3f20f3,_0x767600[_0xf38a('0x3d')]);var _0x49a316={'where':_0x3f20f3[_0xf38a('0x39')]};return db[_0xf38a('0x28')]['count'](_0x49a316)[_0xf38a('0x1d')](function(_0x243ca2){_0x5ba20d[_0xf38a('0x17')]=_0x243ca2;if(_0x767600['query']['includeAll']){_0x3f20f3['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xf38a('0x3e')](_0x3f20f3);})[_0xf38a('0x1d')](function(_0x5cb4e9){_0x5ba20d[_0xf38a('0x3f')]=_0x5cb4e9;return _0x5ba20d;})['then'](respondWithFilteredResult(_0xef1e2,_0x3f20f3))[_0xf38a('0x40')](handleError(_0xef1e2,null));};exports['show']=function(_0x3f1721,_0x312171){var _0x2792d4={'raw':!![],'where':{'id':_0x3f1721[_0xf38a('0x41')]['id']}},_0xd05fbe={};_0xd05fbe['model']=_[_0xf38a('0x2f')](db['AnalyticExtractedReport'][_0xf38a('0x29')]);_0xd05fbe['query']=_[_0xf38a('0x2f')](_0x3f1721['query']);_0xd05fbe[_0xf38a('0x30')]=_[_0xf38a('0x32')](_0xd05fbe[_0xf38a('0x2d')],_0xd05fbe[_0xf38a('0x2e')]);_0x2792d4['attributes']=_[_0xf38a('0x32')](_0xd05fbe[_0xf38a('0x2d')],qs[_0xf38a('0x33')](_0x3f1721[_0xf38a('0x2e')]['fields']));_0x2792d4[_0xf38a('0x31')]=_0x2792d4[_0xf38a('0x31')][_0xf38a('0x34')]?_0x2792d4['attributes']:_0xd05fbe[_0xf38a('0x2d')];if(_0x3f1721[_0xf38a('0x2e')][_0xf38a('0x42')]){_0x2792d4[_0xf38a('0x43')]=[{'all':!![]}];}_0x2792d4=_[_0xf38a('0x3a')]({},_0x2792d4,_0x3f1721['options']);return db[_0xf38a('0x28')][_0xf38a('0x44')](_0x2792d4)[_0xf38a('0x1d')](handleEntityNotFound(_0x312171,null))['then'](respondWithResult(_0x312171,null))[_0xf38a('0x40')](handleError(_0x312171,null));};exports[_0xf38a('0x45')]=function(_0x25aecf,_0x41b5e4){return db[_0xf38a('0x28')]['create'](_0x25aecf[_0xf38a('0x46')],{})['then'](function(_0x38393d){var _0x5832ea=_0x25aecf[_0xf38a('0x47')][_0xf38a('0x1f')]({'plain':!![]});if(!_0x5832ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5832ea[_0xf38a('0x48')]===_0xf38a('0x47')){var _0x4128b3=_0x38393d['get']({'plain':!![]});var _0x26c137=_0xf38a('0x20');return db[_0xf38a('0x49')]['find']({'where':{'name':_0x26c137,'userProfileId':_0x5832ea['userProfileId']},'raw':!![]})[_0xf38a('0x1d')](function(_0x48fa0b){if(_0x48fa0b&&_0x48fa0b[_0xf38a('0x4a')]===0x0){return db['UserProfileResource'][_0xf38a('0x45')]({'name':_0x4128b3[_0xf38a('0x25')],'resourceId':_0x4128b3['id'],'type':_0x48fa0b['name'],'sectionId':_0x48fa0b['id']},{})[_0xf38a('0x1d')](function(){return _0x38393d;});}else{return _0x38393d;}})['catch'](function(_0x67d8d5){logger[_0xf38a('0x23')](_0xf38a('0x4b'),_0x67d8d5);throw _0x67d8d5;});}return _0x38393d;})[_0xf38a('0x1d')](respondWithResult(_0x41b5e4,0xc9))[_0xf38a('0x40')](handleError(_0x41b5e4,null));};exports[_0xf38a('0x4c')]=function(_0x3edaaf,_0x35c85b){if(_0x3edaaf[_0xf38a('0x46')]['id']){delete _0x3edaaf[_0xf38a('0x46')]['id'];}return db[_0xf38a('0x28')][_0xf38a('0x44')]({'where':{'id':_0x3edaaf[_0xf38a('0x41')]['id']}})[_0xf38a('0x1d')](handleEntityNotFound(_0x35c85b,null))[_0xf38a('0x1d')](saveUpdates(_0x3edaaf[_0xf38a('0x46')],null))[_0xf38a('0x1d')](respondWithResult(_0x35c85b,null))['catch'](handleError(_0x35c85b,null));};exports[_0xf38a('0x1e')]=function(_0x59bf8d,_0x12409f){return db[_0xf38a('0x28')][_0xf38a('0x44')]({'where':{'id':_0x59bf8d['params']['id']}})[_0xf38a('0x1d')](handleEntityNotFound(_0x12409f,null))[_0xf38a('0x1d')](removeEntity(_0x12409f,null))[_0xf38a('0x40')](handleError(_0x12409f,null));};exports[_0xf38a('0x4d')]=function(_0x2f80dc,_0x695e4d,_0x5210b2){return db[_0xf38a('0x28')][_0xf38a('0x44')]({'where':{'id':_0x2f80dc[_0xf38a('0x41')]['id']},'attributes':[_0xf38a('0x25'),_0xf38a('0x4e'),_0xf38a('0x4f'),_0xf38a('0x50')],'raw':!![]})[_0xf38a('0x1d')](handleEntityNotFound(_0x695e4d,null))['then'](function(_0x2749ff){if(_0x2749ff){if(!fs[_0xf38a('0x51')](path[_0xf38a('0x52')](config[_0xf38a('0x53')],_0xf38a('0x54'),_0x2749ff[_0xf38a('0x4f')]))){throw new db['Sequelize'][(_0xf38a('0x55'))](_0xf38a('0x56'));}if(_0x2f80dc[_0xf38a('0x2e')][_0xf38a('0x57')]){return _0x695e4d[_0xf38a('0x22')](0xc8);}return _0x695e4d['download'](path['join'](config[_0xf38a('0x53')],_0xf38a('0x54'),_0x2749ff[_0xf38a('0x4f')]),util['format'](_0xf38a('0x58'),_0x2749ff['basename']||_0x2749ff[_0xf38a('0x25')],_0x2749ff[_0xf38a('0x50')][_0xf38a('0x59')]()));}})[_0xf38a('0x40')](handleError(_0x695e4d,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index ba3e8cf..0934350 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 _0x4eac=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x5997fb,_0x507e93){var _0x198516=function(_0x18ee0c){while(--_0x18ee0c){_0x5997fb['push'](_0x5997fb['shift']());}};_0x198516(++_0x507e93);}(_0x4eac,0x1df));var _0xc4ea=function(_0x6242bf,_0x57aa4d){_0x6242bf=_0x6242bf-0x0;var _0x4ceab4=_0x4eac[_0x6242bf];return _0x4ceab4;};'use strict';var _=require(_0xc4ea('0x0'));var util=require(_0xc4ea('0x1'));var logger=require(_0xc4ea('0x2'))(_0xc4ea('0x3'));var moment=require('moment');var BPromise=require(_0xc4ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc4ea('0x5'));var rimraf=require(_0xc4ea('0x6'));var config=require(_0xc4ea('0x7'));var attributes=require(_0xc4ea('0x8'));module[_0xc4ea('0x9')]=function(_0x5e6e83,_0x372784){return _0x5e6e83['define'](_0xc4ea('0xa'),attributes,{'tableName':_0xc4ea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e7f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e7f,0x78));var _0xf5e7=function(_0x3b2ffc,_0x55cc96){_0x3b2ffc=_0x3b2ffc-0x0;var _0x313a74=_0x5e7f[_0x3b2ffc];return _0x313a74;};'use strict';var _=require(_0xf5e7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf5e7('0x1'));var moment=require(_0xf5e7('0x2'));var BPromise=require(_0xf5e7('0x3'));var rp=require(_0xf5e7('0x4'));var fs=require('fs');var path=require(_0xf5e7('0x5'));var rimraf=require(_0xf5e7('0x6'));var config=require(_0xf5e7('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0xf5e7('0x8')]=function(_0x2003e9,_0x5020f3){return _0x2003e9['define'](_0xf5e7('0x9'),attributes,{'tableName':_0xf5e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index e7a53d5..8649011 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 _0x8725=['then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x885eff,_0x555809){var _0x17819f=function(_0x3a69f0){while(--_0x3a69f0){_0x885eff['push'](_0x885eff['shift']());}};_0x17819f(++_0x555809);}(_0x8725,0x96));var _0x5872=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x8725[_0x56482c];return _0x5aae7a;};'use strict';var _=require('lodash');var util=require(_0x5872('0x0'));var moment=require(_0x5872('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5872('0x2'));var db=require(_0x5872('0x3'))['db'];var utils=require(_0x5872('0x4'));var logger=require(_0x5872('0x5'))(_0x5872('0x6'));var config=require(_0x5872('0x7'));var jayson=require(_0x5872('0x8'));var client=jayson[_0x5872('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46c7d7,_0x518910,_0x26a98d){return new BPromise(function(_0x1938b3,_0x5f215d){return client['request'](_0x46c7d7,_0x26a98d)[_0x5872('0xa')](function(_0x5d5fa6){logger['info'](_0x5872('0xb'),_0x518910,_0x5872('0xc'));logger['debug'](_0x5872('0xd'),_0x518910,_0x5872('0xc'),JSON[_0x5872('0xe')](_0x5d5fa6));if(_0x5d5fa6['error']){if(_0x5d5fa6[_0x5872('0xf')][_0x5872('0x10')]===0x1f4){logger[_0x5872('0xf')](_0x5872('0xb'),_0x518910,_0x5d5fa6['error'][_0x5872('0x11')]);return _0x5f215d(_0x5d5fa6[_0x5872('0xf')][_0x5872('0x11')]);}logger[_0x5872('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x518910,_0x5d5fa6[_0x5872('0xf')][_0x5872('0x11')]);return _0x1938b3(_0x5d5fa6[_0x5872('0xf')][_0x5872('0x11')]);}else{logger[_0x5872('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x518910,_0x5872('0xc'));_0x1938b3(_0x5d5fa6[_0x5872('0x13')][_0x5872('0x11')]);}})['catch'](function(_0x132ae3){logger[_0x5872('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x518910,_0x132ae3);_0x5f215d(_0x132ae3);});});} \ No newline at end of file +var _0xbd0e=['http','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x175a55,_0x4082fd){var _0x167adf=function(_0x18ef07){while(--_0x18ef07){_0x175a55['push'](_0x175a55['shift']());}};_0x167adf(++_0x4082fd);}(_0xbd0e,0xfe));var _0xebd0=function(_0x121328,_0x2c3815){_0x121328=_0x121328-0x0;var _0x28548a=_0xbd0e[_0x121328];return _0x28548a;};'use strict';var _=require(_0xebd0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xebd0('0x1'));var rs=require(_0xebd0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebd0('0x3'))['db'];var utils=require(_0xebd0('0x4'));var logger=require(_0xebd0('0x5'))(_0xebd0('0x6'));var config=require(_0xebd0('0x7'));var jayson=require(_0xebd0('0x8'));var client=jayson[_0xebd0('0x9')][_0xebd0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf59a1a,_0x119850,_0x221e06){return new BPromise(function(_0x16e79d,_0x237249){return client[_0xebd0('0xb')](_0xf59a1a,_0x221e06)['then'](function(_0x3800f3){logger['info'](_0xebd0('0xc'),_0x119850,_0xebd0('0xd'));logger[_0xebd0('0xe')](_0xebd0('0xf'),_0x119850,_0xebd0('0xd'),JSON['stringify'](_0x3800f3));if(_0x3800f3[_0xebd0('0x10')]){if(_0x3800f3[_0xebd0('0x10')][_0xebd0('0x11')]===0x1f4){logger[_0xebd0('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x119850,_0x3800f3[_0xebd0('0x10')][_0xebd0('0x12')]);return _0x237249(_0x3800f3[_0xebd0('0x10')]['message']);}logger[_0xebd0('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x119850,_0x3800f3['error'][_0xebd0('0x12')]);return _0x16e79d(_0x3800f3[_0xebd0('0x10')][_0xebd0('0x12')]);}else{logger[_0xebd0('0x13')](_0xebd0('0xc'),_0x119850,'request\x20sent');_0x16e79d(_0x3800f3[_0xebd0('0x14')]['message']);}})[_0xebd0('0x15')](function(_0x3c3185){logger[_0xebd0('0x10')](_0xebd0('0xc'),_0x119850,_0x3c3185);_0x237249(_0x3c3185);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 37d4ec8..89007ed 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 _0x9bf4=['isAuthenticated','show','/:id/download','create','/:id','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x1c06f4,_0x2feba6){var _0x1a727e=function(_0x2e83af){while(--_0x2e83af){_0x1c06f4['push'](_0x1c06f4['shift']());}};_0x1a727e(++_0x2feba6);}(_0x9bf4,0xd7));var _0x49bf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9bf4[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x49bf('0x0'));var util=require(_0x49bf('0x1'));var path=require(_0x49bf('0x2'));var timeout=require('connect-timeout');var express=require(_0x49bf('0x3'));var router=express['Router']();var auth=require(_0x49bf('0x4'));var interaction=require(_0x49bf('0x5'));var config=require(_0x49bf('0x6'));var controller=require(_0x49bf('0x7'));router[_0x49bf('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x49bf('0x8')]('/:id',auth[_0x49bf('0x9')](),controller[_0x49bf('0xa')]);router[_0x49bf('0x8')](_0x49bf('0xb'),auth[_0x49bf('0x9')](),controller['download']);router['post']('/',auth[_0x49bf('0x9')](),controller[_0x49bf('0xc')]);router['put'](_0x49bf('0xd'),auth[_0x49bf('0x9')](),controller['update']);router[_0x49bf('0xe')](_0x49bf('0xd'),auth[_0x49bf('0x9')](),controller[_0x49bf('0xf')]);module['exports']=router; \ No newline at end of file +var _0xd339=['/:id','/:id/download','download','create','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x209302,_0x5826ac){var _0x1df8e9=function(_0x16ae49){while(--_0x16ae49){_0x209302['push'](_0x209302['shift']());}};_0x1df8e9(++_0x5826ac);}(_0xd339,0xad));var _0x9d33=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd339[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9d33('0x0'));var timeout=require('connect-timeout');var express=require(_0x9d33('0x1'));var router=express[_0x9d33('0x2')]();var auth=require(_0x9d33('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9d33('0x4'));var controller=require('./analyticExtractedReport.controller');router[_0x9d33('0x5')]('/',auth[_0x9d33('0x6')](),controller['index']);router['get'](_0x9d33('0x7'),auth[_0x9d33('0x6')](),controller['show']);router[_0x9d33('0x5')](_0x9d33('0x8'),auth[_0x9d33('0x6')](),controller[_0x9d33('0x9')]);router['post']('/',auth[_0x9d33('0x6')](),controller[_0x9d33('0xa')]);router['put']('/:id',auth[_0x9d33('0x6')](),controller[_0x9d33('0xb')]);router[_0x9d33('0xc')](_0x9d33('0x7'),auth['isAuthenticated'](),controller[_0x9d33('0xd')]);module[_0x9d33('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index f7b3e6f..b3a9b5d 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(_0x12a1cd,_0x521514){var _0x1f2a83=function(_0x56adaa){while(--_0x56adaa){_0x12a1cd['push'](_0x12a1cd['shift']());}};_0x1f2a83(++_0x521514);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x5fc3[_0x2ed8f3];return _0x525a55;};'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 _0x7a54=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x3aa0f4,_0x5d9be6){var _0x1181ae=function(_0x4f1454){while(--_0x4f1454){_0x3aa0f4['push'](_0x3aa0f4['shift']());}};_0x1181ae(++_0x5d9be6);}(_0x7a54,0x106));var _0x47a5=function(_0x17ce82,_0x40dd34){_0x17ce82=_0x17ce82-0x0;var _0x128a9c=_0x7a54[_0x17ce82];return _0x128a9c;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'field':{'type':Sequelize[_0x47a5('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x47a5('0x3')]},'format':{'type':Sequelize[_0x47a5('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x47a5('0x3')]},'custom':{'type':Sequelize[_0x47a5('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 9107980..7027023 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 _0x1921=['sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','then','destroy','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','include','rows','catch','show','params','includeAll','options','create','body','bulkCreate','update','find','bulkDestroy','ids','addFields','findOne','sequelize','transaction','CustomReportId','findAll','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x241f10,_0xf4bcd8){var _0x59009e=function(_0x537ee5){while(--_0x537ee5){_0x241f10['push'](_0x241f10['shift']());}};_0x59009e(++_0xf4bcd8);}(_0x1921,0xf2));var _0x1192=function(_0xd2905d,_0x5d74ce){_0xd2905d=_0xd2905d-0x0;var _0x1852a5=_0x1921[_0xd2905d];return _0x1852a5;};'use strict';var pdf=require(_0x1192('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1192('0x1'));var zipdir=require(_0x1192('0x2'));var jsonpatch=require(_0x1192('0x3'));var rp=require(_0x1192('0x4'));var moment=require(_0x1192('0x5'));var BPromise=require(_0x1192('0x6'));var Mustache=require(_0x1192('0x7'));var util=require(_0x1192('0x8'));var path=require(_0x1192('0x9'));var sox=require(_0x1192('0xa'));var csv=require(_0x1192('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x1192('0xc'));var crypto=require(_0x1192('0xd'));var jsforce=require(_0x1192('0xe'));var deskjs=require(_0x1192('0xf'));var toCsv=require(_0x1192('0xb'));var querystring=require(_0x1192('0x10'));var Papa=require(_0x1192('0x11'));var Redis=require(_0x1192('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1192('0x13'));var hardwareService=require(_0x1192('0x14'));var logger=require(_0x1192('0x15'))(_0x1192('0x16'));var utils=require(_0x1192('0x17'));var config=require(_0x1192('0x18'));var db=require(_0x1192('0x19'))['db'];function respondWithStatusCode(_0x48bb77,_0x33b997){_0x33b997=_0x33b997||0xcc;return function(_0x594596){if(_0x594596){return _0x48bb77[_0x1192('0x1a')](_0x33b997);}return _0x48bb77[_0x1192('0x1b')](_0x33b997)['end']();};}function respondWithResult(_0x3dc2db,_0x1e5fcc){_0x1e5fcc=_0x1e5fcc||0xc8;return function(_0x406b97){if(_0x406b97){return _0x3dc2db['status'](_0x1e5fcc)[_0x1192('0x1c')](_0x406b97);}};}function respondWithFilteredResult(_0x195c7c,_0x55755b){return function(_0x2021f2){if(_0x2021f2){var _0x3397d1=_0x2021f2['count'],_0x2a162b=_0x55755b[_0x1192('0x1d')],_0x4823d0=_0x55755b[_0x1192('0x1d')]+_0x55755b[_0x1192('0x1e')],_0x230cc3;if(_0x4823d0>=_0x3397d1){_0x4823d0=_0x3397d1;_0x230cc3=0xc8;}else{_0x230cc3=0xce;}_0x195c7c[_0x1192('0x1b')](_0x230cc3);return _0x195c7c[_0x1192('0x1f')](_0x1192('0x20'),_0x2a162b+'-'+_0x4823d0+'/'+_0x3397d1)['json'](_0x2021f2);}return null;};}function patchUpdates(_0x4f72d7){return function(_0x1c266c){try{jsonpatch[_0x1192('0x21')](_0x1c266c,_0x4f72d7,!![]);}catch(_0x3ab275){return BPromise[_0x1192('0x22')](_0x3ab275);}return _0x1c266c['save']();};}function saveUpdates(_0x3c48fa,_0x2da521){return function(_0x141c9b){if(_0x141c9b){return _0x141c9b['update'](_0x3c48fa)[_0x1192('0x23')](function(_0x4699c2){return _0x4699c2;});}return null;};}function removeEntity(_0x506831,_0x40bee5){return function(_0x22f4c8){if(_0x22f4c8){return _0x22f4c8[_0x1192('0x24')]()[_0x1192('0x23')](function(){_0x506831['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x406c87,_0x5a7774){return function(_0x3cc973){if(!_0x3cc973){_0x406c87['sendStatus'](0x194);}return _0x3cc973;};}function handleError(_0x1a56b2,_0x59d1f8){_0x59d1f8=_0x59d1f8||0x1f4;return function(_0xabae0f){logger[_0x1192('0x25')](_0xabae0f['stack']);if(_0xabae0f[_0x1192('0x26')]){delete _0xabae0f[_0x1192('0x26')];}_0x1a56b2[_0x1192('0x1b')](_0x59d1f8)[_0x1192('0x27')](_0xabae0f);};}exports[_0x1192('0x28')]=function(_0x168638,_0x52967f){var _0x2586c8={},_0x799f71={},_0x401922={'count':0x0,'rows':[]};var _0x2ca953=_[_0x1192('0x29')](db[_0x1192('0x2a')][_0x1192('0x2b')],function(_0x2c7c9b){return{'name':_0x2c7c9b[_0x1192('0x2c')],'type':_0x2c7c9b[_0x1192('0x2d')]['key']};});_0x799f71[_0x1192('0x2e')]=_['map'](_0x2ca953,'name');_0x799f71[_0x1192('0x2f')]=_[_0x1192('0x30')](_0x168638[_0x1192('0x2f')]);_0x799f71[_0x1192('0x31')]=_[_0x1192('0x32')](_0x799f71[_0x1192('0x2e')],_0x799f71[_0x1192('0x2f')]);_0x2586c8[_0x1192('0x33')]=_[_0x1192('0x32')](_0x799f71[_0x1192('0x2e')],qs[_0x1192('0x34')](_0x168638[_0x1192('0x2f')][_0x1192('0x34')]));_0x2586c8[_0x1192('0x33')]=_0x2586c8[_0x1192('0x33')][_0x1192('0x35')]?_0x2586c8[_0x1192('0x33')]:_0x799f71[_0x1192('0x2e')];if(!_0x168638[_0x1192('0x2f')][_0x1192('0x36')](_0x1192('0x37'))){_0x2586c8['limit']=qs['limit'](_0x168638['query'][_0x1192('0x1e')]);_0x2586c8[_0x1192('0x1d')]=qs[_0x1192('0x1d')](_0x168638[_0x1192('0x2f')]['offset']);}_0x2586c8[_0x1192('0x38')]=qs[_0x1192('0x39')](_0x168638[_0x1192('0x2f')][_0x1192('0x39')]);_0x2586c8[_0x1192('0x3a')]=qs[_0x1192('0x31')](_[_0x1192('0x3b')](_0x168638[_0x1192('0x2f')],_0x799f71['filters']));if(_0x168638['query'][_0x1192('0x3c')]){_0x2586c8[_0x1192('0x3a')]=_[_0x1192('0x3d')](_0x2586c8[_0x1192('0x3a')],{'$or':_[_0x1192('0x29')](_0x2ca953,function(_0x3f9539){if(_0x3f9539['type']!==_0x1192('0x3e')){var _0x3d8d12={};_0x3d8d12[_0x3f9539[_0x1192('0x26')]]={'$like':'%'+_0x168638[_0x1192('0x2f')][_0x1192('0x3c')]+'%'};return _0x3d8d12;}})});}_0x2586c8=_[_0x1192('0x3d')]({},_0x2586c8,_0x168638['options']);var _0x11114e={'where':_0x2586c8[_0x1192('0x3a')]};return db['AnalyticFieldReport'][_0x1192('0x3f')](_0x11114e)[_0x1192('0x23')](function(_0x21a09e){_0x401922['count']=_0x21a09e;if(_0x168638['query']['includeAll']){_0x2586c8[_0x1192('0x40')]=[{'all':!![]}];}return db[_0x1192('0x2a')]['findAll'](_0x2586c8);})[_0x1192('0x23')](function(_0x26428b){_0x401922[_0x1192('0x41')]=_0x26428b;return _0x401922;})[_0x1192('0x23')](respondWithFilteredResult(_0x52967f,_0x2586c8))[_0x1192('0x42')](handleError(_0x52967f,null));};exports[_0x1192('0x43')]=function(_0x179c4f,_0x36664a){var _0x1c4198={'raw':![],'where':{'id':_0x179c4f[_0x1192('0x44')]['id']}},_0x1c870f={};_0x1c870f[_0x1192('0x2e')]=_[_0x1192('0x30')](db[_0x1192('0x2a')][_0x1192('0x2b')]);_0x1c870f[_0x1192('0x2f')]=_[_0x1192('0x30')](_0x179c4f['query']);_0x1c870f[_0x1192('0x31')]=_[_0x1192('0x32')](_0x1c870f[_0x1192('0x2e')],_0x1c870f['query']);_0x1c4198[_0x1192('0x33')]=_[_0x1192('0x32')](_0x1c870f[_0x1192('0x2e')],qs['fields'](_0x179c4f[_0x1192('0x2f')][_0x1192('0x34')]));_0x1c4198['attributes']=_0x1c4198[_0x1192('0x33')][_0x1192('0x35')]?_0x1c4198[_0x1192('0x33')]:_0x1c870f['model'];if(_0x179c4f[_0x1192('0x2f')][_0x1192('0x45')]){_0x1c4198[_0x1192('0x40')]=[{'all':!![]}];}_0x1c4198=_[_0x1192('0x3d')]({},_0x1c4198,_0x179c4f[_0x1192('0x46')]);return db['AnalyticFieldReport']['find'](_0x1c4198)[_0x1192('0x23')](handleEntityNotFound(_0x36664a,null))['then'](respondWithResult(_0x36664a,null))[_0x1192('0x42')](handleError(_0x36664a,null));};exports[_0x1192('0x47')]=function(_0x2dd66b,_0x116e3a){return db['AnalyticFieldReport'][_0x1192('0x47')](_0x2dd66b[_0x1192('0x48')],{})[_0x1192('0x23')](respondWithResult(_0x116e3a,0xc9))[_0x1192('0x42')](handleError(_0x116e3a,null));};exports[_0x1192('0x49')]=function(_0x144149,_0x43925b){return db['AnalyticFieldReport'][_0x1192('0x49')](_0x144149[_0x1192('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x43925b,0xc9))[_0x1192('0x42')](handleError(_0x43925b,null));};exports[_0x1192('0x4a')]=function(_0x2822f8,_0x244b6c){if(_0x2822f8[_0x1192('0x48')]['id']){delete _0x2822f8[_0x1192('0x48')]['id'];}return db[_0x1192('0x2a')]['find']({'where':{'id':_0x2822f8[_0x1192('0x44')]['id']}})[_0x1192('0x23')](handleEntityNotFound(_0x244b6c,null))[_0x1192('0x23')](saveUpdates(_0x2822f8['body'],null))[_0x1192('0x23')](respondWithResult(_0x244b6c,null))[_0x1192('0x42')](handleError(_0x244b6c,null));};exports[_0x1192('0x24')]=function(_0x5b735c,_0x4bcea8){return db['AnalyticFieldReport'][_0x1192('0x4b')]({'where':{'id':_0x5b735c[_0x1192('0x44')]['id']}})[_0x1192('0x23')](handleEntityNotFound(_0x4bcea8,null))['then'](removeEntity(_0x4bcea8,null))['catch'](handleError(_0x4bcea8,null));};exports[_0x1192('0x4c')]=function(_0x239b6c,_0x5dadf1){return db[_0x1192('0x2a')][_0x1192('0x24')]({'where':{'id':_0x239b6c[_0x1192('0x2f')][_0x1192('0x4d')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5dadf1,0xcc))[_0x1192('0x42')](handleError(_0x5dadf1,null));};exports[_0x1192('0x4e')]=function(_0x141c09,_0x4b9b8e,_0x24aaa4){return db['AnalyticCustomReport'][_0x1192('0x4f')]({'where':{'id':_0x141c09[_0x1192('0x44')]['id']}})[_0x1192('0x23')](handleEntityNotFound(_0x4b9b8e,null))[_0x1192('0x23')](function(_0x44134c){if(_0x44134c){return db[_0x1192('0x50')][_0x1192('0x51')](function(_0x2b96c4){return db['AnalyticFieldReport'][_0x1192('0x24')]({'where':{'CustomReportId':_0x141c09['params']['id']},'transaction':_0x2b96c4})[_0x1192('0x23')](function(_0x21ee1e){var _0x537052=_[_0x1192('0x29')](_0x141c09[_0x1192('0x48')],function(_0x192cc7){delete _0x192cc7['id'];_0x192cc7[_0x1192('0x52')]=_0x141c09[_0x1192('0x44')]['id'];return _0x192cc7;});return db['AnalyticFieldReport'][_0x1192('0x49')](_0x537052,{'transaction':_0x2b96c4});});})[_0x1192('0x23')](function(){return db[_0x1192('0x2a')][_0x1192('0x53')]({'where':{'CustomReportId':_0x141c09['params']['id']}});});}})['then'](respondWithResult(_0x4b9b8e,null))[_0x1192('0x42')](handleError(_0x4b9b8e,null));}; \ No newline at end of file +var _0x2706=['filters','merge','type','VIRTUAL','options','AnalyticFieldReport','includeAll','findAll','catch','show','include','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','end','count','offset','limit','status','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x11c77d,_0x75d3b4){var _0x5974ef=function(_0x5426eb){while(--_0x5426eb){_0x11c77d['push'](_0x11c77d['shift']());}};_0x5974ef(++_0x75d3b4);}(_0x2706,0x107));var _0x6270=function(_0x1c5ba0,_0x2d0677){_0x1c5ba0=_0x1c5ba0-0x0;var _0x53a304=_0x2706[_0x1c5ba0];return _0x53a304;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6270('0x0'));var rimraf=require(_0x6270('0x1'));var zipdir=require(_0x6270('0x2'));var jsonpatch=require(_0x6270('0x3'));var rp=require('request-promise');var moment=require(_0x6270('0x4'));var BPromise=require(_0x6270('0x5'));var Mustache=require(_0x6270('0x6'));var util=require(_0x6270('0x7'));var path=require(_0x6270('0x8'));var sox=require(_0x6270('0x9'));var csv=require(_0x6270('0xa'));var ejs=require(_0x6270('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6270('0xc'));var crypto=require(_0x6270('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6270('0xe'));var toCsv=require(_0x6270('0xa'));var querystring=require(_0x6270('0xf'));var Papa=require(_0x6270('0x10'));var Redis=require(_0x6270('0x11'));var authService=require(_0x6270('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6270('0x13'));var hardwareService=require(_0x6270('0x14'));var logger=require(_0x6270('0x15'))(_0x6270('0x16'));var utils=require(_0x6270('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x229eb4,_0x124980){_0x124980=_0x124980||0xcc;return function(_0x5f1be1){if(_0x5f1be1){return _0x229eb4['sendStatus'](_0x124980);}return _0x229eb4['status'](_0x124980)[_0x6270('0x18')]();};}function respondWithResult(_0x4d739d,_0x2190cf){_0x2190cf=_0x2190cf||0xc8;return function(_0x49a384){if(_0x49a384){return _0x4d739d['status'](_0x2190cf)['json'](_0x49a384);}};}function respondWithFilteredResult(_0x17d001,_0x2a117f){return function(_0xc1e9c7){if(_0xc1e9c7){var _0x5336fd=_0xc1e9c7[_0x6270('0x19')],_0x4b4904=_0x2a117f[_0x6270('0x1a')],_0x20ad4d=_0x2a117f[_0x6270('0x1a')]+_0x2a117f[_0x6270('0x1b')],_0x59af54;if(_0x20ad4d>=_0x5336fd){_0x20ad4d=_0x5336fd;_0x59af54=0xc8;}else{_0x59af54=0xce;}_0x17d001[_0x6270('0x1c')](_0x59af54);return _0x17d001['set'](_0x6270('0x1d'),_0x4b4904+'-'+_0x20ad4d+'/'+_0x5336fd)['json'](_0xc1e9c7);}return null;};}function patchUpdates(_0x273478){return function(_0x1f5f11){try{jsonpatch[_0x6270('0x1e')](_0x1f5f11,_0x273478,!![]);}catch(_0x3495b8){return BPromise[_0x6270('0x1f')](_0x3495b8);}return _0x1f5f11[_0x6270('0x20')]();};}function saveUpdates(_0x1cb956,_0x3c1c02){return function(_0x1efa0a){if(_0x1efa0a){return _0x1efa0a[_0x6270('0x21')](_0x1cb956)[_0x6270('0x22')](function(_0x476657){return _0x476657;});}return null;};}function removeEntity(_0x575851,_0x2db609){return function(_0xc5e5d7){if(_0xc5e5d7){return _0xc5e5d7[_0x6270('0x23')]()[_0x6270('0x22')](function(){_0x575851[_0x6270('0x1c')](0xcc)[_0x6270('0x18')]();});}};}function handleEntityNotFound(_0x44dd6d,_0x564398){return function(_0x191cc6){if(!_0x191cc6){_0x44dd6d[_0x6270('0x24')](0x194);}return _0x191cc6;};}function handleError(_0xb21fc,_0x4ca437){_0x4ca437=_0x4ca437||0x1f4;return function(_0x1338ae){logger[_0x6270('0x25')](_0x1338ae[_0x6270('0x26')]);if(_0x1338ae[_0x6270('0x27')]){delete _0x1338ae[_0x6270('0x27')];}_0xb21fc[_0x6270('0x1c')](_0x4ca437)['send'](_0x1338ae);};}exports[_0x6270('0x28')]=function(_0x10b19e,_0x247a4d){var _0x337038={},_0x1d1450={},_0x542a9d={'count':0x0,'rows':[]};var _0x49c7ed=_[_0x6270('0x29')](db['AnalyticFieldReport'][_0x6270('0x2a')],function(_0x16e536){return{'name':_0x16e536['fieldName'],'type':_0x16e536['type'][_0x6270('0x2b')]};});_0x1d1450['model']=_[_0x6270('0x29')](_0x49c7ed,_0x6270('0x27'));_0x1d1450[_0x6270('0x2c')]=_[_0x6270('0x2d')](_0x10b19e[_0x6270('0x2c')]);_0x1d1450['filters']=_[_0x6270('0x2e')](_0x1d1450[_0x6270('0x2f')],_0x1d1450[_0x6270('0x2c')]);_0x337038[_0x6270('0x30')]=_[_0x6270('0x2e')](_0x1d1450[_0x6270('0x2f')],qs[_0x6270('0x31')](_0x10b19e[_0x6270('0x2c')][_0x6270('0x31')]));_0x337038['attributes']=_0x337038[_0x6270('0x30')][_0x6270('0x32')]?_0x337038['attributes']:_0x1d1450[_0x6270('0x2f')];if(!_0x10b19e['query'][_0x6270('0x33')](_0x6270('0x34'))){_0x337038[_0x6270('0x1b')]=qs[_0x6270('0x1b')](_0x10b19e[_0x6270('0x2c')][_0x6270('0x1b')]);_0x337038[_0x6270('0x1a')]=qs[_0x6270('0x1a')](_0x10b19e['query']['offset']);}_0x337038[_0x6270('0x35')]=qs[_0x6270('0x36')](_0x10b19e[_0x6270('0x2c')][_0x6270('0x36')]);_0x337038[_0x6270('0x37')]=qs['filters'](_[_0x6270('0x38')](_0x10b19e[_0x6270('0x2c')],_0x1d1450[_0x6270('0x39')]));if(_0x10b19e[_0x6270('0x2c')]['filter']){_0x337038['where']=_[_0x6270('0x3a')](_0x337038[_0x6270('0x37')],{'$or':_[_0x6270('0x29')](_0x49c7ed,function(_0x59e4ad){if(_0x59e4ad[_0x6270('0x3b')]!==_0x6270('0x3c')){var _0x58f96e={};_0x58f96e[_0x59e4ad[_0x6270('0x27')]]={'$like':'%'+_0x10b19e[_0x6270('0x2c')]['filter']+'%'};return _0x58f96e;}})});}_0x337038=_[_0x6270('0x3a')]({},_0x337038,_0x10b19e[_0x6270('0x3d')]);var _0x59476c={'where':_0x337038['where']};return db[_0x6270('0x3e')][_0x6270('0x19')](_0x59476c)[_0x6270('0x22')](function(_0x23f981){_0x542a9d['count']=_0x23f981;if(_0x10b19e['query'][_0x6270('0x3f')]){_0x337038['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x6270('0x40')](_0x337038);})['then'](function(_0x35fb94){_0x542a9d['rows']=_0x35fb94;return _0x542a9d;})[_0x6270('0x22')](respondWithFilteredResult(_0x247a4d,_0x337038))[_0x6270('0x41')](handleError(_0x247a4d,null));};exports[_0x6270('0x42')]=function(_0x579836,_0x168d32){var _0x48b1eb={'raw':![],'where':{'id':_0x579836['params']['id']}},_0x19b73a={};_0x19b73a[_0x6270('0x2f')]=_[_0x6270('0x2d')](db['AnalyticFieldReport'][_0x6270('0x2a')]);_0x19b73a['query']=_['keys'](_0x579836['query']);_0x19b73a['filters']=_[_0x6270('0x2e')](_0x19b73a[_0x6270('0x2f')],_0x19b73a[_0x6270('0x2c')]);_0x48b1eb[_0x6270('0x30')]=_['intersection'](_0x19b73a[_0x6270('0x2f')],qs['fields'](_0x579836[_0x6270('0x2c')][_0x6270('0x31')]));_0x48b1eb[_0x6270('0x30')]=_0x48b1eb[_0x6270('0x30')][_0x6270('0x32')]?_0x48b1eb[_0x6270('0x30')]:_0x19b73a[_0x6270('0x2f')];if(_0x579836['query']['includeAll']){_0x48b1eb[_0x6270('0x43')]=[{'all':!![]}];}_0x48b1eb=_['merge']({},_0x48b1eb,_0x579836['options']);return db[_0x6270('0x3e')][_0x6270('0x44')](_0x48b1eb)[_0x6270('0x22')](handleEntityNotFound(_0x168d32,null))[_0x6270('0x22')](respondWithResult(_0x168d32,null))[_0x6270('0x41')](handleError(_0x168d32,null));};exports[_0x6270('0x45')]=function(_0x148693,_0x1eef3a){return db[_0x6270('0x3e')][_0x6270('0x45')](_0x148693[_0x6270('0x46')],{})[_0x6270('0x22')](respondWithResult(_0x1eef3a,0xc9))[_0x6270('0x41')](handleError(_0x1eef3a,null));};exports['bulkCreate']=function(_0x290c80,_0x35b844){return db[_0x6270('0x3e')][_0x6270('0x47')](_0x290c80[_0x6270('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x35b844,0xc9))[_0x6270('0x41')](handleError(_0x35b844,null));};exports[_0x6270('0x21')]=function(_0x395fe9,_0x124319){if(_0x395fe9[_0x6270('0x46')]['id']){delete _0x395fe9[_0x6270('0x46')]['id'];}return db['AnalyticFieldReport'][_0x6270('0x44')]({'where':{'id':_0x395fe9[_0x6270('0x48')]['id']}})['then'](handleEntityNotFound(_0x124319,null))[_0x6270('0x22')](saveUpdates(_0x395fe9[_0x6270('0x46')],null))[_0x6270('0x22')](respondWithResult(_0x124319,null))[_0x6270('0x41')](handleError(_0x124319,null));};exports['destroy']=function(_0x556e7a,_0x5c68f1){return db[_0x6270('0x3e')]['find']({'where':{'id':_0x556e7a[_0x6270('0x48')]['id']}})[_0x6270('0x22')](handleEntityNotFound(_0x5c68f1,null))['then'](removeEntity(_0x5c68f1,null))[_0x6270('0x41')](handleError(_0x5c68f1,null));};exports[_0x6270('0x49')]=function(_0xa9674d,_0x4d1172){return db[_0x6270('0x3e')]['destroy']({'where':{'id':_0xa9674d[_0x6270('0x2c')][_0x6270('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x6270('0x22')](respondWithResult(_0x4d1172,0xcc))[_0x6270('0x41')](handleError(_0x4d1172,null));};exports[_0x6270('0x4b')]=function(_0x44aad4,_0x3669b3,_0x1fa80f){return db[_0x6270('0x4c')][_0x6270('0x4d')]({'where':{'id':_0x44aad4['params']['id']}})['then'](handleEntityNotFound(_0x3669b3,null))[_0x6270('0x22')](function(_0x19248e){if(_0x19248e){return db['sequelize'][_0x6270('0x4e')](function(_0x3500ec){return db[_0x6270('0x3e')][_0x6270('0x23')]({'where':{'CustomReportId':_0x44aad4['params']['id']},'transaction':_0x3500ec})['then'](function(_0x58609d){var _0x3a2a84=_['map'](_0x44aad4['body'],function(_0x300934){delete _0x300934['id'];_0x300934[_0x6270('0x4f')]=_0x44aad4[_0x6270('0x48')]['id'];return _0x300934;});return db[_0x6270('0x3e')][_0x6270('0x47')](_0x3a2a84,{'transaction':_0x3500ec});});})[_0x6270('0x22')](function(){return db[_0x6270('0x3e')][_0x6270('0x40')]({'where':{'CustomReportId':_0x44aad4[_0x6270('0x48')]['id']}});});}})[_0x6270('0x22')](respondWithResult(_0x3669b3,null))[_0x6270('0x41')](handleError(_0x3669b3,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 39ed6cf..d67365a 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 _0x4fc0=['path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x334f88,_0x3031ae){var _0x415432=function(_0x444934){while(--_0x444934){_0x334f88['push'](_0x334f88['shift']());}};_0x415432(++_0x3031ae);}(_0x4fc0,0x118));var _0x04fc=function(_0x3b4ae8,_0x57c305){_0x3b4ae8=_0x3b4ae8-0x0;var _0x6fca45=_0x4fc0[_0x3b4ae8];return _0x6fca45;};'use strict';var _=require(_0x04fc('0x0'));var util=require(_0x04fc('0x1'));var logger=require(_0x04fc('0x2'))(_0x04fc('0x3'));var moment=require(_0x04fc('0x4'));var BPromise=require('bluebird');var rp=require(_0x04fc('0x5'));var fs=require('fs');var path=require(_0x04fc('0x6'));var rimraf=require('rimraf');var config=require(_0x04fc('0x7'));var attributes=require(_0x04fc('0x8'));module[_0x04fc('0x9')]=function(_0x454b51,_0x586a0c){return _0x454b51[_0x04fc('0xa')](_0x04fc('0xb'),attributes,{'tableName':_0x04fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cfd=['request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1cd8e7,_0x394a95){var _0x233682=function(_0x55cb00){while(--_0x55cb00){_0x1cd8e7['push'](_0x1cd8e7['shift']());}};_0x233682(++_0x394a95);}(_0x5cfd,0x1b4));var _0xd5cf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5cfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5cf('0x0'));var util=require(_0xd5cf('0x1'));var logger=require(_0xd5cf('0x2'))(_0xd5cf('0x3'));var moment=require(_0xd5cf('0x4'));var BPromise=require(_0xd5cf('0x5'));var rp=require(_0xd5cf('0x6'));var fs=require('fs');var path=require(_0xd5cf('0x7'));var rimraf=require('rimraf');var config=require(_0xd5cf('0x8'));var attributes=require(_0xd5cf('0x9'));module[_0xd5cf('0xa')]=function(_0x3d1357,_0x41c91a){return _0x3d1357[_0xd5cf('0xb')](_0xd5cf('0xc'),attributes,{'tableName':'analytics_report_fields','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 c8e02d4..57ebd67 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 _0x7ef2=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0x7ef2,0x70));var _0x27ef=function(_0x5eb065,_0x949a3f){_0x5eb065=_0x5eb065-0x0;var _0x142822=_0x7ef2[_0x5eb065];return _0x142822;};'use strict';var _=require('lodash');var util=require(_0x27ef('0x0'));var moment=require(_0x27ef('0x1'));var BPromise=require(_0x27ef('0x2'));var rs=require(_0x27ef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27ef('0x4'))['db'];var utils=require(_0x27ef('0x5'));var logger=require(_0x27ef('0x6'))(_0x27ef('0x7'));var config=require(_0x27ef('0x8'));var jayson=require(_0x27ef('0x9'));var client=jayson[_0x27ef('0xa')][_0x27ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5218d0,_0x3d0b08,_0x440c2b){return new BPromise(function(_0x28851d,_0x3a7780){return client['request'](_0x5218d0,_0x440c2b)[_0x27ef('0xc')](function(_0x22c307){logger['info'](_0x27ef('0xd'),_0x3d0b08,_0x27ef('0xe'));logger[_0x27ef('0xf')](_0x27ef('0x10'),_0x3d0b08,_0x27ef('0xe'),JSON[_0x27ef('0x11')](_0x22c307));if(_0x22c307[_0x27ef('0x12')]){if(_0x22c307[_0x27ef('0x12')]['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x3d0b08,_0x22c307[_0x27ef('0x12')]['message']);return _0x3a7780(_0x22c307[_0x27ef('0x12')][_0x27ef('0x13')]);}logger[_0x27ef('0x12')](_0x27ef('0xd'),_0x3d0b08,_0x22c307[_0x27ef('0x12')]['message']);return _0x28851d(_0x22c307['error'][_0x27ef('0x13')]);}else{logger[_0x27ef('0x14')](_0x27ef('0xd'),_0x3d0b08,'request\x20sent');_0x28851d(_0x22c307[_0x27ef('0x15')]['message']);}})[_0x27ef('0x16')](function(_0x7469f6){logger['error'](_0x27ef('0xd'),_0x3d0b08,_0x7469f6);_0x3a7780(_0x7469f6);});});} \ No newline at end of file +var _0x0403=['randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','catch','lodash','moment','bluebird'];(function(_0x297f25,_0x594be0){var _0x4b16e8=function(_0x5cccb9){while(--_0x5cccb9){_0x297f25['push'](_0x297f25['shift']());}};_0x4b16e8(++_0x594be0);}(_0x0403,0xd9));var _0x3040=function(_0x433148,_0x3fd275){_0x433148=_0x433148-0x0;var _0x4239b3=_0x0403[_0x433148];return _0x4239b3;};'use strict';var _=require(_0x3040('0x0'));var util=require('util');var moment=require(_0x3040('0x1'));var BPromise=require(_0x3040('0x2'));var rs=require(_0x3040('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3040('0x4'));var logger=require('../../config/logger')(_0x3040('0x5'));var config=require(_0x3040('0x6'));var jayson=require(_0x3040('0x7'));var client=jayson[_0x3040('0x8')][_0x3040('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x141716,_0x53d8b9,_0x3e1f4f){return new BPromise(function(_0x29104a,_0x15e40d){return client['request'](_0x141716,_0x3e1f4f)['then'](function(_0x3b3a09){logger[_0x3040('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x53d8b9,_0x3040('0xb'));logger[_0x3040('0xc')](_0x3040('0xd'),_0x53d8b9,_0x3040('0xb'),JSON[_0x3040('0xe')](_0x3b3a09));if(_0x3b3a09[_0x3040('0xf')]){if(_0x3b3a09[_0x3040('0xf')][_0x3040('0x10')]===0x1f4){logger[_0x3040('0xf')](_0x3040('0x11'),_0x53d8b9,_0x3b3a09[_0x3040('0xf')][_0x3040('0x12')]);return _0x15e40d(_0x3b3a09[_0x3040('0xf')][_0x3040('0x12')]);}logger[_0x3040('0xf')](_0x3040('0x11'),_0x53d8b9,_0x3b3a09['error'][_0x3040('0x12')]);return _0x29104a(_0x3b3a09[_0x3040('0xf')][_0x3040('0x12')]);}else{logger[_0x3040('0xa')](_0x3040('0x11'),_0x53d8b9,_0x3040('0xb'));_0x29104a(_0x3b3a09['result'][_0x3040('0x12')]);}})[_0x3040('0x13')](function(_0x4e18b5){logger[_0x3040('0xf')](_0x3040('0x11'),_0x53d8b9,_0x4e18b5);_0x15e40d(_0x4e18b5);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index bdb835e..06156b7 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 _0x814b=['../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','post','create','/create_many','bulkCreate','/:id/create_many','addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x1592e4,_0x3c493f){var _0xd5f40a=function(_0xc4ab12){while(--_0xc4ab12){_0x1592e4['push'](_0x1592e4['shift']());}};_0xd5f40a(++_0x3c493f);}(_0x814b,0x1a2));var _0xb814=function(_0xdeffe6,_0x198150){_0xdeffe6=_0xdeffe6-0x0;var _0x5baeb=_0x814b[_0xdeffe6];return _0x5baeb;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['show']);router[_0xb814('0xd')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xd')](_0xb814('0xf'),auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0xd')](_0xb814('0x11'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['put'](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router[_0xb814('0x14')](_0xb814('0x15'),auth[_0xb814('0xa')](),controller[_0xb814('0x16')]);router[_0xb814('0x14')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x17')]);module[_0xb814('0x18')]=router; \ No newline at end of file +var _0x9957=['../../config/environment','get','isAuthenticated','index','/:id','post','/create_many','bulkCreate','/:id/create_many','put','update','delete','/destroy_many','bulkDestroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./analyticFieldReport.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xc')](_0x7995('0xd'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xc')](_0x7995('0xf'),auth[_0x7995('0x9')](),controller['addFields']);router[_0x7995('0x10')](_0x7995('0xb'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0x13'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x12')](_0x7995('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 9278f38..f871678 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 _0xe547=['name','TEXT','STRING'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xe547,0x191));var _0x7e54=function(_0xf099a0,_0x49ae03){_0xf099a0=_0xf099a0-0x0;var _0x5a09e9=_0xe547[_0xf099a0];return _0x5a09e9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7e54('0x0')],'allowNull':![],'unique':_0x7e54('0x1')},'table':{'type':Sequelize[_0x7e54('0x0')]},'metric':{'type':Sequelize[_0x7e54('0x2')]},'description':{'type':Sequelize[_0x7e54('0x0')]}}; \ No newline at end of file +var _0xefe3=['STRING','TEXT','sequelize'];(function(_0x2daddd,_0x1f6d29){var _0x5ed9bd=function(_0x38510b){while(--_0x38510b){_0x2daddd['push'](_0x2daddd['shift']());}};_0x5ed9bd(++_0x1f6d29);}(_0xefe3,0xf5));var _0x3efe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xefe3[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x3efe('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x3efe('0x1')]},'metric':{'type':Sequelize[_0x3efe('0x2')]},'description':{'type':Sequelize[_0x3efe('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index aaf87ea..4c2c5c3 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 _0x9a11=['status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','send','index','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','AnalyticMetric','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x7275e9,_0x321fa5){var _0x17b99d=function(_0x54af41){while(--_0x54af41){_0x7275e9['push'](_0x7275e9['shift']());}};_0x17b99d(++_0x321fa5);}(_0x9a11,0x12b));var _0x19a1=function(_0x4a55f8,_0xcf7cba){_0x4a55f8=_0x4a55f8-0x0;var _0x577ef3=_0x9a11[_0x4a55f8];return _0x577ef3;};'use strict';var pdf=require(_0x19a1('0x0'));var emlformat=require(_0x19a1('0x1'));var rimraf=require(_0x19a1('0x2'));var zipdir=require(_0x19a1('0x3'));var jsonpatch=require(_0x19a1('0x4'));var rp=require('request-promise');var moment=require(_0x19a1('0x5'));var BPromise=require(_0x19a1('0x6'));var Mustache=require(_0x19a1('0x7'));var util=require(_0x19a1('0x8'));var path=require(_0x19a1('0x9'));var sox=require(_0x19a1('0xa'));var csv=require(_0x19a1('0xb'));var ejs=require(_0x19a1('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x19a1('0xd'));var crypto=require(_0x19a1('0xe'));var jsforce=require(_0x19a1('0xf'));var deskjs=require(_0x19a1('0x10'));var toCsv=require(_0x19a1('0xb'));var querystring=require('querystring');var Papa=require(_0x19a1('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x19a1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x19a1('0x13'));var logger=require(_0x19a1('0x14'))('api');var utils=require(_0x19a1('0x15'));var config=require(_0x19a1('0x16'));var db=require(_0x19a1('0x17'))['db'];function respondWithStatusCode(_0x1820f5,_0x28d2e2){_0x28d2e2=_0x28d2e2||0xcc;return function(_0x23efc6){if(_0x23efc6){return _0x1820f5[_0x19a1('0x18')](_0x28d2e2);}return _0x1820f5[_0x19a1('0x19')](_0x28d2e2)[_0x19a1('0x1a')]();};}function respondWithResult(_0x45f23b,_0x65f5dc){_0x65f5dc=_0x65f5dc||0xc8;return function(_0x3e52b2){if(_0x3e52b2){return _0x45f23b[_0x19a1('0x19')](_0x65f5dc)[_0x19a1('0x1b')](_0x3e52b2);}};}function respondWithFilteredResult(_0x37eb73,_0x521c05){return function(_0x1c15e4){if(_0x1c15e4){var _0x2ce800=_0x1c15e4[_0x19a1('0x1c')],_0x31f819=_0x521c05['offset'],_0xdf28e5=_0x521c05[_0x19a1('0x1d')]+_0x521c05[_0x19a1('0x1e')],_0x51f4b6;if(_0xdf28e5>=_0x2ce800){_0xdf28e5=_0x2ce800;_0x51f4b6=0xc8;}else{_0x51f4b6=0xce;}_0x37eb73[_0x19a1('0x19')](_0x51f4b6);return _0x37eb73[_0x19a1('0x1f')](_0x19a1('0x20'),_0x31f819+'-'+_0xdf28e5+'/'+_0x2ce800)[_0x19a1('0x1b')](_0x1c15e4);}return null;};}function patchUpdates(_0x5e4c2c){return function(_0x432a04){try{jsonpatch[_0x19a1('0x21')](_0x432a04,_0x5e4c2c,!![]);}catch(_0x4e271a){return BPromise['reject'](_0x4e271a);}return _0x432a04['save']();};}function saveUpdates(_0x2cd100,_0xb57d27){return function(_0x5d576f){if(_0x5d576f){return _0x5d576f[_0x19a1('0x22')](_0x2cd100)[_0x19a1('0x23')](function(_0x27bdad){return _0x27bdad;});}return null;};}function removeEntity(_0x635a11,_0x1e0363){return function(_0x338e30){if(_0x338e30){return _0x338e30[_0x19a1('0x24')]()[_0x19a1('0x23')](function(){var _0x4880c0=_0x338e30[_0x19a1('0x25')]({'plain':!![]});var _0x81329a=_0x19a1('0x26');return db[_0x19a1('0x27')][_0x19a1('0x24')]({'where':{'type':_0x81329a,'resourceId':_0x4880c0['id']}})['then'](function(){return _0x338e30;});})[_0x19a1('0x23')](function(){_0x635a11['status'](0xcc)[_0x19a1('0x1a')]();});}};}function handleEntityNotFound(_0x21daef,_0xc8b282){return function(_0x541c48){if(!_0x541c48){_0x21daef['sendStatus'](0x194);}return _0x541c48;};}function handleError(_0x4a7148,_0x4e051e){_0x4e051e=_0x4e051e||0x1f4;return function(_0xbf78e8){logger[_0x19a1('0x28')](_0xbf78e8[_0x19a1('0x29')]);if(_0xbf78e8[_0x19a1('0x2a')]){delete _0xbf78e8[_0x19a1('0x2a')];}_0x4a7148[_0x19a1('0x19')](_0x4e051e)[_0x19a1('0x2b')](_0xbf78e8);};}exports[_0x19a1('0x2c')]=function(_0x581856,_0x211daa){var _0x596b03={},_0x184c08={},_0x2bc084={'count':0x0,'rows':[]};var _0xa58a67=_['map'](db['AnalyticMetric']['rawAttributes'],function(_0x5c6d58){return{'name':_0x5c6d58['fieldName'],'type':_0x5c6d58[_0x19a1('0x2d')][_0x19a1('0x2e')]};});_0x184c08[_0x19a1('0x2f')]=_[_0x19a1('0x30')](_0xa58a67,'name');_0x184c08['query']=_[_0x19a1('0x31')](_0x581856[_0x19a1('0x32')]);_0x184c08[_0x19a1('0x33')]=_[_0x19a1('0x34')](_0x184c08[_0x19a1('0x2f')],_0x184c08[_0x19a1('0x32')]);_0x596b03['attributes']=_[_0x19a1('0x34')](_0x184c08['model'],qs['fields'](_0x581856[_0x19a1('0x32')][_0x19a1('0x35')]));_0x596b03[_0x19a1('0x36')]=_0x596b03[_0x19a1('0x36')][_0x19a1('0x37')]?_0x596b03[_0x19a1('0x36')]:_0x184c08['model'];if(!_0x581856[_0x19a1('0x32')][_0x19a1('0x38')](_0x19a1('0x39'))){_0x596b03[_0x19a1('0x1e')]=qs[_0x19a1('0x1e')](_0x581856[_0x19a1('0x32')][_0x19a1('0x1e')]);_0x596b03[_0x19a1('0x1d')]=qs['offset'](_0x581856['query'][_0x19a1('0x1d')]);}_0x596b03[_0x19a1('0x3a')]=qs[_0x19a1('0x3b')](_0x581856[_0x19a1('0x32')][_0x19a1('0x3b')]);_0x596b03['where']=qs[_0x19a1('0x33')](_[_0x19a1('0x3c')](_0x581856['query'],_0x184c08['filters']));if(_0x581856[_0x19a1('0x32')]['filter']){_0x596b03[_0x19a1('0x3d')]=_[_0x19a1('0x3e')](_0x596b03['where'],{'$or':_[_0x19a1('0x30')](_0xa58a67,function(_0x9b3484){if(_0x9b3484[_0x19a1('0x2d')]!=='VIRTUAL'){var _0x567808={};_0x567808[_0x9b3484[_0x19a1('0x2a')]]={'$like':'%'+_0x581856['query'][_0x19a1('0x3f')]+'%'};return _0x567808;}})});}_0x596b03=_[_0x19a1('0x3e')]({},_0x596b03,_0x581856[_0x19a1('0x40')]);var _0x291753={'where':_0x596b03['where']};return db[_0x19a1('0x41')][_0x19a1('0x1c')](_0x291753)[_0x19a1('0x23')](function(_0x1a8ff8){_0x2bc084['count']=_0x1a8ff8;if(_0x581856[_0x19a1('0x32')][_0x19a1('0x42')]){_0x596b03['include']=[{'all':!![]}];}return db[_0x19a1('0x41')][_0x19a1('0x43')](_0x596b03);})[_0x19a1('0x23')](function(_0x43c5f5){_0x2bc084[_0x19a1('0x44')]=_0x43c5f5;return _0x2bc084;})[_0x19a1('0x23')](respondWithFilteredResult(_0x211daa,_0x596b03))[_0x19a1('0x45')](handleError(_0x211daa,null));};exports[_0x19a1('0x46')]=function(_0xd39756,_0x2d5a89){var _0x2a598d={'raw':!![],'where':{'id':_0xd39756[_0x19a1('0x47')]['id']}},_0x1f60d3={};_0x1f60d3[_0x19a1('0x2f')]=_[_0x19a1('0x31')](db[_0x19a1('0x41')][_0x19a1('0x48')]);_0x1f60d3[_0x19a1('0x32')]=_[_0x19a1('0x31')](_0xd39756[_0x19a1('0x32')]);_0x1f60d3[_0x19a1('0x33')]=_[_0x19a1('0x34')](_0x1f60d3[_0x19a1('0x2f')],_0x1f60d3['query']);_0x2a598d['attributes']=_['intersection'](_0x1f60d3['model'],qs[_0x19a1('0x35')](_0xd39756[_0x19a1('0x32')][_0x19a1('0x35')]));_0x2a598d['attributes']=_0x2a598d[_0x19a1('0x36')][_0x19a1('0x37')]?_0x2a598d[_0x19a1('0x36')]:_0x1f60d3[_0x19a1('0x2f')];if(_0xd39756[_0x19a1('0x32')][_0x19a1('0x42')]){_0x2a598d[_0x19a1('0x49')]=[{'all':!![]}];}_0x2a598d=_[_0x19a1('0x3e')]({},_0x2a598d,_0xd39756[_0x19a1('0x40')]);return db['AnalyticMetric'][_0x19a1('0x4a')](_0x2a598d)[_0x19a1('0x23')](handleEntityNotFound(_0x2d5a89,null))[_0x19a1('0x23')](respondWithResult(_0x2d5a89,null))['catch'](handleError(_0x2d5a89,null));};exports[_0x19a1('0x4b')]=function(_0x46cd52,_0x584a28){return db[_0x19a1('0x41')]['create'](_0x46cd52['body'],{})['then'](function(_0x344066){var _0x1e0614=_0x46cd52['user'][_0x19a1('0x25')]({'plain':!![]});if(!_0x1e0614)throw new Error(_0x19a1('0x4c'));if(_0x1e0614[_0x19a1('0x4d')]===_0x19a1('0x4e')){var _0x2da78f=_0x344066[_0x19a1('0x25')]({'plain':!![]});var _0x56f72e='Metrics';return db['UserProfileSection'][_0x19a1('0x4a')]({'where':{'name':_0x56f72e,'userProfileId':_0x1e0614['userProfileId']},'raw':!![]})[_0x19a1('0x23')](function(_0x4dc1b9){if(_0x4dc1b9&&_0x4dc1b9[_0x19a1('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x2da78f[_0x19a1('0x2a')],'resourceId':_0x2da78f['id'],'type':_0x4dc1b9['name'],'sectionId':_0x4dc1b9['id']},{})['then'](function(){return _0x344066;});}else{return _0x344066;}})[_0x19a1('0x45')](function(_0x1d360f){logger['error'](_0x19a1('0x50'),_0x1d360f);throw _0x1d360f;});}return _0x344066;})[_0x19a1('0x23')](respondWithResult(_0x584a28,0xc9))[_0x19a1('0x45')](handleError(_0x584a28,null));};exports['update']=function(_0x3669ca,_0x43d3da){if(_0x3669ca['body']['id']){delete _0x3669ca['body']['id'];}return db['AnalyticMetric'][_0x19a1('0x4a')]({'where':{'id':_0x3669ca[_0x19a1('0x47')]['id']}})['then'](handleEntityNotFound(_0x43d3da,null))[_0x19a1('0x23')](saveUpdates(_0x3669ca['body'],null))[_0x19a1('0x23')](respondWithResult(_0x43d3da,null))[_0x19a1('0x45')](handleError(_0x43d3da,null));};exports[_0x19a1('0x24')]=function(_0x559f60,_0x1ed3d6){return db[_0x19a1('0x41')][_0x19a1('0x4a')]({'where':{'id':_0x559f60[_0x19a1('0x47')]['id']}})[_0x19a1('0x23')](handleEntityNotFound(_0x1ed3d6,null))[_0x19a1('0x23')](removeEntity(_0x1ed3d6,null))[_0x19a1('0x45')](handleError(_0x1ed3d6,null));}; \ No newline at end of file +var _0x6815=['update','then','get','UserProfileResource','destroy','stack','name','index','map','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','AnalyticMetric','includeAll','findAll','show','params','keys','rawAttributes','length','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save'];(function(_0x71417,_0x4b85af){var _0xf28985=function(_0x3bfe32){while(--_0x3bfe32){_0x71417['push'](_0x71417['shift']());}};_0xf28985(++_0x4b85af);}(_0x6815,0x85));var _0x5681=function(_0x5a51de,_0x2c7794){_0x5a51de=_0x5a51de-0x0;var _0x5b161e=_0x6815[_0x5a51de];return _0x5b161e;};'use strict';var pdf=require(_0x5681('0x0'));var emlformat=require(_0x5681('0x1'));var rimraf=require(_0x5681('0x2'));var zipdir=require(_0x5681('0x3'));var jsonpatch=require(_0x5681('0x4'));var rp=require(_0x5681('0x5'));var moment=require(_0x5681('0x6'));var BPromise=require(_0x5681('0x7'));var Mustache=require(_0x5681('0x8'));var util=require(_0x5681('0x9'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5681('0xa'));var fs=require('fs');var _=require(_0x5681('0xb'));var squel=require(_0x5681('0xc'));var crypto=require('crypto');var jsforce=require(_0x5681('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5681('0xe'));var querystring=require(_0x5681('0xf'));var Papa=require(_0x5681('0x10'));var Redis=require('ioredis');var authService=require(_0x5681('0x11'));var qs=require(_0x5681('0x12'));var as=require(_0x5681('0x13'));var hardwareService=require(_0x5681('0x14'));var logger=require('../../config/logger')(_0x5681('0x15'));var utils=require('../../config/utils');var config=require(_0x5681('0x16'));var db=require(_0x5681('0x17'))['db'];function respondWithStatusCode(_0x143fc4,_0xb8f508){_0xb8f508=_0xb8f508||0xcc;return function(_0xe691b2){if(_0xe691b2){return _0x143fc4[_0x5681('0x18')](_0xb8f508);}return _0x143fc4[_0x5681('0x19')](_0xb8f508)[_0x5681('0x1a')]();};}function respondWithResult(_0x2e4740,_0x2949b4){_0x2949b4=_0x2949b4||0xc8;return function(_0x4d6de4){if(_0x4d6de4){return _0x2e4740[_0x5681('0x19')](_0x2949b4)[_0x5681('0x1b')](_0x4d6de4);}};}function respondWithFilteredResult(_0x18151e,_0x3ec565){return function(_0x4a59b3){if(_0x4a59b3){var _0x1a7306=_0x4a59b3[_0x5681('0x1c')],_0x1b303f=_0x3ec565[_0x5681('0x1d')],_0x525226=_0x3ec565[_0x5681('0x1d')]+_0x3ec565['limit'],_0x447aea;if(_0x525226>=_0x1a7306){_0x525226=_0x1a7306;_0x447aea=0xc8;}else{_0x447aea=0xce;}_0x18151e[_0x5681('0x19')](_0x447aea);return _0x18151e[_0x5681('0x1e')](_0x5681('0x1f'),_0x1b303f+'-'+_0x525226+'/'+_0x1a7306)['json'](_0x4a59b3);}return null;};}function patchUpdates(_0x42e82d){return function(_0xd47e49){try{jsonpatch[_0x5681('0x20')](_0xd47e49,_0x42e82d,!![]);}catch(_0xa978ef){return BPromise[_0x5681('0x21')](_0xa978ef);}return _0xd47e49[_0x5681('0x22')]();};}function saveUpdates(_0x32b6d8,_0x2e3581){return function(_0x382ca9){if(_0x382ca9){return _0x382ca9[_0x5681('0x23')](_0x32b6d8)[_0x5681('0x24')](function(_0x306db2){return _0x306db2;});}return null;};}function removeEntity(_0x11f02f,_0x528425){return function(_0x495956){if(_0x495956){return _0x495956['destroy']()[_0x5681('0x24')](function(){var _0x29a241=_0x495956[_0x5681('0x25')]({'plain':!![]});var _0x1ba594='Metrics';return db[_0x5681('0x26')][_0x5681('0x27')]({'where':{'type':_0x1ba594,'resourceId':_0x29a241['id']}})[_0x5681('0x24')](function(){return _0x495956;});})['then'](function(){_0x11f02f[_0x5681('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ec90a,_0x3dd752){return function(_0x219dd1){if(!_0x219dd1){_0x3ec90a[_0x5681('0x18')](0x194);}return _0x219dd1;};}function handleError(_0x381d85,_0x2fd8ca){_0x2fd8ca=_0x2fd8ca||0x1f4;return function(_0x3a5c61){logger['error'](_0x3a5c61[_0x5681('0x28')]);if(_0x3a5c61[_0x5681('0x29')]){delete _0x3a5c61[_0x5681('0x29')];}_0x381d85[_0x5681('0x19')](_0x2fd8ca)['send'](_0x3a5c61);};}exports[_0x5681('0x2a')]=function(_0x5c1b1f,_0x2a1b90){var _0xe8f803={},_0x1492b6={},_0x1e660d={'count':0x0,'rows':[]};var _0x4ac03f=_[_0x5681('0x2b')](db['AnalyticMetric']['rawAttributes'],function(_0x364a0f){return{'name':_0x364a0f[_0x5681('0x2c')],'type':_0x364a0f[_0x5681('0x2d')][_0x5681('0x2e')]};});_0x1492b6['model']=_[_0x5681('0x2b')](_0x4ac03f,_0x5681('0x29'));_0x1492b6['query']=_['keys'](_0x5c1b1f[_0x5681('0x2f')]);_0x1492b6[_0x5681('0x30')]=_[_0x5681('0x31')](_0x1492b6[_0x5681('0x32')],_0x1492b6[_0x5681('0x2f')]);_0xe8f803[_0x5681('0x33')]=_[_0x5681('0x31')](_0x1492b6[_0x5681('0x32')],qs['fields'](_0x5c1b1f[_0x5681('0x2f')][_0x5681('0x34')]));_0xe8f803[_0x5681('0x33')]=_0xe8f803[_0x5681('0x33')]['length']?_0xe8f803[_0x5681('0x33')]:_0x1492b6[_0x5681('0x32')];if(!_0x5c1b1f[_0x5681('0x2f')][_0x5681('0x35')](_0x5681('0x36'))){_0xe8f803[_0x5681('0x37')]=qs[_0x5681('0x37')](_0x5c1b1f[_0x5681('0x2f')][_0x5681('0x37')]);_0xe8f803[_0x5681('0x1d')]=qs[_0x5681('0x1d')](_0x5c1b1f['query'][_0x5681('0x1d')]);}_0xe8f803[_0x5681('0x38')]=qs[_0x5681('0x39')](_0x5c1b1f[_0x5681('0x2f')][_0x5681('0x39')]);_0xe8f803[_0x5681('0x3a')]=qs[_0x5681('0x30')](_['pick'](_0x5c1b1f[_0x5681('0x2f')],_0x1492b6['filters']));if(_0x5c1b1f['query']['filter']){_0xe8f803['where']=_[_0x5681('0x3b')](_0xe8f803[_0x5681('0x3a')],{'$or':_[_0x5681('0x2b')](_0x4ac03f,function(_0x5f3d31){if(_0x5f3d31[_0x5681('0x2d')]!==_0x5681('0x3c')){var _0x3dc40a={};_0x3dc40a[_0x5f3d31[_0x5681('0x29')]]={'$like':'%'+_0x5c1b1f[_0x5681('0x2f')][_0x5681('0x3d')]+'%'};return _0x3dc40a;}})});}_0xe8f803=_[_0x5681('0x3b')]({},_0xe8f803,_0x5c1b1f[_0x5681('0x3e')]);var _0x42ac5f={'where':_0xe8f803[_0x5681('0x3a')]};return db[_0x5681('0x3f')]['count'](_0x42ac5f)[_0x5681('0x24')](function(_0x4950e0){_0x1e660d[_0x5681('0x1c')]=_0x4950e0;if(_0x5c1b1f['query'][_0x5681('0x40')]){_0xe8f803['include']=[{'all':!![]}];}return db[_0x5681('0x3f')][_0x5681('0x41')](_0xe8f803);})[_0x5681('0x24')](function(_0x14da3b){_0x1e660d['rows']=_0x14da3b;return _0x1e660d;})['then'](respondWithFilteredResult(_0x2a1b90,_0xe8f803))['catch'](handleError(_0x2a1b90,null));};exports[_0x5681('0x42')]=function(_0x38d65a,_0x124b0c){var _0x323e5a={'raw':!![],'where':{'id':_0x38d65a[_0x5681('0x43')]['id']}},_0x563e05={};_0x563e05['model']=_[_0x5681('0x44')](db[_0x5681('0x3f')][_0x5681('0x45')]);_0x563e05[_0x5681('0x2f')]=_['keys'](_0x38d65a[_0x5681('0x2f')]);_0x563e05[_0x5681('0x30')]=_[_0x5681('0x31')](_0x563e05[_0x5681('0x32')],_0x563e05['query']);_0x323e5a[_0x5681('0x33')]=_[_0x5681('0x31')](_0x563e05['model'],qs['fields'](_0x38d65a[_0x5681('0x2f')]['fields']));_0x323e5a[_0x5681('0x33')]=_0x323e5a[_0x5681('0x33')][_0x5681('0x46')]?_0x323e5a['attributes']:_0x563e05['model'];if(_0x38d65a[_0x5681('0x2f')][_0x5681('0x40')]){_0x323e5a[_0x5681('0x47')]=[{'all':!![]}];}_0x323e5a=_[_0x5681('0x3b')]({},_0x323e5a,_0x38d65a[_0x5681('0x3e')]);return db[_0x5681('0x3f')][_0x5681('0x48')](_0x323e5a)[_0x5681('0x24')](handleEntityNotFound(_0x124b0c,null))[_0x5681('0x24')](respondWithResult(_0x124b0c,null))[_0x5681('0x49')](handleError(_0x124b0c,null));};exports[_0x5681('0x4a')]=function(_0xa90f41,_0xc0bed0){return db[_0x5681('0x3f')][_0x5681('0x4a')](_0xa90f41['body'],{})[_0x5681('0x24')](function(_0x33b726){var _0x33c61b=_0xa90f41[_0x5681('0x4b')][_0x5681('0x25')]({'plain':!![]});if(!_0x33c61b)throw new Error(_0x5681('0x4c'));if(_0x33c61b[_0x5681('0x4d')]===_0x5681('0x4b')){var _0x3038f0=_0x33b726[_0x5681('0x25')]({'plain':!![]});var _0x263d28='Metrics';return db[_0x5681('0x4e')][_0x5681('0x48')]({'where':{'name':_0x263d28,'userProfileId':_0x33c61b[_0x5681('0x4f')]},'raw':!![]})[_0x5681('0x24')](function(_0x534b07){if(_0x534b07&&_0x534b07[_0x5681('0x50')]===0x0){return db[_0x5681('0x26')][_0x5681('0x4a')]({'name':_0x3038f0[_0x5681('0x29')],'resourceId':_0x3038f0['id'],'type':_0x534b07[_0x5681('0x29')],'sectionId':_0x534b07['id']},{})[_0x5681('0x24')](function(){return _0x33b726;});}else{return _0x33b726;}})[_0x5681('0x49')](function(_0x560297){logger[_0x5681('0x51')](_0x5681('0x52'),_0x560297);throw _0x560297;});}return _0x33b726;})[_0x5681('0x24')](respondWithResult(_0xc0bed0,0xc9))['catch'](handleError(_0xc0bed0,null));};exports[_0x5681('0x23')]=function(_0x4bb87f,_0x400f8f){if(_0x4bb87f[_0x5681('0x53')]['id']){delete _0x4bb87f[_0x5681('0x53')]['id'];}return db[_0x5681('0x3f')][_0x5681('0x48')]({'where':{'id':_0x4bb87f[_0x5681('0x43')]['id']}})[_0x5681('0x24')](handleEntityNotFound(_0x400f8f,null))[_0x5681('0x24')](saveUpdates(_0x4bb87f[_0x5681('0x53')],null))['then'](respondWithResult(_0x400f8f,null))['catch'](handleError(_0x400f8f,null));};exports[_0x5681('0x27')]=function(_0x5a9567,_0x237985){return db[_0x5681('0x3f')][_0x5681('0x48')]({'where':{'id':_0x5a9567['params']['id']}})[_0x5681('0x24')](handleEntityNotFound(_0x237985,null))['then'](removeEntity(_0x237985,null))[_0x5681('0x49')](handleError(_0x237985,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 68e751f..c83bc99 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 _0x766f=['moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports','util','../../config/logger','api'];(function(_0x1aad91,_0x4a76ab){var _0x4e53b2=function(_0x2b948a){while(--_0x2b948a){_0x1aad91['push'](_0x1aad91['shift']());}};_0x4e53b2(++_0x4a76ab);}(_0x766f,0x89));var _0xf766=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x766f[_0x35885a];return _0xe86249;};'use strict';var _=require('lodash');var util=require(_0xf766('0x0'));var logger=require(_0xf766('0x1'))(_0xf766('0x2'));var moment=require(_0xf766('0x3'));var BPromise=require(_0xf766('0x4'));var rp=require(_0xf766('0x5'));var fs=require('fs');var path=require(_0xf766('0x6'));var rimraf=require(_0xf766('0x7'));var config=require('../../config/environment');var attributes=require(_0xf766('0x8'));module[_0xf766('0x9')]=function(_0x1d71fa,_0x1e8a16){return _0x1d71fa['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c79=['path','rimraf','../../config/environment','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1ab699,_0x383d7f){var _0x1548e5=function(_0x2f6dc1){while(--_0x2f6dc1){_0x1ab699['push'](_0x1ab699['shift']());}};_0x1548e5(++_0x383d7f);}(_0x5c79,0x17a));var _0x95c7=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0x5c79[_0x3b19ea];return _0x40ece9;};'use strict';var _=require(_0x95c7('0x0'));var util=require(_0x95c7('0x1'));var logger=require(_0x95c7('0x2'))(_0x95c7('0x3'));var moment=require('moment');var BPromise=require(_0x95c7('0x4'));var rp=require(_0x95c7('0x5'));var fs=require('fs');var path=require(_0x95c7('0x6'));var rimraf=require(_0x95c7('0x7'));var config=require(_0x95c7('0x8'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x5f05f2,_0x2ff812){return _0x5f05f2[_0x95c7('0x9')](_0x95c7('0xa'),attributes,{'tableName':_0x95c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 7bcceaf..68f2b09 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 _0x7d3e=['client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','../../config/utils','../../config/environment'];(function(_0x11ec6c,_0x1a8169){var _0xb59506=function(_0x58e31d){while(--_0x58e31d){_0x11ec6c['push'](_0x11ec6c['shift']());}};_0xb59506(++_0x1a8169);}(_0x7d3e,0x69));var _0xe7d3=function(_0x1717a0,_0x3df0e9){_0x1717a0=_0x1717a0-0x0;var _0x4065f3=_0x7d3e[_0x1717a0];return _0x4065f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7d3('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe7d3('0x1'));var logger=require('../../config/logger')('rpc');var config=require(_0xe7d3('0x2'));var jayson=require('jayson/promise');var client=jayson[_0xe7d3('0x3')][_0xe7d3('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x5abbef,_0x4ea51b,_0x4f5306){return new BPromise(function(_0x262165,_0xdc78f1){return client[_0xe7d3('0x5')](_0x5abbef,_0x4f5306)[_0xe7d3('0x6')](function(_0x133c43){logger[_0xe7d3('0x7')](_0xe7d3('0x8'),_0x4ea51b,_0xe7d3('0x9'));logger[_0xe7d3('0xa')](_0xe7d3('0xb'),_0x4ea51b,_0xe7d3('0x9'),JSON[_0xe7d3('0xc')](_0x133c43));if(_0x133c43[_0xe7d3('0xd')]){if(_0x133c43[_0xe7d3('0xd')][_0xe7d3('0xe')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x4ea51b,_0x133c43[_0xe7d3('0xd')][_0xe7d3('0xf')]);return _0xdc78f1(_0x133c43[_0xe7d3('0xd')][_0xe7d3('0xf')]);}logger['error'](_0xe7d3('0x8'),_0x4ea51b,_0x133c43[_0xe7d3('0xd')][_0xe7d3('0xf')]);return _0x262165(_0x133c43[_0xe7d3('0xd')][_0xe7d3('0xf')]);}else{logger[_0xe7d3('0x7')](_0xe7d3('0x8'),_0x4ea51b,_0xe7d3('0x9'));_0x262165(_0x133c43[_0xe7d3('0x10')][_0xe7d3('0xf')]);}})[_0xe7d3('0x11')](function(_0x2c12bf){logger[_0xe7d3('0xd')](_0xe7d3('0x8'),_0x4ea51b,_0x2c12bf);_0xdc78f1(_0x2c12bf);});});} \ No newline at end of file +var _0xd771=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch'];(function(_0x14dbbd,_0x120b25){var _0x5e4207=function(_0x1154b9){while(--_0x1154b9){_0x14dbbd['push'](_0x14dbbd['shift']());}};_0x5e4207(++_0x120b25);}(_0xd771,0xdc));var _0x1d77=function(_0x36a0f6,_0x315f9a){_0x36a0f6=_0x36a0f6-0x0;var _0x2e6290=_0xd771[_0x36a0f6];return _0x2e6290;};'use strict';var _=require(_0x1d77('0x0'));var util=require('util');var moment=require(_0x1d77('0x1'));var BPromise=require('bluebird');var rs=require(_0x1d77('0x2'));var fs=require('fs');var Redis=require(_0x1d77('0x3'));var db=require(_0x1d77('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d77('0x5'))(_0x1d77('0x6'));var config=require(_0x1d77('0x7'));var jayson=require(_0x1d77('0x8'));var client=jayson[_0x1d77('0x9')][_0x1d77('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e8b16,_0x43c0f0,_0x76c692){return new BPromise(function(_0x5b475b,_0x2c9467){return client['request'](_0x5e8b16,_0x76c692)[_0x1d77('0xb')](function(_0x1647b9){logger['info'](_0x1d77('0xc'),_0x43c0f0,'request\x20sent');logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x43c0f0,_0x1d77('0xd'),JSON[_0x1d77('0xe')](_0x1647b9));if(_0x1647b9[_0x1d77('0xf')]){if(_0x1647b9[_0x1d77('0xf')]['code']===0x1f4){logger[_0x1d77('0xf')](_0x1d77('0xc'),_0x43c0f0,_0x1647b9['error'][_0x1d77('0x10')]);return _0x2c9467(_0x1647b9[_0x1d77('0xf')][_0x1d77('0x10')]);}logger[_0x1d77('0xf')](_0x1d77('0xc'),_0x43c0f0,_0x1647b9[_0x1d77('0xf')][_0x1d77('0x10')]);return _0x5b475b(_0x1647b9[_0x1d77('0xf')]['message']);}else{logger[_0x1d77('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x43c0f0,_0x1d77('0xd'));_0x5b475b(_0x1647b9[_0x1d77('0x12')][_0x1d77('0x10')]);}})[_0x1d77('0x13')](function(_0x52c9c7){logger['error'](_0x1d77('0xc'),_0x43c0f0,_0x52c9c7);_0x2c9467(_0x52c9c7);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index c95c744..28472ee 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 _0x6d38=['path','connect-timeout','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','create','put','update','delete','destroy','exports','util'];(function(_0x23d059,_0x55fe4e){var _0x4ad86c=function(_0x833143){while(--_0x833143){_0x23d059['push'](_0x23d059['shift']());}};_0x4ad86c(++_0x55fe4e);}(_0x6d38,0x1ef));var _0x86d3=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6d38[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x86d3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x86d3('0x4'));var controller=require(_0x86d3('0x5'));router[_0x86d3('0x6')]('/',auth['isAuthenticated'](),controller[_0x86d3('0x7')]);router[_0x86d3('0x6')](_0x86d3('0x8'),auth[_0x86d3('0x9')](),controller['show']);router['post']('/',auth[_0x86d3('0x9')](),controller[_0x86d3('0xa')]);router[_0x86d3('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x86d3('0xc')]);router[_0x86d3('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('0xf')]=router; \ No newline at end of file +var _0xf494=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util'];(function(_0x220430,_0x6e7218){var _0x4c1ae4=function(_0x53bba5){while(--_0x53bba5){_0x220430['push'](_0x220430['shift']());}};_0x4c1ae4(++_0x6e7218);}(_0xf494,0x1c6));var _0x4f49=function(_0x58071b,_0x2a7ef0){_0x58071b=_0x58071b-0x0;var _0x5742ce=_0xf494[_0x58071b];return _0x5742ce;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var auth=require(_0x4f49('0x5'));var interaction=require(_0x4f49('0x6'));var config=require(_0x4f49('0x7'));var controller=require(_0x4f49('0x8'));router[_0x4f49('0x9')]('/',auth[_0x4f49('0xa')](),controller[_0x4f49('0xb')]);router[_0x4f49('0x9')](_0x4f49('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x4f49('0xd')]('/',auth[_0x4f49('0xa')](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xc'),auth[_0x4f49('0xa')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')]('/:id',auth[_0x4f49('0xa')](),controller[_0x4f49('0x12')]);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 a4b9025..2eec74a 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 _0xfa7f=['exports','sequelize'];(function(_0x169070,_0x47e463){var _0x1c7014=function(_0x24193a){while(--_0x24193a){_0x169070['push'](_0x169070['shift']());}};_0x1c7014(++_0x47e463);}(_0xfa7f,0x87));var _0xffa7=function(_0x1eeb14,_0x282856){_0x1eeb14=_0x1eeb14-0x0;var _0x3437f9=_0xfa7f[_0x1eeb14];return _0x3437f9;};'use strict';var Sequelize=require(_0xffa7('0x0'));module[_0xffa7('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x2a3e=['sequelize','exports','TEXT'];(function(_0x404b42,_0x5f296e){var _0xfb6745=function(_0x3aa77e){while(--_0x3aa77e){_0x404b42['push'](_0x404b42['shift']());}};_0xfb6745(++_0x5f296e);}(_0x2a3e,0x6f));var _0xe2a3=function(_0x2c88c8,_0x4a71e6){_0x2c88c8=_0x2c88c8-0x0;var _0x320739=_0x2a3e[_0x2c88c8];return _0x320739;};'use strict';var Sequelize=require(_0xe2a3('0x0'));module[_0xe2a3('0x1')]={'tree':{'type':Sequelize[_0xe2a3('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 f7cc8ad..3bf5e68 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 _0xdd4f=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','html-pdf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','model','map','query','keys','filters'];(function(_0x274963,_0x586f06){var _0x59440b=function(_0x4adf71){while(--_0x4adf71){_0x274963['push'](_0x274963['shift']());}};_0x59440b(++_0x586f06);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x3710b5,_0x3cdf91){_0x3710b5=_0x3710b5-0x0;var _0x20acb1=_0xdd4f[_0x3710b5];return _0x20acb1;};'use strict';var pdf=require(_0xfdd4('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfdd4('0x1'));var rp=require(_0xfdd4('0x2'));var moment=require('moment');var BPromise=require(_0xfdd4('0x3'));var Mustache=require(_0xfdd4('0x4'));var util=require(_0xfdd4('0x5'));var path=require('path');var sox=require(_0xfdd4('0x6'));var csv=require(_0xfdd4('0x7'));var ejs=require(_0xfdd4('0x8'));var fs=require('fs');var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x7'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var hardwareService=require(_0xfdd4('0x10'));var logger=require(_0xfdd4('0x11'))(_0xfdd4('0x12'));var utils=require(_0xfdd4('0x13'));var config=require(_0xfdd4('0x14'));var db=require(_0xfdd4('0x15'))['db'];function respondWithStatusCode(_0x1c71c4,_0x3f07f1){_0x3f07f1=_0x3f07f1||0xcc;return function(_0x4565e6){if(_0x4565e6){return _0x1c71c4[_0xfdd4('0x16')](_0x3f07f1);}return _0x1c71c4['status'](_0x3f07f1)[_0xfdd4('0x17')]();};}function respondWithResult(_0xd7dbf,_0x227099){_0x227099=_0x227099||0xc8;return function(_0x57b21f){if(_0x57b21f){return _0xd7dbf[_0xfdd4('0x18')](_0x227099)['json'](_0x57b21f);}};}function respondWithFilteredResult(_0x467824,_0x42c3a8){return function(_0x2f34ec){if(_0x2f34ec){var _0x431255=_0x2f34ec['count'],_0x37b05f=_0x42c3a8[_0xfdd4('0x19')],_0x52cf2c=_0x42c3a8[_0xfdd4('0x19')]+_0x42c3a8[_0xfdd4('0x1a')],_0x47ed1d;if(_0x52cf2c>=_0x431255){_0x52cf2c=_0x431255;_0x47ed1d=0xc8;}else{_0x47ed1d=0xce;}_0x467824[_0xfdd4('0x18')](_0x47ed1d);return _0x467824[_0xfdd4('0x1b')](_0xfdd4('0x1c'),_0x37b05f+'-'+_0x52cf2c+'/'+_0x431255)[_0xfdd4('0x1d')](_0x2f34ec);}return null;};}function patchUpdates(_0x2ffd5f){return function(_0x32e00d){try{jsonpatch['apply'](_0x32e00d,_0x2ffd5f,!![]);}catch(_0x1e5d91){return BPromise[_0xfdd4('0x1e')](_0x1e5d91);}return _0x32e00d[_0xfdd4('0x1f')]();};}function saveUpdates(_0x36e611,_0x1454f1){return function(_0x29cc8d){if(_0x29cc8d){return _0x29cc8d[_0xfdd4('0x20')](_0x36e611)[_0xfdd4('0x21')](function(_0x523a7d){return _0x523a7d;});}return null;};}function removeEntity(_0x2147e6,_0x17302b){return function(_0x2a24e8){if(_0x2a24e8){return _0x2a24e8[_0xfdd4('0x22')]()[_0xfdd4('0x21')](function(){_0x2147e6[_0xfdd4('0x18')](0xcc)[_0xfdd4('0x17')]();});}};}function handleEntityNotFound(_0x277ec1,_0x538b00){return function(_0x1e14da){if(!_0x1e14da){_0x277ec1[_0xfdd4('0x16')](0x194);}return _0x1e14da;};}function handleError(_0x4397a3,_0x53d35a){_0x53d35a=_0x53d35a||0x1f4;return function(_0x58fe0d){logger[_0xfdd4('0x23')](_0x58fe0d[_0xfdd4('0x24')]);if(_0x58fe0d[_0xfdd4('0x25')]){delete _0x58fe0d[_0xfdd4('0x25')];}_0x4397a3['status'](_0x53d35a)[_0xfdd4('0x26')](_0x58fe0d);};}exports[_0xfdd4('0x27')]=function(_0x3cd2c9,_0x31e053){var _0x3c6728={},_0x192471={},_0x453a48={'count':0x0,'rows':[]};var _0x37b7a2=_['map'](db[_0xfdd4('0x28')][_0xfdd4('0x29')],function(_0x385a68){return{'name':_0x385a68[_0xfdd4('0x2a')],'type':_0x385a68[_0xfdd4('0x2b')]['key']};});_0x192471[_0xfdd4('0x2c')]=_[_0xfdd4('0x2d')](_0x37b7a2,_0xfdd4('0x25'));_0x192471[_0xfdd4('0x2e')]=_[_0xfdd4('0x2f')](_0x3cd2c9['query']);_0x192471[_0xfdd4('0x30')]=_[_0xfdd4('0x31')](_0x192471[_0xfdd4('0x2c')],_0x192471['query']);_0x3c6728[_0xfdd4('0x32')]=_['intersection'](_0x192471[_0xfdd4('0x2c')],qs[_0xfdd4('0x33')](_0x3cd2c9['query']['fields']));_0x3c6728[_0xfdd4('0x32')]=_0x3c6728[_0xfdd4('0x32')]['length']?_0x3c6728['attributes']:_0x192471[_0xfdd4('0x2c')];if(!_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x34')](_0xfdd4('0x35'))){_0x3c6728[_0xfdd4('0x1a')]=qs[_0xfdd4('0x1a')](_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x1a')]);_0x3c6728[_0xfdd4('0x19')]=qs[_0xfdd4('0x19')](_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x19')]);}_0x3c6728[_0xfdd4('0x36')]=qs[_0xfdd4('0x37')](_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x37')]);_0x3c6728[_0xfdd4('0x38')]=qs[_0xfdd4('0x30')](_[_0xfdd4('0x39')](_0x3cd2c9[_0xfdd4('0x2e')],_0x192471[_0xfdd4('0x30')]));if(_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x3a')]){_0x3c6728[_0xfdd4('0x38')]=_[_0xfdd4('0x3b')](_0x3c6728[_0xfdd4('0x38')],{'$or':_['map'](_0x37b7a2,function(_0x2b6c87){if(_0x2b6c87[_0xfdd4('0x2b')]!==_0xfdd4('0x3c')){var _0x439389={};_0x439389[_0x2b6c87[_0xfdd4('0x25')]]={'$like':'%'+_0x3cd2c9[_0xfdd4('0x2e')]['filter']+'%'};return _0x439389;}})});}_0x3c6728=_[_0xfdd4('0x3b')]({},_0x3c6728,_0x3cd2c9['options']);var _0xeca9d={'where':_0x3c6728[_0xfdd4('0x38')]};return db[_0xfdd4('0x28')][_0xfdd4('0x3d')](_0xeca9d)['then'](function(_0x1c6f43){_0x453a48[_0xfdd4('0x3d')]=_0x1c6f43;if(_0x3cd2c9[_0xfdd4('0x2e')][_0xfdd4('0x3e')]){_0x3c6728[_0xfdd4('0x3f')]=[{'all':!![]}];}return db[_0xfdd4('0x28')][_0xfdd4('0x40')](_0x3c6728);})[_0xfdd4('0x21')](function(_0xe65944){_0x453a48[_0xfdd4('0x41')]=_0xe65944;return _0x453a48;})['then'](respondWithFilteredResult(_0x31e053,_0x3c6728))[_0xfdd4('0x42')](handleError(_0x31e053,null));};exports[_0xfdd4('0x43')]=function(_0x210a15,_0x67a1e3){var _0x5173db={'raw':!![],'where':{'id':_0x210a15[_0xfdd4('0x44')]['id']}},_0x3e2bda={};_0x3e2bda[_0xfdd4('0x2c')]=_[_0xfdd4('0x2f')](db[_0xfdd4('0x28')]['rawAttributes']);_0x3e2bda[_0xfdd4('0x2e')]=_[_0xfdd4('0x2f')](_0x210a15[_0xfdd4('0x2e')]);_0x3e2bda[_0xfdd4('0x30')]=_[_0xfdd4('0x31')](_0x3e2bda[_0xfdd4('0x2c')],_0x3e2bda[_0xfdd4('0x2e')]);_0x5173db['attributes']=_[_0xfdd4('0x31')](_0x3e2bda['model'],qs[_0xfdd4('0x33')](_0x210a15[_0xfdd4('0x2e')][_0xfdd4('0x33')]));_0x5173db[_0xfdd4('0x32')]=_0x5173db['attributes'][_0xfdd4('0x45')]?_0x5173db[_0xfdd4('0x32')]:_0x3e2bda['model'];if(_0x210a15[_0xfdd4('0x2e')][_0xfdd4('0x3e')]){_0x5173db['include']=[{'all':!![]}];}_0x5173db=_[_0xfdd4('0x3b')]({},_0x5173db,_0x210a15['options']);return db['AnalyticTreeReport']['find'](_0x5173db)[_0xfdd4('0x21')](handleEntityNotFound(_0x67a1e3,null))[_0xfdd4('0x21')](respondWithResult(_0x67a1e3,null))[_0xfdd4('0x42')](handleError(_0x67a1e3,null));};exports['create']=function(_0x393029,_0x169d72){return db['AnalyticTreeReport'][_0xfdd4('0x46')](_0x393029[_0xfdd4('0x47')],{})[_0xfdd4('0x21')](respondWithResult(_0x169d72,0xc9))[_0xfdd4('0x42')](handleError(_0x169d72,null));};exports[_0xfdd4('0x20')]=function(_0x3817fe,_0x2578eb){if(_0x3817fe[_0xfdd4('0x47')]['id']){delete _0x3817fe[_0xfdd4('0x47')]['id'];}return db[_0xfdd4('0x28')][_0xfdd4('0x48')]({'where':{'id':_0x3817fe[_0xfdd4('0x44')]['id']}})[_0xfdd4('0x21')](handleEntityNotFound(_0x2578eb,null))[_0xfdd4('0x21')](saveUpdates(_0x3817fe['body'],null))['then'](respondWithResult(_0x2578eb,null))[_0xfdd4('0x42')](handleError(_0x2578eb,null));};exports[_0xfdd4('0x22')]=function(_0x1296e6,_0x1932ef){return db['AnalyticTreeReport'][_0xfdd4('0x48')]({'where':{'id':_0x1296e6[_0xfdd4('0x44')]['id']}})['then'](handleEntityNotFound(_0x1932ef,null))['then'](removeEntity(_0x1932ef,null))['catch'](handleError(_0x1932ef,null));}; \ No newline at end of file +var _0xb688=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','save','update','then','destroy','error','stack','send','index','AnalyticTreeReport','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x19e3fd,_0x51872a){var _0x46fc6b=function(_0x166b93){while(--_0x166b93){_0x19e3fd['push'](_0x19e3fd['shift']());}};_0x46fc6b(++_0x51872a);}(_0xb688,0xcf));var _0x8b68=function(_0x48d27a,_0x40671b){_0x48d27a=_0x48d27a-0x0;var _0x4e8a2d=_0xb688[_0x48d27a];return _0x4e8a2d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8b68('0x0'));var rimraf=require(_0x8b68('0x1'));var zipdir=require(_0x8b68('0x2'));var jsonpatch=require(_0x8b68('0x3'));var rp=require(_0x8b68('0x4'));var moment=require(_0x8b68('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8b68('0x6'));var util=require(_0x8b68('0x7'));var path=require(_0x8b68('0x8'));var sox=require(_0x8b68('0x9'));var csv=require('to-csv');var ejs=require(_0x8b68('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0xf'));var querystring=require(_0x8b68('0x10'));var Papa=require(_0x8b68('0x11'));var Redis=require(_0x8b68('0x12'));var authService=require(_0x8b68('0x13'));var qs=require(_0x8b68('0x14'));var as=require(_0x8b68('0x15'));var hardwareService=require(_0x8b68('0x16'));var logger=require(_0x8b68('0x17'))('api');var utils=require(_0x8b68('0x18'));var config=require(_0x8b68('0x19'));var db=require(_0x8b68('0x1a'))['db'];function respondWithStatusCode(_0x2d8472,_0x1965cf){_0x1965cf=_0x1965cf||0xcc;return function(_0x2f3af4){if(_0x2f3af4){return _0x2d8472[_0x8b68('0x1b')](_0x1965cf);}return _0x2d8472[_0x8b68('0x1c')](_0x1965cf)[_0x8b68('0x1d')]();};}function respondWithResult(_0x5b4364,_0xb2df35){_0xb2df35=_0xb2df35||0xc8;return function(_0x509033){if(_0x509033){return _0x5b4364['status'](_0xb2df35)[_0x8b68('0x1e')](_0x509033);}};}function respondWithFilteredResult(_0x1554d6,_0x27d717){return function(_0x5d3468){if(_0x5d3468){var _0x5c8d0e=_0x5d3468[_0x8b68('0x1f')],_0x23bd52=_0x27d717[_0x8b68('0x20')],_0x5c1e44=_0x27d717[_0x8b68('0x20')]+_0x27d717['limit'],_0x136f1b;if(_0x5c1e44>=_0x5c8d0e){_0x5c1e44=_0x5c8d0e;_0x136f1b=0xc8;}else{_0x136f1b=0xce;}_0x1554d6[_0x8b68('0x1c')](_0x136f1b);return _0x1554d6[_0x8b68('0x21')]('Content-Range',_0x23bd52+'-'+_0x5c1e44+'/'+_0x5c8d0e)[_0x8b68('0x1e')](_0x5d3468);}return null;};}function patchUpdates(_0x3c7e5a){return function(_0x3cf3bd){try{jsonpatch[_0x8b68('0x22')](_0x3cf3bd,_0x3c7e5a,!![]);}catch(_0x38b7a7){return BPromise['reject'](_0x38b7a7);}return _0x3cf3bd[_0x8b68('0x23')]();};}function saveUpdates(_0x4b4b0f,_0x59e9b1){return function(_0x1a9788){if(_0x1a9788){return _0x1a9788[_0x8b68('0x24')](_0x4b4b0f)[_0x8b68('0x25')](function(_0x5603d4){return _0x5603d4;});}return null;};}function removeEntity(_0x571adf,_0x23edc1){return function(_0x59cb26){if(_0x59cb26){return _0x59cb26[_0x8b68('0x26')]()[_0x8b68('0x25')](function(){_0x571adf[_0x8b68('0x1c')](0xcc)[_0x8b68('0x1d')]();});}};}function handleEntityNotFound(_0x32ddc5,_0x173524){return function(_0x59bb8a){if(!_0x59bb8a){_0x32ddc5[_0x8b68('0x1b')](0x194);}return _0x59bb8a;};}function handleError(_0x46e827,_0x4ca77d){_0x4ca77d=_0x4ca77d||0x1f4;return function(_0x1c5808){logger[_0x8b68('0x27')](_0x1c5808[_0x8b68('0x28')]);if(_0x1c5808['name']){delete _0x1c5808['name'];}_0x46e827['status'](_0x4ca77d)[_0x8b68('0x29')](_0x1c5808);};}exports[_0x8b68('0x2a')]=function(_0x2ba2a3,_0x583476){var _0x3311c7={},_0x53aaa2={},_0x4cf89d={'count':0x0,'rows':[]};var _0x3865ea=_['map'](db[_0x8b68('0x2b')][_0x8b68('0x2c')],function(_0x48e2c8){return{'name':_0x48e2c8['fieldName'],'type':_0x48e2c8[_0x8b68('0x2d')][_0x8b68('0x2e')]};});_0x53aaa2[_0x8b68('0x2f')]=_[_0x8b68('0x30')](_0x3865ea,_0x8b68('0x31'));_0x53aaa2[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x2ba2a3['query']);_0x53aaa2[_0x8b68('0x34')]=_['intersection'](_0x53aaa2[_0x8b68('0x2f')],_0x53aaa2[_0x8b68('0x32')]);_0x3311c7['attributes']=_[_0x8b68('0x35')](_0x53aaa2[_0x8b68('0x2f')],qs[_0x8b68('0x36')](_0x2ba2a3['query']['fields']));_0x3311c7[_0x8b68('0x37')]=_0x3311c7[_0x8b68('0x37')][_0x8b68('0x38')]?_0x3311c7[_0x8b68('0x37')]:_0x53aaa2[_0x8b68('0x2f')];if(!_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x39')](_0x8b68('0x3a'))){_0x3311c7[_0x8b68('0x3b')]=qs[_0x8b68('0x3b')](_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x3b')]);_0x3311c7[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x20')]);}_0x3311c7[_0x8b68('0x3c')]=qs[_0x8b68('0x3d')](_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x3d')]);_0x3311c7[_0x8b68('0x3e')]=qs[_0x8b68('0x34')](_['pick'](_0x2ba2a3['query'],_0x53aaa2[_0x8b68('0x34')]));if(_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x3f')]){_0x3311c7[_0x8b68('0x3e')]=_[_0x8b68('0x40')](_0x3311c7[_0x8b68('0x3e')],{'$or':_[_0x8b68('0x30')](_0x3865ea,function(_0x43feb3){if(_0x43feb3['type']!==_0x8b68('0x41')){var _0x2c94d0={};_0x2c94d0[_0x43feb3[_0x8b68('0x31')]]={'$like':'%'+_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x3f')]+'%'};return _0x2c94d0;}})});}_0x3311c7=_[_0x8b68('0x40')]({},_0x3311c7,_0x2ba2a3[_0x8b68('0x42')]);var _0x2dd264={'where':_0x3311c7['where']};return db[_0x8b68('0x2b')][_0x8b68('0x1f')](_0x2dd264)[_0x8b68('0x25')](function(_0x374a7c){_0x4cf89d[_0x8b68('0x1f')]=_0x374a7c;if(_0x2ba2a3[_0x8b68('0x32')][_0x8b68('0x43')]){_0x3311c7['include']=[{'all':!![]}];}return db[_0x8b68('0x2b')][_0x8b68('0x44')](_0x3311c7);})['then'](function(_0x14ec40){_0x4cf89d[_0x8b68('0x45')]=_0x14ec40;return _0x4cf89d;})['then'](respondWithFilteredResult(_0x583476,_0x3311c7))['catch'](handleError(_0x583476,null));};exports['show']=function(_0x4a093e,_0x423194){var _0x23d24a={'raw':!![],'where':{'id':_0x4a093e[_0x8b68('0x46')]['id']}},_0x515815={};_0x515815['model']=_[_0x8b68('0x33')](db[_0x8b68('0x2b')]['rawAttributes']);_0x515815[_0x8b68('0x32')]=_['keys'](_0x4a093e['query']);_0x515815['filters']=_[_0x8b68('0x35')](_0x515815[_0x8b68('0x2f')],_0x515815[_0x8b68('0x32')]);_0x23d24a[_0x8b68('0x37')]=_['intersection'](_0x515815[_0x8b68('0x2f')],qs['fields'](_0x4a093e[_0x8b68('0x32')][_0x8b68('0x36')]));_0x23d24a['attributes']=_0x23d24a[_0x8b68('0x37')][_0x8b68('0x38')]?_0x23d24a[_0x8b68('0x37')]:_0x515815[_0x8b68('0x2f')];if(_0x4a093e['query'][_0x8b68('0x43')]){_0x23d24a[_0x8b68('0x47')]=[{'all':!![]}];}_0x23d24a=_[_0x8b68('0x40')]({},_0x23d24a,_0x4a093e[_0x8b68('0x42')]);return db[_0x8b68('0x2b')][_0x8b68('0x48')](_0x23d24a)[_0x8b68('0x25')](handleEntityNotFound(_0x423194,null))[_0x8b68('0x25')](respondWithResult(_0x423194,null))[_0x8b68('0x49')](handleError(_0x423194,null));};exports[_0x8b68('0x4a')]=function(_0x1ec2c4,_0x2a2a99){return db[_0x8b68('0x2b')][_0x8b68('0x4a')](_0x1ec2c4[_0x8b68('0x4b')],{})[_0x8b68('0x25')](respondWithResult(_0x2a2a99,0xc9))['catch'](handleError(_0x2a2a99,null));};exports[_0x8b68('0x24')]=function(_0x20681a,_0x5dd099){if(_0x20681a[_0x8b68('0x4b')]['id']){delete _0x20681a['body']['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x20681a[_0x8b68('0x46')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x5dd099,null))[_0x8b68('0x25')](saveUpdates(_0x20681a[_0x8b68('0x4b')],null))['then'](respondWithResult(_0x5dd099,null))['catch'](handleError(_0x5dd099,null));};exports[_0x8b68('0x26')]=function(_0x163fd5,_0x1e900f){return db['AnalyticTreeReport'][_0x8b68('0x48')]({'where':{'id':_0x163fd5[_0x8b68('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e900f,null))[_0x8b68('0x25')](removeEntity(_0x1e900f,null))[_0x8b68('0x49')](handleError(_0x1e900f,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 2953ad2..412158b 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 _0x01d9=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x105b20,_0x388d13){var _0x357455=function(_0x5b28d7){while(--_0x5b28d7){_0x105b20['push'](_0x105b20['shift']());}};_0x357455(++_0x388d13);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var logger=require(_0x901d('0x2'))(_0x901d('0x3'));var moment=require('moment');var BPromise=require(_0x901d('0x4'));var rp=require(_0x901d('0x5'));var fs=require('fs');var path=require(_0x901d('0x6'));var rimraf=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var attributes=require(_0x901d('0x9'));module[_0x901d('0xa')]=function(_0x4e7842,_0x1e5d7d){return _0x4e7842[_0x901d('0xb')](_0x901d('0xc'),attributes,{'tableName':_0x901d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45c2=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x4d3410,_0x2cce25){var _0x4d6f57=function(_0x1fe69c){while(--_0x1fe69c){_0x4d3410['push'](_0x4d3410['shift']());}};_0x4d6f57(++_0x2cce25);}(_0x45c2,0x68));var _0x245c=function(_0x35bad0,_0x21927d){_0x35bad0=_0x35bad0-0x0;var _0x4fe50f=_0x45c2[_0x35bad0];return _0x4fe50f;};'use strict';var _=require(_0x245c('0x0'));var util=require(_0x245c('0x1'));var logger=require(_0x245c('0x2'))(_0x245c('0x3'));var moment=require('moment');var BPromise=require(_0x245c('0x4'));var rp=require(_0x245c('0x5'));var fs=require('fs');var path=require(_0x245c('0x6'));var rimraf=require('rimraf');var config=require(_0x245c('0x7'));var attributes=require(_0x245c('0x8'));module[_0x245c('0x9')]=function(_0x3a75df,_0x11a37e){return _0x3a75df[_0x245c('0xa')](_0x245c('0xb'),attributes,{'tableName':_0x245c('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 5146bc5..6fdcc0f 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 _0x9341=['client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x35541c,_0x156ccf){var _0x4a26c5=function(_0xea7f9b){while(--_0xea7f9b){_0x35541c['push'](_0x35541c['shift']());}};_0x4a26c5(++_0x156ccf);}(_0x9341,0x176));var _0x1934=function(_0x2c7615,_0x59e33e){_0x2c7615=_0x2c7615-0x0;var _0x3bf545=_0x9341[_0x2c7615];return _0x3bf545;};'use strict';var _=require(_0x1934('0x0'));var util=require(_0x1934('0x1'));var moment=require('moment');var BPromise=require(_0x1934('0x2'));var rs=require(_0x1934('0x3'));var fs=require('fs');var Redis=require(_0x1934('0x4'));var db=require(_0x1934('0x5'))['db'];var utils=require(_0x1934('0x6'));var logger=require(_0x1934('0x7'))('rpc');var config=require(_0x1934('0x8'));var jayson=require(_0x1934('0x9'));var client=jayson[_0x1934('0xa')][_0x1934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa2fc82,_0x43aad9,_0x1722ed){return new BPromise(function(_0x8e85c,_0x5620de){return client[_0x1934('0xc')](_0xa2fc82,_0x1722ed)[_0x1934('0xd')](function(_0x39d094){logger[_0x1934('0xe')](_0x1934('0xf'),_0x43aad9,_0x1934('0x10'));logger[_0x1934('0x11')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x43aad9,_0x1934('0x10'),JSON[_0x1934('0x12')](_0x39d094));if(_0x39d094['error']){if(_0x39d094[_0x1934('0x13')][_0x1934('0x14')]===0x1f4){logger[_0x1934('0x13')](_0x1934('0xf'),_0x43aad9,_0x39d094[_0x1934('0x13')][_0x1934('0x15')]);return _0x5620de(_0x39d094[_0x1934('0x13')][_0x1934('0x15')]);}logger[_0x1934('0x13')](_0x1934('0xf'),_0x43aad9,_0x39d094[_0x1934('0x13')]['message']);return _0x8e85c(_0x39d094['error'][_0x1934('0x15')]);}else{logger['info'](_0x1934('0xf'),_0x43aad9,_0x1934('0x10'));_0x8e85c(_0x39d094[_0x1934('0x16')][_0x1934('0x15')]);}})[_0x1934('0x17')](function(_0x493f6c){logger[_0x1934('0x13')](_0x1934('0xf'),_0x43aad9,_0x493f6c);_0x5620de(_0x493f6c);});});} \ No newline at end of file +var _0xddad=['AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','AnalyticTreeReport,\x20%s,\x20%s','debug'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xddad,0x12f));var _0xddda=function(_0x3a62d3,_0x4fd275){_0x3a62d3=_0x3a62d3-0x0;var _0x138eae=_0xddad[_0x3a62d3];return _0x138eae;};'use strict';var _=require(_0xddda('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xddda('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddda('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xddda('0x3'));var logger=require(_0xddda('0x4'))(_0xddda('0x5'));var config=require('../../config/environment');var jayson=require(_0xddda('0x6'));var client=jayson[_0xddda('0x7')][_0xddda('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3358be,_0x437f01,_0x34a28b){return new BPromise(function(_0x5d1135,_0x20fab7){return client[_0xddda('0x9')](_0x3358be,_0x34a28b)['then'](function(_0x3d3160){logger['info'](_0xddda('0xa'),_0x437f01,'request\x20sent');logger[_0xddda('0xb')](_0xddda('0xc'),_0x437f01,_0xddda('0xd'),JSON[_0xddda('0xe')](_0x3d3160));if(_0x3d3160['error']){if(_0x3d3160[_0xddda('0xf')][_0xddda('0x10')]===0x1f4){logger[_0xddda('0xf')](_0xddda('0xa'),_0x437f01,_0x3d3160['error']['message']);return _0x20fab7(_0x3d3160[_0xddda('0xf')][_0xddda('0x11')]);}logger['error'](_0xddda('0xa'),_0x437f01,_0x3d3160[_0xddda('0xf')][_0xddda('0x11')]);return _0x5d1135(_0x3d3160[_0xddda('0xf')][_0xddda('0x11')]);}else{logger[_0xddda('0x12')](_0xddda('0xa'),_0x437f01,_0xddda('0xd'));_0x5d1135(_0x3d3160[_0xddda('0x13')][_0xddda('0x11')]);}})[_0xddda('0x14')](function(_0x239c9a){logger[_0xddda('0xf')](_0xddda('0xa'),_0x437f01,_0x239c9a);_0x20fab7(_0x239c9a);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index fd3e2ef..d125995 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 _0x5d1e=['express','Router','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2aa83a,_0x4b5c0b){var _0x36a653=function(_0x3fdc46){while(--_0x3fdc46){_0x2aa83a['push'](_0x2aa83a['shift']());}};_0x36a653(++_0x4b5c0b);}(_0x5d1e,0x1e3));var _0xe5d1=function(_0x1c386e,_0x4b2257){_0x1c386e=_0x1c386e-0x0;var _0x26f0ad=_0x5d1e[_0x1c386e];return _0x26f0ad;};'use strict';var multer=require(_0xe5d1('0x0'));var util=require(_0xe5d1('0x1'));var path=require(_0xe5d1('0x2'));var timeout=require('connect-timeout');var express=require(_0xe5d1('0x3'));var router=express[_0xe5d1('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe5d1('0x5'));var controller=require(_0xe5d1('0x6'));router[_0xe5d1('0x7')]('/',auth[_0xe5d1('0x8')](),controller[_0xe5d1('0x9')]);router[_0xe5d1('0x7')](_0xe5d1('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xe5d1('0xb')]('/',auth[_0xe5d1('0x8')](),controller[_0xe5d1('0xc')]);router[_0xe5d1('0xd')]('/:id',auth[_0xe5d1('0x8')](),controller[_0xe5d1('0xe')]);router[_0xe5d1('0xf')](_0xe5d1('0xa'),auth[_0xe5d1('0x8')](),controller[_0xe5d1('0x10')]);module[_0xe5d1('0x11')]=router; \ No newline at end of file +var _0x4325=['show','post','create','put','update','delete','exports','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','/:id'];(function(_0x3dc1a3,_0x5d832a){var _0x522289=function(_0x26e580){while(--_0x26e580){_0x3dc1a3['push'](_0x3dc1a3['shift']());}};_0x522289(++_0x5d832a);}(_0x4325,0x181));var _0x5432=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4325[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5432('0x0')]();var auth=require(_0x5432('0x1'));var interaction=require(_0x5432('0x2'));var config=require('../../config/environment');var controller=require(_0x5432('0x3'));router[_0x5432('0x4')]('/',auth[_0x5432('0x5')](),controller['index']);router['get'](_0x5432('0x6'),auth[_0x5432('0x5')](),controller[_0x5432('0x7')]);router[_0x5432('0x8')]('/',auth[_0x5432('0x5')](),controller[_0x5432('0x9')]);router[_0x5432('0xa')](_0x5432('0x6'),auth['isAuthenticated'](),controller[_0x5432('0xb')]);router[_0x5432('0xc')](_0x5432('0x6'),auth['isAuthenticated'](),controller['destroy']);module[_0x5432('0xd')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 072d774..1c05f2d 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 _0x3dae=['exports','STRING','sequelize'];(function(_0x540ff4,_0x5073d4){var _0x3fb385=function(_0x2d3668){while(--_0x2d3668){_0x540ff4['push'](_0x540ff4['shift']());}};_0x3fb385(++_0x5073d4);}(_0x3dae,0x18b));var _0xe3da=function(_0x1e78a6,_0x4e40dc){_0x1e78a6=_0x1e78a6-0x0;var _0x1b218f=_0x3dae[_0x1e78a6];return _0x1b218f;};'use strict';var Sequelize=require(_0xe3da('0x0'));module[_0xe3da('0x1')]={'name':{'type':Sequelize[_0xe3da('0x2')]},'basename':{'type':Sequelize[_0xe3da('0x2')]},'type':{'type':Sequelize[_0xe3da('0x2')]}}; \ No newline at end of file +var _0x7da0=['exports','STRING'];(function(_0x50b7c7,_0x48fb99){var _0x297ecc=function(_0x3b2d31){while(--_0x3b2d31){_0x50b7c7['push'](_0x50b7c7['shift']());}};_0x297ecc(++_0x48fb99);}(_0x7da0,0x17c));var _0x07da=function(_0x1ba62b,_0x16fb56){_0x1ba62b=_0x1ba62b-0x0;var _0x1c2758=_0x7da0[_0x1ba62b];return _0x1c2758;};'use strict';var Sequelize=require('sequelize');module[_0x07da('0x0')]={'name':{'type':Sequelize[_0x07da('0x1')]},'basename':{'type':Sequelize[_0x07da('0x1')]},'type':{'type':Sequelize[_0x07da('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 087098a..35ae108 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 _0x9846=['findAll','rows','catch','show','clone','find','get','omit','createdAt','updatedAt','body','params','create','file','originalname','basename','filename','mimetype','join','root','server/files/attachments/','html-pdf','rimraf','fast-json-patch','request-promise','mustache','path','sox','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','include'];(function(_0x544af1,_0x258acb){var _0x287049=function(_0x4ddc98){while(--_0x4ddc98){_0x544af1['push'](_0x544af1['shift']());}};_0x287049(++_0x258acb);}(_0x9846,0x15d));var _0x6984=function(_0xd880ae,_0x41521b){_0xd880ae=_0xd880ae-0x0;var _0x118e8a=_0x9846[_0xd880ae];return _0x118e8a;};'use strict';var pdf=require(_0x6984('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6984('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6984('0x2'));var rp=require(_0x6984('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6984('0x4'));var util=require('util');var path=require(_0x6984('0x5'));var sox=require(_0x6984('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6984('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x6984('0x8'));var toCsv=require(_0x6984('0x9'));var querystring=require(_0x6984('0xa'));var Papa=require('papaparse');var Redis=require(_0x6984('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x6984('0xc'));var as=require(_0x6984('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6984('0xe'))(_0x6984('0xf'));var utils=require(_0x6984('0x10'));var config=require('../../config/environment');var db=require(_0x6984('0x11'))['db'];function respondWithStatusCode(_0x18b584,_0x559c3b){_0x559c3b=_0x559c3b||0xcc;return function(_0xe5c037){if(_0xe5c037){return _0x18b584[_0x6984('0x12')](_0x559c3b);}return _0x18b584[_0x6984('0x13')](_0x559c3b)[_0x6984('0x14')]();};}function respondWithResult(_0x2ff520,_0x361b75){_0x361b75=_0x361b75||0xc8;return function(_0x2db855){if(_0x2db855){return _0x2ff520[_0x6984('0x13')](_0x361b75)[_0x6984('0x15')](_0x2db855);}};}function respondWithFilteredResult(_0x1956c1,_0x3e75cf){return function(_0x58bbdb){if(_0x58bbdb){var _0x46cb53=_0x58bbdb[_0x6984('0x16')],_0xa1240c=_0x3e75cf[_0x6984('0x17')],_0xa22967=_0x3e75cf[_0x6984('0x17')]+_0x3e75cf['limit'],_0x3b5927;if(_0xa22967>=_0x46cb53){_0xa22967=_0x46cb53;_0x3b5927=0xc8;}else{_0x3b5927=0xce;}_0x1956c1['status'](_0x3b5927);return _0x1956c1[_0x6984('0x18')](_0x6984('0x19'),_0xa1240c+'-'+_0xa22967+'/'+_0x46cb53)[_0x6984('0x15')](_0x58bbdb);}return null;};}function patchUpdates(_0x50cba7){return function(_0x446386){try{jsonpatch[_0x6984('0x1a')](_0x446386,_0x50cba7,!![]);}catch(_0x5e3149){return BPromise['reject'](_0x5e3149);}return _0x446386[_0x6984('0x1b')]();};}function saveUpdates(_0x27164a,_0x4e85f5){return function(_0x1e9393){if(_0x1e9393){return _0x1e9393[_0x6984('0x1c')](_0x27164a)[_0x6984('0x1d')](function(_0x1379df){return _0x1379df;});}return null;};}function removeEntity(_0x45dcc1,_0x56b03a){return function(_0x5ad999){if(_0x5ad999){return _0x5ad999[_0x6984('0x1e')]()[_0x6984('0x1d')](function(){_0x45dcc1[_0x6984('0x13')](0xcc)[_0x6984('0x14')]();});}};}function handleEntityNotFound(_0x58b682,_0x47ee7e){return function(_0x39b136){if(!_0x39b136){_0x58b682[_0x6984('0x12')](0x194);}return _0x39b136;};}function handleError(_0x557f0e,_0x53f268){_0x53f268=_0x53f268||0x1f4;return function(_0x2d0816){logger[_0x6984('0x1f')](_0x2d0816[_0x6984('0x20')]);if(_0x2d0816[_0x6984('0x21')]){delete _0x2d0816[_0x6984('0x21')];}_0x557f0e[_0x6984('0x13')](_0x53f268)['send'](_0x2d0816);};}exports[_0x6984('0x22')]=function(_0x2d4a8d,_0x42e9a0){var _0x33a6ad={},_0x5c26f4={},_0x40f523={'count':0x0,'rows':[]};var _0x309332=_[_0x6984('0x23')](db[_0x6984('0x24')][_0x6984('0x25')],function(_0xa48577){return{'name':_0xa48577[_0x6984('0x26')],'type':_0xa48577[_0x6984('0x27')][_0x6984('0x28')]};});_0x5c26f4['model']=_[_0x6984('0x23')](_0x309332,'name');_0x5c26f4[_0x6984('0x29')]=_[_0x6984('0x2a')](_0x2d4a8d[_0x6984('0x29')]);_0x5c26f4[_0x6984('0x2b')]=_['intersection'](_0x5c26f4[_0x6984('0x2c')],_0x5c26f4[_0x6984('0x29')]);_0x33a6ad[_0x6984('0x2d')]=_[_0x6984('0x2e')](_0x5c26f4[_0x6984('0x2c')],qs[_0x6984('0x2f')](_0x2d4a8d['query'][_0x6984('0x2f')]));_0x33a6ad[_0x6984('0x2d')]=_0x33a6ad[_0x6984('0x2d')][_0x6984('0x30')]?_0x33a6ad['attributes']:_0x5c26f4[_0x6984('0x2c')];if(!_0x2d4a8d[_0x6984('0x29')][_0x6984('0x31')](_0x6984('0x32'))){_0x33a6ad[_0x6984('0x33')]=qs['limit'](_0x2d4a8d[_0x6984('0x29')][_0x6984('0x33')]);_0x33a6ad[_0x6984('0x17')]=qs[_0x6984('0x17')](_0x2d4a8d['query'][_0x6984('0x17')]);}_0x33a6ad[_0x6984('0x34')]=qs[_0x6984('0x35')](_0x2d4a8d[_0x6984('0x29')][_0x6984('0x35')]);_0x33a6ad[_0x6984('0x36')]=qs['filters'](_[_0x6984('0x37')](_0x2d4a8d[_0x6984('0x29')],_0x5c26f4[_0x6984('0x2b')]));if(_0x2d4a8d['query']['filter']){_0x33a6ad['where']=_[_0x6984('0x38')](_0x33a6ad[_0x6984('0x36')],{'$or':_[_0x6984('0x23')](_0x309332,function(_0x371c83){if(_0x371c83[_0x6984('0x27')]!==_0x6984('0x39')){var _0x4e573c={};_0x4e573c[_0x371c83[_0x6984('0x21')]]={'$like':'%'+_0x2d4a8d[_0x6984('0x29')][_0x6984('0x3a')]+'%'};return _0x4e573c;}})});}_0x33a6ad=_['merge']({},_0x33a6ad,_0x2d4a8d[_0x6984('0x3b')]);var _0x3bb932={'where':_0x33a6ad[_0x6984('0x36')]};return db[_0x6984('0x24')][_0x6984('0x16')](_0x3bb932)[_0x6984('0x1d')](function(_0x3b20c8){_0x40f523['count']=_0x3b20c8;if(_0x2d4a8d['query']['includeAll']){_0x33a6ad[_0x6984('0x3c')]=[{'all':!![]}];}return db['Attachment'][_0x6984('0x3d')](_0x33a6ad);})[_0x6984('0x1d')](function(_0x3f162c){_0x40f523[_0x6984('0x3e')]=_0x3f162c;return _0x40f523;})[_0x6984('0x1d')](respondWithFilteredResult(_0x42e9a0,_0x33a6ad))[_0x6984('0x3f')](handleError(_0x42e9a0,null));};exports[_0x6984('0x40')]=function(_0x3fdf66,_0x479bdd){var _0x3e96cb={'raw':!![],'where':{'id':_0x3fdf66['params']['id']}},_0x4854de={};_0x4854de[_0x6984('0x2c')]=_[_0x6984('0x2a')](db[_0x6984('0x24')][_0x6984('0x25')]);_0x4854de['query']=_['keys'](_0x3fdf66[_0x6984('0x29')]);_0x4854de['filters']=_[_0x6984('0x2e')](_0x4854de[_0x6984('0x2c')],_0x4854de[_0x6984('0x29')]);_0x3e96cb[_0x6984('0x2d')]=_['intersection'](_0x4854de['model'],qs['fields'](_0x3fdf66['query'][_0x6984('0x2f')]));_0x3e96cb[_0x6984('0x2d')]=_0x3e96cb['attributes'][_0x6984('0x30')]?_0x3e96cb['attributes']:_0x4854de[_0x6984('0x2c')];if(_0x3fdf66[_0x6984('0x29')]['includeAll']){_0x3e96cb['include']=[{'all':!![]}];}_0x3e96cb=_[_0x6984('0x38')]({},_0x3e96cb,_0x3fdf66['options']);return db['Attachment']['find'](_0x3e96cb)['then'](handleEntityNotFound(_0x479bdd,null))['then'](respondWithResult(_0x479bdd,null))[_0x6984('0x3f')](handleError(_0x479bdd,null));};exports[_0x6984('0x41')]=function(_0x13b330,_0x197971){var _0x55e5f5={'where':{'id':_0x13b330['params']['id']}},_0x1f72d4={};_0x1f72d4[_0x6984('0x2c')]=_[_0x6984('0x2a')](db[_0x6984('0x24')][_0x6984('0x25')]);_0x55e5f5[_0x6984('0x2d')]=_[_0x6984('0x2e')](_0x1f72d4[_0x6984('0x2c')],qs[_0x6984('0x2f')](_0x13b330[_0x6984('0x29')][_0x6984('0x2f')]));_0x55e5f5['attributes']=_0x55e5f5[_0x6984('0x2d')][_0x6984('0x30')]?_0x55e5f5[_0x6984('0x2d')]:_0x1f72d4[_0x6984('0x2c')];if(_0x13b330[_0x6984('0x29')]['includeAll']){_0x55e5f5['include']=[{'all':!![]}];}_0x55e5f5=_[_0x6984('0x38')]({},_0x55e5f5,_0x13b330['options']);return db[_0x6984('0x24')][_0x6984('0x42')](_0x55e5f5)[_0x6984('0x1d')](handleEntityNotFound(_0x197971,null))[_0x6984('0x1d')](function(_0x3d6336){if(_0x3d6336){var _0x238a53=_0x3d6336[_0x6984('0x43')]({'plain':!![]});_0x238a53=qs[_0x6984('0x44')](_0x238a53,['id',_0x6984('0x45'),_0x6984('0x46')]);_0x13b330[_0x6984('0x47')]=_[_0x6984('0x44')](_0x13b330[_0x6984('0x47')],['id',_0x6984('0x45'),'updatedAt']);return db[_0x6984('0x24')]['create'](_[_0x6984('0x38')](_0x238a53,_0x13b330[_0x6984('0x47')]),{'include':_0x13b330['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x6984('0x1d')](respondWithResult(_0x197971,0xc9))[_0x6984('0x3f')](handleError(_0x197971,null));};exports[_0x6984('0x1c')]=function(_0x2561b6,_0xded92b){if(_0x2561b6[_0x6984('0x47')]['id']){delete _0x2561b6['body']['id'];}return db[_0x6984('0x24')][_0x6984('0x42')]({'where':{'id':_0x2561b6['params']['id']}})['then'](handleEntityNotFound(_0xded92b,null))[_0x6984('0x1d')](saveUpdates(_0x2561b6[_0x6984('0x47')],null))[_0x6984('0x1d')](respondWithResult(_0xded92b,null))[_0x6984('0x3f')](handleError(_0xded92b,null));};exports[_0x6984('0x1e')]=function(_0xaa17d3,_0x6b5e98){return db[_0x6984('0x24')][_0x6984('0x42')]({'where':{'id':_0xaa17d3[_0x6984('0x48')]['id']}})['then'](handleEntityNotFound(_0x6b5e98,null))[_0x6984('0x1d')](removeEntity(_0x6b5e98,null))[_0x6984('0x3f')](handleError(_0x6b5e98,null));};exports[_0x6984('0x49')]=function(_0xcd1bd3,_0x2cece0,_0x148f2e){_0xcd1bd3['body'][_0x6984('0x21')]=_0xcd1bd3[_0x6984('0x4a')][_0x6984('0x4b')];_0xcd1bd3[_0x6984('0x47')][_0x6984('0x4c')]=_0xcd1bd3[_0x6984('0x4a')][_0x6984('0x4d')];_0xcd1bd3[_0x6984('0x47')][_0x6984('0x27')]=_0xcd1bd3[_0x6984('0x4a')][_0x6984('0x4e')];return db[_0x6984('0x24')][_0x6984('0x49')](_0xcd1bd3['body'])['then'](respondWithResult(_0x2cece0,0xc9))[_0x6984('0x3f')](handleError(_0x2cece0,null));};exports['download']=function(_0x25d3d0,_0x40b25d,_0x447bfa){return db['Attachment']['findOne']({'where':{'id':_0x25d3d0[_0x6984('0x48')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x40b25d,null))['then'](function(_0x3062a3){if(_0x3062a3){return _0x40b25d['download'](path[_0x6984('0x4f')](config[_0x6984('0x50')],_0x6984('0x51'),_0x3062a3['basename']));}})['catch'](handleError(_0x40b25d,null));}; \ No newline at end of file +var _0x2ff0=['mimetype','download','findOne','root','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','sendStatus','name','index','map','Attachment','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','then','include','findAll','params','keys','includeAll','find','clone','get','omit','createdAt','updatedAt','body','create','catch','update','file','originalname','basename'];(function(_0x411a28,_0x54c52e){var _0x4e41ce=function(_0x42d976){while(--_0x42d976){_0x411a28['push'](_0x411a28['shift']());}};_0x4e41ce(++_0x54c52e);}(_0x2ff0,0xa6));var _0x02ff=function(_0x28d7b1,_0x2ce1f5){_0x28d7b1=_0x28d7b1-0x0;var _0x374033=_0x2ff0[_0x28d7b1];return _0x374033;};'use strict';var pdf=require(_0x02ff('0x0'));var emlformat=require(_0x02ff('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x02ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x02ff('0x3'));var moment=require(_0x02ff('0x4'));var BPromise=require(_0x02ff('0x5'));var Mustache=require(_0x02ff('0x6'));var util=require('util');var path=require(_0x02ff('0x7'));var sox=require(_0x02ff('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x02ff('0x9'));var crypto=require(_0x02ff('0xa'));var jsforce=require(_0x02ff('0xb'));var deskjs=require(_0x02ff('0xc'));var toCsv=require(_0x02ff('0xd'));var querystring=require('querystring');var Papa=require(_0x02ff('0xe'));var Redis=require(_0x02ff('0xf'));var authService=require(_0x02ff('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02ff('0x11'));var logger=require(_0x02ff('0x12'))(_0x02ff('0x13'));var utils=require(_0x02ff('0x14'));var config=require(_0x02ff('0x15'));var db=require(_0x02ff('0x16'))['db'];function respondWithStatusCode(_0x29228e,_0x5dd9ad){_0x5dd9ad=_0x5dd9ad||0xcc;return function(_0x11018b){if(_0x11018b){return _0x29228e['sendStatus'](_0x5dd9ad);}return _0x29228e[_0x02ff('0x17')](_0x5dd9ad)[_0x02ff('0x18')]();};}function respondWithResult(_0x4de460,_0x4e1d44){_0x4e1d44=_0x4e1d44||0xc8;return function(_0x43508c){if(_0x43508c){return _0x4de460[_0x02ff('0x17')](_0x4e1d44)[_0x02ff('0x19')](_0x43508c);}};}function respondWithFilteredResult(_0x260745,_0x3875c7){return function(_0x179ebe){if(_0x179ebe){var _0x49c098=_0x179ebe[_0x02ff('0x1a')],_0x298406=_0x3875c7[_0x02ff('0x1b')],_0x5205e5=_0x3875c7[_0x02ff('0x1b')]+_0x3875c7[_0x02ff('0x1c')],_0x27e900;if(_0x5205e5>=_0x49c098){_0x5205e5=_0x49c098;_0x27e900=0xc8;}else{_0x27e900=0xce;}_0x260745[_0x02ff('0x17')](_0x27e900);return _0x260745[_0x02ff('0x1d')](_0x02ff('0x1e'),_0x298406+'-'+_0x5205e5+'/'+_0x49c098)['json'](_0x179ebe);}return null;};}function patchUpdates(_0x5d5ffc){return function(_0x2ad5a5){try{jsonpatch[_0x02ff('0x1f')](_0x2ad5a5,_0x5d5ffc,!![]);}catch(_0x5c4ef7){return BPromise[_0x02ff('0x20')](_0x5c4ef7);}return _0x2ad5a5[_0x02ff('0x21')]();};}function saveUpdates(_0x4514b3,_0x5e76a4){return function(_0x1d658a){if(_0x1d658a){return _0x1d658a['update'](_0x4514b3)['then'](function(_0xfa3f38){return _0xfa3f38;});}return null;};}function removeEntity(_0xd95b51,_0x28a79c){return function(_0x1de896){if(_0x1de896){return _0x1de896[_0x02ff('0x22')]()['then'](function(){_0xd95b51[_0x02ff('0x17')](0xcc)[_0x02ff('0x18')]();});}};}function handleEntityNotFound(_0x40083b,_0x14a007){return function(_0x42c19b){if(!_0x42c19b){_0x40083b[_0x02ff('0x23')](0x194);}return _0x42c19b;};}function handleError(_0x3b745f,_0x387610){_0x387610=_0x387610||0x1f4;return function(_0x4a66b0){logger['error'](_0x4a66b0['stack']);if(_0x4a66b0[_0x02ff('0x24')]){delete _0x4a66b0[_0x02ff('0x24')];}_0x3b745f[_0x02ff('0x17')](_0x387610)['send'](_0x4a66b0);};}exports[_0x02ff('0x25')]=function(_0x5af487,_0x45e3b6){var _0x4d31c1={},_0x588069={},_0x1ed32c={'count':0x0,'rows':[]};var _0x538887=_[_0x02ff('0x26')](db[_0x02ff('0x27')][_0x02ff('0x28')],function(_0x5240c3){return{'name':_0x5240c3['fieldName'],'type':_0x5240c3[_0x02ff('0x29')][_0x02ff('0x2a')]};});_0x588069[_0x02ff('0x2b')]=_[_0x02ff('0x26')](_0x538887,_0x02ff('0x24'));_0x588069['query']=_['keys'](_0x5af487[_0x02ff('0x2c')]);_0x588069[_0x02ff('0x2d')]=_[_0x02ff('0x2e')](_0x588069[_0x02ff('0x2b')],_0x588069[_0x02ff('0x2c')]);_0x4d31c1[_0x02ff('0x2f')]=_['intersection'](_0x588069[_0x02ff('0x2b')],qs['fields'](_0x5af487[_0x02ff('0x2c')][_0x02ff('0x30')]));_0x4d31c1[_0x02ff('0x2f')]=_0x4d31c1[_0x02ff('0x2f')][_0x02ff('0x31')]?_0x4d31c1[_0x02ff('0x2f')]:_0x588069[_0x02ff('0x2b')];if(!_0x5af487[_0x02ff('0x2c')][_0x02ff('0x32')](_0x02ff('0x33'))){_0x4d31c1[_0x02ff('0x1c')]=qs[_0x02ff('0x1c')](_0x5af487['query'][_0x02ff('0x1c')]);_0x4d31c1['offset']=qs['offset'](_0x5af487[_0x02ff('0x2c')]['offset']);}_0x4d31c1['order']=qs[_0x02ff('0x34')](_0x5af487[_0x02ff('0x2c')][_0x02ff('0x34')]);_0x4d31c1['where']=qs[_0x02ff('0x2d')](_[_0x02ff('0x35')](_0x5af487[_0x02ff('0x2c')],_0x588069[_0x02ff('0x2d')]));if(_0x5af487[_0x02ff('0x2c')][_0x02ff('0x36')]){_0x4d31c1[_0x02ff('0x37')]=_[_0x02ff('0x38')](_0x4d31c1['where'],{'$or':_[_0x02ff('0x26')](_0x538887,function(_0x22adf1){if(_0x22adf1[_0x02ff('0x29')]!=='VIRTUAL'){var _0x11bc6f={};_0x11bc6f[_0x22adf1['name']]={'$like':'%'+_0x5af487[_0x02ff('0x2c')][_0x02ff('0x36')]+'%'};return _0x11bc6f;}})});}_0x4d31c1=_['merge']({},_0x4d31c1,_0x5af487[_0x02ff('0x39')]);var _0x4c28f1={'where':_0x4d31c1['where']};return db[_0x02ff('0x27')][_0x02ff('0x1a')](_0x4c28f1)[_0x02ff('0x3a')](function(_0x311300){_0x1ed32c[_0x02ff('0x1a')]=_0x311300;if(_0x5af487[_0x02ff('0x2c')]['includeAll']){_0x4d31c1[_0x02ff('0x3b')]=[{'all':!![]}];}return db[_0x02ff('0x27')][_0x02ff('0x3c')](_0x4d31c1);})[_0x02ff('0x3a')](function(_0x572a62){_0x1ed32c['rows']=_0x572a62;return _0x1ed32c;})[_0x02ff('0x3a')](respondWithFilteredResult(_0x45e3b6,_0x4d31c1))['catch'](handleError(_0x45e3b6,null));};exports['show']=function(_0x3234cb,_0x46cc37){var _0x344d6e={'raw':!![],'where':{'id':_0x3234cb[_0x02ff('0x3d')]['id']}},_0x3c774b={};_0x3c774b[_0x02ff('0x2b')]=_[_0x02ff('0x3e')](db[_0x02ff('0x27')][_0x02ff('0x28')]);_0x3c774b[_0x02ff('0x2c')]=_[_0x02ff('0x3e')](_0x3234cb[_0x02ff('0x2c')]);_0x3c774b[_0x02ff('0x2d')]=_['intersection'](_0x3c774b['model'],_0x3c774b[_0x02ff('0x2c')]);_0x344d6e['attributes']=_['intersection'](_0x3c774b[_0x02ff('0x2b')],qs[_0x02ff('0x30')](_0x3234cb[_0x02ff('0x2c')][_0x02ff('0x30')]));_0x344d6e[_0x02ff('0x2f')]=_0x344d6e[_0x02ff('0x2f')][_0x02ff('0x31')]?_0x344d6e[_0x02ff('0x2f')]:_0x3c774b[_0x02ff('0x2b')];if(_0x3234cb[_0x02ff('0x2c')][_0x02ff('0x3f')]){_0x344d6e[_0x02ff('0x3b')]=[{'all':!![]}];}_0x344d6e=_[_0x02ff('0x38')]({},_0x344d6e,_0x3234cb[_0x02ff('0x39')]);return db[_0x02ff('0x27')][_0x02ff('0x40')](_0x344d6e)['then'](handleEntityNotFound(_0x46cc37,null))[_0x02ff('0x3a')](respondWithResult(_0x46cc37,null))['catch'](handleError(_0x46cc37,null));};exports[_0x02ff('0x41')]=function(_0x39e46e,_0x238cb0){var _0x5e26df={'where':{'id':_0x39e46e[_0x02ff('0x3d')]['id']}},_0x242305={};_0x242305[_0x02ff('0x2b')]=_[_0x02ff('0x3e')](db[_0x02ff('0x27')]['rawAttributes']);_0x5e26df['attributes']=_['intersection'](_0x242305['model'],qs[_0x02ff('0x30')](_0x39e46e['query'][_0x02ff('0x30')]));_0x5e26df[_0x02ff('0x2f')]=_0x5e26df[_0x02ff('0x2f')][_0x02ff('0x31')]?_0x5e26df[_0x02ff('0x2f')]:_0x242305['model'];if(_0x39e46e['query'][_0x02ff('0x3f')]){_0x5e26df[_0x02ff('0x3b')]=[{'all':!![]}];}_0x5e26df=_[_0x02ff('0x38')]({},_0x5e26df,_0x39e46e[_0x02ff('0x39')]);return db[_0x02ff('0x27')][_0x02ff('0x40')](_0x5e26df)[_0x02ff('0x3a')](handleEntityNotFound(_0x238cb0,null))[_0x02ff('0x3a')](function(_0x40c56f){if(_0x40c56f){var _0x5daea9=_0x40c56f[_0x02ff('0x42')]({'plain':!![]});_0x5daea9=qs[_0x02ff('0x43')](_0x5daea9,['id',_0x02ff('0x44'),_0x02ff('0x45')]);_0x39e46e[_0x02ff('0x46')]=_[_0x02ff('0x43')](_0x39e46e[_0x02ff('0x46')],['id','createdAt',_0x02ff('0x45')]);return db[_0x02ff('0x27')][_0x02ff('0x47')](_[_0x02ff('0x38')](_0x5daea9,_0x39e46e[_0x02ff('0x46')]),{'include':_0x39e46e[_0x02ff('0x2c')][_0x02ff('0x3f')]?[{'all':!![]}]:undefined});}})[_0x02ff('0x3a')](respondWithResult(_0x238cb0,0xc9))[_0x02ff('0x48')](handleError(_0x238cb0,null));};exports[_0x02ff('0x49')]=function(_0xac109e,_0x1be03a){if(_0xac109e[_0x02ff('0x46')]['id']){delete _0xac109e[_0x02ff('0x46')]['id'];}return db['Attachment']['find']({'where':{'id':_0xac109e[_0x02ff('0x3d')]['id']}})[_0x02ff('0x3a')](handleEntityNotFound(_0x1be03a,null))[_0x02ff('0x3a')](saveUpdates(_0xac109e[_0x02ff('0x46')],null))[_0x02ff('0x3a')](respondWithResult(_0x1be03a,null))['catch'](handleError(_0x1be03a,null));};exports[_0x02ff('0x22')]=function(_0x5d5d46,_0x1a65cc){return db[_0x02ff('0x27')][_0x02ff('0x40')]({'where':{'id':_0x5d5d46[_0x02ff('0x3d')]['id']}})[_0x02ff('0x3a')](handleEntityNotFound(_0x1a65cc,null))[_0x02ff('0x3a')](removeEntity(_0x1a65cc,null))[_0x02ff('0x48')](handleError(_0x1a65cc,null));};exports[_0x02ff('0x47')]=function(_0x2696a7,_0x3507c5,_0x23d3f3){_0x2696a7['body'][_0x02ff('0x24')]=_0x2696a7[_0x02ff('0x4a')][_0x02ff('0x4b')];_0x2696a7['body'][_0x02ff('0x4c')]=_0x2696a7[_0x02ff('0x4a')]['filename'];_0x2696a7[_0x02ff('0x46')]['type']=_0x2696a7[_0x02ff('0x4a')][_0x02ff('0x4d')];return db[_0x02ff('0x27')][_0x02ff('0x47')](_0x2696a7[_0x02ff('0x46')])['then'](respondWithResult(_0x3507c5,0xc9))[_0x02ff('0x48')](handleError(_0x3507c5,null));};exports[_0x02ff('0x4e')]=function(_0x32a3ee,_0x5395e2,_0x4f58ad){return db['Attachment'][_0x02ff('0x4f')]({'where':{'id':_0x32a3ee[_0x02ff('0x3d')]['id']},'raw':!![]})[_0x02ff('0x3a')](handleEntityNotFound(_0x5395e2,null))['then'](function(_0x5cfbca){if(_0x5cfbca){return _0x5395e2['download'](path['join'](config[_0x02ff('0x50')],'server/files/attachments/',_0x5cfbca[_0x02ff('0x4c')]));}})[_0x02ff('0x48')](handleError(_0x5395e2,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 96a213c..a0acd62 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 _0xeb74=['rimraf','../../config/environment','./attachment.attributes','exports','define','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x535836,_0x51e533){var _0x4d0ca0=function(_0x52f713){while(--_0x52f713){_0x535836['push'](_0x535836['shift']());}};_0x4d0ca0(++_0x51e533);}(_0xeb74,0xe3));var _0x4eb7=function(_0x3787ee,_0xc1d93){_0x3787ee=_0x3787ee-0x0;var _0x2e4c34=_0xeb74[_0x3787ee];return _0x2e4c34;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var logger=require(_0x4eb7('0x2'))(_0x4eb7('0x3'));var moment=require(_0x4eb7('0x4'));var BPromise=require(_0x4eb7('0x5'));var rp=require(_0x4eb7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4eb7('0x7'));var config=require(_0x4eb7('0x8'));var attributes=require(_0x4eb7('0x9'));module[_0x4eb7('0xa')]=function(_0xa6e086,_0x563d6e){return _0xa6e086[_0x4eb7('0xb')]('Attachment',attributes,{'tableName':_0x4eb7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4849=['path','rimraf','../../config/environment','./attachment.attributes','exports','attachments','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x4849,0xf8));var _0x9484=function(_0x4eb7cb,_0x2f7a48){_0x4eb7cb=_0x4eb7cb-0x0;var _0xed8f85=_0x4849[_0x4eb7cb];return _0xed8f85;};'use strict';var _=require(_0x9484('0x0'));var util=require(_0x9484('0x1'));var logger=require(_0x9484('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9484('0x3'));var rp=require(_0x9484('0x4'));var fs=require('fs');var path=require(_0x9484('0x5'));var rimraf=require(_0x9484('0x6'));var config=require(_0x9484('0x7'));var attributes=require(_0x9484('0x8'));module[_0x9484('0x9')]=function(_0x94e9bd,_0xc4337e){return _0x94e9bd['define']('Attachment',attributes,{'tableName':_0x9484('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 55f9f2f..b0d246d 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 _0x56ad=['stringify','error','message','result','CreateAttachment','Attachment','create','body','options','info','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xace953,_0x338468){var _0x5b5c4b=function(_0x2bebce){while(--_0x2bebce){_0xace953['push'](_0xace953['shift']());}};_0x5b5c4b(++_0x338468);}(_0x56ad,0x82));var _0xd56a=function(_0x245150,_0x34f6da){_0x245150=_0x245150-0x0;var _0x592d5d=_0x56ad[_0x245150];return _0x592d5d;};'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(_0xd56a('0x0'));var db=require(_0xd56a('0x1'))['db'];var utils=require(_0xd56a('0x2'));var logger=require(_0xd56a('0x3'))(_0xd56a('0x4'));var config=require(_0xd56a('0x5'));var jayson=require(_0xd56a('0x6'));var client=jayson[_0xd56a('0x7')][_0xd56a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x213103,_0x5ac7e9,_0x97b067){return new BPromise(function(_0x61a210,_0xf64f1c){return client[_0xd56a('0x9')](_0x213103,_0x97b067)[_0xd56a('0xa')](function(_0x31cb1e){logger['info'](_0xd56a('0xb'),_0x5ac7e9,_0xd56a('0xc'));logger[_0xd56a('0xd')]('Attachment,\x20%s,\x20%s,\x20%s',_0x5ac7e9,_0xd56a('0xc'),JSON[_0xd56a('0xe')](_0x31cb1e));if(_0x31cb1e[_0xd56a('0xf')]){if(_0x31cb1e[_0xd56a('0xf')]['code']===0x1f4){logger[_0xd56a('0xf')](_0xd56a('0xb'),_0x5ac7e9,_0x31cb1e[_0xd56a('0xf')][_0xd56a('0x10')]);return _0xf64f1c(_0x31cb1e[_0xd56a('0xf')]['message']);}logger['error'](_0xd56a('0xb'),_0x5ac7e9,_0x31cb1e[_0xd56a('0xf')][_0xd56a('0x10')]);return _0x61a210(_0x31cb1e[_0xd56a('0xf')][_0xd56a('0x10')]);}else{logger['info'](_0xd56a('0xb'),_0x5ac7e9,'request\x20sent');_0x61a210(_0x31cb1e[_0xd56a('0x11')]['message']);}})['catch'](function(_0x5b04d1){logger[_0xd56a('0xf')](_0xd56a('0xb'),_0x5ac7e9,_0x5b04d1);_0xf64f1c(_0x5b04d1);});});}exports[_0xd56a('0x12')]=function(_0x4311ce){var _0x5cac3d=this;return new Promise(function(_0x32c90d,_0x190447){return db[_0xd56a('0x13')][_0xd56a('0x14')](_0x4311ce[_0xd56a('0x15')],{'raw':_0x4311ce[_0xd56a('0x16')]?_0x4311ce[_0xd56a('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xd56a('0xa')](function(_0x425f4e){logger[_0xd56a('0x17')](_0xd56a('0x12'),_0x4311ce);logger[_0xd56a('0xd')](_0xd56a('0x12'),_0x4311ce,JSON[_0xd56a('0xe')](_0x425f4e));_0x32c90d(_0x425f4e);})['catch'](function(_0x23707){logger[_0xd56a('0xf')](_0xd56a('0x12'),_0x23707['message'],_0x4311ce);_0x190447(_0x5cac3d[_0xd56a('0xf')](0x1f4,_0x23707['message']));});});}; \ No newline at end of file +var _0x0b25=['request','then','Attachment,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','CreateAttachment','body','options','debug','util','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b25,0x19c));var _0x50b2=function(_0x55cc58,_0x5ce0af){_0x55cc58=_0x55cc58-0x0;var _0x26062e=_0x0b25[_0x55cc58];return _0x26062e;};'use strict';var _=require('lodash');var util=require(_0x50b2('0x0'));var moment=require('moment');var BPromise=require(_0x50b2('0x1'));var rs=require(_0x50b2('0x2'));var fs=require('fs');var Redis=require(_0x50b2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x50b2('0x4'));var logger=require('../../config/logger')(_0x50b2('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x50b2('0x6')][_0x50b2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x267720,_0xf6fab0,_0x2d5a99){return new BPromise(function(_0xcc47d2,_0x17db34){return client[_0x50b2('0x8')](_0x267720,_0x2d5a99)[_0x50b2('0x9')](function(_0x18295a){logger['info'](_0x50b2('0xa'),_0xf6fab0,_0x50b2('0xb'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0xf6fab0,_0x50b2('0xb'),JSON['stringify'](_0x18295a));if(_0x18295a[_0x50b2('0xc')]){if(_0x18295a['error']['code']===0x1f4){logger[_0x50b2('0xc')](_0x50b2('0xa'),_0xf6fab0,_0x18295a[_0x50b2('0xc')][_0x50b2('0xd')]);return _0x17db34(_0x18295a[_0x50b2('0xc')][_0x50b2('0xd')]);}logger[_0x50b2('0xc')](_0x50b2('0xa'),_0xf6fab0,_0x18295a[_0x50b2('0xc')][_0x50b2('0xd')]);return _0xcc47d2(_0x18295a[_0x50b2('0xc')][_0x50b2('0xd')]);}else{logger[_0x50b2('0xe')](_0x50b2('0xa'),_0xf6fab0,_0x50b2('0xb'));_0xcc47d2(_0x18295a[_0x50b2('0xf')]['message']);}})[_0x50b2('0x10')](function(_0x4aa3b9){logger['error'](_0x50b2('0xa'),_0xf6fab0,_0x4aa3b9);_0x17db34(_0x4aa3b9);});});}exports[_0x50b2('0x11')]=function(_0x4b3364){var _0x29511f=this;return new Promise(function(_0x2dedc5,_0x3d7ed5){return db['Attachment']['create'](_0x4b3364[_0x50b2('0x12')],{'raw':_0x4b3364[_0x50b2('0x13')]?_0x4b3364[_0x50b2('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x50b2('0x9')](function(_0x2f4c8c){logger['info'](_0x50b2('0x11'),_0x4b3364);logger[_0x50b2('0x14')]('CreateAttachment',_0x4b3364,JSON['stringify'](_0x2f4c8c));_0x2dedc5(_0x2f4c8c);})[_0x50b2('0x10')](function(_0x1c14c3){logger[_0x50b2('0xc')](_0x50b2('0x11'),_0x1c14c3[_0x50b2('0xd')],_0x4b3364);_0x3d7ed5(_0x29511f[_0x50b2('0xc')](0x1f4,_0x1c14c3[_0x50b2('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 71e3c11..8e69564 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 _0xcd78=['delete','multer','util','connect-timeout','express','Router','../../components/auth/service','get','index','/:id','/:id/download','isAuthenticated','download','clone','diskStorage','root','server/files/attachments/','format','%s-%s','originalname','replace','single','create','put'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xcd78,0xa9));var _0x8cd7=function(_0xea1570,_0x2f7856){_0xea1570=_0xea1570-0x0;var _0x579e74=_0xcd78[_0xea1570];return _0x579e74;};'use strict';var multer=require(_0x8cd7('0x0'));var util=require(_0x8cd7('0x1'));var path=require('path');var timeout=require(_0x8cd7('0x2'));var express=require(_0x8cd7('0x3'));var router=express[_0x8cd7('0x4')]();var auth=require(_0x8cd7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./attachment.controller');router[_0x8cd7('0x6')]('/',auth['isAuthenticated'](),controller[_0x8cd7('0x7')]);router[_0x8cd7('0x6')](_0x8cd7('0x8'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8cd7('0x9'),auth[_0x8cd7('0xa')](),controller[_0x8cd7('0xb')]);router['post']('/:id/clone',auth[_0x8cd7('0xa')](),controller[_0x8cd7('0xc')]);var upload=multer({'storage':multer[_0x8cd7('0xd')]({'destination':function(_0x49caa3,_0x4d4bde,_0x49ac1f){_0x49ac1f(null,path['join'](config[_0x8cd7('0xe')],_0x8cd7('0xf')));},'filename':function(_0x31d3c8,_0x1e1816,_0x2d6488){_0x2d6488(null,util[_0x8cd7('0x10')](_0x8cd7('0x11'),Date['now'](),_0x1e1816[_0x8cd7('0x12')][_0x8cd7('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload[_0x8cd7('0x14')]('file'),controller[_0x8cd7('0x15')]);router[_0x8cd7('0x16')](_0x8cd7('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x8cd7('0x17')](_0x8cd7('0x8'),auth[_0x8cd7('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0e21=['/:id/download','download','clone','diskStorage','join','root','server/files/attachments/','format','post','single','file','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x55af0f,_0x1bba80){var _0x1ff172=function(_0x3d150e){while(--_0x3d150e){_0x55af0f['push'](_0x55af0f['shift']());}};_0x1ff172(++_0x1bba80);}(_0x0e21,0xe8));var _0x10e2=function(_0x3418fb,_0x3ba0ae){_0x3418fb=_0x3418fb-0x0;var _0xbea12e=_0x0e21[_0x3418fb];return _0xbea12e;};'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 auth=require(_0x10e2('0x4'));var interaction=require(_0x10e2('0x5'));var config=require('../../config/environment');var controller=require('./attachment.controller');router[_0x10e2('0x6')]('/',auth[_0x10e2('0x7')](),controller[_0x10e2('0x8')]);router[_0x10e2('0x6')](_0x10e2('0x9'),auth[_0x10e2('0x7')](),controller[_0x10e2('0xa')]);router[_0x10e2('0x6')](_0x10e2('0xb'),auth['isAuthenticated'](),controller[_0x10e2('0xc')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x10e2('0xd')]);var upload=multer({'storage':multer[_0x10e2('0xe')]({'destination':function(_0x5c6925,_0x2f7131,_0x530522){_0x530522(null,path[_0x10e2('0xf')](config[_0x10e2('0x10')],_0x10e2('0x11')));},'filename':function(_0x56db90,_0x37dafd,_0x4072f4){_0x4072f4(null,util[_0x10e2('0x12')]('%s-%s',Date['now'](),_0x37dafd['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x10e2('0x13')]('/',upload[_0x10e2('0x14')](_0x10e2('0x15')),controller['create']);router[_0x10e2('0x16')](_0x10e2('0x9'),auth[_0x10e2('0x7')](),controller[_0x10e2('0x17')]);router[_0x10e2('0x18')](_0x10e2('0x9'),auth['isAuthenticated'](),controller[_0x10e2('0x19')]);module[_0x10e2('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 7dcbe61..1aa9e81 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 _0x2f0a=['agent','disabled','blockDuration','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../config/environment','../../components/auth/service','signToken','authenticate','/login','email','google','clientID','clientSecret','secret','callbackURL','findOne','allowedLoginAttempts','then','find','map','emails','admin'];(function(_0x16066e,_0x31e151){var _0x52a12e=function(_0x3e6bed){while(--_0x3e6bed){_0x16066e['push'](_0x16066e['shift']());}};_0x52a12e(++_0x31e151);}(_0x2f0a,0x6a));var _0xa2f0=function(_0x1f5ec4,_0x392888){_0x1f5ec4=_0x1f5ec4-0x0;var _0x4f7022=_0x2f0a[_0x1f5ec4];return _0x4f7022;};'use strict';var _=require(_0xa2f0('0x0'));var passport=require(_0xa2f0('0x1'));var GoogleStrategy=require(_0xa2f0('0x2'))['Strategy'];var moment=require(_0xa2f0('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0xa2f0('0x4'));var signToken=require(_0xa2f0('0x5'))[_0xa2f0('0x6')];var utils=require('../../config/utils');exports['login']=passport[_0xa2f0('0x7')]('google',{'failureRedirect':_0xa2f0('0x8'),'scope':['profile',_0xa2f0('0x9')],'session':![]});exports['callback']=passport[_0xa2f0('0x7')](_0xa2f0('0xa'),{'failureRedirect':'/login','session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xa2f0('0xa')]?config[_0xa2f0('0xa')][_0xa2f0('0xb')]:'id','clientSecret':config[_0xa2f0('0xa')]?config[_0xa2f0('0xa')][_0xa2f0('0xc')]:_0xa2f0('0xd'),'callbackURL':config['google']?config[_0xa2f0('0xa')][_0xa2f0('0xe')]:''},function(_0x34089c,_0x4eee68,_0x27ccd2,_0x3628bc){var _0x17c748,_0x3c5e35;return db['Setting'][_0xa2f0('0xf')]({'where':{'id':0x1},'attributes':[_0xa2f0('0x10'),'blockDuration'],'raw':!![]})[_0xa2f0('0x11')](function(_0x4bf239){_0x17c748=_0x4bf239;return db['User'][_0xa2f0('0x12')]({'where':{'email':_[_0xa2f0('0x13')](_0x27ccd2[_0xa2f0('0x14')],'value'),'role':{'$or':[_0xa2f0('0x15'),'user',_0xa2f0('0x16')]}}});})[_0xa2f0('0x11')](function(_0x5c7d2a){_0x3c5e35=_0x5c7d2a;if(_0x3c5e35){if(_0x3c5e35[_0xa2f0('0x17')]){return _0x3628bc('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x17c748[_0xa2f0('0x18')]>0x0){if(_0x3c5e35[_0xa2f0('0x19')]){if(moment(_0x3c5e35[_0xa2f0('0x1a')])[_0xa2f0('0x1b')](_0x17c748[_0xa2f0('0x18')],_0xa2f0('0x1c'))>moment()){return _0x3628bc('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0xa2f0('0x1d')](_0x3c5e35,0x0,![],null)[_0xa2f0('0x11')](function(){return utils[_0xa2f0('0x1e')](_0x3c5e35);})[_0xa2f0('0x11')](function(){return _0x3628bc(null,_0x3c5e35);});}}else{return utils['getLicense'](_0x3c5e35)[_0xa2f0('0x11')](function(){return _0x3628bc(null,_0x3c5e35);});}}else{return utils[_0xa2f0('0x1e')](_0x3c5e35)[_0xa2f0('0x11')](function(){return _0x3628bc(null,_0x3c5e35);});}}return _0x3628bc('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xa2f0('0x1f')](function(_0x2b4c1a){_0x3628bc(_0x2b4c1a);});})); \ No newline at end of file +var _0x0631=['signToken','../../config/utils','login','authenticate','google','email','callback','use','clientID','clientSecret','secret','Setting','findOne','allowedLoginAttempts','blockDuration','then','map','emails','value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','minutes','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service'];(function(_0x5b9a72,_0x239cb5){var _0x2e04ae=function(_0x2a2325){while(--_0x2a2325){_0x5b9a72['push'](_0x5b9a72['shift']());}};_0x2e04ae(++_0x239cb5);}(_0x0631,0x9e));var _0x1063=function(_0x33c637,_0x597c26){_0x33c637=_0x33c637-0x0;var _0x14aa20=_0x0631[_0x33c637];return _0x14aa20;};'use strict';var _=require(_0x1063('0x0'));var passport=require(_0x1063('0x1'));var GoogleStrategy=require(_0x1063('0x2'))[_0x1063('0x3')];var moment=require(_0x1063('0x4'));var db=require(_0x1063('0x5'))['db'];var config=require('../../config/environment');var signToken=require(_0x1063('0x6'))[_0x1063('0x7')];var utils=require(_0x1063('0x8'));exports[_0x1063('0x9')]=passport[_0x1063('0xa')](_0x1063('0xb'),{'failureRedirect':'/login','scope':['profile',_0x1063('0xc')],'session':![]});exports[_0x1063('0xd')]=passport[_0x1063('0xa')](_0x1063('0xb'),{'failureRedirect':'/login','session':![]});passport[_0x1063('0xe')](new GoogleStrategy({'clientID':config[_0x1063('0xb')]?config[_0x1063('0xb')][_0x1063('0xf')]:'id','clientSecret':config['google']?config[_0x1063('0xb')][_0x1063('0x10')]:_0x1063('0x11'),'callbackURL':config[_0x1063('0xb')]?config[_0x1063('0xb')]['callbackURL']:''},function(_0x40ac7f,_0x2b88a0,_0x55a379,_0x1e1d33){var _0x1d9c0e,_0x5c9bd4;return db[_0x1063('0x12')][_0x1063('0x13')]({'where':{'id':0x1},'attributes':[_0x1063('0x14'),_0x1063('0x15')],'raw':!![]})[_0x1063('0x16')](function(_0x283877){_0x1d9c0e=_0x283877;return db['User']['find']({'where':{'email':_[_0x1063('0x17')](_0x55a379[_0x1063('0x18')],_0x1063('0x19')),'role':{'$or':[_0x1063('0x1a'),'user',_0x1063('0x1b')]}}});})[_0x1063('0x16')](function(_0x15bca4){_0x5c9bd4=_0x15bca4;if(_0x5c9bd4){if(_0x5c9bd4[_0x1063('0x1c')]){return _0x1e1d33(_0x1063('0x1d'));}else if(_0x1d9c0e[_0x1063('0x15')]>0x0){if(_0x5c9bd4['blocked']){if(moment(_0x5c9bd4['blockedAt'])['add'](_0x1d9c0e['blockDuration'],_0x1063('0x1e'))>moment()){return _0x1e1d33(_0x1063('0x1d'));}else{return utils['clearBlockUser'](_0x5c9bd4,0x0,![],null)['then'](function(){return utils[_0x1063('0x1f')](_0x5c9bd4);})[_0x1063('0x16')](function(){return _0x1e1d33(null,_0x5c9bd4);});}}else{return utils[_0x1063('0x1f')](_0x5c9bd4)[_0x1063('0x16')](function(){return _0x1e1d33(null,_0x5c9bd4);});}}else{return utils[_0x1063('0x1f')](_0x5c9bd4)[_0x1063('0x16')](function(){return _0x1e1d33(null,_0x5c9bd4);});}}return _0x1e1d33(_0x1063('0x1d'));})[_0x1063('0x20')](function(_0x3eff61){_0x1e1d33(_0x3eff61);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 6d8aaff..bb4aeec 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 _0x8d53=['passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','setTokenCookie','exports','express'];(function(_0x8beec4,_0x33f4c7){var _0x376f14=function(_0x3c5d9b){while(--_0x3c5d9b){_0x8beec4['push'](_0x8beec4['shift']());}};_0x376f14(++_0x33f4c7);}(_0x8d53,0x1c2));var _0x38d5=function(_0x72e9dd,_0x34b28e){_0x72e9dd=_0x72e9dd-0x0;var _0x11e337=_0x8d53[_0x72e9dd];return _0x11e337;};'use strict';var express=require(_0x38d5('0x0'));var passport=require(_0x38d5('0x1'));var router=express['Router']();var controller=require(_0x38d5('0x2'));var userController=require(_0x38d5('0x3'));var authService=require(_0x38d5('0x4'));router[_0x38d5('0x5')]('/',controller[_0x38d5('0x6')]);router[_0x38d5('0x5')](_0x38d5('0x7'),controller[_0x38d5('0x8')],authService['isMiddleware'],userController[_0x38d5('0x6')],authService[_0x38d5('0x9')]);module[_0x38d5('0xa')]=router; \ No newline at end of file +var _0xc30d=['express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware','login','setTokenCookie','exports'];(function(_0x2b7bb6,_0x47f2a4){var _0x72f7de=function(_0x279b47){while(--_0x279b47){_0x2b7bb6['push'](_0x2b7bb6['shift']());}};_0x72f7de(++_0x47f2a4);}(_0xc30d,0x6e));var _0xdc30=function(_0x5f584a,_0x47f064){_0x5f584a=_0x5f584a-0x0;var _0x3788d9=_0xc30d[_0x5f584a];return _0x3788d9;};'use strict';var express=require(_0xdc30('0x0'));var passport=require('passport');var router=express[_0xdc30('0x1')]();var controller=require(_0xdc30('0x2'));var userController=require(_0xdc30('0x3'));var authService=require(_0xdc30('0x4'));router[_0xdc30('0x5')]('/',controller['login']);router[_0xdc30('0x5')]('/callback',controller[_0xdc30('0x6')],authService[_0xdc30('0x7')],userController[_0xdc30('0x8')],authService[_0xdc30('0x9')]);module[_0xdc30('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 3070607..61263f8 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 _0x51ca=['generate','toLowerCase','findOne','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','blocked','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','http://','headers','/reset/','Reset\x20Email\x20sent!','catch','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','password','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','then','name','salt','role','blockedAt','loginAttempts','admin','user','agent','authenticate','disabled','blockDuration','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','allowedLoginAttempts','getLicense','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing'];(function(_0x57f8eb,_0x484ee9){var _0xc72795=function(_0x17cb9d){while(--_0x17cb9d){_0x57f8eb['push'](_0x57f8eb['shift']());}};_0xc72795(++_0x484ee9);}(_0x51ca,0x1be));var _0xa51c=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x51ca[_0x29d94e];return _0x106237;};'use strict';var util=require(_0xa51c('0x0'));var passport=require(_0xa51c('0x1'));var LocalStrategy=require(_0xa51c('0x2'))[_0xa51c('0x3')];var jayson=require(_0xa51c('0x4'));var _=require('lodash');var rs=require(_0xa51c('0x5'));var moment=require('moment');var db=require(_0xa51c('0x6'))['db'];var authService=require(_0xa51c('0x7'));var utils=require(_0xa51c('0x8'));var client=jayson['client'][_0xa51c('0x9')]({'port':0x232b});function localAuthenticate(_0x30f123,_0x381618,_0x5e665b,_0x4b352a){var _0xd71704,_0x1783bd;return db[_0xa51c('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xa51c('0xb')](function(_0x3fc6f8){_0xd71704=_0x3fc6f8;return _0x30f123['findOne']({'attributes':['id',_0xa51c('0xc'),'password',_0xa51c('0xd'),_0xa51c('0xe'),'disabled','blocked',_0xa51c('0xf'),_0xa51c('0x10')],'where':{'name':_0x381618,'role':{'$or':[_0xa51c('0x11'),_0xa51c('0x12'),_0xa51c('0x13')]}}});})['then'](function(_0x5a58c4){if(!_0x5a58c4||_0x5a58c4&&_0x5a58c4['name']!==_0x381618){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1783bd=_0x5a58c4;return _0x1783bd;}})[_0xa51c('0xb')](function(){_0x1783bd[_0xa51c('0x14')](_0x5e665b,function(_0x18b582,_0xcb572){var _0x5adb6f=_0x1783bd[_0xa51c('0x10')]+0x1;if(_0x18b582){return _0x4b352a(_0x18b582);}else if(!_0xcb572){if(_0x1783bd[_0xa51c('0x15')]){return _0x4b352a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xd71704['allowedLoginAttempts']>0x0){if(_0x1783bd['blocked']){if(_0xd71704['blockDuration']>0x0){if(moment(_0x1783bd[_0xa51c('0xf')])['add'](_0xd71704[_0xa51c('0x16')],_0xa51c('0x17'))>moment()){return _0x4b352a(null,![],{'message':_0xa51c('0x18')});}else{return utils[_0xa51c('0x19')](_0x1783bd,_0x5adb6f,![],null)[_0xa51c('0xb')](function(){return _0x4b352a(null,![],{'message':_0xa51c('0x18')});});}}else{return _0x4b352a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5adb6f>=_0xd71704[_0xa51c('0x1a')]){return utils[_0xa51c('0x19')](_0x1783bd,0x0,!![],moment())['then'](function(){return _0x4b352a(null,![],{'message':_0xa51c('0x18')});});}else{return utils[_0xa51c('0x19')](_0x1783bd,_0x5adb6f,![],null)['then'](function(){return _0x4b352a(null,![],{'message':_0xa51c('0x18')});});}}}else{return _0x4b352a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1783bd[_0xa51c('0x15')]){return _0x4b352a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xd71704['allowedLoginAttempts']>0x0){if(_0x1783bd['blocked']){if(_0xd71704['blockDuration']>0x0){if(moment(_0x1783bd['blockedAt'])['add'](_0xd71704['blockDuration'],'minutes')>moment()){return _0x4b352a(null,![],{'message':_0xa51c('0x18')});}else{return utils['clearBlockUser'](_0x1783bd,0x0,![],null)[_0xa51c('0xb')](function(){return utils[_0xa51c('0x1b')](_0x1783bd);})['then'](function(){return _0x4b352a(null,_0x1783bd);});}}else{return _0x4b352a(null,![],{'message':_0xa51c('0x18')});}}else{return utils[_0xa51c('0x19')](_0x1783bd,0x0,![],null)[_0xa51c('0xb')](function(){return utils['getLicense'](_0x1783bd);})[_0xa51c('0xb')](function(){return _0x4b352a(null,_0x1783bd);})['catch'](function(_0x954ced){return _0x4b352a(null,![],_0x954ced);});}}else{if(_0x1783bd['blocked']){return _0x4b352a(null,![],{'message':_0xa51c('0x18')});}else{return utils[_0xa51c('0x1b')](_0x1783bd)[_0xa51c('0xb')](function(){return _0x4b352a(null,_0x1783bd);});}}}});})['catch'](function(_0x1d72ec){return _0x4b352a(null,![],_0x1d72ec);});}function sendServiceMail(_0x433e59){return db['MailAccount'][_0xa51c('0x1c')]({'where':{'service':!![]},'attributes':['id',_0xa51c('0xc'),_0xa51c('0x1d')],'include':[{'model':db['MailServerOut'],'as':_0xa51c('0x1e')}]})[_0xa51c('0xb')](function(_0x2396e0){if(!_0x2396e0){throw new Error(_0xa51c('0x1f'));}var _0x2f81bb={'tls':{'rejectUnauthorized':![]}};if(_0x2396e0['Smtp'][_0xa51c('0x20')]){_0x2f81bb['service']=_0x2396e0['Smtp'][_0xa51c('0x20')];}else{_0x2f81bb[_0xa51c('0x21')]=_0x2396e0['Smtp']['host'];_0x2f81bb[_0xa51c('0x22')]=_0x2396e0[_0xa51c('0x1e')][_0xa51c('0x22')];_0x2f81bb[_0xa51c('0x23')]=_0x2396e0[_0xa51c('0x1e')]['secure'];}if(_0x2396e0[_0xa51c('0x1e')][_0xa51c('0x24')]){_0x2f81bb[_0xa51c('0x25')]={'user':_0x2396e0[_0xa51c('0x1e')][_0xa51c('0x12')],'pass':_0x2396e0[_0xa51c('0x1e')][_0xa51c('0x26')]};}var _0x3eb925={'account':_0x2f81bb,'message':_[_0xa51c('0x27')]({'from':util[_0xa51c('0x28')](_0xa51c('0x29'),_0x2396e0[_0xa51c('0xc')],_0x2396e0[_0xa51c('0x1d')]||_0x2396e0[_0xa51c('0x1e')][_0xa51c('0x12')])},_0x433e59)};return client[_0xa51c('0x2a')]('SendMail',_0x3eb925);})[_0xa51c('0xb')](function(_0x439e85){if(_0x439e85[_0xa51c('0x2b')]){throw new Error(util[_0xa51c('0x28')](_0xa51c('0x2c'),_0x439e85[_0xa51c('0x2b')][_0xa51c('0x2d')]||JSON[_0xa51c('0x2e')](_0x439e85[_0xa51c('0x2b')])));}return!![];});}function handleError(_0x5eb4e7,_0x5089f8,_0x476de6){return _0x5eb4e7[_0xa51c('0x2f')](_0x5089f8||0x1f4)[_0xa51c('0x30')]({'message':_0x476de6?_0x476de6['message']||_0x476de6:''});}function checkPasswordPattern(_0x3fc9a7,_0x543247,_0xd9a525){if(_0xd9a525){var _0x4ea1bb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ea1bb['test'](_0x543247)){return _0x3fc9a7;}else{throw new Error(_0xa51c('0x31'));}}else{return _0x3fc9a7;}}exports[_0xa51c('0x32')]=function(_0x88bde0,_0x2ba87b,_0x894919){passport[_0xa51c('0x14')](_0xa51c('0x33'),function(_0x5a4d94,_0x4d0a47,_0x34c510){var _0xba8784=_0x5a4d94||_0x34c510;if(_0xba8784){return handleError(_0x2ba87b,0x191,_0xba8784);}if(!_0x4d0a47){return handleError(_0x2ba87b,0x194,{'message':_0xa51c('0x34')});}else{var _0x243335={'payload':{'id':_0x4d0a47['id'],'role':_0x4d0a47[_0xa51c('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0xa51c('0x35')](_0x243335)[_0xa51c('0xb')](function(_0x3a82fb){_0x2ba87b['json']({'id':_0x4d0a47['id'],'token':_0x3a82fb,'statusCall':'','isAlreadyLogged':_0x4d0a47[_0xa51c('0x36')]});});}})(_0x88bde0,_0x2ba87b,_0x894919);};exports[_0xa51c('0x37')]=function(_0x4ecd5f,_0x405eb1,_0x16e541){if(!_0x4ecd5f[_0xa51c('0x38')][_0xa51c('0x1d')]){return handleError(_0x405eb1,0x1f4,{'message':_0xa51c('0x39')});}var _0x3d0153=rs[_0xa51c('0x3a')]();_0x4ecd5f[_0xa51c('0x38')][_0xa51c('0x1d')]=_0x4ecd5f[_0xa51c('0x38')][_0xa51c('0x1d')]['trim']()[_0xa51c('0x3b')]();var _0x3bd79b;return db[_0xa51c('0xa')][_0xa51c('0x3c')]({'where':{'id':0x1},'attributes':[_0xa51c('0x1a'),_0xa51c('0x16')],'raw':!![]})[_0xa51c('0xb')](function(_0x60aa07){_0x3bd79b=_0x60aa07;return db[_0xa51c('0x3d')]['find']({'where':{'email':_0x4ecd5f['body']['email']}});})[_0xa51c('0xb')](function(_0x45caad){if(!_0x45caad){throw new Error(_0xa51c('0x3e'));}if(_0x45caad['disabled']){throw new Error(_0xa51c('0x3f'));}if(_0x45caad[_0xa51c('0x40')]){if(moment(_0x45caad[_0xa51c('0xf')])[_0xa51c('0x41')](_0x3bd79b['blockDuration'],'minutes')>moment()){throw new Error(_0xa51c('0x42'));}else{_0x45caad[_0xa51c('0x40')]=![];_0x45caad[_0xa51c('0xf')]=null;}}_0x45caad[_0xa51c('0x43')]=_0x3d0153;_0x45caad[_0xa51c('0x44')]=Date[_0xa51c('0x45')]()+0x36ee80;return _0x45caad[_0xa51c('0x46')]();})[_0xa51c('0xb')](function(){return sendServiceMail({'to':_0x4ecd5f['body']['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xa51c('0x47')+_0xa51c('0x48')+_0xa51c('0x49')+_0x4ecd5f[_0xa51c('0x4a')][_0xa51c('0x21')]+_0xa51c('0x4b')+_0x3d0153+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xa51c('0xb')](function(){_0x405eb1[_0xa51c('0x2f')](0xc8)[_0xa51c('0x30')]({'message':_0xa51c('0x4c')});})[_0xa51c('0x4d')](function(_0x16c7b6){return handleError(_0x405eb1,0x1f4,_0x16c7b6);});};exports['reset']=function(_0x5345db,_0x1d3dee,_0x4b34ee){var _0x3ae899;return db[_0xa51c('0x3d')]['find']({'where':{'resetPasswordToken':_0x5345db[_0xa51c('0x4e')]['token'],'resetPasswordExpires':{'$gt':Date[_0xa51c('0x45')]()}}})[_0xa51c('0xb')](function(_0x3a7ec9){_0x3ae899=_0x3a7ec9;if(!_0x3ae899){throw new Error(_0xa51c('0x4f'));}return db[_0xa51c('0xa')][_0xa51c('0x3c')]({'attributes':['id',_0xa51c('0x50')]});})[_0xa51c('0xb')](function(_0x2cdee9){return checkPasswordPattern(_0x2cdee9,_0x5345db[_0xa51c('0x38')][_0xa51c('0x51')],_0x2cdee9[_0xa51c('0x50')]);})[_0xa51c('0xb')](function(){_0x3ae899['password']=_0x5345db[_0xa51c('0x38')][_0xa51c('0x51')];_0x3ae899['resetPasswordToken']=null;_0x3ae899['resetPasswordExpires']=null;return _0x3ae899[_0xa51c('0x46')]();})[_0xa51c('0xb')](function(){_0x1d3dee[_0xa51c('0x2f')](0xc8)['send']({'message':_0xa51c('0x52')});})[_0xa51c('0x4d')](function(_0x17eea0){return handleError(_0x1d3dee,0x1f4,_0x17eea0);});};passport[_0xa51c('0x53')](new LocalStrategy({'usernameField':_0xa51c('0xc'),'passwordField':_0xa51c('0x51')},function(_0x1c403e,_0x4a0bf3,_0x1e8d7){return localAuthenticate(db[_0xa51c('0x3d')],_0x1c403e,_0x4a0bf3,_0x1e8d7);})); \ No newline at end of file +var _0x8cd9=['Strategy','lodash','moment','../../components/auth/service','../../config/utils','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','authentication','merge','format','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','stringify','status','send','message','test','login','local','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','email','trim','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','/reset/','Reset\x20Email\x20sent!','reset','User','params','token','securePassword','resetPasswordToken','Password\x20reset!','util','passport','passport-local'];(function(_0x575cb1,_0x2a2a34){var _0xe8038=function(_0x2cf27f){while(--_0x2cf27f){_0x575cb1['push'](_0x575cb1['shift']());}};_0xe8038(++_0x2a2a34);}(_0x8cd9,0xea));var _0x98cd=function(_0x3bc654,_0x4f9fb3){_0x3bc654=_0x3bc654-0x0;var _0x5e1fe4=_0x8cd9[_0x3bc654];return _0x5e1fe4;};'use strict';var util=require(_0x98cd('0x0'));var passport=require(_0x98cd('0x1'));var LocalStrategy=require(_0x98cd('0x2'))[_0x98cd('0x3')];var jayson=require('jayson/promise');var _=require(_0x98cd('0x4'));var rs=require('randomstring');var moment=require(_0x98cd('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x98cd('0x6'));var utils=require(_0x98cd('0x7'));var client=jayson['client'][_0x98cd('0x8')]({'port':0x232b});function localAuthenticate(_0x37e03f,_0x165110,_0x440565,_0x20dcba){var _0x1127be,_0x2e4748;return db['Setting'][_0x98cd('0x9')]({'where':{'id':0x1},'attributes':[_0x98cd('0xa'),_0x98cd('0xb')],'raw':!![]})[_0x98cd('0xc')](function(_0x4d768f){_0x1127be=_0x4d768f;return _0x37e03f['findOne']({'attributes':['id',_0x98cd('0xd'),_0x98cd('0xe'),_0x98cd('0xf'),_0x98cd('0x10'),_0x98cd('0x11'),_0x98cd('0x12'),_0x98cd('0x13'),'loginAttempts'],'where':{'name':_0x165110,'role':{'$or':['admin',_0x98cd('0x14'),_0x98cd('0x15')]}}});})[_0x98cd('0xc')](function(_0x28c2b9){if(!_0x28c2b9||_0x28c2b9&&_0x28c2b9['name']!==_0x165110){throw new Error(_0x98cd('0x16'));}else{_0x2e4748=_0x28c2b9;return _0x2e4748;}})[_0x98cd('0xc')](function(){_0x2e4748[_0x98cd('0x17')](_0x440565,function(_0x5a8483,_0x46d384){var _0x4be4f9=_0x2e4748[_0x98cd('0x18')]+0x1;if(_0x5a8483){return _0x20dcba(_0x5a8483);}else if(!_0x46d384){if(_0x2e4748[_0x98cd('0x11')]){return _0x20dcba(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1127be['allowedLoginAttempts']>0x0){if(_0x2e4748['blocked']){if(_0x1127be['blockDuration']>0x0){if(moment(_0x2e4748[_0x98cd('0x13')])[_0x98cd('0x19')](_0x1127be[_0x98cd('0xb')],_0x98cd('0x1a'))>moment()){return _0x20dcba(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x2e4748,_0x4be4f9,![],null)[_0x98cd('0xc')](function(){return _0x20dcba(null,![],{'message':_0x98cd('0x16')});});}}else{return _0x20dcba(null,![],{'message':_0x98cd('0x16')});}}else{if(_0x4be4f9>=_0x1127be['allowedLoginAttempts']){return utils[_0x98cd('0x1b')](_0x2e4748,0x0,!![],moment())[_0x98cd('0xc')](function(){return _0x20dcba(null,![],{'message':_0x98cd('0x16')});});}else{return utils[_0x98cd('0x1b')](_0x2e4748,_0x4be4f9,![],null)[_0x98cd('0xc')](function(){return _0x20dcba(null,![],{'message':_0x98cd('0x16')});});}}}else{return _0x20dcba(null,![],{'message':_0x98cd('0x16')});}}else{if(_0x2e4748[_0x98cd('0x11')]){return _0x20dcba(null,![],{'message':_0x98cd('0x16')});}else if(_0x1127be['allowedLoginAttempts']>0x0){if(_0x2e4748[_0x98cd('0x12')]){if(_0x1127be['blockDuration']>0x0){if(moment(_0x2e4748[_0x98cd('0x13')])[_0x98cd('0x19')](_0x1127be[_0x98cd('0xb')],_0x98cd('0x1a'))>moment()){return _0x20dcba(null,![],{'message':_0x98cd('0x16')});}else{return utils[_0x98cd('0x1b')](_0x2e4748,0x0,![],null)[_0x98cd('0xc')](function(){return utils[_0x98cd('0x1c')](_0x2e4748);})[_0x98cd('0xc')](function(){return _0x20dcba(null,_0x2e4748);});}}else{return _0x20dcba(null,![],{'message':_0x98cd('0x16')});}}else{return utils['clearBlockUser'](_0x2e4748,0x0,![],null)[_0x98cd('0xc')](function(){return utils[_0x98cd('0x1c')](_0x2e4748);})[_0x98cd('0xc')](function(){return _0x20dcba(null,_0x2e4748);})[_0x98cd('0x1d')](function(_0x4f2173){return _0x20dcba(null,![],_0x4f2173);});}}else{if(_0x2e4748[_0x98cd('0x12')]){return _0x20dcba(null,![],{'message':_0x98cd('0x16')});}else{return utils[_0x98cd('0x1c')](_0x2e4748)[_0x98cd('0xc')](function(){return _0x20dcba(null,_0x2e4748);});}}}});})[_0x98cd('0x1d')](function(_0x181332){return _0x20dcba(null,![],_0x181332);});}function sendServiceMail(_0x54fdbe){return db[_0x98cd('0x1e')][_0x98cd('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x98cd('0xd'),'email'],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x98cd('0xc')](function(_0x37c64c){if(!_0x37c64c){throw new Error(_0x98cd('0x20'));}var _0x5b0dd9={'tls':{'rejectUnauthorized':![]}};if(_0x37c64c[_0x98cd('0x21')][_0x98cd('0x22')]){_0x5b0dd9['service']=_0x37c64c[_0x98cd('0x21')][_0x98cd('0x22')];}else{_0x5b0dd9[_0x98cd('0x23')]=_0x37c64c[_0x98cd('0x21')][_0x98cd('0x23')];_0x5b0dd9['port']=_0x37c64c[_0x98cd('0x21')][_0x98cd('0x24')];_0x5b0dd9['secure']=_0x37c64c[_0x98cd('0x21')]['secure'];}if(_0x37c64c[_0x98cd('0x21')][_0x98cd('0x25')]){_0x5b0dd9['auth']={'user':_0x37c64c['Smtp'][_0x98cd('0x14')],'pass':_0x37c64c['Smtp']['pass']};}var _0x4b4239={'account':_0x5b0dd9,'message':_[_0x98cd('0x26')]({'from':util[_0x98cd('0x27')]('\x22%s\x22\x20<%s>',_0x37c64c[_0x98cd('0xd')],_0x37c64c['email']||_0x37c64c['Smtp'][_0x98cd('0x14')])},_0x54fdbe)};return client[_0x98cd('0x28')](_0x98cd('0x29'),_0x4b4239);})['then'](function(_0x14e7a9){if(_0x14e7a9['error']){throw new Error(util[_0x98cd('0x27')](_0x98cd('0x2a'),_0x14e7a9[_0x98cd('0x2b')]['message']||JSON[_0x98cd('0x2c')](_0x14e7a9[_0x98cd('0x2b')])));}return!![];});}function handleError(_0xf9faa2,_0x508f3c,_0x47bf74){return _0xf9faa2[_0x98cd('0x2d')](_0x508f3c||0x1f4)[_0x98cd('0x2e')]({'message':_0x47bf74?_0x47bf74[_0x98cd('0x2f')]||_0x47bf74:''});}function checkPasswordPattern(_0x1780dc,_0x120623,_0x1614de){if(_0x1614de){var _0x4fcf23=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4fcf23[_0x98cd('0x30')](_0x120623)){return _0x1780dc;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1780dc;}}exports[_0x98cd('0x31')]=function(_0x43674c,_0x4b978f,_0x4cb987){passport['authenticate'](_0x98cd('0x32'),function(_0x5a6ae5,_0x45c3b9,_0x5b28f6){var _0x4b3af3=_0x5a6ae5||_0x5b28f6;if(_0x4b3af3){return handleError(_0x4b978f,0x191,_0x4b3af3);}if(!_0x45c3b9){return handleError(_0x4b978f,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x326d71={'payload':{'id':_0x45c3b9['id'],'role':_0x45c3b9[_0x98cd('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x326d71)[_0x98cd('0xc')](function(_0x4e1feb){_0x4b978f['json']({'id':_0x45c3b9['id'],'token':_0x4e1feb,'statusCall':'','isAlreadyLogged':_0x45c3b9[_0x98cd('0x33')]});});}})(_0x43674c,_0x4b978f,_0x4cb987);};exports[_0x98cd('0x34')]=function(_0x32e354,_0xecff83,_0x45915e){if(!_0x32e354['body']['email']){return handleError(_0xecff83,0x1f4,{'message':_0x98cd('0x35')});}var _0xb60b8b=rs[_0x98cd('0x36')]();_0x32e354[_0x98cd('0x37')]['email']=_0x32e354[_0x98cd('0x37')][_0x98cd('0x38')][_0x98cd('0x39')]()['toLowerCase']();var _0x2bfcbc;return db[_0x98cd('0x3a')]['findOne']({'where':{'id':0x1},'attributes':[_0x98cd('0xa'),'blockDuration'],'raw':!![]})[_0x98cd('0xc')](function(_0x3fcba0){_0x2bfcbc=_0x3fcba0;return db['User'][_0x98cd('0x1f')]({'where':{'email':_0x32e354['body']['email']}});})[_0x98cd('0xc')](function(_0x2f9fa6){if(!_0x2f9fa6){throw new Error(_0x98cd('0x3b'));}if(_0x2f9fa6[_0x98cd('0x11')]){throw new Error(_0x98cd('0x3c'));}if(_0x2f9fa6['blocked']){if(moment(_0x2f9fa6[_0x98cd('0x13')])[_0x98cd('0x19')](_0x2bfcbc['blockDuration'],_0x98cd('0x1a'))>moment()){throw new Error(_0x98cd('0x3d'));}else{_0x2f9fa6[_0x98cd('0x12')]=![];_0x2f9fa6[_0x98cd('0x13')]=null;}}_0x2f9fa6['resetPasswordToken']=_0xb60b8b;_0x2f9fa6[_0x98cd('0x3e')]=Date[_0x98cd('0x3f')]()+0x36ee80;return _0x2f9fa6[_0x98cd('0x40')]();})[_0x98cd('0xc')](function(){return sendServiceMail({'to':_0x32e354[_0x98cd('0x37')]['email'],'subject':_0x98cd('0x41'),'text':_0x98cd('0x42')+_0x98cd('0x43')+_0x98cd('0x44')+_0x32e354[_0x98cd('0x45')][_0x98cd('0x23')]+_0x98cd('0x46')+_0xb60b8b+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x98cd('0xc')](function(){_0xecff83[_0x98cd('0x2d')](0xc8)[_0x98cd('0x2e')]({'message':_0x98cd('0x47')});})['catch'](function(_0x40f0c5){return handleError(_0xecff83,0x1f4,_0x40f0c5);});};exports[_0x98cd('0x48')]=function(_0x47ccdf,_0x5d3666,_0x134244){var _0x434729;return db[_0x98cd('0x49')]['find']({'where':{'resetPasswordToken':_0x47ccdf[_0x98cd('0x4a')][_0x98cd('0x4b')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x98cd('0xc')](function(_0x23807f){_0x434729=_0x23807f;if(!_0x434729){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x98cd('0x9')]({'attributes':['id',_0x98cd('0x4c')]});})['then'](function(_0x3b7e4c){return checkPasswordPattern(_0x3b7e4c,_0x47ccdf[_0x98cd('0x37')][_0x98cd('0xe')],_0x3b7e4c[_0x98cd('0x4c')]);})[_0x98cd('0xc')](function(){_0x434729[_0x98cd('0xe')]=_0x47ccdf[_0x98cd('0x37')][_0x98cd('0xe')];_0x434729[_0x98cd('0x4d')]=null;_0x434729[_0x98cd('0x3e')]=null;return _0x434729['save']();})[_0x98cd('0xc')](function(){_0x5d3666['status'](0xc8)[_0x98cd('0x2e')]({'message':_0x98cd('0x4e')});})['catch'](function(_0x5a2b6b){return handleError(_0x5d3666,0x1f4,_0x5a2b6b);});};passport['use'](new LocalStrategy({'usernameField':'name','passwordField':_0x98cd('0xe')},function(_0x557e0d,_0x368890,_0x45853d){return localAuthenticate(db[_0x98cd('0x49')],_0x557e0d,_0x368890,_0x45853d);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index df67103..8a8195e 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 _0xd0ad=['express','./authLocal.controller','post','/forgot','forgot'];(function(_0x588dcc,_0x4490e8){var _0x18c3d2=function(_0x588d29){while(--_0x588d29){_0x588dcc['push'](_0x588dcc['shift']());}};_0x18c3d2(++_0x4490e8);}(_0xd0ad,0x145));var _0xdd0a=function(_0x49d434,_0x203001){_0x49d434=_0x49d434-0x0;var _0x1e9442=_0xd0ad[_0x49d434];return _0x1e9442;};'use strict';var express=require(_0xdd0a('0x0'));var router=express['Router']();var controller=require(_0xdd0a('0x1'));router[_0xdd0a('0x2')]('/',controller['login']);router[_0xdd0a('0x2')](_0xdd0a('0x3'),controller[_0xdd0a('0x4')]);router[_0xdd0a('0x2')]('/reset/:token',controller['reset']);module['exports']=router; \ No newline at end of file +var _0x4864=['post','login','/forgot','forgot','/reset/:token','reset','./authLocal.controller'];(function(_0x123df8,_0x3a1ac3){var _0x43177f=function(_0x4f8622){while(--_0x4f8622){_0x123df8['push'](_0x123df8['shift']());}};_0x43177f(++_0x3a1ac3);}(_0x4864,0x12c));var _0x4486=function(_0x25601e,_0x3bd0f4){_0x25601e=_0x25601e-0x0;var _0x54d208=_0x4864[_0x25601e];return _0x54d208;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x4486('0x0'));router[_0x4486('0x1')]('/',controller[_0x4486('0x2')]);router[_0x4486('0x1')](_0x4486('0x3'),controller[_0x4486('0x4')]);router[_0x4486('0x1')](_0x4486('0x5'),controller[_0x4486('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index a62bc81..8903d31 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 _0x9993=['STRING','BOOLEAN'];(function(_0x43305f,_0x320675){var _0x32a65f=function(_0x3497f9){while(--_0x3497f9){_0x43305f['push'](_0x43305f['shift']());}};_0x32a65f(++_0x320675);}(_0x9993,0xe0));var _0x3999=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x9993[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3999('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x3999('0x0')]},'description':{'type':Sequelize[_0x3999('0x0')]},'status':{'type':Sequelize[_0x3999('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x281c=['STRING','INTEGER','sequelize','exports'];(function(_0x33cb4a,_0x2dc7a2){var _0x157398=function(_0x38b7c5){while(--_0x38b7c5){_0x33cb4a['push'](_0x33cb4a['shift']());}};_0x157398(++_0x2dc7a2);}(_0x281c,0xe6));var _0xc281=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x281c[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0xc281('0x0'));module[_0xc281('0x1')]={'name':{'type':Sequelize[_0xc281('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xc281('0x3')],'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 f8ce0ee..7055ee1 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 _0x095a=['sort','where','filter','merge','options','count','includeAll','include','findAll','rows','catch','params','create','body','update','find','addConditions','Condition','ids','omit','getConditions','findOne','pick','addActions','Action','getActions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','offset','status','set','Content-Range','json','reject','save','then','destroy','error','stack','name','index','Automation','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order'];(function(_0x3f25a5,_0x19f07a){var _0x4abb52=function(_0x29f44f){while(--_0x29f44f){_0x3f25a5['push'](_0x3f25a5['shift']());}};_0x4abb52(++_0x19f07a);}(_0x095a,0x107));var _0xa095=function(_0x5851ec,_0x213152){_0x5851ec=_0x5851ec-0x0;var _0x7d3e54=_0x095a[_0x5851ec];return _0x7d3e54;};'use strict';var pdf=require(_0xa095('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa095('0x1'));var zipdir=require(_0xa095('0x2'));var jsonpatch=require(_0xa095('0x3'));var rp=require(_0xa095('0x4'));var moment=require(_0xa095('0x5'));var BPromise=require(_0xa095('0x6'));var Mustache=require(_0xa095('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa095('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa095('0x9'));var squel=require(_0xa095('0xa'));var crypto=require(_0xa095('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa095('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa095('0xd'));var Papa=require('papaparse');var Redis=require(_0xa095('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa095('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa095('0x10'));var logger=require(_0xa095('0x11'))(_0xa095('0x12'));var utils=require(_0xa095('0x13'));var config=require(_0xa095('0x14'));var db=require(_0xa095('0x15'))['db'];function respondWithStatusCode(_0x1e44ba,_0x993626){_0x993626=_0x993626||0xcc;return function(_0xe9709e){if(_0xe9709e){return _0x1e44ba[_0xa095('0x16')](_0x993626);}return _0x1e44ba['status'](_0x993626)[_0xa095('0x17')]();};}function respondWithResult(_0x2df657,_0x121bfe){_0x121bfe=_0x121bfe||0xc8;return function(_0x297052){if(_0x297052){return _0x2df657['status'](_0x121bfe)['json'](_0x297052);}};}function respondWithFilteredResult(_0x541a55,_0x2ad5ea){return function(_0x4a854a){if(_0x4a854a){var _0x1678c5=_0x4a854a['count'],_0x4a8f9f=_0x2ad5ea[_0xa095('0x18')],_0x41acba=_0x2ad5ea[_0xa095('0x18')]+_0x2ad5ea['limit'],_0x31c5e8;if(_0x41acba>=_0x1678c5){_0x41acba=_0x1678c5;_0x31c5e8=0xc8;}else{_0x31c5e8=0xce;}_0x541a55[_0xa095('0x19')](_0x31c5e8);return _0x541a55[_0xa095('0x1a')](_0xa095('0x1b'),_0x4a8f9f+'-'+_0x41acba+'/'+_0x1678c5)[_0xa095('0x1c')](_0x4a854a);}return null;};}function patchUpdates(_0x29b542){return function(_0x238efc){try{jsonpatch['apply'](_0x238efc,_0x29b542,!![]);}catch(_0x1b54fa){return BPromise[_0xa095('0x1d')](_0x1b54fa);}return _0x238efc[_0xa095('0x1e')]();};}function saveUpdates(_0x32bfb5,_0x23beb3){return function(_0x44a31e){if(_0x44a31e){return _0x44a31e['update'](_0x32bfb5)[_0xa095('0x1f')](function(_0xdd8e94){return _0xdd8e94;});}return null;};}function removeEntity(_0x221b3c,_0x4040f9){return function(_0x1cc830){if(_0x1cc830){return _0x1cc830[_0xa095('0x20')]()[_0xa095('0x1f')](function(){_0x221b3c[_0xa095('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x457598,_0x219460){return function(_0xb64dfc){if(!_0xb64dfc){_0x457598[_0xa095('0x16')](0x194);}return _0xb64dfc;};}function handleError(_0x370348,_0x30c5fb){_0x30c5fb=_0x30c5fb||0x1f4;return function(_0x37a488){logger[_0xa095('0x21')](_0x37a488[_0xa095('0x22')]);if(_0x37a488[_0xa095('0x23')]){delete _0x37a488[_0xa095('0x23')];}_0x370348['status'](_0x30c5fb)['send'](_0x37a488);};}exports[_0xa095('0x24')]=function(_0x2429e7,_0x310ca5){var _0x2e05a2={},_0x234594={},_0x81cedc={'count':0x0,'rows':[]};var _0x14d4bd=_['map'](db[_0xa095('0x25')][_0xa095('0x26')],function(_0x2ee2f4){return{'name':_0x2ee2f4[_0xa095('0x27')],'type':_0x2ee2f4['type']['key']};});_0x234594[_0xa095('0x28')]=_[_0xa095('0x29')](_0x14d4bd,_0xa095('0x23'));_0x234594['query']=_[_0xa095('0x2a')](_0x2429e7[_0xa095('0x2b')]);_0x234594[_0xa095('0x2c')]=_[_0xa095('0x2d')](_0x234594['model'],_0x234594[_0xa095('0x2b')]);_0x2e05a2[_0xa095('0x2e')]=_[_0xa095('0x2d')](_0x234594[_0xa095('0x28')],qs[_0xa095('0x2f')](_0x2429e7[_0xa095('0x2b')][_0xa095('0x2f')]));_0x2e05a2[_0xa095('0x2e')]=_0x2e05a2['attributes'][_0xa095('0x30')]?_0x2e05a2[_0xa095('0x2e')]:_0x234594[_0xa095('0x28')];if(!_0x2429e7[_0xa095('0x2b')][_0xa095('0x31')](_0xa095('0x32'))){_0x2e05a2[_0xa095('0x33')]=qs['limit'](_0x2429e7[_0xa095('0x2b')][_0xa095('0x33')]);_0x2e05a2[_0xa095('0x18')]=qs['offset'](_0x2429e7[_0xa095('0x2b')][_0xa095('0x18')]);}_0x2e05a2[_0xa095('0x34')]=qs['sort'](_0x2429e7[_0xa095('0x2b')][_0xa095('0x35')]);_0x2e05a2[_0xa095('0x36')]=qs['filters'](_['pick'](_0x2429e7[_0xa095('0x2b')],_0x234594[_0xa095('0x2c')]));if(_0x2429e7['query'][_0xa095('0x37')]){_0x2e05a2[_0xa095('0x36')]=_[_0xa095('0x38')](_0x2e05a2[_0xa095('0x36')],{'$or':_[_0xa095('0x29')](_0x14d4bd,function(_0x47383c){if(_0x47383c['type']!=='VIRTUAL'){var _0x2e8835={};_0x2e8835[_0x47383c['name']]={'$like':'%'+_0x2429e7[_0xa095('0x2b')][_0xa095('0x37')]+'%'};return _0x2e8835;}})});}_0x2e05a2=_[_0xa095('0x38')]({},_0x2e05a2,_0x2429e7[_0xa095('0x39')]);var _0x501455={'where':_0x2e05a2[_0xa095('0x36')]};return db[_0xa095('0x25')]['count'](_0x501455)[_0xa095('0x1f')](function(_0x5d9aff){_0x81cedc[_0xa095('0x3a')]=_0x5d9aff;if(_0x2429e7[_0xa095('0x2b')][_0xa095('0x3b')]){_0x2e05a2[_0xa095('0x3c')]=[{'all':!![]}];}return db[_0xa095('0x25')][_0xa095('0x3d')](_0x2e05a2);})[_0xa095('0x1f')](function(_0xad82b6){_0x81cedc[_0xa095('0x3e')]=_0xad82b6;return _0x81cedc;})[_0xa095('0x1f')](respondWithFilteredResult(_0x310ca5,_0x2e05a2))[_0xa095('0x3f')](handleError(_0x310ca5,null));};exports['show']=function(_0x22e464,_0x299012){var _0x5eee05={'raw':![],'where':{'id':_0x22e464[_0xa095('0x40')]['id']}},_0x34c250={};_0x34c250[_0xa095('0x28')]=_[_0xa095('0x2a')](db[_0xa095('0x25')][_0xa095('0x26')]);_0x34c250[_0xa095('0x2b')]=_[_0xa095('0x2a')](_0x22e464[_0xa095('0x2b')]);_0x34c250['filters']=_[_0xa095('0x2d')](_0x34c250['model'],_0x34c250['query']);_0x5eee05['attributes']=_[_0xa095('0x2d')](_0x34c250[_0xa095('0x28')],qs[_0xa095('0x2f')](_0x22e464[_0xa095('0x2b')][_0xa095('0x2f')]));_0x5eee05[_0xa095('0x2e')]=_0x5eee05[_0xa095('0x2e')][_0xa095('0x30')]?_0x5eee05[_0xa095('0x2e')]:_0x34c250[_0xa095('0x28')];if(_0x22e464[_0xa095('0x2b')][_0xa095('0x3b')]){_0x5eee05[_0xa095('0x3c')]=[{'all':!![]}];}_0x5eee05=_[_0xa095('0x38')]({},_0x5eee05,_0x22e464['options']);return db[_0xa095('0x25')]['find'](_0x5eee05)[_0xa095('0x1f')](handleEntityNotFound(_0x299012,null))[_0xa095('0x1f')](respondWithResult(_0x299012,null))[_0xa095('0x3f')](handleError(_0x299012,null));};exports['create']=function(_0x2e1463,_0x488db1){return db['Automation'][_0xa095('0x41')](_0x2e1463[_0xa095('0x42')],{})[_0xa095('0x1f')](respondWithResult(_0x488db1,0xc9))[_0xa095('0x3f')](handleError(_0x488db1,null));};exports[_0xa095('0x43')]=function(_0x43be75,_0x1d72c9){if(_0x43be75['body']['id']){delete _0x43be75[_0xa095('0x42')]['id'];}return db[_0xa095('0x25')][_0xa095('0x44')]({'where':{'id':_0x43be75['params']['id']}})['then'](handleEntityNotFound(_0x1d72c9,null))[_0xa095('0x1f')](saveUpdates(_0x43be75[_0xa095('0x42')],null))['then'](respondWithResult(_0x1d72c9,null))[_0xa095('0x3f')](handleError(_0x1d72c9,null));};exports[_0xa095('0x20')]=function(_0x29dec4,_0x3cb8a8){return db[_0xa095('0x25')][_0xa095('0x44')]({'where':{'id':_0x29dec4[_0xa095('0x40')]['id']}})[_0xa095('0x1f')](handleEntityNotFound(_0x3cb8a8,null))['then'](removeEntity(_0x3cb8a8,null))[_0xa095('0x3f')](handleError(_0x3cb8a8,null));};exports[_0xa095('0x45')]=function(_0x158107,_0x3ed0e3,_0x50c3ca){return db[_0xa095('0x46')][_0xa095('0x44')]({'where':{'id':_0x158107[_0xa095('0x40')]['id']}})['then'](handleEntityNotFound(_0x3ed0e3,null))[_0xa095('0x1f')](function(_0x59b36c){if(_0x59b36c){return _0x59b36c[_0xa095('0x45')](_0x158107['body'][_0xa095('0x47')],_[_0xa095('0x48')](_0x158107['body'],[_0xa095('0x47'),'id'])||{});}})[_0xa095('0x1f')](respondWithResult(_0x3ed0e3,null))[_0xa095('0x3f')](handleError(_0x3ed0e3,null));};exports[_0xa095('0x49')]=function(_0x1861e4,_0x13f679,_0x1ca1da){var _0x42c161={};var _0x54e85c={};var _0xed32b6;var _0x10eea6;return db[_0xa095('0x25')][_0xa095('0x4a')]({'where':{'id':_0x1861e4[_0xa095('0x40')]['id']}})[_0xa095('0x1f')](handleEntityNotFound(_0x13f679,null))[_0xa095('0x1f')](function(_0x21b644){if(_0x21b644){_0xed32b6=_0x21b644;_0x54e85c[_0xa095('0x28')]=_[_0xa095('0x2a')](db[_0xa095('0x46')]['rawAttributes']);_0x54e85c[_0xa095('0x2b')]=_['keys'](_0x1861e4['query']);_0x54e85c[_0xa095('0x2c')]=_[_0xa095('0x2d')](_0x54e85c[_0xa095('0x28')],_0x54e85c[_0xa095('0x2b')]);_0x42c161[_0xa095('0x2e')]=_[_0xa095('0x2d')](_0x54e85c[_0xa095('0x28')],qs[_0xa095('0x2f')](_0x1861e4['query'][_0xa095('0x2f')]));_0x42c161['attributes']=_0x42c161['attributes']['length']?_0x42c161[_0xa095('0x2e')]:_0x54e85c[_0xa095('0x28')];_0x42c161[_0xa095('0x34')]=qs['sort'](_0x1861e4[_0xa095('0x2b')][_0xa095('0x35')]);_0x42c161['where']=qs[_0xa095('0x2c')](_[_0xa095('0x4b')](_0x1861e4[_0xa095('0x2b')],_0x54e85c['filters']));if(_0x1861e4[_0xa095('0x2b')][_0xa095('0x37')]){_0x42c161['where']=_[_0xa095('0x38')](_0x42c161[_0xa095('0x36')],{'$or':_['map'](_0x42c161['attributes'],function(_0x4de1ed){var _0x3f11e9={};_0x3f11e9[_0x4de1ed]={'$like':'%'+_0x1861e4[_0xa095('0x2b')][_0xa095('0x37')]+'%'};return _0x3f11e9;})});}_0x42c161=_[_0xa095('0x38')]({},_0x42c161,_0x1861e4['options']);return _0xed32b6[_0xa095('0x49')](_0x42c161);}})['then'](function(_0x355f2f){if(_0x355f2f){_0x10eea6=_0x355f2f[_0xa095('0x30')];if(!_0x1861e4['query'][_0xa095('0x31')]('nolimit')){_0x42c161['limit']=qs[_0xa095('0x33')](_0x1861e4[_0xa095('0x2b')]['limit']);_0x42c161[_0xa095('0x18')]=qs[_0xa095('0x18')](_0x1861e4[_0xa095('0x2b')]['offset']);}return _0xed32b6[_0xa095('0x49')](_0x42c161);}})['then'](function(_0x2f110e){if(_0x2f110e){return _0x2f110e?{'count':_0x10eea6,'rows':_0x2f110e}:null;}})[_0xa095('0x1f')](respondWithResult(_0x13f679,null))[_0xa095('0x3f')](handleError(_0x13f679,null));};exports[_0xa095('0x4c')]=function(_0x59fb6a,_0x4190cc,_0x5cef0c){return db[_0xa095('0x4d')]['find']({'where':{'id':_0x59fb6a[_0xa095('0x40')]['id']}})[_0xa095('0x1f')](handleEntityNotFound(_0x4190cc,null))[_0xa095('0x1f')](function(_0x28b8b8){if(_0x28b8b8){return _0x28b8b8[_0xa095('0x4c')](_0x59fb6a[_0xa095('0x42')]['ids'],_[_0xa095('0x48')](_0x59fb6a[_0xa095('0x42')],[_0xa095('0x47'),'id'])||{});}})[_0xa095('0x1f')](respondWithResult(_0x4190cc,null))[_0xa095('0x3f')](handleError(_0x4190cc,null));};exports[_0xa095('0x4e')]=function(_0x2e28c7,_0x5499a9,_0x46b3f3){var _0x3a489c={};var _0x50c6f0={};var _0x1e4216;var _0x3a8bb3;return db[_0xa095('0x25')][_0xa095('0x4a')]({'where':{'id':_0x2e28c7[_0xa095('0x40')]['id']}})[_0xa095('0x1f')](handleEntityNotFound(_0x5499a9,null))['then'](function(_0xe45af5){if(_0xe45af5){_0x1e4216=_0xe45af5;_0x50c6f0[_0xa095('0x28')]=_['keys'](db[_0xa095('0x4d')][_0xa095('0x26')]);_0x50c6f0[_0xa095('0x2b')]=_[_0xa095('0x2a')](_0x2e28c7[_0xa095('0x2b')]);_0x50c6f0[_0xa095('0x2c')]=_[_0xa095('0x2d')](_0x50c6f0[_0xa095('0x28')],_0x50c6f0[_0xa095('0x2b')]);_0x3a489c[_0xa095('0x2e')]=_['intersection'](_0x50c6f0[_0xa095('0x28')],qs[_0xa095('0x2f')](_0x2e28c7[_0xa095('0x2b')][_0xa095('0x2f')]));_0x3a489c[_0xa095('0x2e')]=_0x3a489c[_0xa095('0x2e')]['length']?_0x3a489c['attributes']:_0x50c6f0[_0xa095('0x28')];_0x3a489c[_0xa095('0x34')]=qs[_0xa095('0x35')](_0x2e28c7[_0xa095('0x2b')][_0xa095('0x35')]);_0x3a489c[_0xa095('0x36')]=qs['filters'](_[_0xa095('0x4b')](_0x2e28c7[_0xa095('0x2b')],_0x50c6f0[_0xa095('0x2c')]));if(_0x2e28c7[_0xa095('0x2b')][_0xa095('0x37')]){_0x3a489c['where']=_['merge'](_0x3a489c[_0xa095('0x36')],{'$or':_['map'](_0x3a489c[_0xa095('0x2e')],function(_0x3a149b){var _0x4ac6c6={};_0x4ac6c6[_0x3a149b]={'$like':'%'+_0x2e28c7['query']['filter']+'%'};return _0x4ac6c6;})});}_0x3a489c=_[_0xa095('0x38')]({},_0x3a489c,_0x2e28c7[_0xa095('0x39')]);return _0x1e4216['getActions'](_0x3a489c);}})['then'](function(_0xb8f030){if(_0xb8f030){_0x3a8bb3=_0xb8f030[_0xa095('0x30')];if(!_0x2e28c7[_0xa095('0x2b')][_0xa095('0x31')]('nolimit')){_0x3a489c['limit']=qs['limit'](_0x2e28c7[_0xa095('0x2b')][_0xa095('0x33')]);_0x3a489c[_0xa095('0x18')]=qs[_0xa095('0x18')](_0x2e28c7[_0xa095('0x2b')]['offset']);}return _0x1e4216[_0xa095('0x4e')](_0x3a489c);}})[_0xa095('0x1f')](function(_0xe73a9f){if(_0xe73a9f){return _0xe73a9f?{'count':_0x3a8bb3,'rows':_0xe73a9f}:null;}})[_0xa095('0x1f')](respondWithResult(_0x5499a9,null))[_0xa095('0x3f')](handleError(_0x5499a9,null));}; \ No newline at end of file +var _0x5120=['order','addActions','Action','omit','findOne','getActions','nolimit','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','save','then','destroy','sendStatus','error','stack','map','Automation','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','type','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','addConditions','Condition','ids','getConditions'];(function(_0x35dd31,_0x281166){var _0x71fa9f=function(_0x34bf33){while(--_0x34bf33){_0x35dd31['push'](_0x35dd31['shift']());}};_0x71fa9f(++_0x281166);}(_0x5120,0x1db));var _0x0512=function(_0x151334,_0x1e11ac){_0x151334=_0x151334-0x0;var _0x3d03da=_0x5120[_0x151334];return _0x3d03da;};'use strict';var pdf=require(_0x0512('0x0'));var emlformat=require(_0x0512('0x1'));var rimraf=require(_0x0512('0x2'));var zipdir=require(_0x0512('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0512('0x4'));var moment=require(_0x0512('0x5'));var BPromise=require(_0x0512('0x6'));var Mustache=require('mustache');var util=require(_0x0512('0x7'));var path=require(_0x0512('0x8'));var sox=require(_0x0512('0x9'));var csv=require(_0x0512('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0512('0xb'));var jsforce=require(_0x0512('0xc'));var deskjs=require(_0x0512('0xd'));var toCsv=require(_0x0512('0xa'));var querystring=require(_0x0512('0xe'));var Papa=require('papaparse');var Redis=require(_0x0512('0xf'));var authService=require(_0x0512('0x10'));var qs=require(_0x0512('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0512('0x12'));var utils=require(_0x0512('0x13'));var config=require(_0x0512('0x14'));var db=require(_0x0512('0x15'))['db'];function respondWithStatusCode(_0x5d4393,_0x497b44){_0x497b44=_0x497b44||0xcc;return function(_0xeda223){if(_0xeda223){return _0x5d4393['sendStatus'](_0x497b44);}return _0x5d4393[_0x0512('0x16')](_0x497b44)[_0x0512('0x17')]();};}function respondWithResult(_0x447a8f,_0x581873){_0x581873=_0x581873||0xc8;return function(_0x3424b1){if(_0x3424b1){return _0x447a8f[_0x0512('0x16')](_0x581873)[_0x0512('0x18')](_0x3424b1);}};}function respondWithFilteredResult(_0x1524f0,_0x19a172){return function(_0x503db2){if(_0x503db2){var _0x1addfe=_0x503db2[_0x0512('0x19')],_0x228784=_0x19a172[_0x0512('0x1a')],_0x3b9d1a=_0x19a172[_0x0512('0x1a')]+_0x19a172[_0x0512('0x1b')],_0x260ad5;if(_0x3b9d1a>=_0x1addfe){_0x3b9d1a=_0x1addfe;_0x260ad5=0xc8;}else{_0x260ad5=0xce;}_0x1524f0[_0x0512('0x16')](_0x260ad5);return _0x1524f0[_0x0512('0x1c')]('Content-Range',_0x228784+'-'+_0x3b9d1a+'/'+_0x1addfe)[_0x0512('0x18')](_0x503db2);}return null;};}function patchUpdates(_0x137958){return function(_0x35c0df){try{jsonpatch[_0x0512('0x1d')](_0x35c0df,_0x137958,!![]);}catch(_0x4c786c){return BPromise['reject'](_0x4c786c);}return _0x35c0df[_0x0512('0x1e')]();};}function saveUpdates(_0x485770,_0x36785f){return function(_0x2813cf){if(_0x2813cf){return _0x2813cf['update'](_0x485770)[_0x0512('0x1f')](function(_0x4e2573){return _0x4e2573;});}return null;};}function removeEntity(_0x596a7e,_0x414c48){return function(_0x5caa1b){if(_0x5caa1b){return _0x5caa1b[_0x0512('0x20')]()[_0x0512('0x1f')](function(){_0x596a7e[_0x0512('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x145971,_0x30daa4){return function(_0x5e64e2){if(!_0x5e64e2){_0x145971[_0x0512('0x21')](0x194);}return _0x5e64e2;};}function handleError(_0xb563ca,_0x2b39f2){_0x2b39f2=_0x2b39f2||0x1f4;return function(_0x23ea4b){logger[_0x0512('0x22')](_0x23ea4b[_0x0512('0x23')]);if(_0x23ea4b['name']){delete _0x23ea4b['name'];}_0xb563ca[_0x0512('0x16')](_0x2b39f2)['send'](_0x23ea4b);};}exports['index']=function(_0x42d4a3,_0x556288){var _0x35f967={},_0x563a35={},_0x542640={'count':0x0,'rows':[]};var _0x1a9e30=_[_0x0512('0x24')](db[_0x0512('0x25')][_0x0512('0x26')],function(_0xc6fa53){return{'name':_0xc6fa53[_0x0512('0x27')],'type':_0xc6fa53['type'][_0x0512('0x28')]};});_0x563a35[_0x0512('0x29')]=_['map'](_0x1a9e30,'name');_0x563a35[_0x0512('0x2a')]=_[_0x0512('0x2b')](_0x42d4a3[_0x0512('0x2a')]);_0x563a35['filters']=_[_0x0512('0x2c')](_0x563a35[_0x0512('0x29')],_0x563a35[_0x0512('0x2a')]);_0x35f967[_0x0512('0x2d')]=_[_0x0512('0x2c')](_0x563a35[_0x0512('0x29')],qs['fields'](_0x42d4a3['query'][_0x0512('0x2e')]));_0x35f967[_0x0512('0x2d')]=_0x35f967[_0x0512('0x2d')][_0x0512('0x2f')]?_0x35f967[_0x0512('0x2d')]:_0x563a35[_0x0512('0x29')];if(!_0x42d4a3['query'][_0x0512('0x30')]('nolimit')){_0x35f967[_0x0512('0x1b')]=qs[_0x0512('0x1b')](_0x42d4a3['query'][_0x0512('0x1b')]);_0x35f967['offset']=qs[_0x0512('0x1a')](_0x42d4a3[_0x0512('0x2a')][_0x0512('0x1a')]);}_0x35f967['order']=qs[_0x0512('0x31')](_0x42d4a3[_0x0512('0x2a')][_0x0512('0x31')]);_0x35f967[_0x0512('0x32')]=qs[_0x0512('0x33')](_[_0x0512('0x34')](_0x42d4a3[_0x0512('0x2a')],_0x563a35[_0x0512('0x33')]));if(_0x42d4a3[_0x0512('0x2a')]['filter']){_0x35f967[_0x0512('0x32')]=_[_0x0512('0x35')](_0x35f967[_0x0512('0x32')],{'$or':_[_0x0512('0x24')](_0x1a9e30,function(_0x4dfab0){if(_0x4dfab0[_0x0512('0x36')]!=='VIRTUAL'){var _0x3f70f0={};_0x3f70f0[_0x4dfab0['name']]={'$like':'%'+_0x42d4a3['query'][_0x0512('0x37')]+'%'};return _0x3f70f0;}})});}_0x35f967=_[_0x0512('0x35')]({},_0x35f967,_0x42d4a3[_0x0512('0x38')]);var _0x3293b6={'where':_0x35f967[_0x0512('0x32')]};return db[_0x0512('0x25')][_0x0512('0x19')](_0x3293b6)[_0x0512('0x1f')](function(_0x20299e){_0x542640[_0x0512('0x19')]=_0x20299e;if(_0x42d4a3['query'][_0x0512('0x39')]){_0x35f967[_0x0512('0x3a')]=[{'all':!![]}];}return db[_0x0512('0x25')][_0x0512('0x3b')](_0x35f967);})[_0x0512('0x1f')](function(_0x3c83ec){_0x542640[_0x0512('0x3c')]=_0x3c83ec;return _0x542640;})['then'](respondWithFilteredResult(_0x556288,_0x35f967))['catch'](handleError(_0x556288,null));};exports[_0x0512('0x3d')]=function(_0x34e778,_0x4d526b){var _0x1bafb2={'raw':![],'where':{'id':_0x34e778[_0x0512('0x3e')]['id']}},_0x3a6217={};_0x3a6217[_0x0512('0x29')]=_[_0x0512('0x2b')](db[_0x0512('0x25')][_0x0512('0x26')]);_0x3a6217['query']=_[_0x0512('0x2b')](_0x34e778[_0x0512('0x2a')]);_0x3a6217[_0x0512('0x33')]=_[_0x0512('0x2c')](_0x3a6217[_0x0512('0x29')],_0x3a6217[_0x0512('0x2a')]);_0x1bafb2[_0x0512('0x2d')]=_['intersection'](_0x3a6217[_0x0512('0x29')],qs[_0x0512('0x2e')](_0x34e778[_0x0512('0x2a')][_0x0512('0x2e')]));_0x1bafb2['attributes']=_0x1bafb2[_0x0512('0x2d')]['length']?_0x1bafb2[_0x0512('0x2d')]:_0x3a6217[_0x0512('0x29')];if(_0x34e778[_0x0512('0x2a')][_0x0512('0x39')]){_0x1bafb2[_0x0512('0x3a')]=[{'all':!![]}];}_0x1bafb2=_[_0x0512('0x35')]({},_0x1bafb2,_0x34e778['options']);return db[_0x0512('0x25')][_0x0512('0x3f')](_0x1bafb2)['then'](handleEntityNotFound(_0x4d526b,null))[_0x0512('0x1f')](respondWithResult(_0x4d526b,null))['catch'](handleError(_0x4d526b,null));};exports[_0x0512('0x40')]=function(_0x38e623,_0x3f4e77){return db[_0x0512('0x25')][_0x0512('0x40')](_0x38e623[_0x0512('0x41')],{})[_0x0512('0x1f')](respondWithResult(_0x3f4e77,0xc9))[_0x0512('0x42')](handleError(_0x3f4e77,null));};exports['update']=function(_0x22287a,_0xcc35bb){if(_0x22287a[_0x0512('0x41')]['id']){delete _0x22287a[_0x0512('0x41')]['id'];}return db['Automation']['find']({'where':{'id':_0x22287a[_0x0512('0x3e')]['id']}})[_0x0512('0x1f')](handleEntityNotFound(_0xcc35bb,null))[_0x0512('0x1f')](saveUpdates(_0x22287a['body'],null))['then'](respondWithResult(_0xcc35bb,null))[_0x0512('0x42')](handleError(_0xcc35bb,null));};exports['destroy']=function(_0x2ebf70,_0x22cd2b){return db['Automation'][_0x0512('0x3f')]({'where':{'id':_0x2ebf70[_0x0512('0x3e')]['id']}})[_0x0512('0x1f')](handleEntityNotFound(_0x22cd2b,null))['then'](removeEntity(_0x22cd2b,null))[_0x0512('0x42')](handleError(_0x22cd2b,null));};exports[_0x0512('0x43')]=function(_0x2b2419,_0x799454,_0x2f1e74){return db[_0x0512('0x44')]['find']({'where':{'id':_0x2b2419[_0x0512('0x3e')]['id']}})[_0x0512('0x1f')](handleEntityNotFound(_0x799454,null))['then'](function(_0xe0e515){if(_0xe0e515){return _0xe0e515[_0x0512('0x43')](_0x2b2419[_0x0512('0x41')]['ids'],_['omit'](_0x2b2419[_0x0512('0x41')],[_0x0512('0x45'),'id'])||{});}})[_0x0512('0x1f')](respondWithResult(_0x799454,null))[_0x0512('0x42')](handleError(_0x799454,null));};exports[_0x0512('0x46')]=function(_0x135873,_0x184ebd,_0x5667db){var _0x465296={};var _0x15b368={};var _0x512502;var _0x3784b6;return db[_0x0512('0x25')]['findOne']({'where':{'id':_0x135873[_0x0512('0x3e')]['id']}})['then'](handleEntityNotFound(_0x184ebd,null))[_0x0512('0x1f')](function(_0x36b54e){if(_0x36b54e){_0x512502=_0x36b54e;_0x15b368[_0x0512('0x29')]=_['keys'](db[_0x0512('0x44')][_0x0512('0x26')]);_0x15b368[_0x0512('0x2a')]=_[_0x0512('0x2b')](_0x135873[_0x0512('0x2a')]);_0x15b368[_0x0512('0x33')]=_[_0x0512('0x2c')](_0x15b368[_0x0512('0x29')],_0x15b368[_0x0512('0x2a')]);_0x465296[_0x0512('0x2d')]=_['intersection'](_0x15b368[_0x0512('0x29')],qs[_0x0512('0x2e')](_0x135873[_0x0512('0x2a')][_0x0512('0x2e')]));_0x465296['attributes']=_0x465296[_0x0512('0x2d')]['length']?_0x465296[_0x0512('0x2d')]:_0x15b368[_0x0512('0x29')];_0x465296[_0x0512('0x47')]=qs[_0x0512('0x31')](_0x135873[_0x0512('0x2a')][_0x0512('0x31')]);_0x465296[_0x0512('0x32')]=qs[_0x0512('0x33')](_[_0x0512('0x34')](_0x135873[_0x0512('0x2a')],_0x15b368['filters']));if(_0x135873[_0x0512('0x2a')][_0x0512('0x37')]){_0x465296[_0x0512('0x32')]=_[_0x0512('0x35')](_0x465296[_0x0512('0x32')],{'$or':_['map'](_0x465296['attributes'],function(_0x52fd80){var _0x1c221a={};_0x1c221a[_0x52fd80]={'$like':'%'+_0x135873[_0x0512('0x2a')][_0x0512('0x37')]+'%'};return _0x1c221a;})});}_0x465296=_['merge']({},_0x465296,_0x135873[_0x0512('0x38')]);return _0x512502['getConditions'](_0x465296);}})['then'](function(_0x487678){if(_0x487678){_0x3784b6=_0x487678[_0x0512('0x2f')];if(!_0x135873[_0x0512('0x2a')][_0x0512('0x30')]('nolimit')){_0x465296[_0x0512('0x1b')]=qs[_0x0512('0x1b')](_0x135873[_0x0512('0x2a')][_0x0512('0x1b')]);_0x465296['offset']=qs[_0x0512('0x1a')](_0x135873[_0x0512('0x2a')][_0x0512('0x1a')]);}return _0x512502['getConditions'](_0x465296);}})['then'](function(_0xa8f790){if(_0xa8f790){return _0xa8f790?{'count':_0x3784b6,'rows':_0xa8f790}:null;}})[_0x0512('0x1f')](respondWithResult(_0x184ebd,null))['catch'](handleError(_0x184ebd,null));};exports[_0x0512('0x48')]=function(_0x144c09,_0xdc24d2,_0x3e06dd){return db[_0x0512('0x49')]['find']({'where':{'id':_0x144c09['params']['id']}})['then'](handleEntityNotFound(_0xdc24d2,null))['then'](function(_0x46209a){if(_0x46209a){return _0x46209a[_0x0512('0x48')](_0x144c09[_0x0512('0x41')][_0x0512('0x45')],_[_0x0512('0x4a')](_0x144c09['body'],[_0x0512('0x45'),'id'])||{});}})['then'](respondWithResult(_0xdc24d2,null))[_0x0512('0x42')](handleError(_0xdc24d2,null));};exports['getActions']=function(_0x48d2fd,_0x267af8,_0x2dd227){var _0x35883a={};var _0x466ca4={};var _0x25d6bb;var _0x3b0d61;return db['Automation'][_0x0512('0x4b')]({'where':{'id':_0x48d2fd[_0x0512('0x3e')]['id']}})[_0x0512('0x1f')](handleEntityNotFound(_0x267af8,null))[_0x0512('0x1f')](function(_0x43d89e){if(_0x43d89e){_0x25d6bb=_0x43d89e;_0x466ca4[_0x0512('0x29')]=_['keys'](db[_0x0512('0x49')][_0x0512('0x26')]);_0x466ca4[_0x0512('0x2a')]=_[_0x0512('0x2b')](_0x48d2fd['query']);_0x466ca4[_0x0512('0x33')]=_['intersection'](_0x466ca4[_0x0512('0x29')],_0x466ca4[_0x0512('0x2a')]);_0x35883a['attributes']=_[_0x0512('0x2c')](_0x466ca4['model'],qs[_0x0512('0x2e')](_0x48d2fd[_0x0512('0x2a')][_0x0512('0x2e')]));_0x35883a['attributes']=_0x35883a[_0x0512('0x2d')][_0x0512('0x2f')]?_0x35883a['attributes']:_0x466ca4['model'];_0x35883a[_0x0512('0x47')]=qs[_0x0512('0x31')](_0x48d2fd[_0x0512('0x2a')][_0x0512('0x31')]);_0x35883a[_0x0512('0x32')]=qs[_0x0512('0x33')](_[_0x0512('0x34')](_0x48d2fd[_0x0512('0x2a')],_0x466ca4['filters']));if(_0x48d2fd[_0x0512('0x2a')][_0x0512('0x37')]){_0x35883a[_0x0512('0x32')]=_[_0x0512('0x35')](_0x35883a[_0x0512('0x32')],{'$or':_[_0x0512('0x24')](_0x35883a[_0x0512('0x2d')],function(_0x3a579f){var _0x5d81c4={};_0x5d81c4[_0x3a579f]={'$like':'%'+_0x48d2fd[_0x0512('0x2a')]['filter']+'%'};return _0x5d81c4;})});}_0x35883a=_['merge']({},_0x35883a,_0x48d2fd[_0x0512('0x38')]);return _0x25d6bb[_0x0512('0x4c')](_0x35883a);}})[_0x0512('0x1f')](function(_0x934a7c){if(_0x934a7c){_0x3b0d61=_0x934a7c[_0x0512('0x2f')];if(!_0x48d2fd[_0x0512('0x2a')][_0x0512('0x30')](_0x0512('0x4d'))){_0x35883a[_0x0512('0x1b')]=qs[_0x0512('0x1b')](_0x48d2fd['query']['limit']);_0x35883a[_0x0512('0x1a')]=qs[_0x0512('0x1a')](_0x48d2fd[_0x0512('0x2a')]['offset']);}return _0x25d6bb[_0x0512('0x4c')](_0x35883a);}})[_0x0512('0x1f')](function(_0x3024c1){if(_0x3024c1){return _0x3024c1?{'count':_0x3b0d61,'rows':_0x3024c1}:null;}})['then'](respondWithResult(_0x267af8,null))[_0x0512('0x42')](handleError(_0x267af8,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index c29c511..091b40f 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 _0x3f06=['tools_automations','util','api','moment','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','Automation'];(function(_0x50b378,_0x34adb1){var _0x29e608=function(_0x591db6){while(--_0x591db6){_0x50b378['push'](_0x50b378['shift']());}};_0x29e608(++_0x34adb1);}(_0x3f06,0x140));var _0x63f0=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x3f06[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x63f0('0x0'));var logger=require('../../config/logger')(_0x63f0('0x1'));var moment=require(_0x63f0('0x2'));var BPromise=require('bluebird');var rp=require(_0x63f0('0x3'));var fs=require('fs');var path=require(_0x63f0('0x4'));var rimraf=require(_0x63f0('0x5'));var config=require(_0x63f0('0x6'));var attributes=require(_0x63f0('0x7'));module[_0x63f0('0x8')]=function(_0x393e14,_0x1f1017){return _0x393e14['define'](_0x63f0('0x9'),attributes,{'tableName':_0x63f0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed3c=['util','../../config/logger','api','bluebird','request-promise','path','./automation.attributes','exports','lodash'];(function(_0x16acd3,_0x155170){var _0x541f3f=function(_0x4cee79){while(--_0x4cee79){_0x16acd3['push'](_0x16acd3['shift']());}};_0x541f3f(++_0x155170);}(_0xed3c,0x1a6));var _0xced3=function(_0x240362,_0x156794){_0x240362=_0x240362-0x0;var _0x26de18=_0xed3c[_0x240362];return _0x26de18;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var logger=require(_0xced3('0x2'))(_0xced3('0x3'));var moment=require('moment');var BPromise=require(_0xced3('0x4'));var rp=require(_0xced3('0x5'));var fs=require('fs');var path=require(_0xced3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xced3('0x7'));module[_0xced3('0x8')]=function(_0x2f92f8,_0x1cd694){return _0x2f92f8['define']('Automation',attributes,{'tableName':'tools_automations','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 927d5e5..91b9dc2 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 _0x3f45=['message','Automation,\x20%s,\x20%s','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1b660b,_0xccf3bc){var _0x42d2d7=function(_0x10ed91){while(--_0x10ed91){_0x1b660b['push'](_0x1b660b['shift']());}};_0x42d2d7(++_0xccf3bc);}(_0x3f45,0x115));var _0x53f4=function(_0x59008b,_0x75ea97){_0x59008b=_0x59008b-0x0;var _0x20359c=_0x3f45[_0x59008b];return _0x20359c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x53f4('0x0'));var rs=require(_0x53f4('0x1'));var fs=require('fs');var Redis=require(_0x53f4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x53f4('0x3'));var logger=require(_0x53f4('0x4'))(_0x53f4('0x5'));var config=require('../../config/environment');var jayson=require(_0x53f4('0x6'));var client=jayson[_0x53f4('0x7')][_0x53f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x501d2c,_0x2d0d7b,_0x3968fe){return new BPromise(function(_0x28387b,_0x16e621){return client[_0x53f4('0x9')](_0x501d2c,_0x3968fe)['then'](function(_0x336ad8){logger[_0x53f4('0xa')]('Automation,\x20%s,\x20%s',_0x2d0d7b,_0x53f4('0xb'));logger[_0x53f4('0xc')](_0x53f4('0xd'),_0x2d0d7b,_0x53f4('0xb'),JSON[_0x53f4('0xe')](_0x336ad8));if(_0x336ad8[_0x53f4('0xf')]){if(_0x336ad8[_0x53f4('0xf')][_0x53f4('0x10')]===0x1f4){logger[_0x53f4('0xf')]('Automation,\x20%s,\x20%s',_0x2d0d7b,_0x336ad8[_0x53f4('0xf')][_0x53f4('0x11')]);return _0x16e621(_0x336ad8['error'][_0x53f4('0x11')]);}logger[_0x53f4('0xf')](_0x53f4('0x12'),_0x2d0d7b,_0x336ad8[_0x53f4('0xf')][_0x53f4('0x11')]);return _0x28387b(_0x336ad8[_0x53f4('0xf')]['message']);}else{logger[_0x53f4('0xa')](_0x53f4('0x12'),_0x2d0d7b,_0x53f4('0xb'));_0x28387b(_0x336ad8[_0x53f4('0x13')][_0x53f4('0x11')]);}})[_0x53f4('0x14')](function(_0x3d0d11){logger['error']('Automation,\x20%s,\x20%s',_0x2d0d7b,_0x3d0d11);_0x16e621(_0x3d0d11);});});} \ No newline at end of file +var _0x4226=['debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then','Automation,\x20%s,\x20%s','request\x20sent'];(function(_0x2c9197,_0x37f2f2){var _0x3eed29=function(_0x42aef1){while(--_0x42aef1){_0x2c9197['push'](_0x2c9197['shift']());}};_0x3eed29(++_0x37f2f2);}(_0x4226,0x1dc));var _0x6422=function(_0x2d7dc5,_0x50877f){_0x2d7dc5=_0x2d7dc5-0x0;var _0x231489=_0x4226[_0x2d7dc5];return _0x231489;};'use strict';var _=require('lodash');var util=require(_0x6422('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6422('0x1'));var db=require(_0x6422('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x6422('0x3'))(_0x6422('0x4'));var config=require(_0x6422('0x5'));var jayson=require(_0x6422('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a2450,_0x1eb320,_0x5b6c6d){return new BPromise(function(_0x304998,_0xd422a2){return client['request'](_0x5a2450,_0x5b6c6d)[_0x6422('0x7')](function(_0x452be6){logger['info'](_0x6422('0x8'),_0x1eb320,_0x6422('0x9'));logger[_0x6422('0xa')](_0x6422('0xb'),_0x1eb320,_0x6422('0x9'),JSON[_0x6422('0xc')](_0x452be6));if(_0x452be6[_0x6422('0xd')]){if(_0x452be6[_0x6422('0xd')]['code']===0x1f4){logger[_0x6422('0xd')](_0x6422('0x8'),_0x1eb320,_0x452be6['error']['message']);return _0xd422a2(_0x452be6[_0x6422('0xd')][_0x6422('0xe')]);}logger['error'](_0x6422('0x8'),_0x1eb320,_0x452be6['error'][_0x6422('0xe')]);return _0x304998(_0x452be6[_0x6422('0xd')][_0x6422('0xe')]);}else{logger[_0x6422('0xf')]('Automation,\x20%s,\x20%s',_0x1eb320,_0x6422('0x9'));_0x304998(_0x452be6[_0x6422('0x10')][_0x6422('0xe')]);}})[_0x6422('0x11')](function(_0x5a05f5){logger[_0x6422('0xd')]('Automation,\x20%s,\x20%s',_0x1eb320,_0x5a05f5);_0xd422a2(_0x5a05f5);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 21eef88..ed6d627 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 _0xec33=['express','Router','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','/:id','delete','destroy','multer','util','path','connect-timeout'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xec33,0x1f4));var _0x3ec3=function(_0x1a0324,_0x59d611){_0x1a0324=_0x1a0324-0x0;var _0x2eba14=_0xec33[_0x1a0324];return _0x2eba14;};'use strict';var multer=require(_0x3ec3('0x0'));var util=require(_0x3ec3('0x1'));var path=require(_0x3ec3('0x2'));var timeout=require(_0x3ec3('0x3'));var express=require(_0x3ec3('0x4'));var router=express[_0x3ec3('0x5')]();var auth=require(_0x3ec3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3ec3('0x7'));var controller=require(_0x3ec3('0x8'));router[_0x3ec3('0x9')]('/',auth[_0x3ec3('0xa')](),controller['index']);router[_0x3ec3('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3ec3('0xb')]);router[_0x3ec3('0x9')](_0x3ec3('0xc'),auth['isAuthenticated'](),controller[_0x3ec3('0xd')]);router[_0x3ec3('0x9')](_0x3ec3('0xe'),auth['isAuthenticated'](),controller[_0x3ec3('0xf')]);router[_0x3ec3('0x10')]('/',auth[_0x3ec3('0xa')](),controller[_0x3ec3('0x11')]);router[_0x3ec3('0x10')](_0x3ec3('0xc'),auth['isAuthenticated'](),controller[_0x3ec3('0x12')]);router[_0x3ec3('0x10')](_0x3ec3('0xe'),auth[_0x3ec3('0xa')](),controller[_0x3ec3('0x13')]);router[_0x3ec3('0x14')](_0x3ec3('0x15'),auth[_0x3ec3('0xa')](),controller['update']);router[_0x3ec3('0x16')](_0x3ec3('0x15'),auth['isAuthenticated'](),controller[_0x3ec3('0x17')]);module['exports']=router; \ No newline at end of file +var _0x9782=['update','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','post','create','addConditions'];(function(_0x381606,_0x53382c){var _0x31c4ca=function(_0x310493){while(--_0x310493){_0x381606['push'](_0x381606['shift']());}};_0x31c4ca(++_0x53382c);}(_0x9782,0xf6));var _0x2978=function(_0x36684c,_0xbab67){_0x36684c=_0x36684c-0x0;var _0x51ab53=_0x9782[_0x36684c];return _0x51ab53;};'use strict';var multer=require(_0x2978('0x0'));var util=require(_0x2978('0x1'));var path=require('path');var timeout=require(_0x2978('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x2978('0x3'));var interaction=require(_0x2978('0x4'));var config=require(_0x2978('0x5'));var controller=require(_0x2978('0x6'));router[_0x2978('0x7')]('/',auth[_0x2978('0x8')](),controller[_0x2978('0x9')]);router['get'](_0x2978('0xa'),auth['isAuthenticated'](),controller[_0x2978('0xb')]);router[_0x2978('0x7')](_0x2978('0xc'),auth[_0x2978('0x8')](),controller[_0x2978('0xd')]);router[_0x2978('0x7')](_0x2978('0xe'),auth[_0x2978('0x8')](),controller['getActions']);router[_0x2978('0xf')]('/',auth[_0x2978('0x8')](),controller[_0x2978('0x10')]);router[_0x2978('0xf')](_0x2978('0xc'),auth[_0x2978('0x8')](),controller[_0x2978('0x11')]);router[_0x2978('0xf')]('/:id/actions',auth['isAuthenticated'](),controller['addActions']);router['put']('/:id',auth[_0x2978('0x8')](),controller[_0x2978('0x12')]);router[_0x2978('0x13')](_0x2978('0xa'),auth[_0x2978('0x8')](),controller[_0x2978('0x14')]);module[_0x2978('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index ec6fd11..d215a60 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 _0xa111=['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)','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa111,0x11f));var _0x1a11=function(_0x3a19b3,_0x41d2bf){_0x3a19b3=_0x3a19b3-0x0;var _0x8b0807=_0xa111[_0x3a19b3];return _0x8b0807;};'use strict';var Sequelize=require(_0x1a11('0x0'));module[_0x1a11('0x1')]={'name':{'type':Sequelize[_0x1a11('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1a11('0x3')](_0x1a11('0x4')),'allowNull':![],'defaultValue':_0x1a11('0x4')},'description':{'type':Sequelize[_0x1a11('0x2')]},'active':{'type':Sequelize[_0x1a11('0x5')],'defaultValue':0x0,'comment':_0x1a11('0x6')},'limitCalls':{'type':Sequelize[_0x1a11('0x7')](0x4)[_0x1a11('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1a11('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1a11('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1a11('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x1a11('0x7')](0x3)[_0x1a11('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a11('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1a11('0x7')](0x3)[_0x1a11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1a11('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1a11('0x7')](0x5)[_0x1a11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1a11('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x1a11('0x7')](0x3)[_0x1a11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x1a11('0x7')](0x5)[_0x1a11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1a11('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1a11('0x7')](0x3)[_0x1a11('0x8')],'defaultValue':0x3,'comment':_0x1a11('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1a11('0x7')](0x5)[_0x1a11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1a11('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1a11('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1a11('0x10')},'dialTimezone':{'type':Sequelize[_0x1a11('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1a11('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x1a11('0x11'),_0x1a11('0x12'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x1a11('0x5')],'defaultValue':0x0,'comment':_0x1a11('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1a11('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1a11('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1a11('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1a11('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1a11('0x7')](0x9)[_0x1a11('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1a11('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1a11('0x7')](0x9)[_0x1a11('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1a11('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1a11('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1a11('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1a11('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x1a11('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x1a11('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1a11('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1a11('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1a11('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1a11('0x3')]('DESC',_0x1a11('0x1b')),'defaultValue':_0x1a11('0x1c')},'dialPrefix':{'type':Sequelize[_0x1a11('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x1a11('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1a11('0x1d')}}; \ No newline at end of file +var _0xdac7=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x15376c,_0x4f2e2e){var _0x58f909=function(_0x37470f){while(--_0x37470f){_0x15376c['push'](_0x15376c['shift']());}};_0x58f909(++_0x4f2e2e);}(_0xdac7,0x1c0));var _0x7dac=function(_0x54a71e,_0x4884f4){_0x54a71e=_0x54a71e-0x0;var _0x33d0c3=_0xdac7[_0x54a71e];return _0x33d0c3;};'use strict';var Sequelize=require(_0x7dac('0x0'));module[_0x7dac('0x1')]={'name':{'type':Sequelize[_0x7dac('0x2')],'unique':_0x7dac('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7dac('0x4')](_0x7dac('0x5')),'allowNull':![],'defaultValue':_0x7dac('0x5')},'description':{'type':Sequelize[_0x7dac('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x7dac('0x6')},'limitCalls':{'type':Sequelize[_0x7dac('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7dac('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7dac('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7dac('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7dac('0x7')](0x3)[_0x7dac('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7dac('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7dac('0x7')](0x3)[_0x7dac('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7dac('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7dac('0x7')](0x5)[_0x7dac('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7dac('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7dac('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7dac('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7dac('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7dac('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x7dac('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7dac('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x7dac('0x7')](0x3)[_0x7dac('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7dac('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7dac('0x2')],'defaultValue':_0x7dac('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x7dac('0x4')](_0x7dac('0x12'),_0x7dac('0x13'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x7dac('0x14')],'defaultValue':0x0,'comment':_0x7dac('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x7dac('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7dac('0x16')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x7dac('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7dac('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7dac('0x7')](0x9)[_0x7dac('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7dac('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x7dac('0x7')](0x9)[_0x7dac('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7dac('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7dac('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7dac('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7dac('0x7')](0x9)[_0x7dac('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7dac('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7dac('0x7')](0x5)[_0x7dac('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7dac('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7dac('0x7')](0x9)[_0x7dac('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7dac('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7dac('0x4')]('DESC',_0x7dac('0x1e')),'defaultValue':_0x7dac('0x1f')},'dialPrefix':{'type':Sequelize[_0x7dac('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7dac('0x7')](0x3)[_0x7dac('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7dac('0x20')},'dialCutDigit':{'type':Sequelize[_0x7dac('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7dac('0x21')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index d569267..10b8943 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 _0xbdb7=['findOne','CmHopperHistory','hasOwnProperty','nolimit','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','from','sequelize','all','removeLists','addBlackLists','spread','push','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','count','offset','limit','status','set','json','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','order','sort','where','filters','pick','filter','merge','VIRTUAL','Campaign','include','findAll','rows','intersection','length','includeAll','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','omit','updatedAt','user','UserProfileSection','getHoppers','CmHopper','CampaignId','getHopperHistories'];(function(_0x5989e9,_0xef6905){var _0xac49f2=function(_0xa5ab7c){while(--_0xa5ab7c){_0x5989e9['push'](_0x5989e9['shift']());}};_0xac49f2(++_0xef6905);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x221eae,_0x2a3fa6){_0x221eae=_0x221eae-0x0;var _0x86f9f3=_0xbdb7[_0x221eae];return _0x86f9f3;};'use strict';var pdf=require(_0x7bdb('0x0'));var emlformat=require(_0x7bdb('0x1'));var rimraf=require(_0x7bdb('0x2'));var zipdir=require(_0x7bdb('0x3'));var jsonpatch=require(_0x7bdb('0x4'));var rp=require(_0x7bdb('0x5'));var moment=require(_0x7bdb('0x6'));var BPromise=require(_0x7bdb('0x7'));var Mustache=require(_0x7bdb('0x8'));var util=require('util');var path=require(_0x7bdb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7bdb('0xa'));var fs=require('fs');var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3053d0,_0x25e3cb){_0x25e3cb=_0x25e3cb||0xcc;return function(_0x496613){if(_0x496613){return _0x3053d0[_0x7bdb('0x16')](_0x25e3cb);}return _0x3053d0['status'](_0x25e3cb)['end']();};}function respondWithResult(_0x2abca6,_0x46dd4a){_0x46dd4a=_0x46dd4a||0xc8;return function(_0x4fd91a){if(_0x4fd91a){return _0x2abca6['status'](_0x46dd4a)['json'](_0x4fd91a);}};}function respondWithFilteredResult(_0x4476ff,_0x195b2e){return function(_0xe9919f){if(_0xe9919f){var _0x25d417=_0xe9919f[_0x7bdb('0x17')],_0x31c909=_0x195b2e['offset'],_0xbde12a=_0x195b2e[_0x7bdb('0x18')]+_0x195b2e[_0x7bdb('0x19')],_0x3e96ac;if(_0xbde12a>=_0x25d417){_0xbde12a=_0x25d417;_0x3e96ac=0xc8;}else{_0x3e96ac=0xce;}_0x4476ff[_0x7bdb('0x1a')](_0x3e96ac);return _0x4476ff[_0x7bdb('0x1b')]('Content-Range',_0x31c909+'-'+_0xbde12a+'/'+_0x25d417)[_0x7bdb('0x1c')](_0xe9919f);}return null;};}function patchUpdates(_0x23e9eb){return function(_0x5b8481){try{jsonpatch[_0x7bdb('0x1d')](_0x5b8481,_0x23e9eb,!![]);}catch(_0x31f78e){return BPromise[_0x7bdb('0x1e')](_0x31f78e);}return _0x5b8481[_0x7bdb('0x1f')]();};}function saveUpdates(_0x112793,_0x5bfc35){return function(_0x49f353){if(_0x49f353){return _0x49f353[_0x7bdb('0x20')](_0x112793)[_0x7bdb('0x21')](function(_0x5daea4){return _0x5daea4;});}return null;};}function removeEntity(_0x341fe4,_0x118ea1){return function(_0x346c72){if(_0x346c72){return _0x346c72[_0x7bdb('0x22')]()[_0x7bdb('0x21')](function(){var _0x4d668e=_0x346c72[_0x7bdb('0x23')]({'plain':!![]});var _0xdad53d=_0x7bdb('0x24');return db[_0x7bdb('0x25')]['destroy']({'where':{'type':_0xdad53d,'resourceId':_0x4d668e['id']}})['then'](function(){return _0x346c72;});})[_0x7bdb('0x21')](function(){_0x341fe4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a9e02,_0x2abef6){return function(_0x51ab04){if(!_0x51ab04){_0x4a9e02[_0x7bdb('0x16')](0x194);}return _0x51ab04;};}function handleError(_0x72ba69,_0x3ec129){_0x3ec129=_0x3ec129||0x1f4;return function(_0x7c09cf){logger[_0x7bdb('0x26')](_0x7c09cf['stack']);if(_0x7c09cf[_0x7bdb('0x27')]){delete _0x7c09cf[_0x7bdb('0x27')];}_0x72ba69[_0x7bdb('0x1a')](_0x3ec129)[_0x7bdb('0x28')](_0x7c09cf);};}exports[_0x7bdb('0x29')]=function(_0x2e8e65,_0x1e9996){var _0xd2d7be={},_0x25a1fe={},_0x365c02={'count':0x0,'rows':[]};var _0x9ec48d=_[_0x7bdb('0x2a')](db['Campaign'][_0x7bdb('0x2b')],function(_0x23fc3a){return{'name':_0x23fc3a[_0x7bdb('0x2c')],'type':_0x23fc3a[_0x7bdb('0x2d')][_0x7bdb('0x2e')]};});_0x25a1fe['model']=_[_0x7bdb('0x2a')](_0x9ec48d,_0x7bdb('0x27'));_0x25a1fe[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x2e8e65['query']);_0x25a1fe['filters']=_['intersection'](_0x25a1fe[_0x7bdb('0x31')],_0x25a1fe['query']);_0xd2d7be[_0x7bdb('0x32')]=_['intersection'](_0x25a1fe[_0x7bdb('0x31')],qs[_0x7bdb('0x33')](_0x2e8e65[_0x7bdb('0x2f')]['fields']));_0xd2d7be[_0x7bdb('0x32')]=_0xd2d7be['attributes']['length']?_0xd2d7be[_0x7bdb('0x32')]:_0x25a1fe['model'];if(!_0x2e8e65[_0x7bdb('0x2f')]['hasOwnProperty']('nolimit')){_0xd2d7be[_0x7bdb('0x19')]=qs[_0x7bdb('0x19')](_0x2e8e65[_0x7bdb('0x2f')][_0x7bdb('0x19')]);_0xd2d7be[_0x7bdb('0x18')]=qs[_0x7bdb('0x18')](_0x2e8e65['query'][_0x7bdb('0x18')]);}_0xd2d7be[_0x7bdb('0x34')]=qs[_0x7bdb('0x35')](_0x2e8e65[_0x7bdb('0x2f')][_0x7bdb('0x35')]);_0xd2d7be[_0x7bdb('0x36')]=qs[_0x7bdb('0x37')](_[_0x7bdb('0x38')](_0x2e8e65[_0x7bdb('0x2f')],_0x25a1fe['filters']));if(_0x2e8e65['query'][_0x7bdb('0x39')]){_0xd2d7be[_0x7bdb('0x36')]=_[_0x7bdb('0x3a')](_0xd2d7be[_0x7bdb('0x36')],{'$or':_[_0x7bdb('0x2a')](_0x9ec48d,function(_0x509e90){if(_0x509e90['type']!==_0x7bdb('0x3b')){var _0x5d7c1f={};_0x5d7c1f[_0x509e90[_0x7bdb('0x27')]]={'$like':'%'+_0x2e8e65['query'][_0x7bdb('0x39')]+'%'};return _0x5d7c1f;}})});}_0xd2d7be=_['merge']({},_0xd2d7be,_0x2e8e65['options']);var _0x21dae7={'where':_0xd2d7be[_0x7bdb('0x36')]};return db[_0x7bdb('0x3c')][_0x7bdb('0x17')](_0x21dae7)[_0x7bdb('0x21')](function(_0x2b4829){_0x365c02[_0x7bdb('0x17')]=_0x2b4829;if(_0x2e8e65['query']['includeAll']){_0xd2d7be[_0x7bdb('0x3d')]=[{'all':!![]}];}return db[_0x7bdb('0x3c')][_0x7bdb('0x3e')](_0xd2d7be);})[_0x7bdb('0x21')](function(_0x39fbca){_0x365c02[_0x7bdb('0x3f')]=_0x39fbca;return _0x365c02;})[_0x7bdb('0x21')](respondWithFilteredResult(_0x1e9996,_0xd2d7be))['catch'](handleError(_0x1e9996,null));};exports['show']=function(_0x1bcbcd,_0x8e893e){var _0x4636f8={'raw':![],'where':{'id':_0x1bcbcd['params']['id']}},_0x72a81c={};_0x72a81c[_0x7bdb('0x31')]=_['keys'](db[_0x7bdb('0x3c')][_0x7bdb('0x2b')]);_0x72a81c[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x1bcbcd[_0x7bdb('0x2f')]);_0x72a81c[_0x7bdb('0x37')]=_[_0x7bdb('0x40')](_0x72a81c[_0x7bdb('0x31')],_0x72a81c[_0x7bdb('0x2f')]);_0x4636f8['attributes']=_[_0x7bdb('0x40')](_0x72a81c[_0x7bdb('0x31')],qs['fields'](_0x1bcbcd[_0x7bdb('0x2f')]['fields']));_0x4636f8[_0x7bdb('0x32')]=_0x4636f8[_0x7bdb('0x32')][_0x7bdb('0x41')]?_0x4636f8[_0x7bdb('0x32')]:_0x72a81c[_0x7bdb('0x31')];if(_0x1bcbcd['query'][_0x7bdb('0x42')]){_0x4636f8[_0x7bdb('0x3d')]=[{'all':!![]}];}_0x4636f8=_[_0x7bdb('0x3a')]({},_0x4636f8,_0x1bcbcd[_0x7bdb('0x43')]);return db[_0x7bdb('0x3c')]['find'](_0x4636f8)[_0x7bdb('0x21')](handleEntityNotFound(_0x8e893e,null))[_0x7bdb('0x21')](respondWithResult(_0x8e893e,null))[_0x7bdb('0x44')](handleError(_0x8e893e,null));};exports[_0x7bdb('0x45')]=function(_0x259007,_0x25c534){return db[_0x7bdb('0x3c')][_0x7bdb('0x45')](_0x259007[_0x7bdb('0x46')],{})[_0x7bdb('0x21')](function(_0x58e21d){var _0x189cf8=_0x259007['user']['get']({'plain':!![]});if(!_0x189cf8)throw new Error(_0x7bdb('0x47'));if(_0x189cf8[_0x7bdb('0x48')]==='user'){var _0x37780a=_0x58e21d[_0x7bdb('0x23')]({'plain':!![]});var _0x5ea9ef='IvrCampaigns';return db['UserProfileSection'][_0x7bdb('0x49')]({'where':{'name':_0x5ea9ef,'userProfileId':_0x189cf8[_0x7bdb('0x4a')]},'raw':!![]})[_0x7bdb('0x21')](function(_0x46410c){if(_0x46410c&&_0x46410c[_0x7bdb('0x4b')]===0x0){return db[_0x7bdb('0x25')][_0x7bdb('0x45')]({'name':_0x37780a[_0x7bdb('0x27')],'resourceId':_0x37780a['id'],'type':_0x46410c[_0x7bdb('0x27')],'sectionId':_0x46410c['id']},{})[_0x7bdb('0x21')](function(){return _0x58e21d;});}else{return _0x58e21d;}})['catch'](function(_0x299ef0){logger['error'](_0x7bdb('0x4c'),_0x299ef0);throw _0x299ef0;});}return _0x58e21d;})[_0x7bdb('0x21')](respondWithResult(_0x25c534,0xc9))[_0x7bdb('0x44')](handleError(_0x25c534,null));};exports[_0x7bdb('0x4d')]=function(_0x493d23,_0x258f29){var _0x5c79a8={'where':{'id':_0x493d23[_0x7bdb('0x4e')]['id']}},_0x533c3b={};_0x533c3b[_0x7bdb('0x31')]=_['keys'](db['Campaign']['rawAttributes']);_0x5c79a8[_0x7bdb('0x32')]=_['intersection'](_0x533c3b['model'],qs[_0x7bdb('0x33')](_0x493d23[_0x7bdb('0x2f')][_0x7bdb('0x33')]));_0x5c79a8[_0x7bdb('0x32')]=_0x5c79a8['attributes'][_0x7bdb('0x41')]?_0x5c79a8['attributes']:_0x533c3b[_0x7bdb('0x31')];if(_0x493d23[_0x7bdb('0x2f')][_0x7bdb('0x42')]){_0x5c79a8[_0x7bdb('0x3d')]=[{'all':!![]}];}_0x5c79a8=_[_0x7bdb('0x3a')]({},_0x5c79a8,_0x493d23[_0x7bdb('0x43')]);return db['Campaign'][_0x7bdb('0x49')](_0x5c79a8)[_0x7bdb('0x21')](handleEntityNotFound(_0x258f29,null))[_0x7bdb('0x21')](function(_0x58658e){if(_0x58658e){var _0x2b5493=_0x58658e[_0x7bdb('0x23')]({'plain':!![]});_0x2b5493=qs['omit'](_0x2b5493,['id',_0x7bdb('0x4f'),'updatedAt']);_0x493d23[_0x7bdb('0x46')]=_[_0x7bdb('0x50')](_0x493d23['body'],['id','createdAt',_0x7bdb('0x51')]);return db[_0x7bdb('0x3c')]['create'](_[_0x7bdb('0x3a')](_0x2b5493,_0x493d23['body']),{'include':_0x493d23[_0x7bdb('0x2f')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x22ef9c){var _0x2d4b59=_0x493d23[_0x7bdb('0x52')][_0x7bdb('0x23')]({'plain':!![]});if(!_0x2d4b59)throw new Error(_0x7bdb('0x47'));if(_0x2d4b59[_0x7bdb('0x48')]===_0x7bdb('0x52')){var _0x8cf13a=_0x22ef9c[_0x7bdb('0x23')]({'plain':!![]});var _0x19f99f=_0x7bdb('0x24');return db[_0x7bdb('0x53')]['find']({'where':{'name':_0x19f99f,'userProfileId':_0x2d4b59[_0x7bdb('0x4a')]},'raw':!![]})[_0x7bdb('0x21')](function(_0x52cf54){if(_0x52cf54&&_0x52cf54[_0x7bdb('0x4b')]===0x0){return db[_0x7bdb('0x25')][_0x7bdb('0x45')]({'name':_0x8cf13a[_0x7bdb('0x27')],'resourceId':_0x8cf13a['id'],'type':_0x52cf54[_0x7bdb('0x27')],'sectionId':_0x52cf54['id']},{})['then'](function(){return _0x22ef9c;});}else{return _0x22ef9c;}})[_0x7bdb('0x44')](function(_0x30f825){logger[_0x7bdb('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30f825);throw _0x30f825;});}return _0x22ef9c;});}})[_0x7bdb('0x21')](respondWithResult(_0x258f29,0xc9))[_0x7bdb('0x44')](handleError(_0x258f29,null));};exports[_0x7bdb('0x20')]=function(_0x11ec61,_0x30d069){if(_0x11ec61[_0x7bdb('0x46')]['id']){delete _0x11ec61[_0x7bdb('0x46')]['id'];}return db[_0x7bdb('0x3c')][_0x7bdb('0x49')]({'where':{'id':_0x11ec61['params']['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x30d069,null))[_0x7bdb('0x21')](saveUpdates(_0x11ec61[_0x7bdb('0x46')],null))[_0x7bdb('0x21')](respondWithResult(_0x30d069,null))[_0x7bdb('0x44')](handleError(_0x30d069,null));};exports[_0x7bdb('0x22')]=function(_0x22aa65,_0x86c6ed){return db[_0x7bdb('0x3c')][_0x7bdb('0x49')]({'where':{'id':_0x22aa65[_0x7bdb('0x4e')]['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x86c6ed,null))[_0x7bdb('0x21')](removeEntity(_0x86c6ed,null))['catch'](handleError(_0x86c6ed,null));};exports[_0x7bdb('0x54')]=function(_0x4d878f,_0x1ca2e0,_0x4030eb){var _0x24f19e={'raw':!![],'where':{}};var _0x52ffb5={};var _0xd57d33={'count':0x0,'rows':[]};return db[_0x7bdb('0x3c')]['findOne']({'where':{'id':_0x4d878f[_0x7bdb('0x4e')]['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x1ca2e0,null))['then'](function(_0x1c4525){if(_0x1c4525){_0x52ffb5[_0x7bdb('0x31')]=_['keys'](db[_0x7bdb('0x55')][_0x7bdb('0x2b')]);_0x52ffb5['query']=_[_0x7bdb('0x30')](_0x4d878f[_0x7bdb('0x2f')]);_0x52ffb5['filters']=_[_0x7bdb('0x40')](_0x52ffb5['model'],_0x52ffb5[_0x7bdb('0x2f')]);_0x24f19e[_0x7bdb('0x32')]=_[_0x7bdb('0x40')](_0x52ffb5[_0x7bdb('0x31')],qs[_0x7bdb('0x33')](_0x4d878f['query']['fields']));_0x24f19e['attributes']=_0x24f19e[_0x7bdb('0x32')]['length']?_0x24f19e[_0x7bdb('0x32')]:_0x52ffb5[_0x7bdb('0x31')];if(!_0x4d878f[_0x7bdb('0x2f')]['hasOwnProperty']('nolimit')){_0x24f19e[_0x7bdb('0x19')]=qs[_0x7bdb('0x19')](_0x4d878f[_0x7bdb('0x2f')][_0x7bdb('0x19')]);_0x24f19e['offset']=qs[_0x7bdb('0x18')](_0x4d878f[_0x7bdb('0x2f')][_0x7bdb('0x18')]);}_0x24f19e[_0x7bdb('0x34')]=qs[_0x7bdb('0x35')](_0x4d878f[_0x7bdb('0x2f')]['sort']);_0x24f19e[_0x7bdb('0x36')]=qs['filters'](_[_0x7bdb('0x38')](_0x4d878f['query'],_0x52ffb5[_0x7bdb('0x37')]));_0x24f19e[_0x7bdb('0x36')][_0x7bdb('0x56')]=_0x1c4525['id'];if(_0x4d878f[_0x7bdb('0x2f')][_0x7bdb('0x39')]){_0x24f19e['where']=_['merge'](_0x24f19e[_0x7bdb('0x36')],{'$or':_[_0x7bdb('0x2a')](_0x24f19e['attributes'],function(_0x415ec5){var _0x2d5991={};_0x2d5991[_0x415ec5]={'$like':'%'+_0x4d878f['query'][_0x7bdb('0x39')]+'%'};return _0x2d5991;})});}_0x24f19e=_[_0x7bdb('0x3a')]({},_0x24f19e,_0x4d878f['options']);return db[_0x7bdb('0x55')]['count']({'where':_0x24f19e['where']})[_0x7bdb('0x21')](function(_0x43e097){_0xd57d33['count']=_0x43e097;if(_0x4d878f['query'][_0x7bdb('0x42')]){_0x24f19e['include']=[{'all':!![]}];}return db[_0x7bdb('0x55')]['findAll'](_0x24f19e);})[_0x7bdb('0x21')](function(_0x1570c8){_0xd57d33[_0x7bdb('0x3f')]=_0x1570c8;return _0xd57d33;});}})[_0x7bdb('0x21')](respondWithFilteredResult(_0x1ca2e0,_0x24f19e))['catch'](handleError(_0x1ca2e0,null));};exports[_0x7bdb('0x57')]=function(_0x231f9c,_0x587e9c,_0x2be441){var _0x3096e0={'raw':!![],'where':{}};var _0x4d8e23={};var _0x1774a4={'count':0x0,'rows':[]};return db[_0x7bdb('0x3c')][_0x7bdb('0x58')]({'where':{'id':_0x231f9c[_0x7bdb('0x4e')]['id']}})['then'](handleEntityNotFound(_0x587e9c,null))[_0x7bdb('0x21')](function(_0x5af736){if(_0x5af736){_0x4d8e23[_0x7bdb('0x31')]=_[_0x7bdb('0x30')](db[_0x7bdb('0x59')]['rawAttributes']);_0x4d8e23[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x231f9c[_0x7bdb('0x2f')]);_0x4d8e23[_0x7bdb('0x37')]=_[_0x7bdb('0x40')](_0x4d8e23[_0x7bdb('0x31')],_0x4d8e23[_0x7bdb('0x2f')]);_0x3096e0[_0x7bdb('0x32')]=_[_0x7bdb('0x40')](_0x4d8e23[_0x7bdb('0x31')],qs[_0x7bdb('0x33')](_0x231f9c[_0x7bdb('0x2f')][_0x7bdb('0x33')]));_0x3096e0[_0x7bdb('0x32')]=_0x3096e0[_0x7bdb('0x32')][_0x7bdb('0x41')]?_0x3096e0[_0x7bdb('0x32')]:_0x4d8e23[_0x7bdb('0x31')];if(!_0x231f9c['query'][_0x7bdb('0x5a')](_0x7bdb('0x5b'))){_0x3096e0[_0x7bdb('0x19')]=qs[_0x7bdb('0x19')](_0x231f9c[_0x7bdb('0x2f')][_0x7bdb('0x19')]);_0x3096e0[_0x7bdb('0x18')]=qs[_0x7bdb('0x18')](_0x231f9c[_0x7bdb('0x2f')][_0x7bdb('0x18')]);}_0x3096e0[_0x7bdb('0x34')]=qs['sort'](_0x231f9c['query']['sort']);_0x3096e0[_0x7bdb('0x36')]=qs[_0x7bdb('0x37')](_['pick'](_0x231f9c[_0x7bdb('0x2f')],_0x4d8e23[_0x7bdb('0x37')]));_0x3096e0['where']['CampaignId']=_0x5af736['id'];if(_0x231f9c['query'][_0x7bdb('0x39')]){_0x3096e0['where']=_['merge'](_0x3096e0['where'],{'$or':_[_0x7bdb('0x2a')](_0x3096e0[_0x7bdb('0x32')],function(_0x32ef5e){var _0x535a06={};_0x535a06[_0x32ef5e]={'$like':'%'+_0x231f9c[_0x7bdb('0x2f')][_0x7bdb('0x39')]+'%'};return _0x535a06;})});}_0x3096e0=_[_0x7bdb('0x3a')]({},_0x3096e0,_0x231f9c[_0x7bdb('0x43')]);return db['CmHopperHistory'][_0x7bdb('0x17')]({'where':_0x3096e0['where']})[_0x7bdb('0x21')](function(_0x1bb65a){_0x1774a4[_0x7bdb('0x17')]=_0x1bb65a;if(_0x231f9c['query'][_0x7bdb('0x42')]){_0x3096e0[_0x7bdb('0x3d')]=[{'all':!![]}];}return db[_0x7bdb('0x59')]['findAll'](_0x3096e0);})[_0x7bdb('0x21')](function(_0x172daf){_0x1774a4['rows']=_0x172daf;return _0x1774a4;});}})[_0x7bdb('0x21')](respondWithFilteredResult(_0x587e9c,_0x3096e0))[_0x7bdb('0x44')](handleError(_0x587e9c,null));};exports['getHopperFinals']=function(_0x23051a,_0x2a5c32,_0x5d6ca3){var _0x1fef3e={'raw':!![],'where':{}};var _0x1054f1={};var _0x4ce4d8={'count':0x0,'rows':[]};return db[_0x7bdb('0x3c')]['findOne']({'where':{'id':_0x23051a[_0x7bdb('0x4e')]['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x2a5c32,null))[_0x7bdb('0x21')](function(_0x4b7730){if(_0x4b7730){_0x1054f1[_0x7bdb('0x31')]=_['keys'](db[_0x7bdb('0x5c')]['rawAttributes']);_0x1054f1[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x23051a[_0x7bdb('0x2f')]);_0x1054f1[_0x7bdb('0x37')]=_[_0x7bdb('0x40')](_0x1054f1['model'],_0x1054f1['query']);_0x1fef3e[_0x7bdb('0x32')]=_[_0x7bdb('0x40')](_0x1054f1[_0x7bdb('0x31')],qs[_0x7bdb('0x33')](_0x23051a['query'][_0x7bdb('0x33')]));_0x1fef3e[_0x7bdb('0x32')]=_0x1fef3e['attributes'][_0x7bdb('0x41')]?_0x1fef3e[_0x7bdb('0x32')]:_0x1054f1['model'];if(!_0x23051a[_0x7bdb('0x2f')][_0x7bdb('0x5a')](_0x7bdb('0x5b'))){_0x1fef3e[_0x7bdb('0x19')]=qs[_0x7bdb('0x19')](_0x23051a[_0x7bdb('0x2f')][_0x7bdb('0x19')]);_0x1fef3e[_0x7bdb('0x18')]=qs['offset'](_0x23051a['query'][_0x7bdb('0x18')]);}_0x1fef3e[_0x7bdb('0x34')]=qs[_0x7bdb('0x35')](_0x23051a[_0x7bdb('0x2f')][_0x7bdb('0x35')]);_0x1fef3e[_0x7bdb('0x36')]=qs['filters'](_[_0x7bdb('0x38')](_0x23051a[_0x7bdb('0x2f')],_0x1054f1[_0x7bdb('0x37')]));_0x1fef3e[_0x7bdb('0x36')]['CampaignId']=_0x4b7730['id'];if(_0x23051a[_0x7bdb('0x2f')][_0x7bdb('0x39')]){_0x1fef3e['where']=_[_0x7bdb('0x3a')](_0x1fef3e[_0x7bdb('0x36')],{'$or':_[_0x7bdb('0x2a')](_0x1fef3e['attributes'],function(_0x59178f){var _0x35d3c6={};_0x35d3c6[_0x59178f]={'$like':'%'+_0x23051a['query']['filter']+'%'};return _0x35d3c6;})});}_0x1fef3e=_[_0x7bdb('0x3a')]({},_0x1fef3e,_0x23051a['options']);return db[_0x7bdb('0x5c')]['count']({'where':_0x1fef3e['where']})[_0x7bdb('0x21')](function(_0x5b5999){_0x4ce4d8[_0x7bdb('0x17')]=_0x5b5999;if(_0x23051a[_0x7bdb('0x2f')]['includeAll']){_0x1fef3e[_0x7bdb('0x3d')]=[{'all':!![]}];}return db[_0x7bdb('0x5c')][_0x7bdb('0x3e')](_0x1fef3e);})[_0x7bdb('0x21')](function(_0x489a79){_0x4ce4d8[_0x7bdb('0x3f')]=_0x489a79;return _0x4ce4d8;});}})['then'](respondWithFilteredResult(_0x2a5c32,_0x1fef3e))[_0x7bdb('0x44')](handleError(_0x2a5c32,null));};exports[_0x7bdb('0x5d')]=function(_0x3c5f95,_0x199e4b,_0x4ebf68){var _0x50af73={'raw':!![],'where':{}};var _0x200386={};var _0x1803f7={'count':0x0,'rows':[]};return db[_0x7bdb('0x3c')]['findOne']({'where':{'id':_0x3c5f95[_0x7bdb('0x4e')]['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x199e4b,null))['then'](function(_0x3a004b){if(_0x3a004b){_0x200386['model']=_[_0x7bdb('0x30')](db[_0x7bdb('0x5e')]['rawAttributes']);_0x200386[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x3c5f95[_0x7bdb('0x2f')]);_0x200386[_0x7bdb('0x37')]=_[_0x7bdb('0x40')](_0x200386[_0x7bdb('0x31')],_0x200386[_0x7bdb('0x2f')]);_0x50af73[_0x7bdb('0x32')]=_[_0x7bdb('0x40')](_0x200386[_0x7bdb('0x31')],qs['fields'](_0x3c5f95[_0x7bdb('0x2f')]['fields']));_0x50af73[_0x7bdb('0x32')]=_0x50af73[_0x7bdb('0x32')][_0x7bdb('0x41')]?_0x50af73[_0x7bdb('0x32')]:_0x200386[_0x7bdb('0x31')];if(!_0x3c5f95[_0x7bdb('0x2f')]['hasOwnProperty'](_0x7bdb('0x5b'))){_0x50af73['limit']=qs['limit'](_0x3c5f95[_0x7bdb('0x2f')][_0x7bdb('0x19')]);_0x50af73[_0x7bdb('0x18')]=qs[_0x7bdb('0x18')](_0x3c5f95[_0x7bdb('0x2f')][_0x7bdb('0x18')]);}_0x50af73['order']=qs[_0x7bdb('0x35')](_0x3c5f95[_0x7bdb('0x2f')][_0x7bdb('0x35')]);_0x50af73[_0x7bdb('0x36')]=qs['filters'](_['pick'](_0x3c5f95[_0x7bdb('0x2f')],_0x200386['filters']));_0x50af73[_0x7bdb('0x36')][_0x7bdb('0x56')]=_0x3a004b['id'];if(_0x3c5f95['query']['filter']){_0x50af73[_0x7bdb('0x36')]=_[_0x7bdb('0x3a')](_0x50af73['where'],{'$or':_[_0x7bdb('0x2a')](_0x50af73[_0x7bdb('0x32')],function(_0x6287f8){var _0x5289cb={};_0x5289cb[_0x6287f8]={'$like':'%'+_0x3c5f95['query'][_0x7bdb('0x39')]+'%'};return _0x5289cb;})});}_0x50af73=_[_0x7bdb('0x3a')]({},_0x50af73,_0x3c5f95['options']);return db[_0x7bdb('0x5e')]['count']({'where':_0x50af73[_0x7bdb('0x36')]})[_0x7bdb('0x21')](function(_0x3f96dc){_0x1803f7['count']=_0x3f96dc;if(_0x3c5f95['query']['includeAll']){_0x50af73[_0x7bdb('0x3d')]=[{'all':!![]}];}return db[_0x7bdb('0x5e')][_0x7bdb('0x3e')](_0x50af73);})['then'](function(_0x2bce33){_0x1803f7[_0x7bdb('0x3f')]=_0x2bce33;return _0x1803f7;});}})[_0x7bdb('0x21')](respondWithFilteredResult(_0x199e4b,_0x50af73))[_0x7bdb('0x44')](handleError(_0x199e4b,null));};exports[_0x7bdb('0x5f')]=function(_0x3d9c81,_0x522a5b,_0x55a347){var _0x31e8bf={};var _0x1c3439={};var _0x51c2a0;var _0x4998cd;return db[_0x7bdb('0x3c')]['findOne']({'where':{'id':_0x3d9c81['params']['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x522a5b,null))[_0x7bdb('0x21')](function(_0x1793f1){if(_0x1793f1){_0x51c2a0=_0x1793f1;_0x1c3439[_0x7bdb('0x31')]=_['keys'](db[_0x7bdb('0x60')][_0x7bdb('0x2b')]);_0x1c3439[_0x7bdb('0x2f')]=_['keys'](_0x3d9c81[_0x7bdb('0x2f')]);_0x1c3439[_0x7bdb('0x37')]=_[_0x7bdb('0x40')](_0x1c3439[_0x7bdb('0x31')],_0x1c3439['query']);_0x31e8bf[_0x7bdb('0x32')]=_[_0x7bdb('0x40')](_0x1c3439['model'],qs[_0x7bdb('0x33')](_0x3d9c81['query']['fields']));_0x31e8bf[_0x7bdb('0x32')]=_0x31e8bf[_0x7bdb('0x32')][_0x7bdb('0x41')]?_0x31e8bf[_0x7bdb('0x32')]:_0x1c3439[_0x7bdb('0x31')];_0x31e8bf[_0x7bdb('0x34')]=qs['sort'](_0x3d9c81['query'][_0x7bdb('0x35')]);_0x31e8bf['where']=qs[_0x7bdb('0x37')](_[_0x7bdb('0x38')](_0x3d9c81[_0x7bdb('0x2f')],_0x1c3439[_0x7bdb('0x37')]));if(_0x3d9c81[_0x7bdb('0x2f')][_0x7bdb('0x39')]){_0x31e8bf['where']=_['merge'](_0x31e8bf['where'],{'$or':_[_0x7bdb('0x2a')](_0x31e8bf['attributes'],function(_0x22f50a){var _0x30b5d1={};_0x30b5d1[_0x22f50a]={'$like':'%'+_0x3d9c81[_0x7bdb('0x2f')]['filter']+'%'};return _0x30b5d1;})});}_0x31e8bf=_[_0x7bdb('0x3a')]({},_0x31e8bf,_0x3d9c81[_0x7bdb('0x43')]);return _0x51c2a0[_0x7bdb('0x5f')](_0x31e8bf);}})[_0x7bdb('0x21')](function(_0x2a6b18){if(_0x2a6b18){_0x4998cd=_0x2a6b18[_0x7bdb('0x41')];if(!_0x3d9c81['query'][_0x7bdb('0x5a')](_0x7bdb('0x5b'))){_0x31e8bf[_0x7bdb('0x19')]=qs[_0x7bdb('0x19')](_0x3d9c81[_0x7bdb('0x2f')]['limit']);_0x31e8bf[_0x7bdb('0x18')]=qs['offset'](_0x3d9c81[_0x7bdb('0x2f')][_0x7bdb('0x18')]);}return _0x51c2a0[_0x7bdb('0x5f')](_0x31e8bf);}})[_0x7bdb('0x21')](function(_0x164f67){if(_0x164f67){return _0x164f67?{'count':_0x4998cd,'rows':_0x164f67}:null;}})[_0x7bdb('0x21')](respondWithResult(_0x522a5b,null))[_0x7bdb('0x44')](handleError(_0x522a5b,null));};exports[_0x7bdb('0x61')]=function(_0x42f8e4,_0x15da37,_0x5344d1){var _0x1ea2ab,_0xe902d0;return db[_0x7bdb('0x3c')]['find']({'where':{'id':_0x42f8e4['params']['id']}})['then'](handleEntityNotFound(_0x15da37,null))['then'](function(_0x1c442b){if(_0x1c442b){_0xe902d0=_0x1c442b;return _0x1c442b[_0x7bdb('0x61')](_0x42f8e4[_0x7bdb('0x46')][_0x7bdb('0x62')],_['omit'](_0x42f8e4[_0x7bdb('0x46')],[_0x7bdb('0x62'),'id'])||{});}return null;})['spread'](function(_0x50899a){var _0x3905c4;_0x1ea2ab=_0x50899a||[];var _0x15825b=[];if(_0x50899a){for(var _0x242725=0x0;_0x242725<_0x50899a[_0x7bdb('0x41')];_0x242725+=0x1){var _0x11c725=_0x50899a[_0x242725][_0x7bdb('0x23')]({'plain':!![]});_0xe902d0[_0x7bdb('0x63')]=_0x42f8e4[_0x7bdb('0x46')]['dialCheckDuplicateType']?_0x42f8e4[_0x7bdb('0x46')][_0x7bdb('0x63')]:_0xe902d0[_0x7bdb('0x63')];switch(_0xe902d0['dialCheckDuplicateType']){case _0x7bdb('0x64'):_0x3905c4=squel['insert']()[_0x7bdb('0x65')](_0x7bdb('0x66'))[_0x7bdb('0x67')]([_0x7bdb('0x68'),'scheduledAt',_0x7bdb('0x69'),_0x7bdb('0x6a'),_0x7bdb('0x56'),_0x7bdb('0x4f'),'updatedAt'],squel[_0x7bdb('0x6b')]()[_0x7bdb('0x6c')](_0x7bdb('0x68'),_0x7bdb('0x68'))[_0x7bdb('0x6c')](_0x7bdb('0x6d'),_0x7bdb('0x6e'))[_0x7bdb('0x6c')]('id','ContactId')[_0x7bdb('0x6c')](_0x11c725[_0x7bdb('0x6f')][_0x7bdb('0x70')](),_0x7bdb('0x6a'))[_0x7bdb('0x6c')](_0x42f8e4[_0x7bdb('0x4e')]['id'][_0x7bdb('0x70')](),_0x7bdb('0x56'))[_0x7bdb('0x6c')]('NOW()',_0x7bdb('0x4f'))['field']('NOW()',_0x7bdb('0x51'))['from'](_0x7bdb('0x71'))['where'](_0x7bdb('0x72'))[_0x7bdb('0x36')](_0x7bdb('0x73'),_0x11c725[_0x7bdb('0x6f')]['toString']())['where'](_0x7bdb('0x74'))[_0x7bdb('0x36')](_0x7bdb('0x75'),squel[_0x7bdb('0x6b')]()[_0x7bdb('0x6c')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x7bdb('0x76'))[_0x7bdb('0x36')](_0x7bdb('0x77'),_0x42f8e4[_0x7bdb('0x4e')]['id'][_0x7bdb('0x70')]()))[_0x7bdb('0x36')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7bdb('0x6b')]()['field'](_0x7bdb('0x78'))['from'](_0x7bdb('0x66'))[_0x7bdb('0x36')]('CampaignId\x20=\x20?',_0x42f8e4[_0x7bdb('0x4e')]['id'][_0x7bdb('0x70')]())))[_0x7bdb('0x70')]();break;case _0x7bdb('0x79'):_0x3905c4=squel[_0x7bdb('0x7a')]()[_0x7bdb('0x65')](_0x7bdb('0x66'))[_0x7bdb('0x67')]([_0x7bdb('0x68'),_0x7bdb('0x6e'),_0x7bdb('0x69'),_0x7bdb('0x6a'),_0x7bdb('0x56'),_0x7bdb('0x4f'),_0x7bdb('0x51')],squel[_0x7bdb('0x6b')]()[_0x7bdb('0x6c')](_0x7bdb('0x68'),'phone')['field']('NOW()',_0x7bdb('0x6e'))[_0x7bdb('0x6c')]('id',_0x7bdb('0x69'))[_0x7bdb('0x6c')](_0x11c725[_0x7bdb('0x6f')][_0x7bdb('0x70')](),_0x7bdb('0x6a'))[_0x7bdb('0x6c')](_0x42f8e4[_0x7bdb('0x4e')]['id']['toString'](),_0x7bdb('0x56'))[_0x7bdb('0x6c')](_0x7bdb('0x6d'),_0x7bdb('0x4f'))['field'](_0x7bdb('0x6d'),_0x7bdb('0x51'))['from'](_0x7bdb('0x71'))[_0x7bdb('0x36')](_0x7bdb('0x72'))[_0x7bdb('0x36')]('ListId\x20=\x20?',_0x11c725[_0x7bdb('0x6f')][_0x7bdb('0x70')]())[_0x7bdb('0x36')]('phone\x20IS\x20NOT\x20NULL')[_0x7bdb('0x36')](_0x7bdb('0x75'),squel[_0x7bdb('0x6b')]()[_0x7bdb('0x6c')](_0x7bdb('0x78'))['from'](_0x7bdb('0x66'))[_0x7bdb('0x36')](_0x7bdb('0x77'),_0x42f8e4[_0x7bdb('0x4e')]['id'][_0x7bdb('0x70')]())))[_0x7bdb('0x70')]();break;default:_0x3905c4=squel[_0x7bdb('0x7a')]()['into'](_0x7bdb('0x66'))[_0x7bdb('0x67')](['phone','scheduledAt','ContactId',_0x7bdb('0x6a'),_0x7bdb('0x56'),_0x7bdb('0x4f'),_0x7bdb('0x51')],squel['select']()[_0x7bdb('0x6c')](_0x7bdb('0x68'),_0x7bdb('0x68'))['field'](_0x7bdb('0x6d'),_0x7bdb('0x6e'))[_0x7bdb('0x6c')]('id',_0x7bdb('0x69'))['field'](_0x11c725[_0x7bdb('0x6f')][_0x7bdb('0x70')](),_0x7bdb('0x6a'))['field'](_0x42f8e4[_0x7bdb('0x4e')]['id'][_0x7bdb('0x70')](),_0x7bdb('0x56'))['field'](_0x7bdb('0x6d'),_0x7bdb('0x4f'))[_0x7bdb('0x6c')](_0x7bdb('0x6d'),_0x7bdb('0x51'))[_0x7bdb('0x7b')](_0x7bdb('0x71'))[_0x7bdb('0x36')](_0x7bdb('0x72'))[_0x7bdb('0x36')](_0x7bdb('0x73'),_0x11c725['CmListId']['toString']())[_0x7bdb('0x36')](_0x7bdb('0x74')))['toString']();}_0x15825b['push'](db[_0x7bdb('0x7c')][_0x7bdb('0x2f')](_0x3905c4));}return BPromise[_0x7bdb('0x7d')](_0x15825b);}})[_0x7bdb('0x21')](function(){return _0x1ea2ab;})[_0x7bdb('0x21')](respondWithResult(_0x15da37,null))[_0x7bdb('0x44')](handleError(_0x15da37,null));};exports['removeLists']=function(_0x15c928,_0x2d819c,_0x25ab51){return db['Campaign'][_0x7bdb('0x49')]({'where':{'id':_0x15c928[_0x7bdb('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2d819c,null))['then'](function(_0x3d1cb0){if(_0x3d1cb0){return _0x3d1cb0[_0x7bdb('0x7e')](_0x15c928['query'][_0x7bdb('0x62')]);}})[_0x7bdb('0x21')](function(_0x27236d){if(_0x27236d){return db['CmHopper']['destroy']({'where':{'ListId':_0x15c928['query'][_0x7bdb('0x62')],'CampaignId':_0x15c928[_0x7bdb('0x4e')]['id']}})['then'](function(){return _0x27236d;});}})[_0x7bdb('0x21')](respondWithStatusCode(_0x2d819c,null))[_0x7bdb('0x44')](handleError(_0x2d819c,null));};exports['getBlackLists']=function(_0x31d350,_0x419e64,_0x381091){var _0x2ab3d1={'raw':!![],'where':{}};var _0x100e0c={};var _0x18f25a={'count':0x0,'rows':[]};return db['Campaign'][_0x7bdb('0x58')]({'where':{'id':_0x31d350['params']['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x419e64,null))['then'](function(_0x20c0b6){if(_0x20c0b6){_0x100e0c[_0x7bdb('0x31')]=_[_0x7bdb('0x30')](db[_0x7bdb('0x60')][_0x7bdb('0x2b')]);_0x100e0c[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x31d350[_0x7bdb('0x2f')]);_0x100e0c['filters']=_[_0x7bdb('0x40')](_0x100e0c[_0x7bdb('0x31')],_0x100e0c[_0x7bdb('0x2f')]);_0x2ab3d1['attributes']=_['intersection'](_0x100e0c[_0x7bdb('0x31')],qs[_0x7bdb('0x33')](_0x31d350['query']['fields']));_0x2ab3d1['attributes']=_0x2ab3d1[_0x7bdb('0x32')][_0x7bdb('0x41')]?_0x2ab3d1[_0x7bdb('0x32')]:_0x100e0c[_0x7bdb('0x31')];if(!_0x31d350['query']['hasOwnProperty'](_0x7bdb('0x5b'))){_0x2ab3d1[_0x7bdb('0x19')]=qs['limit'](_0x31d350[_0x7bdb('0x2f')][_0x7bdb('0x19')]);_0x2ab3d1[_0x7bdb('0x18')]=qs[_0x7bdb('0x18')](_0x31d350[_0x7bdb('0x2f')][_0x7bdb('0x18')]);}_0x2ab3d1[_0x7bdb('0x34')]=qs[_0x7bdb('0x35')](_0x31d350[_0x7bdb('0x2f')][_0x7bdb('0x35')]);_0x2ab3d1['where']=qs[_0x7bdb('0x37')](_[_0x7bdb('0x38')](_0x31d350['query'],_0x100e0c[_0x7bdb('0x37')]));_0x2ab3d1[_0x7bdb('0x36')][_0x7bdb('0x56')]=_0x20c0b6['id'];if(_0x31d350[_0x7bdb('0x2f')][_0x7bdb('0x39')]){_0x2ab3d1['where']=_[_0x7bdb('0x3a')](_0x2ab3d1['where'],{'$or':_['map'](_0x2ab3d1[_0x7bdb('0x32')],function(_0x4c2087){var _0x3677c0={};_0x3677c0[_0x4c2087]={'$like':'%'+_0x31d350['query'][_0x7bdb('0x39')]+'%'};return _0x3677c0;})});}_0x2ab3d1=_[_0x7bdb('0x3a')]({},_0x2ab3d1,_0x31d350[_0x7bdb('0x43')]);return db[_0x7bdb('0x60')][_0x7bdb('0x17')]({'where':_0x2ab3d1[_0x7bdb('0x36')]})[_0x7bdb('0x21')](function(_0x3d5a24){_0x18f25a[_0x7bdb('0x17')]=_0x3d5a24;if(_0x31d350[_0x7bdb('0x2f')]['includeAll']){_0x2ab3d1[_0x7bdb('0x3d')]=[{'all':!![]}];}return db[_0x7bdb('0x60')][_0x7bdb('0x3e')](_0x2ab3d1);})[_0x7bdb('0x21')](function(_0x171039){_0x18f25a[_0x7bdb('0x3f')]=_0x171039;return _0x18f25a;});}})[_0x7bdb('0x21')](respondWithFilteredResult(_0x419e64,_0x2ab3d1))[_0x7bdb('0x44')](handleError(_0x419e64,null));};exports[_0x7bdb('0x7f')]=function(_0x179acc,_0x5cfa17,_0x1713c7){var _0x9062ae,_0x46842b;return db[_0x7bdb('0x3c')][_0x7bdb('0x49')]({'where':{'id':_0x179acc[_0x7bdb('0x4e')]['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x5cfa17,null))[_0x7bdb('0x21')](function(_0xd32fb6){if(_0xd32fb6){_0x46842b=_0xd32fb6;return _0xd32fb6[_0x7bdb('0x7f')](_0x179acc[_0x7bdb('0x46')]['ids'],_[_0x7bdb('0x50')](_0x179acc[_0x7bdb('0x46')],[_0x7bdb('0x62'),'id'])||{});}return null;})[_0x7bdb('0x80')](function(_0x4bd79c){var _0x11b56a;_0x9062ae=_0x4bd79c||[];var _0x2fc710=[];if(_0x4bd79c){for(var _0x79454e=0x0;_0x79454e<_0x4bd79c['length'];_0x79454e+=0x1){var _0x5f29c1=_0x4bd79c[_0x79454e]['get']({'plain':!![]});_0x11b56a=squel[_0x7bdb('0x7a')]()[_0x7bdb('0x65')]('cm_hopper_black')['fromQuery']([_0x7bdb('0x68'),_0x7bdb('0x69'),_0x7bdb('0x6a'),_0x7bdb('0x56'),_0x7bdb('0x4f'),_0x7bdb('0x51')],squel[_0x7bdb('0x6b')]()['field']('phone',_0x7bdb('0x68'))['field']('id',_0x7bdb('0x69'))['field'](_0x5f29c1[_0x7bdb('0x6f')][_0x7bdb('0x70')](),'ListId')[_0x7bdb('0x6c')](_0x179acc['params']['id'][_0x7bdb('0x70')](),'CampaignId')['field'](_0x7bdb('0x6d'),_0x7bdb('0x4f'))[_0x7bdb('0x6c')](_0x7bdb('0x6d'),'updatedAt')['from']('cm_contacts')[_0x7bdb('0x36')](_0x7bdb('0x72'))[_0x7bdb('0x36')](_0x7bdb('0x73'),_0x5f29c1['CmListId'][_0x7bdb('0x70')]())['where'](_0x7bdb('0x74')))[_0x7bdb('0x70')]();_0x2fc710[_0x7bdb('0x81')](db['sequelize'][_0x7bdb('0x2f')](_0x11b56a));}return BPromise[_0x7bdb('0x7d')](_0x2fc710);}})[_0x7bdb('0x21')](function(){return _0x9062ae;})['then'](respondWithResult(_0x5cfa17,null))[_0x7bdb('0x44')](handleError(_0x5cfa17,null));};exports['removeBlackLists']=function(_0x494df9,_0x2040da,_0x46a897){return db[_0x7bdb('0x3c')][_0x7bdb('0x49')]({'where':{'id':_0x494df9[_0x7bdb('0x4e')]['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x2040da,null))['then'](function(_0x13aeeb){if(_0x13aeeb){return _0x13aeeb['removeBlackLists'](_0x494df9[_0x7bdb('0x2f')][_0x7bdb('0x62')]);}})[_0x7bdb('0x21')](function(_0x1e8016){if(_0x1e8016){return db[_0x7bdb('0x5e')][_0x7bdb('0x22')]({'where':{'ListId':_0x494df9[_0x7bdb('0x2f')]['ids'],'CampaignId':_0x494df9['params']['id']}})[_0x7bdb('0x21')](function(){return _0x1e8016;});}})['then'](respondWithStatusCode(_0x2040da,null))[_0x7bdb('0x44')](handleError(_0x2040da,null));}; \ No newline at end of file +var _0xb4e6=['limit','set','Content-Range','apply','reject','update','destroy','then','get','UserProfileResource','error','name','send','index','map','Campaign','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','count','includeAll','include','catch','params','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','omit','createdAt','updatedAt','IvrCampaigns','getHoppers','CmHopper','CampaignId','findAll','rows','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','CmListId','toString','NOW()','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','ContactId','cm_contacts','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x597768,_0x30c6b5){var _0x366166=function(_0x2640f0){while(--_0x2640f0){_0x597768['push'](_0x597768['shift']());}};_0x366166(++_0x30c6b5);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x210603,_0x4adbac){_0x210603=_0x210603-0x0;var _0x1bcb7d=_0xb4e6[_0x210603];return _0x1bcb7d;};'use strict';var pdf=require(_0x6b4e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6b4e('0x1'));var zipdir=require(_0x6b4e('0x2'));var jsonpatch=require(_0x6b4e('0x3'));var rp=require(_0x6b4e('0x4'));var moment=require(_0x6b4e('0x5'));var BPromise=require(_0x6b4e('0x6'));var Mustache=require(_0x6b4e('0x7'));var util=require('util');var path=require(_0x6b4e('0x8'));var sox=require(_0x6b4e('0x9'));var csv=require(_0x6b4e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6b4e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6b4e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b4e('0xd'));var Papa=require(_0x6b4e('0xe'));var Redis=require(_0x6b4e('0xf'));var authService=require(_0x6b4e('0x10'));var qs=require(_0x6b4e('0x11'));var as=require(_0x6b4e('0x12'));var hardwareService=require(_0x6b4e('0x13'));var logger=require('../../config/logger')(_0x6b4e('0x14'));var utils=require(_0x6b4e('0x15'));var config=require('../../config/environment');var db=require(_0x6b4e('0x16'))['db'];function respondWithStatusCode(_0x9cd7da,_0x432399){_0x432399=_0x432399||0xcc;return function(_0x2b2ce0){if(_0x2b2ce0){return _0x9cd7da[_0x6b4e('0x17')](_0x432399);}return _0x9cd7da[_0x6b4e('0x18')](_0x432399)[_0x6b4e('0x19')]();};}function respondWithResult(_0x531eec,_0x36f8a5){_0x36f8a5=_0x36f8a5||0xc8;return function(_0x29bdee){if(_0x29bdee){return _0x531eec['status'](_0x36f8a5)[_0x6b4e('0x1a')](_0x29bdee);}};}function respondWithFilteredResult(_0x4b62ad,_0x355f10){return function(_0x2195c1){if(_0x2195c1){var _0x3ba513=_0x2195c1['count'],_0x42e265=_0x355f10['offset'],_0x28c3ba=_0x355f10[_0x6b4e('0x1b')]+_0x355f10[_0x6b4e('0x1c')],_0x135568;if(_0x28c3ba>=_0x3ba513){_0x28c3ba=_0x3ba513;_0x135568=0xc8;}else{_0x135568=0xce;}_0x4b62ad[_0x6b4e('0x18')](_0x135568);return _0x4b62ad[_0x6b4e('0x1d')](_0x6b4e('0x1e'),_0x42e265+'-'+_0x28c3ba+'/'+_0x3ba513)[_0x6b4e('0x1a')](_0x2195c1);}return null;};}function patchUpdates(_0xbba4e9){return function(_0x2eaf01){try{jsonpatch[_0x6b4e('0x1f')](_0x2eaf01,_0xbba4e9,!![]);}catch(_0x20a178){return BPromise[_0x6b4e('0x20')](_0x20a178);}return _0x2eaf01['save']();};}function saveUpdates(_0x378233,_0x248fea){return function(_0x31fb9d){if(_0x31fb9d){return _0x31fb9d[_0x6b4e('0x21')](_0x378233)['then'](function(_0x1b48b5){return _0x1b48b5;});}return null;};}function removeEntity(_0x507703,_0x2503a5){return function(_0x163dea){if(_0x163dea){return _0x163dea[_0x6b4e('0x22')]()[_0x6b4e('0x23')](function(){var _0xa06ccd=_0x163dea[_0x6b4e('0x24')]({'plain':!![]});var _0x3e636f='IvrCampaigns';return db[_0x6b4e('0x25')]['destroy']({'where':{'type':_0x3e636f,'resourceId':_0xa06ccd['id']}})[_0x6b4e('0x23')](function(){return _0x163dea;});})[_0x6b4e('0x23')](function(){_0x507703[_0x6b4e('0x18')](0xcc)[_0x6b4e('0x19')]();});}};}function handleEntityNotFound(_0x4ec9cc,_0xec7d35){return function(_0x3f72d7){if(!_0x3f72d7){_0x4ec9cc['sendStatus'](0x194);}return _0x3f72d7;};}function handleError(_0x32102f,_0x381ff0){_0x381ff0=_0x381ff0||0x1f4;return function(_0x3513b2){logger[_0x6b4e('0x26')](_0x3513b2['stack']);if(_0x3513b2[_0x6b4e('0x27')]){delete _0x3513b2[_0x6b4e('0x27')];}_0x32102f['status'](_0x381ff0)[_0x6b4e('0x28')](_0x3513b2);};}exports[_0x6b4e('0x29')]=function(_0x2f1129,_0x143de5){var _0x4a6c90={},_0x445278={},_0x4007b6={'count':0x0,'rows':[]};var _0x47ab11=_[_0x6b4e('0x2a')](db[_0x6b4e('0x2b')][_0x6b4e('0x2c')],function(_0x53c242){return{'name':_0x53c242['fieldName'],'type':_0x53c242[_0x6b4e('0x2d')][_0x6b4e('0x2e')]};});_0x445278[_0x6b4e('0x2f')]=_['map'](_0x47ab11,_0x6b4e('0x27'));_0x445278[_0x6b4e('0x30')]=_[_0x6b4e('0x31')](_0x2f1129['query']);_0x445278['filters']=_[_0x6b4e('0x32')](_0x445278['model'],_0x445278[_0x6b4e('0x30')]);_0x4a6c90[_0x6b4e('0x33')]=_['intersection'](_0x445278[_0x6b4e('0x2f')],qs[_0x6b4e('0x34')](_0x2f1129[_0x6b4e('0x30')][_0x6b4e('0x34')]));_0x4a6c90['attributes']=_0x4a6c90['attributes'][_0x6b4e('0x35')]?_0x4a6c90[_0x6b4e('0x33')]:_0x445278[_0x6b4e('0x2f')];if(!_0x2f1129[_0x6b4e('0x30')][_0x6b4e('0x36')](_0x6b4e('0x37'))){_0x4a6c90[_0x6b4e('0x1c')]=qs[_0x6b4e('0x1c')](_0x2f1129[_0x6b4e('0x30')][_0x6b4e('0x1c')]);_0x4a6c90[_0x6b4e('0x1b')]=qs[_0x6b4e('0x1b')](_0x2f1129[_0x6b4e('0x30')]['offset']);}_0x4a6c90[_0x6b4e('0x38')]=qs[_0x6b4e('0x39')](_0x2f1129[_0x6b4e('0x30')]['sort']);_0x4a6c90[_0x6b4e('0x3a')]=qs['filters'](_[_0x6b4e('0x3b')](_0x2f1129[_0x6b4e('0x30')],_0x445278[_0x6b4e('0x3c')]));if(_0x2f1129['query']['filter']){_0x4a6c90[_0x6b4e('0x3a')]=_[_0x6b4e('0x3d')](_0x4a6c90['where'],{'$or':_['map'](_0x47ab11,function(_0x2362e1){if(_0x2362e1[_0x6b4e('0x2d')]!==_0x6b4e('0x3e')){var _0x39097d={};_0x39097d[_0x2362e1[_0x6b4e('0x27')]]={'$like':'%'+_0x2f1129[_0x6b4e('0x30')][_0x6b4e('0x3f')]+'%'};return _0x39097d;}})});}_0x4a6c90=_[_0x6b4e('0x3d')]({},_0x4a6c90,_0x2f1129[_0x6b4e('0x40')]);var _0x2b61c4={'where':_0x4a6c90[_0x6b4e('0x3a')]};return db['Campaign'][_0x6b4e('0x41')](_0x2b61c4)[_0x6b4e('0x23')](function(_0x5d5d55){_0x4007b6[_0x6b4e('0x41')]=_0x5d5d55;if(_0x2f1129[_0x6b4e('0x30')][_0x6b4e('0x42')]){_0x4a6c90[_0x6b4e('0x43')]=[{'all':!![]}];}return db[_0x6b4e('0x2b')]['findAll'](_0x4a6c90);})['then'](function(_0x210691){_0x4007b6['rows']=_0x210691;return _0x4007b6;})[_0x6b4e('0x23')](respondWithFilteredResult(_0x143de5,_0x4a6c90))[_0x6b4e('0x44')](handleError(_0x143de5,null));};exports['show']=function(_0xf70c24,_0x50f0e7){var _0x3dec0f={'raw':![],'where':{'id':_0xf70c24[_0x6b4e('0x45')]['id']}},_0x4fbd96={};_0x4fbd96[_0x6b4e('0x2f')]=_[_0x6b4e('0x31')](db[_0x6b4e('0x2b')]['rawAttributes']);_0x4fbd96[_0x6b4e('0x30')]=_[_0x6b4e('0x31')](_0xf70c24[_0x6b4e('0x30')]);_0x4fbd96['filters']=_[_0x6b4e('0x32')](_0x4fbd96[_0x6b4e('0x2f')],_0x4fbd96[_0x6b4e('0x30')]);_0x3dec0f[_0x6b4e('0x33')]=_[_0x6b4e('0x32')](_0x4fbd96[_0x6b4e('0x2f')],qs[_0x6b4e('0x34')](_0xf70c24[_0x6b4e('0x30')][_0x6b4e('0x34')]));_0x3dec0f['attributes']=_0x3dec0f[_0x6b4e('0x33')][_0x6b4e('0x35')]?_0x3dec0f[_0x6b4e('0x33')]:_0x4fbd96[_0x6b4e('0x2f')];if(_0xf70c24[_0x6b4e('0x30')]['includeAll']){_0x3dec0f[_0x6b4e('0x43')]=[{'all':!![]}];}_0x3dec0f=_['merge']({},_0x3dec0f,_0xf70c24[_0x6b4e('0x40')]);return db[_0x6b4e('0x2b')][_0x6b4e('0x46')](_0x3dec0f)[_0x6b4e('0x23')](handleEntityNotFound(_0x50f0e7,null))['then'](respondWithResult(_0x50f0e7,null))[_0x6b4e('0x44')](handleError(_0x50f0e7,null));};exports[_0x6b4e('0x47')]=function(_0x1d0eb3,_0x5b9da3){return db[_0x6b4e('0x2b')][_0x6b4e('0x47')](_0x1d0eb3[_0x6b4e('0x48')],{})[_0x6b4e('0x23')](function(_0x2016e5){var _0x33c797=_0x1d0eb3[_0x6b4e('0x49')][_0x6b4e('0x24')]({'plain':!![]});if(!_0x33c797)throw new Error(_0x6b4e('0x4a'));if(_0x33c797[_0x6b4e('0x4b')]==='user'){var _0x2106fb=_0x2016e5[_0x6b4e('0x24')]({'plain':!![]});var _0x1f691f='IvrCampaigns';return db[_0x6b4e('0x4c')][_0x6b4e('0x46')]({'where':{'name':_0x1f691f,'userProfileId':_0x33c797[_0x6b4e('0x4d')]},'raw':!![]})[_0x6b4e('0x23')](function(_0x73c6be){if(_0x73c6be&&_0x73c6be[_0x6b4e('0x4e')]===0x0){return db[_0x6b4e('0x25')][_0x6b4e('0x47')]({'name':_0x2106fb[_0x6b4e('0x27')],'resourceId':_0x2106fb['id'],'type':_0x73c6be[_0x6b4e('0x27')],'sectionId':_0x73c6be['id']},{})[_0x6b4e('0x23')](function(){return _0x2016e5;});}else{return _0x2016e5;}})['catch'](function(_0x4e183b){logger[_0x6b4e('0x26')](_0x6b4e('0x4f'),_0x4e183b);throw _0x4e183b;});}return _0x2016e5;})[_0x6b4e('0x23')](respondWithResult(_0x5b9da3,0xc9))[_0x6b4e('0x44')](handleError(_0x5b9da3,null));};exports['clone']=function(_0x1450de,_0x31071f){var _0xf2e6d5={'where':{'id':_0x1450de[_0x6b4e('0x45')]['id']}},_0x59db52={};_0x59db52[_0x6b4e('0x2f')]=_[_0x6b4e('0x31')](db[_0x6b4e('0x2b')][_0x6b4e('0x2c')]);_0xf2e6d5['attributes']=_[_0x6b4e('0x32')](_0x59db52['model'],qs[_0x6b4e('0x34')](_0x1450de[_0x6b4e('0x30')]['fields']));_0xf2e6d5[_0x6b4e('0x33')]=_0xf2e6d5['attributes'][_0x6b4e('0x35')]?_0xf2e6d5[_0x6b4e('0x33')]:_0x59db52[_0x6b4e('0x2f')];if(_0x1450de[_0x6b4e('0x30')][_0x6b4e('0x42')]){_0xf2e6d5['include']=[{'all':!![]}];}_0xf2e6d5=_[_0x6b4e('0x3d')]({},_0xf2e6d5,_0x1450de[_0x6b4e('0x40')]);return db[_0x6b4e('0x2b')]['find'](_0xf2e6d5)['then'](handleEntityNotFound(_0x31071f,null))[_0x6b4e('0x23')](function(_0x15ec6f){if(_0x15ec6f){var _0x5d46b9=_0x15ec6f[_0x6b4e('0x24')]({'plain':!![]});_0x5d46b9=qs[_0x6b4e('0x50')](_0x5d46b9,['id',_0x6b4e('0x51'),_0x6b4e('0x52')]);_0x1450de[_0x6b4e('0x48')]=_['omit'](_0x1450de['body'],['id',_0x6b4e('0x51'),_0x6b4e('0x52')]);return db[_0x6b4e('0x2b')][_0x6b4e('0x47')](_[_0x6b4e('0x3d')](_0x5d46b9,_0x1450de[_0x6b4e('0x48')]),{'include':_0x1450de[_0x6b4e('0x30')][_0x6b4e('0x42')]?[{'all':!![]}]:undefined})[_0x6b4e('0x23')](function(_0x5bedab){var _0x322fa4=_0x1450de[_0x6b4e('0x49')][_0x6b4e('0x24')]({'plain':!![]});if(!_0x322fa4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x322fa4['role']===_0x6b4e('0x49')){var _0x38b1a6=_0x5bedab[_0x6b4e('0x24')]({'plain':!![]});var _0x158c28=_0x6b4e('0x53');return db['UserProfileSection'][_0x6b4e('0x46')]({'where':{'name':_0x158c28,'userProfileId':_0x322fa4[_0x6b4e('0x4d')]},'raw':!![]})[_0x6b4e('0x23')](function(_0x5383fc){if(_0x5383fc&&_0x5383fc[_0x6b4e('0x4e')]===0x0){return db[_0x6b4e('0x25')][_0x6b4e('0x47')]({'name':_0x38b1a6['name'],'resourceId':_0x38b1a6['id'],'type':_0x5383fc[_0x6b4e('0x27')],'sectionId':_0x5383fc['id']},{})[_0x6b4e('0x23')](function(){return _0x5bedab;});}else{return _0x5bedab;}})['catch'](function(_0x177470){logger[_0x6b4e('0x26')](_0x6b4e('0x4f'),_0x177470);throw _0x177470;});}return _0x5bedab;});}})[_0x6b4e('0x23')](respondWithResult(_0x31071f,0xc9))[_0x6b4e('0x44')](handleError(_0x31071f,null));};exports[_0x6b4e('0x21')]=function(_0x2ada5d,_0x5d8433){if(_0x2ada5d[_0x6b4e('0x48')]['id']){delete _0x2ada5d[_0x6b4e('0x48')]['id'];}return db[_0x6b4e('0x2b')][_0x6b4e('0x46')]({'where':{'id':_0x2ada5d[_0x6b4e('0x45')]['id']}})['then'](handleEntityNotFound(_0x5d8433,null))[_0x6b4e('0x23')](saveUpdates(_0x2ada5d[_0x6b4e('0x48')],null))[_0x6b4e('0x23')](respondWithResult(_0x5d8433,null))[_0x6b4e('0x44')](handleError(_0x5d8433,null));};exports[_0x6b4e('0x22')]=function(_0x4ed029,_0xa1246f){return db['Campaign'][_0x6b4e('0x46')]({'where':{'id':_0x4ed029[_0x6b4e('0x45')]['id']}})[_0x6b4e('0x23')](handleEntityNotFound(_0xa1246f,null))[_0x6b4e('0x23')](removeEntity(_0xa1246f,null))['catch'](handleError(_0xa1246f,null));};exports[_0x6b4e('0x54')]=function(_0xb14e52,_0x329d25,_0x2bdc10){var _0xc3083={'raw':!![],'where':{}};var _0x15de0d={};var _0x41e901={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xb14e52['params']['id']}})[_0x6b4e('0x23')](handleEntityNotFound(_0x329d25,null))[_0x6b4e('0x23')](function(_0x247319){if(_0x247319){_0x15de0d[_0x6b4e('0x2f')]=_[_0x6b4e('0x31')](db[_0x6b4e('0x55')]['rawAttributes']);_0x15de0d['query']=_[_0x6b4e('0x31')](_0xb14e52[_0x6b4e('0x30')]);_0x15de0d[_0x6b4e('0x3c')]=_[_0x6b4e('0x32')](_0x15de0d['model'],_0x15de0d[_0x6b4e('0x30')]);_0xc3083['attributes']=_[_0x6b4e('0x32')](_0x15de0d[_0x6b4e('0x2f')],qs[_0x6b4e('0x34')](_0xb14e52[_0x6b4e('0x30')]['fields']));_0xc3083[_0x6b4e('0x33')]=_0xc3083['attributes'][_0x6b4e('0x35')]?_0xc3083['attributes']:_0x15de0d[_0x6b4e('0x2f')];if(!_0xb14e52[_0x6b4e('0x30')]['hasOwnProperty'](_0x6b4e('0x37'))){_0xc3083['limit']=qs[_0x6b4e('0x1c')](_0xb14e52[_0x6b4e('0x30')][_0x6b4e('0x1c')]);_0xc3083[_0x6b4e('0x1b')]=qs['offset'](_0xb14e52['query']['offset']);}_0xc3083[_0x6b4e('0x38')]=qs[_0x6b4e('0x39')](_0xb14e52['query'][_0x6b4e('0x39')]);_0xc3083[_0x6b4e('0x3a')]=qs[_0x6b4e('0x3c')](_[_0x6b4e('0x3b')](_0xb14e52[_0x6b4e('0x30')],_0x15de0d[_0x6b4e('0x3c')]));_0xc3083[_0x6b4e('0x3a')][_0x6b4e('0x56')]=_0x247319['id'];if(_0xb14e52[_0x6b4e('0x30')][_0x6b4e('0x3f')]){_0xc3083[_0x6b4e('0x3a')]=_['merge'](_0xc3083[_0x6b4e('0x3a')],{'$or':_[_0x6b4e('0x2a')](_0xc3083[_0x6b4e('0x33')],function(_0x7692bc){var _0x24c2ca={};_0x24c2ca[_0x7692bc]={'$like':'%'+_0xb14e52[_0x6b4e('0x30')][_0x6b4e('0x3f')]+'%'};return _0x24c2ca;})});}_0xc3083=_[_0x6b4e('0x3d')]({},_0xc3083,_0xb14e52[_0x6b4e('0x40')]);return db['CmHopper']['count']({'where':_0xc3083['where']})['then'](function(_0xafb7da){_0x41e901[_0x6b4e('0x41')]=_0xafb7da;if(_0xb14e52[_0x6b4e('0x30')][_0x6b4e('0x42')]){_0xc3083['include']=[{'all':!![]}];}return db[_0x6b4e('0x55')][_0x6b4e('0x57')](_0xc3083);})['then'](function(_0x1ad4bb){_0x41e901[_0x6b4e('0x58')]=_0x1ad4bb;return _0x41e901;});}})[_0x6b4e('0x23')](respondWithFilteredResult(_0x329d25,_0xc3083))[_0x6b4e('0x44')](handleError(_0x329d25,null));};exports['getHopperHistories']=function(_0x3f5dda,_0x3bab0b,_0x4b0a4e){var _0x50bbeb={'raw':!![],'where':{}};var _0x1dc719={};var _0x47af87={'count':0x0,'rows':[]};return db[_0x6b4e('0x2b')][_0x6b4e('0x59')]({'where':{'id':_0x3f5dda['params']['id']}})[_0x6b4e('0x23')](handleEntityNotFound(_0x3bab0b,null))[_0x6b4e('0x23')](function(_0x3b7c3c){if(_0x3b7c3c){_0x1dc719[_0x6b4e('0x2f')]=_[_0x6b4e('0x31')](db['CmHopperHistory']['rawAttributes']);_0x1dc719[_0x6b4e('0x30')]=_[_0x6b4e('0x31')](_0x3f5dda[_0x6b4e('0x30')]);_0x1dc719[_0x6b4e('0x3c')]=_[_0x6b4e('0x32')](_0x1dc719[_0x6b4e('0x2f')],_0x1dc719[_0x6b4e('0x30')]);_0x50bbeb[_0x6b4e('0x33')]=_[_0x6b4e('0x32')](_0x1dc719['model'],qs[_0x6b4e('0x34')](_0x3f5dda[_0x6b4e('0x30')][_0x6b4e('0x34')]));_0x50bbeb[_0x6b4e('0x33')]=_0x50bbeb[_0x6b4e('0x33')][_0x6b4e('0x35')]?_0x50bbeb[_0x6b4e('0x33')]:_0x1dc719[_0x6b4e('0x2f')];if(!_0x3f5dda[_0x6b4e('0x30')][_0x6b4e('0x36')](_0x6b4e('0x37'))){_0x50bbeb[_0x6b4e('0x1c')]=qs['limit'](_0x3f5dda['query'][_0x6b4e('0x1c')]);_0x50bbeb[_0x6b4e('0x1b')]=qs[_0x6b4e('0x1b')](_0x3f5dda[_0x6b4e('0x30')][_0x6b4e('0x1b')]);}_0x50bbeb['order']=qs[_0x6b4e('0x39')](_0x3f5dda[_0x6b4e('0x30')][_0x6b4e('0x39')]);_0x50bbeb['where']=qs[_0x6b4e('0x3c')](_[_0x6b4e('0x3b')](_0x3f5dda[_0x6b4e('0x30')],_0x1dc719[_0x6b4e('0x3c')]));_0x50bbeb[_0x6b4e('0x3a')][_0x6b4e('0x56')]=_0x3b7c3c['id'];if(_0x3f5dda[_0x6b4e('0x30')]['filter']){_0x50bbeb[_0x6b4e('0x3a')]=_[_0x6b4e('0x3d')](_0x50bbeb[_0x6b4e('0x3a')],{'$or':_['map'](_0x50bbeb['attributes'],function(_0x53b303){var _0x3871e5={};_0x3871e5[_0x53b303]={'$like':'%'+_0x3f5dda['query'][_0x6b4e('0x3f')]+'%'};return _0x3871e5;})});}_0x50bbeb=_[_0x6b4e('0x3d')]({},_0x50bbeb,_0x3f5dda[_0x6b4e('0x40')]);return db[_0x6b4e('0x5a')][_0x6b4e('0x41')]({'where':_0x50bbeb[_0x6b4e('0x3a')]})[_0x6b4e('0x23')](function(_0x5d8adf){_0x47af87[_0x6b4e('0x41')]=_0x5d8adf;if(_0x3f5dda['query']['includeAll']){_0x50bbeb[_0x6b4e('0x43')]=[{'all':!![]}];}return db[_0x6b4e('0x5a')][_0x6b4e('0x57')](_0x50bbeb);})['then'](function(_0x230671){_0x47af87['rows']=_0x230671;return _0x47af87;});}})[_0x6b4e('0x23')](respondWithFilteredResult(_0x3bab0b,_0x50bbeb))[_0x6b4e('0x44')](handleError(_0x3bab0b,null));};exports[_0x6b4e('0x5b')]=function(_0x3edadd,_0x3c812a,_0x98ff80){var _0x1a3dd8={'raw':!![],'where':{}};var _0x1e5033={};var _0x4b9b4b={'count':0x0,'rows':[]};return db[_0x6b4e('0x2b')]['findOne']({'where':{'id':_0x3edadd[_0x6b4e('0x45')]['id']}})['then'](handleEntityNotFound(_0x3c812a,null))[_0x6b4e('0x23')](function(_0x53db70){if(_0x53db70){_0x1e5033[_0x6b4e('0x2f')]=_[_0x6b4e('0x31')](db[_0x6b4e('0x5c')][_0x6b4e('0x2c')]);_0x1e5033[_0x6b4e('0x30')]=_[_0x6b4e('0x31')](_0x3edadd[_0x6b4e('0x30')]);_0x1e5033[_0x6b4e('0x3c')]=_[_0x6b4e('0x32')](_0x1e5033[_0x6b4e('0x2f')],_0x1e5033[_0x6b4e('0x30')]);_0x1a3dd8[_0x6b4e('0x33')]=_[_0x6b4e('0x32')](_0x1e5033[_0x6b4e('0x2f')],qs[_0x6b4e('0x34')](_0x3edadd[_0x6b4e('0x30')]['fields']));_0x1a3dd8[_0x6b4e('0x33')]=_0x1a3dd8['attributes'][_0x6b4e('0x35')]?_0x1a3dd8['attributes']:_0x1e5033[_0x6b4e('0x2f')];if(!_0x3edadd[_0x6b4e('0x30')][_0x6b4e('0x36')](_0x6b4e('0x37'))){_0x1a3dd8['limit']=qs[_0x6b4e('0x1c')](_0x3edadd[_0x6b4e('0x30')][_0x6b4e('0x1c')]);_0x1a3dd8[_0x6b4e('0x1b')]=qs['offset'](_0x3edadd[_0x6b4e('0x30')]['offset']);}_0x1a3dd8[_0x6b4e('0x38')]=qs[_0x6b4e('0x39')](_0x3edadd[_0x6b4e('0x30')][_0x6b4e('0x39')]);_0x1a3dd8[_0x6b4e('0x3a')]=qs[_0x6b4e('0x3c')](_[_0x6b4e('0x3b')](_0x3edadd[_0x6b4e('0x30')],_0x1e5033[_0x6b4e('0x3c')]));_0x1a3dd8[_0x6b4e('0x3a')][_0x6b4e('0x56')]=_0x53db70['id'];if(_0x3edadd[_0x6b4e('0x30')][_0x6b4e('0x3f')]){_0x1a3dd8[_0x6b4e('0x3a')]=_[_0x6b4e('0x3d')](_0x1a3dd8[_0x6b4e('0x3a')],{'$or':_['map'](_0x1a3dd8[_0x6b4e('0x33')],function(_0x36b62b){var _0x4633e3={};_0x4633e3[_0x36b62b]={'$like':'%'+_0x3edadd[_0x6b4e('0x30')]['filter']+'%'};return _0x4633e3;})});}_0x1a3dd8=_[_0x6b4e('0x3d')]({},_0x1a3dd8,_0x3edadd[_0x6b4e('0x40')]);return db[_0x6b4e('0x5c')]['count']({'where':_0x1a3dd8[_0x6b4e('0x3a')]})[_0x6b4e('0x23')](function(_0x3c7b22){_0x4b9b4b[_0x6b4e('0x41')]=_0x3c7b22;if(_0x3edadd['query']['includeAll']){_0x1a3dd8[_0x6b4e('0x43')]=[{'all':!![]}];}return db[_0x6b4e('0x5c')]['findAll'](_0x1a3dd8);})[_0x6b4e('0x23')](function(_0x2e6d9d){_0x4b9b4b[_0x6b4e('0x58')]=_0x2e6d9d;return _0x4b9b4b;});}})[_0x6b4e('0x23')](respondWithFilteredResult(_0x3c812a,_0x1a3dd8))[_0x6b4e('0x44')](handleError(_0x3c812a,null));};exports[_0x6b4e('0x5d')]=function(_0x4847ba,_0x92d02e,_0x3c234d){var _0x1122e1={'raw':!![],'where':{}};var _0x14bde0={};var _0x3700a4={'count':0x0,'rows':[]};return db[_0x6b4e('0x2b')][_0x6b4e('0x59')]({'where':{'id':_0x4847ba[_0x6b4e('0x45')]['id']}})[_0x6b4e('0x23')](handleEntityNotFound(_0x92d02e,null))[_0x6b4e('0x23')](function(_0x44c7bb){if(_0x44c7bb){_0x14bde0['model']=_[_0x6b4e('0x31')](db['CmHopperBlack']['rawAttributes']);_0x14bde0[_0x6b4e('0x30')]=_[_0x6b4e('0x31')](_0x4847ba['query']);_0x14bde0['filters']=_[_0x6b4e('0x32')](_0x14bde0[_0x6b4e('0x2f')],_0x14bde0[_0x6b4e('0x30')]);_0x1122e1[_0x6b4e('0x33')]=_[_0x6b4e('0x32')](_0x14bde0['model'],qs[_0x6b4e('0x34')](_0x4847ba[_0x6b4e('0x30')][_0x6b4e('0x34')]));_0x1122e1[_0x6b4e('0x33')]=_0x1122e1[_0x6b4e('0x33')][_0x6b4e('0x35')]?_0x1122e1[_0x6b4e('0x33')]:_0x14bde0[_0x6b4e('0x2f')];if(!_0x4847ba['query'][_0x6b4e('0x36')](_0x6b4e('0x37'))){_0x1122e1[_0x6b4e('0x1c')]=qs[_0x6b4e('0x1c')](_0x4847ba[_0x6b4e('0x30')][_0x6b4e('0x1c')]);_0x1122e1[_0x6b4e('0x1b')]=qs[_0x6b4e('0x1b')](_0x4847ba[_0x6b4e('0x30')][_0x6b4e('0x1b')]);}_0x1122e1['order']=qs[_0x6b4e('0x39')](_0x4847ba[_0x6b4e('0x30')][_0x6b4e('0x39')]);_0x1122e1[_0x6b4e('0x3a')]=qs['filters'](_[_0x6b4e('0x3b')](_0x4847ba['query'],_0x14bde0[_0x6b4e('0x3c')]));_0x1122e1[_0x6b4e('0x3a')][_0x6b4e('0x56')]=_0x44c7bb['id'];if(_0x4847ba[_0x6b4e('0x30')][_0x6b4e('0x3f')]){_0x1122e1[_0x6b4e('0x3a')]=_[_0x6b4e('0x3d')](_0x1122e1[_0x6b4e('0x3a')],{'$or':_[_0x6b4e('0x2a')](_0x1122e1['attributes'],function(_0x1e5221){var _0x4caccf={};_0x4caccf[_0x1e5221]={'$like':'%'+_0x4847ba['query'][_0x6b4e('0x3f')]+'%'};return _0x4caccf;})});}_0x1122e1=_[_0x6b4e('0x3d')]({},_0x1122e1,_0x4847ba['options']);return db[_0x6b4e('0x5e')][_0x6b4e('0x41')]({'where':_0x1122e1[_0x6b4e('0x3a')]})['then'](function(_0x11bbc9){_0x3700a4[_0x6b4e('0x41')]=_0x11bbc9;if(_0x4847ba[_0x6b4e('0x30')][_0x6b4e('0x42')]){_0x1122e1[_0x6b4e('0x43')]=[{'all':!![]}];}return db[_0x6b4e('0x5e')][_0x6b4e('0x57')](_0x1122e1);})[_0x6b4e('0x23')](function(_0x3a64e0){_0x3700a4[_0x6b4e('0x58')]=_0x3a64e0;return _0x3700a4;});}})['then'](respondWithFilteredResult(_0x92d02e,_0x1122e1))[_0x6b4e('0x44')](handleError(_0x92d02e,null));};exports[_0x6b4e('0x5f')]=function(_0x8ca71b,_0x3882f6,_0x46c1d8){var _0x3aba0a={};var _0x409477={};var _0x297fc5;var _0x47dfe5;return db[_0x6b4e('0x2b')]['findOne']({'where':{'id':_0x8ca71b[_0x6b4e('0x45')]['id']}})[_0x6b4e('0x23')](handleEntityNotFound(_0x3882f6,null))[_0x6b4e('0x23')](function(_0x552873){if(_0x552873){_0x297fc5=_0x552873;_0x409477[_0x6b4e('0x2f')]=_[_0x6b4e('0x31')](db[_0x6b4e('0x60')][_0x6b4e('0x2c')]);_0x409477['query']=_['keys'](_0x8ca71b['query']);_0x409477[_0x6b4e('0x3c')]=_['intersection'](_0x409477[_0x6b4e('0x2f')],_0x409477[_0x6b4e('0x30')]);_0x3aba0a[_0x6b4e('0x33')]=_[_0x6b4e('0x32')](_0x409477['model'],qs[_0x6b4e('0x34')](_0x8ca71b[_0x6b4e('0x30')][_0x6b4e('0x34')]));_0x3aba0a[_0x6b4e('0x33')]=_0x3aba0a[_0x6b4e('0x33')]['length']?_0x3aba0a[_0x6b4e('0x33')]:_0x409477['model'];_0x3aba0a[_0x6b4e('0x38')]=qs[_0x6b4e('0x39')](_0x8ca71b['query'][_0x6b4e('0x39')]);_0x3aba0a[_0x6b4e('0x3a')]=qs['filters'](_[_0x6b4e('0x3b')](_0x8ca71b['query'],_0x409477[_0x6b4e('0x3c')]));if(_0x8ca71b['query'][_0x6b4e('0x3f')]){_0x3aba0a[_0x6b4e('0x3a')]=_[_0x6b4e('0x3d')](_0x3aba0a['where'],{'$or':_[_0x6b4e('0x2a')](_0x3aba0a['attributes'],function(_0x2e66d9){var _0x41a2f6={};_0x41a2f6[_0x2e66d9]={'$like':'%'+_0x8ca71b[_0x6b4e('0x30')][_0x6b4e('0x3f')]+'%'};return _0x41a2f6;})});}_0x3aba0a=_['merge']({},_0x3aba0a,_0x8ca71b[_0x6b4e('0x40')]);return _0x297fc5[_0x6b4e('0x5f')](_0x3aba0a);}})[_0x6b4e('0x23')](function(_0x16d53d){if(_0x16d53d){_0x47dfe5=_0x16d53d[_0x6b4e('0x35')];if(!_0x8ca71b[_0x6b4e('0x30')][_0x6b4e('0x36')]('nolimit')){_0x3aba0a['limit']=qs[_0x6b4e('0x1c')](_0x8ca71b['query'][_0x6b4e('0x1c')]);_0x3aba0a[_0x6b4e('0x1b')]=qs['offset'](_0x8ca71b[_0x6b4e('0x30')][_0x6b4e('0x1b')]);}return _0x297fc5[_0x6b4e('0x5f')](_0x3aba0a);}})[_0x6b4e('0x23')](function(_0x2afae3){if(_0x2afae3){return _0x2afae3?{'count':_0x47dfe5,'rows':_0x2afae3}:null;}})[_0x6b4e('0x23')](respondWithResult(_0x3882f6,null))[_0x6b4e('0x44')](handleError(_0x3882f6,null));};exports[_0x6b4e('0x61')]=function(_0x4e4d8b,_0x424202,_0x2c9c21){var _0x28d9e1,_0x2630da;return db['Campaign']['find']({'where':{'id':_0x4e4d8b[_0x6b4e('0x45')]['id']}})[_0x6b4e('0x23')](handleEntityNotFound(_0x424202,null))[_0x6b4e('0x23')](function(_0x5c7944){if(_0x5c7944){_0x2630da=_0x5c7944;return _0x5c7944[_0x6b4e('0x61')](_0x4e4d8b[_0x6b4e('0x48')][_0x6b4e('0x62')],_[_0x6b4e('0x50')](_0x4e4d8b['body'],[_0x6b4e('0x62'),'id'])||{});}return null;})[_0x6b4e('0x63')](function(_0x1873f4){var _0x4625d9;_0x28d9e1=_0x1873f4||[];var _0x42a59a=[];if(_0x1873f4){for(var _0x428ea7=0x0;_0x428ea7<_0x1873f4[_0x6b4e('0x35')];_0x428ea7+=0x1){var _0x560fdd=_0x1873f4[_0x428ea7]['get']({'plain':!![]});_0x2630da[_0x6b4e('0x64')]=_0x4e4d8b[_0x6b4e('0x48')]['dialCheckDuplicateType']?_0x4e4d8b['body'][_0x6b4e('0x64')]:_0x2630da['dialCheckDuplicateType'];switch(_0x2630da[_0x6b4e('0x64')]){case _0x6b4e('0x65'):_0x4625d9=squel[_0x6b4e('0x66')]()[_0x6b4e('0x67')](_0x6b4e('0x68'))[_0x6b4e('0x69')]([_0x6b4e('0x6a'),_0x6b4e('0x6b'),'ContactId',_0x6b4e('0x6c'),_0x6b4e('0x56'),_0x6b4e('0x51'),_0x6b4e('0x52')],squel[_0x6b4e('0x6d')]()[_0x6b4e('0x6e')](_0x6b4e('0x6a'),_0x6b4e('0x6a'))[_0x6b4e('0x6e')]('NOW()','scheduledAt')[_0x6b4e('0x6e')]('id','ContactId')[_0x6b4e('0x6e')](_0x560fdd[_0x6b4e('0x6f')]['toString'](),_0x6b4e('0x6c'))[_0x6b4e('0x6e')](_0x4e4d8b[_0x6b4e('0x45')]['id'][_0x6b4e('0x70')](),_0x6b4e('0x56'))[_0x6b4e('0x6e')]('NOW()','createdAt')[_0x6b4e('0x6e')](_0x6b4e('0x71'),_0x6b4e('0x52'))[_0x6b4e('0x72')]('cm_contacts')[_0x6b4e('0x3a')](_0x6b4e('0x73'))[_0x6b4e('0x3a')](_0x6b4e('0x74'),_0x560fdd[_0x6b4e('0x6f')][_0x6b4e('0x70')]())[_0x6b4e('0x3a')](_0x6b4e('0x75'))['where'](_0x6b4e('0x76'),squel['select']()[_0x6b4e('0x6e')](_0x6b4e('0x77'))['from']('cm_hopper_final')['where'](_0x6b4e('0x78'),_0x4e4d8b[_0x6b4e('0x45')]['id']['toString']()))[_0x6b4e('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6b4e('0x6d')]()[_0x6b4e('0x6e')](_0x6b4e('0x79'))[_0x6b4e('0x72')](_0x6b4e('0x68'))[_0x6b4e('0x3a')]('CampaignId\x20=\x20?',_0x4e4d8b[_0x6b4e('0x45')]['id'][_0x6b4e('0x70')]())))['toString']();break;case'onlyIfOpen':_0x4625d9=squel[_0x6b4e('0x66')]()[_0x6b4e('0x67')](_0x6b4e('0x68'))['fromQuery'](['phone',_0x6b4e('0x6b'),'ContactId',_0x6b4e('0x6c'),_0x6b4e('0x56'),_0x6b4e('0x51'),'updatedAt'],squel[_0x6b4e('0x6d')]()[_0x6b4e('0x6e')](_0x6b4e('0x6a'),_0x6b4e('0x6a'))['field'](_0x6b4e('0x71'),_0x6b4e('0x6b'))[_0x6b4e('0x6e')]('id',_0x6b4e('0x7a'))[_0x6b4e('0x6e')](_0x560fdd[_0x6b4e('0x6f')][_0x6b4e('0x70')](),'ListId')[_0x6b4e('0x6e')](_0x4e4d8b[_0x6b4e('0x45')]['id'][_0x6b4e('0x70')](),'CampaignId')[_0x6b4e('0x6e')](_0x6b4e('0x71'),_0x6b4e('0x51'))['field'](_0x6b4e('0x71'),_0x6b4e('0x52'))['from']('cm_contacts')[_0x6b4e('0x3a')](_0x6b4e('0x73'))['where'](_0x6b4e('0x74'),_0x560fdd['CmListId'][_0x6b4e('0x70')]())['where'](_0x6b4e('0x75'))[_0x6b4e('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6b4e('0x6d')]()[_0x6b4e('0x6e')]('COALESCE(phone,\x27\x27)')[_0x6b4e('0x72')](_0x6b4e('0x68'))['where'](_0x6b4e('0x78'),_0x4e4d8b[_0x6b4e('0x45')]['id'][_0x6b4e('0x70')]())))[_0x6b4e('0x70')]();break;default:_0x4625d9=squel[_0x6b4e('0x66')]()[_0x6b4e('0x67')]('cm_hopper')['fromQuery']([_0x6b4e('0x6a'),_0x6b4e('0x6b'),_0x6b4e('0x7a'),_0x6b4e('0x6c'),_0x6b4e('0x56'),_0x6b4e('0x51'),_0x6b4e('0x52')],squel['select']()[_0x6b4e('0x6e')](_0x6b4e('0x6a'),'phone')[_0x6b4e('0x6e')]('NOW()',_0x6b4e('0x6b'))[_0x6b4e('0x6e')]('id',_0x6b4e('0x7a'))[_0x6b4e('0x6e')](_0x560fdd['CmListId'][_0x6b4e('0x70')](),'ListId')[_0x6b4e('0x6e')](_0x4e4d8b[_0x6b4e('0x45')]['id'][_0x6b4e('0x70')](),_0x6b4e('0x56'))[_0x6b4e('0x6e')](_0x6b4e('0x71'),_0x6b4e('0x51'))[_0x6b4e('0x6e')]('NOW()','updatedAt')[_0x6b4e('0x72')](_0x6b4e('0x7b'))['where'](_0x6b4e('0x73'))[_0x6b4e('0x3a')](_0x6b4e('0x74'),_0x560fdd[_0x6b4e('0x6f')]['toString']())[_0x6b4e('0x3a')](_0x6b4e('0x75')))['toString']();}_0x42a59a[_0x6b4e('0x7c')](db[_0x6b4e('0x7d')][_0x6b4e('0x30')](_0x4625d9));}return BPromise[_0x6b4e('0x7e')](_0x42a59a);}})[_0x6b4e('0x23')](function(){return _0x28d9e1;})[_0x6b4e('0x23')](respondWithResult(_0x424202,null))[_0x6b4e('0x44')](handleError(_0x424202,null));};exports['removeLists']=function(_0x1674c7,_0x1b4f38,_0x133acf){return db['Campaign'][_0x6b4e('0x46')]({'where':{'id':_0x1674c7[_0x6b4e('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b4f38,null))[_0x6b4e('0x23')](function(_0xb5a15){if(_0xb5a15){return _0xb5a15[_0x6b4e('0x7f')](_0x1674c7['query'][_0x6b4e('0x62')]);}})[_0x6b4e('0x23')](function(_0x388023){if(_0x388023){return db['CmHopper'][_0x6b4e('0x22')]({'where':{'ListId':_0x1674c7[_0x6b4e('0x30')][_0x6b4e('0x62')],'CampaignId':_0x1674c7[_0x6b4e('0x45')]['id']}})['then'](function(){return _0x388023;});}})[_0x6b4e('0x23')](respondWithStatusCode(_0x1b4f38,null))['catch'](handleError(_0x1b4f38,null));};exports[_0x6b4e('0x80')]=function(_0x467dd8,_0x27c72d,_0x18649d){var _0x2a60c4={'raw':!![],'where':{}};var _0x343171={};var _0x44ed89={'count':0x0,'rows':[]};return db[_0x6b4e('0x2b')]['findOne']({'where':{'id':_0x467dd8[_0x6b4e('0x45')]['id']}})[_0x6b4e('0x23')](handleEntityNotFound(_0x27c72d,null))[_0x6b4e('0x23')](function(_0x38ae68){if(_0x38ae68){_0x343171['model']=_['keys'](db[_0x6b4e('0x60')]['rawAttributes']);_0x343171[_0x6b4e('0x30')]=_['keys'](_0x467dd8['query']);_0x343171['filters']=_[_0x6b4e('0x32')](_0x343171[_0x6b4e('0x2f')],_0x343171[_0x6b4e('0x30')]);_0x2a60c4['attributes']=_[_0x6b4e('0x32')](_0x343171[_0x6b4e('0x2f')],qs[_0x6b4e('0x34')](_0x467dd8[_0x6b4e('0x30')][_0x6b4e('0x34')]));_0x2a60c4[_0x6b4e('0x33')]=_0x2a60c4[_0x6b4e('0x33')][_0x6b4e('0x35')]?_0x2a60c4[_0x6b4e('0x33')]:_0x343171['model'];if(!_0x467dd8[_0x6b4e('0x30')]['hasOwnProperty'](_0x6b4e('0x37'))){_0x2a60c4[_0x6b4e('0x1c')]=qs[_0x6b4e('0x1c')](_0x467dd8[_0x6b4e('0x30')][_0x6b4e('0x1c')]);_0x2a60c4[_0x6b4e('0x1b')]=qs['offset'](_0x467dd8[_0x6b4e('0x30')][_0x6b4e('0x1b')]);}_0x2a60c4[_0x6b4e('0x38')]=qs[_0x6b4e('0x39')](_0x467dd8[_0x6b4e('0x30')][_0x6b4e('0x39')]);_0x2a60c4['where']=qs[_0x6b4e('0x3c')](_[_0x6b4e('0x3b')](_0x467dd8[_0x6b4e('0x30')],_0x343171[_0x6b4e('0x3c')]));_0x2a60c4['where']['CampaignId']=_0x38ae68['id'];if(_0x467dd8['query'][_0x6b4e('0x3f')]){_0x2a60c4[_0x6b4e('0x3a')]=_[_0x6b4e('0x3d')](_0x2a60c4[_0x6b4e('0x3a')],{'$or':_[_0x6b4e('0x2a')](_0x2a60c4[_0x6b4e('0x33')],function(_0x4c440b){var _0x298c39={};_0x298c39[_0x4c440b]={'$like':'%'+_0x467dd8[_0x6b4e('0x30')]['filter']+'%'};return _0x298c39;})});}_0x2a60c4=_['merge']({},_0x2a60c4,_0x467dd8[_0x6b4e('0x40')]);return db['CmList'][_0x6b4e('0x41')]({'where':_0x2a60c4['where']})[_0x6b4e('0x23')](function(_0x5312af){_0x44ed89['count']=_0x5312af;if(_0x467dd8[_0x6b4e('0x30')]['includeAll']){_0x2a60c4[_0x6b4e('0x43')]=[{'all':!![]}];}return db['CmList'][_0x6b4e('0x57')](_0x2a60c4);})[_0x6b4e('0x23')](function(_0x6d498e){_0x44ed89[_0x6b4e('0x58')]=_0x6d498e;return _0x44ed89;});}})['then'](respondWithFilteredResult(_0x27c72d,_0x2a60c4))[_0x6b4e('0x44')](handleError(_0x27c72d,null));};exports[_0x6b4e('0x81')]=function(_0x31ae39,_0x4d54fc,_0x505985){var _0x233ad5,_0x4e6c09;return db[_0x6b4e('0x2b')][_0x6b4e('0x46')]({'where':{'id':_0x31ae39['params']['id']}})['then'](handleEntityNotFound(_0x4d54fc,null))[_0x6b4e('0x23')](function(_0xbc35b5){if(_0xbc35b5){_0x4e6c09=_0xbc35b5;return _0xbc35b5[_0x6b4e('0x81')](_0x31ae39['body']['ids'],_[_0x6b4e('0x50')](_0x31ae39[_0x6b4e('0x48')],['ids','id'])||{});}return null;})[_0x6b4e('0x63')](function(_0x4b533f){var _0x43e75a;_0x233ad5=_0x4b533f||[];var _0x5b31fe=[];if(_0x4b533f){for(var _0x388958=0x0;_0x388958<_0x4b533f[_0x6b4e('0x35')];_0x388958+=0x1){var _0x4934c9=_0x4b533f[_0x388958][_0x6b4e('0x24')]({'plain':!![]});_0x43e75a=squel['insert']()[_0x6b4e('0x67')](_0x6b4e('0x82'))[_0x6b4e('0x69')](['phone','ContactId',_0x6b4e('0x6c'),_0x6b4e('0x56'),'createdAt',_0x6b4e('0x52')],squel[_0x6b4e('0x6d')]()['field'](_0x6b4e('0x6a'),_0x6b4e('0x6a'))[_0x6b4e('0x6e')]('id',_0x6b4e('0x7a'))[_0x6b4e('0x6e')](_0x4934c9[_0x6b4e('0x6f')][_0x6b4e('0x70')](),_0x6b4e('0x6c'))['field'](_0x31ae39['params']['id'][_0x6b4e('0x70')](),_0x6b4e('0x56'))['field']('NOW()',_0x6b4e('0x51'))[_0x6b4e('0x6e')](_0x6b4e('0x71'),_0x6b4e('0x52'))[_0x6b4e('0x72')](_0x6b4e('0x7b'))[_0x6b4e('0x3a')](_0x6b4e('0x73'))[_0x6b4e('0x3a')](_0x6b4e('0x74'),_0x4934c9[_0x6b4e('0x6f')]['toString']())[_0x6b4e('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x6b4e('0x70')]();_0x5b31fe[_0x6b4e('0x7c')](db[_0x6b4e('0x7d')][_0x6b4e('0x30')](_0x43e75a));}return BPromise['all'](_0x5b31fe);}})[_0x6b4e('0x23')](function(){return _0x233ad5;})[_0x6b4e('0x23')](respondWithResult(_0x4d54fc,null))[_0x6b4e('0x44')](handleError(_0x4d54fc,null));};exports[_0x6b4e('0x83')]=function(_0x1c0eaa,_0x2a2bf1,_0x15254c){return db[_0x6b4e('0x2b')][_0x6b4e('0x46')]({'where':{'id':_0x1c0eaa['params']['id']}})[_0x6b4e('0x23')](handleEntityNotFound(_0x2a2bf1,null))['then'](function(_0x1266f4){if(_0x1266f4){return _0x1266f4['removeBlackLists'](_0x1c0eaa[_0x6b4e('0x30')][_0x6b4e('0x62')]);}})[_0x6b4e('0x23')](function(_0x5e9fe3){if(_0x5e9fe3){return db[_0x6b4e('0x5e')][_0x6b4e('0x22')]({'where':{'ListId':_0x1c0eaa[_0x6b4e('0x30')][_0x6b4e('0x62')],'CampaignId':_0x1c0eaa[_0x6b4e('0x45')]['id']}})['then'](function(){return _0x5e9fe3;});}})[_0x6b4e('0x23')](respondWithStatusCode(_0x2a2bf1,null))[_0x6b4e('0x44')](handleError(_0x2a2bf1,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index cb0a071..08a92f2 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 _0x7e18=['rimraf','../../config/environment','exports','Campaign','campaigns','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x7e18,0x87));var _0x87e1=function(_0x1fa594,_0x3102ed){_0x1fa594=_0x1fa594-0x0;var _0x3200e9=_0x7e18[_0x1fa594];return _0x3200e9;};'use strict';var _=require(_0x87e1('0x0'));var util=require('util');var logger=require(_0x87e1('0x1'))('api');var moment=require(_0x87e1('0x2'));var BPromise=require(_0x87e1('0x3'));var rp=require(_0x87e1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x87e1('0x5'));var config=require(_0x87e1('0x6'));var attributes=require('./campaign.attributes');module[_0x87e1('0x7')]=function(_0x41e663,_0x36c100){return _0x41e663['define'](_0x87e1('0x8'),attributes,{'tableName':_0x87e1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf07=['bluebird','request-promise','path','../../config/environment','./campaign.attributes','exports','Campaign','../../config/logger','moment'];(function(_0x501980,_0x382668){var _0x181e59=function(_0x440064){while(--_0x440064){_0x501980['push'](_0x501980['shift']());}};_0x181e59(++_0x382668);}(_0xaf07,0x115));var _0x7af0=function(_0x4d95de,_0x26ff83){_0x4d95de=_0x4d95de-0x0;var _0x2fd50f=_0xaf07[_0x4d95de];return _0x2fd50f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7af0('0x0'))('api');var moment=require(_0x7af0('0x1'));var BPromise=require(_0x7af0('0x2'));var rp=require(_0x7af0('0x3'));var fs=require('fs');var path=require(_0x7af0('0x4'));var rimraf=require('rimraf');var config=require(_0x7af0('0x5'));var attributes=require(_0x7af0('0x6'));module[_0x7af0('0x7')]=function(_0x2a2f33,_0x2bbeed){return _0x2a2f33['define'](_0x7af0('0x8'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 818b9e0..fd3e98a 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(_0x280da0,_0x8e5927){var _0x2128c9=function(_0x130bbd){while(--_0x130bbd){_0x280da0['push'](_0x280da0['shift']());}};_0x2128c9(++_0x8e5927);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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(_0x5298bf,_0x24f030){var _0x31f81c=function(_0x4da537){while(--_0x4da537){_0x5298bf['push'](_0x5298bf['shift']());}};_0x31f81c(++_0x24f030);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 d9a618a..39ae69a 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 _0xebc0=['/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','/:id/blacklists','addBlackLists','put','update','delete','/:id','destroy','removeLists','removeBlackLists','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','show','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0x584d83,_0x4d309f){var _0x35bb5b=function(_0x57e849){while(--_0x57e849){_0x584d83['push'](_0x584d83['shift']());}};_0x35bb5b(++_0x4d309f);}(_0xebc0,0xe5));var _0x0ebc=function(_0x48b916,_0x100bf0){_0x48b916=_0x48b916-0x0;var _0x3b8f23=_0xebc0[_0x48b916];return _0x3b8f23;};'use strict';var multer=require(_0x0ebc('0x0'));var util=require(_0x0ebc('0x1'));var path=require(_0x0ebc('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ebc('0x3'));var router=express[_0x0ebc('0x4')]();var auth=require(_0x0ebc('0x5'));var interaction=require(_0x0ebc('0x6'));var config=require(_0x0ebc('0x7'));var controller=require(_0x0ebc('0x8'));router[_0x0ebc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0ebc('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x0ebc('0xa')]);router[_0x0ebc('0x9')]('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router[_0x0ebc('0x9')](_0x0ebc('0xb'),auth[_0x0ebc('0xc')](),controller[_0x0ebc('0xd')]);router['get'](_0x0ebc('0xe'),auth[_0x0ebc('0xc')](),controller[_0x0ebc('0xf')]);router[_0x0ebc('0x9')](_0x0ebc('0x10'),auth[_0x0ebc('0xc')](),controller[_0x0ebc('0x11')]);router[_0x0ebc('0x9')](_0x0ebc('0x12'),auth[_0x0ebc('0xc')](),controller[_0x0ebc('0x13')]);router[_0x0ebc('0x9')]('/:id/blacklists',auth[_0x0ebc('0xc')](),controller[_0x0ebc('0x14')]);router[_0x0ebc('0x15')]('/',auth[_0x0ebc('0xc')](),controller[_0x0ebc('0x16')]);router[_0x0ebc('0x15')](_0x0ebc('0x17'),auth[_0x0ebc('0xc')](),controller[_0x0ebc('0x18')]);router[_0x0ebc('0x15')](_0x0ebc('0x12'),auth[_0x0ebc('0xc')](),controller['addLists']);router[_0x0ebc('0x15')](_0x0ebc('0x19'),auth[_0x0ebc('0xc')](),controller[_0x0ebc('0x1a')]);router[_0x0ebc('0x1b')]('/:id',auth[_0x0ebc('0xc')](),controller[_0x0ebc('0x1c')]);router[_0x0ebc('0x1d')](_0x0ebc('0x1e'),auth[_0x0ebc('0xc')](),controller[_0x0ebc('0x1f')]);router['delete'](_0x0ebc('0x12'),auth[_0x0ebc('0xc')](),controller[_0x0ebc('0x20')]);router[_0x0ebc('0x1d')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x0ebc('0x21')]);module[_0x0ebc('0x22')]=router; \ No newline at end of file +var _0x1a05=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','update','destroy','delete','removeLists','exports','multer'];(function(_0x29a40a,_0x234214){var _0x6182e9=function(_0x569d5d){while(--_0x569d5d){_0x29a40a['push'](_0x29a40a['shift']());}};_0x6182e9(++_0x234214);}(_0x1a05,0x153));var _0x51a0=function(_0x88a617,_0xcd4fe0){_0x88a617=_0x88a617-0x0;var _0xcd5aa0=_0x1a05[_0x88a617];return _0xcd5aa0;};'use strict';var multer=require(_0x51a0('0x0'));var util=require(_0x51a0('0x1'));var path=require('path');var timeout=require(_0x51a0('0x2'));var express=require(_0x51a0('0x3'));var router=express[_0x51a0('0x4')]();var auth=require(_0x51a0('0x5'));var interaction=require(_0x51a0('0x6'));var config=require(_0x51a0('0x7'));var controller=require(_0x51a0('0x8'));router[_0x51a0('0x9')]('/',auth[_0x51a0('0xa')](),controller['index']);router[_0x51a0('0x9')](_0x51a0('0xb'),auth[_0x51a0('0xa')](),controller[_0x51a0('0xc')]);router['get'](_0x51a0('0xd'),auth[_0x51a0('0xa')](),controller['getHoppers']);router[_0x51a0('0x9')](_0x51a0('0xe'),auth['isAuthenticated'](),controller[_0x51a0('0xf')]);router[_0x51a0('0x9')](_0x51a0('0x10'),auth[_0x51a0('0xa')](),controller[_0x51a0('0x11')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x51a0('0x12')]);router[_0x51a0('0x9')](_0x51a0('0x13'),auth[_0x51a0('0xa')](),controller[_0x51a0('0x14')]);router['get'](_0x51a0('0x15'),auth['isAuthenticated'](),controller[_0x51a0('0x16')]);router[_0x51a0('0x17')]('/',auth['isAuthenticated'](),controller['create']);router[_0x51a0('0x17')](_0x51a0('0x18'),auth['isAuthenticated'](),controller[_0x51a0('0x19')]);router['post'](_0x51a0('0x13'),auth[_0x51a0('0xa')](),controller[_0x51a0('0x1a')]);router[_0x51a0('0x17')](_0x51a0('0x15'),auth[_0x51a0('0xa')](),controller[_0x51a0('0x1b')]);router[_0x51a0('0x1c')](_0x51a0('0xb'),auth[_0x51a0('0xa')](),controller[_0x51a0('0x1d')]);router['delete'](_0x51a0('0xb'),auth[_0x51a0('0xa')](),controller[_0x51a0('0x1e')]);router[_0x51a0('0x1f')]('/:id/lists',auth['isAuthenticated'](),controller[_0x51a0('0x20')]);router['delete'](_0x51a0('0x15'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x51a0('0x21')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index ade8747..162a509 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 _0x235e=['key','sequelize','exports','STRING','VIRTUAL'];(function(_0x1c7137,_0x4c7c26){var _0xeb4432=function(_0x26d850){while(--_0x26d850){_0x1c7137['push'](_0x1c7137['shift']());}};_0xeb4432(++_0x4c7c26);}(_0x235e,0x119));var _0xe235=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x235e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe235('0x0'));module[_0xe235('0x1')]={'key':{'type':Sequelize[_0xe235('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xe235('0x2')]},'name':{'type':Sequelize[_0xe235('0x3')],'get':function(){return this['getDataValue'](_0xe235('0x4'));}}}; \ No newline at end of file +var _0xede9=['exports','STRING','TEXT','getDataValue','sequelize'];(function(_0x27a4e0,_0x4816f5){var _0x2b57c7=function(_0x539d59){while(--_0x539d59){_0x27a4e0['push'](_0x27a4e0['shift']());}};_0x2b57c7(++_0x4816f5);}(_0xede9,0x1d5));var _0x9ede=function(_0x1d232f,_0xd63afb){_0x1d232f=_0x1d232f-0x0;var _0x239a79=_0xede9[_0x1d232f];return _0x239a79;};'use strict';var Sequelize=require(_0x9ede('0x0'));module[_0x9ede('0x1')]={'key':{'type':Sequelize[_0x9ede('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x9ede('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x9ede('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9ede('0x4')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 34cb0f4..e184499 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 _0xa9e0=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x2ec755){return{'name':_0x2ec755['fieldName'],'type':_0x2ec755[_0x0a9e('0x2c')][_0x0a9e('0x2d')]};});_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x29')](_0x5a101a,_0x0a9e('0x26'));_0x11c3b6[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x14433c[_0x0a9e('0x2f')]);_0x11c3b6[_0x0a9e('0x31')]=_['intersection'](_0x11c3b6[_0x0a9e('0x2e')],_0x11c3b6['query']);_0x1538a4[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x11c3b6[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2f')]['fields']));_0x1538a4[_0x0a9e('0x32')]=_0x1538a4[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x1538a4[_0x0a9e('0x32')]:_0x11c3b6[_0x0a9e('0x2e')];if(!_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x36')](_0x0a9e('0x37'))){_0x1538a4['limit']=qs[_0x0a9e('0x38')](_0x14433c['query'][_0x0a9e('0x38')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x2f')]['offset']);}_0x1538a4[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3a')]);_0x1538a4['where']=qs['filters'](_[_0x0a9e('0x3b')](_0x14433c['query'],_0x11c3b6[_0x0a9e('0x31')]));if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3c')]){_0x1538a4[_0x0a9e('0x3d')]=_['merge'](_0x1538a4[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x29')](_0x5a101a,function(_0x3cae){if(_0x3cae['type']!==_0x0a9e('0x3e')){var _0x1a180b={};_0x1a180b[_0x3cae[_0x0a9e('0x26')]]={'$like':'%'+_0x14433c['query']['filter']+'%'};return _0x1a180b;}})});}_0x1538a4=_[_0x0a9e('0x3f')]({},_0x1538a4,_0x14433c[_0x0a9e('0x40')]);var _0x5adda1={'where':_0x1538a4[_0x0a9e('0x3d')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x17')](_0x5adda1)[_0x0a9e('0x1f')](function(_0x4b38d9){_0x14de77['count']=_0x4b38d9;if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x1538a4['include']=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x42')](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x5b4f5e){_0x14de77[_0x0a9e('0x43')]=_0x5b4f5e;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x44')](handleError(_0x140511,null));};exports[_0x0a9e('0x45')]=function(_0x13cb1f,_0xeaa5e5){var _0x2881b3={'raw':!![],'where':{'id':_0x13cb1f[_0x0a9e('0x46')]['id']}},_0x45a9b8={};_0x45a9b8[_0x0a9e('0x2e')]=_[_0x0a9e('0x30')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x45a9b8[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x13cb1f['query']);_0x45a9b8['filters']=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],_0x45a9b8[_0x0a9e('0x2f')]);_0x2881b3[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x34')]));_0x2881b3[_0x0a9e('0x32')]=_0x2881b3[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x2881b3['attributes']:_0x45a9b8[_0x0a9e('0x2e')];if(_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x2881b3[_0x0a9e('0x47')]=[{'all':!![]}];}_0x2881b3=_[_0x0a9e('0x3f')]({},_0x2881b3,_0x13cb1f[_0x0a9e('0x40')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x48')](_0x2881b3)['then'](handleEntityNotFound(_0xeaa5e5,null))[_0x0a9e('0x1f')](respondWithResult(_0xeaa5e5,null))['catch'](handleError(_0xeaa5e5,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x49')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x476688[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x49')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x44')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x1b5e80[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};exports[_0x0a9e('0x4a')]=function(_0x3fe430,_0x4f7240){var _0x4ae14b={'key':_0x3fe430['body'][_0x0a9e('0x2d')]};if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')]){_0x4ae14b[_0x0a9e('0x4b')]=_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4c')]){_0x4ae14b['SmsAccountId']=_0x3fe430['body']['SmsAccountId'];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4d')]){_0x4ae14b[_0x0a9e('0x4d')]=_0x3fe430['body'][_0x0a9e('0x4d')];}else if(_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId']){_0x4ae14b['ChatWebsiteId']=_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId'];}return db[_0x0a9e('0x2a')]['find']({'where':_0x4ae14b})[_0x0a9e('0x1f')](function(_0x3c20b2){if(_0x3c20b2){throw new db[(_0x0a9e('0x4e'))]['ValidationError'](_0x0a9e('0x4f'));}return db[_0x0a9e('0x2a')]['create'](_0x3fe430['body']);})[_0x0a9e('0x1f')](function(_0x3aedd0){var _0x49c095=_0x3fe430[_0x0a9e('0x50')]['get']({'plain':!![]});if(!_0x49c095)throw new Error(_0x0a9e('0x51'));if(_0x49c095['role']===_0x0a9e('0x50')){var _0x4a6deb=_0x3aedd0['get']({'plain':!![]});return db['UserProfileSection'][_0x0a9e('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x49c095[_0x0a9e('0x52')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x3cfd00){if(_0x3cfd00&&_0x3cfd00[_0x0a9e('0x53')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x4a')]({'name':_0x4a6deb[_0x0a9e('0x26')],'resourceId':_0x4a6deb['id'],'type':_0x3cfd00[_0x0a9e('0x26')],'sectionId':_0x3cfd00['id']},{})['then'](function(){return _0x3aedd0;});}else{return _0x3aedd0;}})[_0x0a9e('0x44')](function(_0x121cef){logger[_0x0a9e('0x25')](_0x0a9e('0x54'),_0x121cef);throw _0x121cef;});}return _0x3aedd0;})[_0x0a9e('0x1f')](respondWithResult(_0x4f7240,0xc9))[_0x0a9e('0x44')](handleError(_0x4f7240,null));}; \ No newline at end of file +var _0x34e8=['filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','include','findAll','catch','show','includeAll','find','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','CannedAnswers','destroy','sendStatus','error','stack','name','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x2101e6,_0x5f4e7f){var _0x53186e=function(_0x2fe7a9){while(--_0x2fe7a9){_0x2101e6['push'](_0x2101e6['shift']());}};_0x53186e(++_0x5f4e7f);}(_0x34e8,0x12c));var _0x834e=function(_0x1c5b29,_0x26df3d){_0x1c5b29=_0x1c5b29-0x0;var _0x20c17=_0x34e8[_0x1c5b29];return _0x20c17;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var as=require(_0x834e('0x16'));var hardwareService=require(_0x834e('0x17'));var logger=require(_0x834e('0x18'))(_0x834e('0x19'));var utils=require(_0x834e('0x1a'));var config=require(_0x834e('0x1b'));var db=require(_0x834e('0x1c'))['db'];function respondWithStatusCode(_0x538bb3,_0x5e5b6d){_0x5e5b6d=_0x5e5b6d||0xcc;return function(_0x6cd9b9){if(_0x6cd9b9){return _0x538bb3['sendStatus'](_0x5e5b6d);}return _0x538bb3[_0x834e('0x1d')](_0x5e5b6d)[_0x834e('0x1e')]();};}function respondWithResult(_0x28e659,_0x21cc0a){_0x21cc0a=_0x21cc0a||0xc8;return function(_0x50e860){if(_0x50e860){return _0x28e659[_0x834e('0x1d')](_0x21cc0a)[_0x834e('0x1f')](_0x50e860);}};}function respondWithFilteredResult(_0x57274a,_0x316205){return function(_0x4a9cdc){if(_0x4a9cdc){var _0x38a8cd=_0x4a9cdc[_0x834e('0x20')],_0x36d443=_0x316205[_0x834e('0x21')],_0x478afe=_0x316205['offset']+_0x316205[_0x834e('0x22')],_0x43ac41;if(_0x478afe>=_0x38a8cd){_0x478afe=_0x38a8cd;_0x43ac41=0xc8;}else{_0x43ac41=0xce;}_0x57274a[_0x834e('0x1d')](_0x43ac41);return _0x57274a[_0x834e('0x23')](_0x834e('0x24'),_0x36d443+'-'+_0x478afe+'/'+_0x38a8cd)[_0x834e('0x1f')](_0x4a9cdc);}return null;};}function patchUpdates(_0x254677){return function(_0x1dd214){try{jsonpatch['apply'](_0x1dd214,_0x254677,!![]);}catch(_0x2545b4){return BPromise[_0x834e('0x25')](_0x2545b4);}return _0x1dd214[_0x834e('0x26')]();};}function saveUpdates(_0x325a99,_0x4ab05d){return function(_0x45a630){if(_0x45a630){return _0x45a630[_0x834e('0x27')](_0x325a99)['then'](function(_0x1b4bdf){return _0x1b4bdf;});}return null;};}function removeEntity(_0x28d687,_0x8d406e){return function(_0x5c55ca){if(_0x5c55ca){return _0x5c55ca['destroy']()[_0x834e('0x28')](function(){var _0x34563b=_0x5c55ca['get']({'plain':!![]});var _0x25ee1d=_0x834e('0x29');return db['UserProfileResource'][_0x834e('0x2a')]({'where':{'type':_0x25ee1d,'resourceId':_0x34563b['id']}})[_0x834e('0x28')](function(){return _0x5c55ca;});})[_0x834e('0x28')](function(){_0x28d687['status'](0xcc)[_0x834e('0x1e')]();});}};}function handleEntityNotFound(_0x3e310f,_0x5e1cc5){return function(_0x5bef62){if(!_0x5bef62){_0x3e310f[_0x834e('0x2b')](0x194);}return _0x5bef62;};}function handleError(_0x508a1d,_0x2826ec){_0x2826ec=_0x2826ec||0x1f4;return function(_0x3f1b0b){logger[_0x834e('0x2c')](_0x3f1b0b[_0x834e('0x2d')]);if(_0x3f1b0b[_0x834e('0x2e')]){delete _0x3f1b0b[_0x834e('0x2e')];}_0x508a1d['status'](_0x2826ec)['send'](_0x3f1b0b);};}exports['index']=function(_0x58c1d7,_0x2c7a8d){var _0x567cea={},_0x106d6a={},_0x5dacc1={'count':0x0,'rows':[]};var _0xb5bc06=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x4551f5){return{'name':_0x4551f5[_0x834e('0x32')],'type':_0x4551f5[_0x834e('0x33')][_0x834e('0x34')]};});_0x106d6a[_0x834e('0x35')]=_['map'](_0xb5bc06,_0x834e('0x2e'));_0x106d6a['query']=_[_0x834e('0x36')](_0x58c1d7[_0x834e('0x37')]);_0x106d6a[_0x834e('0x38')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],_0x106d6a[_0x834e('0x37')]);_0x567cea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],qs[_0x834e('0x3b')](_0x58c1d7['query'][_0x834e('0x3b')]));_0x567cea[_0x834e('0x3a')]=_0x567cea[_0x834e('0x3a')][_0x834e('0x3c')]?_0x567cea['attributes']:_0x106d6a[_0x834e('0x35')];if(!_0x58c1d7[_0x834e('0x37')]['hasOwnProperty']('nolimit')){_0x567cea['limit']=qs[_0x834e('0x22')](_0x58c1d7[_0x834e('0x37')][_0x834e('0x22')]);_0x567cea[_0x834e('0x21')]=qs[_0x834e('0x21')](_0x58c1d7[_0x834e('0x37')]['offset']);}_0x567cea[_0x834e('0x3d')]=qs['sort'](_0x58c1d7[_0x834e('0x37')][_0x834e('0x3e')]);_0x567cea['where']=qs[_0x834e('0x38')](_[_0x834e('0x3f')](_0x58c1d7['query'],_0x106d6a['filters']));if(_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]){_0x567cea[_0x834e('0x41')]=_[_0x834e('0x42')](_0x567cea[_0x834e('0x41')],{'$or':_['map'](_0xb5bc06,function(_0x1c5ed6){if(_0x1c5ed6['type']!=='VIRTUAL'){var _0x1b2edf={};_0x1b2edf[_0x1c5ed6['name']]={'$like':'%'+_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]+'%'};return _0x1b2edf;}})});}_0x567cea=_[_0x834e('0x42')]({},_0x567cea,_0x58c1d7[_0x834e('0x43')]);var _0x2b7933={'where':_0x567cea['where']};return db[_0x834e('0x30')][_0x834e('0x20')](_0x2b7933)[_0x834e('0x28')](function(_0x58c5fb){_0x5dacc1[_0x834e('0x20')]=_0x58c5fb;if(_0x58c1d7[_0x834e('0x37')]['includeAll']){_0x567cea[_0x834e('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0x834e('0x45')](_0x567cea);})[_0x834e('0x28')](function(_0x4a18bb){_0x5dacc1['rows']=_0x4a18bb;return _0x5dacc1;})[_0x834e('0x28')](respondWithFilteredResult(_0x2c7a8d,_0x567cea))[_0x834e('0x46')](handleError(_0x2c7a8d,null));};exports[_0x834e('0x47')]=function(_0xbc1571,_0x8ad264){var _0x23feea={'raw':!![],'where':{'id':_0xbc1571['params']['id']}},_0x195204={};_0x195204[_0x834e('0x35')]=_['keys'](db[_0x834e('0x30')]['rawAttributes']);_0x195204[_0x834e('0x37')]=_['keys'](_0xbc1571[_0x834e('0x37')]);_0x195204[_0x834e('0x38')]=_['intersection'](_0x195204[_0x834e('0x35')],_0x195204[_0x834e('0x37')]);_0x23feea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x195204[_0x834e('0x35')],qs[_0x834e('0x3b')](_0xbc1571[_0x834e('0x37')][_0x834e('0x3b')]));_0x23feea[_0x834e('0x3a')]=_0x23feea[_0x834e('0x3a')]['length']?_0x23feea[_0x834e('0x3a')]:_0x195204[_0x834e('0x35')];if(_0xbc1571['query'][_0x834e('0x48')]){_0x23feea[_0x834e('0x44')]=[{'all':!![]}];}_0x23feea=_[_0x834e('0x42')]({},_0x23feea,_0xbc1571[_0x834e('0x43')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x23feea)['then'](handleEntityNotFound(_0x8ad264,null))['then'](respondWithResult(_0x8ad264,null))[_0x834e('0x46')](handleError(_0x8ad264,null));};exports[_0x834e('0x27')]=function(_0x30568e,_0x40ff5a){if(_0x30568e[_0x834e('0x4a')]['id']){delete _0x30568e[_0x834e('0x4a')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x30568e[_0x834e('0x4b')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x40ff5a,null))[_0x834e('0x28')](saveUpdates(_0x30568e[_0x834e('0x4a')],null))[_0x834e('0x28')](respondWithResult(_0x40ff5a,null))[_0x834e('0x46')](handleError(_0x40ff5a,null));};exports[_0x834e('0x2a')]=function(_0x1a3855,_0x3df078){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1a3855[_0x834e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3df078,null))[_0x834e('0x28')](removeEntity(_0x3df078,null))[_0x834e('0x46')](handleError(_0x3df078,null));};exports['create']=function(_0x3c00a3,_0x3b0988){var _0x55d491={'key':_0x3c00a3[_0x834e('0x4a')][_0x834e('0x34')]};if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')]){_0x55d491[_0x834e('0x4c')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')];}else if(_0x3c00a3['body'][_0x834e('0x4d')]){_0x55d491[_0x834e('0x4d')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4d')];}else if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4e')]){_0x55d491[_0x834e('0x4e')]=_0x3c00a3[_0x834e('0x4a')]['OpenchannelAccountId'];}else if(_0x3c00a3[_0x834e('0x4a')]['ChatWebsiteId']){_0x55d491[_0x834e('0x4f')]=_0x3c00a3['body'][_0x834e('0x4f')];}return db['CannedAnswer']['find']({'where':_0x55d491})[_0x834e('0x28')](function(_0x3e1bee){if(_0x3e1bee){throw new db['Sequelize']['ValidationError'](_0x834e('0x50'));}return db[_0x834e('0x30')][_0x834e('0x51')](_0x3c00a3[_0x834e('0x4a')]);})[_0x834e('0x28')](function(_0x315858){var _0x3d3f2b=_0x3c00a3[_0x834e('0x52')]['get']({'plain':!![]});if(!_0x3d3f2b)throw new Error(_0x834e('0x53'));if(_0x3d3f2b[_0x834e('0x54')]==='user'){var _0x281342=_0x315858['get']({'plain':!![]});return db[_0x834e('0x55')][_0x834e('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x3d3f2b[_0x834e('0x56')]},'raw':!![]})[_0x834e('0x28')](function(_0x2de29a){if(_0x2de29a&&_0x2de29a[_0x834e('0x57')]===0x0){return db['UserProfileResource'][_0x834e('0x51')]({'name':_0x281342[_0x834e('0x2e')],'resourceId':_0x281342['id'],'type':_0x2de29a[_0x834e('0x2e')],'sectionId':_0x2de29a['id']},{})['then'](function(){return _0x315858;});}else{return _0x315858;}})[_0x834e('0x46')](function(_0x1fcae9){logger[_0x834e('0x2c')](_0x834e('0x58'),_0x1fcae9);throw _0x1fcae9;});}return _0x315858;})[_0x834e('0x28')](respondWithResult(_0x3b0988,0xc9))[_0x834e('0x46')](handleError(_0x3b0988,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index ab9188a..cc711e1 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 _0x28bc=['bluebird','path','rimraf','../../config/environment','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x57f244,_0x48df38){var _0x540920=function(_0x43a30e){while(--_0x43a30e){_0x57f244['push'](_0x57f244['shift']());}};_0x540920(++_0x48df38);}(_0x28bc,0x79));var _0xc28b=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0x28bc[_0x4bc65f];return _0x44f85f;};'use strict';var _=require(_0xc28b('0x0'));var util=require(_0xc28b('0x1'));var logger=require(_0xc28b('0x2'))(_0xc28b('0x3'));var moment=require(_0xc28b('0x4'));var BPromise=require(_0xc28b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc28b('0x6'));var rimraf=require(_0xc28b('0x7'));var config=require(_0xc28b('0x8'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x15c63a,_0x55daa4){return _0x15c63a[_0xc28b('0x9')](_0xc28b('0xa'),attributes,{'tableName':_0xc28b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc28b('0xc'),'collate':_0xc28b('0xd')});}; \ No newline at end of file +var _0x7e04=['api','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x54b4cc,_0x4838bb){var _0x5a4701=function(_0x18389f){while(--_0x18389f){_0x54b4cc['push'](_0x54b4cc['shift']());}};_0x5a4701(++_0x4838bb);}(_0x7e04,0x1cf));var _0x47e0=function(_0x4fe14d,_0x40b1ac){_0x4fe14d=_0x4fe14d-0x0;var _0x54abe3=_0x7e04[_0x4fe14d];return _0x54abe3;};'use strict';var _=require(_0x47e0('0x0'));var util=require('util');var logger=require(_0x47e0('0x1'))(_0x47e0('0x2'));var moment=require(_0x47e0('0x3'));var BPromise=require('bluebird');var rp=require(_0x47e0('0x4'));var fs=require('fs');var path=require(_0x47e0('0x5'));var rimraf=require(_0x47e0('0x6'));var config=require(_0x47e0('0x7'));var attributes=require(_0x47e0('0x8'));module[_0x47e0('0x9')]=function(_0x236508,_0x1c8d5e){return _0x236508[_0x47e0('0xa')](_0x47e0('0xb'),attributes,{'tableName':_0x47e0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x47e0('0xd'),'collate':_0x47e0('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 85476d4..814bed7 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 _0xe3e2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','CannedAnswer,\x20%s,\x20%s','request\x20sent','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment'];(function(_0x1f504c,_0x319b4f){var _0x50d2e6=function(_0x47f98d){while(--_0x47f98d){_0x1f504c['push'](_0x1f504c['shift']());}};_0x50d2e6(++_0x319b4f);}(_0xe3e2,0xc5));var _0x2e3e=function(_0x5d4a90,_0x209140){_0x5d4a90=_0x5d4a90-0x0;var _0x51e898=_0xe3e2[_0x5d4a90];return _0x51e898;};'use strict';var _=require(_0x2e3e('0x0'));var util=require(_0x2e3e('0x1'));var moment=require(_0x2e3e('0x2'));var BPromise=require(_0x2e3e('0x3'));var rs=require(_0x2e3e('0x4'));var fs=require('fs');var Redis=require(_0x2e3e('0x5'));var db=require(_0x2e3e('0x6'))['db'];var utils=require(_0x2e3e('0x7'));var logger=require(_0x2e3e('0x8'))(_0x2e3e('0x9'));var config=require(_0x2e3e('0xa'));var jayson=require(_0x2e3e('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3aa688,_0x2444fb,_0x107c28){return new BPromise(function(_0x442c5b,_0x509826){return client['request'](_0x3aa688,_0x107c28)[_0x2e3e('0xc')](function(_0x2e1336){logger['info'](_0x2e3e('0xd'),_0x2444fb,_0x2e3e('0xe'));logger['debug'](_0x2e3e('0xf'),_0x2444fb,'request\x20sent',JSON[_0x2e3e('0x10')](_0x2e1336));if(_0x2e1336['error']){if(_0x2e1336[_0x2e3e('0x11')]['code']===0x1f4){logger[_0x2e3e('0x11')](_0x2e3e('0xd'),_0x2444fb,_0x2e1336['error'][_0x2e3e('0x12')]);return _0x509826(_0x2e1336[_0x2e3e('0x11')][_0x2e3e('0x12')]);}logger[_0x2e3e('0x11')]('CannedAnswer,\x20%s,\x20%s',_0x2444fb,_0x2e1336[_0x2e3e('0x11')][_0x2e3e('0x12')]);return _0x442c5b(_0x2e1336[_0x2e3e('0x11')][_0x2e3e('0x12')]);}else{logger['info'](_0x2e3e('0xd'),_0x2444fb,'request\x20sent');_0x442c5b(_0x2e1336[_0x2e3e('0x13')][_0x2e3e('0x12')]);}})['catch'](function(_0x38562e){logger[_0x2e3e('0x11')](_0x2e3e('0xd'),_0x2444fb,_0x38562e);_0x509826(_0x38562e);});});} \ No newline at end of file +var _0xdf95=['debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent'];(function(_0x42a42a,_0x187dba){var _0x39e25a=function(_0x4d5e72){while(--_0x4d5e72){_0x42a42a['push'](_0x42a42a['shift']());}};_0x39e25a(++_0x187dba);}(_0xdf95,0x17c));var _0x5df9=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xdf95[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0x5df9('0x0'));var util=require(_0x5df9('0x1'));var moment=require(_0x5df9('0x2'));var BPromise=require(_0x5df9('0x3'));var rs=require(_0x5df9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5df9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5df9('0x6'))(_0x5df9('0x7'));var config=require('../../config/environment');var jayson=require(_0x5df9('0x8'));var client=jayson[_0x5df9('0x9')][_0x5df9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f1383,_0x2a656e,_0x4c2c42){return new BPromise(function(_0x5c293a,_0xcd53cc){return client[_0x5df9('0xb')](_0x1f1383,_0x4c2c42)[_0x5df9('0xc')](function(_0x2c9328){logger[_0x5df9('0xd')](_0x5df9('0xe'),_0x2a656e,_0x5df9('0xf'));logger[_0x5df9('0x10')]('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x2a656e,_0x5df9('0xf'),JSON[_0x5df9('0x11')](_0x2c9328));if(_0x2c9328[_0x5df9('0x12')]){if(_0x2c9328[_0x5df9('0x12')][_0x5df9('0x13')]===0x1f4){logger[_0x5df9('0x12')](_0x5df9('0xe'),_0x2a656e,_0x2c9328[_0x5df9('0x12')][_0x5df9('0x14')]);return _0xcd53cc(_0x2c9328[_0x5df9('0x12')][_0x5df9('0x14')]);}logger[_0x5df9('0x12')](_0x5df9('0xe'),_0x2a656e,_0x2c9328['error']['message']);return _0x5c293a(_0x2c9328[_0x5df9('0x12')][_0x5df9('0x14')]);}else{logger[_0x5df9('0xd')]('CannedAnswer,\x20%s,\x20%s',_0x2a656e,_0x5df9('0xf'));_0x5c293a(_0x2c9328['result'][_0x5df9('0x14')]);}})[_0x5df9('0x15')](function(_0x62f51a){logger[_0x5df9('0x12')](_0x5df9('0xe'),_0x2a656e,_0x62f51a);_0xcd53cc(_0x62f51a);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index d01525e..9093c0e 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 _0x5aa1=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post'];(function(_0x25d098,_0x9e0faa){var _0x23260d=function(_0x6d51f7){while(--_0x6d51f7){_0x25d098['push'](_0x25d098['shift']());}};_0x23260d(++_0x9e0faa);}(_0x5aa1,0x158));var _0x15aa=function(_0x4dd2c0,_0x47e15d){_0x4dd2c0=_0x4dd2c0-0x0;var _0x562f93=_0x5aa1[_0x4dd2c0];return _0x562f93;};'use strict';var multer=require(_0x15aa('0x0'));var util=require(_0x15aa('0x1'));var path=require(_0x15aa('0x2'));var timeout=require(_0x15aa('0x3'));var express=require(_0x15aa('0x4'));var router=express['Router']();var auth=require(_0x15aa('0x5'));var interaction=require(_0x15aa('0x6'));var config=require('../../config/environment');var controller=require(_0x15aa('0x7'));router[_0x15aa('0x8')]('/',auth[_0x15aa('0x9')](),controller[_0x15aa('0xa')]);router['get'](_0x15aa('0xb'),auth[_0x15aa('0x9')](),controller['show']);router[_0x15aa('0xc')]('/',auth[_0x15aa('0x9')](),controller['create']);router['put'](_0x15aa('0xb'),auth[_0x15aa('0x9')](),controller[_0x15aa('0xd')]);router[_0x15aa('0xe')]('/:id',auth[_0x15aa('0x9')](),controller[_0x15aa('0xf')]);module[_0x15aa('0x10')]=router; \ No newline at end of file +var _0x977d=['exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','destroy'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x977d,0xc7));var _0xd977=function(_0x246e79,_0x46e0be){_0x246e79=_0x246e79-0x0;var _0x250ac2=_0x977d[_0x246e79];return _0x250ac2;};'use strict';var multer=require(_0xd977('0x0'));var util=require(_0xd977('0x1'));var path=require('path');var timeout=require(_0xd977('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xd977('0x3'));var interaction=require(_0xd977('0x4'));var config=require(_0xd977('0x5'));var controller=require(_0xd977('0x6'));router[_0xd977('0x7')]('/',auth['isAuthenticated'](),controller[_0xd977('0x8')]);router['get'](_0xd977('0x9'),auth[_0xd977('0xa')](),controller['show']);router[_0xd977('0xb')]('/',auth[_0xd977('0xa')](),controller[_0xd977('0xc')]);router[_0xd977('0xd')](_0xd977('0x9'),auth['isAuthenticated'](),controller[_0xd977('0xe')]);router[_0xd977('0xf')](_0xd977('0x9'),auth[_0xd977('0xa')](),controller[_0xd977('0x10')]);module[_0xd977('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index aa5f793..8473e3f 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 _0xdc40=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xdc40,0x1ee));var _0x0dc4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdc40[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0dc4('0x0'));module[_0x0dc4('0x1')]={'calldate':{'type':Sequelize[_0x0dc4('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x0dc4('0x3')]},'src':{'type':Sequelize[_0x0dc4('0x3')]},'dst':{'type':Sequelize[_0x0dc4('0x3')]},'dcontext':{'type':Sequelize[_0x0dc4('0x3')]},'channel':{'type':Sequelize[_0x0dc4('0x3')]},'dstchannel':{'type':Sequelize[_0x0dc4('0x3')]},'lastapp':{'type':Sequelize[_0x0dc4('0x3')]},'lastdata':{'type':Sequelize[_0x0dc4('0x3')]},'duration':{'type':Sequelize[_0x0dc4('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0dc4('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0dc4('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0dc4('0x3')]},'userfield':{'type':Sequelize[_0x0dc4('0x3')]},'uniqueid':{'type':Sequelize[_0x0dc4('0x3')]},'linkedid':{'type':Sequelize[_0x0dc4('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x0dc4('0x3')]},'type':{'type':Sequelize[_0x0dc4('0x3')]},'tag':{'type':Sequelize[_0x0dc4('0x3')]}}; \ No newline at end of file +var _0xcf43=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xcf43,0x10a));var _0x3cf4=function(_0x1c53e1,_0x2f9074){_0x1c53e1=_0x1c53e1-0x0;var _0x3dde87=_0xcf43[_0x1c53e1];return _0x3dde87;};'use strict';var Sequelize=require(_0x3cf4('0x0'));module[_0x3cf4('0x1')]={'calldate':{'type':Sequelize[_0x3cf4('0x2')],'allowNull':![],'defaultValue':_0x3cf4('0x3')},'clid':{'type':Sequelize[_0x3cf4('0x4')]},'src':{'type':Sequelize[_0x3cf4('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x3cf4('0x4')]},'channel':{'type':Sequelize[_0x3cf4('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x3cf4('0x4')]},'lastdata':{'type':Sequelize[_0x3cf4('0x4')]},'duration':{'type':Sequelize[_0x3cf4('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3cf4('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x3cf4('0x4')]},'userfield':{'type':Sequelize[_0x3cf4('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3cf4('0x4')]},'sequence':{'type':Sequelize[_0x3cf4('0x4')]},'peeraccount':{'type':Sequelize[_0x3cf4('0x4')]},'type':{'type':Sequelize[_0x3cf4('0x4')]},'tag':{'type':Sequelize[_0x3cf4('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 1126463..6f4d8c6 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 _0xa3b9=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','status','end','json','count','offset','set','apply','reject','save','update','then','sendStatus','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','Cdr','findAll','rows','catch','show','params','include','create','body','find','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','squel','crypto','jsforce','desk.js'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xa3b9,0xc8));var _0x9a3b=function(_0x2375ac,_0xf736f1){_0x2375ac=_0x2375ac-0x0;var _0x307261=_0xa3b9[_0x2375ac];return _0x307261;};'use strict';var pdf=require(_0x9a3b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9a3b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a3b('0x2'));var rp=require(_0x9a3b('0x3'));var moment=require(_0x9a3b('0x4'));var BPromise=require(_0x9a3b('0x5'));var Mustache=require(_0x9a3b('0x6'));var util=require(_0x9a3b('0x7'));var path=require(_0x9a3b('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9a3b('0x9'));var crypto=require(_0x9a3b('0xa'));var jsforce=require(_0x9a3b('0xb'));var deskjs=require(_0x9a3b('0xc'));var toCsv=require(_0x9a3b('0xd'));var querystring=require(_0x9a3b('0xe'));var Papa=require(_0x9a3b('0xf'));var Redis=require(_0x9a3b('0x10'));var authService=require(_0x9a3b('0x11'));var qs=require(_0x9a3b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a3b('0x13'));var logger=require('../../config/logger')(_0x9a3b('0x14'));var utils=require(_0x9a3b('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59fc1c,_0x4da99b){_0x4da99b=_0x4da99b||0xcc;return function(_0x50d15c){if(_0x50d15c){return _0x59fc1c['sendStatus'](_0x4da99b);}return _0x59fc1c[_0x9a3b('0x16')](_0x4da99b)[_0x9a3b('0x17')]();};}function respondWithResult(_0x33c30a,_0x30d1b0){_0x30d1b0=_0x30d1b0||0xc8;return function(_0x14c748){if(_0x14c748){return _0x33c30a[_0x9a3b('0x16')](_0x30d1b0)[_0x9a3b('0x18')](_0x14c748);}};}function respondWithFilteredResult(_0x248da1,_0x178ae7){return function(_0x1f49e5){if(_0x1f49e5){var _0x3f679a=_0x1f49e5[_0x9a3b('0x19')],_0x3993f1=_0x178ae7[_0x9a3b('0x1a')],_0x1614fe=_0x178ae7[_0x9a3b('0x1a')]+_0x178ae7['limit'],_0x4dabb0;if(_0x1614fe>=_0x3f679a){_0x1614fe=_0x3f679a;_0x4dabb0=0xc8;}else{_0x4dabb0=0xce;}_0x248da1[_0x9a3b('0x16')](_0x4dabb0);return _0x248da1[_0x9a3b('0x1b')]('Content-Range',_0x3993f1+'-'+_0x1614fe+'/'+_0x3f679a)['json'](_0x1f49e5);}return null;};}function patchUpdates(_0x5dfa55){return function(_0x1b5005){try{jsonpatch[_0x9a3b('0x1c')](_0x1b5005,_0x5dfa55,!![]);}catch(_0x49e59f){return BPromise[_0x9a3b('0x1d')](_0x49e59f);}return _0x1b5005[_0x9a3b('0x1e')]();};}function saveUpdates(_0xf8567,_0x302a98){return function(_0x524f9c){if(_0x524f9c){return _0x524f9c[_0x9a3b('0x1f')](_0xf8567)[_0x9a3b('0x20')](function(_0x2c66a7){return _0x2c66a7;});}return null;};}function removeEntity(_0x17127b,_0x1a3945){return function(_0x5e0ee3){if(_0x5e0ee3){return _0x5e0ee3['destroy']()['then'](function(){_0x17127b[_0x9a3b('0x16')](0xcc)[_0x9a3b('0x17')]();});}};}function handleEntityNotFound(_0x555fde,_0x57738e){return function(_0x40af33){if(!_0x40af33){_0x555fde[_0x9a3b('0x21')](0x194);}return _0x40af33;};}function handleError(_0x262b47,_0x3175fb){_0x3175fb=_0x3175fb||0x1f4;return function(_0x56ac3b){logger['error'](_0x56ac3b['stack']);if(_0x56ac3b[_0x9a3b('0x22')]){delete _0x56ac3b['name'];}_0x262b47['status'](_0x3175fb)[_0x9a3b('0x23')](_0x56ac3b);};}exports[_0x9a3b('0x24')]=function(_0x501c66,_0x5424d4){var _0x4b0a18={},_0x3ed19a={},_0x4d78c6={'count':0x0,'rows':[]};var _0x4afa8c=_[_0x9a3b('0x25')](db['Cdr'][_0x9a3b('0x26')],function(_0x108f82){return{'name':_0x108f82[_0x9a3b('0x27')],'type':_0x108f82['type'][_0x9a3b('0x28')]};});_0x3ed19a[_0x9a3b('0x29')]=_[_0x9a3b('0x25')](_0x4afa8c,_0x9a3b('0x22'));_0x3ed19a[_0x9a3b('0x2a')]=_[_0x9a3b('0x2b')](_0x501c66[_0x9a3b('0x2a')]);_0x3ed19a[_0x9a3b('0x2c')]=_[_0x9a3b('0x2d')](_0x3ed19a[_0x9a3b('0x29')],_0x3ed19a[_0x9a3b('0x2a')]);_0x4b0a18[_0x9a3b('0x2e')]=_[_0x9a3b('0x2d')](_0x3ed19a[_0x9a3b('0x29')],qs[_0x9a3b('0x2f')](_0x501c66[_0x9a3b('0x2a')][_0x9a3b('0x2f')]));_0x4b0a18[_0x9a3b('0x2e')]=_0x4b0a18[_0x9a3b('0x2e')][_0x9a3b('0x30')]?_0x4b0a18[_0x9a3b('0x2e')]:_0x3ed19a[_0x9a3b('0x29')];if(!_0x501c66[_0x9a3b('0x2a')][_0x9a3b('0x31')](_0x9a3b('0x32'))){_0x4b0a18[_0x9a3b('0x33')]=qs[_0x9a3b('0x33')](_0x501c66[_0x9a3b('0x2a')][_0x9a3b('0x33')]);_0x4b0a18[_0x9a3b('0x1a')]=qs[_0x9a3b('0x1a')](_0x501c66[_0x9a3b('0x2a')][_0x9a3b('0x1a')]);}_0x4b0a18['order']=qs[_0x9a3b('0x34')](_0x501c66[_0x9a3b('0x2a')][_0x9a3b('0x34')]);_0x4b0a18[_0x9a3b('0x35')]=qs['filters'](_[_0x9a3b('0x36')](_0x501c66[_0x9a3b('0x2a')],_0x3ed19a[_0x9a3b('0x2c')]));if(_0x501c66[_0x9a3b('0x2a')][_0x9a3b('0x37')]){_0x4b0a18[_0x9a3b('0x35')]=_[_0x9a3b('0x38')](_0x4b0a18['where'],{'$or':_['map'](_0x4afa8c,function(_0x474fe9){if(_0x474fe9['type']!==_0x9a3b('0x39')){var _0x213da7={};_0x213da7[_0x474fe9[_0x9a3b('0x22')]]={'$like':'%'+_0x501c66[_0x9a3b('0x2a')][_0x9a3b('0x37')]+'%'};return _0x213da7;}})});}_0x4b0a18=_[_0x9a3b('0x38')]({},_0x4b0a18,_0x501c66[_0x9a3b('0x3a')]);var _0x456080={'where':_0x4b0a18[_0x9a3b('0x35')]};return db['Cdr'][_0x9a3b('0x19')](_0x456080)[_0x9a3b('0x20')](function(_0x3fa037){_0x4d78c6[_0x9a3b('0x19')]=_0x3fa037;if(_0x501c66[_0x9a3b('0x2a')][_0x9a3b('0x3b')]){_0x4b0a18['include']=[{'all':!![]}];}return db[_0x9a3b('0x3c')][_0x9a3b('0x3d')](_0x4b0a18);})[_0x9a3b('0x20')](function(_0x38558c){_0x4d78c6[_0x9a3b('0x3e')]=_0x38558c;return _0x4d78c6;})[_0x9a3b('0x20')](respondWithFilteredResult(_0x5424d4,_0x4b0a18))[_0x9a3b('0x3f')](handleError(_0x5424d4,null));};exports[_0x9a3b('0x40')]=function(_0x2aee60,_0x454a36){var _0x450fea={'raw':!![],'where':{'id':_0x2aee60[_0x9a3b('0x41')]['id']}},_0x581bd6={};_0x581bd6[_0x9a3b('0x29')]=_[_0x9a3b('0x2b')](db[_0x9a3b('0x3c')][_0x9a3b('0x26')]);_0x581bd6['query']=_[_0x9a3b('0x2b')](_0x2aee60[_0x9a3b('0x2a')]);_0x581bd6['filters']=_[_0x9a3b('0x2d')](_0x581bd6[_0x9a3b('0x29')],_0x581bd6[_0x9a3b('0x2a')]);_0x450fea[_0x9a3b('0x2e')]=_[_0x9a3b('0x2d')](_0x581bd6['model'],qs[_0x9a3b('0x2f')](_0x2aee60[_0x9a3b('0x2a')][_0x9a3b('0x2f')]));_0x450fea[_0x9a3b('0x2e')]=_0x450fea[_0x9a3b('0x2e')][_0x9a3b('0x30')]?_0x450fea[_0x9a3b('0x2e')]:_0x581bd6[_0x9a3b('0x29')];if(_0x2aee60['query'][_0x9a3b('0x3b')]){_0x450fea[_0x9a3b('0x42')]=[{'all':!![]}];}_0x450fea=_[_0x9a3b('0x38')]({},_0x450fea,_0x2aee60[_0x9a3b('0x3a')]);return db[_0x9a3b('0x3c')]['find'](_0x450fea)[_0x9a3b('0x20')](handleEntityNotFound(_0x454a36,null))[_0x9a3b('0x20')](respondWithResult(_0x454a36,null))[_0x9a3b('0x3f')](handleError(_0x454a36,null));};exports[_0x9a3b('0x43')]=function(_0x309ff6,_0x5e383e){return db[_0x9a3b('0x3c')][_0x9a3b('0x43')](_0x309ff6[_0x9a3b('0x44')],{})['then'](respondWithResult(_0x5e383e,0xc9))['catch'](handleError(_0x5e383e,null));};exports[_0x9a3b('0x1f')]=function(_0x309ef4,_0x80c25a){if(_0x309ef4[_0x9a3b('0x44')]['id']){delete _0x309ef4[_0x9a3b('0x44')]['id'];}return db[_0x9a3b('0x3c')][_0x9a3b('0x45')]({'where':{'id':_0x309ef4[_0x9a3b('0x41')]['id']}})['then'](handleEntityNotFound(_0x80c25a,null))[_0x9a3b('0x20')](saveUpdates(_0x309ef4['body'],null))[_0x9a3b('0x20')](respondWithResult(_0x80c25a,null))[_0x9a3b('0x3f')](handleError(_0x80c25a,null));};exports['destroy']=function(_0x1ac9b2,_0x453c28){return db[_0x9a3b('0x3c')][_0x9a3b('0x45')]({'where':{'id':_0x1ac9b2[_0x9a3b('0x41')]['id']}})['then'](handleEntityNotFound(_0x453c28,null))[_0x9a3b('0x20')](removeEntity(_0x453c28,null))[_0x9a3b('0x3f')](handleError(_0x453c28,null));};exports[_0x9a3b('0x46')]=function(_0x29942c,_0x2f3423){return db['Cdr'][_0x9a3b('0x46')]()[_0x9a3b('0x20')](respondWithResult(_0x2f3423,null))[_0x9a3b('0x3f')](handleError(_0x2f3423,null));}; \ No newline at end of file +var _0x39cb=['params','includeAll','options','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show'];(function(_0x31983e,_0x19b92d){var _0x3ccc06=function(_0x56b3ef){while(--_0x56b3ef){_0x31983e['push'](_0x31983e['shift']());}};_0x3ccc06(++_0x19b92d);}(_0x39cb,0x1bd));var _0xb39c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x39cb[_0x167cc1];return _0x10bc4b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb39c('0x0'));var rimraf=require(_0xb39c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb39c('0x2'));var rp=require(_0xb39c('0x3'));var moment=require('moment');var BPromise=require(_0xb39c('0x4'));var Mustache=require(_0xb39c('0x5'));var util=require(_0xb39c('0x6'));var path=require(_0xb39c('0x7'));var sox=require(_0xb39c('0x8'));var csv=require('to-csv');var ejs=require(_0xb39c('0x9'));var fs=require('fs');var _=require(_0xb39c('0xa'));var squel=require(_0xb39c('0xb'));var crypto=require(_0xb39c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb39c('0xd'));var querystring=require(_0xb39c('0xe'));var Papa=require(_0xb39c('0xf'));var Redis=require(_0xb39c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb39c('0x11'));var logger=require(_0xb39c('0x12'))(_0xb39c('0x13'));var utils=require(_0xb39c('0x14'));var config=require(_0xb39c('0x15'));var db=require(_0xb39c('0x16'))['db'];function respondWithStatusCode(_0x2a5c79,_0x18d12e){_0x18d12e=_0x18d12e||0xcc;return function(_0x51ff24){if(_0x51ff24){return _0x2a5c79[_0xb39c('0x17')](_0x18d12e);}return _0x2a5c79[_0xb39c('0x18')](_0x18d12e)[_0xb39c('0x19')]();};}function respondWithResult(_0x5e4caf,_0xf4662a){_0xf4662a=_0xf4662a||0xc8;return function(_0x40a6d3){if(_0x40a6d3){return _0x5e4caf[_0xb39c('0x18')](_0xf4662a)[_0xb39c('0x1a')](_0x40a6d3);}};}function respondWithFilteredResult(_0x469fa9,_0x27c22a){return function(_0x8e9181){if(_0x8e9181){var _0x5277ce=_0x8e9181[_0xb39c('0x1b')],_0x316c9b=_0x27c22a[_0xb39c('0x1c')],_0x3223f6=_0x27c22a[_0xb39c('0x1c')]+_0x27c22a[_0xb39c('0x1d')],_0x10989d;if(_0x3223f6>=_0x5277ce){_0x3223f6=_0x5277ce;_0x10989d=0xc8;}else{_0x10989d=0xce;}_0x469fa9[_0xb39c('0x18')](_0x10989d);return _0x469fa9[_0xb39c('0x1e')](_0xb39c('0x1f'),_0x316c9b+'-'+_0x3223f6+'/'+_0x5277ce)['json'](_0x8e9181);}return null;};}function patchUpdates(_0x1d2f49){return function(_0x1a8e12){try{jsonpatch[_0xb39c('0x20')](_0x1a8e12,_0x1d2f49,!![]);}catch(_0x447352){return BPromise['reject'](_0x447352);}return _0x1a8e12[_0xb39c('0x21')]();};}function saveUpdates(_0x2da46a,_0x5e4a0b){return function(_0x2d8e93){if(_0x2d8e93){return _0x2d8e93[_0xb39c('0x22')](_0x2da46a)[_0xb39c('0x23')](function(_0x4ebfca){return _0x4ebfca;});}return null;};}function removeEntity(_0x539d27,_0x2789fd){return function(_0x1a5b9d){if(_0x1a5b9d){return _0x1a5b9d[_0xb39c('0x24')]()['then'](function(){_0x539d27[_0xb39c('0x18')](0xcc)[_0xb39c('0x19')]();});}};}function handleEntityNotFound(_0x1bb895,_0x16f3b0){return function(_0x3b03ed){if(!_0x3b03ed){_0x1bb895['sendStatus'](0x194);}return _0x3b03ed;};}function handleError(_0x3036f5,_0xbeab7e){_0xbeab7e=_0xbeab7e||0x1f4;return function(_0x583ee5){logger[_0xb39c('0x25')](_0x583ee5[_0xb39c('0x26')]);if(_0x583ee5[_0xb39c('0x27')]){delete _0x583ee5[_0xb39c('0x27')];}_0x3036f5[_0xb39c('0x18')](_0xbeab7e)['send'](_0x583ee5);};}exports[_0xb39c('0x28')]=function(_0x299c27,_0x132769){var _0x4c06fa={},_0x41fff2={},_0x337532={'count':0x0,'rows':[]};var _0x52eb5e=_[_0xb39c('0x29')](db[_0xb39c('0x2a')][_0xb39c('0x2b')],function(_0x4e9672){return{'name':_0x4e9672[_0xb39c('0x2c')],'type':_0x4e9672[_0xb39c('0x2d')]['key']};});_0x41fff2[_0xb39c('0x2e')]=_['map'](_0x52eb5e,_0xb39c('0x27'));_0x41fff2[_0xb39c('0x2f')]=_[_0xb39c('0x30')](_0x299c27[_0xb39c('0x2f')]);_0x41fff2[_0xb39c('0x31')]=_['intersection'](_0x41fff2[_0xb39c('0x2e')],_0x41fff2['query']);_0x4c06fa[_0xb39c('0x32')]=_['intersection'](_0x41fff2[_0xb39c('0x2e')],qs[_0xb39c('0x33')](_0x299c27[_0xb39c('0x2f')][_0xb39c('0x33')]));_0x4c06fa['attributes']=_0x4c06fa['attributes'][_0xb39c('0x34')]?_0x4c06fa[_0xb39c('0x32')]:_0x41fff2['model'];if(!_0x299c27[_0xb39c('0x2f')][_0xb39c('0x35')](_0xb39c('0x36'))){_0x4c06fa[_0xb39c('0x1d')]=qs[_0xb39c('0x1d')](_0x299c27[_0xb39c('0x2f')][_0xb39c('0x1d')]);_0x4c06fa[_0xb39c('0x1c')]=qs[_0xb39c('0x1c')](_0x299c27[_0xb39c('0x2f')][_0xb39c('0x1c')]);}_0x4c06fa[_0xb39c('0x37')]=qs[_0xb39c('0x38')](_0x299c27[_0xb39c('0x2f')][_0xb39c('0x38')]);_0x4c06fa[_0xb39c('0x39')]=qs[_0xb39c('0x31')](_[_0xb39c('0x3a')](_0x299c27[_0xb39c('0x2f')],_0x41fff2['filters']));if(_0x299c27[_0xb39c('0x2f')][_0xb39c('0x3b')]){_0x4c06fa['where']=_['merge'](_0x4c06fa['where'],{'$or':_[_0xb39c('0x29')](_0x52eb5e,function(_0x33e468){if(_0x33e468[_0xb39c('0x2d')]!=='VIRTUAL'){var _0x3071dd={};_0x3071dd[_0x33e468[_0xb39c('0x27')]]={'$like':'%'+_0x299c27[_0xb39c('0x2f')][_0xb39c('0x3b')]+'%'};return _0x3071dd;}})});}_0x4c06fa=_[_0xb39c('0x3c')]({},_0x4c06fa,_0x299c27['options']);var _0x3cdeeb={'where':_0x4c06fa[_0xb39c('0x39')]};return db['Cdr'][_0xb39c('0x1b')](_0x3cdeeb)['then'](function(_0x1ee418){_0x337532[_0xb39c('0x1b')]=_0x1ee418;if(_0x299c27[_0xb39c('0x2f')]['includeAll']){_0x4c06fa[_0xb39c('0x3d')]=[{'all':!![]}];}return db[_0xb39c('0x2a')][_0xb39c('0x3e')](_0x4c06fa);})[_0xb39c('0x23')](function(_0x10b87b){_0x337532[_0xb39c('0x3f')]=_0x10b87b;return _0x337532;})[_0xb39c('0x23')](respondWithFilteredResult(_0x132769,_0x4c06fa))[_0xb39c('0x40')](handleError(_0x132769,null));};exports[_0xb39c('0x41')]=function(_0x263544,_0x38359d){var _0xd1136f={'raw':!![],'where':{'id':_0x263544[_0xb39c('0x42')]['id']}},_0x53347e={};_0x53347e[_0xb39c('0x2e')]=_[_0xb39c('0x30')](db[_0xb39c('0x2a')][_0xb39c('0x2b')]);_0x53347e[_0xb39c('0x2f')]=_[_0xb39c('0x30')](_0x263544[_0xb39c('0x2f')]);_0x53347e[_0xb39c('0x31')]=_['intersection'](_0x53347e['model'],_0x53347e[_0xb39c('0x2f')]);_0xd1136f[_0xb39c('0x32')]=_['intersection'](_0x53347e['model'],qs[_0xb39c('0x33')](_0x263544['query'][_0xb39c('0x33')]));_0xd1136f[_0xb39c('0x32')]=_0xd1136f[_0xb39c('0x32')][_0xb39c('0x34')]?_0xd1136f[_0xb39c('0x32')]:_0x53347e['model'];if(_0x263544[_0xb39c('0x2f')][_0xb39c('0x43')]){_0xd1136f['include']=[{'all':!![]}];}_0xd1136f=_['merge']({},_0xd1136f,_0x263544[_0xb39c('0x44')]);return db['Cdr']['find'](_0xd1136f)[_0xb39c('0x23')](handleEntityNotFound(_0x38359d,null))[_0xb39c('0x23')](respondWithResult(_0x38359d,null))[_0xb39c('0x40')](handleError(_0x38359d,null));};exports[_0xb39c('0x45')]=function(_0x3dff16,_0x2af6ec){return db[_0xb39c('0x2a')][_0xb39c('0x45')](_0x3dff16[_0xb39c('0x46')],{})[_0xb39c('0x23')](respondWithResult(_0x2af6ec,0xc9))['catch'](handleError(_0x2af6ec,null));};exports[_0xb39c('0x22')]=function(_0x7e9750,_0xe329bf){if(_0x7e9750[_0xb39c('0x46')]['id']){delete _0x7e9750[_0xb39c('0x46')]['id'];}return db[_0xb39c('0x2a')][_0xb39c('0x47')]({'where':{'id':_0x7e9750[_0xb39c('0x42')]['id']}})[_0xb39c('0x23')](handleEntityNotFound(_0xe329bf,null))[_0xb39c('0x23')](saveUpdates(_0x7e9750[_0xb39c('0x46')],null))[_0xb39c('0x23')](respondWithResult(_0xe329bf,null))[_0xb39c('0x40')](handleError(_0xe329bf,null));};exports[_0xb39c('0x24')]=function(_0x17ad13,_0x44b825){return db['Cdr'][_0xb39c('0x47')]({'where':{'id':_0x17ad13[_0xb39c('0x42')]['id']}})[_0xb39c('0x23')](handleEntityNotFound(_0x44b825,null))[_0xb39c('0x23')](removeEntity(_0x44b825,null))[_0xb39c('0x40')](handleError(_0x44b825,null));};exports[_0xb39c('0x48')]=function(_0xd4f368,_0xc20a16){return db['Cdr']['describe']()[_0xb39c('0x23')](respondWithResult(_0xc20a16,null))[_0xb39c('0x40')](handleError(_0xc20a16,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index ca8d53a..375a476 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 _0x2542=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid'];(function(_0x115850,_0x4bb634){var _0xbad084=function(_0xa14074){while(--_0xa14074){_0x115850['push'](_0x115850['shift']());}};_0xbad084(++_0x4bb634);}(_0x2542,0x169));var _0x2254=function(_0x1a5107,_0x336e02){_0x1a5107=_0x1a5107-0x0;var _0x168775=_0x2542[_0x1a5107];return _0x168775;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xd')]},{'name':_0x2254('0xe'),'fields':[_0x2254('0xe')]},{'name':_0x2254('0xf'),'fields':[_0x2254('0xf')]},{'name':_0x2254('0x10'),'fields':['dst']},{'name':_0x2254('0x11'),'fields':[_0x2254('0x11')]},{'name':_0x2254('0x12'),'fields':[_0x2254('0x12')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1261=['src','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','define','cdr','accountcode','calldate','disposition','dst'];(function(_0x232ec0,_0x45fdd0){var _0x356705=function(_0x4099ea){while(--_0x4099ea){_0x232ec0['push'](_0x232ec0['shift']());}};_0x356705(++_0x45fdd0);}(_0x1261,0x144));var _0x1126=function(_0x4ca796,_0x10dc47){_0x4ca796=_0x4ca796-0x0;var _0x171f87=_0x1261[_0x4ca796];return _0x171f87;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('Cdr',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]},{'name':_0x1126('0xd'),'fields':[_0x1126('0xd')]},{'name':'disposition','fields':[_0x1126('0xe')]},{'name':_0x1126('0xf'),'fields':[_0x1126('0xf')]},{'name':'src','fields':[_0x1126('0x10')]},{'name':'uniqueid','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 8b39d34..227bdae 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 _0x9e84=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x47d493,_0x3bedfb){var _0x50242a=function(_0x473bd6){while(--_0x473bd6){_0x47d493['push'](_0x47d493['shift']());}};_0x50242a(++_0x3bedfb);}(_0x9e84,0x1ce));var _0x49e8=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0x9e84[_0x26fc81];return _0x9feece;};'use strict';var _=require(_0x49e8('0x0'));var util=require(_0x49e8('0x1'));var moment=require(_0x49e8('0x2'));var BPromise=require(_0x49e8('0x3'));var rs=require(_0x49e8('0x4'));var fs=require('fs');var Redis=require(_0x49e8('0x5'));var db=require(_0x49e8('0x6'))['db'];var utils=require(_0x49e8('0x7'));var logger=require(_0x49e8('0x8'))(_0x49e8('0x9'));var config=require(_0x49e8('0xa'));var jayson=require(_0x49e8('0xb'));var client=jayson['client'][_0x49e8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2de9ea,_0x5d5321,_0x43dc42){return new BPromise(function(_0x75124b,_0x133c21){return client['request'](_0x2de9ea,_0x43dc42)[_0x49e8('0xd')](function(_0x1a38bf){logger[_0x49e8('0xe')](_0x49e8('0xf'),_0x5d5321,_0x49e8('0x10'));logger[_0x49e8('0x11')]('Cdr,\x20%s,\x20%s,\x20%s',_0x5d5321,_0x49e8('0x10'),JSON[_0x49e8('0x12')](_0x1a38bf));if(_0x1a38bf[_0x49e8('0x13')]){if(_0x1a38bf[_0x49e8('0x13')]['code']===0x1f4){logger[_0x49e8('0x13')](_0x49e8('0xf'),_0x5d5321,_0x1a38bf[_0x49e8('0x13')]['message']);return _0x133c21(_0x1a38bf[_0x49e8('0x13')]['message']);}logger[_0x49e8('0x13')](_0x49e8('0xf'),_0x5d5321,_0x1a38bf[_0x49e8('0x13')][_0x49e8('0x14')]);return _0x75124b(_0x1a38bf[_0x49e8('0x13')]['message']);}else{logger[_0x49e8('0xe')](_0x49e8('0xf'),_0x5d5321,'request\x20sent');_0x75124b(_0x1a38bf[_0x49e8('0x15')]['message']);}})[_0x49e8('0x16')](function(_0x5ca275){logger[_0x49e8('0x13')](_0x49e8('0xf'),_0x5d5321,_0x5ca275);_0x133c21(_0x5ca275);});});} \ No newline at end of file +var _0x7245=['stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0xf46963,_0x3c4cce){var _0x343194=function(_0x553211){while(--_0x553211){_0xf46963['push'](_0xf46963['shift']());}};_0x343194(++_0x3c4cce);}(_0x7245,0xa8));var _0x5724=function(_0x2eb2f5,_0x5c82fd){_0x2eb2f5=_0x2eb2f5-0x0;var _0x1037a5=_0x7245[_0x2eb2f5];return _0x1037a5;};'use strict';var _=require('lodash');var util=require(_0x5724('0x0'));var moment=require('moment');var BPromise=require(_0x5724('0x1'));var rs=require(_0x5724('0x2'));var fs=require('fs');var Redis=require(_0x5724('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5724('0x4'));var logger=require(_0x5724('0x5'))('rpc');var config=require(_0x5724('0x6'));var jayson=require(_0x5724('0x7'));var client=jayson[_0x5724('0x8')][_0x5724('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e2509,_0x177f84,_0x563d13){return new BPromise(function(_0x1391fe,_0x54011a){return client[_0x5724('0xa')](_0x1e2509,_0x563d13)[_0x5724('0xb')](function(_0x1e57e9){logger[_0x5724('0xc')]('Cdr,\x20%s,\x20%s',_0x177f84,_0x5724('0xd'));logger[_0x5724('0xe')](_0x5724('0xf'),_0x177f84,_0x5724('0xd'),JSON[_0x5724('0x10')](_0x1e57e9));if(_0x1e57e9[_0x5724('0x11')]){if(_0x1e57e9[_0x5724('0x11')][_0x5724('0x12')]===0x1f4){logger['error'](_0x5724('0x13'),_0x177f84,_0x1e57e9[_0x5724('0x11')][_0x5724('0x14')]);return _0x54011a(_0x1e57e9[_0x5724('0x11')][_0x5724('0x14')]);}logger[_0x5724('0x11')]('Cdr,\x20%s,\x20%s',_0x177f84,_0x1e57e9[_0x5724('0x11')][_0x5724('0x14')]);return _0x1391fe(_0x1e57e9[_0x5724('0x11')][_0x5724('0x14')]);}else{logger[_0x5724('0xc')](_0x5724('0x13'),_0x177f84,_0x5724('0xd'));_0x1391fe(_0x1e57e9[_0x5724('0x15')][_0x5724('0x14')]);}})[_0x5724('0x16')](function(_0x5d07ea){logger[_0x5724('0x11')](_0x5724('0x13'),_0x177f84,_0x5d07ea);_0x54011a(_0x5d07ea);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index e6276f4..4654124 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 _0x4cb0=['/describe','describe','show','post','put','update','delete','/:id','exports','multer','connect-timeout','Router','../../components/interaction/service','./cdr.controller','get','isAuthenticated'];(function(_0x33fd71,_0x1562e2){var _0x3b1daf=function(_0x34ea7d){while(--_0x34ea7d){_0x33fd71['push'](_0x33fd71['shift']());}};_0x3b1daf(++_0x1562e2);}(_0x4cb0,0x169));var _0x04cb=function(_0x18dfce,_0x4aba3d){_0x18dfce=_0x18dfce-0x0;var _0x39e278=_0x4cb0[_0x18dfce];return _0x39e278;};'use strict';var multer=require(_0x04cb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x04cb('0x1'));var express=require('express');var router=express[_0x04cb('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x04cb('0x3'));var config=require('../../config/environment');var controller=require(_0x04cb('0x4'));router[_0x04cb('0x5')]('/',auth[_0x04cb('0x6')](),controller['index']);router['get'](_0x04cb('0x7'),auth['isAuthenticated'](),controller[_0x04cb('0x8')]);router[_0x04cb('0x5')]('/:id',auth[_0x04cb('0x6')](),controller[_0x04cb('0x9')]);router[_0x04cb('0xa')]('/',auth[_0x04cb('0x6')](),controller['create']);router[_0x04cb('0xb')]('/:id',auth[_0x04cb('0x6')](),controller[_0x04cb('0xc')]);router[_0x04cb('0xd')](_0x04cb('0xe'),auth[_0x04cb('0x6')](),controller['destroy']);module[_0x04cb('0xf')]=router; \ No newline at end of file +var _0xb627=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x108d5f,_0x33f82d){var _0x456ea3=function(_0x228200){while(--_0x228200){_0x108d5f['push'](_0x108d5f['shift']());}};_0x456ea3(++_0x33f82d);}(_0xb627,0x96));var _0x7b62=function(_0x5132dd,_0x9e5c87){_0x5132dd=_0x5132dd-0x0;var _0x64c5ac=_0xb627[_0x5132dd];return _0x64c5ac;};'use strict';var multer=require(_0x7b62('0x0'));var util=require(_0x7b62('0x1'));var path=require(_0x7b62('0x2'));var timeout=require(_0x7b62('0x3'));var express=require('express');var router=express[_0x7b62('0x4')]();var auth=require(_0x7b62('0x5'));var interaction=require(_0x7b62('0x6'));var config=require(_0x7b62('0x7'));var controller=require(_0x7b62('0x8'));router[_0x7b62('0x9')]('/',auth[_0x7b62('0xa')](),controller[_0x7b62('0xb')]);router[_0x7b62('0x9')](_0x7b62('0xc'),auth[_0x7b62('0xa')](),controller[_0x7b62('0xd')]);router[_0x7b62('0x9')](_0x7b62('0xe'),auth[_0x7b62('0xa')](),controller[_0x7b62('0xf')]);router[_0x7b62('0x10')]('/',auth[_0x7b62('0xa')](),controller[_0x7b62('0x11')]);router[_0x7b62('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7b62('0x13')](_0x7b62('0xe'),auth[_0x7b62('0xa')](),controller[_0x7b62('0x14')]);module[_0x7b62('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 6817b47..285b1a7 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 _0x35a7=['TEXT','STRING','sequelize','exports','noop'];(function(_0x46c115,_0x37fa65){var _0x1520f7=function(_0x88fe5b){while(--_0x88fe5b){_0x46c115['push'](_0x46c115['shift']());}};_0x1520f7(++_0x37fa65);}(_0x35a7,0x101));var _0x735a=function(_0xee6752,_0x667b44){_0xee6752=_0xee6752-0x0;var _0xb4dcea=_0x35a7[_0xee6752];return _0xb4dcea;};'use strict';var Sequelize=require(_0x735a('0x0'));module[_0x735a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x735a('0x2')},'appdata':{'type':Sequelize[_0x735a('0x3')]()},'description':{'type':Sequelize[_0x735a('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x1c4f=['noop','TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x3eedba,_0x37f312){var _0x479d40=function(_0x3aaa79){while(--_0x3aaa79){_0x3eedba['push'](_0x3eedba['shift']());}};_0x479d40(++_0x37f312);}(_0x1c4f,0xf9));var _0xf1c4=function(_0x2e5590,_0x5a2453){_0x2e5590=_0x2e5590-0x0;var _0x39fbda=_0x1c4f[_0x2e5590];return _0x39fbda;};'use strict';var Sequelize=require(_0xf1c4('0x0'));module[_0xf1c4('0x1')]={'priority':{'type':Sequelize[_0xf1c4('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf1c4('0x3')},'appdata':{'type':Sequelize[_0xf1c4('0x4')]()},'description':{'type':Sequelize[_0xf1c4('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf1c4('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index fa54983..a0dcc3c 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 _0x3239=['model','fields','length','includeAll','include','options','catch','find','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','count','Content-Range','apply','reject','save','then','destroy','sendStatus','name','show','params','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x3239,0x1b1));var _0x9323=function(_0x54b9ac,_0x1d40e8){_0x54b9ac=_0x54b9ac-0x0;var _0x5e0065=_0x3239[_0x54b9ac];return _0x5e0065;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9323('0x0'));var rimraf=require(_0x9323('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9323('0x2'));var rp=require(_0x9323('0x3'));var moment=require(_0x9323('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9323('0x5'));var util=require(_0x9323('0x6'));var path=require('path');var sox=require(_0x9323('0x7'));var csv=require(_0x9323('0x8'));var ejs=require(_0x9323('0x9'));var fs=require('fs');var _=require(_0x9323('0xa'));var squel=require(_0x9323('0xb'));var crypto=require(_0x9323('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9323('0xd'));var toCsv=require(_0x9323('0x8'));var querystring=require(_0x9323('0xe'));var Papa=require(_0x9323('0xf'));var Redis=require('ioredis');var authService=require(_0x9323('0x10'));var qs=require(_0x9323('0x11'));var as=require(_0x9323('0x12'));var hardwareService=require(_0x9323('0x13'));var logger=require(_0x9323('0x14'))('api');var utils=require(_0x9323('0x15'));var config=require('../../config/environment');var db=require(_0x9323('0x16'))['db'];function respondWithStatusCode(_0x24f74b,_0x4ccae4){_0x4ccae4=_0x4ccae4||0xcc;return function(_0x56f70a){if(_0x56f70a){return _0x24f74b['sendStatus'](_0x4ccae4);}return _0x24f74b[_0x9323('0x17')](_0x4ccae4)[_0x9323('0x18')]();};}function respondWithResult(_0x23dc13,_0x171692){_0x171692=_0x171692||0xc8;return function(_0xd2b363){if(_0xd2b363){return _0x23dc13[_0x9323('0x17')](_0x171692)[_0x9323('0x19')](_0xd2b363);}};}function respondWithFilteredResult(_0x4b3783,_0x41969e){return function(_0x4e21ed){if(_0x4e21ed){var _0x1a7891=_0x4e21ed[_0x9323('0x1a')],_0x9168d4=_0x41969e['offset'],_0x7e1f9d=_0x41969e['offset']+_0x41969e['limit'],_0x380e7b;if(_0x7e1f9d>=_0x1a7891){_0x7e1f9d=_0x1a7891;_0x380e7b=0xc8;}else{_0x380e7b=0xce;}_0x4b3783[_0x9323('0x17')](_0x380e7b);return _0x4b3783['set'](_0x9323('0x1b'),_0x9168d4+'-'+_0x7e1f9d+'/'+_0x1a7891)[_0x9323('0x19')](_0x4e21ed);}return null;};}function patchUpdates(_0x16c954){return function(_0x260a4d){try{jsonpatch[_0x9323('0x1c')](_0x260a4d,_0x16c954,!![]);}catch(_0x47e5e8){return BPromise[_0x9323('0x1d')](_0x47e5e8);}return _0x260a4d[_0x9323('0x1e')]();};}function saveUpdates(_0x576698,_0x49e0dc){return function(_0x573d27){if(_0x573d27){return _0x573d27['update'](_0x576698)[_0x9323('0x1f')](function(_0x542228){return _0x542228;});}return null;};}function removeEntity(_0x507750,_0x2087c3){return function(_0x46347f){if(_0x46347f){return _0x46347f[_0x9323('0x20')]()[_0x9323('0x1f')](function(){_0x507750['status'](0xcc)[_0x9323('0x18')]();});}};}function handleEntityNotFound(_0x3a10c3,_0x5412c3){return function(_0x62a40e){if(!_0x62a40e){_0x3a10c3[_0x9323('0x21')](0x194);}return _0x62a40e;};}function handleError(_0x2694d2,_0x5b0af3){_0x5b0af3=_0x5b0af3||0x1f4;return function(_0x44e995){logger['error'](_0x44e995['stack']);if(_0x44e995['name']){delete _0x44e995[_0x9323('0x22')];}_0x2694d2[_0x9323('0x17')](_0x5b0af3)['send'](_0x44e995);};}exports[_0x9323('0x23')]=function(_0xf3d559,_0x33ef81){var _0x113ad7={'raw':!![],'where':{'id':_0xf3d559[_0x9323('0x24')]['id']}},_0x3c861c={};_0x3c861c['model']=_['keys'](db[_0x9323('0x25')][_0x9323('0x26')]);_0x3c861c[_0x9323('0x27')]=_[_0x9323('0x28')](_0xf3d559[_0x9323('0x27')]);_0x3c861c[_0x9323('0x29')]=_[_0x9323('0x2a')](_0x3c861c['model'],_0x3c861c[_0x9323('0x27')]);_0x113ad7[_0x9323('0x2b')]=_[_0x9323('0x2a')](_0x3c861c[_0x9323('0x2c')],qs['fields'](_0xf3d559['query'][_0x9323('0x2d')]));_0x113ad7[_0x9323('0x2b')]=_0x113ad7['attributes'][_0x9323('0x2e')]?_0x113ad7['attributes']:_0x3c861c[_0x9323('0x2c')];if(_0xf3d559[_0x9323('0x27')][_0x9323('0x2f')]){_0x113ad7[_0x9323('0x30')]=[{'all':!![]}];}_0x113ad7=_['merge']({},_0x113ad7,_0xf3d559[_0x9323('0x31')]);return db[_0x9323('0x25')]['find'](_0x113ad7)['then'](handleEntityNotFound(_0x33ef81,null))[_0x9323('0x1f')](respondWithResult(_0x33ef81,null))[_0x9323('0x32')](handleError(_0x33ef81,null));};exports['update']=function(_0x2c23d5,_0x3341b5){if(_0x2c23d5['body']['id']){delete _0x2c23d5['body']['id'];}return db['ChatApplication'][_0x9323('0x33')]({'where':{'id':_0x2c23d5['params']['id']}})['then'](handleEntityNotFound(_0x3341b5,null))['then'](saveUpdates(_0x2c23d5[_0x9323('0x34')],null))[_0x9323('0x1f')](respondWithResult(_0x3341b5,null))[_0x9323('0x32')](handleError(_0x3341b5,null));};exports[_0x9323('0x20')]=function(_0x4f6c34,_0xb0dfa1){return db['ChatApplication'][_0x9323('0x33')]({'where':{'id':_0x4f6c34[_0x9323('0x24')]['id']}})['then'](handleEntityNotFound(_0xb0dfa1,null))['then'](removeEntity(_0xb0dfa1,null))[_0x9323('0x32')](handleError(_0xb0dfa1,null));}; \ No newline at end of file +var _0x9cab=['model','keys','ChatApplication','rawAttributes','query','intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','show','params'];(function(_0x4d14bb,_0xe9dbb5){var _0x1aaa75=function(_0x2c397d){while(--_0x2c397d){_0x4d14bb['push'](_0x4d14bb['shift']());}};_0x1aaa75(++_0xe9dbb5);}(_0x9cab,0xf7));var _0xb9ca=function(_0x57f5a8,_0x3edbf0){_0x57f5a8=_0x57f5a8-0x0;var _0x116b7a=_0x9cab[_0x57f5a8];return _0x116b7a;};'use strict';var pdf=require(_0xb9ca('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb9ca('0x1'));var zipdir=require(_0xb9ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb9ca('0x3'));var BPromise=require(_0xb9ca('0x4'));var Mustache=require(_0xb9ca('0x5'));var util=require(_0xb9ca('0x6'));var path=require(_0xb9ca('0x7'));var sox=require(_0xb9ca('0x8'));var csv=require(_0xb9ca('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb9ca('0xa'));var squel=require(_0xb9ca('0xb'));var crypto=require(_0xb9ca('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb9ca('0xd'));var toCsv=require(_0xb9ca('0x9'));var querystring=require(_0xb9ca('0xe'));var Papa=require(_0xb9ca('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb9ca('0x10'));var as=require(_0xb9ca('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9ca('0x12'))(_0xb9ca('0x13'));var utils=require(_0xb9ca('0x14'));var config=require(_0xb9ca('0x15'));var db=require(_0xb9ca('0x16'))['db'];function respondWithStatusCode(_0x418f92,_0xce19ed){_0xce19ed=_0xce19ed||0xcc;return function(_0x36c76a){if(_0x36c76a){return _0x418f92[_0xb9ca('0x17')](_0xce19ed);}return _0x418f92[_0xb9ca('0x18')](_0xce19ed)[_0xb9ca('0x19')]();};}function respondWithResult(_0x2105df,_0x370ea0){_0x370ea0=_0x370ea0||0xc8;return function(_0x2c2aca){if(_0x2c2aca){return _0x2105df[_0xb9ca('0x18')](_0x370ea0)['json'](_0x2c2aca);}};}function respondWithFilteredResult(_0x2944d1,_0x895bc4){return function(_0x27f72b){if(_0x27f72b){var _0x3d4105=_0x27f72b[_0xb9ca('0x1a')],_0x39f4f3=_0x895bc4[_0xb9ca('0x1b')],_0x4d39eb=_0x895bc4[_0xb9ca('0x1b')]+_0x895bc4[_0xb9ca('0x1c')],_0x5e2616;if(_0x4d39eb>=_0x3d4105){_0x4d39eb=_0x3d4105;_0x5e2616=0xc8;}else{_0x5e2616=0xce;}_0x2944d1[_0xb9ca('0x18')](_0x5e2616);return _0x2944d1[_0xb9ca('0x1d')](_0xb9ca('0x1e'),_0x39f4f3+'-'+_0x4d39eb+'/'+_0x3d4105)[_0xb9ca('0x1f')](_0x27f72b);}return null;};}function patchUpdates(_0x24d7ce){return function(_0x13b249){try{jsonpatch[_0xb9ca('0x20')](_0x13b249,_0x24d7ce,!![]);}catch(_0x5add0d){return BPromise[_0xb9ca('0x21')](_0x5add0d);}return _0x13b249['save']();};}function saveUpdates(_0x55a9ef,_0x40486b){return function(_0x4a87ee){if(_0x4a87ee){return _0x4a87ee[_0xb9ca('0x22')](_0x55a9ef)[_0xb9ca('0x23')](function(_0xa0abcf){return _0xa0abcf;});}return null;};}function removeEntity(_0x39a12f,_0x1053df){return function(_0x4dd547){if(_0x4dd547){return _0x4dd547[_0xb9ca('0x24')]()[_0xb9ca('0x23')](function(){_0x39a12f[_0xb9ca('0x18')](0xcc)[_0xb9ca('0x19')]();});}};}function handleEntityNotFound(_0x388fbf,_0x127510){return function(_0x272c9c){if(!_0x272c9c){_0x388fbf[_0xb9ca('0x17')](0x194);}return _0x272c9c;};}function handleError(_0x44834d,_0x1eac5e){_0x1eac5e=_0x1eac5e||0x1f4;return function(_0x37046e){logger[_0xb9ca('0x25')](_0x37046e[_0xb9ca('0x26')]);if(_0x37046e[_0xb9ca('0x27')]){delete _0x37046e[_0xb9ca('0x27')];}_0x44834d[_0xb9ca('0x18')](_0x1eac5e)[_0xb9ca('0x28')](_0x37046e);};}exports[_0xb9ca('0x29')]=function(_0x1ccaa3,_0x302662){var _0x44ee33={'raw':!![],'where':{'id':_0x1ccaa3[_0xb9ca('0x2a')]['id']}},_0x5f1e3a={};_0x5f1e3a[_0xb9ca('0x2b')]=_[_0xb9ca('0x2c')](db[_0xb9ca('0x2d')][_0xb9ca('0x2e')]);_0x5f1e3a[_0xb9ca('0x2f')]=_[_0xb9ca('0x2c')](_0x1ccaa3['query']);_0x5f1e3a['filters']=_[_0xb9ca('0x30')](_0x5f1e3a[_0xb9ca('0x2b')],_0x5f1e3a['query']);_0x44ee33['attributes']=_['intersection'](_0x5f1e3a[_0xb9ca('0x2b')],qs[_0xb9ca('0x31')](_0x1ccaa3[_0xb9ca('0x2f')][_0xb9ca('0x31')]));_0x44ee33[_0xb9ca('0x32')]=_0x44ee33['attributes']['length']?_0x44ee33['attributes']:_0x5f1e3a[_0xb9ca('0x2b')];if(_0x1ccaa3[_0xb9ca('0x2f')][_0xb9ca('0x33')]){_0x44ee33[_0xb9ca('0x34')]=[{'all':!![]}];}_0x44ee33=_[_0xb9ca('0x35')]({},_0x44ee33,_0x1ccaa3[_0xb9ca('0x36')]);return db[_0xb9ca('0x2d')][_0xb9ca('0x37')](_0x44ee33)[_0xb9ca('0x23')](handleEntityNotFound(_0x302662,null))[_0xb9ca('0x23')](respondWithResult(_0x302662,null))[_0xb9ca('0x38')](handleError(_0x302662,null));};exports[_0xb9ca('0x22')]=function(_0x17a49c,_0x642e8){if(_0x17a49c['body']['id']){delete _0x17a49c['body']['id'];}return db[_0xb9ca('0x2d')]['find']({'where':{'id':_0x17a49c[_0xb9ca('0x2a')]['id']}})[_0xb9ca('0x23')](handleEntityNotFound(_0x642e8,null))[_0xb9ca('0x23')](saveUpdates(_0x17a49c[_0xb9ca('0x39')],null))[_0xb9ca('0x23')](respondWithResult(_0x642e8,null))[_0xb9ca('0x38')](handleError(_0x642e8,null));};exports['destroy']=function(_0x50998a,_0x4cfcdb){return db[_0xb9ca('0x2d')]['find']({'where':{'id':_0x50998a[_0xb9ca('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4cfcdb,null))[_0xb9ca('0x23')](removeEntity(_0x4cfcdb,null))['catch'](handleError(_0x4cfcdb,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 28ff736..530e516 100644 --- a/server/api/chatApplication/chatApplication.model.js +++ b/server/api/chatApplication/chatApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_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 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 6934c44..7a9f3d9 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 _0x9b53=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x9b53,0xf6));var _0x39b5=function(_0x5419d9,_0x231930){_0x5419d9=_0x5419d9-0x0;var _0x210094=_0x9b53[_0x5419d9];return _0x210094;};'use strict';var _=require(_0x39b5('0x0'));var util=require(_0x39b5('0x1'));var moment=require(_0x39b5('0x2'));var BPromise=require('bluebird');var rs=require(_0x39b5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39b5('0x4'))['db'];var utils=require(_0x39b5('0x5'));var logger=require(_0x39b5('0x6'))(_0x39b5('0x7'));var config=require(_0x39b5('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a3a1e,_0x5355e6,_0x36d483){return new BPromise(function(_0x1f3987,_0x2b227e){return client['request'](_0x4a3a1e,_0x36d483)[_0x39b5('0x9')](function(_0x57a61d){logger[_0x39b5('0xa')](_0x39b5('0xb'),_0x5355e6,_0x39b5('0xc'));logger[_0x39b5('0xd')](_0x39b5('0xe'),_0x5355e6,'request\x20sent',JSON[_0x39b5('0xf')](_0x57a61d));if(_0x57a61d[_0x39b5('0x10')]){if(_0x57a61d[_0x39b5('0x10')]['code']===0x1f4){logger['error'](_0x39b5('0xb'),_0x5355e6,_0x57a61d[_0x39b5('0x10')]['message']);return _0x2b227e(_0x57a61d[_0x39b5('0x10')][_0x39b5('0x11')]);}logger[_0x39b5('0x10')](_0x39b5('0xb'),_0x5355e6,_0x57a61d[_0x39b5('0x10')]['message']);return _0x1f3987(_0x57a61d[_0x39b5('0x10')][_0x39b5('0x11')]);}else{logger['info'](_0x39b5('0xb'),_0x5355e6,_0x39b5('0xc'));_0x1f3987(_0x57a61d[_0x39b5('0x12')][_0x39b5('0x11')]);}})['catch'](function(_0x195be4){logger['error'](_0x39b5('0xb'),_0x5355e6,_0x195be4);_0x2b227e(_0x195be4);});});} \ No newline at end of file +var _0x222e=['code','message','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','request\x20sent','error'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x222e,0x134));var _0xe222=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x222e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe222('0x0'));var rs=require(_0xe222('0x1'));var fs=require('fs');var Redis=require(_0xe222('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe222('0x3'));var logger=require(_0xe222('0x4'))(_0xe222('0x5'));var config=require(_0xe222('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe222('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xa7551c,_0x271c6c,_0x2153b1){return new BPromise(function(_0x585bd4,_0x235132){return client[_0xe222('0x8')](_0xa7551c,_0x2153b1)[_0xe222('0x9')](function(_0x1160bc){logger[_0xe222('0xa')](_0xe222('0xb'),_0x271c6c,'request\x20sent');logger[_0xe222('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x271c6c,_0xe222('0xd'),JSON['stringify'](_0x1160bc));if(_0x1160bc[_0xe222('0xe')]){if(_0x1160bc['error'][_0xe222('0xf')]===0x1f4){logger[_0xe222('0xe')]('ChatApplication,\x20%s,\x20%s',_0x271c6c,_0x1160bc[_0xe222('0xe')][_0xe222('0x10')]);return _0x235132(_0x1160bc[_0xe222('0xe')]['message']);}logger[_0xe222('0xe')](_0xe222('0xb'),_0x271c6c,_0x1160bc[_0xe222('0xe')][_0xe222('0x10')]);return _0x585bd4(_0x1160bc[_0xe222('0xe')]['message']);}else{logger[_0xe222('0xa')](_0xe222('0xb'),_0x271c6c,_0xe222('0xd'));_0x585bd4(_0x1160bc['result'][_0xe222('0x10')]);}})['catch'](function(_0xedae2d){logger[_0xe222('0xe')]('ChatApplication,\x20%s,\x20%s',_0x271c6c,_0xedae2d);_0x235132(_0xedae2d);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 3ccc12c..3d8b129 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 _0x6904=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','put','isAuthenticated','update','delete'];(function(_0x4d4663,_0xcb51b5){var _0x5eae54=function(_0x56197c){while(--_0x56197c){_0x4d4663['push'](_0x4d4663['shift']());}};_0x5eae54(++_0xcb51b5);}(_0x6904,0xf0));var _0x4690=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0x6904[_0x2b5513];return _0x578fd2;};'use strict';var multer=require(_0x4690('0x0'));var util=require(_0x4690('0x1'));var path=require(_0x4690('0x2'));var timeout=require(_0x4690('0x3'));var express=require(_0x4690('0x4'));var router=express[_0x4690('0x5')]();var auth=require(_0x4690('0x6'));var interaction=require(_0x4690('0x7'));var config=require(_0x4690('0x8'));var controller=require('./chatApplication.controller');router[_0x4690('0x9')](_0x4690('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4690('0xb')](_0x4690('0xa'),auth[_0x4690('0xc')](),controller[_0x4690('0xd')]);router[_0x4690('0xe')](_0x4690('0xa'),auth[_0x4690('0xc')](),controller[_0x4690('0xf')]);module[_0x4690('0x10')]=router; \ No newline at end of file +var _0x005b=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','put','/:id','update','delete','isAuthenticated','destroy','exports','util'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0x005b,0x1cf));var _0xb005=function(_0x2686a3,_0x229d7c){_0x2686a3=_0x2686a3-0x0;var _0xd0f890=_0x005b[_0x2686a3];return _0xd0f890;};'use strict';var multer=require('multer');var util=require(_0xb005('0x0'));var path=require('path');var timeout=require(_0xb005('0x1'));var express=require(_0xb005('0x2'));var router=express[_0xb005('0x3')]();var auth=require(_0xb005('0x4'));var interaction=require(_0xb005('0x5'));var config=require(_0xb005('0x6'));var controller=require(_0xb005('0x7'));router[_0xb005('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb005('0x9')](_0xb005('0xa'),auth['isAuthenticated'](),controller[_0xb005('0xb')]);router[_0xb005('0xc')](_0xb005('0xa'),auth[_0xb005('0xd')](),controller[_0xb005('0xe')]);module[_0xb005('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 5078e2f..9ef53ad 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 _0x5ca5=['STRING','BOOLEAN','sequelize','exports'];(function(_0x35d981,_0x529683){var _0x579ac5=function(_0x28da30){while(--_0x28da30){_0x35d981['push'](_0x35d981['shift']());}};_0x579ac5(++_0x529683);}(_0x5ca5,0x92));var _0x55ca=function(_0x443ef1,_0x4dbf0c){_0x443ef1=_0x443ef1-0x0;var _0x118d9c=_0x5ca5[_0x443ef1];return _0x118d9c;};'use strict';var Sequelize=require(_0x55ca('0x0'));module[_0x55ca('0x1')]={'name':{'type':Sequelize[_0x55ca('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x55ca('0x2')]},'write':{'type':Sequelize[_0x55ca('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb651=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0xb651,0xfd));var _0x1b65=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xb651[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x1b65('0x0'));module[_0x1b65('0x1')]={'name':{'type':Sequelize[_0x1b65('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1b65('0x2')]},'write':{'type':Sequelize[_0x1b65('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 938a13a..62c2723 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 _0xcf06=['request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','status','end','json','offset','limit','Content-Range','reject','save','update','destroy','stack','index','map','ChatGroup','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','name','options','count','includeAll','include','findAll','params','rawAttributes','keys','create','body','find','describe','ChatInternalMessage','toInteger','addMembers','ids','findOne','User','getMembers','hasOwnProperty','removeMembers','ChatGroupId','getMessages','$gte','split','format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcf06,0xcd));var _0x6cf0=function(_0x126367,_0x13ca16){_0x126367=_0x126367-0x0;var _0x22e2aa=_0xcf06[_0x126367];return _0x22e2aa;};'use strict';var pdf=require(_0x6cf0('0x0'));var emlformat=require(_0x6cf0('0x1'));var rimraf=require(_0x6cf0('0x2'));var zipdir=require(_0x6cf0('0x3'));var jsonpatch=require(_0x6cf0('0x4'));var rp=require(_0x6cf0('0x5'));var moment=require('moment');var BPromise=require(_0x6cf0('0x6'));var Mustache=require(_0x6cf0('0x7'));var util=require(_0x6cf0('0x8'));var path=require(_0x6cf0('0x9'));var sox=require(_0x6cf0('0xa'));var csv=require('to-csv');var ejs=require(_0x6cf0('0xb'));var fs=require('fs');var _=require(_0x6cf0('0xc'));var squel=require(_0x6cf0('0xd'));var crypto=require(_0x6cf0('0xe'));var jsforce=require(_0x6cf0('0xf'));var deskjs=require(_0x6cf0('0x10'));var toCsv=require(_0x6cf0('0x11'));var querystring=require(_0x6cf0('0x12'));var Papa=require(_0x6cf0('0x13'));var Redis=require('ioredis');var authService=require(_0x6cf0('0x14'));var qs=require(_0x6cf0('0x15'));var as=require(_0x6cf0('0x16'));var hardwareService=require(_0x6cf0('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x6cf0('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x6cf0('0x19')]=_[_0x6cf0('0x1a')](config[_0x6cf0('0x19')],{'host':_0x6cf0('0x1b'),'port':0x18eb});var socket=require(_0x6cf0('0x1c'))(new Redis(config[_0x6cf0('0x19')]));require(_0x6cf0('0x1d'))[_0x6cf0('0x1e')](socket);var jayson=require(_0x6cf0('0x1f'));var client=jayson[_0x6cf0('0x20')][_0x6cf0('0x21')]({'port':0x232a});function checkPasswordPattern(_0x52b923,_0x23c946,_0x343b09){if(_0x343b09){var _0x406b86=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x406b86[_0x6cf0('0x22')](_0x23c946)){return _0x52b923;}else{throw new db[(_0x6cf0('0x23'))]['ValidationError'](_0x6cf0('0x24'));}}else{return _0x52b923;}}function respondWithRpcPromise(_0x907057,_0x27e87f,_0x5cce65,_0x193b83){return new BPromise(function(_0x1d1533,_0x611de9){var _0x171239=_0x193b83||client;return _0x171239[_0x6cf0('0x25')](_0x907057,_0x5cce65)[_0x6cf0('0x26')](function(_0x53c2ee){logger[_0x6cf0('0x27')](_0x6cf0('0x28'),_0x27e87f,'request\x20sent');logger[_0x6cf0('0x29')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x27e87f,_0x6cf0('0x2a'),JSON['stringify'](_0x53c2ee));if(_0x53c2ee[_0x6cf0('0x2b')]){if(_0x53c2ee[_0x6cf0('0x2b')][_0x6cf0('0x2c')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x27e87f,_0x53c2ee[_0x6cf0('0x2b')][_0x6cf0('0x2d')]);return _0x611de9(_0x53c2ee[_0x6cf0('0x2b')][_0x6cf0('0x2d')]);}logger['error'](_0x6cf0('0x28'),_0x27e87f,_0x53c2ee[_0x6cf0('0x2b')][_0x6cf0('0x2d')]);return _0x1d1533(_0x53c2ee['error'][_0x6cf0('0x2d')]);}else{logger[_0x6cf0('0x27')](_0x6cf0('0x28'),_0x27e87f,_0x6cf0('0x2a'));_0x1d1533(_0x53c2ee[_0x6cf0('0x2e')][_0x6cf0('0x2d')]);}})[_0x6cf0('0x2f')](function(_0x23c962){logger[_0x6cf0('0x2b')](_0x6cf0('0x28'),_0x27e87f,_0x23c962);_0x611de9(_0x23c962);});});}function respondWithStatusCode(_0x5c62b4,_0x490d47){_0x490d47=_0x490d47||0xcc;return function(_0x22db2a){if(_0x22db2a){return _0x5c62b4['sendStatus'](_0x490d47);}return _0x5c62b4[_0x6cf0('0x30')](_0x490d47)[_0x6cf0('0x31')]();};}function respondWithResult(_0x284689,_0xe8e365){_0xe8e365=_0xe8e365||0xc8;return function(_0xc7b224){if(_0xc7b224){return _0x284689['status'](_0xe8e365)[_0x6cf0('0x32')](_0xc7b224);}};}function respondWithFilteredResult(_0x3f713e,_0x41680a){return function(_0x37ddd4){if(_0x37ddd4){var _0x2c6d87=_0x37ddd4['count'],_0x349945=_0x41680a[_0x6cf0('0x33')],_0x58913f=_0x41680a['offset']+_0x41680a[_0x6cf0('0x34')],_0x39b2d4;if(_0x58913f>=_0x2c6d87){_0x58913f=_0x2c6d87;_0x39b2d4=0xc8;}else{_0x39b2d4=0xce;}_0x3f713e[_0x6cf0('0x30')](_0x39b2d4);return _0x3f713e['set'](_0x6cf0('0x35'),_0x349945+'-'+_0x58913f+'/'+_0x2c6d87)['json'](_0x37ddd4);}return null;};}function patchUpdates(_0x6bb84e){return function(_0x265619){try{jsonpatch['apply'](_0x265619,_0x6bb84e,!![]);}catch(_0x2a7a6a){return BPromise[_0x6cf0('0x36')](_0x2a7a6a);}return _0x265619[_0x6cf0('0x37')]();};}function saveUpdates(_0x4af354,_0x283963){return function(_0x3bd850){if(_0x3bd850){return _0x3bd850[_0x6cf0('0x38')](_0x4af354)['then'](function(_0x598bb1){return _0x598bb1;});}return null;};}function removeEntity(_0x538ff0,_0x52e931){return function(_0x39f55b){if(_0x39f55b){return _0x39f55b[_0x6cf0('0x39')]()[_0x6cf0('0x26')](function(){_0x538ff0['status'](0xcc)[_0x6cf0('0x31')]();});}};}function handleEntityNotFound(_0x2c7105,_0x2d79f3){return function(_0x2e297d){if(!_0x2e297d){_0x2c7105['sendStatus'](0x194);}return _0x2e297d;};}function handleError(_0xeb0394,_0x3459f5){_0x3459f5=_0x3459f5||0x1f4;return function(_0x12de22){logger['error'](_0x12de22[_0x6cf0('0x3a')]);if(_0x12de22['name']){delete _0x12de22['name'];}_0xeb0394[_0x6cf0('0x30')](_0x3459f5)['send'](_0x12de22);};}exports[_0x6cf0('0x3b')]=function(_0x4599af,_0x24f790){var _0x34f371={},_0x12444a={},_0x2b9d5b={'count':0x0,'rows':[]};var _0x1f9351=_[_0x6cf0('0x3c')](db[_0x6cf0('0x3d')]['rawAttributes'],function(_0x535833){return{'name':_0x535833['fieldName'],'type':_0x535833[_0x6cf0('0x3e')][_0x6cf0('0x3f')]};});_0x12444a[_0x6cf0('0x40')]=_[_0x6cf0('0x3c')](_0x1f9351,'name');_0x12444a[_0x6cf0('0x41')]=_['keys'](_0x4599af[_0x6cf0('0x41')]);_0x12444a['filters']=_[_0x6cf0('0x42')](_0x12444a[_0x6cf0('0x40')],_0x12444a[_0x6cf0('0x41')]);_0x34f371['attributes']=_[_0x6cf0('0x42')](_0x12444a[_0x6cf0('0x40')],qs[_0x6cf0('0x43')](_0x4599af[_0x6cf0('0x41')][_0x6cf0('0x43')]));_0x34f371[_0x6cf0('0x44')]=_0x34f371[_0x6cf0('0x44')][_0x6cf0('0x45')]?_0x34f371[_0x6cf0('0x44')]:_0x12444a[_0x6cf0('0x40')];if(!_0x4599af[_0x6cf0('0x41')]['hasOwnProperty'](_0x6cf0('0x46'))){_0x34f371['limit']=qs[_0x6cf0('0x34')](_0x4599af[_0x6cf0('0x41')][_0x6cf0('0x34')]);_0x34f371[_0x6cf0('0x33')]=qs[_0x6cf0('0x33')](_0x4599af[_0x6cf0('0x41')]['offset']);}_0x34f371[_0x6cf0('0x47')]=qs[_0x6cf0('0x48')](_0x4599af[_0x6cf0('0x41')][_0x6cf0('0x48')]);_0x34f371[_0x6cf0('0x49')]=qs[_0x6cf0('0x4a')](_[_0x6cf0('0x4b')](_0x4599af['query'],_0x12444a['filters']));if(_0x4599af['query'][_0x6cf0('0x4c')]){_0x34f371[_0x6cf0('0x49')]=_[_0x6cf0('0x4d')](_0x34f371[_0x6cf0('0x49')],{'$or':_[_0x6cf0('0x3c')](_0x1f9351,function(_0x440816){if(_0x440816[_0x6cf0('0x3e')]!=='VIRTUAL'){var _0x166a30={};_0x166a30[_0x440816[_0x6cf0('0x4e')]]={'$like':'%'+_0x4599af[_0x6cf0('0x41')]['filter']+'%'};return _0x166a30;}})});}_0x34f371=_[_0x6cf0('0x4d')]({},_0x34f371,_0x4599af[_0x6cf0('0x4f')]);var _0xbdf96b={'where':_0x34f371['where']};return db[_0x6cf0('0x3d')][_0x6cf0('0x50')](_0xbdf96b)[_0x6cf0('0x26')](function(_0x27ba41){_0x2b9d5b[_0x6cf0('0x50')]=_0x27ba41;if(_0x4599af['query'][_0x6cf0('0x51')]){_0x34f371[_0x6cf0('0x52')]=[{'all':!![]}];}return db[_0x6cf0('0x3d')][_0x6cf0('0x53')](_0x34f371);})[_0x6cf0('0x26')](function(_0x57caf5){_0x2b9d5b['rows']=_0x57caf5;return _0x2b9d5b;})[_0x6cf0('0x26')](respondWithFilteredResult(_0x24f790,_0x34f371))[_0x6cf0('0x2f')](handleError(_0x24f790,null));};exports['show']=function(_0x22a64f,_0x5f1a10){var _0x1a2e60={'raw':!![],'where':{'id':_0x22a64f[_0x6cf0('0x54')]['id']}},_0x5c13f8={};_0x5c13f8[_0x6cf0('0x40')]=_['keys'](db[_0x6cf0('0x3d')][_0x6cf0('0x55')]);_0x5c13f8[_0x6cf0('0x41')]=_[_0x6cf0('0x56')](_0x22a64f['query']);_0x5c13f8[_0x6cf0('0x4a')]=_[_0x6cf0('0x42')](_0x5c13f8[_0x6cf0('0x40')],_0x5c13f8[_0x6cf0('0x41')]);_0x1a2e60[_0x6cf0('0x44')]=_['intersection'](_0x5c13f8[_0x6cf0('0x40')],qs['fields'](_0x22a64f['query'][_0x6cf0('0x43')]));_0x1a2e60[_0x6cf0('0x44')]=_0x1a2e60[_0x6cf0('0x44')][_0x6cf0('0x45')]?_0x1a2e60[_0x6cf0('0x44')]:_0x5c13f8[_0x6cf0('0x40')];if(_0x22a64f['query']['includeAll']){_0x1a2e60[_0x6cf0('0x52')]=[{'all':!![]}];}_0x1a2e60=_[_0x6cf0('0x4d')]({},_0x1a2e60,_0x22a64f[_0x6cf0('0x4f')]);return db['ChatGroup']['find'](_0x1a2e60)[_0x6cf0('0x26')](handleEntityNotFound(_0x5f1a10,null))['then'](respondWithResult(_0x5f1a10,null))['catch'](handleError(_0x5f1a10,null));};exports[_0x6cf0('0x57')]=function(_0xe5bf4d,_0x42fbb0){return db['ChatGroup']['create'](_0xe5bf4d['body'],{})['then'](respondWithResult(_0x42fbb0,0xc9))[_0x6cf0('0x2f')](handleError(_0x42fbb0,null));};exports[_0x6cf0('0x38')]=function(_0xdf680,_0x3543b2){if(_0xdf680[_0x6cf0('0x58')]['id']){delete _0xdf680[_0x6cf0('0x58')]['id'];}return db[_0x6cf0('0x3d')]['find']({'where':{'id':_0xdf680['params']['id']}})[_0x6cf0('0x26')](handleEntityNotFound(_0x3543b2,null))['then'](saveUpdates(_0xdf680[_0x6cf0('0x58')],null))[_0x6cf0('0x26')](respondWithResult(_0x3543b2,null))[_0x6cf0('0x2f')](handleError(_0x3543b2,null));};exports[_0x6cf0('0x39')]=function(_0x202e97,_0x28fbc8){return db['ChatGroup'][_0x6cf0('0x59')]({'where':{'id':_0x202e97[_0x6cf0('0x54')]['id']}})[_0x6cf0('0x26')](handleEntityNotFound(_0x28fbc8,null))['then'](removeEntity(_0x28fbc8,null))[_0x6cf0('0x2f')](handleError(_0x28fbc8,null));};exports[_0x6cf0('0x5a')]=function(_0xa15f0c,_0x4394d8){return db[_0x6cf0('0x3d')][_0x6cf0('0x5a')]()[_0x6cf0('0x26')](respondWithResult(_0x4394d8,null))['catch'](handleError(_0x4394d8,null));};exports['getUnread']=function(_0x41a74e,_0xfe9f7c,_0x24181e){return db[_0x6cf0('0x5b')][_0x6cf0('0x50')]({'where':{'ChatGroupId':_0x41a74e[_0x6cf0('0x54')]['id'],'ToId':_0x41a74e['user']['id'],'read':![]}})['then'](function(_0x334fcd){return{'id':_[_0x6cf0('0x5c')](_0x41a74e['params']['id']),'count':_0x334fcd};})['then'](respondWithResult(_0xfe9f7c,null))['catch'](handleError(_0xfe9f7c,null));};exports[_0x6cf0('0x5d')]=function(_0x52444d,_0x5f1bdd,_0x325efb){return db[_0x6cf0('0x3d')]['find']({'where':{'id':_0x52444d[_0x6cf0('0x54')]['id']}})['then'](handleEntityNotFound(_0x5f1bdd,null))['then'](function(_0x16dd72){if(_0x16dd72){return _0x16dd72['addMembers'](_0x52444d[_0x6cf0('0x58')][_0x6cf0('0x5e')],_['omit'](_0x52444d[_0x6cf0('0x58')],[_0x6cf0('0x5e'),'id'])||{});}})['then'](respondWithResult(_0x5f1bdd,null))[_0x6cf0('0x2f')](handleError(_0x5f1bdd,null));};exports['getMembers']=function(_0x46ad1e,_0x5453d3,_0x1ce8ae){var _0x57f63b={};var _0x53308b={};var _0x47ae32;var _0x304cbc;return db[_0x6cf0('0x3d')][_0x6cf0('0x5f')]({'where':{'id':_0x46ad1e[_0x6cf0('0x54')]['id']}})[_0x6cf0('0x26')](handleEntityNotFound(_0x5453d3,null))['then'](function(_0x168472){if(_0x168472){_0x47ae32=_0x168472;_0x53308b[_0x6cf0('0x40')]=_[_0x6cf0('0x56')](db[_0x6cf0('0x60')]['rawAttributes']);_0x53308b['query']=_[_0x6cf0('0x56')](_0x46ad1e[_0x6cf0('0x41')]);_0x53308b[_0x6cf0('0x4a')]=_[_0x6cf0('0x42')](_0x53308b['model'],_0x53308b['query']);_0x57f63b[_0x6cf0('0x44')]=_[_0x6cf0('0x42')](_0x53308b[_0x6cf0('0x40')],qs[_0x6cf0('0x43')](_0x46ad1e[_0x6cf0('0x41')][_0x6cf0('0x43')]));_0x57f63b[_0x6cf0('0x44')]=_0x57f63b[_0x6cf0('0x44')]['length']?_0x57f63b[_0x6cf0('0x44')]:_0x53308b[_0x6cf0('0x40')];_0x57f63b[_0x6cf0('0x47')]=qs[_0x6cf0('0x48')](_0x46ad1e[_0x6cf0('0x41')][_0x6cf0('0x48')]);_0x57f63b[_0x6cf0('0x49')]=qs[_0x6cf0('0x4a')](_[_0x6cf0('0x4b')](_0x46ad1e[_0x6cf0('0x41')],_0x53308b[_0x6cf0('0x4a')]));if(_0x46ad1e[_0x6cf0('0x41')]['filter']){_0x57f63b[_0x6cf0('0x49')]=_[_0x6cf0('0x4d')](_0x57f63b['where'],{'$or':_[_0x6cf0('0x3c')](_0x57f63b[_0x6cf0('0x44')],function(_0xaab507){var _0xd51477={};_0xd51477[_0xaab507]={'$like':'%'+_0x46ad1e[_0x6cf0('0x41')][_0x6cf0('0x4c')]+'%'};return _0xd51477;})});}_0x57f63b=_[_0x6cf0('0x4d')]({},_0x57f63b,_0x46ad1e[_0x6cf0('0x4f')]);return _0x47ae32[_0x6cf0('0x61')](_0x57f63b);}})['then'](function(_0x1caa1c){if(_0x1caa1c){_0x304cbc=_0x1caa1c['length'];if(!_0x46ad1e['query'][_0x6cf0('0x62')](_0x6cf0('0x46'))){_0x57f63b['limit']=qs[_0x6cf0('0x34')](_0x46ad1e['query'][_0x6cf0('0x34')]);_0x57f63b['offset']=qs[_0x6cf0('0x33')](_0x46ad1e[_0x6cf0('0x41')][_0x6cf0('0x33')]);}return _0x47ae32[_0x6cf0('0x61')](_0x57f63b);}})['then'](function(_0x6595b2){if(_0x6595b2){return _0x6595b2?{'count':_0x304cbc,'rows':_0x6595b2}:null;}})[_0x6cf0('0x26')](respondWithResult(_0x5453d3,null))['catch'](handleError(_0x5453d3,null));};exports[_0x6cf0('0x63')]=function(_0x2c2c8b,_0x38105c,_0x123349){return db[_0x6cf0('0x3d')][_0x6cf0('0x59')]({'where':{'id':_0x2c2c8b[_0x6cf0('0x54')]['id']}})[_0x6cf0('0x26')](handleEntityNotFound(_0x38105c,null))['then'](function(_0x1b6457){if(_0x1b6457){return _0x1b6457[_0x6cf0('0x63')](_0x2c2c8b[_0x6cf0('0x41')][_0x6cf0('0x5e')]);}})[_0x6cf0('0x26')](respondWithStatusCode(_0x38105c,null))[_0x6cf0('0x2f')](handleError(_0x38105c,null));};exports['addMessage']=function(_0x516715,_0x2c7964,_0x135ede){if(_0x516715[_0x6cf0('0x58')]['id']){delete _0x516715[_0x6cf0('0x58')]['id'];}return db[_0x6cf0('0x3d')][_0x6cf0('0x59')]({'where':{'id':_0x516715['params']['id']}})[_0x6cf0('0x26')](handleEntityNotFound(_0x2c7964,null))[_0x6cf0('0x26')](function(_0x2ba88b){if(_0x2ba88b){_0x516715[_0x6cf0('0x58')][_0x6cf0('0x64')]=_0x2ba88b['id'];return db[_0x6cf0('0x5b')][_0x6cf0('0x57')](_0x516715[_0x6cf0('0x58')]);}})[_0x6cf0('0x26')](respondWithResult(_0x2c7964,null))[_0x6cf0('0x2f')](handleError(_0x2c7964,null));};exports[_0x6cf0('0x65')]=function(_0x37e024,_0x4ca2c0,_0xd5143c){var _0x14ddda={};var _0x330b12={};var _0x551dd3;var _0x38ee02;return db[_0x6cf0('0x3d')][_0x6cf0('0x5f')]({'where':{'id':_0x37e024[_0x6cf0('0x54')]['id']}})['then'](handleEntityNotFound(_0x4ca2c0,null))[_0x6cf0('0x26')](function(_0x1970a4){if(_0x1970a4){_0x551dd3=_0x1970a4;_0x330b12['model']=_['keys'](db[_0x6cf0('0x5b')]['rawAttributes']);_0x330b12[_0x6cf0('0x41')]=_[_0x6cf0('0x56')](_0x37e024[_0x6cf0('0x41')]);_0x330b12[_0x6cf0('0x4a')]=_[_0x6cf0('0x42')](_0x330b12[_0x6cf0('0x40')],_0x330b12[_0x6cf0('0x41')]);_0x14ddda['attributes']=_[_0x6cf0('0x42')](_0x330b12[_0x6cf0('0x40')],qs[_0x6cf0('0x43')](_0x37e024[_0x6cf0('0x41')]['fields']));_0x14ddda[_0x6cf0('0x44')]=_0x14ddda[_0x6cf0('0x44')]['length']?_0x14ddda[_0x6cf0('0x44')]:_0x330b12[_0x6cf0('0x40')];_0x14ddda['order']=qs[_0x6cf0('0x48')](_0x37e024[_0x6cf0('0x41')]['sort']);_0x14ddda[_0x6cf0('0x49')]=qs[_0x6cf0('0x4a')](_[_0x6cf0('0x4b')](_0x37e024[_0x6cf0('0x41')],_0x330b12[_0x6cf0('0x4a')]));if(_0x37e024['query'][_0x6cf0('0x4c')]){_0x14ddda['where']=_[_0x6cf0('0x4d')](_0x14ddda[_0x6cf0('0x49')],{'$or':_[_0x6cf0('0x3c')](_0x14ddda['attributes'],function(_0x47d6df){var _0x1943de={};_0x1943de[_0x47d6df]={'$like':'%'+_0x37e024[_0x6cf0('0x41')][_0x6cf0('0x4c')]+'%'};return _0x1943de;})});}if(_0x37e024[_0x6cf0('0x41')][_0x6cf0('0x66')]){var _0x31a88f=_0x37e024[_0x6cf0('0x41')][_0x6cf0('0x66')][_0x6cf0('0x67')](',');var _0x55df94={};_0x55df94[_0x31a88f[0x0]]={'$gte':moment(_0x31a88f[0x1])[_0x6cf0('0x68')]('YYYY-MM-DD\x20HH:mm:ss')};_0x14ddda[_0x6cf0('0x49')]=_[_0x6cf0('0x4d')](_0x14ddda['where'],_0x55df94);}_0x14ddda=_[_0x6cf0('0x4d')]({},_0x14ddda,_0x37e024[_0x6cf0('0x4f')]);return _0x551dd3['getMessages'](_0x14ddda);}})['then'](function(_0x595ab8){if(_0x595ab8){_0x38ee02=_0x595ab8['length'];if(!_0x37e024[_0x6cf0('0x41')][_0x6cf0('0x62')](_0x6cf0('0x46'))){_0x14ddda[_0x6cf0('0x34')]=qs[_0x6cf0('0x34')](_0x37e024[_0x6cf0('0x41')][_0x6cf0('0x34')]);_0x14ddda[_0x6cf0('0x33')]=qs[_0x6cf0('0x33')](_0x37e024[_0x6cf0('0x41')]['offset']);}return _0x551dd3[_0x6cf0('0x65')](_0x14ddda);}})[_0x6cf0('0x26')](function(_0x163edb){if(_0x163edb){return _0x163edb?{'count':_0x38ee02,'rows':_0x163edb}:null;}})[_0x6cf0('0x26')](respondWithResult(_0x4ca2c0,null))[_0x6cf0('0x2f')](handleError(_0x4ca2c0,null));}; \ No newline at end of file +var _0x84d1=['sendStatus','stack','name','send','index','ChatGroup','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','findOne','User','sort','filter','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','http','test','Sequelize','ValidationError','request','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy'];(function(_0x3e7804,_0x121853){var _0x56efda=function(_0x1996f3){while(--_0x1996f3){_0x3e7804['push'](_0x3e7804['shift']());}};_0x56efda(++_0x121853);}(_0x84d1,0x17b));var _0x184d=function(_0x1fd437,_0x2c0b47){_0x1fd437=_0x1fd437-0x0;var _0x40d9e6=_0x84d1[_0x1fd437];return _0x40d9e6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x184d('0x0'));var rimraf=require(_0x184d('0x1'));var zipdir=require(_0x184d('0x2'));var jsonpatch=require(_0x184d('0x3'));var rp=require(_0x184d('0x4'));var moment=require(_0x184d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x184d('0x6'));var util=require(_0x184d('0x7'));var path=require(_0x184d('0x8'));var sox=require(_0x184d('0x9'));var csv=require('to-csv');var ejs=require(_0x184d('0xa'));var fs=require('fs');var _=require(_0x184d('0xb'));var squel=require(_0x184d('0xc'));var crypto=require(_0x184d('0xd'));var jsforce=require(_0x184d('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x184d('0xf'));var Papa=require(_0x184d('0x10'));var Redis=require(_0x184d('0x11'));var authService=require(_0x184d('0x12'));var qs=require(_0x184d('0x13'));var as=require(_0x184d('0x14'));var hardwareService=require(_0x184d('0x15'));var logger=require(_0x184d('0x16'))(_0x184d('0x17'));var utils=require(_0x184d('0x18'));var config=require(_0x184d('0x19'));var db=require(_0x184d('0x1a'))['db'];config[_0x184d('0x1b')]=_[_0x184d('0x1c')](config['redis'],{'host':_0x184d('0x1d'),'port':0x18eb});var socket=require(_0x184d('0x1e'))(new Redis(config[_0x184d('0x1b')]));require('./chatGroup.socket')['register'](socket);var jayson=require(_0x184d('0x1f'));var client=jayson['client'][_0x184d('0x20')]({'port':0x232a});function checkPasswordPattern(_0x297aca,_0x2b5853,_0x16ea91){if(_0x16ea91){var _0x3fcd1d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3fcd1d[_0x184d('0x21')](_0x2b5853)){return _0x297aca;}else{throw new db[(_0x184d('0x22'))][(_0x184d('0x23'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x297aca;}}function respondWithRpcPromise(_0x58c07e,_0x1bd75e,_0x29ac74,_0x597913){return new BPromise(function(_0x5f2d5e,_0x2ccdcb){var _0x401231=_0x597913||client;return _0x401231[_0x184d('0x24')](_0x58c07e,_0x29ac74)['then'](function(_0x2d4586){logger['info'](_0x184d('0x25'),_0x1bd75e,_0x184d('0x26'));logger[_0x184d('0x27')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1bd75e,_0x184d('0x26'),JSON[_0x184d('0x28')](_0x2d4586));if(_0x2d4586[_0x184d('0x29')]){if(_0x2d4586[_0x184d('0x29')]['code']===0x1f4){logger['error'](_0x184d('0x25'),_0x1bd75e,_0x2d4586[_0x184d('0x29')][_0x184d('0x2a')]);return _0x2ccdcb(_0x2d4586['error'][_0x184d('0x2a')]);}logger[_0x184d('0x29')]('ChatGroup,\x20%s,\x20%s',_0x1bd75e,_0x2d4586[_0x184d('0x29')][_0x184d('0x2a')]);return _0x5f2d5e(_0x2d4586['error']['message']);}else{logger[_0x184d('0x2b')](_0x184d('0x25'),_0x1bd75e,_0x184d('0x26'));_0x5f2d5e(_0x2d4586[_0x184d('0x2c')][_0x184d('0x2a')]);}})['catch'](function(_0x5be758){logger[_0x184d('0x29')](_0x184d('0x25'),_0x1bd75e,_0x5be758);_0x2ccdcb(_0x5be758);});});}function respondWithStatusCode(_0x54e232,_0x11f15c){_0x11f15c=_0x11f15c||0xcc;return function(_0x5cda20){if(_0x5cda20){return _0x54e232['sendStatus'](_0x11f15c);}return _0x54e232[_0x184d('0x2d')](_0x11f15c)['end']();};}function respondWithResult(_0x86aef1,_0x32aa19){_0x32aa19=_0x32aa19||0xc8;return function(_0x5b0206){if(_0x5b0206){return _0x86aef1['status'](_0x32aa19)[_0x184d('0x2e')](_0x5b0206);}};}function respondWithFilteredResult(_0x219724,_0x5a03f3){return function(_0x562863){if(_0x562863){var _0x14973e=_0x562863[_0x184d('0x2f')],_0x444c2c=_0x5a03f3[_0x184d('0x30')],_0x32962c=_0x5a03f3[_0x184d('0x30')]+_0x5a03f3[_0x184d('0x31')],_0xa9a993;if(_0x32962c>=_0x14973e){_0x32962c=_0x14973e;_0xa9a993=0xc8;}else{_0xa9a993=0xce;}_0x219724['status'](_0xa9a993);return _0x219724[_0x184d('0x32')](_0x184d('0x33'),_0x444c2c+'-'+_0x32962c+'/'+_0x14973e)[_0x184d('0x2e')](_0x562863);}return null;};}function patchUpdates(_0xdad76){return function(_0x440bb9){try{jsonpatch['apply'](_0x440bb9,_0xdad76,!![]);}catch(_0x2cf4e0){return BPromise[_0x184d('0x34')](_0x2cf4e0);}return _0x440bb9[_0x184d('0x35')]();};}function saveUpdates(_0x3d090b,_0xa9ee07){return function(_0x2d8206){if(_0x2d8206){return _0x2d8206[_0x184d('0x36')](_0x3d090b)[_0x184d('0x37')](function(_0x58f93a){return _0x58f93a;});}return null;};}function removeEntity(_0x12b61e,_0x4f59ae){return function(_0x3f39c3){if(_0x3f39c3){return _0x3f39c3[_0x184d('0x38')]()[_0x184d('0x37')](function(){_0x12b61e[_0x184d('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4607a0,_0x3d7b56){return function(_0x5b9145){if(!_0x5b9145){_0x4607a0[_0x184d('0x39')](0x194);}return _0x5b9145;};}function handleError(_0x37c976,_0x4b1edb){_0x4b1edb=_0x4b1edb||0x1f4;return function(_0x569b81){logger['error'](_0x569b81[_0x184d('0x3a')]);if(_0x569b81['name']){delete _0x569b81[_0x184d('0x3b')];}_0x37c976[_0x184d('0x2d')](_0x4b1edb)[_0x184d('0x3c')](_0x569b81);};}exports[_0x184d('0x3d')]=function(_0x1d3924,_0x57b5e1){var _0x8b3947={},_0xc0e3c2={},_0x4a129a={'count':0x0,'rows':[]};var _0x56fa60=_['map'](db[_0x184d('0x3e')][_0x184d('0x3f')],function(_0xc7e24){return{'name':_0xc7e24['fieldName'],'type':_0xc7e24[_0x184d('0x40')][_0x184d('0x41')]};});_0xc0e3c2[_0x184d('0x42')]=_[_0x184d('0x43')](_0x56fa60,'name');_0xc0e3c2[_0x184d('0x44')]=_[_0x184d('0x45')](_0x1d3924[_0x184d('0x44')]);_0xc0e3c2[_0x184d('0x46')]=_['intersection'](_0xc0e3c2['model'],_0xc0e3c2[_0x184d('0x44')]);_0x8b3947[_0x184d('0x47')]=_[_0x184d('0x48')](_0xc0e3c2[_0x184d('0x42')],qs[_0x184d('0x49')](_0x1d3924[_0x184d('0x44')][_0x184d('0x49')]));_0x8b3947[_0x184d('0x47')]=_0x8b3947[_0x184d('0x47')][_0x184d('0x4a')]?_0x8b3947[_0x184d('0x47')]:_0xc0e3c2['model'];if(!_0x1d3924[_0x184d('0x44')][_0x184d('0x4b')](_0x184d('0x4c'))){_0x8b3947[_0x184d('0x31')]=qs[_0x184d('0x31')](_0x1d3924[_0x184d('0x44')][_0x184d('0x31')]);_0x8b3947[_0x184d('0x30')]=qs[_0x184d('0x30')](_0x1d3924[_0x184d('0x44')]['offset']);}_0x8b3947[_0x184d('0x4d')]=qs['sort'](_0x1d3924[_0x184d('0x44')]['sort']);_0x8b3947['where']=qs[_0x184d('0x46')](_[_0x184d('0x4e')](_0x1d3924['query'],_0xc0e3c2[_0x184d('0x46')]));if(_0x1d3924[_0x184d('0x44')]['filter']){_0x8b3947[_0x184d('0x4f')]=_[_0x184d('0x50')](_0x8b3947[_0x184d('0x4f')],{'$or':_[_0x184d('0x43')](_0x56fa60,function(_0x397bcb){if(_0x397bcb[_0x184d('0x40')]!==_0x184d('0x51')){var _0x5eaf04={};_0x5eaf04[_0x397bcb[_0x184d('0x3b')]]={'$like':'%'+_0x1d3924[_0x184d('0x44')]['filter']+'%'};return _0x5eaf04;}})});}_0x8b3947=_['merge']({},_0x8b3947,_0x1d3924[_0x184d('0x52')]);var _0x31dbc5={'where':_0x8b3947[_0x184d('0x4f')]};return db['ChatGroup']['count'](_0x31dbc5)[_0x184d('0x37')](function(_0x576c83){_0x4a129a[_0x184d('0x2f')]=_0x576c83;if(_0x1d3924['query'][_0x184d('0x53')]){_0x8b3947[_0x184d('0x54')]=[{'all':!![]}];}return db[_0x184d('0x3e')][_0x184d('0x55')](_0x8b3947);})[_0x184d('0x37')](function(_0x44186a){_0x4a129a['rows']=_0x44186a;return _0x4a129a;})['then'](respondWithFilteredResult(_0x57b5e1,_0x8b3947))[_0x184d('0x56')](handleError(_0x57b5e1,null));};exports[_0x184d('0x57')]=function(_0x21ffa6,_0x4c1cba){var _0xd091d8={'raw':!![],'where':{'id':_0x21ffa6[_0x184d('0x58')]['id']}},_0xfb63d3={};_0xfb63d3[_0x184d('0x42')]=_[_0x184d('0x45')](db[_0x184d('0x3e')]['rawAttributes']);_0xfb63d3[_0x184d('0x44')]=_[_0x184d('0x45')](_0x21ffa6['query']);_0xfb63d3['filters']=_[_0x184d('0x48')](_0xfb63d3[_0x184d('0x42')],_0xfb63d3[_0x184d('0x44')]);_0xd091d8[_0x184d('0x47')]=_[_0x184d('0x48')](_0xfb63d3['model'],qs['fields'](_0x21ffa6[_0x184d('0x44')][_0x184d('0x49')]));_0xd091d8[_0x184d('0x47')]=_0xd091d8[_0x184d('0x47')]['length']?_0xd091d8[_0x184d('0x47')]:_0xfb63d3['model'];if(_0x21ffa6['query'][_0x184d('0x53')]){_0xd091d8[_0x184d('0x54')]=[{'all':!![]}];}_0xd091d8=_[_0x184d('0x50')]({},_0xd091d8,_0x21ffa6['options']);return db['ChatGroup'][_0x184d('0x59')](_0xd091d8)[_0x184d('0x37')](handleEntityNotFound(_0x4c1cba,null))[_0x184d('0x37')](respondWithResult(_0x4c1cba,null))['catch'](handleError(_0x4c1cba,null));};exports[_0x184d('0x5a')]=function(_0x6de9be,_0x69eec3){return db[_0x184d('0x3e')]['create'](_0x6de9be['body'],{})[_0x184d('0x37')](respondWithResult(_0x69eec3,0xc9))[_0x184d('0x56')](handleError(_0x69eec3,null));};exports[_0x184d('0x36')]=function(_0x39f44a,_0x31f0c7){if(_0x39f44a['body']['id']){delete _0x39f44a['body']['id'];}return db['ChatGroup'][_0x184d('0x59')]({'where':{'id':_0x39f44a['params']['id']}})[_0x184d('0x37')](handleEntityNotFound(_0x31f0c7,null))['then'](saveUpdates(_0x39f44a[_0x184d('0x5b')],null))[_0x184d('0x37')](respondWithResult(_0x31f0c7,null))[_0x184d('0x56')](handleError(_0x31f0c7,null));};exports[_0x184d('0x38')]=function(_0xaf881a,_0x5cb187){return db[_0x184d('0x3e')][_0x184d('0x59')]({'where':{'id':_0xaf881a['params']['id']}})['then'](handleEntityNotFound(_0x5cb187,null))[_0x184d('0x37')](removeEntity(_0x5cb187,null))[_0x184d('0x56')](handleError(_0x5cb187,null));};exports[_0x184d('0x5c')]=function(_0x3425cc,_0x1f10f9){return db[_0x184d('0x3e')][_0x184d('0x5c')]()['then'](respondWithResult(_0x1f10f9,null))['catch'](handleError(_0x1f10f9,null));};exports[_0x184d('0x5d')]=function(_0xde53,_0x3a68e1,_0x45c704){return db[_0x184d('0x5e')]['count']({'where':{'ChatGroupId':_0xde53[_0x184d('0x58')]['id'],'ToId':_0xde53['user']['id'],'read':![]}})[_0x184d('0x37')](function(_0x4ccab8){return{'id':_[_0x184d('0x5f')](_0xde53[_0x184d('0x58')]['id']),'count':_0x4ccab8};})['then'](respondWithResult(_0x3a68e1,null))['catch'](handleError(_0x3a68e1,null));};exports[_0x184d('0x60')]=function(_0x263b18,_0x57c46d,_0x47120d){return db[_0x184d('0x3e')][_0x184d('0x59')]({'where':{'id':_0x263b18[_0x184d('0x58')]['id']}})[_0x184d('0x37')](handleEntityNotFound(_0x57c46d,null))['then'](function(_0x5f0b69){if(_0x5f0b69){return _0x5f0b69[_0x184d('0x60')](_0x263b18[_0x184d('0x5b')][_0x184d('0x61')],_[_0x184d('0x62')](_0x263b18[_0x184d('0x5b')],[_0x184d('0x61'),'id'])||{});}})[_0x184d('0x37')](respondWithResult(_0x57c46d,null))[_0x184d('0x56')](handleError(_0x57c46d,null));};exports['getMembers']=function(_0x904399,_0x4756ff,_0x116696){var _0x4ed924={};var _0x2269c3={};var _0x2a07b1;var _0x2d6540;return db[_0x184d('0x3e')][_0x184d('0x63')]({'where':{'id':_0x904399['params']['id']}})['then'](handleEntityNotFound(_0x4756ff,null))[_0x184d('0x37')](function(_0x45ccb3){if(_0x45ccb3){_0x2a07b1=_0x45ccb3;_0x2269c3[_0x184d('0x42')]=_['keys'](db[_0x184d('0x64')][_0x184d('0x3f')]);_0x2269c3[_0x184d('0x44')]=_[_0x184d('0x45')](_0x904399[_0x184d('0x44')]);_0x2269c3[_0x184d('0x46')]=_[_0x184d('0x48')](_0x2269c3[_0x184d('0x42')],_0x2269c3[_0x184d('0x44')]);_0x4ed924[_0x184d('0x47')]=_['intersection'](_0x2269c3[_0x184d('0x42')],qs[_0x184d('0x49')](_0x904399[_0x184d('0x44')][_0x184d('0x49')]));_0x4ed924[_0x184d('0x47')]=_0x4ed924[_0x184d('0x47')][_0x184d('0x4a')]?_0x4ed924[_0x184d('0x47')]:_0x2269c3['model'];_0x4ed924[_0x184d('0x4d')]=qs[_0x184d('0x65')](_0x904399[_0x184d('0x44')][_0x184d('0x65')]);_0x4ed924[_0x184d('0x4f')]=qs['filters'](_[_0x184d('0x4e')](_0x904399[_0x184d('0x44')],_0x2269c3['filters']));if(_0x904399['query']['filter']){_0x4ed924[_0x184d('0x4f')]=_[_0x184d('0x50')](_0x4ed924['where'],{'$or':_[_0x184d('0x43')](_0x4ed924[_0x184d('0x47')],function(_0x38ba7a){var _0x2237ac={};_0x2237ac[_0x38ba7a]={'$like':'%'+_0x904399[_0x184d('0x44')][_0x184d('0x66')]+'%'};return _0x2237ac;})});}_0x4ed924=_[_0x184d('0x50')]({},_0x4ed924,_0x904399[_0x184d('0x52')]);return _0x2a07b1[_0x184d('0x67')](_0x4ed924);}})['then'](function(_0x3ffeaa){if(_0x3ffeaa){_0x2d6540=_0x3ffeaa[_0x184d('0x4a')];if(!_0x904399[_0x184d('0x44')][_0x184d('0x4b')](_0x184d('0x4c'))){_0x4ed924[_0x184d('0x31')]=qs[_0x184d('0x31')](_0x904399[_0x184d('0x44')]['limit']);_0x4ed924[_0x184d('0x30')]=qs[_0x184d('0x30')](_0x904399[_0x184d('0x44')]['offset']);}return _0x2a07b1['getMembers'](_0x4ed924);}})[_0x184d('0x37')](function(_0x375f7a){if(_0x375f7a){return _0x375f7a?{'count':_0x2d6540,'rows':_0x375f7a}:null;}})['then'](respondWithResult(_0x4756ff,null))[_0x184d('0x56')](handleError(_0x4756ff,null));};exports[_0x184d('0x68')]=function(_0x59b8f2,_0x4d2e54,_0x2c04a2){return db['ChatGroup'][_0x184d('0x59')]({'where':{'id':_0x59b8f2[_0x184d('0x58')]['id']}})['then'](handleEntityNotFound(_0x4d2e54,null))[_0x184d('0x37')](function(_0x19b91b){if(_0x19b91b){return _0x19b91b[_0x184d('0x68')](_0x59b8f2[_0x184d('0x44')]['ids']);}})[_0x184d('0x37')](respondWithStatusCode(_0x4d2e54,null))[_0x184d('0x56')](handleError(_0x4d2e54,null));};exports[_0x184d('0x69')]=function(_0x9eb304,_0x22b1a9,_0x17ce20){if(_0x9eb304['body']['id']){delete _0x9eb304[_0x184d('0x5b')]['id'];}return db[_0x184d('0x3e')][_0x184d('0x59')]({'where':{'id':_0x9eb304['params']['id']}})[_0x184d('0x37')](handleEntityNotFound(_0x22b1a9,null))[_0x184d('0x37')](function(_0x1a3b5e){if(_0x1a3b5e){_0x9eb304[_0x184d('0x5b')][_0x184d('0x6a')]=_0x1a3b5e['id'];return db[_0x184d('0x5e')]['create'](_0x9eb304[_0x184d('0x5b')]);}})[_0x184d('0x37')](respondWithResult(_0x22b1a9,null))['catch'](handleError(_0x22b1a9,null));};exports[_0x184d('0x6b')]=function(_0x55ea1f,_0x1ce867,_0x139877){var _0x58b42c={};var _0x4512c1={};var _0x34476a;var _0x22651f;return db[_0x184d('0x3e')][_0x184d('0x63')]({'where':{'id':_0x55ea1f['params']['id']}})[_0x184d('0x37')](handleEntityNotFound(_0x1ce867,null))[_0x184d('0x37')](function(_0x502b4e){if(_0x502b4e){_0x34476a=_0x502b4e;_0x4512c1[_0x184d('0x42')]=_['keys'](db[_0x184d('0x5e')][_0x184d('0x3f')]);_0x4512c1['query']=_[_0x184d('0x45')](_0x55ea1f[_0x184d('0x44')]);_0x4512c1['filters']=_[_0x184d('0x48')](_0x4512c1[_0x184d('0x42')],_0x4512c1[_0x184d('0x44')]);_0x58b42c['attributes']=_[_0x184d('0x48')](_0x4512c1[_0x184d('0x42')],qs[_0x184d('0x49')](_0x55ea1f[_0x184d('0x44')][_0x184d('0x49')]));_0x58b42c['attributes']=_0x58b42c[_0x184d('0x47')][_0x184d('0x4a')]?_0x58b42c[_0x184d('0x47')]:_0x4512c1[_0x184d('0x42')];_0x58b42c[_0x184d('0x4d')]=qs[_0x184d('0x65')](_0x55ea1f[_0x184d('0x44')][_0x184d('0x65')]);_0x58b42c[_0x184d('0x4f')]=qs[_0x184d('0x46')](_[_0x184d('0x4e')](_0x55ea1f['query'],_0x4512c1[_0x184d('0x46')]));if(_0x55ea1f['query']['filter']){_0x58b42c[_0x184d('0x4f')]=_['merge'](_0x58b42c[_0x184d('0x4f')],{'$or':_[_0x184d('0x43')](_0x58b42c[_0x184d('0x47')],function(_0x1e7798){var _0x5400bc={};_0x5400bc[_0x1e7798]={'$like':'%'+_0x55ea1f[_0x184d('0x44')][_0x184d('0x66')]+'%'};return _0x5400bc;})});}if(_0x55ea1f['query'][_0x184d('0x6c')]){var _0x4c3584=_0x55ea1f[_0x184d('0x44')][_0x184d('0x6c')]['split'](',');var _0x1cf82a={};_0x1cf82a[_0x4c3584[0x0]]={'$gte':moment(_0x4c3584[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x58b42c[_0x184d('0x4f')]=_[_0x184d('0x50')](_0x58b42c[_0x184d('0x4f')],_0x1cf82a);}_0x58b42c=_['merge']({},_0x58b42c,_0x55ea1f[_0x184d('0x52')]);return _0x34476a[_0x184d('0x6b')](_0x58b42c);}})[_0x184d('0x37')](function(_0x1d454d){if(_0x1d454d){_0x22651f=_0x1d454d[_0x184d('0x4a')];if(!_0x55ea1f[_0x184d('0x44')][_0x184d('0x4b')](_0x184d('0x4c'))){_0x58b42c[_0x184d('0x31')]=qs['limit'](_0x55ea1f[_0x184d('0x44')][_0x184d('0x31')]);_0x58b42c['offset']=qs[_0x184d('0x30')](_0x55ea1f[_0x184d('0x44')]['offset']);}return _0x34476a[_0x184d('0x6b')](_0x58b42c);}})[_0x184d('0x37')](function(_0x11b350){if(_0x11b350){return _0x11b350?{'count':_0x22651f,'rows':_0x11b350}:null;}})[_0x184d('0x37')](respondWithResult(_0x1ce867,null))[_0x184d('0x56')](handleError(_0x1ce867,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 61cbd73..db8579d 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 _0xdb28=['ChatGroup','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x5678b5,_0x1c4aa8){var _0x4c09a5=function(_0x2aa89a){while(--_0x2aa89a){_0x5678b5['push'](_0x5678b5['shift']());}};_0x4c09a5(++_0x1c4aa8);}(_0xdb28,0x106));var _0x8db2=function(_0x23a734,_0x4303bc){_0x23a734=_0x23a734-0x0;var _0x203618=_0xdb28[_0x23a734];return _0x203618;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var ChatGroup=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','ChatGroup','setMaxListeners','save','remove','emit'];(function(_0x19c6fd,_0x3ee1e7){var _0x1dfabc=function(_0x165426){while(--_0x165426){_0x19c6fd['push'](_0x19c6fd['shift']());}};_0x1dfabc(++_0x3ee1e7);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ed26c,_0xab6b81){_0x3ed26c=_0x3ed26c-0x0;var _0x20074a=_0xb10b[_0x3ed26c];return _0x20074a;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatGroupEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatGroupEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatGroup[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 386b987..5af91fa 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 _0x78d3=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','chat_groups','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x78d3,0x73));var _0x378d=function(_0x229691,_0x270f3b){_0x229691=_0x229691-0x0;var _0x25e2c9=_0x78d3[_0x229691];return _0x25e2c9;};'use strict';var _=require(_0x378d('0x0'));var util=require(_0x378d('0x1'));var logger=require(_0x378d('0x2'))(_0x378d('0x3'));var moment=require(_0x378d('0x4'));var BPromise=require(_0x378d('0x5'));var rp=require(_0x378d('0x6'));var fs=require('fs');var path=require(_0x378d('0x7'));var rimraf=require(_0x378d('0x8'));var config=require(_0x378d('0x9'));var attributes=require(_0x378d('0xa'));module[_0x378d('0xb')]=function(_0xc18c0b,_0x59117c){return _0xc18c0b['define']('ChatGroup',attributes,{'tableName':_0x378d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb138=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0xe9b919,_0x17f7e5){var _0xa4d147=function(_0x2de038){while(--_0x2de038){_0xe9b919['push'](_0xe9b919['shift']());}};_0xa4d147(++_0x17f7e5);}(_0xb138,0x1dd));var _0x8b13=function(_0x5e0c7f,_0x3bae30){_0x5e0c7f=_0x5e0c7f-0x0;var _0x131235=_0xb138[_0x5e0c7f];return _0x131235;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));module['exports']=function(_0xd19a0f,_0x13f7bd){return _0xd19a0f['define'](_0x8b13('0xa'),attributes,{'tableName':_0x8b13('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 2814346..be5a9c1 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 _0x162c=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x1c93d1,_0x4c1700){var _0x27aa84=function(_0x4a6673){while(--_0x4a6673){_0x1c93d1['push'](_0x1c93d1['shift']());}};_0x27aa84(++_0x4c1700);}(_0x162c,0x138));var _0xc162=function(_0x477cb9,_0x1f151b){_0x477cb9=_0x477cb9-0x0;var _0x59f8ec=_0x162c[_0x477cb9];return _0x59f8ec;};'use strict';var _=require('lodash');var util=require(_0xc162('0x0'));var moment=require(_0xc162('0x1'));var BPromise=require(_0xc162('0x2'));var rs=require(_0xc162('0x3'));var fs=require('fs');var Redis=require(_0xc162('0x4'));var db=require(_0xc162('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc162('0x6'))(_0xc162('0x7'));var config=require(_0xc162('0x8'));var jayson=require(_0xc162('0x9'));var client=jayson['client'][_0xc162('0xa')]({'port':0x232a});config[_0xc162('0xb')]=_[_0xc162('0xc')](config[_0xc162('0xb')],{'host':_0xc162('0xd'),'port':0x18eb});var socket=require(_0xc162('0xe'))(new Redis(config[_0xc162('0xb')]));require(_0xc162('0xf'))[_0xc162('0x10')](socket);function respondWithRpcPromise(_0x384dee,_0x5d5044,_0x13a653){return new BPromise(function(_0x131661,_0x4eb348){return client[_0xc162('0x11')](_0x384dee,_0x13a653)[_0xc162('0x12')](function(_0x5c0d13){logger[_0xc162('0x13')](_0xc162('0x14'),_0x5d5044,_0xc162('0x15'));logger['debug'](_0xc162('0x16'),_0x5d5044,_0xc162('0x15'),JSON[_0xc162('0x17')](_0x5c0d13));if(_0x5c0d13[_0xc162('0x18')]){if(_0x5c0d13['error'][_0xc162('0x19')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x5d5044,_0x5c0d13['error'][_0xc162('0x1a')]);return _0x4eb348(_0x5c0d13[_0xc162('0x18')][_0xc162('0x1a')]);}logger[_0xc162('0x18')](_0xc162('0x14'),_0x5d5044,_0x5c0d13[_0xc162('0x18')][_0xc162('0x1a')]);return _0x131661(_0x5c0d13[_0xc162('0x18')][_0xc162('0x1a')]);}else{logger[_0xc162('0x13')](_0xc162('0x14'),_0x5d5044,'request\x20sent');_0x131661(_0x5c0d13[_0xc162('0x1b')]['message']);}})[_0xc162('0x1c')](function(_0x214180){logger['error'](_0xc162('0x14'),_0x5d5044,_0x214180);_0x4eb348(_0x214180);});});} \ No newline at end of file +var _0x045c=['localhost','socket.io-emitter','register','request','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x536cf2,_0x185d82){var _0x25458a=function(_0x2bd7c9){while(--_0x2bd7c9){_0x536cf2['push'](_0x536cf2['shift']());}};_0x25458a(++_0x185d82);}(_0x045c,0x151));var _0xc045=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x045c[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0xc045('0x0'));var util=require(_0xc045('0x1'));var moment=require(_0xc045('0x2'));var BPromise=require(_0xc045('0x3'));var rs=require(_0xc045('0x4'));var fs=require('fs');var Redis=require(_0xc045('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc045('0x6'));var logger=require(_0xc045('0x7'))(_0xc045('0x8'));var config=require(_0xc045('0x9'));var jayson=require(_0xc045('0xa'));var client=jayson[_0xc045('0xb')]['http']({'port':0x232a});config[_0xc045('0xc')]=_[_0xc045('0xd')](config[_0xc045('0xc')],{'host':_0xc045('0xe'),'port':0x18eb});var socket=require(_0xc045('0xf'))(new Redis(config[_0xc045('0xc')]));require('./chatGroup.socket')[_0xc045('0x10')](socket);function respondWithRpcPromise(_0x4e5ad2,_0x12134a,_0x14c290){return new BPromise(function(_0x369cd1,_0xac2f4e){return client[_0xc045('0x11')](_0x4e5ad2,_0x14c290)['then'](function(_0x22345e){logger[_0xc045('0x12')]('ChatGroup,\x20%s,\x20%s',_0x12134a,_0xc045('0x13'));logger['debug'](_0xc045('0x14'),_0x12134a,_0xc045('0x13'),JSON[_0xc045('0x15')](_0x22345e));if(_0x22345e['error']){if(_0x22345e[_0xc045('0x16')]['code']===0x1f4){logger[_0xc045('0x16')](_0xc045('0x17'),_0x12134a,_0x22345e['error'][_0xc045('0x18')]);return _0xac2f4e(_0x22345e['error']['message']);}logger[_0xc045('0x16')]('ChatGroup,\x20%s,\x20%s',_0x12134a,_0x22345e[_0xc045('0x16')][_0xc045('0x18')]);return _0x369cd1(_0x22345e[_0xc045('0x16')][_0xc045('0x18')]);}else{logger['info'](_0xc045('0x17'),_0x12134a,_0xc045('0x13'));_0x369cd1(_0x22345e[_0xc045('0x19')][_0xc045('0x18')]);}})[_0xc045('0x1a')](function(_0x167939){logger[_0xc045('0x16')]('ChatGroup,\x20%s,\x20%s',_0x12134a,_0x167939);_0xac2f4e(_0x167939);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index bf0a37d..381a205 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 _0x0dea=['save','remove','emit','removeListener','register','chatGroup:','./chatGroup.events'];(function(_0x1f3fad,_0x469eb0){var _0x37a47f=function(_0x24bbf9){while(--_0x24bbf9){_0x1f3fad['push'](_0x1f3fad['shift']());}};_0x37a47f(++_0x469eb0);}(_0x0dea,0x1c6));var _0xa0de=function(_0x4f3522,_0x3e9fb){_0x4f3522=_0x4f3522-0x0;var _0x5b4de7=_0x0dea[_0x4f3522];return _0x5b4de7;};'use strict';var ChatGroupEvents=require(_0xa0de('0x0'));var events=[_0xa0de('0x1'),_0xa0de('0x2'),'update'];function createListener(_0x5f24a3,_0x198f29){return function(_0xfe93d0){_0x198f29[_0xa0de('0x3')](_0x5f24a3,_0xfe93d0);};}function removeListener(_0x2390a5,_0x52c3cc){return function(){ChatGroupEvents[_0xa0de('0x4')](_0x2390a5,_0x52c3cc);};}exports[_0xa0de('0x5')]=function(_0x4dc4b0){for(var _0x3eb81d=0x0,_0x267e57=events['length'];_0x3eb81d<_0x267e57;_0x3eb81d++){var _0x6cde76=events[_0x3eb81d];var _0x48a316=createListener(_0xa0de('0x6')+_0x6cde76,_0x4dc4b0);ChatGroupEvents['on'](_0x6cde76,_0x48a316);}}; \ No newline at end of file +var _0x8f28=['remove','update','register','length','chatGroup:','save'];(function(_0x2a5700,_0x1d3352){var _0x366d41=function(_0x190011){while(--_0x190011){_0x2a5700['push'](_0x2a5700['shift']());}};_0x366d41(++_0x1d3352);}(_0x8f28,0x1e5));var _0x88f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f28[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x88f2('0x0'),_0x88f2('0x1'),_0x88f2('0x2')];function createListener(_0xd9e986,_0x3725c6){return function(_0x32da45){_0x3725c6['emit'](_0xd9e986,_0x32da45);};}function removeListener(_0x4e43fb,_0x1cabd9){return function(){ChatGroupEvents['removeListener'](_0x4e43fb,_0x1cabd9);};}exports[_0x88f2('0x3')]=function(_0x7014ab){for(var _0x16d8f9=0x0,_0x3ef9d2=events[_0x88f2('0x4')];_0x16d8f9<_0x3ef9d2;_0x16d8f9++){var _0x40772c=events[_0x16d8f9];var _0x2592ca=createListener(_0x88f2('0x5')+_0x40772c,_0x7014ab);ChatGroupEvents['on'](_0x40772c,_0x2592ca);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 218cc82..ff51e4d 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 _0x19bc=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','put','update','delete','removeMembers'];(function(_0x20943d,_0x58dac0){var _0x5a09bd=function(_0x5c2060){while(--_0x5c2060){_0x20943d['push'](_0x20943d['shift']());}};_0x5a09bd(++_0x58dac0);}(_0x19bc,0xa9));var _0xc19b=function(_0x1436c1,_0x2846a7){_0x1436c1=_0x1436c1-0x0;var _0x138d30=_0x19bc[_0x1436c1];return _0x138d30;};'use strict';var multer=require(_0xc19b('0x0'));var util=require(_0xc19b('0x1'));var path=require(_0xc19b('0x2'));var timeout=require('connect-timeout');var express=require(_0xc19b('0x3'));var router=express[_0xc19b('0x4')]();var auth=require(_0xc19b('0x5'));var interaction=require(_0xc19b('0x6'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0xc19b('0x7')]('/',auth[_0xc19b('0x8')](),controller[_0xc19b('0x9')]);router[_0xc19b('0x7')](_0xc19b('0xa'),auth[_0xc19b('0x8')](),controller['describe']);router[_0xc19b('0x7')](_0xc19b('0xb'),auth[_0xc19b('0x8')](),controller[_0xc19b('0xc')]);router['get'](_0xc19b('0xd'),auth[_0xc19b('0x8')](),controller[_0xc19b('0xe')]);router[_0xc19b('0x7')]('/:id/members',auth[_0xc19b('0x8')](),controller[_0xc19b('0xf')]);router['get'](_0xc19b('0x10'),auth[_0xc19b('0x8')](),controller[_0xc19b('0x11')]);router[_0xc19b('0x12')]('/',auth[_0xc19b('0x8')](),controller[_0xc19b('0x13')]);router['post'](_0xc19b('0x14'),auth['isAuthenticated'](),controller[_0xc19b('0x15')]);router[_0xc19b('0x12')]('/:id/messages',auth[_0xc19b('0x8')](),controller[_0xc19b('0x16')]);router[_0xc19b('0x17')](_0xc19b('0xb'),auth[_0xc19b('0x8')](),controller[_0xc19b('0x18')]);router['delete'](_0xc19b('0xb'),auth[_0xc19b('0x8')](),controller['destroy']);router[_0xc19b('0x19')](_0xc19b('0x14'),auth[_0xc19b('0x8')](),controller[_0xc19b('0x1a')]);module[_0xc19b('0x1b')]=router; \ No newline at end of file +var _0xfd5d=['addMessage','update','delete','removeMembers','exports','multer','util','path','express','../../components/auth/service','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post'];(function(_0x188cb8,_0x3b12b3){var _0x25eb9b=function(_0x11770b){while(--_0x11770b){_0x188cb8['push'](_0x188cb8['shift']());}};_0x25eb9b(++_0x3b12b3);}(_0xfd5d,0x82));var _0xdfd5=function(_0x46399a,_0x108f44){_0x46399a=_0x46399a-0x0;var _0x3f97ca=_0xfd5d[_0x46399a];return _0x3f97ca;};'use strict';var multer=require(_0xdfd5('0x0'));var util=require(_0xdfd5('0x1'));var path=require(_0xdfd5('0x2'));var timeout=require('connect-timeout');var express=require(_0xdfd5('0x3'));var router=express['Router']();var auth=require(_0xdfd5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdfd5('0x5'));router[_0xdfd5('0x6')]('/',auth[_0xdfd5('0x7')](),controller[_0xdfd5('0x8')]);router[_0xdfd5('0x6')](_0xdfd5('0x9'),auth[_0xdfd5('0x7')](),controller['describe']);router[_0xdfd5('0x6')](_0xdfd5('0xa'),auth['isAuthenticated'](),controller[_0xdfd5('0xb')]);router[_0xdfd5('0x6')](_0xdfd5('0xc'),auth[_0xdfd5('0x7')](),controller[_0xdfd5('0xd')]);router[_0xdfd5('0x6')](_0xdfd5('0xe'),auth[_0xdfd5('0x7')](),controller[_0xdfd5('0xf')]);router['get'](_0xdfd5('0x10'),auth['isAuthenticated'](),controller[_0xdfd5('0x11')]);router['post']('/',auth[_0xdfd5('0x7')](),controller[_0xdfd5('0x12')]);router['post'](_0xdfd5('0xe'),auth[_0xdfd5('0x7')](),controller['addMembers']);router[_0xdfd5('0x13')](_0xdfd5('0x10'),auth[_0xdfd5('0x7')](),controller[_0xdfd5('0x14')]);router['put'](_0xdfd5('0xa'),auth[_0xdfd5('0x7')](),controller[_0xdfd5('0x15')]);router[_0xdfd5('0x16')]('/:id',auth[_0xdfd5('0x7')](),controller['destroy']);router['delete']('/:id/members',auth[_0xdfd5('0x7')](),controller[_0xdfd5('0x17')]);module[_0xdfd5('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index ab3490d..a6a01e8 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 _0xfce7=['sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out'];(function(_0x404174,_0x8d4532){var _0x42b4f3=function(_0x569859){while(--_0x569859){_0x404174['push'](_0x404174['shift']());}};_0x42b4f3(++_0x8d4532);}(_0xfce7,0xfc));var _0x7fce=function(_0x163742,_0x467e36){_0x163742=_0x163742-0x0;var _0x1152ac=_0xfce7[_0x163742];return _0x1152ac;};'use strict';var Sequelize=require(_0x7fce('0x0'));module[_0x7fce('0x1')]={'closed':{'type':Sequelize[_0x7fce('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7fce('0x3')]},'ratingType':{'type':Sequelize[_0x7fce('0x4')](_0x7fce('0x5'),_0x7fce('0x6')),'defaultValue':_0x7fce('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x7fce('0x7')]},'mailTranscript':{'type':Sequelize[_0x7fce('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7fce('0x9')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x7fce('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x7fce('0x8')]},'osVersion':{'type':Sequelize[_0x7fce('0x8')]},'deviceModel':{'type':Sequelize[_0x7fce('0x8')]},'deviceVendor':{'type':Sequelize[_0x7fce('0x8')]},'deviceType':{'type':Sequelize[_0x7fce('0x8')]},'referer':{'type':Sequelize[_0x7fce('0x7')]},'customerIp':{'type':Sequelize[_0x7fce('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x7fce('0xa'))},'read1stAt':{'type':Sequelize[_0x7fce('0x9')]},'lastMsgAt':{'type':Sequelize[_0x7fce('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x7fce('0x4')]('in',_0x7fce('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x7fce('0x8')]}}; \ No newline at end of file +var _0xeb8f=['thumb','star','TEXT','DATE','STRING','out','exports','BOOLEAN','ENUM'];(function(_0x1365aa,_0x18b126){var _0x59ebee=function(_0x2acb61){while(--_0x2acb61){_0x1365aa['push'](_0x1365aa['shift']());}};_0x59ebee(++_0x18b126);}(_0xeb8f,0x1bf));var _0xfeb8=function(_0x302a31,_0x5d1db8){_0x302a31=_0x302a31-0x0;var _0x229bd0=_0xeb8f[_0x302a31];return _0x229bd0;};'use strict';var Sequelize=require('sequelize');module[_0xfeb8('0x0')]={'closed':{'type':Sequelize[_0xfeb8('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xfeb8('0x2')]('star',_0xfeb8('0x3')),'defaultValue':_0xfeb8('0x4')},'ratingMessage':{'type':Sequelize[_0xfeb8('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xfeb8('0x6')]},'disposition':{'type':Sequelize[_0xfeb8('0x7')]},'note':{'type':Sequelize[_0xfeb8('0x7')]},'browserName':{'type':Sequelize[_0xfeb8('0x7')]},'browserVersion':{'type':Sequelize[_0xfeb8('0x7')]},'osName':{'type':Sequelize[_0xfeb8('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xfeb8('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xfeb8('0x7')]},'formData':{'type':Sequelize[_0xfeb8('0x5')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xfeb8('0x2')]('in',_0xfeb8('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xfeb8('0x7')]},'customerPort':{'type':Sequelize[_0xfeb8('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 2224240..1e7cd15 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 _0xcb66=['keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','show','params','includeAll','include','options','create','body','describe','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','basename','file','filename','mimetype','Attachment','attachmentDownload','findOne','json','Unauthorized','attachId','download','root','server/files/attachments/','mailTranscript','join','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','omit','ids','rawAttributes','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','ChatInteractionId','findAll','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','server','tmp','attachments','CmContact','firstName','lastName','direction','secret','Account','Owner','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','YYYY-MM-DD','Chat','N.A.','browserName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','out','views','toFile','transcript-','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','map','fullname','Tags','TagIds','split','forEach','push','then','ChatInteraction','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','chat_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','start','some','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','resolve','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','sequelize','toString','count'];(function(_0xff736,_0x4aff00){var _0x4ce70d=function(_0x4e5d74){while(--_0x4e5d74){_0xff736['push'](_0xff736['shift']());}};_0x4ce70d(++_0x4aff00);}(_0xcb66,0x19f));var _0x6cb6=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xcb66[_0x5ddaac];return _0x2a9c58;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6cb6('0x0'));var rimraf=require(_0x6cb6('0x1'));var zipdir=require(_0x6cb6('0x2'));var jsonpatch=require(_0x6cb6('0x3'));var rp=require(_0x6cb6('0x4'));var moment=require('moment');var BPromise=require(_0x6cb6('0x5'));var Mustache=require(_0x6cb6('0x6'));var util=require(_0x6cb6('0x7'));var path=require(_0x6cb6('0x8'));var sox=require(_0x6cb6('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6cb6('0xa'));var squel=require(_0x6cb6('0xb'));var crypto=require(_0x6cb6('0xc'));var jsforce=require(_0x6cb6('0xd'));var deskjs=require(_0x6cb6('0xe'));var toCsv=require(_0x6cb6('0xf'));var querystring=require(_0x6cb6('0x10'));var Papa=require(_0x6cb6('0x11'));var Redis=require(_0x6cb6('0x12'));var authService=require(_0x6cb6('0x13'));var qs=require(_0x6cb6('0x14'));var as=require(_0x6cb6('0x15'));var hardwareService=require(_0x6cb6('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6cb6('0x17'))['db'];config[_0x6cb6('0x18')]=_[_0x6cb6('0x19')](config[_0x6cb6('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6cb6('0x1a'))(new Redis(config[_0x6cb6('0x18')]));require('./chatInteraction.socket')[_0x6cb6('0x1b')](socket);var jayson=require(_0x6cb6('0x1c'));var client=jayson['client'][_0x6cb6('0x1d')]({'port':0x232b});var client9004=jayson[_0x6cb6('0x1e')]['http']({'port':0x232c});function checkPasswordPattern(_0x5ab865,_0x505b4d,_0x5dd4cd){if(_0x5dd4cd){var _0x380edc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x380edc[_0x6cb6('0x1f')](_0x505b4d)){return _0x5ab865;}else{throw new db[(_0x6cb6('0x20'))][(_0x6cb6('0x21'))](_0x6cb6('0x22'));}}else{return _0x5ab865;}}function respondWithRpcPromise(_0x40d445,_0x5b8a17,_0x1e8b7e,_0xc0bdea){return new BPromise(function(_0x57c4f4,_0x4b9da5){var _0x5ef3d2=_0xc0bdea||client;return _0x5ef3d2['request'](_0x40d445,_0x1e8b7e)['then'](function(_0x5e5349){logger[_0x6cb6('0x23')](_0x6cb6('0x24'),_0x5b8a17,_0x6cb6('0x25'));logger[_0x6cb6('0x26')](_0x6cb6('0x27'),_0x5b8a17,'request\x20sent',JSON['stringify'](_0x5e5349));if(_0x5e5349[_0x6cb6('0x28')]){if(_0x5e5349[_0x6cb6('0x28')][_0x6cb6('0x29')]===0x1f4){logger[_0x6cb6('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x5b8a17,_0x5e5349[_0x6cb6('0x28')][_0x6cb6('0x2a')]);return _0x4b9da5(_0x5e5349['error']['message']);}logger[_0x6cb6('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x5b8a17,_0x5e5349[_0x6cb6('0x28')][_0x6cb6('0x2a')]);return _0x57c4f4(_0x5e5349[_0x6cb6('0x28')][_0x6cb6('0x2a')]);}else{logger[_0x6cb6('0x23')](_0x6cb6('0x24'),_0x5b8a17,_0x6cb6('0x25'));_0x57c4f4(_0x5e5349[_0x6cb6('0x2b')][_0x6cb6('0x2a')]);}})[_0x6cb6('0x2c')](function(_0x47a81b){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5b8a17,_0x47a81b);_0x4b9da5(_0x47a81b);});});}function respondWithStatusCode(_0x2dc6c9,_0x462dbf){_0x462dbf=_0x462dbf||0xcc;return function(_0xf07150){if(_0xf07150){return _0x2dc6c9[_0x6cb6('0x2d')](_0x462dbf);}return _0x2dc6c9[_0x6cb6('0x2e')](_0x462dbf)[_0x6cb6('0x2f')]();};}function respondWithResult(_0x57cd74,_0x124291){_0x124291=_0x124291||0xc8;return function(_0x4d4ad9){if(_0x4d4ad9){return _0x57cd74[_0x6cb6('0x2e')](_0x124291)['json'](_0x4d4ad9);}};}function respondWithFilteredResult(_0x13126c,_0x1f59cd){return function(_0x32c373){if(_0x32c373){var _0x59b26e=_0x32c373['count'],_0x417dec=_0x1f59cd[_0x6cb6('0x30')],_0x1b7428=_0x1f59cd[_0x6cb6('0x30')]+_0x1f59cd[_0x6cb6('0x31')],_0x8de1a0;if(_0x1b7428>=_0x59b26e){_0x1b7428=_0x59b26e;_0x8de1a0=0xc8;}else{_0x8de1a0=0xce;}_0x13126c['status'](_0x8de1a0);return _0x13126c[_0x6cb6('0x32')](_0x6cb6('0x33'),_0x417dec+'-'+_0x1b7428+'/'+_0x59b26e)['json'](_0x32c373);}return null;};}function patchUpdates(_0x2a8ae0){return function(_0x1e5c33){try{jsonpatch[_0x6cb6('0x34')](_0x1e5c33,_0x2a8ae0,!![]);}catch(_0x6c6d53){return BPromise[_0x6cb6('0x35')](_0x6c6d53);}return _0x1e5c33[_0x6cb6('0x36')]();};}function saveUpdates(_0x3b05fe,_0xc97145){return function(_0x40030e){if(_0x40030e){return _0x40030e[_0x6cb6('0x37')](_0x3b05fe)['then'](function(_0x2b95e4){return _0x2b95e4;});}return null;};}function removeEntity(_0x1328b2,_0x137c4c){return function(_0x2f7c65){if(_0x2f7c65){return _0x2f7c65['destroy']()['then'](function(){_0x1328b2['status'](0xcc)[_0x6cb6('0x2f')]();});}};}function handleEntityNotFound(_0x21b495,_0x272f54){return function(_0x39b543){if(!_0x39b543){_0x21b495[_0x6cb6('0x2d')](0x194);}return _0x39b543;};}function handleError(_0xa9f21b,_0x317c84){_0x317c84=_0x317c84||0x1f4;return function(_0x950248){logger['error'](_0x950248[_0x6cb6('0x38')]);if(_0x950248['name']){delete _0x950248[_0x6cb6('0x39')];}_0xa9f21b[_0x6cb6('0x2e')](_0x317c84)[_0x6cb6('0x3a')](_0x950248);};}function getInteractionUsers(_0x20a881,_0xb09374){return new BPromise(function(_0x3bd60c,_0x1bb1e4){try{if(_0xb09374[_0x20a881['id']]){_0x20a881['Users']=_[_0x6cb6('0x3b')](_0xb09374[_0x20a881['id']],function(_0x58a304){return{'id':_0x58a304['id'],'fullname':_0x58a304[_0x6cb6('0x3c')]};});}}catch(_0x18a4a1){_0x1bb1e4(_0x18a4a1);}_0x3bd60c(_0x20a881);});}function getInteractionTags(_0x3bb13d,_0x5a60a0){return new BPromise(function(_0x4cbef4,_0x95392){try{if(_0x3bb13d['TagIds']){_0x3bb13d[_0x6cb6('0x3d')]=[];_0x3bb13d[_0x6cb6('0x3e')][_0x6cb6('0x3f')](',')[_0x6cb6('0x40')](function(_0x267c95){_0x3bb13d[_0x6cb6('0x3d')][_0x6cb6('0x41')](_0x5a60a0[_0x267c95]);});}delete _0x3bb13d['TagIds'];}catch(_0x359bd1){_0x95392(_0x359bd1);}_0x4cbef4(_0x3bb13d);});}function updateChatInteraction(_0x102c1b,_0x4d380e,_0x163a8b){return new BPromise(function(_0x4c6b9f,_0x81b536){return getInteractionUsers(_0x102c1b,_0x163a8b)[_0x6cb6('0x42')](function(_0x15a0a8){return getInteractionTags(_0x15a0a8,_0x4d380e);})[_0x6cb6('0x42')](function(_0x571cba){_0x4c6b9f(_0x571cba);})['catch'](function(_0x1f4e94){_0x81b536(_0x1f4e94);});});}exports['index']=function(_0x588ea4,_0x605673){var _0x49beec={},_0x428d65={},_0x7bd70d={'count':0x0,'rows':[]};var _0x49a749=_['map'](db[_0x6cb6('0x43')]['rawAttributes'],function(_0x2aa2a9){return{'name':_0x2aa2a9[_0x6cb6('0x44')],'type':_0x2aa2a9['type'][_0x6cb6('0x45')]};});_0x428d65[_0x6cb6('0x46')]=_['map'](_0x49a749,_0x6cb6('0x39'));_0x428d65['query']=_[_0x6cb6('0x47')](_0x588ea4[_0x6cb6('0x48')]);_0x428d65['filters']=_[_0x6cb6('0x49')](_0x428d65[_0x6cb6('0x46')],_0x428d65['query']);_0x49beec['attributes']=_[_0x6cb6('0x49')](_0x428d65[_0x6cb6('0x46')],qs[_0x6cb6('0x4a')](_0x588ea4['query'][_0x6cb6('0x4a')]));_0x49beec[_0x6cb6('0x4b')]=_0x49beec['attributes'][_0x6cb6('0x4c')]?_0x49beec[_0x6cb6('0x4b')]:_0x428d65[_0x6cb6('0x46')];if(!_0x588ea4['query'][_0x6cb6('0x4d')](_0x6cb6('0x4e'))){_0x49beec[_0x6cb6('0x31')]=qs[_0x6cb6('0x31')](_0x588ea4[_0x6cb6('0x48')][_0x6cb6('0x31')]);_0x49beec['offset']=qs[_0x6cb6('0x30')](_0x588ea4['query']['offset']);}_0x49beec[_0x6cb6('0x4f')]=qs[_0x6cb6('0x50')](_0x588ea4['query'][_0x6cb6('0x50')]);_0x49beec['where']=qs[_0x6cb6('0x51')](_[_0x6cb6('0x52')](_0x588ea4[_0x6cb6('0x48')],_0x428d65['filters']));var _0x394f72=[];var _0x298a36=squel[_0x6cb6('0x53')]()['field']('id')[_0x6cb6('0x54')]('name')[_0x6cb6('0x54')](_0x6cb6('0x55'))[_0x6cb6('0x56')]('tools_tags');var _0x5e795c=squel[_0x6cb6('0x53')]()[_0x6cb6('0x54')](_0x6cb6('0x57'))['field'](_0x6cb6('0x58'))[_0x6cb6('0x54')](_0x6cb6('0x59'))['from'](_0x6cb6('0x5a'),'ui')[_0x6cb6('0x5b')](_0x6cb6('0x5c'),'u','u.id\x20=\x20ui.UserId');var _0x3f011f=squel[_0x6cb6('0x53')]()[_0x6cb6('0x56')](_0x6cb6('0x5d'),'i')[_0x6cb6('0x5b')](_0x6cb6('0x5e'),'c',_0x6cb6('0x5f'))[_0x6cb6('0x5b')](_0x6cb6('0x5c'),'o',_0x6cb6('0x60'))[_0x6cb6('0x5b')](_0x6cb6('0x61'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x6cb6('0x5b')](_0x6cb6('0x62'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x6cb6('0x5b')](_0x6cb6('0x63'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x6cb6('0x5b')](_0x6cb6('0x64'),'t',_0x6cb6('0x65'));var _0x58f239=squel[_0x6cb6('0x66')]();var _0x1b489b=[];var _0x46ae66=squel[_0x6cb6('0x66')]();var _0x27ec34;if(_0x588ea4[_0x6cb6('0x48')][_0x6cb6('0x67')]){_0x27ec34=as[_0x6cb6('0x68')](_0x588ea4[_0x6cb6('0x48')][_0x6cb6('0x67')]);var _0x4e9c3f=_0x27ec34[_0x6cb6('0x69')];for(var _0xb3937e=0x0;_0xb3937e<_0x27ec34['conditions'][_0x6cb6('0x4c')];_0xb3937e++){var _0x555bbd=_0x27ec34['conditions'][_0xb3937e];var _0x3844a9='i';var _0x28096c=_[_0x6cb6('0x6a')](_0x49a749,[_0x6cb6('0x39'),_0x555bbd[_0x6cb6('0x54')]]);if(!_0x28096c){switch(_0x555bbd['field']){case _0x6cb6('0x6b'):if(_0x555bbd[_0x6cb6('0x6c')]==0x1){_0x3f011f['having']('`'+_0x555bbd[_0x6cb6('0x54')]+_0x6cb6('0x6d'));}else{_0x3f011f[_0x6cb6('0x6e')]('`'+_0x555bbd['field']+_0x6cb6('0x6f'));}break;case _0x6cb6('0x70'):if(_0x555bbd[_0x6cb6('0x71')]===_0x6cb6('0x72')){if(_0x555bbd[_0x6cb6('0x6c')]['split']('\x20')[_0x6cb6('0x4c')]>0x1){_0x58f239[_0x4e9c3f]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6cb6('0x73')](_0x555bbd['value']),null);}else{var _0x2e285f='%'+_0x555bbd[_0x6cb6('0x6c')]+'%';_0x58f239[_0x4e9c3f](_0x6cb6('0x74'),_0x2e285f,_0x2e285f,_0x2e285f);}}else{_0x28096c=_[_0x6cb6('0x6a')](_0x49a749,[_0x6cb6('0x39'),'ContactId']);_0x555bbd[_0x6cb6('0x54')]=_0x6cb6('0x75');_0x1c136f=as[_0x6cb6('0x76')](_0x3844a9,_0x28096c[_0x6cb6('0x77')],_0x555bbd);_0x58f239[_0x4e9c3f](_0x1c136f[_0x6cb6('0x78')],_0x1c136f[_0x6cb6('0x6c')]['start'],_0x1c136f['value'][_0x6cb6('0x2f')]);}break;case _0x6cb6('0x79'):var _0x2acef7=_0x555bbd['value'][_0x6cb6('0x3f')](',')[_0x6cb6('0x3b')](function(_0x84d0cc){return Number(_0x84d0cc);});_0x2acef7['forEach'](function(_0x558e39){_0x46ae66['or'](_0x6cb6('0x7a'),'%,'+_0x558e39+',%');});_0x1b489b=_[_0x6cb6('0x7b')](_0x1b489b,_0x2acef7);break;case _0x6cb6('0x7c'):if(_0x555bbd['operator']===_0x6cb6('0x72')){_0x58f239[_0x4e9c3f]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x555bbd[_0x6cb6('0x6c')]+'%',null);}else{_0x28096c=_[_0x6cb6('0x6a')](_0x49a749,[_0x6cb6('0x39'),'UserId']);_0x555bbd['field']=_0x6cb6('0x7d');_0x1c136f=as[_0x6cb6('0x76')](_0x3844a9,_0x28096c['type'],_0x555bbd);_0x58f239[_0x4e9c3f](_0x1c136f[_0x6cb6('0x78')],_0x1c136f['value'][_0x6cb6('0x7e')],_0x1c136f['value']['end']);}break;case'body':_0x1c136f=as[_0x6cb6('0x76')]('me',null,_0x555bbd);_0x58f239[_0x4e9c3f](_0x1c136f[_0x6cb6('0x78')],_0x1c136f[_0x6cb6('0x6c')][_0x6cb6('0x7e')],_0x1c136f['value']['end']);break;}}else{var _0x1c136f=as['buildExpression'](_0x3844a9,_0x28096c['type'],_0x555bbd);_0x58f239[_0x4e9c3f](_0x1c136f[_0x6cb6('0x78')],_0x1c136f[_0x6cb6('0x6c')][_0x6cb6('0x7e')],_0x1c136f[_0x6cb6('0x6c')]['end']);}}}else{var _0x3161e1=_(_0x588ea4[_0x6cb6('0x48')])[_0x6cb6('0x47')]()['map'](function(_0x5d262b){return _[_0x6cb6('0x7f')](_0x49a749,['name',_0x5d262b])?_0x5d262b:undefined;})[_0x6cb6('0x80')]()['value']();if(!_['isEmpty'](_0x3161e1)){_0x3161e1[_0x6cb6('0x40')](function(_0x2448dd){if(_0x2448dd===_0x6cb6('0x81')){_0x3f011f[_0x6cb6('0x82')](_0x6cb6('0x83'),[][_0x6cb6('0x84')](_0x588ea4[_0x6cb6('0x48')][_0x2448dd]));}else if(_0x2448dd===_0x6cb6('0x85')){var _0x566a61=JSON[_0x6cb6('0x86')](_0x588ea4[_0x6cb6('0x48')][_0x2448dd])[_0x6cb6('0x87')];var _0x4283a7=JSON[_0x6cb6('0x86')](_0x588ea4[_0x6cb6('0x48')][_0x2448dd])[_0x6cb6('0x88')];_0x3f011f[_0x6cb6('0x82')](_0x6cb6('0x89'),_0x566a61,_0x4283a7);}else{if(_0x588ea4['query'][_0x2448dd]==='null'){_0x3f011f['where']('i.'+_0x2448dd+'\x20IS\x20NULL');}else{_0x3f011f[_0x6cb6('0x82')]('i.'+_0x2448dd+'\x20=\x20?',_0x588ea4[_0x6cb6('0x48')][_0x2448dd]);}}});}if(_0x588ea4[_0x6cb6('0x48')][_0x6cb6('0x8a')]){if(_0x588ea4[_0x6cb6('0x48')][_0x6cb6('0x8a')]==0x1){_0x3f011f[_0x6cb6('0x6e')](_0x6cb6('0x8b'));}else{_0x3f011f[_0x6cb6('0x6e')](_0x6cb6('0x8c'));}}if(_0x588ea4[_0x6cb6('0x48')][_0x6cb6('0x8d')]){_0x1b489b=_['isArray'](_0x588ea4['query'][_0x6cb6('0x8d')])?_0x588ea4[_0x6cb6('0x48')][_0x6cb6('0x8d')]:new Array(_0x588ea4[_0x6cb6('0x48')][_0x6cb6('0x8d')]);_0x1b489b[_0x6cb6('0x40')](function(_0x487f1f){_0x46ae66['or'](_0x6cb6('0x7a'),'%,'+_0x487f1f+',%');});}if(_0x588ea4['query'][_0x6cb6('0x8e')]){var _0xcade2b=_0x588ea4[_0x6cb6('0x48')][_0x6cb6('0x8e')][_0x6cb6('0x8f')]('\x5c','\x5c\x5c')[_0x6cb6('0x8f')]('\x27\x27',_0x6cb6('0x90'));if(qs['isNumeric'](_0xcade2b)){_0x58f239['or']('i.id\x20LIKE\x20?',_0xcade2b+'%');}else{_0x58f239['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6cb6('0x73')](_0xcade2b))['or'](_0x6cb6('0x91'),_0xcade2b+'%');}}}_0x3f011f[_0x6cb6('0x82')](_0x58f239);_0x3f011f[_0x6cb6('0x92')](_0x6cb6('0x93'));var _0x1e8c05={'type':db[_0x6cb6('0x20')][_0x6cb6('0x94')][_0x6cb6('0x95')],'raw':!![]};var _0x564720=_0x3f011f[_0x6cb6('0x96')]();_0x564720[_0x6cb6('0x54')](_0x6cb6('0x93'));_0x564720[_0x6cb6('0x54')](_0x6cb6('0x97'),_0x6cb6('0x6b'));if(_0x49beec[_0x6cb6('0x4f')]){_0x49beec['order'][_0x6cb6('0x40')](function(_0x3e1185){_0x3f011f[_0x6cb6('0x4f')]('i.'+_0x3e1185[0x0],_0x3e1185[0x1]===_0x6cb6('0x98')?![]:!![]);});}if(!_[_0x6cb6('0x99')](_0x1b489b)){_0x3f011f['having'](_0x46ae66);_0x564720[_0x6cb6('0x82')](_0x6cb6('0x9a'),_0x1b489b);}BPromise[_0x6cb6('0x9b')]()[_0x6cb6('0x42')](function(){if(!_0x27ec34){if(_0x588ea4[_0x6cb6('0x48')]['ChatWebsiteId']||_0x588ea4[_0x6cb6('0x48')][_0x6cb6('0x9c')])return;_0x564720[_0x6cb6('0x82')](_0x6cb6('0x9d'));_0x3f011f[_0x6cb6('0x82')](_0x6cb6('0x9d'));return;}return _0x588ea4[_0x6cb6('0x9e')][_0x6cb6('0x9f')]({'attributes':['id'],'raw':!![]})[_0x6cb6('0x42')](function(_0x3d891b){if(_[_0x6cb6('0x99')](_0x3d891b)){_0x564720[_0x6cb6('0x82')]('i.ChatWebsiteId\x20IS\x20NULL');_0x3f011f[_0x6cb6('0x82')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x564720['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x6cb6('0x3b')](_0x3d891b,'id'));_0x3f011f['where'](_0x6cb6('0x83'),_[_0x6cb6('0x3b')](_0x3d891b,'id'));}});})[_0x6cb6('0x42')](function(){db[_0x6cb6('0xa0')][_0x6cb6('0x48')](_0x564720[_0x6cb6('0xa1')](),_0x1e8c05)[_0x6cb6('0x42')](function(_0x22ec75){_0x7bd70d[_0x6cb6('0xa2')]=_0x22ec75[_0x6cb6('0x4c')];if(_0x7bd70d['count']===0x0)return[];return db[_0x6cb6('0xa0')][_0x6cb6('0x48')](_0x298a36['toString'](),_0x1e8c05)[_0x6cb6('0x42')](function(_0x51d532){_0x394f72=_[_0x6cb6('0xa3')](_0x51d532,'id');_0x1e8c05=_[_0x6cb6('0xa4')](_0x1e8c05,{'model':db[_0x6cb6('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x588ea4[_0x6cb6('0x48')][_0x6cb6('0x4a')]){_0x49beec[_0x6cb6('0x4b')][_0x6cb6('0x40')](function(_0x5b8b89){_0x3f011f[_0x6cb6('0x54')]('i.'+_0x5b8b89);});}else{_0x3f011f[_0x6cb6('0x54')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6cb6('0x6b'));_0x3f011f['field'](_0x6cb6('0xa5'),_0x6cb6('0xa6'));_0x3f011f['field'](_0x6cb6('0xa7'),_0x6cb6('0xa8'));_0x3f011f[_0x6cb6('0x54')](_0x6cb6('0xa9'));_0x3f011f[_0x6cb6('0x54')](_0x6cb6('0xaa'),'Contact.firstName');_0x3f011f[_0x6cb6('0x54')](_0x6cb6('0xab'),_0x6cb6('0xac'));_0x3f011f[_0x6cb6('0x54')](_0x6cb6('0xad'),_0x6cb6('0xae'));_0x3f011f['field'](_0x6cb6('0xaf'),'Contact.phone');_0x3f011f['field'](_0x6cb6('0xb0'),_0x6cb6('0xb1'));_0x3f011f['field'](_0x6cb6('0xb2'),_0x6cb6('0xb3'));_0x3f011f['field'](_0x6cb6('0xb4'),_0x6cb6('0xb5'));_0x3f011f[_0x6cb6('0x54')]('o.internal','Owner.internal');_0x3f011f[_0x6cb6('0x54')](_0x6cb6('0xb6'),_0x6cb6('0x3e'));}_0x3f011f[_0x6cb6('0x31')](_0x49beec[_0x6cb6('0x31')]);_0x3f011f[_0x6cb6('0x30')](_0x49beec[_0x6cb6('0x30')]);return db[_0x6cb6('0xa0')][_0x6cb6('0x48')](_0x3f011f[_0x6cb6('0xa1')](),_0x1e8c05);})[_0x6cb6('0x42')](function(_0x51192f){_0x5e795c[_0x6cb6('0x82')](_0x6cb6('0xb7'),_[_0x6cb6('0x3b')](_0x51192f,'id'));return db[_0x6cb6('0xa0')][_0x6cb6('0x48')](_0x5e795c[_0x6cb6('0xa1')](),_0x1e8c05)['then'](function(_0x1a2172){var _0x10d06b=_[_0x6cb6('0xb8')](_0x1a2172,'ChatInteractionId');var _0x11ba2f=[];_0x51192f[_0x6cb6('0x40')](function(_0x49e24c){_0x11ba2f['push'](updateChatInteraction(_0x49e24c,_0x394f72,_0x10d06b));});return BPromise[_0x6cb6('0xb9')](_0x11ba2f);});});})['then'](function(_0x346f84){_0x7bd70d[_0x6cb6('0xba')]=_0x346f84;return _0x7bd70d;})['then'](respondWithFilteredResult(_0x605673,_0x49beec));})[_0x6cb6('0x2c')](handleError(_0x605673,null));};exports[_0x6cb6('0xbb')]=function(_0x2efdb0,_0x303c38){var _0x22858a={'raw':![],'where':{'id':_0x2efdb0[_0x6cb6('0xbc')]['id']}},_0x4b0b04={};_0x4b0b04[_0x6cb6('0x46')]=_[_0x6cb6('0x47')](db[_0x6cb6('0x43')]['rawAttributes']);_0x4b0b04[_0x6cb6('0x48')]=_[_0x6cb6('0x47')](_0x2efdb0[_0x6cb6('0x48')]);_0x4b0b04[_0x6cb6('0x51')]=_[_0x6cb6('0x49')](_0x4b0b04['model'],_0x4b0b04['query']);_0x22858a['attributes']=_[_0x6cb6('0x49')](_0x4b0b04[_0x6cb6('0x46')],qs[_0x6cb6('0x4a')](_0x2efdb0[_0x6cb6('0x48')]['fields']));_0x22858a[_0x6cb6('0x4b')]=_0x22858a[_0x6cb6('0x4b')][_0x6cb6('0x4c')]?_0x22858a[_0x6cb6('0x4b')]:_0x4b0b04[_0x6cb6('0x46')];if(_0x2efdb0['query'][_0x6cb6('0xbd')]){_0x22858a[_0x6cb6('0xbe')]=[{'all':!![]}];}_0x22858a=_[_0x6cb6('0xa4')]({},_0x22858a,_0x2efdb0[_0x6cb6('0xbf')]);return db[_0x6cb6('0x43')][_0x6cb6('0x6a')](_0x22858a)[_0x6cb6('0x42')](handleEntityNotFound(_0x303c38,null))[_0x6cb6('0x42')](respondWithResult(_0x303c38,null))[_0x6cb6('0x2c')](handleError(_0x303c38,null));};exports[_0x6cb6('0xc0')]=function(_0x23c162,_0x3e7400){return db[_0x6cb6('0x43')]['create'](_0x23c162[_0x6cb6('0xc1')],{})[_0x6cb6('0x42')](respondWithResult(_0x3e7400,0xc9))[_0x6cb6('0x2c')](handleError(_0x3e7400,null));};exports[_0x6cb6('0x37')]=function(_0xf5437,_0x121f10){if(_0xf5437['body']['id']){delete _0xf5437[_0x6cb6('0xc1')]['id'];}return db['ChatInteraction'][_0x6cb6('0x6a')]({'where':{'id':_0xf5437[_0x6cb6('0xbc')]['id']}})[_0x6cb6('0x42')](handleEntityNotFound(_0x121f10,null))[_0x6cb6('0x42')](saveUpdates(_0xf5437[_0x6cb6('0xc1')],null))[_0x6cb6('0x42')](respondWithResult(_0x121f10,null))[_0x6cb6('0x2c')](handleError(_0x121f10,null));};exports['destroy']=function(_0x51cbfc,_0x9d49a9){return db[_0x6cb6('0x43')]['find']({'where':{'id':_0x51cbfc[_0x6cb6('0xbc')]['id']}})[_0x6cb6('0x42')](handleEntityNotFound(_0x9d49a9,null))['then'](removeEntity(_0x9d49a9,null))['catch'](handleError(_0x9d49a9,null));};exports['describe']=function(_0x44d8a9,_0x371a73){return db['ChatInteraction'][_0x6cb6('0xc2')]()[_0x6cb6('0x42')](respondWithResult(_0x371a73,null))[_0x6cb6('0x2c')](handleError(_0x371a73,null));};exports['customUpdate']=function(_0x2412e2,_0x4ca47b){if(_0x2412e2['body']['id']){delete _0x2412e2['body']['id'];}return db[_0x6cb6('0x43')]['find']({'where':{'id':_0x2412e2[_0x6cb6('0xbc')]['id']}})[_0x6cb6('0x42')](handleEntityNotFound(_0x4ca47b,null))[_0x6cb6('0x42')](saveUpdates(_0x2412e2['body'],null))[_0x6cb6('0x42')](respondWithResult(_0x4ca47b,null))['catch'](handleError(_0x4ca47b,null));};exports['abandon']=function(_0x956faa,_0x32f2f4,_0x535241){if(_0x956faa[_0x6cb6('0xc1')]['id']){delete _0x956faa[_0x6cb6('0xc1')]['id'];}return db[_0x6cb6('0x43')][_0x6cb6('0x6a')]({'where':{'id':_0x956faa[_0x6cb6('0xbc')]['id']}})[_0x6cb6('0x42')](function(_0x1bd53c){if(!_0x1bd53c){logger[_0x6cb6('0x28')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x6cb6('0xc3'),0x194,_0x6cb6('0xc4'));_0x32f2f4[_0x6cb6('0x2d')](0x194);}else{if(_0x1bd53c['UserId']){throw new db[(_0x6cb6('0x20'))][(_0x6cb6('0x21'))](_0x6cb6('0xc5'));}}return _0x1bd53c;})[_0x6cb6('0x42')](function(_0x4a4b71){if(_0x4a4b71){return _0x4a4b71[_0x6cb6('0x37')]({'closed':_0x956faa[_0x6cb6('0xc1')][_0x6cb6('0xc6')],'disposition':_0x956faa['body'][_0x6cb6('0xc7')]})[_0x6cb6('0x42')](function(_0x4851fd){return _0x4851fd;});}})[_0x6cb6('0x42')](function(_0x6807ad){return respondWithRpcPromise(_0x6cb6('0xc8'),'abandon',_0x956faa[_0x6cb6('0xc1')],client9004);})['then'](respondWithResult(_0x32f2f4,null))['catch'](handleError(_0x32f2f4,null));};exports[_0x6cb6('0xc9')]=function(_0x5bbb30,_0x196ab3,_0x4d32f6){_0x5bbb30['body'][_0x6cb6('0x39')]=_0x5bbb30['file']['originalname'];_0x5bbb30[_0x6cb6('0xc1')][_0x6cb6('0xca')]=_0x5bbb30[_0x6cb6('0xcb')][_0x6cb6('0xcc')];_0x5bbb30[_0x6cb6('0xc1')][_0x6cb6('0x77')]=_0x5bbb30[_0x6cb6('0xcb')][_0x6cb6('0xcd')];return db[_0x6cb6('0xce')][_0x6cb6('0xc0')](_0x5bbb30[_0x6cb6('0xc1')])['then'](respondWithResult(_0x196ab3,0xc9))[_0x6cb6('0x2c')](handleError(_0x196ab3,null));};exports[_0x6cb6('0xcf')]=function(_0x48e20f,_0x3a36c5,_0x343093){return db['ChatInteraction'][_0x6cb6('0xd0')]({'where':{'id':_0x48e20f[_0x6cb6('0xbc')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3a36c5,null))[_0x6cb6('0x42')](function(_0x4dbee7){if(_0x4dbee7){if(_0x4dbee7[_0x6cb6('0xc6')]){return _0x3a36c5[_0x6cb6('0x2e')](0x193)[_0x6cb6('0xd1')]({'status':0x193,'message':_0x6cb6('0xd2')});}return db[_0x6cb6('0xce')][_0x6cb6('0xd0')]({'where':{'id':_0x48e20f[_0x6cb6('0x48')][_0x6cb6('0xd3')]},'raw':!![]})['then'](handleEntityNotFound(_0x3a36c5,null));}})[_0x6cb6('0x42')](function(_0x56465e){if(_0x56465e){return _0x3a36c5[_0x6cb6('0xd4')](path['join'](config[_0x6cb6('0xd5')],_0x6cb6('0xd6'),_0x56465e[_0x6cb6('0xca')]));}})[_0x6cb6('0x2c')](handleError(_0x3a36c5,null));};exports['close']=function(_0x58b0ef,_0x3f224e){var _0x290ef6=null;var _0x32e7af=null;var _0xb493c8=null;var _0x4f660f=null;if(_0x58b0ef[_0x6cb6('0xc1')]['id']){delete _0x58b0ef[_0x6cb6('0xc1')]['id'];}if(_0x58b0ef[_0x6cb6('0xc1')][_0x6cb6('0xd7')]){_0x4f660f=path[_0x6cb6('0xd8')](config[_0x6cb6('0xd5')],_0x6cb6('0xd9'),util['format'](_0x6cb6('0xda'),Date[_0x6cb6('0xdb')]()));_0x58b0ef[_0x6cb6('0xc1')][_0x6cb6('0xdc')]=_0x4f660f;}return db[_0x6cb6('0x43')][_0x6cb6('0x6a')]({'where':{'id':_0x58b0ef['params']['id']},'include':[{'model':db[_0x6cb6('0xdd')],'as':_0x6cb6('0xde'),'include':[{'model':db[_0x6cb6('0x7c')],'as':'User'}]}]})[_0x6cb6('0x42')](handleEntityNotFound(_0x3f224e,null))[_0x6cb6('0x42')](saveUpdates(_0x58b0ef[_0x6cb6('0xc1')],null))['then'](function(_0x360f3b){if(_0x360f3b){_0x290ef6=_0x360f3b;return db['ChatWebsite'][_0x6cb6('0x6a')]({'where':{'id':_0x290ef6['ChatWebsiteId']}});}})[_0x6cb6('0x42')](function(_0x325408){if(_0x325408){_0xb493c8=_0x325408;return db['CmContact']['find']({'where':{'id':_0x290ef6['ContactId']}});}})['then'](function(_0x476c52){if(_0x476c52){_0x32e7af=_0x476c52;if(_0x4f660f){var _0x350f46=null;for(var _0x421e3c=0x1;_0x421e3c<_0x290ef6[_0x6cb6('0xde')][_0x6cb6('0x4c')];++_0x421e3c){_0x350f46=_0x290ef6['Messages'][_0x421e3c];var _0x539710=_0x350f46[_0x6cb6('0x7d')]?util[_0x6cb6('0xdf')](_0x6cb6('0xe0'),_0xb493c8[_0x6cb6('0xe1')],_0x350f46[_0x6cb6('0x7d')]):_0x6cb6('0xe2');var _0x527e53=_0x58b0ef[_0x6cb6('0xc1')][_0x6cb6('0xe3')]||util[_0x6cb6('0xdf')](_0x6cb6('0xe0'),_0x6cb6('0xe4'),_0x350f46['ContactId']);switch(_0xb493c8[_0x6cb6('0xe5')]){case _0x6cb6('0xe6'):_0x539710=_0x350f46[_0x6cb6('0x7d')]?util[_0x6cb6('0xdf')](_0x6cb6('0xe0'),_0xb493c8['agentAlias'],_0x350f46[_0x6cb6('0x7d')]):'System';break;case _0x6cb6('0xe7'):_0x539710=_0x350f46[_0x6cb6('0x7d')]?_0x350f46[_0x6cb6('0x7c')][_0x6cb6('0xe8')]||_0x350f46['User'][_0x6cb6('0x3c')]:'System';break;case'agent_fullname':_0x539710=_0x350f46[_0x6cb6('0x7d')]?_0x350f46['User'][_0x6cb6('0x3c')]:_0x6cb6('0xe2');break;default:_0x539710=_0x350f46[_0x6cb6('0x7d')]?util['format'](_0x6cb6('0xe0'),_0xb493c8[_0x6cb6('0xe1')],_0x350f46[_0x6cb6('0x7d')]):_0x6cb6('0xe2');}var _0x662b7d=util[_0x6cb6('0xdf')](_0x6cb6('0xe9'),moment(_0x350f46[_0x6cb6('0x85')])['format'](_0x6cb6('0xea')),_0x350f46['direction']==='in'?_0x527e53:_0x539710,_0x350f46[_0x6cb6('0xc1')]);if(!_0x350f46['secret']){fs[_0x6cb6('0xeb')](_0x4f660f,_0x662b7d);}}return db[_0x6cb6('0xec')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x6cb6('0xed')],'as':'Smtp','raw':!![]}]});}}})['then'](function(_0x104623){if(_0x104623&&_0x104623[_0x6cb6('0xee')]&&_0x58b0ef[_0x6cb6('0xc1')]){var _0x3468c3={'tls':{'rejectUnauthorized':![]}};if(_0x104623[_0x6cb6('0xee')][_0x6cb6('0xef')]){_0x3468c3[_0x6cb6('0xef')]=_0x104623[_0x6cb6('0xee')][_0x6cb6('0xef')];}else{_0x3468c3[_0x6cb6('0xf0')]=_0x104623[_0x6cb6('0xee')][_0x6cb6('0xf0')];_0x3468c3[_0x6cb6('0xf1')]=_0x104623[_0x6cb6('0xee')]['port'];_0x3468c3[_0x6cb6('0xf2')]=_0x104623['Smtp'][_0x6cb6('0xf2')];}if(_0x104623['Smtp'][_0x6cb6('0xf3')]){_0x3468c3[_0x6cb6('0xf4')]={'user':_0x104623['Smtp'][_0x6cb6('0x9e')],'pass':_0x104623[_0x6cb6('0xee')]['pass']};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x3468c3,'message':{'from':util[_0x6cb6('0xdf')]('\x22%s\x22\x20<%s>',_0x104623[_0x6cb6('0x39')],_0x104623['email']||_0x104623[_0x6cb6('0xee')][_0x6cb6('0x9e')]),'to':_0x58b0ef[_0x6cb6('0xc1')]['mailTranscript'],'subject':_0x6cb6('0xf5'),'text':util['format'](_0x6cb6('0xf6'),_0x58b0ef[_0x6cb6('0xc1')][_0x6cb6('0xd7')]),'attachments':[{'path':_0x4f660f}]}})[_0x6cb6('0x42')](function(){return _0x290ef6;})[_0x6cb6('0x2c')](function(_0x38779b){console[_0x6cb6('0x28')](_0x38779b);});}else{return _0x290ef6;}})[_0x6cb6('0x42')](respondWithStatusCode(_0x3f224e,0xc8))[_0x6cb6('0x2c')](handleError(_0x3f224e,null));};exports['addMessage']=function(_0x4a5dc7,_0x1d11d9,_0x4e7610){return db[_0x6cb6('0xdd')][_0x6cb6('0x6a')]({'where':{'id':_0x4a5dc7[_0x6cb6('0xbc')]['id']}})['then'](handleEntityNotFound(_0x1d11d9,null))[_0x6cb6('0x42')](function(_0xc3b135){if(_0xc3b135){return _0xc3b135['addMessage'](_0x4a5dc7[_0x6cb6('0xc1')]['ids'],_[_0x6cb6('0xf7')](_0x4a5dc7['body'],[_0x6cb6('0xf8'),'id'])||{});}})[_0x6cb6('0x42')](respondWithResult(_0x1d11d9,null))[_0x6cb6('0x2c')](handleError(_0x1d11d9,null));};exports['getMessages']=function(_0x34a054,_0x1da669,_0xee465b){var _0x5bb913={'raw':![],'where':{}};var _0x19dea2={};var _0x55da98={'count':0x0,'rows':[]};return db[_0x6cb6('0x43')][_0x6cb6('0xd0')]({'where':{'id':_0x34a054[_0x6cb6('0xbc')]['id']}})[_0x6cb6('0x42')](handleEntityNotFound(_0x1da669,null))[_0x6cb6('0x42')](function(_0x395b4d){if(_0x395b4d){_0x19dea2[_0x6cb6('0x46')]=_['keys'](db['ChatMessage'][_0x6cb6('0xf9')]);_0x19dea2[_0x6cb6('0x48')]=_[_0x6cb6('0x47')](_0x34a054[_0x6cb6('0x48')]);_0x19dea2[_0x6cb6('0x51')]=_[_0x6cb6('0x49')](_0x19dea2['model'],_0x19dea2[_0x6cb6('0x48')]);_0x5bb913['attributes']=_[_0x6cb6('0x49')](_0x19dea2['model'],qs['fields'](_0x34a054['query'][_0x6cb6('0x4a')]));_0x5bb913[_0x6cb6('0x4b')]=_0x5bb913[_0x6cb6('0x4b')][_0x6cb6('0x4c')]?_0x5bb913[_0x6cb6('0x4b')]:_0x19dea2[_0x6cb6('0x46')];if(!_0x34a054[_0x6cb6('0x48')][_0x6cb6('0x4d')](_0x6cb6('0x4e'))){_0x5bb913['limit']=qs[_0x6cb6('0x31')](_0x34a054[_0x6cb6('0x48')][_0x6cb6('0x31')]);_0x5bb913['offset']=qs[_0x6cb6('0x30')](_0x34a054[_0x6cb6('0x48')][_0x6cb6('0x30')]);}_0x5bb913[_0x6cb6('0x4f')]=qs[_0x6cb6('0x50')](_0x34a054[_0x6cb6('0x48')]['sort']);_0x5bb913[_0x6cb6('0x82')]=qs[_0x6cb6('0x51')](_[_0x6cb6('0x52')](_0x34a054[_0x6cb6('0x48')],_0x19dea2[_0x6cb6('0x51')]));_0x5bb913[_0x6cb6('0x82')]['ChatInteractionId']=_0x395b4d['id'];if(_0x34a054[_0x6cb6('0x48')][_0x6cb6('0x8e')]){_0x5bb913['where']=_[_0x6cb6('0xa4')](_0x5bb913['where'],{'$or':_[_0x6cb6('0x3b')](_0x5bb913[_0x6cb6('0x4b')],function(_0x25d1e5){var _0x53c2c6={};_0x53c2c6[_0x25d1e5]={'$like':'%'+_0x34a054[_0x6cb6('0x48')]['filter']+'%'};return _0x53c2c6;})});}if(_0x34a054[_0x6cb6('0x48')][_0x6cb6('0x87')]){var _0x56adba=_0x34a054[_0x6cb6('0x48')][_0x6cb6('0x87')][_0x6cb6('0x3f')](',');var _0x311e0d={};_0x311e0d[_0x56adba[0x0]]={'$gte':moment(_0x56adba[0x1])[_0x6cb6('0xdf')](_0x6cb6('0xfa'))};_0x5bb913[_0x6cb6('0x82')]=_[_0x6cb6('0xa4')](_0x5bb913[_0x6cb6('0x82')],_0x311e0d);}_0x5bb913=_[_0x6cb6('0xa4')]({},_0x5bb913,_0x34a054[_0x6cb6('0xbf')]);return db[_0x6cb6('0xdd')][_0x6cb6('0xa2')]({'where':_0x5bb913[_0x6cb6('0x82')]})[_0x6cb6('0x42')](function(_0x33fd30){_0x55da98['count']=_0x33fd30;if(_0x34a054['query']['includeAll']){_0x5bb913[_0x6cb6('0xbe')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x5bb913);})[_0x6cb6('0x42')](function(_0x16a57a){_0x55da98[_0x6cb6('0xba')]=_0x16a57a;return _0x55da98;});}})['then'](respondWithFilteredResult(_0x1da669,_0x5bb913))['catch'](handleError(_0x1da669,null));};exports[_0x6cb6('0xfb')]=function(_0x242d26,_0x5dc92c,_0x2aa435){var _0x2b2c84={'where':{}},_0x1872a4={},_0x5c0d85={'count':0x0,'rows':[]};return db[_0x6cb6('0x43')][_0x6cb6('0xd0')]({'where':{'id':_0x242d26[_0x6cb6('0xbc')]['id']}})[_0x6cb6('0x42')](handleEntityNotFound(_0x5dc92c,null))[_0x6cb6('0x42')](function(_0x3112a9){if(_0x3112a9){_0x1872a4[_0x6cb6('0x46')]=_[_0x6cb6('0x47')](db[_0x6cb6('0xdd')][_0x6cb6('0xf9')]);_0x1872a4['query']=_[_0x6cb6('0x47')](_0x242d26[_0x6cb6('0x48')]);_0x1872a4[_0x6cb6('0x51')]=_[_0x6cb6('0x49')](_0x1872a4[_0x6cb6('0x46')],_0x1872a4['query']);_0x2b2c84[_0x6cb6('0x4b')]=_['intersection'](_0x1872a4['model'],qs[_0x6cb6('0x4a')](_0x242d26[_0x6cb6('0x48')]['fields']));_0x2b2c84['attributes']=_0x2b2c84[_0x6cb6('0x4b')][_0x6cb6('0x4c')]?_0x2b2c84['attributes']:_0x1872a4['model'];if(!_0x242d26[_0x6cb6('0x48')]['hasOwnProperty'](_0x6cb6('0x4e'))){_0x2b2c84['limit']=qs[_0x6cb6('0x31')](_0x242d26[_0x6cb6('0x48')][_0x6cb6('0x31')]);_0x2b2c84[_0x6cb6('0x30')]=qs[_0x6cb6('0x30')](_0x242d26['query'][_0x6cb6('0x30')]);}_0x2b2c84[_0x6cb6('0x4f')]=qs[_0x6cb6('0x50')](_0x242d26[_0x6cb6('0x48')][_0x6cb6('0x50')]);_0x2b2c84['where']=qs['filters'](_[_0x6cb6('0x52')](_0x242d26[_0x6cb6('0x48')],_0x1872a4[_0x6cb6('0x51')]));_0x2b2c84['where'][_0x6cb6('0xfc')]=_0x3112a9['id'];if(_0x242d26['query'][_0x6cb6('0x8e')]){_0x2b2c84[_0x6cb6('0x82')]=_[_0x6cb6('0xa4')](_0x2b2c84['where'],{'$or':_[_0x6cb6('0x3b')](_0x2b2c84[_0x6cb6('0x4b')],function(_0x36b05f){var _0x37aaeb={};_0x37aaeb[_0x36b05f]={'$like':'%'+_0x242d26[_0x6cb6('0x48')][_0x6cb6('0x8e')]+'%'};return _0x37aaeb;})});}_0x2b2c84[_0x6cb6('0x82')]['secret']=![];if(_0x242d26[_0x6cb6('0x48')]['id']){_0x2b2c84[_0x6cb6('0x82')]['id']={'$gt':_0x242d26[_0x6cb6('0x48')]['id']};}_0x2b2c84=_[_0x6cb6('0xa4')]({},_0x2b2c84,_0x242d26[_0x6cb6('0xbf')]);return db['ChatMessage'][_0x6cb6('0xa2')]({'where':_0x2b2c84[_0x6cb6('0x82')]})['then'](function(_0x25b1d3){_0x5c0d85['count']=_0x25b1d3;_0x2b2c84[_0x6cb6('0xbe')]=[];if(_0x242d26['query']['includeAgent']){_0x2b2c84[_0x6cb6('0xbe')][_0x6cb6('0x41')]({'model':db[_0x6cb6('0x7c')],'as':_0x6cb6('0x7c'),'attributes':['id',_0x6cb6('0x3c'),_0x6cb6('0xe8')]});}if(_0x242d26[_0x6cb6('0x48')][_0x6cb6('0xbd')]){_0x2b2c84['include']=[{'all':!![]}];}return db[_0x6cb6('0xdd')][_0x6cb6('0xfd')](_0x2b2c84);})[_0x6cb6('0x42')](function(_0x180a4c){_0x5c0d85[_0x6cb6('0xba')]=_0x180a4c;return _0x5c0d85;});}})[_0x6cb6('0x42')](respondWithFilteredResult(_0x5dc92c,_0x2b2c84))[_0x6cb6('0x2c')](handleError(_0x5dc92c,null));};exports[_0x6cb6('0xfe')]=function(_0x4df28b,_0x4bcfab,_0x4035f4){return db[_0x6cb6('0x43')][_0x6cb6('0x6a')]({'where':{'id':_0x4df28b['params']['id']}})['then'](handleEntityNotFound(_0x4bcfab,null))['then'](function(_0x411b75){if(_0x411b75){return _0x411b75[_0x6cb6('0xff')](_0x4df28b[_0x6cb6('0xc1')][_0x6cb6('0xf8')],_[_0x6cb6('0xf7')](_0x4df28b[_0x6cb6('0xc1')],[_0x6cb6('0xf8'),'id'])||{})[_0x6cb6('0x100')](function(){return db[_0x6cb6('0x79')][_0x6cb6('0xfd')]({'attributes':['id','name',_0x6cb6('0x55')],'where':{'id':_0x4df28b[_0x6cb6('0xc1')][_0x6cb6('0xf8')]}});})[_0x6cb6('0x42')](function(_0x2babc1){socket[_0x6cb6('0x101')](_0x6cb6('0x102'),{'id':Number(_0x4df28b[_0x6cb6('0xbc')]['id']),'tags':_0x2babc1||[]});return{'id':Number(_0x4df28b[_0x6cb6('0xbc')]['id']),'tags':_0x2babc1||[]};});}})[_0x6cb6('0x42')](respondWithResult(_0x4bcfab,null))[_0x6cb6('0x2c')](handleError(_0x4bcfab,null));};exports[_0x6cb6('0x103')]=function(_0x1294d4,_0x23d75e,_0x5c920b){return db[_0x6cb6('0x43')][_0x6cb6('0x6a')]({'where':{'id':_0x1294d4[_0x6cb6('0xbc')]['id']}})['then'](handleEntityNotFound(_0x23d75e,null))[_0x6cb6('0x42')](function(_0x4a2d46){if(_0x4a2d46){return _0x4a2d46[_0x6cb6('0x103')](_0x1294d4[_0x6cb6('0x48')][_0x6cb6('0xf8')]);}})['then'](respondWithStatusCode(_0x23d75e,null))['catch'](handleError(_0x23d75e,null));};exports[_0x6cb6('0xd4')]=function(_0x1882ef,_0xb640df){var _0x48ed99=moment()['unix']()[_0x6cb6('0xa1')]();var _0x5f1cc7=path[_0x6cb6('0xd8')](config['root'],_0x6cb6('0x104'),'files',_0x6cb6('0x105'));var _0x31eabc=path[_0x6cb6('0xd8')](config[_0x6cb6('0xd5')],_0x6cb6('0x104'),'files',_0x6cb6('0x106'));var _0x5cdaea=path['join'](_0x5f1cc7,_0x48ed99);var _0x4c41dc=util[_0x6cb6('0xdf')]('transcript-%d-%s.zip',_0x1882ef['params']['id'],_0x48ed99);var _0x3e7643=path[_0x6cb6('0xd8')](_0x5f1cc7,_0x4c41dc);var _0x1e8e68=[];_0x1e8e68[_0x6cb6('0x41')]({'model':db[_0x6cb6('0x7c')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x1e8e68[_0x6cb6('0x41')]({'model':db[_0x6cb6('0x107')],'as':_0x6cb6('0x70'),'attributes':['id',_0x6cb6('0x108'),_0x6cb6('0x109')],'raw':!![]});if(_0x1882ef[_0x6cb6('0x48')][_0x6cb6('0x106')]){_0x1e8e68['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x3cad91=[{'model':db[_0x6cb6('0xdd')],'as':_0x6cb6('0xde'),'attributes':['id',_0x6cb6('0xc1'),'createdAt',_0x6cb6('0x10a'),_0x6cb6('0x10b'),_0x6cb6('0x8a')],'include':_0x1e8e68}];_0x3cad91[_0x6cb6('0x41')]({'model':db['ChatWebsite'],'as':_0x6cb6('0x10c'),'attributes':['id',_0x6cb6('0x39')]});_0x3cad91[_0x6cb6('0x41')]({'model':db[_0x6cb6('0x7c')],'as':_0x6cb6('0x10d'),'attributes':['id',_0x6cb6('0x3c')]});return db[_0x6cb6('0x43')]['find']({'where':{'id':_0x1882ef['params']['id']},'include':_0x3cad91})[_0x6cb6('0x42')](handleEntityNotFound(_0xb640df,null))[_0x6cb6('0x42')](function(_0x381401){if(_0x381401){var _0x1803ee=_0x381401['get']({'plain':!![]});fs['mkdirSync'](_0x5cdaea);var _0xc5174a={'format':'A4','border':_0x6cb6('0x10e'),'header':{'height':'40px','contents':{'first':_0x6cb6('0x10f')}},'footer':{'height':_0x6cb6('0x110'),'contents':{'default':util[_0x6cb6('0xdf')]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util[_0x6cb6('0xdf')]('%s\x20#%d','Chat',_0x1803ee['id']),moment()[_0x6cb6('0xdf')](_0x6cb6('0x111'))[_0x6cb6('0xa1')]())}}};var _0x3ab817={'channel':_0x6cb6('0x112'),'account':_0x1803ee['Account'][_0x6cb6('0x39')],'agent':_0x1803ee[_0x6cb6('0x10d')]?_0x1803ee[_0x6cb6('0x10d')][_0x6cb6('0x3c')]:_0x6cb6('0x113'),'createdAt':moment(_0x1803ee[_0x6cb6('0x85')])['format'](_0x6cb6('0xfa'))[_0x6cb6('0xa1')](),'closedAt':_0x1803ee[_0x6cb6('0xc6')]?moment(_0x1803ee['closedAt'])[_0x6cb6('0xdf')](_0x6cb6('0xfa'))[_0x6cb6('0xa1')]():'','disposition':_0x1803ee[_0x6cb6('0xc7')],'chatInfo':{'browser':_0x1803ee[_0x6cb6('0x114')],'os':_0x1803ee['osName'],'referer':_0x1803ee['referer'],'customerIp':_0x1803ee[_0x6cb6('0x115')],'customerPort':_0x1803ee['customerPort']?_0x1803ee[_0x6cb6('0x116')]:'N.A.'},'messages':_(_0x1803ee[_0x6cb6('0xde')])[_0x6cb6('0x117')]()[_0x6cb6('0x8e')]({'secret':![]})[_0x6cb6('0x3b')](function(_0x50b87){if(_0x50b87['Attachment']){var _0x41ac05=path['join'](_0x31eabc,_0x50b87[_0x6cb6('0xce')]['basename']);if(fs[_0x6cb6('0x118')](_0x41ac05)){fs[_0x6cb6('0x119')](_0x41ac05)[_0x6cb6('0x11a')](fs['createWriteStream'](path[_0x6cb6('0xd8')](_0x5cdaea,_0x50b87[_0x6cb6('0xce')][_0x6cb6('0xca')])));}}return{'date':moment(_0x50b87[_0x6cb6('0x85')])[_0x6cb6('0xdf')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6cb6('0xa1')](),'sender':_0x50b87[_0x6cb6('0x10a')]==='out'?_0x50b87[_0x6cb6('0x7c')]?_0x50b87['User']['fullname']:_0x6cb6('0xe2'):_0x50b87['Contact']['firstName']+(_0x50b87['Contact'][_0x6cb6('0x109')]?'\x20'+_0x50b87[_0x6cb6('0x70')][_0x6cb6('0x109')]:''),'body':_0x50b87[_0x6cb6('0xce')]?_0x50b87[_0x6cb6('0xce')]['basename']:_0x50b87[_0x6cb6('0xc1')],'direction':_0x50b87[_0x6cb6('0x10a')]===_0x6cb6('0x11b')?'A':'C','secret':_0x50b87[_0x6cb6('0x10b')],'read':_0x50b87[_0x6cb6('0x8a')],'attachment':_0x50b87[_0x6cb6('0xce')]};})['value']()};return ejs['renderFile'](path[_0x6cb6('0xd8')](config[_0x6cb6('0xd5')],_0x6cb6('0x104'),_0x6cb6('0x11c'),'downloadInteraction.html'),{'interaction':_0x3ab817})[_0x6cb6('0x42')](function(_0x5ac2a2){return new BPromise(function(_0xfe645,_0x5cac61){pdf[_0x6cb6('0xc0')](_0x5ac2a2,_0xc5174a)[_0x6cb6('0x11d')](path[_0x6cb6('0xd8')](_0x5cdaea,_0x6cb6('0x11e')+_0x1803ee['id']+'-'+_0x48ed99+'.pdf'),function(_0x4ee194,_0x57e393){if(_0x4ee194)return _0x5cac61(_0x4ee194);_0xfe645(_0x57e393);});});})[_0x6cb6('0x42')](function(){return new BPromise(function(_0x6c3240,_0x36fa46){zipdir(_0x5cdaea,{'saveTo':_0x3e7643},function(_0x3aae8c,_0x4535f4){if(_0x3aae8c)return _0x36fa46(_0x3aae8c);return _0x6c3240(_0x4535f4);});})[_0x6cb6('0x42')](function(){return new BPromise(function(_0x23a5e7,_0xb77f7e){rimraf(_0x5cdaea,function(_0x44c414){if(_0x44c414)_0xb77f7e(_0x44c414);return _0x23a5e7();});});})[_0x6cb6('0x42')](function(){return _0xb640df[_0x6cb6('0xd4')](_0x3e7643,_0x4c41dc,function(_0x4313fe){if(_0x4313fe){console[_0x6cb6('0x11f')](_0x6cb6('0x120'),_0x4313fe);}else{fs['unlinkSync'](_0x3e7643);}});});});}else{return _0xb640df[_0x6cb6('0x2d')](0xc8);}})['catch'](handleError(_0xb640df,null));}; \ No newline at end of file +var _0x5075=['Contact.fax','Owner.fullname','Owner.internal','ChatInteractionId','all','rows','show','rawAttributes','includeAll','include','options','create','update','params','describe','customUpdate','abandon','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','basename','mimetype','Attachment','findOne','attachId','download','root','server/files/attachments/','close','mailTranscript','join','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','ChatWebsite','format','agentAlias','System','customer','%s%d','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','sort','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','setTags','spread','emit','removeTags','unix','server','files','tmp','attachments','CmContact','lastName','direction','Account','get','mkdirSync','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Chat','Owner','N.A.','closedAt','osName','customerPort','tail','createReadStream','createWriteStream','out','firstName','downloadInteraction.html','toFile','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','stack','name','send','fullname','TagIds','Tags','split','forEach','push','index','map','ChatInteraction','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','t.id\x20=\x20it.TagId','expr','search','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)','ContactId','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','body','compact','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax'];(function(_0x5b3995,_0x1f0bdd){var _0x2e6750=function(_0x44dcbf){while(--_0x44dcbf){_0x5b3995['push'](_0x5b3995['shift']());}};_0x2e6750(++_0x1f0bdd);}(_0x5075,0x73));var _0x5507=function(_0x233dc0,_0x2866ad){_0x233dc0=_0x233dc0-0x0;var _0x1fc160=_0x5075[_0x233dc0];return _0x1fc160;};'use strict';var pdf=require(_0x5507('0x0'));var emlformat=require(_0x5507('0x1'));var rimraf=require(_0x5507('0x2'));var zipdir=require(_0x5507('0x3'));var jsonpatch=require(_0x5507('0x4'));var rp=require(_0x5507('0x5'));var moment=require(_0x5507('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5507('0x7'));var util=require(_0x5507('0x8'));var path=require(_0x5507('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5507('0xa'));var fs=require('fs');var _=require(_0x5507('0xb'));var squel=require('squel');var crypto=require(_0x5507('0xc'));var jsforce=require(_0x5507('0xd'));var deskjs=require(_0x5507('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5507('0xf'));var Redis=require(_0x5507('0x10'));var authService=require(_0x5507('0x11'));var qs=require(_0x5507('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5507('0x13'));var logger=require(_0x5507('0x14'))('api');var utils=require(_0x5507('0x15'));var config=require(_0x5507('0x16'));var db=require('../../mysqldb')['db'];config[_0x5507('0x17')]=_[_0x5507('0x18')](config[_0x5507('0x17')],{'host':_0x5507('0x19'),'port':0x18eb});var socket=require(_0x5507('0x1a'))(new Redis(config[_0x5507('0x17')]));require('./chatInteraction.socket')[_0x5507('0x1b')](socket);var jayson=require(_0x5507('0x1c'));var client=jayson[_0x5507('0x1d')][_0x5507('0x1e')]({'port':0x232b});var client9004=jayson['client'][_0x5507('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x10d7b9,_0x2dfd06,_0x1ab167){if(_0x1ab167){var _0xa6e4b3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa6e4b3[_0x5507('0x1f')](_0x2dfd06)){return _0x10d7b9;}else{throw new db[(_0x5507('0x20'))][(_0x5507('0x21'))](_0x5507('0x22'));}}else{return _0x10d7b9;}}function respondWithRpcPromise(_0x2f0c7d,_0x233b6a,_0x2260f7,_0x3822dd){return new BPromise(function(_0x5ad6d7,_0x14dab0){var _0x276a81=_0x3822dd||client;return _0x276a81[_0x5507('0x23')](_0x2f0c7d,_0x2260f7)[_0x5507('0x24')](function(_0x54f473){logger[_0x5507('0x25')](_0x5507('0x26'),_0x233b6a,_0x5507('0x27'));logger[_0x5507('0x28')](_0x5507('0x29'),_0x233b6a,_0x5507('0x27'),JSON['stringify'](_0x54f473));if(_0x54f473[_0x5507('0x2a')]){if(_0x54f473[_0x5507('0x2a')][_0x5507('0x2b')]===0x1f4){logger[_0x5507('0x2a')](_0x5507('0x26'),_0x233b6a,_0x54f473[_0x5507('0x2a')][_0x5507('0x2c')]);return _0x14dab0(_0x54f473[_0x5507('0x2a')][_0x5507('0x2c')]);}logger[_0x5507('0x2a')](_0x5507('0x26'),_0x233b6a,_0x54f473[_0x5507('0x2a')][_0x5507('0x2c')]);return _0x5ad6d7(_0x54f473[_0x5507('0x2a')][_0x5507('0x2c')]);}else{logger['info'](_0x5507('0x26'),_0x233b6a,'request\x20sent');_0x5ad6d7(_0x54f473[_0x5507('0x2d')]['message']);}})[_0x5507('0x2e')](function(_0x24668b){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x233b6a,_0x24668b);_0x14dab0(_0x24668b);});});}function respondWithStatusCode(_0xbe8d32,_0x1a18d0){_0x1a18d0=_0x1a18d0||0xcc;return function(_0x5912d4){if(_0x5912d4){return _0xbe8d32[_0x5507('0x2f')](_0x1a18d0);}return _0xbe8d32[_0x5507('0x30')](_0x1a18d0)[_0x5507('0x31')]();};}function respondWithResult(_0x38f4d9,_0x1e5ce6){_0x1e5ce6=_0x1e5ce6||0xc8;return function(_0x14fdea){if(_0x14fdea){return _0x38f4d9['status'](_0x1e5ce6)[_0x5507('0x32')](_0x14fdea);}};}function respondWithFilteredResult(_0x9c1468,_0x106b11){return function(_0x38f0f5){if(_0x38f0f5){var _0x29dd58=_0x38f0f5[_0x5507('0x33')],_0x495bbe=_0x106b11[_0x5507('0x34')],_0x51e692=_0x106b11[_0x5507('0x34')]+_0x106b11['limit'],_0x3b09be;if(_0x51e692>=_0x29dd58){_0x51e692=_0x29dd58;_0x3b09be=0xc8;}else{_0x3b09be=0xce;}_0x9c1468[_0x5507('0x30')](_0x3b09be);return _0x9c1468[_0x5507('0x35')](_0x5507('0x36'),_0x495bbe+'-'+_0x51e692+'/'+_0x29dd58)[_0x5507('0x32')](_0x38f0f5);}return null;};}function patchUpdates(_0x3cf04d){return function(_0x2074a){try{jsonpatch[_0x5507('0x37')](_0x2074a,_0x3cf04d,!![]);}catch(_0x27c8c8){return BPromise['reject'](_0x27c8c8);}return _0x2074a[_0x5507('0x38')]();};}function saveUpdates(_0x423426,_0x1b69f3){return function(_0x51ca35){if(_0x51ca35){return _0x51ca35['update'](_0x423426)[_0x5507('0x24')](function(_0xf5aa07){return _0xf5aa07;});}return null;};}function removeEntity(_0x3297bc,_0x17d01c){return function(_0x143d97){if(_0x143d97){return _0x143d97['destroy']()['then'](function(){_0x3297bc[_0x5507('0x30')](0xcc)[_0x5507('0x31')]();});}};}function handleEntityNotFound(_0x3a452d,_0x1b9115){return function(_0x5dcd57){if(!_0x5dcd57){_0x3a452d['sendStatus'](0x194);}return _0x5dcd57;};}function handleError(_0x23ea7c,_0x5a5b67){_0x5a5b67=_0x5a5b67||0x1f4;return function(_0x304daf){logger[_0x5507('0x2a')](_0x304daf[_0x5507('0x39')]);if(_0x304daf[_0x5507('0x3a')]){delete _0x304daf[_0x5507('0x3a')];}_0x23ea7c[_0x5507('0x30')](_0x5a5b67)[_0x5507('0x3b')](_0x304daf);};}function getInteractionUsers(_0x2b962d,_0x44502c){return new BPromise(function(_0x453c21,_0x59db9b){try{if(_0x44502c[_0x2b962d['id']]){_0x2b962d['Users']=_['map'](_0x44502c[_0x2b962d['id']],function(_0x570eee){return{'id':_0x570eee['id'],'fullname':_0x570eee[_0x5507('0x3c')]};});}}catch(_0x2cf512){_0x59db9b(_0x2cf512);}_0x453c21(_0x2b962d);});}function getInteractionTags(_0x2c2bad,_0x854262){return new BPromise(function(_0x2b32a5,_0x210991){try{if(_0x2c2bad[_0x5507('0x3d')]){_0x2c2bad[_0x5507('0x3e')]=[];_0x2c2bad[_0x5507('0x3d')][_0x5507('0x3f')](',')[_0x5507('0x40')](function(_0x2e2307){_0x2c2bad[_0x5507('0x3e')][_0x5507('0x41')](_0x854262[_0x2e2307]);});}delete _0x2c2bad['TagIds'];}catch(_0x53b3f3){_0x210991(_0x53b3f3);}_0x2b32a5(_0x2c2bad);});}function updateChatInteraction(_0x50eb32,_0x33f7f7,_0x41283f){return new BPromise(function(_0x417022,_0x245b0a){return getInteractionUsers(_0x50eb32,_0x41283f)[_0x5507('0x24')](function(_0x17d7db){return getInteractionTags(_0x17d7db,_0x33f7f7);})[_0x5507('0x24')](function(_0x371136){_0x417022(_0x371136);})[_0x5507('0x2e')](function(_0x436c44){_0x245b0a(_0x436c44);});});}exports[_0x5507('0x42')]=function(_0x192a00,_0x24d7b5){var _0x25496b={},_0x1b3006={},_0x8bad16={'count':0x0,'rows':[]};var _0x129396=_[_0x5507('0x43')](db[_0x5507('0x44')]['rawAttributes'],function(_0x21f162){return{'name':_0x21f162[_0x5507('0x45')],'type':_0x21f162['type']['key']};});_0x1b3006[_0x5507('0x46')]=_[_0x5507('0x43')](_0x129396,_0x5507('0x3a'));_0x1b3006[_0x5507('0x47')]=_[_0x5507('0x48')](_0x192a00['query']);_0x1b3006[_0x5507('0x49')]=_[_0x5507('0x4a')](_0x1b3006[_0x5507('0x46')],_0x1b3006['query']);_0x25496b[_0x5507('0x4b')]=_[_0x5507('0x4a')](_0x1b3006[_0x5507('0x46')],qs[_0x5507('0x4c')](_0x192a00[_0x5507('0x47')]['fields']));_0x25496b[_0x5507('0x4b')]=_0x25496b['attributes'][_0x5507('0x4d')]?_0x25496b[_0x5507('0x4b')]:_0x1b3006[_0x5507('0x46')];if(!_0x192a00[_0x5507('0x47')][_0x5507('0x4e')](_0x5507('0x4f'))){_0x25496b[_0x5507('0x50')]=qs[_0x5507('0x50')](_0x192a00['query'][_0x5507('0x50')]);_0x25496b[_0x5507('0x34')]=qs['offset'](_0x192a00['query']['offset']);}_0x25496b[_0x5507('0x51')]=qs['sort'](_0x192a00[_0x5507('0x47')]['sort']);_0x25496b[_0x5507('0x52')]=qs['filters'](_['pick'](_0x192a00[_0x5507('0x47')],_0x1b3006[_0x5507('0x49')]));var _0x192b4a=[];var _0x32ecad=squel[_0x5507('0x53')]()[_0x5507('0x54')]('id')['field'](_0x5507('0x3a'))[_0x5507('0x54')](_0x5507('0x55'))['from'](_0x5507('0x56'));var _0xe4b14c=squel[_0x5507('0x53')]()[_0x5507('0x54')](_0x5507('0x57'))[_0x5507('0x54')](_0x5507('0x58'))[_0x5507('0x54')](_0x5507('0x59'))[_0x5507('0x5a')](_0x5507('0x5b'),'ui')['left_join']('users','u',_0x5507('0x5c'));var _0x5d7753=squel[_0x5507('0x53')]()[_0x5507('0x5a')](_0x5507('0x5d'),'i')[_0x5507('0x5e')](_0x5507('0x5f'),'c',_0x5507('0x60'))[_0x5507('0x5e')](_0x5507('0x61'),'o',_0x5507('0x62'))[_0x5507('0x5e')](_0x5507('0x63'),'a',_0x5507('0x64'))[_0x5507('0x5e')](_0x5507('0x65'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x5507('0x5e')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')[_0x5507('0x5e')](_0x5507('0x56'),'t',_0x5507('0x66'));var _0x3ba05c=squel['expr']();var _0x2d4f18=[];var _0x2f41a9=squel[_0x5507('0x67')]();var _0x34276a;if(_0x192a00[_0x5507('0x47')][_0x5507('0x68')]){_0x34276a=as['parseSearch'](_0x192a00[_0x5507('0x47')][_0x5507('0x68')]);var _0x3a2f9f=_0x34276a['sqlOperator'];for(var _0x5ac5d7=0x0;_0x5ac5d7<_0x34276a[_0x5507('0x69')]['length'];_0x5ac5d7++){var _0x208fc4=_0x34276a[_0x5507('0x69')][_0x5ac5d7];var _0x5cd12e='i';var _0x3e796d=_[_0x5507('0x6a')](_0x129396,[_0x5507('0x3a'),_0x208fc4[_0x5507('0x54')]]);if(!_0x3e796d){switch(_0x208fc4[_0x5507('0x54')]){case _0x5507('0x6b'):if(_0x208fc4[_0x5507('0x6c')]==0x1){_0x5d7753[_0x5507('0x6d')]('`'+_0x208fc4[_0x5507('0x54')]+_0x5507('0x6e'));}else{_0x5d7753[_0x5507('0x6d')]('`'+_0x208fc4[_0x5507('0x54')]+'`\x20>\x200');}break;case _0x5507('0x6f'):if(_0x208fc4[_0x5507('0x70')]===_0x5507('0x71')){if(_0x208fc4[_0x5507('0x6c')][_0x5507('0x3f')]('\x20')['length']>0x1){_0x3ba05c[_0x3a2f9f](_0x5507('0x72'),qs['getFullTextValue'](_0x208fc4[_0x5507('0x6c')]),null);}else{var _0xae8662='%'+_0x208fc4[_0x5507('0x6c')]+'%';_0x3ba05c[_0x3a2f9f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xae8662,_0xae8662,_0xae8662);}}else{_0x3e796d=_[_0x5507('0x6a')](_0x129396,[_0x5507('0x3a'),_0x5507('0x73')]);_0x208fc4['field']=_0x5507('0x73');_0x1812d7=as['buildExpression'](_0x5cd12e,_0x3e796d[_0x5507('0x74')],_0x208fc4);_0x3ba05c[_0x3a2f9f](_0x1812d7['text'],_0x1812d7['value'][_0x5507('0x75')],_0x1812d7[_0x5507('0x6c')][_0x5507('0x31')]);}break;case _0x5507('0x76'):var _0x2d7729=_0x208fc4[_0x5507('0x6c')]['split'](',')['map'](function(_0x3a88fb){return Number(_0x3a88fb);});_0x2d7729[_0x5507('0x40')](function(_0x14c884){_0x2f41a9['or'](_0x5507('0x77'),'%,'+_0x14c884+',%');});_0x2d4f18=_['union'](_0x2d4f18,_0x2d7729);break;case _0x5507('0x78'):if(_0x208fc4[_0x5507('0x70')]===_0x5507('0x71')){_0x3ba05c[_0x3a2f9f](_0x5507('0x79'),'%'+_0x208fc4[_0x5507('0x6c')]+'%',null);}else{_0x3e796d=_[_0x5507('0x6a')](_0x129396,[_0x5507('0x3a'),'UserId']);_0x208fc4[_0x5507('0x54')]=_0x5507('0x7a');_0x1812d7=as[_0x5507('0x7b')](_0x5cd12e,_0x3e796d['type'],_0x208fc4);_0x3ba05c[_0x3a2f9f](_0x1812d7[_0x5507('0x7c')],_0x1812d7['value']['start'],_0x1812d7['value'][_0x5507('0x31')]);}break;case _0x5507('0x7d'):_0x1812d7=as[_0x5507('0x7b')]('me',null,_0x208fc4);_0x3ba05c[_0x3a2f9f](_0x1812d7[_0x5507('0x7c')],_0x1812d7[_0x5507('0x6c')][_0x5507('0x75')],_0x1812d7[_0x5507('0x6c')]['end']);break;}}else{var _0x1812d7=as['buildExpression'](_0x5cd12e,_0x3e796d[_0x5507('0x74')],_0x208fc4);_0x3ba05c[_0x3a2f9f](_0x1812d7[_0x5507('0x7c')],_0x1812d7[_0x5507('0x6c')][_0x5507('0x75')],_0x1812d7[_0x5507('0x6c')][_0x5507('0x31')]);}}}else{var _0x4423a8=_(_0x192a00[_0x5507('0x47')])[_0x5507('0x48')]()[_0x5507('0x43')](function(_0x259a87){return _['some'](_0x129396,[_0x5507('0x3a'),_0x259a87])?_0x259a87:undefined;})[_0x5507('0x7e')]()[_0x5507('0x6c')]();if(!_['isEmpty'](_0x4423a8)){_0x4423a8[_0x5507('0x40')](function(_0x2f67d6){if(_0x2f67d6==='ChatWebsiteId'){_0x5d7753[_0x5507('0x52')]('i.ChatWebsiteId\x20IN\x20?',[]['concat'](_0x192a00[_0x5507('0x47')][_0x2f67d6]));}else if(_0x2f67d6==='createdAt'){var _0xb92deb=JSON[_0x5507('0x7f')](_0x192a00[_0x5507('0x47')][_0x2f67d6])[_0x5507('0x80')];var _0xbb4353=JSON[_0x5507('0x7f')](_0x192a00['query'][_0x2f67d6])[_0x5507('0x81')];_0x5d7753[_0x5507('0x52')](_0x5507('0x82'),_0xb92deb,_0xbb4353);}else{if(_0x192a00[_0x5507('0x47')][_0x2f67d6]===_0x5507('0x83')){_0x5d7753[_0x5507('0x52')]('i.'+_0x2f67d6+_0x5507('0x84'));}else{_0x5d7753[_0x5507('0x52')]('i.'+_0x2f67d6+_0x5507('0x85'),_0x192a00[_0x5507('0x47')][_0x2f67d6]);}}});}if(_0x192a00[_0x5507('0x47')][_0x5507('0x86')]){if(_0x192a00['query'][_0x5507('0x86')]==0x1){_0x5d7753[_0x5507('0x6d')](_0x5507('0x87'));}else{_0x5d7753[_0x5507('0x6d')](_0x5507('0x88'));}}if(_0x192a00[_0x5507('0x47')]['tag']){_0x2d4f18=_[_0x5507('0x89')](_0x192a00['query'][_0x5507('0x8a')])?_0x192a00['query']['tag']:new Array(_0x192a00[_0x5507('0x47')][_0x5507('0x8a')]);_0x2d4f18[_0x5507('0x40')](function(_0x363213){_0x2f41a9['or'](_0x5507('0x77'),'%,'+_0x363213+',%');});}if(_0x192a00['query'][_0x5507('0x8b')]){var _0x53fd44=_0x192a00[_0x5507('0x47')][_0x5507('0x8b')][_0x5507('0x8c')]('\x5c','\x5c\x5c')[_0x5507('0x8c')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x5507('0x8d')](_0x53fd44)){_0x3ba05c['or'](_0x5507('0x8e'),_0x53fd44+'%');}else{_0x3ba05c['or'](_0x5507('0x8f'),qs['getFullTextValue'](_0x53fd44))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x53fd44+'%');}}}_0x5d7753[_0x5507('0x52')](_0x3ba05c);_0x5d7753[_0x5507('0x90')](_0x5507('0x91'));var _0x38a45f={'type':db[_0x5507('0x20')][_0x5507('0x92')][_0x5507('0x93')],'raw':!![]};var _0x10b62e=_0x5d7753[_0x5507('0x94')]();_0x10b62e[_0x5507('0x54')](_0x5507('0x91'));_0x10b62e[_0x5507('0x54')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5507('0x6b'));if(_0x25496b[_0x5507('0x51')]){_0x25496b[_0x5507('0x51')][_0x5507('0x40')](function(_0x335b52){_0x5d7753[_0x5507('0x51')]('i.'+_0x335b52[0x0],_0x335b52[0x1]===_0x5507('0x95')?![]:!![]);});}if(!_['isEmpty'](_0x2d4f18)){_0x5d7753[_0x5507('0x6d')](_0x2f41a9);_0x10b62e[_0x5507('0x52')](_0x5507('0x96'),_0x2d4f18);}BPromise[_0x5507('0x97')]()['then'](function(){if(!_0x34276a){if(_0x192a00[_0x5507('0x47')][_0x5507('0x98')]||_0x192a00[_0x5507('0x47')][_0x5507('0x99')])return;_0x10b62e[_0x5507('0x52')](_0x5507('0x9a'));_0x5d7753[_0x5507('0x52')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}return _0x192a00[_0x5507('0x9b')][_0x5507('0x9c')]({'attributes':['id'],'raw':!![]})[_0x5507('0x24')](function(_0x2facc9){if(_[_0x5507('0x9d')](_0x2facc9)){_0x10b62e['where'](_0x5507('0x9e'));_0x5d7753[_0x5507('0x52')](_0x5507('0x9e'));}else{_0x10b62e[_0x5507('0x52')](_0x5507('0x9f'),_[_0x5507('0x43')](_0x2facc9,'id'));_0x5d7753[_0x5507('0x52')](_0x5507('0x9f'),_[_0x5507('0x43')](_0x2facc9,'id'));}});})[_0x5507('0x24')](function(){db[_0x5507('0xa0')][_0x5507('0x47')](_0x10b62e[_0x5507('0xa1')](),_0x38a45f)['then'](function(_0x47ee77){_0x8bad16['count']=_0x47ee77[_0x5507('0x4d')];if(_0x8bad16[_0x5507('0x33')]===0x0)return[];return db[_0x5507('0xa0')][_0x5507('0x47')](_0x32ecad[_0x5507('0xa1')](),_0x38a45f)['then'](function(_0x2339c7){_0x192b4a=_[_0x5507('0xa2')](_0x2339c7,'id');_0x38a45f=_[_0x5507('0xa3')](_0x38a45f,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x192a00[_0x5507('0x47')]['fields']){_0x25496b['attributes'][_0x5507('0x40')](function(_0x58b56c){_0x5d7753[_0x5507('0x54')]('i.'+_0x58b56c);});}else{_0x5d7753['field'](_0x5507('0xa4'),_0x5507('0x6b'));_0x5d7753[_0x5507('0x54')]('a.key','Account.key');_0x5d7753[_0x5507('0x54')](_0x5507('0xa5'),_0x5507('0xa6'));_0x5d7753['field'](_0x5507('0xa7'));_0x5d7753[_0x5507('0x54')](_0x5507('0xa8'),_0x5507('0xa9'));_0x5d7753['field']('c.lastName',_0x5507('0xaa'));_0x5d7753[_0x5507('0x54')]('c.email',_0x5507('0xab'));_0x5d7753[_0x5507('0x54')](_0x5507('0xac'),_0x5507('0xad'));_0x5d7753['field'](_0x5507('0xae'),_0x5507('0xaf'));_0x5d7753['field'](_0x5507('0xb0'),_0x5507('0xb1'));_0x5d7753[_0x5507('0x54')]('o.fullname',_0x5507('0xb2'));_0x5d7753[_0x5507('0x54')]('o.internal',_0x5507('0xb3'));_0x5d7753[_0x5507('0x54')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5507('0x3d'));}_0x5d7753[_0x5507('0x50')](_0x25496b[_0x5507('0x50')]);_0x5d7753['offset'](_0x25496b[_0x5507('0x34')]);return db[_0x5507('0xa0')][_0x5507('0x47')](_0x5d7753[_0x5507('0xa1')](),_0x38a45f);})[_0x5507('0x24')](function(_0x462af2){_0xe4b14c[_0x5507('0x52')]('ui.ChatInteractionId\x20IN\x20?',_[_0x5507('0x43')](_0x462af2,'id'));return db[_0x5507('0xa0')][_0x5507('0x47')](_0xe4b14c[_0x5507('0xa1')](),_0x38a45f)['then'](function(_0x5bfea5){var _0x23f6df=_['groupBy'](_0x5bfea5,_0x5507('0xb4'));var _0x204058=[];_0x462af2[_0x5507('0x40')](function(_0x4b3bb8){_0x204058[_0x5507('0x41')](updateChatInteraction(_0x4b3bb8,_0x192b4a,_0x23f6df));});return BPromise[_0x5507('0xb5')](_0x204058);});});})['then'](function(_0x2fbcf9){_0x8bad16[_0x5507('0xb6')]=_0x2fbcf9;return _0x8bad16;})[_0x5507('0x24')](respondWithFilteredResult(_0x24d7b5,_0x25496b));})[_0x5507('0x2e')](handleError(_0x24d7b5,null));};exports[_0x5507('0xb7')]=function(_0x3daaca,_0x4cebba){var _0x24e3d4={'raw':![],'where':{'id':_0x3daaca['params']['id']}},_0xcb8b32={};_0xcb8b32[_0x5507('0x46')]=_[_0x5507('0x48')](db[_0x5507('0x44')][_0x5507('0xb8')]);_0xcb8b32[_0x5507('0x47')]=_[_0x5507('0x48')](_0x3daaca[_0x5507('0x47')]);_0xcb8b32[_0x5507('0x49')]=_[_0x5507('0x4a')](_0xcb8b32[_0x5507('0x46')],_0xcb8b32[_0x5507('0x47')]);_0x24e3d4['attributes']=_[_0x5507('0x4a')](_0xcb8b32['model'],qs[_0x5507('0x4c')](_0x3daaca[_0x5507('0x47')][_0x5507('0x4c')]));_0x24e3d4[_0x5507('0x4b')]=_0x24e3d4[_0x5507('0x4b')][_0x5507('0x4d')]?_0x24e3d4[_0x5507('0x4b')]:_0xcb8b32[_0x5507('0x46')];if(_0x3daaca[_0x5507('0x47')][_0x5507('0xb9')]){_0x24e3d4[_0x5507('0xba')]=[{'all':!![]}];}_0x24e3d4=_[_0x5507('0xa3')]({},_0x24e3d4,_0x3daaca[_0x5507('0xbb')]);return db[_0x5507('0x44')]['find'](_0x24e3d4)[_0x5507('0x24')](handleEntityNotFound(_0x4cebba,null))[_0x5507('0x24')](respondWithResult(_0x4cebba,null))[_0x5507('0x2e')](handleError(_0x4cebba,null));};exports[_0x5507('0xbc')]=function(_0x91d70d,_0x384b3a){return db[_0x5507('0x44')][_0x5507('0xbc')](_0x91d70d[_0x5507('0x7d')],{})[_0x5507('0x24')](respondWithResult(_0x384b3a,0xc9))[_0x5507('0x2e')](handleError(_0x384b3a,null));};exports[_0x5507('0xbd')]=function(_0x3d6e06,_0x37bf7b){if(_0x3d6e06[_0x5507('0x7d')]['id']){delete _0x3d6e06[_0x5507('0x7d')]['id'];}return db[_0x5507('0x44')][_0x5507('0x6a')]({'where':{'id':_0x3d6e06[_0x5507('0xbe')]['id']}})[_0x5507('0x24')](handleEntityNotFound(_0x37bf7b,null))['then'](saveUpdates(_0x3d6e06['body'],null))[_0x5507('0x24')](respondWithResult(_0x37bf7b,null))['catch'](handleError(_0x37bf7b,null));};exports['destroy']=function(_0x110efb,_0x234f51){return db[_0x5507('0x44')][_0x5507('0x6a')]({'where':{'id':_0x110efb[_0x5507('0xbe')]['id']}})['then'](handleEntityNotFound(_0x234f51,null))['then'](removeEntity(_0x234f51,null))[_0x5507('0x2e')](handleError(_0x234f51,null));};exports[_0x5507('0xbf')]=function(_0x4c594a,_0xc329ec){return db[_0x5507('0x44')][_0x5507('0xbf')]()[_0x5507('0x24')](respondWithResult(_0xc329ec,null))[_0x5507('0x2e')](handleError(_0xc329ec,null));};exports[_0x5507('0xc0')]=function(_0x44f613,_0x188152){if(_0x44f613[_0x5507('0x7d')]['id']){delete _0x44f613[_0x5507('0x7d')]['id'];}return db[_0x5507('0x44')][_0x5507('0x6a')]({'where':{'id':_0x44f613[_0x5507('0xbe')]['id']}})[_0x5507('0x24')](handleEntityNotFound(_0x188152,null))['then'](saveUpdates(_0x44f613[_0x5507('0x7d')],null))[_0x5507('0x24')](respondWithResult(_0x188152,null))[_0x5507('0x2e')](handleError(_0x188152,null));};exports[_0x5507('0xc1')]=function(_0x2cfdef,_0x59bd7e,_0x209612){if(_0x2cfdef[_0x5507('0x7d')]['id']){delete _0x2cfdef[_0x5507('0x7d')]['id'];}return db[_0x5507('0x44')][_0x5507('0x6a')]({'where':{'id':_0x2cfdef[_0x5507('0xbe')]['id']}})['then'](function(_0x169c6a){if(!_0x169c6a){logger[_0x5507('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x5507('0xc1'),0x194,'entity\x20not\x20found');_0x59bd7e[_0x5507('0x2f')](0x194);}else{if(_0x169c6a[_0x5507('0x7a')]){throw new db[(_0x5507('0x20'))]['ValidationError'](_0x5507('0xc2'));}}return _0x169c6a;})[_0x5507('0x24')](function(_0xb236f0){if(_0xb236f0){return _0xb236f0[_0x5507('0xbd')]({'closed':_0x2cfdef[_0x5507('0x7d')][_0x5507('0xc3')],'disposition':_0x2cfdef[_0x5507('0x7d')]['disposition']})[_0x5507('0x24')](function(_0x31dfbc){return _0x31dfbc;});}})[_0x5507('0x24')](function(_0x273a40){return respondWithRpcPromise(_0x5507('0xc4'),_0x5507('0xc1'),_0x2cfdef[_0x5507('0x7d')],client9004);})['then'](respondWithResult(_0x59bd7e,null))[_0x5507('0x2e')](handleError(_0x59bd7e,null));};exports[_0x5507('0xc5')]=function(_0x33a0cd,_0x418626,_0x1f2841){_0x33a0cd[_0x5507('0x7d')][_0x5507('0x3a')]=_0x33a0cd[_0x5507('0xc6')]['originalname'];_0x33a0cd[_0x5507('0x7d')][_0x5507('0xc7')]=_0x33a0cd['file']['filename'];_0x33a0cd[_0x5507('0x7d')]['type']=_0x33a0cd[_0x5507('0xc6')][_0x5507('0xc8')];return db[_0x5507('0xc9')][_0x5507('0xbc')](_0x33a0cd[_0x5507('0x7d')])[_0x5507('0x24')](respondWithResult(_0x418626,0xc9))['catch'](handleError(_0x418626,null));};exports['attachmentDownload']=function(_0x168e09,_0x276234,_0x335aa2){return db['ChatInteraction'][_0x5507('0xca')]({'where':{'id':_0x168e09[_0x5507('0xbe')]['id']},'raw':!![]})[_0x5507('0x24')](handleEntityNotFound(_0x276234,null))[_0x5507('0x24')](function(_0x19053f){if(_0x19053f){if(_0x19053f[_0x5507('0xc3')]){return _0x276234[_0x5507('0x30')](0x193)[_0x5507('0x32')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x5507('0xca')]({'where':{'id':_0x168e09[_0x5507('0x47')][_0x5507('0xcb')]},'raw':!![]})[_0x5507('0x24')](handleEntityNotFound(_0x276234,null));}})[_0x5507('0x24')](function(_0x45f9af){if(_0x45f9af){return _0x276234[_0x5507('0xcc')](path['join'](config[_0x5507('0xcd')],_0x5507('0xce'),_0x45f9af[_0x5507('0xc7')]));}})[_0x5507('0x2e')](handleError(_0x276234,null));};exports[_0x5507('0xcf')]=function(_0x3f9b58,_0x2d1a4b){var _0x2ccf1b=null;var _0x1cd1cd=null;var _0xf9db83=null;var _0x38aa88=null;if(_0x3f9b58[_0x5507('0x7d')]['id']){delete _0x3f9b58['body']['id'];}if(_0x3f9b58['body'][_0x5507('0xd0')]){_0x38aa88=path[_0x5507('0xd1')](config[_0x5507('0xcd')],_0x5507('0xd2'),util['format'](_0x5507('0xd3'),Date[_0x5507('0xd4')]()));_0x3f9b58[_0x5507('0x7d')][_0x5507('0xd5')]=_0x38aa88;}return db[_0x5507('0x44')][_0x5507('0x6a')]({'where':{'id':_0x3f9b58[_0x5507('0xbe')]['id']},'include':[{'model':db[_0x5507('0xd6')],'as':_0x5507('0xd7'),'include':[{'model':db['User'],'as':_0x5507('0x78')}]}]})[_0x5507('0x24')](handleEntityNotFound(_0x2d1a4b,null))[_0x5507('0x24')](saveUpdates(_0x3f9b58[_0x5507('0x7d')],null))['then'](function(_0x2f1d61){if(_0x2f1d61){_0x2ccf1b=_0x2f1d61;return db[_0x5507('0xd8')][_0x5507('0x6a')]({'where':{'id':_0x2ccf1b[_0x5507('0x98')]}});}})[_0x5507('0x24')](function(_0x37a8a8){if(_0x37a8a8){_0xf9db83=_0x37a8a8;return db['CmContact'][_0x5507('0x6a')]({'where':{'id':_0x2ccf1b[_0x5507('0x73')]}});}})[_0x5507('0x24')](function(_0xfd66e5){if(_0xfd66e5){_0x1cd1cd=_0xfd66e5;if(_0x38aa88){var _0x3eda30=null;for(var _0x53ab95=0x1;_0x53ab95<_0x2ccf1b['Messages'][_0x5507('0x4d')];++_0x53ab95){_0x3eda30=_0x2ccf1b['Messages'][_0x53ab95];var _0x381097=_0x3eda30[_0x5507('0x7a')]?util[_0x5507('0xd9')]('%s%d',_0xf9db83[_0x5507('0xda')],_0x3eda30[_0x5507('0x7a')]):_0x5507('0xdb');var _0x41ac51=_0x3f9b58[_0x5507('0x7d')][_0x5507('0xdc')]||util['format'](_0x5507('0xdd'),'Visitor',_0x3eda30[_0x5507('0x73')]);switch(_0xf9db83[_0x5507('0xde')]){case _0x5507('0xdf'):_0x381097=_0x3eda30[_0x5507('0x7a')]?util[_0x5507('0xd9')](_0x5507('0xdd'),_0xf9db83[_0x5507('0xda')],_0x3eda30[_0x5507('0x7a')]):_0x5507('0xdb');break;case _0x5507('0xe0'):_0x381097=_0x3eda30['UserId']?_0x3eda30[_0x5507('0x78')][_0x5507('0xe1')]||_0x3eda30['User'][_0x5507('0x3c')]:_0x5507('0xdb');break;case'agent_fullname':_0x381097=_0x3eda30[_0x5507('0x7a')]?_0x3eda30[_0x5507('0x78')]['fullname']:_0x5507('0xdb');break;default:_0x381097=_0x3eda30[_0x5507('0x7a')]?util['format'](_0x5507('0xdd'),_0xf9db83[_0x5507('0xda')],_0x3eda30[_0x5507('0x7a')]):_0x5507('0xdb');}var _0x172e76=util[_0x5507('0xd9')](_0x5507('0xe2'),moment(_0x3eda30[_0x5507('0xe3')])['format'](_0x5507('0xe4')),_0x3eda30['direction']==='in'?_0x41ac51:_0x381097,_0x3eda30[_0x5507('0x7d')]);if(!_0x3eda30[_0x5507('0xe5')]){fs[_0x5507('0xe6')](_0x38aa88,_0x172e76);}}return db[_0x5507('0xe7')][_0x5507('0xca')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0x5507('0x24')](function(_0x3d9f80){if(_0x3d9f80&&_0x3d9f80[_0x5507('0xe8')]&&_0x3f9b58[_0x5507('0x7d')]){var _0x61cda9={'tls':{'rejectUnauthorized':![]}};if(_0x3d9f80[_0x5507('0xe8')][_0x5507('0xe9')]){_0x61cda9['service']=_0x3d9f80['Smtp'][_0x5507('0xe9')];}else{_0x61cda9[_0x5507('0xea')]=_0x3d9f80['Smtp'][_0x5507('0xea')];_0x61cda9[_0x5507('0xeb')]=_0x3d9f80[_0x5507('0xe8')]['port'];_0x61cda9[_0x5507('0xec')]=_0x3d9f80[_0x5507('0xe8')][_0x5507('0xec')];}if(_0x3d9f80[_0x5507('0xe8')][_0x5507('0xed')]){_0x61cda9[_0x5507('0xee')]={'user':_0x3d9f80[_0x5507('0xe8')][_0x5507('0x9b')],'pass':_0x3d9f80[_0x5507('0xe8')][_0x5507('0xef')]};}return respondWithRpcPromise(_0x5507('0xf0'),_0x5507('0xf1'),{'account':_0x61cda9,'message':{'from':util[_0x5507('0xd9')](_0x5507('0xf2'),_0x3d9f80[_0x5507('0x3a')],_0x3d9f80[_0x5507('0xf3')]||_0x3d9f80[_0x5507('0xe8')][_0x5507('0x9b')]),'to':_0x3f9b58[_0x5507('0x7d')][_0x5507('0xd0')],'subject':_0x5507('0xf4'),'text':util[_0x5507('0xd9')](_0x5507('0xf5'),_0x3f9b58[_0x5507('0x7d')][_0x5507('0xd0')]),'attachments':[{'path':_0x38aa88}]}})[_0x5507('0x24')](function(){return _0x2ccf1b;})['catch'](function(_0x493d6a){console[_0x5507('0x2a')](_0x493d6a);});}else{return _0x2ccf1b;}})[_0x5507('0x24')](respondWithStatusCode(_0x2d1a4b,0xc8))[_0x5507('0x2e')](handleError(_0x2d1a4b,null));};exports['addMessage']=function(_0x329093,_0x1a70ce,_0x2f00b3){return db['ChatMessage'][_0x5507('0x6a')]({'where':{'id':_0x329093['params']['id']}})[_0x5507('0x24')](handleEntityNotFound(_0x1a70ce,null))['then'](function(_0x3a61a8){if(_0x3a61a8){return _0x3a61a8[_0x5507('0xf6')](_0x329093['body'][_0x5507('0xf7')],_['omit'](_0x329093[_0x5507('0x7d')],[_0x5507('0xf7'),'id'])||{});}})[_0x5507('0x24')](respondWithResult(_0x1a70ce,null))[_0x5507('0x2e')](handleError(_0x1a70ce,null));};exports[_0x5507('0xf8')]=function(_0x43dc25,_0x4cda9c,_0x106f44){var _0x4bc6ea={'raw':![],'where':{}};var _0x1f74f4={};var _0x55accb={'count':0x0,'rows':[]};return db[_0x5507('0x44')][_0x5507('0xca')]({'where':{'id':_0x43dc25[_0x5507('0xbe')]['id']}})[_0x5507('0x24')](handleEntityNotFound(_0x4cda9c,null))['then'](function(_0x4af82f){if(_0x4af82f){_0x1f74f4[_0x5507('0x46')]=_[_0x5507('0x48')](db[_0x5507('0xd6')][_0x5507('0xb8')]);_0x1f74f4[_0x5507('0x47')]=_[_0x5507('0x48')](_0x43dc25['query']);_0x1f74f4[_0x5507('0x49')]=_[_0x5507('0x4a')](_0x1f74f4[_0x5507('0x46')],_0x1f74f4['query']);_0x4bc6ea[_0x5507('0x4b')]=_[_0x5507('0x4a')](_0x1f74f4[_0x5507('0x46')],qs[_0x5507('0x4c')](_0x43dc25[_0x5507('0x47')]['fields']));_0x4bc6ea[_0x5507('0x4b')]=_0x4bc6ea[_0x5507('0x4b')][_0x5507('0x4d')]?_0x4bc6ea[_0x5507('0x4b')]:_0x1f74f4[_0x5507('0x46')];if(!_0x43dc25[_0x5507('0x47')][_0x5507('0x4e')](_0x5507('0x4f'))){_0x4bc6ea[_0x5507('0x50')]=qs[_0x5507('0x50')](_0x43dc25[_0x5507('0x47')][_0x5507('0x50')]);_0x4bc6ea[_0x5507('0x34')]=qs[_0x5507('0x34')](_0x43dc25['query'][_0x5507('0x34')]);}_0x4bc6ea['order']=qs['sort'](_0x43dc25[_0x5507('0x47')][_0x5507('0xf9')]);_0x4bc6ea[_0x5507('0x52')]=qs[_0x5507('0x49')](_[_0x5507('0xfa')](_0x43dc25[_0x5507('0x47')],_0x1f74f4['filters']));_0x4bc6ea[_0x5507('0x52')][_0x5507('0xb4')]=_0x4af82f['id'];if(_0x43dc25[_0x5507('0x47')][_0x5507('0x8b')]){_0x4bc6ea['where']=_[_0x5507('0xa3')](_0x4bc6ea[_0x5507('0x52')],{'$or':_[_0x5507('0x43')](_0x4bc6ea['attributes'],function(_0x107ddc){var _0x25096b={};_0x25096b[_0x107ddc]={'$like':'%'+_0x43dc25[_0x5507('0x47')]['filter']+'%'};return _0x25096b;})});}if(_0x43dc25[_0x5507('0x47')][_0x5507('0x80')]){var _0x403cda=_0x43dc25[_0x5507('0x47')][_0x5507('0x80')]['split'](',');var _0x4bec1c={};_0x4bec1c[_0x403cda[0x0]]={'$gte':moment(_0x403cda[0x1])[_0x5507('0xd9')](_0x5507('0xfb'))};_0x4bc6ea[_0x5507('0x52')]=_[_0x5507('0xa3')](_0x4bc6ea[_0x5507('0x52')],_0x4bec1c);}_0x4bc6ea=_[_0x5507('0xa3')]({},_0x4bc6ea,_0x43dc25[_0x5507('0xbb')]);return db[_0x5507('0xd6')][_0x5507('0x33')]({'where':_0x4bc6ea[_0x5507('0x52')]})[_0x5507('0x24')](function(_0x27313f){_0x55accb['count']=_0x27313f;if(_0x43dc25['query'][_0x5507('0xb9')]){_0x4bc6ea['include']=[{'all':!![]}];}return db[_0x5507('0xd6')][_0x5507('0xfc')](_0x4bc6ea);})[_0x5507('0x24')](function(_0x4f6101){_0x55accb[_0x5507('0xb6')]=_0x4f6101;return _0x55accb;});}})[_0x5507('0x24')](respondWithFilteredResult(_0x4cda9c,_0x4bc6ea))[_0x5507('0x2e')](handleError(_0x4cda9c,null));};exports[_0x5507('0xfd')]=function(_0x2427ad,_0x46293e,_0x44e6ca){var _0x58202e={'where':{}},_0x336c48={},_0x5af08c={'count':0x0,'rows':[]};return db[_0x5507('0x44')][_0x5507('0xca')]({'where':{'id':_0x2427ad[_0x5507('0xbe')]['id']}})[_0x5507('0x24')](handleEntityNotFound(_0x46293e,null))[_0x5507('0x24')](function(_0x79be0c){if(_0x79be0c){_0x336c48[_0x5507('0x46')]=_[_0x5507('0x48')](db[_0x5507('0xd6')][_0x5507('0xb8')]);_0x336c48[_0x5507('0x47')]=_[_0x5507('0x48')](_0x2427ad[_0x5507('0x47')]);_0x336c48[_0x5507('0x49')]=_[_0x5507('0x4a')](_0x336c48[_0x5507('0x46')],_0x336c48[_0x5507('0x47')]);_0x58202e[_0x5507('0x4b')]=_[_0x5507('0x4a')](_0x336c48['model'],qs['fields'](_0x2427ad['query']['fields']));_0x58202e['attributes']=_0x58202e['attributes'][_0x5507('0x4d')]?_0x58202e['attributes']:_0x336c48[_0x5507('0x46')];if(!_0x2427ad[_0x5507('0x47')]['hasOwnProperty'](_0x5507('0x4f'))){_0x58202e[_0x5507('0x50')]=qs[_0x5507('0x50')](_0x2427ad[_0x5507('0x47')][_0x5507('0x50')]);_0x58202e[_0x5507('0x34')]=qs['offset'](_0x2427ad[_0x5507('0x47')][_0x5507('0x34')]);}_0x58202e[_0x5507('0x51')]=qs[_0x5507('0xf9')](_0x2427ad['query'][_0x5507('0xf9')]);_0x58202e['where']=qs[_0x5507('0x49')](_['pick'](_0x2427ad[_0x5507('0x47')],_0x336c48[_0x5507('0x49')]));_0x58202e['where'][_0x5507('0xb4')]=_0x79be0c['id'];if(_0x2427ad[_0x5507('0x47')][_0x5507('0x8b')]){_0x58202e[_0x5507('0x52')]=_[_0x5507('0xa3')](_0x58202e['where'],{'$or':_[_0x5507('0x43')](_0x58202e['attributes'],function(_0x2eadea){var _0x58f9a1={};_0x58f9a1[_0x2eadea]={'$like':'%'+_0x2427ad[_0x5507('0x47')][_0x5507('0x8b')]+'%'};return _0x58f9a1;})});}_0x58202e[_0x5507('0x52')][_0x5507('0xe5')]=![];if(_0x2427ad[_0x5507('0x47')]['id']){_0x58202e[_0x5507('0x52')]['id']={'$gt':_0x2427ad[_0x5507('0x47')]['id']};}_0x58202e=_[_0x5507('0xa3')]({},_0x58202e,_0x2427ad[_0x5507('0xbb')]);return db['ChatMessage'][_0x5507('0x33')]({'where':_0x58202e[_0x5507('0x52')]})[_0x5507('0x24')](function(_0x543174){_0x5af08c[_0x5507('0x33')]=_0x543174;_0x58202e[_0x5507('0xba')]=[];if(_0x2427ad[_0x5507('0x47')][_0x5507('0xfe')]){_0x58202e[_0x5507('0xba')]['push']({'model':db['User'],'as':'User','attributes':['id',_0x5507('0x3c'),_0x5507('0xe1')]});}if(_0x2427ad['query']['includeAll']){_0x58202e[_0x5507('0xba')]=[{'all':!![]}];}return db[_0x5507('0xd6')][_0x5507('0xfc')](_0x58202e);})[_0x5507('0x24')](function(_0x2b5c75){_0x5af08c['rows']=_0x2b5c75;return _0x5af08c;});}})[_0x5507('0x24')](respondWithFilteredResult(_0x46293e,_0x58202e))[_0x5507('0x2e')](handleError(_0x46293e,null));};exports[_0x5507('0xff')]=function(_0x59639f,_0x3fc4e4,_0x327dd2){return db[_0x5507('0x44')]['find']({'where':{'id':_0x59639f['params']['id']}})[_0x5507('0x24')](handleEntityNotFound(_0x3fc4e4,null))[_0x5507('0x24')](function(_0x2578f1){if(_0x2578f1){return _0x2578f1[_0x5507('0x100')](_0x59639f['body'][_0x5507('0xf7')],_['omit'](_0x59639f[_0x5507('0x7d')],['ids','id'])||{})[_0x5507('0x101')](function(){return db['Tag'][_0x5507('0xfc')]({'attributes':['id',_0x5507('0x3a'),'color'],'where':{'id':_0x59639f[_0x5507('0x7d')][_0x5507('0xf7')]}});})['then'](function(_0x56e055){socket[_0x5507('0x102')]('chatInteractionTags:save',{'id':Number(_0x59639f[_0x5507('0xbe')]['id']),'tags':_0x56e055||[]});return{'id':Number(_0x59639f['params']['id']),'tags':_0x56e055||[]};});}})['then'](respondWithResult(_0x3fc4e4,null))['catch'](handleError(_0x3fc4e4,null));};exports[_0x5507('0x103')]=function(_0x29817d,_0x455702,_0x33b619){return db[_0x5507('0x44')]['find']({'where':{'id':_0x29817d[_0x5507('0xbe')]['id']}})[_0x5507('0x24')](handleEntityNotFound(_0x455702,null))['then'](function(_0x55ea79){if(_0x55ea79){return _0x55ea79['removeTags'](_0x29817d[_0x5507('0x47')][_0x5507('0xf7')]);}})[_0x5507('0x24')](respondWithStatusCode(_0x455702,null))['catch'](handleError(_0x455702,null));};exports[_0x5507('0xcc')]=function(_0x521d46,_0x17da0b){var _0x3450d0=moment()[_0x5507('0x104')]()[_0x5507('0xa1')]();var _0x3a8a60=path['join'](config['root'],_0x5507('0x105'),_0x5507('0x106'),_0x5507('0x107'));var _0x2900eb=path[_0x5507('0xd1')](config[_0x5507('0xcd')],_0x5507('0x105'),_0x5507('0x106'),_0x5507('0x108'));var _0x587f88=path['join'](_0x3a8a60,_0x3450d0);var _0x1af166=util[_0x5507('0xd9')]('transcript-%d-%s.zip',_0x521d46['params']['id'],_0x3450d0);var _0x9b654d=path[_0x5507('0xd1')](_0x3a8a60,_0x1af166);var _0x81031b=[];_0x81031b[_0x5507('0x41')]({'model':db[_0x5507('0x78')],'as':_0x5507('0x78'),'attributes':['id',_0x5507('0x3c')],'raw':!![]});_0x81031b[_0x5507('0x41')]({'model':db[_0x5507('0x109')],'as':'Contact','attributes':['id','firstName',_0x5507('0x10a')],'raw':!![]});if(_0x521d46['query'][_0x5507('0x108')]){_0x81031b[_0x5507('0x41')]({'model':db['Attachment'],'as':_0x5507('0xc9'),'raw':!![]});}var _0x543b47=[{'model':db['ChatMessage'],'as':_0x5507('0xd7'),'attributes':['id',_0x5507('0x7d'),_0x5507('0xe3'),_0x5507('0x10b'),'secret',_0x5507('0x86')],'include':_0x81031b}];_0x543b47[_0x5507('0x41')]({'model':db[_0x5507('0xd8')],'as':_0x5507('0x10c'),'attributes':['id',_0x5507('0x3a')]});_0x543b47[_0x5507('0x41')]({'model':db[_0x5507('0x78')],'as':'Owner','attributes':['id',_0x5507('0x3c')]});return db['ChatInteraction'][_0x5507('0x6a')]({'where':{'id':_0x521d46[_0x5507('0xbe')]['id']},'include':_0x543b47})[_0x5507('0x24')](handleEntityNotFound(_0x17da0b,null))[_0x5507('0x24')](function(_0x3129d4){if(_0x3129d4){var _0x59347c=_0x3129d4[_0x5507('0x10d')]({'plain':!![]});fs[_0x5507('0x10e')](_0x587f88);var _0x5f7947={'format':'A4','border':_0x5507('0x10f'),'header':{'height':'40px','contents':{'first':_0x5507('0x110')}},'footer':{'height':_0x5507('0x111'),'contents':{'default':util[_0x5507('0xd9')](_0x5507('0x112'),util[_0x5507('0xd9')](_0x5507('0x113'),_0x5507('0x114'),_0x59347c['id']),moment()[_0x5507('0xd9')]('YYYY-MM-DD')[_0x5507('0xa1')]())}}};var _0x414d02={'channel':'Chat','account':_0x59347c[_0x5507('0x10c')]['name'],'agent':_0x59347c[_0x5507('0x115')]?_0x59347c[_0x5507('0x115')][_0x5507('0x3c')]:_0x5507('0x116'),'createdAt':moment(_0x59347c[_0x5507('0xe3')])[_0x5507('0xd9')](_0x5507('0xfb'))[_0x5507('0xa1')](),'closedAt':_0x59347c[_0x5507('0xc3')]?moment(_0x59347c[_0x5507('0x117')])[_0x5507('0xd9')](_0x5507('0xfb'))['toString']():'','disposition':_0x59347c['disposition'],'chatInfo':{'browser':_0x59347c['browserName'],'os':_0x59347c[_0x5507('0x118')],'referer':_0x59347c['referer'],'customerIp':_0x59347c['customerIp'],'customerPort':_0x59347c[_0x5507('0x119')]?_0x59347c['customerPort']:_0x5507('0x116')},'messages':_(_0x59347c['Messages'])[_0x5507('0x11a')]()['filter']({'secret':![]})['map'](function(_0x197f8e){if(_0x197f8e[_0x5507('0xc9')]){var _0x44183b=path[_0x5507('0xd1')](_0x2900eb,_0x197f8e[_0x5507('0xc9')][_0x5507('0xc7')]);if(fs['existsSync'](_0x44183b)){fs[_0x5507('0x11b')](_0x44183b)['pipe'](fs[_0x5507('0x11c')](path['join'](_0x587f88,_0x197f8e['Attachment'][_0x5507('0xc7')])));}}return{'date':moment(_0x197f8e[_0x5507('0xe3')])[_0x5507('0xd9')](_0x5507('0xfb'))[_0x5507('0xa1')](),'sender':_0x197f8e[_0x5507('0x10b')]===_0x5507('0x11d')?_0x197f8e[_0x5507('0x78')]?_0x197f8e[_0x5507('0x78')][_0x5507('0x3c')]:_0x5507('0xdb'):_0x197f8e[_0x5507('0x6f')][_0x5507('0x11e')]+(_0x197f8e[_0x5507('0x6f')][_0x5507('0x10a')]?'\x20'+_0x197f8e['Contact'][_0x5507('0x10a')]:''),'body':_0x197f8e['Attachment']?_0x197f8e[_0x5507('0xc9')][_0x5507('0xc7')]:_0x197f8e['body'],'direction':_0x197f8e[_0x5507('0x10b')]===_0x5507('0x11d')?'A':'C','secret':_0x197f8e[_0x5507('0xe5')],'read':_0x197f8e[_0x5507('0x86')],'attachment':_0x197f8e[_0x5507('0xc9')]};})[_0x5507('0x6c')]()};return ejs['renderFile'](path[_0x5507('0xd1')](config['root'],'server','views',_0x5507('0x11f')),{'interaction':_0x414d02})[_0x5507('0x24')](function(_0x1d1026){return new BPromise(function(_0xc30dc6,_0x29a014){pdf[_0x5507('0xbc')](_0x1d1026,_0x5f7947)[_0x5507('0x120')](path['join'](_0x587f88,'transcript-'+_0x59347c['id']+'-'+_0x3450d0+'.pdf'),function(_0x5ac195,_0x2dd7ce){if(_0x5ac195)return _0x29a014(_0x5ac195);_0xc30dc6(_0x2dd7ce);});});})[_0x5507('0x24')](function(){return new BPromise(function(_0x55303d,_0x378e71){zipdir(_0x587f88,{'saveTo':_0x9b654d},function(_0x3c25b2,_0x3675a2){if(_0x3c25b2)return _0x378e71(_0x3c25b2);return _0x55303d(_0x3675a2);});})[_0x5507('0x24')](function(){return new BPromise(function(_0x56fe3b,_0x64dd47){rimraf(_0x587f88,function(_0x1c35f8){if(_0x1c35f8)_0x64dd47(_0x1c35f8);return _0x56fe3b();});});})[_0x5507('0x24')](function(){return _0x17da0b['download'](_0x9b654d,_0x1af166,function(_0x556699){if(_0x556699){console[_0x5507('0x121')](_0x5507('0x122'),_0x556699);}else{fs[_0x5507('0x123')](_0x9b654d);}});});});}else{return _0x17da0b['sendStatus'](0xc8);}})['catch'](handleError(_0x17da0b,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 9e60ce0..22b5579 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 _0x9a8d=['setMaxListeners','save','remove','getUsers','then','Users','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','ChatMessage'];(function(_0x4812e0,_0x2ccf3c){var _0x252e0f=function(_0x14cdb8){while(--_0x14cdb8){_0x4812e0['push'](_0x4812e0['shift']());}};_0x252e0f(++_0x2ccf3c);}(_0x9a8d,0xec));var _0xd9a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a8d[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd9a8('0x0'));var ChatInteraction=require(_0xd9a8('0x1'))['db'][_0xd9a8('0x2')];var ChatMessage=require(_0xd9a8('0x1'))['db'][_0xd9a8('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xd9a8('0x4')](0x0);var events={'afterCreate':_0xd9a8('0x5'),'afterUpdate':'update','afterDestroy':_0xd9a8('0x6')};function emitEvent(_0x2c26ac){return function(_0x2191a1,_0x2e95eb,_0x5977fc){_0x2191a1[_0xd9a8('0x7')]({'attributes':['id'],'raw':!![]})[_0xd9a8('0x8')](function(_0x1a60ff){_0x2191a1['setDataValue'](_0xd9a8('0x9'),_0x1a60ff['map'](function(_0x3ddaf0){return{'id':_0x3ddaf0['id']};}));return ChatMessage[_0xd9a8('0xa')]({'where':{'ChatInteractionId':_0x2191a1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd9a8('0x8')](function(_0x2935aa){_0x2191a1['setDataValue'](_0xd9a8('0xb'),_0x2935aa['length']);ChatInteractionEvents[_0xd9a8('0xc')](_0x2c26ac+':'+_0x2191a1['id'],_0x2191a1);ChatInteractionEvents['emit'](_0x2c26ac,_0x2191a1);_0x5977fc(null);})[_0xd9a8('0xd')](_0x5977fc(null));};}for(var e in events){if(events[_0xd9a8('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xd9a8('0xf')]=ChatInteractionEvents; \ No newline at end of file +var _0x3a84=['then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','getUsers'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3a84,0xb4));var _0x43a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a84[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x43a8('0x0'));var ChatInteraction=require(_0x43a8('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x43a8('0x2')](0x0);var events={'afterCreate':_0x43a8('0x3'),'afterUpdate':_0x43a8('0x4'),'afterDestroy':_0x43a8('0x5')};function emitEvent(_0x47f0fd){return function(_0x5ced71,_0x1318f3,_0x401614){_0x5ced71[_0x43a8('0x6')]({'attributes':['id'],'raw':!![]})[_0x43a8('0x7')](function(_0x4e1b77){_0x5ced71[_0x43a8('0x8')](_0x43a8('0x9'),_0x4e1b77[_0x43a8('0xa')](function(_0x3e5d91){return{'id':_0x3e5d91['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5ced71['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3c004b){_0x5ced71[_0x43a8('0x8')]('unreadMessages',_0x3c004b[_0x43a8('0xb')]);ChatInteractionEvents['emit'](_0x47f0fd+':'+_0x5ced71['id'],_0x5ced71);ChatInteractionEvents[_0x43a8('0xc')](_0x47f0fd,_0x5ced71);_0x401614(null);})[_0x43a8('0xd')](_0x401614(null));};}for(var e in events){if(events[_0x43a8('0xe')](e)){var event=events[e];ChatInteraction[_0x43a8('0xf')](e,emitEvent(event));}}module[_0x43a8('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 7c4ea96..4cddb97 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 _0xdce0=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xdce0,0x1be));var _0x0dce=function(_0x21280e,_0x578929){_0x21280e=_0x21280e-0x0;var _0x1d728b=_0xdce0[_0x21280e];return _0x1d728b;};'use strict';var _=require(_0x0dce('0x0'));var util=require(_0x0dce('0x1'));var logger=require(_0x0dce('0x2'))('api');var moment=require(_0x0dce('0x3'));var BPromise=require('bluebird');var rp=require(_0x0dce('0x4'));var fs=require('fs');var path=require(_0x0dce('0x5'));var rimraf=require(_0x0dce('0x6'));var config=require(_0x0dce('0x7'));var attributes=require(_0x0dce('0x8'));module[_0x0dce('0x9')]=function(_0x3c73b1,_0x403c89){return _0x3c73b1[_0x0dce('0xa')]('ChatInteraction',attributes,{'tableName':_0x0dce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1229d3,_0x452ca7,_0x48f090){if(_0x1229d3[_0x0dce('0xc')](_0x0dce('0xd'))){_0x1229d3[_0x0dce('0xe')]=moment()[_0x0dce('0xf')](_0x0dce('0x10'));}_0x48f090(null,_0x1229d3);}},'charset':'utf8mb4','collate':_0x0dce('0x11')});}; \ No newline at end of file +var _0x6ea9=['format','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','closedAt'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x6ea9,0xab));var _0x96ea=function(_0x5ed6ae,_0x172715){_0x5ed6ae=_0x5ed6ae-0x0;var _0x43fd55=_0x6ea9[_0x5ed6ae];return _0x43fd55;};'use strict';var _=require(_0x96ea('0x0'));var util=require(_0x96ea('0x1'));var logger=require(_0x96ea('0x2'))(_0x96ea('0x3'));var moment=require('moment');var BPromise=require(_0x96ea('0x4'));var rp=require(_0x96ea('0x5'));var fs=require('fs');var path=require(_0x96ea('0x6'));var rimraf=require(_0x96ea('0x7'));var config=require(_0x96ea('0x8'));var attributes=require(_0x96ea('0x9'));module[_0x96ea('0xa')]=function(_0x3c4b0c,_0xb0338e){return _0x3c4b0c[_0x96ea('0xb')](_0x96ea('0xc'),attributes,{'tableName':_0x96ea('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x52ed1c,_0x5a557b,_0x52f951){if(_0x52ed1c['changed'](_0x96ea('0xe'))){_0x52ed1c[_0x96ea('0xf')]=moment()[_0x96ea('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x52f951(null,_0x52ed1c);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index f4802a2..cbf9129 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 _0xdedb=['catch','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','ChatInteraction','update','body','options','raw','where','info','UpdateChatInteraction','stringify'];(function(_0x38bad3,_0x20e5e9){var _0x510814=function(_0x1d57aa){while(--_0x1d57aa){_0x38bad3['push'](_0x38bad3['shift']());}};_0x510814(++_0x20e5e9);}(_0xdedb,0x7a));var _0xbded=function(_0x36f125,_0x5b8fb0){_0x36f125=_0x36f125-0x0;var _0x5c5f8e=_0xdedb[_0x36f125];return _0x5c5f8e;};'use strict';var _=require(_0xbded('0x0'));var util=require(_0xbded('0x1'));var moment=require(_0xbded('0x2'));var BPromise=require(_0xbded('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbded('0x4'));var db=require(_0xbded('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbded('0x6'))(_0xbded('0x7'));var config=require(_0xbded('0x8'));var jayson=require(_0xbded('0x9'));var client=jayson[_0xbded('0xa')][_0xbded('0xb')]({'port':0x232a});config['redis']=_[_0xbded('0xc')](config[_0xbded('0xd')],{'host':_0xbded('0xe'),'port':0x18eb});var socket=require(_0xbded('0xf'))(new Redis(config['redis']));require(_0xbded('0x10'))['register'](socket);function respondWithRpcPromise(_0x45457e,_0x3125d6,_0x36cff6){return new BPromise(function(_0x587c65,_0x4129b7){return client[_0xbded('0x11')](_0x45457e,_0x36cff6)[_0xbded('0x12')](function(_0x584eba){logger['info'](_0xbded('0x13'),_0x3125d6,_0xbded('0x14'));logger[_0xbded('0x15')](_0xbded('0x16'),_0x3125d6,_0xbded('0x14'),JSON['stringify'](_0x584eba));if(_0x584eba[_0xbded('0x17')]){if(_0x584eba[_0xbded('0x17')]['code']===0x1f4){logger[_0xbded('0x17')](_0xbded('0x13'),_0x3125d6,_0x584eba[_0xbded('0x17')][_0xbded('0x18')]);return _0x4129b7(_0x584eba['error'][_0xbded('0x18')]);}logger['error'](_0xbded('0x13'),_0x3125d6,_0x584eba[_0xbded('0x17')][_0xbded('0x18')]);return _0x587c65(_0x584eba[_0xbded('0x17')][_0xbded('0x18')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3125d6,_0xbded('0x14'));_0x587c65(_0x584eba['result'][_0xbded('0x18')]);}})['catch'](function(_0x12bb4d){logger[_0xbded('0x17')](_0xbded('0x13'),_0x3125d6,_0x12bb4d);_0x4129b7(_0x12bb4d);});});}exports['UpdateChatInteraction']=function(_0x2396de){var _0x1a57c1=this;return new Promise(function(_0x27d415,_0x5388b5){return db[_0xbded('0x19')][_0xbded('0x1a')](_0x2396de[_0xbded('0x1b')],{'raw':_0x2396de[_0xbded('0x1c')]?_0x2396de[_0xbded('0x1c')][_0xbded('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2396de[_0xbded('0x1c')]?_0x2396de[_0xbded('0x1c')][_0xbded('0x1e')]||null:null,'attributes':_0x2396de[_0xbded('0x1c')]?_0x2396de[_0xbded('0x1c')]['attributes']||null:null,'limit':_0x2396de[_0xbded('0x1c')]?_0x2396de[_0xbded('0x1c')]['limit']||null:null})['then'](function(_0x22f219){logger[_0xbded('0x1f')](_0xbded('0x20'),_0x2396de);logger[_0xbded('0x15')](_0xbded('0x20'),_0x2396de,JSON[_0xbded('0x21')](_0x22f219));_0x27d415(_0x22f219);})[_0xbded('0x22')](function(_0x5bff34){logger[_0xbded('0x17')]('UpdateChatInteraction',_0x5bff34[_0xbded('0x18')],_0x2396de);_0x5388b5(_0x1a57c1[_0xbded('0x17')](0x1f4,_0x5bff34[_0xbded('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x482a0d){return new Promise(function(_0x36195e,_0x1c8d05){return db[_0xbded('0x19')]['find']({'where':_0x482a0d[_0xbded('0x1c')]?_0x482a0d[_0xbded('0x1c')][_0xbded('0x1e')]||null:null})[_0xbded('0x12')](function(_0x404fa5){if(_0x404fa5){return _0x404fa5['addTags'](_0x482a0d[_0xbded('0x1b')][_0xbded('0x23')],_[_0xbded('0x24')](_0x482a0d[_0xbded('0x1b')],[_0xbded('0x23'),'id'])||{});}})[_0xbded('0x25')](function(_0x43802e){logger[_0xbded('0x1f')](_0xbded('0x26'),_0x482a0d);logger[_0xbded('0x15')]('AddTags',_0x482a0d,JSON['stringify'](_0x43802e));_0x36195e(_0x43802e);})[_0xbded('0x22')](function(_0x3cf352){logger[_0xbded('0x17')](_0xbded('0x26'),_0x3cf352[_0xbded('0x18')],_0x482a0d);_0x1c8d05(_this[_0xbded('0x17')](0x1f4,_0x3cf352[_0xbded('0x18')]));});});}; \ No newline at end of file +var _0x4ca7=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./chatInteraction.socket','register','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','limit','AddTagsToChatInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis'];(function(_0xcaf933,_0x204492){var _0x52adf8=function(_0x4a55b3){while(--_0x4a55b3){_0xcaf933['push'](_0xcaf933['shift']());}};_0x52adf8(++_0x204492);}(_0x4ca7,0x14b));var _0x74ca=function(_0x14ca3a,_0x2358cd){_0x14ca3a=_0x14ca3a-0x0;var _0x439455=_0x4ca7[_0x14ca3a];return _0x439455;};'use strict';var _=require(_0x74ca('0x0'));var util=require(_0x74ca('0x1'));var moment=require(_0x74ca('0x2'));var BPromise=require(_0x74ca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74ca('0x4'));var db=require(_0x74ca('0x5'))['db'];var utils=require(_0x74ca('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x74ca('0x7'));var jayson=require(_0x74ca('0x8'));var client=jayson[_0x74ca('0x9')]['http']({'port':0x232a});config[_0x74ca('0xa')]=_['defaults'](config[_0x74ca('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x74ca('0xb'))(new Redis(config[_0x74ca('0xa')]));require(_0x74ca('0xc'))[_0x74ca('0xd')](socket);function respondWithRpcPromise(_0x49afa3,_0x1b028a,_0x4452d3){return new BPromise(function(_0x5a4cac,_0x32a298){return client['request'](_0x49afa3,_0x4452d3)[_0x74ca('0xe')](function(_0x197c74){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x1b028a,_0x74ca('0xf'));logger[_0x74ca('0x10')](_0x74ca('0x11'),_0x1b028a,_0x74ca('0xf'),JSON[_0x74ca('0x12')](_0x197c74));if(_0x197c74[_0x74ca('0x13')]){if(_0x197c74[_0x74ca('0x13')][_0x74ca('0x14')]===0x1f4){logger[_0x74ca('0x13')](_0x74ca('0x15'),_0x1b028a,_0x197c74[_0x74ca('0x13')][_0x74ca('0x16')]);return _0x32a298(_0x197c74['error']['message']);}logger['error'](_0x74ca('0x15'),_0x1b028a,_0x197c74[_0x74ca('0x13')][_0x74ca('0x16')]);return _0x5a4cac(_0x197c74['error']['message']);}else{logger[_0x74ca('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x1b028a,'request\x20sent');_0x5a4cac(_0x197c74[_0x74ca('0x18')][_0x74ca('0x16')]);}})[_0x74ca('0x19')](function(_0x5ad296){logger[_0x74ca('0x13')](_0x74ca('0x15'),_0x1b028a,_0x5ad296);_0x32a298(_0x5ad296);});});}exports[_0x74ca('0x1a')]=function(_0x4e3092){var _0x32a263=this;return new Promise(function(_0x1c79c0,_0x2ebaab){return db[_0x74ca('0x1b')][_0x74ca('0x1c')](_0x4e3092[_0x74ca('0x1d')],{'raw':_0x4e3092[_0x74ca('0x1e')]?_0x4e3092[_0x74ca('0x1e')][_0x74ca('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e3092[_0x74ca('0x1e')]?_0x4e3092[_0x74ca('0x1e')]['where']||null:null,'attributes':_0x4e3092[_0x74ca('0x1e')]?_0x4e3092['options'][_0x74ca('0x20')]||null:null,'limit':_0x4e3092['options']?_0x4e3092['options'][_0x74ca('0x21')]||null:null})['then'](function(_0x5872d9){logger['info'](_0x74ca('0x1a'),_0x4e3092);logger[_0x74ca('0x10')]('UpdateChatInteraction',_0x4e3092,JSON[_0x74ca('0x12')](_0x5872d9));_0x1c79c0(_0x5872d9);})[_0x74ca('0x19')](function(_0x1159a8){logger[_0x74ca('0x13')](_0x74ca('0x1a'),_0x1159a8[_0x74ca('0x16')],_0x4e3092);_0x2ebaab(_0x32a263['error'](0x1f4,_0x1159a8[_0x74ca('0x16')]));});});};exports[_0x74ca('0x22')]=function(_0x3c7503){return new Promise(function(_0x2c8a72,_0x3ad575){return db[_0x74ca('0x1b')][_0x74ca('0x23')]({'where':_0x3c7503[_0x74ca('0x1e')]?_0x3c7503[_0x74ca('0x1e')][_0x74ca('0x24')]||null:null})[_0x74ca('0xe')](function(_0x5635ba){if(_0x5635ba){return _0x5635ba[_0x74ca('0x25')](_0x3c7503[_0x74ca('0x1d')][_0x74ca('0x26')],_[_0x74ca('0x27')](_0x3c7503[_0x74ca('0x1d')],[_0x74ca('0x26'),'id'])||{});}})[_0x74ca('0x28')](function(_0x1befbc){logger[_0x74ca('0x17')](_0x74ca('0x29'),_0x3c7503);logger['debug'](_0x74ca('0x29'),_0x3c7503,JSON[_0x74ca('0x12')](_0x1befbc));_0x2c8a72(_0x1befbc);})[_0x74ca('0x19')](function(_0x498619){logger[_0x74ca('0x13')](_0x74ca('0x29'),_0x498619[_0x74ca('0x16')],_0x3c7503);_0x3ad575(_this[_0x74ca('0x13')](0x1f4,_0x498619[_0x74ca('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 94a46a0..1a48c1c 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 _0xe0da=['remove','update','emit','removeListener','length','save'];(function(_0x5e849c,_0x5db995){var _0x2283a8=function(_0x10e6ac){while(--_0x10e6ac){_0x5e849c['push'](_0x5e849c['shift']());}};_0x2283a8(++_0x5db995);}(_0xe0da,0x149));var _0xae0d=function(_0x352b7f,_0x1a94e6){_0x352b7f=_0x352b7f-0x0;var _0x116aea=_0xe0da[_0x352b7f];return _0x116aea;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xae0d('0x0'),_0xae0d('0x1'),_0xae0d('0x2')];function createListener(_0x5445fc,_0x1d990e){return function(_0x5056c8){_0x1d990e[_0xae0d('0x3')](_0x5445fc,_0x5056c8);};}function removeListener(_0x5d7bea,_0x589394){return function(){ChatInteractionEvents[_0xae0d('0x4')](_0x5d7bea,_0x589394);};}exports['register']=function(_0x4f7de1){for(var _0xf4f033=0x0,_0x5902dc=events[_0xae0d('0x5')];_0xf4f033<_0x5902dc;_0xf4f033++){var _0x4a64d3=events[_0xf4f033];var _0x7f75b=createListener('chatInteraction:'+_0x4a64d3,_0x4f7de1);ChatInteractionEvents['on'](_0x4a64d3,_0x7f75b);}}; \ No newline at end of file +var _0xc8da=['remove','emit','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x9e7f3a,_0x37105f){var _0x5ab145=function(_0x5b3bad){while(--_0x5b3bad){_0x9e7f3a['push'](_0x9e7f3a['shift']());}};_0x5ab145(++_0x37105f);}(_0xc8da,0x10f));var _0xac8d=function(_0x1d9639,_0x3c1de3){_0x1d9639=_0x1d9639-0x0;var _0x31a51b=_0xc8da[_0x1d9639];return _0x31a51b;};'use strict';var ChatInteractionEvents=require(_0xac8d('0x0'));var events=[_0xac8d('0x1'),_0xac8d('0x2'),'update'];function createListener(_0x48b1b9,_0x2a9c1e){return function(_0x24f371){_0x2a9c1e[_0xac8d('0x3')](_0x48b1b9,_0x24f371);};}function removeListener(_0x1385d4,_0x368024){return function(){ChatInteractionEvents['removeListener'](_0x1385d4,_0x368024);};}exports[_0xac8d('0x4')]=function(_0x170028){for(var _0x1669f3=0x0,_0x100d94=events[_0xac8d('0x5')];_0x1669f3<_0x100d94;_0x1669f3++){var _0x3ceff7=events[_0x1669f3];var _0x463d57=createListener(_0xac8d('0x6')+_0x3ceff7,_0x170028);ChatInteractionEvents['on'](_0x3ceff7,_0x463d57);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 6e9b0bf..09249ed 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 _0xd53d=['server/files/attachments/','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','tracked','chatinteraction:destroy','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMyMessages','/:id/download','download','post','create','diskStorage','join','root'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd53d,0x151));var _0xdd53=function(_0x4d7988,_0x4c62e3){_0x4d7988=_0x4d7988-0x0;var _0x97e287=_0xd53d[_0x4d7988];return _0x97e287;};'use strict';var multer=require(_0xdd53('0x0'));var util=require(_0xdd53('0x1'));var path=require(_0xdd53('0x2'));var timeout=require('connect-timeout');var express=require(_0xdd53('0x3'));var router=express[_0xdd53('0x4')]();var auth=require(_0xdd53('0x5'));var interaction=require(_0xdd53('0x6'));var config=require(_0xdd53('0x7'));var controller=require('./chatInteraction.controller');router[_0xdd53('0x8')]('/',auth[_0xdd53('0x9')](),controller[_0xdd53('0xa')]);router[_0xdd53('0x8')](_0xdd53('0xb'),auth['isAuthenticated'](),controller[_0xdd53('0xc')]);router[_0xdd53('0x8')](_0xdd53('0xd'),auth[_0xdd53('0xe')](),controller[_0xdd53('0xf')]);router['get'](_0xdd53('0x10'),auth[_0xdd53('0xe')](),controller[_0xdd53('0x11')]);router['get'](_0xdd53('0x12'),auth[_0xdd53('0x9')](),controller['getMessages']);router[_0xdd53('0x8')]('/:id/my_messages',auth[_0xdd53('0xe')](),controller[_0xdd53('0x13')]);router['get'](_0xdd53('0x14'),auth['isAuthenticated'](),controller[_0xdd53('0x15')]);router[_0xdd53('0x16')]('/',auth[_0xdd53('0x9')](),controller[_0xdd53('0x17')]);var upload=multer({'storage':multer[_0xdd53('0x18')]({'destination':function(_0x136952,_0x4429ea,_0x7c629f){_0x7c629f(null,path[_0xdd53('0x19')](config[_0xdd53('0x1a')],_0xdd53('0x1b')));},'filename':function(_0x1046ac,_0x10819a,_0x46678d){_0x46678d(null,util['format'](_0xdd53('0x1c'),Date[_0xdd53('0x1d')](),_0x10819a[_0xdd53('0x1e')][_0xdd53('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xdd53('0x16')]('/:id/attachment_upload',upload[_0xdd53('0x20')](_0xdd53('0x21')),controller[_0xdd53('0x22')]);router[_0xdd53('0x16')](_0xdd53('0x12'),auth[_0xdd53('0xe')](),controller[_0xdd53('0x23')]);router[_0xdd53('0x16')](_0xdd53('0x24'),auth[_0xdd53('0x9')](),interaction['tracked'](_0xdd53('0x25'),_0xdd53('0x26')),controller['addTags']);router[_0xdd53('0x27')](_0xdd53('0xd'),auth[_0xdd53('0x9')](),interaction['tracked'](_0xdd53('0x25'),_0xdd53('0x28')),controller[_0xdd53('0x29')]);router[_0xdd53('0x27')](_0xdd53('0x2a'),controller[_0xdd53('0x2b')]);router[_0xdd53('0x27')](_0xdd53('0x2c'),auth[_0xdd53('0xe')](),controller[_0xdd53('0x2d')]);router[_0xdd53('0x27')](_0xdd53('0x2e'),controller[_0xdd53('0x2f')]);router[_0xdd53('0x30')](_0xdd53('0xd'),auth[_0xdd53('0x9')](),interaction[_0xdd53('0x31')](_0xdd53('0x25'),_0xdd53('0x32')),controller[_0xdd53('0x33')]);router[_0xdd53('0x30')](_0xdd53('0x24'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x52bb=['getMessages','getMyMessages','/:id/download','post','diskStorage','join','server/files/attachments/','format','%s-%s','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','delete','chatinteraction:destroy','destroy','removeTags','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x52bb,0xa4));var _0xb52b=function(_0x2cf740,_0x3917ca){_0x2cf740=_0x2cf740-0x0;var _0x4aba59=_0x52bb[_0x2cf740];return _0x4aba59;};'use strict';var multer=require(_0xb52b('0x0'));var util=require(_0xb52b('0x1'));var path=require('path');var timeout=require(_0xb52b('0x2'));var express=require(_0xb52b('0x3'));var router=express['Router']();var auth=require(_0xb52b('0x4'));var interaction=require(_0xb52b('0x5'));var config=require(_0xb52b('0x6'));var controller=require(_0xb52b('0x7'));router[_0xb52b('0x8')]('/',auth[_0xb52b('0x9')](),controller['index']);router[_0xb52b('0x8')](_0xb52b('0xa'),auth[_0xb52b('0x9')](),controller['describe']);router[_0xb52b('0x8')](_0xb52b('0xb'),auth[_0xb52b('0xc')](),controller[_0xb52b('0xd')]);router[_0xb52b('0x8')](_0xb52b('0xe'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xb52b('0x8')](_0xb52b('0xf'),auth[_0xb52b('0x9')](),controller[_0xb52b('0x10')]);router['get']('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0xb52b('0x11')]);router[_0xb52b('0x8')](_0xb52b('0x12'),auth['isAuthenticated'](),controller['download']);router[_0xb52b('0x13')]('/',auth[_0xb52b('0x9')](),controller['create']);var upload=multer({'storage':multer[_0xb52b('0x14')]({'destination':function(_0x51eb24,_0x193ad7,_0x377947){_0x377947(null,path[_0xb52b('0x15')](config['root'],_0xb52b('0x16')));},'filename':function(_0x347695,_0x5653d5,_0x2e1538){_0x2e1538(null,util[_0xb52b('0x17')](_0xb52b('0x18'),Date['now'](),_0x5653d5['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb52b('0x13')](_0xb52b('0x19'),upload[_0xb52b('0x1a')](_0xb52b('0x1b')),controller[_0xb52b('0x1c')]);router[_0xb52b('0x13')]('/:id/messages',auth[_0xb52b('0xc')](),controller[_0xb52b('0x1d')]);router[_0xb52b('0x13')](_0xb52b('0x1e'),auth['isAuthenticated'](),interaction[_0xb52b('0x1f')](_0xb52b('0x20'),_0xb52b('0x21')),controller[_0xb52b('0x22')]);router[_0xb52b('0x23')](_0xb52b('0xb'),auth[_0xb52b('0x9')](),interaction['tracked'](_0xb52b('0x20'),_0xb52b('0x24')),controller[_0xb52b('0x25')]);router[_0xb52b('0x23')](_0xb52b('0x26'),controller[_0xb52b('0x27')]);router[_0xb52b('0x23')]('/:id/abandon',auth[_0xb52b('0xc')](),controller[_0xb52b('0x28')]);router['put']('/:id/close',controller['close']);router[_0xb52b('0x29')](_0xb52b('0xb'),auth['isAuthenticated'](),interaction[_0xb52b('0x1f')]('chat',_0xb52b('0x2a')),controller[_0xb52b('0x2b')]);router[_0xb52b('0x29')]('/:id/tags',auth[_0xb52b('0x9')](),controller[_0xb52b('0x2c')]);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 3e9df97..aab28a3 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 _0x14a0=['BOOLEAN','INTEGER','exports','TEXT','medium'];(function(_0x2b8f90,_0x3a895e){var _0x54b694=function(_0x4ad0bc){while(--_0x4ad0bc){_0x2b8f90['push'](_0x2b8f90['shift']());}};_0x54b694(++_0x3a895e);}(_0x14a0,0x8e));var _0x014a=function(_0x1fb138,_0x3d6660){_0x1fb138=_0x1fb138-0x0;var _0x5ab559=_0x14a0[_0x1fb138];return _0x5ab559;};'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 +var _0x1967=['INTEGER','exports','TEXT','medium','BOOLEAN'];(function(_0x4f39f0,_0x11ec01){var _0x87dc43=function(_0x1747ce){while(--_0x1747ce){_0x4f39f0['push'](_0x4f39f0['shift']());}};_0x87dc43(++_0x11ec01);}(_0x1967,0x173));var _0x7196=function(_0x122a3d,_0x4ebd7a){_0x122a3d=_0x122a3d-0x0;var _0x5c6f27=_0x1967[_0x122a3d];return _0x5c6f27;};'use strict';var Sequelize=require('sequelize');module[_0x7196('0x0')]={'body':{'type':Sequelize[_0x7196('0x1')](_0x7196('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7196('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7196('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index a142e4f..687ad83 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 _0x2cee=['name','send','index','map','ChatInternalMessage','type','model','query','keys','attributes','intersection','fields','nolimit','sort','where','pick','merge','filter','options','include','findAll','rows','show','params','rawAttributes','filters','length','includeAll','find','catch','create','body','update','get','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','push','user','FromId','ToId','read','all','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','sendStatus','status','end','json','count','offset','limit','set','reject','then','destroy','error','stack'];(function(_0x400b43,_0x55da4e){var _0x3c330f=function(_0x5bbd52){while(--_0x5bbd52){_0x400b43['push'](_0x400b43['shift']());}};_0x3c330f(++_0x55da4e);}(_0x2cee,0x10b));var _0xe2ce=function(_0x2afa67,_0xde603){_0x2afa67=_0x2afa67-0x0;var _0x18d4f7=_0x2cee[_0x2afa67];return _0x18d4f7;};'use strict';var pdf=require(_0xe2ce('0x0'));var emlformat=require(_0xe2ce('0x1'));var rimraf=require(_0xe2ce('0x2'));var zipdir=require(_0xe2ce('0x3'));var jsonpatch=require(_0xe2ce('0x4'));var rp=require('request-promise');var moment=require(_0xe2ce('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe2ce('0x6'));var util=require(_0xe2ce('0x7'));var path=require(_0xe2ce('0x8'));var sox=require(_0xe2ce('0x9'));var csv=require(_0xe2ce('0xa'));var ejs=require(_0xe2ce('0xb'));var fs=require('fs');var _=require(_0xe2ce('0xc'));var squel=require(_0xe2ce('0xd'));var crypto=require(_0xe2ce('0xe'));var jsforce=require(_0xe2ce('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe2ce('0x10'));var Redis=require(_0xe2ce('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe2ce('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe2ce('0x13'));var logger=require('../../config/logger')(_0xe2ce('0x14'));var utils=require(_0xe2ce('0x15'));var config=require(_0xe2ce('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe2ce('0x17')](config['redis'],{'host':_0xe2ce('0x18'),'port':0x18eb});var socket=require(_0xe2ce('0x19'))(new Redis(config[_0xe2ce('0x1a')]));require(_0xe2ce('0x1b'))[_0xe2ce('0x1c')](socket);function respondWithStatusCode(_0x35d24e,_0xe406f9){_0xe406f9=_0xe406f9||0xcc;return function(_0x4725cb){if(_0x4725cb){return _0x35d24e[_0xe2ce('0x1d')](_0xe406f9);}return _0x35d24e[_0xe2ce('0x1e')](_0xe406f9)[_0xe2ce('0x1f')]();};}function respondWithResult(_0x4d9572,_0x23fe87){_0x23fe87=_0x23fe87||0xc8;return function(_0xb0747e){if(_0xb0747e){return _0x4d9572[_0xe2ce('0x1e')](_0x23fe87)[_0xe2ce('0x20')](_0xb0747e);}};}function respondWithFilteredResult(_0x46b60e,_0x271f97){return function(_0xdcc6f9){if(_0xdcc6f9){var _0x5cd2e9=_0xdcc6f9[_0xe2ce('0x21')],_0xc2009=_0x271f97[_0xe2ce('0x22')],_0x20f6e4=_0x271f97[_0xe2ce('0x22')]+_0x271f97[_0xe2ce('0x23')],_0x2e7478;if(_0x20f6e4>=_0x5cd2e9){_0x20f6e4=_0x5cd2e9;_0x2e7478=0xc8;}else{_0x2e7478=0xce;}_0x46b60e[_0xe2ce('0x1e')](_0x2e7478);return _0x46b60e[_0xe2ce('0x24')]('Content-Range',_0xc2009+'-'+_0x20f6e4+'/'+_0x5cd2e9)[_0xe2ce('0x20')](_0xdcc6f9);}return null;};}function patchUpdates(_0x41f05d){return function(_0x693631){try{jsonpatch['apply'](_0x693631,_0x41f05d,!![]);}catch(_0x2ca68d){return BPromise[_0xe2ce('0x25')](_0x2ca68d);}return _0x693631['save']();};}function saveUpdates(_0x33577b,_0x110005){return function(_0x50551f){if(_0x50551f){return _0x50551f['update'](_0x33577b)[_0xe2ce('0x26')](function(_0x594d78){return _0x594d78;});}return null;};}function removeEntity(_0x27bb43,_0x57156d){return function(_0x167c5d){if(_0x167c5d){return _0x167c5d[_0xe2ce('0x27')]()[_0xe2ce('0x26')](function(){_0x27bb43[_0xe2ce('0x1e')](0xcc)[_0xe2ce('0x1f')]();});}};}function handleEntityNotFound(_0x541dca,_0x5a0b8d){return function(_0x579dcb){if(!_0x579dcb){_0x541dca[_0xe2ce('0x1d')](0x194);}return _0x579dcb;};}function handleError(_0x4a4e96,_0x2c7bdd){_0x2c7bdd=_0x2c7bdd||0x1f4;return function(_0xde4bca){logger[_0xe2ce('0x28')](_0xde4bca[_0xe2ce('0x29')]);if(_0xde4bca['name']){delete _0xde4bca[_0xe2ce('0x2a')];}_0x4a4e96[_0xe2ce('0x1e')](_0x2c7bdd)[_0xe2ce('0x2b')](_0xde4bca);};}exports[_0xe2ce('0x2c')]=function(_0x163e55,_0x4a927d){var _0x494a14={},_0x3b31e1={},_0x4c8b20={'count':0x0,'rows':[]};var _0x2510a8=_[_0xe2ce('0x2d')](db[_0xe2ce('0x2e')]['rawAttributes'],function(_0x5db4ab){return{'name':_0x5db4ab['fieldName'],'type':_0x5db4ab[_0xe2ce('0x2f')]['key']};});_0x3b31e1[_0xe2ce('0x30')]=_[_0xe2ce('0x2d')](_0x2510a8,_0xe2ce('0x2a'));_0x3b31e1[_0xe2ce('0x31')]=_[_0xe2ce('0x32')](_0x163e55[_0xe2ce('0x31')]);_0x3b31e1['filters']=_['intersection'](_0x3b31e1['model'],_0x3b31e1[_0xe2ce('0x31')]);_0x494a14[_0xe2ce('0x33')]=_[_0xe2ce('0x34')](_0x3b31e1[_0xe2ce('0x30')],qs[_0xe2ce('0x35')](_0x163e55[_0xe2ce('0x31')][_0xe2ce('0x35')]));_0x494a14['attributes']=_0x494a14[_0xe2ce('0x33')]['length']?_0x494a14[_0xe2ce('0x33')]:_0x3b31e1[_0xe2ce('0x30')];if(!_0x163e55[_0xe2ce('0x31')]['hasOwnProperty'](_0xe2ce('0x36'))){_0x494a14['limit']=qs[_0xe2ce('0x23')](_0x163e55['query'][_0xe2ce('0x23')]);_0x494a14['offset']=qs['offset'](_0x163e55[_0xe2ce('0x31')][_0xe2ce('0x22')]);}_0x494a14['order']=qs[_0xe2ce('0x37')](_0x163e55[_0xe2ce('0x31')]['sort']);_0x494a14[_0xe2ce('0x38')]=qs['filters'](_[_0xe2ce('0x39')](_0x163e55[_0xe2ce('0x31')],_0x3b31e1['filters']));if(_0x163e55[_0xe2ce('0x31')]['filter']){_0x494a14['where']=_[_0xe2ce('0x3a')](_0x494a14[_0xe2ce('0x38')],{'$or':_[_0xe2ce('0x2d')](_0x2510a8,function(_0x3e4d9b){if(_0x3e4d9b['type']!=='VIRTUAL'){var _0x4a3b93={};_0x4a3b93[_0x3e4d9b[_0xe2ce('0x2a')]]={'$like':'%'+_0x163e55[_0xe2ce('0x31')][_0xe2ce('0x3b')]+'%'};return _0x4a3b93;}})});}_0x494a14=_['merge']({},_0x494a14,_0x163e55[_0xe2ce('0x3c')]);var _0x480f8e={'where':_0x494a14['where']};return db[_0xe2ce('0x2e')][_0xe2ce('0x21')](_0x480f8e)[_0xe2ce('0x26')](function(_0xe0e7fd){_0x4c8b20[_0xe2ce('0x21')]=_0xe0e7fd;if(_0x163e55[_0xe2ce('0x31')]['includeAll']){_0x494a14[_0xe2ce('0x3d')]=[{'all':!![]}];}return db[_0xe2ce('0x2e')][_0xe2ce('0x3e')](_0x494a14);})[_0xe2ce('0x26')](function(_0x4b6d26){_0x4c8b20[_0xe2ce('0x3f')]=_0x4b6d26;return _0x4c8b20;})[_0xe2ce('0x26')](respondWithFilteredResult(_0x4a927d,_0x494a14))['catch'](handleError(_0x4a927d,null));};exports[_0xe2ce('0x40')]=function(_0x3e8ce5,_0x2f8cbe){var _0x376b56={'raw':!![],'where':{'id':_0x3e8ce5[_0xe2ce('0x41')]['id']}},_0x14a26f={};_0x14a26f[_0xe2ce('0x30')]=_[_0xe2ce('0x32')](db[_0xe2ce('0x2e')][_0xe2ce('0x42')]);_0x14a26f[_0xe2ce('0x31')]=_[_0xe2ce('0x32')](_0x3e8ce5[_0xe2ce('0x31')]);_0x14a26f[_0xe2ce('0x43')]=_[_0xe2ce('0x34')](_0x14a26f['model'],_0x14a26f[_0xe2ce('0x31')]);_0x376b56[_0xe2ce('0x33')]=_['intersection'](_0x14a26f[_0xe2ce('0x30')],qs[_0xe2ce('0x35')](_0x3e8ce5[_0xe2ce('0x31')]['fields']));_0x376b56[_0xe2ce('0x33')]=_0x376b56[_0xe2ce('0x33')][_0xe2ce('0x44')]?_0x376b56[_0xe2ce('0x33')]:_0x14a26f['model'];if(_0x3e8ce5[_0xe2ce('0x31')][_0xe2ce('0x45')]){_0x376b56[_0xe2ce('0x3d')]=[{'all':!![]}];}_0x376b56=_[_0xe2ce('0x3a')]({},_0x376b56,_0x3e8ce5[_0xe2ce('0x3c')]);return db[_0xe2ce('0x2e')][_0xe2ce('0x46')](_0x376b56)[_0xe2ce('0x26')](handleEntityNotFound(_0x2f8cbe,null))[_0xe2ce('0x26')](respondWithResult(_0x2f8cbe,null))[_0xe2ce('0x47')](handleError(_0x2f8cbe,null));};exports[_0xe2ce('0x48')]=function(_0x50857f,_0x1aa177){return db[_0xe2ce('0x2e')][_0xe2ce('0x48')](_0x50857f[_0xe2ce('0x49')],{})[_0xe2ce('0x26')](respondWithResult(_0x1aa177,0xc9))[_0xe2ce('0x47')](handleError(_0x1aa177,null));};exports[_0xe2ce('0x4a')]=function(_0x273862,_0x7de25f){if(_0x273862[_0xe2ce('0x49')]['id']){delete _0x273862[_0xe2ce('0x49')]['id'];}return db[_0xe2ce('0x2e')][_0xe2ce('0x46')]({'where':{'id':_0x273862[_0xe2ce('0x41')]['id']}})[_0xe2ce('0x26')](handleEntityNotFound(_0x7de25f,null))[_0xe2ce('0x26')](saveUpdates(_0x273862[_0xe2ce('0x49')],null))['then'](respondWithResult(_0x7de25f,null))[_0xe2ce('0x47')](handleError(_0x7de25f,null));};exports['destroy']=function(_0x4020e7,_0x493ccb){return db['ChatInternalMessage'][_0xe2ce('0x46')]({'where':{'id':_0x4020e7['params']['id']}})[_0xe2ce('0x26')](handleEntityNotFound(_0x493ccb,null))[_0xe2ce('0x26')](removeEntity(_0x493ccb,null))['catch'](handleError(_0x493ccb,null));};exports['describe']=function(_0x5715c0,_0x4712a3){return db[_0xe2ce('0x2e')]['describe']()[_0xe2ce('0x26')](respondWithResult(_0x4712a3,null))[_0xe2ce('0x47')](handleError(_0x4712a3,null));};function wrapUser(_0x5f08a3){return function(_0x541023){var _0x2b5e97=_0x5f08a3[_0xe2ce('0x4b')]({'plain':!![]});_0x2b5e97['messages']=[];if(_0x541023){_0x2b5e97[_0xe2ce('0x4c')]=_0x541023[_0xe2ce('0x4d')];_0x2b5e97[_0xe2ce('0x4e')]=_0x541023;}else{_0x2b5e97[_0xe2ce('0x4c')]=moment(0x0)['format'](_0xe2ce('0x4f'));_0x2b5e97[_0xe2ce('0x4e')]={};}return _0x2b5e97;};}exports[_0xe2ce('0x50')]=function(_0x206a6c,_0x1ba834,_0x5c9a51){var _0xfa5023=[];return db[_0xe2ce('0x51')]['findAll']({'where':{'role':['agent','admin','user']},'attributes':['id',_0xe2ce('0x52'),_0xe2ce('0x2a'),_0xe2ce('0x53'),_0xe2ce('0x54'),_0xe2ce('0x55'),_0xe2ce('0x56'),_0xe2ce('0x57'),'allowmessenger',_0xe2ce('0x58')],'order':qs[_0xe2ce('0x37')](_0xe2ce('0x59')),'include':[{'model':db[_0xe2ce('0x5a')],'as':_0xe2ce('0x5b'),'attributes':['id',_0xe2ce('0x2a'),_0xe2ce('0x2f')],'through':{'attributes':[]}}]})['then'](function(_0x3c6430){if(_0x3c6430){var _0x1e39f2=_0x206a6c['user']['get']({'plain':!![]});if(!_0x1e39f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e39f2[_0xe2ce('0x53')]==='user'){return db['UserProfileSection'][_0xe2ce('0x46')]({'where':{'name':'Agents','userProfileId':_0x1e39f2[_0xe2ce('0x5c')]},'raw':!![]})[_0xe2ce('0x26')](function(_0x4c997b){if(_0x4c997b){if(_0x4c997b[_0xe2ce('0x5d')]===0x0){return db[_0xe2ce('0x5e')]['findAll']({'where':{'sectionId':_0x4c997b['id']},'raw':!![]})[_0xe2ce('0x26')](function(_0x32836d){var _0x35813e=[];if(_[_0xe2ce('0x5f')](_0x32836d)){_0x35813e=_[_0xe2ce('0x3b')](_0x3c6430,function(_0x25993d){if(_0x25993d[_0xe2ce('0x53')]!==_0xe2ce('0x60')){return _0x25993d;}});return _0x35813e;}else{for(var _0x3584fd=0x0;_0x3584fd<_0x3c6430[_0xe2ce('0x44')];_0x3584fd++){var _0x3911ca=_0x3c6430[_0x3584fd];if(_0x3911ca[_0xe2ce('0x53')]==='agent'){var _0x17e527=_[_0xe2ce('0x46')](_0x32836d,function(_0x2b0187){return _0x2b0187['resourceId']===_0x3911ca['id'];});if(_0x17e527)_0x35813e[_0xe2ce('0x61')](_0x3911ca);}else{_0x35813e[_0xe2ce('0x61')](_0x3911ca);}}return _0x35813e;}});}else{return _0x3c6430;}}else{var _0x9fc1fb=_[_0xe2ce('0x3b')](_0x3c6430,function(_0x4c7627){if(_0x4c7627['role']!==_0xe2ce('0x60')){return _0x4c7627;}});return _0x9fc1fb;}});}else{return _0x3c6430;}}})[_0xe2ce('0x26')](function(_0x1ac4f9){var _0x26ecb6=[];if(_0x1ac4f9){_0xfa5023=_0x1ac4f9;for(var _0x3a34e4=0x0;_0x3a34e4<_0x1ac4f9[_0xe2ce('0x44')];_0x3a34e4+=0x1){_0xfa5023[_0x3a34e4]['messages']=[];_0x26ecb6[_0xe2ce('0x61')](db[_0xe2ce('0x2e')][_0xe2ce('0x46')]({'where':{'FromId':[_0x206a6c[_0xe2ce('0x62')]['id'],_0x1ac4f9[_0x3a34e4]['id']],'ToId':[_0x206a6c[_0xe2ce('0x62')]['id'],_0x1ac4f9[_0x3a34e4]['id']],'ChatGroupId':null},'attributes':['id',_0xe2ce('0x4d'),_0xe2ce('0x63'),_0xe2ce('0x64'),_0xe2ce('0x65'),_0xe2ce('0x49')],'order':qs[_0xe2ce('0x37')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe2ce('0x26')](wrapUser(_0x1ac4f9[_0x3a34e4])));}return BPromise[_0xe2ce('0x66')](_0x26ecb6);}return[];})['then'](function(_0x62417e){return{'rows':_0x62417e,'count':_0x62417e['length']};})[_0xe2ce('0x26')](respondWithResult(_0x1ba834,null))[_0xe2ce('0x47')](handleError(_0x1ba834,null));}; \ No newline at end of file +var _0x8e7b=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','status','end','json','offset','limit','Content-Range','apply','save','update','then','sendStatus','error','name','send','index','ChatInternalMessage'];(function(_0x18d6ed,_0x78bc4f){var _0x3ed0d1=function(_0x5a0bd0){while(--_0x5a0bd0){_0x18d6ed['push'](_0x18d6ed['shift']());}};_0x3ed0d1(++_0x78bc4f);}(_0x8e7b,0x197));var _0xb8e7=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x8e7b[_0x4792c8];return _0x35edb1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb8e7('0x0'));var rimraf=require(_0xb8e7('0x1'));var zipdir=require(_0xb8e7('0x2'));var jsonpatch=require(_0xb8e7('0x3'));var rp=require('request-promise');var moment=require(_0xb8e7('0x4'));var BPromise=require(_0xb8e7('0x5'));var Mustache=require('mustache');var util=require(_0xb8e7('0x6'));var path=require(_0xb8e7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb8e7('0x8'));var fs=require('fs');var _=require(_0xb8e7('0x9'));var squel=require(_0xb8e7('0xa'));var crypto=require(_0xb8e7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb8e7('0xc'));var toCsv=require(_0xb8e7('0xd'));var querystring=require('querystring');var Papa=require(_0xb8e7('0xe'));var Redis=require(_0xb8e7('0xf'));var authService=require(_0xb8e7('0x10'));var qs=require(_0xb8e7('0x11'));var as=require(_0xb8e7('0x12'));var hardwareService=require(_0xb8e7('0x13'));var logger=require('../../config/logger')(_0xb8e7('0x14'));var utils=require(_0xb8e7('0x15'));var config=require(_0xb8e7('0x16'));var db=require(_0xb8e7('0x17'))['db'];config[_0xb8e7('0x18')]=_[_0xb8e7('0x19')](config[_0xb8e7('0x18')],{'host':_0xb8e7('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb8e7('0x18')]));require(_0xb8e7('0x1b'))[_0xb8e7('0x1c')](socket);function respondWithStatusCode(_0x48320e,_0x29655b){_0x29655b=_0x29655b||0xcc;return function(_0x3a0ec1){if(_0x3a0ec1){return _0x48320e['sendStatus'](_0x29655b);}return _0x48320e[_0xb8e7('0x1d')](_0x29655b)[_0xb8e7('0x1e')]();};}function respondWithResult(_0x26cd00,_0x16f93c){_0x16f93c=_0x16f93c||0xc8;return function(_0x5058de){if(_0x5058de){return _0x26cd00[_0xb8e7('0x1d')](_0x16f93c)[_0xb8e7('0x1f')](_0x5058de);}};}function respondWithFilteredResult(_0x59ea92,_0x158988){return function(_0x5bfcc5){if(_0x5bfcc5){var _0x4719cb=_0x5bfcc5['count'],_0xf0d099=_0x158988[_0xb8e7('0x20')],_0x4beefe=_0x158988[_0xb8e7('0x20')]+_0x158988[_0xb8e7('0x21')],_0x2724d4;if(_0x4beefe>=_0x4719cb){_0x4beefe=_0x4719cb;_0x2724d4=0xc8;}else{_0x2724d4=0xce;}_0x59ea92[_0xb8e7('0x1d')](_0x2724d4);return _0x59ea92['set'](_0xb8e7('0x22'),_0xf0d099+'-'+_0x4beefe+'/'+_0x4719cb)[_0xb8e7('0x1f')](_0x5bfcc5);}return null;};}function patchUpdates(_0x277f87){return function(_0x3b5f8b){try{jsonpatch[_0xb8e7('0x23')](_0x3b5f8b,_0x277f87,!![]);}catch(_0x57665a){return BPromise['reject'](_0x57665a);}return _0x3b5f8b[_0xb8e7('0x24')]();};}function saveUpdates(_0x100970,_0x47ae83){return function(_0xc173db){if(_0xc173db){return _0xc173db[_0xb8e7('0x25')](_0x100970)[_0xb8e7('0x26')](function(_0xe0f557){return _0xe0f557;});}return null;};}function removeEntity(_0x1923be,_0x5598d7){return function(_0x258280){if(_0x258280){return _0x258280['destroy']()['then'](function(){_0x1923be[_0xb8e7('0x1d')](0xcc)[_0xb8e7('0x1e')]();});}};}function handleEntityNotFound(_0xd8f47b,_0xd503f8){return function(_0x43816c){if(!_0x43816c){_0xd8f47b[_0xb8e7('0x27')](0x194);}return _0x43816c;};}function handleError(_0x79bfcc,_0x838a4a){_0x838a4a=_0x838a4a||0x1f4;return function(_0x46c49d){logger[_0xb8e7('0x28')](_0x46c49d['stack']);if(_0x46c49d[_0xb8e7('0x29')]){delete _0x46c49d[_0xb8e7('0x29')];}_0x79bfcc[_0xb8e7('0x1d')](_0x838a4a)[_0xb8e7('0x2a')](_0x46c49d);};}exports[_0xb8e7('0x2b')]=function(_0xb59957,_0x5d1ef2){var _0xae4fe9={},_0x3d7c8d={},_0x3e55fc={'count':0x0,'rows':[]};var _0x27861f=_['map'](db[_0xb8e7('0x2c')][_0xb8e7('0x2d')],function(_0x46d93e){return{'name':_0x46d93e[_0xb8e7('0x2e')],'type':_0x46d93e[_0xb8e7('0x2f')][_0xb8e7('0x30')]};});_0x3d7c8d[_0xb8e7('0x31')]=_[_0xb8e7('0x32')](_0x27861f,_0xb8e7('0x29'));_0x3d7c8d[_0xb8e7('0x33')]=_[_0xb8e7('0x34')](_0xb59957['query']);_0x3d7c8d[_0xb8e7('0x35')]=_[_0xb8e7('0x36')](_0x3d7c8d[_0xb8e7('0x31')],_0x3d7c8d[_0xb8e7('0x33')]);_0xae4fe9[_0xb8e7('0x37')]=_[_0xb8e7('0x36')](_0x3d7c8d[_0xb8e7('0x31')],qs[_0xb8e7('0x38')](_0xb59957[_0xb8e7('0x33')][_0xb8e7('0x38')]));_0xae4fe9[_0xb8e7('0x37')]=_0xae4fe9[_0xb8e7('0x37')][_0xb8e7('0x39')]?_0xae4fe9[_0xb8e7('0x37')]:_0x3d7c8d[_0xb8e7('0x31')];if(!_0xb59957[_0xb8e7('0x33')][_0xb8e7('0x3a')](_0xb8e7('0x3b'))){_0xae4fe9[_0xb8e7('0x21')]=qs['limit'](_0xb59957['query'][_0xb8e7('0x21')]);_0xae4fe9['offset']=qs[_0xb8e7('0x20')](_0xb59957[_0xb8e7('0x33')]['offset']);}_0xae4fe9['order']=qs[_0xb8e7('0x3c')](_0xb59957[_0xb8e7('0x33')]['sort']);_0xae4fe9['where']=qs['filters'](_[_0xb8e7('0x3d')](_0xb59957[_0xb8e7('0x33')],_0x3d7c8d[_0xb8e7('0x35')]));if(_0xb59957['query'][_0xb8e7('0x3e')]){_0xae4fe9[_0xb8e7('0x3f')]=_['merge'](_0xae4fe9[_0xb8e7('0x3f')],{'$or':_[_0xb8e7('0x32')](_0x27861f,function(_0x24c2ca){if(_0x24c2ca[_0xb8e7('0x2f')]!==_0xb8e7('0x40')){var _0xc6fdac={};_0xc6fdac[_0x24c2ca[_0xb8e7('0x29')]]={'$like':'%'+_0xb59957[_0xb8e7('0x33')][_0xb8e7('0x3e')]+'%'};return _0xc6fdac;}})});}_0xae4fe9=_[_0xb8e7('0x41')]({},_0xae4fe9,_0xb59957[_0xb8e7('0x42')]);var _0x1c7edf={'where':_0xae4fe9[_0xb8e7('0x3f')]};return db[_0xb8e7('0x2c')][_0xb8e7('0x43')](_0x1c7edf)[_0xb8e7('0x26')](function(_0x2298b0){_0x3e55fc[_0xb8e7('0x43')]=_0x2298b0;if(_0xb59957[_0xb8e7('0x33')][_0xb8e7('0x44')]){_0xae4fe9[_0xb8e7('0x45')]=[{'all':!![]}];}return db[_0xb8e7('0x2c')][_0xb8e7('0x46')](_0xae4fe9);})[_0xb8e7('0x26')](function(_0x1ee668){_0x3e55fc[_0xb8e7('0x47')]=_0x1ee668;return _0x3e55fc;})[_0xb8e7('0x26')](respondWithFilteredResult(_0x5d1ef2,_0xae4fe9))[_0xb8e7('0x48')](handleError(_0x5d1ef2,null));};exports[_0xb8e7('0x49')]=function(_0x468720,_0x23b90d){var _0x13e7a5={'raw':!![],'where':{'id':_0x468720[_0xb8e7('0x4a')]['id']}},_0x2c7dd7={};_0x2c7dd7[_0xb8e7('0x31')]=_[_0xb8e7('0x34')](db[_0xb8e7('0x2c')][_0xb8e7('0x2d')]);_0x2c7dd7[_0xb8e7('0x33')]=_[_0xb8e7('0x34')](_0x468720[_0xb8e7('0x33')]);_0x2c7dd7[_0xb8e7('0x35')]=_['intersection'](_0x2c7dd7[_0xb8e7('0x31')],_0x2c7dd7[_0xb8e7('0x33')]);_0x13e7a5[_0xb8e7('0x37')]=_['intersection'](_0x2c7dd7[_0xb8e7('0x31')],qs[_0xb8e7('0x38')](_0x468720[_0xb8e7('0x33')][_0xb8e7('0x38')]));_0x13e7a5[_0xb8e7('0x37')]=_0x13e7a5[_0xb8e7('0x37')][_0xb8e7('0x39')]?_0x13e7a5[_0xb8e7('0x37')]:_0x2c7dd7[_0xb8e7('0x31')];if(_0x468720['query'][_0xb8e7('0x44')]){_0x13e7a5[_0xb8e7('0x45')]=[{'all':!![]}];}_0x13e7a5=_[_0xb8e7('0x41')]({},_0x13e7a5,_0x468720[_0xb8e7('0x42')]);return db['ChatInternalMessage']['find'](_0x13e7a5)['then'](handleEntityNotFound(_0x23b90d,null))['then'](respondWithResult(_0x23b90d,null))['catch'](handleError(_0x23b90d,null));};exports[_0xb8e7('0x4b')]=function(_0x502176,_0x36349f){return db[_0xb8e7('0x2c')][_0xb8e7('0x4b')](_0x502176[_0xb8e7('0x4c')],{})[_0xb8e7('0x26')](respondWithResult(_0x36349f,0xc9))['catch'](handleError(_0x36349f,null));};exports[_0xb8e7('0x25')]=function(_0x59cf29,_0x1cc3ed){if(_0x59cf29[_0xb8e7('0x4c')]['id']){delete _0x59cf29['body']['id'];}return db[_0xb8e7('0x2c')][_0xb8e7('0x4d')]({'where':{'id':_0x59cf29['params']['id']}})[_0xb8e7('0x26')](handleEntityNotFound(_0x1cc3ed,null))[_0xb8e7('0x26')](saveUpdates(_0x59cf29[_0xb8e7('0x4c')],null))['then'](respondWithResult(_0x1cc3ed,null))[_0xb8e7('0x48')](handleError(_0x1cc3ed,null));};exports[_0xb8e7('0x4e')]=function(_0x5785f8,_0x3f1907){return db[_0xb8e7('0x2c')][_0xb8e7('0x4d')]({'where':{'id':_0x5785f8['params']['id']}})[_0xb8e7('0x26')](handleEntityNotFound(_0x3f1907,null))[_0xb8e7('0x26')](removeEntity(_0x3f1907,null))['catch'](handleError(_0x3f1907,null));};exports['describe']=function(_0x2da740,_0x149605){return db[_0xb8e7('0x2c')][_0xb8e7('0x4f')]()[_0xb8e7('0x26')](respondWithResult(_0x149605,null))[_0xb8e7('0x48')](handleError(_0x149605,null));};function wrapUser(_0x231971){return function(_0x101723){var _0x332628=_0x231971[_0xb8e7('0x50')]({'plain':!![]});_0x332628[_0xb8e7('0x51')]=[];if(_0x101723){_0x332628[_0xb8e7('0x52')]=_0x101723[_0xb8e7('0x53')];_0x332628[_0xb8e7('0x54')]=_0x101723;}else{_0x332628[_0xb8e7('0x52')]=moment(0x0)[_0xb8e7('0x55')](_0xb8e7('0x56'));_0x332628['lastMessage']={};}return _0x332628;};}exports[_0xb8e7('0x57')]=function(_0x7e4635,_0x1cfac1,_0x1e2ebc){var _0xd1032b=[];return db['User'][_0xb8e7('0x46')]({'where':{'role':[_0xb8e7('0x58'),_0xb8e7('0x59'),'user']},'attributes':['id',_0xb8e7('0x5a'),_0xb8e7('0x29'),_0xb8e7('0x5b'),_0xb8e7('0x5c'),_0xb8e7('0x5d'),_0xb8e7('0x5e'),_0xb8e7('0x5f'),_0xb8e7('0x60'),_0xb8e7('0x61')],'order':qs[_0xb8e7('0x3c')](_0xb8e7('0x62')),'include':[{'model':db[_0xb8e7('0x63')],'as':_0xb8e7('0x64'),'attributes':['id',_0xb8e7('0x29'),_0xb8e7('0x2f')],'through':{'attributes':[]}}]})[_0xb8e7('0x26')](function(_0x3fe89c){if(_0x3fe89c){var _0x1ea860=_0x7e4635[_0xb8e7('0x65')][_0xb8e7('0x50')]({'plain':!![]});if(!_0x1ea860)throw new Error(_0xb8e7('0x66'));if(_0x1ea860['role']===_0xb8e7('0x65')){return db['UserProfileSection'][_0xb8e7('0x4d')]({'where':{'name':_0xb8e7('0x67'),'userProfileId':_0x1ea860[_0xb8e7('0x68')]},'raw':!![]})['then'](function(_0x5e6637){if(_0x5e6637){if(_0x5e6637[_0xb8e7('0x69')]===0x0){return db[_0xb8e7('0x6a')][_0xb8e7('0x46')]({'where':{'sectionId':_0x5e6637['id']},'raw':!![]})[_0xb8e7('0x26')](function(_0x22670d){var _0x4163fa=[];if(_[_0xb8e7('0x6b')](_0x22670d)){_0x4163fa=_[_0xb8e7('0x3e')](_0x3fe89c,function(_0x4122de){if(_0x4122de[_0xb8e7('0x5b')]!==_0xb8e7('0x58')){return _0x4122de;}});return _0x4163fa;}else{for(var _0x8d0349=0x0;_0x8d0349<_0x3fe89c['length'];_0x8d0349++){var _0x4a8762=_0x3fe89c[_0x8d0349];if(_0x4a8762[_0xb8e7('0x5b')]===_0xb8e7('0x58')){var _0x388c55=_['find'](_0x22670d,function(_0x111883){return _0x111883[_0xb8e7('0x6c')]===_0x4a8762['id'];});if(_0x388c55)_0x4163fa['push'](_0x4a8762);}else{_0x4163fa[_0xb8e7('0x6d')](_0x4a8762);}}return _0x4163fa;}});}else{return _0x3fe89c;}}else{var _0xc33d43=_[_0xb8e7('0x3e')](_0x3fe89c,function(_0x21d430){if(_0x21d430[_0xb8e7('0x5b')]!==_0xb8e7('0x58')){return _0x21d430;}});return _0xc33d43;}});}else{return _0x3fe89c;}}})[_0xb8e7('0x26')](function(_0x1cd52a){var _0x3ea831=[];if(_0x1cd52a){_0xd1032b=_0x1cd52a;for(var _0x360274=0x0;_0x360274<_0x1cd52a[_0xb8e7('0x39')];_0x360274+=0x1){_0xd1032b[_0x360274][_0xb8e7('0x51')]=[];_0x3ea831[_0xb8e7('0x6d')](db[_0xb8e7('0x2c')][_0xb8e7('0x4d')]({'where':{'FromId':[_0x7e4635[_0xb8e7('0x65')]['id'],_0x1cd52a[_0x360274]['id']],'ToId':[_0x7e4635[_0xb8e7('0x65')]['id'],_0x1cd52a[_0x360274]['id']],'ChatGroupId':null},'attributes':['id',_0xb8e7('0x53'),'FromId','ToId',_0xb8e7('0x6e'),_0xb8e7('0x4c')],'order':qs[_0xb8e7('0x3c')](_0xb8e7('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xb8e7('0x26')](wrapUser(_0x1cd52a[_0x360274])));}return BPromise[_0xb8e7('0x70')](_0x3ea831);}return[];})['then'](function(_0x354466){return{'rows':_0x354466,'count':_0x354466[_0xb8e7('0x39')]};})[_0xb8e7('0x26')](respondWithResult(_0x1cfac1,null))[_0xb8e7('0x48')](handleError(_0x1cfac1,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 3f98446..d31e331 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 _0xc03e=['hasOwnProperty','hook','exports','events','setMaxListeners','update','emit'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc03e,0x15a));var _0xec03=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0xc03e[_0x56825b];return _0x69ce77;};'use strict';var EventEmitter=require(_0xec03('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xec03('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xec03('0x2'),'afterDestroy':'remove'};function emitEvent(_0xfed10f){return function(_0x269001,_0x3e3a78,_0x194e54){ChatInternalMessageEvents[_0xec03('0x3')](_0xfed10f+':'+_0x269001['id'],_0x269001);ChatInternalMessageEvents[_0xec03('0x3')](_0xfed10f,_0x269001);_0x194e54(null);};}for(var e in events){if(events[_0xec03('0x4')](e)){var event=events[e];ChatInternalMessage[_0xec03('0x5')](e,emitEvent(event));}}module[_0xec03('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x31af=['ChatInternalMessage','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4266b4,_0x4859ad){var _0x1442aa=function(_0x21f8c1){while(--_0x21f8c1){_0x4266b4['push'](_0x4266b4['shift']());}};_0x1442aa(++_0x4859ad);}(_0x31af,0xde));var _0xf31a=function(_0x2b4e1a,_0x267da0){_0x2b4e1a=_0x2b4e1a-0x0;var _0x1ee43c=_0x31af[_0x2b4e1a];return _0x1ee43c;};'use strict';var EventEmitter=require(_0xf31a('0x0'));var ChatInternalMessage=require(_0xf31a('0x1'))['db'][_0xf31a('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf31a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3b7976){return function(_0x1853d7,_0x820362,_0x245db8){ChatInternalMessageEvents['emit'](_0x3b7976+':'+_0x1853d7['id'],_0x1853d7);ChatInternalMessageEvents[_0xf31a('0x4')](_0x3b7976,_0x1853d7);_0x245db8(null);};}for(var e in events){if(events[_0xf31a('0x5')](e)){var event=events[e];ChatInternalMessage[_0xf31a('0x6')](e,emitEvent(event));}}module[_0xf31a('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 5737610..80f6185 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 _0xac4a=['bluebird','rimraf','../../config/environment','./chatInternalMessage.attributes','define','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x407bd8,_0x277add){var _0x20b6c9=function(_0x215b6c){while(--_0x215b6c){_0x407bd8['push'](_0x407bd8['shift']());}};_0x20b6c9(++_0x277add);}(_0xac4a,0x13f));var _0xaac4=function(_0x53257b,_0x2e5536){_0x53257b=_0x53257b-0x0;var _0x48b92a=_0xac4a[_0x53257b];return _0x48b92a;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var moment=require(_0xaac4('0x4'));var BPromise=require(_0xaac4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var attributes=require(_0xaac4('0x8'));module['exports']=function(_0x1283a5,_0x53d03a){return _0x1283a5[_0xaac4('0x9')]('ChatInternalMessage',attributes,{'tableName':_0xaac4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaac4('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0713=['../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3c2b2e,_0x3e6e53){var _0x27a338=function(_0x40d29d){while(--_0x40d29d){_0x3c2b2e['push'](_0x3c2b2e['shift']());}};_0x27a338(++_0x3e6e53);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3071('0xc'),'collate':_0x3071('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index d54524d..a74110c 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 _0xad22=['request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x36250a,_0x3e2e72){var _0x43a5eb=function(_0x448663){while(--_0x448663){_0x36250a['push'](_0x36250a['shift']());}};_0x43a5eb(++_0x3e2e72);}(_0xad22,0x1bd));var _0x2ad2=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0xad22[_0x2e249d];return _0x1faa37;};'use strict';var _=require(_0x2ad2('0x0'));var util=require(_0x2ad2('0x1'));var moment=require(_0x2ad2('0x2'));var BPromise=require(_0x2ad2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ad2('0x4'));var db=require(_0x2ad2('0x5'))['db'];var utils=require(_0x2ad2('0x6'));var logger=require(_0x2ad2('0x7'))(_0x2ad2('0x8'));var config=require(_0x2ad2('0x9'));var jayson=require(_0x2ad2('0xa'));var client=jayson[_0x2ad2('0xb')][_0x2ad2('0xc')]({'port':0x232a});config['redis']=_[_0x2ad2('0xd')](config[_0x2ad2('0xe')],{'host':_0x2ad2('0xf'),'port':0x18eb});var socket=require(_0x2ad2('0x10'))(new Redis(config[_0x2ad2('0xe')]));require(_0x2ad2('0x11'))[_0x2ad2('0x12')](socket);function respondWithRpcPromise(_0x108964,_0x4f1e0f,_0x385cd7){return new BPromise(function(_0x100f32,_0x374228){return client[_0x2ad2('0x13')](_0x108964,_0x385cd7)['then'](function(_0x49f5ca){logger[_0x2ad2('0x14')](_0x2ad2('0x15'),_0x4f1e0f,_0x2ad2('0x16'));logger[_0x2ad2('0x17')](_0x2ad2('0x18'),_0x4f1e0f,'request\x20sent',JSON['stringify'](_0x49f5ca));if(_0x49f5ca[_0x2ad2('0x19')]){if(_0x49f5ca[_0x2ad2('0x19')]['code']===0x1f4){logger[_0x2ad2('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x4f1e0f,_0x49f5ca['error'][_0x2ad2('0x1a')]);return _0x374228(_0x49f5ca['error'][_0x2ad2('0x1a')]);}logger[_0x2ad2('0x19')](_0x2ad2('0x15'),_0x4f1e0f,_0x49f5ca[_0x2ad2('0x19')][_0x2ad2('0x1a')]);return _0x100f32(_0x49f5ca[_0x2ad2('0x19')]['message']);}else{logger[_0x2ad2('0x14')](_0x2ad2('0x15'),_0x4f1e0f,_0x2ad2('0x16'));_0x100f32(_0x49f5ca[_0x2ad2('0x1b')][_0x2ad2('0x1a')]);}})[_0x2ad2('0x1c')](function(_0x157f49){logger['error'](_0x2ad2('0x15'),_0x4f1e0f,_0x157f49);_0x374228(_0x157f49);});});} \ No newline at end of file +var _0x4a64=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4b68bc,_0x46cb1a){var _0x1b8a15=function(_0xe0b6a4){while(--_0xe0b6a4){_0x4b68bc['push'](_0x4b68bc['shift']());}};_0x1b8a15(++_0x46cb1a);}(_0x4a64,0x172));var _0x44a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4a64[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x44a6('0x0'));var util=require(_0x44a6('0x1'));var moment=require(_0x44a6('0x2'));var BPromise=require('bluebird');var rs=require(_0x44a6('0x3'));var fs=require('fs');var Redis=require(_0x44a6('0x4'));var db=require(_0x44a6('0x5'))['db'];var utils=require(_0x44a6('0x6'));var logger=require(_0x44a6('0x7'))(_0x44a6('0x8'));var config=require(_0x44a6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x44a6('0xa')][_0x44a6('0xb')]({'port':0x232a});config[_0x44a6('0xc')]=_[_0x44a6('0xd')](config[_0x44a6('0xc')],{'host':_0x44a6('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44a6('0xc')]));require(_0x44a6('0xf'))[_0x44a6('0x10')](socket);function respondWithRpcPromise(_0x568902,_0x42b583,_0x45476f){return new BPromise(function(_0x203a2d,_0xbf72c7){return client['request'](_0x568902,_0x45476f)['then'](function(_0x20c562){logger[_0x44a6('0x11')](_0x44a6('0x12'),_0x42b583,_0x44a6('0x13'));logger[_0x44a6('0x14')](_0x44a6('0x15'),_0x42b583,_0x44a6('0x13'),JSON[_0x44a6('0x16')](_0x20c562));if(_0x20c562[_0x44a6('0x17')]){if(_0x20c562['error'][_0x44a6('0x18')]===0x1f4){logger[_0x44a6('0x17')](_0x44a6('0x12'),_0x42b583,_0x20c562[_0x44a6('0x17')][_0x44a6('0x19')]);return _0xbf72c7(_0x20c562[_0x44a6('0x17')][_0x44a6('0x19')]);}logger[_0x44a6('0x17')](_0x44a6('0x12'),_0x42b583,_0x20c562[_0x44a6('0x17')][_0x44a6('0x19')]);return _0x203a2d(_0x20c562['error'][_0x44a6('0x19')]);}else{logger[_0x44a6('0x11')](_0x44a6('0x12'),_0x42b583,_0x44a6('0x13'));_0x203a2d(_0x20c562[_0x44a6('0x1a')]['message']);}})[_0x44a6('0x1b')](function(_0xbe8c4b){logger['error'](_0x44a6('0x12'),_0x42b583,_0xbe8c4b);_0xbf72c7(_0xbe8c4b);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 38cff53..b63ee8a 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 _0xe186=['register','chatInternalMessage:','./chatInternalMessage.events','save','update','emit'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe186,0x146));var _0x6e18=function(_0x34fa6b,_0x2e06c3){_0x34fa6b=_0x34fa6b-0x0;var _0x1e8b18=_0xe186[_0x34fa6b];return _0x1e8b18;};'use strict';var ChatInternalMessageEvents=require(_0x6e18('0x0'));var events=[_0x6e18('0x1'),'remove',_0x6e18('0x2')];function createListener(_0xc09e8a,_0xf8a6e3){return function(_0xadd322){_0xf8a6e3[_0x6e18('0x3')](_0xc09e8a,_0xadd322);};}function removeListener(_0x4b7198,_0x1d3480){return function(){ChatInternalMessageEvents['removeListener'](_0x4b7198,_0x1d3480);};}exports[_0x6e18('0x4')]=function(_0x1bafb5){for(var _0x1b9e15=0x0,_0x5a2ae3=events['length'];_0x1b9e15<_0x5a2ae3;_0x1b9e15++){var _0x30a65b=events[_0x1b9e15];var _0x508982=createListener(_0x6e18('0x5')+_0x30a65b,_0x1bafb5);ChatInternalMessageEvents['on'](_0x30a65b,_0x508982);}}; \ No newline at end of file +var _0x1782=['update','chatInternalMessage:','./chatInternalMessage.events','remove'];(function(_0xbdcdef,_0x399e49){var _0x4ad89e=function(_0x2e32b9){while(--_0x2e32b9){_0xbdcdef['push'](_0xbdcdef['shift']());}};_0x4ad89e(++_0x399e49);}(_0x1782,0x13e));var _0x2178=function(_0x33aadc,_0x49a9c9){_0x33aadc=_0x33aadc-0x0;var _0x11c521=_0x1782[_0x33aadc];return _0x11c521;};'use strict';var ChatInternalMessageEvents=require(_0x2178('0x0'));var events=['save',_0x2178('0x1'),_0x2178('0x2')];function createListener(_0x1df52d,_0x1c92e6){return function(_0x17b0da){_0x1c92e6['emit'](_0x1df52d,_0x17b0da);};}function removeListener(_0x601378,_0x1659a1){return function(){ChatInternalMessageEvents['removeListener'](_0x601378,_0x1659a1);};}exports['register']=function(_0x3c4dd1){for(var _0x3b0f74=0x0,_0x50ad34=events['length'];_0x3b0f74<_0x50ad34;_0x3b0f74++){var _0x4cf22a=events[_0x3b0f74];var _0x3b4115=createListener(_0x2178('0x3')+_0x4cf22a,_0x3c4dd1);ChatInternalMessageEvents['on'](_0x4cf22a,_0x3b4115);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index a75a184..ae91dd2 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 _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','put','update','delete'];(function(_0x39ff2e,_0x2eae85){var _0x513d28=function(_0x34bcb7){while(--_0x34bcb7){_0x39ff2e['push'](_0x39ff2e['shift']());}};_0x513d28(++_0x2eae85);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['get'](_0x3071('0xe'),auth[_0x3071('0x8')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')]('/',auth[_0x3071('0x8')](),controller['create']);router[_0x3071('0x11')](_0x3071('0xe'),controller[_0x3071('0x12')]);router[_0x3071('0x13')](_0x3071('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x3071('0x14')]=router; \ No newline at end of file +var _0xb7e7=['exports','multer','path','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','/describe','isAuthenticated','/users','getUsers','/:id','post','create','put','update','delete'];(function(_0x267364,_0xb38cb7){var _0x19c6f2=function(_0x463dc9){while(--_0x463dc9){_0x267364['push'](_0x267364['shift']());}};_0x19c6f2(++_0xb38cb7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xb7e7[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0xc')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0xb'),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['destroy']);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 340de16..bab8fe6 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 _0x457c=['medium','BOOLEAN','ENUM','DATE','sequelize','exports','TEXT'];(function(_0x2073f8,_0x34a29d){var _0x11c069=function(_0x1c49ab){while(--_0x1c49ab){_0x2073f8['push'](_0x2073f8['shift']());}};_0x11c069(++_0x34a29d);}(_0x457c,0x97));var _0xc457=function(_0x2b4b82,_0x2602fa){_0x2b4b82=_0x2b4b82-0x0;var _0x3ea07f=_0x457c[_0x2b4b82];return _0x3ea07f;};'use strict';var Sequelize=require(_0xc457('0x0'));module[_0xc457('0x1')]={'body':{'type':Sequelize[_0xc457('0x2')](_0xc457('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc457('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc457('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc457('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xc457('0x6')]}}; \ No newline at end of file +var _0xf854=['medium','BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0xf854,0xed));var _0x4f85=function(_0x3df16e,_0x35746b){_0x3df16e=_0x3df16e-0x0;var _0xd54577=_0xf854[_0x3df16e];return _0xd54577;};'use strict';var Sequelize=require(_0x4f85('0x0'));module[_0x4f85('0x1')]={'body':{'type':Sequelize[_0x4f85('0x2')](_0x4f85('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4f85('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4f85('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4f85('0x5')]('in',_0x4f85('0x6')),'defaultValue':_0x4f85('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4f85('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 16cb129..c29209b 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 _0xec9b=['set','Content-Range','json','apply','reject','save','then','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','ChatMessage','count','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','ChatInteraction','ChatInteractionId','update','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','test','ValidationError','request','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','offset','limit'];(function(_0x166451,_0x404979){var _0x5ebf44=function(_0x6b55d6){while(--_0x6b55d6){_0x166451['push'](_0x166451['shift']());}};_0x5ebf44(++_0x404979);}(_0xec9b,0x144));var _0xbec9=function(_0x27a3cb,_0x4af597){_0x27a3cb=_0x27a3cb-0x0;var _0x54ff38=_0xec9b[_0x27a3cb];return _0x54ff38;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbec9('0x0'));var rimraf=require(_0xbec9('0x1'));var zipdir=require(_0xbec9('0x2'));var jsonpatch=require(_0xbec9('0x3'));var rp=require('request-promise');var moment=require(_0xbec9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbec9('0x5'));var util=require('util');var path=require(_0xbec9('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xbec9('0x7'));var squel=require(_0xbec9('0x8'));var crypto=require('crypto');var jsforce=require(_0xbec9('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xbec9('0xa'));var querystring=require('querystring');var Papa=require(_0xbec9('0xb'));var Redis=require(_0xbec9('0xc'));var authService=require(_0xbec9('0xd'));var qs=require(_0xbec9('0xe'));var as=require(_0xbec9('0xf'));var hardwareService=require(_0xbec9('0x10'));var logger=require(_0xbec9('0x11'))(_0xbec9('0x12'));var utils=require('../../config/utils');var config=require(_0xbec9('0x13'));var db=require(_0xbec9('0x14'))['db'];config[_0xbec9('0x15')]=_[_0xbec9('0x16')](config['redis'],{'host':_0xbec9('0x17'),'port':0x18eb});var socket=require(_0xbec9('0x18'))(new Redis(config['redis']));require(_0xbec9('0x19'))['register'](socket);var jayson=require(_0xbec9('0x1a'));var client=jayson[_0xbec9('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xbec9('0x1b')][_0xbec9('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x56bd35,_0x2145a4,_0x4aa279){if(_0x4aa279){var _0x36e3f7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x36e3f7[_0xbec9('0x1d')](_0x2145a4)){return _0x56bd35;}else{throw new db['Sequelize'][(_0xbec9('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x56bd35;}}function respondWithRpcPromise(_0x37dfe7,_0x152523,_0x22e12e,_0x334556){return new BPromise(function(_0x3839fa,_0x3eb6d0){var _0x245531=_0x334556||client;return _0x245531[_0xbec9('0x1f')](_0x37dfe7,_0x22e12e)['then'](function(_0x13b7d8){logger[_0xbec9('0x20')](_0xbec9('0x21'),_0x152523,'request\x20sent');logger[_0xbec9('0x22')](_0xbec9('0x23'),_0x152523,_0xbec9('0x24'),JSON[_0xbec9('0x25')](_0x13b7d8));if(_0x13b7d8[_0xbec9('0x26')]){if(_0x13b7d8[_0xbec9('0x26')][_0xbec9('0x27')]===0x1f4){logger[_0xbec9('0x26')](_0xbec9('0x21'),_0x152523,_0x13b7d8[_0xbec9('0x26')][_0xbec9('0x28')]);return _0x3eb6d0(_0x13b7d8[_0xbec9('0x26')][_0xbec9('0x28')]);}logger[_0xbec9('0x26')]('ChatMessage,\x20%s,\x20%s',_0x152523,_0x13b7d8[_0xbec9('0x26')]['message']);return _0x3839fa(_0x13b7d8[_0xbec9('0x26')][_0xbec9('0x28')]);}else{logger[_0xbec9('0x20')](_0xbec9('0x21'),_0x152523,_0xbec9('0x24'));_0x3839fa(_0x13b7d8[_0xbec9('0x29')]['message']);}})['catch'](function(_0x34d6d7){logger['error']('ChatMessage,\x20%s,\x20%s',_0x152523,_0x34d6d7);_0x3eb6d0(_0x34d6d7);});});}function respondWithStatusCode(_0x21a420,_0x279a68){_0x279a68=_0x279a68||0xcc;return function(_0x2d4e61){if(_0x2d4e61){return _0x21a420['sendStatus'](_0x279a68);}return _0x21a420[_0xbec9('0x2a')](_0x279a68)['end']();};}function respondWithResult(_0x528282,_0x10a882){_0x10a882=_0x10a882||0xc8;return function(_0x18996d){if(_0x18996d){return _0x528282[_0xbec9('0x2a')](_0x10a882)['json'](_0x18996d);}};}function respondWithFilteredResult(_0x108147,_0x528551){return function(_0x5e4744){if(_0x5e4744){var _0x56ce9f=_0x5e4744['count'],_0x1e2a45=_0x528551[_0xbec9('0x2b')],_0x49327b=_0x528551[_0xbec9('0x2b')]+_0x528551[_0xbec9('0x2c')],_0x443201;if(_0x49327b>=_0x56ce9f){_0x49327b=_0x56ce9f;_0x443201=0xc8;}else{_0x443201=0xce;}_0x108147['status'](_0x443201);return _0x108147[_0xbec9('0x2d')](_0xbec9('0x2e'),_0x1e2a45+'-'+_0x49327b+'/'+_0x56ce9f)[_0xbec9('0x2f')](_0x5e4744);}return null;};}function patchUpdates(_0x5bab68){return function(_0x28396c){try{jsonpatch[_0xbec9('0x30')](_0x28396c,_0x5bab68,!![]);}catch(_0x4bebc8){return BPromise[_0xbec9('0x31')](_0x4bebc8);}return _0x28396c[_0xbec9('0x32')]();};}function saveUpdates(_0x6966e8,_0x28bed2){return function(_0x588046){if(_0x588046){return _0x588046['update'](_0x6966e8)[_0xbec9('0x33')](function(_0x42067e){return _0x42067e;});}return null;};}function removeEntity(_0x295bc1,_0x1bfecf){return function(_0x3a7ba6){if(_0x3a7ba6){return _0x3a7ba6[_0xbec9('0x34')]()['then'](function(){_0x295bc1[_0xbec9('0x2a')](0xcc)[_0xbec9('0x35')]();});}};}function handleEntityNotFound(_0x3e2ca7,_0x3424f8){return function(_0x3ebea2){if(!_0x3ebea2){_0x3e2ca7[_0xbec9('0x36')](0x194);}return _0x3ebea2;};}function handleError(_0x42aa7d,_0x30b7a2){_0x30b7a2=_0x30b7a2||0x1f4;return function(_0x589c3e){logger[_0xbec9('0x26')](_0x589c3e[_0xbec9('0x37')]);if(_0x589c3e['name']){delete _0x589c3e[_0xbec9('0x38')];}_0x42aa7d[_0xbec9('0x2a')](_0x30b7a2)[_0xbec9('0x39')](_0x589c3e);};}exports[_0xbec9('0x3a')]=function(_0x2a2b14,_0x564175){var _0x511556={},_0x5d5bdd={},_0x1b4936={'count':0x0,'rows':[]};var _0x104db5=_[_0xbec9('0x3b')](db['ChatMessage'][_0xbec9('0x3c')],function(_0x3e8a77){return{'name':_0x3e8a77[_0xbec9('0x3d')],'type':_0x3e8a77[_0xbec9('0x3e')]['key']};});_0x5d5bdd[_0xbec9('0x3f')]=_[_0xbec9('0x3b')](_0x104db5,_0xbec9('0x38'));_0x5d5bdd[_0xbec9('0x40')]=_[_0xbec9('0x41')](_0x2a2b14['query']);_0x5d5bdd[_0xbec9('0x42')]=_[_0xbec9('0x43')](_0x5d5bdd[_0xbec9('0x3f')],_0x5d5bdd['query']);_0x511556['attributes']=_[_0xbec9('0x43')](_0x5d5bdd[_0xbec9('0x3f')],qs['fields'](_0x2a2b14[_0xbec9('0x40')][_0xbec9('0x44')]));_0x511556[_0xbec9('0x45')]=_0x511556[_0xbec9('0x45')][_0xbec9('0x46')]?_0x511556[_0xbec9('0x45')]:_0x5d5bdd[_0xbec9('0x3f')];if(!_0x2a2b14[_0xbec9('0x40')]['hasOwnProperty'](_0xbec9('0x47'))){_0x511556[_0xbec9('0x2c')]=qs['limit'](_0x2a2b14[_0xbec9('0x40')][_0xbec9('0x2c')]);_0x511556['offset']=qs[_0xbec9('0x2b')](_0x2a2b14[_0xbec9('0x40')]['offset']);}_0x511556['order']=qs['sort'](_0x2a2b14[_0xbec9('0x40')][_0xbec9('0x48')]);_0x511556[_0xbec9('0x49')]=qs[_0xbec9('0x42')](_[_0xbec9('0x4a')](_0x2a2b14[_0xbec9('0x40')],_0x5d5bdd[_0xbec9('0x42')]));if(_0x2a2b14['query']['filter']){_0x511556[_0xbec9('0x49')]=_['merge'](_0x511556[_0xbec9('0x49')],{'$or':_[_0xbec9('0x3b')](_0x104db5,function(_0x41bbc4){if(_0x41bbc4[_0xbec9('0x3e')]!==_0xbec9('0x4b')){var _0x22dd21={};_0x22dd21[_0x41bbc4[_0xbec9('0x38')]]={'$like':'%'+_0x2a2b14[_0xbec9('0x40')][_0xbec9('0x4c')]+'%'};return _0x22dd21;}})});}_0x511556=_[_0xbec9('0x4d')]({},_0x511556,_0x2a2b14[_0xbec9('0x4e')]);var _0x18ead6={'where':_0x511556[_0xbec9('0x49')]};return db[_0xbec9('0x4f')][_0xbec9('0x50')](_0x18ead6)[_0xbec9('0x33')](function(_0xe723f4){_0x1b4936[_0xbec9('0x50')]=_0xe723f4;if(_0x2a2b14[_0xbec9('0x40')][_0xbec9('0x51')]){_0x511556['include']=[{'all':!![]}];}return db[_0xbec9('0x4f')][_0xbec9('0x52')](_0x511556);})[_0xbec9('0x33')](function(_0x415fe8){_0x1b4936[_0xbec9('0x53')]=_0x415fe8;return _0x1b4936;})[_0xbec9('0x33')](respondWithFilteredResult(_0x564175,_0x511556))[_0xbec9('0x54')](handleError(_0x564175,null));};exports[_0xbec9('0x55')]=function(_0x3e180f,_0x4096f3){var _0x5679c5={'raw':!![],'where':{'id':_0x3e180f[_0xbec9('0x56')]['id']}},_0x55d254={};_0x55d254['model']=_[_0xbec9('0x41')](db[_0xbec9('0x4f')][_0xbec9('0x3c')]);_0x55d254[_0xbec9('0x40')]=_['keys'](_0x3e180f[_0xbec9('0x40')]);_0x55d254['filters']=_[_0xbec9('0x43')](_0x55d254[_0xbec9('0x3f')],_0x55d254[_0xbec9('0x40')]);_0x5679c5[_0xbec9('0x45')]=_[_0xbec9('0x43')](_0x55d254['model'],qs[_0xbec9('0x44')](_0x3e180f[_0xbec9('0x40')][_0xbec9('0x44')]));_0x5679c5['attributes']=_0x5679c5['attributes']['length']?_0x5679c5[_0xbec9('0x45')]:_0x55d254[_0xbec9('0x3f')];if(_0x3e180f[_0xbec9('0x40')][_0xbec9('0x51')]){_0x5679c5[_0xbec9('0x57')]=[{'all':!![]}];}_0x5679c5=_[_0xbec9('0x4d')]({},_0x5679c5,_0x3e180f['options']);return db[_0xbec9('0x4f')][_0xbec9('0x58')](_0x5679c5)[_0xbec9('0x33')](handleEntityNotFound(_0x4096f3,null))[_0xbec9('0x33')](respondWithResult(_0x4096f3,null))[_0xbec9('0x54')](handleError(_0x4096f3,null));};exports[_0xbec9('0x59')]=function(_0x5a3f41,_0xcb978a){return db[_0xbec9('0x4f')][_0xbec9('0x59')](_0x5a3f41[_0xbec9('0x5a')],{})[_0xbec9('0x33')](respondWithResult(_0xcb978a,0xc9))['catch'](handleError(_0xcb978a,null));};exports['update']=function(_0x4105fe,_0x2291b5){if(_0x4105fe[_0xbec9('0x5a')]['id']){delete _0x4105fe['body']['id'];}return db[_0xbec9('0x4f')][_0xbec9('0x58')]({'where':{'id':_0x4105fe[_0xbec9('0x56')]['id']}})[_0xbec9('0x33')](handleEntityNotFound(_0x2291b5,null))[_0xbec9('0x33')](saveUpdates(_0x4105fe[_0xbec9('0x5a')],null))[_0xbec9('0x33')](respondWithResult(_0x2291b5,null))['catch'](handleError(_0x2291b5,null));};exports['destroy']=function(_0x1de699,_0x47e17d){return db[_0xbec9('0x4f')][_0xbec9('0x58')]({'where':{'id':_0x1de699[_0xbec9('0x56')]['id']}})[_0xbec9('0x33')](handleEntityNotFound(_0x47e17d,null))['then'](removeEntity(_0x47e17d,null))[_0xbec9('0x54')](handleError(_0x47e17d,null));};exports['describe']=function(_0xf0c83a,_0x42d3fc){return db[_0xbec9('0x4f')][_0xbec9('0x5b')]()[_0xbec9('0x33')](respondWithResult(_0x42d3fc,null))[_0xbec9('0x54')](handleError(_0x42d3fc,null));};var interaction_log=require('../../config/logger')(_0xbec9('0x5c'));exports[_0xbec9('0x5d')]=function(_0x7c7d51,_0xedc48e,_0x24cb42){var _0xaf3429={'channel':_0xbec9('0x5e')};if(_0x7c7d51[_0xbec9('0x5a')]['id']){delete _0x7c7d51[_0xbec9('0x5a')]['id'];}_0x7c7d51[_0xbec9('0x5a')][_0xbec9('0x5f')]=!![];_0x7c7d51[_0xbec9('0x5a')][_0xbec9('0x60')]=moment()[_0xbec9('0x61')](_0xbec9('0x62'));_0x7c7d51['body']['UserId']=_0x7c7d51['body'][_0xbec9('0x63')]||_0x7c7d51[_0xbec9('0x64')]['id'];return db[_0xbec9('0x4f')][_0xbec9('0x58')]({'where':{'id':_0x7c7d51[_0xbec9('0x56')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xbec9('0x65')}]})['then'](handleEntityNotFound(_0xedc48e,null))[_0xbec9('0x33')](saveUpdates(_0x7c7d51[_0xbec9('0x5a')],null))[_0xbec9('0x33')](function(_0x22b6e3){if(_0x22b6e3){_0xaf3429[_0xbec9('0x28')]=_0x22b6e3[_0xbec9('0x66')]({'plain':!![]});return db[_0xbec9('0x67')][_0xbec9('0x58')]({'where':{'id':_0x22b6e3[_0xbec9('0x68')]}});}return null;})[_0xbec9('0x33')](handleEntityNotFound(_0xedc48e,null))[_0xbec9('0x33')](function(_0x328a06){if(_0x328a06){return _0x328a06[_0xbec9('0x69')]({'UserId':_0x7c7d51[_0xbec9('0x5a')]['UserId'],'read1stAt':_['isNil'](_0x328a06[_0xbec9('0x6a')])?moment()[_0xbec9('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xbec9('0x33')](function(_0x396b99){if(_0x396b99){_0xaf3429[_0xbec9('0x6b')]=_0x396b99[_0xbec9('0x66')]({'plain':!![]});interaction_log[_0xbec9('0x20')](_0xbec9('0x6c'),_0x7c7d51[_0xbec9('0x64')]['id'],_0x7c7d51['user']['name'],_0x7c7d51[_0xbec9('0x64')][_0xbec9('0x6d')],_0xaf3429[_0xbec9('0x6b')]['id'],_0x7c7d51[_0xbec9('0x5a')]?JSON['stringify'](_0x7c7d51[_0xbec9('0x5a')]):_0xbec9('0x6e'));return respondWithRpcPromise(_0xbec9('0x6f'),_0xbec9('0x70'),_0xaf3429);}return null;})['then'](function(_0x480066){if(_0x480066){if(_0x7c7d51[_0xbec9('0x5a')][_0xbec9('0x71')]){_0xaf3429[_0xbec9('0x28')][_0xbec9('0x72')]=util[_0xbec9('0x61')](_0xbec9('0x73'),_0x7c7d51[_0xbec9('0x64')]['name']);_0xaf3429[_0xbec9('0x28')][_0xbec9('0x74')]=_0xaf3429['channel'];_0xaf3429[_0xbec9('0x28')][_0xbec9('0x75')]=_0xbec9('0x5d');return respondWithRpcPromise(_0xbec9('0x76'),_0xbec9('0x76'),{'event':'acceptmessage','message':_[_0xbec9('0x4d')](_0xaf3429[_0xbec9('0x28')],JSON['parse'](_0xaf3429[_0xbec9('0x6b')][_0xbec9('0x77')]))},client9002)['then'](function(){return _0xaf3429;});}return _0xaf3429;}return null;})[_0xbec9('0x33')](respondWithResult(_0xedc48e,null))[_0xbec9('0x54')](handleError(_0xedc48e,null));};var interaction_log=require(_0xbec9('0x11'))(_0xbec9('0x5c'));exports[_0xbec9('0x31')]=function(_0x153016,_0x27c43d,_0x27e5de){var _0x920b31={'agent':{},'channel':_0xbec9('0x5e')};if(_0x153016[_0xbec9('0x5a')]['id']){delete _0x153016['body']['id'];}_0x153016['body'][_0xbec9('0x63')]=_0x153016['body'][_0xbec9('0x63')]||_0x153016[_0xbec9('0x64')]['id'];_0x920b31['agent']['id']=_0x153016['body'][_0xbec9('0x63')];return db[_0xbec9('0x4f')]['find']({'where':{'id':_0x153016[_0xbec9('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x27c43d,null))[_0xbec9('0x33')](function(_0x243f5a){if(_0x243f5a){_0x920b31[_0xbec9('0x28')]=_0x243f5a[_0xbec9('0x66')]({'plain':!![]});return db[_0xbec9('0x67')][_0xbec9('0x58')]({'where':{'id':_0x243f5a['ChatInteractionId']}});}return null;})[_0xbec9('0x33')](handleEntityNotFound(_0x27c43d,null))[_0xbec9('0x33')](function(_0x1ef231){if(_0x1ef231){_0x920b31[_0xbec9('0x6b')]=_0x1ef231[_0xbec9('0x66')]({'plain':!![]});interaction_log['info'](_0xbec9('0x78'),_0x153016[_0xbec9('0x64')]['id'],_0x153016['user'][_0xbec9('0x38')],_0x153016[_0xbec9('0x64')][_0xbec9('0x6d')],_0x920b31['interaction']['id'],_0x153016['body']?JSON[_0xbec9('0x25')](_0x153016[_0xbec9('0x5a')]):_0xbec9('0x6e'));return respondWithRpcPromise('RejectMessage',_0xbec9('0x79'),_0x920b31);}return null;})[_0xbec9('0x33')](function(_0x36d866){if(_0x36d866){_0x36d866['message'][_0xbec9('0x72')]=util[_0xbec9('0x61')](_0xbec9('0x73'),_0x153016['user'][_0xbec9('0x38')]);_0x36d866['message'][_0xbec9('0x74')]=_0x920b31[_0xbec9('0x74')];_0x36d866[_0xbec9('0x28')][_0xbec9('0x75')]=_0xbec9('0x31');respondWithRpcPromise(_0xbec9('0x76'),_0xbec9('0x76'),{'event':_0xbec9('0x7a'),'message':_0x36d866[_0xbec9('0x28')]},client9002);return _0x920b31;}return null;})[_0xbec9('0x33')](respondWithResult(_0x27c43d,null))[_0xbec9('0x54')](handleError(_0x27c43d,null));}; \ No newline at end of file +var _0x1ce5=['update','body','describe','chat-interactions','accept','chat','read','readAt','format','UserId','user','Contact','ChatInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','manual','interface','SIP/%s','EventManager','acceptmessage','parse','formData','../../config/logger','agent','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','channel','event','rejectmessage','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','destroy','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','options','include','findAll','show','params','includeAll','merge','find','create'];(function(_0xbd5cd8,_0x1c4828){var _0x3af56d=function(_0x2be1a2){while(--_0x2be1a2){_0xbd5cd8['push'](_0xbd5cd8['shift']());}};_0x3af56d(++_0x1c4828);}(_0x1ce5,0x1a8));var _0x51ce=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x1ce5[_0x255d5b];return _0x3e141a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x51ce('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x51ce('0x1'));var rp=require(_0x51ce('0x2'));var moment=require(_0x51ce('0x3'));var BPromise=require(_0x51ce('0x4'));var Mustache=require(_0x51ce('0x5'));var util=require(_0x51ce('0x6'));var path=require(_0x51ce('0x7'));var sox=require(_0x51ce('0x8'));var csv=require(_0x51ce('0x9'));var ejs=require(_0x51ce('0xa'));var fs=require('fs');var _=require(_0x51ce('0xb'));var squel=require(_0x51ce('0xc'));var crypto=require(_0x51ce('0xd'));var jsforce=require(_0x51ce('0xe'));var deskjs=require(_0x51ce('0xf'));var toCsv=require(_0x51ce('0x9'));var querystring=require(_0x51ce('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x51ce('0x11'));var qs=require(_0x51ce('0x12'));var as=require(_0x51ce('0x13'));var hardwareService=require(_0x51ce('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x51ce('0x15'));var config=require(_0x51ce('0x16'));var db=require(_0x51ce('0x17'))['db'];config[_0x51ce('0x18')]=_['defaults'](config[_0x51ce('0x18')],{'host':_0x51ce('0x19'),'port':0x18eb});var socket=require(_0x51ce('0x1a'))(new Redis(config['redis']));require(_0x51ce('0x1b'))['register'](socket);var jayson=require(_0x51ce('0x1c'));var client=jayson[_0x51ce('0x1d')][_0x51ce('0x1e')]({'port':0x232c});var client9002=jayson[_0x51ce('0x1d')][_0x51ce('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x5e4470,_0x337eb6,_0x33c48d){if(_0x33c48d){var _0x4afdc0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4afdc0[_0x51ce('0x1f')](_0x337eb6)){return _0x5e4470;}else{throw new db['Sequelize'][(_0x51ce('0x20'))](_0x51ce('0x21'));}}else{return _0x5e4470;}}function respondWithRpcPromise(_0x3e38ec,_0x514bee,_0x60be02,_0x553c5d){return new BPromise(function(_0x22fc8e,_0x1a5322){var _0x18606a=_0x553c5d||client;return _0x18606a[_0x51ce('0x22')](_0x3e38ec,_0x60be02)[_0x51ce('0x23')](function(_0x5bb26c){logger[_0x51ce('0x24')](_0x51ce('0x25'),_0x514bee,_0x51ce('0x26'));logger[_0x51ce('0x27')](_0x51ce('0x28'),_0x514bee,_0x51ce('0x26'),JSON[_0x51ce('0x29')](_0x5bb26c));if(_0x5bb26c[_0x51ce('0x2a')]){if(_0x5bb26c['error'][_0x51ce('0x2b')]===0x1f4){logger[_0x51ce('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x514bee,_0x5bb26c[_0x51ce('0x2a')]['message']);return _0x1a5322(_0x5bb26c[_0x51ce('0x2a')][_0x51ce('0x2c')]);}logger['error'](_0x51ce('0x25'),_0x514bee,_0x5bb26c[_0x51ce('0x2a')][_0x51ce('0x2c')]);return _0x22fc8e(_0x5bb26c[_0x51ce('0x2a')][_0x51ce('0x2c')]);}else{logger[_0x51ce('0x24')]('ChatMessage,\x20%s,\x20%s',_0x514bee,_0x51ce('0x26'));_0x22fc8e(_0x5bb26c[_0x51ce('0x2d')][_0x51ce('0x2c')]);}})[_0x51ce('0x2e')](function(_0x445b7d){logger[_0x51ce('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x514bee,_0x445b7d);_0x1a5322(_0x445b7d);});});}function respondWithStatusCode(_0xa3923c,_0xea5a7f){_0xea5a7f=_0xea5a7f||0xcc;return function(_0x286eb7){if(_0x286eb7){return _0xa3923c[_0x51ce('0x2f')](_0xea5a7f);}return _0xa3923c[_0x51ce('0x30')](_0xea5a7f)[_0x51ce('0x31')]();};}function respondWithResult(_0x2f2721,_0x4cf22c){_0x4cf22c=_0x4cf22c||0xc8;return function(_0x25ec6b){if(_0x25ec6b){return _0x2f2721[_0x51ce('0x30')](_0x4cf22c)[_0x51ce('0x32')](_0x25ec6b);}};}function respondWithFilteredResult(_0xc1b048,_0x5ead3a){return function(_0x2efa68){if(_0x2efa68){var _0x10ba1f=_0x2efa68[_0x51ce('0x33')],_0x586430=_0x5ead3a[_0x51ce('0x34')],_0x28dc88=_0x5ead3a[_0x51ce('0x34')]+_0x5ead3a['limit'],_0x5df94c;if(_0x28dc88>=_0x10ba1f){_0x28dc88=_0x10ba1f;_0x5df94c=0xc8;}else{_0x5df94c=0xce;}_0xc1b048['status'](_0x5df94c);return _0xc1b048[_0x51ce('0x35')](_0x51ce('0x36'),_0x586430+'-'+_0x28dc88+'/'+_0x10ba1f)[_0x51ce('0x32')](_0x2efa68);}return null;};}function patchUpdates(_0x36d7f8){return function(_0x2fa4ef){try{jsonpatch[_0x51ce('0x37')](_0x2fa4ef,_0x36d7f8,!![]);}catch(_0x65a301){return BPromise[_0x51ce('0x38')](_0x65a301);}return _0x2fa4ef[_0x51ce('0x39')]();};}function saveUpdates(_0x1c4490,_0x432e9b){return function(_0x44abde){if(_0x44abde){return _0x44abde['update'](_0x1c4490)[_0x51ce('0x23')](function(_0x454659){return _0x454659;});}return null;};}function removeEntity(_0x3e7a90,_0x247847){return function(_0x2a67dd){if(_0x2a67dd){return _0x2a67dd[_0x51ce('0x3a')]()[_0x51ce('0x23')](function(){_0x3e7a90[_0x51ce('0x30')](0xcc)[_0x51ce('0x31')]();});}};}function handleEntityNotFound(_0x528436,_0x6c225a){return function(_0x598043){if(!_0x598043){_0x528436[_0x51ce('0x2f')](0x194);}return _0x598043;};}function handleError(_0x10e45e,_0x1f0567){_0x1f0567=_0x1f0567||0x1f4;return function(_0x2df7f5){logger[_0x51ce('0x2a')](_0x2df7f5['stack']);if(_0x2df7f5['name']){delete _0x2df7f5[_0x51ce('0x3b')];}_0x10e45e[_0x51ce('0x30')](_0x1f0567)[_0x51ce('0x3c')](_0x2df7f5);};}exports[_0x51ce('0x3d')]=function(_0x651dae,_0xdcfbf5){var _0x4bb548={},_0x4c34a5={},_0x56badd={'count':0x0,'rows':[]};var _0x1ddcbd=_[_0x51ce('0x3e')](db[_0x51ce('0x3f')][_0x51ce('0x40')],function(_0x475dba){return{'name':_0x475dba[_0x51ce('0x41')],'type':_0x475dba[_0x51ce('0x42')][_0x51ce('0x43')]};});_0x4c34a5[_0x51ce('0x44')]=_['map'](_0x1ddcbd,'name');_0x4c34a5[_0x51ce('0x45')]=_[_0x51ce('0x46')](_0x651dae[_0x51ce('0x45')]);_0x4c34a5[_0x51ce('0x47')]=_[_0x51ce('0x48')](_0x4c34a5[_0x51ce('0x44')],_0x4c34a5['query']);_0x4bb548[_0x51ce('0x49')]=_['intersection'](_0x4c34a5[_0x51ce('0x44')],qs[_0x51ce('0x4a')](_0x651dae['query'][_0x51ce('0x4a')]));_0x4bb548[_0x51ce('0x49')]=_0x4bb548[_0x51ce('0x49')][_0x51ce('0x4b')]?_0x4bb548['attributes']:_0x4c34a5[_0x51ce('0x44')];if(!_0x651dae['query'][_0x51ce('0x4c')]('nolimit')){_0x4bb548[_0x51ce('0x4d')]=qs[_0x51ce('0x4d')](_0x651dae[_0x51ce('0x45')][_0x51ce('0x4d')]);_0x4bb548[_0x51ce('0x34')]=qs['offset'](_0x651dae['query'][_0x51ce('0x34')]);}_0x4bb548[_0x51ce('0x4e')]=qs[_0x51ce('0x4f')](_0x651dae[_0x51ce('0x45')][_0x51ce('0x4f')]);_0x4bb548['where']=qs['filters'](_[_0x51ce('0x50')](_0x651dae[_0x51ce('0x45')],_0x4c34a5[_0x51ce('0x47')]));if(_0x651dae['query'][_0x51ce('0x51')]){_0x4bb548[_0x51ce('0x52')]=_['merge'](_0x4bb548[_0x51ce('0x52')],{'$or':_['map'](_0x1ddcbd,function(_0x5c6bd8){if(_0x5c6bd8['type']!=='VIRTUAL'){var _0xecf34e={};_0xecf34e[_0x5c6bd8[_0x51ce('0x3b')]]={'$like':'%'+_0x651dae['query'][_0x51ce('0x51')]+'%'};return _0xecf34e;}})});}_0x4bb548=_['merge']({},_0x4bb548,_0x651dae[_0x51ce('0x53')]);var _0x3d18d5={'where':_0x4bb548[_0x51ce('0x52')]};return db[_0x51ce('0x3f')][_0x51ce('0x33')](_0x3d18d5)[_0x51ce('0x23')](function(_0x419e9d){_0x56badd[_0x51ce('0x33')]=_0x419e9d;if(_0x651dae[_0x51ce('0x45')]['includeAll']){_0x4bb548[_0x51ce('0x54')]=[{'all':!![]}];}return db[_0x51ce('0x3f')][_0x51ce('0x55')](_0x4bb548);})[_0x51ce('0x23')](function(_0x406450){_0x56badd['rows']=_0x406450;return _0x56badd;})[_0x51ce('0x23')](respondWithFilteredResult(_0xdcfbf5,_0x4bb548))[_0x51ce('0x2e')](handleError(_0xdcfbf5,null));};exports[_0x51ce('0x56')]=function(_0x2f5536,_0x50200c){var _0x3cd8e4={'raw':!![],'where':{'id':_0x2f5536[_0x51ce('0x57')]['id']}},_0x5b40e1={};_0x5b40e1['model']=_[_0x51ce('0x46')](db[_0x51ce('0x3f')][_0x51ce('0x40')]);_0x5b40e1['query']=_[_0x51ce('0x46')](_0x2f5536[_0x51ce('0x45')]);_0x5b40e1[_0x51ce('0x47')]=_[_0x51ce('0x48')](_0x5b40e1['model'],_0x5b40e1[_0x51ce('0x45')]);_0x3cd8e4['attributes']=_[_0x51ce('0x48')](_0x5b40e1[_0x51ce('0x44')],qs[_0x51ce('0x4a')](_0x2f5536[_0x51ce('0x45')][_0x51ce('0x4a')]));_0x3cd8e4['attributes']=_0x3cd8e4[_0x51ce('0x49')]['length']?_0x3cd8e4['attributes']:_0x5b40e1[_0x51ce('0x44')];if(_0x2f5536['query'][_0x51ce('0x58')]){_0x3cd8e4[_0x51ce('0x54')]=[{'all':!![]}];}_0x3cd8e4=_[_0x51ce('0x59')]({},_0x3cd8e4,_0x2f5536[_0x51ce('0x53')]);return db[_0x51ce('0x3f')][_0x51ce('0x5a')](_0x3cd8e4)[_0x51ce('0x23')](handleEntityNotFound(_0x50200c,null))[_0x51ce('0x23')](respondWithResult(_0x50200c,null))[_0x51ce('0x2e')](handleError(_0x50200c,null));};exports[_0x51ce('0x5b')]=function(_0x7d6402,_0x76942b){return db[_0x51ce('0x3f')]['create'](_0x7d6402['body'],{})['then'](respondWithResult(_0x76942b,0xc9))['catch'](handleError(_0x76942b,null));};exports[_0x51ce('0x5c')]=function(_0x535d35,_0x480371){if(_0x535d35['body']['id']){delete _0x535d35[_0x51ce('0x5d')]['id'];}return db[_0x51ce('0x3f')][_0x51ce('0x5a')]({'where':{'id':_0x535d35[_0x51ce('0x57')]['id']}})[_0x51ce('0x23')](handleEntityNotFound(_0x480371,null))[_0x51ce('0x23')](saveUpdates(_0x535d35[_0x51ce('0x5d')],null))[_0x51ce('0x23')](respondWithResult(_0x480371,null))[_0x51ce('0x2e')](handleError(_0x480371,null));};exports[_0x51ce('0x3a')]=function(_0x3aac2e,_0x30ba00){return db[_0x51ce('0x3f')][_0x51ce('0x5a')]({'where':{'id':_0x3aac2e[_0x51ce('0x57')]['id']}})['then'](handleEntityNotFound(_0x30ba00,null))[_0x51ce('0x23')](removeEntity(_0x30ba00,null))[_0x51ce('0x2e')](handleError(_0x30ba00,null));};exports[_0x51ce('0x5e')]=function(_0x1558ea,_0xc3fad8){return db[_0x51ce('0x3f')][_0x51ce('0x5e')]()[_0x51ce('0x23')](respondWithResult(_0xc3fad8,null))[_0x51ce('0x2e')](handleError(_0xc3fad8,null));};var interaction_log=require('../../config/logger')(_0x51ce('0x5f'));exports[_0x51ce('0x60')]=function(_0x16f877,_0x519c52,_0x8959ff){var _0x5d79c2={'channel':_0x51ce('0x61')};if(_0x16f877['body']['id']){delete _0x16f877[_0x51ce('0x5d')]['id'];}_0x16f877[_0x51ce('0x5d')][_0x51ce('0x62')]=!![];_0x16f877[_0x51ce('0x5d')][_0x51ce('0x63')]=moment()[_0x51ce('0x64')]('YYYY-MM-DD\x20HH:mm:ss');_0x16f877['body'][_0x51ce('0x65')]=_0x16f877[_0x51ce('0x5d')][_0x51ce('0x65')]||_0x16f877[_0x51ce('0x66')]['id'];return db[_0x51ce('0x3f')][_0x51ce('0x5a')]({'where':{'id':_0x16f877[_0x51ce('0x57')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x51ce('0x67')}]})['then'](handleEntityNotFound(_0x519c52,null))[_0x51ce('0x23')](saveUpdates(_0x16f877[_0x51ce('0x5d')],null))[_0x51ce('0x23')](function(_0x4bb821){if(_0x4bb821){_0x5d79c2[_0x51ce('0x2c')]=_0x4bb821['get']({'plain':!![]});return db[_0x51ce('0x68')][_0x51ce('0x5a')]({'where':{'id':_0x4bb821['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x519c52,null))[_0x51ce('0x23')](function(_0x2e6e14){if(_0x2e6e14){return _0x2e6e14[_0x51ce('0x5c')]({'UserId':_0x16f877[_0x51ce('0x5d')]['UserId'],'read1stAt':_[_0x51ce('0x69')](_0x2e6e14['read1stAt'])?moment()['format'](_0x51ce('0x6a')):undefined});}return null;})[_0x51ce('0x23')](function(_0x3eb13e){if(_0x3eb13e){_0x5d79c2[_0x51ce('0x6b')]=_0x3eb13e[_0x51ce('0x6c')]({'plain':!![]});interaction_log[_0x51ce('0x24')](_0x51ce('0x6d'),_0x16f877[_0x51ce('0x66')]['id'],_0x16f877[_0x51ce('0x66')][_0x51ce('0x3b')],_0x16f877[_0x51ce('0x66')][_0x51ce('0x6e')],_0x5d79c2[_0x51ce('0x6b')]['id'],_0x16f877[_0x51ce('0x5d')]?JSON[_0x51ce('0x29')](_0x16f877['body']):_0x51ce('0x6f'));return respondWithRpcPromise('AcceptMessage',_0x51ce('0x70'),_0x5d79c2);}return null;})[_0x51ce('0x23')](function(_0x1d08c5){if(_0x1d08c5){if(_0x16f877[_0x51ce('0x5d')][_0x51ce('0x71')]){_0x5d79c2[_0x51ce('0x2c')][_0x51ce('0x72')]=util[_0x51ce('0x64')](_0x51ce('0x73'),_0x16f877[_0x51ce('0x66')]['name']);_0x5d79c2['message']['channel']=_0x5d79c2['channel'];_0x5d79c2[_0x51ce('0x2c')]['event']=_0x51ce('0x60');return respondWithRpcPromise('EventManager',_0x51ce('0x74'),{'event':_0x51ce('0x75'),'message':_[_0x51ce('0x59')](_0x5d79c2[_0x51ce('0x2c')],JSON[_0x51ce('0x76')](_0x5d79c2[_0x51ce('0x6b')][_0x51ce('0x77')]))},client9002)[_0x51ce('0x23')](function(){return _0x5d79c2;});}return _0x5d79c2;}return null;})[_0x51ce('0x23')](respondWithResult(_0x519c52,null))[_0x51ce('0x2e')](handleError(_0x519c52,null));};var interaction_log=require(_0x51ce('0x78'))(_0x51ce('0x5f'));exports[_0x51ce('0x38')]=function(_0x39f048,_0x4a9c94,_0x488d0c){var _0x188d3d={'agent':{},'channel':_0x51ce('0x61')};if(_0x39f048[_0x51ce('0x5d')]['id']){delete _0x39f048[_0x51ce('0x5d')]['id'];}_0x39f048[_0x51ce('0x5d')][_0x51ce('0x65')]=_0x39f048[_0x51ce('0x5d')][_0x51ce('0x65')]||_0x39f048[_0x51ce('0x66')]['id'];_0x188d3d[_0x51ce('0x79')]['id']=_0x39f048[_0x51ce('0x5d')][_0x51ce('0x65')];return db[_0x51ce('0x3f')]['find']({'where':{'id':_0x39f048[_0x51ce('0x57')]['id'],'UserId':null}})[_0x51ce('0x23')](handleEntityNotFound(_0x4a9c94,null))[_0x51ce('0x23')](function(_0x1f9f40){if(_0x1f9f40){_0x188d3d['message']=_0x1f9f40[_0x51ce('0x6c')]({'plain':!![]});return db['ChatInteraction'][_0x51ce('0x5a')]({'where':{'id':_0x1f9f40[_0x51ce('0x7a')]}});}return null;})[_0x51ce('0x23')](handleEntityNotFound(_0x4a9c94,null))[_0x51ce('0x23')](function(_0x2c9d6c){if(_0x2c9d6c){_0x188d3d[_0x51ce('0x6b')]=_0x2c9d6c['get']({'plain':!![]});interaction_log[_0x51ce('0x24')](_0x51ce('0x7b'),_0x39f048[_0x51ce('0x66')]['id'],_0x39f048['user'][_0x51ce('0x3b')],_0x39f048[_0x51ce('0x66')]['role'],_0x188d3d[_0x51ce('0x6b')]['id'],_0x39f048[_0x51ce('0x5d')]?JSON[_0x51ce('0x29')](_0x39f048[_0x51ce('0x5d')]):'null');return respondWithRpcPromise(_0x51ce('0x7c'),_0x51ce('0x7d'),_0x188d3d);}return null;})[_0x51ce('0x23')](function(_0x3eab24){if(_0x3eab24){_0x3eab24[_0x51ce('0x2c')][_0x51ce('0x72')]=util[_0x51ce('0x64')](_0x51ce('0x73'),_0x39f048[_0x51ce('0x66')][_0x51ce('0x3b')]);_0x3eab24['message']['channel']=_0x188d3d[_0x51ce('0x7e')];_0x3eab24[_0x51ce('0x2c')][_0x51ce('0x7f')]=_0x51ce('0x38');respondWithRpcPromise(_0x51ce('0x74'),_0x51ce('0x74'),{'event':_0x51ce('0x80'),'message':_0x3eab24[_0x51ce('0x2c')]},client9002);return _0x188d3d;}return null;})['then'](respondWithResult(_0x4a9c94,null))[_0x51ce('0x2e')](handleError(_0x4a9c94,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 08fa1f7..6f620ba 100644 --- a/server/api/chatMessage/chatMessage.events.js +++ b/server/api/chatMessage/chatMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c02=['ChatMessage','setMaxListeners','save','update','remove','emit','hook','../../mysqldb'];(function(_0x594ec5,_0x34c07d){var _0x4f6d33=function(_0x4e9ced){while(--_0x4e9ced){_0x594ec5['push'](_0x594ec5['shift']());}};_0x4f6d33(++_0x34c07d);}(_0x6c02,0x1c7));var _0x26c0=function(_0xfd0116,_0x7472fb){_0xfd0116=_0xfd0116-0x0;var _0x537e1a=_0x6c02[_0xfd0116];return _0x537e1a;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x26c0('0x0'))['db'][_0x26c0('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x26c0('0x2')](0x0);var events={'afterCreate':_0x26c0('0x3'),'afterUpdate':_0x26c0('0x4'),'afterDestroy':_0x26c0('0x5')};function emitEvent(_0x5b680b){return function(_0x3e7915,_0x2a5dbb,_0x3dae5b){ChatMessageEvents[_0x26c0('0x6')](_0x5b680b+':'+_0x3e7915['id'],_0x3e7915);ChatMessageEvents[_0x26c0('0x6')](_0x5b680b,_0x3e7915);_0x3dae5b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x26c0('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x540b=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x5d35f7,_0x529c06){var _0x242f1d=function(_0x2047c3){while(--_0x2047c3){_0x5d35f7['push'](_0x5d35f7['shift']());}};_0x242f1d(++_0x529c06);}(_0x540b,0x83));var _0xb540=function(_0x263601,_0x200523){_0x263601=_0x263601-0x0;var _0x23e63a=_0x540b[_0x263601];return _0x23e63a;};'use strict';var EventEmitter=require(_0xb540('0x0'));var ChatMessage=require(_0xb540('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb540('0x2')](0x0);var events={'afterCreate':_0xb540('0x3'),'afterUpdate':'update','afterDestroy':_0xb540('0x4')};function emitEvent(_0x412392){return function(_0x4bb2b0,_0x2f0249,_0x52c195){ChatMessageEvents[_0xb540('0x5')](_0x412392+':'+_0x4bb2b0['id'],_0x4bb2b0);ChatMessageEvents[_0xb540('0x5')](_0x412392,_0x4bb2b0);_0x52c195(null);};}for(var e in events){if(events[_0xb540('0x6')](e)){var event=events[e];ChatMessage[_0xb540('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 09ca85f..1da38a6 100644 --- a/server/api/chatMessage/chatMessage.model.js +++ b/server/api/chatMessage/chatMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2934=['out','secret','isNil','UserId','findOne','then','update','error','lodash','api','path','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase'];(function(_0x5d16a2,_0x31bac3){var _0x597906=function(_0x3371ae){while(--_0x3371ae){_0x5d16a2['push'](_0x5d16a2['shift']());}};_0x597906(++_0x31bac3);}(_0x2934,0x104));var _0x4293=function(_0x39a4b2,_0x411e7a){_0x39a4b2=_0x39a4b2-0x0;var _0x189f01=_0x2934[_0x39a4b2];return _0x189f01;};'use strict';var _=require(_0x4293('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4293('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4293('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4293('0x3'));module[_0x4293('0x4')]=function(_0x2f664c,_0x39381d){return _0x2f664c[_0x4293('0x5')]('ChatMessage',attributes,{'tableName':_0x4293('0x6'),'paranoid':![],'indexes':[{'name':_0x4293('0x7'),'fields':[_0x4293('0x8')],'type':_0x4293('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xb65391,_0x12495a,_0x5bfa6e){var _0x15b9eb=_0x2f664c[_0x4293('0xa')];var _0x4465f2=_0xb65391['get']({'plain':!![]});if(_0x4465f2[_0x4293('0xb')][_0x4293('0xc')]()==='in'||_0x4465f2[_0x4293('0xb')][_0x4293('0xc')]()===_0x4293('0xd')&&!_0x4465f2[_0x4293('0xe')]&&!_[_0x4293('0xf')](_0x4465f2[_0x4293('0x10')])){_0x15b9eb['ChatInteraction'][_0x4293('0x11')]({'where':{'id':_0x4465f2['ChatInteractionId']}})[_0x4293('0x12')](function(_0x2e55dd){if(_0x2e55dd){_0x2e55dd[_0x4293('0x13')]({'lastMsgAt':_0x4465f2['createdAt'],'lastMsgDirection':_0x4465f2[_0x4293('0xb')][_0x4293('0xc')]()});}})['catch'](function(_0x5b10f3){console[_0x4293('0x14')](_0x5b10f3);});}_0x5bfa6e();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x08a6=['chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','findOne','ChatInteractionId','then','update','catch','error','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatMessage'];(function(_0x378100,_0x39e192){var _0x5e6d95=function(_0x4e820d){while(--_0x4e820d){_0x378100['push'](_0x378100['shift']());}};_0x5e6d95(++_0x39e192);}(_0x08a6,0x17d));var _0x608a=function(_0x2a7210,_0x2f3d23){_0x2a7210=_0x2a7210-0x0;var _0x460766=_0x08a6[_0x2a7210];return _0x460766;};'use strict';var _=require(_0x608a('0x0'));var util=require('util');var logger=require(_0x608a('0x1'))(_0x608a('0x2'));var moment=require(_0x608a('0x3'));var BPromise=require(_0x608a('0x4'));var rp=require(_0x608a('0x5'));var fs=require('fs');var path=require(_0x608a('0x6'));var rimraf=require(_0x608a('0x7'));var config=require(_0x608a('0x8'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x2101c6,_0xa299ad){return _0x2101c6[_0x608a('0x9')](_0x608a('0xa'),attributes,{'tableName':_0x608a('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x608a('0xc')],'type':_0x608a('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x470ba8,_0x2f4ee9,_0x526d05){var _0x8795c9=_0x2101c6[_0x608a('0xe')];var _0x454b63=_0x470ba8[_0x608a('0xf')]({'plain':!![]});if(_0x454b63[_0x608a('0x10')]['toLowerCase']()==='in'||_0x454b63[_0x608a('0x10')][_0x608a('0x11')]()==='out'&&!_0x454b63[_0x608a('0x12')]&&!_[_0x608a('0x13')](_0x454b63[_0x608a('0x14')])){_0x8795c9['ChatInteraction'][_0x608a('0x15')]({'where':{'id':_0x454b63[_0x608a('0x16')]}})[_0x608a('0x17')](function(_0x8a1686){if(_0x8a1686){_0x8a1686[_0x608a('0x18')]({'lastMsgAt':_0x454b63['createdAt'],'lastMsgDirection':_0x454b63[_0x608a('0x10')][_0x608a('0x11')]()});}})[_0x608a('0x19')](function(_0x293e89){console[_0x608a('0x1a')](_0x293e89);});}_0x526d05();}},'charset':_0x608a('0x1b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 67a639d..a4705b3 100644 --- a/server/api/chatMessage/chatMessage.rpc.js +++ b/server/api/chatMessage/chatMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa49b=['ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','request','info','request\x20sent','debug'];(function(_0x2532a8,_0x3f4440){var _0x4fb7f3=function(_0x1d0778){while(--_0x1d0778){_0x2532a8['push'](_0x2532a8['shift']());}};_0x4fb7f3(++_0x3f4440);}(_0xa49b,0x138));var _0xba49=function(_0x532139,_0x2749c1){_0x532139=_0x532139-0x0;var _0x4be495=_0xa49b[_0x532139];return _0x4be495;};'use strict';var _=require(_0xba49('0x0'));var util=require(_0xba49('0x1'));var moment=require(_0xba49('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba49('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xba49('0x4'));var logger=require(_0xba49('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xba49('0x6'));var client=jayson[_0xba49('0x7')][_0xba49('0x8')]({'port':0x232a});config['redis']=_[_0xba49('0x9')](config[_0xba49('0xa')],{'host':_0xba49('0xb'),'port':0x18eb});var socket=require(_0xba49('0xc'))(new Redis(config[_0xba49('0xa')]));require(_0xba49('0xd'))['register'](socket);function respondWithRpcPromise(_0x26c34e,_0x12d7df,_0x435e72){return new BPromise(function(_0x48dc17,_0x89da32){return client[_0xba49('0xe')](_0x26c34e,_0x435e72)['then'](function(_0x571fdc){logger[_0xba49('0xf')]('ChatMessage,\x20%s,\x20%s',_0x12d7df,_0xba49('0x10'));logger[_0xba49('0x11')](_0xba49('0x12'),_0x12d7df,'request\x20sent',JSON['stringify'](_0x571fdc));if(_0x571fdc['error']){if(_0x571fdc[_0xba49('0x13')][_0xba49('0x14')]===0x1f4){logger[_0xba49('0x13')](_0xba49('0x15'),_0x12d7df,_0x571fdc[_0xba49('0x13')][_0xba49('0x16')]);return _0x89da32(_0x571fdc[_0xba49('0x13')][_0xba49('0x16')]);}logger[_0xba49('0x13')]('ChatMessage,\x20%s,\x20%s',_0x12d7df,_0x571fdc['error'][_0xba49('0x16')]);return _0x48dc17(_0x571fdc[_0xba49('0x13')][_0xba49('0x16')]);}else{logger[_0xba49('0xf')](_0xba49('0x15'),_0x12d7df,_0xba49('0x10'));_0x48dc17(_0x571fdc[_0xba49('0x17')][_0xba49('0x16')]);}})[_0xba49('0x18')](function(_0x3a3b18){logger['error'](_0xba49('0x15'),_0x12d7df,_0x3a3b18);_0x89da32(_0x3a3b18);});});}exports[_0xba49('0x19')]=function(_0x106ccf){var _0x49bf81=this;return new Promise(function(_0x1c6d8d,_0x438ef4){return db[_0xba49('0x1a')][_0xba49('0x1b')](_0x106ccf[_0xba49('0x1c')],{'raw':_0x106ccf[_0xba49('0x1d')]?_0x106ccf[_0xba49('0x1d')][_0xba49('0x1e')]===undefined?!![]:![]:!![]})[_0xba49('0x1f')](function(_0x15b04f){logger[_0xba49('0xf')](_0xba49('0x19'),_0x106ccf);logger[_0xba49('0x11')](_0xba49('0x19'),_0x106ccf,JSON[_0xba49('0x20')](_0x15b04f));_0x1c6d8d(_0x15b04f);})['catch'](function(_0x4b6c29){logger[_0xba49('0x13')](_0xba49('0x19'),_0x4b6c29[_0xba49('0x16')],_0x106ccf);_0x438ef4(_0x49bf81['error'](0x1f4,_0x4b6c29[_0xba49('0x16')]));});});}; \ No newline at end of file +var _0xc22f=['localhost','socket.io-emitter','./chatMessage.socket','register','request','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x2bdba7,_0x24f2c3){var _0x283dfe=function(_0x1065dc){while(--_0x1065dc){_0x2bdba7['push'](_0x2bdba7['shift']());}};_0x283dfe(++_0x24f2c3);}(_0xc22f,0xbf));var _0xfc22=function(_0x422957,_0x6df95c){_0x422957=_0x422957-0x0;var _0x2b8cc5=_0xc22f[_0x422957];return _0x2b8cc5;};'use strict';var _=require(_0xfc22('0x0'));var util=require(_0xfc22('0x1'));var moment=require(_0xfc22('0x2'));var BPromise=require(_0xfc22('0x3'));var rs=require(_0xfc22('0x4'));var fs=require('fs');var Redis=require(_0xfc22('0x5'));var db=require(_0xfc22('0x6'))['db'];var utils=require(_0xfc22('0x7'));var logger=require(_0xfc22('0x8'))(_0xfc22('0x9'));var config=require(_0xfc22('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfc22('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfc22('0xc')],{'host':_0xfc22('0xd'),'port':0x18eb});var socket=require(_0xfc22('0xe'))(new Redis(config[_0xfc22('0xc')]));require(_0xfc22('0xf'))[_0xfc22('0x10')](socket);function respondWithRpcPromise(_0x17fd71,_0x20d356,_0x535d1d){return new BPromise(function(_0x322e50,_0x3445e5){return client[_0xfc22('0x11')](_0x17fd71,_0x535d1d)['then'](function(_0x5d48e7){logger['info'](_0xfc22('0x12'),_0x20d356,_0xfc22('0x13'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x20d356,_0xfc22('0x13'),JSON[_0xfc22('0x14')](_0x5d48e7));if(_0x5d48e7['error']){if(_0x5d48e7[_0xfc22('0x15')][_0xfc22('0x16')]===0x1f4){logger[_0xfc22('0x15')](_0xfc22('0x12'),_0x20d356,_0x5d48e7[_0xfc22('0x15')][_0xfc22('0x17')]);return _0x3445e5(_0x5d48e7['error'][_0xfc22('0x17')]);}logger[_0xfc22('0x15')](_0xfc22('0x12'),_0x20d356,_0x5d48e7[_0xfc22('0x15')][_0xfc22('0x17')]);return _0x322e50(_0x5d48e7[_0xfc22('0x15')][_0xfc22('0x17')]);}else{logger[_0xfc22('0x18')](_0xfc22('0x12'),_0x20d356,_0xfc22('0x13'));_0x322e50(_0x5d48e7[_0xfc22('0x19')][_0xfc22('0x17')]);}})[_0xfc22('0x1a')](function(_0x92770d){logger[_0xfc22('0x15')](_0xfc22('0x12'),_0x20d356,_0x92770d);_0x3445e5(_0x92770d);});});}exports[_0xfc22('0x1b')]=function(_0x5d9c16){var _0x464bbd=this;return new Promise(function(_0x582b9c,_0x1ffeaf){return db[_0xfc22('0x1c')][_0xfc22('0x1d')](_0x5d9c16[_0xfc22('0x1e')],{'raw':_0x5d9c16[_0xfc22('0x1f')]?_0x5d9c16[_0xfc22('0x1f')][_0xfc22('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x1ed300){logger[_0xfc22('0x18')](_0xfc22('0x1b'),_0x5d9c16);logger[_0xfc22('0x21')](_0xfc22('0x1b'),_0x5d9c16,JSON[_0xfc22('0x14')](_0x1ed300));_0x582b9c(_0x1ed300);})[_0xfc22('0x1a')](function(_0x4d04ac){logger[_0xfc22('0x15')](_0xfc22('0x1b'),_0x4d04ac[_0xfc22('0x17')],_0x5d9c16);_0x1ffeaf(_0x464bbd[_0xfc22('0x15')](0x1f4,_0x4d04ac[_0xfc22('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index eccfd39..ac82562 100644 --- a/server/api/chatMessage/chatMessage.socket.js +++ b/server/api/chatMessage/chatMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66fa=['emit','length','chatMessage:','./chatMessage.events','save','update'];(function(_0x23a0fe,_0x2bdc1b){var _0x40fd04=function(_0x50d280){while(--_0x50d280){_0x23a0fe['push'](_0x23a0fe['shift']());}};_0x40fd04(++_0x2bdc1b);}(_0x66fa,0x117));var _0xa66f=function(_0x5f6bd,_0x42b40a){_0x5f6bd=_0x5f6bd-0x0;var _0x529a89=_0x66fa[_0x5f6bd];return _0x529a89;};'use strict';var ChatMessageEvents=require(_0xa66f('0x0'));var events=[_0xa66f('0x1'),'remove',_0xa66f('0x2')];function createListener(_0x2dcf24,_0x234f2d){return function(_0x12a38f){_0x234f2d[_0xa66f('0x3')](_0x2dcf24,_0x12a38f);};}function removeListener(_0x2a2abf,_0x3f4904){return function(){ChatMessageEvents['removeListener'](_0x2a2abf,_0x3f4904);};}exports['register']=function(_0x2239d3){for(var _0x20a150=0x0,_0x2f0b78=events[_0xa66f('0x4')];_0x20a150<_0x2f0b78;_0x20a150++){var _0x38b58b=events[_0x20a150];var _0x5096bf=createListener(_0xa66f('0x5')+_0x38b58b,_0x2239d3);ChatMessageEvents['on'](_0x38b58b,_0x5096bf);}}; \ No newline at end of file +var _0x524e=['remove','update','emit','removeListener','register','length','chatMessage:'];(function(_0x4a7a14,_0x2f0a61){var _0x5363d4=function(_0xce57e0){while(--_0xce57e0){_0x4a7a14['push'](_0x4a7a14['shift']());}};_0x5363d4(++_0x2f0a61);}(_0x524e,0x15e));var _0xe524=function(_0x15b4c2,_0x5abf4c){_0x15b4c2=_0x15b4c2-0x0;var _0x1ad663=_0x524e[_0x15b4c2];return _0x1ad663;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0xe524('0x0'),_0xe524('0x1')];function createListener(_0xc5f6b5,_0x29e619){return function(_0x699159){_0x29e619[_0xe524('0x2')](_0xc5f6b5,_0x699159);};}function removeListener(_0xabd694,_0x32c90b){return function(){ChatMessageEvents[_0xe524('0x3')](_0xabd694,_0x32c90b);};}exports[_0xe524('0x4')]=function(_0x4f75d6){for(var _0xaaeaa9=0x0,_0x41e1a3=events[_0xe524('0x5')];_0xaaeaa9<_0x41e1a3;_0xaaeaa9++){var _0x533c14=events[_0xaaeaa9];var _0x384935=createListener(_0xe524('0x6')+_0x533c14,_0x4f75d6);ChatMessageEvents['on'](_0x533c14,_0x384935);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 9718966..3df2569 100644 --- a/server/api/chatMessage/index.js +++ b/server/api/chatMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x17e3=['/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','chat','create','put','update','/:id/accept','accept'];(function(_0x4e3ffc,_0x570704){var _0x543119=function(_0x396abb){while(--_0x396abb){_0x4e3ffc['push'](_0x4e3ffc['shift']());}};_0x543119(++_0x570704);}(_0x17e3,0x1ae));var _0x317e=function(_0x520246,_0x110cc1){_0x520246=_0x520246-0x0;var _0x5a1d4c=_0x17e3[_0x520246];return _0x5a1d4c;};'use strict';var multer=require(_0x317e('0x0'));var util=require(_0x317e('0x1'));var path=require('path');var timeout=require(_0x317e('0x2'));var express=require(_0x317e('0x3'));var router=express[_0x317e('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x317e('0x5'));var controller=require(_0x317e('0x6'));router['get']('/',auth[_0x317e('0x7')](),controller[_0x317e('0x8')]);router[_0x317e('0x9')](_0x317e('0xa'),auth['isAuthenticated'](),controller[_0x317e('0xb')]);router[_0x317e('0x9')](_0x317e('0xc'),auth[_0x317e('0x7')](),controller[_0x317e('0xd')]);router['post']('/',auth[_0x317e('0x7')](),interaction['tracked'](_0x317e('0xe'),'chatmessage:create'),controller[_0x317e('0xf')]);router[_0x317e('0x10')](_0x317e('0xc'),controller[_0x317e('0x11')]);router[_0x317e('0x10')](_0x317e('0x12'),auth['isAuthenticated'](),controller[_0x317e('0x13')]);router[_0x317e('0x10')](_0x317e('0x14'),auth[_0x317e('0x7')](),controller[_0x317e('0x15')]);router[_0x317e('0x16')](_0x317e('0xc'),auth[_0x317e('0x7')](),controller[_0x317e('0x17')]);module[_0x317e('0x18')]=router; \ No newline at end of file +var _0xf1e2=['get','isAuthenticated','/describe','chat','chatmessage:create','/:id','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','./chatMessage.controller'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0xf1e2,0x99));var _0x2f1e=function(_0x1b8cb5,_0x283259){_0x1b8cb5=_0x1b8cb5-0x0;var _0x5c80cd=_0xf1e2[_0x1b8cb5];return _0x5c80cd;};'use strict';var multer=require(_0x2f1e('0x0'));var util=require('util');var path=require(_0x2f1e('0x1'));var timeout=require(_0x2f1e('0x2'));var express=require(_0x2f1e('0x3'));var router=express[_0x2f1e('0x4')]();var auth=require(_0x2f1e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2f1e('0x6'));router[_0x2f1e('0x7')]('/',auth[_0x2f1e('0x8')](),controller['index']);router['get'](_0x2f1e('0x9'),auth[_0x2f1e('0x8')](),controller['describe']);router[_0x2f1e('0x7')]('/:id',auth[_0x2f1e('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0x2f1e('0xa'),_0x2f1e('0xb')),controller['create']);router['put'](_0x2f1e('0xc'),controller['update']);router[_0x2f1e('0xd')](_0x2f1e('0xe'),auth[_0x2f1e('0x8')](),controller[_0x2f1e('0xf')]);router[_0x2f1e('0xd')](_0x2f1e('0x10'),auth['isAuthenticated'](),controller[_0x2f1e('0x11')]);router[_0x2f1e('0x12')](_0x2f1e('0xc'),auth[_0x2f1e('0x8')](),controller[_0x2f1e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index ca507e4..bb0bd51 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d1b=['medium','sequelize','exports','TEXT'];(function(_0x2b6836,_0x58d7c7){var _0x2bb4f5=function(_0x24e41f){while(--_0x24e41f){_0x2b6836['push'](_0x2b6836['shift']());}};_0x2bb4f5(++_0x58d7c7);}(_0x4d1b,0xd9));var _0xb4d1=function(_0x616fb8,_0x177e11){_0x616fb8=_0x616fb8-0x0;var _0x739e20=_0x4d1b[_0x616fb8];return _0x739e20;};'use strict';var Sequelize=require(_0xb4d1('0x0'));module[_0xb4d1('0x1')]={'body':{'type':Sequelize[_0xb4d1('0x2')](_0xb4d1('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x76a9=['TEXT','medium','sequelize','exports'];(function(_0x3ffadf,_0x47c3b1){var _0x46223d=function(_0x1a3ddd){while(--_0x1a3ddd){_0x3ffadf['push'](_0x3ffadf['shift']());}};_0x46223d(++_0x47c3b1);}(_0x76a9,0x11a));var _0x976a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x76a9[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x976a('0x0'));module[_0x976a('0x1')]={'body':{'type':Sequelize[_0x976a('0x2')](_0x976a('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index da2bacc..9cd3809 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf30c=['fields','nolimit','order','sort','filter','where','merge','options','includeAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','request-promise','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0xf30c,0x1b0));var _0xcf30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf30c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcf30('0x0'));var rimraf=require(_0xcf30('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcf30('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcf30('0x3'));var util=require('util');var path=require(_0xcf30('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcf30('0x5'));var fs=require('fs');var _=require(_0xcf30('0x6'));var squel=require(_0xcf30('0x7'));var crypto=require(_0xcf30('0x8'));var jsforce=require(_0xcf30('0x9'));var deskjs=require(_0xcf30('0xa'));var toCsv=require(_0xcf30('0xb'));var querystring=require(_0xcf30('0xc'));var Papa=require(_0xcf30('0xd'));var Redis=require(_0xcf30('0xe'));var authService=require(_0xcf30('0xf'));var qs=require(_0xcf30('0x10'));var as=require(_0xcf30('0x11'));var hardwareService=require(_0xcf30('0x12'));var logger=require('../../config/logger')(_0xcf30('0x13'));var utils=require(_0xcf30('0x14'));var config=require(_0xcf30('0x15'));var db=require(_0xcf30('0x16'))['db'];function respondWithStatusCode(_0x38fca9,_0x52b11d){_0x52b11d=_0x52b11d||0xcc;return function(_0x26d7a9){if(_0x26d7a9){return _0x38fca9[_0xcf30('0x17')](_0x52b11d);}return _0x38fca9[_0xcf30('0x18')](_0x52b11d)[_0xcf30('0x19')]();};}function respondWithResult(_0x7fc0eb,_0x5d6948){_0x5d6948=_0x5d6948||0xc8;return function(_0x33820e){if(_0x33820e){return _0x7fc0eb['status'](_0x5d6948)['json'](_0x33820e);}};}function respondWithFilteredResult(_0x50f750,_0x4be9a5){return function(_0x57292d){if(_0x57292d){var _0x55ad62=_0x57292d[_0xcf30('0x1a')],_0x5e2854=_0x4be9a5[_0xcf30('0x1b')],_0xc1d281=_0x4be9a5[_0xcf30('0x1b')]+_0x4be9a5[_0xcf30('0x1c')],_0x125c35;if(_0xc1d281>=_0x55ad62){_0xc1d281=_0x55ad62;_0x125c35=0xc8;}else{_0x125c35=0xce;}_0x50f750['status'](_0x125c35);return _0x50f750['set'](_0xcf30('0x1d'),_0x5e2854+'-'+_0xc1d281+'/'+_0x55ad62)['json'](_0x57292d);}return null;};}function patchUpdates(_0x48b06a){return function(_0x97ee18){try{jsonpatch[_0xcf30('0x1e')](_0x97ee18,_0x48b06a,!![]);}catch(_0x149336){return BPromise[_0xcf30('0x1f')](_0x149336);}return _0x97ee18['save']();};}function saveUpdates(_0x2a20c9,_0x4f0e16){return function(_0x149ab2){if(_0x149ab2){return _0x149ab2[_0xcf30('0x20')](_0x2a20c9)[_0xcf30('0x21')](function(_0x298b79){return _0x298b79;});}return null;};}function removeEntity(_0x2341b0,_0x15ac84){return function(_0x101227){if(_0x101227){return _0x101227[_0xcf30('0x22')]()[_0xcf30('0x21')](function(){_0x2341b0[_0xcf30('0x18')](0xcc)[_0xcf30('0x19')]();});}};}function handleEntityNotFound(_0x2bade9,_0x4f4126){return function(_0x17e70b){if(!_0x17e70b){_0x2bade9[_0xcf30('0x17')](0x194);}return _0x17e70b;};}function handleError(_0x524fa8,_0x23ab7a){_0x23ab7a=_0x23ab7a||0x1f4;return function(_0xbfeb02){logger[_0xcf30('0x23')](_0xbfeb02[_0xcf30('0x24')]);if(_0xbfeb02[_0xcf30('0x25')]){delete _0xbfeb02[_0xcf30('0x25')];}_0x524fa8[_0xcf30('0x18')](_0x23ab7a)[_0xcf30('0x26')](_0xbfeb02);};}exports[_0xcf30('0x27')]=function(_0x604955,_0x43da7b){var _0x523e7c={},_0x485a87={},_0x3501bf={'count':0x0,'rows':[]};var _0x3a5d1f=_['map'](db[_0xcf30('0x28')][_0xcf30('0x29')],function(_0x2404c5){return{'name':_0x2404c5[_0xcf30('0x2a')],'type':_0x2404c5[_0xcf30('0x2b')]['key']};});_0x485a87[_0xcf30('0x2c')]=_[_0xcf30('0x2d')](_0x3a5d1f,_0xcf30('0x25'));_0x485a87[_0xcf30('0x2e')]=_[_0xcf30('0x2f')](_0x604955[_0xcf30('0x2e')]);_0x485a87[_0xcf30('0x30')]=_[_0xcf30('0x31')](_0x485a87[_0xcf30('0x2c')],_0x485a87[_0xcf30('0x2e')]);_0x523e7c[_0xcf30('0x32')]=_[_0xcf30('0x31')](_0x485a87[_0xcf30('0x2c')],qs[_0xcf30('0x33')](_0x604955[_0xcf30('0x2e')][_0xcf30('0x33')]));_0x523e7c['attributes']=_0x523e7c[_0xcf30('0x32')]['length']?_0x523e7c[_0xcf30('0x32')]:_0x485a87[_0xcf30('0x2c')];if(!_0x604955[_0xcf30('0x2e')]['hasOwnProperty'](_0xcf30('0x34'))){_0x523e7c['limit']=qs[_0xcf30('0x1c')](_0x604955[_0xcf30('0x2e')][_0xcf30('0x1c')]);_0x523e7c[_0xcf30('0x1b')]=qs[_0xcf30('0x1b')](_0x604955[_0xcf30('0x2e')][_0xcf30('0x1b')]);}_0x523e7c[_0xcf30('0x35')]=qs[_0xcf30('0x36')](_0x604955['query'][_0xcf30('0x36')]);_0x523e7c['where']=qs['filters'](_['pick'](_0x604955[_0xcf30('0x2e')],_0x485a87[_0xcf30('0x30')]));if(_0x604955[_0xcf30('0x2e')][_0xcf30('0x37')]){_0x523e7c[_0xcf30('0x38')]=_[_0xcf30('0x39')](_0x523e7c[_0xcf30('0x38')],{'$or':_[_0xcf30('0x2d')](_0x3a5d1f,function(_0x3e09e4){if(_0x3e09e4[_0xcf30('0x2b')]!=='VIRTUAL'){var _0x409e70={};_0x409e70[_0x3e09e4[_0xcf30('0x25')]]={'$like':'%'+_0x604955['query'][_0xcf30('0x37')]+'%'};return _0x409e70;}})});}_0x523e7c=_[_0xcf30('0x39')]({},_0x523e7c,_0x604955[_0xcf30('0x3a')]);var _0x17b15d={'where':_0x523e7c[_0xcf30('0x38')]};return db[_0xcf30('0x28')]['count'](_0x17b15d)['then'](function(_0x3588ba){_0x3501bf[_0xcf30('0x1a')]=_0x3588ba;if(_0x604955[_0xcf30('0x2e')][_0xcf30('0x3b')]){_0x523e7c['include']=[{'all':!![]}];}return db[_0xcf30('0x28')]['findAll'](_0x523e7c);})[_0xcf30('0x21')](function(_0x27ea4d){_0x3501bf[_0xcf30('0x3c')]=_0x27ea4d;return _0x3501bf;})[_0xcf30('0x21')](respondWithFilteredResult(_0x43da7b,_0x523e7c))[_0xcf30('0x3d')](handleError(_0x43da7b,null));};exports[_0xcf30('0x3e')]=function(_0x14bf10,_0x1c2dd4){var _0x40db51={'raw':!![],'where':{'id':_0x14bf10[_0xcf30('0x3f')]['id']}},_0x2842c2={};_0x2842c2[_0xcf30('0x2c')]=_[_0xcf30('0x2f')](db[_0xcf30('0x28')][_0xcf30('0x29')]);_0x2842c2['query']=_[_0xcf30('0x2f')](_0x14bf10[_0xcf30('0x2e')]);_0x2842c2['filters']=_[_0xcf30('0x31')](_0x2842c2['model'],_0x2842c2[_0xcf30('0x2e')]);_0x40db51[_0xcf30('0x32')]=_[_0xcf30('0x31')](_0x2842c2['model'],qs[_0xcf30('0x33')](_0x14bf10[_0xcf30('0x2e')][_0xcf30('0x33')]));_0x40db51['attributes']=_0x40db51['attributes']['length']?_0x40db51['attributes']:_0x2842c2[_0xcf30('0x2c')];if(_0x14bf10[_0xcf30('0x2e')][_0xcf30('0x3b')]){_0x40db51[_0xcf30('0x40')]=[{'all':!![]}];}_0x40db51=_['merge']({},_0x40db51,_0x14bf10[_0xcf30('0x3a')]);return db[_0xcf30('0x28')][_0xcf30('0x41')](_0x40db51)['then'](handleEntityNotFound(_0x1c2dd4,null))[_0xcf30('0x21')](respondWithResult(_0x1c2dd4,null))['catch'](handleError(_0x1c2dd4,null));};exports['create']=function(_0x1a3426,_0x2ba4a6){return db[_0xcf30('0x28')][_0xcf30('0x42')](_0x1a3426[_0xcf30('0x43')],{})[_0xcf30('0x21')](respondWithResult(_0x2ba4a6,0xc9))[_0xcf30('0x3d')](handleError(_0x2ba4a6,null));};exports['update']=function(_0x2bf713,_0x3e6d62){if(_0x2bf713[_0xcf30('0x43')]['id']){delete _0x2bf713[_0xcf30('0x43')]['id'];}return db[_0xcf30('0x28')][_0xcf30('0x41')]({'where':{'id':_0x2bf713[_0xcf30('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3e6d62,null))[_0xcf30('0x21')](saveUpdates(_0x2bf713[_0xcf30('0x43')],null))['then'](respondWithResult(_0x3e6d62,null))[_0xcf30('0x3d')](handleError(_0x3e6d62,null));};exports[_0xcf30('0x22')]=function(_0x163fbd,_0x48c4e5){return db[_0xcf30('0x28')][_0xcf30('0x41')]({'where':{'id':_0x163fbd[_0xcf30('0x3f')]['id']}})[_0xcf30('0x21')](handleEntityNotFound(_0x48c4e5,null))[_0xcf30('0x21')](removeEntity(_0x48c4e5,null))['catch'](handleError(_0x48c4e5,null));};exports[_0xcf30('0x44')]=function(_0xd7bd46,_0x152dce){return db['ChatOfflineMessage']['describe']()[_0xcf30('0x21')](respondWithResult(_0x152dce,null))['catch'](handleError(_0x152dce,null));}; \ No newline at end of file +var _0x58c5=['where','pick','filter','merge','VIRTUAL','options','then','count','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','ChatOfflineMessage','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','nolimit','limit','order','sort'];(function(_0x43ab93,_0xe22392){var _0x3579bb=function(_0xdfb682){while(--_0xdfb682){_0x43ab93['push'](_0x43ab93['shift']());}};_0x3579bb(++_0xe22392);}(_0x58c5,0x1c3));var _0x558c=function(_0x588d98,_0x79b890){_0x588d98=_0x588d98-0x0;var _0x3d4152=_0x58c5[_0x588d98];return _0x3d4152;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x558c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x558c('0x1'));var jsonpatch=require(_0x558c('0x2'));var rp=require(_0x558c('0x3'));var moment=require('moment');var BPromise=require(_0x558c('0x4'));var Mustache=require('mustache');var util=require(_0x558c('0x5'));var path=require(_0x558c('0x6'));var sox=require(_0x558c('0x7'));var csv=require(_0x558c('0x8'));var ejs=require(_0x558c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x558c('0xa'));var toCsv=require(_0x558c('0x8'));var querystring=require(_0x558c('0xb'));var Papa=require('papaparse');var Redis=require(_0x558c('0xc'));var authService=require(_0x558c('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x558c('0xe'));var hardwareService=require(_0x558c('0xf'));var logger=require(_0x558c('0x10'))(_0x558c('0x11'));var utils=require(_0x558c('0x12'));var config=require(_0x558c('0x13'));var db=require(_0x558c('0x14'))['db'];function respondWithStatusCode(_0x34f8bb,_0x286c6d){_0x286c6d=_0x286c6d||0xcc;return function(_0x5798df){if(_0x5798df){return _0x34f8bb[_0x558c('0x15')](_0x286c6d);}return _0x34f8bb[_0x558c('0x16')](_0x286c6d)[_0x558c('0x17')]();};}function respondWithResult(_0x4b9484,_0x5f2144){_0x5f2144=_0x5f2144||0xc8;return function(_0x5124e5){if(_0x5124e5){return _0x4b9484[_0x558c('0x16')](_0x5f2144)[_0x558c('0x18')](_0x5124e5);}};}function respondWithFilteredResult(_0xf5bf72,_0x531792){return function(_0xf71967){if(_0xf71967){var _0x566cb0=_0xf71967['count'],_0x425d03=_0x531792[_0x558c('0x19')],_0x2ad4a2=_0x531792[_0x558c('0x19')]+_0x531792['limit'],_0xeaa819;if(_0x2ad4a2>=_0x566cb0){_0x2ad4a2=_0x566cb0;_0xeaa819=0xc8;}else{_0xeaa819=0xce;}_0xf5bf72[_0x558c('0x16')](_0xeaa819);return _0xf5bf72[_0x558c('0x1a')](_0x558c('0x1b'),_0x425d03+'-'+_0x2ad4a2+'/'+_0x566cb0)[_0x558c('0x18')](_0xf71967);}return null;};}function patchUpdates(_0x216e9e){return function(_0x42f4d6){try{jsonpatch[_0x558c('0x1c')](_0x42f4d6,_0x216e9e,!![]);}catch(_0x5f0e08){return BPromise[_0x558c('0x1d')](_0x5f0e08);}return _0x42f4d6[_0x558c('0x1e')]();};}function saveUpdates(_0x472386,_0x429722){return function(_0x533b77){if(_0x533b77){return _0x533b77[_0x558c('0x1f')](_0x472386)['then'](function(_0x4acfb8){return _0x4acfb8;});}return null;};}function removeEntity(_0x3e7dd3,_0x12b277){return function(_0x42a18b){if(_0x42a18b){return _0x42a18b['destroy']()['then'](function(){_0x3e7dd3['status'](0xcc)[_0x558c('0x17')]();});}};}function handleEntityNotFound(_0xa34432,_0x41aba3){return function(_0x335363){if(!_0x335363){_0xa34432[_0x558c('0x15')](0x194);}return _0x335363;};}function handleError(_0x43025c,_0x1684b4){_0x1684b4=_0x1684b4||0x1f4;return function(_0x408ce0){logger[_0x558c('0x20')](_0x408ce0[_0x558c('0x21')]);if(_0x408ce0[_0x558c('0x22')]){delete _0x408ce0[_0x558c('0x22')];}_0x43025c[_0x558c('0x16')](_0x1684b4)[_0x558c('0x23')](_0x408ce0);};}exports[_0x558c('0x24')]=function(_0x53b929,_0x24423e){var _0x5e9f5e={},_0x351c6b={},_0x3ae0e4={'count':0x0,'rows':[]};var _0x274f0e=_[_0x558c('0x25')](db[_0x558c('0x26')]['rawAttributes'],function(_0x3bccce){return{'name':_0x3bccce[_0x558c('0x27')],'type':_0x3bccce[_0x558c('0x28')]['key']};});_0x351c6b['model']=_['map'](_0x274f0e,'name');_0x351c6b[_0x558c('0x29')]=_[_0x558c('0x2a')](_0x53b929[_0x558c('0x29')]);_0x351c6b[_0x558c('0x2b')]=_['intersection'](_0x351c6b[_0x558c('0x2c')],_0x351c6b[_0x558c('0x29')]);_0x5e9f5e[_0x558c('0x2d')]=_[_0x558c('0x2e')](_0x351c6b[_0x558c('0x2c')],qs[_0x558c('0x2f')](_0x53b929['query'][_0x558c('0x2f')]));_0x5e9f5e[_0x558c('0x2d')]=_0x5e9f5e[_0x558c('0x2d')][_0x558c('0x30')]?_0x5e9f5e[_0x558c('0x2d')]:_0x351c6b[_0x558c('0x2c')];if(!_0x53b929[_0x558c('0x29')]['hasOwnProperty'](_0x558c('0x31'))){_0x5e9f5e['limit']=qs[_0x558c('0x32')](_0x53b929[_0x558c('0x29')]['limit']);_0x5e9f5e[_0x558c('0x19')]=qs['offset'](_0x53b929[_0x558c('0x29')][_0x558c('0x19')]);}_0x5e9f5e[_0x558c('0x33')]=qs[_0x558c('0x34')](_0x53b929[_0x558c('0x29')][_0x558c('0x34')]);_0x5e9f5e[_0x558c('0x35')]=qs[_0x558c('0x2b')](_[_0x558c('0x36')](_0x53b929[_0x558c('0x29')],_0x351c6b[_0x558c('0x2b')]));if(_0x53b929['query'][_0x558c('0x37')]){_0x5e9f5e[_0x558c('0x35')]=_[_0x558c('0x38')](_0x5e9f5e['where'],{'$or':_[_0x558c('0x25')](_0x274f0e,function(_0x1408ec){if(_0x1408ec[_0x558c('0x28')]!==_0x558c('0x39')){var _0x18e57b={};_0x18e57b[_0x1408ec['name']]={'$like':'%'+_0x53b929[_0x558c('0x29')][_0x558c('0x37')]+'%'};return _0x18e57b;}})});}_0x5e9f5e=_[_0x558c('0x38')]({},_0x5e9f5e,_0x53b929[_0x558c('0x3a')]);var _0x3112e7={'where':_0x5e9f5e[_0x558c('0x35')]};return db['ChatOfflineMessage']['count'](_0x3112e7)[_0x558c('0x3b')](function(_0x401aa8){_0x3ae0e4[_0x558c('0x3c')]=_0x401aa8;if(_0x53b929[_0x558c('0x29')]['includeAll']){_0x5e9f5e[_0x558c('0x3d')]=[{'all':!![]}];}return db[_0x558c('0x26')][_0x558c('0x3e')](_0x5e9f5e);})[_0x558c('0x3b')](function(_0x5e9656){_0x3ae0e4['rows']=_0x5e9656;return _0x3ae0e4;})[_0x558c('0x3b')](respondWithFilteredResult(_0x24423e,_0x5e9f5e))[_0x558c('0x3f')](handleError(_0x24423e,null));};exports[_0x558c('0x40')]=function(_0x1649d3,_0x44a0d3){var _0x1484e9={'raw':!![],'where':{'id':_0x1649d3[_0x558c('0x41')]['id']}},_0x23e30b={};_0x23e30b[_0x558c('0x2c')]=_[_0x558c('0x2a')](db[_0x558c('0x26')][_0x558c('0x42')]);_0x23e30b[_0x558c('0x29')]=_[_0x558c('0x2a')](_0x1649d3[_0x558c('0x29')]);_0x23e30b[_0x558c('0x2b')]=_[_0x558c('0x2e')](_0x23e30b['model'],_0x23e30b[_0x558c('0x29')]);_0x1484e9['attributes']=_[_0x558c('0x2e')](_0x23e30b[_0x558c('0x2c')],qs['fields'](_0x1649d3[_0x558c('0x29')][_0x558c('0x2f')]));_0x1484e9[_0x558c('0x2d')]=_0x1484e9[_0x558c('0x2d')][_0x558c('0x30')]?_0x1484e9[_0x558c('0x2d')]:_0x23e30b[_0x558c('0x2c')];if(_0x1649d3[_0x558c('0x29')][_0x558c('0x43')]){_0x1484e9['include']=[{'all':!![]}];}_0x1484e9=_['merge']({},_0x1484e9,_0x1649d3[_0x558c('0x3a')]);return db[_0x558c('0x26')][_0x558c('0x44')](_0x1484e9)['then'](handleEntityNotFound(_0x44a0d3,null))['then'](respondWithResult(_0x44a0d3,null))[_0x558c('0x3f')](handleError(_0x44a0d3,null));};exports[_0x558c('0x45')]=function(_0x195fdb,_0x11df07){return db[_0x558c('0x26')][_0x558c('0x45')](_0x195fdb['body'],{})['then'](respondWithResult(_0x11df07,0xc9))['catch'](handleError(_0x11df07,null));};exports[_0x558c('0x1f')]=function(_0x3c3e49,_0x4950e8){if(_0x3c3e49['body']['id']){delete _0x3c3e49[_0x558c('0x46')]['id'];}return db[_0x558c('0x26')][_0x558c('0x44')]({'where':{'id':_0x3c3e49['params']['id']}})[_0x558c('0x3b')](handleEntityNotFound(_0x4950e8,null))[_0x558c('0x3b')](saveUpdates(_0x3c3e49['body'],null))[_0x558c('0x3b')](respondWithResult(_0x4950e8,null))[_0x558c('0x3f')](handleError(_0x4950e8,null));};exports['destroy']=function(_0x74bf41,_0x2fdad3){return db[_0x558c('0x26')]['find']({'where':{'id':_0x74bf41[_0x558c('0x41')]['id']}})[_0x558c('0x3b')](handleEntityNotFound(_0x2fdad3,null))[_0x558c('0x3b')](removeEntity(_0x2fdad3,null))[_0x558c('0x3f')](handleError(_0x2fdad3,null));};exports['describe']=function(_0x39ebb4,_0x19b61f){return db[_0x558c('0x26')][_0x558c('0x47')]()['then'](respondWithResult(_0x19b61f,null))[_0x558c('0x3f')](handleError(_0x19b61f,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index e827e79..9bb9369 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 _0xed1f=['request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xed1f,0x6a));var _0xfed1=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xed1f[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var logger=require(_0xfed1('0x2'))(_0xfed1('0x3'));var moment=require(_0xfed1('0x4'));var BPromise=require(_0xfed1('0x5'));var rp=require(_0xfed1('0x6'));var fs=require('fs');var path=require(_0xfed1('0x7'));var rimraf=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var attributes=require(_0xfed1('0xa'));module[_0xfed1('0xb')]=function(_0x3d6706,_0x42751d){return _0x3d6706[_0xfed1('0xc')](_0xfed1('0xd'),attributes,{'tableName':_0xfed1('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfed1('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7a2c=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_offline_messages'];(function(_0x273ad6,_0x114770){var _0x3d5f71=function(_0x42772e){while(--_0x42772e){_0x273ad6['push'](_0x273ad6['shift']());}};_0x3d5f71(++_0x114770);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x46eeb7,_0x371acf){_0x46eeb7=_0x46eeb7-0x0;var _0x1bb585=_0x7a2c[_0x46eeb7];return _0x1bb585;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var logger=require(_0xc7a2('0x1'))(_0xc7a2('0x2'));var moment=require(_0xc7a2('0x3'));var BPromise=require(_0xc7a2('0x4'));var rp=require(_0xc7a2('0x5'));var fs=require('fs');var path=require(_0xc7a2('0x6'));var rimraf=require(_0xc7a2('0x7'));var config=require(_0xc7a2('0x8'));var attributes=require('./chatOfflineMessage.attributes');module[_0xc7a2('0x9')]=function(_0x1ddbae,_0x5f334e){return _0x1ddbae['define']('ChatOfflineMessage',attributes,{'tableName':_0xc7a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc7a2('0xb'),'collate':_0xc7a2('0xc')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index e0b45ba..50e4280 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 _0x06cb=['../../config/environment','jayson/promise','client','http','then','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','util','moment','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x25b24a,_0x1c0163){var _0x224e68=function(_0x1fc9d2){while(--_0x1fc9d2){_0x25b24a['push'](_0x25b24a['shift']());}};_0x224e68(++_0x1c0163);}(_0x06cb,0x104));var _0xb06c=function(_0x4eca50,_0x4b36ac){_0x4eca50=_0x4eca50-0x0;var _0xc88250=_0x06cb[_0x4eca50];return _0xc88250;};'use strict';var _=require('lodash');var util=require(_0xb06c('0x0'));var moment=require(_0xb06c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb06c('0x2'));var fs=require('fs');var Redis=require(_0xb06c('0x3'));var db=require(_0xb06c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb06c('0x5'));var config=require(_0xb06c('0x6'));var jayson=require(_0xb06c('0x7'));var client=jayson[_0xb06c('0x8')][_0xb06c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23b5a6,_0x4b6924,_0x2b88b5){return new BPromise(function(_0x2413a9,_0x4a4578){return client['request'](_0x23b5a6,_0x2b88b5)[_0xb06c('0xa')](function(_0x4e4d06){logger['info'](_0xb06c('0xb'),_0x4b6924,'request\x20sent');logger['debug'](_0xb06c('0xc'),_0x4b6924,_0xb06c('0xd'),JSON['stringify'](_0x4e4d06));if(_0x4e4d06[_0xb06c('0xe')]){if(_0x4e4d06[_0xb06c('0xe')][_0xb06c('0xf')]===0x1f4){logger['error'](_0xb06c('0xb'),_0x4b6924,_0x4e4d06['error']['message']);return _0x4a4578(_0x4e4d06[_0xb06c('0xe')]['message']);}logger[_0xb06c('0xe')](_0xb06c('0xb'),_0x4b6924,_0x4e4d06[_0xb06c('0xe')][_0xb06c('0x10')]);return _0x2413a9(_0x4e4d06['error'][_0xb06c('0x10')]);}else{logger[_0xb06c('0x11')](_0xb06c('0xb'),_0x4b6924,_0xb06c('0xd'));_0x2413a9(_0x4e4d06[_0xb06c('0x12')][_0xb06c('0x10')]);}})['catch'](function(_0x25b052){logger['error'](_0xb06c('0xb'),_0x4b6924,_0x25b052);_0x4a4578(_0x25b052);});});} \ No newline at end of file +var _0x54f8=['code','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x54f8,0xae));var _0x854f=function(_0x25a316,_0x21dace){_0x25a316=_0x25a316-0x0;var _0x510e2c=_0x54f8[_0x25a316];return _0x510e2c;};'use strict';var _=require(_0x854f('0x0'));var util=require(_0x854f('0x1'));var moment=require(_0x854f('0x2'));var BPromise=require(_0x854f('0x3'));var rs=require(_0x854f('0x4'));var fs=require('fs');var Redis=require(_0x854f('0x5'));var db=require(_0x854f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x854f('0x7'))(_0x854f('0x8'));var config=require('../../config/environment');var jayson=require(_0x854f('0x9'));var client=jayson[_0x854f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53b53e,_0x3640dc,_0x1e31b3){return new BPromise(function(_0x52ace6,_0x31a14f){return client[_0x854f('0xb')](_0x53b53e,_0x1e31b3)[_0x854f('0xc')](function(_0x1c6746){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x3640dc,_0x854f('0xd'));logger[_0x854f('0xe')](_0x854f('0xf'),_0x3640dc,_0x854f('0xd'),JSON[_0x854f('0x10')](_0x1c6746));if(_0x1c6746[_0x854f('0x11')]){if(_0x1c6746[_0x854f('0x11')][_0x854f('0x12')]===0x1f4){logger[_0x854f('0x11')](_0x854f('0x13'),_0x3640dc,_0x1c6746[_0x854f('0x11')][_0x854f('0x14')]);return _0x31a14f(_0x1c6746[_0x854f('0x11')][_0x854f('0x14')]);}logger[_0x854f('0x11')](_0x854f('0x13'),_0x3640dc,_0x1c6746['error'][_0x854f('0x14')]);return _0x52ace6(_0x1c6746['error'][_0x854f('0x14')]);}else{logger[_0x854f('0x15')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3640dc,_0x854f('0xd'));_0x52ace6(_0x1c6746[_0x854f('0x16')][_0x854f('0x14')]);}})[_0x854f('0x17')](function(_0x585165){logger[_0x854f('0x11')](_0x854f('0x13'),_0x3640dc,_0x585165);_0x31a14f(_0x585165);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 5175db7..9871b3c 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 _0xde2b=['multer','util','express','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','exports'];(function(_0xe131be,_0x4cd478){var _0x210f37=function(_0x414a64){while(--_0x414a64){_0xe131be['push'](_0xe131be['shift']());}};_0x210f37(++_0x4cd478);}(_0xde2b,0x1c0));var _0xbde2=function(_0x41e86d,_0x2eebcf){_0x41e86d=_0x41e86d-0x0;var _0x30f860=_0xde2b[_0x41e86d];return _0x30f860;};'use strict';var multer=require(_0xbde2('0x0'));var util=require(_0xbde2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbde2('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbde2('0x3'));var controller=require(_0xbde2('0x4'));router[_0xbde2('0x5')]('/',auth[_0xbde2('0x6')](),controller[_0xbde2('0x7')]);router[_0xbde2('0x5')](_0xbde2('0x8'),auth[_0xbde2('0x6')](),controller['describe']);router[_0xbde2('0x5')](_0xbde2('0x9'),auth['isAuthenticated'](),controller[_0xbde2('0xa')]);router[_0xbde2('0xb')]('/',auth[_0xbde2('0x6')](),controller['create']);router[_0xbde2('0xc')](_0xbde2('0x9'),auth[_0xbde2('0x6')](),controller[_0xbde2('0xd')]);router[_0xbde2('0xe')](_0xbde2('0x9'),auth[_0xbde2('0x6')](),controller['destroy']);module[_0xbde2('0xf')]=router; \ No newline at end of file +var _0xf5b0=['util','path','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','multer'];(function(_0x5e7aba,_0x4dcf62){var _0x135a8e=function(_0x58526e){while(--_0x58526e){_0x5e7aba['push'](_0x5e7aba['shift']());}};_0x135a8e(++_0x4dcf62);}(_0xf5b0,0x1d3));var _0x0f5b=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xf5b0[_0x334841];return _0x5beb4b;};'use strict';var multer=require(_0x0f5b('0x0'));var util=require(_0x0f5b('0x1'));var path=require(_0x0f5b('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f5b('0x3'));var router=express['Router']();var auth=require(_0x0f5b('0x4'));var interaction=require(_0x0f5b('0x5'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x0f5b('0x6')]('/',auth[_0x0f5b('0x7')](),controller[_0x0f5b('0x8')]);router[_0x0f5b('0x6')](_0x0f5b('0x9'),auth[_0x0f5b('0x7')](),controller[_0x0f5b('0xa')]);router['get']('/:id',auth[_0x0f5b('0x7')](),controller[_0x0f5b('0xb')]);router[_0x0f5b('0xc')]('/',auth[_0x0f5b('0x7')](),controller[_0x0f5b('0xd')]);router['put'](_0x0f5b('0xe'),auth['isAuthenticated'](),controller[_0x0f5b('0xf')]);router[_0x0f5b('0x10')](_0x0f5b('0xe'),auth[_0x0f5b('0x7')](),controller[_0x0f5b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index c744e36..67f3087 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 _0x5411=['INTEGER','sequelize','exports','STRING','timeout','mouseOver'];(function(_0x551b0a,_0x41348c){var _0x5dacb8=function(_0x1123cf){while(--_0x1123cf){_0x551b0a['push'](_0x551b0a['shift']());}};_0x5dacb8(++_0x41348c);}(_0x5411,0x19f));var _0x1541=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x5411[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0x1541('0x0'));module[_0x1541('0x1')]={'name':{'type':Sequelize[_0x1541('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x1541('0x3')),'defaultValue':_0x1541('0x4')},'selector':{'type':Sequelize[_0x1541('0x2')]},'timeout':{'type':Sequelize[_0x1541('0x5')]}}; \ No newline at end of file +var _0x5410=['ENUM','mouseOver','sequelize','exports','STRING'];(function(_0x503f4d,_0x476e97){var _0x4ce6d1=function(_0x17b5fc){while(--_0x17b5fc){_0x503f4d['push'](_0x503f4d['shift']());}};_0x4ce6d1(++_0x476e97);}(_0x5410,0x15b));var _0x0541=function(_0x392986,_0x23bfc2){_0x392986=_0x392986-0x0;var _0x11372f=_0x5410[_0x392986];return _0x11372f;};'use strict';var Sequelize=require(_0x0541('0x0'));module[_0x0541('0x1')]={'name':{'type':Sequelize[_0x0541('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0541('0x3')](_0x0541('0x4'),'timeout'),'defaultValue':_0x0541('0x4')},'selector':{'type':Sequelize[_0x0541('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 304c7d6..a80fecd 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 _0xedd9=['offset','limit','Content-Range','reject','update','then','destroy','error','stack','send','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','include','merge','options','find','catch','create','ChatProactiveAction','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xedd9,0xfc));var _0x9edd=function(_0x50368e,_0x17ee72){_0x50368e=_0x50368e-0x0;var _0x381d5d=_0xedd9[_0x50368e];return _0x381d5d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');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('0xa'));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 db=require(_0x9edd('0x16'))['db'];function respondWithStatusCode(_0x25e64c,_0xfd544a){_0xfd544a=_0xfd544a||0xcc;return function(_0x287ddd){if(_0x287ddd){return _0x25e64c[_0x9edd('0x17')](_0xfd544a);}return _0x25e64c[_0x9edd('0x18')](_0xfd544a)[_0x9edd('0x19')]();};}function respondWithResult(_0x47eb64,_0x176bfa){_0x176bfa=_0x176bfa||0xc8;return function(_0x44fc7c){if(_0x44fc7c){return _0x47eb64[_0x9edd('0x18')](_0x176bfa)[_0x9edd('0x1a')](_0x44fc7c);}};}function respondWithFilteredResult(_0x13b6b6,_0x338f3c){return function(_0x1042aa){if(_0x1042aa){var _0x75a4ab=_0x1042aa[_0x9edd('0x1b')],_0x4ea60f=_0x338f3c['offset'],_0x5f5bf4=_0x338f3c[_0x9edd('0x1c')]+_0x338f3c[_0x9edd('0x1d')],_0x448996;if(_0x5f5bf4>=_0x75a4ab){_0x5f5bf4=_0x75a4ab;_0x448996=0xc8;}else{_0x448996=0xce;}_0x13b6b6[_0x9edd('0x18')](_0x448996);return _0x13b6b6['set'](_0x9edd('0x1e'),_0x4ea60f+'-'+_0x5f5bf4+'/'+_0x75a4ab)['json'](_0x1042aa);}return null;};}function patchUpdates(_0x2cdcef){return function(_0x1083e4){try{jsonpatch['apply'](_0x1083e4,_0x2cdcef,!![]);}catch(_0x498977){return BPromise[_0x9edd('0x1f')](_0x498977);}return _0x1083e4['save']();};}function saveUpdates(_0x27a95a,_0x54a03f){return function(_0x535f37){if(_0x535f37){return _0x535f37[_0x9edd('0x20')](_0x27a95a)[_0x9edd('0x21')](function(_0x4fb7bf){return _0x4fb7bf;});}return null;};}function removeEntity(_0x5823bc,_0x341d67){return function(_0x186186){if(_0x186186){return _0x186186[_0x9edd('0x22')]()['then'](function(){_0x5823bc[_0x9edd('0x18')](0xcc)[_0x9edd('0x19')]();});}};}function handleEntityNotFound(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(!_0x339a0d){_0x44a6c1['sendStatus'](0x194);}return _0x339a0d;};}function handleError(_0x46c383,_0xeaf55a){_0xeaf55a=_0xeaf55a||0x1f4;return function(_0x3a1ea5){logger[_0x9edd('0x23')](_0x3a1ea5[_0x9edd('0x24')]);if(_0x3a1ea5['name']){delete _0x3a1ea5['name'];}_0x46c383[_0x9edd('0x18')](_0xeaf55a)[_0x9edd('0x25')](_0x3a1ea5);};}exports[_0x9edd('0x26')]=function(_0x25e135,_0x3c2227){var _0x4fe471={'raw':!![],'where':{'id':_0x25e135[_0x9edd('0x27')]['id']}},_0x57a2cc={};_0x57a2cc[_0x9edd('0x28')]=_[_0x9edd('0x29')](db['ChatProactiveAction'][_0x9edd('0x2a')]);_0x57a2cc[_0x9edd('0x2b')]=_[_0x9edd('0x29')](_0x25e135[_0x9edd('0x2b')]);_0x57a2cc['filters']=_[_0x9edd('0x2c')](_0x57a2cc[_0x9edd('0x28')],_0x57a2cc[_0x9edd('0x2b')]);_0x4fe471[_0x9edd('0x2d')]=_[_0x9edd('0x2c')](_0x57a2cc[_0x9edd('0x28')],qs[_0x9edd('0x2e')](_0x25e135[_0x9edd('0x2b')][_0x9edd('0x2e')]));_0x4fe471[_0x9edd('0x2d')]=_0x4fe471[_0x9edd('0x2d')][_0x9edd('0x2f')]?_0x4fe471[_0x9edd('0x2d')]:_0x57a2cc[_0x9edd('0x28')];if(_0x25e135[_0x9edd('0x2b')]['includeAll']){_0x4fe471[_0x9edd('0x30')]=[{'all':!![]}];}_0x4fe471=_[_0x9edd('0x31')]({},_0x4fe471,_0x25e135[_0x9edd('0x32')]);return db['ChatProactiveAction'][_0x9edd('0x33')](_0x4fe471)[_0x9edd('0x21')](handleEntityNotFound(_0x3c2227,null))[_0x9edd('0x21')](respondWithResult(_0x3c2227,null))[_0x9edd('0x34')](handleError(_0x3c2227,null));};exports[_0x9edd('0x35')]=function(_0x2bc4ed,_0x473068){return db[_0x9edd('0x36')][_0x9edd('0x35')](_0x2bc4ed[_0x9edd('0x37')],{})[_0x9edd('0x21')](respondWithResult(_0x473068,0xc9))[_0x9edd('0x34')](handleError(_0x473068,null));};exports[_0x9edd('0x20')]=function(_0x14f780,_0x5757fc){if(_0x14f780[_0x9edd('0x37')]['id']){delete _0x14f780['body']['id'];}return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'id':_0x14f780[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x5757fc,null))[_0x9edd('0x21')](saveUpdates(_0x14f780['body'],null))[_0x9edd('0x21')](respondWithResult(_0x5757fc,null))[_0x9edd('0x34')](handleError(_0x5757fc,null));};exports[_0x9edd('0x22')]=function(_0x38e9be,_0x1be77f){return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'id':_0x38e9be[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x1be77f,null))[_0x9edd('0x21')](removeEntity(_0x1be77f,null))['catch'](handleError(_0x1be77f,null));}; \ No newline at end of file +var _0xedd9=['offset','limit','Content-Range','reject','update','then','destroy','error','stack','send','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','include','merge','options','find','catch','create','ChatProactiveAction','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0xedd9,0xfc));var _0x9edd=function(_0x4f25f9,_0x255051){_0x4f25f9=_0x4f25f9-0x0;var _0x92083c=_0xedd9[_0x4f25f9];return _0x92083c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');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('0xa'));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 db=require(_0x9edd('0x16'))['db'];function respondWithStatusCode(_0x25e64c,_0xfd544a){_0xfd544a=_0xfd544a||0xcc;return function(_0x287ddd){if(_0x287ddd){return _0x25e64c[_0x9edd('0x17')](_0xfd544a);}return _0x25e64c[_0x9edd('0x18')](_0xfd544a)[_0x9edd('0x19')]();};}function respondWithResult(_0x47eb64,_0x176bfa){_0x176bfa=_0x176bfa||0xc8;return function(_0x44fc7c){if(_0x44fc7c){return _0x47eb64[_0x9edd('0x18')](_0x176bfa)[_0x9edd('0x1a')](_0x44fc7c);}};}function respondWithFilteredResult(_0x13b6b6,_0x338f3c){return function(_0x1042aa){if(_0x1042aa){var _0x75a4ab=_0x1042aa[_0x9edd('0x1b')],_0x4ea60f=_0x338f3c['offset'],_0x5f5bf4=_0x338f3c[_0x9edd('0x1c')]+_0x338f3c[_0x9edd('0x1d')],_0x448996;if(_0x5f5bf4>=_0x75a4ab){_0x5f5bf4=_0x75a4ab;_0x448996=0xc8;}else{_0x448996=0xce;}_0x13b6b6[_0x9edd('0x18')](_0x448996);return _0x13b6b6['set'](_0x9edd('0x1e'),_0x4ea60f+'-'+_0x5f5bf4+'/'+_0x75a4ab)['json'](_0x1042aa);}return null;};}function patchUpdates(_0x2cdcef){return function(_0x1083e4){try{jsonpatch['apply'](_0x1083e4,_0x2cdcef,!![]);}catch(_0x498977){return BPromise[_0x9edd('0x1f')](_0x498977);}return _0x1083e4['save']();};}function saveUpdates(_0x27a95a,_0x54a03f){return function(_0x535f37){if(_0x535f37){return _0x535f37[_0x9edd('0x20')](_0x27a95a)[_0x9edd('0x21')](function(_0x4fb7bf){return _0x4fb7bf;});}return null;};}function removeEntity(_0x5823bc,_0x341d67){return function(_0x186186){if(_0x186186){return _0x186186[_0x9edd('0x22')]()['then'](function(){_0x5823bc[_0x9edd('0x18')](0xcc)[_0x9edd('0x19')]();});}};}function handleEntityNotFound(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(!_0x339a0d){_0x44a6c1['sendStatus'](0x194);}return _0x339a0d;};}function handleError(_0x46c383,_0xeaf55a){_0xeaf55a=_0xeaf55a||0x1f4;return function(_0x3a1ea5){logger[_0x9edd('0x23')](_0x3a1ea5[_0x9edd('0x24')]);if(_0x3a1ea5['name']){delete _0x3a1ea5['name'];}_0x46c383[_0x9edd('0x18')](_0xeaf55a)[_0x9edd('0x25')](_0x3a1ea5);};}exports[_0x9edd('0x26')]=function(_0x25e135,_0x3c2227){var _0x4fe471={'raw':!![],'where':{'id':_0x25e135[_0x9edd('0x27')]['id']}},_0x57a2cc={};_0x57a2cc[_0x9edd('0x28')]=_[_0x9edd('0x29')](db['ChatProactiveAction'][_0x9edd('0x2a')]);_0x57a2cc[_0x9edd('0x2b')]=_[_0x9edd('0x29')](_0x25e135[_0x9edd('0x2b')]);_0x57a2cc['filters']=_[_0x9edd('0x2c')](_0x57a2cc[_0x9edd('0x28')],_0x57a2cc[_0x9edd('0x2b')]);_0x4fe471[_0x9edd('0x2d')]=_[_0x9edd('0x2c')](_0x57a2cc[_0x9edd('0x28')],qs[_0x9edd('0x2e')](_0x25e135[_0x9edd('0x2b')][_0x9edd('0x2e')]));_0x4fe471[_0x9edd('0x2d')]=_0x4fe471[_0x9edd('0x2d')][_0x9edd('0x2f')]?_0x4fe471[_0x9edd('0x2d')]:_0x57a2cc[_0x9edd('0x28')];if(_0x25e135[_0x9edd('0x2b')]['includeAll']){_0x4fe471[_0x9edd('0x30')]=[{'all':!![]}];}_0x4fe471=_[_0x9edd('0x31')]({},_0x4fe471,_0x25e135[_0x9edd('0x32')]);return db['ChatProactiveAction'][_0x9edd('0x33')](_0x4fe471)[_0x9edd('0x21')](handleEntityNotFound(_0x3c2227,null))[_0x9edd('0x21')](respondWithResult(_0x3c2227,null))[_0x9edd('0x34')](handleError(_0x3c2227,null));};exports[_0x9edd('0x35')]=function(_0x2bc4ed,_0x473068){return db[_0x9edd('0x36')][_0x9edd('0x35')](_0x2bc4ed[_0x9edd('0x37')],{})[_0x9edd('0x21')](respondWithResult(_0x473068,0xc9))[_0x9edd('0x34')](handleError(_0x473068,null));};exports[_0x9edd('0x20')]=function(_0x14f780,_0x5757fc){if(_0x14f780[_0x9edd('0x37')]['id']){delete _0x14f780['body']['id'];}return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'id':_0x14f780[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x5757fc,null))[_0x9edd('0x21')](saveUpdates(_0x14f780['body'],null))[_0x9edd('0x21')](respondWithResult(_0x5757fc,null))[_0x9edd('0x34')](handleError(_0x5757fc,null));};exports[_0x9edd('0x22')]=function(_0x38e9be,_0x1be77f){return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'id':_0x38e9be[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x1be77f,null))[_0x9edd('0x21')](removeEntity(_0x1be77f,null))['catch'](handleError(_0x1be77f,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 513a7bd..a8669ec 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 _0x87e4=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x3b9891,_0xb984cf){var _0x402c62=function(_0x41e6a2){while(--_0x41e6a2){_0x3b9891['push'](_0x3b9891['shift']());}};_0x402c62(++_0xb984cf);}(_0x87e4,0x1bc));var _0x487e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x87e4[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x487e('0x0'));var util=require(_0x487e('0x1'));var logger=require('../../config/logger')(_0x487e('0x2'));var moment=require(_0x487e('0x3'));var BPromise=require(_0x487e('0x4'));var rp=require(_0x487e('0x5'));var fs=require('fs');var path=require(_0x487e('0x6'));var rimraf=require(_0x487e('0x7'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0x487e('0x8')]=function(_0x179bf5,_0xeecfc1){return _0x179bf5[_0x487e('0x9')](_0x487e('0xa'),attributes,{'tableName':_0x487e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf52b=['define','chat_proactive_actions','lodash','util','api','moment','request-promise','rimraf','./chatProactiveAction.attributes','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf52b,0x84));var _0xbf52=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0xf52b[_0x5a1a51];return _0x47edd7;};'use strict';var _=require(_0xbf52('0x0'));var util=require(_0xbf52('0x1'));var logger=require('../../config/logger')(_0xbf52('0x2'));var moment=require(_0xbf52('0x3'));var BPromise=require('bluebird');var rp=require(_0xbf52('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf52('0x5'));var config=require('../../config/environment');var attributes=require(_0xbf52('0x6'));module[_0xbf52('0x7')]=function(_0x951aaa,_0x9f303e){return _0x951aaa[_0xbf52('0x8')]('ChatProactiveAction',attributes,{'tableName':_0xbf52('0x9'),'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 961ab54..3f3de50 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 _0xd254=['jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4652c8,_0x39056e){var _0x792fc5=function(_0x567f5a){while(--_0x567f5a){_0x4652c8['push'](_0x4652c8['shift']());}};_0x792fc5(++_0x39056e);}(_0xd254,0xb0));var _0x4d25=function(_0x7399e4,_0x1418d8){_0x7399e4=_0x7399e4-0x0;var _0x38cdc0=_0xd254[_0x7399e4];return _0x38cdc0;};'use strict';var _=require(_0x4d25('0x0'));var util=require('util');var moment=require(_0x4d25('0x1'));var BPromise=require('bluebird');var rs=require(_0x4d25('0x2'));var fs=require('fs');var Redis=require(_0x4d25('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4d25('0x4'));var logger=require(_0x4d25('0x5'))(_0x4d25('0x6'));var config=require(_0x4d25('0x7'));var jayson=require(_0x4d25('0x8'));var client=jayson[_0x4d25('0x9')][_0x4d25('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x386c90,_0x48a61e,_0x32cc4f){return new BPromise(function(_0x38e09c,_0x33c41b){return client[_0x4d25('0xb')](_0x386c90,_0x32cc4f)[_0x4d25('0xc')](function(_0x87c51f){logger[_0x4d25('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x48a61e,_0x4d25('0xe'));logger[_0x4d25('0xf')](_0x4d25('0x10'),_0x48a61e,_0x4d25('0xe'),JSON[_0x4d25('0x11')](_0x87c51f));if(_0x87c51f[_0x4d25('0x12')]){if(_0x87c51f[_0x4d25('0x12')]['code']===0x1f4){logger[_0x4d25('0x12')](_0x4d25('0x13'),_0x48a61e,_0x87c51f[_0x4d25('0x12')][_0x4d25('0x14')]);return _0x33c41b(_0x87c51f[_0x4d25('0x12')][_0x4d25('0x14')]);}logger[_0x4d25('0x12')](_0x4d25('0x13'),_0x48a61e,_0x87c51f[_0x4d25('0x12')]['message']);return _0x38e09c(_0x87c51f['error'][_0x4d25('0x14')]);}else{logger['info'](_0x4d25('0x13'),_0x48a61e,'request\x20sent');_0x38e09c(_0x87c51f[_0x4d25('0x15')][_0x4d25('0x14')]);}})[_0x4d25('0x16')](function(_0x1cd3eb){logger[_0x4d25('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x48a61e,_0x1cd3eb);_0x33c41b(_0x1cd3eb);});});} \ No newline at end of file +var _0x5d95=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x12a9b9,_0x300cf4){var _0x260c0c=function(_0x548ad7){while(--_0x548ad7){_0x12a9b9['push'](_0x12a9b9['shift']());}};_0x260c0c(++_0x300cf4);}(_0x5d95,0x12a));var _0x55d9=function(_0x329075,_0x1e16fd){_0x329075=_0x329075-0x0;var _0x39499a=_0x5d95[_0x329075];return _0x39499a;};'use strict';var _=require(_0x55d9('0x0'));var util=require(_0x55d9('0x1'));var moment=require(_0x55d9('0x2'));var BPromise=require(_0x55d9('0x3'));var rs=require(_0x55d9('0x4'));var fs=require('fs');var Redis=require(_0x55d9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x55d9('0x6'));var logger=require(_0x55d9('0x7'))(_0x55d9('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x55d9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x375fca,_0x596403,_0x2b4e48){return new BPromise(function(_0x50f92c,_0xc6136e){return client['request'](_0x375fca,_0x2b4e48)['then'](function(_0x8a7c02){logger[_0x55d9('0xa')](_0x55d9('0xb'),_0x596403,_0x55d9('0xc'));logger[_0x55d9('0xd')](_0x55d9('0xe'),_0x596403,'request\x20sent',JSON[_0x55d9('0xf')](_0x8a7c02));if(_0x8a7c02['error']){if(_0x8a7c02[_0x55d9('0x10')]['code']===0x1f4){logger[_0x55d9('0x10')](_0x55d9('0xb'),_0x596403,_0x8a7c02[_0x55d9('0x10')][_0x55d9('0x11')]);return _0xc6136e(_0x8a7c02['error'][_0x55d9('0x11')]);}logger[_0x55d9('0x10')](_0x55d9('0xb'),_0x596403,_0x8a7c02[_0x55d9('0x10')]['message']);return _0x50f92c(_0x8a7c02[_0x55d9('0x10')]['message']);}else{logger[_0x55d9('0xa')](_0x55d9('0xb'),_0x596403,_0x55d9('0xc'));_0x50f92c(_0x8a7c02[_0x55d9('0x12')][_0x55d9('0x11')]);}})[_0x55d9('0x13')](function(_0x330861){logger[_0x55d9('0x10')](_0x55d9('0xb'),_0x596403,_0x330861);_0xc6136e(_0x330861);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index ed69a5a..9ec2dd4 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 _0x0af7=['create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','post'];(function(_0x53f125,_0x4ba12e){var _0x209b38=function(_0x67892c){while(--_0x67892c){_0x53f125['push'](_0x53f125['shift']());}};_0x209b38(++_0x4ba12e);}(_0x0af7,0x17b));var _0x70af=function(_0x15e3df,_0x15fd65){_0x15e3df=_0x15e3df-0x0;var _0x206b20=_0x0af7[_0x15e3df];return _0x206b20;};'use strict';var multer=require(_0x70af('0x0'));var util=require('util');var path=require(_0x70af('0x1'));var timeout=require(_0x70af('0x2'));var express=require(_0x70af('0x3'));var router=express[_0x70af('0x4')]();var auth=require(_0x70af('0x5'));var interaction=require(_0x70af('0x6'));var config=require('../../config/environment');var controller=require(_0x70af('0x7'));router[_0x70af('0x8')](_0x70af('0x9'),auth[_0x70af('0xa')](),controller['show']);router[_0x70af('0xb')]('/',auth[_0x70af('0xa')](),controller[_0x70af('0xc')]);router['put'](_0x70af('0x9'),auth['isAuthenticated'](),controller[_0x70af('0xd')]);router[_0x70af('0xe')](_0x70af('0x9'),auth['isAuthenticated'](),controller[_0x70af('0xf')]);module[_0x70af('0x10')]=router; \ No newline at end of file +var _0xbc6b=['/:id','isAuthenticated','show','create','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get'];(function(_0xef6128,_0x5024fd){var _0x418dce=function(_0xb16252){while(--_0xb16252){_0xef6128['push'](_0xef6128['shift']());}};_0x418dce(++_0x5024fd);}(_0xbc6b,0x14b));var _0xbbc6=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0xbc6b[_0x2a67fe];return _0x57e726;};'use strict';var multer=require(_0xbbc6('0x0'));var util=require(_0xbbc6('0x1'));var path=require(_0xbbc6('0x2'));var timeout=require('connect-timeout');var express=require(_0xbbc6('0x3'));var router=express[_0xbbc6('0x4')]();var auth=require(_0xbbc6('0x5'));var interaction=require(_0xbbc6('0x6'));var config=require('../../config/environment');var controller=require(_0xbbc6('0x7'));router[_0xbbc6('0x8')](_0xbbc6('0x9'),auth[_0xbbc6('0xa')](),controller[_0xbbc6('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbbc6('0xc')]);router[_0xbbc6('0xd')](_0xbbc6('0x9'),auth[_0xbbc6('0xa')](),controller[_0xbbc6('0xe')]);router['delete']('/:id',auth[_0xbbc6('0xa')](),controller[_0xbbc6('0xf')]);module[_0xbbc6('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 71615c2..d48b316 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 _0x43ff=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x1f60d2,_0xd10a6f){var _0x450056=function(_0x19c340){while(--_0x19c340){_0x1f60d2['push'](_0x1f60d2['shift']());}};_0x450056(++_0xd10a6f);}(_0x43ff,0xe9));var _0xf43f=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x43ff[_0x6a0266];return _0x309e00;};'use strict';var Sequelize=require(_0xf43f('0x0'));module[_0xf43f('0x1')]={'name':{'type':Sequelize[_0xf43f('0x2')],'unique':_0xf43f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf43f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xf43f('0x5'),_0xf43f('0x6'))}}; \ No newline at end of file +var _0x143b=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','ENUM'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0x143b,0xa3));var _0xb143=function(_0x46a05f,_0xd23a7f){_0x46a05f=_0x46a05f-0x0;var _0x42575b=_0x143b[_0x46a05f];return _0x42575b;};'use strict';var Sequelize=require(_0xb143('0x0'));module[_0xb143('0x1')]={'name':{'type':Sequelize[_0xb143('0x2')],'unique':_0xb143('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb143('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb143('0x4')](_0xb143('0x5'),_0xb143('0x6'),_0xb143('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index e7c6d34..06d01d7 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 _0xff22=['set','reject','save','update','destroy','get','ChatQueues','UserProfileResource','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','offset','sort','where','pick','merge','VIRTUAL','filter','options','ChatQueue','count','includeAll','findAll','rows','params','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','getMembers','findOne','UserChatQueue','nolimit','order','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','field','tq.TeamId','from','team_has_chat_queues','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','removeTeams','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','status','json','limit'];(function(_0x1a9459,_0x5cafca){var _0x31440c=function(_0x5cd50b){while(--_0x5cd50b){_0x1a9459['push'](_0x1a9459['shift']());}};_0x31440c(++_0x5cafca);}(_0xff22,0x1a0));var _0x2ff2=function(_0x3b8ee3,_0x56cd4b){_0x3b8ee3=_0x3b8ee3-0x0;var _0x21b39a=_0xff22[_0x3b8ee3];return _0x21b39a;};'use strict';var pdf=require(_0x2ff2('0x0'));var emlformat=require(_0x2ff2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2ff2('0x2'));var jsonpatch=require(_0x2ff2('0x3'));var rp=require(_0x2ff2('0x4'));var moment=require(_0x2ff2('0x5'));var BPromise=require(_0x2ff2('0x6'));var Mustache=require(_0x2ff2('0x7'));var util=require(_0x2ff2('0x8'));var path=require(_0x2ff2('0x9'));var sox=require(_0x2ff2('0xa'));var csv=require('to-csv');var ejs=require(_0x2ff2('0xb'));var fs=require('fs');var _=require(_0x2ff2('0xc'));var squel=require(_0x2ff2('0xd'));var crypto=require(_0x2ff2('0xe'));var jsforce=require(_0x2ff2('0xf'));var deskjs=require(_0x2ff2('0x10'));var toCsv=require(_0x2ff2('0x11'));var querystring=require('querystring');var Papa=require(_0x2ff2('0x12'));var Redis=require(_0x2ff2('0x13'));var authService=require(_0x2ff2('0x14'));var qs=require(_0x2ff2('0x15'));var as=require(_0x2ff2('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2ff2('0x17'));var config=require(_0x2ff2('0x18'));var db=require(_0x2ff2('0x19'))['db'];config[_0x2ff2('0x1a')]=_[_0x2ff2('0x1b')](config[_0x2ff2('0x1a')],{'host':_0x2ff2('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ff2('0x1a')]));require(_0x2ff2('0x1d'))[_0x2ff2('0x1e')](socket);var jayson=require(_0x2ff2('0x1f'));var client=jayson[_0x2ff2('0x20')]['http']({'port':0x232a});function checkPasswordPattern(_0x48baff,_0x39053f,_0x54d58f){if(_0x54d58f){var _0x401f66=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x401f66[_0x2ff2('0x21')](_0x39053f)){return _0x48baff;}else{throw new db[(_0x2ff2('0x22'))][(_0x2ff2('0x23'))](_0x2ff2('0x24'));}}else{return _0x48baff;}}function respondWithRpcPromise(_0x2f2476,_0xca38d7,_0x5c95fa,_0x321b0a){return new BPromise(function(_0x598e53,_0xe7b8f4){var _0x112d37=_0x321b0a||client;return _0x112d37[_0x2ff2('0x25')](_0x2f2476,_0x5c95fa)[_0x2ff2('0x26')](function(_0x1ca301){logger[_0x2ff2('0x27')](_0x2ff2('0x28'),_0xca38d7,_0x2ff2('0x29'));logger[_0x2ff2('0x2a')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0xca38d7,'request\x20sent',JSON['stringify'](_0x1ca301));if(_0x1ca301['error']){if(_0x1ca301[_0x2ff2('0x2b')]['code']===0x1f4){logger[_0x2ff2('0x2b')]('ChatQueue,\x20%s,\x20%s',_0xca38d7,_0x1ca301[_0x2ff2('0x2b')]['message']);return _0xe7b8f4(_0x1ca301['error'][_0x2ff2('0x2c')]);}logger[_0x2ff2('0x2b')](_0x2ff2('0x28'),_0xca38d7,_0x1ca301[_0x2ff2('0x2b')][_0x2ff2('0x2c')]);return _0x598e53(_0x1ca301[_0x2ff2('0x2b')]['message']);}else{logger['info'](_0x2ff2('0x28'),_0xca38d7,_0x2ff2('0x29'));_0x598e53(_0x1ca301['result'][_0x2ff2('0x2c')]);}})[_0x2ff2('0x2d')](function(_0x248742){logger[_0x2ff2('0x2b')](_0x2ff2('0x28'),_0xca38d7,_0x248742);_0xe7b8f4(_0x248742);});});}function respondWithStatusCode(_0x2af017,_0x126b80){_0x126b80=_0x126b80||0xcc;return function(_0x8cdbb7){if(_0x8cdbb7){return _0x2af017['sendStatus'](_0x126b80);}return _0x2af017[_0x2ff2('0x2e')](_0x126b80)['end']();};}function respondWithResult(_0x1e1957,_0x49b954){_0x49b954=_0x49b954||0xc8;return function(_0x354dff){if(_0x354dff){return _0x1e1957[_0x2ff2('0x2e')](_0x49b954)[_0x2ff2('0x2f')](_0x354dff);}};}function respondWithFilteredResult(_0xadd615,_0x29aa02){return function(_0x3b8e3b){if(_0x3b8e3b){var _0x116f9d=_0x3b8e3b['count'],_0x2a9e81=_0x29aa02['offset'],_0x5f0e29=_0x29aa02['offset']+_0x29aa02[_0x2ff2('0x30')],_0x3d9bde;if(_0x5f0e29>=_0x116f9d){_0x5f0e29=_0x116f9d;_0x3d9bde=0xc8;}else{_0x3d9bde=0xce;}_0xadd615['status'](_0x3d9bde);return _0xadd615[_0x2ff2('0x31')]('Content-Range',_0x2a9e81+'-'+_0x5f0e29+'/'+_0x116f9d)['json'](_0x3b8e3b);}return null;};}function patchUpdates(_0x1b93a9){return function(_0x482d6a){try{jsonpatch['apply'](_0x482d6a,_0x1b93a9,!![]);}catch(_0x29958b){return BPromise[_0x2ff2('0x32')](_0x29958b);}return _0x482d6a[_0x2ff2('0x33')]();};}function saveUpdates(_0x4b8082,_0x216451){return function(_0x4192b5){if(_0x4192b5){return _0x4192b5[_0x2ff2('0x34')](_0x4b8082)[_0x2ff2('0x26')](function(_0x34161d){return _0x34161d;});}return null;};}function removeEntity(_0x3d8f5b,_0x201805){return function(_0x2d45d5){if(_0x2d45d5){return _0x2d45d5[_0x2ff2('0x35')]()[_0x2ff2('0x26')](function(){var _0x5e553c=_0x2d45d5[_0x2ff2('0x36')]({'plain':!![]});var _0x3e6e72=_0x2ff2('0x37');return db[_0x2ff2('0x38')]['destroy']({'where':{'type':_0x3e6e72,'resourceId':_0x5e553c['id']}})[_0x2ff2('0x26')](function(){return _0x2d45d5;});})[_0x2ff2('0x26')](function(){_0x3d8f5b[_0x2ff2('0x2e')](0xcc)[_0x2ff2('0x39')]();});}};}function handleEntityNotFound(_0x58463d,_0x5aa782){return function(_0x7cc4ae){if(!_0x7cc4ae){_0x58463d[_0x2ff2('0x3a')](0x194);}return _0x7cc4ae;};}function handleError(_0x2fabe5,_0x5a757f){_0x5a757f=_0x5a757f||0x1f4;return function(_0x4f4547){logger[_0x2ff2('0x2b')](_0x4f4547[_0x2ff2('0x3b')]);if(_0x4f4547[_0x2ff2('0x3c')]){delete _0x4f4547['name'];}_0x2fabe5[_0x2ff2('0x2e')](_0x5a757f)[_0x2ff2('0x3d')](_0x4f4547);};}exports[_0x2ff2('0x3e')]=function(_0x43c5f1,_0x36b9c8){var _0x857d96={},_0x203085={},_0x3fd022={'count':0x0,'rows':[]};var _0x31b105=_[_0x2ff2('0x3f')](db['ChatQueue'][_0x2ff2('0x40')],function(_0x10edfa){return{'name':_0x10edfa[_0x2ff2('0x41')],'type':_0x10edfa[_0x2ff2('0x42')][_0x2ff2('0x43')]};});_0x203085[_0x2ff2('0x44')]=_[_0x2ff2('0x3f')](_0x31b105,'name');_0x203085[_0x2ff2('0x45')]=_[_0x2ff2('0x46')](_0x43c5f1['query']);_0x203085[_0x2ff2('0x47')]=_['intersection'](_0x203085[_0x2ff2('0x44')],_0x203085['query']);_0x857d96[_0x2ff2('0x48')]=_['intersection'](_0x203085[_0x2ff2('0x44')],qs[_0x2ff2('0x49')](_0x43c5f1[_0x2ff2('0x45')][_0x2ff2('0x49')]));_0x857d96[_0x2ff2('0x48')]=_0x857d96[_0x2ff2('0x48')][_0x2ff2('0x4a')]?_0x857d96[_0x2ff2('0x48')]:_0x203085[_0x2ff2('0x44')];if(!_0x43c5f1['query'][_0x2ff2('0x4b')]('nolimit')){_0x857d96[_0x2ff2('0x30')]=qs[_0x2ff2('0x30')](_0x43c5f1[_0x2ff2('0x45')][_0x2ff2('0x30')]);_0x857d96[_0x2ff2('0x4c')]=qs[_0x2ff2('0x4c')](_0x43c5f1[_0x2ff2('0x45')][_0x2ff2('0x4c')]);}_0x857d96['order']=qs[_0x2ff2('0x4d')](_0x43c5f1[_0x2ff2('0x45')][_0x2ff2('0x4d')]);_0x857d96[_0x2ff2('0x4e')]=qs[_0x2ff2('0x47')](_[_0x2ff2('0x4f')](_0x43c5f1[_0x2ff2('0x45')],_0x203085['filters']));if(_0x43c5f1['query']['filter']){_0x857d96[_0x2ff2('0x4e')]=_[_0x2ff2('0x50')](_0x857d96[_0x2ff2('0x4e')],{'$or':_[_0x2ff2('0x3f')](_0x31b105,function(_0x19916a){if(_0x19916a['type']!==_0x2ff2('0x51')){var _0x502990={};_0x502990[_0x19916a[_0x2ff2('0x3c')]]={'$like':'%'+_0x43c5f1[_0x2ff2('0x45')][_0x2ff2('0x52')]+'%'};return _0x502990;}})});}_0x857d96=_['merge']({},_0x857d96,_0x43c5f1[_0x2ff2('0x53')]);var _0x4e99cf={'where':_0x857d96[_0x2ff2('0x4e')]};return db[_0x2ff2('0x54')][_0x2ff2('0x55')](_0x4e99cf)[_0x2ff2('0x26')](function(_0x4f18b2){_0x3fd022['count']=_0x4f18b2;if(_0x43c5f1[_0x2ff2('0x45')][_0x2ff2('0x56')]){_0x857d96['include']=[{'all':!![]}];}return db[_0x2ff2('0x54')][_0x2ff2('0x57')](_0x857d96);})[_0x2ff2('0x26')](function(_0x2b9e44){_0x3fd022[_0x2ff2('0x58')]=_0x2b9e44;return _0x3fd022;})[_0x2ff2('0x26')](respondWithFilteredResult(_0x36b9c8,_0x857d96))[_0x2ff2('0x2d')](handleError(_0x36b9c8,null));};exports['show']=function(_0x2b7967,_0x8c952d){var _0x159f6a={'raw':!![],'where':{'id':_0x2b7967[_0x2ff2('0x59')]['id']}},_0x312c98={};_0x312c98[_0x2ff2('0x44')]=_['keys'](db[_0x2ff2('0x54')][_0x2ff2('0x40')]);_0x312c98[_0x2ff2('0x45')]=_[_0x2ff2('0x46')](_0x2b7967[_0x2ff2('0x45')]);_0x312c98[_0x2ff2('0x47')]=_[_0x2ff2('0x5a')](_0x312c98[_0x2ff2('0x44')],_0x312c98[_0x2ff2('0x45')]);_0x159f6a['attributes']=_[_0x2ff2('0x5a')](_0x312c98['model'],qs['fields'](_0x2b7967[_0x2ff2('0x45')][_0x2ff2('0x49')]));_0x159f6a[_0x2ff2('0x48')]=_0x159f6a[_0x2ff2('0x48')][_0x2ff2('0x4a')]?_0x159f6a[_0x2ff2('0x48')]:_0x312c98['model'];if(_0x2b7967[_0x2ff2('0x45')]['includeAll']){_0x159f6a[_0x2ff2('0x5b')]=[{'all':!![]}];}_0x159f6a=_[_0x2ff2('0x50')]({},_0x159f6a,_0x2b7967[_0x2ff2('0x53')]);return db[_0x2ff2('0x54')][_0x2ff2('0x5c')](_0x159f6a)[_0x2ff2('0x26')](handleEntityNotFound(_0x8c952d,null))[_0x2ff2('0x26')](respondWithResult(_0x8c952d,null))[_0x2ff2('0x2d')](handleError(_0x8c952d,null));};exports[_0x2ff2('0x5d')]=function(_0x48421e,_0x5b852d){return db[_0x2ff2('0x54')][_0x2ff2('0x5d')](_0x48421e[_0x2ff2('0x5e')],{})[_0x2ff2('0x26')](function(_0x52685e){var _0x4f01b8=_0x48421e[_0x2ff2('0x5f')][_0x2ff2('0x36')]({'plain':!![]});if(!_0x4f01b8)throw new Error(_0x2ff2('0x60'));if(_0x4f01b8[_0x2ff2('0x61')]===_0x2ff2('0x5f')){var _0x3337ba=_0x52685e[_0x2ff2('0x36')]({'plain':!![]});var _0x5a84c6=_0x2ff2('0x37');return db[_0x2ff2('0x62')][_0x2ff2('0x5c')]({'where':{'name':_0x5a84c6,'userProfileId':_0x4f01b8[_0x2ff2('0x63')]},'raw':!![]})['then'](function(_0x1bd379){if(_0x1bd379&&_0x1bd379[_0x2ff2('0x64')]===0x0){return db[_0x2ff2('0x38')]['create']({'name':_0x3337ba['name'],'resourceId':_0x3337ba['id'],'type':_0x1bd379['name'],'sectionId':_0x1bd379['id']},{})[_0x2ff2('0x26')](function(){return _0x52685e;});}else{return _0x52685e;}})[_0x2ff2('0x2d')](function(_0x44e9c1){logger[_0x2ff2('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44e9c1);throw _0x44e9c1;});}return _0x52685e;})[_0x2ff2('0x26')](respondWithResult(_0x5b852d,0xc9))[_0x2ff2('0x2d')](handleError(_0x5b852d,null));};exports[_0x2ff2('0x34')]=function(_0x29a3b3,_0x54bc6c){if(_0x29a3b3[_0x2ff2('0x5e')]['id']){delete _0x29a3b3[_0x2ff2('0x5e')]['id'];}return db['ChatQueue'][_0x2ff2('0x5c')]({'where':{'id':_0x29a3b3[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](handleEntityNotFound(_0x54bc6c,null))[_0x2ff2('0x26')](saveUpdates(_0x29a3b3['body'],null))[_0x2ff2('0x26')](respondWithResult(_0x54bc6c,null))[_0x2ff2('0x2d')](handleError(_0x54bc6c,null));};exports[_0x2ff2('0x35')]=function(_0x653c82,_0x261d68){return db[_0x2ff2('0x54')]['find']({'where':{'id':_0x653c82[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](handleEntityNotFound(_0x261d68,null))['then'](removeEntity(_0x261d68,null))[_0x2ff2('0x2d')](handleError(_0x261d68,null));};exports['describe']=function(_0x439b01,_0x4de92e){return db[_0x2ff2('0x54')]['describe']()[_0x2ff2('0x26')](respondWithResult(_0x4de92e,null))[_0x2ff2('0x2d')](handleError(_0x4de92e,null));};exports[_0x2ff2('0x65')]=function(_0x44384f,_0x262ec6,_0x18d486){var _0x5f1b4a={'raw':!![],'where':{}},_0x2aac3b={},_0x490811;return db['ChatQueue'][_0x2ff2('0x66')]({'where':{'id':_0x44384f[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](handleEntityNotFound(_0x262ec6,null))['then'](function(_0x51a770){if(_0x51a770){_0x490811=_0x51a770[_0x2ff2('0x36')]({'plain':!![]});_0x2aac3b['model']=_[_0x2ff2('0x46')](db[_0x2ff2('0x67')][_0x2ff2('0x40')]);_0x2aac3b[_0x2ff2('0x45')]=_[_0x2ff2('0x46')](_0x44384f[_0x2ff2('0x45')]);_0x2aac3b[_0x2ff2('0x47')]=_['intersection'](_0x2aac3b[_0x2ff2('0x44')],_0x2aac3b[_0x2ff2('0x45')]);_0x5f1b4a[_0x2ff2('0x48')]=_[_0x2ff2('0x5a')](_0x2aac3b[_0x2ff2('0x44')],qs[_0x2ff2('0x49')](_0x44384f[_0x2ff2('0x45')][_0x2ff2('0x49')]));_0x5f1b4a['attributes']=_0x5f1b4a['attributes'][_0x2ff2('0x4a')]?_0x5f1b4a['attributes']:_0x2aac3b[_0x2ff2('0x44')];if(!_0x44384f[_0x2ff2('0x45')]['hasOwnProperty'](_0x2ff2('0x68'))){_0x5f1b4a[_0x2ff2('0x30')]=qs['limit'](_0x44384f['query'][_0x2ff2('0x30')]);_0x5f1b4a[_0x2ff2('0x4c')]=qs[_0x2ff2('0x4c')](_0x44384f['query'][_0x2ff2('0x4c')]);}_0x5f1b4a[_0x2ff2('0x69')]=qs[_0x2ff2('0x4d')](_0x44384f[_0x2ff2('0x45')][_0x2ff2('0x4d')]);_0x5f1b4a[_0x2ff2('0x4e')]=qs[_0x2ff2('0x47')](_[_0x2ff2('0x4f')](_0x44384f[_0x2ff2('0x45')],_0x2aac3b['filters']));_0x5f1b4a[_0x2ff2('0x4e')][_0x2ff2('0x6a')]=_0x51a770['id'];if(_0x44384f['query'][_0x2ff2('0x52')]){_0x5f1b4a[_0x2ff2('0x4e')]=_['merge'](_0x5f1b4a[_0x2ff2('0x4e')],{'$or':_[_0x2ff2('0x3f')](_0x5f1b4a['attributes'],function(_0xeba062){var _0x24b8f7={};_0x24b8f7[_0xeba062]={'$like':'%'+_0x44384f[_0x2ff2('0x45')][_0x2ff2('0x52')]+'%'};return _0x24b8f7;})});}_0x5f1b4a=_[_0x2ff2('0x50')]({},_0x5f1b4a,_0x44384f['options']);return db[_0x2ff2('0x67')][_0x2ff2('0x57')](_0x5f1b4a);}})['then'](function(_0x47321a){if(_0x47321a){return db[_0x2ff2('0x6b')][_0x2ff2('0x6c')]({'where':{'id':_[_0x2ff2('0x3f')](_0x47321a,_0x2ff2('0x6d')),'role':_0x2ff2('0x6e')},'attributes':['id',_0x2ff2('0x3c'),_0x2ff2('0x6f'),_0x2ff2('0x70'),_0x2ff2('0x71')]});}})[_0x2ff2('0x26')](function(_0x222bcf){if(_0x222bcf){return{'count':_0x222bcf[_0x2ff2('0x55')],'rows':_[_0x2ff2('0x3f')](_0x222bcf[_0x2ff2('0x58')],function(_0x4df077){return{'membername':_0x4df077['name'],'UserId':_0x4df077['id'],'queue_name':_0x490811[_0x2ff2('0x3c')],'ChatQueueId':_0x490811['id'],'interface':util['format'](_0x2ff2('0x72'),_0x2ff2('0x73'),_0x4df077[_0x2ff2('0x3c')]),'penalty':0x0,'paused':_0x4df077[_0x2ff2('0x6f')],'createdAt':_0x4df077[_0x2ff2('0x71')],'updatedAt':_0x4df077[_0x2ff2('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2ff2('0x26')](respondWithFilteredResult(_0x262ec6,_0x5f1b4a))['catch'](handleError(_0x262ec6,null));};exports[_0x2ff2('0x74')]=function(_0x4aca4e,_0x22c251,_0x5032f2){var _0x339ca1={};var _0x6dac6c={};var _0x11d777;var _0x545dcb;return db['ChatQueue'][_0x2ff2('0x66')]({'where':{'id':_0x4aca4e[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](handleEntityNotFound(_0x22c251,null))['then'](function(_0x4d18f4){if(_0x4d18f4){_0x11d777=_0x4d18f4;_0x6dac6c['model']=_[_0x2ff2('0x46')](db[_0x2ff2('0x75')][_0x2ff2('0x40')]);_0x6dac6c['query']=_['keys'](_0x4aca4e['query']);_0x6dac6c[_0x2ff2('0x47')]=_[_0x2ff2('0x5a')](_0x6dac6c[_0x2ff2('0x44')],_0x6dac6c[_0x2ff2('0x45')]);_0x339ca1[_0x2ff2('0x48')]=_['intersection'](_0x6dac6c['model'],qs['fields'](_0x4aca4e[_0x2ff2('0x45')][_0x2ff2('0x49')]));_0x339ca1[_0x2ff2('0x48')]=_0x339ca1['attributes'][_0x2ff2('0x4a')]?_0x339ca1['attributes']:_0x6dac6c[_0x2ff2('0x44')];_0x339ca1[_0x2ff2('0x69')]=qs[_0x2ff2('0x4d')](_0x4aca4e[_0x2ff2('0x45')][_0x2ff2('0x4d')]);_0x339ca1[_0x2ff2('0x4e')]=qs[_0x2ff2('0x47')](_[_0x2ff2('0x4f')](_0x4aca4e[_0x2ff2('0x45')],_0x6dac6c['filters']));if(_0x4aca4e['query'][_0x2ff2('0x52')]){_0x339ca1['where']=_[_0x2ff2('0x50')](_0x339ca1[_0x2ff2('0x4e')],{'$or':_['map'](_0x339ca1[_0x2ff2('0x48')],function(_0x316414){var _0x27786d={};_0x27786d[_0x316414]={'$like':'%'+_0x4aca4e['query']['filter']+'%'};return _0x27786d;})});}_0x339ca1=_['merge']({},_0x339ca1,_0x4aca4e[_0x2ff2('0x53')]);return _0x11d777['getTeams'](_0x339ca1);}})[_0x2ff2('0x26')](function(_0x229b4f){if(_0x229b4f){_0x545dcb=_0x229b4f[_0x2ff2('0x4a')];if(!_0x4aca4e[_0x2ff2('0x45')]['hasOwnProperty'](_0x2ff2('0x68'))){_0x339ca1[_0x2ff2('0x30')]=qs[_0x2ff2('0x30')](_0x4aca4e['query'][_0x2ff2('0x30')]);_0x339ca1['offset']=qs[_0x2ff2('0x4c')](_0x4aca4e['query']['offset']);}return _0x11d777[_0x2ff2('0x74')](_0x339ca1);}})[_0x2ff2('0x26')](function(_0x248baf){if(_0x248baf){return _0x248baf?{'count':_0x545dcb,'rows':_0x248baf}:null;}})[_0x2ff2('0x26')](respondWithResult(_0x22c251,null))[_0x2ff2('0x2d')](handleError(_0x22c251,null));};exports[_0x2ff2('0x76')]=function(_0x222785,_0x3ff440,_0x1634a3){var _0xfeaf80=_0x222785[_0x2ff2('0x5e')][_0x2ff2('0x77')];return db[_0x2ff2('0x75')][_0x2ff2('0x57')]({'where':{'id':_0xfeaf80},'attributes':['id'],'include':[{'model':db[_0x2ff2('0x6b')],'as':_0x2ff2('0x78'),'attributes':['id',_0x2ff2('0x3c'),_0x2ff2('0x79'),_0x2ff2('0x7a'),_0x2ff2('0x7b')],'raw':!![]}]})[_0x2ff2('0x26')](function(_0x3d2349){if(_0x3d2349){var _0xc2eff5=_[_0x2ff2('0x7c')](_0x3d2349,function(_0x5060be){var _0x1658a4=_0x5060be[_0x2ff2('0x36')]({'plain':!![]});return _0x1658a4[_0x2ff2('0x78')];});return db[_0x2ff2('0x54')][_0x2ff2('0x5c')]({'where':{'id':_0x222785[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](function(_0x4024f0){return db[_0x2ff2('0x7d')][_0x2ff2('0x7e')](function(_0x35da11){return _0x4024f0['addTeams'](_0xfeaf80,{'transaction':_0x35da11})[_0x2ff2('0x26')](function(){return BPromise[_0x2ff2('0x7f')](_0xc2eff5,function(_0x241308){return db[_0x2ff2('0x67')][_0x2ff2('0x80')]({'where':{'UserId':_0x241308['id'],'ChatQueueId':_0x222785['params']['id']},'transaction':_0x35da11});});})['then'](function(){_0xc2eff5[_0x2ff2('0x81')](function(_0x5eed58){socket[_0x2ff2('0x82')](_0x2ff2('0x83'),{'UserId':_0x5eed58['id'],'ChatQueueId':_0x4024f0['id']});});});});});}})[_0x2ff2('0x26')](respondWithStatusCode(_0x3ff440,null))[_0x2ff2('0x2d')](handleError(_0x3ff440,null));};exports['removeTeams']=function(_0x421e39,_0x6f7e09,_0x1177f9){return db[_0x2ff2('0x75')][_0x2ff2('0x57')]({'where':{'id':_0x421e39[_0x2ff2('0x45')][_0x2ff2('0x77')]},'attributes':['id'],'include':[{'model':db[_0x2ff2('0x6b')],'as':_0x2ff2('0x78'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x6f7e09,null))[_0x2ff2('0x26')](function(_0x39a8ec){var _0x123466=_[_0x2ff2('0x3f')](_0x39a8ec,'id');var _0x4ce54e=[];var _0x52c361=[];var _0x453a0d=squel['select']();_0x453a0d[_0x2ff2('0x84')](_0x2ff2('0x85'))[_0x2ff2('0x86')](_0x2ff2('0x87'),'tq')[_0x2ff2('0x88')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x2ff2('0x89'),_0x421e39[_0x2ff2('0x59')]['id']);for(var _0x4c09b6=0x0;_0x4c09b6<_0x39a8ec[_0x2ff2('0x4a')];_0x4c09b6+=0x1){let _0x1ff945=_0x39a8ec[_0x4c09b6];for(var _0x14ff82=0x0;_0x14ff82<_0x1ff945[_0x2ff2('0x78')]['length'];_0x14ff82+=0x1){let _0x2f98b3=_0x1ff945['Agents'][_0x14ff82];var _0x149973=_0x453a0d[_0x2ff2('0x8a')]();_0x149973['where'](_0x2ff2('0x8b'),_0x2f98b3['id']);_0x52c361[_0x2ff2('0x8c')](db[_0x2ff2('0x7d')][_0x2ff2('0x45')](_0x149973[_0x2ff2('0x8d')](),{'type':db['sequelize'][_0x2ff2('0x8e')]['SELECT']})[_0x2ff2('0x26')](function(_0x24c81b){if(_0x24c81b[_0x2ff2('0x4a')]===0x1){return _0x2f98b3['id'];}else{var _0x22fc5c=_[_0x2ff2('0x8f')](_[_0x2ff2('0x3f')](_0x24c81b,_0x2ff2('0x90')),function(_0x38a344){return _[_0x2ff2('0x91')](_0x123466,_0x38a344);});if(_0x22fc5c){return _0x2f98b3['id'];}}}));}}return BPromise[_0x2ff2('0x92')](_0x52c361)[_0x2ff2('0x26')](function(_0x30fc3a){_0x4ce54e=_(_0x4ce54e)['union'](_0x30fc3a)[_0x2ff2('0x93')]()['value']();return db['ChatQueue'][_0x2ff2('0x5c')]({'where':{'id':_0x421e39[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](function(_0x4f86ff){return db['sequelize'][_0x2ff2('0x7e')](function(_0x41092e){return _0x4f86ff[_0x2ff2('0x94')](_0x421e39[_0x2ff2('0x45')]['ids'],{'transaction':_0x41092e})[_0x2ff2('0x26')](function(){if(!_['isEmpty'](_0x4ce54e)){return _0x4f86ff[_0x2ff2('0x95')](_0x4ce54e,{'transaction':_0x41092e});}})[_0x2ff2('0x26')](function(){_0x4ce54e['forEach'](function(_0xfd3319){socket[_0x2ff2('0x82')](_0x2ff2('0x96'),{'UserId':_0xfd3319,'ChatQueueId':_0x4f86ff['id']});});});});});});})[_0x2ff2('0x26')](respondWithStatusCode(_0x6f7e09,null))[_0x2ff2('0x2d')](handleError(_0x6f7e09,null));};exports['addAgents']=function(_0x27e426,_0x462fb5,_0x1cad08){return db[_0x2ff2('0x54')]['find']({'where':{'id':_0x27e426[_0x2ff2('0x59')]['id']}})['then'](handleEntityNotFound(_0x462fb5,null))[_0x2ff2('0x26')](function(_0xa7c085){if(_0xa7c085){return _0xa7c085[_0x2ff2('0x97')](_0x27e426[_0x2ff2('0x5e')][_0x2ff2('0x77')],_[_0x2ff2('0x98')](_0x27e426[_0x2ff2('0x5e')],['ids','id'])||{})[_0x2ff2('0x99')](function(_0x1bde9d){for(var _0xfbfe7a=0x0;_0xfbfe7a<_0x27e426[_0x2ff2('0x5e')][_0x2ff2('0x77')][_0x2ff2('0x4a')];_0xfbfe7a+=0x1){socket[_0x2ff2('0x82')](_0x2ff2('0x83'),{'UserId':_0x27e426[_0x2ff2('0x5e')][_0x2ff2('0x77')][_0xfbfe7a],'ChatQueueId':_0x27e426[_0x2ff2('0x59')]['id']});}return _0x1bde9d;});}})[_0x2ff2('0x26')](respondWithResult(_0x462fb5,null))['catch'](handleError(_0x462fb5,null));};exports['removeAgents']=function(_0x5f1b5f,_0x3423ef,_0x4af3b7){return db['ChatQueue'][_0x2ff2('0x5c')]({'where':{'id':_0x5f1b5f[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](handleEntityNotFound(_0x3423ef,null))['then'](function(_0x4d4c7e){if(_0x4d4c7e){return _0x4d4c7e['removeAgents'](_0x5f1b5f[_0x2ff2('0x45')]['ids'])[_0x2ff2('0x26')](function(){if(_['isArray'](_0x5f1b5f[_0x2ff2('0x45')][_0x2ff2('0x77')])){for(var _0x3e89b4=0x0;_0x3e89b4<_0x5f1b5f[_0x2ff2('0x45')][_0x2ff2('0x77')]['length'];_0x3e89b4+=0x1){socket[_0x2ff2('0x82')]('userChatQueue:remove',{'UserId':Number(_0x5f1b5f[_0x2ff2('0x45')]['ids'][_0x3e89b4]),'ChatQueueId':Number(_0x5f1b5f[_0x2ff2('0x59')]['id'])});}}else{socket[_0x2ff2('0x82')](_0x2ff2('0x96'),{'UserId':Number(_0x5f1b5f[_0x2ff2('0x45')][_0x2ff2('0x77')]),'ChatQueueId':Number(_0x5f1b5f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3423ef,null))[_0x2ff2('0x2d')](handleError(_0x3423ef,null));};exports['getAgents']=function(_0x41d76e,_0x327466,_0x303212){var _0x397ac4={};var _0x302943={};var _0xb1c06c;var _0x2eda6e;return db[_0x2ff2('0x54')][_0x2ff2('0x66')]({'where':{'id':_0x41d76e[_0x2ff2('0x59')]['id']}})[_0x2ff2('0x26')](handleEntityNotFound(_0x327466,null))[_0x2ff2('0x26')](function(_0x408914){if(_0x408914){_0xb1c06c=_0x408914;_0x302943[_0x2ff2('0x44')]=_[_0x2ff2('0x46')](db[_0x2ff2('0x6b')][_0x2ff2('0x40')]);_0x302943[_0x2ff2('0x45')]=_['keys'](_0x41d76e[_0x2ff2('0x45')]);_0x302943['filters']=_[_0x2ff2('0x5a')](_0x302943[_0x2ff2('0x44')],_0x302943['query']);_0x397ac4['attributes']=_[_0x2ff2('0x5a')](_0x302943[_0x2ff2('0x44')],qs[_0x2ff2('0x49')](_0x41d76e[_0x2ff2('0x45')]['fields']));_0x397ac4[_0x2ff2('0x48')]=_0x397ac4[_0x2ff2('0x48')][_0x2ff2('0x4a')]?_0x397ac4[_0x2ff2('0x48')]:_0x302943['model'];_0x397ac4['order']=qs[_0x2ff2('0x4d')](_0x41d76e[_0x2ff2('0x45')][_0x2ff2('0x4d')]);_0x397ac4['where']=qs[_0x2ff2('0x47')](_[_0x2ff2('0x4f')](_0x41d76e[_0x2ff2('0x45')],_0x302943['filters']));if(_0x41d76e[_0x2ff2('0x45')][_0x2ff2('0x52')]){_0x397ac4[_0x2ff2('0x4e')]=_[_0x2ff2('0x50')](_0x397ac4['where'],{'$or':_[_0x2ff2('0x3f')](_0x397ac4[_0x2ff2('0x48')],function(_0x5a21d7){var _0x2c3b6b={};_0x2c3b6b[_0x5a21d7]={'$like':'%'+_0x41d76e['query'][_0x2ff2('0x52')]+'%'};return _0x2c3b6b;})});}_0x397ac4=_['merge']({},_0x397ac4,_0x41d76e[_0x2ff2('0x53')]);return _0xb1c06c[_0x2ff2('0x9a')](_0x397ac4);}})[_0x2ff2('0x26')](function(_0x20d6b9){if(_0x20d6b9){_0x2eda6e=_0x20d6b9[_0x2ff2('0x4a')];if(!_0x41d76e['query'][_0x2ff2('0x4b')](_0x2ff2('0x68'))){_0x397ac4[_0x2ff2('0x30')]=qs[_0x2ff2('0x30')](_0x41d76e['query'][_0x2ff2('0x30')]);_0x397ac4[_0x2ff2('0x4c')]=qs[_0x2ff2('0x4c')](_0x41d76e[_0x2ff2('0x45')][_0x2ff2('0x4c')]);}return _0xb1c06c[_0x2ff2('0x9a')](_0x397ac4);}})['then'](function(_0x3986b3){if(_0x3986b3){return _0x3986b3?{'count':_0x2eda6e,'rows':_0x3986b3}:null;}})[_0x2ff2('0x26')](respondWithResult(_0x327466,null))[_0x2ff2('0x2d')](handleError(_0x327466,null));}; \ No newline at end of file +var _0x9fe7=['includes','union','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','sendStatus','status','offset','limit','set','json','apply','reject','update','destroy','ChatQueues','UserProfileResource','end','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','ChatQueue','count','includeAll','include','rows','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','findAll','User','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','pick','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','TeamId'];(function(_0x1b4fb4,_0x35346b){var _0x6c1374=function(_0x4bef84){while(--_0x4bef84){_0x1b4fb4['push'](_0x1b4fb4['shift']());}};_0x6c1374(++_0x35346b);}(_0x9fe7,0x1df));var _0x79fe=function(_0x587951,_0x4de605){_0x587951=_0x587951-0x0;var _0x2921c8=_0x9fe7[_0x587951];return _0x2921c8;};'use strict';var pdf=require(_0x79fe('0x0'));var emlformat=require(_0x79fe('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x79fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x79fe('0x3'));var moment=require(_0x79fe('0x4'));var BPromise=require(_0x79fe('0x5'));var Mustache=require('mustache');var util=require(_0x79fe('0x6'));var path=require(_0x79fe('0x7'));var sox=require(_0x79fe('0x8'));var csv=require('to-csv');var ejs=require(_0x79fe('0x9'));var fs=require('fs');var _=require(_0x79fe('0xa'));var squel=require(_0x79fe('0xb'));var crypto=require('crypto');var jsforce=require(_0x79fe('0xc'));var deskjs=require(_0x79fe('0xd'));var toCsv=require(_0x79fe('0xe'));var querystring=require(_0x79fe('0xf'));var Papa=require(_0x79fe('0x10'));var Redis=require('ioredis');var authService=require(_0x79fe('0x11'));var qs=require(_0x79fe('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79fe('0x13'));var logger=require(_0x79fe('0x14'))(_0x79fe('0x15'));var utils=require(_0x79fe('0x16'));var config=require('../../config/environment');var db=require(_0x79fe('0x17'))['db'];config[_0x79fe('0x18')]=_[_0x79fe('0x19')](config[_0x79fe('0x18')],{'host':_0x79fe('0x1a'),'port':0x18eb});var socket=require(_0x79fe('0x1b'))(new Redis(config[_0x79fe('0x18')]));require(_0x79fe('0x1c'))['register'](socket);var jayson=require(_0x79fe('0x1d'));var client=jayson[_0x79fe('0x1e')][_0x79fe('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x536944,_0x35fb79,_0x25e91b){if(_0x25e91b){var _0x58124b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58124b[_0x79fe('0x20')](_0x35fb79)){return _0x536944;}else{throw new db[(_0x79fe('0x21'))][(_0x79fe('0x22'))](_0x79fe('0x23'));}}else{return _0x536944;}}function respondWithRpcPromise(_0x5eadbf,_0x416b5b,_0x16f93a,_0x39be95){return new BPromise(function(_0x40a549,_0x536641){var _0x5e2f0b=_0x39be95||client;return _0x5e2f0b[_0x79fe('0x24')](_0x5eadbf,_0x16f93a)[_0x79fe('0x25')](function(_0x25e51f){logger['info'](_0x79fe('0x26'),_0x416b5b,_0x79fe('0x27'));logger[_0x79fe('0x28')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x416b5b,_0x79fe('0x27'),JSON['stringify'](_0x25e51f));if(_0x25e51f[_0x79fe('0x29')]){if(_0x25e51f[_0x79fe('0x29')][_0x79fe('0x2a')]===0x1f4){logger[_0x79fe('0x29')](_0x79fe('0x26'),_0x416b5b,_0x25e51f[_0x79fe('0x29')]['message']);return _0x536641(_0x25e51f['error'][_0x79fe('0x2b')]);}logger['error'](_0x79fe('0x26'),_0x416b5b,_0x25e51f[_0x79fe('0x29')]['message']);return _0x40a549(_0x25e51f['error'][_0x79fe('0x2b')]);}else{logger[_0x79fe('0x2c')]('ChatQueue,\x20%s,\x20%s',_0x416b5b,_0x79fe('0x27'));_0x40a549(_0x25e51f[_0x79fe('0x2d')]['message']);}})['catch'](function(_0x4ea368){logger[_0x79fe('0x29')](_0x79fe('0x26'),_0x416b5b,_0x4ea368);_0x536641(_0x4ea368);});});}function respondWithStatusCode(_0x36ead5,_0x4ac913){_0x4ac913=_0x4ac913||0xcc;return function(_0x47786f){if(_0x47786f){return _0x36ead5[_0x79fe('0x2e')](_0x4ac913);}return _0x36ead5[_0x79fe('0x2f')](_0x4ac913)['end']();};}function respondWithResult(_0x4e2740,_0x14e055){_0x14e055=_0x14e055||0xc8;return function(_0x51200f){if(_0x51200f){return _0x4e2740[_0x79fe('0x2f')](_0x14e055)['json'](_0x51200f);}};}function respondWithFilteredResult(_0x4d1a9a,_0x5b4835){return function(_0x59b44d){if(_0x59b44d){var _0x13f8da=_0x59b44d['count'],_0xd2ec88=_0x5b4835[_0x79fe('0x30')],_0x4dff5f=_0x5b4835[_0x79fe('0x30')]+_0x5b4835[_0x79fe('0x31')],_0x2b6975;if(_0x4dff5f>=_0x13f8da){_0x4dff5f=_0x13f8da;_0x2b6975=0xc8;}else{_0x2b6975=0xce;}_0x4d1a9a[_0x79fe('0x2f')](_0x2b6975);return _0x4d1a9a[_0x79fe('0x32')]('Content-Range',_0xd2ec88+'-'+_0x4dff5f+'/'+_0x13f8da)[_0x79fe('0x33')](_0x59b44d);}return null;};}function patchUpdates(_0x2dbf62){return function(_0x25ef07){try{jsonpatch[_0x79fe('0x34')](_0x25ef07,_0x2dbf62,!![]);}catch(_0x445db9){return BPromise[_0x79fe('0x35')](_0x445db9);}return _0x25ef07['save']();};}function saveUpdates(_0x3b50e7,_0x125226){return function(_0x8ddef3){if(_0x8ddef3){return _0x8ddef3[_0x79fe('0x36')](_0x3b50e7)[_0x79fe('0x25')](function(_0x6a8a24){return _0x6a8a24;});}return null;};}function removeEntity(_0x596040,_0x2d4705){return function(_0x5a917f){if(_0x5a917f){return _0x5a917f[_0x79fe('0x37')]()['then'](function(){var _0x2a533b=_0x5a917f['get']({'plain':!![]});var _0x1ee275=_0x79fe('0x38');return db[_0x79fe('0x39')]['destroy']({'where':{'type':_0x1ee275,'resourceId':_0x2a533b['id']}})[_0x79fe('0x25')](function(){return _0x5a917f;});})[_0x79fe('0x25')](function(){_0x596040[_0x79fe('0x2f')](0xcc)[_0x79fe('0x3a')]();});}};}function handleEntityNotFound(_0x2b203b,_0x5b15bb){return function(_0x53957b){if(!_0x53957b){_0x2b203b[_0x79fe('0x2e')](0x194);}return _0x53957b;};}function handleError(_0x4a8336,_0x27de50){_0x27de50=_0x27de50||0x1f4;return function(_0x44d97e){logger['error'](_0x44d97e[_0x79fe('0x3b')]);if(_0x44d97e[_0x79fe('0x3c')]){delete _0x44d97e[_0x79fe('0x3c')];}_0x4a8336[_0x79fe('0x2f')](_0x27de50)[_0x79fe('0x3d')](_0x44d97e);};}exports[_0x79fe('0x3e')]=function(_0x5e1bf1,_0x3f099f){var _0x30b8c3={},_0x35a5ec={},_0x2d2908={'count':0x0,'rows':[]};var _0x4eada4=_[_0x79fe('0x3f')](db['ChatQueue'][_0x79fe('0x40')],function(_0x5e29b5){return{'name':_0x5e29b5[_0x79fe('0x41')],'type':_0x5e29b5['type'][_0x79fe('0x42')]};});_0x35a5ec[_0x79fe('0x43')]=_['map'](_0x4eada4,'name');_0x35a5ec[_0x79fe('0x44')]=_[_0x79fe('0x45')](_0x5e1bf1[_0x79fe('0x44')]);_0x35a5ec[_0x79fe('0x46')]=_['intersection'](_0x35a5ec['model'],_0x35a5ec[_0x79fe('0x44')]);_0x30b8c3[_0x79fe('0x47')]=_[_0x79fe('0x48')](_0x35a5ec[_0x79fe('0x43')],qs[_0x79fe('0x49')](_0x5e1bf1[_0x79fe('0x44')][_0x79fe('0x49')]));_0x30b8c3[_0x79fe('0x47')]=_0x30b8c3['attributes'][_0x79fe('0x4a')]?_0x30b8c3[_0x79fe('0x47')]:_0x35a5ec[_0x79fe('0x43')];if(!_0x5e1bf1[_0x79fe('0x44')][_0x79fe('0x4b')](_0x79fe('0x4c'))){_0x30b8c3['limit']=qs[_0x79fe('0x31')](_0x5e1bf1[_0x79fe('0x44')][_0x79fe('0x31')]);_0x30b8c3[_0x79fe('0x30')]=qs[_0x79fe('0x30')](_0x5e1bf1[_0x79fe('0x44')]['offset']);}_0x30b8c3[_0x79fe('0x4d')]=qs[_0x79fe('0x4e')](_0x5e1bf1[_0x79fe('0x44')]['sort']);_0x30b8c3[_0x79fe('0x4f')]=qs['filters'](_['pick'](_0x5e1bf1[_0x79fe('0x44')],_0x35a5ec[_0x79fe('0x46')]));if(_0x5e1bf1[_0x79fe('0x44')]['filter']){_0x30b8c3[_0x79fe('0x4f')]=_[_0x79fe('0x50')](_0x30b8c3[_0x79fe('0x4f')],{'$or':_['map'](_0x4eada4,function(_0x4b3841){if(_0x4b3841[_0x79fe('0x51')]!==_0x79fe('0x52')){var _0x1594ce={};_0x1594ce[_0x4b3841[_0x79fe('0x3c')]]={'$like':'%'+_0x5e1bf1[_0x79fe('0x44')][_0x79fe('0x53')]+'%'};return _0x1594ce;}})});}_0x30b8c3=_[_0x79fe('0x50')]({},_0x30b8c3,_0x5e1bf1[_0x79fe('0x54')]);var _0x2b46ad={'where':_0x30b8c3['where']};return db[_0x79fe('0x55')][_0x79fe('0x56')](_0x2b46ad)['then'](function(_0x22ab55){_0x2d2908['count']=_0x22ab55;if(_0x5e1bf1[_0x79fe('0x44')][_0x79fe('0x57')]){_0x30b8c3[_0x79fe('0x58')]=[{'all':!![]}];}return db[_0x79fe('0x55')]['findAll'](_0x30b8c3);})[_0x79fe('0x25')](function(_0x23faee){_0x2d2908[_0x79fe('0x59')]=_0x23faee;return _0x2d2908;})['then'](respondWithFilteredResult(_0x3f099f,_0x30b8c3))['catch'](handleError(_0x3f099f,null));};exports[_0x79fe('0x5a')]=function(_0x1ce058,_0x5a00f5){var _0x1ae54f={'raw':!![],'where':{'id':_0x1ce058[_0x79fe('0x5b')]['id']}},_0x368e5d={};_0x368e5d[_0x79fe('0x43')]=_['keys'](db[_0x79fe('0x55')][_0x79fe('0x40')]);_0x368e5d[_0x79fe('0x44')]=_['keys'](_0x1ce058['query']);_0x368e5d['filters']=_['intersection'](_0x368e5d['model'],_0x368e5d[_0x79fe('0x44')]);_0x1ae54f[_0x79fe('0x47')]=_['intersection'](_0x368e5d[_0x79fe('0x43')],qs[_0x79fe('0x49')](_0x1ce058[_0x79fe('0x44')]['fields']));_0x1ae54f['attributes']=_0x1ae54f['attributes'][_0x79fe('0x4a')]?_0x1ae54f['attributes']:_0x368e5d[_0x79fe('0x43')];if(_0x1ce058[_0x79fe('0x44')][_0x79fe('0x57')]){_0x1ae54f[_0x79fe('0x58')]=[{'all':!![]}];}_0x1ae54f=_[_0x79fe('0x50')]({},_0x1ae54f,_0x1ce058[_0x79fe('0x54')]);return db[_0x79fe('0x55')][_0x79fe('0x5c')](_0x1ae54f)[_0x79fe('0x25')](handleEntityNotFound(_0x5a00f5,null))[_0x79fe('0x25')](respondWithResult(_0x5a00f5,null))[_0x79fe('0x5d')](handleError(_0x5a00f5,null));};exports['create']=function(_0x3a24da,_0x397e40){return db['ChatQueue'][_0x79fe('0x5e')](_0x3a24da['body'],{})[_0x79fe('0x25')](function(_0x1fff51){var _0x523bf8=_0x3a24da[_0x79fe('0x5f')]['get']({'plain':!![]});if(!_0x523bf8)throw new Error(_0x79fe('0x60'));if(_0x523bf8['role']==='user'){var _0x492ac1=_0x1fff51[_0x79fe('0x61')]({'plain':!![]});var _0x272272=_0x79fe('0x38');return db[_0x79fe('0x62')][_0x79fe('0x5c')]({'where':{'name':_0x272272,'userProfileId':_0x523bf8[_0x79fe('0x63')]},'raw':!![]})[_0x79fe('0x25')](function(_0x206c20){if(_0x206c20&&_0x206c20[_0x79fe('0x64')]===0x0){return db['UserProfileResource'][_0x79fe('0x5e')]({'name':_0x492ac1[_0x79fe('0x3c')],'resourceId':_0x492ac1['id'],'type':_0x206c20[_0x79fe('0x3c')],'sectionId':_0x206c20['id']},{})[_0x79fe('0x25')](function(){return _0x1fff51;});}else{return _0x1fff51;}})['catch'](function(_0x128ad3){logger['error'](_0x79fe('0x65'),_0x128ad3);throw _0x128ad3;});}return _0x1fff51;})['then'](respondWithResult(_0x397e40,0xc9))[_0x79fe('0x5d')](handleError(_0x397e40,null));};exports[_0x79fe('0x36')]=function(_0x13c203,_0xec619e){if(_0x13c203['body']['id']){delete _0x13c203[_0x79fe('0x66')]['id'];}return db[_0x79fe('0x55')][_0x79fe('0x5c')]({'where':{'id':_0x13c203[_0x79fe('0x5b')]['id']}})['then'](handleEntityNotFound(_0xec619e,null))[_0x79fe('0x25')](saveUpdates(_0x13c203[_0x79fe('0x66')],null))['then'](respondWithResult(_0xec619e,null))[_0x79fe('0x5d')](handleError(_0xec619e,null));};exports['destroy']=function(_0x4ed2b8,_0x37ccea){return db[_0x79fe('0x55')][_0x79fe('0x5c')]({'where':{'id':_0x4ed2b8['params']['id']}})['then'](handleEntityNotFound(_0x37ccea,null))[_0x79fe('0x25')](removeEntity(_0x37ccea,null))['catch'](handleError(_0x37ccea,null));};exports['describe']=function(_0x47780b,_0xfa6867){return db[_0x79fe('0x55')][_0x79fe('0x67')]()[_0x79fe('0x25')](respondWithResult(_0xfa6867,null))[_0x79fe('0x5d')](handleError(_0xfa6867,null));};exports[_0x79fe('0x68')]=function(_0xc91129,_0x3c0326,_0x47f7e6){var _0x3766e4={'raw':!![],'where':{}},_0x36e157={},_0x546a47;return db[_0x79fe('0x55')][_0x79fe('0x69')]({'where':{'id':_0xc91129[_0x79fe('0x5b')]['id']}})[_0x79fe('0x25')](handleEntityNotFound(_0x3c0326,null))[_0x79fe('0x25')](function(_0x1d48ca){if(_0x1d48ca){_0x546a47=_0x1d48ca[_0x79fe('0x61')]({'plain':!![]});_0x36e157[_0x79fe('0x43')]=_[_0x79fe('0x45')](db[_0x79fe('0x6a')][_0x79fe('0x40')]);_0x36e157['query']=_[_0x79fe('0x45')](_0xc91129[_0x79fe('0x44')]);_0x36e157[_0x79fe('0x46')]=_[_0x79fe('0x48')](_0x36e157[_0x79fe('0x43')],_0x36e157[_0x79fe('0x44')]);_0x3766e4[_0x79fe('0x47')]=_['intersection'](_0x36e157[_0x79fe('0x43')],qs[_0x79fe('0x49')](_0xc91129[_0x79fe('0x44')]['fields']));_0x3766e4['attributes']=_0x3766e4['attributes']['length']?_0x3766e4[_0x79fe('0x47')]:_0x36e157['model'];if(!_0xc91129[_0x79fe('0x44')][_0x79fe('0x4b')](_0x79fe('0x4c'))){_0x3766e4[_0x79fe('0x31')]=qs[_0x79fe('0x31')](_0xc91129['query'][_0x79fe('0x31')]);_0x3766e4['offset']=qs[_0x79fe('0x30')](_0xc91129[_0x79fe('0x44')][_0x79fe('0x30')]);}_0x3766e4[_0x79fe('0x4d')]=qs[_0x79fe('0x4e')](_0xc91129[_0x79fe('0x44')][_0x79fe('0x4e')]);_0x3766e4['where']=qs[_0x79fe('0x46')](_['pick'](_0xc91129[_0x79fe('0x44')],_0x36e157[_0x79fe('0x46')]));_0x3766e4[_0x79fe('0x4f')]['ChatQueueId']=_0x1d48ca['id'];if(_0xc91129[_0x79fe('0x44')][_0x79fe('0x53')]){_0x3766e4[_0x79fe('0x4f')]=_[_0x79fe('0x50')](_0x3766e4['where'],{'$or':_[_0x79fe('0x3f')](_0x3766e4[_0x79fe('0x47')],function(_0x2d4bfa){var _0x55a2f5={};_0x55a2f5[_0x2d4bfa]={'$like':'%'+_0xc91129[_0x79fe('0x44')][_0x79fe('0x53')]+'%'};return _0x55a2f5;})});}_0x3766e4=_[_0x79fe('0x50')]({},_0x3766e4,_0xc91129[_0x79fe('0x54')]);return db[_0x79fe('0x6a')][_0x79fe('0x6b')](_0x3766e4);}})[_0x79fe('0x25')](function(_0x2ddbd7){if(_0x2ddbd7){return db[_0x79fe('0x6c')]['findAndCountAll']({'where':{'id':_[_0x79fe('0x3f')](_0x2ddbd7,'UserId'),'role':_0x79fe('0x6d')},'attributes':['id',_0x79fe('0x3c'),_0x79fe('0x6e'),_0x79fe('0x6f'),_0x79fe('0x70')]});}})['then'](function(_0x262d38){if(_0x262d38){return{'count':_0x262d38['count'],'rows':_[_0x79fe('0x3f')](_0x262d38[_0x79fe('0x59')],function(_0x4d2366){return{'membername':_0x4d2366[_0x79fe('0x3c')],'UserId':_0x4d2366['id'],'queue_name':_0x546a47[_0x79fe('0x3c')],'ChatQueueId':_0x546a47['id'],'interface':util[_0x79fe('0x71')](_0x79fe('0x72'),_0x79fe('0x73'),_0x4d2366['name']),'penalty':0x0,'paused':_0x4d2366[_0x79fe('0x6e')],'createdAt':_0x4d2366[_0x79fe('0x70')],'updatedAt':_0x4d2366[_0x79fe('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x79fe('0x25')](respondWithFilteredResult(_0x3c0326,_0x3766e4))[_0x79fe('0x5d')](handleError(_0x3c0326,null));};exports[_0x79fe('0x74')]=function(_0x477c6f,_0x24c6ad,_0x38fc15){var _0x202107={};var _0x53e1eb={};var _0xa227b9;var _0x5e1cf5;return db[_0x79fe('0x55')]['findOne']({'where':{'id':_0x477c6f[_0x79fe('0x5b')]['id']}})[_0x79fe('0x25')](handleEntityNotFound(_0x24c6ad,null))[_0x79fe('0x25')](function(_0x50fa09){if(_0x50fa09){_0xa227b9=_0x50fa09;_0x53e1eb[_0x79fe('0x43')]=_['keys'](db[_0x79fe('0x75')][_0x79fe('0x40')]);_0x53e1eb[_0x79fe('0x44')]=_[_0x79fe('0x45')](_0x477c6f['query']);_0x53e1eb[_0x79fe('0x46')]=_['intersection'](_0x53e1eb[_0x79fe('0x43')],_0x53e1eb[_0x79fe('0x44')]);_0x202107[_0x79fe('0x47')]=_[_0x79fe('0x48')](_0x53e1eb[_0x79fe('0x43')],qs['fields'](_0x477c6f[_0x79fe('0x44')]['fields']));_0x202107[_0x79fe('0x47')]=_0x202107[_0x79fe('0x47')]['length']?_0x202107[_0x79fe('0x47')]:_0x53e1eb[_0x79fe('0x43')];_0x202107[_0x79fe('0x4d')]=qs[_0x79fe('0x4e')](_0x477c6f[_0x79fe('0x44')][_0x79fe('0x4e')]);_0x202107['where']=qs['filters'](_[_0x79fe('0x76')](_0x477c6f[_0x79fe('0x44')],_0x53e1eb[_0x79fe('0x46')]));if(_0x477c6f['query'][_0x79fe('0x53')]){_0x202107[_0x79fe('0x4f')]=_[_0x79fe('0x50')](_0x202107[_0x79fe('0x4f')],{'$or':_[_0x79fe('0x3f')](_0x202107['attributes'],function(_0x3fbb0e){var _0xfb2ee6={};_0xfb2ee6[_0x3fbb0e]={'$like':'%'+_0x477c6f[_0x79fe('0x44')]['filter']+'%'};return _0xfb2ee6;})});}_0x202107=_[_0x79fe('0x50')]({},_0x202107,_0x477c6f[_0x79fe('0x54')]);return _0xa227b9[_0x79fe('0x74')](_0x202107);}})[_0x79fe('0x25')](function(_0x5c00c6){if(_0x5c00c6){_0x5e1cf5=_0x5c00c6[_0x79fe('0x4a')];if(!_0x477c6f[_0x79fe('0x44')]['hasOwnProperty'](_0x79fe('0x4c'))){_0x202107[_0x79fe('0x31')]=qs[_0x79fe('0x31')](_0x477c6f[_0x79fe('0x44')][_0x79fe('0x31')]);_0x202107['offset']=qs[_0x79fe('0x30')](_0x477c6f[_0x79fe('0x44')]['offset']);}return _0xa227b9['getTeams'](_0x202107);}})['then'](function(_0x381d08){if(_0x381d08){return _0x381d08?{'count':_0x5e1cf5,'rows':_0x381d08}:null;}})[_0x79fe('0x25')](respondWithResult(_0x24c6ad,null))[_0x79fe('0x5d')](handleError(_0x24c6ad,null));};exports[_0x79fe('0x77')]=function(_0x114f7b,_0x5d2971,_0x3521ff){var _0x389e32=_0x114f7b['body'][_0x79fe('0x78')];return db['Team']['findAll']({'where':{'id':_0x389e32},'attributes':['id'],'include':[{'model':db[_0x79fe('0x6c')],'as':_0x79fe('0x79'),'attributes':['id',_0x79fe('0x3c'),_0x79fe('0x7a'),_0x79fe('0x7b'),_0x79fe('0x7c')],'raw':!![]}]})[_0x79fe('0x25')](function(_0xde5e36){if(_0xde5e36){var _0x646fb5=_[_0x79fe('0x7d')](_0xde5e36,function(_0x4e8a44){var _0x57a104=_0x4e8a44[_0x79fe('0x61')]({'plain':!![]});return _0x57a104[_0x79fe('0x79')];});return db[_0x79fe('0x55')][_0x79fe('0x5c')]({'where':{'id':_0x114f7b[_0x79fe('0x5b')]['id']}})[_0x79fe('0x25')](function(_0x2beaf4){return db[_0x79fe('0x7e')][_0x79fe('0x7f')](function(_0x5ce655){return _0x2beaf4[_0x79fe('0x77')](_0x389e32,{'transaction':_0x5ce655})[_0x79fe('0x25')](function(){return BPromise[_0x79fe('0x80')](_0x646fb5,function(_0x28cba7){return db['UserChatQueue'][_0x79fe('0x81')]({'where':{'UserId':_0x28cba7['id'],'ChatQueueId':_0x114f7b['params']['id']},'transaction':_0x5ce655});});})[_0x79fe('0x25')](function(){_0x646fb5['forEach'](function(_0x46151b){socket[_0x79fe('0x82')](_0x79fe('0x83'),{'UserId':_0x46151b['id'],'ChatQueueId':_0x2beaf4['id']});});});});});}})[_0x79fe('0x25')](respondWithStatusCode(_0x5d2971,null))[_0x79fe('0x5d')](handleError(_0x5d2971,null));};exports[_0x79fe('0x84')]=function(_0x52c50c,_0x5617b0,_0x2837b7){return db[_0x79fe('0x75')][_0x79fe('0x6b')]({'where':{'id':_0x52c50c[_0x79fe('0x44')][_0x79fe('0x78')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x79fe('0x79'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5617b0,null))['then'](function(_0x28685f){var _0x517c85=_[_0x79fe('0x3f')](_0x28685f,'id');var _0x3b1d07=[];var _0x268e7f=[];var _0x1dcf6f=squel[_0x79fe('0x85')]();_0x1dcf6f[_0x79fe('0x86')](_0x79fe('0x87'))[_0x79fe('0x88')]('team_has_chat_queues','tq')[_0x79fe('0x89')](_0x79fe('0x8a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x79fe('0x4f')](_0x79fe('0x8b'),_0x52c50c[_0x79fe('0x5b')]['id']);for(var _0x24a505=0x0;_0x24a505<_0x28685f['length'];_0x24a505+=0x1){let _0x48e12d=_0x28685f[_0x24a505];for(var _0x67f6ce=0x0;_0x67f6ce<_0x48e12d['Agents'][_0x79fe('0x4a')];_0x67f6ce+=0x1){let _0x29323e=_0x48e12d[_0x79fe('0x79')][_0x67f6ce];var _0x5f04da=_0x1dcf6f[_0x79fe('0x8c')]();_0x5f04da[_0x79fe('0x4f')](_0x79fe('0x8d'),_0x29323e['id']);_0x268e7f[_0x79fe('0x8e')](db[_0x79fe('0x7e')][_0x79fe('0x44')](_0x5f04da['toString'](),{'type':db['sequelize'][_0x79fe('0x8f')]['SELECT']})[_0x79fe('0x25')](function(_0x35a3c2){if(_0x35a3c2[_0x79fe('0x4a')]===0x1){return _0x29323e['id'];}else{var _0x1e3f89=_['every'](_[_0x79fe('0x3f')](_0x35a3c2,_0x79fe('0x90')),function(_0x13ca3f){return _[_0x79fe('0x91')](_0x517c85,_0x13ca3f);});if(_0x1e3f89){return _0x29323e['id'];}}}));}}return BPromise['all'](_0x268e7f)[_0x79fe('0x25')](function(_0x57b79e){_0x3b1d07=_(_0x3b1d07)[_0x79fe('0x92')](_0x57b79e)['compact']()[_0x79fe('0x93')]();return db[_0x79fe('0x55')][_0x79fe('0x5c')]({'where':{'id':_0x52c50c[_0x79fe('0x5b')]['id']}})[_0x79fe('0x25')](function(_0x1c5f4c){return db['sequelize'][_0x79fe('0x7f')](function(_0x5df9bf){return _0x1c5f4c[_0x79fe('0x84')](_0x52c50c[_0x79fe('0x44')][_0x79fe('0x78')],{'transaction':_0x5df9bf})[_0x79fe('0x25')](function(){if(!_[_0x79fe('0x94')](_0x3b1d07)){return _0x1c5f4c[_0x79fe('0x95')](_0x3b1d07,{'transaction':_0x5df9bf});}})[_0x79fe('0x25')](function(){_0x3b1d07[_0x79fe('0x96')](function(_0x4099f6){socket[_0x79fe('0x82')](_0x79fe('0x97'),{'UserId':_0x4099f6,'ChatQueueId':_0x1c5f4c['id']});});});});});});})[_0x79fe('0x25')](respondWithStatusCode(_0x5617b0,null))[_0x79fe('0x5d')](handleError(_0x5617b0,null));};exports[_0x79fe('0x98')]=function(_0x58ddb7,_0x5ec99e,_0x797422){return db[_0x79fe('0x55')][_0x79fe('0x5c')]({'where':{'id':_0x58ddb7[_0x79fe('0x5b')]['id']}})[_0x79fe('0x25')](handleEntityNotFound(_0x5ec99e,null))[_0x79fe('0x25')](function(_0x116bfb){if(_0x116bfb){return _0x116bfb[_0x79fe('0x98')](_0x58ddb7['body'][_0x79fe('0x78')],_[_0x79fe('0x99')](_0x58ddb7[_0x79fe('0x66')],['ids','id'])||{})[_0x79fe('0x9a')](function(_0x3e8249){for(var _0xc57f79=0x0;_0xc57f79<_0x58ddb7[_0x79fe('0x66')][_0x79fe('0x78')][_0x79fe('0x4a')];_0xc57f79+=0x1){socket[_0x79fe('0x82')](_0x79fe('0x83'),{'UserId':_0x58ddb7[_0x79fe('0x66')]['ids'][_0xc57f79],'ChatQueueId':_0x58ddb7[_0x79fe('0x5b')]['id']});}return _0x3e8249;});}})['then'](respondWithResult(_0x5ec99e,null))['catch'](handleError(_0x5ec99e,null));};exports['removeAgents']=function(_0x4f0789,_0x106bf8,_0x461a42){return db[_0x79fe('0x55')][_0x79fe('0x5c')]({'where':{'id':_0x4f0789[_0x79fe('0x5b')]['id']}})[_0x79fe('0x25')](handleEntityNotFound(_0x106bf8,null))['then'](function(_0x58607c){if(_0x58607c){return _0x58607c[_0x79fe('0x95')](_0x4f0789[_0x79fe('0x44')][_0x79fe('0x78')])[_0x79fe('0x25')](function(){if(_['isArray'](_0x4f0789[_0x79fe('0x44')]['ids'])){for(var _0x45e7f7=0x0;_0x45e7f7<_0x4f0789[_0x79fe('0x44')][_0x79fe('0x78')][_0x79fe('0x4a')];_0x45e7f7+=0x1){socket['emit'](_0x79fe('0x97'),{'UserId':Number(_0x4f0789[_0x79fe('0x44')]['ids'][_0x45e7f7]),'ChatQueueId':Number(_0x4f0789[_0x79fe('0x5b')]['id'])});}}else{socket[_0x79fe('0x82')]('userChatQueue:remove',{'UserId':Number(_0x4f0789[_0x79fe('0x44')][_0x79fe('0x78')]),'ChatQueueId':Number(_0x4f0789[_0x79fe('0x5b')]['id'])});}});}})[_0x79fe('0x25')](respondWithStatusCode(_0x106bf8,null))[_0x79fe('0x5d')](handleError(_0x106bf8,null));};exports['getAgents']=function(_0x235d90,_0xcf0b7d,_0x1c0548){var _0x46639a={};var _0x5417d2={};var _0xe417fa;var _0x215a5f;return db[_0x79fe('0x55')][_0x79fe('0x69')]({'where':{'id':_0x235d90[_0x79fe('0x5b')]['id']}})[_0x79fe('0x25')](handleEntityNotFound(_0xcf0b7d,null))[_0x79fe('0x25')](function(_0x31e1bf){if(_0x31e1bf){_0xe417fa=_0x31e1bf;_0x5417d2['model']=_[_0x79fe('0x45')](db['User'][_0x79fe('0x40')]);_0x5417d2[_0x79fe('0x44')]=_[_0x79fe('0x45')](_0x235d90[_0x79fe('0x44')]);_0x5417d2['filters']=_[_0x79fe('0x48')](_0x5417d2[_0x79fe('0x43')],_0x5417d2[_0x79fe('0x44')]);_0x46639a[_0x79fe('0x47')]=_[_0x79fe('0x48')](_0x5417d2[_0x79fe('0x43')],qs[_0x79fe('0x49')](_0x235d90[_0x79fe('0x44')][_0x79fe('0x49')]));_0x46639a[_0x79fe('0x47')]=_0x46639a['attributes'][_0x79fe('0x4a')]?_0x46639a[_0x79fe('0x47')]:_0x5417d2[_0x79fe('0x43')];_0x46639a[_0x79fe('0x4d')]=qs[_0x79fe('0x4e')](_0x235d90[_0x79fe('0x44')][_0x79fe('0x4e')]);_0x46639a[_0x79fe('0x4f')]=qs[_0x79fe('0x46')](_[_0x79fe('0x76')](_0x235d90[_0x79fe('0x44')],_0x5417d2[_0x79fe('0x46')]));if(_0x235d90[_0x79fe('0x44')][_0x79fe('0x53')]){_0x46639a[_0x79fe('0x4f')]=_[_0x79fe('0x50')](_0x46639a[_0x79fe('0x4f')],{'$or':_['map'](_0x46639a['attributes'],function(_0x35f9bb){var _0x35da8a={};_0x35da8a[_0x35f9bb]={'$like':'%'+_0x235d90['query'][_0x79fe('0x53')]+'%'};return _0x35da8a;})});}_0x46639a=_[_0x79fe('0x50')]({},_0x46639a,_0x235d90['options']);return _0xe417fa[_0x79fe('0x9b')](_0x46639a);}})['then'](function(_0x109b64){if(_0x109b64){_0x215a5f=_0x109b64[_0x79fe('0x4a')];if(!_0x235d90[_0x79fe('0x44')][_0x79fe('0x4b')](_0x79fe('0x4c'))){_0x46639a[_0x79fe('0x31')]=qs['limit'](_0x235d90['query']['limit']);_0x46639a[_0x79fe('0x30')]=qs[_0x79fe('0x30')](_0x235d90[_0x79fe('0x44')][_0x79fe('0x30')]);}return _0xe417fa[_0x79fe('0x9b')](_0x46639a);}})['then'](function(_0x715361){if(_0x715361){return _0x715361?{'count':_0x215a5f,'rows':_0x715361}:null;}})[_0x79fe('0x25')](respondWithResult(_0xcf0b7d,null))['catch'](handleError(_0xcf0b7d,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 9a842e6..2268f86 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 _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x52f361,_0x1027aa){var _0x45e81f=function(_0xa7e007){while(--_0xa7e007){_0x52f361['push'](_0x52f361['shift']());}};_0x45e81f(++_0x1027aa);}(_0xb10b,0x12a));var _0xbb10=function(_0x2b0b61,_0x170827){_0x2b0b61=_0x2b0b61-0x0;var _0x2ae144=_0xb10b[_0x2b0b61];return _0x2ae144;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x0b0e=['ChatQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x31b37c,_0x2039a8){var _0x4d0cce=function(_0x5af0bb){while(--_0x5af0bb){_0x31b37c['push'](_0x31b37c['shift']());}};_0x4d0cce(++_0x2039a8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1b68ba,_0x23687a){_0x1b68ba=_0x1b68ba-0x0;var _0xf49b11=_0x0b0e[_0x1b68ba];return _0xf49b11;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xe0b0('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){ChatQueueEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);ChatQueueEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];ChatQueue[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 0f6eb17..a62fea8 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 _0x6ef8=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','chat_queues'];(function(_0x291e0e,_0x792683){var _0x3f85f3=function(_0x4a4049){while(--_0x4a4049){_0x291e0e['push'](_0x291e0e['shift']());}};_0x3f85f3(++_0x792683);}(_0x6ef8,0xd8));var _0x86ef=function(_0x49cb19,_0x5a9e76){_0x49cb19=_0x49cb19-0x0;var _0x377d04=_0x6ef8[_0x49cb19];return _0x377d04;};'use strict';var _=require('lodash');var util=require(_0x86ef('0x0'));var logger=require('../../config/logger')(_0x86ef('0x1'));var moment=require(_0x86ef('0x2'));var BPromise=require(_0x86ef('0x3'));var rp=require(_0x86ef('0x4'));var fs=require('fs');var path=require(_0x86ef('0x5'));var rimraf=require(_0x86ef('0x6'));var config=require(_0x86ef('0x7'));var attributes=require(_0x86ef('0x8'));module[_0x86ef('0x9')]=function(_0x1d2387,_0x195ba2){return _0x1d2387[_0x86ef('0xa')]('ChatQueue',attributes,{'tableName':_0x86ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1bab=['define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','request-promise','../../config/environment','./chatQueue.attributes','exports'];(function(_0x36940e,_0x11f338){var _0x3283f2=function(_0x418008){while(--_0x418008){_0x36940e['push'](_0x36940e['shift']());}};_0x3283f2(++_0x11f338);}(_0x1bab,0x14d));var _0xb1ba=function(_0x2fab46,_0x495003){_0x2fab46=_0x2fab46-0x0;var _0x44ef9f=_0x1bab[_0x2fab46];return _0x44ef9f;};'use strict';var _=require(_0xb1ba('0x0'));var util=require(_0xb1ba('0x1'));var logger=require(_0xb1ba('0x2'))(_0xb1ba('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb1ba('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb1ba('0x5'));var attributes=require(_0xb1ba('0x6'));module[_0xb1ba('0x7')]=function(_0x407de4,_0x4653c1){return _0x407de4[_0xb1ba('0x8')](_0xb1ba('0x9'),attributes,{'tableName':_0xb1ba('0xa'),'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 5753a12..7ff9c25 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 _0xfcc5=['map','model','ShowChatQueue','ChatQueue','find','where','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','http','redis','defaults','localhost','register','request','then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','info','result','catch','GetChatQueue','options','raw','attributes','limit','include'];(function(_0x5e6d65,_0x5db89c){var _0x5e1f75=function(_0x3729a1){while(--_0x3729a1){_0x5e6d65['push'](_0x5e6d65['shift']());}};_0x5e1f75(++_0x5db89c);}(_0xfcc5,0x14a));var _0x5fcc=function(_0x3a508a,_0x358c16){_0x3a508a=_0x3a508a-0x0;var _0x5a8c34=_0xfcc5[_0x3a508a];return _0x5a8c34;};'use strict';var _=require('lodash');var util=require(_0x5fcc('0x0'));var moment=require(_0x5fcc('0x1'));var BPromise=require(_0x5fcc('0x2'));var rs=require(_0x5fcc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5fcc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5fcc('0x5'));var config=require(_0x5fcc('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5fcc('0x7')]({'port':0x232a});config[_0x5fcc('0x8')]=_[_0x5fcc('0x9')](config[_0x5fcc('0x8')],{'host':_0x5fcc('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5fcc('0x8')]));require('./chatQueue.socket')[_0x5fcc('0xb')](socket);function respondWithRpcPromise(_0x688fd5,_0x53f3cc,_0x15df6a){return new BPromise(function(_0x44f62f,_0x2b5132){return client[_0x5fcc('0xc')](_0x688fd5,_0x15df6a)[_0x5fcc('0xd')](function(_0x3627b6){logger['info']('ChatQueue,\x20%s,\x20%s',_0x53f3cc,_0x5fcc('0xe'));logger[_0x5fcc('0xf')](_0x5fcc('0x10'),_0x53f3cc,_0x5fcc('0xe'),JSON[_0x5fcc('0x11')](_0x3627b6));if(_0x3627b6[_0x5fcc('0x12')]){if(_0x3627b6[_0x5fcc('0x12')]['code']===0x1f4){logger[_0x5fcc('0x12')]('ChatQueue,\x20%s,\x20%s',_0x53f3cc,_0x3627b6[_0x5fcc('0x12')][_0x5fcc('0x13')]);return _0x2b5132(_0x3627b6[_0x5fcc('0x12')][_0x5fcc('0x13')]);}logger['error'](_0x5fcc('0x14'),_0x53f3cc,_0x3627b6[_0x5fcc('0x12')][_0x5fcc('0x13')]);return _0x44f62f(_0x3627b6[_0x5fcc('0x12')][_0x5fcc('0x13')]);}else{logger[_0x5fcc('0x15')](_0x5fcc('0x14'),_0x53f3cc,'request\x20sent');_0x44f62f(_0x3627b6[_0x5fcc('0x16')]['message']);}})[_0x5fcc('0x17')](function(_0x189686){logger[_0x5fcc('0x12')](_0x5fcc('0x14'),_0x53f3cc,_0x189686);_0x2b5132(_0x189686);});});}exports[_0x5fcc('0x18')]=function(_0x859bd7){var _0x2f2d9a=this;return new Promise(function(_0x398bbf,_0x360332){return db['ChatQueue']['findAll']({'raw':_0x859bd7['options']?_0x859bd7[_0x5fcc('0x19')][_0x5fcc('0x1a')]===undefined?!![]:![]:!![],'where':_0x859bd7[_0x5fcc('0x19')]?_0x859bd7[_0x5fcc('0x19')]['where']||null:null,'attributes':_0x859bd7[_0x5fcc('0x19')]?_0x859bd7[_0x5fcc('0x19')][_0x5fcc('0x1b')]||null:null,'limit':_0x859bd7[_0x5fcc('0x19')]?_0x859bd7[_0x5fcc('0x19')][_0x5fcc('0x1c')]||null:null,'include':_0x859bd7[_0x5fcc('0x19')]?_0x859bd7[_0x5fcc('0x19')][_0x5fcc('0x1d')]?_[_0x5fcc('0x1e')](_0x859bd7[_0x5fcc('0x19')][_0x5fcc('0x1d')],function(_0x137edf){return{'model':db[_0x137edf[_0x5fcc('0x1f')]],'as':_0x137edf['as'],'attributes':_0x137edf['attributes'],'include':_0x137edf[_0x5fcc('0x1d')]?_[_0x5fcc('0x1e')](_0x137edf[_0x5fcc('0x1d')],function(_0x1a8903){return{'model':db[_0x1a8903[_0x5fcc('0x1f')]],'as':_0x1a8903['as'],'attributes':_0x1a8903[_0x5fcc('0x1b')],'include':_0x1a8903[_0x5fcc('0x1d')]?_[_0x5fcc('0x1e')](_0x1a8903['include'],function(_0x4ae690){return{'model':db[_0x4ae690['model']],'as':_0x4ae690['as'],'attributes':_0x4ae690['attributes']};}):[]};}):[]};}):[]:[]})[_0x5fcc('0xd')](function(_0x526e9f){logger[_0x5fcc('0x15')](_0x5fcc('0x18'),_0x859bd7);logger[_0x5fcc('0xf')](_0x5fcc('0x18'),_0x859bd7,JSON[_0x5fcc('0x11')](_0x526e9f));_0x398bbf(_0x526e9f);})[_0x5fcc('0x17')](function(_0x246553){logger[_0x5fcc('0x12')](_0x5fcc('0x18'),_0x246553['message'],_0x859bd7);_0x360332(_0x2f2d9a[_0x5fcc('0x12')](0x1f4,_0x246553[_0x5fcc('0x13')]));});});};exports[_0x5fcc('0x20')]=function(_0x4b4f69){var _0x3dda55=this;return new Promise(function(_0x35ae58,_0x41be57){return db[_0x5fcc('0x21')][_0x5fcc('0x22')]({'raw':_0x4b4f69[_0x5fcc('0x19')]?_0x4b4f69[_0x5fcc('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4b4f69[_0x5fcc('0x19')]?_0x4b4f69[_0x5fcc('0x19')][_0x5fcc('0x23')]||null:null,'attributes':_0x4b4f69[_0x5fcc('0x19')]?_0x4b4f69[_0x5fcc('0x19')][_0x5fcc('0x1b')]||null:null,'include':_0x4b4f69[_0x5fcc('0x19')]?_0x4b4f69[_0x5fcc('0x19')][_0x5fcc('0x1d')]?_[_0x5fcc('0x1e')](_0x4b4f69[_0x5fcc('0x19')]['include'],function(_0x25678d){return{'model':db[_0x25678d[_0x5fcc('0x1f')]],'as':_0x25678d['as'],'attributes':_0x25678d[_0x5fcc('0x1b')],'include':_0x25678d['include']?_[_0x5fcc('0x1e')](_0x25678d[_0x5fcc('0x1d')],function(_0x8fb47a){return{'model':db[_0x8fb47a[_0x5fcc('0x1f')]],'as':_0x8fb47a['as'],'attributes':_0x8fb47a['attributes'],'include':_0x8fb47a[_0x5fcc('0x1d')]?_[_0x5fcc('0x1e')](_0x8fb47a['include'],function(_0xce4f95){return{'model':db[_0xce4f95[_0x5fcc('0x1f')]],'as':_0xce4f95['as'],'attributes':_0xce4f95[_0x5fcc('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17d7c6){logger[_0x5fcc('0x15')]('ShowChatQueue',_0x4b4f69);logger[_0x5fcc('0xf')](_0x5fcc('0x20'),_0x4b4f69,JSON[_0x5fcc('0x11')](_0x17d7c6));_0x35ae58(_0x17d7c6);})[_0x5fcc('0x17')](function(_0x1aec6e){logger['error'](_0x5fcc('0x20'),_0x1aec6e[_0x5fcc('0x13')],_0x4b4f69);_0x41be57(_0x3dda55[_0x5fcc('0x12')](0x1f4,_0x1aec6e[_0x5fcc('0x13')]));});});}; \ No newline at end of file +var _0x6e1c=['raw','where','limit','include','model','attributes','map','then','ShowChatQueue','find','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options'];(function(_0x4577d8,_0x4b98a6){var _0x2a9f16=function(_0x22e334){while(--_0x22e334){_0x4577d8['push'](_0x4577d8['shift']());}};_0x2a9f16(++_0x4b98a6);}(_0x6e1c,0xb6));var _0xc6e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e1c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc6e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc6e1('0x1'));var rs=require(_0xc6e1('0x2'));var fs=require('fs');var Redis=require(_0xc6e1('0x3'));var db=require(_0xc6e1('0x4'))['db'];var utils=require(_0xc6e1('0x5'));var logger=require(_0xc6e1('0x6'))(_0xc6e1('0x7'));var config=require(_0xc6e1('0x8'));var jayson=require(_0xc6e1('0x9'));var client=jayson[_0xc6e1('0xa')][_0xc6e1('0xb')]({'port':0x232a});config['redis']=_[_0xc6e1('0xc')](config[_0xc6e1('0xd')],{'host':_0xc6e1('0xe'),'port':0x18eb});var socket=require(_0xc6e1('0xf'))(new Redis(config[_0xc6e1('0xd')]));require('./chatQueue.socket')[_0xc6e1('0x10')](socket);function respondWithRpcPromise(_0x3ba651,_0x4728e1,_0x4f8e6b){return new BPromise(function(_0x5c556e,_0x5e602d){return client[_0xc6e1('0x11')](_0x3ba651,_0x4f8e6b)['then'](function(_0x7f3a0f){logger[_0xc6e1('0x12')](_0xc6e1('0x13'),_0x4728e1,_0xc6e1('0x14'));logger[_0xc6e1('0x15')](_0xc6e1('0x16'),_0x4728e1,'request\x20sent',JSON[_0xc6e1('0x17')](_0x7f3a0f));if(_0x7f3a0f[_0xc6e1('0x18')]){if(_0x7f3a0f[_0xc6e1('0x18')][_0xc6e1('0x19')]===0x1f4){logger[_0xc6e1('0x18')]('ChatQueue,\x20%s,\x20%s',_0x4728e1,_0x7f3a0f['error'][_0xc6e1('0x1a')]);return _0x5e602d(_0x7f3a0f[_0xc6e1('0x18')]['message']);}logger[_0xc6e1('0x18')](_0xc6e1('0x13'),_0x4728e1,_0x7f3a0f[_0xc6e1('0x18')]['message']);return _0x5c556e(_0x7f3a0f[_0xc6e1('0x18')][_0xc6e1('0x1a')]);}else{logger[_0xc6e1('0x12')](_0xc6e1('0x13'),_0x4728e1,'request\x20sent');_0x5c556e(_0x7f3a0f[_0xc6e1('0x1b')][_0xc6e1('0x1a')]);}})[_0xc6e1('0x1c')](function(_0x11f476){logger[_0xc6e1('0x18')](_0xc6e1('0x13'),_0x4728e1,_0x11f476);_0x5e602d(_0x11f476);});});}exports[_0xc6e1('0x1d')]=function(_0x1fa16f){var _0x2f4e05=this;return new Promise(function(_0x1046b9,_0x23369a){return db[_0xc6e1('0x1e')][_0xc6e1('0x1f')]({'raw':_0x1fa16f[_0xc6e1('0x20')]?_0x1fa16f['options'][_0xc6e1('0x21')]===undefined?!![]:![]:!![],'where':_0x1fa16f[_0xc6e1('0x20')]?_0x1fa16f[_0xc6e1('0x20')][_0xc6e1('0x22')]||null:null,'attributes':_0x1fa16f[_0xc6e1('0x20')]?_0x1fa16f[_0xc6e1('0x20')]['attributes']||null:null,'limit':_0x1fa16f[_0xc6e1('0x20')]?_0x1fa16f[_0xc6e1('0x20')][_0xc6e1('0x23')]||null:null,'include':_0x1fa16f[_0xc6e1('0x20')]?_0x1fa16f[_0xc6e1('0x20')]['include']?_['map'](_0x1fa16f[_0xc6e1('0x20')][_0xc6e1('0x24')],function(_0x5b0537){return{'model':db[_0x5b0537[_0xc6e1('0x25')]],'as':_0x5b0537['as'],'attributes':_0x5b0537[_0xc6e1('0x26')],'include':_0x5b0537[_0xc6e1('0x24')]?_[_0xc6e1('0x27')](_0x5b0537[_0xc6e1('0x24')],function(_0x240801){return{'model':db[_0x240801[_0xc6e1('0x25')]],'as':_0x240801['as'],'attributes':_0x240801[_0xc6e1('0x26')],'include':_0x240801[_0xc6e1('0x24')]?_['map'](_0x240801[_0xc6e1('0x24')],function(_0x600377){return{'model':db[_0x600377[_0xc6e1('0x25')]],'as':_0x600377['as'],'attributes':_0x600377['attributes']};}):[]};}):[]};}):[]:[]})[_0xc6e1('0x28')](function(_0x3e67a6){logger[_0xc6e1('0x12')](_0xc6e1('0x1d'),_0x1fa16f);logger[_0xc6e1('0x15')]('GetChatQueue',_0x1fa16f,JSON[_0xc6e1('0x17')](_0x3e67a6));_0x1046b9(_0x3e67a6);})[_0xc6e1('0x1c')](function(_0x5a7c24){logger[_0xc6e1('0x18')](_0xc6e1('0x1d'),_0x5a7c24[_0xc6e1('0x1a')],_0x1fa16f);_0x23369a(_0x2f4e05[_0xc6e1('0x18')](0x1f4,_0x5a7c24[_0xc6e1('0x1a')]));});});};exports[_0xc6e1('0x29')]=function(_0x424dda){var _0x382235=this;return new Promise(function(_0x52181e,_0x341687){return db[_0xc6e1('0x1e')][_0xc6e1('0x2a')]({'raw':_0x424dda[_0xc6e1('0x20')]?_0x424dda[_0xc6e1('0x20')][_0xc6e1('0x21')]===undefined?!![]:![]:!![],'where':_0x424dda['options']?_0x424dda['options'][_0xc6e1('0x22')]||null:null,'attributes':_0x424dda[_0xc6e1('0x20')]?_0x424dda[_0xc6e1('0x20')]['attributes']||null:null,'include':_0x424dda[_0xc6e1('0x20')]?_0x424dda[_0xc6e1('0x20')]['include']?_[_0xc6e1('0x27')](_0x424dda[_0xc6e1('0x20')][_0xc6e1('0x24')],function(_0x25205c){return{'model':db[_0x25205c['model']],'as':_0x25205c['as'],'attributes':_0x25205c[_0xc6e1('0x26')],'include':_0x25205c['include']?_[_0xc6e1('0x27')](_0x25205c[_0xc6e1('0x24')],function(_0x3c437b){return{'model':db[_0x3c437b[_0xc6e1('0x25')]],'as':_0x3c437b['as'],'attributes':_0x3c437b[_0xc6e1('0x26')],'include':_0x3c437b['include']?_['map'](_0x3c437b[_0xc6e1('0x24')],function(_0x3e6044){return{'model':db[_0x3e6044[_0xc6e1('0x25')]],'as':_0x3e6044['as'],'attributes':_0x3e6044['attributes']};}):[]};}):[]};}):[]:[]})[_0xc6e1('0x28')](function(_0x5f5c15){logger[_0xc6e1('0x12')](_0xc6e1('0x29'),_0x424dda);logger[_0xc6e1('0x15')](_0xc6e1('0x29'),_0x424dda,JSON[_0xc6e1('0x17')](_0x5f5c15));_0x52181e(_0x5f5c15);})[_0xc6e1('0x1c')](function(_0x257526){logger[_0xc6e1('0x18')]('ShowChatQueue',_0x257526[_0xc6e1('0x1a')],_0x424dda);_0x341687(_0x382235[_0xc6e1('0x18')](0x1f4,_0x257526[_0xc6e1('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 58062de..2abaaf9 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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x100ea5,_0x2f13b4){var _0x1c331=function(_0x247f46){while(--_0x247f46){_0x100ea5['push'](_0x100ea5['shift']());}};_0x1c331(++_0x2f13b4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2bbe84,_0x27e011){_0x2bbe84=_0x2bbe84-0x0;var _0x5467bd=_0x5f2f[_0x2bbe84];return _0x5467bd;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0x16e60a,_0x5e7d9a){var _0x3bdad8=function(_0x17224a){while(--_0x17224a){_0x16e60a['push'](_0x16e60a['shift']());}};_0x3bdad8(++_0x5e7d9a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x32f9ca,_0x2fa8bc){_0x32f9ca=_0x32f9ca-0x0;var _0x52e083=_0x0b0e[_0x32f9ca];return _0x52e083;};'use strict';var ChatQueueEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){ChatQueueEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);ChatQueueEvents['on'](_0x50be7f,_0x11effc);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 8e1ac97..fe1dc91 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 _0xf892=['index','/describe','describe','/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated'];(function(_0x1eb0a3,_0x16de8b){var _0x2c8f9a=function(_0x45e54d){while(--_0x45e54d){_0x1eb0a3['push'](_0x1eb0a3['shift']());}};_0x2c8f9a(++_0x16de8b);}(_0xf892,0xc1));var _0x2f89=function(_0x172029,_0x1dcd88){_0x172029=_0x172029-0x0;var _0x1e53f2=_0xf892[_0x172029];return _0x1e53f2;};'use strict';var multer=require(_0x2f89('0x0'));var util=require(_0x2f89('0x1'));var path=require(_0x2f89('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2f89('0x3')]();var auth=require(_0x2f89('0x4'));var interaction=require(_0x2f89('0x5'));var config=require(_0x2f89('0x6'));var controller=require(_0x2f89('0x7'));router[_0x2f89('0x8')]('/',auth[_0x2f89('0x9')](),controller[_0x2f89('0xa')]);router[_0x2f89('0x8')](_0x2f89('0xb'),auth[_0x2f89('0x9')](),controller[_0x2f89('0xc')]);router[_0x2f89('0x8')](_0x2f89('0xd'),auth[_0x2f89('0x9')](),controller['show']);router[_0x2f89('0x8')](_0x2f89('0xe'),auth[_0x2f89('0x9')](),controller[_0x2f89('0xf')]);router[_0x2f89('0x8')]('/:id/teams',auth['isAuthenticated'](),controller[_0x2f89('0x10')]);router[_0x2f89('0x8')](_0x2f89('0x11'),auth['isAuthenticated'](),controller[_0x2f89('0x12')]);router[_0x2f89('0x13')]('/',auth[_0x2f89('0x9')](),controller[_0x2f89('0x14')]);router[_0x2f89('0x13')](_0x2f89('0x15'),auth[_0x2f89('0x9')](),controller['addTeams']);router[_0x2f89('0x13')](_0x2f89('0x11'),auth[_0x2f89('0x9')](),controller[_0x2f89('0x16')]);router[_0x2f89('0x17')](_0x2f89('0xd'),auth[_0x2f89('0x9')](),controller['update']);router[_0x2f89('0x18')](_0x2f89('0xd'),auth[_0x2f89('0x9')](),controller[_0x2f89('0x19')]);router[_0x2f89('0x18')]('/:id/teams',auth[_0x2f89('0x9')](),controller[_0x2f89('0x1a')]);router[_0x2f89('0x18')]('/:id/users',auth[_0x2f89('0x9')](),controller[_0x2f89('0x1b')]);module[_0x2f89('0x1c')]=router; \ No newline at end of file +var _0x62c3=['getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','path','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','index','isAuthenticated','describe','/:id','show','/:id/members'];(function(_0x3ce7f3,_0x520831){var _0x5b5cd7=function(_0x1e8c22){while(--_0x1e8c22){_0x3ce7f3['push'](_0x3ce7f3['shift']());}};_0x5b5cd7(++_0x520831);}(_0x62c3,0xc4));var _0x362c=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0x62c3[_0x1a0daa];return _0x1dbe15;};'use strict';var multer=require(_0x362c('0x0'));var util=require('util');var path=require(_0x362c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x362c('0x2'));var config=require(_0x362c('0x3'));var controller=require(_0x362c('0x4'));router[_0x362c('0x5')]('/',auth['isAuthenticated'](),controller[_0x362c('0x6')]);router['get']('/describe',auth[_0x362c('0x7')](),controller[_0x362c('0x8')]);router['get'](_0x362c('0x9'),auth[_0x362c('0x7')](),controller[_0x362c('0xa')]);router['get'](_0x362c('0xb'),auth[_0x362c('0x7')](),controller[_0x362c('0xc')]);router['get'](_0x362c('0xd'),auth['isAuthenticated'](),controller[_0x362c('0xe')]);router[_0x362c('0x5')](_0x362c('0xf'),auth[_0x362c('0x7')](),controller['getAgents']);router['post']('/',auth[_0x362c('0x7')](),controller[_0x362c('0x10')]);router[_0x362c('0x11')](_0x362c('0xd'),auth['isAuthenticated'](),controller[_0x362c('0x12')]);router[_0x362c('0x11')]('/:id/users',auth[_0x362c('0x7')](),controller[_0x362c('0x13')]);router[_0x362c('0x14')](_0x362c('0x9'),auth[_0x362c('0x7')](),controller[_0x362c('0x15')]);router[_0x362c('0x16')](_0x362c('0x9'),auth[_0x362c('0x7')](),controller['destroy']);router[_0x362c('0x16')](_0x362c('0xd'),auth['isAuthenticated'](),controller[_0x362c('0x17')]);router[_0x362c('0x16')](_0x362c('0xf'),auth[_0x362c('0x7')](),controller[_0x362c('0x18')]);module[_0x362c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index ea937b2..a3d6920 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 _0x3e9f=['STRING','DATE','moment','sequelize','exports'];(function(_0x287814,_0x380c51){var _0x1266f4=function(_0x429311){while(--_0x429311){_0x287814['push'](_0x287814['shift']());}};_0x1266f4(++_0x380c51);}(_0x3e9f,0xe8));var _0xf3e9=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x3e9f[_0x33032e];return _0x13316b;};'use strict';var moment=require(_0xf3e9('0x0'));var Sequelize=require(_0xf3e9('0x1'));module[_0xf3e9('0x2')]={'uniqueid':{'type':Sequelize[_0xf3e9('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf3e9('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf3e9('0x4')]},'acceptAt':{'type':Sequelize[_0xf3e9('0x4')]},'exitAt':{'type':Sequelize[_0xf3e9('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa0cc=['DATE','moment','sequelize','STRING'];(function(_0x5ddf53,_0x415dff){var _0x50820c=function(_0xe8a49b){while(--_0xe8a49b){_0x5ddf53['push'](_0x5ddf53['shift']());}};_0x50820c(++_0x415dff);}(_0xa0cc,0x125));var _0xca0c=function(_0x422145,_0x567e44){_0x422145=_0x422145-0x0;var _0x4f5c63=_0xa0cc[_0x422145];return _0x4f5c63;};'use strict';var moment=require(_0xca0c('0x0'));var Sequelize=require(_0xca0c('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xca0c('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xca0c('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xca0c('0x3')]},'reason':{'type':Sequelize[_0xca0c('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 22e417a..3e2e2aa 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 _0x4b80=['update','destroy','then','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','filter','where','VIRTUAL','merge','options','include','rows','catch','show','params','keys','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x4b80,0x6e));var _0x04b8=function(_0x1cacea,_0x521835){_0x1cacea=_0x1cacea-0x0;var _0x34250f=_0x4b80[_0x1cacea];return _0x34250f;};'use strict';var pdf=require(_0x04b8('0x0'));var emlformat=require(_0x04b8('0x1'));var rimraf=require(_0x04b8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x04b8('0x3'));var rp=require(_0x04b8('0x4'));var moment=require(_0x04b8('0x5'));var BPromise=require(_0x04b8('0x6'));var Mustache=require(_0x04b8('0x7'));var util=require(_0x04b8('0x8'));var path=require(_0x04b8('0x9'));var sox=require(_0x04b8('0xa'));var csv=require(_0x04b8('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x04b8('0xc'));var squel=require('squel');var crypto=require(_0x04b8('0xd'));var jsforce=require(_0x04b8('0xe'));var deskjs=require(_0x04b8('0xf'));var toCsv=require(_0x04b8('0xb'));var querystring=require(_0x04b8('0x10'));var Papa=require('papaparse');var Redis=require(_0x04b8('0x11'));var authService=require(_0x04b8('0x12'));var qs=require(_0x04b8('0x13'));var as=require(_0x04b8('0x14'));var hardwareService=require(_0x04b8('0x15'));var logger=require('../../config/logger')(_0x04b8('0x16'));var utils=require(_0x04b8('0x17'));var config=require(_0x04b8('0x18'));var db=require(_0x04b8('0x19'))['db'];function respondWithStatusCode(_0x4d14dc,_0x46b612){_0x46b612=_0x46b612||0xcc;return function(_0x1cefff){if(_0x1cefff){return _0x4d14dc[_0x04b8('0x1a')](_0x46b612);}return _0x4d14dc[_0x04b8('0x1b')](_0x46b612)[_0x04b8('0x1c')]();};}function respondWithResult(_0x5bdae9,_0x22c2ee){_0x22c2ee=_0x22c2ee||0xc8;return function(_0x39f95d){if(_0x39f95d){return _0x5bdae9['status'](_0x22c2ee)[_0x04b8('0x1d')](_0x39f95d);}};}function respondWithFilteredResult(_0x56d7eb,_0x499d7c){return function(_0x26b91d){if(_0x26b91d){var _0x2fd370=_0x26b91d[_0x04b8('0x1e')],_0x103b32=_0x499d7c[_0x04b8('0x1f')],_0x305cb3=_0x499d7c[_0x04b8('0x1f')]+_0x499d7c[_0x04b8('0x20')],_0x158fc4;if(_0x305cb3>=_0x2fd370){_0x305cb3=_0x2fd370;_0x158fc4=0xc8;}else{_0x158fc4=0xce;}_0x56d7eb['status'](_0x158fc4);return _0x56d7eb[_0x04b8('0x21')](_0x04b8('0x22'),_0x103b32+'-'+_0x305cb3+'/'+_0x2fd370)[_0x04b8('0x1d')](_0x26b91d);}return null;};}function patchUpdates(_0x6b6f86){return function(_0x584dfe){try{jsonpatch[_0x04b8('0x23')](_0x584dfe,_0x6b6f86,!![]);}catch(_0x26980e){return BPromise[_0x04b8('0x24')](_0x26980e);}return _0x584dfe[_0x04b8('0x25')]();};}function saveUpdates(_0x43d760,_0x5178ab){return function(_0x514c51){if(_0x514c51){return _0x514c51[_0x04b8('0x26')](_0x43d760)['then'](function(_0x146cd7){return _0x146cd7;});}return null;};}function removeEntity(_0x236d97,_0x4557f1){return function(_0x18f4a8){if(_0x18f4a8){return _0x18f4a8[_0x04b8('0x27')]()[_0x04b8('0x28')](function(){_0x236d97[_0x04b8('0x1b')](0xcc)[_0x04b8('0x1c')]();});}};}function handleEntityNotFound(_0x1cdd0a,_0x2cca1c){return function(_0x45b3aa){if(!_0x45b3aa){_0x1cdd0a[_0x04b8('0x1a')](0x194);}return _0x45b3aa;};}function handleError(_0x182823,_0x127c5f){_0x127c5f=_0x127c5f||0x1f4;return function(_0x4a0c35){logger['error'](_0x4a0c35[_0x04b8('0x29')]);if(_0x4a0c35[_0x04b8('0x2a')]){delete _0x4a0c35[_0x04b8('0x2a')];}_0x182823[_0x04b8('0x1b')](_0x127c5f)[_0x04b8('0x2b')](_0x4a0c35);};}exports['index']=function(_0x17557e,_0x2bb993){var _0x474dea={},_0x58c996={},_0x534bc4={'count':0x0,'rows':[]};var _0x1d88cd=_[_0x04b8('0x2c')](db[_0x04b8('0x2d')][_0x04b8('0x2e')],function(_0x327edf){return{'name':_0x327edf[_0x04b8('0x2f')],'type':_0x327edf[_0x04b8('0x30')]['key']};});_0x58c996[_0x04b8('0x31')]=_[_0x04b8('0x2c')](_0x1d88cd,_0x04b8('0x2a'));_0x58c996[_0x04b8('0x32')]=_['keys'](_0x17557e['query']);_0x58c996['filters']=_[_0x04b8('0x33')](_0x58c996[_0x04b8('0x31')],_0x58c996[_0x04b8('0x32')]);_0x474dea[_0x04b8('0x34')]=_['intersection'](_0x58c996['model'],qs[_0x04b8('0x35')](_0x17557e['query']['fields']));_0x474dea['attributes']=_0x474dea[_0x04b8('0x34')][_0x04b8('0x36')]?_0x474dea['attributes']:_0x58c996['model'];if(!_0x17557e['query'][_0x04b8('0x37')]('nolimit')){_0x474dea['limit']=qs[_0x04b8('0x20')](_0x17557e[_0x04b8('0x32')]['limit']);_0x474dea['offset']=qs[_0x04b8('0x1f')](_0x17557e[_0x04b8('0x32')]['offset']);}_0x474dea['order']=qs[_0x04b8('0x38')](_0x17557e[_0x04b8('0x32')]['sort']);_0x474dea['where']=qs['filters'](_['pick'](_0x17557e[_0x04b8('0x32')],_0x58c996[_0x04b8('0x39')]));if(_0x17557e[_0x04b8('0x32')][_0x04b8('0x3a')]){_0x474dea[_0x04b8('0x3b')]=_['merge'](_0x474dea[_0x04b8('0x3b')],{'$or':_['map'](_0x1d88cd,function(_0x20302b){if(_0x20302b[_0x04b8('0x30')]!==_0x04b8('0x3c')){var _0x467382={};_0x467382[_0x20302b[_0x04b8('0x2a')]]={'$like':'%'+_0x17557e[_0x04b8('0x32')][_0x04b8('0x3a')]+'%'};return _0x467382;}})});}_0x474dea=_[_0x04b8('0x3d')]({},_0x474dea,_0x17557e[_0x04b8('0x3e')]);var _0x2ac82b={'where':_0x474dea[_0x04b8('0x3b')]};return db[_0x04b8('0x2d')]['count'](_0x2ac82b)[_0x04b8('0x28')](function(_0x4b4b37){_0x534bc4['count']=_0x4b4b37;if(_0x17557e['query']['includeAll']){_0x474dea[_0x04b8('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x474dea);})[_0x04b8('0x28')](function(_0x72db64){_0x534bc4[_0x04b8('0x40')]=_0x72db64;return _0x534bc4;})[_0x04b8('0x28')](respondWithFilteredResult(_0x2bb993,_0x474dea))[_0x04b8('0x41')](handleError(_0x2bb993,null));};exports[_0x04b8('0x42')]=function(_0x475d86,_0x4b3c7c){var _0x44a205={'raw':!![],'where':{'id':_0x475d86[_0x04b8('0x43')]['id']}},_0x402eb8={};_0x402eb8[_0x04b8('0x31')]=_['keys'](db['ChatQueueReport'][_0x04b8('0x2e')]);_0x402eb8[_0x04b8('0x32')]=_[_0x04b8('0x44')](_0x475d86['query']);_0x402eb8[_0x04b8('0x39')]=_[_0x04b8('0x33')](_0x402eb8[_0x04b8('0x31')],_0x402eb8[_0x04b8('0x32')]);_0x44a205[_0x04b8('0x34')]=_['intersection'](_0x402eb8['model'],qs['fields'](_0x475d86[_0x04b8('0x32')][_0x04b8('0x35')]));_0x44a205['attributes']=_0x44a205[_0x04b8('0x34')]['length']?_0x44a205[_0x04b8('0x34')]:_0x402eb8['model'];if(_0x475d86[_0x04b8('0x32')][_0x04b8('0x45')]){_0x44a205['include']=[{'all':!![]}];}_0x44a205=_[_0x04b8('0x3d')]({},_0x44a205,_0x475d86['options']);return db['ChatQueueReport'][_0x04b8('0x46')](_0x44a205)[_0x04b8('0x28')](handleEntityNotFound(_0x4b3c7c,null))[_0x04b8('0x28')](respondWithResult(_0x4b3c7c,null))['catch'](handleError(_0x4b3c7c,null));};exports[_0x04b8('0x47')]=function(_0x96455d,_0x4b84bb){return db[_0x04b8('0x2d')][_0x04b8('0x47')](_0x96455d[_0x04b8('0x48')],{})[_0x04b8('0x28')](respondWithResult(_0x4b84bb,0xc9))['catch'](handleError(_0x4b84bb,null));};exports[_0x04b8('0x26')]=function(_0x38d6c5,_0xbe4fd4){if(_0x38d6c5[_0x04b8('0x48')]['id']){delete _0x38d6c5['body']['id'];}return db[_0x04b8('0x2d')][_0x04b8('0x46')]({'where':{'id':_0x38d6c5[_0x04b8('0x43')]['id']}})[_0x04b8('0x28')](handleEntityNotFound(_0xbe4fd4,null))[_0x04b8('0x28')](saveUpdates(_0x38d6c5[_0x04b8('0x48')],null))[_0x04b8('0x28')](respondWithResult(_0xbe4fd4,null))[_0x04b8('0x41')](handleError(_0xbe4fd4,null));};exports[_0x04b8('0x27')]=function(_0xf59c64,_0x3f233f){return db[_0x04b8('0x2d')][_0x04b8('0x46')]({'where':{'id':_0xf59c64[_0x04b8('0x43')]['id']}})[_0x04b8('0x28')](handleEntityNotFound(_0x3f233f,null))['then'](removeEntity(_0x3f233f,null))[_0x04b8('0x41')](handleError(_0x3f233f,null));};exports[_0x04b8('0x49')]=function(_0x40f47a,_0x56593e){return db['ChatQueueReport']['describe']()[_0x04b8('0x28')](respondWithResult(_0x56593e,null))[_0x04b8('0x41')](handleError(_0x56593e,null));}; \ No newline at end of file +var _0x06ae=['../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','ChatQueueReport','count','includeAll','findAll','rows','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','lodash','crypto','desk.js','to-csv','querystring','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x06ae,0x7e));var _0xe06a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x06ae[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe06a('0x0'));var rimraf=require(_0xe06a('0x1'));var zipdir=require(_0xe06a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe06a('0x3'));var moment=require(_0xe06a('0x4'));var BPromise=require(_0xe06a('0x5'));var Mustache=require(_0xe06a('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe06a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe06a('0x8'));var squel=require('squel');var crypto=require(_0xe06a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe06a('0xa'));var toCsv=require(_0xe06a('0xb'));var querystring=require(_0xe06a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe06a('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe06a('0xe'));var logger=require(_0xe06a('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xe06a('0x10'));var db=require(_0xe06a('0x11'))['db'];function respondWithStatusCode(_0x465853,_0x2aadcb){_0x2aadcb=_0x2aadcb||0xcc;return function(_0x3e2d42){if(_0x3e2d42){return _0x465853[_0xe06a('0x12')](_0x2aadcb);}return _0x465853[_0xe06a('0x13')](_0x2aadcb)[_0xe06a('0x14')]();};}function respondWithResult(_0x5806f0,_0x4d7618){_0x4d7618=_0x4d7618||0xc8;return function(_0x459824){if(_0x459824){return _0x5806f0[_0xe06a('0x13')](_0x4d7618)['json'](_0x459824);}};}function respondWithFilteredResult(_0x30559b,_0x1a0f40){return function(_0x26f7c1){if(_0x26f7c1){var _0x274428=_0x26f7c1['count'],_0x5a3926=_0x1a0f40[_0xe06a('0x15')],_0x4263a4=_0x1a0f40[_0xe06a('0x15')]+_0x1a0f40[_0xe06a('0x16')],_0x3e5deb;if(_0x4263a4>=_0x274428){_0x4263a4=_0x274428;_0x3e5deb=0xc8;}else{_0x3e5deb=0xce;}_0x30559b['status'](_0x3e5deb);return _0x30559b[_0xe06a('0x17')](_0xe06a('0x18'),_0x5a3926+'-'+_0x4263a4+'/'+_0x274428)[_0xe06a('0x19')](_0x26f7c1);}return null;};}function patchUpdates(_0x1bfd89){return function(_0x3d8f28){try{jsonpatch[_0xe06a('0x1a')](_0x3d8f28,_0x1bfd89,!![]);}catch(_0xcd6589){return BPromise[_0xe06a('0x1b')](_0xcd6589);}return _0x3d8f28[_0xe06a('0x1c')]();};}function saveUpdates(_0x300766,_0x3b5603){return function(_0x570570){if(_0x570570){return _0x570570[_0xe06a('0x1d')](_0x300766)[_0xe06a('0x1e')](function(_0x43d974){return _0x43d974;});}return null;};}function removeEntity(_0x5c0b03,_0x5b1469){return function(_0x263caf){if(_0x263caf){return _0x263caf[_0xe06a('0x1f')]()[_0xe06a('0x1e')](function(){_0x5c0b03[_0xe06a('0x13')](0xcc)[_0xe06a('0x14')]();});}};}function handleEntityNotFound(_0x5c9b6f,_0x313a7e){return function(_0x5662be){if(!_0x5662be){_0x5c9b6f['sendStatus'](0x194);}return _0x5662be;};}function handleError(_0x3ad548,_0x5564b0){_0x5564b0=_0x5564b0||0x1f4;return function(_0x4d7852){logger[_0xe06a('0x20')](_0x4d7852[_0xe06a('0x21')]);if(_0x4d7852['name']){delete _0x4d7852[_0xe06a('0x22')];}_0x3ad548[_0xe06a('0x13')](_0x5564b0)['send'](_0x4d7852);};}exports[_0xe06a('0x23')]=function(_0x11b050,_0xe440d0){var _0x564c64={},_0xd7a0cf={},_0x65fcf8={'count':0x0,'rows':[]};var _0x4c45c3=_[_0xe06a('0x24')](db['ChatQueueReport'][_0xe06a('0x25')],function(_0x56d83f){return{'name':_0x56d83f[_0xe06a('0x26')],'type':_0x56d83f[_0xe06a('0x27')][_0xe06a('0x28')]};});_0xd7a0cf['model']=_[_0xe06a('0x24')](_0x4c45c3,_0xe06a('0x22'));_0xd7a0cf[_0xe06a('0x29')]=_[_0xe06a('0x2a')](_0x11b050[_0xe06a('0x29')]);_0xd7a0cf[_0xe06a('0x2b')]=_[_0xe06a('0x2c')](_0xd7a0cf[_0xe06a('0x2d')],_0xd7a0cf[_0xe06a('0x29')]);_0x564c64[_0xe06a('0x2e')]=_[_0xe06a('0x2c')](_0xd7a0cf[_0xe06a('0x2d')],qs[_0xe06a('0x2f')](_0x11b050['query'][_0xe06a('0x2f')]));_0x564c64[_0xe06a('0x2e')]=_0x564c64['attributes'][_0xe06a('0x30')]?_0x564c64[_0xe06a('0x2e')]:_0xd7a0cf['model'];if(!_0x11b050[_0xe06a('0x29')][_0xe06a('0x31')](_0xe06a('0x32'))){_0x564c64[_0xe06a('0x16')]=qs['limit'](_0x11b050['query']['limit']);_0x564c64[_0xe06a('0x15')]=qs[_0xe06a('0x15')](_0x11b050[_0xe06a('0x29')][_0xe06a('0x15')]);}_0x564c64['order']=qs[_0xe06a('0x33')](_0x11b050[_0xe06a('0x29')][_0xe06a('0x33')]);_0x564c64[_0xe06a('0x34')]=qs[_0xe06a('0x2b')](_[_0xe06a('0x35')](_0x11b050[_0xe06a('0x29')],_0xd7a0cf[_0xe06a('0x2b')]));if(_0x11b050[_0xe06a('0x29')][_0xe06a('0x36')]){_0x564c64[_0xe06a('0x34')]=_['merge'](_0x564c64[_0xe06a('0x34')],{'$or':_['map'](_0x4c45c3,function(_0x2e1e42){if(_0x2e1e42[_0xe06a('0x27')]!==_0xe06a('0x37')){var _0xc84aac={};_0xc84aac[_0x2e1e42['name']]={'$like':'%'+_0x11b050['query'][_0xe06a('0x36')]+'%'};return _0xc84aac;}})});}_0x564c64=_[_0xe06a('0x38')]({},_0x564c64,_0x11b050['options']);var _0x4bb127={'where':_0x564c64[_0xe06a('0x34')]};return db[_0xe06a('0x39')][_0xe06a('0x3a')](_0x4bb127)[_0xe06a('0x1e')](function(_0x1c7fc8){_0x65fcf8[_0xe06a('0x3a')]=_0x1c7fc8;if(_0x11b050[_0xe06a('0x29')][_0xe06a('0x3b')]){_0x564c64['include']=[{'all':!![]}];}return db[_0xe06a('0x39')][_0xe06a('0x3c')](_0x564c64);})[_0xe06a('0x1e')](function(_0x441752){_0x65fcf8[_0xe06a('0x3d')]=_0x441752;return _0x65fcf8;})['then'](respondWithFilteredResult(_0xe440d0,_0x564c64))['catch'](handleError(_0xe440d0,null));};exports[_0xe06a('0x3e')]=function(_0x3558e1,_0x24401c){var _0x3350ab={'raw':!![],'where':{'id':_0x3558e1[_0xe06a('0x3f')]['id']}},_0x447518={};_0x447518[_0xe06a('0x2d')]=_[_0xe06a('0x2a')](db['ChatQueueReport'][_0xe06a('0x25')]);_0x447518[_0xe06a('0x29')]=_[_0xe06a('0x2a')](_0x3558e1[_0xe06a('0x29')]);_0x447518[_0xe06a('0x2b')]=_['intersection'](_0x447518['model'],_0x447518[_0xe06a('0x29')]);_0x3350ab[_0xe06a('0x2e')]=_[_0xe06a('0x2c')](_0x447518[_0xe06a('0x2d')],qs[_0xe06a('0x2f')](_0x3558e1[_0xe06a('0x29')][_0xe06a('0x2f')]));_0x3350ab['attributes']=_0x3350ab[_0xe06a('0x2e')][_0xe06a('0x30')]?_0x3350ab[_0xe06a('0x2e')]:_0x447518[_0xe06a('0x2d')];if(_0x3558e1[_0xe06a('0x29')][_0xe06a('0x3b')]){_0x3350ab['include']=[{'all':!![]}];}_0x3350ab=_['merge']({},_0x3350ab,_0x3558e1[_0xe06a('0x40')]);return db[_0xe06a('0x39')][_0xe06a('0x41')](_0x3350ab)[_0xe06a('0x1e')](handleEntityNotFound(_0x24401c,null))[_0xe06a('0x1e')](respondWithResult(_0x24401c,null))[_0xe06a('0x42')](handleError(_0x24401c,null));};exports['create']=function(_0x56673f,_0x2cfc42){return db[_0xe06a('0x39')][_0xe06a('0x43')](_0x56673f[_0xe06a('0x44')],{})['then'](respondWithResult(_0x2cfc42,0xc9))[_0xe06a('0x42')](handleError(_0x2cfc42,null));};exports[_0xe06a('0x1d')]=function(_0xb4640c,_0x1da4d6){if(_0xb4640c[_0xe06a('0x44')]['id']){delete _0xb4640c[_0xe06a('0x44')]['id'];}return db[_0xe06a('0x39')][_0xe06a('0x41')]({'where':{'id':_0xb4640c[_0xe06a('0x3f')]['id']}})[_0xe06a('0x1e')](handleEntityNotFound(_0x1da4d6,null))[_0xe06a('0x1e')](saveUpdates(_0xb4640c[_0xe06a('0x44')],null))[_0xe06a('0x1e')](respondWithResult(_0x1da4d6,null))[_0xe06a('0x42')](handleError(_0x1da4d6,null));};exports[_0xe06a('0x1f')]=function(_0x189e5d,_0x30e09c){return db['ChatQueueReport'][_0xe06a('0x41')]({'where':{'id':_0x189e5d[_0xe06a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x30e09c,null))[_0xe06a('0x1e')](removeEntity(_0x30e09c,null))[_0xe06a('0x42')](handleError(_0x30e09c,null));};exports[_0xe06a('0x45')]=function(_0x48d110,_0x56d92f){return db['ChatQueueReport']['describe']()[_0xe06a('0x1e')](respondWithResult(_0x56d92f,null))[_0xe06a('0x42')](handleError(_0x56d92f,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 83e7a72..703ce45 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 _0x24f5=['util','api','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','ChatQueueReport','uniqueid'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x24f5,0x156));var _0x524f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x24f5[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x524f('0x0'));var logger=require('../../config/logger')(_0x524f('0x1'));var moment=require('moment');var BPromise=require(_0x524f('0x2'));var rp=require(_0x524f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x524f('0x4'));var config=require(_0x524f('0x5'));var attributes=require(_0x524f('0x6'));module['exports']=function(_0x25d91f,_0x475dc8){return _0x25d91f['define'](_0x524f('0x7'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x524f('0x8'),'fields':[_0x524f('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9542=['../../config/environment','exports','ChatQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0x9542,0x163));var _0x2954=function(_0x462f40,_0x43ae99){_0x462f40=_0x462f40-0x0;var _0xa930e3=_0x9542[_0x462f40];return _0xa930e3;};'use strict';var _=require(_0x2954('0x0'));var util=require(_0x2954('0x1'));var logger=require(_0x2954('0x2'))(_0x2954('0x3'));var moment=require(_0x2954('0x4'));var BPromise=require(_0x2954('0x5'));var rp=require(_0x2954('0x6'));var fs=require('fs');var path=require(_0x2954('0x7'));var rimraf=require(_0x2954('0x8'));var config=require(_0x2954('0x9'));var attributes=require('./chatQueueReport.attributes');module[_0x2954('0xa')]=function(_0x2b2270,_0x250b18){return _0x2b2270['define'](_0x2954('0xb'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x2954('0xc'),'fields':[_0x2954('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 c281358..701c583 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 _0x0990=['UpdateChatQueueReport','ChatQueueReport','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateChatQueueReport','create','body','options','then','catch'];(function(_0x5742e9,_0x3143ea){var _0x5b2f9f=function(_0x142d64){while(--_0x142d64){_0x5742e9['push'](_0x5742e9['shift']());}};_0x5b2f9f(++_0x3143ea);}(_0x0990,0xa6));var _0x0099=function(_0x188a93,_0xaf57db){_0x188a93=_0x188a93-0x0;var _0x23b40d=_0x0990[_0x188a93];return _0x23b40d;};'use strict';var _=require(_0x0099('0x0'));var util=require('util');var moment=require(_0x0099('0x1'));var BPromise=require(_0x0099('0x2'));var rs=require(_0x0099('0x3'));var fs=require('fs');var Redis=require(_0x0099('0x4'));var db=require(_0x0099('0x5'))['db'];var utils=require(_0x0099('0x6'));var logger=require(_0x0099('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0099('0x8'));var client=jayson[_0x0099('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x388ee1,_0xa31ba7,_0x5bd846){return new BPromise(function(_0x437474,_0x5352c8){return client[_0x0099('0xa')](_0x388ee1,_0x5bd846)['then'](function(_0x4000ed){logger[_0x0099('0xb')](_0x0099('0xc'),_0xa31ba7,_0x0099('0xd'));logger[_0x0099('0xe')](_0x0099('0xf'),_0xa31ba7,_0x0099('0xd'),JSON[_0x0099('0x10')](_0x4000ed));if(_0x4000ed['error']){if(_0x4000ed[_0x0099('0x11')]['code']===0x1f4){logger[_0x0099('0x11')](_0x0099('0xc'),_0xa31ba7,_0x4000ed[_0x0099('0x11')][_0x0099('0x12')]);return _0x5352c8(_0x4000ed[_0x0099('0x11')][_0x0099('0x12')]);}logger['error'](_0x0099('0xc'),_0xa31ba7,_0x4000ed[_0x0099('0x11')][_0x0099('0x12')]);return _0x437474(_0x4000ed[_0x0099('0x11')][_0x0099('0x12')]);}else{logger[_0x0099('0xb')](_0x0099('0xc'),_0xa31ba7,_0x0099('0xd'));_0x437474(_0x4000ed[_0x0099('0x13')][_0x0099('0x12')]);}})['catch'](function(_0x498869){logger[_0x0099('0x11')](_0x0099('0xc'),_0xa31ba7,_0x498869);_0x5352c8(_0x498869);});});}exports[_0x0099('0x14')]=function(_0xb70368){var _0x25f6bf=this;return new Promise(function(_0x259067,_0xfd105b){return db['ChatQueueReport'][_0x0099('0x15')](_0xb70368[_0x0099('0x16')],{'raw':_0xb70368[_0x0099('0x17')]?_0xb70368[_0x0099('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x0099('0x18')](function(_0x50147c){logger['info'](_0x0099('0x14'),_0xb70368);logger[_0x0099('0xe')](_0x0099('0x14'),_0xb70368,JSON[_0x0099('0x10')](_0x50147c));_0x259067(_0x50147c);})[_0x0099('0x19')](function(_0xf52817){logger[_0x0099('0x11')](_0x0099('0x14'),_0xf52817[_0x0099('0x12')],_0xb70368);_0xfd105b(_0x25f6bf[_0x0099('0x11')](0x1f4,_0xf52817['message']));});});};exports[_0x0099('0x1a')]=function(_0x22b5f6){var _0x3cdce7=this;return new Promise(function(_0x58a806,_0x1e5182){return db[_0x0099('0x1b')]['update'](_0x22b5f6['body'],{'raw':_0x22b5f6[_0x0099('0x17')]?_0x22b5f6['options'][_0x0099('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22b5f6['options']?_0x22b5f6[_0x0099('0x17')][_0x0099('0x1d')]||null:null,'attributes':_0x22b5f6['options']?_0x22b5f6[_0x0099('0x17')][_0x0099('0x1e')]||null:null,'limit':_0x22b5f6[_0x0099('0x17')]?_0x22b5f6['options'][_0x0099('0x1f')]||null:null})[_0x0099('0x18')](function(_0x549061){logger[_0x0099('0xb')](_0x0099('0x1a'),_0x22b5f6);logger[_0x0099('0xe')]('UpdateChatQueueReport',_0x22b5f6,JSON[_0x0099('0x10')](_0x549061));_0x58a806(_0x549061);})['catch'](function(_0x3eddcf){logger['error']('UpdateChatQueueReport',_0x3eddcf[_0x0099('0x12')],_0x22b5f6);_0x1e5182(_0x3cdce7[_0x0099('0x11')](0x1f4,_0x3eddcf[_0x0099('0x12')]));});});}; \ No newline at end of file +var _0x2e10=['CreateChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','limit','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2e10,0x170));var _0x02e1=function(_0x1bf583,_0x172a1a){_0x1bf583=_0x1bf583-0x0;var _0x587820=_0x2e10[_0x1bf583];return _0x587820;};'use strict';var _=require(_0x02e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x02e1('0x1'));var rs=require(_0x02e1('0x2'));var fs=require('fs');var Redis=require(_0x02e1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x02e1('0x4'));var logger=require(_0x02e1('0x5'))('rpc');var config=require(_0x02e1('0x6'));var jayson=require(_0x02e1('0x7'));var client=jayson[_0x02e1('0x8')][_0x02e1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5257ad,_0x5aff69,_0x448ef5){return new BPromise(function(_0xfa4a73,_0x753652){return client['request'](_0x5257ad,_0x448ef5)[_0x02e1('0xa')](function(_0x2f7b0f){logger[_0x02e1('0xb')](_0x02e1('0xc'),_0x5aff69,_0x02e1('0xd'));logger[_0x02e1('0xe')](_0x02e1('0xf'),_0x5aff69,_0x02e1('0xd'),JSON[_0x02e1('0x10')](_0x2f7b0f));if(_0x2f7b0f[_0x02e1('0x11')]){if(_0x2f7b0f[_0x02e1('0x11')][_0x02e1('0x12')]===0x1f4){logger['error'](_0x02e1('0xc'),_0x5aff69,_0x2f7b0f[_0x02e1('0x11')][_0x02e1('0x13')]);return _0x753652(_0x2f7b0f[_0x02e1('0x11')]['message']);}logger[_0x02e1('0x11')](_0x02e1('0xc'),_0x5aff69,_0x2f7b0f[_0x02e1('0x11')][_0x02e1('0x13')]);return _0xfa4a73(_0x2f7b0f['error'][_0x02e1('0x13')]);}else{logger[_0x02e1('0xb')](_0x02e1('0xc'),_0x5aff69,'request\x20sent');_0xfa4a73(_0x2f7b0f[_0x02e1('0x14')][_0x02e1('0x13')]);}})[_0x02e1('0x15')](function(_0x4f8b8c){logger[_0x02e1('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x5aff69,_0x4f8b8c);_0x753652(_0x4f8b8c);});});}exports[_0x02e1('0x16')]=function(_0x1b7603){var _0x5193c6=this;return new Promise(function(_0x14c6cf,_0x3f5297){return db['ChatQueueReport'][_0x02e1('0x17')](_0x1b7603[_0x02e1('0x18')],{'raw':_0x1b7603[_0x02e1('0x19')]?_0x1b7603['options'][_0x02e1('0x1a')]===undefined?!![]:![]:!![]})[_0x02e1('0xa')](function(_0x40db86){logger[_0x02e1('0xb')](_0x02e1('0x16'),_0x1b7603);logger['debug'](_0x02e1('0x16'),_0x1b7603,JSON[_0x02e1('0x10')](_0x40db86));_0x14c6cf(_0x40db86);})[_0x02e1('0x15')](function(_0x5cd284){logger['error'](_0x02e1('0x16'),_0x5cd284[_0x02e1('0x13')],_0x1b7603);_0x3f5297(_0x5193c6[_0x02e1('0x11')](0x1f4,_0x5cd284[_0x02e1('0x13')]));});});};exports[_0x02e1('0x1b')]=function(_0x201376){var _0x1737ad=this;return new Promise(function(_0x453e18,_0x54826f){return db['ChatQueueReport'][_0x02e1('0x1c')](_0x201376['body'],{'raw':_0x201376[_0x02e1('0x19')]?_0x201376[_0x02e1('0x19')][_0x02e1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x201376[_0x02e1('0x19')]?_0x201376[_0x02e1('0x19')]['where']||null:null,'attributes':_0x201376['options']?_0x201376['options']['attributes']||null:null,'limit':_0x201376[_0x02e1('0x19')]?_0x201376['options'][_0x02e1('0x1d')]||null:null})[_0x02e1('0xa')](function(_0x2fdb3f){logger[_0x02e1('0xb')](_0x02e1('0x1b'),_0x201376);logger['debug'](_0x02e1('0x1b'),_0x201376,JSON[_0x02e1('0x10')](_0x2fdb3f));_0x453e18(_0x2fdb3f);})[_0x02e1('0x15')](function(_0x620526){logger[_0x02e1('0x11')](_0x02e1('0x1b'),_0x620526['message'],_0x201376);_0x54826f(_0x1737ad[_0x02e1('0x11')](0x1f4,_0x620526[_0x02e1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index bab0858..326e0ea 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 _0x452f=['util','path','connect-timeout','express','Router','../../config/environment','isAuthenticated','index','/describe','get','/:id','show','post','create','put','update','delete','exports'];(function(_0x291bc2,_0x580442){var _0xab139c=function(_0x5e2fa9){while(--_0x5e2fa9){_0x291bc2['push'](_0x291bc2['shift']());}};_0xab139c(++_0x580442);}(_0x452f,0x19e));var _0xf452=function(_0x3e8270,_0x293590){_0x3e8270=_0x3e8270-0x0;var _0x1ccde9=_0x452f[_0x3e8270];return _0x1ccde9;};'use strict';var multer=require('multer');var util=require(_0xf452('0x0'));var path=require(_0xf452('0x1'));var timeout=require(_0xf452('0x2'));var express=require(_0xf452('0x3'));var router=express[_0xf452('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf452('0x5'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0xf452('0x6')](),controller[_0xf452('0x7')]);router['get'](_0xf452('0x8'),auth[_0xf452('0x6')](),controller['describe']);router[_0xf452('0x9')](_0xf452('0xa'),auth[_0xf452('0x6')](),controller[_0xf452('0xb')]);router[_0xf452('0xc')]('/',auth[_0xf452('0x6')](),controller[_0xf452('0xd')]);router[_0xf452('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf452('0xf')]);router[_0xf452('0x10')](_0xf452('0xa'),auth[_0xf452('0x6')](),controller['destroy']);module[_0xf452('0x11')]=router; \ No newline at end of file +var _0x3f43=['describe','/:id','post','put','update','delete','destroy','exports','path','connect-timeout','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index','/describe'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x3f43,0x1ac));var _0x33f4=function(_0x31b847,_0x4ade18){_0x31b847=_0x31b847-0x0;var _0x18094f=_0x3f43[_0x31b847];return _0x18094f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x33f4('0x0'));var timeout=require(_0x33f4('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x33f4('0x2'));var config=require('../../config/environment');var controller=require(_0x33f4('0x3'));router['get']('/',auth[_0x33f4('0x4')](),controller[_0x33f4('0x5')]);router['get'](_0x33f4('0x6'),auth['isAuthenticated'](),controller[_0x33f4('0x7')]);router['get'](_0x33f4('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x33f4('0x9')]('/',auth[_0x33f4('0x4')](),controller['create']);router[_0x33f4('0xa')](_0x33f4('0x8'),auth[_0x33f4('0x4')](),controller[_0x33f4('0xb')]);router[_0x33f4('0xc')](_0x33f4('0x8'),auth[_0x33f4('0x4')](),controller[_0x33f4('0xd')]);module[_0x33f4('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 1982177..05cc2b4 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 _0xa917=['account','agent','queue','NOW','moment','sequelize','exports','ENUM'];(function(_0x12f08c,_0xae2d2c){var _0x52b826=function(_0x21ec43){while(--_0x21ec43){_0x12f08c['push'](_0x12f08c['shift']());}};_0x52b826(++_0xae2d2c);}(_0xa917,0x104));var _0x7a91=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa917[_0x502c7d];return _0x30b7ed;};'use strict';var moment=require(_0x7a91('0x0'));var Sequelize=require(_0x7a91('0x1'));module[_0x7a91('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7a91('0x3')](_0x7a91('0x4'),_0x7a91('0x5'),_0x7a91('0x6')),'allowNull':![],'defaultValue':_0x7a91('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x7a91('0x7')]}}; \ No newline at end of file +var _0x9a77=['moment','sequelize','STRING','account','agent','queue','DATE','NOW'];(function(_0x2fb561,_0x579dbf){var _0x2b7be3=function(_0x578df4){while(--_0x578df4){_0x2fb561['push'](_0x2fb561['shift']());}};_0x2b7be3(++_0x579dbf);}(_0x9a77,0x1e0));var _0x79a7=function(_0x96384c,_0x5d2106){_0x96384c=_0x96384c-0x0;var _0x50405b=_0x9a77[_0x96384c];return _0x50405b;};'use strict';var moment=require(_0x79a7('0x0'));var Sequelize=require(_0x79a7('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x79a7('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x79a7('0x3'),_0x79a7('0x4'),_0x79a7('0x5')),'allowNull':![],'defaultValue':_0x79a7('0x5')},'transferredAt':{'type':Sequelize[_0x79a7('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x79a7('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 28f3106..51ac6ae 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 _0x3385=['fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x3385,0xa6));var _0x5338=function(_0x4df6f9,_0x44bd65){_0x4df6f9=_0x4df6f9-0x0;var _0x4b1a73=_0x3385[_0x4df6f9];return _0x4b1a73;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5338('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5338('0x1'));var jsonpatch=require(_0x5338('0x2'));var rp=require(_0x5338('0x3'));var moment=require(_0x5338('0x4'));var BPromise=require(_0x5338('0x5'));var Mustache=require(_0x5338('0x6'));var util=require(_0x5338('0x7'));var path=require(_0x5338('0x8'));var sox=require(_0x5338('0x9'));var csv=require(_0x5338('0xa'));var ejs=require(_0x5338('0xb'));var fs=require('fs');var _=require(_0x5338('0xc'));var squel=require(_0x5338('0xd'));var crypto=require('crypto');var jsforce=require(_0x5338('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5338('0xa'));var querystring=require(_0x5338('0xf'));var Papa=require('papaparse');var Redis=require(_0x5338('0x10'));var authService=require(_0x5338('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5338('0x12'));var logger=require('../../config/logger')(_0x5338('0x13'));var utils=require(_0x5338('0x14'));var config=require(_0x5338('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe81de5,_0x1faafe){_0x1faafe=_0x1faafe||0xcc;return function(_0x265228){if(_0x265228){return _0xe81de5[_0x5338('0x16')](_0x1faafe);}return _0xe81de5[_0x5338('0x17')](_0x1faafe)[_0x5338('0x18')]();};}function respondWithResult(_0x35b550,_0x2820b2){_0x2820b2=_0x2820b2||0xc8;return function(_0x3218f4){if(_0x3218f4){return _0x35b550[_0x5338('0x17')](_0x2820b2)[_0x5338('0x19')](_0x3218f4);}};}function respondWithFilteredResult(_0x14caaa,_0x2b58ab){return function(_0x4babf4){if(_0x4babf4){var _0x8d3e8c=_0x4babf4[_0x5338('0x1a')],_0xfccbda=_0x2b58ab[_0x5338('0x1b')],_0xa07a94=_0x2b58ab['offset']+_0x2b58ab[_0x5338('0x1c')],_0xdeae6c;if(_0xa07a94>=_0x8d3e8c){_0xa07a94=_0x8d3e8c;_0xdeae6c=0xc8;}else{_0xdeae6c=0xce;}_0x14caaa['status'](_0xdeae6c);return _0x14caaa[_0x5338('0x1d')]('Content-Range',_0xfccbda+'-'+_0xa07a94+'/'+_0x8d3e8c)[_0x5338('0x19')](_0x4babf4);}return null;};}function patchUpdates(_0x311c9a){return function(_0x4e7bad){try{jsonpatch[_0x5338('0x1e')](_0x4e7bad,_0x311c9a,!![]);}catch(_0x3f225b){return BPromise[_0x5338('0x1f')](_0x3f225b);}return _0x4e7bad[_0x5338('0x20')]();};}function saveUpdates(_0x3e40df,_0x1201f0){return function(_0x3c5a64){if(_0x3c5a64){return _0x3c5a64[_0x5338('0x21')](_0x3e40df)[_0x5338('0x22')](function(_0x4323a5){return _0x4323a5;});}return null;};}function removeEntity(_0x25e4e7,_0x24e5f9){return function(_0x57a0c5){if(_0x57a0c5){return _0x57a0c5[_0x5338('0x23')]()['then'](function(){_0x25e4e7[_0x5338('0x17')](0xcc)[_0x5338('0x18')]();});}};}function handleEntityNotFound(_0x52256d,_0x1d8c5b){return function(_0x3b59dd){if(!_0x3b59dd){_0x52256d[_0x5338('0x16')](0x194);}return _0x3b59dd;};}function handleError(_0x1a9cdb,_0x3dd2fd){_0x3dd2fd=_0x3dd2fd||0x1f4;return function(_0x478fe3){logger[_0x5338('0x24')](_0x478fe3[_0x5338('0x25')]);if(_0x478fe3[_0x5338('0x26')]){delete _0x478fe3[_0x5338('0x26')];}_0x1a9cdb['status'](_0x3dd2fd)[_0x5338('0x27')](_0x478fe3);};}exports['index']=function(_0x49a08f,_0x52be76){var _0x3ca724={},_0x42bfc6={},_0xe211f6={'count':0x0,'rows':[]};var _0x6465c3=_[_0x5338('0x28')](db['ChatTransferReport'][_0x5338('0x29')],function(_0x1caaa7){return{'name':_0x1caaa7[_0x5338('0x2a')],'type':_0x1caaa7[_0x5338('0x2b')]['key']};});_0x42bfc6['model']=_[_0x5338('0x28')](_0x6465c3,_0x5338('0x26'));_0x42bfc6[_0x5338('0x2c')]=_[_0x5338('0x2d')](_0x49a08f['query']);_0x42bfc6[_0x5338('0x2e')]=_['intersection'](_0x42bfc6[_0x5338('0x2f')],_0x42bfc6[_0x5338('0x2c')]);_0x3ca724[_0x5338('0x30')]=_[_0x5338('0x31')](_0x42bfc6[_0x5338('0x2f')],qs['fields'](_0x49a08f[_0x5338('0x2c')][_0x5338('0x32')]));_0x3ca724[_0x5338('0x30')]=_0x3ca724[_0x5338('0x30')][_0x5338('0x33')]?_0x3ca724[_0x5338('0x30')]:_0x42bfc6[_0x5338('0x2f')];if(!_0x49a08f[_0x5338('0x2c')][_0x5338('0x34')]('nolimit')){_0x3ca724[_0x5338('0x1c')]=qs[_0x5338('0x1c')](_0x49a08f[_0x5338('0x2c')][_0x5338('0x1c')]);_0x3ca724[_0x5338('0x1b')]=qs[_0x5338('0x1b')](_0x49a08f[_0x5338('0x2c')][_0x5338('0x1b')]);}_0x3ca724[_0x5338('0x35')]=qs[_0x5338('0x36')](_0x49a08f[_0x5338('0x2c')][_0x5338('0x36')]);_0x3ca724[_0x5338('0x37')]=qs[_0x5338('0x2e')](_[_0x5338('0x38')](_0x49a08f['query'],_0x42bfc6[_0x5338('0x2e')]));if(_0x49a08f[_0x5338('0x2c')][_0x5338('0x39')]){_0x3ca724['where']=_[_0x5338('0x3a')](_0x3ca724[_0x5338('0x37')],{'$or':_[_0x5338('0x28')](_0x6465c3,function(_0x3dba36){if(_0x3dba36['type']!==_0x5338('0x3b')){var _0x50ea3f={};_0x50ea3f[_0x3dba36[_0x5338('0x26')]]={'$like':'%'+_0x49a08f['query'][_0x5338('0x39')]+'%'};return _0x50ea3f;}})});}_0x3ca724=_[_0x5338('0x3a')]({},_0x3ca724,_0x49a08f[_0x5338('0x3c')]);var _0x231f7f={'where':_0x3ca724[_0x5338('0x37')]};return db[_0x5338('0x3d')]['count'](_0x231f7f)[_0x5338('0x22')](function(_0x1e819f){_0xe211f6[_0x5338('0x1a')]=_0x1e819f;if(_0x49a08f[_0x5338('0x2c')][_0x5338('0x3e')]){_0x3ca724[_0x5338('0x3f')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x5338('0x40')](_0x3ca724);})['then'](function(_0x3e2b07){_0xe211f6[_0x5338('0x41')]=_0x3e2b07;return _0xe211f6;})[_0x5338('0x22')](respondWithFilteredResult(_0x52be76,_0x3ca724))[_0x5338('0x42')](handleError(_0x52be76,null));};exports['show']=function(_0x1a1c64,_0x3c61ee){var _0x1068f5={'raw':!![],'where':{'id':_0x1a1c64[_0x5338('0x43')]['id']}},_0x314f9={};_0x314f9[_0x5338('0x2f')]=_[_0x5338('0x2d')](db[_0x5338('0x3d')][_0x5338('0x29')]);_0x314f9[_0x5338('0x2c')]=_[_0x5338('0x2d')](_0x1a1c64['query']);_0x314f9[_0x5338('0x2e')]=_['intersection'](_0x314f9[_0x5338('0x2f')],_0x314f9[_0x5338('0x2c')]);_0x1068f5['attributes']=_[_0x5338('0x31')](_0x314f9[_0x5338('0x2f')],qs[_0x5338('0x32')](_0x1a1c64[_0x5338('0x2c')]['fields']));_0x1068f5[_0x5338('0x30')]=_0x1068f5[_0x5338('0x30')][_0x5338('0x33')]?_0x1068f5['attributes']:_0x314f9[_0x5338('0x2f')];if(_0x1a1c64[_0x5338('0x2c')][_0x5338('0x3e')]){_0x1068f5[_0x5338('0x3f')]=[{'all':!![]}];}_0x1068f5=_['merge']({},_0x1068f5,_0x1a1c64[_0x5338('0x3c')]);return db[_0x5338('0x3d')][_0x5338('0x44')](_0x1068f5)[_0x5338('0x22')](handleEntityNotFound(_0x3c61ee,null))[_0x5338('0x22')](respondWithResult(_0x3c61ee,null))['catch'](handleError(_0x3c61ee,null));};exports[_0x5338('0x45')]=function(_0x3fcbec,_0x52b89e){return db['ChatTransferReport'][_0x5338('0x45')](_0x3fcbec[_0x5338('0x46')],{})[_0x5338('0x22')](respondWithResult(_0x52b89e,0xc9))[_0x5338('0x42')](handleError(_0x52b89e,null));};exports[_0x5338('0x21')]=function(_0x2288ea,_0x492ef2){if(_0x2288ea[_0x5338('0x46')]['id']){delete _0x2288ea[_0x5338('0x46')]['id'];}return db[_0x5338('0x3d')]['find']({'where':{'id':_0x2288ea['params']['id']}})['then'](handleEntityNotFound(_0x492ef2,null))[_0x5338('0x22')](saveUpdates(_0x2288ea['body'],null))[_0x5338('0x22')](respondWithResult(_0x492ef2,null))[_0x5338('0x42')](handleError(_0x492ef2,null));};exports['destroy']=function(_0x3a385e,_0x2473e6){return db[_0x5338('0x3d')][_0x5338('0x44')]({'where':{'id':_0x3a385e['params']['id']}})[_0x5338('0x22')](handleEntityNotFound(_0x2473e6,null))[_0x5338('0x22')](removeEntity(_0x2473e6,null))[_0x5338('0x42')](handleError(_0x2473e6,null));};exports[_0x5338('0x47')]=function(_0x323c9d,_0x4da6c8){return db[_0x5338('0x3d')][_0x5338('0x47')]()[_0x5338('0x22')](respondWithResult(_0x4da6c8,null))[_0x5338('0x42')](handleError(_0x4da6c8,null));}; \ No newline at end of file +var _0x3e87=['fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','length','merge','find','create','update','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','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','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','save','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','key','keys','query','filters','intersection','model'];(function(_0x27f1f8,_0x3b18ce){var _0x38ec34=function(_0x2edd78){while(--_0x2edd78){_0x27f1f8['push'](_0x27f1f8['shift']());}};_0x38ec34(++_0x3b18ce);}(_0x3e87,0xf0));var _0x73e8=function(_0x172dea,_0x5d9da7){_0x172dea=_0x172dea-0x0;var _0x441bf1=_0x3e87[_0x172dea];return _0x441bf1;};'use strict';var pdf=require(_0x73e8('0x0'));var emlformat=require(_0x73e8('0x1'));var rimraf=require(_0x73e8('0x2'));var zipdir=require(_0x73e8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x73e8('0x4'));var moment=require(_0x73e8('0x5'));var BPromise=require(_0x73e8('0x6'));var Mustache=require('mustache');var util=require(_0x73e8('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x73e8('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x73e8('0x9'));var crypto=require('crypto');var jsforce=require(_0x73e8('0xa'));var deskjs=require(_0x73e8('0xb'));var toCsv=require(_0x73e8('0xc'));var querystring=require(_0x73e8('0xd'));var Papa=require(_0x73e8('0xe'));var Redis=require('ioredis');var authService=require(_0x73e8('0xf'));var qs=require(_0x73e8('0x10'));var as=require(_0x73e8('0x11'));var hardwareService=require(_0x73e8('0x12'));var logger=require(_0x73e8('0x13'))(_0x73e8('0x14'));var utils=require(_0x73e8('0x15'));var config=require('../../config/environment');var db=require(_0x73e8('0x16'))['db'];function respondWithStatusCode(_0x3618d4,_0x5ec48f){_0x5ec48f=_0x5ec48f||0xcc;return function(_0x6423aa){if(_0x6423aa){return _0x3618d4['sendStatus'](_0x5ec48f);}return _0x3618d4[_0x73e8('0x17')](_0x5ec48f)[_0x73e8('0x18')]();};}function respondWithResult(_0x321670,_0x13f6cd){_0x13f6cd=_0x13f6cd||0xc8;return function(_0x214a77){if(_0x214a77){return _0x321670[_0x73e8('0x17')](_0x13f6cd)[_0x73e8('0x19')](_0x214a77);}};}function respondWithFilteredResult(_0x24ccd1,_0x37e076){return function(_0x165ff5){if(_0x165ff5){var _0x4382d8=_0x165ff5[_0x73e8('0x1a')],_0x34550d=_0x37e076[_0x73e8('0x1b')],_0x272cf4=_0x37e076['offset']+_0x37e076[_0x73e8('0x1c')],_0x250f9f;if(_0x272cf4>=_0x4382d8){_0x272cf4=_0x4382d8;_0x250f9f=0xc8;}else{_0x250f9f=0xce;}_0x24ccd1[_0x73e8('0x17')](_0x250f9f);return _0x24ccd1[_0x73e8('0x1d')](_0x73e8('0x1e'),_0x34550d+'-'+_0x272cf4+'/'+_0x4382d8)[_0x73e8('0x19')](_0x165ff5);}return null;};}function patchUpdates(_0xb3c687){return function(_0x1ef0cd){try{jsonpatch['apply'](_0x1ef0cd,_0xb3c687,!![]);}catch(_0x31b0d3){return BPromise['reject'](_0x31b0d3);}return _0x1ef0cd[_0x73e8('0x1f')]();};}function saveUpdates(_0x52ef52,_0x34f7bf){return function(_0x423f40){if(_0x423f40){return _0x423f40['update'](_0x52ef52)[_0x73e8('0x20')](function(_0x1c23c5){return _0x1c23c5;});}return null;};}function removeEntity(_0x7c8b4b,_0x4f30e6){return function(_0x15b1d1){if(_0x15b1d1){return _0x15b1d1[_0x73e8('0x21')]()[_0x73e8('0x20')](function(){_0x7c8b4b[_0x73e8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c11d2,_0x12b9ec){return function(_0x5d24db){if(!_0x5d24db){_0x4c11d2['sendStatus'](0x194);}return _0x5d24db;};}function handleError(_0x14295f,_0x2119da){_0x2119da=_0x2119da||0x1f4;return function(_0x3559bd){logger[_0x73e8('0x22')](_0x3559bd[_0x73e8('0x23')]);if(_0x3559bd[_0x73e8('0x24')]){delete _0x3559bd[_0x73e8('0x24')];}_0x14295f[_0x73e8('0x17')](_0x2119da)[_0x73e8('0x25')](_0x3559bd);};}exports[_0x73e8('0x26')]=function(_0x427a28,_0x5e3f26){var _0x309f45={},_0x3ca125={},_0x455236={'count':0x0,'rows':[]};var _0x4c4f18=_[_0x73e8('0x27')](db[_0x73e8('0x28')][_0x73e8('0x29')],function(_0x54d929){return{'name':_0x54d929['fieldName'],'type':_0x54d929['type'][_0x73e8('0x2a')]};});_0x3ca125['model']=_['map'](_0x4c4f18,'name');_0x3ca125['query']=_[_0x73e8('0x2b')](_0x427a28[_0x73e8('0x2c')]);_0x3ca125[_0x73e8('0x2d')]=_[_0x73e8('0x2e')](_0x3ca125[_0x73e8('0x2f')],_0x3ca125['query']);_0x309f45['attributes']=_[_0x73e8('0x2e')](_0x3ca125[_0x73e8('0x2f')],qs[_0x73e8('0x30')](_0x427a28['query'][_0x73e8('0x30')]));_0x309f45[_0x73e8('0x31')]=_0x309f45['attributes']['length']?_0x309f45[_0x73e8('0x31')]:_0x3ca125[_0x73e8('0x2f')];if(!_0x427a28[_0x73e8('0x2c')][_0x73e8('0x32')](_0x73e8('0x33'))){_0x309f45[_0x73e8('0x1c')]=qs[_0x73e8('0x1c')](_0x427a28[_0x73e8('0x2c')]['limit']);_0x309f45['offset']=qs[_0x73e8('0x1b')](_0x427a28[_0x73e8('0x2c')][_0x73e8('0x1b')]);}_0x309f45[_0x73e8('0x34')]=qs[_0x73e8('0x35')](_0x427a28['query'][_0x73e8('0x35')]);_0x309f45[_0x73e8('0x36')]=qs[_0x73e8('0x2d')](_[_0x73e8('0x37')](_0x427a28[_0x73e8('0x2c')],_0x3ca125['filters']));if(_0x427a28[_0x73e8('0x2c')]['filter']){_0x309f45['where']=_['merge'](_0x309f45['where'],{'$or':_[_0x73e8('0x27')](_0x4c4f18,function(_0x1de143){if(_0x1de143['type']!==_0x73e8('0x38')){var _0x37ad31={};_0x37ad31[_0x1de143[_0x73e8('0x24')]]={'$like':'%'+_0x427a28[_0x73e8('0x2c')][_0x73e8('0x39')]+'%'};return _0x37ad31;}})});}_0x309f45=_['merge']({},_0x309f45,_0x427a28[_0x73e8('0x3a')]);var _0x94dad5={'where':_0x309f45[_0x73e8('0x36')]};return db[_0x73e8('0x28')]['count'](_0x94dad5)[_0x73e8('0x20')](function(_0x5e01fc){_0x455236[_0x73e8('0x1a')]=_0x5e01fc;if(_0x427a28[_0x73e8('0x2c')][_0x73e8('0x3b')]){_0x309f45[_0x73e8('0x3c')]=[{'all':!![]}];}return db[_0x73e8('0x28')][_0x73e8('0x3d')](_0x309f45);})['then'](function(_0x576c78){_0x455236[_0x73e8('0x3e')]=_0x576c78;return _0x455236;})[_0x73e8('0x20')](respondWithFilteredResult(_0x5e3f26,_0x309f45))[_0x73e8('0x3f')](handleError(_0x5e3f26,null));};exports['show']=function(_0x2b8c8d,_0x33356f){var _0x103f4d={'raw':!![],'where':{'id':_0x2b8c8d['params']['id']}},_0x4618f5={};_0x4618f5[_0x73e8('0x2f')]=_[_0x73e8('0x2b')](db[_0x73e8('0x28')][_0x73e8('0x29')]);_0x4618f5[_0x73e8('0x2c')]=_[_0x73e8('0x2b')](_0x2b8c8d[_0x73e8('0x2c')]);_0x4618f5[_0x73e8('0x2d')]=_[_0x73e8('0x2e')](_0x4618f5[_0x73e8('0x2f')],_0x4618f5[_0x73e8('0x2c')]);_0x103f4d[_0x73e8('0x31')]=_[_0x73e8('0x2e')](_0x4618f5[_0x73e8('0x2f')],qs['fields'](_0x2b8c8d['query'][_0x73e8('0x30')]));_0x103f4d[_0x73e8('0x31')]=_0x103f4d[_0x73e8('0x31')][_0x73e8('0x40')]?_0x103f4d['attributes']:_0x4618f5[_0x73e8('0x2f')];if(_0x2b8c8d[_0x73e8('0x2c')][_0x73e8('0x3b')]){_0x103f4d['include']=[{'all':!![]}];}_0x103f4d=_[_0x73e8('0x41')]({},_0x103f4d,_0x2b8c8d[_0x73e8('0x3a')]);return db['ChatTransferReport'][_0x73e8('0x42')](_0x103f4d)[_0x73e8('0x20')](handleEntityNotFound(_0x33356f,null))['then'](respondWithResult(_0x33356f,null))[_0x73e8('0x3f')](handleError(_0x33356f,null));};exports['create']=function(_0x1603a3,_0x2b017){return db[_0x73e8('0x28')][_0x73e8('0x43')](_0x1603a3['body'],{})['then'](respondWithResult(_0x2b017,0xc9))[_0x73e8('0x3f')](handleError(_0x2b017,null));};exports[_0x73e8('0x44')]=function(_0x5af876,_0x159e76){if(_0x5af876['body']['id']){delete _0x5af876[_0x73e8('0x45')]['id'];}return db[_0x73e8('0x28')][_0x73e8('0x42')]({'where':{'id':_0x5af876[_0x73e8('0x46')]['id']}})[_0x73e8('0x20')](handleEntityNotFound(_0x159e76,null))[_0x73e8('0x20')](saveUpdates(_0x5af876['body'],null))[_0x73e8('0x20')](respondWithResult(_0x159e76,null))[_0x73e8('0x3f')](handleError(_0x159e76,null));};exports['destroy']=function(_0x415fbe,_0x242d30){return db[_0x73e8('0x28')]['find']({'where':{'id':_0x415fbe[_0x73e8('0x46')]['id']}})[_0x73e8('0x20')](handleEntityNotFound(_0x242d30,null))[_0x73e8('0x20')](removeEntity(_0x242d30,null))[_0x73e8('0x3f')](handleError(_0x242d30,null));};exports['describe']=function(_0x15144a,_0x4d4b31){return db['ChatTransferReport'][_0x73e8('0x47')]()[_0x73e8('0x20')](respondWithResult(_0x4d4b31,null))[_0x73e8('0x3f')](handleError(_0x4d4b31,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index acca9de..8b81172 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 _0x7fcf=['uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatTransferReport'];(function(_0x226dc4,_0x491708){var _0x23eebe=function(_0x2a2b2b){while(--_0x2a2b2b){_0x226dc4['push'](_0x226dc4['shift']());}};_0x23eebe(++_0x491708);}(_0x7fcf,0xb5));var _0xf7fc=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x7fcf[_0x18ab2a];return _0x16dcee;};'use strict';var _=require('lodash');var util=require(_0xf7fc('0x0'));var logger=require(_0xf7fc('0x1'))(_0xf7fc('0x2'));var moment=require(_0xf7fc('0x3'));var BPromise=require(_0xf7fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf7fc('0x5'));var rimraf=require(_0xf7fc('0x6'));var config=require(_0xf7fc('0x7'));var attributes=require('./chatTransferReport.attributes');module[_0xf7fc('0x8')]=function(_0xfbd1a5,_0x229e11){return _0xfbd1a5[_0xf7fc('0x9')](_0xf7fc('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf7fc('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc910=['bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x338b58,_0x4cc1f5){var _0x196efa=function(_0x2975eb){while(--_0x2975eb){_0x338b58['push'](_0x338b58['shift']());}};_0x196efa(++_0x4cc1f5);}(_0xc910,0x109));var _0x0c91=function(_0x138544,_0x2ee674){_0x138544=_0x138544-0x0;var _0x54fb5d=_0xc910[_0x138544];return _0x54fb5d;};'use strict';var _=require(_0x0c91('0x0'));var util=require(_0x0c91('0x1'));var logger=require(_0x0c91('0x2'))(_0x0c91('0x3'));var moment=require(_0x0c91('0x4'));var BPromise=require(_0x0c91('0x5'));var rp=require(_0x0c91('0x6'));var fs=require('fs');var path=require(_0x0c91('0x7'));var rimraf=require(_0x0c91('0x8'));var config=require(_0x0c91('0x9'));var attributes=require(_0x0c91('0xa'));module['exports']=function(_0x129432,_0x439ac9){return _0x129432[_0x0c91('0xb')](_0x0c91('0xc'),attributes,{'tableName':_0x0c91('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0c91('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 24ec56c..df7ef94 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 _0x693b=['request\x20sent','debug','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0xfc81e3,_0x57d42a){var _0x473d29=function(_0x2e903b){while(--_0x2e903b){_0xfc81e3['push'](_0xfc81e3['shift']());}};_0x473d29(++_0x57d42a);}(_0x693b,0x13b));var _0xb693=function(_0x2fdfda,_0x35fc00){_0x2fdfda=_0x2fdfda-0x0;var _0x284bc9=_0x693b[_0x2fdfda];return _0x284bc9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb693('0x0'));var BPromise=require(_0xb693('0x1'));var rs=require(_0xb693('0x2'));var fs=require('fs');var Redis=require(_0xb693('0x3'));var db=require(_0xb693('0x4'))['db'];var utils=require(_0xb693('0x5'));var logger=require('../../config/logger')(_0xb693('0x6'));var config=require(_0xb693('0x7'));var jayson=require(_0xb693('0x8'));var client=jayson[_0xb693('0x9')][_0xb693('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a4680,_0x4d1ea5,_0xd4cff9){return new BPromise(function(_0x57378d,_0x44ca77){return client[_0xb693('0xb')](_0x4a4680,_0xd4cff9)[_0xb693('0xc')](function(_0x238e03){logger[_0xb693('0xd')](_0xb693('0xe'),_0x4d1ea5,_0xb693('0xf'));logger[_0xb693('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4d1ea5,'request\x20sent',JSON['stringify'](_0x238e03));if(_0x238e03[_0xb693('0x11')]){if(_0x238e03[_0xb693('0x11')][_0xb693('0x12')]===0x1f4){logger['error'](_0xb693('0xe'),_0x4d1ea5,_0x238e03[_0xb693('0x11')]['message']);return _0x44ca77(_0x238e03['error'][_0xb693('0x13')]);}logger[_0xb693('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x4d1ea5,_0x238e03['error'][_0xb693('0x13')]);return _0x57378d(_0x238e03[_0xb693('0x11')][_0xb693('0x13')]);}else{logger[_0xb693('0xd')](_0xb693('0xe'),_0x4d1ea5,'request\x20sent');_0x57378d(_0x238e03[_0xb693('0x14')][_0xb693('0x13')]);}})[_0xb693('0x15')](function(_0x1d3075){logger[_0xb693('0x11')](_0xb693('0xe'),_0x4d1ea5,_0x1d3075);_0x44ca77(_0x1d3075);});});} \ No newline at end of file +var _0x8bc5=['ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','info','debug'];(function(_0x17930c,_0x3887d1){var _0x3a8866=function(_0x4b134b){while(--_0x4b134b){_0x17930c['push'](_0x17930c['shift']());}};_0x3a8866(++_0x3887d1);}(_0x8bc5,0xf8));var _0x58bc=function(_0x23cdf7,_0x2181bc){_0x23cdf7=_0x23cdf7-0x0;var _0x34e058=_0x8bc5[_0x23cdf7];return _0x34e058;};'use strict';var _=require(_0x58bc('0x0'));var util=require(_0x58bc('0x1'));var moment=require('moment');var BPromise=require(_0x58bc('0x2'));var rs=require(_0x58bc('0x3'));var fs=require('fs');var Redis=require(_0x58bc('0x4'));var db=require(_0x58bc('0x5'))['db'];var utils=require(_0x58bc('0x6'));var logger=require(_0x58bc('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x58bc('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x14eb47,_0x2c85bc,_0x3a4569){return new BPromise(function(_0x20aaf5,_0x4e4afa){return client[_0x58bc('0x9')](_0x14eb47,_0x3a4569)['then'](function(_0x259af8){logger[_0x58bc('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x2c85bc,'request\x20sent');logger[_0x58bc('0xb')](_0x58bc('0xc'),_0x2c85bc,_0x58bc('0xd'),JSON[_0x58bc('0xe')](_0x259af8));if(_0x259af8['error']){if(_0x259af8[_0x58bc('0xf')][_0x58bc('0x10')]===0x1f4){logger['error'](_0x58bc('0x11'),_0x2c85bc,_0x259af8[_0x58bc('0xf')][_0x58bc('0x12')]);return _0x4e4afa(_0x259af8['error']['message']);}logger[_0x58bc('0xf')](_0x58bc('0x11'),_0x2c85bc,_0x259af8['error'][_0x58bc('0x12')]);return _0x20aaf5(_0x259af8[_0x58bc('0xf')][_0x58bc('0x12')]);}else{logger[_0x58bc('0xa')](_0x58bc('0x11'),_0x2c85bc,_0x58bc('0xd'));_0x20aaf5(_0x259af8['result'][_0x58bc('0x12')]);}})[_0x58bc('0x13')](function(_0x43389f){logger['error'](_0x58bc('0x11'),_0x2c85bc,_0x43389f);_0x4e4afa(_0x43389f);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 8dd2fa2..de8cbb8 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 _0x5f66=['describe','get','/:id','show','create','put','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/describe',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller['update']);router[_0x65f6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2032=['describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x1d0d20,_0x3f57ca){var _0x7e9f43=function(_0x3bf672){while(--_0x3bf672){_0x1d0d20['push'](_0x1d0d20['shift']());}};_0x7e9f43(++_0x3f57ca);}(_0x2032,0xd9));var _0x2203=function(_0x3bc093,_0x4673c0){_0x3bc093=_0x3bc093-0x0;var _0x1187da=_0x2032[_0x3bc093];return _0x1187da;};'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 auth=require(_0x2203('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2203('0x5'));var controller=require(_0x2203('0x6'));router[_0x2203('0x7')]('/',auth[_0x2203('0x8')](),controller[_0x2203('0x9')]);router[_0x2203('0x7')](_0x2203('0xa'),auth[_0x2203('0x8')](),controller[_0x2203('0xb')]);router[_0x2203('0x7')](_0x2203('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller[_0x2203('0xe')]);router[_0x2203('0xf')](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x10')]);router['delete'](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);module[_0x2203('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 4715a14..ead1a5c 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 _0x0bd6=['Type\x20a\x20message','Send','Skip','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','TEXT','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error'];(function(_0x205f40,_0x2f041d){var _0xf30afa=function(_0x35ce35){while(--_0x35ce35){_0x205f40['push'](_0x205f40['shift']());}};_0xf30afa(++_0x2f041d);}(_0x0bd6,0x1a6));var _0x60bd=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0bd6[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x60bd('0x0'));var rs=require('randomstring');module[_0x60bd('0x1')]={'name':{'type':Sequelize[_0x60bd('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x60bd('0x3')},'description':{'type':Sequelize[_0x60bd('0x2')]},'mapKey':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0x4')},'mapKeyOffline':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0x4')},'key':{'type':Sequelize[_0x60bd('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x60bd('0x2')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x60bd('0x2')],'allowNull':![],'defaultValue':_0x60bd('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x60bd('0x2')],'allowNull':![],'defaultValue':_0x60bd('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x60bd('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x60bd('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x60bd('0x9')](_0x60bd('0xa'),_0x60bd('0xb')),'defaultValue':_0x60bd('0xa')},'header_online':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x60bd('0xd')},'offline_chat_button':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0xe')},'download_transcript':{'type':Sequelize[_0x60bd('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x60bd('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x60bd('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x60bd('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x60bd('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0x12')},'noteTitle':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x60bd('0x13')},'closingMessage':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0x14')},'skipMessageButton':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x60bd('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x60bd('0x16')},'ratingType':{'type':Sequelize[_0x60bd('0x9')](_0x60bd('0x17'),_0x60bd('0x18')),'defaultValue':_0x60bd('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x60bd('0x19')]({'items':[{'type':_0x60bd('0x1a'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x60bd('0x1b'),'helpText':''}},{'type':_0x60bd('0x1a'),'props':{'title':_0x60bd('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x60bd('0x4'),'type':_0x60bd('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x60bd('0x1c')](_0x60bd('0x1d'))?JSON[_0x60bd('0x1e')](this[_0x60bd('0x1c')](_0x60bd('0x1d'))):{};},'set':function(_0x2a968a){return this[_0x60bd('0x1f')](_0x60bd('0x1d'),JSON[_0x60bd('0x19')](_0x2a968a));}},'offlineForm':{'type':Sequelize[_0x60bd('0x20')],'defaultValue':function(){return JSON[_0x60bd('0x19')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x60bd('0x4'),'type':_0x60bd('0x4')},'variable':null},{'type':_0x60bd('0x21'),'config':{'placeholder':_0x60bd('0x22')},'props':{'title':_0x60bd('0x22'),'helpText':_0x60bd('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x60bd('0x1c')](_0x60bd('0x24'))?JSON[_0x60bd('0x1e')](this[_0x60bd('0x1c')]('offlineForm')):{};},'set':function(_0x4d3349){return this[_0x60bd('0x1f')]('offlineForm',JSON[_0x60bd('0x19')](_0x4d3349));}},'token':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':function(){return rs[_0x60bd('0x25')]();}},'autoclose':{'type':Sequelize[_0x60bd('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x60bd('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x60bd('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x60bd('0x2')]},'forwardOffline':{'type':Sequelize[_0x60bd('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x60bd('0x26')},'waitingMessage':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0x27')},'offlineMessageBody':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0x28')},'skipUnmanaged':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0x15')},'sendUnmanaged':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0x14')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x60bd('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x60bd('0x20')]},'showAgentAvatar':{'type':Sequelize[_0x60bd('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x60bd('0x2')]},'notificationTemplate':{'type':Sequelize[_0x60bd('0x20')],'defaultValue':function(){return _0x60bd('0x29');}},'notificationSound':{'type':Sequelize[_0x60bd('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x60bd('0xf')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x60bd('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x60bd('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x60bd('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0x2b')},'defaultTitle':{'type':Sequelize[_0x60bd('0x2')]},'customerAvatar':{'type':Sequelize[_0x60bd('0x20')]},'showCustomerAvatar':{'type':Sequelize[_0x60bd('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x60bd('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x60bd('0x2')],'allowNull':![],'defaultValue':_0x60bd('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x60bd('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x60bd('0x2')],'defaultValue':_0x60bd('0x2d')},'systemAvatar':{'type':Sequelize[_0x60bd('0x20')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x60bd('0x8')],'comment':_0x60bd('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x60bd('0x2f'),'set':function(_0x4e536b){if(!_0x4e536b)this[_0x60bd('0x1f')]('mandatoryDispositionPauseId',null);this[_0x60bd('0x1f')](_0x60bd('0x30'),_0x4e536b);}}}; \ No newline at end of file +var _0x9526=['Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','address','email','Agent','#9f946a','INTEGER','BOOLEAN','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'];(function(_0x4c71a6,_0x5bab4d){var _0x53d900=function(_0x3ee7cd){while(--_0x3ee7cd){_0x4c71a6['push'](_0x4c71a6['shift']());}};_0x53d900(++_0x5bab4d);}(_0x9526,0xf4));var _0x6952=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0x9526[_0x368bba];return _0x409f8f;};'use strict';var Sequelize=require(_0x6952('0x0'));var rs=require(_0x6952('0x1'));module[_0x6952('0x2')]={'name':{'type':Sequelize[_0x6952('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6952('0x4')},'description':{'type':Sequelize[_0x6952('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x6952('0x5')},'mapKeyOffline':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0x5')},'key':{'type':Sequelize[_0x6952('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0x6')},'customerAlias':{'type':Sequelize[_0x6952('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6952('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6952('0x3')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6952('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6952('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6952('0x3')]},'animation':{'type':Sequelize[_0x6952('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x6952('0xa'),'squared'),'defaultValue':_0x6952('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x6952('0xb')},'start_chat_button':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0xc')},'offline_chat_button':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0xd')},'header_offline':{'type':Sequelize[_0x6952('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x6952('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x6952('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6952('0xf')]},'closingQuestion':{'type':Sequelize[_0x6952('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0x11')},'noteTitle':{'type':Sequelize[_0x6952('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0x12')},'closingMessage':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x6952('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6952('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6952('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0x14')},'ratingType':{'type':Sequelize[_0x6952('0x15')](_0x6952('0x16'),_0x6952('0x17')),'defaultValue':_0x6952('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x6952('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6952('0xf')],'defaultValue':function(){return JSON[_0x6952('0x18')]({'items':[{'type':_0x6952('0x19'),'variable':null,'config':{'placeholder':_0x6952('0x1a'),'type':_0x6952('0x1b'),'required':!![]},'props':{'title':_0x6952('0x1a'),'helpText':''}},{'type':_0x6952('0x19'),'props':{'title':_0x6952('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x6952('0x5'),'type':_0x6952('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6952('0x1c')](_0x6952('0x1d'))?JSON[_0x6952('0x1e')](this['getDataValue'](_0x6952('0x1d'))):{};},'set':function(_0x20773d){return this[_0x6952('0x1f')](_0x6952('0x1d'),JSON[_0x6952('0x18')](_0x20773d));}},'offlineForm':{'type':Sequelize[_0x6952('0xf')],'defaultValue':function(){return JSON[_0x6952('0x18')]({'items':[{'type':_0x6952('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x6952('0x5'),'type':_0x6952('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x6952('0x20')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x6952('0x1c')](_0x6952('0x21'))?JSON[_0x6952('0x1e')](this['getDataValue'](_0x6952('0x21'))):{};},'set':function(_0x4a9dfe){return this['setDataValue'](_0x6952('0x21'),JSON[_0x6952('0x18')](_0x4a9dfe));}},'token':{'type':Sequelize[_0x6952('0x3')],'defaultValue':function(){return rs[_0x6952('0x22')]();}},'autoclose':{'type':Sequelize[_0x6952('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6952('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6952('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x6952('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6952('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x6952('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x6952('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x6952('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6952('0x26')},'skipUnmanaged':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0x27')},'sendUnmanaged':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x6952('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6952('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x6952('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x6952('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6952('0xf')],'defaultValue':function(){return _0x6952('0x28');}},'notificationSound':{'type':Sequelize[_0x6952('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6952('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6952('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6952('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0x2a')},'verticalAlignment':{'type':Sequelize[_0x6952('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x6952('0x3')],'defaultValue':_0x6952('0x2b')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6952('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6952('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6952('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6952('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6952('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6952('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6952('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x6952('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6952('0x8')],'comment':_0x6952('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x6952('0x9')],'defaultValue':![],'comment':_0x6952('0x2d'),'set':function(_0x53b937){if(!_0x53b937)this[_0x6952('0x1f')](_0x6952('0x2e'),null);this['setDataValue']('mandatoryDisposition',_0x53b937);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index a2383f9..1686453 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 _0x0cc2=['readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','Smtp','forwardOfflineAddress','service','port','secure','authentication','auth','pass','sendMail','email','offlineMessageSubject','addInteraction','omit','ids','getInteractions','fullname','internal','Tags','color','tag','timezone','interval','iftime\x20%s','indexOf','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','increment','chatLicenseExceeded','all','server/files/chat/iframe.js','utf8','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','addApplications','sequelize','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','onlineForm','fromKey','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','./chatWebsite.socket','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','ChatWebsites','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','rows','show','Pause','length','includeAll','include','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','params','describe','addDisposition','ChatWebsiteId','Disposition','findOne','hasOwnProperty','removeDispositions','addAnswer','getAnswers','CannedAnswer','findAll','removeAnswers','filename','addAvatar','file','addCustomerAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.png','sitepic','../../config/license/util','getLicense','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','isNil','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','server/files/images/avatars/','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','no\x20available\x20attributes','updatedAt','difference','createdAt','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','List','CmContact','DESC','ChatApplication','Applications','list','applications','orderBy','priority','asc','account','Contacts','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','close','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','defaults'];(function(_0x353068,_0x4d13b5){var _0x5ec3a3=function(_0x15a45e){while(--_0x15a45e){_0x353068['push'](_0x353068['shift']());}};_0x5ec3a3(++_0x4d13b5);}(_0x0cc2,0x16a));var _0x20cc=function(_0x11de44,_0xbd656b){_0x11de44=_0x11de44-0x0;var _0x333098=_0x0cc2[_0x11de44];return _0x333098;};'use strict';var pdf=require(_0x20cc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x20cc('0x1'));var zipdir=require(_0x20cc('0x2'));var jsonpatch=require(_0x20cc('0x3'));var rp=require(_0x20cc('0x4'));var moment=require(_0x20cc('0x5'));var BPromise=require(_0x20cc('0x6'));var Mustache=require(_0x20cc('0x7'));var util=require(_0x20cc('0x8'));var path=require(_0x20cc('0x9'));var sox=require(_0x20cc('0xa'));var csv=require(_0x20cc('0xb'));var ejs=require(_0x20cc('0xc'));var fs=require('fs');var _=require(_0x20cc('0xd'));var squel=require(_0x20cc('0xe'));var crypto=require(_0x20cc('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x20cc('0x10'));var toCsv=require(_0x20cc('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x20cc('0x11'));var authService=require(_0x20cc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x20cc('0x13'));var hardwareService=require(_0x20cc('0x14'));var logger=require(_0x20cc('0x15'))(_0x20cc('0x16'));var utils=require(_0x20cc('0x17'));var config=require('../../config/environment');var db=require(_0x20cc('0x18'))['db'];config[_0x20cc('0x19')]=_['defaults'](config[_0x20cc('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x20cc('0x19')]));require(_0x20cc('0x1a'))[_0x20cc('0x1b')](socket);var jayson=require(_0x20cc('0x1c'));var client=jayson[_0x20cc('0x1d')][_0x20cc('0x1e')]({'port':0x232c});var client9002=jayson[_0x20cc('0x1d')][_0x20cc('0x1e')]({'port':0x232a});var client9003=jayson[_0x20cc('0x1d')]['http']({'port':0x232b});function checkPasswordPattern(_0x1d7923,_0x11995f,_0x1aeda3){if(_0x1aeda3){var _0xec90fb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xec90fb['test'](_0x11995f)){return _0x1d7923;}else{throw new db[(_0x20cc('0x1f'))][(_0x20cc('0x20'))](_0x20cc('0x21'));}}else{return _0x1d7923;}}function respondWithRpcPromise(_0x48a43c,_0x20f56a,_0x3e3466,_0x6098db){return new BPromise(function(_0x5ac062,_0x5b0810){var _0x450e4c=_0x6098db||client;return _0x450e4c[_0x20cc('0x22')](_0x48a43c,_0x3e3466)['then'](function(_0x386689){logger['info'](_0x20cc('0x23'),_0x20f56a,'request\x20sent');logger['debug'](_0x20cc('0x24'),_0x20f56a,_0x20cc('0x25'),JSON['stringify'](_0x386689));if(_0x386689[_0x20cc('0x26')]){if(_0x386689['error'][_0x20cc('0x27')]===0x1f4){logger[_0x20cc('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x20f56a,_0x386689[_0x20cc('0x26')]['message']);return _0x5b0810(_0x386689['error'][_0x20cc('0x28')]);}logger['error'](_0x20cc('0x23'),_0x20f56a,_0x386689['error'][_0x20cc('0x28')]);return _0x5ac062(_0x386689[_0x20cc('0x26')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x20f56a,_0x20cc('0x25'));_0x5ac062(_0x386689[_0x20cc('0x29')][_0x20cc('0x28')]);}})[_0x20cc('0x2a')](function(_0x2ed227){logger[_0x20cc('0x26')](_0x20cc('0x23'),_0x20f56a,_0x2ed227);_0x5b0810(_0x2ed227);});});}function respondWithStatusCode(_0x6d30a9,_0xdd35e){_0xdd35e=_0xdd35e||0xcc;return function(_0x4b2455){if(_0x4b2455){return _0x6d30a9[_0x20cc('0x2b')](_0xdd35e);}return _0x6d30a9['status'](_0xdd35e)[_0x20cc('0x2c')]();};}function respondWithResult(_0x134098,_0x470739){_0x470739=_0x470739||0xc8;return function(_0xb252a5){if(_0xb252a5){return _0x134098[_0x20cc('0x2d')](_0x470739)['json'](_0xb252a5);}};}function respondWithFilteredResult(_0x14a4c9,_0x63a6ee){return function(_0x5dd6c6){if(_0x5dd6c6){var _0x2d97c8=_0x5dd6c6[_0x20cc('0x2e')],_0x41bb94=_0x63a6ee[_0x20cc('0x2f')],_0x1c604e=_0x63a6ee['offset']+_0x63a6ee[_0x20cc('0x30')],_0x44e50f;if(_0x1c604e>=_0x2d97c8){_0x1c604e=_0x2d97c8;_0x44e50f=0xc8;}else{_0x44e50f=0xce;}_0x14a4c9[_0x20cc('0x2d')](_0x44e50f);return _0x14a4c9[_0x20cc('0x31')](_0x20cc('0x32'),_0x41bb94+'-'+_0x1c604e+'/'+_0x2d97c8)[_0x20cc('0x33')](_0x5dd6c6);}return null;};}function patchUpdates(_0x44308c){return function(_0x39ffab){try{jsonpatch[_0x20cc('0x34')](_0x39ffab,_0x44308c,!![]);}catch(_0x14435d){return BPromise[_0x20cc('0x35')](_0x14435d);}return _0x39ffab[_0x20cc('0x36')]();};}function saveUpdates(_0x554698,_0x38f771){return function(_0x46d8d2){if(_0x46d8d2){return _0x46d8d2[_0x20cc('0x37')](_0x554698)['then'](function(_0x35c00c){return _0x35c00c;});}return null;};}function removeEntity(_0x5a7452,_0xcf26ce){return function(_0x5c1133){if(_0x5c1133){return _0x5c1133[_0x20cc('0x38')]()[_0x20cc('0x39')](function(){var _0x2faa67=_0x5c1133['get']({'plain':!![]});var _0x1f1f49=_0x20cc('0x3a');return db['UserProfileResource'][_0x20cc('0x38')]({'where':{'type':_0x1f1f49,'resourceId':_0x2faa67['id']}})[_0x20cc('0x39')](function(){return _0x5c1133;});})[_0x20cc('0x39')](function(){_0x5a7452['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x10bc04,_0x2e85e2){return function(_0x1908f1){if(!_0x1908f1){_0x10bc04[_0x20cc('0x2b')](0x194);}return _0x1908f1;};}function handleError(_0x58079b,_0x2ce23e){_0x2ce23e=_0x2ce23e||0x1f4;return function(_0x347e39){logger[_0x20cc('0x26')](_0x347e39[_0x20cc('0x3b')]);if(_0x347e39['name']){delete _0x347e39[_0x20cc('0x3c')];}_0x58079b[_0x20cc('0x2d')](_0x2ce23e)[_0x20cc('0x3d')](_0x347e39);};}exports[_0x20cc('0x3e')]=function(_0x67d45b,_0x5bfe15){var _0x393136={'include':[{'model':db['Pause'],'as':_0x20cc('0x3f')}]},_0x19f37b={},_0x3c094b={'count':0x0,'rows':[]};var _0x182fa0=_[_0x20cc('0x40')](db[_0x20cc('0x41')][_0x20cc('0x42')],function(_0xf7dd4f){return{'name':_0xf7dd4f[_0x20cc('0x43')],'type':_0xf7dd4f['type'][_0x20cc('0x44')]};});_0x19f37b[_0x20cc('0x45')]=_[_0x20cc('0x40')](_0x182fa0,_0x20cc('0x3c'));_0x19f37b[_0x20cc('0x46')]=_[_0x20cc('0x47')](_0x67d45b[_0x20cc('0x46')]);_0x19f37b[_0x20cc('0x48')]=_['intersection'](_0x19f37b[_0x20cc('0x45')],_0x19f37b['query']);_0x393136[_0x20cc('0x49')]=_[_0x20cc('0x4a')](_0x19f37b[_0x20cc('0x45')],qs[_0x20cc('0x4b')](_0x67d45b[_0x20cc('0x46')][_0x20cc('0x4b')]));_0x393136[_0x20cc('0x49')]=_0x393136[_0x20cc('0x49')]['length']?_0x393136[_0x20cc('0x49')]:_0x19f37b[_0x20cc('0x45')];if(!_0x67d45b['query']['hasOwnProperty'](_0x20cc('0x4c'))){_0x393136['limit']=qs[_0x20cc('0x30')](_0x67d45b[_0x20cc('0x46')]['limit']);_0x393136[_0x20cc('0x2f')]=qs[_0x20cc('0x2f')](_0x67d45b[_0x20cc('0x46')][_0x20cc('0x2f')]);}_0x393136[_0x20cc('0x4d')]=qs[_0x20cc('0x4e')](_0x67d45b[_0x20cc('0x46')]['sort']);_0x393136['where']=qs[_0x20cc('0x48')](_[_0x20cc('0x4f')](_0x67d45b[_0x20cc('0x46')],_0x19f37b[_0x20cc('0x48')]));if(_0x67d45b[_0x20cc('0x46')][_0x20cc('0x50')]){_0x393136[_0x20cc('0x51')]=_[_0x20cc('0x52')](_0x393136['where'],{'$or':_[_0x20cc('0x40')](_0x182fa0,function(_0x2bb79f){if(_0x2bb79f[_0x20cc('0x53')]!==_0x20cc('0x54')){var _0x58cbac={};_0x58cbac[_0x2bb79f['name']]={'$like':'%'+_0x67d45b['query'][_0x20cc('0x50')]+'%'};return _0x58cbac;}})});}_0x393136=_[_0x20cc('0x52')]({},_0x393136,_0x67d45b[_0x20cc('0x55')]);var _0x4a9e92={'where':_0x393136[_0x20cc('0x51')]};return db[_0x20cc('0x41')][_0x20cc('0x2e')](_0x4a9e92)[_0x20cc('0x39')](function(_0xec0bda){_0x3c094b['count']=_0xec0bda;if(_0x67d45b['query']['includeAll']){_0x393136['include']=[{'all':!![]}];}return db[_0x20cc('0x41')]['findAll'](_0x393136);})['then'](function(_0x3fdf0f){_0x3c094b[_0x20cc('0x56')]=_0x3fdf0f;return _0x3c094b;})['then'](respondWithFilteredResult(_0x5bfe15,_0x393136))[_0x20cc('0x2a')](handleError(_0x5bfe15,null));};exports[_0x20cc('0x57')]=function(_0x1956bc,_0x40dba8){var _0x5c71f8={'raw':![],'where':{'id':_0x1956bc['params']['id']},'include':[{'model':db[_0x20cc('0x58')],'as':_0x20cc('0x3f')}]},_0x316a58={};_0x316a58['model']=_['keys'](db[_0x20cc('0x41')][_0x20cc('0x42')]);_0x316a58[_0x20cc('0x46')]=_[_0x20cc('0x47')](_0x1956bc[_0x20cc('0x46')]);_0x316a58['filters']=_[_0x20cc('0x4a')](_0x316a58[_0x20cc('0x45')],_0x316a58[_0x20cc('0x46')]);_0x5c71f8[_0x20cc('0x49')]=_['intersection'](_0x316a58[_0x20cc('0x45')],qs[_0x20cc('0x4b')](_0x1956bc[_0x20cc('0x46')][_0x20cc('0x4b')]));_0x5c71f8[_0x20cc('0x49')]=_0x5c71f8[_0x20cc('0x49')][_0x20cc('0x59')]?_0x5c71f8[_0x20cc('0x49')]:_0x316a58[_0x20cc('0x45')];if(_0x1956bc['query'][_0x20cc('0x5a')]){_0x5c71f8[_0x20cc('0x5b')]=[{'all':!![]}];}_0x5c71f8=_[_0x20cc('0x52')]({},_0x5c71f8,_0x1956bc['options']);return db[_0x20cc('0x41')][_0x20cc('0x5c')](_0x5c71f8)[_0x20cc('0x39')](handleEntityNotFound(_0x40dba8,null))[_0x20cc('0x39')](respondWithResult(_0x40dba8,null))[_0x20cc('0x2a')](handleError(_0x40dba8,null));};exports['create']=function(_0x5acd34,_0x82d921){return db[_0x20cc('0x41')]['create'](_0x5acd34[_0x20cc('0x5d')],{})[_0x20cc('0x39')](function(_0x6ec94d){var _0xad65b5=_0x5acd34[_0x20cc('0x5e')][_0x20cc('0x5f')]({'plain':!![]});if(!_0xad65b5)throw new Error(_0x20cc('0x60'));if(_0xad65b5[_0x20cc('0x61')]===_0x20cc('0x5e')){var _0x4354cf=_0x6ec94d[_0x20cc('0x5f')]({'plain':!![]});var _0x147804='ChatWebsites';return db[_0x20cc('0x62')][_0x20cc('0x5c')]({'where':{'name':_0x147804,'userProfileId':_0xad65b5['userProfileId']},'raw':!![]})[_0x20cc('0x39')](function(_0x3ac2b6){if(_0x3ac2b6&&_0x3ac2b6['autoAssociation']===0x0){return db['UserProfileResource'][_0x20cc('0x63')]({'name':_0x4354cf[_0x20cc('0x3c')],'resourceId':_0x4354cf['id'],'type':_0x3ac2b6[_0x20cc('0x3c')],'sectionId':_0x3ac2b6['id']},{})[_0x20cc('0x39')](function(){return _0x6ec94d;});}else{return _0x6ec94d;}})[_0x20cc('0x2a')](function(_0xe5caff){logger[_0x20cc('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe5caff);throw _0xe5caff;});}return _0x6ec94d;})[_0x20cc('0x39')](respondWithResult(_0x82d921,0xc9))[_0x20cc('0x2a')](handleError(_0x82d921,null));};exports[_0x20cc('0x37')]=function(_0x3aa2a6,_0x2d5510){if(_0x3aa2a6[_0x20cc('0x5d')]['id']){delete _0x3aa2a6['body']['id'];}return db['ChatWebsite'][_0x20cc('0x5c')]({'where':{'id':_0x3aa2a6[_0x20cc('0x64')]['id']},'include':[{'model':db[_0x20cc('0x58')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x2d5510,null))[_0x20cc('0x39')](saveUpdates(_0x3aa2a6[_0x20cc('0x5d')],null))[_0x20cc('0x39')](respondWithResult(_0x2d5510,null))['catch'](handleError(_0x2d5510,null));};exports[_0x20cc('0x38')]=function(_0x1fe1ea,_0x357676){return db[_0x20cc('0x41')][_0x20cc('0x5c')]({'where':{'id':_0x1fe1ea[_0x20cc('0x64')]['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x357676,null))[_0x20cc('0x39')](removeEntity(_0x357676,null))[_0x20cc('0x2a')](handleError(_0x357676,null));};exports[_0x20cc('0x65')]=function(_0x27f3ee,_0x3fb88a){return db[_0x20cc('0x41')]['describe']()[_0x20cc('0x39')](respondWithResult(_0x3fb88a,null))[_0x20cc('0x2a')](handleError(_0x3fb88a,null));};exports[_0x20cc('0x66')]=function(_0x223af2,_0x4e8222,_0x6b7e34){if(_0x223af2['body']['id']){delete _0x223af2[_0x20cc('0x5d')]['id'];}return db['ChatWebsite'][_0x20cc('0x5c')]({'where':{'id':_0x223af2[_0x20cc('0x64')]['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x4e8222,null))[_0x20cc('0x39')](function(_0x499af9){if(_0x499af9){_0x223af2[_0x20cc('0x5d')][_0x20cc('0x67')]=_0x499af9['id'];return db[_0x20cc('0x68')][_0x20cc('0x63')](_0x223af2[_0x20cc('0x5d')]);}})['then'](respondWithResult(_0x4e8222,null))['catch'](handleError(_0x4e8222,null));};exports['getDispositions']=function(_0x45e8ea,_0x543dd8,_0x53ce68){var _0x564a32={'raw':![],'where':{}};var _0x12d6d5={};var _0x57933e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x20cc('0x69')]({'where':{'id':_0x45e8ea[_0x20cc('0x64')]['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x543dd8,null))[_0x20cc('0x39')](function(_0x4784df){if(_0x4784df){_0x12d6d5['model']=_[_0x20cc('0x47')](db[_0x20cc('0x68')][_0x20cc('0x42')]);_0x12d6d5['query']=_[_0x20cc('0x47')](_0x45e8ea[_0x20cc('0x46')]);_0x12d6d5[_0x20cc('0x48')]=_['intersection'](_0x12d6d5[_0x20cc('0x45')],_0x12d6d5[_0x20cc('0x46')]);_0x564a32[_0x20cc('0x49')]=_[_0x20cc('0x4a')](_0x12d6d5[_0x20cc('0x45')],qs[_0x20cc('0x4b')](_0x45e8ea[_0x20cc('0x46')]['fields']));_0x564a32[_0x20cc('0x49')]=_0x564a32['attributes'][_0x20cc('0x59')]?_0x564a32[_0x20cc('0x49')]:_0x12d6d5['model'];if(!_0x45e8ea[_0x20cc('0x46')][_0x20cc('0x6a')](_0x20cc('0x4c'))){_0x564a32[_0x20cc('0x30')]=qs[_0x20cc('0x30')](_0x45e8ea['query']['limit']);_0x564a32[_0x20cc('0x2f')]=qs['offset'](_0x45e8ea[_0x20cc('0x46')][_0x20cc('0x2f')]);}_0x564a32[_0x20cc('0x4d')]=qs[_0x20cc('0x4e')](_0x45e8ea['query']['sort']);_0x564a32[_0x20cc('0x51')]=qs[_0x20cc('0x48')](_[_0x20cc('0x4f')](_0x45e8ea[_0x20cc('0x46')],_0x12d6d5[_0x20cc('0x48')]));_0x564a32[_0x20cc('0x51')][_0x20cc('0x67')]=_0x4784df['id'];if(_0x45e8ea[_0x20cc('0x46')]['filter']){_0x564a32['where']=_[_0x20cc('0x52')](_0x564a32[_0x20cc('0x51')],{'$or':_[_0x20cc('0x40')](_0x564a32[_0x20cc('0x49')],function(_0x3dbb83){var _0x3291a3={};_0x3291a3[_0x3dbb83]={'$like':'%'+_0x45e8ea[_0x20cc('0x46')][_0x20cc('0x50')]+'%'};return _0x3291a3;})});}_0x564a32=_[_0x20cc('0x52')]({},_0x564a32,_0x45e8ea[_0x20cc('0x55')]);return db['Disposition'][_0x20cc('0x2e')]({'where':_0x564a32[_0x20cc('0x51')]})[_0x20cc('0x39')](function(_0x3a4eca){_0x57933e['count']=_0x3a4eca;if(_0x45e8ea[_0x20cc('0x46')][_0x20cc('0x5a')]){_0x564a32[_0x20cc('0x5b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x564a32);})[_0x20cc('0x39')](function(_0x5a18cb){_0x57933e[_0x20cc('0x56')]=_0x5a18cb;return _0x57933e;});}})[_0x20cc('0x39')](respondWithFilteredResult(_0x543dd8,_0x564a32))[_0x20cc('0x2a')](handleError(_0x543dd8,null));};exports['removeDispositions']=function(_0x4bc658,_0x143a75,_0x55809e){return db['ChatWebsite'][_0x20cc('0x5c')]({'where':{'id':_0x4bc658['params']['id']}})['then'](handleEntityNotFound(_0x143a75,null))[_0x20cc('0x39')](function(_0x527400){if(_0x527400){return _0x527400[_0x20cc('0x6b')](_0x4bc658[_0x20cc('0x46')]['ids']);}})[_0x20cc('0x39')](respondWithStatusCode(_0x143a75,null))[_0x20cc('0x2a')](handleError(_0x143a75,null));};exports[_0x20cc('0x6c')]=function(_0x291198,_0xa16463,_0x251a4a){if(_0x291198[_0x20cc('0x5d')]['id']){delete _0x291198[_0x20cc('0x5d')]['id'];}return db[_0x20cc('0x41')]['find']({'where':{'id':_0x291198[_0x20cc('0x64')]['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0xa16463,null))['then'](function(_0x3b408b){if(_0x3b408b){_0x291198[_0x20cc('0x5d')][_0x20cc('0x67')]=_0x3b408b['id'];return db['CannedAnswer'][_0x20cc('0x63')](_0x291198['body']);}})['then'](respondWithResult(_0xa16463,null))['catch'](handleError(_0xa16463,null));};exports[_0x20cc('0x6d')]=function(_0x32ba5a,_0x1fa110,_0x43bc0e){var _0x4662c7={'raw':![],'where':{}};var _0x5c1acc={};var _0x32c859={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x32ba5a[_0x20cc('0x64')]['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x1fa110,null))['then'](function(_0x27e9c7){if(_0x27e9c7){_0x5c1acc[_0x20cc('0x45')]=_['keys'](db[_0x20cc('0x6e')]['rawAttributes']);_0x5c1acc[_0x20cc('0x46')]=_['keys'](_0x32ba5a['query']);_0x5c1acc[_0x20cc('0x48')]=_['intersection'](_0x5c1acc[_0x20cc('0x45')],_0x5c1acc[_0x20cc('0x46')]);_0x4662c7[_0x20cc('0x49')]=_[_0x20cc('0x4a')](_0x5c1acc[_0x20cc('0x45')],qs['fields'](_0x32ba5a[_0x20cc('0x46')][_0x20cc('0x4b')]));_0x4662c7[_0x20cc('0x49')]=_0x4662c7[_0x20cc('0x49')]['length']?_0x4662c7[_0x20cc('0x49')]:_0x5c1acc[_0x20cc('0x45')];if(!_0x32ba5a[_0x20cc('0x46')][_0x20cc('0x6a')]('nolimit')){_0x4662c7[_0x20cc('0x30')]=qs['limit'](_0x32ba5a[_0x20cc('0x46')][_0x20cc('0x30')]);_0x4662c7[_0x20cc('0x2f')]=qs['offset'](_0x32ba5a[_0x20cc('0x46')][_0x20cc('0x2f')]);}_0x4662c7[_0x20cc('0x4d')]=qs[_0x20cc('0x4e')](_0x32ba5a[_0x20cc('0x46')][_0x20cc('0x4e')]);_0x4662c7[_0x20cc('0x51')]=qs[_0x20cc('0x48')](_[_0x20cc('0x4f')](_0x32ba5a[_0x20cc('0x46')],_0x5c1acc[_0x20cc('0x48')]));_0x4662c7[_0x20cc('0x51')][_0x20cc('0x67')]=_0x27e9c7['id'];if(_0x32ba5a['query'][_0x20cc('0x50')]){_0x4662c7[_0x20cc('0x51')]=_[_0x20cc('0x52')](_0x4662c7['where'],{'$or':_[_0x20cc('0x40')](_0x4662c7[_0x20cc('0x49')],function(_0x3c4710){var _0x284ca9={};_0x284ca9[_0x3c4710]={'$like':'%'+_0x32ba5a[_0x20cc('0x46')]['filter']+'%'};return _0x284ca9;})});}_0x4662c7=_[_0x20cc('0x52')]({},_0x4662c7,_0x32ba5a['options']);return db[_0x20cc('0x6e')][_0x20cc('0x2e')]({'where':_0x4662c7[_0x20cc('0x51')]})[_0x20cc('0x39')](function(_0x5415f4){_0x32c859[_0x20cc('0x2e')]=_0x5415f4;if(_0x32ba5a[_0x20cc('0x46')][_0x20cc('0x5a')]){_0x4662c7['include']=[{'all':!![]}];}return db[_0x20cc('0x6e')][_0x20cc('0x6f')](_0x4662c7);})['then'](function(_0x2692af){_0x32c859[_0x20cc('0x56')]=_0x2692af;return _0x32c859;});}})[_0x20cc('0x39')](respondWithFilteredResult(_0x1fa110,_0x4662c7))[_0x20cc('0x2a')](handleError(_0x1fa110,null));};exports[_0x20cc('0x70')]=function(_0x5798b7,_0x20335f,_0x3939e3){return db['ChatWebsite']['find']({'where':{'id':_0x5798b7[_0x20cc('0x64')]['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x20335f,null))[_0x20cc('0x39')](function(_0x52d673){if(_0x52d673){return _0x52d673['removeAnswers'](_0x5798b7['query']['ids']);}})[_0x20cc('0x39')](respondWithStatusCode(_0x20335f,null))[_0x20cc('0x2a')](handleError(_0x20335f,null));};exports['addLogo']=function(_0x56b09d,_0x5a9ab5,_0x566a4f){_0x56b09d['body']['sitepic']=_0x56b09d['file'][_0x20cc('0x71')];return db[_0x20cc('0x41')][_0x20cc('0x5c')]({'where':{'id':_0x56b09d[_0x20cc('0x64')]['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x5a9ab5,null))[_0x20cc('0x39')](saveUpdates(_0x56b09d[_0x20cc('0x5d')],null))[_0x20cc('0x39')](respondWithResult(_0x5a9ab5,null))[_0x20cc('0x2a')](handleError(_0x5a9ab5,null));};exports[_0x20cc('0x72')]=function(_0x220c2a,_0x3338d8,_0x4dff1b){_0x220c2a[_0x20cc('0x5d')]['agentAvatar']=_0x220c2a[_0x20cc('0x73')][_0x20cc('0x71')];return db[_0x20cc('0x41')][_0x20cc('0x5c')]({'where':{'id':_0x220c2a[_0x20cc('0x64')]['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x3338d8,null))[_0x20cc('0x39')](saveUpdates(_0x220c2a[_0x20cc('0x5d')],null))[_0x20cc('0x39')](respondWithResult(_0x3338d8,null))['catch'](handleError(_0x3338d8,null));};exports[_0x20cc('0x74')]=function(_0x372c87,_0x1a2f9b,_0x4f517d){_0x372c87[_0x20cc('0x5d')]['customerAvatar']=_0x372c87[_0x20cc('0x73')][_0x20cc('0x71')];return db[_0x20cc('0x41')][_0x20cc('0x5c')]({'where':{'id':_0x372c87['params']['id']}})['then'](handleEntityNotFound(_0x1a2f9b,null))['then'](saveUpdates(_0x372c87['body'],null))[_0x20cc('0x39')](respondWithResult(_0x1a2f9b,null))[_0x20cc('0x2a')](handleError(_0x1a2f9b,null));};exports['addSystemAvatar']=function(_0x550743,_0x48e526,_0x23db37){_0x550743[_0x20cc('0x5d')][_0x20cc('0x75')]=_0x550743[_0x20cc('0x73')][_0x20cc('0x71')];return db['ChatWebsite']['find']({'where':{'id':_0x550743[_0x20cc('0x64')]['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x48e526,null))['then'](saveUpdates(_0x550743[_0x20cc('0x5d')],null))[_0x20cc('0x39')](respondWithResult(_0x48e526,null))[_0x20cc('0x2a')](handleError(_0x48e526,null));};exports[_0x20cc('0x76')]=function(_0xa70af,_0x3a4ab8,_0x2c6d36){var _0x342ce0=path['join'](config[_0x20cc('0x77')],_0x20cc('0x78'));var _0x23c050={'where':{'id':_0xa70af['params']['id']},'attributes':['id',_0x20cc('0x79')],'raw':!![]};var _0x34aadb=![];return require(_0x20cc('0x7a'))[_0x20cc('0x7b')]()[_0x20cc('0x39')](function(_0x2d447f){if(_0x2d447f){_0x34aadb=_0x2d447f[_0x20cc('0x7c')];}})[_0x20cc('0x39')](function(){return db[_0x20cc('0x41')][_0x20cc('0x5c')](_0x23c050);})[_0x20cc('0x39')](handleEntityNotFound(_0x3a4ab8,null))['then'](function(_0x2a34bd){if(_0x2a34bd){if(!_['isNil'](_0x2a34bd[_0x20cc('0x79')])){if(fs[_0x20cc('0x7d')](path[_0x20cc('0x7e')](config['root'],_0x20cc('0x7f'),_0x2a34bd[_0x20cc('0x79')]))&&_0x34aadb){_0x342ce0=path['join'](config[_0x20cc('0x77')],_0x20cc('0x7f'),_0x2a34bd[_0x20cc('0x79')]);}}return _0x3a4ab8[_0x20cc('0x80')](_0x342ce0);}})[_0x20cc('0x2a')](handleError(_0x3a4ab8,null));};exports[_0x20cc('0x81')]=function(_0x5cd2c7,_0x334981,_0x4e1688){var _0x45c26c=path[_0x20cc('0x7e')](config[_0x20cc('0x77')],_0x20cc('0x82'));var _0x4c0814={'where':{'id':_0x5cd2c7[_0x20cc('0x64')]['id']},'attributes':['id',_0x20cc('0x83')],'raw':!![]};return db[_0x20cc('0x41')][_0x20cc('0x5c')](_0x4c0814)[_0x20cc('0x39')](handleEntityNotFound(_0x334981,null))[_0x20cc('0x39')](function(_0x4d7ced){if(_0x4d7ced){if(!_[_0x20cc('0x84')](_0x4d7ced['agentAvatar'])){if(fs['existsSync'](path['join'](config['root'],'server/files/images/avatars/',_0x4d7ced['agentAvatar']))){_0x45c26c=path[_0x20cc('0x7e')](config[_0x20cc('0x77')],'server/files/images/avatars/',_0x4d7ced[_0x20cc('0x83')]);}}return _0x334981['download'](_0x45c26c);}})['catch'](handleError(_0x334981,null));};exports[_0x20cc('0x85')]=function(_0xa86686,_0x2f09c5,_0x342be3){var _0x536efc=path[_0x20cc('0x7e')](config[_0x20cc('0x77')],_0x20cc('0x86'));var _0x55bd25={'where':{'id':_0xa86686[_0x20cc('0x64')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x20cc('0x41')][_0x20cc('0x5c')](_0x55bd25)[_0x20cc('0x39')](handleEntityNotFound(_0x2f09c5,null))[_0x20cc('0x39')](function(_0x5e2da3){if(_0x5e2da3){if(!_[_0x20cc('0x84')](_0x5e2da3[_0x20cc('0x87')])){if(fs[_0x20cc('0x7d')](path[_0x20cc('0x7e')](config[_0x20cc('0x77')],_0x20cc('0x88'),_0x5e2da3[_0x20cc('0x87')]))&&_0x5e2da3['showCustomerAvatar']){_0x536efc=path[_0x20cc('0x7e')](config[_0x20cc('0x77')],_0x20cc('0x88'),_0x5e2da3[_0x20cc('0x87')]);}}return _0x2f09c5[_0x20cc('0x80')](_0x536efc);}})['catch'](handleError(_0x2f09c5,null));};exports['getSystemAvatar']=function(_0x1bdf12,_0x2f0147,_0x3443fe){var _0x5e9873=path[_0x20cc('0x7e')](config[_0x20cc('0x77')],_0x20cc('0x89'));var _0x161ff0={'where':{'id':_0x1bdf12[_0x20cc('0x64')]['id']},'attributes':['id',_0x20cc('0x75')],'raw':!![]};return db['ChatWebsite'][_0x20cc('0x5c')](_0x161ff0)[_0x20cc('0x39')](handleEntityNotFound(_0x2f0147,null))['then'](function(_0x48a540){if(_0x48a540){if(!_[_0x20cc('0x84')](_0x48a540['systemAvatar'])){if(fs['existsSync'](path[_0x20cc('0x7e')](config[_0x20cc('0x77')],_0x20cc('0x88'),_0x48a540['systemAvatar']))){_0x5e9873=path['join'](config[_0x20cc('0x77')],_0x20cc('0x88'),_0x48a540[_0x20cc('0x75')]);}}return _0x2f0147[_0x20cc('0x80')](_0x5e9873);}})[_0x20cc('0x2a')](handleError(_0x2f0147,null));};exports[_0x20cc('0x8a')]=function(_0x43e7e2,_0x23538b,_0x3c4d1d){var _0x4dbdc4=require(_0x20cc('0x8b'));var _0x10e389=new _0x4dbdc4();var _0x5edfb7=_0x10e389[_0x20cc('0x8c')](_0x43e7e2[_0x20cc('0x8d')][_0x20cc('0x8e')])[_0x20cc('0x8f')]();var _0x183fdf={'body':_0x43e7e2['body'],'channel':_0x20cc('0x90')};var _0x1206b1=[];var _0x36aa1a=[];var _0x10255b={};var _0x2b387f=![];return db['CmContact'][_0x20cc('0x65')]()[_0x20cc('0x39')](function(_0x8bae2a){if(!_0x8bae2a){throw new db[(_0x20cc('0x1f'))][(_0x20cc('0x20'))](_0x20cc('0x91'));}_0x1206b1=_['difference'](_[_0x20cc('0x47')](_0x8bae2a),['createdAt',_0x20cc('0x92')]);_0x36aa1a=_[_0x20cc('0x93')](_[_0x20cc('0x47')](_0x8bae2a),[_0x20cc('0x94'),'updatedAt','CompanyId',_0x20cc('0x95')]);if(_0x43e7e2[_0x20cc('0x5d')]['id']){delete _0x43e7e2['body']['id'];}if(_[_0x20cc('0x84')](_0x43e7e2[_0x20cc('0x5d')][_0x20cc('0x96')])){throw new db[(_0x20cc('0x1f'))][(_0x20cc('0x20'))](_0x20cc('0x97'));}if(_[_0x20cc('0x84')](_0x43e7e2[_0x20cc('0x5d')]['body'])||_0x43e7e2[_0x20cc('0x5d')]['body']===''){throw new db[(_0x20cc('0x1f'))][(_0x20cc('0x20'))](_0x20cc('0x98'));}if(_[_0x20cc('0x84')](_0x43e7e2['body'][_0x20cc('0x99')])){throw new db[(_0x20cc('0x1f'))][(_0x20cc('0x20'))](_0x20cc('0x9a')+_0x36aa1a);}if(!_['includes'](_0x36aa1a,_0x43e7e2[_0x20cc('0x5d')][_0x20cc('0x99')])){throw new db[(_0x20cc('0x1f'))][(_0x20cc('0x20'))](_0x20cc('0x9b')+_0x36aa1a);}_0x10255b[_0x43e7e2[_0x20cc('0x5d')][_0x20cc('0x99')]]=_0x43e7e2['body'][_0x20cc('0x96')];})['then'](function(){return db[_0x20cc('0x41')][_0x20cc('0x5c')]({'where':{'id':_0x43e7e2['params']['id']},'include':[{'model':db['CmList'],'as':_0x20cc('0x9c'),'include':[{'model':db[_0x20cc('0x9d')],'as':'Contacts','where':_0x10255b,'limit':0x1,'order':[[_0x20cc('0x92'),_0x20cc('0x9e')]]}]},{'model':db[_0x20cc('0x9f')],'as':_0x20cc('0xa0')}]});})[_0x20cc('0x39')](handleEntityNotFound(_0x23538b,null))[_0x20cc('0x39')](function(_0x39f72b){if(_0x39f72b&&_0x39f72b[_0x20cc('0x9c')]){_0x183fdf['account']=_0x39f72b;_0x183fdf['applications']=_0x39f72b['Applications'];_0x183fdf[_0x20cc('0xa1')]=_0x39f72b[_0x20cc('0x9c')];_0x183fdf[_0x20cc('0xa2')]=_[_0x20cc('0xa3')](_0x183fdf['applications'],[_0x20cc('0xa4')],[_0x20cc('0xa5')]);if(_0x183fdf[_0x20cc('0xa6')][_0x20cc('0xa0')]){delete _0x183fdf[_0x20cc('0xa6')][_0x20cc('0xa0')];}if(_0x183fdf[_0x20cc('0xa6')]['List']&&_0x183fdf[_0x20cc('0xa6')][_0x20cc('0x9c')][_0x20cc('0xa7')][_0x20cc('0x59')]){return _0x183fdf[_0x20cc('0xa6')]['List'][_0x20cc('0xa7')][0x0];}var _0x3ee1b8=_['defaults'](_0x43e7e2['body'],{'firstName':_0x43e7e2[_0x20cc('0x5d')][_0x20cc('0x96')],'ListId':_0x39f72b['ListId']});_0x3ee1b8[_0x43e7e2[_0x20cc('0x5d')][_0x20cc('0x99')]]=_0x43e7e2[_0x20cc('0x5d')][_0x20cc('0x96')];return db[_0x20cc('0x9d')]['create'](_0x3ee1b8,{'fields':_0x1206b1,'raw':!![]});}})[_0x20cc('0x39')](handleEntityNotFound(_0x23538b,null))[_0x20cc('0x39')](function(_0x4da355){_0x183fdf['contact']=_0x4da355;var _0x363262=_0x43e7e2[_0x20cc('0x5d')]['customerIp'];if(_0x43e7e2[_0x20cc('0x8d')][_0x20cc('0xa8')]){_0x363262=_0x43e7e2[_0x20cc('0x8d')][_0x20cc('0xa8')];}else if(_0x43e7e2[_0x20cc('0x8d')][_0x20cc('0xa9')]){_0x363262=_[_0x20cc('0xaa')](_0x43e7e2[_0x20cc('0x8d')]['x-forwarded-for'][_0x20cc('0xab')](','));}if(_0x4da355){var _0x38ed34={'ContactId':_0x4da355['id'],'ChatWebsiteId':_0x43e7e2['params']['id'],'from':(_0x4da355[_0x20cc('0xac')]||'')+'\x20'+(_0x4da355[_0x20cc('0xad')]||''),'customerIp':_0x363262,'customerPort':_0x43e7e2[_0x20cc('0x8d')][_0x20cc('0xae')]?_0x43e7e2[_0x20cc('0x8d')][_0x20cc('0xae')]:null,'referer':_0x43e7e2[_0x20cc('0x5d')][_0x20cc('0xaf')],'browserName':_0x5edfb7[_0x20cc('0xb0')]['name']&&_0x5edfb7[_0x20cc('0xb0')][_0x20cc('0xb1')]?util['format'](_0x20cc('0xb2'),_0x5edfb7['browser']['name'],_0x5edfb7[_0x20cc('0xb0')][_0x20cc('0xb1')]):'unknown','browserVersion':_0x5edfb7['browser']['version']||_0x20cc('0xb3'),'osName':util[_0x20cc('0xb4')](_0x20cc('0xb2'),_0x5edfb7['os'][_0x20cc('0x3c')],_0x5edfb7['os']['version']),'osVersion':_0x5edfb7['os'][_0x20cc('0xb1')],'deviceModel':_0x5edfb7[_0x20cc('0xb5')][_0x20cc('0x45')]&&_0x5edfb7[_0x20cc('0xb5')][_0x20cc('0xb6')]?util[_0x20cc('0xb4')](_0x20cc('0xb7'),_0x5edfb7[_0x20cc('0xb5')][_0x20cc('0x45')],_0x5edfb7['device'][_0x20cc('0xb6')],_0x5edfb7[_0x20cc('0xb5')][_0x20cc('0x53')]):null,'deviceVendor':_0x5edfb7[_0x20cc('0xb5')][_0x20cc('0xb6')],'deviceType':_0x5edfb7[_0x20cc('0xb5')][_0x20cc('0x53')],'formData':JSON[_0x20cc('0xb8')](_0x43e7e2[_0x20cc('0x5d')])};var _0x4f9d7c={'ChatWebsiteId':_0x43e7e2[_0x20cc('0x64')]['id'],'closed':![]};if(_0x43e7e2['body']['threadId']){_0x4f9d7c[_0x20cc('0xb9')]=_0x43e7e2[_0x20cc('0x5d')][_0x20cc('0xb9')];return db[_0x20cc('0xba')][_0x20cc('0x5c')]({'where':_0x4f9d7c})[_0x20cc('0x39')](function(_0x2c0af2){if(_0x2c0af2){return[_0x2c0af2,![]];}_0x38ed34[_0x20cc('0xb9')]=_0x43e7e2[_0x20cc('0x5d')][_0x20cc('0xb9')];_0x38ed34[_0x20cc('0xbb')]=_0x43e7e2[_0x20cc('0x5d')][_0x20cc('0xbb')];return db['ChatInteraction'][_0x20cc('0x63')](_0x38ed34)[_0x20cc('0x39')](function(_0x5ca904){return[_0x5ca904,!![]];});});}_0x4f9d7c[_0x20cc('0xbc')]=_0x4da355['id'];if(_0x43e7e2[_0x20cc('0x5d')]['interaction']&&_0x43e7e2[_0x20cc('0x5d')][_0x20cc('0xbd')]['id']){_0x4f9d7c['id']=_0x43e7e2[_0x20cc('0x5d')][_0x20cc('0xbd')]['id'];return db[_0x20cc('0xba')][_0x20cc('0x5c')]({'where':_0x4f9d7c})[_0x20cc('0x39')](function(_0x7c8ca1){if(_0x7c8ca1){return[_0x7c8ca1,![]];}return db[_0x20cc('0xba')][_0x20cc('0x63')](_0x38ed34)[_0x20cc('0x39')](function(_0x3492fe){return[_0x3492fe,!![]];});});}return db[_0x20cc('0xba')][_0x20cc('0x63')](_0x38ed34)[_0x20cc('0x39')](function(_0x2596ac){return[_0x2596ac,!![]];});}})[_0x20cc('0xbe')](function(_0x49e3ae,_0x38961e){if(_0x49e3ae){_0x2b387f=_0x38961e;if(!_0x38961e){var _0xae4a93={'from':(_0x183fdf[_0x20cc('0xbf')][_0x20cc('0xac')]||'')+'\x20'+(_0x183fdf[_0x20cc('0xbf')]['lastName']||'')};if(_0x43e7e2[_0x20cc('0x5d')][_0x20cc('0xb9')]&&_0x43e7e2['body'][_0x20cc('0xc0')]&&_0x43e7e2[_0x20cc('0x5d')]['threadId']!=_0x43e7e2[_0x20cc('0x5d')]['messageId']){_0xae4a93['threadId']=_0x43e7e2['body'][_0x20cc('0xc0')];}return _0x49e3ae[_0x20cc('0x37')](_0xae4a93);}else{return _0x49e3ae;}}})[_0x20cc('0x39')](function(_0x291774){_0x183fdf['interaction']=_0x291774[_0x20cc('0x5f')]({'plain':!![]});_0x183fdf[_0x20cc('0xbd')][_0x20cc('0xc1')]=_0x2b387f;if(_0x183fdf[_0x20cc('0xbd')][_0x20cc('0xc1')]){if(_0x183fdf[_0x20cc('0xa6')][_0x20cc('0xc2')]){_0x183fdf[_0x20cc('0xa2')]['push']({'id':0x0,'priority':_0x183fdf[_0x20cc('0xa2')]['length']+0x1,'app':_0x20cc('0xc3'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x20cc('0xc4')][_0x20cc('0x63')]({'body':_0x43e7e2['body'][_0x20cc('0x5d')],'ChatWebsiteId':_0x43e7e2[_0x20cc('0x64')]['id'],'ChatInteractionId':_0x291774['id'],'direction':'in','ContactId':_0x183fdf[_0x20cc('0xbf')]['id'],'AttachmentId':_0x43e7e2[_0x20cc('0x5d')][_0x20cc('0xc5')]});})['then'](function(_0x131973){_0x183fdf[_0x20cc('0x28')]=_0x131973;if(_0x183fdf[_0x20cc('0xbd')][_0x20cc('0xc6')]){return db[_0x20cc('0xc7')][_0x20cc('0x5c')]({'attributes':['id',_0x20cc('0x3c')],'where':{'id':_0x183fdf[_0x20cc('0xbd')][_0x20cc('0xc6')]}})[_0x20cc('0x39')](function(_0x16562a){if(_0x16562a){_0x183fdf[_0x20cc('0xa2')][_0x20cc('0xc8')]({'id':0x0,'priority':0x0,'app':_0x20cc('0xc9'),'appdata':_0x16562a['name']+','+(_0x183fdf[_0x20cc('0xa6')][_0x20cc('0xca')]||0xa),'interval':_0x20cc('0xcb')});_0x183fdf[_0x20cc('0xcc')]=!![];}return respondWithRpcPromise(_0x20cc('0xcd'),_0x20cc('0xce'),_0x183fdf);});}return respondWithRpcPromise('Start',_0x20cc('0xce'),_0x183fdf);})['then'](function(_0x533e02){respondWithRpcPromise(_0x20cc('0xcf'),_0x20cc('0xcf'),{'event':_0x20cc('0x8a'),'message':_0x533e02},client9002);return _0x533e02;})['then'](respondWithResult(_0x23538b,null))[_0x20cc('0x2a')](handleError(_0x23538b,null));};exports[_0x20cc('0xd0')]=function(_0x1f29b3,_0x4ceda9,_0x421d66){var _0x59e427,_0x279d92,_0x5cd8f4;var _0xf5d8e0=[];var _0x3e2967=[];var _0x149bd8={};return db[_0x20cc('0x9d')]['describe']()['then'](function(_0x5ab0ee){if(!_0x5ab0ee){throw new db[(_0x20cc('0x1f'))]['ValidationError']('no\x20available\x20attributes');}_0x3e2967=_[_0x20cc('0x93')](_['keys'](_0x5ab0ee),['createdAt','updatedAt']);_0xf5d8e0=_[_0x20cc('0x93')](_[_0x20cc('0x47')](_0x5ab0ee),[_0x20cc('0x94'),_0x20cc('0x92'),'CompanyId',_0x20cc('0x95')]);if(_0x1f29b3[_0x20cc('0x5d')]['id']){delete _0x1f29b3[_0x20cc('0x5d')]['id'];}if(_['isNil'](_0x1f29b3[_0x20cc('0x5d')][_0x20cc('0x96')])){throw _0x4ceda9[_0x20cc('0x2d')](0x1f4)[_0x20cc('0x3d')](new db['Sequelize'][(_0x20cc('0x20'))](_0x20cc('0x97')));}if(_['isNil'](_0x1f29b3['body'][_0x20cc('0x5d')])||_0x1f29b3['body'][_0x20cc('0x5d')]===''){throw _0x4ceda9[_0x20cc('0x2d')](0x1f4)[_0x20cc('0x3d')](new db[(_0x20cc('0x1f'))][(_0x20cc('0x20'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x20cc('0x84')](_0x1f29b3[_0x20cc('0x5d')][_0x20cc('0xd1')])){throw _0x4ceda9['status'](0x1f4)[_0x20cc('0x3d')](new db['Sequelize']['ValidationError'](_0x20cc('0xd2')+_0xf5d8e0));}if(!_[_0x20cc('0xd3')](_0xf5d8e0,_0x1f29b3[_0x20cc('0x5d')][_0x20cc('0xd1')])){throw _0x4ceda9[_0x20cc('0x2d')](0x1f4)['send'](new db[(_0x20cc('0x1f'))][(_0x20cc('0x20'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xf5d8e0));}_0x149bd8[_0x1f29b3[_0x20cc('0x5d')]['mapKeyOffline']]=_0x1f29b3[_0x20cc('0x5d')][_0x20cc('0x96')];})['then'](function(){return db[_0x20cc('0x41')][_0x20cc('0x5c')]({'where':{'id':_0x1f29b3[_0x20cc('0x64')]['id']},'include':[{'model':db[_0x20cc('0xd4')],'as':_0x20cc('0x9c')}]});})[_0x20cc('0x39')](handleEntityNotFound(_0x4ceda9,null))[_0x20cc('0x39')](function(_0x5b885c){if(_0x5b885c&&_0x5b885c[_0x20cc('0x9c')]){_0x279d92=_0x5b885c;var _0x48ca4b=_[_0x20cc('0xd5')](_0x1f29b3['body'],{'firstName':_0x1f29b3['body']['from'],'phone':_0x1f29b3[_0x20cc('0x5d')]['from'],'ListId':_0x5b885c[_0x20cc('0x95')]});_0x48ca4b[_0x1f29b3[_0x20cc('0x5d')][_0x20cc('0xd1')]]=_0x1f29b3['body'][_0x20cc('0x96')];return db[_0x20cc('0x9d')]['findOrCreate']({'where':_0x149bd8,'defaults':_0x48ca4b});}})[_0x20cc('0xbe')](function(_0x3b1c62){if(_0x3b1c62){_0x5cd8f4=_0x3b1c62;var _0x45015f=fs[_0x20cc('0xd6')](path[_0x20cc('0x7e')](config[_0x20cc('0x77')],_0x20cc('0xd7')),'utf8');var _0x4b66f2=ejs[_0x20cc('0xd8')](_0x45015f,{'body':_[_0x20cc('0xd9')](_0x1f29b3[_0x20cc('0x5d')][_0x20cc('0x5d')]),'bodyTitle':_0x279d92[_0x20cc('0xda')]});return db[_0x20cc('0xdb')][_0x20cc('0x63')]({'body':_0x4b66f2,'ContactId':_0x3b1c62['id'],'ChatWebsiteId':_0x279d92['id']});}})[_0x20cc('0x39')](function(_0x2f1b9d){if(_0x2f1b9d){_0x59e427=_0x2f1b9d;return db[_0x20cc('0xdc')][_0x20cc('0x69')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x20cc('0xdd'),'raw':!![]}]});}})[_0x20cc('0x39')](function(_0x2f27db){if(_0x2f27db&&_0x2f27db[_0x20cc('0xdd')]&&_0x279d92[_0x20cc('0xde')]){var _0x4b3606={'tls':{'rejectUnauthorized':![]}};if(_0x2f27db[_0x20cc('0xdd')][_0x20cc('0xdf')]){_0x4b3606['service']=_0x2f27db[_0x20cc('0xdd')]['service'];}else{_0x4b3606['host']=_0x2f27db[_0x20cc('0xdd')]['host'];_0x4b3606['port']=_0x2f27db[_0x20cc('0xdd')][_0x20cc('0xe0')];_0x4b3606['secure']=_0x2f27db['Smtp'][_0x20cc('0xe1')];}if(_0x2f27db['Smtp'][_0x20cc('0xe2')]){_0x4b3606[_0x20cc('0xe3')]={'user':_0x2f27db['Smtp'][_0x20cc('0x5e')],'pass':_0x2f27db[_0x20cc('0xdd')][_0x20cc('0xe4')]};}return respondWithRpcPromise('SendMail',_0x20cc('0xe5'),{'account':_0x4b3606,'message':{'from':util[_0x20cc('0xb4')]('\x22%s\x22\x20<%s>',_0x2f27db['name'],_0x2f27db[_0x20cc('0xe6')]||_0x2f27db[_0x20cc('0xdd')][_0x20cc('0x5e')]),'to':_0x279d92[_0x20cc('0xde')],'subject':_0x279d92[_0x20cc('0xe7')],'text':_0x59e427[_0x20cc('0x5d')]}},client9003)[_0x20cc('0x39')](function(){return _0x59e427;})['catch'](function(_0x17c181){console['error'](_0x17c181);});}})[_0x20cc('0x39')](function(){if(_0x59e427){return _0x59e427;}})[_0x20cc('0x39')](respondWithResult(_0x4ceda9,null))[_0x20cc('0x2a')](handleError(_0x4ceda9,null));};exports[_0x20cc('0xe8')]=function(_0x525401,_0x173cfe,_0x138cf8){return db[_0x20cc('0xba')]['find']({'where':{'id':_0x525401[_0x20cc('0x64')]['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x173cfe,null))['then'](function(_0x1eab12){if(_0x1eab12){return _0x1eab12[_0x20cc('0xe8')](_0x525401['body']['ids'],_[_0x20cc('0xe9')](_0x525401[_0x20cc('0x5d')],[_0x20cc('0xea'),'id'])||{});}})[_0x20cc('0x39')](respondWithResult(_0x173cfe,null))[_0x20cc('0x2a')](handleError(_0x173cfe,null));};exports[_0x20cc('0xeb')]=function(_0x28555d,_0x596359,_0x216482){var _0x57a50e={'raw':![],'where':{}};var _0x3b0464={};var _0x5a25c5={'count':0x0,'rows':[]};return db[_0x20cc('0x41')][_0x20cc('0x69')]({'where':{'id':_0x28555d[_0x20cc('0x64')]['id']}})['then'](handleEntityNotFound(_0x596359,null))[_0x20cc('0x39')](function(_0x3fd7fa){if(_0x3fd7fa){_0x3b0464[_0x20cc('0x45')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x3b0464[_0x20cc('0x46')]=_[_0x20cc('0x47')](_0x28555d[_0x20cc('0x46')]);_0x3b0464['filters']=_[_0x20cc('0x4a')](_0x3b0464[_0x20cc('0x45')],_0x3b0464[_0x20cc('0x46')]);_0x57a50e[_0x20cc('0x49')]=_[_0x20cc('0x4a')](_0x3b0464[_0x20cc('0x45')],qs[_0x20cc('0x4b')](_0x28555d[_0x20cc('0x46')][_0x20cc('0x4b')]));_0x57a50e[_0x20cc('0x49')]=_0x57a50e[_0x20cc('0x49')][_0x20cc('0x59')]?_0x57a50e[_0x20cc('0x49')]:_0x3b0464['model'];if(!_0x28555d[_0x20cc('0x46')][_0x20cc('0x6a')](_0x20cc('0x4c'))){_0x57a50e[_0x20cc('0x30')]=qs[_0x20cc('0x30')](_0x28555d[_0x20cc('0x46')]['limit']);_0x57a50e[_0x20cc('0x2f')]=qs['offset'](_0x28555d[_0x20cc('0x46')][_0x20cc('0x2f')]);}_0x57a50e[_0x20cc('0x4d')]=qs[_0x20cc('0x4e')](_0x28555d[_0x20cc('0x46')]['sort']);_0x57a50e[_0x20cc('0x51')]=qs[_0x20cc('0x48')](_[_0x20cc('0x4f')](_0x28555d[_0x20cc('0x46')],_0x3b0464[_0x20cc('0x48')]));_0x57a50e[_0x20cc('0x51')][_0x20cc('0x67')]=_0x3fd7fa['id'];if(_0x28555d['query'][_0x20cc('0x50')]){_0x57a50e[_0x20cc('0x51')]=_[_0x20cc('0x52')](_0x57a50e[_0x20cc('0x51')],{'$or':_[_0x20cc('0x40')](_0x57a50e[_0x20cc('0x49')],function(_0x44b1d2){var _0x73a9aa={};_0x73a9aa[_0x44b1d2]={'$like':'%'+_0x28555d[_0x20cc('0x46')][_0x20cc('0x50')]+'%'};return _0x73a9aa;})});}_0x57a50e=_[_0x20cc('0x52')]({},_0x57a50e,_0x28555d[_0x20cc('0x55')]);return db[_0x20cc('0xba')][_0x20cc('0x2e')]({'where':_0x57a50e[_0x20cc('0x51')]})['then'](function(_0x200af1){_0x5a25c5[_0x20cc('0x2e')]=_0x200af1;if(_0x28555d[_0x20cc('0x46')]['includeAll']){_0x57a50e[_0x20cc('0x5b')]=[{'model':db[_0x20cc('0x9d')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x20cc('0xec'),_0x20cc('0xed')],'required':![]},{'model':db['Tag'],'as':_0x20cc('0xee'),'attributes':['id',_0x20cc('0x3c'),_0x20cc('0xef')],'where':_0x28555d[_0x20cc('0x46')]['tag']?{'id':_0x28555d[_0x20cc('0x46')]['tag']}:undefined,'required':_0x28555d[_0x20cc('0x46')][_0x20cc('0xf0')]?!![]:![]}];}return db[_0x20cc('0xba')][_0x20cc('0x6f')](_0x57a50e);})[_0x20cc('0x39')](function(_0x4dd12d){_0x5a25c5[_0x20cc('0x56')]=_0x4dd12d;return _0x5a25c5;});}})[_0x20cc('0x39')](respondWithFilteredResult(_0x596359,_0x57a50e))['catch'](handleError(_0x596359,null));};function iftimePromise(_0x32c0dc,_0xc568b0){return respondWithRpcPromise('Command','getSnippet',{'command':_0xc568b0[_0x20cc('0xf1')]?util[_0x20cc('0xb4')]('iftime\x20%s,%s',_0x32c0dc[_0x20cc('0xf2')],_0xc568b0['timezone']):util[_0x20cc('0xb4')](_0x20cc('0xf3'),_0x32c0dc[_0x20cc('0xf2')])},client9002)[_0x20cc('0x39')](function(_0x249f79){var _0x457923=_0x249f79&&_0x249f79[_0x20cc('0xf4')]('true')>=0x0?!![]:![];logger[_0x20cc('0xf5')](_0x20cc('0xf6'),_0xc568b0['id'],_0x32c0dc['id'],_0x32c0dc[_0x20cc('0xf2')],_0x457923?_0x20cc('0xf7'):_0x20cc('0xf8'),_0xc568b0[_0x20cc('0xf1')]?_0xc568b0['timezone']:_0x20cc('0xf9'));return _0x457923;})['catch'](function(_0x2aabf0){logger[_0x20cc('0x26')](_0x20cc('0xf6'),_0xc568b0['id'],_0x32c0dc['id'],_0x32c0dc[_0x20cc('0xf2')],util[_0x20cc('0xfa')](_0x2aabf0,{'showHidden':![],'depth':null}),_0xc568b0[_0x20cc('0xf1')]?_0xc568b0[_0x20cc('0xf1')]:_0x20cc('0xf9'));return![];});}exports[_0x20cc('0xfb')]=function(_0x43edbb,_0x339596,_0x5ed157){var _0x35fbc7=0x0;var _0x42354a=0x0;var _0x5ce045=![];var _0x89b0a1;var _0x5d3b88;return db[_0x20cc('0x41')]['find']({'where':{'id':_0x43edbb[_0x20cc('0x64')]['id']},'include':[{'model':db['Interval'],'as':_0x20cc('0xfc'),'include':[{'model':db['Interval'],'as':_0x20cc('0xfd'),'attributes':['id',_0x20cc('0xf2')],'raw':!![]}]}]})[_0x20cc('0x39')](handleEntityNotFound(_0x339596,null))['then'](function(_0x504156){if(_0x504156){_0x89b0a1=_0x504156;return _0x504156[_0x20cc('0xfe')]({'raw':!![]});}})[_0x20cc('0x39')](function(_0x43a61c){if(_0x89b0a1){if(_0x43a61c){_0x5d3b88=_0x43a61c;}}return require(_0x20cc('0x7a'))[_0x20cc('0x7b')]();})[_0x20cc('0x39')](function(_0x237fbc){if(_0x237fbc){_0x42354a=_0x237fbc['virtual'];_0x5ce045=_0x237fbc[_0x20cc('0x7c')];}})[_0x20cc('0x39')](function(){return db[_0x20cc('0xba')][_0x20cc('0x2e')]({'where':{'closed':![]}});})[_0x20cc('0x39')](function(_0x51d6ad){_0x35fbc7=_0x51d6ad;if(_0x42354a&&_0x51d6ad>_0x42354a){return db['License']['findOne']({'where':{'id':0x1}})['then'](function(_0x5c96f6){if(_0x5c96f6){_0x5c96f6[_0x20cc('0xff')](_0x20cc('0x100'));}});}})[_0x20cc('0x39')](function(){if(_0x89b0a1['Interval']&&_0x89b0a1[_0x20cc('0xfc')][_0x20cc('0xfd')]){var _0xd41fff=[];for(var _0x32e913=0x0;_0x32e913<_0x89b0a1[_0x20cc('0xfc')]['Intervals']['length'];_0x32e913++){var _0x47305f=_0x89b0a1[_0x20cc('0xfc')]['Intervals'][_0x32e913][_0x20cc('0x5f')]({'plain':!![]});_0xd41fff['push'](iftimePromise(_0x47305f,_0x89b0a1));}return BPromise[_0x20cc('0x101')](_0xd41fff)[_0x20cc('0x39')](function(_0x4dd94d){return _['some'](_0x4dd94d);});}else{return!![];}})[_0x20cc('0x39')](function(_0x51f48e){var _0x2049dc=fs[_0x20cc('0xd6')](path[_0x20cc('0x7e')](config[_0x20cc('0x77')],_0x20cc('0x102')),_0x20cc('0x103'));var _0x447166={'remote':_0x89b0a1[_0x20cc('0x104')],'query':querystring[_0x20cc('0xb8')](_[_0x20cc('0x52')](_0x89b0a1[_0x20cc('0x5f')]({'plain':!![]}),{'customerIp':_0x43edbb[_0x20cc('0x8d')][_0x20cc('0xa9')]||_0x43edbb['headers'][_0x20cc('0x105')]||_0x43edbb[_0x20cc('0x106')][_0x20cc('0x107')]||_0x43edbb['ip'],'referer':_0x43edbb[_0x20cc('0x8d')][_0x20cc('0xaf')],'openedInteractions':_0x35fbc7,'maxInteractions':_0x42354a,'virtual':_0x5ce045['virtual'],'online':_0x51f48e,'custom':_0x5ce045}))[_0x20cc('0x108')](/'/g,'\x5c\x27')};_0x339596['send'](ejs[_0x20cc('0xd8')](Mustache['render'](_0x2049dc,_0x447166),{'proactiveActions':_0x5d3b88,'alignment':_0x89b0a1[_0x20cc('0x109')],'verticalAlignment':_0x89b0a1[_0x20cc('0x10a')],'div_color':_0x89b0a1[_0x20cc('0xef')],'text_color':_0x89b0a1['textColor']}));})['catch'](handleError(_0x339596,null));};exports[_0x20cc('0x10b')]=function(_0x22279a,_0x519a3a,_0x1b6c1b){return db[_0x20cc('0x41')][_0x20cc('0x69')]({'where':{'id':_0x22279a[_0x20cc('0x64')]['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x519a3a,null))[_0x20cc('0x39')](function(_0x1252eb){if(_0x1252eb){return db[_0x20cc('0x10c')]['transaction'](function(_0x39cfbf){return db[_0x20cc('0x9f')][_0x20cc('0x38')]({'where':{'ChatWebsiteId':_0x22279a[_0x20cc('0x64')]['id']},'transaction':_0x39cfbf})[_0x20cc('0x39')](function(_0x3af377){var _0x2776f9=_[_0x20cc('0x40')](_0x22279a[_0x20cc('0x5d')],function(_0xdbffff){_0xdbffff[_0x20cc('0x67')]=_0x22279a[_0x20cc('0x64')]['id'];return _0xdbffff;});return db[_0x20cc('0x9f')]['bulkCreate'](_0x2776f9,{'transaction':_0x39cfbf});});})[_0x20cc('0x39')](function(){return db[_0x20cc('0x9f')][_0x20cc('0x10d')]({'where':{'ChatWebsiteId':_0x22279a[_0x20cc('0x64')]['id']},'order':_0x20cc('0xa4')});});}})[_0x20cc('0x39')](respondWithResult(_0x519a3a,null))[_0x20cc('0x2a')](handleError(_0x519a3a,null));};exports[_0x20cc('0x10e')]=function(_0x2247a6,_0x2ee967,_0xd3ff7e){var _0x5d38a5={};var _0x930586={};var _0x1d22cf;var _0x5bc131;return db[_0x20cc('0x41')]['findOne']({'where':{'id':_0x2247a6[_0x20cc('0x64')]['id']}})['then'](handleEntityNotFound(_0x2ee967,null))[_0x20cc('0x39')](function(_0x4c1043){if(_0x4c1043){_0x1d22cf=_0x4c1043;_0x930586[_0x20cc('0x45')]=_['keys'](db[_0x20cc('0x9f')][_0x20cc('0x42')]);_0x930586['query']=_[_0x20cc('0x47')](_0x2247a6[_0x20cc('0x46')]);_0x930586[_0x20cc('0x48')]=_['intersection'](_0x930586[_0x20cc('0x45')],_0x930586[_0x20cc('0x46')]);_0x5d38a5[_0x20cc('0x49')]=_[_0x20cc('0x4a')](_0x930586[_0x20cc('0x45')],qs['fields'](_0x2247a6[_0x20cc('0x46')][_0x20cc('0x4b')]));_0x5d38a5['attributes']=_0x5d38a5['attributes'][_0x20cc('0x59')]?_0x5d38a5[_0x20cc('0x49')]:_0x930586[_0x20cc('0x45')];_0x5d38a5['order']=qs[_0x20cc('0x4e')](_0x2247a6[_0x20cc('0x46')]['sort']);_0x5d38a5[_0x20cc('0x51')]=qs[_0x20cc('0x48')](_['pick'](_0x2247a6[_0x20cc('0x46')],_0x930586[_0x20cc('0x48')]));if(_0x2247a6[_0x20cc('0x46')][_0x20cc('0x50')]){_0x5d38a5['where']=_[_0x20cc('0x52')](_0x5d38a5[_0x20cc('0x51')],{'$or':_[_0x20cc('0x40')](_0x5d38a5[_0x20cc('0x49')],function(_0x430514){var _0x14b2ec={};_0x14b2ec[_0x430514]={'$like':'%'+_0x2247a6[_0x20cc('0x46')][_0x20cc('0x50')]+'%'};return _0x14b2ec;})});}_0x5d38a5=_['merge']({},_0x5d38a5,_0x2247a6[_0x20cc('0x55')]);return _0x1d22cf['getApplications'](_0x5d38a5);}})[_0x20cc('0x39')](function(_0x496548){if(_0x496548){_0x5bc131=_0x496548['length'];if(!_0x2247a6[_0x20cc('0x46')][_0x20cc('0x6a')](_0x20cc('0x4c'))){_0x5d38a5['limit']=qs[_0x20cc('0x30')](_0x2247a6[_0x20cc('0x46')][_0x20cc('0x30')]);_0x5d38a5[_0x20cc('0x2f')]=qs['offset'](_0x2247a6[_0x20cc('0x46')][_0x20cc('0x2f')]);}return _0x1d22cf[_0x20cc('0x10e')](_0x5d38a5);}})[_0x20cc('0x39')](function(_0x213d01){if(_0x213d01){return _0x213d01?{'count':_0x5bc131,'rows':_0x213d01}:null;}})['then'](respondWithResult(_0x2ee967,null))[_0x20cc('0x2a')](handleError(_0x2ee967,null));};exports[_0x20cc('0x10f')]=function(_0x3447a2,_0x51afb5,_0x5c3247){return db[_0x20cc('0x110')]['find']({'where':{'id':_0x3447a2['params']['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x51afb5,null))[_0x20cc('0x39')](function(_0xd96ed3){if(_0xd96ed3){return _0xd96ed3[_0x20cc('0x10f')](_0x3447a2[_0x20cc('0x5d')][_0x20cc('0xea')],_[_0x20cc('0xe9')](_0x3447a2['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x51afb5,null))[_0x20cc('0x2a')](handleError(_0x51afb5,null));};exports[_0x20cc('0xfe')]=function(_0xbf7fb4,_0x5de21e,_0x43f66e){var _0x4d744e={};var _0x2a45e3={};var _0x39bf47;var _0x56d4bd;return db[_0x20cc('0x41')][_0x20cc('0x69')]({'where':{'id':_0xbf7fb4[_0x20cc('0x64')]['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x5de21e,null))[_0x20cc('0x39')](function(_0x1be0a6){if(_0x1be0a6){_0x39bf47=_0x1be0a6;_0x2a45e3[_0x20cc('0x45')]=_[_0x20cc('0x47')](db[_0x20cc('0x111')]['rawAttributes']);_0x2a45e3[_0x20cc('0x46')]=_[_0x20cc('0x47')](_0xbf7fb4['query']);_0x2a45e3[_0x20cc('0x48')]=_['intersection'](_0x2a45e3['model'],_0x2a45e3[_0x20cc('0x46')]);_0x4d744e[_0x20cc('0x49')]=_[_0x20cc('0x4a')](_0x2a45e3[_0x20cc('0x45')],qs[_0x20cc('0x4b')](_0xbf7fb4[_0x20cc('0x46')][_0x20cc('0x4b')]));_0x4d744e['attributes']=_0x4d744e['attributes'][_0x20cc('0x59')]?_0x4d744e[_0x20cc('0x49')]:_0x2a45e3[_0x20cc('0x45')];_0x4d744e[_0x20cc('0x4d')]=qs[_0x20cc('0x4e')](_0xbf7fb4[_0x20cc('0x46')][_0x20cc('0x4e')]);_0x4d744e[_0x20cc('0x51')]=qs[_0x20cc('0x48')](_[_0x20cc('0x4f')](_0xbf7fb4[_0x20cc('0x46')],_0x2a45e3['filters']));if(_0xbf7fb4[_0x20cc('0x46')][_0x20cc('0x50')]){_0x4d744e['where']=_[_0x20cc('0x52')](_0x4d744e[_0x20cc('0x51')],{'$or':_[_0x20cc('0x40')](_0x4d744e['attributes'],function(_0x4d1a8d){var _0x319c7e={};_0x319c7e[_0x4d1a8d]={'$like':'%'+_0xbf7fb4[_0x20cc('0x46')][_0x20cc('0x50')]+'%'};return _0x319c7e;})});}_0x4d744e=_[_0x20cc('0x52')]({},_0x4d744e,_0xbf7fb4[_0x20cc('0x55')]);return _0x39bf47['getProactiveActions'](_0x4d744e);}})[_0x20cc('0x39')](function(_0x3aa2c3){if(_0x3aa2c3){_0x56d4bd=_0x3aa2c3['length'];if(!_0xbf7fb4['query'][_0x20cc('0x6a')]('nolimit')){_0x4d744e[_0x20cc('0x30')]=qs[_0x20cc('0x30')](_0xbf7fb4[_0x20cc('0x46')]['limit']);_0x4d744e[_0x20cc('0x2f')]=qs['offset'](_0xbf7fb4[_0x20cc('0x46')]['offset']);}return _0x39bf47[_0x20cc('0xfe')](_0x4d744e);}})[_0x20cc('0x39')](function(_0x206a62){if(_0x206a62){return _0x206a62?{'count':_0x56d4bd,'rows':_0x206a62}:null;}})[_0x20cc('0x39')](respondWithResult(_0x5de21e,null))[_0x20cc('0x2a')](handleError(_0x5de21e,null));};exports['getFields']=function(_0x30075e,_0x802308,_0x586851){var _0x3883bc=_0x30075e[_0x20cc('0x46')][_0x20cc('0x112')]===_0x20cc('0x113')?_0x20cc('0x114'):_0x20cc('0x115');return db[_0x20cc('0x41')]['find']({'attributes':['id',_0x3883bc],'where':{'id':_0x30075e['params']['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x802308,null))[_0x20cc('0x39')](function(_0x5f5889){if(_0x5f5889){var _0x403118=_0x5f5889[_0x3883bc];var _0x4bcabf=_0x403118&&_0x403118['items']?_0x403118['items']:[];_0x802308[_0x20cc('0x3d')]({'fromKey':_['isNil'](_0x403118[_0x20cc('0x116')])?undefined:_0x403118[_0x20cc('0x116')],'count':_0x4bcabf['length'],'rows':_0x4bcabf});}})[_0x20cc('0x2a')](handleError(_0x802308,null));};exports[_0x20cc('0x117')]=function(_0xb101e3,_0x5d4cd1,_0x3e2210){var _0x5ee86d={'raw':![],'where':{}};var _0x38ae92={};var _0x4eda9f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x20cc('0x69')]({'where':{'id':_0xb101e3['params']['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x5d4cd1,null))[_0x20cc('0x39')](function(_0x215f52){if(_0x215f52){_0x38ae92[_0x20cc('0x45')]=_[_0x20cc('0x47')](db[_0x20cc('0xdb')]['rawAttributes']);_0x38ae92[_0x20cc('0x46')]=_['keys'](_0xb101e3[_0x20cc('0x46')]);_0x38ae92[_0x20cc('0x48')]=_[_0x20cc('0x4a')](_0x38ae92['model'],_0x38ae92['query']);_0x5ee86d[_0x20cc('0x49')]=_[_0x20cc('0x4a')](_0x38ae92[_0x20cc('0x45')],qs[_0x20cc('0x4b')](_0xb101e3['query'][_0x20cc('0x4b')]));_0x5ee86d['attributes']=_0x5ee86d['attributes'][_0x20cc('0x59')]?_0x5ee86d[_0x20cc('0x49')]:_0x38ae92['model'];if(!_0xb101e3['query']['hasOwnProperty'](_0x20cc('0x4c'))){_0x5ee86d[_0x20cc('0x30')]=qs[_0x20cc('0x30')](_0xb101e3[_0x20cc('0x46')][_0x20cc('0x30')]);_0x5ee86d['offset']=qs[_0x20cc('0x2f')](_0xb101e3[_0x20cc('0x46')][_0x20cc('0x2f')]);}_0x5ee86d[_0x20cc('0x4d')]=qs[_0x20cc('0x4e')](_0xb101e3[_0x20cc('0x46')][_0x20cc('0x4e')]);_0x5ee86d['where']=qs[_0x20cc('0x48')](_[_0x20cc('0x4f')](_0xb101e3[_0x20cc('0x46')],_0x38ae92[_0x20cc('0x48')]));_0x5ee86d[_0x20cc('0x51')][_0x20cc('0x67')]=_0x215f52['id'];if(_0xb101e3[_0x20cc('0x46')][_0x20cc('0x50')]){_0x5ee86d[_0x20cc('0x51')]=_[_0x20cc('0x52')](_0x5ee86d[_0x20cc('0x51')],{'$or':_['map'](_0x5ee86d[_0x20cc('0x49')],function(_0x52bf34){var _0x49c8fc={};_0x49c8fc[_0x52bf34]={'$like':'%'+_0xb101e3[_0x20cc('0x46')][_0x20cc('0x50')]+'%'};return _0x49c8fc;})});}_0x5ee86d=_[_0x20cc('0x52')]({},_0x5ee86d,_0xb101e3[_0x20cc('0x55')]);return db[_0x20cc('0xdb')][_0x20cc('0x2e')]({'where':_0x5ee86d[_0x20cc('0x51')]})['then'](function(_0x2b6bad){_0x4eda9f[_0x20cc('0x2e')]=_0x2b6bad;if(_0xb101e3[_0x20cc('0x46')][_0x20cc('0x5a')]){_0x5ee86d[_0x20cc('0x5b')]=[{'all':!![]}];}else{_0x5ee86d[_0x20cc('0x5b')]=[{'model':db[_0x20cc('0x9d')],'as':_0x20cc('0x118'),'required':![]}];}return db[_0x20cc('0xdb')][_0x20cc('0x6f')](_0x5ee86d);})['then'](function(_0x8f5e40){_0x4eda9f['rows']=_0x8f5e40;return _0x4eda9f;});}})[_0x20cc('0x39')](respondWithFilteredResult(_0x5d4cd1,_0x5ee86d))[_0x20cc('0x2a')](handleError(_0x5d4cd1,null));};exports[_0x20cc('0x119')]=function(_0x2f708f,_0x55324e,_0x474c04){return db['ChatWebsite'][_0x20cc('0x5c')]({'where':{'id':_0x2f708f['params']['id']}})['then'](handleEntityNotFound(_0x55324e,null))[_0x20cc('0x39')](function(_0x540c98){if(_0x540c98){return _0x540c98[_0x20cc('0x119')](_0x2f708f[_0x20cc('0x5d')]['ids'],_[_0x20cc('0xe9')](_0x2f708f[_0x20cc('0x5d')],[_0x20cc('0xea'),'id'])||{})[_0x20cc('0xbe')](function(_0x4a8241){for(var _0xc59734=0x0;_0xc59734<_0x2f708f[_0x20cc('0x5d')][_0x20cc('0xea')][_0x20cc('0x59')];_0xc59734+=0x1){socket[_0x20cc('0x11a')](_0x20cc('0x11b'),{'UserId':_0x2f708f[_0x20cc('0x5d')][_0x20cc('0xea')][_0xc59734],'ChatWebsiteId':_0x2f708f[_0x20cc('0x64')]['id']});}return _0x4a8241;});}})[_0x20cc('0x39')](respondWithResult(_0x55324e,null))['catch'](handleError(_0x55324e,null));};exports[_0x20cc('0x11c')]=function(_0x1fb6e4,_0x41420c,_0x4ed6a9){return db[_0x20cc('0x41')]['find']({'where':{'id':_0x1fb6e4[_0x20cc('0x64')]['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x41420c,null))['then'](function(_0x179244){if(_0x179244){return _0x179244['removeAgents'](_0x1fb6e4[_0x20cc('0x46')][_0x20cc('0xea')])[_0x20cc('0x39')](function(){if(_[_0x20cc('0x11d')](_0x1fb6e4[_0x20cc('0x46')][_0x20cc('0xea')])){for(var _0x4666bd=0x0;_0x4666bd<_0x1fb6e4['query']['ids'][_0x20cc('0x59')];_0x4666bd+=0x1){socket['emit'](_0x20cc('0x11e'),{'UserId':Number(_0x1fb6e4[_0x20cc('0x46')][_0x20cc('0xea')][_0x4666bd]),'ChatWebsiteId':Number(_0x1fb6e4[_0x20cc('0x64')]['id'])});}}else{socket[_0x20cc('0x11a')](_0x20cc('0x11e'),{'UserId':Number(_0x1fb6e4['query']['ids']),'ChatWebsiteId':Number(_0x1fb6e4[_0x20cc('0x64')]['id'])});}});}})[_0x20cc('0x39')](respondWithStatusCode(_0x41420c,null))['catch'](handleError(_0x41420c,null));};exports['getAgents']=function(_0x1bb867,_0x372282,_0x5d45c0){var _0xca826c={};var _0x38b77a={};var _0x422f5c;var _0x22f1f8;return db[_0x20cc('0x41')][_0x20cc('0x69')]({'where':{'id':_0x1bb867[_0x20cc('0x64')]['id']}})[_0x20cc('0x39')](handleEntityNotFound(_0x372282,null))[_0x20cc('0x39')](function(_0x3ed831){if(_0x3ed831){_0x422f5c=_0x3ed831;_0x38b77a[_0x20cc('0x45')]=_[_0x20cc('0x47')](db[_0x20cc('0xc7')][_0x20cc('0x42')]);_0x38b77a[_0x20cc('0x46')]=_[_0x20cc('0x47')](_0x1bb867['query']);_0x38b77a[_0x20cc('0x48')]=_['intersection'](_0x38b77a['model'],_0x38b77a[_0x20cc('0x46')]);_0xca826c['attributes']=_['intersection'](_0x38b77a['model'],qs['fields'](_0x1bb867['query']['fields']));_0xca826c[_0x20cc('0x49')]=_0xca826c[_0x20cc('0x49')][_0x20cc('0x59')]?_0xca826c[_0x20cc('0x49')]:_0x38b77a['model'];_0xca826c[_0x20cc('0x4d')]=qs[_0x20cc('0x4e')](_0x1bb867[_0x20cc('0x46')]['sort']);_0xca826c[_0x20cc('0x51')]=qs['filters'](_[_0x20cc('0x4f')](_0x1bb867[_0x20cc('0x46')],_0x38b77a['filters']));if(_0x1bb867['query'][_0x20cc('0x50')]){_0xca826c[_0x20cc('0x51')]=_[_0x20cc('0x52')](_0xca826c[_0x20cc('0x51')],{'$or':_[_0x20cc('0x40')](_0xca826c[_0x20cc('0x49')],function(_0xfddb2f){var _0x3b1494={};_0x3b1494[_0xfddb2f]={'$like':'%'+_0x1bb867['query'][_0x20cc('0x50')]+'%'};return _0x3b1494;})});}_0xca826c=_[_0x20cc('0x52')]({},_0xca826c,_0x1bb867[_0x20cc('0x55')]);return _0x422f5c['getAgents'](_0xca826c);}})['then'](function(_0x2afcfc){if(_0x2afcfc){_0x22f1f8=_0x2afcfc[_0x20cc('0x59')];if(!_0x1bb867[_0x20cc('0x46')]['hasOwnProperty'](_0x20cc('0x4c'))){_0xca826c['limit']=qs['limit'](_0x1bb867['query'][_0x20cc('0x30')]);_0xca826c[_0x20cc('0x2f')]=qs[_0x20cc('0x2f')](_0x1bb867[_0x20cc('0x46')][_0x20cc('0x2f')]);}return _0x422f5c[_0x20cc('0x11f')](_0xca826c);}})[_0x20cc('0x39')](function(_0xeb3b47){if(_0xeb3b47){return _0xeb3b47?{'count':_0x22f1f8,'rows':_0xeb3b47}:null;}})[_0x20cc('0x39')](respondWithResult(_0x372282,null))[_0x20cc('0x2a')](handleError(_0x372282,null));}; \ No newline at end of file +var _0x2126=['host','port','secure','authentication','auth','pass','SendMail','email','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','some','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','referer','alignment','verticalAlignment','textColor','addApplications','transaction','bulkCreate','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','http','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','destroy','then','get','ChatWebsites','UserProfileResource','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','nolimit','order','sort','filter','VIRTUAL','include','findAll','rows','show','params','keys','filters','length','includeAll','merge','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','where','pick','count','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','hasOwnProperty','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.png','../../config/license/util','custom','isNil','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','user-agent','getResult','chat','CmContact','difference','updatedAt','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','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','asc','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','version','unknown','format','%s\x20%s','device','%s\x20%s\x20%s','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','messageId','autoclose','push','close','unmanaged','AttachmentId','UserId','User','unshift','agent','*,*,*,*','Start','startRouting','EventManager','notify','offline','createdAt','CompanyId','ListId','mapKeyOffline','CmList','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service'];(function(_0x2c7f2b,_0x71a26c){var _0xade785=function(_0x293951){while(--_0x293951){_0x2c7f2b['push'](_0x2c7f2b['shift']());}};_0xade785(++_0x71a26c);}(_0x2126,0x169));var _0x6212=function(_0x4c1eec,_0x515aa1){_0x4c1eec=_0x4c1eec-0x0;var _0x5d8475=_0x2126[_0x4c1eec];return _0x5d8475;};'use strict';var pdf=require(_0x6212('0x0'));var emlformat=require(_0x6212('0x1'));var rimraf=require(_0x6212('0x2'));var zipdir=require(_0x6212('0x3'));var jsonpatch=require(_0x6212('0x4'));var rp=require(_0x6212('0x5'));var moment=require(_0x6212('0x6'));var BPromise=require(_0x6212('0x7'));var Mustache=require('mustache');var util=require(_0x6212('0x8'));var path=require(_0x6212('0x9'));var sox=require('sox');var csv=require(_0x6212('0xa'));var ejs=require(_0x6212('0xb'));var fs=require('fs');var _=require(_0x6212('0xc'));var squel=require(_0x6212('0xd'));var crypto=require('crypto');var jsforce=require(_0x6212('0xe'));var deskjs=require(_0x6212('0xf'));var toCsv=require(_0x6212('0xa'));var querystring=require('querystring');var Papa=require(_0x6212('0x10'));var Redis=require('ioredis');var authService=require(_0x6212('0x11'));var qs=require(_0x6212('0x12'));var as=require(_0x6212('0x13'));var hardwareService=require(_0x6212('0x14'));var logger=require(_0x6212('0x15'))('api');var utils=require(_0x6212('0x16'));var config=require(_0x6212('0x17'));var db=require(_0x6212('0x18'))['db'];config[_0x6212('0x19')]=_[_0x6212('0x1a')](config[_0x6212('0x19')],{'host':_0x6212('0x1b'),'port':0x18eb});var socket=require(_0x6212('0x1c'))(new Redis(config[_0x6212('0x19')]));require(_0x6212('0x1d'))['register'](socket);var jayson=require(_0x6212('0x1e'));var client=jayson['client'][_0x6212('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x6212('0x1f')]({'port':0x232a});var client9003=jayson[_0x6212('0x20')][_0x6212('0x1f')]({'port':0x232b});function checkPasswordPattern(_0x213271,_0x20c84d,_0xfa485e){if(_0xfa485e){var _0x3d8342=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3d8342[_0x6212('0x21')](_0x20c84d)){return _0x213271;}else{throw new db[(_0x6212('0x22'))][(_0x6212('0x23'))](_0x6212('0x24'));}}else{return _0x213271;}}function respondWithRpcPromise(_0x1593e9,_0x548d76,_0x50ad26,_0x337056){return new BPromise(function(_0x27d4b5,_0x418157){var _0x38986f=_0x337056||client;return _0x38986f[_0x6212('0x25')](_0x1593e9,_0x50ad26)['then'](function(_0x115a37){logger[_0x6212('0x26')](_0x6212('0x27'),_0x548d76,_0x6212('0x28'));logger[_0x6212('0x29')](_0x6212('0x2a'),_0x548d76,'request\x20sent',JSON[_0x6212('0x2b')](_0x115a37));if(_0x115a37[_0x6212('0x2c')]){if(_0x115a37[_0x6212('0x2c')][_0x6212('0x2d')]===0x1f4){logger[_0x6212('0x2c')](_0x6212('0x27'),_0x548d76,_0x115a37['error'][_0x6212('0x2e')]);return _0x418157(_0x115a37[_0x6212('0x2c')][_0x6212('0x2e')]);}logger[_0x6212('0x2c')](_0x6212('0x27'),_0x548d76,_0x115a37[_0x6212('0x2c')]['message']);return _0x27d4b5(_0x115a37[_0x6212('0x2c')][_0x6212('0x2e')]);}else{logger[_0x6212('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x548d76,'request\x20sent');_0x27d4b5(_0x115a37[_0x6212('0x2f')]['message']);}})['catch'](function(_0x568d72){logger['error'](_0x6212('0x27'),_0x548d76,_0x568d72);_0x418157(_0x568d72);});});}function respondWithStatusCode(_0xa8ca42,_0x287357){_0x287357=_0x287357||0xcc;return function(_0x542389){if(_0x542389){return _0xa8ca42[_0x6212('0x30')](_0x287357);}return _0xa8ca42[_0x6212('0x31')](_0x287357)[_0x6212('0x32')]();};}function respondWithResult(_0x44c20c,_0x2bbbe1){_0x2bbbe1=_0x2bbbe1||0xc8;return function(_0x3e58c1){if(_0x3e58c1){return _0x44c20c['status'](_0x2bbbe1)[_0x6212('0x33')](_0x3e58c1);}};}function respondWithFilteredResult(_0x35d120,_0x12685a){return function(_0x1fa1bd){if(_0x1fa1bd){var _0x5426c6=_0x1fa1bd['count'],_0x20c9f7=_0x12685a[_0x6212('0x34')],_0x4df40e=_0x12685a['offset']+_0x12685a[_0x6212('0x35')],_0x5b94e9;if(_0x4df40e>=_0x5426c6){_0x4df40e=_0x5426c6;_0x5b94e9=0xc8;}else{_0x5b94e9=0xce;}_0x35d120[_0x6212('0x31')](_0x5b94e9);return _0x35d120[_0x6212('0x36')](_0x6212('0x37'),_0x20c9f7+'-'+_0x4df40e+'/'+_0x5426c6)[_0x6212('0x33')](_0x1fa1bd);}return null;};}function patchUpdates(_0x576a84){return function(_0x43a305){try{jsonpatch[_0x6212('0x38')](_0x43a305,_0x576a84,!![]);}catch(_0x550f77){return BPromise[_0x6212('0x39')](_0x550f77);}return _0x43a305[_0x6212('0x3a')]();};}function saveUpdates(_0x181933,_0x2bcfa2){return function(_0x2d116e){if(_0x2d116e){return _0x2d116e['update'](_0x181933)['then'](function(_0x3f66e5){return _0x3f66e5;});}return null;};}function removeEntity(_0x4c7cca,_0x5e421e){return function(_0x18d78d){if(_0x18d78d){return _0x18d78d[_0x6212('0x3b')]()[_0x6212('0x3c')](function(){var _0x5e8d7c=_0x18d78d[_0x6212('0x3d')]({'plain':!![]});var _0x35b0cc=_0x6212('0x3e');return db[_0x6212('0x3f')][_0x6212('0x3b')]({'where':{'type':_0x35b0cc,'resourceId':_0x5e8d7c['id']}})['then'](function(){return _0x18d78d;});})[_0x6212('0x3c')](function(){_0x4c7cca[_0x6212('0x31')](0xcc)[_0x6212('0x32')]();});}};}function handleEntityNotFound(_0x26ed11,_0x37f4cf){return function(_0x561353){if(!_0x561353){_0x26ed11[_0x6212('0x30')](0x194);}return _0x561353;};}function handleError(_0x45e969,_0x63a9d3){_0x63a9d3=_0x63a9d3||0x1f4;return function(_0x23f0c7){logger['error'](_0x23f0c7['stack']);if(_0x23f0c7[_0x6212('0x40')]){delete _0x23f0c7[_0x6212('0x40')];}_0x45e969[_0x6212('0x31')](_0x63a9d3)[_0x6212('0x41')](_0x23f0c7);};}exports['index']=function(_0x3c98a4,_0x53de3c){var _0x5e4211={'include':[{'model':db[_0x6212('0x42')],'as':_0x6212('0x43')}]},_0x46aa3f={},_0x452298={'count':0x0,'rows':[]};var _0x29a7d3=_[_0x6212('0x44')](db[_0x6212('0x45')][_0x6212('0x46')],function(_0x2eeebe){return{'name':_0x2eeebe[_0x6212('0x47')],'type':_0x2eeebe[_0x6212('0x48')][_0x6212('0x49')]};});_0x46aa3f['model']=_[_0x6212('0x44')](_0x29a7d3,_0x6212('0x40'));_0x46aa3f[_0x6212('0x4a')]=_['keys'](_0x3c98a4['query']);_0x46aa3f['filters']=_[_0x6212('0x4b')](_0x46aa3f['model'],_0x46aa3f['query']);_0x5e4211[_0x6212('0x4c')]=_[_0x6212('0x4b')](_0x46aa3f[_0x6212('0x4d')],qs['fields'](_0x3c98a4['query'][_0x6212('0x4e')]));_0x5e4211[_0x6212('0x4c')]=_0x5e4211[_0x6212('0x4c')]['length']?_0x5e4211['attributes']:_0x46aa3f[_0x6212('0x4d')];if(!_0x3c98a4['query']['hasOwnProperty'](_0x6212('0x4f'))){_0x5e4211['limit']=qs[_0x6212('0x35')](_0x3c98a4[_0x6212('0x4a')][_0x6212('0x35')]);_0x5e4211[_0x6212('0x34')]=qs['offset'](_0x3c98a4['query'][_0x6212('0x34')]);}_0x5e4211[_0x6212('0x50')]=qs[_0x6212('0x51')](_0x3c98a4['query'][_0x6212('0x51')]);_0x5e4211['where']=qs['filters'](_['pick'](_0x3c98a4[_0x6212('0x4a')],_0x46aa3f['filters']));if(_0x3c98a4[_0x6212('0x4a')][_0x6212('0x52')]){_0x5e4211['where']=_['merge'](_0x5e4211['where'],{'$or':_[_0x6212('0x44')](_0x29a7d3,function(_0x582431){if(_0x582431[_0x6212('0x48')]!==_0x6212('0x53')){var _0x149881={};_0x149881[_0x582431[_0x6212('0x40')]]={'$like':'%'+_0x3c98a4[_0x6212('0x4a')][_0x6212('0x52')]+'%'};return _0x149881;}})});}_0x5e4211=_['merge']({},_0x5e4211,_0x3c98a4['options']);var _0x13e813={'where':_0x5e4211['where']};return db[_0x6212('0x45')]['count'](_0x13e813)[_0x6212('0x3c')](function(_0x2fb91f){_0x452298['count']=_0x2fb91f;if(_0x3c98a4[_0x6212('0x4a')]['includeAll']){_0x5e4211[_0x6212('0x54')]=[{'all':!![]}];}return db['ChatWebsite'][_0x6212('0x55')](_0x5e4211);})[_0x6212('0x3c')](function(_0x3cd6c4){_0x452298[_0x6212('0x56')]=_0x3cd6c4;return _0x452298;})[_0x6212('0x3c')](respondWithFilteredResult(_0x53de3c,_0x5e4211))['catch'](handleError(_0x53de3c,null));};exports[_0x6212('0x57')]=function(_0x536485,_0x29d2ad){var _0x3a2d6e={'raw':![],'where':{'id':_0x536485[_0x6212('0x58')]['id']},'include':[{'model':db[_0x6212('0x42')],'as':_0x6212('0x43')}]},_0x51e096={};_0x51e096[_0x6212('0x4d')]=_['keys'](db[_0x6212('0x45')]['rawAttributes']);_0x51e096[_0x6212('0x4a')]=_[_0x6212('0x59')](_0x536485[_0x6212('0x4a')]);_0x51e096[_0x6212('0x5a')]=_['intersection'](_0x51e096[_0x6212('0x4d')],_0x51e096[_0x6212('0x4a')]);_0x3a2d6e[_0x6212('0x4c')]=_[_0x6212('0x4b')](_0x51e096['model'],qs[_0x6212('0x4e')](_0x536485['query'][_0x6212('0x4e')]));_0x3a2d6e['attributes']=_0x3a2d6e['attributes'][_0x6212('0x5b')]?_0x3a2d6e[_0x6212('0x4c')]:_0x51e096['model'];if(_0x536485[_0x6212('0x4a')][_0x6212('0x5c')]){_0x3a2d6e[_0x6212('0x54')]=[{'all':!![]}];}_0x3a2d6e=_[_0x6212('0x5d')]({},_0x3a2d6e,_0x536485[_0x6212('0x5e')]);return db['ChatWebsite'][_0x6212('0x5f')](_0x3a2d6e)['then'](handleEntityNotFound(_0x29d2ad,null))[_0x6212('0x3c')](respondWithResult(_0x29d2ad,null))[_0x6212('0x60')](handleError(_0x29d2ad,null));};exports[_0x6212('0x61')]=function(_0x5b851d,_0x6b4df5){return db[_0x6212('0x45')]['create'](_0x5b851d[_0x6212('0x62')],{})[_0x6212('0x3c')](function(_0x124201){var _0x3dbaeb=_0x5b851d[_0x6212('0x63')]['get']({'plain':!![]});if(!_0x3dbaeb)throw new Error(_0x6212('0x64'));if(_0x3dbaeb[_0x6212('0x65')]===_0x6212('0x63')){var _0xe631a4=_0x124201[_0x6212('0x3d')]({'plain':!![]});var _0xbd330f=_0x6212('0x3e');return db[_0x6212('0x66')][_0x6212('0x5f')]({'where':{'name':_0xbd330f,'userProfileId':_0x3dbaeb[_0x6212('0x67')]},'raw':!![]})[_0x6212('0x3c')](function(_0x5cdd73){if(_0x5cdd73&&_0x5cdd73[_0x6212('0x68')]===0x0){return db['UserProfileResource'][_0x6212('0x61')]({'name':_0xe631a4[_0x6212('0x40')],'resourceId':_0xe631a4['id'],'type':_0x5cdd73[_0x6212('0x40')],'sectionId':_0x5cdd73['id']},{})['then'](function(){return _0x124201;});}else{return _0x124201;}})[_0x6212('0x60')](function(_0x172a0e){logger[_0x6212('0x2c')](_0x6212('0x69'),_0x172a0e);throw _0x172a0e;});}return _0x124201;})[_0x6212('0x3c')](respondWithResult(_0x6b4df5,0xc9))[_0x6212('0x60')](handleError(_0x6b4df5,null));};exports[_0x6212('0x6a')]=function(_0x2e7cc0,_0x482108){if(_0x2e7cc0[_0x6212('0x62')]['id']){delete _0x2e7cc0[_0x6212('0x62')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x2e7cc0[_0x6212('0x58')]['id']},'include':[{'model':db[_0x6212('0x42')],'as':_0x6212('0x43')}]})['then'](handleEntityNotFound(_0x482108,null))[_0x6212('0x3c')](saveUpdates(_0x2e7cc0[_0x6212('0x62')],null))[_0x6212('0x3c')](respondWithResult(_0x482108,null))[_0x6212('0x60')](handleError(_0x482108,null));};exports['destroy']=function(_0x17416f,_0x317548){return db[_0x6212('0x45')][_0x6212('0x5f')]({'where':{'id':_0x17416f[_0x6212('0x58')]['id']}})[_0x6212('0x3c')](handleEntityNotFound(_0x317548,null))['then'](removeEntity(_0x317548,null))['catch'](handleError(_0x317548,null));};exports[_0x6212('0x6b')]=function(_0x543389,_0x4b5154){return db[_0x6212('0x45')][_0x6212('0x6b')]()[_0x6212('0x3c')](respondWithResult(_0x4b5154,null))[_0x6212('0x60')](handleError(_0x4b5154,null));};exports[_0x6212('0x6c')]=function(_0x30cdec,_0x33bc2b,_0x226328){if(_0x30cdec[_0x6212('0x62')]['id']){delete _0x30cdec['body']['id'];}return db[_0x6212('0x45')]['find']({'where':{'id':_0x30cdec[_0x6212('0x58')]['id']}})[_0x6212('0x3c')](handleEntityNotFound(_0x33bc2b,null))[_0x6212('0x3c')](function(_0xd1412d){if(_0xd1412d){_0x30cdec[_0x6212('0x62')][_0x6212('0x6d')]=_0xd1412d['id'];return db['Disposition']['create'](_0x30cdec['body']);}})[_0x6212('0x3c')](respondWithResult(_0x33bc2b,null))[_0x6212('0x60')](handleError(_0x33bc2b,null));};exports[_0x6212('0x6e')]=function(_0x35c0a2,_0x37acb6,_0xe77676){var _0x53f15a={'raw':![],'where':{}};var _0x87436a={};var _0x46169e={'count':0x0,'rows':[]};return db[_0x6212('0x45')][_0x6212('0x6f')]({'where':{'id':_0x35c0a2['params']['id']}})[_0x6212('0x3c')](handleEntityNotFound(_0x37acb6,null))[_0x6212('0x3c')](function(_0x58a4c5){if(_0x58a4c5){_0x87436a[_0x6212('0x4d')]=_['keys'](db[_0x6212('0x70')][_0x6212('0x46')]);_0x87436a[_0x6212('0x4a')]=_[_0x6212('0x59')](_0x35c0a2[_0x6212('0x4a')]);_0x87436a[_0x6212('0x5a')]=_[_0x6212('0x4b')](_0x87436a[_0x6212('0x4d')],_0x87436a[_0x6212('0x4a')]);_0x53f15a['attributes']=_[_0x6212('0x4b')](_0x87436a['model'],qs[_0x6212('0x4e')](_0x35c0a2['query'][_0x6212('0x4e')]));_0x53f15a['attributes']=_0x53f15a[_0x6212('0x4c')][_0x6212('0x5b')]?_0x53f15a[_0x6212('0x4c')]:_0x87436a['model'];if(!_0x35c0a2[_0x6212('0x4a')]['hasOwnProperty'](_0x6212('0x4f'))){_0x53f15a[_0x6212('0x35')]=qs[_0x6212('0x35')](_0x35c0a2[_0x6212('0x4a')][_0x6212('0x35')]);_0x53f15a[_0x6212('0x34')]=qs[_0x6212('0x34')](_0x35c0a2[_0x6212('0x4a')][_0x6212('0x34')]);}_0x53f15a[_0x6212('0x50')]=qs[_0x6212('0x51')](_0x35c0a2[_0x6212('0x4a')]['sort']);_0x53f15a[_0x6212('0x71')]=qs[_0x6212('0x5a')](_[_0x6212('0x72')](_0x35c0a2[_0x6212('0x4a')],_0x87436a['filters']));_0x53f15a[_0x6212('0x71')][_0x6212('0x6d')]=_0x58a4c5['id'];if(_0x35c0a2[_0x6212('0x4a')][_0x6212('0x52')]){_0x53f15a[_0x6212('0x71')]=_[_0x6212('0x5d')](_0x53f15a[_0x6212('0x71')],{'$or':_[_0x6212('0x44')](_0x53f15a['attributes'],function(_0x36e42f){var _0x623101={};_0x623101[_0x36e42f]={'$like':'%'+_0x35c0a2[_0x6212('0x4a')][_0x6212('0x52')]+'%'};return _0x623101;})});}_0x53f15a=_[_0x6212('0x5d')]({},_0x53f15a,_0x35c0a2['options']);return db['Disposition'][_0x6212('0x73')]({'where':_0x53f15a[_0x6212('0x71')]})[_0x6212('0x3c')](function(_0x58fdc7){_0x46169e[_0x6212('0x73')]=_0x58fdc7;if(_0x35c0a2[_0x6212('0x4a')][_0x6212('0x5c')]){_0x53f15a[_0x6212('0x54')]=[{'all':!![]}];}return db[_0x6212('0x70')][_0x6212('0x55')](_0x53f15a);})[_0x6212('0x3c')](function(_0x24692e){_0x46169e[_0x6212('0x56')]=_0x24692e;return _0x46169e;});}})[_0x6212('0x3c')](respondWithFilteredResult(_0x37acb6,_0x53f15a))[_0x6212('0x60')](handleError(_0x37acb6,null));};exports[_0x6212('0x74')]=function(_0x426c96,_0x513862,_0x2f2bb0){return db[_0x6212('0x45')]['find']({'where':{'id':_0x426c96[_0x6212('0x58')]['id']}})['then'](handleEntityNotFound(_0x513862,null))['then'](function(_0x2ecb13){if(_0x2ecb13){return _0x2ecb13[_0x6212('0x74')](_0x426c96[_0x6212('0x4a')][_0x6212('0x75')]);}})[_0x6212('0x3c')](respondWithStatusCode(_0x513862,null))[_0x6212('0x60')](handleError(_0x513862,null));};exports[_0x6212('0x76')]=function(_0x3355e2,_0x32dc78,_0x3dd82e){if(_0x3355e2[_0x6212('0x62')]['id']){delete _0x3355e2[_0x6212('0x62')]['id'];}return db[_0x6212('0x45')][_0x6212('0x5f')]({'where':{'id':_0x3355e2[_0x6212('0x58')]['id']}})[_0x6212('0x3c')](handleEntityNotFound(_0x32dc78,null))[_0x6212('0x3c')](function(_0x130380){if(_0x130380){_0x3355e2[_0x6212('0x62')]['ChatWebsiteId']=_0x130380['id'];return db['CannedAnswer'][_0x6212('0x61')](_0x3355e2[_0x6212('0x62')]);}})[_0x6212('0x3c')](respondWithResult(_0x32dc78,null))['catch'](handleError(_0x32dc78,null));};exports[_0x6212('0x77')]=function(_0xccb316,_0x59dc74,_0x2c5c08){var _0x31e843={'raw':![],'where':{}};var _0x3c70b2={};var _0x4e7baa={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6212('0x6f')]({'where':{'id':_0xccb316[_0x6212('0x58')]['id']}})[_0x6212('0x3c')](handleEntityNotFound(_0x59dc74,null))['then'](function(_0x5deec7){if(_0x5deec7){_0x3c70b2['model']=_['keys'](db[_0x6212('0x78')]['rawAttributes']);_0x3c70b2['query']=_['keys'](_0xccb316[_0x6212('0x4a')]);_0x3c70b2[_0x6212('0x5a')]=_[_0x6212('0x4b')](_0x3c70b2[_0x6212('0x4d')],_0x3c70b2[_0x6212('0x4a')]);_0x31e843['attributes']=_[_0x6212('0x4b')](_0x3c70b2[_0x6212('0x4d')],qs[_0x6212('0x4e')](_0xccb316[_0x6212('0x4a')][_0x6212('0x4e')]));_0x31e843[_0x6212('0x4c')]=_0x31e843[_0x6212('0x4c')][_0x6212('0x5b')]?_0x31e843['attributes']:_0x3c70b2[_0x6212('0x4d')];if(!_0xccb316[_0x6212('0x4a')][_0x6212('0x79')](_0x6212('0x4f'))){_0x31e843[_0x6212('0x35')]=qs['limit'](_0xccb316[_0x6212('0x4a')][_0x6212('0x35')]);_0x31e843[_0x6212('0x34')]=qs[_0x6212('0x34')](_0xccb316[_0x6212('0x4a')]['offset']);}_0x31e843[_0x6212('0x50')]=qs[_0x6212('0x51')](_0xccb316[_0x6212('0x4a')][_0x6212('0x51')]);_0x31e843[_0x6212('0x71')]=qs[_0x6212('0x5a')](_[_0x6212('0x72')](_0xccb316[_0x6212('0x4a')],_0x3c70b2[_0x6212('0x5a')]));_0x31e843[_0x6212('0x71')][_0x6212('0x6d')]=_0x5deec7['id'];if(_0xccb316['query']['filter']){_0x31e843[_0x6212('0x71')]=_[_0x6212('0x5d')](_0x31e843[_0x6212('0x71')],{'$or':_[_0x6212('0x44')](_0x31e843[_0x6212('0x4c')],function(_0x55c664){var _0x59803e={};_0x59803e[_0x55c664]={'$like':'%'+_0xccb316['query'][_0x6212('0x52')]+'%'};return _0x59803e;})});}_0x31e843=_['merge']({},_0x31e843,_0xccb316[_0x6212('0x5e')]);return db[_0x6212('0x78')][_0x6212('0x73')]({'where':_0x31e843[_0x6212('0x71')]})[_0x6212('0x3c')](function(_0x6c0a83){_0x4e7baa['count']=_0x6c0a83;if(_0xccb316[_0x6212('0x4a')][_0x6212('0x5c')]){_0x31e843[_0x6212('0x54')]=[{'all':!![]}];}return db[_0x6212('0x78')]['findAll'](_0x31e843);})[_0x6212('0x3c')](function(_0x101238){_0x4e7baa[_0x6212('0x56')]=_0x101238;return _0x4e7baa;});}})[_0x6212('0x3c')](respondWithFilteredResult(_0x59dc74,_0x31e843))[_0x6212('0x60')](handleError(_0x59dc74,null));};exports['removeAnswers']=function(_0x925835,_0x2a9a71,_0x33cd2d){return db[_0x6212('0x45')]['find']({'where':{'id':_0x925835[_0x6212('0x58')]['id']}})[_0x6212('0x3c')](handleEntityNotFound(_0x2a9a71,null))[_0x6212('0x3c')](function(_0x43c6b5){if(_0x43c6b5){return _0x43c6b5['removeAnswers'](_0x925835['query']['ids']);}})[_0x6212('0x3c')](respondWithStatusCode(_0x2a9a71,null))['catch'](handleError(_0x2a9a71,null));};exports[_0x6212('0x7a')]=function(_0x574613,_0x238111,_0x1ffaf6){_0x574613[_0x6212('0x62')][_0x6212('0x7b')]=_0x574613[_0x6212('0x7c')][_0x6212('0x7d')];return db[_0x6212('0x45')][_0x6212('0x5f')]({'where':{'id':_0x574613[_0x6212('0x58')]['id']}})[_0x6212('0x3c')](handleEntityNotFound(_0x238111,null))[_0x6212('0x3c')](saveUpdates(_0x574613['body'],null))[_0x6212('0x3c')](respondWithResult(_0x238111,null))[_0x6212('0x60')](handleError(_0x238111,null));};exports[_0x6212('0x7e')]=function(_0x22b322,_0x444fe5,_0x71a266){_0x22b322[_0x6212('0x62')][_0x6212('0x7f')]=_0x22b322[_0x6212('0x7c')][_0x6212('0x7d')];return db[_0x6212('0x45')][_0x6212('0x5f')]({'where':{'id':_0x22b322['params']['id']}})[_0x6212('0x3c')](handleEntityNotFound(_0x444fe5,null))[_0x6212('0x3c')](saveUpdates(_0x22b322[_0x6212('0x62')],null))[_0x6212('0x3c')](respondWithResult(_0x444fe5,null))[_0x6212('0x60')](handleError(_0x444fe5,null));};exports[_0x6212('0x80')]=function(_0x3a2a5f,_0x30c2be,_0xe74b58){_0x3a2a5f[_0x6212('0x62')][_0x6212('0x81')]=_0x3a2a5f[_0x6212('0x7c')][_0x6212('0x7d')];return db[_0x6212('0x45')][_0x6212('0x5f')]({'where':{'id':_0x3a2a5f['params']['id']}})[_0x6212('0x3c')](handleEntityNotFound(_0x30c2be,null))[_0x6212('0x3c')](saveUpdates(_0x3a2a5f[_0x6212('0x62')],null))[_0x6212('0x3c')](respondWithResult(_0x30c2be,null))[_0x6212('0x60')](handleError(_0x30c2be,null));};exports[_0x6212('0x82')]=function(_0x513d4b,_0x2cf785,_0x240dbf){_0x513d4b['body']['systemAvatar']=_0x513d4b[_0x6212('0x7c')][_0x6212('0x7d')];return db[_0x6212('0x45')][_0x6212('0x5f')]({'where':{'id':_0x513d4b[_0x6212('0x58')]['id']}})['then'](handleEntityNotFound(_0x2cf785,null))[_0x6212('0x3c')](saveUpdates(_0x513d4b[_0x6212('0x62')],null))[_0x6212('0x3c')](respondWithResult(_0x2cf785,null))[_0x6212('0x60')](handleError(_0x2cf785,null));};exports[_0x6212('0x83')]=function(_0x259d00,_0x9523e9,_0x49a8d9){var _0x15a7c1=path['join'](config[_0x6212('0x84')],_0x6212('0x85'));var _0x1ebdfa={'where':{'id':_0x259d00[_0x6212('0x58')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x43d605=![];return require(_0x6212('0x86'))['getLicense']()['then'](function(_0x16b8ae){if(_0x16b8ae){_0x43d605=_0x16b8ae[_0x6212('0x87')];}})[_0x6212('0x3c')](function(){return db[_0x6212('0x45')][_0x6212('0x5f')](_0x1ebdfa);})['then'](handleEntityNotFound(_0x9523e9,null))[_0x6212('0x3c')](function(_0xd6625c){if(_0xd6625c){if(!_[_0x6212('0x88')](_0xd6625c[_0x6212('0x7b')])){if(fs['existsSync'](path[_0x6212('0x89')](config[_0x6212('0x84')],_0x6212('0x8a'),_0xd6625c[_0x6212('0x7b')]))&&_0x43d605){_0x15a7c1=path['join'](config[_0x6212('0x84')],_0x6212('0x8a'),_0xd6625c[_0x6212('0x7b')]);}}return _0x9523e9[_0x6212('0x8b')](_0x15a7c1);}})[_0x6212('0x60')](handleError(_0x9523e9,null));};exports[_0x6212('0x8c')]=function(_0x5412d2,_0xd6862e,_0x27dea1){var _0x406f90=path[_0x6212('0x89')](config[_0x6212('0x84')],_0x6212('0x8d'));var _0x1273ca={'where':{'id':_0x5412d2['params']['id']},'attributes':['id',_0x6212('0x7f')],'raw':!![]};return db[_0x6212('0x45')][_0x6212('0x5f')](_0x1273ca)[_0x6212('0x3c')](handleEntityNotFound(_0xd6862e,null))['then'](function(_0x48ad68){if(_0x48ad68){if(!_['isNil'](_0x48ad68[_0x6212('0x7f')])){if(fs[_0x6212('0x8e')](path[_0x6212('0x89')](config[_0x6212('0x84')],_0x6212('0x8f'),_0x48ad68[_0x6212('0x7f')]))){_0x406f90=path[_0x6212('0x89')](config[_0x6212('0x84')],'server/files/images/avatars/',_0x48ad68['agentAvatar']);}}return _0xd6862e[_0x6212('0x8b')](_0x406f90);}})[_0x6212('0x60')](handleError(_0xd6862e,null));};exports[_0x6212('0x90')]=function(_0x2838ef,_0x117138,_0x5e6b72){var _0x5e8f95=path['join'](config[_0x6212('0x84')],_0x6212('0x91'));var _0x419eae={'where':{'id':_0x2838ef[_0x6212('0x58')]['id']},'attributes':['id',_0x6212('0x81'),'showCustomerAvatar'],'raw':!![]};return db[_0x6212('0x45')][_0x6212('0x5f')](_0x419eae)[_0x6212('0x3c')](handleEntityNotFound(_0x117138,null))['then'](function(_0x2fc669){if(_0x2fc669){if(!_[_0x6212('0x88')](_0x2fc669[_0x6212('0x81')])){if(fs['existsSync'](path[_0x6212('0x89')](config[_0x6212('0x84')],_0x6212('0x8f'),_0x2fc669[_0x6212('0x81')]))&&_0x2fc669[_0x6212('0x92')]){_0x5e8f95=path[_0x6212('0x89')](config[_0x6212('0x84')],_0x6212('0x8f'),_0x2fc669[_0x6212('0x81')]);}}return _0x117138[_0x6212('0x8b')](_0x5e8f95);}})[_0x6212('0x60')](handleError(_0x117138,null));};exports[_0x6212('0x93')]=function(_0x47c980,_0x2da9e9,_0x44e1d8){var _0x45c6e1=path[_0x6212('0x89')](config[_0x6212('0x84')],_0x6212('0x94'));var _0x2afd70={'where':{'id':_0x47c980[_0x6212('0x58')]['id']},'attributes':['id',_0x6212('0x95')],'raw':!![]};return db[_0x6212('0x45')][_0x6212('0x5f')](_0x2afd70)[_0x6212('0x3c')](handleEntityNotFound(_0x2da9e9,null))[_0x6212('0x3c')](function(_0x2a06d5){if(_0x2a06d5){if(!_['isNil'](_0x2a06d5[_0x6212('0x95')])){if(fs['existsSync'](path[_0x6212('0x89')](config[_0x6212('0x84')],'server/files/images/avatars/',_0x2a06d5[_0x6212('0x95')]))){_0x45c6e1=path[_0x6212('0x89')](config[_0x6212('0x84')],_0x6212('0x8f'),_0x2a06d5[_0x6212('0x95')]);}}return _0x2da9e9[_0x6212('0x8b')](_0x45c6e1);}})[_0x6212('0x60')](handleError(_0x2da9e9,null));};exports['notify']=function(_0x146593,_0x5ed82a,_0x4d839e){var _0x216548=require(_0x6212('0x96'));var _0x22aaf8=new _0x216548();var _0x5463bf=_0x22aaf8['setUA'](_0x146593['headers'][_0x6212('0x97')])[_0x6212('0x98')]();var _0x211074={'body':_0x146593['body'],'channel':_0x6212('0x99')};var _0x2ddd79=[];var _0xce8aba=[];var _0x4eb39d={};var _0xfc0d20=![];return db[_0x6212('0x9a')][_0x6212('0x6b')]()[_0x6212('0x3c')](function(_0x4f31e9){if(!_0x4f31e9){throw new db[(_0x6212('0x22'))][(_0x6212('0x23'))]('no\x20available\x20attributes');}_0x2ddd79=_[_0x6212('0x9b')](_[_0x6212('0x59')](_0x4f31e9),['createdAt',_0x6212('0x9c')]);_0xce8aba=_[_0x6212('0x9b')](_[_0x6212('0x59')](_0x4f31e9),['createdAt','updatedAt','CompanyId','ListId']);if(_0x146593[_0x6212('0x62')]['id']){delete _0x146593[_0x6212('0x62')]['id'];}if(_['isNil'](_0x146593['body'][_0x6212('0x9d')])){throw new db[(_0x6212('0x22'))][(_0x6212('0x23'))](_0x6212('0x9e'));}if(_['isNil'](_0x146593[_0x6212('0x62')][_0x6212('0x62')])||_0x146593[_0x6212('0x62')][_0x6212('0x62')]===''){throw new db[(_0x6212('0x22'))][(_0x6212('0x23'))](_0x6212('0x9f'));}if(_[_0x6212('0x88')](_0x146593[_0x6212('0x62')][_0x6212('0xa0')])){throw new db[(_0x6212('0x22'))][(_0x6212('0x23'))](_0x6212('0xa1')+_0xce8aba);}if(!_[_0x6212('0xa2')](_0xce8aba,_0x146593[_0x6212('0x62')]['mapKey'])){throw new db[(_0x6212('0x22'))]['ValidationError'](_0x6212('0xa3')+_0xce8aba);}_0x4eb39d[_0x146593[_0x6212('0x62')][_0x6212('0xa0')]]=_0x146593['body'][_0x6212('0x9d')];})['then'](function(){return db[_0x6212('0x45')][_0x6212('0x5f')]({'where':{'id':_0x146593[_0x6212('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x6212('0xa4'),'include':[{'model':db['CmContact'],'as':_0x6212('0xa5'),'where':_0x4eb39d,'limit':0x1,'order':[[_0x6212('0x9c'),_0x6212('0xa6')]]}]},{'model':db[_0x6212('0xa7')],'as':_0x6212('0xa8')}]});})[_0x6212('0x3c')](handleEntityNotFound(_0x5ed82a,null))[_0x6212('0x3c')](function(_0x219785){if(_0x219785&&_0x219785[_0x6212('0xa4')]){_0x211074[_0x6212('0xa9')]=_0x219785;_0x211074[_0x6212('0xaa')]=_0x219785[_0x6212('0xa8')];_0x211074[_0x6212('0xab')]=_0x219785[_0x6212('0xa4')];_0x211074['applications']=_['orderBy'](_0x211074[_0x6212('0xaa')],['priority'],[_0x6212('0xac')]);if(_0x211074[_0x6212('0xa9')][_0x6212('0xa8')]){delete _0x211074[_0x6212('0xa9')][_0x6212('0xa8')];}if(_0x211074['account'][_0x6212('0xa4')]&&_0x211074['account'][_0x6212('0xa4')][_0x6212('0xa5')][_0x6212('0x5b')]){return _0x211074['account'][_0x6212('0xa4')][_0x6212('0xa5')][0x0];}var _0x1d12ca=_[_0x6212('0x1a')](_0x146593['body'],{'firstName':_0x146593['body'][_0x6212('0x9d')],'ListId':_0x219785['ListId']});_0x1d12ca[_0x146593[_0x6212('0x62')][_0x6212('0xa0')]]=_0x146593[_0x6212('0x62')][_0x6212('0x9d')];return db['CmContact'][_0x6212('0x61')](_0x1d12ca,{'fields':_0x2ddd79,'raw':!![]});}})[_0x6212('0x3c')](handleEntityNotFound(_0x5ed82a,null))[_0x6212('0x3c')](function(_0x6d1741){_0x211074['contact']=_0x6d1741;var _0x38f897=_0x146593[_0x6212('0x62')][_0x6212('0xad')];if(_0x146593[_0x6212('0xae')][_0x6212('0xaf')]){_0x38f897=_0x146593[_0x6212('0xae')][_0x6212('0xaf')];}else if(_0x146593[_0x6212('0xae')][_0x6212('0xb0')]){_0x38f897=_[_0x6212('0xb1')](_0x146593[_0x6212('0xae')][_0x6212('0xb0')][_0x6212('0xb2')](','));}if(_0x6d1741){var _0xcb6959={'ContactId':_0x6d1741['id'],'ChatWebsiteId':_0x146593[_0x6212('0x58')]['id'],'from':(_0x6d1741[_0x6212('0xb3')]||'')+'\x20'+(_0x6d1741[_0x6212('0xb4')]||''),'customerIp':_0x38f897,'customerPort':_0x146593['headers']['x-real-port']?_0x146593[_0x6212('0xae')][_0x6212('0xb5')]:null,'referer':_0x146593[_0x6212('0x62')]['referer'],'browserName':_0x5463bf['browser']['name']&&_0x5463bf[_0x6212('0xb6')]['version']?util['format']('%s\x20%s',_0x5463bf[_0x6212('0xb6')][_0x6212('0x40')],_0x5463bf[_0x6212('0xb6')]['version']):'unknown','browserVersion':_0x5463bf[_0x6212('0xb6')][_0x6212('0xb7')]||_0x6212('0xb8'),'osName':util[_0x6212('0xb9')](_0x6212('0xba'),_0x5463bf['os'][_0x6212('0x40')],_0x5463bf['os'][_0x6212('0xb7')]),'osVersion':_0x5463bf['os'][_0x6212('0xb7')],'deviceModel':_0x5463bf[_0x6212('0xbb')]['model']&&_0x5463bf[_0x6212('0xbb')]['vendor']?util[_0x6212('0xb9')](_0x6212('0xbc'),_0x5463bf[_0x6212('0xbb')][_0x6212('0x4d')],_0x5463bf[_0x6212('0xbb')][_0x6212('0xbd')],_0x5463bf['device'][_0x6212('0x48')]):null,'deviceVendor':_0x5463bf[_0x6212('0xbb')]['vendor'],'deviceType':_0x5463bf[_0x6212('0xbb')]['type'],'formData':JSON[_0x6212('0x2b')](_0x146593[_0x6212('0x62')])};var _0x400965={'ChatWebsiteId':_0x146593[_0x6212('0x58')]['id'],'closed':![]};if(_0x146593[_0x6212('0x62')][_0x6212('0xbe')]){_0x400965[_0x6212('0xbe')]=_0x146593['body'][_0x6212('0xbe')];return db['ChatInteraction']['find']({'where':_0x400965})[_0x6212('0x3c')](function(_0x1176a2){if(_0x1176a2){return[_0x1176a2,![]];}_0xcb6959['threadId']=_0x146593[_0x6212('0x62')]['threadId'];_0xcb6959[_0x6212('0xbf')]=_0x146593[_0x6212('0x62')]['externalUrl'];return db[_0x6212('0xc0')][_0x6212('0x61')](_0xcb6959)['then'](function(_0x3997b6){return[_0x3997b6,!![]];});});}_0x400965[_0x6212('0xc1')]=_0x6d1741['id'];if(_0x146593['body'][_0x6212('0xc2')]&&_0x146593[_0x6212('0x62')][_0x6212('0xc2')]['id']){_0x400965['id']=_0x146593[_0x6212('0x62')][_0x6212('0xc2')]['id'];return db[_0x6212('0xc0')][_0x6212('0x5f')]({'where':_0x400965})['then'](function(_0x10ad00){if(_0x10ad00){return[_0x10ad00,![]];}return db[_0x6212('0xc0')][_0x6212('0x61')](_0xcb6959)['then'](function(_0x3f2e42){return[_0x3f2e42,!![]];});});}return db[_0x6212('0xc0')][_0x6212('0x61')](_0xcb6959)[_0x6212('0x3c')](function(_0x5ad1dc){return[_0x5ad1dc,!![]];});}})[_0x6212('0xc3')](function(_0x982a59,_0x7fa7b8){if(_0x982a59){_0xfc0d20=_0x7fa7b8;if(!_0x7fa7b8){var _0x18be31={'from':(_0x211074[_0x6212('0xc4')][_0x6212('0xb3')]||'')+'\x20'+(_0x211074[_0x6212('0xc4')]['lastName']||'')};if(_0x146593[_0x6212('0x62')][_0x6212('0xbe')]&&_0x146593[_0x6212('0x62')][_0x6212('0xc5')]&&_0x146593['body'][_0x6212('0xbe')]!=_0x146593[_0x6212('0x62')][_0x6212('0xc5')]){_0x18be31[_0x6212('0xbe')]=_0x146593[_0x6212('0x62')]['messageId'];}return _0x982a59[_0x6212('0x6a')](_0x18be31);}else{return _0x982a59;}}})[_0x6212('0x3c')](function(_0x10127f){_0x211074[_0x6212('0xc2')]=_0x10127f['get']({'plain':!![]});_0x211074['interaction']['created']=_0xfc0d20;if(_0x211074[_0x6212('0xc2')]['created']){if(_0x211074['account'][_0x6212('0xc6')]){_0x211074[_0x6212('0xaa')][_0x6212('0xc7')]({'id':0x0,'priority':_0x211074['applications'][_0x6212('0x5b')]+0x1,'app':_0x6212('0xc8'),'appdata':_0x6212('0xc9'),'interval':'*,*,*,*'});}}return db['ChatMessage']['create']({'body':_0x146593['body']['body'],'ChatWebsiteId':_0x146593['params']['id'],'ChatInteractionId':_0x10127f['id'],'direction':'in','ContactId':_0x211074['contact']['id'],'AttachmentId':_0x146593[_0x6212('0x62')][_0x6212('0xca')]});})[_0x6212('0x3c')](function(_0x52f4da){_0x211074[_0x6212('0x2e')]=_0x52f4da;if(_0x211074[_0x6212('0xc2')][_0x6212('0xcb')]){return db[_0x6212('0xcc')][_0x6212('0x5f')]({'attributes':['id',_0x6212('0x40')],'where':{'id':_0x211074[_0x6212('0xc2')]['UserId']}})['then'](function(_0x132dd7){if(_0x132dd7){_0x211074['applications'][_0x6212('0xcd')]({'id':0x0,'priority':0x0,'app':_0x6212('0xce'),'appdata':_0x132dd7['name']+','+(_0x211074[_0x6212('0xa9')]['waitForTheAssignedAgent']||0xa),'interval':_0x6212('0xcf')});_0x211074['forcedOwnership']=!![];}return respondWithRpcPromise(_0x6212('0xd0'),_0x6212('0xd1'),_0x211074);});}return respondWithRpcPromise(_0x6212('0xd0'),_0x6212('0xd1'),_0x211074);})[_0x6212('0x3c')](function(_0x3ecf50){respondWithRpcPromise(_0x6212('0xd2'),'EventManager',{'event':_0x6212('0xd3'),'message':_0x3ecf50},client9002);return _0x3ecf50;})['then'](respondWithResult(_0x5ed82a,null))[_0x6212('0x60')](handleError(_0x5ed82a,null));};exports[_0x6212('0xd4')]=function(_0x5e6e4f,_0x455404,_0x10fd9e){var _0x464f06,_0x289071,_0x19110e;var _0x33000c=[];var _0x38bb8b=[];var _0x20c8aa={};return db[_0x6212('0x9a')][_0x6212('0x6b')]()[_0x6212('0x3c')](function(_0x44e83e){if(!_0x44e83e){throw new db[(_0x6212('0x22'))][(_0x6212('0x23'))]('no\x20available\x20attributes');}_0x38bb8b=_[_0x6212('0x9b')](_[_0x6212('0x59')](_0x44e83e),[_0x6212('0xd5'),_0x6212('0x9c')]);_0x33000c=_[_0x6212('0x9b')](_[_0x6212('0x59')](_0x44e83e),[_0x6212('0xd5'),_0x6212('0x9c'),_0x6212('0xd6'),_0x6212('0xd7')]);if(_0x5e6e4f[_0x6212('0x62')]['id']){delete _0x5e6e4f[_0x6212('0x62')]['id'];}if(_['isNil'](_0x5e6e4f[_0x6212('0x62')]['from'])){throw _0x455404[_0x6212('0x31')](0x1f4)[_0x6212('0x41')](new db['Sequelize'][(_0x6212('0x23'))](_0x6212('0x9e')));}if(_['isNil'](_0x5e6e4f[_0x6212('0x62')][_0x6212('0x62')])||_0x5e6e4f[_0x6212('0x62')][_0x6212('0x62')]===''){throw _0x455404[_0x6212('0x31')](0x1f4)[_0x6212('0x41')](new db[(_0x6212('0x22'))][(_0x6212('0x23'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x6212('0x88')](_0x5e6e4f['body'][_0x6212('0xd8')])){throw _0x455404[_0x6212('0x31')](0x1f4)[_0x6212('0x41')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x33000c));}if(!_[_0x6212('0xa2')](_0x33000c,_0x5e6e4f[_0x6212('0x62')][_0x6212('0xd8')])){throw _0x455404[_0x6212('0x31')](0x1f4)['send'](new db['Sequelize']['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x33000c));}_0x20c8aa[_0x5e6e4f[_0x6212('0x62')][_0x6212('0xd8')]]=_0x5e6e4f[_0x6212('0x62')][_0x6212('0x9d')];})['then'](function(){return db['ChatWebsite'][_0x6212('0x5f')]({'where':{'id':_0x5e6e4f['params']['id']},'include':[{'model':db[_0x6212('0xd9')],'as':_0x6212('0xa4')}]});})[_0x6212('0x3c')](handleEntityNotFound(_0x455404,null))[_0x6212('0x3c')](function(_0x3231cf){if(_0x3231cf&&_0x3231cf[_0x6212('0xa4')]){_0x289071=_0x3231cf;var _0x133a2b=_['defaults'](_0x5e6e4f['body'],{'firstName':_0x5e6e4f[_0x6212('0x62')]['from'],'phone':_0x5e6e4f[_0x6212('0x62')][_0x6212('0x9d')],'ListId':_0x3231cf[_0x6212('0xd7')]});_0x133a2b[_0x5e6e4f[_0x6212('0x62')]['mapKeyOffline']]=_0x5e6e4f['body'][_0x6212('0x9d')];return db['CmContact'][_0x6212('0xda')]({'where':_0x20c8aa,'defaults':_0x133a2b});}})[_0x6212('0xc3')](function(_0x542b32){if(_0x542b32){_0x19110e=_0x542b32;var _0x3c88b7=fs[_0x6212('0xdb')](path[_0x6212('0x89')](config[_0x6212('0x84')],_0x6212('0xdc')),_0x6212('0xdd'));var _0x3f8baf=ejs[_0x6212('0xde')](_0x3c88b7,{'body':_[_0x6212('0xdf')](_0x5e6e4f[_0x6212('0x62')][_0x6212('0x62')]),'bodyTitle':_0x289071[_0x6212('0xe0')]});return db[_0x6212('0xe1')][_0x6212('0x61')]({'body':_0x3f8baf,'ContactId':_0x542b32['id'],'ChatWebsiteId':_0x289071['id']});}})['then'](function(_0x29aeaa){if(_0x29aeaa){_0x464f06=_0x29aeaa;return db[_0x6212('0xe2')][_0x6212('0x6f')]({'where':{'service':!![]},'include':[{'model':db[_0x6212('0xe3')],'as':_0x6212('0xe4'),'raw':!![]}]});}})['then'](function(_0x65f9a5){if(_0x65f9a5&&_0x65f9a5['Smtp']&&_0x289071[_0x6212('0xe5')]){var _0x5e28c7={'tls':{'rejectUnauthorized':![]}};if(_0x65f9a5[_0x6212('0xe4')][_0x6212('0xe6')]){_0x5e28c7['service']=_0x65f9a5[_0x6212('0xe4')][_0x6212('0xe6')];}else{_0x5e28c7[_0x6212('0xe7')]=_0x65f9a5[_0x6212('0xe4')][_0x6212('0xe7')];_0x5e28c7['port']=_0x65f9a5[_0x6212('0xe4')][_0x6212('0xe8')];_0x5e28c7[_0x6212('0xe9')]=_0x65f9a5['Smtp']['secure'];}if(_0x65f9a5['Smtp'][_0x6212('0xea')]){_0x5e28c7[_0x6212('0xeb')]={'user':_0x65f9a5[_0x6212('0xe4')][_0x6212('0x63')],'pass':_0x65f9a5[_0x6212('0xe4')][_0x6212('0xec')]};}return respondWithRpcPromise(_0x6212('0xed'),'sendMail',{'account':_0x5e28c7,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x65f9a5[_0x6212('0x40')],_0x65f9a5[_0x6212('0xee')]||_0x65f9a5[_0x6212('0xe4')][_0x6212('0x63')]),'to':_0x289071['forwardOfflineAddress'],'subject':_0x289071['offlineMessageSubject'],'text':_0x464f06[_0x6212('0x62')]}},client9003)[_0x6212('0x3c')](function(){return _0x464f06;})[_0x6212('0x60')](function(_0x7129){console['error'](_0x7129);});}})[_0x6212('0x3c')](function(){if(_0x464f06){return _0x464f06;}})[_0x6212('0x3c')](respondWithResult(_0x455404,null))[_0x6212('0x60')](handleError(_0x455404,null));};exports[_0x6212('0xef')]=function(_0x2fb970,_0xe27190,_0x484d94){return db[_0x6212('0xc0')][_0x6212('0x5f')]({'where':{'id':_0x2fb970[_0x6212('0x58')]['id']}})[_0x6212('0x3c')](handleEntityNotFound(_0xe27190,null))['then'](function(_0x1c0194){if(_0x1c0194){return _0x1c0194['addInteraction'](_0x2fb970['body'][_0x6212('0x75')],_[_0x6212('0xf0')](_0x2fb970[_0x6212('0x62')],['ids','id'])||{});}})[_0x6212('0x3c')](respondWithResult(_0xe27190,null))[_0x6212('0x60')](handleError(_0xe27190,null));};exports[_0x6212('0xf1')]=function(_0x364f17,_0x3f40a0,_0x21182b){var _0x4b3fa1={'raw':![],'where':{}};var _0x318614={};var _0x3aa399={'count':0x0,'rows':[]};return db[_0x6212('0x45')][_0x6212('0x6f')]({'where':{'id':_0x364f17[_0x6212('0x58')]['id']}})[_0x6212('0x3c')](handleEntityNotFound(_0x3f40a0,null))[_0x6212('0x3c')](function(_0xd61c2e){if(_0xd61c2e){_0x318614[_0x6212('0x4d')]=_['keys'](db[_0x6212('0xc0')][_0x6212('0x46')]);_0x318614[_0x6212('0x4a')]=_['keys'](_0x364f17[_0x6212('0x4a')]);_0x318614[_0x6212('0x5a')]=_[_0x6212('0x4b')](_0x318614[_0x6212('0x4d')],_0x318614[_0x6212('0x4a')]);_0x4b3fa1['attributes']=_['intersection'](_0x318614[_0x6212('0x4d')],qs[_0x6212('0x4e')](_0x364f17[_0x6212('0x4a')][_0x6212('0x4e')]));_0x4b3fa1['attributes']=_0x4b3fa1[_0x6212('0x4c')]['length']?_0x4b3fa1[_0x6212('0x4c')]:_0x318614[_0x6212('0x4d')];if(!_0x364f17['query'][_0x6212('0x79')](_0x6212('0x4f'))){_0x4b3fa1[_0x6212('0x35')]=qs[_0x6212('0x35')](_0x364f17[_0x6212('0x4a')][_0x6212('0x35')]);_0x4b3fa1[_0x6212('0x34')]=qs[_0x6212('0x34')](_0x364f17[_0x6212('0x4a')][_0x6212('0x34')]);}_0x4b3fa1[_0x6212('0x50')]=qs['sort'](_0x364f17['query'][_0x6212('0x51')]);_0x4b3fa1[_0x6212('0x71')]=qs[_0x6212('0x5a')](_[_0x6212('0x72')](_0x364f17[_0x6212('0x4a')],_0x318614['filters']));_0x4b3fa1[_0x6212('0x71')]['ChatWebsiteId']=_0xd61c2e['id'];if(_0x364f17[_0x6212('0x4a')][_0x6212('0x52')]){_0x4b3fa1[_0x6212('0x71')]=_[_0x6212('0x5d')](_0x4b3fa1[_0x6212('0x71')],{'$or':_['map'](_0x4b3fa1[_0x6212('0x4c')],function(_0x528d22){var _0x44f9a3={};_0x44f9a3[_0x528d22]={'$like':'%'+_0x364f17[_0x6212('0x4a')][_0x6212('0x52')]+'%'};return _0x44f9a3;})});}_0x4b3fa1=_['merge']({},_0x4b3fa1,_0x364f17[_0x6212('0x5e')]);return db[_0x6212('0xc0')][_0x6212('0x73')]({'where':_0x4b3fa1[_0x6212('0x71')]})[_0x6212('0x3c')](function(_0x1fbae1){_0x3aa399[_0x6212('0x73')]=_0x1fbae1;if(_0x364f17[_0x6212('0x4a')][_0x6212('0x5c')]){_0x4b3fa1[_0x6212('0x54')]=[{'model':db['CmContact'],'as':_0x6212('0xf2'),'required':![]},{'model':db[_0x6212('0xcc')],'as':_0x6212('0xf3'),'attributes':['name',_0x6212('0xf4'),'internal'],'required':![]},{'model':db[_0x6212('0xf5')],'as':_0x6212('0xf6'),'attributes':['id',_0x6212('0x40'),_0x6212('0xf7')],'where':_0x364f17[_0x6212('0x4a')]['tag']?{'id':_0x364f17[_0x6212('0x4a')][_0x6212('0xf8')]}:undefined,'required':_0x364f17['query']['tag']?!![]:![]}];}return db[_0x6212('0xc0')][_0x6212('0x55')](_0x4b3fa1);})['then'](function(_0x4baeeb){_0x3aa399[_0x6212('0x56')]=_0x4baeeb;return _0x3aa399;});}})[_0x6212('0x3c')](respondWithFilteredResult(_0x3f40a0,_0x4b3fa1))['catch'](handleError(_0x3f40a0,null));};function iftimePromise(_0x3206b6,_0x2e0aaf){return respondWithRpcPromise('Command','getSnippet',{'command':_0x2e0aaf[_0x6212('0xf9')]?util[_0x6212('0xb9')](_0x6212('0xfa'),_0x3206b6['interval'],_0x2e0aaf[_0x6212('0xf9')]):util[_0x6212('0xb9')]('iftime\x20%s',_0x3206b6[_0x6212('0xfb')])},client9002)[_0x6212('0x3c')](function(_0x467338){var _0x35c372=_0x467338&&_0x467338[_0x6212('0xfc')](_0x6212('0xfd'))>=0x0?!![]:![];logger[_0x6212('0x26')](_0x6212('0xfe'),_0x2e0aaf['id'],_0x3206b6['id'],_0x3206b6[_0x6212('0xfb')],_0x35c372?_0x6212('0xff'):'OFFLINE',_0x2e0aaf[_0x6212('0xf9')]?_0x2e0aaf[_0x6212('0xf9')]:_0x6212('0x100'));return _0x35c372;})[_0x6212('0x60')](function(_0x53c3b7){logger[_0x6212('0x2c')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2e0aaf['id'],_0x3206b6['id'],_0x3206b6[_0x6212('0xfb')],util[_0x6212('0x101')](_0x53c3b7,{'showHidden':![],'depth':null}),_0x2e0aaf[_0x6212('0xf9')]?_0x2e0aaf[_0x6212('0xf9')]:'No\x20timezone');return![];});}exports[_0x6212('0x102')]=function(_0x32ef36,_0x47bef9,_0x380e74){var _0xd1a85e=0x0;var _0x1f0234=0x0;var _0x1983ef=![];var _0x4a641a;var _0x573723;return db['ChatWebsite'][_0x6212('0x5f')]({'where':{'id':_0x32ef36[_0x6212('0x58')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x6212('0x103')],'as':_0x6212('0x104'),'attributes':['id',_0x6212('0xfb')],'raw':!![]}]}]})[_0x6212('0x3c')](handleEntityNotFound(_0x47bef9,null))['then'](function(_0x131cfb){if(_0x131cfb){_0x4a641a=_0x131cfb;return _0x131cfb[_0x6212('0x105')]({'raw':!![]});}})[_0x6212('0x3c')](function(_0x380f58){if(_0x4a641a){if(_0x380f58){_0x573723=_0x380f58;}}return require(_0x6212('0x86'))['getLicense']();})[_0x6212('0x3c')](function(_0x88ead){if(_0x88ead){_0x1f0234=_0x88ead[_0x6212('0x106')];_0x1983ef=_0x88ead[_0x6212('0x87')];}})[_0x6212('0x3c')](function(){return db[_0x6212('0xc0')]['count']({'where':{'closed':![]}});})[_0x6212('0x3c')](function(_0x16d03e){_0xd1a85e=_0x16d03e;if(_0x1f0234&&_0x16d03e>_0x1f0234){return db[_0x6212('0x107')]['findOne']({'where':{'id':0x1}})['then'](function(_0x45dc18){if(_0x45dc18){_0x45dc18[_0x6212('0x108')](_0x6212('0x109'));}});}})[_0x6212('0x3c')](function(){if(_0x4a641a[_0x6212('0x103')]&&_0x4a641a[_0x6212('0x103')][_0x6212('0x104')]){var _0x26f2de=[];for(var _0x12dc52=0x0;_0x12dc52<_0x4a641a[_0x6212('0x103')][_0x6212('0x104')][_0x6212('0x5b')];_0x12dc52++){var _0x2da8e3=_0x4a641a['Interval'][_0x6212('0x104')][_0x12dc52][_0x6212('0x3d')]({'plain':!![]});_0x26f2de[_0x6212('0xc7')](iftimePromise(_0x2da8e3,_0x4a641a));}return BPromise['all'](_0x26f2de)['then'](function(_0x287cfd){return _[_0x6212('0x10a')](_0x287cfd);});}else{return!![];}})['then'](function(_0x33fbcb){var _0x4c55ac=fs[_0x6212('0xdb')](path[_0x6212('0x89')](config['root'],_0x6212('0x10b')),_0x6212('0xdd'));var _0x1ff38e={'remote':_0x4a641a[_0x6212('0x10c')],'query':querystring['stringify'](_['merge'](_0x4a641a[_0x6212('0x3d')]({'plain':!![]}),{'customerIp':_0x32ef36[_0x6212('0xae')]['x-forwarded-for']||_0x32ef36[_0x6212('0xae')][_0x6212('0x10d')]||_0x32ef36[_0x6212('0x10e')][_0x6212('0x10f')]||_0x32ef36['ip'],'referer':_0x32ef36[_0x6212('0xae')][_0x6212('0x110')],'openedInteractions':_0xd1a85e,'maxInteractions':_0x1f0234,'virtual':_0x1983ef[_0x6212('0x106')],'online':_0x33fbcb,'custom':_0x1983ef}))['replace'](/'/g,'\x5c\x27')};_0x47bef9['send'](ejs['render'](Mustache[_0x6212('0xde')](_0x4c55ac,_0x1ff38e),{'proactiveActions':_0x573723,'alignment':_0x4a641a[_0x6212('0x111')],'verticalAlignment':_0x4a641a[_0x6212('0x112')],'div_color':_0x4a641a[_0x6212('0xf7')],'text_color':_0x4a641a[_0x6212('0x113')]}));})['catch'](handleError(_0x47bef9,null));};exports[_0x6212('0x114')]=function(_0x4f5377,_0x449818,_0x3f1120){return db['ChatWebsite'][_0x6212('0x6f')]({'where':{'id':_0x4f5377[_0x6212('0x58')]['id']}})['then'](handleEntityNotFound(_0x449818,null))[_0x6212('0x3c')](function(_0x576615){if(_0x576615){return db['sequelize'][_0x6212('0x115')](function(_0x3d0ad1){return db[_0x6212('0xa7')][_0x6212('0x3b')]({'where':{'ChatWebsiteId':_0x4f5377[_0x6212('0x58')]['id']},'transaction':_0x3d0ad1})[_0x6212('0x3c')](function(_0x3a0cd6){var _0x47ce23=_[_0x6212('0x44')](_0x4f5377['body'],function(_0x2855a3){_0x2855a3[_0x6212('0x6d')]=_0x4f5377['params']['id'];return _0x2855a3;});return db[_0x6212('0xa7')][_0x6212('0x116')](_0x47ce23,{'transaction':_0x3d0ad1});});})[_0x6212('0x3c')](function(){return db[_0x6212('0xa7')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4f5377[_0x6212('0x58')]['id']},'order':'priority'});});}})[_0x6212('0x3c')](respondWithResult(_0x449818,null))[_0x6212('0x60')](handleError(_0x449818,null));};exports[_0x6212('0x117')]=function(_0x159e6e,_0x26bc30,_0x3653c6){var _0x31dcc5={};var _0x2df048={};var _0x2c12f9;var _0xb531b5;return db['ChatWebsite'][_0x6212('0x6f')]({'where':{'id':_0x159e6e[_0x6212('0x58')]['id']}})['then'](handleEntityNotFound(_0x26bc30,null))[_0x6212('0x3c')](function(_0x1940ed){if(_0x1940ed){_0x2c12f9=_0x1940ed;_0x2df048[_0x6212('0x4d')]=_[_0x6212('0x59')](db[_0x6212('0xa7')][_0x6212('0x46')]);_0x2df048[_0x6212('0x4a')]=_[_0x6212('0x59')](_0x159e6e[_0x6212('0x4a')]);_0x2df048[_0x6212('0x5a')]=_[_0x6212('0x4b')](_0x2df048[_0x6212('0x4d')],_0x2df048['query']);_0x31dcc5[_0x6212('0x4c')]=_['intersection'](_0x2df048[_0x6212('0x4d')],qs['fields'](_0x159e6e['query'][_0x6212('0x4e')]));_0x31dcc5['attributes']=_0x31dcc5[_0x6212('0x4c')][_0x6212('0x5b')]?_0x31dcc5[_0x6212('0x4c')]:_0x2df048[_0x6212('0x4d')];_0x31dcc5['order']=qs[_0x6212('0x51')](_0x159e6e[_0x6212('0x4a')]['sort']);_0x31dcc5[_0x6212('0x71')]=qs['filters'](_[_0x6212('0x72')](_0x159e6e['query'],_0x2df048[_0x6212('0x5a')]));if(_0x159e6e[_0x6212('0x4a')]['filter']){_0x31dcc5['where']=_['merge'](_0x31dcc5['where'],{'$or':_[_0x6212('0x44')](_0x31dcc5[_0x6212('0x4c')],function(_0x218e7d){var _0x2c9b37={};_0x2c9b37[_0x218e7d]={'$like':'%'+_0x159e6e['query'][_0x6212('0x52')]+'%'};return _0x2c9b37;})});}_0x31dcc5=_['merge']({},_0x31dcc5,_0x159e6e[_0x6212('0x5e')]);return _0x2c12f9['getApplications'](_0x31dcc5);}})[_0x6212('0x3c')](function(_0x12a7e4){if(_0x12a7e4){_0xb531b5=_0x12a7e4[_0x6212('0x5b')];if(!_0x159e6e[_0x6212('0x4a')][_0x6212('0x79')](_0x6212('0x4f'))){_0x31dcc5['limit']=qs[_0x6212('0x35')](_0x159e6e[_0x6212('0x4a')][_0x6212('0x35')]);_0x31dcc5[_0x6212('0x34')]=qs[_0x6212('0x34')](_0x159e6e[_0x6212('0x4a')][_0x6212('0x34')]);}return _0x2c12f9[_0x6212('0x117')](_0x31dcc5);}})[_0x6212('0x3c')](function(_0x2df92d){if(_0x2df92d){return _0x2df92d?{'count':_0xb531b5,'rows':_0x2df92d}:null;}})[_0x6212('0x3c')](respondWithResult(_0x26bc30,null))[_0x6212('0x60')](handleError(_0x26bc30,null));};exports[_0x6212('0x118')]=function(_0x4e6e23,_0x5e47b4,_0x2ca39f){return db['chatProactiveAction'][_0x6212('0x5f')]({'where':{'id':_0x4e6e23['params']['id']}})['then'](handleEntityNotFound(_0x5e47b4,null))[_0x6212('0x3c')](function(_0x452e12){if(_0x452e12){return _0x452e12[_0x6212('0x118')](_0x4e6e23['body'][_0x6212('0x75')],_[_0x6212('0xf0')](_0x4e6e23[_0x6212('0x62')],[_0x6212('0x75'),'id'])||{});}})[_0x6212('0x3c')](respondWithResult(_0x5e47b4,null))[_0x6212('0x60')](handleError(_0x5e47b4,null));};exports[_0x6212('0x105')]=function(_0x179815,_0x598f24,_0x13cf96){var _0x6466a5={};var _0x21d8f2={};var _0x3dbe0a;var _0x13bd26;return db['ChatWebsite'][_0x6212('0x6f')]({'where':{'id':_0x179815[_0x6212('0x58')]['id']}})[_0x6212('0x3c')](handleEntityNotFound(_0x598f24,null))['then'](function(_0x1cb323){if(_0x1cb323){_0x3dbe0a=_0x1cb323;_0x21d8f2['model']=_[_0x6212('0x59')](db[_0x6212('0x119')][_0x6212('0x46')]);_0x21d8f2[_0x6212('0x4a')]=_[_0x6212('0x59')](_0x179815[_0x6212('0x4a')]);_0x21d8f2[_0x6212('0x5a')]=_[_0x6212('0x4b')](_0x21d8f2['model'],_0x21d8f2[_0x6212('0x4a')]);_0x6466a5[_0x6212('0x4c')]=_[_0x6212('0x4b')](_0x21d8f2[_0x6212('0x4d')],qs['fields'](_0x179815[_0x6212('0x4a')][_0x6212('0x4e')]));_0x6466a5[_0x6212('0x4c')]=_0x6466a5[_0x6212('0x4c')][_0x6212('0x5b')]?_0x6466a5[_0x6212('0x4c')]:_0x21d8f2[_0x6212('0x4d')];_0x6466a5['order']=qs[_0x6212('0x51')](_0x179815['query'][_0x6212('0x51')]);_0x6466a5[_0x6212('0x71')]=qs[_0x6212('0x5a')](_[_0x6212('0x72')](_0x179815[_0x6212('0x4a')],_0x21d8f2[_0x6212('0x5a')]));if(_0x179815['query'][_0x6212('0x52')]){_0x6466a5['where']=_[_0x6212('0x5d')](_0x6466a5[_0x6212('0x71')],{'$or':_['map'](_0x6466a5[_0x6212('0x4c')],function(_0x494ad2){var _0x396aad={};_0x396aad[_0x494ad2]={'$like':'%'+_0x179815[_0x6212('0x4a')][_0x6212('0x52')]+'%'};return _0x396aad;})});}_0x6466a5=_[_0x6212('0x5d')]({},_0x6466a5,_0x179815['options']);return _0x3dbe0a[_0x6212('0x105')](_0x6466a5);}})[_0x6212('0x3c')](function(_0xcea99){if(_0xcea99){_0x13bd26=_0xcea99['length'];if(!_0x179815[_0x6212('0x4a')]['hasOwnProperty'](_0x6212('0x4f'))){_0x6466a5[_0x6212('0x35')]=qs[_0x6212('0x35')](_0x179815[_0x6212('0x4a')][_0x6212('0x35')]);_0x6466a5[_0x6212('0x34')]=qs['offset'](_0x179815['query']['offset']);}return _0x3dbe0a['getProactiveActions'](_0x6466a5);}})['then'](function(_0x2bb507){if(_0x2bb507){return _0x2bb507?{'count':_0x13bd26,'rows':_0x2bb507}:null;}})['then'](respondWithResult(_0x598f24,null))[_0x6212('0x60')](handleError(_0x598f24,null));};exports[_0x6212('0x11a')]=function(_0x5ccaa7,_0x31f0ac,_0x3de364){var _0x33ad66=_0x5ccaa7[_0x6212('0x4a')]['online']===_0x6212('0x11b')?_0x6212('0x11c'):_0x6212('0x11d');return db[_0x6212('0x45')][_0x6212('0x5f')]({'attributes':['id',_0x33ad66],'where':{'id':_0x5ccaa7[_0x6212('0x58')]['id']}})[_0x6212('0x3c')](handleEntityNotFound(_0x31f0ac,null))['then'](function(_0x18f32e){if(_0x18f32e){var _0x44cb4a=_0x18f32e[_0x33ad66];var _0x59cbc7=_0x44cb4a&&_0x44cb4a['items']?_0x44cb4a[_0x6212('0x11e')]:[];_0x31f0ac['send']({'fromKey':_[_0x6212('0x88')](_0x44cb4a[_0x6212('0x11f')])?undefined:_0x44cb4a[_0x6212('0x11f')],'count':_0x59cbc7['length'],'rows':_0x59cbc7});}})[_0x6212('0x60')](handleError(_0x31f0ac,null));};exports[_0x6212('0x120')]=function(_0x237ad8,_0x165429,_0xb2c54d){var _0x9b6ce0={'raw':![],'where':{}};var _0x1fbb5e={};var _0x5d1576={'count':0x0,'rows':[]};return db[_0x6212('0x45')][_0x6212('0x6f')]({'where':{'id':_0x237ad8['params']['id']}})['then'](handleEntityNotFound(_0x165429,null))['then'](function(_0x41a0e0){if(_0x41a0e0){_0x1fbb5e[_0x6212('0x4d')]=_[_0x6212('0x59')](db['ChatOfflineMessage'][_0x6212('0x46')]);_0x1fbb5e['query']=_[_0x6212('0x59')](_0x237ad8[_0x6212('0x4a')]);_0x1fbb5e['filters']=_[_0x6212('0x4b')](_0x1fbb5e[_0x6212('0x4d')],_0x1fbb5e['query']);_0x9b6ce0[_0x6212('0x4c')]=_[_0x6212('0x4b')](_0x1fbb5e[_0x6212('0x4d')],qs['fields'](_0x237ad8[_0x6212('0x4a')][_0x6212('0x4e')]));_0x9b6ce0[_0x6212('0x4c')]=_0x9b6ce0[_0x6212('0x4c')][_0x6212('0x5b')]?_0x9b6ce0[_0x6212('0x4c')]:_0x1fbb5e[_0x6212('0x4d')];if(!_0x237ad8[_0x6212('0x4a')][_0x6212('0x79')](_0x6212('0x4f'))){_0x9b6ce0['limit']=qs[_0x6212('0x35')](_0x237ad8['query'][_0x6212('0x35')]);_0x9b6ce0[_0x6212('0x34')]=qs[_0x6212('0x34')](_0x237ad8[_0x6212('0x4a')][_0x6212('0x34')]);}_0x9b6ce0['order']=qs['sort'](_0x237ad8[_0x6212('0x4a')][_0x6212('0x51')]);_0x9b6ce0[_0x6212('0x71')]=qs[_0x6212('0x5a')](_[_0x6212('0x72')](_0x237ad8[_0x6212('0x4a')],_0x1fbb5e[_0x6212('0x5a')]));_0x9b6ce0['where']['ChatWebsiteId']=_0x41a0e0['id'];if(_0x237ad8[_0x6212('0x4a')][_0x6212('0x52')]){_0x9b6ce0[_0x6212('0x71')]=_[_0x6212('0x5d')](_0x9b6ce0[_0x6212('0x71')],{'$or':_[_0x6212('0x44')](_0x9b6ce0[_0x6212('0x4c')],function(_0x585150){var _0x25f8b9={};_0x25f8b9[_0x585150]={'$like':'%'+_0x237ad8[_0x6212('0x4a')][_0x6212('0x52')]+'%'};return _0x25f8b9;})});}_0x9b6ce0=_['merge']({},_0x9b6ce0,_0x237ad8[_0x6212('0x5e')]);return db[_0x6212('0xe1')][_0x6212('0x73')]({'where':_0x9b6ce0['where']})[_0x6212('0x3c')](function(_0x4e3625){_0x5d1576[_0x6212('0x73')]=_0x4e3625;if(_0x237ad8[_0x6212('0x4a')][_0x6212('0x5c')]){_0x9b6ce0[_0x6212('0x54')]=[{'all':!![]}];}else{_0x9b6ce0['include']=[{'model':db[_0x6212('0x9a')],'as':_0x6212('0xf2'),'required':![]}];}return db[_0x6212('0xe1')][_0x6212('0x55')](_0x9b6ce0);})[_0x6212('0x3c')](function(_0x150615){_0x5d1576['rows']=_0x150615;return _0x5d1576;});}})[_0x6212('0x3c')](respondWithFilteredResult(_0x165429,_0x9b6ce0))['catch'](handleError(_0x165429,null));};exports[_0x6212('0x121')]=function(_0x5c027b,_0x5d279b,_0x5b06bc){return db['ChatWebsite'][_0x6212('0x5f')]({'where':{'id':_0x5c027b[_0x6212('0x58')]['id']}})[_0x6212('0x3c')](handleEntityNotFound(_0x5d279b,null))[_0x6212('0x3c')](function(_0x40ed80){if(_0x40ed80){return _0x40ed80[_0x6212('0x121')](_0x5c027b[_0x6212('0x62')][_0x6212('0x75')],_[_0x6212('0xf0')](_0x5c027b[_0x6212('0x62')],['ids','id'])||{})[_0x6212('0xc3')](function(_0x84adb7){for(var _0x41416f=0x0;_0x41416f<_0x5c027b[_0x6212('0x62')][_0x6212('0x75')][_0x6212('0x5b')];_0x41416f+=0x1){socket[_0x6212('0x122')](_0x6212('0x123'),{'UserId':_0x5c027b['body'][_0x6212('0x75')][_0x41416f],'ChatWebsiteId':_0x5c027b[_0x6212('0x58')]['id']});}return _0x84adb7;});}})[_0x6212('0x3c')](respondWithResult(_0x5d279b,null))['catch'](handleError(_0x5d279b,null));};exports[_0x6212('0x124')]=function(_0x3491f8,_0xb5d9f8,_0x58511d){return db[_0x6212('0x45')][_0x6212('0x5f')]({'where':{'id':_0x3491f8[_0x6212('0x58')]['id']}})[_0x6212('0x3c')](handleEntityNotFound(_0xb5d9f8,null))[_0x6212('0x3c')](function(_0x5d0960){if(_0x5d0960){return _0x5d0960[_0x6212('0x124')](_0x3491f8[_0x6212('0x4a')][_0x6212('0x75')])['then'](function(){if(_[_0x6212('0x125')](_0x3491f8[_0x6212('0x4a')][_0x6212('0x75')])){for(var _0x42142a=0x0;_0x42142a<_0x3491f8[_0x6212('0x4a')]['ids'][_0x6212('0x5b')];_0x42142a+=0x1){socket[_0x6212('0x122')](_0x6212('0x126'),{'UserId':Number(_0x3491f8[_0x6212('0x4a')][_0x6212('0x75')][_0x42142a]),'ChatWebsiteId':Number(_0x3491f8['params']['id'])});}}else{socket[_0x6212('0x122')](_0x6212('0x126'),{'UserId':Number(_0x3491f8[_0x6212('0x4a')][_0x6212('0x75')]),'ChatWebsiteId':Number(_0x3491f8[_0x6212('0x58')]['id'])});}});}})[_0x6212('0x3c')](respondWithStatusCode(_0xb5d9f8,null))[_0x6212('0x60')](handleError(_0xb5d9f8,null));};exports[_0x6212('0x127')]=function(_0x8da4f4,_0x47a615,_0x1c0a17){var _0x10a487={};var _0x15ab0b={};var _0x268b9f;var _0x53026e;return db['ChatWebsite'][_0x6212('0x6f')]({'where':{'id':_0x8da4f4[_0x6212('0x58')]['id']}})['then'](handleEntityNotFound(_0x47a615,null))['then'](function(_0x59d332){if(_0x59d332){_0x268b9f=_0x59d332;_0x15ab0b[_0x6212('0x4d')]=_[_0x6212('0x59')](db[_0x6212('0xcc')]['rawAttributes']);_0x15ab0b[_0x6212('0x4a')]=_['keys'](_0x8da4f4['query']);_0x15ab0b[_0x6212('0x5a')]=_[_0x6212('0x4b')](_0x15ab0b[_0x6212('0x4d')],_0x15ab0b[_0x6212('0x4a')]);_0x10a487['attributes']=_[_0x6212('0x4b')](_0x15ab0b['model'],qs['fields'](_0x8da4f4['query']['fields']));_0x10a487['attributes']=_0x10a487['attributes'][_0x6212('0x5b')]?_0x10a487[_0x6212('0x4c')]:_0x15ab0b[_0x6212('0x4d')];_0x10a487[_0x6212('0x50')]=qs[_0x6212('0x51')](_0x8da4f4[_0x6212('0x4a')][_0x6212('0x51')]);_0x10a487[_0x6212('0x71')]=qs[_0x6212('0x5a')](_[_0x6212('0x72')](_0x8da4f4[_0x6212('0x4a')],_0x15ab0b[_0x6212('0x5a')]));if(_0x8da4f4[_0x6212('0x4a')][_0x6212('0x52')]){_0x10a487[_0x6212('0x71')]=_[_0x6212('0x5d')](_0x10a487[_0x6212('0x71')],{'$or':_[_0x6212('0x44')](_0x10a487[_0x6212('0x4c')],function(_0x448aba){var _0x360912={};_0x360912[_0x448aba]={'$like':'%'+_0x8da4f4[_0x6212('0x4a')]['filter']+'%'};return _0x360912;})});}_0x10a487=_[_0x6212('0x5d')]({},_0x10a487,_0x8da4f4[_0x6212('0x5e')]);return _0x268b9f[_0x6212('0x127')](_0x10a487);}})['then'](function(_0x30bd97){if(_0x30bd97){_0x53026e=_0x30bd97[_0x6212('0x5b')];if(!_0x8da4f4[_0x6212('0x4a')][_0x6212('0x79')]('nolimit')){_0x10a487[_0x6212('0x35')]=qs[_0x6212('0x35')](_0x8da4f4[_0x6212('0x4a')][_0x6212('0x35')]);_0x10a487['offset']=qs[_0x6212('0x34')](_0x8da4f4['query'][_0x6212('0x34')]);}return _0x268b9f['getAgents'](_0x10a487);}})[_0x6212('0x3c')](function(_0x3b4385){if(_0x3b4385){return _0x3b4385?{'count':_0x53026e,'rows':_0x3b4385}:null;}})[_0x6212('0x3c')](respondWithResult(_0x47a615,null))['catch'](handleError(_0x47a615,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 1c598f9..f345aed 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 _0xecd9=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xecd9,0x13f));var _0x9ecd=function(_0x32b42c,_0x46dc9e){_0x32b42c=_0x32b42c-0x0;var _0x55e4ec=_0xecd9[_0x32b42c];return _0x55e4ec;};'use strict';var EventEmitter=require(_0x9ecd('0x0'));var ChatWebsite=require(_0x9ecd('0x1'))['db'][_0x9ecd('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9ecd('0x3')](0x0);var events={'afterCreate':_0x9ecd('0x4'),'afterUpdate':_0x9ecd('0x5'),'afterDestroy':_0x9ecd('0x6')};function emitEvent(_0x290270){return function(_0x4abf6e,_0x5e6bf1,_0xfc95e6){ChatWebsiteEvents[_0x9ecd('0x7')](_0x290270+':'+_0x4abf6e['id'],_0x4abf6e);ChatWebsiteEvents[_0x9ecd('0x7')](_0x290270,_0x4abf6e);_0xfc95e6(null);};}for(var e in events){if(events[_0x9ecd('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x9ecd('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x9589=['ChatWebsite','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3405bd,_0x8bc08b){var _0x52e9e5=function(_0x2cfd2f){while(--_0x2cfd2f){_0x3405bd['push'](_0x3405bd['shift']());}};_0x52e9e5(++_0x8bc08b);}(_0x9589,0xbc));var _0x9958=function(_0x467fef,_0x5f10bb){_0x467fef=_0x467fef-0x0;var _0x5b8007=_0x9589[_0x467fef];return _0x5b8007;};'use strict';var EventEmitter=require(_0x9958('0x0'));var ChatWebsite=require(_0x9958('0x1'))['db'][_0x9958('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9958('0x3')](0x0);var events={'afterCreate':_0x9958('0x4'),'afterUpdate':'update','afterDestroy':_0x9958('0x5')};function emitEvent(_0x153116){return function(_0xe7c0e,_0x4845d4,_0xdd5925){ChatWebsiteEvents[_0x9958('0x6')](_0x153116+':'+_0xe7c0e['id'],_0xe7c0e);ChatWebsiteEvents[_0x9958('0x6')](_0x153116,_0xe7c0e);_0xdd5925(null);};}for(var e in events){if(events[_0x9958('0x7')](e)){var event=events[e];ChatWebsite[_0x9958('0x8')](e,emitEvent(event));}}module[_0x9958('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 5ea8849..86236c0 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 _0x04b8=['../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','util','api','moment','request-promise','path'];(function(_0x21094c,_0x5f08b9){var _0x3b799c=function(_0x4e5210){while(--_0x4e5210){_0x21094c['push'](_0x21094c['shift']());}};_0x3b799c(++_0x5f08b9);}(_0x04b8,0x159));var _0x804b=function(_0x2bb66c,_0x36c6c6){_0x2bb66c=_0x2bb66c-0x0;var _0x1e0f98=_0x04b8[_0x2bb66c];return _0x1e0f98;};'use strict';var _=require('lodash');var util=require(_0x804b('0x0'));var logger=require('../../config/logger')(_0x804b('0x1'));var moment=require(_0x804b('0x2'));var BPromise=require('bluebird');var rp=require(_0x804b('0x3'));var fs=require('fs');var path=require(_0x804b('0x4'));var rimraf=require('rimraf');var config=require(_0x804b('0x5'));var attributes=require(_0x804b('0x6'));module[_0x804b('0x7')]=function(_0x5a8a5b,_0x2c22e3){return _0x5a8a5b[_0x804b('0x8')](_0x804b('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d9b=['rimraf','./chatWebsite.attributes','ChatWebsite','chat_websites','util','../../config/logger','moment','request-promise','path'];(function(_0x1cea90,_0x163a1b){var _0x53da7e=function(_0x3c36b2){while(--_0x3c36b2){_0x1cea90['push'](_0x1cea90['shift']());}};_0x53da7e(++_0x163a1b);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x2617ab,_0x2698ae){_0x2617ab=_0x2617ab-0x0;var _0x578fcc=_0x9d9b[_0x2617ab];return _0x578fcc;};'use strict';var _=require('lodash');var util=require(_0xb9d9('0x0'));var logger=require(_0xb9d9('0x1'))('api');var moment=require(_0xb9d9('0x2'));var BPromise=require('bluebird');var rp=require(_0xb9d9('0x3'));var fs=require('fs');var path=require(_0xb9d9('0x4'));var rimraf=require(_0xb9d9('0x5'));var config=require('../../config/environment');var attributes=require(_0xb9d9('0x6'));module['exports']=function(_0x1b1f3c,_0x32cf18){return _0x1b1f3c['define'](_0xb9d9('0x7'),attributes,{'tableName':_0xb9d9('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 693f23c..e277834 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 _0x4975=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','register','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','lodash'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4975,0x86));var _0x5497=function(_0xb9dd98,_0x426494){_0xb9dd98=_0xb9dd98-0x0;var _0x2cbce9=_0x4975[_0xb9dd98];return _0x2cbce9;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});config['redis']=_[_0x5497('0xc')](config[_0x5497('0xd')],{'host':_0x5497('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5497('0xd')]));require('./chatWebsite.socket')[_0x5497('0xf')](socket);function respondWithRpcPromise(_0x29c93f,_0x2ec5a4,_0x32a8a2){return new BPromise(function(_0x131627,_0x425288){return client[_0x5497('0x10')](_0x29c93f,_0x32a8a2)[_0x5497('0x11')](function(_0x50d716){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2ec5a4,_0x5497('0x12'));logger[_0x5497('0x13')](_0x5497('0x14'),_0x2ec5a4,_0x5497('0x12'),JSON[_0x5497('0x15')](_0x50d716));if(_0x50d716[_0x5497('0x16')]){if(_0x50d716[_0x5497('0x16')][_0x5497('0x17')]===0x1f4){logger[_0x5497('0x16')](_0x5497('0x18'),_0x2ec5a4,_0x50d716['error'][_0x5497('0x19')]);return _0x425288(_0x50d716['error'][_0x5497('0x19')]);}logger[_0x5497('0x16')](_0x5497('0x18'),_0x2ec5a4,_0x50d716[_0x5497('0x16')][_0x5497('0x19')]);return _0x131627(_0x50d716[_0x5497('0x16')][_0x5497('0x19')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2ec5a4,_0x5497('0x12'));_0x131627(_0x50d716[_0x5497('0x1a')][_0x5497('0x19')]);}})['catch'](function(_0xbf1ba7){logger[_0x5497('0x16')](_0x5497('0x18'),_0x2ec5a4,_0xbf1ba7);_0x425288(_0xbf1ba7);});});} \ No newline at end of file +var _0x687b=['request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register'];(function(_0x2362b6,_0x419bd9){var _0x4e0729=function(_0x228b41){while(--_0x228b41){_0x2362b6['push'](_0x2362b6['shift']());}};_0x4e0729(++_0x419bd9);}(_0x687b,0x14a));var _0xb687=function(_0xf15036,_0x52e137){_0xf15036=_0xf15036-0x0;var _0x2985dd=_0x687b[_0xf15036];return _0x2985dd;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});config[_0xb687('0xc')]=_[_0xb687('0xd')](config['redis'],{'host':_0xb687('0xe'),'port':0x18eb});var socket=require(_0xb687('0xf'))(new Redis(config['redis']));require(_0xb687('0x10'))[_0xb687('0x11')](socket);function respondWithRpcPromise(_0x825ad,_0x15dc9a,_0x404fdb){return new BPromise(function(_0x309d84,_0x3e6271){return client[_0xb687('0x12')](_0x825ad,_0x404fdb)[_0xb687('0x13')](function(_0x5103b9){logger[_0xb687('0x14')](_0xb687('0x15'),_0x15dc9a,_0xb687('0x16'));logger[_0xb687('0x17')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x15dc9a,'request\x20sent',JSON[_0xb687('0x18')](_0x5103b9));if(_0x5103b9[_0xb687('0x19')]){if(_0x5103b9['error'][_0xb687('0x1a')]===0x1f4){logger[_0xb687('0x19')](_0xb687('0x15'),_0x15dc9a,_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);return _0x3e6271(_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);}logger[_0xb687('0x19')](_0xb687('0x15'),_0x15dc9a,_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);return _0x309d84(_0x5103b9[_0xb687('0x19')]['message']);}else{logger[_0xb687('0x14')](_0xb687('0x15'),_0x15dc9a,_0xb687('0x16'));_0x309d84(_0x5103b9['result']['message']);}})[_0xb687('0x1c')](function(_0x3a10ef){logger[_0xb687('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x15dc9a,_0x3a10ef);_0x3e6271(_0x3a10ef);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 7b6e989..148743a 100644 --- a/server/api/chatWebsite/chatWebsite.socket.js +++ b/server/api/chatWebsite/chatWebsite.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x4b1f9c,_0x422fc9){var _0x3e0632=function(_0x480a6f){while(--_0x480a6f){_0x4b1f9c['push'](_0x4b1f9c['shift']());}};_0x3e0632(++_0x422fc9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1da9f7,_0x54feba){_0x1da9f7=_0x1da9f7-0x0;var _0x4bfa79=_0x5f2f[_0x1da9f7];return _0x4bfa79;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x187045,_0x27442a){var _0x228241=function(_0x3c2a4f){while(--_0x3c2a4f){_0x187045['push'](_0x187045['shift']());}};_0x228241(++_0x27442a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x57bbe1,_0x53b78d){_0x57bbe1=_0x57bbe1-0x0;var _0x420334=_0x5f2f[_0x57bbe1];return _0x420334;};'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 b0b0613..0fb1851 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 _0x2e35=['/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','/:id/canned_answers','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','addAvatar','file','join','addSystemAvatar','/:id/notify','notify'];(function(_0x95b44e,_0x4af5e1){var _0x4d33ea=function(_0x35acd6){while(--_0x35acd6){_0x95b44e['push'](_0x95b44e['shift']());}};_0x4d33ea(++_0x4af5e1);}(_0x2e35,0xd9));var _0x52e3=function(_0x545c0e,_0x11d2ed){_0x545c0e=_0x545c0e-0x0;var _0x5732fd=_0x2e35[_0x545c0e];return _0x5732fd;};'use strict';var multer=require('multer');var util=require(_0x52e3('0x0'));var path=require(_0x52e3('0x1'));var timeout=require(_0x52e3('0x2'));var express=require(_0x52e3('0x3'));var router=express['Router']();var auth=require(_0x52e3('0x4'));var interaction=require(_0x52e3('0x5'));var config=require('../../config/environment');var controller=require(_0x52e3('0x6'));router[_0x52e3('0x7')]('/',auth[_0x52e3('0x8')](),controller[_0x52e3('0x9')]);router[_0x52e3('0x7')](_0x52e3('0xa'),auth[_0x52e3('0x8')](),controller[_0x52e3('0xb')]);router['get'](_0x52e3('0xc'),auth[_0x52e3('0x8')](),controller[_0x52e3('0xd')]);router[_0x52e3('0x7')](_0x52e3('0xe'),auth[_0x52e3('0x8')](),controller['getDispositions']);router[_0x52e3('0x7')]('/:id/canned_answers',auth[_0x52e3('0x8')](),controller[_0x52e3('0xf')]);router[_0x52e3('0x7')](_0x52e3('0x10'),controller[_0x52e3('0x11')]);router[_0x52e3('0x7')](_0x52e3('0x12'),controller[_0x52e3('0x13')]);router[_0x52e3('0x7')](_0x52e3('0x14'),controller['getCustomerAvatar']);router[_0x52e3('0x7')](_0x52e3('0x15'),controller[_0x52e3('0x16')]);router['get'](_0x52e3('0x17'),auth[_0x52e3('0x8')](),controller[_0x52e3('0x18')]);router[_0x52e3('0x7')](_0x52e3('0x19'),controller[_0x52e3('0x1a')]);router[_0x52e3('0x7')](_0x52e3('0x1b'),auth[_0x52e3('0x8')](),controller[_0x52e3('0x1c')]);router['get'](_0x52e3('0x1d'),auth[_0x52e3('0x8')](),controller[_0x52e3('0x1e')]);router[_0x52e3('0x7')]('/:id/fields',controller[_0x52e3('0x1f')]);router['get'](_0x52e3('0x20'),auth[_0x52e3('0x8')](),controller[_0x52e3('0x21')]);router[_0x52e3('0x7')](_0x52e3('0x22'),auth['isAuthenticated'](),controller[_0x52e3('0x23')]);router[_0x52e3('0x24')]('/',auth[_0x52e3('0x8')](),controller['create']);router[_0x52e3('0x24')]('/:id/dispositions',auth[_0x52e3('0x8')](),controller['addDisposition']);router[_0x52e3('0x24')](_0x52e3('0x25'),auth[_0x52e3('0x8')](),controller[_0x52e3('0x26')]);var upload=multer({'storage':multer[_0x52e3('0x27')]({'destination':function(_0x1302b4,_0x51f0e0,_0x336471){_0x336471(null,path['join'](config[_0x52e3('0x28')],_0x52e3('0x29')));},'filename':function(_0x316c52,_0x3576d7,_0x53bc09){_0x53bc09(null,util[_0x52e3('0x2a')](_0x52e3('0x2b'),Date[_0x52e3('0x2c')](),_0x3576d7[_0x52e3('0x2d')]));}})});router[_0x52e3('0x24')](_0x52e3('0x10'),upload[_0x52e3('0x2e')]('file'),controller[_0x52e3('0x2f')]);var upload=multer({'storage':multer[_0x52e3('0x27')]({'destination':function(_0x29f2d8,_0x5b75c7,_0x307a3e){_0x307a3e(null,path['join'](config[_0x52e3('0x28')],_0x52e3('0x30')));},'filename':function(_0x13b56d,_0x5ae9b2,_0xdc55dd){_0xdc55dd(null,util[_0x52e3('0x2a')](_0x52e3('0x2b'),Date[_0x52e3('0x2c')](),_0x5ae9b2[_0x52e3('0x2d')]));}})});router['post']('/:id/avatar',upload[_0x52e3('0x2e')]('file'),controller[_0x52e3('0x31')]);var upload=multer({'storage':multer[_0x52e3('0x27')]({'destination':function(_0x55e430,_0x4a91d6,_0x266833){_0x266833(null,path['join'](config[_0x52e3('0x28')],_0x52e3('0x30')));},'filename':function(_0x24b0a1,_0x2c5d5d,_0x58a41e){_0x58a41e(null,util['format'](_0x52e3('0x2b'),Date[_0x52e3('0x2c')](),_0x2c5d5d[_0x52e3('0x2d')]));}})});router['post'](_0x52e3('0x14'),upload[_0x52e3('0x2e')](_0x52e3('0x32')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x52e3('0x27')]({'destination':function(_0x1b82b7,_0xacb5d2,_0x57c278){_0x57c278(null,path[_0x52e3('0x33')](config[_0x52e3('0x28')],_0x52e3('0x30')));},'filename':function(_0x3452d8,_0x36b1d8,_0x25c29c){_0x25c29c(null,util[_0x52e3('0x2a')](_0x52e3('0x2b'),Date[_0x52e3('0x2c')](),_0x36b1d8[_0x52e3('0x2d')]));}})});router[_0x52e3('0x24')](_0x52e3('0x15'),upload['single'](_0x52e3('0x32')),controller[_0x52e3('0x34')]);router[_0x52e3('0x24')](_0x52e3('0x35'),controller[_0x52e3('0x36')]);router[_0x52e3('0x24')](_0x52e3('0x37'),controller['offline']);router[_0x52e3('0x24')](_0x52e3('0x17'),auth[_0x52e3('0x8')](),controller[_0x52e3('0x38')]);router[_0x52e3('0x24')](_0x52e3('0x1b'),auth[_0x52e3('0x8')](),controller[_0x52e3('0x39')]);router[_0x52e3('0x24')]('/:id/proactive_actions',auth[_0x52e3('0x8')](),controller[_0x52e3('0x3a')]);router[_0x52e3('0x24')](_0x52e3('0x22'),auth[_0x52e3('0x8')](),controller[_0x52e3('0x3b')]);router[_0x52e3('0x3c')](_0x52e3('0xc'),auth[_0x52e3('0x8')](),controller[_0x52e3('0x3d')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x52e3('0x3e')]);router[_0x52e3('0x3f')](_0x52e3('0xe'),auth['isAuthenticated'](),controller[_0x52e3('0x40')]);router[_0x52e3('0x3f')](_0x52e3('0x25'),auth['isAuthenticated'](),controller[_0x52e3('0x41')]);router[_0x52e3('0x3f')](_0x52e3('0x22'),auth[_0x52e3('0x8')](),controller[_0x52e3('0x42')]);module[_0x52e3('0x43')]=router; \ No newline at end of file +var _0x758c=['multer','util','connect-timeout','Router','../../config/environment','./chatWebsite.controller','isAuthenticated','index','describe','get','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','getAgents','post','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','originalname','single','addLogo','root','server/files/images/avatars/','/:id/avatar','now','file','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','put','update','delete','removeDispositions','removeAnswers','exports'];(function(_0x12c791,_0x123617){var _0x266301=function(_0x53ba03){while(--_0x53ba03){_0x12c791['push'](_0x12c791['shift']());}};_0x266301(++_0x123617);}(_0x758c,0x186));var _0xc758=function(_0x4af6d6,_0x5a73bc){_0x4af6d6=_0x4af6d6-0x0;var _0x5e63a0=_0x758c[_0x4af6d6];return _0x5e63a0;};'use strict';var multer=require(_0xc758('0x0'));var util=require(_0xc758('0x1'));var path=require('path');var timeout=require(_0xc758('0x2'));var express=require('express');var router=express[_0xc758('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc758('0x4'));var controller=require(_0xc758('0x5'));router['get']('/',auth[_0xc758('0x6')](),controller[_0xc758('0x7')]);router['get']('/describe',auth[_0xc758('0x6')](),controller[_0xc758('0x8')]);router[_0xc758('0x9')](_0xc758('0xa'),auth['isAuthenticated'](),controller[_0xc758('0xb')]);router[_0xc758('0x9')]('/:id/dispositions',auth[_0xc758('0x6')](),controller[_0xc758('0xc')]);router[_0xc758('0x9')](_0xc758('0xd'),auth['isAuthenticated'](),controller[_0xc758('0xe')]);router['get'](_0xc758('0xf'),controller['getLogo']);router[_0xc758('0x9')]('/:id/avatar',controller['getAvatar']);router['get'](_0xc758('0x10'),controller[_0xc758('0x11')]);router[_0xc758('0x9')](_0xc758('0x12'),controller[_0xc758('0x13')]);router[_0xc758('0x9')](_0xc758('0x14'),auth[_0xc758('0x6')](),controller[_0xc758('0x15')]);router[_0xc758('0x9')](_0xc758('0x16'),controller[_0xc758('0x17')]);router[_0xc758('0x9')](_0xc758('0x18'),auth[_0xc758('0x6')](),controller[_0xc758('0x19')]);router[_0xc758('0x9')](_0xc758('0x1a'),auth['isAuthenticated'](),controller[_0xc758('0x1b')]);router['get']('/:id/fields',controller[_0xc758('0x1c')]);router['get']('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xc758('0x1d')]);router[_0xc758('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xc758('0x1e')]);router[_0xc758('0x1f')]('/',auth[_0xc758('0x6')](),controller['create']);router['post'](_0xc758('0x20'),auth[_0xc758('0x6')](),controller[_0xc758('0x21')]);router[_0xc758('0x1f')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xc758('0x22')]);var upload=multer({'storage':multer[_0xc758('0x23')]({'destination':function(_0x4f2006,_0x23d5f1,_0x12f4cc){_0x12f4cc(null,path[_0xc758('0x24')](config['root'],_0xc758('0x25')));},'filename':function(_0x547695,_0x43d2f9,_0x582426){_0x582426(null,util[_0xc758('0x26')](_0xc758('0x27'),Date['now'](),_0x43d2f9[_0xc758('0x28')]));}})});router[_0xc758('0x1f')](_0xc758('0xf'),upload[_0xc758('0x29')]('file'),controller[_0xc758('0x2a')]);var upload=multer({'storage':multer[_0xc758('0x23')]({'destination':function(_0x511c0a,_0x3bb740,_0x1be3a7){_0x1be3a7(null,path[_0xc758('0x24')](config[_0xc758('0x2b')],_0xc758('0x2c')));},'filename':function(_0x18f7d4,_0x1b8d7a,_0x3026ff){_0x3026ff(null,util[_0xc758('0x26')](_0xc758('0x27'),Date['now'](),_0x1b8d7a[_0xc758('0x28')]));}})});router['post'](_0xc758('0x2d'),upload['single']('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x17772f,_0x3ae075,_0x2f0251){_0x2f0251(null,path['join'](config[_0xc758('0x2b')],_0xc758('0x2c')));},'filename':function(_0x102c3a,_0x1a2565,_0x41e734){_0x41e734(null,util[_0xc758('0x26')](_0xc758('0x27'),Date[_0xc758('0x2e')](),_0x1a2565['originalname']));}})});router[_0xc758('0x1f')](_0xc758('0x10'),upload[_0xc758('0x29')](_0xc758('0x2f')),controller[_0xc758('0x30')]);var upload=multer({'storage':multer[_0xc758('0x23')]({'destination':function(_0x1501fd,_0x2dbfd6,_0x208a18){_0x208a18(null,path[_0xc758('0x24')](config[_0xc758('0x2b')],_0xc758('0x2c')));},'filename':function(_0x4e40ac,_0x44b5e3,_0x270e8d){_0x270e8d(null,util[_0xc758('0x26')](_0xc758('0x27'),Date['now'](),_0x44b5e3[_0xc758('0x28')]));}})});router[_0xc758('0x1f')](_0xc758('0x12'),upload[_0xc758('0x29')](_0xc758('0x2f')),controller[_0xc758('0x31')]);router[_0xc758('0x1f')](_0xc758('0x32'),controller[_0xc758('0x33')]);router['post'](_0xc758('0x34'),controller[_0xc758('0x35')]);router[_0xc758('0x1f')](_0xc758('0x14'),auth['isAuthenticated'](),controller[_0xc758('0x36')]);router[_0xc758('0x1f')](_0xc758('0x18'),auth['isAuthenticated'](),controller[_0xc758('0x37')]);router[_0xc758('0x1f')](_0xc758('0x1a'),auth[_0xc758('0x6')](),controller[_0xc758('0x38')]);router[_0xc758('0x1f')](_0xc758('0x39'),auth[_0xc758('0x6')](),controller[_0xc758('0x3a')]);router[_0xc758('0x3b')]('/:id',auth[_0xc758('0x6')](),controller[_0xc758('0x3c')]);router[_0xc758('0x3d')](_0xc758('0xa'),auth[_0xc758('0x6')](),controller['destroy']);router[_0xc758('0x3d')](_0xc758('0x20'),auth[_0xc758('0x6')](),controller[_0xc758('0x3e')]);router[_0xc758('0x3d')]('/:id/canned_answers',auth[_0xc758('0x6')](),controller[_0xc758('0x3f')]);router['delete'](_0xc758('0x39'),auth[_0xc758('0x6')](),controller['removeAgents']);module[_0xc758('0x40')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 1bb4d25..24c2591 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 _0x7e1b=['STRING','exports'];(function(_0x8a1a2,_0x26e04d){var _0x713d23=function(_0x562419){while(--_0x562419){_0x8a1a2['push'](_0x8a1a2['shift']());}};_0x713d23(++_0x26e04d);}(_0x7e1b,0x177));var _0xb7e1=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x7e1b[_0x576170];return _0x397c70;};'use strict';var Sequelize=require('sequelize');module[_0xb7e1('0x0')]={'name':{'type':Sequelize[_0xb7e1('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xb7e1('0x1')]},'website':{'type':Sequelize[_0xb7e1('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xb7e1('0x1')]},'type':{'type':Sequelize[_0xb7e1('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xb7e1('0x1')]},'country':{'type':Sequelize[_0xb7e1('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xb7e1('0x1')]},'sCity':{'type':Sequelize[_0xb7e1('0x1')]},'sCountry':{'type':Sequelize[_0xb7e1('0x1')]},'description':{'type':Sequelize[_0xb7e1('0x1')]}}; \ No newline at end of file +var _0xe63f=['STRING','name','sequelize','exports'];(function(_0x514ffb,_0x65ef2c){var _0x10637b=function(_0x37142b){while(--_0x37142b){_0x514ffb['push'](_0x514ffb['shift']());}};_0x10637b(++_0x65ef2c);}(_0xe63f,0x156));var _0xfe63=function(_0x36aa9c,_0x3db9a6){_0x36aa9c=_0x36aa9c-0x0;var _0x10ec1f=_0xe63f[_0x36aa9c];return _0x10ec1f;};'use strict';var Sequelize=require(_0xfe63('0x0'));module[_0xfe63('0x1')]={'name':{'type':Sequelize[_0xfe63('0x2')],'unique':_0xfe63('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xfe63('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xfe63('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xfe63('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xfe63('0x2')]},'city':{'type':Sequelize[_0xfe63('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xfe63('0x2')]},'sStreet':{'type':Sequelize[_0xfe63('0x2')]},'sPostalCode':{'type':Sequelize[_0xfe63('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xfe63('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index ec56c78..aa69cab 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 _0xfa19=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','Companies','UserProfileResource','end','sendStatus','error','stack','name','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','includeAll','include','findAll','rows','catch','show','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x251d9c,_0x580977){var _0x16ae64=function(_0x4d3b53){while(--_0x4d3b53){_0x251d9c['push'](_0x251d9c['shift']());}};_0x16ae64(++_0x580977);}(_0xfa19,0x1c2));var _0x9fa1=function(_0x2f395e,_0x40c647){_0x2f395e=_0x2f395e-0x0;var _0x1946ba=_0xfa19[_0x2f395e];return _0x1946ba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9fa1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9fa1('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9fa1('0x2'));var Mustache=require(_0x9fa1('0x3'));var util=require(_0x9fa1('0x4'));var path=require(_0x9fa1('0x5'));var sox=require(_0x9fa1('0x6'));var csv=require('to-csv');var ejs=require(_0x9fa1('0x7'));var fs=require('fs');var _=require(_0x9fa1('0x8'));var squel=require(_0x9fa1('0x9'));var crypto=require(_0x9fa1('0xa'));var jsforce=require(_0x9fa1('0xb'));var deskjs=require(_0x9fa1('0xc'));var toCsv=require(_0x9fa1('0xd'));var querystring=require(_0x9fa1('0xe'));var Papa=require(_0x9fa1('0xf'));var Redis=require(_0x9fa1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9fa1('0x11'));var as=require(_0x9fa1('0x12'));var hardwareService=require(_0x9fa1('0x13'));var logger=require(_0x9fa1('0x14'))(_0x9fa1('0x15'));var utils=require(_0x9fa1('0x16'));var config=require(_0x9fa1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdb7686,_0x3ecf98){_0x3ecf98=_0x3ecf98||0xcc;return function(_0x172714){if(_0x172714){return _0xdb7686['sendStatus'](_0x3ecf98);}return _0xdb7686[_0x9fa1('0x18')](_0x3ecf98)['end']();};}function respondWithResult(_0x2bb616,_0x428a84){_0x428a84=_0x428a84||0xc8;return function(_0x18d42a){if(_0x18d42a){return _0x2bb616[_0x9fa1('0x18')](_0x428a84)[_0x9fa1('0x19')](_0x18d42a);}};}function respondWithFilteredResult(_0x3d90b9,_0x628009){return function(_0x4e13e7){if(_0x4e13e7){var _0x2dfc11=_0x4e13e7[_0x9fa1('0x1a')],_0x3f73f3=_0x628009['offset'],_0x43d3cc=_0x628009[_0x9fa1('0x1b')]+_0x628009[_0x9fa1('0x1c')],_0x2d0061;if(_0x43d3cc>=_0x2dfc11){_0x43d3cc=_0x2dfc11;_0x2d0061=0xc8;}else{_0x2d0061=0xce;}_0x3d90b9[_0x9fa1('0x18')](_0x2d0061);return _0x3d90b9[_0x9fa1('0x1d')](_0x9fa1('0x1e'),_0x3f73f3+'-'+_0x43d3cc+'/'+_0x2dfc11)[_0x9fa1('0x19')](_0x4e13e7);}return null;};}function patchUpdates(_0x1c75da){return function(_0x3c8d40){try{jsonpatch[_0x9fa1('0x1f')](_0x3c8d40,_0x1c75da,!![]);}catch(_0x35cd83){return BPromise[_0x9fa1('0x20')](_0x35cd83);}return _0x3c8d40[_0x9fa1('0x21')]();};}function saveUpdates(_0x5c86cd,_0x6b94bb){return function(_0x5a5535){if(_0x5a5535){return _0x5a5535[_0x9fa1('0x22')](_0x5c86cd)['then'](function(_0x242b96){return _0x242b96;});}return null;};}function removeEntity(_0x48a1e0,_0x1807bd){return function(_0x3a3237){if(_0x3a3237){return _0x3a3237[_0x9fa1('0x23')]()[_0x9fa1('0x24')](function(){var _0x57132b=_0x3a3237[_0x9fa1('0x25')]({'plain':!![]});var _0x431f13=_0x9fa1('0x26');return db[_0x9fa1('0x27')][_0x9fa1('0x23')]({'where':{'type':_0x431f13,'resourceId':_0x57132b['id']}})[_0x9fa1('0x24')](function(){return _0x3a3237;});})[_0x9fa1('0x24')](function(){_0x48a1e0[_0x9fa1('0x18')](0xcc)[_0x9fa1('0x28')]();});}};}function handleEntityNotFound(_0x48e70e,_0x2e0f16){return function(_0x3184d8){if(!_0x3184d8){_0x48e70e[_0x9fa1('0x29')](0x194);}return _0x3184d8;};}function handleError(_0x2d7477,_0x4ce844){_0x4ce844=_0x4ce844||0x1f4;return function(_0x55ea8f){logger[_0x9fa1('0x2a')](_0x55ea8f[_0x9fa1('0x2b')]);if(_0x55ea8f[_0x9fa1('0x2c')]){delete _0x55ea8f[_0x9fa1('0x2c')];}_0x2d7477[_0x9fa1('0x18')](_0x4ce844)['send'](_0x55ea8f);};}exports['index']=function(_0x247954,_0x4921d3){var _0x4c4e2f={},_0x5df63f={},_0x47ffd5={'count':0x0,'rows':[]};return db[_0x9fa1('0x2d')][_0x9fa1('0x2e')]()['then'](function(_0x25b168){_0x5df63f[_0x9fa1('0x2f')]=_[_0x9fa1('0x30')](_0x25b168);_0x5df63f[_0x9fa1('0x31')]=_[_0x9fa1('0x30')](_0x247954[_0x9fa1('0x31')]);_0x5df63f['filters']=_[_0x9fa1('0x32')](_0x5df63f['model'],_0x5df63f[_0x9fa1('0x31')]);_0x4c4e2f[_0x9fa1('0x33')]=_[_0x9fa1('0x32')](_0x5df63f['model'],qs[_0x9fa1('0x34')](_0x247954[_0x9fa1('0x31')]['fields']));_0x4c4e2f[_0x9fa1('0x33')]=_0x4c4e2f['attributes'][_0x9fa1('0x35')]?_0x4c4e2f[_0x9fa1('0x33')]:_0x5df63f['model'];if(!_0x247954[_0x9fa1('0x31')][_0x9fa1('0x36')](_0x9fa1('0x37'))){_0x4c4e2f['limit']=qs[_0x9fa1('0x1c')](_0x247954['query'][_0x9fa1('0x1c')]);_0x4c4e2f[_0x9fa1('0x1b')]=qs[_0x9fa1('0x1b')](_0x247954[_0x9fa1('0x31')][_0x9fa1('0x1b')]);}_0x4c4e2f[_0x9fa1('0x38')]=qs['sort'](_0x247954[_0x9fa1('0x31')][_0x9fa1('0x39')]);_0x4c4e2f[_0x9fa1('0x3a')]=qs[_0x9fa1('0x3b')](_[_0x9fa1('0x3c')](_0x247954[_0x9fa1('0x31')],_0x5df63f[_0x9fa1('0x3b')]));if(_0x247954['query'][_0x9fa1('0x3d')]){_0x4c4e2f[_0x9fa1('0x3a')]=_[_0x9fa1('0x3e')](_0x4c4e2f['where'],{'$or':_[_0x9fa1('0x3f')](_0x4c4e2f['attributes'],function(_0x4bbfc1){var _0x28adcb={};_0x28adcb[_0x4bbfc1]={'$like':'%'+_0x247954['query'][_0x9fa1('0x3d')]+'%'};return _0x28adcb;})});}_0x4c4e2f=_['merge']({},_0x4c4e2f,_0x247954['options']);var _0xdf3475={'where':_0x4c4e2f[_0x9fa1('0x3a')]};return db['CmCompany'][_0x9fa1('0x1a')](_0xdf3475)[_0x9fa1('0x24')](function(_0x1b96f5){_0x47ffd5[_0x9fa1('0x1a')]=_0x1b96f5;if(_0x247954[_0x9fa1('0x31')][_0x9fa1('0x40')]){_0x4c4e2f[_0x9fa1('0x41')]=[{'all':!![]}];}return db[_0x9fa1('0x2d')][_0x9fa1('0x42')](_0x4c4e2f);})['then'](function(_0xe9cbd9){_0x47ffd5[_0x9fa1('0x43')]=_0xe9cbd9;return _0x47ffd5;})[_0x9fa1('0x24')](respondWithFilteredResult(_0x4921d3,_0x4c4e2f))[_0x9fa1('0x44')](handleError(_0x4921d3,null));})[_0x9fa1('0x44')](handleError(_0x4921d3,null));};exports[_0x9fa1('0x45')]=function(_0x2e7b71,_0x1bbc19){var _0x45f49f={'raw':![],'where':{'id':_0x2e7b71['params']['id']}},_0x304ad0={};_0x304ad0[_0x9fa1('0x2f')]=_['keys'](db[_0x9fa1('0x2d')]['rawAttributes']);_0x304ad0[_0x9fa1('0x31')]=_[_0x9fa1('0x30')](_0x2e7b71[_0x9fa1('0x31')]);_0x304ad0['filters']=_[_0x9fa1('0x32')](_0x304ad0[_0x9fa1('0x2f')],_0x304ad0[_0x9fa1('0x31')]);_0x45f49f[_0x9fa1('0x33')]=_[_0x9fa1('0x32')](_0x304ad0[_0x9fa1('0x2f')],qs[_0x9fa1('0x34')](_0x2e7b71[_0x9fa1('0x31')][_0x9fa1('0x34')]));_0x45f49f[_0x9fa1('0x33')]=_0x45f49f[_0x9fa1('0x33')][_0x9fa1('0x35')]?_0x45f49f[_0x9fa1('0x33')]:_0x304ad0['model'];if(_0x2e7b71['query'][_0x9fa1('0x40')]){_0x45f49f[_0x9fa1('0x41')]=[{'all':!![]}];}_0x45f49f=_[_0x9fa1('0x3e')]({},_0x45f49f,_0x2e7b71[_0x9fa1('0x46')]);return db['CmCompany'][_0x9fa1('0x47')](_0x45f49f)[_0x9fa1('0x24')](handleEntityNotFound(_0x1bbc19,null))['then'](respondWithResult(_0x1bbc19,null))[_0x9fa1('0x44')](handleError(_0x1bbc19,null));};exports[_0x9fa1('0x48')]=function(_0xd73579,_0x4a6a69){return db['CmCompany'][_0x9fa1('0x48')](_0xd73579['body'],{})['then'](function(_0x2a4919){var _0x13496c=_0xd73579[_0x9fa1('0x49')][_0x9fa1('0x25')]({'plain':!![]});if(!_0x13496c)throw new Error(_0x9fa1('0x4a'));if(_0x13496c[_0x9fa1('0x4b')]===_0x9fa1('0x49')){var _0x50fcc7=_0x2a4919[_0x9fa1('0x25')]({'plain':!![]});var _0x58f5c9='Companies';return db[_0x9fa1('0x4c')][_0x9fa1('0x47')]({'where':{'name':_0x58f5c9,'userProfileId':_0x13496c[_0x9fa1('0x4d')]},'raw':!![]})[_0x9fa1('0x24')](function(_0x19dfe0){if(_0x19dfe0&&_0x19dfe0[_0x9fa1('0x4e')]===0x0){return db[_0x9fa1('0x27')][_0x9fa1('0x48')]({'name':_0x50fcc7['name'],'resourceId':_0x50fcc7['id'],'type':_0x19dfe0[_0x9fa1('0x2c')],'sectionId':_0x19dfe0['id']},{})[_0x9fa1('0x24')](function(){return _0x2a4919;});}else{return _0x2a4919;}})[_0x9fa1('0x44')](function(_0x45b164){logger['error'](_0x9fa1('0x4f'),_0x45b164);throw _0x45b164;});}return _0x2a4919;})[_0x9fa1('0x24')](respondWithResult(_0x4a6a69,0xc9))[_0x9fa1('0x44')](handleError(_0x4a6a69,null));};exports[_0x9fa1('0x22')]=function(_0x2bcfc9,_0x3b2aab){if(_0x2bcfc9['body']['id']){delete _0x2bcfc9[_0x9fa1('0x50')]['id'];}return db[_0x9fa1('0x2d')][_0x9fa1('0x47')]({'where':{'id':_0x2bcfc9[_0x9fa1('0x51')]['id']}})[_0x9fa1('0x24')](handleEntityNotFound(_0x3b2aab,null))['then'](saveUpdates(_0x2bcfc9[_0x9fa1('0x50')],null))['then'](respondWithResult(_0x3b2aab,null))[_0x9fa1('0x44')](handleError(_0x3b2aab,null));};exports['destroy']=function(_0x3bf700,_0x24dcb0){return db[_0x9fa1('0x2d')]['find']({'where':{'id':_0x3bf700[_0x9fa1('0x51')]['id']}})[_0x9fa1('0x24')](handleEntityNotFound(_0x24dcb0,null))['then'](removeEntity(_0x24dcb0,null))['catch'](handleError(_0x24dcb0,null));};exports[_0x9fa1('0x2e')]=function(_0xfc8a30,_0x524185){return db[_0x9fa1('0x2d')][_0x9fa1('0x2e')]()[_0x9fa1('0x24')](respondWithResult(_0x524185,null))[_0x9fa1('0x44')](handleError(_0x524185,null));};exports[_0x9fa1('0x52')]=function(_0x22c347,_0x398d06,_0x410aa4){return db[_0x9fa1('0x53')][_0x9fa1('0x47')]({'where':{'id':_0x22c347[_0x9fa1('0x51')]['id']}})[_0x9fa1('0x24')](handleEntityNotFound(_0x398d06,null))[_0x9fa1('0x24')](function(_0x5ec4d5){if(_0x5ec4d5){return _0x5ec4d5[_0x9fa1('0x52')](_0x22c347[_0x9fa1('0x50')][_0x9fa1('0x54')],_[_0x9fa1('0x55')](_0x22c347[_0x9fa1('0x50')],[_0x9fa1('0x54'),'id'])||{});}})[_0x9fa1('0x24')](respondWithResult(_0x398d06,null))['catch'](handleError(_0x398d06,null));};exports[_0x9fa1('0x56')]=function(_0x27bd86,_0x5c2d2e,_0x2388ab){var _0x4c7f9f={};var _0x2912d3={};var _0x500547;var _0x6cfba1;return db[_0x9fa1('0x2d')][_0x9fa1('0x57')]({'where':{'id':_0x27bd86['params']['id']}})[_0x9fa1('0x24')](handleEntityNotFound(_0x5c2d2e,null))[_0x9fa1('0x24')](function(_0x241a8c){if(_0x241a8c){_0x500547=_0x241a8c;_0x2912d3['model']=_[_0x9fa1('0x30')](db['CmContact']['rawAttributes']);_0x2912d3[_0x9fa1('0x31')]=_[_0x9fa1('0x30')](_0x27bd86[_0x9fa1('0x31')]);_0x2912d3[_0x9fa1('0x3b')]=_[_0x9fa1('0x32')](_0x2912d3[_0x9fa1('0x2f')],_0x2912d3[_0x9fa1('0x31')]);_0x4c7f9f['attributes']=_[_0x9fa1('0x32')](_0x2912d3['model'],qs['fields'](_0x27bd86[_0x9fa1('0x31')][_0x9fa1('0x34')]));_0x4c7f9f[_0x9fa1('0x33')]=_0x4c7f9f[_0x9fa1('0x33')]['length']?_0x4c7f9f[_0x9fa1('0x33')]:_0x2912d3[_0x9fa1('0x2f')];_0x4c7f9f['order']=qs[_0x9fa1('0x39')](_0x27bd86['query'][_0x9fa1('0x39')]);_0x4c7f9f[_0x9fa1('0x3a')]=qs[_0x9fa1('0x3b')](_['pick'](_0x27bd86[_0x9fa1('0x31')],_0x2912d3['filters']));if(_0x27bd86[_0x9fa1('0x31')][_0x9fa1('0x3d')]){_0x4c7f9f[_0x9fa1('0x3a')]=_['merge'](_0x4c7f9f[_0x9fa1('0x3a')],{'$or':_['map'](_0x4c7f9f['attributes'],function(_0x1b4ae8){var _0x3f0de8={};_0x3f0de8[_0x1b4ae8]={'$like':'%'+_0x27bd86['query'][_0x9fa1('0x3d')]+'%'};return _0x3f0de8;})});}_0x4c7f9f=_[_0x9fa1('0x3e')]({},_0x4c7f9f,_0x27bd86['options']);return _0x500547[_0x9fa1('0x56')](_0x4c7f9f);}})[_0x9fa1('0x24')](function(_0x85a1db){if(_0x85a1db){_0x6cfba1=_0x85a1db['length'];if(!_0x27bd86[_0x9fa1('0x31')][_0x9fa1('0x36')](_0x9fa1('0x37'))){_0x4c7f9f[_0x9fa1('0x1c')]=qs['limit'](_0x27bd86['query'][_0x9fa1('0x1c')]);_0x4c7f9f[_0x9fa1('0x1b')]=qs[_0x9fa1('0x1b')](_0x27bd86[_0x9fa1('0x31')]['offset']);}return _0x500547[_0x9fa1('0x56')](_0x4c7f9f);}})[_0x9fa1('0x24')](function(_0x3bd34d){if(_0x3bd34d){return _0x3bd34d?{'count':_0x6cfba1,'rows':_0x3bd34d}:null;}})[_0x9fa1('0x24')](respondWithResult(_0x5c2d2e,null))['catch'](handleError(_0x5c2d2e,null));}; \ No newline at end of file +var _0x68ea=['model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','map','options','includeAll','include','CmCompany','findAll','catch','rawAttributes','intersection','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','ids','omit','getContacts','CmContact','order','pick','html-pdf','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','describe'];(function(_0x51b1d7,_0x2bb562){var _0x32269e=function(_0x1328f3){while(--_0x1328f3){_0x51b1d7['push'](_0x51b1d7['shift']());}};_0x32269e(++_0x2bb562);}(_0x68ea,0x173));var _0xa68e=function(_0x5d1185,_0x124b58){_0x5d1185=_0x5d1185-0x0;var _0x27212b=_0x68ea[_0x5d1185];return _0x27212b;};'use strict';var pdf=require(_0xa68e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa68e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa68e('0x2'));var BPromise=require(_0xa68e('0x3'));var Mustache=require(_0xa68e('0x4'));var util=require(_0xa68e('0x5'));var path=require(_0xa68e('0x6'));var sox=require(_0xa68e('0x7'));var csv=require(_0xa68e('0x8'));var ejs=require(_0xa68e('0x9'));var fs=require('fs');var _=require(_0xa68e('0xa'));var squel=require(_0xa68e('0xb'));var crypto=require(_0xa68e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa68e('0x8'));var querystring=require(_0xa68e('0xd'));var Papa=require(_0xa68e('0xe'));var Redis=require(_0xa68e('0xf'));var authService=require(_0xa68e('0x10'));var qs=require(_0xa68e('0x11'));var as=require(_0xa68e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa68e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa68e('0x14'));var db=require(_0xa68e('0x15'))['db'];function respondWithStatusCode(_0x2bfcaf,_0x345b0e){_0x345b0e=_0x345b0e||0xcc;return function(_0x2b0687){if(_0x2b0687){return _0x2bfcaf[_0xa68e('0x16')](_0x345b0e);}return _0x2bfcaf[_0xa68e('0x17')](_0x345b0e)[_0xa68e('0x18')]();};}function respondWithResult(_0x2038e1,_0x4ecf56){_0x4ecf56=_0x4ecf56||0xc8;return function(_0x5b1291){if(_0x5b1291){return _0x2038e1[_0xa68e('0x17')](_0x4ecf56)['json'](_0x5b1291);}};}function respondWithFilteredResult(_0x7211e9,_0x4b0ebd){return function(_0x4a4f09){if(_0x4a4f09){var _0x2fe7a3=_0x4a4f09[_0xa68e('0x19')],_0x9dad62=_0x4b0ebd[_0xa68e('0x1a')],_0x4bf055=_0x4b0ebd[_0xa68e('0x1a')]+_0x4b0ebd[_0xa68e('0x1b')],_0x420c3d;if(_0x4bf055>=_0x2fe7a3){_0x4bf055=_0x2fe7a3;_0x420c3d=0xc8;}else{_0x420c3d=0xce;}_0x7211e9[_0xa68e('0x17')](_0x420c3d);return _0x7211e9['set'](_0xa68e('0x1c'),_0x9dad62+'-'+_0x4bf055+'/'+_0x2fe7a3)['json'](_0x4a4f09);}return null;};}function patchUpdates(_0x213184){return function(_0x571045){try{jsonpatch[_0xa68e('0x1d')](_0x571045,_0x213184,!![]);}catch(_0x2673fb){return BPromise[_0xa68e('0x1e')](_0x2673fb);}return _0x571045[_0xa68e('0x1f')]();};}function saveUpdates(_0x3b605f,_0x36efbc){return function(_0x3a74e7){if(_0x3a74e7){return _0x3a74e7[_0xa68e('0x20')](_0x3b605f)[_0xa68e('0x21')](function(_0x8afd70){return _0x8afd70;});}return null;};}function removeEntity(_0x4aaca5,_0x18ff36){return function(_0x4c1c8c){if(_0x4c1c8c){return _0x4c1c8c[_0xa68e('0x22')]()['then'](function(){var _0x301646=_0x4c1c8c[_0xa68e('0x23')]({'plain':!![]});var _0x14941e=_0xa68e('0x24');return db[_0xa68e('0x25')]['destroy']({'where':{'type':_0x14941e,'resourceId':_0x301646['id']}})[_0xa68e('0x21')](function(){return _0x4c1c8c;});})['then'](function(){_0x4aaca5['status'](0xcc)[_0xa68e('0x18')]();});}};}function handleEntityNotFound(_0x2d2b2a,_0x46ddd6){return function(_0x3a03fd){if(!_0x3a03fd){_0x2d2b2a['sendStatus'](0x194);}return _0x3a03fd;};}function handleError(_0x198d9d,_0x26ad45){_0x26ad45=_0x26ad45||0x1f4;return function(_0x33b828){logger[_0xa68e('0x26')](_0x33b828[_0xa68e('0x27')]);if(_0x33b828[_0xa68e('0x28')]){delete _0x33b828[_0xa68e('0x28')];}_0x198d9d[_0xa68e('0x17')](_0x26ad45)[_0xa68e('0x29')](_0x33b828);};}exports[_0xa68e('0x2a')]=function(_0x1121bd,_0x19dc3d){var _0x9a5822={},_0x392f68={},_0xc5119={'count':0x0,'rows':[]};return db['CmCompany'][_0xa68e('0x2b')]()['then'](function(_0x15d670){_0x392f68[_0xa68e('0x2c')]=_[_0xa68e('0x2d')](_0x15d670);_0x392f68[_0xa68e('0x2e')]=_[_0xa68e('0x2d')](_0x1121bd[_0xa68e('0x2e')]);_0x392f68['filters']=_['intersection'](_0x392f68[_0xa68e('0x2c')],_0x392f68[_0xa68e('0x2e')]);_0x9a5822[_0xa68e('0x2f')]=_['intersection'](_0x392f68['model'],qs[_0xa68e('0x30')](_0x1121bd[_0xa68e('0x2e')][_0xa68e('0x30')]));_0x9a5822[_0xa68e('0x2f')]=_0x9a5822[_0xa68e('0x2f')][_0xa68e('0x31')]?_0x9a5822['attributes']:_0x392f68[_0xa68e('0x2c')];if(!_0x1121bd['query'][_0xa68e('0x32')](_0xa68e('0x33'))){_0x9a5822['limit']=qs[_0xa68e('0x1b')](_0x1121bd[_0xa68e('0x2e')]['limit']);_0x9a5822[_0xa68e('0x1a')]=qs['offset'](_0x1121bd[_0xa68e('0x2e')]['offset']);}_0x9a5822['order']=qs[_0xa68e('0x34')](_0x1121bd[_0xa68e('0x2e')][_0xa68e('0x34')]);_0x9a5822[_0xa68e('0x35')]=qs[_0xa68e('0x36')](_['pick'](_0x1121bd[_0xa68e('0x2e')],_0x392f68[_0xa68e('0x36')]));if(_0x1121bd['query'][_0xa68e('0x37')]){_0x9a5822[_0xa68e('0x35')]=_[_0xa68e('0x38')](_0x9a5822[_0xa68e('0x35')],{'$or':_[_0xa68e('0x39')](_0x9a5822['attributes'],function(_0x39be60){var _0x9790f3={};_0x9790f3[_0x39be60]={'$like':'%'+_0x1121bd[_0xa68e('0x2e')][_0xa68e('0x37')]+'%'};return _0x9790f3;})});}_0x9a5822=_[_0xa68e('0x38')]({},_0x9a5822,_0x1121bd[_0xa68e('0x3a')]);var _0x46b2d7={'where':_0x9a5822[_0xa68e('0x35')]};return db['CmCompany'][_0xa68e('0x19')](_0x46b2d7)[_0xa68e('0x21')](function(_0x29e285){_0xc5119['count']=_0x29e285;if(_0x1121bd['query'][_0xa68e('0x3b')]){_0x9a5822[_0xa68e('0x3c')]=[{'all':!![]}];}return db[_0xa68e('0x3d')][_0xa68e('0x3e')](_0x9a5822);})[_0xa68e('0x21')](function(_0x47f0aa){_0xc5119['rows']=_0x47f0aa;return _0xc5119;})[_0xa68e('0x21')](respondWithFilteredResult(_0x19dc3d,_0x9a5822))[_0xa68e('0x3f')](handleError(_0x19dc3d,null));})[_0xa68e('0x3f')](handleError(_0x19dc3d,null));};exports['show']=function(_0xb9d6e0,_0x568ffc){var _0x3b32a7={'raw':![],'where':{'id':_0xb9d6e0['params']['id']}},_0xf989f8={};_0xf989f8[_0xa68e('0x2c')]=_[_0xa68e('0x2d')](db[_0xa68e('0x3d')][_0xa68e('0x40')]);_0xf989f8[_0xa68e('0x2e')]=_[_0xa68e('0x2d')](_0xb9d6e0['query']);_0xf989f8[_0xa68e('0x36')]=_[_0xa68e('0x41')](_0xf989f8[_0xa68e('0x2c')],_0xf989f8['query']);_0x3b32a7[_0xa68e('0x2f')]=_[_0xa68e('0x41')](_0xf989f8[_0xa68e('0x2c')],qs['fields'](_0xb9d6e0[_0xa68e('0x2e')]['fields']));_0x3b32a7[_0xa68e('0x2f')]=_0x3b32a7[_0xa68e('0x2f')]['length']?_0x3b32a7[_0xa68e('0x2f')]:_0xf989f8[_0xa68e('0x2c')];if(_0xb9d6e0['query'][_0xa68e('0x3b')]){_0x3b32a7[_0xa68e('0x3c')]=[{'all':!![]}];}_0x3b32a7=_['merge']({},_0x3b32a7,_0xb9d6e0[_0xa68e('0x3a')]);return db[_0xa68e('0x3d')][_0xa68e('0x42')](_0x3b32a7)[_0xa68e('0x21')](handleEntityNotFound(_0x568ffc,null))[_0xa68e('0x21')](respondWithResult(_0x568ffc,null))['catch'](handleError(_0x568ffc,null));};exports['create']=function(_0x378429,_0x4d23fe){return db['CmCompany'][_0xa68e('0x43')](_0x378429['body'],{})[_0xa68e('0x21')](function(_0x562cff){var _0x47a617=_0x378429[_0xa68e('0x44')][_0xa68e('0x23')]({'plain':!![]});if(!_0x47a617)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47a617[_0xa68e('0x45')]===_0xa68e('0x44')){var _0x391b11=_0x562cff['get']({'plain':!![]});var _0x940fe7=_0xa68e('0x24');return db[_0xa68e('0x46')][_0xa68e('0x42')]({'where':{'name':_0x940fe7,'userProfileId':_0x47a617[_0xa68e('0x47')]},'raw':!![]})[_0xa68e('0x21')](function(_0x41cce1){if(_0x41cce1&&_0x41cce1[_0xa68e('0x48')]===0x0){return db[_0xa68e('0x25')][_0xa68e('0x43')]({'name':_0x391b11[_0xa68e('0x28')],'resourceId':_0x391b11['id'],'type':_0x41cce1[_0xa68e('0x28')],'sectionId':_0x41cce1['id']},{})[_0xa68e('0x21')](function(){return _0x562cff;});}else{return _0x562cff;}})['catch'](function(_0x500bab){logger['error'](_0xa68e('0x49'),_0x500bab);throw _0x500bab;});}return _0x562cff;})[_0xa68e('0x21')](respondWithResult(_0x4d23fe,0xc9))[_0xa68e('0x3f')](handleError(_0x4d23fe,null));};exports[_0xa68e('0x20')]=function(_0x166ce0,_0x4355eb){if(_0x166ce0[_0xa68e('0x4a')]['id']){delete _0x166ce0['body']['id'];}return db[_0xa68e('0x3d')][_0xa68e('0x42')]({'where':{'id':_0x166ce0[_0xa68e('0x4b')]['id']}})[_0xa68e('0x21')](handleEntityNotFound(_0x4355eb,null))[_0xa68e('0x21')](saveUpdates(_0x166ce0[_0xa68e('0x4a')],null))[_0xa68e('0x21')](respondWithResult(_0x4355eb,null))['catch'](handleError(_0x4355eb,null));};exports[_0xa68e('0x22')]=function(_0x40fc42,_0x37319a){return db[_0xa68e('0x3d')][_0xa68e('0x42')]({'where':{'id':_0x40fc42[_0xa68e('0x4b')]['id']}})[_0xa68e('0x21')](handleEntityNotFound(_0x37319a,null))[_0xa68e('0x21')](removeEntity(_0x37319a,null))[_0xa68e('0x3f')](handleError(_0x37319a,null));};exports['describe']=function(_0x2b91ef,_0x47c946){return db[_0xa68e('0x3d')]['describe']()[_0xa68e('0x21')](respondWithResult(_0x47c946,null))[_0xa68e('0x3f')](handleError(_0x47c946,null));};exports['addContacts']=function(_0x5f0e7d,_0x340c35,_0x49e39d){return db['CmContact'][_0xa68e('0x42')]({'where':{'id':_0x5f0e7d[_0xa68e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x340c35,null))[_0xa68e('0x21')](function(_0x3f1779){if(_0x3f1779){return _0x3f1779[_0xa68e('0x4c')](_0x5f0e7d[_0xa68e('0x4a')][_0xa68e('0x4d')],_[_0xa68e('0x4e')](_0x5f0e7d[_0xa68e('0x4a')],[_0xa68e('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x340c35,null))['catch'](handleError(_0x340c35,null));};exports[_0xa68e('0x4f')]=function(_0x3f3100,_0x4100d6,_0x4559d7){var _0x4646ae={};var _0x1834ab={};var _0x446989;var _0xf736c0;return db[_0xa68e('0x3d')]['findOne']({'where':{'id':_0x3f3100[_0xa68e('0x4b')]['id']}})[_0xa68e('0x21')](handleEntityNotFound(_0x4100d6,null))['then'](function(_0xc4dc8a){if(_0xc4dc8a){_0x446989=_0xc4dc8a;_0x1834ab[_0xa68e('0x2c')]=_['keys'](db[_0xa68e('0x50')][_0xa68e('0x40')]);_0x1834ab[_0xa68e('0x2e')]=_[_0xa68e('0x2d')](_0x3f3100[_0xa68e('0x2e')]);_0x1834ab['filters']=_[_0xa68e('0x41')](_0x1834ab[_0xa68e('0x2c')],_0x1834ab[_0xa68e('0x2e')]);_0x4646ae[_0xa68e('0x2f')]=_[_0xa68e('0x41')](_0x1834ab[_0xa68e('0x2c')],qs[_0xa68e('0x30')](_0x3f3100[_0xa68e('0x2e')][_0xa68e('0x30')]));_0x4646ae['attributes']=_0x4646ae[_0xa68e('0x2f')][_0xa68e('0x31')]?_0x4646ae[_0xa68e('0x2f')]:_0x1834ab[_0xa68e('0x2c')];_0x4646ae[_0xa68e('0x51')]=qs['sort'](_0x3f3100['query'][_0xa68e('0x34')]);_0x4646ae[_0xa68e('0x35')]=qs[_0xa68e('0x36')](_[_0xa68e('0x52')](_0x3f3100[_0xa68e('0x2e')],_0x1834ab[_0xa68e('0x36')]));if(_0x3f3100[_0xa68e('0x2e')]['filter']){_0x4646ae[_0xa68e('0x35')]=_['merge'](_0x4646ae[_0xa68e('0x35')],{'$or':_[_0xa68e('0x39')](_0x4646ae[_0xa68e('0x2f')],function(_0x57e5ed){var _0x22eeec={};_0x22eeec[_0x57e5ed]={'$like':'%'+_0x3f3100[_0xa68e('0x2e')][_0xa68e('0x37')]+'%'};return _0x22eeec;})});}_0x4646ae=_[_0xa68e('0x38')]({},_0x4646ae,_0x3f3100['options']);return _0x446989[_0xa68e('0x4f')](_0x4646ae);}})[_0xa68e('0x21')](function(_0x12e720){if(_0x12e720){_0xf736c0=_0x12e720[_0xa68e('0x31')];if(!_0x3f3100['query'][_0xa68e('0x32')](_0xa68e('0x33'))){_0x4646ae[_0xa68e('0x1b')]=qs[_0xa68e('0x1b')](_0x3f3100[_0xa68e('0x2e')][_0xa68e('0x1b')]);_0x4646ae['offset']=qs['offset'](_0x3f3100[_0xa68e('0x2e')]['offset']);}return _0x446989[_0xa68e('0x4f')](_0x4646ae);}})[_0xa68e('0x21')](function(_0x3f6bc8){if(_0x3f6bc8){return _0x3f6bc8?{'count':_0xf736c0,'rows':_0x3f6bc8}:null;}})[_0xa68e('0x21')](respondWithResult(_0x4100d6,null))['catch'](handleError(_0x4100d6,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 4d50add..8e86407 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 _0xf2cf=['./cmCompany.attributes','CmCompany','cm_companies','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4585ce,_0xbdd351){var _0xba5507=function(_0x3106aa){while(--_0x3106aa){_0x4585ce['push'](_0x4585ce['shift']());}};_0xba5507(++_0xbdd351);}(_0xf2cf,0xf5));var _0xff2c=function(_0x32f29a,_0x3edf1d){_0x32f29a=_0x32f29a-0x0;var _0x373a0e=_0xf2cf[_0x32f29a];return _0x373a0e;};'use strict';var _=require('lodash');var util=require(_0xff2c('0x0'));var logger=require(_0xff2c('0x1'))(_0xff2c('0x2'));var moment=require('moment');var BPromise=require(_0xff2c('0x3'));var rp=require(_0xff2c('0x4'));var fs=require('fs');var path=require(_0xff2c('0x5'));var rimraf=require(_0xff2c('0x6'));var config=require(_0xff2c('0x7'));var attributes=require(_0xff2c('0x8'));module['exports']=function(_0x8f0f4,_0x68b356){return _0x8f0f4['define'](_0xff2c('0x9'),attributes,{'tableName':_0xff2c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80d9=['api','moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','cm_companies','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x80d9,0x15c));var _0x980d=function(_0x37dc50,_0x3ef602){_0x37dc50=_0x37dc50-0x0;var _0x2b100b=_0x80d9[_0x37dc50];return _0x2b100b;};'use strict';var _=require(_0x980d('0x0'));var util=require('util');var logger=require(_0x980d('0x1'))(_0x980d('0x2'));var moment=require(_0x980d('0x3'));var BPromise=require('bluebird');var rp=require(_0x980d('0x4'));var fs=require('fs');var path=require(_0x980d('0x5'));var rimraf=require(_0x980d('0x6'));var config=require(_0x980d('0x7'));var attributes=require(_0x980d('0x8'));module['exports']=function(_0x4c3533,_0x2fd4b9){return _0x4c3533['define']('CmCompany',attributes,{'tableName':_0x980d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index abc7373..4ccaf85 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 _0x3c02=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','CmCompany,\x20%s,\x20%s'];(function(_0x3505a3,_0x3921c3){var _0x45b858=function(_0x5d7bef){while(--_0x5d7bef){_0x3505a3['push'](_0x3505a3['shift']());}};_0x45b858(++_0x3921c3);}(_0x3c02,0xc9));var _0x23c0=function(_0x3286d6,_0x8a37d3){_0x3286d6=_0x3286d6-0x0;var _0x5c9fb1=_0x3c02[_0x3286d6];return _0x5c9fb1;};'use strict';var _=require(_0x23c0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x23c0('0x1'));var rs=require(_0x23c0('0x2'));var fs=require('fs');var Redis=require(_0x23c0('0x3'));var db=require(_0x23c0('0x4'))['db'];var utils=require(_0x23c0('0x5'));var logger=require(_0x23c0('0x6'))(_0x23c0('0x7'));var config=require(_0x23c0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x23c0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe3ab78,_0x5c9df7,_0xe37e9d){return new BPromise(function(_0x1e41ea,_0x49a3b4){return client[_0x23c0('0xa')](_0xe3ab78,_0xe37e9d)[_0x23c0('0xb')](function(_0x237af0){logger[_0x23c0('0xc')]('CmCompany,\x20%s,\x20%s',_0x5c9df7,_0x23c0('0xd'));logger[_0x23c0('0xe')](_0x23c0('0xf'),_0x5c9df7,_0x23c0('0xd'),JSON['stringify'](_0x237af0));if(_0x237af0[_0x23c0('0x10')]){if(_0x237af0[_0x23c0('0x10')][_0x23c0('0x11')]===0x1f4){logger[_0x23c0('0x10')](_0x23c0('0x12'),_0x5c9df7,_0x237af0[_0x23c0('0x10')]['message']);return _0x49a3b4(_0x237af0['error'][_0x23c0('0x13')]);}logger[_0x23c0('0x10')](_0x23c0('0x12'),_0x5c9df7,_0x237af0[_0x23c0('0x10')][_0x23c0('0x13')]);return _0x1e41ea(_0x237af0['error']['message']);}else{logger[_0x23c0('0xc')](_0x23c0('0x12'),_0x5c9df7,'request\x20sent');_0x1e41ea(_0x237af0[_0x23c0('0x14')][_0x23c0('0x13')]);}})[_0x23c0('0x15')](function(_0x3ff7b9){logger[_0x23c0('0x10')](_0x23c0('0x12'),_0x5c9df7,_0x3ff7b9);_0x49a3b4(_0x3ff7b9);});});} \ No newline at end of file +var _0xeffc=['message','catch','lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x426426,_0x209951){var _0x45c288=function(_0x3c2203){while(--_0x3c2203){_0x426426['push'](_0x426426['shift']());}};_0x45c288(++_0x209951);}(_0xeffc,0x17c));var _0xceff=function(_0x295ce7,_0x4052b4){_0x295ce7=_0x295ce7-0x0;var _0x236656=_0xeffc[_0x295ce7];return _0x236656;};'use strict';var _=require(_0xceff('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xceff('0x1'));var fs=require('fs');var Redis=require(_0xceff('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xceff('0x3'));var logger=require('../../config/logger')(_0xceff('0x4'));var config=require(_0xceff('0x5'));var jayson=require(_0xceff('0x6'));var client=jayson[_0xceff('0x7')][_0xceff('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbf0aef,_0x137b4a,_0xf351af){return new BPromise(function(_0x780009,_0x3b788b){return client[_0xceff('0x9')](_0xbf0aef,_0xf351af)[_0xceff('0xa')](function(_0x24b81b){logger[_0xceff('0xb')](_0xceff('0xc'),_0x137b4a,_0xceff('0xd'));logger[_0xceff('0xe')](_0xceff('0xf'),_0x137b4a,_0xceff('0xd'),JSON[_0xceff('0x10')](_0x24b81b));if(_0x24b81b[_0xceff('0x11')]){if(_0x24b81b[_0xceff('0x11')][_0xceff('0x12')]===0x1f4){logger[_0xceff('0x11')]('CmCompany,\x20%s,\x20%s',_0x137b4a,_0x24b81b[_0xceff('0x11')][_0xceff('0x13')]);return _0x3b788b(_0x24b81b[_0xceff('0x11')]['message']);}logger['error'](_0xceff('0xc'),_0x137b4a,_0x24b81b[_0xceff('0x11')][_0xceff('0x13')]);return _0x780009(_0x24b81b[_0xceff('0x11')]['message']);}else{logger[_0xceff('0xb')]('CmCompany,\x20%s,\x20%s',_0x137b4a,_0xceff('0xd'));_0x780009(_0x24b81b['result'][_0xceff('0x13')]);}})[_0xceff('0x14')](function(_0x5dc57e){logger[_0xceff('0x11')](_0xceff('0xc'),_0x137b4a,_0x5dc57e);_0x3b788b(_0x5dc57e);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 4f960e9..e5f0f8a 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 _0x4888=['show','/:id/contacts','getContacts','post','create','addContacts','/:id','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x4888,0x198));var _0x8488=function(_0xa39b2b,_0x8c128c){_0xa39b2b=_0xa39b2b-0x0;var _0x54d7f3=_0x4888[_0xa39b2b];return _0x54d7f3;};'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 auth=require(_0x8488('0x5'));var interaction=require(_0x8488('0x6'));var config=require('../../config/environment');var controller=require(_0x8488('0x7'));router[_0x8488('0x8')]('/',auth[_0x8488('0x9')](),controller[_0x8488('0xa')]);router[_0x8488('0x8')](_0x8488('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x8488('0x9')](),controller[_0x8488('0xc')]);router['get'](_0x8488('0xd'),auth[_0x8488('0x9')](),controller[_0x8488('0xe')]);router[_0x8488('0xf')]('/',auth['isAuthenticated'](),controller[_0x8488('0x10')]);router[_0x8488('0xf')](_0x8488('0xd'),auth[_0x8488('0x9')](),controller[_0x8488('0x11')]);router['put'](_0x8488('0x12'),auth[_0x8488('0x9')](),controller['update']);router['delete'](_0x8488('0x12'),auth['isAuthenticated'](),controller[_0x8488('0x13')]);module['exports']=router; \ No newline at end of file +var _0x583c=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./cmCompany.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/contacts','getContacts','create'];(function(_0x131bb1,_0x5c91cc){var _0x4b006b=function(_0x236496){while(--_0x236496){_0x131bb1['push'](_0x131bb1['shift']());}};_0x4b006b(++_0x5c91cc);}(_0x583c,0x12b));var _0xc583=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x583c[_0x2283dc];return _0x16db90;};'use strict';var multer=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var path=require(_0xc583('0x2'));var timeout=require(_0xc583('0x3'));var express=require('express');var router=express[_0xc583('0x4')]();var auth=require(_0xc583('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc583('0x6'));router[_0xc583('0x7')]('/',auth['isAuthenticated'](),controller[_0xc583('0x8')]);router[_0xc583('0x7')](_0xc583('0x9'),auth[_0xc583('0xa')](),controller['describe']);router[_0xc583('0x7')](_0xc583('0xb'),auth['isAuthenticated'](),controller[_0xc583('0xc')]);router[_0xc583('0x7')](_0xc583('0xd'),auth[_0xc583('0xa')](),controller[_0xc583('0xe')]);router['post']('/',auth[_0xc583('0xa')](),controller[_0xc583('0xf')]);router['post'](_0xc583('0xd'),auth[_0xc583('0xa')](),controller['addContacts']);router[_0xc583('0x10')](_0xc583('0xb'),auth[_0xc583('0xa')](),controller[_0xc583('0x11')]);router[_0xc583('0x12')](_0xc583('0xb'),auth[_0xc583('0xa')](),controller[_0xc583('0x13')]);module[_0xc583('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 0ef1a86..7afc06e 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 _0xac80=['INTEGER','DATE','NOW','lodash','STRING','TEXT'];(function(_0x3dfcef,_0x407f9d){var _0x248d9d=function(_0x2a619c){while(--_0x2a619c){_0x3dfcef['push'](_0x3dfcef['shift']());}};_0x248d9d(++_0x407f9d);}(_0xac80,0x1b3));var _0x0ac8=function(_0x464c43,_0x594dcb){_0x464c43=_0x464c43-0x0;var _0x5e46e8=_0xac80[_0x464c43];return _0x5e46e8;};'use strict';var _=require(_0x0ac8('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x0ac8('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x0ac8('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x0ac8('0x1')]},'dateOfBirth':{'type':Sequelize[_0x0ac8('0x1')]},'description':{'type':Sequelize[_0x0ac8('0x2')]},'phone':{'type':Sequelize[_0x0ac8('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x0ac8('0x1')]},'email':{'type':Sequelize[_0x0ac8('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x0ac8('0x1')]},'fb_data':{'type':Sequelize[_0x0ac8('0x1')]},'twitter':{'type':Sequelize[_0x0ac8('0x1')]},'skype':{'type':Sequelize[_0x0ac8('0x1')]},'teams':{'type':Sequelize[_0x0ac8('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x0ac8('0x1')]},'telegram':{'type':Sequelize[_0x0ac8('0x1')]},'UserId':{'type':Sequelize[_0x0ac8('0x3')]},'priority':{'type':Sequelize[_0x0ac8('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0ac8('0x4')],'defaultValue':Sequelize[_0x0ac8('0x5')]}}; \ No newline at end of file +var _0xb1d7=['exports','STRING','TEXT','INTEGER','UNSIGNED','NOW','sequelize'];(function(_0x5afbd5,_0x48a693){var _0x298511=function(_0x2f4262){while(--_0x2f4262){_0x5afbd5['push'](_0x5afbd5['shift']());}};_0x298511(++_0x48a693);}(_0xb1d7,0x172));var _0x7b1d=function(_0x4bb8fe,_0x4935c4){_0x4bb8fe=_0x4bb8fe-0x0;var _0xcf5a78=_0xb1d7[_0x4bb8fe];return _0xcf5a78;};'use strict';var _=require('lodash');var Sequelize=require(_0x7b1d('0x0'));module[_0x7b1d('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x7b1d('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x7b1d('0x2')]},'city':{'type':Sequelize[_0x7b1d('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x7b1d('0x2')]},'description':{'type':Sequelize[_0x7b1d('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x7b1d('0x2')]},'email':{'type':Sequelize[_0x7b1d('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x7b1d('0x2')]},'fb_data':{'type':Sequelize[_0x7b1d('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x7b1d('0x2')]},'viber':{'type':Sequelize[_0x7b1d('0x2')]},'line':{'type':Sequelize[_0x7b1d('0x2')]},'wechat':{'type':Sequelize[_0x7b1d('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x7b1d('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x7b1d('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x7b1d('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index bf04b90..815a9b8 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 _0x96d0=['merge','c.phone','c.ListId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','rows','params','catch','tags','startsWith','columnName','displayName','findAll','custom','values','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','bulkCreate','each','duplicates','findOrCreate','spread','show','Tags','format','$and','pickBy','cf_%d','table','setFields','id\x20=\x20?','phone','getTags','rawAttributes','options','setTags','ids','getHoppers','ContactId','includeAll','include','CmHopper','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','upload','createReadStream','parse','file','meta','import','agent','No\x20ListId\x20specified','binding','No\x20firstName\x20column\x20specified','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','error\x20child\x20process','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','end','status','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','sendStatus','stack','name','send','index','CmContact','describe','keys','length','push','CmCustomField','findOne','trimStart','cf_','all','fieldType','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','field','color','select','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','parseSearch','search','sqlOperator','conditions','find','Tag','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','castTo','DATE','text','start','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','tag','isArray','filter','replace','\x27\x27\x27\x27','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy'];(function(_0x50e7a1,_0x4d286e){var _0x535ccf=function(_0x3f1cc7){while(--_0x3f1cc7){_0x50e7a1['push'](_0x50e7a1['shift']());}};_0x535ccf(++_0x4d286e);}(_0x96d0,0x14f));var _0x096d=function(_0x232965,_0x21fcfc){_0x232965=_0x232965-0x0;var _0x8567ab=_0x96d0[_0x232965];return _0x8567ab;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x096d('0x0'));var zipdir=require(_0x096d('0x1'));var jsonpatch=require(_0x096d('0x2'));var rp=require(_0x096d('0x3'));var moment=require('moment');var BPromise=require(_0x096d('0x4'));var Mustache=require('mustache');var util=require(_0x096d('0x5'));var path=require(_0x096d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x096d('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x096d('0x8'));var crypto=require(_0x096d('0x9'));var jsforce=require(_0x096d('0xa'));var deskjs=require(_0x096d('0xb'));var toCsv=require(_0x096d('0xc'));var querystring=require(_0x096d('0xd'));var Papa=require(_0x096d('0xe'));var Redis=require(_0x096d('0xf'));var authService=require(_0x096d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x096d('0x11'));var hardwareService=require(_0x096d('0x12'));var logger=require(_0x096d('0x13'))(_0x096d('0x14'));var utils=require(_0x096d('0x15'));var config=require(_0x096d('0x16'));var db=require(_0x096d('0x17'))['db'];config[_0x096d('0x18')]=_[_0x096d('0x19')](config[_0x096d('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x096d('0x1a'))(new Redis(config[_0x096d('0x18')]));require(_0x096d('0x1b'))[_0x096d('0x1c')](socket);function respondWithStatusCode(_0x57e8f3,_0x1d5210){_0x1d5210=_0x1d5210||0xcc;return function(_0x4641fc){if(_0x4641fc){return _0x57e8f3['sendStatus'](_0x1d5210);}return _0x57e8f3['status'](_0x1d5210)[_0x096d('0x1d')]();};}function respondWithResult(_0x343274,_0x381ee2){_0x381ee2=_0x381ee2||0xc8;return function(_0x1f61b0){if(_0x1f61b0){return _0x343274[_0x096d('0x1e')](_0x381ee2)['json'](_0x1f61b0);}};}function respondWithFilteredResult(_0x515a44,_0x49c8c){return function(_0x1f7565){if(_0x1f7565){var _0x21e731=_0x1f7565[_0x096d('0x1f')],_0x35648a=_0x49c8c[_0x096d('0x20')],_0x20b151=_0x49c8c['offset']+_0x49c8c[_0x096d('0x21')],_0xecb8de;if(_0x20b151>=_0x21e731){_0x20b151=_0x21e731;_0xecb8de=0xc8;}else{_0xecb8de=0xce;}_0x515a44[_0x096d('0x1e')](_0xecb8de);return _0x515a44['set'](_0x096d('0x22'),_0x35648a+'-'+_0x20b151+'/'+_0x21e731)[_0x096d('0x23')](_0x1f7565);}return null;};}function patchUpdates(_0x42ce69){return function(_0x34d0c2){try{jsonpatch['apply'](_0x34d0c2,_0x42ce69,!![]);}catch(_0x3d273e){return BPromise[_0x096d('0x24')](_0x3d273e);}return _0x34d0c2[_0x096d('0x25')]();};}function saveUpdates(_0x405c1c,_0x4acc45){return function(_0x19cd99){if(_0x19cd99){return _0x19cd99[_0x096d('0x26')](_0x405c1c)[_0x096d('0x27')](function(_0x7d1895){return _0x7d1895;});}return null;};}function removeEntity(_0x507321,_0x35d5ac){return function(_0x4640b1){if(_0x4640b1){return _0x4640b1[_0x096d('0x28')]()[_0x096d('0x27')](function(){_0x507321[_0x096d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39ab6e,_0xe89dab){return function(_0x373a6c){if(!_0x373a6c){_0x39ab6e[_0x096d('0x29')](0x194);}return _0x373a6c;};}function handleError(_0x260ace,_0x5e624e){_0x5e624e=_0x5e624e||0x1f4;return function(_0x19c166){logger['error'](_0x19c166[_0x096d('0x2a')]);if(_0x19c166[_0x096d('0x2b')]){delete _0x19c166['name'];}_0x260ace[_0x096d('0x1e')](_0x5e624e)[_0x096d('0x2c')](_0x19c166);};}exports[_0x096d('0x2d')]=function(_0x969145,_0x176664){var _0x4a2722={},_0x440a67={},_0x349987={'count':0x0,'rows':[]};return db[_0x096d('0x2e')][_0x096d('0x2f')]()['then'](function(_0x1a9937){var _0x5877ee=[];for(var _0x33cb8b=0x0;_0x33cb8b0x1){_0x3bc3bc['or'](_0x096d('0x71'),qs[_0x096d('0x72')](_0x1f053f),null);}else{if(qs['isNumeric'](_0x1f053f)){_0x3bc3bc['or']('c.id\x20LIKE\x20?',_0x1f053f+'%');_0x3bc3bc['or']('c.phone\x20LIKE\x20?',_0x1f053f+'%');_0x3bc3bc['or']('c.mobile\x20LIKE\x20?',_0x1f053f+'%');_0x3bc3bc['or'](_0x096d('0x73'),_0x1f053f+'%');}else if(qs[_0x096d('0x74')](_0x1f053f)){_0x3bc3bc['or'](_0x096d('0x75'),_0x1f053f+'%');}else{_0x3bc3bc['or']('c.firstName\x20LIKE\x20?','%'+_0x1f053f+'%');_0x3bc3bc['or'](_0x096d('0x76'),'%'+_0x1f053f+'%');_0x3bc3bc['or']('c.email\x20LIKE\x20?','%'+_0x1f053f+'%');}}}}_0x112891[_0x096d('0x43')](_0x3bc3bc);_0x112891[_0x096d('0x77')](_0x096d('0x78'));var _0x29a225={'type':db['Sequelize'][_0x096d('0x79')][_0x096d('0x7a')],'raw':!![]};var _0x350470=_0x112891[_0x096d('0x7b')]()[_0x096d('0x46')]('c.id');if(_0x4a2722['order']){_0x4a2722['order'][_0x096d('0x5a')](function(_0x43eb7a){_0x112891[_0x096d('0x41')]('c.'+_0x43eb7a[0x0],_0x43eb7a[0x1]===_0x096d('0x7c')?![]:!![]);});}if(!_[_0x096d('0x67')](_0x56d854)){_0x112891[_0x096d('0x7d')](_0x3dfe40);_0x350470[_0x096d('0x43')](_0x096d('0x7e'),_0x56d854);}BPromise['resolve']()[_0x096d('0x27')](function(){if(_0x774909&&!_[_0x096d('0x7f')](_0x774909[_0x096d('0x55')],[_0x096d('0x46'),_0x096d('0x5d')])){return _0x969145['user'][_0x096d('0x80')]({'attributes':['id'],'raw':!![]})[_0x096d('0x27')](function(_0x23144e){if(_[_0x096d('0x67')](_0x23144e)){_0x350470[_0x096d('0x43')](_0x096d('0x81'));_0x112891['where']('c.ListId\x20IS\x20NULL');}else{_0x350470[_0x096d('0x43')](_0x096d('0x69'),_['map'](_0x23144e,'id'));_0x112891['where'](_0x096d('0x69'),_[_0x096d('0x59')](_0x23144e,'id'));}});}else{return;}})[_0x096d('0x27')](function(){db[_0x096d('0x82')][_0x096d('0x3b')](_0x350470['toString'](),_0x29a225)['then'](function(_0x1200b1){_0x349987['count']=_0x1200b1[_0x096d('0x31')];if(_0x349987[_0x096d('0x1f')]===0x0)return[];return db[_0x096d('0x82')][_0x096d('0x3b')](_0x332785[_0x096d('0x83')](),_0x29a225);})[_0x096d('0x27')](function(_0x4cf582){_0xaec8c1=_[_0x096d('0x84')](_0x4cf582,'id');_0x29a225=_[_0x096d('0x85')](_0x29a225,{'model':db[_0x096d('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x969145[_0x096d('0x3b')][_0x096d('0x3e')]){_0x4a2722[_0x096d('0x3d')]['forEach'](function(_0x2ed839){_0x112891[_0x096d('0x46')]('c.'+_0x2ed839);});}else{_0x112891[_0x096d('0x46')]('c.id');_0x112891['field']('c.firstName');_0x112891[_0x096d('0x46')]('c.lastName');_0x112891[_0x096d('0x46')](_0x096d('0x86'));_0x112891[_0x096d('0x46')]('c.mobile');_0x112891[_0x096d('0x46')]('c.fax');_0x112891[_0x096d('0x46')]('c.email');_0x112891['field'](_0x096d('0x87'));_0x112891[_0x096d('0x46')](_0x096d('0x88'));_0x112891[_0x096d('0x46')](_0x096d('0x89'),'TagIds');}if(_0x4a2722[_0x096d('0x21')])_0x112891[_0x096d('0x21')](_0x4a2722[_0x096d('0x21')]);if(_0x4a2722[_0x096d('0x20')])_0x112891[_0x096d('0x20')](_0x4a2722[_0x096d('0x20')]);return db[_0x096d('0x82')][_0x096d('0x3b')](_0x112891[_0x096d('0x83')](),_0x29a225);})[_0x096d('0x27')](function(_0x18de06){_0x18de06['forEach'](function(_0x562c62){if(_0x562c62[_0x096d('0x8a')]){_0x562c62['Tags']=[];_0x562c62[_0x096d('0x8a')]['split'](',')['forEach'](function(_0x14a21f){_0x562c62['Tags'][_0x096d('0x32')](_0xaec8c1[_0x14a21f]);});}delete _0x562c62[_0x096d('0x8a')];});_0x349987[_0x096d('0x8b')]=_0x18de06;return _0x349987;})[_0x096d('0x27')](respondWithFilteredResult(_0x176664,_0x4a2722));});})['catch'](handleError(_0x176664,null));};exports['destroy']=function(_0x3180b3,_0x154268){return db[_0x096d('0x2e')][_0x096d('0x56')]({'where':{'id':_0x3180b3[_0x096d('0x8c')]['id']}})['then'](handleEntityNotFound(_0x154268,null))[_0x096d('0x27')](removeEntity(_0x154268,null))[_0x096d('0x8d')](handleError(_0x154268,null));};exports[_0x096d('0x2f')]=function(_0x37f6c4,_0x5e271d){return db[_0x096d('0x2e')][_0x096d('0x2f')]()[_0x096d('0x27')](function(_0x3cebd5){delete _0x3cebd5[_0x096d('0x8e')];for(var _0x15a317=0x0;_0x15a317=_0x15f5c4){_0x67239e=_0x15f5c4;_0x3dfd6c=0xc8;}else{_0x3dfd6c=0xce;}_0x40afb3['status'](_0x3dfd6c);return _0x40afb3[_0x9889('0x23')](_0x9889('0x24'),_0x331e59+'-'+_0x67239e+'/'+_0x15f5c4)[_0x9889('0x20')](_0x8a6c64);}return null;};}function patchUpdates(_0x2c9279){return function(_0x454f57){try{jsonpatch[_0x9889('0x25')](_0x454f57,_0x2c9279,!![]);}catch(_0x520ba1){return BPromise[_0x9889('0x26')](_0x520ba1);}return _0x454f57[_0x9889('0x27')]();};}function saveUpdates(_0x1e7a1c,_0x15d045){return function(_0x56ce9a){if(_0x56ce9a){return _0x56ce9a[_0x9889('0x28')](_0x1e7a1c)[_0x9889('0x29')](function(_0x262ce7){return _0x262ce7;});}return null;};}function removeEntity(_0x4110f8,_0x3db611){return function(_0x3f6246){if(_0x3f6246){return _0x3f6246[_0x9889('0x2a')]()[_0x9889('0x29')](function(){_0x4110f8[_0x9889('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x511ef2,_0x36b56f){return function(_0x3be8ef){if(!_0x3be8ef){_0x511ef2[_0x9889('0x2b')](0x194);}return _0x3be8ef;};}function handleError(_0x13a7e0,_0xfaed19){_0xfaed19=_0xfaed19||0x1f4;return function(_0x351a82){logger[_0x9889('0x2c')](_0x351a82[_0x9889('0x2d')]);if(_0x351a82[_0x9889('0x2e')]){delete _0x351a82[_0x9889('0x2e')];}_0x13a7e0[_0x9889('0x1e')](_0xfaed19)[_0x9889('0x2f')](_0x351a82);};}exports[_0x9889('0x30')]=function(_0x56e2f9,_0x13e690){var _0x164d59={},_0x450c2b={},_0x47d35e={'count':0x0,'rows':[]};return db[_0x9889('0x31')][_0x9889('0x32')]()[_0x9889('0x29')](function(_0x5901d8){var _0x5af202=[];for(var _0x6ff547=0x0;_0x6ff5470x1){_0x3bef17['or'](_0x9889('0x70'),qs[_0x9889('0x71')](_0x455707),null);}else{if(qs[_0x9889('0x72')](_0x455707)){_0x3bef17['or'](_0x9889('0x73'),_0x455707+'%');_0x3bef17['or'](_0x9889('0x74'),_0x455707+'%');_0x3bef17['or'](_0x9889('0x75'),_0x455707+'%');_0x3bef17['or'](_0x9889('0x76'),_0x455707+'%');}else if(qs[_0x9889('0x77')](_0x455707)){_0x3bef17['or']('c.email\x20LIKE\x20?',_0x455707+'%');}else{_0x3bef17['or'](_0x9889('0x78'),'%'+_0x455707+'%');_0x3bef17['or'](_0x9889('0x79'),'%'+_0x455707+'%');_0x3bef17['or'](_0x9889('0x7a'),'%'+_0x455707+'%');}}}}_0x3b8c91['where'](_0x3bef17);_0x3b8c91[_0x9889('0x7b')](_0x9889('0x7c'));var _0x311672={'type':db['Sequelize']['QueryTypes'][_0x9889('0x7d')],'raw':!![]};var _0x5cc0be=_0x3b8c91[_0x9889('0x7e')]()[_0x9889('0x47')](_0x9889('0x7c'));if(_0x164d59['order']){_0x164d59[_0x9889('0x44')][_0x9889('0x5b')](function(_0x2389ed){_0x3b8c91[_0x9889('0x44')]('c.'+_0x2389ed[0x0],_0x2389ed[0x1]===_0x9889('0x7f')?![]:!![]);});}if(!_[_0x9889('0x80')](_0x3008d0)){_0x3b8c91['having'](_0x3c7693);_0x5cc0be[_0x9889('0x52')](_0x9889('0x81'),_0x3008d0);}BPromise[_0x9889('0x82')]()['then'](function(){if(_0x5f53cd&&!_['some'](_0x5f53cd['conditions'],['field','User'])){return _0x56e2f9['user'][_0x9889('0x83')]({'attributes':['id'],'raw':!![]})[_0x9889('0x29')](function(_0x6c5474){if(_[_0x9889('0x80')](_0x6c5474)){_0x5cc0be[_0x9889('0x52')](_0x9889('0x84'));_0x3b8c91[_0x9889('0x52')](_0x9889('0x84'));}else{_0x5cc0be[_0x9889('0x52')](_0x9889('0x6a'),_[_0x9889('0x5a')](_0x6c5474,'id'));_0x3b8c91[_0x9889('0x52')](_0x9889('0x6a'),_[_0x9889('0x5a')](_0x6c5474,'id'));}});}else{return;}})[_0x9889('0x29')](function(){db[_0x9889('0x85')]['query'](_0x5cc0be[_0x9889('0x86')](),_0x311672)[_0x9889('0x29')](function(_0x502522){_0x47d35e[_0x9889('0x87')]=_0x502522[_0x9889('0x33')];if(_0x47d35e[_0x9889('0x87')]===0x0)return[];return db[_0x9889('0x85')][_0x9889('0x3e')](_0x503e9a[_0x9889('0x86')](),_0x311672);})[_0x9889('0x29')](function(_0x342c40){_0x35bce5=_['keyBy'](_0x342c40,'id');_0x311672=_[_0x9889('0x88')](_0x311672,{'model':db[_0x9889('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x56e2f9[_0x9889('0x3e')][_0x9889('0x40')]){_0x164d59['attributes'][_0x9889('0x5b')](function(_0x3a89d0){_0x3b8c91[_0x9889('0x47')]('c.'+_0x3a89d0);});}else{_0x3b8c91[_0x9889('0x47')](_0x9889('0x7c'));_0x3b8c91['field'](_0x9889('0x89'));_0x3b8c91['field'](_0x9889('0x8a'));_0x3b8c91[_0x9889('0x47')](_0x9889('0x8b'));_0x3b8c91[_0x9889('0x47')](_0x9889('0x8c'));_0x3b8c91[_0x9889('0x47')]('c.fax');_0x3b8c91[_0x9889('0x47')](_0x9889('0x8d'));_0x3b8c91[_0x9889('0x47')](_0x9889('0x8e'));_0x3b8c91[_0x9889('0x47')]('c.deletedAt');_0x3b8c91['field'](_0x9889('0x8f'),_0x9889('0x90'));}if(_0x164d59[_0x9889('0x22')])_0x3b8c91['limit'](_0x164d59['limit']);if(_0x164d59[_0x9889('0x21')])_0x3b8c91[_0x9889('0x21')](_0x164d59['offset']);return db[_0x9889('0x85')][_0x9889('0x3e')](_0x3b8c91[_0x9889('0x86')](),_0x311672);})['then'](function(_0x11f211){_0x11f211[_0x9889('0x5b')](function(_0x74ef12){if(_0x74ef12[_0x9889('0x90')]){_0x74ef12[_0x9889('0x91')]=[];_0x74ef12[_0x9889('0x90')][_0x9889('0x92')](',')[_0x9889('0x5b')](function(_0x59b3d2){_0x74ef12['Tags'][_0x9889('0x68')](_0x35bce5[_0x59b3d2]);});}delete _0x74ef12['TagIds'];});_0x47d35e['rows']=_0x11f211;return _0x47d35e;})['then'](respondWithFilteredResult(_0x13e690,_0x164d59));});})[_0x9889('0x93')](handleError(_0x13e690,null));};exports[_0x9889('0x2a')]=function(_0x1e191e,_0x869771){return db['CmContact']['find']({'where':{'id':_0x1e191e[_0x9889('0x94')]['id']}})[_0x9889('0x29')](handleEntityNotFound(_0x869771,null))[_0x9889('0x29')](removeEntity(_0x869771,null))['catch'](handleError(_0x869771,null));};exports[_0x9889('0x32')]=function(_0x5d910c,_0x5e3045){return db[_0x9889('0x31')][_0x9889('0x32')]()[_0x9889('0x29')](function(_0x53b53e){delete _0x53b53e['tags'];for(var _0x5a77d2=0x0;_0x5a77d2{}\s\\|]/g,'-');_0x1e2411(null,util['format']('%s-%s%s',path['basename'](_0x2253fd[_0x72d1('0x21')],path[_0x72d1('0x22')](_0x2253fd['originalname'])),Date[_0x72d1('0x23')](),path[_0x72d1('0x22')](_0x2253fd[_0x72d1('0x21')])));}})});router[_0x72d1('0x16')](_0x72d1('0x24'),upload['single']('file'),controller[_0x72d1('0x25')]);var upload=multer({'storage':multer[_0x72d1('0x1d')]({'destination':function(_0x2f661,_0x2f879f,_0xdf6a69){_0xdf6a69(null,path[_0x72d1('0x1e')](config[_0x72d1('0x1f')],'server/files/tmp'));},'filename':function(_0x57ec9e,_0x1ba258,_0x482cb8){_0x1ba258[_0x72d1('0x21')]=_0x1ba258[_0x72d1('0x21')][_0x72d1('0x26')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x482cb8(null,util['format'](_0x72d1('0x27'),path['basename'](_0x1ba258[_0x72d1('0x21')],path[_0x72d1('0x22')](_0x1ba258[_0x72d1('0x21')])),Date[_0x72d1('0x23')](),path['extname'](_0x1ba258[_0x72d1('0x21')])));}})});router['post'](_0x72d1('0x28'),upload[_0x72d1('0x29')]('file'),controller[_0x72d1('0x2a')]);router[_0x72d1('0x16')](_0x72d1('0x2b'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x2c')]);router['put'](_0x72d1('0xb'),auth[_0x72d1('0x7')](),controller[_0x72d1('0x2d')]);router['delete'](_0x72d1('0xb'),auth[_0x72d1('0x7')](),controller['destroy']);module[_0x72d1('0x2e')]=router; \ No newline at end of file +var _0xbd50=['extname','now','/csv','uploadCsv','replace','/upload','single','upload','/upload/:id','put','/:id','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','show','getTags','/:id/hoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/merge','post','create','bulkCreate','/:id/tags','setTags','diskStorage','join','root','server/files/tmp','format','%s-%s%s','basename','originalname'];(function(_0x5f552f,_0x4e44cd){var _0x89601e=function(_0x101aca){while(--_0x101aca){_0x5f552f['push'](_0x5f552f['shift']());}};_0x89601e(++_0x4e44cd);}(_0xbd50,0x196));var _0x0bd5=function(_0x2faf38,_0x43b0ec){_0x2faf38=_0x2faf38-0x0;var _0x35ced6=_0xbd50[_0x2faf38];return _0x35ced6;};'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 auth=require(_0x0bd5('0x5'));var interaction=require(_0x0bd5('0x6'));var config=require(_0x0bd5('0x7'));var controller=require('./cmContact.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0bd5('0x8')]);router[_0x0bd5('0x9')](_0x0bd5('0xa'),auth[_0x0bd5('0xb')](),controller[_0x0bd5('0xc')]);router['get']('/:id',auth[_0x0bd5('0xb')](),controller[_0x0bd5('0xd')]);router[_0x0bd5('0x9')]('/:id/tags',auth[_0x0bd5('0xb')](),controller[_0x0bd5('0xe')]);router['get'](_0x0bd5('0xf'),auth[_0x0bd5('0xb')](),controller['getHoppers']);router[_0x0bd5('0x9')](_0x0bd5('0x10'),auth[_0x0bd5('0xb')](),controller['getHopperHistories']);router[_0x0bd5('0x9')](_0x0bd5('0x11'),auth[_0x0bd5('0xb')](),controller[_0x0bd5('0x12')]);router[_0x0bd5('0x9')](_0x0bd5('0x13'),auth[_0x0bd5('0xb')](),controller[_0x0bd5('0x14')]);router['post'](_0x0bd5('0x15'),auth[_0x0bd5('0xb')](),controller['merge']);router[_0x0bd5('0x16')]('/',auth[_0x0bd5('0xb')](),controller[_0x0bd5('0x17')]);router[_0x0bd5('0x16')]('/create_many',auth[_0x0bd5('0xb')](),controller[_0x0bd5('0x18')]);router[_0x0bd5('0x16')](_0x0bd5('0x19'),auth[_0x0bd5('0xb')](),controller[_0x0bd5('0x1a')]);var upload=multer({'storage':multer[_0x0bd5('0x1b')]({'destination':function(_0x19fe20,_0x29fa4c,_0x20c667){_0x20c667(null,path[_0x0bd5('0x1c')](config[_0x0bd5('0x1d')],_0x0bd5('0x1e')));},'filename':function(_0x2dc1e5,_0x527c37,_0x5ba943){_0x527c37['originalname']=_0x527c37['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5ba943(null,util[_0x0bd5('0x1f')](_0x0bd5('0x20'),path[_0x0bd5('0x21')](_0x527c37[_0x0bd5('0x22')],path[_0x0bd5('0x23')](_0x527c37['originalname'])),Date[_0x0bd5('0x24')](),path[_0x0bd5('0x23')](_0x527c37[_0x0bd5('0x22')])));}})});router['post'](_0x0bd5('0x25'),upload['single']('file'),controller[_0x0bd5('0x26')]);var upload=multer({'storage':multer[_0x0bd5('0x1b')]({'destination':function(_0x184db3,_0x4fde84,_0x42428c){_0x42428c(null,path['join'](config[_0x0bd5('0x1d')],_0x0bd5('0x1e')));},'filename':function(_0x18cec3,_0x2b6b53,_0x3ff237){_0x2b6b53[_0x0bd5('0x22')]=_0x2b6b53[_0x0bd5('0x22')][_0x0bd5('0x27')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3ff237(null,util[_0x0bd5('0x1f')](_0x0bd5('0x20'),path[_0x0bd5('0x21')](_0x2b6b53[_0x0bd5('0x22')],path[_0x0bd5('0x23')](_0x2b6b53[_0x0bd5('0x22')])),Date['now'](),path[_0x0bd5('0x23')](_0x2b6b53[_0x0bd5('0x22')])));}})});router['post'](_0x0bd5('0x28'),upload[_0x0bd5('0x29')]('file'),controller[_0x0bd5('0x2a')]);router[_0x0bd5('0x16')](_0x0bd5('0x2b'),auth[_0x0bd5('0xb')](),controller['import']);router[_0x0bd5('0x2c')](_0x0bd5('0x2d'),auth[_0x0bd5('0xb')](),controller[_0x0bd5('0x2e')]);router[_0x0bd5('0x2f')](_0x0bd5('0x2d'),auth['isAuthenticated'](),controller[_0x0bd5('0x30')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 32523f2..e19b4c1 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 _0xa8e6=['parse','values','isArray','stringify','sequelize','lodash','exports','alias','setDataValue','name','STRING','TEXT','long','getDataValue','type','select'];(function(_0x507c4c,_0x18a6b1){var _0x360938=function(_0x37af16){while(--_0x37af16){_0x507c4c['push'](_0x507c4c['shift']());}};_0x360938(++_0x18a6b1);}(_0xa8e6,0x1e4));var _0x6a8e=function(_0x2c3458,_0x1f7efd){_0x2c3458=_0x2c3458-0x0;var _0x3f7e02=_0xa8e6[_0x2c3458];return _0x3f7e02;};'use strict';var Sequelize=require(_0x6a8e('0x0'));var _=require(_0x6a8e('0x1'));module[_0x6a8e('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x38b61d){return this['getDataValue'](_0x6a8e('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x5b4edd){this[_0x6a8e('0x4')]('alias',_0x5b4edd?_0x5b4edd:this['getDataValue'](_0x6a8e('0x5')));}},'type':{'type':Sequelize[_0x6a8e('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x6a8e('0x7')](_0x6a8e('0x8')),'get':function(){if(this[_0x6a8e('0x9')](_0x6a8e('0xa'))===_0x6a8e('0xb')){return JSON[_0x6a8e('0xc')](this[_0x6a8e('0x9')]('values'));}else{return this[_0x6a8e('0x9')](_0x6a8e('0xd'));}},'set':function(_0x3f96ca){if(Array[_0x6a8e('0xe')](_0x3f96ca)){this[_0x6a8e('0x4')](_0x6a8e('0xd'),JSON[_0x6a8e('0xf')](_0x3f96ca));}else{this[_0x6a8e('0x4')](_0x6a8e('0xd'),_0x3f96ca);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x803c=['STRING','setDataValue','select','parse','values','stringify','BOOLEAN','sequelize','lodash','exports','VIRTUAL','getDataValue','alias'];(function(_0x5e709a,_0x1d7975){var _0x57401a=function(_0x27eab5){while(--_0x27eab5){_0x5e709a['push'](_0x5e709a['shift']());}};_0x57401a(++_0x1d7975);}(_0x803c,0x125));var _0xc803=function(_0x164292,_0x470865){_0x164292=_0x164292-0x0;var _0x229250=_0x803c[_0x164292];return _0x229250;};'use strict';var Sequelize=require(_0xc803('0x0'));var _=require(_0xc803('0x1'));module[_0xc803('0x2')]={'name':{'type':Sequelize[_0xc803('0x3')],'get':function(_0x313ef3){return this[_0xc803('0x4')](_0xc803('0x5'));}},'alias':{'type':Sequelize[_0xc803('0x6')],'allowNull':![],'set':function(_0x42207b){this[_0xc803('0x7')](_0xc803('0x5'),_0x42207b?_0x42207b:this[_0xc803('0x4')]('name'));}},'type':{'type':Sequelize[_0xc803('0x6')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0xc803('0x4')]('type')===_0xc803('0x8')){return JSON[_0xc803('0x9')](this[_0xc803('0x4')](_0xc803('0xa')));}else{return this['getDataValue'](_0xc803('0xa'));}},'set':function(_0x2503ae){if(Array['isArray'](_0x2503ae)){this[_0xc803('0x7')](_0xc803('0xa'),JSON[_0xc803('0xb')](_0x2503ae));}else{this[_0xc803('0x7')](_0xc803('0xa'),_0x2503ae);}}},'required':{'type':Sequelize[_0xc803('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index c6ec799..3bf99a0 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 _0xecd1=['error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','catch','update','body','find','create','Sequelize','TEXT','type','text','number','INTEGER','switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%d','html-pdf','rimraf','fast-json-patch','request-promise','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','reject','then','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xecd1,0xd0));var _0x1ecd=function(_0x335c40,_0x4961ac){_0x335c40=_0x335c40-0x0;var _0x48ad54=_0xecd1[_0x335c40];return _0x48ad54;};'use strict';var pdf=require(_0x1ecd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1ecd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1ecd('0x2'));var rp=require(_0x1ecd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1ecd('0x4'));var path=require(_0x1ecd('0x5'));var sox=require(_0x1ecd('0x6'));var csv=require('to-csv');var ejs=require(_0x1ecd('0x7'));var fs=require('fs');var _=require(_0x1ecd('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1ecd('0x9'));var deskjs=require(_0x1ecd('0xa'));var toCsv=require(_0x1ecd('0xb'));var querystring=require(_0x1ecd('0xc'));var Papa=require(_0x1ecd('0xd'));var Redis=require(_0x1ecd('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1ecd('0xf'));var hardwareService=require(_0x1ecd('0x10'));var logger=require(_0x1ecd('0x11'))('api');var utils=require(_0x1ecd('0x12'));var config=require('../../config/environment');var db=require(_0x1ecd('0x13'))['db'];function respondWithStatusCode(_0x206216,_0xb58c75){_0xb58c75=_0xb58c75||0xcc;return function(_0x532f8e){if(_0x532f8e){return _0x206216[_0x1ecd('0x14')](_0xb58c75);}return _0x206216[_0x1ecd('0x15')](_0xb58c75)['end']();};}function respondWithResult(_0x1fb598,_0x15e9de){_0x15e9de=_0x15e9de||0xc8;return function(_0x4f41f2){if(_0x4f41f2){return _0x1fb598[_0x1ecd('0x15')](_0x15e9de)['json'](_0x4f41f2);}};}function respondWithFilteredResult(_0x317fcf,_0x4d2337){return function(_0x55dc28){if(_0x55dc28){var _0x162b0c=_0x55dc28[_0x1ecd('0x16')],_0x71bcfc=_0x4d2337[_0x1ecd('0x17')],_0x68bb62=_0x4d2337[_0x1ecd('0x17')]+_0x4d2337[_0x1ecd('0x18')],_0x25b502;if(_0x68bb62>=_0x162b0c){_0x68bb62=_0x162b0c;_0x25b502=0xc8;}else{_0x25b502=0xce;}_0x317fcf[_0x1ecd('0x15')](_0x25b502);return _0x317fcf['set'](_0x1ecd('0x19'),_0x71bcfc+'-'+_0x68bb62+'/'+_0x162b0c)['json'](_0x55dc28);}return null;};}function patchUpdates(_0x304628){return function(_0x30d84c){try{jsonpatch['apply'](_0x30d84c,_0x304628,!![]);}catch(_0x34386e){return BPromise[_0x1ecd('0x1a')](_0x34386e);}return _0x30d84c['save']();};}function saveUpdates(_0x379f91,_0x34d930){return function(_0x2fd62d){if(_0x2fd62d){return _0x2fd62d['update'](_0x379f91)[_0x1ecd('0x1b')](function(_0x42be33){return _0x42be33;});}return null;};}function removeEntity(_0x2026d9,_0x37167e){return function(_0x5c9c60){if(_0x5c9c60){return _0x5c9c60[_0x1ecd('0x1c')]()[_0x1ecd('0x1b')](function(){_0x2026d9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4296ed,_0x286805){return function(_0x231dbf){if(!_0x231dbf){_0x4296ed[_0x1ecd('0x14')](0x194);}return _0x231dbf;};}function handleError(_0x171f0f,_0x55368d){_0x55368d=_0x55368d||0x1f4;return function(_0x3f2892){logger[_0x1ecd('0x1d')](_0x3f2892[_0x1ecd('0x1e')]);if(_0x3f2892[_0x1ecd('0x1f')]){delete _0x3f2892[_0x1ecd('0x1f')];}_0x171f0f[_0x1ecd('0x15')](_0x55368d)[_0x1ecd('0x20')](_0x3f2892);};}exports[_0x1ecd('0x21')]=function(_0x14d95f,_0x94b3b8){var _0x15f56f={},_0x25efe9={},_0x5dcddd={'count':0x0,'rows':[]};var _0x4a19f6=_[_0x1ecd('0x22')](db[_0x1ecd('0x23')][_0x1ecd('0x24')],function(_0x36ee13){return{'name':_0x36ee13[_0x1ecd('0x25')],'type':_0x36ee13['type']['key']};});_0x25efe9[_0x1ecd('0x26')]=_[_0x1ecd('0x27')](_[_0x1ecd('0x22')](_0x4a19f6,_0x1ecd('0x1f')),['name']);_0x25efe9[_0x1ecd('0x28')]=_[_0x1ecd('0x29')](_0x14d95f[_0x1ecd('0x28')]);_0x25efe9[_0x1ecd('0x2a')]=_[_0x1ecd('0x2b')](_0x25efe9['model'],_0x25efe9['query']);_0x15f56f[_0x1ecd('0x2c')]=_[_0x1ecd('0x2b')](_0x25efe9[_0x1ecd('0x26')],qs[_0x1ecd('0x2d')](_0x14d95f[_0x1ecd('0x28')][_0x1ecd('0x2d')]));_0x15f56f['attributes']=_0x15f56f[_0x1ecd('0x2c')][_0x1ecd('0x2e')]?_0x15f56f[_0x1ecd('0x2c')]:_0x25efe9[_0x1ecd('0x26')];if(!_0x14d95f[_0x1ecd('0x28')]['hasOwnProperty'](_0x1ecd('0x2f'))){_0x15f56f['limit']=qs['limit'](_0x14d95f[_0x1ecd('0x28')][_0x1ecd('0x18')]);_0x15f56f[_0x1ecd('0x17')]=qs[_0x1ecd('0x17')](_0x14d95f[_0x1ecd('0x28')]['offset']);}_0x15f56f[_0x1ecd('0x30')]=qs[_0x1ecd('0x31')](_0x14d95f['query'][_0x1ecd('0x31')]);_0x15f56f['where']=qs[_0x1ecd('0x2a')](_[_0x1ecd('0x32')](_0x14d95f[_0x1ecd('0x28')],_0x25efe9['filters']));if(_0x14d95f['query'][_0x1ecd('0x33')]){_0x15f56f[_0x1ecd('0x34')]=_[_0x1ecd('0x35')](_0x15f56f[_0x1ecd('0x34')],{'$or':_[_0x1ecd('0x22')](_0x4a19f6,function(_0x19dbca){if(_0x19dbca['type']!=='VIRTUAL'){var _0x259957={};_0x259957[_0x19dbca[_0x1ecd('0x1f')]]={'$like':'%'+_0x14d95f['query'][_0x1ecd('0x33')]+'%'};return _0x259957;}})});}_0x15f56f=_[_0x1ecd('0x35')]({},_0x15f56f,_0x14d95f[_0x1ecd('0x36')]);var _0x33d9ff={'where':_0x15f56f[_0x1ecd('0x34')]};return db['CmCustomField']['count'](_0x33d9ff)['then'](function(_0x5df0d2){_0x5dcddd[_0x1ecd('0x16')]=_0x5df0d2;if(_0x14d95f[_0x1ecd('0x28')][_0x1ecd('0x37')]){_0x15f56f[_0x1ecd('0x38')]=[{'all':!![]}];}return db[_0x1ecd('0x23')][_0x1ecd('0x39')](_0x15f56f);})[_0x1ecd('0x1b')](function(_0x2b5690){_0x5dcddd[_0x1ecd('0x3a')]=_0x2b5690;return _0x5dcddd;})[_0x1ecd('0x1b')](respondWithFilteredResult(_0x94b3b8,_0x15f56f))['catch'](handleError(_0x94b3b8,null));};exports[_0x1ecd('0x3b')]=function(_0x21f77d,_0x3b9c61){var _0x4728d1={'raw':!![],'where':{'id':_0x21f77d[_0x1ecd('0x3c')]['id']}},_0x2248df={};_0x2248df[_0x1ecd('0x26')]=_[_0x1ecd('0x29')](db['CmCustomField']['rawAttributes']);_0x2248df[_0x1ecd('0x28')]=_[_0x1ecd('0x29')](_0x21f77d[_0x1ecd('0x28')]);_0x2248df[_0x1ecd('0x2a')]=_['intersection'](_0x2248df['model'],_0x2248df['query']);_0x4728d1[_0x1ecd('0x2c')]=_['intersection'](_0x2248df[_0x1ecd('0x26')],qs[_0x1ecd('0x2d')](_0x21f77d['query']['fields']));_0x4728d1[_0x1ecd('0x2c')]=_0x4728d1['attributes'][_0x1ecd('0x2e')]?_0x4728d1[_0x1ecd('0x2c')]:_0x2248df[_0x1ecd('0x26')];if(_0x21f77d[_0x1ecd('0x28')][_0x1ecd('0x37')]){_0x4728d1[_0x1ecd('0x38')]=[{'all':!![]}];}_0x4728d1=_[_0x1ecd('0x35')]({},_0x4728d1,_0x21f77d[_0x1ecd('0x36')]);return db[_0x1ecd('0x23')]['find'](_0x4728d1)['then'](handleEntityNotFound(_0x3b9c61,null))[_0x1ecd('0x1b')](respondWithResult(_0x3b9c61,null))[_0x1ecd('0x3d')](handleError(_0x3b9c61,null));};exports[_0x1ecd('0x3e')]=function(_0x459c90,_0x297ec4){if(_0x459c90[_0x1ecd('0x3f')]['id']){delete _0x459c90[_0x1ecd('0x3f')]['id'];}return db[_0x1ecd('0x23')][_0x1ecd('0x40')]({'where':{'id':_0x459c90[_0x1ecd('0x3c')]['id']}})[_0x1ecd('0x1b')](handleEntityNotFound(_0x297ec4,null))[_0x1ecd('0x1b')](saveUpdates(_0x459c90[_0x1ecd('0x3f')],null))[_0x1ecd('0x1b')](respondWithResult(_0x297ec4,null))['catch'](handleError(_0x297ec4,null));};exports[_0x1ecd('0x1c')]=function(_0x5b9c26,_0x4cf90f){return db[_0x1ecd('0x23')]['find']({'where':{'id':_0x5b9c26[_0x1ecd('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4cf90f,null))[_0x1ecd('0x1b')](removeEntity(_0x4cf90f,null))[_0x1ecd('0x3d')](handleError(_0x4cf90f,null));};exports['create']=function(_0x5b4f2d,_0x1d2a8d){var _0x8454db;return db['sequelize']['transaction'](function(_0x30d4b1){return db['CmCustomField'][_0x1ecd('0x41')](_0x5b4f2d[_0x1ecd('0x3f')],{'transaction':_0x30d4b1})['then'](function(_0x25f34f){_0x8454db=_0x25f34f;var _0x6a2096={'type':db[_0x1ecd('0x42')][_0x1ecd('0x43')],'transaction':_0x30d4b1};switch(_0x5b4f2d[_0x1ecd('0x3f')][_0x1ecd('0x44')]){case _0x1ecd('0x45'):_0x6a2096[_0x1ecd('0x44')]=db[_0x1ecd('0x42')][_0x1ecd('0x43')];break;case _0x1ecd('0x46'):_0x6a2096[_0x1ecd('0x44')]=db['Sequelize'][_0x1ecd('0x47')];break;case _0x1ecd('0x48'):_0x6a2096[_0x1ecd('0x44')]=db[_0x1ecd('0x42')]['BOOLEAN'];_0x6a2096[_0x1ecd('0x49')]=![];break;default:}return db[_0x1ecd('0x4a')][_0x1ecd('0x4b')][_0x1ecd('0x4c')](_0x1ecd('0x4d'),util['format'](_0x1ecd('0x4e'),_0x8454db['id']),_0x6a2096);})[_0x1ecd('0x1b')](function(){return _0x8454db;});})[_0x1ecd('0x1b')](respondWithResult(_0x1d2a8d,0xc9))[_0x1ecd('0x3d')](handleError(_0x1d2a8d,null));}; \ No newline at end of file +var _0x2d46=['update','body','create','sequelize','transaction','Sequelize','TEXT','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','then','destroy','error','stack','name','send','index','CmCustomField','rawAttributes','fieldName','type','key','differenceBy','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','catch','show','params','model','length','options','find'];(function(_0x4f2524,_0x22d16c){var _0x4d4d38=function(_0x320767){while(--_0x320767){_0x4f2524['push'](_0x4f2524['shift']());}};_0x4d4d38(++_0x22d16c);}(_0x2d46,0x116));var _0x62d4=function(_0x2c3c3f,_0x2436f8){_0x2c3c3f=_0x2c3c3f-0x0;var _0x1f5280=_0x2d46[_0x2c3c3f];return _0x1f5280;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x62d4('0x0'));var rimraf=require(_0x62d4('0x1'));var zipdir=require(_0x62d4('0x2'));var jsonpatch=require(_0x62d4('0x3'));var rp=require('request-promise');var moment=require(_0x62d4('0x4'));var BPromise=require(_0x62d4('0x5'));var Mustache=require(_0x62d4('0x6'));var util=require(_0x62d4('0x7'));var path=require(_0x62d4('0x8'));var sox=require(_0x62d4('0x9'));var csv=require(_0x62d4('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x62d4('0xb'));var squel=require('squel');var crypto=require(_0x62d4('0xc'));var jsforce=require(_0x62d4('0xd'));var deskjs=require(_0x62d4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x62d4('0xf'));var Papa=require(_0x62d4('0x10'));var Redis=require(_0x62d4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x62d4('0x12'));var as=require(_0x62d4('0x13'));var hardwareService=require(_0x62d4('0x14'));var logger=require(_0x62d4('0x15'))(_0x62d4('0x16'));var utils=require(_0x62d4('0x17'));var config=require(_0x62d4('0x18'));var db=require(_0x62d4('0x19'))['db'];function respondWithStatusCode(_0x4630f7,_0x4dfc18){_0x4dfc18=_0x4dfc18||0xcc;return function(_0x45bac4){if(_0x45bac4){return _0x4630f7[_0x62d4('0x1a')](_0x4dfc18);}return _0x4630f7[_0x62d4('0x1b')](_0x4dfc18)[_0x62d4('0x1c')]();};}function respondWithResult(_0x4074a9,_0x5d0016){_0x5d0016=_0x5d0016||0xc8;return function(_0x355f23){if(_0x355f23){return _0x4074a9[_0x62d4('0x1b')](_0x5d0016)[_0x62d4('0x1d')](_0x355f23);}};}function respondWithFilteredResult(_0x938cea,_0x4e0f18){return function(_0x63a17a){if(_0x63a17a){var _0xf984b0=_0x63a17a[_0x62d4('0x1e')],_0x3b7e6f=_0x4e0f18[_0x62d4('0x1f')],_0x1af770=_0x4e0f18[_0x62d4('0x1f')]+_0x4e0f18[_0x62d4('0x20')],_0x2c0dc1;if(_0x1af770>=_0xf984b0){_0x1af770=_0xf984b0;_0x2c0dc1=0xc8;}else{_0x2c0dc1=0xce;}_0x938cea[_0x62d4('0x1b')](_0x2c0dc1);return _0x938cea[_0x62d4('0x21')]('Content-Range',_0x3b7e6f+'-'+_0x1af770+'/'+_0xf984b0)[_0x62d4('0x1d')](_0x63a17a);}return null;};}function patchUpdates(_0x196aa5){return function(_0x15d158){try{jsonpatch[_0x62d4('0x22')](_0x15d158,_0x196aa5,!![]);}catch(_0x29099d){return BPromise[_0x62d4('0x23')](_0x29099d);}return _0x15d158['save']();};}function saveUpdates(_0x3ca20b,_0x375382){return function(_0x8e7551){if(_0x8e7551){return _0x8e7551['update'](_0x3ca20b)[_0x62d4('0x24')](function(_0x278b08){return _0x278b08;});}return null;};}function removeEntity(_0x59e8a5,_0x590247){return function(_0x4d1cbb){if(_0x4d1cbb){return _0x4d1cbb[_0x62d4('0x25')]()[_0x62d4('0x24')](function(){_0x59e8a5['status'](0xcc)[_0x62d4('0x1c')]();});}};}function handleEntityNotFound(_0x5a5500,_0x1c4c77){return function(_0x214030){if(!_0x214030){_0x5a5500[_0x62d4('0x1a')](0x194);}return _0x214030;};}function handleError(_0x2a1bc0,_0x2c4f59){_0x2c4f59=_0x2c4f59||0x1f4;return function(_0x24be8e){logger[_0x62d4('0x26')](_0x24be8e[_0x62d4('0x27')]);if(_0x24be8e[_0x62d4('0x28')]){delete _0x24be8e[_0x62d4('0x28')];}_0x2a1bc0[_0x62d4('0x1b')](_0x2c4f59)[_0x62d4('0x29')](_0x24be8e);};}exports[_0x62d4('0x2a')]=function(_0x3dacb0,_0x139b48){var _0x58c79={},_0xefa039={},_0x18afea={'count':0x0,'rows':[]};var _0x142fad=_['map'](db[_0x62d4('0x2b')][_0x62d4('0x2c')],function(_0x9ee666){return{'name':_0x9ee666[_0x62d4('0x2d')],'type':_0x9ee666[_0x62d4('0x2e')][_0x62d4('0x2f')]};});_0xefa039['model']=_[_0x62d4('0x30')](_[_0x62d4('0x31')](_0x142fad,'name'),[_0x62d4('0x28')]);_0xefa039[_0x62d4('0x32')]=_[_0x62d4('0x33')](_0x3dacb0[_0x62d4('0x32')]);_0xefa039[_0x62d4('0x34')]=_[_0x62d4('0x35')](_0xefa039['model'],_0xefa039[_0x62d4('0x32')]);_0x58c79[_0x62d4('0x36')]=_['intersection'](_0xefa039['model'],qs[_0x62d4('0x37')](_0x3dacb0[_0x62d4('0x32')][_0x62d4('0x37')]));_0x58c79[_0x62d4('0x36')]=_0x58c79[_0x62d4('0x36')]['length']?_0x58c79[_0x62d4('0x36')]:_0xefa039['model'];if(!_0x3dacb0[_0x62d4('0x32')][_0x62d4('0x38')](_0x62d4('0x39'))){_0x58c79[_0x62d4('0x20')]=qs[_0x62d4('0x20')](_0x3dacb0[_0x62d4('0x32')][_0x62d4('0x20')]);_0x58c79[_0x62d4('0x1f')]=qs[_0x62d4('0x1f')](_0x3dacb0[_0x62d4('0x32')][_0x62d4('0x1f')]);}_0x58c79[_0x62d4('0x3a')]=qs[_0x62d4('0x3b')](_0x3dacb0[_0x62d4('0x32')][_0x62d4('0x3b')]);_0x58c79[_0x62d4('0x3c')]=qs[_0x62d4('0x34')](_[_0x62d4('0x3d')](_0x3dacb0[_0x62d4('0x32')],_0xefa039[_0x62d4('0x34')]));if(_0x3dacb0[_0x62d4('0x32')]['filter']){_0x58c79['where']=_[_0x62d4('0x3e')](_0x58c79[_0x62d4('0x3c')],{'$or':_['map'](_0x142fad,function(_0x71362a){if(_0x71362a[_0x62d4('0x2e')]!=='VIRTUAL'){var _0x49c3c7={};_0x49c3c7[_0x71362a['name']]={'$like':'%'+_0x3dacb0[_0x62d4('0x32')][_0x62d4('0x3f')]+'%'};return _0x49c3c7;}})});}_0x58c79=_['merge']({},_0x58c79,_0x3dacb0['options']);var _0x1abeaf={'where':_0x58c79[_0x62d4('0x3c')]};return db[_0x62d4('0x2b')][_0x62d4('0x1e')](_0x1abeaf)[_0x62d4('0x24')](function(_0x27d61a){_0x18afea[_0x62d4('0x1e')]=_0x27d61a;if(_0x3dacb0[_0x62d4('0x32')][_0x62d4('0x40')]){_0x58c79[_0x62d4('0x41')]=[{'all':!![]}];}return db[_0x62d4('0x2b')][_0x62d4('0x42')](_0x58c79);})[_0x62d4('0x24')](function(_0x53768a){_0x18afea['rows']=_0x53768a;return _0x18afea;})[_0x62d4('0x24')](respondWithFilteredResult(_0x139b48,_0x58c79))[_0x62d4('0x43')](handleError(_0x139b48,null));};exports[_0x62d4('0x44')]=function(_0x498e7a,_0x16971e){var _0x31d0f7={'raw':!![],'where':{'id':_0x498e7a[_0x62d4('0x45')]['id']}},_0x300312={};_0x300312['model']=_['keys'](db[_0x62d4('0x2b')][_0x62d4('0x2c')]);_0x300312['query']=_['keys'](_0x498e7a[_0x62d4('0x32')]);_0x300312[_0x62d4('0x34')]=_[_0x62d4('0x35')](_0x300312[_0x62d4('0x46')],_0x300312['query']);_0x31d0f7['attributes']=_[_0x62d4('0x35')](_0x300312[_0x62d4('0x46')],qs[_0x62d4('0x37')](_0x498e7a[_0x62d4('0x32')][_0x62d4('0x37')]));_0x31d0f7[_0x62d4('0x36')]=_0x31d0f7[_0x62d4('0x36')][_0x62d4('0x47')]?_0x31d0f7['attributes']:_0x300312['model'];if(_0x498e7a[_0x62d4('0x32')][_0x62d4('0x40')]){_0x31d0f7[_0x62d4('0x41')]=[{'all':!![]}];}_0x31d0f7=_['merge']({},_0x31d0f7,_0x498e7a[_0x62d4('0x48')]);return db[_0x62d4('0x2b')][_0x62d4('0x49')](_0x31d0f7)[_0x62d4('0x24')](handleEntityNotFound(_0x16971e,null))[_0x62d4('0x24')](respondWithResult(_0x16971e,null))['catch'](handleError(_0x16971e,null));};exports[_0x62d4('0x4a')]=function(_0x50872d,_0x22f3ef){if(_0x50872d[_0x62d4('0x4b')]['id']){delete _0x50872d['body']['id'];}return db[_0x62d4('0x2b')]['find']({'where':{'id':_0x50872d[_0x62d4('0x45')]['id']}})['then'](handleEntityNotFound(_0x22f3ef,null))[_0x62d4('0x24')](saveUpdates(_0x50872d['body'],null))[_0x62d4('0x24')](respondWithResult(_0x22f3ef,null))['catch'](handleError(_0x22f3ef,null));};exports[_0x62d4('0x25')]=function(_0x3f011c,_0x516205){return db[_0x62d4('0x2b')][_0x62d4('0x49')]({'where':{'id':_0x3f011c['params']['id']}})[_0x62d4('0x24')](handleEntityNotFound(_0x516205,null))[_0x62d4('0x24')](removeEntity(_0x516205,null))[_0x62d4('0x43')](handleError(_0x516205,null));};exports[_0x62d4('0x4c')]=function(_0x4e0706,_0x1cb03b){var _0x4bd63b;return db[_0x62d4('0x4d')][_0x62d4('0x4e')](function(_0xaedfb8){return db[_0x62d4('0x2b')][_0x62d4('0x4c')](_0x4e0706[_0x62d4('0x4b')],{'transaction':_0xaedfb8})[_0x62d4('0x24')](function(_0x2d2599){_0x4bd63b=_0x2d2599;var _0x3f0e0f={'type':db[_0x62d4('0x4f')][_0x62d4('0x50')],'transaction':_0xaedfb8};switch(_0x4e0706[_0x62d4('0x4b')][_0x62d4('0x2e')]){case'text':_0x3f0e0f[_0x62d4('0x2e')]=db[_0x62d4('0x4f')]['TEXT'];break;case'number':_0x3f0e0f[_0x62d4('0x2e')]=db[_0x62d4('0x4f')][_0x62d4('0x51')];break;case _0x62d4('0x52'):_0x3f0e0f[_0x62d4('0x2e')]=db[_0x62d4('0x4f')][_0x62d4('0x53')];_0x3f0e0f[_0x62d4('0x54')]=![];break;default:}return db[_0x62d4('0x4d')][_0x62d4('0x55')][_0x62d4('0x56')](_0x62d4('0x57'),util['format']('cf_%d',_0x4bd63b['id']),_0x3f0e0f);})[_0x62d4('0x24')](function(){return _0x4bd63b;});})[_0x62d4('0x24')](respondWithResult(_0x1cb03b,0xc9))[_0x62d4('0x43')](handleError(_0x1cb03b,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 9b8d554..e2de681 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 _0x9762=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger'];(function(_0x49be3d,_0x263ede){var _0x39bf50=function(_0x3403fc){while(--_0x3403fc){_0x49be3d['push'](_0x49be3d['shift']());}};_0x39bf50(++_0x263ede);}(_0x9762,0x13f));var _0x2976=function(_0xab7ee5,_0x4bf7da){_0xab7ee5=_0xab7ee5-0x0;var _0x25970c=_0x9762[_0xab7ee5];return _0x25970c;};'use strict';var _=require(_0x2976('0x0'));var util=require(_0x2976('0x1'));var logger=require(_0x2976('0x2'))(_0x2976('0x3'));var moment=require('moment');var BPromise=require(_0x2976('0x4'));var rp=require(_0x2976('0x5'));var fs=require('fs');var path=require(_0x2976('0x6'));var rimraf=require(_0x2976('0x7'));var config=require(_0x2976('0x8'));var attributes=require(_0x2976('0x9'));module[_0x2976('0xa')]=function(_0x230eb4,_0x37cebe){return _0x230eb4[_0x2976('0xb')](_0x2976('0xc'),attributes,{'tableName':_0x2976('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc49f=['./cmCustomField.attributes','define','cm_custom_fields','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x2fedac,_0x167b72){var _0x30a70c=function(_0x378c80){while(--_0x378c80){_0x2fedac['push'](_0x2fedac['shift']());}};_0x30a70c(++_0x167b72);}(_0xc49f,0x11b));var _0xfc49=function(_0x5d0cca,_0x3c46ef){_0x5d0cca=_0x5d0cca-0x0;var _0x10a5f1=_0xc49f[_0x5d0cca];return _0x10a5f1;};'use strict';var _=require(_0xfc49('0x0'));var util=require(_0xfc49('0x1'));var logger=require(_0xfc49('0x2'))(_0xfc49('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfc49('0x4'));var fs=require('fs');var path=require(_0xfc49('0x5'));var rimraf=require(_0xfc49('0x6'));var config=require('../../config/environment');var attributes=require(_0xfc49('0x7'));module['exports']=function(_0x3f6fb7,_0x127df1){return _0x3f6fb7[_0xfc49('0x8')]('CmCustomField',attributes,{'tableName':_0xfc49('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 2d198ee..4ee603e 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 _0x9a19=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x9a19,0x114));var _0x99a1=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x9a19[_0x44b3bd];return _0x1efc4a;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var moment=require(_0x99a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x99a1('0x3'));var fs=require('fs');var Redis=require(_0x99a1('0x4'));var db=require(_0x99a1('0x5'))['db'];var utils=require(_0x99a1('0x6'));var logger=require(_0x99a1('0x7'))(_0x99a1('0x8'));var config=require(_0x99a1('0x9'));var jayson=require(_0x99a1('0xa'));var client=jayson[_0x99a1('0xb')][_0x99a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x65045d,_0x523b9e,_0x4d2a5c){return new BPromise(function(_0x5aa6c2,_0x56f50){return client[_0x99a1('0xd')](_0x65045d,_0x4d2a5c)['then'](function(_0x5874fc){logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));logger[_0x99a1('0x11')](_0x99a1('0x12'),_0x523b9e,'request\x20sent',JSON[_0x99a1('0x13')](_0x5874fc));if(_0x5874fc[_0x99a1('0x14')]){if(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x15')]===0x1f4){logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x56f50(_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);}logger[_0x99a1('0x14')](_0x99a1('0xf'),_0x523b9e,_0x5874fc[_0x99a1('0x14')][_0x99a1('0x16')]);return _0x5aa6c2(_0x5874fc[_0x99a1('0x14')]['message']);}else{logger[_0x99a1('0xe')](_0x99a1('0xf'),_0x523b9e,_0x99a1('0x10'));_0x5aa6c2(_0x5874fc[_0x99a1('0x17')][_0x99a1('0x16')]);}})[_0x99a1('0x18')](function(_0x1ca878){logger['error']('CmCustomField,\x20%s,\x20%s',_0x523b9e,_0x1ca878);_0x56f50(_0x1ca878);});});} \ No newline at end of file +var _0xa8a8=['stringify','error','code','CmCustomField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x1344a8,_0x141233){var _0x5ce81b=function(_0x1e170d){while(--_0x1e170d){_0x1344a8['push'](_0x1344a8['shift']());}};_0x5ce81b(++_0x141233);}(_0xa8a8,0xec));var _0x8a8a=function(_0x343711,_0x2aee64){_0x343711=_0x343711-0x0;var _0xfdc703=_0xa8a8[_0x343711];return _0xfdc703;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('CmCustomField,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('CmCustomField,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 2f433ad..347f519 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 _0xfa34=['../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x30a862,_0x2a48b6){var _0x5c9dad=function(_0x508cd4){while(--_0x508cd4){_0x30a862['push'](_0x30a862['shift']());}};_0x5c9dad(++_0x2a48b6);}(_0xfa34,0x151));var _0x4fa3=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0xfa34[_0x5f1617];return _0x3af5da;};'use strict';var multer=require('multer');var util=require(_0x4fa3('0x0'));var path=require(_0x4fa3('0x1'));var timeout=require(_0x4fa3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x4fa3('0x3'));var interaction=require(_0x4fa3('0x4'));var config=require(_0x4fa3('0x5'));var controller=require(_0x4fa3('0x6'));router[_0x4fa3('0x7')]('/',auth[_0x4fa3('0x8')](),controller[_0x4fa3('0x9')]);router['get'](_0x4fa3('0xa'),auth['isAuthenticated'](),controller[_0x4fa3('0xb')]);router[_0x4fa3('0xc')]('/',auth[_0x4fa3('0x8')](),controller[_0x4fa3('0xd')]);router[_0x4fa3('0xe')](_0x4fa3('0xa'),auth[_0x4fa3('0x8')](),controller[_0x4fa3('0xf')]);router[_0x4fa3('0x10')](_0x4fa3('0xa'),auth[_0x4fa3('0x8')](),controller[_0x4fa3('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6918=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x5a4a1e,_0x5f014c){var _0x13b91d=function(_0x1b8403){while(--_0x1b8403){_0x5a4a1e['push'](_0x5a4a1e['shift']());}};_0x13b91d(++_0x5f014c);}(_0x6918,0xc8));var _0x8691=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x6918[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x8691('0x0'));var path=require(_0x8691('0x1'));var timeout=require(_0x8691('0x2'));var express=require(_0x8691('0x3'));var router=express[_0x8691('0x4')]();var auth=require(_0x8691('0x5'));var interaction=require(_0x8691('0x6'));var config=require(_0x8691('0x7'));var controller=require(_0x8691('0x8'));router[_0x8691('0x9')]('/',auth[_0x8691('0xa')](),controller['index']);router['get'](_0x8691('0xb'),auth[_0x8691('0xa')](),controller[_0x8691('0xc')]);router[_0x8691('0xd')]('/',auth[_0x8691('0xa')](),controller[_0x8691('0xe')]);router[_0x8691('0xf')](_0x8691('0xb'),auth[_0x8691('0xa')](),controller[_0x8691('0x10')]);router[_0x8691('0x11')](_0x8691('0xb'),auth[_0x8691('0xa')](),controller[_0x8691('0x12')]);module[_0x8691('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 2496877..1d3027f 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 _0x992d=['contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE','INTEGER','UNSIGNED'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x992d,0xa9));var _0xd992=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x992d[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xd992('0x0'));var Sequelize=require(_0xd992('0x1'));module['exports']={'phone':{'type':Sequelize[_0xd992('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xd992('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xd992('0x4')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xd992('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd992('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd992('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd992('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xd992('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xd992('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xd992('0x5')],'unique':_0xd992('0x7')},'ListId':{'type':Sequelize[_0xd992('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xd992('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xd992('0x5')],'unique':_0xd992('0x7')},'CampaignId':{'type':Sequelize[_0xd992('0x5')]}}; \ No newline at end of file +var _0x86bc=['BOOLEAN','STRING','DATE','contactListQueue','moment','sequelize','exports','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0x86bc,0xea));var _0xc86b=function(_0x404d37,_0x120551){_0x404d37=_0x404d37-0x0;var _0x35df54=_0x86bc[_0x404d37];return _0x35df54;};'use strict';var moment=require(_0xc86b('0x0'));var Sequelize=require(_0xc86b('0x1'));module[_0xc86b('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xc86b('0x3')](_0xc86b('0x4'))},'countbusyretry':{'type':Sequelize[_0xc86b('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc86b('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc86b('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xc86b('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc86b('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc86b('0x8')]},'priority':{'type':Sequelize[_0xc86b('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xc86b('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xc86b('0x9')},'ListId':{'type':Sequelize[_0xc86b('0x5')],'unique':_0xc86b('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xc86b('0x5')],'unique':_0xc86b('0x9')},'CampaignId':{'type':Sequelize[_0xc86b('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index f2ce259..3b5747b 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 _0xf3f4=['calleridname','CmHopperFinal','getPreview','outbound','dialOrderByScheduledAt','length','sequelize','format','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','getOpenContacts','getVoiceQueues','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','count','limit','set','Content-Range','then','destroy','end','error','stack','name','send','map','CmHopper','rawAttributes','type','model','query','filters','intersection','$and','$gt','$gte','$lte','$eq','$between','$in','$notIn','$like','$iLike','$notILike','$contains','$any','fields','attributes','offset','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','options','find','body','update','params','describe','VoiceQueueId','VoiceQueue','omit','dataValues','createdAt','statedesc','deleted','campaign','user','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','isNil','firstName','lastName'];(function(_0x12ce43,_0x455a06){var _0xdb8970=function(_0x1ad606){while(--_0x1ad606){_0x12ce43['push'](_0x12ce43['shift']());}};_0xdb8970(++_0x455a06);}(_0xf3f4,0xa4));var _0x4f3f=function(_0x1d851d,_0x180322){_0x1d851d=_0x1d851d-0x0;var _0x583de1=_0xf3f4[_0x1d851d];return _0x583de1;};'use strict';var pdf=require(_0x4f3f('0x0'));var emlformat=require(_0x4f3f('0x1'));var rimraf=require(_0x4f3f('0x2'));var zipdir=require(_0x4f3f('0x3'));var jsonpatch=require(_0x4f3f('0x4'));var rp=require(_0x4f3f('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4f3f('0x6'));var util=require(_0x4f3f('0x7'));var path=require(_0x4f3f('0x8'));var sox=require(_0x4f3f('0x9'));var csv=require(_0x4f3f('0xa'));var ejs=require(_0x4f3f('0xb'));var fs=require('fs');var _=require(_0x4f3f('0xc'));var squel=require(_0x4f3f('0xd'));var crypto=require(_0x4f3f('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4f3f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4f3f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4f3f('0x10'));var hardwareService=require(_0x4f3f('0x11'));var logger=require('../../config/logger')(_0x4f3f('0x12'));var utils=require('../../config/utils');var config=require(_0x4f3f('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2975b5,_0x4f8ec4){_0x4f8ec4=_0x4f8ec4||0xcc;return function(_0x57926c){if(_0x57926c){return _0x2975b5[_0x4f3f('0x14')](_0x4f8ec4);}return _0x2975b5[_0x4f3f('0x15')](_0x4f8ec4)['end']();};}function respondWithResult(_0x3e5ed7,_0x58b017){_0x58b017=_0x58b017||0xc8;return function(_0x3058e2){if(_0x3058e2){return _0x3e5ed7[_0x4f3f('0x15')](_0x58b017)[_0x4f3f('0x16')](_0x3058e2);}};}function respondWithFilteredResult(_0x358e2e,_0x55b8de){return function(_0x2aba19){if(_0x2aba19){var _0x444038=_0x2aba19[_0x4f3f('0x17')],_0x5c611b=_0x55b8de['offset'],_0x18846e=_0x55b8de['offset']+_0x55b8de[_0x4f3f('0x18')],_0x5c7d3d;if(_0x18846e>=_0x444038){_0x18846e=_0x444038;_0x5c7d3d=0xc8;}else{_0x5c7d3d=0xce;}_0x358e2e[_0x4f3f('0x15')](_0x5c7d3d);return _0x358e2e[_0x4f3f('0x19')](_0x4f3f('0x1a'),_0x5c611b+'-'+_0x18846e+'/'+_0x444038)['json'](_0x2aba19);}return null;};}function patchUpdates(_0x4ef599){return function(_0x40ae50){try{jsonpatch['apply'](_0x40ae50,_0x4ef599,!![]);}catch(_0x2b6fe8){return BPromise['reject'](_0x2b6fe8);}return _0x40ae50['save']();};}function saveUpdates(_0x4bf298,_0x3e0c4d){return function(_0x36d241){if(_0x36d241){return _0x36d241['update'](_0x4bf298)[_0x4f3f('0x1b')](function(_0xa0e6b5){return _0xa0e6b5;});}return null;};}function removeEntity(_0x1ceb22,_0x2401d7){return function(_0xc71ebf){if(_0xc71ebf){return _0xc71ebf[_0x4f3f('0x1c')]()[_0x4f3f('0x1b')](function(){_0x1ceb22[_0x4f3f('0x15')](0xcc)[_0x4f3f('0x1d')]();});}};}function handleEntityNotFound(_0x313a76,_0x1f6d49){return function(_0x5ad78a){if(!_0x5ad78a){_0x313a76['sendStatus'](0x194);}return _0x5ad78a;};}function handleError(_0x538609,_0x27798d){_0x27798d=_0x27798d||0x1f4;return function(_0x1d1528){logger[_0x4f3f('0x1e')](_0x1d1528[_0x4f3f('0x1f')]);if(_0x1d1528[_0x4f3f('0x20')]){delete _0x1d1528[_0x4f3f('0x20')];}_0x538609[_0x4f3f('0x15')](_0x27798d)[_0x4f3f('0x21')](_0x1d1528);};}exports['index']=function(_0x5eecc8,_0x2a4e1e){var _0x946f5d={},_0x49495f={},_0x481aef={'count':0x0,'rows':[]};var _0x136053=_[_0x4f3f('0x22')](db[_0x4f3f('0x23')][_0x4f3f('0x24')],function(_0x37ea85){return{'name':_0x37ea85['fieldName'],'type':_0x37ea85[_0x4f3f('0x25')]['key']};});_0x49495f[_0x4f3f('0x26')]=_[_0x4f3f('0x22')](_0x136053,_0x4f3f('0x20'));_0x49495f[_0x4f3f('0x27')]=_['keys'](_0x5eecc8[_0x4f3f('0x27')]);_0x49495f[_0x4f3f('0x28')]=_[_0x4f3f('0x29')](_0x49495f['model'],_0x49495f[_0x4f3f('0x27')]);_0x49495f[_0x4f3f('0x28')]=_['concat'](_0x49495f[_0x4f3f('0x28')],[_0x4f3f('0x2a'),'$or',_0x4f3f('0x2b'),_0x4f3f('0x2c'),'$lt',_0x4f3f('0x2d'),'$ne',_0x4f3f('0x2e'),'$not',_0x4f3f('0x2f'),'$notBetween',_0x4f3f('0x30'),_0x4f3f('0x31'),_0x4f3f('0x32'),'$notLike',_0x4f3f('0x33'),_0x4f3f('0x34'),'$like','$overlap',_0x4f3f('0x35'),'$contained',_0x4f3f('0x36')]);_0x946f5d['attributes']=_[_0x4f3f('0x29')](_0x49495f[_0x4f3f('0x26')],qs[_0x4f3f('0x37')](_0x5eecc8[_0x4f3f('0x27')][_0x4f3f('0x37')]));_0x946f5d[_0x4f3f('0x38')]=_0x946f5d[_0x4f3f('0x38')]['length']?_0x946f5d['attributes']:_0x49495f[_0x4f3f('0x26')];if(!_0x5eecc8[_0x4f3f('0x27')]['hasOwnProperty']('nolimit')){_0x946f5d['limit']=qs[_0x4f3f('0x18')](_0x5eecc8[_0x4f3f('0x27')]['limit']);_0x946f5d[_0x4f3f('0x39')]=qs[_0x4f3f('0x39')](_0x5eecc8[_0x4f3f('0x27')][_0x4f3f('0x39')]);}_0x946f5d['order']=qs[_0x4f3f('0x3a')](_0x5eecc8[_0x4f3f('0x27')][_0x4f3f('0x3a')]);_0x946f5d[_0x4f3f('0x3b')]=qs[_0x4f3f('0x28')](_['pick'](_0x5eecc8[_0x4f3f('0x27')],_0x49495f['filters']));if(_0x5eecc8['query'][_0x4f3f('0x3c')]){_0x946f5d['where']=_[_0x4f3f('0x3d')](_0x946f5d['where'],{'$or':_[_0x4f3f('0x22')](_0x136053,function(_0x42af31){if(_0x42af31[_0x4f3f('0x25')]!==_0x4f3f('0x3e')){var _0x3e8d0f={};_0x3e8d0f[_0x42af31[_0x4f3f('0x20')]]={'$like':'%'+_0x5eecc8['query'][_0x4f3f('0x3c')]+'%'};return _0x3e8d0f;}})});}_0x946f5d=_[_0x4f3f('0x3d')]({},_0x946f5d,_0x5eecc8['options']);var _0x30167a={'where':_0x946f5d[_0x4f3f('0x3b')]};return db[_0x4f3f('0x23')][_0x4f3f('0x17')](_0x30167a)[_0x4f3f('0x1b')](function(_0xc2e673){_0x481aef['count']=_0xc2e673;if(_0x5eecc8[_0x4f3f('0x27')][_0x4f3f('0x3f')]){_0x946f5d[_0x4f3f('0x40')]=[{'all':!![]}];}return db['CmHopper'][_0x4f3f('0x41')](_0x946f5d);})['then'](function(_0x2d9f29){_0x481aef[_0x4f3f('0x42')]=_0x2d9f29;return _0x481aef;})[_0x4f3f('0x1b')](respondWithFilteredResult(_0x2a4e1e,_0x946f5d))[_0x4f3f('0x43')](handleError(_0x2a4e1e,null));};exports[_0x4f3f('0x44')]=function(_0x471b74,_0x258a81){var _0x5085a0={'raw':!![],'where':{'id':_0x471b74['params']['id']}},_0xa80a30={};_0xa80a30['model']=_[_0x4f3f('0x45')](db[_0x4f3f('0x23')]['rawAttributes']);_0xa80a30['query']=_[_0x4f3f('0x45')](_0x471b74['query']);_0xa80a30[_0x4f3f('0x28')]=_['intersection'](_0xa80a30[_0x4f3f('0x26')],_0xa80a30[_0x4f3f('0x27')]);_0x5085a0['attributes']=_[_0x4f3f('0x29')](_0xa80a30['model'],qs[_0x4f3f('0x37')](_0x471b74[_0x4f3f('0x27')][_0x4f3f('0x37')]));_0x5085a0['attributes']=_0x5085a0[_0x4f3f('0x38')]['length']?_0x5085a0[_0x4f3f('0x38')]:_0xa80a30['model'];if(_0x471b74[_0x4f3f('0x27')]['includeAll']){_0x5085a0[_0x4f3f('0x40')]=[{'all':!![]}];}_0x5085a0=_[_0x4f3f('0x3d')]({},_0x5085a0,_0x471b74[_0x4f3f('0x46')]);return db[_0x4f3f('0x23')][_0x4f3f('0x47')](_0x5085a0)[_0x4f3f('0x1b')](handleEntityNotFound(_0x258a81,null))[_0x4f3f('0x1b')](respondWithResult(_0x258a81,null))['catch'](handleError(_0x258a81,null));};exports['create']=function(_0x538994,_0x1eec8d){return db['CmHopper']['create'](_0x538994[_0x4f3f('0x48')],{})[_0x4f3f('0x1b')](respondWithResult(_0x1eec8d,0xc9))[_0x4f3f('0x43')](handleError(_0x1eec8d,null));};exports[_0x4f3f('0x49')]=function(_0x302b44,_0x4eb97d){if(_0x302b44[_0x4f3f('0x48')]['id']){delete _0x302b44['body']['id'];}return db[_0x4f3f('0x23')][_0x4f3f('0x47')]({'where':{'id':_0x302b44[_0x4f3f('0x4a')]['id']}})[_0x4f3f('0x1b')](handleEntityNotFound(_0x4eb97d,null))['then'](saveUpdates(_0x302b44[_0x4f3f('0x48')],null))[_0x4f3f('0x1b')](respondWithResult(_0x4eb97d,null))[_0x4f3f('0x43')](handleError(_0x4eb97d,null));};exports[_0x4f3f('0x4b')]=function(_0x22f90a,_0x4ebfa0){return db['CmHopper'][_0x4f3f('0x4b')]()['then'](respondWithResult(_0x4ebfa0,null))[_0x4f3f('0x43')](handleError(_0x4ebfa0,null));};exports[_0x4f3f('0x1c')]=function(_0x4d7f98,_0x5e6958){var _0x2bd787;return db[_0x4f3f('0x23')]['find']({'where':{'id':_0x4d7f98['params']['id']}})[_0x4f3f('0x1b')](handleEntityNotFound(_0x5e6958,null))[_0x4f3f('0x1b')](function(_0x36bb38){if(_0x36bb38){return _0x36bb38[_0x4f3f('0x1c')]()[_0x4f3f('0x1b')](function(_0x152197){return _0x152197;});}})[_0x4f3f('0x1b')](function(_0x312dac){_0x2bd787=_0x312dac;if(_0x312dac){if(_0x312dac['VoiceQueueId']||_0x312dac['CampaignId']){return db[_0x312dac[_0x4f3f('0x4c')]?_0x4f3f('0x4d'):'Campaign']['find']({'where':{'id':_0x312dac['VoiceQueueId']?_0x312dac[_0x4f3f('0x4c')]:_0x312dac['CampaignId']},'attributes':['id',_0x4f3f('0x20')],'raw':!![]});}}})[_0x4f3f('0x1b')](function(_0x3ad3b4){var _0x1b6f62={};if(_0x3ad3b4){_[_0x4f3f('0x3d')](_0x1b6f62,_[_0x4f3f('0x4e')](_0x2bd787[_0x4f3f('0x4f')],[_0x4f3f('0x50'),'updatedAt','id']));_0x1b6f62['state']=0x15;_0x1b6f62[_0x4f3f('0x51')]=_0x4f3f('0x52');_0x1b6f62[_0x4f3f('0x53')]=_0x3ad3b4[_0x4f3f('0x20')];_0x1b6f62['membername']=_0x4d7f98['user'][_0x4f3f('0x20')];_0x1b6f62['UserId']=_0x4d7f98[_0x4f3f('0x54')]['id'];_0x1b6f62['deleted']=!![];_0x1b6f62[_0x4f3f('0x55')]=moment()['format'](_0x4f3f('0x56'));_0x1b6f62[_0x4f3f('0x57')]=_0x2bd787[_0x4f3f('0x58')];_0x1b6f62[_0x4f3f('0x59')]=_0x2bd787[_0x4f3f('0x4c')]?'queue':_0x4f3f('0x5a');return db[_0x4f3f('0x5b')][_0x4f3f('0x47')]({'where':{'id':_0x1b6f62[_0x4f3f('0x5c')]},'attributes':['firstName','lastName']})[_0x4f3f('0x1b')](function(_0xeaa61){if(!_[_0x4f3f('0x5d')](_0x5e6958)&&!_[_0x4f3f('0x5d')](_0xeaa61[_0x4f3f('0x5e')])){_0x1b6f62['calleridname']=_0xeaa61['firstName'];if(!_[_0x4f3f('0x5d')](_0xeaa61[_0x4f3f('0x5f')])){_0x1b6f62[_0x4f3f('0x60')]+='\x20'+_0xeaa61[_0x4f3f('0x5f')];}}})['finally'](function(){return db[_0x4f3f('0x61')]['create'](_0x1b6f62);});}})[_0x4f3f('0x1b')](function(){return _0x5e6958['status'](0xcc)[_0x4f3f('0x1d')]();})[_0x4f3f('0x43')](handleError(_0x5e6958,null));};exports[_0x4f3f('0x62')]=function(_0x371c13,_0x3b1681,_0x2603f8){var _0x1c99a2=[];return db[_0x4f3f('0x5b')][_0x4f3f('0x4b')]()[_0x4f3f('0x1b')](function(_0x19f544){_0x1c99a2=_[_0x4f3f('0x45')](_0x19f544);return _0x371c13['user']['getVoiceQueues']({'where':{'type':_0x4f3f('0x63'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x4f3f('0x64')],'raw':!![]});})[_0x4f3f('0x1b')](function(_0x24fd92){if(_0x24fd92&&_0x24fd92[_0x4f3f('0x65')]){return db[_0x4f3f('0x66')]['transaction'](function(_0x510fb5){var _0x5f4867={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4f3f('0x67')](_0x4f3f('0x56'))},'VoiceQueueId':{'$in':_[_0x4f3f('0x22')](_0x24fd92,'id')},'$or':[{'UserId':null},{'UserId':_0x371c13[_0x4f3f('0x54')]['id']}]};var _0xf2c868=[];if(_0x371c13[_0x4f3f('0x48')][_0x4f3f('0x68')]&&_0x371c13[_0x4f3f('0x48')][_0x4f3f('0x68')]===_0x4f3f('0x69')){if(!_['isEmpty'](_0x371c13['body'][_0x4f3f('0x6a')])){_0x5f4867['id']={'$in':_0x371c13[_0x4f3f('0x48')][_0x4f3f('0x6a')]};}_0xf2c868=[[_0x4f3f('0x6b'),_0x4f3f('0x6c')],[_0x4f3f('0x6d'),_0x24fd92[0x0][_0x4f3f('0x64')]===_0x4f3f('0x6c')?_0x4f3f('0x6e'):_0x4f3f('0x6c')],db[_0x4f3f('0x66')][_0x4f3f('0x6f')](_0x4f3f('0x70')),['id','DESC']];}else{if(!_[_0x4f3f('0x71')](_0x371c13[_0x4f3f('0x48')][_0x4f3f('0x6a')])){_0x5f4867['id']={'$notIn':_0x371c13[_0x4f3f('0x48')][_0x4f3f('0x6a')]};}_0xf2c868=[['priority','DESC'],['scheduledAt',_0x24fd92[0x0][_0x4f3f('0x64')]],db[_0x4f3f('0x66')][_0x4f3f('0x6f')](_0x4f3f('0x72')),['id',_0x4f3f('0x6c')]];}return db[_0x4f3f('0x23')][_0x4f3f('0x73')]({'attributes':['id',_0x4f3f('0x74')],'where':_0x5f4867,'order':_0xf2c868,'transaction':_0x510fb5,'lock':_0x510fb5[_0x4f3f('0x75')][_0x4f3f('0x76')],'include':[{'model':db[_0x4f3f('0x5b')],'as':_0x4f3f('0x77'),'attributes':_0x1c99a2,'include':[{'model':db[_0x4f3f('0x78')],'as':_0x4f3f('0x79'),'attributes':['id',_0x4f3f('0x20')]}]},{'model':db[_0x4f3f('0x7a')],'as':_0x4f3f('0x7b'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name','dialActive']}]})[_0x4f3f('0x1b')](function(_0x4912df){if(_0x4912df){return _0x4912df[_0x4f3f('0x49')]({'UserId':_0x371c13[_0x4f3f('0x54')]['id']},{'transaction':_0x510fb5});}});});}})[_0x4f3f('0x1b')](handleEntityNotFound(_0x3b1681,null))[_0x4f3f('0x1b')](respondWithResult(_0x3b1681,null))['catch'](handleError(_0x3b1681,null));};exports[_0x4f3f('0x7c')]=function(_0x3d57ea,_0x135ff8,_0x519173){return _0x3d57ea[_0x4f3f('0x54')][_0x4f3f('0x7d')]({'where':{'type':_0x4f3f('0x63'),'dialActive':!![],'dialMethod':_0x4f3f('0x7e')},'attributes':['id'],'raw':!![]})[_0x4f3f('0x1b')](function(_0x5e4faf){if(_0x5e4faf&&_0x5e4faf[_0x4f3f('0x65')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4f3f('0x67')](_0x4f3f('0x56'))},'VoiceQueueId':{'$in':_['map'](_0x5e4faf,'id')},'$or':[{'UserId':null},{'UserId':_0x3d57ea['user']['id']}]}});}return 0x0;})[_0x4f3f('0x1b')](function(_0x28cf59){if(!_[_0x4f3f('0x5d')](_0x28cf59)&&_[_0x4f3f('0x7f')](_0x28cf59)){return _0x135ff8[_0x4f3f('0x15')](0xc8)[_0x4f3f('0x16')]({'contacts':_0x28cf59});}else{logger[_0x4f3f('0x1e')](_0x4f3f('0x80'),_0x4f3f('0x7c'),0x194,_0x4f3f('0x81'));_0x135ff8[_0x4f3f('0x14')](0x194);}})[_0x4f3f('0x43')](handleError(_0x135ff8,null));}; \ No newline at end of file +var _0xb7aa=['CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','util','path','sox','ejs','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','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','CmHopper','rawAttributes','fieldName','type','key','model','query','filters','$or','$lt','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','VoiceQueueId','CampaignId','Campaign','omit','createdAt','state','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','preview','isNumber'];(function(_0x303b3a,_0x2f01f7){var _0x5daedd=function(_0xcc0425){while(--_0xcc0425){_0x303b3a['push'](_0x303b3a['shift']());}};_0x5daedd(++_0x2f01f7);}(_0xb7aa,0x1be));var _0xab7a=function(_0x51ff86,_0x54da33){_0x51ff86=_0x51ff86-0x0;var _0x1abbd9=_0xb7aa[_0x51ff86];return _0x1abbd9;};'use strict';var pdf=require(_0xab7a('0x0'));var emlformat=require(_0xab7a('0x1'));var rimraf=require(_0xab7a('0x2'));var zipdir=require(_0xab7a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xab7a('0x4'));var path=require(_0xab7a('0x5'));var sox=require(_0xab7a('0x6'));var csv=require('to-csv');var ejs=require(_0xab7a('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xab7a('0x8'));var crypto=require(_0xab7a('0x9'));var jsforce=require(_0xab7a('0xa'));var deskjs=require(_0xab7a('0xb'));var toCsv=require('to-csv');var querystring=require(_0xab7a('0xc'));var Papa=require('papaparse');var Redis=require(_0xab7a('0xd'));var authService=require(_0xab7a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xab7a('0xf'));var hardwareService=require(_0xab7a('0x10'));var logger=require(_0xab7a('0x11'))(_0xab7a('0x12'));var utils=require(_0xab7a('0x13'));var config=require(_0xab7a('0x14'));var db=require(_0xab7a('0x15'))['db'];function respondWithStatusCode(_0x5088f3,_0x25a685){_0x25a685=_0x25a685||0xcc;return function(_0x2d7bcd){if(_0x2d7bcd){return _0x5088f3[_0xab7a('0x16')](_0x25a685);}return _0x5088f3[_0xab7a('0x17')](_0x25a685)[_0xab7a('0x18')]();};}function respondWithResult(_0x4aa700,_0xca5f0a){_0xca5f0a=_0xca5f0a||0xc8;return function(_0x27ff5c){if(_0x27ff5c){return _0x4aa700[_0xab7a('0x17')](_0xca5f0a)[_0xab7a('0x19')](_0x27ff5c);}};}function respondWithFilteredResult(_0x111d6c,_0x1702fc){return function(_0x3499c8){if(_0x3499c8){var _0x173a5e=_0x3499c8[_0xab7a('0x1a')],_0xaf8b65=_0x1702fc[_0xab7a('0x1b')],_0x401069=_0x1702fc[_0xab7a('0x1b')]+_0x1702fc[_0xab7a('0x1c')],_0x33a080;if(_0x401069>=_0x173a5e){_0x401069=_0x173a5e;_0x33a080=0xc8;}else{_0x33a080=0xce;}_0x111d6c[_0xab7a('0x17')](_0x33a080);return _0x111d6c['set'](_0xab7a('0x1d'),_0xaf8b65+'-'+_0x401069+'/'+_0x173a5e)[_0xab7a('0x19')](_0x3499c8);}return null;};}function patchUpdates(_0xec8e8b){return function(_0x502a02){try{jsonpatch[_0xab7a('0x1e')](_0x502a02,_0xec8e8b,!![]);}catch(_0x2dd2fa){return BPromise[_0xab7a('0x1f')](_0x2dd2fa);}return _0x502a02[_0xab7a('0x20')]();};}function saveUpdates(_0x129e10,_0x2ad827){return function(_0x4fce67){if(_0x4fce67){return _0x4fce67[_0xab7a('0x21')](_0x129e10)['then'](function(_0x413d1d){return _0x413d1d;});}return null;};}function removeEntity(_0x17c2fa,_0x2a44ea){return function(_0x4f478b){if(_0x4f478b){return _0x4f478b[_0xab7a('0x22')]()[_0xab7a('0x23')](function(){_0x17c2fa[_0xab7a('0x17')](0xcc)[_0xab7a('0x18')]();});}};}function handleEntityNotFound(_0x8e3d9d,_0x42e099){return function(_0x3fb08d){if(!_0x3fb08d){_0x8e3d9d[_0xab7a('0x16')](0x194);}return _0x3fb08d;};}function handleError(_0x2bf054,_0x5bfb40){_0x5bfb40=_0x5bfb40||0x1f4;return function(_0x180ab4){logger[_0xab7a('0x24')](_0x180ab4[_0xab7a('0x25')]);if(_0x180ab4[_0xab7a('0x26')]){delete _0x180ab4['name'];}_0x2bf054[_0xab7a('0x17')](_0x5bfb40)[_0xab7a('0x27')](_0x180ab4);};}exports['index']=function(_0x29d88b,_0x32b9a2){var _0x5da7e={},_0x1ea62a={},_0x3d25d6={'count':0x0,'rows':[]};var _0x536a9f=_[_0xab7a('0x28')](db[_0xab7a('0x29')][_0xab7a('0x2a')],function(_0x5ed101){return{'name':_0x5ed101[_0xab7a('0x2b')],'type':_0x5ed101[_0xab7a('0x2c')][_0xab7a('0x2d')]};});_0x1ea62a[_0xab7a('0x2e')]=_[_0xab7a('0x28')](_0x536a9f,'name');_0x1ea62a[_0xab7a('0x2f')]=_['keys'](_0x29d88b[_0xab7a('0x2f')]);_0x1ea62a[_0xab7a('0x30')]=_['intersection'](_0x1ea62a[_0xab7a('0x2e')],_0x1ea62a[_0xab7a('0x2f')]);_0x1ea62a[_0xab7a('0x30')]=_['concat'](_0x1ea62a['filters'],['$and',_0xab7a('0x31'),'$gt','$gte',_0xab7a('0x32'),'$lte',_0xab7a('0x33'),_0xab7a('0x34'),_0xab7a('0x35'),_0xab7a('0x36'),_0xab7a('0x37'),_0xab7a('0x38'),_0xab7a('0x39'),_0xab7a('0x3a'),_0xab7a('0x3b'),_0xab7a('0x3c'),_0xab7a('0x3d'),_0xab7a('0x3a'),_0xab7a('0x3e'),_0xab7a('0x3f'),'$contained',_0xab7a('0x40')]);_0x5da7e[_0xab7a('0x41')]=_[_0xab7a('0x42')](_0x1ea62a[_0xab7a('0x2e')],qs[_0xab7a('0x43')](_0x29d88b[_0xab7a('0x2f')][_0xab7a('0x43')]));_0x5da7e[_0xab7a('0x41')]=_0x5da7e[_0xab7a('0x41')][_0xab7a('0x44')]?_0x5da7e[_0xab7a('0x41')]:_0x1ea62a['model'];if(!_0x29d88b['query'][_0xab7a('0x45')](_0xab7a('0x46'))){_0x5da7e['limit']=qs['limit'](_0x29d88b[_0xab7a('0x2f')][_0xab7a('0x1c')]);_0x5da7e[_0xab7a('0x1b')]=qs[_0xab7a('0x1b')](_0x29d88b[_0xab7a('0x2f')][_0xab7a('0x1b')]);}_0x5da7e[_0xab7a('0x47')]=qs[_0xab7a('0x48')](_0x29d88b['query'][_0xab7a('0x48')]);_0x5da7e['where']=qs['filters'](_[_0xab7a('0x49')](_0x29d88b[_0xab7a('0x2f')],_0x1ea62a['filters']));if(_0x29d88b[_0xab7a('0x2f')][_0xab7a('0x4a')]){_0x5da7e[_0xab7a('0x4b')]=_[_0xab7a('0x4c')](_0x5da7e['where'],{'$or':_['map'](_0x536a9f,function(_0x561ea5){if(_0x561ea5[_0xab7a('0x2c')]!==_0xab7a('0x4d')){var _0x333789={};_0x333789[_0x561ea5[_0xab7a('0x26')]]={'$like':'%'+_0x29d88b[_0xab7a('0x2f')]['filter']+'%'};return _0x333789;}})});}_0x5da7e=_[_0xab7a('0x4c')]({},_0x5da7e,_0x29d88b[_0xab7a('0x4e')]);var _0x4d4692={'where':_0x5da7e[_0xab7a('0x4b')]};return db[_0xab7a('0x29')][_0xab7a('0x1a')](_0x4d4692)[_0xab7a('0x23')](function(_0x152219){_0x3d25d6[_0xab7a('0x1a')]=_0x152219;if(_0x29d88b[_0xab7a('0x2f')][_0xab7a('0x4f')]){_0x5da7e[_0xab7a('0x50')]=[{'all':!![]}];}return db[_0xab7a('0x29')][_0xab7a('0x51')](_0x5da7e);})[_0xab7a('0x23')](function(_0x2b1a52){_0x3d25d6[_0xab7a('0x52')]=_0x2b1a52;return _0x3d25d6;})[_0xab7a('0x23')](respondWithFilteredResult(_0x32b9a2,_0x5da7e))[_0xab7a('0x53')](handleError(_0x32b9a2,null));};exports[_0xab7a('0x54')]=function(_0x5aea27,_0x5f227){var _0x34e7eb={'raw':!![],'where':{'id':_0x5aea27[_0xab7a('0x55')]['id']}},_0x2f3c78={};_0x2f3c78[_0xab7a('0x2e')]=_[_0xab7a('0x56')](db[_0xab7a('0x29')][_0xab7a('0x2a')]);_0x2f3c78[_0xab7a('0x2f')]=_['keys'](_0x5aea27[_0xab7a('0x2f')]);_0x2f3c78['filters']=_[_0xab7a('0x42')](_0x2f3c78[_0xab7a('0x2e')],_0x2f3c78[_0xab7a('0x2f')]);_0x34e7eb[_0xab7a('0x41')]=_[_0xab7a('0x42')](_0x2f3c78['model'],qs[_0xab7a('0x43')](_0x5aea27[_0xab7a('0x2f')][_0xab7a('0x43')]));_0x34e7eb[_0xab7a('0x41')]=_0x34e7eb[_0xab7a('0x41')][_0xab7a('0x44')]?_0x34e7eb[_0xab7a('0x41')]:_0x2f3c78[_0xab7a('0x2e')];if(_0x5aea27[_0xab7a('0x2f')][_0xab7a('0x4f')]){_0x34e7eb['include']=[{'all':!![]}];}_0x34e7eb=_[_0xab7a('0x4c')]({},_0x34e7eb,_0x5aea27[_0xab7a('0x4e')]);return db[_0xab7a('0x29')][_0xab7a('0x57')](_0x34e7eb)[_0xab7a('0x23')](handleEntityNotFound(_0x5f227,null))[_0xab7a('0x23')](respondWithResult(_0x5f227,null))[_0xab7a('0x53')](handleError(_0x5f227,null));};exports['create']=function(_0x426a5b,_0x466946){return db[_0xab7a('0x29')][_0xab7a('0x58')](_0x426a5b[_0xab7a('0x59')],{})[_0xab7a('0x23')](respondWithResult(_0x466946,0xc9))['catch'](handleError(_0x466946,null));};exports[_0xab7a('0x21')]=function(_0x5ed3d8,_0x4a5971){if(_0x5ed3d8[_0xab7a('0x59')]['id']){delete _0x5ed3d8[_0xab7a('0x59')]['id'];}return db['CmHopper'][_0xab7a('0x57')]({'where':{'id':_0x5ed3d8[_0xab7a('0x55')]['id']}})[_0xab7a('0x23')](handleEntityNotFound(_0x4a5971,null))[_0xab7a('0x23')](saveUpdates(_0x5ed3d8[_0xab7a('0x59')],null))[_0xab7a('0x23')](respondWithResult(_0x4a5971,null))[_0xab7a('0x53')](handleError(_0x4a5971,null));};exports[_0xab7a('0x5a')]=function(_0x562567,_0x2ef136){return db['CmHopper'][_0xab7a('0x5a')]()[_0xab7a('0x23')](respondWithResult(_0x2ef136,null))[_0xab7a('0x53')](handleError(_0x2ef136,null));};exports['destroy']=function(_0x4d668d,_0x1712d2){var _0xb7c9c8;return db['CmHopper'][_0xab7a('0x57')]({'where':{'id':_0x4d668d[_0xab7a('0x55')]['id']}})[_0xab7a('0x23')](handleEntityNotFound(_0x1712d2,null))[_0xab7a('0x23')](function(_0x1d2b7d){if(_0x1d2b7d){return _0x1d2b7d['destroy']()['then'](function(_0x34842e){return _0x34842e;});}})['then'](function(_0x119a6c){_0xb7c9c8=_0x119a6c;if(_0x119a6c){if(_0x119a6c[_0xab7a('0x5b')]||_0x119a6c[_0xab7a('0x5c')]){return db[_0x119a6c[_0xab7a('0x5b')]?'VoiceQueue':_0xab7a('0x5d')][_0xab7a('0x57')]({'where':{'id':_0x119a6c[_0xab7a('0x5b')]?_0x119a6c[_0xab7a('0x5b')]:_0x119a6c[_0xab7a('0x5c')]},'attributes':['id','name'],'raw':!![]});}}})[_0xab7a('0x23')](function(_0x59d375){var _0x2ccee7={};if(_0x59d375){_[_0xab7a('0x4c')](_0x2ccee7,_[_0xab7a('0x5e')](_0xb7c9c8['dataValues'],[_0xab7a('0x5f'),'updatedAt','id']));_0x2ccee7[_0xab7a('0x60')]=0x15;_0x2ccee7['statedesc']=_0xab7a('0x61');_0x2ccee7[_0xab7a('0x62')]=_0x59d375[_0xab7a('0x26')];_0x2ccee7[_0xab7a('0x63')]=_0x4d668d[_0xab7a('0x64')][_0xab7a('0x26')];_0x2ccee7['UserId']=_0x4d668d[_0xab7a('0x64')]['id'];_0x2ccee7[_0xab7a('0x61')]=!![];_0x2ccee7[_0xab7a('0x65')]=moment()[_0xab7a('0x66')](_0xab7a('0x67'));_0x2ccee7[_0xab7a('0x68')]=_0xb7c9c8[_0xab7a('0x69')];_0x2ccee7[_0xab7a('0x6a')]=_0xb7c9c8[_0xab7a('0x5b')]?_0xab7a('0x6b'):_0xab7a('0x6c');return db[_0xab7a('0x6d')]['find']({'where':{'id':_0x2ccee7[_0xab7a('0x6e')]},'attributes':[_0xab7a('0x6f'),_0xab7a('0x70')]})['then'](function(_0xc34bd0){if(!_[_0xab7a('0x71')](_0x1712d2)&&!_[_0xab7a('0x71')](_0xc34bd0[_0xab7a('0x6f')])){_0x2ccee7[_0xab7a('0x72')]=_0xc34bd0[_0xab7a('0x6f')];if(!_[_0xab7a('0x71')](_0xc34bd0[_0xab7a('0x70')])){_0x2ccee7[_0xab7a('0x72')]+='\x20'+_0xc34bd0[_0xab7a('0x70')];}}})['finally'](function(){return db['CmHopperFinal'][_0xab7a('0x58')](_0x2ccee7);});}})[_0xab7a('0x23')](function(){return _0x1712d2[_0xab7a('0x17')](0xcc)['end']();})[_0xab7a('0x53')](handleError(_0x1712d2,null));};exports[_0xab7a('0x73')]=function(_0x20b79d,_0x510c04,_0x4dcb1c){var _0x7ec8f9=[];return db[_0xab7a('0x6d')][_0xab7a('0x5a')]()[_0xab7a('0x23')](function(_0x528c03){_0x7ec8f9=_[_0xab7a('0x56')](_0x528c03);return _0x20b79d[_0xab7a('0x64')][_0xab7a('0x74')]({'where':{'type':_0xab7a('0x75'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xab7a('0x76')],'raw':!![]});})['then'](function(_0x2bd4d5){if(_0x2bd4d5&&_0x2bd4d5[_0xab7a('0x44')]){return db[_0xab7a('0x77')][_0xab7a('0x78')](function(_0x25e46b){var _0xde9a1b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x2bd4d5,'id')},'$or':[{'UserId':null},{'UserId':_0x20b79d[_0xab7a('0x64')]['id']}]};var _0x4b28e2=[];if(_0x20b79d['body']['direction']&&_0x20b79d[_0xab7a('0x59')][_0xab7a('0x79')]===_0xab7a('0x7a')){if(!_[_0xab7a('0x7b')](_0x20b79d['body']['hopperIds'])){_0xde9a1b['id']={'$in':_0x20b79d[_0xab7a('0x59')][_0xab7a('0x7c')]};}_0x4b28e2=[[_0xab7a('0x7d'),_0xab7a('0x7e')],[_0xab7a('0x7f'),_0x2bd4d5[0x0][_0xab7a('0x76')]===_0xab7a('0x7e')?'DESC':_0xab7a('0x7e')],db[_0xab7a('0x77')][_0xab7a('0x80')](_0xab7a('0x81')),['id',_0xab7a('0x82')]];}else{if(!_[_0xab7a('0x7b')](_0x20b79d[_0xab7a('0x59')][_0xab7a('0x7c')])){_0xde9a1b['id']={'$notIn':_0x20b79d[_0xab7a('0x59')][_0xab7a('0x7c')]};}_0x4b28e2=[['priority','DESC'],[_0xab7a('0x7f'),_0x2bd4d5[0x0][_0xab7a('0x76')]],db[_0xab7a('0x77')][_0xab7a('0x80')](_0xab7a('0x83')),['id','ASC']];}return db[_0xab7a('0x29')][_0xab7a('0x84')]({'attributes':['id',_0xab7a('0x85')],'where':_0xde9a1b,'order':_0x4b28e2,'transaction':_0x25e46b,'lock':_0x25e46b[_0xab7a('0x86')][_0xab7a('0x87')],'include':[{'model':db[_0xab7a('0x6d')],'as':_0xab7a('0x88'),'attributes':_0x7ec8f9,'include':[{'model':db['CmCompany'],'as':_0xab7a('0x89'),'attributes':['id',_0xab7a('0x26')]}]},{'model':db[_0xab7a('0x8a')],'as':_0xab7a('0x8b'),'attributes':['id',_0xab7a('0x26')]},{'model':db[_0xab7a('0x8c')],'as':_0xab7a('0x8d'),'attributes':['id',_0xab7a('0x26'),_0xab7a('0x8e')]}]})[_0xab7a('0x23')](function(_0x5870cd){if(_0x5870cd){return _0x5870cd[_0xab7a('0x21')]({'UserId':_0x20b79d['user']['id']},{'transaction':_0x25e46b});}});});}})[_0xab7a('0x23')](handleEntityNotFound(_0x510c04,null))['then'](respondWithResult(_0x510c04,null))[_0xab7a('0x53')](handleError(_0x510c04,null));};exports[_0xab7a('0x8f')]=function(_0x4a8455,_0x49e287,_0x2a509f){return _0x4a8455[_0xab7a('0x64')]['getVoiceQueues']({'where':{'type':_0xab7a('0x75'),'dialActive':!![],'dialMethod':_0xab7a('0x90')},'attributes':['id'],'raw':!![]})[_0xab7a('0x23')](function(_0x476db5){if(_0x476db5&&_0x476db5[_0xab7a('0x44')]){return db[_0xab7a('0x29')][_0xab7a('0x1a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xab7a('0x66')](_0xab7a('0x67'))},'VoiceQueueId':{'$in':_[_0xab7a('0x28')](_0x476db5,'id')},'$or':[{'UserId':null},{'UserId':_0x4a8455['user']['id']}]}});}return 0x0;})[_0xab7a('0x23')](function(_0x2264f1){if(!_['isNil'](_0x2264f1)&&_[_0xab7a('0x91')](_0x2264f1)){return _0x49e287[_0xab7a('0x17')](0xc8)[_0xab7a('0x19')]({'contacts':_0x2264f1});}else{logger[_0xab7a('0x24')](_0xab7a('0x92'),_0xab7a('0x8f'),0x194,_0xab7a('0x93'));_0x49e287['sendStatus'](0x194);}})['catch'](handleError(_0x49e287,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 29c9b97..b312c7e 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 _0x93b4=['bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x288b36,_0x527364){var _0x486645=function(_0x59912f){while(--_0x59912f){_0x288b36['push'](_0x288b36['shift']());}};_0x486645(++_0x527364);}(_0x93b4,0xe9));var _0x493b=function(_0x2b7ba3,_0x3eb26a){_0x2b7ba3=_0x2b7ba3-0x0;var _0x2d189f=_0x93b4[_0x2b7ba3];return _0x2d189f;};'use strict';var _=require(_0x493b('0x0'));var util=require(_0x493b('0x1'));var logger=require(_0x493b('0x2'))(_0x493b('0x3'));var moment=require(_0x493b('0x4'));var BPromise=require(_0x493b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x493b('0x6'));var rimraf=require(_0x493b('0x7'));var config=require(_0x493b('0x8'));var attributes=require(_0x493b('0x9'));module[_0x493b('0xa')]=function(_0x3342dc,_0x28d656){return _0x3342dc[_0x493b('0xb')](_0x493b('0xc'),attributes,{'tableName':_0x493b('0xd'),'paranoid':![],'indexes':[{'name':_0x493b('0xe'),'fields':[_0x493b('0xe')]},{'name':_0x493b('0xf'),'fields':[_0x493b('0xf')]},{'name':_0x493b('0x10'),'fields':[_0x493b('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc1b7=['rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4683b6,_0x374508){var _0x91942a=function(_0x2d0b7d){while(--_0x2d0b7d){_0x4683b6['push'](_0x4683b6['shift']());}};_0x91942a(++_0x374508);}(_0xc1b7,0x16a));var _0x7c1b=function(_0x1b0c7c,_0x468383){_0x1b0c7c=_0x1b0c7c-0x0;var _0x44f649=_0xc1b7[_0x1b0c7c];return _0x44f649;};'use strict';var _=require('lodash');var util=require(_0x7c1b('0x0'));var logger=require(_0x7c1b('0x1'))(_0x7c1b('0x2'));var moment=require(_0x7c1b('0x3'));var BPromise=require(_0x7c1b('0x4'));var rp=require(_0x7c1b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c1b('0x6'));var config=require(_0x7c1b('0x7'));var attributes=require(_0x7c1b('0x8'));module[_0x7c1b('0x9')]=function(_0x295e79,_0x2c8b94){return _0x295e79[_0x7c1b('0xa')](_0x7c1b('0xb'),attributes,{'tableName':_0x7c1b('0xc'),'paranoid':![],'indexes':[{'name':_0x7c1b('0xd'),'fields':['scheduledat']},{'name':_0x7c1b('0xe'),'fields':[_0x7c1b('0xe')]},{'name':_0x7c1b('0xf'),'fields':[_0x7c1b('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index ac46c08..fe27e75 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 _0xb10b=['order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','push','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','all','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','debug','catch','ShowCmHopper','CreateCmHopper','create','body','update','limit','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb10b,0x12a));var _0xbb10=function(_0x466bc5,_0x3a0f2a){_0x466bc5=_0x466bc5-0x0;var _0x138952=_0xb10b[_0x466bc5];return _0x138952;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'limit':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['limit']||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x407cb4){return{'model':db[_0x407cb4[_0xbb10('0x1e')]],'as':_0x407cb4['as'],'attributes':_0x407cb4[_0xbb10('0x1b')],'include':_0x407cb4[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x407cb4[_0xbb10('0x1c')],function(_0x537898){return{'model':db[_0x537898['model']],'as':_0x537898['as'],'attributes':_0x537898['attributes'],'include':_0x537898[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x537898[_0xbb10('0x1c')],function(_0x4e25ff){return{'model':db[_0x4e25ff[_0xbb10('0x1e')]],'as':_0x4e25ff['as'],'attributes':_0x4e25ff[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x1d5e95){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')]('GetCmHopper',_0x378da8,JSON[_0xbb10('0x11')](_0x1d5e95));_0x575cca(_0x1d5e95);})[_0xbb10('0x20')](function(_0xfc3595){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0xfc3595[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0xfc3595[_0xbb10('0x13')]));});});};exports['ShowCmHopper']=function(_0x448d5c){var _0x56f2da=this;return new Promise(function(_0x16ad2a,_0x1dcc9c){return db[_0xbb10('0x16')]['find']({'raw':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'include':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')]['include']?_[_0xbb10('0x1d')](_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x8c1ce6){return{'model':db[_0x8c1ce6[_0xbb10('0x1e')]],'as':_0x8c1ce6['as'],'attributes':_0x8c1ce6[_0xbb10('0x1b')],'include':_0x8c1ce6[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x8c1ce6[_0xbb10('0x1c')],function(_0x56943c){return{'model':db[_0x56943c[_0xbb10('0x1e')]],'as':_0x56943c['as'],'attributes':_0x56943c[_0xbb10('0x1b')],'include':_0x56943c[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x56943c['include'],function(_0x111762){return{'model':db[_0x111762['model']],'as':_0x111762['as'],'attributes':_0x111762['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x40c164){logger[_0xbb10('0xd')](_0xbb10('0x21'),_0x448d5c);logger[_0xbb10('0x1f')](_0xbb10('0x21'),_0x448d5c,JSON['stringify'](_0x40c164));_0x16ad2a(_0x40c164);})[_0xbb10('0x20')](function(_0x25d72f){logger['error']('ShowCmHopper',_0x25d72f['message'],_0x448d5c);_0x1dcc9c(_0x56f2da[_0xbb10('0x12')](0x1f4,_0x25d72f[_0xbb10('0x13')]));});});};exports[_0xbb10('0x22')]=function(_0x4d5a9b){var _0x3c0cd7=this;return new Promise(function(_0x3e8538,_0x4345f3){return db['CmHopper'][_0xbb10('0x23')](_0x4d5a9b[_0xbb10('0x24')],{'raw':_0x4d5a9b[_0xbb10('0x18')]?_0x4d5a9b[_0xbb10('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0x110eb5){logger['info'](_0xbb10('0x22'),_0x4d5a9b);logger[_0xbb10('0x1f')](_0xbb10('0x22'),_0x4d5a9b,JSON[_0xbb10('0x11')](_0x110eb5));_0x3e8538(_0x110eb5);})[_0xbb10('0x20')](function(_0x185a52){logger['error'](_0xbb10('0x22'),_0x185a52[_0xbb10('0x13')],_0x4d5a9b);_0x4345f3(_0x3c0cd7[_0xbb10('0x12')](0x1f4,_0x185a52[_0xbb10('0x13')]));});});};exports['UpdateCmHopper']=function(_0x3fff6c){var _0x331751=this;return new Promise(function(_0x23dc18,_0x403beb){return db['CmHopper'][_0xbb10('0x25')](_0x3fff6c[_0xbb10('0x24')],{'raw':_0x3fff6c['options']?_0x3fff6c['options'][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fff6c['options']?_0x3fff6c[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x3fff6c['options']?_0x3fff6c[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x3fff6c[_0xbb10('0x18')]?_0x3fff6c['options'][_0xbb10('0x26')]||null:null})[_0xbb10('0xc')](function(_0x3b9fdf){logger[_0xbb10('0xd')](_0xbb10('0x27'),_0x3fff6c);logger[_0xbb10('0x1f')](_0xbb10('0x27'),_0x3fff6c,JSON[_0xbb10('0x11')](_0x3b9fdf));_0x23dc18(_0x3b9fdf);})[_0xbb10('0x20')](function(_0x43b948){logger[_0xbb10('0x12')](_0xbb10('0x27'),_0x43b948['message'],_0x3fff6c);_0x403beb(_0x331751[_0xbb10('0x12')](0x1f4,_0x43b948[_0xbb10('0x13')]));});});};exports['DestroyCmHopper']=function(_0x14e1cb){var _0x2f5027=this;return new Promise(function(_0x1a7df6,_0x5a5226){return db[_0xbb10('0x16')][_0xbb10('0x28')]({'where':_0x14e1cb[_0xbb10('0x18')]?_0x14e1cb['options']['where']||null:null})[_0xbb10('0xc')](function(_0x76a208){logger[_0xbb10('0xd')]('DestroyCmHopper',_0x14e1cb);logger['debug'](_0xbb10('0x29'),_0x14e1cb,JSON[_0xbb10('0x11')](_0x76a208));_0x1a7df6(_0x76a208);})[_0xbb10('0x20')](function(_0xf820fe){logger[_0xbb10('0x12')](_0xbb10('0x29'),_0xf820fe[_0xbb10('0x13')],_0x14e1cb);_0x5a5226(_0x2f5027[_0xbb10('0x12')](0x1f4,_0xf820fe[_0xbb10('0x13')]));});});};exports[_0xbb10('0x2a')]=function(_0x550111){var _0x5eafac=this;return new Promise(function(_0x412e13,_0x467dba){return db[_0xbb10('0x2b')][_0xbb10('0x2c')]()[_0xbb10('0xc')](function(_0x440f9e){return db[_0xbb10('0x2d')][_0xbb10('0x2e')](function(_0x1c0d8f){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'where':_0x550111[_0xbb10('0x18')]?_0x550111[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x550111[_0xbb10('0x18')]?_0x550111['options'][_0xbb10('0x1b')]||null:null,'limit':_0x550111['options']?_0x550111[_0xbb10('0x18')][_0xbb10('0x26')]||null:null,'order':_0x550111[_0xbb10('0x18')]?_0x550111[_0xbb10('0x18')][_0xbb10('0x2f')]||null:null,'transaction':_0x1c0d8f,'lock':_0x1c0d8f[_0xbb10('0x30')][_0xbb10('0x31')],'include':[{'model':db[_0xbb10('0x2b')],'as':_0xbb10('0x32'),'attributes':_[_0xbb10('0x33')](_0x440f9e)},{'model':db[_0xbb10('0x34')],'as':_0xbb10('0x35'),'attributes':['id',_0xbb10('0x36'),_0xbb10('0x37')]}]})[_0xbb10('0xc')](function(_0x5de0cc){var _0x4571b6=[];for(var _0x466eb7=0x0;_0x466eb7<_0x5de0cc[_0xbb10('0x38')];_0x466eb7+=0x1){_0x4571b6[_0xbb10('0x39')](_0x5de0cc[_0x466eb7][_0xbb10('0x25')](_0x550111[_0xbb10('0x24')],{'transaction':_0x1c0d8f}));}return BPromise['all'](_0x4571b6);});})[_0xbb10('0xc')](function(_0x4731ce){logger[_0xbb10('0xd')](_0xbb10('0x2a'),_0x550111);logger[_0xbb10('0x1f')](_0xbb10('0x2a'),_0x550111,JSON[_0xbb10('0x11')](_0x4731ce));_0x412e13(_0x4731ce);})[_0xbb10('0x20')](function(_0x205e01){logger[_0xbb10('0x12')](_0xbb10('0x2a'),_0x205e01[_0xbb10('0x13')],_0x550111);_0x467dba(_0x5eafac[_0xbb10('0x12')](0x1f4,_0x205e01['message']));});});});};exports['MoveContactManagedDialer']=function(_0x16272d){var _0x3e6338=this;return new Promise(function(_0x3d0cb7,_0x8b0a7d){return db['sequelize']['transaction'](function(_0x79411e){return db[_0xbb10('0x3a')][_0xbb10('0x23')](_0x16272d[_0xbb10('0x24')],{'raw':_0x16272d[_0xbb10('0x18')]?_0x16272d[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'transaction':_0x79411e})['then'](function(){return db[_0xbb10('0x16')][_0xbb10('0x28')]({'where':_0x16272d['options']?_0x16272d['options']['where']||null:null,'transaction':_0x79411e});});})[_0xbb10('0xc')](function(_0x31c727){logger[_0xbb10('0xd')]('MoveContactManagedDialer',_0x16272d);logger['debug']('MoveContactManagedDialer',_0x16272d,JSON[_0xbb10('0x11')](_0x31c727));_0x3d0cb7(_0x31c727);})[_0xbb10('0x20')](function(_0x45167a){logger['error'](_0xbb10('0x3b'),_0x45167a[_0xbb10('0x13')],_0x16272d);_0x8b0a7d(_0x3e6338['error'](0x1f4,_0x45167a['message']));});});};exports[_0xbb10('0x3c')]=function(_0x308896){var _0xd77753=this;return new Promise(function(_0x237246,_0x54b7c5){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x308896[_0xbb10('0x18')]?_0x308896['options'][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x308896[_0xbb10('0x18')]?_0x308896[_0xbb10('0x18')]['where']||null:null,'attributes':[[db[_0xbb10('0x2d')]['fn'](_0xbb10('0x3d'),db[_0xbb10('0x2d')]['fn']('IF',db[_0xbb10('0x2d')]['literal'](_0xbb10('0x3e')+util[_0xbb10('0x3f')](_0xbb10('0x40'),moment()[_0xbb10('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xbb10('0x41')))),_0xbb10('0x42')]]})[_0xbb10('0xc')](function(_0x2ceb3e){logger[_0xbb10('0xd')](_0xbb10('0x3c'),_0x308896);logger[_0xbb10('0x1f')]('CountReScheduled',_0x308896,JSON['stringify'](_0x2ceb3e));_0x237246(_0x2ceb3e);})['catch'](function(_0xdfbc0b){logger[_0xbb10('0x12')](_0xbb10('0x3c'),_0xdfbc0b['message'],_0x308896);_0x54b7c5(_0xd77753['error'](0x1f4,_0xdfbc0b[_0xbb10('0x13')]));});});};exports[_0xbb10('0x43')]=function(_0xd9e743){var _0x3a9677=this;return new Promise(function(_0x260e06,_0x1ad2ed){return db['CmContact'][_0xbb10('0x2c')]()[_0xbb10('0xc')](function(_0x270fdb){return db[_0xbb10('0x2d')][_0xbb10('0x2e')](function(_0x5bfc68){return db['CmHopper']['findAll']({'where':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':0x1,'order':_0xd9e743['options']?_0xd9e743[_0xbb10('0x18')]['order']||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x5bfc68,'lock':_0x5bfc68[_0xbb10('0x30')][_0xbb10('0x31')],'include':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')]['include']?_[_0xbb10('0x1d')](_0xd9e743['options']['include'],function(_0x165fe9){return{'model':db[_0x165fe9[_0xbb10('0x1e')]],'as':_0x165fe9['as'],'attributes':_0x165fe9[_0xbb10('0x1b')],'include':_0x165fe9[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x165fe9['include'],function(_0x2d52ea){return{'model':db[_0x2d52ea[_0xbb10('0x1e')]],'as':_0x2d52ea['as'],'attributes':_0x2d52ea[_0xbb10('0x1b')],'include':_0x2d52ea[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x2d52ea[_0xbb10('0x1c')],function(_0x174395){return{'model':db[_0x174395['model']],'as':_0x174395['as'],'attributes':_0x174395[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x30f3ea){var _0x322b41=[];for(var _0x37b20e=0x0;_0x37b20e<_0x30f3ea[_0xbb10('0x38')];_0x37b20e+=0x1){_0x322b41[_0xbb10('0x39')](_0x30f3ea[_0x37b20e][_0xbb10('0x25')](_0xd9e743['body'],{'transaction':_0x5bfc68}));}return BPromise[_0xbb10('0x44')](_0x322b41);});})[_0xbb10('0xc')](function(_0x145baf){logger['info']('GetContactRecallMe',_0xd9e743);logger['debug'](_0xbb10('0x43'),_0xd9e743,JSON['stringify'](_0x145baf));_0x260e06(_0x145baf);})['catch'](function(_0x1701c5){logger[_0xbb10('0x12')](_0xbb10('0x43'),_0x1701c5[_0xbb10('0x13')],_0xd9e743);_0x1ad2ed(_0x3a9677[_0xbb10('0x12')](0x1f4,_0x1701c5[_0xbb10('0x13')]));});});});}; \ No newline at end of file +var _0xb10b=['order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','push','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','all','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','debug','catch','ShowCmHopper','CreateCmHopper','create','body','update','limit','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb10b,0x12a));var _0xbb10=function(_0x24fe48,_0x10e97e){_0x24fe48=_0x24fe48-0x0;var _0x51e7d5=_0xb10b[_0x24fe48];return _0x51e7d5;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'limit':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['limit']||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x407cb4){return{'model':db[_0x407cb4[_0xbb10('0x1e')]],'as':_0x407cb4['as'],'attributes':_0x407cb4[_0xbb10('0x1b')],'include':_0x407cb4[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x407cb4[_0xbb10('0x1c')],function(_0x537898){return{'model':db[_0x537898['model']],'as':_0x537898['as'],'attributes':_0x537898['attributes'],'include':_0x537898[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x537898[_0xbb10('0x1c')],function(_0x4e25ff){return{'model':db[_0x4e25ff[_0xbb10('0x1e')]],'as':_0x4e25ff['as'],'attributes':_0x4e25ff[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x1d5e95){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')]('GetCmHopper',_0x378da8,JSON[_0xbb10('0x11')](_0x1d5e95));_0x575cca(_0x1d5e95);})[_0xbb10('0x20')](function(_0xfc3595){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0xfc3595[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0xfc3595[_0xbb10('0x13')]));});});};exports['ShowCmHopper']=function(_0x448d5c){var _0x56f2da=this;return new Promise(function(_0x16ad2a,_0x1dcc9c){return db[_0xbb10('0x16')]['find']({'raw':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x448d5c['options']?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'include':_0x448d5c[_0xbb10('0x18')]?_0x448d5c[_0xbb10('0x18')]['include']?_[_0xbb10('0x1d')](_0x448d5c[_0xbb10('0x18')][_0xbb10('0x1c')],function(_0x8c1ce6){return{'model':db[_0x8c1ce6[_0xbb10('0x1e')]],'as':_0x8c1ce6['as'],'attributes':_0x8c1ce6[_0xbb10('0x1b')],'include':_0x8c1ce6[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x8c1ce6[_0xbb10('0x1c')],function(_0x56943c){return{'model':db[_0x56943c[_0xbb10('0x1e')]],'as':_0x56943c['as'],'attributes':_0x56943c[_0xbb10('0x1b')],'include':_0x56943c[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x56943c['include'],function(_0x111762){return{'model':db[_0x111762['model']],'as':_0x111762['as'],'attributes':_0x111762['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x40c164){logger[_0xbb10('0xd')](_0xbb10('0x21'),_0x448d5c);logger[_0xbb10('0x1f')](_0xbb10('0x21'),_0x448d5c,JSON['stringify'](_0x40c164));_0x16ad2a(_0x40c164);})[_0xbb10('0x20')](function(_0x25d72f){logger['error']('ShowCmHopper',_0x25d72f['message'],_0x448d5c);_0x1dcc9c(_0x56f2da[_0xbb10('0x12')](0x1f4,_0x25d72f[_0xbb10('0x13')]));});});};exports[_0xbb10('0x22')]=function(_0x4d5a9b){var _0x3c0cd7=this;return new Promise(function(_0x3e8538,_0x4345f3){return db['CmHopper'][_0xbb10('0x23')](_0x4d5a9b[_0xbb10('0x24')],{'raw':_0x4d5a9b[_0xbb10('0x18')]?_0x4d5a9b[_0xbb10('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0x110eb5){logger['info'](_0xbb10('0x22'),_0x4d5a9b);logger[_0xbb10('0x1f')](_0xbb10('0x22'),_0x4d5a9b,JSON[_0xbb10('0x11')](_0x110eb5));_0x3e8538(_0x110eb5);})[_0xbb10('0x20')](function(_0x185a52){logger['error'](_0xbb10('0x22'),_0x185a52[_0xbb10('0x13')],_0x4d5a9b);_0x4345f3(_0x3c0cd7[_0xbb10('0x12')](0x1f4,_0x185a52[_0xbb10('0x13')]));});});};exports['UpdateCmHopper']=function(_0x3fff6c){var _0x331751=this;return new Promise(function(_0x23dc18,_0x403beb){return db['CmHopper'][_0xbb10('0x25')](_0x3fff6c[_0xbb10('0x24')],{'raw':_0x3fff6c['options']?_0x3fff6c['options'][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fff6c['options']?_0x3fff6c[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x3fff6c['options']?_0x3fff6c[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x3fff6c[_0xbb10('0x18')]?_0x3fff6c['options'][_0xbb10('0x26')]||null:null})[_0xbb10('0xc')](function(_0x3b9fdf){logger[_0xbb10('0xd')](_0xbb10('0x27'),_0x3fff6c);logger[_0xbb10('0x1f')](_0xbb10('0x27'),_0x3fff6c,JSON[_0xbb10('0x11')](_0x3b9fdf));_0x23dc18(_0x3b9fdf);})[_0xbb10('0x20')](function(_0x43b948){logger[_0xbb10('0x12')](_0xbb10('0x27'),_0x43b948['message'],_0x3fff6c);_0x403beb(_0x331751[_0xbb10('0x12')](0x1f4,_0x43b948[_0xbb10('0x13')]));});});};exports['DestroyCmHopper']=function(_0x14e1cb){var _0x2f5027=this;return new Promise(function(_0x1a7df6,_0x5a5226){return db[_0xbb10('0x16')][_0xbb10('0x28')]({'where':_0x14e1cb[_0xbb10('0x18')]?_0x14e1cb['options']['where']||null:null})[_0xbb10('0xc')](function(_0x76a208){logger[_0xbb10('0xd')]('DestroyCmHopper',_0x14e1cb);logger['debug'](_0xbb10('0x29'),_0x14e1cb,JSON[_0xbb10('0x11')](_0x76a208));_0x1a7df6(_0x76a208);})[_0xbb10('0x20')](function(_0xf820fe){logger[_0xbb10('0x12')](_0xbb10('0x29'),_0xf820fe[_0xbb10('0x13')],_0x14e1cb);_0x5a5226(_0x2f5027[_0xbb10('0x12')](0x1f4,_0xf820fe[_0xbb10('0x13')]));});});};exports[_0xbb10('0x2a')]=function(_0x550111){var _0x5eafac=this;return new Promise(function(_0x412e13,_0x467dba){return db[_0xbb10('0x2b')][_0xbb10('0x2c')]()[_0xbb10('0xc')](function(_0x440f9e){return db[_0xbb10('0x2d')][_0xbb10('0x2e')](function(_0x1c0d8f){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'where':_0x550111[_0xbb10('0x18')]?_0x550111[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x550111[_0xbb10('0x18')]?_0x550111['options'][_0xbb10('0x1b')]||null:null,'limit':_0x550111['options']?_0x550111[_0xbb10('0x18')][_0xbb10('0x26')]||null:null,'order':_0x550111[_0xbb10('0x18')]?_0x550111[_0xbb10('0x18')][_0xbb10('0x2f')]||null:null,'transaction':_0x1c0d8f,'lock':_0x1c0d8f[_0xbb10('0x30')][_0xbb10('0x31')],'include':[{'model':db[_0xbb10('0x2b')],'as':_0xbb10('0x32'),'attributes':_[_0xbb10('0x33')](_0x440f9e)},{'model':db[_0xbb10('0x34')],'as':_0xbb10('0x35'),'attributes':['id',_0xbb10('0x36'),_0xbb10('0x37')]}]})[_0xbb10('0xc')](function(_0x5de0cc){var _0x4571b6=[];for(var _0x466eb7=0x0;_0x466eb7<_0x5de0cc[_0xbb10('0x38')];_0x466eb7+=0x1){_0x4571b6[_0xbb10('0x39')](_0x5de0cc[_0x466eb7][_0xbb10('0x25')](_0x550111[_0xbb10('0x24')],{'transaction':_0x1c0d8f}));}return BPromise['all'](_0x4571b6);});})[_0xbb10('0xc')](function(_0x4731ce){logger[_0xbb10('0xd')](_0xbb10('0x2a'),_0x550111);logger[_0xbb10('0x1f')](_0xbb10('0x2a'),_0x550111,JSON[_0xbb10('0x11')](_0x4731ce));_0x412e13(_0x4731ce);})[_0xbb10('0x20')](function(_0x205e01){logger[_0xbb10('0x12')](_0xbb10('0x2a'),_0x205e01[_0xbb10('0x13')],_0x550111);_0x467dba(_0x5eafac[_0xbb10('0x12')](0x1f4,_0x205e01['message']));});});});};exports['MoveContactManagedDialer']=function(_0x16272d){var _0x3e6338=this;return new Promise(function(_0x3d0cb7,_0x8b0a7d){return db['sequelize']['transaction'](function(_0x79411e){return db[_0xbb10('0x3a')][_0xbb10('0x23')](_0x16272d[_0xbb10('0x24')],{'raw':_0x16272d[_0xbb10('0x18')]?_0x16272d[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'transaction':_0x79411e})['then'](function(){return db[_0xbb10('0x16')][_0xbb10('0x28')]({'where':_0x16272d['options']?_0x16272d['options']['where']||null:null,'transaction':_0x79411e});});})[_0xbb10('0xc')](function(_0x31c727){logger[_0xbb10('0xd')]('MoveContactManagedDialer',_0x16272d);logger['debug']('MoveContactManagedDialer',_0x16272d,JSON[_0xbb10('0x11')](_0x31c727));_0x3d0cb7(_0x31c727);})[_0xbb10('0x20')](function(_0x45167a){logger['error'](_0xbb10('0x3b'),_0x45167a[_0xbb10('0x13')],_0x16272d);_0x8b0a7d(_0x3e6338['error'](0x1f4,_0x45167a['message']));});});};exports[_0xbb10('0x3c')]=function(_0x308896){var _0xd77753=this;return new Promise(function(_0x237246,_0x54b7c5){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x308896[_0xbb10('0x18')]?_0x308896['options'][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x308896[_0xbb10('0x18')]?_0x308896[_0xbb10('0x18')]['where']||null:null,'attributes':[[db[_0xbb10('0x2d')]['fn'](_0xbb10('0x3d'),db[_0xbb10('0x2d')]['fn']('IF',db[_0xbb10('0x2d')]['literal'](_0xbb10('0x3e')+util[_0xbb10('0x3f')](_0xbb10('0x40'),moment()[_0xbb10('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xbb10('0x41')))),_0xbb10('0x42')]]})[_0xbb10('0xc')](function(_0x2ceb3e){logger[_0xbb10('0xd')](_0xbb10('0x3c'),_0x308896);logger[_0xbb10('0x1f')]('CountReScheduled',_0x308896,JSON['stringify'](_0x2ceb3e));_0x237246(_0x2ceb3e);})['catch'](function(_0xdfbc0b){logger[_0xbb10('0x12')](_0xbb10('0x3c'),_0xdfbc0b['message'],_0x308896);_0x54b7c5(_0xd77753['error'](0x1f4,_0xdfbc0b[_0xbb10('0x13')]));});});};exports[_0xbb10('0x43')]=function(_0xd9e743){var _0x3a9677=this;return new Promise(function(_0x260e06,_0x1ad2ed){return db['CmContact'][_0xbb10('0x2c')]()[_0xbb10('0xc')](function(_0x270fdb){return db[_0xbb10('0x2d')][_0xbb10('0x2e')](function(_0x5bfc68){return db['CmHopper']['findAll']({'where':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':0x1,'order':_0xd9e743['options']?_0xd9e743[_0xbb10('0x18')]['order']||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x5bfc68,'lock':_0x5bfc68[_0xbb10('0x30')][_0xbb10('0x31')],'include':_0xd9e743[_0xbb10('0x18')]?_0xd9e743[_0xbb10('0x18')]['include']?_[_0xbb10('0x1d')](_0xd9e743['options']['include'],function(_0x165fe9){return{'model':db[_0x165fe9[_0xbb10('0x1e')]],'as':_0x165fe9['as'],'attributes':_0x165fe9[_0xbb10('0x1b')],'include':_0x165fe9[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x165fe9['include'],function(_0x2d52ea){return{'model':db[_0x2d52ea[_0xbb10('0x1e')]],'as':_0x2d52ea['as'],'attributes':_0x2d52ea[_0xbb10('0x1b')],'include':_0x2d52ea[_0xbb10('0x1c')]?_[_0xbb10('0x1d')](_0x2d52ea[_0xbb10('0x1c')],function(_0x174395){return{'model':db[_0x174395['model']],'as':_0x174395['as'],'attributes':_0x174395[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0xc')](function(_0x30f3ea){var _0x322b41=[];for(var _0x37b20e=0x0;_0x37b20e<_0x30f3ea[_0xbb10('0x38')];_0x37b20e+=0x1){_0x322b41[_0xbb10('0x39')](_0x30f3ea[_0x37b20e][_0xbb10('0x25')](_0xd9e743['body'],{'transaction':_0x5bfc68}));}return BPromise[_0xbb10('0x44')](_0x322b41);});})[_0xbb10('0xc')](function(_0x145baf){logger['info']('GetContactRecallMe',_0xd9e743);logger['debug'](_0xbb10('0x43'),_0xd9e743,JSON['stringify'](_0x145baf));_0x260e06(_0x145baf);})['catch'](function(_0x1701c5){logger[_0xbb10('0x12')](_0xbb10('0x43'),_0x1701c5[_0xbb10('0x13')],_0xd9e743);_0x1ad2ed(_0x3a9677[_0xbb10('0x12')](0x1f4,_0x1701c5[_0xbb10('0x13')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index a7ae5f1..571c9d2 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 _0x5840=['getPreview','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','show','post','create','/preview'];(function(_0x2cc594,_0x4d727b){var _0x4abff7=function(_0x22b01d){while(--_0x22b01d){_0x2cc594['push'](_0x2cc594['shift']());}};_0x4abff7(++_0x4d727b);}(_0x5840,0x186));var _0x0584=function(_0x4d01aa,_0x42cd2d){_0x4d01aa=_0x4d01aa-0x0;var _0x554411=_0x5840[_0x4d01aa];return _0x554411;};'use strict';var multer=require(_0x0584('0x0'));var util=require(_0x0584('0x1'));var path=require(_0x0584('0x2'));var timeout=require(_0x0584('0x3'));var express=require('express');var router=express[_0x0584('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0584('0x5'));var config=require(_0x0584('0x6'));var controller=require(_0x0584('0x7'));router[_0x0584('0x8')]('/',auth[_0x0584('0x9')](),controller[_0x0584('0xa')]);router[_0x0584('0x8')](_0x0584('0xb'),auth[_0x0584('0x9')](),controller[_0x0584('0xc')]);router[_0x0584('0x8')](_0x0584('0xd'),auth[_0x0584('0x9')](),controller['getOpenContacts']);router[_0x0584('0x8')]('/:id',auth[_0x0584('0x9')](),controller[_0x0584('0xe')]);router[_0x0584('0xf')]('/',auth['isAuthenticated'](),controller[_0x0584('0x10')]);router[_0x0584('0xf')](_0x0584('0x11'),auth['isAuthenticated'](),controller[_0x0584('0x12')]);router[_0x0584('0x13')](_0x0584('0x14'),auth['isAuthenticated'](),controller['update']);router[_0x0584('0x15')](_0x0584('0x14'),auth['isAuthenticated'](),controller[_0x0584('0x16')]);module[_0x0584('0x17')]=router; \ No newline at end of file +var _0xf703=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/:id','show','create','post','/preview','put','update','destroy','exports','multer','util'];(function(_0x337f03,_0x41c14c){var _0x26f590=function(_0x4d3770){while(--_0x4d3770){_0x337f03['push'](_0x337f03['shift']());}};_0x26f590(++_0x41c14c);}(_0xf703,0x136));var _0x3f70=function(_0x42b863,_0x524885){_0x42b863=_0x42b863-0x0;var _0x4faeca=_0xf703[_0x42b863];return _0x4faeca;};'use strict';var multer=require(_0x3f70('0x0'));var util=require(_0x3f70('0x1'));var path=require(_0x3f70('0x2'));var timeout=require(_0x3f70('0x3'));var express=require(_0x3f70('0x4'));var router=express[_0x3f70('0x5')]();var auth=require(_0x3f70('0x6'));var interaction=require(_0x3f70('0x7'));var config=require(_0x3f70('0x8'));var controller=require(_0x3f70('0x9'));router[_0x3f70('0xa')]('/',auth[_0x3f70('0xb')](),controller[_0x3f70('0xc')]);router['get'](_0x3f70('0xd'),auth[_0x3f70('0xb')](),controller[_0x3f70('0xe')]);router['get'](_0x3f70('0xf'),auth[_0x3f70('0xb')](),controller[_0x3f70('0x10')]);router[_0x3f70('0xa')](_0x3f70('0x11'),auth[_0x3f70('0xb')](),controller[_0x3f70('0x12')]);router['post']('/',auth[_0x3f70('0xb')](),controller[_0x3f70('0x13')]);router[_0x3f70('0x14')](_0x3f70('0x15'),auth[_0x3f70('0xb')](),controller['getPreview']);router[_0x3f70('0x16')](_0x3f70('0x11'),auth[_0x3f70('0xb')](),controller[_0x3f70('0x17')]);router['delete']('/:id',auth[_0x3f70('0xb')](),controller[_0x3f70('0x18')]);module[_0x3f70('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index f77abe9..0d8928b 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 _0x5dbe=['sequelize','exports','INTEGER','moment'];(function(_0x54469d,_0xb9ad06){var _0x5240fa=function(_0x3f244a){while(--_0x3f244a){_0x54469d['push'](_0x54469d['shift']());}};_0x5240fa(++_0xb9ad06);}(_0x5dbe,0x19b));var _0xe5db=function(_0x17ff84,_0x513e44){_0x17ff84=_0x17ff84-0x0;var _0x4d6138=_0x5dbe[_0x17ff84];return _0x4d6138;};'use strict';var moment=require(_0xe5db('0x0'));var Sequelize=require(_0xe5db('0x1'));module[_0xe5db('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xe5db('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xe5db('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x0d8a=['moment','sequelize','exports','STRING','contactListQueue','INTEGER'];(function(_0x35332e,_0x59f00c){var _0x5a3eb7=function(_0x5c1a23){while(--_0x5c1a23){_0x35332e['push'](_0x35332e['shift']());}};_0x5a3eb7(++_0x59f00c);}(_0x0d8a,0x162));var _0xa0d8=function(_0x2678ef,_0x4ff894){_0x2678ef=_0x2678ef-0x0;var _0x364a0b=_0x0d8a[_0x2678ef];return _0x364a0b;};'use strict';var moment=require(_0xa0d8('0x0'));var Sequelize=require(_0xa0d8('0x1'));module[_0xa0d8('0x2')]={'phone':{'type':Sequelize[_0xa0d8('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xa0d8('0x4')},'ListId':{'type':Sequelize[_0xa0d8('0x5')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 3153950..feed2bc 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 _0xb511=['include','rows','catch','show','params','includeAll','options','find','update','body','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','json','reject','then','stack','name','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','CmHopperBlack'];(function(_0x39bfb6,_0x4272c8){var _0x23fef9=function(_0x5f83c1){while(--_0x5f83c1){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x23fef9(++_0x4272c8);}(_0xb511,0x165));var _0x1b51=function(_0x4b4c5c,_0x3cdd80){_0x4b4c5c=_0x4b4c5c-0x0;var _0x3709b3=_0xb511[_0x4b4c5c];return _0x3709b3;};'use strict';var pdf=require(_0x1b51('0x0'));var emlformat=require(_0x1b51('0x1'));var rimraf=require(_0x1b51('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1b51('0x3'));var rp=require(_0x1b51('0x4'));var moment=require('moment');var BPromise=require(_0x1b51('0x5'));var Mustache=require(_0x1b51('0x6'));var util=require(_0x1b51('0x7'));var path=require('path');var sox=require(_0x1b51('0x8'));var csv=require(_0x1b51('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1b51('0xa'));var squel=require(_0x1b51('0xb'));var crypto=require('crypto');var jsforce=require(_0x1b51('0xc'));var deskjs=require(_0x1b51('0xd'));var toCsv=require(_0x1b51('0x9'));var querystring=require(_0x1b51('0xe'));var Papa=require(_0x1b51('0xf'));var Redis=require(_0x1b51('0x10'));var authService=require(_0x1b51('0x11'));var qs=require(_0x1b51('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b51('0x13'));var logger=require(_0x1b51('0x14'))(_0x1b51('0x15'));var utils=require(_0x1b51('0x16'));var config=require(_0x1b51('0x17'));var db=require(_0x1b51('0x18'))['db'];function respondWithStatusCode(_0x4bf4eb,_0xfa36a5){_0xfa36a5=_0xfa36a5||0xcc;return function(_0x11e29e){if(_0x11e29e){return _0x4bf4eb[_0x1b51('0x19')](_0xfa36a5);}return _0x4bf4eb[_0x1b51('0x1a')](_0xfa36a5)[_0x1b51('0x1b')]();};}function respondWithResult(_0x46c991,_0x159c9a){_0x159c9a=_0x159c9a||0xc8;return function(_0x58a1db){if(_0x58a1db){return _0x46c991[_0x1b51('0x1a')](_0x159c9a)['json'](_0x58a1db);}};}function respondWithFilteredResult(_0x5db91e,_0x46b28f){return function(_0x3c427a){if(_0x3c427a){var _0x4bfe72=_0x3c427a['count'],_0x231475=_0x46b28f[_0x1b51('0x1c')],_0x3ece8d=_0x46b28f[_0x1b51('0x1c')]+_0x46b28f[_0x1b51('0x1d')],_0x3f3850;if(_0x3ece8d>=_0x4bfe72){_0x3ece8d=_0x4bfe72;_0x3f3850=0xc8;}else{_0x3f3850=0xce;}_0x5db91e[_0x1b51('0x1a')](_0x3f3850);return _0x5db91e['set'](_0x1b51('0x1e'),_0x231475+'-'+_0x3ece8d+'/'+_0x4bfe72)[_0x1b51('0x1f')](_0x3c427a);}return null;};}function patchUpdates(_0x153c33){return function(_0x556762){try{jsonpatch['apply'](_0x556762,_0x153c33,!![]);}catch(_0x1d67f3){return BPromise[_0x1b51('0x20')](_0x1d67f3);}return _0x556762['save']();};}function saveUpdates(_0x2c9e54,_0x695f55){return function(_0x527647){if(_0x527647){return _0x527647['update'](_0x2c9e54)[_0x1b51('0x21')](function(_0xb4ddf6){return _0xb4ddf6;});}return null;};}function removeEntity(_0x15e196,_0x17381b){return function(_0x5628cf){if(_0x5628cf){return _0x5628cf['destroy']()[_0x1b51('0x21')](function(){_0x15e196[_0x1b51('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cfab4,_0x4ba07e){return function(_0x4a2e45){if(!_0x4a2e45){_0x2cfab4[_0x1b51('0x19')](0x194);}return _0x4a2e45;};}function handleError(_0x4b43c8,_0x1eac36){_0x1eac36=_0x1eac36||0x1f4;return function(_0x2a720f){logger['error'](_0x2a720f[_0x1b51('0x22')]);if(_0x2a720f[_0x1b51('0x23')]){delete _0x2a720f[_0x1b51('0x23')];}_0x4b43c8[_0x1b51('0x1a')](_0x1eac36)['send'](_0x2a720f);};}exports['index']=function(_0x3544ad,_0x1a6c68){var _0x9f3268={},_0x46797d={},_0x25cb80={'count':0x0,'rows':[]};var _0x23cfcd=_[_0x1b51('0x24')](db['CmHopperBlack'][_0x1b51('0x25')],function(_0x1108ba){return{'name':_0x1108ba[_0x1b51('0x26')],'type':_0x1108ba['type'][_0x1b51('0x27')]};});_0x46797d[_0x1b51('0x28')]=_[_0x1b51('0x24')](_0x23cfcd,_0x1b51('0x23'));_0x46797d[_0x1b51('0x29')]=_[_0x1b51('0x2a')](_0x3544ad[_0x1b51('0x29')]);_0x46797d['filters']=_[_0x1b51('0x2b')](_0x46797d[_0x1b51('0x28')],_0x46797d[_0x1b51('0x29')]);_0x9f3268[_0x1b51('0x2c')]=_[_0x1b51('0x2b')](_0x46797d[_0x1b51('0x28')],qs[_0x1b51('0x2d')](_0x3544ad[_0x1b51('0x29')][_0x1b51('0x2d')]));_0x9f3268['attributes']=_0x9f3268[_0x1b51('0x2c')][_0x1b51('0x2e')]?_0x9f3268['attributes']:_0x46797d[_0x1b51('0x28')];if(!_0x3544ad['query'][_0x1b51('0x2f')](_0x1b51('0x30'))){_0x9f3268[_0x1b51('0x1d')]=qs[_0x1b51('0x1d')](_0x3544ad['query'][_0x1b51('0x1d')]);_0x9f3268[_0x1b51('0x1c')]=qs[_0x1b51('0x1c')](_0x3544ad[_0x1b51('0x29')]['offset']);}_0x9f3268['order']=qs[_0x1b51('0x31')](_0x3544ad[_0x1b51('0x29')][_0x1b51('0x31')]);_0x9f3268[_0x1b51('0x32')]=qs[_0x1b51('0x33')](_['pick'](_0x3544ad[_0x1b51('0x29')],_0x46797d[_0x1b51('0x33')]));if(_0x3544ad[_0x1b51('0x29')][_0x1b51('0x34')]){_0x9f3268[_0x1b51('0x32')]=_[_0x1b51('0x35')](_0x9f3268['where'],{'$or':_[_0x1b51('0x24')](_0x23cfcd,function(_0x2137e5){if(_0x2137e5[_0x1b51('0x36')]!==_0x1b51('0x37')){var _0x5a936a={};_0x5a936a[_0x2137e5[_0x1b51('0x23')]]={'$like':'%'+_0x3544ad[_0x1b51('0x29')][_0x1b51('0x34')]+'%'};return _0x5a936a;}})});}_0x9f3268=_[_0x1b51('0x35')]({},_0x9f3268,_0x3544ad['options']);var _0x2861c3={'where':_0x9f3268[_0x1b51('0x32')]};return db[_0x1b51('0x38')]['count'](_0x2861c3)['then'](function(_0x12bdce){_0x25cb80['count']=_0x12bdce;if(_0x3544ad[_0x1b51('0x29')]['includeAll']){_0x9f3268[_0x1b51('0x39')]=[{'all':!![]}];}return db[_0x1b51('0x38')]['findAll'](_0x9f3268);})[_0x1b51('0x21')](function(_0x5d32d0){_0x25cb80[_0x1b51('0x3a')]=_0x5d32d0;return _0x25cb80;})[_0x1b51('0x21')](respondWithFilteredResult(_0x1a6c68,_0x9f3268))[_0x1b51('0x3b')](handleError(_0x1a6c68,null));};exports[_0x1b51('0x3c')]=function(_0x12a00f,_0x14328f){var _0x488c1b={'raw':!![],'where':{'id':_0x12a00f[_0x1b51('0x3d')]['id']}},_0xab381f={};_0xab381f[_0x1b51('0x28')]=_[_0x1b51('0x2a')](db[_0x1b51('0x38')][_0x1b51('0x25')]);_0xab381f['query']=_[_0x1b51('0x2a')](_0x12a00f[_0x1b51('0x29')]);_0xab381f[_0x1b51('0x33')]=_[_0x1b51('0x2b')](_0xab381f[_0x1b51('0x28')],_0xab381f[_0x1b51('0x29')]);_0x488c1b['attributes']=_[_0x1b51('0x2b')](_0xab381f[_0x1b51('0x28')],qs['fields'](_0x12a00f[_0x1b51('0x29')][_0x1b51('0x2d')]));_0x488c1b[_0x1b51('0x2c')]=_0x488c1b[_0x1b51('0x2c')][_0x1b51('0x2e')]?_0x488c1b[_0x1b51('0x2c')]:_0xab381f[_0x1b51('0x28')];if(_0x12a00f[_0x1b51('0x29')][_0x1b51('0x3e')]){_0x488c1b[_0x1b51('0x39')]=[{'all':!![]}];}_0x488c1b=_[_0x1b51('0x35')]({},_0x488c1b,_0x12a00f[_0x1b51('0x3f')]);return db[_0x1b51('0x38')][_0x1b51('0x40')](_0x488c1b)['then'](handleEntityNotFound(_0x14328f,null))[_0x1b51('0x21')](respondWithResult(_0x14328f,null))[_0x1b51('0x3b')](handleError(_0x14328f,null));};exports[_0x1b51('0x41')]=function(_0x1bf9ba,_0x1a15b3){if(_0x1bf9ba[_0x1b51('0x42')]['id']){delete _0x1bf9ba['body']['id'];}return db[_0x1b51('0x38')][_0x1b51('0x40')]({'where':{'id':_0x1bf9ba[_0x1b51('0x3d')]['id']}})[_0x1b51('0x21')](handleEntityNotFound(_0x1a15b3,null))[_0x1b51('0x21')](saveUpdates(_0x1bf9ba[_0x1b51('0x42')],null))['then'](respondWithResult(_0x1a15b3,null))[_0x1b51('0x3b')](handleError(_0x1a15b3,null));};exports[_0x1b51('0x43')]=function(_0xe39db8,_0x595cbc){return db[_0x1b51('0x38')][_0x1b51('0x40')]({'where':{'id':_0xe39db8[_0x1b51('0x3d')]['id']}})[_0x1b51('0x21')](handleEntityNotFound(_0x595cbc,null))[_0x1b51('0x21')](removeEntity(_0x595cbc,null))[_0x1b51('0x3b')](handleError(_0x595cbc,null));};exports[_0x1b51('0x44')]=function(_0x2d5a57,_0x53341c){return db['CmHopperBlack']['describe']()[_0x1b51('0x21')](respondWithResult(_0x53341c,null))[_0x1b51('0x3b')](handleError(_0x53341c,null));}; \ No newline at end of file +var _0x6302=['fast-json-patch','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','map','CmHopperBlack','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','where','merge','VIRTUAL','filter','options','rows','catch','show','params','rawAttributes','keys','includeAll','include','find','body','eml-format','rimraf','zip-dir'];(function(_0x266965,_0x2c257e){var _0x232cf7=function(_0xffd080){while(--_0xffd080){_0x266965['push'](_0x266965['shift']());}};_0x232cf7(++_0x2c257e);}(_0x6302,0x109));var _0x2630=function(_0x23910e,_0x3eb0ab){_0x23910e=_0x23910e-0x0;var _0x31675b=_0x6302[_0x23910e];return _0x31675b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2630('0x0'));var rimraf=require(_0x2630('0x1'));var zipdir=require(_0x2630('0x2'));var jsonpatch=require(_0x2630('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2630('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2630('0x5'));var sox=require(_0x2630('0x6'));var csv=require(_0x2630('0x7'));var ejs=require(_0x2630('0x8'));var fs=require('fs');var _=require(_0x2630('0x9'));var squel=require(_0x2630('0xa'));var crypto=require(_0x2630('0xb'));var jsforce=require(_0x2630('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2630('0xd'));var Papa=require(_0x2630('0xe'));var Redis=require('ioredis');var authService=require(_0x2630('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2630('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2630('0x11'))(_0x2630('0x12'));var utils=require(_0x2630('0x13'));var config=require(_0x2630('0x14'));var db=require(_0x2630('0x15'))['db'];function respondWithStatusCode(_0x1ed3a2,_0x50b8e5){_0x50b8e5=_0x50b8e5||0xcc;return function(_0x4424c1){if(_0x4424c1){return _0x1ed3a2[_0x2630('0x16')](_0x50b8e5);}return _0x1ed3a2[_0x2630('0x17')](_0x50b8e5)[_0x2630('0x18')]();};}function respondWithResult(_0x4866f2,_0x33f40d){_0x33f40d=_0x33f40d||0xc8;return function(_0x467d72){if(_0x467d72){return _0x4866f2[_0x2630('0x17')](_0x33f40d)['json'](_0x467d72);}};}function respondWithFilteredResult(_0x15ada2,_0x53b1d2){return function(_0x1e4731){if(_0x1e4731){var _0x37c8d7=_0x1e4731[_0x2630('0x19')],_0x3b1b78=_0x53b1d2[_0x2630('0x1a')],_0x249507=_0x53b1d2[_0x2630('0x1a')]+_0x53b1d2['limit'],_0x157d35;if(_0x249507>=_0x37c8d7){_0x249507=_0x37c8d7;_0x157d35=0xc8;}else{_0x157d35=0xce;}_0x15ada2[_0x2630('0x17')](_0x157d35);return _0x15ada2['set']('Content-Range',_0x3b1b78+'-'+_0x249507+'/'+_0x37c8d7)['json'](_0x1e4731);}return null;};}function patchUpdates(_0x17d98b){return function(_0xa4f917){try{jsonpatch[_0x2630('0x1b')](_0xa4f917,_0x17d98b,!![]);}catch(_0x7c443c){return BPromise[_0x2630('0x1c')](_0x7c443c);}return _0xa4f917[_0x2630('0x1d')]();};}function saveUpdates(_0x4364a0,_0x608d15){return function(_0x13b5d5){if(_0x13b5d5){return _0x13b5d5[_0x2630('0x1e')](_0x4364a0)[_0x2630('0x1f')](function(_0x285f17){return _0x285f17;});}return null;};}function removeEntity(_0x5de075,_0x47a037){return function(_0x2c4a50){if(_0x2c4a50){return _0x2c4a50[_0x2630('0x20')]()['then'](function(){_0x5de075[_0x2630('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x452a9c,_0x3d303a){return function(_0xafc7c6){if(!_0xafc7c6){_0x452a9c[_0x2630('0x16')](0x194);}return _0xafc7c6;};}function handleError(_0x57f7e6,_0x3a9e7f){_0x3a9e7f=_0x3a9e7f||0x1f4;return function(_0x3d53c6){logger[_0x2630('0x21')](_0x3d53c6[_0x2630('0x22')]);if(_0x3d53c6[_0x2630('0x23')]){delete _0x3d53c6[_0x2630('0x23')];}_0x57f7e6[_0x2630('0x17')](_0x3a9e7f)[_0x2630('0x24')](_0x3d53c6);};}exports['index']=function(_0x5497d9,_0x1e57d6){var _0x3c654c={},_0x41c2c3={},_0x4afd2f={'count':0x0,'rows':[]};var _0x10d4ce=_[_0x2630('0x25')](db[_0x2630('0x26')]['rawAttributes'],function(_0x3ad356){return{'name':_0x3ad356['fieldName'],'type':_0x3ad356[_0x2630('0x27')]['key']};});_0x41c2c3[_0x2630('0x28')]=_[_0x2630('0x25')](_0x10d4ce,'name');_0x41c2c3[_0x2630('0x29')]=_['keys'](_0x5497d9['query']);_0x41c2c3[_0x2630('0x2a')]=_[_0x2630('0x2b')](_0x41c2c3['model'],_0x41c2c3[_0x2630('0x29')]);_0x3c654c[_0x2630('0x2c')]=_[_0x2630('0x2b')](_0x41c2c3[_0x2630('0x28')],qs[_0x2630('0x2d')](_0x5497d9[_0x2630('0x29')][_0x2630('0x2d')]));_0x3c654c['attributes']=_0x3c654c[_0x2630('0x2c')][_0x2630('0x2e')]?_0x3c654c['attributes']:_0x41c2c3[_0x2630('0x28')];if(!_0x5497d9['query'][_0x2630('0x2f')]('nolimit')){_0x3c654c['limit']=qs[_0x2630('0x30')](_0x5497d9[_0x2630('0x29')][_0x2630('0x30')]);_0x3c654c['offset']=qs[_0x2630('0x1a')](_0x5497d9[_0x2630('0x29')]['offset']);}_0x3c654c[_0x2630('0x31')]=qs[_0x2630('0x32')](_0x5497d9['query'][_0x2630('0x32')]);_0x3c654c['where']=qs[_0x2630('0x2a')](_[_0x2630('0x33')](_0x5497d9['query'],_0x41c2c3[_0x2630('0x2a')]));if(_0x5497d9[_0x2630('0x29')]['filter']){_0x3c654c[_0x2630('0x34')]=_[_0x2630('0x35')](_0x3c654c[_0x2630('0x34')],{'$or':_[_0x2630('0x25')](_0x10d4ce,function(_0x1cb15d){if(_0x1cb15d[_0x2630('0x27')]!==_0x2630('0x36')){var _0x3b856b={};_0x3b856b[_0x1cb15d[_0x2630('0x23')]]={'$like':'%'+_0x5497d9['query'][_0x2630('0x37')]+'%'};return _0x3b856b;}})});}_0x3c654c=_['merge']({},_0x3c654c,_0x5497d9[_0x2630('0x38')]);var _0x3d7106={'where':_0x3c654c[_0x2630('0x34')]};return db[_0x2630('0x26')][_0x2630('0x19')](_0x3d7106)[_0x2630('0x1f')](function(_0x53d2bb){_0x4afd2f[_0x2630('0x19')]=_0x53d2bb;if(_0x5497d9[_0x2630('0x29')]['includeAll']){_0x3c654c['include']=[{'all':!![]}];}return db[_0x2630('0x26')]['findAll'](_0x3c654c);})[_0x2630('0x1f')](function(_0x15c0a0){_0x4afd2f[_0x2630('0x39')]=_0x15c0a0;return _0x4afd2f;})['then'](respondWithFilteredResult(_0x1e57d6,_0x3c654c))[_0x2630('0x3a')](handleError(_0x1e57d6,null));};exports[_0x2630('0x3b')]=function(_0x49197c,_0x512a6a){var _0x181fec={'raw':!![],'where':{'id':_0x49197c[_0x2630('0x3c')]['id']}},_0x27db44={};_0x27db44[_0x2630('0x28')]=_['keys'](db[_0x2630('0x26')][_0x2630('0x3d')]);_0x27db44[_0x2630('0x29')]=_[_0x2630('0x3e')](_0x49197c[_0x2630('0x29')]);_0x27db44[_0x2630('0x2a')]=_[_0x2630('0x2b')](_0x27db44['model'],_0x27db44[_0x2630('0x29')]);_0x181fec[_0x2630('0x2c')]=_[_0x2630('0x2b')](_0x27db44[_0x2630('0x28')],qs[_0x2630('0x2d')](_0x49197c[_0x2630('0x29')][_0x2630('0x2d')]));_0x181fec[_0x2630('0x2c')]=_0x181fec['attributes']['length']?_0x181fec[_0x2630('0x2c')]:_0x27db44[_0x2630('0x28')];if(_0x49197c[_0x2630('0x29')][_0x2630('0x3f')]){_0x181fec[_0x2630('0x40')]=[{'all':!![]}];}_0x181fec=_['merge']({},_0x181fec,_0x49197c[_0x2630('0x38')]);return db['CmHopperBlack'][_0x2630('0x41')](_0x181fec)['then'](handleEntityNotFound(_0x512a6a,null))[_0x2630('0x1f')](respondWithResult(_0x512a6a,null))[_0x2630('0x3a')](handleError(_0x512a6a,null));};exports[_0x2630('0x1e')]=function(_0x325440,_0x489994){if(_0x325440[_0x2630('0x42')]['id']){delete _0x325440[_0x2630('0x42')]['id'];}return db[_0x2630('0x26')]['find']({'where':{'id':_0x325440[_0x2630('0x3c')]['id']}})[_0x2630('0x1f')](handleEntityNotFound(_0x489994,null))[_0x2630('0x1f')](saveUpdates(_0x325440[_0x2630('0x42')],null))['then'](respondWithResult(_0x489994,null))[_0x2630('0x3a')](handleError(_0x489994,null));};exports[_0x2630('0x20')]=function(_0x5c248d,_0x55fd9e){return db[_0x2630('0x26')][_0x2630('0x41')]({'where':{'id':_0x5c248d['params']['id']}})[_0x2630('0x1f')](handleEntityNotFound(_0x55fd9e,null))[_0x2630('0x1f')](removeEntity(_0x55fd9e,null))[_0x2630('0x3a')](handleError(_0x55fd9e,null));};exports['describe']=function(_0x13dc40,_0x643e1d){return db['CmHopperBlack']['describe']()['then'](respondWithResult(_0x643e1d,null))[_0x2630('0x3a')](handleError(_0x643e1d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index d318b86..4c60ecd 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 _0x3244=['exports','cm_hopper_black','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperBlack.attributes'];(function(_0x177022,_0xd62d11){var _0x802050=function(_0x4b00c3){while(--_0x4b00c3){_0x177022['push'](_0x177022['shift']());}};_0x802050(++_0xd62d11);}(_0x3244,0x188));var _0x4324=function(_0x4a4d10,_0x29ab37){_0x4a4d10=_0x4a4d10-0x0;var _0x15f1ef=_0x3244[_0x4a4d10];return _0x15f1ef;};'use strict';var _=require(_0x4324('0x0'));var util=require('util');var logger=require(_0x4324('0x1'))('api');var moment=require(_0x4324('0x2'));var BPromise=require(_0x4324('0x3'));var rp=require(_0x4324('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4324('0x5'));var config=require(_0x4324('0x6'));var attributes=require(_0x4324('0x7'));module[_0x4324('0x8')]=function(_0x429098,_0x538c86){return _0x429098['define']('CmHopperBlack',attributes,{'tableName':_0x4324('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb48=['util','../../config/logger','api','bluebird','request-promise','rimraf','./cmHopperBlack.attributes','exports','define','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb48,0x1f3));var _0x8cb4=function(_0x2e2d13,_0x32e244){_0x2e2d13=_0x2e2d13-0x0;var _0x762ea9=_0xcb48[_0x2e2d13];return _0x762ea9;};'use strict';var _=require(_0x8cb4('0x0'));var util=require(_0x8cb4('0x1'));var logger=require(_0x8cb4('0x2'))(_0x8cb4('0x3'));var moment=require('moment');var BPromise=require(_0x8cb4('0x4'));var rp=require(_0x8cb4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8cb4('0x6'));var config=require('../../config/environment');var attributes=require(_0x8cb4('0x7'));module[_0x8cb4('0x8')]=function(_0x154a63,_0x7e10f5){return _0x154a63[_0x8cb4('0x9')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','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 40566de..6e7199a 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 _0x0888=['../../mysqldb','../../config/utils','rpc','client','http','CmHopperBlack,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','include','model','map','then','debug','body','where','limit','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','ioredis'];(function(_0x2b293b,_0x35d5c0){var _0x334616=function(_0x2fcab2){while(--_0x2fcab2){_0x2b293b['push'](_0x2b293b['shift']());}};_0x334616(++_0x35d5c0);}(_0x0888,0x187));var _0x8088=function(_0x971b3b,_0x3ecac4){_0x971b3b=_0x971b3b-0x0;var _0x20faaa=_0x0888[_0x971b3b];return _0x20faaa;};'use strict';var _=require('lodash');var util=require(_0x8088('0x0'));var moment=require(_0x8088('0x1'));var BPromise=require(_0x8088('0x2'));var rs=require(_0x8088('0x3'));var fs=require('fs');var Redis=require(_0x8088('0x4'));var db=require(_0x8088('0x5'))['db'];var utils=require(_0x8088('0x6'));var logger=require('../../config/logger')(_0x8088('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8088('0x8')][_0x8088('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x547bb8,_0x41b408,_0x177aeb){return new BPromise(function(_0x4755ed,_0x3695ed){return client['request'](_0x547bb8,_0x177aeb)['then'](function(_0xa77dae){logger['info'](_0x8088('0xa'),_0x41b408,_0x8088('0xb'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x41b408,_0x8088('0xb'),JSON[_0x8088('0xc')](_0xa77dae));if(_0xa77dae[_0x8088('0xd')]){if(_0xa77dae[_0x8088('0xd')][_0x8088('0xe')]===0x1f4){logger[_0x8088('0xd')](_0x8088('0xa'),_0x41b408,_0xa77dae[_0x8088('0xd')]['message']);return _0x3695ed(_0xa77dae[_0x8088('0xd')][_0x8088('0xf')]);}logger[_0x8088('0xd')](_0x8088('0xa'),_0x41b408,_0xa77dae[_0x8088('0xd')]['message']);return _0x4755ed(_0xa77dae[_0x8088('0xd')][_0x8088('0xf')]);}else{logger[_0x8088('0x10')](_0x8088('0xa'),_0x41b408,_0x8088('0xb'));_0x4755ed(_0xa77dae[_0x8088('0x11')][_0x8088('0xf')]);}})[_0x8088('0x12')](function(_0x1548e2){logger[_0x8088('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x41b408,_0x1548e2);_0x3695ed(_0x1548e2);});});}exports[_0x8088('0x13')]=function(_0x4816fa){var _0x125db2=this;return new Promise(function(_0xc7fdc9,_0x6aa032){return db[_0x8088('0x14')][_0x8088('0x15')]({'raw':_0x4816fa[_0x8088('0x16')]?_0x4816fa[_0x8088('0x16')][_0x8088('0x17')]===undefined?!![]:![]:!![],'where':_0x4816fa[_0x8088('0x16')]?_0x4816fa[_0x8088('0x16')]['where']||null:null,'attributes':_0x4816fa[_0x8088('0x16')]?_0x4816fa[_0x8088('0x16')][_0x8088('0x18')]||null:null,'limit':_0x4816fa[_0x8088('0x16')]?_0x4816fa[_0x8088('0x16')]['limit']||null:null,'include':_0x4816fa['options']?_0x4816fa['options'][_0x8088('0x19')]?_['map'](_0x4816fa[_0x8088('0x16')][_0x8088('0x19')],function(_0x1ee7d0){return{'model':db[_0x1ee7d0[_0x8088('0x1a')]],'as':_0x1ee7d0['as'],'attributes':_0x1ee7d0[_0x8088('0x18')],'include':_0x1ee7d0[_0x8088('0x19')]?_[_0x8088('0x1b')](_0x1ee7d0[_0x8088('0x19')],function(_0xa15763){return{'model':db[_0xa15763[_0x8088('0x1a')]],'as':_0xa15763['as'],'attributes':_0xa15763[_0x8088('0x18')],'include':_0xa15763[_0x8088('0x19')]?_['map'](_0xa15763['include'],function(_0x1cd5d1){return{'model':db[_0x1cd5d1[_0x8088('0x1a')]],'as':_0x1cd5d1['as'],'attributes':_0x1cd5d1['attributes']};}):[]};}):[]};}):[]:[]})[_0x8088('0x1c')](function(_0x18b345){logger[_0x8088('0x10')](_0x8088('0x13'),_0x4816fa);logger[_0x8088('0x1d')]('GetCmHopperBlack',_0x4816fa,JSON[_0x8088('0xc')](_0x18b345));_0xc7fdc9(_0x18b345);})[_0x8088('0x12')](function(_0x3cce5e){logger[_0x8088('0xd')](_0x8088('0x13'),_0x3cce5e[_0x8088('0xf')],_0x4816fa);_0x6aa032(_0x125db2['error'](0x1f4,_0x3cce5e['message']));});});};exports['UpdateCmHopperBlack']=function(_0x57dd1f){var _0x32eaa6=this;return new Promise(function(_0x186cd6,_0x447565){return db[_0x8088('0x14')]['update'](_0x57dd1f[_0x8088('0x1e')],{'raw':_0x57dd1f[_0x8088('0x16')]?_0x57dd1f['options'][_0x8088('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57dd1f[_0x8088('0x16')]?_0x57dd1f[_0x8088('0x16')][_0x8088('0x1f')]||null:null,'attributes':_0x57dd1f[_0x8088('0x16')]?_0x57dd1f[_0x8088('0x16')]['attributes']||null:null,'limit':_0x57dd1f[_0x8088('0x16')]?_0x57dd1f['options'][_0x8088('0x20')]||null:null})[_0x8088('0x1c')](function(_0x347b50){logger[_0x8088('0x10')](_0x8088('0x21'),_0x57dd1f);logger[_0x8088('0x1d')](_0x8088('0x21'),_0x57dd1f,JSON['stringify'](_0x347b50));_0x186cd6(_0x347b50);})[_0x8088('0x12')](function(_0x5a4a10){logger['error'](_0x8088('0x21'),_0x5a4a10[_0x8088('0xf')],_0x57dd1f);_0x447565(_0x32eaa6[_0x8088('0xd')](0x1f4,_0x5a4a10[_0x8088('0xf')]));});});};exports[_0x8088('0x22')]=function(_0x57fe66){var _0x4e3471=this;return new Promise(function(_0x190895,_0x1e45cb){return db[_0x8088('0x14')][_0x8088('0x23')]({'where':_0x57fe66['options']?_0x57fe66[_0x8088('0x16')][_0x8088('0x1f')]||null:null})[_0x8088('0x1c')](function(_0x3a11c3){logger[_0x8088('0x10')](_0x8088('0x22'),_0x57fe66);logger[_0x8088('0x1d')](_0x8088('0x22'),_0x57fe66,JSON[_0x8088('0xc')](_0x3a11c3));_0x190895(_0x3a11c3);})[_0x8088('0x12')](function(_0x3645c2){logger[_0x8088('0xd')](_0x8088('0x22'),_0x3645c2['message'],_0x57fe66);_0x1e45cb(_0x4e3471[_0x8088('0xd')](0x1f4,_0x3645c2[_0x8088('0xf')]));});});}; \ No newline at end of file +var _0xd446=['map','stringify','update','body','UpdateCmHopperBlack','destroy','DestroyCmHopperBlack','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','model'];(function(_0x5b9b6e,_0xd43eed){var _0x44579e=function(_0x5d3b28){while(--_0x5d3b28){_0x5b9b6e['push'](_0x5b9b6e['shift']());}};_0x44579e(++_0xd43eed);}(_0xd446,0x12f));var _0x6d44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd446[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6d44('0x0'));var util=require(_0x6d44('0x1'));var moment=require('moment');var BPromise=require(_0x6d44('0x2'));var rs=require(_0x6d44('0x3'));var fs=require('fs');var Redis=require(_0x6d44('0x4'));var db=require(_0x6d44('0x5'))['db'];var utils=require(_0x6d44('0x6'));var logger=require(_0x6d44('0x7'))('rpc');var config=require(_0x6d44('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5aa6d2,_0x593f6f,_0x2e46f1){return new BPromise(function(_0x43527e,_0x3db4d6){return client['request'](_0x5aa6d2,_0x2e46f1)[_0x6d44('0x9')](function(_0x162a26){logger[_0x6d44('0xa')](_0x6d44('0xb'),_0x593f6f,'request\x20sent');logger[_0x6d44('0xc')](_0x6d44('0xd'),_0x593f6f,_0x6d44('0xe'),JSON['stringify'](_0x162a26));if(_0x162a26[_0x6d44('0xf')]){if(_0x162a26[_0x6d44('0xf')][_0x6d44('0x10')]===0x1f4){logger[_0x6d44('0xf')](_0x6d44('0xb'),_0x593f6f,_0x162a26[_0x6d44('0xf')][_0x6d44('0x11')]);return _0x3db4d6(_0x162a26['error'][_0x6d44('0x11')]);}logger[_0x6d44('0xf')](_0x6d44('0xb'),_0x593f6f,_0x162a26[_0x6d44('0xf')][_0x6d44('0x11')]);return _0x43527e(_0x162a26[_0x6d44('0xf')][_0x6d44('0x11')]);}else{logger['info'](_0x6d44('0xb'),_0x593f6f,'request\x20sent');_0x43527e(_0x162a26[_0x6d44('0x12')][_0x6d44('0x11')]);}})[_0x6d44('0x13')](function(_0x171d7c){logger[_0x6d44('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x593f6f,_0x171d7c);_0x3db4d6(_0x171d7c);});});}exports[_0x6d44('0x14')]=function(_0x445b46){var _0x3dcc89=this;return new Promise(function(_0x5cbb08,_0x20a096){return db[_0x6d44('0x15')][_0x6d44('0x16')]({'raw':_0x445b46[_0x6d44('0x17')]?_0x445b46[_0x6d44('0x17')][_0x6d44('0x18')]===undefined?!![]:![]:!![],'where':_0x445b46['options']?_0x445b46[_0x6d44('0x17')][_0x6d44('0x19')]||null:null,'attributes':_0x445b46[_0x6d44('0x17')]?_0x445b46[_0x6d44('0x17')][_0x6d44('0x1a')]||null:null,'limit':_0x445b46[_0x6d44('0x17')]?_0x445b46[_0x6d44('0x17')][_0x6d44('0x1b')]||null:null,'include':_0x445b46['options']?_0x445b46[_0x6d44('0x17')][_0x6d44('0x1c')]?_['map'](_0x445b46[_0x6d44('0x17')]['include'],function(_0x3166cb){return{'model':db[_0x3166cb[_0x6d44('0x1d')]],'as':_0x3166cb['as'],'attributes':_0x3166cb['attributes'],'include':_0x3166cb[_0x6d44('0x1c')]?_[_0x6d44('0x1e')](_0x3166cb[_0x6d44('0x1c')],function(_0x3ffb65){return{'model':db[_0x3ffb65['model']],'as':_0x3ffb65['as'],'attributes':_0x3ffb65[_0x6d44('0x1a')],'include':_0x3ffb65[_0x6d44('0x1c')]?_[_0x6d44('0x1e')](_0x3ffb65['include'],function(_0x10e737){return{'model':db[_0x10e737[_0x6d44('0x1d')]],'as':_0x10e737['as'],'attributes':_0x10e737[_0x6d44('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6d44('0x9')](function(_0x122c48){logger[_0x6d44('0xa')](_0x6d44('0x14'),_0x445b46);logger[_0x6d44('0xc')]('GetCmHopperBlack',_0x445b46,JSON[_0x6d44('0x1f')](_0x122c48));_0x5cbb08(_0x122c48);})['catch'](function(_0xe43b6f){logger[_0x6d44('0xf')](_0x6d44('0x14'),_0xe43b6f[_0x6d44('0x11')],_0x445b46);_0x20a096(_0x3dcc89[_0x6d44('0xf')](0x1f4,_0xe43b6f['message']));});});};exports['UpdateCmHopperBlack']=function(_0x3c9282){var _0x42f20d=this;return new Promise(function(_0x469c21,_0x53d54b){return db['CmHopperBlack'][_0x6d44('0x20')](_0x3c9282[_0x6d44('0x21')],{'raw':_0x3c9282[_0x6d44('0x17')]?_0x3c9282[_0x6d44('0x17')][_0x6d44('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c9282[_0x6d44('0x17')]?_0x3c9282['options'][_0x6d44('0x19')]||null:null,'attributes':_0x3c9282[_0x6d44('0x17')]?_0x3c9282[_0x6d44('0x17')]['attributes']||null:null,'limit':_0x3c9282[_0x6d44('0x17')]?_0x3c9282[_0x6d44('0x17')]['limit']||null:null})[_0x6d44('0x9')](function(_0x32c832){logger[_0x6d44('0xa')](_0x6d44('0x22'),_0x3c9282);logger[_0x6d44('0xc')](_0x6d44('0x22'),_0x3c9282,JSON[_0x6d44('0x1f')](_0x32c832));_0x469c21(_0x32c832);})['catch'](function(_0x3f260b){logger[_0x6d44('0xf')](_0x6d44('0x22'),_0x3f260b[_0x6d44('0x11')],_0x3c9282);_0x53d54b(_0x42f20d[_0x6d44('0xf')](0x1f4,_0x3f260b[_0x6d44('0x11')]));});});};exports['DestroyCmHopperBlack']=function(_0x585554){var _0x56557f=this;return new Promise(function(_0x1ef778,_0x10042f){return db[_0x6d44('0x15')][_0x6d44('0x23')]({'where':_0x585554['options']?_0x585554[_0x6d44('0x17')][_0x6d44('0x19')]||null:null})[_0x6d44('0x9')](function(_0xdd2ecb){logger[_0x6d44('0xa')]('DestroyCmHopperBlack',_0x585554);logger[_0x6d44('0xc')](_0x6d44('0x24'),_0x585554,JSON[_0x6d44('0x1f')](_0xdd2ecb));_0x1ef778(_0xdd2ecb);})[_0x6d44('0x13')](function(_0x2bfd55){logger['error'](_0x6d44('0x24'),_0x2bfd55['message'],_0x585554);_0x10042f(_0x56557f['error'](0x1f4,_0x2bfd55['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 53dcca0..b910d75 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 _0x9c44=['delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','put','update'];(function(_0x2ec00a,_0x23412a){var _0x27b616=function(_0x1bb2c5){while(--_0x1bb2c5){_0x2ec00a['push'](_0x2ec00a['shift']());}};_0x27b616(++_0x23412a);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0xe')]);router[_0x49c4('0xf')]('/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0x10')]);module['exports']=router; \ No newline at end of file +var _0x9957=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopperBlack.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);module[_0x7995('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index cdd30b6..3a2670e 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 _0x3061=['setDataValue','followuptime','seconds','BOOLEAN','moment','exports','INTEGER','STRING','DATE','getDataValue'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0x3061,0x176));var _0x1306=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x3061[_0x2070da];return _0x4f9fe1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1306('0x0'));module[_0x1306('0x1')]={'state':{'type':Sequelize[_0x1306('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x1306('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x1306('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1306('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1306('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x1306('0x3')]},'originatecalleridname':{'type':Sequelize[_0x1306('0x3')]},'calleridnum':{'type':Sequelize[_0x1306('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x1306('0x4')]},'answertime':{'type':Sequelize[_0x1306('0x4')]},'droptime':{'type':Sequelize[_0x1306('0x4')]},'endtime':{'type':Sequelize[_0x1306('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1306('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1306('0x3')]},'campaign':{'type':Sequelize[_0x1306('0x3')]},'campaigntype':{'type':Sequelize[_0x1306('0x3')]},'membername':{'type':Sequelize[_0x1306('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x1306('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x25279f){var _0x49a32f=this[_0x1306('0x5')]('endtime');if(_0x49a32f&&_0x25279f){this[_0x1306('0x6')](_0x1306('0x7'),moment(_0x25279f)['diff'](moment(_0x49a32f),_0x1306('0x8')));}return this[_0x1306('0x6')]('dispositionat',_0x25279f);}},'amd':{'type':Sequelize[_0x1306('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x1306('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x1306('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x1306('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1306('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1306('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x1306('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x1306('0x4')]}}; \ No newline at end of file +var _0xce8a=['BOOLEAN','moment','STRING','INTEGER','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds','dispositionat'];(function(_0x5d860f,_0x467498){var _0x236490=function(_0x5e045c){while(--_0x5e045c){_0x5d860f['push'](_0x5d860f['shift']());}};_0x236490(++_0x467498);}(_0xce8a,0x85));var _0xace8=function(_0x4667a7,_0x20723d){_0x4667a7=_0x4667a7-0x0;var _0x696d78=_0xce8a[_0x4667a7];return _0x696d78;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xace8('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xace8('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xace8('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xace8('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xace8('0x1')]},'originatecalleridnum':{'type':Sequelize[_0xace8('0x1')]},'originatecalleridname':{'type':Sequelize[_0xace8('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xace8('0x1')]},'starttime':{'type':Sequelize[_0xace8('0x3')]},'responsetime':{'type':Sequelize[_0xace8('0x3')]},'answertime':{'type':Sequelize[_0xace8('0x3')]},'droptime':{'type':Sequelize[_0xace8('0x3')]},'endtime':{'type':Sequelize[_0xace8('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xace8('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xace8('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xace8('0x1')]},'campaign':{'type':Sequelize[_0xace8('0x1')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xace8('0x1')]},'reason':{'type':Sequelize[_0xace8('0x1')]},'disposition':{'type':Sequelize[_0xace8('0x1')]},'dispositionat':{'type':Sequelize[_0xace8('0x3')],'set':function(_0x5d64fc){var _0x473f65=this[_0xace8('0x4')](_0xace8('0x5'));if(_0x473f65&&_0x5d64fc){this[_0xace8('0x6')](_0xace8('0x7'),moment(_0x5d64fc)[_0xace8('0x8')](moment(_0x473f65),_0xace8('0x9')));}return this[_0xace8('0x6')](_0xace8('0xa'),_0x5d64fc);}},'amd':{'type':Sequelize[_0xace8('0xb')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xace8('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xace8('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xace8('0x1')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xace8('0x3')]},'recallme':{'type':Sequelize[_0xace8('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xace8('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index e8ffa63..dfc0d0e 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 _0xa647=['count','offset','limit','set','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','sort','where','pick','merge','type','VIRTUAL','filter','options','CmHopperFinal','includeAll','include','rows','catch','show','params','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noSuchContacts','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','field','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','NOW()','updatedAt','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','select','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper_final','Campaign','find','fromQuery','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum','group','checkContactHopper','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json'];(function(_0xcabd64,_0x34f30d){var _0x5a36a4=function(_0x48a3dd){while(--_0x48a3dd){_0xcabd64['push'](_0xcabd64['shift']());}};_0x5a36a4(++_0x34f30d);}(_0xa647,0xe5));var _0x7a64=function(_0x74912e,_0x25c8c9){_0x74912e=_0x74912e-0x0;var _0x54e755=_0xa647[_0x74912e];return _0x54e755;};'use strict';var pdf=require(_0x7a64('0x0'));var emlformat=require(_0x7a64('0x1'));var rimraf=require(_0x7a64('0x2'));var zipdir=require(_0x7a64('0x3'));var jsonpatch=require(_0x7a64('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7a64('0x5'));var Mustache=require(_0x7a64('0x6'));var util=require(_0x7a64('0x7'));var path=require(_0x7a64('0x8'));var sox=require(_0x7a64('0x9'));var csv=require(_0x7a64('0xa'));var ejs=require(_0x7a64('0xb'));var fs=require('fs');var _=require(_0x7a64('0xc'));var squel=require(_0x7a64('0xd'));var crypto=require(_0x7a64('0xe'));var jsforce=require(_0x7a64('0xf'));var deskjs=require(_0x7a64('0x10'));var toCsv=require(_0x7a64('0xa'));var querystring=require(_0x7a64('0x11'));var Papa=require(_0x7a64('0x12'));var Redis=require('ioredis');var authService=require(_0x7a64('0x13'));var qs=require(_0x7a64('0x14'));var as=require(_0x7a64('0x15'));var hardwareService=require(_0x7a64('0x16'));var logger=require(_0x7a64('0x17'))(_0x7a64('0x18'));var utils=require(_0x7a64('0x19'));var config=require('../../config/environment');var db=require(_0x7a64('0x1a'))['db'];function respondWithStatusCode(_0x435398,_0x5c1eb2){_0x5c1eb2=_0x5c1eb2||0xcc;return function(_0x81624d){if(_0x81624d){return _0x435398[_0x7a64('0x1b')](_0x5c1eb2);}return _0x435398[_0x7a64('0x1c')](_0x5c1eb2)[_0x7a64('0x1d')]();};}function respondWithResult(_0x26f57b,_0x4616da){_0x4616da=_0x4616da||0xc8;return function(_0x121167){if(_0x121167){return _0x26f57b[_0x7a64('0x1c')](_0x4616da)[_0x7a64('0x1e')](_0x121167);}};}function respondWithFilteredResult(_0x401738,_0x127bb5){return function(_0x5414b3){if(_0x5414b3){var _0x166c05=_0x5414b3[_0x7a64('0x1f')],_0x57c15b=_0x127bb5[_0x7a64('0x20')],_0x2e9867=_0x127bb5[_0x7a64('0x20')]+_0x127bb5[_0x7a64('0x21')],_0x5bb7af;if(_0x2e9867>=_0x166c05){_0x2e9867=_0x166c05;_0x5bb7af=0xc8;}else{_0x5bb7af=0xce;}_0x401738['status'](_0x5bb7af);return _0x401738[_0x7a64('0x22')]('Content-Range',_0x57c15b+'-'+_0x2e9867+'/'+_0x166c05)['json'](_0x5414b3);}return null;};}function patchUpdates(_0x4b154b){return function(_0x131bd5){try{jsonpatch[_0x7a64('0x23')](_0x131bd5,_0x4b154b,!![]);}catch(_0x5a3e01){return BPromise[_0x7a64('0x24')](_0x5a3e01);}return _0x131bd5['save']();};}function saveUpdates(_0x491b65,_0x567ca9){return function(_0x467f14){if(_0x467f14){return _0x467f14[_0x7a64('0x25')](_0x491b65)[_0x7a64('0x26')](function(_0x13bc21){return _0x13bc21;});}return null;};}function removeEntity(_0x37958c,_0x4446b2){return function(_0x1cdb02){if(_0x1cdb02){return _0x1cdb02['destroy']()[_0x7a64('0x26')](function(){_0x37958c[_0x7a64('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bb5dc,_0x39631c){return function(_0x416a83){if(!_0x416a83){_0x4bb5dc[_0x7a64('0x1b')](0x194);}return _0x416a83;};}function handleError(_0x10c0c2,_0x396b18){_0x396b18=_0x396b18||0x1f4;return function(_0x4e16d8){logger[_0x7a64('0x27')](_0x4e16d8[_0x7a64('0x28')]);if(_0x4e16d8[_0x7a64('0x29')]){delete _0x4e16d8['name'];}_0x10c0c2['status'](_0x396b18)[_0x7a64('0x2a')](_0x4e16d8);};}exports[_0x7a64('0x2b')]=function(_0x5d4353,_0x2da1dc){var _0x19fc61={},_0x4316ea={},_0x245229={'count':0x0,'rows':[]};var _0x14eaa2=_[_0x7a64('0x2c')](db['CmHopperFinal'][_0x7a64('0x2d')],function(_0x56c3d4){return{'name':_0x56c3d4[_0x7a64('0x2e')],'type':_0x56c3d4['type']['key']};});_0x4316ea['model']=_['map'](_0x14eaa2,_0x7a64('0x29'));_0x4316ea[_0x7a64('0x2f')]=_[_0x7a64('0x30')](_0x5d4353['query']);_0x4316ea[_0x7a64('0x31')]=_[_0x7a64('0x32')](_0x4316ea[_0x7a64('0x33')],_0x4316ea[_0x7a64('0x2f')]);_0x19fc61[_0x7a64('0x34')]=_[_0x7a64('0x32')](_0x4316ea[_0x7a64('0x33')],qs['fields'](_0x5d4353['query'][_0x7a64('0x35')]));_0x19fc61['attributes']=_0x19fc61[_0x7a64('0x34')][_0x7a64('0x36')]?_0x19fc61['attributes']:_0x4316ea[_0x7a64('0x33')];if(!_0x5d4353[_0x7a64('0x2f')]['hasOwnProperty']('nolimit')){_0x19fc61['limit']=qs['limit'](_0x5d4353[_0x7a64('0x2f')]['limit']);_0x19fc61[_0x7a64('0x20')]=qs['offset'](_0x5d4353[_0x7a64('0x2f')][_0x7a64('0x20')]);}_0x19fc61['order']=qs['sort'](_0x5d4353['query'][_0x7a64('0x37')]);_0x19fc61[_0x7a64('0x38')]=qs[_0x7a64('0x31')](_[_0x7a64('0x39')](_0x5d4353[_0x7a64('0x2f')],_0x4316ea[_0x7a64('0x31')]));if(_0x5d4353['query']['filter']){_0x19fc61['where']=_[_0x7a64('0x3a')](_0x19fc61[_0x7a64('0x38')],{'$or':_['map'](_0x14eaa2,function(_0x3a6de1){if(_0x3a6de1[_0x7a64('0x3b')]!==_0x7a64('0x3c')){var _0x429ed6={};_0x429ed6[_0x3a6de1[_0x7a64('0x29')]]={'$like':'%'+_0x5d4353['query'][_0x7a64('0x3d')]+'%'};return _0x429ed6;}})});}_0x19fc61=_[_0x7a64('0x3a')]({},_0x19fc61,_0x5d4353[_0x7a64('0x3e')]);var _0x8aea20={'where':_0x19fc61[_0x7a64('0x38')]};return db[_0x7a64('0x3f')][_0x7a64('0x1f')](_0x8aea20)[_0x7a64('0x26')](function(_0x26f623){_0x245229[_0x7a64('0x1f')]=_0x26f623;if(_0x5d4353[_0x7a64('0x2f')][_0x7a64('0x40')]){_0x19fc61[_0x7a64('0x41')]=[{'all':!![]}];}return db[_0x7a64('0x3f')]['findAll'](_0x19fc61);})[_0x7a64('0x26')](function(_0x3d6504){_0x245229[_0x7a64('0x42')]=_0x3d6504;return _0x245229;})[_0x7a64('0x26')](respondWithFilteredResult(_0x2da1dc,_0x19fc61))[_0x7a64('0x43')](handleError(_0x2da1dc,null));};exports[_0x7a64('0x44')]=function(_0x844e28,_0x6789e7){var _0x142a56={'raw':!![],'where':{'id':_0x844e28[_0x7a64('0x45')]['id']}},_0x3e2430={};_0x3e2430[_0x7a64('0x33')]=_[_0x7a64('0x30')](db[_0x7a64('0x3f')][_0x7a64('0x2d')]);_0x3e2430[_0x7a64('0x2f')]=_[_0x7a64('0x30')](_0x844e28[_0x7a64('0x2f')]);_0x3e2430['filters']=_[_0x7a64('0x32')](_0x3e2430[_0x7a64('0x33')],_0x3e2430['query']);_0x142a56[_0x7a64('0x34')]=_[_0x7a64('0x32')](_0x3e2430[_0x7a64('0x33')],qs[_0x7a64('0x35')](_0x844e28[_0x7a64('0x2f')][_0x7a64('0x35')]));_0x142a56[_0x7a64('0x34')]=_0x142a56[_0x7a64('0x34')][_0x7a64('0x36')]?_0x142a56[_0x7a64('0x34')]:_0x3e2430[_0x7a64('0x33')];if(_0x844e28[_0x7a64('0x2f')][_0x7a64('0x40')]){_0x142a56[_0x7a64('0x41')]=[{'all':!![]}];}_0x142a56=_['merge']({},_0x142a56,_0x844e28[_0x7a64('0x3e')]);return db[_0x7a64('0x3f')]['find'](_0x142a56)['then'](handleEntityNotFound(_0x6789e7,null))[_0x7a64('0x26')](respondWithResult(_0x6789e7,null))[_0x7a64('0x43')](handleError(_0x6789e7,null));};exports[_0x7a64('0x46')]=function(_0x43365c,_0x3aa7aa){return db[_0x7a64('0x3f')][_0x7a64('0x46')]()[_0x7a64('0x26')](respondWithResult(_0x3aa7aa,null))[_0x7a64('0x43')](handleError(_0x3aa7aa,null));};exports['update']=function(_0x416d11,_0x1f96da){if(_0x416d11[_0x7a64('0x47')][_0x7a64('0x48')]){delete _0x416d11[_0x7a64('0x47')][_0x7a64('0x48')];}return db[_0x7a64('0x3f')]['find']({'where':{'uniqueid':_0x416d11[_0x7a64('0x45')]['id']}})[_0x7a64('0x26')](handleEntityNotFound(_0x1f96da,null))[_0x7a64('0x26')](saveUpdates(_0x416d11[_0x7a64('0x47')],null))['then'](respondWithResult(_0x1f96da,null))[_0x7a64('0x43')](handleError(_0x1f96da,null));};exports[_0x7a64('0x49')]=function(_0x4b5b36,_0x461fd8,_0x860bba){return db[_0x7a64('0x3f')][_0x7a64('0x4a')]({'raw':![],'where':{'VoiceQueueId':_0x4b5b36['params']['id']},'attributes':[[db[_0x7a64('0x4b')]['fn'](_0x7a64('0x4c'),db[_0x7a64('0x4b')]['fn']('IF',db[_0x7a64('0x4b')][_0x7a64('0x4d')](_0x7a64('0x4e')))),'noSuchContacts'],[db[_0x7a64('0x4b')]['fn']('COUNT',db[_0x7a64('0x4b')]['fn']('IF',db[_0x7a64('0x4b')][_0x7a64('0x4d')](_0x7a64('0x4f')))),_0x7a64('0x50')],[db[_0x7a64('0x4b')]['fn'](_0x7a64('0x4c'),db[_0x7a64('0x4b')]['fn']('IF',db[_0x7a64('0x4b')][_0x7a64('0x4d')](_0x7a64('0x51')))),_0x7a64('0x52')],[db[_0x7a64('0x4b')]['fn'](_0x7a64('0x4c'),db['sequelize']['fn']('IF',db[_0x7a64('0x4b')][_0x7a64('0x4d')](_0x7a64('0x53')))),_0x7a64('0x54')],[db['sequelize']['fn'](_0x7a64('0x4c'),db['sequelize']['fn']('IF',db[_0x7a64('0x4b')][_0x7a64('0x4d')](_0x7a64('0x55')))),_0x7a64('0x56')],[db[_0x7a64('0x4b')]['fn'](_0x7a64('0x4c'),db[_0x7a64('0x4b')]['fn']('IF',db['sequelize'][_0x7a64('0x4d')](_0x7a64('0x57')))),_0x7a64('0x58')],[db[_0x7a64('0x4b')]['fn'](_0x7a64('0x4c'),db[_0x7a64('0x4b')]['fn']('IF',db[_0x7a64('0x4b')][_0x7a64('0x4d')](_0x7a64('0x59')))),'reCallContacts'],[db[_0x7a64('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x7a64('0x4b')][_0x7a64('0x4d')](_0x7a64('0x5a')))),_0x7a64('0x5b')]]})[_0x7a64('0x26')](handleEntityNotFound(_0x461fd8,null))[_0x7a64('0x26')](respondWithResult(_0x461fd8,null))[_0x7a64('0x43')](handleError(_0x461fd8,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x330fe9,_0x2b1f31,_0x12cefa){return db[_0x7a64('0x3f')][_0x7a64('0x4a')]({'raw':![],'where':{'CampaignId':_0x330fe9[_0x7a64('0x45')]['id']},'attributes':[[db[_0x7a64('0x4b')]['fn'](_0x7a64('0x4c'),db[_0x7a64('0x4b')]['fn']('IF',db[_0x7a64('0x4b')][_0x7a64('0x4d')](_0x7a64('0x4e')))),_0x7a64('0x5c')],[db[_0x7a64('0x4b')]['fn'](_0x7a64('0x4c'),db[_0x7a64('0x4b')]['fn']('IF',db[_0x7a64('0x4b')][_0x7a64('0x4d')](_0x7a64('0x4f')))),_0x7a64('0x50')],[db['sequelize']['fn'](_0x7a64('0x4c'),db[_0x7a64('0x4b')]['fn']('IF',db[_0x7a64('0x4b')][_0x7a64('0x4d')](_0x7a64('0x51')))),_0x7a64('0x52')],[db['sequelize']['fn']('COUNT',db[_0x7a64('0x4b')]['fn']('IF',db[_0x7a64('0x4b')]['literal'](_0x7a64('0x53')))),_0x7a64('0x54')],[db[_0x7a64('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x7a64('0x4b')][_0x7a64('0x4d')](_0x7a64('0x55')))),'dropContacts'],[db['sequelize']['fn'](_0x7a64('0x4c'),db[_0x7a64('0x4b')]['fn']('IF',db[_0x7a64('0x4b')]['literal'](_0x7a64('0x57')))),_0x7a64('0x58')],[db[_0x7a64('0x4b')]['fn'](_0x7a64('0x4c'),db['sequelize']['fn']('IF',db[_0x7a64('0x4b')][_0x7a64('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),_0x7a64('0x5d')],[db['sequelize']['fn'](_0x7a64('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x7a64('0x4d')](_0x7a64('0x5a')))),_0x7a64('0x5b')]]})[_0x7a64('0x26')](handleEntityNotFound(_0x2b1f31,null))[_0x7a64('0x26')](respondWithResult(_0x2b1f31,null))['catch'](handleError(_0x2b1f31,null));};exports[_0x7a64('0x5e')]=function(_0x9972e7,_0x4b10cd,_0x54689d){return db[_0x7a64('0x5f')]['find']({'where':{'id':_0x9972e7[_0x7a64('0x45')]['id']}})[_0x7a64('0x26')](handleEntityNotFound(_0x4b10cd,null))[_0x7a64('0x26')](function(_0x49d37d){var _0x5407ef;if(_0x49d37d){_0x5407ef=squel[_0x7a64('0x60')]()[_0x7a64('0x61')](_0x7a64('0x62'))['fromQuery']([_0x7a64('0x63'),_0x7a64('0x64'),_0x7a64('0x65'),_0x7a64('0x66'),_0x7a64('0x67'),_0x7a64('0x68'),'updatedAt'],squel['select']()[_0x7a64('0x69')](_0x7a64('0x6a'),_0x7a64('0x63'))[_0x7a64('0x69')]('NOW()',_0x7a64('0x64'))[_0x7a64('0x69')](_0x7a64('0x6b'),_0x7a64('0x65'))['field']('ANY_VALUE(ListId)',_0x7a64('0x66'))['field'](_0x7a64('0x6c'),_0x7a64('0x67'))[_0x7a64('0x69')](_0x7a64('0x6d'),_0x7a64('0x68'))[_0x7a64('0x69')](_0x7a64('0x6d'),_0x7a64('0x6e'))[_0x7a64('0x6f')]('cm_hopper_final')[_0x7a64('0x38')](_0x7a64('0x70'),_0x9972e7[_0x7a64('0x45')]['id'][_0x7a64('0x71')]())[_0x7a64('0x38')](_0x7a64('0x72'),_0x9972e7[_0x7a64('0x47')]['state'][_0x7a64('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x7a64('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7a64('0x73')]()[_0x7a64('0x69')]('phone')['from'](_0x7a64('0x62'))[_0x7a64('0x38')]('VoiceQueueId\x20=\x20?',_0x9972e7[_0x7a64('0x45')]['id'][_0x7a64('0x71')]()))['where'](_0x7a64('0x74'),squel[_0x7a64('0x73')]()[_0x7a64('0x69')]('calleridnum')['from'](_0x7a64('0x75'))['where'](_0x7a64('0x70'),_0x9972e7[_0x7a64('0x45')]['id'][_0x7a64('0x71')]())['where']('state\x20=\x204'))['group']('ContactId'))[_0x7a64('0x71')]();return db[_0x7a64('0x4b')][_0x7a64('0x2f')](_0x5407ef);}return[];})[_0x7a64('0x26')](respondWithResult(_0x4b10cd,null))[_0x7a64('0x43')](handleError(_0x4b10cd,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x3df234,_0x154c33,_0x34f165){return db[_0x7a64('0x76')][_0x7a64('0x77')]({'where':{'id':_0x3df234['params']['id']}})[_0x7a64('0x26')](handleEntityNotFound(_0x154c33,null))[_0x7a64('0x26')](function(_0x26c9a2){var _0x1befbf;if(_0x26c9a2){_0x1befbf=squel[_0x7a64('0x60')]()[_0x7a64('0x61')](_0x7a64('0x62'))[_0x7a64('0x78')]([_0x7a64('0x63'),_0x7a64('0x64'),_0x7a64('0x65'),_0x7a64('0x66'),'CampaignId',_0x7a64('0x68'),_0x7a64('0x6e')],squel['select']()[_0x7a64('0x69')](_0x7a64('0x6a'),_0x7a64('0x63'))['field'](_0x7a64('0x6d'),_0x7a64('0x64'))[_0x7a64('0x69')](_0x7a64('0x6b'),_0x7a64('0x65'))['field'](_0x7a64('0x79'),_0x7a64('0x66'))[_0x7a64('0x69')](_0x7a64('0x7a'),_0x7a64('0x7b'))[_0x7a64('0x69')](_0x7a64('0x6d'),_0x7a64('0x68'))[_0x7a64('0x69')](_0x7a64('0x6d'),_0x7a64('0x6e'))[_0x7a64('0x6f')](_0x7a64('0x75'))[_0x7a64('0x38')](_0x7a64('0x7c'),_0x3df234[_0x7a64('0x45')]['id'][_0x7a64('0x71')]())[_0x7a64('0x38')](_0x7a64('0x72'),_0x3df234[_0x7a64('0x47')][_0x7a64('0x7d')][_0x7a64('0x71')]())[_0x7a64('0x38')](_0x7a64('0x7e'))[_0x7a64('0x38')](_0x7a64('0x74'),squel[_0x7a64('0x73')]()[_0x7a64('0x69')](_0x7a64('0x63'))[_0x7a64('0x6f')](_0x7a64('0x62'))[_0x7a64('0x38')]('CampaignId\x20=\x20?',_0x3df234[_0x7a64('0x45')]['id'][_0x7a64('0x71')]()))[_0x7a64('0x38')](_0x7a64('0x74'),squel['select']()[_0x7a64('0x69')](_0x7a64('0x7f'))[_0x7a64('0x6f')](_0x7a64('0x75'))[_0x7a64('0x38')](_0x7a64('0x7c'),_0x3df234[_0x7a64('0x45')]['id'][_0x7a64('0x71')]())[_0x7a64('0x38')]('state\x20=\x204'))[_0x7a64('0x80')](_0x7a64('0x65')))[_0x7a64('0x71')]();return db[_0x7a64('0x4b')]['query'](_0x1befbf);}return[];})[_0x7a64('0x26')](respondWithResult(_0x154c33,null))['catch'](handleError(_0x154c33,null));};exports[_0x7a64('0x81')]=function(_0x5a8b93,_0x12b593,_0x3d9c23){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x5a8b93['body'][_0x7a64('0x67')],'CampaignId':_0x5a8b93[_0x7a64('0x47')][_0x7a64('0x7b')],'ContactId':_0x5a8b93[_0x7a64('0x47')][_0x7a64('0x65')]}})[_0x7a64('0x26')](handleEntityNotFound(_0x12b593,null))[_0x7a64('0x26')](function(_0x554c35){if(_0x554c35){return _0x554c35;}return null;})[_0x7a64('0x26')](respondWithResult(_0x12b593,null))[_0x7a64('0x43')](handleError(_0x12b593,null));}; \ No newline at end of file +var _0xbcb2=['includeAll','find','describe','update','uniqueid','body','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','literal','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','ContactId','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()','scheduledAt','ANY_VALUE(ContactId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','group','moveContactsIvrCampaignHopperFinal','cm_hopper','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','state\x20=\x204','checkContactHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','json','apply','save','destroy','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','CmHopperFinal','include','findAll','rows','catch','show','params'];(function(_0x28f7fa,_0x37131d){var _0xcca44e=function(_0x53db1c){while(--_0x53db1c){_0x28f7fa['push'](_0x28f7fa['shift']());}};_0xcca44e(++_0x37131d);}(_0xbcb2,0xbd));var _0x2bcb=function(_0x4eb7d7,_0x378639){_0x4eb7d7=_0x4eb7d7-0x0;var _0x6df382=_0xbcb2[_0x4eb7d7];return _0x6df382;};'use strict';var pdf=require(_0x2bcb('0x0'));var emlformat=require(_0x2bcb('0x1'));var rimraf=require(_0x2bcb('0x2'));var zipdir=require(_0x2bcb('0x3'));var jsonpatch=require(_0x2bcb('0x4'));var rp=require(_0x2bcb('0x5'));var moment=require(_0x2bcb('0x6'));var BPromise=require(_0x2bcb('0x7'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2bcb('0x8'));var ejs=require(_0x2bcb('0x9'));var fs=require('fs');var _=require(_0x2bcb('0xa'));var squel=require('squel');var crypto=require(_0x2bcb('0xb'));var jsforce=require(_0x2bcb('0xc'));var deskjs=require(_0x2bcb('0xd'));var toCsv=require(_0x2bcb('0x8'));var querystring=require('querystring');var Papa=require(_0x2bcb('0xe'));var Redis=require('ioredis');var authService=require(_0x2bcb('0xf'));var qs=require(_0x2bcb('0x10'));var as=require(_0x2bcb('0x11'));var hardwareService=require(_0x2bcb('0x12'));var logger=require('../../config/logger')(_0x2bcb('0x13'));var utils=require(_0x2bcb('0x14'));var config=require(_0x2bcb('0x15'));var db=require(_0x2bcb('0x16'))['db'];function respondWithStatusCode(_0xda7f1f,_0x456788){_0x456788=_0x456788||0xcc;return function(_0x6c8613){if(_0x6c8613){return _0xda7f1f['sendStatus'](_0x456788);}return _0xda7f1f[_0x2bcb('0x17')](_0x456788)[_0x2bcb('0x18')]();};}function respondWithResult(_0x41f5b7,_0x49dcfa){_0x49dcfa=_0x49dcfa||0xc8;return function(_0x5b099e){if(_0x5b099e){return _0x41f5b7['status'](_0x49dcfa)['json'](_0x5b099e);}};}function respondWithFilteredResult(_0x237415,_0x112db6){return function(_0x5131e0){if(_0x5131e0){var _0x5b4cfb=_0x5131e0['count'],_0x4ab675=_0x112db6[_0x2bcb('0x19')],_0x2cdefc=_0x112db6[_0x2bcb('0x19')]+_0x112db6[_0x2bcb('0x1a')],_0x3f9d81;if(_0x2cdefc>=_0x5b4cfb){_0x2cdefc=_0x5b4cfb;_0x3f9d81=0xc8;}else{_0x3f9d81=0xce;}_0x237415[_0x2bcb('0x17')](_0x3f9d81);return _0x237415[_0x2bcb('0x1b')](_0x2bcb('0x1c'),_0x4ab675+'-'+_0x2cdefc+'/'+_0x5b4cfb)[_0x2bcb('0x1d')](_0x5131e0);}return null;};}function patchUpdates(_0x37ed74){return function(_0x34e84a){try{jsonpatch[_0x2bcb('0x1e')](_0x34e84a,_0x37ed74,!![]);}catch(_0x30f506){return BPromise['reject'](_0x30f506);}return _0x34e84a[_0x2bcb('0x1f')]();};}function saveUpdates(_0x123e7c,_0x1f023e){return function(_0xe1cdc6){if(_0xe1cdc6){return _0xe1cdc6['update'](_0x123e7c)['then'](function(_0x255c33){return _0x255c33;});}return null;};}function removeEntity(_0x9d5fcb,_0x4d685f){return function(_0x2a8291){if(_0x2a8291){return _0x2a8291[_0x2bcb('0x20')]()[_0x2bcb('0x21')](function(){_0x9d5fcb[_0x2bcb('0x17')](0xcc)[_0x2bcb('0x18')]();});}};}function handleEntityNotFound(_0x1dfd44,_0x3e11e9){return function(_0x1c0e35){if(!_0x1c0e35){_0x1dfd44[_0x2bcb('0x22')](0x194);}return _0x1c0e35;};}function handleError(_0x22d67a,_0x284ef2){_0x284ef2=_0x284ef2||0x1f4;return function(_0x5604a7){logger['error'](_0x5604a7[_0x2bcb('0x23')]);if(_0x5604a7[_0x2bcb('0x24')]){delete _0x5604a7[_0x2bcb('0x24')];}_0x22d67a[_0x2bcb('0x17')](_0x284ef2)[_0x2bcb('0x25')](_0x5604a7);};}exports[_0x2bcb('0x26')]=function(_0x47611b,_0x372235){var _0x46926a={},_0x5345ec={},_0x58974c={'count':0x0,'rows':[]};var _0x568792=_[_0x2bcb('0x27')](db['CmHopperFinal'][_0x2bcb('0x28')],function(_0x32ca80){return{'name':_0x32ca80[_0x2bcb('0x29')],'type':_0x32ca80[_0x2bcb('0x2a')]['key']};});_0x5345ec['model']=_[_0x2bcb('0x27')](_0x568792,_0x2bcb('0x24'));_0x5345ec[_0x2bcb('0x2b')]=_[_0x2bcb('0x2c')](_0x47611b['query']);_0x5345ec[_0x2bcb('0x2d')]=_['intersection'](_0x5345ec['model'],_0x5345ec[_0x2bcb('0x2b')]);_0x46926a[_0x2bcb('0x2e')]=_[_0x2bcb('0x2f')](_0x5345ec[_0x2bcb('0x30')],qs[_0x2bcb('0x31')](_0x47611b['query']['fields']));_0x46926a['attributes']=_0x46926a[_0x2bcb('0x2e')][_0x2bcb('0x32')]?_0x46926a[_0x2bcb('0x2e')]:_0x5345ec['model'];if(!_0x47611b[_0x2bcb('0x2b')][_0x2bcb('0x33')]('nolimit')){_0x46926a[_0x2bcb('0x1a')]=qs[_0x2bcb('0x1a')](_0x47611b[_0x2bcb('0x2b')][_0x2bcb('0x1a')]);_0x46926a['offset']=qs[_0x2bcb('0x19')](_0x47611b[_0x2bcb('0x2b')][_0x2bcb('0x19')]);}_0x46926a[_0x2bcb('0x34')]=qs[_0x2bcb('0x35')](_0x47611b[_0x2bcb('0x2b')]['sort']);_0x46926a[_0x2bcb('0x36')]=qs['filters'](_[_0x2bcb('0x37')](_0x47611b[_0x2bcb('0x2b')],_0x5345ec[_0x2bcb('0x2d')]));if(_0x47611b[_0x2bcb('0x2b')]['filter']){_0x46926a['where']=_['merge'](_0x46926a[_0x2bcb('0x36')],{'$or':_[_0x2bcb('0x27')](_0x568792,function(_0x4e90e6){if(_0x4e90e6[_0x2bcb('0x2a')]!==_0x2bcb('0x38')){var _0x4c2798={};_0x4c2798[_0x4e90e6[_0x2bcb('0x24')]]={'$like':'%'+_0x47611b['query'][_0x2bcb('0x39')]+'%'};return _0x4c2798;}})});}_0x46926a=_[_0x2bcb('0x3a')]({},_0x46926a,_0x47611b[_0x2bcb('0x3b')]);var _0x482dce={'where':_0x46926a[_0x2bcb('0x36')]};return db[_0x2bcb('0x3c')]['count'](_0x482dce)[_0x2bcb('0x21')](function(_0x40d892){_0x58974c['count']=_0x40d892;if(_0x47611b['query']['includeAll']){_0x46926a[_0x2bcb('0x3d')]=[{'all':!![]}];}return db[_0x2bcb('0x3c')][_0x2bcb('0x3e')](_0x46926a);})[_0x2bcb('0x21')](function(_0x88dff4){_0x58974c[_0x2bcb('0x3f')]=_0x88dff4;return _0x58974c;})[_0x2bcb('0x21')](respondWithFilteredResult(_0x372235,_0x46926a))[_0x2bcb('0x40')](handleError(_0x372235,null));};exports[_0x2bcb('0x41')]=function(_0xf85bcc,_0x4db6fd){var _0x2bc9b1={'raw':!![],'where':{'id':_0xf85bcc[_0x2bcb('0x42')]['id']}},_0x54d564={};_0x54d564['model']=_[_0x2bcb('0x2c')](db[_0x2bcb('0x3c')]['rawAttributes']);_0x54d564['query']=_[_0x2bcb('0x2c')](_0xf85bcc['query']);_0x54d564[_0x2bcb('0x2d')]=_['intersection'](_0x54d564['model'],_0x54d564[_0x2bcb('0x2b')]);_0x2bc9b1[_0x2bcb('0x2e')]=_['intersection'](_0x54d564['model'],qs[_0x2bcb('0x31')](_0xf85bcc[_0x2bcb('0x2b')][_0x2bcb('0x31')]));_0x2bc9b1[_0x2bcb('0x2e')]=_0x2bc9b1[_0x2bcb('0x2e')][_0x2bcb('0x32')]?_0x2bc9b1[_0x2bcb('0x2e')]:_0x54d564[_0x2bcb('0x30')];if(_0xf85bcc['query'][_0x2bcb('0x43')]){_0x2bc9b1[_0x2bcb('0x3d')]=[{'all':!![]}];}_0x2bc9b1=_['merge']({},_0x2bc9b1,_0xf85bcc[_0x2bcb('0x3b')]);return db[_0x2bcb('0x3c')][_0x2bcb('0x44')](_0x2bc9b1)[_0x2bcb('0x21')](handleEntityNotFound(_0x4db6fd,null))[_0x2bcb('0x21')](respondWithResult(_0x4db6fd,null))[_0x2bcb('0x40')](handleError(_0x4db6fd,null));};exports[_0x2bcb('0x45')]=function(_0x2a9f44,_0x5c3803){return db[_0x2bcb('0x3c')][_0x2bcb('0x45')]()['then'](respondWithResult(_0x5c3803,null))[_0x2bcb('0x40')](handleError(_0x5c3803,null));};exports[_0x2bcb('0x46')]=function(_0x57c4ad,_0x59d5fd){if(_0x57c4ad['body'][_0x2bcb('0x47')]){delete _0x57c4ad[_0x2bcb('0x48')][_0x2bcb('0x47')];}return db[_0x2bcb('0x3c')]['find']({'where':{'uniqueid':_0x57c4ad[_0x2bcb('0x42')]['id']}})['then'](handleEntityNotFound(_0x59d5fd,null))[_0x2bcb('0x21')](saveUpdates(_0x57c4ad[_0x2bcb('0x48')],null))[_0x2bcb('0x21')](respondWithResult(_0x59d5fd,null))[_0x2bcb('0x40')](handleError(_0x59d5fd,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x2acce4,_0x1d88e5,_0x592561){return db[_0x2bcb('0x3c')][_0x2bcb('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x2acce4['params']['id']},'attributes':[[db[_0x2bcb('0x49')]['fn'](_0x2bcb('0x4a'),db[_0x2bcb('0x49')]['fn']('IF',db[_0x2bcb('0x49')]['literal'](_0x2bcb('0x4b')))),_0x2bcb('0x4c')],[db[_0x2bcb('0x49')]['fn'](_0x2bcb('0x4a'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x2bcb('0x4d')],[db[_0x2bcb('0x49')]['fn'](_0x2bcb('0x4a'),db[_0x2bcb('0x49')]['fn']('IF',db['sequelize']['literal'](_0x2bcb('0x4e')))),_0x2bcb('0x4f')],[db[_0x2bcb('0x49')]['fn'](_0x2bcb('0x4a'),db[_0x2bcb('0x49')]['fn']('IF',db['sequelize'][_0x2bcb('0x50')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0x2bcb('0x49')]['fn']('IF',db[_0x2bcb('0x49')][_0x2bcb('0x50')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'dropContacts'],[db['sequelize']['fn'](_0x2bcb('0x4a'),db[_0x2bcb('0x49')]['fn']('IF',db['sequelize'][_0x2bcb('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x2bcb('0x51')],[db[_0x2bcb('0x49')]['fn'](_0x2bcb('0x4a'),db['sequelize']['fn']('IF',db[_0x2bcb('0x49')]['literal'](_0x2bcb('0x52')))),_0x2bcb('0x53')],[db['sequelize']['fn'](_0x2bcb('0x4a'),db[_0x2bcb('0x49')]['fn']('IF',db[_0x2bcb('0x49')][_0x2bcb('0x50')](_0x2bcb('0x54')))),'answeringMachine']]})[_0x2bcb('0x21')](handleEntityNotFound(_0x1d88e5,null))[_0x2bcb('0x21')](respondWithResult(_0x1d88e5,null))[_0x2bcb('0x40')](handleError(_0x1d88e5,null));};exports[_0x2bcb('0x55')]=function(_0x55478c,_0x180e81,_0x28c859){return db[_0x2bcb('0x3c')][_0x2bcb('0x3e')]({'raw':![],'where':{'CampaignId':_0x55478c[_0x2bcb('0x42')]['id']},'attributes':[[db[_0x2bcb('0x49')]['fn'](_0x2bcb('0x4a'),db[_0x2bcb('0x49')]['fn']('IF',db[_0x2bcb('0x49')][_0x2bcb('0x50')](_0x2bcb('0x4b')))),_0x2bcb('0x4c')],[db[_0x2bcb('0x49')]['fn'](_0x2bcb('0x4a'),db[_0x2bcb('0x49')]['fn']('IF',db['sequelize'][_0x2bcb('0x50')](_0x2bcb('0x56')))),_0x2bcb('0x4d')],[db[_0x2bcb('0x49')]['fn'](_0x2bcb('0x4a'),db[_0x2bcb('0x49')]['fn']('IF',db[_0x2bcb('0x49')][_0x2bcb('0x50')](_0x2bcb('0x4e')))),'busyContacts'],[db[_0x2bcb('0x49')]['fn'](_0x2bcb('0x4a'),db[_0x2bcb('0x49')]['fn']('IF',db[_0x2bcb('0x49')][_0x2bcb('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0x2bcb('0x57')],[db['sequelize']['fn'](_0x2bcb('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0x2bcb('0x50')](_0x2bcb('0x58')))),_0x2bcb('0x59')],[db[_0x2bcb('0x49')]['fn'](_0x2bcb('0x4a'),db[_0x2bcb('0x49')]['fn']('IF',db['sequelize'][_0x2bcb('0x50')](_0x2bcb('0x5a')))),_0x2bcb('0x51')],[db[_0x2bcb('0x49')]['fn'](_0x2bcb('0x4a'),db[_0x2bcb('0x49')]['fn']('IF',db[_0x2bcb('0x49')][_0x2bcb('0x50')]('`state`\x20=\x2022,\x201,\x20null'))),_0x2bcb('0x53')],[db['sequelize']['fn'](_0x2bcb('0x4a'),db[_0x2bcb('0x49')]['fn']('IF',db['sequelize'][_0x2bcb('0x50')](_0x2bcb('0x54')))),_0x2bcb('0x5b')]]})[_0x2bcb('0x21')](handleEntityNotFound(_0x180e81,null))['then'](respondWithResult(_0x180e81,null))[_0x2bcb('0x40')](handleError(_0x180e81,null));};exports[_0x2bcb('0x5c')]=function(_0x31a8a1,_0xfff51b,_0x118d5a){return db[_0x2bcb('0x5d')][_0x2bcb('0x44')]({'where':{'id':_0x31a8a1[_0x2bcb('0x42')]['id']}})[_0x2bcb('0x21')](handleEntityNotFound(_0xfff51b,null))['then'](function(_0x1b3ac5){var _0x24c3e7;if(_0x1b3ac5){_0x24c3e7=squel[_0x2bcb('0x5e')]()[_0x2bcb('0x5f')]('cm_hopper')[_0x2bcb('0x60')](['phone','scheduledAt',_0x2bcb('0x61'),_0x2bcb('0x62'),_0x2bcb('0x63'),_0x2bcb('0x64'),'updatedAt'],squel[_0x2bcb('0x65')]()[_0x2bcb('0x66')](_0x2bcb('0x67'),_0x2bcb('0x68'))[_0x2bcb('0x66')](_0x2bcb('0x69'),_0x2bcb('0x6a'))[_0x2bcb('0x66')](_0x2bcb('0x6b'),'ContactId')['field']('ANY_VALUE(ListId)',_0x2bcb('0x62'))['field']('ANY_VALUE(VoiceQueueId)',_0x2bcb('0x63'))[_0x2bcb('0x66')](_0x2bcb('0x69'),_0x2bcb('0x64'))[_0x2bcb('0x66')](_0x2bcb('0x69'),_0x2bcb('0x6c'))['from'](_0x2bcb('0x6d'))[_0x2bcb('0x36')](_0x2bcb('0x6e'),_0x31a8a1[_0x2bcb('0x42')]['id'][_0x2bcb('0x6f')]())['where'](_0x2bcb('0x70'),_0x31a8a1['body']['state'][_0x2bcb('0x6f')]())['where'](_0x2bcb('0x71'))[_0x2bcb('0x36')](_0x2bcb('0x72'),squel[_0x2bcb('0x65')]()[_0x2bcb('0x66')](_0x2bcb('0x68'))[_0x2bcb('0x73')]('cm_hopper')[_0x2bcb('0x36')]('VoiceQueueId\x20=\x20?',_0x31a8a1[_0x2bcb('0x42')]['id'][_0x2bcb('0x6f')]()))[_0x2bcb('0x36')](_0x2bcb('0x72'),squel[_0x2bcb('0x65')]()[_0x2bcb('0x66')](_0x2bcb('0x74'))[_0x2bcb('0x73')](_0x2bcb('0x6d'))['where'](_0x2bcb('0x6e'),_0x31a8a1[_0x2bcb('0x42')]['id'][_0x2bcb('0x6f')]())[_0x2bcb('0x36')]('state\x20=\x204'))[_0x2bcb('0x75')](_0x2bcb('0x61')))['toString']();return db['sequelize'][_0x2bcb('0x2b')](_0x24c3e7);}return[];})[_0x2bcb('0x21')](respondWithResult(_0xfff51b,null))[_0x2bcb('0x40')](handleError(_0xfff51b,null));};exports[_0x2bcb('0x76')]=function(_0x111dbe,_0x1a58e6,_0x1db966){return db['Campaign'][_0x2bcb('0x44')]({'where':{'id':_0x111dbe['params']['id']}})[_0x2bcb('0x21')](handleEntityNotFound(_0x1a58e6,null))[_0x2bcb('0x21')](function(_0x20dfad){var _0x535860;if(_0x20dfad){_0x535860=squel[_0x2bcb('0x5e')]()['into'](_0x2bcb('0x77'))[_0x2bcb('0x60')]([_0x2bcb('0x68'),_0x2bcb('0x6a'),_0x2bcb('0x61'),_0x2bcb('0x62'),_0x2bcb('0x78'),_0x2bcb('0x64'),'updatedAt'],squel[_0x2bcb('0x65')]()['field']('ANY_VALUE(calleridnum)',_0x2bcb('0x68'))['field'](_0x2bcb('0x69'),_0x2bcb('0x6a'))[_0x2bcb('0x66')](_0x2bcb('0x6b'),_0x2bcb('0x61'))[_0x2bcb('0x66')](_0x2bcb('0x79'),'ListId')['field'](_0x2bcb('0x7a'),_0x2bcb('0x78'))[_0x2bcb('0x66')](_0x2bcb('0x69'),'createdAt')[_0x2bcb('0x66')]('NOW()',_0x2bcb('0x6c'))[_0x2bcb('0x73')](_0x2bcb('0x6d'))[_0x2bcb('0x36')](_0x2bcb('0x7b'),_0x111dbe['params']['id'][_0x2bcb('0x6f')]())[_0x2bcb('0x36')](_0x2bcb('0x70'),_0x111dbe[_0x2bcb('0x48')][_0x2bcb('0x7c')][_0x2bcb('0x6f')]())[_0x2bcb('0x36')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0x2bcb('0x72'),squel[_0x2bcb('0x65')]()[_0x2bcb('0x66')](_0x2bcb('0x68'))[_0x2bcb('0x73')]('cm_hopper')[_0x2bcb('0x36')]('CampaignId\x20=\x20?',_0x111dbe['params']['id'][_0x2bcb('0x6f')]()))[_0x2bcb('0x36')](_0x2bcb('0x72'),squel[_0x2bcb('0x65')]()[_0x2bcb('0x66')]('calleridnum')['from'](_0x2bcb('0x6d'))[_0x2bcb('0x36')]('CampaignId\x20=\x20?',_0x111dbe[_0x2bcb('0x42')]['id'][_0x2bcb('0x6f')]())[_0x2bcb('0x36')](_0x2bcb('0x7d')))[_0x2bcb('0x75')]('ContactId'))[_0x2bcb('0x6f')]();return db[_0x2bcb('0x49')]['query'](_0x535860);}return[];})['then'](respondWithResult(_0x1a58e6,null))[_0x2bcb('0x40')](handleError(_0x1a58e6,null));};exports[_0x2bcb('0x7e')]=function(_0x17371d,_0x17fe3b,_0x4016a2){return db['CmHopper'][_0x2bcb('0x7f')]({'where':{'VoiceQueueId':_0x17371d[_0x2bcb('0x48')][_0x2bcb('0x63')],'CampaignId':_0x17371d[_0x2bcb('0x48')][_0x2bcb('0x78')],'ContactId':_0x17371d['body'][_0x2bcb('0x61')]}})[_0x2bcb('0x21')](handleEntityNotFound(_0x17fe3b,null))[_0x2bcb('0x21')](function(_0x1f5672){if(_0x1f5672){return _0x1f5672;}return null;})['then'](respondWithResult(_0x17fe3b,null))[_0x2bcb('0x40')](handleError(_0x17fe3b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index deeb6b0..8bcf36d 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 _0xf997=['../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','calleridnum','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x1214e6,_0x2cd993){var _0x135467=function(_0x3946c4){while(--_0x3946c4){_0x1214e6['push'](_0x1214e6['shift']());}};_0x135467(++_0x2cd993);}(_0xf997,0xf6));var _0x7f99=function(_0x1c7da3,_0xaeabcc){_0x1c7da3=_0x1c7da3-0x0;var _0x588305=_0xf997[_0x1c7da3];return _0x588305;};'use strict';var _=require(_0x7f99('0x0'));var util=require('util');var logger=require(_0x7f99('0x1'))('api');var moment=require(_0x7f99('0x2'));var BPromise=require(_0x7f99('0x3'));var rp=require(_0x7f99('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f99('0x5'));var config=require(_0x7f99('0x6'));var attributes=require(_0x7f99('0x7'));module['exports']=function(_0x382000,_0x1439ed){return _0x382000[_0x7f99('0x8')](_0x7f99('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x7f99('0xa'),'fields':[_0x7f99('0xa')]},{'name':_0x7f99('0xb'),'fields':[_0x7f99('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x54cc=['calleridnum','uniqueid','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','cm_hopper_final'];(function(_0x502e15,_0x49ff8f){var _0xadd0c4=function(_0xa1776){while(--_0xa1776){_0x502e15['push'](_0x502e15['shift']());}};_0xadd0c4(++_0x49ff8f);}(_0x54cc,0x1be));var _0xc54c=function(_0x103018,_0x25dfbe){_0x103018=_0x103018-0x0;var _0x45f364=_0x54cc[_0x103018];return _0x45f364;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc54c('0x0'))(_0xc54c('0x1'));var moment=require('moment');var BPromise=require(_0xc54c('0x2'));var rp=require(_0xc54c('0x3'));var fs=require('fs');var path=require(_0xc54c('0x4'));var rimraf=require(_0xc54c('0x5'));var config=require(_0xc54c('0x6'));var attributes=require('./cmHopperFinal.attributes');module[_0xc54c('0x7')]=function(_0x174da1,_0x14d074){return _0x174da1[_0xc54c('0x8')]('CmHopperFinal',attributes,{'tableName':_0xc54c('0x9'),'paranoid':![],'indexes':[{'name':_0xc54c('0xa'),'fields':['calleridnum']},{'name':_0xc54c('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index a0b6737..03d5c09 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 _0x99c9=['CmHopperFinal','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperFinal,\x20%s,\x20%s','request\x20sent','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateCmHopperFinal'];(function(_0x26d0ab,_0x2b7a20){var _0x6df651=function(_0x2d13dd){while(--_0x2d13dd){_0x26d0ab['push'](_0x26d0ab['shift']());}};_0x6df651(++_0x2b7a20);}(_0x99c9,0x13c));var _0x999c=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x99c9[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x999c('0x0'));var util=require(_0x999c('0x1'));var moment=require(_0x999c('0x2'));var BPromise=require(_0x999c('0x3'));var rs=require(_0x999c('0x4'));var fs=require('fs');var Redis=require(_0x999c('0x5'));var db=require(_0x999c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x999c('0x7'))(_0x999c('0x8'));var config=require(_0x999c('0x9'));var jayson=require(_0x999c('0xa'));var client=jayson[_0x999c('0xb')][_0x999c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34f100,_0x651b7e,_0xc8a6b5){return new BPromise(function(_0xb88ec1,_0x329252){return client[_0x999c('0xd')](_0x34f100,_0xc8a6b5)[_0x999c('0xe')](function(_0x395321){logger['info'](_0x999c('0xf'),_0x651b7e,_0x999c('0x10'));logger['debug'](_0x999c('0x11'),_0x651b7e,_0x999c('0x10'),JSON[_0x999c('0x12')](_0x395321));if(_0x395321[_0x999c('0x13')]){if(_0x395321[_0x999c('0x13')][_0x999c('0x14')]===0x1f4){logger[_0x999c('0x13')](_0x999c('0xf'),_0x651b7e,_0x395321[_0x999c('0x13')][_0x999c('0x15')]);return _0x329252(_0x395321[_0x999c('0x13')][_0x999c('0x15')]);}logger['error'](_0x999c('0xf'),_0x651b7e,_0x395321[_0x999c('0x13')]['message']);return _0xb88ec1(_0x395321['error']['message']);}else{logger[_0x999c('0x16')](_0x999c('0xf'),_0x651b7e,_0x999c('0x10'));_0xb88ec1(_0x395321[_0x999c('0x17')][_0x999c('0x15')]);}})['catch'](function(_0x226437){logger[_0x999c('0x13')](_0x999c('0xf'),_0x651b7e,_0x226437);_0x329252(_0x226437);});});}exports[_0x999c('0x18')]=function(_0x110486){var _0x500048=this;return new Promise(function(_0x1b327f,_0x3fb85e){return db[_0x999c('0x19')][_0x999c('0x1a')](_0x110486[_0x999c('0x1b')],{'raw':_0x110486['options']?_0x110486[_0x999c('0x1c')][_0x999c('0x1d')]===undefined?!![]:![]:!![]})[_0x999c('0xe')](function(_0x1ec406){logger[_0x999c('0x16')](_0x999c('0x18'),_0x110486);logger['debug'](_0x999c('0x18'),_0x110486,JSON[_0x999c('0x12')](_0x1ec406));_0x1b327f(_0x1ec406);})[_0x999c('0x1e')](function(_0x2bcfc9){logger[_0x999c('0x13')](_0x999c('0x18'),_0x2bcfc9[_0x999c('0x15')],_0x110486);_0x3fb85e(_0x500048[_0x999c('0x13')](0x1f4,_0x2bcfc9[_0x999c('0x15')]));});});}; \ No newline at end of file +var _0x16ab=['CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','CreateCmHopperFinal','create','body','options','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x58543d,_0x216935){var _0x1166ec=function(_0x4c661a){while(--_0x4c661a){_0x58543d['push'](_0x58543d['shift']());}};_0x1166ec(++_0x216935);}(_0x16ab,0xed));var _0xb16a=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x16ab[_0x616290];return _0x453879;};'use strict';var _=require('lodash');var util=require(_0xb16a('0x0'));var moment=require(_0xb16a('0x1'));var BPromise=require(_0xb16a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb16a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb16a('0x4'));var logger=require(_0xb16a('0x5'))('rpc');var config=require(_0xb16a('0x6'));var jayson=require(_0xb16a('0x7'));var client=jayson[_0xb16a('0x8')][_0xb16a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x115451,_0x24695f,_0x22dbf8){return new BPromise(function(_0x531164,_0x3bf167){return client[_0xb16a('0xa')](_0x115451,_0x22dbf8)[_0xb16a('0xb')](function(_0x4d1d87){logger[_0xb16a('0xc')](_0xb16a('0xd'),_0x24695f,'request\x20sent');logger[_0xb16a('0xe')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x24695f,'request\x20sent',JSON[_0xb16a('0xf')](_0x4d1d87));if(_0x4d1d87[_0xb16a('0x10')]){if(_0x4d1d87[_0xb16a('0x10')][_0xb16a('0x11')]===0x1f4){logger[_0xb16a('0x10')]('CmHopperFinal,\x20%s,\x20%s',_0x24695f,_0x4d1d87[_0xb16a('0x10')][_0xb16a('0x12')]);return _0x3bf167(_0x4d1d87[_0xb16a('0x10')]['message']);}logger[_0xb16a('0x10')](_0xb16a('0xd'),_0x24695f,_0x4d1d87[_0xb16a('0x10')][_0xb16a('0x12')]);return _0x531164(_0x4d1d87['error'][_0xb16a('0x12')]);}else{logger[_0xb16a('0xc')](_0xb16a('0xd'),_0x24695f,_0xb16a('0x13'));_0x531164(_0x4d1d87['result'][_0xb16a('0x12')]);}})[_0xb16a('0x14')](function(_0x19b926){logger['error'](_0xb16a('0xd'),_0x24695f,_0x19b926);_0x3bf167(_0x19b926);});});}exports[_0xb16a('0x15')]=function(_0x4b91af){var _0x434e41=this;return new Promise(function(_0x506608,_0x115cbc){return db['CmHopperFinal'][_0xb16a('0x16')](_0x4b91af[_0xb16a('0x17')],{'raw':_0x4b91af['options']?_0x4b91af[_0xb16a('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xb16a('0xb')](function(_0xdb8399){logger['info']('CreateCmHopperFinal',_0x4b91af);logger[_0xb16a('0xe')](_0xb16a('0x15'),_0x4b91af,JSON[_0xb16a('0xf')](_0xdb8399));_0x506608(_0xdb8399);})[_0xb16a('0x14')](function(_0x58c169){logger[_0xb16a('0x10')](_0xb16a('0x15'),_0x58c169[_0xb16a('0x12')],_0x4b91af);_0x115cbc(_0x434e41[_0xb16a('0x10')](0x1f4,_0x58c169['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index cb096ce..792efe1 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 _0xf63f=['post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','index','/describe','describe','/:id','show','isAuthenticated','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal'];(function(_0x595f98,_0x49a2ab){var _0x370fe3=function(_0x48bd0a){while(--_0x48bd0a){_0x595f98['push'](_0x595f98['shift']());}};_0x370fe3(++_0x49a2ab);}(_0xf63f,0x1e3));var _0xff63=function(_0xff36ad,_0x281bbd){_0xff36ad=_0xff36ad-0x0;var _0x512b4d=_0xf63f[_0xff36ad];return _0x512b4d;};'use strict';var multer=require('multer');var util=require(_0xff63('0x0'));var path=require('path');var timeout=require(_0xff63('0x1'));var express=require(_0xff63('0x2'));var router=express[_0xff63('0x3')]();var auth=require(_0xff63('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xff63('0x5'));var controller=require(_0xff63('0x6'));router[_0xff63('0x7')]('/',auth['isAuthenticated'](),controller[_0xff63('0x8')]);router['get'](_0xff63('0x9'),auth['isAuthenticated'](),controller[_0xff63('0xa')]);router[_0xff63('0x7')](_0xff63('0xb'),auth['isAuthenticated'](),controller[_0xff63('0xc')]);router[_0xff63('0x7')]('/voice/queue/countAttributes/:id',auth[_0xff63('0xd')](),controller[_0xff63('0xe')]);router['get'](_0xff63('0xf'),auth[_0xff63('0xd')](),controller[_0xff63('0x10')]);router[_0xff63('0x11')](_0xff63('0x12'),auth[_0xff63('0xd')](),controller[_0xff63('0x13')]);router[_0xff63('0x11')]('/voice/campaign/moveContacts/:id',auth[_0xff63('0xd')](),controller[_0xff63('0x14')]);router['post'](_0xff63('0x15'),auth[_0xff63('0xd')](),controller[_0xff63('0x16')]);router[_0xff63('0x17')](_0xff63('0xb'),auth[_0xff63('0xd')](),controller[_0xff63('0x18')]);module['exports']=router; \ No newline at end of file +var _0x89a2=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','/:id','update','exports','multer','path','express'];(function(_0x3cdba4,_0x38853d){var _0x5b35bc=function(_0x3d77e7){while(--_0x3d77e7){_0x3cdba4['push'](_0x3cdba4['shift']());}};_0x5b35bc(++_0x38853d);}(_0x89a2,0x14f));var _0x289a=function(_0x358881,_0x1b748c){_0x358881=_0x358881-0x0;var _0x76792d=_0x89a2[_0x358881];return _0x76792d;};'use strict';var multer=require(_0x289a('0x0'));var util=require('util');var path=require(_0x289a('0x1'));var timeout=require('connect-timeout');var express=require(_0x289a('0x2'));var router=express[_0x289a('0x3')]();var auth=require(_0x289a('0x4'));var interaction=require(_0x289a('0x5'));var config=require(_0x289a('0x6'));var controller=require(_0x289a('0x7'));router[_0x289a('0x8')]('/',auth[_0x289a('0x9')](),controller[_0x289a('0xa')]);router[_0x289a('0x8')](_0x289a('0xb'),auth[_0x289a('0x9')](),controller[_0x289a('0xc')]);router[_0x289a('0x8')]('/:id',auth[_0x289a('0x9')](),controller[_0x289a('0xd')]);router['get'](_0x289a('0xe'),auth[_0x289a('0x9')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x289a('0x8')](_0x289a('0xf'),auth[_0x289a('0x9')](),controller[_0x289a('0x10')]);router[_0x289a('0x11')]('/voice/queue/moveContacts/:id',auth[_0x289a('0x9')](),controller[_0x289a('0x12')]);router['post'](_0x289a('0x13'),auth['isAuthenticated'](),controller[_0x289a('0x14')]);router[_0x289a('0x11')]('/checkContactHopper',auth[_0x289a('0x9')](),controller[_0x289a('0x15')]);router[_0x289a('0x16')](_0x289a('0x17'),auth[_0x289a('0x9')](),controller[_0x289a('0x18')]);module[_0x289a('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index de64227..d88748d 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 _0x8fa9=['exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x2d97fa,_0x5b488a){var _0x575d9c=function(_0x168e96){while(--_0x168e96){_0x2d97fa['push'](_0x2d97fa['shift']());}};_0x575d9c(++_0x5b488a);}(_0x8fa9,0x7d));var _0x98fa=function(_0x2cc20d,_0x1a8ecb){_0x2cc20d=_0x2cc20d-0x0;var _0xebf262=_0x8fa9[_0x2cc20d];return _0xebf262;};'use strict';var Sequelize=require('sequelize');module[_0x98fa('0x0')]={'state':{'type':Sequelize[_0x98fa('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x98fa('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x98fa('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x98fa('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x98fa('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x98fa('0x2')]},'originatecalleridname':{'type':Sequelize[_0x98fa('0x2')]},'calleridnum':{'type':Sequelize[_0x98fa('0x2')]},'calleridname':{'type':Sequelize[_0x98fa('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x98fa('0x3')]},'answertime':{'type':Sequelize[_0x98fa('0x3')]},'droptime':{'type':Sequelize[_0x98fa('0x3')]},'endtime':{'type':Sequelize[_0x98fa('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x98fa('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x98fa('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x98fa('0x2')]},'membername':{'type':Sequelize[_0x98fa('0x2')]},'reason':{'type':Sequelize[_0x98fa('0x2')]},'amd':{'type':Sequelize[_0x98fa('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x98fa('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x98fa('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x98fa('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x98fa('0x3')]},'edited':{'type':Sequelize[_0x98fa('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xbba6=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x3b4419,_0x5ebc44){var _0x3f4ea5=function(_0x42c8ea){while(--_0x42c8ea){_0x3b4419['push'](_0x3b4419['shift']());}};_0x3f4ea5(++_0x5ebc44);}(_0xbba6,0x6e));var _0x6bba=function(_0x24865d,_0x201088){_0x24865d=_0x24865d-0x0;var _0x230a4c=_0xbba6[_0x24865d];return _0x230a4c;};'use strict';var Sequelize=require(_0x6bba('0x0'));module[_0x6bba('0x1')]={'state':{'type':Sequelize[_0x6bba('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6bba('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x6bba('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6bba('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6bba('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6bba('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6bba('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x6bba('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6bba('0x3')]},'starttime':{'type':Sequelize[_0x6bba('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x6bba('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x6bba('0x4')]},'ringtime':{'type':Sequelize[_0x6bba('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6bba('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6bba('0x3')]},'campaign':{'type':Sequelize[_0x6bba('0x3')]},'campaigntype':{'type':Sequelize[_0x6bba('0x3')]},'membername':{'type':Sequelize[_0x6bba('0x3')]},'reason':{'type':Sequelize[_0x6bba('0x3')]},'amd':{'type':Sequelize[_0x6bba('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x6bba('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6bba('0x4')]},'recallme':{'type':Sequelize[_0x6bba('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x6bba('0x4')]},'edited':{'type':Sequelize[_0x6bba('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index a4d426e..f169151 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 _0xb65b=['rows','catch','show','params','keys','length','create','body','describe','uniqueid','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','update','then','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb65b,0x1cc));var _0xbb65=function(_0x56ee42,_0x2d97ee){_0x56ee42=_0x56ee42-0x0;var _0x108a44=_0xb65b[_0x56ee42];return _0x108a44;};'use strict';var pdf=require(_0xbb65('0x0'));var emlformat=require(_0xbb65('0x1'));var rimraf=require(_0xbb65('0x2'));var zipdir=require(_0xbb65('0x3'));var jsonpatch=require(_0xbb65('0x4'));var rp=require(_0xbb65('0x5'));var moment=require(_0xbb65('0x6'));var BPromise=require(_0xbb65('0x7'));var Mustache=require('mustache');var util=require(_0xbb65('0x8'));var path=require(_0xbb65('0x9'));var sox=require(_0xbb65('0xa'));var csv=require('to-csv');var ejs=require(_0xbb65('0xb'));var fs=require('fs');var _=require(_0xbb65('0xc'));var squel=require(_0xbb65('0xd'));var crypto=require(_0xbb65('0xe'));var jsforce=require(_0xbb65('0xf'));var deskjs=require(_0xbb65('0x10'));var toCsv=require(_0xbb65('0x11'));var querystring=require(_0xbb65('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbb65('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb65('0x14'));var logger=require(_0xbb65('0x15'))(_0xbb65('0x16'));var utils=require(_0xbb65('0x17'));var config=require('../../config/environment');var db=require(_0xbb65('0x18'))['db'];function respondWithStatusCode(_0x30f56e,_0x5027dd){_0x5027dd=_0x5027dd||0xcc;return function(_0x1d3fee){if(_0x1d3fee){return _0x30f56e[_0xbb65('0x19')](_0x5027dd);}return _0x30f56e[_0xbb65('0x1a')](_0x5027dd)[_0xbb65('0x1b')]();};}function respondWithResult(_0x403909,_0x49fd1c){_0x49fd1c=_0x49fd1c||0xc8;return function(_0x4ba12d){if(_0x4ba12d){return _0x403909[_0xbb65('0x1a')](_0x49fd1c)['json'](_0x4ba12d);}};}function respondWithFilteredResult(_0x42412a,_0x5f54dc){return function(_0x38768e){if(_0x38768e){var _0x10c9f4=_0x38768e[_0xbb65('0x1c')],_0x1fe6c9=_0x5f54dc[_0xbb65('0x1d')],_0x4504c1=_0x5f54dc[_0xbb65('0x1d')]+_0x5f54dc['limit'],_0x54d0a1;if(_0x4504c1>=_0x10c9f4){_0x4504c1=_0x10c9f4;_0x54d0a1=0xc8;}else{_0x54d0a1=0xce;}_0x42412a[_0xbb65('0x1a')](_0x54d0a1);return _0x42412a[_0xbb65('0x1e')](_0xbb65('0x1f'),_0x1fe6c9+'-'+_0x4504c1+'/'+_0x10c9f4)[_0xbb65('0x20')](_0x38768e);}return null;};}function patchUpdates(_0x437fd7){return function(_0x3fdd11){try{jsonpatch['apply'](_0x3fdd11,_0x437fd7,!![]);}catch(_0x54244e){return BPromise[_0xbb65('0x21')](_0x54244e);}return _0x3fdd11[_0xbb65('0x22')]();};}function saveUpdates(_0x547220,_0x1e2b08){return function(_0x9db054){if(_0x9db054){return _0x9db054[_0xbb65('0x23')](_0x547220)[_0xbb65('0x24')](function(_0xc973c1){return _0xc973c1;});}return null;};}function removeEntity(_0x201f7a,_0x568026){return function(_0x14c9cd){if(_0x14c9cd){return _0x14c9cd['destroy']()['then'](function(){_0x201f7a[_0xbb65('0x1a')](0xcc)[_0xbb65('0x1b')]();});}};}function handleEntityNotFound(_0xcd7f6a,_0x3efad5){return function(_0xbf8003){if(!_0xbf8003){_0xcd7f6a[_0xbb65('0x19')](0x194);}return _0xbf8003;};}function handleError(_0x581068,_0x247c66){_0x247c66=_0x247c66||0x1f4;return function(_0x49c7f3){logger[_0xbb65('0x25')](_0x49c7f3[_0xbb65('0x26')]);if(_0x49c7f3[_0xbb65('0x27')]){delete _0x49c7f3[_0xbb65('0x27')];}_0x581068[_0xbb65('0x1a')](_0x247c66)['send'](_0x49c7f3);};}exports[_0xbb65('0x28')]=function(_0x402411,_0x27efcb){var _0x34002d={},_0x1e6542={},_0xa9e464={'count':0x0,'rows':[]};var _0x546057=_[_0xbb65('0x29')](db[_0xbb65('0x2a')][_0xbb65('0x2b')],function(_0x537b3b){return{'name':_0x537b3b[_0xbb65('0x2c')],'type':_0x537b3b[_0xbb65('0x2d')][_0xbb65('0x2e')]};});_0x1e6542[_0xbb65('0x2f')]=_['map'](_0x546057,_0xbb65('0x27'));_0x1e6542[_0xbb65('0x30')]=_['keys'](_0x402411[_0xbb65('0x30')]);_0x1e6542['filters']=_[_0xbb65('0x31')](_0x1e6542[_0xbb65('0x2f')],_0x1e6542[_0xbb65('0x30')]);_0x34002d['attributes']=_[_0xbb65('0x31')](_0x1e6542[_0xbb65('0x2f')],qs['fields'](_0x402411['query'][_0xbb65('0x32')]));_0x34002d[_0xbb65('0x33')]=_0x34002d[_0xbb65('0x33')]['length']?_0x34002d[_0xbb65('0x33')]:_0x1e6542[_0xbb65('0x2f')];if(!_0x402411['query'][_0xbb65('0x34')]('nolimit')){_0x34002d[_0xbb65('0x35')]=qs[_0xbb65('0x35')](_0x402411['query']['limit']);_0x34002d[_0xbb65('0x1d')]=qs[_0xbb65('0x1d')](_0x402411[_0xbb65('0x30')][_0xbb65('0x1d')]);}_0x34002d[_0xbb65('0x36')]=qs[_0xbb65('0x37')](_0x402411[_0xbb65('0x30')][_0xbb65('0x37')]);_0x34002d[_0xbb65('0x38')]=qs[_0xbb65('0x39')](_[_0xbb65('0x3a')](_0x402411[_0xbb65('0x30')],_0x1e6542[_0xbb65('0x39')]));if(_0x402411[_0xbb65('0x30')][_0xbb65('0x3b')]){_0x34002d['where']=_[_0xbb65('0x3c')](_0x34002d[_0xbb65('0x38')],{'$or':_[_0xbb65('0x29')](_0x546057,function(_0xeedf2f){if(_0xeedf2f[_0xbb65('0x2d')]!==_0xbb65('0x3d')){var _0x79b11b={};_0x79b11b[_0xeedf2f['name']]={'$like':'%'+_0x402411[_0xbb65('0x30')][_0xbb65('0x3b')]+'%'};return _0x79b11b;}})});}_0x34002d=_[_0xbb65('0x3c')]({},_0x34002d,_0x402411[_0xbb65('0x3e')]);var _0x2278aa={'where':_0x34002d[_0xbb65('0x38')]};return db[_0xbb65('0x2a')][_0xbb65('0x1c')](_0x2278aa)[_0xbb65('0x24')](function(_0x284589){_0xa9e464[_0xbb65('0x1c')]=_0x284589;if(_0x402411[_0xbb65('0x30')][_0xbb65('0x3f')]){_0x34002d[_0xbb65('0x40')]=[{'all':!![]}];}return db[_0xbb65('0x2a')]['findAll'](_0x34002d);})[_0xbb65('0x24')](function(_0xdb109f){_0xa9e464[_0xbb65('0x41')]=_0xdb109f;return _0xa9e464;})[_0xbb65('0x24')](respondWithFilteredResult(_0x27efcb,_0x34002d))[_0xbb65('0x42')](handleError(_0x27efcb,null));};exports[_0xbb65('0x43')]=function(_0x21a386,_0x49080e){var _0x4dea2a={'raw':!![],'where':{'id':_0x21a386[_0xbb65('0x44')]['id']}},_0x12780b={};_0x12780b[_0xbb65('0x2f')]=_[_0xbb65('0x45')](db[_0xbb65('0x2a')][_0xbb65('0x2b')]);_0x12780b['query']=_[_0xbb65('0x45')](_0x21a386[_0xbb65('0x30')]);_0x12780b[_0xbb65('0x39')]=_[_0xbb65('0x31')](_0x12780b[_0xbb65('0x2f')],_0x12780b[_0xbb65('0x30')]);_0x4dea2a[_0xbb65('0x33')]=_[_0xbb65('0x31')](_0x12780b[_0xbb65('0x2f')],qs[_0xbb65('0x32')](_0x21a386[_0xbb65('0x30')][_0xbb65('0x32')]));_0x4dea2a[_0xbb65('0x33')]=_0x4dea2a[_0xbb65('0x33')][_0xbb65('0x46')]?_0x4dea2a[_0xbb65('0x33')]:_0x12780b[_0xbb65('0x2f')];if(_0x21a386[_0xbb65('0x30')][_0xbb65('0x3f')]){_0x4dea2a[_0xbb65('0x40')]=[{'all':!![]}];}_0x4dea2a=_[_0xbb65('0x3c')]({},_0x4dea2a,_0x21a386[_0xbb65('0x3e')]);return db['CmHopperHistory']['find'](_0x4dea2a)[_0xbb65('0x24')](handleEntityNotFound(_0x49080e,null))[_0xbb65('0x24')](respondWithResult(_0x49080e,null))[_0xbb65('0x42')](handleError(_0x49080e,null));};exports['create']=function(_0x41ec87,_0x8a01b7){return db['CmHopperHistory'][_0xbb65('0x47')](_0x41ec87[_0xbb65('0x48')],{})[_0xbb65('0x24')](respondWithResult(_0x8a01b7,0xc9))[_0xbb65('0x42')](handleError(_0x8a01b7,null));};exports[_0xbb65('0x49')]=function(_0x5d7911,_0x18838){return db[_0xbb65('0x2a')]['describe']()[_0xbb65('0x24')](respondWithResult(_0x18838,null))[_0xbb65('0x42')](handleError(_0x18838,null));};exports[_0xbb65('0x23')]=function(_0x307d26,_0x160012){if(_0x307d26[_0xbb65('0x48')][_0xbb65('0x4a')]){delete _0x307d26[_0xbb65('0x48')][_0xbb65('0x4a')];}return db[_0xbb65('0x2a')]['find']({'where':{'uniqueid':_0x307d26[_0xbb65('0x44')]['id']}})[_0xbb65('0x24')](handleEntityNotFound(_0x160012,null))['then'](saveUpdates(_0x307d26['body'],null))[_0xbb65('0x24')](respondWithResult(_0x160012,null))[_0xbb65('0x42')](handleError(_0x160012,null));}; \ No newline at end of file +var _0x2edd=['stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','describe','uniqueid','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','save','then','destroy','error'];(function(_0x25211d,_0x303f2f){var _0xb2a108=function(_0x452629){while(--_0x452629){_0x25211d['push'](_0x25211d['shift']());}};_0xb2a108(++_0x303f2f);}(_0x2edd,0x198));var _0xd2ed=function(_0x351260,_0x5204f0){_0x351260=_0x351260-0x0;var _0x8850d0=_0x2edd[_0x351260];return _0x8850d0;};'use strict';var pdf=require(_0xd2ed('0x0'));var emlformat=require(_0xd2ed('0x1'));var rimraf=require(_0xd2ed('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd2ed('0x3'));var moment=require('moment');var BPromise=require(_0xd2ed('0x4'));var Mustache=require(_0xd2ed('0x5'));var util=require(_0xd2ed('0x6'));var path=require(_0xd2ed('0x7'));var sox=require(_0xd2ed('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xd2ed('0x9'));var squel=require(_0xd2ed('0xa'));var crypto=require(_0xd2ed('0xb'));var jsforce=require(_0xd2ed('0xc'));var deskjs=require(_0xd2ed('0xd'));var toCsv=require(_0xd2ed('0xe'));var querystring=require('querystring');var Papa=require(_0xd2ed('0xf'));var Redis=require(_0xd2ed('0x10'));var authService=require(_0xd2ed('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd2ed('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd2ed('0x13'));var utils=require(_0xd2ed('0x14'));var config=require(_0xd2ed('0x15'));var db=require(_0xd2ed('0x16'))['db'];function respondWithStatusCode(_0x1560ff,_0x595847){_0x595847=_0x595847||0xcc;return function(_0x47efaf){if(_0x47efaf){return _0x1560ff[_0xd2ed('0x17')](_0x595847);}return _0x1560ff[_0xd2ed('0x18')](_0x595847)[_0xd2ed('0x19')]();};}function respondWithResult(_0x133961,_0x23053f){_0x23053f=_0x23053f||0xc8;return function(_0xdbba25){if(_0xdbba25){return _0x133961[_0xd2ed('0x18')](_0x23053f)['json'](_0xdbba25);}};}function respondWithFilteredResult(_0x30eda5,_0x292d3c){return function(_0x14a0ee){if(_0x14a0ee){var _0x5ae2b8=_0x14a0ee[_0xd2ed('0x1a')],_0x25101d=_0x292d3c[_0xd2ed('0x1b')],_0x31c2da=_0x292d3c[_0xd2ed('0x1b')]+_0x292d3c[_0xd2ed('0x1c')],_0x5eba52;if(_0x31c2da>=_0x5ae2b8){_0x31c2da=_0x5ae2b8;_0x5eba52=0xc8;}else{_0x5eba52=0xce;}_0x30eda5[_0xd2ed('0x18')](_0x5eba52);return _0x30eda5['set'](_0xd2ed('0x1d'),_0x25101d+'-'+_0x31c2da+'/'+_0x5ae2b8)['json'](_0x14a0ee);}return null;};}function patchUpdates(_0x41089b){return function(_0x11a161){try{jsonpatch[_0xd2ed('0x1e')](_0x11a161,_0x41089b,!![]);}catch(_0x288333){return BPromise[_0xd2ed('0x1f')](_0x288333);}return _0x11a161[_0xd2ed('0x20')]();};}function saveUpdates(_0x379207,_0x5a048c){return function(_0xba58a2){if(_0xba58a2){return _0xba58a2['update'](_0x379207)[_0xd2ed('0x21')](function(_0x237c26){return _0x237c26;});}return null;};}function removeEntity(_0x3193a0,_0x38e0d4){return function(_0x46ecb4){if(_0x46ecb4){return _0x46ecb4[_0xd2ed('0x22')]()[_0xd2ed('0x21')](function(){_0x3193a0[_0xd2ed('0x18')](0xcc)[_0xd2ed('0x19')]();});}};}function handleEntityNotFound(_0x3dca21,_0x2bed69){return function(_0x321125){if(!_0x321125){_0x3dca21['sendStatus'](0x194);}return _0x321125;};}function handleError(_0x27250c,_0x1c06c2){_0x1c06c2=_0x1c06c2||0x1f4;return function(_0x48323d){logger[_0xd2ed('0x23')](_0x48323d[_0xd2ed('0x24')]);if(_0x48323d[_0xd2ed('0x25')]){delete _0x48323d['name'];}_0x27250c[_0xd2ed('0x18')](_0x1c06c2)[_0xd2ed('0x26')](_0x48323d);};}exports[_0xd2ed('0x27')]=function(_0x532163,_0x86186f){var _0x4f2d6a={},_0x344039={},_0x1e0a9d={'count':0x0,'rows':[]};var _0x224a13=_[_0xd2ed('0x28')](db[_0xd2ed('0x29')][_0xd2ed('0x2a')],function(_0x3d95a6){return{'name':_0x3d95a6[_0xd2ed('0x2b')],'type':_0x3d95a6[_0xd2ed('0x2c')][_0xd2ed('0x2d')]};});_0x344039[_0xd2ed('0x2e')]=_[_0xd2ed('0x28')](_0x224a13,_0xd2ed('0x25'));_0x344039[_0xd2ed('0x2f')]=_['keys'](_0x532163[_0xd2ed('0x2f')]);_0x344039[_0xd2ed('0x30')]=_['intersection'](_0x344039[_0xd2ed('0x2e')],_0x344039[_0xd2ed('0x2f')]);_0x4f2d6a['attributes']=_[_0xd2ed('0x31')](_0x344039[_0xd2ed('0x2e')],qs[_0xd2ed('0x32')](_0x532163[_0xd2ed('0x2f')]['fields']));_0x4f2d6a[_0xd2ed('0x33')]=_0x4f2d6a[_0xd2ed('0x33')][_0xd2ed('0x34')]?_0x4f2d6a[_0xd2ed('0x33')]:_0x344039[_0xd2ed('0x2e')];if(!_0x532163[_0xd2ed('0x2f')][_0xd2ed('0x35')]('nolimit')){_0x4f2d6a['limit']=qs[_0xd2ed('0x1c')](_0x532163[_0xd2ed('0x2f')][_0xd2ed('0x1c')]);_0x4f2d6a[_0xd2ed('0x1b')]=qs['offset'](_0x532163[_0xd2ed('0x2f')][_0xd2ed('0x1b')]);}_0x4f2d6a[_0xd2ed('0x36')]=qs[_0xd2ed('0x37')](_0x532163['query'][_0xd2ed('0x37')]);_0x4f2d6a[_0xd2ed('0x38')]=qs[_0xd2ed('0x30')](_[_0xd2ed('0x39')](_0x532163[_0xd2ed('0x2f')],_0x344039[_0xd2ed('0x30')]));if(_0x532163[_0xd2ed('0x2f')][_0xd2ed('0x3a')]){_0x4f2d6a['where']=_[_0xd2ed('0x3b')](_0x4f2d6a['where'],{'$or':_['map'](_0x224a13,function(_0x3e5c28){if(_0x3e5c28['type']!=='VIRTUAL'){var _0x1168fe={};_0x1168fe[_0x3e5c28[_0xd2ed('0x25')]]={'$like':'%'+_0x532163[_0xd2ed('0x2f')][_0xd2ed('0x3a')]+'%'};return _0x1168fe;}})});}_0x4f2d6a=_[_0xd2ed('0x3b')]({},_0x4f2d6a,_0x532163['options']);var _0x1344fa={'where':_0x4f2d6a[_0xd2ed('0x38')]};return db[_0xd2ed('0x29')][_0xd2ed('0x1a')](_0x1344fa)['then'](function(_0x451b45){_0x1e0a9d['count']=_0x451b45;if(_0x532163[_0xd2ed('0x2f')][_0xd2ed('0x3c')]){_0x4f2d6a[_0xd2ed('0x3d')]=[{'all':!![]}];}return db[_0xd2ed('0x29')][_0xd2ed('0x3e')](_0x4f2d6a);})[_0xd2ed('0x21')](function(_0x817d5f){_0x1e0a9d[_0xd2ed('0x3f')]=_0x817d5f;return _0x1e0a9d;})[_0xd2ed('0x21')](respondWithFilteredResult(_0x86186f,_0x4f2d6a))[_0xd2ed('0x40')](handleError(_0x86186f,null));};exports[_0xd2ed('0x41')]=function(_0x46eb9e,_0x1e640c){var _0x2d2ea3={'raw':!![],'where':{'id':_0x46eb9e[_0xd2ed('0x42')]['id']}},_0x44a1e9={};_0x44a1e9[_0xd2ed('0x2e')]=_[_0xd2ed('0x43')](db[_0xd2ed('0x29')][_0xd2ed('0x2a')]);_0x44a1e9[_0xd2ed('0x2f')]=_[_0xd2ed('0x43')](_0x46eb9e[_0xd2ed('0x2f')]);_0x44a1e9[_0xd2ed('0x30')]=_[_0xd2ed('0x31')](_0x44a1e9[_0xd2ed('0x2e')],_0x44a1e9[_0xd2ed('0x2f')]);_0x2d2ea3[_0xd2ed('0x33')]=_[_0xd2ed('0x31')](_0x44a1e9['model'],qs[_0xd2ed('0x32')](_0x46eb9e[_0xd2ed('0x2f')][_0xd2ed('0x32')]));_0x2d2ea3[_0xd2ed('0x33')]=_0x2d2ea3[_0xd2ed('0x33')][_0xd2ed('0x34')]?_0x2d2ea3[_0xd2ed('0x33')]:_0x44a1e9['model'];if(_0x46eb9e[_0xd2ed('0x2f')]['includeAll']){_0x2d2ea3[_0xd2ed('0x3d')]=[{'all':!![]}];}_0x2d2ea3=_['merge']({},_0x2d2ea3,_0x46eb9e[_0xd2ed('0x44')]);return db[_0xd2ed('0x29')]['find'](_0x2d2ea3)[_0xd2ed('0x21')](handleEntityNotFound(_0x1e640c,null))[_0xd2ed('0x21')](respondWithResult(_0x1e640c,null))[_0xd2ed('0x40')](handleError(_0x1e640c,null));};exports[_0xd2ed('0x45')]=function(_0x37da80,_0x584912){return db[_0xd2ed('0x29')][_0xd2ed('0x45')](_0x37da80[_0xd2ed('0x46')],{})[_0xd2ed('0x21')](respondWithResult(_0x584912,0xc9))[_0xd2ed('0x40')](handleError(_0x584912,null));};exports[_0xd2ed('0x47')]=function(_0x1634e8,_0x11f6fd){return db[_0xd2ed('0x29')][_0xd2ed('0x47')]()[_0xd2ed('0x21')](respondWithResult(_0x11f6fd,null))['catch'](handleError(_0x11f6fd,null));};exports['update']=function(_0x299ed7,_0x2c9d9c){if(_0x299ed7[_0xd2ed('0x46')][_0xd2ed('0x48')]){delete _0x299ed7[_0xd2ed('0x46')][_0xd2ed('0x48')];}return db[_0xd2ed('0x29')][_0xd2ed('0x49')]({'where':{'uniqueid':_0x299ed7['params']['id']}})[_0xd2ed('0x21')](handleEntityNotFound(_0x2c9d9c,null))[_0xd2ed('0x21')](saveUpdates(_0x299ed7[_0xd2ed('0x46')],null))[_0xd2ed('0x21')](respondWithResult(_0x2c9d9c,null))['catch'](handleError(_0x2c9d9c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index e8a7bb4..7806490 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 _0xcff2=['exports','CmHopperHistory','endtime','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./cmHopperHistory.attributes'];(function(_0x57516d,_0x98bf20){var _0x1fe2dc=function(_0x189bb6){while(--_0x189bb6){_0x57516d['push'](_0x57516d['shift']());}};_0x1fe2dc(++_0x98bf20);}(_0xcff2,0x1f0));var _0x2cff=function(_0x1bb812,_0x23eacc){_0x1bb812=_0x1bb812-0x0;var _0x372adb=_0xcff2[_0x1bb812];return _0x372adb;};'use strict';var _=require(_0x2cff('0x0'));var util=require(_0x2cff('0x1'));var logger=require(_0x2cff('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2cff('0x3'));var rp=require(_0x2cff('0x4'));var fs=require('fs');var path=require(_0x2cff('0x5'));var rimraf=require('rimraf');var config=require(_0x2cff('0x6'));var attributes=require(_0x2cff('0x7'));module[_0x2cff('0x8')]=function(_0x3b9209,_0x559c81){return _0x3b9209['define'](_0x2cff('0x9'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x2cff('0xa'),'fields':[_0x2cff('0xa')]},{'name':'uniqueid','fields':[_0x2cff('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x64b7=['uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64b7,0xe1));var _0x764b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x64b7[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x764b('0x0'));var util=require('util');var logger=require(_0x764b('0x1'))(_0x764b('0x2'));var moment=require(_0x764b('0x3'));var BPromise=require(_0x764b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x764b('0x5'));var rimraf=require(_0x764b('0x6'));var config=require(_0x764b('0x7'));var attributes=require(_0x764b('0x8'));module[_0x764b('0x9')]=function(_0x27d6b6,_0x4865c6){return _0x27d6b6['define'](_0x764b('0xa'),attributes,{'tableName':_0x764b('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x764b('0xc')]},{'name':_0x764b('0xd'),'fields':[_0x764b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 183971d..4203fe0 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 _0x5eb8=['raw','then','CreateCmHopperHistory','stringify','AvgHandleTime','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','findAll','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','catch','CmHopperHistory','create','body','options'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0x5eb8,0xb0));var _0x85eb=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0x5eb8[_0x35fb56];return _0x2fd52c;};'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')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['CreateCmHopperHistory']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')](_0x50d2a8[_0x85eb('0x17')],{'raw':_0x50d2a8['options']?_0x50d2a8[_0x85eb('0x18')][_0x85eb('0x19')]===undefined?!![]:![]:!![]})[_0x85eb('0x1a')](function(_0x4e8041){logger['info']('CreateCmHopperHistory',_0x50d2a8);logger['debug'](_0x85eb('0x1b'),_0x50d2a8,JSON[_0x85eb('0x1c')](_0x4e8041));_0x39ca96(_0x4e8041);})[_0x85eb('0x14')](function(_0x255ca7){logger[_0x85eb('0x12')](_0x85eb('0x1b'),_0x255ca7['message'],_0x50d2a8);_0x10cf2f(_0xe198ca['error'](0x1f4,_0x255ca7['message']));});});};exports[_0x85eb('0x1d')]=function(_0x1426c8){var _0x3f7a4d=this;return new Promise(function(_0x28b87d,_0x312b3e){return db[_0x85eb('0x15')]['findAll']({'raw':_0x1426c8[_0x85eb('0x18')]?_0x1426c8[_0x85eb('0x18')][_0x85eb('0x19')]===undefined?!![]:![]:!![],'where':_0x1426c8[_0x85eb('0x18')]?_0x1426c8[_0x85eb('0x18')]['where']||null:null,'attributes':[[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')][_0x85eb('0x20')]('id')),_0x85eb('0x21')],[db[_0x85eb('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x24')))),_0x85eb('0x25')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x26'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x27')))),_0x85eb('0x28')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x26'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x29')))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x340745){logger[_0x85eb('0xd')](_0x85eb('0x1d'),_0x1426c8);logger[_0x85eb('0x10')](_0x85eb('0x1d'),_0x1426c8,JSON[_0x85eb('0x1c')](_0x340745));_0x28b87d(_0x340745);})[_0x85eb('0x14')](function(_0x35f092){logger[_0x85eb('0x12')](_0x85eb('0x1d'),_0x35f092[_0x85eb('0x13')],_0x1426c8);_0x312b3e(_0x3f7a4d[_0x85eb('0x12')](0x1f4,_0x35f092[_0x85eb('0x13')]));});});};exports[_0x85eb('0x2a')]=function(_0x4b69a7){var _0x4361e2=this;return new Promise(function(_0x3dfe74,_0x58f091){return db['CmHopperHistory'][_0x85eb('0x2b')]({'raw':_0x4b69a7[_0x85eb('0x18')]?_0x4b69a7['options'][_0x85eb('0x19')]===undefined?!![]:![]:!![],'where':_0x4b69a7['options']?_0x4b69a7[_0x85eb('0x18')]['where']||null:null,'attributes':[[_0x85eb('0x2c'),'name'],[db[_0x85eb('0x1e')]['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x2d')))),'outboundNoSuchCallsDay'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db['sequelize']['fn']('IF',db[_0x85eb('0x1e')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x85eb('0x2e')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x85eb('0x22')))),_0x85eb('0x2f')],[db['sequelize']['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x30')))),_0x85eb('0x31')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x32')))),_0x85eb('0x33')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x34')))),'outboundDropCallsDayTimeout'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x35')))),'outboundDropCallsDayCallersExit'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x36')))),_0x85eb('0x37')],[db[_0x85eb('0x1e')]['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x38')))),_0x85eb('0x39')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x3a')))),_0x85eb('0x3b')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x3c')))),_0x85eb('0x3d')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x3e')))),_0x85eb('0x3f')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x85eb('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x40')))),'outboundReCallsDay']],'group':['campaign']})[_0x85eb('0x1a')](function(_0x249511){logger[_0x85eb('0xd')](_0x85eb('0x2a'),_0x4b69a7);logger[_0x85eb('0x10')]('GetVoiceQueueHopperHistory',_0x4b69a7,JSON[_0x85eb('0x1c')](_0x249511));_0x3dfe74(_0x249511);})[_0x85eb('0x14')](function(_0x270bb2){logger[_0x85eb('0x12')](_0x85eb('0x2a'),_0x270bb2['message'],_0x4b69a7);_0x58f091(_0x4361e2[_0x85eb('0x12')](0x1f4,_0x270bb2['message']));});});};exports[_0x85eb('0x41')]=function(_0x40d846){var _0x4ee529=this;return new Promise(function(_0x341ddb,_0xd04f24){return db[_0x85eb('0x15')][_0x85eb('0x2b')]({'raw':_0x40d846[_0x85eb('0x18')]?_0x40d846[_0x85eb('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x40d846[_0x85eb('0x18')]?_0x40d846['options'][_0x85eb('0x42')]||null:null,'attributes':[[_0x85eb('0x2c'),'name'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db['sequelize'][_0x85eb('0x20')]('id')),'ivrTotalCallsDays'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x22')))),'ivrAnswerCallsDay']],'group':[_0x85eb('0x2c')]})[_0x85eb('0x1a')](function(_0x1d3204){logger[_0x85eb('0xd')](_0x85eb('0x41'),_0x40d846);logger[_0x85eb('0x10')](_0x85eb('0x41'),_0x40d846,JSON[_0x85eb('0x1c')](_0x1d3204));_0x341ddb(_0x1d3204);})[_0x85eb('0x14')](function(_0x13cc2a){logger[_0x85eb('0x12')]('GetCampaignHopperHistory',_0x13cc2a[_0x85eb('0x13')],_0x40d846);_0xd04f24(_0x4ee529[_0x85eb('0x12')](0x1f4,_0x13cc2a[_0x85eb('0x13')]));});});}; \ No newline at end of file +var _0x1339=['predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','ivrAnswerCallsDay','GetCampaignHopperHistory','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopperHistory','create','options','raw','debug','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null'];(function(_0x44eb21,_0x31aab0){var _0x179f3b=function(_0x2ed51b){while(--_0x2ed51b){_0x44eb21['push'](_0x44eb21['shift']());}};_0x179f3b(++_0x31aab0);}(_0x1339,0x1ed));var _0x9133=function(_0x40e464,_0x49c867){_0x40e464=_0x40e464-0x0;var _0x380314=_0x1339[_0x40e464];return _0x380314;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9133('0x0'));var BPromise=require(_0x9133('0x1'));var rs=require(_0x9133('0x2'));var fs=require('fs');var Redis=require(_0x9133('0x3'));var db=require(_0x9133('0x4'))['db'];var utils=require(_0x9133('0x5'));var logger=require(_0x9133('0x6'))(_0x9133('0x7'));var config=require('../../config/environment');var jayson=require(_0x9133('0x8'));var client=jayson[_0x9133('0x9')][_0x9133('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539af6,_0x2758e2,_0x334dcd){return new BPromise(function(_0x3059c4,_0x431a55){return client[_0x9133('0xb')](_0x539af6,_0x334dcd)[_0x9133('0xc')](function(_0x4294b7){logger[_0x9133('0xd')](_0x9133('0xe'),_0x2758e2,_0x9133('0xf'));logger['debug'](_0x9133('0x10'),_0x2758e2,_0x9133('0xf'),JSON[_0x9133('0x11')](_0x4294b7));if(_0x4294b7[_0x9133('0x12')]){if(_0x4294b7[_0x9133('0x12')][_0x9133('0x13')]===0x1f4){logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')]['message']);return _0x431a55(_0x4294b7['error'][_0x9133('0x14')]);}logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);return _0x3059c4(_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);}else{logger[_0x9133('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x2758e2,_0x9133('0xf'));_0x3059c4(_0x4294b7[_0x9133('0x15')]['message']);}})[_0x9133('0x16')](function(_0xa46eb1){logger[_0x9133('0x12')](_0x9133('0xe'),_0x2758e2,_0xa46eb1);_0x431a55(_0xa46eb1);});});}exports['CreateCmHopperHistory']=function(_0x1f3484){var _0x573998=this;return new Promise(function(_0x3c48ef,_0x5d4a77){return db[_0x9133('0x17')][_0x9133('0x18')](_0x1f3484['body'],{'raw':_0x1f3484[_0x9133('0x19')]?_0x1f3484['options'][_0x9133('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5e4f0c){logger[_0x9133('0xd')]('CreateCmHopperHistory',_0x1f3484);logger[_0x9133('0x1b')]('CreateCmHopperHistory',_0x1f3484,JSON['stringify'](_0x5e4f0c));_0x3c48ef(_0x5e4f0c);})['catch'](function(_0x2e99a1){logger[_0x9133('0x12')]('CreateCmHopperHistory',_0x2e99a1[_0x9133('0x14')],_0x1f3484);_0x5d4a77(_0x573998[_0x9133('0x12')](0x1f4,_0x2e99a1[_0x9133('0x14')]));});});};exports[_0x9133('0x1c')]=function(_0x4f26e8){var _0xdb7a98=this;return new Promise(function(_0x5c4614,_0x187e32){return db[_0x9133('0x17')][_0x9133('0x1d')]({'raw':_0x4f26e8[_0x9133('0x19')]?_0x4f26e8[_0x9133('0x19')][_0x9133('0x1a')]===undefined?!![]:![]:!![],'where':_0x4f26e8[_0x9133('0x19')]?_0x4f26e8[_0x9133('0x19')][_0x9133('0x1e')]||null:null,'attributes':[[db[_0x9133('0x1f')]['fn']('COUNT',db['sequelize'][_0x9133('0x20')]('id')),_0x9133('0x21')],[db[_0x9133('0x1f')]['fn'](_0x9133('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x9133('0x23')](_0x9133('0x24')))),_0x9133('0x25')],[db[_0x9133('0x1f')]['fn'](_0x9133('0x22'),db[_0x9133('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0x9133('0x26')],[db['sequelize']['fn'](_0x9133('0x22'),db[_0x9133('0x1f')]['fn']('IF',db['sequelize'][_0x9133('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),_0x9133('0x27')],[db[_0x9133('0x1f')]['fn'](_0x9133('0x28'),db['sequelize']['fn']('IF',db[_0x9133('0x1f')][_0x9133('0x23')](_0x9133('0x29')))),'predictiveIntervalAvgHoldtime'],[db[_0x9133('0x1f')]['fn'](_0x9133('0x28'),db[_0x9133('0x1f')]['fn']('IF',db['sequelize'][_0x9133('0x23')](_0x9133('0x2a')))),_0x9133('0x2b')]]})[_0x9133('0xc')](function(_0x5e4d5e){logger[_0x9133('0xd')](_0x9133('0x1c'),_0x4f26e8);logger['debug'](_0x9133('0x1c'),_0x4f26e8,JSON[_0x9133('0x11')](_0x5e4d5e));_0x5c4614(_0x5e4d5e);})[_0x9133('0x16')](function(_0x2763f3){logger[_0x9133('0x12')](_0x9133('0x1c'),_0x2763f3[_0x9133('0x14')],_0x4f26e8);_0x187e32(_0xdb7a98[_0x9133('0x12')](0x1f4,_0x2763f3[_0x9133('0x14')]));});});};exports[_0x9133('0x2c')]=function(_0x40d92f){var _0x4f3fa6=this;return new Promise(function(_0x17bb4c,_0x2c2e16){return db['CmHopperHistory'][_0x9133('0x1d')]({'raw':_0x40d92f[_0x9133('0x19')]?_0x40d92f[_0x9133('0x19')][_0x9133('0x1a')]===undefined?!![]:![]:!![],'where':_0x40d92f[_0x9133('0x19')]?_0x40d92f[_0x9133('0x19')]['where']||null:null,'attributes':[['campaign',_0x9133('0x2d')],[db[_0x9133('0x1f')]['fn'](_0x9133('0x22'),db[_0x9133('0x1f')]['fn']('IF',db[_0x9133('0x1f')][_0x9133('0x23')](_0x9133('0x2e')))),_0x9133('0x2f')],[db[_0x9133('0x1f')]['fn']('COUNT',db[_0x9133('0x1f')]['fn']('IF',db[_0x9133('0x1f')][_0x9133('0x23')](_0x9133('0x30')))),_0x9133('0x31')],[db['sequelize']['fn'](_0x9133('0x22'),db[_0x9133('0x1f')]['fn']('IF',db[_0x9133('0x1f')][_0x9133('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0x9133('0x32')],[db[_0x9133('0x1f')]['fn'](_0x9133('0x22'),db[_0x9133('0x1f')]['fn']('IF',db[_0x9133('0x1f')][_0x9133('0x23')](_0x9133('0x33')))),'outboundBusyCallsDay'],[db[_0x9133('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9133('0x1f')][_0x9133('0x23')](_0x9133('0x34')))),_0x9133('0x35')],[db[_0x9133('0x1f')]['fn'](_0x9133('0x22'),db[_0x9133('0x1f')]['fn']('IF',db[_0x9133('0x1f')][_0x9133('0x23')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x9133('0x36')],[db[_0x9133('0x1f')]['fn'](_0x9133('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x9133('0x23')](_0x9133('0x37')))),'outboundDropCallsDayCallersExit'],[db[_0x9133('0x1f')]['fn'](_0x9133('0x22'),db[_0x9133('0x1f')]['fn']('IF',db[_0x9133('0x1f')][_0x9133('0x23')]('`state`\x20=\x2012,\x201,\x20null'))),_0x9133('0x38')],[db[_0x9133('0x1f')]['fn'](_0x9133('0x22'),db['sequelize']['fn']('IF',db[_0x9133('0x1f')][_0x9133('0x23')]('`state`\x20=\x2013,\x201,\x20null'))),'outboundBlacklistCallsDay'],[db[_0x9133('0x1f')]['fn'](_0x9133('0x22'),db[_0x9133('0x1f')]['fn']('IF',db[_0x9133('0x1f')][_0x9133('0x23')](_0x9133('0x39')))),_0x9133('0x3a')],[db[_0x9133('0x1f')]['fn'](_0x9133('0x22'),db[_0x9133('0x1f')]['fn']('IF',db[_0x9133('0x1f')][_0x9133('0x23')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x9133('0x1f')]['fn']('COUNT',db[_0x9133('0x1f')]['fn']('IF',db[_0x9133('0x1f')][_0x9133('0x23')](_0x9133('0x3b')))),'outboundAnswerAgiCallsDay'],[db[_0x9133('0x1f')]['fn'](_0x9133('0x22'),db[_0x9133('0x1f')]['fn']('IF',db['sequelize'][_0x9133('0x23')](_0x9133('0x3c')))),_0x9133('0x3d')],[db['sequelize']['fn'](_0x9133('0x22'),db['sequelize']['fn']('IF',db[_0x9133('0x1f')][_0x9133('0x23')](_0x9133('0x3e')))),_0x9133('0x3f')]],'group':['campaign']})['then'](function(_0x2f09f6){logger[_0x9133('0xd')](_0x9133('0x2c'),_0x40d92f);logger[_0x9133('0x1b')](_0x9133('0x2c'),_0x40d92f,JSON['stringify'](_0x2f09f6));_0x17bb4c(_0x2f09f6);})['catch'](function(_0x33599b){logger[_0x9133('0x12')]('GetVoiceQueueHopperHistory',_0x33599b[_0x9133('0x14')],_0x40d92f);_0x2c2e16(_0x4f3fa6[_0x9133('0x12')](0x1f4,_0x33599b['message']));});});};exports['GetCampaignHopperHistory']=function(_0x4a521a){var _0x6d8c71=this;return new Promise(function(_0x537046,_0x12d9e1){return db[_0x9133('0x17')][_0x9133('0x1d')]({'raw':_0x4a521a[_0x9133('0x19')]?_0x4a521a['options'][_0x9133('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a521a['options']?_0x4a521a[_0x9133('0x19')][_0x9133('0x1e')]||null:null,'attributes':[[_0x9133('0x40'),_0x9133('0x2d')],[db[_0x9133('0x1f')]['fn'](_0x9133('0x22'),db['sequelize']['col']('id')),'ivrTotalCallsDays'],[db[_0x9133('0x1f')]['fn'](_0x9133('0x22'),db[_0x9133('0x1f')]['fn']('IF',db['sequelize'][_0x9133('0x23')](_0x9133('0x24')))),_0x9133('0x41')]],'group':[_0x9133('0x40')]})[_0x9133('0xc')](function(_0x356103){logger[_0x9133('0xd')](_0x9133('0x42'),_0x4a521a);logger['debug'](_0x9133('0x42'),_0x4a521a,JSON['stringify'](_0x356103));_0x537046(_0x356103);})[_0x9133('0x16')](function(_0x53d9bd){logger[_0x9133('0x12')](_0x9133('0x42'),_0x53d9bd['message'],_0x4a521a);_0x12d9e1(_0x6d8c71['error'](0x1f4,_0x53d9bd[_0x9133('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 9aab6ba..2ee509c 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 _0x1c53=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','describe','show','post','isAuthenticated','/:id','exports','multer','util','connect-timeout','express','Router'];(function(_0x543865,_0x502676){var _0x1d3e67=function(_0x3132e4){while(--_0x3132e4){_0x543865['push'](_0x543865['shift']());}};_0x1d3e67(++_0x502676);}(_0x1c53,0x8b));var _0x31c5=function(_0x1e2fe6,_0x19e196){_0x1e2fe6=_0x1e2fe6-0x0;var _0x59246d=_0x1c53[_0x1e2fe6];return _0x59246d;};'use strict';var multer=require(_0x31c5('0x0'));var util=require(_0x31c5('0x1'));var path=require('path');var timeout=require(_0x31c5('0x2'));var express=require(_0x31c5('0x3'));var router=express[_0x31c5('0x4')]();var auth=require(_0x31c5('0x5'));var interaction=require(_0x31c5('0x6'));var config=require(_0x31c5('0x7'));var controller=require(_0x31c5('0x8'));router[_0x31c5('0x9')]('/',auth['isAuthenticated'](),controller[_0x31c5('0xa')]);router[_0x31c5('0x9')](_0x31c5('0xb'),auth['isAuthenticated'](),controller[_0x31c5('0xc')]);router[_0x31c5('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x31c5('0xd')]);router[_0x31c5('0xe')]('/',auth[_0x31c5('0xf')](),controller['create']);router['put'](_0x31c5('0x10'),auth[_0x31c5('0xf')](),controller['update']);module[_0x31c5('0x11')]=router; \ No newline at end of file +var _0x43fa=['show','post','create','put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id'];(function(_0x27a4b0,_0x3a3377){var _0x377068=function(_0x2b35be){while(--_0x2b35be){_0x27a4b0['push'](_0x27a4b0['shift']());}};_0x377068(++_0x3a3377);}(_0x43fa,0xd6));var _0xa43f=function(_0x1e91eb,_0x5829a3){_0x1e91eb=_0x1e91eb-0x0;var _0x2af75a=_0x43fa[_0x1e91eb];return _0x2af75a;};'use strict';var multer=require(_0xa43f('0x0'));var util=require(_0xa43f('0x1'));var path=require(_0xa43f('0x2'));var timeout=require(_0xa43f('0x3'));var express=require(_0xa43f('0x4'));var router=express[_0xa43f('0x5')]();var auth=require(_0xa43f('0x6'));var interaction=require(_0xa43f('0x7'));var config=require(_0xa43f('0x8'));var controller=require('./cmHopperHistory.controller');router[_0xa43f('0x9')]('/',auth[_0xa43f('0xa')](),controller[_0xa43f('0xb')]);router[_0xa43f('0x9')]('/describe',auth[_0xa43f('0xa')](),controller[_0xa43f('0xc')]);router[_0xa43f('0x9')](_0xa43f('0xd'),auth[_0xa43f('0xa')](),controller[_0xa43f('0xe')]);router[_0xa43f('0xf')]('/',auth['isAuthenticated'](),controller[_0xa43f('0x10')]);router[_0xa43f('0x11')](_0xa43f('0xd'),auth[_0xa43f('0xa')](),controller[_0xa43f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index b3cea76..32d89c1 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 _0x8fec=['exports','STRING','sequelize'];(function(_0x2063ba,_0x342f8a){var _0x2b09e6=function(_0x422517){while(--_0x422517){_0x2063ba['push'](_0x2063ba['shift']());}};_0x2b09e6(++_0x342f8a);}(_0x8fec,0x14c));var _0xc8fe=function(_0x4d09e5,_0x1e7917){_0x4d09e5=_0x4d09e5-0x0;var _0x347fba=_0x8fec[_0x4d09e5];return _0x347fba;};'use strict';var Sequelize=require(_0xc8fe('0x0'));module[_0xc8fe('0x1')]={'name':{'type':Sequelize[_0xc8fe('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc8fe('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x48c6=['STRING','name','sequelize','exports'];(function(_0x401150,_0x34e9d5){var _0x1614e6=function(_0x30a433){while(--_0x30a433){_0x401150['push'](_0x401150['shift']());}};_0x1614e6(++_0x34e9d5);}(_0x48c6,0x18a));var _0x648c=function(_0x48eb64,_0x551a7e){_0x48eb64=_0x48eb64-0x0;var _0x2bdd58=_0x48c6[_0x48eb64];return _0x2bdd58;};'use strict';var Sequelize=require(_0x648c('0x0'));module[_0x648c('0x1')]={'name':{'type':Sequelize[_0x648c('0x2')],'unique':_0x648c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x648c('0x2')]},'dialPrefix':{'type':Sequelize[_0x648c('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index d8299f2..d6c29d6 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 _0x0713=['cm_contacts','format','getCustomFields','addAgents','spread','emit','userCmList:save','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./cmList.socket','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Lists','error','stack','name','send','index','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','filter','options','CmList','findAll','rows','catch','show','params','length','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','ListId','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','rawAttributes','pick','cf_%d','raw','getContacts','now','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','transaction','addCustomFields','Sequelize','type','text','TEXT','number','switch','sequelize','queryInterface','addColumn'];(function(_0x485eac,_0x26db4f){var _0x2cda08=function(_0x4e7624){while(--_0x4e7624){_0x485eac['push'](_0x485eac['shift']());}};_0x2cda08(++_0x26db4f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var db=require(_0x3071('0x19'))['db'];config[_0x3071('0x1a')]=_['defaults'](config['redis'],{'host':_0x3071('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3071('0x1a')]));require(_0x3071('0x1c'))['register'](socket);function respondWithStatusCode(_0x104e73,_0x4e1219){_0x4e1219=_0x4e1219||0xcc;return function(_0x2fc15d){if(_0x2fc15d){return _0x104e73[_0x3071('0x1d')](_0x4e1219);}return _0x104e73[_0x3071('0x1e')](_0x4e1219)[_0x3071('0x1f')]();};}function respondWithResult(_0x1caa5d,_0x2a6a4b){_0x2a6a4b=_0x2a6a4b||0xc8;return function(_0x157a47){if(_0x157a47){return _0x1caa5d[_0x3071('0x1e')](_0x2a6a4b)[_0x3071('0x20')](_0x157a47);}};}function respondWithFilteredResult(_0x344ea6,_0x5f3c22){return function(_0x224996){if(_0x224996){var _0x17dbda=_0x224996[_0x3071('0x21')],_0x1068d9=_0x5f3c22[_0x3071('0x22')],_0x108a83=_0x5f3c22[_0x3071('0x22')]+_0x5f3c22['limit'],_0x3acf0e;if(_0x108a83>=_0x17dbda){_0x108a83=_0x17dbda;_0x3acf0e=0xc8;}else{_0x3acf0e=0xce;}_0x344ea6[_0x3071('0x1e')](_0x3acf0e);return _0x344ea6[_0x3071('0x23')](_0x3071('0x24'),_0x1068d9+'-'+_0x108a83+'/'+_0x17dbda)['json'](_0x224996);}return null;};}function patchUpdates(_0xb8f4e3){return function(_0x5cd80d){try{jsonpatch[_0x3071('0x25')](_0x5cd80d,_0xb8f4e3,!![]);}catch(_0x43128c){return BPromise[_0x3071('0x26')](_0x43128c);}return _0x5cd80d[_0x3071('0x27')]();};}function saveUpdates(_0x33090c,_0x34c50e){return function(_0x3c5cef){if(_0x3c5cef){return _0x3c5cef[_0x3071('0x28')](_0x33090c)['then'](function(_0x481a51){return _0x481a51;});}return null;};}function removeEntity(_0x2ce48a,_0xb05b1d){return function(_0x412652){if(_0x412652){return _0x412652[_0x3071('0x29')]()[_0x3071('0x2a')](function(){var _0x44b45f=_0x412652[_0x3071('0x2b')]({'plain':!![]});var _0x1fe727=_0x3071('0x2c');return db['UserProfileResource'][_0x3071('0x29')]({'where':{'type':_0x1fe727,'resourceId':_0x44b45f['id']}})[_0x3071('0x2a')](function(){return _0x412652;});})[_0x3071('0x2a')](function(){_0x2ce48a['status'](0xcc)[_0x3071('0x1f')]();});}};}function handleEntityNotFound(_0x28792d,_0x163604){return function(_0x950fde){if(!_0x950fde){_0x28792d[_0x3071('0x1d')](0x194);}return _0x950fde;};}function handleError(_0x25b96b,_0x177b5f){_0x177b5f=_0x177b5f||0x1f4;return function(_0x3921a1){logger[_0x3071('0x2d')](_0x3921a1[_0x3071('0x2e')]);if(_0x3921a1[_0x3071('0x2f')]){delete _0x3921a1['name'];}_0x25b96b['status'](_0x177b5f)[_0x3071('0x30')](_0x3921a1);};}exports[_0x3071('0x31')]=function(_0x6ddf96,_0x40be95){var _0x3f6d90={},_0x29538c={},_0x32b6b1={'count':0x0,'rows':[]};var _0x1ccc41=_['map'](db['CmList']['rawAttributes'],function(_0x1b0aaf){return{'name':_0x1b0aaf[_0x3071('0x32')],'type':_0x1b0aaf['type'][_0x3071('0x33')]};});_0x29538c[_0x3071('0x34')]=_[_0x3071('0x35')](_0x1ccc41,_0x3071('0x2f'));_0x29538c['query']=_[_0x3071('0x36')](_0x6ddf96[_0x3071('0x37')]);_0x29538c[_0x3071('0x38')]=_[_0x3071('0x39')](_0x29538c[_0x3071('0x34')],_0x29538c[_0x3071('0x37')]);_0x3f6d90[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x29538c['model'],qs[_0x3071('0x3b')](_0x6ddf96['query']['fields']));_0x3f6d90[_0x3071('0x3a')]=_0x3f6d90[_0x3071('0x3a')]['length']?_0x3f6d90[_0x3071('0x3a')]:_0x29538c[_0x3071('0x34')];if(!_0x6ddf96[_0x3071('0x37')][_0x3071('0x3c')](_0x3071('0x3d'))){_0x3f6d90[_0x3071('0x3e')]=qs['limit'](_0x6ddf96[_0x3071('0x37')][_0x3071('0x3e')]);_0x3f6d90['offset']=qs[_0x3071('0x22')](_0x6ddf96['query'][_0x3071('0x22')]);}_0x3f6d90[_0x3071('0x3f')]=qs['sort'](_0x6ddf96['query'][_0x3071('0x40')]);_0x3f6d90[_0x3071('0x41')]=qs[_0x3071('0x38')](_['pick'](_0x6ddf96[_0x3071('0x37')],_0x29538c['filters']));if(_0x6ddf96[_0x3071('0x37')]['filter']){_0x3f6d90[_0x3071('0x41')]=_[_0x3071('0x42')](_0x3f6d90[_0x3071('0x41')],{'$or':_[_0x3071('0x35')](_0x1ccc41,function(_0x30ab68){if(_0x30ab68['type']!=='VIRTUAL'){var _0x4337eb={};_0x4337eb[_0x30ab68[_0x3071('0x2f')]]={'$like':'%'+_0x6ddf96[_0x3071('0x37')][_0x3071('0x43')]+'%'};return _0x4337eb;}})});}_0x3f6d90=_['merge']({},_0x3f6d90,_0x6ddf96[_0x3071('0x44')]);var _0x60549a={'where':_0x3f6d90[_0x3071('0x41')]};return db[_0x3071('0x45')][_0x3071('0x21')](_0x60549a)[_0x3071('0x2a')](function(_0x56a9d8){_0x32b6b1[_0x3071('0x21')]=_0x56a9d8;if(_0x6ddf96['query']['includeAll']){_0x3f6d90['include']=[{'all':!![]}];}return db['CmList'][_0x3071('0x46')](_0x3f6d90);})[_0x3071('0x2a')](function(_0x67b2fb){_0x32b6b1[_0x3071('0x47')]=_0x67b2fb;return _0x32b6b1;})[_0x3071('0x2a')](respondWithFilteredResult(_0x40be95,_0x3f6d90))[_0x3071('0x48')](handleError(_0x40be95,null));};exports[_0x3071('0x49')]=function(_0x2e6c70,_0x56589e){var _0x1e8222={'raw':![],'where':{'id':_0x2e6c70[_0x3071('0x4a')]['id']}},_0x1641d9={};_0x1641d9[_0x3071('0x34')]=_[_0x3071('0x36')](db['CmList']['rawAttributes']);_0x1641d9[_0x3071('0x37')]=_[_0x3071('0x36')](_0x2e6c70[_0x3071('0x37')]);_0x1641d9[_0x3071('0x38')]=_[_0x3071('0x39')](_0x1641d9['model'],_0x1641d9[_0x3071('0x37')]);_0x1e8222['attributes']=_[_0x3071('0x39')](_0x1641d9['model'],qs['fields'](_0x2e6c70[_0x3071('0x37')]['fields']));_0x1e8222[_0x3071('0x3a')]=_0x1e8222['attributes'][_0x3071('0x4b')]?_0x1e8222[_0x3071('0x3a')]:_0x1641d9[_0x3071('0x34')];if(_0x2e6c70[_0x3071('0x37')]['includeAll']){_0x1e8222[_0x3071('0x4c')]=[{'all':!![]}];}_0x1e8222=_['merge']({},_0x1e8222,_0x2e6c70[_0x3071('0x44')]);return db['CmList'][_0x3071('0x4d')](_0x1e8222)[_0x3071('0x2a')](handleEntityNotFound(_0x56589e,null))['then'](respondWithResult(_0x56589e,null))[_0x3071('0x48')](handleError(_0x56589e,null));};exports[_0x3071('0x4e')]=function(_0x224a70,_0x38bcc2){return db[_0x3071('0x45')][_0x3071('0x4e')](_0x224a70[_0x3071('0x4f')],{})['then'](function(_0x2c6e4c){var _0x486b7a=_0x224a70[_0x3071('0x50')][_0x3071('0x2b')]({'plain':!![]});if(!_0x486b7a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x486b7a[_0x3071('0x51')]===_0x3071('0x50')){var _0x1b832e=_0x2c6e4c[_0x3071('0x2b')]({'plain':!![]});var _0x22aade=_0x3071('0x2c');return db[_0x3071('0x52')][_0x3071('0x4d')]({'where':{'name':_0x22aade,'userProfileId':_0x486b7a[_0x3071('0x53')]},'raw':!![]})[_0x3071('0x2a')](function(_0x4371e7){if(_0x4371e7&&_0x4371e7[_0x3071('0x54')]===0x0){return db[_0x3071('0x55')][_0x3071('0x4e')]({'name':_0x1b832e[_0x3071('0x2f')],'resourceId':_0x1b832e['id'],'type':_0x4371e7[_0x3071('0x2f')],'sectionId':_0x4371e7['id']},{})['then'](function(){return _0x2c6e4c;});}else{return _0x2c6e4c;}})['catch'](function(_0x12536d){logger['error'](_0x3071('0x56'),_0x12536d);throw _0x12536d;});}return _0x2c6e4c;})[_0x3071('0x2a')](respondWithResult(_0x38bcc2,0xc9))[_0x3071('0x48')](handleError(_0x38bcc2,null));};exports['update']=function(_0x1ec428,_0x1ada95){if(_0x1ec428['body']['id']){delete _0x1ec428['body']['id'];}return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x1ec428[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x1ada95,null))['then'](saveUpdates(_0x1ec428[_0x3071('0x4f')],null))[_0x3071('0x2a')](respondWithResult(_0x1ada95,null))[_0x3071('0x48')](handleError(_0x1ada95,null));};exports[_0x3071('0x29')]=function(_0x123323,_0x5206bd){return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x123323[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x5206bd,null))[_0x3071('0x2a')](removeEntity(_0x5206bd,null))[_0x3071('0x48')](handleError(_0x5206bd,null));};exports[_0x3071('0x57')]=function(_0x4bea5d,_0x4d6ed0){return db[_0x3071('0x45')]['describe']()[_0x3071('0x2a')](respondWithResult(_0x4d6ed0,null))[_0x3071('0x48')](handleError(_0x4d6ed0,null));};exports['addDisposition']=function(_0x19dc95,_0x1bf911,_0x4d3886){if(_0x19dc95[_0x3071('0x4f')]['id']){delete _0x19dc95[_0x3071('0x4f')]['id'];}return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x19dc95[_0x3071('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1bf911,null))[_0x3071('0x2a')](function(_0x313a54){if(_0x313a54){_0x19dc95[_0x3071('0x4f')]['ListId']=_0x313a54['id'];return db[_0x3071('0x58')][_0x3071('0x4e')](_0x19dc95[_0x3071('0x4f')]);}})[_0x3071('0x2a')](respondWithResult(_0x1bf911,null))[_0x3071('0x48')](handleError(_0x1bf911,null));};exports[_0x3071('0x59')]=function(_0xe93f28,_0x2e39ff,_0x3b47e8){var _0x5cb3b3={'raw':![],'where':{}};var _0x5d1316={};var _0x29a58e={'count':0x0,'rows':[]};return db[_0x3071('0x45')][_0x3071('0x5a')]({'where':{'id':_0xe93f28[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x2e39ff,null))[_0x3071('0x2a')](function(_0x287974){if(_0x287974){_0x5d1316[_0x3071('0x34')]=_[_0x3071('0x36')](db[_0x3071('0x58')]['rawAttributes']);_0x5d1316[_0x3071('0x37')]=_[_0x3071('0x36')](_0xe93f28[_0x3071('0x37')]);_0x5d1316[_0x3071('0x38')]=_[_0x3071('0x39')](_0x5d1316[_0x3071('0x34')],_0x5d1316[_0x3071('0x37')]);_0x5cb3b3[_0x3071('0x3a')]=_['intersection'](_0x5d1316[_0x3071('0x34')],qs[_0x3071('0x3b')](_0xe93f28['query']['fields']));_0x5cb3b3[_0x3071('0x3a')]=_0x5cb3b3[_0x3071('0x3a')][_0x3071('0x4b')]?_0x5cb3b3[_0x3071('0x3a')]:_0x5d1316['model'];if(!_0xe93f28['query'][_0x3071('0x3c')]('nolimit')){_0x5cb3b3['limit']=qs['limit'](_0xe93f28['query'][_0x3071('0x3e')]);_0x5cb3b3[_0x3071('0x22')]=qs[_0x3071('0x22')](_0xe93f28['query'][_0x3071('0x22')]);}_0x5cb3b3[_0x3071('0x3f')]=qs[_0x3071('0x40')](_0xe93f28[_0x3071('0x37')]['sort']);_0x5cb3b3[_0x3071('0x41')]=qs[_0x3071('0x38')](_['pick'](_0xe93f28[_0x3071('0x37')],_0x5d1316[_0x3071('0x38')]));_0x5cb3b3[_0x3071('0x41')][_0x3071('0x5b')]=_0x287974['id'];if(_0xe93f28[_0x3071('0x37')][_0x3071('0x43')]){_0x5cb3b3[_0x3071('0x41')]=_['merge'](_0x5cb3b3['where'],{'$or':_[_0x3071('0x35')](_0x5cb3b3[_0x3071('0x3a')],function(_0x1456ce){var _0x4bf839={};_0x4bf839[_0x1456ce]={'$like':'%'+_0xe93f28['query'][_0x3071('0x43')]+'%'};return _0x4bf839;})});}_0x5cb3b3=_[_0x3071('0x42')]({},_0x5cb3b3,_0xe93f28[_0x3071('0x44')]);return db[_0x3071('0x58')][_0x3071('0x21')]({'where':_0x5cb3b3[_0x3071('0x41')]})[_0x3071('0x2a')](function(_0x268657){_0x29a58e['count']=_0x268657;if(_0xe93f28[_0x3071('0x37')]['includeAll']){_0x5cb3b3[_0x3071('0x4c')]=[{'all':!![]}];}return db[_0x3071('0x58')][_0x3071('0x46')](_0x5cb3b3);})[_0x3071('0x2a')](function(_0x37cec5){_0x29a58e[_0x3071('0x47')]=_0x37cec5;return _0x29a58e;});}})[_0x3071('0x2a')](respondWithFilteredResult(_0x2e39ff,_0x5cb3b3))[_0x3071('0x48')](handleError(_0x2e39ff,null));};exports['removeDispositions']=function(_0x20dff9,_0x138a94,_0x1da477){return db['CmList'][_0x3071('0x4d')]({'where':{'id':_0x20dff9[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x138a94,null))['then'](function(_0x521ee6){if(_0x521ee6){return _0x521ee6[_0x3071('0x5c')](_0x20dff9['query'][_0x3071('0x5d')]);}})[_0x3071('0x2a')](respondWithStatusCode(_0x138a94,null))[_0x3071('0x48')](handleError(_0x138a94,null));};exports[_0x3071('0x5e')]=function(_0x311939,_0x437098,_0x242665){return db['CmList'][_0x3071('0x4d')]({'where':{'id':_0x311939[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x437098,null))[_0x3071('0x2a')](function(_0x98d0fb){if(_0x98d0fb){var _0x1fea60=[];var _0x435dcb={'success':[],'errors':[]};return db[_0x3071('0x5f')]['describe']()[_0x3071('0x2a')](function(_0x5ed436){if(_0x311939[_0x3071('0x4f')][_0x3071('0x60')]&&_[_0x3071('0x61')](_0x311939[_0x3071('0x4f')][_0x3071('0x60')])){if(_0x311939[_0x3071('0x4f')][_0x3071('0x60')][_0x3071('0x4b')]){_0x311939[_0x3071('0x4f')][_0x3071('0x60')]=_0x311939['body'][_0x3071('0x60')][_0x3071('0x62')](';')+';';}else{_0x311939['body'][_0x3071('0x60')]=null;}}else{_0x311939[_0x3071('0x4f')][_0x3071('0x60')]=null;}if(_0x311939[_0x3071('0x4f')]&&_[_0x3071('0x61')](_0x311939['body'])){for(var _0x5a7d28=0x0;_0x5a7d28<_0x311939[_0x3071('0x4f')]['length'];_0x5a7d28+=0x1){_0x311939[_0x3071('0x4f')][_0x5a7d28][_0x3071('0x5b')]=_0x311939[_0x3071('0x4a')]['id'];_0x1fea60[_0x3071('0x63')](_0x311939[_0x3071('0x4f')][_0x5a7d28]);}return BPromise[_0x3071('0x64')](_0x1fea60,function(_0x568386){return db[_0x3071('0x5f')][_0x3071('0x4e')](_[_0x3071('0x65')](_0x568386,[_0x3071('0x5d'),'id'])||{},{'fields':_['keys'](_0x5ed436),'raw':!![]})[_0x3071('0x2a')](function(_0x446546){_0x435dcb['success'][_0x3071('0x63')](_0x446546[_0x3071('0x66')]);})[_0x3071('0x48')](function(_0x10bc5b){_0x435dcb[_0x3071('0x67')]['push']({'data':_0x568386,'error':_0x10bc5b[_0x3071('0x68')]});});})['then'](function(_0x34b88b){return _0x435dcb;})[_0x3071('0x48')](function(_0x39060f){return _0x39060f;});}else{_0x437098[_0x3071('0x1e')](0x190)[_0x3071('0x20')]({'message':_0x3071('0x69')});}});}})[_0x3071('0x2a')](respondWithResult(_0x437098,null))[_0x3071('0x48')](handleError(_0x437098,null));};exports['getContacts']=function(_0x2868c2,_0x3efa3c,_0x459653){var _0x4dfb45;return db[_0x3071('0x45')]['find']({'where':{'id':_0x2868c2[_0x3071('0x4a')]['id']},'include':[{'model':db[_0x3071('0x6a')],'as':_0x3071('0x6b')}]})['then'](handleEntityNotFound(_0x3efa3c,null))[_0x3071('0x2a')](function(_0x2ef706){if(_0x2ef706){_0x4dfb45=_0x2ef706;return db[_0x3071('0x5f')][_0x3071('0x6c')];}})[_0x3071('0x2a')](function(_0x2e5f09){if(_0x2e5f09){var _0x12c700={};var _0x2c7749={};_0x2c7749[_0x3071('0x34')]=_['concat'](_[_0x3071('0x36')](_0x2e5f09),_[_0x3071('0x35')](_0x4dfb45[_0x3071('0x6b')],function(_0x5b2830){return util['format']('cf_%d',_0x5b2830['id']);}));_0x2c7749['query']=_['keys'](_0x2868c2[_0x3071('0x37')]);_0x2c7749[_0x3071('0x38')]=_['intersection'](_0x2c7749[_0x3071('0x34')],_0x2c7749[_0x3071('0x37')]);_0x12c700[_0x3071('0x3a')]=_['intersection'](_0x2c7749['model'],qs[_0x3071('0x3b')](_0x2868c2[_0x3071('0x37')][_0x3071('0x3b')]));_0x12c700[_0x3071('0x3a')]=_0x12c700[_0x3071('0x3a')][_0x3071('0x4b')]?_0x12c700[_0x3071('0x3a')]:_0x2c7749['model'];if(!_0x2868c2['query'][_0x3071('0x3c')](_0x3071('0x3d'))){_0x12c700[_0x3071('0x3e')]=qs[_0x3071('0x3e')](_0x2868c2['query'][_0x3071('0x3e')]);_0x12c700[_0x3071('0x22')]=qs[_0x3071('0x22')](_0x2868c2[_0x3071('0x37')][_0x3071('0x22')]);}_0x12c700[_0x3071('0x3f')]=qs[_0x3071('0x40')](_0x2868c2[_0x3071('0x37')]['sort']);_0x12c700[_0x3071('0x41')]=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x2868c2[_0x3071('0x37')],_0x2c7749[_0x3071('0x38')]));_0x12c700['raw']=!![];if(_0x2868c2[_0x3071('0x37')]['filter']){_0x12c700['where']=_[_0x3071('0x42')](_0x12c700[_0x3071('0x41')],{'$or':_[_0x3071('0x35')](_0x12c700['attributes'],function(_0x262bca){var _0x1791bc={};_0x1791bc[_0x262bca]={'$like':'%'+_0x2868c2[_0x3071('0x37')][_0x3071('0x43')]+'%'};return _0x1791bc;})});}_0x12c700=_[_0x3071('0x42')]({},_0x12c700,_0x2868c2['options']);return _0x4dfb45['getContacts'](_0x12c700);}})[_0x3071('0x2a')](respondWithResult(_0x3efa3c,null))[_0x3071('0x48')](handleError(_0x3efa3c,null));};exports['getContactsCsv']=function(_0x3ae39b,_0x141122,_0x22e484){var _0x2d559a;return db[_0x3071('0x45')]['find']({'where':{'id':_0x3ae39b[_0x3071('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x3071('0x6b')}]})[_0x3071('0x2a')](handleEntityNotFound(_0x141122,null))['then'](function(_0x279525){if(_0x279525){_0x2d559a=_0x279525;return db['CmContact'][_0x3071('0x6c')];}})[_0x3071('0x2a')](function(_0x408ace){if(_0x408ace){var _0x2f36b1={};var _0x5a19b5={};_0x5a19b5[_0x3071('0x34')]=_['concat'](_[_0x3071('0x36')](_0x408ace),_['map'](_0x2d559a[_0x3071('0x6b')],function(_0x3ce867){return util['format'](_0x3071('0x6e'),_0x3ce867['id']);}));_0x5a19b5[_0x3071('0x37')]=_['keys'](_0x3ae39b[_0x3071('0x37')]);_0x5a19b5[_0x3071('0x38')]=_[_0x3071('0x39')](_0x5a19b5[_0x3071('0x34')],_0x5a19b5[_0x3071('0x37')]);_0x2f36b1[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x5a19b5[_0x3071('0x34')],qs[_0x3071('0x3b')](_0x3ae39b[_0x3071('0x37')][_0x3071('0x3b')]));_0x2f36b1[_0x3071('0x3a')]=_0x2f36b1[_0x3071('0x3a')][_0x3071('0x4b')]?_0x2f36b1[_0x3071('0x3a')]:_0x5a19b5['model'];if(!_0x3ae39b[_0x3071('0x37')][_0x3071('0x3c')](_0x3071('0x3d'))){_0x2f36b1[_0x3071('0x3e')]=qs[_0x3071('0x3e')](_0x3ae39b['query']['limit']);_0x2f36b1[_0x3071('0x22')]=qs[_0x3071('0x22')](_0x3ae39b['query'][_0x3071('0x22')]);}_0x2f36b1[_0x3071('0x3f')]=qs['sort'](_0x3ae39b[_0x3071('0x37')][_0x3071('0x40')]);_0x2f36b1[_0x3071('0x41')]=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x3ae39b[_0x3071('0x37')],_0x5a19b5[_0x3071('0x38')]));_0x2f36b1[_0x3071('0x6f')]=!![];if(_0x3ae39b[_0x3071('0x37')][_0x3071('0x43')]){_0x2f36b1['where']=_[_0x3071('0x42')](_0x2f36b1['where'],{'$or':_[_0x3071('0x35')](_0x2f36b1[_0x3071('0x3a')],function(_0x46ab46){var _0x3d4d6b={};_0x3d4d6b[_0x46ab46]={'$like':'%'+_0x3ae39b['query']['filter']+'%'};return _0x3d4d6b;})});}_0x2f36b1=_['merge']({},_0x2f36b1,_0x3ae39b[_0x3071('0x44')]);return _0x2d559a[_0x3071('0x70')](_0x2f36b1);}})[_0x3071('0x2a')](function(_0x2e729c){if(!_['isEmpty'](_0x2e729c)){var _0x35aef4=toCsv(_0x2e729c);var _0x7c3473=Date[_0x3071('0x71')]();fs['writeFileSync'](util['format']('/tmp/list_%d_%s.csv',_0x2d559a['id'],_0x7c3473),_0x35aef4);_0x141122['setHeader'](_0x3071('0x72'),_0x3071('0x73')+util['format'](_0x3071('0x74'),_0x2d559a['id'],_0x7c3473));_0x141122[_0x3071('0x75')](_0x3071('0x76'),_0x3071('0x77'));return _0x141122[_0x3071('0x78')](util['format'](_0x3071('0x79'),_0x2d559a['id'],_0x7c3473));}else{return _0x141122[_0x3071('0x1d')](0xcc);}})[_0x3071('0x48')](handleError(_0x141122,null));};exports[_0x3071('0x7a')]=function(_0x56d01a,_0x398590,_0x54d194){var _0x2c5bf0;delete _0x56d01a[_0x3071('0x4f')]['id'];return db[_0x3071('0x45')]['findOne']({'where':{'id':_0x56d01a[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x398590,null))[_0x3071('0x2a')](function(_0x1e30be){if(_0x1e30be){return db['sequelize'][_0x3071('0x7b')](function(_0xd89eeb){return db[_0x3071('0x6a')][_0x3071('0x4e')](_0x56d01a[_0x3071('0x4f')],{'transaction':_0xd89eeb})['then'](function(_0x57f202){_0x2c5bf0=_0x57f202;return _0x1e30be[_0x3071('0x7c')](_0x57f202,{'transaction':_0xd89eeb});})[_0x3071('0x2a')](function(){var _0x11c32f={'type':db[_0x3071('0x7d')]['TEXT'],'transaction':_0xd89eeb};switch(_0x56d01a['body'][_0x3071('0x7e')]){case _0x3071('0x7f'):_0x11c32f['type']=db[_0x3071('0x7d')][_0x3071('0x80')];break;case _0x3071('0x81'):_0x11c32f['type']=db['Sequelize']['INTEGER'];break;case _0x3071('0x82'):_0x11c32f[_0x3071('0x7e')]=db[_0x3071('0x7d')]['BOOLEAN'];_0x11c32f['defaultValue']=![];break;default:}return db[_0x3071('0x83')][_0x3071('0x84')][_0x3071('0x85')](_0x3071('0x86'),util[_0x3071('0x87')]('cf_%s',_0x2c5bf0['id']),_0x11c32f);})[_0x3071('0x2a')](function(){return _0x2c5bf0;});});}})['then'](respondWithResult(_0x398590,null))[_0x3071('0x48')](handleError(_0x398590,null));};exports[_0x3071('0x88')]=function(_0x294316,_0xc1632,_0x1817a8){var _0x4e9672={};var _0x64220e={};var _0x1919cc;var _0x17b103;return db[_0x3071('0x45')][_0x3071('0x5a')]({'where':{'id':_0x294316[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0xc1632,null))[_0x3071('0x2a')](function(_0xc6bc56){if(_0xc6bc56){_0x1919cc=_0xc6bc56;_0x64220e[_0x3071('0x34')]=_[_0x3071('0x36')](db['CmCustomField'][_0x3071('0x6c')]);_0x64220e[_0x3071('0x37')]=_[_0x3071('0x36')](_0x294316[_0x3071('0x37')]);_0x64220e['filters']=_[_0x3071('0x39')](_0x64220e['model'],_0x64220e[_0x3071('0x37')]);_0x4e9672[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x64220e[_0x3071('0x34')],qs[_0x3071('0x3b')](_0x294316[_0x3071('0x37')][_0x3071('0x3b')]));_0x4e9672['attributes']=_0x4e9672[_0x3071('0x3a')]['length']?_0x4e9672['attributes']:_0x64220e[_0x3071('0x34')];_0x4e9672[_0x3071('0x3f')]=qs['sort'](_0x294316[_0x3071('0x37')]['sort']);_0x4e9672[_0x3071('0x41')]=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x294316[_0x3071('0x37')],_0x64220e[_0x3071('0x38')]));_0x4e9672[_0x3071('0x41')]=_[_0x3071('0x42')](_0x4e9672[_0x3071('0x41')],{'$or':[{'ListId':_0xc6bc56['id']},{'ListId':null}]});if(_0x294316[_0x3071('0x37')][_0x3071('0x43')]){_0x4e9672[_0x3071('0x41')]=_['merge'](_0x4e9672[_0x3071('0x41')],{'$or':_[_0x3071('0x35')](_0x4e9672[_0x3071('0x3a')],function(_0x5f1c3b){var _0x2f7eee={};_0x2f7eee[_0x5f1c3b]={'$like':'%'+_0x294316['query'][_0x3071('0x43')]+'%'};return _0x2f7eee;})});}_0x4e9672=_[_0x3071('0x42')]({},_0x4e9672,_0x294316[_0x3071('0x44')]);return db[_0x3071('0x6a')]['findAndCountAll'](_0x4e9672);}})['then'](respondWithResult(_0xc1632,null))['catch'](handleError(_0xc1632,null));};exports[_0x3071('0x89')]=function(_0x5da7bc,_0x4d4519,_0x3c617e){return db['CmList'][_0x3071('0x4d')]({'where':{'id':_0x5da7bc[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x4d4519,null))['then'](function(_0x16b566){if(_0x16b566){return _0x16b566['addAgents'](_0x5da7bc['body'][_0x3071('0x5d')],_[_0x3071('0x65')](_0x5da7bc[_0x3071('0x4f')],[_0x3071('0x5d'),'id'])||{})[_0x3071('0x8a')](function(_0x38b2c5){for(var _0x3d396d=0x0;_0x3d396d<_0x5da7bc['body'][_0x3071('0x5d')][_0x3071('0x4b')];_0x3d396d+=0x1){socket[_0x3071('0x8b')](_0x3071('0x8c'),{'UserId':_0x5da7bc[_0x3071('0x4f')][_0x3071('0x5d')][_0x3d396d],'CmListId':_0x5da7bc[_0x3071('0x4a')]['id']});}return _0x38b2c5;});}})[_0x3071('0x2a')](respondWithResult(_0x4d4519,null))[_0x3071('0x48')](handleError(_0x4d4519,null));};exports['removeAgents']=function(_0x12765c,_0x149dae,_0x32a43f){return db[_0x3071('0x45')][_0x3071('0x4d')]({'where':{'id':_0x12765c[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x149dae,null))['then'](function(_0x2b6fca){if(_0x2b6fca){return _0x2b6fca['removeAgents'](_0x12765c[_0x3071('0x37')][_0x3071('0x5d')])[_0x3071('0x2a')](function(){if(_['isArray'](_0x12765c['query']['ids'])){for(var _0x475047=0x0;_0x475047<_0x12765c[_0x3071('0x37')][_0x3071('0x5d')]['length'];_0x475047+=0x1){socket[_0x3071('0x8b')](_0x3071('0x8d'),{'UserId':Number(_0x12765c[_0x3071('0x37')][_0x3071('0x5d')][_0x475047]),'CmListId':Number(_0x12765c[_0x3071('0x4a')]['id'])});}}else{socket[_0x3071('0x8b')](_0x3071('0x8d'),{'UserId':Number(_0x12765c[_0x3071('0x37')][_0x3071('0x5d')]),'CmListId':Number(_0x12765c['params']['id'])});}});}})[_0x3071('0x2a')](respondWithStatusCode(_0x149dae,null))[_0x3071('0x48')](handleError(_0x149dae,null));};exports[_0x3071('0x8e')]=function(_0x5048ca,_0x34181c,_0x1f9c91){var _0x3cacc1={};var _0x3b5c46={};var _0x3b5619;var _0x1cc091;return db[_0x3071('0x45')][_0x3071('0x5a')]({'where':{'id':_0x5048ca[_0x3071('0x4a')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x34181c,null))[_0x3071('0x2a')](function(_0x1dd796){if(_0x1dd796){_0x3b5619=_0x1dd796;_0x3b5c46['model']=_[_0x3071('0x36')](db[_0x3071('0x8f')]['rawAttributes']);_0x3b5c46['query']=_['keys'](_0x5048ca['query']);_0x3b5c46[_0x3071('0x38')]=_[_0x3071('0x39')](_0x3b5c46['model'],_0x3b5c46[_0x3071('0x37')]);_0x3cacc1[_0x3071('0x3a')]=_[_0x3071('0x39')](_0x3b5c46[_0x3071('0x34')],qs[_0x3071('0x3b')](_0x5048ca[_0x3071('0x37')][_0x3071('0x3b')]));_0x3cacc1[_0x3071('0x3a')]=_0x3cacc1[_0x3071('0x3a')][_0x3071('0x4b')]?_0x3cacc1[_0x3071('0x3a')]:_0x3b5c46[_0x3071('0x34')];_0x3cacc1[_0x3071('0x3f')]=qs['sort'](_0x5048ca[_0x3071('0x37')][_0x3071('0x40')]);_0x3cacc1['where']=qs[_0x3071('0x38')](_[_0x3071('0x6d')](_0x5048ca[_0x3071('0x37')],_0x3b5c46[_0x3071('0x38')]));if(_0x5048ca['query'][_0x3071('0x43')]){_0x3cacc1[_0x3071('0x41')]=_[_0x3071('0x42')](_0x3cacc1[_0x3071('0x41')],{'$or':_['map'](_0x3cacc1['attributes'],function(_0x1afce9){var _0x370797={};_0x370797[_0x1afce9]={'$like':'%'+_0x5048ca[_0x3071('0x37')][_0x3071('0x43')]+'%'};return _0x370797;})});}_0x3cacc1=_[_0x3071('0x42')]({},_0x3cacc1,_0x5048ca[_0x3071('0x44')]);return _0x3b5619[_0x3071('0x8e')](_0x3cacc1);}})[_0x3071('0x2a')](function(_0x4d2992){if(_0x4d2992){_0x1cc091=_0x4d2992[_0x3071('0x4b')];if(!_0x5048ca['query']['hasOwnProperty'](_0x3071('0x3d'))){_0x3cacc1[_0x3071('0x3e')]=qs['limit'](_0x5048ca['query'][_0x3071('0x3e')]);_0x3cacc1[_0x3071('0x22')]=qs[_0x3071('0x22')](_0x5048ca[_0x3071('0x37')]['offset']);}return _0x3b5619[_0x3071('0x8e')](_0x3cacc1);}})[_0x3071('0x2a')](function(_0x2bb0eb){if(_0x2bb0eb){return _0x2bb0eb?{'count':_0x1cc091,'rows':_0x2bb0eb}:null;}})[_0x3071('0x2a')](respondWithResult(_0x34181c,null))[_0x3071('0x48')](handleError(_0x34181c,null));}; \ No newline at end of file +var _0xedd9=['end','json','count','offset','Content-Range','apply','save','update','then','destroy','get','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','include','rows','catch','show','params','length','includeAll','find','create','body','user','role','Lists','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','Disposition','findAll','removeDispositions','addContacts','CmContact','tags','isArray','join','push','omit','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','cf_%d','raw','getContactsCsv','CustomFields','format','isEmpty','now','writeFileSync','setHeader','Content-disposition','list_%d_%s.csv','Content-type','download','/tmp/list_%d_%s.csv','addCustomField','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','findOne','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status'];(function(_0x207dea,_0x2f864f){var _0x2aa6d3=function(_0x388455){while(--_0x388455){_0x207dea['push'](_0x207dea['shift']());}};_0x2aa6d3(++_0x2f864f);}(_0xedd9,0xfc));var _0x9edd=function(_0x417c9c,_0x312b94){_0x417c9c=_0x417c9c-0x0;var _0x371627=_0xedd9[_0x417c9c];return _0x371627;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');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('0xa'));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 db=require(_0x9edd('0x16'))['db'];config[_0x9edd('0x17')]=_[_0x9edd('0x18')](config[_0x9edd('0x17')],{'host':_0x9edd('0x19'),'port':0x18eb});var socket=require(_0x9edd('0x1a'))(new Redis(config[_0x9edd('0x17')]));require('./cmList.socket')[_0x9edd('0x1b')](socket);function respondWithStatusCode(_0x44fc7c,_0x891832){_0x891832=_0x891832||0xcc;return function(_0x4d9a7){if(_0x4d9a7){return _0x44fc7c[_0x9edd('0x1c')](_0x891832);}return _0x44fc7c[_0x9edd('0x1d')](_0x891832)[_0x9edd('0x1e')]();};}function respondWithResult(_0x75a4ab,_0x4ea60f){_0x4ea60f=_0x4ea60f||0xc8;return function(_0x5f5bf4){if(_0x5f5bf4){return _0x75a4ab[_0x9edd('0x1d')](_0x4ea60f)[_0x9edd('0x1f')](_0x5f5bf4);}};}function respondWithFilteredResult(_0x5acf65,_0x1b54c0){return function(_0x35f454){if(_0x35f454){var _0x40ba32=_0x35f454[_0x9edd('0x20')],_0x4d8f33=_0x1b54c0[_0x9edd('0x21')],_0x43dc70=_0x1b54c0['offset']+_0x1b54c0['limit'],_0x5d879c;if(_0x43dc70>=_0x40ba32){_0x43dc70=_0x40ba32;_0x5d879c=0xc8;}else{_0x5d879c=0xce;}_0x5acf65[_0x9edd('0x1d')](_0x5d879c);return _0x5acf65['set'](_0x9edd('0x22'),_0x4d8f33+'-'+_0x43dc70+'/'+_0x40ba32)['json'](_0x35f454);}return null;};}function patchUpdates(_0x535f37){return function(_0x356751){try{jsonpatch[_0x9edd('0x23')](_0x356751,_0x535f37,!![]);}catch(_0x4fb7bf){return BPromise['reject'](_0x4fb7bf);}return _0x356751[_0x9edd('0x24')]();};}function saveUpdates(_0x186186,_0x477878){return function(_0x542172){if(_0x542172){return _0x542172[_0x9edd('0x25')](_0x186186)[_0x9edd('0x26')](function(_0x44a6c1){return _0x44a6c1;});}return null;};}function removeEntity(_0x2ca65f,_0x339a0d){return function(_0x4c75d2){if(_0x4c75d2){return _0x4c75d2[_0x9edd('0x27')]()[_0x9edd('0x26')](function(){var _0x3a1ea5=_0x4c75d2[_0x9edd('0x28')]({'plain':!![]});var _0x310a4d='Lists';return db['UserProfileResource'][_0x9edd('0x27')]({'where':{'type':_0x310a4d,'resourceId':_0x3a1ea5['id']}})[_0x9edd('0x26')](function(){return _0x4c75d2;});})[_0x9edd('0x26')](function(){_0x2ca65f[_0x9edd('0x1d')](0xcc)[_0x9edd('0x1e')]();});}};}function handleEntityNotFound(_0x4fe471,_0x57a2cc){return function(_0x214d0a){if(!_0x214d0a){_0x4fe471[_0x9edd('0x1c')](0x194);}return _0x214d0a;};}function handleError(_0x1c762c,_0x52746a){_0x52746a=_0x52746a||0x1f4;return function(_0x238b22){logger[_0x9edd('0x29')](_0x238b22[_0x9edd('0x2a')]);if(_0x238b22[_0x9edd('0x2b')]){delete _0x238b22['name'];}_0x1c762c[_0x9edd('0x1d')](_0x52746a)[_0x9edd('0x2c')](_0x238b22);};}exports[_0x9edd('0x2d')]=function(_0x12c1bc,_0xbbf08f){var _0x42e664={},_0x209aba={},_0x1fba7b={'count':0x0,'rows':[]};var _0x19b6c1=_[_0x9edd('0x2e')](db[_0x9edd('0x2f')][_0x9edd('0x30')],function(_0x6907a5){return{'name':_0x6907a5[_0x9edd('0x31')],'type':_0x6907a5[_0x9edd('0x32')]['key']};});_0x209aba[_0x9edd('0x33')]=_[_0x9edd('0x2e')](_0x19b6c1,_0x9edd('0x2b'));_0x209aba['query']=_[_0x9edd('0x34')](_0x12c1bc[_0x9edd('0x35')]);_0x209aba[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x209aba[_0x9edd('0x33')],_0x209aba[_0x9edd('0x35')]);_0x42e664[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x209aba[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x39')]));_0x42e664[_0x9edd('0x38')]=_0x42e664[_0x9edd('0x38')]['length']?_0x42e664[_0x9edd('0x38')]:_0x209aba['model'];if(!_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x3a')](_0x9edd('0x3b'))){_0x42e664[_0x9edd('0x3c')]=qs[_0x9edd('0x3c')](_0x12c1bc['query'][_0x9edd('0x3c')]);_0x42e664[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x42e664[_0x9edd('0x3d')]=qs[_0x9edd('0x3e')](_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x3e')]);_0x42e664[_0x9edd('0x3f')]=qs['filters'](_[_0x9edd('0x40')](_0x12c1bc['query'],_0x209aba[_0x9edd('0x36')]));if(_0x12c1bc['query'][_0x9edd('0x41')]){_0x42e664[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x42e664['where'],{'$or':_[_0x9edd('0x2e')](_0x19b6c1,function(_0xcbd0ef){if(_0xcbd0ef[_0x9edd('0x32')]!=='VIRTUAL'){var _0x1b5a43={};_0x1b5a43[_0xcbd0ef['name']]={'$like':'%'+_0x12c1bc[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x1b5a43;}})});}_0x42e664=_['merge']({},_0x42e664,_0x12c1bc[_0x9edd('0x43')]);var _0x40fdfb={'where':_0x42e664[_0x9edd('0x3f')]};return db[_0x9edd('0x2f')]['count'](_0x40fdfb)[_0x9edd('0x26')](function(_0x5bbdf8){_0x1fba7b[_0x9edd('0x20')]=_0x5bbdf8;if(_0x12c1bc[_0x9edd('0x35')]['includeAll']){_0x42e664[_0x9edd('0x44')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x42e664);})[_0x9edd('0x26')](function(_0x9cab86){_0x1fba7b[_0x9edd('0x45')]=_0x9cab86;return _0x1fba7b;})[_0x9edd('0x26')](respondWithFilteredResult(_0xbbf08f,_0x42e664))[_0x9edd('0x46')](handleError(_0xbbf08f,null));};exports[_0x9edd('0x47')]=function(_0x3ff512,_0x75efbe){var _0x18c149={'raw':![],'where':{'id':_0x3ff512[_0x9edd('0x48')]['id']}},_0x2b081a={};_0x2b081a[_0x9edd('0x33')]=_[_0x9edd('0x34')](db[_0x9edd('0x2f')][_0x9edd('0x30')]);_0x2b081a['query']=_[_0x9edd('0x34')](_0x3ff512[_0x9edd('0x35')]);_0x2b081a[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x2b081a[_0x9edd('0x33')],_0x2b081a[_0x9edd('0x35')]);_0x18c149[_0x9edd('0x38')]=_['intersection'](_0x2b081a['model'],qs['fields'](_0x3ff512[_0x9edd('0x35')]['fields']));_0x18c149[_0x9edd('0x38')]=_0x18c149[_0x9edd('0x38')][_0x9edd('0x49')]?_0x18c149[_0x9edd('0x38')]:_0x2b081a[_0x9edd('0x33')];if(_0x3ff512['query'][_0x9edd('0x4a')]){_0x18c149[_0x9edd('0x44')]=[{'all':!![]}];}_0x18c149=_[_0x9edd('0x42')]({},_0x18c149,_0x3ff512['options']);return db[_0x9edd('0x2f')][_0x9edd('0x4b')](_0x18c149)[_0x9edd('0x26')](handleEntityNotFound(_0x75efbe,null))[_0x9edd('0x26')](respondWithResult(_0x75efbe,null))[_0x9edd('0x46')](handleError(_0x75efbe,null));};exports[_0x9edd('0x4c')]=function(_0x4d4f33,_0x441e4a){return db[_0x9edd('0x2f')]['create'](_0x4d4f33[_0x9edd('0x4d')],{})[_0x9edd('0x26')](function(_0x4bb324){var _0x2bd089=_0x4d4f33[_0x9edd('0x4e')][_0x9edd('0x28')]({'plain':!![]});if(!_0x2bd089)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bd089[_0x9edd('0x4f')]===_0x9edd('0x4e')){var _0x317a60=_0x4bb324[_0x9edd('0x28')]({'plain':!![]});var _0x53f6e3=_0x9edd('0x50');return db[_0x9edd('0x51')][_0x9edd('0x4b')]({'where':{'name':_0x53f6e3,'userProfileId':_0x2bd089['userProfileId']},'raw':!![]})[_0x9edd('0x26')](function(_0x21f6ce){if(_0x21f6ce&&_0x21f6ce['autoAssociation']===0x0){return db[_0x9edd('0x52')]['create']({'name':_0x317a60[_0x9edd('0x2b')],'resourceId':_0x317a60['id'],'type':_0x21f6ce[_0x9edd('0x2b')],'sectionId':_0x21f6ce['id']},{})[_0x9edd('0x26')](function(){return _0x4bb324;});}else{return _0x4bb324;}})[_0x9edd('0x46')](function(_0x1e3c19){logger[_0x9edd('0x29')](_0x9edd('0x53'),_0x1e3c19);throw _0x1e3c19;});}return _0x4bb324;})[_0x9edd('0x26')](respondWithResult(_0x441e4a,0xc9))[_0x9edd('0x46')](handleError(_0x441e4a,null));};exports[_0x9edd('0x25')]=function(_0x31272d,_0x5a3b1d){if(_0x31272d[_0x9edd('0x4d')]['id']){delete _0x31272d[_0x9edd('0x4d')]['id'];}return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x31272d[_0x9edd('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a3b1d,null))['then'](saveUpdates(_0x31272d['body'],null))[_0x9edd('0x26')](respondWithResult(_0x5a3b1d,null))[_0x9edd('0x46')](handleError(_0x5a3b1d,null));};exports[_0x9edd('0x27')]=function(_0x35ddb3,_0x48a900){return db['CmList']['find']({'where':{'id':_0x35ddb3[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x48a900,null))[_0x9edd('0x26')](removeEntity(_0x48a900,null))[_0x9edd('0x46')](handleError(_0x48a900,null));};exports[_0x9edd('0x54')]=function(_0x41ec97,_0x25906c){return db[_0x9edd('0x2f')]['describe']()[_0x9edd('0x26')](respondWithResult(_0x25906c,null))['catch'](handleError(_0x25906c,null));};exports[_0x9edd('0x55')]=function(_0x6a1cfc,_0x4b7e68,_0x22b91a){if(_0x6a1cfc[_0x9edd('0x4d')]['id']){delete _0x6a1cfc[_0x9edd('0x4d')]['id'];}return db['CmList'][_0x9edd('0x4b')]({'where':{'id':_0x6a1cfc[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x4b7e68,null))[_0x9edd('0x26')](function(_0x1720b1){if(_0x1720b1){_0x6a1cfc[_0x9edd('0x4d')]['ListId']=_0x1720b1['id'];return db['Disposition'][_0x9edd('0x4c')](_0x6a1cfc['body']);}})[_0x9edd('0x26')](respondWithResult(_0x4b7e68,null))[_0x9edd('0x46')](handleError(_0x4b7e68,null));};exports[_0x9edd('0x56')]=function(_0x17d2f2,_0x5df1d7,_0x21ead2){var _0x507cce={'raw':![],'where':{}};var _0x3e5dca={};var _0x344692={'count':0x0,'rows':[]};return db[_0x9edd('0x2f')]['findOne']({'where':{'id':_0x17d2f2[_0x9edd('0x48')]['id']}})['then'](handleEntityNotFound(_0x5df1d7,null))[_0x9edd('0x26')](function(_0x4e1eda){if(_0x4e1eda){_0x3e5dca['model']=_[_0x9edd('0x34')](db['Disposition'][_0x9edd('0x30')]);_0x3e5dca[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x17d2f2['query']);_0x3e5dca[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x3e5dca[_0x9edd('0x33')],_0x3e5dca[_0x9edd('0x35')]);_0x507cce[_0x9edd('0x38')]=_['intersection'](_0x3e5dca['model'],qs[_0x9edd('0x39')](_0x17d2f2[_0x9edd('0x35')]['fields']));_0x507cce['attributes']=_0x507cce['attributes'][_0x9edd('0x49')]?_0x507cce['attributes']:_0x3e5dca['model'];if(!_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x3a')]('nolimit')){_0x507cce[_0x9edd('0x3c')]=qs[_0x9edd('0x3c')](_0x17d2f2[_0x9edd('0x35')]['limit']);_0x507cce[_0x9edd('0x21')]=qs['offset'](_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x507cce['order']=qs[_0x9edd('0x3e')](_0x17d2f2[_0x9edd('0x35')]['sort']);_0x507cce[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x17d2f2[_0x9edd('0x35')],_0x3e5dca['filters']));_0x507cce[_0x9edd('0x3f')]['ListId']=_0x4e1eda['id'];if(_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x41')]){_0x507cce[_0x9edd('0x3f')]=_['merge'](_0x507cce[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x507cce[_0x9edd('0x38')],function(_0x383cb9){var _0x25626a={};_0x25626a[_0x383cb9]={'$like':'%'+_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x25626a;})});}_0x507cce=_['merge']({},_0x507cce,_0x17d2f2['options']);return db[_0x9edd('0x57')][_0x9edd('0x20')]({'where':_0x507cce[_0x9edd('0x3f')]})[_0x9edd('0x26')](function(_0x1e2126){_0x344692['count']=_0x1e2126;if(_0x17d2f2[_0x9edd('0x35')][_0x9edd('0x4a')]){_0x507cce[_0x9edd('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x9edd('0x58')](_0x507cce);})[_0x9edd('0x26')](function(_0x4b1c12){_0x344692[_0x9edd('0x45')]=_0x4b1c12;return _0x344692;});}})[_0x9edd('0x26')](respondWithFilteredResult(_0x5df1d7,_0x507cce))['catch'](handleError(_0x5df1d7,null));};exports[_0x9edd('0x59')]=function(_0x1e2de6,_0x566be7,_0x3f08ac){return db['CmList']['find']({'where':{'id':_0x1e2de6[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x566be7,null))[_0x9edd('0x26')](function(_0x5b56c7){if(_0x5b56c7){return _0x5b56c7[_0x9edd('0x59')](_0x1e2de6[_0x9edd('0x35')]['ids']);}})[_0x9edd('0x26')](respondWithStatusCode(_0x566be7,null))[_0x9edd('0x46')](handleError(_0x566be7,null));};exports[_0x9edd('0x5a')]=function(_0x1ad198,_0x54ac71,_0x5e68db){return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x1ad198[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x54ac71,null))[_0x9edd('0x26')](function(_0x3cfd35){if(_0x3cfd35){var _0x195921=[];var _0x4786f8={'success':[],'errors':[]};return db[_0x9edd('0x5b')][_0x9edd('0x54')]()[_0x9edd('0x26')](function(_0x554241){if(_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]&&_[_0x9edd('0x5d')](_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')])){if(_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]['length']){_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]=_0x1ad198['body'][_0x9edd('0x5c')][_0x9edd('0x5e')](';')+';';}else{_0x1ad198['body'][_0x9edd('0x5c')]=null;}}else{_0x1ad198[_0x9edd('0x4d')][_0x9edd('0x5c')]=null;}if(_0x1ad198['body']&&_[_0x9edd('0x5d')](_0x1ad198[_0x9edd('0x4d')])){for(var _0x3f04d3=0x0;_0x3f04d3<_0x1ad198['body']['length'];_0x3f04d3+=0x1){_0x1ad198['body'][_0x3f04d3]['ListId']=_0x1ad198[_0x9edd('0x48')]['id'];_0x195921[_0x9edd('0x5f')](_0x1ad198[_0x9edd('0x4d')][_0x3f04d3]);}return BPromise['each'](_0x195921,function(_0x53e141){return db['CmContact'][_0x9edd('0x4c')](_[_0x9edd('0x60')](_0x53e141,[_0x9edd('0x61'),'id'])||{},{'fields':_[_0x9edd('0x34')](_0x554241),'raw':!![]})[_0x9edd('0x26')](function(_0x18b25e){_0x4786f8[_0x9edd('0x62')][_0x9edd('0x5f')](_0x18b25e[_0x9edd('0x63')]);})[_0x9edd('0x46')](function(_0x2523b5){_0x4786f8[_0x9edd('0x64')]['push']({'data':_0x53e141,'error':_0x2523b5[_0x9edd('0x65')]});});})[_0x9edd('0x26')](function(_0x33b5dc){return _0x4786f8;})[_0x9edd('0x46')](function(_0x104afc){return _0x104afc;});}else{_0x54ac71[_0x9edd('0x1d')](0x190)[_0x9edd('0x1f')]({'message':_0x9edd('0x66')});}});}})['then'](respondWithResult(_0x54ac71,null))['catch'](handleError(_0x54ac71,null));};exports[_0x9edd('0x67')]=function(_0x4ec836,_0x35950b,_0x4a685e){var _0x21c35f;return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x4ec836[_0x9edd('0x48')]['id']},'include':[{'model':db[_0x9edd('0x68')],'as':'CustomFields'}]})[_0x9edd('0x26')](handleEntityNotFound(_0x35950b,null))[_0x9edd('0x26')](function(_0x42d546){if(_0x42d546){_0x21c35f=_0x42d546;return db[_0x9edd('0x5b')][_0x9edd('0x30')];}})['then'](function(_0x33a077){if(_0x33a077){var _0x3ff07e={};var _0x3ec531={};_0x3ec531[_0x9edd('0x33')]=_[_0x9edd('0x69')](_['keys'](_0x33a077),_['map'](_0x21c35f['CustomFields'],function(_0x50316a){return util['format'](_0x9edd('0x6a'),_0x50316a['id']);}));_0x3ec531['query']=_['keys'](_0x4ec836[_0x9edd('0x35')]);_0x3ec531[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x3ec531[_0x9edd('0x33')],_0x3ec531[_0x9edd('0x35')]);_0x3ff07e[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x3ec531[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0x4ec836[_0x9edd('0x35')]['fields']));_0x3ff07e[_0x9edd('0x38')]=_0x3ff07e[_0x9edd('0x38')][_0x9edd('0x49')]?_0x3ff07e[_0x9edd('0x38')]:_0x3ec531[_0x9edd('0x33')];if(!_0x4ec836[_0x9edd('0x35')][_0x9edd('0x3a')](_0x9edd('0x3b'))){_0x3ff07e['limit']=qs['limit'](_0x4ec836[_0x9edd('0x35')][_0x9edd('0x3c')]);_0x3ff07e[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0x4ec836[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x3ff07e[_0x9edd('0x3d')]=qs[_0x9edd('0x3e')](_0x4ec836[_0x9edd('0x35')][_0x9edd('0x3e')]);_0x3ff07e[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x4ec836[_0x9edd('0x35')],_0x3ec531['filters']));_0x3ff07e[_0x9edd('0x6b')]=!![];if(_0x4ec836[_0x9edd('0x35')]['filter']){_0x3ff07e[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x3ff07e[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x3ff07e['attributes'],function(_0x3429b6){var _0x398c34={};_0x398c34[_0x3429b6]={'$like':'%'+_0x4ec836[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x398c34;})});}_0x3ff07e=_[_0x9edd('0x42')]({},_0x3ff07e,_0x4ec836['options']);return _0x21c35f[_0x9edd('0x67')](_0x3ff07e);}})[_0x9edd('0x26')](respondWithResult(_0x35950b,null))[_0x9edd('0x46')](handleError(_0x35950b,null));};exports[_0x9edd('0x6c')]=function(_0xa8d944,_0x59927d,_0x4d0734){var _0x2f8ce1;return db['CmList'][_0x9edd('0x4b')]({'where':{'id':_0xa8d944['params']['id']},'include':[{'model':db[_0x9edd('0x68')],'as':_0x9edd('0x6d')}]})[_0x9edd('0x26')](handleEntityNotFound(_0x59927d,null))[_0x9edd('0x26')](function(_0x2c7245){if(_0x2c7245){_0x2f8ce1=_0x2c7245;return db[_0x9edd('0x5b')]['rawAttributes'];}})[_0x9edd('0x26')](function(_0x33beb7){if(_0x33beb7){var _0x3aae72={};var _0x39d6dd={};_0x39d6dd[_0x9edd('0x33')]=_[_0x9edd('0x69')](_[_0x9edd('0x34')](_0x33beb7),_[_0x9edd('0x2e')](_0x2f8ce1['CustomFields'],function(_0x195088){return util[_0x9edd('0x6e')](_0x9edd('0x6a'),_0x195088['id']);}));_0x39d6dd[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0xa8d944[_0x9edd('0x35')]);_0x39d6dd[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x39d6dd[_0x9edd('0x33')],_0x39d6dd[_0x9edd('0x35')]);_0x3aae72[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x39d6dd[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0xa8d944[_0x9edd('0x35')][_0x9edd('0x39')]));_0x3aae72[_0x9edd('0x38')]=_0x3aae72[_0x9edd('0x38')][_0x9edd('0x49')]?_0x3aae72[_0x9edd('0x38')]:_0x39d6dd[_0x9edd('0x33')];if(!_0xa8d944['query'][_0x9edd('0x3a')]('nolimit')){_0x3aae72['limit']=qs[_0x9edd('0x3c')](_0xa8d944[_0x9edd('0x35')][_0x9edd('0x3c')]);_0x3aae72[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0xa8d944[_0x9edd('0x35')][_0x9edd('0x21')]);}_0x3aae72[_0x9edd('0x3d')]=qs[_0x9edd('0x3e')](_0xa8d944[_0x9edd('0x35')]['sort']);_0x3aae72[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_['pick'](_0xa8d944['query'],_0x39d6dd[_0x9edd('0x36')]));_0x3aae72[_0x9edd('0x6b')]=!![];if(_0xa8d944[_0x9edd('0x35')][_0x9edd('0x41')]){_0x3aae72['where']=_['merge'](_0x3aae72[_0x9edd('0x3f')],{'$or':_['map'](_0x3aae72[_0x9edd('0x38')],function(_0x24a9d1){var _0x3e2404={};_0x3e2404[_0x24a9d1]={'$like':'%'+_0xa8d944['query']['filter']+'%'};return _0x3e2404;})});}_0x3aae72=_['merge']({},_0x3aae72,_0xa8d944[_0x9edd('0x43')]);return _0x2f8ce1[_0x9edd('0x67')](_0x3aae72);}})[_0x9edd('0x26')](function(_0x5bfbfd){if(!_[_0x9edd('0x6f')](_0x5bfbfd)){var _0x402574=toCsv(_0x5bfbfd);var _0x4f12b9=Date[_0x9edd('0x70')]();fs[_0x9edd('0x71')](util['format']('/tmp/list_%d_%s.csv',_0x2f8ce1['id'],_0x4f12b9),_0x402574);_0x59927d[_0x9edd('0x72')](_0x9edd('0x73'),'attachment;\x20filename='+util[_0x9edd('0x6e')](_0x9edd('0x74'),_0x2f8ce1['id'],_0x4f12b9));_0x59927d['setHeader'](_0x9edd('0x75'),'text/csv');return _0x59927d[_0x9edd('0x76')](util[_0x9edd('0x6e')](_0x9edd('0x77'),_0x2f8ce1['id'],_0x4f12b9));}else{return _0x59927d[_0x9edd('0x1c')](0xcc);}})[_0x9edd('0x46')](handleError(_0x59927d,null));};exports[_0x9edd('0x78')]=function(_0x58bc3c,_0x2fe810,_0x22aa2b){var _0x68047e;delete _0x58bc3c['body']['id'];return db[_0x9edd('0x2f')]['findOne']({'where':{'id':_0x58bc3c[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x2fe810,null))[_0x9edd('0x26')](function(_0x41b0ea){if(_0x41b0ea){return db['sequelize']['transaction'](function(_0x4e9242){return db[_0x9edd('0x68')][_0x9edd('0x4c')](_0x58bc3c[_0x9edd('0x4d')],{'transaction':_0x4e9242})['then'](function(_0x41a761){_0x68047e=_0x41a761;return _0x41b0ea[_0x9edd('0x79')](_0x41a761,{'transaction':_0x4e9242});})[_0x9edd('0x26')](function(){var _0xb66eaf={'type':db[_0x9edd('0x7a')][_0x9edd('0x7b')],'transaction':_0x4e9242};switch(_0x58bc3c['body']['type']){case _0x9edd('0x7c'):_0xb66eaf[_0x9edd('0x32')]=db[_0x9edd('0x7a')]['TEXT'];break;case _0x9edd('0x7d'):_0xb66eaf[_0x9edd('0x32')]=db[_0x9edd('0x7a')][_0x9edd('0x7e')];break;case'switch':_0xb66eaf[_0x9edd('0x32')]=db['Sequelize'][_0x9edd('0x7f')];_0xb66eaf[_0x9edd('0x80')]=![];break;default:}return db[_0x9edd('0x81')][_0x9edd('0x82')][_0x9edd('0x83')]('cm_contacts',util[_0x9edd('0x6e')]('cf_%s',_0x68047e['id']),_0xb66eaf);})[_0x9edd('0x26')](function(){return _0x68047e;});});}})['then'](respondWithResult(_0x2fe810,null))[_0x9edd('0x46')](handleError(_0x2fe810,null));};exports['getCustomFields']=function(_0x363c5c,_0x96e3d7,_0x3bc495){var _0x575377={};var _0x244dce={};var _0x7512ea;var _0x1c5038;return db[_0x9edd('0x2f')][_0x9edd('0x84')]({'where':{'id':_0x363c5c[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x96e3d7,null))[_0x9edd('0x26')](function(_0x365b27){if(_0x365b27){_0x7512ea=_0x365b27;_0x244dce[_0x9edd('0x33')]=_[_0x9edd('0x34')](db[_0x9edd('0x68')][_0x9edd('0x30')]);_0x244dce[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x363c5c[_0x9edd('0x35')]);_0x244dce[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x244dce[_0x9edd('0x33')],_0x244dce[_0x9edd('0x35')]);_0x575377[_0x9edd('0x38')]=_[_0x9edd('0x37')](_0x244dce['model'],qs[_0x9edd('0x39')](_0x363c5c['query'][_0x9edd('0x39')]));_0x575377[_0x9edd('0x38')]=_0x575377[_0x9edd('0x38')][_0x9edd('0x49')]?_0x575377[_0x9edd('0x38')]:_0x244dce['model'];_0x575377[_0x9edd('0x3d')]=qs['sort'](_0x363c5c[_0x9edd('0x35')][_0x9edd('0x3e')]);_0x575377[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x363c5c[_0x9edd('0x35')],_0x244dce['filters']));_0x575377[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x575377['where'],{'$or':[{'ListId':_0x365b27['id']},{'ListId':null}]});if(_0x363c5c['query']['filter']){_0x575377['where']=_[_0x9edd('0x42')](_0x575377[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x575377[_0x9edd('0x38')],function(_0x239774){var _0x229a92={};_0x229a92[_0x239774]={'$like':'%'+_0x363c5c[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x229a92;})});}_0x575377=_[_0x9edd('0x42')]({},_0x575377,_0x363c5c[_0x9edd('0x43')]);return db['CmCustomField'][_0x9edd('0x85')](_0x575377);}})['then'](respondWithResult(_0x96e3d7,null))['catch'](handleError(_0x96e3d7,null));};exports[_0x9edd('0x86')]=function(_0x2dafd2,_0x35e9b9,_0x42a142){return db[_0x9edd('0x2f')]['find']({'where':{'id':_0x2dafd2[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x35e9b9,null))[_0x9edd('0x26')](function(_0x181469){if(_0x181469){return _0x181469['addAgents'](_0x2dafd2[_0x9edd('0x4d')][_0x9edd('0x61')],_[_0x9edd('0x60')](_0x2dafd2[_0x9edd('0x4d')],[_0x9edd('0x61'),'id'])||{})[_0x9edd('0x87')](function(_0x55052b){for(var _0x9ff2d3=0x0;_0x9ff2d3<_0x2dafd2[_0x9edd('0x4d')][_0x9edd('0x61')][_0x9edd('0x49')];_0x9ff2d3+=0x1){socket['emit'](_0x9edd('0x88'),{'UserId':_0x2dafd2[_0x9edd('0x4d')][_0x9edd('0x61')][_0x9ff2d3],'CmListId':_0x2dafd2[_0x9edd('0x48')]['id']});}return _0x55052b;});}})[_0x9edd('0x26')](respondWithResult(_0x35e9b9,null))[_0x9edd('0x46')](handleError(_0x35e9b9,null));};exports[_0x9edd('0x89')]=function(_0x39e3b3,_0x4a3955,_0x4a19a0){return db['CmList'][_0x9edd('0x4b')]({'where':{'id':_0x39e3b3[_0x9edd('0x48')]['id']}})[_0x9edd('0x26')](handleEntityNotFound(_0x4a3955,null))[_0x9edd('0x26')](function(_0x223c42){if(_0x223c42){return _0x223c42[_0x9edd('0x89')](_0x39e3b3[_0x9edd('0x35')][_0x9edd('0x61')])[_0x9edd('0x26')](function(){if(_[_0x9edd('0x5d')](_0x39e3b3['query'][_0x9edd('0x61')])){for(var _0x56dc7e=0x0;_0x56dc7e<_0x39e3b3['query'][_0x9edd('0x61')][_0x9edd('0x49')];_0x56dc7e+=0x1){socket[_0x9edd('0x8a')]('userCmList:remove',{'UserId':Number(_0x39e3b3['query']['ids'][_0x56dc7e]),'CmListId':Number(_0x39e3b3['params']['id'])});}}else{socket['emit'](_0x9edd('0x8b'),{'UserId':Number(_0x39e3b3[_0x9edd('0x35')][_0x9edd('0x61')]),'CmListId':Number(_0x39e3b3['params']['id'])});}});}})[_0x9edd('0x26')](respondWithStatusCode(_0x4a3955,null))[_0x9edd('0x46')](handleError(_0x4a3955,null));};exports[_0x9edd('0x8c')]=function(_0x557156,_0x2c2f00,_0x4afe0b){var _0x16a1c8={};var _0x1a2376={};var _0xc84fb7;var _0x259d33;return db['CmList'][_0x9edd('0x84')]({'where':{'id':_0x557156[_0x9edd('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c2f00,null))[_0x9edd('0x26')](function(_0x36e825){if(_0x36e825){_0xc84fb7=_0x36e825;_0x1a2376[_0x9edd('0x33')]=_[_0x9edd('0x34')](db['User'][_0x9edd('0x30')]);_0x1a2376[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x557156[_0x9edd('0x35')]);_0x1a2376[_0x9edd('0x36')]=_[_0x9edd('0x37')](_0x1a2376[_0x9edd('0x33')],_0x1a2376['query']);_0x16a1c8[_0x9edd('0x38')]=_['intersection'](_0x1a2376[_0x9edd('0x33')],qs[_0x9edd('0x39')](_0x557156['query'][_0x9edd('0x39')]));_0x16a1c8[_0x9edd('0x38')]=_0x16a1c8[_0x9edd('0x38')]['length']?_0x16a1c8[_0x9edd('0x38')]:_0x1a2376[_0x9edd('0x33')];_0x16a1c8[_0x9edd('0x3d')]=qs['sort'](_0x557156[_0x9edd('0x35')]['sort']);_0x16a1c8[_0x9edd('0x3f')]=qs[_0x9edd('0x36')](_[_0x9edd('0x40')](_0x557156[_0x9edd('0x35')],_0x1a2376['filters']));if(_0x557156['query'][_0x9edd('0x41')]){_0x16a1c8[_0x9edd('0x3f')]=_[_0x9edd('0x42')](_0x16a1c8[_0x9edd('0x3f')],{'$or':_[_0x9edd('0x2e')](_0x16a1c8['attributes'],function(_0x1a1938){var _0x235762={};_0x235762[_0x1a1938]={'$like':'%'+_0x557156[_0x9edd('0x35')][_0x9edd('0x41')]+'%'};return _0x235762;})});}_0x16a1c8=_[_0x9edd('0x42')]({},_0x16a1c8,_0x557156[_0x9edd('0x43')]);return _0xc84fb7[_0x9edd('0x8c')](_0x16a1c8);}})[_0x9edd('0x26')](function(_0x3173fa){if(_0x3173fa){_0x259d33=_0x3173fa[_0x9edd('0x49')];if(!_0x557156[_0x9edd('0x35')][_0x9edd('0x3a')](_0x9edd('0x3b'))){_0x16a1c8['limit']=qs[_0x9edd('0x3c')](_0x557156[_0x9edd('0x35')][_0x9edd('0x3c')]);_0x16a1c8[_0x9edd('0x21')]=qs['offset'](_0x557156[_0x9edd('0x35')][_0x9edd('0x21')]);}return _0xc84fb7[_0x9edd('0x8c')](_0x16a1c8);}})['then'](function(_0x910adf){if(_0x910adf){return _0x910adf?{'count':_0x259d33,'rows':_0x910adf}:null;}})['then'](respondWithResult(_0x2c2f00,null))['catch'](handleError(_0x2c2f00,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 601b62a..525f383 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 _0x42bb=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList','setMaxListeners','update'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x42bb,0xeb));var _0xb42b=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x42bb[_0x580576];return _0x3f55a0;};'use strict';var EventEmitter=require(_0xb42b('0x0'));var CmList=require(_0xb42b('0x1'))['db'][_0xb42b('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb42b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb42b('0x4'),'afterDestroy':_0xb42b('0x5')};function emitEvent(_0x34f0c6){return function(_0x2aa0ec,_0x2eb950,_0x4e4943){CmListEvents[_0xb42b('0x6')](_0x34f0c6+':'+_0x2aa0ec['id'],_0x2aa0ec);CmListEvents[_0xb42b('0x6')](_0x34f0c6,_0x2aa0ec);_0x4e4943(null);};}for(var e in events){if(events[_0xb42b('0x7')](e)){var event=events[e];CmList[_0xb42b('0x8')](e,emitEvent(event));}}module[_0xb42b('0x9')]=CmListEvents; \ No newline at end of file +var _0x90ae=['emit','hasOwnProperty','hook','events','setMaxListeners','save','update'];(function(_0x390143,_0x2b54ac){var _0x11361b=function(_0x3666c3){while(--_0x3666c3){_0x390143['push'](_0x390143['shift']());}};_0x11361b(++_0x2b54ac);}(_0x90ae,0xc0));var _0xe90a=function(_0x80517,_0x4df839){_0x80517=_0x80517-0x0;var _0x49f7de=_0x90ae[_0x80517];return _0x49f7de;};'use strict';var EventEmitter=require(_0xe90a('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xe90a('0x1')](0x0);var events={'afterCreate':_0xe90a('0x2'),'afterUpdate':_0xe90a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1dc93d){return function(_0x15ff9a,_0x4e5f86,_0x4e6c37){CmListEvents[_0xe90a('0x4')](_0x1dc93d+':'+_0x15ff9a['id'],_0x15ff9a);CmListEvents[_0xe90a('0x4')](_0x1dc93d,_0x15ff9a);_0x4e6c37(null);};}for(var e in events){if(events[_0xe90a('0x5')](e)){var event=events[e];CmList[_0xe90a('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index d99e145..dd74ced 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 _0x34e4=['bluebird','request-promise','path','rimraf','./cmList.attributes','exports','lodash','util','../../config/logger','api'];(function(_0xf31593,_0x3da036){var _0x4bd676=function(_0x382615){while(--_0x382615){_0xf31593['push'](_0xf31593['shift']());}};_0x4bd676(++_0x3da036);}(_0x34e4,0x196));var _0x434e=function(_0x1552a7,_0x5361a5){_0x1552a7=_0x1552a7-0x0;var _0x5ee752=_0x34e4[_0x1552a7];return _0x5ee752;};'use strict';var _=require(_0x434e('0x0'));var util=require(_0x434e('0x1'));var logger=require(_0x434e('0x2'))(_0x434e('0x3'));var moment=require('moment');var BPromise=require(_0x434e('0x4'));var rp=require(_0x434e('0x5'));var fs=require('fs');var path=require(_0x434e('0x6'));var rimraf=require(_0x434e('0x7'));var config=require('../../config/environment');var attributes=require(_0x434e('0x8'));module[_0x434e('0x9')]=function(_0x936346,_0x57d3fc){return _0x936346['define']('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0922=['define','util','../../config/logger','api','path','../../config/environment','./cmList.attributes','exports'];(function(_0x54e05d,_0xe887de){var _0x39c88f=function(_0x1fd88b){while(--_0x1fd88b){_0x54e05d['push'](_0x54e05d['shift']());}};_0x39c88f(++_0xe887de);}(_0x0922,0x1e1));var _0x2092=function(_0x36d203,_0x3653f3){_0x36d203=_0x36d203-0x0;var _0x2f9e62=_0x0922[_0x36d203];return _0x2f9e62;};'use strict';var _=require('lodash');var util=require(_0x2092('0x0'));var logger=require(_0x2092('0x1'))(_0x2092('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2092('0x3'));var rimraf=require('rimraf');var config=require(_0x2092('0x4'));var attributes=require(_0x2092('0x5'));module[_0x2092('0x6')]=function(_0x23e2a7,_0x10639f){return _0x23e2a7[_0x2092('0x7')]('CmList',attributes,{'tableName':'cm_lists','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 230d520..991e7a8 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 _0xa89b=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x53056c,_0x1d56a9){var _0x5cec88=function(_0x2ad06b){while(--_0x2ad06b){_0x53056c['push'](_0x53056c['shift']());}};_0x5cec88(++_0x1d56a9);}(_0xa89b,0x75));var _0xba89=function(_0x5d0792,_0x486759){_0x5d0792=_0x5d0792-0x0;var _0x2885a6=_0xa89b[_0x5d0792];return _0x2885a6;};'use strict';var _=require('lodash');var util=require(_0xba89('0x0'));var moment=require(_0xba89('0x1'));var BPromise=require(_0xba89('0x2'));var rs=require(_0xba89('0x3'));var fs=require('fs');var Redis=require(_0xba89('0x4'));var db=require(_0xba89('0x5'))['db'];var utils=require(_0xba89('0x6'));var logger=require(_0xba89('0x7'))(_0xba89('0x8'));var config=require(_0xba89('0x9'));var jayson=require(_0xba89('0xa'));var client=jayson['client'][_0xba89('0xb')]({'port':0x232a});config[_0xba89('0xc')]=_[_0xba89('0xd')](config[_0xba89('0xc')],{'host':_0xba89('0xe'),'port':0x18eb});var socket=require(_0xba89('0xf'))(new Redis(config[_0xba89('0xc')]));require(_0xba89('0x10'))[_0xba89('0x11')](socket);function respondWithRpcPromise(_0x17ed07,_0x186a88,_0x280ff3){return new BPromise(function(_0x125ba6,_0x3959b9){return client[_0xba89('0x12')](_0x17ed07,_0x280ff3)[_0xba89('0x13')](function(_0x5122e3){logger[_0xba89('0x14')](_0xba89('0x15'),_0x186a88,_0xba89('0x16'));logger[_0xba89('0x17')]('CmList,\x20%s,\x20%s,\x20%s',_0x186a88,'request\x20sent',JSON[_0xba89('0x18')](_0x5122e3));if(_0x5122e3[_0xba89('0x19')]){if(_0x5122e3[_0xba89('0x19')]['code']===0x1f4){logger[_0xba89('0x19')](_0xba89('0x15'),_0x186a88,_0x5122e3[_0xba89('0x19')][_0xba89('0x1a')]);return _0x3959b9(_0x5122e3[_0xba89('0x19')][_0xba89('0x1a')]);}logger['error'](_0xba89('0x15'),_0x186a88,_0x5122e3[_0xba89('0x19')][_0xba89('0x1a')]);return _0x125ba6(_0x5122e3[_0xba89('0x19')][_0xba89('0x1a')]);}else{logger[_0xba89('0x14')](_0xba89('0x15'),_0x186a88,_0xba89('0x16'));_0x125ba6(_0x5122e3[_0xba89('0x1b')][_0xba89('0x1a')]);}})[_0xba89('0x1c')](function(_0x5e237f){logger[_0xba89('0x19')](_0xba89('0x15'),_0x186a88,_0x5e237f);_0x3959b9(_0x5e237f);});});} \ No newline at end of file +var _0x0214=['socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x5d35bb,_0x46ec23){var _0x1643ad=function(_0x1deccc){while(--_0x1deccc){_0x5d35bb['push'](_0x5d35bb['shift']());}};_0x1643ad(++_0x46ec23);}(_0x0214,0xf0));var _0x4021=function(_0x120d30,_0x1d577c){_0x120d30=_0x120d30-0x0;var _0x39d979=_0x0214[_0x120d30];return _0x39d979;};'use strict';var _=require(_0x4021('0x0'));var util=require(_0x4021('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4021('0x2'));var fs=require('fs');var Redis=require(_0x4021('0x3'));var db=require(_0x4021('0x4'))['db'];var utils=require(_0x4021('0x5'));var logger=require('../../config/logger')(_0x4021('0x6'));var config=require(_0x4021('0x7'));var jayson=require(_0x4021('0x8'));var client=jayson[_0x4021('0x9')]['http']({'port':0x232a});config[_0x4021('0xa')]=_[_0x4021('0xb')](config[_0x4021('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4021('0xc'))(new Redis(config[_0x4021('0xa')]));require(_0x4021('0xd'))[_0x4021('0xe')](socket);function respondWithRpcPromise(_0x11b02d,_0x15360e,_0x575804){return new BPromise(function(_0x39403b,_0x5dde40){return client[_0x4021('0xf')](_0x11b02d,_0x575804)[_0x4021('0x10')](function(_0x140889){logger[_0x4021('0x11')](_0x4021('0x12'),_0x15360e,_0x4021('0x13'));logger[_0x4021('0x14')](_0x4021('0x15'),_0x15360e,'request\x20sent',JSON[_0x4021('0x16')](_0x140889));if(_0x140889[_0x4021('0x17')]){if(_0x140889[_0x4021('0x17')][_0x4021('0x18')]===0x1f4){logger[_0x4021('0x17')]('CmList,\x20%s,\x20%s',_0x15360e,_0x140889[_0x4021('0x17')][_0x4021('0x19')]);return _0x5dde40(_0x140889['error']['message']);}logger['error'](_0x4021('0x12'),_0x15360e,_0x140889['error'][_0x4021('0x19')]);return _0x39403b(_0x140889[_0x4021('0x17')][_0x4021('0x19')]);}else{logger['info'](_0x4021('0x12'),_0x15360e,_0x4021('0x13'));_0x39403b(_0x140889[_0x4021('0x1a')][_0x4021('0x19')]);}})[_0x4021('0x1b')](function(_0x240ef2){logger[_0x4021('0x17')]('CmList,\x20%s,\x20%s',_0x15360e,_0x240ef2);_0x5dde40(_0x240ef2);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 58f7270..210eb9c 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 _0x4fb4=['cmList:','save','remove','update','removeListener','register','length'];(function(_0x5eca50,_0xc1e3f8){var _0x41fb84=function(_0x4ce3f3){while(--_0x4ce3f3){_0x5eca50['push'](_0x5eca50['shift']());}};_0x41fb84(++_0xc1e3f8);}(_0x4fb4,0x190));var _0x44fb=function(_0x4dfc33,_0x21fe4c){_0x4dfc33=_0x4dfc33-0x0;var _0x4d04be=_0x4fb4[_0x4dfc33];return _0x4d04be;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x44fb('0x0'),_0x44fb('0x1'),_0x44fb('0x2')];function createListener(_0x29a2fe,_0x24e38d){return function(_0x42dbbb){_0x24e38d['emit'](_0x29a2fe,_0x42dbbb);};}function removeListener(_0xec6dce,_0x953327){return function(){CmListEvents[_0x44fb('0x3')](_0xec6dce,_0x953327);};}exports[_0x44fb('0x4')]=function(_0x375d33){for(var _0x173e70=0x0,_0x464af5=events[_0x44fb('0x5')];_0x173e70<_0x464af5;_0x173e70++){var _0x59aa6d=events[_0x173e70];var _0x87f716=createListener(_0x44fb('0x6')+_0x59aa6d,_0x375d33);CmListEvents['on'](_0x59aa6d,_0x87f716);}}; \ No newline at end of file +var _0x0dec=['removeListener','register','length','cmList:','./cmList.events','save','remove','update'];(function(_0x14bd50,_0x41fec1){var _0x14998e=function(_0x421eaa){while(--_0x421eaa){_0x14bd50['push'](_0x14bd50['shift']());}};_0x14998e(++_0x41fec1);}(_0x0dec,0x11c));var _0xc0de=function(_0x28a70d,_0x451a9f){_0x28a70d=_0x28a70d-0x0;var _0x3d571f=_0x0dec[_0x28a70d];return _0x3d571f;};'use strict';var CmListEvents=require(_0xc0de('0x0'));var events=[_0xc0de('0x1'),_0xc0de('0x2'),_0xc0de('0x3')];function createListener(_0x5cacd3,_0x210d57){return function(_0x5c1905){_0x210d57['emit'](_0x5cacd3,_0x5c1905);};}function removeListener(_0x24091c,_0x1a263e){return function(){CmListEvents[_0xc0de('0x4')](_0x24091c,_0x1a263e);};}exports[_0xc0de('0x5')]=function(_0xae49db){for(var _0x194937=0x0,_0x3639e8=events[_0xc0de('0x6')];_0x194937<_0x3639e8;_0x194937++){var _0x4090cf=events[_0x194937];var _0x2d9bae=createListener(_0xc0de('0x7')+_0x4090cf,_0xae49db);CmListEvents['on'](_0x4090cf,_0x2d9bae);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index b543cdf..c165f7c 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 _0xccfb=['getContactsCsv','/:id/users','getAgents','post','create','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','put','update','delete','removeAgents','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv'];(function(_0x130705,_0x2d266b){var _0x1fa991=function(_0x395639){while(--_0x395639){_0x130705['push'](_0x130705['shift']());}};_0x1fa991(++_0x2d266b);}(_0xccfb,0x1a2));var _0xbccf=function(_0x1e9990,_0x1ff352){_0x1e9990=_0x1e9990-0x0;var _0x3ea157=_0xccfb[_0x1e9990];return _0x3ea157;};'use strict';var multer=require('multer');var util=require(_0xbccf('0x0'));var path=require('path');var timeout=require(_0xbccf('0x1'));var express=require(_0xbccf('0x2'));var router=express[_0xbccf('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbccf('0x4'));var config=require(_0xbccf('0x5'));var controller=require('./cmList.controller');router[_0xbccf('0x6')]('/',auth[_0xbccf('0x7')](),controller[_0xbccf('0x8')]);router[_0xbccf('0x6')](_0xbccf('0x9'),auth[_0xbccf('0x7')](),controller['describe']);router[_0xbccf('0x6')](_0xbccf('0xa'),auth[_0xbccf('0x7')](),controller['show']);router['get'](_0xbccf('0xb'),auth[_0xbccf('0x7')](),controller[_0xbccf('0xc')]);router[_0xbccf('0x6')](_0xbccf('0xd'),auth['isAuthenticated'](),controller[_0xbccf('0xe')]);router[_0xbccf('0x6')](_0xbccf('0xf'),auth[_0xbccf('0x7')](),controller[_0xbccf('0x10')]);router[_0xbccf('0x6')]('/:id/fields',auth[_0xbccf('0x7')](),controller['getCustomFields']);router[_0xbccf('0x6')](_0xbccf('0x11'),auth[_0xbccf('0x7')](),controller[_0xbccf('0x12')]);router[_0xbccf('0x13')]('/',auth['isAuthenticated'](),controller[_0xbccf('0x14')]);router['post'](_0xbccf('0xb'),auth[_0xbccf('0x7')](),controller[_0xbccf('0x15')]);router[_0xbccf('0x13')](_0xbccf('0xd'),auth[_0xbccf('0x7')](),controller[_0xbccf('0x16')]);router[_0xbccf('0x13')](_0xbccf('0x17'),auth[_0xbccf('0x7')](),controller[_0xbccf('0x18')]);router[_0xbccf('0x13')]('/:id/users',auth[_0xbccf('0x7')](),controller[_0xbccf('0x19')]);router[_0xbccf('0x1a')](_0xbccf('0xa'),auth[_0xbccf('0x7')](),controller[_0xbccf('0x1b')]);router[_0xbccf('0x1c')]('/:id',auth[_0xbccf('0x7')](),controller['destroy']);router[_0xbccf('0x1c')]('/:id/dispositions',auth[_0xbccf('0x7')](),controller['removeDispositions']);router['delete'](_0xbccf('0x11'),auth['isAuthenticated'](),controller[_0xbccf('0x1d')]);module[_0xbccf('0x1e')]=router; \ No newline at end of file +var _0xf46d=['/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','create','addDisposition','addContacts','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions'];(function(_0x896a11,_0x2cf3c7){var _0x2766d4=function(_0x12d9f5){while(--_0x12d9f5){_0x896a11['push'](_0x896a11['shift']());}};_0x2766d4(++_0x2cf3c7);}(_0xf46d,0x192));var _0xdf46=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0xf46d[_0x273dc5];return _0x46dae7;};'use strict';var multer=require('multer');var util=require(_0xdf46('0x0'));var path=require(_0xdf46('0x1'));var timeout=require('connect-timeout');var express=require(_0xdf46('0x2'));var router=express[_0xdf46('0x3')]();var auth=require(_0xdf46('0x4'));var interaction=require(_0xdf46('0x5'));var config=require(_0xdf46('0x6'));var controller=require('./cmList.controller');router[_0xdf46('0x7')]('/',auth[_0xdf46('0x8')](),controller['index']);router[_0xdf46('0x7')](_0xdf46('0x9'),auth[_0xdf46('0x8')](),controller[_0xdf46('0xa')]);router[_0xdf46('0x7')](_0xdf46('0xb'),auth['isAuthenticated'](),controller[_0xdf46('0xc')]);router[_0xdf46('0x7')](_0xdf46('0xd'),auth[_0xdf46('0x8')](),controller['getDispositions']);router['get'](_0xdf46('0xe'),auth[_0xdf46('0x8')](),controller['getContacts']);router[_0xdf46('0x7')](_0xdf46('0xf'),auth[_0xdf46('0x8')](),controller[_0xdf46('0x10')]);router[_0xdf46('0x7')](_0xdf46('0x11'),auth[_0xdf46('0x8')](),controller[_0xdf46('0x12')]);router['get'](_0xdf46('0x13'),auth[_0xdf46('0x8')](),controller['getAgents']);router[_0xdf46('0x14')]('/',auth['isAuthenticated'](),controller[_0xdf46('0x15')]);router[_0xdf46('0x14')](_0xdf46('0xd'),auth['isAuthenticated'](),controller[_0xdf46('0x16')]);router[_0xdf46('0x14')](_0xdf46('0xe'),auth[_0xdf46('0x8')](),controller[_0xdf46('0x17')]);router[_0xdf46('0x14')]('/:id/fields',auth[_0xdf46('0x8')](),controller['addCustomField']);router['post'](_0xdf46('0x13'),auth[_0xdf46('0x8')](),controller[_0xdf46('0x18')]);router[_0xdf46('0x19')]('/:id',auth[_0xdf46('0x8')](),controller[_0xdf46('0x1a')]);router[_0xdf46('0x1b')](_0xdf46('0xb'),auth[_0xdf46('0x8')](),controller[_0xdf46('0x1c')]);router['delete'](_0xdf46('0xd'),auth[_0xdf46('0x8')](),controller[_0xdf46('0x1d')]);router[_0xdf46('0x1b')](_0xdf46('0x13'),auth[_0xdf46('0x8')](),controller[_0xdf46('0x1e')]);module[_0xdf46('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 a2a92e2..6d55794 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 _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x2ba4ac,_0x297e64){var _0x47d9bd=function(_0x17bffd){while(--_0x17bffd){_0x2ba4ac['push'](_0x2ba4ac['shift']());}};_0x47d9bd(++_0x297e64);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x33c3c4,_0x35c1b0){var _0x464b59=function(_0xc35800){while(--_0xc35800){_0x33c3c4['push'](_0x33c3c4['shift']());}};_0x464b59(++_0x35c1b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index bf3040c..254d7bb 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 _0xe6b0=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','json','count','offset','status','Content-Range','apply','save','update','destroy','end','error','stack','name','body','find','params','then','catch','Condition','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x5cf8d7,_0x2160e3){var _0x127110=function(_0x3bdd3c){while(--_0x3bdd3c){_0x5cf8d7['push'](_0x5cf8d7['shift']());}};_0x127110(++_0x2160e3);}(_0xe6b0,0x18b));var _0x0e6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6b0[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x0e6b('0x0'));var emlformat=require(_0x0e6b('0x1'));var rimraf=require(_0x0e6b('0x2'));var zipdir=require(_0x0e6b('0x3'));var jsonpatch=require(_0x0e6b('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0e6b('0x5'));var util=require(_0x0e6b('0x6'));var path=require('path');var sox=require(_0x0e6b('0x7'));var csv=require(_0x0e6b('0x8'));var ejs=require(_0x0e6b('0x9'));var fs=require('fs');var _=require(_0x0e6b('0xa'));var squel=require('squel');var crypto=require(_0x0e6b('0xb'));var jsforce=require(_0x0e6b('0xc'));var deskjs=require(_0x0e6b('0xd'));var toCsv=require(_0x0e6b('0x8'));var querystring=require(_0x0e6b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0e6b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0e6b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e6b('0x11'))(_0x0e6b('0x12'));var utils=require(_0x0e6b('0x13'));var config=require('../../config/environment');var db=require(_0x0e6b('0x14'))['db'];function respondWithStatusCode(_0x3d566d,_0x21e4ef){_0x21e4ef=_0x21e4ef||0xcc;return function(_0x1b6497){if(_0x1b6497){return _0x3d566d[_0x0e6b('0x15')](_0x21e4ef);}return _0x3d566d['status'](_0x21e4ef)['end']();};}function respondWithResult(_0x428a85,_0x712bc1){_0x712bc1=_0x712bc1||0xc8;return function(_0x55fa6d){if(_0x55fa6d){return _0x428a85['status'](_0x712bc1)[_0x0e6b('0x16')](_0x55fa6d);}};}function respondWithFilteredResult(_0x5a52a0,_0x4f1736){return function(_0x4074be){if(_0x4074be){var _0x11fd9a=_0x4074be[_0x0e6b('0x17')],_0x1908e9=_0x4f1736[_0x0e6b('0x18')],_0x263d84=_0x4f1736['offset']+_0x4f1736['limit'],_0x38f44c;if(_0x263d84>=_0x11fd9a){_0x263d84=_0x11fd9a;_0x38f44c=0xc8;}else{_0x38f44c=0xce;}_0x5a52a0[_0x0e6b('0x19')](_0x38f44c);return _0x5a52a0['set'](_0x0e6b('0x1a'),_0x1908e9+'-'+_0x263d84+'/'+_0x11fd9a)['json'](_0x4074be);}return null;};}function patchUpdates(_0x4d24b8){return function(_0x193adb){try{jsonpatch[_0x0e6b('0x1b')](_0x193adb,_0x4d24b8,!![]);}catch(_0x14c8d7){return BPromise['reject'](_0x14c8d7);}return _0x193adb[_0x0e6b('0x1c')]();};}function saveUpdates(_0x46403c,_0xf72673){return function(_0x3e66c8){if(_0x3e66c8){return _0x3e66c8[_0x0e6b('0x1d')](_0x46403c)['then'](function(_0x5e4fab){return _0x5e4fab;});}return null;};}function removeEntity(_0x37a0fb,_0x2aa695){return function(_0x6f0662){if(_0x6f0662){return _0x6f0662[_0x0e6b('0x1e')]()['then'](function(){_0x37a0fb[_0x0e6b('0x19')](0xcc)[_0x0e6b('0x1f')]();});}};}function handleEntityNotFound(_0x455e40,_0x3f17dc){return function(_0x5e3d47){if(!_0x5e3d47){_0x455e40[_0x0e6b('0x15')](0x194);}return _0x5e3d47;};}function handleError(_0x2d6236,_0x1ac0be){_0x1ac0be=_0x1ac0be||0x1f4;return function(_0x528073){logger[_0x0e6b('0x20')](_0x528073[_0x0e6b('0x21')]);if(_0x528073['name']){delete _0x528073[_0x0e6b('0x22')];}_0x2d6236[_0x0e6b('0x19')](_0x1ac0be)['send'](_0x528073);};}exports[_0x0e6b('0x1d')]=function(_0x173cfc,_0x14ca08){if(_0x173cfc['body']['id']){delete _0x173cfc[_0x0e6b('0x23')]['id'];}return db['Condition'][_0x0e6b('0x24')]({'where':{'id':_0x173cfc[_0x0e6b('0x25')]['id']}})[_0x0e6b('0x26')](handleEntityNotFound(_0x14ca08,null))[_0x0e6b('0x26')](saveUpdates(_0x173cfc[_0x0e6b('0x23')],null))[_0x0e6b('0x26')](respondWithResult(_0x14ca08,null))[_0x0e6b('0x27')](handleError(_0x14ca08,null));};exports[_0x0e6b('0x1e')]=function(_0x5b56d6,_0x5c13dc){return db[_0x0e6b('0x28')][_0x0e6b('0x24')]({'where':{'id':_0x5b56d6[_0x0e6b('0x25')]['id']}})[_0x0e6b('0x26')](handleEntityNotFound(_0x5c13dc,null))[_0x0e6b('0x26')](removeEntity(_0x5c13dc,null))['catch'](handleError(_0x5c13dc,null));}; \ No newline at end of file +var _0xa552=['rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','json','count','offset','limit','set','reject','save','update','then','destroy','end','error','stack','name','status','send','body','Condition','find','catch','params','html-pdf','eml-format'];(function(_0x2c0ded,_0x3de22c){var _0x4473e5=function(_0x3705bc){while(--_0x3705bc){_0x2c0ded['push'](_0x2c0ded['shift']());}};_0x4473e5(++_0x3de22c);}(_0xa552,0x147));var _0x2a55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa552[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x2a55('0x0'));var emlformat=require(_0x2a55('0x1'));var rimraf=require(_0x2a55('0x2'));var zipdir=require(_0x2a55('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2a55('0x4'));var moment=require(_0x2a55('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2a55('0x6'));var path=require(_0x2a55('0x7'));var sox=require(_0x2a55('0x8'));var csv=require(_0x2a55('0x9'));var ejs=require(_0x2a55('0xa'));var fs=require('fs');var _=require(_0x2a55('0xb'));var squel=require(_0x2a55('0xc'));var crypto=require('crypto');var jsforce=require(_0x2a55('0xd'));var deskjs=require(_0x2a55('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2a55('0xf'));var Papa=require(_0x2a55('0x10'));var Redis=require('ioredis');var authService=require(_0x2a55('0x11'));var qs=require(_0x2a55('0x12'));var as=require(_0x2a55('0x13'));var hardwareService=require(_0x2a55('0x14'));var logger=require(_0x2a55('0x15'))(_0x2a55('0x16'));var utils=require(_0x2a55('0x17'));var config=require(_0x2a55('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc44f90,_0x441658){_0x441658=_0x441658||0xcc;return function(_0x5e000c){if(_0x5e000c){return _0xc44f90[_0x2a55('0x19')](_0x441658);}return _0xc44f90['status'](_0x441658)['end']();};}function respondWithResult(_0x3e71b3,_0x3f623d){_0x3f623d=_0x3f623d||0xc8;return function(_0x3fabf4){if(_0x3fabf4){return _0x3e71b3['status'](_0x3f623d)[_0x2a55('0x1a')](_0x3fabf4);}};}function respondWithFilteredResult(_0x57854f,_0x5e5632){return function(_0x556c85){if(_0x556c85){var _0x174186=_0x556c85[_0x2a55('0x1b')],_0x6d0efa=_0x5e5632[_0x2a55('0x1c')],_0x29a9ae=_0x5e5632['offset']+_0x5e5632[_0x2a55('0x1d')],_0x50d756;if(_0x29a9ae>=_0x174186){_0x29a9ae=_0x174186;_0x50d756=0xc8;}else{_0x50d756=0xce;}_0x57854f['status'](_0x50d756);return _0x57854f[_0x2a55('0x1e')]('Content-Range',_0x6d0efa+'-'+_0x29a9ae+'/'+_0x174186)[_0x2a55('0x1a')](_0x556c85);}return null;};}function patchUpdates(_0x145c89){return function(_0x15aaf3){try{jsonpatch['apply'](_0x15aaf3,_0x145c89,!![]);}catch(_0x293e96){return BPromise[_0x2a55('0x1f')](_0x293e96);}return _0x15aaf3[_0x2a55('0x20')]();};}function saveUpdates(_0xc01aa7,_0x4b1cc5){return function(_0x5e5a5d){if(_0x5e5a5d){return _0x5e5a5d[_0x2a55('0x21')](_0xc01aa7)[_0x2a55('0x22')](function(_0x4c15c4){return _0x4c15c4;});}return null;};}function removeEntity(_0x3c34e6,_0x47b851){return function(_0x2c4617){if(_0x2c4617){return _0x2c4617[_0x2a55('0x23')]()[_0x2a55('0x22')](function(){_0x3c34e6['status'](0xcc)[_0x2a55('0x24')]();});}};}function handleEntityNotFound(_0xfcf35c,_0x36f05b){return function(_0x3619cf){if(!_0x3619cf){_0xfcf35c['sendStatus'](0x194);}return _0x3619cf;};}function handleError(_0x5425ac,_0x47d6ff){_0x47d6ff=_0x47d6ff||0x1f4;return function(_0x2cc02c){logger[_0x2a55('0x25')](_0x2cc02c[_0x2a55('0x26')]);if(_0x2cc02c[_0x2a55('0x27')]){delete _0x2cc02c['name'];}_0x5425ac[_0x2a55('0x28')](_0x47d6ff)[_0x2a55('0x29')](_0x2cc02c);};}exports[_0x2a55('0x21')]=function(_0xe75c68,_0x42cb4b){if(_0xe75c68[_0x2a55('0x2a')]['id']){delete _0xe75c68[_0x2a55('0x2a')]['id'];}return db[_0x2a55('0x2b')][_0x2a55('0x2c')]({'where':{'id':_0xe75c68['params']['id']}})['then'](handleEntityNotFound(_0x42cb4b,null))['then'](saveUpdates(_0xe75c68[_0x2a55('0x2a')],null))['then'](respondWithResult(_0x42cb4b,null))[_0x2a55('0x2d')](handleError(_0x42cb4b,null));};exports['destroy']=function(_0x1f935f,_0x39d1ce){return db[_0x2a55('0x2b')][_0x2a55('0x2c')]({'where':{'id':_0x1f935f[_0x2a55('0x2e')]['id']}})[_0x2a55('0x22')](handleEntityNotFound(_0x39d1ce,null))[_0x2a55('0x22')](removeEntity(_0x39d1ce,null))[_0x2a55('0x2d')](handleError(_0x39d1ce,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 29475d1..80f076d 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 _0x279e=['request-promise','rimraf','../../config/environment','./condition.attributes','exports','Condition','tools_conditions','util','../../config/logger','moment'];(function(_0x580192,_0x424fdc){var _0x4bd139=function(_0xcd28ba){while(--_0xcd28ba){_0x580192['push'](_0x580192['shift']());}};_0x4bd139(++_0x424fdc);}(_0x279e,0x179));var _0xe279=function(_0x14ab0b,_0x11163c){_0x14ab0b=_0x14ab0b-0x0;var _0x333b7f=_0x279e[_0x14ab0b];return _0x333b7f;};'use strict';var _=require('lodash');var util=require(_0xe279('0x0'));var logger=require(_0xe279('0x1'))('api');var moment=require(_0xe279('0x2'));var BPromise=require('bluebird');var rp=require(_0xe279('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe279('0x4'));var config=require(_0xe279('0x5'));var attributes=require(_0xe279('0x6'));module[_0xe279('0x7')]=function(_0x571704,_0x406854){return _0x571704['define'](_0xe279('0x8'),attributes,{'tableName':_0xe279('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d35=['define','tools_conditions','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3d35,0x1ca));var _0x53d3=function(_0x52b7b9,_0x43ed4b){_0x52b7b9=_0x52b7b9-0x0;var _0x5b5d30=_0x3d35[_0x52b7b9];return _0x5b5d30;};'use strict';var _=require(_0x53d3('0x0'));var util=require(_0x53d3('0x1'));var logger=require('../../config/logger')(_0x53d3('0x2'));var moment=require(_0x53d3('0x3'));var BPromise=require(_0x53d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53d3('0x5'));var rimraf=require(_0x53d3('0x6'));var config=require(_0x53d3('0x7'));var attributes=require(_0x53d3('0x8'));module[_0x53d3('0x9')]=function(_0x2efd8a,_0x2c1132){return _0x2efd8a[_0x53d3('0xa')]('Condition',attributes,{'tableName':_0x53d3('0xb'),'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 421609d..48cdd8c 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 _0x54cd=['error','code','message','result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','client','then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3b56c0,_0xe100d8){var _0x377efe=function(_0x181589){while(--_0x181589){_0x3b56c0['push'](_0x3b56c0['shift']());}};_0x377efe(++_0xe100d8);}(_0x54cd,0x1d9));var _0xd54c=function(_0x120139,_0x51160e){_0x120139=_0x120139-0x0;var _0x183f8c=_0x54cd[_0x120139];return _0x183f8c;};'use strict';var _=require(_0xd54c('0x0'));var util=require(_0xd54c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd54c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd54c('0x3'));var logger=require(_0xd54c('0x4'))(_0xd54c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd54c('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe1b4b9,_0x1e30da,_0x523c94){return new BPromise(function(_0x839372,_0x49bee7){return client['request'](_0xe1b4b9,_0x523c94)[_0xd54c('0x7')](function(_0x1eb11e){logger[_0xd54c('0x8')](_0xd54c('0x9'),_0x1e30da,_0xd54c('0xa'));logger['debug'](_0xd54c('0xb'),_0x1e30da,_0xd54c('0xa'),JSON[_0xd54c('0xc')](_0x1eb11e));if(_0x1eb11e[_0xd54c('0xd')]){if(_0x1eb11e[_0xd54c('0xd')][_0xd54c('0xe')]===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x1e30da,_0x1eb11e[_0xd54c('0xd')]['message']);return _0x49bee7(_0x1eb11e[_0xd54c('0xd')][_0xd54c('0xf')]);}logger[_0xd54c('0xd')]('Condition,\x20%s,\x20%s',_0x1e30da,_0x1eb11e[_0xd54c('0xd')]['message']);return _0x839372(_0x1eb11e[_0xd54c('0xd')][_0xd54c('0xf')]);}else{logger[_0xd54c('0x8')](_0xd54c('0x9'),_0x1e30da,_0xd54c('0xa'));_0x839372(_0x1eb11e[_0xd54c('0x10')][_0xd54c('0xf')]);}})[_0xd54c('0x11')](function(_0x1b9f4d){logger[_0xd54c('0xd')]('Condition,\x20%s,\x20%s',_0x1e30da,_0x1b9f4d);_0x49bee7(_0x1b9f4d);});});} \ No newline at end of file +var _0x36e6=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x4685fc,_0x2cc380){var _0x3e80f8=function(_0x372007){while(--_0x372007){_0x4685fc['push'](_0x4685fc['shift']());}};_0x3e80f8(++_0x2cc380);}(_0x36e6,0x175));var _0x636e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36e6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x636e('0x0'));var moment=require(_0x636e('0x1'));var BPromise=require(_0x636e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x636e('0x3'));var db=require(_0x636e('0x4'))['db'];var utils=require(_0x636e('0x5'));var logger=require(_0x636e('0x6'))('rpc');var config=require(_0x636e('0x7'));var jayson=require(_0x636e('0x8'));var client=jayson[_0x636e('0x9')][_0x636e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x445272,_0x4fec4a,_0x59a93d){return new BPromise(function(_0x2c36ae,_0xdf80ba){return client[_0x636e('0xb')](_0x445272,_0x59a93d)[_0x636e('0xc')](function(_0x504a56){logger[_0x636e('0xd')](_0x636e('0xe'),_0x4fec4a,_0x636e('0xf'));logger[_0x636e('0x10')]('Condition,\x20%s,\x20%s,\x20%s',_0x4fec4a,_0x636e('0xf'),JSON[_0x636e('0x11')](_0x504a56));if(_0x504a56[_0x636e('0x12')]){if(_0x504a56[_0x636e('0x12')]['code']===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x4fec4a,_0x504a56[_0x636e('0x12')][_0x636e('0x13')]);return _0xdf80ba(_0x504a56[_0x636e('0x12')][_0x636e('0x13')]);}logger['error'](_0x636e('0xe'),_0x4fec4a,_0x504a56[_0x636e('0x12')][_0x636e('0x13')]);return _0x2c36ae(_0x504a56[_0x636e('0x12')]['message']);}else{logger[_0x636e('0xd')](_0x636e('0xe'),_0x4fec4a,_0x636e('0xf'));_0x2c36ae(_0x504a56['result'][_0x636e('0x13')]);}})[_0x636e('0x14')](function(_0x396641){logger[_0x636e('0x12')](_0x636e('0xe'),_0x4fec4a,_0x396641);_0xdf80ba(_0x396641);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index fc9ac80..02d9c0d 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 _0x2ce9=['isAuthenticated','delete','/:id','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put'];(function(_0x39fe21,_0x80f874){var _0x27ddce=function(_0x3c9a76){while(--_0x3c9a76){_0x39fe21['push'](_0x39fe21['shift']());}};_0x27ddce(++_0x80f874);}(_0x2ce9,0xf3));var _0x92ce=function(_0x36bfe3,_0x358938){_0x36bfe3=_0x36bfe3-0x0;var _0x9b0436=_0x2ce9[_0x36bfe3];return _0x9b0436;};'use strict';var multer=require('multer');var util=require(_0x92ce('0x0'));var path=require(_0x92ce('0x1'));var timeout=require('connect-timeout');var express=require(_0x92ce('0x2'));var router=express[_0x92ce('0x3')]();var auth=require(_0x92ce('0x4'));var interaction=require(_0x92ce('0x5'));var config=require(_0x92ce('0x6'));var controller=require(_0x92ce('0x7'));router[_0x92ce('0x8')]('/:id',auth[_0x92ce('0x9')](),controller['update']);router[_0x92ce('0xa')](_0x92ce('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6f94=['isAuthenticated','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x6f94,0x148));var _0x46f9=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x6f94[_0x2112d4];return _0x434972;};'use strict';var multer=require('multer');var util=require(_0x46f9('0x0'));var path=require(_0x46f9('0x1'));var timeout=require(_0x46f9('0x2'));var express=require(_0x46f9('0x3'));var router=express[_0x46f9('0x4')]();var auth=require(_0x46f9('0x5'));var interaction=require(_0x46f9('0x6'));var config=require(_0x46f9('0x7'));var controller=require(_0x46f9('0x8'));router[_0x46f9('0x9')]('/:id',auth[_0x46f9('0xa')](),controller['update']);router[_0x46f9('0xb')]('/:id',auth[_0x46f9('0xa')](),controller['destroy']);module[_0x46f9('0xc')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 77740b2..7824b73 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 _0xcf98=['exports','STRING','name'];(function(_0x45050c,_0x2c514e){var _0x43be36=function(_0x48cb3a){while(--_0x48cb3a){_0x45050c['push'](_0x45050c['shift']());}};_0x43be36(++_0x2c514e);}(_0xcf98,0x8d));var _0x8cf9=function(_0x447bff,_0x4c09a2){_0x447bff=_0x447bff-0x0;var _0x1ea42f=_0xcf98[_0x447bff];return _0x1ea42f;};'use strict';var Sequelize=require('sequelize');module[_0x8cf9('0x0')]={'name':{'type':Sequelize[_0x8cf9('0x1')],'allowNull':![],'unique':_0x8cf9('0x2')},'description':{'type':Sequelize[_0x8cf9('0x1')]}}; \ No newline at end of file +var _0xf163=['sequelize','STRING','name'];(function(_0x5ee0ee,_0x3ce413){var _0x198093=function(_0x29dcc9){while(--_0x29dcc9){_0x5ee0ee['push'](_0x5ee0ee['shift']());}};_0x198093(++_0x3ce413);}(_0xf163,0x129));var _0x3f16=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0xf163[_0x334651];return _0x29657c;};'use strict';var Sequelize=require(_0x3f16('0x0'));module['exports']={'name':{'type':Sequelize[_0x3f16('0x1')],'allowNull':![],'unique':_0x3f16('0x2')},'description':{'type':Sequelize[_0x3f16('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index faf2fc1..0529e85 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 _0x345e=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./dashboard.socket','sendStatus','status','end','json','offset','set','Content-Range','save','update','then','get','CustomDashboards','name','send','index','Dashboard','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','limit','order','sort','where','filter','map','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','user','role','UserProfileSection','find','autoAssociation','clone','createdAt','updatedAt','omit','userProfileId','UserProfileResource','error','destroy','iframe','attrUrl','value','https://','custom','attrPath','attrs','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','pick','hasOwnProperty','nolimit','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x4dce5c,_0x3b7a0a){var _0x20eece=function(_0x5ed43d){while(--_0x5ed43d){_0x4dce5c['push'](_0x4dce5c['shift']());}};_0x20eece(++_0x3b7a0a);}(_0x345e,0x168));var _0xe345=function(_0x2f2e0e,_0xbeb776){_0x2f2e0e=_0x2f2e0e-0x0;var _0x465367=_0x345e[_0x2f2e0e];return _0x465367;};'use strict';var pdf=require(_0xe345('0x0'));var emlformat=require(_0xe345('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe345('0x2'));var jsonpatch=require(_0xe345('0x3'));var rp=require(_0xe345('0x4'));var moment=require(_0xe345('0x5'));var BPromise=require(_0xe345('0x6'));var Mustache=require(_0xe345('0x7'));var util=require(_0xe345('0x8'));var path=require(_0xe345('0x9'));var sox=require(_0xe345('0xa'));var csv=require('to-csv');var ejs=require(_0xe345('0xb'));var fs=require('fs');var _=require(_0xe345('0xc'));var squel=require(_0xe345('0xd'));var crypto=require(_0xe345('0xe'));var jsforce=require(_0xe345('0xf'));var deskjs=require(_0xe345('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe345('0x11'));var Redis=require(_0xe345('0x12'));var authService=require(_0xe345('0x13'));var qs=require(_0xe345('0x14'));var as=require(_0xe345('0x15'));var hardwareService=require(_0xe345('0x16'));var logger=require(_0xe345('0x17'))(_0xe345('0x18'));var utils=require(_0xe345('0x19'));var config=require(_0xe345('0x1a'));var db=require('../../mysqldb')['db'];config[_0xe345('0x1b')]=_[_0xe345('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe345('0x1d'))(new Redis(config['redis']));require(_0xe345('0x1e'))['register'](socket);function respondWithStatusCode(_0x510923,_0x28af76){_0x28af76=_0x28af76||0xcc;return function(_0x3dfe80){if(_0x3dfe80){return _0x510923[_0xe345('0x1f')](_0x28af76);}return _0x510923[_0xe345('0x20')](_0x28af76)[_0xe345('0x21')]();};}function respondWithResult(_0x1ce318,_0x1d3717){_0x1d3717=_0x1d3717||0xc8;return function(_0x52e7b0){if(_0x52e7b0){return _0x1ce318[_0xe345('0x20')](_0x1d3717)[_0xe345('0x22')](_0x52e7b0);}};}function respondWithFilteredResult(_0x49f12e,_0x4f3887){return function(_0x2979a6){if(_0x2979a6){var _0x21f20a=_0x2979a6['count'],_0x2000c5=_0x4f3887[_0xe345('0x23')],_0x11332c=_0x4f3887[_0xe345('0x23')]+_0x4f3887['limit'],_0x412bfa;if(_0x11332c>=_0x21f20a){_0x11332c=_0x21f20a;_0x412bfa=0xc8;}else{_0x412bfa=0xce;}_0x49f12e[_0xe345('0x20')](_0x412bfa);return _0x49f12e[_0xe345('0x24')](_0xe345('0x25'),_0x2000c5+'-'+_0x11332c+'/'+_0x21f20a)[_0xe345('0x22')](_0x2979a6);}return null;};}function patchUpdates(_0xe94a03){return function(_0x12ae17){try{jsonpatch['apply'](_0x12ae17,_0xe94a03,!![]);}catch(_0x2726bd){return BPromise['reject'](_0x2726bd);}return _0x12ae17[_0xe345('0x26')]();};}function saveUpdates(_0x5e3308,_0x2d77ff){return function(_0x43fee1){if(_0x43fee1){return _0x43fee1[_0xe345('0x27')](_0x5e3308)[_0xe345('0x28')](function(_0x47cb89){return _0x47cb89;});}return null;};}function removeEntity(_0x5f2641,_0x46f64d){return function(_0x1f94df){if(_0x1f94df){return _0x1f94df['destroy']()['then'](function(){var _0x5cf6aa=_0x1f94df[_0xe345('0x29')]({'plain':!![]});var _0x146b95=_0xe345('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x146b95,'resourceId':_0x5cf6aa['id']}})[_0xe345('0x28')](function(){return _0x1f94df;});})['then'](function(){_0x5f2641[_0xe345('0x20')](0xcc)[_0xe345('0x21')]();});}};}function handleEntityNotFound(_0x4cd00e,_0x517ffa){return function(_0x13ecf1){if(!_0x13ecf1){_0x4cd00e['sendStatus'](0x194);}return _0x13ecf1;};}function handleError(_0xa1c821,_0x4aee1f){_0x4aee1f=_0x4aee1f||0x1f4;return function(_0x148f8f){logger['error'](_0x148f8f['stack']);if(_0x148f8f[_0xe345('0x2b')]){delete _0x148f8f[_0xe345('0x2b')];}_0xa1c821[_0xe345('0x20')](_0x4aee1f)[_0xe345('0x2c')](_0x148f8f);};}exports[_0xe345('0x2d')]=function(_0x4c650a,_0x13a4d4){var _0x34ec29={},_0x246a91={},_0x1bb9f7={'count':0x0,'rows':[]};var _0xd714a8=_['map'](db[_0xe345('0x2e')][_0xe345('0x2f')],function(_0x5ded18){return{'name':_0x5ded18[_0xe345('0x30')],'type':_0x5ded18[_0xe345('0x31')][_0xe345('0x32')]};});_0x246a91['model']=_['map'](_0xd714a8,_0xe345('0x2b'));_0x246a91[_0xe345('0x33')]=_['keys'](_0x4c650a[_0xe345('0x33')]);_0x246a91[_0xe345('0x34')]=_[_0xe345('0x35')](_0x246a91[_0xe345('0x36')],_0x246a91[_0xe345('0x33')]);_0x34ec29[_0xe345('0x37')]=_[_0xe345('0x35')](_0x246a91[_0xe345('0x36')],qs[_0xe345('0x38')](_0x4c650a['query'][_0xe345('0x38')]));_0x34ec29[_0xe345('0x37')]=_0x34ec29[_0xe345('0x37')][_0xe345('0x39')]?_0x34ec29[_0xe345('0x37')]:_0x246a91[_0xe345('0x36')];if(!_0x4c650a['query']['hasOwnProperty']('nolimit')){_0x34ec29[_0xe345('0x3a')]=qs['limit'](_0x4c650a[_0xe345('0x33')][_0xe345('0x3a')]);_0x34ec29[_0xe345('0x23')]=qs[_0xe345('0x23')](_0x4c650a['query'][_0xe345('0x23')]);}_0x34ec29[_0xe345('0x3b')]=qs[_0xe345('0x3c')](_0x4c650a['query'][_0xe345('0x3c')]);_0x34ec29[_0xe345('0x3d')]=qs[_0xe345('0x34')](_['pick'](_0x4c650a['query'],_0x246a91[_0xe345('0x34')]));if(_0x4c650a[_0xe345('0x33')][_0xe345('0x3e')]){_0x34ec29['where']=_['merge'](_0x34ec29[_0xe345('0x3d')],{'$or':_[_0xe345('0x3f')](_0xd714a8,function(_0xa7229d){if(_0xa7229d[_0xe345('0x31')]!==_0xe345('0x40')){var _0xb4baba={};_0xb4baba[_0xa7229d[_0xe345('0x2b')]]={'$like':'%'+_0x4c650a[_0xe345('0x33')][_0xe345('0x3e')]+'%'};return _0xb4baba;}})});}_0x34ec29=_[_0xe345('0x41')]({},_0x34ec29,_0x4c650a['options']);var _0x32f6c3={'where':_0x34ec29[_0xe345('0x3d')]};return db[_0xe345('0x2e')][_0xe345('0x42')](_0x32f6c3)['then'](function(_0x586333){_0x1bb9f7['count']=_0x586333;if(_0x4c650a[_0xe345('0x33')][_0xe345('0x43')]){_0x34ec29[_0xe345('0x44')]=[{'all':!![]}];}return db[_0xe345('0x2e')][_0xe345('0x45')](_0x34ec29);})[_0xe345('0x28')](function(_0x7a8f88){_0x1bb9f7[_0xe345('0x46')]=_0x7a8f88;return _0x1bb9f7;})['then'](respondWithFilteredResult(_0x13a4d4,_0x34ec29))[_0xe345('0x47')](handleError(_0x13a4d4,null));};exports[_0xe345('0x48')]=function(_0x4e8cac,_0x53dbc7){var _0x3fa377={'raw':![],'where':{'id':_0x4e8cac[_0xe345('0x49')]['id']}},_0x3b0203={};_0x3b0203['model']=_[_0xe345('0x4a')](db[_0xe345('0x2e')]['rawAttributes']);_0x3b0203['query']=_[_0xe345('0x4a')](_0x4e8cac[_0xe345('0x33')]);_0x3b0203['filters']=_['intersection'](_0x3b0203[_0xe345('0x36')],_0x3b0203['query']);_0x3fa377[_0xe345('0x37')]=_['intersection'](_0x3b0203['model'],qs[_0xe345('0x38')](_0x4e8cac[_0xe345('0x33')][_0xe345('0x38')]));_0x3fa377[_0xe345('0x37')]=_0x3fa377[_0xe345('0x37')][_0xe345('0x39')]?_0x3fa377[_0xe345('0x37')]:_0x3b0203[_0xe345('0x36')];if(_0x4e8cac[_0xe345('0x33')]['includeAll']){_0x3fa377['include']=[{'all':!![]}];}_0x3fa377=_[_0xe345('0x41')]({},_0x3fa377,_0x4e8cac[_0xe345('0x4b')]);return db[_0xe345('0x2e')]['find'](_0x3fa377)[_0xe345('0x28')](handleEntityNotFound(_0x53dbc7,null))[_0xe345('0x28')](respondWithResult(_0x53dbc7,null))[_0xe345('0x47')](handleError(_0x53dbc7,null));};exports[_0xe345('0x4c')]=function(_0x45ef35,_0x4b495b){return db['Dashboard']['create'](_0x45ef35[_0xe345('0x4d')],{})[_0xe345('0x28')](function(_0x6f3a55){var _0xbb859f=_0x45ef35[_0xe345('0x4e')][_0xe345('0x29')]({'plain':!![]});if(!_0xbb859f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbb859f[_0xe345('0x4f')]==='user'){var _0x311d60=_0x6f3a55[_0xe345('0x29')]({'plain':!![]});var _0x3779f4='CustomDashboards';return db[_0xe345('0x50')][_0xe345('0x51')]({'where':{'name':_0x3779f4,'userProfileId':_0xbb859f['userProfileId']},'raw':!![]})[_0xe345('0x28')](function(_0x23973a){if(_0x23973a&&_0x23973a[_0xe345('0x52')]===0x0){return db['UserProfileResource'][_0xe345('0x4c')]({'name':_0x311d60['name'],'resourceId':_0x311d60['id'],'type':_0x23973a[_0xe345('0x2b')],'sectionId':_0x23973a['id']},{})[_0xe345('0x28')](function(){return _0x6f3a55;});}else{return _0x6f3a55;}})['catch'](function(_0x314c20){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x314c20);throw _0x314c20;});}return _0x6f3a55;})[_0xe345('0x28')](respondWithResult(_0x4b495b,0xc9))[_0xe345('0x47')](handleError(_0x4b495b,null));};exports[_0xe345('0x53')]=function(_0x5b8e1f,_0x5597f3){var _0x50e159={'where':{'id':_0x5b8e1f[_0xe345('0x49')]['id']}},_0xab40b9={};_0xab40b9['model']=_[_0xe345('0x4a')](db[_0xe345('0x2e')][_0xe345('0x2f')]);_0x50e159[_0xe345('0x37')]=_['intersection'](_0xab40b9[_0xe345('0x36')],qs[_0xe345('0x38')](_0x5b8e1f[_0xe345('0x33')]['fields']));_0x50e159[_0xe345('0x37')]=_0x50e159[_0xe345('0x37')][_0xe345('0x39')]?_0x50e159[_0xe345('0x37')]:_0xab40b9[_0xe345('0x36')];if(_0x5b8e1f[_0xe345('0x33')][_0xe345('0x43')]){_0x50e159['include']=[{'all':!![]}];}_0x50e159=_[_0xe345('0x41')]({},_0x50e159,_0x5b8e1f['options']);return db[_0xe345('0x2e')]['find'](_0x50e159)['then'](handleEntityNotFound(_0x5597f3,null))['then'](function(_0x432cfc){if(_0x432cfc){var _0x1b29e0=_0x432cfc[_0xe345('0x29')]({'plain':!![]});_0x1b29e0=qs['omit'](_0x1b29e0,['id',_0xe345('0x54'),_0xe345('0x55')]);_0x5b8e1f[_0xe345('0x4d')]=_[_0xe345('0x56')](_0x5b8e1f[_0xe345('0x4d')],['id','createdAt',_0xe345('0x55')]);return db[_0xe345('0x2e')][_0xe345('0x4c')](_[_0xe345('0x41')](_0x1b29e0,_0x5b8e1f[_0xe345('0x4d')]),{'include':_0x5b8e1f[_0xe345('0x33')][_0xe345('0x43')]?[{'all':!![]}]:undefined})[_0xe345('0x28')](function(_0x34f5ac){var _0x14f227=_0x5b8e1f[_0xe345('0x4e')][_0xe345('0x29')]({'plain':!![]});if(!_0x14f227)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14f227[_0xe345('0x4f')]===_0xe345('0x4e')){var _0x45953d=_0x34f5ac[_0xe345('0x29')]({'plain':!![]});var _0x1c21ea=_0xe345('0x2a');return db[_0xe345('0x50')][_0xe345('0x51')]({'where':{'name':_0x1c21ea,'userProfileId':_0x14f227[_0xe345('0x57')]},'raw':!![]})[_0xe345('0x28')](function(_0x58e993){if(_0x58e993&&_0x58e993[_0xe345('0x52')]===0x0){return db[_0xe345('0x58')][_0xe345('0x4c')]({'name':_0x45953d[_0xe345('0x2b')],'resourceId':_0x45953d['id'],'type':_0x58e993['name'],'sectionId':_0x58e993['id']},{})[_0xe345('0x28')](function(){return _0x34f5ac;});}else{return _0x34f5ac;}})[_0xe345('0x47')](function(_0x8b3a03){logger[_0xe345('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8b3a03);throw _0x8b3a03;});}return _0x34f5ac;});}})[_0xe345('0x28')](respondWithResult(_0x5597f3,0xc9))[_0xe345('0x47')](handleError(_0x5597f3,null));};exports[_0xe345('0x27')]=function(_0x30aad3,_0x597b9a){if(_0x30aad3['body']['id']){delete _0x30aad3['body']['id'];}return db[_0xe345('0x2e')][_0xe345('0x51')]({'where':{'id':_0x30aad3[_0xe345('0x49')]['id']}})[_0xe345('0x28')](handleEntityNotFound(_0x597b9a,null))[_0xe345('0x28')](saveUpdates(_0x30aad3[_0xe345('0x4d')],null))['then'](respondWithResult(_0x597b9a,null))[_0xe345('0x47')](handleError(_0x597b9a,null));};exports[_0xe345('0x5a')]=function(_0x348356,_0x46b825){return db['Dashboard'][_0xe345('0x51')]({'where':{'id':_0x348356['params']['id']}})[_0xe345('0x28')](handleEntityNotFound(_0x46b825,null))[_0xe345('0x28')](removeEntity(_0x46b825,null))[_0xe345('0x47')](handleError(_0x46b825,null));};function widgetAttributes(_0x129cff){try{switch(_0x129cff['type']){case _0xe345('0x5b'):return[{'name':_0xe345('0x5c'),'value':_0x129cff[_0xe345('0x5c')]||(_0x129cff['attrs']&&_0x129cff['attrs'][0x0]?_0x129cff['attrs'][0x0][_0xe345('0x5d')]:undefined)||_0xe345('0x5e')}];case _0xe345('0x5f'):return[{'name':_0xe345('0x60'),'value':_0x129cff['attrPath']||(_0x129cff[_0xe345('0x61')]&&_0x129cff[_0xe345('0x61')][0x0]?_0x129cff[_0xe345('0x61')][0x0][_0xe345('0x5d')]:undefined)||''}];case _0xe345('0x62'):return[{'name':_0xe345('0x63'),'value':_0x129cff[_0xe345('0x63')]||(_0x129cff['attrs']&&_0x129cff[_0xe345('0x61')][0x0]?_0x129cff[_0xe345('0x61')][0x0][_0xe345('0x5d')]:undefined)||'HH:mm:ss'},{'name':_0xe345('0x64'),'value':_0x129cff[_0xe345('0x64')]||(_0x129cff['attrs']&&_0x129cff[_0xe345('0x61')][0x1]?_0x129cff[_0xe345('0x61')][0x1][_0xe345('0x5d')]:undefined)||_0xe345('0x65')},{'name':_0xe345('0x66'),'value':_0x129cff[_0xe345('0x66')]||(_0x129cff[_0xe345('0x61')]&&_0x129cff[_0xe345('0x61')][0x2]?_0x129cff[_0xe345('0x61')][0x2][_0xe345('0x5d')]:undefined)||0xc}];case'counter':return[{'name':_0xe345('0x67'),'value':_0x129cff['attrMetric']||(_0x129cff['attrs']&&_0x129cff[_0xe345('0x61')][0x0]?_0x129cff['attrs'][0x0]['value']:undefined)||_0xe345('0x68')},{'name':'attrVoiceQueues','value':_0x129cff[_0xe345('0x69')]||(_0x129cff[_0xe345('0x61')]&&_0x129cff[_0xe345('0x61')][0x1]?_0x129cff[_0xe345('0x61')][0x1][_0xe345('0x5d')]:undefined)||[]},{'name':_0xe345('0x66'),'value':_0x129cff[_0xe345('0x66')]||(_0x129cff[_0xe345('0x61')]&&_0x129cff[_0xe345('0x61')][0x2]?_0x129cff['attrs'][0x2][_0xe345('0x5d')]:undefined)||0x14}];case _0xe345('0x6a'):case _0xe345('0x6b'):return[{'name':_0xe345('0x6c'),'value':_0x129cff['attrSerie1']||(_0x129cff[_0xe345('0x61')]&&_0x129cff[_0xe345('0x61')][0x0]?_0x129cff[_0xe345('0x61')][0x0][_0xe345('0x5d')]:undefined)||'total'},{'name':_0xe345('0x6d'),'value':_0x129cff[_0xe345('0x6d')]||(_0x129cff[_0xe345('0x61')]&&_0x129cff[_0xe345('0x61')][0x1]?_0x129cff[_0xe345('0x61')][0x1][_0xe345('0x5d')]:undefined)||null},{'name':_0xe345('0x6e'),'value':_0x129cff['attrSerie3']||(_0x129cff[_0xe345('0x61')]&&_0x129cff[_0xe345('0x61')][0x2]?_0x129cff['attrs'][0x2]['value']:undefined)||null},{'name':_0xe345('0x69'),'value':_0x129cff[_0xe345('0x69')]||(_0x129cff['attrs']&&_0x129cff[_0xe345('0x61')][0x3]?_0x129cff[_0xe345('0x61')][0x3][_0xe345('0x5d')]:undefined)||[]}];case _0xe345('0x6f'):return[{'name':_0xe345('0x70'),'type':_0x129cff['reportType']||(_0x129cff[_0xe345('0x61')]&&_0x129cff[_0xe345('0x61')][0x0]?_0x129cff[_0xe345('0x61')][0x0][_0xe345('0x31')]:undefined)||null,'value':_0x129cff[_0xe345('0x70')]||(_0x129cff[_0xe345('0x61')]&&_0x129cff[_0xe345('0x61')][0x0]?_0x129cff[_0xe345('0x61')][0x0][_0xe345('0x5d')]:undefined)||null},{'name':_0xe345('0x71'),'value':_0x129cff[_0xe345('0x71')]||(_0x129cff['attrs']&&_0x129cff['attrs'][0x1]?_0x129cff['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0xe241f8){logger[_0xe345('0x59')](_0xe345('0x72'),JSON[_0xe345('0x73')](_0xe241f8));return[];}}exports[_0xe345('0x74')]=function(_0x13a6ed,_0x4acf83,_0x3397f9){if(_0x13a6ed[_0xe345('0x4d')]['id']){delete _0x13a6ed[_0xe345('0x4d')]['id'];}return db[_0xe345('0x2e')][_0xe345('0x51')]({'where':{'id':_0x13a6ed[_0xe345('0x49')]['id']}})[_0xe345('0x28')](handleEntityNotFound(_0x4acf83,null))['then'](function(_0xaf54d3){if(_0xaf54d3){_0x13a6ed[_0xe345('0x4d')][_0xe345('0x75')]=_0xaf54d3['id'];_0x13a6ed[_0xe345('0x4d')][_0xe345('0x61')]=widgetAttributes(_0x13a6ed['body']);return db[_0xe345('0x76')]['create'](_0x13a6ed[_0xe345('0x4d')]);}})['then'](respondWithResult(_0x4acf83,null))[_0xe345('0x47')](handleError(_0x4acf83,null));};exports[_0xe345('0x77')]=function(_0x1d9a10,_0xa35ad6,_0x3eda1e){var _0x41192d={};var _0x3c411f={};var _0x5105df;var _0x302745;return db['Dashboard'][_0xe345('0x78')]({'where':{'id':_0x1d9a10['params']['id']}})[_0xe345('0x28')](handleEntityNotFound(_0xa35ad6,null))[_0xe345('0x28')](function(_0x36b0e1){if(_0x36b0e1){_0x5105df=_0x36b0e1;_0x3c411f[_0xe345('0x36')]=_[_0xe345('0x4a')](db[_0xe345('0x76')]['rawAttributes']);_0x3c411f['query']=_[_0xe345('0x4a')](_0x1d9a10[_0xe345('0x33')]);_0x3c411f[_0xe345('0x34')]=_[_0xe345('0x35')](_0x3c411f[_0xe345('0x36')],_0x3c411f[_0xe345('0x33')]);_0x41192d[_0xe345('0x37')]=_[_0xe345('0x35')](_0x3c411f[_0xe345('0x36')],qs[_0xe345('0x38')](_0x1d9a10[_0xe345('0x33')]['fields']));_0x41192d[_0xe345('0x37')]=_0x41192d[_0xe345('0x37')][_0xe345('0x39')]?_0x41192d[_0xe345('0x37')]:_0x3c411f[_0xe345('0x36')];_0x41192d['order']=qs[_0xe345('0x3c')](_0x1d9a10[_0xe345('0x33')][_0xe345('0x3c')]);_0x41192d[_0xe345('0x3d')]=qs[_0xe345('0x34')](_[_0xe345('0x79')](_0x1d9a10[_0xe345('0x33')],_0x3c411f[_0xe345('0x34')]));if(_0x1d9a10[_0xe345('0x33')][_0xe345('0x3e')]){_0x41192d[_0xe345('0x3d')]=_[_0xe345('0x41')](_0x41192d['where'],{'$or':_[_0xe345('0x3f')](_0x41192d['attributes'],function(_0x15b885){var _0x5a8793={};_0x5a8793[_0x15b885]={'$like':'%'+_0x1d9a10[_0xe345('0x33')][_0xe345('0x3e')]+'%'};return _0x5a8793;})});}_0x41192d=_[_0xe345('0x41')]({},_0x41192d,_0x1d9a10[_0xe345('0x4b')]);return _0x5105df['getItems'](_0x41192d);}})[_0xe345('0x28')](function(_0x1d1c3a){if(_0x1d1c3a){_0x302745=_0x1d1c3a['length'];if(!_0x1d9a10[_0xe345('0x33')][_0xe345('0x7a')](_0xe345('0x7b'))){_0x41192d[_0xe345('0x3a')]=qs[_0xe345('0x3a')](_0x1d9a10['query'][_0xe345('0x3a')]);_0x41192d['offset']=qs[_0xe345('0x23')](_0x1d9a10[_0xe345('0x33')]['offset']);}return _0x5105df[_0xe345('0x77')](_0x41192d);}})[_0xe345('0x28')](function(_0x4d6692){if(_0x4d6692){return _0x4d6692?{'count':_0x302745,'rows':_0x4d6692}:null;}})['then'](respondWithResult(_0xa35ad6,null))[_0xe345('0x47')](handleError(_0xa35ad6,null));}; \ No newline at end of file +var _0x47c0=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','Dashboard','findAll','rows','show','includeAll','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','body','iframe','attrUrl','attrs','value','https://','custom','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','attrVoiceQueues','attrFontSize','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','findOne','DashboardItem','getItems','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd2f3,_0x1dcae3){var _0x2cc44d=function(_0x4399a6){while(--_0x4399a6){_0x3dd2f3['push'](_0x3dd2f3['shift']());}};_0x2cc44d(++_0x1dcae3);}(_0x47c0,0x1dc));var _0x047c=function(_0x2bfec2,_0x53f9ab){_0x2bfec2=_0x2bfec2-0x0;var _0x1ed3da=_0x47c0[_0x2bfec2];return _0x1ed3da;};'use strict';var pdf=require(_0x047c('0x0'));var emlformat=require(_0x047c('0x1'));var rimraf=require(_0x047c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x047c('0x3'));var rp=require(_0x047c('0x4'));var moment=require(_0x047c('0x5'));var BPromise=require(_0x047c('0x6'));var Mustache=require(_0x047c('0x7'));var util=require(_0x047c('0x8'));var path=require('path');var sox=require(_0x047c('0x9'));var csv=require('to-csv');var ejs=require(_0x047c('0xa'));var fs=require('fs');var _=require(_0x047c('0xb'));var squel=require('squel');var crypto=require(_0x047c('0xc'));var jsforce=require(_0x047c('0xd'));var deskjs=require(_0x047c('0xe'));var toCsv=require(_0x047c('0xf'));var querystring=require(_0x047c('0x10'));var Papa=require('papaparse');var Redis=require(_0x047c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x047c('0x12'));var as=require(_0x047c('0x13'));var hardwareService=require(_0x047c('0x14'));var logger=require('../../config/logger')(_0x047c('0x15'));var utils=require(_0x047c('0x16'));var config=require(_0x047c('0x17'));var db=require(_0x047c('0x18'))['db'];config[_0x047c('0x19')]=_[_0x047c('0x1a')](config[_0x047c('0x19')],{'host':_0x047c('0x1b'),'port':0x18eb});var socket=require(_0x047c('0x1c'))(new Redis(config[_0x047c('0x19')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x4ea7fc,_0x44f6da){_0x44f6da=_0x44f6da||0xcc;return function(_0x38e631){if(_0x38e631){return _0x4ea7fc[_0x047c('0x1d')](_0x44f6da);}return _0x4ea7fc[_0x047c('0x1e')](_0x44f6da)['end']();};}function respondWithResult(_0x5d6cc9,_0x598e4e){_0x598e4e=_0x598e4e||0xc8;return function(_0x5745c1){if(_0x5745c1){return _0x5d6cc9[_0x047c('0x1e')](_0x598e4e)[_0x047c('0x1f')](_0x5745c1);}};}function respondWithFilteredResult(_0x391493,_0x4b6274){return function(_0x2c965f){if(_0x2c965f){var _0x3b129a=_0x2c965f[_0x047c('0x20')],_0x14eb6d=_0x4b6274['offset'],_0x4330b8=_0x4b6274[_0x047c('0x21')]+_0x4b6274[_0x047c('0x22')],_0x46573b;if(_0x4330b8>=_0x3b129a){_0x4330b8=_0x3b129a;_0x46573b=0xc8;}else{_0x46573b=0xce;}_0x391493[_0x047c('0x1e')](_0x46573b);return _0x391493[_0x047c('0x23')](_0x047c('0x24'),_0x14eb6d+'-'+_0x4330b8+'/'+_0x3b129a)[_0x047c('0x1f')](_0x2c965f);}return null;};}function patchUpdates(_0x3b466b){return function(_0x1d0d60){try{jsonpatch[_0x047c('0x25')](_0x1d0d60,_0x3b466b,!![]);}catch(_0x18b959){return BPromise[_0x047c('0x26')](_0x18b959);}return _0x1d0d60[_0x047c('0x27')]();};}function saveUpdates(_0x500cc8,_0x23f5cf){return function(_0x37aa80){if(_0x37aa80){return _0x37aa80[_0x047c('0x28')](_0x500cc8)[_0x047c('0x29')](function(_0x19afa4){return _0x19afa4;});}return null;};}function removeEntity(_0x4b94b3,_0x596033){return function(_0x51bdaf){if(_0x51bdaf){return _0x51bdaf[_0x047c('0x2a')]()[_0x047c('0x29')](function(){var _0x225864=_0x51bdaf[_0x047c('0x2b')]({'plain':!![]});var _0x3e118b=_0x047c('0x2c');return db[_0x047c('0x2d')][_0x047c('0x2a')]({'where':{'type':_0x3e118b,'resourceId':_0x225864['id']}})[_0x047c('0x29')](function(){return _0x51bdaf;});})[_0x047c('0x29')](function(){_0x4b94b3[_0x047c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46a354,_0x11a0ea){return function(_0x3bd5fa){if(!_0x3bd5fa){_0x46a354[_0x047c('0x1d')](0x194);}return _0x3bd5fa;};}function handleError(_0x5c53a5,_0xfd2440){_0xfd2440=_0xfd2440||0x1f4;return function(_0x121f21){logger[_0x047c('0x2e')](_0x121f21[_0x047c('0x2f')]);if(_0x121f21[_0x047c('0x30')]){delete _0x121f21[_0x047c('0x30')];}_0x5c53a5[_0x047c('0x1e')](_0xfd2440)[_0x047c('0x31')](_0x121f21);};}exports['index']=function(_0x6a3795,_0x46f4de){var _0x2e50c3={},_0x20ef6a={},_0xccd9ac={'count':0x0,'rows':[]};var _0x469a34=_['map'](db['Dashboard'][_0x047c('0x32')],function(_0xed9f95){return{'name':_0xed9f95['fieldName'],'type':_0xed9f95[_0x047c('0x33')][_0x047c('0x34')]};});_0x20ef6a[_0x047c('0x35')]=_[_0x047c('0x36')](_0x469a34,_0x047c('0x30'));_0x20ef6a['query']=_[_0x047c('0x37')](_0x6a3795[_0x047c('0x38')]);_0x20ef6a[_0x047c('0x39')]=_[_0x047c('0x3a')](_0x20ef6a[_0x047c('0x35')],_0x20ef6a[_0x047c('0x38')]);_0x2e50c3['attributes']=_[_0x047c('0x3a')](_0x20ef6a[_0x047c('0x35')],qs[_0x047c('0x3b')](_0x6a3795[_0x047c('0x38')]['fields']));_0x2e50c3[_0x047c('0x3c')]=_0x2e50c3['attributes'][_0x047c('0x3d')]?_0x2e50c3[_0x047c('0x3c')]:_0x20ef6a[_0x047c('0x35')];if(!_0x6a3795[_0x047c('0x38')][_0x047c('0x3e')](_0x047c('0x3f'))){_0x2e50c3[_0x047c('0x22')]=qs[_0x047c('0x22')](_0x6a3795[_0x047c('0x38')][_0x047c('0x22')]);_0x2e50c3[_0x047c('0x21')]=qs[_0x047c('0x21')](_0x6a3795[_0x047c('0x38')][_0x047c('0x21')]);}_0x2e50c3[_0x047c('0x40')]=qs[_0x047c('0x41')](_0x6a3795[_0x047c('0x38')]['sort']);_0x2e50c3[_0x047c('0x42')]=qs[_0x047c('0x39')](_[_0x047c('0x43')](_0x6a3795[_0x047c('0x38')],_0x20ef6a[_0x047c('0x39')]));if(_0x6a3795[_0x047c('0x38')][_0x047c('0x44')]){_0x2e50c3[_0x047c('0x42')]=_[_0x047c('0x45')](_0x2e50c3['where'],{'$or':_[_0x047c('0x36')](_0x469a34,function(_0x351576){if(_0x351576[_0x047c('0x33')]!==_0x047c('0x46')){var _0xbf353b={};_0xbf353b[_0x351576[_0x047c('0x30')]]={'$like':'%'+_0x6a3795[_0x047c('0x38')]['filter']+'%'};return _0xbf353b;}})});}_0x2e50c3=_['merge']({},_0x2e50c3,_0x6a3795[_0x047c('0x47')]);var _0x1976b4={'where':_0x2e50c3[_0x047c('0x42')]};return db['Dashboard'][_0x047c('0x20')](_0x1976b4)['then'](function(_0x2f43a1){_0xccd9ac['count']=_0x2f43a1;if(_0x6a3795[_0x047c('0x38')]['includeAll']){_0x2e50c3[_0x047c('0x48')]=[{'all':!![]}];}return db[_0x047c('0x49')][_0x047c('0x4a')](_0x2e50c3);})[_0x047c('0x29')](function(_0x97d87f){_0xccd9ac[_0x047c('0x4b')]=_0x97d87f;return _0xccd9ac;})[_0x047c('0x29')](respondWithFilteredResult(_0x46f4de,_0x2e50c3))['catch'](handleError(_0x46f4de,null));};exports[_0x047c('0x4c')]=function(_0x3202e4,_0x1f5d35){var _0x569836={'raw':![],'where':{'id':_0x3202e4['params']['id']}},_0x3fa5d7={};_0x3fa5d7['model']=_[_0x047c('0x37')](db[_0x047c('0x49')][_0x047c('0x32')]);_0x3fa5d7[_0x047c('0x38')]=_[_0x047c('0x37')](_0x3202e4[_0x047c('0x38')]);_0x3fa5d7[_0x047c('0x39')]=_[_0x047c('0x3a')](_0x3fa5d7['model'],_0x3fa5d7[_0x047c('0x38')]);_0x569836[_0x047c('0x3c')]=_['intersection'](_0x3fa5d7[_0x047c('0x35')],qs[_0x047c('0x3b')](_0x3202e4[_0x047c('0x38')][_0x047c('0x3b')]));_0x569836['attributes']=_0x569836[_0x047c('0x3c')][_0x047c('0x3d')]?_0x569836[_0x047c('0x3c')]:_0x3fa5d7[_0x047c('0x35')];if(_0x3202e4[_0x047c('0x38')][_0x047c('0x4d')]){_0x569836[_0x047c('0x48')]=[{'all':!![]}];}_0x569836=_[_0x047c('0x45')]({},_0x569836,_0x3202e4[_0x047c('0x47')]);return db['Dashboard'][_0x047c('0x4e')](_0x569836)[_0x047c('0x29')](handleEntityNotFound(_0x1f5d35,null))[_0x047c('0x29')](respondWithResult(_0x1f5d35,null))[_0x047c('0x4f')](handleError(_0x1f5d35,null));};exports[_0x047c('0x50')]=function(_0x3336e1,_0x4480be){return db[_0x047c('0x49')][_0x047c('0x50')](_0x3336e1['body'],{})[_0x047c('0x29')](function(_0x5c10f2){var _0x111b84=_0x3336e1['user'][_0x047c('0x2b')]({'plain':!![]});if(!_0x111b84)throw new Error(_0x047c('0x51'));if(_0x111b84[_0x047c('0x52')]===_0x047c('0x53')){var _0x4ccada=_0x5c10f2[_0x047c('0x2b')]({'plain':!![]});var _0x34553c=_0x047c('0x2c');return db[_0x047c('0x54')][_0x047c('0x4e')]({'where':{'name':_0x34553c,'userProfileId':_0x111b84[_0x047c('0x55')]},'raw':!![]})['then'](function(_0x3e5b16){if(_0x3e5b16&&_0x3e5b16[_0x047c('0x56')]===0x0){return db[_0x047c('0x2d')]['create']({'name':_0x4ccada[_0x047c('0x30')],'resourceId':_0x4ccada['id'],'type':_0x3e5b16['name'],'sectionId':_0x3e5b16['id']},{})[_0x047c('0x29')](function(){return _0x5c10f2;});}else{return _0x5c10f2;}})[_0x047c('0x4f')](function(_0x570a8a){logger[_0x047c('0x2e')](_0x047c('0x57'),_0x570a8a);throw _0x570a8a;});}return _0x5c10f2;})[_0x047c('0x29')](respondWithResult(_0x4480be,0xc9))[_0x047c('0x4f')](handleError(_0x4480be,null));};exports[_0x047c('0x58')]=function(_0x344077,_0x4e8603){var _0x41bdba={'where':{'id':_0x344077[_0x047c('0x59')]['id']}},_0x443fcb={};_0x443fcb[_0x047c('0x35')]=_['keys'](db[_0x047c('0x49')]['rawAttributes']);_0x41bdba[_0x047c('0x3c')]=_[_0x047c('0x3a')](_0x443fcb[_0x047c('0x35')],qs['fields'](_0x344077['query'][_0x047c('0x3b')]));_0x41bdba[_0x047c('0x3c')]=_0x41bdba[_0x047c('0x3c')][_0x047c('0x3d')]?_0x41bdba['attributes']:_0x443fcb[_0x047c('0x35')];if(_0x344077['query']['includeAll']){_0x41bdba[_0x047c('0x48')]=[{'all':!![]}];}_0x41bdba=_[_0x047c('0x45')]({},_0x41bdba,_0x344077['options']);return db['Dashboard'][_0x047c('0x4e')](_0x41bdba)['then'](handleEntityNotFound(_0x4e8603,null))[_0x047c('0x29')](function(_0x962307){if(_0x962307){var _0xf4cbc7=_0x962307[_0x047c('0x2b')]({'plain':!![]});_0xf4cbc7=qs[_0x047c('0x5a')](_0xf4cbc7,['id',_0x047c('0x5b'),_0x047c('0x5c')]);_0x344077[_0x047c('0x5d')]=_['omit'](_0x344077[_0x047c('0x5d')],['id',_0x047c('0x5b'),_0x047c('0x5c')]);return db[_0x047c('0x49')][_0x047c('0x50')](_[_0x047c('0x45')](_0xf4cbc7,_0x344077['body']),{'include':_0x344077[_0x047c('0x38')][_0x047c('0x4d')]?[{'all':!![]}]:undefined})[_0x047c('0x29')](function(_0x5afa5f){var _0x2c19e6=_0x344077[_0x047c('0x53')][_0x047c('0x2b')]({'plain':!![]});if(!_0x2c19e6)throw new Error(_0x047c('0x51'));if(_0x2c19e6[_0x047c('0x52')]===_0x047c('0x53')){var _0x2c4302=_0x5afa5f[_0x047c('0x2b')]({'plain':!![]});var _0x4ddfca=_0x047c('0x2c');return db[_0x047c('0x54')][_0x047c('0x4e')]({'where':{'name':_0x4ddfca,'userProfileId':_0x2c19e6[_0x047c('0x55')]},'raw':!![]})[_0x047c('0x29')](function(_0x4cd616){if(_0x4cd616&&_0x4cd616[_0x047c('0x56')]===0x0){return db[_0x047c('0x2d')][_0x047c('0x50')]({'name':_0x2c4302[_0x047c('0x30')],'resourceId':_0x2c4302['id'],'type':_0x4cd616[_0x047c('0x30')],'sectionId':_0x4cd616['id']},{})[_0x047c('0x29')](function(){return _0x5afa5f;});}else{return _0x5afa5f;}})[_0x047c('0x4f')](function(_0x4cf688){logger['error'](_0x047c('0x57'),_0x4cf688);throw _0x4cf688;});}return _0x5afa5f;});}})[_0x047c('0x29')](respondWithResult(_0x4e8603,0xc9))[_0x047c('0x4f')](handleError(_0x4e8603,null));};exports[_0x047c('0x28')]=function(_0x422b90,_0x52ade7){if(_0x422b90['body']['id']){delete _0x422b90[_0x047c('0x5d')]['id'];}return db[_0x047c('0x49')]['find']({'where':{'id':_0x422b90[_0x047c('0x59')]['id']}})[_0x047c('0x29')](handleEntityNotFound(_0x52ade7,null))[_0x047c('0x29')](saveUpdates(_0x422b90[_0x047c('0x5d')],null))[_0x047c('0x29')](respondWithResult(_0x52ade7,null))['catch'](handleError(_0x52ade7,null));};exports[_0x047c('0x2a')]=function(_0x31f7da,_0xaca035){return db[_0x047c('0x49')][_0x047c('0x4e')]({'where':{'id':_0x31f7da[_0x047c('0x59')]['id']}})[_0x047c('0x29')](handleEntityNotFound(_0xaca035,null))[_0x047c('0x29')](removeEntity(_0xaca035,null))[_0x047c('0x4f')](handleError(_0xaca035,null));};function widgetAttributes(_0x1b73dc){try{switch(_0x1b73dc['type']){case _0x047c('0x5e'):return[{'name':_0x047c('0x5f'),'value':_0x1b73dc[_0x047c('0x5f')]||(_0x1b73dc[_0x047c('0x60')]&&_0x1b73dc[_0x047c('0x60')][0x0]?_0x1b73dc[_0x047c('0x60')][0x0][_0x047c('0x61')]:undefined)||_0x047c('0x62')}];case _0x047c('0x63'):return[{'name':'attrPath','value':_0x1b73dc['attrPath']||(_0x1b73dc[_0x047c('0x60')]&&_0x1b73dc[_0x047c('0x60')][0x0]?_0x1b73dc[_0x047c('0x60')][0x0][_0x047c('0x61')]:undefined)||''}];case _0x047c('0x64'):return[{'name':_0x047c('0x65'),'value':_0x1b73dc[_0x047c('0x65')]||(_0x1b73dc[_0x047c('0x60')]&&_0x1b73dc[_0x047c('0x60')][0x0]?_0x1b73dc[_0x047c('0x60')][0x0]['value']:undefined)||_0x047c('0x66')},{'name':_0x047c('0x67'),'value':_0x1b73dc['attrTimezone']||(_0x1b73dc[_0x047c('0x60')]&&_0x1b73dc[_0x047c('0x60')][0x1]?_0x1b73dc[_0x047c('0x60')][0x1][_0x047c('0x61')]:undefined)||_0x047c('0x68')},{'name':'attrFontSize','value':_0x1b73dc['attrFontSize']||(_0x1b73dc[_0x047c('0x60')]&&_0x1b73dc[_0x047c('0x60')][0x2]?_0x1b73dc['attrs'][0x2]['value']:undefined)||0xc}];case _0x047c('0x69'):return[{'name':_0x047c('0x6a'),'value':_0x1b73dc[_0x047c('0x6a')]||(_0x1b73dc['attrs']&&_0x1b73dc[_0x047c('0x60')][0x0]?_0x1b73dc['attrs'][0x0][_0x047c('0x61')]:undefined)||'total'},{'name':_0x047c('0x6b'),'value':_0x1b73dc[_0x047c('0x6b')]||(_0x1b73dc['attrs']&&_0x1b73dc[_0x047c('0x60')][0x1]?_0x1b73dc[_0x047c('0x60')][0x1][_0x047c('0x61')]:undefined)||[]},{'name':_0x047c('0x6c'),'value':_0x1b73dc[_0x047c('0x6c')]||(_0x1b73dc[_0x047c('0x60')]&&_0x1b73dc['attrs'][0x2]?_0x1b73dc['attrs'][0x2][_0x047c('0x61')]:undefined)||0x14}];case _0x047c('0x6d'):case _0x047c('0x6e'):return[{'name':_0x047c('0x6f'),'value':_0x1b73dc[_0x047c('0x6f')]||(_0x1b73dc['attrs']&&_0x1b73dc[_0x047c('0x60')][0x0]?_0x1b73dc['attrs'][0x0][_0x047c('0x61')]:undefined)||_0x047c('0x70')},{'name':_0x047c('0x71'),'value':_0x1b73dc[_0x047c('0x71')]||(_0x1b73dc[_0x047c('0x60')]&&_0x1b73dc[_0x047c('0x60')][0x1]?_0x1b73dc['attrs'][0x1][_0x047c('0x61')]:undefined)||null},{'name':_0x047c('0x72'),'value':_0x1b73dc[_0x047c('0x72')]||(_0x1b73dc[_0x047c('0x60')]&&_0x1b73dc['attrs'][0x2]?_0x1b73dc['attrs'][0x2][_0x047c('0x61')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1b73dc[_0x047c('0x6b')]||(_0x1b73dc['attrs']&&_0x1b73dc[_0x047c('0x60')][0x3]?_0x1b73dc['attrs'][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x1b73dc[_0x047c('0x73')]||(_0x1b73dc['attrs']&&_0x1b73dc[_0x047c('0x60')][0x0]?_0x1b73dc[_0x047c('0x60')][0x0][_0x047c('0x33')]:undefined)||null,'value':_0x1b73dc[_0x047c('0x74')]||(_0x1b73dc[_0x047c('0x60')]&&_0x1b73dc[_0x047c('0x60')][0x0]?_0x1b73dc['attrs'][0x0][_0x047c('0x61')]:undefined)||null},{'name':_0x047c('0x75'),'value':_0x1b73dc[_0x047c('0x75')]||(_0x1b73dc[_0x047c('0x60')]&&_0x1b73dc[_0x047c('0x60')][0x1]?_0x1b73dc[_0x047c('0x60')][0x1][_0x047c('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x5e6ac7){logger[_0x047c('0x2e')](_0x047c('0x76'),JSON['stringify'](_0x5e6ac7));return[];}}exports[_0x047c('0x77')]=function(_0x322c46,_0xb76e62,_0x423b85){if(_0x322c46[_0x047c('0x5d')]['id']){delete _0x322c46[_0x047c('0x5d')]['id'];}return db[_0x047c('0x49')]['find']({'where':{'id':_0x322c46[_0x047c('0x59')]['id']}})['then'](handleEntityNotFound(_0xb76e62,null))[_0x047c('0x29')](function(_0x43fb40){if(_0x43fb40){_0x322c46[_0x047c('0x5d')][_0x047c('0x78')]=_0x43fb40['id'];_0x322c46[_0x047c('0x5d')]['attrs']=widgetAttributes(_0x322c46[_0x047c('0x5d')]);return db['DashboardItem']['create'](_0x322c46[_0x047c('0x5d')]);}})['then'](respondWithResult(_0xb76e62,null))[_0x047c('0x4f')](handleError(_0xb76e62,null));};exports['getItems']=function(_0x50c273,_0x512a1c,_0x2fbacb){var _0x1d51ca={};var _0x5f387f={};var _0x50495b;var _0x4a2bd1;return db[_0x047c('0x49')][_0x047c('0x79')]({'where':{'id':_0x50c273[_0x047c('0x59')]['id']}})[_0x047c('0x29')](handleEntityNotFound(_0x512a1c,null))[_0x047c('0x29')](function(_0x5bdffd){if(_0x5bdffd){_0x50495b=_0x5bdffd;_0x5f387f[_0x047c('0x35')]=_[_0x047c('0x37')](db[_0x047c('0x7a')]['rawAttributes']);_0x5f387f['query']=_[_0x047c('0x37')](_0x50c273[_0x047c('0x38')]);_0x5f387f[_0x047c('0x39')]=_[_0x047c('0x3a')](_0x5f387f['model'],_0x5f387f['query']);_0x1d51ca['attributes']=_[_0x047c('0x3a')](_0x5f387f['model'],qs[_0x047c('0x3b')](_0x50c273[_0x047c('0x38')][_0x047c('0x3b')]));_0x1d51ca[_0x047c('0x3c')]=_0x1d51ca[_0x047c('0x3c')][_0x047c('0x3d')]?_0x1d51ca[_0x047c('0x3c')]:_0x5f387f['model'];_0x1d51ca[_0x047c('0x40')]=qs[_0x047c('0x41')](_0x50c273[_0x047c('0x38')][_0x047c('0x41')]);_0x1d51ca[_0x047c('0x42')]=qs[_0x047c('0x39')](_[_0x047c('0x43')](_0x50c273[_0x047c('0x38')],_0x5f387f[_0x047c('0x39')]));if(_0x50c273['query']['filter']){_0x1d51ca[_0x047c('0x42')]=_[_0x047c('0x45')](_0x1d51ca['where'],{'$or':_['map'](_0x1d51ca[_0x047c('0x3c')],function(_0x6b3035){var _0x25282d={};_0x25282d[_0x6b3035]={'$like':'%'+_0x50c273['query']['filter']+'%'};return _0x25282d;})});}_0x1d51ca=_[_0x047c('0x45')]({},_0x1d51ca,_0x50c273[_0x047c('0x47')]);return _0x50495b[_0x047c('0x7b')](_0x1d51ca);}})[_0x047c('0x29')](function(_0x4ac295){if(_0x4ac295){_0x4a2bd1=_0x4ac295[_0x047c('0x3d')];if(!_0x50c273[_0x047c('0x38')][_0x047c('0x3e')]('nolimit')){_0x1d51ca[_0x047c('0x22')]=qs[_0x047c('0x22')](_0x50c273[_0x047c('0x38')][_0x047c('0x22')]);_0x1d51ca[_0x047c('0x21')]=qs[_0x047c('0x21')](_0x50c273[_0x047c('0x38')]['offset']);}return _0x50495b[_0x047c('0x7b')](_0x1d51ca);}})[_0x047c('0x29')](function(_0x4140c2){if(_0x4140c2){return _0x4140c2?{'count':_0x4a2bd1,'rows':_0x4140c2}:null;}})[_0x047c('0x29')](respondWithResult(_0x512a1c,null))[_0x047c('0x4f')](handleError(_0x512a1c,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index e56ec75..174a733 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 _0x9893=['hook','exports','../../mysqldb','Dashboard','setMaxListeners','save','remove','emit'];(function(_0x384067,_0x4d2c20){var _0x152b72=function(_0x47dd35){while(--_0x47dd35){_0x384067['push'](_0x384067['shift']());}};_0x152b72(++_0x4d2c20);}(_0x9893,0xe2));var _0x3989=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9893[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x3989('0x0'))['db'][_0x3989('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x3989('0x2')](0x0);var events={'afterCreate':_0x3989('0x3'),'afterUpdate':'update','afterDestroy':_0x3989('0x4')};function emitEvent(_0x450e80){return function(_0x481ee8,_0x2d0dcf,_0x4f0475){DashboardEvents[_0x3989('0x5')](_0x450e80+':'+_0x481ee8['id'],_0x481ee8);DashboardEvents['emit'](_0x450e80,_0x481ee8);_0x4f0475(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x3989('0x6')](e,emitEvent(event));}}module[_0x3989('0x7')]=DashboardEvents; \ No newline at end of file +var _0x07f4=['save','update','hasOwnProperty','hook','events','Dashboard','setMaxListeners'];(function(_0x2948ea,_0x30e30c){var _0x2b8ee4=function(_0x1d1b33){while(--_0x1d1b33){_0x2948ea['push'](_0x2948ea['shift']());}};_0x2b8ee4(++_0x30e30c);}(_0x07f4,0xd6));var _0x407f=function(_0x58a860,_0x4344f2){_0x58a860=_0x58a860-0x0;var _0x36ca4c=_0x07f4[_0x58a860];return _0x36ca4c;};'use strict';var EventEmitter=require(_0x407f('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x407f('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x407f('0x2')](0x0);var events={'afterCreate':_0x407f('0x3'),'afterUpdate':_0x407f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4c92b2){return function(_0x37f627,_0x26a77f,_0x4af64b){DashboardEvents['emit'](_0x4c92b2+':'+_0x37f627['id'],_0x37f627);DashboardEvents['emit'](_0x4c92b2,_0x37f627);_0x4af64b(null);};}for(var e in events){if(events[_0x407f('0x5')](e)){var event=events[e];Dashboard[_0x407f('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 8c7ac29..50b2933 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 _0x502f=['../../config/environment','exports','define','Dashboard','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1bb58c,_0x2c8a4d){var _0x277586=function(_0x11fd4c){while(--_0x11fd4c){_0x1bb58c['push'](_0x1bb58c['shift']());}};_0x277586(++_0x2c8a4d);}(_0x502f,0x148));var _0xf502=function(_0x2a8bd7,_0x55170d){_0x2a8bd7=_0x2a8bd7-0x0;var _0x23d1e1=_0x502f[_0x2a8bd7];return _0x23d1e1;};'use strict';var _=require(_0xf502('0x0'));var util=require('util');var logger=require(_0xf502('0x1'))(_0xf502('0x2'));var moment=require(_0xf502('0x3'));var BPromise=require(_0xf502('0x4'));var rp=require(_0xf502('0x5'));var fs=require('fs');var path=require(_0xf502('0x6'));var rimraf=require(_0xf502('0x7'));var config=require(_0xf502('0x8'));var attributes=require('./dashboard.attributes');module[_0xf502('0x9')]=function(_0x175710,_0x2a188d){return _0x175710[_0xf502('0xa')](_0xf502('0xb'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x544e=['../../config/logger','bluebird','path','../../config/environment','exports','define','Dashboard','util'];(function(_0x1ebeea,_0x2f54f4){var _0x576465=function(_0x47fc77){while(--_0x47fc77){_0x1ebeea['push'](_0x1ebeea['shift']());}};_0x576465(++_0x2f54f4);}(_0x544e,0x7f));var _0xe544=function(_0x45c81d,_0x5e5298){_0x45c81d=_0x45c81d-0x0;var _0x18f1f1=_0x544e[_0x45c81d];return _0x18f1f1;};'use strict';var _=require('lodash');var util=require(_0xe544('0x0'));var logger=require(_0xe544('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe544('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe544('0x3'));var rimraf=require('rimraf');var config=require(_0xe544('0x4'));var attributes=require('./dashboard.attributes');module[_0xe544('0x5')]=function(_0x198d88,_0x363e07){return _0x198d88[_0xe544('0x6')](_0xe544('0x7'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index c2322fa..a7ef7ac 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 _0xc02c=['../../config/logger','../../config/environment','client','redis','defaults','localhost','./dashboard.socket','register','request','Dashboard,\x20%s,\x20%s','debug','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x27dbad,_0x497508){var _0x44e668=function(_0x108ef8){while(--_0x108ef8){_0x27dbad['push'](_0x27dbad['shift']());}};_0x44e668(++_0x497508);}(_0xc02c,0xf8));var _0xcc02=function(_0x4f617f,_0x28248f){_0x4f617f=_0x4f617f-0x0;var _0xe56a5a=_0xc02c[_0x4f617f];return _0xe56a5a;};'use strict';var _=require(_0xcc02('0x0'));var util=require('util');var moment=require(_0xcc02('0x1'));var BPromise=require('bluebird');var rs=require(_0xcc02('0x2'));var fs=require('fs');var Redis=require(_0xcc02('0x3'));var db=require(_0xcc02('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc02('0x5'))('rpc');var config=require(_0xcc02('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcc02('0x7')]['http']({'port':0x232a});config[_0xcc02('0x8')]=_[_0xcc02('0x9')](config[_0xcc02('0x8')],{'host':_0xcc02('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc02('0x8')]));require(_0xcc02('0xb'))[_0xcc02('0xc')](socket);function respondWithRpcPromise(_0x32618d,_0x54ed1e,_0x5455e0){return new BPromise(function(_0x47f695,_0x4063e9){return client[_0xcc02('0xd')](_0x32618d,_0x5455e0)['then'](function(_0x4bc8b2){logger['info'](_0xcc02('0xe'),_0x54ed1e,'request\x20sent');logger[_0xcc02('0xf')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x54ed1e,'request\x20sent',JSON[_0xcc02('0x10')](_0x4bc8b2));if(_0x4bc8b2[_0xcc02('0x11')]){if(_0x4bc8b2[_0xcc02('0x11')][_0xcc02('0x12')]===0x1f4){logger[_0xcc02('0x11')](_0xcc02('0xe'),_0x54ed1e,_0x4bc8b2['error'][_0xcc02('0x13')]);return _0x4063e9(_0x4bc8b2['error']['message']);}logger['error'](_0xcc02('0xe'),_0x54ed1e,_0x4bc8b2[_0xcc02('0x11')]['message']);return _0x47f695(_0x4bc8b2['error'][_0xcc02('0x13')]);}else{logger[_0xcc02('0x14')](_0xcc02('0xe'),_0x54ed1e,'request\x20sent');_0x47f695(_0x4bc8b2[_0xcc02('0x15')][_0xcc02('0x13')]);}})[_0xcc02('0x16')](function(_0x461daf){logger[_0xcc02('0x11')](_0xcc02('0xe'),_0x54ed1e,_0x461daf);_0x4063e9(_0x461daf);});});} \ No newline at end of file +var _0xfafd=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','./dashboard.socket','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','message','result','util'];(function(_0x4687df,_0x12099c){var _0x32eaef=function(_0x2387db){while(--_0x2387db){_0x4687df['push'](_0x4687df['shift']());}};_0x32eaef(++_0x12099c);}(_0xfafd,0x113));var _0xdfaf=function(_0x504d38,_0x538d83){_0x504d38=_0x504d38-0x0;var _0x3634d5=_0xfafd[_0x504d38];return _0x3634d5;};'use strict';var _=require('lodash');var util=require(_0xdfaf('0x0'));var moment=require(_0xdfaf('0x1'));var BPromise=require(_0xdfaf('0x2'));var rs=require(_0xdfaf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdfaf('0x4'))['db'];var utils=require(_0xdfaf('0x5'));var logger=require(_0xdfaf('0x6'))('rpc');var config=require(_0xdfaf('0x7'));var jayson=require(_0xdfaf('0x8'));var client=jayson[_0xdfaf('0x9')][_0xdfaf('0xa')]({'port':0x232a});config[_0xdfaf('0xb')]=_[_0xdfaf('0xc')](config[_0xdfaf('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdfaf('0xb')]));require(_0xdfaf('0xd'))['register'](socket);function respondWithRpcPromise(_0xf23521,_0x4444dd,_0x42751d){return new BPromise(function(_0x3f3312,_0x50a15f){return client[_0xdfaf('0xe')](_0xf23521,_0x42751d)['then'](function(_0x4247b2){logger[_0xdfaf('0xf')](_0xdfaf('0x10'),_0x4444dd,_0xdfaf('0x11'));logger[_0xdfaf('0x12')](_0xdfaf('0x13'),_0x4444dd,_0xdfaf('0x11'),JSON['stringify'](_0x4247b2));if(_0x4247b2[_0xdfaf('0x14')]){if(_0x4247b2[_0xdfaf('0x14')]['code']===0x1f4){logger[_0xdfaf('0x14')](_0xdfaf('0x10'),_0x4444dd,_0x4247b2[_0xdfaf('0x14')][_0xdfaf('0x15')]);return _0x50a15f(_0x4247b2[_0xdfaf('0x14')][_0xdfaf('0x15')]);}logger[_0xdfaf('0x14')](_0xdfaf('0x10'),_0x4444dd,_0x4247b2[_0xdfaf('0x14')]['message']);return _0x3f3312(_0x4247b2[_0xdfaf('0x14')]['message']);}else{logger[_0xdfaf('0xf')](_0xdfaf('0x10'),_0x4444dd,_0xdfaf('0x11'));_0x3f3312(_0x4247b2[_0xdfaf('0x16')]['message']);}})['catch'](function(_0x1ea038){logger[_0xdfaf('0x14')](_0xdfaf('0x10'),_0x4444dd,_0x1ea038);_0x50a15f(_0x1ea038);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index e0fcb07..deee51c 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 _0xdfc1=['emit','dashboard:','./dashboard.events','save','remove','update'];(function(_0x4f3244,_0x36b2f5){var _0x4708a8=function(_0x39ae21){while(--_0x39ae21){_0x4f3244['push'](_0x4f3244['shift']());}};_0x4708a8(++_0x36b2f5);}(_0xdfc1,0x1ca));var _0x1dfc=function(_0x1bf301,_0xda5c4c){_0x1bf301=_0x1bf301-0x0;var _0x51c947=_0xdfc1[_0x1bf301];return _0x51c947;};'use strict';var DashboardEvents=require(_0x1dfc('0x0'));var events=[_0x1dfc('0x1'),_0x1dfc('0x2'),_0x1dfc('0x3')];function createListener(_0xd5f94c,_0x3696dc){return function(_0x56bcc0){_0x3696dc[_0x1dfc('0x4')](_0xd5f94c,_0x56bcc0);};}function removeListener(_0x1e5b36,_0x1b125a){return function(){DashboardEvents['removeListener'](_0x1e5b36,_0x1b125a);};}exports['register']=function(_0x4eeeb7){for(var _0x30e5e0=0x0,_0x439c79=events['length'];_0x30e5e0<_0x439c79;_0x30e5e0++){var _0x49f5f8=events[_0x30e5e0];var _0x24a869=createListener(_0x1dfc('0x5')+_0x49f5f8,_0x4eeeb7);DashboardEvents['on'](_0x49f5f8,_0x24a869);}}; \ No newline at end of file +var _0x2d34=['emit','register','dashboard:','./dashboard.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d34,0xd5));var _0x42d3=function(_0x299022,_0x300f74){_0x299022=_0x299022-0x0;var _0x48c0ce=_0x2d34[_0x299022];return _0x48c0ce;};'use strict';var DashboardEvents=require(_0x42d3('0x0'));var events=[_0x42d3('0x1'),'remove','update'];function createListener(_0x4cc63e,_0x14aa10){return function(_0x308121){_0x14aa10[_0x42d3('0x2')](_0x4cc63e,_0x308121);};}function removeListener(_0x164274,_0x37d516){return function(){DashboardEvents['removeListener'](_0x164274,_0x37d516);};}exports[_0x42d3('0x3')]=function(_0x2ffd38){for(var _0x50a8d2=0x0,_0x14f3ea=events['length'];_0x50a8d2<_0x14f3ea;_0x50a8d2++){var _0x3cbeb0=events[_0x50a8d2];var _0x2cb450=createListener(_0x42d3('0x4')+_0x3cbeb0,_0x2ffd38);DashboardEvents['on'](_0x3cbeb0,_0x2cb450);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index e881605..38a08ed 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 _0xb7e7=['addItem','put','update','delete','multer','path','express','../../components/auth/service','../../config/environment','./dashboard.controller','get','/:id','isAuthenticated','/:id/items','getItems','post','create','/:id/clone','clone'];(function(_0x4bd67a,_0x4f9725){var _0x2be5fb=function(_0x33e132){while(--_0x33e132){_0x4bd67a['push'](_0x4bd67a['shift']());}};_0x2be5fb(++_0x4f9725);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb7e7[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xc')]);router['post'](_0x7b7e('0xd'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xe')]);router[_0x7b7e('0xb')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0x7'),auth['isAuthenticated'](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x12')]('/:id',auth[_0x7b7e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd8b0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','index','get','/:id','show','isAuthenticated','getItems','post','create','/:id/clone','addItem','put','update','delete','destroy','exports','multer','util','Router'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/items',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xd')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller['clone']);router[_0x0d8b('0xd')]('/:id/items',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x13')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x14')]);module[_0x0d8b('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 0a6062a..3f4791b 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 _0x5d96=['sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff'];(function(_0x43c22e,_0x252785){var _0x2c13b6=function(_0x312422){while(--_0x312422){_0x43c22e['push'](_0x43c22e['shift']());}};_0x2c13b6(++_0x252785);}(_0x5d96,0xc4));var _0x65d9=function(_0x24cf9b,_0x19a454){_0x24cf9b=_0x24cf9b-0x0;var _0x48735d=_0x5d96[_0x24cf9b];return _0x48735d;};'use strict';var Sequelize=require(_0x65d9('0x0'));var squel=require(_0x65d9('0x1'));var _=require(_0x65d9('0x2'));module[_0x65d9('0x3')]={'title':{'type':Sequelize[_0x65d9('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x65d9('0x5')](_0x65d9('0x6')),'get':function(){try{return JSON[_0x65d9('0x7')](this[_0x65d9('0x8')](_0x65d9('0x9')));}catch(_0x2cbc98){return[];}},'set':function(_0x24ab51){try{this[_0x65d9('0xa')](_0x65d9('0x9'),JSON[_0x65d9('0xb')](_0x24ab51));}catch(_0x4f9443){this[_0x65d9('0xa')]('attrs',JSON[_0x65d9('0xb')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x65d9('0xc')]},'col':{'type':Sequelize[_0x65d9('0xc')]},'background':{'type':Sequelize[_0x65d9('0x4')],'allowNull':![],'defaultValue':_0x65d9('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x65d9('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x65d9('0x4')]}}; \ No newline at end of file +var _0x82b2=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','sequelize','STRING','long'];(function(_0xeb61a,_0x55e4fc){var _0x2d3f34=function(_0x304974){while(--_0x304974){_0xeb61a['push'](_0xeb61a['shift']());}};_0x2d3f34(++_0x55e4fc);}(_0x82b2,0x151));var _0x282b=function(_0x2c7b86,_0x59ef3c){_0x2c7b86=_0x2c7b86-0x0;var _0x256735=_0x82b2[_0x2c7b86];return _0x256735;};'use strict';var Sequelize=require(_0x282b('0x0'));var squel=require('squel');var _=require('lodash');module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x282b('0x1')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x282b('0x2')),'get':function(){try{return JSON[_0x282b('0x3')](this[_0x282b('0x4')](_0x282b('0x5')));}catch(_0x57c274){return[];}},'set':function(_0xc521b4){try{this[_0x282b('0x6')](_0x282b('0x5'),JSON['stringify'](_0xc521b4));}catch(_0x488b5c){this[_0x282b('0x6')]('attrs',JSON[_0x282b('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x282b('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x282b('0x8')]},'col':{'type':Sequelize[_0x282b('0x8')]},'background':{'type':Sequelize[_0x282b('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x282b('0x9'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x282b('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index eb0eb69..991121a 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 _0x6495=['value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','web-report','attrReport','reportType','attrRefresh','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./dashboardItem.socket','register','status','count','offset','set','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','params','type','iframe','attrUrl','attrs','https://','custom','attrPath'];(function(_0x170084,_0x20843b){var _0x4735d6=function(_0x5b0b1e){while(--_0x5b0b1e){_0x170084['push'](_0x170084['shift']());}};_0x4735d6(++_0x20843b);}(_0x6495,0x68));var _0x5649=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6495[_0x19950b];return _0x3c6b41;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5649('0x0'));var rimraf=require(_0x5649('0x1'));var zipdir=require(_0x5649('0x2'));var jsonpatch=require(_0x5649('0x3'));var rp=require(_0x5649('0x4'));var moment=require('moment');var BPromise=require(_0x5649('0x5'));var Mustache=require(_0x5649('0x6'));var util=require('util');var path=require(_0x5649('0x7'));var sox=require(_0x5649('0x8'));var csv=require(_0x5649('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5649('0xa'));var crypto=require(_0x5649('0xb'));var jsforce=require(_0x5649('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5649('0xd'));var Papa=require(_0x5649('0xe'));var Redis=require(_0x5649('0xf'));var authService=require(_0x5649('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5649('0x11'));var logger=require(_0x5649('0x12'))(_0x5649('0x13'));var utils=require(_0x5649('0x14'));var config=require('../../config/environment');var db=require(_0x5649('0x15'))['db'];config[_0x5649('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5649('0x17'))(new Redis(config[_0x5649('0x16')]));require(_0x5649('0x18'))[_0x5649('0x19')](socket);function respondWithStatusCode(_0x3781ac,_0x4dd4cd){_0x4dd4cd=_0x4dd4cd||0xcc;return function(_0x1b28ff){if(_0x1b28ff){return _0x3781ac['sendStatus'](_0x4dd4cd);}return _0x3781ac[_0x5649('0x1a')](_0x4dd4cd)['end']();};}function respondWithResult(_0x3eec42,_0x2da2f8){_0x2da2f8=_0x2da2f8||0xc8;return function(_0x138cc4){if(_0x138cc4){return _0x3eec42[_0x5649('0x1a')](_0x2da2f8)['json'](_0x138cc4);}};}function respondWithFilteredResult(_0x3a1813,_0x32c085){return function(_0x5b8118){if(_0x5b8118){var _0x488c9f=_0x5b8118[_0x5649('0x1b')],_0x5b0d80=_0x32c085[_0x5649('0x1c')],_0x35d049=_0x32c085[_0x5649('0x1c')]+_0x32c085['limit'],_0x428428;if(_0x35d049>=_0x488c9f){_0x35d049=_0x488c9f;_0x428428=0xc8;}else{_0x428428=0xce;}_0x3a1813['status'](_0x428428);return _0x3a1813[_0x5649('0x1d')]('Content-Range',_0x5b0d80+'-'+_0x35d049+'/'+_0x488c9f)[_0x5649('0x1e')](_0x5b8118);}return null;};}function patchUpdates(_0x33eaba){return function(_0x52c3d8){try{jsonpatch[_0x5649('0x1f')](_0x52c3d8,_0x33eaba,!![]);}catch(_0x20c1c1){return BPromise[_0x5649('0x20')](_0x20c1c1);}return _0x52c3d8[_0x5649('0x21')]();};}function saveUpdates(_0x5890e2,_0xe7d07){return function(_0x2cea74){if(_0x2cea74){return _0x2cea74[_0x5649('0x22')](_0x5890e2)[_0x5649('0x23')](function(_0x38955a){return _0x38955a;});}return null;};}function removeEntity(_0x29b278,_0x17ded7){return function(_0x38fcd7){if(_0x38fcd7){return _0x38fcd7[_0x5649('0x24')]()['then'](function(){_0x29b278[_0x5649('0x1a')](0xcc)[_0x5649('0x25')]();});}};}function handleEntityNotFound(_0x48c581,_0x30a721){return function(_0x5e6773){if(!_0x5e6773){_0x48c581[_0x5649('0x26')](0x194);}return _0x5e6773;};}function handleError(_0x2b679f,_0x116c39){_0x116c39=_0x116c39||0x1f4;return function(_0x4e6037){logger[_0x5649('0x27')](_0x4e6037[_0x5649('0x28')]);if(_0x4e6037[_0x5649('0x29')]){delete _0x4e6037[_0x5649('0x29')];}_0x2b679f[_0x5649('0x1a')](_0x116c39)[_0x5649('0x2a')](_0x4e6037);};}exports[_0x5649('0x2b')]=function(_0x9c47b8,_0x1ffe00){var _0x310fbc={'raw':![],'where':{'id':_0x9c47b8['params']['id']}},_0xeb1720={};_0xeb1720[_0x5649('0x2c')]=_[_0x5649('0x2d')](db[_0x5649('0x2e')][_0x5649('0x2f')]);_0xeb1720[_0x5649('0x30')]=_[_0x5649('0x2d')](_0x9c47b8[_0x5649('0x30')]);_0xeb1720[_0x5649('0x31')]=_['intersection'](_0xeb1720[_0x5649('0x2c')],_0xeb1720[_0x5649('0x30')]);_0x310fbc['attributes']=_[_0x5649('0x32')](_0xeb1720['model'],qs['fields'](_0x9c47b8[_0x5649('0x30')][_0x5649('0x33')]));_0x310fbc[_0x5649('0x34')]=_0x310fbc['attributes'][_0x5649('0x35')]?_0x310fbc[_0x5649('0x34')]:_0xeb1720[_0x5649('0x2c')];if(_0x9c47b8[_0x5649('0x30')][_0x5649('0x36')]){_0x310fbc[_0x5649('0x37')]=[{'all':!![]}];}_0x310fbc=_[_0x5649('0x38')]({},_0x310fbc,_0x9c47b8[_0x5649('0x39')]);return db['DashboardItem'][_0x5649('0x3a')](_0x310fbc)['then'](handleEntityNotFound(_0x1ffe00,null))[_0x5649('0x23')](respondWithResult(_0x1ffe00,null))[_0x5649('0x3b')](handleError(_0x1ffe00,null));};exports[_0x5649('0x24')]=function(_0x2eac4a,_0x155d9e){return db['DashboardItem'][_0x5649('0x3a')]({'where':{'id':_0x2eac4a[_0x5649('0x3c')]['id']}})[_0x5649('0x23')](handleEntityNotFound(_0x155d9e,null))[_0x5649('0x23')](removeEntity(_0x155d9e,null))['catch'](handleError(_0x155d9e,null));};function widgetAttributes(_0x40af67){try{switch(_0x40af67[_0x5649('0x3d')]){case _0x5649('0x3e'):return[{'name':'attrUrl','value':_0x40af67[_0x5649('0x3f')]||(_0x40af67[_0x5649('0x40')]&&_0x40af67['attrs'][0x0]?_0x40af67[_0x5649('0x40')][0x0]['value']:undefined)||_0x5649('0x41')}];case _0x5649('0x42'):return[{'name':_0x5649('0x43'),'value':_0x40af67[_0x5649('0x43')]||(_0x40af67['attrs']&&_0x40af67[_0x5649('0x40')][0x0]?_0x40af67['attrs'][0x0][_0x5649('0x44')]:undefined)||''}];case _0x5649('0x45'):return[{'name':_0x5649('0x46'),'value':_0x40af67[_0x5649('0x46')]||(_0x40af67[_0x5649('0x40')]&&_0x40af67['attrs'][0x0]?_0x40af67[_0x5649('0x40')][0x0]['value']:undefined)||_0x5649('0x47')},{'name':_0x5649('0x48'),'value':_0x40af67['attrTimezone']||(_0x40af67[_0x5649('0x40')]&&_0x40af67[_0x5649('0x40')][0x1]?_0x40af67[_0x5649('0x40')][0x1][_0x5649('0x44')]:undefined)||_0x5649('0x49')},{'name':_0x5649('0x4a'),'value':_0x40af67['attrFontSize']||(_0x40af67['attrs']&&_0x40af67[_0x5649('0x40')][0x2]?_0x40af67['attrs'][0x2][_0x5649('0x44')]:undefined)||0xc}];case'counter':return[{'name':_0x5649('0x4b'),'value':_0x40af67[_0x5649('0x4b')]||(_0x40af67[_0x5649('0x40')]&&_0x40af67[_0x5649('0x40')][0x0]?_0x40af67['attrs'][0x0][_0x5649('0x44')]:undefined)||_0x5649('0x4c')},{'name':_0x5649('0x4d'),'value':_0x40af67['attrVoiceQueues']||(_0x40af67[_0x5649('0x40')]&&_0x40af67[_0x5649('0x40')][0x1]?_0x40af67[_0x5649('0x40')][0x1]['value']:undefined)||[]},{'name':_0x5649('0x4a'),'value':_0x40af67[_0x5649('0x4a')]||(_0x40af67[_0x5649('0x40')]&&_0x40af67['attrs'][0x2]?_0x40af67[_0x5649('0x40')][0x2][_0x5649('0x44')]:undefined)||0x14}];case'multibar-chart':case _0x5649('0x4e'):return[{'name':_0x5649('0x4f'),'value':_0x40af67['attrSerie1']||(_0x40af67['attrs']&&_0x40af67[_0x5649('0x40')][0x0]?_0x40af67[_0x5649('0x40')][0x0][_0x5649('0x44')]:undefined)||_0x5649('0x4c')},{'name':_0x5649('0x50'),'value':_0x40af67[_0x5649('0x50')]||(_0x40af67[_0x5649('0x40')]&&_0x40af67['attrs'][0x1]?_0x40af67[_0x5649('0x40')][0x1][_0x5649('0x44')]:undefined)||null},{'name':'attrSerie3','value':_0x40af67['attrSerie3']||(_0x40af67[_0x5649('0x40')]&&_0x40af67['attrs'][0x2]?_0x40af67['attrs'][0x2][_0x5649('0x44')]:undefined)||null},{'name':_0x5649('0x4d'),'value':_0x40af67[_0x5649('0x4d')]||(_0x40af67['attrs']&&_0x40af67['attrs'][0x3]?_0x40af67[_0x5649('0x40')][0x3][_0x5649('0x44')]:undefined)||[]}];case _0x5649('0x51'):return[{'name':_0x5649('0x52'),'type':_0x40af67[_0x5649('0x53')]||(_0x40af67[_0x5649('0x40')]&&_0x40af67[_0x5649('0x40')][0x0]?_0x40af67[_0x5649('0x40')][0x0][_0x5649('0x3d')]:undefined)||null,'value':_0x40af67[_0x5649('0x52')]||(_0x40af67['attrs']&&_0x40af67[_0x5649('0x40')][0x0]?_0x40af67[_0x5649('0x40')][0x0]['value']:undefined)||null},{'name':_0x5649('0x54'),'value':_0x40af67[_0x5649('0x54')]||(_0x40af67[_0x5649('0x40')]&&_0x40af67[_0x5649('0x40')][0x1]?_0x40af67[_0x5649('0x40')][0x1][_0x5649('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x3b7cba){logger[_0x5649('0x27')]('widgetAttributes:\x20%s',JSON['stringify'](_0x3b7cba));return[];}}exports['create']=function(_0x49e89c,_0x51323d){if(_0x49e89c['body']){_0x49e89c[_0x5649('0x55')]['attrs']=widgetAttributes(_0x49e89c['body']);}return db['DashboardItem']['create'](_0x49e89c['body'],{})['then'](respondWithResult(_0x51323d,0xc9))[_0x5649('0x3b')](handleError(_0x51323d,null));};exports[_0x5649('0x22')]=function(_0x15f4ed,_0x7c76ae){if(_0x15f4ed[_0x5649('0x55')]['id']){delete _0x15f4ed['body']['id'];}_0x15f4ed[_0x5649('0x55')][_0x5649('0x40')]=widgetAttributes(_0x15f4ed['body']);return db[_0x5649('0x2e')]['find']({'where':{'id':_0x15f4ed[_0x5649('0x3c')]['id']}})[_0x5649('0x23')](handleEntityNotFound(_0x7c76ae,null))[_0x5649('0x23')](saveUpdates(_0x15f4ed[_0x5649('0x55')],null))[_0x5649('0x23')](respondWithResult(_0x7c76ae,null))[_0x5649('0x3b')](handleError(_0x7c76ae,null));}; \ No newline at end of file +var _0x3b00=['apply','reject','save','update','then','destroy','status','sendStatus','error','name','send','show','params','model','keys','DashboardItem','query','attributes','intersection','fields','length','include','merge','options','find','catch','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','stringify','create','body','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','redis','defaults','localhost','./dashboardItem.socket','end','json','count','limit','set','Content-Range'];(function(_0x34ed48,_0x2cc995){var _0x37da5c=function(_0x5b6e16){while(--_0x5b6e16){_0x34ed48['push'](_0x34ed48['shift']());}};_0x37da5c(++_0x2cc995);}(_0x3b00,0x12b));var _0x03b0=function(_0x5e6f6f,_0x3a1630){_0x5e6f6f=_0x5e6f6f-0x0;var _0x27e8e8=_0x3b00[_0x5e6f6f];return _0x27e8e8;};'use strict';var pdf=require(_0x03b0('0x0'));var emlformat=require(_0x03b0('0x1'));var rimraf=require(_0x03b0('0x2'));var zipdir=require(_0x03b0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x03b0('0x4'));var BPromise=require(_0x03b0('0x5'));var Mustache=require(_0x03b0('0x6'));var util=require('util');var path=require(_0x03b0('0x7'));var sox=require(_0x03b0('0x8'));var csv=require(_0x03b0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x03b0('0xa'));var squel=require('squel');var crypto=require(_0x03b0('0xb'));var jsforce=require(_0x03b0('0xc'));var deskjs=require(_0x03b0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x03b0('0xe'));var authService=require(_0x03b0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x03b0('0x10'));var hardwareService=require(_0x03b0('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x03b0('0x12'));var db=require('../../mysqldb')['db'];config[_0x03b0('0x13')]=_[_0x03b0('0x14')](config[_0x03b0('0x13')],{'host':_0x03b0('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03b0('0x13')]));require(_0x03b0('0x16'))['register'](socket);function respondWithStatusCode(_0x119a4c,_0x4a10b1){_0x4a10b1=_0x4a10b1||0xcc;return function(_0x5f5609){if(_0x5f5609){return _0x119a4c['sendStatus'](_0x4a10b1);}return _0x119a4c['status'](_0x4a10b1)[_0x03b0('0x17')]();};}function respondWithResult(_0x5e7460,_0x4f1cb0){_0x4f1cb0=_0x4f1cb0||0xc8;return function(_0x1d1679){if(_0x1d1679){return _0x5e7460['status'](_0x4f1cb0)[_0x03b0('0x18')](_0x1d1679);}};}function respondWithFilteredResult(_0x4bf0aa,_0x33bd50){return function(_0x1d86c2){if(_0x1d86c2){var _0xa97343=_0x1d86c2[_0x03b0('0x19')],_0x2edef4=_0x33bd50['offset'],_0x375c0c=_0x33bd50['offset']+_0x33bd50[_0x03b0('0x1a')],_0x2d0da3;if(_0x375c0c>=_0xa97343){_0x375c0c=_0xa97343;_0x2d0da3=0xc8;}else{_0x2d0da3=0xce;}_0x4bf0aa['status'](_0x2d0da3);return _0x4bf0aa[_0x03b0('0x1b')](_0x03b0('0x1c'),_0x2edef4+'-'+_0x375c0c+'/'+_0xa97343)['json'](_0x1d86c2);}return null;};}function patchUpdates(_0x1eda88){return function(_0x488f70){try{jsonpatch[_0x03b0('0x1d')](_0x488f70,_0x1eda88,!![]);}catch(_0x59a3b5){return BPromise[_0x03b0('0x1e')](_0x59a3b5);}return _0x488f70[_0x03b0('0x1f')]();};}function saveUpdates(_0x40b8a9,_0x105b0b){return function(_0x3d5e55){if(_0x3d5e55){return _0x3d5e55[_0x03b0('0x20')](_0x40b8a9)[_0x03b0('0x21')](function(_0x46476a){return _0x46476a;});}return null;};}function removeEntity(_0x2028f5,_0x3795fb){return function(_0x2b536b){if(_0x2b536b){return _0x2b536b[_0x03b0('0x22')]()['then'](function(){_0x2028f5[_0x03b0('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a1072,_0x52c558){return function(_0x4e92e8){if(!_0x4e92e8){_0x1a1072[_0x03b0('0x24')](0x194);}return _0x4e92e8;};}function handleError(_0x195b14,_0x201742){_0x201742=_0x201742||0x1f4;return function(_0x3f0a68){logger[_0x03b0('0x25')](_0x3f0a68['stack']);if(_0x3f0a68['name']){delete _0x3f0a68[_0x03b0('0x26')];}_0x195b14[_0x03b0('0x23')](_0x201742)[_0x03b0('0x27')](_0x3f0a68);};}exports[_0x03b0('0x28')]=function(_0x3cf514,_0x2c92fe){var _0x3647ef={'raw':![],'where':{'id':_0x3cf514[_0x03b0('0x29')]['id']}},_0x137673={};_0x137673[_0x03b0('0x2a')]=_[_0x03b0('0x2b')](db[_0x03b0('0x2c')]['rawAttributes']);_0x137673['query']=_[_0x03b0('0x2b')](_0x3cf514[_0x03b0('0x2d')]);_0x137673['filters']=_['intersection'](_0x137673[_0x03b0('0x2a')],_0x137673['query']);_0x3647ef[_0x03b0('0x2e')]=_[_0x03b0('0x2f')](_0x137673[_0x03b0('0x2a')],qs[_0x03b0('0x30')](_0x3cf514['query'][_0x03b0('0x30')]));_0x3647ef[_0x03b0('0x2e')]=_0x3647ef[_0x03b0('0x2e')][_0x03b0('0x31')]?_0x3647ef['attributes']:_0x137673[_0x03b0('0x2a')];if(_0x3cf514[_0x03b0('0x2d')]['includeAll']){_0x3647ef[_0x03b0('0x32')]=[{'all':!![]}];}_0x3647ef=_[_0x03b0('0x33')]({},_0x3647ef,_0x3cf514[_0x03b0('0x34')]);return db[_0x03b0('0x2c')]['find'](_0x3647ef)[_0x03b0('0x21')](handleEntityNotFound(_0x2c92fe,null))[_0x03b0('0x21')](respondWithResult(_0x2c92fe,null))['catch'](handleError(_0x2c92fe,null));};exports[_0x03b0('0x22')]=function(_0xd53dc6,_0xfff50c){return db[_0x03b0('0x2c')][_0x03b0('0x35')]({'where':{'id':_0xd53dc6[_0x03b0('0x29')]['id']}})['then'](handleEntityNotFound(_0xfff50c,null))['then'](removeEntity(_0xfff50c,null))[_0x03b0('0x36')](handleError(_0xfff50c,null));};function widgetAttributes(_0x2eb577){try{switch(_0x2eb577['type']){case _0x03b0('0x37'):return[{'name':_0x03b0('0x38'),'value':_0x2eb577[_0x03b0('0x38')]||(_0x2eb577['attrs']&&_0x2eb577[_0x03b0('0x39')][0x0]?_0x2eb577[_0x03b0('0x39')][0x0][_0x03b0('0x3a')]:undefined)||'https://'}];case _0x03b0('0x3b'):return[{'name':_0x03b0('0x3c'),'value':_0x2eb577[_0x03b0('0x3c')]||(_0x2eb577[_0x03b0('0x39')]&&_0x2eb577[_0x03b0('0x39')][0x0]?_0x2eb577[_0x03b0('0x39')][0x0][_0x03b0('0x3a')]:undefined)||''}];case'clock':return[{'name':_0x03b0('0x3d'),'value':_0x2eb577['attrHourFormat']||(_0x2eb577[_0x03b0('0x39')]&&_0x2eb577[_0x03b0('0x39')][0x0]?_0x2eb577[_0x03b0('0x39')][0x0][_0x03b0('0x3a')]:undefined)||_0x03b0('0x3e')},{'name':_0x03b0('0x3f'),'value':_0x2eb577[_0x03b0('0x3f')]||(_0x2eb577['attrs']&&_0x2eb577[_0x03b0('0x39')][0x1]?_0x2eb577[_0x03b0('0x39')][0x1][_0x03b0('0x3a')]:undefined)||_0x03b0('0x40')},{'name':_0x03b0('0x41'),'value':_0x2eb577['attrFontSize']||(_0x2eb577[_0x03b0('0x39')]&&_0x2eb577[_0x03b0('0x39')][0x2]?_0x2eb577[_0x03b0('0x39')][0x2][_0x03b0('0x3a')]:undefined)||0xc}];case _0x03b0('0x42'):return[{'name':_0x03b0('0x43'),'value':_0x2eb577[_0x03b0('0x43')]||(_0x2eb577[_0x03b0('0x39')]&&_0x2eb577[_0x03b0('0x39')][0x0]?_0x2eb577[_0x03b0('0x39')][0x0]['value']:undefined)||'total'},{'name':_0x03b0('0x44'),'value':_0x2eb577[_0x03b0('0x44')]||(_0x2eb577[_0x03b0('0x39')]&&_0x2eb577[_0x03b0('0x39')][0x1]?_0x2eb577[_0x03b0('0x39')][0x1][_0x03b0('0x3a')]:undefined)||[]},{'name':_0x03b0('0x41'),'value':_0x2eb577[_0x03b0('0x41')]||(_0x2eb577['attrs']&&_0x2eb577[_0x03b0('0x39')][0x2]?_0x2eb577[_0x03b0('0x39')][0x2][_0x03b0('0x3a')]:undefined)||0x14}];case _0x03b0('0x45'):case'pie-chart':return[{'name':_0x03b0('0x46'),'value':_0x2eb577[_0x03b0('0x46')]||(_0x2eb577[_0x03b0('0x39')]&&_0x2eb577['attrs'][0x0]?_0x2eb577[_0x03b0('0x39')][0x0][_0x03b0('0x3a')]:undefined)||_0x03b0('0x47')},{'name':_0x03b0('0x48'),'value':_0x2eb577['attrSerie2']||(_0x2eb577[_0x03b0('0x39')]&&_0x2eb577[_0x03b0('0x39')][0x1]?_0x2eb577['attrs'][0x1][_0x03b0('0x3a')]:undefined)||null},{'name':_0x03b0('0x49'),'value':_0x2eb577[_0x03b0('0x49')]||(_0x2eb577[_0x03b0('0x39')]&&_0x2eb577[_0x03b0('0x39')][0x2]?_0x2eb577['attrs'][0x2][_0x03b0('0x3a')]:undefined)||null},{'name':_0x03b0('0x44'),'value':_0x2eb577['attrVoiceQueues']||(_0x2eb577[_0x03b0('0x39')]&&_0x2eb577[_0x03b0('0x39')][0x3]?_0x2eb577['attrs'][0x3][_0x03b0('0x3a')]:undefined)||[]}];case _0x03b0('0x4a'):return[{'name':_0x03b0('0x4b'),'type':_0x2eb577[_0x03b0('0x4c')]||(_0x2eb577[_0x03b0('0x39')]&&_0x2eb577[_0x03b0('0x39')][0x0]?_0x2eb577['attrs'][0x0][_0x03b0('0x4d')]:undefined)||null,'value':_0x2eb577[_0x03b0('0x4b')]||(_0x2eb577[_0x03b0('0x39')]&&_0x2eb577['attrs'][0x0]?_0x2eb577[_0x03b0('0x39')][0x0][_0x03b0('0x3a')]:undefined)||null},{'name':_0x03b0('0x4e'),'value':_0x2eb577[_0x03b0('0x4e')]||(_0x2eb577['attrs']&&_0x2eb577[_0x03b0('0x39')][0x1]?_0x2eb577[_0x03b0('0x39')][0x1][_0x03b0('0x3a')]:undefined)||0x0}];default:return[];}}catch(_0x499ac7){logger['error']('widgetAttributes:\x20%s',JSON[_0x03b0('0x4f')](_0x499ac7));return[];}}exports[_0x03b0('0x50')]=function(_0x48de4e,_0x49bb57){if(_0x48de4e[_0x03b0('0x51')]){_0x48de4e[_0x03b0('0x51')][_0x03b0('0x39')]=widgetAttributes(_0x48de4e[_0x03b0('0x51')]);}return db[_0x03b0('0x2c')][_0x03b0('0x50')](_0x48de4e[_0x03b0('0x51')],{})[_0x03b0('0x21')](respondWithResult(_0x49bb57,0xc9))['catch'](handleError(_0x49bb57,null));};exports[_0x03b0('0x20')]=function(_0x30e49c,_0x3612d2){if(_0x30e49c[_0x03b0('0x51')]['id']){delete _0x30e49c['body']['id'];}_0x30e49c['body'][_0x03b0('0x39')]=widgetAttributes(_0x30e49c[_0x03b0('0x51')]);return db[_0x03b0('0x2c')][_0x03b0('0x35')]({'where':{'id':_0x30e49c[_0x03b0('0x29')]['id']}})['then'](handleEntityNotFound(_0x3612d2,null))[_0x03b0('0x21')](saveUpdates(_0x30e49c['body'],null))['then'](respondWithResult(_0x3612d2,null))['catch'](handleError(_0x3612d2,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 40d459a..e8c99af 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 _0x8308=['../../mysqldb','save','update','remove','emit','hook','exports','events'];(function(_0x120123,_0x4eff59){var _0x3bec4c=function(_0x182818){while(--_0x182818){_0x120123['push'](_0x120123['shift']());}};_0x3bec4c(++_0x4eff59);}(_0x8308,0x10f));var _0x8830=function(_0x425540,_0x97a491){_0x425540=_0x425540-0x0;var _0x117693=_0x8308[_0x425540];return _0x117693;};'use strict';var EventEmitter=require(_0x8830('0x0'));var DashboardItem=require(_0x8830('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8830('0x2'),'afterUpdate':_0x8830('0x3'),'afterDestroy':_0x8830('0x4')};function emitEvent(_0x38574a){return function(_0x47830a,_0x1cf107,_0x1b47ab){DashboardItemEvents[_0x8830('0x5')](_0x38574a+':'+_0x47830a['id'],_0x47830a);DashboardItemEvents[_0x8830('0x5')](_0x38574a,_0x47830a);_0x1b47ab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x8830('0x6')](e,emitEvent(event));}}module[_0x8830('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0x4bd0=['hasOwnProperty','hook','exports','setMaxListeners','save','update','remove','emit'];(function(_0x1abcf3,_0x1ce174){var _0x546f56=function(_0x269a40){while(--_0x269a40){_0x1abcf3['push'](_0x1abcf3['shift']());}};_0x546f56(++_0x1ce174);}(_0x4bd0,0x143));var _0x04bd=function(_0x10df87,_0x4e3dcb){_0x10df87=_0x10df87-0x0;var _0x22923d=_0x4bd0[_0x10df87];return _0x22923d;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x04bd('0x0')](0x0);var events={'afterCreate':_0x04bd('0x1'),'afterUpdate':_0x04bd('0x2'),'afterDestroy':_0x04bd('0x3')};function emitEvent(_0x342c23){return function(_0x33ce36,_0xbf41c0,_0x53d0b1){DashboardItemEvents[_0x04bd('0x4')](_0x342c23+':'+_0x33ce36['id'],_0x33ce36);DashboardItemEvents[_0x04bd('0x4')](_0x342c23,_0x33ce36);_0x53d0b1(null);};}for(var e in events){if(events[_0x04bd('0x5')](e)){var event=events[e];DashboardItem[_0x04bd('0x6')](e,emitEvent(event));}}module[_0x04bd('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 080335f..83ccb8e 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 _0x4a38=['../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2cb7ab,_0x2ec6a3){var _0x5db6ee=function(_0x538fe9){while(--_0x538fe9){_0x2cb7ab['push'](_0x2cb7ab['shift']());}};_0x5db6ee(++_0x2ec6a3);}(_0x4a38,0x172));var _0x84a3=function(_0xc6900,_0x27d4b1){_0xc6900=_0xc6900-0x0;var _0x421a25=_0x4a38[_0xc6900];return _0x421a25;};'use strict';var _=require(_0x84a3('0x0'));var util=require(_0x84a3('0x1'));var logger=require(_0x84a3('0x2'))(_0x84a3('0x3'));var moment=require(_0x84a3('0x4'));var BPromise=require(_0x84a3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84a3('0x6'));var rimraf=require(_0x84a3('0x7'));var config=require(_0x84a3('0x8'));var attributes=require(_0x84a3('0x9'));module[_0x84a3('0xa')]=function(_0x2326ff,_0x26c13a){return _0x2326ff[_0x84a3('0xb')](_0x84a3('0xc'),attributes,{'tableName':_0x84a3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12dc=['request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment'];(function(_0x17db0f,_0xf01f63){var _0x241191=function(_0x368495){while(--_0x368495){_0x17db0f['push'](_0x17db0f['shift']());}};_0x241191(++_0xf01f63);}(_0x12dc,0x167));var _0xc12d=function(_0x5a88db,_0x14e49a){_0x5a88db=_0x5a88db-0x0;var _0x5442d2=_0x12dc[_0x5a88db];return _0x5442d2;};'use strict';var _=require(_0xc12d('0x0'));var util=require(_0xc12d('0x1'));var logger=require(_0xc12d('0x2'))(_0xc12d('0x3'));var moment=require(_0xc12d('0x4'));var BPromise=require('bluebird');var rp=require(_0xc12d('0x5'));var fs=require('fs');var path=require(_0xc12d('0x6'));var rimraf=require(_0xc12d('0x7'));var config=require(_0xc12d('0x8'));var attributes=require(_0xc12d('0x9'));module[_0xc12d('0xa')]=function(_0x5e4095,_0x524df9){return _0x5e4095[_0xc12d('0xb')](_0xc12d('0xc'),attributes,{'tableName':_0xc12d('0xd'),'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 40782bb..503bdad 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 _0x5017=['moment','ioredis','rpc','jayson/promise','client','http','defaults','redis','localhost','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2bacf4,_0x4c6b0b){var _0x34187b=function(_0x44a06d){while(--_0x44a06d){_0x2bacf4['push'](_0x2bacf4['shift']());}};_0x34187b(++_0x4c6b0b);}(_0x5017,0x11c));var _0x7501=function(_0x1b715c,_0x5e4e02){_0x1b715c=_0x1b715c-0x0;var _0x28daa2=_0x5017[_0x1b715c];return _0x28daa2;};'use strict';var _=require(_0x7501('0x0'));var util=require(_0x7501('0x1'));var moment=require(_0x7501('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7501('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7501('0x4'));var config=require('../../config/environment');var jayson=require(_0x7501('0x5'));var client=jayson[_0x7501('0x6')][_0x7501('0x7')]({'port':0x232a});config['redis']=_[_0x7501('0x8')](config[_0x7501('0x9')],{'host':_0x7501('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7501('0xb'))[_0x7501('0xc')](socket);function respondWithRpcPromise(_0x5184b3,_0x41c59e,_0x4af257){return new BPromise(function(_0x566a37,_0x8b2222){return client[_0x7501('0xd')](_0x5184b3,_0x4af257)[_0x7501('0xe')](function(_0x3c1ffb){logger[_0x7501('0xf')](_0x7501('0x10'),_0x41c59e,_0x7501('0x11'));logger[_0x7501('0x12')](_0x7501('0x13'),_0x41c59e,_0x7501('0x11'),JSON[_0x7501('0x14')](_0x3c1ffb));if(_0x3c1ffb[_0x7501('0x15')]){if(_0x3c1ffb[_0x7501('0x15')][_0x7501('0x16')]===0x1f4){logger['error'](_0x7501('0x10'),_0x41c59e,_0x3c1ffb[_0x7501('0x15')]['message']);return _0x8b2222(_0x3c1ffb[_0x7501('0x15')][_0x7501('0x17')]);}logger[_0x7501('0x15')](_0x7501('0x10'),_0x41c59e,_0x3c1ffb[_0x7501('0x15')][_0x7501('0x17')]);return _0x566a37(_0x3c1ffb[_0x7501('0x15')]['message']);}else{logger[_0x7501('0xf')]('DashboardItem,\x20%s,\x20%s',_0x41c59e,'request\x20sent');_0x566a37(_0x3c1ffb[_0x7501('0x18')]['message']);}})[_0x7501('0x19')](function(_0x593cb6){logger['error']('DashboardItem,\x20%s,\x20%s',_0x41c59e,_0x593cb6);_0x8b2222(_0x593cb6);});});} \ No newline at end of file +var _0xe7db=['rpc','../../config/environment','client','http','redis','defaults','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x432245,_0xe78678){var _0x5e3c4e=function(_0x39d6be){while(--_0x39d6be){_0x432245['push'](_0x432245['shift']());}};_0x5e3c4e(++_0xe78678);}(_0xe7db,0x117));var _0xbe7d=function(_0xca04ff,_0xcb449f){_0xca04ff=_0xca04ff-0x0;var _0x6b547=_0xe7db[_0xca04ff];return _0x6b547;};'use strict';var _=require(_0xbe7d('0x0'));var util=require(_0xbe7d('0x1'));var moment=require(_0xbe7d('0x2'));var BPromise=require(_0xbe7d('0x3'));var rs=require(_0xbe7d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe7d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe7d('0x6'))(_0xbe7d('0x7'));var config=require(_0xbe7d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbe7d('0x9')][_0xbe7d('0xa')]({'port':0x232a});config[_0xbe7d('0xb')]=_[_0xbe7d('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe7d('0xb')]));require(_0xbe7d('0xd'))[_0xbe7d('0xe')](socket);function respondWithRpcPromise(_0x5c7401,_0x4df6b0,_0x413c68){return new BPromise(function(_0x7fd4d8,_0x4720aa){return client['request'](_0x5c7401,_0x413c68)[_0xbe7d('0xf')](function(_0x309e0d){logger[_0xbe7d('0x10')](_0xbe7d('0x11'),_0x4df6b0,_0xbe7d('0x12'));logger[_0xbe7d('0x13')](_0xbe7d('0x14'),_0x4df6b0,_0xbe7d('0x12'),JSON[_0xbe7d('0x15')](_0x309e0d));if(_0x309e0d[_0xbe7d('0x16')]){if(_0x309e0d[_0xbe7d('0x16')][_0xbe7d('0x17')]===0x1f4){logger['error'](_0xbe7d('0x11'),_0x4df6b0,_0x309e0d[_0xbe7d('0x16')][_0xbe7d('0x18')]);return _0x4720aa(_0x309e0d['error']['message']);}logger['error'](_0xbe7d('0x11'),_0x4df6b0,_0x309e0d[_0xbe7d('0x16')][_0xbe7d('0x18')]);return _0x7fd4d8(_0x309e0d[_0xbe7d('0x16')][_0xbe7d('0x18')]);}else{logger[_0xbe7d('0x10')]('DashboardItem,\x20%s,\x20%s',_0x4df6b0,_0xbe7d('0x12'));_0x7fd4d8(_0x309e0d[_0xbe7d('0x19')]['message']);}})['catch'](function(_0x55053a){logger['error'](_0xbe7d('0x11'),_0x4df6b0,_0x55053a);_0x4720aa(_0x55053a);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index c1849c0..883cc8d 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 _0xd69b=['./dashboardItem.events','remove','update','removeListener','register'];(function(_0x5bbbb3,_0xfa2dc3){var _0x520933=function(_0x58d43b){while(--_0x58d43b){_0x5bbbb3['push'](_0x5bbbb3['shift']());}};_0x520933(++_0xfa2dc3);}(_0xd69b,0x64));var _0xbd69=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xd69b[_0x1762b4];return _0x29beda;};'use strict';var DashboardItemEvents=require(_0xbd69('0x0'));var events=['save',_0xbd69('0x1'),_0xbd69('0x2')];function createListener(_0x18cc30,_0x218b93){return function(_0xb3b084){_0x218b93['emit'](_0x18cc30,_0xb3b084);};}function removeListener(_0x53416d,_0x447c11){return function(){DashboardItemEvents[_0xbd69('0x3')](_0x53416d,_0x447c11);};}exports[_0xbd69('0x4')]=function(_0x31f7e7){for(var _0x33bf78=0x0,_0x42540f=events['length'];_0x33bf78<_0x42540f;_0x33bf78++){var _0xa2f73d=events[_0x33bf78];var _0xfd2ac7=createListener('dashboardItem:'+_0xa2f73d,_0x31f7e7);DashboardItemEvents['on'](_0xa2f73d,_0xfd2ac7);}}; \ No newline at end of file +var _0x98b8=['register','dashboardItem:','save','remove','update','emit'];(function(_0x18e1bb,_0x1fe076){var _0x3c29dd=function(_0x82029a){while(--_0x82029a){_0x18e1bb['push'](_0x18e1bb['shift']());}};_0x3c29dd(++_0x1fe076);}(_0x98b8,0x11c));var _0x898b=function(_0x39f31f,_0x1989e3){_0x39f31f=_0x39f31f-0x0;var _0x28a1d3=_0x98b8[_0x39f31f];return _0x28a1d3;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x898b('0x0'),_0x898b('0x1'),_0x898b('0x2')];function createListener(_0x18cd1a,_0x578e7d){return function(_0x5df98a){_0x578e7d[_0x898b('0x3')](_0x18cd1a,_0x5df98a);};}function removeListener(_0xb3f2b7,_0x3163b7){return function(){DashboardItemEvents['removeListener'](_0xb3f2b7,_0x3163b7);};}exports[_0x898b('0x4')]=function(_0xa464ff){for(var _0x42ffb1=0x0,_0x3f86ec=events['length'];_0x42ffb1<_0x3f86ec;_0x42ffb1++){var _0x260fc4=events[_0x42ffb1];var _0x2ce7aa=createListener(_0x898b('0x5')+_0x260fc4,_0xa464ff);DashboardItemEvents['on'](_0x260fc4,_0x2ce7aa);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 714d459..f1518a8 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 _0xf494=['put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post'];(function(_0x38c121,_0x29c927){var _0x21c1f5=function(_0x125cc3){while(--_0x125cc3){_0x38c121['push'](_0x38c121['shift']());}};_0x21c1f5(++_0x29c927);}(_0xf494,0x1c6));var _0x4f49=function(_0x1fc7d0,_0x235642){_0x1fc7d0=_0x1fc7d0-0x0;var _0x467002=_0xf494[_0x1fc7d0];return _0x467002;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var auth=require(_0x4f49('0x5'));var interaction=require(_0x4f49('0x6'));var config=require(_0x4f49('0x7'));var controller=require(_0x4f49('0x8'));router[_0x4f49('0x9')](_0x4f49('0xa'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f49('0xe')](_0x4f49('0xa'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')](_0x4f49('0xa'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x11')]);module['exports']=router; \ No newline at end of file +var _0x814b=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','post','put'];(function(_0x2ae416,_0x57477a){var _0x113c74=function(_0x491795){while(--_0x491795){_0x2ae416['push'](_0x2ae416['shift']());}};_0x113c74(++_0x57477a);}(_0x814b,0x1a2));var _0xb814=function(_0x442f5b,_0x39d79d){_0x442f5b=_0x442f5b-0x0;var _0x19fd96=_0x814b[_0x442f5b];return _0x19fd96;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')](_0xb814('0xa'),auth[_0xb814('0xb')](),controller['show']);router[_0xb814('0xc')]('/',auth[_0xb814('0xb')](),controller['create']);router[_0xb814('0xd')](_0xb814('0xa'),auth[_0xb814('0xb')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')](_0xb814('0xa'),auth[_0xb814('0xb')](),controller[_0xb814('0x10')]);module[_0xb814('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index d975f97..3d8be31 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 _0x7627=['STRING','sequelize','exports'];(function(_0x258bba,_0x57b1f7){var _0x1bbc41=function(_0x1671dd){while(--_0x1671dd){_0x258bba['push'](_0x258bba['shift']());}};_0x1bbc41(++_0x57b1f7);}(_0x7627,0x15d));var _0x7762=function(_0x34d5a5,_0x403b4b){_0x34d5a5=_0x34d5a5-0x0;var _0x2d9523=_0x7627[_0x34d5a5];return _0x2d9523;};'use strict';var Sequelize=require(_0x7762('0x0'));module[_0x7762('0x1')]={'name':{'type':Sequelize[_0x7762('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x0b99=['exports'];(function(_0x580197,_0xbb7e10){var _0x54a754=function(_0x271e2b){while(--_0x271e2b){_0x580197['push'](_0x580197['shift']());}};_0x54a754(++_0xbb7e10);}(_0x0b99,0x17b));var _0x90b9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0b99[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x90b9('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 2c49c1e..0c45d94 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 _0x0ba7=['then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','filter','merge','VIRTUAL','options','include','Disposition','findAll','catch','show','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','reject','save','update'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0x0ba7,0x16d));var _0x70ba=function(_0xcb1f41,_0x1b0780){_0xcb1f41=_0xcb1f41-0x0;var _0x1ee017=_0x0ba7[_0xcb1f41];return _0x1ee017;};'use strict';var pdf=require(_0x70ba('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x70ba('0x1'));var zipdir=require(_0x70ba('0x2'));var jsonpatch=require(_0x70ba('0x3'));var rp=require(_0x70ba('0x4'));var moment=require('moment');var BPromise=require(_0x70ba('0x5'));var Mustache=require(_0x70ba('0x6'));var util=require(_0x70ba('0x7'));var path=require(_0x70ba('0x8'));var sox=require(_0x70ba('0x9'));var csv=require(_0x70ba('0xa'));var ejs=require(_0x70ba('0xb'));var fs=require('fs');var _=require(_0x70ba('0xc'));var squel=require(_0x70ba('0xd'));var crypto=require(_0x70ba('0xe'));var jsforce=require(_0x70ba('0xf'));var deskjs=require(_0x70ba('0x10'));var toCsv=require(_0x70ba('0xa'));var querystring=require(_0x70ba('0x11'));var Papa=require(_0x70ba('0x12'));var Redis=require('ioredis');var authService=require(_0x70ba('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x70ba('0x14'));var hardwareService=require(_0x70ba('0x15'));var logger=require(_0x70ba('0x16'))(_0x70ba('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x70ba('0x18'))['db'];function respondWithStatusCode(_0x4a2c2e,_0xd6580e){_0xd6580e=_0xd6580e||0xcc;return function(_0x5e94c7){if(_0x5e94c7){return _0x4a2c2e[_0x70ba('0x19')](_0xd6580e);}return _0x4a2c2e[_0x70ba('0x1a')](_0xd6580e)['end']();};}function respondWithResult(_0x1d674b,_0x57d84e){_0x57d84e=_0x57d84e||0xc8;return function(_0x51321d){if(_0x51321d){return _0x1d674b[_0x70ba('0x1a')](_0x57d84e)[_0x70ba('0x1b')](_0x51321d);}};}function respondWithFilteredResult(_0x10613f,_0x2516fd){return function(_0x29734b){if(_0x29734b){var _0x232138=_0x29734b[_0x70ba('0x1c')],_0x164521=_0x2516fd[_0x70ba('0x1d')],_0x18334a=_0x2516fd[_0x70ba('0x1d')]+_0x2516fd[_0x70ba('0x1e')],_0x3e27e8;if(_0x18334a>=_0x232138){_0x18334a=_0x232138;_0x3e27e8=0xc8;}else{_0x3e27e8=0xce;}_0x10613f['status'](_0x3e27e8);return _0x10613f['set']('Content-Range',_0x164521+'-'+_0x18334a+'/'+_0x232138)[_0x70ba('0x1b')](_0x29734b);}return null;};}function patchUpdates(_0x2dd33a){return function(_0x20c2aa){try{jsonpatch[_0x70ba('0x1f')](_0x20c2aa,_0x2dd33a,!![]);}catch(_0x43caa4){return BPromise[_0x70ba('0x20')](_0x43caa4);}return _0x20c2aa[_0x70ba('0x21')]();};}function saveUpdates(_0x2763f3,_0x415879){return function(_0x40b82c){if(_0x40b82c){return _0x40b82c[_0x70ba('0x22')](_0x2763f3)[_0x70ba('0x23')](function(_0x2a1328){return _0x2a1328;});}return null;};}function removeEntity(_0x4570b0,_0x273ce4){return function(_0x5ebe9d){if(_0x5ebe9d){return _0x5ebe9d[_0x70ba('0x24')]()[_0x70ba('0x23')](function(){var _0x52accf=_0x5ebe9d[_0x70ba('0x25')]({'plain':!![]});var _0x5519d4='Dispositions';return db[_0x70ba('0x26')]['destroy']({'where':{'type':_0x5519d4,'resourceId':_0x52accf['id']}})[_0x70ba('0x23')](function(){return _0x5ebe9d;});})[_0x70ba('0x23')](function(){_0x4570b0['status'](0xcc)[_0x70ba('0x27')]();});}};}function handleEntityNotFound(_0x4ef847,_0x5ad828){return function(_0x39482c){if(!_0x39482c){_0x4ef847['sendStatus'](0x194);}return _0x39482c;};}function handleError(_0x230d11,_0x441fed){_0x441fed=_0x441fed||0x1f4;return function(_0x44f1c0){logger[_0x70ba('0x28')](_0x44f1c0[_0x70ba('0x29')]);if(_0x44f1c0[_0x70ba('0x2a')]){delete _0x44f1c0['name'];}_0x230d11[_0x70ba('0x1a')](_0x441fed)[_0x70ba('0x2b')](_0x44f1c0);};}exports[_0x70ba('0x2c')]=function(_0x5179c6,_0x445fe5){var _0x51b5cb={},_0x5955dc={},_0x505f98={'count':0x0,'rows':[]};var _0x77e564=_[_0x70ba('0x2d')](db['Disposition']['rawAttributes'],function(_0x16dc2f){return{'name':_0x16dc2f['fieldName'],'type':_0x16dc2f[_0x70ba('0x2e')][_0x70ba('0x2f')]};});_0x5955dc[_0x70ba('0x30')]=_[_0x70ba('0x2d')](_0x77e564,_0x70ba('0x2a'));_0x5955dc[_0x70ba('0x31')]=_[_0x70ba('0x32')](_0x5179c6[_0x70ba('0x31')]);_0x5955dc[_0x70ba('0x33')]=_[_0x70ba('0x34')](_0x5955dc[_0x70ba('0x30')],_0x5955dc['query']);_0x51b5cb['attributes']=_[_0x70ba('0x34')](_0x5955dc[_0x70ba('0x30')],qs[_0x70ba('0x35')](_0x5179c6['query']['fields']));_0x51b5cb['attributes']=_0x51b5cb[_0x70ba('0x36')][_0x70ba('0x37')]?_0x51b5cb[_0x70ba('0x36')]:_0x5955dc['model'];if(!_0x5179c6[_0x70ba('0x31')]['hasOwnProperty']('nolimit')){_0x51b5cb[_0x70ba('0x1e')]=qs['limit'](_0x5179c6[_0x70ba('0x31')][_0x70ba('0x1e')]);_0x51b5cb['offset']=qs[_0x70ba('0x1d')](_0x5179c6[_0x70ba('0x31')][_0x70ba('0x1d')]);}_0x51b5cb['order']=qs[_0x70ba('0x38')](_0x5179c6[_0x70ba('0x31')][_0x70ba('0x38')]);_0x51b5cb[_0x70ba('0x39')]=qs['filters'](_[_0x70ba('0x3a')](_0x5179c6['query'],_0x5955dc[_0x70ba('0x33')]));if(_0x5179c6[_0x70ba('0x31')][_0x70ba('0x3b')]){_0x51b5cb[_0x70ba('0x39')]=_[_0x70ba('0x3c')](_0x51b5cb[_0x70ba('0x39')],{'$or':_[_0x70ba('0x2d')](_0x77e564,function(_0x5937b7){if(_0x5937b7[_0x70ba('0x2e')]!==_0x70ba('0x3d')){var _0x31e713={};_0x31e713[_0x5937b7[_0x70ba('0x2a')]]={'$like':'%'+_0x5179c6[_0x70ba('0x31')][_0x70ba('0x3b')]+'%'};return _0x31e713;}})});}_0x51b5cb=_['merge']({},_0x51b5cb,_0x5179c6[_0x70ba('0x3e')]);var _0x175152={'where':_0x51b5cb[_0x70ba('0x39')]};return db['Disposition']['count'](_0x175152)['then'](function(_0x215ccc){_0x505f98[_0x70ba('0x1c')]=_0x215ccc;if(_0x5179c6[_0x70ba('0x31')]['includeAll']){_0x51b5cb[_0x70ba('0x3f')]=[{'all':!![]}];}return db[_0x70ba('0x40')][_0x70ba('0x41')](_0x51b5cb);})[_0x70ba('0x23')](function(_0x112703){_0x505f98['rows']=_0x112703;return _0x505f98;})['then'](respondWithFilteredResult(_0x445fe5,_0x51b5cb))[_0x70ba('0x42')](handleError(_0x445fe5,null));};exports[_0x70ba('0x43')]=function(_0x3bdd66,_0x5a1edb){var _0x595645={'raw':!![],'where':{'id':_0x3bdd66['params']['id']}},_0x2fc262={};_0x2fc262[_0x70ba('0x30')]=_[_0x70ba('0x32')](db[_0x70ba('0x40')][_0x70ba('0x44')]);_0x2fc262[_0x70ba('0x31')]=_['keys'](_0x3bdd66[_0x70ba('0x31')]);_0x2fc262[_0x70ba('0x33')]=_[_0x70ba('0x34')](_0x2fc262[_0x70ba('0x30')],_0x2fc262[_0x70ba('0x31')]);_0x595645[_0x70ba('0x36')]=_[_0x70ba('0x34')](_0x2fc262[_0x70ba('0x30')],qs[_0x70ba('0x35')](_0x3bdd66[_0x70ba('0x31')][_0x70ba('0x35')]));_0x595645[_0x70ba('0x36')]=_0x595645[_0x70ba('0x36')][_0x70ba('0x37')]?_0x595645[_0x70ba('0x36')]:_0x2fc262['model'];if(_0x3bdd66[_0x70ba('0x31')][_0x70ba('0x45')]){_0x595645['include']=[{'all':!![]}];}_0x595645=_[_0x70ba('0x3c')]({},_0x595645,_0x3bdd66[_0x70ba('0x3e')]);return db[_0x70ba('0x40')][_0x70ba('0x46')](_0x595645)[_0x70ba('0x23')](handleEntityNotFound(_0x5a1edb,null))[_0x70ba('0x23')](respondWithResult(_0x5a1edb,null))[_0x70ba('0x42')](handleError(_0x5a1edb,null));};exports['create']=function(_0x2e2613,_0x21f462){return db[_0x70ba('0x40')][_0x70ba('0x47')](_0x2e2613[_0x70ba('0x48')],{})[_0x70ba('0x23')](function(_0x35bb91){var _0x400c37=_0x2e2613[_0x70ba('0x49')][_0x70ba('0x25')]({'plain':!![]});if(!_0x400c37)throw new Error(_0x70ba('0x4a'));if(_0x400c37[_0x70ba('0x4b')]===_0x70ba('0x49')){var _0x16af4d=_0x35bb91[_0x70ba('0x25')]({'plain':!![]});var _0x2536cd=_0x70ba('0x4c');return db['UserProfileSection'][_0x70ba('0x46')]({'where':{'name':_0x2536cd,'userProfileId':_0x400c37[_0x70ba('0x4d')]},'raw':!![]})[_0x70ba('0x23')](function(_0x19c99c){if(_0x19c99c&&_0x19c99c['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x16af4d[_0x70ba('0x2a')],'resourceId':_0x16af4d['id'],'type':_0x19c99c[_0x70ba('0x2a')],'sectionId':_0x19c99c['id']},{})['then'](function(){return _0x35bb91;});}else{return _0x35bb91;}})['catch'](function(_0x6a3dc6){logger[_0x70ba('0x28')](_0x70ba('0x4e'),_0x6a3dc6);throw _0x6a3dc6;});}return _0x35bb91;})[_0x70ba('0x23')](respondWithResult(_0x21f462,0xc9))[_0x70ba('0x42')](handleError(_0x21f462,null));};exports[_0x70ba('0x22')]=function(_0x3b05c6,_0x5bb322){if(_0x3b05c6['body']['id']){delete _0x3b05c6[_0x70ba('0x48')]['id'];}return db[_0x70ba('0x40')][_0x70ba('0x46')]({'where':{'id':_0x3b05c6[_0x70ba('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5bb322,null))[_0x70ba('0x23')](saveUpdates(_0x3b05c6[_0x70ba('0x48')],null))['then'](respondWithResult(_0x5bb322,null))['catch'](handleError(_0x5bb322,null));};exports['destroy']=function(_0x4acb51,_0x2195d9){return db[_0x70ba('0x40')][_0x70ba('0x46')]({'where':{'id':_0x4acb51['params']['id']}})[_0x70ba('0x23')](handleEntityNotFound(_0x2195d9,null))[_0x70ba('0x23')](removeEntity(_0x2195d9,null))[_0x70ba('0x42')](handleError(_0x2195d9,null));}; \ No newline at end of file +var _0x9a19=['pick','filter','where','merge','VIRTUAL','options','includeAll','include','Disposition','rows','catch','show','keys','find','create','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','Dispositions','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filters'];(function(_0x5044a8,_0x379fef){var _0x498720=function(_0x471d3f){while(--_0x471d3f){_0x5044a8['push'](_0x5044a8['shift']());}};_0x498720(++_0x379fef);}(_0x9a19,0x114));var _0x99a1=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x9a19[_0x58db4e];return _0x40139a;};'use strict';var pdf=require(_0x99a1('0x0'));var emlformat=require(_0x99a1('0x1'));var rimraf=require(_0x99a1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99a1('0x3'));var rp=require(_0x99a1('0x4'));var moment=require(_0x99a1('0x5'));var BPromise=require(_0x99a1('0x6'));var Mustache=require(_0x99a1('0x7'));var util=require(_0x99a1('0x8'));var path=require(_0x99a1('0x9'));var sox=require(_0x99a1('0xa'));var csv=require(_0x99a1('0xb'));var ejs=require(_0x99a1('0xc'));var fs=require('fs');var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var db=require(_0x99a1('0x17'))['db'];function respondWithStatusCode(_0x2c68dd,_0x1bc7aa){_0x1bc7aa=_0x1bc7aa||0xcc;return function(_0x2ff655){if(_0x2ff655){return _0x2c68dd[_0x99a1('0x18')](_0x1bc7aa);}return _0x2c68dd[_0x99a1('0x19')](_0x1bc7aa)[_0x99a1('0x1a')]();};}function respondWithResult(_0x3a865c,_0x47815e){_0x47815e=_0x47815e||0xc8;return function(_0xe1a1f){if(_0xe1a1f){return _0x3a865c[_0x99a1('0x19')](_0x47815e)[_0x99a1('0x1b')](_0xe1a1f);}};}function respondWithFilteredResult(_0x4d73de,_0x2d81ed){return function(_0x3e45d4){if(_0x3e45d4){var _0x1bb464=_0x3e45d4[_0x99a1('0x1c')],_0x3d40cc=_0x2d81ed['offset'],_0x384f05=_0x2d81ed['offset']+_0x2d81ed[_0x99a1('0x1d')],_0x33e2c1;if(_0x384f05>=_0x1bb464){_0x384f05=_0x1bb464;_0x33e2c1=0xc8;}else{_0x33e2c1=0xce;}_0x4d73de[_0x99a1('0x19')](_0x33e2c1);return _0x4d73de[_0x99a1('0x1e')](_0x99a1('0x1f'),_0x3d40cc+'-'+_0x384f05+'/'+_0x1bb464)[_0x99a1('0x1b')](_0x3e45d4);}return null;};}function patchUpdates(_0x209021){return function(_0x228442){try{jsonpatch[_0x99a1('0x20')](_0x228442,_0x209021,!![]);}catch(_0x13389d){return BPromise[_0x99a1('0x21')](_0x13389d);}return _0x228442[_0x99a1('0x22')]();};}function saveUpdates(_0x5eabcb,_0x3023a1){return function(_0x20007e){if(_0x20007e){return _0x20007e['update'](_0x5eabcb)[_0x99a1('0x23')](function(_0x53093d){return _0x53093d;});}return null;};}function removeEntity(_0x458ed3,_0x2927b0){return function(_0x2d6f20){if(_0x2d6f20){return _0x2d6f20[_0x99a1('0x24')]()['then'](function(){var _0x3eab51=_0x2d6f20[_0x99a1('0x25')]({'plain':!![]});var _0x483c17=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x483c17,'resourceId':_0x3eab51['id']}})[_0x99a1('0x23')](function(){return _0x2d6f20;});})[_0x99a1('0x23')](function(){_0x458ed3[_0x99a1('0x19')](0xcc)[_0x99a1('0x1a')]();});}};}function handleEntityNotFound(_0x491341,_0x4fe7f7){return function(_0x114b38){if(!_0x114b38){_0x491341['sendStatus'](0x194);}return _0x114b38;};}function handleError(_0x5dc733,_0xafea84){_0xafea84=_0xafea84||0x1f4;return function(_0x440879){logger[_0x99a1('0x27')](_0x440879[_0x99a1('0x28')]);if(_0x440879[_0x99a1('0x29')]){delete _0x440879[_0x99a1('0x29')];}_0x5dc733[_0x99a1('0x19')](_0xafea84)['send'](_0x440879);};}exports[_0x99a1('0x2a')]=function(_0x499eef,_0x255197){var _0x1137f2={},_0x26fbae={},_0x523668={'count':0x0,'rows':[]};var _0x371edf=_[_0x99a1('0x2b')](db['Disposition'][_0x99a1('0x2c')],function(_0x1434a0){return{'name':_0x1434a0[_0x99a1('0x2d')],'type':_0x1434a0[_0x99a1('0x2e')][_0x99a1('0x2f')]};});_0x26fbae[_0x99a1('0x30')]=_[_0x99a1('0x2b')](_0x371edf,_0x99a1('0x29'));_0x26fbae['query']=_['keys'](_0x499eef[_0x99a1('0x31')]);_0x26fbae['filters']=_[_0x99a1('0x32')](_0x26fbae[_0x99a1('0x30')],_0x26fbae['query']);_0x1137f2[_0x99a1('0x33')]=_[_0x99a1('0x32')](_0x26fbae[_0x99a1('0x30')],qs[_0x99a1('0x34')](_0x499eef[_0x99a1('0x31')][_0x99a1('0x34')]));_0x1137f2[_0x99a1('0x33')]=_0x1137f2[_0x99a1('0x33')][_0x99a1('0x35')]?_0x1137f2[_0x99a1('0x33')]:_0x26fbae[_0x99a1('0x30')];if(!_0x499eef[_0x99a1('0x31')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1137f2['limit']=qs['limit'](_0x499eef[_0x99a1('0x31')][_0x99a1('0x1d')]);_0x1137f2[_0x99a1('0x38')]=qs[_0x99a1('0x38')](_0x499eef[_0x99a1('0x31')][_0x99a1('0x38')]);}_0x1137f2[_0x99a1('0x39')]=qs['sort'](_0x499eef[_0x99a1('0x31')][_0x99a1('0x3a')]);_0x1137f2['where']=qs[_0x99a1('0x3b')](_[_0x99a1('0x3c')](_0x499eef[_0x99a1('0x31')],_0x26fbae[_0x99a1('0x3b')]));if(_0x499eef[_0x99a1('0x31')][_0x99a1('0x3d')]){_0x1137f2[_0x99a1('0x3e')]=_[_0x99a1('0x3f')](_0x1137f2[_0x99a1('0x3e')],{'$or':_[_0x99a1('0x2b')](_0x371edf,function(_0x1da3e7){if(_0x1da3e7[_0x99a1('0x2e')]!==_0x99a1('0x40')){var _0x5018e9={};_0x5018e9[_0x1da3e7['name']]={'$like':'%'+_0x499eef['query'][_0x99a1('0x3d')]+'%'};return _0x5018e9;}})});}_0x1137f2=_[_0x99a1('0x3f')]({},_0x1137f2,_0x499eef[_0x99a1('0x41')]);var _0x279662={'where':_0x1137f2[_0x99a1('0x3e')]};return db['Disposition'][_0x99a1('0x1c')](_0x279662)[_0x99a1('0x23')](function(_0x32ee4c){_0x523668['count']=_0x32ee4c;if(_0x499eef['query'][_0x99a1('0x42')]){_0x1137f2[_0x99a1('0x43')]=[{'all':!![]}];}return db[_0x99a1('0x44')]['findAll'](_0x1137f2);})[_0x99a1('0x23')](function(_0xa028d){_0x523668[_0x99a1('0x45')]=_0xa028d;return _0x523668;})[_0x99a1('0x23')](respondWithFilteredResult(_0x255197,_0x1137f2))[_0x99a1('0x46')](handleError(_0x255197,null));};exports[_0x99a1('0x47')]=function(_0x8b49a6,_0x29d0a0){var _0x1c4ce4={'raw':!![],'where':{'id':_0x8b49a6['params']['id']}},_0x2be9e3={};_0x2be9e3[_0x99a1('0x30')]=_[_0x99a1('0x48')](db[_0x99a1('0x44')]['rawAttributes']);_0x2be9e3[_0x99a1('0x31')]=_['keys'](_0x8b49a6[_0x99a1('0x31')]);_0x2be9e3[_0x99a1('0x3b')]=_[_0x99a1('0x32')](_0x2be9e3[_0x99a1('0x30')],_0x2be9e3[_0x99a1('0x31')]);_0x1c4ce4[_0x99a1('0x33')]=_['intersection'](_0x2be9e3[_0x99a1('0x30')],qs['fields'](_0x8b49a6[_0x99a1('0x31')][_0x99a1('0x34')]));_0x1c4ce4[_0x99a1('0x33')]=_0x1c4ce4[_0x99a1('0x33')][_0x99a1('0x35')]?_0x1c4ce4[_0x99a1('0x33')]:_0x2be9e3[_0x99a1('0x30')];if(_0x8b49a6[_0x99a1('0x31')][_0x99a1('0x42')]){_0x1c4ce4[_0x99a1('0x43')]=[{'all':!![]}];}_0x1c4ce4=_[_0x99a1('0x3f')]({},_0x1c4ce4,_0x8b49a6['options']);return db[_0x99a1('0x44')][_0x99a1('0x49')](_0x1c4ce4)['then'](handleEntityNotFound(_0x29d0a0,null))[_0x99a1('0x23')](respondWithResult(_0x29d0a0,null))[_0x99a1('0x46')](handleError(_0x29d0a0,null));};exports[_0x99a1('0x4a')]=function(_0x2e377b,_0x113dd9){return db[_0x99a1('0x44')][_0x99a1('0x4a')](_0x2e377b['body'],{})[_0x99a1('0x23')](function(_0x573bcb){var _0x1d4d3f=_0x2e377b[_0x99a1('0x4b')]['get']({'plain':!![]});if(!_0x1d4d3f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d4d3f[_0x99a1('0x4c')]===_0x99a1('0x4b')){var _0x462c15=_0x573bcb[_0x99a1('0x25')]({'plain':!![]});var _0xee2b1b='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0xee2b1b,'userProfileId':_0x1d4d3f[_0x99a1('0x4d')]},'raw':!![]})[_0x99a1('0x23')](function(_0x463e49){if(_0x463e49&&_0x463e49[_0x99a1('0x4e')]===0x0){return db[_0x99a1('0x4f')][_0x99a1('0x4a')]({'name':_0x462c15[_0x99a1('0x29')],'resourceId':_0x462c15['id'],'type':_0x463e49['name'],'sectionId':_0x463e49['id']},{})[_0x99a1('0x23')](function(){return _0x573bcb;});}else{return _0x573bcb;}})[_0x99a1('0x46')](function(_0x451824){logger['error'](_0x99a1('0x50'),_0x451824);throw _0x451824;});}return _0x573bcb;})['then'](respondWithResult(_0x113dd9,0xc9))['catch'](handleError(_0x113dd9,null));};exports[_0x99a1('0x51')]=function(_0x1af90b,_0x1dd17b){if(_0x1af90b[_0x99a1('0x52')]['id']){delete _0x1af90b[_0x99a1('0x52')]['id'];}return db[_0x99a1('0x44')][_0x99a1('0x49')]({'where':{'id':_0x1af90b[_0x99a1('0x53')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1dd17b,null))['then'](saveUpdates(_0x1af90b[_0x99a1('0x52')],null))['then'](respondWithResult(_0x1dd17b,null))[_0x99a1('0x46')](handleError(_0x1dd17b,null));};exports[_0x99a1('0x24')]=function(_0x5dc042,_0x2cc320){return db[_0x99a1('0x44')][_0x99a1('0x49')]({'where':{'id':_0x5dc042[_0x99a1('0x53')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x2cc320,null))[_0x99a1('0x23')](removeEntity(_0x2cc320,null))[_0x99a1('0x46')](handleError(_0x2cc320,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 1e025f7..40558d8 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 _0x9ba1=['tools_dispositions','name_voice','name','ListId','name_chat','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','OpenchannelAccountId','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition'];(function(_0x46508d,_0x583cb3){var _0x11569c=function(_0x163418){while(--_0x163418){_0x46508d['push'](_0x46508d['shift']());}};_0x11569c(++_0x583cb3);}(_0x9ba1,0x108));var _0x19ba=function(_0x1f8083,_0x32e3ea){_0x1f8083=_0x1f8083-0x0;var _0x4dec98=_0x9ba1[_0x1f8083];return _0x4dec98;};'use strict';var _=require(_0x19ba('0x0'));var util=require(_0x19ba('0x1'));var logger=require(_0x19ba('0x2'))(_0x19ba('0x3'));var moment=require(_0x19ba('0x4'));var BPromise=require('bluebird');var rp=require(_0x19ba('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x19ba('0x6'));var config=require(_0x19ba('0x7'));var attributes=require(_0x19ba('0x8'));module[_0x19ba('0x9')]=function(_0x2eacd8,_0x3623fd){return _0x2eacd8[_0x19ba('0xa')](_0x19ba('0xb'),attributes,{'tableName':_0x19ba('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x19ba('0xd'),'fields':[_0x19ba('0xe'),_0x19ba('0xf')]},{'unique':!![],'name':_0x19ba('0x10'),'fields':[_0x19ba('0xe'),'ChatWebsiteId']},{'unique':!![],'name':_0x19ba('0x11'),'fields':[_0x19ba('0xe'),_0x19ba('0x12')]},{'unique':!![],'name':_0x19ba('0x13'),'fields':[_0x19ba('0xe'),_0x19ba('0x14')]},{'unique':!![],'name':_0x19ba('0x15'),'fields':[_0x19ba('0xe'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0x19ba('0xe'),_0x19ba('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x991f=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./disposition.attributes','exports','name_voice','name','ListId','name_chat','name_mail','name_sms','name_openchannel','OpenchannelAccountId','lodash'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x991f,0x143));var _0xf991=function(_0x37516c,_0x3e50e8){_0x37516c=_0x37516c-0x0;var _0x985de3=_0x991f[_0x37516c];return _0x985de3;};'use strict';var _=require(_0xf991('0x0'));var util=require(_0xf991('0x1'));var logger=require(_0xf991('0x2'))(_0xf991('0x3'));var moment=require('moment');var BPromise=require(_0xf991('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf991('0x5'));var rimraf=require(_0xf991('0x6'));var config=require(_0xf991('0x7'));var attributes=require(_0xf991('0x8'));module[_0xf991('0x9')]=function(_0x1eaced,_0x5336f6){return _0x1eaced['define']('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xf991('0xa'),'fields':[_0xf991('0xb'),_0xf991('0xc')]},{'unique':!![],'name':_0xf991('0xd'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0xf991('0xe'),'fields':['name','MailAccountId']},{'unique':!![],'name':_0xf991('0xf'),'fields':[_0xf991('0xb'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':['name','FaxAccountId']},{'unique':!![],'name':_0xf991('0x10'),'fields':[_0xf991('0xb'),_0xf991('0x11')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 8cb799b..f2ab6e4 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 _0xcbb1=['message','result','catch','lodash','util','moment','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','Disposition,\x20%s,\x20%s'];(function(_0x4b793b,_0x1ee112){var _0xcfbd6a=function(_0x2eb91c){while(--_0x2eb91c){_0x4b793b['push'](_0x4b793b['shift']());}};_0xcfbd6a(++_0x1ee112);}(_0xcbb1,0x1a7));var _0x1cbb=function(_0x361634,_0x2693da){_0x361634=_0x361634-0x0;var _0x43c535=_0xcbb1[_0x361634];return _0x43c535;};'use strict';var _=require(_0x1cbb('0x0'));var util=require(_0x1cbb('0x1'));var moment=require(_0x1cbb('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('../../config/utils');var logger=require(_0x1cbb('0x3'))(_0x1cbb('0x4'));var config=require('../../config/environment');var jayson=require(_0x1cbb('0x5'));var client=jayson['client'][_0x1cbb('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x266629,_0x30a13b,_0x2a8672){return new BPromise(function(_0x33ace7,_0x2668ce){return client[_0x1cbb('0x7')](_0x266629,_0x2a8672)[_0x1cbb('0x8')](function(_0x36894b){logger[_0x1cbb('0x9')]('Disposition,\x20%s,\x20%s',_0x30a13b,_0x1cbb('0xa'));logger[_0x1cbb('0xb')](_0x1cbb('0xc'),_0x30a13b,_0x1cbb('0xa'),JSON[_0x1cbb('0xd')](_0x36894b));if(_0x36894b[_0x1cbb('0xe')]){if(_0x36894b[_0x1cbb('0xe')][_0x1cbb('0xf')]===0x1f4){logger[_0x1cbb('0xe')](_0x1cbb('0x10'),_0x30a13b,_0x36894b['error'][_0x1cbb('0x11')]);return _0x2668ce(_0x36894b[_0x1cbb('0xe')][_0x1cbb('0x11')]);}logger['error'](_0x1cbb('0x10'),_0x30a13b,_0x36894b[_0x1cbb('0xe')][_0x1cbb('0x11')]);return _0x33ace7(_0x36894b[_0x1cbb('0xe')]['message']);}else{logger[_0x1cbb('0x9')](_0x1cbb('0x10'),_0x30a13b,_0x1cbb('0xa'));_0x33ace7(_0x36894b[_0x1cbb('0x12')][_0x1cbb('0x11')]);}})[_0x1cbb('0x13')](function(_0x5e8d01){logger[_0x1cbb('0xe')](_0x1cbb('0x10'),_0x30a13b,_0x5e8d01);_0x2668ce(_0x5e8d01);});});} \ No newline at end of file +var _0x44bc=['Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','Disposition,\x20%s,\x20%s','message','info','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','debug'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x44bc,0x76));var _0xc44b=function(_0x314809,_0x39f58a){_0x314809=_0x314809-0x0;var _0x5d8f8b=_0x44bc[_0x314809];return _0x5d8f8b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc44b('0x0'));var BPromise=require(_0xc44b('0x1'));var rs=require(_0xc44b('0x2'));var fs=require('fs');var Redis=require(_0xc44b('0x3'));var db=require(_0xc44b('0x4'))['db'];var utils=require(_0xc44b('0x5'));var logger=require(_0xc44b('0x6'))(_0xc44b('0x7'));var config=require(_0xc44b('0x8'));var jayson=require(_0xc44b('0x9'));var client=jayson[_0xc44b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x666fdb,_0x2ace4e,_0x4484c0){return new BPromise(function(_0x3a60cc,_0x26e1a0){return client[_0xc44b('0xb')](_0x666fdb,_0x4484c0)['then'](function(_0x318d41){logger['info']('Disposition,\x20%s,\x20%s',_0x2ace4e,_0xc44b('0xc'));logger[_0xc44b('0xd')](_0xc44b('0xe'),_0x2ace4e,'request\x20sent',JSON[_0xc44b('0xf')](_0x318d41));if(_0x318d41[_0xc44b('0x10')]){if(_0x318d41[_0xc44b('0x10')][_0xc44b('0x11')]===0x1f4){logger[_0xc44b('0x10')](_0xc44b('0x12'),_0x2ace4e,_0x318d41[_0xc44b('0x10')][_0xc44b('0x13')]);return _0x26e1a0(_0x318d41['error'][_0xc44b('0x13')]);}logger['error'](_0xc44b('0x12'),_0x2ace4e,_0x318d41[_0xc44b('0x10')][_0xc44b('0x13')]);return _0x3a60cc(_0x318d41[_0xc44b('0x10')][_0xc44b('0x13')]);}else{logger[_0xc44b('0x14')](_0xc44b('0x12'),_0x2ace4e,_0xc44b('0xc'));_0x3a60cc(_0x318d41[_0xc44b('0x15')][_0xc44b('0x13')]);}})['catch'](function(_0x42ddfc){logger[_0xc44b('0x10')](_0xc44b('0x12'),_0x2ace4e,_0x42ddfc);_0x26e1a0(_0x42ddfc);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index d517ae4..3e3a1c3 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 _0x3ef7=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports'];(function(_0x3bc268,_0x8db620){var _0x3e4bda=function(_0x5ae613){while(--_0x5ae613){_0x3bc268['push'](_0x3bc268['shift']());}};_0x3e4bda(++_0x8db620);}(_0x3ef7,0xa2));var _0x73ef=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3ef7[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x73ef('0x0'));var util=require('util');var path=require(_0x73ef('0x1'));var timeout=require(_0x73ef('0x2'));var express=require(_0x73ef('0x3'));var router=express[_0x73ef('0x4')]();var auth=require(_0x73ef('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x73ef('0x6'));var controller=require(_0x73ef('0x7'));router[_0x73ef('0x8')]('/',auth[_0x73ef('0x9')](),controller['index']);router[_0x73ef('0x8')](_0x73ef('0xa'),auth[_0x73ef('0x9')](),controller[_0x73ef('0xb')]);router[_0x73ef('0xc')]('/',auth['isAuthenticated'](),controller[_0x73ef('0xd')]);router[_0x73ef('0xe')]('/:id',auth[_0x73ef('0x9')](),controller[_0x73ef('0xf')]);router[_0x73ef('0x10')](_0x73ef('0xa'),auth[_0x73ef('0x9')](),controller['destroy']);module[_0x73ef('0x11')]=router; \ No newline at end of file +var _0xb44a=['update','exports','path','express','../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x49c6ff,_0x1d4afe){var _0x42be3c=function(_0x5cf974){while(--_0x5cf974){_0x49c6ff['push'](_0x49c6ff['shift']());}};_0x42be3c(++_0x1d4afe);}(_0xb44a,0x1c2));var _0xab44=function(_0x644560,_0x1783aa){_0x644560=_0x644560-0x0;var _0x41b76b=_0xb44a[_0x644560];return _0x41b76b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xab44('0x0'));var timeout=require('connect-timeout');var express=require(_0xab44('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xab44('0x2'));var config=require('../../config/environment');var controller=require(_0xab44('0x3'));router[_0xab44('0x4')]('/',auth[_0xab44('0x5')](),controller[_0xab44('0x6')]);router[_0xab44('0x4')](_0xab44('0x7'),auth[_0xab44('0x5')](),controller[_0xab44('0x8')]);router[_0xab44('0x9')]('/',auth[_0xab44('0x5')](),controller[_0xab44('0xa')]);router[_0xab44('0xb')](_0xab44('0x7'),auth['isAuthenticated'](),controller[_0xab44('0xc')]);router['delete'](_0xab44('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xab44('0xd')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 6d840e8..1b2a7ee 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 _0x197e=['yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200','9600','12000','14400','INTEGER','IAX','DADHI','KHOMP','SIP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING'];(function(_0x5ed059,_0x29729c){var _0x111768=function(_0x3548a7){while(--_0x3548a7){_0x5ed059['push'](_0x5ed059['shift']());}};_0x111768(++_0x29729c);}(_0x197e,0x1e1));var _0xe197=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x197e[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xe197('0x0'));module[_0xe197('0x1')]={'name':{'type':Sequelize[_0xe197('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe197('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0xe197('0x3'),'no'),'defaultValue':_0xe197('0x3')},'headerinfo':{'type':Sequelize[_0xe197('0x2')],'defaultValue':_0xe197('0x4')},'localstationid':{'type':Sequelize[_0xe197('0x2')],'unique':_0xe197('0x5')},'minrate':{'type':Sequelize[_0xe197('0x6')](_0xe197('0x7'),_0xe197('0x8'),_0xe197('0x9'),_0xe197('0xa'),_0xe197('0xb'),_0xe197('0xc')),'defaultValue':_0xe197('0x8')},'maxrate':{'type':Sequelize['ENUM'](_0xe197('0x7'),'4800',_0xe197('0x9'),'9600',_0xe197('0xb'),_0xe197('0xc')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xe197('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xe197('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xe197('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xe197('0x6')]('SIP',_0xe197('0xe'),_0xe197('0xf'),_0xe197('0x10')),'defaultValue':_0xe197('0x11')},'key':{'type':Sequelize[_0xe197('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xe197('0x12');}},'notificationSound':{'type':Sequelize[_0xe197('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe197('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe197('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe197('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe197('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe197('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe197('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe197('0x13')],'defaultValue':![],'comment':_0xe197('0x14'),'set':function(_0x4d225c){if(!_0x4d225c)this[_0xe197('0x15')]('mandatoryDispositionPauseId',null);this[_0xe197('0x15')]('mandatoryDisposition',_0x4d225c);}}}; \ No newline at end of file +var _0x5f79=['7200','9600','12000','v17,v27,v29','INTEGER','SIP','IAX','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800'];(function(_0x15eb48,_0x231833){var _0x5b51f5=function(_0x2d5329){while(--_0x2d5329){_0x15eb48['push'](_0x15eb48['shift']());}};_0x5b51f5(++_0x231833);}(_0x5f79,0x12c));var _0x95f7=function(_0x127c7b,_0x1f65e7){_0x127c7b=_0x127c7b-0x0;var _0x1708eb=_0x5f79[_0x127c7b];return _0x1708eb;};'use strict';var Sequelize=require(_0x95f7('0x0'));module['exports']={'name':{'type':Sequelize[_0x95f7('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x95f7('0x1')]},'ecm':{'type':Sequelize[_0x95f7('0x2')]('yes','no'),'defaultValue':_0x95f7('0x3')},'headerinfo':{'type':Sequelize[_0x95f7('0x1')],'defaultValue':_0x95f7('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x95f7('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x95f7('0x6'),_0x95f7('0x7'),_0x95f7('0x8'),_0x95f7('0x9'),'12000','14400'),'defaultValue':_0x95f7('0x7')},'maxrate':{'type':Sequelize[_0x95f7('0x2')]('2400',_0x95f7('0x7'),_0x95f7('0x8'),_0x95f7('0x9'),_0x95f7('0xa'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x95f7('0x1')],'defaultValue':_0x95f7('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x95f7('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x95f7('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x95f7('0xd'),_0x95f7('0xe'),'DADHI','KHOMP'),'defaultValue':_0x95f7('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x95f7('0xf');}},'notificationSound':{'type':Sequelize[_0x95f7('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x95f7('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x95f7('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x95f7('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x95f7('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x95f7('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x95f7('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x95f7('0x10')],'defaultValue':![],'comment':_0x95f7('0x12'),'set':function(_0x470192){if(!_0x470192)this[_0x95f7('0x13')](_0x95f7('0x14'),null);this[_0x95f7('0x13')](_0x95f7('0x15'),_0x470192);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index f7389c4..c97db80 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 _0x21f8=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./faxAccount.socket','register','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','UserProfileResource','destroy','end','stack','name','send','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','rows','show','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','Pause','describe','addDisposition','FaxAccountId','findOne','hasOwnProperty','Disposition','includeAll','findAll','removeDispositions','CannedAnswer','order','removeAnswers','addInteraction','FaxInteraction','ids','omit','getInteractions','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','bulkCreate','priority','getApplications','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','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','VoiceExtension','tech','key','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','defaults','Send\x20Fax\x20failed','filename','Messages','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js'];(function(_0x7e201,_0x3efc32){var _0x1c988e=function(_0x3bb303){while(--_0x3bb303){_0x7e201['push'](_0x7e201['shift']());}};_0x1c988e(++_0x3efc32);}(_0x21f8,0x179));var _0x821f=function(_0x39609a,_0x28a563){_0x39609a=_0x39609a-0x0;var _0xecd92=_0x21f8[_0x39609a];return _0xecd92;};'use strict';var pdf=require(_0x821f('0x0'));var emlformat=require(_0x821f('0x1'));var rimraf=require(_0x821f('0x2'));var zipdir=require(_0x821f('0x3'));var jsonpatch=require(_0x821f('0x4'));var rp=require(_0x821f('0x5'));var moment=require(_0x821f('0x6'));var BPromise=require(_0x821f('0x7'));var Mustache=require('mustache');var util=require(_0x821f('0x8'));var path=require(_0x821f('0x9'));var sox=require(_0x821f('0xa'));var csv=require(_0x821f('0xb'));var ejs=require(_0x821f('0xc'));var fs=require('fs');var _=require(_0x821f('0xd'));var squel=require(_0x821f('0xe'));var crypto=require('crypto');var jsforce=require(_0x821f('0xf'));var deskjs=require(_0x821f('0x10'));var toCsv=require(_0x821f('0xb'));var querystring=require('querystring');var Papa=require(_0x821f('0x11'));var Redis=require(_0x821f('0x12'));var authService=require(_0x821f('0x13'));var qs=require(_0x821f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x821f('0x15'));var logger=require(_0x821f('0x16'))(_0x821f('0x17'));var utils=require(_0x821f('0x18'));var config=require(_0x821f('0x19'));var db=require(_0x821f('0x1a'))['db'];config[_0x821f('0x1b')]=_['defaults'](config[_0x821f('0x1b')],{'host':_0x821f('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x821f('0x1b')]));require(_0x821f('0x1d'))[_0x821f('0x1e')](socket);var jayson=require(_0x821f('0x1f'));var client=jayson['client'][_0x821f('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x856139,_0x1e4cc9,_0x41f554){if(_0x41f554){var _0x1be0b9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1be0b9[_0x821f('0x21')](_0x1e4cc9)){return _0x856139;}else{throw new db[(_0x821f('0x22'))][(_0x821f('0x23'))](_0x821f('0x24'));}}else{return _0x856139;}}function respondWithRpcPromise(_0x32ebf9,_0xaa4709,_0x316b95,_0x15cf4f){return new BPromise(function(_0x4ba7f6,_0xb5474b){var _0x34e804=_0x15cf4f||client;return _0x34e804[_0x821f('0x25')](_0x32ebf9,_0x316b95)['then'](function(_0x224764){logger[_0x821f('0x26')](_0x821f('0x27'),_0xaa4709,_0x821f('0x28'));logger['debug'](_0x821f('0x29'),_0xaa4709,'request\x20sent',JSON[_0x821f('0x2a')](_0x224764));if(_0x224764[_0x821f('0x2b')]){if(_0x224764['error'][_0x821f('0x2c')]===0x1f4){logger[_0x821f('0x2b')]('FaxAccount,\x20%s,\x20%s',_0xaa4709,_0x224764[_0x821f('0x2b')][_0x821f('0x2d')]);return _0xb5474b(_0x224764[_0x821f('0x2b')]['message']);}logger[_0x821f('0x2b')]('FaxAccount,\x20%s,\x20%s',_0xaa4709,_0x224764[_0x821f('0x2b')][_0x821f('0x2d')]);return _0x4ba7f6(_0x224764[_0x821f('0x2b')][_0x821f('0x2d')]);}else{logger['info'](_0x821f('0x27'),_0xaa4709,'request\x20sent');_0x4ba7f6(_0x224764[_0x821f('0x2e')][_0x821f('0x2d')]);}})[_0x821f('0x2f')](function(_0x4054fa){logger[_0x821f('0x2b')](_0x821f('0x27'),_0xaa4709,_0x4054fa);_0xb5474b(_0x4054fa);});});}function respondWithStatusCode(_0x414042,_0x36066d){_0x36066d=_0x36066d||0xcc;return function(_0xc6493e){if(_0xc6493e){return _0x414042[_0x821f('0x30')](_0x36066d);}return _0x414042[_0x821f('0x31')](_0x36066d)['end']();};}function respondWithResult(_0xe3dac4,_0x28ad2f){_0x28ad2f=_0x28ad2f||0xc8;return function(_0x1bb9cd){if(_0x1bb9cd){return _0xe3dac4[_0x821f('0x31')](_0x28ad2f)[_0x821f('0x32')](_0x1bb9cd);}};}function respondWithFilteredResult(_0x3e3468,_0x3b3a75){return function(_0x1e721b){if(_0x1e721b){var _0x1c9d33=_0x1e721b[_0x821f('0x33')],_0x2be7a4=_0x3b3a75[_0x821f('0x34')],_0x22db7e=_0x3b3a75['offset']+_0x3b3a75[_0x821f('0x35')],_0x2223bc;if(_0x22db7e>=_0x1c9d33){_0x22db7e=_0x1c9d33;_0x2223bc=0xc8;}else{_0x2223bc=0xce;}_0x3e3468['status'](_0x2223bc);return _0x3e3468[_0x821f('0x36')](_0x821f('0x37'),_0x2be7a4+'-'+_0x22db7e+'/'+_0x1c9d33)[_0x821f('0x32')](_0x1e721b);}return null;};}function patchUpdates(_0x13487e){return function(_0x2659fe){try{jsonpatch[_0x821f('0x38')](_0x2659fe,_0x13487e,!![]);}catch(_0x4a9b9f){return BPromise[_0x821f('0x39')](_0x4a9b9f);}return _0x2659fe['save']();};}function saveUpdates(_0x1c1d28,_0x15a204){return function(_0x310965){if(_0x310965){return _0x310965[_0x821f('0x3a')](_0x1c1d28)[_0x821f('0x3b')](function(_0xa0cd75){return _0xa0cd75;});}return null;};}function removeEntity(_0x1ab7e9,_0x4dcd6){return function(_0x25ee42){if(_0x25ee42){return _0x25ee42['destroy']()[_0x821f('0x3b')](function(){var _0x503f02=_0x25ee42['get']({'plain':!![]});var _0x1e9ab5='FaxAccounts';return db[_0x821f('0x3c')][_0x821f('0x3d')]({'where':{'type':_0x1e9ab5,'resourceId':_0x503f02['id']}})['then'](function(){return _0x25ee42;});})[_0x821f('0x3b')](function(){_0x1ab7e9[_0x821f('0x31')](0xcc)[_0x821f('0x3e')]();});}};}function handleEntityNotFound(_0x53c795,_0xa48b0){return function(_0x58cd37){if(!_0x58cd37){_0x53c795[_0x821f('0x30')](0x194);}return _0x58cd37;};}function handleError(_0x25a3c2,_0x497a81){_0x497a81=_0x497a81||0x1f4;return function(_0x49d2b4){logger[_0x821f('0x2b')](_0x49d2b4[_0x821f('0x3f')]);if(_0x49d2b4[_0x821f('0x40')]){delete _0x49d2b4[_0x821f('0x40')];}_0x25a3c2['status'](_0x497a81)[_0x821f('0x41')](_0x49d2b4);};}exports['index']=function(_0x25bffb,_0x58897d){var _0x4654b4={'include':[{'model':db['Pause'],'as':_0x821f('0x42')}]},_0x39af99={},_0x2bc1c5={'count':0x0,'rows':[]};var _0x46c2c4=_[_0x821f('0x43')](db[_0x821f('0x44')][_0x821f('0x45')],function(_0x59185e){return{'name':_0x59185e[_0x821f('0x46')],'type':_0x59185e['type']['key']};});_0x39af99[_0x821f('0x47')]=_[_0x821f('0x43')](_0x46c2c4,'name');_0x39af99[_0x821f('0x48')]=_[_0x821f('0x49')](_0x25bffb[_0x821f('0x48')]);_0x39af99['filters']=_[_0x821f('0x4a')](_0x39af99[_0x821f('0x47')],_0x39af99[_0x821f('0x48')]);_0x4654b4['attributes']=_[_0x821f('0x4a')](_0x39af99['model'],qs[_0x821f('0x4b')](_0x25bffb['query'][_0x821f('0x4b')]));_0x4654b4[_0x821f('0x4c')]=_0x4654b4[_0x821f('0x4c')][_0x821f('0x4d')]?_0x4654b4[_0x821f('0x4c')]:_0x39af99['model'];if(!_0x25bffb[_0x821f('0x48')]['hasOwnProperty'](_0x821f('0x4e'))){_0x4654b4[_0x821f('0x35')]=qs['limit'](_0x25bffb[_0x821f('0x48')][_0x821f('0x35')]);_0x4654b4[_0x821f('0x34')]=qs['offset'](_0x25bffb[_0x821f('0x48')]['offset']);}_0x4654b4['order']=qs[_0x821f('0x4f')](_0x25bffb[_0x821f('0x48')][_0x821f('0x4f')]);_0x4654b4[_0x821f('0x50')]=qs[_0x821f('0x51')](_[_0x821f('0x52')](_0x25bffb[_0x821f('0x48')],_0x39af99[_0x821f('0x51')]));if(_0x25bffb[_0x821f('0x48')][_0x821f('0x53')]){_0x4654b4[_0x821f('0x50')]=_[_0x821f('0x54')](_0x4654b4[_0x821f('0x50')],{'$or':_[_0x821f('0x43')](_0x46c2c4,function(_0x36f45a){if(_0x36f45a[_0x821f('0x55')]!==_0x821f('0x56')){var _0x382f8e={};_0x382f8e[_0x36f45a[_0x821f('0x40')]]={'$like':'%'+_0x25bffb['query']['filter']+'%'};return _0x382f8e;}})});}_0x4654b4=_[_0x821f('0x54')]({},_0x4654b4,_0x25bffb[_0x821f('0x57')]);var _0x4d795b={'where':_0x4654b4[_0x821f('0x50')]};return db[_0x821f('0x44')][_0x821f('0x33')](_0x4d795b)[_0x821f('0x3b')](function(_0x4db63c){_0x2bc1c5[_0x821f('0x33')]=_0x4db63c;if(_0x25bffb[_0x821f('0x48')]['includeAll']){_0x4654b4[_0x821f('0x58')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x4654b4);})[_0x821f('0x3b')](function(_0x44d903){_0x2bc1c5[_0x821f('0x59')]=_0x44d903;return _0x2bc1c5;})[_0x821f('0x3b')](respondWithFilteredResult(_0x58897d,_0x4654b4))[_0x821f('0x2f')](handleError(_0x58897d,null));};exports[_0x821f('0x5a')]=function(_0x257086,_0x5842e7){var _0x2f40b0={'raw':![],'where':{'id':_0x257086['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x39b669={};_0x39b669['model']=_[_0x821f('0x49')](db[_0x821f('0x44')][_0x821f('0x45')]);_0x39b669[_0x821f('0x48')]=_[_0x821f('0x49')](_0x257086[_0x821f('0x48')]);_0x39b669['filters']=_[_0x821f('0x4a')](_0x39b669[_0x821f('0x47')],_0x39b669[_0x821f('0x48')]);_0x2f40b0['attributes']=_[_0x821f('0x4a')](_0x39b669[_0x821f('0x47')],qs['fields'](_0x257086[_0x821f('0x48')]['fields']));_0x2f40b0[_0x821f('0x4c')]=_0x2f40b0[_0x821f('0x4c')][_0x821f('0x4d')]?_0x2f40b0[_0x821f('0x4c')]:_0x39b669[_0x821f('0x47')];if(_0x257086[_0x821f('0x48')]['includeAll']){_0x2f40b0[_0x821f('0x58')]=[{'all':!![]}];}_0x2f40b0=_[_0x821f('0x54')]({},_0x2f40b0,_0x257086['options']);return db[_0x821f('0x44')][_0x821f('0x5b')](_0x2f40b0)[_0x821f('0x3b')](handleEntityNotFound(_0x5842e7,null))['then'](respondWithResult(_0x5842e7,null))[_0x821f('0x2f')](handleError(_0x5842e7,null));};exports[_0x821f('0x5c')]=function(_0x322fcd,_0x4d4316){return db[_0x821f('0x44')][_0x821f('0x5c')](_0x322fcd['body'],{})[_0x821f('0x3b')](function(_0x5152be){var _0xed9d4e=_0x322fcd[_0x821f('0x5d')][_0x821f('0x5e')]({'plain':!![]});if(!_0xed9d4e)throw new Error(_0x821f('0x5f'));if(_0xed9d4e['role']==='user'){var _0x531709=_0x5152be[_0x821f('0x5e')]({'plain':!![]});var _0x2295d0='FaxAccounts';return db['UserProfileSection'][_0x821f('0x5b')]({'where':{'name':_0x2295d0,'userProfileId':_0xed9d4e['userProfileId']},'raw':!![]})[_0x821f('0x3b')](function(_0x17963f){if(_0x17963f&&_0x17963f[_0x821f('0x60')]===0x0){return db[_0x821f('0x3c')][_0x821f('0x5c')]({'name':_0x531709[_0x821f('0x40')],'resourceId':_0x531709['id'],'type':_0x17963f[_0x821f('0x40')],'sectionId':_0x17963f['id']},{})[_0x821f('0x3b')](function(){return _0x5152be;});}else{return _0x5152be;}})['catch'](function(_0x144e0d){logger[_0x821f('0x2b')](_0x821f('0x61'),_0x144e0d);throw _0x144e0d;});}return _0x5152be;})[_0x821f('0x3b')](respondWithResult(_0x4d4316,0xc9))[_0x821f('0x2f')](handleError(_0x4d4316,null));};exports[_0x821f('0x3a')]=function(_0x4831ae,_0x121898){if(_0x4831ae['body']['id']){delete _0x4831ae[_0x821f('0x62')]['id'];}return db[_0x821f('0x44')][_0x821f('0x5b')]({'where':{'id':_0x4831ae[_0x821f('0x63')]['id']},'include':[{'model':db[_0x821f('0x64')],'as':_0x821f('0x42')}]})[_0x821f('0x3b')](handleEntityNotFound(_0x121898,null))[_0x821f('0x3b')](saveUpdates(_0x4831ae[_0x821f('0x62')],null))[_0x821f('0x3b')](respondWithResult(_0x121898,null))['catch'](handleError(_0x121898,null));};exports['destroy']=function(_0x21eaeb,_0x46bedc){return db['FaxAccount']['find']({'where':{'id':_0x21eaeb['params']['id']}})[_0x821f('0x3b')](handleEntityNotFound(_0x46bedc,null))[_0x821f('0x3b')](removeEntity(_0x46bedc,null))[_0x821f('0x2f')](handleError(_0x46bedc,null));};exports[_0x821f('0x65')]=function(_0x1a3083,_0x56b367){return db[_0x821f('0x44')][_0x821f('0x65')]()[_0x821f('0x3b')](respondWithResult(_0x56b367,null))['catch'](handleError(_0x56b367,null));};exports[_0x821f('0x66')]=function(_0x2336c2,_0x54cf3e,_0x3c9d64){if(_0x2336c2['body']['id']){delete _0x2336c2[_0x821f('0x62')]['id'];}return db[_0x821f('0x44')]['find']({'where':{'id':_0x2336c2['params']['id']}})[_0x821f('0x3b')](handleEntityNotFound(_0x54cf3e,null))[_0x821f('0x3b')](function(_0x2a7675){if(_0x2a7675){_0x2336c2[_0x821f('0x62')][_0x821f('0x67')]=_0x2a7675['id'];return db['Disposition']['create'](_0x2336c2[_0x821f('0x62')]);}})[_0x821f('0x3b')](respondWithResult(_0x54cf3e,null))[_0x821f('0x2f')](handleError(_0x54cf3e,null));};exports['getDispositions']=function(_0x113cab,_0x379687,_0x1abeff){var _0x5e7ae7={'raw':![],'where':{}};var _0x3fcd04={};var _0x170d64={'count':0x0,'rows':[]};return db[_0x821f('0x44')][_0x821f('0x68')]({'where':{'id':_0x113cab[_0x821f('0x63')]['id']}})[_0x821f('0x3b')](handleEntityNotFound(_0x379687,null))[_0x821f('0x3b')](function(_0x531206){if(_0x531206){_0x3fcd04[_0x821f('0x47')]=_[_0x821f('0x49')](db['Disposition'][_0x821f('0x45')]);_0x3fcd04[_0x821f('0x48')]=_[_0x821f('0x49')](_0x113cab[_0x821f('0x48')]);_0x3fcd04[_0x821f('0x51')]=_[_0x821f('0x4a')](_0x3fcd04[_0x821f('0x47')],_0x3fcd04[_0x821f('0x48')]);_0x5e7ae7[_0x821f('0x4c')]=_[_0x821f('0x4a')](_0x3fcd04[_0x821f('0x47')],qs[_0x821f('0x4b')](_0x113cab[_0x821f('0x48')][_0x821f('0x4b')]));_0x5e7ae7['attributes']=_0x5e7ae7[_0x821f('0x4c')][_0x821f('0x4d')]?_0x5e7ae7['attributes']:_0x3fcd04[_0x821f('0x47')];if(!_0x113cab['query'][_0x821f('0x69')](_0x821f('0x4e'))){_0x5e7ae7[_0x821f('0x35')]=qs['limit'](_0x113cab[_0x821f('0x48')]['limit']);_0x5e7ae7[_0x821f('0x34')]=qs[_0x821f('0x34')](_0x113cab[_0x821f('0x48')][_0x821f('0x34')]);}_0x5e7ae7['order']=qs[_0x821f('0x4f')](_0x113cab[_0x821f('0x48')][_0x821f('0x4f')]);_0x5e7ae7[_0x821f('0x50')]=qs['filters'](_[_0x821f('0x52')](_0x113cab['query'],_0x3fcd04['filters']));_0x5e7ae7[_0x821f('0x50')][_0x821f('0x67')]=_0x531206['id'];if(_0x113cab[_0x821f('0x48')]['filter']){_0x5e7ae7[_0x821f('0x50')]=_[_0x821f('0x54')](_0x5e7ae7[_0x821f('0x50')],{'$or':_['map'](_0x5e7ae7[_0x821f('0x4c')],function(_0x44304d){var _0x4e0fb3={};_0x4e0fb3[_0x44304d]={'$like':'%'+_0x113cab[_0x821f('0x48')]['filter']+'%'};return _0x4e0fb3;})});}_0x5e7ae7=_[_0x821f('0x54')]({},_0x5e7ae7,_0x113cab[_0x821f('0x57')]);return db[_0x821f('0x6a')][_0x821f('0x33')]({'where':_0x5e7ae7[_0x821f('0x50')]})[_0x821f('0x3b')](function(_0x172741){_0x170d64[_0x821f('0x33')]=_0x172741;if(_0x113cab[_0x821f('0x48')][_0x821f('0x6b')]){_0x5e7ae7[_0x821f('0x58')]=[{'all':!![]}];}return db[_0x821f('0x6a')][_0x821f('0x6c')](_0x5e7ae7);})['then'](function(_0x3bf75e){_0x170d64[_0x821f('0x59')]=_0x3bf75e;return _0x170d64;});}})[_0x821f('0x3b')](respondWithFilteredResult(_0x379687,_0x5e7ae7))['catch'](handleError(_0x379687,null));};exports[_0x821f('0x6d')]=function(_0x4f4e97,_0x22157,_0x48d366){return db[_0x821f('0x44')][_0x821f('0x5b')]({'where':{'id':_0x4f4e97['params']['id']}})[_0x821f('0x3b')](handleEntityNotFound(_0x22157,null))['then'](function(_0x172b97){if(_0x172b97){return _0x172b97[_0x821f('0x6d')](_0x4f4e97[_0x821f('0x48')]['ids']);}})[_0x821f('0x3b')](respondWithStatusCode(_0x22157,null))['catch'](handleError(_0x22157,null));};exports['addAnswer']=function(_0x5d6258,_0x4be830,_0x53230e){if(_0x5d6258[_0x821f('0x62')]['id']){delete _0x5d6258[_0x821f('0x62')]['id'];}return db['FaxAccount'][_0x821f('0x5b')]({'where':{'id':_0x5d6258[_0x821f('0x63')]['id']}})['then'](handleEntityNotFound(_0x4be830,null))[_0x821f('0x3b')](function(_0x1ffec2){if(_0x1ffec2){_0x5d6258[_0x821f('0x62')]['FaxAccountId']=_0x1ffec2['id'];return db[_0x821f('0x6e')][_0x821f('0x5c')](_0x5d6258[_0x821f('0x62')]);}})[_0x821f('0x3b')](respondWithResult(_0x4be830,null))['catch'](handleError(_0x4be830,null));};exports['getAnswers']=function(_0xed8409,_0x153107,_0x18c181){var _0x2390ed={'raw':![],'where':{}};var _0x2d631a={};var _0x128b39={'count':0x0,'rows':[]};return db[_0x821f('0x44')][_0x821f('0x68')]({'where':{'id':_0xed8409['params']['id']}})[_0x821f('0x3b')](handleEntityNotFound(_0x153107,null))[_0x821f('0x3b')](function(_0x1a7c21){if(_0x1a7c21){_0x2d631a[_0x821f('0x47')]=_[_0x821f('0x49')](db[_0x821f('0x6e')]['rawAttributes']);_0x2d631a['query']=_[_0x821f('0x49')](_0xed8409[_0x821f('0x48')]);_0x2d631a[_0x821f('0x51')]=_[_0x821f('0x4a')](_0x2d631a[_0x821f('0x47')],_0x2d631a[_0x821f('0x48')]);_0x2390ed[_0x821f('0x4c')]=_['intersection'](_0x2d631a[_0x821f('0x47')],qs[_0x821f('0x4b')](_0xed8409[_0x821f('0x48')][_0x821f('0x4b')]));_0x2390ed[_0x821f('0x4c')]=_0x2390ed[_0x821f('0x4c')][_0x821f('0x4d')]?_0x2390ed[_0x821f('0x4c')]:_0x2d631a[_0x821f('0x47')];if(!_0xed8409[_0x821f('0x48')][_0x821f('0x69')](_0x821f('0x4e'))){_0x2390ed[_0x821f('0x35')]=qs[_0x821f('0x35')](_0xed8409[_0x821f('0x48')][_0x821f('0x35')]);_0x2390ed[_0x821f('0x34')]=qs[_0x821f('0x34')](_0xed8409[_0x821f('0x48')][_0x821f('0x34')]);}_0x2390ed[_0x821f('0x6f')]=qs[_0x821f('0x4f')](_0xed8409[_0x821f('0x48')][_0x821f('0x4f')]);_0x2390ed[_0x821f('0x50')]=qs[_0x821f('0x51')](_[_0x821f('0x52')](_0xed8409[_0x821f('0x48')],_0x2d631a[_0x821f('0x51')]));_0x2390ed[_0x821f('0x50')][_0x821f('0x67')]=_0x1a7c21['id'];if(_0xed8409[_0x821f('0x48')][_0x821f('0x53')]){_0x2390ed[_0x821f('0x50')]=_[_0x821f('0x54')](_0x2390ed[_0x821f('0x50')],{'$or':_[_0x821f('0x43')](_0x2390ed['attributes'],function(_0x397ae9){var _0x6f95d2={};_0x6f95d2[_0x397ae9]={'$like':'%'+_0xed8409[_0x821f('0x48')][_0x821f('0x53')]+'%'};return _0x6f95d2;})});}_0x2390ed=_[_0x821f('0x54')]({},_0x2390ed,_0xed8409[_0x821f('0x57')]);return db['CannedAnswer'][_0x821f('0x33')]({'where':_0x2390ed[_0x821f('0x50')]})[_0x821f('0x3b')](function(_0x3d724a){_0x128b39[_0x821f('0x33')]=_0x3d724a;if(_0xed8409[_0x821f('0x48')][_0x821f('0x6b')]){_0x2390ed[_0x821f('0x58')]=[{'all':!![]}];}return db[_0x821f('0x6e')][_0x821f('0x6c')](_0x2390ed);})['then'](function(_0x4721ee){_0x128b39[_0x821f('0x59')]=_0x4721ee;return _0x128b39;});}})[_0x821f('0x3b')](respondWithFilteredResult(_0x153107,_0x2390ed))[_0x821f('0x2f')](handleError(_0x153107,null));};exports[_0x821f('0x70')]=function(_0x30db90,_0x49a7bc,_0x4baa71){return db[_0x821f('0x44')][_0x821f('0x5b')]({'where':{'id':_0x30db90['params']['id']}})[_0x821f('0x3b')](handleEntityNotFound(_0x49a7bc,null))[_0x821f('0x3b')](function(_0x39b02e){if(_0x39b02e){return _0x39b02e[_0x821f('0x70')](_0x30db90[_0x821f('0x48')]['ids']);}})[_0x821f('0x3b')](respondWithStatusCode(_0x49a7bc,null))[_0x821f('0x2f')](handleError(_0x49a7bc,null));};exports[_0x821f('0x71')]=function(_0x1cdd71,_0x46c9b3,_0x36f6e1){return db[_0x821f('0x72')]['find']({'where':{'id':_0x1cdd71[_0x821f('0x63')]['id']}})['then'](handleEntityNotFound(_0x46c9b3,null))[_0x821f('0x3b')](function(_0x12267f){if(_0x12267f){return _0x12267f[_0x821f('0x71')](_0x1cdd71['body'][_0x821f('0x73')],_[_0x821f('0x74')](_0x1cdd71['body'],[_0x821f('0x73'),'id'])||{});}})['then'](respondWithResult(_0x46c9b3,null))[_0x821f('0x2f')](handleError(_0x46c9b3,null));};exports[_0x821f('0x75')]=function(_0x2700f3,_0x4f1471,_0x253b61){var _0x20c3d5={'raw':![],'where':{}};var _0x1430e3={};var _0xa98c1f={'count':0x0,'rows':[]};return db[_0x821f('0x44')]['findOne']({'where':{'id':_0x2700f3[_0x821f('0x63')]['id']}})[_0x821f('0x3b')](handleEntityNotFound(_0x4f1471,null))[_0x821f('0x3b')](function(_0x121f25){if(_0x121f25){_0x1430e3[_0x821f('0x47')]=_[_0x821f('0x49')](db[_0x821f('0x72')][_0x821f('0x45')]);_0x1430e3[_0x821f('0x48')]=_[_0x821f('0x49')](_0x2700f3[_0x821f('0x48')]);_0x1430e3[_0x821f('0x51')]=_['intersection'](_0x1430e3['model'],_0x1430e3[_0x821f('0x48')]);_0x20c3d5[_0x821f('0x4c')]=_['intersection'](_0x1430e3[_0x821f('0x47')],qs[_0x821f('0x4b')](_0x2700f3[_0x821f('0x48')][_0x821f('0x4b')]));_0x20c3d5[_0x821f('0x4c')]=_0x20c3d5[_0x821f('0x4c')][_0x821f('0x4d')]?_0x20c3d5[_0x821f('0x4c')]:_0x1430e3[_0x821f('0x47')];if(!_0x2700f3['query'][_0x821f('0x69')](_0x821f('0x4e'))){_0x20c3d5[_0x821f('0x35')]=qs['limit'](_0x2700f3[_0x821f('0x48')]['limit']);_0x20c3d5[_0x821f('0x34')]=qs[_0x821f('0x34')](_0x2700f3[_0x821f('0x48')][_0x821f('0x34')]);}_0x20c3d5['order']=qs[_0x821f('0x4f')](_0x2700f3[_0x821f('0x48')]['sort']);_0x20c3d5[_0x821f('0x50')]=qs[_0x821f('0x51')](_['pick'](_0x2700f3[_0x821f('0x48')],_0x1430e3[_0x821f('0x51')]));_0x20c3d5[_0x821f('0x50')][_0x821f('0x67')]=_0x121f25['id'];if(_0x2700f3[_0x821f('0x48')][_0x821f('0x53')]){_0x20c3d5[_0x821f('0x50')]=_[_0x821f('0x54')](_0x20c3d5[_0x821f('0x50')],{'$or':_[_0x821f('0x43')](_0x20c3d5[_0x821f('0x4c')],function(_0x11a9c2){var _0x1207ee={};_0x1207ee[_0x11a9c2]={'$like':'%'+_0x2700f3[_0x821f('0x48')][_0x821f('0x53')]+'%'};return _0x1207ee;})});}_0x20c3d5=_['merge']({},_0x20c3d5,_0x2700f3[_0x821f('0x57')]);return db[_0x821f('0x72')][_0x821f('0x33')]({'where':_0x20c3d5[_0x821f('0x50')]})[_0x821f('0x3b')](function(_0x37a981){_0xa98c1f[_0x821f('0x33')]=_0x37a981;if(_0x2700f3[_0x821f('0x48')][_0x821f('0x6b')]){_0x20c3d5[_0x821f('0x58')]=[{'model':db[_0x821f('0x76')],'as':_0x821f('0x77'),'required':![]},{'model':db[_0x821f('0x78')],'as':_0x821f('0x79'),'attributes':[_0x821f('0x40'),'fullname',_0x821f('0x7a')],'required':![]},{'model':db[_0x821f('0x7b')],'as':_0x821f('0x7c'),'attributes':['id','name',_0x821f('0x7d')],'where':_0x2700f3['query']['tag']?{'id':_0x2700f3[_0x821f('0x48')]['tag']}:undefined,'required':_0x2700f3[_0x821f('0x48')][_0x821f('0x7e')]?!![]:![]}];}return db[_0x821f('0x72')][_0x821f('0x6c')](_0x20c3d5);})[_0x821f('0x3b')](function(_0x4b451c){_0xa98c1f['rows']=_0x4b451c;return _0xa98c1f;});}})['then'](respondWithFilteredResult(_0x4f1471,_0x20c3d5))[_0x821f('0x2f')](handleError(_0x4f1471,null));};exports['addApplications']=function(_0x5473ab,_0x1a678d,_0x4ec546){return db[_0x821f('0x44')]['findOne']({'where':{'id':_0x5473ab[_0x821f('0x63')]['id']}})['then'](handleEntityNotFound(_0x1a678d,null))['then'](function(_0x2192a4){if(_0x2192a4){return db[_0x821f('0x7f')][_0x821f('0x80')](function(_0x4850df){return db['FaxApplication'][_0x821f('0x3d')]({'where':{'FaxAccountId':_0x5473ab[_0x821f('0x63')]['id']},'transaction':_0x4850df})[_0x821f('0x3b')](function(_0x181a3d){var _0x4adec4=_[_0x821f('0x43')](_0x5473ab[_0x821f('0x62')],function(_0x4d64cb){_0x4d64cb[_0x821f('0x67')]=_0x5473ab[_0x821f('0x63')]['id'];return _0x4d64cb;});return db[_0x821f('0x81')][_0x821f('0x82')](_0x4adec4,{'transaction':_0x4850df});});})[_0x821f('0x3b')](function(){return db[_0x821f('0x81')]['findAndCountAll']({'where':{'FaxAccountId':_0x5473ab['params']['id']},'order':_0x821f('0x83')});});}})[_0x821f('0x3b')](respondWithResult(_0x1a678d,null))[_0x821f('0x2f')](handleError(_0x1a678d,null));};exports[_0x821f('0x84')]=function(_0x228d16,_0x1c0b5e,_0x53c93b){var _0x53b8e4={};var _0x5f3193={};var _0x5f5d87;var _0x3db91b;return db[_0x821f('0x44')][_0x821f('0x68')]({'where':{'id':_0x228d16[_0x821f('0x63')]['id']}})['then'](handleEntityNotFound(_0x1c0b5e,null))['then'](function(_0x21bba9){if(_0x21bba9){_0x5f5d87=_0x21bba9;_0x5f3193['model']=_[_0x821f('0x49')](db['FaxApplication']['rawAttributes']);_0x5f3193['query']=_[_0x821f('0x49')](_0x228d16[_0x821f('0x48')]);_0x5f3193['filters']=_[_0x821f('0x4a')](_0x5f3193[_0x821f('0x47')],_0x5f3193[_0x821f('0x48')]);_0x53b8e4['attributes']=_[_0x821f('0x4a')](_0x5f3193[_0x821f('0x47')],qs[_0x821f('0x4b')](_0x228d16['query'][_0x821f('0x4b')]));_0x53b8e4[_0x821f('0x4c')]=_0x53b8e4[_0x821f('0x4c')][_0x821f('0x4d')]?_0x53b8e4[_0x821f('0x4c')]:_0x5f3193[_0x821f('0x47')];_0x53b8e4[_0x821f('0x6f')]=qs['sort'](_0x228d16[_0x821f('0x48')]['sort']);_0x53b8e4['where']=qs['filters'](_[_0x821f('0x52')](_0x228d16[_0x821f('0x48')],_0x5f3193['filters']));if(_0x228d16[_0x821f('0x48')][_0x821f('0x53')]){_0x53b8e4['where']=_[_0x821f('0x54')](_0x53b8e4['where'],{'$or':_['map'](_0x53b8e4['attributes'],function(_0x2c7623){var _0x3f486d={};_0x3f486d[_0x2c7623]={'$like':'%'+_0x228d16[_0x821f('0x48')][_0x821f('0x53')]+'%'};return _0x3f486d;})});}_0x53b8e4=_[_0x821f('0x54')]({},_0x53b8e4,_0x228d16[_0x821f('0x57')]);return _0x5f5d87[_0x821f('0x84')](_0x53b8e4);}})[_0x821f('0x3b')](function(_0x4b75cd){if(_0x4b75cd){_0x3db91b=_0x4b75cd[_0x821f('0x4d')];if(!_0x228d16[_0x821f('0x48')][_0x821f('0x69')](_0x821f('0x4e'))){_0x53b8e4[_0x821f('0x35')]=qs[_0x821f('0x35')](_0x228d16[_0x821f('0x48')][_0x821f('0x35')]);_0x53b8e4['offset']=qs['offset'](_0x228d16[_0x821f('0x48')]['offset']);}return _0x5f5d87['getApplications'](_0x53b8e4);}})[_0x821f('0x3b')](function(_0x28bb14){if(_0x28bb14){return _0x28bb14?{'count':_0x3db91b,'rows':_0x28bb14}:null;}})[_0x821f('0x3b')](respondWithResult(_0x1c0b5e,null))[_0x821f('0x2f')](handleError(_0x1c0b5e,null));};function Extension(_0x1bccb5,_0x4a7231,_0x4d04a9,_0x3f65da){this['context']=_0x821f('0x85');this[_0x821f('0x86')]=_0x1bccb5[_0x821f('0x87')];this[_0x821f('0x88')]=_0x3f65da;this[_0x821f('0x55')]=_0x821f('0x89');this[_0x821f('0x8a')]=_0x821f('0x8b');this[_0x821f('0x67')]=_0x1bccb5['id'];this[_0x821f('0x83')]=_0x4a7231;this['appdata']=_0x4d04a9;}function createExtensionsReciveFax(_0x40cb52){var _0x2f9162=0x1;var _0xd09177=[];_0xd09177[_0x821f('0x8c')](new Extension(_0x40cb52,_0x2f9162,'','Answer'));_0x2f9162+=0x1;_0xd09177[_0x821f('0x8c')](new Extension(_0x40cb52,_0x2f9162,_0x821f('0x8d'),_0x821f('0x8e')));_0x2f9162+=0x1;for(var _0x580ae2 in _0x40cb52){if(_0x40cb52[_0x821f('0x69')](_0x580ae2)&&(_0x580ae2==='ecm'||_0x580ae2===_0x821f('0x87')||_0x580ae2===_0x821f('0x8f')||_0x580ae2===_0x821f('0x90')||_0x580ae2===_0x821f('0x91')||_0x580ae2===_0x821f('0x92')||_0x580ae2==='minrate'||_0x580ae2===_0x821f('0x93')||_0x580ae2===_0x821f('0x94'))){_0xd09177['push'](new Extension(_0x40cb52,_0x2f9162,_0x821f('0x95')+_0x580ae2+')='+_0x40cb52[_0x580ae2],_0x821f('0x8e')));_0x2f9162+=0x1;}}_0xd09177[_0x821f('0x8c')](new Extension(_0x40cb52,_0x2f9162,'6',_0x821f('0x96')));_0x2f9162+=0x1;_0xd09177[_0x821f('0x8c')](new Extension(_0x40cb52,_0x2f9162,_0x821f('0x97'),_0x821f('0x98')));_0x2f9162=0x0;return _0xd09177;}exports[_0x821f('0x99')]=function(_0x28bf52,_0x4dbef5,_0x3a0f98){var _0x365047;return db[_0x821f('0x7f')][_0x821f('0x80')](function(_0x33847d){return db[_0x821f('0x44')][_0x821f('0x5c')](_0x28bf52[_0x821f('0x62')],{'transaction':_0x33847d})[_0x821f('0x3b')](function(_0x566cf8){_0x365047=_0x566cf8[_0x821f('0x5e')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x365047),{'transaction':_0x33847d});});})['then'](function(){return _0x365047;})[_0x821f('0x3b')](respondWithResult(_0x4dbef5,null))['catch'](handleError(_0x4dbef5,null));};exports['updateAccountApplications']=function(_0x423256,_0x3df701,_0x49434f){var _0x46bcc0;return db[_0x821f('0x7f')]['transaction'](function(_0x3f7260){return db[_0x821f('0x44')]['update'](_0x423256[_0x821f('0x62')],{'where':{'id':_0x423256[_0x821f('0x62')]['id']},'transaction':_0x3f7260})[_0x821f('0x3b')](function(_0x1f2a88){return db[_0x821f('0x9a')]['destroy']({'where':{'FaxAccountId':_0x423256[_0x821f('0x62')]['id']},'transaction':_0x3f7260})[_0x821f('0x3b')](function(_0x5bfb75){return db[_0x821f('0x9a')][_0x821f('0x82')](createExtensionsReciveFax(_[_0x821f('0x74')](_0x423256[_0x821f('0x62')],[_0x821f('0x9b'),_0x821f('0x9c'),_0x821f('0x9d'),_0x821f('0x9e'),_0x821f('0x9f'),_0x821f('0xa0')])),{'transaction':_0x3f7260});});});})[_0x821f('0x3b')](function(){return db[_0x821f('0x44')][_0x821f('0xa1')](_0x423256[_0x821f('0x62')]['id']);})[_0x821f('0x3b')](respondWithResult(_0x3df701,null))[_0x821f('0x2f')](handleError(_0x3df701,null));};exports['getMessages']=function(_0x2dbe41,_0x3f6a7b,_0x45fcef){var _0x4ec5bb={'raw':!![],'where':{}};var _0x22355f={};var _0x23d186={'count':0x0,'rows':[]};return db[_0x821f('0x44')][_0x821f('0x68')]({'where':{'id':_0x2dbe41[_0x821f('0x63')]['id']}})[_0x821f('0x3b')](handleEntityNotFound(_0x3f6a7b,null))[_0x821f('0x3b')](function(_0xa22627){if(_0xa22627){_0x22355f['model']=_[_0x821f('0x49')](db[_0x821f('0xa2')]['rawAttributes']);_0x22355f['query']=_[_0x821f('0x49')](_0x2dbe41[_0x821f('0x48')]);_0x22355f[_0x821f('0x51')]=_[_0x821f('0x4a')](_0x22355f[_0x821f('0x47')],_0x22355f['query']);_0x4ec5bb['attributes']=_[_0x821f('0x4a')](_0x22355f['model'],qs['fields'](_0x2dbe41['query']['fields']));_0x4ec5bb['attributes']=_0x4ec5bb[_0x821f('0x4c')][_0x821f('0x4d')]?_0x4ec5bb[_0x821f('0x4c')]:_0x22355f[_0x821f('0x47')];if(!_0x2dbe41[_0x821f('0x48')][_0x821f('0x69')]('nolimit')){_0x4ec5bb[_0x821f('0x35')]=qs['limit'](_0x2dbe41[_0x821f('0x48')][_0x821f('0x35')]);_0x4ec5bb[_0x821f('0x34')]=qs[_0x821f('0x34')](_0x2dbe41[_0x821f('0x48')][_0x821f('0x34')]);}_0x4ec5bb[_0x821f('0x6f')]=qs[_0x821f('0x4f')](_0x2dbe41['query']['sort']);_0x4ec5bb['where']=qs[_0x821f('0x51')](_[_0x821f('0x52')](_0x2dbe41[_0x821f('0x48')],_0x22355f['filters']));_0x4ec5bb[_0x821f('0x50')][_0x821f('0x67')]=_0xa22627['id'];if(_0x2dbe41['query'][_0x821f('0x53')]){_0x4ec5bb[_0x821f('0x50')]=_[_0x821f('0x54')](_0x4ec5bb[_0x821f('0x50')],{'$or':_[_0x821f('0x43')](_0x4ec5bb[_0x821f('0x4c')],function(_0x3c9980){var _0x249183={};_0x249183[_0x3c9980]={'$like':'%'+_0x2dbe41[_0x821f('0x48')]['filter']+'%'};return _0x249183;})});}if(_0x2dbe41[_0x821f('0x48')][_0x821f('0xa3')]){var _0x544a61=_0x2dbe41[_0x821f('0x48')][_0x821f('0xa3')][_0x821f('0xa4')](',');var _0x4c5cf4={};_0x4c5cf4[_0x544a61[0x0]]={'$gte':moment(_0x544a61[0x1])[_0x821f('0xa5')](_0x821f('0xa6'))};_0x4ec5bb[_0x821f('0x50')]=_[_0x821f('0x54')](_0x4ec5bb['where'],_0x4c5cf4);}_0x4ec5bb=_[_0x821f('0x54')]({},_0x4ec5bb,_0x2dbe41['options']);return db[_0x821f('0xa2')]['count']({'where':_0x4ec5bb[_0x821f('0x50')]})[_0x821f('0x3b')](function(_0x4289a9){_0x23d186[_0x821f('0x33')]=_0x4289a9;if(_0x2dbe41[_0x821f('0x48')][_0x821f('0x6b')]){_0x4ec5bb['include']=[{'all':!![]}];}return db[_0x821f('0xa2')][_0x821f('0x6c')](_0x4ec5bb);})['then'](function(_0x26416a){_0x23d186[_0x821f('0x59')]=_0x26416a;return _0x23d186;});}})[_0x821f('0x3b')](respondWithFilteredResult(_0x3f6a7b,_0x4ec5bb))[_0x821f('0x2f')](handleError(_0x3f6a7b,null));};exports['send']=function(_0x3a187c,_0x2c1788,_0x59a8b9){var _0x40b60e,_0x35de5d={},_0x1257d7;if(_0x3a187c[_0x821f('0x62')]['to']){_0x1257d7=_0x3a187c[_0x821f('0x62')]['to'][0x0];}return db[_0x821f('0x44')][_0x821f('0x5b')]({'where':{'id':_0x3a187c[_0x821f('0x63')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x821f('0x76')],'as':_0x821f('0xa7'),'where':{'fax':_0x1257d7},'limit':0x1,'order':[[_0x821f('0x9e'),_0x821f('0xa8')]]}]}]})[_0x821f('0x3b')](handleEntityNotFound(_0x2c1788,null))[_0x821f('0x3b')](function(_0x59fa0f){_0x40b60e=_0x59fa0f;if(_0x3a187c[_0x821f('0x62')][_0x821f('0xa9')]&&_0x3a187c[_0x821f('0x62')][_0x821f('0xa9')]['length']){for(var _0x36ebba=0x0;_0x36ebba<_0x3a187c[_0x821f('0x62')]['attachments'][_0x821f('0x4d')];_0x36ebba+=0x1){_0x3a187c[_0x821f('0x62')][_0x821f('0xa9')][_0x36ebba]={'filename':_0x3a187c[_0x821f('0x62')]['attachments'][_0x36ebba][_0x821f('0x40')],'id':_0x3a187c[_0x821f('0x62')][_0x821f('0xa9')][_0x36ebba]['id'],'path':path[_0x821f('0xaa')](config[_0x821f('0xab')],_0x821f('0xac'),_0x3a187c[_0x821f('0x62')][_0x821f('0xa9')][_0x36ebba][_0x821f('0xad')])};}}return respondWithRpcPromise(_0x821f('0xae'),_0x821f('0xae'),{'FaxAccountId':_[_0x821f('0xaf')](_0x3a187c[_0x821f('0x63')]['id'])?undefined:_0x3a187c['params']['id'],'path':_[_0x821f('0xaf')](_0x3a187c[_0x821f('0x62')][_0x821f('0xa9')][0x0][_0x821f('0x9')])?undefined:_0x3a187c[_0x821f('0x62')][_0x821f('0xa9')][0x0]['path'],'fax':_[_0x821f('0xaf')](_0x3a187c[_0x821f('0x62')]['to'][0x0])?undefined:_0x3a187c[_0x821f('0x62')]['to'][0x0]},client9002);})[_0x821f('0x3b')](function(){if(_0x40b60e){if(_[_0x821f('0xaf')](_0x3a187c[_0x821f('0x62')][_0x821f('0xb0')])){_0x3a187c[_0x821f('0x62')][_0x821f('0xb0')]=util[_0x821f('0xa5')](_0x821f('0xb1'),_0x40b60e['name'],_0x40b60e[_0x821f('0xb2')]);}if(_0x40b60e[_0x821f('0xb3')]){if(_0x40b60e[_0x821f('0xb3')][_0x821f('0xa7')][_0x821f('0x4d')]){return _0x40b60e[_0x821f('0xb3')][_0x821f('0xa7')][0x0];}else{return db[_0x821f('0x76')]['create'](_[_0x821f('0xb4')](_0x3a187c[_0x821f('0x62')],{'firstName':_0x3a187c['body']['to'][0x0],'phone':_0x3a187c[_0x821f('0x62')]['to'][0x0],'fax':_0x3a187c[_0x821f('0x62')]['to'][0x0],'ListId':_0x40b60e[_0x821f('0xa0')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x821f('0xb5'));}})['then'](function(_0x2ee7d1){if(_0x2ee7d1){return db[_0x821f('0x72')][_0x821f('0x5b')]({'where':{'ContactId':_0x2ee7d1['id'],'closed':![],'FaxAccountId':_0x40b60e['id']}})['then'](function(_0x5cd9be){if(_0x5cd9be){return[_0x5cd9be,![]];}return db['FaxInteraction'][_0x821f('0x5c')]({'UserId':_0x3a187c[_0x821f('0x5d')]['id'],'ContactId':_0x2ee7d1['id'],'FaxAccountId':_0x40b60e['id'],'fax':_0x3a187c[_0x821f('0x62')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x821f('0x54')](_0x3a187c[_0x821f('0x62')],{'read':![],'body':_0x3a187c['body']['attachments'][0x0][_0x821f('0xb6')],'FaxAccountId':_0x40b60e['id'],'UserId':_0x3a187c['user']['id'],'ContactId':_0x2ee7d1['id'],'AttachmentId':_0x3a187c[_0x821f('0x62')][_0x821f('0xa9')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x821f('0xb7')}]})[_0x821f('0x3b')](function(_0x415b42){return[_0x415b42,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x821f('0xb8')](function(_0x118a57,_0x5e4b4a){if(_0x5e4b4a){return _0x118a57;}return db[_0x821f('0xa2')]['create']({'direction':_0x821f('0xb9'),'read':![],'body':_0x3a187c[_0x821f('0x62')]['attachments'][0x0][_0x821f('0xb6')],'FaxAccountId':_0x40b60e['id'],'FaxInteractionId':_0x118a57['id'],'UserId':_0x3a187c['user']['id'],'ContactId':_0x118a57[_0x821f('0xba')],'AttachmentId':_0x3a187c[_0x821f('0x62')][_0x821f('0xa9')][0x0]['id']})[_0x821f('0x3b')](function(_0x14de47){_0x118a57[_0x821f('0xbb')][_0x821f('0xb7')]=[];_0x118a57['dataValues'][_0x821f('0xb7')]['push'](_0x14de47[_0x821f('0xbb')]);return _0x118a57;});})['then'](function(_0x58ee97){respondWithRpcPromise('SendFax',_0x821f('0xbc'),{'FaxAccountId':_[_0x821f('0xaf')](_0x3a187c[_0x821f('0x63')]['id'])?undefined:_0x3a187c['params']['id'],'path':_[_0x821f('0xaf')](_0x3a187c[_0x821f('0x62')]['attachments'][0x0][_0x821f('0x9')])?undefined:_0x3a187c[_0x821f('0x62')][_0x821f('0xa9')][0x0][_0x821f('0x9')],'fax':_[_0x821f('0xaf')](_0x3a187c['body']['to'][0x0])?undefined:_0x3a187c['body']['to'][0x0],'AttachmentId':_0x3a187c[_0x821f('0x62')][_0x821f('0xa9')][0x0]['id']},client9002)[_0x821f('0x3b')](function(_0x3c3261){logger[_0x821f('0x26')](_0x821f('0xbd'),_0x3c3261);})[_0x821f('0x2f')](function(_0xce427c){logger[_0x821f('0x26')](_0x821f('0xbd'),_0xce427c);});return _0x58ee97;})[_0x821f('0x3b')](respondWithResult(_0x2c1788,null))[_0x821f('0x2f')](handleError(_0x2c1788,null));};exports['addAgents']=function(_0x5de6f2,_0x581b9e,_0x42d766){return db[_0x821f('0x44')]['find']({'where':{'id':_0x5de6f2[_0x821f('0x63')]['id']}})['then'](handleEntityNotFound(_0x581b9e,null))['then'](function(_0x3d231b){if(_0x3d231b){return _0x3d231b[_0x821f('0xbe')](_0x5de6f2['body'][_0x821f('0x73')],_[_0x821f('0x74')](_0x5de6f2[_0x821f('0x62')],[_0x821f('0x73'),'id'])||{})[_0x821f('0xb8')](function(_0x49ac2b){for(var _0x50d34b=0x0;_0x50d34b<_0x5de6f2[_0x821f('0x62')][_0x821f('0x73')][_0x821f('0x4d')];_0x50d34b+=0x1){socket[_0x821f('0xbf')](_0x821f('0xc0'),{'UserId':_0x5de6f2[_0x821f('0x62')][_0x821f('0x73')][_0x50d34b],'FaxAccountId':_0x5de6f2['params']['id']});}return _0x49ac2b;});}})[_0x821f('0x3b')](respondWithResult(_0x581b9e,null))[_0x821f('0x2f')](handleError(_0x581b9e,null));};exports[_0x821f('0xc1')]=function(_0x1220fb,_0x17ca2d,_0x3fd14c){return db['FaxAccount'][_0x821f('0x5b')]({'where':{'id':_0x1220fb[_0x821f('0x63')]['id']}})['then'](handleEntityNotFound(_0x17ca2d,null))['then'](function(_0x30c527){if(_0x30c527){return _0x30c527['removeAgents'](_0x1220fb[_0x821f('0x48')]['ids'])['then'](function(){if(_[_0x821f('0xc2')](_0x1220fb[_0x821f('0x48')]['ids'])){for(var _0x1a9846=0x0;_0x1a9846<_0x1220fb[_0x821f('0x48')][_0x821f('0x73')][_0x821f('0x4d')];_0x1a9846+=0x1){socket[_0x821f('0xbf')](_0x821f('0xc3'),{'UserId':Number(_0x1220fb[_0x821f('0x48')][_0x821f('0x73')][_0x1a9846]),'FaxAccountId':Number(_0x1220fb[_0x821f('0x63')]['id'])});}}else{socket[_0x821f('0xbf')]('userFaxAccount:remove',{'UserId':Number(_0x1220fb['query'][_0x821f('0x73')]),'FaxAccountId':Number(_0x1220fb[_0x821f('0x63')]['id'])});}});}})[_0x821f('0x3b')](respondWithStatusCode(_0x17ca2d,null))[_0x821f('0x2f')](handleError(_0x17ca2d,null));};exports[_0x821f('0xc4')]=function(_0x30669d,_0x22fad6,_0xbba589){var _0x6aac71={};var _0x43c0d5={};var _0x4b1602;var _0xdd5c19;return db['FaxAccount']['findOne']({'where':{'id':_0x30669d[_0x821f('0x63')]['id']}})[_0x821f('0x3b')](handleEntityNotFound(_0x22fad6,null))[_0x821f('0x3b')](function(_0x175c46){if(_0x175c46){_0x4b1602=_0x175c46;_0x43c0d5['model']=_[_0x821f('0x49')](db['User'][_0x821f('0x45')]);_0x43c0d5[_0x821f('0x48')]=_[_0x821f('0x49')](_0x30669d[_0x821f('0x48')]);_0x43c0d5[_0x821f('0x51')]=_[_0x821f('0x4a')](_0x43c0d5[_0x821f('0x47')],_0x43c0d5[_0x821f('0x48')]);_0x6aac71[_0x821f('0x4c')]=_[_0x821f('0x4a')](_0x43c0d5[_0x821f('0x47')],qs['fields'](_0x30669d[_0x821f('0x48')]['fields']));_0x6aac71[_0x821f('0x4c')]=_0x6aac71[_0x821f('0x4c')]['length']?_0x6aac71[_0x821f('0x4c')]:_0x43c0d5[_0x821f('0x47')];_0x6aac71[_0x821f('0x6f')]=qs['sort'](_0x30669d[_0x821f('0x48')][_0x821f('0x4f')]);_0x6aac71[_0x821f('0x50')]=qs[_0x821f('0x51')](_[_0x821f('0x52')](_0x30669d[_0x821f('0x48')],_0x43c0d5[_0x821f('0x51')]));if(_0x30669d[_0x821f('0x48')][_0x821f('0x53')]){_0x6aac71[_0x821f('0x50')]=_['merge'](_0x6aac71[_0x821f('0x50')],{'$or':_[_0x821f('0x43')](_0x6aac71[_0x821f('0x4c')],function(_0x2fae0f){var _0x2f3b47={};_0x2f3b47[_0x2fae0f]={'$like':'%'+_0x30669d[_0x821f('0x48')][_0x821f('0x53')]+'%'};return _0x2f3b47;})});}_0x6aac71=_[_0x821f('0x54')]({},_0x6aac71,_0x30669d[_0x821f('0x57')]);return _0x4b1602[_0x821f('0xc4')](_0x6aac71);}})[_0x821f('0x3b')](function(_0x470f72){if(_0x470f72){_0xdd5c19=_0x470f72[_0x821f('0x4d')];if(!_0x30669d[_0x821f('0x48')][_0x821f('0x69')](_0x821f('0x4e'))){_0x6aac71[_0x821f('0x35')]=qs[_0x821f('0x35')](_0x30669d[_0x821f('0x48')][_0x821f('0x35')]);_0x6aac71['offset']=qs[_0x821f('0x34')](_0x30669d[_0x821f('0x48')][_0x821f('0x34')]);}return _0x4b1602[_0x821f('0xc4')](_0x6aac71);}})[_0x821f('0x3b')](function(_0x41b42b){if(_0x41b42b){return _0x41b42b?{'count':_0xdd5c19,'rows':_0x41b42b}:null;}})['then'](respondWithResult(_0x22fad6,null))[_0x821f('0x2f')](handleError(_0x22fad6,null));}; \ No newline at end of file +var _0xee2c=['Set','ecm','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','sequelize','VoiceExtension','bulkCreate','updateAccountApplications','update','tech','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','ListId','List\x20not\x20found','out','filename','Messages','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./faxAccount.socket','register','jayson/promise','http','client','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','get','FaxAccounts','UserProfileResource','destroy','stack','name','send','Pause','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','merge','options','FaxAccount','count','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','describe','Disposition','findOne','nolimit','FaxAccountId','filter','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','system','description','appdata','push','CDR(type)=inbound-fax'];(function(_0x3e3472,_0x457290){var _0x348b0d=function(_0x2e751f){while(--_0x2e751f){_0x3e3472['push'](_0x3e3472['shift']());}};_0x348b0d(++_0x457290);}(_0xee2c,0x1c7));var _0xcee2=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xee2c[_0x4ae6ef];return _0x3cbb4e;};'use strict';var pdf=require(_0xcee2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcee2('0x1'));var zipdir=require(_0xcee2('0x2'));var jsonpatch=require(_0xcee2('0x3'));var rp=require(_0xcee2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcee2('0x5'));var util=require(_0xcee2('0x6'));var path=require('path');var sox=require(_0xcee2('0x7'));var csv=require(_0xcee2('0x8'));var ejs=require(_0xcee2('0x9'));var fs=require('fs');var _=require(_0xcee2('0xa'));var squel=require(_0xcee2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcee2('0xc'));var toCsv=require(_0xcee2('0x8'));var querystring=require(_0xcee2('0xd'));var Papa=require(_0xcee2('0xe'));var Redis=require(_0xcee2('0xf'));var authService=require(_0xcee2('0x10'));var qs=require(_0xcee2('0x11'));var as=require(_0xcee2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcee2('0x13'))(_0xcee2('0x14'));var utils=require(_0xcee2('0x15'));var config=require(_0xcee2('0x16'));var db=require(_0xcee2('0x17'))['db'];config['redis']=_[_0xcee2('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcee2('0x19')]));require(_0xcee2('0x1a'))[_0xcee2('0x1b')](socket);var jayson=require(_0xcee2('0x1c'));var client=jayson['client'][_0xcee2('0x1d')]({'port':0x232c});var client9002=jayson[_0xcee2('0x1e')][_0xcee2('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x238da0,_0x1787ec,_0x21a182){if(_0x21a182){var _0x25bdcf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25bdcf[_0xcee2('0x1f')](_0x1787ec)){return _0x238da0;}else{throw new db[(_0xcee2('0x20'))]['ValidationError'](_0xcee2('0x21'));}}else{return _0x238da0;}}function respondWithRpcPromise(_0x548e47,_0x221d75,_0xeae302,_0x2b2ea0){return new BPromise(function(_0x2a52b4,_0x5bb46f){var _0x245811=_0x2b2ea0||client;return _0x245811[_0xcee2('0x22')](_0x548e47,_0xeae302)[_0xcee2('0x23')](function(_0x36af7f){logger[_0xcee2('0x24')](_0xcee2('0x25'),_0x221d75,_0xcee2('0x26'));logger[_0xcee2('0x27')](_0xcee2('0x28'),_0x221d75,_0xcee2('0x26'),JSON[_0xcee2('0x29')](_0x36af7f));if(_0x36af7f['error']){if(_0x36af7f[_0xcee2('0x2a')][_0xcee2('0x2b')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x221d75,_0x36af7f[_0xcee2('0x2a')]['message']);return _0x5bb46f(_0x36af7f[_0xcee2('0x2a')][_0xcee2('0x2c')]);}logger[_0xcee2('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x221d75,_0x36af7f['error'][_0xcee2('0x2c')]);return _0x2a52b4(_0x36af7f[_0xcee2('0x2a')][_0xcee2('0x2c')]);}else{logger['info'](_0xcee2('0x25'),_0x221d75,'request\x20sent');_0x2a52b4(_0x36af7f[_0xcee2('0x2d')][_0xcee2('0x2c')]);}})[_0xcee2('0x2e')](function(_0x21bc84){logger[_0xcee2('0x2a')](_0xcee2('0x25'),_0x221d75,_0x21bc84);_0x5bb46f(_0x21bc84);});});}function respondWithStatusCode(_0xbc2b2e,_0x29be38){_0x29be38=_0x29be38||0xcc;return function(_0x262954){if(_0x262954){return _0xbc2b2e[_0xcee2('0x2f')](_0x29be38);}return _0xbc2b2e[_0xcee2('0x30')](_0x29be38)['end']();};}function respondWithResult(_0x19a99b,_0x3ccff6){_0x3ccff6=_0x3ccff6||0xc8;return function(_0x226910){if(_0x226910){return _0x19a99b['status'](_0x3ccff6)[_0xcee2('0x31')](_0x226910);}};}function respondWithFilteredResult(_0x117342,_0x559816){return function(_0x1e0dfc){if(_0x1e0dfc){var _0x25ead9=_0x1e0dfc['count'],_0x56e23b=_0x559816['offset'],_0x5ee5a5=_0x559816[_0xcee2('0x32')]+_0x559816[_0xcee2('0x33')],_0x1efa5b;if(_0x5ee5a5>=_0x25ead9){_0x5ee5a5=_0x25ead9;_0x1efa5b=0xc8;}else{_0x1efa5b=0xce;}_0x117342['status'](_0x1efa5b);return _0x117342[_0xcee2('0x34')](_0xcee2('0x35'),_0x56e23b+'-'+_0x5ee5a5+'/'+_0x25ead9)[_0xcee2('0x31')](_0x1e0dfc);}return null;};}function patchUpdates(_0x3d0d4b){return function(_0x201c62){try{jsonpatch[_0xcee2('0x36')](_0x201c62,_0x3d0d4b,!![]);}catch(_0x3f727d){return BPromise[_0xcee2('0x37')](_0x3f727d);}return _0x201c62[_0xcee2('0x38')]();};}function saveUpdates(_0x130e40,_0xf1bf9a){return function(_0x2be665){if(_0x2be665){return _0x2be665['update'](_0x130e40)[_0xcee2('0x23')](function(_0x349a2f){return _0x349a2f;});}return null;};}function removeEntity(_0x5ed4a1,_0x19f63d){return function(_0xecdf2c){if(_0xecdf2c){return _0xecdf2c['destroy']()[_0xcee2('0x23')](function(){var _0xf41cf6=_0xecdf2c[_0xcee2('0x39')]({'plain':!![]});var _0x55c19e=_0xcee2('0x3a');return db[_0xcee2('0x3b')][_0xcee2('0x3c')]({'where':{'type':_0x55c19e,'resourceId':_0xf41cf6['id']}})[_0xcee2('0x23')](function(){return _0xecdf2c;});})[_0xcee2('0x23')](function(){_0x5ed4a1[_0xcee2('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x457f39,_0x355f13){return function(_0x4421bb){if(!_0x4421bb){_0x457f39['sendStatus'](0x194);}return _0x4421bb;};}function handleError(_0x1836cd,_0x484955){_0x484955=_0x484955||0x1f4;return function(_0x594eab){logger[_0xcee2('0x2a')](_0x594eab[_0xcee2('0x3d')]);if(_0x594eab[_0xcee2('0x3e')]){delete _0x594eab[_0xcee2('0x3e')];}_0x1836cd[_0xcee2('0x30')](_0x484955)[_0xcee2('0x3f')](_0x594eab);};}exports['index']=function(_0x572ebb,_0x481168){var _0x20d759={'include':[{'model':db[_0xcee2('0x40')],'as':'mandatoryDispositionPause'}]},_0x5dc799={},_0x1cfa4d={'count':0x0,'rows':[]};var _0x15e2ab=_['map'](db['FaxAccount'][_0xcee2('0x41')],function(_0x46880b){return{'name':_0x46880b['fieldName'],'type':_0x46880b['type'][_0xcee2('0x42')]};});_0x5dc799[_0xcee2('0x43')]=_[_0xcee2('0x44')](_0x15e2ab,_0xcee2('0x3e'));_0x5dc799[_0xcee2('0x45')]=_[_0xcee2('0x46')](_0x572ebb[_0xcee2('0x45')]);_0x5dc799[_0xcee2('0x47')]=_[_0xcee2('0x48')](_0x5dc799['model'],_0x5dc799[_0xcee2('0x45')]);_0x20d759[_0xcee2('0x49')]=_[_0xcee2('0x48')](_0x5dc799[_0xcee2('0x43')],qs['fields'](_0x572ebb[_0xcee2('0x45')][_0xcee2('0x4a')]));_0x20d759[_0xcee2('0x49')]=_0x20d759[_0xcee2('0x49')][_0xcee2('0x4b')]?_0x20d759[_0xcee2('0x49')]:_0x5dc799[_0xcee2('0x43')];if(!_0x572ebb[_0xcee2('0x45')][_0xcee2('0x4c')]('nolimit')){_0x20d759[_0xcee2('0x33')]=qs[_0xcee2('0x33')](_0x572ebb[_0xcee2('0x45')]['limit']);_0x20d759[_0xcee2('0x32')]=qs[_0xcee2('0x32')](_0x572ebb[_0xcee2('0x45')][_0xcee2('0x32')]);}_0x20d759[_0xcee2('0x4d')]=qs[_0xcee2('0x4e')](_0x572ebb[_0xcee2('0x45')][_0xcee2('0x4e')]);_0x20d759[_0xcee2('0x4f')]=qs[_0xcee2('0x47')](_[_0xcee2('0x50')](_0x572ebb[_0xcee2('0x45')],_0x5dc799[_0xcee2('0x47')]));if(_0x572ebb[_0xcee2('0x45')]['filter']){_0x20d759[_0xcee2('0x4f')]=_['merge'](_0x20d759['where'],{'$or':_[_0xcee2('0x44')](_0x15e2ab,function(_0x399291){if(_0x399291[_0xcee2('0x51')]!==_0xcee2('0x52')){var _0x295806={};_0x295806[_0x399291['name']]={'$like':'%'+_0x572ebb[_0xcee2('0x45')]['filter']+'%'};return _0x295806;}})});}_0x20d759=_[_0xcee2('0x53')]({},_0x20d759,_0x572ebb[_0xcee2('0x54')]);var _0x465e9a={'where':_0x20d759[_0xcee2('0x4f')]};return db[_0xcee2('0x55')][_0xcee2('0x56')](_0x465e9a)[_0xcee2('0x23')](function(_0x47c526){_0x1cfa4d[_0xcee2('0x56')]=_0x47c526;if(_0x572ebb[_0xcee2('0x45')][_0xcee2('0x57')]){_0x20d759[_0xcee2('0x58')]=[{'all':!![]}];}return db[_0xcee2('0x55')][_0xcee2('0x59')](_0x20d759);})[_0xcee2('0x23')](function(_0x3a1f76){_0x1cfa4d[_0xcee2('0x5a')]=_0x3a1f76;return _0x1cfa4d;})['then'](respondWithFilteredResult(_0x481168,_0x20d759))['catch'](handleError(_0x481168,null));};exports[_0xcee2('0x5b')]=function(_0x54d09,_0x4b888f){var _0x21cfe0={'raw':![],'where':{'id':_0x54d09[_0xcee2('0x5c')]['id']},'include':[{'model':db[_0xcee2('0x40')],'as':_0xcee2('0x5d')}]},_0x2cf58d={};_0x2cf58d[_0xcee2('0x43')]=_[_0xcee2('0x46')](db['FaxAccount']['rawAttributes']);_0x2cf58d['query']=_[_0xcee2('0x46')](_0x54d09[_0xcee2('0x45')]);_0x2cf58d[_0xcee2('0x47')]=_['intersection'](_0x2cf58d[_0xcee2('0x43')],_0x2cf58d[_0xcee2('0x45')]);_0x21cfe0[_0xcee2('0x49')]=_['intersection'](_0x2cf58d[_0xcee2('0x43')],qs[_0xcee2('0x4a')](_0x54d09[_0xcee2('0x45')]['fields']));_0x21cfe0[_0xcee2('0x49')]=_0x21cfe0[_0xcee2('0x49')][_0xcee2('0x4b')]?_0x21cfe0[_0xcee2('0x49')]:_0x2cf58d['model'];if(_0x54d09['query']['includeAll']){_0x21cfe0[_0xcee2('0x58')]=[{'all':!![]}];}_0x21cfe0=_[_0xcee2('0x53')]({},_0x21cfe0,_0x54d09[_0xcee2('0x54')]);return db[_0xcee2('0x55')][_0xcee2('0x5e')](_0x21cfe0)[_0xcee2('0x23')](handleEntityNotFound(_0x4b888f,null))[_0xcee2('0x23')](respondWithResult(_0x4b888f,null))[_0xcee2('0x2e')](handleError(_0x4b888f,null));};exports[_0xcee2('0x5f')]=function(_0x30d3cd,_0x3f4a06){return db['FaxAccount'][_0xcee2('0x5f')](_0x30d3cd[_0xcee2('0x60')],{})[_0xcee2('0x23')](function(_0x1bb852){var _0x289744=_0x30d3cd[_0xcee2('0x61')][_0xcee2('0x39')]({'plain':!![]});if(!_0x289744)throw new Error(_0xcee2('0x62'));if(_0x289744['role']===_0xcee2('0x61')){var _0x1e2c15=_0x1bb852[_0xcee2('0x39')]({'plain':!![]});var _0x251499=_0xcee2('0x3a');return db[_0xcee2('0x63')][_0xcee2('0x5e')]({'where':{'name':_0x251499,'userProfileId':_0x289744[_0xcee2('0x64')]},'raw':!![]})[_0xcee2('0x23')](function(_0x266586){if(_0x266586&&_0x266586['autoAssociation']===0x0){return db['UserProfileResource'][_0xcee2('0x5f')]({'name':_0x1e2c15[_0xcee2('0x3e')],'resourceId':_0x1e2c15['id'],'type':_0x266586[_0xcee2('0x3e')],'sectionId':_0x266586['id']},{})['then'](function(){return _0x1bb852;});}else{return _0x1bb852;}})['catch'](function(_0x566d94){logger[_0xcee2('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x566d94);throw _0x566d94;});}return _0x1bb852;})['then'](respondWithResult(_0x3f4a06,0xc9))[_0xcee2('0x2e')](handleError(_0x3f4a06,null));};exports['update']=function(_0x442cd7,_0x9943ff){if(_0x442cd7['body']['id']){delete _0x442cd7[_0xcee2('0x60')]['id'];}return db[_0xcee2('0x55')]['find']({'where':{'id':_0x442cd7['params']['id']},'include':[{'model':db[_0xcee2('0x40')],'as':_0xcee2('0x5d')}]})[_0xcee2('0x23')](handleEntityNotFound(_0x9943ff,null))[_0xcee2('0x23')](saveUpdates(_0x442cd7[_0xcee2('0x60')],null))['then'](respondWithResult(_0x9943ff,null))[_0xcee2('0x2e')](handleError(_0x9943ff,null));};exports[_0xcee2('0x3c')]=function(_0x3b1b8e,_0xa39d9a){return db[_0xcee2('0x55')][_0xcee2('0x5e')]({'where':{'id':_0x3b1b8e[_0xcee2('0x5c')]['id']}})[_0xcee2('0x23')](handleEntityNotFound(_0xa39d9a,null))[_0xcee2('0x23')](removeEntity(_0xa39d9a,null))[_0xcee2('0x2e')](handleError(_0xa39d9a,null));};exports[_0xcee2('0x65')]=function(_0x216020,_0x5e29c1){return db[_0xcee2('0x55')][_0xcee2('0x65')]()[_0xcee2('0x23')](respondWithResult(_0x5e29c1,null))['catch'](handleError(_0x5e29c1,null));};exports['addDisposition']=function(_0x1c3b64,_0x33767d,_0x25930b){if(_0x1c3b64[_0xcee2('0x60')]['id']){delete _0x1c3b64['body']['id'];}return db['FaxAccount'][_0xcee2('0x5e')]({'where':{'id':_0x1c3b64[_0xcee2('0x5c')]['id']}})[_0xcee2('0x23')](handleEntityNotFound(_0x33767d,null))[_0xcee2('0x23')](function(_0xe75e6e){if(_0xe75e6e){_0x1c3b64['body']['FaxAccountId']=_0xe75e6e['id'];return db[_0xcee2('0x66')][_0xcee2('0x5f')](_0x1c3b64[_0xcee2('0x60')]);}})[_0xcee2('0x23')](respondWithResult(_0x33767d,null))[_0xcee2('0x2e')](handleError(_0x33767d,null));};exports['getDispositions']=function(_0x3796cf,_0x546ad3,_0x38039b){var _0x10a097={'raw':![],'where':{}};var _0x2c9497={};var _0x3f11e2={'count':0x0,'rows':[]};return db['FaxAccount'][_0xcee2('0x67')]({'where':{'id':_0x3796cf['params']['id']}})['then'](handleEntityNotFound(_0x546ad3,null))[_0xcee2('0x23')](function(_0x3d7b5d){if(_0x3d7b5d){_0x2c9497[_0xcee2('0x43')]=_[_0xcee2('0x46')](db['Disposition'][_0xcee2('0x41')]);_0x2c9497['query']=_['keys'](_0x3796cf[_0xcee2('0x45')]);_0x2c9497[_0xcee2('0x47')]=_[_0xcee2('0x48')](_0x2c9497['model'],_0x2c9497[_0xcee2('0x45')]);_0x10a097['attributes']=_[_0xcee2('0x48')](_0x2c9497['model'],qs[_0xcee2('0x4a')](_0x3796cf['query'][_0xcee2('0x4a')]));_0x10a097[_0xcee2('0x49')]=_0x10a097[_0xcee2('0x49')][_0xcee2('0x4b')]?_0x10a097[_0xcee2('0x49')]:_0x2c9497[_0xcee2('0x43')];if(!_0x3796cf[_0xcee2('0x45')][_0xcee2('0x4c')](_0xcee2('0x68'))){_0x10a097[_0xcee2('0x33')]=qs[_0xcee2('0x33')](_0x3796cf[_0xcee2('0x45')][_0xcee2('0x33')]);_0x10a097[_0xcee2('0x32')]=qs[_0xcee2('0x32')](_0x3796cf[_0xcee2('0x45')][_0xcee2('0x32')]);}_0x10a097[_0xcee2('0x4d')]=qs[_0xcee2('0x4e')](_0x3796cf['query'][_0xcee2('0x4e')]);_0x10a097[_0xcee2('0x4f')]=qs['filters'](_[_0xcee2('0x50')](_0x3796cf[_0xcee2('0x45')],_0x2c9497[_0xcee2('0x47')]));_0x10a097[_0xcee2('0x4f')][_0xcee2('0x69')]=_0x3d7b5d['id'];if(_0x3796cf[_0xcee2('0x45')][_0xcee2('0x6a')]){_0x10a097[_0xcee2('0x4f')]=_[_0xcee2('0x53')](_0x10a097[_0xcee2('0x4f')],{'$or':_['map'](_0x10a097[_0xcee2('0x49')],function(_0x4b7729){var _0x109b85={};_0x109b85[_0x4b7729]={'$like':'%'+_0x3796cf[_0xcee2('0x45')][_0xcee2('0x6a')]+'%'};return _0x109b85;})});}_0x10a097=_[_0xcee2('0x53')]({},_0x10a097,_0x3796cf['options']);return db['Disposition'][_0xcee2('0x56')]({'where':_0x10a097['where']})[_0xcee2('0x23')](function(_0x37b2a5){_0x3f11e2[_0xcee2('0x56')]=_0x37b2a5;if(_0x3796cf[_0xcee2('0x45')][_0xcee2('0x57')]){_0x10a097['include']=[{'all':!![]}];}return db['Disposition'][_0xcee2('0x59')](_0x10a097);})[_0xcee2('0x23')](function(_0x5585e2){_0x3f11e2['rows']=_0x5585e2;return _0x3f11e2;});}})[_0xcee2('0x23')](respondWithFilteredResult(_0x546ad3,_0x10a097))[_0xcee2('0x2e')](handleError(_0x546ad3,null));};exports[_0xcee2('0x6b')]=function(_0x5623b8,_0x58b8b7,_0xf2621){return db['FaxAccount']['find']({'where':{'id':_0x5623b8[_0xcee2('0x5c')]['id']}})[_0xcee2('0x23')](handleEntityNotFound(_0x58b8b7,null))[_0xcee2('0x23')](function(_0x3b1962){if(_0x3b1962){return _0x3b1962[_0xcee2('0x6b')](_0x5623b8[_0xcee2('0x45')][_0xcee2('0x6c')]);}})[_0xcee2('0x23')](respondWithStatusCode(_0x58b8b7,null))[_0xcee2('0x2e')](handleError(_0x58b8b7,null));};exports[_0xcee2('0x6d')]=function(_0x21bbb5,_0x27f8d7,_0x23576e){if(_0x21bbb5[_0xcee2('0x60')]['id']){delete _0x21bbb5['body']['id'];}return db[_0xcee2('0x55')][_0xcee2('0x5e')]({'where':{'id':_0x21bbb5['params']['id']}})[_0xcee2('0x23')](handleEntityNotFound(_0x27f8d7,null))[_0xcee2('0x23')](function(_0x472e15){if(_0x472e15){_0x21bbb5['body']['FaxAccountId']=_0x472e15['id'];return db['CannedAnswer'][_0xcee2('0x5f')](_0x21bbb5[_0xcee2('0x60')]);}})[_0xcee2('0x23')](respondWithResult(_0x27f8d7,null))[_0xcee2('0x2e')](handleError(_0x27f8d7,null));};exports['getAnswers']=function(_0x4a505f,_0x130b70,_0x228b27){var _0x42cd1d={'raw':![],'where':{}};var _0x255f8a={};var _0x10c8c4={'count':0x0,'rows':[]};return db['FaxAccount'][_0xcee2('0x67')]({'where':{'id':_0x4a505f[_0xcee2('0x5c')]['id']}})[_0xcee2('0x23')](handleEntityNotFound(_0x130b70,null))['then'](function(_0x19c2e4){if(_0x19c2e4){_0x255f8a[_0xcee2('0x43')]=_['keys'](db[_0xcee2('0x6e')]['rawAttributes']);_0x255f8a[_0xcee2('0x45')]=_[_0xcee2('0x46')](_0x4a505f[_0xcee2('0x45')]);_0x255f8a[_0xcee2('0x47')]=_[_0xcee2('0x48')](_0x255f8a['model'],_0x255f8a['query']);_0x42cd1d[_0xcee2('0x49')]=_[_0xcee2('0x48')](_0x255f8a['model'],qs[_0xcee2('0x4a')](_0x4a505f[_0xcee2('0x45')][_0xcee2('0x4a')]));_0x42cd1d[_0xcee2('0x49')]=_0x42cd1d[_0xcee2('0x49')]['length']?_0x42cd1d[_0xcee2('0x49')]:_0x255f8a[_0xcee2('0x43')];if(!_0x4a505f[_0xcee2('0x45')][_0xcee2('0x4c')]('nolimit')){_0x42cd1d[_0xcee2('0x33')]=qs[_0xcee2('0x33')](_0x4a505f[_0xcee2('0x45')][_0xcee2('0x33')]);_0x42cd1d[_0xcee2('0x32')]=qs[_0xcee2('0x32')](_0x4a505f[_0xcee2('0x45')][_0xcee2('0x32')]);}_0x42cd1d[_0xcee2('0x4d')]=qs[_0xcee2('0x4e')](_0x4a505f[_0xcee2('0x45')][_0xcee2('0x4e')]);_0x42cd1d[_0xcee2('0x4f')]=qs[_0xcee2('0x47')](_[_0xcee2('0x50')](_0x4a505f['query'],_0x255f8a[_0xcee2('0x47')]));_0x42cd1d[_0xcee2('0x4f')][_0xcee2('0x69')]=_0x19c2e4['id'];if(_0x4a505f['query'][_0xcee2('0x6a')]){_0x42cd1d[_0xcee2('0x4f')]=_['merge'](_0x42cd1d[_0xcee2('0x4f')],{'$or':_['map'](_0x42cd1d[_0xcee2('0x49')],function(_0x178edd){var _0x257650={};_0x257650[_0x178edd]={'$like':'%'+_0x4a505f[_0xcee2('0x45')][_0xcee2('0x6a')]+'%'};return _0x257650;})});}_0x42cd1d=_[_0xcee2('0x53')]({},_0x42cd1d,_0x4a505f[_0xcee2('0x54')]);return db[_0xcee2('0x6e')][_0xcee2('0x56')]({'where':_0x42cd1d[_0xcee2('0x4f')]})[_0xcee2('0x23')](function(_0x292045){_0x10c8c4[_0xcee2('0x56')]=_0x292045;if(_0x4a505f[_0xcee2('0x45')]['includeAll']){_0x42cd1d[_0xcee2('0x58')]=[{'all':!![]}];}return db[_0xcee2('0x6e')]['findAll'](_0x42cd1d);})[_0xcee2('0x23')](function(_0x37d4eb){_0x10c8c4[_0xcee2('0x5a')]=_0x37d4eb;return _0x10c8c4;});}})[_0xcee2('0x23')](respondWithFilteredResult(_0x130b70,_0x42cd1d))[_0xcee2('0x2e')](handleError(_0x130b70,null));};exports[_0xcee2('0x6f')]=function(_0x1fce50,_0x22c366,_0xd92ae7){return db[_0xcee2('0x55')][_0xcee2('0x5e')]({'where':{'id':_0x1fce50[_0xcee2('0x5c')]['id']}})[_0xcee2('0x23')](handleEntityNotFound(_0x22c366,null))['then'](function(_0x2f988a){if(_0x2f988a){return _0x2f988a['removeAnswers'](_0x1fce50['query'][_0xcee2('0x6c')]);}})['then'](respondWithStatusCode(_0x22c366,null))[_0xcee2('0x2e')](handleError(_0x22c366,null));};exports[_0xcee2('0x70')]=function(_0x137350,_0x437bf4,_0x381dd9){return db[_0xcee2('0x71')][_0xcee2('0x5e')]({'where':{'id':_0x137350[_0xcee2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x437bf4,null))[_0xcee2('0x23')](function(_0x2b8aef){if(_0x2b8aef){return _0x2b8aef[_0xcee2('0x70')](_0x137350[_0xcee2('0x60')][_0xcee2('0x6c')],_[_0xcee2('0x72')](_0x137350['body'],[_0xcee2('0x6c'),'id'])||{});}})[_0xcee2('0x23')](respondWithResult(_0x437bf4,null))[_0xcee2('0x2e')](handleError(_0x437bf4,null));};exports['getInteractions']=function(_0x165d72,_0x4995bc,_0x189502){var _0x26e538={'raw':![],'where':{}};var _0x4eea10={};var _0x18b5a5={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x165d72['params']['id']}})['then'](handleEntityNotFound(_0x4995bc,null))[_0xcee2('0x23')](function(_0x54660c){if(_0x54660c){_0x4eea10[_0xcee2('0x43')]=_[_0xcee2('0x46')](db[_0xcee2('0x71')][_0xcee2('0x41')]);_0x4eea10[_0xcee2('0x45')]=_[_0xcee2('0x46')](_0x165d72[_0xcee2('0x45')]);_0x4eea10[_0xcee2('0x47')]=_['intersection'](_0x4eea10[_0xcee2('0x43')],_0x4eea10['query']);_0x26e538['attributes']=_[_0xcee2('0x48')](_0x4eea10[_0xcee2('0x43')],qs['fields'](_0x165d72[_0xcee2('0x45')][_0xcee2('0x4a')]));_0x26e538[_0xcee2('0x49')]=_0x26e538['attributes']['length']?_0x26e538['attributes']:_0x4eea10[_0xcee2('0x43')];if(!_0x165d72[_0xcee2('0x45')]['hasOwnProperty'](_0xcee2('0x68'))){_0x26e538[_0xcee2('0x33')]=qs[_0xcee2('0x33')](_0x165d72['query'][_0xcee2('0x33')]);_0x26e538[_0xcee2('0x32')]=qs['offset'](_0x165d72['query']['offset']);}_0x26e538[_0xcee2('0x4d')]=qs[_0xcee2('0x4e')](_0x165d72[_0xcee2('0x45')][_0xcee2('0x4e')]);_0x26e538[_0xcee2('0x4f')]=qs[_0xcee2('0x47')](_[_0xcee2('0x50')](_0x165d72[_0xcee2('0x45')],_0x4eea10[_0xcee2('0x47')]));_0x26e538[_0xcee2('0x4f')]['FaxAccountId']=_0x54660c['id'];if(_0x165d72[_0xcee2('0x45')]['filter']){_0x26e538[_0xcee2('0x4f')]=_[_0xcee2('0x53')](_0x26e538['where'],{'$or':_['map'](_0x26e538[_0xcee2('0x49')],function(_0x4bcb26){var _0x135d6b={};_0x135d6b[_0x4bcb26]={'$like':'%'+_0x165d72[_0xcee2('0x45')][_0xcee2('0x6a')]+'%'};return _0x135d6b;})});}_0x26e538=_[_0xcee2('0x53')]({},_0x26e538,_0x165d72[_0xcee2('0x54')]);return db[_0xcee2('0x71')][_0xcee2('0x56')]({'where':_0x26e538[_0xcee2('0x4f')]})[_0xcee2('0x23')](function(_0xb7018c){_0x18b5a5[_0xcee2('0x56')]=_0xb7018c;if(_0x165d72[_0xcee2('0x45')][_0xcee2('0x57')]){_0x26e538[_0xcee2('0x58')]=[{'model':db[_0xcee2('0x73')],'as':_0xcee2('0x74'),'required':![]},{'model':db[_0xcee2('0x75')],'as':_0xcee2('0x76'),'attributes':[_0xcee2('0x3e'),_0xcee2('0x77'),_0xcee2('0x78')],'required':![]},{'model':db[_0xcee2('0x79')],'as':'Tags','attributes':['id',_0xcee2('0x3e'),_0xcee2('0x7a')],'where':_0x165d72['query']['tag']?{'id':_0x165d72[_0xcee2('0x45')][_0xcee2('0x7b')]}:undefined,'required':_0x165d72[_0xcee2('0x45')]['tag']?!![]:![]}];}return db[_0xcee2('0x71')][_0xcee2('0x59')](_0x26e538);})[_0xcee2('0x23')](function(_0x4c9b18){_0x18b5a5[_0xcee2('0x5a')]=_0x4c9b18;return _0x18b5a5;});}})[_0xcee2('0x23')](respondWithFilteredResult(_0x4995bc,_0x26e538))['catch'](handleError(_0x4995bc,null));};exports[_0xcee2('0x7c')]=function(_0x464d9a,_0x49bac9,_0x4a75eb){return db[_0xcee2('0x55')][_0xcee2('0x67')]({'where':{'id':_0x464d9a[_0xcee2('0x5c')]['id']}})[_0xcee2('0x23')](handleEntityNotFound(_0x49bac9,null))[_0xcee2('0x23')](function(_0x24f20a){if(_0x24f20a){return db['sequelize'][_0xcee2('0x7d')](function(_0x2636ed){return db[_0xcee2('0x7e')][_0xcee2('0x3c')]({'where':{'FaxAccountId':_0x464d9a[_0xcee2('0x5c')]['id']},'transaction':_0x2636ed})['then'](function(_0x22a634){var _0x2a1555=_[_0xcee2('0x44')](_0x464d9a[_0xcee2('0x60')],function(_0x40f34d){_0x40f34d[_0xcee2('0x69')]=_0x464d9a[_0xcee2('0x5c')]['id'];return _0x40f34d;});return db[_0xcee2('0x7e')]['bulkCreate'](_0x2a1555,{'transaction':_0x2636ed});});})[_0xcee2('0x23')](function(){return db['FaxApplication'][_0xcee2('0x7f')]({'where':{'FaxAccountId':_0x464d9a[_0xcee2('0x5c')]['id']},'order':_0xcee2('0x80')});});}})['then'](respondWithResult(_0x49bac9,null))['catch'](handleError(_0x49bac9,null));};exports[_0xcee2('0x81')]=function(_0x14fd28,_0x139c18,_0xc7b478){var _0x15e568={};var _0x26d93f={};var _0x2389e5;var _0x1068ee;return db[_0xcee2('0x55')][_0xcee2('0x67')]({'where':{'id':_0x14fd28[_0xcee2('0x5c')]['id']}})[_0xcee2('0x23')](handleEntityNotFound(_0x139c18,null))[_0xcee2('0x23')](function(_0x302d2c){if(_0x302d2c){_0x2389e5=_0x302d2c;_0x26d93f['model']=_[_0xcee2('0x46')](db[_0xcee2('0x7e')]['rawAttributes']);_0x26d93f[_0xcee2('0x45')]=_['keys'](_0x14fd28['query']);_0x26d93f[_0xcee2('0x47')]=_[_0xcee2('0x48')](_0x26d93f[_0xcee2('0x43')],_0x26d93f[_0xcee2('0x45')]);_0x15e568[_0xcee2('0x49')]=_['intersection'](_0x26d93f[_0xcee2('0x43')],qs[_0xcee2('0x4a')](_0x14fd28[_0xcee2('0x45')]['fields']));_0x15e568[_0xcee2('0x49')]=_0x15e568['attributes'][_0xcee2('0x4b')]?_0x15e568[_0xcee2('0x49')]:_0x26d93f['model'];_0x15e568[_0xcee2('0x4d')]=qs[_0xcee2('0x4e')](_0x14fd28[_0xcee2('0x45')]['sort']);_0x15e568[_0xcee2('0x4f')]=qs[_0xcee2('0x47')](_[_0xcee2('0x50')](_0x14fd28[_0xcee2('0x45')],_0x26d93f[_0xcee2('0x47')]));if(_0x14fd28['query']['filter']){_0x15e568['where']=_[_0xcee2('0x53')](_0x15e568['where'],{'$or':_[_0xcee2('0x44')](_0x15e568['attributes'],function(_0x2dee62){var _0x591092={};_0x591092[_0x2dee62]={'$like':'%'+_0x14fd28[_0xcee2('0x45')][_0xcee2('0x6a')]+'%'};return _0x591092;})});}_0x15e568=_[_0xcee2('0x53')]({},_0x15e568,_0x14fd28['options']);return _0x2389e5[_0xcee2('0x81')](_0x15e568);}})[_0xcee2('0x23')](function(_0x4d1124){if(_0x4d1124){_0x1068ee=_0x4d1124['length'];if(!_0x14fd28[_0xcee2('0x45')][_0xcee2('0x4c')](_0xcee2('0x68'))){_0x15e568[_0xcee2('0x33')]=qs[_0xcee2('0x33')](_0x14fd28[_0xcee2('0x45')]['limit']);_0x15e568[_0xcee2('0x32')]=qs[_0xcee2('0x32')](_0x14fd28[_0xcee2('0x45')][_0xcee2('0x32')]);}return _0x2389e5['getApplications'](_0x15e568);}})[_0xcee2('0x23')](function(_0xd7881c){if(_0xd7881c){return _0xd7881c?{'count':_0x1068ee,'rows':_0xd7881c}:null;}})[_0xcee2('0x23')](respondWithResult(_0x139c18,null))[_0xcee2('0x2e')](handleError(_0x139c18,null));};function Extension(_0x5d5438,_0x543a59,_0x12c886,_0x30161c){this[_0xcee2('0x82')]=_0xcee2('0x83');this[_0xcee2('0x84')]=_0x5d5438[_0xcee2('0x85')];this['app']=_0x30161c;this[_0xcee2('0x51')]=_0xcee2('0x86');this[_0xcee2('0x87')]='Fax\x20Extension';this['FaxAccountId']=_0x5d5438['id'];this[_0xcee2('0x80')]=_0x543a59;this[_0xcee2('0x88')]=_0x12c886;}function createExtensionsReciveFax(_0x29a85b){var _0x53890c=0x1;var _0x1e7b05=[];_0x1e7b05[_0xcee2('0x89')](new Extension(_0x29a85b,_0x53890c,'','Answer'));_0x53890c+=0x1;_0x1e7b05[_0xcee2('0x89')](new Extension(_0x29a85b,_0x53890c,_0xcee2('0x8a'),_0xcee2('0x8b')));_0x53890c+=0x1;for(var _0x10270c in _0x29a85b){if(_0x29a85b['hasOwnProperty'](_0x10270c)&&(_0x10270c===_0xcee2('0x8c')||_0x10270c===_0xcee2('0x85')||_0x10270c==='gateway'||_0x10270c===_0xcee2('0x8d')||_0x10270c===_0xcee2('0x8e')||_0x10270c===_0xcee2('0x8f')||_0x10270c===_0xcee2('0x90')||_0x10270c===_0xcee2('0x91')||_0x10270c===_0xcee2('0x92'))){_0x1e7b05[_0xcee2('0x89')](new Extension(_0x29a85b,_0x53890c,_0xcee2('0x93')+_0x10270c+')='+_0x29a85b[_0x10270c],_0xcee2('0x8b')));_0x53890c+=0x1;}}_0x1e7b05['push'](new Extension(_0x29a85b,_0x53890c,'6',_0xcee2('0x94')));_0x53890c+=0x1;_0x1e7b05[_0xcee2('0x89')](new Extension(_0x29a85b,_0x53890c,_0xcee2('0x95'),_0xcee2('0x96')));_0x53890c=0x0;return _0x1e7b05;}exports[_0xcee2('0x97')]=function(_0x1e43d9,_0x4ae75d,_0x939a1){var _0x9fb2d7;return db[_0xcee2('0x98')][_0xcee2('0x7d')](function(_0x1108b8){return db[_0xcee2('0x55')][_0xcee2('0x5f')](_0x1e43d9['body'],{'transaction':_0x1108b8})['then'](function(_0x1de75d){_0x9fb2d7=_0x1de75d[_0xcee2('0x39')]({'plain':!![]});return db[_0xcee2('0x99')][_0xcee2('0x9a')](createExtensionsReciveFax(_0x9fb2d7),{'transaction':_0x1108b8});});})['then'](function(){return _0x9fb2d7;})[_0xcee2('0x23')](respondWithResult(_0x4ae75d,null))[_0xcee2('0x2e')](handleError(_0x4ae75d,null));};exports[_0xcee2('0x9b')]=function(_0x181f6b,_0x46c742,_0x33594b){var _0x2f8246;return db['sequelize'][_0xcee2('0x7d')](function(_0x4bd08b){return db[_0xcee2('0x55')][_0xcee2('0x9c')](_0x181f6b['body'],{'where':{'id':_0x181f6b['body']['id']},'transaction':_0x4bd08b})[_0xcee2('0x23')](function(_0x22df30){return db[_0xcee2('0x99')][_0xcee2('0x3c')]({'where':{'FaxAccountId':_0x181f6b[_0xcee2('0x60')]['id']},'transaction':_0x4bd08b})[_0xcee2('0x23')](function(_0x8b305d){return db['VoiceExtension'][_0xcee2('0x9a')](createExtensionsReciveFax(_[_0xcee2('0x72')](_0x181f6b['body'],[_0xcee2('0x9d'),_0xcee2('0x42'),_0xcee2('0x9e'),_0xcee2('0x9f'),_0xcee2('0xa0'),'ListId'])),{'transaction':_0x4bd08b});});});})[_0xcee2('0x23')](function(){return db['FaxAccount'][_0xcee2('0xa1')](_0x181f6b['body']['id']);})['then'](respondWithResult(_0x46c742,null))[_0xcee2('0x2e')](handleError(_0x46c742,null));};exports[_0xcee2('0xa2')]=function(_0x1d4740,_0x3ff21a,_0x4b2a5f){var _0x5d3a12={'raw':!![],'where':{}};var _0x2a6149={};var _0x34915c={'count':0x0,'rows':[]};return db[_0xcee2('0x55')][_0xcee2('0x67')]({'where':{'id':_0x1d4740['params']['id']}})[_0xcee2('0x23')](handleEntityNotFound(_0x3ff21a,null))[_0xcee2('0x23')](function(_0x4ed56d){if(_0x4ed56d){_0x2a6149[_0xcee2('0x43')]=_[_0xcee2('0x46')](db[_0xcee2('0xa3')][_0xcee2('0x41')]);_0x2a6149[_0xcee2('0x45')]=_[_0xcee2('0x46')](_0x1d4740['query']);_0x2a6149[_0xcee2('0x47')]=_[_0xcee2('0x48')](_0x2a6149['model'],_0x2a6149[_0xcee2('0x45')]);_0x5d3a12[_0xcee2('0x49')]=_[_0xcee2('0x48')](_0x2a6149[_0xcee2('0x43')],qs[_0xcee2('0x4a')](_0x1d4740['query'][_0xcee2('0x4a')]));_0x5d3a12['attributes']=_0x5d3a12['attributes'][_0xcee2('0x4b')]?_0x5d3a12[_0xcee2('0x49')]:_0x2a6149[_0xcee2('0x43')];if(!_0x1d4740[_0xcee2('0x45')][_0xcee2('0x4c')](_0xcee2('0x68'))){_0x5d3a12['limit']=qs[_0xcee2('0x33')](_0x1d4740['query'][_0xcee2('0x33')]);_0x5d3a12[_0xcee2('0x32')]=qs[_0xcee2('0x32')](_0x1d4740['query'][_0xcee2('0x32')]);}_0x5d3a12['order']=qs['sort'](_0x1d4740['query']['sort']);_0x5d3a12[_0xcee2('0x4f')]=qs[_0xcee2('0x47')](_['pick'](_0x1d4740['query'],_0x2a6149[_0xcee2('0x47')]));_0x5d3a12[_0xcee2('0x4f')][_0xcee2('0x69')]=_0x4ed56d['id'];if(_0x1d4740[_0xcee2('0x45')][_0xcee2('0x6a')]){_0x5d3a12[_0xcee2('0x4f')]=_[_0xcee2('0x53')](_0x5d3a12[_0xcee2('0x4f')],{'$or':_[_0xcee2('0x44')](_0x5d3a12[_0xcee2('0x49')],function(_0x58c767){var _0x32a95e={};_0x32a95e[_0x58c767]={'$like':'%'+_0x1d4740[_0xcee2('0x45')][_0xcee2('0x6a')]+'%'};return _0x32a95e;})});}if(_0x1d4740[_0xcee2('0x45')][_0xcee2('0xa4')]){var _0x565064=_0x1d4740[_0xcee2('0x45')][_0xcee2('0xa4')][_0xcee2('0xa5')](',');var _0x574ee0={};_0x574ee0[_0x565064[0x0]]={'$gte':moment(_0x565064[0x1])[_0xcee2('0xa6')](_0xcee2('0xa7'))};_0x5d3a12[_0xcee2('0x4f')]=_['merge'](_0x5d3a12['where'],_0x574ee0);}_0x5d3a12=_[_0xcee2('0x53')]({},_0x5d3a12,_0x1d4740['options']);return db[_0xcee2('0xa3')][_0xcee2('0x56')]({'where':_0x5d3a12[_0xcee2('0x4f')]})[_0xcee2('0x23')](function(_0x598f47){_0x34915c['count']=_0x598f47;if(_0x1d4740[_0xcee2('0x45')][_0xcee2('0x57')]){_0x5d3a12[_0xcee2('0x58')]=[{'all':!![]}];}return db[_0xcee2('0xa3')][_0xcee2('0x59')](_0x5d3a12);})['then'](function(_0x3d227b){_0x34915c[_0xcee2('0x5a')]=_0x3d227b;return _0x34915c;});}})[_0xcee2('0x23')](respondWithFilteredResult(_0x3ff21a,_0x5d3a12))[_0xcee2('0x2e')](handleError(_0x3ff21a,null));};exports[_0xcee2('0x3f')]=function(_0x3d07a2,_0x271ad0,_0xcea638){var _0xf07e01,_0x1dcf0c={},_0x2c6e95;if(_0x3d07a2['body']['to']){_0x2c6e95=_0x3d07a2['body']['to'][0x0];}return db[_0xcee2('0x55')]['find']({'where':{'id':_0x3d07a2['params']['id']},'include':[{'model':db[_0xcee2('0xa8')],'as':_0xcee2('0xa9'),'include':[{'model':db[_0xcee2('0x73')],'as':_0xcee2('0xaa'),'where':{'fax':_0x2c6e95},'limit':0x1,'order':[[_0xcee2('0x9f'),_0xcee2('0xab')]]}]}]})['then'](handleEntityNotFound(_0x271ad0,null))[_0xcee2('0x23')](function(_0x3eda1a){_0xf07e01=_0x3eda1a;if(_0x3d07a2[_0xcee2('0x60')][_0xcee2('0xac')]&&_0x3d07a2['body']['attachments'][_0xcee2('0x4b')]){for(var _0x3a5f55=0x0;_0x3a5f55<_0x3d07a2[_0xcee2('0x60')][_0xcee2('0xac')]['length'];_0x3a5f55+=0x1){_0x3d07a2['body']['attachments'][_0x3a5f55]={'filename':_0x3d07a2['body'][_0xcee2('0xac')][_0x3a5f55][_0xcee2('0x3e')],'id':_0x3d07a2[_0xcee2('0x60')][_0xcee2('0xac')][_0x3a5f55]['id'],'path':path[_0xcee2('0xad')](config['root'],_0xcee2('0xae'),_0x3d07a2[_0xcee2('0x60')][_0xcee2('0xac')][_0x3a5f55][_0xcee2('0xaf')])};}}return respondWithRpcPromise('CheckAfterSend',_0xcee2('0xb0'),{'FaxAccountId':_[_0xcee2('0xb1')](_0x3d07a2[_0xcee2('0x5c')]['id'])?undefined:_0x3d07a2['params']['id'],'path':_['isNil'](_0x3d07a2['body'][_0xcee2('0xac')][0x0][_0xcee2('0xb2')])?undefined:_0x3d07a2['body'][_0xcee2('0xac')][0x0][_0xcee2('0xb2')],'fax':_['isNil'](_0x3d07a2[_0xcee2('0x60')]['to'][0x0])?undefined:_0x3d07a2[_0xcee2('0x60')]['to'][0x0]},client9002);})[_0xcee2('0x23')](function(){if(_0xf07e01){if(_['isNil'](_0x3d07a2['body']['from'])){_0x3d07a2['body'][_0xcee2('0xb3')]=util[_0xcee2('0xa6')](_0xcee2('0xb4'),_0xf07e01[_0xcee2('0x3e')],_0xf07e01['fax']);}if(_0xf07e01['List']){if(_0xf07e01[_0xcee2('0xa9')][_0xcee2('0xaa')]['length']){return _0xf07e01[_0xcee2('0xa9')]['Contacts'][0x0];}else{return db[_0xcee2('0x73')][_0xcee2('0x5f')](_[_0xcee2('0x18')](_0x3d07a2['body'],{'firstName':_0x3d07a2[_0xcee2('0x60')]['to'][0x0],'phone':_0x3d07a2[_0xcee2('0x60')]['to'][0x0],'fax':_0x3d07a2[_0xcee2('0x60')]['to'][0x0],'ListId':_0xf07e01[_0xcee2('0xb5')]}));}}else{throw new Error(_0xcee2('0xb6'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xcee2('0x23')](function(_0x43a898){if(_0x43a898){return db[_0xcee2('0x71')][_0xcee2('0x5e')]({'where':{'ContactId':_0x43a898['id'],'closed':![],'FaxAccountId':_0xf07e01['id']}})[_0xcee2('0x23')](function(_0x46d9ef){if(_0x46d9ef){return[_0x46d9ef,![]];}return db['FaxInteraction'][_0xcee2('0x5f')]({'UserId':_0x3d07a2[_0xcee2('0x61')]['id'],'ContactId':_0x43a898['id'],'FaxAccountId':_0xf07e01['id'],'fax':_0x3d07a2[_0xcee2('0x60')]['to'][0x0],'firstMsgDirection':_0xcee2('0xb7'),'Messages':[_['merge'](_0x3d07a2[_0xcee2('0x60')],{'read':![],'body':_0x3d07a2[_0xcee2('0x60')][_0xcee2('0xac')][0x0][_0xcee2('0xb8')],'FaxAccountId':_0xf07e01['id'],'UserId':_0x3d07a2[_0xcee2('0x61')]['id'],'ContactId':_0x43a898['id'],'AttachmentId':_0x3d07a2[_0xcee2('0x60')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xcee2('0xa3')],'as':_0xcee2('0xb9')}]})[_0xcee2('0x23')](function(_0x5f295f){return[_0x5f295f,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x53ca73,_0x607f91){if(_0x607f91){return _0x53ca73;}return db['FaxMessage'][_0xcee2('0x5f')]({'direction':_0xcee2('0xb7'),'read':![],'body':_0x3d07a2['body']['attachments'][0x0][_0xcee2('0xb8')],'FaxAccountId':_0xf07e01['id'],'FaxInteractionId':_0x53ca73['id'],'UserId':_0x3d07a2['user']['id'],'ContactId':_0x53ca73[_0xcee2('0xba')],'AttachmentId':_0x3d07a2[_0xcee2('0x60')]['attachments'][0x0]['id']})['then'](function(_0x14eeff){_0x53ca73['dataValues']['Messages']=[];_0x53ca73['dataValues'][_0xcee2('0xb9')][_0xcee2('0x89')](_0x14eeff[_0xcee2('0xbb')]);return _0x53ca73;});})[_0xcee2('0x23')](function(_0x538c57){respondWithRpcPromise(_0xcee2('0xbc'),_0xcee2('0xbc'),{'FaxAccountId':_[_0xcee2('0xb1')](_0x3d07a2[_0xcee2('0x5c')]['id'])?undefined:_0x3d07a2[_0xcee2('0x5c')]['id'],'path':_[_0xcee2('0xb1')](_0x3d07a2[_0xcee2('0x60')][_0xcee2('0xac')][0x0][_0xcee2('0xb2')])?undefined:_0x3d07a2[_0xcee2('0x60')][_0xcee2('0xac')][0x0][_0xcee2('0xb2')],'fax':_[_0xcee2('0xb1')](_0x3d07a2['body']['to'][0x0])?undefined:_0x3d07a2[_0xcee2('0x60')]['to'][0x0],'AttachmentId':_0x3d07a2['body'][_0xcee2('0xac')][0x0]['id']},client9002)[_0xcee2('0x23')](function(_0x49cf46){logger[_0xcee2('0x24')]('SendFaxRpc,\x20%s',_0x49cf46);})['catch'](function(_0x43042b){logger['info'](_0xcee2('0xbd'),_0x43042b);});return _0x538c57;})[_0xcee2('0x23')](respondWithResult(_0x271ad0,null))[_0xcee2('0x2e')](handleError(_0x271ad0,null));};exports[_0xcee2('0xbe')]=function(_0x5acad1,_0x36e18d,_0x59a0ea){return db[_0xcee2('0x55')][_0xcee2('0x5e')]({'where':{'id':_0x5acad1[_0xcee2('0x5c')]['id']}})[_0xcee2('0x23')](handleEntityNotFound(_0x36e18d,null))['then'](function(_0x5dbf77){if(_0x5dbf77){return _0x5dbf77['addAgents'](_0x5acad1[_0xcee2('0x60')][_0xcee2('0x6c')],_[_0xcee2('0x72')](_0x5acad1[_0xcee2('0x60')],[_0xcee2('0x6c'),'id'])||{})[_0xcee2('0xbf')](function(_0x3bdb32){for(var _0x28c709=0x0;_0x28c709<_0x5acad1['body']['ids'][_0xcee2('0x4b')];_0x28c709+=0x1){socket[_0xcee2('0xc0')](_0xcee2('0xc1'),{'UserId':_0x5acad1[_0xcee2('0x60')][_0xcee2('0x6c')][_0x28c709],'FaxAccountId':_0x5acad1[_0xcee2('0x5c')]['id']});}return _0x3bdb32;});}})[_0xcee2('0x23')](respondWithResult(_0x36e18d,null))[_0xcee2('0x2e')](handleError(_0x36e18d,null));};exports['removeAgents']=function(_0x4d5fb2,_0x2663ee,_0x2fcf8c){return db[_0xcee2('0x55')][_0xcee2('0x5e')]({'where':{'id':_0x4d5fb2[_0xcee2('0x5c')]['id']}})[_0xcee2('0x23')](handleEntityNotFound(_0x2663ee,null))[_0xcee2('0x23')](function(_0x158598){if(_0x158598){return _0x158598[_0xcee2('0xc2')](_0x4d5fb2[_0xcee2('0x45')][_0xcee2('0x6c')])[_0xcee2('0x23')](function(){if(_[_0xcee2('0xc3')](_0x4d5fb2['query'][_0xcee2('0x6c')])){for(var _0x282634=0x0;_0x282634<_0x4d5fb2[_0xcee2('0x45')][_0xcee2('0x6c')][_0xcee2('0x4b')];_0x282634+=0x1){socket[_0xcee2('0xc0')](_0xcee2('0xc4'),{'UserId':Number(_0x4d5fb2[_0xcee2('0x45')][_0xcee2('0x6c')][_0x282634]),'FaxAccountId':Number(_0x4d5fb2[_0xcee2('0x5c')]['id'])});}}else{socket[_0xcee2('0xc0')](_0xcee2('0xc4'),{'UserId':Number(_0x4d5fb2[_0xcee2('0x45')][_0xcee2('0x6c')]),'FaxAccountId':Number(_0x4d5fb2[_0xcee2('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x2663ee,null))[_0xcee2('0x2e')](handleError(_0x2663ee,null));};exports[_0xcee2('0xc5')]=function(_0x2b8304,_0x4a0e14,_0x4bb600){var _0xa449d={};var _0x43e1a5={};var _0xe3a87a;var _0xe6bed5;return db[_0xcee2('0x55')][_0xcee2('0x67')]({'where':{'id':_0x2b8304[_0xcee2('0x5c')]['id']}})[_0xcee2('0x23')](handleEntityNotFound(_0x4a0e14,null))[_0xcee2('0x23')](function(_0x28a879){if(_0x28a879){_0xe3a87a=_0x28a879;_0x43e1a5[_0xcee2('0x43')]=_['keys'](db[_0xcee2('0x75')][_0xcee2('0x41')]);_0x43e1a5[_0xcee2('0x45')]=_[_0xcee2('0x46')](_0x2b8304[_0xcee2('0x45')]);_0x43e1a5['filters']=_[_0xcee2('0x48')](_0x43e1a5[_0xcee2('0x43')],_0x43e1a5[_0xcee2('0x45')]);_0xa449d[_0xcee2('0x49')]=_[_0xcee2('0x48')](_0x43e1a5[_0xcee2('0x43')],qs[_0xcee2('0x4a')](_0x2b8304[_0xcee2('0x45')][_0xcee2('0x4a')]));_0xa449d[_0xcee2('0x49')]=_0xa449d[_0xcee2('0x49')][_0xcee2('0x4b')]?_0xa449d['attributes']:_0x43e1a5['model'];_0xa449d[_0xcee2('0x4d')]=qs[_0xcee2('0x4e')](_0x2b8304[_0xcee2('0x45')]['sort']);_0xa449d[_0xcee2('0x4f')]=qs[_0xcee2('0x47')](_['pick'](_0x2b8304[_0xcee2('0x45')],_0x43e1a5[_0xcee2('0x47')]));if(_0x2b8304[_0xcee2('0x45')][_0xcee2('0x6a')]){_0xa449d[_0xcee2('0x4f')]=_[_0xcee2('0x53')](_0xa449d[_0xcee2('0x4f')],{'$or':_['map'](_0xa449d['attributes'],function(_0x11be4c){var _0x2a9439={};_0x2a9439[_0x11be4c]={'$like':'%'+_0x2b8304[_0xcee2('0x45')][_0xcee2('0x6a')]+'%'};return _0x2a9439;})});}_0xa449d=_[_0xcee2('0x53')]({},_0xa449d,_0x2b8304[_0xcee2('0x54')]);return _0xe3a87a['getAgents'](_0xa449d);}})[_0xcee2('0x23')](function(_0x24d266){if(_0x24d266){_0xe6bed5=_0x24d266['length'];if(!_0x2b8304[_0xcee2('0x45')][_0xcee2('0x4c')](_0xcee2('0x68'))){_0xa449d['limit']=qs['limit'](_0x2b8304['query'][_0xcee2('0x33')]);_0xa449d[_0xcee2('0x32')]=qs[_0xcee2('0x32')](_0x2b8304[_0xcee2('0x45')][_0xcee2('0x32')]);}return _0xe3a87a['getAgents'](_0xa449d);}})[_0xcee2('0x23')](function(_0x4a823d){if(_0x4a823d){return _0x4a823d?{'count':_0xe6bed5,'rows':_0x4a823d}:null;}})['then'](respondWithResult(_0x4a0e14,null))[_0xcee2('0x2e')](handleError(_0x4a0e14,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 854cbf0..51cd6f5 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 _0xd17a=['exports','events','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xd17a,0x8d));var _0xad17=function(_0x2b365f,_0x17aa37){_0x2b365f=_0x2b365f-0x0;var _0x26b060=_0xd17a[_0x2b365f];return _0x26b060;};'use strict';var EventEmitter=require(_0xad17('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xad17('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xad17('0x2'),'afterDestroy':_0xad17('0x3')};function emitEvent(_0x1498c4){return function(_0x5c665c,_0x4c77b5,_0x547f85){FaxAccountEvents[_0xad17('0x4')](_0x1498c4+':'+_0x5c665c['id'],_0x5c665c);FaxAccountEvents[_0xad17('0x4')](_0x1498c4,_0x5c665c);_0x547f85(null);};}for(var e in events){if(events[_0xad17('0x5')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xad17('0x6')]=FaxAccountEvents; \ No newline at end of file +var _0x6719=['FaxAccount','setMaxListeners','save','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x6719,0x116));var _0x9671=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0x6719[_0x15b399];return _0x199f2d;};'use strict';var EventEmitter=require(_0x9671('0x0'));var FaxAccount=require(_0x9671('0x1'))['db'][_0x9671('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9671('0x3')](0x0);var events={'afterCreate':_0x9671('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3b931b){return function(_0x1ec2c3,_0xfbb8d6,_0x23f93f){FaxAccountEvents[_0x9671('0x5')](_0x3b931b+':'+_0x1ec2c3['id'],_0x1ec2c3);FaxAccountEvents[_0x9671('0x5')](_0x3b931b,_0x1ec2c3);_0x23f93f(null);};}for(var e in events){if(events[_0x9671('0x6')](e)){var event=events[e];FaxAccount[_0x9671('0x7')](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 e69eeb0..e099497 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 _0x7762=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util'];(function(_0x5ea91e,_0x2c2430){var _0x4adaa1=function(_0x21cd64){while(--_0x21cd64){_0x5ea91e['push'](_0x5ea91e['shift']());}};_0x4adaa1(++_0x2c2430);}(_0x7762,0x1b9));var _0x2776=function(_0x35586f,_0x35e12b){_0x35586f=_0x35586f-0x0;var _0x435ed9=_0x7762[_0x35586f];return _0x435ed9;};'use strict';var _=require('lodash');var util=require(_0x2776('0x0'));var logger=require(_0x2776('0x1'))(_0x2776('0x2'));var moment=require(_0x2776('0x3'));var BPromise=require(_0x2776('0x4'));var rp=require(_0x2776('0x5'));var fs=require('fs');var path=require(_0x2776('0x6'));var rimraf=require(_0x2776('0x7'));var config=require('../../config/environment');var attributes=require(_0x2776('0x8'));module[_0x2776('0x9')]=function(_0x2233c3,_0x4d4ac){return _0x2233c3[_0x2776('0xa')](_0x2776('0xb'),attributes,{'tableName':_0x2776('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59a5=['api','moment','bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts','util'];(function(_0x5d658f,_0x1ec8ca){var _0x541f47=function(_0x5a67cb){while(--_0x5a67cb){_0x5d658f['push'](_0x5d658f['shift']());}};_0x541f47(++_0x1ec8ca);}(_0x59a5,0xfc));var _0x559a=function(_0xbc57ea,_0xc29d19){_0xbc57ea=_0xbc57ea-0x0;var _0x592bb9=_0x59a5[_0xbc57ea];return _0x592bb9;};'use strict';var _=require('lodash');var util=require(_0x559a('0x0'));var logger=require('../../config/logger')(_0x559a('0x1'));var moment=require(_0x559a('0x2'));var BPromise=require(_0x559a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x559a('0x4'));var rimraf=require(_0x559a('0x5'));var config=require(_0x559a('0x6'));var attributes=require(_0x559a('0x7'));module[_0x559a('0x8')]=function(_0x1ef5be,_0x32c64f){return _0x1ef5be['define'](_0x559a('0x9'),attributes,{'tableName':_0x559a('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 5083cb9..d11787d 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 _0xc7b1=['keys','CompanyId','body','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','DESC','Applications','get','applications','list','orderBy','priority','asc','length','Contacts','ListId','create','contact','FaxInteraction','find','Contact\x20not\x20found','spread','autoclose','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount','raw','options','where','attributes','limit','include','model','map','then','stringify','NotifyFaxAccount','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt'];(function(_0xbeb86f,_0x3162e7){var _0x192833=function(_0x498953){while(--_0x498953){_0xbeb86f['push'](_0xbeb86f['shift']());}};_0x192833(++_0x3162e7);}(_0xc7b1,0xe5));var _0x1c7b=function(_0x34c4e1,_0x310387){_0x34c4e1=_0x34c4e1-0x0;var _0x5a11ef=_0xc7b1[_0x34c4e1];return _0x5a11ef;};'use strict';var _=require(_0x1c7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1c7b('0x1'));var rs=require(_0x1c7b('0x2'));var fs=require('fs');var Redis=require(_0x1c7b('0x3'));var db=require(_0x1c7b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c7b('0x5'))(_0x1c7b('0x6'));var config=require(_0x1c7b('0x7'));var jayson=require(_0x1c7b('0x8'));var client=jayson[_0x1c7b('0x9')]['http']({'port':0x232c});config['redis']=_[_0x1c7b('0xa')](config[_0x1c7b('0xb')],{'host':_0x1c7b('0xc'),'port':0x18eb});var socket=require(_0x1c7b('0xd'))(new Redis(config['redis']));require(_0x1c7b('0xe'))['register'](socket);function respondWithRpcPromise(_0x5d344e,_0x487b22,_0x14dbb2){return new BPromise(function(_0x12057e,_0x43823a){return client[_0x1c7b('0xf')](_0x5d344e,_0x14dbb2)['then'](function(_0x369433){logger[_0x1c7b('0x10')](_0x1c7b('0x11'),_0x487b22,_0x1c7b('0x12'));logger[_0x1c7b('0x13')](_0x1c7b('0x14'),_0x487b22,_0x1c7b('0x12'),JSON['stringify'](_0x369433));if(_0x369433[_0x1c7b('0x15')]){if(_0x369433[_0x1c7b('0x15')][_0x1c7b('0x16')]===0x1f4){logger[_0x1c7b('0x15')](_0x1c7b('0x11'),_0x487b22,_0x369433[_0x1c7b('0x15')]['message']);return _0x43823a(_0x369433[_0x1c7b('0x15')][_0x1c7b('0x17')]);}logger[_0x1c7b('0x15')](_0x1c7b('0x11'),_0x487b22,_0x369433[_0x1c7b('0x15')][_0x1c7b('0x17')]);return _0x12057e(_0x369433[_0x1c7b('0x15')]['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x487b22,_0x1c7b('0x12'));_0x12057e(_0x369433[_0x1c7b('0x18')]['message']);}})[_0x1c7b('0x19')](function(_0x558cfc){logger[_0x1c7b('0x15')](_0x1c7b('0x11'),_0x487b22,_0x558cfc);_0x43823a(_0x558cfc);});});}exports[_0x1c7b('0x1a')]=function(_0x2c9dbc){var _0x85e0cd=this;return new Promise(function(_0x3bac5a,_0xeac5dc){return db[_0x1c7b('0x1b')]['findAll']({'raw':_0x2c9dbc['options']?_0x2c9dbc['options'][_0x1c7b('0x1c')]===undefined?!![]:![]:!![],'where':_0x2c9dbc['options']?_0x2c9dbc[_0x1c7b('0x1d')][_0x1c7b('0x1e')]||null:null,'attributes':_0x2c9dbc['options']?_0x2c9dbc[_0x1c7b('0x1d')][_0x1c7b('0x1f')]||null:null,'limit':_0x2c9dbc[_0x1c7b('0x1d')]?_0x2c9dbc[_0x1c7b('0x1d')][_0x1c7b('0x20')]||null:null,'include':_0x2c9dbc[_0x1c7b('0x1d')]?_0x2c9dbc[_0x1c7b('0x1d')][_0x1c7b('0x21')]?_['map'](_0x2c9dbc['options'][_0x1c7b('0x21')],function(_0x4dcd24){return{'model':db[_0x4dcd24[_0x1c7b('0x22')]],'as':_0x4dcd24['as'],'attributes':_0x4dcd24['attributes'],'include':_0x4dcd24['include']?_[_0x1c7b('0x23')](_0x4dcd24[_0x1c7b('0x21')],function(_0x299343){return{'model':db[_0x299343[_0x1c7b('0x22')]],'as':_0x299343['as'],'attributes':_0x299343[_0x1c7b('0x1f')],'include':_0x299343[_0x1c7b('0x21')]?_['map'](_0x299343[_0x1c7b('0x21')],function(_0x5007fe){return{'model':db[_0x5007fe[_0x1c7b('0x22')]],'as':_0x5007fe['as'],'attributes':_0x5007fe['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c7b('0x24')](function(_0x5a14dc){logger[_0x1c7b('0x10')](_0x1c7b('0x1a'),_0x2c9dbc);logger[_0x1c7b('0x13')](_0x1c7b('0x1a'),_0x2c9dbc,JSON[_0x1c7b('0x25')](_0x5a14dc));_0x3bac5a(_0x5a14dc);})[_0x1c7b('0x19')](function(_0x2baf8b){logger[_0x1c7b('0x15')](_0x1c7b('0x1a'),_0x2baf8b[_0x1c7b('0x17')],_0x2c9dbc);_0xeac5dc(_0x85e0cd[_0x1c7b('0x15')](0x1f4,_0x2baf8b[_0x1c7b('0x17')]));});});};exports[_0x1c7b('0x26')]=function(_0x193160,_0x530f80,_0x46c981){var _0x2ca271=this;return new Promise(function(_0x8f409f,_0x2e175e){var _0x364c94={'body':_0x193160['body'],'channel':_0x1c7b('0x27')};var _0x2fec2a=[];var _0x187a85=[];var _0x227fe6={};return db[_0x1c7b('0x28')]['describe']()['then'](function(_0x59022c){if(!_0x59022c){throw new db[(_0x1c7b('0x29'))][(_0x1c7b('0x2a'))](_0x1c7b('0x2b'));}_0x2fec2a=_[_0x1c7b('0x2c')](_['keys'](_0x59022c),[_0x1c7b('0x2d'),_0x1c7b('0x2e')]);_0x187a85=_['difference'](_[_0x1c7b('0x2f')](_0x59022c),[_0x1c7b('0x2d'),_0x1c7b('0x2e'),_0x1c7b('0x30'),'ListId']);if(_0x193160[_0x1c7b('0x31')]['id']){delete _0x193160['body']['id'];}if(_[_0x1c7b('0x32')](_0x193160['body'][_0x1c7b('0x33')])){throw new db[(_0x1c7b('0x29'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x1c7b('0x32')](_0x193160[_0x1c7b('0x31')][_0x1c7b('0x31')])||_0x193160[_0x1c7b('0x31')][_0x1c7b('0x31')]===''){throw new db[(_0x1c7b('0x29'))][(_0x1c7b('0x2a'))](_0x1c7b('0x34'));}if(_['isNil'](_0x193160[_0x1c7b('0x31')]['mapKey'])){throw new db[(_0x1c7b('0x29'))][(_0x1c7b('0x2a'))](_0x1c7b('0x35')+_0x187a85);}if(!_[_0x1c7b('0x36')](_0x187a85,_0x193160['body'][_0x1c7b('0x37')])){throw new db[(_0x1c7b('0x29'))][(_0x1c7b('0x2a'))](_0x1c7b('0x38')+_0x187a85);}_0x227fe6[_0x193160['body'][_0x1c7b('0x37')]]=_0x193160[_0x1c7b('0x31')][_0x1c7b('0x33')];})[_0x1c7b('0x24')](function(){return db[_0x1c7b('0x1b')]['find']({'where':{'id':_0x193160[_0x1c7b('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0x1c7b('0x3a'),'include':[{'model':db[_0x1c7b('0x28')],'as':'Contacts','where':_0x227fe6,'limit':0x1,'order':[[_0x1c7b('0x2e'),_0x1c7b('0x3b')]]}]},{'model':db['FaxApplication'],'as':_0x1c7b('0x3c')}]});})['then'](function(_0x2fe9c6){if(_0x2fe9c6&&_0x2fe9c6[_0x1c7b('0x3a')]){var _0x187a4e=_0x2fe9c6[_0x1c7b('0x3d')]({'plain':!![]});_0x364c94['account']=_0x187a4e;_0x364c94[_0x1c7b('0x3e')]=_0x187a4e['Applications'];_0x364c94[_0x1c7b('0x3f')]=_0x187a4e[_0x1c7b('0x3a')];_0x364c94[_0x1c7b('0x3e')]=_[_0x1c7b('0x40')](_0x364c94['applications'],[_0x1c7b('0x41')],[_0x1c7b('0x42')]);if(_0x364c94[_0x1c7b('0x39')][_0x1c7b('0x3c')]){delete _0x364c94[_0x1c7b('0x39')]['Applications'];}if(_0x364c94['account'][_0x1c7b('0x3a')]&&_0x364c94['account'][_0x1c7b('0x3a')]['Contacts'][_0x1c7b('0x43')]){return _0x364c94[_0x1c7b('0x39')]['List'][_0x1c7b('0x44')][0x0];}var _0x28978d=_[_0x1c7b('0xa')](_0x193160[_0x1c7b('0x31')],{'firstName':_0x193160[_0x1c7b('0x31')]['from'],'ListId':_0x187a4e[_0x1c7b('0x45')]});_0x28978d[_0x193160['body'][_0x1c7b('0x37')]]=_0x193160[_0x1c7b('0x31')][_0x1c7b('0x33')];return db[_0x1c7b('0x28')][_0x1c7b('0x46')](_0x28978d,{'fields':_0x2fec2a,'raw':!![]});}})[_0x1c7b('0x24')](function(_0x7718){_0x364c94[_0x1c7b('0x47')]=_0x7718;if(_0x7718){var _0xb43d71={'ContactId':_0x7718['id'],'FaxAccountId':_0x193160[_0x1c7b('0x39')]['id'],'fax':_0x7718[_0x1c7b('0x27')]};return db[_0x1c7b('0x48')][_0x1c7b('0x49')]({'where':{'ContactId':_0x7718['id'],'closed':![],'FaxAccountId':_0x193160[_0x1c7b('0x39')]['id']}})[_0x1c7b('0x24')](function(_0x33ab89){if(_0x33ab89){return[_0x33ab89,![]];}return db[_0x1c7b('0x48')][_0x1c7b('0x46')](_0xb43d71)[_0x1c7b('0x24')](function(_0x1dbfe5){return[_0x1dbfe5,!![]];});});}else{throw new Error(_0x1c7b('0x4a'));}})[_0x1c7b('0x4b')](function(_0x443b93,_0x20ba00){var _0x84c052=_0x443b93[_0x1c7b('0x3d')]({'plain':!![]});if(_0x20ba00){if(_0x364c94['account'][_0x1c7b('0x4c')]){_0x364c94[_0x1c7b('0x3e')]['push']({'id':0x0,'priority':_0x364c94[_0x1c7b('0x3e')][_0x1c7b('0x43')]+0x1,'app':_0x1c7b('0x4d'),'appdata':_0x1c7b('0x4e'),'interval':_0x1c7b('0x4f')});}_0x84c052['created']=!![];}else{_0x84c052[_0x1c7b('0x50')]=![];}_0x364c94['interaction']=_0x84c052;return db[_0x1c7b('0x51')][_0x1c7b('0x46')]({'body':_0x193160['body'][_0x1c7b('0x31')],'FaxAccountId':_0x193160[_0x1c7b('0x39')]['id'],'FaxInteractionId':_0x443b93['id'],'direction':'in','ContactId':_0x443b93[_0x1c7b('0x52')],'AttachmentId':_0x193160['body'][_0x1c7b('0x53')]});})[_0x1c7b('0x24')](function(_0x5b68a7){_0x364c94['message']=_0x5b68a7;if(_0x364c94[_0x1c7b('0x54')][_0x1c7b('0x55')]){return db['User'][_0x1c7b('0x49')]({'attributes':['id',_0x1c7b('0x56')],'where':{'id':_0x364c94['interaction'][_0x1c7b('0x55')]}})[_0x1c7b('0x24')](function(_0x433b75){if(_0x433b75){_0x364c94['applications'][_0x1c7b('0x57')]({'id':0x0,'priority':0x0,'app':_0x1c7b('0x58'),'appdata':_0x433b75['name']+','+(_0x364c94[_0x1c7b('0x39')][_0x1c7b('0x59')]||0xa),'interval':_0x1c7b('0x4f')});}return respondWithRpcPromise(_0x1c7b('0x5a'),_0x1c7b('0x5b'),_0x364c94);});}return respondWithRpcPromise(_0x1c7b('0x5a'),'startRouting',_0x364c94);})[_0x1c7b('0x24')](function(_0x23173b){_0x8f409f(_0x23173b);})[_0x1c7b('0x19')](function(_0x368014){_0x2e175e(_0x2ca271[_0x1c7b('0x15')](0x1f4,_0x368014[_0x1c7b('0x17')]));});});}; \ No newline at end of file +var _0x21d7=['jayson/promise','client','http','defaults','redis','./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','raw','options','where','attributes','limit','include','map','model','body','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','updatedAt','DESC','FaxApplication','Applications','get','list','applications','priority','asc','Contacts','create','contact','fax','FaxInteraction','spread','push','length','close','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','find','name','startRouting','Start','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x470b3c,_0x44b858){var _0x501b69=function(_0x2ca659){while(--_0x2ca659){_0x470b3c['push'](_0x470b3c['shift']());}};_0x501b69(++_0x44b858);}(_0x21d7,0xf7));var _0x721d=function(_0x573da7,_0x3d425c){_0x573da7=_0x573da7-0x0;var _0x91443c=_0x21d7[_0x573da7];return _0x91443c;};'use strict';var _=require(_0x721d('0x0'));var util=require(_0x721d('0x1'));var moment=require(_0x721d('0x2'));var BPromise=require('bluebird');var rs=require(_0x721d('0x3'));var fs=require('fs');var Redis=require(_0x721d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x721d('0x5'));var logger=require('../../config/logger')(_0x721d('0x6'));var config=require(_0x721d('0x7'));var jayson=require(_0x721d('0x8'));var client=jayson[_0x721d('0x9')][_0x721d('0xa')]({'port':0x232c});config['redis']=_[_0x721d('0xb')](config[_0x721d('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x721d('0xc')]));require(_0x721d('0xd'))[_0x721d('0xe')](socket);function respondWithRpcPromise(_0x5b00f4,_0x1dc228,_0x2778db){return new BPromise(function(_0x418726,_0x32596c){return client[_0x721d('0xf')](_0x5b00f4,_0x2778db)[_0x721d('0x10')](function(_0x2fa471){logger[_0x721d('0x11')](_0x721d('0x12'),_0x1dc228,_0x721d('0x13'));logger[_0x721d('0x14')](_0x721d('0x15'),_0x1dc228,_0x721d('0x13'),JSON[_0x721d('0x16')](_0x2fa471));if(_0x2fa471[_0x721d('0x17')]){if(_0x2fa471['error'][_0x721d('0x18')]===0x1f4){logger[_0x721d('0x17')](_0x721d('0x12'),_0x1dc228,_0x2fa471[_0x721d('0x17')][_0x721d('0x19')]);return _0x32596c(_0x2fa471['error']['message']);}logger[_0x721d('0x17')](_0x721d('0x12'),_0x1dc228,_0x2fa471[_0x721d('0x17')]['message']);return _0x418726(_0x2fa471[_0x721d('0x17')][_0x721d('0x19')]);}else{logger[_0x721d('0x11')](_0x721d('0x12'),_0x1dc228,'request\x20sent');_0x418726(_0x2fa471['result']['message']);}})[_0x721d('0x1a')](function(_0x257b3c){logger[_0x721d('0x17')](_0x721d('0x12'),_0x1dc228,_0x257b3c);_0x32596c(_0x257b3c);});});}exports[_0x721d('0x1b')]=function(_0x1fa787){var _0xd4ba9a=this;return new Promise(function(_0x29ed71,_0x4c33df){return db[_0x721d('0x1c')][_0x721d('0x1d')]({'raw':_0x1fa787['options']?_0x1fa787['options'][_0x721d('0x1e')]===undefined?!![]:![]:!![],'where':_0x1fa787[_0x721d('0x1f')]?_0x1fa787[_0x721d('0x1f')][_0x721d('0x20')]||null:null,'attributes':_0x1fa787[_0x721d('0x1f')]?_0x1fa787[_0x721d('0x1f')][_0x721d('0x21')]||null:null,'limit':_0x1fa787[_0x721d('0x1f')]?_0x1fa787[_0x721d('0x1f')][_0x721d('0x22')]||null:null,'include':_0x1fa787['options']?_0x1fa787[_0x721d('0x1f')][_0x721d('0x23')]?_[_0x721d('0x24')](_0x1fa787['options'][_0x721d('0x23')],function(_0xaf7c1){return{'model':db[_0xaf7c1[_0x721d('0x25')]],'as':_0xaf7c1['as'],'attributes':_0xaf7c1[_0x721d('0x21')],'include':_0xaf7c1[_0x721d('0x23')]?_[_0x721d('0x24')](_0xaf7c1[_0x721d('0x23')],function(_0x105bd2){return{'model':db[_0x105bd2[_0x721d('0x25')]],'as':_0x105bd2['as'],'attributes':_0x105bd2[_0x721d('0x21')],'include':_0x105bd2[_0x721d('0x23')]?_[_0x721d('0x24')](_0x105bd2[_0x721d('0x23')],function(_0x2d8580){return{'model':db[_0x2d8580['model']],'as':_0x2d8580['as'],'attributes':_0x2d8580[_0x721d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x522749){logger[_0x721d('0x11')]('GetFaxAccount',_0x1fa787);logger[_0x721d('0x14')](_0x721d('0x1b'),_0x1fa787,JSON[_0x721d('0x16')](_0x522749));_0x29ed71(_0x522749);})[_0x721d('0x1a')](function(_0x59db88){logger['error'](_0x721d('0x1b'),_0x59db88[_0x721d('0x19')],_0x1fa787);_0x4c33df(_0xd4ba9a[_0x721d('0x17')](0x1f4,_0x59db88[_0x721d('0x19')]));});});};exports['NotifyFaxAccount']=function(_0x464998,_0x2dadc9,_0x1c9944){var _0x44eabd=this;return new Promise(function(_0x195e1a,_0xfc6b65){var _0x2d3207={'body':_0x464998[_0x721d('0x26')],'channel':'fax'};var _0x533fe0=[];var _0x5630f2=[];var _0x56f5b9={};return db[_0x721d('0x27')][_0x721d('0x28')]()['then'](function(_0xcb6997){if(!_0xcb6997){throw new db[(_0x721d('0x29'))][(_0x721d('0x2a'))](_0x721d('0x2b'));}_0x533fe0=_[_0x721d('0x2c')](_[_0x721d('0x2d')](_0xcb6997),[_0x721d('0x2e'),'updatedAt']);_0x5630f2=_[_0x721d('0x2c')](_['keys'](_0xcb6997),[_0x721d('0x2e'),'updatedAt',_0x721d('0x2f'),_0x721d('0x30')]);if(_0x464998[_0x721d('0x26')]['id']){delete _0x464998['body']['id'];}if(_[_0x721d('0x31')](_0x464998[_0x721d('0x26')][_0x721d('0x32')])){throw new db[(_0x721d('0x29'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x721d('0x31')](_0x464998['body'][_0x721d('0x26')])||_0x464998[_0x721d('0x26')][_0x721d('0x26')]===''){throw new db[(_0x721d('0x29'))]['ValidationError'](_0x721d('0x33'));}if(_[_0x721d('0x31')](_0x464998['body'][_0x721d('0x34')])){throw new db['Sequelize'][(_0x721d('0x2a'))](_0x721d('0x35')+_0x5630f2);}if(!_['includes'](_0x5630f2,_0x464998[_0x721d('0x26')][_0x721d('0x34')])){throw new db[(_0x721d('0x29'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5630f2);}_0x56f5b9[_0x464998[_0x721d('0x26')][_0x721d('0x34')]]=_0x464998['body'][_0x721d('0x32')];})['then'](function(){return db[_0x721d('0x1c')]['find']({'where':{'id':_0x464998[_0x721d('0x36')]['id']},'include':[{'model':db['CmList'],'as':_0x721d('0x37'),'include':[{'model':db[_0x721d('0x27')],'as':'Contacts','where':_0x56f5b9,'limit':0x1,'order':[[_0x721d('0x38'),_0x721d('0x39')]]}]},{'model':db[_0x721d('0x3a')],'as':_0x721d('0x3b')}]});})[_0x721d('0x10')](function(_0x3c134a){if(_0x3c134a&&_0x3c134a[_0x721d('0x37')]){var _0xebc79e=_0x3c134a[_0x721d('0x3c')]({'plain':!![]});_0x2d3207[_0x721d('0x36')]=_0xebc79e;_0x2d3207['applications']=_0xebc79e[_0x721d('0x3b')];_0x2d3207[_0x721d('0x3d')]=_0xebc79e[_0x721d('0x37')];_0x2d3207[_0x721d('0x3e')]=_['orderBy'](_0x2d3207[_0x721d('0x3e')],[_0x721d('0x3f')],[_0x721d('0x40')]);if(_0x2d3207[_0x721d('0x36')][_0x721d('0x3b')]){delete _0x2d3207[_0x721d('0x36')]['Applications'];}if(_0x2d3207[_0x721d('0x36')][_0x721d('0x37')]&&_0x2d3207[_0x721d('0x36')][_0x721d('0x37')][_0x721d('0x41')]['length']){return _0x2d3207[_0x721d('0x36')][_0x721d('0x37')]['Contacts'][0x0];}var _0x1142fc=_['defaults'](_0x464998[_0x721d('0x26')],{'firstName':_0x464998[_0x721d('0x26')]['from'],'ListId':_0xebc79e[_0x721d('0x30')]});_0x1142fc[_0x464998[_0x721d('0x26')][_0x721d('0x34')]]=_0x464998['body'][_0x721d('0x32')];return db[_0x721d('0x27')][_0x721d('0x42')](_0x1142fc,{'fields':_0x533fe0,'raw':!![]});}})[_0x721d('0x10')](function(_0x13ba4e){_0x2d3207[_0x721d('0x43')]=_0x13ba4e;if(_0x13ba4e){var _0x596590={'ContactId':_0x13ba4e['id'],'FaxAccountId':_0x464998[_0x721d('0x36')]['id'],'fax':_0x13ba4e[_0x721d('0x44')]};return db[_0x721d('0x45')]['find']({'where':{'ContactId':_0x13ba4e['id'],'closed':![],'FaxAccountId':_0x464998[_0x721d('0x36')]['id']}})[_0x721d('0x10')](function(_0x1505ce){if(_0x1505ce){return[_0x1505ce,![]];}return db[_0x721d('0x45')][_0x721d('0x42')](_0x596590)[_0x721d('0x10')](function(_0x2ce408){return[_0x2ce408,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x721d('0x46')](function(_0xf13f58,_0x2f790a){var _0x36c0ea=_0xf13f58[_0x721d('0x3c')]({'plain':!![]});if(_0x2f790a){if(_0x2d3207['account']['autoclose']){_0x2d3207[_0x721d('0x3e')][_0x721d('0x47')]({'id':0x0,'priority':_0x2d3207[_0x721d('0x3e')][_0x721d('0x48')]+0x1,'app':_0x721d('0x49'),'appdata':'unmanaged','interval':_0x721d('0x4a')});}_0x36c0ea[_0x721d('0x4b')]=!![];}else{_0x36c0ea['created']=![];}_0x2d3207[_0x721d('0x4c')]=_0x36c0ea;return db[_0x721d('0x4d')][_0x721d('0x42')]({'body':_0x464998[_0x721d('0x26')][_0x721d('0x26')],'FaxAccountId':_0x464998[_0x721d('0x36')]['id'],'FaxInteractionId':_0xf13f58['id'],'direction':'in','ContactId':_0xf13f58['ContactId'],'AttachmentId':_0x464998[_0x721d('0x26')][_0x721d('0x4e')]});})['then'](function(_0x2f3074){_0x2d3207['message']=_0x2f3074;if(_0x2d3207['interaction'][_0x721d('0x4f')]){return db[_0x721d('0x50')][_0x721d('0x51')]({'attributes':['id','name'],'where':{'id':_0x2d3207[_0x721d('0x4c')][_0x721d('0x4f')]}})[_0x721d('0x10')](function(_0x315b9d){if(_0x315b9d){_0x2d3207[_0x721d('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x315b9d[_0x721d('0x52')]+','+(_0x2d3207[_0x721d('0x36')]['waitForTheAssignedAgent']||0xa),'interval':_0x721d('0x4a')});}return respondWithRpcPromise('Start',_0x721d('0x53'),_0x2d3207);});}return respondWithRpcPromise(_0x721d('0x54'),_0x721d('0x53'),_0x2d3207);})[_0x721d('0x10')](function(_0x4f1a64){_0x195e1a(_0x4f1a64);})[_0x721d('0x1a')](function(_0x1fc260){_0xfc6b65(_0x44eabd['error'](0x1f4,_0x1fc260[_0x721d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 18430c3..3fb1fbe 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 _0x47c5=['update','emit','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x47c5,0x165));var _0x547c=function(_0x2c2d2f,_0x1e780d){_0x2c2d2f=_0x2c2d2f-0x0;var _0x2630c7=_0x47c5[_0x2c2d2f];return _0x2630c7;};'use strict';var FaxAccountEvents=require(_0x547c('0x0'));var events=[_0x547c('0x1'),_0x547c('0x2'),_0x547c('0x3')];function createListener(_0x5fe74c,_0x3260c8){return function(_0x500b86){_0x3260c8[_0x547c('0x4')](_0x5fe74c,_0x500b86);};}function removeListener(_0x16f4db,_0x5b48c9){return function(){FaxAccountEvents[_0x547c('0x5')](_0x16f4db,_0x5b48c9);};}exports[_0x547c('0x6')]=function(_0x51ab7f){for(var _0x2e5b57=0x0,_0x439f25=events[_0x547c('0x7')];_0x2e5b57<_0x439f25;_0x2e5b57++){var _0x10a334=events[_0x2e5b57];var _0x12fb7d=createListener(_0x547c('0x8')+_0x10a334,_0x51ab7f);FaxAccountEvents['on'](_0x10a334,_0x12fb7d);}}; \ No newline at end of file +var _0x5464=['save','remove','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x4b20e6,_0x39bd9e){var _0x10ecd1=function(_0xfeb1a7){while(--_0xfeb1a7){_0x4b20e6['push'](_0x4b20e6['shift']());}};_0x10ecd1(++_0x39bd9e);}(_0x5464,0x15d));var _0x4546=function(_0x1288ae,_0x2ba362){_0x1288ae=_0x1288ae-0x0;var _0x5e93bc=_0x5464[_0x1288ae];return _0x5e93bc;};'use strict';var FaxAccountEvents=require(_0x4546('0x0'));var events=[_0x4546('0x1'),_0x4546('0x2'),'update'];function createListener(_0x3add1b,_0x5b51d3){return function(_0x11ba33){_0x5b51d3['emit'](_0x3add1b,_0x11ba33);};}function removeListener(_0x320c4d,_0x396a1d){return function(){FaxAccountEvents[_0x4546('0x3')](_0x320c4d,_0x396a1d);};}exports[_0x4546('0x4')]=function(_0x54228a){for(var _0x57391f=0x0,_0x5c5e09=events[_0x4546('0x5')];_0x57391f<_0x5c5e09;_0x57391f++){var _0x36c875=events[_0x57391f];var _0x1a76c1=createListener(_0x4546('0x6')+_0x36c875,_0x54228a);FaxAccountEvents['on'](_0x36c875,_0x1a76c1);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 7285031..6311a68 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 _0xd29d=['../../components/auth/service','../../components/interaction/service','./faxAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','getAgents','create','addDisposition','post','addInteraction','addApplications','/addaccountapplications','/updateaccountapplications','/:id/send','send','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2bd1ec,_0x3fe65f){var _0x2f7577=function(_0x5234fb){while(--_0x5234fb){_0x2bd1ec['push'](_0x2bd1ec['shift']());}};_0x2f7577(++_0x3fe65f);}(_0xd29d,0x17d));var _0xdd29=function(_0x54a963,_0x33479d){_0x54a963=_0x54a963-0x0;var _0x2b5369=_0xd29d[_0x54a963];return _0x2b5369;};'use strict';var multer=require(_0xdd29('0x0'));var util=require(_0xdd29('0x1'));var path=require(_0xdd29('0x2'));var timeout=require(_0xdd29('0x3'));var express=require(_0xdd29('0x4'));var router=express[_0xdd29('0x5')]();var auth=require(_0xdd29('0x6'));var interaction=require(_0xdd29('0x7'));var config=require('../../config/environment');var controller=require(_0xdd29('0x8'));router[_0xdd29('0x9')]('/',auth[_0xdd29('0xa')](),controller[_0xdd29('0xb')]);router[_0xdd29('0x9')](_0xdd29('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xdd29('0x9')](_0xdd29('0xd'),auth['isAuthenticated'](),controller[_0xdd29('0xe')]);router['get'](_0xdd29('0xf'),auth[_0xdd29('0xa')](),controller[_0xdd29('0x10')]);router[_0xdd29('0x9')](_0xdd29('0x11'),auth[_0xdd29('0xa')](),controller['getAnswers']);router['get'](_0xdd29('0x12'),auth[_0xdd29('0xa')](),controller[_0xdd29('0x13')]);router[_0xdd29('0x9')](_0xdd29('0x14'),auth[_0xdd29('0xa')](),controller['getApplications']);router['get'](_0xdd29('0x15'),auth[_0xdd29('0xa')](),controller[_0xdd29('0x16')]);router['get']('/:id/users',auth[_0xdd29('0xa')](),controller[_0xdd29('0x17')]);router['post']('/',auth[_0xdd29('0xa')](),controller[_0xdd29('0x18')]);router['post'](_0xdd29('0xf'),auth[_0xdd29('0xa')](),controller[_0xdd29('0x19')]);router['post'](_0xdd29('0x11'),auth[_0xdd29('0xa')](),controller['addAnswer']);router[_0xdd29('0x1a')](_0xdd29('0x12'),auth['isAuthenticated'](),controller[_0xdd29('0x1b')]);router[_0xdd29('0x1a')](_0xdd29('0x14'),auth[_0xdd29('0xa')](),controller[_0xdd29('0x1c')]);router[_0xdd29('0x1a')](_0xdd29('0x1d'),auth[_0xdd29('0xa')](),controller['addAccountApplications']);router[_0xdd29('0x1a')](_0xdd29('0x1e'),auth[_0xdd29('0xa')](),controller['updateAccountApplications']);router[_0xdd29('0x1a')](_0xdd29('0x1f'),auth['isAuthenticated'](),controller[_0xdd29('0x20')]);router[_0xdd29('0x1a')](_0xdd29('0x21'),auth[_0xdd29('0xa')](),controller[_0xdd29('0x22')]);router[_0xdd29('0x23')](_0xdd29('0xd'),auth[_0xdd29('0xa')](),controller[_0xdd29('0x24')]);router[_0xdd29('0x25')](_0xdd29('0xd'),auth[_0xdd29('0xa')](),controller[_0xdd29('0x26')]);router[_0xdd29('0x25')]('/:id/dispositions',auth[_0xdd29('0xa')](),controller[_0xdd29('0x27')]);router['delete'](_0xdd29('0x11'),auth[_0xdd29('0xa')](),controller[_0xdd29('0x28')]);router[_0xdd29('0x25')](_0xdd29('0x21'),auth['isAuthenticated'](),controller[_0xdd29('0x29')]);module[_0xdd29('0x2a')]=router; \ No newline at end of file +var _0xb473=['../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','exports','multer','path','Router','../../components/auth/service'];(function(_0x8f7cad,_0x42f802){var _0x36bf4a=function(_0x4ca082){while(--_0x4ca082){_0x8f7cad['push'](_0x8f7cad['shift']());}};_0x36bf4a(++_0x42f802);}(_0xb473,0xac));var _0x3b47=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0xb473[_0x4063a4];return _0x17908d;};'use strict';var multer=require(_0x3b47('0x0'));var util=require('util');var path=require(_0x3b47('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3b47('0x2')]();var auth=require(_0x3b47('0x3'));var interaction=require(_0x3b47('0x4'));var config=require(_0x3b47('0x5'));var controller=require(_0x3b47('0x6'));router[_0x3b47('0x7')]('/',auth[_0x3b47('0x8')](),controller[_0x3b47('0x9')]);router[_0x3b47('0x7')](_0x3b47('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x3b47('0x7')](_0x3b47('0xb'),auth[_0x3b47('0x8')](),controller[_0x3b47('0xc')]);router[_0x3b47('0x7')](_0x3b47('0xd'),auth[_0x3b47('0x8')](),controller[_0x3b47('0xe')]);router[_0x3b47('0x7')](_0x3b47('0xf'),auth[_0x3b47('0x8')](),controller[_0x3b47('0x10')]);router['get'](_0x3b47('0x11'),auth[_0x3b47('0x8')](),controller[_0x3b47('0x12')]);router[_0x3b47('0x7')](_0x3b47('0x13'),auth[_0x3b47('0x8')](),controller[_0x3b47('0x14')]);router['get'](_0x3b47('0x15'),auth['isAuthenticated'](),controller[_0x3b47('0x16')]);router[_0x3b47('0x7')](_0x3b47('0x17'),auth[_0x3b47('0x8')](),controller[_0x3b47('0x18')]);router[_0x3b47('0x19')]('/',auth[_0x3b47('0x8')](),controller[_0x3b47('0x1a')]);router[_0x3b47('0x19')]('/:id/dispositions',auth[_0x3b47('0x8')](),controller[_0x3b47('0x1b')]);router[_0x3b47('0x19')](_0x3b47('0xf'),auth[_0x3b47('0x8')](),controller[_0x3b47('0x1c')]);router[_0x3b47('0x19')](_0x3b47('0x11'),auth[_0x3b47('0x8')](),controller['addInteraction']);router['post'](_0x3b47('0x13'),auth['isAuthenticated'](),controller[_0x3b47('0x1d')]);router[_0x3b47('0x19')](_0x3b47('0x1e'),auth[_0x3b47('0x8')](),controller[_0x3b47('0x1f')]);router[_0x3b47('0x19')](_0x3b47('0x20'),auth[_0x3b47('0x8')](),controller[_0x3b47('0x21')]);router['post'](_0x3b47('0x22'),auth['isAuthenticated'](),controller[_0x3b47('0x23')]);router[_0x3b47('0x19')]('/:id/users',auth[_0x3b47('0x8')](),controller[_0x3b47('0x24')]);router[_0x3b47('0x25')](_0x3b47('0xb'),auth[_0x3b47('0x8')](),controller[_0x3b47('0x26')]);router['delete'](_0x3b47('0xb'),auth[_0x3b47('0x8')](),controller[_0x3b47('0x27')]);router[_0x3b47('0x28')](_0x3b47('0xd'),auth[_0x3b47('0x8')](),controller[_0x3b47('0x29')]);router[_0x3b47('0x28')](_0x3b47('0xf'),auth[_0x3b47('0x8')](),controller[_0x3b47('0x2a')]);router[_0x3b47('0x28')](_0x3b47('0x17'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x3b47('0x2b')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index bed4c11..92895a7 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 _0xbd0e=['*,*,*,*','exports','STRING','noop','TEXT'];(function(_0x8c5f12,_0x2fbc1d){var _0x41220d=function(_0x1bb566){while(--_0x1bb566){_0x8c5f12['push'](_0x8c5f12['shift']());}};_0x41220d(++_0x2fbc1d);}(_0xbd0e,0x187));var _0xebd0=function(_0x4d821c,_0x22bd0e){_0x4d821c=_0x4d821c-0x0;var _0x15dd5b=_0xbd0e[_0x4d821c];return _0x15dd5b;};'use strict';var Sequelize=require('sequelize');module[_0xebd0('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xebd0('0x1')],'allowNull':![],'defaultValue':_0xebd0('0x2')},'appdata':{'type':Sequelize[_0xebd0('0x3')]()},'description':{'type':Sequelize[_0xebd0('0x1')]},'interval':{'type':Sequelize[_0xebd0('0x1')],'defaultValue':_0xebd0('0x4')}}; \ No newline at end of file +var _0xa613=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x22b70f,_0x4c853f){var _0x100985=function(_0x18628e){while(--_0x18628e){_0x22b70f['push'](_0x22b70f['shift']());}};_0x100985(++_0x4c853f);}(_0xa613,0x8a));var _0x3a61=function(_0xfacee2,_0x29c3b0){_0xfacee2=_0xfacee2-0x0;var _0x4cc9ea=_0xa613[_0xfacee2];return _0x4cc9ea;};'use strict';var Sequelize=require(_0x3a61('0x0'));module['exports']={'priority':{'type':Sequelize[_0x3a61('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3a61('0x2')],'allowNull':![],'defaultValue':_0x3a61('0x3')},'appdata':{'type':Sequelize[_0x3a61('0x4')]()},'description':{'type':Sequelize[_0x3a61('0x2')]},'interval':{'type':Sequelize[_0x3a61('0x2')],'defaultValue':_0x3a61('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index c2a73ef..8820665 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 _0x3a5e=['type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','fields','find','create','catch','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','then','sendStatus','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName'];(function(_0x88b91b,_0x2bc5ec){var _0xb854a1=function(_0x5d4004){while(--_0x5d4004){_0x88b91b['push'](_0x88b91b['shift']());}};_0xb854a1(++_0x2bc5ec);}(_0x3a5e,0x14c));var _0xe3a5=function(_0x323179,_0x5cc36d){_0x323179=_0x323179-0x0;var _0x5dfc95=_0x3a5e[_0x323179];return _0x5dfc95;};'use strict';var pdf=require(_0xe3a5('0x0'));var emlformat=require(_0xe3a5('0x1'));var rimraf=require(_0xe3a5('0x2'));var zipdir=require(_0xe3a5('0x3'));var jsonpatch=require(_0xe3a5('0x4'));var rp=require(_0xe3a5('0x5'));var moment=require('moment');var BPromise=require(_0xe3a5('0x6'));var Mustache=require(_0xe3a5('0x7'));var util=require(_0xe3a5('0x8'));var path=require(_0xe3a5('0x9'));var sox=require(_0xe3a5('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe3a5('0xb'));var squel=require('squel');var crypto=require(_0xe3a5('0xc'));var jsforce=require(_0xe3a5('0xd'));var deskjs=require(_0xe3a5('0xe'));var toCsv=require(_0xe3a5('0xf'));var querystring=require(_0xe3a5('0x10'));var Papa=require(_0xe3a5('0x11'));var Redis=require(_0xe3a5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe3a5('0x13'));var as=require(_0xe3a5('0x14'));var hardwareService=require(_0xe3a5('0x15'));var logger=require(_0xe3a5('0x16'))('api');var utils=require(_0xe3a5('0x17'));var config=require(_0xe3a5('0x18'));var db=require(_0xe3a5('0x19'))['db'];function respondWithStatusCode(_0xed6d6a,_0x21df1a){_0x21df1a=_0x21df1a||0xcc;return function(_0x11c871){if(_0x11c871){return _0xed6d6a['sendStatus'](_0x21df1a);}return _0xed6d6a[_0xe3a5('0x1a')](_0x21df1a)[_0xe3a5('0x1b')]();};}function respondWithResult(_0x35097b,_0x69a1c){_0x69a1c=_0x69a1c||0xc8;return function(_0x33d5de){if(_0x33d5de){return _0x35097b[_0xe3a5('0x1a')](_0x69a1c)[_0xe3a5('0x1c')](_0x33d5de);}};}function respondWithFilteredResult(_0x45aad6,_0x28645a){return function(_0x539af2){if(_0x539af2){var _0x59bc87=_0x539af2[_0xe3a5('0x1d')],_0x132932=_0x28645a[_0xe3a5('0x1e')],_0x3994f0=_0x28645a[_0xe3a5('0x1e')]+_0x28645a[_0xe3a5('0x1f')],_0x55e709;if(_0x3994f0>=_0x59bc87){_0x3994f0=_0x59bc87;_0x55e709=0xc8;}else{_0x55e709=0xce;}_0x45aad6[_0xe3a5('0x1a')](_0x55e709);return _0x45aad6[_0xe3a5('0x20')](_0xe3a5('0x21'),_0x132932+'-'+_0x3994f0+'/'+_0x59bc87)[_0xe3a5('0x1c')](_0x539af2);}return null;};}function patchUpdates(_0x5e421c){return function(_0x53091a){try{jsonpatch['apply'](_0x53091a,_0x5e421c,!![]);}catch(_0x1ab537){return BPromise[_0xe3a5('0x22')](_0x1ab537);}return _0x53091a[_0xe3a5('0x23')]();};}function saveUpdates(_0x3eea83,_0x2a07e6){return function(_0x5a2a0c){if(_0x5a2a0c){return _0x5a2a0c['update'](_0x3eea83)['then'](function(_0x453e95){return _0x453e95;});}return null;};}function removeEntity(_0xd5f03b,_0x2920e7){return function(_0x1758db){if(_0x1758db){return _0x1758db[_0xe3a5('0x24')]()[_0xe3a5('0x25')](function(){_0xd5f03b[_0xe3a5('0x1a')](0xcc)[_0xe3a5('0x1b')]();});}};}function handleEntityNotFound(_0x10759c,_0xb8ab4f){return function(_0x182622){if(!_0x182622){_0x10759c[_0xe3a5('0x26')](0x194);}return _0x182622;};}function handleError(_0x3fcedb,_0x551e78){_0x551e78=_0x551e78||0x1f4;return function(_0xe49210){logger[_0xe3a5('0x27')](_0xe49210[_0xe3a5('0x28')]);if(_0xe49210[_0xe3a5('0x29')]){delete _0xe49210['name'];}_0x3fcedb[_0xe3a5('0x1a')](_0x551e78)[_0xe3a5('0x2a')](_0xe49210);};}exports[_0xe3a5('0x2b')]=function(_0x4d709d,_0x3b9f7d){var _0x51acf8={},_0x952936={},_0x3989f6={'count':0x0,'rows':[]};var _0x5a6b20=_[_0xe3a5('0x2c')](db[_0xe3a5('0x2d')][_0xe3a5('0x2e')],function(_0x1c1f79){return{'name':_0x1c1f79[_0xe3a5('0x2f')],'type':_0x1c1f79[_0xe3a5('0x30')][_0xe3a5('0x31')]};});_0x952936[_0xe3a5('0x32')]=_[_0xe3a5('0x2c')](_0x5a6b20,_0xe3a5('0x29'));_0x952936[_0xe3a5('0x33')]=_[_0xe3a5('0x34')](_0x4d709d[_0xe3a5('0x33')]);_0x952936[_0xe3a5('0x35')]=_[_0xe3a5('0x36')](_0x952936[_0xe3a5('0x32')],_0x952936[_0xe3a5('0x33')]);_0x51acf8[_0xe3a5('0x37')]=_['intersection'](_0x952936['model'],qs['fields'](_0x4d709d[_0xe3a5('0x33')]['fields']));_0x51acf8[_0xe3a5('0x37')]=_0x51acf8[_0xe3a5('0x37')][_0xe3a5('0x38')]?_0x51acf8[_0xe3a5('0x37')]:_0x952936[_0xe3a5('0x32')];if(!_0x4d709d[_0xe3a5('0x33')][_0xe3a5('0x39')](_0xe3a5('0x3a'))){_0x51acf8[_0xe3a5('0x1f')]=qs[_0xe3a5('0x1f')](_0x4d709d['query'][_0xe3a5('0x1f')]);_0x51acf8[_0xe3a5('0x1e')]=qs[_0xe3a5('0x1e')](_0x4d709d[_0xe3a5('0x33')][_0xe3a5('0x1e')]);}_0x51acf8['order']=qs[_0xe3a5('0x3b')](_0x4d709d[_0xe3a5('0x33')]['sort']);_0x51acf8[_0xe3a5('0x3c')]=qs[_0xe3a5('0x35')](_[_0xe3a5('0x3d')](_0x4d709d[_0xe3a5('0x33')],_0x952936['filters']));if(_0x4d709d[_0xe3a5('0x33')][_0xe3a5('0x3e')]){_0x51acf8[_0xe3a5('0x3c')]=_[_0xe3a5('0x3f')](_0x51acf8[_0xe3a5('0x3c')],{'$or':_[_0xe3a5('0x2c')](_0x5a6b20,function(_0x32e6fa){if(_0x32e6fa[_0xe3a5('0x30')]!=='VIRTUAL'){var _0x5ac1a3={};_0x5ac1a3[_0x32e6fa[_0xe3a5('0x29')]]={'$like':'%'+_0x4d709d[_0xe3a5('0x33')][_0xe3a5('0x3e')]+'%'};return _0x5ac1a3;}})});}_0x51acf8=_[_0xe3a5('0x3f')]({},_0x51acf8,_0x4d709d[_0xe3a5('0x40')]);var _0x5cb5e4={'where':_0x51acf8[_0xe3a5('0x3c')]};return db[_0xe3a5('0x2d')][_0xe3a5('0x1d')](_0x5cb5e4)[_0xe3a5('0x25')](function(_0x3f3dcf){_0x3989f6[_0xe3a5('0x1d')]=_0x3f3dcf;if(_0x4d709d[_0xe3a5('0x33')][_0xe3a5('0x41')]){_0x51acf8[_0xe3a5('0x42')]=[{'all':!![]}];}return db[_0xe3a5('0x2d')][_0xe3a5('0x43')](_0x51acf8);})[_0xe3a5('0x25')](function(_0x37229f){_0x3989f6[_0xe3a5('0x44')]=_0x37229f;return _0x3989f6;})['then'](respondWithFilteredResult(_0x3b9f7d,_0x51acf8))['catch'](handleError(_0x3b9f7d,null));};exports[_0xe3a5('0x45')]=function(_0x29947a,_0x19370d){var _0xaacd4c={'raw':!![],'where':{'id':_0x29947a['params']['id']}},_0x2a524c={};_0x2a524c[_0xe3a5('0x32')]=_[_0xe3a5('0x34')](db[_0xe3a5('0x2d')][_0xe3a5('0x2e')]);_0x2a524c[_0xe3a5('0x33')]=_[_0xe3a5('0x34')](_0x29947a[_0xe3a5('0x33')]);_0x2a524c[_0xe3a5('0x35')]=_['intersection'](_0x2a524c[_0xe3a5('0x32')],_0x2a524c[_0xe3a5('0x33')]);_0xaacd4c['attributes']=_[_0xe3a5('0x36')](_0x2a524c[_0xe3a5('0x32')],qs[_0xe3a5('0x46')](_0x29947a['query'][_0xe3a5('0x46')]));_0xaacd4c[_0xe3a5('0x37')]=_0xaacd4c[_0xe3a5('0x37')]['length']?_0xaacd4c[_0xe3a5('0x37')]:_0x2a524c[_0xe3a5('0x32')];if(_0x29947a[_0xe3a5('0x33')][_0xe3a5('0x41')]){_0xaacd4c['include']=[{'all':!![]}];}_0xaacd4c=_[_0xe3a5('0x3f')]({},_0xaacd4c,_0x29947a[_0xe3a5('0x40')]);return db[_0xe3a5('0x2d')][_0xe3a5('0x47')](_0xaacd4c)[_0xe3a5('0x25')](handleEntityNotFound(_0x19370d,null))['then'](respondWithResult(_0x19370d,null))['catch'](handleError(_0x19370d,null));};exports[_0xe3a5('0x48')]=function(_0x33d361,_0x4d6684){return db[_0xe3a5('0x2d')]['create'](_0x33d361['body'],{})[_0xe3a5('0x25')](respondWithResult(_0x4d6684,0xc9))[_0xe3a5('0x49')](handleError(_0x4d6684,null));};exports[_0xe3a5('0x4a')]=function(_0x1714f8,_0x424e85){if(_0x1714f8[_0xe3a5('0x4b')]['id']){delete _0x1714f8[_0xe3a5('0x4b')]['id'];}return db[_0xe3a5('0x2d')][_0xe3a5('0x47')]({'where':{'id':_0x1714f8['params']['id']}})['then'](handleEntityNotFound(_0x424e85,null))[_0xe3a5('0x25')](saveUpdates(_0x1714f8[_0xe3a5('0x4b')],null))[_0xe3a5('0x25')](respondWithResult(_0x424e85,null))[_0xe3a5('0x49')](handleError(_0x424e85,null));};exports[_0xe3a5('0x24')]=function(_0xb39ebf,_0x4005c1){return db[_0xe3a5('0x2d')][_0xe3a5('0x47')]({'where':{'id':_0xb39ebf['params']['id']}})[_0xe3a5('0x25')](handleEntityNotFound(_0x4005c1,null))[_0xe3a5('0x25')](removeEntity(_0x4005c1,null))[_0xe3a5('0x49')](handleError(_0x4005c1,null));}; \ No newline at end of file +var _0xc23a=['filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','apply','save','update','then','destroy','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','pick'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc23a,0xd2));var _0xac23=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xc23a[_0xc8a931];return _0x28bd27;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xac23('0x0'));var rimraf=require(_0xac23('0x1'));var zipdir=require(_0xac23('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac23('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xac23('0x4'));var util=require('util');var path=require(_0xac23('0x5'));var sox=require(_0xac23('0x6'));var csv=require(_0xac23('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xac23('0x8'));var crypto=require(_0xac23('0x9'));var jsforce=require(_0xac23('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xac23('0x7'));var querystring=require(_0xac23('0xb'));var Papa=require(_0xac23('0xc'));var Redis=require(_0xac23('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac23('0xe'));var logger=require(_0xac23('0xf'))('api');var utils=require(_0xac23('0x10'));var config=require(_0xac23('0x11'));var db=require(_0xac23('0x12'))['db'];function respondWithStatusCode(_0x88567b,_0x261ee1){_0x261ee1=_0x261ee1||0xcc;return function(_0x4340db){if(_0x4340db){return _0x88567b[_0xac23('0x13')](_0x261ee1);}return _0x88567b[_0xac23('0x14')](_0x261ee1)[_0xac23('0x15')]();};}function respondWithResult(_0x257296,_0x4d36dd){_0x4d36dd=_0x4d36dd||0xc8;return function(_0x16f660){if(_0x16f660){return _0x257296[_0xac23('0x14')](_0x4d36dd)['json'](_0x16f660);}};}function respondWithFilteredResult(_0x4c2817,_0x110bef){return function(_0x21d5ee){if(_0x21d5ee){var _0x618735=_0x21d5ee[_0xac23('0x16')],_0x49fa85=_0x110bef[_0xac23('0x17')],_0x138548=_0x110bef['offset']+_0x110bef[_0xac23('0x18')],_0x1c117f;if(_0x138548>=_0x618735){_0x138548=_0x618735;_0x1c117f=0xc8;}else{_0x1c117f=0xce;}_0x4c2817[_0xac23('0x14')](_0x1c117f);return _0x4c2817[_0xac23('0x19')]('Content-Range',_0x49fa85+'-'+_0x138548+'/'+_0x618735)['json'](_0x21d5ee);}return null;};}function patchUpdates(_0x37c6ee){return function(_0x2d1ac1){try{jsonpatch[_0xac23('0x1a')](_0x2d1ac1,_0x37c6ee,!![]);}catch(_0x111130){return BPromise['reject'](_0x111130);}return _0x2d1ac1[_0xac23('0x1b')]();};}function saveUpdates(_0x44bf6c,_0x34c6b8){return function(_0xd39dc2){if(_0xd39dc2){return _0xd39dc2[_0xac23('0x1c')](_0x44bf6c)[_0xac23('0x1d')](function(_0x4efbcb){return _0x4efbcb;});}return null;};}function removeEntity(_0x2a42a2,_0x1b2a89){return function(_0xcdbf38){if(_0xcdbf38){return _0xcdbf38[_0xac23('0x1e')]()[_0xac23('0x1d')](function(){_0x2a42a2['status'](0xcc)[_0xac23('0x15')]();});}};}function handleEntityNotFound(_0x57dacd,_0x33bed2){return function(_0x9239d6){if(!_0x9239d6){_0x57dacd[_0xac23('0x13')](0x194);}return _0x9239d6;};}function handleError(_0x3f57b6,_0x3f1e14){_0x3f1e14=_0x3f1e14||0x1f4;return function(_0x281356){logger['error'](_0x281356[_0xac23('0x1f')]);if(_0x281356['name']){delete _0x281356[_0xac23('0x20')];}_0x3f57b6[_0xac23('0x14')](_0x3f1e14)[_0xac23('0x21')](_0x281356);};}exports[_0xac23('0x22')]=function(_0x2708a7,_0x100a7b){var _0x625160={},_0x2190f8={},_0x29375f={'count':0x0,'rows':[]};var _0x8ea71=_[_0xac23('0x23')](db[_0xac23('0x24')][_0xac23('0x25')],function(_0x27e17b){return{'name':_0x27e17b[_0xac23('0x26')],'type':_0x27e17b['type']['key']};});_0x2190f8[_0xac23('0x27')]=_['map'](_0x8ea71,'name');_0x2190f8[_0xac23('0x28')]=_[_0xac23('0x29')](_0x2708a7['query']);_0x2190f8['filters']=_[_0xac23('0x2a')](_0x2190f8['model'],_0x2190f8['query']);_0x625160[_0xac23('0x2b')]=_[_0xac23('0x2a')](_0x2190f8['model'],qs[_0xac23('0x2c')](_0x2708a7[_0xac23('0x28')]['fields']));_0x625160[_0xac23('0x2b')]=_0x625160[_0xac23('0x2b')][_0xac23('0x2d')]?_0x625160[_0xac23('0x2b')]:_0x2190f8['model'];if(!_0x2708a7[_0xac23('0x28')]['hasOwnProperty'](_0xac23('0x2e'))){_0x625160[_0xac23('0x18')]=qs[_0xac23('0x18')](_0x2708a7[_0xac23('0x28')][_0xac23('0x18')]);_0x625160[_0xac23('0x17')]=qs[_0xac23('0x17')](_0x2708a7[_0xac23('0x28')]['offset']);}_0x625160['order']=qs[_0xac23('0x2f')](_0x2708a7[_0xac23('0x28')][_0xac23('0x2f')]);_0x625160['where']=qs[_0xac23('0x30')](_[_0xac23('0x31')](_0x2708a7[_0xac23('0x28')],_0x2190f8[_0xac23('0x30')]));if(_0x2708a7['query'][_0xac23('0x32')]){_0x625160[_0xac23('0x33')]=_[_0xac23('0x34')](_0x625160[_0xac23('0x33')],{'$or':_[_0xac23('0x23')](_0x8ea71,function(_0x4b784c){if(_0x4b784c[_0xac23('0x35')]!==_0xac23('0x36')){var _0x40a323={};_0x40a323[_0x4b784c[_0xac23('0x20')]]={'$like':'%'+_0x2708a7[_0xac23('0x28')]['filter']+'%'};return _0x40a323;}})});}_0x625160=_[_0xac23('0x34')]({},_0x625160,_0x2708a7[_0xac23('0x37')]);var _0x4300b9={'where':_0x625160['where']};return db[_0xac23('0x24')]['count'](_0x4300b9)['then'](function(_0x44f52b){_0x29375f[_0xac23('0x16')]=_0x44f52b;if(_0x2708a7['query'][_0xac23('0x38')]){_0x625160['include']=[{'all':!![]}];}return db['FaxApplication'][_0xac23('0x39')](_0x625160);})[_0xac23('0x1d')](function(_0x1c9b37){_0x29375f[_0xac23('0x3a')]=_0x1c9b37;return _0x29375f;})['then'](respondWithFilteredResult(_0x100a7b,_0x625160))['catch'](handleError(_0x100a7b,null));};exports[_0xac23('0x3b')]=function(_0x21deac,_0x51a650){var _0x219bef={'raw':!![],'where':{'id':_0x21deac[_0xac23('0x3c')]['id']}},_0x2fd505={};_0x2fd505[_0xac23('0x27')]=_[_0xac23('0x29')](db[_0xac23('0x24')][_0xac23('0x25')]);_0x2fd505[_0xac23('0x28')]=_[_0xac23('0x29')](_0x21deac[_0xac23('0x28')]);_0x2fd505['filters']=_[_0xac23('0x2a')](_0x2fd505[_0xac23('0x27')],_0x2fd505[_0xac23('0x28')]);_0x219bef[_0xac23('0x2b')]=_[_0xac23('0x2a')](_0x2fd505[_0xac23('0x27')],qs[_0xac23('0x2c')](_0x21deac['query'][_0xac23('0x2c')]));_0x219bef['attributes']=_0x219bef[_0xac23('0x2b')][_0xac23('0x2d')]?_0x219bef['attributes']:_0x2fd505['model'];if(_0x21deac[_0xac23('0x28')][_0xac23('0x38')]){_0x219bef['include']=[{'all':!![]}];}_0x219bef=_[_0xac23('0x34')]({},_0x219bef,_0x21deac['options']);return db['FaxApplication']['find'](_0x219bef)['then'](handleEntityNotFound(_0x51a650,null))['then'](respondWithResult(_0x51a650,null))[_0xac23('0x3d')](handleError(_0x51a650,null));};exports['create']=function(_0x81ce28,_0x1819ba){return db[_0xac23('0x24')][_0xac23('0x3e')](_0x81ce28['body'],{})[_0xac23('0x1d')](respondWithResult(_0x1819ba,0xc9))[_0xac23('0x3d')](handleError(_0x1819ba,null));};exports['update']=function(_0x1b9fc7,_0x3444d4){if(_0x1b9fc7['body']['id']){delete _0x1b9fc7[_0xac23('0x3f')]['id'];}return db[_0xac23('0x24')][_0xac23('0x40')]({'where':{'id':_0x1b9fc7[_0xac23('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3444d4,null))['then'](saveUpdates(_0x1b9fc7['body'],null))['then'](respondWithResult(_0x3444d4,null))[_0xac23('0x3d')](handleError(_0x3444d4,null));};exports['destroy']=function(_0x4f0474,_0x4bf383){return db[_0xac23('0x24')]['find']({'where':{'id':_0x4f0474['params']['id']}})[_0xac23('0x1d')](handleEntityNotFound(_0x4bf383,null))[_0xac23('0x1d')](removeEntity(_0x4bf383,null))[_0xac23('0x3d')](handleError(_0x4bf383,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index b57bb90..84a5653 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 _0x607d=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','fax_applications','utf8mb4','lodash'];(function(_0x411df2,_0x223016){var _0x5a71aa=function(_0x4e4022){while(--_0x4e4022){_0x411df2['push'](_0x411df2['shift']());}};_0x5a71aa(++_0x223016);}(_0x607d,0x178));var _0xd607=function(_0x10a00b,_0x2a3c2a){_0x10a00b=_0x10a00b-0x0;var _0x349213=_0x607d[_0x10a00b];return _0x349213;};'use strict';var _=require(_0xd607('0x0'));var util=require(_0xd607('0x1'));var logger=require(_0xd607('0x2'))(_0xd607('0x3'));var moment=require(_0xd607('0x4'));var BPromise=require(_0xd607('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd607('0x6'));var rimraf=require(_0xd607('0x7'));var config=require(_0xd607('0x8'));var attributes=require('./faxApplication.attributes');module[_0xd607('0x9')]=function(_0x2ad0b5,_0x6891b6){return _0x2ad0b5[_0xd607('0xa')]('FaxApplication',attributes,{'tableName':_0xd607('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd607('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x70c5=['define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes'];(function(_0xb3358c,_0x522658){var _0x132077=function(_0x5cc727){while(--_0x5cc727){_0xb3358c['push'](_0xb3358c['shift']());}};_0x132077(++_0x522658);}(_0x70c5,0x66));var _0x570c=function(_0x1ed3b7,_0x2830d4){_0x1ed3b7=_0x1ed3b7-0x0;var _0xd8c958=_0x70c5[_0x1ed3b7];return _0xd8c958;};'use strict';var _=require(_0x570c('0x0'));var util=require(_0x570c('0x1'));var logger=require(_0x570c('0x2'))(_0x570c('0x3'));var moment=require(_0x570c('0x4'));var BPromise=require('bluebird');var rp=require(_0x570c('0x5'));var fs=require('fs');var path=require(_0x570c('0x6'));var rimraf=require(_0x570c('0x7'));var config=require(_0x570c('0x8'));var attributes=require(_0x570c('0x9'));module['exports']=function(_0x13897a,_0x3827d2){return _0x13897a[_0x570c('0xa')]('FaxApplication',attributes,{'tableName':_0x570c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x570c('0xc'),'collate':_0x570c('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index ca1e3ec..6e9a5e6 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 _0xd81e=['FaxApplication','update','options','raw','where','limit','debug','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateFaxApplication'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd81e,0x146));var _0xed81=function(_0x5310e8,_0x629558){_0x5310e8=_0x5310e8-0x0;var _0x17b783=_0xd81e[_0x5310e8];return _0x17b783;};'use strict';var _=require('lodash');var util=require(_0xed81('0x0'));var moment=require(_0xed81('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed81('0x2'));var db=require(_0xed81('0x3'))['db'];var utils=require(_0xed81('0x4'));var logger=require(_0xed81('0x5'))('rpc');var config=require(_0xed81('0x6'));var jayson=require(_0xed81('0x7'));var client=jayson[_0xed81('0x8')][_0xed81('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x343483,_0x5a0a45,_0x163060){return new BPromise(function(_0x187c70,_0x186544){return client[_0xed81('0xa')](_0x343483,_0x163060)[_0xed81('0xb')](function(_0x4ae0c9){logger['info'](_0xed81('0xc'),_0x5a0a45,_0xed81('0xd'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x5a0a45,'request\x20sent',JSON[_0xed81('0xe')](_0x4ae0c9));if(_0x4ae0c9[_0xed81('0xf')]){if(_0x4ae0c9[_0xed81('0xf')][_0xed81('0x10')]===0x1f4){logger[_0xed81('0xf')](_0xed81('0xc'),_0x5a0a45,_0x4ae0c9[_0xed81('0xf')][_0xed81('0x11')]);return _0x186544(_0x4ae0c9[_0xed81('0xf')]['message']);}logger[_0xed81('0xf')](_0xed81('0xc'),_0x5a0a45,_0x4ae0c9['error'][_0xed81('0x11')]);return _0x187c70(_0x4ae0c9[_0xed81('0xf')][_0xed81('0x11')]);}else{logger[_0xed81('0x12')](_0xed81('0xc'),_0x5a0a45,_0xed81('0xd'));_0x187c70(_0x4ae0c9[_0xed81('0x13')]['message']);}})[_0xed81('0x14')](function(_0x3f627b){logger['error'](_0xed81('0xc'),_0x5a0a45,_0x3f627b);_0x186544(_0x3f627b);});});}exports[_0xed81('0x15')]=function(_0xbe864f){var _0x327d6b=this;return new Promise(function(_0x5eb35c,_0x253e91){return db[_0xed81('0x16')][_0xed81('0x17')](_0xbe864f['body'],{'raw':_0xbe864f[_0xed81('0x18')]?_0xbe864f['options'][_0xed81('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbe864f['options']?_0xbe864f[_0xed81('0x18')][_0xed81('0x1a')]||null:null,'attributes':_0xbe864f[_0xed81('0x18')]?_0xbe864f['options']['attributes']||null:null,'limit':_0xbe864f['options']?_0xbe864f[_0xed81('0x18')][_0xed81('0x1b')]||null:null})[_0xed81('0xb')](function(_0x468c45){logger[_0xed81('0x12')](_0xed81('0x15'),_0xbe864f);logger[_0xed81('0x1c')](_0xed81('0x15'),_0xbe864f,JSON[_0xed81('0xe')](_0x468c45));_0x5eb35c(_0x468c45);})[_0xed81('0x14')](function(_0x3b0cb2){logger['error'](_0xed81('0x15'),_0x3b0cb2[_0xed81('0x11')],_0xbe864f);_0x253e91(_0x327d6b['error'](0x1f4,_0x3b0cb2[_0xed81('0x11')]));});});}; \ No newline at end of file +var _0x4524=['catch','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','limit','debug','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','FaxApplication,\x20%s,\x20%s','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result'];(function(_0x421c56,_0x4efd00){var _0x49b244=function(_0x5cd079){while(--_0x5cd079){_0x421c56['push'](_0x421c56['shift']());}};_0x49b244(++_0x4efd00);}(_0x4524,0xf2));var _0x4452=function(_0x14be2b,_0x7420b1){_0x14be2b=_0x14be2b-0x0;var _0x3f2632=_0x4524[_0x14be2b];return _0x3f2632;};'use strict';var _=require('lodash');var util=require(_0x4452('0x0'));var moment=require('moment');var BPromise=require(_0x4452('0x1'));var rs=require(_0x4452('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4452('0x3'));var logger=require('../../config/logger')(_0x4452('0x4'));var config=require(_0x4452('0x5'));var jayson=require(_0x4452('0x6'));var client=jayson[_0x4452('0x7')][_0x4452('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5eb5be,_0x136913,_0x3f5dfe){return new BPromise(function(_0x39626e,_0x38444e){return client['request'](_0x5eb5be,_0x3f5dfe)[_0x4452('0x9')](function(_0x9d4033){logger['info'](_0x4452('0xa'),_0x136913,'request\x20sent');logger['debug'](_0x4452('0xb'),_0x136913,'request\x20sent',JSON[_0x4452('0xc')](_0x9d4033));if(_0x9d4033[_0x4452('0xd')]){if(_0x9d4033[_0x4452('0xd')][_0x4452('0xe')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x136913,_0x9d4033[_0x4452('0xd')]['message']);return _0x38444e(_0x9d4033[_0x4452('0xd')][_0x4452('0xf')]);}logger['error'](_0x4452('0xa'),_0x136913,_0x9d4033['error'][_0x4452('0xf')]);return _0x39626e(_0x9d4033[_0x4452('0xd')][_0x4452('0xf')]);}else{logger[_0x4452('0x10')](_0x4452('0xa'),_0x136913,_0x4452('0x11'));_0x39626e(_0x9d4033[_0x4452('0x12')]['message']);}})[_0x4452('0x13')](function(_0x543b8b){logger[_0x4452('0xd')](_0x4452('0xa'),_0x136913,_0x543b8b);_0x38444e(_0x543b8b);});});}exports[_0x4452('0x14')]=function(_0x8c6c02){var _0x3a91fb=this;return new Promise(function(_0x425b5b,_0x4772b6){return db[_0x4452('0x15')]['update'](_0x8c6c02[_0x4452('0x16')],{'raw':_0x8c6c02[_0x4452('0x17')]?_0x8c6c02[_0x4452('0x17')][_0x4452('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8c6c02[_0x4452('0x17')]?_0x8c6c02['options'][_0x4452('0x19')]||null:null,'attributes':_0x8c6c02[_0x4452('0x17')]?_0x8c6c02[_0x4452('0x17')][_0x4452('0x1a')]||null:null,'limit':_0x8c6c02[_0x4452('0x17')]?_0x8c6c02[_0x4452('0x17')][_0x4452('0x1b')]||null:null})[_0x4452('0x9')](function(_0x52b207){logger[_0x4452('0x10')](_0x4452('0x14'),_0x8c6c02);logger[_0x4452('0x1c')](_0x4452('0x14'),_0x8c6c02,JSON['stringify'](_0x52b207));_0x425b5b(_0x52b207);})[_0x4452('0x13')](function(_0x35ff18){logger[_0x4452('0xd')]('UpdateFaxApplication',_0x35ff18[_0x4452('0xf')],_0x8c6c02);_0x4772b6(_0x3a91fb[_0x4452('0xd')](0x1f4,_0x35ff18[_0x4452('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 308e39b..e7043cd 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 _0xee14=['index','/:id','isAuthenticated','show','post','create','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get'];(function(_0x2b4c99,_0x2d5b0f){var _0xece969=function(_0x5c5df4){while(--_0x5c5df4){_0x2b4c99['push'](_0x2b4c99['shift']());}};_0xece969(++_0x2d5b0f);}(_0xee14,0x13a));var _0x4ee1=function(_0x1c8918,_0x356371){_0x1c8918=_0x1c8918-0x0;var _0xa287ad=_0xee14[_0x1c8918];return _0xa287ad;};'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 auth=require(_0x4ee1('0x4'));var interaction=require(_0x4ee1('0x5'));var config=require(_0x4ee1('0x6'));var controller=require(_0x4ee1('0x7'));router[_0x4ee1('0x8')]('/',auth['isAuthenticated'](),controller[_0x4ee1('0x9')]);router['get'](_0x4ee1('0xa'),auth[_0x4ee1('0xb')](),controller[_0x4ee1('0xc')]);router[_0x4ee1('0xd')]('/',auth[_0x4ee1('0xb')](),controller[_0x4ee1('0xe')]);router['put'](_0x4ee1('0xa'),auth[_0x4ee1('0xb')](),controller['update']);router[_0x4ee1('0xf')](_0x4ee1('0xa'),auth[_0x4ee1('0xb')](),controller[_0x4ee1('0x10')]);module['exports']=router; \ No newline at end of file +var _0xeff8=['index','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxApplication.controller','get'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xeff8,0x186));var _0x8eff=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0xeff8[_0x3afe18];return _0x19ed1f;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8eff('0x5'));var config=require(_0x8eff('0x6'));var controller=require(_0x8eff('0x7'));router[_0x8eff('0x8')]('/',auth['isAuthenticated'](),controller[_0x8eff('0x9')]);router[_0x8eff('0x8')](_0x8eff('0xa'),auth[_0x8eff('0xb')](),controller['show']);router[_0x8eff('0xc')]('/',auth[_0x8eff('0xb')](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x8eff('0xf')]);router[_0x8eff('0x10')](_0x8eff('0xa'),auth['isAuthenticated'](),controller[_0x8eff('0x11')]);module[_0x8eff('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 6ad47e3..44837fe 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 _0x63cb=['DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x24717a,_0x26f6dc){var _0x32cf54=function(_0x1282a6){while(--_0x1282a6){_0x24717a['push'](_0x24717a['shift']());}};_0x32cf54(++_0x26f6dc);}(_0x63cb,0x112));var _0xb63c=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x63cb[_0x119280];return _0x481797;};'use strict';var Sequelize=require(_0xb63c('0x0'));module[_0xb63c('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb63c('0x2')]},'disposition':{'type':Sequelize[_0xb63c('0x3')]},'note':{'type':Sequelize[_0xb63c('0x3')]},'read1stAt':{'type':Sequelize[_0xb63c('0x2')]},'fax':{'type':Sequelize[_0xb63c('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb63c('0x4')]('in',_0xb63c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb63c('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xb63c('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x8fe9=['ENUM','exports','BOOLEAN','DATE','STRING','out'];(function(_0x3b6032,_0x3b7841){var _0x526885=function(_0xd2537f){while(--_0xd2537f){_0x3b6032['push'](_0x3b6032['shift']());}};_0x526885(++_0x3b7841);}(_0x8fe9,0x115));var _0x98fe=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0x8fe9[_0x5756c6];return _0x4b5806;};'use strict';var Sequelize=require('sequelize');module[_0x98fe('0x0')]={'closed':{'type':Sequelize[_0x98fe('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x98fe('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x98fe('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x98fe('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x98fe('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x98fe('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x98fe('0x5')]('in',_0x98fe('0x4')),'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 1f58b5d..605efc5 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 _0x9999=['hasOwnProperty','nolimit','limit','sort','where','filters','pick','select','field','from','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','getFullTextValue','ContactId','buildExpression','text','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','keys','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','unreadMessages','order','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','all','rows','show','params','include','options','create','body','describe','addMessage','FaxMessage','ids','getMessages','format','includeAll','findAll','setTags','omit','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','root','server','files','tmp','attachments','join','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','createReadStream','pipe','createWriteStream','basename','log','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','Users','fullname','TagIds','Tags','split','push','catch','index','map','FaxInteraction','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length'];(function(_0xfb86f6,_0x127103){var _0x534a4b=function(_0x2a2a1b){while(--_0x2a2a1b){_0xfb86f6['push'](_0xfb86f6['shift']());}};_0x534a4b(++_0x127103);}(_0x9999,0x166));var _0x9999=function(_0x4417af,_0x58a168){_0x4417af=_0x4417af-0x0;var _0x4a396e=_0x9999[_0x4417af];return _0x4a396e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9999('0x0'));var rimraf=require(_0x9999('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9999('0x2'));var rp=require(_0x9999('0x3'));var moment=require('moment');var BPromise=require(_0x9999('0x4'));var Mustache=require(_0x9999('0x5'));var util=require(_0x9999('0x6'));var path=require('path');var sox=require(_0x9999('0x7'));var csv=require(_0x9999('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9999('0x9'));var squel=require(_0x9999('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9999('0x8'));var querystring=require(_0x9999('0xb'));var Papa=require(_0x9999('0xc'));var Redis=require(_0x9999('0xd'));var authService=require(_0x9999('0xe'));var qs=require(_0x9999('0xf'));var as=require(_0x9999('0x10'));var hardwareService=require(_0x9999('0x11'));var logger=require('../../config/logger')(_0x9999('0x12'));var utils=require(_0x9999('0x13'));var config=require('../../config/environment');var db=require(_0x9999('0x14'))['db'];config['redis']=_[_0x9999('0x15')](config[_0x9999('0x16')],{'host':_0x9999('0x17'),'port':0x18eb});var socket=require(_0x9999('0x18'))(new Redis(config[_0x9999('0x16')]));require(_0x9999('0x19'))[_0x9999('0x1a')](socket);function respondWithStatusCode(_0x584a12,_0x88bc49){_0x88bc49=_0x88bc49||0xcc;return function(_0x9d99d6){if(_0x9d99d6){return _0x584a12[_0x9999('0x1b')](_0x88bc49);}return _0x584a12[_0x9999('0x1c')](_0x88bc49)[_0x9999('0x1d')]();};}function respondWithResult(_0xbee23,_0x2a8f83){_0x2a8f83=_0x2a8f83||0xc8;return function(_0x2a6c8a){if(_0x2a6c8a){return _0xbee23[_0x9999('0x1c')](_0x2a8f83)[_0x9999('0x1e')](_0x2a6c8a);}};}function respondWithFilteredResult(_0x5349ba,_0x5cf5fd){return function(_0x3e154f){if(_0x3e154f){var _0x5456fe=_0x3e154f[_0x9999('0x1f')],_0x3ded5a=_0x5cf5fd[_0x9999('0x20')],_0x5dfc85=_0x5cf5fd['offset']+_0x5cf5fd['limit'],_0xa13f12;if(_0x5dfc85>=_0x5456fe){_0x5dfc85=_0x5456fe;_0xa13f12=0xc8;}else{_0xa13f12=0xce;}_0x5349ba[_0x9999('0x1c')](_0xa13f12);return _0x5349ba[_0x9999('0x21')](_0x9999('0x22'),_0x3ded5a+'-'+_0x5dfc85+'/'+_0x5456fe)[_0x9999('0x1e')](_0x3e154f);}return null;};}function patchUpdates(_0x4dc0f3){return function(_0x4d2dc9){try{jsonpatch[_0x9999('0x23')](_0x4d2dc9,_0x4dc0f3,!![]);}catch(_0x44a67e){return BPromise[_0x9999('0x24')](_0x44a67e);}return _0x4d2dc9[_0x9999('0x25')]();};}function saveUpdates(_0x16d20e,_0xea1d4c){return function(_0x1c9340){if(_0x1c9340){return _0x1c9340[_0x9999('0x26')](_0x16d20e)['then'](function(_0x4539a9){return _0x4539a9;});}return null;};}function removeEntity(_0x3581ba,_0x5eb245){return function(_0x2d2366){if(_0x2d2366){return _0x2d2366[_0x9999('0x27')]()[_0x9999('0x28')](function(){_0x3581ba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x204358,_0x1e5b14){return function(_0x13fd88){if(!_0x13fd88){_0x204358[_0x9999('0x1b')](0x194);}return _0x13fd88;};}function handleError(_0x49dce6,_0xedc803){_0xedc803=_0xedc803||0x1f4;return function(_0x5d7f18){logger[_0x9999('0x29')](_0x5d7f18[_0x9999('0x2a')]);if(_0x5d7f18[_0x9999('0x2b')]){delete _0x5d7f18['name'];}_0x49dce6[_0x9999('0x1c')](_0xedc803)['send'](_0x5d7f18);};}function getInteractionUsers(_0x514b12,_0x1ed48b){return new BPromise(function(_0x17276c,_0x38c4e1){try{if(_0x1ed48b[_0x514b12['id']]){_0x514b12[_0x9999('0x2c')]=_['map'](_0x1ed48b[_0x514b12['id']],function(_0x3e47f5){return{'id':_0x3e47f5['id'],'fullname':_0x3e47f5[_0x9999('0x2d')]};});}}catch(_0x3b8e50){_0x38c4e1(_0x3b8e50);}_0x17276c(_0x514b12);});}function getInteractionTags(_0x52e42a,_0x5b8804){return new BPromise(function(_0x57fcec,_0x283389){try{if(_0x52e42a[_0x9999('0x2e')]){_0x52e42a[_0x9999('0x2f')]=[];_0x52e42a['TagIds'][_0x9999('0x30')](',')['forEach'](function(_0x3d22dc){_0x52e42a[_0x9999('0x2f')][_0x9999('0x31')](_0x5b8804[_0x3d22dc]);});}delete _0x52e42a[_0x9999('0x2e')];}catch(_0x2f64b2){_0x283389(_0x2f64b2);}_0x57fcec(_0x52e42a);});}function updateFaxInteraction(_0x1d5243,_0x1669be,_0x489326){return new BPromise(function(_0x42c071,_0x18c762){return getInteractionUsers(_0x1d5243,_0x489326)['then'](function(_0x1ed368){return getInteractionTags(_0x1ed368,_0x1669be);})['then'](function(_0x4a0837){_0x42c071(_0x4a0837);})[_0x9999('0x32')](function(_0x44f766){_0x18c762(_0x44f766);});});}exports[_0x9999('0x33')]=function(_0x3810a9,_0xd03584){var _0x1a4de6={},_0x5b06a4={},_0xaf246={'count':0x0,'rows':[]};var _0x427ef9=_[_0x9999('0x34')](db[_0x9999('0x35')][_0x9999('0x36')],function(_0x31c54f){return{'name':_0x31c54f[_0x9999('0x37')],'type':_0x31c54f[_0x9999('0x38')][_0x9999('0x39')]};});_0x5b06a4[_0x9999('0x3a')]=_[_0x9999('0x34')](_0x427ef9,'name');_0x5b06a4['query']=_['keys'](_0x3810a9['query']);_0x5b06a4['filters']=_['intersection'](_0x5b06a4[_0x9999('0x3a')],_0x5b06a4[_0x9999('0x3b')]);_0x1a4de6['attributes']=_[_0x9999('0x3c')](_0x5b06a4[_0x9999('0x3a')],qs['fields'](_0x3810a9[_0x9999('0x3b')][_0x9999('0x3d')]));_0x1a4de6['attributes']=_0x1a4de6[_0x9999('0x3e')][_0x9999('0x3f')]?_0x1a4de6['attributes']:_0x5b06a4[_0x9999('0x3a')];if(!_0x3810a9['query'][_0x9999('0x40')](_0x9999('0x41'))){_0x1a4de6['limit']=qs['limit'](_0x3810a9[_0x9999('0x3b')][_0x9999('0x42')]);_0x1a4de6[_0x9999('0x20')]=qs['offset'](_0x3810a9[_0x9999('0x3b')][_0x9999('0x20')]);}_0x1a4de6['order']=qs[_0x9999('0x43')](_0x3810a9[_0x9999('0x3b')][_0x9999('0x43')]);_0x1a4de6[_0x9999('0x44')]=qs[_0x9999('0x45')](_[_0x9999('0x46')](_0x3810a9['query'],_0x5b06a4[_0x9999('0x45')]));var _0x35bbd9=[];var _0x345a75=squel[_0x9999('0x47')]()[_0x9999('0x48')]('id')[_0x9999('0x48')](_0x9999('0x2b'))[_0x9999('0x48')]('color')[_0x9999('0x49')](_0x9999('0x4a'));var _0x531a6a=squel[_0x9999('0x47')]()[_0x9999('0x48')](_0x9999('0x4b'))[_0x9999('0x48')]('u.fullname')['field'](_0x9999('0x4c'))[_0x9999('0x49')](_0x9999('0x4d'),'ui')[_0x9999('0x4e')](_0x9999('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x1bd29d=squel[_0x9999('0x47')]()[_0x9999('0x49')]('fax_interactions','i')[_0x9999('0x4e')](_0x9999('0x50'),'c',_0x9999('0x51'))[_0x9999('0x4e')]('users','o',_0x9999('0x52'))[_0x9999('0x4e')](_0x9999('0x53'),'a',_0x9999('0x54'))['left_join'](_0x9999('0x55'),'me',_0x9999('0x56'))['left_join'](_0x9999('0x57'),'it',_0x9999('0x58'))[_0x9999('0x4e')](_0x9999('0x4a'),'t',_0x9999('0x59'));var _0x5a68be=squel[_0x9999('0x5a')]();var _0x4da68e=[];var _0x2ab954=squel[_0x9999('0x5a')]();var _0x4340cb;if(_0x3810a9[_0x9999('0x3b')][_0x9999('0x5b')]){_0x4340cb=as[_0x9999('0x5c')](_0x3810a9[_0x9999('0x3b')][_0x9999('0x5b')]);var _0x698a38=_0x4340cb[_0x9999('0x5d')];for(var _0xd58dd6=0x0;_0xd58dd6<_0x4340cb[_0x9999('0x5e')][_0x9999('0x3f')];_0xd58dd6++){var _0x2d6a68=_0x4340cb[_0x9999('0x5e')][_0xd58dd6];var _0x2fbd84='i';var _0x1789c0=_[_0x9999('0x5f')](_0x427ef9,[_0x9999('0x2b'),_0x2d6a68['field']]);if(!_0x1789c0){switch(_0x2d6a68[_0x9999('0x48')]){case'unreadMessages':if(_0x2d6a68[_0x9999('0x60')]==0x1){_0x1bd29d[_0x9999('0x61')]('`'+_0x2d6a68['field']+_0x9999('0x62'));}else{_0x1bd29d[_0x9999('0x61')]('`'+_0x2d6a68[_0x9999('0x48')]+_0x9999('0x63'));}break;case'Contact':if(_0x2d6a68[_0x9999('0x64')]===_0x9999('0x65')){if(_0x2d6a68[_0x9999('0x60')][_0x9999('0x30')]('\x20')['length']>0x1){_0x5a68be[_0x698a38]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9999('0x66')](_0x2d6a68[_0x9999('0x60')]),null);}else{var _0x21d7df='%'+_0x2d6a68[_0x9999('0x60')]+'%';_0x5a68be[_0x698a38]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x21d7df,_0x21d7df,_0x21d7df);}}else{_0x1789c0=_['find'](_0x427ef9,[_0x9999('0x2b'),_0x9999('0x67')]);_0x2d6a68[_0x9999('0x48')]=_0x9999('0x67');_0x4d70a2=as[_0x9999('0x68')](_0x2fbd84,_0x1789c0[_0x9999('0x38')],_0x2d6a68);_0x5a68be[_0x698a38](_0x4d70a2[_0x9999('0x69')],_0x4d70a2[_0x9999('0x60')]['start'],_0x4d70a2['value'][_0x9999('0x1d')]);}break;case'Tag':var _0x422b03=_0x2d6a68['value'][_0x9999('0x30')](',')[_0x9999('0x34')](function(_0x518af0){return Number(_0x518af0);});_0x422b03[_0x9999('0x6a')](function(_0x304de3){_0x2ab954['or'](_0x9999('0x6b'),'%,'+_0x304de3+',%');});_0x4da68e=_[_0x9999('0x6c')](_0x4da68e,_0x422b03);break;case'User':if(_0x2d6a68[_0x9999('0x64')]==='$substring'){_0x5a68be[_0x698a38](_0x9999('0x6d'),'%'+_0x2d6a68[_0x9999('0x60')]+'%',null);}else{_0x1789c0=_['find'](_0x427ef9,[_0x9999('0x2b'),_0x9999('0x6e')]);_0x2d6a68[_0x9999('0x48')]='UserId';_0x4d70a2=as['buildExpression'](_0x2fbd84,_0x1789c0[_0x9999('0x38')],_0x2d6a68);_0x5a68be[_0x698a38](_0x4d70a2[_0x9999('0x69')],_0x4d70a2[_0x9999('0x60')]['start'],_0x4d70a2[_0x9999('0x60')]['end']);}break;case'body':_0x4d70a2=as['buildExpression']('me',null,_0x2d6a68);_0x5a68be[_0x698a38](_0x4d70a2[_0x9999('0x69')],_0x4d70a2['value'][_0x9999('0x6f')],_0x4d70a2[_0x9999('0x60')][_0x9999('0x1d')]);break;}}else{var _0x4d70a2=as['buildExpression'](_0x2fbd84,_0x1789c0['type'],_0x2d6a68);_0x5a68be[_0x698a38](_0x4d70a2['text'],_0x4d70a2[_0x9999('0x60')][_0x9999('0x6f')],_0x4d70a2['value'][_0x9999('0x1d')]);}}}else{var _0x178c12=_(_0x3810a9[_0x9999('0x3b')])[_0x9999('0x70')]()[_0x9999('0x34')](function(_0x7657b){return _['some'](_0x427ef9,[_0x9999('0x2b'),_0x7657b])?_0x7657b:undefined;})['compact']()[_0x9999('0x60')]();if(!_[_0x9999('0x71')](_0x178c12)){_0x178c12[_0x9999('0x6a')](function(_0xc7e398){if(_0xc7e398===_0x9999('0x72')){_0x1bd29d[_0x9999('0x44')](_0x9999('0x73'),[][_0x9999('0x74')](_0x3810a9[_0x9999('0x3b')][_0xc7e398]));}else if(_0xc7e398===_0x9999('0x75')){var _0x5a0583=JSON[_0x9999('0x76')](_0x3810a9[_0x9999('0x3b')][_0xc7e398])[_0x9999('0x77')];var _0x2b4d56=JSON[_0x9999('0x76')](_0x3810a9[_0x9999('0x3b')][_0xc7e398])[_0x9999('0x78')];_0x1bd29d[_0x9999('0x44')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5a0583,_0x2b4d56);}else{if(_0x3810a9['query'][_0xc7e398]===_0x9999('0x79')){_0x1bd29d[_0x9999('0x44')]('i.'+_0xc7e398+_0x9999('0x7a'));}else{_0x1bd29d[_0x9999('0x44')]('i.'+_0xc7e398+_0x9999('0x7b'),_0x3810a9[_0x9999('0x3b')][_0xc7e398]);}}});}if(_0x3810a9['query']['read']){if(_0x3810a9[_0x9999('0x3b')]['read']==0x1){_0x1bd29d[_0x9999('0x61')](_0x9999('0x7c'));}else{_0x1bd29d['having'](_0x9999('0x7d'));}}if(_0x3810a9[_0x9999('0x3b')]['tag']){_0x4da68e=_[_0x9999('0x7e')](_0x3810a9[_0x9999('0x3b')][_0x9999('0x7f')])?_0x3810a9[_0x9999('0x3b')]['tag']:new Array(_0x3810a9['query'][_0x9999('0x7f')]);_0x4da68e[_0x9999('0x6a')](function(_0xf60e55){_0x2ab954['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xf60e55+',%');});}if(_0x3810a9[_0x9999('0x3b')][_0x9999('0x80')]){var _0x516aed=_0x3810a9['query']['filter'][_0x9999('0x81')]('\x5c','\x5c\x5c')[_0x9999('0x81')]('\x27\x27',_0x9999('0x82'));if(qs['isNumeric'](_0x516aed)){_0x5a68be['or'](_0x9999('0x83'),_0x516aed+'%')['or']('i.fax\x20LIKE\x20?',_0x516aed+'%');}_0x5a68be['or'](_0x9999('0x84'),_0x516aed+'%');}}_0x1bd29d['where'](_0x5a68be);_0x1bd29d[_0x9999('0x85')]('i.id');var _0x3f18d1={'type':db[_0x9999('0x86')][_0x9999('0x87')][_0x9999('0x88')],'raw':!![]};var _0x3c1aa9=_0x1bd29d[_0x9999('0x89')]();_0x3c1aa9[_0x9999('0x48')](_0x9999('0x8a'));_0x3c1aa9[_0x9999('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9999('0x8b'));if(_0x1a4de6[_0x9999('0x8c')]){_0x1a4de6[_0x9999('0x8c')]['forEach'](function(_0x27f5c1){_0x1bd29d[_0x9999('0x8c')]('i.'+_0x27f5c1[0x0],_0x27f5c1[0x1]===_0x9999('0x8d')?![]:!![]);});}if(!_[_0x9999('0x71')](_0x4da68e)){_0x1bd29d[_0x9999('0x61')](_0x2ab954);_0x3c1aa9[_0x9999('0x44')](_0x9999('0x8e'),_0x4da68e);}BPromise[_0x9999('0x8f')]()['then'](function(){if(!_0x4340cb){if(_0x3810a9[_0x9999('0x3b')]['FaxAccountId']||_0x3810a9[_0x9999('0x3b')]['journey'])return;_0x3c1aa9[_0x9999('0x44')](_0x9999('0x90'));_0x1bd29d['where'](_0x9999('0x90'));return;}return _0x3810a9[_0x9999('0x91')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x2a47d6){if(_[_0x9999('0x71')](_0x2a47d6)){_0x3c1aa9['where']('i.FaxAccountId\x20IS\x20NULL');_0x1bd29d[_0x9999('0x44')](_0x9999('0x92'));}else{_0x3c1aa9[_0x9999('0x44')](_0x9999('0x73'),_[_0x9999('0x34')](_0x2a47d6,'id'));_0x1bd29d['where'](_0x9999('0x73'),_[_0x9999('0x34')](_0x2a47d6,'id'));}});})[_0x9999('0x28')](function(){db[_0x9999('0x93')][_0x9999('0x3b')](_0x3c1aa9[_0x9999('0x94')](),_0x3f18d1)[_0x9999('0x28')](function(_0x19d282){_0xaf246[_0x9999('0x1f')]=_0x19d282[_0x9999('0x3f')];if(_0xaf246[_0x9999('0x1f')]===0x0)return[];return db[_0x9999('0x93')]['query'](_0x345a75[_0x9999('0x94')](),_0x3f18d1)[_0x9999('0x28')](function(_0x28ce1d){_0x35bbd9=_['keyBy'](_0x28ce1d,'id');_0x3f18d1=_[_0x9999('0x95')](_0x3f18d1,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3810a9[_0x9999('0x3b')][_0x9999('0x3d')]){_0x1a4de6[_0x9999('0x3e')]['forEach'](function(_0x13607c){_0x1bd29d[_0x9999('0x48')]('i.'+_0x13607c);});}else{_0x1bd29d[_0x9999('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9999('0x8b'));_0x1bd29d[_0x9999('0x48')]('a.key',_0x9999('0x96'));_0x1bd29d[_0x9999('0x48')](_0x9999('0x97'),_0x9999('0x98'));_0x1bd29d[_0x9999('0x48')](_0x9999('0x99'));_0x1bd29d[_0x9999('0x48')]('c.firstName',_0x9999('0x9a'));_0x1bd29d['field'](_0x9999('0x9b'),'Contact.lastName');_0x1bd29d[_0x9999('0x48')](_0x9999('0x9c'),_0x9999('0x9d'));_0x1bd29d[_0x9999('0x48')](_0x9999('0x9e'),_0x9999('0x9f'));_0x1bd29d['field']('c.mobile',_0x9999('0xa0'));_0x1bd29d[_0x9999('0x48')](_0x9999('0xa1'),'Contact.fax');_0x1bd29d['field'](_0x9999('0xa2'),_0x9999('0xa3'));_0x1bd29d[_0x9999('0x48')](_0x9999('0xa4'),'Owner.internal');_0x1bd29d[_0x9999('0x48')](_0x9999('0xa5'),_0x9999('0x2e'));}_0x1bd29d['limit'](_0x1a4de6['limit']);_0x1bd29d[_0x9999('0x20')](_0x1a4de6[_0x9999('0x20')]);return db['sequelize'][_0x9999('0x3b')](_0x1bd29d[_0x9999('0x94')](),_0x3f18d1);})['then'](function(_0x3e3816){_0x531a6a[_0x9999('0x44')]('ui.FaxInteractionId\x20IN\x20?',_[_0x9999('0x34')](_0x3e3816,'id'));return db[_0x9999('0x93')][_0x9999('0x3b')](_0x531a6a['toString'](),_0x3f18d1)[_0x9999('0x28')](function(_0x3172a8){var _0x1ab6c5=_[_0x9999('0xa6')](_0x3172a8,_0x9999('0xa7'));var _0x395a7a=[];_0x3e3816[_0x9999('0x6a')](function(_0x5fd973){_0x395a7a[_0x9999('0x31')](updateFaxInteraction(_0x5fd973,_0x35bbd9,_0x1ab6c5));});return BPromise[_0x9999('0xa8')](_0x395a7a);});});})['then'](function(_0x384204){_0xaf246[_0x9999('0xa9')]=_0x384204;return _0xaf246;})[_0x9999('0x28')](respondWithFilteredResult(_0xd03584,_0x1a4de6));})[_0x9999('0x32')](handleError(_0xd03584,null));};exports[_0x9999('0xaa')]=function(_0x281869,_0x4cf322){var _0x5ecee9={'raw':![],'where':{'id':_0x281869[_0x9999('0xab')]['id']}},_0x474e33={};_0x474e33[_0x9999('0x3a')]=_[_0x9999('0x70')](db[_0x9999('0x35')][_0x9999('0x36')]);_0x474e33[_0x9999('0x3b')]=_[_0x9999('0x70')](_0x281869[_0x9999('0x3b')]);_0x474e33[_0x9999('0x45')]=_[_0x9999('0x3c')](_0x474e33[_0x9999('0x3a')],_0x474e33[_0x9999('0x3b')]);_0x5ecee9[_0x9999('0x3e')]=_[_0x9999('0x3c')](_0x474e33[_0x9999('0x3a')],qs[_0x9999('0x3d')](_0x281869[_0x9999('0x3b')][_0x9999('0x3d')]));_0x5ecee9[_0x9999('0x3e')]=_0x5ecee9[_0x9999('0x3e')]['length']?_0x5ecee9['attributes']:_0x474e33[_0x9999('0x3a')];if(_0x281869[_0x9999('0x3b')]['includeAll']){_0x5ecee9[_0x9999('0xac')]=[{'all':!![]}];}_0x5ecee9=_[_0x9999('0x95')]({},_0x5ecee9,_0x281869[_0x9999('0xad')]);return db[_0x9999('0x35')]['find'](_0x5ecee9)[_0x9999('0x28')](handleEntityNotFound(_0x4cf322,null))[_0x9999('0x28')](respondWithResult(_0x4cf322,null))['catch'](handleError(_0x4cf322,null));};exports['create']=function(_0xe4ddf2,_0x3ca634){return db[_0x9999('0x35')][_0x9999('0xae')](_0xe4ddf2['body'],{})[_0x9999('0x28')](respondWithResult(_0x3ca634,0xc9))[_0x9999('0x32')](handleError(_0x3ca634,null));};exports[_0x9999('0x26')]=function(_0x5bddf0,_0x1c55a7){if(_0x5bddf0[_0x9999('0xaf')]['id']){delete _0x5bddf0[_0x9999('0xaf')]['id'];}return db['FaxInteraction'][_0x9999('0x5f')]({'where':{'id':_0x5bddf0[_0x9999('0xab')]['id']}})[_0x9999('0x28')](handleEntityNotFound(_0x1c55a7,null))[_0x9999('0x28')](saveUpdates(_0x5bddf0[_0x9999('0xaf')],null))['then'](respondWithResult(_0x1c55a7,null))['catch'](handleError(_0x1c55a7,null));};exports[_0x9999('0x27')]=function(_0x96957c,_0x340bf9){return db[_0x9999('0x35')][_0x9999('0x5f')]({'where':{'id':_0x96957c[_0x9999('0xab')]['id']}})[_0x9999('0x28')](handleEntityNotFound(_0x340bf9,null))[_0x9999('0x28')](removeEntity(_0x340bf9,null))[_0x9999('0x32')](handleError(_0x340bf9,null));};exports[_0x9999('0xb0')]=function(_0x13e8df,_0xfa4fa9){return db['FaxInteraction']['describe']()[_0x9999('0x28')](respondWithResult(_0xfa4fa9,null))[_0x9999('0x32')](handleError(_0xfa4fa9,null));};exports[_0x9999('0xb1')]=function(_0x4378e0,_0x36dae9,_0x8c328f){return db[_0x9999('0xb2')][_0x9999('0x5f')]({'where':{'id':_0x4378e0['params']['id']}})[_0x9999('0x28')](handleEntityNotFound(_0x36dae9,null))[_0x9999('0x28')](function(_0x48ab37){if(_0x48ab37){return _0x48ab37['addMessage'](_0x4378e0[_0x9999('0xaf')]['ids'],_['omit'](_0x4378e0['body'],[_0x9999('0xb3'),'id'])||{});}})[_0x9999('0x28')](respondWithResult(_0x36dae9,null))[_0x9999('0x32')](handleError(_0x36dae9,null));};exports[_0x9999('0xb4')]=function(_0x18bc21,_0x3ede33,_0x43e96a){var _0x14162c={'raw':![],'where':{}};var _0x2227f4={};var _0x392f59={'count':0x0,'rows':[]};return db[_0x9999('0x35')]['findOne']({'where':{'id':_0x18bc21[_0x9999('0xab')]['id']}})[_0x9999('0x28')](handleEntityNotFound(_0x3ede33,null))[_0x9999('0x28')](function(_0x22a549){if(_0x22a549){_0x2227f4[_0x9999('0x3a')]=_[_0x9999('0x70')](db[_0x9999('0xb2')][_0x9999('0x36')]);_0x2227f4[_0x9999('0x3b')]=_[_0x9999('0x70')](_0x18bc21[_0x9999('0x3b')]);_0x2227f4[_0x9999('0x45')]=_[_0x9999('0x3c')](_0x2227f4['model'],_0x2227f4[_0x9999('0x3b')]);_0x14162c[_0x9999('0x3e')]=_[_0x9999('0x3c')](_0x2227f4[_0x9999('0x3a')],qs[_0x9999('0x3d')](_0x18bc21[_0x9999('0x3b')][_0x9999('0x3d')]));_0x14162c[_0x9999('0x3e')]=_0x14162c[_0x9999('0x3e')][_0x9999('0x3f')]?_0x14162c['attributes']:_0x2227f4[_0x9999('0x3a')];if(!_0x18bc21[_0x9999('0x3b')]['hasOwnProperty']('nolimit')){_0x14162c[_0x9999('0x42')]=qs[_0x9999('0x42')](_0x18bc21['query'][_0x9999('0x42')]);_0x14162c['offset']=qs[_0x9999('0x20')](_0x18bc21[_0x9999('0x3b')][_0x9999('0x20')]);}_0x14162c[_0x9999('0x8c')]=qs[_0x9999('0x43')](_0x18bc21[_0x9999('0x3b')][_0x9999('0x43')]);_0x14162c[_0x9999('0x44')]=qs[_0x9999('0x45')](_['pick'](_0x18bc21[_0x9999('0x3b')],_0x2227f4[_0x9999('0x45')]));_0x14162c[_0x9999('0x44')][_0x9999('0xa7')]=_0x22a549['id'];if(_0x18bc21[_0x9999('0x3b')][_0x9999('0x80')]){_0x14162c['where']=_[_0x9999('0x95')](_0x14162c[_0x9999('0x44')],{'$or':_[_0x9999('0x34')](_0x14162c['attributes'],function(_0x237488){var _0x80d171={};_0x80d171[_0x237488]={'$like':'%'+_0x18bc21[_0x9999('0x3b')][_0x9999('0x80')]+'%'};return _0x80d171;})});}if(_0x18bc21['query'][_0x9999('0x77')]){var _0x3e3ac1=_0x18bc21[_0x9999('0x3b')][_0x9999('0x77')][_0x9999('0x30')](',');var _0x2bb34d={};_0x2bb34d[_0x3e3ac1[0x0]]={'$gte':moment(_0x3e3ac1[0x1])[_0x9999('0xb5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x14162c[_0x9999('0x44')]=_[_0x9999('0x95')](_0x14162c[_0x9999('0x44')],_0x2bb34d);}_0x14162c=_[_0x9999('0x95')]({},_0x14162c,_0x18bc21[_0x9999('0xad')]);return db['FaxMessage'][_0x9999('0x1f')]({'where':_0x14162c[_0x9999('0x44')]})[_0x9999('0x28')](function(_0xfd3629){_0x392f59[_0x9999('0x1f')]=_0xfd3629;if(_0x18bc21[_0x9999('0x3b')][_0x9999('0xb6')]){_0x14162c[_0x9999('0xac')]=[{'all':!![]}];}return db[_0x9999('0xb2')][_0x9999('0xb7')](_0x14162c);})[_0x9999('0x28')](function(_0x180fa3){_0x392f59['rows']=_0x180fa3;return _0x392f59;});}})['then'](respondWithFilteredResult(_0x3ede33,_0x14162c))[_0x9999('0x32')](handleError(_0x3ede33,null));};exports['addTags']=function(_0x3349a4,_0x35e294,_0x2cbbe7){return db[_0x9999('0x35')][_0x9999('0x5f')]({'where':{'id':_0x3349a4['params']['id']}})[_0x9999('0x28')](handleEntityNotFound(_0x35e294,null))[_0x9999('0x28')](function(_0x42b1d2){if(_0x42b1d2){return _0x42b1d2[_0x9999('0xb8')](_0x3349a4['body'][_0x9999('0xb3')],_[_0x9999('0xb9')](_0x3349a4['body'],['ids','id'])||{})[_0x9999('0xba')](function(){return db[_0x9999('0xbb')][_0x9999('0xb7')]({'attributes':['id','name',_0x9999('0xbc')],'where':{'id':_0x3349a4[_0x9999('0xaf')][_0x9999('0xb3')]}});})[_0x9999('0x28')](function(_0x24678e){socket[_0x9999('0xbd')](_0x9999('0xbe'),{'id':Number(_0x3349a4[_0x9999('0xab')]['id']),'tags':_0x24678e||[]});return{'id':Number(_0x3349a4[_0x9999('0xab')]['id']),'tags':_0x24678e||[]};});}})[_0x9999('0x28')](respondWithResult(_0x35e294,null))['catch'](handleError(_0x35e294,null));};exports[_0x9999('0xbf')]=function(_0x252789,_0x58a4d5,_0x3cd02b){return db[_0x9999('0x35')][_0x9999('0x5f')]({'where':{'id':_0x252789[_0x9999('0xab')]['id']}})[_0x9999('0x28')](handleEntityNotFound(_0x58a4d5,null))[_0x9999('0x28')](function(_0x5a93e5){if(_0x5a93e5){return _0x5a93e5['removeTags'](_0x252789[_0x9999('0x3b')][_0x9999('0xb3')]);}})[_0x9999('0x28')](respondWithStatusCode(_0x58a4d5,null))['catch'](handleError(_0x58a4d5,null));};exports[_0x9999('0xc0')]=function(_0x50cb0c,_0x697b71){var _0x2a8173=moment()[_0x9999('0xc1')]()[_0x9999('0x94')]();var _0x2de9ea=path['join'](config[_0x9999('0xc2')],_0x9999('0xc3'),_0x9999('0xc4'),_0x9999('0xc5'));var _0x2c1956=path['join'](config[_0x9999('0xc2')],_0x9999('0xc3'),'files',_0x9999('0xc6'));var _0x3bf231=path[_0x9999('0xc7')](_0x2de9ea,_0x2a8173);var _0x4587f9=util[_0x9999('0xb5')](_0x9999('0xc8'),_0x50cb0c[_0x9999('0xab')]['id'],_0x2a8173);var _0x4ba502=path[_0x9999('0xc7')](_0x2de9ea,_0x4587f9);var _0x2761bc=[];_0x2761bc['push']({'model':db[_0x9999('0xc9')],'as':_0x9999('0xc9'),'raw':!![]});var _0x221bb4=[{'model':db['FaxMessage'],'as':_0x9999('0xca'),'attributes':['id',_0x9999('0xaf'),_0x9999('0x75')],'include':_0x2761bc}];return db[_0x9999('0x35')][_0x9999('0x5f')]({'where':{'id':_0x50cb0c[_0x9999('0xab')]['id']},'include':_0x221bb4})[_0x9999('0x28')](handleEntityNotFound(_0x697b71,null))[_0x9999('0x28')](function(_0x591058){if(_0x591058&&_0x591058[_0x9999('0xca')]){var _0xce1339=_0x591058[_0x9999('0xcb')]({'plain':!![]});fs[_0x9999('0xcc')](_0x3bf231);for(var _0x45a1a7=0x0;_0x45a1a7<_0xce1339['Messages'][_0x9999('0x3f')];_0x45a1a7++){var _0x149e61=_0xce1339[_0x9999('0xca')][_0x45a1a7]['Attachment'];if(_0x149e61){var _0x4202d6=path['join'](_0x2c1956,_0x149e61['basename']);if(fs['existsSync'](_0x4202d6)){fs[_0x9999('0xcd')](_0x4202d6)[_0x9999('0xce')](fs[_0x9999('0xcf')](path[_0x9999('0xc7')](_0x3bf231,_0x149e61[_0x9999('0xd0')])));}}}return BPromise['resolve']()[_0x9999('0x28')](function(){return new BPromise(function(_0x4b04b9,_0x10d01b){zipdir(_0x3bf231,{'saveTo':_0x4ba502},function(_0x416375,_0x137038){if(_0x416375)return _0x10d01b(_0x416375);return _0x4b04b9(_0x137038);});})['then'](function(){return new BPromise(function(_0x4a01f1,_0x89cf35){rimraf(_0x3bf231,function(_0x106d9d){if(_0x106d9d)_0x89cf35(_0x106d9d);return _0x4a01f1();});});})[_0x9999('0x28')](function(){return _0x697b71[_0x9999('0xc0')](_0x4ba502,_0x4587f9,function(_0x5be96b){if(_0x5be96b){console[_0x9999('0xd1')]('err',_0x5be96b);}else{fs[_0x9999('0xd2')](_0x4ba502);}});});});}else{return _0x697b71[_0x9999('0x1b')](0xc8);}})['catch'](handleError(_0x697b71,null));}; \ No newline at end of file +var _0xbaad=['groupBy','FaxInteractionId','show','params','includeAll','include','options','create','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','hasOwnProperty','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','root','files','join','server','attachments','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','ejs','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','Users','map','fullname','TagIds','Tags','split','push','catch','index','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','sequelize','toString','count','keyBy','merge','FaxInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?'];(function(_0x413efc,_0x383595){var _0x2bd0ba=function(_0x3bff59){while(--_0x3bff59){_0x413efc['push'](_0x413efc['shift']());}};_0x2bd0ba(++_0x383595);}(_0xbaad,0x1d1));var _0xdbaa=function(_0x452f5b,_0x5389d1){_0x452f5b=_0x452f5b-0x0;var _0x33e5e2=_0xbaad[_0x452f5b];return _0x33e5e2;};'use strict';var pdf=require(_0xdbaa('0x0'));var emlformat=require(_0xdbaa('0x1'));var rimraf=require(_0xdbaa('0x2'));var zipdir=require(_0xdbaa('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdbaa('0x4'));var moment=require(_0xdbaa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdbaa('0x6'));var util=require('util');var path=require(_0xdbaa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdbaa('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdbaa('0x9'));var crypto=require(_0xdbaa('0xa'));var jsforce=require(_0xdbaa('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdbaa('0xc'));var querystring=require('querystring');var Papa=require(_0xdbaa('0xd'));var Redis=require(_0xdbaa('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdbaa('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdbaa('0x10'));var logger=require('../../config/logger')(_0xdbaa('0x11'));var utils=require(_0xdbaa('0x12'));var config=require('../../config/environment');var db=require(_0xdbaa('0x13'))['db'];config[_0xdbaa('0x14')]=_['defaults'](config[_0xdbaa('0x14')],{'host':_0xdbaa('0x15'),'port':0x18eb});var socket=require(_0xdbaa('0x16'))(new Redis(config['redis']));require(_0xdbaa('0x17'))['register'](socket);function respondWithStatusCode(_0x4a6a7f,_0x59b9b6){_0x59b9b6=_0x59b9b6||0xcc;return function(_0x5e2658){if(_0x5e2658){return _0x4a6a7f[_0xdbaa('0x18')](_0x59b9b6);}return _0x4a6a7f[_0xdbaa('0x19')](_0x59b9b6)[_0xdbaa('0x1a')]();};}function respondWithResult(_0x5d3387,_0x54ba2f){_0x54ba2f=_0x54ba2f||0xc8;return function(_0x26ca22){if(_0x26ca22){return _0x5d3387['status'](_0x54ba2f)['json'](_0x26ca22);}};}function respondWithFilteredResult(_0x39fd88,_0x3fcbe3){return function(_0x33a3df){if(_0x33a3df){var _0x1d8676=_0x33a3df['count'],_0x286b8d=_0x3fcbe3['offset'],_0x29ccf5=_0x3fcbe3[_0xdbaa('0x1b')]+_0x3fcbe3[_0xdbaa('0x1c')],_0xb320a9;if(_0x29ccf5>=_0x1d8676){_0x29ccf5=_0x1d8676;_0xb320a9=0xc8;}else{_0xb320a9=0xce;}_0x39fd88['status'](_0xb320a9);return _0x39fd88[_0xdbaa('0x1d')](_0xdbaa('0x1e'),_0x286b8d+'-'+_0x29ccf5+'/'+_0x1d8676)[_0xdbaa('0x1f')](_0x33a3df);}return null;};}function patchUpdates(_0x41ad81){return function(_0x36fd72){try{jsonpatch[_0xdbaa('0x20')](_0x36fd72,_0x41ad81,!![]);}catch(_0x11e9d2){return BPromise[_0xdbaa('0x21')](_0x11e9d2);}return _0x36fd72[_0xdbaa('0x22')]();};}function saveUpdates(_0x4a1afc,_0x25805e){return function(_0x2f8e4d){if(_0x2f8e4d){return _0x2f8e4d[_0xdbaa('0x23')](_0x4a1afc)['then'](function(_0x25c0ba){return _0x25c0ba;});}return null;};}function removeEntity(_0x192905,_0x52ebd5){return function(_0x17ffdb){if(_0x17ffdb){return _0x17ffdb[_0xdbaa('0x24')]()[_0xdbaa('0x25')](function(){_0x192905[_0xdbaa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x193ec0,_0x47237d){return function(_0x2e9578){if(!_0x2e9578){_0x193ec0['sendStatus'](0x194);}return _0x2e9578;};}function handleError(_0x2c4eb2,_0x16e330){_0x16e330=_0x16e330||0x1f4;return function(_0x493476){logger[_0xdbaa('0x26')](_0x493476[_0xdbaa('0x27')]);if(_0x493476[_0xdbaa('0x28')]){delete _0x493476['name'];}_0x2c4eb2['status'](_0x16e330)['send'](_0x493476);};}function getInteractionUsers(_0x4bba95,_0x492949){return new BPromise(function(_0x422887,_0x21e5f6){try{if(_0x492949[_0x4bba95['id']]){_0x4bba95[_0xdbaa('0x29')]=_[_0xdbaa('0x2a')](_0x492949[_0x4bba95['id']],function(_0x18d8ba){return{'id':_0x18d8ba['id'],'fullname':_0x18d8ba[_0xdbaa('0x2b')]};});}}catch(_0x199c35){_0x21e5f6(_0x199c35);}_0x422887(_0x4bba95);});}function getInteractionTags(_0x1b2e5f,_0x526fe5){return new BPromise(function(_0x37f5f4,_0x240c0f){try{if(_0x1b2e5f[_0xdbaa('0x2c')]){_0x1b2e5f[_0xdbaa('0x2d')]=[];_0x1b2e5f[_0xdbaa('0x2c')][_0xdbaa('0x2e')](',')['forEach'](function(_0x48a5dc){_0x1b2e5f[_0xdbaa('0x2d')][_0xdbaa('0x2f')](_0x526fe5[_0x48a5dc]);});}delete _0x1b2e5f['TagIds'];}catch(_0x8f9e67){_0x240c0f(_0x8f9e67);}_0x37f5f4(_0x1b2e5f);});}function updateFaxInteraction(_0x3f1cd9,_0x38d213,_0x5a78d3){return new BPromise(function(_0x373898,_0x1115d8){return getInteractionUsers(_0x3f1cd9,_0x5a78d3)[_0xdbaa('0x25')](function(_0x24d5bb){return getInteractionTags(_0x24d5bb,_0x38d213);})['then'](function(_0x4f241c){_0x373898(_0x4f241c);})[_0xdbaa('0x30')](function(_0x3e8498){_0x1115d8(_0x3e8498);});});}exports[_0xdbaa('0x31')]=function(_0x38b00d,_0x5f1baf){var _0x3a4623={},_0x50a88e={},_0x3be80b={'count':0x0,'rows':[]};var _0x4afeb5=_[_0xdbaa('0x2a')](db['FaxInteraction'][_0xdbaa('0x32')],function(_0x171400){return{'name':_0x171400[_0xdbaa('0x33')],'type':_0x171400[_0xdbaa('0x34')]['key']};});_0x50a88e['model']=_[_0xdbaa('0x2a')](_0x4afeb5,'name');_0x50a88e[_0xdbaa('0x35')]=_[_0xdbaa('0x36')](_0x38b00d[_0xdbaa('0x35')]);_0x50a88e['filters']=_[_0xdbaa('0x37')](_0x50a88e[_0xdbaa('0x38')],_0x50a88e[_0xdbaa('0x35')]);_0x3a4623['attributes']=_[_0xdbaa('0x37')](_0x50a88e[_0xdbaa('0x38')],qs[_0xdbaa('0x39')](_0x38b00d[_0xdbaa('0x35')][_0xdbaa('0x39')]));_0x3a4623[_0xdbaa('0x3a')]=_0x3a4623[_0xdbaa('0x3a')][_0xdbaa('0x3b')]?_0x3a4623[_0xdbaa('0x3a')]:_0x50a88e[_0xdbaa('0x38')];if(!_0x38b00d['query']['hasOwnProperty'](_0xdbaa('0x3c'))){_0x3a4623[_0xdbaa('0x1c')]=qs[_0xdbaa('0x1c')](_0x38b00d['query'][_0xdbaa('0x1c')]);_0x3a4623[_0xdbaa('0x1b')]=qs[_0xdbaa('0x1b')](_0x38b00d[_0xdbaa('0x35')]['offset']);}_0x3a4623[_0xdbaa('0x3d')]=qs[_0xdbaa('0x3e')](_0x38b00d[_0xdbaa('0x35')]['sort']);_0x3a4623[_0xdbaa('0x3f')]=qs[_0xdbaa('0x40')](_[_0xdbaa('0x41')](_0x38b00d['query'],_0x50a88e[_0xdbaa('0x40')]));var _0x42e2b9=[];var _0x429c5e=squel[_0xdbaa('0x42')]()[_0xdbaa('0x43')]('id')[_0xdbaa('0x43')](_0xdbaa('0x28'))[_0xdbaa('0x43')](_0xdbaa('0x44'))[_0xdbaa('0x45')](_0xdbaa('0x46'));var _0xd320a1=squel['select']()[_0xdbaa('0x43')](_0xdbaa('0x47'))[_0xdbaa('0x43')](_0xdbaa('0x48'))[_0xdbaa('0x43')]('ui.FaxInteractionId')[_0xdbaa('0x45')]('user_has_fax_interactions','ui')['left_join'](_0xdbaa('0x49'),'u',_0xdbaa('0x4a'));var _0xe3e60=squel['select']()[_0xdbaa('0x45')](_0xdbaa('0x4b'),'i')['left_join'](_0xdbaa('0x4c'),'c',_0xdbaa('0x4d'))['left_join'](_0xdbaa('0x49'),'o',_0xdbaa('0x4e'))[_0xdbaa('0x4f')](_0xdbaa('0x50'),'a','a.id\x20=\x20i.FaxAccountId')['left_join'](_0xdbaa('0x51'),'me',_0xdbaa('0x52'))['left_join'](_0xdbaa('0x53'),'it',_0xdbaa('0x54'))[_0xdbaa('0x4f')](_0xdbaa('0x46'),'t','t.id\x20=\x20it.TagId');var _0x302d29=squel['expr']();var _0x3acb65=[];var _0x2bd5ca=squel['expr']();var _0x462fc9;if(_0x38b00d[_0xdbaa('0x35')][_0xdbaa('0x55')]){_0x462fc9=as[_0xdbaa('0x56')](_0x38b00d[_0xdbaa('0x35')][_0xdbaa('0x55')]);var _0x8a6e21=_0x462fc9['sqlOperator'];for(var _0x317476=0x0;_0x317476<_0x462fc9[_0xdbaa('0x57')][_0xdbaa('0x3b')];_0x317476++){var _0x35d863=_0x462fc9['conditions'][_0x317476];var _0x24bf9f='i';var _0x591383=_[_0xdbaa('0x58')](_0x4afeb5,[_0xdbaa('0x28'),_0x35d863[_0xdbaa('0x43')]]);if(!_0x591383){switch(_0x35d863[_0xdbaa('0x43')]){case _0xdbaa('0x59'):if(_0x35d863[_0xdbaa('0x5a')]==0x1){_0xe3e60[_0xdbaa('0x5b')]('`'+_0x35d863[_0xdbaa('0x43')]+_0xdbaa('0x5c'));}else{_0xe3e60[_0xdbaa('0x5b')]('`'+_0x35d863[_0xdbaa('0x43')]+'`\x20>\x200');}break;case'Contact':if(_0x35d863[_0xdbaa('0x5d')]===_0xdbaa('0x5e')){if(_0x35d863[_0xdbaa('0x5a')][_0xdbaa('0x2e')]('\x20')[_0xdbaa('0x3b')]>0x1){_0x302d29[_0x8a6e21]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xdbaa('0x5f')](_0x35d863[_0xdbaa('0x5a')]),null);}else{var _0x4cf950='%'+_0x35d863[_0xdbaa('0x5a')]+'%';_0x302d29[_0x8a6e21](_0xdbaa('0x60'),_0x4cf950,_0x4cf950,_0x4cf950);}}else{_0x591383=_[_0xdbaa('0x58')](_0x4afeb5,['name','ContactId']);_0x35d863[_0xdbaa('0x43')]=_0xdbaa('0x61');_0x21a98c=as[_0xdbaa('0x62')](_0x24bf9f,_0x591383['type'],_0x35d863);_0x302d29[_0x8a6e21](_0x21a98c['text'],_0x21a98c[_0xdbaa('0x5a')][_0xdbaa('0x63')],_0x21a98c['value'][_0xdbaa('0x1a')]);}break;case _0xdbaa('0x64'):var _0x5968b3=_0x35d863[_0xdbaa('0x5a')][_0xdbaa('0x2e')](',')[_0xdbaa('0x2a')](function(_0x3db52b){return Number(_0x3db52b);});_0x5968b3[_0xdbaa('0x65')](function(_0x55653d){_0x2bd5ca['or'](_0xdbaa('0x66'),'%,'+_0x55653d+',%');});_0x3acb65=_[_0xdbaa('0x67')](_0x3acb65,_0x5968b3);break;case _0xdbaa('0x68'):if(_0x35d863[_0xdbaa('0x5d')]===_0xdbaa('0x5e')){_0x302d29[_0x8a6e21](_0xdbaa('0x69'),'%'+_0x35d863[_0xdbaa('0x5a')]+'%',null);}else{_0x591383=_['find'](_0x4afeb5,[_0xdbaa('0x28'),_0xdbaa('0x6a')]);_0x35d863['field']=_0xdbaa('0x6a');_0x21a98c=as[_0xdbaa('0x62')](_0x24bf9f,_0x591383[_0xdbaa('0x34')],_0x35d863);_0x302d29[_0x8a6e21](_0x21a98c[_0xdbaa('0x6b')],_0x21a98c['value'][_0xdbaa('0x63')],_0x21a98c['value'][_0xdbaa('0x1a')]);}break;case _0xdbaa('0x6c'):_0x21a98c=as[_0xdbaa('0x62')]('me',null,_0x35d863);_0x302d29[_0x8a6e21](_0x21a98c[_0xdbaa('0x6b')],_0x21a98c[_0xdbaa('0x5a')][_0xdbaa('0x63')],_0x21a98c[_0xdbaa('0x5a')][_0xdbaa('0x1a')]);break;}}else{var _0x21a98c=as[_0xdbaa('0x62')](_0x24bf9f,_0x591383[_0xdbaa('0x34')],_0x35d863);_0x302d29[_0x8a6e21](_0x21a98c[_0xdbaa('0x6b')],_0x21a98c['value'][_0xdbaa('0x63')],_0x21a98c[_0xdbaa('0x5a')]['end']);}}}else{var _0x44c56f=_(_0x38b00d[_0xdbaa('0x35')])[_0xdbaa('0x36')]()[_0xdbaa('0x2a')](function(_0x24f00e){return _[_0xdbaa('0x6d')](_0x4afeb5,['name',_0x24f00e])?_0x24f00e:undefined;})[_0xdbaa('0x6e')]()[_0xdbaa('0x5a')]();if(!_[_0xdbaa('0x6f')](_0x44c56f)){_0x44c56f[_0xdbaa('0x65')](function(_0x330e8e){if(_0x330e8e===_0xdbaa('0x70')){_0xe3e60['where'](_0xdbaa('0x71'),[][_0xdbaa('0x72')](_0x38b00d[_0xdbaa('0x35')][_0x330e8e]));}else if(_0x330e8e===_0xdbaa('0x73')){var _0x7fb6da=JSON[_0xdbaa('0x74')](_0x38b00d['query'][_0x330e8e])['$gte'];var _0x10854d=JSON[_0xdbaa('0x74')](_0x38b00d['query'][_0x330e8e])[_0xdbaa('0x75')];_0xe3e60[_0xdbaa('0x3f')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x7fb6da,_0x10854d);}else{if(_0x38b00d[_0xdbaa('0x35')][_0x330e8e]===_0xdbaa('0x76')){_0xe3e60[_0xdbaa('0x3f')]('i.'+_0x330e8e+_0xdbaa('0x77'));}else{_0xe3e60[_0xdbaa('0x3f')]('i.'+_0x330e8e+_0xdbaa('0x78'),_0x38b00d[_0xdbaa('0x35')][_0x330e8e]);}}});}if(_0x38b00d['query'][_0xdbaa('0x79')]){if(_0x38b00d['query'][_0xdbaa('0x79')]==0x1){_0xe3e60[_0xdbaa('0x5b')](_0xdbaa('0x7a'));}else{_0xe3e60[_0xdbaa('0x5b')]('`unreadMessages`\x20>\x200');}}if(_0x38b00d[_0xdbaa('0x35')]['tag']){_0x3acb65=_[_0xdbaa('0x7b')](_0x38b00d[_0xdbaa('0x35')][_0xdbaa('0x7c')])?_0x38b00d[_0xdbaa('0x35')][_0xdbaa('0x7c')]:new Array(_0x38b00d[_0xdbaa('0x35')]['tag']);_0x3acb65[_0xdbaa('0x65')](function(_0xc5a8b3){_0x2bd5ca['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xc5a8b3+',%');});}if(_0x38b00d[_0xdbaa('0x35')][_0xdbaa('0x7d')]){var _0x517a07=_0x38b00d['query'][_0xdbaa('0x7d')][_0xdbaa('0x7e')]('\x5c','\x5c\x5c')[_0xdbaa('0x7e')]('\x27\x27',_0xdbaa('0x7f'));if(qs[_0xdbaa('0x80')](_0x517a07)){_0x302d29['or'](_0xdbaa('0x81'),_0x517a07+'%')['or'](_0xdbaa('0x82'),_0x517a07+'%');}_0x302d29['or'](_0xdbaa('0x83'),_0x517a07+'%');}}_0xe3e60[_0xdbaa('0x3f')](_0x302d29);_0xe3e60[_0xdbaa('0x84')](_0xdbaa('0x85'));var _0x37ca93={'type':db[_0xdbaa('0x86')][_0xdbaa('0x87')][_0xdbaa('0x88')],'raw':!![]};var _0x5ea934=_0xe3e60[_0xdbaa('0x89')]();_0x5ea934[_0xdbaa('0x43')](_0xdbaa('0x85'));_0x5ea934[_0xdbaa('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xdbaa('0x59'));if(_0x3a4623[_0xdbaa('0x3d')]){_0x3a4623[_0xdbaa('0x3d')][_0xdbaa('0x65')](function(_0x5d9510){_0xe3e60[_0xdbaa('0x3d')]('i.'+_0x5d9510[0x0],_0x5d9510[0x1]===_0xdbaa('0x8a')?![]:!![]);});}if(!_[_0xdbaa('0x6f')](_0x3acb65)){_0xe3e60[_0xdbaa('0x5b')](_0x2bd5ca);_0x5ea934['where']('t.id\x20IN\x20?',_0x3acb65);}BPromise['resolve']()[_0xdbaa('0x25')](function(){if(!_0x462fc9){if(_0x38b00d['query']['FaxAccountId']||_0x38b00d[_0xdbaa('0x35')]['journey'])return;_0x5ea934['where'](_0xdbaa('0x8b'));_0xe3e60[_0xdbaa('0x3f')](_0xdbaa('0x8b'));return;}return _0x38b00d[_0xdbaa('0x8c')][_0xdbaa('0x8d')]({'attributes':['id'],'raw':!![]})[_0xdbaa('0x25')](function(_0x30b73e){if(_[_0xdbaa('0x6f')](_0x30b73e)){_0x5ea934[_0xdbaa('0x3f')]('i.FaxAccountId\x20IS\x20NULL');_0xe3e60[_0xdbaa('0x3f')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x5ea934['where'](_0xdbaa('0x71'),_['map'](_0x30b73e,'id'));_0xe3e60['where'](_0xdbaa('0x71'),_[_0xdbaa('0x2a')](_0x30b73e,'id'));}});})[_0xdbaa('0x25')](function(){db[_0xdbaa('0x8e')][_0xdbaa('0x35')](_0x5ea934[_0xdbaa('0x8f')](),_0x37ca93)[_0xdbaa('0x25')](function(_0x5b53d3){_0x3be80b[_0xdbaa('0x90')]=_0x5b53d3[_0xdbaa('0x3b')];if(_0x3be80b[_0xdbaa('0x90')]===0x0)return[];return db[_0xdbaa('0x8e')][_0xdbaa('0x35')](_0x429c5e[_0xdbaa('0x8f')](),_0x37ca93)[_0xdbaa('0x25')](function(_0x4b931c){_0x42e2b9=_[_0xdbaa('0x91')](_0x4b931c,'id');_0x37ca93=_[_0xdbaa('0x92')](_0x37ca93,{'model':db[_0xdbaa('0x93')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x38b00d['query']['fields']){_0x3a4623[_0xdbaa('0x3a')][_0xdbaa('0x65')](function(_0x51bcfe){_0xe3e60[_0xdbaa('0x43')]('i.'+_0x51bcfe);});}else{_0xe3e60[_0xdbaa('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xdbaa('0x59'));_0xe3e60[_0xdbaa('0x43')](_0xdbaa('0x94'),_0xdbaa('0x95'));_0xe3e60[_0xdbaa('0x43')](_0xdbaa('0x96'),_0xdbaa('0x97'));_0xe3e60[_0xdbaa('0x43')](_0xdbaa('0x98'));_0xe3e60[_0xdbaa('0x43')](_0xdbaa('0x99'),_0xdbaa('0x9a'));_0xe3e60['field']('c.lastName','Contact.lastName');_0xe3e60[_0xdbaa('0x43')]('c.email','Contact.email');_0xe3e60[_0xdbaa('0x43')]('c.phone',_0xdbaa('0x9b'));_0xe3e60['field'](_0xdbaa('0x9c'),_0xdbaa('0x9d'));_0xe3e60[_0xdbaa('0x43')]('c.fax',_0xdbaa('0x9e'));_0xe3e60[_0xdbaa('0x43')](_0xdbaa('0x9f'),_0xdbaa('0xa0'));_0xe3e60['field'](_0xdbaa('0xa1'),_0xdbaa('0xa2'));_0xe3e60['field'](_0xdbaa('0xa3'),_0xdbaa('0x2c'));}_0xe3e60[_0xdbaa('0x1c')](_0x3a4623['limit']);_0xe3e60[_0xdbaa('0x1b')](_0x3a4623[_0xdbaa('0x1b')]);return db['sequelize'][_0xdbaa('0x35')](_0xe3e60['toString'](),_0x37ca93);})[_0xdbaa('0x25')](function(_0x3ceb88){_0xd320a1[_0xdbaa('0x3f')](_0xdbaa('0xa4'),_[_0xdbaa('0x2a')](_0x3ceb88,'id'));return db[_0xdbaa('0x8e')]['query'](_0xd320a1[_0xdbaa('0x8f')](),_0x37ca93)[_0xdbaa('0x25')](function(_0x490a41){var _0x4664f3=_[_0xdbaa('0xa5')](_0x490a41,_0xdbaa('0xa6'));var _0x3ac6a9=[];_0x3ceb88[_0xdbaa('0x65')](function(_0x5d0cc8){_0x3ac6a9[_0xdbaa('0x2f')](updateFaxInteraction(_0x5d0cc8,_0x42e2b9,_0x4664f3));});return BPromise['all'](_0x3ac6a9);});});})[_0xdbaa('0x25')](function(_0xf9393a){_0x3be80b['rows']=_0xf9393a;return _0x3be80b;})[_0xdbaa('0x25')](respondWithFilteredResult(_0x5f1baf,_0x3a4623));})['catch'](handleError(_0x5f1baf,null));};exports[_0xdbaa('0xa7')]=function(_0x5ec7f5,_0x4886c5){var _0x9fc060={'raw':![],'where':{'id':_0x5ec7f5[_0xdbaa('0xa8')]['id']}},_0xa8232b={};_0xa8232b['model']=_[_0xdbaa('0x36')](db['FaxInteraction'][_0xdbaa('0x32')]);_0xa8232b[_0xdbaa('0x35')]=_[_0xdbaa('0x36')](_0x5ec7f5[_0xdbaa('0x35')]);_0xa8232b['filters']=_['intersection'](_0xa8232b[_0xdbaa('0x38')],_0xa8232b[_0xdbaa('0x35')]);_0x9fc060[_0xdbaa('0x3a')]=_[_0xdbaa('0x37')](_0xa8232b['model'],qs[_0xdbaa('0x39')](_0x5ec7f5['query'][_0xdbaa('0x39')]));_0x9fc060[_0xdbaa('0x3a')]=_0x9fc060[_0xdbaa('0x3a')][_0xdbaa('0x3b')]?_0x9fc060['attributes']:_0xa8232b[_0xdbaa('0x38')];if(_0x5ec7f5['query'][_0xdbaa('0xa9')]){_0x9fc060[_0xdbaa('0xaa')]=[{'all':!![]}];}_0x9fc060=_[_0xdbaa('0x92')]({},_0x9fc060,_0x5ec7f5[_0xdbaa('0xab')]);return db[_0xdbaa('0x93')]['find'](_0x9fc060)[_0xdbaa('0x25')](handleEntityNotFound(_0x4886c5,null))[_0xdbaa('0x25')](respondWithResult(_0x4886c5,null))[_0xdbaa('0x30')](handleError(_0x4886c5,null));};exports[_0xdbaa('0xac')]=function(_0x52019c,_0x470cb5){return db[_0xdbaa('0x93')][_0xdbaa('0xac')](_0x52019c['body'],{})[_0xdbaa('0x25')](respondWithResult(_0x470cb5,0xc9))[_0xdbaa('0x30')](handleError(_0x470cb5,null));};exports[_0xdbaa('0x23')]=function(_0x1118e2,_0x1f8e14){if(_0x1118e2[_0xdbaa('0x6c')]['id']){delete _0x1118e2['body']['id'];}return db[_0xdbaa('0x93')]['find']({'where':{'id':_0x1118e2[_0xdbaa('0xa8')]['id']}})[_0xdbaa('0x25')](handleEntityNotFound(_0x1f8e14,null))[_0xdbaa('0x25')](saveUpdates(_0x1118e2[_0xdbaa('0x6c')],null))[_0xdbaa('0x25')](respondWithResult(_0x1f8e14,null))[_0xdbaa('0x30')](handleError(_0x1f8e14,null));};exports[_0xdbaa('0x24')]=function(_0x2b3cdf,_0x30c765){return db[_0xdbaa('0x93')][_0xdbaa('0x58')]({'where':{'id':_0x2b3cdf[_0xdbaa('0xa8')]['id']}})[_0xdbaa('0x25')](handleEntityNotFound(_0x30c765,null))['then'](removeEntity(_0x30c765,null))[_0xdbaa('0x30')](handleError(_0x30c765,null));};exports[_0xdbaa('0xad')]=function(_0x2ae374,_0x24e03e){return db[_0xdbaa('0x93')]['describe']()[_0xdbaa('0x25')](respondWithResult(_0x24e03e,null))[_0xdbaa('0x30')](handleError(_0x24e03e,null));};exports[_0xdbaa('0xae')]=function(_0x2fe915,_0x19f321,_0xa355ed){return db[_0xdbaa('0xaf')]['find']({'where':{'id':_0x2fe915[_0xdbaa('0xa8')]['id']}})[_0xdbaa('0x25')](handleEntityNotFound(_0x19f321,null))[_0xdbaa('0x25')](function(_0x3bb337){if(_0x3bb337){return _0x3bb337[_0xdbaa('0xae')](_0x2fe915[_0xdbaa('0x6c')]['ids'],_[_0xdbaa('0xb0')](_0x2fe915[_0xdbaa('0x6c')],[_0xdbaa('0xb1'),'id'])||{});}})[_0xdbaa('0x25')](respondWithResult(_0x19f321,null))[_0xdbaa('0x30')](handleError(_0x19f321,null));};exports[_0xdbaa('0xb2')]=function(_0x4ffe52,_0x2007c0,_0x5573c2){var _0x5bcae1={'raw':![],'where':{}};var _0x1c049f={};var _0x248a37={'count':0x0,'rows':[]};return db[_0xdbaa('0x93')][_0xdbaa('0xb3')]({'where':{'id':_0x4ffe52['params']['id']}})[_0xdbaa('0x25')](handleEntityNotFound(_0x2007c0,null))[_0xdbaa('0x25')](function(_0x135e5d){if(_0x135e5d){_0x1c049f[_0xdbaa('0x38')]=_[_0xdbaa('0x36')](db['FaxMessage'][_0xdbaa('0x32')]);_0x1c049f[_0xdbaa('0x35')]=_[_0xdbaa('0x36')](_0x4ffe52[_0xdbaa('0x35')]);_0x1c049f[_0xdbaa('0x40')]=_[_0xdbaa('0x37')](_0x1c049f[_0xdbaa('0x38')],_0x1c049f['query']);_0x5bcae1[_0xdbaa('0x3a')]=_[_0xdbaa('0x37')](_0x1c049f[_0xdbaa('0x38')],qs[_0xdbaa('0x39')](_0x4ffe52[_0xdbaa('0x35')][_0xdbaa('0x39')]));_0x5bcae1['attributes']=_0x5bcae1['attributes']['length']?_0x5bcae1[_0xdbaa('0x3a')]:_0x1c049f[_0xdbaa('0x38')];if(!_0x4ffe52['query'][_0xdbaa('0xb4')](_0xdbaa('0x3c'))){_0x5bcae1[_0xdbaa('0x1c')]=qs['limit'](_0x4ffe52[_0xdbaa('0x35')][_0xdbaa('0x1c')]);_0x5bcae1[_0xdbaa('0x1b')]=qs[_0xdbaa('0x1b')](_0x4ffe52[_0xdbaa('0x35')]['offset']);}_0x5bcae1[_0xdbaa('0x3d')]=qs[_0xdbaa('0x3e')](_0x4ffe52[_0xdbaa('0x35')][_0xdbaa('0x3e')]);_0x5bcae1[_0xdbaa('0x3f')]=qs[_0xdbaa('0x40')](_[_0xdbaa('0x41')](_0x4ffe52[_0xdbaa('0x35')],_0x1c049f[_0xdbaa('0x40')]));_0x5bcae1[_0xdbaa('0x3f')][_0xdbaa('0xa6')]=_0x135e5d['id'];if(_0x4ffe52[_0xdbaa('0x35')][_0xdbaa('0x7d')]){_0x5bcae1[_0xdbaa('0x3f')]=_[_0xdbaa('0x92')](_0x5bcae1[_0xdbaa('0x3f')],{'$or':_['map'](_0x5bcae1[_0xdbaa('0x3a')],function(_0x4e1dc5){var _0x52c6f7={};_0x52c6f7[_0x4e1dc5]={'$like':'%'+_0x4ffe52[_0xdbaa('0x35')]['filter']+'%'};return _0x52c6f7;})});}if(_0x4ffe52[_0xdbaa('0x35')][_0xdbaa('0xb5')]){var _0x28cf65=_0x4ffe52[_0xdbaa('0x35')][_0xdbaa('0xb5')]['split'](',');var _0x8e927e={};_0x8e927e[_0x28cf65[0x0]]={'$gte':moment(_0x28cf65[0x1])[_0xdbaa('0xb6')](_0xdbaa('0xb7'))};_0x5bcae1[_0xdbaa('0x3f')]=_[_0xdbaa('0x92')](_0x5bcae1[_0xdbaa('0x3f')],_0x8e927e);}_0x5bcae1=_[_0xdbaa('0x92')]({},_0x5bcae1,_0x4ffe52[_0xdbaa('0xab')]);return db[_0xdbaa('0xaf')][_0xdbaa('0x90')]({'where':_0x5bcae1[_0xdbaa('0x3f')]})[_0xdbaa('0x25')](function(_0x310132){_0x248a37[_0xdbaa('0x90')]=_0x310132;if(_0x4ffe52[_0xdbaa('0x35')][_0xdbaa('0xa9')]){_0x5bcae1[_0xdbaa('0xaa')]=[{'all':!![]}];}return db[_0xdbaa('0xaf')][_0xdbaa('0xb8')](_0x5bcae1);})[_0xdbaa('0x25')](function(_0x1dad34){_0x248a37[_0xdbaa('0xb9')]=_0x1dad34;return _0x248a37;});}})[_0xdbaa('0x25')](respondWithFilteredResult(_0x2007c0,_0x5bcae1))['catch'](handleError(_0x2007c0,null));};exports[_0xdbaa('0xba')]=function(_0x171b40,_0x168029,_0x441f8a){return db['FaxInteraction']['find']({'where':{'id':_0x171b40[_0xdbaa('0xa8')]['id']}})['then'](handleEntityNotFound(_0x168029,null))[_0xdbaa('0x25')](function(_0x71995e){if(_0x71995e){return _0x71995e[_0xdbaa('0xbb')](_0x171b40[_0xdbaa('0x6c')][_0xdbaa('0xb1')],_['omit'](_0x171b40[_0xdbaa('0x6c')],['ids','id'])||{})[_0xdbaa('0xbc')](function(){return db['Tag'][_0xdbaa('0xb8')]({'attributes':['id',_0xdbaa('0x28'),'color'],'where':{'id':_0x171b40['body'][_0xdbaa('0xb1')]}});})[_0xdbaa('0x25')](function(_0x4678df){socket[_0xdbaa('0xbd')](_0xdbaa('0xbe'),{'id':Number(_0x171b40[_0xdbaa('0xa8')]['id']),'tags':_0x4678df||[]});return{'id':Number(_0x171b40[_0xdbaa('0xa8')]['id']),'tags':_0x4678df||[]};});}})[_0xdbaa('0x25')](respondWithResult(_0x168029,null))[_0xdbaa('0x30')](handleError(_0x168029,null));};exports[_0xdbaa('0xbf')]=function(_0x4d6065,_0x3e5a8d,_0x38a0b2){return db[_0xdbaa('0x93')][_0xdbaa('0x58')]({'where':{'id':_0x4d6065[_0xdbaa('0xa8')]['id']}})['then'](handleEntityNotFound(_0x3e5a8d,null))['then'](function(_0x3c1b50){if(_0x3c1b50){return _0x3c1b50[_0xdbaa('0xbf')](_0x4d6065[_0xdbaa('0x35')][_0xdbaa('0xb1')]);}})['then'](respondWithStatusCode(_0x3e5a8d,null))[_0xdbaa('0x30')](handleError(_0x3e5a8d,null));};exports['download']=function(_0x2a7089,_0xddd943){var _0x762f48=moment()['unix']()[_0xdbaa('0x8f')]();var _0x335d4e=path['join'](config[_0xdbaa('0xc0')],'server',_0xdbaa('0xc1'),'tmp');var _0x4be37c=path[_0xdbaa('0xc2')](config[_0xdbaa('0xc0')],_0xdbaa('0xc3'),_0xdbaa('0xc1'),_0xdbaa('0xc4'));var _0x2ee535=path[_0xdbaa('0xc2')](_0x335d4e,_0x762f48);var _0x335c17=util[_0xdbaa('0xb6')]('transcript-%d-%s.zip',_0x2a7089['params']['id'],_0x762f48);var _0x500e14=path[_0xdbaa('0xc2')](_0x335d4e,_0x335c17);var _0x2b2b9b=[];_0x2b2b9b[_0xdbaa('0x2f')]({'model':db[_0xdbaa('0xc5')],'as':_0xdbaa('0xc5'),'raw':!![]});var _0x322575=[{'model':db['FaxMessage'],'as':_0xdbaa('0xc6'),'attributes':['id',_0xdbaa('0x6c'),'createdAt'],'include':_0x2b2b9b}];return db[_0xdbaa('0x93')]['find']({'where':{'id':_0x2a7089['params']['id']},'include':_0x322575})[_0xdbaa('0x25')](handleEntityNotFound(_0xddd943,null))[_0xdbaa('0x25')](function(_0x4e60c8){if(_0x4e60c8&&_0x4e60c8[_0xdbaa('0xc6')]){var _0x261a26=_0x4e60c8[_0xdbaa('0xc7')]({'plain':!![]});fs[_0xdbaa('0xc8')](_0x2ee535);for(var _0x14f7c7=0x0;_0x14f7c7<_0x261a26['Messages'][_0xdbaa('0x3b')];_0x14f7c7++){var _0x461c8f=_0x261a26['Messages'][_0x14f7c7][_0xdbaa('0xc5')];if(_0x461c8f){var _0x5882c6=path[_0xdbaa('0xc2')](_0x4be37c,_0x461c8f[_0xdbaa('0xc9')]);if(fs[_0xdbaa('0xca')](_0x5882c6)){fs[_0xdbaa('0xcb')](_0x5882c6)[_0xdbaa('0xcc')](fs[_0xdbaa('0xcd')](path[_0xdbaa('0xc2')](_0x2ee535,_0x461c8f[_0xdbaa('0xc9')])));}}}return BPromise[_0xdbaa('0xce')]()[_0xdbaa('0x25')](function(){return new BPromise(function(_0xb17850,_0x11b5bb){zipdir(_0x2ee535,{'saveTo':_0x500e14},function(_0x5458ea,_0x3d210a){if(_0x5458ea)return _0x11b5bb(_0x5458ea);return _0xb17850(_0x3d210a);});})[_0xdbaa('0x25')](function(){return new BPromise(function(_0x5761cd,_0x510aa3){rimraf(_0x2ee535,function(_0x3af0f5){if(_0x3af0f5)_0x510aa3(_0x3af0f5);return _0x5761cd();});});})[_0xdbaa('0x25')](function(){return _0xddd943['download'](_0x500e14,_0x335c17,function(_0x336b10){if(_0x336b10){console[_0xdbaa('0xcf')](_0xdbaa('0xd0'),_0x336b10);}else{fs[_0xdbaa('0xd1')](_0x500e14);}});});});}else{return _0xddd943[_0xdbaa('0x18')](0xc8);}})[_0xdbaa('0x30')](handleError(_0xddd943,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 9ef2015..90717f1 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 _0x1261=['exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty'];(function(_0x3756bc,_0x5c02a4){var _0x2ee470=function(_0x282d73){while(--_0x282d73){_0x3756bc['push'](_0x3756bc['shift']());}};_0x2ee470(++_0x5c02a4);}(_0x1261,0x144));var _0x1126=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0x1261[_0x22b39b];return _0x280e1d;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x1126('0x0'))['db'][_0x1126('0x1')];var FaxMessage=require(_0x1126('0x0'))['db'][_0x1126('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x1126('0x3')](0x0);var events={'afterCreate':_0x1126('0x4'),'afterUpdate':_0x1126('0x5'),'afterDestroy':_0x1126('0x6')};function emitEvent(_0x21a480){return function(_0x75a851,_0x5a2189,_0x5c68c8){_0x75a851[_0x1126('0x7')]({'attributes':['id'],'raw':!![]})[_0x1126('0x8')](function(_0x4f239c){_0x75a851[_0x1126('0x9')](_0x1126('0xa'),_0x4f239c[_0x1126('0xb')](function(_0x3abb0b){return{'id':_0x3abb0b['id']};}));return FaxMessage[_0x1126('0xc')]({'where':{'FaxInteractionId':_0x75a851['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3f09ac){_0x75a851[_0x1126('0x9')](_0x1126('0xd'),_0x3f09ac['length']);FaxInteractionEvents[_0x1126('0xe')](_0x21a480+':'+_0x75a851['id'],_0x75a851);FaxInteractionEvents['emit'](_0x21a480,_0x75a851);_0x5c68c8(null);})['catch'](_0x5c68c8(null));};}for(var e in events){if(events[_0x1126('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x1126('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x7a54=['setDataValue','map','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers'];(function(_0x3b6948,_0x16029c){var _0x55afc1=function(_0x50f5f2){while(--_0x50f5f2){_0x3b6948['push'](_0x3b6948['shift']());}};_0x55afc1(++_0x16029c);}(_0x7a54,0x106));var _0x47a5=function(_0x132f83,_0x2d84d9){_0x132f83=_0x132f83-0x0;var _0x1602fc=_0x7a54[_0x132f83];return _0x1602fc;};'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 diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 04d12dd..2fc392c 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 _0x5f70=['./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x135cf6,_0x15285a){var _0x52bf11=function(_0x1038b1){while(--_0x1038b1){_0x135cf6['push'](_0x135cf6['shift']());}};_0x52bf11(++_0x15285a);}(_0x5f70,0x15e));var _0x05f7=function(_0x5de485,_0x2e7349){_0x5de485=_0x5de485-0x0;var _0x2137f5=_0x5f70[_0x5de485];return _0x2137f5;};'use strict';var _=require(_0x05f7('0x0'));var util=require(_0x05f7('0x1'));var logger=require(_0x05f7('0x2'))(_0x05f7('0x3'));var moment=require(_0x05f7('0x4'));var BPromise=require(_0x05f7('0x5'));var rp=require(_0x05f7('0x6'));var fs=require('fs');var path=require(_0x05f7('0x7'));var rimraf=require(_0x05f7('0x8'));var config=require(_0x05f7('0x9'));var attributes=require(_0x05f7('0xa'));module[_0x05f7('0xb')]=function(_0x53014c,_0x5f53d7){return _0x53014c['define'](_0x05f7('0xc'),attributes,{'tableName':_0x05f7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x390560,_0x356bf5,_0x251498){if(_0x390560[_0x05f7('0xe')](_0x05f7('0xf'))){_0x390560[_0x05f7('0x10')]=moment()[_0x05f7('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x251498(null,_0x390560);}}});}; \ No newline at end of file +var _0x6dad=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x18792a,_0x4334fd){var _0x25efb0=function(_0x141bf6){while(--_0x141bf6){_0x18792a['push'](_0x18792a['shift']());}};_0x25efb0(++_0x4334fd);}(_0x6dad,0xd1));var _0xd6da=function(_0x599ce8,_0x496f2e){_0x599ce8=_0x599ce8-0x0;var _0x4d2637=_0x6dad[_0x599ce8];return _0x4d2637;};'use strict';var _=require(_0xd6da('0x0'));var util=require('util');var logger=require(_0xd6da('0x1'))(_0xd6da('0x2'));var moment=require(_0xd6da('0x3'));var BPromise=require(_0xd6da('0x4'));var rp=require(_0xd6da('0x5'));var fs=require('fs');var path=require(_0xd6da('0x6'));var rimraf=require(_0xd6da('0x7'));var config=require(_0xd6da('0x8'));var attributes=require(_0xd6da('0x9'));module[_0xd6da('0xa')]=function(_0x4cf762,_0x2d66a3){return _0x4cf762[_0xd6da('0xb')](_0xd6da('0xc'),attributes,{'tableName':_0xd6da('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c983b,_0x4acc5f,_0x54737b){if(_0x4c983b[_0xd6da('0xe')](_0xd6da('0xf'))){_0x4c983b[_0xd6da('0x10')]=moment()[_0xd6da('0x11')](_0xd6da('0x12'));}_0x54737b(null,_0x4c983b);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index fc38114..2e6f179 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 _0xf3c6=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxInteraction','update','body','options','raw','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','where','addTags','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0xa1a4d9,_0x5bb37c){var _0x252906=function(_0x35351b){while(--_0x35351b){_0xa1a4d9['push'](_0xa1a4d9['shift']());}};_0x252906(++_0x5bb37c);}(_0xf3c6,0xfb));var _0x6f3c=function(_0x4f768a,_0x43695f){_0x4f768a=_0x4f768a-0x0;var _0x467258=_0xf3c6[_0x4f768a];return _0x467258;};'use strict';var _=require(_0x6f3c('0x0'));var util=require(_0x6f3c('0x1'));var moment=require('moment');var BPromise=require(_0x6f3c('0x2'));var rs=require(_0x6f3c('0x3'));var fs=require('fs');var Redis=require(_0x6f3c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6f3c('0x5'))('rpc');var config=require(_0x6f3c('0x6'));var jayson=require(_0x6f3c('0x7'));var client=jayson[_0x6f3c('0x8')][_0x6f3c('0x9')]({'port':0x232a});config[_0x6f3c('0xa')]=_[_0x6f3c('0xb')](config['redis'],{'host':_0x6f3c('0xc'),'port':0x18eb});var socket=require(_0x6f3c('0xd'))(new Redis(config[_0x6f3c('0xa')]));require(_0x6f3c('0xe'))[_0x6f3c('0xf')](socket);function respondWithRpcPromise(_0x43c40a,_0x4c056b,_0x5bbebb){return new BPromise(function(_0xdacf40,_0x351aa8){return client[_0x6f3c('0x10')](_0x43c40a,_0x5bbebb)[_0x6f3c('0x11')](function(_0x29ddfc){logger[_0x6f3c('0x12')](_0x6f3c('0x13'),_0x4c056b,_0x6f3c('0x14'));logger[_0x6f3c('0x15')](_0x6f3c('0x16'),_0x4c056b,_0x6f3c('0x14'),JSON[_0x6f3c('0x17')](_0x29ddfc));if(_0x29ddfc[_0x6f3c('0x18')]){if(_0x29ddfc[_0x6f3c('0x18')][_0x6f3c('0x19')]===0x1f4){logger[_0x6f3c('0x18')](_0x6f3c('0x13'),_0x4c056b,_0x29ddfc[_0x6f3c('0x18')][_0x6f3c('0x1a')]);return _0x351aa8(_0x29ddfc[_0x6f3c('0x18')][_0x6f3c('0x1a')]);}logger[_0x6f3c('0x18')](_0x6f3c('0x13'),_0x4c056b,_0x29ddfc['error'][_0x6f3c('0x1a')]);return _0xdacf40(_0x29ddfc[_0x6f3c('0x18')][_0x6f3c('0x1a')]);}else{logger[_0x6f3c('0x12')](_0x6f3c('0x13'),_0x4c056b,_0x6f3c('0x14'));_0xdacf40(_0x29ddfc[_0x6f3c('0x1b')]['message']);}})[_0x6f3c('0x1c')](function(_0x3d8a7a){logger[_0x6f3c('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x4c056b,_0x3d8a7a);_0x351aa8(_0x3d8a7a);});});}exports['UpdateFaxInteraction']=function(_0x2136a5){var _0x19bf6b=this;return new Promise(function(_0x2b79c,_0x321187){return db[_0x6f3c('0x1d')][_0x6f3c('0x1e')](_0x2136a5[_0x6f3c('0x1f')],{'raw':_0x2136a5['options']?_0x2136a5[_0x6f3c('0x20')][_0x6f3c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2136a5['options']?_0x2136a5[_0x6f3c('0x20')]['where']||null:null,'attributes':_0x2136a5[_0x6f3c('0x20')]?_0x2136a5['options'][_0x6f3c('0x22')]||null:null,'limit':_0x2136a5[_0x6f3c('0x20')]?_0x2136a5[_0x6f3c('0x20')][_0x6f3c('0x23')]||null:null})[_0x6f3c('0x11')](function(_0x52c951){logger[_0x6f3c('0x12')](_0x6f3c('0x24'),_0x2136a5);logger[_0x6f3c('0x15')](_0x6f3c('0x24'),_0x2136a5,JSON[_0x6f3c('0x17')](_0x52c951));_0x2b79c(_0x52c951);})[_0x6f3c('0x1c')](function(_0x1064b6){logger[_0x6f3c('0x18')](_0x6f3c('0x24'),_0x1064b6[_0x6f3c('0x1a')],_0x2136a5);_0x321187(_0x19bf6b['error'](0x1f4,_0x1064b6[_0x6f3c('0x1a')]));});});};exports[_0x6f3c('0x25')]=function(_0x39dba1){return new Promise(function(_0x339fa7,_0x5dd872){return db[_0x6f3c('0x1d')]['find']({'where':_0x39dba1[_0x6f3c('0x20')]?_0x39dba1[_0x6f3c('0x20')][_0x6f3c('0x26')]||null:null})[_0x6f3c('0x11')](function(_0x5efd92){if(_0x5efd92){return _0x5efd92[_0x6f3c('0x27')](_0x39dba1[_0x6f3c('0x1f')][_0x6f3c('0x28')],_[_0x6f3c('0x29')](_0x39dba1['body'],[_0x6f3c('0x28'),'id'])||{});}})['spread'](function(_0x245026){logger['info'](_0x6f3c('0x2a'),_0x39dba1);logger[_0x6f3c('0x15')](_0x6f3c('0x2a'),_0x39dba1,JSON[_0x6f3c('0x17')](_0x245026));_0x339fa7(_0x245026);})[_0x6f3c('0x1c')](function(_0x2a5e5f){logger[_0x6f3c('0x18')](_0x6f3c('0x2a'),_0x2a5e5f['message'],_0x39dba1);_0x5dd872(_this[_0x6f3c('0x18')](0x1f4,_0x2a5e5f[_0x6f3c('0x1a')]));});});}; \ No newline at end of file +var _0x828d=['message','info','result','UpdateFaxInteraction','update','body','options','raw','attributes','limit','debug','catch','AddTagsToFaxInteraction','FaxInteraction','where','addTags','omit','ids','spread','AddTags','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x477826,_0x49606b){var _0x1e32d8=function(_0x5870d9){while(--_0x5870d9){_0x477826['push'](_0x477826['shift']());}};_0x1e32d8(++_0x49606b);}(_0x828d,0x1b8));var _0xd828=function(_0x5f2057,_0x59e593){_0x5f2057=_0x5f2057-0x0;var _0xa0c427=_0x828d[_0x5f2057];return _0xa0c427;};'use strict';var _=require(_0xd828('0x0'));var util=require(_0xd828('0x1'));var moment=require(_0xd828('0x2'));var BPromise=require('bluebird');var rs=require(_0xd828('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd828('0x4'));var logger=require(_0xd828('0x5'))(_0xd828('0x6'));var config=require(_0xd828('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd828('0x8')]({'port':0x232a});config[_0xd828('0x9')]=_['defaults'](config[_0xd828('0x9')],{'host':_0xd828('0xa'),'port':0x18eb});var socket=require(_0xd828('0xb'))(new Redis(config[_0xd828('0x9')]));require(_0xd828('0xc'))[_0xd828('0xd')](socket);function respondWithRpcPromise(_0x32532e,_0x33cc71,_0x3e70c3){return new BPromise(function(_0x4108ea,_0x365ffc){return client[_0xd828('0xe')](_0x32532e,_0x3e70c3)[_0xd828('0xf')](function(_0x880bc2){logger['info'](_0xd828('0x10'),_0x33cc71,_0xd828('0x11'));logger['debug'](_0xd828('0x12'),_0x33cc71,_0xd828('0x11'),JSON[_0xd828('0x13')](_0x880bc2));if(_0x880bc2['error']){if(_0x880bc2[_0xd828('0x14')][_0xd828('0x15')]===0x1f4){logger['error'](_0xd828('0x10'),_0x33cc71,_0x880bc2['error'][_0xd828('0x16')]);return _0x365ffc(_0x880bc2[_0xd828('0x14')]['message']);}logger[_0xd828('0x14')](_0xd828('0x10'),_0x33cc71,_0x880bc2['error'][_0xd828('0x16')]);return _0x4108ea(_0x880bc2[_0xd828('0x14')]['message']);}else{logger[_0xd828('0x17')](_0xd828('0x10'),_0x33cc71,_0xd828('0x11'));_0x4108ea(_0x880bc2[_0xd828('0x18')][_0xd828('0x16')]);}})['catch'](function(_0xd30009){logger['error'](_0xd828('0x10'),_0x33cc71,_0xd30009);_0x365ffc(_0xd30009);});});}exports[_0xd828('0x19')]=function(_0x44c512){var _0x435d78=this;return new Promise(function(_0x5414e5,_0x57f4bc){return db['FaxInteraction'][_0xd828('0x1a')](_0x44c512[_0xd828('0x1b')],{'raw':_0x44c512[_0xd828('0x1c')]?_0x44c512[_0xd828('0x1c')][_0xd828('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44c512[_0xd828('0x1c')]?_0x44c512[_0xd828('0x1c')]['where']||null:null,'attributes':_0x44c512[_0xd828('0x1c')]?_0x44c512[_0xd828('0x1c')][_0xd828('0x1e')]||null:null,'limit':_0x44c512[_0xd828('0x1c')]?_0x44c512[_0xd828('0x1c')][_0xd828('0x1f')]||null:null})[_0xd828('0xf')](function(_0x13adaf){logger[_0xd828('0x17')]('UpdateFaxInteraction',_0x44c512);logger[_0xd828('0x20')]('UpdateFaxInteraction',_0x44c512,JSON[_0xd828('0x13')](_0x13adaf));_0x5414e5(_0x13adaf);})[_0xd828('0x21')](function(_0x1be9e0){logger[_0xd828('0x14')](_0xd828('0x19'),_0x1be9e0[_0xd828('0x16')],_0x44c512);_0x57f4bc(_0x435d78[_0xd828('0x14')](0x1f4,_0x1be9e0['message']));});});};exports[_0xd828('0x22')]=function(_0x8e736){return new Promise(function(_0x2b0691,_0x4c85f7){return db[_0xd828('0x23')]['find']({'where':_0x8e736[_0xd828('0x1c')]?_0x8e736[_0xd828('0x1c')][_0xd828('0x24')]||null:null})['then'](function(_0x2387e3){if(_0x2387e3){return _0x2387e3[_0xd828('0x25')](_0x8e736[_0xd828('0x1b')]['ids'],_[_0xd828('0x26')](_0x8e736[_0xd828('0x1b')],[_0xd828('0x27'),'id'])||{});}})[_0xd828('0x28')](function(_0x5402cc){logger[_0xd828('0x17')](_0xd828('0x29'),_0x8e736);logger[_0xd828('0x20')]('AddTags',_0x8e736,JSON[_0xd828('0x13')](_0x5402cc));_0x2b0691(_0x5402cc);})[_0xd828('0x21')](function(_0x5e2482){logger['error'](_0xd828('0x29'),_0x5e2482[_0xd828('0x16')],_0x8e736);_0x4c85f7(_this['error'](0x1f4,_0x5e2482['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 9b289ec..052d3b3 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 _0x56d5=['./faxInteraction.events','save','remove','update','removeListener'];(function(_0x211087,_0x354fdd){var _0x2a581f=function(_0x2928fe){while(--_0x2928fe){_0x211087['push'](_0x211087['shift']());}};_0x2a581f(++_0x354fdd);}(_0x56d5,0x104));var _0x556d=function(_0x2369b8,_0x25d764){_0x2369b8=_0x2369b8-0x0;var _0x326a60=_0x56d5[_0x2369b8];return _0x326a60;};'use strict';var FaxInteractionEvents=require(_0x556d('0x0'));var events=[_0x556d('0x1'),_0x556d('0x2'),_0x556d('0x3')];function createListener(_0x50764e,_0x27f809){return function(_0x51285a){_0x27f809['emit'](_0x50764e,_0x51285a);};}function removeListener(_0x9fb9ff,_0x1f3e43){return function(){FaxInteractionEvents[_0x556d('0x4')](_0x9fb9ff,_0x1f3e43);};}exports['register']=function(_0x17c785){for(var _0x1ce2dd=0x0,_0xe7a8d6=events['length'];_0x1ce2dd<_0xe7a8d6;_0x1ce2dd++){var _0x4a2bfa=events[_0x1ce2dd];var _0x1223e0=createListener('faxInteraction:'+_0x4a2bfa,_0x17c785);FaxInteractionEvents['on'](_0x4a2bfa,_0x1223e0);}}; \ No newline at end of file +var _0xe0a3=['update','emit','removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x3a7ca4,_0x6bae54){var _0x474d09=function(_0x5e7eee){while(--_0x5e7eee){_0x3a7ca4['push'](_0x3a7ca4['shift']());}};_0x474d09(++_0x6bae54);}(_0xe0a3,0xba));var _0x3e0a=function(_0x1943d9,_0x245bb8){_0x1943d9=_0x1943d9-0x0;var _0x4b4f3f=_0xe0a3[_0x1943d9];return _0x4b4f3f;};'use strict';var FaxInteractionEvents=require(_0x3e0a('0x0'));var events=[_0x3e0a('0x1'),_0x3e0a('0x2'),_0x3e0a('0x3')];function createListener(_0x2bd5de,_0x345d09){return function(_0x258e05){_0x345d09[_0x3e0a('0x4')](_0x2bd5de,_0x258e05);};}function removeListener(_0x4ee7b6,_0x136c20){return function(){FaxInteractionEvents[_0x3e0a('0x5')](_0x4ee7b6,_0x136c20);};}exports[_0x3e0a('0x6')]=function(_0x25abed){for(var _0x484a46=0x0,_0x41a144=events[_0x3e0a('0x7')];_0x484a46<_0x41a144;_0x484a46++){var _0x11a868=events[_0x484a46];var _0x47d1ba=createListener(_0x3e0a('0x8')+_0x11a868,_0x25abed);FaxInteractionEvents['on'](_0x11a868,_0x47d1ba);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index abe238d..e1f5b3e 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 _0xfd87=['update','delete','faxinteraction:destroy','removeTags','exports','multer','util','path','express','Router','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','/:id/download','download','post','create','/:id/messages','addMessage','tracked','addTags','put','fax','faxinteraction:update'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0xfd87,0x1b5));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7fd8('0x0'));var util=require(_0x7fd8('0x1'));var path=require(_0x7fd8('0x2'));var timeout=require('connect-timeout');var express=require(_0x7fd8('0x3'));var router=express[_0x7fd8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7fd8('0x5'));var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0x7fd8('0x6')]('/',auth[_0x7fd8('0x7')](),controller[_0x7fd8('0x8')]);router[_0x7fd8('0x6')]('/describe',auth[_0x7fd8('0x7')](),controller[_0x7fd8('0x9')]);router[_0x7fd8('0x6')](_0x7fd8('0xa'),auth[_0x7fd8('0x7')](),controller['show']);router[_0x7fd8('0x6')]('/:id/messages',auth[_0x7fd8('0x7')](),controller['getMessages']);router[_0x7fd8('0x6')](_0x7fd8('0xb'),auth[_0x7fd8('0x7')](),controller[_0x7fd8('0xc')]);router[_0x7fd8('0xd')]('/',auth[_0x7fd8('0x7')](),controller[_0x7fd8('0xe')]);router[_0x7fd8('0xd')](_0x7fd8('0xf'),auth[_0x7fd8('0x7')](),controller[_0x7fd8('0x10')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x7fd8('0x11')]('fax','faxinteraction:addtags'),controller[_0x7fd8('0x12')]);router[_0x7fd8('0x13')](_0x7fd8('0xa'),auth[_0x7fd8('0x7')](),interaction[_0x7fd8('0x11')](_0x7fd8('0x14'),_0x7fd8('0x15')),controller[_0x7fd8('0x16')]);router[_0x7fd8('0x17')](_0x7fd8('0xa'),auth[_0x7fd8('0x7')](),interaction[_0x7fd8('0x11')]('fax',_0x7fd8('0x18')),controller['destroy']);router[_0x7fd8('0x17')]('/:id/tags',auth[_0x7fd8('0x7')](),controller[_0x7fd8('0x19')]);module[_0x7fd8('0x1a')]=router; \ No newline at end of file +var _0x4f08=['/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','update','delete','faxinteraction:destroy','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index'];(function(_0x3a09d3,_0x2fbc4d){var _0x2dc35d=function(_0x35adde){while(--_0x35adde){_0x3a09d3['push'](_0x3a09d3['shift']());}};_0x2dc35d(++_0x2fbc4d);}(_0x4f08,0xaa));var _0x84f0=function(_0x44b690,_0x5bcadc){_0x44b690=_0x44b690-0x0;var _0x2b1381=_0x4f08[_0x44b690];return _0x2b1381;};'use strict';var multer=require(_0x84f0('0x0'));var util=require(_0x84f0('0x1'));var path=require('path');var timeout=require(_0x84f0('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x84f0('0x3'));var interaction=require(_0x84f0('0x4'));var config=require(_0x84f0('0x5'));var controller=require(_0x84f0('0x6'));router[_0x84f0('0x7')]('/',auth[_0x84f0('0x8')](),controller[_0x84f0('0x9')]);router[_0x84f0('0x7')](_0x84f0('0xa'),auth['isAuthenticated'](),controller[_0x84f0('0xb')]);router[_0x84f0('0x7')](_0x84f0('0xc'),auth[_0x84f0('0x8')](),controller[_0x84f0('0xd')]);router[_0x84f0('0x7')](_0x84f0('0xe'),auth[_0x84f0('0x8')](),controller[_0x84f0('0xf')]);router[_0x84f0('0x7')](_0x84f0('0x10'),auth[_0x84f0('0x8')](),controller['download']);router[_0x84f0('0x11')]('/',auth[_0x84f0('0x8')](),controller[_0x84f0('0x12')]);router[_0x84f0('0x11')]('/:id/messages',auth['isAuthenticated'](),controller[_0x84f0('0x13')]);router[_0x84f0('0x11')](_0x84f0('0x14'),auth['isAuthenticated'](),interaction[_0x84f0('0x15')](_0x84f0('0x16'),_0x84f0('0x17')),controller[_0x84f0('0x18')]);router['put'](_0x84f0('0xc'),auth[_0x84f0('0x8')](),interaction[_0x84f0('0x15')](_0x84f0('0x16'),'faxinteraction:update'),controller[_0x84f0('0x19')]);router[_0x84f0('0x1a')]('/:id',auth[_0x84f0('0x8')](),interaction['tracked'](_0x84f0('0x16'),_0x84f0('0x1b')),controller[_0x84f0('0x1c')]);router['delete'](_0x84f0('0x14'),auth[_0x84f0('0x8')](),controller['removeTags']);module[_0x84f0('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 0897529..6a5bf4e 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 _0xcfdf=['BOOLEAN','ENUM','out','DATE','sequelize','TEXT','medium'];(function(_0x5759a2,_0x5144da){var _0x48abe2=function(_0x38ee92){while(--_0x38ee92){_0x5759a2['push'](_0x5759a2['shift']());}};_0x48abe2(++_0x5144da);}(_0xcfdf,0xcf));var _0xfcfd=function(_0x499923,_0x490ef){_0x499923=_0x499923-0x0;var _0x4e6da6=_0xcfdf[_0x499923];return _0x4e6da6;};'use strict';var Sequelize=require(_0xfcfd('0x0'));module['exports']={'body':{'type':Sequelize[_0xfcfd('0x1')](_0xfcfd('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xfcfd('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfcfd('0x4')]('in',_0xfcfd('0x5')),'defaultValue':_0xfcfd('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xfcfd('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xfcfd('0x6')]}}; \ No newline at end of file +var _0x1aba=['out','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0xf0885a,_0x391c17){var _0x42c8f4=function(_0x3af61f){while(--_0x3af61f){_0xf0885a['push'](_0xf0885a['shift']());}};_0x42c8f4(++_0x391c17);}(_0x1aba,0x19a));var _0xa1ab=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x1aba[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0xa1ab('0x0'));module[_0xa1ab('0x1')]={'body':{'type':Sequelize[_0xa1ab('0x2')](_0xa1ab('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa1ab('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa1ab('0x5')]('in','out'),'defaultValue':_0xa1ab('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xa1ab('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 81ae9ee..5f0382e 100644 --- a/server/api/faxMessage/faxMessage.controller.js +++ b/server/api/faxMessage/faxMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','EventManager','rejectmessage','create','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','Attachment','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','FaxMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22dccb,_0x5d0880,_0x1985b6){if(_0x1985b6){var _0x519dfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x519dfd[_0x0a9e('0x1d')](_0x5d0880)){return _0x22dccb;}else{throw new db[(_0x0a9e('0x1e'))]['ValidationError'](_0x0a9e('0x1f'));}}else{return _0x22dccb;}}function respondWithRpcPromise(_0x5a0a06,_0x459eb1,_0x478723,_0x106033){return new BPromise(function(_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x106033||client;return _0x2eb11f[_0x0a9e('0x20')](_0x5a0a06,_0x478723)[_0x0a9e('0x21')](function(_0x1314ae){logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x459eb1,_0x0a9e('0x24'));logger['debug'](_0x0a9e('0x25'),_0x459eb1,_0x0a9e('0x24'),JSON['stringify'](_0x1314ae));if(_0x1314ae[_0x0a9e('0x26')]){if(_0x1314ae['error']['code']===0x1f4){logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x31b1ca(_0x1314ae['error'][_0x0a9e('0x27')]);}logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x205fd6(_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x0a9e('0x24'));_0x205fd6(_0x1314ae[_0x0a9e('0x28')][_0x0a9e('0x27')]);}})[_0x0a9e('0x29')](function(_0x526cf3){logger[_0x0a9e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x526cf3);_0x31b1ca(_0x526cf3);});});}function respondWithStatusCode(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0xcc;return function(_0x1dc186){if(_0x1dc186){return _0x45a1e7[_0x0a9e('0x2a')](_0x5bfb33);}return _0x45a1e7[_0x0a9e('0x2b')](_0x5bfb33)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x140511,_0x1538a4){_0x1538a4=_0x1538a4||0xc8;return function(_0x11c3b6){if(_0x11c3b6){return _0x140511[_0x0a9e('0x2b')](_0x1538a4)['json'](_0x11c3b6);}};}function respondWithFilteredResult(_0x3652a7,_0x468813){return function(_0x2b1f27){if(_0x2b1f27){var _0x2ec755=_0x2b1f27[_0x0a9e('0x2d')],_0x5c877d=_0x468813[_0x0a9e('0x2e')],_0x15b200=_0x468813[_0x0a9e('0x2e')]+_0x468813[_0x0a9e('0x2f')],_0x40e7a3;if(_0x15b200>=_0x2ec755){_0x15b200=_0x2ec755;_0x40e7a3=0xc8;}else{_0x40e7a3=0xce;}_0x3652a7[_0x0a9e('0x2b')](_0x40e7a3);return _0x3652a7[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x5c877d+'-'+_0x15b200+'/'+_0x2ec755)['json'](_0x2b1f27);}return null;};}function patchUpdates(_0x426950){return function(_0x5d1e0e){try{jsonpatch[_0x0a9e('0x32')](_0x5d1e0e,_0x426950,!![]);}catch(_0x3ae878){return BPromise[_0x0a9e('0x33')](_0x3ae878);}return _0x5d1e0e[_0x0a9e('0x34')]();};}function saveUpdates(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(_0x66c1d2){return _0x66c1d2[_0x0a9e('0x35')](_0x25ce3a)[_0x0a9e('0x21')](function(_0x2da5c0){return _0x2da5c0;});}return null;};}function removeEntity(_0x2b45ea,_0x409319){return function(_0x332d35){if(_0x332d35){return _0x332d35[_0x0a9e('0x36')]()['then'](function(){_0x2b45ea[_0x0a9e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7a0,_0x14b13f){return function(_0x2b7e7f){if(!_0x2b7e7f){_0x2cc7a0[_0x0a9e('0x2a')](0x194);}return _0x2b7e7f;};}function handleError(_0x567193,_0x191e91){_0x191e91=_0x191e91||0x1f4;return function(_0xd1836d){logger[_0x0a9e('0x26')](_0xd1836d[_0x0a9e('0x37')]);if(_0xd1836d['name']){delete _0xd1836d['name'];}_0x567193[_0x0a9e('0x2b')](_0x191e91)['send'](_0xd1836d);};}exports[_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x39')](db['FaxMessage'][_0x0a9e('0x3a')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x3b')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x3c')]=_[_0x0a9e('0x39')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x3d9717[_0x0a9e('0x3d')]);_0x4f41ae[_0x0a9e('0x3f')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x3d')]);_0x1ef87a[_0x0a9e('0x40')]=_['intersection'](_0x4f41ae[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x3d')]['fields']));_0x1ef87a[_0x0a9e('0x40')]=_0x1ef87a[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1ef87a[_0x0a9e('0x40')]:_0x4f41ae[_0x0a9e('0x3c')];if(!_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x1ef87a[_0x0a9e('0x2f')]=qs[_0x0a9e('0x2f')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x2f')]);_0x1ef87a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x3d9717[_0x0a9e('0x3d')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x45')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x1ef87a[_0x0a9e('0x46')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x47')](_0x3d9717[_0x0a9e('0x3d')],_0x4f41ae[_0x0a9e('0x3f')]));if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]){_0x1ef87a[_0x0a9e('0x46')]=_[_0x0a9e('0x49')](_0x1ef87a['where'],{'$or':_[_0x0a9e('0x39')](_0x3bfce8,function(_0x138b8b){if(_0x138b8b[_0x0a9e('0x4a')]!==_0x0a9e('0x4b')){var _0x2e8caf={};_0x2e8caf[_0x138b8b[_0x0a9e('0x4c')]]={'$like':'%'+_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]+'%'};return _0x2e8caf;}})});}_0x1ef87a=_['merge']({},_0x1ef87a,_0x3d9717[_0x0a9e('0x4d')]);var _0x48fd45={'where':_0x1ef87a[_0x0a9e('0x46')]};return db[_0x0a9e('0x4e')][_0x0a9e('0x2d')](_0x48fd45)['then'](function(_0x14bec2){_0x31916f[_0x0a9e('0x2d')]=_0x14bec2;if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x4f')]){_0x1ef87a[_0x0a9e('0x50')]=[{'all':!![]}];}return db[_0x0a9e('0x4e')][_0x0a9e('0x51')](_0x1ef87a);})['then'](function(_0x13f44d){_0x31916f[_0x0a9e('0x52')]=_0x13f44d;return _0x31916f;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x381c37,_0x1ef87a))[_0x0a9e('0x29')](handleError(_0x381c37,null));};exports[_0x0a9e('0x53')]=function(_0x992c77,_0x6054ee){var _0x19383e={'raw':!![],'where':{'id':_0x992c77['params']['id']}},_0x34febd={};_0x34febd[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['FaxMessage']['rawAttributes']);_0x34febd['query']=_[_0x0a9e('0x3e')](_0x992c77[_0x0a9e('0x3d')]);_0x34febd[_0x0a9e('0x3f')]=_[_0x0a9e('0x54')](_0x34febd[_0x0a9e('0x3c')],_0x34febd[_0x0a9e('0x3d')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x54')](_0x34febd['model'],qs['fields'](_0x992c77['query'][_0x0a9e('0x41')]));_0x19383e[_0x0a9e('0x40')]=_0x19383e[_0x0a9e('0x40')]['length']?_0x19383e[_0x0a9e('0x40')]:_0x34febd[_0x0a9e('0x3c')];if(_0x992c77['query']['includeAll']){_0x19383e[_0x0a9e('0x50')]=[{'all':!![]}];}_0x19383e=_['merge']({},_0x19383e,_0x992c77[_0x0a9e('0x4d')]);return db['FaxMessage'][_0x0a9e('0x55')](_0x19383e)[_0x0a9e('0x21')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x21')](respondWithResult(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports[_0x0a9e('0x35')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x4e')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x57')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x21')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5df0ad[_0x0a9e('0x57')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x21')](removeEntity(_0x2da03c,null))[_0x0a9e('0x29')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['FaxMessage'][_0x0a9e('0x58')]()[_0x0a9e('0x21')](respondWithResult(_0x28d814,null))[_0x0a9e('0x29')](handleError(_0x28d814,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x5b')]=function(_0x5d86e9,_0x956fbe,_0x26bc80){var _0x5239ef={'channel':_0x0a9e('0x5c')};if(_0x5d86e9['body']['id']){delete _0x5d86e9[_0x0a9e('0x56')]['id'];}_0x5d86e9['body']['read']=!![];_0x5d86e9['body'][_0x0a9e('0x5d')]=moment()['format'](_0x0a9e('0x5e'));_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]=_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]||_0x5d86e9[_0x0a9e('0x60')]['id'];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5d86e9['params']['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x61')],'as':_0x0a9e('0x62')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9[_0x0a9e('0x56')],null))[_0x0a9e('0x21')](function(_0x119677){if(_0x119677){_0x5239ef[_0x0a9e('0x27')]=_0x119677['get']({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x119677['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))[_0x0a9e('0x21')](function(_0x88dcbf){if(_0x88dcbf){return _0x88dcbf[_0x0a9e('0x35')]({'UserId':_0x5d86e9[_0x0a9e('0x56')]['UserId'],'read1stAt':_[_0x0a9e('0x64')](_0x88dcbf[_0x0a9e('0x65')])?moment()[_0x0a9e('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x21')](function(_0x4f1e60){if(_0x4f1e60){_0x5239ef['interaction']=_0x4f1e60[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x60')]['id'],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x69')],_0x5239ef[_0x0a9e('0x6a')]['id'],_0x5d86e9[_0x0a9e('0x56')]?JSON[_0x0a9e('0x6b')](_0x5d86e9[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x6d'),_0x0a9e('0x6e'),_0x5239ef);}return null;})[_0x0a9e('0x21')](function(_0x2a28c0){if(_0x2a28c0){if(_0x5d86e9[_0x0a9e('0x56')]['manual']){_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util[_0x0a9e('0x66')]('SIP/%s',_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x5239ef['message'][_0x0a9e('0x70')]=_0x5239ef[_0x0a9e('0x70')];_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x71')]=_0x0a9e('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5239ef[_0x0a9e('0x27')]},client9002)[_0x0a9e('0x21')](function(){return _0x5239ef;});}return _0x5239ef;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x956fbe,null))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x33')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2={'agent':{},'channel':_0x0a9e('0x5c')};if(_0x1a0677['body']['id']){delete _0x1a0677[_0x0a9e('0x56')]['id'];}_0x1a0677['body'][_0x0a9e('0x5f')]=_0x1a0677[_0x0a9e('0x56')]['UserId']||_0x1a0677[_0x0a9e('0x60')]['id'];_0xcbc8b2[_0x0a9e('0x72')]['id']=_0x1a0677[_0x0a9e('0x56')][_0x0a9e('0x5f')];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x1a0677[_0x0a9e('0x57')]['id'],'UserId':null}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x5b7fc3){if(_0x5b7fc3){_0xcbc8b2[_0x0a9e('0x27')]=_0x5b7fc3[_0x0a9e('0x67')]({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x5b7fc3['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x30a4c7){if(_0x30a4c7){_0xcbc8b2[_0x0a9e('0x6a')]=_0x30a4c7[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x73'),_0x1a0677[_0x0a9e('0x60')]['id'],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x69')],_0xcbc8b2[_0x0a9e('0x6a')]['id'],_0x1a0677[_0x0a9e('0x56')]?JSON['stringify'](_0x1a0677[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x74'),'rejectMessage',_0xcbc8b2);}return null;})[_0x0a9e('0x21')](function(_0x33dda0){if(_0x33dda0){_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util['format']('SIP/%s',_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x33dda0['message'][_0x0a9e('0x70')]=_0xcbc8b2['channel'];_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x71')]='reject';respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x75'),{'event':_0x0a9e('0x76'),'message':_0x33dda0[_0x0a9e('0x27')]},client9002);return _0xcbc8b2;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x5512d1,null))[_0x0a9e('0x29')](handleError(_0x5512d1,null));};exports[_0x0a9e('0x77')]=function(_0x482ca2,_0x2973d3){var _0x3ca9b9;return db[_0x0a9e('0x4e')][_0x0a9e('0x77')](_0x482ca2['body'],{})[_0x0a9e('0x21')](function(_0xf0db1){_0x3ca9b9=_0xf0db1;return db['CmContact'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9['ContactId']}});})[_0x0a9e('0x21')](function(_0x2bb25a){if(_[_0x0a9e('0x64')](_0x2bb25a)){return;}else{_0x3ca9b9[_0x0a9e('0x5c')]=_0x2bb25a['fax'];return db['Attachment'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9[_0x0a9e('0x79')]}});}})[_0x0a9e('0x21')](function(_0x5ac73d){return respondWithRpcPromise(_0x0a9e('0x7a'),_0x0a9e('0x7a'),{'FaxAccountId':_['isNil'](_0x482ca2['body'])?undefined:_0x482ca2[_0x0a9e('0x56')]['FaxAccountId'],'path':_['isNil'](_0x5ac73d)?undefined:util['format'](_0x0a9e('0x7b'),_0x5ac73d[_0x0a9e('0x7c')]),'fax':_[_0x0a9e('0x64')](_0x3ca9b9[_0x0a9e('0x5c')])?undefined:_0x3ca9b9[_0x0a9e('0x5c')],'AttachmentId':_0x3ca9b9[_0x0a9e('0x79')]},client9002);})['then'](respondWithResult(_0x2973d3,0xc9))[_0x0a9e('0x29')](handleError(_0x2973d3,null));};exports['download']=function(_0x2871c1,_0x2aabab){var _0x18ad56=path[_0x0a9e('0x7d')](config['root'],_0x0a9e('0x7e'),_0x0a9e('0x7f'),_0x0a9e('0x80'));return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x2871c1[_0x0a9e('0x57')]['id']},'include':[{'model':db[_0x0a9e('0x81')],'as':_0x0a9e('0x81')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x2aabab,null))[_0x0a9e('0x21')](function(_0x32b9bd){if(_0x32b9bd){return _0x2aabab[_0x0a9e('0x82')](path['join'](_0x18ad56,_0x32b9bd[_0x0a9e('0x81')][_0x0a9e('0x7c')]));}})['catch'](handleError(_0x2aabab,null));}; \ No newline at end of file +var _0xb10b=['read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','channel','EventManager','acceptmessage','fax','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','create','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','attachments','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','update','stack','name','send','index','FaxMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','body','destroy','describe','fax-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','FaxInteraction','isNil'];(function(_0x35d983,_0x1df52b){var _0x3bf48b=function(_0x493352){while(--_0x493352){_0x35d983['push'](_0x35d983['shift']());}};_0x3bf48b(++_0x1df52b);}(_0xb10b,0x12a));var _0xbb10=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0xb10b[_0x65c50e];return _0x4573e7;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x18')]));require('./faxMessage.socket')[_0xbb10('0x1c')](socket);var jayson=require(_0xbb10('0x1d'));var client=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232c});var client9002=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x24a57b,_0x36b5e8,_0x3e26f4){if(_0x3e26f4){var _0x2b184e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b184e['test'](_0x36b5e8)){return _0x24a57b;}else{throw new db[(_0xbb10('0x20'))][(_0xbb10('0x21'))](_0xbb10('0x22'));}}else{return _0x24a57b;}}function respondWithRpcPromise(_0x42db98,_0x378da8,_0x1682a4,_0x575cca){return new BPromise(function(_0x30efc6,_0xbf2906){var _0xe1c665=_0x575cca||client;return _0xe1c665['request'](_0x42db98,_0x1682a4)[_0xbb10('0x23')](function(_0x19f48d){logger[_0xbb10('0x24')](_0xbb10('0x25'),_0x378da8,_0xbb10('0x26'));logger[_0xbb10('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'),JSON[_0xbb10('0x28')](_0x19f48d));if(_0x19f48d['error']){if(_0x19f48d['error'][_0xbb10('0x29')]===0x1f4){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0xbf2906(_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);}logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0x30efc6(_0x19f48d[_0xbb10('0x2a')]['message']);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'));_0x30efc6(_0x19f48d[_0xbb10('0x2c')][_0xbb10('0x2b')]);}})['catch'](function(_0x2fdde9){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x2fdde9);_0xbf2906(_0x2fdde9);});});}function respondWithStatusCode(_0x1d5e95,_0x1acce9){_0x1acce9=_0x1acce9||0xcc;return function(_0x20d946){if(_0x20d946){return _0x1d5e95[_0xbb10('0x2d')](_0x1acce9);}return _0x1d5e95['status'](_0x1acce9)[_0xbb10('0x2e')]();};}function respondWithResult(_0x21ac54,_0xfc3595){_0xfc3595=_0xfc3595||0xc8;return function(_0x2e0249){if(_0x2e0249){return _0x21ac54[_0xbb10('0x2f')](_0xfc3595)[_0xbb10('0x30')](_0x2e0249);}};}function respondWithFilteredResult(_0x5d5c80,_0x221624){return function(_0x4ee02e){if(_0x4ee02e){var _0x448d5c=_0x4ee02e[_0xbb10('0x31')],_0x56f2da=_0x221624['offset'],_0x16ad2a=_0x221624['offset']+_0x221624[_0xbb10('0x32')],_0x1dcc9c;if(_0x16ad2a>=_0x448d5c){_0x16ad2a=_0x448d5c;_0x1dcc9c=0xc8;}else{_0x1dcc9c=0xce;}_0x5d5c80[_0xbb10('0x2f')](_0x1dcc9c);return _0x5d5c80['set'](_0xbb10('0x33'),_0x56f2da+'-'+_0x16ad2a+'/'+_0x448d5c)[_0xbb10('0x30')](_0x4ee02e);}return null;};}function patchUpdates(_0x2f653f){return function(_0x1c0b57){try{jsonpatch[_0xbb10('0x34')](_0x1c0b57,_0x2f653f,!![]);}catch(_0x138bc6){return BPromise[_0xbb10('0x35')](_0x138bc6);}return _0x1c0b57['save']();};}function saveUpdates(_0x25acb3,_0x1da9c9){return function(_0x441d15){if(_0x441d15){return _0x441d15[_0xbb10('0x36')](_0x25acb3)[_0xbb10('0x23')](function(_0x9de708){return _0x9de708;});}return null;};}function removeEntity(_0x188cbd,_0x10202c){return function(_0x3c8d7d){if(_0x3c8d7d){return _0x3c8d7d['destroy']()[_0xbb10('0x23')](function(){_0x188cbd[_0xbb10('0x2f')](0xcc)[_0xbb10('0x2e')]();});}};}function handleEntityNotFound(_0x3c3c45,_0x570f5a){return function(_0x111762){if(!_0x111762){_0x3c3c45['sendStatus'](0x194);}return _0x111762;};}function handleError(_0x4e2754,_0x3eb3cc){_0x3eb3cc=_0x3eb3cc||0x1f4;return function(_0x40c164){logger[_0xbb10('0x2a')](_0x40c164[_0xbb10('0x37')]);if(_0x40c164[_0xbb10('0x38')]){delete _0x40c164[_0xbb10('0x38')];}_0x4e2754['status'](_0x3eb3cc)[_0xbb10('0x39')](_0x40c164);};}exports[_0xbb10('0x3a')]=function(_0x52de31,_0x5e3fbd){var _0x5cd55f={},_0x31bee3={},_0x2b0b45={'count':0x0,'rows':[]};var _0x2b658a=_['map'](db[_0xbb10('0x3b')][_0xbb10('0x3c')],function(_0x4345f3){return{'name':_0x4345f3['fieldName'],'type':_0x4345f3[_0xbb10('0x3d')][_0xbb10('0x3e')]};});_0x31bee3[_0xbb10('0x3f')]=_[_0xbb10('0x40')](_0x2b658a,'name');_0x31bee3[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x52de31['query']);_0x31bee3[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x31bee3[_0xbb10('0x3f')],_0x31bee3[_0xbb10('0x41')]);_0x5cd55f[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x31bee3['model'],qs[_0xbb10('0x46')](_0x52de31[_0xbb10('0x41')][_0xbb10('0x46')]));_0x5cd55f[_0xbb10('0x45')]=_0x5cd55f['attributes'][_0xbb10('0x47')]?_0x5cd55f[_0xbb10('0x45')]:_0x31bee3[_0xbb10('0x3f')];if(!_0x52de31[_0xbb10('0x41')]['hasOwnProperty'](_0xbb10('0x48'))){_0x5cd55f[_0xbb10('0x32')]=qs['limit'](_0x52de31['query'][_0xbb10('0x32')]);_0x5cd55f['offset']=qs[_0xbb10('0x49')](_0x52de31[_0xbb10('0x41')]['offset']);}_0x5cd55f[_0xbb10('0x4a')]=qs[_0xbb10('0x4b')](_0x52de31[_0xbb10('0x41')]['sort']);_0x5cd55f[_0xbb10('0x4c')]=qs[_0xbb10('0x43')](_[_0xbb10('0x4d')](_0x52de31[_0xbb10('0x41')],_0x31bee3[_0xbb10('0x43')]));if(_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]){_0x5cd55f[_0xbb10('0x4c')]=_[_0xbb10('0x4f')](_0x5cd55f[_0xbb10('0x4c')],{'$or':_[_0xbb10('0x40')](_0x2b658a,function(_0x1eadd2){if(_0x1eadd2['type']!==_0xbb10('0x50')){var _0x41bbf8={};_0x41bbf8[_0x1eadd2['name']]={'$like':'%'+_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]+'%'};return _0x41bbf8;}})});}_0x5cd55f=_[_0xbb10('0x4f')]({},_0x5cd55f,_0x52de31[_0xbb10('0x51')]);var _0x41ea91={'where':_0x5cd55f[_0xbb10('0x4c')]};return db[_0xbb10('0x3b')]['count'](_0x41ea91)['then'](function(_0xcb3354){_0x2b0b45[_0xbb10('0x31')]=_0xcb3354;if(_0x52de31[_0xbb10('0x41')]['includeAll']){_0x5cd55f['include']=[{'all':!![]}];}return db[_0xbb10('0x3b')][_0xbb10('0x52')](_0x5cd55f);})[_0xbb10('0x23')](function(_0xf820fe){_0x2b0b45[_0xbb10('0x53')]=_0xf820fe;return _0x2b0b45;})[_0xbb10('0x23')](respondWithFilteredResult(_0x5e3fbd,_0x5cd55f))[_0xbb10('0x54')](handleError(_0x5e3fbd,null));};exports[_0xbb10('0x55')]=function(_0x2626d8,_0x3d7e7e){var _0x550111={'raw':!![],'where':{'id':_0x2626d8[_0xbb10('0x56')]['id']}},_0x5eafac={};_0x5eafac[_0xbb10('0x3f')]=_[_0xbb10('0x42')](db[_0xbb10('0x3b')][_0xbb10('0x3c')]);_0x5eafac[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x2626d8[_0xbb10('0x41')]);_0x5eafac[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],_0x5eafac[_0xbb10('0x41')]);_0x550111[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],qs['fields'](_0x2626d8[_0xbb10('0x41')]['fields']));_0x550111[_0xbb10('0x45')]=_0x550111[_0xbb10('0x45')][_0xbb10('0x47')]?_0x550111[_0xbb10('0x45')]:_0x5eafac[_0xbb10('0x3f')];if(_0x2626d8[_0xbb10('0x41')][_0xbb10('0x57')]){_0x550111[_0xbb10('0x58')]=[{'all':!![]}];}_0x550111=_[_0xbb10('0x4f')]({},_0x550111,_0x2626d8[_0xbb10('0x51')]);return db[_0xbb10('0x3b')][_0xbb10('0x59')](_0x550111)[_0xbb10('0x23')](handleEntityNotFound(_0x3d7e7e,null))[_0xbb10('0x23')](respondWithResult(_0x3d7e7e,null))[_0xbb10('0x54')](handleError(_0x3d7e7e,null));};exports['update']=function(_0x4571b6,_0x466eb7){if(_0x4571b6[_0xbb10('0x5a')]['id']){delete _0x4571b6[_0xbb10('0x5a')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x4571b6['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x466eb7,null))[_0xbb10('0x23')](saveUpdates(_0x4571b6[_0xbb10('0x5a')],null))[_0xbb10('0x23')](respondWithResult(_0x466eb7,null))[_0xbb10('0x54')](handleError(_0x466eb7,null));};exports[_0xbb10('0x5b')]=function(_0x175872,_0x12ec18){return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x175872[_0xbb10('0x56')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))[_0xbb10('0x23')](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['describe']=function(_0x16272d,_0x3e6338){return db[_0xbb10('0x3b')][_0xbb10('0x5c')]()['then'](respondWithResult(_0x3e6338,null))['catch'](handleError(_0x3e6338,null));};var interaction_log=require(_0xbb10('0x15'))(_0xbb10('0x5d'));exports[_0xbb10('0x5e')]=function(_0x2dd150,_0x412f13,_0x3e9753){var _0x45c0dc={'channel':'fax'};if(_0x2dd150[_0xbb10('0x5a')]['id']){delete _0x2dd150[_0xbb10('0x5a')]['id'];}_0x2dd150['body']['read']=!![];_0x2dd150['body'][_0xbb10('0x5f')]=moment()[_0xbb10('0x60')](_0xbb10('0x61'));_0x2dd150['body']['UserId']=_0x2dd150['body'][_0xbb10('0x62')]||_0x2dd150[_0xbb10('0x63')]['id'];return db[_0xbb10('0x3b')]['find']({'where':{'id':_0x2dd150[_0xbb10('0x56')]['id'],'UserId':null},'include':[{'model':db[_0xbb10('0x64')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](saveUpdates(_0x2dd150[_0xbb10('0x5a')],null))[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x45c0dc['message']=_0x237246[_0xbb10('0x65')]({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x237246['FaxInteractionId']}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](function(_0x3e3617){if(_0x3e3617){return _0x3e3617['update']({'UserId':_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x62')],'read1stAt':_[_0xbb10('0x67')](_0x3e3617[_0xbb10('0x68')])?moment()['format'](_0xbb10('0x61')):undefined});}return null;})[_0xbb10('0x23')](function(_0x108e5b){if(_0x108e5b){_0x45c0dc[_0xbb10('0x69')]=_0x108e5b['get']({'plain':!![]});interaction_log[_0xbb10('0x24')](_0xbb10('0x6a'),_0x2dd150[_0xbb10('0x63')]['id'],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x6b')],_0x45c0dc['interaction']['id'],_0x2dd150['body']?JSON['stringify'](_0x2dd150[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x6d'),'acceptMessage',_0x45c0dc);}return null;})['then'](function(_0x46f462){if(_0x46f462){if(_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x6e')]){_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')]);_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x45c0dc[_0xbb10('0x70')];_0x45c0dc['message']['event']='accept';return respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':_0xbb10('0x72'),'message':_0x45c0dc[_0xbb10('0x2b')]},client9002)[_0xbb10('0x23')](function(){return _0x45c0dc;});}return _0x45c0dc;}return null;})[_0xbb10('0x23')](respondWithResult(_0x412f13,null))['catch'](handleError(_0x412f13,null));};var interaction_log=require(_0xbb10('0x15'))('fax-interactions');exports['reject']=function(_0x519a54,_0xdf634f,_0x13040d){var _0x23b1d5={'agent':{},'channel':_0xbb10('0x73')};if(_0x519a54['body']['id']){delete _0x519a54[_0xbb10('0x5a')]['id'];}_0x519a54['body']['UserId']=_0x519a54[_0xbb10('0x5a')][_0xbb10('0x62')]||_0x519a54[_0xbb10('0x63')]['id'];_0x23b1d5[_0xbb10('0x74')]['id']=_0x519a54[_0xbb10('0x5a')]['UserId'];return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x519a54[_0xbb10('0x56')]['id'],'UserId':null}})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x27f42f){if(_0x27f42f){_0x23b1d5[_0xbb10('0x2b')]=_0x27f42f['get']({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x27f42f[_0xbb10('0x75')]}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x172be3){if(_0x172be3){_0x23b1d5[_0xbb10('0x69')]=_0x172be3[_0xbb10('0x65')]({'plain':!![]});interaction_log['info'](_0xbb10('0x76'),_0x519a54[_0xbb10('0x63')]['id'],_0x519a54[_0xbb10('0x63')]['name'],_0x519a54['user']['role'],_0x23b1d5[_0xbb10('0x69')]['id'],_0x519a54['body']?JSON['stringify'](_0x519a54[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x77'),_0xbb10('0x78'),_0x23b1d5);}return null;})[_0xbb10('0x23')](function(_0x24dca6){if(_0x24dca6){_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x519a54[_0xbb10('0x63')][_0xbb10('0x38')]);_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x23b1d5['channel'];_0x24dca6['message'][_0xbb10('0x79')]=_0xbb10('0x35');respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':'rejectmessage','message':_0x24dca6[_0xbb10('0x2b')]},client9002);return _0x23b1d5;}return null;})[_0xbb10('0x23')](respondWithResult(_0xdf634f,null))[_0xbb10('0x54')](handleError(_0xdf634f,null));};exports[_0xbb10('0x7a')]=function(_0x35c1e8,_0x517185){var _0x5f0691;return db[_0xbb10('0x3b')][_0xbb10('0x7a')](_0x35c1e8[_0xbb10('0x5a')],{})['then'](function(_0x256b35){_0x5f0691=_0x256b35;return db[_0xbb10('0x64')]['findOne']({'where':{'id':_0x5f0691['ContactId']}});})[_0xbb10('0x23')](function(_0x26d0dd){if(_[_0xbb10('0x67')](_0x26d0dd)){return;}else{_0x5f0691['fax']=_0x26d0dd[_0xbb10('0x73')];return db[_0xbb10('0x7b')][_0xbb10('0x7c')]({'where':{'id':_0x5f0691[_0xbb10('0x7d')]}});}})[_0xbb10('0x23')](function(_0x5de006){return respondWithRpcPromise(_0xbb10('0x7e'),_0xbb10('0x7e'),{'FaxAccountId':_[_0xbb10('0x67')](_0x35c1e8['body'])?undefined:_0x35c1e8[_0xbb10('0x5a')][_0xbb10('0x7f')],'path':_[_0xbb10('0x67')](_0x5de006)?undefined:util[_0xbb10('0x60')](_0xbb10('0x80'),_0x5de006[_0xbb10('0x81')]),'fax':_[_0xbb10('0x67')](_0x5f0691[_0xbb10('0x73')])?undefined:_0x5f0691[_0xbb10('0x73')],'AttachmentId':_0x5f0691[_0xbb10('0x7d')]},client9002);})[_0xbb10('0x23')](respondWithResult(_0x517185,0xc9))[_0xbb10('0x54')](handleError(_0x517185,null));};exports['download']=function(_0x51f106,_0xe1fc51){var _0x3fa344=path[_0xbb10('0x82')](config[_0xbb10('0x83')],_0xbb10('0x84'),'files',_0xbb10('0x85'));return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x51f106[_0xbb10('0x56')]['id']},'include':[{'model':db[_0xbb10('0x7b')],'as':_0xbb10('0x7b')}]})['then'](handleEntityNotFound(_0xe1fc51,null))[_0xbb10('0x23')](function(_0x742e10){if(_0x742e10){return _0xe1fc51['download'](path[_0xbb10('0x82')](_0x3fa344,_0x742e10['Attachment'][_0xbb10('0x81')]));}})[_0xbb10('0x54')](handleError(_0xe1fc51,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 3b21fa7..041db83 100644 --- a/server/api/faxMessage/faxMessage.events.js +++ b/server/api/faxMessage/faxMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x55ca,0x126));var _0xa55c=function(_0x354bd6,_0x4a7c74){_0x354bd6=_0x354bd6-0x0;var _0x39bf52=_0x55ca[_0x354bd6];return _0x39bf52;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var FaxMessage=require(_0xa55c('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){FaxMessageEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);FaxMessageEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];FaxMessage[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x3e74=['hasOwnProperty','exports','events','FaxMessage','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x25e3cc,_0x113165){_0x25e3cc=_0x25e3cc-0x0;var _0x18d72b=_0x3e74[_0x25e3cc];return _0x18d72b;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x43e7('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){FaxMessageEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);FaxMessageEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 232544c..6f2773e 100644 --- a/server/api/faxMessage/faxMessage.model.js +++ b/server/api/faxMessage/faxMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb295=['models','get','toLowerCase','direction','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT'];(function(_0x20bf6b,_0x43e437){var _0x3cf675=function(_0x37c408){while(--_0x37c408){_0x20bf6b['push'](_0x20bf6b['shift']());}};_0x3cf675(++_0x43e437);}(_0xb295,0x18a));var _0x5b29=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xb295[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0x5b29('0x0'));var util=require(_0x5b29('0x1'));var logger=require(_0x5b29('0x2'))(_0x5b29('0x3'));var moment=require('moment');var BPromise=require(_0x5b29('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b29('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0x5b29('0x6')]=function(_0x36f735,_0x3c1242){return _0x36f735[_0x5b29('0x7')](_0x5b29('0x8'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x5b29('0x9'),'fields':[_0x5b29('0xa')],'type':_0x5b29('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f7745,_0x1c078b,_0x5aa22c){var _0x5c525c=_0x36f735[_0x5b29('0xc')];var _0x5de318=_0x3f7745[_0x5b29('0xd')]({'plain':!![]});if(_0x5de318['direction'][_0x5b29('0xe')]()==='in'||_0x5de318[_0x5b29('0xf')]['toLowerCase']()==='out'&&!_0x5de318[_0x5b29('0x10')]&&!_[_0x5b29('0x11')](_0x5de318[_0x5b29('0x12')])){_0x5c525c[_0x5b29('0x13')][_0x5b29('0x14')]({'where':{'id':_0x5de318[_0x5b29('0x15')]}})[_0x5b29('0x16')](function(_0x906071){if(_0x906071){_0x906071[_0x5b29('0x17')]({'lastMsgAt':_0x5de318[_0x5b29('0x18')],'lastMsgDirection':_0x5de318[_0x5b29('0xf')][_0x5b29('0xe')]()});}})[_0x5b29('0x19')](function(_0x4273eb){console[_0x5b29('0x1a')](_0x4273eb);});}_0x5aa22c();}},'charset':_0x5b29('0x1b'),'collate':_0x5b29('0x1c')});}; \ No newline at end of file +var _0x3f1a=['isNil','FaxInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','models','direction','toLowerCase','out','secret'];(function(_0x11bd6f,_0x583dd7){var _0x563307=function(_0x266b54){while(--_0x266b54){_0x11bd6f['push'](_0x11bd6f['shift']());}};_0x563307(++_0x583dd7);}(_0x3f1a,0x13e));var _0xa3f1=function(_0x3c9cc3,_0x13ebd1){_0x3c9cc3=_0x3c9cc3-0x0;var _0x1b52cb=_0x3f1a[_0x3c9cc3];return _0x1b52cb;};'use strict';var _=require(_0xa3f1('0x0'));var util=require('util');var logger=require(_0xa3f1('0x1'))(_0xa3f1('0x2'));var moment=require(_0xa3f1('0x3'));var BPromise=require(_0xa3f1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa3f1('0x5'));var rimraf=require(_0xa3f1('0x6'));var config=require('../../config/environment');var attributes=require(_0xa3f1('0x7'));module[_0xa3f1('0x8')]=function(_0x3cacf9,_0x2309e1){return _0x3cacf9[_0xa3f1('0x9')](_0xa3f1('0xa'),attributes,{'tableName':_0xa3f1('0xb'),'paranoid':![],'indexes':[{'name':_0xa3f1('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x53eca5,_0x56f357,_0x10cca9){var _0x336504=_0x3cacf9[_0xa3f1('0xd')];var _0x263e66=_0x53eca5['get']({'plain':!![]});if(_0x263e66[_0xa3f1('0xe')][_0xa3f1('0xf')]()==='in'||_0x263e66[_0xa3f1('0xe')][_0xa3f1('0xf')]()===_0xa3f1('0x10')&&!_0x263e66[_0xa3f1('0x11')]&&!_[_0xa3f1('0x12')](_0x263e66['UserId'])){_0x336504[_0xa3f1('0x13')][_0xa3f1('0x14')]({'where':{'id':_0x263e66['FaxInteractionId']}})[_0xa3f1('0x15')](function(_0x36d4a4){if(_0x36d4a4){_0x36d4a4[_0xa3f1('0x16')]({'lastMsgAt':_0x263e66[_0xa3f1('0x17')],'lastMsgDirection':_0x263e66[_0xa3f1('0xe')][_0xa3f1('0xf')]()});}})[_0xa3f1('0x18')](function(_0x48f585){console[_0xa3f1('0x19')](_0x48f585);});}_0x10cca9();}},'charset':_0xa3f1('0x1a'),'collate':_0xa3f1('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index a53554a..92200fc 100644 --- a/server/api/faxMessage/faxMessage.rpc.js +++ b/server/api/faxMessage/faxMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7cda=['then','catch','FaxMessage','body','raw','attributes','limit','UpdateFaxMessage','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./faxMessage.socket','register','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage','create','options'];(function(_0x34f7d7,_0x5937a1){var _0x43cf70=function(_0xe133d6){while(--_0xe133d6){_0x34f7d7['push'](_0x34f7d7['shift']());}};_0x43cf70(++_0x5937a1);}(_0x7cda,0xf6));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xa7cd('0x0'));var moment=require(_0xa7cd('0x1'));var BPromise=require(_0xa7cd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa7cd('0x3'));var db=require(_0xa7cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa7cd('0x5'))(_0xa7cd('0x6'));var config=require(_0xa7cd('0x7'));var jayson=require(_0xa7cd('0x8'));var client=jayson['client'][_0xa7cd('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa7cd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa7cd('0xb'))(new Redis(config[_0xa7cd('0xa')]));require(_0xa7cd('0xc'))[_0xa7cd('0xd')](socket);function respondWithRpcPromise(_0x31879f,_0x372273,_0x39d8c4){return new BPromise(function(_0x1a66f7,_0xd20e5d){return client['request'](_0x31879f,_0x39d8c4)['then'](function(_0x3c38a4){logger[_0xa7cd('0xe')]('FaxMessage,\x20%s,\x20%s',_0x372273,_0xa7cd('0xf'));logger[_0xa7cd('0x10')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x372273,_0xa7cd('0xf'),JSON[_0xa7cd('0x11')](_0x3c38a4));if(_0x3c38a4[_0xa7cd('0x12')]){if(_0x3c38a4['error'][_0xa7cd('0x13')]===0x1f4){logger[_0xa7cd('0x12')](_0xa7cd('0x14'),_0x372273,_0x3c38a4[_0xa7cd('0x12')][_0xa7cd('0x15')]);return _0xd20e5d(_0x3c38a4[_0xa7cd('0x12')]['message']);}logger['error'](_0xa7cd('0x14'),_0x372273,_0x3c38a4[_0xa7cd('0x12')][_0xa7cd('0x15')]);return _0x1a66f7(_0x3c38a4['error'][_0xa7cd('0x15')]);}else{logger[_0xa7cd('0xe')]('FaxMessage,\x20%s,\x20%s',_0x372273,_0xa7cd('0xf'));_0x1a66f7(_0x3c38a4[_0xa7cd('0x16')][_0xa7cd('0x15')]);}})['catch'](function(_0x111774){logger[_0xa7cd('0x12')]('FaxMessage,\x20%s,\x20%s',_0x372273,_0x111774);_0xd20e5d(_0x111774);});});}exports[_0xa7cd('0x17')]=function(_0x7eab17){var _0x14305a=this;return new Promise(function(_0x5224b0,_0x4c601c){return db['FaxMessage'][_0xa7cd('0x18')](_0x7eab17['body'],{'raw':_0x7eab17['options']?_0x7eab17[_0xa7cd('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xa7cd('0x1a')](function(_0x134612){logger['info']('CreateFaxMessage',_0x7eab17);logger['debug'](_0xa7cd('0x17'),_0x7eab17,JSON['stringify'](_0x134612));_0x5224b0(_0x134612);})[_0xa7cd('0x1b')](function(_0x1c79f9){logger['error'](_0xa7cd('0x17'),_0x1c79f9['message'],_0x7eab17);_0x4c601c(_0x14305a[_0xa7cd('0x12')](0x1f4,_0x1c79f9[_0xa7cd('0x15')]));});});};exports['UpdateFaxMessage']=function(_0x2796a5){var _0x4362a4=this;return new Promise(function(_0x53d3b7,_0x5ba778){return db[_0xa7cd('0x1c')]['update'](_0x2796a5[_0xa7cd('0x1d')],{'raw':_0x2796a5['options']?_0x2796a5[_0xa7cd('0x19')][_0xa7cd('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2796a5['options']?_0x2796a5['options']['where']||null:null,'attributes':_0x2796a5[_0xa7cd('0x19')]?_0x2796a5['options'][_0xa7cd('0x1f')]||null:null,'limit':_0x2796a5[_0xa7cd('0x19')]?_0x2796a5[_0xa7cd('0x19')][_0xa7cd('0x20')]||null:null})['then'](function(_0x11b7d7){logger['info'](_0xa7cd('0x21'),_0x2796a5);logger[_0xa7cd('0x10')]('UpdateFaxMessage',_0x2796a5,JSON[_0xa7cd('0x11')](_0x11b7d7));_0x53d3b7(_0x11b7d7);})[_0xa7cd('0x1b')](function(_0xb4cfa){logger[_0xa7cd('0x12')](_0xa7cd('0x21'),_0xb4cfa[_0xa7cd('0x15')],_0x2796a5);_0x5ba778(_0x4362a4[_0xa7cd('0x12')](0x1f4,_0xb4cfa[_0xa7cd('0x15')]));});});}; \ No newline at end of file +var _0xb488=['code','message','info','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb488,0xe7));var _0x8b48=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb488[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x8b48('0x0'));var util=require('util');var moment=require(_0x8b48('0x1'));var BPromise=require(_0x8b48('0x2'));var rs=require(_0x8b48('0x3'));var fs=require('fs');var Redis=require(_0x8b48('0x4'));var db=require(_0x8b48('0x5'))['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']['http']({'port':0x232a});config[_0x8b48('0x6')]=_['defaults'](config[_0x8b48('0x6')],{'host':_0x8b48('0x7'),'port':0x18eb});var socket=require(_0x8b48('0x8'))(new Redis(config[_0x8b48('0x6')]));require(_0x8b48('0x9'))[_0x8b48('0xa')](socket);function respondWithRpcPromise(_0x284fae,_0x863e4e,_0x19a5cc){return new BPromise(function(_0x15274f,_0x46579a){return client['request'](_0x284fae,_0x19a5cc)['then'](function(_0x54dcb4){logger['info'](_0x8b48('0xb'),_0x863e4e,_0x8b48('0xc'));logger[_0x8b48('0xd')](_0x8b48('0xe'),_0x863e4e,_0x8b48('0xc'),JSON[_0x8b48('0xf')](_0x54dcb4));if(_0x54dcb4['error']){if(_0x54dcb4[_0x8b48('0x10')][_0x8b48('0x11')]===0x1f4){logger[_0x8b48('0x10')](_0x8b48('0xb'),_0x863e4e,_0x54dcb4[_0x8b48('0x10')][_0x8b48('0x12')]);return _0x46579a(_0x54dcb4[_0x8b48('0x10')][_0x8b48('0x12')]);}logger[_0x8b48('0x10')]('FaxMessage,\x20%s,\x20%s',_0x863e4e,_0x54dcb4[_0x8b48('0x10')][_0x8b48('0x12')]);return _0x15274f(_0x54dcb4['error'][_0x8b48('0x12')]);}else{logger[_0x8b48('0x13')]('FaxMessage,\x20%s,\x20%s',_0x863e4e,_0x8b48('0xc'));_0x15274f(_0x54dcb4[_0x8b48('0x14')][_0x8b48('0x12')]);}})[_0x8b48('0x15')](function(_0x5aba87){logger[_0x8b48('0x10')]('FaxMessage,\x20%s,\x20%s',_0x863e4e,_0x5aba87);_0x46579a(_0x5aba87);});});}exports[_0x8b48('0x16')]=function(_0x150b80){var _0x4bc7e4=this;return new Promise(function(_0x5bea3e,_0xebe4c1){return db[_0x8b48('0x17')]['create'](_0x150b80[_0x8b48('0x18')],{'raw':_0x150b80['options']?_0x150b80[_0x8b48('0x19')][_0x8b48('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x24ba81){logger[_0x8b48('0x13')](_0x8b48('0x16'),_0x150b80);logger[_0x8b48('0xd')](_0x8b48('0x16'),_0x150b80,JSON[_0x8b48('0xf')](_0x24ba81));_0x5bea3e(_0x24ba81);})[_0x8b48('0x15')](function(_0xf0c4aa){logger[_0x8b48('0x10')](_0x8b48('0x16'),_0xf0c4aa[_0x8b48('0x12')],_0x150b80);_0xebe4c1(_0x4bc7e4['error'](0x1f4,_0xf0c4aa[_0x8b48('0x12')]));});});};exports[_0x8b48('0x1b')]=function(_0x34c4cf){var _0xbfe736=this;return new Promise(function(_0x7fdd81,_0x3b579c){return db['FaxMessage'][_0x8b48('0x1c')](_0x34c4cf['body'],{'raw':_0x34c4cf[_0x8b48('0x19')]?_0x34c4cf['options'][_0x8b48('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34c4cf[_0x8b48('0x19')]?_0x34c4cf[_0x8b48('0x19')]['where']||null:null,'attributes':_0x34c4cf[_0x8b48('0x19')]?_0x34c4cf[_0x8b48('0x19')][_0x8b48('0x1d')]||null:null,'limit':_0x34c4cf['options']?_0x34c4cf[_0x8b48('0x19')][_0x8b48('0x1e')]||null:null})['then'](function(_0x5e8136){logger[_0x8b48('0x13')](_0x8b48('0x1b'),_0x34c4cf);logger[_0x8b48('0xd')]('UpdateFaxMessage',_0x34c4cf,JSON[_0x8b48('0xf')](_0x5e8136));_0x7fdd81(_0x5e8136);})[_0x8b48('0x15')](function(_0x128100){logger[_0x8b48('0x10')](_0x8b48('0x1b'),_0x128100[_0x8b48('0x12')],_0x34c4cf);_0x3b579c(_0xbfe736[_0x8b48('0x10')](0x1f4,_0x128100[_0x8b48('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 3ca9f77..efdce6a 100644 --- a/server/api/faxMessage/faxMessage.socket.js +++ b/server/api/faxMessage/faxMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var FaxMessageEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){FaxMessageEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index b05b16d..629687c 100644 --- a/server/api/faxMessage/index.js +++ b/server/api/faxMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3657=['isAuthenticated','/describe','/:id','/:id/download','download','tracked','fax','create','put','update','/:id/accept','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get'];(function(_0x1fdc35,_0x4b7ee7){var _0x95c907=function(_0x435857){while(--_0x435857){_0x1fdc35['push'](_0x1fdc35['shift']());}};_0x95c907(++_0x4b7ee7);}(_0x3657,0x183));var _0x7365=function(_0x2bcd1f,_0x4f1972){_0x2bcd1f=_0x2bcd1f-0x0;var _0x2381ca=_0x3657[_0x2bcd1f];return _0x2381ca;};'use strict';var multer=require(_0x7365('0x0'));var util=require(_0x7365('0x1'));var path=require(_0x7365('0x2'));var timeout=require('connect-timeout');var express=require(_0x7365('0x3'));var router=express[_0x7365('0x4')]();var auth=require(_0x7365('0x5'));var interaction=require(_0x7365('0x6'));var config=require('../../config/environment');var controller=require(_0x7365('0x7'));router[_0x7365('0x8')]('/',auth[_0x7365('0x9')](),controller['index']);router[_0x7365('0x8')](_0x7365('0xa'),auth[_0x7365('0x9')](),controller['describe']);router[_0x7365('0x8')](_0x7365('0xb'),auth[_0x7365('0x9')](),controller['show']);router[_0x7365('0x8')](_0x7365('0xc'),auth['isAuthenticated'](),controller[_0x7365('0xd')]);router['post']('/',auth[_0x7365('0x9')](),interaction[_0x7365('0xe')](_0x7365('0xf'),'faxmessage:create'),controller[_0x7365('0x10')]);router[_0x7365('0x11')]('/:id',auth[_0x7365('0x9')](),controller[_0x7365('0x12')]);router[_0x7365('0x11')](_0x7365('0x13'),auth[_0x7365('0x9')](),controller['accept']);router[_0x7365('0x11')]('/:id/reject',auth[_0x7365('0x9')](),controller['reject']);router['delete'](_0x7365('0xb'),auth[_0x7365('0x9')](),controller[_0x7365('0x14')]);module[_0x7365('0x15')]=router; \ No newline at end of file +var _0xa2cf=['./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','tracked','fax','faxmessage:create','create','put','update','accept','/:id/reject','delete','destroy','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa2cf,0xbb));var _0xfa2c=function(_0x5bb4b1,_0x33ee09){_0x5bb4b1=_0x5bb4b1-0x0;var _0x95f648=_0xa2cf[_0x5bb4b1];return _0x95f648;};'use strict';var multer=require('multer');var util=require(_0xfa2c('0x0'));var path=require(_0xfa2c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xfa2c('0x2'));var interaction=require(_0xfa2c('0x3'));var config=require(_0xfa2c('0x4'));var controller=require(_0xfa2c('0x5'));router[_0xfa2c('0x6')]('/',auth[_0xfa2c('0x7')](),controller[_0xfa2c('0x8')]);router[_0xfa2c('0x6')](_0xfa2c('0x9'),auth[_0xfa2c('0x7')](),controller[_0xfa2c('0xa')]);router[_0xfa2c('0x6')](_0xfa2c('0xb'),auth[_0xfa2c('0x7')](),controller[_0xfa2c('0xc')]);router[_0xfa2c('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0xfa2c('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xfa2c('0xe')](_0xfa2c('0xf'),_0xfa2c('0x10')),controller[_0xfa2c('0x11')]);router[_0xfa2c('0x12')](_0xfa2c('0xb'),auth[_0xfa2c('0x7')](),controller[_0xfa2c('0x13')]);router[_0xfa2c('0x12')]('/:id/accept',auth[_0xfa2c('0x7')](),controller[_0xfa2c('0x14')]);router[_0xfa2c('0x12')](_0xfa2c('0x15'),auth[_0xfa2c('0x7')](),controller['reject']);router[_0xfa2c('0x16')](_0xfa2c('0xb'),auth[_0xfa2c('0x7')](),controller[_0xfa2c('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 0a0ac8d..c165713 100644 --- a/server/api/faxQueue/faxQueue.attributes.js +++ b/server/api/faxQueue/faxQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf1c=['ENUM','sequelize','exports','name','STRING','INTEGER'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xcf1c,0x18d));var _0xccf1=function(_0x48564d,_0x2c1c8c){_0x48564d=_0x48564d-0x0;var _0x2ad779=_0xcf1c[_0x48564d];return _0x2ad779;};'use strict';var Sequelize=require(_0xccf1('0x0'));module[_0xccf1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xccf1('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xccf1('0x3')]},'timeout':{'type':Sequelize[_0xccf1('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xccf1('0x5')]('rrmemory','beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xccf1('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6931=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x4662fc,_0x2787f7){var _0x2026cb=function(_0xd60ea5){while(--_0xd60ea5){_0x4662fc['push'](_0x4662fc['shift']());}};_0x2026cb(++_0x2787f7);}(_0x6931,0x8c));var _0x1693=function(_0xce479f,_0x2178d2){_0xce479f=_0xce479f-0x0;var _0x270fc3=_0x6931[_0xce479f];return _0x270fc3;};'use strict';var Sequelize=require(_0x1693('0x0'));module[_0x1693('0x1')]={'name':{'type':Sequelize[_0x1693('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1693('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1693('0x4')](_0x1693('0x5'),_0x1693('0x6'),_0x1693('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x1693('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 938f583..5dc1d20 100644 --- a/server/api/faxQueue/faxQueue.controller.js +++ b/server/api/faxQueue/faxQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2868=['../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','error','stack','name','send','index','FaxQueue','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','count','includeAll','findAll','catch','show','params','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','UserFaxQueue','filter','merge','User','UserId','agent','faxPause','createdAt','rows','%s/%s','SIP','updatedAt','getTeams','findOne','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','ids','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','TeamId','includes','all','union','value','removeTeams','isEmpty','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','removeAgents','isArray','getAgents','html-pdf','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x5ee68f,_0x23b1d8){var _0x15ca51=function(_0x29e384){while(--_0x29e384){_0x5ee68f['push'](_0x5ee68f['shift']());}};_0x15ca51(++_0x23b1d8);}(_0x2868,0x191));var _0x8286=function(_0x218fae,_0x3a4a74){_0x218fae=_0x218fae-0x0;var _0x3926a8=_0x2868[_0x218fae];return _0x3926a8;};'use strict';var pdf=require(_0x8286('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8286('0x1'));var zipdir=require(_0x8286('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8286('0x3'));var moment=require('moment');var BPromise=require(_0x8286('0x4'));var Mustache=require('mustache');var util=require(_0x8286('0x5'));var path=require(_0x8286('0x6'));var sox=require('sox');var csv=require(_0x8286('0x7'));var ejs=require(_0x8286('0x8'));var fs=require('fs');var _=require(_0x8286('0x9'));var squel=require(_0x8286('0xa'));var crypto=require('crypto');var jsforce=require(_0x8286('0xb'));var deskjs=require(_0x8286('0xc'));var toCsv=require(_0x8286('0x7'));var querystring=require(_0x8286('0xd'));var Papa=require(_0x8286('0xe'));var Redis=require(_0x8286('0xf'));var authService=require(_0x8286('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8286('0x11'));var hardwareService=require(_0x8286('0x12'));var logger=require(_0x8286('0x13'))(_0x8286('0x14'));var utils=require(_0x8286('0x15'));var config=require(_0x8286('0x16'));var db=require(_0x8286('0x17'))['db'];config[_0x8286('0x18')]=_[_0x8286('0x19')](config['redis'],{'host':_0x8286('0x1a'),'port':0x18eb});var socket=require(_0x8286('0x1b'))(new Redis(config[_0x8286('0x18')]));require(_0x8286('0x1c'))[_0x8286('0x1d')](socket);function respondWithStatusCode(_0x43a3db,_0x5207a2){_0x5207a2=_0x5207a2||0xcc;return function(_0x59d20b){if(_0x59d20b){return _0x43a3db[_0x8286('0x1e')](_0x5207a2);}return _0x43a3db[_0x8286('0x1f')](_0x5207a2)[_0x8286('0x20')]();};}function respondWithResult(_0x516038,_0x543f45){_0x543f45=_0x543f45||0xc8;return function(_0x37980f){if(_0x37980f){return _0x516038[_0x8286('0x1f')](_0x543f45)[_0x8286('0x21')](_0x37980f);}};}function respondWithFilteredResult(_0x46b682,_0x1ab3c9){return function(_0xca34de){if(_0xca34de){var _0x20296a=_0xca34de['count'],_0x465523=_0x1ab3c9[_0x8286('0x22')],_0x38d483=_0x1ab3c9[_0x8286('0x22')]+_0x1ab3c9[_0x8286('0x23')],_0x2b53c0;if(_0x38d483>=_0x20296a){_0x38d483=_0x20296a;_0x2b53c0=0xc8;}else{_0x2b53c0=0xce;}_0x46b682[_0x8286('0x1f')](_0x2b53c0);return _0x46b682[_0x8286('0x24')](_0x8286('0x25'),_0x465523+'-'+_0x38d483+'/'+_0x20296a)[_0x8286('0x21')](_0xca34de);}return null;};}function patchUpdates(_0x18b5cc){return function(_0x1b524f){try{jsonpatch[_0x8286('0x26')](_0x1b524f,_0x18b5cc,!![]);}catch(_0x4338bc){return BPromise[_0x8286('0x27')](_0x4338bc);}return _0x1b524f[_0x8286('0x28')]();};}function saveUpdates(_0x4d738b,_0x2660e8){return function(_0xe879c2){if(_0xe879c2){return _0xe879c2[_0x8286('0x29')](_0x4d738b)[_0x8286('0x2a')](function(_0x1522d4){return _0x1522d4;});}return null;};}function removeEntity(_0x184fb3,_0x2f1e93){return function(_0xdc7cc7){if(_0xdc7cc7){return _0xdc7cc7[_0x8286('0x2b')]()[_0x8286('0x2a')](function(){var _0x171afc=_0xdc7cc7[_0x8286('0x2c')]({'plain':!![]});var _0x39dadd=_0x8286('0x2d');return db['UserProfileResource'][_0x8286('0x2b')]({'where':{'type':_0x39dadd,'resourceId':_0x171afc['id']}})[_0x8286('0x2a')](function(){return _0xdc7cc7;});})[_0x8286('0x2a')](function(){_0x184fb3[_0x8286('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x505860,_0x702889){return function(_0x1c616c){if(!_0x1c616c){_0x505860[_0x8286('0x1e')](0x194);}return _0x1c616c;};}function handleError(_0x4e5088,_0x2dbe4b){_0x2dbe4b=_0x2dbe4b||0x1f4;return function(_0x4ee1d9){logger[_0x8286('0x2e')](_0x4ee1d9[_0x8286('0x2f')]);if(_0x4ee1d9[_0x8286('0x30')]){delete _0x4ee1d9[_0x8286('0x30')];}_0x4e5088['status'](_0x2dbe4b)[_0x8286('0x31')](_0x4ee1d9);};}exports[_0x8286('0x32')]=function(_0x26ebf9,_0x1cce3f){var _0x4bd840={},_0x2b4ff1={},_0x5454b8={'count':0x0,'rows':[]};var _0x5a84a4=_['map'](db[_0x8286('0x33')][_0x8286('0x34')],function(_0x3a98b9){return{'name':_0x3a98b9[_0x8286('0x35')],'type':_0x3a98b9[_0x8286('0x36')]['key']};});_0x2b4ff1[_0x8286('0x37')]=_[_0x8286('0x38')](_0x5a84a4,_0x8286('0x30'));_0x2b4ff1['query']=_[_0x8286('0x39')](_0x26ebf9[_0x8286('0x3a')]);_0x2b4ff1[_0x8286('0x3b')]=_['intersection'](_0x2b4ff1['model'],_0x2b4ff1[_0x8286('0x3a')]);_0x4bd840[_0x8286('0x3c')]=_[_0x8286('0x3d')](_0x2b4ff1[_0x8286('0x37')],qs[_0x8286('0x3e')](_0x26ebf9[_0x8286('0x3a')][_0x8286('0x3e')]));_0x4bd840[_0x8286('0x3c')]=_0x4bd840[_0x8286('0x3c')][_0x8286('0x3f')]?_0x4bd840[_0x8286('0x3c')]:_0x2b4ff1[_0x8286('0x37')];if(!_0x26ebf9['query'][_0x8286('0x40')](_0x8286('0x41'))){_0x4bd840[_0x8286('0x23')]=qs[_0x8286('0x23')](_0x26ebf9[_0x8286('0x3a')][_0x8286('0x23')]);_0x4bd840[_0x8286('0x22')]=qs[_0x8286('0x22')](_0x26ebf9[_0x8286('0x3a')][_0x8286('0x22')]);}_0x4bd840[_0x8286('0x42')]=qs['sort'](_0x26ebf9[_0x8286('0x3a')][_0x8286('0x43')]);_0x4bd840[_0x8286('0x44')]=qs[_0x8286('0x3b')](_[_0x8286('0x45')](_0x26ebf9[_0x8286('0x3a')],_0x2b4ff1['filters']));if(_0x26ebf9[_0x8286('0x3a')]['filter']){_0x4bd840[_0x8286('0x44')]=_['merge'](_0x4bd840['where'],{'$or':_['map'](_0x5a84a4,function(_0x5bf230){if(_0x5bf230[_0x8286('0x36')]!==_0x8286('0x46')){var _0x59cfd0={};_0x59cfd0[_0x5bf230[_0x8286('0x30')]]={'$like':'%'+_0x26ebf9[_0x8286('0x3a')]['filter']+'%'};return _0x59cfd0;}})});}_0x4bd840=_['merge']({},_0x4bd840,_0x26ebf9[_0x8286('0x47')]);var _0x2fea16={'where':_0x4bd840[_0x8286('0x44')]};return db['FaxQueue'][_0x8286('0x48')](_0x2fea16)[_0x8286('0x2a')](function(_0x45cbaa){_0x5454b8['count']=_0x45cbaa;if(_0x26ebf9[_0x8286('0x3a')][_0x8286('0x49')]){_0x4bd840['include']=[{'all':!![]}];}return db[_0x8286('0x33')][_0x8286('0x4a')](_0x4bd840);})[_0x8286('0x2a')](function(_0x457448){_0x5454b8['rows']=_0x457448;return _0x5454b8;})[_0x8286('0x2a')](respondWithFilteredResult(_0x1cce3f,_0x4bd840))[_0x8286('0x4b')](handleError(_0x1cce3f,null));};exports[_0x8286('0x4c')]=function(_0x27625d,_0x48e367){var _0x189c72={'raw':!![],'where':{'id':_0x27625d[_0x8286('0x4d')]['id']}},_0xbbbab1={};_0xbbbab1[_0x8286('0x37')]=_[_0x8286('0x39')](db[_0x8286('0x33')][_0x8286('0x34')]);_0xbbbab1['query']=_[_0x8286('0x39')](_0x27625d[_0x8286('0x3a')]);_0xbbbab1[_0x8286('0x3b')]=_[_0x8286('0x3d')](_0xbbbab1[_0x8286('0x37')],_0xbbbab1[_0x8286('0x3a')]);_0x189c72['attributes']=_[_0x8286('0x3d')](_0xbbbab1['model'],qs[_0x8286('0x3e')](_0x27625d[_0x8286('0x3a')]['fields']));_0x189c72['attributes']=_0x189c72[_0x8286('0x3c')][_0x8286('0x3f')]?_0x189c72['attributes']:_0xbbbab1['model'];if(_0x27625d[_0x8286('0x3a')]['includeAll']){_0x189c72[_0x8286('0x4e')]=[{'all':!![]}];}_0x189c72=_['merge']({},_0x189c72,_0x27625d[_0x8286('0x47')]);return db[_0x8286('0x33')]['find'](_0x189c72)[_0x8286('0x2a')](handleEntityNotFound(_0x48e367,null))['then'](respondWithResult(_0x48e367,null))[_0x8286('0x4b')](handleError(_0x48e367,null));};exports[_0x8286('0x4f')]=function(_0x3470f4,_0x315042){return db[_0x8286('0x33')][_0x8286('0x4f')](_0x3470f4['body'],{})[_0x8286('0x2a')](function(_0x2f42ca){var _0x1c2da2=_0x3470f4['user'][_0x8286('0x2c')]({'plain':!![]});if(!_0x1c2da2)throw new Error(_0x8286('0x50'));if(_0x1c2da2[_0x8286('0x51')]===_0x8286('0x52')){var _0x1c9925=_0x2f42ca[_0x8286('0x2c')]({'plain':!![]});var _0x42be43=_0x8286('0x2d');return db[_0x8286('0x53')][_0x8286('0x54')]({'where':{'name':_0x42be43,'userProfileId':_0x1c2da2[_0x8286('0x55')]},'raw':!![]})[_0x8286('0x2a')](function(_0x33fb51){if(_0x33fb51&&_0x33fb51['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1c9925['name'],'resourceId':_0x1c9925['id'],'type':_0x33fb51[_0x8286('0x30')],'sectionId':_0x33fb51['id']},{})[_0x8286('0x2a')](function(){return _0x2f42ca;});}else{return _0x2f42ca;}})['catch'](function(_0x45a42e){logger[_0x8286('0x2e')](_0x8286('0x56'),_0x45a42e);throw _0x45a42e;});}return _0x2f42ca;})[_0x8286('0x2a')](respondWithResult(_0x315042,0xc9))['catch'](handleError(_0x315042,null));};exports[_0x8286('0x29')]=function(_0x286f37,_0x4104dd){if(_0x286f37['body']['id']){delete _0x286f37[_0x8286('0x57')]['id'];}return db[_0x8286('0x33')]['find']({'where':{'id':_0x286f37[_0x8286('0x4d')]['id']}})[_0x8286('0x2a')](handleEntityNotFound(_0x4104dd,null))['then'](saveUpdates(_0x286f37['body'],null))[_0x8286('0x2a')](respondWithResult(_0x4104dd,null))[_0x8286('0x4b')](handleError(_0x4104dd,null));};exports[_0x8286('0x2b')]=function(_0x136e25,_0x21868c){return db[_0x8286('0x33')][_0x8286('0x54')]({'where':{'id':_0x136e25[_0x8286('0x4d')]['id']}})[_0x8286('0x2a')](handleEntityNotFound(_0x21868c,null))[_0x8286('0x2a')](removeEntity(_0x21868c,null))['catch'](handleError(_0x21868c,null));};exports['describe']=function(_0x2c62e3,_0x1921dd){return db['FaxQueue']['describe']()[_0x8286('0x2a')](respondWithResult(_0x1921dd,null))[_0x8286('0x4b')](handleError(_0x1921dd,null));};exports['getMembers']=function(_0x214d3e,_0x348dfb,_0x351d92){var _0x1781cc={'raw':!![],'where':{}},_0x253752={},_0x1f30eb;return db['FaxQueue']['findOne']({'where':{'id':_0x214d3e[_0x8286('0x4d')]['id']}})[_0x8286('0x2a')](handleEntityNotFound(_0x348dfb,null))['then'](function(_0x1f1209){if(_0x1f1209){_0x1f30eb=_0x1f1209[_0x8286('0x2c')]({'plain':!![]});_0x253752[_0x8286('0x37')]=_[_0x8286('0x39')](db[_0x8286('0x58')][_0x8286('0x34')]);_0x253752[_0x8286('0x3a')]=_[_0x8286('0x39')](_0x214d3e[_0x8286('0x3a')]);_0x253752['filters']=_[_0x8286('0x3d')](_0x253752['model'],_0x253752[_0x8286('0x3a')]);_0x1781cc['attributes']=_[_0x8286('0x3d')](_0x253752[_0x8286('0x37')],qs[_0x8286('0x3e')](_0x214d3e['query'][_0x8286('0x3e')]));_0x1781cc[_0x8286('0x3c')]=_0x1781cc[_0x8286('0x3c')]['length']?_0x1781cc[_0x8286('0x3c')]:_0x253752[_0x8286('0x37')];if(!_0x214d3e[_0x8286('0x3a')][_0x8286('0x40')]('nolimit')){_0x1781cc[_0x8286('0x23')]=qs[_0x8286('0x23')](_0x214d3e[_0x8286('0x3a')][_0x8286('0x23')]);_0x1781cc[_0x8286('0x22')]=qs[_0x8286('0x22')](_0x214d3e[_0x8286('0x3a')]['offset']);}_0x1781cc[_0x8286('0x42')]=qs[_0x8286('0x43')](_0x214d3e['query']['sort']);_0x1781cc[_0x8286('0x44')]=qs[_0x8286('0x3b')](_['pick'](_0x214d3e[_0x8286('0x3a')],_0x253752['filters']));_0x1781cc['where']['FaxQueueId']=_0x1f1209['id'];if(_0x214d3e[_0x8286('0x3a')][_0x8286('0x59')]){_0x1781cc[_0x8286('0x44')]=_[_0x8286('0x5a')](_0x1781cc[_0x8286('0x44')],{'$or':_[_0x8286('0x38')](_0x1781cc[_0x8286('0x3c')],function(_0x163112){var _0x133bf0={};_0x133bf0[_0x163112]={'$like':'%'+_0x214d3e[_0x8286('0x3a')][_0x8286('0x59')]+'%'};return _0x133bf0;})});}_0x1781cc=_[_0x8286('0x5a')]({},_0x1781cc,_0x214d3e[_0x8286('0x47')]);return db[_0x8286('0x58')][_0x8286('0x4a')](_0x1781cc);}})[_0x8286('0x2a')](function(_0x17953d){if(_0x17953d){return db[_0x8286('0x5b')]['findAndCountAll']({'where':{'id':_[_0x8286('0x38')](_0x17953d,_0x8286('0x5c')),'role':_0x8286('0x5d')},'attributes':['id',_0x8286('0x30'),_0x8286('0x5e'),'updatedAt',_0x8286('0x5f')]});}})['then'](function(_0x12c55a){if(_0x12c55a){return{'count':_0x12c55a[_0x8286('0x48')],'rows':_[_0x8286('0x38')](_0x12c55a[_0x8286('0x60')],function(_0x3ff47e){return{'membername':_0x3ff47e[_0x8286('0x30')],'UserId':_0x3ff47e['id'],'queue_name':_0x1f30eb[_0x8286('0x30')],'FaxQueueId':_0x1f30eb['id'],'interface':util['format'](_0x8286('0x61'),_0x8286('0x62'),_0x3ff47e[_0x8286('0x30')]),'penalty':0x0,'paused':_0x3ff47e[_0x8286('0x5e')],'createdAt':_0x3ff47e[_0x8286('0x5f')],'updatedAt':_0x3ff47e[_0x8286('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8286('0x2a')](respondWithFilteredResult(_0x348dfb,_0x1781cc))[_0x8286('0x4b')](handleError(_0x348dfb,null));};exports[_0x8286('0x64')]=function(_0x536e52,_0x164a33,_0x3f01eb){var _0x15991a={};var _0x7d5ce3={};var _0x1f55db;var _0x45e58d;return db[_0x8286('0x33')][_0x8286('0x65')]({'where':{'id':_0x536e52[_0x8286('0x4d')]['id']}})[_0x8286('0x2a')](handleEntityNotFound(_0x164a33,null))[_0x8286('0x2a')](function(_0x10d63d){if(_0x10d63d){_0x1f55db=_0x10d63d;_0x7d5ce3[_0x8286('0x37')]=_[_0x8286('0x39')](db[_0x8286('0x66')][_0x8286('0x34')]);_0x7d5ce3['query']=_[_0x8286('0x39')](_0x536e52[_0x8286('0x3a')]);_0x7d5ce3[_0x8286('0x3b')]=_['intersection'](_0x7d5ce3[_0x8286('0x37')],_0x7d5ce3['query']);_0x15991a[_0x8286('0x3c')]=_[_0x8286('0x3d')](_0x7d5ce3[_0x8286('0x37')],qs[_0x8286('0x3e')](_0x536e52[_0x8286('0x3a')][_0x8286('0x3e')]));_0x15991a[_0x8286('0x3c')]=_0x15991a[_0x8286('0x3c')][_0x8286('0x3f')]?_0x15991a[_0x8286('0x3c')]:_0x7d5ce3[_0x8286('0x37')];_0x15991a[_0x8286('0x42')]=qs[_0x8286('0x43')](_0x536e52[_0x8286('0x3a')][_0x8286('0x43')]);_0x15991a[_0x8286('0x44')]=qs[_0x8286('0x3b')](_[_0x8286('0x45')](_0x536e52[_0x8286('0x3a')],_0x7d5ce3[_0x8286('0x3b')]));if(_0x536e52[_0x8286('0x3a')][_0x8286('0x59')]){_0x15991a[_0x8286('0x44')]=_['merge'](_0x15991a[_0x8286('0x44')],{'$or':_[_0x8286('0x38')](_0x15991a[_0x8286('0x3c')],function(_0x15eff6){var _0x2715ee={};_0x2715ee[_0x15eff6]={'$like':'%'+_0x536e52[_0x8286('0x3a')][_0x8286('0x59')]+'%'};return _0x2715ee;})});}_0x15991a=_[_0x8286('0x5a')]({},_0x15991a,_0x536e52[_0x8286('0x47')]);return _0x1f55db['getTeams'](_0x15991a);}})[_0x8286('0x2a')](function(_0x557d52){if(_0x557d52){_0x45e58d=_0x557d52[_0x8286('0x3f')];if(!_0x536e52[_0x8286('0x3a')][_0x8286('0x40')](_0x8286('0x41'))){_0x15991a['limit']=qs[_0x8286('0x23')](_0x536e52[_0x8286('0x3a')][_0x8286('0x23')]);_0x15991a[_0x8286('0x22')]=qs[_0x8286('0x22')](_0x536e52[_0x8286('0x3a')][_0x8286('0x22')]);}return _0x1f55db[_0x8286('0x64')](_0x15991a);}})[_0x8286('0x2a')](function(_0x310db4){if(_0x310db4){return _0x310db4?{'count':_0x45e58d,'rows':_0x310db4}:null;}})[_0x8286('0x2a')](respondWithResult(_0x164a33,null))[_0x8286('0x4b')](handleError(_0x164a33,null));};exports['addTeams']=function(_0x278304,_0xc1a0b0,_0x21f329){var _0x736745=_0x278304[_0x8286('0x57')]['ids'];return db[_0x8286('0x66')][_0x8286('0x4a')]({'where':{'id':_0x736745},'attributes':['id'],'include':[{'model':db[_0x8286('0x5b')],'as':_0x8286('0x67'),'attributes':['id',_0x8286('0x30'),_0x8286('0x68'),_0x8286('0x69'),_0x8286('0x6a')],'raw':!![]}]})[_0x8286('0x2a')](function(_0x1266c2){if(_0x1266c2){var _0x53bffa=_[_0x8286('0x6b')](_0x1266c2,function(_0x22edc1){var _0x1e5e0e=_0x22edc1['get']({'plain':!![]});return _0x1e5e0e[_0x8286('0x67')];});return db[_0x8286('0x33')][_0x8286('0x54')]({'where':{'id':_0x278304[_0x8286('0x4d')]['id']}})['then'](function(_0x42c23e){return db[_0x8286('0x6c')][_0x8286('0x6d')](function(_0x131cc2){return _0x42c23e['addTeams'](_0x736745,{'transaction':_0x131cc2})['then'](function(){return BPromise['each'](_0x53bffa,function(_0x5cef08){return db[_0x8286('0x58')][_0x8286('0x6e')]({'where':{'UserId':_0x5cef08['id'],'FaxQueueId':_0x278304[_0x8286('0x4d')]['id']},'transaction':_0x131cc2});});})[_0x8286('0x2a')](function(){_0x53bffa[_0x8286('0x6f')](function(_0x3e9c61){socket[_0x8286('0x70')]('userFaxQueue:save',{'UserId':_0x3e9c61['id'],'FaxQueueId':_0x42c23e['id']});});});});});}})[_0x8286('0x2a')](respondWithStatusCode(_0xc1a0b0,null))['catch'](handleError(_0xc1a0b0,null));};exports['removeTeams']=function(_0x148980,_0x4dec32,_0x5af371){return db[_0x8286('0x66')][_0x8286('0x4a')]({'where':{'id':_0x148980[_0x8286('0x3a')][_0x8286('0x71')]},'attributes':['id'],'include':[{'model':db[_0x8286('0x5b')],'as':_0x8286('0x67'),'attributes':['id'],'raw':!![]}]})[_0x8286('0x2a')](handleEntityNotFound(_0x4dec32,null))[_0x8286('0x2a')](function(_0x4594ef){var _0x285819=_['map'](_0x4594ef,'id');var _0x9e9a01=[];var _0x2f4431=[];var _0x2e8665=squel[_0x8286('0x72')]();_0x2e8665['field'](_0x8286('0x73'))[_0x8286('0x74')](_0x8286('0x75'),'tq')[_0x8286('0x76')](_0x8286('0x77'),'ut',_0x8286('0x78'))['where'](_0x8286('0x79'),_0x148980[_0x8286('0x4d')]['id']);for(var _0x192daf=0x0;_0x192daf<_0x4594ef['length'];_0x192daf+=0x1){let _0x5326e2=_0x4594ef[_0x192daf];for(var _0x3e257e=0x0;_0x3e257e<_0x5326e2[_0x8286('0x67')]['length'];_0x3e257e+=0x1){let _0x146fb5=_0x5326e2[_0x8286('0x67')][_0x3e257e];var _0x208e1a=_0x2e8665[_0x8286('0x7a')]();_0x208e1a[_0x8286('0x44')]('ut.UserId\x20=\x20?',_0x146fb5['id']);_0x2f4431[_0x8286('0x7b')](db['sequelize'][_0x8286('0x3a')](_0x208e1a['toString'](),{'type':db[_0x8286('0x6c')][_0x8286('0x7c')][_0x8286('0x7d')]})[_0x8286('0x2a')](function(_0x209139){if(_0x209139['length']===0x1){return _0x146fb5['id'];}else{var _0x1be045=_['every'](_[_0x8286('0x38')](_0x209139,_0x8286('0x7e')),function(_0x5741e8){return _[_0x8286('0x7f')](_0x285819,_0x5741e8);});if(_0x1be045){return _0x146fb5['id'];}}}));}}return BPromise[_0x8286('0x80')](_0x2f4431)[_0x8286('0x2a')](function(_0x1aa11f){_0x9e9a01=_(_0x9e9a01)[_0x8286('0x81')](_0x1aa11f)['compact']()[_0x8286('0x82')]();return db['FaxQueue']['find']({'where':{'id':_0x148980[_0x8286('0x4d')]['id']}})['then'](function(_0x3cda47){return db[_0x8286('0x6c')][_0x8286('0x6d')](function(_0x3650d2){return _0x3cda47[_0x8286('0x83')](_0x148980[_0x8286('0x3a')][_0x8286('0x71')],{'transaction':_0x3650d2})[_0x8286('0x2a')](function(){if(!_[_0x8286('0x84')](_0x9e9a01)){return _0x3cda47['removeAgents'](_0x9e9a01,{'transaction':_0x3650d2});}})[_0x8286('0x2a')](function(){_0x9e9a01['forEach'](function(_0x105c57){socket[_0x8286('0x70')](_0x8286('0x85'),{'UserId':_0x105c57,'FaxQueueId':_0x3cda47['id']});});});});});});})[_0x8286('0x2a')](respondWithStatusCode(_0x4dec32,null))[_0x8286('0x4b')](handleError(_0x4dec32,null));};exports[_0x8286('0x86')]=function(_0xa8c829,_0x59ce4c,_0x35d93c){return db[_0x8286('0x33')][_0x8286('0x54')]({'where':{'id':_0xa8c829['params']['id']}})[_0x8286('0x2a')](handleEntityNotFound(_0x59ce4c,null))['then'](function(_0x5827bc){if(_0x5827bc){return _0x5827bc[_0x8286('0x86')](_0xa8c829['body'][_0x8286('0x71')],_[_0x8286('0x87')](_0xa8c829[_0x8286('0x57')],['ids','id'])||{})[_0x8286('0x88')](function(_0x3f1294){for(var _0x2144de=0x0;_0x2144de<_0xa8c829[_0x8286('0x57')][_0x8286('0x71')][_0x8286('0x3f')];_0x2144de+=0x1){socket[_0x8286('0x70')](_0x8286('0x89'),{'UserId':_0xa8c829[_0x8286('0x57')]['ids'][_0x2144de],'FaxQueueId':_0xa8c829[_0x8286('0x4d')]['id']});}return _0x3f1294;});}})[_0x8286('0x2a')](respondWithResult(_0x59ce4c,null))[_0x8286('0x4b')](handleError(_0x59ce4c,null));};exports['removeAgents']=function(_0x556d64,_0x5b5b2a,_0x1ec39e){return db[_0x8286('0x33')][_0x8286('0x54')]({'where':{'id':_0x556d64['params']['id']}})[_0x8286('0x2a')](handleEntityNotFound(_0x5b5b2a,null))[_0x8286('0x2a')](function(_0x2c935f){if(_0x2c935f){return _0x2c935f[_0x8286('0x8a')](_0x556d64[_0x8286('0x3a')][_0x8286('0x71')])[_0x8286('0x2a')](function(){if(_[_0x8286('0x8b')](_0x556d64['query']['ids'])){for(var _0x4fba0d=0x0;_0x4fba0d<_0x556d64['query']['ids']['length'];_0x4fba0d+=0x1){socket[_0x8286('0x70')](_0x8286('0x85'),{'UserId':Number(_0x556d64[_0x8286('0x3a')]['ids'][_0x4fba0d]),'FaxQueueId':Number(_0x556d64['params']['id'])});}}else{socket[_0x8286('0x70')](_0x8286('0x85'),{'UserId':Number(_0x556d64['query'][_0x8286('0x71')]),'FaxQueueId':Number(_0x556d64[_0x8286('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x5b5b2a,null))[_0x8286('0x4b')](handleError(_0x5b5b2a,null));};exports[_0x8286('0x8c')]=function(_0x49d071,_0x39ef30,_0x1989bb){var _0x50865e={};var _0x5274b0={};var _0x47dbd0;var _0x23b518;return db[_0x8286('0x33')][_0x8286('0x65')]({'where':{'id':_0x49d071[_0x8286('0x4d')]['id']}})[_0x8286('0x2a')](handleEntityNotFound(_0x39ef30,null))[_0x8286('0x2a')](function(_0x5740cc){if(_0x5740cc){_0x47dbd0=_0x5740cc;_0x5274b0[_0x8286('0x37')]=_['keys'](db[_0x8286('0x5b')][_0x8286('0x34')]);_0x5274b0['query']=_[_0x8286('0x39')](_0x49d071[_0x8286('0x3a')]);_0x5274b0[_0x8286('0x3b')]=_[_0x8286('0x3d')](_0x5274b0[_0x8286('0x37')],_0x5274b0[_0x8286('0x3a')]);_0x50865e[_0x8286('0x3c')]=_[_0x8286('0x3d')](_0x5274b0[_0x8286('0x37')],qs[_0x8286('0x3e')](_0x49d071['query']['fields']));_0x50865e['attributes']=_0x50865e[_0x8286('0x3c')][_0x8286('0x3f')]?_0x50865e['attributes']:_0x5274b0[_0x8286('0x37')];_0x50865e[_0x8286('0x42')]=qs['sort'](_0x49d071[_0x8286('0x3a')][_0x8286('0x43')]);_0x50865e[_0x8286('0x44')]=qs[_0x8286('0x3b')](_[_0x8286('0x45')](_0x49d071[_0x8286('0x3a')],_0x5274b0['filters']));if(_0x49d071[_0x8286('0x3a')]['filter']){_0x50865e[_0x8286('0x44')]=_[_0x8286('0x5a')](_0x50865e[_0x8286('0x44')],{'$or':_[_0x8286('0x38')](_0x50865e[_0x8286('0x3c')],function(_0x1c44f4){var _0x35c87c={};_0x35c87c[_0x1c44f4]={'$like':'%'+_0x49d071[_0x8286('0x3a')][_0x8286('0x59')]+'%'};return _0x35c87c;})});}_0x50865e=_[_0x8286('0x5a')]({},_0x50865e,_0x49d071[_0x8286('0x47')]);return _0x47dbd0[_0x8286('0x8c')](_0x50865e);}})[_0x8286('0x2a')](function(_0x593c7b){if(_0x593c7b){_0x23b518=_0x593c7b[_0x8286('0x3f')];if(!_0x49d071['query'][_0x8286('0x40')](_0x8286('0x41'))){_0x50865e[_0x8286('0x23')]=qs[_0x8286('0x23')](_0x49d071[_0x8286('0x3a')][_0x8286('0x23')]);_0x50865e[_0x8286('0x22')]=qs[_0x8286('0x22')](_0x49d071[_0x8286('0x3a')][_0x8286('0x22')]);}return _0x47dbd0['getAgents'](_0x50865e);}})['then'](function(_0x55f245){if(_0x55f245){return _0x55f245?{'count':_0x23b518,'rows':_0x55f245}:null;}})[_0x8286('0x2a')](respondWithResult(_0x39ef30,null))[_0x8286('0x4b')](handleError(_0x39ef30,null));}; \ No newline at end of file +var _0xfa4d=['getAgents','html-pdf','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','limit','order','sort','filter','merge','VIRTUAL','where','FaxQueue','includeAll','include','findAll','rows','catch','show','rawAttributes','fields','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','pick','FaxQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','SIP','faxPause','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','transaction','UserFaxQueue','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray'];(function(_0x3decfc,_0x2f7203){var _0x2e6a51=function(_0x348d4c){while(--_0x348d4c){_0x3decfc['push'](_0x3decfc['shift']());}};_0x2e6a51(++_0x2f7203);}(_0xfa4d,0x90));var _0xdfa4=function(_0x1b301a,_0x13bf14){_0x1b301a=_0x1b301a-0x0;var _0x43b138=_0xfa4d[_0x1b301a];return _0x43b138;};'use strict';var pdf=require(_0xdfa4('0x0'));var emlformat=require(_0xdfa4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdfa4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdfa4('0x3'));var Mustache=require(_0xdfa4('0x4'));var util=require(_0xdfa4('0x5'));var path=require(_0xdfa4('0x6'));var sox=require(_0xdfa4('0x7'));var csv=require(_0xdfa4('0x8'));var ejs=require(_0xdfa4('0x9'));var fs=require('fs');var _=require(_0xdfa4('0xa'));var squel=require(_0xdfa4('0xb'));var crypto=require(_0xdfa4('0xc'));var jsforce=require(_0xdfa4('0xd'));var deskjs=require(_0xdfa4('0xe'));var toCsv=require(_0xdfa4('0x8'));var querystring=require(_0xdfa4('0xf'));var Papa=require(_0xdfa4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdfa4('0x11'));var as=require(_0xdfa4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdfa4('0x13'))('api');var utils=require(_0xdfa4('0x14'));var config=require(_0xdfa4('0x15'));var db=require(_0xdfa4('0x16'))['db'];config[_0xdfa4('0x17')]=_[_0xdfa4('0x18')](config[_0xdfa4('0x17')],{'host':_0xdfa4('0x19'),'port':0x18eb});var socket=require(_0xdfa4('0x1a'))(new Redis(config[_0xdfa4('0x17')]));require(_0xdfa4('0x1b'))[_0xdfa4('0x1c')](socket);function respondWithStatusCode(_0x101063,_0x239bde){_0x239bde=_0x239bde||0xcc;return function(_0x58ed13){if(_0x58ed13){return _0x101063[_0xdfa4('0x1d')](_0x239bde);}return _0x101063[_0xdfa4('0x1e')](_0x239bde)[_0xdfa4('0x1f')]();};}function respondWithResult(_0x566c09,_0x1284de){_0x1284de=_0x1284de||0xc8;return function(_0x1163ed){if(_0x1163ed){return _0x566c09['status'](_0x1284de)[_0xdfa4('0x20')](_0x1163ed);}};}function respondWithFilteredResult(_0xad42a3,_0x2d7fe6){return function(_0x36717f){if(_0x36717f){var _0xed6924=_0x36717f[_0xdfa4('0x21')],_0x4d6fe0=_0x2d7fe6[_0xdfa4('0x22')],_0x5c2765=_0x2d7fe6['offset']+_0x2d7fe6['limit'],_0x280808;if(_0x5c2765>=_0xed6924){_0x5c2765=_0xed6924;_0x280808=0xc8;}else{_0x280808=0xce;}_0xad42a3[_0xdfa4('0x1e')](_0x280808);return _0xad42a3['set'](_0xdfa4('0x23'),_0x4d6fe0+'-'+_0x5c2765+'/'+_0xed6924)[_0xdfa4('0x20')](_0x36717f);}return null;};}function patchUpdates(_0x25701a){return function(_0x47187f){try{jsonpatch[_0xdfa4('0x24')](_0x47187f,_0x25701a,!![]);}catch(_0x2ca5e2){return BPromise[_0xdfa4('0x25')](_0x2ca5e2);}return _0x47187f[_0xdfa4('0x26')]();};}function saveUpdates(_0x486c77,_0x359ba2){return function(_0x204f64){if(_0x204f64){return _0x204f64['update'](_0x486c77)[_0xdfa4('0x27')](function(_0x405d50){return _0x405d50;});}return null;};}function removeEntity(_0x5ab8f6,_0x3c77bf){return function(_0x12c765){if(_0x12c765){return _0x12c765[_0xdfa4('0x28')]()['then'](function(){var _0x3d9bfc=_0x12c765[_0xdfa4('0x29')]({'plain':!![]});var _0x41a6e9='FaxQueues';return db[_0xdfa4('0x2a')][_0xdfa4('0x28')]({'where':{'type':_0x41a6e9,'resourceId':_0x3d9bfc['id']}})['then'](function(){return _0x12c765;});})[_0xdfa4('0x27')](function(){_0x5ab8f6[_0xdfa4('0x1e')](0xcc)[_0xdfa4('0x1f')]();});}};}function handleEntityNotFound(_0x633aa7,_0x442974){return function(_0x1fd295){if(!_0x1fd295){_0x633aa7[_0xdfa4('0x1d')](0x194);}return _0x1fd295;};}function handleError(_0xe2b998,_0x155a39){_0x155a39=_0x155a39||0x1f4;return function(_0x195ed2){logger[_0xdfa4('0x2b')](_0x195ed2[_0xdfa4('0x2c')]);if(_0x195ed2[_0xdfa4('0x2d')]){delete _0x195ed2[_0xdfa4('0x2d')];}_0xe2b998[_0xdfa4('0x1e')](_0x155a39)['send'](_0x195ed2);};}exports[_0xdfa4('0x2e')]=function(_0x400796,_0x267c79){var _0x18d983={},_0x26874a={},_0x1d67f8={'count':0x0,'rows':[]};var _0x2b3a61=_[_0xdfa4('0x2f')](db['FaxQueue']['rawAttributes'],function(_0x8e8c07){return{'name':_0x8e8c07[_0xdfa4('0x30')],'type':_0x8e8c07[_0xdfa4('0x31')][_0xdfa4('0x32')]};});_0x26874a[_0xdfa4('0x33')]=_[_0xdfa4('0x2f')](_0x2b3a61,_0xdfa4('0x2d'));_0x26874a[_0xdfa4('0x34')]=_[_0xdfa4('0x35')](_0x400796[_0xdfa4('0x34')]);_0x26874a[_0xdfa4('0x36')]=_['intersection'](_0x26874a[_0xdfa4('0x33')],_0x26874a['query']);_0x18d983[_0xdfa4('0x37')]=_[_0xdfa4('0x38')](_0x26874a[_0xdfa4('0x33')],qs['fields'](_0x400796[_0xdfa4('0x34')]['fields']));_0x18d983[_0xdfa4('0x37')]=_0x18d983[_0xdfa4('0x37')]['length']?_0x18d983[_0xdfa4('0x37')]:_0x26874a[_0xdfa4('0x33')];if(!_0x400796[_0xdfa4('0x34')][_0xdfa4('0x39')](_0xdfa4('0x3a'))){_0x18d983['limit']=qs[_0xdfa4('0x3b')](_0x400796[_0xdfa4('0x34')]['limit']);_0x18d983['offset']=qs[_0xdfa4('0x22')](_0x400796[_0xdfa4('0x34')][_0xdfa4('0x22')]);}_0x18d983[_0xdfa4('0x3c')]=qs[_0xdfa4('0x3d')](_0x400796[_0xdfa4('0x34')]['sort']);_0x18d983['where']=qs['filters'](_['pick'](_0x400796['query'],_0x26874a['filters']));if(_0x400796[_0xdfa4('0x34')][_0xdfa4('0x3e')]){_0x18d983['where']=_[_0xdfa4('0x3f')](_0x18d983['where'],{'$or':_[_0xdfa4('0x2f')](_0x2b3a61,function(_0x4f7c07){if(_0x4f7c07['type']!==_0xdfa4('0x40')){var _0x3dd60c={};_0x3dd60c[_0x4f7c07[_0xdfa4('0x2d')]]={'$like':'%'+_0x400796[_0xdfa4('0x34')][_0xdfa4('0x3e')]+'%'};return _0x3dd60c;}})});}_0x18d983=_[_0xdfa4('0x3f')]({},_0x18d983,_0x400796['options']);var _0x4ddd24={'where':_0x18d983[_0xdfa4('0x41')]};return db[_0xdfa4('0x42')][_0xdfa4('0x21')](_0x4ddd24)['then'](function(_0x831ad4){_0x1d67f8[_0xdfa4('0x21')]=_0x831ad4;if(_0x400796['query'][_0xdfa4('0x43')]){_0x18d983[_0xdfa4('0x44')]=[{'all':!![]}];}return db['FaxQueue'][_0xdfa4('0x45')](_0x18d983);})[_0xdfa4('0x27')](function(_0x52c160){_0x1d67f8[_0xdfa4('0x46')]=_0x52c160;return _0x1d67f8;})['then'](respondWithFilteredResult(_0x267c79,_0x18d983))[_0xdfa4('0x47')](handleError(_0x267c79,null));};exports[_0xdfa4('0x48')]=function(_0x5154e5,_0x450781){var _0x48a66c={'raw':!![],'where':{'id':_0x5154e5['params']['id']}},_0x1f0006={};_0x1f0006['model']=_[_0xdfa4('0x35')](db['FaxQueue'][_0xdfa4('0x49')]);_0x1f0006['query']=_[_0xdfa4('0x35')](_0x5154e5[_0xdfa4('0x34')]);_0x1f0006[_0xdfa4('0x36')]=_[_0xdfa4('0x38')](_0x1f0006['model'],_0x1f0006[_0xdfa4('0x34')]);_0x48a66c[_0xdfa4('0x37')]=_[_0xdfa4('0x38')](_0x1f0006[_0xdfa4('0x33')],qs[_0xdfa4('0x4a')](_0x5154e5[_0xdfa4('0x34')][_0xdfa4('0x4a')]));_0x48a66c[_0xdfa4('0x37')]=_0x48a66c['attributes'][_0xdfa4('0x4b')]?_0x48a66c['attributes']:_0x1f0006[_0xdfa4('0x33')];if(_0x5154e5['query'][_0xdfa4('0x43')]){_0x48a66c[_0xdfa4('0x44')]=[{'all':!![]}];}_0x48a66c=_[_0xdfa4('0x3f')]({},_0x48a66c,_0x5154e5[_0xdfa4('0x4c')]);return db[_0xdfa4('0x42')][_0xdfa4('0x4d')](_0x48a66c)[_0xdfa4('0x27')](handleEntityNotFound(_0x450781,null))[_0xdfa4('0x27')](respondWithResult(_0x450781,null))[_0xdfa4('0x47')](handleError(_0x450781,null));};exports[_0xdfa4('0x4e')]=function(_0xd06b1c,_0x25dd8c){return db['FaxQueue'][_0xdfa4('0x4e')](_0xd06b1c[_0xdfa4('0x4f')],{})[_0xdfa4('0x27')](function(_0x2b342c){var _0x4508da=_0xd06b1c[_0xdfa4('0x50')][_0xdfa4('0x29')]({'plain':!![]});if(!_0x4508da)throw new Error(_0xdfa4('0x51'));if(_0x4508da[_0xdfa4('0x52')]===_0xdfa4('0x50')){var _0x325777=_0x2b342c[_0xdfa4('0x29')]({'plain':!![]});var _0x1a351d=_0xdfa4('0x53');return db['UserProfileSection'][_0xdfa4('0x4d')]({'where':{'name':_0x1a351d,'userProfileId':_0x4508da[_0xdfa4('0x54')]},'raw':!![]})[_0xdfa4('0x27')](function(_0x5cd3d1){if(_0x5cd3d1&&_0x5cd3d1[_0xdfa4('0x55')]===0x0){return db[_0xdfa4('0x2a')][_0xdfa4('0x4e')]({'name':_0x325777['name'],'resourceId':_0x325777['id'],'type':_0x5cd3d1[_0xdfa4('0x2d')],'sectionId':_0x5cd3d1['id']},{})[_0xdfa4('0x27')](function(){return _0x2b342c;});}else{return _0x2b342c;}})[_0xdfa4('0x47')](function(_0x44993f){logger[_0xdfa4('0x2b')](_0xdfa4('0x56'),_0x44993f);throw _0x44993f;});}return _0x2b342c;})[_0xdfa4('0x27')](respondWithResult(_0x25dd8c,0xc9))[_0xdfa4('0x47')](handleError(_0x25dd8c,null));};exports[_0xdfa4('0x57')]=function(_0x117d8f,_0x18d36b){if(_0x117d8f['body']['id']){delete _0x117d8f['body']['id'];}return db[_0xdfa4('0x42')][_0xdfa4('0x4d')]({'where':{'id':_0x117d8f[_0xdfa4('0x58')]['id']}})[_0xdfa4('0x27')](handleEntityNotFound(_0x18d36b,null))[_0xdfa4('0x27')](saveUpdates(_0x117d8f[_0xdfa4('0x4f')],null))['then'](respondWithResult(_0x18d36b,null))[_0xdfa4('0x47')](handleError(_0x18d36b,null));};exports[_0xdfa4('0x28')]=function(_0x1740e2,_0x534f0c){return db[_0xdfa4('0x42')][_0xdfa4('0x4d')]({'where':{'id':_0x1740e2[_0xdfa4('0x58')]['id']}})[_0xdfa4('0x27')](handleEntityNotFound(_0x534f0c,null))[_0xdfa4('0x27')](removeEntity(_0x534f0c,null))[_0xdfa4('0x47')](handleError(_0x534f0c,null));};exports[_0xdfa4('0x59')]=function(_0x3a3a58,_0x1c1856){return db[_0xdfa4('0x42')]['describe']()[_0xdfa4('0x27')](respondWithResult(_0x1c1856,null))[_0xdfa4('0x47')](handleError(_0x1c1856,null));};exports[_0xdfa4('0x5a')]=function(_0x3004f3,_0x1c281d,_0x4f826f){var _0x5c2ee8={'raw':!![],'where':{}},_0x4afd9b={},_0x43ddb6;return db['FaxQueue'][_0xdfa4('0x5b')]({'where':{'id':_0x3004f3[_0xdfa4('0x58')]['id']}})[_0xdfa4('0x27')](handleEntityNotFound(_0x1c281d,null))['then'](function(_0x1db9f9){if(_0x1db9f9){_0x43ddb6=_0x1db9f9[_0xdfa4('0x29')]({'plain':!![]});_0x4afd9b[_0xdfa4('0x33')]=_[_0xdfa4('0x35')](db['UserFaxQueue'][_0xdfa4('0x49')]);_0x4afd9b[_0xdfa4('0x34')]=_[_0xdfa4('0x35')](_0x3004f3[_0xdfa4('0x34')]);_0x4afd9b['filters']=_['intersection'](_0x4afd9b[_0xdfa4('0x33')],_0x4afd9b[_0xdfa4('0x34')]);_0x5c2ee8[_0xdfa4('0x37')]=_[_0xdfa4('0x38')](_0x4afd9b[_0xdfa4('0x33')],qs['fields'](_0x3004f3[_0xdfa4('0x34')][_0xdfa4('0x4a')]));_0x5c2ee8[_0xdfa4('0x37')]=_0x5c2ee8[_0xdfa4('0x37')]['length']?_0x5c2ee8[_0xdfa4('0x37')]:_0x4afd9b[_0xdfa4('0x33')];if(!_0x3004f3[_0xdfa4('0x34')][_0xdfa4('0x39')](_0xdfa4('0x3a'))){_0x5c2ee8[_0xdfa4('0x3b')]=qs['limit'](_0x3004f3[_0xdfa4('0x34')][_0xdfa4('0x3b')]);_0x5c2ee8[_0xdfa4('0x22')]=qs['offset'](_0x3004f3[_0xdfa4('0x34')][_0xdfa4('0x22')]);}_0x5c2ee8['order']=qs[_0xdfa4('0x3d')](_0x3004f3[_0xdfa4('0x34')][_0xdfa4('0x3d')]);_0x5c2ee8[_0xdfa4('0x41')]=qs[_0xdfa4('0x36')](_[_0xdfa4('0x5c')](_0x3004f3[_0xdfa4('0x34')],_0x4afd9b[_0xdfa4('0x36')]));_0x5c2ee8[_0xdfa4('0x41')][_0xdfa4('0x5d')]=_0x1db9f9['id'];if(_0x3004f3['query'][_0xdfa4('0x3e')]){_0x5c2ee8[_0xdfa4('0x41')]=_[_0xdfa4('0x3f')](_0x5c2ee8[_0xdfa4('0x41')],{'$or':_[_0xdfa4('0x2f')](_0x5c2ee8[_0xdfa4('0x37')],function(_0x172ae8){var _0x25155a={};_0x25155a[_0x172ae8]={'$like':'%'+_0x3004f3[_0xdfa4('0x34')][_0xdfa4('0x3e')]+'%'};return _0x25155a;})});}_0x5c2ee8=_[_0xdfa4('0x3f')]({},_0x5c2ee8,_0x3004f3[_0xdfa4('0x4c')]);return db['UserFaxQueue']['findAll'](_0x5c2ee8);}})[_0xdfa4('0x27')](function(_0x18f989){if(_0x18f989){return db[_0xdfa4('0x5e')][_0xdfa4('0x5f')]({'where':{'id':_[_0xdfa4('0x2f')](_0x18f989,_0xdfa4('0x60')),'role':_0xdfa4('0x61')},'attributes':['id',_0xdfa4('0x2d'),'faxPause',_0xdfa4('0x62'),_0xdfa4('0x63')]});}})[_0xdfa4('0x27')](function(_0x5912f9){if(_0x5912f9){return{'count':_0x5912f9['count'],'rows':_[_0xdfa4('0x2f')](_0x5912f9[_0xdfa4('0x46')],function(_0x58f35c){return{'membername':_0x58f35c[_0xdfa4('0x2d')],'UserId':_0x58f35c['id'],'queue_name':_0x43ddb6[_0xdfa4('0x2d')],'FaxQueueId':_0x43ddb6['id'],'interface':util[_0xdfa4('0x64')]('%s/%s',_0xdfa4('0x65'),_0x58f35c[_0xdfa4('0x2d')]),'penalty':0x0,'paused':_0x58f35c[_0xdfa4('0x66')],'createdAt':_0x58f35c['createdAt'],'updatedAt':_0x58f35c[_0xdfa4('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdfa4('0x27')](respondWithFilteredResult(_0x1c281d,_0x5c2ee8))['catch'](handleError(_0x1c281d,null));};exports[_0xdfa4('0x67')]=function(_0x11f331,_0x446252,_0x491b16){var _0xc0a027={};var _0x40a4bd={};var _0x2e501b;var _0xfb5590;return db['FaxQueue']['findOne']({'where':{'id':_0x11f331[_0xdfa4('0x58')]['id']}})[_0xdfa4('0x27')](handleEntityNotFound(_0x446252,null))['then'](function(_0xca65aa){if(_0xca65aa){_0x2e501b=_0xca65aa;_0x40a4bd[_0xdfa4('0x33')]=_[_0xdfa4('0x35')](db[_0xdfa4('0x68')][_0xdfa4('0x49')]);_0x40a4bd[_0xdfa4('0x34')]=_[_0xdfa4('0x35')](_0x11f331[_0xdfa4('0x34')]);_0x40a4bd[_0xdfa4('0x36')]=_['intersection'](_0x40a4bd[_0xdfa4('0x33')],_0x40a4bd[_0xdfa4('0x34')]);_0xc0a027[_0xdfa4('0x37')]=_[_0xdfa4('0x38')](_0x40a4bd[_0xdfa4('0x33')],qs['fields'](_0x11f331[_0xdfa4('0x34')][_0xdfa4('0x4a')]));_0xc0a027[_0xdfa4('0x37')]=_0xc0a027[_0xdfa4('0x37')]['length']?_0xc0a027[_0xdfa4('0x37')]:_0x40a4bd[_0xdfa4('0x33')];_0xc0a027[_0xdfa4('0x3c')]=qs['sort'](_0x11f331['query']['sort']);_0xc0a027[_0xdfa4('0x41')]=qs['filters'](_[_0xdfa4('0x5c')](_0x11f331[_0xdfa4('0x34')],_0x40a4bd[_0xdfa4('0x36')]));if(_0x11f331[_0xdfa4('0x34')][_0xdfa4('0x3e')]){_0xc0a027[_0xdfa4('0x41')]=_[_0xdfa4('0x3f')](_0xc0a027[_0xdfa4('0x41')],{'$or':_[_0xdfa4('0x2f')](_0xc0a027[_0xdfa4('0x37')],function(_0x1bc243){var _0x12a862={};_0x12a862[_0x1bc243]={'$like':'%'+_0x11f331[_0xdfa4('0x34')][_0xdfa4('0x3e')]+'%'};return _0x12a862;})});}_0xc0a027=_[_0xdfa4('0x3f')]({},_0xc0a027,_0x11f331[_0xdfa4('0x4c')]);return _0x2e501b['getTeams'](_0xc0a027);}})[_0xdfa4('0x27')](function(_0x435750){if(_0x435750){_0xfb5590=_0x435750[_0xdfa4('0x4b')];if(!_0x11f331[_0xdfa4('0x34')][_0xdfa4('0x39')](_0xdfa4('0x3a'))){_0xc0a027['limit']=qs[_0xdfa4('0x3b')](_0x11f331['query'][_0xdfa4('0x3b')]);_0xc0a027[_0xdfa4('0x22')]=qs[_0xdfa4('0x22')](_0x11f331[_0xdfa4('0x34')][_0xdfa4('0x22')]);}return _0x2e501b[_0xdfa4('0x67')](_0xc0a027);}})[_0xdfa4('0x27')](function(_0x5514b4){if(_0x5514b4){return _0x5514b4?{'count':_0xfb5590,'rows':_0x5514b4}:null;}})['then'](respondWithResult(_0x446252,null))[_0xdfa4('0x47')](handleError(_0x446252,null));};exports[_0xdfa4('0x69')]=function(_0x2acd39,_0x1bc584,_0x16dfe1){var _0x31891b=_0x2acd39[_0xdfa4('0x4f')][_0xdfa4('0x6a')];return db[_0xdfa4('0x68')][_0xdfa4('0x45')]({'where':{'id':_0x31891b},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdfa4('0x6b'),'attributes':['id',_0xdfa4('0x2d'),'online',_0xdfa4('0x6c'),_0xdfa4('0x6d')],'raw':!![]}]})[_0xdfa4('0x27')](function(_0x4528c9){if(_0x4528c9){var _0x5995f6=_[_0xdfa4('0x6e')](_0x4528c9,function(_0x3d9b75){var _0x3893a9=_0x3d9b75[_0xdfa4('0x29')]({'plain':!![]});return _0x3893a9[_0xdfa4('0x6b')];});return db[_0xdfa4('0x42')][_0xdfa4('0x4d')]({'where':{'id':_0x2acd39['params']['id']}})[_0xdfa4('0x27')](function(_0x286cf1){return db['sequelize'][_0xdfa4('0x6f')](function(_0x4226d9){return _0x286cf1[_0xdfa4('0x69')](_0x31891b,{'transaction':_0x4226d9})[_0xdfa4('0x27')](function(){return BPromise['each'](_0x5995f6,function(_0x155b0d){return db[_0xdfa4('0x70')][_0xdfa4('0x71')]({'where':{'UserId':_0x155b0d['id'],'FaxQueueId':_0x2acd39[_0xdfa4('0x58')]['id']},'transaction':_0x4226d9});});})[_0xdfa4('0x27')](function(){_0x5995f6[_0xdfa4('0x72')](function(_0x27d059){socket[_0xdfa4('0x73')](_0xdfa4('0x74'),{'UserId':_0x27d059['id'],'FaxQueueId':_0x286cf1['id']});});});});});}})[_0xdfa4('0x27')](respondWithStatusCode(_0x1bc584,null))[_0xdfa4('0x47')](handleError(_0x1bc584,null));};exports[_0xdfa4('0x75')]=function(_0x162250,_0x36f1ac,_0x1a17c7){return db[_0xdfa4('0x68')][_0xdfa4('0x45')]({'where':{'id':_0x162250['query'][_0xdfa4('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xdfa4('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xdfa4('0x27')](handleEntityNotFound(_0x36f1ac,null))[_0xdfa4('0x27')](function(_0x530e89){var _0x29d966=_['map'](_0x530e89,'id');var _0xa40c20=[];var _0x4baa09=[];var _0x28753e=squel[_0xdfa4('0x76')]();_0x28753e[_0xdfa4('0x77')](_0xdfa4('0x78'))[_0xdfa4('0x79')](_0xdfa4('0x7a'),'tq')[_0xdfa4('0x7b')]('user_has_teams','ut',_0xdfa4('0x7c'))[_0xdfa4('0x41')]('FaxQueueId\x20=\x20?',_0x162250['params']['id']);for(var _0x2b75f0=0x0;_0x2b75f0<_0x530e89[_0xdfa4('0x4b')];_0x2b75f0+=0x1){let _0x5ab1ee=_0x530e89[_0x2b75f0];for(var _0x5a389e=0x0;_0x5a389e<_0x5ab1ee[_0xdfa4('0x6b')][_0xdfa4('0x4b')];_0x5a389e+=0x1){let _0xc0358c=_0x5ab1ee[_0xdfa4('0x6b')][_0x5a389e];var _0x3e58ee=_0x28753e['clone']();_0x3e58ee[_0xdfa4('0x41')]('ut.UserId\x20=\x20?',_0xc0358c['id']);_0x4baa09[_0xdfa4('0x7d')](db[_0xdfa4('0x7e')][_0xdfa4('0x34')](_0x3e58ee['toString'](),{'type':db['sequelize'][_0xdfa4('0x7f')][_0xdfa4('0x80')]})[_0xdfa4('0x27')](function(_0x894a8c){if(_0x894a8c[_0xdfa4('0x4b')]===0x1){return _0xc0358c['id'];}else{var _0x17b704=_[_0xdfa4('0x81')](_[_0xdfa4('0x2f')](_0x894a8c,_0xdfa4('0x82')),function(_0x2203cb){return _[_0xdfa4('0x83')](_0x29d966,_0x2203cb);});if(_0x17b704){return _0xc0358c['id'];}}}));}}return BPromise[_0xdfa4('0x84')](_0x4baa09)['then'](function(_0x1335f7){_0xa40c20=_(_0xa40c20)[_0xdfa4('0x85')](_0x1335f7)[_0xdfa4('0x86')]()['value']();return db['FaxQueue'][_0xdfa4('0x4d')]({'where':{'id':_0x162250['params']['id']}})[_0xdfa4('0x27')](function(_0x1c4023){return db['sequelize']['transaction'](function(_0x191acb){return _0x1c4023[_0xdfa4('0x75')](_0x162250['query'][_0xdfa4('0x6a')],{'transaction':_0x191acb})[_0xdfa4('0x27')](function(){if(!_[_0xdfa4('0x87')](_0xa40c20)){return _0x1c4023[_0xdfa4('0x88')](_0xa40c20,{'transaction':_0x191acb});}})['then'](function(){_0xa40c20[_0xdfa4('0x72')](function(_0x12b85f){socket['emit'](_0xdfa4('0x89'),{'UserId':_0x12b85f,'FaxQueueId':_0x1c4023['id']});});});});});});})[_0xdfa4('0x27')](respondWithStatusCode(_0x36f1ac,null))[_0xdfa4('0x47')](handleError(_0x36f1ac,null));};exports['addAgents']=function(_0x241027,_0x2542fd,_0x34c4f6){return db[_0xdfa4('0x42')][_0xdfa4('0x4d')]({'where':{'id':_0x241027[_0xdfa4('0x58')]['id']}})['then'](handleEntityNotFound(_0x2542fd,null))[_0xdfa4('0x27')](function(_0xdb0ed3){if(_0xdb0ed3){return _0xdb0ed3[_0xdfa4('0x8a')](_0x241027[_0xdfa4('0x4f')][_0xdfa4('0x6a')],_[_0xdfa4('0x8b')](_0x241027[_0xdfa4('0x4f')],[_0xdfa4('0x6a'),'id'])||{})[_0xdfa4('0x8c')](function(_0x26a1dc){for(var _0x32e882=0x0;_0x32e882<_0x241027[_0xdfa4('0x4f')][_0xdfa4('0x6a')][_0xdfa4('0x4b')];_0x32e882+=0x1){socket['emit']('userFaxQueue:save',{'UserId':_0x241027[_0xdfa4('0x4f')][_0xdfa4('0x6a')][_0x32e882],'FaxQueueId':_0x241027['params']['id']});}return _0x26a1dc;});}})[_0xdfa4('0x27')](respondWithResult(_0x2542fd,null))['catch'](handleError(_0x2542fd,null));};exports[_0xdfa4('0x88')]=function(_0x346640,_0x48ba96,_0x5f4da4){return db['FaxQueue'][_0xdfa4('0x4d')]({'where':{'id':_0x346640['params']['id']}})[_0xdfa4('0x27')](handleEntityNotFound(_0x48ba96,null))[_0xdfa4('0x27')](function(_0x19a52c){if(_0x19a52c){return _0x19a52c[_0xdfa4('0x88')](_0x346640[_0xdfa4('0x34')][_0xdfa4('0x6a')])['then'](function(){if(_[_0xdfa4('0x8d')](_0x346640['query'][_0xdfa4('0x6a')])){for(var _0x4cecdb=0x0;_0x4cecdb<_0x346640[_0xdfa4('0x34')][_0xdfa4('0x6a')][_0xdfa4('0x4b')];_0x4cecdb+=0x1){socket[_0xdfa4('0x73')](_0xdfa4('0x89'),{'UserId':Number(_0x346640[_0xdfa4('0x34')]['ids'][_0x4cecdb]),'FaxQueueId':Number(_0x346640[_0xdfa4('0x58')]['id'])});}}else{socket[_0xdfa4('0x73')]('userFaxQueue:remove',{'UserId':Number(_0x346640[_0xdfa4('0x34')][_0xdfa4('0x6a')]),'FaxQueueId':Number(_0x346640['params']['id'])});}});}})['then'](respondWithStatusCode(_0x48ba96,null))[_0xdfa4('0x47')](handleError(_0x48ba96,null));};exports[_0xdfa4('0x8e')]=function(_0x513a98,_0x4ede77,_0x4ef8a1){var _0x4ae7ec={};var _0x324801={};var _0x3f60ba;var _0xb806f2;return db[_0xdfa4('0x42')]['findOne']({'where':{'id':_0x513a98['params']['id']}})[_0xdfa4('0x27')](handleEntityNotFound(_0x4ede77,null))[_0xdfa4('0x27')](function(_0x490677){if(_0x490677){_0x3f60ba=_0x490677;_0x324801[_0xdfa4('0x33')]=_['keys'](db['User']['rawAttributes']);_0x324801[_0xdfa4('0x34')]=_['keys'](_0x513a98['query']);_0x324801[_0xdfa4('0x36')]=_['intersection'](_0x324801[_0xdfa4('0x33')],_0x324801[_0xdfa4('0x34')]);_0x4ae7ec[_0xdfa4('0x37')]=_['intersection'](_0x324801['model'],qs['fields'](_0x513a98[_0xdfa4('0x34')][_0xdfa4('0x4a')]));_0x4ae7ec[_0xdfa4('0x37')]=_0x4ae7ec[_0xdfa4('0x37')][_0xdfa4('0x4b')]?_0x4ae7ec[_0xdfa4('0x37')]:_0x324801['model'];_0x4ae7ec['order']=qs['sort'](_0x513a98[_0xdfa4('0x34')][_0xdfa4('0x3d')]);_0x4ae7ec[_0xdfa4('0x41')]=qs[_0xdfa4('0x36')](_[_0xdfa4('0x5c')](_0x513a98[_0xdfa4('0x34')],_0x324801[_0xdfa4('0x36')]));if(_0x513a98[_0xdfa4('0x34')]['filter']){_0x4ae7ec[_0xdfa4('0x41')]=_[_0xdfa4('0x3f')](_0x4ae7ec['where'],{'$or':_[_0xdfa4('0x2f')](_0x4ae7ec[_0xdfa4('0x37')],function(_0x38c6e6){var _0xa3108={};_0xa3108[_0x38c6e6]={'$like':'%'+_0x513a98['query'][_0xdfa4('0x3e')]+'%'};return _0xa3108;})});}_0x4ae7ec=_[_0xdfa4('0x3f')]({},_0x4ae7ec,_0x513a98[_0xdfa4('0x4c')]);return _0x3f60ba[_0xdfa4('0x8e')](_0x4ae7ec);}})[_0xdfa4('0x27')](function(_0xccfe41){if(_0xccfe41){_0xb806f2=_0xccfe41[_0xdfa4('0x4b')];if(!_0x513a98[_0xdfa4('0x34')]['hasOwnProperty'](_0xdfa4('0x3a'))){_0x4ae7ec[_0xdfa4('0x3b')]=qs[_0xdfa4('0x3b')](_0x513a98[_0xdfa4('0x34')][_0xdfa4('0x3b')]);_0x4ae7ec[_0xdfa4('0x22')]=qs[_0xdfa4('0x22')](_0x513a98['query']['offset']);}return _0x3f60ba[_0xdfa4('0x8e')](_0x4ae7ec);}})[_0xdfa4('0x27')](function(_0x17dd27){if(_0x17dd27){return _0x17dd27?{'count':_0xb806f2,'rows':_0x17dd27}:null;}})[_0xdfa4('0x27')](respondWithResult(_0x4ede77,null))[_0xdfa4('0x47')](handleError(_0x4ede77,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 428666e..a60d1b9 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 _0xf272=['events','../../mysqldb','FaxQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x50bb41,_0x4da1d6){var _0x512809=function(_0x5019f8){while(--_0x5019f8){_0x50bb41['push'](_0x50bb41['shift']());}};_0x512809(++_0x4da1d6);}(_0xf272,0xdc));var _0x2f27=function(_0x19c6f1,_0x26d0fb){_0x19c6f1=_0x19c6f1-0x0;var _0x3efe35=_0xf272[_0x19c6f1];return _0x3efe35;};'use strict';var EventEmitter=require(_0x2f27('0x0'));var FaxQueue=require(_0x2f27('0x1'))['db'][_0x2f27('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x2f27('0x3')](0x0);var events={'afterCreate':_0x2f27('0x4'),'afterUpdate':'update','afterDestroy':_0x2f27('0x5')};function emitEvent(_0x4756df){return function(_0x215a1e,_0xa9dc81,_0x46b5d2){FaxQueueEvents[_0x2f27('0x6')](_0x4756df+':'+_0x215a1e['id'],_0x215a1e);FaxQueueEvents['emit'](_0x4756df,_0x215a1e);_0x46b5d2(null);};}for(var e in events){if(events[_0x2f27('0x7')](e)){var event=events[e];FaxQueue[_0x2f27('0x8')](e,emitEvent(event));}}module[_0x2f27('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0xc832=['FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x31c29e,_0x514baf){var _0x460bd9=function(_0x3e9b7f){while(--_0x3e9b7f){_0x31c29e['push'](_0x31c29e['shift']());}};_0x460bd9(++_0x514baf);}(_0xc832,0xdb));var _0x2c83=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xc832[_0x1e7b16];return _0x37fadc;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x2c83('0x0'))['db'][_0x2c83('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x2c83('0x2')](0x0);var events={'afterCreate':_0x2c83('0x3'),'afterUpdate':_0x2c83('0x4'),'afterDestroy':_0x2c83('0x5')};function emitEvent(_0x477d2f){return function(_0x4063e2,_0x45c5b9,_0x15e974){FaxQueueEvents['emit'](_0x477d2f+':'+_0x4063e2['id'],_0x4063e2);FaxQueueEvents[_0x2c83('0x6')](_0x477d2f,_0x4063e2);_0x15e974(null);};}for(var e in events){if(events[_0x2c83('0x7')](e)){var event=events[e];FaxQueue[_0x2c83('0x8')](e,emitEvent(event));}}module[_0x2c83('0x9')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 403b491..3d4f29d 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 _0x3961=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','util'];(function(_0x588aa6,_0x3fa1bc){var _0x1bcd33=function(_0x3780c6){while(--_0x3780c6){_0x588aa6['push'](_0x588aa6['shift']());}};_0x1bcd33(++_0x3fa1bc);}(_0x3961,0x1ba));var _0x1396=function(_0x86337d,_0x2b57c3){_0x86337d=_0x86337d-0x0;var _0x22b2c6=_0x3961[_0x86337d];return _0x22b2c6;};'use strict';var _=require(_0x1396('0x0'));var util=require(_0x1396('0x1'));var logger=require(_0x1396('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1396('0x3'));var rp=require(_0x1396('0x4'));var fs=require('fs');var path=require(_0x1396('0x5'));var rimraf=require(_0x1396('0x6'));var config=require(_0x1396('0x7'));var attributes=require(_0x1396('0x8'));module[_0x1396('0x9')]=function(_0x234678,_0x58b389){return _0x234678[_0x1396('0xa')]('FaxQueue',attributes,{'tableName':_0x1396('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3dc9=['bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue','fax_queues','lodash','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3dc9,0xc9));var _0x93dc=function(_0x276b09,_0x41bb87){_0x276b09=_0x276b09-0x0;var _0x3d8d54=_0x3dc9[_0x276b09];return _0x3d8d54;};'use strict';var _=require(_0x93dc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x93dc('0x1'));var moment=require(_0x93dc('0x2'));var BPromise=require(_0x93dc('0x3'));var rp=require(_0x93dc('0x4'));var fs=require('fs');var path=require(_0x93dc('0x5'));var rimraf=require(_0x93dc('0x6'));var config=require(_0x93dc('0x7'));var attributes=require(_0x93dc('0x8'));module['exports']=function(_0xdbbfd6,_0x208bbf){return _0xdbbfd6[_0x93dc('0x9')](_0x93dc('0xa'),attributes,{'tableName':_0x93dc('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 d287c24..d5b7f62 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 _0x53ea=['result','GetFaxQueue','FaxQueue','options','raw','where','attributes','include','map','model','ShowFaxQueue','then','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','request','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0x53ea,0x7c));var _0xa53e=function(_0x34f8b6,_0x501553){_0x34f8b6=_0x34f8b6-0x0;var _0x109265=_0x53ea[_0x34f8b6];return _0x109265;};'use strict';var _=require(_0xa53e('0x0'));var util=require('util');var moment=require(_0xa53e('0x1'));var BPromise=require(_0xa53e('0x2'));var rs=require(_0xa53e('0x3'));var fs=require('fs');var Redis=require(_0xa53e('0x4'));var db=require(_0xa53e('0x5'))['db'];var utils=require(_0xa53e('0x6'));var logger=require(_0xa53e('0x7'))(_0xa53e('0x8'));var config=require(_0xa53e('0x9'));var jayson=require(_0xa53e('0xa'));var client=jayson[_0xa53e('0xb')][_0xa53e('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa53e('0xd')],{'host':_0xa53e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x3d0a66,_0x337f86,_0x1ee1a9){return new BPromise(function(_0x4afa18,_0x50c9e9){return client[_0xa53e('0xf')](_0x3d0a66,_0x1ee1a9)['then'](function(_0x543aee){logger['info'](_0xa53e('0x10'),_0x337f86,_0xa53e('0x11'));logger[_0xa53e('0x12')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x337f86,_0xa53e('0x11'),JSON[_0xa53e('0x13')](_0x543aee));if(_0x543aee[_0xa53e('0x14')]){if(_0x543aee['error'][_0xa53e('0x15')]===0x1f4){logger['error'](_0xa53e('0x10'),_0x337f86,_0x543aee[_0xa53e('0x14')]['message']);return _0x50c9e9(_0x543aee[_0xa53e('0x14')][_0xa53e('0x16')]);}logger[_0xa53e('0x14')]('FaxQueue,\x20%s,\x20%s',_0x337f86,_0x543aee[_0xa53e('0x14')][_0xa53e('0x16')]);return _0x4afa18(_0x543aee['error'][_0xa53e('0x16')]);}else{logger[_0xa53e('0x17')](_0xa53e('0x10'),_0x337f86,_0xa53e('0x11'));_0x4afa18(_0x543aee[_0xa53e('0x18')][_0xa53e('0x16')]);}})['catch'](function(_0x3610d8){logger[_0xa53e('0x14')]('FaxQueue,\x20%s,\x20%s',_0x337f86,_0x3610d8);_0x50c9e9(_0x3610d8);});});}exports[_0xa53e('0x19')]=function(_0x51bc47){var _0x4a8676=this;return new Promise(function(_0x165de6,_0x2343e3){return db[_0xa53e('0x1a')]['findAll']({'raw':_0x51bc47[_0xa53e('0x1b')]?_0x51bc47[_0xa53e('0x1b')][_0xa53e('0x1c')]===undefined?!![]:![]:!![],'where':_0x51bc47[_0xa53e('0x1b')]?_0x51bc47['options'][_0xa53e('0x1d')]||null:null,'attributes':_0x51bc47[_0xa53e('0x1b')]?_0x51bc47['options'][_0xa53e('0x1e')]||null:null,'limit':_0x51bc47['options']?_0x51bc47[_0xa53e('0x1b')]['limit']||null:null,'include':_0x51bc47[_0xa53e('0x1b')]?_0x51bc47[_0xa53e('0x1b')][_0xa53e('0x1f')]?_[_0xa53e('0x20')](_0x51bc47[_0xa53e('0x1b')][_0xa53e('0x1f')],function(_0x2e137d){return{'model':db[_0x2e137d[_0xa53e('0x21')]],'as':_0x2e137d['as'],'attributes':_0x2e137d[_0xa53e('0x1e')],'include':_0x2e137d[_0xa53e('0x1f')]?_[_0xa53e('0x20')](_0x2e137d['include'],function(_0x4c1eb3){return{'model':db[_0x4c1eb3[_0xa53e('0x21')]],'as':_0x4c1eb3['as'],'attributes':_0x4c1eb3[_0xa53e('0x1e')],'include':_0x4c1eb3[_0xa53e('0x1f')]?_[_0xa53e('0x20')](_0x4c1eb3[_0xa53e('0x1f')],function(_0x391f0c){return{'model':db[_0x391f0c['model']],'as':_0x391f0c['as'],'attributes':_0x391f0c[_0xa53e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf37652){logger[_0xa53e('0x17')](_0xa53e('0x19'),_0x51bc47);logger[_0xa53e('0x12')](_0xa53e('0x19'),_0x51bc47,JSON[_0xa53e('0x13')](_0xf37652));_0x165de6(_0xf37652);})['catch'](function(_0x413c11){logger[_0xa53e('0x14')](_0xa53e('0x19'),_0x413c11['message'],_0x51bc47);_0x2343e3(_0x4a8676[_0xa53e('0x14')](0x1f4,_0x413c11['message']));});});};exports[_0xa53e('0x22')]=function(_0x4fb2b1){var _0x77b29=this;return new Promise(function(_0x266b42,_0x49b7a2){return db[_0xa53e('0x1a')]['find']({'raw':_0x4fb2b1[_0xa53e('0x1b')]?_0x4fb2b1[_0xa53e('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4fb2b1[_0xa53e('0x1b')]?_0x4fb2b1[_0xa53e('0x1b')][_0xa53e('0x1d')]||null:null,'attributes':_0x4fb2b1['options']?_0x4fb2b1[_0xa53e('0x1b')][_0xa53e('0x1e')]||null:null,'include':_0x4fb2b1[_0xa53e('0x1b')]?_0x4fb2b1[_0xa53e('0x1b')][_0xa53e('0x1f')]?_[_0xa53e('0x20')](_0x4fb2b1['options'][_0xa53e('0x1f')],function(_0x3bc5ff){return{'model':db[_0x3bc5ff[_0xa53e('0x21')]],'as':_0x3bc5ff['as'],'attributes':_0x3bc5ff['attributes'],'include':_0x3bc5ff['include']?_[_0xa53e('0x20')](_0x3bc5ff['include'],function(_0x5c72a1){return{'model':db[_0x5c72a1[_0xa53e('0x21')]],'as':_0x5c72a1['as'],'attributes':_0x5c72a1[_0xa53e('0x1e')],'include':_0x5c72a1[_0xa53e('0x1f')]?_[_0xa53e('0x20')](_0x5c72a1[_0xa53e('0x1f')],function(_0x4ed634){return{'model':db[_0x4ed634[_0xa53e('0x21')]],'as':_0x4ed634['as'],'attributes':_0x4ed634['attributes']};}):[]};}):[]};}):[]:[]})[_0xa53e('0x23')](function(_0x2d1e98){logger['info'](_0xa53e('0x22'),_0x4fb2b1);logger[_0xa53e('0x12')](_0xa53e('0x22'),_0x4fb2b1,JSON[_0xa53e('0x13')](_0x2d1e98));_0x266b42(_0x2d1e98);})[_0xa53e('0x24')](function(_0x1fea21){logger[_0xa53e('0x14')]('ShowFaxQueue',_0x1fea21[_0xa53e('0x16')],_0x4fb2b1);_0x49b7a2(_0x77b29['error'](0x1f4,_0x1fea21[_0xa53e('0x16')]));});});}; \ No newline at end of file +var _0xb549=['raw','attributes','limit','include','model','map','then','stringify','ShowFaxQueue','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','message','catch','FaxQueue','findAll','options'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xb549,0x1b8));var _0x9b54=function(_0x242b5f,_0x2e413d){_0x242b5f=_0x242b5f-0x0;var _0x4ac256=_0xb549[_0x242b5f];return _0x4ac256;};'use strict';var _=require(_0x9b54('0x0'));var util=require(_0x9b54('0x1'));var moment=require(_0x9b54('0x2'));var BPromise=require(_0x9b54('0x3'));var rs=require(_0x9b54('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9b54('0x5'))['db'];var utils=require(_0x9b54('0x6'));var logger=require(_0x9b54('0x7'))(_0x9b54('0x8'));var config=require(_0x9b54('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9b54('0xa')][_0x9b54('0xb')]({'port':0x232a});config[_0x9b54('0xc')]=_['defaults'](config[_0x9b54('0xc')],{'host':_0x9b54('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9b54('0xc')]));require(_0x9b54('0xe'))[_0x9b54('0xf')](socket);function respondWithRpcPromise(_0x4201d2,_0x1e2f9a,_0x4addbc){return new BPromise(function(_0x566087,_0x42d8b1){return client[_0x9b54('0x10')](_0x4201d2,_0x4addbc)['then'](function(_0x553b6c){logger[_0x9b54('0x11')](_0x9b54('0x12'),_0x1e2f9a,_0x9b54('0x13'));logger[_0x9b54('0x14')](_0x9b54('0x15'),_0x1e2f9a,_0x9b54('0x13'),JSON['stringify'](_0x553b6c));if(_0x553b6c[_0x9b54('0x16')]){if(_0x553b6c[_0x9b54('0x16')]['code']===0x1f4){logger[_0x9b54('0x16')](_0x9b54('0x12'),_0x1e2f9a,_0x553b6c['error'][_0x9b54('0x17')]);return _0x42d8b1(_0x553b6c[_0x9b54('0x16')]['message']);}logger[_0x9b54('0x16')](_0x9b54('0x12'),_0x1e2f9a,_0x553b6c[_0x9b54('0x16')][_0x9b54('0x17')]);return _0x566087(_0x553b6c[_0x9b54('0x16')][_0x9b54('0x17')]);}else{logger[_0x9b54('0x11')](_0x9b54('0x12'),_0x1e2f9a,_0x9b54('0x13'));_0x566087(_0x553b6c['result'][_0x9b54('0x17')]);}})[_0x9b54('0x18')](function(_0x24c969){logger[_0x9b54('0x16')](_0x9b54('0x12'),_0x1e2f9a,_0x24c969);_0x42d8b1(_0x24c969);});});}exports['GetFaxQueue']=function(_0x3349a9){var _0x4b9d88=this;return new Promise(function(_0x1279d2,_0x3ffc37){return db[_0x9b54('0x19')][_0x9b54('0x1a')]({'raw':_0x3349a9[_0x9b54('0x1b')]?_0x3349a9[_0x9b54('0x1b')][_0x9b54('0x1c')]===undefined?!![]:![]:!![],'where':_0x3349a9[_0x9b54('0x1b')]?_0x3349a9[_0x9b54('0x1b')]['where']||null:null,'attributes':_0x3349a9[_0x9b54('0x1b')]?_0x3349a9[_0x9b54('0x1b')][_0x9b54('0x1d')]||null:null,'limit':_0x3349a9['options']?_0x3349a9[_0x9b54('0x1b')][_0x9b54('0x1e')]||null:null,'include':_0x3349a9['options']?_0x3349a9[_0x9b54('0x1b')][_0x9b54('0x1f')]?_['map'](_0x3349a9[_0x9b54('0x1b')][_0x9b54('0x1f')],function(_0x3d5955){return{'model':db[_0x3d5955['model']],'as':_0x3d5955['as'],'attributes':_0x3d5955[_0x9b54('0x1d')],'include':_0x3d5955[_0x9b54('0x1f')]?_['map'](_0x3d5955[_0x9b54('0x1f')],function(_0x31b81d){return{'model':db[_0x31b81d[_0x9b54('0x20')]],'as':_0x31b81d['as'],'attributes':_0x31b81d[_0x9b54('0x1d')],'include':_0x31b81d[_0x9b54('0x1f')]?_[_0x9b54('0x21')](_0x31b81d[_0x9b54('0x1f')],function(_0x34a728){return{'model':db[_0x34a728[_0x9b54('0x20')]],'as':_0x34a728['as'],'attributes':_0x34a728[_0x9b54('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9b54('0x22')](function(_0x479e9d){logger[_0x9b54('0x11')]('GetFaxQueue',_0x3349a9);logger[_0x9b54('0x14')]('GetFaxQueue',_0x3349a9,JSON[_0x9b54('0x23')](_0x479e9d));_0x1279d2(_0x479e9d);})[_0x9b54('0x18')](function(_0x57219d){logger['error']('GetFaxQueue',_0x57219d[_0x9b54('0x17')],_0x3349a9);_0x3ffc37(_0x4b9d88['error'](0x1f4,_0x57219d[_0x9b54('0x17')]));});});};exports[_0x9b54('0x24')]=function(_0x551c37){var _0x555aa9=this;return new Promise(function(_0xa9009d,_0x517aff){return db['FaxQueue'][_0x9b54('0x25')]({'raw':_0x551c37[_0x9b54('0x1b')]?_0x551c37[_0x9b54('0x1b')][_0x9b54('0x1c')]===undefined?!![]:![]:!![],'where':_0x551c37[_0x9b54('0x1b')]?_0x551c37['options'][_0x9b54('0x26')]||null:null,'attributes':_0x551c37[_0x9b54('0x1b')]?_0x551c37[_0x9b54('0x1b')][_0x9b54('0x1d')]||null:null,'include':_0x551c37[_0x9b54('0x1b')]?_0x551c37['options'][_0x9b54('0x1f')]?_['map'](_0x551c37[_0x9b54('0x1b')][_0x9b54('0x1f')],function(_0x2c21d9){return{'model':db[_0x2c21d9[_0x9b54('0x20')]],'as':_0x2c21d9['as'],'attributes':_0x2c21d9[_0x9b54('0x1d')],'include':_0x2c21d9[_0x9b54('0x1f')]?_[_0x9b54('0x21')](_0x2c21d9[_0x9b54('0x1f')],function(_0x1133d0){return{'model':db[_0x1133d0[_0x9b54('0x20')]],'as':_0x1133d0['as'],'attributes':_0x1133d0[_0x9b54('0x1d')],'include':_0x1133d0['include']?_[_0x9b54('0x21')](_0x1133d0[_0x9b54('0x1f')],function(_0x3d861b){return{'model':db[_0x3d861b[_0x9b54('0x20')]],'as':_0x3d861b['as'],'attributes':_0x3d861b[_0x9b54('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bacc4){logger[_0x9b54('0x11')](_0x9b54('0x24'),_0x551c37);logger[_0x9b54('0x14')](_0x9b54('0x24'),_0x551c37,JSON[_0x9b54('0x23')](_0x5bacc4));_0xa9009d(_0x5bacc4);})[_0x9b54('0x18')](function(_0x51b9dd){logger['error'](_0x9b54('0x24'),_0x51b9dd['message'],_0x551c37);_0x517aff(_0x555aa9[_0x9b54('0x16')](0x1f4,_0x51b9dd[_0x9b54('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 1888620..5613674 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 _0x0011=['emit','removeListener','register','length','faxQueue:','./faxQueue.events','update'];(function(_0x253dad,_0x3bfafa){var _0x6c42df=function(_0x32fd1c){while(--_0x32fd1c){_0x253dad['push'](_0x253dad['shift']());}};_0x6c42df(++_0x3bfafa);}(_0x0011,0x19b));var _0x1001=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0011[_0xbca1b1];return _0x4e1686;};'use strict';var FaxQueueEvents=require(_0x1001('0x0'));var events=['save','remove',_0x1001('0x1')];function createListener(_0x5c95b5,_0x3e4fc9){return function(_0xbd7ac){_0x3e4fc9[_0x1001('0x2')](_0x5c95b5,_0xbd7ac);};}function removeListener(_0x461774,_0x249deb){return function(){FaxQueueEvents[_0x1001('0x3')](_0x461774,_0x249deb);};}exports[_0x1001('0x4')]=function(_0x535489){for(var _0x434b26=0x0,_0x32f9cf=events[_0x1001('0x5')];_0x434b26<_0x32f9cf;_0x434b26++){var _0x141b2d=events[_0x434b26];var _0x443a6c=createListener(_0x1001('0x6')+_0x141b2d,_0x535489);FaxQueueEvents['on'](_0x141b2d,_0x443a6c);}}; \ No newline at end of file +var _0x0356=['register','length','./faxQueue.events','save','remove','emit','removeListener'];(function(_0x575057,_0x14baf3){var _0x49dbc8=function(_0x23599a){while(--_0x23599a){_0x575057['push'](_0x575057['shift']());}};_0x49dbc8(++_0x14baf3);}(_0x0356,0x152));var _0x6035=function(_0x180f27,_0x45f52b){_0x180f27=_0x180f27-0x0;var _0x67d756=_0x0356[_0x180f27];return _0x67d756;};'use strict';var FaxQueueEvents=require(_0x6035('0x0'));var events=[_0x6035('0x1'),_0x6035('0x2'),'update'];function createListener(_0x5c785c,_0x1e3767){return function(_0x5e4e70){_0x1e3767[_0x6035('0x3')](_0x5c785c,_0x5e4e70);};}function removeListener(_0x2921b9,_0x5aeb50){return function(){FaxQueueEvents[_0x6035('0x4')](_0x2921b9,_0x5aeb50);};}exports[_0x6035('0x5')]=function(_0x13c604){for(var _0x19bf2c=0x0,_0x16f6ba=events[_0x6035('0x6')];_0x19bf2c<_0x16f6ba;_0x19bf2c++){var _0x4685b0=events[_0x19bf2c];var _0x23c02d=createListener('faxQueue:'+_0x4685b0,_0x13c604);FaxQueueEvents['on'](_0x4685b0,_0x23c02d);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index defb43f..09688d6 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 _0xd8b0=['util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','index','get','/describe','describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','exports','multer'];(function(_0x4a2c10,_0x2a9dc2){var _0x53e995=function(_0x456156){while(--_0x456156){_0x4a2c10['push'](_0x4a2c10['shift']());}};_0x53e995(++_0x2a9dc2);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['get'](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x13')]('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x13')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);router[_0x0d8b('0x13')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x16')]);router['put'](_0x0d8b('0x17'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x18')]);router[_0x0d8b('0x19')](_0x0d8b('0x17'),auth['isAuthenticated'](),controller[_0x0d8b('0x1a')]);router[_0x0d8b('0x19')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x1b')]);router[_0x0d8b('0x19')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller['removeAgents']);module[_0x0d8b('0x1c')]=router; \ No newline at end of file +var _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0xb10b,0x12a));var _0xbb10=function(_0x15af2f,_0x3c0a01){_0x15af2f=_0x15af2f-0x0;var _0x359239=_0xb10b[_0x15af2f];return _0x359239;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index dd4f0a7..61dff79 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 _0x3abf=['exports','STRING','DATE','sequelize'];(function(_0x53dc4c,_0x29bcc4){var _0x3fba13=function(_0x5c8660){while(--_0x5c8660){_0x53dc4c['push'](_0x53dc4c['shift']());}};_0x3fba13(++_0x29bcc4);}(_0x3abf,0x16b));var _0xf3ab=function(_0x14abc0,_0x3a7020){_0x14abc0=_0x14abc0-0x0;var _0x28d748=_0x3abf[_0x14abc0];return _0x28d748;};'use strict';var moment=require('moment');var Sequelize=require(_0xf3ab('0x0'));module[_0xf3ab('0x1')]={'uniqueid':{'type':Sequelize[_0xf3ab('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf3ab('0x2')]},'joinAt':{'type':Sequelize[_0xf3ab('0x3')]},'leaveAt':{'type':Sequelize[_0xf3ab('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf3ab('0x3')]},'reason':{'type':Sequelize[_0xf3ab('0x2')]}}; \ No newline at end of file +var _0xb46f=['moment','STRING','DATE'];(function(_0x19912,_0x1eeea4){var _0x520e73=function(_0x5ead4a){while(--_0x5ead4a){_0x19912['push'](_0x19912['shift']());}};_0x520e73(++_0x1eeea4);}(_0xb46f,0x147));var _0xfb46=function(_0x450641,_0x218f5f){_0x450641=_0x450641-0x0;var _0x44deee=_0xb46f[_0x450641];return _0x44deee;};'use strict';var moment=require(_0xfb46('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xfb46('0x1')]},'joinAt':{'type':Sequelize[_0xfb46('0x2')]},'leaveAt':{'type':Sequelize[_0xfb46('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xfb46('0x2')]},'reason':{'type':Sequelize[_0xfb46('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 96837e0..ae5cdf4 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 _0x1d34=['lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','offset','set','Content-Range','json','reject','then','destroy','status','stack','name','FaxQueueReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','count','includeAll','findAll','rows','catch','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x995fd8,_0x25cc4d){var _0x1ed791=function(_0x3f8bc8){while(--_0x3f8bc8){_0x995fd8['push'](_0x995fd8['shift']());}};_0x1ed791(++_0x25cc4d);}(_0x1d34,0x10c));var _0x41d3=function(_0x5d314f,_0xa8d2a8){_0x5d314f=_0x5d314f-0x0;var _0x5d29ff=_0x1d34[_0x5d314f];return _0x5d29ff;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x41d3('0x0'));var rimraf=require(_0x41d3('0x1'));var zipdir=require(_0x41d3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x41d3('0x3'));var moment=require(_0x41d3('0x4'));var BPromise=require(_0x41d3('0x5'));var Mustache=require(_0x41d3('0x6'));var util=require(_0x41d3('0x7'));var path=require(_0x41d3('0x8'));var sox=require(_0x41d3('0x9'));var csv=require(_0x41d3('0xa'));var ejs=require(_0x41d3('0xb'));var fs=require('fs');var _=require(_0x41d3('0xc'));var squel=require(_0x41d3('0xd'));var crypto=require(_0x41d3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x41d3('0xf'));var Papa=require('papaparse');var Redis=require(_0x41d3('0x10'));var authService=require(_0x41d3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x41d3('0x12'));var hardwareService=require(_0x41d3('0x13'));var logger=require(_0x41d3('0x14'))(_0x41d3('0x15'));var utils=require(_0x41d3('0x16'));var config=require(_0x41d3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d2497,_0x49adb6){_0x49adb6=_0x49adb6||0xcc;return function(_0x472a13){if(_0x472a13){return _0x4d2497[_0x41d3('0x18')](_0x49adb6);}return _0x4d2497['status'](_0x49adb6)[_0x41d3('0x19')]();};}function respondWithResult(_0x178e16,_0x2cfb2c){_0x2cfb2c=_0x2cfb2c||0xc8;return function(_0x19ea09){if(_0x19ea09){return _0x178e16['status'](_0x2cfb2c)['json'](_0x19ea09);}};}function respondWithFilteredResult(_0x2783e5,_0x4d2d72){return function(_0x2acc0a){if(_0x2acc0a){var _0x200a85=_0x2acc0a['count'],_0x2b5128=_0x4d2d72[_0x41d3('0x1a')],_0x9772f3=_0x4d2d72['offset']+_0x4d2d72['limit'],_0x57aa59;if(_0x9772f3>=_0x200a85){_0x9772f3=_0x200a85;_0x57aa59=0xc8;}else{_0x57aa59=0xce;}_0x2783e5['status'](_0x57aa59);return _0x2783e5[_0x41d3('0x1b')](_0x41d3('0x1c'),_0x2b5128+'-'+_0x9772f3+'/'+_0x200a85)[_0x41d3('0x1d')](_0x2acc0a);}return null;};}function patchUpdates(_0x1c1afc){return function(_0x32d8a4){try{jsonpatch['apply'](_0x32d8a4,_0x1c1afc,!![]);}catch(_0x2bc085){return BPromise[_0x41d3('0x1e')](_0x2bc085);}return _0x32d8a4['save']();};}function saveUpdates(_0x72119b,_0x1308bc){return function(_0x180b50){if(_0x180b50){return _0x180b50['update'](_0x72119b)[_0x41d3('0x1f')](function(_0x6880dd){return _0x6880dd;});}return null;};}function removeEntity(_0x46fd2a,_0x4babeb){return function(_0x45b6fa){if(_0x45b6fa){return _0x45b6fa[_0x41d3('0x20')]()[_0x41d3('0x1f')](function(){_0x46fd2a[_0x41d3('0x21')](0xcc)[_0x41d3('0x19')]();});}};}function handleEntityNotFound(_0x2faf45,_0x2ea7ed){return function(_0x31fec2){if(!_0x31fec2){_0x2faf45[_0x41d3('0x18')](0x194);}return _0x31fec2;};}function handleError(_0x2670e9,_0x3d0703){_0x3d0703=_0x3d0703||0x1f4;return function(_0x5063ed){logger['error'](_0x5063ed[_0x41d3('0x22')]);if(_0x5063ed[_0x41d3('0x23')]){delete _0x5063ed[_0x41d3('0x23')];}_0x2670e9[_0x41d3('0x21')](_0x3d0703)['send'](_0x5063ed);};}exports['index']=function(_0x5195b2,_0x3f7e09){var _0x49b60c={},_0x33ecb9={},_0x473ebe={'count':0x0,'rows':[]};var _0x55ffa5=_['map'](db[_0x41d3('0x24')][_0x41d3('0x25')],function(_0x5f24b5){return{'name':_0x5f24b5['fieldName'],'type':_0x5f24b5[_0x41d3('0x26')][_0x41d3('0x27')]};});_0x33ecb9[_0x41d3('0x28')]=_['map'](_0x55ffa5,'name');_0x33ecb9['query']=_[_0x41d3('0x29')](_0x5195b2[_0x41d3('0x2a')]);_0x33ecb9[_0x41d3('0x2b')]=_[_0x41d3('0x2c')](_0x33ecb9[_0x41d3('0x28')],_0x33ecb9['query']);_0x49b60c[_0x41d3('0x2d')]=_[_0x41d3('0x2c')](_0x33ecb9['model'],qs[_0x41d3('0x2e')](_0x5195b2[_0x41d3('0x2a')]['fields']));_0x49b60c['attributes']=_0x49b60c[_0x41d3('0x2d')][_0x41d3('0x2f')]?_0x49b60c[_0x41d3('0x2d')]:_0x33ecb9['model'];if(!_0x5195b2[_0x41d3('0x2a')][_0x41d3('0x30')]('nolimit')){_0x49b60c[_0x41d3('0x31')]=qs[_0x41d3('0x31')](_0x5195b2[_0x41d3('0x2a')]['limit']);_0x49b60c[_0x41d3('0x1a')]=qs[_0x41d3('0x1a')](_0x5195b2[_0x41d3('0x2a')][_0x41d3('0x1a')]);}_0x49b60c[_0x41d3('0x32')]=qs['sort'](_0x5195b2['query'][_0x41d3('0x33')]);_0x49b60c[_0x41d3('0x34')]=qs['filters'](_[_0x41d3('0x35')](_0x5195b2[_0x41d3('0x2a')],_0x33ecb9[_0x41d3('0x2b')]));if(_0x5195b2[_0x41d3('0x2a')][_0x41d3('0x36')]){_0x49b60c[_0x41d3('0x34')]=_[_0x41d3('0x37')](_0x49b60c['where'],{'$or':_[_0x41d3('0x38')](_0x55ffa5,function(_0x1710eb){if(_0x1710eb[_0x41d3('0x26')]!==_0x41d3('0x39')){var _0x2ff751={};_0x2ff751[_0x1710eb[_0x41d3('0x23')]]={'$like':'%'+_0x5195b2[_0x41d3('0x2a')]['filter']+'%'};return _0x2ff751;}})});}_0x49b60c=_[_0x41d3('0x37')]({},_0x49b60c,_0x5195b2[_0x41d3('0x3a')]);var _0x3cd960={'where':_0x49b60c[_0x41d3('0x34')]};return db[_0x41d3('0x24')][_0x41d3('0x3b')](_0x3cd960)[_0x41d3('0x1f')](function(_0xe8e888){_0x473ebe[_0x41d3('0x3b')]=_0xe8e888;if(_0x5195b2[_0x41d3('0x2a')][_0x41d3('0x3c')]){_0x49b60c['include']=[{'all':!![]}];}return db[_0x41d3('0x24')][_0x41d3('0x3d')](_0x49b60c);})[_0x41d3('0x1f')](function(_0x4da3b6){_0x473ebe[_0x41d3('0x3e')]=_0x4da3b6;return _0x473ebe;})[_0x41d3('0x1f')](respondWithFilteredResult(_0x3f7e09,_0x49b60c))[_0x41d3('0x3f')](handleError(_0x3f7e09,null));};exports['show']=function(_0x5f51aa,_0xd955e2){var _0x464a96={'raw':!![],'where':{'id':_0x5f51aa[_0x41d3('0x40')]['id']}},_0x14fcc4={};_0x14fcc4[_0x41d3('0x28')]=_['keys'](db['FaxQueueReport']['rawAttributes']);_0x14fcc4[_0x41d3('0x2a')]=_[_0x41d3('0x29')](_0x5f51aa[_0x41d3('0x2a')]);_0x14fcc4[_0x41d3('0x2b')]=_[_0x41d3('0x2c')](_0x14fcc4[_0x41d3('0x28')],_0x14fcc4[_0x41d3('0x2a')]);_0x464a96[_0x41d3('0x2d')]=_[_0x41d3('0x2c')](_0x14fcc4[_0x41d3('0x28')],qs['fields'](_0x5f51aa[_0x41d3('0x2a')]['fields']));_0x464a96[_0x41d3('0x2d')]=_0x464a96[_0x41d3('0x2d')][_0x41d3('0x2f')]?_0x464a96['attributes']:_0x14fcc4['model'];if(_0x5f51aa['query']['includeAll']){_0x464a96[_0x41d3('0x41')]=[{'all':!![]}];}_0x464a96=_['merge']({},_0x464a96,_0x5f51aa[_0x41d3('0x3a')]);return db[_0x41d3('0x24')][_0x41d3('0x42')](_0x464a96)[_0x41d3('0x1f')](handleEntityNotFound(_0xd955e2,null))['then'](respondWithResult(_0xd955e2,null))[_0x41d3('0x3f')](handleError(_0xd955e2,null));};exports['create']=function(_0x369c79,_0x451c32){return db[_0x41d3('0x24')][_0x41d3('0x43')](_0x369c79[_0x41d3('0x44')],{})[_0x41d3('0x1f')](respondWithResult(_0x451c32,0xc9))[_0x41d3('0x3f')](handleError(_0x451c32,null));};exports['update']=function(_0x234d5f,_0x84b32){if(_0x234d5f[_0x41d3('0x44')]['id']){delete _0x234d5f['body']['id'];}return db[_0x41d3('0x24')][_0x41d3('0x42')]({'where':{'id':_0x234d5f['params']['id']}})['then'](handleEntityNotFound(_0x84b32,null))[_0x41d3('0x1f')](saveUpdates(_0x234d5f[_0x41d3('0x44')],null))['then'](respondWithResult(_0x84b32,null))[_0x41d3('0x3f')](handleError(_0x84b32,null));};exports[_0x41d3('0x20')]=function(_0x1fe1a5,_0x201cf4){return db[_0x41d3('0x24')][_0x41d3('0x42')]({'where':{'id':_0x1fe1a5[_0x41d3('0x40')]['id']}})[_0x41d3('0x1f')](handleEntityNotFound(_0x201cf4,null))['then'](removeEntity(_0x201cf4,null))['catch'](handleError(_0x201cf4,null));};exports[_0x41d3('0x45')]=function(_0x350bbc,_0x45b69f){return db[_0x41d3('0x24')][_0x41d3('0x45')]()[_0x41d3('0x1f')](respondWithResult(_0x45b69f,null))[_0x41d3('0x3f')](handleError(_0x45b69f,null));}; \ No newline at end of file +var _0x4fed=['Content-Range','apply','save','update','then','error','name','index','FaxQueueReport','rawAttributes','type','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','options','count','includeAll','rows','catch','show','params','keys','include','create','body','destroy','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set'];(function(_0x2b1239,_0x1e5a05){var _0x40b65d=function(_0x3cf351){while(--_0x3cf351){_0x2b1239['push'](_0x2b1239['shift']());}};_0x40b65d(++_0x1e5a05);}(_0x4fed,0xc0));var _0xd4fe=function(_0x305c31,_0x466b17){_0x305c31=_0x305c31-0x0;var _0x17f39f=_0x4fed[_0x305c31];return _0x17f39f;};'use strict';var pdf=require(_0xd4fe('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd4fe('0x1'));var zipdir=require(_0xd4fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd4fe('0x3'));var moment=require(_0xd4fe('0x4'));var BPromise=require(_0xd4fe('0x5'));var Mustache=require(_0xd4fe('0x6'));var util=require(_0xd4fe('0x7'));var path=require(_0xd4fe('0x8'));var sox=require(_0xd4fe('0x9'));var csv=require(_0xd4fe('0xa'));var ejs=require(_0xd4fe('0xb'));var fs=require('fs');var _=require(_0xd4fe('0xc'));var squel=require(_0xd4fe('0xd'));var crypto=require(_0xd4fe('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd4fe('0xf'));var toCsv=require(_0xd4fe('0xa'));var querystring=require(_0xd4fe('0x10'));var Papa=require(_0xd4fe('0x11'));var Redis=require(_0xd4fe('0x12'));var authService=require(_0xd4fe('0x13'));var qs=require(_0xd4fe('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4fe('0x15'));var logger=require(_0xd4fe('0x16'))(_0xd4fe('0x17'));var utils=require(_0xd4fe('0x18'));var config=require(_0xd4fe('0x19'));var db=require(_0xd4fe('0x1a'))['db'];function respondWithStatusCode(_0x3efeb8,_0x342310){_0x342310=_0x342310||0xcc;return function(_0x81db1d){if(_0x81db1d){return _0x3efeb8[_0xd4fe('0x1b')](_0x342310);}return _0x3efeb8['status'](_0x342310)[_0xd4fe('0x1c')]();};}function respondWithResult(_0x467692,_0x2d191a){_0x2d191a=_0x2d191a||0xc8;return function(_0x5899a2){if(_0x5899a2){return _0x467692[_0xd4fe('0x1d')](_0x2d191a)[_0xd4fe('0x1e')](_0x5899a2);}};}function respondWithFilteredResult(_0x42f4ca,_0x505b25){return function(_0x357606){if(_0x357606){var _0x5ba0c1=_0x357606['count'],_0xe762f6=_0x505b25[_0xd4fe('0x1f')],_0x461ac1=_0x505b25[_0xd4fe('0x1f')]+_0x505b25['limit'],_0x2c7c67;if(_0x461ac1>=_0x5ba0c1){_0x461ac1=_0x5ba0c1;_0x2c7c67=0xc8;}else{_0x2c7c67=0xce;}_0x42f4ca[_0xd4fe('0x1d')](_0x2c7c67);return _0x42f4ca[_0xd4fe('0x20')](_0xd4fe('0x21'),_0xe762f6+'-'+_0x461ac1+'/'+_0x5ba0c1)[_0xd4fe('0x1e')](_0x357606);}return null;};}function patchUpdates(_0x379581){return function(_0x3d0c2f){try{jsonpatch[_0xd4fe('0x22')](_0x3d0c2f,_0x379581,!![]);}catch(_0x356082){return BPromise['reject'](_0x356082);}return _0x3d0c2f[_0xd4fe('0x23')]();};}function saveUpdates(_0x3c2181,_0x193fc4){return function(_0x11016a){if(_0x11016a){return _0x11016a[_0xd4fe('0x24')](_0x3c2181)[_0xd4fe('0x25')](function(_0x16c765){return _0x16c765;});}return null;};}function removeEntity(_0x1d2ad7,_0x1dfabb){return function(_0x157ad5){if(_0x157ad5){return _0x157ad5['destroy']()[_0xd4fe('0x25')](function(){_0x1d2ad7[_0xd4fe('0x1d')](0xcc)[_0xd4fe('0x1c')]();});}};}function handleEntityNotFound(_0x15d82a,_0x5ae100){return function(_0x38dbb3){if(!_0x38dbb3){_0x15d82a['sendStatus'](0x194);}return _0x38dbb3;};}function handleError(_0x5b4b05,_0x4033d8){_0x4033d8=_0x4033d8||0x1f4;return function(_0x3a64e5){logger[_0xd4fe('0x26')](_0x3a64e5['stack']);if(_0x3a64e5[_0xd4fe('0x27')]){delete _0x3a64e5['name'];}_0x5b4b05[_0xd4fe('0x1d')](_0x4033d8)['send'](_0x3a64e5);};}exports[_0xd4fe('0x28')]=function(_0x38a4fc,_0x1d35a4){var _0xf6ea5f={},_0x2bc038={},_0x4659cb={'count':0x0,'rows':[]};var _0x13ec03=_['map'](db[_0xd4fe('0x29')][_0xd4fe('0x2a')],function(_0x370e7c){return{'name':_0x370e7c['fieldName'],'type':_0x370e7c[_0xd4fe('0x2b')][_0xd4fe('0x2c')]};});_0x2bc038['model']=_[_0xd4fe('0x2d')](_0x13ec03,_0xd4fe('0x27'));_0x2bc038[_0xd4fe('0x2e')]=_['keys'](_0x38a4fc[_0xd4fe('0x2e')]);_0x2bc038[_0xd4fe('0x2f')]=_['intersection'](_0x2bc038[_0xd4fe('0x30')],_0x2bc038[_0xd4fe('0x2e')]);_0xf6ea5f[_0xd4fe('0x31')]=_[_0xd4fe('0x32')](_0x2bc038[_0xd4fe('0x30')],qs[_0xd4fe('0x33')](_0x38a4fc[_0xd4fe('0x2e')]['fields']));_0xf6ea5f[_0xd4fe('0x31')]=_0xf6ea5f['attributes'][_0xd4fe('0x34')]?_0xf6ea5f[_0xd4fe('0x31')]:_0x2bc038[_0xd4fe('0x30')];if(!_0x38a4fc[_0xd4fe('0x2e')][_0xd4fe('0x35')](_0xd4fe('0x36'))){_0xf6ea5f[_0xd4fe('0x37')]=qs['limit'](_0x38a4fc[_0xd4fe('0x2e')]['limit']);_0xf6ea5f[_0xd4fe('0x1f')]=qs['offset'](_0x38a4fc[_0xd4fe('0x2e')][_0xd4fe('0x1f')]);}_0xf6ea5f[_0xd4fe('0x38')]=qs[_0xd4fe('0x39')](_0x38a4fc[_0xd4fe('0x2e')]['sort']);_0xf6ea5f[_0xd4fe('0x3a')]=qs[_0xd4fe('0x2f')](_[_0xd4fe('0x3b')](_0x38a4fc['query'],_0x2bc038[_0xd4fe('0x2f')]));if(_0x38a4fc['query']['filter']){_0xf6ea5f[_0xd4fe('0x3a')]=_[_0xd4fe('0x3c')](_0xf6ea5f[_0xd4fe('0x3a')],{'$or':_[_0xd4fe('0x2d')](_0x13ec03,function(_0x52b9a2){if(_0x52b9a2[_0xd4fe('0x2b')]!=='VIRTUAL'){var _0x523500={};_0x523500[_0x52b9a2[_0xd4fe('0x27')]]={'$like':'%'+_0x38a4fc[_0xd4fe('0x2e')][_0xd4fe('0x3d')]+'%'};return _0x523500;}})});}_0xf6ea5f=_['merge']({},_0xf6ea5f,_0x38a4fc[_0xd4fe('0x3e')]);var _0x422e1a={'where':_0xf6ea5f[_0xd4fe('0x3a')]};return db[_0xd4fe('0x29')][_0xd4fe('0x3f')](_0x422e1a)[_0xd4fe('0x25')](function(_0x3d0ed9){_0x4659cb[_0xd4fe('0x3f')]=_0x3d0ed9;if(_0x38a4fc['query'][_0xd4fe('0x40')]){_0xf6ea5f['include']=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0xf6ea5f);})[_0xd4fe('0x25')](function(_0x263e6c){_0x4659cb[_0xd4fe('0x41')]=_0x263e6c;return _0x4659cb;})[_0xd4fe('0x25')](respondWithFilteredResult(_0x1d35a4,_0xf6ea5f))[_0xd4fe('0x42')](handleError(_0x1d35a4,null));};exports[_0xd4fe('0x43')]=function(_0xe7f50b,_0x2bee93){var _0x562a4a={'raw':!![],'where':{'id':_0xe7f50b[_0xd4fe('0x44')]['id']}},_0x1dfcb6={};_0x1dfcb6[_0xd4fe('0x30')]=_[_0xd4fe('0x45')](db[_0xd4fe('0x29')]['rawAttributes']);_0x1dfcb6[_0xd4fe('0x2e')]=_['keys'](_0xe7f50b[_0xd4fe('0x2e')]);_0x1dfcb6[_0xd4fe('0x2f')]=_[_0xd4fe('0x32')](_0x1dfcb6[_0xd4fe('0x30')],_0x1dfcb6[_0xd4fe('0x2e')]);_0x562a4a[_0xd4fe('0x31')]=_[_0xd4fe('0x32')](_0x1dfcb6[_0xd4fe('0x30')],qs[_0xd4fe('0x33')](_0xe7f50b[_0xd4fe('0x2e')][_0xd4fe('0x33')]));_0x562a4a[_0xd4fe('0x31')]=_0x562a4a[_0xd4fe('0x31')]['length']?_0x562a4a[_0xd4fe('0x31')]:_0x1dfcb6[_0xd4fe('0x30')];if(_0xe7f50b[_0xd4fe('0x2e')][_0xd4fe('0x40')]){_0x562a4a[_0xd4fe('0x46')]=[{'all':!![]}];}_0x562a4a=_['merge']({},_0x562a4a,_0xe7f50b[_0xd4fe('0x3e')]);return db[_0xd4fe('0x29')]['find'](_0x562a4a)[_0xd4fe('0x25')](handleEntityNotFound(_0x2bee93,null))[_0xd4fe('0x25')](respondWithResult(_0x2bee93,null))['catch'](handleError(_0x2bee93,null));};exports[_0xd4fe('0x47')]=function(_0x8cc634,_0x21a33e){return db[_0xd4fe('0x29')][_0xd4fe('0x47')](_0x8cc634[_0xd4fe('0x48')],{})['then'](respondWithResult(_0x21a33e,0xc9))['catch'](handleError(_0x21a33e,null));};exports[_0xd4fe('0x24')]=function(_0x384add,_0x80d5e5){if(_0x384add['body']['id']){delete _0x384add[_0xd4fe('0x48')]['id'];}return db[_0xd4fe('0x29')]['find']({'where':{'id':_0x384add[_0xd4fe('0x44')]['id']}})['then'](handleEntityNotFound(_0x80d5e5,null))['then'](saveUpdates(_0x384add[_0xd4fe('0x48')],null))[_0xd4fe('0x25')](respondWithResult(_0x80d5e5,null))[_0xd4fe('0x42')](handleError(_0x80d5e5,null));};exports[_0xd4fe('0x49')]=function(_0x245f12,_0xd53a4f){return db[_0xd4fe('0x29')]['find']({'where':{'id':_0x245f12[_0xd4fe('0x44')]['id']}})[_0xd4fe('0x25')](handleEntityNotFound(_0xd53a4f,null))[_0xd4fe('0x25')](removeEntity(_0xd53a4f,null))[_0xd4fe('0x42')](handleError(_0xd53a4f,null));};exports[_0xd4fe('0x4a')]=function(_0x2bcbe5,_0x24e98b){return db['FaxQueueReport'][_0xd4fe('0x4a')]()[_0xd4fe('0x25')](respondWithResult(_0x24e98b,null))['catch'](handleError(_0x24e98b,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 4b281d2..ff965d6 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 _0xaf92=['define','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxQueueReport.attributes'];(function(_0x24eb13,_0x9bf446){var _0x36d230=function(_0x5308a7){while(--_0x5308a7){_0x24eb13['push'](_0x24eb13['shift']());}};_0x36d230(++_0x9bf446);}(_0xaf92,0x1f2));var _0x2af9=function(_0x41b02d,_0x162a8a){_0x41b02d=_0x41b02d-0x0;var _0x48a625=_0xaf92[_0x41b02d];return _0x48a625;};'use strict';var _=require(_0x2af9('0x0'));var util=require('util');var logger=require(_0x2af9('0x1'))(_0x2af9('0x2'));var moment=require(_0x2af9('0x3'));var BPromise=require(_0x2af9('0x4'));var rp=require(_0x2af9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2af9('0x6'));var config=require(_0x2af9('0x7'));var attributes=require(_0x2af9('0x8'));module['exports']=function(_0x30a73a,_0x2e09df){return _0x30a73a[_0x2af9('0x9')](_0x2af9('0xa'),attributes,{'tableName':_0x2af9('0xb'),'paranoid':![],'indexes':[{'name':_0x2af9('0xc'),'fields':[_0x2af9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde1b=['FaxQueueReport','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define'];(function(_0x4694a2,_0x1a4a32){var _0x3eb1c5=function(_0x1ed15b){while(--_0x1ed15b){_0x4694a2['push'](_0x4694a2['shift']());}};_0x3eb1c5(++_0x1a4a32);}(_0xde1b,0x145));var _0xbde1=function(_0x29b62d,_0x2677b3){_0x29b62d=_0x29b62d-0x0;var _0x436ead=_0xde1b[_0x29b62d];return _0x436ead;};'use strict';var _=require(_0xbde1('0x0'));var util=require(_0xbde1('0x1'));var logger=require(_0xbde1('0x2'))(_0xbde1('0x3'));var moment=require('moment');var BPromise=require(_0xbde1('0x4'));var rp=require(_0xbde1('0x5'));var fs=require('fs');var path=require(_0xbde1('0x6'));var rimraf=require('rimraf');var config=require(_0xbde1('0x7'));var attributes=require(_0xbde1('0x8'));module[_0xbde1('0x9')]=function(_0x574c44,_0x57e808){return _0x574c44[_0xbde1('0xa')](_0xbde1('0xb'),attributes,{'tableName':_0xbde1('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xbde1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index e128d9c..b4b0101 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 _0x3557=['debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','create','body','options','CreateFaxQueueReport','update','raw','where','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x8aa09a,_0x494414){var _0x5ca335=function(_0x4d8775){while(--_0x4d8775){_0x8aa09a['push'](_0x8aa09a['shift']());}};_0x5ca335(++_0x494414);}(_0x3557,0x1b2));var _0x7355=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0x3557[_0x22ffbf];return _0x360c17;};'use strict';var _=require(_0x7355('0x0'));var util=require(_0x7355('0x1'));var moment=require(_0x7355('0x2'));var BPromise=require(_0x7355('0x3'));var rs=require(_0x7355('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7355('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7355('0x6'))('rpc');var config=require(_0x7355('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7355('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31e57e,_0xb0aeed,_0x27affc){return new BPromise(function(_0x2ad70b,_0x30eeb5){return client[_0x7355('0x9')](_0x31e57e,_0x27affc)[_0x7355('0xa')](function(_0x1c7524){logger[_0x7355('0xb')](_0x7355('0xc'),_0xb0aeed,_0x7355('0xd'));logger[_0x7355('0xe')](_0x7355('0xf'),_0xb0aeed,_0x7355('0xd'),JSON[_0x7355('0x10')](_0x1c7524));if(_0x1c7524['error']){if(_0x1c7524['error'][_0x7355('0x11')]===0x1f4){logger[_0x7355('0x12')](_0x7355('0xc'),_0xb0aeed,_0x1c7524[_0x7355('0x12')][_0x7355('0x13')]);return _0x30eeb5(_0x1c7524[_0x7355('0x12')][_0x7355('0x13')]);}logger[_0x7355('0x12')](_0x7355('0xc'),_0xb0aeed,_0x1c7524['error'][_0x7355('0x13')]);return _0x2ad70b(_0x1c7524[_0x7355('0x12')][_0x7355('0x13')]);}else{logger[_0x7355('0xb')](_0x7355('0xc'),_0xb0aeed,'request\x20sent');_0x2ad70b(_0x1c7524[_0x7355('0x14')][_0x7355('0x13')]);}})[_0x7355('0x15')](function(_0x28b285){logger[_0x7355('0x12')](_0x7355('0xc'),_0xb0aeed,_0x28b285);_0x30eeb5(_0x28b285);});});}exports['CreateFaxQueueReport']=function(_0x5c0479){var _0x3b43c8=this;return new Promise(function(_0x4e99e7,_0x5c6be4){return db['FaxQueueReport'][_0x7355('0x16')](_0x5c0479[_0x7355('0x17')],{'raw':_0x5c0479[_0x7355('0x18')]?_0x5c0479['options']['raw']===undefined?!![]:![]:!![]})[_0x7355('0xa')](function(_0x20088f){logger[_0x7355('0xb')](_0x7355('0x19'),_0x5c0479);logger['debug'](_0x7355('0x19'),_0x5c0479,JSON[_0x7355('0x10')](_0x20088f));_0x4e99e7(_0x20088f);})[_0x7355('0x15')](function(_0x370e55){logger['error'](_0x7355('0x19'),_0x370e55[_0x7355('0x13')],_0x5c0479);_0x5c6be4(_0x3b43c8['error'](0x1f4,_0x370e55[_0x7355('0x13')]));});});};exports['UpdateFaxQueueReport']=function(_0x208709){var _0x4d91fd=this;return new Promise(function(_0x583d98,_0x5a3ce5){return db['FaxQueueReport'][_0x7355('0x1a')](_0x208709[_0x7355('0x17')],{'raw':_0x208709[_0x7355('0x18')]?_0x208709[_0x7355('0x18')][_0x7355('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x208709[_0x7355('0x18')]?_0x208709[_0x7355('0x18')][_0x7355('0x1c')]||null:null,'attributes':_0x208709[_0x7355('0x18')]?_0x208709[_0x7355('0x18')][_0x7355('0x1d')]||null:null,'limit':_0x208709[_0x7355('0x18')]?_0x208709[_0x7355('0x18')][_0x7355('0x1e')]||null:null})[_0x7355('0xa')](function(_0x253e54){logger[_0x7355('0xb')]('UpdateFaxQueueReport',_0x208709);logger[_0x7355('0xe')](_0x7355('0x1f'),_0x208709,JSON[_0x7355('0x10')](_0x253e54));_0x583d98(_0x253e54);})['catch'](function(_0x1e6877){logger[_0x7355('0x12')](_0x7355('0x1f'),_0x1e6877['message'],_0x208709);_0x5a3ce5(_0x4d91fd[_0x7355('0x12')](0x1f4,_0x1e6877[_0x7355('0x13')]));});});}; \ No newline at end of file +var _0x4c09=['debug','request\x20sent','stringify','error','code','message','info','result','catch','CreateFaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','FaxQueueReport','update','where','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','FaxQueueReport,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c09,0x187));var _0x94c0=function(_0x4f6259,_0x35094b){_0x4f6259=_0x4f6259-0x0;var _0x35f1bb=_0x4c09[_0x4f6259];return _0x35f1bb;};'use strict';var _=require(_0x94c0('0x0'));var util=require(_0x94c0('0x1'));var moment=require(_0x94c0('0x2'));var BPromise=require(_0x94c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x94c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x94c0('0x5'));var logger=require('../../config/logger')(_0x94c0('0x6'));var config=require('../../config/environment');var jayson=require(_0x94c0('0x7'));var client=jayson['client'][_0x94c0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9e792b,_0x3276dc,_0x59d3e3){return new BPromise(function(_0x11586a,_0x5f3bf7){return client[_0x94c0('0x9')](_0x9e792b,_0x59d3e3)[_0x94c0('0xa')](function(_0x31cd69){logger['info'](_0x94c0('0xb'),_0x3276dc,'request\x20sent');logger[_0x94c0('0xc')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x3276dc,_0x94c0('0xd'),JSON[_0x94c0('0xe')](_0x31cd69));if(_0x31cd69[_0x94c0('0xf')]){if(_0x31cd69['error'][_0x94c0('0x10')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x3276dc,_0x31cd69[_0x94c0('0xf')][_0x94c0('0x11')]);return _0x5f3bf7(_0x31cd69[_0x94c0('0xf')][_0x94c0('0x11')]);}logger['error'](_0x94c0('0xb'),_0x3276dc,_0x31cd69[_0x94c0('0xf')][_0x94c0('0x11')]);return _0x11586a(_0x31cd69['error'][_0x94c0('0x11')]);}else{logger[_0x94c0('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x3276dc,_0x94c0('0xd'));_0x11586a(_0x31cd69[_0x94c0('0x13')][_0x94c0('0x11')]);}})[_0x94c0('0x14')](function(_0x498f1f){logger['error'](_0x94c0('0xb'),_0x3276dc,_0x498f1f);_0x5f3bf7(_0x498f1f);});});}exports[_0x94c0('0x15')]=function(_0x474638){var _0xc5f104=this;return new Promise(function(_0x6c821c,_0x2f76c0){return db['FaxQueueReport'][_0x94c0('0x16')](_0x474638[_0x94c0('0x17')],{'raw':_0x474638[_0x94c0('0x18')]?_0x474638[_0x94c0('0x18')][_0x94c0('0x19')]===undefined?!![]:![]:!![]})[_0x94c0('0xa')](function(_0x20115f){logger[_0x94c0('0x12')](_0x94c0('0x15'),_0x474638);logger['debug']('CreateFaxQueueReport',_0x474638,JSON['stringify'](_0x20115f));_0x6c821c(_0x20115f);})[_0x94c0('0x14')](function(_0x2c27c7){logger[_0x94c0('0xf')](_0x94c0('0x15'),_0x2c27c7[_0x94c0('0x11')],_0x474638);_0x2f76c0(_0xc5f104['error'](0x1f4,_0x2c27c7['message']));});});};exports[_0x94c0('0x1a')]=function(_0x421258){var _0x31e217=this;return new Promise(function(_0x577cf9,_0x7e6823){return db[_0x94c0('0x1b')][_0x94c0('0x1c')](_0x421258[_0x94c0('0x17')],{'raw':_0x421258['options']?_0x421258[_0x94c0('0x18')][_0x94c0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x421258[_0x94c0('0x18')]?_0x421258[_0x94c0('0x18')][_0x94c0('0x1d')]||null:null,'attributes':_0x421258[_0x94c0('0x18')]?_0x421258[_0x94c0('0x18')]['attributes']||null:null,'limit':_0x421258['options']?_0x421258[_0x94c0('0x18')][_0x94c0('0x1e')]||null:null})['then'](function(_0x1da5df){logger['info'](_0x94c0('0x1a'),_0x421258);logger['debug'](_0x94c0('0x1a'),_0x421258,JSON['stringify'](_0x1da5df));_0x577cf9(_0x1da5df);})[_0x94c0('0x14')](function(_0x32bcb7){logger['error']('UpdateFaxQueueReport',_0x32bcb7['message'],_0x421258);_0x7e6823(_0x31e217[_0x94c0('0xf')](0x1f4,_0x32bcb7[_0x94c0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 78c72bb..6159dee 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 _0x2409=['../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','delete','destroy','multer','path','connect-timeout','express','Router'];(function(_0x41c7f9,_0x18ef19){var _0x39514b=function(_0x5294e0){while(--_0x5294e0){_0x41c7f9['push'](_0x41c7f9['shift']());}};_0x39514b(++_0x18ef19);}(_0x2409,0x8b));var _0x9240=function(_0x2e0ed0,_0x47f705){_0x2e0ed0=_0x2e0ed0-0x0;var _0x3ea186=_0x2409[_0x2e0ed0];return _0x3ea186;};'use strict';var multer=require(_0x9240('0x0'));var util=require('util');var path=require(_0x9240('0x1'));var timeout=require(_0x9240('0x2'));var express=require(_0x9240('0x3'));var router=express[_0x9240('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9240('0x5'));var config=require('../../config/environment');var controller=require(_0x9240('0x6'));router[_0x9240('0x7')]('/',auth[_0x9240('0x8')](),controller[_0x9240('0x9')]);router['get']('/describe',auth[_0x9240('0x8')](),controller[_0x9240('0xa')]);router[_0x9240('0x7')](_0x9240('0xb'),auth['isAuthenticated'](),controller[_0x9240('0xc')]);router[_0x9240('0xd')]('/',auth[_0x9240('0x8')](),controller[_0x9240('0xe')]);router[_0x9240('0xf')](_0x9240('0xb'),auth[_0x9240('0x8')](),controller['update']);router[_0x9240('0x10')](_0x9240('0xb'),auth[_0x9240('0x8')](),controller[_0x9240('0x11')]);module['exports']=router; \ No newline at end of file +var _0xc46c=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','isAuthenticated','get','/describe','describe','show','post','/:id','update'];(function(_0x41a7dd,_0x2cc7b6){var _0x4db8dc=function(_0x3fbd5d){while(--_0x3fbd5d){_0x41a7dd['push'](_0x41a7dd['shift']());}};_0x4db8dc(++_0x2cc7b6);}(_0xc46c,0x133));var _0xcc46=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0xc46c[_0x86b219];return _0x1f320c;};'use strict';var multer=require(_0xcc46('0x0'));var util=require(_0xcc46('0x1'));var path=require(_0xcc46('0x2'));var timeout=require(_0xcc46('0x3'));var express=require('express');var router=express[_0xcc46('0x4')]();var auth=require(_0xcc46('0x5'));var interaction=require(_0xcc46('0x6'));var config=require('../../config/environment');var controller=require(_0xcc46('0x7'));router['get']('/',auth[_0xcc46('0x8')](),controller['index']);router[_0xcc46('0x9')](_0xcc46('0xa'),auth[_0xcc46('0x8')](),controller[_0xcc46('0xb')]);router[_0xcc46('0x9')]('/:id',auth[_0xcc46('0x8')](),controller[_0xcc46('0xc')]);router[_0xcc46('0xd')]('/',auth[_0xcc46('0x8')](),controller['create']);router['put'](_0xcc46('0xe'),auth[_0xcc46('0x8')](),controller[_0xcc46('0xf')]);router[_0xcc46('0x10')](_0xcc46('0xe'),auth[_0xcc46('0x8')](),controller[_0xcc46('0x11')]);module[_0xcc46('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 9554f1c..e57e739 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 _0x1d97=['exports','STRING','account','agent','DATE','NOW','sequelize'];(function(_0x43444b,_0x8cf95b){var _0x392fe5=function(_0x7a1a82){while(--_0x7a1a82){_0x43444b['push'](_0x43444b['shift']());}};_0x392fe5(++_0x8cf95b);}(_0x1d97,0x13a));var _0x71d9=function(_0x246355,_0x329100){_0x246355=_0x246355-0x0;var _0x306e3b=_0x1d97[_0x246355];return _0x306e3b;};'use strict';var moment=require('moment');var Sequelize=require(_0x71d9('0x0'));module[_0x71d9('0x1')]={'uniqueid':{'type':Sequelize[_0x71d9('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x71d9('0x3'),_0x71d9('0x4'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x71d9('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x71d9('0x6')]}}; \ No newline at end of file +var _0xdaca=['ENUM','account','queue','DATE','NOW','moment','sequelize','STRING'];(function(_0x1e7984,_0x3b0903){var _0x42d88d=function(_0x3a7822){while(--_0x3a7822){_0x1e7984['push'](_0x1e7984['shift']());}};_0x42d88d(++_0x3b0903);}(_0xdaca,0x1d5));var _0xadac=function(_0x2e74af,_0x309a4f){_0x2e74af=_0x2e74af-0x0;var _0xcd7e8f=_0xdaca[_0x2e74af];return _0xcd7e8f;};'use strict';var moment=require(_0xadac('0x0'));var Sequelize=require(_0xadac('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xadac('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xadac('0x3')](_0xadac('0x4'),'agent',_0xadac('0x5')),'allowNull':![],'defaultValue':_0xadac('0x5')},'transferredAt':{'type':Sequelize[_0xadac('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xadac('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 4bb7acb..42edd90 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 _0x3232=['body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','FaxTransferReport','findAll','rows','show','params','length','include','catch','create'];(function(_0x4a0a69,_0x56acd5){var _0x14abbf=function(_0x3e0854){while(--_0x3e0854){_0x4a0a69['push'](_0x4a0a69['shift']());}};_0x14abbf(++_0x56acd5);}(_0x3232,0x9f));var _0x2323=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3232[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2323('0x0'));var rimraf=require(_0x2323('0x1'));var zipdir=require(_0x2323('0x2'));var jsonpatch=require(_0x2323('0x3'));var rp=require(_0x2323('0x4'));var moment=require(_0x2323('0x5'));var BPromise=require(_0x2323('0x6'));var Mustache=require(_0x2323('0x7'));var util=require(_0x2323('0x8'));var path=require(_0x2323('0x9'));var sox=require(_0x2323('0xa'));var csv=require(_0x2323('0xb'));var ejs=require(_0x2323('0xc'));var fs=require('fs');var _=require(_0x2323('0xd'));var squel=require(_0x2323('0xe'));var crypto=require(_0x2323('0xf'));var jsforce=require(_0x2323('0x10'));var deskjs=require(_0x2323('0x11'));var toCsv=require(_0x2323('0xb'));var querystring=require(_0x2323('0x12'));var Papa=require(_0x2323('0x13'));var Redis=require(_0x2323('0x14'));var authService=require(_0x2323('0x15'));var qs=require(_0x2323('0x16'));var as=require(_0x2323('0x17'));var hardwareService=require(_0x2323('0x18'));var logger=require('../../config/logger')(_0x2323('0x19'));var utils=require('../../config/utils');var config=require(_0x2323('0x1a'));var db=require(_0x2323('0x1b'))['db'];function respondWithStatusCode(_0x117a41,_0x3d7796){_0x3d7796=_0x3d7796||0xcc;return function(_0x5ccac8){if(_0x5ccac8){return _0x117a41[_0x2323('0x1c')](_0x3d7796);}return _0x117a41[_0x2323('0x1d')](_0x3d7796)[_0x2323('0x1e')]();};}function respondWithResult(_0x5c1413,_0x165832){_0x165832=_0x165832||0xc8;return function(_0x1bbff2){if(_0x1bbff2){return _0x5c1413['status'](_0x165832)[_0x2323('0x1f')](_0x1bbff2);}};}function respondWithFilteredResult(_0x505222,_0x351dcf){return function(_0x46a2e1){if(_0x46a2e1){var _0x354169=_0x46a2e1[_0x2323('0x20')],_0x5c46fc=_0x351dcf[_0x2323('0x21')],_0x5e77e5=_0x351dcf[_0x2323('0x21')]+_0x351dcf[_0x2323('0x22')],_0x2347fe;if(_0x5e77e5>=_0x354169){_0x5e77e5=_0x354169;_0x2347fe=0xc8;}else{_0x2347fe=0xce;}_0x505222[_0x2323('0x1d')](_0x2347fe);return _0x505222[_0x2323('0x23')](_0x2323('0x24'),_0x5c46fc+'-'+_0x5e77e5+'/'+_0x354169)[_0x2323('0x1f')](_0x46a2e1);}return null;};}function patchUpdates(_0x40284b){return function(_0x278458){try{jsonpatch[_0x2323('0x25')](_0x278458,_0x40284b,!![]);}catch(_0x488e70){return BPromise['reject'](_0x488e70);}return _0x278458[_0x2323('0x26')]();};}function saveUpdates(_0x4f7d73,_0x23526b){return function(_0x165bf2){if(_0x165bf2){return _0x165bf2[_0x2323('0x27')](_0x4f7d73)[_0x2323('0x28')](function(_0x3d1b07){return _0x3d1b07;});}return null;};}function removeEntity(_0x2e5234,_0x5846e5){return function(_0x17498b){if(_0x17498b){return _0x17498b[_0x2323('0x29')]()['then'](function(){_0x2e5234['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f2f26,_0x128aa6){return function(_0x5e11b1){if(!_0x5e11b1){_0x1f2f26['sendStatus'](0x194);}return _0x5e11b1;};}function handleError(_0x50edf9,_0x53730c){_0x53730c=_0x53730c||0x1f4;return function(_0x5d2515){logger['error'](_0x5d2515[_0x2323('0x2a')]);if(_0x5d2515[_0x2323('0x2b')]){delete _0x5d2515[_0x2323('0x2b')];}_0x50edf9[_0x2323('0x1d')](_0x53730c)[_0x2323('0x2c')](_0x5d2515);};}exports[_0x2323('0x2d')]=function(_0x3bfe67,_0x4c760b){var _0x172a81={},_0x23dcbf={},_0x1acf4d={'count':0x0,'rows':[]};var _0x4ea3dc=_[_0x2323('0x2e')](db['FaxTransferReport'][_0x2323('0x2f')],function(_0x2dae31){return{'name':_0x2dae31[_0x2323('0x30')],'type':_0x2dae31['type']['key']};});_0x23dcbf['model']=_['map'](_0x4ea3dc,'name');_0x23dcbf[_0x2323('0x31')]=_[_0x2323('0x32')](_0x3bfe67['query']);_0x23dcbf[_0x2323('0x33')]=_['intersection'](_0x23dcbf[_0x2323('0x34')],_0x23dcbf['query']);_0x172a81[_0x2323('0x35')]=_[_0x2323('0x36')](_0x23dcbf['model'],qs[_0x2323('0x37')](_0x3bfe67[_0x2323('0x31')][_0x2323('0x37')]));_0x172a81['attributes']=_0x172a81[_0x2323('0x35')]['length']?_0x172a81[_0x2323('0x35')]:_0x23dcbf[_0x2323('0x34')];if(!_0x3bfe67[_0x2323('0x31')][_0x2323('0x38')](_0x2323('0x39'))){_0x172a81['limit']=qs[_0x2323('0x22')](_0x3bfe67[_0x2323('0x31')]['limit']);_0x172a81[_0x2323('0x21')]=qs['offset'](_0x3bfe67[_0x2323('0x31')]['offset']);}_0x172a81['order']=qs[_0x2323('0x3a')](_0x3bfe67[_0x2323('0x31')][_0x2323('0x3a')]);_0x172a81[_0x2323('0x3b')]=qs['filters'](_['pick'](_0x3bfe67[_0x2323('0x31')],_0x23dcbf[_0x2323('0x33')]));if(_0x3bfe67[_0x2323('0x31')][_0x2323('0x3c')]){_0x172a81[_0x2323('0x3b')]=_[_0x2323('0x3d')](_0x172a81[_0x2323('0x3b')],{'$or':_[_0x2323('0x2e')](_0x4ea3dc,function(_0xd39d75){if(_0xd39d75[_0x2323('0x3e')]!==_0x2323('0x3f')){var _0x2aff1d={};_0x2aff1d[_0xd39d75[_0x2323('0x2b')]]={'$like':'%'+_0x3bfe67[_0x2323('0x31')][_0x2323('0x3c')]+'%'};return _0x2aff1d;}})});}_0x172a81=_[_0x2323('0x3d')]({},_0x172a81,_0x3bfe67[_0x2323('0x40')]);var _0x178933={'where':_0x172a81[_0x2323('0x3b')]};return db['FaxTransferReport'][_0x2323('0x20')](_0x178933)['then'](function(_0x2a7f00){_0x1acf4d['count']=_0x2a7f00;if(_0x3bfe67[_0x2323('0x31')][_0x2323('0x41')]){_0x172a81['include']=[{'all':!![]}];}return db[_0x2323('0x42')][_0x2323('0x43')](_0x172a81);})[_0x2323('0x28')](function(_0x5db5d7){_0x1acf4d[_0x2323('0x44')]=_0x5db5d7;return _0x1acf4d;})[_0x2323('0x28')](respondWithFilteredResult(_0x4c760b,_0x172a81))['catch'](handleError(_0x4c760b,null));};exports[_0x2323('0x45')]=function(_0x52cc90,_0x293e26){var _0x5c42fc={'raw':!![],'where':{'id':_0x52cc90[_0x2323('0x46')]['id']}},_0xa2625e={};_0xa2625e['model']=_[_0x2323('0x32')](db[_0x2323('0x42')][_0x2323('0x2f')]);_0xa2625e[_0x2323('0x31')]=_['keys'](_0x52cc90['query']);_0xa2625e[_0x2323('0x33')]=_[_0x2323('0x36')](_0xa2625e[_0x2323('0x34')],_0xa2625e[_0x2323('0x31')]);_0x5c42fc[_0x2323('0x35')]=_[_0x2323('0x36')](_0xa2625e[_0x2323('0x34')],qs[_0x2323('0x37')](_0x52cc90['query'][_0x2323('0x37')]));_0x5c42fc[_0x2323('0x35')]=_0x5c42fc[_0x2323('0x35')][_0x2323('0x47')]?_0x5c42fc[_0x2323('0x35')]:_0xa2625e[_0x2323('0x34')];if(_0x52cc90['query'][_0x2323('0x41')]){_0x5c42fc[_0x2323('0x48')]=[{'all':!![]}];}_0x5c42fc=_['merge']({},_0x5c42fc,_0x52cc90[_0x2323('0x40')]);return db[_0x2323('0x42')]['find'](_0x5c42fc)[_0x2323('0x28')](handleEntityNotFound(_0x293e26,null))[_0x2323('0x28')](respondWithResult(_0x293e26,null))[_0x2323('0x49')](handleError(_0x293e26,null));};exports[_0x2323('0x4a')]=function(_0xcfc5d0,_0x1fb52a){return db[_0x2323('0x42')]['create'](_0xcfc5d0['body'],{})[_0x2323('0x28')](respondWithResult(_0x1fb52a,0xc9))[_0x2323('0x49')](handleError(_0x1fb52a,null));};exports[_0x2323('0x27')]=function(_0x17744f,_0x40ada1){if(_0x17744f[_0x2323('0x4b')]['id']){delete _0x17744f[_0x2323('0x4b')]['id'];}return db[_0x2323('0x42')]['find']({'where':{'id':_0x17744f[_0x2323('0x46')]['id']}})[_0x2323('0x28')](handleEntityNotFound(_0x40ada1,null))[_0x2323('0x28')](saveUpdates(_0x17744f['body'],null))[_0x2323('0x28')](respondWithResult(_0x40ada1,null))[_0x2323('0x49')](handleError(_0x40ada1,null));};exports[_0x2323('0x29')]=function(_0x334ab0,_0x314388){return db[_0x2323('0x42')][_0x2323('0x4c')]({'where':{'id':_0x334ab0['params']['id']}})[_0x2323('0x28')](handleEntityNotFound(_0x314388,null))[_0x2323('0x28')](removeEntity(_0x314388,null))[_0x2323('0x49')](handleError(_0x314388,null));};exports[_0x2323('0x4d')]=function(_0x3c5083,_0x243b47){return db['FaxTransferReport'][_0x2323('0x4d')]()['then'](respondWithResult(_0x243b47,null))[_0x2323('0x49')](handleError(_0x243b47,null));}; \ No newline at end of file +var _0x5545=['count','offset','set','Content-Range','update','then','destroy','stack','name','send','index','FaxTransferReport','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','keys','length','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json'];(function(_0x319a14,_0x1cfccc){var _0x34619e=function(_0x3d6df5){while(--_0x3d6df5){_0x319a14['push'](_0x319a14['shift']());}};_0x34619e(++_0x1cfccc);}(_0x5545,0x18e));var _0x5554=function(_0x5aab81,_0x10ea5b){_0x5aab81=_0x5aab81-0x0;var _0x6c61da=_0x5545[_0x5aab81];return _0x6c61da;};'use strict';var pdf=require(_0x5554('0x0'));var emlformat=require(_0x5554('0x1'));var rimraf=require(_0x5554('0x2'));var zipdir=require(_0x5554('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5554('0x4'));var moment=require(_0x5554('0x5'));var BPromise=require(_0x5554('0x6'));var Mustache=require(_0x5554('0x7'));var util=require('util');var path=require(_0x5554('0x8'));var sox=require(_0x5554('0x9'));var csv=require(_0x5554('0xa'));var ejs=require(_0x5554('0xb'));var fs=require('fs');var _=require(_0x5554('0xc'));var squel=require(_0x5554('0xd'));var crypto=require(_0x5554('0xe'));var jsforce=require(_0x5554('0xf'));var deskjs=require(_0x5554('0x10'));var toCsv=require(_0x5554('0xa'));var querystring=require(_0x5554('0x11'));var Papa=require('papaparse');var Redis=require(_0x5554('0x12'));var authService=require(_0x5554('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5554('0x14'));var logger=require('../../config/logger')(_0x5554('0x15'));var utils=require(_0x5554('0x16'));var config=require(_0x5554('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e1997,_0x41a7e3){_0x41a7e3=_0x41a7e3||0xcc;return function(_0x446c4a){if(_0x446c4a){return _0x1e1997[_0x5554('0x18')](_0x41a7e3);}return _0x1e1997[_0x5554('0x19')](_0x41a7e3)[_0x5554('0x1a')]();};}function respondWithResult(_0x32ef45,_0x3d33e6){_0x3d33e6=_0x3d33e6||0xc8;return function(_0x2c447d){if(_0x2c447d){return _0x32ef45[_0x5554('0x19')](_0x3d33e6)[_0x5554('0x1b')](_0x2c447d);}};}function respondWithFilteredResult(_0x2a29a8,_0x3482ff){return function(_0x3e4d31){if(_0x3e4d31){var _0x2df950=_0x3e4d31[_0x5554('0x1c')],_0x111135=_0x3482ff[_0x5554('0x1d')],_0x2fa446=_0x3482ff[_0x5554('0x1d')]+_0x3482ff['limit'],_0x4ee231;if(_0x2fa446>=_0x2df950){_0x2fa446=_0x2df950;_0x4ee231=0xc8;}else{_0x4ee231=0xce;}_0x2a29a8[_0x5554('0x19')](_0x4ee231);return _0x2a29a8[_0x5554('0x1e')](_0x5554('0x1f'),_0x111135+'-'+_0x2fa446+'/'+_0x2df950)[_0x5554('0x1b')](_0x3e4d31);}return null;};}function patchUpdates(_0x325786){return function(_0x9dd5ad){try{jsonpatch['apply'](_0x9dd5ad,_0x325786,!![]);}catch(_0x127509){return BPromise['reject'](_0x127509);}return _0x9dd5ad['save']();};}function saveUpdates(_0xc86fe1,_0x438b5b){return function(_0x3d28a8){if(_0x3d28a8){return _0x3d28a8[_0x5554('0x20')](_0xc86fe1)[_0x5554('0x21')](function(_0x2a656d){return _0x2a656d;});}return null;};}function removeEntity(_0x3feace,_0x4c93af){return function(_0x1032a7){if(_0x1032a7){return _0x1032a7[_0x5554('0x22')]()[_0x5554('0x21')](function(){_0x3feace[_0x5554('0x19')](0xcc)[_0x5554('0x1a')]();});}};}function handleEntityNotFound(_0x26cfb6,_0x223ffd){return function(_0x96f050){if(!_0x96f050){_0x26cfb6[_0x5554('0x18')](0x194);}return _0x96f050;};}function handleError(_0x3ff624,_0x2a7c35){_0x2a7c35=_0x2a7c35||0x1f4;return function(_0x23f3e6){logger['error'](_0x23f3e6[_0x5554('0x23')]);if(_0x23f3e6['name']){delete _0x23f3e6[_0x5554('0x24')];}_0x3ff624['status'](_0x2a7c35)[_0x5554('0x25')](_0x23f3e6);};}exports[_0x5554('0x26')]=function(_0x35002a,_0x28aead){var _0x3ca4b2={},_0x220771={},_0x365e3d={'count':0x0,'rows':[]};var _0x4d4dc5=_['map'](db[_0x5554('0x27')][_0x5554('0x28')],function(_0x42275f){return{'name':_0x42275f[_0x5554('0x29')],'type':_0x42275f[_0x5554('0x2a')]['key']};});_0x220771[_0x5554('0x2b')]=_[_0x5554('0x2c')](_0x4d4dc5,_0x5554('0x24'));_0x220771[_0x5554('0x2d')]=_['keys'](_0x35002a[_0x5554('0x2d')]);_0x220771['filters']=_[_0x5554('0x2e')](_0x220771['model'],_0x220771[_0x5554('0x2d')]);_0x3ca4b2[_0x5554('0x2f')]=_[_0x5554('0x2e')](_0x220771[_0x5554('0x2b')],qs[_0x5554('0x30')](_0x35002a[_0x5554('0x2d')][_0x5554('0x30')]));_0x3ca4b2[_0x5554('0x2f')]=_0x3ca4b2['attributes']['length']?_0x3ca4b2[_0x5554('0x2f')]:_0x220771[_0x5554('0x2b')];if(!_0x35002a[_0x5554('0x2d')][_0x5554('0x31')](_0x5554('0x32'))){_0x3ca4b2['limit']=qs[_0x5554('0x33')](_0x35002a[_0x5554('0x2d')]['limit']);_0x3ca4b2[_0x5554('0x1d')]=qs[_0x5554('0x1d')](_0x35002a['query'][_0x5554('0x1d')]);}_0x3ca4b2['order']=qs[_0x5554('0x34')](_0x35002a[_0x5554('0x2d')][_0x5554('0x34')]);_0x3ca4b2['where']=qs[_0x5554('0x35')](_[_0x5554('0x36')](_0x35002a[_0x5554('0x2d')],_0x220771['filters']));if(_0x35002a[_0x5554('0x2d')][_0x5554('0x37')]){_0x3ca4b2[_0x5554('0x38')]=_[_0x5554('0x39')](_0x3ca4b2['where'],{'$or':_[_0x5554('0x2c')](_0x4d4dc5,function(_0x4d9667){if(_0x4d9667['type']!=='VIRTUAL'){var _0x45aadf={};_0x45aadf[_0x4d9667[_0x5554('0x24')]]={'$like':'%'+_0x35002a[_0x5554('0x2d')][_0x5554('0x37')]+'%'};return _0x45aadf;}})});}_0x3ca4b2=_['merge']({},_0x3ca4b2,_0x35002a[_0x5554('0x3a')]);var _0x3e6561={'where':_0x3ca4b2[_0x5554('0x38')]};return db[_0x5554('0x27')][_0x5554('0x1c')](_0x3e6561)[_0x5554('0x21')](function(_0x29cf19){_0x365e3d['count']=_0x29cf19;if(_0x35002a[_0x5554('0x2d')][_0x5554('0x3b')]){_0x3ca4b2[_0x5554('0x3c')]=[{'all':!![]}];}return db[_0x5554('0x27')]['findAll'](_0x3ca4b2);})[_0x5554('0x21')](function(_0x2b8860){_0x365e3d[_0x5554('0x3d')]=_0x2b8860;return _0x365e3d;})[_0x5554('0x21')](respondWithFilteredResult(_0x28aead,_0x3ca4b2))[_0x5554('0x3e')](handleError(_0x28aead,null));};exports[_0x5554('0x3f')]=function(_0x42c0f1,_0x323f02){var _0x3f5ac6={'raw':!![],'where':{'id':_0x42c0f1[_0x5554('0x40')]['id']}},_0x5cc47c={};_0x5cc47c[_0x5554('0x2b')]=_[_0x5554('0x41')](db[_0x5554('0x27')][_0x5554('0x28')]);_0x5cc47c[_0x5554('0x2d')]=_[_0x5554('0x41')](_0x42c0f1[_0x5554('0x2d')]);_0x5cc47c[_0x5554('0x35')]=_[_0x5554('0x2e')](_0x5cc47c[_0x5554('0x2b')],_0x5cc47c['query']);_0x3f5ac6[_0x5554('0x2f')]=_[_0x5554('0x2e')](_0x5cc47c['model'],qs['fields'](_0x42c0f1[_0x5554('0x2d')][_0x5554('0x30')]));_0x3f5ac6[_0x5554('0x2f')]=_0x3f5ac6['attributes'][_0x5554('0x42')]?_0x3f5ac6['attributes']:_0x5cc47c[_0x5554('0x2b')];if(_0x42c0f1[_0x5554('0x2d')][_0x5554('0x3b')]){_0x3f5ac6[_0x5554('0x3c')]=[{'all':!![]}];}_0x3f5ac6=_['merge']({},_0x3f5ac6,_0x42c0f1[_0x5554('0x3a')]);return db[_0x5554('0x27')][_0x5554('0x43')](_0x3f5ac6)['then'](handleEntityNotFound(_0x323f02,null))[_0x5554('0x21')](respondWithResult(_0x323f02,null))[_0x5554('0x3e')](handleError(_0x323f02,null));};exports[_0x5554('0x44')]=function(_0x200bb6,_0x1f8eee){return db[_0x5554('0x27')]['create'](_0x200bb6[_0x5554('0x45')],{})[_0x5554('0x21')](respondWithResult(_0x1f8eee,0xc9))[_0x5554('0x3e')](handleError(_0x1f8eee,null));};exports[_0x5554('0x20')]=function(_0x3ea356,_0x274a1d){if(_0x3ea356[_0x5554('0x45')]['id']){delete _0x3ea356[_0x5554('0x45')]['id'];}return db[_0x5554('0x27')][_0x5554('0x43')]({'where':{'id':_0x3ea356['params']['id']}})[_0x5554('0x21')](handleEntityNotFound(_0x274a1d,null))['then'](saveUpdates(_0x3ea356[_0x5554('0x45')],null))[_0x5554('0x21')](respondWithResult(_0x274a1d,null))['catch'](handleError(_0x274a1d,null));};exports[_0x5554('0x22')]=function(_0x42e37a,_0x1775ee){return db[_0x5554('0x27')][_0x5554('0x43')]({'where':{'id':_0x42e37a[_0x5554('0x40')]['id']}})[_0x5554('0x21')](handleEntityNotFound(_0x1775ee,null))[_0x5554('0x21')](removeEntity(_0x1775ee,null))[_0x5554('0x3e')](handleError(_0x1775ee,null));};exports[_0x5554('0x46')]=function(_0x23175f,_0x2336ae){return db[_0x5554('0x27')][_0x5554('0x46')]()['then'](respondWithResult(_0x2336ae,null))['catch'](handleError(_0x2336ae,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index ad70775..35443e7 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 _0xf1a5=['lodash','util','api','moment','bluebird','request-promise','../../config/environment','define','FaxTransferReport','report_fax_transfer','uniqueid'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xf1a5,0x6e));var _0x5f1a=function(_0x2a3221,_0x350966){_0x2a3221=_0x2a3221-0x0;var _0x55daf9=_0xf1a5[_0x2a3221];return _0x55daf9;};'use strict';var _=require(_0x5f1a('0x0'));var util=require(_0x5f1a('0x1'));var logger=require('../../config/logger')(_0x5f1a('0x2'));var moment=require(_0x5f1a('0x3'));var BPromise=require(_0x5f1a('0x4'));var rp=require(_0x5f1a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5f1a('0x6'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x486ca8,_0x3b746b){return _0x486ca8[_0x5f1a('0x7')](_0x5f1a('0x8'),attributes,{'tableName':_0x5f1a('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5f1a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb006=['moment','bluebird','request-promise','path','../../config/environment','./faxTransferReport.attributes','define','FaxTransferReport','uniqueid','lodash','util','../../config/logger'];(function(_0x3ff3f0,_0x43e4c0){var _0x2f9b6f=function(_0x1f791e){while(--_0x1f791e){_0x3ff3f0['push'](_0x3ff3f0['shift']());}};_0x2f9b6f(++_0x43e4c0);}(_0xb006,0xbd));var _0x6b00=function(_0x35ad40,_0x51a847){_0x35ad40=_0x35ad40-0x0;var _0xf1acc=_0xb006[_0x35ad40];return _0xf1acc;};'use strict';var _=require(_0x6b00('0x0'));var util=require(_0x6b00('0x1'));var logger=require(_0x6b00('0x2'))('api');var moment=require(_0x6b00('0x3'));var BPromise=require(_0x6b00('0x4'));var rp=require(_0x6b00('0x5'));var fs=require('fs');var path=require(_0x6b00('0x6'));var rimraf=require('rimraf');var config=require(_0x6b00('0x7'));var attributes=require(_0x6b00('0x8'));module['exports']=function(_0xa559ec,_0x52c2de){return _0xa559ec[_0x6b00('0x9')](_0x6b00('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x6b00('0xb'),'fields':[_0x6b00('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 0e9c9f7..cc51948 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 _0x27b7=['message','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1e7cf4,_0x1facaa){var _0x49af32=function(_0x23667f){while(--_0x23667f){_0x1e7cf4['push'](_0x1e7cf4['shift']());}};_0x49af32(++_0x1facaa);}(_0x27b7,0x146));var _0x727b=function(_0x4dd2e4,_0x214b4c){_0x4dd2e4=_0x4dd2e4-0x0;var _0xf22084=_0x27b7[_0x4dd2e4];return _0xf22084;};'use strict';var _=require(_0x727b('0x0'));var util=require('util');var moment=require(_0x727b('0x1'));var BPromise=require('bluebird');var rs=require(_0x727b('0x2'));var fs=require('fs');var Redis=require(_0x727b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x727b('0x4'));var logger=require(_0x727b('0x5'))(_0x727b('0x6'));var config=require(_0x727b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x727b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x240017,_0x433e5b,_0x34f024){return new BPromise(function(_0x42ac21,_0x4b9650){return client[_0x727b('0x9')](_0x240017,_0x34f024)[_0x727b('0xa')](function(_0x1fe0f0){logger['info'](_0x727b('0xb'),_0x433e5b,_0x727b('0xc'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x433e5b,'request\x20sent',JSON[_0x727b('0xd')](_0x1fe0f0));if(_0x1fe0f0[_0x727b('0xe')]){if(_0x1fe0f0[_0x727b('0xe')][_0x727b('0xf')]===0x1f4){logger[_0x727b('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x433e5b,_0x1fe0f0[_0x727b('0xe')]['message']);return _0x4b9650(_0x1fe0f0['error'][_0x727b('0x10')]);}logger[_0x727b('0xe')](_0x727b('0xb'),_0x433e5b,_0x1fe0f0[_0x727b('0xe')][_0x727b('0x10')]);return _0x42ac21(_0x1fe0f0['error'][_0x727b('0x10')]);}else{logger['info'](_0x727b('0xb'),_0x433e5b,'request\x20sent');_0x42ac21(_0x1fe0f0[_0x727b('0x11')][_0x727b('0x10')]);}})['catch'](function(_0x4082f0){logger[_0x727b('0xe')](_0x727b('0xb'),_0x433e5b,_0x4082f0);_0x4b9650(_0x4082f0);});});} \ No newline at end of file +var _0xc6a6=['info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x37026d,_0x402bf4){var _0x5b1ff2=function(_0x540b82){while(--_0x540b82){_0x37026d['push'](_0x37026d['shift']());}};_0x5b1ff2(++_0x402bf4);}(_0xc6a6,0x12f));var _0x6c6a=function(_0x343376,_0x53d37f){_0x343376=_0x343376-0x0;var _0x541f7f=_0xc6a6[_0x343376];return _0x541f7f;};'use strict';var _=require('lodash');var util=require(_0x6c6a('0x0'));var moment=require(_0x6c6a('0x1'));var BPromise=require(_0x6c6a('0x2'));var rs=require(_0x6c6a('0x3'));var fs=require('fs');var Redis=require(_0x6c6a('0x4'));var db=require(_0x6c6a('0x5'))['db'];var utils=require(_0x6c6a('0x6'));var logger=require(_0x6c6a('0x7'))(_0x6c6a('0x8'));var config=require(_0x6c6a('0x9'));var jayson=require(_0x6c6a('0xa'));var client=jayson['client'][_0x6c6a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56f5fa,_0x21ac9e,_0x91cac1){return new BPromise(function(_0xcf4572,_0x48a7d7){return client[_0x6c6a('0xc')](_0x56f5fa,_0x91cac1)[_0x6c6a('0xd')](function(_0x4fcefd){logger['info'](_0x6c6a('0xe'),_0x21ac9e,_0x6c6a('0xf'));logger[_0x6c6a('0x10')](_0x6c6a('0x11'),_0x21ac9e,_0x6c6a('0xf'),JSON[_0x6c6a('0x12')](_0x4fcefd));if(_0x4fcefd[_0x6c6a('0x13')]){if(_0x4fcefd[_0x6c6a('0x13')][_0x6c6a('0x14')]===0x1f4){logger[_0x6c6a('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x21ac9e,_0x4fcefd[_0x6c6a('0x13')][_0x6c6a('0x15')]);return _0x48a7d7(_0x4fcefd[_0x6c6a('0x13')][_0x6c6a('0x15')]);}logger[_0x6c6a('0x13')](_0x6c6a('0xe'),_0x21ac9e,_0x4fcefd['error']['message']);return _0xcf4572(_0x4fcefd['error']['message']);}else{logger[_0x6c6a('0x16')](_0x6c6a('0xe'),_0x21ac9e,_0x6c6a('0xf'));_0xcf4572(_0x4fcefd[_0x6c6a('0x17')]['message']);}})[_0x6c6a('0x18')](function(_0x3a00a6){logger[_0x6c6a('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x21ac9e,_0x3a00a6);_0x48a7d7(_0x3a00a6);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index f3f1381..ab4b8f0 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 _0x4eb4=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','exports','util','path','connect-timeout'];(function(_0x4cd013,_0x8e0839){var _0x1ffa55=function(_0xa4fe40){while(--_0xa4fe40){_0x4cd013['push'](_0x4cd013['shift']());}};_0x1ffa55(++_0x8e0839);}(_0x4eb4,0x189));var _0x44eb=function(_0x1e5cc3,_0x238a87){_0x1e5cc3=_0x1e5cc3-0x0;var _0x15c596=_0x4eb4[_0x1e5cc3];return _0x15c596;};'use strict';var multer=require('multer');var util=require(_0x44eb('0x0'));var path=require(_0x44eb('0x1'));var timeout=require(_0x44eb('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x44eb('0x3'));var interaction=require(_0x44eb('0x4'));var config=require(_0x44eb('0x5'));var controller=require('./faxTransferReport.controller');router[_0x44eb('0x6')]('/',auth[_0x44eb('0x7')](),controller[_0x44eb('0x8')]);router[_0x44eb('0x6')](_0x44eb('0x9'),auth[_0x44eb('0x7')](),controller[_0x44eb('0xa')]);router[_0x44eb('0x6')](_0x44eb('0xb'),auth[_0x44eb('0x7')](),controller[_0x44eb('0xc')]);router[_0x44eb('0xd')]('/',auth[_0x44eb('0x7')](),controller[_0x44eb('0xe')]);router[_0x44eb('0xf')](_0x44eb('0xb'),auth[_0x44eb('0x7')](),controller['update']);router[_0x44eb('0x10')](_0x44eb('0xb'),auth[_0x44eb('0x7')](),controller['destroy']);module[_0x44eb('0x11')]=router; \ No newline at end of file +var _0x4349=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get'];(function(_0x3c4fa4,_0x15a295){var _0xbf822=function(_0x579a0d){while(--_0x579a0d){_0x3c4fa4['push'](_0x3c4fa4['shift']());}};_0xbf822(++_0x15a295);}(_0x4349,0x1af));var _0x9434=function(_0x427217,_0x87dd9d){_0x427217=_0x427217-0x0;var _0x281c9b=_0x4349[_0x427217];return _0x281c9b;};'use strict';var multer=require(_0x9434('0x0'));var util=require('util');var path=require(_0x9434('0x1'));var timeout=require(_0x9434('0x2'));var express=require(_0x9434('0x3'));var router=express['Router']();var auth=require(_0x9434('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9434('0x5'));var controller=require(_0x9434('0x6'));router['get']('/',auth[_0x9434('0x7')](),controller[_0x9434('0x8')]);router[_0x9434('0x9')](_0x9434('0xa'),auth[_0x9434('0x7')](),controller[_0x9434('0xb')]);router[_0x9434('0x9')](_0x9434('0xc'),auth['isAuthenticated'](),controller[_0x9434('0xd')]);router[_0x9434('0xe')]('/',auth[_0x9434('0x7')](),controller[_0x9434('0xf')]);router[_0x9434('0x10')](_0x9434('0xc'),auth[_0x9434('0x7')](),controller[_0x9434('0x11')]);router[_0x9434('0x12')](_0x9434('0xc'),auth[_0x9434('0x7')](),controller[_0x9434('0x13')]);module[_0x9434('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 64cd266..1ce6519 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 _0x8ece=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x3a67ed,_0x258a30){var _0x1324cb=function(_0x3ec975){while(--_0x3ec975){_0x3a67ed['push'](_0x3a67ed['shift']());}};_0x1324cb(++_0x258a30);}(_0x8ece,0x195));var _0xe8ec=function(_0x443732,_0x644284){_0x443732=_0x443732-0x0;var _0x2d8440=_0x8ece[_0x443732];return _0x2d8440;};'use strict';var multer=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var path=require(_0xe8ec('0x2'));var timeout=require(_0xe8ec('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xe8ec('0x4'));var interaction=require(_0xe8ec('0x5'));var config=require(_0xe8ec('0x6'));var controller=require(_0xe8ec('0x7'));router[_0xe8ec('0x8')]('/',auth['isAuthenticated'](),controller[_0xe8ec('0x9')]);router[_0xe8ec('0x8')](_0xe8ec('0xa'),auth[_0xe8ec('0xb')](),controller[_0xe8ec('0xc')]);router[_0xe8ec('0x8')](_0xe8ec('0xd'),auth['isAuthenticated'](),controller[_0xe8ec('0xe')]);router['get'](_0xe8ec('0xf'),auth['isAuthenticated'](),controller[_0xe8ec('0x10')]);router[_0xe8ec('0x11')]('/',auth[_0xe8ec('0xb')](),controller[_0xe8ec('0x12')]);router[_0xe8ec('0x11')](_0xe8ec('0xd'),auth[_0xe8ec('0xb')](),controller[_0xe8ec('0x13')]);router[_0xe8ec('0x14')](_0xe8ec('0xa'),auth[_0xe8ec('0xb')](),controller[_0xe8ec('0x15')]);router[_0xe8ec('0x16')]('/:id',auth[_0xe8ec('0xb')](),controller[_0xe8ec('0x17')]);module[_0xe8ec('0x18')]=router; \ No newline at end of file +var _0xa3e6=['exports','multer','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x49fa38,_0x5190c5){_0x49fa38=_0x49fa38-0x0;var _0x84d941=_0xa3e6[_0x49fa38];return _0x84d941;};'use strict';var multer=require(_0x6a3e('0x0'));var util=require('util');var path=require(_0x6a3e('0x1'));var timeout=require('connect-timeout');var express=require(_0x6a3e('0x2'));var router=express[_0x6a3e('0x3')]();var auth=require(_0x6a3e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6a3e('0x5'));var controller=require('./intDeskAccount.controller');router[_0x6a3e('0x6')]('/',auth[_0x6a3e('0x7')](),controller[_0x6a3e('0x8')]);router[_0x6a3e('0x6')](_0x6a3e('0x9'),auth['isAuthenticated'](),controller[_0x6a3e('0xa')]);router[_0x6a3e('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x6a3e('0xb')]);router['get']('/:id/fields',auth[_0x6a3e('0x7')](),controller['getFields']);router[_0x6a3e('0xc')]('/',auth['isAuthenticated'](),controller[_0x6a3e('0xd')]);router[_0x6a3e('0xc')](_0x6a3e('0xe'),auth[_0x6a3e('0x7')](),controller[_0x6a3e('0xf')]);router[_0x6a3e('0x10')]('/:id',auth[_0x6a3e('0x7')](),controller[_0x6a3e('0x11')]);router[_0x6a3e('0x12')](_0x6a3e('0x9'),auth[_0x6a3e('0x7')](),controller[_0x6a3e('0x13')]);module[_0x6a3e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 0f98554..bba1f0c 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 _0x19ae=['integrationTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x19ae,0x1c9));var _0xe19a=function(_0x32b801,_0x58a857){_0x32b801=_0x32b801-0x0;var _0x4b56d6=_0x19ae[_0x32b801];return _0x4b56d6;};'use strict';var Sequelize=require(_0xe19a('0x0'));module[_0xe19a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe19a('0x2')]},'username':{'type':Sequelize[_0xe19a('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xe19a('0x3')](_0xe19a('0x4')),'defaultValue':_0xe19a('0x4')},'password':{'type':Sequelize[_0xe19a('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0xe19a('0x2')]},'token':{'type':Sequelize[_0xe19a('0x2')]},'tokenSecret':{'type':Sequelize[_0xe19a('0x2')]},'serverUrl':{'type':Sequelize[_0xe19a('0x2')]},'type':{'type':Sequelize[_0xe19a('0x3')](_0xe19a('0x5'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xb4a0=['STRING','ENUM','basic','integrationTab','sequelize','exports'];(function(_0x233aa1,_0x37af6d){var _0x4e670d=function(_0x2fca54){while(--_0x2fca54){_0x233aa1['push'](_0x233aa1['shift']());}};_0x4e670d(++_0x37af6d);}(_0xb4a0,0xa0));var _0x0b4a=function(_0x5ab0ee,_0x1f3584){_0x5ab0ee=_0x5ab0ee-0x0;var _0x829dd=_0xb4a0[_0x5ab0ee];return _0x829dd;};'use strict';var Sequelize=require(_0x0b4a('0x0'));module[_0x0b4a('0x1')]={'name':{'type':Sequelize[_0x0b4a('0x2')]},'description':{'type':Sequelize[_0x0b4a('0x2')]},'username':{'type':Sequelize[_0x0b4a('0x2')]},'remoteUri':{'type':Sequelize[_0x0b4a('0x2')]},'authType':{'type':Sequelize[_0x0b4a('0x3')](_0x0b4a('0x4')),'defaultValue':_0x0b4a('0x4')},'password':{'type':Sequelize[_0x0b4a('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x0b4a('0x2')]},'tokenSecret':{'type':Sequelize[_0x0b4a('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0b4a('0x3')](_0x0b4a('0x5'),'newTab'),'defaultValue':_0x0b4a('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 1a0402e..19149d6 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 _0xeb98=['request','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','status','end','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','name','send','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','options','find','create','body','update','params','getConfigurations','DeskConfiguration','addConfiguration','findOne','AccountId','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','lastIndexOf','GET','format','application/json','headers','Authorization','Basic\x20%s','%s:%s','concat','_embedded','active','label','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x1e6772,_0x78054d){var _0x46ec02=function(_0x55730c){while(--_0x55730c){_0x1e6772['push'](_0x1e6772['shift']());}};_0x46ec02(++_0x78054d);}(_0xeb98,0xe0));var _0x8eb9=function(_0x3d5bc3,_0x43ad90){_0x3d5bc3=_0x3d5bc3-0x0;var _0x13b4cb=_0xeb98[_0x3d5bc3];return _0x13b4cb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8eb9('0x0'));var rimraf=require(_0x8eb9('0x1'));var zipdir=require(_0x8eb9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8eb9('0x3'));var Mustache=require(_0x8eb9('0x4'));var util=require(_0x8eb9('0x5'));var path=require(_0x8eb9('0x6'));var sox=require('sox');var csv=require(_0x8eb9('0x7'));var ejs=require(_0x8eb9('0x8'));var fs=require('fs');var _=require(_0x8eb9('0x9'));var squel=require('squel');var crypto=require(_0x8eb9('0xa'));var jsforce=require(_0x8eb9('0xb'));var deskjs=require(_0x8eb9('0xc'));var toCsv=require(_0x8eb9('0x7'));var querystring=require(_0x8eb9('0xd'));var Papa=require(_0x8eb9('0xe'));var Redis=require(_0x8eb9('0xf'));var authService=require(_0x8eb9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8eb9('0x11'));var hardwareService=require(_0x8eb9('0x12'));var logger=require(_0x8eb9('0x13'))('api');var utils=require(_0x8eb9('0x14'));var config=require(_0x8eb9('0x15'));var db=require(_0x8eb9('0x16'))['db'];var integrations=require(_0x8eb9('0x17'));var jayson=require(_0x8eb9('0x18'));var client=jayson['client'][_0x8eb9('0x19')]({'port':0x232a});function checkPasswordPattern(_0x1843a5,_0x49eb0a,_0x3189c3){if(_0x3189c3){var _0x2106c6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2106c6[_0x8eb9('0x1a')](_0x49eb0a)){return _0x1843a5;}else{throw new db[(_0x8eb9('0x1b'))][(_0x8eb9('0x1c'))](_0x8eb9('0x1d'));}}else{return _0x1843a5;}}function respondWithRpcPromise(_0x192572,_0x4c46e7,_0x1cacd2,_0x43f3a4){return new BPromise(function(_0x4ba2d4,_0x4619c8){var _0x242930=_0x43f3a4||client;return _0x242930[_0x8eb9('0x1e')](_0x192572,_0x1cacd2)['then'](function(_0x2d0a47){logger[_0x8eb9('0x1f')](_0x8eb9('0x20'),_0x4c46e7,'request\x20sent');logger[_0x8eb9('0x21')](_0x8eb9('0x22'),_0x4c46e7,_0x8eb9('0x23'),JSON['stringify'](_0x2d0a47));if(_0x2d0a47[_0x8eb9('0x24')]){if(_0x2d0a47[_0x8eb9('0x24')][_0x8eb9('0x25')]===0x1f4){logger[_0x8eb9('0x24')]('DeskAccount,\x20%s,\x20%s',_0x4c46e7,_0x2d0a47[_0x8eb9('0x24')][_0x8eb9('0x26')]);return _0x4619c8(_0x2d0a47[_0x8eb9('0x24')][_0x8eb9('0x26')]);}logger[_0x8eb9('0x24')](_0x8eb9('0x20'),_0x4c46e7,_0x2d0a47[_0x8eb9('0x24')][_0x8eb9('0x26')]);return _0x4ba2d4(_0x2d0a47[_0x8eb9('0x24')][_0x8eb9('0x26')]);}else{logger[_0x8eb9('0x1f')]('DeskAccount,\x20%s,\x20%s',_0x4c46e7,_0x8eb9('0x23'));_0x4ba2d4(_0x2d0a47[_0x8eb9('0x27')][_0x8eb9('0x26')]);}})['catch'](function(_0x4ab5b9){logger['error'](_0x8eb9('0x20'),_0x4c46e7,_0x4ab5b9);_0x4619c8(_0x4ab5b9);});});}function respondWithStatusCode(_0x1e80f4,_0x4ab7ee){_0x4ab7ee=_0x4ab7ee||0xcc;return function(_0x312d80){if(_0x312d80){return _0x1e80f4['sendStatus'](_0x4ab7ee);}return _0x1e80f4[_0x8eb9('0x28')](_0x4ab7ee)[_0x8eb9('0x29')]();};}function respondWithResult(_0x2df0fc,_0x73adc3){_0x73adc3=_0x73adc3||0xc8;return function(_0x53ab26){if(_0x53ab26){return _0x2df0fc[_0x8eb9('0x28')](_0x73adc3)['json'](_0x53ab26);}};}function respondWithFilteredResult(_0x2390bc,_0x14df41){return function(_0x432038){if(_0x432038){var _0x25896c=_0x432038[_0x8eb9('0x2a')],_0xc3896a=_0x14df41['offset'],_0x576421=_0x14df41[_0x8eb9('0x2b')]+_0x14df41['limit'],_0x5be067;if(_0x576421>=_0x25896c){_0x576421=_0x25896c;_0x5be067=0xc8;}else{_0x5be067=0xce;}_0x2390bc[_0x8eb9('0x28')](_0x5be067);return _0x2390bc[_0x8eb9('0x2c')](_0x8eb9('0x2d'),_0xc3896a+'-'+_0x576421+'/'+_0x25896c)[_0x8eb9('0x2e')](_0x432038);}return null;};}function patchUpdates(_0x47dc43){return function(_0x4cf121){try{jsonpatch[_0x8eb9('0x2f')](_0x4cf121,_0x47dc43,!![]);}catch(_0xbe0c94){return BPromise[_0x8eb9('0x30')](_0xbe0c94);}return _0x4cf121[_0x8eb9('0x31')]();};}function saveUpdates(_0x34e57c,_0x1b2327){return function(_0x3cf327){if(_0x3cf327){return _0x3cf327['update'](_0x34e57c)[_0x8eb9('0x32')](function(_0x19d4c6){return _0x19d4c6;});}return null;};}function removeEntity(_0xf28ce2,_0x82c1ec){return function(_0x49df29){if(_0x49df29){return _0x49df29[_0x8eb9('0x33')]()['then'](function(){_0xf28ce2[_0x8eb9('0x28')](0xcc)[_0x8eb9('0x29')]();});}};}function handleEntityNotFound(_0x13927a,_0x49b65d){return function(_0x2c2340){if(!_0x2c2340){_0x13927a[_0x8eb9('0x34')](0x194);}return _0x2c2340;};}function handleError(_0x5ed37f,_0x5b3718){_0x5b3718=_0x5b3718||0x1f4;return function(_0x165e0c){logger['error'](_0x165e0c['stack']);if(_0x165e0c[_0x8eb9('0x35')]){delete _0x165e0c[_0x8eb9('0x35')];}_0x5ed37f[_0x8eb9('0x28')](_0x5b3718)[_0x8eb9('0x36')](_0x165e0c);};}exports['index']=function(_0x186471,_0x40992b){var _0x1e6403={},_0x87de27={},_0x54dc0e={'count':0x0,'rows':[]};var _0x6a7d63=_[_0x8eb9('0x37')](db[_0x8eb9('0x38')][_0x8eb9('0x39')],function(_0x24d792){return{'name':_0x24d792[_0x8eb9('0x3a')],'type':_0x24d792[_0x8eb9('0x3b')][_0x8eb9('0x3c')]};});_0x87de27[_0x8eb9('0x3d')]=_['map'](_0x6a7d63,_0x8eb9('0x35'));_0x87de27[_0x8eb9('0x3e')]=_[_0x8eb9('0x3f')](_0x186471[_0x8eb9('0x3e')]);_0x87de27[_0x8eb9('0x40')]=_['intersection'](_0x87de27[_0x8eb9('0x3d')],_0x87de27[_0x8eb9('0x3e')]);_0x1e6403[_0x8eb9('0x41')]=_[_0x8eb9('0x42')](_0x87de27[_0x8eb9('0x3d')],qs[_0x8eb9('0x43')](_0x186471[_0x8eb9('0x3e')][_0x8eb9('0x43')]));_0x1e6403[_0x8eb9('0x41')]=_0x1e6403['attributes'][_0x8eb9('0x44')]?_0x1e6403[_0x8eb9('0x41')]:_0x87de27[_0x8eb9('0x3d')];if(!_0x186471['query'][_0x8eb9('0x45')](_0x8eb9('0x46'))){_0x1e6403[_0x8eb9('0x47')]=qs[_0x8eb9('0x47')](_0x186471[_0x8eb9('0x3e')]['limit']);_0x1e6403[_0x8eb9('0x2b')]=qs[_0x8eb9('0x2b')](_0x186471[_0x8eb9('0x3e')][_0x8eb9('0x2b')]);}_0x1e6403[_0x8eb9('0x48')]=qs[_0x8eb9('0x49')](_0x186471[_0x8eb9('0x3e')][_0x8eb9('0x49')]);_0x1e6403[_0x8eb9('0x4a')]=qs[_0x8eb9('0x40')](_[_0x8eb9('0x4b')](_0x186471[_0x8eb9('0x3e')],_0x87de27['filters']));if(_0x186471[_0x8eb9('0x3e')]['filter']){_0x1e6403[_0x8eb9('0x4a')]=_[_0x8eb9('0x4c')](_0x1e6403[_0x8eb9('0x4a')],{'$or':_[_0x8eb9('0x37')](_0x6a7d63,function(_0x18b08d){if(_0x18b08d['type']!==_0x8eb9('0x4d')){var _0x5abb9f={};_0x5abb9f[_0x18b08d[_0x8eb9('0x35')]]={'$like':'%'+_0x186471['query'][_0x8eb9('0x4e')]+'%'};return _0x5abb9f;}})});}_0x1e6403=_[_0x8eb9('0x4c')]({},_0x1e6403,_0x186471['options']);var _0x45473f={'where':_0x1e6403[_0x8eb9('0x4a')]};return db['DeskAccount'][_0x8eb9('0x2a')](_0x45473f)[_0x8eb9('0x32')](function(_0x8903f9){_0x54dc0e[_0x8eb9('0x2a')]=_0x8903f9;if(_0x186471[_0x8eb9('0x3e')][_0x8eb9('0x4f')]){_0x1e6403[_0x8eb9('0x50')]=[{'all':!![]}];}return db[_0x8eb9('0x38')][_0x8eb9('0x51')](_0x1e6403);})[_0x8eb9('0x32')](function(_0x1568d2){_0x54dc0e[_0x8eb9('0x52')]=_0x1568d2;return _0x54dc0e;})[_0x8eb9('0x32')](respondWithFilteredResult(_0x40992b,_0x1e6403))[_0x8eb9('0x53')](handleError(_0x40992b,null));};exports[_0x8eb9('0x54')]=function(_0x2653a1,_0x1d140a){var _0x454bf1={'raw':![],'where':{'id':_0x2653a1['params']['id']}},_0x33a440={};_0x33a440[_0x8eb9('0x3d')]=_[_0x8eb9('0x3f')](db[_0x8eb9('0x38')][_0x8eb9('0x39')]);_0x33a440['query']=_['keys'](_0x2653a1['query']);_0x33a440['filters']=_[_0x8eb9('0x42')](_0x33a440['model'],_0x33a440[_0x8eb9('0x3e')]);_0x454bf1[_0x8eb9('0x41')]=_['intersection'](_0x33a440[_0x8eb9('0x3d')],qs[_0x8eb9('0x43')](_0x2653a1[_0x8eb9('0x3e')][_0x8eb9('0x43')]));_0x454bf1[_0x8eb9('0x41')]=_0x454bf1[_0x8eb9('0x41')][_0x8eb9('0x44')]?_0x454bf1[_0x8eb9('0x41')]:_0x33a440[_0x8eb9('0x3d')];if(_0x2653a1[_0x8eb9('0x3e')][_0x8eb9('0x4f')]){_0x454bf1[_0x8eb9('0x50')]=[{'all':!![]}];}_0x454bf1=_['merge']({},_0x454bf1,_0x2653a1[_0x8eb9('0x55')]);return db['DeskAccount'][_0x8eb9('0x56')](_0x454bf1)[_0x8eb9('0x32')](handleEntityNotFound(_0x1d140a,null))[_0x8eb9('0x32')](respondWithResult(_0x1d140a,null))['catch'](handleError(_0x1d140a,null));};exports[_0x8eb9('0x57')]=function(_0x261cab,_0x3475f1){return db[_0x8eb9('0x38')][_0x8eb9('0x57')](_0x261cab[_0x8eb9('0x58')],{})[_0x8eb9('0x32')](respondWithResult(_0x3475f1,0xc9))[_0x8eb9('0x53')](handleError(_0x3475f1,null));};exports[_0x8eb9('0x59')]=function(_0x3ab8c7,_0x4903c2){if(_0x3ab8c7[_0x8eb9('0x58')]['id']){delete _0x3ab8c7[_0x8eb9('0x58')]['id'];}return db[_0x8eb9('0x38')][_0x8eb9('0x56')]({'where':{'id':_0x3ab8c7['params']['id']}})[_0x8eb9('0x32')](handleEntityNotFound(_0x4903c2,null))[_0x8eb9('0x32')](saveUpdates(_0x3ab8c7[_0x8eb9('0x58')],null))[_0x8eb9('0x32')](respondWithResult(_0x4903c2,null))[_0x8eb9('0x53')](handleError(_0x4903c2,null));};exports[_0x8eb9('0x33')]=function(_0x2f8dfc,_0x124469){return db[_0x8eb9('0x38')]['find']({'where':{'id':_0x2f8dfc[_0x8eb9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x124469,null))['then'](removeEntity(_0x124469,null))[_0x8eb9('0x53')](handleError(_0x124469,null));};exports[_0x8eb9('0x5b')]=function(_0x8c97b6,_0x57ddbe,_0x31bad5){var _0x5a5489={};var _0x2ab783={};var _0x54f84a;var _0x59c416;return db[_0x8eb9('0x38')]['findOne']({'where':{'id':_0x8c97b6[_0x8eb9('0x5a')]['id']}})[_0x8eb9('0x32')](handleEntityNotFound(_0x57ddbe,null))['then'](function(_0x1c6183){if(_0x1c6183){_0x54f84a=_0x1c6183;_0x2ab783['model']=_[_0x8eb9('0x3f')](db[_0x8eb9('0x5c')]['rawAttributes']);_0x2ab783[_0x8eb9('0x3e')]=_[_0x8eb9('0x3f')](_0x8c97b6[_0x8eb9('0x3e')]);_0x2ab783[_0x8eb9('0x40')]=_['intersection'](_0x2ab783['model'],_0x2ab783[_0x8eb9('0x3e')]);_0x5a5489['attributes']=_[_0x8eb9('0x42')](_0x2ab783[_0x8eb9('0x3d')],qs[_0x8eb9('0x43')](_0x8c97b6[_0x8eb9('0x3e')][_0x8eb9('0x43')]));_0x5a5489[_0x8eb9('0x41')]=_0x5a5489[_0x8eb9('0x41')][_0x8eb9('0x44')]?_0x5a5489['attributes']:_0x2ab783['model'];_0x5a5489['order']=qs[_0x8eb9('0x49')](_0x8c97b6['query']['sort']);_0x5a5489[_0x8eb9('0x4a')]=qs[_0x8eb9('0x40')](_[_0x8eb9('0x4b')](_0x8c97b6[_0x8eb9('0x3e')],_0x2ab783[_0x8eb9('0x40')]));if(_0x8c97b6[_0x8eb9('0x3e')][_0x8eb9('0x4e')]){_0x5a5489['where']=_[_0x8eb9('0x4c')](_0x5a5489[_0x8eb9('0x4a')],{'$or':_['map'](_0x5a5489[_0x8eb9('0x41')],function(_0x5daec0){var _0x2a6a4e={};_0x2a6a4e[_0x5daec0]={'$like':'%'+_0x8c97b6[_0x8eb9('0x3e')][_0x8eb9('0x4e')]+'%'};return _0x2a6a4e;})});}_0x5a5489=_[_0x8eb9('0x4c')]({},_0x5a5489,_0x8c97b6['options']);return _0x54f84a[_0x8eb9('0x5b')](_0x5a5489);}})[_0x8eb9('0x32')](function(_0x4336c7){if(_0x4336c7){_0x59c416=_0x4336c7['length'];if(!_0x8c97b6[_0x8eb9('0x3e')]['hasOwnProperty'](_0x8eb9('0x46'))){_0x5a5489[_0x8eb9('0x47')]=qs['limit'](_0x8c97b6[_0x8eb9('0x3e')][_0x8eb9('0x47')]);_0x5a5489['offset']=qs[_0x8eb9('0x2b')](_0x8c97b6[_0x8eb9('0x3e')]['offset']);}return _0x54f84a['getConfigurations'](_0x5a5489);}})['then'](function(_0x576b86){if(_0x576b86){return _0x576b86?{'count':_0x59c416,'rows':_0x576b86}:null;}})['then'](respondWithResult(_0x57ddbe,null))['catch'](handleError(_0x57ddbe,null));};exports[_0x8eb9('0x5d')]=function(_0x2ba202,_0xb820a6,_0x21a08d){if(_0x2ba202[_0x8eb9('0x58')]['id']){delete _0x2ba202[_0x8eb9('0x58')]['id'];}return db[_0x8eb9('0x38')][_0x8eb9('0x5e')]({'where':{'id':_0x2ba202['params']['id']}})[_0x8eb9('0x32')](handleEntityNotFound(_0xb820a6,null))[_0x8eb9('0x32')](function(_0x37eed1){if(_0x37eed1){_0x2ba202['body'][_0x8eb9('0x5f')]=_0x37eed1['id'];_0x2ba202[_0x8eb9('0x58')]['Subjects']=integrations[_0x8eb9('0x60')](_0x2ba202[_0x8eb9('0x58')]['channel'],_0x2ba202['body']['type']);_0x2ba202[_0x8eb9('0x58')][_0x8eb9('0x61')]=integrations[_0x8eb9('0x62')](_0x2ba202[_0x8eb9('0x58')][_0x8eb9('0x63')],_0x2ba202['body']['type']);return db[_0x8eb9('0x5c')][_0x8eb9('0x57')](_0x2ba202[_0x8eb9('0x58')],{'include':[{'model':db[_0x8eb9('0x64')],'as':'Subjects'},{'model':db['DeskField'],'as':_0x8eb9('0x61')}]});}return null;})[_0x8eb9('0x32')](respondWithResult(_0xb820a6,null))[_0x8eb9('0x53')](handleError(_0xb820a6,null));};exports[_0x8eb9('0x65')]=function(_0x491fe2,_0x46a89f,_0x19b232){var _0x970a6e=[{'name':_0x8eb9('0x66'),'label':_0x8eb9('0x66'),'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 _0x34cd51='';return db[_0x8eb9('0x38')]['findOne']({'where':{'id':_0x491fe2[_0x8eb9('0x5a')]['id']},'attributes':['id',_0x8eb9('0x67'),_0x8eb9('0x68'),_0x8eb9('0x69'),_0x8eb9('0x6a'),_0x8eb9('0x6b'),_0x8eb9('0x6c'),_0x8eb9('0x6d'),_0x8eb9('0x6e')]})[_0x8eb9('0x32')](handleEntityNotFound(_0x46a89f,null))['then'](function(_0x2dd482){if(_0x2dd482){_0x34cd51=_0x2dd482[_0x8eb9('0x67')];var _0x10c057=_0x34cd51['slice'](-0x1);if(_0x10c057==='/'){_0x34cd51=_0x34cd51['substring'](0x0,_0x34cd51[_0x8eb9('0x6f')](_0x10c057));}var _0x4ebc37={'method':_0x8eb9('0x70'),'uri':util[_0x8eb9('0x71')]('%s/custom_fields',_0x34cd51),'headers':{'Content-Type':_0x8eb9('0x72'),'Accept':'application/json'},'json':!![]};if(_0x2dd482[_0x8eb9('0x68')]==='basic'){_0x4ebc37[_0x8eb9('0x73')][_0x8eb9('0x74')]=util['format'](_0x8eb9('0x75'),new Buffer(util[_0x8eb9('0x71')](_0x8eb9('0x76'),_0x2dd482[_0x8eb9('0x69')],_0x2dd482[_0x8eb9('0x6a')]))['toString']('base64'));}return rp(_0x4ebc37)[_0x8eb9('0x32')](function(_0x4cfb0d){return _0x970a6e[_0x8eb9('0x77')](_[_0x8eb9('0x37')](_0x4cfb0d[_0x8eb9('0x78')]['entries'],function(_0x263a5f){return{'id':_0x263a5f[_0x8eb9('0x35')],'name':_0x263a5f['name'],'type':_0x263a5f[_0x8eb9('0x3b')],'active':_0x263a5f[_0x8eb9('0x79')],'label':_0x263a5f[_0x8eb9('0x7a')],'custom':!![]};}));});}})[_0x8eb9('0x32')](function(_0x15a3de){return{'count':_0x15a3de['length'],'rows':_0x15a3de};})[_0x8eb9('0x32')](respondWithResult(_0x46a89f,null))[_0x8eb9('0x53')](function(_0x3c53d0){var _0x49acbf=_0x491fe2[_0x8eb9('0x3e')][_0x8eb9('0x1a')]?0x1f4:_0x3c53d0['statusCode']||0x1f4;logger[_0x8eb9('0x24')](_0x8eb9('0x7b'),_0x8eb9('0x65'),_0x49acbf,JSON[_0x8eb9('0x7c')](_0x3c53d0));delete _0x3c53d0[_0x8eb9('0x35')];if(_0x49acbf===0x191){_0x49acbf=0x190;}_0x46a89f[_0x8eb9('0x28')](_0x49acbf)[_0x8eb9('0x36')](_0x491fe2['query'][_0x8eb9('0x1a')]?{'message':_0x8eb9('0x7d'),'statusCode':_0x3c53d0[_0x8eb9('0x7e')]}:_0x3c53d0);});}; \ No newline at end of file +var _0x54f3=['rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','lodash','squel','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','debug','stringify','error','message','DeskAccount,\x20%s,\x20%s','info','request\x20sent','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save','then','destroy','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','update','findOne','DeskConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','getFields','priority','password','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','format','application/json','authType','basic','headers','Authorization','Basic\x20%s','%s:%s','username','_embedded','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format'];(function(_0x38831b,_0x4611ea){var _0x5a508a=function(_0x2df441){while(--_0x2df441){_0x38831b['push'](_0x38831b['shift']());}};_0x5a508a(++_0x4611ea);}(_0x54f3,0xec));var _0x354f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x54f3[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require(_0x354f('0x0'));var emlformat=require(_0x354f('0x1'));var rimraf=require(_0x354f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x354f('0x3'));var rp=require('request-promise');var moment=require(_0x354f('0x4'));var BPromise=require(_0x354f('0x5'));var Mustache=require('mustache');var util=require(_0x354f('0x6'));var path=require('path');var sox=require(_0x354f('0x7'));var csv=require(_0x354f('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x354f('0x9'));var squel=require(_0x354f('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x354f('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x354f('0xc'));var qs=require(_0x354f('0xd'));var as=require(_0x354f('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x354f('0xf'))(_0x354f('0x10'));var utils=require(_0x354f('0x11'));var config=require(_0x354f('0x12'));var db=require(_0x354f('0x13'))['db'];var integrations=require(_0x354f('0x14'));var jayson=require(_0x354f('0x15'));var client=jayson[_0x354f('0x16')][_0x354f('0x17')]({'port':0x232a});function checkPasswordPattern(_0x3ffcd2,_0xf8a594,_0x5a647d){if(_0x5a647d){var _0x235eac=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x235eac[_0x354f('0x18')](_0xf8a594)){return _0x3ffcd2;}else{throw new db[(_0x354f('0x19'))]['ValidationError'](_0x354f('0x1a'));}}else{return _0x3ffcd2;}}function respondWithRpcPromise(_0x2c18f6,_0x5407a3,_0x1c9678,_0x2be366){return new BPromise(function(_0x4f3651,_0x55aed7){var _0x1509f2=_0x2be366||client;return _0x1509f2['request'](_0x2c18f6,_0x1c9678)['then'](function(_0xfe9c2d){logger['info']('DeskAccount,\x20%s,\x20%s',_0x5407a3,'request\x20sent');logger[_0x354f('0x1b')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x5407a3,'request\x20sent',JSON[_0x354f('0x1c')](_0xfe9c2d));if(_0xfe9c2d[_0x354f('0x1d')]){if(_0xfe9c2d[_0x354f('0x1d')]['code']===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x5407a3,_0xfe9c2d[_0x354f('0x1d')]['message']);return _0x55aed7(_0xfe9c2d[_0x354f('0x1d')][_0x354f('0x1e')]);}logger['error'](_0x354f('0x1f'),_0x5407a3,_0xfe9c2d[_0x354f('0x1d')][_0x354f('0x1e')]);return _0x4f3651(_0xfe9c2d[_0x354f('0x1d')][_0x354f('0x1e')]);}else{logger[_0x354f('0x20')](_0x354f('0x1f'),_0x5407a3,_0x354f('0x21'));_0x4f3651(_0xfe9c2d[_0x354f('0x22')][_0x354f('0x1e')]);}})[_0x354f('0x23')](function(_0xd5061d){logger[_0x354f('0x1d')](_0x354f('0x1f'),_0x5407a3,_0xd5061d);_0x55aed7(_0xd5061d);});});}function respondWithStatusCode(_0x26bc0e,_0x1f2652){_0x1f2652=_0x1f2652||0xcc;return function(_0x1b9d52){if(_0x1b9d52){return _0x26bc0e[_0x354f('0x24')](_0x1f2652);}return _0x26bc0e[_0x354f('0x25')](_0x1f2652)[_0x354f('0x26')]();};}function respondWithResult(_0x4fab00,_0x47bce3){_0x47bce3=_0x47bce3||0xc8;return function(_0xc0dfea){if(_0xc0dfea){return _0x4fab00[_0x354f('0x25')](_0x47bce3)['json'](_0xc0dfea);}};}function respondWithFilteredResult(_0x3b1a98,_0x2dbcf6){return function(_0x335a9a){if(_0x335a9a){var _0x49296b=_0x335a9a[_0x354f('0x27')],_0x1fabc5=_0x2dbcf6[_0x354f('0x28')],_0x150fba=_0x2dbcf6[_0x354f('0x28')]+_0x2dbcf6[_0x354f('0x29')],_0x3a7ad5;if(_0x150fba>=_0x49296b){_0x150fba=_0x49296b;_0x3a7ad5=0xc8;}else{_0x3a7ad5=0xce;}_0x3b1a98['status'](_0x3a7ad5);return _0x3b1a98[_0x354f('0x2a')](_0x354f('0x2b'),_0x1fabc5+'-'+_0x150fba+'/'+_0x49296b)[_0x354f('0x2c')](_0x335a9a);}return null;};}function patchUpdates(_0x2c1fff){return function(_0x41b01f){try{jsonpatch['apply'](_0x41b01f,_0x2c1fff,!![]);}catch(_0x4fc3be){return BPromise['reject'](_0x4fc3be);}return _0x41b01f[_0x354f('0x2d')]();};}function saveUpdates(_0x1c10ec,_0x5d885e){return function(_0x267055){if(_0x267055){return _0x267055['update'](_0x1c10ec)[_0x354f('0x2e')](function(_0x1b6c08){return _0x1b6c08;});}return null;};}function removeEntity(_0xf1872a,_0x2ed598){return function(_0x3d1937){if(_0x3d1937){return _0x3d1937[_0x354f('0x2f')]()[_0x354f('0x2e')](function(){_0xf1872a[_0x354f('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44fd7a,_0x7e51b7){return function(_0x5434d7){if(!_0x5434d7){_0x44fd7a[_0x354f('0x24')](0x194);}return _0x5434d7;};}function handleError(_0x40423b,_0x5ba977){_0x5ba977=_0x5ba977||0x1f4;return function(_0x3a6023){logger[_0x354f('0x1d')](_0x3a6023[_0x354f('0x30')]);if(_0x3a6023[_0x354f('0x31')]){delete _0x3a6023[_0x354f('0x31')];}_0x40423b[_0x354f('0x25')](_0x5ba977)[_0x354f('0x32')](_0x3a6023);};}exports[_0x354f('0x33')]=function(_0x20e431,_0x27397e){var _0x498b57={},_0x4dd948={},_0x3c6a10={'count':0x0,'rows':[]};var _0x4a5e1b=_[_0x354f('0x34')](db[_0x354f('0x35')][_0x354f('0x36')],function(_0x237d2b){return{'name':_0x237d2b[_0x354f('0x37')],'type':_0x237d2b[_0x354f('0x38')]['key']};});_0x4dd948['model']=_['map'](_0x4a5e1b,_0x354f('0x31'));_0x4dd948[_0x354f('0x39')]=_[_0x354f('0x3a')](_0x20e431[_0x354f('0x39')]);_0x4dd948[_0x354f('0x3b')]=_[_0x354f('0x3c')](_0x4dd948[_0x354f('0x3d')],_0x4dd948[_0x354f('0x39')]);_0x498b57[_0x354f('0x3e')]=_[_0x354f('0x3c')](_0x4dd948['model'],qs[_0x354f('0x3f')](_0x20e431[_0x354f('0x39')][_0x354f('0x3f')]));_0x498b57[_0x354f('0x3e')]=_0x498b57[_0x354f('0x3e')][_0x354f('0x40')]?_0x498b57[_0x354f('0x3e')]:_0x4dd948['model'];if(!_0x20e431[_0x354f('0x39')][_0x354f('0x41')](_0x354f('0x42'))){_0x498b57[_0x354f('0x29')]=qs[_0x354f('0x29')](_0x20e431['query']['limit']);_0x498b57[_0x354f('0x28')]=qs[_0x354f('0x28')](_0x20e431[_0x354f('0x39')][_0x354f('0x28')]);}_0x498b57[_0x354f('0x43')]=qs[_0x354f('0x44')](_0x20e431[_0x354f('0x39')]['sort']);_0x498b57[_0x354f('0x45')]=qs[_0x354f('0x3b')](_[_0x354f('0x46')](_0x20e431[_0x354f('0x39')],_0x4dd948[_0x354f('0x3b')]));if(_0x20e431[_0x354f('0x39')][_0x354f('0x47')]){_0x498b57[_0x354f('0x45')]=_['merge'](_0x498b57[_0x354f('0x45')],{'$or':_[_0x354f('0x34')](_0x4a5e1b,function(_0x4600f1){if(_0x4600f1[_0x354f('0x38')]!==_0x354f('0x48')){var _0x593dd9={};_0x593dd9[_0x4600f1[_0x354f('0x31')]]={'$like':'%'+_0x20e431['query'][_0x354f('0x47')]+'%'};return _0x593dd9;}})});}_0x498b57=_[_0x354f('0x49')]({},_0x498b57,_0x20e431[_0x354f('0x4a')]);var _0xa9c84b={'where':_0x498b57[_0x354f('0x45')]};return db[_0x354f('0x35')][_0x354f('0x27')](_0xa9c84b)[_0x354f('0x2e')](function(_0x3c35dd){_0x3c6a10['count']=_0x3c35dd;if(_0x20e431[_0x354f('0x39')][_0x354f('0x4b')]){_0x498b57[_0x354f('0x4c')]=[{'all':!![]}];}return db[_0x354f('0x35')][_0x354f('0x4d')](_0x498b57);})[_0x354f('0x2e')](function(_0x528d26){_0x3c6a10[_0x354f('0x4e')]=_0x528d26;return _0x3c6a10;})[_0x354f('0x2e')](respondWithFilteredResult(_0x27397e,_0x498b57))['catch'](handleError(_0x27397e,null));};exports[_0x354f('0x4f')]=function(_0x28f2a1,_0x4bd453){var _0x42afb8={'raw':![],'where':{'id':_0x28f2a1[_0x354f('0x50')]['id']}},_0x1f780d={};_0x1f780d['model']=_[_0x354f('0x3a')](db['DeskAccount'][_0x354f('0x36')]);_0x1f780d['query']=_['keys'](_0x28f2a1[_0x354f('0x39')]);_0x1f780d[_0x354f('0x3b')]=_[_0x354f('0x3c')](_0x1f780d[_0x354f('0x3d')],_0x1f780d[_0x354f('0x39')]);_0x42afb8[_0x354f('0x3e')]=_[_0x354f('0x3c')](_0x1f780d[_0x354f('0x3d')],qs['fields'](_0x28f2a1[_0x354f('0x39')][_0x354f('0x3f')]));_0x42afb8[_0x354f('0x3e')]=_0x42afb8[_0x354f('0x3e')][_0x354f('0x40')]?_0x42afb8['attributes']:_0x1f780d[_0x354f('0x3d')];if(_0x28f2a1[_0x354f('0x39')][_0x354f('0x4b')]){_0x42afb8[_0x354f('0x4c')]=[{'all':!![]}];}_0x42afb8=_[_0x354f('0x49')]({},_0x42afb8,_0x28f2a1[_0x354f('0x4a')]);return db[_0x354f('0x35')][_0x354f('0x51')](_0x42afb8)[_0x354f('0x2e')](handleEntityNotFound(_0x4bd453,null))[_0x354f('0x2e')](respondWithResult(_0x4bd453,null))[_0x354f('0x23')](handleError(_0x4bd453,null));};exports[_0x354f('0x52')]=function(_0x545037,_0x4f8986){return db[_0x354f('0x35')][_0x354f('0x52')](_0x545037[_0x354f('0x53')],{})[_0x354f('0x2e')](respondWithResult(_0x4f8986,0xc9))[_0x354f('0x23')](handleError(_0x4f8986,null));};exports[_0x354f('0x54')]=function(_0x1243d3,_0x12b0cc){if(_0x1243d3['body']['id']){delete _0x1243d3[_0x354f('0x53')]['id'];}return db[_0x354f('0x35')][_0x354f('0x51')]({'where':{'id':_0x1243d3[_0x354f('0x50')]['id']}})[_0x354f('0x2e')](handleEntityNotFound(_0x12b0cc,null))[_0x354f('0x2e')](saveUpdates(_0x1243d3['body'],null))[_0x354f('0x2e')](respondWithResult(_0x12b0cc,null))[_0x354f('0x23')](handleError(_0x12b0cc,null));};exports[_0x354f('0x2f')]=function(_0x254b06,_0x3cd956){return db['DeskAccount'][_0x354f('0x51')]({'where':{'id':_0x254b06[_0x354f('0x50')]['id']}})[_0x354f('0x2e')](handleEntityNotFound(_0x3cd956,null))[_0x354f('0x2e')](removeEntity(_0x3cd956,null))[_0x354f('0x23')](handleError(_0x3cd956,null));};exports['getConfigurations']=function(_0x4f4f52,_0x5dd870,_0x8dc9d9){var _0x3b9c7c={};var _0x20b614={};var _0x371c86;var _0x4126bb;return db[_0x354f('0x35')][_0x354f('0x55')]({'where':{'id':_0x4f4f52[_0x354f('0x50')]['id']}})[_0x354f('0x2e')](handleEntityNotFound(_0x5dd870,null))[_0x354f('0x2e')](function(_0x2d356d){if(_0x2d356d){_0x371c86=_0x2d356d;_0x20b614[_0x354f('0x3d')]=_[_0x354f('0x3a')](db[_0x354f('0x56')][_0x354f('0x36')]);_0x20b614[_0x354f('0x39')]=_[_0x354f('0x3a')](_0x4f4f52[_0x354f('0x39')]);_0x20b614[_0x354f('0x3b')]=_[_0x354f('0x3c')](_0x20b614[_0x354f('0x3d')],_0x20b614['query']);_0x3b9c7c[_0x354f('0x3e')]=_[_0x354f('0x3c')](_0x20b614[_0x354f('0x3d')],qs[_0x354f('0x3f')](_0x4f4f52[_0x354f('0x39')]['fields']));_0x3b9c7c[_0x354f('0x3e')]=_0x3b9c7c[_0x354f('0x3e')][_0x354f('0x40')]?_0x3b9c7c[_0x354f('0x3e')]:_0x20b614['model'];_0x3b9c7c[_0x354f('0x43')]=qs[_0x354f('0x44')](_0x4f4f52['query'][_0x354f('0x44')]);_0x3b9c7c[_0x354f('0x45')]=qs[_0x354f('0x3b')](_[_0x354f('0x46')](_0x4f4f52[_0x354f('0x39')],_0x20b614[_0x354f('0x3b')]));if(_0x4f4f52[_0x354f('0x39')][_0x354f('0x47')]){_0x3b9c7c[_0x354f('0x45')]=_[_0x354f('0x49')](_0x3b9c7c[_0x354f('0x45')],{'$or':_['map'](_0x3b9c7c[_0x354f('0x3e')],function(_0x29a1af){var _0x30c78b={};_0x30c78b[_0x29a1af]={'$like':'%'+_0x4f4f52[_0x354f('0x39')]['filter']+'%'};return _0x30c78b;})});}_0x3b9c7c=_['merge']({},_0x3b9c7c,_0x4f4f52['options']);return _0x371c86[_0x354f('0x57')](_0x3b9c7c);}})['then'](function(_0x1f1261){if(_0x1f1261){_0x4126bb=_0x1f1261[_0x354f('0x40')];if(!_0x4f4f52[_0x354f('0x39')][_0x354f('0x41')](_0x354f('0x42'))){_0x3b9c7c[_0x354f('0x29')]=qs[_0x354f('0x29')](_0x4f4f52[_0x354f('0x39')][_0x354f('0x29')]);_0x3b9c7c[_0x354f('0x28')]=qs['offset'](_0x4f4f52[_0x354f('0x39')][_0x354f('0x28')]);}return _0x371c86[_0x354f('0x57')](_0x3b9c7c);}})[_0x354f('0x2e')](function(_0x8b06cc){if(_0x8b06cc){return _0x8b06cc?{'count':_0x4126bb,'rows':_0x8b06cc}:null;}})[_0x354f('0x2e')](respondWithResult(_0x5dd870,null))[_0x354f('0x23')](handleError(_0x5dd870,null));};exports[_0x354f('0x58')]=function(_0xb6bf3d,_0x540bc7,_0xc3377b){if(_0xb6bf3d[_0x354f('0x53')]['id']){delete _0xb6bf3d[_0x354f('0x53')]['id'];}return db['DeskAccount'][_0x354f('0x55')]({'where':{'id':_0xb6bf3d[_0x354f('0x50')]['id']}})['then'](handleEntityNotFound(_0x540bc7,null))[_0x354f('0x2e')](function(_0x2c9615){if(_0x2c9615){_0xb6bf3d[_0x354f('0x53')]['AccountId']=_0x2c9615['id'];_0xb6bf3d[_0x354f('0x53')][_0x354f('0x59')]=integrations[_0x354f('0x5a')](_0xb6bf3d['body']['channel'],_0xb6bf3d[_0x354f('0x53')]['type']);_0xb6bf3d['body'][_0x354f('0x5b')]=integrations[_0x354f('0x5c')](_0xb6bf3d[_0x354f('0x53')][_0x354f('0x5d')],_0xb6bf3d[_0x354f('0x53')]['type']);return db[_0x354f('0x56')]['create'](_0xb6bf3d[_0x354f('0x53')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db['DeskField'],'as':_0x354f('0x5b')}]});}return null;})[_0x354f('0x2e')](respondWithResult(_0x540bc7,null))[_0x354f('0x23')](handleError(_0x540bc7,null));};exports[_0x354f('0x5e')]=function(_0xae7cb4,_0x5e3f06,_0x4be3f6){var _0x523ebe=[{'name':_0x354f('0x5f'),'label':_0x354f('0x5f'),'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 _0x3f81b3='';return db[_0x354f('0x35')][_0x354f('0x55')]({'where':{'id':_0xae7cb4[_0x354f('0x50')]['id']},'attributes':['id','remoteUri','authType','username',_0x354f('0x60'),'consumerKey',_0x354f('0x61'),_0x354f('0x62'),_0x354f('0x63')]})[_0x354f('0x2e')](handleEntityNotFound(_0x5e3f06,null))[_0x354f('0x2e')](function(_0x342950){if(_0x342950){_0x3f81b3=_0x342950['remoteUri'];var _0x3901e5=_0x3f81b3['slice'](-0x1);if(_0x3901e5==='/'){_0x3f81b3=_0x3f81b3[_0x354f('0x64')](0x0,_0x3f81b3[_0x354f('0x65')](_0x3901e5));}var _0x14d4f8={'method':_0x354f('0x66'),'uri':util[_0x354f('0x67')]('%s/custom_fields',_0x3f81b3),'headers':{'Content-Type':_0x354f('0x68'),'Accept':_0x354f('0x68')},'json':!![]};if(_0x342950[_0x354f('0x69')]===_0x354f('0x6a')){_0x14d4f8[_0x354f('0x6b')][_0x354f('0x6c')]=util['format'](_0x354f('0x6d'),new Buffer(util[_0x354f('0x67')](_0x354f('0x6e'),_0x342950[_0x354f('0x6f')],_0x342950['password']))['toString']('base64'));}return rp(_0x14d4f8)['then'](function(_0x3b0f0a){return _0x523ebe['concat'](_[_0x354f('0x34')](_0x3b0f0a[_0x354f('0x70')][_0x354f('0x71')],function(_0xddfd11){return{'id':_0xddfd11['name'],'name':_0xddfd11[_0x354f('0x31')],'type':_0xddfd11[_0x354f('0x38')],'active':_0xddfd11[_0x354f('0x72')],'label':_0xddfd11[_0x354f('0x73')],'custom':!![]};}));});}})['then'](function(_0x3dc494){return{'count':_0x3dc494[_0x354f('0x40')],'rows':_0x3dc494};})[_0x354f('0x2e')](respondWithResult(_0x5e3f06,null))[_0x354f('0x23')](function(_0x12cf2a){var _0x136df6=_0xae7cb4[_0x354f('0x39')][_0x354f('0x18')]?0x1f4:_0x12cf2a[_0x354f('0x74')]||0x1f4;logger[_0x354f('0x1d')](_0x354f('0x75'),_0x354f('0x5e'),_0x136df6,JSON[_0x354f('0x1c')](_0x12cf2a));delete _0x12cf2a[_0x354f('0x31')];if(_0x136df6===0x191){_0x136df6=0x190;}_0x5e3f06[_0x354f('0x25')](_0x136df6)[_0x354f('0x32')](_0xae7cb4[_0x354f('0x39')][_0x354f('0x18')]?{'message':_0x354f('0x76'),'statusCode':_0x12cf2a[_0x354f('0x74')]}:_0x12cf2a);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 1e1f4bc..f3c6e14 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 _0xe1eb=['util','../../config/logger','api','moment','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash'];(function(_0x76f50b,_0x2bf5d1){var _0x4c56fc=function(_0x291787){while(--_0x291787){_0x76f50b['push'](_0x76f50b['shift']());}};_0x4c56fc(++_0x2bf5d1);}(_0xe1eb,0x173));var _0xbe1e=function(_0xfd2dd2,_0x41e8d6){_0xfd2dd2=_0xfd2dd2-0x0;var _0x3f28f1=_0xe1eb[_0xfd2dd2];return _0x3f28f1;};'use strict';var _=require(_0xbe1e('0x0'));var util=require(_0xbe1e('0x1'));var logger=require(_0xbe1e('0x2'))(_0xbe1e('0x3'));var moment=require(_0xbe1e('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(_0xbe1e('0x5'));var attributes=require(_0xbe1e('0x6'));var integrations=require(_0xbe1e('0x7'));module[_0xbe1e('0x8')]=function(_0x5ca169,_0x319992){return _0x5ca169[_0xbe1e('0x9')](_0xbe1e('0xa'),attributes,{'tableName':_0xbe1e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22cb=['int_desk_accounts','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x407276,_0x32b382){var _0x514e59=function(_0x4f4d03){while(--_0x4f4d03){_0x407276['push'](_0x407276['shift']());}};_0x514e59(++_0x32b382);}(_0x22cb,0x99));var _0xb22c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x22cb[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb22c('0x0'))('api');var moment=require('moment');var BPromise=require(_0xb22c('0x1'));var rp=require(_0xb22c('0x2'));var fs=require('fs');var path=require(_0xb22c('0x3'));var rimraf=require(_0xb22c('0x4'));var config=require(_0xb22c('0x5'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xb22c('0x6')]=function(_0x3f17e8,_0x5001c3){return _0x3f17e8['define']('DeskAccount',attributes,{'tableName':_0xb22c('0x7'),'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 1e34168..4c1380e 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 _0x16e0=['code','message','request\x20sent','catch','GetDeskAccount','DeskAccount','findAll','raw','where','options','attributes','limit','include','model','ShowDeskAccount','find','map','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','DeskAccount,\x20%s,\x20%s','debug','stringify','error'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x16e0,0x91));var _0x016e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x16e0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x016e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x016e('0x1'));var rs=require(_0x016e('0x2'));var fs=require('fs');var Redis=require(_0x016e('0x3'));var db=require(_0x016e('0x4'))['db'];var utils=require(_0x016e('0x5'));var logger=require(_0x016e('0x6'))('rpc');var config=require(_0x016e('0x7'));var jayson=require(_0x016e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a01c4,_0x316075,_0x1075cf){return new BPromise(function(_0x5cff2c,_0x1ca911){return client['request'](_0x1a01c4,_0x1075cf)[_0x016e('0x9')](function(_0x500dd9){logger[_0x016e('0xa')](_0x016e('0xb'),_0x316075,'request\x20sent');logger[_0x016e('0xc')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x316075,'request\x20sent',JSON[_0x016e('0xd')](_0x500dd9));if(_0x500dd9['error']){if(_0x500dd9[_0x016e('0xe')][_0x016e('0xf')]===0x1f4){logger[_0x016e('0xe')](_0x016e('0xb'),_0x316075,_0x500dd9[_0x016e('0xe')]['message']);return _0x1ca911(_0x500dd9[_0x016e('0xe')]['message']);}logger['error'](_0x016e('0xb'),_0x316075,_0x500dd9[_0x016e('0xe')][_0x016e('0x10')]);return _0x5cff2c(_0x500dd9[_0x016e('0xe')][_0x016e('0x10')]);}else{logger[_0x016e('0xa')](_0x016e('0xb'),_0x316075,_0x016e('0x11'));_0x5cff2c(_0x500dd9['result'][_0x016e('0x10')]);}})[_0x016e('0x12')](function(_0x48157e){logger[_0x016e('0xe')]('DeskAccount,\x20%s,\x20%s',_0x316075,_0x48157e);_0x1ca911(_0x48157e);});});}exports[_0x016e('0x13')]=function(_0x414e2a){var _0x1ec35a=this;return new Promise(function(_0x353d39,_0x337afe){return db[_0x016e('0x14')][_0x016e('0x15')]({'raw':_0x414e2a['options']?_0x414e2a['options'][_0x016e('0x16')]===undefined?!![]:![]:!![],'where':_0x414e2a['options']?_0x414e2a['options'][_0x016e('0x17')]||null:null,'attributes':_0x414e2a[_0x016e('0x18')]?_0x414e2a[_0x016e('0x18')][_0x016e('0x19')]||null:null,'limit':_0x414e2a['options']?_0x414e2a[_0x016e('0x18')][_0x016e('0x1a')]||null:null,'include':_0x414e2a[_0x016e('0x18')]?_0x414e2a[_0x016e('0x18')]['include']?_['map'](_0x414e2a['options'][_0x016e('0x1b')],function(_0x21a05e){return{'model':db[_0x21a05e['model']],'as':_0x21a05e['as'],'attributes':_0x21a05e[_0x016e('0x19')],'include':_0x21a05e['include']?_['map'](_0x21a05e[_0x016e('0x1b')],function(_0x55d7eb){return{'model':db[_0x55d7eb[_0x016e('0x1c')]],'as':_0x55d7eb['as'],'attributes':_0x55d7eb['attributes'],'include':_0x55d7eb['include']?_['map'](_0x55d7eb[_0x016e('0x1b')],function(_0x4f44bb){return{'model':db[_0x4f44bb[_0x016e('0x1c')]],'as':_0x4f44bb['as'],'attributes':_0x4f44bb['attributes']};}):[]};}):[]};}):[]:[]})[_0x016e('0x9')](function(_0x2c6849){logger[_0x016e('0xa')](_0x016e('0x13'),_0x414e2a);logger[_0x016e('0xc')](_0x016e('0x13'),_0x414e2a,JSON['stringify'](_0x2c6849));_0x353d39(_0x2c6849);})[_0x016e('0x12')](function(_0x368f1c){logger[_0x016e('0xe')]('GetDeskAccount',_0x368f1c['message'],_0x414e2a);_0x337afe(_0x1ec35a[_0x016e('0xe')](0x1f4,_0x368f1c[_0x016e('0x10')]));});});};exports[_0x016e('0x1d')]=function(_0x5b149f){var _0x5a3497=this;return new Promise(function(_0x3ffe5b,_0x2dd3bb){return db['DeskAccount'][_0x016e('0x1e')]({'raw':_0x5b149f['options']?_0x5b149f[_0x016e('0x18')][_0x016e('0x16')]===undefined?!![]:![]:!![],'where':_0x5b149f[_0x016e('0x18')]?_0x5b149f['options'][_0x016e('0x17')]||null:null,'attributes':_0x5b149f['options']?_0x5b149f[_0x016e('0x18')][_0x016e('0x19')]||null:null,'include':_0x5b149f[_0x016e('0x18')]?_0x5b149f[_0x016e('0x18')][_0x016e('0x1b')]?_['map'](_0x5b149f['options'][_0x016e('0x1b')],function(_0x5a3bff){return{'model':db[_0x5a3bff[_0x016e('0x1c')]],'as':_0x5a3bff['as'],'attributes':_0x5a3bff['attributes'],'include':_0x5a3bff[_0x016e('0x1b')]?_[_0x016e('0x1f')](_0x5a3bff['include'],function(_0x1027c8){return{'model':db[_0x1027c8['model']],'as':_0x1027c8['as'],'attributes':_0x1027c8[_0x016e('0x19')],'include':_0x1027c8[_0x016e('0x1b')]?_[_0x016e('0x1f')](_0x1027c8[_0x016e('0x1b')],function(_0x581788){return{'model':db[_0x581788[_0x016e('0x1c')]],'as':_0x581788['as'],'attributes':_0x581788[_0x016e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x016e('0x9')](function(_0x42583c){logger['info'](_0x016e('0x1d'),_0x5b149f);logger[_0x016e('0xc')](_0x016e('0x1d'),_0x5b149f,JSON[_0x016e('0xd')](_0x42583c));_0x3ffe5b(_0x42583c);})[_0x016e('0x12')](function(_0x4ee718){logger[_0x016e('0xe')]('ShowDeskAccount',_0x4ee718[_0x016e('0x10')],_0x5b149f);_0x2dd3bb(_0x5a3497[_0x016e('0xe')](0x1f4,_0x4ee718[_0x016e('0x10')]));});});}; \ No newline at end of file +var _0x7664=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','include','model','map','debug','ShowDeskAccount','lodash','bluebird','../../mysqldb'];(function(_0x4f7405,_0x24e84d){var _0x3fcca7=function(_0x531a2d){while(--_0x531a2d){_0x4f7405['push'](_0x4f7405['shift']());}};_0x3fcca7(++_0x24e84d);}(_0x7664,0xfd));var _0x4766=function(_0x2ad3a2,_0x2221e6){_0x2ad3a2=_0x2ad3a2-0x0;var _0x56e19d=_0x7664[_0x2ad3a2];return _0x56e19d;};'use strict';var _=require(_0x4766('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4766('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4766('0x2'))['db'];var utils=require(_0x4766('0x3'));var logger=require(_0x4766('0x4'))(_0x4766('0x5'));var config=require('../../config/environment');var jayson=require(_0x4766('0x6'));var client=jayson[_0x4766('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x571623,_0x5dad37,_0x3c27a0){return new BPromise(function(_0x244ceb,_0xe14e03){return client[_0x4766('0x8')](_0x571623,_0x3c27a0)[_0x4766('0x9')](function(_0x2a6d37){logger['info'](_0x4766('0xa'),_0x5dad37,_0x4766('0xb'));logger['debug'](_0x4766('0xc'),_0x5dad37,_0x4766('0xb'),JSON[_0x4766('0xd')](_0x2a6d37));if(_0x2a6d37[_0x4766('0xe')]){if(_0x2a6d37['error'][_0x4766('0xf')]===0x1f4){logger[_0x4766('0xe')](_0x4766('0xa'),_0x5dad37,_0x2a6d37[_0x4766('0xe')][_0x4766('0x10')]);return _0xe14e03(_0x2a6d37[_0x4766('0xe')][_0x4766('0x10')]);}logger[_0x4766('0xe')](_0x4766('0xa'),_0x5dad37,_0x2a6d37[_0x4766('0xe')][_0x4766('0x10')]);return _0x244ceb(_0x2a6d37[_0x4766('0xe')]['message']);}else{logger[_0x4766('0x11')](_0x4766('0xa'),_0x5dad37,_0x4766('0xb'));_0x244ceb(_0x2a6d37[_0x4766('0x12')][_0x4766('0x10')]);}})[_0x4766('0x13')](function(_0x1d1eaa){logger[_0x4766('0xe')](_0x4766('0xa'),_0x5dad37,_0x1d1eaa);_0xe14e03(_0x1d1eaa);});});}exports[_0x4766('0x14')]=function(_0x202eb5){var _0x2bb3fc=this;return new Promise(function(_0x1cf80d,_0x33410b){return db[_0x4766('0x15')][_0x4766('0x16')]({'raw':_0x202eb5[_0x4766('0x17')]?_0x202eb5[_0x4766('0x17')][_0x4766('0x18')]===undefined?!![]:![]:!![],'where':_0x202eb5['options']?_0x202eb5[_0x4766('0x17')][_0x4766('0x19')]||null:null,'attributes':_0x202eb5[_0x4766('0x17')]?_0x202eb5[_0x4766('0x17')][_0x4766('0x1a')]||null:null,'limit':_0x202eb5['options']?_0x202eb5['options']['limit']||null:null,'include':_0x202eb5[_0x4766('0x17')]?_0x202eb5['options'][_0x4766('0x1b')]?_['map'](_0x202eb5[_0x4766('0x17')]['include'],function(_0x5c94be){return{'model':db[_0x5c94be[_0x4766('0x1c')]],'as':_0x5c94be['as'],'attributes':_0x5c94be[_0x4766('0x1a')],'include':_0x5c94be[_0x4766('0x1b')]?_[_0x4766('0x1d')](_0x5c94be['include'],function(_0x1aa5c0){return{'model':db[_0x1aa5c0[_0x4766('0x1c')]],'as':_0x1aa5c0['as'],'attributes':_0x1aa5c0[_0x4766('0x1a')],'include':_0x1aa5c0[_0x4766('0x1b')]?_['map'](_0x1aa5c0['include'],function(_0x74e5f8){return{'model':db[_0x74e5f8[_0x4766('0x1c')]],'as':_0x74e5f8['as'],'attributes':_0x74e5f8['attributes']};}):[]};}):[]};}):[]:[]})[_0x4766('0x9')](function(_0x15fb89){logger[_0x4766('0x11')](_0x4766('0x14'),_0x202eb5);logger[_0x4766('0x1e')](_0x4766('0x14'),_0x202eb5,JSON[_0x4766('0xd')](_0x15fb89));_0x1cf80d(_0x15fb89);})[_0x4766('0x13')](function(_0x249885){logger[_0x4766('0xe')](_0x4766('0x14'),_0x249885['message'],_0x202eb5);_0x33410b(_0x2bb3fc[_0x4766('0xe')](0x1f4,_0x249885['message']));});});};exports['ShowDeskAccount']=function(_0x196d43){var _0x321a27=this;return new Promise(function(_0xe23bc8,_0xd7e7e3){return db[_0x4766('0x15')]['find']({'raw':_0x196d43[_0x4766('0x17')]?_0x196d43[_0x4766('0x17')][_0x4766('0x18')]===undefined?!![]:![]:!![],'where':_0x196d43[_0x4766('0x17')]?_0x196d43[_0x4766('0x17')][_0x4766('0x19')]||null:null,'attributes':_0x196d43['options']?_0x196d43[_0x4766('0x17')][_0x4766('0x1a')]||null:null,'include':_0x196d43[_0x4766('0x17')]?_0x196d43[_0x4766('0x17')][_0x4766('0x1b')]?_['map'](_0x196d43[_0x4766('0x17')][_0x4766('0x1b')],function(_0xdfe6c1){return{'model':db[_0xdfe6c1[_0x4766('0x1c')]],'as':_0xdfe6c1['as'],'attributes':_0xdfe6c1[_0x4766('0x1a')],'include':_0xdfe6c1['include']?_[_0x4766('0x1d')](_0xdfe6c1[_0x4766('0x1b')],function(_0x23bb7d){return{'model':db[_0x23bb7d[_0x4766('0x1c')]],'as':_0x23bb7d['as'],'attributes':_0x23bb7d[_0x4766('0x1a')],'include':_0x23bb7d[_0x4766('0x1b')]?_[_0x4766('0x1d')](_0x23bb7d[_0x4766('0x1b')],function(_0xd298a5){return{'model':db[_0xd298a5[_0x4766('0x1c')]],'as':_0xd298a5['as'],'attributes':_0xd298a5[_0x4766('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4766('0x9')](function(_0x1bcf8a){logger['info'](_0x4766('0x1f'),_0x196d43);logger[_0x4766('0x1e')](_0x4766('0x1f'),_0x196d43,JSON[_0x4766('0xd')](_0x1bcf8a));_0xe23bc8(_0x1bcf8a);})[_0x4766('0x13')](function(_0x35c31d){logger[_0x4766('0xe')](_0x4766('0x1f'),_0x35c31d['message'],_0x196d43);_0xd7e7e3(_0x321a27[_0x4766('0xe')](0x1f4,_0x35c31d[_0x4766('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 78250fc..d6073ce 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 _0x22b4=['/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x22b4,0x8b));var _0x422b=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x22b4[_0x411017];return _0x2adeea;};'use strict';var multer=require(_0x422b('0x0'));var util=require(_0x422b('0x1'));var path=require(_0x422b('0x2'));var timeout=require(_0x422b('0x3'));var express=require(_0x422b('0x4'));var router=express[_0x422b('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x422b('0x6'));var config=require(_0x422b('0x7'));var controller=require('./intDeskConfiguration.controller');router[_0x422b('0x8')]('/',auth[_0x422b('0x9')](),controller[_0x422b('0xa')]);router[_0x422b('0x8')](_0x422b('0xb'),auth[_0x422b('0x9')](),controller['show']);router[_0x422b('0x8')]('/:id/fields',auth[_0x422b('0x9')](),controller[_0x422b('0xc')]);router[_0x422b('0x8')](_0x422b('0xd'),auth[_0x422b('0x9')](),controller[_0x422b('0xe')]);router['get'](_0x422b('0xf'),auth[_0x422b('0x9')](),controller[_0x422b('0x10')]);router[_0x422b('0x8')](_0x422b('0x11'),auth[_0x422b('0x9')](),controller[_0x422b('0x12')]);router[_0x422b('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x422b('0x13')](_0x422b('0x11'),auth[_0x422b('0x9')](),controller[_0x422b('0x14')]);router[_0x422b('0x15')](_0x422b('0xb'),auth[_0x422b('0x9')](),controller[_0x422b('0x16')]);router['delete'](_0x422b('0xb'),auth['isAuthenticated'](),controller[_0x422b('0x17')]);module[_0x422b('0x18')]=router; \ No newline at end of file +var _0xa32b=['path','Router','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer'];(function(_0x378a07,_0x26dbbe){var _0x1013e7=function(_0x28855f){while(--_0x28855f){_0x378a07['push'](_0x378a07['shift']());}};_0x1013e7(++_0x26dbbe);}(_0xa32b,0x68));var _0xba32=function(_0x386525,_0xefae6){_0x386525=_0x386525-0x0;var _0x14d015=_0xa32b[_0x386525];return _0x14d015;};'use strict';var multer=require(_0xba32('0x0'));var util=require('util');var path=require(_0xba32('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xba32('0x2')]();var auth=require(_0xba32('0x3'));var interaction=require(_0xba32('0x4'));var config=require('../../config/environment');var controller=require(_0xba32('0x5'));router[_0xba32('0x6')]('/',auth[_0xba32('0x7')](),controller[_0xba32('0x8')]);router[_0xba32('0x6')]('/:id',auth[_0xba32('0x7')](),controller['show']);router[_0xba32('0x6')](_0xba32('0x9'),auth[_0xba32('0x7')](),controller[_0xba32('0xa')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xba32('0x6')]('/:id/descriptions',auth[_0xba32('0x7')](),controller['getDescriptions']);router[_0xba32('0x6')]('/:id/tags',auth['isAuthenticated'](),controller[_0xba32('0xb')]);router[_0xba32('0xc')]('/',auth[_0xba32('0x7')](),controller[_0xba32('0xd')]);router[_0xba32('0xc')]('/:id/tags',auth[_0xba32('0x7')](),controller[_0xba32('0xe')]);router[_0xba32('0xf')](_0xba32('0x10'),auth[_0xba32('0x7')](),controller[_0xba32('0x11')]);router[_0xba32('0x12')]('/:id',auth[_0xba32('0x7')](),controller[_0xba32('0x13')]);module[_0xba32('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 68cd5bb..8579448 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 _0xe145=['exports','STRING','sequelize'];(function(_0xdbc13,_0x1925de){var _0x45ff7b=function(_0x334c2f){while(--_0x334c2f){_0xdbc13['push'](_0xdbc13['shift']());}};_0x45ff7b(++_0x1925de);}(_0xe145,0xb3));var _0x5e14=function(_0x4e2ce0,_0x4acb4a){_0x4e2ce0=_0x4e2ce0-0x0;var _0x3ecf63=_0xe145[_0x4e2ce0];return _0x3ecf63;};'use strict';var Sequelize=require(_0x5e14('0x0'));module[_0x5e14('0x1')]={'name':{'type':Sequelize[_0x5e14('0x2')]},'description':{'type':Sequelize[_0x5e14('0x2')]}}; \ No newline at end of file +var _0x02c4=['exports','STRING','sequelize'];(function(_0x54b82a,_0xa88a0b){var _0x20a5f2=function(_0x30d121){while(--_0x30d121){_0x54b82a['push'](_0x54b82a['shift']());}};_0x20a5f2(++_0xa88a0b);}(_0x02c4,0x1eb));var _0x402c=function(_0x5ce467,_0x499aea){_0x5ce467=_0x5ce467-0x0;var _0x394de4=_0x02c4[_0x5ce467];return _0x394de4;};'use strict';var Sequelize=require(_0x402c('0x0'));module[_0x402c('0x1')]={'name':{'type':Sequelize[_0x402c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index dac7505..549c871 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 _0xefe1=['filter','merge','VIRTUAL','DeskConfiguration','count','includeAll','include','catch','params','options','find','create','body','getFields','DeskField','getSubjects','findOne','order','getDescriptions','Tag','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','set','Content-Range','reject','update','destroy','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick'];(function(_0x99d412,_0x1f47d8){var _0x25f651=function(_0x252c13){while(--_0x252c13){_0x99d412['push'](_0x99d412['shift']());}};_0x25f651(++_0x1f47d8);}(_0xefe1,0x17f));var _0x1efe=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xefe1[_0x173441];return _0x2423a8;};'use strict';var pdf=require(_0x1efe('0x0'));var emlformat=require(_0x1efe('0x1'));var rimraf=require(_0x1efe('0x2'));var zipdir=require(_0x1efe('0x3'));var jsonpatch=require(_0x1efe('0x4'));var rp=require('request-promise');var moment=require(_0x1efe('0x5'));var BPromise=require(_0x1efe('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1efe('0x7'));var csv=require('to-csv');var ejs=require(_0x1efe('0x8'));var fs=require('fs');var _=require(_0x1efe('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1efe('0xa'));var deskjs=require(_0x1efe('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1efe('0xc'));var Papa=require(_0x1efe('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1efe('0xe'));var hardwareService=require(_0x1efe('0xf'));var logger=require(_0x1efe('0x10'))(_0x1efe('0x11'));var utils=require(_0x1efe('0x12'));var config=require(_0x1efe('0x13'));var db=require('../../mysqldb')['db'];var jayson=require(_0x1efe('0x14'));var client=jayson['client'][_0x1efe('0x15')]({'port':0x232a});function checkPasswordPattern(_0x36230d,_0x1325d8,_0x4ae8a8){if(_0x4ae8a8){var _0x16f645=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16f645['test'](_0x1325d8)){return _0x36230d;}else{throw new db['Sequelize'][(_0x1efe('0x16'))](_0x1efe('0x17'));}}else{return _0x36230d;}}function respondWithRpcPromise(_0xf3c2e3,_0x1015a8,_0x33a83f,_0x3b09b3){return new BPromise(function(_0x3e9fa7,_0x2113db){var _0x160862=_0x3b09b3||client;return _0x160862[_0x1efe('0x18')](_0xf3c2e3,_0x33a83f)[_0x1efe('0x19')](function(_0x383e9f){logger[_0x1efe('0x1a')](_0x1efe('0x1b'),_0x1015a8,_0x1efe('0x1c'));logger[_0x1efe('0x1d')](_0x1efe('0x1e'),_0x1015a8,_0x1efe('0x1c'),JSON[_0x1efe('0x1f')](_0x383e9f));if(_0x383e9f[_0x1efe('0x20')]){if(_0x383e9f[_0x1efe('0x20')][_0x1efe('0x21')]===0x1f4){logger[_0x1efe('0x20')](_0x1efe('0x1b'),_0x1015a8,_0x383e9f['error'][_0x1efe('0x22')]);return _0x2113db(_0x383e9f[_0x1efe('0x20')][_0x1efe('0x22')]);}logger[_0x1efe('0x20')](_0x1efe('0x1b'),_0x1015a8,_0x383e9f['error'][_0x1efe('0x22')]);return _0x3e9fa7(_0x383e9f[_0x1efe('0x20')][_0x1efe('0x22')]);}else{logger['info'](_0x1efe('0x1b'),_0x1015a8,'request\x20sent');_0x3e9fa7(_0x383e9f[_0x1efe('0x23')]['message']);}})['catch'](function(_0x203ef3){logger[_0x1efe('0x20')](_0x1efe('0x1b'),_0x1015a8,_0x203ef3);_0x2113db(_0x203ef3);});});}function respondWithStatusCode(_0x23f1fa,_0x4d1fc0){_0x4d1fc0=_0x4d1fc0||0xcc;return function(_0x4d2686){if(_0x4d2686){return _0x23f1fa[_0x1efe('0x24')](_0x4d1fc0);}return _0x23f1fa[_0x1efe('0x25')](_0x4d1fc0)[_0x1efe('0x26')]();};}function respondWithResult(_0x103d85,_0x276ab0){_0x276ab0=_0x276ab0||0xc8;return function(_0x3639bb){if(_0x3639bb){return _0x103d85['status'](_0x276ab0)[_0x1efe('0x27')](_0x3639bb);}};}function respondWithFilteredResult(_0x4c6f29,_0x2e6606){return function(_0x2741dc){if(_0x2741dc){var _0x3e81dc=_0x2741dc['count'],_0x12d644=_0x2e6606[_0x1efe('0x28')],_0x112c64=_0x2e6606[_0x1efe('0x28')]+_0x2e6606['limit'],_0x1aa6b9;if(_0x112c64>=_0x3e81dc){_0x112c64=_0x3e81dc;_0x1aa6b9=0xc8;}else{_0x1aa6b9=0xce;}_0x4c6f29[_0x1efe('0x25')](_0x1aa6b9);return _0x4c6f29[_0x1efe('0x29')](_0x1efe('0x2a'),_0x12d644+'-'+_0x112c64+'/'+_0x3e81dc)[_0x1efe('0x27')](_0x2741dc);}return null;};}function patchUpdates(_0x4eedcb){return function(_0x836335){try{jsonpatch['apply'](_0x836335,_0x4eedcb,!![]);}catch(_0x234dd2){return BPromise[_0x1efe('0x2b')](_0x234dd2);}return _0x836335['save']();};}function saveUpdates(_0x32a163,_0x51eb25){return function(_0x55d3f6){if(_0x55d3f6){return _0x55d3f6[_0x1efe('0x2c')](_0x32a163)[_0x1efe('0x19')](function(_0x348304){return _0x348304;});}return null;};}function removeEntity(_0x2c070d,_0x3d397c){return function(_0x28027d){if(_0x28027d){return _0x28027d[_0x1efe('0x2d')]()[_0x1efe('0x19')](function(){_0x2c070d[_0x1efe('0x25')](0xcc)[_0x1efe('0x26')]();});}};}function handleEntityNotFound(_0x43ae0a,_0x273231){return function(_0x172672){if(!_0x172672){_0x43ae0a[_0x1efe('0x24')](0x194);}return _0x172672;};}function handleError(_0x338de1,_0x5dc591){_0x5dc591=_0x5dc591||0x1f4;return function(_0x30dd8e){logger['error'](_0x30dd8e[_0x1efe('0x2e')]);if(_0x30dd8e[_0x1efe('0x2f')]){delete _0x30dd8e[_0x1efe('0x2f')];}_0x338de1[_0x1efe('0x25')](_0x5dc591)['send'](_0x30dd8e);};}exports[_0x1efe('0x30')]=function(_0x5db0fa,_0x16085e){var _0x4b9698={},_0x55b2a6={},_0x358501={'count':0x0,'rows':[]};var _0x137f6c=_[_0x1efe('0x31')](db['DeskConfiguration'][_0x1efe('0x32')],function(_0x15e299){return{'name':_0x15e299['fieldName'],'type':_0x15e299[_0x1efe('0x33')][_0x1efe('0x34')]};});_0x55b2a6[_0x1efe('0x35')]=_[_0x1efe('0x31')](_0x137f6c,_0x1efe('0x2f'));_0x55b2a6[_0x1efe('0x36')]=_[_0x1efe('0x37')](_0x5db0fa[_0x1efe('0x36')]);_0x55b2a6[_0x1efe('0x38')]=_['intersection'](_0x55b2a6[_0x1efe('0x35')],_0x55b2a6[_0x1efe('0x36')]);_0x4b9698[_0x1efe('0x39')]=_[_0x1efe('0x3a')](_0x55b2a6['model'],qs[_0x1efe('0x3b')](_0x5db0fa[_0x1efe('0x36')]['fields']));_0x4b9698[_0x1efe('0x39')]=_0x4b9698['attributes'][_0x1efe('0x3c')]?_0x4b9698[_0x1efe('0x39')]:_0x55b2a6[_0x1efe('0x35')];if(!_0x5db0fa[_0x1efe('0x36')][_0x1efe('0x3d')](_0x1efe('0x3e'))){_0x4b9698['limit']=qs['limit'](_0x5db0fa[_0x1efe('0x36')][_0x1efe('0x3f')]);_0x4b9698[_0x1efe('0x28')]=qs['offset'](_0x5db0fa[_0x1efe('0x36')][_0x1efe('0x28')]);}_0x4b9698['order']=qs[_0x1efe('0x40')](_0x5db0fa['query'][_0x1efe('0x40')]);_0x4b9698[_0x1efe('0x41')]=qs[_0x1efe('0x38')](_[_0x1efe('0x42')](_0x5db0fa[_0x1efe('0x36')],_0x55b2a6[_0x1efe('0x38')]));if(_0x5db0fa[_0x1efe('0x36')][_0x1efe('0x43')]){_0x4b9698[_0x1efe('0x41')]=_[_0x1efe('0x44')](_0x4b9698[_0x1efe('0x41')],{'$or':_[_0x1efe('0x31')](_0x137f6c,function(_0x4aa942){if(_0x4aa942['type']!==_0x1efe('0x45')){var _0x2bee75={};_0x2bee75[_0x4aa942[_0x1efe('0x2f')]]={'$like':'%'+_0x5db0fa[_0x1efe('0x36')][_0x1efe('0x43')]+'%'};return _0x2bee75;}})});}_0x4b9698=_[_0x1efe('0x44')]({},_0x4b9698,_0x5db0fa['options']);var _0x299487={'where':_0x4b9698['where']};return db[_0x1efe('0x46')]['count'](_0x299487)[_0x1efe('0x19')](function(_0x362de7){_0x358501[_0x1efe('0x47')]=_0x362de7;if(_0x5db0fa[_0x1efe('0x36')][_0x1efe('0x48')]){_0x4b9698[_0x1efe('0x49')]=[{'all':!![]}];}return db[_0x1efe('0x46')]['findAll'](_0x4b9698);})[_0x1efe('0x19')](function(_0x35489a){_0x358501['rows']=_0x35489a;return _0x358501;})[_0x1efe('0x19')](respondWithFilteredResult(_0x16085e,_0x4b9698))[_0x1efe('0x4a')](handleError(_0x16085e,null));};exports['show']=function(_0xbb29b3,_0x48b2dd){var _0x50b6e2={'raw':![],'where':{'id':_0xbb29b3[_0x1efe('0x4b')]['id']}},_0x5c3b8c={};_0x5c3b8c['model']=_[_0x1efe('0x37')](db[_0x1efe('0x46')][_0x1efe('0x32')]);_0x5c3b8c['query']=_[_0x1efe('0x37')](_0xbb29b3['query']);_0x5c3b8c['filters']=_[_0x1efe('0x3a')](_0x5c3b8c['model'],_0x5c3b8c[_0x1efe('0x36')]);_0x50b6e2[_0x1efe('0x39')]=_[_0x1efe('0x3a')](_0x5c3b8c[_0x1efe('0x35')],qs[_0x1efe('0x3b')](_0xbb29b3[_0x1efe('0x36')][_0x1efe('0x3b')]));_0x50b6e2[_0x1efe('0x39')]=_0x50b6e2['attributes'][_0x1efe('0x3c')]?_0x50b6e2['attributes']:_0x5c3b8c[_0x1efe('0x35')];if(_0xbb29b3[_0x1efe('0x36')][_0x1efe('0x48')]){_0x50b6e2[_0x1efe('0x49')]=[{'all':!![]}];}_0x50b6e2=_[_0x1efe('0x44')]({},_0x50b6e2,_0xbb29b3[_0x1efe('0x4c')]);return db[_0x1efe('0x46')][_0x1efe('0x4d')](_0x50b6e2)['then'](handleEntityNotFound(_0x48b2dd,null))[_0x1efe('0x19')](respondWithResult(_0x48b2dd,null))[_0x1efe('0x4a')](handleError(_0x48b2dd,null));};exports['create']=function(_0x269f5a,_0x4b2ecc){return db[_0x1efe('0x46')][_0x1efe('0x4e')](_0x269f5a[_0x1efe('0x4f')],{})[_0x1efe('0x19')](respondWithResult(_0x4b2ecc,0xc9))[_0x1efe('0x4a')](handleError(_0x4b2ecc,null));};exports[_0x1efe('0x2c')]=function(_0x5d4d5e,_0x4534d5){if(_0x5d4d5e[_0x1efe('0x4f')]['id']){delete _0x5d4d5e['body']['id'];}return db[_0x1efe('0x46')][_0x1efe('0x4d')]({'where':{'id':_0x5d4d5e['params']['id']}})[_0x1efe('0x19')](handleEntityNotFound(_0x4534d5,null))[_0x1efe('0x19')](saveUpdates(_0x5d4d5e[_0x1efe('0x4f')],null))['then'](respondWithResult(_0x4534d5,null))['catch'](handleError(_0x4534d5,null));};exports[_0x1efe('0x2d')]=function(_0x4248b8,_0x46a00c){return db['DeskConfiguration']['find']({'where':{'id':_0x4248b8['params']['id']}})[_0x1efe('0x19')](handleEntityNotFound(_0x46a00c,null))[_0x1efe('0x19')](removeEntity(_0x46a00c,null))['catch'](handleError(_0x46a00c,null));};exports[_0x1efe('0x50')]=function(_0x203b10,_0x60d134,_0x1eeeb8){var _0xddc0d6={};var _0x1c5018={};var _0x39b874;var _0xbeccfa;return db['DeskConfiguration']['findOne']({'where':{'id':_0x203b10['params']['id']}})[_0x1efe('0x19')](handleEntityNotFound(_0x60d134,null))[_0x1efe('0x19')](function(_0x52330b){if(_0x52330b){_0x39b874=_0x52330b;_0x1c5018[_0x1efe('0x35')]=_['keys'](db[_0x1efe('0x51')][_0x1efe('0x32')]);_0x1c5018['query']=_[_0x1efe('0x37')](_0x203b10[_0x1efe('0x36')]);_0x1c5018[_0x1efe('0x38')]=_['intersection'](_0x1c5018[_0x1efe('0x35')],_0x1c5018['query']);_0xddc0d6[_0x1efe('0x39')]=_[_0x1efe('0x3a')](_0x1c5018[_0x1efe('0x35')],qs['fields'](_0x203b10[_0x1efe('0x36')][_0x1efe('0x3b')]));_0xddc0d6[_0x1efe('0x39')]=_0xddc0d6[_0x1efe('0x39')][_0x1efe('0x3c')]?_0xddc0d6[_0x1efe('0x39')]:_0x1c5018[_0x1efe('0x35')];_0xddc0d6['order']=qs[_0x1efe('0x40')](_0x203b10[_0x1efe('0x36')][_0x1efe('0x40')]);_0xddc0d6[_0x1efe('0x41')]=qs[_0x1efe('0x38')](_[_0x1efe('0x42')](_0x203b10[_0x1efe('0x36')],_0x1c5018[_0x1efe('0x38')]));if(_0x203b10[_0x1efe('0x36')][_0x1efe('0x43')]){_0xddc0d6[_0x1efe('0x41')]=_['merge'](_0xddc0d6['where'],{'$or':_['map'](_0xddc0d6['attributes'],function(_0x45c1c1){var _0x3bff40={};_0x3bff40[_0x45c1c1]={'$like':'%'+_0x203b10[_0x1efe('0x36')][_0x1efe('0x43')]+'%'};return _0x3bff40;})});}_0xddc0d6=_[_0x1efe('0x44')]({},_0xddc0d6,_0x203b10[_0x1efe('0x4c')]);return _0x39b874[_0x1efe('0x50')](_0xddc0d6);}})[_0x1efe('0x19')](function(_0x1aad75){if(_0x1aad75){_0xbeccfa=_0x1aad75[_0x1efe('0x3c')];if(!_0x203b10[_0x1efe('0x36')][_0x1efe('0x3d')]('nolimit')){_0xddc0d6[_0x1efe('0x3f')]=qs['limit'](_0x203b10[_0x1efe('0x36')]['limit']);_0xddc0d6[_0x1efe('0x28')]=qs['offset'](_0x203b10[_0x1efe('0x36')][_0x1efe('0x28')]);}return _0x39b874[_0x1efe('0x50')](_0xddc0d6);}})[_0x1efe('0x19')](function(_0x2ec108){if(_0x2ec108){return _0x2ec108?{'count':_0xbeccfa,'rows':_0x2ec108}:null;}})[_0x1efe('0x19')](respondWithResult(_0x60d134,null))[_0x1efe('0x4a')](handleError(_0x60d134,null));};exports[_0x1efe('0x52')]=function(_0x568d3e,_0x584fe3,_0x145485){var _0x755d28={};var _0x398d3b={};var _0x45520a;var _0x17648b;return db[_0x1efe('0x46')][_0x1efe('0x53')]({'where':{'id':_0x568d3e['params']['id']}})[_0x1efe('0x19')](handleEntityNotFound(_0x584fe3,null))[_0x1efe('0x19')](function(_0x1a169b){if(_0x1a169b){_0x45520a=_0x1a169b;_0x398d3b['model']=_[_0x1efe('0x37')](db[_0x1efe('0x51')]['rawAttributes']);_0x398d3b[_0x1efe('0x36')]=_['keys'](_0x568d3e[_0x1efe('0x36')]);_0x398d3b[_0x1efe('0x38')]=_[_0x1efe('0x3a')](_0x398d3b[_0x1efe('0x35')],_0x398d3b[_0x1efe('0x36')]);_0x755d28['attributes']=_[_0x1efe('0x3a')](_0x398d3b[_0x1efe('0x35')],qs['fields'](_0x568d3e['query'][_0x1efe('0x3b')]));_0x755d28['attributes']=_0x755d28[_0x1efe('0x39')][_0x1efe('0x3c')]?_0x755d28[_0x1efe('0x39')]:_0x398d3b[_0x1efe('0x35')];_0x755d28[_0x1efe('0x54')]=qs['sort'](_0x568d3e['query'][_0x1efe('0x40')]);_0x755d28[_0x1efe('0x41')]=qs['filters'](_[_0x1efe('0x42')](_0x568d3e['query'],_0x398d3b[_0x1efe('0x38')]));if(_0x568d3e['query'][_0x1efe('0x43')]){_0x755d28['where']=_[_0x1efe('0x44')](_0x755d28['where'],{'$or':_[_0x1efe('0x31')](_0x755d28[_0x1efe('0x39')],function(_0x4c1d51){var _0x25dda7={};_0x25dda7[_0x4c1d51]={'$like':'%'+_0x568d3e[_0x1efe('0x36')][_0x1efe('0x43')]+'%'};return _0x25dda7;})});}_0x755d28=_[_0x1efe('0x44')]({},_0x755d28,_0x568d3e[_0x1efe('0x4c')]);return _0x45520a[_0x1efe('0x52')](_0x755d28);}})[_0x1efe('0x19')](function(_0x567b59){if(_0x567b59){_0x17648b=_0x567b59[_0x1efe('0x3c')];if(!_0x568d3e[_0x1efe('0x36')]['hasOwnProperty'](_0x1efe('0x3e'))){_0x755d28['limit']=qs['limit'](_0x568d3e[_0x1efe('0x36')][_0x1efe('0x3f')]);_0x755d28[_0x1efe('0x28')]=qs[_0x1efe('0x28')](_0x568d3e[_0x1efe('0x36')]['offset']);}return _0x45520a[_0x1efe('0x52')](_0x755d28);}})[_0x1efe('0x19')](function(_0x597f0c){if(_0x597f0c){return _0x597f0c?{'count':_0x17648b,'rows':_0x597f0c}:null;}})[_0x1efe('0x19')](respondWithResult(_0x584fe3,null))[_0x1efe('0x4a')](handleError(_0x584fe3,null));};exports['getDescriptions']=function(_0x1c801,_0x3714f3,_0x128ea0){var _0x2d812b={};var _0x4a5318={};var _0x3b36e2;var _0x190fcf;return db['DeskConfiguration'][_0x1efe('0x53')]({'where':{'id':_0x1c801[_0x1efe('0x4b')]['id']}})[_0x1efe('0x19')](handleEntityNotFound(_0x3714f3,null))[_0x1efe('0x19')](function(_0x255ee9){if(_0x255ee9){_0x3b36e2=_0x255ee9;_0x4a5318[_0x1efe('0x35')]=_['keys'](db[_0x1efe('0x51')][_0x1efe('0x32')]);_0x4a5318[_0x1efe('0x36')]=_[_0x1efe('0x37')](_0x1c801[_0x1efe('0x36')]);_0x4a5318['filters']=_[_0x1efe('0x3a')](_0x4a5318[_0x1efe('0x35')],_0x4a5318[_0x1efe('0x36')]);_0x2d812b[_0x1efe('0x39')]=_[_0x1efe('0x3a')](_0x4a5318[_0x1efe('0x35')],qs[_0x1efe('0x3b')](_0x1c801[_0x1efe('0x36')][_0x1efe('0x3b')]));_0x2d812b['attributes']=_0x2d812b['attributes'][_0x1efe('0x3c')]?_0x2d812b[_0x1efe('0x39')]:_0x4a5318[_0x1efe('0x35')];_0x2d812b[_0x1efe('0x54')]=qs[_0x1efe('0x40')](_0x1c801[_0x1efe('0x36')][_0x1efe('0x40')]);_0x2d812b[_0x1efe('0x41')]=qs['filters'](_['pick'](_0x1c801[_0x1efe('0x36')],_0x4a5318['filters']));if(_0x1c801[_0x1efe('0x36')]['filter']){_0x2d812b[_0x1efe('0x41')]=_[_0x1efe('0x44')](_0x2d812b[_0x1efe('0x41')],{'$or':_[_0x1efe('0x31')](_0x2d812b['attributes'],function(_0x74f14c){var _0x41de02={};_0x41de02[_0x74f14c]={'$like':'%'+_0x1c801[_0x1efe('0x36')][_0x1efe('0x43')]+'%'};return _0x41de02;})});}_0x2d812b=_[_0x1efe('0x44')]({},_0x2d812b,_0x1c801['options']);return _0x3b36e2[_0x1efe('0x55')](_0x2d812b);}})['then'](function(_0x2f85a8){if(_0x2f85a8){_0x190fcf=_0x2f85a8['length'];if(!_0x1c801['query'][_0x1efe('0x3d')]('nolimit')){_0x2d812b[_0x1efe('0x3f')]=qs[_0x1efe('0x3f')](_0x1c801[_0x1efe('0x36')][_0x1efe('0x3f')]);_0x2d812b[_0x1efe('0x28')]=qs[_0x1efe('0x28')](_0x1c801[_0x1efe('0x36')][_0x1efe('0x28')]);}return _0x3b36e2[_0x1efe('0x55')](_0x2d812b);}})['then'](function(_0x212f0c){if(_0x212f0c){return _0x212f0c?{'count':_0x190fcf,'rows':_0x212f0c}:null;}})[_0x1efe('0x19')](respondWithResult(_0x3714f3,null))[_0x1efe('0x4a')](handleError(_0x3714f3,null));};exports['getTags']=function(_0x5c5b49,_0x39fc45,_0x9dbffa){var _0x225980={};var _0x22ae9a={};var _0x167e6e;var _0x255d45;return db[_0x1efe('0x46')][_0x1efe('0x53')]({'where':{'id':_0x5c5b49[_0x1efe('0x4b')]['id']}})['then'](handleEntityNotFound(_0x39fc45,null))['then'](function(_0x1a9073){if(_0x1a9073){_0x167e6e=_0x1a9073;_0x22ae9a['model']=_[_0x1efe('0x37')](db[_0x1efe('0x56')][_0x1efe('0x32')]);_0x22ae9a[_0x1efe('0x36')]=_['keys'](_0x5c5b49[_0x1efe('0x36')]);_0x22ae9a[_0x1efe('0x38')]=_[_0x1efe('0x3a')](_0x22ae9a[_0x1efe('0x35')],_0x22ae9a[_0x1efe('0x36')]);_0x225980[_0x1efe('0x39')]=_['intersection'](_0x22ae9a['model'],qs[_0x1efe('0x3b')](_0x5c5b49[_0x1efe('0x36')]['fields']));_0x225980[_0x1efe('0x39')]=_0x225980['attributes'][_0x1efe('0x3c')]?_0x225980[_0x1efe('0x39')]:_0x22ae9a[_0x1efe('0x35')];_0x225980[_0x1efe('0x54')]=qs[_0x1efe('0x40')](_0x5c5b49[_0x1efe('0x36')]['sort']);_0x225980[_0x1efe('0x41')]=qs[_0x1efe('0x38')](_[_0x1efe('0x42')](_0x5c5b49[_0x1efe('0x36')],_0x22ae9a[_0x1efe('0x38')]));if(_0x5c5b49[_0x1efe('0x36')][_0x1efe('0x43')]){_0x225980[_0x1efe('0x41')]=_[_0x1efe('0x44')](_0x225980['where'],{'$or':_[_0x1efe('0x31')](_0x225980[_0x1efe('0x39')],function(_0x13eafc){var _0x58a7e7={};_0x58a7e7[_0x13eafc]={'$like':'%'+_0x5c5b49[_0x1efe('0x36')][_0x1efe('0x43')]+'%'};return _0x58a7e7;})});}_0x225980=_[_0x1efe('0x44')]({},_0x225980,_0x5c5b49[_0x1efe('0x4c')]);return _0x167e6e[_0x1efe('0x57')](_0x225980);}})[_0x1efe('0x19')](function(_0x531b1a){if(_0x531b1a){_0x255d45=_0x531b1a['length'];if(!_0x5c5b49[_0x1efe('0x36')][_0x1efe('0x3d')](_0x1efe('0x3e'))){_0x225980[_0x1efe('0x3f')]=qs['limit'](_0x5c5b49[_0x1efe('0x36')][_0x1efe('0x3f')]);_0x225980[_0x1efe('0x28')]=qs[_0x1efe('0x28')](_0x5c5b49['query'][_0x1efe('0x28')]);}return _0x167e6e[_0x1efe('0x57')](_0x225980);}})[_0x1efe('0x19')](function(_0x4339af){if(_0x4339af){return _0x4339af?{'count':_0x255d45,'rows':_0x4339af}:null;}})[_0x1efe('0x19')](respondWithResult(_0x39fc45,null))[_0x1efe('0x4a')](handleError(_0x39fc45,null));};exports['setTags']=function(_0x13d532,_0x4a44fb,_0x316a3d){if(_0x13d532[_0x1efe('0x4f')]['id']){delete _0x13d532[_0x1efe('0x4f')]['id'];}return db['DeskConfiguration'][_0x1efe('0x53')]({'where':{'id':_0x13d532[_0x1efe('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4a44fb,null))[_0x1efe('0x19')](function(_0x44b3eb){if(_0x44b3eb){return _0x44b3eb[_0x1efe('0x58')](_0x13d532[_0x1efe('0x4f')][_0x1efe('0x59')]||[]);}return null;})[_0x1efe('0x19')](respondWithResult(_0x4a44fb,null))[_0x1efe('0x4a')](handleError(_0x4a44fb,null));}; \ No newline at end of file +var _0xab60=['test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','stack','name','send','index','map','DeskConfiguration','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','params','keys','rawAttributes','include','find','create','body','update','getFields','findOne','DeskField','getSubjects','getTags','setTags','ids','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http'];(function(_0x282ccc,_0x5d66a1){var _0x27c2dd=function(_0x58431a){while(--_0x58431a){_0x282ccc['push'](_0x282ccc['shift']());}};_0x27c2dd(++_0x5d66a1);}(_0xab60,0x1d0));var _0x0ab6=function(_0x4584ed,_0x30292b){_0x4584ed=_0x4584ed-0x0;var _0x3d0859=_0xab60[_0x4584ed];return _0x3d0859;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0ab6('0x0'));var rimraf=require(_0x0ab6('0x1'));var zipdir=require(_0x0ab6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0ab6('0x3'));var Mustache=require(_0x0ab6('0x4'));var util=require(_0x0ab6('0x5'));var path=require('path');var sox=require(_0x0ab6('0x6'));var csv=require(_0x0ab6('0x7'));var ejs=require(_0x0ab6('0x8'));var fs=require('fs');var _=require(_0x0ab6('0x9'));var squel=require(_0x0ab6('0xa'));var crypto=require(_0x0ab6('0xb'));var jsforce=require(_0x0ab6('0xc'));var deskjs=require(_0x0ab6('0xd'));var toCsv=require(_0x0ab6('0x7'));var querystring=require('querystring');var Papa=require(_0x0ab6('0xe'));var Redis=require(_0x0ab6('0xf'));var authService=require(_0x0ab6('0x10'));var qs=require(_0x0ab6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ab6('0x12'));var logger=require(_0x0ab6('0x13'))(_0x0ab6('0x14'));var utils=require(_0x0ab6('0x15'));var config=require(_0x0ab6('0x16'));var db=require(_0x0ab6('0x17'))['db'];var jayson=require(_0x0ab6('0x18'));var client=jayson['client'][_0x0ab6('0x19')]({'port':0x232a});function checkPasswordPattern(_0x50c41c,_0x2ab4ef,_0x2ed4e4){if(_0x2ed4e4){var _0x506c18=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x506c18[_0x0ab6('0x1a')](_0x2ab4ef)){return _0x50c41c;}else{throw new db['Sequelize'][(_0x0ab6('0x1b'))](_0x0ab6('0x1c'));}}else{return _0x50c41c;}}function respondWithRpcPromise(_0x4a63b9,_0x5dc513,_0x3b1d7a,_0x889204){return new BPromise(function(_0x5559e7,_0x20e16a){var _0x1b6964=_0x889204||client;return _0x1b6964[_0x0ab6('0x1d')](_0x4a63b9,_0x3b1d7a)['then'](function(_0x3ffd08){logger[_0x0ab6('0x1e')](_0x0ab6('0x1f'),_0x5dc513,_0x0ab6('0x20'));logger[_0x0ab6('0x21')](_0x0ab6('0x22'),_0x5dc513,_0x0ab6('0x20'),JSON[_0x0ab6('0x23')](_0x3ffd08));if(_0x3ffd08['error']){if(_0x3ffd08[_0x0ab6('0x24')][_0x0ab6('0x25')]===0x1f4){logger['error'](_0x0ab6('0x1f'),_0x5dc513,_0x3ffd08[_0x0ab6('0x24')]['message']);return _0x20e16a(_0x3ffd08[_0x0ab6('0x24')][_0x0ab6('0x26')]);}logger[_0x0ab6('0x24')](_0x0ab6('0x1f'),_0x5dc513,_0x3ffd08[_0x0ab6('0x24')]['message']);return _0x5559e7(_0x3ffd08[_0x0ab6('0x24')][_0x0ab6('0x26')]);}else{logger[_0x0ab6('0x1e')](_0x0ab6('0x1f'),_0x5dc513,_0x0ab6('0x20'));_0x5559e7(_0x3ffd08[_0x0ab6('0x27')]['message']);}})[_0x0ab6('0x28')](function(_0x2a1d4c){logger[_0x0ab6('0x24')](_0x0ab6('0x1f'),_0x5dc513,_0x2a1d4c);_0x20e16a(_0x2a1d4c);});});}function respondWithStatusCode(_0x436cbf,_0x1250ba){_0x1250ba=_0x1250ba||0xcc;return function(_0x407c10){if(_0x407c10){return _0x436cbf[_0x0ab6('0x29')](_0x1250ba);}return _0x436cbf[_0x0ab6('0x2a')](_0x1250ba)[_0x0ab6('0x2b')]();};}function respondWithResult(_0x305ab5,_0x3becd0){_0x3becd0=_0x3becd0||0xc8;return function(_0x3190fe){if(_0x3190fe){return _0x305ab5[_0x0ab6('0x2a')](_0x3becd0)[_0x0ab6('0x2c')](_0x3190fe);}};}function respondWithFilteredResult(_0x1d9878,_0x251bca){return function(_0x4c8a4b){if(_0x4c8a4b){var _0x5924c2=_0x4c8a4b[_0x0ab6('0x2d')],_0x1c21d4=_0x251bca[_0x0ab6('0x2e')],_0x543fc7=_0x251bca[_0x0ab6('0x2e')]+_0x251bca[_0x0ab6('0x2f')],_0x2ef54e;if(_0x543fc7>=_0x5924c2){_0x543fc7=_0x5924c2;_0x2ef54e=0xc8;}else{_0x2ef54e=0xce;}_0x1d9878[_0x0ab6('0x2a')](_0x2ef54e);return _0x1d9878[_0x0ab6('0x30')]('Content-Range',_0x1c21d4+'-'+_0x543fc7+'/'+_0x5924c2)[_0x0ab6('0x2c')](_0x4c8a4b);}return null;};}function patchUpdates(_0xd577b0){return function(_0x7a6b9d){try{jsonpatch[_0x0ab6('0x31')](_0x7a6b9d,_0xd577b0,!![]);}catch(_0x55067f){return BPromise[_0x0ab6('0x32')](_0x55067f);}return _0x7a6b9d[_0x0ab6('0x33')]();};}function saveUpdates(_0x47eb03,_0x26ce20){return function(_0x168261){if(_0x168261){return _0x168261['update'](_0x47eb03)[_0x0ab6('0x34')](function(_0x9cb52c){return _0x9cb52c;});}return null;};}function removeEntity(_0x190276,_0x19ac0d){return function(_0x47ace7){if(_0x47ace7){return _0x47ace7[_0x0ab6('0x35')]()[_0x0ab6('0x34')](function(){_0x190276[_0x0ab6('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44b36d,_0x4b7948){return function(_0xf82759){if(!_0xf82759){_0x44b36d['sendStatus'](0x194);}return _0xf82759;};}function handleError(_0x25a8a9,_0x3e158c){_0x3e158c=_0x3e158c||0x1f4;return function(_0x2b7de4){logger['error'](_0x2b7de4[_0x0ab6('0x36')]);if(_0x2b7de4[_0x0ab6('0x37')]){delete _0x2b7de4['name'];}_0x25a8a9[_0x0ab6('0x2a')](_0x3e158c)[_0x0ab6('0x38')](_0x2b7de4);};}exports[_0x0ab6('0x39')]=function(_0x30fa7c,_0x320f07){var _0x6ae9c7={},_0x529ca0={},_0x4c6fe5={'count':0x0,'rows':[]};var _0x2ca84f=_[_0x0ab6('0x3a')](db[_0x0ab6('0x3b')]['rawAttributes'],function(_0x1894ec){return{'name':_0x1894ec[_0x0ab6('0x3c')],'type':_0x1894ec[_0x0ab6('0x3d')][_0x0ab6('0x3e')]};});_0x529ca0[_0x0ab6('0x3f')]=_[_0x0ab6('0x3a')](_0x2ca84f,_0x0ab6('0x37'));_0x529ca0[_0x0ab6('0x40')]=_['keys'](_0x30fa7c[_0x0ab6('0x40')]);_0x529ca0[_0x0ab6('0x41')]=_[_0x0ab6('0x42')](_0x529ca0[_0x0ab6('0x3f')],_0x529ca0[_0x0ab6('0x40')]);_0x6ae9c7['attributes']=_[_0x0ab6('0x42')](_0x529ca0[_0x0ab6('0x3f')],qs['fields'](_0x30fa7c['query'][_0x0ab6('0x43')]));_0x6ae9c7['attributes']=_0x6ae9c7[_0x0ab6('0x44')][_0x0ab6('0x45')]?_0x6ae9c7[_0x0ab6('0x44')]:_0x529ca0[_0x0ab6('0x3f')];if(!_0x30fa7c['query'][_0x0ab6('0x46')](_0x0ab6('0x47'))){_0x6ae9c7[_0x0ab6('0x2f')]=qs[_0x0ab6('0x2f')](_0x30fa7c[_0x0ab6('0x40')][_0x0ab6('0x2f')]);_0x6ae9c7[_0x0ab6('0x2e')]=qs[_0x0ab6('0x2e')](_0x30fa7c[_0x0ab6('0x40')]['offset']);}_0x6ae9c7[_0x0ab6('0x48')]=qs[_0x0ab6('0x49')](_0x30fa7c[_0x0ab6('0x40')]['sort']);_0x6ae9c7['where']=qs[_0x0ab6('0x41')](_[_0x0ab6('0x4a')](_0x30fa7c['query'],_0x529ca0['filters']));if(_0x30fa7c[_0x0ab6('0x40')]['filter']){_0x6ae9c7[_0x0ab6('0x4b')]=_[_0x0ab6('0x4c')](_0x6ae9c7[_0x0ab6('0x4b')],{'$or':_[_0x0ab6('0x3a')](_0x2ca84f,function(_0x2cbfcb){if(_0x2cbfcb[_0x0ab6('0x3d')]!==_0x0ab6('0x4d')){var _0x26e8f9={};_0x26e8f9[_0x2cbfcb[_0x0ab6('0x37')]]={'$like':'%'+_0x30fa7c['query'][_0x0ab6('0x4e')]+'%'};return _0x26e8f9;}})});}_0x6ae9c7=_[_0x0ab6('0x4c')]({},_0x6ae9c7,_0x30fa7c[_0x0ab6('0x4f')]);var _0x2af4b1={'where':_0x6ae9c7[_0x0ab6('0x4b')]};return db[_0x0ab6('0x3b')][_0x0ab6('0x2d')](_0x2af4b1)[_0x0ab6('0x34')](function(_0x503f27){_0x4c6fe5[_0x0ab6('0x2d')]=_0x503f27;if(_0x30fa7c['query'][_0x0ab6('0x50')]){_0x6ae9c7['include']=[{'all':!![]}];}return db[_0x0ab6('0x3b')][_0x0ab6('0x51')](_0x6ae9c7);})[_0x0ab6('0x34')](function(_0x152c7e){_0x4c6fe5[_0x0ab6('0x52')]=_0x152c7e;return _0x4c6fe5;})[_0x0ab6('0x34')](respondWithFilteredResult(_0x320f07,_0x6ae9c7))[_0x0ab6('0x28')](handleError(_0x320f07,null));};exports['show']=function(_0x50722e,_0x5107eb){var _0x37ca48={'raw':![],'where':{'id':_0x50722e[_0x0ab6('0x53')]['id']}},_0x43e0b7={};_0x43e0b7[_0x0ab6('0x3f')]=_[_0x0ab6('0x54')](db['DeskConfiguration'][_0x0ab6('0x55')]);_0x43e0b7[_0x0ab6('0x40')]=_['keys'](_0x50722e['query']);_0x43e0b7[_0x0ab6('0x41')]=_[_0x0ab6('0x42')](_0x43e0b7[_0x0ab6('0x3f')],_0x43e0b7[_0x0ab6('0x40')]);_0x37ca48[_0x0ab6('0x44')]=_[_0x0ab6('0x42')](_0x43e0b7['model'],qs['fields'](_0x50722e[_0x0ab6('0x40')][_0x0ab6('0x43')]));_0x37ca48[_0x0ab6('0x44')]=_0x37ca48[_0x0ab6('0x44')]['length']?_0x37ca48[_0x0ab6('0x44')]:_0x43e0b7[_0x0ab6('0x3f')];if(_0x50722e[_0x0ab6('0x40')][_0x0ab6('0x50')]){_0x37ca48[_0x0ab6('0x56')]=[{'all':!![]}];}_0x37ca48=_[_0x0ab6('0x4c')]({},_0x37ca48,_0x50722e[_0x0ab6('0x4f')]);return db['DeskConfiguration'][_0x0ab6('0x57')](_0x37ca48)[_0x0ab6('0x34')](handleEntityNotFound(_0x5107eb,null))['then'](respondWithResult(_0x5107eb,null))[_0x0ab6('0x28')](handleError(_0x5107eb,null));};exports[_0x0ab6('0x58')]=function(_0x12d046,_0x12e5b5){return db[_0x0ab6('0x3b')]['create'](_0x12d046[_0x0ab6('0x59')],{})[_0x0ab6('0x34')](respondWithResult(_0x12e5b5,0xc9))[_0x0ab6('0x28')](handleError(_0x12e5b5,null));};exports[_0x0ab6('0x5a')]=function(_0x3b376c,_0x3b0e1a){if(_0x3b376c[_0x0ab6('0x59')]['id']){delete _0x3b376c[_0x0ab6('0x59')]['id'];}return db[_0x0ab6('0x3b')][_0x0ab6('0x57')]({'where':{'id':_0x3b376c[_0x0ab6('0x53')]['id']}})[_0x0ab6('0x34')](handleEntityNotFound(_0x3b0e1a,null))[_0x0ab6('0x34')](saveUpdates(_0x3b376c[_0x0ab6('0x59')],null))[_0x0ab6('0x34')](respondWithResult(_0x3b0e1a,null))[_0x0ab6('0x28')](handleError(_0x3b0e1a,null));};exports[_0x0ab6('0x35')]=function(_0xa5c87c,_0xc4adfe){return db[_0x0ab6('0x3b')]['find']({'where':{'id':_0xa5c87c['params']['id']}})['then'](handleEntityNotFound(_0xc4adfe,null))[_0x0ab6('0x34')](removeEntity(_0xc4adfe,null))[_0x0ab6('0x28')](handleError(_0xc4adfe,null));};exports[_0x0ab6('0x5b')]=function(_0x2234f3,_0x5a4551,_0x4fc785){var _0x2df64d={};var _0x16f5bf={};var _0xbb80ce;var _0x18865d;return db['DeskConfiguration'][_0x0ab6('0x5c')]({'where':{'id':_0x2234f3[_0x0ab6('0x53')]['id']}})['then'](handleEntityNotFound(_0x5a4551,null))[_0x0ab6('0x34')](function(_0x3f9dac){if(_0x3f9dac){_0xbb80ce=_0x3f9dac;_0x16f5bf[_0x0ab6('0x3f')]=_['keys'](db[_0x0ab6('0x5d')]['rawAttributes']);_0x16f5bf[_0x0ab6('0x40')]=_[_0x0ab6('0x54')](_0x2234f3[_0x0ab6('0x40')]);_0x16f5bf[_0x0ab6('0x41')]=_[_0x0ab6('0x42')](_0x16f5bf[_0x0ab6('0x3f')],_0x16f5bf[_0x0ab6('0x40')]);_0x2df64d[_0x0ab6('0x44')]=_[_0x0ab6('0x42')](_0x16f5bf['model'],qs[_0x0ab6('0x43')](_0x2234f3[_0x0ab6('0x40')][_0x0ab6('0x43')]));_0x2df64d[_0x0ab6('0x44')]=_0x2df64d[_0x0ab6('0x44')][_0x0ab6('0x45')]?_0x2df64d[_0x0ab6('0x44')]:_0x16f5bf[_0x0ab6('0x3f')];_0x2df64d[_0x0ab6('0x48')]=qs[_0x0ab6('0x49')](_0x2234f3[_0x0ab6('0x40')][_0x0ab6('0x49')]);_0x2df64d[_0x0ab6('0x4b')]=qs[_0x0ab6('0x41')](_[_0x0ab6('0x4a')](_0x2234f3['query'],_0x16f5bf[_0x0ab6('0x41')]));if(_0x2234f3['query'][_0x0ab6('0x4e')]){_0x2df64d[_0x0ab6('0x4b')]=_[_0x0ab6('0x4c')](_0x2df64d['where'],{'$or':_[_0x0ab6('0x3a')](_0x2df64d['attributes'],function(_0x102ece){var _0x383c06={};_0x383c06[_0x102ece]={'$like':'%'+_0x2234f3[_0x0ab6('0x40')][_0x0ab6('0x4e')]+'%'};return _0x383c06;})});}_0x2df64d=_[_0x0ab6('0x4c')]({},_0x2df64d,_0x2234f3['options']);return _0xbb80ce[_0x0ab6('0x5b')](_0x2df64d);}})['then'](function(_0x4b2543){if(_0x4b2543){_0x18865d=_0x4b2543[_0x0ab6('0x45')];if(!_0x2234f3[_0x0ab6('0x40')][_0x0ab6('0x46')](_0x0ab6('0x47'))){_0x2df64d[_0x0ab6('0x2f')]=qs[_0x0ab6('0x2f')](_0x2234f3['query']['limit']);_0x2df64d[_0x0ab6('0x2e')]=qs['offset'](_0x2234f3['query'][_0x0ab6('0x2e')]);}return _0xbb80ce['getFields'](_0x2df64d);}})[_0x0ab6('0x34')](function(_0x242388){if(_0x242388){return _0x242388?{'count':_0x18865d,'rows':_0x242388}:null;}})[_0x0ab6('0x34')](respondWithResult(_0x5a4551,null))[_0x0ab6('0x28')](handleError(_0x5a4551,null));};exports['getSubjects']=function(_0x3d88bf,_0x2f51b4,_0xb959e9){var _0x3d732d={};var _0x3e2212={};var _0xc031c1;var _0x234fa0;return db['DeskConfiguration'][_0x0ab6('0x5c')]({'where':{'id':_0x3d88bf[_0x0ab6('0x53')]['id']}})[_0x0ab6('0x34')](handleEntityNotFound(_0x2f51b4,null))['then'](function(_0x5da6c8){if(_0x5da6c8){_0xc031c1=_0x5da6c8;_0x3e2212[_0x0ab6('0x3f')]=_['keys'](db[_0x0ab6('0x5d')][_0x0ab6('0x55')]);_0x3e2212[_0x0ab6('0x40')]=_[_0x0ab6('0x54')](_0x3d88bf[_0x0ab6('0x40')]);_0x3e2212[_0x0ab6('0x41')]=_[_0x0ab6('0x42')](_0x3e2212[_0x0ab6('0x3f')],_0x3e2212[_0x0ab6('0x40')]);_0x3d732d[_0x0ab6('0x44')]=_[_0x0ab6('0x42')](_0x3e2212[_0x0ab6('0x3f')],qs[_0x0ab6('0x43')](_0x3d88bf['query'][_0x0ab6('0x43')]));_0x3d732d[_0x0ab6('0x44')]=_0x3d732d[_0x0ab6('0x44')][_0x0ab6('0x45')]?_0x3d732d[_0x0ab6('0x44')]:_0x3e2212[_0x0ab6('0x3f')];_0x3d732d[_0x0ab6('0x48')]=qs['sort'](_0x3d88bf[_0x0ab6('0x40')][_0x0ab6('0x49')]);_0x3d732d['where']=qs['filters'](_[_0x0ab6('0x4a')](_0x3d88bf[_0x0ab6('0x40')],_0x3e2212[_0x0ab6('0x41')]));if(_0x3d88bf[_0x0ab6('0x40')]['filter']){_0x3d732d['where']=_[_0x0ab6('0x4c')](_0x3d732d[_0x0ab6('0x4b')],{'$or':_[_0x0ab6('0x3a')](_0x3d732d[_0x0ab6('0x44')],function(_0x2d8730){var _0xd2d62a={};_0xd2d62a[_0x2d8730]={'$like':'%'+_0x3d88bf[_0x0ab6('0x40')][_0x0ab6('0x4e')]+'%'};return _0xd2d62a;})});}_0x3d732d=_['merge']({},_0x3d732d,_0x3d88bf['options']);return _0xc031c1[_0x0ab6('0x5e')](_0x3d732d);}})['then'](function(_0x3f5a7f){if(_0x3f5a7f){_0x234fa0=_0x3f5a7f[_0x0ab6('0x45')];if(!_0x3d88bf['query'][_0x0ab6('0x46')](_0x0ab6('0x47'))){_0x3d732d['limit']=qs[_0x0ab6('0x2f')](_0x3d88bf[_0x0ab6('0x40')]['limit']);_0x3d732d[_0x0ab6('0x2e')]=qs[_0x0ab6('0x2e')](_0x3d88bf[_0x0ab6('0x40')][_0x0ab6('0x2e')]);}return _0xc031c1['getSubjects'](_0x3d732d);}})[_0x0ab6('0x34')](function(_0x96fc29){if(_0x96fc29){return _0x96fc29?{'count':_0x234fa0,'rows':_0x96fc29}:null;}})[_0x0ab6('0x34')](respondWithResult(_0x2f51b4,null))[_0x0ab6('0x28')](handleError(_0x2f51b4,null));};exports['getDescriptions']=function(_0xaf8a7e,_0x4a0323,_0x3a0c29){var _0x59a52c={};var _0x189d43={};var _0x1da80f;var _0xc4c40f;return db[_0x0ab6('0x3b')][_0x0ab6('0x5c')]({'where':{'id':_0xaf8a7e['params']['id']}})[_0x0ab6('0x34')](handleEntityNotFound(_0x4a0323,null))[_0x0ab6('0x34')](function(_0x45a3da){if(_0x45a3da){_0x1da80f=_0x45a3da;_0x189d43[_0x0ab6('0x3f')]=_[_0x0ab6('0x54')](db[_0x0ab6('0x5d')][_0x0ab6('0x55')]);_0x189d43[_0x0ab6('0x40')]=_['keys'](_0xaf8a7e[_0x0ab6('0x40')]);_0x189d43[_0x0ab6('0x41')]=_[_0x0ab6('0x42')](_0x189d43[_0x0ab6('0x3f')],_0x189d43[_0x0ab6('0x40')]);_0x59a52c[_0x0ab6('0x44')]=_[_0x0ab6('0x42')](_0x189d43[_0x0ab6('0x3f')],qs['fields'](_0xaf8a7e[_0x0ab6('0x40')][_0x0ab6('0x43')]));_0x59a52c[_0x0ab6('0x44')]=_0x59a52c[_0x0ab6('0x44')][_0x0ab6('0x45')]?_0x59a52c[_0x0ab6('0x44')]:_0x189d43[_0x0ab6('0x3f')];_0x59a52c[_0x0ab6('0x48')]=qs[_0x0ab6('0x49')](_0xaf8a7e[_0x0ab6('0x40')]['sort']);_0x59a52c[_0x0ab6('0x4b')]=qs[_0x0ab6('0x41')](_[_0x0ab6('0x4a')](_0xaf8a7e[_0x0ab6('0x40')],_0x189d43['filters']));if(_0xaf8a7e[_0x0ab6('0x40')][_0x0ab6('0x4e')]){_0x59a52c[_0x0ab6('0x4b')]=_[_0x0ab6('0x4c')](_0x59a52c[_0x0ab6('0x4b')],{'$or':_['map'](_0x59a52c[_0x0ab6('0x44')],function(_0x293ea3){var _0x4b7475={};_0x4b7475[_0x293ea3]={'$like':'%'+_0xaf8a7e[_0x0ab6('0x40')][_0x0ab6('0x4e')]+'%'};return _0x4b7475;})});}_0x59a52c=_[_0x0ab6('0x4c')]({},_0x59a52c,_0xaf8a7e[_0x0ab6('0x4f')]);return _0x1da80f['getDescriptions'](_0x59a52c);}})['then'](function(_0x250595){if(_0x250595){_0xc4c40f=_0x250595[_0x0ab6('0x45')];if(!_0xaf8a7e[_0x0ab6('0x40')][_0x0ab6('0x46')](_0x0ab6('0x47'))){_0x59a52c['limit']=qs[_0x0ab6('0x2f')](_0xaf8a7e[_0x0ab6('0x40')]['limit']);_0x59a52c[_0x0ab6('0x2e')]=qs[_0x0ab6('0x2e')](_0xaf8a7e['query']['offset']);}return _0x1da80f['getDescriptions'](_0x59a52c);}})[_0x0ab6('0x34')](function(_0xba48ae){if(_0xba48ae){return _0xba48ae?{'count':_0xc4c40f,'rows':_0xba48ae}:null;}})[_0x0ab6('0x34')](respondWithResult(_0x4a0323,null))['catch'](handleError(_0x4a0323,null));};exports['getTags']=function(_0x5aec80,_0x45fd37,_0x2de3b2){var _0x5459c6={};var _0x10f989={};var _0xc615e5;var _0x32f897;return db[_0x0ab6('0x3b')][_0x0ab6('0x5c')]({'where':{'id':_0x5aec80[_0x0ab6('0x53')]['id']}})[_0x0ab6('0x34')](handleEntityNotFound(_0x45fd37,null))[_0x0ab6('0x34')](function(_0x2d1ae1){if(_0x2d1ae1){_0xc615e5=_0x2d1ae1;_0x10f989[_0x0ab6('0x3f')]=_[_0x0ab6('0x54')](db['Tag'][_0x0ab6('0x55')]);_0x10f989['query']=_[_0x0ab6('0x54')](_0x5aec80[_0x0ab6('0x40')]);_0x10f989[_0x0ab6('0x41')]=_[_0x0ab6('0x42')](_0x10f989[_0x0ab6('0x3f')],_0x10f989[_0x0ab6('0x40')]);_0x5459c6[_0x0ab6('0x44')]=_[_0x0ab6('0x42')](_0x10f989['model'],qs[_0x0ab6('0x43')](_0x5aec80['query']['fields']));_0x5459c6[_0x0ab6('0x44')]=_0x5459c6['attributes']['length']?_0x5459c6[_0x0ab6('0x44')]:_0x10f989[_0x0ab6('0x3f')];_0x5459c6[_0x0ab6('0x48')]=qs['sort'](_0x5aec80[_0x0ab6('0x40')][_0x0ab6('0x49')]);_0x5459c6[_0x0ab6('0x4b')]=qs[_0x0ab6('0x41')](_['pick'](_0x5aec80[_0x0ab6('0x40')],_0x10f989[_0x0ab6('0x41')]));if(_0x5aec80['query']['filter']){_0x5459c6[_0x0ab6('0x4b')]=_[_0x0ab6('0x4c')](_0x5459c6[_0x0ab6('0x4b')],{'$or':_[_0x0ab6('0x3a')](_0x5459c6[_0x0ab6('0x44')],function(_0x20d50b){var _0x55ebca={};_0x55ebca[_0x20d50b]={'$like':'%'+_0x5aec80[_0x0ab6('0x40')][_0x0ab6('0x4e')]+'%'};return _0x55ebca;})});}_0x5459c6=_[_0x0ab6('0x4c')]({},_0x5459c6,_0x5aec80[_0x0ab6('0x4f')]);return _0xc615e5[_0x0ab6('0x5f')](_0x5459c6);}})[_0x0ab6('0x34')](function(_0x43e3ee){if(_0x43e3ee){_0x32f897=_0x43e3ee[_0x0ab6('0x45')];if(!_0x5aec80['query'][_0x0ab6('0x46')]('nolimit')){_0x5459c6[_0x0ab6('0x2f')]=qs[_0x0ab6('0x2f')](_0x5aec80[_0x0ab6('0x40')][_0x0ab6('0x2f')]);_0x5459c6['offset']=qs[_0x0ab6('0x2e')](_0x5aec80[_0x0ab6('0x40')]['offset']);}return _0xc615e5[_0x0ab6('0x5f')](_0x5459c6);}})[_0x0ab6('0x34')](function(_0x5718d0){if(_0x5718d0){return _0x5718d0?{'count':_0x32f897,'rows':_0x5718d0}:null;}})['then'](respondWithResult(_0x45fd37,null))[_0x0ab6('0x28')](handleError(_0x45fd37,null));};exports[_0x0ab6('0x60')]=function(_0x37b191,_0xcd445c,_0x43b527){if(_0x37b191[_0x0ab6('0x59')]['id']){delete _0x37b191[_0x0ab6('0x59')]['id'];}return db[_0x0ab6('0x3b')][_0x0ab6('0x5c')]({'where':{'id':_0x37b191['params']['id']}})[_0x0ab6('0x34')](handleEntityNotFound(_0xcd445c,null))['then'](function(_0x280ba4){if(_0x280ba4){return _0x280ba4[_0x0ab6('0x60')](_0x37b191['body'][_0x0ab6('0x61')]||[]);}return null;})['then'](respondWithResult(_0xcd445c,null))['catch'](handleError(_0xcd445c,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 80a6315..4c7cc27 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 _0xcd4e=['moment','bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','util','../../config/logger','api'];(function(_0x35e04a,_0x2af41b){var _0x319987=function(_0x13848a){while(--_0x13848a){_0x35e04a['push'](_0x35e04a['shift']());}};_0x319987(++_0x2af41b);}(_0xcd4e,0xc9));var _0xecd4=function(_0x41c92f,_0x1d4365){_0x41c92f=_0x41c92f-0x0;var _0x2a270b=_0xcd4e[_0x41c92f];return _0x2a270b;};'use strict';var _=require('lodash');var util=require(_0xecd4('0x0'));var logger=require(_0xecd4('0x1'))(_0xecd4('0x2'));var moment=require(_0xecd4('0x3'));var BPromise=require(_0xecd4('0x4'));var rp=require(_0xecd4('0x5'));var fs=require('fs');var path=require(_0xecd4('0x6'));var rimraf=require(_0xecd4('0x7'));var config=require('../../config/environment');var attributes=require(_0xecd4('0x8'));module[_0xecd4('0x9')]=function(_0x332c40,_0xf09f5e){return _0x332c40[_0xecd4('0xa')](_0xecd4('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52b7=['define','DeskConfiguration','int_desk_configurations','lodash','util','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0x18dd3e,_0x4db54d){var _0x2df0ee=function(_0x24d55c){while(--_0x24d55c){_0x18dd3e['push'](_0x18dd3e['shift']());}};_0x2df0ee(++_0x4db54d);}(_0x52b7,0x1c5));var _0x752b=function(_0x41775d,_0x33ce2b){_0x41775d=_0x41775d-0x0;var _0x35ef31=_0x52b7[_0x41775d];return _0x35ef31;};'use strict';var _=require(_0x752b('0x0'));var util=require(_0x752b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x752b('0x2'));var BPromise=require(_0x752b('0x3'));var rp=require(_0x752b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x752b('0x5'));var attributes=require('./intDeskConfiguration.attributes');module[_0x752b('0x6')]=function(_0x1db017,_0x10fbef){return _0x1db017[_0x752b('0x7')](_0x752b('0x8'),attributes,{'tableName':_0x752b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 9d49a67..db6f3e1 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 _0x96cc=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis'];(function(_0x25519a,_0x221468){var _0x353009=function(_0x2fb11b){while(--_0x2fb11b){_0x25519a['push'](_0x25519a['shift']());}};_0x353009(++_0x221468);}(_0x96cc,0x16c));var _0xc96c=function(_0x19cb5a,_0x583fbd){_0x19cb5a=_0x19cb5a-0x0;var _0x9b2f0f=_0x96cc[_0x19cb5a];return _0x9b2f0f;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var moment=require(_0xc96c('0x1'));var BPromise=require('bluebird');var rs=require(_0xc96c('0x2'));var fs=require('fs');var Redis=require(_0xc96c('0x3'));var db=require(_0xc96c('0x4'))['db'];var utils=require(_0xc96c('0x5'));var logger=require(_0xc96c('0x6'))(_0xc96c('0x7'));var config=require(_0xc96c('0x8'));var jayson=require(_0xc96c('0x9'));var client=jayson[_0xc96c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b411,_0x18eb9c,_0x408afb){return new BPromise(function(_0x86c1a8,_0x13363d){return client[_0xc96c('0xb')](_0x10b411,_0x408afb)[_0xc96c('0xc')](function(_0x54e765){logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));logger['debug'](_0xc96c('0x10'),_0x18eb9c,'request\x20sent',JSON[_0xc96c('0x11')](_0x54e765));if(_0x54e765['error']){if(_0x54e765[_0xc96c('0x12')][_0xc96c('0x13')]===0x1f4){logger[_0xc96c('0x12')](_0xc96c('0xe'),_0x18eb9c,_0x54e765['error'][_0xc96c('0x14')]);return _0x13363d(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}logger[_0xc96c('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x18eb9c,_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);return _0x86c1a8(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}else{logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));_0x86c1a8(_0x54e765[_0xc96c('0x15')][_0xc96c('0x14')]);}})[_0xc96c('0x16')](function(_0x861230){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x18eb9c,_0x861230);_0x13363d(_0x861230);});});} \ No newline at end of file +var _0xf6e8=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3a853e,_0x39ddf1){var _0x5f3323=function(_0x2a33e3){while(--_0x2a33e3){_0x3a853e['push'](_0x3a853e['shift']());}};_0x5f3323(++_0x39ddf1);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x26b44c,_0x25dee2){_0x26b44c=_0x26b44c-0x0;var _0x1c27ca=_0xf6e8[_0x26b44c];return _0x1c27ca;};'use strict';var _=require('lodash');var util=require(_0x8f6e('0x0'));var moment=require(_0x8f6e('0x1'));var BPromise=require(_0x8f6e('0x2'));var rs=require(_0x8f6e('0x3'));var fs=require('fs');var Redis=require(_0x8f6e('0x4'));var db=require(_0x8f6e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f6e('0x6'))('rpc');var config=require(_0x8f6e('0x7'));var jayson=require(_0x8f6e('0x8'));var client=jayson['client'][_0x8f6e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233158,_0xd26126,_0x71b52c){return new BPromise(function(_0x423ed4,_0x105076){return client[_0x8f6e('0xa')](_0x233158,_0x71b52c)[_0x8f6e('0xb')](function(_0x364ade){logger[_0x8f6e('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0xd26126,_0x8f6e('0xd'));logger[_0x8f6e('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0xd26126,_0x8f6e('0xd'),JSON[_0x8f6e('0xf')](_0x364ade));if(_0x364ade[_0x8f6e('0x10')]){if(_0x364ade[_0x8f6e('0x10')][_0x8f6e('0x11')]===0x1f4){logger[_0x8f6e('0x10')](_0x8f6e('0x12'),_0xd26126,_0x364ade[_0x8f6e('0x10')][_0x8f6e('0x13')]);return _0x105076(_0x364ade[_0x8f6e('0x10')][_0x8f6e('0x13')]);}logger[_0x8f6e('0x10')](_0x8f6e('0x12'),_0xd26126,_0x364ade['error'][_0x8f6e('0x13')]);return _0x423ed4(_0x364ade[_0x8f6e('0x10')]['message']);}else{logger[_0x8f6e('0xc')](_0x8f6e('0x12'),_0xd26126,_0x8f6e('0xd'));_0x423ed4(_0x364ade['result']['message']);}})['catch'](function(_0x201991){logger[_0x8f6e('0x10')](_0x8f6e('0x12'),_0xd26126,_0x201991);_0x105076(_0x201991);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 377fecd..a84e295 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 _0xbe89=['index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3bc75c,_0x17cf43){var _0x362e72=function(_0x3554b3){while(--_0x3554b3){_0x3bc75c['push'](_0x3bc75c['shift']());}};_0x362e72(++_0x17cf43);}(_0xbe89,0x7b));var _0x9be8=function(_0x2c6b4c,_0x33cc1e){_0x2c6b4c=_0x2c6b4c-0x0;var _0x4b573a=_0xbe89[_0x2c6b4c];return _0x4b573a;};'use strict';var multer=require(_0x9be8('0x0'));var util=require(_0x9be8('0x1'));var path=require(_0x9be8('0x2'));var timeout=require(_0x9be8('0x3'));var express=require('express');var router=express[_0x9be8('0x4')]();var auth=require(_0x9be8('0x5'));var interaction=require(_0x9be8('0x6'));var config=require(_0x9be8('0x7'));var controller=require('./intDeskField.controller');router[_0x9be8('0x8')]('/',auth[_0x9be8('0x9')](),controller[_0x9be8('0xa')]);router[_0x9be8('0x8')](_0x9be8('0xb'),auth[_0x9be8('0x9')](),controller[_0x9be8('0xc')]);router[_0x9be8('0xd')]('/',auth[_0x9be8('0x9')](),controller[_0x9be8('0xe')]);router[_0x9be8('0xf')]('/:id',auth[_0x9be8('0x9')](),controller[_0x9be8('0x10')]);router[_0x9be8('0x11')](_0x9be8('0xb'),auth[_0x9be8('0x9')](),controller[_0x9be8('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7984=['put','update','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','create'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0x7984,0x18b));var _0x4798=function(_0x2e0a99,_0x5411d7){_0x2e0a99=_0x2e0a99-0x0;var _0xfcf3c2=_0x7984[_0x2e0a99];return _0xfcf3c2;};'use strict';var multer=require(_0x4798('0x0'));var util=require(_0x4798('0x1'));var path=require(_0x4798('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4798('0x3')]();var auth=require(_0x4798('0x4'));var interaction=require(_0x4798('0x5'));var config=require(_0x4798('0x6'));var controller=require(_0x4798('0x7'));router[_0x4798('0x8')]('/',auth[_0x4798('0x9')](),controller[_0x4798('0xa')]);router[_0x4798('0x8')](_0x4798('0xb'),auth[_0x4798('0x9')](),controller['show']);router['post']('/',auth[_0x4798('0x9')](),controller[_0x4798('0xc')]);router[_0x4798('0xd')](_0x4798('0xb'),auth[_0x4798('0x9')](),controller[_0x4798('0xe')]);router[_0x4798('0xf')](_0x4798('0xb'),auth[_0x4798('0x9')](),controller[_0x4798('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 808e48d..55f1027 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 _0x84b3=['string','customVariable','keyValue','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x1b97f3,_0xce63f3){var _0x32d818=function(_0x9671b7){while(--_0x9671b7){_0x1b97f3['push'](_0x1b97f3['shift']());}};_0x32d818(++_0xce63f3);}(_0x84b3,0xa8));var _0x384b=function(_0x16ccf0,_0x43bb7b){_0x16ccf0=_0x16ccf0-0x0;var _0xac32c=_0x84b3[_0x16ccf0];return _0xac32c;};'use strict';var Sequelize=require(_0x384b('0x0'));module[_0x384b('0x1')]={'type':{'type':Sequelize[_0x384b('0x2')](_0x384b('0x3'),'variable',_0x384b('0x4'),_0x384b('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x384b('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x384b('0x2')](_0x384b('0x3'),_0x384b('0x7'),_0x384b('0x4'))},'keyContent':{'type':Sequelize[_0x384b('0x6')]},'idField':{'type':Sequelize[_0x384b('0x6')]},'nameField':{'type':Sequelize[_0x384b('0x6')]},'customField':{'type':Sequelize[_0x384b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x384b('0x6')]}}; \ No newline at end of file +var _0x4562=['string','STRING','sequelize','exports','ENUM','variable','customVariable','keyValue'];(function(_0xb0d4a2,_0x48181b){var _0x4bd10f=function(_0x4d8810){while(--_0x4d8810){_0xb0d4a2['push'](_0xb0d4a2['shift']());}};_0x4bd10f(++_0x48181b);}(_0x4562,0x10a));var _0x2456=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4562[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x2456('0x0'));module[_0x2456('0x1')]={'type':{'type':Sequelize[_0x2456('0x2')]('string',_0x2456('0x3'),_0x2456('0x4'),_0x2456('0x5')),'defaultValue':_0x2456('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2456('0x7')]},'keyType':{'type':Sequelize[_0x2456('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x2456('0x7')]},'idField':{'type':Sequelize[_0x2456('0x7')]},'nameField':{'type':Sequelize[_0x2456('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2456('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 999c7cb..1b48abe 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 _0x79a8=['save','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','catch','params','fields','length','find','create','body','update','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject'];(function(_0xd95dd8,_0x502e38){var _0x24e1bc=function(_0x56f6ba){while(--_0x56f6ba){_0xd95dd8['push'](_0xd95dd8['shift']());}};_0x24e1bc(++_0x502e38);}(_0x79a8,0x1d0));var _0x879a=function(_0x168f21,_0x70b14){_0x168f21=_0x168f21-0x0;var _0x66dba=_0x79a8[_0x168f21];return _0x66dba;};'use strict';var pdf=require(_0x879a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x879a('0x1'));var zipdir=require(_0x879a('0x2'));var jsonpatch=require(_0x879a('0x3'));var rp=require('request-promise');var moment=require(_0x879a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x879a('0x5'));var util=require(_0x879a('0x6'));var path=require(_0x879a('0x7'));var sox=require(_0x879a('0x8'));var csv=require(_0x879a('0x9'));var ejs=require(_0x879a('0xa'));var fs=require('fs');var _=require(_0x879a('0xb'));var squel=require(_0x879a('0xc'));var crypto=require('crypto');var jsforce=require(_0x879a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x879a('0x9'));var querystring=require(_0x879a('0xe'));var Papa=require('papaparse');var Redis=require(_0x879a('0xf'));var authService=require(_0x879a('0x10'));var qs=require(_0x879a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x879a('0x12'));var logger=require(_0x879a('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x879a('0x14'));var db=require(_0x879a('0x15'))['db'];function respondWithStatusCode(_0x3391c8,_0x320115){_0x320115=_0x320115||0xcc;return function(_0x54a9b6){if(_0x54a9b6){return _0x3391c8[_0x879a('0x16')](_0x320115);}return _0x3391c8[_0x879a('0x17')](_0x320115)[_0x879a('0x18')]();};}function respondWithResult(_0x1ea66e,_0x1a20c5){_0x1a20c5=_0x1a20c5||0xc8;return function(_0x1c2853){if(_0x1c2853){return _0x1ea66e[_0x879a('0x17')](_0x1a20c5)[_0x879a('0x19')](_0x1c2853);}};}function respondWithFilteredResult(_0x1746b6,_0x16b649){return function(_0x5b4dbe){if(_0x5b4dbe){var _0x4a1e0e=_0x5b4dbe[_0x879a('0x1a')],_0x3b8680=_0x16b649[_0x879a('0x1b')],_0x1c1f08=_0x16b649[_0x879a('0x1b')]+_0x16b649[_0x879a('0x1c')],_0x4b1f67;if(_0x1c1f08>=_0x4a1e0e){_0x1c1f08=_0x4a1e0e;_0x4b1f67=0xc8;}else{_0x4b1f67=0xce;}_0x1746b6[_0x879a('0x17')](_0x4b1f67);return _0x1746b6[_0x879a('0x1d')](_0x879a('0x1e'),_0x3b8680+'-'+_0x1c1f08+'/'+_0x4a1e0e)[_0x879a('0x19')](_0x5b4dbe);}return null;};}function patchUpdates(_0x1ed368){return function(_0x12b1f9){try{jsonpatch[_0x879a('0x1f')](_0x12b1f9,_0x1ed368,!![]);}catch(_0x295caf){return BPromise[_0x879a('0x20')](_0x295caf);}return _0x12b1f9[_0x879a('0x21')]();};}function saveUpdates(_0x5aeb90,_0x830b36){return function(_0x326e6a){if(_0x326e6a){return _0x326e6a['update'](_0x5aeb90)[_0x879a('0x22')](function(_0x4113e1){return _0x4113e1;});}return null;};}function removeEntity(_0x4dd092,_0x56e394){return function(_0x4ed0d6){if(_0x4ed0d6){return _0x4ed0d6[_0x879a('0x23')]()[_0x879a('0x22')](function(){_0x4dd092[_0x879a('0x17')](0xcc)[_0x879a('0x18')]();});}};}function handleEntityNotFound(_0x4c3808,_0x5c21e2){return function(_0x3674f9){if(!_0x3674f9){_0x4c3808[_0x879a('0x16')](0x194);}return _0x3674f9;};}function handleError(_0x2b69be,_0x259ad3){_0x259ad3=_0x259ad3||0x1f4;return function(_0x88e92f){logger[_0x879a('0x24')](_0x88e92f[_0x879a('0x25')]);if(_0x88e92f[_0x879a('0x26')]){delete _0x88e92f[_0x879a('0x26')];}_0x2b69be[_0x879a('0x17')](_0x259ad3)[_0x879a('0x27')](_0x88e92f);};}exports[_0x879a('0x28')]=function(_0x18c10f,_0x583b5c){var _0x51a665={},_0x2cd769={},_0x92c805={'count':0x0,'rows':[]};var _0x39d0c9=_[_0x879a('0x29')](db[_0x879a('0x2a')][_0x879a('0x2b')],function(_0x2d9ed3){return{'name':_0x2d9ed3[_0x879a('0x2c')],'type':_0x2d9ed3[_0x879a('0x2d')][_0x879a('0x2e')]};});_0x2cd769[_0x879a('0x2f')]=_[_0x879a('0x29')](_0x39d0c9,_0x879a('0x26'));_0x2cd769[_0x879a('0x30')]=_[_0x879a('0x31')](_0x18c10f[_0x879a('0x30')]);_0x2cd769[_0x879a('0x32')]=_['intersection'](_0x2cd769[_0x879a('0x2f')],_0x2cd769['query']);_0x51a665[_0x879a('0x33')]=_[_0x879a('0x34')](_0x2cd769[_0x879a('0x2f')],qs['fields'](_0x18c10f[_0x879a('0x30')]['fields']));_0x51a665['attributes']=_0x51a665['attributes']['length']?_0x51a665[_0x879a('0x33')]:_0x2cd769[_0x879a('0x2f')];if(!_0x18c10f['query'][_0x879a('0x35')](_0x879a('0x36'))){_0x51a665[_0x879a('0x1c')]=qs['limit'](_0x18c10f[_0x879a('0x30')][_0x879a('0x1c')]);_0x51a665[_0x879a('0x1b')]=qs[_0x879a('0x1b')](_0x18c10f['query'][_0x879a('0x1b')]);}_0x51a665[_0x879a('0x37')]=qs[_0x879a('0x38')](_0x18c10f[_0x879a('0x30')]['sort']);_0x51a665[_0x879a('0x39')]=qs['filters'](_[_0x879a('0x3a')](_0x18c10f['query'],_0x2cd769[_0x879a('0x32')]));if(_0x18c10f[_0x879a('0x30')]['filter']){_0x51a665[_0x879a('0x39')]=_[_0x879a('0x3b')](_0x51a665[_0x879a('0x39')],{'$or':_[_0x879a('0x29')](_0x39d0c9,function(_0x5b361f){if(_0x5b361f[_0x879a('0x2d')]!==_0x879a('0x3c')){var _0x2029eb={};_0x2029eb[_0x5b361f['name']]={'$like':'%'+_0x18c10f['query']['filter']+'%'};return _0x2029eb;}})});}_0x51a665=_['merge']({},_0x51a665,_0x18c10f['options']);var _0x452558={'where':_0x51a665[_0x879a('0x39')]};return db[_0x879a('0x2a')]['count'](_0x452558)['then'](function(_0x4a047b){_0x92c805[_0x879a('0x1a')]=_0x4a047b;if(_0x18c10f['query'][_0x879a('0x3d')]){_0x51a665[_0x879a('0x3e')]=[{'all':!![]}];}return db[_0x879a('0x2a')]['findAll'](_0x51a665);})['then'](function(_0x376f0a){_0x92c805['rows']=_0x376f0a;return _0x92c805;})[_0x879a('0x22')](respondWithFilteredResult(_0x583b5c,_0x51a665))[_0x879a('0x3f')](handleError(_0x583b5c,null));};exports['show']=function(_0x924f1,_0x4197a9){var _0x2cc43c={'raw':!![],'where':{'id':_0x924f1[_0x879a('0x40')]['id']}},_0x56d802={};_0x56d802[_0x879a('0x2f')]=_['keys'](db[_0x879a('0x2a')][_0x879a('0x2b')]);_0x56d802['query']=_[_0x879a('0x31')](_0x924f1[_0x879a('0x30')]);_0x56d802[_0x879a('0x32')]=_[_0x879a('0x34')](_0x56d802['model'],_0x56d802[_0x879a('0x30')]);_0x2cc43c['attributes']=_[_0x879a('0x34')](_0x56d802['model'],qs[_0x879a('0x41')](_0x924f1['query'][_0x879a('0x41')]));_0x2cc43c[_0x879a('0x33')]=_0x2cc43c[_0x879a('0x33')][_0x879a('0x42')]?_0x2cc43c[_0x879a('0x33')]:_0x56d802[_0x879a('0x2f')];if(_0x924f1['query'][_0x879a('0x3d')]){_0x2cc43c[_0x879a('0x3e')]=[{'all':!![]}];}_0x2cc43c=_[_0x879a('0x3b')]({},_0x2cc43c,_0x924f1['options']);return db[_0x879a('0x2a')][_0x879a('0x43')](_0x2cc43c)[_0x879a('0x22')](handleEntityNotFound(_0x4197a9,null))['then'](respondWithResult(_0x4197a9,null))[_0x879a('0x3f')](handleError(_0x4197a9,null));};exports[_0x879a('0x44')]=function(_0xd82b05,_0x85bd60){return db['DeskField']['create'](_0xd82b05[_0x879a('0x45')],{})[_0x879a('0x22')](respondWithResult(_0x85bd60,0xc9))['catch'](handleError(_0x85bd60,null));};exports[_0x879a('0x46')]=function(_0x4420ac,_0x48f92a){if(_0x4420ac[_0x879a('0x45')]['id']){delete _0x4420ac[_0x879a('0x45')]['id'];}return db[_0x879a('0x2a')][_0x879a('0x43')]({'where':{'id':_0x4420ac['params']['id']}})[_0x879a('0x22')](handleEntityNotFound(_0x48f92a,null))[_0x879a('0x22')](saveUpdates(_0x4420ac[_0x879a('0x45')],null))['then'](respondWithResult(_0x48f92a,null))['catch'](handleError(_0x48f92a,null));};exports[_0x879a('0x23')]=function(_0x3d7cb8,_0x524f1c){return db[_0x879a('0x2a')][_0x879a('0x43')]({'where':{'id':_0x3d7cb8[_0x879a('0x40')]['id']}})['then'](handleEntityNotFound(_0x524f1c,null))[_0x879a('0x22')](removeEntity(_0x524f1c,null))[_0x879a('0x3f')](handleError(_0x524f1c,null));}; \ No newline at end of file +var _0xbe02=['destroy','then','error','stack','name','index','map','DeskField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0x282645,_0x569164){var _0x42a15d=function(_0x3c5d54){while(--_0x3c5d54){_0x282645['push'](_0x282645['shift']());}};_0x42a15d(++_0x569164);}(_0xbe02,0x146));var _0x2be0=function(_0x54d8c3,_0x5161c9){_0x54d8c3=_0x54d8c3-0x0;var _0x42f8c8=_0xbe02[_0x54d8c3];return _0x42f8c8;};'use strict';var pdf=require(_0x2be0('0x0'));var emlformat=require(_0x2be0('0x1'));var rimraf=require(_0x2be0('0x2'));var zipdir=require(_0x2be0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2be0('0x4'));var moment=require(_0x2be0('0x5'));var BPromise=require(_0x2be0('0x6'));var Mustache=require(_0x2be0('0x7'));var util=require(_0x2be0('0x8'));var path=require(_0x2be0('0x9'));var sox=require(_0x2be0('0xa'));var csv=require(_0x2be0('0xb'));var ejs=require(_0x2be0('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2be0('0xd'));var jsforce=require(_0x2be0('0xe'));var deskjs=require(_0x2be0('0xf'));var toCsv=require(_0x2be0('0xb'));var querystring=require(_0x2be0('0x10'));var Papa=require(_0x2be0('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2be0('0x12'));var utils=require(_0x2be0('0x13'));var config=require('../../config/environment');var db=require(_0x2be0('0x14'))['db'];function respondWithStatusCode(_0x19c73a,_0x204a1f){_0x204a1f=_0x204a1f||0xcc;return function(_0x258b54){if(_0x258b54){return _0x19c73a[_0x2be0('0x15')](_0x204a1f);}return _0x19c73a[_0x2be0('0x16')](_0x204a1f)[_0x2be0('0x17')]();};}function respondWithResult(_0x3b47ab,_0x135d01){_0x135d01=_0x135d01||0xc8;return function(_0x271f25){if(_0x271f25){return _0x3b47ab['status'](_0x135d01)[_0x2be0('0x18')](_0x271f25);}};}function respondWithFilteredResult(_0x422a66,_0x5cda7b){return function(_0x8bdce0){if(_0x8bdce0){var _0x1e0c27=_0x8bdce0[_0x2be0('0x19')],_0x5bcbc5=_0x5cda7b[_0x2be0('0x1a')],_0x334070=_0x5cda7b[_0x2be0('0x1a')]+_0x5cda7b[_0x2be0('0x1b')],_0x30d623;if(_0x334070>=_0x1e0c27){_0x334070=_0x1e0c27;_0x30d623=0xc8;}else{_0x30d623=0xce;}_0x422a66[_0x2be0('0x16')](_0x30d623);return _0x422a66[_0x2be0('0x1c')](_0x2be0('0x1d'),_0x5bcbc5+'-'+_0x334070+'/'+_0x1e0c27)[_0x2be0('0x18')](_0x8bdce0);}return null;};}function patchUpdates(_0x1aaeec){return function(_0x1d4b00){try{jsonpatch[_0x2be0('0x1e')](_0x1d4b00,_0x1aaeec,!![]);}catch(_0x34f588){return BPromise[_0x2be0('0x1f')](_0x34f588);}return _0x1d4b00[_0x2be0('0x20')]();};}function saveUpdates(_0x3bf2ba,_0x4c8afc){return function(_0x51ddee){if(_0x51ddee){return _0x51ddee[_0x2be0('0x21')](_0x3bf2ba)['then'](function(_0x5d1a32){return _0x5d1a32;});}return null;};}function removeEntity(_0x40cc4d,_0x4d2c62){return function(_0x2da0d5){if(_0x2da0d5){return _0x2da0d5[_0x2be0('0x22')]()[_0x2be0('0x23')](function(){_0x40cc4d[_0x2be0('0x16')](0xcc)[_0x2be0('0x17')]();});}};}function handleEntityNotFound(_0x72018a,_0x494fb4){return function(_0x2f44f7){if(!_0x2f44f7){_0x72018a['sendStatus'](0x194);}return _0x2f44f7;};}function handleError(_0x5e7fd2,_0x2fd80f){_0x2fd80f=_0x2fd80f||0x1f4;return function(_0x1602b7){logger[_0x2be0('0x24')](_0x1602b7[_0x2be0('0x25')]);if(_0x1602b7[_0x2be0('0x26')]){delete _0x1602b7[_0x2be0('0x26')];}_0x5e7fd2[_0x2be0('0x16')](_0x2fd80f)['send'](_0x1602b7);};}exports[_0x2be0('0x27')]=function(_0x2a605b,_0x559a66){var _0x5260d3={},_0x1fd3eb={},_0x20f866={'count':0x0,'rows':[]};var _0x4bdf61=_[_0x2be0('0x28')](db[_0x2be0('0x29')][_0x2be0('0x2a')],function(_0x439888){return{'name':_0x439888[_0x2be0('0x2b')],'type':_0x439888[_0x2be0('0x2c')][_0x2be0('0x2d')]};});_0x1fd3eb['model']=_[_0x2be0('0x28')](_0x4bdf61,'name');_0x1fd3eb[_0x2be0('0x2e')]=_[_0x2be0('0x2f')](_0x2a605b[_0x2be0('0x2e')]);_0x1fd3eb[_0x2be0('0x30')]=_[_0x2be0('0x31')](_0x1fd3eb[_0x2be0('0x32')],_0x1fd3eb[_0x2be0('0x2e')]);_0x5260d3['attributes']=_[_0x2be0('0x31')](_0x1fd3eb[_0x2be0('0x32')],qs[_0x2be0('0x33')](_0x2a605b[_0x2be0('0x2e')][_0x2be0('0x33')]));_0x5260d3['attributes']=_0x5260d3[_0x2be0('0x34')][_0x2be0('0x35')]?_0x5260d3[_0x2be0('0x34')]:_0x1fd3eb[_0x2be0('0x32')];if(!_0x2a605b[_0x2be0('0x2e')]['hasOwnProperty']('nolimit')){_0x5260d3[_0x2be0('0x1b')]=qs[_0x2be0('0x1b')](_0x2a605b[_0x2be0('0x2e')]['limit']);_0x5260d3['offset']=qs['offset'](_0x2a605b[_0x2be0('0x2e')][_0x2be0('0x1a')]);}_0x5260d3[_0x2be0('0x36')]=qs[_0x2be0('0x37')](_0x2a605b[_0x2be0('0x2e')][_0x2be0('0x37')]);_0x5260d3[_0x2be0('0x38')]=qs[_0x2be0('0x30')](_[_0x2be0('0x39')](_0x2a605b[_0x2be0('0x2e')],_0x1fd3eb[_0x2be0('0x30')]));if(_0x2a605b['query'][_0x2be0('0x3a')]){_0x5260d3[_0x2be0('0x38')]=_[_0x2be0('0x3b')](_0x5260d3[_0x2be0('0x38')],{'$or':_[_0x2be0('0x28')](_0x4bdf61,function(_0x565623){if(_0x565623[_0x2be0('0x2c')]!==_0x2be0('0x3c')){var _0x2b646c={};_0x2b646c[_0x565623['name']]={'$like':'%'+_0x2a605b[_0x2be0('0x2e')]['filter']+'%'};return _0x2b646c;}})});}_0x5260d3=_[_0x2be0('0x3b')]({},_0x5260d3,_0x2a605b['options']);var _0x4ea299={'where':_0x5260d3[_0x2be0('0x38')]};return db['DeskField'][_0x2be0('0x19')](_0x4ea299)['then'](function(_0x3017c4){_0x20f866['count']=_0x3017c4;if(_0x2a605b[_0x2be0('0x2e')][_0x2be0('0x3d')]){_0x5260d3[_0x2be0('0x3e')]=[{'all':!![]}];}return db['DeskField'][_0x2be0('0x3f')](_0x5260d3);})['then'](function(_0x103608){_0x20f866[_0x2be0('0x40')]=_0x103608;return _0x20f866;})[_0x2be0('0x23')](respondWithFilteredResult(_0x559a66,_0x5260d3))[_0x2be0('0x41')](handleError(_0x559a66,null));};exports[_0x2be0('0x42')]=function(_0x36ed89,_0x2cf412){var _0x9b6867={'raw':!![],'where':{'id':_0x36ed89[_0x2be0('0x43')]['id']}},_0x2f27de={};_0x2f27de[_0x2be0('0x32')]=_[_0x2be0('0x2f')](db[_0x2be0('0x29')][_0x2be0('0x2a')]);_0x2f27de[_0x2be0('0x2e')]=_['keys'](_0x36ed89[_0x2be0('0x2e')]);_0x2f27de['filters']=_[_0x2be0('0x31')](_0x2f27de[_0x2be0('0x32')],_0x2f27de[_0x2be0('0x2e')]);_0x9b6867[_0x2be0('0x34')]=_[_0x2be0('0x31')](_0x2f27de[_0x2be0('0x32')],qs[_0x2be0('0x33')](_0x36ed89['query'][_0x2be0('0x33')]));_0x9b6867[_0x2be0('0x34')]=_0x9b6867[_0x2be0('0x34')][_0x2be0('0x35')]?_0x9b6867[_0x2be0('0x34')]:_0x2f27de['model'];if(_0x36ed89[_0x2be0('0x2e')]['includeAll']){_0x9b6867[_0x2be0('0x3e')]=[{'all':!![]}];}_0x9b6867=_[_0x2be0('0x3b')]({},_0x9b6867,_0x36ed89[_0x2be0('0x44')]);return db[_0x2be0('0x29')][_0x2be0('0x45')](_0x9b6867)[_0x2be0('0x23')](handleEntityNotFound(_0x2cf412,null))['then'](respondWithResult(_0x2cf412,null))[_0x2be0('0x41')](handleError(_0x2cf412,null));};exports['create']=function(_0x237995,_0x41237c){return db['DeskField'][_0x2be0('0x46')](_0x237995[_0x2be0('0x47')],{})[_0x2be0('0x23')](respondWithResult(_0x41237c,0xc9))[_0x2be0('0x41')](handleError(_0x41237c,null));};exports[_0x2be0('0x21')]=function(_0x59bb83,_0x52211f){if(_0x59bb83[_0x2be0('0x47')]['id']){delete _0x59bb83[_0x2be0('0x47')]['id'];}return db['DeskField']['find']({'where':{'id':_0x59bb83[_0x2be0('0x43')]['id']}})[_0x2be0('0x23')](handleEntityNotFound(_0x52211f,null))[_0x2be0('0x23')](saveUpdates(_0x59bb83[_0x2be0('0x47')],null))['then'](respondWithResult(_0x52211f,null))[_0x2be0('0x41')](handleError(_0x52211f,null));};exports[_0x2be0('0x22')]=function(_0x7c024c,_0x3e7e87){return db[_0x2be0('0x29')][_0x2be0('0x45')]({'where':{'id':_0x7c024c[_0x2be0('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e7e87,null))[_0x2be0('0x23')](removeEntity(_0x3e7e87,null))[_0x2be0('0x41')](handleError(_0x3e7e87,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 11f433f..d213aa0 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 _0x4862=['FieldId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./intDeskField.attributes','exports','idField'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0x4862,0x161));var _0x2486=function(_0x4787ce,_0x3f2423){_0x4787ce=_0x4787ce-0x0;var _0x19432e=_0x4862[_0x4787ce];return _0x19432e;};'use strict';var _=require(_0x2486('0x0'));var util=require(_0x2486('0x1'));var logger=require(_0x2486('0x2'))('api');var moment=require(_0x2486('0x3'));var BPromise=require('bluebird');var rp=require(_0x2486('0x4'));var fs=require('fs');var path=require(_0x2486('0x5'));var rimraf=require(_0x2486('0x6'));var config=require('../../config/environment');var attributes=require(_0x2486('0x7'));module[_0x2486('0x8')]=function(_0xf2c5bb,_0x3fc38d){return _0xf2c5bb['define']('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x2486('0x9'),_0x2486('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x99c6=['DeskField','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x87d3ec,_0x387888){var _0x5f3f6f=function(_0x5492ac){while(--_0x5492ac){_0x87d3ec['push'](_0x87d3ec['shift']());}};_0x5f3f6f(++_0x387888);}(_0x99c6,0x1be));var _0x699c=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x99c6[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x699c('0x0'));var util=require(_0x699c('0x1'));var logger=require(_0x699c('0x2'))(_0x699c('0x3'));var moment=require(_0x699c('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(_0x699c('0x5'));var attributes=require(_0x699c('0x6'));module[_0x699c('0x7')]=function(_0x1fc2dd,_0xdbcb4d){return _0x1fc2dd[_0x699c('0x8')](_0x699c('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x699c('0xa'),'fields':[_0x699c('0xb'),_0x699c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index a6bd480..ffdf401 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 _0xb7a5=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','request','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xb6572b,_0x4ab9f6){var _0x40f10f=function(_0x1a2300){while(--_0x1a2300){_0xb6572b['push'](_0xb6572b['shift']());}};_0x40f10f(++_0x4ab9f6);}(_0xb7a5,0x195));var _0x5b7a=function(_0x3c92a8,_0x1ddb98){_0x3c92a8=_0x3c92a8-0x0;var _0x5b0f40=_0xb7a5[_0x3c92a8];return _0x5b0f40;};'use strict';var _=require(_0x5b7a('0x0'));var util=require(_0x5b7a('0x1'));var moment=require(_0x5b7a('0x2'));var BPromise=require(_0x5b7a('0x3'));var rs=require(_0x5b7a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5b7a('0x5'))(_0x5b7a('0x6'));var config=require('../../config/environment');var jayson=require(_0x5b7a('0x7'));var client=jayson[_0x5b7a('0x8')][_0x5b7a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x146f31,_0xeec951,_0xee0cca){return new BPromise(function(_0xaf2d99,_0x3a287c){return client[_0x5b7a('0xa')](_0x146f31,_0xee0cca)['then'](function(_0x4a2d45){logger['info'](_0x5b7a('0xb'),_0xeec951,_0x5b7a('0xc'));logger[_0x5b7a('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0xeec951,'request\x20sent',JSON[_0x5b7a('0xe')](_0x4a2d45));if(_0x4a2d45['error']){if(_0x4a2d45[_0x5b7a('0xf')][_0x5b7a('0x10')]===0x1f4){logger[_0x5b7a('0xf')](_0x5b7a('0xb'),_0xeec951,_0x4a2d45[_0x5b7a('0xf')]['message']);return _0x3a287c(_0x4a2d45[_0x5b7a('0xf')]['message']);}logger['error'](_0x5b7a('0xb'),_0xeec951,_0x4a2d45[_0x5b7a('0xf')][_0x5b7a('0x11')]);return _0xaf2d99(_0x4a2d45['error'][_0x5b7a('0x11')]);}else{logger[_0x5b7a('0x12')](_0x5b7a('0xb'),_0xeec951,_0x5b7a('0xc'));_0xaf2d99(_0x4a2d45[_0x5b7a('0x13')][_0x5b7a('0x11')]);}})['catch'](function(_0x10acda){logger[_0x5b7a('0xf')](_0x5b7a('0xb'),_0xeec951,_0x10acda);_0x3a287c(_0x10acda);});});} \ No newline at end of file +var _0xca3d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xca3d,0x75));var _0xdca3=function(_0x3c0cd6,_0x5ba428){_0x3c0cd6=_0x3c0cd6-0x0;var _0x4381ec=_0xca3d[_0x3c0cd6];return _0x4381ec;};'use strict';var _=require(_0xdca3('0x0'));var util=require(_0xdca3('0x1'));var moment=require(_0xdca3('0x2'));var BPromise=require(_0xdca3('0x3'));var rs=require(_0xdca3('0x4'));var fs=require('fs');var Redis=require(_0xdca3('0x5'));var db=require(_0xdca3('0x6'))['db'];var utils=require(_0xdca3('0x7'));var logger=require(_0xdca3('0x8'))(_0xdca3('0x9'));var config=require(_0xdca3('0xa'));var jayson=require(_0xdca3('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f2037,_0x610eaf,_0x503b7a){return new BPromise(function(_0x2aba57,_0x37efd7){return client[_0xdca3('0xc')](_0x1f2037,_0x503b7a)[_0xdca3('0xd')](function(_0xb7619c){logger[_0xdca3('0xe')](_0xdca3('0xf'),_0x610eaf,'request\x20sent');logger[_0xdca3('0x10')](_0xdca3('0x11'),_0x610eaf,'request\x20sent',JSON[_0xdca3('0x12')](_0xb7619c));if(_0xb7619c['error']){if(_0xb7619c[_0xdca3('0x13')][_0xdca3('0x14')]===0x1f4){logger[_0xdca3('0x13')]('DeskField,\x20%s,\x20%s',_0x610eaf,_0xb7619c[_0xdca3('0x13')]['message']);return _0x37efd7(_0xb7619c['error'][_0xdca3('0x15')]);}logger[_0xdca3('0x13')](_0xdca3('0xf'),_0x610eaf,_0xb7619c[_0xdca3('0x13')][_0xdca3('0x15')]);return _0x2aba57(_0xb7619c[_0xdca3('0x13')][_0xdca3('0x15')]);}else{logger[_0xdca3('0xe')](_0xdca3('0xf'),_0x610eaf,'request\x20sent');_0x2aba57(_0xb7619c[_0xdca3('0x16')][_0xdca3('0x15')]);}})[_0xdca3('0x17')](function(_0x343955){logger[_0xdca3('0x13')](_0xdca3('0xf'),_0x610eaf,_0x343955);_0x37efd7(_0x343955);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 77e6d7d..6ac0a68 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 _0xc93f=['isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update','delete','exports','multer','util','connect-timeout','express','../../config/environment','./intDynamics365Account.controller','get'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0xc93f,0xa1));var _0xfc93=function(_0x3fb359,_0x3568dd){_0x3fb359=_0x3fb359-0x0;var _0xce5fb3=_0xc93f[_0x3fb359];return _0xce5fb3;};'use strict';var multer=require(_0xfc93('0x0'));var util=require(_0xfc93('0x1'));var path=require('path');var timeout=require(_0xfc93('0x2'));var express=require(_0xfc93('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfc93('0x4'));var controller=require(_0xfc93('0x5'));router[_0xfc93('0x6')]('/',auth[_0xfc93('0x7')](),controller[_0xfc93('0x8')]);router[_0xfc93('0x6')]('/:id',auth[_0xfc93('0x7')](),controller[_0xfc93('0x9')]);router[_0xfc93('0x6')](_0xfc93('0xa'),auth[_0xfc93('0x7')](),controller[_0xfc93('0xb')]);router[_0xfc93('0x6')](_0xfc93('0xc'),auth[_0xfc93('0x7')](),controller['getFields']);router[_0xfc93('0xd')]('/',auth[_0xfc93('0x7')](),controller[_0xfc93('0xe')]);router['post'](_0xfc93('0xa'),auth['isAuthenticated'](),controller[_0xfc93('0xf')]);router[_0xfc93('0x10')](_0xfc93('0x11'),auth[_0xfc93('0x7')](),controller[_0xfc93('0x12')]);router[_0xfc93('0x13')]('/:id',auth[_0xfc93('0x7')](),controller['destroy']);module[_0xfc93('0x14')]=router; \ No newline at end of file +var _0x8518=['/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getConfigurations'];(function(_0xc98099,_0x342a0e){var _0x411857=function(_0x4afb7c){while(--_0x4afb7c){_0xc98099['push'](_0xc98099['shift']());}};_0x411857(++_0x342a0e);}(_0x8518,0x82));var _0x8851=function(_0x855e77,_0x348ad7){_0x855e77=_0x855e77-0x0;var _0x1edd15=_0x8518[_0x855e77];return _0x1edd15;};'use strict';var multer=require(_0x8851('0x0'));var util=require(_0x8851('0x1'));var path=require(_0x8851('0x2'));var timeout=require(_0x8851('0x3'));var express=require(_0x8851('0x4'));var router=express[_0x8851('0x5')]();var auth=require(_0x8851('0x6'));var interaction=require(_0x8851('0x7'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0x8851('0x8')]('/',auth[_0x8851('0x9')](),controller[_0x8851('0xa')]);router[_0x8851('0x8')](_0x8851('0xb'),auth['isAuthenticated'](),controller[_0x8851('0xc')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x8851('0xd')]);router[_0x8851('0x8')](_0x8851('0xe'),auth[_0x8851('0x9')](),controller[_0x8851('0xf')]);router[_0x8851('0x10')]('/',auth[_0x8851('0x9')](),controller['create']);router[_0x8851('0x10')](_0x8851('0x11'),auth[_0x8851('0x9')](),controller[_0x8851('0x12')]);router[_0x8851('0x13')](_0x8851('0xb'),auth[_0x8851('0x9')](),controller[_0x8851('0x14')]);router[_0x8851('0x15')](_0x8851('0xb'),auth[_0x8851('0x9')](),controller[_0x8851('0x16')]);module[_0x8851('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 08c6e74..b1a586e 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 _0x312c=['sequelize','STRING'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0x312c,0xe0));var _0xc312=function(_0x551267,_0x39a4ae){_0x551267=_0x551267-0x0;var _0xc901bb=_0x312c[_0x551267];return _0xc901bb;};'use strict';var Sequelize=require(_0xc312('0x0'));module['exports']={'name':{'type':Sequelize[_0xc312('0x1')]},'username':{'type':Sequelize[_0xc312('0x1')]},'password':{'type':Sequelize[_0xc312('0x1')]},'remoteUri':{'type':Sequelize[_0xc312('0x1')]},'tenantId':{'type':Sequelize[_0xc312('0x1')]},'clientId':{'type':Sequelize[_0xc312('0x1')]},'clientSecret':{'type':Sequelize[_0xc312('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2909=['sequelize','exports','STRING'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2909,0x13b));var _0x9290=function(_0x370703,_0x1d4443){_0x370703=_0x370703-0x0;var _0xf20a67=_0x2909[_0x370703];return _0xf20a67;};'use strict';var Sequelize=require(_0x9290('0x0'));module[_0x9290('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9290('0x2')]},'password':{'type':Sequelize[_0x9290('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x9290('0x2')]},'clientId':{'type':Sequelize[_0x9290('0x2')]},'clientSecret':{'type':Sequelize[_0x9290('0x2')]},'serverUrl':{'type':Sequelize[_0x9290('0x2')]},'description':{'type':Sequelize[_0x9290('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index ea524d5..cefb6ce 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 _0xc4ff=['remoteUri','clientId','clientSecret','substring','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','@odata.type','PicklistAttributeMetadata','all','forEach','isNil','lastIndexOf','BooleanAttributeMetadata','push','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','stack','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','Sequelize','ValidationError','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','then','destroy','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','filter','options','Dynamics365Account','include','findAll','catch','params','includeAll','find','create','body','update','getConfigurations','findOne','Dynamics365Configuration','order','hasOwnProperty','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','Subjects','getFields','ticketType','incident','Incident','title','description','customerid','ownerid','caseorigincode','subject','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','statecode','statuscode','subjectidname','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password'];(function(_0x37dbe8,_0x10e968){var _0x2416b6=function(_0xd39957){while(--_0xd39957){_0x37dbe8['push'](_0x37dbe8['shift']());}};_0x2416b6(++_0x10e968);}(_0xc4ff,0x111));var _0xfc4f=function(_0x1995a2,_0x7d41f4){_0x1995a2=_0x1995a2-0x0;var _0x43c7ca=_0xc4ff[_0x1995a2];return _0x43c7ca;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfc4f('0x0'));var rimraf=require(_0xfc4f('0x1'));var zipdir=require(_0xfc4f('0x2'));var jsonpatch=require(_0xfc4f('0x3'));var rp=require(_0xfc4f('0x4'));var moment=require('moment');var BPromise=require(_0xfc4f('0x5'));var Mustache=require(_0xfc4f('0x6'));var util=require(_0xfc4f('0x7'));var path=require(_0xfc4f('0x8'));var sox=require(_0xfc4f('0x9'));var csv=require(_0xfc4f('0xa'));var ejs=require(_0xfc4f('0xb'));var fs=require('fs');var _=require(_0xfc4f('0xc'));var squel=require(_0xfc4f('0xd'));var crypto=require(_0xfc4f('0xe'));var jsforce=require(_0xfc4f('0xf'));var deskjs=require(_0xfc4f('0x10'));var toCsv=require(_0xfc4f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfc4f('0x11'));var authService=require(_0xfc4f('0x12'));var qs=require(_0xfc4f('0x13'));var as=require(_0xfc4f('0x14'));var hardwareService=require(_0xfc4f('0x15'));var logger=require(_0xfc4f('0x16'))('api');var utils=require(_0xfc4f('0x17'));var config=require(_0xfc4f('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0xfc4f('0x19'));var jayson=require(_0xfc4f('0x1a'));var client=jayson[_0xfc4f('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x260cfa,_0x58a4cf,_0x435913){if(_0x435913){var _0x27c7c1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27c7c1['test'](_0x58a4cf)){return _0x260cfa;}else{throw new db[(_0xfc4f('0x1c'))][(_0xfc4f('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x260cfa;}}function respondWithRpcPromise(_0x2bef8c,_0x2912e9,_0x3ab5c6,_0x3ebc1f){return new BPromise(function(_0x153aab,_0x354582){var _0x4694c=_0x3ebc1f||client;return _0x4694c[_0xfc4f('0x1e')](_0x2bef8c,_0x3ab5c6)['then'](function(_0x3d6a1d){logger[_0xfc4f('0x1f')](_0xfc4f('0x20'),_0x2912e9,_0xfc4f('0x21'));logger['debug'](_0xfc4f('0x22'),_0x2912e9,_0xfc4f('0x21'),JSON['stringify'](_0x3d6a1d));if(_0x3d6a1d[_0xfc4f('0x23')]){if(_0x3d6a1d[_0xfc4f('0x23')][_0xfc4f('0x24')]===0x1f4){logger[_0xfc4f('0x23')](_0xfc4f('0x20'),_0x2912e9,_0x3d6a1d['error']['message']);return _0x354582(_0x3d6a1d[_0xfc4f('0x23')]['message']);}logger[_0xfc4f('0x23')]('Dynamics365Account,\x20%s,\x20%s',_0x2912e9,_0x3d6a1d[_0xfc4f('0x23')][_0xfc4f('0x25')]);return _0x153aab(_0x3d6a1d[_0xfc4f('0x23')][_0xfc4f('0x25')]);}else{logger[_0xfc4f('0x1f')](_0xfc4f('0x20'),_0x2912e9,_0xfc4f('0x21'));_0x153aab(_0x3d6a1d['result'][_0xfc4f('0x25')]);}})['catch'](function(_0x5358ba){logger[_0xfc4f('0x23')](_0xfc4f('0x20'),_0x2912e9,_0x5358ba);_0x354582(_0x5358ba);});});}function respondWithStatusCode(_0x43ea16,_0x59dd29){_0x59dd29=_0x59dd29||0xcc;return function(_0x3956ce){if(_0x3956ce){return _0x43ea16[_0xfc4f('0x26')](_0x59dd29);}return _0x43ea16[_0xfc4f('0x27')](_0x59dd29)[_0xfc4f('0x28')]();};}function respondWithResult(_0x4c750c,_0x32a091){_0x32a091=_0x32a091||0xc8;return function(_0x29696c){if(_0x29696c){return _0x4c750c[_0xfc4f('0x27')](_0x32a091)[_0xfc4f('0x29')](_0x29696c);}};}function respondWithFilteredResult(_0x3047a3,_0x4dc6cf){return function(_0x20b905){if(_0x20b905){var _0x24a8e1=_0x20b905[_0xfc4f('0x2a')],_0x4e96d9=_0x4dc6cf[_0xfc4f('0x2b')],_0x20b0e9=_0x4dc6cf['offset']+_0x4dc6cf[_0xfc4f('0x2c')],_0x3a4fc5;if(_0x20b0e9>=_0x24a8e1){_0x20b0e9=_0x24a8e1;_0x3a4fc5=0xc8;}else{_0x3a4fc5=0xce;}_0x3047a3['status'](_0x3a4fc5);return _0x3047a3[_0xfc4f('0x2d')](_0xfc4f('0x2e'),_0x4e96d9+'-'+_0x20b0e9+'/'+_0x24a8e1)['json'](_0x20b905);}return null;};}function patchUpdates(_0x5e2782){return function(_0x88c98c){try{jsonpatch['apply'](_0x88c98c,_0x5e2782,!![]);}catch(_0x16ba79){return BPromise[_0xfc4f('0x2f')](_0x16ba79);}return _0x88c98c['save']();};}function saveUpdates(_0x57ce89,_0x1a0502){return function(_0x371201){if(_0x371201){return _0x371201['update'](_0x57ce89)[_0xfc4f('0x30')](function(_0x2b7719){return _0x2b7719;});}return null;};}function removeEntity(_0x1e52e4,_0x12d246){return function(_0x5558b2){if(_0x5558b2){return _0x5558b2[_0xfc4f('0x31')]()[_0xfc4f('0x30')](function(){_0x1e52e4[_0xfc4f('0x27')](0xcc)[_0xfc4f('0x28')]();});}};}function handleEntityNotFound(_0x4fa666,_0xff1c4e){return function(_0x1eb821){if(!_0x1eb821){_0x4fa666[_0xfc4f('0x26')](0x194);}return _0x1eb821;};}function handleError(_0x1be867,_0x216005){_0x216005=_0x216005||0x1f4;return function(_0x508e83){logger[_0xfc4f('0x23')](_0x508e83['stack']);if(_0x508e83[_0xfc4f('0x32')]){delete _0x508e83[_0xfc4f('0x32')];}_0x1be867[_0xfc4f('0x27')](_0x216005)['send'](_0x508e83);};}exports[_0xfc4f('0x33')]=function(_0x73a53d,_0x326177){var _0x3bd5dc={},_0x705539={},_0x34b19b={'count':0x0,'rows':[]};var _0x247e58=_[_0xfc4f('0x34')](db['Dynamics365Account'][_0xfc4f('0x35')],function(_0x3ba424){return{'name':_0x3ba424[_0xfc4f('0x36')],'type':_0x3ba424[_0xfc4f('0x37')][_0xfc4f('0x38')]};});_0x705539[_0xfc4f('0x39')]=_['map'](_0x247e58,_0xfc4f('0x32'));_0x705539[_0xfc4f('0x3a')]=_[_0xfc4f('0x3b')](_0x73a53d[_0xfc4f('0x3a')]);_0x705539[_0xfc4f('0x3c')]=_[_0xfc4f('0x3d')](_0x705539['model'],_0x705539['query']);_0x3bd5dc[_0xfc4f('0x3e')]=_[_0xfc4f('0x3d')](_0x705539[_0xfc4f('0x39')],qs['fields'](_0x73a53d[_0xfc4f('0x3a')][_0xfc4f('0x3f')]));_0x3bd5dc[_0xfc4f('0x3e')]=_0x3bd5dc[_0xfc4f('0x3e')][_0xfc4f('0x40')]?_0x3bd5dc[_0xfc4f('0x3e')]:_0x705539['model'];if(!_0x73a53d[_0xfc4f('0x3a')]['hasOwnProperty'](_0xfc4f('0x41'))){_0x3bd5dc[_0xfc4f('0x2c')]=qs[_0xfc4f('0x2c')](_0x73a53d['query'][_0xfc4f('0x2c')]);_0x3bd5dc['offset']=qs[_0xfc4f('0x2b')](_0x73a53d[_0xfc4f('0x3a')][_0xfc4f('0x2b')]);}_0x3bd5dc['order']=qs[_0xfc4f('0x42')](_0x73a53d[_0xfc4f('0x3a')][_0xfc4f('0x42')]);_0x3bd5dc[_0xfc4f('0x43')]=qs['filters'](_['pick'](_0x73a53d[_0xfc4f('0x3a')],_0x705539[_0xfc4f('0x3c')]));if(_0x73a53d[_0xfc4f('0x3a')]['filter']){_0x3bd5dc[_0xfc4f('0x43')]=_[_0xfc4f('0x44')](_0x3bd5dc[_0xfc4f('0x43')],{'$or':_[_0xfc4f('0x34')](_0x247e58,function(_0x10083e){if(_0x10083e[_0xfc4f('0x37')]!==_0xfc4f('0x45')){var _0x15b7fd={};_0x15b7fd[_0x10083e[_0xfc4f('0x32')]]={'$like':'%'+_0x73a53d[_0xfc4f('0x3a')][_0xfc4f('0x46')]+'%'};return _0x15b7fd;}})});}_0x3bd5dc=_[_0xfc4f('0x44')]({},_0x3bd5dc,_0x73a53d[_0xfc4f('0x47')]);var _0x2bd381={'where':_0x3bd5dc[_0xfc4f('0x43')]};return db[_0xfc4f('0x48')][_0xfc4f('0x2a')](_0x2bd381)[_0xfc4f('0x30')](function(_0x4a48b7){_0x34b19b[_0xfc4f('0x2a')]=_0x4a48b7;if(_0x73a53d['query']['includeAll']){_0x3bd5dc[_0xfc4f('0x49')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xfc4f('0x4a')](_0x3bd5dc);})[_0xfc4f('0x30')](function(_0x1b24c7){_0x34b19b['rows']=_0x1b24c7;return _0x34b19b;})[_0xfc4f('0x30')](respondWithFilteredResult(_0x326177,_0x3bd5dc))[_0xfc4f('0x4b')](handleError(_0x326177,null));};exports['show']=function(_0x425be8,_0x4288e8){var _0x4f9df5={'raw':![],'where':{'id':_0x425be8[_0xfc4f('0x4c')]['id']}},_0x50820f={};_0x50820f[_0xfc4f('0x39')]=_[_0xfc4f('0x3b')](db[_0xfc4f('0x48')][_0xfc4f('0x35')]);_0x50820f['query']=_[_0xfc4f('0x3b')](_0x425be8['query']);_0x50820f[_0xfc4f('0x3c')]=_[_0xfc4f('0x3d')](_0x50820f[_0xfc4f('0x39')],_0x50820f['query']);_0x4f9df5[_0xfc4f('0x3e')]=_['intersection'](_0x50820f[_0xfc4f('0x39')],qs['fields'](_0x425be8[_0xfc4f('0x3a')][_0xfc4f('0x3f')]));_0x4f9df5['attributes']=_0x4f9df5[_0xfc4f('0x3e')][_0xfc4f('0x40')]?_0x4f9df5['attributes']:_0x50820f[_0xfc4f('0x39')];if(_0x425be8[_0xfc4f('0x3a')][_0xfc4f('0x4d')]){_0x4f9df5[_0xfc4f('0x49')]=[{'all':!![]}];}_0x4f9df5=_['merge']({},_0x4f9df5,_0x425be8[_0xfc4f('0x47')]);return db['Dynamics365Account'][_0xfc4f('0x4e')](_0x4f9df5)[_0xfc4f('0x30')](handleEntityNotFound(_0x4288e8,null))[_0xfc4f('0x30')](respondWithResult(_0x4288e8,null))['catch'](handleError(_0x4288e8,null));};exports['create']=function(_0x4f3df9,_0x5d065e){return db[_0xfc4f('0x48')][_0xfc4f('0x4f')](_0x4f3df9[_0xfc4f('0x50')],{})[_0xfc4f('0x30')](respondWithResult(_0x5d065e,0xc9))[_0xfc4f('0x4b')](handleError(_0x5d065e,null));};exports[_0xfc4f('0x51')]=function(_0x515293,_0x1866c4){if(_0x515293[_0xfc4f('0x50')]['id']){delete _0x515293[_0xfc4f('0x50')]['id'];}return db[_0xfc4f('0x48')][_0xfc4f('0x4e')]({'where':{'id':_0x515293[_0xfc4f('0x4c')]['id']}})[_0xfc4f('0x30')](handleEntityNotFound(_0x1866c4,null))[_0xfc4f('0x30')](saveUpdates(_0x515293[_0xfc4f('0x50')],null))[_0xfc4f('0x30')](respondWithResult(_0x1866c4,null))[_0xfc4f('0x4b')](handleError(_0x1866c4,null));};exports['destroy']=function(_0x69a83a,_0x338e0a){return db[_0xfc4f('0x48')]['find']({'where':{'id':_0x69a83a[_0xfc4f('0x4c')]['id']}})[_0xfc4f('0x30')](handleEntityNotFound(_0x338e0a,null))['then'](removeEntity(_0x338e0a,null))[_0xfc4f('0x4b')](handleError(_0x338e0a,null));};exports[_0xfc4f('0x52')]=function(_0x3bd64d,_0x1f8e94,_0x234af1){var _0x2e6f72={};var _0x25d9a5={};var _0x3c599f;var _0x10a21b;return db['Dynamics365Account'][_0xfc4f('0x53')]({'where':{'id':_0x3bd64d[_0xfc4f('0x4c')]['id']}})[_0xfc4f('0x30')](handleEntityNotFound(_0x1f8e94,null))['then'](function(_0xe75143){if(_0xe75143){_0x3c599f=_0xe75143;_0x25d9a5['model']=_[_0xfc4f('0x3b')](db[_0xfc4f('0x54')][_0xfc4f('0x35')]);_0x25d9a5[_0xfc4f('0x3a')]=_[_0xfc4f('0x3b')](_0x3bd64d['query']);_0x25d9a5['filters']=_['intersection'](_0x25d9a5[_0xfc4f('0x39')],_0x25d9a5[_0xfc4f('0x3a')]);_0x2e6f72[_0xfc4f('0x3e')]=_[_0xfc4f('0x3d')](_0x25d9a5['model'],qs[_0xfc4f('0x3f')](_0x3bd64d[_0xfc4f('0x3a')][_0xfc4f('0x3f')]));_0x2e6f72[_0xfc4f('0x3e')]=_0x2e6f72[_0xfc4f('0x3e')][_0xfc4f('0x40')]?_0x2e6f72[_0xfc4f('0x3e')]:_0x25d9a5['model'];_0x2e6f72[_0xfc4f('0x55')]=qs['sort'](_0x3bd64d[_0xfc4f('0x3a')][_0xfc4f('0x42')]);_0x2e6f72[_0xfc4f('0x43')]=qs['filters'](_['pick'](_0x3bd64d[_0xfc4f('0x3a')],_0x25d9a5[_0xfc4f('0x3c')]));if(_0x3bd64d['query'][_0xfc4f('0x46')]){_0x2e6f72[_0xfc4f('0x43')]=_[_0xfc4f('0x44')](_0x2e6f72[_0xfc4f('0x43')],{'$or':_[_0xfc4f('0x34')](_0x2e6f72['attributes'],function(_0x18209b){var _0x24a402={};_0x24a402[_0x18209b]={'$like':'%'+_0x3bd64d['query'][_0xfc4f('0x46')]+'%'};return _0x24a402;})});}_0x2e6f72=_[_0xfc4f('0x44')]({},_0x2e6f72,_0x3bd64d[_0xfc4f('0x47')]);return _0x3c599f[_0xfc4f('0x52')](_0x2e6f72);}})['then'](function(_0x27f063){if(_0x27f063){_0x10a21b=_0x27f063[_0xfc4f('0x40')];if(!_0x3bd64d[_0xfc4f('0x3a')][_0xfc4f('0x56')](_0xfc4f('0x41'))){_0x2e6f72[_0xfc4f('0x2c')]=qs[_0xfc4f('0x2c')](_0x3bd64d[_0xfc4f('0x3a')][_0xfc4f('0x2c')]);_0x2e6f72[_0xfc4f('0x2b')]=qs[_0xfc4f('0x2b')](_0x3bd64d['query']['offset']);}return _0x3c599f[_0xfc4f('0x52')](_0x2e6f72);}})['then'](function(_0x26760a){if(_0x26760a){return _0x26760a?{'count':_0x10a21b,'rows':_0x26760a}:null;}})['then'](respondWithResult(_0x1f8e94,null))['catch'](handleError(_0x1f8e94,null));};exports[_0xfc4f('0x57')]=function(_0x418307,_0x34fc6e,_0x287f4d){if(_0x418307[_0xfc4f('0x50')]['id']){delete _0x418307[_0xfc4f('0x50')]['id'];}return db[_0xfc4f('0x48')][_0xfc4f('0x53')]({'where':{'id':_0x418307[_0xfc4f('0x4c')]['id']}})[_0xfc4f('0x30')](handleEntityNotFound(_0x34fc6e,null))[_0xfc4f('0x30')](function(_0x244225){if(_0x244225){_0x418307[_0xfc4f('0x50')]['AccountId']=_0x244225['id'];_0x418307[_0xfc4f('0x50')]['Subjects']=integrations[_0xfc4f('0x58')](_0x418307[_0xfc4f('0x50')][_0xfc4f('0x59')],_0x418307[_0xfc4f('0x50')][_0xfc4f('0x37')]);_0x418307['body'][_0xfc4f('0x5a')]=integrations[_0xfc4f('0x5b')](_0x418307[_0xfc4f('0x50')][_0xfc4f('0x59')],_0x418307['body'][_0xfc4f('0x37')]);return db[_0xfc4f('0x54')][_0xfc4f('0x4f')](_0x418307[_0xfc4f('0x50')],{'include':[{'model':db['Dynamics365Field'],'as':_0xfc4f('0x5c')},{'model':db['Dynamics365Field'],'as':_0xfc4f('0x5a')}]});}return null;})[_0xfc4f('0x30')](respondWithResult(_0x34fc6e,null))[_0xfc4f('0x4b')](handleError(_0x34fc6e,null));};exports[_0xfc4f('0x5d')]=function(_0x426db0,_0x2c9bf2,_0x38c626){var _0x4c1c93=_0x426db0[_0xfc4f('0x3a')][_0xfc4f('0x5e')];var _0x1580fc=_0x4c1c93===_0xfc4f('0x5f')?_0xfc4f('0x60'):'PhoneCall';var _0x23e8b2='';var _0xc026f6='';var _0x1de8c5='';var _0x3eaa97='';var _0xea3486='';var _0x5e5ebf='';var _0x2345e6='';var _0x36cc2c='';var _0x2fc160=[_0xfc4f('0x61'),_0xfc4f('0x62'),_0xfc4f('0x63'),_0xfc4f('0x64'),_0xfc4f('0x65'),_0xfc4f('0x66'),'phonenumber',_0xfc4f('0x67'),'directioncode',_0xfc4f('0x68')];var _0x5e31ee=[_0xfc4f('0x69'),_0xfc4f('0x6a'),_0xfc4f('0x6b'),_0xfc4f('0x6c'),_0xfc4f('0x6d'),_0xfc4f('0x6e'),_0xfc4f('0x6f'),_0xfc4f('0x70'),_0xfc4f('0x71'),_0xfc4f('0x72'),_0xfc4f('0x73'),_0xfc4f('0x74'),'createdon',_0xfc4f('0x75'),'createdonbehalfbyyominame',_0xfc4f('0x76'),_0xfc4f('0x77'),_0xfc4f('0x78'),'emailaddress',_0xfc4f('0x79'),'entityimage_timestamp',_0xfc4f('0x7a'),_0xfc4f('0x7b'),_0xfc4f('0x7c'),_0xfc4f('0x7d'),'followupby',_0xfc4f('0x7e'),'influencescore','kbarticleidname',_0xfc4f('0x7f'),_0xfc4f('0x80'),_0xfc4f('0x81'),_0xfc4f('0x82'),_0xfc4f('0x83'),_0xfc4f('0x84'),'modifiedon','modifiedonbehalfbyname',_0xfc4f('0x85'),_0xfc4f('0x86'),_0xfc4f('0x87'),_0xfc4f('0x88'),'onholdtime',_0xfc4f('0x89'),_0xfc4f('0x8a'),_0xfc4f('0x8b'),_0xfc4f('0x8c'),'parentcaseidname',_0xfc4f('0x8d'),_0xfc4f('0x8e'),_0xfc4f('0x8f'),_0xfc4f('0x90'),_0xfc4f('0x91'),_0xfc4f('0x92'),_0xfc4f('0x93'),_0xfc4f('0x94'),_0xfc4f('0x95'),_0xfc4f('0x96'),'sentimentvalue','slainvokedidname','slaname','socialprofileidname',_0xfc4f('0x97'),_0xfc4f('0x98'),_0xfc4f('0x99'),'ticketnumber',_0xfc4f('0x9a'),'transactioncurrencyidname',_0xfc4f('0x9b'),_0xfc4f('0x9c'),_0xfc4f('0x9d')];var _0x2c5621=_0x2fc160[_0xfc4f('0x9e')](_0x5e31ee);return db[_0xfc4f('0x48')][_0xfc4f('0x53')]({'where':{'id':_0x426db0['params']['id']},'attributes':['id',_0xfc4f('0x9f'),_0xfc4f('0xa0'),_0xfc4f('0xa1'),'tenantId',_0xfc4f('0xa2'),_0xfc4f('0xa3')]})[_0xfc4f('0x30')](handleEntityNotFound(_0x2c9bf2,null))[_0xfc4f('0x30')](function(_0x239d62){if(_0x239d62){_0x36cc2c=_0x239d62[_0xfc4f('0xa1')];var _0x1f3ba6=_0x36cc2c['slice'](-0x1);if(_0x1f3ba6==='/'){_0x36cc2c=_0x36cc2c[_0xfc4f('0xa4')](0x0,_0x36cc2c['lastIndexOf'](_0x1f3ba6));}_0x2345e6=util[_0xfc4f('0xa5')](_0xfc4f('0xa6'),_0x36cc2c);var _0xfa6fa6={'method':_0xfc4f('0xa7'),'uri':_0xfc4f('0xa8')+_0x239d62['tenantId']+_0xfc4f('0xa9'),'form':{'client_id':_0x239d62['clientId'],'resource':_0x36cc2c,'username':_0x239d62[_0xfc4f('0x9f')],'password':_0x239d62[_0xfc4f('0xa0')],'grant_type':_0xfc4f('0xa0'),'client_secret':_0x239d62[_0xfc4f('0xa3')]},'json':!![]};return rp(_0xfa6fa6);}})[_0xfc4f('0x30')](function(_0x51901a){_0x5e5ebf=_0x51901a[_0xfc4f('0xaa')];var _0x3627bd={'method':'GET','uri':encodeURI(_0x2345e6+_0xfc4f('0xab')+_0x1580fc+'\x27'),'headers':{'Authorization':_0xfc4f('0xac')+_0x5e5ebf,'If-None-Match':null,'OData-Version':_0xfc4f('0xad')},'json':!![]};return rp(_0x3627bd);})['then'](function(_0x5dc1e5){var _0x3ee38c=_0x5dc1e5[_0xfc4f('0xae')][0x0];var _0x4a5802=_0x3ee38c[_0xfc4f('0xaf')];var _0x4403e6={'method':_0xfc4f('0xb0'),'uri':_0x2345e6+_0xfc4f('0xb1')+_0x4a5802+_0xfc4f('0xb2'),'headers':{'Authorization':'Bearer\x20'+_0x5e5ebf,'If-None-Match':null,'OData-Version':_0xfc4f('0xad')},'json':!![]};return rp(_0x4403e6);})['then'](function(_0x26afbf){_0x23e8b2=_0x26afbf;_0xc026f6=_0x23e8b2[_0xfc4f('0xb3')];_0xc026f6=_['remove'](_0xc026f6,function(_0x4a547d){return!_0x2c5621[_0xfc4f('0xb4')](_0x4a547d[_0xfc4f('0xb5')]);});var _0x43e5f0=[];var _0x615f32=[];_0xc026f6['forEach'](function(_0x18bb29){if(_0x18bb29[_0xfc4f('0xb6')]){var _0x4b6835=_0x18bb29[_0xfc4f('0xb6')][_0xfc4f('0xa4')](_0x18bb29['@odata.type']['lastIndexOf']('.')+0x1);if(_0x4b6835===_0xfc4f('0xb7')){_0x43e5f0['push'](getSelectList(_0x2345e6,_0x4c1c93,_0x615f32,_0x23e8b2[_0xfc4f('0xaf')],_0x18bb29[_0xfc4f('0xaf')],_0x5e5ebf));}}});return Promise[_0xfc4f('0xb8')](_0x43e5f0);})[_0xfc4f('0x30')](function(_0x20ca3e){_0x1de8c5=_0x20ca3e[0x0];var _0x54056a=[];var _0x8e444b=[];_0xc026f6[_0xfc4f('0xb9')](function(_0x1cd952){if(!_[_0xfc4f('0xba')](_0x1cd952[_0xfc4f('0xb6')])){var _0x156644=_0x1cd952['@odata.type'][_0xfc4f('0xa4')](_0x1cd952['@odata.type'][_0xfc4f('0xbb')]('.')+0x1);if(_0x156644===_0xfc4f('0xbc')){_0x54056a[_0xfc4f('0xbd')](getBooleanList(_0x2345e6,_0x4c1c93,_0x8e444b,_0x23e8b2[_0xfc4f('0xaf')],_0x1cd952['MetadataId'],_0x5e5ebf));}}});return Promise[_0xfc4f('0xb8')](_0x54056a);})[_0xfc4f('0x30')](function(_0x445f3a){_0x3eaa97=_0x445f3a[0x0];var _0x397faa=[];var _0x9eac9e=[];_0xc026f6[_0xfc4f('0xb9')](function(_0x262aa0){if(_0x262aa0['@odata.type']){var _0x54f3f7=_0x262aa0[_0xfc4f('0xb6')][_0xfc4f('0xa4')](_0x262aa0[_0xfc4f('0xb6')][_0xfc4f('0xbb')]('.')+0x1);if(_0x54f3f7==='StringAttributeMetadata'||_0x54f3f7===_0xfc4f('0xbe')||_0x54f3f7===_0xfc4f('0xbf')||_0x54f3f7===_0xfc4f('0xc0')||_0x54f3f7===_0xfc4f('0xc1')||_0x54f3f7===_0xfc4f('0xc2')||_0x54f3f7===_0xfc4f('0xc3')||_0x54f3f7===_0xfc4f('0xc4')||_0x54f3f7==='StateAttributeMetadata'||_0x54f3f7===_0xfc4f('0xc5')){_0x397faa[_0xfc4f('0xbd')](getInputList(_0x2345e6,_0x4c1c93,_0x54f3f7,_0x9eac9e,_0x23e8b2[_0xfc4f('0xaf')],_0x262aa0['MetadataId'],_0x5e5ebf));}}});return Promise[_0xfc4f('0xb8')](_0x397faa);})[_0xfc4f('0x30')](function(_0x26c160){_0xea3486=_0x26c160[0x0];var _0x2eb96e=_0x1de8c5['concat'](_0x3eaa97)['concat'](_0xea3486);var _0xd7d5a8={'count':_0x2eb96e[_0xfc4f('0x40')],'rows':_0x2eb96e};return _0xd7d5a8;})[_0xfc4f('0x30')](respondWithResult(_0x2c9bf2,null))[_0xfc4f('0x4b')](function(_0x31703e){var _0x4cb2b9=_0x426db0[_0xfc4f('0x3a')][_0xfc4f('0xc6')]?0x1f4:_0x31703e[_0xfc4f('0xc7')]||0x1f4;logger[_0xfc4f('0x23')](_0x31703e[_0xfc4f('0xc8')]);delete _0x31703e[_0xfc4f('0x32')];if(_0x4cb2b9===0x191){_0x4cb2b9=0x190;}_0x2c9bf2[_0xfc4f('0x27')](_0x4cb2b9)[_0xfc4f('0xc9')](_0x426db0['query'][_0xfc4f('0xc6')]?{'message':_0xfc4f('0xca'),'statusCode':_0x31703e[_0xfc4f('0xc7')]}:_0x31703e);});};function getSelectList(_0x18e78e,_0x3a980d,_0x4b12c3,_0x4b811e,_0x59fdf6,_0x39619f){var _0x296024={'method':_0xfc4f('0xb0'),'uri':_0x18e78e+'EntityDefinitions('+_0x4b811e+_0xfc4f('0xcb')+_0x59fdf6+_0xfc4f('0xcc')+_0xfc4f('0xcd'),'headers':{'Authorization':_0xfc4f('0xac')+_0x39619f,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x296024)['then'](function(_0x41ae22){var _0x3f2e5c=[];var _0x8c7eed=_0x41ae22['OptionSet']['Options'];_0x8c7eed[_0xfc4f('0xb9')](function(_0x2bee2a){_0x3f2e5c[_0xfc4f('0xbd')]({'name':_0x2bee2a[_0xfc4f('0xce')][_0xfc4f('0xcf')][_0xfc4f('0xce')],'value':String(_0x2bee2a[_0xfc4f('0xd0')])});});var _0x5dc60f={'id':_0x3a980d+'_'+_0x41ae22[_0xfc4f('0xb5')],'name':_0x41ae22[_0xfc4f('0xd1')][_0xfc4f('0xcf')][_0xfc4f('0xce')],'custom':![],'options':_0x3f2e5c};_0x4b12c3[_0xfc4f('0xbd')](_0x5dc60f);return _0x4b12c3;});}function getBooleanList(_0x3ca786,_0xa7aeec,_0x434732,_0x1924a7,_0xaba3e5,_0x179f4c){var _0x4b7c77={'method':_0xfc4f('0xb0'),'uri':_0x3ca786+_0xfc4f('0xb1')+_0x1924a7+_0xfc4f('0xcb')+_0xaba3e5+_0xfc4f('0xd2'),'headers':{'Authorization':'Bearer\x20'+_0x179f4c,'If-None-Match':null,'OData-Version':_0xfc4f('0xad')},'json':!![]};return rp(_0x4b7c77)[_0xfc4f('0x30')](function(_0x4a3d9b){var _0xe4f703=[];_0xe4f703[_0xfc4f('0xbd')]({'name':_0x4a3d9b[_0xfc4f('0xd3')]['TrueOption'][_0xfc4f('0xce')][_0xfc4f('0xcf')]['Label'],'value':_0xfc4f('0xd4')},{'name':_0x4a3d9b['OptionSet'][_0xfc4f('0xd5')][_0xfc4f('0xce')][_0xfc4f('0xcf')][_0xfc4f('0xce')],'value':_0xfc4f('0xd6')});var _0x18a55d={'id':_0xa7aeec+'_'+_0x4a3d9b[_0xfc4f('0xb5')],'name':_0x4a3d9b[_0xfc4f('0xd1')]['UserLocalizedLabel'][_0xfc4f('0xce')],'custom':![],'options':_0xe4f703};_0x434732[_0xfc4f('0xbd')](_0x18a55d);return _0x434732;});}function getInputList(_0x237aaf,_0x2a4091,_0x238626,_0x586304,_0x114537,_0x9c692c,_0x5da578){var _0x27f1cc={'method':_0xfc4f('0xb0'),'uri':_0x237aaf+_0xfc4f('0xb1')+_0x114537+_0xfc4f('0xcb')+_0x9c692c+_0xfc4f('0xd7')+_0x238626+_0xfc4f('0xd8'),'headers':{'Authorization':_0xfc4f('0xac')+_0x5da578,'If-None-Match':null,'OData-Version':_0xfc4f('0xad')},'json':!![]};return rp(_0x27f1cc)[_0xfc4f('0x30')](function(_0x4b8c0d){var _0x564ca7={'id':_0x2a4091+'_'+_0x4b8c0d[_0xfc4f('0xb5')],'name':_0x4b8c0d['DisplayName'][_0xfc4f('0xcf')]?_0x4b8c0d[_0xfc4f('0xd1')][_0xfc4f('0xcf')]['Label']:_0x4b8c0d[_0xfc4f('0xb5')],'custom':![],'options':[]};_0x586304[_0xfc4f('0xbd')](_0x564ca7);return _0x586304;});} \ No newline at end of file +var _0x5f6a=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../components/integrations/configuration','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','Dynamics365Account','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','Dynamics365Configuration','order','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','directioncode','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','clientSecret','slice','format','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','password','access_token','GET','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','includes','LogicalName','forEach','substring','lastIndexOf','PicklistAttributeMetadata','push','all','isNil','@odata.type','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','statusCode','Wrong\x20credentials',')/Attributes(','OptionSet','UserLocalizedLabel','Label','Value','DisplayName','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x4431ea,_0x165fd8){var _0x55e1c2=function(_0x578abb){while(--_0x578abb){_0x4431ea['push'](_0x4431ea['shift']());}};_0x55e1c2(++_0x165fd8);}(_0x5f6a,0xc4));var _0xa5f6=function(_0x589539,_0x1a07ef){_0x589539=_0x589539-0x0;var _0x3070f9=_0x5f6a[_0x589539];return _0x3070f9;};'use strict';var pdf=require(_0xa5f6('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa5f6('0x1'));var jsonpatch=require(_0xa5f6('0x2'));var rp=require(_0xa5f6('0x3'));var moment=require(_0xa5f6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa5f6('0x5'));var util=require(_0xa5f6('0x6'));var path=require(_0xa5f6('0x7'));var sox=require(_0xa5f6('0x8'));var csv=require(_0xa5f6('0x9'));var ejs=require(_0xa5f6('0xa'));var fs=require('fs');var _=require(_0xa5f6('0xb'));var squel=require(_0xa5f6('0xc'));var crypto=require(_0xa5f6('0xd'));var jsforce=require(_0xa5f6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa5f6('0xf'));var Redis=require(_0xa5f6('0x10'));var authService=require(_0xa5f6('0x11'));var qs=require(_0xa5f6('0x12'));var as=require(_0xa5f6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5f6('0x14'))(_0xa5f6('0x15'));var utils=require('../../config/utils');var config=require(_0xa5f6('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa5f6('0x17'));var jayson=require('jayson/promise');var client=jayson[_0xa5f6('0x18')][_0xa5f6('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5286b7,_0x42480a,_0x35eade){if(_0x35eade){var _0x2919fd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2919fd[_0xa5f6('0x1a')](_0x42480a)){return _0x5286b7;}else{throw new db['Sequelize'][(_0xa5f6('0x1b'))](_0xa5f6('0x1c'));}}else{return _0x5286b7;}}function respondWithRpcPromise(_0x17f7f7,_0x5dc17b,_0x3b4780,_0x3b2b23){return new BPromise(function(_0x1c53a1,_0xdda598){var _0x407845=_0x3b2b23||client;return _0x407845['request'](_0x17f7f7,_0x3b4780)[_0xa5f6('0x1d')](function(_0x39f98a){logger['info'](_0xa5f6('0x1e'),_0x5dc17b,_0xa5f6('0x1f'));logger[_0xa5f6('0x20')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x5dc17b,'request\x20sent',JSON['stringify'](_0x39f98a));if(_0x39f98a[_0xa5f6('0x21')]){if(_0x39f98a['error'][_0xa5f6('0x22')]===0x1f4){logger[_0xa5f6('0x21')](_0xa5f6('0x1e'),_0x5dc17b,_0x39f98a['error'][_0xa5f6('0x23')]);return _0xdda598(_0x39f98a['error'][_0xa5f6('0x23')]);}logger[_0xa5f6('0x21')](_0xa5f6('0x1e'),_0x5dc17b,_0x39f98a[_0xa5f6('0x21')][_0xa5f6('0x23')]);return _0x1c53a1(_0x39f98a['error']['message']);}else{logger[_0xa5f6('0x24')]('Dynamics365Account,\x20%s,\x20%s',_0x5dc17b,_0xa5f6('0x1f'));_0x1c53a1(_0x39f98a['result'][_0xa5f6('0x23')]);}})[_0xa5f6('0x25')](function(_0x4330c4){logger[_0xa5f6('0x21')](_0xa5f6('0x1e'),_0x5dc17b,_0x4330c4);_0xdda598(_0x4330c4);});});}function respondWithStatusCode(_0x220992,_0x7613c4){_0x7613c4=_0x7613c4||0xcc;return function(_0x1bf562){if(_0x1bf562){return _0x220992[_0xa5f6('0x26')](_0x7613c4);}return _0x220992[_0xa5f6('0x27')](_0x7613c4)[_0xa5f6('0x28')]();};}function respondWithResult(_0x4f1887,_0x4bab0a){_0x4bab0a=_0x4bab0a||0xc8;return function(_0x29c101){if(_0x29c101){return _0x4f1887[_0xa5f6('0x27')](_0x4bab0a)[_0xa5f6('0x29')](_0x29c101);}};}function respondWithFilteredResult(_0x12e192,_0x19dc39){return function(_0x8cab41){if(_0x8cab41){var _0x5ac06e=_0x8cab41[_0xa5f6('0x2a')],_0x273192=_0x19dc39[_0xa5f6('0x2b')],_0x43fe1d=_0x19dc39[_0xa5f6('0x2b')]+_0x19dc39[_0xa5f6('0x2c')],_0x3417a8;if(_0x43fe1d>=_0x5ac06e){_0x43fe1d=_0x5ac06e;_0x3417a8=0xc8;}else{_0x3417a8=0xce;}_0x12e192[_0xa5f6('0x27')](_0x3417a8);return _0x12e192['set'](_0xa5f6('0x2d'),_0x273192+'-'+_0x43fe1d+'/'+_0x5ac06e)[_0xa5f6('0x29')](_0x8cab41);}return null;};}function patchUpdates(_0x459887){return function(_0x3f2ef0){try{jsonpatch[_0xa5f6('0x2e')](_0x3f2ef0,_0x459887,!![]);}catch(_0x4bc914){return BPromise[_0xa5f6('0x2f')](_0x4bc914);}return _0x3f2ef0[_0xa5f6('0x30')]();};}function saveUpdates(_0x2e285b,_0x507b3b){return function(_0x3fcefb){if(_0x3fcefb){return _0x3fcefb[_0xa5f6('0x31')](_0x2e285b)[_0xa5f6('0x1d')](function(_0xeb02b1){return _0xeb02b1;});}return null;};}function removeEntity(_0x258085,_0x55f0b0){return function(_0x22bdd7){if(_0x22bdd7){return _0x22bdd7[_0xa5f6('0x32')]()[_0xa5f6('0x1d')](function(){_0x258085[_0xa5f6('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1499ab,_0x9b2ff1){return function(_0x16d38d){if(!_0x16d38d){_0x1499ab[_0xa5f6('0x26')](0x194);}return _0x16d38d;};}function handleError(_0x5495bd,_0x363fad){_0x363fad=_0x363fad||0x1f4;return function(_0x42bba2){logger[_0xa5f6('0x21')](_0x42bba2[_0xa5f6('0x33')]);if(_0x42bba2[_0xa5f6('0x34')]){delete _0x42bba2[_0xa5f6('0x34')];}_0x5495bd['status'](_0x363fad)[_0xa5f6('0x35')](_0x42bba2);};}exports['index']=function(_0x2146f1,_0x5c4721){var _0x5dcd01={},_0x28c430={},_0x5c8521={'count':0x0,'rows':[]};var _0x115a73=_[_0xa5f6('0x36')](db['Dynamics365Account'][_0xa5f6('0x37')],function(_0x51b4bb){return{'name':_0x51b4bb['fieldName'],'type':_0x51b4bb['type'][_0xa5f6('0x38')]};});_0x28c430[_0xa5f6('0x39')]=_[_0xa5f6('0x36')](_0x115a73,_0xa5f6('0x34'));_0x28c430[_0xa5f6('0x3a')]=_[_0xa5f6('0x3b')](_0x2146f1[_0xa5f6('0x3a')]);_0x28c430[_0xa5f6('0x3c')]=_[_0xa5f6('0x3d')](_0x28c430[_0xa5f6('0x39')],_0x28c430[_0xa5f6('0x3a')]);_0x5dcd01[_0xa5f6('0x3e')]=_[_0xa5f6('0x3d')](_0x28c430[_0xa5f6('0x39')],qs['fields'](_0x2146f1[_0xa5f6('0x3a')][_0xa5f6('0x3f')]));_0x5dcd01[_0xa5f6('0x3e')]=_0x5dcd01[_0xa5f6('0x3e')][_0xa5f6('0x40')]?_0x5dcd01[_0xa5f6('0x3e')]:_0x28c430[_0xa5f6('0x39')];if(!_0x2146f1[_0xa5f6('0x3a')][_0xa5f6('0x41')]('nolimit')){_0x5dcd01['limit']=qs['limit'](_0x2146f1[_0xa5f6('0x3a')][_0xa5f6('0x2c')]);_0x5dcd01[_0xa5f6('0x2b')]=qs[_0xa5f6('0x2b')](_0x2146f1[_0xa5f6('0x3a')][_0xa5f6('0x2b')]);}_0x5dcd01['order']=qs[_0xa5f6('0x42')](_0x2146f1[_0xa5f6('0x3a')]['sort']);_0x5dcd01[_0xa5f6('0x43')]=qs[_0xa5f6('0x3c')](_[_0xa5f6('0x44')](_0x2146f1[_0xa5f6('0x3a')],_0x28c430[_0xa5f6('0x3c')]));if(_0x2146f1[_0xa5f6('0x3a')][_0xa5f6('0x45')]){_0x5dcd01[_0xa5f6('0x43')]=_[_0xa5f6('0x46')](_0x5dcd01[_0xa5f6('0x43')],{'$or':_['map'](_0x115a73,function(_0x47e440){if(_0x47e440[_0xa5f6('0x47')]!==_0xa5f6('0x48')){var _0x3c51b9={};_0x3c51b9[_0x47e440['name']]={'$like':'%'+_0x2146f1[_0xa5f6('0x3a')][_0xa5f6('0x45')]+'%'};return _0x3c51b9;}})});}_0x5dcd01=_[_0xa5f6('0x46')]({},_0x5dcd01,_0x2146f1[_0xa5f6('0x49')]);var _0x5e1c96={'where':_0x5dcd01[_0xa5f6('0x43')]};return db[_0xa5f6('0x4a')][_0xa5f6('0x2a')](_0x5e1c96)[_0xa5f6('0x1d')](function(_0x46231a){_0x5c8521[_0xa5f6('0x2a')]=_0x46231a;if(_0x2146f1[_0xa5f6('0x3a')][_0xa5f6('0x4b')]){_0x5dcd01[_0xa5f6('0x4c')]=[{'all':!![]}];}return db[_0xa5f6('0x4a')][_0xa5f6('0x4d')](_0x5dcd01);})[_0xa5f6('0x1d')](function(_0x566c4b){_0x5c8521[_0xa5f6('0x4e')]=_0x566c4b;return _0x5c8521;})[_0xa5f6('0x1d')](respondWithFilteredResult(_0x5c4721,_0x5dcd01))[_0xa5f6('0x25')](handleError(_0x5c4721,null));};exports[_0xa5f6('0x4f')]=function(_0x586893,_0x19d3b1){var _0x44dc92={'raw':![],'where':{'id':_0x586893[_0xa5f6('0x50')]['id']}},_0x3de087={};_0x3de087[_0xa5f6('0x39')]=_[_0xa5f6('0x3b')](db[_0xa5f6('0x4a')][_0xa5f6('0x37')]);_0x3de087[_0xa5f6('0x3a')]=_['keys'](_0x586893[_0xa5f6('0x3a')]);_0x3de087[_0xa5f6('0x3c')]=_[_0xa5f6('0x3d')](_0x3de087[_0xa5f6('0x39')],_0x3de087[_0xa5f6('0x3a')]);_0x44dc92[_0xa5f6('0x3e')]=_[_0xa5f6('0x3d')](_0x3de087['model'],qs[_0xa5f6('0x3f')](_0x586893[_0xa5f6('0x3a')]['fields']));_0x44dc92[_0xa5f6('0x3e')]=_0x44dc92[_0xa5f6('0x3e')][_0xa5f6('0x40')]?_0x44dc92['attributes']:_0x3de087[_0xa5f6('0x39')];if(_0x586893[_0xa5f6('0x3a')][_0xa5f6('0x4b')]){_0x44dc92['include']=[{'all':!![]}];}_0x44dc92=_[_0xa5f6('0x46')]({},_0x44dc92,_0x586893['options']);return db[_0xa5f6('0x4a')][_0xa5f6('0x51')](_0x44dc92)['then'](handleEntityNotFound(_0x19d3b1,null))['then'](respondWithResult(_0x19d3b1,null))[_0xa5f6('0x25')](handleError(_0x19d3b1,null));};exports[_0xa5f6('0x52')]=function(_0x162939,_0x5dce6f){return db[_0xa5f6('0x4a')]['create'](_0x162939['body'],{})[_0xa5f6('0x1d')](respondWithResult(_0x5dce6f,0xc9))[_0xa5f6('0x25')](handleError(_0x5dce6f,null));};exports[_0xa5f6('0x31')]=function(_0x74d0b7,_0x45f47e){if(_0x74d0b7['body']['id']){delete _0x74d0b7[_0xa5f6('0x53')]['id'];}return db['Dynamics365Account'][_0xa5f6('0x51')]({'where':{'id':_0x74d0b7[_0xa5f6('0x50')]['id']}})['then'](handleEntityNotFound(_0x45f47e,null))[_0xa5f6('0x1d')](saveUpdates(_0x74d0b7[_0xa5f6('0x53')],null))[_0xa5f6('0x1d')](respondWithResult(_0x45f47e,null))[_0xa5f6('0x25')](handleError(_0x45f47e,null));};exports[_0xa5f6('0x32')]=function(_0x1ea9f2,_0x45f6de){return db[_0xa5f6('0x4a')][_0xa5f6('0x51')]({'where':{'id':_0x1ea9f2[_0xa5f6('0x50')]['id']}})[_0xa5f6('0x1d')](handleEntityNotFound(_0x45f6de,null))['then'](removeEntity(_0x45f6de,null))['catch'](handleError(_0x45f6de,null));};exports[_0xa5f6('0x54')]=function(_0x5c33fb,_0x366639,_0xfed1ef){var _0x320d57={};var _0x960573={};var _0x38cabd;var _0xef3cb3;return db['Dynamics365Account'][_0xa5f6('0x55')]({'where':{'id':_0x5c33fb['params']['id']}})[_0xa5f6('0x1d')](handleEntityNotFound(_0x366639,null))[_0xa5f6('0x1d')](function(_0x3ff4f2){if(_0x3ff4f2){_0x38cabd=_0x3ff4f2;_0x960573[_0xa5f6('0x39')]=_['keys'](db[_0xa5f6('0x56')][_0xa5f6('0x37')]);_0x960573['query']=_[_0xa5f6('0x3b')](_0x5c33fb[_0xa5f6('0x3a')]);_0x960573[_0xa5f6('0x3c')]=_[_0xa5f6('0x3d')](_0x960573[_0xa5f6('0x39')],_0x960573[_0xa5f6('0x3a')]);_0x320d57['attributes']=_[_0xa5f6('0x3d')](_0x960573['model'],qs[_0xa5f6('0x3f')](_0x5c33fb[_0xa5f6('0x3a')][_0xa5f6('0x3f')]));_0x320d57['attributes']=_0x320d57[_0xa5f6('0x3e')][_0xa5f6('0x40')]?_0x320d57[_0xa5f6('0x3e')]:_0x960573['model'];_0x320d57[_0xa5f6('0x57')]=qs[_0xa5f6('0x42')](_0x5c33fb[_0xa5f6('0x3a')][_0xa5f6('0x42')]);_0x320d57[_0xa5f6('0x43')]=qs[_0xa5f6('0x3c')](_[_0xa5f6('0x44')](_0x5c33fb['query'],_0x960573[_0xa5f6('0x3c')]));if(_0x5c33fb[_0xa5f6('0x3a')][_0xa5f6('0x45')]){_0x320d57['where']=_[_0xa5f6('0x46')](_0x320d57['where'],{'$or':_[_0xa5f6('0x36')](_0x320d57[_0xa5f6('0x3e')],function(_0xcdb63f){var _0x5f1330={};_0x5f1330[_0xcdb63f]={'$like':'%'+_0x5c33fb[_0xa5f6('0x3a')][_0xa5f6('0x45')]+'%'};return _0x5f1330;})});}_0x320d57=_[_0xa5f6('0x46')]({},_0x320d57,_0x5c33fb[_0xa5f6('0x49')]);return _0x38cabd[_0xa5f6('0x54')](_0x320d57);}})[_0xa5f6('0x1d')](function(_0x3fa66b){if(_0x3fa66b){_0xef3cb3=_0x3fa66b['length'];if(!_0x5c33fb['query']['hasOwnProperty']('nolimit')){_0x320d57['limit']=qs[_0xa5f6('0x2c')](_0x5c33fb[_0xa5f6('0x3a')][_0xa5f6('0x2c')]);_0x320d57[_0xa5f6('0x2b')]=qs[_0xa5f6('0x2b')](_0x5c33fb['query'][_0xa5f6('0x2b')]);}return _0x38cabd['getConfigurations'](_0x320d57);}})['then'](function(_0x3a04e0){if(_0x3a04e0){return _0x3a04e0?{'count':_0xef3cb3,'rows':_0x3a04e0}:null;}})[_0xa5f6('0x1d')](respondWithResult(_0x366639,null))['catch'](handleError(_0x366639,null));};exports[_0xa5f6('0x58')]=function(_0x200357,_0x4a9061,_0x9ac5f1){if(_0x200357[_0xa5f6('0x53')]['id']){delete _0x200357[_0xa5f6('0x53')]['id'];}return db[_0xa5f6('0x4a')]['findOne']({'where':{'id':_0x200357[_0xa5f6('0x50')]['id']}})['then'](handleEntityNotFound(_0x4a9061,null))[_0xa5f6('0x1d')](function(_0x1d1e80){if(_0x1d1e80){_0x200357['body'][_0xa5f6('0x59')]=_0x1d1e80['id'];_0x200357['body'][_0xa5f6('0x5a')]=integrations['getSubjects'](_0x200357[_0xa5f6('0x53')][_0xa5f6('0x5b')],_0x200357['body'][_0xa5f6('0x47')]);_0x200357[_0xa5f6('0x53')][_0xa5f6('0x5c')]=integrations[_0xa5f6('0x5d')](_0x200357['body'][_0xa5f6('0x5b')],_0x200357['body'][_0xa5f6('0x47')]);return db[_0xa5f6('0x56')]['create'](_0x200357[_0xa5f6('0x53')],{'include':[{'model':db[_0xa5f6('0x5e')],'as':_0xa5f6('0x5a')},{'model':db[_0xa5f6('0x5e')],'as':'Descriptions'}]});}return null;})[_0xa5f6('0x1d')](respondWithResult(_0x4a9061,null))['catch'](handleError(_0x4a9061,null));};exports[_0xa5f6('0x5f')]=function(_0x2436bb,_0x39d433,_0x1c9152){var _0x53c897=_0x2436bb[_0xa5f6('0x3a')][_0xa5f6('0x60')];var _0x2af829=_0x53c897===_0xa5f6('0x61')?_0xa5f6('0x62'):_0xa5f6('0x63');var _0x9b8051='';var _0x36f994='';var _0x56328d='';var _0x44a692='';var _0x3b46f7='';var _0x1c6d9b='';var _0x27c866='';var _0xecb49c='';var _0x302d07=[_0xa5f6('0x64'),_0xa5f6('0x65'),_0xa5f6('0x66'),_0xa5f6('0x67'),_0xa5f6('0x68'),_0xa5f6('0x69'),_0xa5f6('0x6a'),'regardingobjectid',_0xa5f6('0x6b'),'phonecall_activity_parties'];var _0x347f92=[_0xa5f6('0x6c'),_0xa5f6('0x6d'),_0xa5f6('0x6e'),'billedserviceunits',_0xa5f6('0x6f'),_0xa5f6('0x70'),_0xa5f6('0x71'),_0xa5f6('0x72'),_0xa5f6('0x73'),_0xa5f6('0x74'),_0xa5f6('0x75'),'createdbyyominame',_0xa5f6('0x76'),_0xa5f6('0x77'),'createdonbehalfbyyominame',_0xa5f6('0x78'),'customeridtype',_0xa5f6('0x79'),_0xa5f6('0x7a'),_0xa5f6('0x7b'),_0xa5f6('0x7c'),_0xa5f6('0x7d'),_0xa5f6('0x7e'),_0xa5f6('0x7f'),_0xa5f6('0x80'),_0xa5f6('0x81'),'importsequencenumber','influencescore',_0xa5f6('0x82'),'lastonholdtime',_0xa5f6('0x83'),_0xa5f6('0x84'),_0xa5f6('0x85'),_0xa5f6('0x86'),_0xa5f6('0x87'),_0xa5f6('0x88'),_0xa5f6('0x89'),_0xa5f6('0x8a'),'msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime',_0xa5f6('0x8b'),_0xa5f6('0x8c'),_0xa5f6('0x8d'),_0xa5f6('0x8e'),_0xa5f6('0x8f'),_0xa5f6('0x90'),_0xa5f6('0x91'),_0xa5f6('0x92'),_0xa5f6('0x93'),'productserialnumber',_0xa5f6('0x94'),_0xa5f6('0x95'),_0xa5f6('0x96'),_0xa5f6('0x97'),_0xa5f6('0x98'),_0xa5f6('0x99'),'slainvokedidname',_0xa5f6('0x9a'),'socialprofileidname',_0xa5f6('0x9b'),_0xa5f6('0x9c'),_0xa5f6('0x9d'),_0xa5f6('0x9e'),_0xa5f6('0x9f'),_0xa5f6('0xa0'),_0xa5f6('0xa1'),'utcconversiontimezonecode',_0xa5f6('0xa2')];var _0x1622cf=_0x302d07[_0xa5f6('0xa3')](_0x347f92);return db[_0xa5f6('0x4a')][_0xa5f6('0x55')]({'where':{'id':_0x2436bb[_0xa5f6('0x50')]['id']},'attributes':['id',_0xa5f6('0xa4'),'password','remoteUri','tenantId','clientId',_0xa5f6('0xa5')]})['then'](handleEntityNotFound(_0x39d433,null))[_0xa5f6('0x1d')](function(_0x5625e8){if(_0x5625e8){_0xecb49c=_0x5625e8['remoteUri'];var _0x505d72=_0xecb49c[_0xa5f6('0xa6')](-0x1);if(_0x505d72==='/'){_0xecb49c=_0xecb49c['substring'](0x0,_0xecb49c['lastIndexOf'](_0x505d72));}_0x27c866=util[_0xa5f6('0xa7')]('%s/api/data/v9.0/',_0xecb49c);var _0x2fcfa0={'method':_0xa5f6('0xa8'),'uri':_0xa5f6('0xa9')+_0x5625e8[_0xa5f6('0xaa')]+_0xa5f6('0xab'),'form':{'client_id':_0x5625e8[_0xa5f6('0xac')],'resource':_0xecb49c,'username':_0x5625e8[_0xa5f6('0xa4')],'password':_0x5625e8[_0xa5f6('0xad')],'grant_type':_0xa5f6('0xad'),'client_secret':_0x5625e8[_0xa5f6('0xa5')]},'json':!![]};return rp(_0x2fcfa0);}})[_0xa5f6('0x1d')](function(_0x431364){_0x1c6d9b=_0x431364[_0xa5f6('0xae')];var _0x3b7735={'method':_0xa5f6('0xaf'),'uri':encodeURI(_0x27c866+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x2af829+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x1c6d9b,'If-None-Match':null,'OData-Version':_0xa5f6('0xb0')},'json':!![]};return rp(_0x3b7735);})['then'](function(_0x3c36bd){var _0x169b84=_0x3c36bd[_0xa5f6('0xb1')][0x0];var _0x4f5ea8=_0x169b84[_0xa5f6('0xb2')];var _0x43cd20={'method':'GET','uri':_0x27c866+_0xa5f6('0xb3')+_0x4f5ea8+_0xa5f6('0xb4'),'headers':{'Authorization':_0xa5f6('0xb5')+_0x1c6d9b,'If-None-Match':null,'OData-Version':_0xa5f6('0xb0')},'json':!![]};return rp(_0x43cd20);})[_0xa5f6('0x1d')](function(_0x32ecba){_0x9b8051=_0x32ecba;_0x36f994=_0x9b8051[_0xa5f6('0xb6')];_0x36f994=_[_0xa5f6('0xb7')](_0x36f994,function(_0x399946){return!_0x1622cf[_0xa5f6('0xb8')](_0x399946[_0xa5f6('0xb9')]);});var _0x3c9efb=[];var _0x4bce9d=[];_0x36f994[_0xa5f6('0xba')](function(_0x54b305){if(_0x54b305['@odata.type']){var _0x456c4=_0x54b305['@odata.type'][_0xa5f6('0xbb')](_0x54b305['@odata.type'][_0xa5f6('0xbc')]('.')+0x1);if(_0x456c4===_0xa5f6('0xbd')){_0x3c9efb[_0xa5f6('0xbe')](getSelectList(_0x27c866,_0x53c897,_0x4bce9d,_0x9b8051[_0xa5f6('0xb2')],_0x54b305[_0xa5f6('0xb2')],_0x1c6d9b));}}});return Promise[_0xa5f6('0xbf')](_0x3c9efb);})[_0xa5f6('0x1d')](function(_0x897dbc){_0x56328d=_0x897dbc[0x0];var _0x3ca9e7=[];var _0x2bafb9=[];_0x36f994[_0xa5f6('0xba')](function(_0x3f828b){if(!_[_0xa5f6('0xc0')](_0x3f828b[_0xa5f6('0xc1')])){var _0x21451b=_0x3f828b[_0xa5f6('0xc1')][_0xa5f6('0xbb')](_0x3f828b[_0xa5f6('0xc1')][_0xa5f6('0xbc')]('.')+0x1);if(_0x21451b==='BooleanAttributeMetadata'){_0x3ca9e7['push'](getBooleanList(_0x27c866,_0x53c897,_0x2bafb9,_0x9b8051[_0xa5f6('0xb2')],_0x3f828b['MetadataId'],_0x1c6d9b));}}});return Promise[_0xa5f6('0xbf')](_0x3ca9e7);})[_0xa5f6('0x1d')](function(_0x4bd932){_0x44a692=_0x4bd932[0x0];var _0x4756eb=[];var _0x340a3d=[];_0x36f994[_0xa5f6('0xba')](function(_0x5ee53c){if(_0x5ee53c[_0xa5f6('0xc1')]){var _0x1cc47e=_0x5ee53c[_0xa5f6('0xc1')][_0xa5f6('0xbb')](_0x5ee53c['@odata.type'][_0xa5f6('0xbc')]('.')+0x1);if(_0x1cc47e===_0xa5f6('0xc2')||_0x1cc47e===_0xa5f6('0xc3')||_0x1cc47e==='BigIntAttributeMetadata'||_0x1cc47e===_0xa5f6('0xc4')||_0x1cc47e===_0xa5f6('0xc5')||_0x1cc47e==='DateTimeAttributeMetadata'||_0x1cc47e==='StatusAttributeMetadata'||_0x1cc47e==='EntityNameAttributeMetadata'||_0x1cc47e==='StateAttributeMetadata'||_0x1cc47e==='DecimalAttributeMetadata'){_0x4756eb[_0xa5f6('0xbe')](getInputList(_0x27c866,_0x53c897,_0x1cc47e,_0x340a3d,_0x9b8051[_0xa5f6('0xb2')],_0x5ee53c[_0xa5f6('0xb2')],_0x1c6d9b));}}});return Promise[_0xa5f6('0xbf')](_0x4756eb);})['then'](function(_0xde3eaa){_0x3b46f7=_0xde3eaa[0x0];var _0xb65e98=_0x56328d[_0xa5f6('0xa3')](_0x44a692)['concat'](_0x3b46f7);var _0x395432={'count':_0xb65e98[_0xa5f6('0x40')],'rows':_0xb65e98};return _0x395432;})[_0xa5f6('0x1d')](respondWithResult(_0x39d433,null))['catch'](function(_0x41e25e){var _0x17b27a=_0x2436bb[_0xa5f6('0x3a')][_0xa5f6('0x1a')]?0x1f4:_0x41e25e[_0xa5f6('0xc6')]||0x1f4;logger['error'](_0x41e25e[_0xa5f6('0x33')]);delete _0x41e25e[_0xa5f6('0x34')];if(_0x17b27a===0x191){_0x17b27a=0x190;}_0x39d433[_0xa5f6('0x27')](_0x17b27a)[_0xa5f6('0x35')](_0x2436bb[_0xa5f6('0x3a')]['test']?{'message':_0xa5f6('0xc7'),'statusCode':_0x41e25e[_0xa5f6('0xc6')]}:_0x41e25e);});};function getSelectList(_0xb7b480,_0x39680c,_0x6c216d,_0xd69e44,_0x498748,_0x1f502d){var _0x5d9da6={'method':'GET','uri':_0xb7b480+_0xa5f6('0xb3')+_0xd69e44+_0xa5f6('0xc8')+_0x498748+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x1f502d,'If-None-Match':null,'OData-Version':_0xa5f6('0xb0')},'json':!![]};return rp(_0x5d9da6)[_0xa5f6('0x1d')](function(_0x429f6){var _0x30d918=[];var _0x1cf050=_0x429f6[_0xa5f6('0xc9')]['Options'];_0x1cf050[_0xa5f6('0xba')](function(_0x1aed07){_0x30d918[_0xa5f6('0xbe')]({'name':_0x1aed07['Label'][_0xa5f6('0xca')][_0xa5f6('0xcb')],'value':String(_0x1aed07[_0xa5f6('0xcc')])});});var _0x3bd161={'id':_0x39680c+'_'+_0x429f6[_0xa5f6('0xb9')],'name':_0x429f6[_0xa5f6('0xcd')][_0xa5f6('0xca')][_0xa5f6('0xcb')],'custom':![],'options':_0x30d918};_0x6c216d[_0xa5f6('0xbe')](_0x3bd161);return _0x6c216d;});}function getBooleanList(_0xa5c7c7,_0x26573e,_0xf5816,_0x5a48d5,_0x1ab3bd,_0x1aff14){var _0x1f527f={'method':_0xa5f6('0xaf'),'uri':_0xa5c7c7+_0xa5f6('0xb3')+_0x5a48d5+_0xa5f6('0xc8')+_0x1ab3bd+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xa5f6('0xb5')+_0x1aff14,'If-None-Match':null,'OData-Version':_0xa5f6('0xb0')},'json':!![]};return rp(_0x1f527f)[_0xa5f6('0x1d')](function(_0x2a6037){var _0x279f3a=[];_0x279f3a[_0xa5f6('0xbe')]({'name':_0x2a6037[_0xa5f6('0xc9')][_0xa5f6('0xce')]['Label'][_0xa5f6('0xca')][_0xa5f6('0xcb')],'value':_0xa5f6('0xcf')},{'name':_0x2a6037['OptionSet'][_0xa5f6('0xd0')][_0xa5f6('0xcb')][_0xa5f6('0xca')][_0xa5f6('0xcb')],'value':_0xa5f6('0xd1')});var _0x1b232a={'id':_0x26573e+'_'+_0x2a6037['LogicalName'],'name':_0x2a6037[_0xa5f6('0xcd')][_0xa5f6('0xca')][_0xa5f6('0xcb')],'custom':![],'options':_0x279f3a};_0xf5816['push'](_0x1b232a);return _0xf5816;});}function getInputList(_0x582028,_0x11ac13,_0x2d078d,_0x36bd6e,_0x43ae3f,_0x584fc0,_0x213868){var _0x4c1c14={'method':_0xa5f6('0xaf'),'uri':_0x582028+_0xa5f6('0xb3')+_0x43ae3f+')/Attributes('+_0x584fc0+_0xa5f6('0xd2')+_0x2d078d+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xa5f6('0xb5')+_0x213868,'If-None-Match':null,'OData-Version':_0xa5f6('0xb0')},'json':!![]};return rp(_0x4c1c14)[_0xa5f6('0x1d')](function(_0x3f454c){var _0x191f34={'id':_0x11ac13+'_'+_0x3f454c[_0xa5f6('0xb9')],'name':_0x3f454c[_0xa5f6('0xcd')][_0xa5f6('0xca')]?_0x3f454c[_0xa5f6('0xcd')][_0xa5f6('0xca')][_0xa5f6('0xcb')]:_0x3f454c[_0xa5f6('0xb9')],'custom':![],'options':[]};_0x36bd6e[_0xa5f6('0xbe')](_0x191f34);return _0x36bd6e;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 915fe44..522a76e 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 _0x6181=['moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','api'];(function(_0x536b45,_0x3f2427){var _0x5834c8=function(_0x472158){while(--_0x472158){_0x536b45['push'](_0x536b45['shift']());}};_0x5834c8(++_0x3f2427);}(_0x6181,0x176));var _0x1618=function(_0x3671b7,_0x5398bd){_0x3671b7=_0x3671b7-0x0;var _0x50f41b=_0x6181[_0x3671b7];return _0x50f41b;};'use strict';var _=require('lodash');var util=require(_0x1618('0x0'));var logger=require(_0x1618('0x1'))(_0x1618('0x2'));var moment=require(_0x1618('0x3'));var BPromise=require(_0x1618('0x4'));var rp=require(_0x1618('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1618('0x6'));var config=require(_0x1618('0x7'));var attributes=require(_0x1618('0x8'));var integrations=require(_0x1618('0x9'));module[_0x1618('0xa')]=function(_0x2fd1b7,_0x2a72e0){return _0x2fd1b7['define'](_0x1618('0xb'),attributes,{'tableName':_0x1618('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7f7=['exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x2c41cf,_0x2741d5){var _0x3d506c=function(_0x1cef45){while(--_0x1cef45){_0x2c41cf['push'](_0x2c41cf['shift']());}};_0x3d506c(++_0x2741d5);}(_0xb7f7,0xd6));var _0x7b7f=function(_0xbcd665,_0x3a93ea){_0xbcd665=_0xbcd665-0x0;var _0x5ca35a=_0xb7f7[_0xbcd665];return _0x5ca35a;};'use strict';var _=require(_0x7b7f('0x0'));var util=require(_0x7b7f('0x1'));var logger=require('../../config/logger')(_0x7b7f('0x2'));var moment=require(_0x7b7f('0x3'));var BPromise=require(_0x7b7f('0x4'));var rp=require(_0x7b7f('0x5'));var fs=require('fs');var path=require(_0x7b7f('0x6'));var rimraf=require(_0x7b7f('0x7'));var config=require(_0x7b7f('0x8'));var attributes=require(_0x7b7f('0x9'));var integrations=require(_0x7b7f('0xa'));module[_0x7b7f('0xb')]=function(_0x5d5a39,_0x1beda2){return _0x5d5a39[_0x7b7f('0xc')](_0x7b7f('0xd'),attributes,{'tableName':_0x7b7f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index d97322f..36e77ba 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 _0x49c1=['where','attributes','limit','include','map','model','raw','ShowDynamics365Account','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x49c1,0xef));var _0x149c=function(_0x38502a,_0x31c9d5){_0x38502a=_0x38502a-0x0;var _0xf846e8=_0x49c1[_0x38502a];return _0xf846e8;};'use strict';var _=require(_0x149c('0x0'));var util=require('util');var moment=require(_0x149c('0x1'));var BPromise=require(_0x149c('0x2'));var rs=require(_0x149c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x149c('0x4'))['db'];var utils=require(_0x149c('0x5'));var logger=require('../../config/logger')(_0x149c('0x6'));var config=require(_0x149c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x149c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33fa87,_0x2a61c0,_0x51f682){return new BPromise(function(_0x4396bb,_0xfe0da6){return client['request'](_0x33fa87,_0x51f682)[_0x149c('0x9')](function(_0x350050){logger['info'](_0x149c('0xa'),_0x2a61c0,_0x149c('0xb'));logger[_0x149c('0xc')](_0x149c('0xd'),_0x2a61c0,'request\x20sent',JSON[_0x149c('0xe')](_0x350050));if(_0x350050[_0x149c('0xf')]){if(_0x350050[_0x149c('0xf')][_0x149c('0x10')]===0x1f4){logger[_0x149c('0xf')](_0x149c('0xa'),_0x2a61c0,_0x350050[_0x149c('0xf')][_0x149c('0x11')]);return _0xfe0da6(_0x350050['error'][_0x149c('0x11')]);}logger[_0x149c('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x2a61c0,_0x350050[_0x149c('0xf')]['message']);return _0x4396bb(_0x350050[_0x149c('0xf')][_0x149c('0x11')]);}else{logger[_0x149c('0x12')](_0x149c('0xa'),_0x2a61c0,_0x149c('0xb'));_0x4396bb(_0x350050[_0x149c('0x13')][_0x149c('0x11')]);}})[_0x149c('0x14')](function(_0x40989d){logger['error'](_0x149c('0xa'),_0x2a61c0,_0x40989d);_0xfe0da6(_0x40989d);});});}exports[_0x149c('0x15')]=function(_0x352f68){var _0x1bcd3d=this;return new Promise(function(_0x35f64f,_0x457a03){return db[_0x149c('0x16')][_0x149c('0x17')]({'raw':_0x352f68['options']?_0x352f68[_0x149c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x352f68['options']?_0x352f68['options'][_0x149c('0x19')]||null:null,'attributes':_0x352f68[_0x149c('0x18')]?_0x352f68[_0x149c('0x18')][_0x149c('0x1a')]||null:null,'limit':_0x352f68[_0x149c('0x18')]?_0x352f68[_0x149c('0x18')][_0x149c('0x1b')]||null:null,'include':_0x352f68['options']?_0x352f68[_0x149c('0x18')][_0x149c('0x1c')]?_[_0x149c('0x1d')](_0x352f68[_0x149c('0x18')][_0x149c('0x1c')],function(_0xb60e06){return{'model':db[_0xb60e06[_0x149c('0x1e')]],'as':_0xb60e06['as'],'attributes':_0xb60e06[_0x149c('0x1a')],'include':_0xb60e06['include']?_[_0x149c('0x1d')](_0xb60e06[_0x149c('0x1c')],function(_0x4bb447){return{'model':db[_0x4bb447[_0x149c('0x1e')]],'as':_0x4bb447['as'],'attributes':_0x4bb447[_0x149c('0x1a')],'include':_0x4bb447[_0x149c('0x1c')]?_[_0x149c('0x1d')](_0x4bb447['include'],function(_0x36e070){return{'model':db[_0x36e070[_0x149c('0x1e')]],'as':_0x36e070['as'],'attributes':_0x36e070[_0x149c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x149c('0x9')](function(_0x149705){logger[_0x149c('0x12')](_0x149c('0x15'),_0x352f68);logger['debug']('GetDynamics365Account',_0x352f68,JSON[_0x149c('0xe')](_0x149705));_0x35f64f(_0x149705);})[_0x149c('0x14')](function(_0x2da1de){logger['error'](_0x149c('0x15'),_0x2da1de[_0x149c('0x11')],_0x352f68);_0x457a03(_0x1bcd3d[_0x149c('0xf')](0x1f4,_0x2da1de[_0x149c('0x11')]));});});};exports['ShowDynamics365Account']=function(_0x3951ae){var _0x1344d9=this;return new Promise(function(_0x2440d3,_0x1dda8a){return db[_0x149c('0x16')]['find']({'raw':_0x3951ae[_0x149c('0x18')]?_0x3951ae['options'][_0x149c('0x1f')]===undefined?!![]:![]:!![],'where':_0x3951ae[_0x149c('0x18')]?_0x3951ae[_0x149c('0x18')][_0x149c('0x19')]||null:null,'attributes':_0x3951ae[_0x149c('0x18')]?_0x3951ae[_0x149c('0x18')][_0x149c('0x1a')]||null:null,'include':_0x3951ae['options']?_0x3951ae[_0x149c('0x18')]['include']?_[_0x149c('0x1d')](_0x3951ae['options'][_0x149c('0x1c')],function(_0x48ac8e){return{'model':db[_0x48ac8e[_0x149c('0x1e')]],'as':_0x48ac8e['as'],'attributes':_0x48ac8e[_0x149c('0x1a')],'include':_0x48ac8e['include']?_['map'](_0x48ac8e[_0x149c('0x1c')],function(_0x82f483){return{'model':db[_0x82f483['model']],'as':_0x82f483['as'],'attributes':_0x82f483['attributes'],'include':_0x82f483[_0x149c('0x1c')]?_[_0x149c('0x1d')](_0x82f483[_0x149c('0x1c')],function(_0x3d0df6){return{'model':db[_0x3d0df6[_0x149c('0x1e')]],'as':_0x3d0df6['as'],'attributes':_0x3d0df6[_0x149c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36f9f9){logger[_0x149c('0x12')](_0x149c('0x20'),_0x3951ae);logger[_0x149c('0xc')]('ShowDynamics365Account',_0x3951ae,JSON[_0x149c('0xe')](_0x36f9f9));_0x2440d3(_0x36f9f9);})[_0x149c('0x14')](function(_0x45f013){logger[_0x149c('0xf')]('ShowDynamics365Account',_0x45f013['message'],_0x3951ae);_0x1dda8a(_0x1344d9[_0x149c('0xf')](0x1f4,_0x45f013[_0x149c('0x11')]));});});}; \ No newline at end of file +var _0x5a43=['randomstring','ioredis','../../mysqldb','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','model','map','attributes','debug','stringify','ShowDynamics365Account','find','lodash','util','moment','bluebird'];(function(_0x21b93f,_0x43c4b9){var _0x3df231=function(_0x429fc5){while(--_0x429fc5){_0x21b93f['push'](_0x21b93f['shift']());}};_0x3df231(++_0x43c4b9);}(_0x5a43,0xf1));var _0x35a4=function(_0x46a6f5,_0x6edfc7){_0x46a6f5=_0x46a6f5-0x0;var _0x124e45=_0x5a43[_0x46a6f5];return _0x124e45;};'use strict';var _=require(_0x35a4('0x0'));var util=require(_0x35a4('0x1'));var moment=require(_0x35a4('0x2'));var BPromise=require(_0x35a4('0x3'));var rs=require(_0x35a4('0x4'));var fs=require('fs');var Redis=require(_0x35a4('0x5'));var db=require(_0x35a4('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x35a4('0x7'));var client=jayson[_0x35a4('0x8')][_0x35a4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b2bf2,_0x384a3e,_0xa4665e){return new BPromise(function(_0x4cc7a3,_0x38e68f){return client[_0x35a4('0xa')](_0x1b2bf2,_0xa4665e)[_0x35a4('0xb')](function(_0x3e23d6){logger[_0x35a4('0xc')](_0x35a4('0xd'),_0x384a3e,'request\x20sent');logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x384a3e,_0x35a4('0xe'),JSON['stringify'](_0x3e23d6));if(_0x3e23d6[_0x35a4('0xf')]){if(_0x3e23d6[_0x35a4('0xf')][_0x35a4('0x10')]===0x1f4){logger['error'](_0x35a4('0xd'),_0x384a3e,_0x3e23d6[_0x35a4('0xf')][_0x35a4('0x11')]);return _0x38e68f(_0x3e23d6[_0x35a4('0xf')]['message']);}logger[_0x35a4('0xf')](_0x35a4('0xd'),_0x384a3e,_0x3e23d6['error'][_0x35a4('0x11')]);return _0x4cc7a3(_0x3e23d6['error'][_0x35a4('0x11')]);}else{logger[_0x35a4('0xc')](_0x35a4('0xd'),_0x384a3e,_0x35a4('0xe'));_0x4cc7a3(_0x3e23d6[_0x35a4('0x12')][_0x35a4('0x11')]);}})[_0x35a4('0x13')](function(_0x26a97e){logger[_0x35a4('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x384a3e,_0x26a97e);_0x38e68f(_0x26a97e);});});}exports[_0x35a4('0x14')]=function(_0x41b56c){var _0x199ef3=this;return new Promise(function(_0x61f568,_0x46cc80){return db[_0x35a4('0x15')][_0x35a4('0x16')]({'raw':_0x41b56c[_0x35a4('0x17')]?_0x41b56c['options'][_0x35a4('0x18')]===undefined?!![]:![]:!![],'where':_0x41b56c['options']?_0x41b56c['options'][_0x35a4('0x19')]||null:null,'attributes':_0x41b56c[_0x35a4('0x17')]?_0x41b56c[_0x35a4('0x17')]['attributes']||null:null,'limit':_0x41b56c[_0x35a4('0x17')]?_0x41b56c[_0x35a4('0x17')][_0x35a4('0x1a')]||null:null,'include':_0x41b56c['options']?_0x41b56c[_0x35a4('0x17')][_0x35a4('0x1b')]?_['map'](_0x41b56c[_0x35a4('0x17')][_0x35a4('0x1b')],function(_0x34fc8d){return{'model':db[_0x34fc8d[_0x35a4('0x1c')]],'as':_0x34fc8d['as'],'attributes':_0x34fc8d['attributes'],'include':_0x34fc8d['include']?_[_0x35a4('0x1d')](_0x34fc8d['include'],function(_0x469728){return{'model':db[_0x469728[_0x35a4('0x1c')]],'as':_0x469728['as'],'attributes':_0x469728[_0x35a4('0x1e')],'include':_0x469728[_0x35a4('0x1b')]?_[_0x35a4('0x1d')](_0x469728[_0x35a4('0x1b')],function(_0x503719){return{'model':db[_0x503719['model']],'as':_0x503719['as'],'attributes':_0x503719['attributes']};}):[]};}):[]};}):[]:[]})[_0x35a4('0xb')](function(_0x69b73e){logger['info']('GetDynamics365Account',_0x41b56c);logger[_0x35a4('0x1f')](_0x35a4('0x14'),_0x41b56c,JSON[_0x35a4('0x20')](_0x69b73e));_0x61f568(_0x69b73e);})[_0x35a4('0x13')](function(_0x5d3313){logger['error']('GetDynamics365Account',_0x5d3313['message'],_0x41b56c);_0x46cc80(_0x199ef3[_0x35a4('0xf')](0x1f4,_0x5d3313[_0x35a4('0x11')]));});});};exports[_0x35a4('0x21')]=function(_0x1da508){var _0x2e1985=this;return new Promise(function(_0x160bb5,_0x2e6d5d){return db[_0x35a4('0x15')][_0x35a4('0x22')]({'raw':_0x1da508[_0x35a4('0x17')]?_0x1da508[_0x35a4('0x17')][_0x35a4('0x18')]===undefined?!![]:![]:!![],'where':_0x1da508[_0x35a4('0x17')]?_0x1da508[_0x35a4('0x17')][_0x35a4('0x19')]||null:null,'attributes':_0x1da508[_0x35a4('0x17')]?_0x1da508['options'][_0x35a4('0x1e')]||null:null,'include':_0x1da508[_0x35a4('0x17')]?_0x1da508[_0x35a4('0x17')]['include']?_[_0x35a4('0x1d')](_0x1da508[_0x35a4('0x17')][_0x35a4('0x1b')],function(_0x48245c){return{'model':db[_0x48245c['model']],'as':_0x48245c['as'],'attributes':_0x48245c[_0x35a4('0x1e')],'include':_0x48245c['include']?_[_0x35a4('0x1d')](_0x48245c[_0x35a4('0x1b')],function(_0x274237){return{'model':db[_0x274237['model']],'as':_0x274237['as'],'attributes':_0x274237['attributes'],'include':_0x274237[_0x35a4('0x1b')]?_[_0x35a4('0x1d')](_0x274237[_0x35a4('0x1b')],function(_0x55510a){return{'model':db[_0x55510a[_0x35a4('0x1c')]],'as':_0x55510a['as'],'attributes':_0x55510a[_0x35a4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x35a4('0xb')](function(_0x368330){logger['info']('ShowDynamics365Account',_0x1da508);logger[_0x35a4('0x1f')](_0x35a4('0x21'),_0x1da508,JSON[_0x35a4('0x20')](_0x368330));_0x160bb5(_0x368330);})[_0x35a4('0x13')](function(_0xba030a){logger['error'](_0x35a4('0x21'),_0xba030a['message'],_0x1da508);_0x2e6d5d(_0x2e1985[_0x35a4('0xf')](0x1f4,_0xba030a['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 1fb6387..adc341f 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 _0xda28=['./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','post','create','update','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x534fac,_0xc6eb31){var _0x22a372=function(_0x2142b2){while(--_0x2142b2){_0x534fac['push'](_0x534fac['shift']());}};_0x22a372(++_0xc6eb31);}(_0xda28,0x1c8));var _0x8da2=function(_0x11d6d3,_0x4ec9d0){_0x11d6d3=_0x11d6d3-0x0;var _0x1d65d5=_0xda28[_0x11d6d3];return _0x1d65d5;};'use strict';var multer=require('multer');var util=require(_0x8da2('0x0'));var path=require(_0x8da2('0x1'));var timeout=require(_0x8da2('0x2'));var express=require(_0x8da2('0x3'));var router=express['Router']();var auth=require(_0x8da2('0x4'));var interaction=require(_0x8da2('0x5'));var config=require('../../config/environment');var controller=require(_0x8da2('0x6'));router[_0x8da2('0x7')]('/',auth[_0x8da2('0x8')](),controller[_0x8da2('0x9')]);router['get'](_0x8da2('0xa'),auth[_0x8da2('0x8')](),controller[_0x8da2('0xb')]);router['get'](_0x8da2('0xc'),auth[_0x8da2('0x8')](),controller[_0x8da2('0xd')]);router[_0x8da2('0x7')]('/:id/subjects',auth[_0x8da2('0x8')](),controller[_0x8da2('0xe')]);router['get']('/:id/descriptions',auth[_0x8da2('0x8')](),controller[_0x8da2('0xf')]);router[_0x8da2('0x10')]('/',auth[_0x8da2('0x8')](),controller[_0x8da2('0x11')]);router['put'](_0x8da2('0xa'),auth[_0x8da2('0x8')](),controller[_0x8da2('0x12')]);router[_0x8da2('0x13')]('/:id',auth[_0x8da2('0x8')](),controller[_0x8da2('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd43a=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','put'];(function(_0x3734b5,_0x15be08){var _0x2a1f07=function(_0x4ab259){while(--_0x4ab259){_0x3734b5['push'](_0x3734b5['shift']());}};_0x2a1f07(++_0x15be08);}(_0xd43a,0xc4));var _0xad43=function(_0x3b6e4b,_0x4721d0){_0x3b6e4b=_0x3b6e4b-0x0;var _0x36ad17=_0xd43a[_0x3b6e4b];return _0x36ad17;};'use strict';var multer=require(_0xad43('0x0'));var util=require(_0xad43('0x1'));var path=require('path');var timeout=require(_0xad43('0x2'));var express=require(_0xad43('0x3'));var router=express[_0xad43('0x4')]();var auth=require(_0xad43('0x5'));var interaction=require(_0xad43('0x6'));var config=require(_0xad43('0x7'));var controller=require(_0xad43('0x8'));router[_0xad43('0x9')]('/',auth[_0xad43('0xa')](),controller[_0xad43('0xb')]);router[_0xad43('0x9')](_0xad43('0xc'),auth[_0xad43('0xa')](),controller['show']);router[_0xad43('0x9')](_0xad43('0xd'),auth[_0xad43('0xa')](),controller[_0xad43('0xe')]);router['get'](_0xad43('0xf'),auth[_0xad43('0xa')](),controller[_0xad43('0x10')]);router[_0xad43('0x9')](_0xad43('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xad43('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xad43('0x13')]('/:id',auth[_0xad43('0xa')](),controller[_0xad43('0x14')]);router[_0xad43('0x15')](_0xad43('0xc'),auth[_0xad43('0xa')](),controller[_0xad43('0x16')]);module[_0xad43('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index f9a9a55..ea5562c 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 _0x5a58=['incident','phonecall','sequelize','STRING'];(function(_0x3de8a7,_0x57b636){var _0x370464=function(_0x4a8a83){while(--_0x4a8a83){_0x3de8a7['push'](_0x3de8a7['shift']());}};_0x370464(++_0x57b636);}(_0x5a58,0xca));var _0x85a5=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x5a58[_0x1c8c28];return _0x1f59b4;};'use strict';var Sequelize=require(_0x85a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x85a5('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x85a5('0x2'),_0x85a5('0x3')),'defaultValue':'incident'}}; \ No newline at end of file +var _0x3f8a=['STRING','ENUM','incident','phonecall'];(function(_0x10c8fa,_0x3f296a){var _0x28c923=function(_0x2851c7){while(--_0x2851c7){_0x10c8fa['push'](_0x10c8fa['shift']());}};_0x28c923(++_0x3f296a);}(_0x3f8a,0x178));var _0xa3f8=function(_0x132a40,_0x36227f){_0x132a40=_0x132a40-0x0;var _0x148c55=_0x3f8a[_0x132a40];return _0x148c55;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa3f8('0x0')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xa3f8('0x1')](_0xa3f8('0x2'),_0xa3f8('0x3')),'defaultValue':_0xa3f8('0x2')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 36b7a71..91b28cb 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 _0xd667=['request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','count','limit','status','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','Dynamics365Configuration','fieldName','key','query','keys','filters','model','attributes','fields','hasOwnProperty','offset','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','intersection','length','find','create','body','findOne','Dynamics365Field','getFields','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x1e9b80,_0x11d74c){var _0x3661f6=function(_0x464122){while(--_0x464122){_0x1e9b80['push'](_0x1e9b80['shift']());}};_0x3661f6(++_0x11d74c);}(_0xd667,0x1bb));var _0x7d66=function(_0x3ab016,_0x1622ed){_0x3ab016=_0x3ab016-0x0;var _0x484c2d=_0xd667[_0x3ab016];return _0x484c2d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7d66('0x0'));var zipdir=require(_0x7d66('0x1'));var jsonpatch=require(_0x7d66('0x2'));var rp=require(_0x7d66('0x3'));var moment=require(_0x7d66('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7d66('0x5'));var util=require(_0x7d66('0x6'));var path=require(_0x7d66('0x7'));var sox=require(_0x7d66('0x8'));var csv=require(_0x7d66('0x9'));var ejs=require(_0x7d66('0xa'));var fs=require('fs');var _=require(_0x7d66('0xb'));var squel=require(_0x7d66('0xc'));var crypto=require('crypto');var jsforce=require(_0x7d66('0xd'));var deskjs=require(_0x7d66('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7d66('0xf'));var Papa=require(_0x7d66('0x10'));var Redis=require('ioredis');var authService=require(_0x7d66('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d66('0x12'));var logger=require('../../config/logger')(_0x7d66('0x13'));var utils=require('../../config/utils');var config=require(_0x7d66('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7d66('0x15'));var client=jayson['client'][_0x7d66('0x16')]({'port':0x232a});function checkPasswordPattern(_0x4bc8cb,_0x2375ca,_0x306ea9){if(_0x306ea9){var _0x71ae8d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x71ae8d[_0x7d66('0x17')](_0x2375ca)){return _0x4bc8cb;}else{throw new db[(_0x7d66('0x18'))][(_0x7d66('0x19'))](_0x7d66('0x1a'));}}else{return _0x4bc8cb;}}function respondWithRpcPromise(_0x5c9011,_0x4f86a0,_0x5db7e9,_0x2c66d7){return new BPromise(function(_0x38c51b,_0x2e2a1d){var _0x19eec5=_0x2c66d7||client;return _0x19eec5[_0x7d66('0x1b')](_0x5c9011,_0x5db7e9)[_0x7d66('0x1c')](function(_0x5a20c5){logger[_0x7d66('0x1d')](_0x7d66('0x1e'),_0x4f86a0,_0x7d66('0x1f'));logger[_0x7d66('0x20')](_0x7d66('0x21'),_0x4f86a0,_0x7d66('0x1f'),JSON[_0x7d66('0x22')](_0x5a20c5));if(_0x5a20c5['error']){if(_0x5a20c5[_0x7d66('0x23')]['code']===0x1f4){logger[_0x7d66('0x23')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4f86a0,_0x5a20c5['error']['message']);return _0x2e2a1d(_0x5a20c5['error'][_0x7d66('0x24')]);}logger[_0x7d66('0x23')](_0x7d66('0x1e'),_0x4f86a0,_0x5a20c5['error']['message']);return _0x38c51b(_0x5a20c5[_0x7d66('0x23')][_0x7d66('0x24')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x4f86a0,_0x7d66('0x1f'));_0x38c51b(_0x5a20c5[_0x7d66('0x25')][_0x7d66('0x24')]);}})[_0x7d66('0x26')](function(_0x3df9b7){logger[_0x7d66('0x23')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4f86a0,_0x3df9b7);_0x2e2a1d(_0x3df9b7);});});}function respondWithStatusCode(_0x521864,_0x1f5166){_0x1f5166=_0x1f5166||0xcc;return function(_0x351a3b){if(_0x351a3b){return _0x521864[_0x7d66('0x27')](_0x1f5166);}return _0x521864['status'](_0x1f5166)[_0x7d66('0x28')]();};}function respondWithResult(_0x44207d,_0x4705e7){_0x4705e7=_0x4705e7||0xc8;return function(_0x253d46){if(_0x253d46){return _0x44207d['status'](_0x4705e7)['json'](_0x253d46);}};}function respondWithFilteredResult(_0x1ef591,_0x1625c1){return function(_0x374e3d){if(_0x374e3d){var _0x2c750a=_0x374e3d[_0x7d66('0x29')],_0x562849=_0x1625c1['offset'],_0x3cdf4b=_0x1625c1['offset']+_0x1625c1[_0x7d66('0x2a')],_0x373b94;if(_0x3cdf4b>=_0x2c750a){_0x3cdf4b=_0x2c750a;_0x373b94=0xc8;}else{_0x373b94=0xce;}_0x1ef591[_0x7d66('0x2b')](_0x373b94);return _0x1ef591[_0x7d66('0x2c')](_0x7d66('0x2d'),_0x562849+'-'+_0x3cdf4b+'/'+_0x2c750a)[_0x7d66('0x2e')](_0x374e3d);}return null;};}function patchUpdates(_0x3b2f15){return function(_0x16b2d4){try{jsonpatch[_0x7d66('0x2f')](_0x16b2d4,_0x3b2f15,!![]);}catch(_0x3939b5){return BPromise[_0x7d66('0x30')](_0x3939b5);}return _0x16b2d4[_0x7d66('0x31')]();};}function saveUpdates(_0x4df1aa,_0x3a810a){return function(_0xe389d0){if(_0xe389d0){return _0xe389d0[_0x7d66('0x32')](_0x4df1aa)[_0x7d66('0x1c')](function(_0x50201b){return _0x50201b;});}return null;};}function removeEntity(_0x168c31,_0x335865){return function(_0x58b185){if(_0x58b185){return _0x58b185[_0x7d66('0x33')]()['then'](function(){_0x168c31[_0x7d66('0x2b')](0xcc)[_0x7d66('0x28')]();});}};}function handleEntityNotFound(_0x2ae8a3,_0x1440f6){return function(_0x10800e){if(!_0x10800e){_0x2ae8a3[_0x7d66('0x27')](0x194);}return _0x10800e;};}function handleError(_0x34a558,_0xc292fc){_0xc292fc=_0xc292fc||0x1f4;return function(_0x2947da){logger['error'](_0x2947da[_0x7d66('0x34')]);if(_0x2947da[_0x7d66('0x35')]){delete _0x2947da[_0x7d66('0x35')];}_0x34a558[_0x7d66('0x2b')](_0xc292fc)[_0x7d66('0x36')](_0x2947da);};}exports[_0x7d66('0x37')]=function(_0x184178,_0x2b3a92){var _0x176267={},_0x5cf805={},_0x1936e2={'count':0x0,'rows':[]};var _0x38fba2=_[_0x7d66('0x38')](db[_0x7d66('0x39')]['rawAttributes'],function(_0x3d0389){return{'name':_0x3d0389[_0x7d66('0x3a')],'type':_0x3d0389['type'][_0x7d66('0x3b')]};});_0x5cf805['model']=_[_0x7d66('0x38')](_0x38fba2,_0x7d66('0x35'));_0x5cf805[_0x7d66('0x3c')]=_[_0x7d66('0x3d')](_0x184178[_0x7d66('0x3c')]);_0x5cf805[_0x7d66('0x3e')]=_['intersection'](_0x5cf805[_0x7d66('0x3f')],_0x5cf805[_0x7d66('0x3c')]);_0x176267[_0x7d66('0x40')]=_['intersection'](_0x5cf805[_0x7d66('0x3f')],qs[_0x7d66('0x41')](_0x184178[_0x7d66('0x3c')]['fields']));_0x176267[_0x7d66('0x40')]=_0x176267[_0x7d66('0x40')]['length']?_0x176267[_0x7d66('0x40')]:_0x5cf805['model'];if(!_0x184178['query'][_0x7d66('0x42')]('nolimit')){_0x176267['limit']=qs[_0x7d66('0x2a')](_0x184178[_0x7d66('0x3c')]['limit']);_0x176267[_0x7d66('0x43')]=qs['offset'](_0x184178[_0x7d66('0x3c')][_0x7d66('0x43')]);}_0x176267[_0x7d66('0x44')]=qs[_0x7d66('0x45')](_0x184178[_0x7d66('0x3c')][_0x7d66('0x45')]);_0x176267['where']=qs[_0x7d66('0x3e')](_[_0x7d66('0x46')](_0x184178[_0x7d66('0x3c')],_0x5cf805[_0x7d66('0x3e')]));if(_0x184178[_0x7d66('0x3c')][_0x7d66('0x47')]){_0x176267[_0x7d66('0x48')]=_[_0x7d66('0x49')](_0x176267[_0x7d66('0x48')],{'$or':_[_0x7d66('0x38')](_0x38fba2,function(_0x5415bb){if(_0x5415bb[_0x7d66('0x4a')]!==_0x7d66('0x4b')){var _0xe8d755={};_0xe8d755[_0x5415bb['name']]={'$like':'%'+_0x184178[_0x7d66('0x3c')][_0x7d66('0x47')]+'%'};return _0xe8d755;}})});}_0x176267=_[_0x7d66('0x49')]({},_0x176267,_0x184178[_0x7d66('0x4c')]);var _0x67f0fb={'where':_0x176267[_0x7d66('0x48')]};return db['Dynamics365Configuration'][_0x7d66('0x29')](_0x67f0fb)[_0x7d66('0x1c')](function(_0x234866){_0x1936e2[_0x7d66('0x29')]=_0x234866;if(_0x184178[_0x7d66('0x3c')][_0x7d66('0x4d')]){_0x176267[_0x7d66('0x4e')]=[{'all':!![]}];}return db[_0x7d66('0x39')][_0x7d66('0x4f')](_0x176267);})['then'](function(_0x62abb7){_0x1936e2['rows']=_0x62abb7;return _0x1936e2;})[_0x7d66('0x1c')](respondWithFilteredResult(_0x2b3a92,_0x176267))[_0x7d66('0x26')](handleError(_0x2b3a92,null));};exports[_0x7d66('0x50')]=function(_0x1014a2,_0x53f9e7){var _0x1dbb70={'raw':![],'where':{'id':_0x1014a2[_0x7d66('0x51')]['id']}},_0x37986c={};_0x37986c[_0x7d66('0x3f')]=_[_0x7d66('0x3d')](db[_0x7d66('0x39')][_0x7d66('0x52')]);_0x37986c[_0x7d66('0x3c')]=_['keys'](_0x1014a2[_0x7d66('0x3c')]);_0x37986c[_0x7d66('0x3e')]=_[_0x7d66('0x53')](_0x37986c[_0x7d66('0x3f')],_0x37986c[_0x7d66('0x3c')]);_0x1dbb70['attributes']=_[_0x7d66('0x53')](_0x37986c[_0x7d66('0x3f')],qs['fields'](_0x1014a2['query'][_0x7d66('0x41')]));_0x1dbb70[_0x7d66('0x40')]=_0x1dbb70[_0x7d66('0x40')][_0x7d66('0x54')]?_0x1dbb70[_0x7d66('0x40')]:_0x37986c['model'];if(_0x1014a2[_0x7d66('0x3c')]['includeAll']){_0x1dbb70[_0x7d66('0x4e')]=[{'all':!![]}];}_0x1dbb70=_[_0x7d66('0x49')]({},_0x1dbb70,_0x1014a2['options']);return db[_0x7d66('0x39')][_0x7d66('0x55')](_0x1dbb70)[_0x7d66('0x1c')](handleEntityNotFound(_0x53f9e7,null))['then'](respondWithResult(_0x53f9e7,null))[_0x7d66('0x26')](handleError(_0x53f9e7,null));};exports[_0x7d66('0x56')]=function(_0x43223d,_0x1cc38a){return db[_0x7d66('0x39')][_0x7d66('0x56')](_0x43223d[_0x7d66('0x57')],{})[_0x7d66('0x1c')](respondWithResult(_0x1cc38a,0xc9))[_0x7d66('0x26')](handleError(_0x1cc38a,null));};exports[_0x7d66('0x32')]=function(_0x20f1e6,_0x1b860b){if(_0x20f1e6[_0x7d66('0x57')]['id']){delete _0x20f1e6['body']['id'];}return db[_0x7d66('0x39')][_0x7d66('0x55')]({'where':{'id':_0x20f1e6[_0x7d66('0x51')]['id']}})[_0x7d66('0x1c')](handleEntityNotFound(_0x1b860b,null))[_0x7d66('0x1c')](saveUpdates(_0x20f1e6[_0x7d66('0x57')],null))[_0x7d66('0x1c')](respondWithResult(_0x1b860b,null))['catch'](handleError(_0x1b860b,null));};exports[_0x7d66('0x33')]=function(_0xdf7635,_0x51c38f){return db[_0x7d66('0x39')][_0x7d66('0x55')]({'where':{'id':_0xdf7635[_0x7d66('0x51')]['id']}})[_0x7d66('0x1c')](handleEntityNotFound(_0x51c38f,null))['then'](removeEntity(_0x51c38f,null))[_0x7d66('0x26')](handleError(_0x51c38f,null));};exports['getFields']=function(_0x251e54,_0x55c3bc,_0x8e970){var _0x45e221={};var _0x3dad04={};var _0x1e5dbd;var _0x51dae3;return db['Dynamics365Configuration'][_0x7d66('0x58')]({'where':{'id':_0x251e54[_0x7d66('0x51')]['id']}})['then'](handleEntityNotFound(_0x55c3bc,null))[_0x7d66('0x1c')](function(_0x424d8f){if(_0x424d8f){_0x1e5dbd=_0x424d8f;_0x3dad04[_0x7d66('0x3f')]=_['keys'](db[_0x7d66('0x59')][_0x7d66('0x52')]);_0x3dad04[_0x7d66('0x3c')]=_['keys'](_0x251e54[_0x7d66('0x3c')]);_0x3dad04['filters']=_[_0x7d66('0x53')](_0x3dad04[_0x7d66('0x3f')],_0x3dad04[_0x7d66('0x3c')]);_0x45e221['attributes']=_[_0x7d66('0x53')](_0x3dad04['model'],qs['fields'](_0x251e54[_0x7d66('0x3c')]['fields']));_0x45e221[_0x7d66('0x40')]=_0x45e221[_0x7d66('0x40')][_0x7d66('0x54')]?_0x45e221[_0x7d66('0x40')]:_0x3dad04[_0x7d66('0x3f')];_0x45e221[_0x7d66('0x44')]=qs[_0x7d66('0x45')](_0x251e54[_0x7d66('0x3c')][_0x7d66('0x45')]);_0x45e221[_0x7d66('0x48')]=qs[_0x7d66('0x3e')](_[_0x7d66('0x46')](_0x251e54['query'],_0x3dad04[_0x7d66('0x3e')]));if(_0x251e54[_0x7d66('0x3c')]['filter']){_0x45e221['where']=_[_0x7d66('0x49')](_0x45e221[_0x7d66('0x48')],{'$or':_[_0x7d66('0x38')](_0x45e221[_0x7d66('0x40')],function(_0x380f3d){var _0x10a32b={};_0x10a32b[_0x380f3d]={'$like':'%'+_0x251e54[_0x7d66('0x3c')]['filter']+'%'};return _0x10a32b;})});}_0x45e221=_[_0x7d66('0x49')]({},_0x45e221,_0x251e54[_0x7d66('0x4c')]);return _0x1e5dbd[_0x7d66('0x5a')](_0x45e221);}})[_0x7d66('0x1c')](function(_0x3971bb){if(_0x3971bb){_0x51dae3=_0x3971bb[_0x7d66('0x54')];if(!_0x251e54[_0x7d66('0x3c')][_0x7d66('0x42')](_0x7d66('0x5b'))){_0x45e221[_0x7d66('0x2a')]=qs[_0x7d66('0x2a')](_0x251e54[_0x7d66('0x3c')][_0x7d66('0x2a')]);_0x45e221['offset']=qs[_0x7d66('0x43')](_0x251e54[_0x7d66('0x3c')][_0x7d66('0x43')]);}return _0x1e5dbd[_0x7d66('0x5a')](_0x45e221);}})[_0x7d66('0x1c')](function(_0x5f4b48){if(_0x5f4b48){return _0x5f4b48?{'count':_0x51dae3,'rows':_0x5f4b48}:null;}})[_0x7d66('0x1c')](respondWithResult(_0x55c3bc,null))['catch'](handleError(_0x55c3bc,null));};exports[_0x7d66('0x5c')]=function(_0xdea11b,_0x3efed3,_0xacb7b2){var _0x1f51f5={};var _0x2991ac={};var _0x5daf6d;var _0x24e471;return db[_0x7d66('0x39')]['findOne']({'where':{'id':_0xdea11b[_0x7d66('0x51')]['id']}})[_0x7d66('0x1c')](handleEntityNotFound(_0x3efed3,null))[_0x7d66('0x1c')](function(_0x4b0d70){if(_0x4b0d70){_0x5daf6d=_0x4b0d70;_0x2991ac[_0x7d66('0x3f')]=_[_0x7d66('0x3d')](db[_0x7d66('0x59')][_0x7d66('0x52')]);_0x2991ac[_0x7d66('0x3c')]=_[_0x7d66('0x3d')](_0xdea11b['query']);_0x2991ac[_0x7d66('0x3e')]=_[_0x7d66('0x53')](_0x2991ac[_0x7d66('0x3f')],_0x2991ac[_0x7d66('0x3c')]);_0x1f51f5[_0x7d66('0x40')]=_['intersection'](_0x2991ac[_0x7d66('0x3f')],qs[_0x7d66('0x41')](_0xdea11b[_0x7d66('0x3c')][_0x7d66('0x41')]));_0x1f51f5['attributes']=_0x1f51f5[_0x7d66('0x40')]['length']?_0x1f51f5[_0x7d66('0x40')]:_0x2991ac['model'];_0x1f51f5[_0x7d66('0x44')]=qs[_0x7d66('0x45')](_0xdea11b[_0x7d66('0x3c')][_0x7d66('0x45')]);_0x1f51f5[_0x7d66('0x48')]=qs[_0x7d66('0x3e')](_[_0x7d66('0x46')](_0xdea11b[_0x7d66('0x3c')],_0x2991ac[_0x7d66('0x3e')]));if(_0xdea11b['query'][_0x7d66('0x47')]){_0x1f51f5[_0x7d66('0x48')]=_[_0x7d66('0x49')](_0x1f51f5['where'],{'$or':_[_0x7d66('0x38')](_0x1f51f5[_0x7d66('0x40')],function(_0x51236e){var _0x151a84={};_0x151a84[_0x51236e]={'$like':'%'+_0xdea11b['query'][_0x7d66('0x47')]+'%'};return _0x151a84;})});}_0x1f51f5=_[_0x7d66('0x49')]({},_0x1f51f5,_0xdea11b[_0x7d66('0x4c')]);return _0x5daf6d[_0x7d66('0x5c')](_0x1f51f5);}})['then'](function(_0x4107aa){if(_0x4107aa){_0x24e471=_0x4107aa['length'];if(!_0xdea11b[_0x7d66('0x3c')][_0x7d66('0x42')](_0x7d66('0x5b'))){_0x1f51f5[_0x7d66('0x2a')]=qs['limit'](_0xdea11b[_0x7d66('0x3c')][_0x7d66('0x2a')]);_0x1f51f5[_0x7d66('0x43')]=qs[_0x7d66('0x43')](_0xdea11b['query'][_0x7d66('0x43')]);}return _0x5daf6d[_0x7d66('0x5c')](_0x1f51f5);}})[_0x7d66('0x1c')](function(_0x1fe9a8){if(_0x1fe9a8){return _0x1fe9a8?{'count':_0x24e471,'rows':_0x1fe9a8}:null;}})[_0x7d66('0x1c')](respondWithResult(_0x3efed3,null))[_0x7d66('0x26')](handleError(_0x3efed3,null));};exports[_0x7d66('0x5d')]=function(_0x32db76,_0x2220d6,_0xa60c79){var _0x5e346d={};var _0x39aae0={};var _0x3014b9;var _0x20059a;return db[_0x7d66('0x39')][_0x7d66('0x58')]({'where':{'id':_0x32db76['params']['id']}})[_0x7d66('0x1c')](handleEntityNotFound(_0x2220d6,null))['then'](function(_0x58bfe2){if(_0x58bfe2){_0x3014b9=_0x58bfe2;_0x39aae0[_0x7d66('0x3f')]=_[_0x7d66('0x3d')](db['Dynamics365Field']['rawAttributes']);_0x39aae0[_0x7d66('0x3c')]=_[_0x7d66('0x3d')](_0x32db76[_0x7d66('0x3c')]);_0x39aae0[_0x7d66('0x3e')]=_[_0x7d66('0x53')](_0x39aae0[_0x7d66('0x3f')],_0x39aae0[_0x7d66('0x3c')]);_0x5e346d[_0x7d66('0x40')]=_[_0x7d66('0x53')](_0x39aae0[_0x7d66('0x3f')],qs['fields'](_0x32db76[_0x7d66('0x3c')]['fields']));_0x5e346d[_0x7d66('0x40')]=_0x5e346d[_0x7d66('0x40')]['length']?_0x5e346d[_0x7d66('0x40')]:_0x39aae0['model'];_0x5e346d['order']=qs['sort'](_0x32db76[_0x7d66('0x3c')]['sort']);_0x5e346d[_0x7d66('0x48')]=qs['filters'](_['pick'](_0x32db76['query'],_0x39aae0[_0x7d66('0x3e')]));if(_0x32db76[_0x7d66('0x3c')]['filter']){_0x5e346d[_0x7d66('0x48')]=_[_0x7d66('0x49')](_0x5e346d[_0x7d66('0x48')],{'$or':_['map'](_0x5e346d['attributes'],function(_0xb6b9c){var _0x4ac8e9={};_0x4ac8e9[_0xb6b9c]={'$like':'%'+_0x32db76[_0x7d66('0x3c')][_0x7d66('0x47')]+'%'};return _0x4ac8e9;})});}_0x5e346d=_[_0x7d66('0x49')]({},_0x5e346d,_0x32db76['options']);return _0x3014b9['getDescriptions'](_0x5e346d);}})[_0x7d66('0x1c')](function(_0x41c564){if(_0x41c564){_0x20059a=_0x41c564[_0x7d66('0x54')];if(!_0x32db76[_0x7d66('0x3c')][_0x7d66('0x42')](_0x7d66('0x5b'))){_0x5e346d[_0x7d66('0x2a')]=qs['limit'](_0x32db76[_0x7d66('0x3c')][_0x7d66('0x2a')]);_0x5e346d['offset']=qs['offset'](_0x32db76[_0x7d66('0x3c')][_0x7d66('0x43')]);}return _0x3014b9['getDescriptions'](_0x5e346d);}})[_0x7d66('0x1c')](function(_0x590ef1){if(_0x590ef1){return _0x590ef1?{'count':_0x20059a,'rows':_0x590ef1}:null;}})[_0x7d66('0x1c')](respondWithResult(_0x2220d6,null))[_0x7d66('0x26')](handleError(_0x2220d6,null));}; \ No newline at end of file +var _0x487a=['where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','length','find','create','body','params','findOne','Dynamics365Field','hasOwnProperty','getFields','getSubjects','getDescriptions','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort'];(function(_0x5c4a24,_0x45b643){var _0x1d39bc=function(_0x2a0434){while(--_0x2a0434){_0x5c4a24['push'](_0x5c4a24['shift']());}};_0x1d39bc(++_0x45b643);}(_0x487a,0x189));var _0xa487=function(_0x359bbe,_0x5b7fcc){_0x359bbe=_0x359bbe-0x0;var _0x1b3353=_0x487a[_0x359bbe];return _0x1b3353;};'use strict';var pdf=require(_0xa487('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa487('0x1'));var jsonpatch=require(_0xa487('0x2'));var rp=require(_0xa487('0x3'));var moment=require(_0xa487('0x4'));var BPromise=require(_0xa487('0x5'));var Mustache=require(_0xa487('0x6'));var util=require('util');var path=require(_0xa487('0x7'));var sox=require(_0xa487('0x8'));var csv=require(_0xa487('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa487('0xa'));var crypto=require('crypto');var jsforce=require(_0xa487('0xb'));var deskjs=require(_0xa487('0xc'));var toCsv=require(_0xa487('0x9'));var querystring=require(_0xa487('0xd'));var Papa=require(_0xa487('0xe'));var Redis=require('ioredis');var authService=require(_0xa487('0xf'));var qs=require(_0xa487('0x10'));var as=require(_0xa487('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa487('0x12'));var utils=require(_0xa487('0x13'));var config=require(_0xa487('0x14'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xa487('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x1dbbc0,_0x4412c5,_0x3da9ff){if(_0x3da9ff){var _0x1d65f5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d65f5[_0xa487('0x16')](_0x4412c5)){return _0x1dbbc0;}else{throw new db[(_0xa487('0x17'))][(_0xa487('0x18'))](_0xa487('0x19'));}}else{return _0x1dbbc0;}}function respondWithRpcPromise(_0x139ca9,_0x3e4ba4,_0x2230fb,_0xce076e){return new BPromise(function(_0x762334,_0x12b701){var _0x49cabd=_0xce076e||client;return _0x49cabd[_0xa487('0x1a')](_0x139ca9,_0x2230fb)[_0xa487('0x1b')](function(_0x21e104){logger['info'](_0xa487('0x1c'),_0x3e4ba4,'request\x20sent');logger[_0xa487('0x1d')](_0xa487('0x1e'),_0x3e4ba4,_0xa487('0x1f'),JSON[_0xa487('0x20')](_0x21e104));if(_0x21e104[_0xa487('0x21')]){if(_0x21e104['error'][_0xa487('0x22')]===0x1f4){logger[_0xa487('0x21')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3e4ba4,_0x21e104['error'][_0xa487('0x23')]);return _0x12b701(_0x21e104[_0xa487('0x21')][_0xa487('0x23')]);}logger[_0xa487('0x21')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3e4ba4,_0x21e104['error'][_0xa487('0x23')]);return _0x762334(_0x21e104[_0xa487('0x21')][_0xa487('0x23')]);}else{logger[_0xa487('0x24')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3e4ba4,_0xa487('0x1f'));_0x762334(_0x21e104[_0xa487('0x25')]['message']);}})[_0xa487('0x26')](function(_0x28141a){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x3e4ba4,_0x28141a);_0x12b701(_0x28141a);});});}function respondWithStatusCode(_0x551bd3,_0x2882dc){_0x2882dc=_0x2882dc||0xcc;return function(_0x4eafe8){if(_0x4eafe8){return _0x551bd3['sendStatus'](_0x2882dc);}return _0x551bd3[_0xa487('0x27')](_0x2882dc)[_0xa487('0x28')]();};}function respondWithResult(_0x2e050f,_0x2743e5){_0x2743e5=_0x2743e5||0xc8;return function(_0x3c7a4e){if(_0x3c7a4e){return _0x2e050f[_0xa487('0x27')](_0x2743e5)[_0xa487('0x29')](_0x3c7a4e);}};}function respondWithFilteredResult(_0x4ff5fd,_0x4e3177){return function(_0x2a173d){if(_0x2a173d){var _0x3c440a=_0x2a173d[_0xa487('0x2a')],_0x4008bb=_0x4e3177[_0xa487('0x2b')],_0x59651f=_0x4e3177[_0xa487('0x2b')]+_0x4e3177['limit'],_0x211206;if(_0x59651f>=_0x3c440a){_0x59651f=_0x3c440a;_0x211206=0xc8;}else{_0x211206=0xce;}_0x4ff5fd[_0xa487('0x27')](_0x211206);return _0x4ff5fd[_0xa487('0x2c')](_0xa487('0x2d'),_0x4008bb+'-'+_0x59651f+'/'+_0x3c440a)['json'](_0x2a173d);}return null;};}function patchUpdates(_0xfa9bd0){return function(_0x60f76b){try{jsonpatch[_0xa487('0x2e')](_0x60f76b,_0xfa9bd0,!![]);}catch(_0x3524e1){return BPromise[_0xa487('0x2f')](_0x3524e1);}return _0x60f76b[_0xa487('0x30')]();};}function saveUpdates(_0x5eb898,_0xc5b9f1){return function(_0x233969){if(_0x233969){return _0x233969[_0xa487('0x31')](_0x5eb898)['then'](function(_0x20b19d){return _0x20b19d;});}return null;};}function removeEntity(_0x41b31d,_0x5c23fc){return function(_0x2894cd){if(_0x2894cd){return _0x2894cd[_0xa487('0x32')]()['then'](function(){_0x41b31d[_0xa487('0x27')](0xcc)[_0xa487('0x28')]();});}};}function handleEntityNotFound(_0x7b24e6,_0x16c940){return function(_0x42c468){if(!_0x42c468){_0x7b24e6[_0xa487('0x33')](0x194);}return _0x42c468;};}function handleError(_0x966ed2,_0x1ab6d5){_0x1ab6d5=_0x1ab6d5||0x1f4;return function(_0x569e22){logger[_0xa487('0x21')](_0x569e22['stack']);if(_0x569e22['name']){delete _0x569e22[_0xa487('0x34')];}_0x966ed2[_0xa487('0x27')](_0x1ab6d5)[_0xa487('0x35')](_0x569e22);};}exports[_0xa487('0x36')]=function(_0x2d961c,_0x398210){var _0x119b2e={},_0x13629c={},_0x20b815={'count':0x0,'rows':[]};var _0x5e1217=_[_0xa487('0x37')](db[_0xa487('0x38')][_0xa487('0x39')],function(_0x15b719){return{'name':_0x15b719[_0xa487('0x3a')],'type':_0x15b719[_0xa487('0x3b')][_0xa487('0x3c')]};});_0x13629c[_0xa487('0x3d')]=_[_0xa487('0x37')](_0x5e1217,'name');_0x13629c[_0xa487('0x3e')]=_[_0xa487('0x3f')](_0x2d961c[_0xa487('0x3e')]);_0x13629c[_0xa487('0x40')]=_[_0xa487('0x41')](_0x13629c[_0xa487('0x3d')],_0x13629c[_0xa487('0x3e')]);_0x119b2e[_0xa487('0x42')]=_[_0xa487('0x41')](_0x13629c['model'],qs[_0xa487('0x43')](_0x2d961c['query'][_0xa487('0x43')]));_0x119b2e[_0xa487('0x42')]=_0x119b2e[_0xa487('0x42')]['length']?_0x119b2e[_0xa487('0x42')]:_0x13629c['model'];if(!_0x2d961c[_0xa487('0x3e')]['hasOwnProperty'](_0xa487('0x44'))){_0x119b2e[_0xa487('0x45')]=qs[_0xa487('0x45')](_0x2d961c[_0xa487('0x3e')][_0xa487('0x45')]);_0x119b2e[_0xa487('0x2b')]=qs[_0xa487('0x2b')](_0x2d961c['query'][_0xa487('0x2b')]);}_0x119b2e[_0xa487('0x46')]=qs[_0xa487('0x47')](_0x2d961c[_0xa487('0x3e')][_0xa487('0x47')]);_0x119b2e[_0xa487('0x48')]=qs['filters'](_[_0xa487('0x49')](_0x2d961c['query'],_0x13629c['filters']));if(_0x2d961c['query'][_0xa487('0x4a')]){_0x119b2e['where']=_['merge'](_0x119b2e[_0xa487('0x48')],{'$or':_[_0xa487('0x37')](_0x5e1217,function(_0x429ef9){if(_0x429ef9[_0xa487('0x3b')]!==_0xa487('0x4b')){var _0x329853={};_0x329853[_0x429ef9[_0xa487('0x34')]]={'$like':'%'+_0x2d961c[_0xa487('0x3e')][_0xa487('0x4a')]+'%'};return _0x329853;}})});}_0x119b2e=_[_0xa487('0x4c')]({},_0x119b2e,_0x2d961c[_0xa487('0x4d')]);var _0x29524d={'where':_0x119b2e[_0xa487('0x48')]};return db[_0xa487('0x38')][_0xa487('0x2a')](_0x29524d)['then'](function(_0x57c6c4){_0x20b815[_0xa487('0x2a')]=_0x57c6c4;if(_0x2d961c[_0xa487('0x3e')][_0xa487('0x4e')]){_0x119b2e[_0xa487('0x4f')]=[{'all':!![]}];}return db[_0xa487('0x38')][_0xa487('0x50')](_0x119b2e);})[_0xa487('0x1b')](function(_0x4ab357){_0x20b815[_0xa487('0x51')]=_0x4ab357;return _0x20b815;})[_0xa487('0x1b')](respondWithFilteredResult(_0x398210,_0x119b2e))[_0xa487('0x26')](handleError(_0x398210,null));};exports['show']=function(_0x4fff72,_0x170a8c){var _0x50ca82={'raw':![],'where':{'id':_0x4fff72['params']['id']}},_0x196227={};_0x196227[_0xa487('0x3d')]=_[_0xa487('0x3f')](db['Dynamics365Configuration'][_0xa487('0x39')]);_0x196227[_0xa487('0x3e')]=_[_0xa487('0x3f')](_0x4fff72[_0xa487('0x3e')]);_0x196227['filters']=_[_0xa487('0x41')](_0x196227[_0xa487('0x3d')],_0x196227[_0xa487('0x3e')]);_0x50ca82[_0xa487('0x42')]=_['intersection'](_0x196227[_0xa487('0x3d')],qs[_0xa487('0x43')](_0x4fff72[_0xa487('0x3e')]['fields']));_0x50ca82[_0xa487('0x42')]=_0x50ca82[_0xa487('0x42')][_0xa487('0x52')]?_0x50ca82[_0xa487('0x42')]:_0x196227[_0xa487('0x3d')];if(_0x4fff72[_0xa487('0x3e')][_0xa487('0x4e')]){_0x50ca82['include']=[{'all':!![]}];}_0x50ca82=_[_0xa487('0x4c')]({},_0x50ca82,_0x4fff72['options']);return db[_0xa487('0x38')][_0xa487('0x53')](_0x50ca82)[_0xa487('0x1b')](handleEntityNotFound(_0x170a8c,null))['then'](respondWithResult(_0x170a8c,null))[_0xa487('0x26')](handleError(_0x170a8c,null));};exports[_0xa487('0x54')]=function(_0x10aa85,_0x17efe1){return db[_0xa487('0x38')]['create'](_0x10aa85[_0xa487('0x55')],{})[_0xa487('0x1b')](respondWithResult(_0x17efe1,0xc9))[_0xa487('0x26')](handleError(_0x17efe1,null));};exports[_0xa487('0x31')]=function(_0x24ccc9,_0x1722ac){if(_0x24ccc9[_0xa487('0x55')]['id']){delete _0x24ccc9[_0xa487('0x55')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x24ccc9[_0xa487('0x56')]['id']}})[_0xa487('0x1b')](handleEntityNotFound(_0x1722ac,null))[_0xa487('0x1b')](saveUpdates(_0x24ccc9[_0xa487('0x55')],null))['then'](respondWithResult(_0x1722ac,null))[_0xa487('0x26')](handleError(_0x1722ac,null));};exports[_0xa487('0x32')]=function(_0x78b425,_0x24911c){return db['Dynamics365Configuration']['find']({'where':{'id':_0x78b425[_0xa487('0x56')]['id']}})[_0xa487('0x1b')](handleEntityNotFound(_0x24911c,null))[_0xa487('0x1b')](removeEntity(_0x24911c,null))[_0xa487('0x26')](handleError(_0x24911c,null));};exports['getFields']=function(_0x49e4cd,_0x4c608d,_0x40a5fb){var _0xda6751={};var _0x100683={};var _0x20c18b;var _0x243e17;return db[_0xa487('0x38')][_0xa487('0x57')]({'where':{'id':_0x49e4cd[_0xa487('0x56')]['id']}})[_0xa487('0x1b')](handleEntityNotFound(_0x4c608d,null))[_0xa487('0x1b')](function(_0x5cb1f8){if(_0x5cb1f8){_0x20c18b=_0x5cb1f8;_0x100683[_0xa487('0x3d')]=_[_0xa487('0x3f')](db[_0xa487('0x58')][_0xa487('0x39')]);_0x100683[_0xa487('0x3e')]=_['keys'](_0x49e4cd[_0xa487('0x3e')]);_0x100683[_0xa487('0x40')]=_[_0xa487('0x41')](_0x100683[_0xa487('0x3d')],_0x100683[_0xa487('0x3e')]);_0xda6751[_0xa487('0x42')]=_[_0xa487('0x41')](_0x100683[_0xa487('0x3d')],qs[_0xa487('0x43')](_0x49e4cd['query'][_0xa487('0x43')]));_0xda6751['attributes']=_0xda6751[_0xa487('0x42')][_0xa487('0x52')]?_0xda6751[_0xa487('0x42')]:_0x100683['model'];_0xda6751[_0xa487('0x46')]=qs['sort'](_0x49e4cd[_0xa487('0x3e')][_0xa487('0x47')]);_0xda6751[_0xa487('0x48')]=qs[_0xa487('0x40')](_[_0xa487('0x49')](_0x49e4cd[_0xa487('0x3e')],_0x100683[_0xa487('0x40')]));if(_0x49e4cd[_0xa487('0x3e')][_0xa487('0x4a')]){_0xda6751[_0xa487('0x48')]=_[_0xa487('0x4c')](_0xda6751[_0xa487('0x48')],{'$or':_[_0xa487('0x37')](_0xda6751[_0xa487('0x42')],function(_0x36ddf0){var _0x4933dc={};_0x4933dc[_0x36ddf0]={'$like':'%'+_0x49e4cd[_0xa487('0x3e')][_0xa487('0x4a')]+'%'};return _0x4933dc;})});}_0xda6751=_[_0xa487('0x4c')]({},_0xda6751,_0x49e4cd[_0xa487('0x4d')]);return _0x20c18b['getFields'](_0xda6751);}})[_0xa487('0x1b')](function(_0x20cbb2){if(_0x20cbb2){_0x243e17=_0x20cbb2[_0xa487('0x52')];if(!_0x49e4cd['query'][_0xa487('0x59')](_0xa487('0x44'))){_0xda6751[_0xa487('0x45')]=qs[_0xa487('0x45')](_0x49e4cd[_0xa487('0x3e')]['limit']);_0xda6751[_0xa487('0x2b')]=qs['offset'](_0x49e4cd[_0xa487('0x3e')][_0xa487('0x2b')]);}return _0x20c18b[_0xa487('0x5a')](_0xda6751);}})['then'](function(_0x2dbe10){if(_0x2dbe10){return _0x2dbe10?{'count':_0x243e17,'rows':_0x2dbe10}:null;}})['then'](respondWithResult(_0x4c608d,null))['catch'](handleError(_0x4c608d,null));};exports['getSubjects']=function(_0x333621,_0x3a425c,_0x441d59){var _0x17ca22={};var _0x3d8b16={};var _0x2c803c;var _0x51679d;return db[_0xa487('0x38')][_0xa487('0x57')]({'where':{'id':_0x333621[_0xa487('0x56')]['id']}})[_0xa487('0x1b')](handleEntityNotFound(_0x3a425c,null))[_0xa487('0x1b')](function(_0x3b8324){if(_0x3b8324){_0x2c803c=_0x3b8324;_0x3d8b16['model']=_[_0xa487('0x3f')](db[_0xa487('0x58')]['rawAttributes']);_0x3d8b16[_0xa487('0x3e')]=_[_0xa487('0x3f')](_0x333621['query']);_0x3d8b16[_0xa487('0x40')]=_['intersection'](_0x3d8b16[_0xa487('0x3d')],_0x3d8b16['query']);_0x17ca22[_0xa487('0x42')]=_['intersection'](_0x3d8b16[_0xa487('0x3d')],qs[_0xa487('0x43')](_0x333621[_0xa487('0x3e')][_0xa487('0x43')]));_0x17ca22['attributes']=_0x17ca22[_0xa487('0x42')]['length']?_0x17ca22[_0xa487('0x42')]:_0x3d8b16[_0xa487('0x3d')];_0x17ca22[_0xa487('0x46')]=qs['sort'](_0x333621[_0xa487('0x3e')][_0xa487('0x47')]);_0x17ca22['where']=qs['filters'](_['pick'](_0x333621[_0xa487('0x3e')],_0x3d8b16['filters']));if(_0x333621[_0xa487('0x3e')][_0xa487('0x4a')]){_0x17ca22[_0xa487('0x48')]=_[_0xa487('0x4c')](_0x17ca22[_0xa487('0x48')],{'$or':_[_0xa487('0x37')](_0x17ca22[_0xa487('0x42')],function(_0x519b35){var _0xd40582={};_0xd40582[_0x519b35]={'$like':'%'+_0x333621['query']['filter']+'%'};return _0xd40582;})});}_0x17ca22=_[_0xa487('0x4c')]({},_0x17ca22,_0x333621['options']);return _0x2c803c[_0xa487('0x5b')](_0x17ca22);}})[_0xa487('0x1b')](function(_0x18f052){if(_0x18f052){_0x51679d=_0x18f052[_0xa487('0x52')];if(!_0x333621[_0xa487('0x3e')]['hasOwnProperty'](_0xa487('0x44'))){_0x17ca22[_0xa487('0x45')]=qs[_0xa487('0x45')](_0x333621[_0xa487('0x3e')][_0xa487('0x45')]);_0x17ca22['offset']=qs[_0xa487('0x2b')](_0x333621['query']['offset']);}return _0x2c803c['getSubjects'](_0x17ca22);}})[_0xa487('0x1b')](function(_0x322cd7){if(_0x322cd7){return _0x322cd7?{'count':_0x51679d,'rows':_0x322cd7}:null;}})[_0xa487('0x1b')](respondWithResult(_0x3a425c,null))[_0xa487('0x26')](handleError(_0x3a425c,null));};exports[_0xa487('0x5c')]=function(_0x139cb8,_0x6f76ad,_0x56785c){var _0x44ad13={};var _0x280149={};var _0x4f6227;var _0x4dd0f2;return db[_0xa487('0x38')]['findOne']({'where':{'id':_0x139cb8[_0xa487('0x56')]['id']}})[_0xa487('0x1b')](handleEntityNotFound(_0x6f76ad,null))[_0xa487('0x1b')](function(_0x3ddc0d){if(_0x3ddc0d){_0x4f6227=_0x3ddc0d;_0x280149[_0xa487('0x3d')]=_[_0xa487('0x3f')](db['Dynamics365Field'][_0xa487('0x39')]);_0x280149[_0xa487('0x3e')]=_[_0xa487('0x3f')](_0x139cb8['query']);_0x280149['filters']=_['intersection'](_0x280149[_0xa487('0x3d')],_0x280149[_0xa487('0x3e')]);_0x44ad13[_0xa487('0x42')]=_['intersection'](_0x280149[_0xa487('0x3d')],qs[_0xa487('0x43')](_0x139cb8[_0xa487('0x3e')][_0xa487('0x43')]));_0x44ad13[_0xa487('0x42')]=_0x44ad13[_0xa487('0x42')]['length']?_0x44ad13[_0xa487('0x42')]:_0x280149[_0xa487('0x3d')];_0x44ad13['order']=qs[_0xa487('0x47')](_0x139cb8[_0xa487('0x3e')][_0xa487('0x47')]);_0x44ad13[_0xa487('0x48')]=qs['filters'](_[_0xa487('0x49')](_0x139cb8[_0xa487('0x3e')],_0x280149[_0xa487('0x40')]));if(_0x139cb8[_0xa487('0x3e')][_0xa487('0x4a')]){_0x44ad13[_0xa487('0x48')]=_[_0xa487('0x4c')](_0x44ad13[_0xa487('0x48')],{'$or':_[_0xa487('0x37')](_0x44ad13[_0xa487('0x42')],function(_0x11c6d5){var _0x810ca4={};_0x810ca4[_0x11c6d5]={'$like':'%'+_0x139cb8[_0xa487('0x3e')]['filter']+'%'};return _0x810ca4;})});}_0x44ad13=_[_0xa487('0x4c')]({},_0x44ad13,_0x139cb8[_0xa487('0x4d')]);return _0x4f6227[_0xa487('0x5c')](_0x44ad13);}})['then'](function(_0x5ef46a){if(_0x5ef46a){_0x4dd0f2=_0x5ef46a[_0xa487('0x52')];if(!_0x139cb8[_0xa487('0x3e')]['hasOwnProperty'](_0xa487('0x44'))){_0x44ad13[_0xa487('0x45')]=qs[_0xa487('0x45')](_0x139cb8[_0xa487('0x3e')][_0xa487('0x45')]);_0x44ad13[_0xa487('0x2b')]=qs[_0xa487('0x2b')](_0x139cb8[_0xa487('0x3e')][_0xa487('0x2b')]);}return _0x4f6227[_0xa487('0x5c')](_0x44ad13);}})[_0xa487('0x1b')](function(_0x3d4175){if(_0x3d4175){return _0x3d4175?{'count':_0x4dd0f2,'rows':_0x3d4175}:null;}})['then'](respondWithResult(_0x6f76ad,null))['catch'](handleError(_0x6f76ad,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index c1937f4..c780757 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 _0xd697=['request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','bluebird'];(function(_0x460368,_0x36d824){var _0xe5b1f8=function(_0x525400){while(--_0x525400){_0x460368['push'](_0x460368['shift']());}};_0xe5b1f8(++_0x36d824);}(_0xd697,0x11b));var _0x7d69=function(_0x3b3e01,_0x244694){_0x3b3e01=_0x3b3e01-0x0;var _0x1d13c6=_0xd697[_0x3b3e01];return _0x1d13c6;};'use strict';var _=require(_0x7d69('0x0'));var util=require('util');var logger=require(_0x7d69('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7d69('0x2'));var rp=require(_0x7d69('0x3'));var fs=require('fs');var path=require(_0x7d69('0x4'));var rimraf=require(_0x7d69('0x5'));var config=require('../../config/environment');var attributes=require(_0x7d69('0x6'));module[_0x7d69('0x7')]=function(_0x38edf6,_0x8f69c){return _0x38edf6[_0x7d69('0x8')](_0x7d69('0x9'),attributes,{'tableName':_0x7d69('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9110=['rimraf','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','moment','bluebird','request-promise','path'];(function(_0x171fdc,_0x16ae91){var _0x3782ea=function(_0x58b691){while(--_0x58b691){_0x171fdc['push'](_0x171fdc['shift']());}};_0x3782ea(++_0x16ae91);}(_0x9110,0x10e));var _0x0911=function(_0x2cbc89,_0x1b199e){_0x2cbc89=_0x2cbc89-0x0;var _0x58850a=_0x9110[_0x2cbc89];return _0x58850a;};'use strict';var _=require(_0x0911('0x0'));var util=require(_0x0911('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0911('0x2'));var BPromise=require(_0x0911('0x3'));var rp=require(_0x0911('0x4'));var fs=require('fs');var path=require(_0x0911('0x5'));var rimraf=require(_0x0911('0x6'));var config=require('../../config/environment');var attributes=require(_0x0911('0x7'));module[_0x0911('0x8')]=function(_0x4a882d,_0x7786fe){return _0x4a882d[_0x0911('0x9')](_0x0911('0xa'),attributes,{'tableName':_0x0911('0xb'),'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 1b704cd..f65fd60 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 _0x229d=['error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xdbc659,_0x4afd6c){var _0x2caf5a=function(_0x48765d){while(--_0x48765d){_0xdbc659['push'](_0xdbc659['shift']());}};_0x2caf5a(++_0x4afd6c);}(_0x229d,0x1a8));var _0xd229=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x229d[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xd229('0x0'));var util=require(_0xd229('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd229('0x2'));var fs=require('fs');var Redis=require(_0xd229('0x3'));var db=require(_0xd229('0x4'))['db'];var utils=require(_0xd229('0x5'));var logger=require(_0xd229('0x6'))(_0xd229('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd229('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2851b5,_0x99255b,_0x281088){return new BPromise(function(_0x206e3d,_0x20a094){return client[_0xd229('0x9')](_0x2851b5,_0x281088)[_0xd229('0xa')](function(_0xc356e0){logger[_0xd229('0xb')](_0xd229('0xc'),_0x99255b,_0xd229('0xd'));logger['debug'](_0xd229('0xe'),_0x99255b,_0xd229('0xd'),JSON[_0xd229('0xf')](_0xc356e0));if(_0xc356e0[_0xd229('0x10')]){if(_0xc356e0['error'][_0xd229('0x11')]===0x1f4){logger[_0xd229('0x10')](_0xd229('0xc'),_0x99255b,_0xc356e0['error']['message']);return _0x20a094(_0xc356e0[_0xd229('0x10')]['message']);}logger[_0xd229('0x10')](_0xd229('0xc'),_0x99255b,_0xc356e0['error'][_0xd229('0x12')]);return _0x206e3d(_0xc356e0[_0xd229('0x10')][_0xd229('0x12')]);}else{logger[_0xd229('0xb')](_0xd229('0xc'),_0x99255b,'request\x20sent');_0x206e3d(_0xc356e0['result'][_0xd229('0x12')]);}})[_0xd229('0x13')](function(_0xa2882a){logger[_0xd229('0x10')](_0xd229('0xc'),_0x99255b,_0xa2882a);_0x20a094(_0xa2882a);});});} \ No newline at end of file +var _0x9ad0=['info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Configuration,\x20%s,\x20%s','result','catch','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x9ad0,0x1ee));var _0x09ad=function(_0x3fd63c,_0x2b37ee){_0x3fd63c=_0x3fd63c-0x0;var _0x3a4cc=_0x9ad0[_0x3fd63c];return _0x3a4cc;};'use strict';var _=require('lodash');var util=require(_0x09ad('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x09ad('0x1'));var fs=require('fs');var Redis=require(_0x09ad('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x09ad('0x3'));var logger=require(_0x09ad('0x4'))(_0x09ad('0x5'));var config=require('../../config/environment');var jayson=require(_0x09ad('0x6'));var client=jayson['client'][_0x09ad('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x76511c,_0x2162ea,_0x12d7c9){return new BPromise(function(_0x1f9d5b,_0x15a2fe){return client[_0x09ad('0x8')](_0x76511c,_0x12d7c9)[_0x09ad('0x9')](function(_0x23f1ab){logger[_0x09ad('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2162ea,_0x09ad('0xb'));logger[_0x09ad('0xc')](_0x09ad('0xd'),_0x2162ea,'request\x20sent',JSON[_0x09ad('0xe')](_0x23f1ab));if(_0x23f1ab[_0x09ad('0xf')]){if(_0x23f1ab[_0x09ad('0xf')][_0x09ad('0x10')]===0x1f4){logger[_0x09ad('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2162ea,_0x23f1ab['error'][_0x09ad('0x11')]);return _0x15a2fe(_0x23f1ab['error'][_0x09ad('0x11')]);}logger[_0x09ad('0xf')](_0x09ad('0x12'),_0x2162ea,_0x23f1ab['error']['message']);return _0x1f9d5b(_0x23f1ab['error'][_0x09ad('0x11')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x2162ea,_0x09ad('0xb'));_0x1f9d5b(_0x23f1ab[_0x09ad('0x13')]['message']);}})[_0x09ad('0x14')](function(_0x3cbb1d){logger[_0x09ad('0xf')](_0x09ad('0x12'),_0x2162ea,_0x3cbb1d);_0x15a2fe(_0x3cbb1d);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 4b2236f..a691afe 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 _0x0c5d=['multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x1b5cad,_0x4560e3){_0x1b5cad=_0x1b5cad-0x0;var _0x2e782b=_0x0c5d[_0x1b5cad];return _0x2e782b;};'use strict';var multer=require(_0xd0c5('0x0'));var util=require(_0xd0c5('0x1'));var path=require('path');var timeout=require(_0xd0c5('0x2'));var express=require('express');var router=express[_0xd0c5('0x3')]();var auth=require(_0xd0c5('0x4'));var interaction=require(_0xd0c5('0x5'));var config=require(_0xd0c5('0x6'));var controller=require(_0xd0c5('0x7'));router[_0xd0c5('0x8')]('/',auth[_0xd0c5('0x9')](),controller[_0xd0c5('0xa')]);router['get'](_0xd0c5('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd0c5('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd0c5('0xd')](_0xd0c5('0xb'),auth['isAuthenticated'](),controller[_0xd0c5('0xe')]);router[_0xd0c5('0xf')]('/:id',auth[_0xd0c5('0x9')](),controller[_0xd0c5('0x10')]);module[_0xd0c5('0x11')]=router; \ No newline at end of file +var _0x0427=['/:id','show','post','create','put','update','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated'];(function(_0x5c7cad,_0x40bfab){var _0x35c22f=function(_0x5a8e90){while(--_0x5a8e90){_0x5c7cad['push'](_0x5c7cad['shift']());}};_0x35c22f(++_0x40bfab);}(_0x0427,0x137));var _0x7042=function(_0x20b9ed,_0x5558a6){_0x20b9ed=_0x20b9ed-0x0;var _0x52cf73=_0x0427[_0x20b9ed];return _0x52cf73;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7042('0x0'));var timeout=require(_0x7042('0x1'));var express=require('express');var router=express[_0x7042('0x2')]();var auth=require(_0x7042('0x3'));var interaction=require(_0x7042('0x4'));var config=require(_0x7042('0x5'));var controller=require(_0x7042('0x6'));router[_0x7042('0x7')]('/',auth[_0x7042('0x8')](),controller['index']);router[_0x7042('0x7')](_0x7042('0x9'),auth[_0x7042('0x8')](),controller[_0x7042('0xa')]);router[_0x7042('0xb')]('/',auth[_0x7042('0x8')](),controller[_0x7042('0xc')]);router[_0x7042('0xd')](_0x7042('0x9'),auth['isAuthenticated'](),controller[_0x7042('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7042('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index eb675f0..12306ae 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 _0x985d=['sequelize','exports','ENUM','string','customVariable','keyValue','STRING','variable','BOOLEAN'];(function(_0x179b62,_0x1c92e2){var _0x56579b=function(_0xe962f0){while(--_0xe962f0){_0x179b62['push'](_0x179b62['shift']());}};_0x56579b(++_0x1c92e2);}(_0x985d,0xfc));var _0xd985=function(_0x238c65,_0x36bc14){_0x238c65=_0x238c65-0x0;var _0x14a52d=_0x985d[_0x238c65];return _0x14a52d;};'use strict';var Sequelize=require(_0xd985('0x0'));module[_0xd985('0x1')]={'type':{'type':Sequelize[_0xd985('0x2')](_0xd985('0x3'),'variable',_0xd985('0x4'),_0xd985('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd985('0x6')]},'key':{'type':Sequelize[_0xd985('0x6')]},'keyType':{'type':Sequelize[_0xd985('0x2')](_0xd985('0x3'),_0xd985('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xd985('0x6')]},'idField':{'type':Sequelize[_0xd985('0x6')]},'nameField':{'type':Sequelize[_0xd985('0x6')]},'customField':{'type':Sequelize[_0xd985('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd985('0x6')]}}; \ No newline at end of file +var _0x1a66=['exports','ENUM','string','variable','customVariable','STRING','sequelize'];(function(_0x58c851,_0x1f3d96){var _0x534d8a=function(_0x10c1a0){while(--_0x10c1a0){_0x58c851['push'](_0x58c851['shift']());}};_0x534d8a(++_0x1f3d96);}(_0x1a66,0x102));var _0x61a6=function(_0xbe93a5,_0x437147){_0xbe93a5=_0xbe93a5-0x0;var _0x26a896=_0x1a66[_0xbe93a5];return _0x26a896;};'use strict';var Sequelize=require(_0x61a6('0x0'));module[_0x61a6('0x1')]={'type':{'type':Sequelize[_0x61a6('0x2')](_0x61a6('0x3'),_0x61a6('0x4'),_0x61a6('0x5'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x61a6('0x6')]},'key':{'type':Sequelize[_0x61a6('0x6')]},'keyType':{'type':Sequelize[_0x61a6('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x61a6('0x6')]},'nameField':{'type':Sequelize[_0x61a6('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x61a6('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 002df2c..8c6d71c 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 _0xb46f=['sendStatus','error','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','key','model','map','query','filters','attributes','fields','length','limit','order','pick','filter','where','merge','type','VIRTUAL','options','count','includeAll','include','catch','show','params','keys','intersection','find','create','body','update','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','status'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb46f,0xb6));var _0xfb46=function(_0x217cd6,_0x3c427b){_0x217cd6=_0x217cd6-0x0;var _0x184b11=_0xb46f[_0x217cd6];return _0x184b11;};'use strict';var pdf=require(_0xfb46('0x0'));var emlformat=require(_0xfb46('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xfb46('0x2'));var jsonpatch=require(_0xfb46('0x3'));var rp=require(_0xfb46('0x4'));var moment=require(_0xfb46('0x5'));var BPromise=require(_0xfb46('0x6'));var Mustache=require('mustache');var util=require(_0xfb46('0x7'));var path=require('path');var sox=require(_0xfb46('0x8'));var csv=require(_0xfb46('0x9'));var ejs=require(_0xfb46('0xa'));var fs=require('fs');var _=require(_0xfb46('0xb'));var squel=require(_0xfb46('0xc'));var crypto=require('crypto');var jsforce=require(_0xfb46('0xd'));var deskjs=require(_0xfb46('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfb46('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfb46('0x10'));var hardwareService=require(_0xfb46('0x11'));var logger=require(_0xfb46('0x12'))(_0xfb46('0x13'));var utils=require(_0xfb46('0x14'));var config=require(_0xfb46('0x15'));var db=require(_0xfb46('0x16'))['db'];function respondWithStatusCode(_0x39bb39,_0xa0034b){_0xa0034b=_0xa0034b||0xcc;return function(_0x1527e1){if(_0x1527e1){return _0x39bb39['sendStatus'](_0xa0034b);}return _0x39bb39['status'](_0xa0034b)[_0xfb46('0x17')]();};}function respondWithResult(_0x50ec54,_0x41ebd9){_0x41ebd9=_0x41ebd9||0xc8;return function(_0x47bdf3){if(_0x47bdf3){return _0x50ec54['status'](_0x41ebd9)[_0xfb46('0x18')](_0x47bdf3);}};}function respondWithFilteredResult(_0x319759,_0xf3fdbd){return function(_0x348b3e){if(_0x348b3e){var _0x4ec418=_0x348b3e['count'],_0x230774=_0xf3fdbd[_0xfb46('0x19')],_0x2b0ee4=_0xf3fdbd[_0xfb46('0x19')]+_0xf3fdbd['limit'],_0x358b84;if(_0x2b0ee4>=_0x4ec418){_0x2b0ee4=_0x4ec418;_0x358b84=0xc8;}else{_0x358b84=0xce;}_0x319759['status'](_0x358b84);return _0x319759[_0xfb46('0x1a')](_0xfb46('0x1b'),_0x230774+'-'+_0x2b0ee4+'/'+_0x4ec418)[_0xfb46('0x18')](_0x348b3e);}return null;};}function patchUpdates(_0xde1136){return function(_0x2521d0){try{jsonpatch[_0xfb46('0x1c')](_0x2521d0,_0xde1136,!![]);}catch(_0x9f8bd7){return BPromise[_0xfb46('0x1d')](_0x9f8bd7);}return _0x2521d0[_0xfb46('0x1e')]();};}function saveUpdates(_0x452ade,_0x1c820a){return function(_0x2ee6db){if(_0x2ee6db){return _0x2ee6db['update'](_0x452ade)[_0xfb46('0x1f')](function(_0x15aaf8){return _0x15aaf8;});}return null;};}function removeEntity(_0x428c9f,_0x5b19b3){return function(_0x1b05d0){if(_0x1b05d0){return _0x1b05d0[_0xfb46('0x20')]()[_0xfb46('0x1f')](function(){_0x428c9f[_0xfb46('0x21')](0xcc)[_0xfb46('0x17')]();});}};}function handleEntityNotFound(_0x52f392,_0x36c00a){return function(_0x5a8dde){if(!_0x5a8dde){_0x52f392[_0xfb46('0x22')](0x194);}return _0x5a8dde;};}function handleError(_0x282dae,_0x2cad2b){_0x2cad2b=_0x2cad2b||0x1f4;return function(_0x8c83bb){logger[_0xfb46('0x23')](_0x8c83bb[_0xfb46('0x24')]);if(_0x8c83bb[_0xfb46('0x25')]){delete _0x8c83bb['name'];}_0x282dae[_0xfb46('0x21')](_0x2cad2b)[_0xfb46('0x26')](_0x8c83bb);};}exports[_0xfb46('0x27')]=function(_0x2e5bbd,_0x22d795){var _0x189081={},_0x16aea0={},_0x370da1={'count':0x0,'rows':[]};var _0x3dd84a=_['map'](db[_0xfb46('0x28')][_0xfb46('0x29')],function(_0x1d691e){return{'name':_0x1d691e[_0xfb46('0x2a')],'type':_0x1d691e['type'][_0xfb46('0x2b')]};});_0x16aea0[_0xfb46('0x2c')]=_[_0xfb46('0x2d')](_0x3dd84a,_0xfb46('0x25'));_0x16aea0[_0xfb46('0x2e')]=_['keys'](_0x2e5bbd[_0xfb46('0x2e')]);_0x16aea0[_0xfb46('0x2f')]=_['intersection'](_0x16aea0[_0xfb46('0x2c')],_0x16aea0['query']);_0x189081[_0xfb46('0x30')]=_['intersection'](_0x16aea0[_0xfb46('0x2c')],qs['fields'](_0x2e5bbd[_0xfb46('0x2e')][_0xfb46('0x31')]));_0x189081['attributes']=_0x189081[_0xfb46('0x30')][_0xfb46('0x32')]?_0x189081['attributes']:_0x16aea0[_0xfb46('0x2c')];if(!_0x2e5bbd[_0xfb46('0x2e')]['hasOwnProperty']('nolimit')){_0x189081[_0xfb46('0x33')]=qs[_0xfb46('0x33')](_0x2e5bbd[_0xfb46('0x2e')][_0xfb46('0x33')]);_0x189081[_0xfb46('0x19')]=qs[_0xfb46('0x19')](_0x2e5bbd[_0xfb46('0x2e')][_0xfb46('0x19')]);}_0x189081[_0xfb46('0x34')]=qs['sort'](_0x2e5bbd[_0xfb46('0x2e')]['sort']);_0x189081['where']=qs[_0xfb46('0x2f')](_[_0xfb46('0x35')](_0x2e5bbd[_0xfb46('0x2e')],_0x16aea0[_0xfb46('0x2f')]));if(_0x2e5bbd[_0xfb46('0x2e')][_0xfb46('0x36')]){_0x189081[_0xfb46('0x37')]=_[_0xfb46('0x38')](_0x189081['where'],{'$or':_[_0xfb46('0x2d')](_0x3dd84a,function(_0xbb9a5){if(_0xbb9a5[_0xfb46('0x39')]!==_0xfb46('0x3a')){var _0x4c0627={};_0x4c0627[_0xbb9a5[_0xfb46('0x25')]]={'$like':'%'+_0x2e5bbd[_0xfb46('0x2e')][_0xfb46('0x36')]+'%'};return _0x4c0627;}})});}_0x189081=_[_0xfb46('0x38')]({},_0x189081,_0x2e5bbd[_0xfb46('0x3b')]);var _0x575b77={'where':_0x189081[_0xfb46('0x37')]};return db[_0xfb46('0x28')]['count'](_0x575b77)[_0xfb46('0x1f')](function(_0x1af444){_0x370da1[_0xfb46('0x3c')]=_0x1af444;if(_0x2e5bbd['query'][_0xfb46('0x3d')]){_0x189081[_0xfb46('0x3e')]=[{'all':!![]}];}return db[_0xfb46('0x28')]['findAll'](_0x189081);})[_0xfb46('0x1f')](function(_0x592ced){_0x370da1['rows']=_0x592ced;return _0x370da1;})[_0xfb46('0x1f')](respondWithFilteredResult(_0x22d795,_0x189081))[_0xfb46('0x3f')](handleError(_0x22d795,null));};exports[_0xfb46('0x40')]=function(_0x353645,_0x201a38){var _0x2979c4={'raw':!![],'where':{'id':_0x353645[_0xfb46('0x41')]['id']}},_0x3c82d4={};_0x3c82d4[_0xfb46('0x2c')]=_[_0xfb46('0x42')](db['Dynamics365Field'][_0xfb46('0x29')]);_0x3c82d4[_0xfb46('0x2e')]=_[_0xfb46('0x42')](_0x353645[_0xfb46('0x2e')]);_0x3c82d4[_0xfb46('0x2f')]=_[_0xfb46('0x43')](_0x3c82d4['model'],_0x3c82d4['query']);_0x2979c4[_0xfb46('0x30')]=_[_0xfb46('0x43')](_0x3c82d4[_0xfb46('0x2c')],qs[_0xfb46('0x31')](_0x353645[_0xfb46('0x2e')]['fields']));_0x2979c4['attributes']=_0x2979c4['attributes'][_0xfb46('0x32')]?_0x2979c4['attributes']:_0x3c82d4['model'];if(_0x353645[_0xfb46('0x2e')][_0xfb46('0x3d')]){_0x2979c4[_0xfb46('0x3e')]=[{'all':!![]}];}_0x2979c4=_['merge']({},_0x2979c4,_0x353645[_0xfb46('0x3b')]);return db['Dynamics365Field'][_0xfb46('0x44')](_0x2979c4)[_0xfb46('0x1f')](handleEntityNotFound(_0x201a38,null))[_0xfb46('0x1f')](respondWithResult(_0x201a38,null))[_0xfb46('0x3f')](handleError(_0x201a38,null));};exports[_0xfb46('0x45')]=function(_0x84c53d,_0x45dec0){return db[_0xfb46('0x28')][_0xfb46('0x45')](_0x84c53d[_0xfb46('0x46')],{})[_0xfb46('0x1f')](respondWithResult(_0x45dec0,0xc9))[_0xfb46('0x3f')](handleError(_0x45dec0,null));};exports[_0xfb46('0x47')]=function(_0x29e38c,_0x885ff3){if(_0x29e38c['body']['id']){delete _0x29e38c[_0xfb46('0x46')]['id'];}return db[_0xfb46('0x28')][_0xfb46('0x44')]({'where':{'id':_0x29e38c[_0xfb46('0x41')]['id']}})[_0xfb46('0x1f')](handleEntityNotFound(_0x885ff3,null))['then'](saveUpdates(_0x29e38c[_0xfb46('0x46')],null))[_0xfb46('0x1f')](respondWithResult(_0x885ff3,null))[_0xfb46('0x3f')](handleError(_0x885ff3,null));};exports[_0xfb46('0x20')]=function(_0x72b53e,_0x1ddc8e){return db[_0xfb46('0x28')][_0xfb46('0x44')]({'where':{'id':_0x72b53e[_0xfb46('0x41')]['id']}})[_0xfb46('0x1f')](handleEntityNotFound(_0x1ddc8e,null))['then'](removeEntity(_0x1ddc8e,null))['catch'](handleError(_0x1ddc8e,null));}; \ No newline at end of file +var _0xf446=['apply','reject','then','destroy','error','name','index','map','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','Dynamics365Field','includeAll','findAll','rows','show','include','options','create','catch','update','body','find','params','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','path','lodash','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0xf446,0x1c0));var _0x6f44=function(_0xb992ce,_0x2c09c7){_0xb992ce=_0xb992ce-0x0;var _0x18a182=_0xf446[_0xb992ce];return _0x18a182;};'use strict';var pdf=require(_0x6f44('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6f44('0x1'));var zipdir=require(_0x6f44('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f44('0x3'));var moment=require('moment');var BPromise=require(_0x6f44('0x4'));var Mustache=require(_0x6f44('0x5'));var util=require('util');var path=require(_0x6f44('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6f44('0x7'));var squel=require('squel');var crypto=require(_0x6f44('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f44('0x9'));var querystring=require('querystring');var Papa=require(_0x6f44('0xa'));var Redis=require(_0x6f44('0xb'));var authService=require(_0x6f44('0xc'));var qs=require(_0x6f44('0xd'));var as=require(_0x6f44('0xe'));var hardwareService=require(_0x6f44('0xf'));var logger=require(_0x6f44('0x10'))(_0x6f44('0x11'));var utils=require('../../config/utils');var config=require(_0x6f44('0x12'));var db=require(_0x6f44('0x13'))['db'];function respondWithStatusCode(_0x28ec05,_0x4bacc0){_0x4bacc0=_0x4bacc0||0xcc;return function(_0x305757){if(_0x305757){return _0x28ec05[_0x6f44('0x14')](_0x4bacc0);}return _0x28ec05[_0x6f44('0x15')](_0x4bacc0)[_0x6f44('0x16')]();};}function respondWithResult(_0x5bd6da,_0x82c009){_0x82c009=_0x82c009||0xc8;return function(_0x4f1b19){if(_0x4f1b19){return _0x5bd6da[_0x6f44('0x15')](_0x82c009)['json'](_0x4f1b19);}};}function respondWithFilteredResult(_0x5ee20e,_0x33e088){return function(_0xe5c968){if(_0xe5c968){var _0x33a130=_0xe5c968[_0x6f44('0x17')],_0x22200e=_0x33e088[_0x6f44('0x18')],_0x43b6cd=_0x33e088[_0x6f44('0x18')]+_0x33e088[_0x6f44('0x19')],_0x34a64d;if(_0x43b6cd>=_0x33a130){_0x43b6cd=_0x33a130;_0x34a64d=0xc8;}else{_0x34a64d=0xce;}_0x5ee20e[_0x6f44('0x15')](_0x34a64d);return _0x5ee20e['set'](_0x6f44('0x1a'),_0x22200e+'-'+_0x43b6cd+'/'+_0x33a130)[_0x6f44('0x1b')](_0xe5c968);}return null;};}function patchUpdates(_0x40f74c){return function(_0x39bc07){try{jsonpatch[_0x6f44('0x1c')](_0x39bc07,_0x40f74c,!![]);}catch(_0x57af2a){return BPromise[_0x6f44('0x1d')](_0x57af2a);}return _0x39bc07['save']();};}function saveUpdates(_0x43ca38,_0x57d6a2){return function(_0x3c1265){if(_0x3c1265){return _0x3c1265['update'](_0x43ca38)[_0x6f44('0x1e')](function(_0x2a1cff){return _0x2a1cff;});}return null;};}function removeEntity(_0x25b798,_0xf1a57c){return function(_0x1137db){if(_0x1137db){return _0x1137db[_0x6f44('0x1f')]()[_0x6f44('0x1e')](function(){_0x25b798[_0x6f44('0x15')](0xcc)[_0x6f44('0x16')]();});}};}function handleEntityNotFound(_0x50bbad,_0x56cbea){return function(_0x3583c7){if(!_0x3583c7){_0x50bbad[_0x6f44('0x14')](0x194);}return _0x3583c7;};}function handleError(_0x43faec,_0x3cdc68){_0x3cdc68=_0x3cdc68||0x1f4;return function(_0x3771d8){logger[_0x6f44('0x20')](_0x3771d8['stack']);if(_0x3771d8[_0x6f44('0x21')]){delete _0x3771d8[_0x6f44('0x21')];}_0x43faec['status'](_0x3cdc68)['send'](_0x3771d8);};}exports[_0x6f44('0x22')]=function(_0x38ebb4,_0x2a8d41){var _0x3773dd={},_0xe22f1e={},_0x16c879={'count':0x0,'rows':[]};var _0x4c994b=_[_0x6f44('0x23')](db['Dynamics365Field'][_0x6f44('0x24')],function(_0x6784ce){return{'name':_0x6784ce[_0x6f44('0x25')],'type':_0x6784ce['type'][_0x6f44('0x26')]};});_0xe22f1e[_0x6f44('0x27')]=_[_0x6f44('0x23')](_0x4c994b,'name');_0xe22f1e['query']=_[_0x6f44('0x28')](_0x38ebb4[_0x6f44('0x29')]);_0xe22f1e[_0x6f44('0x2a')]=_['intersection'](_0xe22f1e[_0x6f44('0x27')],_0xe22f1e[_0x6f44('0x29')]);_0x3773dd[_0x6f44('0x2b')]=_[_0x6f44('0x2c')](_0xe22f1e[_0x6f44('0x27')],qs[_0x6f44('0x2d')](_0x38ebb4[_0x6f44('0x29')][_0x6f44('0x2d')]));_0x3773dd[_0x6f44('0x2b')]=_0x3773dd[_0x6f44('0x2b')][_0x6f44('0x2e')]?_0x3773dd[_0x6f44('0x2b')]:_0xe22f1e['model'];if(!_0x38ebb4['query'][_0x6f44('0x2f')](_0x6f44('0x30'))){_0x3773dd[_0x6f44('0x19')]=qs['limit'](_0x38ebb4[_0x6f44('0x29')][_0x6f44('0x19')]);_0x3773dd[_0x6f44('0x18')]=qs[_0x6f44('0x18')](_0x38ebb4[_0x6f44('0x29')][_0x6f44('0x18')]);}_0x3773dd[_0x6f44('0x31')]=qs[_0x6f44('0x32')](_0x38ebb4[_0x6f44('0x29')]['sort']);_0x3773dd[_0x6f44('0x33')]=qs['filters'](_['pick'](_0x38ebb4['query'],_0xe22f1e[_0x6f44('0x2a')]));if(_0x38ebb4[_0x6f44('0x29')][_0x6f44('0x34')]){_0x3773dd[_0x6f44('0x33')]=_[_0x6f44('0x35')](_0x3773dd['where'],{'$or':_[_0x6f44('0x23')](_0x4c994b,function(_0x30f3a6){if(_0x30f3a6[_0x6f44('0x36')]!=='VIRTUAL'){var _0x38ba8d={};_0x38ba8d[_0x30f3a6[_0x6f44('0x21')]]={'$like':'%'+_0x38ebb4[_0x6f44('0x29')][_0x6f44('0x34')]+'%'};return _0x38ba8d;}})});}_0x3773dd=_[_0x6f44('0x35')]({},_0x3773dd,_0x38ebb4['options']);var _0x179985={'where':_0x3773dd[_0x6f44('0x33')]};return db[_0x6f44('0x37')]['count'](_0x179985)['then'](function(_0x4d8af2){_0x16c879[_0x6f44('0x17')]=_0x4d8af2;if(_0x38ebb4['query'][_0x6f44('0x38')]){_0x3773dd['include']=[{'all':!![]}];}return db[_0x6f44('0x37')][_0x6f44('0x39')](_0x3773dd);})[_0x6f44('0x1e')](function(_0x313f80){_0x16c879[_0x6f44('0x3a')]=_0x313f80;return _0x16c879;})[_0x6f44('0x1e')](respondWithFilteredResult(_0x2a8d41,_0x3773dd))['catch'](handleError(_0x2a8d41,null));};exports[_0x6f44('0x3b')]=function(_0x449096,_0x1536ca){var _0x297999={'raw':!![],'where':{'id':_0x449096['params']['id']}},_0x16b94e={};_0x16b94e[_0x6f44('0x27')]=_[_0x6f44('0x28')](db[_0x6f44('0x37')][_0x6f44('0x24')]);_0x16b94e[_0x6f44('0x29')]=_[_0x6f44('0x28')](_0x449096[_0x6f44('0x29')]);_0x16b94e[_0x6f44('0x2a')]=_[_0x6f44('0x2c')](_0x16b94e['model'],_0x16b94e[_0x6f44('0x29')]);_0x297999['attributes']=_[_0x6f44('0x2c')](_0x16b94e[_0x6f44('0x27')],qs[_0x6f44('0x2d')](_0x449096[_0x6f44('0x29')]['fields']));_0x297999[_0x6f44('0x2b')]=_0x297999[_0x6f44('0x2b')]['length']?_0x297999[_0x6f44('0x2b')]:_0x16b94e[_0x6f44('0x27')];if(_0x449096[_0x6f44('0x29')][_0x6f44('0x38')]){_0x297999[_0x6f44('0x3c')]=[{'all':!![]}];}_0x297999=_[_0x6f44('0x35')]({},_0x297999,_0x449096[_0x6f44('0x3d')]);return db[_0x6f44('0x37')]['find'](_0x297999)[_0x6f44('0x1e')](handleEntityNotFound(_0x1536ca,null))[_0x6f44('0x1e')](respondWithResult(_0x1536ca,null))['catch'](handleError(_0x1536ca,null));};exports[_0x6f44('0x3e')]=function(_0x4e8f9e,_0x4f4c55){return db['Dynamics365Field'][_0x6f44('0x3e')](_0x4e8f9e['body'],{})['then'](respondWithResult(_0x4f4c55,0xc9))[_0x6f44('0x3f')](handleError(_0x4f4c55,null));};exports[_0x6f44('0x40')]=function(_0x3e1a61,_0x416ee2){if(_0x3e1a61[_0x6f44('0x41')]['id']){delete _0x3e1a61['body']['id'];}return db[_0x6f44('0x37')][_0x6f44('0x42')]({'where':{'id':_0x3e1a61[_0x6f44('0x43')]['id']}})[_0x6f44('0x1e')](handleEntityNotFound(_0x416ee2,null))[_0x6f44('0x1e')](saveUpdates(_0x3e1a61['body'],null))[_0x6f44('0x1e')](respondWithResult(_0x416ee2,null))[_0x6f44('0x3f')](handleError(_0x416ee2,null));};exports[_0x6f44('0x1f')]=function(_0x2087f7,_0x45c6df){return db['Dynamics365Field']['find']({'where':{'id':_0x2087f7[_0x6f44('0x43')]['id']}})['then'](handleEntityNotFound(_0x45c6df,null))[_0x6f44('0x1e')](removeEntity(_0x45c6df,null))['catch'](handleError(_0x45c6df,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index fb5c01a..fce3340 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 _0x8e61=['exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x35f9d4,_0x5dea15){var _0xfbbb29=function(_0x32a7bb){while(--_0x32a7bb){_0x35f9d4['push'](_0x35f9d4['shift']());}};_0xfbbb29(++_0x5dea15);}(_0x8e61,0x131));var _0x18e6=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x8e61[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x18e6('0x0'));var util=require('util');var logger=require(_0x18e6('0x1'))(_0x18e6('0x2'));var moment=require(_0x18e6('0x3'));var BPromise=require(_0x18e6('0x4'));var rp=require(_0x18e6('0x5'));var fs=require('fs');var path=require(_0x18e6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDynamics365Field.attributes');module[_0x18e6('0x7')]=function(_0x5f17ce,_0x932e44){return _0x5f17ce[_0x18e6('0x8')](_0x18e6('0x9'),attributes,{'tableName':_0x18e6('0xa'),'paranoid':![],'indexes':[{'name':_0x18e6('0xb'),'fields':['idField',_0x18e6('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x70b1=['api','moment','bluebird','request-promise','path','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x411986,_0x75d748){var _0x2c26ee=function(_0x5da868){while(--_0x5da868){_0x411986['push'](_0x411986['shift']());}};_0x2c26ee(++_0x75d748);}(_0x70b1,0x1ec));var _0x170b=function(_0x453bec,_0x413a01){_0x453bec=_0x453bec-0x0;var _0x38b180=_0x70b1[_0x453bec];return _0x38b180;};'use strict';var _=require(_0x170b('0x0'));var util=require(_0x170b('0x1'));var logger=require(_0x170b('0x2'))(_0x170b('0x3'));var moment=require(_0x170b('0x4'));var BPromise=require(_0x170b('0x5'));var rp=require(_0x170b('0x6'));var fs=require('fs');var path=require(_0x170b('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x170b('0x8'));module['exports']=function(_0x116ba5,_0x3691a0){return _0x116ba5[_0x170b('0x9')](_0x170b('0xa'),attributes,{'tableName':_0x170b('0xb'),'paranoid':![],'indexes':[{'name':_0x170b('0xc'),'fields':[_0x170b('0xd'),_0x170b('0xe')],'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 c9932a3..c96e8a8 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 _0x89fb=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x2b5cbc,_0x29a39c){var _0x13c790=function(_0x49226b){while(--_0x49226b){_0x2b5cbc['push'](_0x2b5cbc['shift']());}};_0x13c790(++_0x29a39c);}(_0x89fb,0x14b));var _0xb89f=function(_0x3af670,_0x295ef7){_0x3af670=_0x3af670-0x0;var _0x14ec5a=_0x89fb[_0x3af670];return _0x14ec5a;};'use strict';var _=require('lodash');var util=require(_0xb89f('0x0'));var moment=require(_0xb89f('0x1'));var BPromise=require(_0xb89f('0x2'));var rs=require(_0xb89f('0x3'));var fs=require('fs');var Redis=require(_0xb89f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb89f('0x5'));var logger=require(_0xb89f('0x6'))(_0xb89f('0x7'));var config=require(_0xb89f('0x8'));var jayson=require(_0xb89f('0x9'));var client=jayson['client'][_0xb89f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b467c,_0x334236,_0x537685){return new BPromise(function(_0x3c0105,_0x95385){return client[_0xb89f('0xb')](_0x5b467c,_0x537685)['then'](function(_0x18f75f){logger[_0xb89f('0xc')](_0xb89f('0xd'),_0x334236,_0xb89f('0xe'));logger[_0xb89f('0xf')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x334236,'request\x20sent',JSON[_0xb89f('0x10')](_0x18f75f));if(_0x18f75f[_0xb89f('0x11')]){if(_0x18f75f[_0xb89f('0x11')][_0xb89f('0x12')]===0x1f4){logger[_0xb89f('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x334236,_0x18f75f[_0xb89f('0x11')][_0xb89f('0x13')]);return _0x95385(_0x18f75f[_0xb89f('0x11')][_0xb89f('0x13')]);}logger[_0xb89f('0x11')](_0xb89f('0xd'),_0x334236,_0x18f75f['error'][_0xb89f('0x13')]);return _0x3c0105(_0x18f75f[_0xb89f('0x11')][_0xb89f('0x13')]);}else{logger[_0xb89f('0xc')](_0xb89f('0xd'),_0x334236,_0xb89f('0xe'));_0x3c0105(_0x18f75f[_0xb89f('0x14')]['message']);}})[_0xb89f('0x15')](function(_0xfc48d){logger[_0xb89f('0x11')](_0xb89f('0xd'),_0x334236,_0xfc48d);_0x95385(_0xfc48d);});});} \ No newline at end of file +var _0x7a2f=['../../config/environment','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x49d947,_0x30190e){var _0x17abdf=function(_0x445d19){while(--_0x445d19){_0x49d947['push'](_0x49d947['shift']());}};_0x17abdf(++_0x30190e);}(_0x7a2f,0x99));var _0xf7a2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7a2f[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xf7a2('0x0'));var util=require(_0xf7a2('0x1'));var moment=require('moment');var BPromise=require(_0xf7a2('0x2'));var rs=require(_0xf7a2('0x3'));var fs=require('fs');var Redis=require(_0xf7a2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf7a2('0x5'));var logger=require(_0xf7a2('0x6'))(_0xf7a2('0x7'));var config=require(_0xf7a2('0x8'));var jayson=require(_0xf7a2('0x9'));var client=jayson[_0xf7a2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e6ae2,_0x33506b,_0x21e9f6){return new BPromise(function(_0x7ecbb1,_0x585ed7){return client[_0xf7a2('0xb')](_0x3e6ae2,_0x21e9f6)[_0xf7a2('0xc')](function(_0x23b299){logger[_0xf7a2('0xd')](_0xf7a2('0xe'),_0x33506b,_0xf7a2('0xf'));logger[_0xf7a2('0x10')](_0xf7a2('0x11'),_0x33506b,'request\x20sent',JSON[_0xf7a2('0x12')](_0x23b299));if(_0x23b299[_0xf7a2('0x13')]){if(_0x23b299[_0xf7a2('0x13')][_0xf7a2('0x14')]===0x1f4){logger[_0xf7a2('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x33506b,_0x23b299['error']['message']);return _0x585ed7(_0x23b299[_0xf7a2('0x13')][_0xf7a2('0x15')]);}logger[_0xf7a2('0x13')](_0xf7a2('0xe'),_0x33506b,_0x23b299[_0xf7a2('0x13')][_0xf7a2('0x15')]);return _0x7ecbb1(_0x23b299[_0xf7a2('0x13')]['message']);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x33506b,_0xf7a2('0xf'));_0x7ecbb1(_0x23b299['result']['message']);}})[_0xf7a2('0x16')](function(_0x193501){logger[_0xf7a2('0x13')](_0xf7a2('0xe'),_0x33506b,_0x193501);_0x585ed7(_0x193501);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 3e344e3..51d16d2 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 _0x13be=['get','isAuthenticated','show','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller'];(function(_0x40fed5,_0x40e7d4){var _0xda9864=function(_0xadf496){while(--_0xadf496){_0x40fed5['push'](_0x40fed5['shift']());}};_0xda9864(++_0x40e7d4);}(_0x13be,0x141));var _0xe13b=function(_0x1deb27,_0x3cccc4){_0x1deb27=_0x1deb27-0x0;var _0x4f2cbd=_0x13be[_0x1deb27];return _0x4f2cbd;};'use strict';var multer=require(_0xe13b('0x0'));var util=require(_0xe13b('0x1'));var path=require(_0xe13b('0x2'));var timeout=require('connect-timeout');var express=require(_0xe13b('0x3'));var router=express[_0xe13b('0x4')]();var auth=require(_0xe13b('0x5'));var interaction=require(_0xe13b('0x6'));var config=require(_0xe13b('0x7'));var controller=require(_0xe13b('0x8'));router[_0xe13b('0x9')]('/',auth[_0xe13b('0xa')](),controller['index']);router['get']('/:id',auth[_0xe13b('0xa')](),controller[_0xe13b('0xb')]);router[_0xe13b('0x9')]('/:id/configurations',auth[_0xe13b('0xa')](),controller['getConfigurations']);router[_0xe13b('0x9')](_0xe13b('0xc'),auth[_0xe13b('0xa')](),controller[_0xe13b('0xd')]);router[_0xe13b('0xe')]('/',auth[_0xe13b('0xa')](),controller[_0xe13b('0xf')]);router[_0xe13b('0xe')](_0xe13b('0x10'),auth[_0xe13b('0xa')](),controller['addConfiguration']);router[_0xe13b('0x11')]('/:id',auth[_0xe13b('0xa')](),controller[_0xe13b('0x12')]);router[_0xe13b('0x13')]('/:id',auth[_0xe13b('0xa')](),controller[_0xe13b('0x14')]);module[_0xe13b('0x15')]=router; \ No newline at end of file +var _0x9dca=['exports','connect-timeout','express','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','put','delete'];(function(_0x12e509,_0x3fd09a){var _0x4bafbc=function(_0x340572){while(--_0x340572){_0x12e509['push'](_0x12e509['shift']());}};_0x4bafbc(++_0x3fd09a);}(_0x9dca,0x13c));var _0xa9dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dca[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa9dc('0x0'));var express=require(_0xa9dc('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa9dc('0x2'));var config=require('../../config/environment');var controller=require(_0xa9dc('0x3'));router[_0xa9dc('0x4')]('/',auth[_0xa9dc('0x5')](),controller['index']);router[_0xa9dc('0x4')](_0xa9dc('0x6'),auth[_0xa9dc('0x5')](),controller[_0xa9dc('0x7')]);router[_0xa9dc('0x4')](_0xa9dc('0x8'),auth[_0xa9dc('0x5')](),controller['getConfigurations']);router['get'](_0xa9dc('0x9'),auth[_0xa9dc('0x5')](),controller[_0xa9dc('0xa')]);router[_0xa9dc('0xb')]('/',auth[_0xa9dc('0x5')](),controller['create']);router[_0xa9dc('0xb')](_0xa9dc('0x8'),auth[_0xa9dc('0x5')](),controller['addConfiguration']);router[_0xa9dc('0xc')](_0xa9dc('0x6'),auth[_0xa9dc('0x5')](),controller['update']);router[_0xa9dc('0xd')]('/:id',auth[_0xa9dc('0x5')](),controller['destroy']);module[_0xa9dc('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 022c0b2..a94341e 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 _0x6dc0=['STRING','username','sequelize','exports'];(function(_0x3114d4,_0x42beb1){var _0x2807c1=function(_0x18c4e8){while(--_0x18c4e8){_0x3114d4['push'](_0x3114d4['shift']());}};_0x2807c1(++_0x42beb1);}(_0x6dc0,0xb6));var _0x06dc=function(_0x296da0,_0x4d4ea8){_0x296da0=_0x296da0-0x0;var _0x816ff3=_0x6dc0[_0x296da0];return _0x816ff3;};'use strict';var Sequelize=require(_0x06dc('0x0'));module[_0x06dc('0x1')]={'name':{'type':Sequelize[_0x06dc('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x06dc('0x2')],'unique':_0x06dc('0x3')},'apiKey':{'type':Sequelize[_0x06dc('0x2')]},'remoteUri':{'type':Sequelize[_0x06dc('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x06dc('0x2')]}}; \ No newline at end of file +var _0xcd2f=['username','remoteUri','STRING'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xcd2f[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfcd2('0x0')]},'username':{'type':Sequelize[_0xfcd2('0x0')],'unique':_0xfcd2('0x1')},'apiKey':{'type':Sequelize[_0xfcd2('0x0')]},'remoteUri':{'type':Sequelize[_0xfcd2('0x0')],'unique':_0xfcd2('0x2')},'serverUrl':{'type':Sequelize[_0xfcd2('0x0')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 2b6bdcb..d72f40a 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 _0x8f78=['index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','create','body','update','find','getConfigurations','order','nolimit','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','requester','subject','agent','description','priority','group','source','ticket_type','company','includes','custom_text','label','default','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','count','offset','limit','Content-Range','apply','reject','destroy','sendStatus','stack','name'];(function(_0x5106c1,_0x13233a){var _0x5bcaac=function(_0x18c12e){while(--_0x18c12e){_0x5106c1['push'](_0x5106c1['shift']());}};_0x5bcaac(++_0x13233a);}(_0x8f78,0xc9));var _0x88f7=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x8f78[_0x422905];return _0x33dc6c;};'use strict';var pdf=require(_0x88f7('0x0'));var emlformat=require(_0x88f7('0x1'));var rimraf=require(_0x88f7('0x2'));var zipdir=require(_0x88f7('0x3'));var jsonpatch=require(_0x88f7('0x4'));var rp=require(_0x88f7('0x5'));var moment=require(_0x88f7('0x6'));var BPromise=require(_0x88f7('0x7'));var Mustache=require(_0x88f7('0x8'));var util=require(_0x88f7('0x9'));var path=require(_0x88f7('0xa'));var sox=require('sox');var csv=require(_0x88f7('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x88f7('0xc'));var jsforce=require(_0x88f7('0xd'));var deskjs=require(_0x88f7('0xe'));var toCsv=require(_0x88f7('0xb'));var querystring=require(_0x88f7('0xf'));var Papa=require(_0x88f7('0x10'));var Redis=require(_0x88f7('0x11'));var authService=require(_0x88f7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x88f7('0x13'));var hardwareService=require(_0x88f7('0x14'));var logger=require('../../config/logger')(_0x88f7('0x15'));var utils=require('../../config/utils');var config=require(_0x88f7('0x16'));var db=require(_0x88f7('0x17'))['db'];var integrations=require(_0x88f7('0x18'));var jayson=require(_0x88f7('0x19'));var client=jayson[_0x88f7('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x1bb1d8,_0x12377b,_0x32de16){if(_0x32de16){var _0x4b23d1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4b23d1[_0x88f7('0x1b')](_0x12377b)){return _0x1bb1d8;}else{throw new db[(_0x88f7('0x1c'))][(_0x88f7('0x1d'))](_0x88f7('0x1e'));}}else{return _0x1bb1d8;}}function respondWithRpcPromise(_0x3a1179,_0x329338,_0x502f7b,_0x445ce3){return new BPromise(function(_0x5bb752,_0x14e8ee){var _0x57caba=_0x445ce3||client;return _0x57caba['request'](_0x3a1179,_0x502f7b)[_0x88f7('0x1f')](function(_0x59b540){logger[_0x88f7('0x20')](_0x88f7('0x21'),_0x329338,_0x88f7('0x22'));logger['debug'](_0x88f7('0x23'),_0x329338,'request\x20sent',JSON[_0x88f7('0x24')](_0x59b540));if(_0x59b540[_0x88f7('0x25')]){if(_0x59b540['error']['code']===0x1f4){logger[_0x88f7('0x25')](_0x88f7('0x21'),_0x329338,_0x59b540['error'][_0x88f7('0x26')]);return _0x14e8ee(_0x59b540[_0x88f7('0x25')][_0x88f7('0x26')]);}logger[_0x88f7('0x25')](_0x88f7('0x21'),_0x329338,_0x59b540[_0x88f7('0x25')][_0x88f7('0x26')]);return _0x5bb752(_0x59b540['error']['message']);}else{logger[_0x88f7('0x20')](_0x88f7('0x21'),_0x329338,_0x88f7('0x22'));_0x5bb752(_0x59b540[_0x88f7('0x27')][_0x88f7('0x26')]);}})['catch'](function(_0x56c197){logger[_0x88f7('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x329338,_0x56c197);_0x14e8ee(_0x56c197);});});}function respondWithStatusCode(_0x57d6da,_0x446933){_0x446933=_0x446933||0xcc;return function(_0x2ea65e){if(_0x2ea65e){return _0x57d6da['sendStatus'](_0x446933);}return _0x57d6da[_0x88f7('0x28')](_0x446933)[_0x88f7('0x29')]();};}function respondWithResult(_0x565c2b,_0x4576ab){_0x4576ab=_0x4576ab||0xc8;return function(_0x4c1d51){if(_0x4c1d51){return _0x565c2b[_0x88f7('0x28')](_0x4576ab)[_0x88f7('0x2a')](_0x4c1d51);}};}function respondWithFilteredResult(_0x3ec41d,_0x1f954f){return function(_0x1fc3bc){if(_0x1fc3bc){var _0x44da5a=_0x1fc3bc[_0x88f7('0x2b')],_0x29ca06=_0x1f954f[_0x88f7('0x2c')],_0x1cbdbb=_0x1f954f[_0x88f7('0x2c')]+_0x1f954f[_0x88f7('0x2d')],_0x3c7326;if(_0x1cbdbb>=_0x44da5a){_0x1cbdbb=_0x44da5a;_0x3c7326=0xc8;}else{_0x3c7326=0xce;}_0x3ec41d['status'](_0x3c7326);return _0x3ec41d['set'](_0x88f7('0x2e'),_0x29ca06+'-'+_0x1cbdbb+'/'+_0x44da5a)['json'](_0x1fc3bc);}return null;};}function patchUpdates(_0xf11da9){return function(_0x4c4bba){try{jsonpatch[_0x88f7('0x2f')](_0x4c4bba,_0xf11da9,!![]);}catch(_0x2641d5){return BPromise[_0x88f7('0x30')](_0x2641d5);}return _0x4c4bba['save']();};}function saveUpdates(_0x11e232,_0x17d100){return function(_0x2c0a4b){if(_0x2c0a4b){return _0x2c0a4b['update'](_0x11e232)[_0x88f7('0x1f')](function(_0x246857){return _0x246857;});}return null;};}function removeEntity(_0x1e2d36,_0x3a3591){return function(_0x2de780){if(_0x2de780){return _0x2de780[_0x88f7('0x31')]()[_0x88f7('0x1f')](function(){_0x1e2d36[_0x88f7('0x28')](0xcc)[_0x88f7('0x29')]();});}};}function handleEntityNotFound(_0xdc5483,_0x3069ad){return function(_0x3e23df){if(!_0x3e23df){_0xdc5483[_0x88f7('0x32')](0x194);}return _0x3e23df;};}function handleError(_0x5b9eae,_0x1c1617){_0x1c1617=_0x1c1617||0x1f4;return function(_0xc2b5ff){logger[_0x88f7('0x25')](_0xc2b5ff[_0x88f7('0x33')]);if(_0xc2b5ff[_0x88f7('0x34')]){delete _0xc2b5ff[_0x88f7('0x34')];}_0x5b9eae['status'](_0x1c1617)['send'](_0xc2b5ff);};}exports[_0x88f7('0x35')]=function(_0x28d0ed,_0x459e00){var _0x11a2a1={},_0x128468={},_0x4fb9c4={'count':0x0,'rows':[]};var _0x20707b=_[_0x88f7('0x36')](db[_0x88f7('0x37')][_0x88f7('0x38')],function(_0x4350cb){return{'name':_0x4350cb[_0x88f7('0x39')],'type':_0x4350cb[_0x88f7('0x3a')][_0x88f7('0x3b')]};});_0x128468[_0x88f7('0x3c')]=_['map'](_0x20707b,_0x88f7('0x34'));_0x128468['query']=_[_0x88f7('0x3d')](_0x28d0ed[_0x88f7('0x3e')]);_0x128468[_0x88f7('0x3f')]=_['intersection'](_0x128468[_0x88f7('0x3c')],_0x128468['query']);_0x11a2a1[_0x88f7('0x40')]=_[_0x88f7('0x41')](_0x128468[_0x88f7('0x3c')],qs[_0x88f7('0x42')](_0x28d0ed[_0x88f7('0x3e')][_0x88f7('0x42')]));_0x11a2a1[_0x88f7('0x40')]=_0x11a2a1[_0x88f7('0x40')][_0x88f7('0x43')]?_0x11a2a1[_0x88f7('0x40')]:_0x128468[_0x88f7('0x3c')];if(!_0x28d0ed['query'][_0x88f7('0x44')]('nolimit')){_0x11a2a1[_0x88f7('0x2d')]=qs[_0x88f7('0x2d')](_0x28d0ed[_0x88f7('0x3e')][_0x88f7('0x2d')]);_0x11a2a1['offset']=qs['offset'](_0x28d0ed[_0x88f7('0x3e')][_0x88f7('0x2c')]);}_0x11a2a1['order']=qs[_0x88f7('0x45')](_0x28d0ed[_0x88f7('0x3e')][_0x88f7('0x45')]);_0x11a2a1[_0x88f7('0x46')]=qs[_0x88f7('0x3f')](_['pick'](_0x28d0ed[_0x88f7('0x3e')],_0x128468[_0x88f7('0x3f')]));if(_0x28d0ed[_0x88f7('0x3e')][_0x88f7('0x47')]){_0x11a2a1[_0x88f7('0x46')]=_['merge'](_0x11a2a1['where'],{'$or':_[_0x88f7('0x36')](_0x20707b,function(_0xe65a32){if(_0xe65a32[_0x88f7('0x3a')]!==_0x88f7('0x48')){var _0x5f14c9={};_0x5f14c9[_0xe65a32['name']]={'$like':'%'+_0x28d0ed[_0x88f7('0x3e')][_0x88f7('0x47')]+'%'};return _0x5f14c9;}})});}_0x11a2a1=_[_0x88f7('0x49')]({},_0x11a2a1,_0x28d0ed[_0x88f7('0x4a')]);var _0x4f0c2f={'where':_0x11a2a1[_0x88f7('0x46')]};return db[_0x88f7('0x37')]['count'](_0x4f0c2f)[_0x88f7('0x1f')](function(_0x26f9f2){_0x4fb9c4[_0x88f7('0x2b')]=_0x26f9f2;if(_0x28d0ed[_0x88f7('0x3e')][_0x88f7('0x4b')]){_0x11a2a1[_0x88f7('0x4c')]=[{'all':!![]}];}return db[_0x88f7('0x37')][_0x88f7('0x4d')](_0x11a2a1);})[_0x88f7('0x1f')](function(_0x1a8220){_0x4fb9c4['rows']=_0x1a8220;return _0x4fb9c4;})[_0x88f7('0x1f')](respondWithFilteredResult(_0x459e00,_0x11a2a1))[_0x88f7('0x4e')](handleError(_0x459e00,null));};exports[_0x88f7('0x4f')]=function(_0x58f609,_0x7f9f8){var _0x17a967={'raw':![],'where':{'id':_0x58f609[_0x88f7('0x50')]['id']}},_0x5d7eb7={};_0x5d7eb7[_0x88f7('0x3c')]=_['keys'](db[_0x88f7('0x37')]['rawAttributes']);_0x5d7eb7[_0x88f7('0x3e')]=_[_0x88f7('0x3d')](_0x58f609[_0x88f7('0x3e')]);_0x5d7eb7[_0x88f7('0x3f')]=_[_0x88f7('0x41')](_0x5d7eb7['model'],_0x5d7eb7['query']);_0x17a967['attributes']=_['intersection'](_0x5d7eb7[_0x88f7('0x3c')],qs['fields'](_0x58f609[_0x88f7('0x3e')][_0x88f7('0x42')]));_0x17a967[_0x88f7('0x40')]=_0x17a967[_0x88f7('0x40')][_0x88f7('0x43')]?_0x17a967[_0x88f7('0x40')]:_0x5d7eb7[_0x88f7('0x3c')];if(_0x58f609[_0x88f7('0x3e')]['includeAll']){_0x17a967[_0x88f7('0x4c')]=[{'all':!![]}];}_0x17a967=_[_0x88f7('0x49')]({},_0x17a967,_0x58f609[_0x88f7('0x4a')]);return db['FreshdeskAccount']['find'](_0x17a967)[_0x88f7('0x1f')](handleEntityNotFound(_0x7f9f8,null))[_0x88f7('0x1f')](respondWithResult(_0x7f9f8,null))['catch'](handleError(_0x7f9f8,null));};exports[_0x88f7('0x51')]=function(_0x4142b5,_0x564979){return db['FreshdeskAccount'][_0x88f7('0x51')](_0x4142b5[_0x88f7('0x52')],{})[_0x88f7('0x1f')](respondWithResult(_0x564979,0xc9))[_0x88f7('0x4e')](handleError(_0x564979,null));};exports[_0x88f7('0x53')]=function(_0x44ddab,_0x28c0a5){if(_0x44ddab[_0x88f7('0x52')]['id']){delete _0x44ddab[_0x88f7('0x52')]['id'];}return db['FreshdeskAccount'][_0x88f7('0x54')]({'where':{'id':_0x44ddab['params']['id']}})[_0x88f7('0x1f')](handleEntityNotFound(_0x28c0a5,null))[_0x88f7('0x1f')](saveUpdates(_0x44ddab['body'],null))[_0x88f7('0x1f')](respondWithResult(_0x28c0a5,null))[_0x88f7('0x4e')](handleError(_0x28c0a5,null));};exports['destroy']=function(_0x45b61f,_0xd44015){return db[_0x88f7('0x37')][_0x88f7('0x54')]({'where':{'id':_0x45b61f[_0x88f7('0x50')]['id']}})[_0x88f7('0x1f')](handleEntityNotFound(_0xd44015,null))[_0x88f7('0x1f')](removeEntity(_0xd44015,null))['catch'](handleError(_0xd44015,null));};exports[_0x88f7('0x55')]=function(_0x29c395,_0x1163e1,_0x321884){var _0x184968={};var _0x4e46ba={};var _0x5114a9;var _0x11a5fb;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x29c395[_0x88f7('0x50')]['id']}})[_0x88f7('0x1f')](handleEntityNotFound(_0x1163e1,null))[_0x88f7('0x1f')](function(_0x159290){if(_0x159290){_0x5114a9=_0x159290;_0x4e46ba[_0x88f7('0x3c')]=_[_0x88f7('0x3d')](db['FreshdeskConfiguration'][_0x88f7('0x38')]);_0x4e46ba[_0x88f7('0x3e')]=_[_0x88f7('0x3d')](_0x29c395['query']);_0x4e46ba[_0x88f7('0x3f')]=_[_0x88f7('0x41')](_0x4e46ba[_0x88f7('0x3c')],_0x4e46ba['query']);_0x184968['attributes']=_['intersection'](_0x4e46ba['model'],qs[_0x88f7('0x42')](_0x29c395['query'][_0x88f7('0x42')]));_0x184968['attributes']=_0x184968[_0x88f7('0x40')][_0x88f7('0x43')]?_0x184968['attributes']:_0x4e46ba['model'];_0x184968[_0x88f7('0x56')]=qs[_0x88f7('0x45')](_0x29c395['query'][_0x88f7('0x45')]);_0x184968[_0x88f7('0x46')]=qs[_0x88f7('0x3f')](_['pick'](_0x29c395[_0x88f7('0x3e')],_0x4e46ba[_0x88f7('0x3f')]));if(_0x29c395[_0x88f7('0x3e')][_0x88f7('0x47')]){_0x184968[_0x88f7('0x46')]=_['merge'](_0x184968['where'],{'$or':_[_0x88f7('0x36')](_0x184968['attributes'],function(_0x310882){var _0x8c844a={};_0x8c844a[_0x310882]={'$like':'%'+_0x29c395[_0x88f7('0x3e')][_0x88f7('0x47')]+'%'};return _0x8c844a;})});}_0x184968=_[_0x88f7('0x49')]({},_0x184968,_0x29c395[_0x88f7('0x4a')]);return _0x5114a9[_0x88f7('0x55')](_0x184968);}})[_0x88f7('0x1f')](function(_0x4ba0f9){if(_0x4ba0f9){_0x11a5fb=_0x4ba0f9['length'];if(!_0x29c395['query'][_0x88f7('0x44')](_0x88f7('0x57'))){_0x184968[_0x88f7('0x2d')]=qs[_0x88f7('0x2d')](_0x29c395[_0x88f7('0x3e')][_0x88f7('0x2d')]);_0x184968[_0x88f7('0x2c')]=qs[_0x88f7('0x2c')](_0x29c395[_0x88f7('0x3e')][_0x88f7('0x2c')]);}return _0x5114a9[_0x88f7('0x55')](_0x184968);}})[_0x88f7('0x1f')](function(_0x93a9d6){if(_0x93a9d6){return _0x93a9d6?{'count':_0x11a5fb,'rows':_0x93a9d6}:null;}})[_0x88f7('0x1f')](respondWithResult(_0x1163e1,null))[_0x88f7('0x4e')](handleError(_0x1163e1,null));};exports[_0x88f7('0x58')]=function(_0x154807,_0x128e88,_0x58cf8b){if(_0x154807[_0x88f7('0x52')]['id']){delete _0x154807['body']['id'];}return db[_0x88f7('0x37')][_0x88f7('0x59')]({'where':{'id':_0x154807[_0x88f7('0x50')]['id']}})['then'](handleEntityNotFound(_0x128e88,null))[_0x88f7('0x1f')](function(_0x3ef059){if(_0x3ef059){_0x154807[_0x88f7('0x52')]['AccountId']=_0x3ef059['id'];_0x154807['body'][_0x88f7('0x5a')]=integrations[_0x88f7('0x5b')](_0x154807['body'][_0x88f7('0x5c')],_0x154807[_0x88f7('0x52')][_0x88f7('0x3a')]);_0x154807[_0x88f7('0x52')][_0x88f7('0x5d')]=integrations[_0x88f7('0x5e')](_0x154807[_0x88f7('0x52')][_0x88f7('0x5c')],_0x154807[_0x88f7('0x52')][_0x88f7('0x3a')]);return db['FreshdeskConfiguration'][_0x88f7('0x51')](_0x154807[_0x88f7('0x52')],{'include':[{'model':db[_0x88f7('0x5f')],'as':_0x88f7('0x5a')},{'model':db[_0x88f7('0x5f')],'as':'Descriptions'}]});}return null;})[_0x88f7('0x1f')](respondWithResult(_0x128e88,null))[_0x88f7('0x4e')](handleError(_0x128e88,null));};exports['getFields']=function(_0x565a88,_0x4f5266,_0xf90a73){var _0x4fa87c='';return db[_0x88f7('0x37')][_0x88f7('0x59')]({'where':{'id':_0x565a88[_0x88f7('0x50')]['id']},'attributes':['id',_0x88f7('0x60'),_0x88f7('0x61')]})[_0x88f7('0x1f')](handleEntityNotFound(_0x4f5266,null))[_0x88f7('0x1f')](function(_0x29650b){if(_0x29650b){_0x4fa87c=_0x29650b['remoteUri'];var _0x3fd399=_0x4fa87c['slice'](-0x1);if(_0x3fd399==='/'){_0x4fa87c=_0x4fa87c[_0x88f7('0x62')](0x0,_0x4fa87c[_0x88f7('0x63')](_0x3fd399));}return rp({'method':_0x88f7('0x64'),'uri':util[_0x88f7('0x65')](_0x88f7('0x66'),_0x4fa87c,_0x88f7('0x67')),'headers':{'Authorization':util[_0x88f7('0x65')](_0x88f7('0x68'),new Buffer(util['format'](_0x88f7('0x69'),_0x29650b[_0x88f7('0x61')]))[_0x88f7('0x6a')]('base64'))},'json':!![]});}})[_0x88f7('0x1f')](function(_0x2b0a08){if(_0x2b0a08){var _0x842c20=[_0x88f7('0x6b'),_0x88f7('0x6c'),_0x88f7('0x6d'),_0x88f7('0x6e'),'status',_0x88f7('0x6f'),_0x88f7('0x70'),_0x88f7('0x71'),_0x88f7('0x72'),_0x88f7('0x70'),_0x88f7('0x73')];_['remove'](_0x2b0a08,function(_0x303a03){return _0x842c20[_0x88f7('0x74')](_0x303a03[_0x88f7('0x34')])||!_0x303a03['default']&&_0x303a03['type']!==_0x88f7('0x75')&&_0x303a03[_0x88f7('0x3a')]!=='custom_dropdown';});return{'count':_0x2b0a08[_0x88f7('0x43')],'rows':_[_0x88f7('0x36')](_0x2b0a08,function(_0x5126d7){return{'id':_0x5126d7[_0x88f7('0x34')],'name':_0x5126d7[_0x88f7('0x76')],'custom':!_0x5126d7[_0x88f7('0x77')],'options':_0x5126d7[_0x88f7('0x78')]?_[_0x88f7('0x36')](_0x5126d7[_0x88f7('0x78')],function(_0x318b95){return{'name':_[_0x88f7('0x79')](_0x318b95),'value':_0x318b95};}):[]};})};}})[_0x88f7('0x1f')](respondWithResult(_0x4f5266,null))[_0x88f7('0x4e')](function(_0x38b51c){var _0x2f5300=_0x565a88[_0x88f7('0x3e')]['test']?0x1f4:_0x38b51c[_0x88f7('0x7a')]||0x1f4;logger[_0x88f7('0x25')](_0x88f7('0x7b'),_0x88f7('0x7c'),_0x2f5300,JSON[_0x88f7('0x24')](_0x38b51c));delete _0x38b51c['name'];if(_0x2f5300===0x191){_0x2f5300=0x190;}_0x4f5266[_0x88f7('0x28')](_0x2f5300)[_0x88f7('0x7d')](_0x565a88[_0x88f7('0x3e')][_0x88f7('0x1b')]?{'message':_0x88f7('0x7e'),'statusCode':_0x38b51c[_0x88f7('0x7a')]}:_0x38b51c);});}; \ No newline at end of file +var _0xd711=['reject','save','update','destroy','stack','name','send','index','map','FreshdeskAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','params','rawAttributes','include','find','catch','create','body','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','FreshdeskField','Descriptions','getFields','apiKey','remoteUri','slice','substring','GET','format','%s/%s','Basic\x20%s','%s:X','toString','base64','subject','agent','description','priority','group','source','ticket_type','remove','includes','default','custom_text','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','count','limit','Content-Range'];(function(_0x31efdd,_0x2fbeb9){var _0x2d7451=function(_0x48e34e){while(--_0x48e34e){_0x31efdd['push'](_0x31efdd['shift']());}};_0x2d7451(++_0x2fbeb9);}(_0xd711,0x1c1));var _0x1d71=function(_0x5fe239,_0xdac45d){_0x5fe239=_0x5fe239-0x0;var _0x54bafc=_0xd711[_0x5fe239];return _0x54bafc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1d71('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d71('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1d71('0x2'));var BPromise=require(_0x1d71('0x3'));var Mustache=require(_0x1d71('0x4'));var util=require(_0x1d71('0x5'));var path=require(_0x1d71('0x6'));var sox=require(_0x1d71('0x7'));var csv=require('to-csv');var ejs=require(_0x1d71('0x8'));var fs=require('fs');var _=require(_0x1d71('0x9'));var squel=require(_0x1d71('0xa'));var crypto=require(_0x1d71('0xb'));var jsforce=require(_0x1d71('0xc'));var deskjs=require(_0x1d71('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1d71('0xe'));var authService=require(_0x1d71('0xf'));var qs=require(_0x1d71('0x10'));var as=require(_0x1d71('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d71('0x12'))(_0x1d71('0x13'));var utils=require(_0x1d71('0x14'));var config=require('../../config/environment');var db=require(_0x1d71('0x15'))['db'];var integrations=require(_0x1d71('0x16'));var jayson=require(_0x1d71('0x17'));var client=jayson[_0x1d71('0x18')][_0x1d71('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2dc5b4,_0x2456ba,_0x2355ee){if(_0x2355ee){var _0x2916bf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2916bf[_0x1d71('0x1a')](_0x2456ba)){return _0x2dc5b4;}else{throw new db[(_0x1d71('0x1b'))][(_0x1d71('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2dc5b4;}}function respondWithRpcPromise(_0x2506f6,_0x547e19,_0x3e8a33,_0x33d9e3){return new BPromise(function(_0x27a4c6,_0x21067f){var _0x2d5b69=_0x33d9e3||client;return _0x2d5b69[_0x1d71('0x1d')](_0x2506f6,_0x3e8a33)[_0x1d71('0x1e')](function(_0xd91a1c){logger[_0x1d71('0x1f')](_0x1d71('0x20'),_0x547e19,'request\x20sent');logger[_0x1d71('0x21')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x547e19,_0x1d71('0x22'),JSON[_0x1d71('0x23')](_0xd91a1c));if(_0xd91a1c[_0x1d71('0x24')]){if(_0xd91a1c['error'][_0x1d71('0x25')]===0x1f4){logger[_0x1d71('0x24')](_0x1d71('0x20'),_0x547e19,_0xd91a1c[_0x1d71('0x24')][_0x1d71('0x26')]);return _0x21067f(_0xd91a1c['error'][_0x1d71('0x26')]);}logger[_0x1d71('0x24')](_0x1d71('0x20'),_0x547e19,_0xd91a1c[_0x1d71('0x24')][_0x1d71('0x26')]);return _0x27a4c6(_0xd91a1c[_0x1d71('0x24')][_0x1d71('0x26')]);}else{logger[_0x1d71('0x1f')](_0x1d71('0x20'),_0x547e19,_0x1d71('0x22'));_0x27a4c6(_0xd91a1c[_0x1d71('0x27')][_0x1d71('0x26')]);}})['catch'](function(_0x4c9053){logger[_0x1d71('0x24')]('FreshdeskAccount,\x20%s,\x20%s',_0x547e19,_0x4c9053);_0x21067f(_0x4c9053);});});}function respondWithStatusCode(_0x4632cf,_0x21f269){_0x21f269=_0x21f269||0xcc;return function(_0x320b6c){if(_0x320b6c){return _0x4632cf[_0x1d71('0x28')](_0x21f269);}return _0x4632cf[_0x1d71('0x29')](_0x21f269)[_0x1d71('0x2a')]();};}function respondWithResult(_0x40dcdd,_0x15aaeb){_0x15aaeb=_0x15aaeb||0xc8;return function(_0x26b27a){if(_0x26b27a){return _0x40dcdd['status'](_0x15aaeb)[_0x1d71('0x2b')](_0x26b27a);}};}function respondWithFilteredResult(_0x22f954,_0x5f54d9){return function(_0x462a0d){if(_0x462a0d){var _0x42414e=_0x462a0d[_0x1d71('0x2c')],_0x185192=_0x5f54d9['offset'],_0x373770=_0x5f54d9['offset']+_0x5f54d9[_0x1d71('0x2d')],_0xc7b815;if(_0x373770>=_0x42414e){_0x373770=_0x42414e;_0xc7b815=0xc8;}else{_0xc7b815=0xce;}_0x22f954[_0x1d71('0x29')](_0xc7b815);return _0x22f954['set'](_0x1d71('0x2e'),_0x185192+'-'+_0x373770+'/'+_0x42414e)['json'](_0x462a0d);}return null;};}function patchUpdates(_0x4c8221){return function(_0x25b187){try{jsonpatch['apply'](_0x25b187,_0x4c8221,!![]);}catch(_0xc3989){return BPromise[_0x1d71('0x2f')](_0xc3989);}return _0x25b187[_0x1d71('0x30')]();};}function saveUpdates(_0x401bba,_0x3c826e){return function(_0x36b57c){if(_0x36b57c){return _0x36b57c[_0x1d71('0x31')](_0x401bba)[_0x1d71('0x1e')](function(_0x1c6f26){return _0x1c6f26;});}return null;};}function removeEntity(_0x55b9b9,_0x78a31c){return function(_0x26d1d2){if(_0x26d1d2){return _0x26d1d2[_0x1d71('0x32')]()[_0x1d71('0x1e')](function(){_0x55b9b9[_0x1d71('0x29')](0xcc)[_0x1d71('0x2a')]();});}};}function handleEntityNotFound(_0x4b25e9,_0x2daf37){return function(_0x54f347){if(!_0x54f347){_0x4b25e9[_0x1d71('0x28')](0x194);}return _0x54f347;};}function handleError(_0x56bf92,_0x3ef5da){_0x3ef5da=_0x3ef5da||0x1f4;return function(_0x49ee78){logger[_0x1d71('0x24')](_0x49ee78[_0x1d71('0x33')]);if(_0x49ee78[_0x1d71('0x34')]){delete _0x49ee78[_0x1d71('0x34')];}_0x56bf92['status'](_0x3ef5da)[_0x1d71('0x35')](_0x49ee78);};}exports[_0x1d71('0x36')]=function(_0x50ddce,_0x145966){var _0x1c2b44={},_0x3950d1={},_0x1b1cd0={'count':0x0,'rows':[]};var _0x2d85a3=_[_0x1d71('0x37')](db[_0x1d71('0x38')]['rawAttributes'],function(_0x2e7b1a){return{'name':_0x2e7b1a[_0x1d71('0x39')],'type':_0x2e7b1a[_0x1d71('0x3a')][_0x1d71('0x3b')]};});_0x3950d1[_0x1d71('0x3c')]=_[_0x1d71('0x37')](_0x2d85a3,_0x1d71('0x34'));_0x3950d1[_0x1d71('0x3d')]=_[_0x1d71('0x3e')](_0x50ddce[_0x1d71('0x3d')]);_0x3950d1[_0x1d71('0x3f')]=_[_0x1d71('0x40')](_0x3950d1['model'],_0x3950d1[_0x1d71('0x3d')]);_0x1c2b44[_0x1d71('0x41')]=_[_0x1d71('0x40')](_0x3950d1[_0x1d71('0x3c')],qs[_0x1d71('0x42')](_0x50ddce[_0x1d71('0x3d')][_0x1d71('0x42')]));_0x1c2b44[_0x1d71('0x41')]=_0x1c2b44['attributes'][_0x1d71('0x43')]?_0x1c2b44[_0x1d71('0x41')]:_0x3950d1['model'];if(!_0x50ddce[_0x1d71('0x3d')][_0x1d71('0x44')](_0x1d71('0x45'))){_0x1c2b44[_0x1d71('0x2d')]=qs['limit'](_0x50ddce[_0x1d71('0x3d')][_0x1d71('0x2d')]);_0x1c2b44[_0x1d71('0x46')]=qs[_0x1d71('0x46')](_0x50ddce[_0x1d71('0x3d')][_0x1d71('0x46')]);}_0x1c2b44[_0x1d71('0x47')]=qs['sort'](_0x50ddce[_0x1d71('0x3d')]['sort']);_0x1c2b44[_0x1d71('0x48')]=qs[_0x1d71('0x3f')](_[_0x1d71('0x49')](_0x50ddce[_0x1d71('0x3d')],_0x3950d1[_0x1d71('0x3f')]));if(_0x50ddce[_0x1d71('0x3d')]['filter']){_0x1c2b44[_0x1d71('0x48')]=_[_0x1d71('0x4a')](_0x1c2b44['where'],{'$or':_[_0x1d71('0x37')](_0x2d85a3,function(_0x4cbb67){if(_0x4cbb67['type']!==_0x1d71('0x4b')){var _0x28a462={};_0x28a462[_0x4cbb67[_0x1d71('0x34')]]={'$like':'%'+_0x50ddce[_0x1d71('0x3d')][_0x1d71('0x4c')]+'%'};return _0x28a462;}})});}_0x1c2b44=_[_0x1d71('0x4a')]({},_0x1c2b44,_0x50ddce[_0x1d71('0x4d')]);var _0x37818f={'where':_0x1c2b44['where']};return db['FreshdeskAccount'][_0x1d71('0x2c')](_0x37818f)['then'](function(_0x124c5a){_0x1b1cd0[_0x1d71('0x2c')]=_0x124c5a;if(_0x50ddce[_0x1d71('0x3d')][_0x1d71('0x4e')]){_0x1c2b44['include']=[{'all':!![]}];}return db[_0x1d71('0x38')]['findAll'](_0x1c2b44);})['then'](function(_0xf1ab9b){_0x1b1cd0[_0x1d71('0x4f')]=_0xf1ab9b;return _0x1b1cd0;})[_0x1d71('0x1e')](respondWithFilteredResult(_0x145966,_0x1c2b44))['catch'](handleError(_0x145966,null));};exports['show']=function(_0x563d4a,_0x311d08){var _0x212e6c={'raw':![],'where':{'id':_0x563d4a[_0x1d71('0x50')]['id']}},_0x5a7b46={};_0x5a7b46[_0x1d71('0x3c')]=_['keys'](db[_0x1d71('0x38')][_0x1d71('0x51')]);_0x5a7b46[_0x1d71('0x3d')]=_['keys'](_0x563d4a['query']);_0x5a7b46['filters']=_[_0x1d71('0x40')](_0x5a7b46['model'],_0x5a7b46[_0x1d71('0x3d')]);_0x212e6c[_0x1d71('0x41')]=_[_0x1d71('0x40')](_0x5a7b46[_0x1d71('0x3c')],qs[_0x1d71('0x42')](_0x563d4a[_0x1d71('0x3d')][_0x1d71('0x42')]));_0x212e6c[_0x1d71('0x41')]=_0x212e6c[_0x1d71('0x41')][_0x1d71('0x43')]?_0x212e6c[_0x1d71('0x41')]:_0x5a7b46[_0x1d71('0x3c')];if(_0x563d4a[_0x1d71('0x3d')][_0x1d71('0x4e')]){_0x212e6c[_0x1d71('0x52')]=[{'all':!![]}];}_0x212e6c=_[_0x1d71('0x4a')]({},_0x212e6c,_0x563d4a[_0x1d71('0x4d')]);return db[_0x1d71('0x38')][_0x1d71('0x53')](_0x212e6c)['then'](handleEntityNotFound(_0x311d08,null))[_0x1d71('0x1e')](respondWithResult(_0x311d08,null))[_0x1d71('0x54')](handleError(_0x311d08,null));};exports[_0x1d71('0x55')]=function(_0x17868c,_0x122444){return db['FreshdeskAccount'][_0x1d71('0x55')](_0x17868c[_0x1d71('0x56')],{})[_0x1d71('0x1e')](respondWithResult(_0x122444,0xc9))[_0x1d71('0x54')](handleError(_0x122444,null));};exports[_0x1d71('0x31')]=function(_0x1f1963,_0x57e44a){if(_0x1f1963['body']['id']){delete _0x1f1963['body']['id'];}return db[_0x1d71('0x38')][_0x1d71('0x53')]({'where':{'id':_0x1f1963[_0x1d71('0x50')]['id']}})[_0x1d71('0x1e')](handleEntityNotFound(_0x57e44a,null))[_0x1d71('0x1e')](saveUpdates(_0x1f1963['body'],null))['then'](respondWithResult(_0x57e44a,null))[_0x1d71('0x54')](handleError(_0x57e44a,null));};exports['destroy']=function(_0x4f2a27,_0x1f2987){return db['FreshdeskAccount'][_0x1d71('0x53')]({'where':{'id':_0x4f2a27[_0x1d71('0x50')]['id']}})[_0x1d71('0x1e')](handleEntityNotFound(_0x1f2987,null))['then'](removeEntity(_0x1f2987,null))[_0x1d71('0x54')](handleError(_0x1f2987,null));};exports[_0x1d71('0x57')]=function(_0x475180,_0x25c1e9,_0x5eb612){var _0x5d2d12={};var _0x57f99d={};var _0xb03f51;var _0x50342c;return db[_0x1d71('0x38')][_0x1d71('0x58')]({'where':{'id':_0x475180['params']['id']}})[_0x1d71('0x1e')](handleEntityNotFound(_0x25c1e9,null))[_0x1d71('0x1e')](function(_0x5b0740){if(_0x5b0740){_0xb03f51=_0x5b0740;_0x57f99d[_0x1d71('0x3c')]=_[_0x1d71('0x3e')](db[_0x1d71('0x59')][_0x1d71('0x51')]);_0x57f99d[_0x1d71('0x3d')]=_['keys'](_0x475180[_0x1d71('0x3d')]);_0x57f99d[_0x1d71('0x3f')]=_[_0x1d71('0x40')](_0x57f99d[_0x1d71('0x3c')],_0x57f99d['query']);_0x5d2d12[_0x1d71('0x41')]=_['intersection'](_0x57f99d[_0x1d71('0x3c')],qs[_0x1d71('0x42')](_0x475180[_0x1d71('0x3d')]['fields']));_0x5d2d12['attributes']=_0x5d2d12[_0x1d71('0x41')]['length']?_0x5d2d12[_0x1d71('0x41')]:_0x57f99d[_0x1d71('0x3c')];_0x5d2d12[_0x1d71('0x47')]=qs['sort'](_0x475180[_0x1d71('0x3d')]['sort']);_0x5d2d12[_0x1d71('0x48')]=qs['filters'](_[_0x1d71('0x49')](_0x475180[_0x1d71('0x3d')],_0x57f99d[_0x1d71('0x3f')]));if(_0x475180[_0x1d71('0x3d')][_0x1d71('0x4c')]){_0x5d2d12['where']=_[_0x1d71('0x4a')](_0x5d2d12[_0x1d71('0x48')],{'$or':_[_0x1d71('0x37')](_0x5d2d12[_0x1d71('0x41')],function(_0x51e8d4){var _0x1d02fe={};_0x1d02fe[_0x51e8d4]={'$like':'%'+_0x475180[_0x1d71('0x3d')][_0x1d71('0x4c')]+'%'};return _0x1d02fe;})});}_0x5d2d12=_[_0x1d71('0x4a')]({},_0x5d2d12,_0x475180['options']);return _0xb03f51[_0x1d71('0x57')](_0x5d2d12);}})['then'](function(_0x4a254d){if(_0x4a254d){_0x50342c=_0x4a254d[_0x1d71('0x43')];if(!_0x475180[_0x1d71('0x3d')][_0x1d71('0x44')](_0x1d71('0x45'))){_0x5d2d12['limit']=qs[_0x1d71('0x2d')](_0x475180[_0x1d71('0x3d')][_0x1d71('0x2d')]);_0x5d2d12[_0x1d71('0x46')]=qs['offset'](_0x475180['query'][_0x1d71('0x46')]);}return _0xb03f51['getConfigurations'](_0x5d2d12);}})[_0x1d71('0x1e')](function(_0x3e6d4f){if(_0x3e6d4f){return _0x3e6d4f?{'count':_0x50342c,'rows':_0x3e6d4f}:null;}})['then'](respondWithResult(_0x25c1e9,null))[_0x1d71('0x54')](handleError(_0x25c1e9,null));};exports[_0x1d71('0x5a')]=function(_0x4e8ef9,_0x1f6ba0,_0x263e0d){if(_0x4e8ef9[_0x1d71('0x56')]['id']){delete _0x4e8ef9[_0x1d71('0x56')]['id'];}return db[_0x1d71('0x38')][_0x1d71('0x58')]({'where':{'id':_0x4e8ef9['params']['id']}})['then'](handleEntityNotFound(_0x1f6ba0,null))[_0x1d71('0x1e')](function(_0x277f65){if(_0x277f65){_0x4e8ef9['body'][_0x1d71('0x5b')]=_0x277f65['id'];_0x4e8ef9[_0x1d71('0x56')][_0x1d71('0x5c')]=integrations[_0x1d71('0x5d')](_0x4e8ef9['body'][_0x1d71('0x5e')],_0x4e8ef9['body']['type']);_0x4e8ef9['body']['Descriptions']=integrations['getDescriptions'](_0x4e8ef9['body'][_0x1d71('0x5e')],_0x4e8ef9[_0x1d71('0x56')][_0x1d71('0x3a')]);return db['FreshdeskConfiguration']['create'](_0x4e8ef9[_0x1d71('0x56')],{'include':[{'model':db[_0x1d71('0x5f')],'as':_0x1d71('0x5c')},{'model':db[_0x1d71('0x5f')],'as':_0x1d71('0x60')}]});}return null;})[_0x1d71('0x1e')](respondWithResult(_0x1f6ba0,null))[_0x1d71('0x54')](handleError(_0x1f6ba0,null));};exports[_0x1d71('0x61')]=function(_0x21e338,_0x193a9f,_0x1dde5c){var _0x10d91c='';return db[_0x1d71('0x38')][_0x1d71('0x58')]({'where':{'id':_0x21e338[_0x1d71('0x50')]['id']},'attributes':['id','remoteUri',_0x1d71('0x62')]})[_0x1d71('0x1e')](handleEntityNotFound(_0x193a9f,null))[_0x1d71('0x1e')](function(_0x46e212){if(_0x46e212){_0x10d91c=_0x46e212[_0x1d71('0x63')];var _0x30f61f=_0x10d91c[_0x1d71('0x64')](-0x1);if(_0x30f61f==='/'){_0x10d91c=_0x10d91c[_0x1d71('0x65')](0x0,_0x10d91c['lastIndexOf'](_0x30f61f));}return rp({'method':_0x1d71('0x66'),'uri':util[_0x1d71('0x67')](_0x1d71('0x68'),_0x10d91c,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x1d71('0x67')](_0x1d71('0x69'),new Buffer(util[_0x1d71('0x67')](_0x1d71('0x6a'),_0x46e212[_0x1d71('0x62')]))[_0x1d71('0x6b')](_0x1d71('0x6c')))},'json':!![]});}})['then'](function(_0x485758){if(_0x485758){var _0x3dee3d=['requester',_0x1d71('0x6d'),_0x1d71('0x6e'),_0x1d71('0x6f'),_0x1d71('0x29'),_0x1d71('0x70'),_0x1d71('0x71'),_0x1d71('0x72'),_0x1d71('0x73'),_0x1d71('0x71'),'company'];_[_0x1d71('0x74')](_0x485758,function(_0x536402){return _0x3dee3d[_0x1d71('0x75')](_0x536402[_0x1d71('0x34')])||!_0x536402[_0x1d71('0x76')]&&_0x536402['type']!==_0x1d71('0x77')&&_0x536402[_0x1d71('0x3a')]!=='custom_dropdown';});return{'count':_0x485758[_0x1d71('0x43')],'rows':_[_0x1d71('0x37')](_0x485758,function(_0x43e532){return{'id':_0x43e532[_0x1d71('0x34')],'name':_0x43e532['label'],'custom':!_0x43e532[_0x1d71('0x76')],'options':_0x43e532[_0x1d71('0x78')]?_[_0x1d71('0x37')](_0x43e532[_0x1d71('0x78')],function(_0x396dbc){return{'name':_['capitalize'](_0x396dbc),'value':_0x396dbc};}):[]};})};}})[_0x1d71('0x1e')](respondWithResult(_0x193a9f,null))['catch'](function(_0x5dfccb){var _0x57f014=_0x21e338[_0x1d71('0x3d')][_0x1d71('0x1a')]?0x1f4:_0x5dfccb[_0x1d71('0x79')]||0x1f4;logger[_0x1d71('0x24')](_0x1d71('0x7a'),_0x1d71('0x61'),_0x57f014,JSON[_0x1d71('0x23')](_0x5dfccb));delete _0x5dfccb[_0x1d71('0x34')];if(_0x57f014===0x191){_0x57f014=0x190;}_0x193a9f[_0x1d71('0x29')](_0x57f014)[_0x1d71('0x35')](_0x21e338[_0x1d71('0x3d')][_0x1d71('0x1a')]?{'message':_0x1d71('0x7b'),'statusCode':_0x5dfccb[_0x1d71('0x79')]}:_0x5dfccb);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index d4810ca..6aad876 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 _0x4588=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0x4588,0x9c));var _0x8458=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x4588[_0x2080a3];return _0x8d7d17;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8458('0x0'))(_0x8458('0x1'));var moment=require('moment');var BPromise=require(_0x8458('0x2'));var rp=require(_0x8458('0x3'));var fs=require('fs');var path=require(_0x8458('0x4'));var rimraf=require(_0x8458('0x5'));var config=require(_0x8458('0x6'));var attributes=require(_0x8458('0x7'));var integrations=require(_0x8458('0x8'));module[_0x8458('0x9')]=function(_0x4396dd,_0x1e1c69){return _0x4396dd[_0x8458('0xa')](_0x8458('0xb'),attributes,{'tableName':_0x8458('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9064=['exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0x9064,0x74));var _0x4906=function(_0x531183,_0x38cf58){_0x531183=_0x531183-0x0;var _0x4f9205=_0x9064[_0x531183];return _0x4f9205;};'use strict';var _=require(_0x4906('0x0'));var util=require(_0x4906('0x1'));var logger=require(_0x4906('0x2'))(_0x4906('0x3'));var moment=require(_0x4906('0x4'));var BPromise=require(_0x4906('0x5'));var rp=require(_0x4906('0x6'));var fs=require('fs');var path=require(_0x4906('0x7'));var rimraf=require('rimraf');var config=require(_0x4906('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x4906('0x9'));module[_0x4906('0xa')]=function(_0x4e2159,_0x1bfda9){return _0x4e2159[_0x4906('0xb')](_0x4906('0xc'),attributes,{'tableName':_0x4906('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 64cf168..d26a69d 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 _0x23ea=['debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowFreshdeskAccount','find','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x23ea,0x197));var _0xa23e=function(_0x270a02,_0x223adb){_0x270a02=_0x270a02-0x0;var _0x3cd07b=_0x23ea[_0x270a02];return _0x3cd07b;};'use strict';var _=require('lodash');var util=require(_0xa23e('0x0'));var moment=require(_0xa23e('0x1'));var BPromise=require(_0xa23e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa23e('0x3'));var logger=require(_0xa23e('0x4'))(_0xa23e('0x5'));var config=require(_0xa23e('0x6'));var jayson=require(_0xa23e('0x7'));var client=jayson[_0xa23e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7d5c4d,_0x599ebe,_0x19524f){return new BPromise(function(_0x139dab,_0x43cddd){return client[_0xa23e('0x9')](_0x7d5c4d,_0x19524f)[_0xa23e('0xa')](function(_0x4194fe){logger[_0xa23e('0xb')](_0xa23e('0xc'),_0x599ebe,'request\x20sent');logger[_0xa23e('0xd')](_0xa23e('0xe'),_0x599ebe,_0xa23e('0xf'),JSON[_0xa23e('0x10')](_0x4194fe));if(_0x4194fe[_0xa23e('0x11')]){if(_0x4194fe[_0xa23e('0x11')][_0xa23e('0x12')]===0x1f4){logger[_0xa23e('0x11')](_0xa23e('0xc'),_0x599ebe,_0x4194fe[_0xa23e('0x11')][_0xa23e('0x13')]);return _0x43cddd(_0x4194fe[_0xa23e('0x11')][_0xa23e('0x13')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x599ebe,_0x4194fe[_0xa23e('0x11')][_0xa23e('0x13')]);return _0x139dab(_0x4194fe[_0xa23e('0x11')]['message']);}else{logger[_0xa23e('0xb')](_0xa23e('0xc'),_0x599ebe,_0xa23e('0xf'));_0x139dab(_0x4194fe[_0xa23e('0x14')][_0xa23e('0x13')]);}})[_0xa23e('0x15')](function(_0x5b652e){logger[_0xa23e('0x11')](_0xa23e('0xc'),_0x599ebe,_0x5b652e);_0x43cddd(_0x5b652e);});});}exports[_0xa23e('0x16')]=function(_0x5e3774){var _0x2be3e7=this;return new Promise(function(_0x5551f1,_0x4c3f3d){return db[_0xa23e('0x17')][_0xa23e('0x18')]({'raw':_0x5e3774[_0xa23e('0x19')]?_0x5e3774[_0xa23e('0x19')][_0xa23e('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e3774['options']?_0x5e3774[_0xa23e('0x19')][_0xa23e('0x1b')]||null:null,'attributes':_0x5e3774['options']?_0x5e3774[_0xa23e('0x19')][_0xa23e('0x1c')]||null:null,'limit':_0x5e3774[_0xa23e('0x19')]?_0x5e3774['options'][_0xa23e('0x1d')]||null:null,'include':_0x5e3774[_0xa23e('0x19')]?_0x5e3774['options'][_0xa23e('0x1e')]?_['map'](_0x5e3774[_0xa23e('0x19')][_0xa23e('0x1e')],function(_0x5139dd){return{'model':db[_0x5139dd[_0xa23e('0x1f')]],'as':_0x5139dd['as'],'attributes':_0x5139dd[_0xa23e('0x1c')],'include':_0x5139dd[_0xa23e('0x1e')]?_[_0xa23e('0x20')](_0x5139dd[_0xa23e('0x1e')],function(_0x4b5a35){return{'model':db[_0x4b5a35[_0xa23e('0x1f')]],'as':_0x4b5a35['as'],'attributes':_0x4b5a35['attributes'],'include':_0x4b5a35[_0xa23e('0x1e')]?_[_0xa23e('0x20')](_0x4b5a35[_0xa23e('0x1e')],function(_0x3095ab){return{'model':db[_0x3095ab[_0xa23e('0x1f')]],'as':_0x3095ab['as'],'attributes':_0x3095ab[_0xa23e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x299db8){logger[_0xa23e('0xb')](_0xa23e('0x16'),_0x5e3774);logger[_0xa23e('0xd')]('GetFreshdeskAccount',_0x5e3774,JSON['stringify'](_0x299db8));_0x5551f1(_0x299db8);})[_0xa23e('0x15')](function(_0x4fc3de){logger[_0xa23e('0x11')](_0xa23e('0x16'),_0x4fc3de[_0xa23e('0x13')],_0x5e3774);_0x4c3f3d(_0x2be3e7[_0xa23e('0x11')](0x1f4,_0x4fc3de[_0xa23e('0x13')]));});});};exports[_0xa23e('0x21')]=function(_0x5db6bc){var _0x29f3dd=this;return new Promise(function(_0x165400,_0x56fe9a){return db[_0xa23e('0x17')][_0xa23e('0x22')]({'raw':_0x5db6bc['options']?_0x5db6bc[_0xa23e('0x19')][_0xa23e('0x1a')]===undefined?!![]:![]:!![],'where':_0x5db6bc[_0xa23e('0x19')]?_0x5db6bc[_0xa23e('0x19')][_0xa23e('0x1b')]||null:null,'attributes':_0x5db6bc[_0xa23e('0x19')]?_0x5db6bc['options'][_0xa23e('0x1c')]||null:null,'include':_0x5db6bc[_0xa23e('0x19')]?_0x5db6bc['options'][_0xa23e('0x1e')]?_[_0xa23e('0x20')](_0x5db6bc[_0xa23e('0x19')][_0xa23e('0x1e')],function(_0x3d5338){return{'model':db[_0x3d5338[_0xa23e('0x1f')]],'as':_0x3d5338['as'],'attributes':_0x3d5338[_0xa23e('0x1c')],'include':_0x3d5338[_0xa23e('0x1e')]?_[_0xa23e('0x20')](_0x3d5338['include'],function(_0x27e56e){return{'model':db[_0x27e56e[_0xa23e('0x1f')]],'as':_0x27e56e['as'],'attributes':_0x27e56e[_0xa23e('0x1c')],'include':_0x27e56e[_0xa23e('0x1e')]?_[_0xa23e('0x20')](_0x27e56e[_0xa23e('0x1e')],function(_0x51bfde){return{'model':db[_0x51bfde[_0xa23e('0x1f')]],'as':_0x51bfde['as'],'attributes':_0x51bfde[_0xa23e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa23e('0xa')](function(_0x4871e6){logger[_0xa23e('0xb')](_0xa23e('0x21'),_0x5db6bc);logger[_0xa23e('0xd')]('ShowFreshdeskAccount',_0x5db6bc,JSON[_0xa23e('0x10')](_0x4871e6));_0x165400(_0x4871e6);})['catch'](function(_0x47f96a){logger[_0xa23e('0x11')](_0xa23e('0x21'),_0x47f96a[_0xa23e('0x13')],_0x5db6bc);_0x56fe9a(_0x29f3dd[_0xa23e('0x11')](0x1f4,_0x47f96a['message']));});});}; \ No newline at end of file +var _0x3209=['request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FreshdeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','then','GetFreshdeskAccount','catch','ShowFreshdeskAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x1e651f,_0x4f0602){var _0x26a501=function(_0x353245){while(--_0x353245){_0x1e651f['push'](_0x1e651f['shift']());}};_0x26a501(++_0x4f0602);}(_0x3209,0x13f));var _0x9320=function(_0x42e78c,_0x516329){_0x42e78c=_0x42e78c-0x0;var _0x5dba9e=_0x3209[_0x42e78c];return _0x5dba9e;};'use strict';var _=require(_0x9320('0x0'));var util=require(_0x9320('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9320('0x2'));var fs=require('fs');var Redis=require(_0x9320('0x3'));var db=require(_0x9320('0x4'))['db'];var utils=require(_0x9320('0x5'));var logger=require('../../config/logger')(_0x9320('0x6'));var config=require(_0x9320('0x7'));var jayson=require(_0x9320('0x8'));var client=jayson[_0x9320('0x9')][_0x9320('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1791f2,_0x4bde0c,_0xf00cb4){return new BPromise(function(_0x55b2ce,_0xc1875c){return client[_0x9320('0xb')](_0x1791f2,_0xf00cb4)['then'](function(_0x6362cb){logger[_0x9320('0xc')](_0x9320('0xd'),_0x4bde0c,_0x9320('0xe'));logger[_0x9320('0xf')](_0x9320('0x10'),_0x4bde0c,_0x9320('0xe'),JSON[_0x9320('0x11')](_0x6362cb));if(_0x6362cb[_0x9320('0x12')]){if(_0x6362cb[_0x9320('0x12')][_0x9320('0x13')]===0x1f4){logger[_0x9320('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x4bde0c,_0x6362cb[_0x9320('0x12')][_0x9320('0x14')]);return _0xc1875c(_0x6362cb[_0x9320('0x12')]['message']);}logger[_0x9320('0x12')](_0x9320('0xd'),_0x4bde0c,_0x6362cb[_0x9320('0x12')]['message']);return _0x55b2ce(_0x6362cb['error']['message']);}else{logger['info'](_0x9320('0xd'),_0x4bde0c,_0x9320('0xe'));_0x55b2ce(_0x6362cb[_0x9320('0x15')]['message']);}})['catch'](function(_0x5cc1b3){logger['error'](_0x9320('0xd'),_0x4bde0c,_0x5cc1b3);_0xc1875c(_0x5cc1b3);});});}exports['GetFreshdeskAccount']=function(_0x59e7ac){var _0x350f9d=this;return new Promise(function(_0x1f6f5e,_0x32e2ba){return db[_0x9320('0x16')][_0x9320('0x17')]({'raw':_0x59e7ac[_0x9320('0x18')]?_0x59e7ac[_0x9320('0x18')][_0x9320('0x19')]===undefined?!![]:![]:!![],'where':_0x59e7ac[_0x9320('0x18')]?_0x59e7ac[_0x9320('0x18')][_0x9320('0x1a')]||null:null,'attributes':_0x59e7ac['options']?_0x59e7ac['options']['attributes']||null:null,'limit':_0x59e7ac['options']?_0x59e7ac[_0x9320('0x18')][_0x9320('0x1b')]||null:null,'include':_0x59e7ac[_0x9320('0x18')]?_0x59e7ac[_0x9320('0x18')][_0x9320('0x1c')]?_[_0x9320('0x1d')](_0x59e7ac['options']['include'],function(_0x1cab83){return{'model':db[_0x1cab83[_0x9320('0x1e')]],'as':_0x1cab83['as'],'attributes':_0x1cab83[_0x9320('0x1f')],'include':_0x1cab83['include']?_[_0x9320('0x1d')](_0x1cab83[_0x9320('0x1c')],function(_0x3a2422){return{'model':db[_0x3a2422[_0x9320('0x1e')]],'as':_0x3a2422['as'],'attributes':_0x3a2422['attributes'],'include':_0x3a2422[_0x9320('0x1c')]?_[_0x9320('0x1d')](_0x3a2422[_0x9320('0x1c')],function(_0x3ccf49){return{'model':db[_0x3ccf49[_0x9320('0x1e')]],'as':_0x3ccf49['as'],'attributes':_0x3ccf49['attributes']};}):[]};}):[]};}):[]:[]})[_0x9320('0x20')](function(_0x3e3682){logger[_0x9320('0xc')](_0x9320('0x21'),_0x59e7ac);logger[_0x9320('0xf')]('GetFreshdeskAccount',_0x59e7ac,JSON[_0x9320('0x11')](_0x3e3682));_0x1f6f5e(_0x3e3682);})[_0x9320('0x22')](function(_0x63590d){logger['error'](_0x9320('0x21'),_0x63590d[_0x9320('0x14')],_0x59e7ac);_0x32e2ba(_0x350f9d[_0x9320('0x12')](0x1f4,_0x63590d[_0x9320('0x14')]));});});};exports[_0x9320('0x23')]=function(_0x22ebb4){var _0x21dd70=this;return new Promise(function(_0x53dc89,_0xc1ddc7){return db[_0x9320('0x16')][_0x9320('0x24')]({'raw':_0x22ebb4['options']?_0x22ebb4['options'][_0x9320('0x19')]===undefined?!![]:![]:!![],'where':_0x22ebb4['options']?_0x22ebb4[_0x9320('0x18')][_0x9320('0x1a')]||null:null,'attributes':_0x22ebb4[_0x9320('0x18')]?_0x22ebb4[_0x9320('0x18')][_0x9320('0x1f')]||null:null,'include':_0x22ebb4['options']?_0x22ebb4[_0x9320('0x18')][_0x9320('0x1c')]?_[_0x9320('0x1d')](_0x22ebb4[_0x9320('0x18')][_0x9320('0x1c')],function(_0x59d17f){return{'model':db[_0x59d17f[_0x9320('0x1e')]],'as':_0x59d17f['as'],'attributes':_0x59d17f[_0x9320('0x1f')],'include':_0x59d17f[_0x9320('0x1c')]?_['map'](_0x59d17f[_0x9320('0x1c')],function(_0x2e9cfa){return{'model':db[_0x2e9cfa[_0x9320('0x1e')]],'as':_0x2e9cfa['as'],'attributes':_0x2e9cfa['attributes'],'include':_0x2e9cfa[_0x9320('0x1c')]?_[_0x9320('0x1d')](_0x2e9cfa[_0x9320('0x1c')],function(_0x43ffb4){return{'model':db[_0x43ffb4[_0x9320('0x1e')]],'as':_0x43ffb4['as'],'attributes':_0x43ffb4['attributes']};}):[]};}):[]};}):[]:[]})[_0x9320('0x20')](function(_0x41f14e){logger[_0x9320('0xc')]('ShowFreshdeskAccount',_0x22ebb4);logger[_0x9320('0xf')](_0x9320('0x23'),_0x22ebb4,JSON['stringify'](_0x41f14e));_0x53dc89(_0x41f14e);})[_0x9320('0x22')](function(_0x2c7fb7){logger[_0x9320('0x12')](_0x9320('0x23'),_0x2c7fb7['message'],_0x22ebb4);_0xc1ddc7(_0x21dd70[_0x9320('0x12')](0x1f4,_0x2c7fb7[_0x9320('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index a34be47..1ac2859 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 _0xa170=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','delete'];(function(_0x50e7f8,_0x1f5b79){var _0x36de0b=function(_0x4ac1c4){while(--_0x4ac1c4){_0x50e7f8['push'](_0x50e7f8['shift']());}};_0x36de0b(++_0x1f5b79);}(_0xa170,0x16c));var _0x0a17=function(_0x1b4fda,_0x1ff865){_0x1b4fda=_0x1b4fda-0x0;var _0x2ed52e=_0xa170[_0x1b4fda];return _0x2ed52e;};'use strict';var multer=require(_0x0a17('0x0'));var util=require(_0x0a17('0x1'));var path=require(_0x0a17('0x2'));var timeout=require(_0x0a17('0x3'));var express=require(_0x0a17('0x4'));var router=express[_0x0a17('0x5')]();var auth=require(_0x0a17('0x6'));var interaction=require(_0x0a17('0x7'));var config=require(_0x0a17('0x8'));var controller=require(_0x0a17('0x9'));router[_0x0a17('0xa')]('/',auth[_0x0a17('0xb')](),controller[_0x0a17('0xc')]);router['get']('/:id',auth[_0x0a17('0xb')](),controller[_0x0a17('0xd')]);router[_0x0a17('0xa')](_0x0a17('0xe'),auth[_0x0a17('0xb')](),controller[_0x0a17('0xf')]);router[_0x0a17('0xa')](_0x0a17('0x10'),auth[_0x0a17('0xb')](),controller[_0x0a17('0x11')]);router[_0x0a17('0xa')](_0x0a17('0x12'),auth['isAuthenticated'](),controller[_0x0a17('0x13')]);router[_0x0a17('0xa')](_0x0a17('0x14'),auth['isAuthenticated'](),controller[_0x0a17('0x15')]);router[_0x0a17('0x16')]('/',auth['isAuthenticated'](),controller[_0x0a17('0x17')]);router['post'](_0x0a17('0x14'),auth[_0x0a17('0xb')](),controller[_0x0a17('0x18')]);router[_0x0a17('0x19')](_0x0a17('0x1a'),auth[_0x0a17('0xb')](),controller['update']);router[_0x0a17('0x1b')]('/:id',auth[_0x0a17('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf9c8=['put','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags'];(function(_0x131c9b,_0x154062){var _0x367605=function(_0x2b0285){while(--_0x2b0285){_0x131c9b['push'](_0x131c9b['shift']());}};_0x367605(++_0x154062);}(_0xf9c8,0x8c));var _0x8f9c=function(_0x43d701,_0x4bb2e9){_0x43d701=_0x43d701-0x0;var _0x2ec4c6=_0xf9c8[_0x43d701];return _0x2ec4c6;};'use strict';var multer=require(_0x8f9c('0x0'));var util=require('util');var path=require(_0x8f9c('0x1'));var timeout=require(_0x8f9c('0x2'));var express=require(_0x8f9c('0x3'));var router=express[_0x8f9c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8f9c('0x5'));var config=require(_0x8f9c('0x6'));var controller=require(_0x8f9c('0x7'));router['get']('/',auth[_0x8f9c('0x8')](),controller[_0x8f9c('0x9')]);router[_0x8f9c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x8f9c('0xb')]);router[_0x8f9c('0xa')]('/:id/fields',auth[_0x8f9c('0x8')](),controller[_0x8f9c('0xc')]);router[_0x8f9c('0xa')](_0x8f9c('0xd'),auth['isAuthenticated'](),controller[_0x8f9c('0xe')]);router['get'](_0x8f9c('0xf'),auth['isAuthenticated'](),controller[_0x8f9c('0x10')]);router[_0x8f9c('0xa')](_0x8f9c('0x11'),auth[_0x8f9c('0x8')](),controller[_0x8f9c('0x12')]);router[_0x8f9c('0x13')]('/',auth[_0x8f9c('0x8')](),controller[_0x8f9c('0x14')]);router[_0x8f9c('0x13')](_0x8f9c('0x11'),auth[_0x8f9c('0x8')](),controller[_0x8f9c('0x15')]);router[_0x8f9c('0x16')](_0x8f9c('0x17'),auth['isAuthenticated'](),controller[_0x8f9c('0x18')]);router[_0x8f9c('0x19')](_0x8f9c('0x17'),auth[_0x8f9c('0x8')](),controller[_0x8f9c('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 01f00ff..ad2709f 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3cda=['sequelize','STRING'];(function(_0x283b22,_0x14b778){var _0x49c07d=function(_0x54bed8){while(--_0x54bed8){_0x283b22['push'](_0x283b22['shift']());}};_0x49c07d(++_0x14b778);}(_0x3cda,0x7e));var _0xa3cd=function(_0x433bf8,_0x4b5981){_0x433bf8=_0x433bf8-0x0;var _0x181b83=_0x3cda[_0x433bf8];return _0x181b83;};'use strict';var Sequelize=require(_0xa3cd('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3cd('0x1')]},'description':{'type':Sequelize[_0xa3cd('0x1')]}}; \ No newline at end of file +var _0x8919=['STRING'];(function(_0x10d0f0,_0x1eba3d){var _0x93e308=function(_0x388548){while(--_0x388548){_0x10d0f0['push'](_0x10d0f0['shift']());}};_0x93e308(++_0x1eba3d);}(_0x8919,0x149));var _0x9891=function(_0xf7fda0,_0x27c453){_0xf7fda0=_0xf7fda0-0x0;var _0x5a4a51=_0x8919[_0xf7fda0];return _0x5a4a51;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9891('0x0')]},'description':{'type':Sequelize[_0x9891('0x0')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 4423e73..596ff5d 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 _0x210b=['error','message','result','catch','sendStatus','status','end','limit','set','Content-Range','json','apply','reject','update','destroy','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','merge','where','type','VIRTUAL','options','count','include','rows','params','keys','includeAll','find','create','body','FreshdeskField','getFields','getSubjects','findOne','getDescriptions','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x210b,0xfa));var _0xb210=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0x210b[_0x18a436];return _0x5c2cf8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb210('0x0'));var rimraf=require(_0xb210('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb210('0x2'));var rp=require(_0xb210('0x3'));var moment=require(_0xb210('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb210('0x5'));var util=require('util');var path=require(_0xb210('0x6'));var sox=require('sox');var csv=require(_0xb210('0x7'));var ejs=require(_0xb210('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb210('0x9'));var crypto=require(_0xb210('0xa'));var jsforce=require(_0xb210('0xb'));var deskjs=require(_0xb210('0xc'));var toCsv=require(_0xb210('0x7'));var querystring=require(_0xb210('0xd'));var Papa=require(_0xb210('0xe'));var Redis=require(_0xb210('0xf'));var authService=require(_0xb210('0x10'));var qs=require(_0xb210('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb210('0x12'));var utils=require(_0xb210('0x13'));var config=require('../../config/environment');var db=require(_0xb210('0x14'))['db'];var jayson=require(_0xb210('0x15'));var client=jayson[_0xb210('0x16')][_0xb210('0x17')]({'port':0x232a});function checkPasswordPattern(_0x4c2707,_0x189d4b,_0x395a74){if(_0x395a74){var _0x1ae717=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ae717[_0xb210('0x18')](_0x189d4b)){return _0x4c2707;}else{throw new db[(_0xb210('0x19'))][(_0xb210('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4c2707;}}function respondWithRpcPromise(_0x5b6e38,_0x3725a6,_0x4eafc1,_0x3a1898){return new BPromise(function(_0x12000a,_0x21c1db){var _0x15871d=_0x3a1898||client;return _0x15871d[_0xb210('0x1b')](_0x5b6e38,_0x4eafc1)[_0xb210('0x1c')](function(_0x25245c){logger[_0xb210('0x1d')](_0xb210('0x1e'),_0x3725a6,_0xb210('0x1f'));logger[_0xb210('0x20')](_0xb210('0x21'),_0x3725a6,'request\x20sent',JSON[_0xb210('0x22')](_0x25245c));if(_0x25245c[_0xb210('0x23')]){if(_0x25245c['error']['code']===0x1f4){logger[_0xb210('0x23')](_0xb210('0x1e'),_0x3725a6,_0x25245c[_0xb210('0x23')]['message']);return _0x21c1db(_0x25245c[_0xb210('0x23')][_0xb210('0x24')]);}logger['error'](_0xb210('0x1e'),_0x3725a6,_0x25245c[_0xb210('0x23')][_0xb210('0x24')]);return _0x12000a(_0x25245c[_0xb210('0x23')][_0xb210('0x24')]);}else{logger[_0xb210('0x1d')](_0xb210('0x1e'),_0x3725a6,_0xb210('0x1f'));_0x12000a(_0x25245c[_0xb210('0x25')]['message']);}})[_0xb210('0x26')](function(_0x4cf5fb){logger['error'](_0xb210('0x1e'),_0x3725a6,_0x4cf5fb);_0x21c1db(_0x4cf5fb);});});}function respondWithStatusCode(_0x1c28c4,_0x48e195){_0x48e195=_0x48e195||0xcc;return function(_0x3d7e28){if(_0x3d7e28){return _0x1c28c4[_0xb210('0x27')](_0x48e195);}return _0x1c28c4[_0xb210('0x28')](_0x48e195)[_0xb210('0x29')]();};}function respondWithResult(_0x4bb10b,_0x1da3d5){_0x1da3d5=_0x1da3d5||0xc8;return function(_0x4ac5b0){if(_0x4ac5b0){return _0x4bb10b[_0xb210('0x28')](_0x1da3d5)['json'](_0x4ac5b0);}};}function respondWithFilteredResult(_0x47ac43,_0x1a700f){return function(_0x23d449){if(_0x23d449){var _0x282535=_0x23d449['count'],_0x4a61a0=_0x1a700f['offset'],_0xaa89f2=_0x1a700f['offset']+_0x1a700f[_0xb210('0x2a')],_0x154558;if(_0xaa89f2>=_0x282535){_0xaa89f2=_0x282535;_0x154558=0xc8;}else{_0x154558=0xce;}_0x47ac43[_0xb210('0x28')](_0x154558);return _0x47ac43[_0xb210('0x2b')](_0xb210('0x2c'),_0x4a61a0+'-'+_0xaa89f2+'/'+_0x282535)[_0xb210('0x2d')](_0x23d449);}return null;};}function patchUpdates(_0x59d17c){return function(_0x44a384){try{jsonpatch[_0xb210('0x2e')](_0x44a384,_0x59d17c,!![]);}catch(_0x1b4c03){return BPromise[_0xb210('0x2f')](_0x1b4c03);}return _0x44a384['save']();};}function saveUpdates(_0x109369,_0x46572f){return function(_0x31d847){if(_0x31d847){return _0x31d847[_0xb210('0x30')](_0x109369)['then'](function(_0x1407c4){return _0x1407c4;});}return null;};}function removeEntity(_0x3ff072,_0x585146){return function(_0x430f41){if(_0x430f41){return _0x430f41[_0xb210('0x31')]()['then'](function(){_0x3ff072[_0xb210('0x28')](0xcc)[_0xb210('0x29')]();});}};}function handleEntityNotFound(_0x36fc5a,_0x5650fa){return function(_0x14a45d){if(!_0x14a45d){_0x36fc5a[_0xb210('0x27')](0x194);}return _0x14a45d;};}function handleError(_0x1c203a,_0x3bfac3){_0x3bfac3=_0x3bfac3||0x1f4;return function(_0x207372){logger[_0xb210('0x23')](_0x207372[_0xb210('0x32')]);if(_0x207372['name']){delete _0x207372[_0xb210('0x33')];}_0x1c203a['status'](_0x3bfac3)[_0xb210('0x34')](_0x207372);};}exports[_0xb210('0x35')]=function(_0x16d6b4,_0x80ba0c){var _0x11222e={},_0x2cd092={},_0x1495a2={'count':0x0,'rows':[]};var _0x59da11=_[_0xb210('0x36')](db[_0xb210('0x37')][_0xb210('0x38')],function(_0x564c33){return{'name':_0x564c33[_0xb210('0x39')],'type':_0x564c33['type'][_0xb210('0x3a')]};});_0x2cd092[_0xb210('0x3b')]=_[_0xb210('0x36')](_0x59da11,'name');_0x2cd092[_0xb210('0x3c')]=_['keys'](_0x16d6b4[_0xb210('0x3c')]);_0x2cd092[_0xb210('0x3d')]=_[_0xb210('0x3e')](_0x2cd092[_0xb210('0x3b')],_0x2cd092['query']);_0x11222e[_0xb210('0x3f')]=_[_0xb210('0x3e')](_0x2cd092[_0xb210('0x3b')],qs[_0xb210('0x40')](_0x16d6b4[_0xb210('0x3c')][_0xb210('0x40')]));_0x11222e[_0xb210('0x3f')]=_0x11222e[_0xb210('0x3f')][_0xb210('0x41')]?_0x11222e['attributes']:_0x2cd092[_0xb210('0x3b')];if(!_0x16d6b4[_0xb210('0x3c')][_0xb210('0x42')](_0xb210('0x43'))){_0x11222e[_0xb210('0x2a')]=qs[_0xb210('0x2a')](_0x16d6b4[_0xb210('0x3c')][_0xb210('0x2a')]);_0x11222e[_0xb210('0x44')]=qs[_0xb210('0x44')](_0x16d6b4[_0xb210('0x3c')]['offset']);}_0x11222e[_0xb210('0x45')]=qs[_0xb210('0x46')](_0x16d6b4[_0xb210('0x3c')]['sort']);_0x11222e['where']=qs[_0xb210('0x3d')](_[_0xb210('0x47')](_0x16d6b4['query'],_0x2cd092[_0xb210('0x3d')]));if(_0x16d6b4['query'][_0xb210('0x48')]){_0x11222e['where']=_[_0xb210('0x49')](_0x11222e[_0xb210('0x4a')],{'$or':_[_0xb210('0x36')](_0x59da11,function(_0x3e40cc){if(_0x3e40cc[_0xb210('0x4b')]!==_0xb210('0x4c')){var _0x5f4b51={};_0x5f4b51[_0x3e40cc[_0xb210('0x33')]]={'$like':'%'+_0x16d6b4[_0xb210('0x3c')]['filter']+'%'};return _0x5f4b51;}})});}_0x11222e=_['merge']({},_0x11222e,_0x16d6b4[_0xb210('0x4d')]);var _0x557ee4={'where':_0x11222e[_0xb210('0x4a')]};return db[_0xb210('0x37')][_0xb210('0x4e')](_0x557ee4)[_0xb210('0x1c')](function(_0x5aa616){_0x1495a2[_0xb210('0x4e')]=_0x5aa616;if(_0x16d6b4[_0xb210('0x3c')]['includeAll']){_0x11222e[_0xb210('0x4f')]=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0x11222e);})[_0xb210('0x1c')](function(_0x649174){_0x1495a2[_0xb210('0x50')]=_0x649174;return _0x1495a2;})['then'](respondWithFilteredResult(_0x80ba0c,_0x11222e))[_0xb210('0x26')](handleError(_0x80ba0c,null));};exports['show']=function(_0x431dea,_0x937e96){var _0x494d20={'raw':![],'where':{'id':_0x431dea[_0xb210('0x51')]['id']}},_0x4a2723={};_0x4a2723[_0xb210('0x3b')]=_[_0xb210('0x52')](db[_0xb210('0x37')]['rawAttributes']);_0x4a2723[_0xb210('0x3c')]=_[_0xb210('0x52')](_0x431dea[_0xb210('0x3c')]);_0x4a2723[_0xb210('0x3d')]=_[_0xb210('0x3e')](_0x4a2723[_0xb210('0x3b')],_0x4a2723[_0xb210('0x3c')]);_0x494d20[_0xb210('0x3f')]=_['intersection'](_0x4a2723[_0xb210('0x3b')],qs[_0xb210('0x40')](_0x431dea[_0xb210('0x3c')][_0xb210('0x40')]));_0x494d20[_0xb210('0x3f')]=_0x494d20[_0xb210('0x3f')][_0xb210('0x41')]?_0x494d20['attributes']:_0x4a2723[_0xb210('0x3b')];if(_0x431dea[_0xb210('0x3c')][_0xb210('0x53')]){_0x494d20[_0xb210('0x4f')]=[{'all':!![]}];}_0x494d20=_[_0xb210('0x49')]({},_0x494d20,_0x431dea[_0xb210('0x4d')]);return db[_0xb210('0x37')][_0xb210('0x54')](_0x494d20)[_0xb210('0x1c')](handleEntityNotFound(_0x937e96,null))[_0xb210('0x1c')](respondWithResult(_0x937e96,null))[_0xb210('0x26')](handleError(_0x937e96,null));};exports[_0xb210('0x55')]=function(_0x3acd43,_0x380075){return db[_0xb210('0x37')][_0xb210('0x55')](_0x3acd43['body'],{})['then'](respondWithResult(_0x380075,0xc9))[_0xb210('0x26')](handleError(_0x380075,null));};exports[_0xb210('0x30')]=function(_0x69e446,_0x569eba){if(_0x69e446[_0xb210('0x56')]['id']){delete _0x69e446[_0xb210('0x56')]['id'];}return db[_0xb210('0x37')][_0xb210('0x54')]({'where':{'id':_0x69e446['params']['id']}})['then'](handleEntityNotFound(_0x569eba,null))[_0xb210('0x1c')](saveUpdates(_0x69e446['body'],null))[_0xb210('0x1c')](respondWithResult(_0x569eba,null))[_0xb210('0x26')](handleError(_0x569eba,null));};exports[_0xb210('0x31')]=function(_0x337a45,_0x275222){return db['FreshdeskConfiguration'][_0xb210('0x54')]({'where':{'id':_0x337a45[_0xb210('0x51')]['id']}})[_0xb210('0x1c')](handleEntityNotFound(_0x275222,null))[_0xb210('0x1c')](removeEntity(_0x275222,null))['catch'](handleError(_0x275222,null));};exports['getFields']=function(_0x49877a,_0xf84a94,_0x3cbb29){var _0x4758ff={};var _0x136cec={};var _0x32aed6;var _0x511966;return db[_0xb210('0x37')]['findOne']({'where':{'id':_0x49877a[_0xb210('0x51')]['id']}})[_0xb210('0x1c')](handleEntityNotFound(_0xf84a94,null))[_0xb210('0x1c')](function(_0x23a019){if(_0x23a019){_0x32aed6=_0x23a019;_0x136cec[_0xb210('0x3b')]=_['keys'](db[_0xb210('0x57')][_0xb210('0x38')]);_0x136cec[_0xb210('0x3c')]=_[_0xb210('0x52')](_0x49877a[_0xb210('0x3c')]);_0x136cec[_0xb210('0x3d')]=_[_0xb210('0x3e')](_0x136cec[_0xb210('0x3b')],_0x136cec[_0xb210('0x3c')]);_0x4758ff[_0xb210('0x3f')]=_[_0xb210('0x3e')](_0x136cec[_0xb210('0x3b')],qs[_0xb210('0x40')](_0x49877a[_0xb210('0x3c')]['fields']));_0x4758ff[_0xb210('0x3f')]=_0x4758ff[_0xb210('0x3f')][_0xb210('0x41')]?_0x4758ff[_0xb210('0x3f')]:_0x136cec[_0xb210('0x3b')];_0x4758ff[_0xb210('0x45')]=qs[_0xb210('0x46')](_0x49877a[_0xb210('0x3c')]['sort']);_0x4758ff[_0xb210('0x4a')]=qs['filters'](_['pick'](_0x49877a[_0xb210('0x3c')],_0x136cec[_0xb210('0x3d')]));if(_0x49877a[_0xb210('0x3c')][_0xb210('0x48')]){_0x4758ff['where']=_['merge'](_0x4758ff[_0xb210('0x4a')],{'$or':_['map'](_0x4758ff[_0xb210('0x3f')],function(_0x19a696){var _0x258e67={};_0x258e67[_0x19a696]={'$like':'%'+_0x49877a['query'][_0xb210('0x48')]+'%'};return _0x258e67;})});}_0x4758ff=_[_0xb210('0x49')]({},_0x4758ff,_0x49877a[_0xb210('0x4d')]);return _0x32aed6[_0xb210('0x58')](_0x4758ff);}})[_0xb210('0x1c')](function(_0x385775){if(_0x385775){_0x511966=_0x385775[_0xb210('0x41')];if(!_0x49877a[_0xb210('0x3c')][_0xb210('0x42')](_0xb210('0x43'))){_0x4758ff[_0xb210('0x2a')]=qs['limit'](_0x49877a[_0xb210('0x3c')]['limit']);_0x4758ff[_0xb210('0x44')]=qs[_0xb210('0x44')](_0x49877a[_0xb210('0x3c')]['offset']);}return _0x32aed6['getFields'](_0x4758ff);}})[_0xb210('0x1c')](function(_0x1fd07e){if(_0x1fd07e){return _0x1fd07e?{'count':_0x511966,'rows':_0x1fd07e}:null;}})[_0xb210('0x1c')](respondWithResult(_0xf84a94,null))[_0xb210('0x26')](handleError(_0xf84a94,null));};exports[_0xb210('0x59')]=function(_0x5cd75f,_0xef8847,_0x3e2d5c){var _0x582178={};var _0x130102={};var _0x27f7d6;var _0x40d8bb;return db[_0xb210('0x37')][_0xb210('0x5a')]({'where':{'id':_0x5cd75f[_0xb210('0x51')]['id']}})['then'](handleEntityNotFound(_0xef8847,null))[_0xb210('0x1c')](function(_0x531572){if(_0x531572){_0x27f7d6=_0x531572;_0x130102[_0xb210('0x3b')]=_['keys'](db[_0xb210('0x57')][_0xb210('0x38')]);_0x130102[_0xb210('0x3c')]=_[_0xb210('0x52')](_0x5cd75f[_0xb210('0x3c')]);_0x130102[_0xb210('0x3d')]=_[_0xb210('0x3e')](_0x130102['model'],_0x130102['query']);_0x582178[_0xb210('0x3f')]=_[_0xb210('0x3e')](_0x130102[_0xb210('0x3b')],qs[_0xb210('0x40')](_0x5cd75f[_0xb210('0x3c')][_0xb210('0x40')]));_0x582178[_0xb210('0x3f')]=_0x582178[_0xb210('0x3f')][_0xb210('0x41')]?_0x582178[_0xb210('0x3f')]:_0x130102[_0xb210('0x3b')];_0x582178[_0xb210('0x45')]=qs[_0xb210('0x46')](_0x5cd75f[_0xb210('0x3c')]['sort']);_0x582178['where']=qs[_0xb210('0x3d')](_[_0xb210('0x47')](_0x5cd75f[_0xb210('0x3c')],_0x130102[_0xb210('0x3d')]));if(_0x5cd75f[_0xb210('0x3c')][_0xb210('0x48')]){_0x582178[_0xb210('0x4a')]=_[_0xb210('0x49')](_0x582178[_0xb210('0x4a')],{'$or':_['map'](_0x582178['attributes'],function(_0x2fe3b1){var _0x2731d5={};_0x2731d5[_0x2fe3b1]={'$like':'%'+_0x5cd75f[_0xb210('0x3c')][_0xb210('0x48')]+'%'};return _0x2731d5;})});}_0x582178=_[_0xb210('0x49')]({},_0x582178,_0x5cd75f[_0xb210('0x4d')]);return _0x27f7d6['getSubjects'](_0x582178);}})['then'](function(_0x4817da){if(_0x4817da){_0x40d8bb=_0x4817da[_0xb210('0x41')];if(!_0x5cd75f[_0xb210('0x3c')][_0xb210('0x42')](_0xb210('0x43'))){_0x582178[_0xb210('0x2a')]=qs[_0xb210('0x2a')](_0x5cd75f['query'][_0xb210('0x2a')]);_0x582178[_0xb210('0x44')]=qs[_0xb210('0x44')](_0x5cd75f['query'][_0xb210('0x44')]);}return _0x27f7d6[_0xb210('0x59')](_0x582178);}})[_0xb210('0x1c')](function(_0x12cefb){if(_0x12cefb){return _0x12cefb?{'count':_0x40d8bb,'rows':_0x12cefb}:null;}})[_0xb210('0x1c')](respondWithResult(_0xef8847,null))[_0xb210('0x26')](handleError(_0xef8847,null));};exports['getDescriptions']=function(_0x1e936a,_0x4a8055,_0x1873ee){var _0x376173={};var _0x540158={};var _0x56ac03;var _0x227ea7;return db['FreshdeskConfiguration'][_0xb210('0x5a')]({'where':{'id':_0x1e936a[_0xb210('0x51')]['id']}})['then'](handleEntityNotFound(_0x4a8055,null))[_0xb210('0x1c')](function(_0x313ca0){if(_0x313ca0){_0x56ac03=_0x313ca0;_0x540158[_0xb210('0x3b')]=_[_0xb210('0x52')](db[_0xb210('0x57')]['rawAttributes']);_0x540158['query']=_['keys'](_0x1e936a[_0xb210('0x3c')]);_0x540158[_0xb210('0x3d')]=_[_0xb210('0x3e')](_0x540158[_0xb210('0x3b')],_0x540158[_0xb210('0x3c')]);_0x376173[_0xb210('0x3f')]=_[_0xb210('0x3e')](_0x540158[_0xb210('0x3b')],qs[_0xb210('0x40')](_0x1e936a[_0xb210('0x3c')][_0xb210('0x40')]));_0x376173[_0xb210('0x3f')]=_0x376173[_0xb210('0x3f')][_0xb210('0x41')]?_0x376173[_0xb210('0x3f')]:_0x540158['model'];_0x376173[_0xb210('0x45')]=qs[_0xb210('0x46')](_0x1e936a[_0xb210('0x3c')][_0xb210('0x46')]);_0x376173[_0xb210('0x4a')]=qs[_0xb210('0x3d')](_[_0xb210('0x47')](_0x1e936a['query'],_0x540158['filters']));if(_0x1e936a[_0xb210('0x3c')][_0xb210('0x48')]){_0x376173[_0xb210('0x4a')]=_[_0xb210('0x49')](_0x376173[_0xb210('0x4a')],{'$or':_[_0xb210('0x36')](_0x376173['attributes'],function(_0x3521b5){var _0x4cbcb2={};_0x4cbcb2[_0x3521b5]={'$like':'%'+_0x1e936a['query'][_0xb210('0x48')]+'%'};return _0x4cbcb2;})});}_0x376173=_[_0xb210('0x49')]({},_0x376173,_0x1e936a[_0xb210('0x4d')]);return _0x56ac03[_0xb210('0x5b')](_0x376173);}})[_0xb210('0x1c')](function(_0x2db6b3){if(_0x2db6b3){_0x227ea7=_0x2db6b3['length'];if(!_0x1e936a[_0xb210('0x3c')]['hasOwnProperty'](_0xb210('0x43'))){_0x376173[_0xb210('0x2a')]=qs[_0xb210('0x2a')](_0x1e936a[_0xb210('0x3c')]['limit']);_0x376173['offset']=qs[_0xb210('0x44')](_0x1e936a[_0xb210('0x3c')][_0xb210('0x44')]);}return _0x56ac03['getDescriptions'](_0x376173);}})[_0xb210('0x1c')](function(_0x1d86fa){if(_0x1d86fa){return _0x1d86fa?{'count':_0x227ea7,'rows':_0x1d86fa}:null;}})['then'](respondWithResult(_0x4a8055,null))[_0xb210('0x26')](handleError(_0x4a8055,null));};exports['getTags']=function(_0xe525e6,_0x3cf841,_0x5915d5){var _0x122046={};var _0x1dbe3d={};var _0x1a8f5e;var _0x527685;return db[_0xb210('0x37')][_0xb210('0x5a')]({'where':{'id':_0xe525e6[_0xb210('0x51')]['id']}})[_0xb210('0x1c')](handleEntityNotFound(_0x3cf841,null))[_0xb210('0x1c')](function(_0x1495ef){if(_0x1495ef){_0x1a8f5e=_0x1495ef;_0x1dbe3d[_0xb210('0x3b')]=_['keys'](db['Tag'][_0xb210('0x38')]);_0x1dbe3d['query']=_[_0xb210('0x52')](_0xe525e6[_0xb210('0x3c')]);_0x1dbe3d[_0xb210('0x3d')]=_[_0xb210('0x3e')](_0x1dbe3d[_0xb210('0x3b')],_0x1dbe3d[_0xb210('0x3c')]);_0x122046[_0xb210('0x3f')]=_['intersection'](_0x1dbe3d[_0xb210('0x3b')],qs['fields'](_0xe525e6[_0xb210('0x3c')]['fields']));_0x122046[_0xb210('0x3f')]=_0x122046['attributes'][_0xb210('0x41')]?_0x122046[_0xb210('0x3f')]:_0x1dbe3d[_0xb210('0x3b')];_0x122046[_0xb210('0x45')]=qs['sort'](_0xe525e6[_0xb210('0x3c')]['sort']);_0x122046[_0xb210('0x4a')]=qs[_0xb210('0x3d')](_['pick'](_0xe525e6['query'],_0x1dbe3d[_0xb210('0x3d')]));if(_0xe525e6[_0xb210('0x3c')][_0xb210('0x48')]){_0x122046[_0xb210('0x4a')]=_['merge'](_0x122046[_0xb210('0x4a')],{'$or':_[_0xb210('0x36')](_0x122046[_0xb210('0x3f')],function(_0x486c6e){var _0x1ac710={};_0x1ac710[_0x486c6e]={'$like':'%'+_0xe525e6[_0xb210('0x3c')]['filter']+'%'};return _0x1ac710;})});}_0x122046=_[_0xb210('0x49')]({},_0x122046,_0xe525e6[_0xb210('0x4d')]);return _0x1a8f5e[_0xb210('0x5c')](_0x122046);}})[_0xb210('0x1c')](function(_0x181963){if(_0x181963){_0x527685=_0x181963[_0xb210('0x41')];if(!_0xe525e6[_0xb210('0x3c')][_0xb210('0x42')](_0xb210('0x43'))){_0x122046[_0xb210('0x2a')]=qs[_0xb210('0x2a')](_0xe525e6[_0xb210('0x3c')]['limit']);_0x122046[_0xb210('0x44')]=qs[_0xb210('0x44')](_0xe525e6[_0xb210('0x3c')][_0xb210('0x44')]);}return _0x1a8f5e[_0xb210('0x5c')](_0x122046);}})[_0xb210('0x1c')](function(_0x5b9c8b){if(_0x5b9c8b){return _0x5b9c8b?{'count':_0x527685,'rows':_0x5b9c8b}:null;}})[_0xb210('0x1c')](respondWithResult(_0x3cf841,null))[_0xb210('0x26')](handleError(_0x3cf841,null));};exports[_0xb210('0x5d')]=function(_0x43bc49,_0xaece97,_0x171d2e){if(_0x43bc49['body']['id']){delete _0x43bc49[_0xb210('0x56')]['id'];}return db['FreshdeskConfiguration'][_0xb210('0x5a')]({'where':{'id':_0x43bc49[_0xb210('0x51')]['id']}})[_0xb210('0x1c')](handleEntityNotFound(_0xaece97,null))['then'](function(_0x22ae8f){if(_0x22ae8f){return _0x22ae8f['setTags'](_0x43bc49['body'][_0xb210('0x5e')]||[]);}return null;})[_0xb210('0x1c')](respondWithResult(_0xaece97,null))['catch'](handleError(_0xaece97,null));}; \ No newline at end of file +var _0x88c7=['catch','create','body','update','find','findOne','FreshdeskField','getFields','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','count','offset','limit','set','apply','reject','save','then','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','nolimit','order','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','length'];(function(_0x4c212c,_0x5b0c1e){var _0x1cde08=function(_0x58e7fc){while(--_0x58e7fc){_0x4c212c['push'](_0x4c212c['shift']());}};_0x1cde08(++_0x5b0c1e);}(_0x88c7,0x6f));var _0x788c=function(_0x388e38,_0x40abb3){_0x388e38=_0x388e38-0x0;var _0x138fe1=_0x88c7[_0x388e38];return _0x138fe1;};'use strict';var pdf=require(_0x788c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x788c('0x1'));var jsonpatch=require(_0x788c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x788c('0x3'));var Mustache=require(_0x788c('0x4'));var util=require('util');var path=require(_0x788c('0x5'));var sox=require(_0x788c('0x6'));var csv=require('to-csv');var ejs=require(_0x788c('0x7'));var fs=require('fs');var _=require(_0x788c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x788c('0x9'));var deskjs=require(_0x788c('0xa'));var toCsv=require(_0x788c('0xb'));var querystring=require(_0x788c('0xc'));var Papa=require(_0x788c('0xd'));var Redis=require('ioredis');var authService=require(_0x788c('0xe'));var qs=require(_0x788c('0xf'));var as=require(_0x788c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x788c('0x11'))(_0x788c('0x12'));var utils=require(_0x788c('0x13'));var config=require(_0x788c('0x14'));var db=require(_0x788c('0x15'))['db'];var jayson=require(_0x788c('0x16'));var client=jayson['client'][_0x788c('0x17')]({'port':0x232a});function checkPasswordPattern(_0x579e54,_0x3ccdca,_0x4dfc4e){if(_0x4dfc4e){var _0xdab417=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xdab417[_0x788c('0x18')](_0x3ccdca)){return _0x579e54;}else{throw new db[(_0x788c('0x19'))][(_0x788c('0x1a'))](_0x788c('0x1b'));}}else{return _0x579e54;}}function respondWithRpcPromise(_0x7249ae,_0x3d7971,_0x3d837d,_0x2b6e32){return new BPromise(function(_0x41d920,_0x67dc6c){var _0xa118b5=_0x2b6e32||client;return _0xa118b5[_0x788c('0x1c')](_0x7249ae,_0x3d837d)['then'](function(_0x2f3b41){logger[_0x788c('0x1d')](_0x788c('0x1e'),_0x3d7971,_0x788c('0x1f'));logger[_0x788c('0x20')](_0x788c('0x21'),_0x3d7971,_0x788c('0x1f'),JSON[_0x788c('0x22')](_0x2f3b41));if(_0x2f3b41[_0x788c('0x23')]){if(_0x2f3b41[_0x788c('0x23')]['code']===0x1f4){logger[_0x788c('0x23')](_0x788c('0x1e'),_0x3d7971,_0x2f3b41[_0x788c('0x23')][_0x788c('0x24')]);return _0x67dc6c(_0x2f3b41[_0x788c('0x23')][_0x788c('0x24')]);}logger[_0x788c('0x23')](_0x788c('0x1e'),_0x3d7971,_0x2f3b41['error'][_0x788c('0x24')]);return _0x41d920(_0x2f3b41[_0x788c('0x23')][_0x788c('0x24')]);}else{logger[_0x788c('0x1d')](_0x788c('0x1e'),_0x3d7971,_0x788c('0x1f'));_0x41d920(_0x2f3b41[_0x788c('0x25')][_0x788c('0x24')]);}})['catch'](function(_0x3bf479){logger[_0x788c('0x23')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d7971,_0x3bf479);_0x67dc6c(_0x3bf479);});});}function respondWithStatusCode(_0x14e2f1,_0x32353e){_0x32353e=_0x32353e||0xcc;return function(_0x16741c){if(_0x16741c){return _0x14e2f1['sendStatus'](_0x32353e);}return _0x14e2f1[_0x788c('0x26')](_0x32353e)[_0x788c('0x27')]();};}function respondWithResult(_0x28fa56,_0x37d2eb){_0x37d2eb=_0x37d2eb||0xc8;return function(_0x200134){if(_0x200134){return _0x28fa56[_0x788c('0x26')](_0x37d2eb)[_0x788c('0x28')](_0x200134);}};}function respondWithFilteredResult(_0x12fdbc,_0x2dbf2d){return function(_0x4fa90a){if(_0x4fa90a){var _0x4380f4=_0x4fa90a[_0x788c('0x29')],_0x57966d=_0x2dbf2d[_0x788c('0x2a')],_0x297ea6=_0x2dbf2d[_0x788c('0x2a')]+_0x2dbf2d[_0x788c('0x2b')],_0x18b271;if(_0x297ea6>=_0x4380f4){_0x297ea6=_0x4380f4;_0x18b271=0xc8;}else{_0x18b271=0xce;}_0x12fdbc[_0x788c('0x26')](_0x18b271);return _0x12fdbc[_0x788c('0x2c')]('Content-Range',_0x57966d+'-'+_0x297ea6+'/'+_0x4380f4)[_0x788c('0x28')](_0x4fa90a);}return null;};}function patchUpdates(_0x4e9b20){return function(_0x2b9bbb){try{jsonpatch[_0x788c('0x2d')](_0x2b9bbb,_0x4e9b20,!![]);}catch(_0x43509d){return BPromise[_0x788c('0x2e')](_0x43509d);}return _0x2b9bbb[_0x788c('0x2f')]();};}function saveUpdates(_0x19f6d5,_0x5ee705){return function(_0x2d719e){if(_0x2d719e){return _0x2d719e['update'](_0x19f6d5)[_0x788c('0x30')](function(_0x4d15d6){return _0x4d15d6;});}return null;};}function removeEntity(_0x4245ce,_0x57a030){return function(_0x2532e8){if(_0x2532e8){return _0x2532e8['destroy']()['then'](function(){_0x4245ce[_0x788c('0x26')](0xcc)[_0x788c('0x27')]();});}};}function handleEntityNotFound(_0x4eced2,_0x40b93d){return function(_0x45a0d4){if(!_0x45a0d4){_0x4eced2['sendStatus'](0x194);}return _0x45a0d4;};}function handleError(_0x1a4ce8,_0x5d2ced){_0x5d2ced=_0x5d2ced||0x1f4;return function(_0x581e7e){logger[_0x788c('0x23')](_0x581e7e[_0x788c('0x31')]);if(_0x581e7e[_0x788c('0x32')]){delete _0x581e7e['name'];}_0x1a4ce8['status'](_0x5d2ced)[_0x788c('0x33')](_0x581e7e);};}exports[_0x788c('0x34')]=function(_0x4ab290,_0x4d31c1){var _0x5040f0={},_0x81c866={},_0x5c889f={'count':0x0,'rows':[]};var _0x2c5b3c=_[_0x788c('0x35')](db[_0x788c('0x36')][_0x788c('0x37')],function(_0x9a0da7){return{'name':_0x9a0da7[_0x788c('0x38')],'type':_0x9a0da7['type'][_0x788c('0x39')]};});_0x81c866[_0x788c('0x3a')]=_[_0x788c('0x35')](_0x2c5b3c,'name');_0x81c866['query']=_[_0x788c('0x3b')](_0x4ab290['query']);_0x81c866['filters']=_[_0x788c('0x3c')](_0x81c866[_0x788c('0x3a')],_0x81c866[_0x788c('0x3d')]);_0x5040f0[_0x788c('0x3e')]=_[_0x788c('0x3c')](_0x81c866[_0x788c('0x3a')],qs[_0x788c('0x3f')](_0x4ab290['query']['fields']));_0x5040f0[_0x788c('0x3e')]=_0x5040f0[_0x788c('0x3e')]['length']?_0x5040f0[_0x788c('0x3e')]:_0x81c866[_0x788c('0x3a')];if(!_0x4ab290[_0x788c('0x3d')]['hasOwnProperty'](_0x788c('0x40'))){_0x5040f0[_0x788c('0x2b')]=qs[_0x788c('0x2b')](_0x4ab290[_0x788c('0x3d')][_0x788c('0x2b')]);_0x5040f0[_0x788c('0x2a')]=qs[_0x788c('0x2a')](_0x4ab290[_0x788c('0x3d')][_0x788c('0x2a')]);}_0x5040f0[_0x788c('0x41')]=qs[_0x788c('0x42')](_0x4ab290[_0x788c('0x3d')][_0x788c('0x42')]);_0x5040f0['where']=qs[_0x788c('0x43')](_[_0x788c('0x44')](_0x4ab290[_0x788c('0x3d')],_0x81c866['filters']));if(_0x4ab290['query'][_0x788c('0x45')]){_0x5040f0[_0x788c('0x46')]=_['merge'](_0x5040f0[_0x788c('0x46')],{'$or':_[_0x788c('0x35')](_0x2c5b3c,function(_0x10bd71){if(_0x10bd71[_0x788c('0x47')]!==_0x788c('0x48')){var _0x5afe5f={};_0x5afe5f[_0x10bd71['name']]={'$like':'%'+_0x4ab290[_0x788c('0x3d')]['filter']+'%'};return _0x5afe5f;}})});}_0x5040f0=_[_0x788c('0x49')]({},_0x5040f0,_0x4ab290[_0x788c('0x4a')]);var _0x243b70={'where':_0x5040f0[_0x788c('0x46')]};return db['FreshdeskConfiguration'][_0x788c('0x29')](_0x243b70)[_0x788c('0x30')](function(_0x3e6ac2){_0x5c889f['count']=_0x3e6ac2;if(_0x4ab290[_0x788c('0x3d')][_0x788c('0x4b')]){_0x5040f0[_0x788c('0x4c')]=[{'all':!![]}];}return db[_0x788c('0x36')][_0x788c('0x4d')](_0x5040f0);})[_0x788c('0x30')](function(_0x10dc18){_0x5c889f[_0x788c('0x4e')]=_0x10dc18;return _0x5c889f;})['then'](respondWithFilteredResult(_0x4d31c1,_0x5040f0))['catch'](handleError(_0x4d31c1,null));};exports['show']=function(_0x48830b,_0x551cc1){var _0x41414e={'raw':![],'where':{'id':_0x48830b[_0x788c('0x4f')]['id']}},_0x51eeee={};_0x51eeee[_0x788c('0x3a')]=_[_0x788c('0x3b')](db[_0x788c('0x36')]['rawAttributes']);_0x51eeee[_0x788c('0x3d')]=_[_0x788c('0x3b')](_0x48830b[_0x788c('0x3d')]);_0x51eeee[_0x788c('0x43')]=_[_0x788c('0x3c')](_0x51eeee[_0x788c('0x3a')],_0x51eeee[_0x788c('0x3d')]);_0x41414e[_0x788c('0x3e')]=_[_0x788c('0x3c')](_0x51eeee[_0x788c('0x3a')],qs[_0x788c('0x3f')](_0x48830b['query']['fields']));_0x41414e[_0x788c('0x3e')]=_0x41414e[_0x788c('0x3e')][_0x788c('0x50')]?_0x41414e['attributes']:_0x51eeee['model'];if(_0x48830b[_0x788c('0x3d')][_0x788c('0x4b')]){_0x41414e[_0x788c('0x4c')]=[{'all':!![]}];}_0x41414e=_[_0x788c('0x49')]({},_0x41414e,_0x48830b['options']);return db['FreshdeskConfiguration']['find'](_0x41414e)[_0x788c('0x30')](handleEntityNotFound(_0x551cc1,null))[_0x788c('0x30')](respondWithResult(_0x551cc1,null))[_0x788c('0x51')](handleError(_0x551cc1,null));};exports[_0x788c('0x52')]=function(_0x218b7c,_0x564a13){return db[_0x788c('0x36')][_0x788c('0x52')](_0x218b7c[_0x788c('0x53')],{})[_0x788c('0x30')](respondWithResult(_0x564a13,0xc9))[_0x788c('0x51')](handleError(_0x564a13,null));};exports[_0x788c('0x54')]=function(_0x22d14c,_0xa71323){if(_0x22d14c[_0x788c('0x53')]['id']){delete _0x22d14c['body']['id'];}return db[_0x788c('0x36')][_0x788c('0x55')]({'where':{'id':_0x22d14c['params']['id']}})[_0x788c('0x30')](handleEntityNotFound(_0xa71323,null))[_0x788c('0x30')](saveUpdates(_0x22d14c[_0x788c('0x53')],null))['then'](respondWithResult(_0xa71323,null))[_0x788c('0x51')](handleError(_0xa71323,null));};exports['destroy']=function(_0x357c27,_0x22f8d5){return db[_0x788c('0x36')][_0x788c('0x55')]({'where':{'id':_0x357c27[_0x788c('0x4f')]['id']}})[_0x788c('0x30')](handleEntityNotFound(_0x22f8d5,null))[_0x788c('0x30')](removeEntity(_0x22f8d5,null))['catch'](handleError(_0x22f8d5,null));};exports['getFields']=function(_0x1b492a,_0x4a7ca8,_0x312efc){var _0x3d7195={};var _0x1eb472={};var _0x3ded88;var _0x3ca9b4;return db[_0x788c('0x36')][_0x788c('0x56')]({'where':{'id':_0x1b492a['params']['id']}})[_0x788c('0x30')](handleEntityNotFound(_0x4a7ca8,null))[_0x788c('0x30')](function(_0x56e217){if(_0x56e217){_0x3ded88=_0x56e217;_0x1eb472['model']=_[_0x788c('0x3b')](db[_0x788c('0x57')][_0x788c('0x37')]);_0x1eb472['query']=_[_0x788c('0x3b')](_0x1b492a[_0x788c('0x3d')]);_0x1eb472['filters']=_[_0x788c('0x3c')](_0x1eb472[_0x788c('0x3a')],_0x1eb472[_0x788c('0x3d')]);_0x3d7195[_0x788c('0x3e')]=_['intersection'](_0x1eb472['model'],qs[_0x788c('0x3f')](_0x1b492a[_0x788c('0x3d')][_0x788c('0x3f')]));_0x3d7195[_0x788c('0x3e')]=_0x3d7195['attributes'][_0x788c('0x50')]?_0x3d7195[_0x788c('0x3e')]:_0x1eb472[_0x788c('0x3a')];_0x3d7195[_0x788c('0x41')]=qs[_0x788c('0x42')](_0x1b492a[_0x788c('0x3d')][_0x788c('0x42')]);_0x3d7195[_0x788c('0x46')]=qs[_0x788c('0x43')](_['pick'](_0x1b492a['query'],_0x1eb472[_0x788c('0x43')]));if(_0x1b492a[_0x788c('0x3d')][_0x788c('0x45')]){_0x3d7195[_0x788c('0x46')]=_[_0x788c('0x49')](_0x3d7195['where'],{'$or':_[_0x788c('0x35')](_0x3d7195[_0x788c('0x3e')],function(_0x5308ec){var _0x513432={};_0x513432[_0x5308ec]={'$like':'%'+_0x1b492a['query']['filter']+'%'};return _0x513432;})});}_0x3d7195=_[_0x788c('0x49')]({},_0x3d7195,_0x1b492a['options']);return _0x3ded88[_0x788c('0x58')](_0x3d7195);}})['then'](function(_0x5b324e){if(_0x5b324e){_0x3ca9b4=_0x5b324e['length'];if(!_0x1b492a[_0x788c('0x3d')][_0x788c('0x59')](_0x788c('0x40'))){_0x3d7195[_0x788c('0x2b')]=qs['limit'](_0x1b492a[_0x788c('0x3d')][_0x788c('0x2b')]);_0x3d7195[_0x788c('0x2a')]=qs['offset'](_0x1b492a[_0x788c('0x3d')][_0x788c('0x2a')]);}return _0x3ded88[_0x788c('0x58')](_0x3d7195);}})['then'](function(_0x50bb62){if(_0x50bb62){return _0x50bb62?{'count':_0x3ca9b4,'rows':_0x50bb62}:null;}})[_0x788c('0x30')](respondWithResult(_0x4a7ca8,null))[_0x788c('0x51')](handleError(_0x4a7ca8,null));};exports['getSubjects']=function(_0xde5292,_0x4b390e,_0x136b13){var _0x5a3906={};var _0x201d45={};var _0x433ad9;var _0x258b32;return db[_0x788c('0x36')]['findOne']({'where':{'id':_0xde5292[_0x788c('0x4f')]['id']}})[_0x788c('0x30')](handleEntityNotFound(_0x4b390e,null))[_0x788c('0x30')](function(_0x49f397){if(_0x49f397){_0x433ad9=_0x49f397;_0x201d45[_0x788c('0x3a')]=_['keys'](db['FreshdeskField'][_0x788c('0x37')]);_0x201d45[_0x788c('0x3d')]=_['keys'](_0xde5292[_0x788c('0x3d')]);_0x201d45[_0x788c('0x43')]=_[_0x788c('0x3c')](_0x201d45['model'],_0x201d45[_0x788c('0x3d')]);_0x5a3906[_0x788c('0x3e')]=_['intersection'](_0x201d45[_0x788c('0x3a')],qs[_0x788c('0x3f')](_0xde5292['query'][_0x788c('0x3f')]));_0x5a3906[_0x788c('0x3e')]=_0x5a3906['attributes'][_0x788c('0x50')]?_0x5a3906[_0x788c('0x3e')]:_0x201d45[_0x788c('0x3a')];_0x5a3906[_0x788c('0x41')]=qs[_0x788c('0x42')](_0xde5292[_0x788c('0x3d')][_0x788c('0x42')]);_0x5a3906[_0x788c('0x46')]=qs[_0x788c('0x43')](_['pick'](_0xde5292['query'],_0x201d45[_0x788c('0x43')]));if(_0xde5292[_0x788c('0x3d')]['filter']){_0x5a3906[_0x788c('0x46')]=_[_0x788c('0x49')](_0x5a3906[_0x788c('0x46')],{'$or':_['map'](_0x5a3906[_0x788c('0x3e')],function(_0x3ac007){var _0x374e3f={};_0x374e3f[_0x3ac007]={'$like':'%'+_0xde5292[_0x788c('0x3d')][_0x788c('0x45')]+'%'};return _0x374e3f;})});}_0x5a3906=_[_0x788c('0x49')]({},_0x5a3906,_0xde5292[_0x788c('0x4a')]);return _0x433ad9[_0x788c('0x5a')](_0x5a3906);}})['then'](function(_0x7ee208){if(_0x7ee208){_0x258b32=_0x7ee208['length'];if(!_0xde5292[_0x788c('0x3d')][_0x788c('0x59')]('nolimit')){_0x5a3906[_0x788c('0x2b')]=qs['limit'](_0xde5292[_0x788c('0x3d')][_0x788c('0x2b')]);_0x5a3906[_0x788c('0x2a')]=qs[_0x788c('0x2a')](_0xde5292[_0x788c('0x3d')][_0x788c('0x2a')]);}return _0x433ad9[_0x788c('0x5a')](_0x5a3906);}})[_0x788c('0x30')](function(_0x186204){if(_0x186204){return _0x186204?{'count':_0x258b32,'rows':_0x186204}:null;}})['then'](respondWithResult(_0x4b390e,null))['catch'](handleError(_0x4b390e,null));};exports['getDescriptions']=function(_0x52e46d,_0x53c1f8,_0x310c70){var _0x326a6b={};var _0x2bd3f6={};var _0x4cad59;var _0xc26db2;return db[_0x788c('0x36')][_0x788c('0x56')]({'where':{'id':_0x52e46d[_0x788c('0x4f')]['id']}})[_0x788c('0x30')](handleEntityNotFound(_0x53c1f8,null))[_0x788c('0x30')](function(_0xa201db){if(_0xa201db){_0x4cad59=_0xa201db;_0x2bd3f6[_0x788c('0x3a')]=_[_0x788c('0x3b')](db[_0x788c('0x57')]['rawAttributes']);_0x2bd3f6['query']=_[_0x788c('0x3b')](_0x52e46d[_0x788c('0x3d')]);_0x2bd3f6[_0x788c('0x43')]=_[_0x788c('0x3c')](_0x2bd3f6[_0x788c('0x3a')],_0x2bd3f6[_0x788c('0x3d')]);_0x326a6b[_0x788c('0x3e')]=_[_0x788c('0x3c')](_0x2bd3f6[_0x788c('0x3a')],qs[_0x788c('0x3f')](_0x52e46d[_0x788c('0x3d')]['fields']));_0x326a6b[_0x788c('0x3e')]=_0x326a6b[_0x788c('0x3e')][_0x788c('0x50')]?_0x326a6b[_0x788c('0x3e')]:_0x2bd3f6[_0x788c('0x3a')];_0x326a6b[_0x788c('0x41')]=qs[_0x788c('0x42')](_0x52e46d[_0x788c('0x3d')][_0x788c('0x42')]);_0x326a6b[_0x788c('0x46')]=qs[_0x788c('0x43')](_['pick'](_0x52e46d[_0x788c('0x3d')],_0x2bd3f6[_0x788c('0x43')]));if(_0x52e46d[_0x788c('0x3d')]['filter']){_0x326a6b[_0x788c('0x46')]=_['merge'](_0x326a6b[_0x788c('0x46')],{'$or':_['map'](_0x326a6b[_0x788c('0x3e')],function(_0x538abb){var _0x37ff0b={};_0x37ff0b[_0x538abb]={'$like':'%'+_0x52e46d[_0x788c('0x3d')][_0x788c('0x45')]+'%'};return _0x37ff0b;})});}_0x326a6b=_[_0x788c('0x49')]({},_0x326a6b,_0x52e46d[_0x788c('0x4a')]);return _0x4cad59['getDescriptions'](_0x326a6b);}})[_0x788c('0x30')](function(_0x8c6d17){if(_0x8c6d17){_0xc26db2=_0x8c6d17['length'];if(!_0x52e46d[_0x788c('0x3d')][_0x788c('0x59')](_0x788c('0x40'))){_0x326a6b['limit']=qs['limit'](_0x52e46d[_0x788c('0x3d')][_0x788c('0x2b')]);_0x326a6b['offset']=qs['offset'](_0x52e46d[_0x788c('0x3d')][_0x788c('0x2a')]);}return _0x4cad59[_0x788c('0x5b')](_0x326a6b);}})[_0x788c('0x30')](function(_0x4134b1){if(_0x4134b1){return _0x4134b1?{'count':_0xc26db2,'rows':_0x4134b1}:null;}})[_0x788c('0x30')](respondWithResult(_0x53c1f8,null))[_0x788c('0x51')](handleError(_0x53c1f8,null));};exports[_0x788c('0x5c')]=function(_0x227ab1,_0xe5d243,_0x39d283){var _0x458333={};var _0x404903={};var _0x358294;var _0x3fc528;return db[_0x788c('0x36')][_0x788c('0x56')]({'where':{'id':_0x227ab1['params']['id']}})[_0x788c('0x30')](handleEntityNotFound(_0xe5d243,null))['then'](function(_0x526ff1){if(_0x526ff1){_0x358294=_0x526ff1;_0x404903[_0x788c('0x3a')]=_[_0x788c('0x3b')](db[_0x788c('0x5d')][_0x788c('0x37')]);_0x404903[_0x788c('0x3d')]=_['keys'](_0x227ab1[_0x788c('0x3d')]);_0x404903[_0x788c('0x43')]=_['intersection'](_0x404903[_0x788c('0x3a')],_0x404903[_0x788c('0x3d')]);_0x458333[_0x788c('0x3e')]=_[_0x788c('0x3c')](_0x404903[_0x788c('0x3a')],qs[_0x788c('0x3f')](_0x227ab1[_0x788c('0x3d')][_0x788c('0x3f')]));_0x458333[_0x788c('0x3e')]=_0x458333[_0x788c('0x3e')]['length']?_0x458333[_0x788c('0x3e')]:_0x404903[_0x788c('0x3a')];_0x458333[_0x788c('0x41')]=qs['sort'](_0x227ab1[_0x788c('0x3d')]['sort']);_0x458333[_0x788c('0x46')]=qs[_0x788c('0x43')](_['pick'](_0x227ab1[_0x788c('0x3d')],_0x404903[_0x788c('0x43')]));if(_0x227ab1['query'][_0x788c('0x45')]){_0x458333[_0x788c('0x46')]=_[_0x788c('0x49')](_0x458333[_0x788c('0x46')],{'$or':_['map'](_0x458333['attributes'],function(_0x578fc0){var _0xa57067={};_0xa57067[_0x578fc0]={'$like':'%'+_0x227ab1['query'][_0x788c('0x45')]+'%'};return _0xa57067;})});}_0x458333=_[_0x788c('0x49')]({},_0x458333,_0x227ab1[_0x788c('0x4a')]);return _0x358294[_0x788c('0x5c')](_0x458333);}})[_0x788c('0x30')](function(_0x30abd2){if(_0x30abd2){_0x3fc528=_0x30abd2[_0x788c('0x50')];if(!_0x227ab1[_0x788c('0x3d')][_0x788c('0x59')]('nolimit')){_0x458333['limit']=qs['limit'](_0x227ab1[_0x788c('0x3d')][_0x788c('0x2b')]);_0x458333[_0x788c('0x2a')]=qs[_0x788c('0x2a')](_0x227ab1[_0x788c('0x3d')][_0x788c('0x2a')]);}return _0x358294[_0x788c('0x5c')](_0x458333);}})[_0x788c('0x30')](function(_0x57b199){if(_0x57b199){return _0x57b199?{'count':_0x3fc528,'rows':_0x57b199}:null;}})['then'](respondWithResult(_0xe5d243,null))[_0x788c('0x51')](handleError(_0xe5d243,null));};exports[_0x788c('0x5e')]=function(_0x1e0c46,_0x4558ee,_0x5058db){if(_0x1e0c46['body']['id']){delete _0x1e0c46[_0x788c('0x53')]['id'];}return db[_0x788c('0x36')]['findOne']({'where':{'id':_0x1e0c46[_0x788c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4558ee,null))[_0x788c('0x30')](function(_0x59aefe){if(_0x59aefe){return _0x59aefe['setTags'](_0x1e0c46['body'][_0x788c('0x5f')]||[]);}return null;})['then'](respondWithResult(_0x4558ee,null))[_0x788c('0x51')](handleError(_0x4558ee,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 64d3171..2020614 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 _0x9bd7=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','int_freshdesk_configurations'];(function(_0x28b047,_0x43f50b){var _0x3f79e6=function(_0x132f26){while(--_0x132f26){_0x28b047['push'](_0x28b047['shift']());}};_0x3f79e6(++_0x43f50b);}(_0x9bd7,0xc6));var _0x79bd=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x9bd7[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x79bd('0x0'));var util=require(_0x79bd('0x1'));var logger=require(_0x79bd('0x2'))(_0x79bd('0x3'));var moment=require(_0x79bd('0x4'));var BPromise=require(_0x79bd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x79bd('0x6'));var config=require(_0x79bd('0x7'));var attributes=require(_0x79bd('0x8'));module[_0x79bd('0x9')]=function(_0x2a0183,_0x536272){return _0x2a0183['define']('FreshdeskConfiguration',attributes,{'tableName':_0x79bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ec1=['exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x32e97c,_0x43110f){var _0x99b35e=function(_0x5b9276){while(--_0x5b9276){_0x32e97c['push'](_0x32e97c['shift']());}};_0x99b35e(++_0x43110f);}(_0x7ec1,0x88));var _0x17ec=function(_0x100a08,_0x14ac4a){_0x100a08=_0x100a08-0x0;var _0x2c0900=_0x7ec1[_0x100a08];return _0x2c0900;};'use strict';var _=require(_0x17ec('0x0'));var util=require(_0x17ec('0x1'));var logger=require('../../config/logger')(_0x17ec('0x2'));var moment=require(_0x17ec('0x3'));var BPromise=require(_0x17ec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x17ec('0x5'));var rimraf=require('rimraf');var config=require(_0x17ec('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x17ec('0x7')]=function(_0x149b09,_0x3fe730){return _0x149b09[_0x17ec('0x8')](_0x17ec('0x9'),attributes,{'tableName':_0x17ec('0xa'),'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 13dd047..b09abe8 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 _0x4aa8=['result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5bf524,_0x2a1c56){var _0x1e34c7=function(_0x2908ce){while(--_0x2908ce){_0x5bf524['push'](_0x5bf524['shift']());}};_0x1e34c7(++_0x2a1c56);}(_0x4aa8,0x1e5));var _0x84aa=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x4aa8[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x84aa('0x0'));var util=require(_0x84aa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x84aa('0x2'));var fs=require('fs');var Redis=require(_0x84aa('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x84aa('0x4'));var logger=require(_0x84aa('0x5'))('rpc');var config=require(_0x84aa('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x84aa('0x7')][_0x84aa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2753fb,_0x3c37b8,_0x1dc41c){return new BPromise(function(_0x4f2ff4,_0x2807b5){return client[_0x84aa('0x9')](_0x2753fb,_0x1dc41c)['then'](function(_0x13d5fd){logger[_0x84aa('0xa')](_0x84aa('0xb'),_0x3c37b8,_0x84aa('0xc'));logger[_0x84aa('0xd')](_0x84aa('0xe'),_0x3c37b8,_0x84aa('0xc'),JSON[_0x84aa('0xf')](_0x13d5fd));if(_0x13d5fd[_0x84aa('0x10')]){if(_0x13d5fd[_0x84aa('0x10')][_0x84aa('0x11')]===0x1f4){logger[_0x84aa('0x10')](_0x84aa('0xb'),_0x3c37b8,_0x13d5fd[_0x84aa('0x10')][_0x84aa('0x12')]);return _0x2807b5(_0x13d5fd[_0x84aa('0x10')][_0x84aa('0x12')]);}logger[_0x84aa('0x10')](_0x84aa('0xb'),_0x3c37b8,_0x13d5fd['error']['message']);return _0x4f2ff4(_0x13d5fd[_0x84aa('0x10')]['message']);}else{logger[_0x84aa('0xa')](_0x84aa('0xb'),_0x3c37b8,_0x84aa('0xc'));_0x4f2ff4(_0x13d5fd[_0x84aa('0x13')]['message']);}})[_0x84aa('0x14')](function(_0xfae7c5){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3c37b8,_0xfae7c5);_0x2807b5(_0xfae7c5);});});} \ No newline at end of file +var _0x8fe1=['jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x138501,_0x5b003e){var _0x5c9320=function(_0x4533a8){while(--_0x4533a8){_0x138501['push'](_0x138501['shift']());}};_0x5c9320(++_0x5b003e);}(_0x8fe1,0x6b));var _0x18fe=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0x8fe1[_0x41d432];return _0x1650f9;};'use strict';var _=require(_0x18fe('0x0'));var util=require(_0x18fe('0x1'));var moment=require(_0x18fe('0x2'));var BPromise=require(_0x18fe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x18fe('0x4'))['db'];var utils=require(_0x18fe('0x5'));var logger=require(_0x18fe('0x6'))('rpc');var config=require(_0x18fe('0x7'));var jayson=require(_0x18fe('0x8'));var client=jayson[_0x18fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26965b,_0x5661f5,_0x482903){return new BPromise(function(_0x385537,_0x5c626d){return client[_0x18fe('0xa')](_0x26965b,_0x482903)[_0x18fe('0xb')](function(_0x34e539){logger[_0x18fe('0xc')](_0x18fe('0xd'),_0x5661f5,'request\x20sent');logger[_0x18fe('0xe')](_0x18fe('0xf'),_0x5661f5,_0x18fe('0x10'),JSON[_0x18fe('0x11')](_0x34e539));if(_0x34e539[_0x18fe('0x12')]){if(_0x34e539[_0x18fe('0x12')][_0x18fe('0x13')]===0x1f4){logger['error'](_0x18fe('0xd'),_0x5661f5,_0x34e539[_0x18fe('0x12')][_0x18fe('0x14')]);return _0x5c626d(_0x34e539['error']['message']);}logger[_0x18fe('0x12')](_0x18fe('0xd'),_0x5661f5,_0x34e539[_0x18fe('0x12')][_0x18fe('0x14')]);return _0x385537(_0x34e539[_0x18fe('0x12')][_0x18fe('0x14')]);}else{logger[_0x18fe('0xc')](_0x18fe('0xd'),_0x5661f5,'request\x20sent');_0x385537(_0x34e539[_0x18fe('0x15')][_0x18fe('0x14')]);}})[_0x18fe('0x16')](function(_0x414e14){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5661f5,_0x414e14);_0x5c626d(_0x414e14);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 4c5af29..75110f7 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 _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x34e8,0x12c));var _0x834e=function(_0x317c67,_0x5901a7){_0x317c67=_0x317c67-0x0;var _0x25fbf9=_0x34e8[_0x317c67];return _0x25fbf9;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0xc')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);module[_0x834e('0x13')]=router; \ No newline at end of file +var _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x34e8,0x12c));var _0x834e=function(_0x4e5907,_0x5d541d){_0x4e5907=_0x4e5907-0x0;var _0x457de5=_0x34e8[_0x4e5907];return _0x457de5;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0xc')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);module[_0x834e('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 39f14ce..3d25a98 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 _0xbe22=['exports','variable','customVariable','keyValue','string','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x22023b,_0x559d64){var _0x26534f=function(_0x2912a0){while(--_0x2912a0){_0x22023b['push'](_0x22023b['shift']());}};_0x26534f(++_0x559d64);}(_0xbe22,0x1c1));var _0x2be2=function(_0x16308f,_0x2a5854){_0x16308f=_0x16308f-0x0;var _0x4a4289=_0xbe22[_0x16308f];return _0x4a4289;};'use strict';var Sequelize=require(_0x2be2('0x0'));module[_0x2be2('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x2be2('0x2'),_0x2be2('0x3'),_0x2be2('0x4')),'defaultValue':_0x2be2('0x5')},'content':{'type':Sequelize[_0x2be2('0x6')]},'key':{'type':Sequelize[_0x2be2('0x6')]},'keyType':{'type':Sequelize[_0x2be2('0x7')](_0x2be2('0x5'),_0x2be2('0x2'),_0x2be2('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2be2('0x6')]},'nameField':{'type':Sequelize[_0x2be2('0x6')]},'customField':{'type':Sequelize[_0x2be2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2624=['variable','customVariable','keyValue','STRING','ENUM','sequelize','exports','string'];(function(_0x5c41e9,_0x435daf){var _0x2dcb5c=function(_0x3e8ebb){while(--_0x3e8ebb){_0x5c41e9['push'](_0x5c41e9['shift']());}};_0x2dcb5c(++_0x435daf);}(_0x2624,0x75));var _0x4262=function(_0x3f91ad,_0x3510c3){_0x3f91ad=_0x3f91ad-0x0;var _0x2409f7=_0x2624[_0x3f91ad];return _0x2409f7;};'use strict';var Sequelize=require(_0x4262('0x0'));module[_0x4262('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4262('0x2'),_0x4262('0x3'),_0x4262('0x4'),_0x4262('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4262('0x6')]},'key':{'type':Sequelize[_0x4262('0x6')]},'keyType':{'type':Sequelize[_0x4262('0x7')]('string','variable',_0x4262('0x4'))},'keyContent':{'type':Sequelize[_0x4262('0x6')]},'idField':{'type':Sequelize[_0x4262('0x6')]},'nameField':{'type':Sequelize[_0x4262('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 8cff54b..4ff4f5f 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 _0x476f=['status','offset','limit','set','Content-Range','json','update','destroy','then','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','options','count','include','findAll','rows','catch','show','keys','length','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0xb745bf,_0x558c50){var _0x27ca42=function(_0x33b0ad){while(--_0x33b0ad){_0xb745bf['push'](_0xb745bf['shift']());}};_0x27ca42(++_0x558c50);}(_0x476f,0x1ea));var _0xf476=function(_0x5e084a,_0x455aca){_0x5e084a=_0x5e084a-0x0;var _0x348e69=_0x476f[_0x5e084a];return _0x348e69;};'use strict';var pdf=require(_0xf476('0x0'));var emlformat=require(_0xf476('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf476('0x2'));var jsonpatch=require(_0xf476('0x3'));var rp=require(_0xf476('0x4'));var moment=require(_0xf476('0x5'));var BPromise=require(_0xf476('0x6'));var Mustache=require(_0xf476('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf476('0x8'));var csv=require(_0xf476('0x9'));var ejs=require(_0xf476('0xa'));var fs=require('fs');var _=require(_0xf476('0xb'));var squel=require(_0xf476('0xc'));var crypto=require(_0xf476('0xd'));var jsforce=require(_0xf476('0xe'));var deskjs=require(_0xf476('0xf'));var toCsv=require(_0xf476('0x9'));var querystring=require(_0xf476('0x10'));var Papa=require(_0xf476('0x11'));var Redis=require(_0xf476('0x12'));var authService=require(_0xf476('0x13'));var qs=require(_0xf476('0x14'));var as=require(_0xf476('0x15'));var hardwareService=require(_0xf476('0x16'));var logger=require(_0xf476('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xf476('0x18'));var db=require(_0xf476('0x19'))['db'];function respondWithStatusCode(_0x5cea96,_0x5b9ef4){_0x5b9ef4=_0x5b9ef4||0xcc;return function(_0x2808d2){if(_0x2808d2){return _0x5cea96[_0xf476('0x1a')](_0x5b9ef4);}return _0x5cea96['status'](_0x5b9ef4)[_0xf476('0x1b')]();};}function respondWithResult(_0x5e1cf3,_0x56a1bc){_0x56a1bc=_0x56a1bc||0xc8;return function(_0x5c2ebf){if(_0x5c2ebf){return _0x5e1cf3[_0xf476('0x1c')](_0x56a1bc)['json'](_0x5c2ebf);}};}function respondWithFilteredResult(_0x390c5a,_0x85e0a3){return function(_0x1abebc){if(_0x1abebc){var _0x2961b5=_0x1abebc['count'],_0x945af=_0x85e0a3['offset'],_0x447696=_0x85e0a3[_0xf476('0x1d')]+_0x85e0a3[_0xf476('0x1e')],_0x5d2aaa;if(_0x447696>=_0x2961b5){_0x447696=_0x2961b5;_0x5d2aaa=0xc8;}else{_0x5d2aaa=0xce;}_0x390c5a['status'](_0x5d2aaa);return _0x390c5a[_0xf476('0x1f')](_0xf476('0x20'),_0x945af+'-'+_0x447696+'/'+_0x2961b5)[_0xf476('0x21')](_0x1abebc);}return null;};}function patchUpdates(_0x26cfa3){return function(_0x28e57b){try{jsonpatch['apply'](_0x28e57b,_0x26cfa3,!![]);}catch(_0x56763d){return BPromise['reject'](_0x56763d);}return _0x28e57b['save']();};}function saveUpdates(_0x567642,_0x15b8a5){return function(_0x21bd84){if(_0x21bd84){return _0x21bd84[_0xf476('0x22')](_0x567642)['then'](function(_0x294be9){return _0x294be9;});}return null;};}function removeEntity(_0x4dc634,_0xedbd7b){return function(_0x40b8da){if(_0x40b8da){return _0x40b8da[_0xf476('0x23')]()[_0xf476('0x24')](function(){_0x4dc634[_0xf476('0x1c')](0xcc)[_0xf476('0x1b')]();});}};}function handleEntityNotFound(_0x4ce637,_0x5db2dc){return function(_0x33d2d9){if(!_0x33d2d9){_0x4ce637[_0xf476('0x1a')](0x194);}return _0x33d2d9;};}function handleError(_0x48b7cb,_0x402169){_0x402169=_0x402169||0x1f4;return function(_0x30f9db){logger[_0xf476('0x25')](_0x30f9db[_0xf476('0x26')]);if(_0x30f9db['name']){delete _0x30f9db[_0xf476('0x27')];}_0x48b7cb['status'](_0x402169)[_0xf476('0x28')](_0x30f9db);};}exports[_0xf476('0x29')]=function(_0x29cb97,_0x1b0bea){var _0x4b1d1a={},_0x948e={},_0x3552={'count':0x0,'rows':[]};var _0x2af266=_[_0xf476('0x2a')](db[_0xf476('0x2b')][_0xf476('0x2c')],function(_0x427403){return{'name':_0x427403[_0xf476('0x2d')],'type':_0x427403['type'][_0xf476('0x2e')]};});_0x948e[_0xf476('0x2f')]=_['map'](_0x2af266,'name');_0x948e[_0xf476('0x30')]=_['keys'](_0x29cb97[_0xf476('0x30')]);_0x948e[_0xf476('0x31')]=_[_0xf476('0x32')](_0x948e[_0xf476('0x2f')],_0x948e['query']);_0x4b1d1a[_0xf476('0x33')]=_[_0xf476('0x32')](_0x948e[_0xf476('0x2f')],qs[_0xf476('0x34')](_0x29cb97[_0xf476('0x30')][_0xf476('0x34')]));_0x4b1d1a['attributes']=_0x4b1d1a[_0xf476('0x33')]['length']?_0x4b1d1a[_0xf476('0x33')]:_0x948e[_0xf476('0x2f')];if(!_0x29cb97[_0xf476('0x30')]['hasOwnProperty'](_0xf476('0x35'))){_0x4b1d1a[_0xf476('0x1e')]=qs[_0xf476('0x1e')](_0x29cb97[_0xf476('0x30')][_0xf476('0x1e')]);_0x4b1d1a['offset']=qs[_0xf476('0x1d')](_0x29cb97[_0xf476('0x30')][_0xf476('0x1d')]);}_0x4b1d1a[_0xf476('0x36')]=qs[_0xf476('0x37')](_0x29cb97[_0xf476('0x30')][_0xf476('0x37')]);_0x4b1d1a[_0xf476('0x38')]=qs[_0xf476('0x31')](_[_0xf476('0x39')](_0x29cb97['query'],_0x948e[_0xf476('0x31')]));if(_0x29cb97['query'][_0xf476('0x3a')]){_0x4b1d1a[_0xf476('0x38')]=_[_0xf476('0x3b')](_0x4b1d1a['where'],{'$or':_['map'](_0x2af266,function(_0x2e4511){if(_0x2e4511[_0xf476('0x3c')]!=='VIRTUAL'){var _0x102885={};_0x102885[_0x2e4511['name']]={'$like':'%'+_0x29cb97['query'][_0xf476('0x3a')]+'%'};return _0x102885;}})});}_0x4b1d1a=_[_0xf476('0x3b')]({},_0x4b1d1a,_0x29cb97[_0xf476('0x3d')]);var _0x3f14bc={'where':_0x4b1d1a[_0xf476('0x38')]};return db[_0xf476('0x2b')][_0xf476('0x3e')](_0x3f14bc)[_0xf476('0x24')](function(_0x202434){_0x3552[_0xf476('0x3e')]=_0x202434;if(_0x29cb97[_0xf476('0x30')]['includeAll']){_0x4b1d1a[_0xf476('0x3f')]=[{'all':!![]}];}return db[_0xf476('0x2b')][_0xf476('0x40')](_0x4b1d1a);})[_0xf476('0x24')](function(_0x5e17ca){_0x3552[_0xf476('0x41')]=_0x5e17ca;return _0x3552;})[_0xf476('0x24')](respondWithFilteredResult(_0x1b0bea,_0x4b1d1a))[_0xf476('0x42')](handleError(_0x1b0bea,null));};exports[_0xf476('0x43')]=function(_0x187041,_0x4985e0){var _0x32b8d2={'raw':!![],'where':{'id':_0x187041['params']['id']}},_0x37dea4={};_0x37dea4[_0xf476('0x2f')]=_[_0xf476('0x44')](db[_0xf476('0x2b')][_0xf476('0x2c')]);_0x37dea4[_0xf476('0x30')]=_[_0xf476('0x44')](_0x187041[_0xf476('0x30')]);_0x37dea4[_0xf476('0x31')]=_[_0xf476('0x32')](_0x37dea4[_0xf476('0x2f')],_0x37dea4[_0xf476('0x30')]);_0x32b8d2[_0xf476('0x33')]=_['intersection'](_0x37dea4[_0xf476('0x2f')],qs[_0xf476('0x34')](_0x187041[_0xf476('0x30')][_0xf476('0x34')]));_0x32b8d2['attributes']=_0x32b8d2[_0xf476('0x33')][_0xf476('0x45')]?_0x32b8d2[_0xf476('0x33')]:_0x37dea4[_0xf476('0x2f')];if(_0x187041['query']['includeAll']){_0x32b8d2[_0xf476('0x3f')]=[{'all':!![]}];}_0x32b8d2=_[_0xf476('0x3b')]({},_0x32b8d2,_0x187041[_0xf476('0x3d')]);return db['FreshdeskField'][_0xf476('0x46')](_0x32b8d2)[_0xf476('0x24')](handleEntityNotFound(_0x4985e0,null))[_0xf476('0x24')](respondWithResult(_0x4985e0,null))[_0xf476('0x42')](handleError(_0x4985e0,null));};exports[_0xf476('0x47')]=function(_0x242aec,_0x5a9bbc){return db[_0xf476('0x2b')][_0xf476('0x47')](_0x242aec[_0xf476('0x48')],{})[_0xf476('0x24')](respondWithResult(_0x5a9bbc,0xc9))['catch'](handleError(_0x5a9bbc,null));};exports[_0xf476('0x22')]=function(_0x4b7c3b,_0x35ec79){if(_0x4b7c3b[_0xf476('0x48')]['id']){delete _0x4b7c3b['body']['id'];}return db[_0xf476('0x2b')][_0xf476('0x46')]({'where':{'id':_0x4b7c3b[_0xf476('0x49')]['id']}})[_0xf476('0x24')](handleEntityNotFound(_0x35ec79,null))[_0xf476('0x24')](saveUpdates(_0x4b7c3b[_0xf476('0x48')],null))[_0xf476('0x24')](respondWithResult(_0x35ec79,null))['catch'](handleError(_0x35ec79,null));};exports[_0xf476('0x23')]=function(_0x2d4d8d,_0x9c120){return db['FreshdeskField']['find']({'where':{'id':_0x2d4d8d[_0xf476('0x49')]['id']}})[_0xf476('0x24')](handleEntityNotFound(_0x9c120,null))['then'](removeEntity(_0x9c120,null))[_0xf476('0x42')](handleError(_0x9c120,null));}; \ No newline at end of file +var _0x3ee1=['reject','save','update','then','destroy','end','error','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','length','find','catch','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range'];(function(_0x42ae9c,_0x650483){var _0x313897=function(_0x3e58fc){while(--_0x3e58fc){_0x42ae9c['push'](_0x42ae9c['shift']());}};_0x313897(++_0x650483);}(_0x3ee1,0x71));var _0x13ee=function(_0x5837e3,_0x28b582){_0x5837e3=_0x5837e3-0x0;var _0x8bf499=_0x3ee1[_0x5837e3];return _0x8bf499;};'use strict';var pdf=require(_0x13ee('0x0'));var emlformat=require(_0x13ee('0x1'));var rimraf=require(_0x13ee('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13ee('0x3'));var rp=require(_0x13ee('0x4'));var moment=require(_0x13ee('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x13ee('0x6'));var util=require(_0x13ee('0x7'));var path=require(_0x13ee('0x8'));var sox=require(_0x13ee('0x9'));var csv=require(_0x13ee('0xa'));var ejs=require(_0x13ee('0xb'));var fs=require('fs');var _=require(_0x13ee('0xc'));var squel=require(_0x13ee('0xd'));var crypto=require(_0x13ee('0xe'));var jsforce=require(_0x13ee('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x13ee('0xa'));var querystring=require(_0x13ee('0x10'));var Papa=require(_0x13ee('0x11'));var Redis=require('ioredis');var authService=require(_0x13ee('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x13ee('0x13'));var hardwareService=require(_0x13ee('0x14'));var logger=require(_0x13ee('0x15'))('api');var utils=require(_0x13ee('0x16'));var config=require(_0x13ee('0x17'));var db=require(_0x13ee('0x18'))['db'];function respondWithStatusCode(_0x5dafe2,_0x49c1e2){_0x49c1e2=_0x49c1e2||0xcc;return function(_0x5ae3df){if(_0x5ae3df){return _0x5dafe2[_0x13ee('0x19')](_0x49c1e2);}return _0x5dafe2[_0x13ee('0x1a')](_0x49c1e2)['end']();};}function respondWithResult(_0x2f7990,_0x315be6){_0x315be6=_0x315be6||0xc8;return function(_0x2c29aa){if(_0x2c29aa){return _0x2f7990['status'](_0x315be6)[_0x13ee('0x1b')](_0x2c29aa);}};}function respondWithFilteredResult(_0x4ab9c1,_0xa4171){return function(_0x2382d6){if(_0x2382d6){var _0x2254d3=_0x2382d6[_0x13ee('0x1c')],_0x35d148=_0xa4171['offset'],_0x4008c8=_0xa4171[_0x13ee('0x1d')]+_0xa4171[_0x13ee('0x1e')],_0x128a40;if(_0x4008c8>=_0x2254d3){_0x4008c8=_0x2254d3;_0x128a40=0xc8;}else{_0x128a40=0xce;}_0x4ab9c1[_0x13ee('0x1a')](_0x128a40);return _0x4ab9c1[_0x13ee('0x1f')](_0x13ee('0x20'),_0x35d148+'-'+_0x4008c8+'/'+_0x2254d3)[_0x13ee('0x1b')](_0x2382d6);}return null;};}function patchUpdates(_0x2759a1){return function(_0x135728){try{jsonpatch['apply'](_0x135728,_0x2759a1,!![]);}catch(_0x5486ca){return BPromise[_0x13ee('0x21')](_0x5486ca);}return _0x135728[_0x13ee('0x22')]();};}function saveUpdates(_0x39994b,_0x5bd9be){return function(_0x6fc11c){if(_0x6fc11c){return _0x6fc11c[_0x13ee('0x23')](_0x39994b)[_0x13ee('0x24')](function(_0x3ff7e0){return _0x3ff7e0;});}return null;};}function removeEntity(_0x1a2e0e,_0x5ac3a8){return function(_0x4e8e38){if(_0x4e8e38){return _0x4e8e38[_0x13ee('0x25')]()[_0x13ee('0x24')](function(){_0x1a2e0e[_0x13ee('0x1a')](0xcc)[_0x13ee('0x26')]();});}};}function handleEntityNotFound(_0x5a4e4e,_0x199eb6){return function(_0x1933d7){if(!_0x1933d7){_0x5a4e4e[_0x13ee('0x19')](0x194);}return _0x1933d7;};}function handleError(_0x249c3d,_0x2bdb65){_0x2bdb65=_0x2bdb65||0x1f4;return function(_0x1f09f4){logger[_0x13ee('0x27')](_0x1f09f4['stack']);if(_0x1f09f4['name']){delete _0x1f09f4[_0x13ee('0x28')];}_0x249c3d[_0x13ee('0x1a')](_0x2bdb65)[_0x13ee('0x29')](_0x1f09f4);};}exports[_0x13ee('0x2a')]=function(_0x4ac5e7,_0x11a9b9){var _0x7b28d6={},_0x110204={},_0x3943eb={'count':0x0,'rows':[]};var _0x2536b1=_[_0x13ee('0x2b')](db[_0x13ee('0x2c')][_0x13ee('0x2d')],function(_0x90144c){return{'name':_0x90144c[_0x13ee('0x2e')],'type':_0x90144c[_0x13ee('0x2f')][_0x13ee('0x30')]};});_0x110204[_0x13ee('0x31')]=_[_0x13ee('0x2b')](_0x2536b1,_0x13ee('0x28'));_0x110204[_0x13ee('0x32')]=_[_0x13ee('0x33')](_0x4ac5e7[_0x13ee('0x32')]);_0x110204[_0x13ee('0x34')]=_[_0x13ee('0x35')](_0x110204['model'],_0x110204['query']);_0x7b28d6[_0x13ee('0x36')]=_[_0x13ee('0x35')](_0x110204[_0x13ee('0x31')],qs['fields'](_0x4ac5e7[_0x13ee('0x32')][_0x13ee('0x37')]));_0x7b28d6[_0x13ee('0x36')]=_0x7b28d6[_0x13ee('0x36')]['length']?_0x7b28d6['attributes']:_0x110204[_0x13ee('0x31')];if(!_0x4ac5e7[_0x13ee('0x32')][_0x13ee('0x38')](_0x13ee('0x39'))){_0x7b28d6[_0x13ee('0x1e')]=qs[_0x13ee('0x1e')](_0x4ac5e7['query'][_0x13ee('0x1e')]);_0x7b28d6[_0x13ee('0x1d')]=qs[_0x13ee('0x1d')](_0x4ac5e7['query'][_0x13ee('0x1d')]);}_0x7b28d6[_0x13ee('0x3a')]=qs[_0x13ee('0x3b')](_0x4ac5e7[_0x13ee('0x32')][_0x13ee('0x3b')]);_0x7b28d6[_0x13ee('0x3c')]=qs['filters'](_[_0x13ee('0x3d')](_0x4ac5e7[_0x13ee('0x32')],_0x110204['filters']));if(_0x4ac5e7[_0x13ee('0x32')][_0x13ee('0x3e')]){_0x7b28d6['where']=_['merge'](_0x7b28d6['where'],{'$or':_[_0x13ee('0x2b')](_0x2536b1,function(_0x3beddc){if(_0x3beddc[_0x13ee('0x2f')]!=='VIRTUAL'){var _0x5110e9={};_0x5110e9[_0x3beddc[_0x13ee('0x28')]]={'$like':'%'+_0x4ac5e7['query'][_0x13ee('0x3e')]+'%'};return _0x5110e9;}})});}_0x7b28d6=_[_0x13ee('0x3f')]({},_0x7b28d6,_0x4ac5e7[_0x13ee('0x40')]);var _0x2cef98={'where':_0x7b28d6[_0x13ee('0x3c')]};return db['FreshdeskField'][_0x13ee('0x1c')](_0x2cef98)[_0x13ee('0x24')](function(_0x2d0519){_0x3943eb[_0x13ee('0x1c')]=_0x2d0519;if(_0x4ac5e7[_0x13ee('0x32')][_0x13ee('0x41')]){_0x7b28d6[_0x13ee('0x42')]=[{'all':!![]}];}return db[_0x13ee('0x2c')][_0x13ee('0x43')](_0x7b28d6);})[_0x13ee('0x24')](function(_0x12f8a7){_0x3943eb['rows']=_0x12f8a7;return _0x3943eb;})['then'](respondWithFilteredResult(_0x11a9b9,_0x7b28d6))['catch'](handleError(_0x11a9b9,null));};exports['show']=function(_0x4eca4a,_0x4847bc){var _0x384ec1={'raw':!![],'where':{'id':_0x4eca4a['params']['id']}},_0x34df18={};_0x34df18[_0x13ee('0x31')]=_[_0x13ee('0x33')](db['FreshdeskField'][_0x13ee('0x2d')]);_0x34df18[_0x13ee('0x32')]=_[_0x13ee('0x33')](_0x4eca4a[_0x13ee('0x32')]);_0x34df18[_0x13ee('0x34')]=_[_0x13ee('0x35')](_0x34df18['model'],_0x34df18[_0x13ee('0x32')]);_0x384ec1[_0x13ee('0x36')]=_['intersection'](_0x34df18[_0x13ee('0x31')],qs['fields'](_0x4eca4a[_0x13ee('0x32')][_0x13ee('0x37')]));_0x384ec1[_0x13ee('0x36')]=_0x384ec1[_0x13ee('0x36')][_0x13ee('0x44')]?_0x384ec1[_0x13ee('0x36')]:_0x34df18['model'];if(_0x4eca4a['query'][_0x13ee('0x41')]){_0x384ec1[_0x13ee('0x42')]=[{'all':!![]}];}_0x384ec1=_['merge']({},_0x384ec1,_0x4eca4a[_0x13ee('0x40')]);return db[_0x13ee('0x2c')][_0x13ee('0x45')](_0x384ec1)['then'](handleEntityNotFound(_0x4847bc,null))[_0x13ee('0x24')](respondWithResult(_0x4847bc,null))[_0x13ee('0x46')](handleError(_0x4847bc,null));};exports['create']=function(_0x349062,_0x350e4d){return db[_0x13ee('0x2c')]['create'](_0x349062[_0x13ee('0x47')],{})[_0x13ee('0x24')](respondWithResult(_0x350e4d,0xc9))[_0x13ee('0x46')](handleError(_0x350e4d,null));};exports[_0x13ee('0x23')]=function(_0x1fceda,_0x3d7a3a){if(_0x1fceda[_0x13ee('0x47')]['id']){delete _0x1fceda[_0x13ee('0x47')]['id'];}return db[_0x13ee('0x2c')][_0x13ee('0x45')]({'where':{'id':_0x1fceda[_0x13ee('0x48')]['id']}})[_0x13ee('0x24')](handleEntityNotFound(_0x3d7a3a,null))['then'](saveUpdates(_0x1fceda[_0x13ee('0x47')],null))[_0x13ee('0x24')](respondWithResult(_0x3d7a3a,null))['catch'](handleError(_0x3d7a3a,null));};exports[_0x13ee('0x25')]=function(_0x14c2ed,_0x5b6a26){return db['FreshdeskField'][_0x13ee('0x45')]({'where':{'id':_0x14c2ed[_0x13ee('0x48')]['id']}})[_0x13ee('0x24')](handleEntityNotFound(_0x5b6a26,null))['then'](removeEntity(_0x5b6a26,null))[_0x13ee('0x46')](handleError(_0x5b6a26,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 0e719c2..6627652 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 _0x344f=['./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','idField','FieldId','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x4b4638,_0xe99cda){var _0x59e92b=function(_0x2817ea){while(--_0x2817ea){_0x4b4638['push'](_0x4b4638['shift']());}};_0x59e92b(++_0xe99cda);}(_0x344f,0x95));var _0xf344=function(_0xf148c3,_0x10f825){_0xf148c3=_0xf148c3-0x0;var _0x5ec564=_0x344f[_0xf148c3];return _0x5ec564;};'use strict';var _=require(_0xf344('0x0'));var util=require(_0xf344('0x1'));var logger=require(_0xf344('0x2'))('api');var moment=require(_0xf344('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf344('0x4'));var rimraf=require(_0xf344('0x5'));var config=require(_0xf344('0x6'));var attributes=require(_0xf344('0x7'));module[_0xf344('0x8')]=function(_0x40c040,_0xccc72b){return _0x40c040[_0xf344('0x9')]('FreshdeskField',attributes,{'tableName':_0xf344('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xf344('0xb'),_0xf344('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5015=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash'];(function(_0x41a8f6,_0x26b018){var _0x4e2ada=function(_0x185b60){while(--_0x185b60){_0x41a8f6['push'](_0x41a8f6['shift']());}};_0x4e2ada(++_0x26b018);}(_0x5015,0x8e));var _0x5501=function(_0x2e216b,_0x515830){_0x2e216b=_0x2e216b-0x0;var _0x1652ff=_0x5015[_0x2e216b];return _0x1652ff;};'use strict';var _=require(_0x5501('0x0'));var util=require(_0x5501('0x1'));var logger=require(_0x5501('0x2'))(_0x5501('0x3'));var moment=require(_0x5501('0x4'));var BPromise=require(_0x5501('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5501('0x6'));var config=require(_0x5501('0x7'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x564388,_0x10041f){return _0x564388[_0x5501('0x8')](_0x5501('0x9'),attributes,{'tableName':_0x5501('0xa'),'paranoid':![],'indexes':[{'name':_0x5501('0xb'),'fields':['idField',_0x5501('0xc')],'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 faee7d9..7be3fa0 100644 --- a/server/api/intFreshdeskField/intFreshdeskField.rpc.js +++ b/server/api/intFreshdeskField/intFreshdeskField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x49392c,_0x3b171e){var _0x2baf29=function(_0x36d6b9){while(--_0x36d6b9){_0x49392c['push'](_0x49392c['shift']());}};_0x2baf29(++_0x3b171e);}(_0xb10b,0x12a));var _0xbb10=function(_0x4f7b43,_0x119c22){_0x4f7b43=_0x4f7b43-0x0;var _0x2fcdf3=_0xb10b[_0x4f7b43];return _0x2fcdf3;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xb39f9a,_0x3ecf69){var _0x4995d9=function(_0xbf653c){while(--_0xbf653c){_0xb39f9a['push'](_0xb39f9a['shift']());}};_0x4995d9(++_0x3ecf69);}(_0xb10b,0x12a));var _0xbb10=function(_0xfec81c,_0x3f7f63){_0xfec81c=_0xfec81c-0x0;var _0x5d21f6=_0xb10b[_0xfec81c];return _0x5d21f6;};'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 42f1199..24217fe 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 _0x5a42=['exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','index','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','destroy'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0x5a42,0x9b));var _0x25a4=function(_0x324880,_0x3edcf4){_0x324880=_0x324880-0x0;var _0x1e7981=_0x5a42[_0x324880];return _0x1e7981;};'use strict';var multer=require(_0x25a4('0x0'));var util=require(_0x25a4('0x1'));var path=require(_0x25a4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x25a4('0x3')]();var auth=require(_0x25a4('0x4'));var interaction=require(_0x25a4('0x5'));var config=require(_0x25a4('0x6'));var controller=require(_0x25a4('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x25a4('0x8')]);router[_0x25a4('0x9')](_0x25a4('0xa'),auth[_0x25a4('0xb')](),controller['show']);router[_0x25a4('0x9')](_0x25a4('0xc'),auth[_0x25a4('0xb')](),controller[_0x25a4('0xd')]);router['get']('/:id/fields',auth[_0x25a4('0xb')](),controller[_0x25a4('0xe')]);router[_0x25a4('0xf')]('/',auth[_0x25a4('0xb')](),controller[_0x25a4('0x10')]);router[_0x25a4('0xf')]('/:id/configurations',auth[_0x25a4('0xb')](),controller[_0x25a4('0x11')]);router[_0x25a4('0x12')](_0x25a4('0xa'),auth[_0x25a4('0xb')](),controller[_0x25a4('0x13')]);router['delete'](_0x25a4('0xa'),auth['isAuthenticated'](),controller[_0x25a4('0x14')]);module[_0x25a4('0x15')]=router; \ No newline at end of file +var _0xd154=['/:id','show','getConfigurations','/:id/fields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','isAuthenticated','get'];(function(_0x4ac46f,_0xd6ae80){var _0x43c31b=function(_0x54591a){while(--_0x54591a){_0x4ac46f['push'](_0x4ac46f['shift']());}};_0x43c31b(++_0xd6ae80);}(_0xd154,0xde));var _0x4d15=function(_0x1bd13c,_0x53bdd3){_0x1bd13c=_0x1bd13c-0x0;var _0x8dd2ea=_0xd154[_0x1bd13c];return _0x8dd2ea;};'use strict';var multer=require('multer');var util=require(_0x4d15('0x0'));var path=require(_0x4d15('0x1'));var timeout=require(_0x4d15('0x2'));var express=require(_0x4d15('0x3'));var router=express['Router']();var auth=require(_0x4d15('0x4'));var interaction=require(_0x4d15('0x5'));var config=require('../../config/environment');var controller=require(_0x4d15('0x6'));router['get']('/',auth[_0x4d15('0x7')](),controller['index']);router[_0x4d15('0x8')](_0x4d15('0x9'),auth[_0x4d15('0x7')](),controller[_0x4d15('0xa')]);router[_0x4d15('0x8')]('/:id/configurations',auth[_0x4d15('0x7')](),controller[_0x4d15('0xb')]);router['get'](_0x4d15('0xc'),auth[_0x4d15('0x7')](),controller['getFields']);router[_0x4d15('0xd')]('/',auth[_0x4d15('0x7')](),controller['create']);router[_0x4d15('0xd')](_0x4d15('0xe'),auth[_0x4d15('0x7')](),controller[_0x4d15('0xf')]);router[_0x4d15('0x10')](_0x4d15('0x9'),auth[_0x4d15('0x7')](),controller[_0x4d15('0x11')]);router[_0x4d15('0x12')](_0x4d15('0x9'),auth[_0x4d15('0x7')](),controller[_0x4d15('0x13')]);module[_0x4d15('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 5a049b7..ec76afa 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 _0xd9fb=['STRING','username','remoteUri','sequelize','exports'];(function(_0x5eac4b,_0x54b278){var _0x318d8a=function(_0x307e3a){while(--_0x307e3a){_0x5eac4b['push'](_0x5eac4b['shift']());}};_0x318d8a(++_0x54b278);}(_0xd9fb,0x189));var _0xbd9f=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xd9fb[_0x68ee8b];return _0x5148f7;};'use strict';var Sequelize=require(_0xbd9f('0x0'));module[_0xbd9f('0x1')]={'name':{'type':Sequelize[_0xbd9f('0x2')]},'description':{'type':Sequelize[_0xbd9f('0x2')]},'username':{'type':Sequelize[_0xbd9f('0x2')],'unique':_0xbd9f('0x3')},'apiKey':{'type':Sequelize[_0xbd9f('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xbd9f('0x4')},'serverUrl':{'type':Sequelize[_0xbd9f('0x2')]}}; \ No newline at end of file +var _0x1cbc=['sequelize','STRING','username','remoteUri'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x1cbc,0xf4));var _0xc1cb=function(_0x32e2f6,_0x11e862){_0x32e2f6=_0x32e2f6-0x0;var _0x109fa7=_0x1cbc[_0x32e2f6];return _0x109fa7;};'use strict';var Sequelize=require(_0xc1cb('0x0'));module['exports']={'name':{'type':Sequelize[_0xc1cb('0x1')]},'description':{'type':Sequelize[_0xc1cb('0x1')]},'username':{'type':Sequelize[_0xc1cb('0x1')],'unique':_0xc1cb('0x2')},'apiKey':{'type':Sequelize[_0xc1cb('0x1')]},'remoteUri':{'type':Sequelize[_0xc1cb('0x1')],'unique':_0xc1cb('0x3')},'serverUrl':{'type':Sequelize[_0xc1cb('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 2cecf9a..91d9708 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 _0xdefd=['getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','http','Sequelize','ValidationError','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','apply','save','update','destroy','name','send','index','map','FreshsalesAccount','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','findAll','rows','show','length','includeAll','include','find','create','body','params','getConfigurations','findOne','rawAttributes','options','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','Descriptions','username','apiKey','slice','substring','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode'];(function(_0x5d7b19,_0xed2eb2){var _0x8d49d0=function(_0x12ab43){while(--_0x12ab43){_0x5d7b19['push'](_0x5d7b19['shift']());}};_0x8d49d0(++_0xed2eb2);}(_0xdefd,0x14a));var _0xddef=function(_0x52a7e2,_0x5a87e8){_0x52a7e2=_0x52a7e2-0x0;var _0x5387df=_0xdefd[_0x52a7e2];return _0x5387df;};'use strict';var pdf=require(_0xddef('0x0'));var emlformat=require(_0xddef('0x1'));var rimraf=require(_0xddef('0x2'));var zipdir=require(_0xddef('0x3'));var jsonpatch=require(_0xddef('0x4'));var rp=require(_0xddef('0x5'));var moment=require(_0xddef('0x6'));var BPromise=require(_0xddef('0x7'));var Mustache=require(_0xddef('0x8'));var util=require(_0xddef('0x9'));var path=require('path');var sox=require(_0xddef('0xa'));var csv=require('to-csv');var ejs=require(_0xddef('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xddef('0xc'));var jsforce=require(_0xddef('0xd'));var deskjs=require(_0xddef('0xe'));var toCsv=require('to-csv');var querystring=require(_0xddef('0xf'));var Papa=require('papaparse');var Redis=require(_0xddef('0x10'));var authService=require(_0xddef('0x11'));var qs=require(_0xddef('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddef('0x13'));var logger=require(_0xddef('0x14'))('api');var utils=require(_0xddef('0x15'));var config=require(_0xddef('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xddef('0x17'));var jayson=require('jayson/promise');var client=jayson['client'][_0xddef('0x18')]({'port':0x232a});function checkPasswordPattern(_0x44bd77,_0x2d8ede,_0x395360){if(_0x395360){var _0x5c82d7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c82d7['test'](_0x2d8ede)){return _0x44bd77;}else{throw new db[(_0xddef('0x19'))][(_0xddef('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x44bd77;}}function respondWithRpcPromise(_0x3cb62b,_0x4b0b31,_0x67a9be,_0x881e81){return new BPromise(function(_0x314695,_0x35ca76){var _0x768bfe=_0x881e81||client;return _0x768bfe[_0xddef('0x1b')](_0x3cb62b,_0x67a9be)[_0xddef('0x1c')](function(_0x44d11a){logger['info'](_0xddef('0x1d'),_0x4b0b31,_0xddef('0x1e'));logger['debug'](_0xddef('0x1f'),_0x4b0b31,'request\x20sent',JSON[_0xddef('0x20')](_0x44d11a));if(_0x44d11a[_0xddef('0x21')]){if(_0x44d11a['error'][_0xddef('0x22')]===0x1f4){logger[_0xddef('0x21')](_0xddef('0x1d'),_0x4b0b31,_0x44d11a[_0xddef('0x21')]['message']);return _0x35ca76(_0x44d11a['error'][_0xddef('0x23')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x4b0b31,_0x44d11a[_0xddef('0x21')][_0xddef('0x23')]);return _0x314695(_0x44d11a[_0xddef('0x21')]['message']);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x4b0b31,'request\x20sent');_0x314695(_0x44d11a[_0xddef('0x24')]['message']);}})[_0xddef('0x25')](function(_0x1bcacb){logger['error'](_0xddef('0x1d'),_0x4b0b31,_0x1bcacb);_0x35ca76(_0x1bcacb);});});}function respondWithStatusCode(_0x10a2a3,_0x8de858){_0x8de858=_0x8de858||0xcc;return function(_0x5e57f0){if(_0x5e57f0){return _0x10a2a3[_0xddef('0x26')](_0x8de858);}return _0x10a2a3['status'](_0x8de858)[_0xddef('0x27')]();};}function respondWithResult(_0x23883b,_0x387e68){_0x387e68=_0x387e68||0xc8;return function(_0xac95bc){if(_0xac95bc){return _0x23883b[_0xddef('0x28')](_0x387e68)[_0xddef('0x29')](_0xac95bc);}};}function respondWithFilteredResult(_0x5b0a74,_0x28e8ce){return function(_0x3b13ff){if(_0x3b13ff){var _0x2fb742=_0x3b13ff[_0xddef('0x2a')],_0x1223d5=_0x28e8ce['offset'],_0x12cbd2=_0x28e8ce[_0xddef('0x2b')]+_0x28e8ce[_0xddef('0x2c')],_0x522579;if(_0x12cbd2>=_0x2fb742){_0x12cbd2=_0x2fb742;_0x522579=0xc8;}else{_0x522579=0xce;}_0x5b0a74[_0xddef('0x28')](_0x522579);return _0x5b0a74[_0xddef('0x2d')]('Content-Range',_0x1223d5+'-'+_0x12cbd2+'/'+_0x2fb742)['json'](_0x3b13ff);}return null;};}function patchUpdates(_0x3ac028){return function(_0x1d0444){try{jsonpatch[_0xddef('0x2e')](_0x1d0444,_0x3ac028,!![]);}catch(_0x246090){return BPromise['reject'](_0x246090);}return _0x1d0444[_0xddef('0x2f')]();};}function saveUpdates(_0x231df4,_0xd6f325){return function(_0x2bb77e){if(_0x2bb77e){return _0x2bb77e[_0xddef('0x30')](_0x231df4)[_0xddef('0x1c')](function(_0x3a2a78){return _0x3a2a78;});}return null;};}function removeEntity(_0x347be3,_0x1b0c65){return function(_0x10a850){if(_0x10a850){return _0x10a850[_0xddef('0x31')]()[_0xddef('0x1c')](function(){_0x347be3[_0xddef('0x28')](0xcc)[_0xddef('0x27')]();});}};}function handleEntityNotFound(_0x5c03bf,_0x45a815){return function(_0x4c6d08){if(!_0x4c6d08){_0x5c03bf[_0xddef('0x26')](0x194);}return _0x4c6d08;};}function handleError(_0x17660a,_0x953a7f){_0x953a7f=_0x953a7f||0x1f4;return function(_0x20dba7){logger[_0xddef('0x21')](_0x20dba7['stack']);if(_0x20dba7[_0xddef('0x32')]){delete _0x20dba7['name'];}_0x17660a[_0xddef('0x28')](_0x953a7f)[_0xddef('0x33')](_0x20dba7);};}exports[_0xddef('0x34')]=function(_0xdd3b5e,_0x19cdbd){var _0x44e9b9={},_0x417c95={},_0x550126={'count':0x0,'rows':[]};var _0x1b1c48=_[_0xddef('0x35')](db[_0xddef('0x36')]['rawAttributes'],function(_0x292a60){return{'name':_0x292a60[_0xddef('0x37')],'type':_0x292a60['type'][_0xddef('0x38')]};});_0x417c95['model']=_[_0xddef('0x35')](_0x1b1c48,_0xddef('0x32'));_0x417c95[_0xddef('0x39')]=_[_0xddef('0x3a')](_0xdd3b5e[_0xddef('0x39')]);_0x417c95[_0xddef('0x3b')]=_[_0xddef('0x3c')](_0x417c95[_0xddef('0x3d')],_0x417c95[_0xddef('0x39')]);_0x44e9b9[_0xddef('0x3e')]=_[_0xddef('0x3c')](_0x417c95[_0xddef('0x3d')],qs[_0xddef('0x3f')](_0xdd3b5e[_0xddef('0x39')][_0xddef('0x3f')]));_0x44e9b9[_0xddef('0x3e')]=_0x44e9b9[_0xddef('0x3e')]['length']?_0x44e9b9[_0xddef('0x3e')]:_0x417c95['model'];if(!_0xdd3b5e[_0xddef('0x39')][_0xddef('0x40')]('nolimit')){_0x44e9b9[_0xddef('0x2c')]=qs[_0xddef('0x2c')](_0xdd3b5e[_0xddef('0x39')][_0xddef('0x2c')]);_0x44e9b9[_0xddef('0x2b')]=qs[_0xddef('0x2b')](_0xdd3b5e[_0xddef('0x39')]['offset']);}_0x44e9b9[_0xddef('0x41')]=qs[_0xddef('0x42')](_0xdd3b5e[_0xddef('0x39')][_0xddef('0x42')]);_0x44e9b9['where']=qs[_0xddef('0x3b')](_[_0xddef('0x43')](_0xdd3b5e['query'],_0x417c95[_0xddef('0x3b')]));if(_0xdd3b5e['query'][_0xddef('0x44')]){_0x44e9b9[_0xddef('0x45')]=_[_0xddef('0x46')](_0x44e9b9[_0xddef('0x45')],{'$or':_[_0xddef('0x35')](_0x1b1c48,function(_0x203b01){if(_0x203b01[_0xddef('0x47')]!==_0xddef('0x48')){var _0x233b7a={};_0x233b7a[_0x203b01[_0xddef('0x32')]]={'$like':'%'+_0xdd3b5e[_0xddef('0x39')][_0xddef('0x44')]+'%'};return _0x233b7a;}})});}_0x44e9b9=_[_0xddef('0x46')]({},_0x44e9b9,_0xdd3b5e['options']);var _0x595007={'where':_0x44e9b9[_0xddef('0x45')]};return db[_0xddef('0x36')][_0xddef('0x2a')](_0x595007)[_0xddef('0x1c')](function(_0x84143){_0x550126[_0xddef('0x2a')]=_0x84143;if(_0xdd3b5e[_0xddef('0x39')]['includeAll']){_0x44e9b9['include']=[{'all':!![]}];}return db[_0xddef('0x36')][_0xddef('0x49')](_0x44e9b9);})[_0xddef('0x1c')](function(_0x128238){_0x550126[_0xddef('0x4a')]=_0x128238;return _0x550126;})[_0xddef('0x1c')](respondWithFilteredResult(_0x19cdbd,_0x44e9b9))[_0xddef('0x25')](handleError(_0x19cdbd,null));};exports[_0xddef('0x4b')]=function(_0x5d3d65,_0x287a9b){var _0x3274d7={'raw':![],'where':{'id':_0x5d3d65['params']['id']}},_0x5543e={};_0x5543e[_0xddef('0x3d')]=_[_0xddef('0x3a')](db[_0xddef('0x36')]['rawAttributes']);_0x5543e[_0xddef('0x39')]=_[_0xddef('0x3a')](_0x5d3d65[_0xddef('0x39')]);_0x5543e['filters']=_[_0xddef('0x3c')](_0x5543e['model'],_0x5543e[_0xddef('0x39')]);_0x3274d7['attributes']=_[_0xddef('0x3c')](_0x5543e[_0xddef('0x3d')],qs['fields'](_0x5d3d65[_0xddef('0x39')][_0xddef('0x3f')]));_0x3274d7[_0xddef('0x3e')]=_0x3274d7[_0xddef('0x3e')][_0xddef('0x4c')]?_0x3274d7[_0xddef('0x3e')]:_0x5543e['model'];if(_0x5d3d65[_0xddef('0x39')][_0xddef('0x4d')]){_0x3274d7[_0xddef('0x4e')]=[{'all':!![]}];}_0x3274d7=_[_0xddef('0x46')]({},_0x3274d7,_0x5d3d65['options']);return db[_0xddef('0x36')][_0xddef('0x4f')](_0x3274d7)['then'](handleEntityNotFound(_0x287a9b,null))['then'](respondWithResult(_0x287a9b,null))[_0xddef('0x25')](handleError(_0x287a9b,null));};exports[_0xddef('0x50')]=function(_0x5a077a,_0x30515e){return db[_0xddef('0x36')][_0xddef('0x50')](_0x5a077a[_0xddef('0x51')],{})[_0xddef('0x1c')](respondWithResult(_0x30515e,0xc9))[_0xddef('0x25')](handleError(_0x30515e,null));};exports[_0xddef('0x30')]=function(_0x419c1e,_0x1ebb9f){if(_0x419c1e[_0xddef('0x51')]['id']){delete _0x419c1e[_0xddef('0x51')]['id'];}return db[_0xddef('0x36')][_0xddef('0x4f')]({'where':{'id':_0x419c1e[_0xddef('0x52')]['id']}})[_0xddef('0x1c')](handleEntityNotFound(_0x1ebb9f,null))[_0xddef('0x1c')](saveUpdates(_0x419c1e['body'],null))[_0xddef('0x1c')](respondWithResult(_0x1ebb9f,null))[_0xddef('0x25')](handleError(_0x1ebb9f,null));};exports[_0xddef('0x31')]=function(_0x25aab2,_0x5a8e8b){return db[_0xddef('0x36')]['find']({'where':{'id':_0x25aab2[_0xddef('0x52')]['id']}})[_0xddef('0x1c')](handleEntityNotFound(_0x5a8e8b,null))['then'](removeEntity(_0x5a8e8b,null))[_0xddef('0x25')](handleError(_0x5a8e8b,null));};exports[_0xddef('0x53')]=function(_0x330d83,_0x19eecf,_0x5cf4d8){var _0xc73dfd={};var _0x2b45e9={};var _0xf6bce;var _0x5cf4d5;return db[_0xddef('0x36')][_0xddef('0x54')]({'where':{'id':_0x330d83[_0xddef('0x52')]['id']}})[_0xddef('0x1c')](handleEntityNotFound(_0x19eecf,null))['then'](function(_0x3324ac){if(_0x3324ac){_0xf6bce=_0x3324ac;_0x2b45e9[_0xddef('0x3d')]=_[_0xddef('0x3a')](db['FreshsalesConfiguration'][_0xddef('0x55')]);_0x2b45e9[_0xddef('0x39')]=_[_0xddef('0x3a')](_0x330d83['query']);_0x2b45e9[_0xddef('0x3b')]=_[_0xddef('0x3c')](_0x2b45e9[_0xddef('0x3d')],_0x2b45e9['query']);_0xc73dfd['attributes']=_[_0xddef('0x3c')](_0x2b45e9[_0xddef('0x3d')],qs[_0xddef('0x3f')](_0x330d83[_0xddef('0x39')]['fields']));_0xc73dfd[_0xddef('0x3e')]=_0xc73dfd[_0xddef('0x3e')]['length']?_0xc73dfd[_0xddef('0x3e')]:_0x2b45e9[_0xddef('0x3d')];_0xc73dfd[_0xddef('0x41')]=qs[_0xddef('0x42')](_0x330d83[_0xddef('0x39')][_0xddef('0x42')]);_0xc73dfd[_0xddef('0x45')]=qs['filters'](_[_0xddef('0x43')](_0x330d83[_0xddef('0x39')],_0x2b45e9[_0xddef('0x3b')]));if(_0x330d83[_0xddef('0x39')][_0xddef('0x44')]){_0xc73dfd[_0xddef('0x45')]=_[_0xddef('0x46')](_0xc73dfd[_0xddef('0x45')],{'$or':_[_0xddef('0x35')](_0xc73dfd[_0xddef('0x3e')],function(_0x24b523){var _0x113604={};_0x113604[_0x24b523]={'$like':'%'+_0x330d83[_0xddef('0x39')][_0xddef('0x44')]+'%'};return _0x113604;})});}_0xc73dfd=_[_0xddef('0x46')]({},_0xc73dfd,_0x330d83[_0xddef('0x56')]);return _0xf6bce[_0xddef('0x53')](_0xc73dfd);}})[_0xddef('0x1c')](function(_0x14f43f){if(_0x14f43f){_0x5cf4d5=_0x14f43f['length'];if(!_0x330d83['query'][_0xddef('0x40')]('nolimit')){_0xc73dfd['limit']=qs[_0xddef('0x2c')](_0x330d83[_0xddef('0x39')][_0xddef('0x2c')]);_0xc73dfd[_0xddef('0x2b')]=qs['offset'](_0x330d83[_0xddef('0x39')][_0xddef('0x2b')]);}return _0xf6bce[_0xddef('0x53')](_0xc73dfd);}})[_0xddef('0x1c')](function(_0x565bf9){if(_0x565bf9){return _0x565bf9?{'count':_0x5cf4d5,'rows':_0x565bf9}:null;}})['then'](respondWithResult(_0x19eecf,null))[_0xddef('0x25')](handleError(_0x19eecf,null));};exports['addConfiguration']=function(_0x3e673a,_0x996f62,_0x444d95){if(_0x3e673a['body']['id']){delete _0x3e673a[_0xddef('0x51')]['id'];}return db[_0xddef('0x36')][_0xddef('0x54')]({'where':{'id':_0x3e673a['params']['id']}})[_0xddef('0x1c')](handleEntityNotFound(_0x996f62,null))[_0xddef('0x1c')](function(_0x47ef04){if(_0x47ef04){_0x3e673a['body'][_0xddef('0x57')]=_0x47ef04['id'];_0x3e673a[_0xddef('0x51')][_0xddef('0x58')]=integrations[_0xddef('0x59')](_0x3e673a[_0xddef('0x51')][_0xddef('0x5a')],_0x3e673a[_0xddef('0x51')]['type']);_0x3e673a[_0xddef('0x51')]['Descriptions']=integrations[_0xddef('0x5b')](_0x3e673a[_0xddef('0x51')][_0xddef('0x5a')],_0x3e673a[_0xddef('0x51')][_0xddef('0x47')]);return db['FreshsalesConfiguration']['create'](_0x3e673a['body'],{'include':[{'model':db[_0xddef('0x5c')],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0xddef('0x5d')}]});}return null;})['then'](respondWithResult(_0x996f62,null))[_0xddef('0x25')](handleError(_0x996f62,null));};exports['getFields']=function(_0x3698b1,_0x94374c,_0xfd8960){var _0x9f6f8d='';var _0x5926b5='';return db[_0xddef('0x36')]['findOne']({'where':{'id':_0x3698b1[_0xddef('0x52')]['id']},'attributes':['id',_0xddef('0x5e'),'remoteUri',_0xddef('0x5f')]})[_0xddef('0x1c')](handleEntityNotFound(_0x94374c,null))['then'](function(_0x25268c){if(_0x25268c){_0x5926b5=_0x25268c['username'];_0x9f6f8d=_0x25268c['remoteUri'];var _0x3ce476=_0x25268c['remoteUri'][_0xddef('0x60')](-0x1);if(_0x3ce476==='/'){_0x9f6f8d=_0x9f6f8d[_0xddef('0x61')](0x0,_0x9f6f8d['lastIndexOf'](_0x3ce476));}return rp({'method':'GET','uri':util[_0xddef('0x62')](_0xddef('0x63'),_0x9f6f8d,_0xddef('0x64')),'headers':{'Authorization':_0xddef('0x65')+_0x25268c[_0xddef('0x5f')]},'json':!![]});}})[_0xddef('0x1c')](function(_0x4163a1){if(_0x4163a1){var _0x2f97b3=_0x4163a1[_0xddef('0x66')];var _0xc8b2c8=![];var _0x505d99=null;for(_0x505d99=0x0;_0x505d99<_0x2f97b3[_0xddef('0x4c')];_0x505d99++){if(_0x2f97b3[_0x505d99][_0xddef('0x67')]===_0x5926b5){_0xc8b2c8=!![];}}if(_0xc8b2c8){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xddef('0x68')});}}})[_0xddef('0x1c')](respondWithResult(_0x94374c,null))[_0xddef('0x25')](function(_0x1255b0){var _0x15944f=_0x3698b1[_0xddef('0x39')]['test']?0x1f4:_0x1255b0[_0xddef('0x69')]||0x1f4;logger['error'](_0xddef('0x6a'),_0xddef('0x6b'),_0x15944f,JSON[_0xddef('0x20')](_0x1255b0));delete _0x1255b0['name'];if(_0x15944f===0x191){_0x15944f=0x190;}_0x94374c[_0xddef('0x28')](_0x15944f)[_0xddef('0x33')](_0x3698b1[_0xddef('0x39')]['test']?{'message':_0xddef('0x6c'),'statusCode':_0x1255b0[_0xddef('0x69')]}:_0x1255b0);});}; \ No newline at end of file +var _0xc1bc=['findOne','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../components/integrations/configuration','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','FreshsalesAccount,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','destroy','end','stack','name','send','index','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','FreshsalesAccount','count','includeAll','include','findAll','rows','show','params','options','find','create','body','getConfigurations'];(function(_0x5b34f,_0x548d07){var _0x306c4e=function(_0x4a18b3){while(--_0x4a18b3){_0x5b34f['push'](_0x5b34f['shift']());}};_0x306c4e(++_0x548d07);}(_0xc1bc,0x173));var _0xcc1b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc1bc[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xcc1b('0x0'));var emlformat=require(_0xcc1b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcc1b('0x2'));var jsonpatch=require(_0xcc1b('0x3'));var rp=require(_0xcc1b('0x4'));var moment=require(_0xcc1b('0x5'));var BPromise=require(_0xcc1b('0x6'));var Mustache=require(_0xcc1b('0x7'));var util=require(_0xcc1b('0x8'));var path=require(_0xcc1b('0x9'));var sox=require('sox');var csv=require(_0xcc1b('0xa'));var ejs=require(_0xcc1b('0xb'));var fs=require('fs');var _=require(_0xcc1b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcc1b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcc1b('0xa'));var querystring=require('querystring');var Papa=require(_0xcc1b('0xe'));var Redis=require('ioredis');var authService=require(_0xcc1b('0xf'));var qs=require(_0xcc1b('0x10'));var as=require(_0xcc1b('0x11'));var hardwareService=require(_0xcc1b('0x12'));var logger=require('../../config/logger')(_0xcc1b('0x13'));var utils=require(_0xcc1b('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0xcc1b('0x15'));var jayson=require(_0xcc1b('0x16'));var client=jayson[_0xcc1b('0x17')][_0xcc1b('0x18')]({'port':0x232a});function checkPasswordPattern(_0x50d44d,_0x4d3668,_0xd8c99e){if(_0xd8c99e){var _0x54e4fe=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x54e4fe[_0xcc1b('0x19')](_0x4d3668)){return _0x50d44d;}else{throw new db['Sequelize'][(_0xcc1b('0x1a'))](_0xcc1b('0x1b'));}}else{return _0x50d44d;}}function respondWithRpcPromise(_0x599aa7,_0x274518,_0x3422a6,_0x52fd61){return new BPromise(function(_0x3d2dd3,_0x458ed1){var _0x4c8acf=_0x52fd61||client;return _0x4c8acf['request'](_0x599aa7,_0x3422a6)[_0xcc1b('0x1c')](function(_0x5eebf4){logger[_0xcc1b('0x1d')]('FreshsalesAccount,\x20%s,\x20%s',_0x274518,_0xcc1b('0x1e'));logger['debug'](_0xcc1b('0x1f'),_0x274518,_0xcc1b('0x1e'),JSON['stringify'](_0x5eebf4));if(_0x5eebf4[_0xcc1b('0x20')]){if(_0x5eebf4[_0xcc1b('0x20')][_0xcc1b('0x21')]===0x1f4){logger[_0xcc1b('0x20')]('FreshsalesAccount,\x20%s,\x20%s',_0x274518,_0x5eebf4[_0xcc1b('0x20')][_0xcc1b('0x22')]);return _0x458ed1(_0x5eebf4['error'][_0xcc1b('0x22')]);}logger[_0xcc1b('0x20')](_0xcc1b('0x23'),_0x274518,_0x5eebf4[_0xcc1b('0x20')][_0xcc1b('0x22')]);return _0x3d2dd3(_0x5eebf4[_0xcc1b('0x20')][_0xcc1b('0x22')]);}else{logger[_0xcc1b('0x1d')](_0xcc1b('0x23'),_0x274518,_0xcc1b('0x1e'));_0x3d2dd3(_0x5eebf4[_0xcc1b('0x24')][_0xcc1b('0x22')]);}})[_0xcc1b('0x25')](function(_0x36df45){logger[_0xcc1b('0x20')](_0xcc1b('0x23'),_0x274518,_0x36df45);_0x458ed1(_0x36df45);});});}function respondWithStatusCode(_0x567e9d,_0x2a57a2){_0x2a57a2=_0x2a57a2||0xcc;return function(_0x2c051f){if(_0x2c051f){return _0x567e9d[_0xcc1b('0x26')](_0x2a57a2);}return _0x567e9d[_0xcc1b('0x27')](_0x2a57a2)['end']();};}function respondWithResult(_0x4d512f,_0x57eae){_0x57eae=_0x57eae||0xc8;return function(_0x244ec3){if(_0x244ec3){return _0x4d512f[_0xcc1b('0x27')](_0x57eae)[_0xcc1b('0x28')](_0x244ec3);}};}function respondWithFilteredResult(_0x3bf729,_0x4a9da4){return function(_0x50fe03){if(_0x50fe03){var _0x1f725f=_0x50fe03['count'],_0x5b78d6=_0x4a9da4[_0xcc1b('0x29')],_0x4acbe4=_0x4a9da4[_0xcc1b('0x29')]+_0x4a9da4[_0xcc1b('0x2a')],_0x45a4e7;if(_0x4acbe4>=_0x1f725f){_0x4acbe4=_0x1f725f;_0x45a4e7=0xc8;}else{_0x45a4e7=0xce;}_0x3bf729[_0xcc1b('0x27')](_0x45a4e7);return _0x3bf729[_0xcc1b('0x2b')](_0xcc1b('0x2c'),_0x5b78d6+'-'+_0x4acbe4+'/'+_0x1f725f)[_0xcc1b('0x28')](_0x50fe03);}return null;};}function patchUpdates(_0x550abc){return function(_0x27922d){try{jsonpatch[_0xcc1b('0x2d')](_0x27922d,_0x550abc,!![]);}catch(_0x54fe8f){return BPromise['reject'](_0x54fe8f);}return _0x27922d[_0xcc1b('0x2e')]();};}function saveUpdates(_0x53d78a,_0x2fc6e2){return function(_0x3a030c){if(_0x3a030c){return _0x3a030c[_0xcc1b('0x2f')](_0x53d78a)[_0xcc1b('0x1c')](function(_0x52697b){return _0x52697b;});}return null;};}function removeEntity(_0xe3eaea,_0x2adb86){return function(_0x81a1bb){if(_0x81a1bb){return _0x81a1bb[_0xcc1b('0x30')]()[_0xcc1b('0x1c')](function(){_0xe3eaea[_0xcc1b('0x27')](0xcc)[_0xcc1b('0x31')]();});}};}function handleEntityNotFound(_0x2fb8c9,_0x10b46b){return function(_0x190fd3){if(!_0x190fd3){_0x2fb8c9[_0xcc1b('0x26')](0x194);}return _0x190fd3;};}function handleError(_0x55634f,_0x1a18d8){_0x1a18d8=_0x1a18d8||0x1f4;return function(_0x4ed4b1){logger['error'](_0x4ed4b1[_0xcc1b('0x32')]);if(_0x4ed4b1[_0xcc1b('0x33')]){delete _0x4ed4b1[_0xcc1b('0x33')];}_0x55634f[_0xcc1b('0x27')](_0x1a18d8)[_0xcc1b('0x34')](_0x4ed4b1);};}exports[_0xcc1b('0x35')]=function(_0x2cc291,_0x573e53){var _0x5ab110={},_0x4cbb21={},_0x5b2f63={'count':0x0,'rows':[]};var _0x3613db=_['map'](db['FreshsalesAccount'][_0xcc1b('0x36')],function(_0x12fe8a){return{'name':_0x12fe8a[_0xcc1b('0x37')],'type':_0x12fe8a['type'][_0xcc1b('0x38')]};});_0x4cbb21['model']=_['map'](_0x3613db,_0xcc1b('0x33'));_0x4cbb21[_0xcc1b('0x39')]=_[_0xcc1b('0x3a')](_0x2cc291[_0xcc1b('0x39')]);_0x4cbb21[_0xcc1b('0x3b')]=_[_0xcc1b('0x3c')](_0x4cbb21[_0xcc1b('0x3d')],_0x4cbb21[_0xcc1b('0x39')]);_0x5ab110[_0xcc1b('0x3e')]=_['intersection'](_0x4cbb21[_0xcc1b('0x3d')],qs[_0xcc1b('0x3f')](_0x2cc291[_0xcc1b('0x39')][_0xcc1b('0x3f')]));_0x5ab110[_0xcc1b('0x3e')]=_0x5ab110[_0xcc1b('0x3e')][_0xcc1b('0x40')]?_0x5ab110[_0xcc1b('0x3e')]:_0x4cbb21['model'];if(!_0x2cc291[_0xcc1b('0x39')][_0xcc1b('0x41')](_0xcc1b('0x42'))){_0x5ab110[_0xcc1b('0x2a')]=qs[_0xcc1b('0x2a')](_0x2cc291[_0xcc1b('0x39')]['limit']);_0x5ab110[_0xcc1b('0x29')]=qs[_0xcc1b('0x29')](_0x2cc291[_0xcc1b('0x39')]['offset']);}_0x5ab110[_0xcc1b('0x43')]=qs['sort'](_0x2cc291['query'][_0xcc1b('0x44')]);_0x5ab110[_0xcc1b('0x45')]=qs[_0xcc1b('0x3b')](_[_0xcc1b('0x46')](_0x2cc291[_0xcc1b('0x39')],_0x4cbb21[_0xcc1b('0x3b')]));if(_0x2cc291[_0xcc1b('0x39')][_0xcc1b('0x47')]){_0x5ab110[_0xcc1b('0x45')]=_[_0xcc1b('0x48')](_0x5ab110[_0xcc1b('0x45')],{'$or':_[_0xcc1b('0x49')](_0x3613db,function(_0x31cb9){if(_0x31cb9[_0xcc1b('0x4a')]!==_0xcc1b('0x4b')){var _0x58f7ab={};_0x58f7ab[_0x31cb9[_0xcc1b('0x33')]]={'$like':'%'+_0x2cc291[_0xcc1b('0x39')][_0xcc1b('0x47')]+'%'};return _0x58f7ab;}})});}_0x5ab110=_[_0xcc1b('0x48')]({},_0x5ab110,_0x2cc291['options']);var _0x961d16={'where':_0x5ab110[_0xcc1b('0x45')]};return db[_0xcc1b('0x4c')][_0xcc1b('0x4d')](_0x961d16)['then'](function(_0x23b1a0){_0x5b2f63['count']=_0x23b1a0;if(_0x2cc291[_0xcc1b('0x39')][_0xcc1b('0x4e')]){_0x5ab110[_0xcc1b('0x4f')]=[{'all':!![]}];}return db[_0xcc1b('0x4c')][_0xcc1b('0x50')](_0x5ab110);})[_0xcc1b('0x1c')](function(_0x407173){_0x5b2f63[_0xcc1b('0x51')]=_0x407173;return _0x5b2f63;})[_0xcc1b('0x1c')](respondWithFilteredResult(_0x573e53,_0x5ab110))[_0xcc1b('0x25')](handleError(_0x573e53,null));};exports[_0xcc1b('0x52')]=function(_0x239a69,_0x354044){var _0xd03d2a={'raw':![],'where':{'id':_0x239a69[_0xcc1b('0x53')]['id']}},_0x1a285c={};_0x1a285c[_0xcc1b('0x3d')]=_[_0xcc1b('0x3a')](db[_0xcc1b('0x4c')][_0xcc1b('0x36')]);_0x1a285c[_0xcc1b('0x39')]=_[_0xcc1b('0x3a')](_0x239a69[_0xcc1b('0x39')]);_0x1a285c[_0xcc1b('0x3b')]=_['intersection'](_0x1a285c[_0xcc1b('0x3d')],_0x1a285c['query']);_0xd03d2a[_0xcc1b('0x3e')]=_[_0xcc1b('0x3c')](_0x1a285c[_0xcc1b('0x3d')],qs[_0xcc1b('0x3f')](_0x239a69[_0xcc1b('0x39')][_0xcc1b('0x3f')]));_0xd03d2a[_0xcc1b('0x3e')]=_0xd03d2a[_0xcc1b('0x3e')][_0xcc1b('0x40')]?_0xd03d2a['attributes']:_0x1a285c[_0xcc1b('0x3d')];if(_0x239a69[_0xcc1b('0x39')][_0xcc1b('0x4e')]){_0xd03d2a[_0xcc1b('0x4f')]=[{'all':!![]}];}_0xd03d2a=_[_0xcc1b('0x48')]({},_0xd03d2a,_0x239a69[_0xcc1b('0x54')]);return db['FreshsalesAccount'][_0xcc1b('0x55')](_0xd03d2a)[_0xcc1b('0x1c')](handleEntityNotFound(_0x354044,null))[_0xcc1b('0x1c')](respondWithResult(_0x354044,null))[_0xcc1b('0x25')](handleError(_0x354044,null));};exports[_0xcc1b('0x56')]=function(_0x4d2bbb,_0x2b41be){return db[_0xcc1b('0x4c')][_0xcc1b('0x56')](_0x4d2bbb['body'],{})[_0xcc1b('0x1c')](respondWithResult(_0x2b41be,0xc9))['catch'](handleError(_0x2b41be,null));};exports[_0xcc1b('0x2f')]=function(_0x5e7c97,_0xc4c5f){if(_0x5e7c97['body']['id']){delete _0x5e7c97[_0xcc1b('0x57')]['id'];}return db[_0xcc1b('0x4c')]['find']({'where':{'id':_0x5e7c97[_0xcc1b('0x53')]['id']}})['then'](handleEntityNotFound(_0xc4c5f,null))[_0xcc1b('0x1c')](saveUpdates(_0x5e7c97['body'],null))[_0xcc1b('0x1c')](respondWithResult(_0xc4c5f,null))[_0xcc1b('0x25')](handleError(_0xc4c5f,null));};exports['destroy']=function(_0x34b751,_0x243f40){return db[_0xcc1b('0x4c')]['find']({'where':{'id':_0x34b751[_0xcc1b('0x53')]['id']}})['then'](handleEntityNotFound(_0x243f40,null))[_0xcc1b('0x1c')](removeEntity(_0x243f40,null))[_0xcc1b('0x25')](handleError(_0x243f40,null));};exports[_0xcc1b('0x58')]=function(_0x34a608,_0x39f004,_0x53d347){var _0xa69c78={};var _0x29e604={};var _0x53512a;var _0x24118f;return db[_0xcc1b('0x4c')][_0xcc1b('0x59')]({'where':{'id':_0x34a608[_0xcc1b('0x53')]['id']}})['then'](handleEntityNotFound(_0x39f004,null))[_0xcc1b('0x1c')](function(_0x525c09){if(_0x525c09){_0x53512a=_0x525c09;_0x29e604[_0xcc1b('0x3d')]=_[_0xcc1b('0x3a')](db[_0xcc1b('0x5a')][_0xcc1b('0x36')]);_0x29e604['query']=_[_0xcc1b('0x3a')](_0x34a608[_0xcc1b('0x39')]);_0x29e604['filters']=_[_0xcc1b('0x3c')](_0x29e604[_0xcc1b('0x3d')],_0x29e604[_0xcc1b('0x39')]);_0xa69c78[_0xcc1b('0x3e')]=_[_0xcc1b('0x3c')](_0x29e604['model'],qs['fields'](_0x34a608['query'][_0xcc1b('0x3f')]));_0xa69c78['attributes']=_0xa69c78[_0xcc1b('0x3e')][_0xcc1b('0x40')]?_0xa69c78[_0xcc1b('0x3e')]:_0x29e604[_0xcc1b('0x3d')];_0xa69c78[_0xcc1b('0x43')]=qs['sort'](_0x34a608['query'][_0xcc1b('0x44')]);_0xa69c78[_0xcc1b('0x45')]=qs[_0xcc1b('0x3b')](_[_0xcc1b('0x46')](_0x34a608[_0xcc1b('0x39')],_0x29e604[_0xcc1b('0x3b')]));if(_0x34a608[_0xcc1b('0x39')][_0xcc1b('0x47')]){_0xa69c78[_0xcc1b('0x45')]=_[_0xcc1b('0x48')](_0xa69c78[_0xcc1b('0x45')],{'$or':_[_0xcc1b('0x49')](_0xa69c78[_0xcc1b('0x3e')],function(_0x54542c){var _0x3d126f={};_0x3d126f[_0x54542c]={'$like':'%'+_0x34a608[_0xcc1b('0x39')][_0xcc1b('0x47')]+'%'};return _0x3d126f;})});}_0xa69c78=_[_0xcc1b('0x48')]({},_0xa69c78,_0x34a608[_0xcc1b('0x54')]);return _0x53512a[_0xcc1b('0x58')](_0xa69c78);}})[_0xcc1b('0x1c')](function(_0x29b747){if(_0x29b747){_0x24118f=_0x29b747[_0xcc1b('0x40')];if(!_0x34a608[_0xcc1b('0x39')][_0xcc1b('0x41')](_0xcc1b('0x42'))){_0xa69c78['limit']=qs['limit'](_0x34a608['query'][_0xcc1b('0x2a')]);_0xa69c78[_0xcc1b('0x29')]=qs[_0xcc1b('0x29')](_0x34a608['query'][_0xcc1b('0x29')]);}return _0x53512a[_0xcc1b('0x58')](_0xa69c78);}})[_0xcc1b('0x1c')](function(_0xe03704){if(_0xe03704){return _0xe03704?{'count':_0x24118f,'rows':_0xe03704}:null;}})[_0xcc1b('0x1c')](respondWithResult(_0x39f004,null))[_0xcc1b('0x25')](handleError(_0x39f004,null));};exports[_0xcc1b('0x5b')]=function(_0x1665f5,_0x143f24,_0xde8d27){if(_0x1665f5[_0xcc1b('0x57')]['id']){delete _0x1665f5[_0xcc1b('0x57')]['id'];}return db[_0xcc1b('0x4c')]['findOne']({'where':{'id':_0x1665f5[_0xcc1b('0x53')]['id']}})[_0xcc1b('0x1c')](handleEntityNotFound(_0x143f24,null))['then'](function(_0x5648fb){if(_0x5648fb){_0x1665f5['body'][_0xcc1b('0x5c')]=_0x5648fb['id'];_0x1665f5[_0xcc1b('0x57')][_0xcc1b('0x5d')]=integrations[_0xcc1b('0x5e')](_0x1665f5[_0xcc1b('0x57')][_0xcc1b('0x5f')],_0x1665f5[_0xcc1b('0x57')][_0xcc1b('0x4a')]);_0x1665f5[_0xcc1b('0x57')]['Descriptions']=integrations[_0xcc1b('0x60')](_0x1665f5[_0xcc1b('0x57')][_0xcc1b('0x5f')],_0x1665f5[_0xcc1b('0x57')][_0xcc1b('0x4a')]);return db[_0xcc1b('0x5a')][_0xcc1b('0x56')](_0x1665f5[_0xcc1b('0x57')],{'include':[{'model':db[_0xcc1b('0x61')],'as':_0xcc1b('0x5d')},{'model':db[_0xcc1b('0x61')],'as':_0xcc1b('0x62')}]});}return null;})[_0xcc1b('0x1c')](respondWithResult(_0x143f24,null))['catch'](handleError(_0x143f24,null));};exports[_0xcc1b('0x63')]=function(_0x88ac2f,_0x1626a4,_0x1064f7){var _0x4bc9f7='';var _0x1e0912='';return db['FreshsalesAccount'][_0xcc1b('0x59')]({'where':{'id':_0x88ac2f['params']['id']},'attributes':['id',_0xcc1b('0x64'),_0xcc1b('0x65'),'apiKey']})[_0xcc1b('0x1c')](handleEntityNotFound(_0x1626a4,null))[_0xcc1b('0x1c')](function(_0x38b025){if(_0x38b025){_0x1e0912=_0x38b025[_0xcc1b('0x64')];_0x4bc9f7=_0x38b025[_0xcc1b('0x65')];var _0x38fb78=_0x38b025[_0xcc1b('0x65')][_0xcc1b('0x66')](-0x1);if(_0x38fb78==='/'){_0x4bc9f7=_0x4bc9f7[_0xcc1b('0x67')](0x0,_0x4bc9f7[_0xcc1b('0x68')](_0x38fb78));}return rp({'method':_0xcc1b('0x69'),'uri':util['format'](_0xcc1b('0x6a'),_0x4bc9f7,_0xcc1b('0x6b')),'headers':{'Authorization':_0xcc1b('0x6c')+_0x38b025['apiKey']},'json':!![]});}})['then'](function(_0x490d02){if(_0x490d02){var _0x1835b7=_0x490d02[_0xcc1b('0x6d')];var _0x26996a=![];var _0x15b2cf=null;for(_0x15b2cf=0x0;_0x15b2cf<_0x1835b7[_0xcc1b('0x40')];_0x15b2cf++){if(_0x1835b7[_0x15b2cf][_0xcc1b('0x6e')]===_0x1e0912){_0x26996a=!![];}}if(_0x26996a){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xcc1b('0x6f')});}}})[_0xcc1b('0x1c')](respondWithResult(_0x1626a4,null))[_0xcc1b('0x25')](function(_0x250ba9){var _0x1c3eb5=_0x88ac2f['query'][_0xcc1b('0x19')]?0x1f4:_0x250ba9[_0xcc1b('0x70')]||0x1f4;logger[_0xcc1b('0x20')](_0xcc1b('0x71'),_0xcc1b('0x63'),_0x1c3eb5,JSON[_0xcc1b('0x72')](_0x250ba9));delete _0x250ba9[_0xcc1b('0x33')];if(_0x1c3eb5===0x191){_0x1c3eb5=0x190;}_0x1626a4[_0xcc1b('0x27')](_0x1c3eb5)['send'](_0x88ac2f['query'][_0xcc1b('0x19')]?{'message':'Wrong\x20credentials','statusCode':_0x250ba9[_0xcc1b('0x70')]}:_0x250ba9);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 629f74d..6d19561 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 _0x44fa=['moment','bluebird','request-promise','path','../../config/environment','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0xd50b7f,_0x53c16c){var _0x380972=function(_0x4865d8){while(--_0x4865d8){_0xd50b7f['push'](_0xd50b7f['shift']());}};_0x380972(++_0x53c16c);}(_0x44fa,0x68));var _0xa44f=function(_0x26dfb7,_0x52a125){_0x26dfb7=_0x26dfb7-0x0;var _0x24d96c=_0x44fa[_0x26dfb7];return _0x24d96c;};'use strict';var _=require(_0xa44f('0x0'));var util=require(_0xa44f('0x1'));var logger=require(_0xa44f('0x2'))(_0xa44f('0x3'));var moment=require(_0xa44f('0x4'));var BPromise=require(_0xa44f('0x5'));var rp=require(_0xa44f('0x6'));var fs=require('fs');var path=require(_0xa44f('0x7'));var rimraf=require('rimraf');var config=require(_0xa44f('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xa44f('0x9')]=function(_0x3a40ba,_0x21c603){return _0x3a40ba['define'](_0xa44f('0xa'),attributes,{'tableName':_0xa44f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6965=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash'];(function(_0x48e7c8,_0x1b6e62){var _0x3cd9cb=function(_0x1aa01a){while(--_0x1aa01a){_0x48e7c8['push'](_0x48e7c8['shift']());}};_0x3cd9cb(++_0x1b6e62);}(_0x6965,0xa8));var _0x5696=function(_0x4a8506,_0x35c900){_0x4a8506=_0x4a8506-0x0;var _0x4a521a=_0x6965[_0x4a8506];return _0x4a521a;};'use strict';var _=require(_0x5696('0x0'));var util=require('util');var logger=require(_0x5696('0x1'))(_0x5696('0x2'));var moment=require(_0x5696('0x3'));var BPromise=require('bluebird');var rp=require(_0x5696('0x4'));var fs=require('fs');var path=require(_0x5696('0x5'));var rimraf=require(_0x5696('0x6'));var config=require(_0x5696('0x7'));var attributes=require(_0x5696('0x8'));var integrations=require(_0x5696('0x9'));module[_0x5696('0xa')]=function(_0xdad5c1,_0xfa042f){return _0xdad5c1[_0x5696('0xb')]('FreshsalesAccount',attributes,{'tableName':_0x5696('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 411d51f..d5c44e8 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 _0x627e=['request','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshsalesAccount','findAll','raw','options','where','map','model','attributes','include','then','debug','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x12f4af,_0x4a2bb9){var _0x4c4d50=function(_0x25a7f7){while(--_0x25a7f7){_0x12f4af['push'](_0x12f4af['shift']());}};_0x4c4d50(++_0x4a2bb9);}(_0x627e,0x14a));var _0xe627=function(_0x4650be,_0x15f218){_0x4650be=_0x4650be-0x0;var _0x4ec151=_0x627e[_0x4650be];return _0x4ec151;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var moment=require(_0xe627('0x2'));var BPromise=require(_0xe627('0x3'));var rs=require(_0xe627('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe627('0x5'))['db'];var utils=require(_0xe627('0x6'));var logger=require(_0xe627('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe627('0x8')][_0xe627('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45e49a,_0x2d4f63,_0xd5016e){return new BPromise(function(_0xe065b,_0x4bae52){return client[_0xe627('0xa')](_0x45e49a,_0xd5016e)['then'](function(_0x56549e){logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,'request\x20sent');logger['debug'](_0xe627('0xd'),_0x2d4f63,_0xe627('0xe'),JSON[_0xe627('0xf')](_0x56549e));if(_0x56549e[_0xe627('0x10')]){if(_0x56549e[_0xe627('0x10')][_0xe627('0x11')]===0x1f4){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x56549e[_0xe627('0x10')]['message']);return _0x4bae52(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}logger[_0xe627('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x2d4f63,_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);return _0xe065b(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}else{logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,_0xe627('0xe'));_0xe065b(_0x56549e['result'][_0xe627('0x12')]);}})[_0xe627('0x13')](function(_0x16c2d7){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x16c2d7);_0x4bae52(_0x16c2d7);});});}exports[_0xe627('0x14')]=function(_0x56559b){var _0x2fe46a=this;return new Promise(function(_0x538b22,_0x24fddd){return db['FreshsalesAccount'][_0xe627('0x15')]({'raw':_0x56559b['options']?_0x56559b['options'][_0xe627('0x16')]===undefined?!![]:![]:!![],'where':_0x56559b['options']?_0x56559b[_0xe627('0x17')][_0xe627('0x18')]||null:null,'attributes':_0x56559b['options']?_0x56559b['options']['attributes']||null:null,'limit':_0x56559b[_0xe627('0x17')]?_0x56559b[_0xe627('0x17')]['limit']||null:null,'include':_0x56559b[_0xe627('0x17')]?_0x56559b[_0xe627('0x17')]['include']?_[_0xe627('0x19')](_0x56559b[_0xe627('0x17')]['include'],function(_0x42f3d1){return{'model':db[_0x42f3d1[_0xe627('0x1a')]],'as':_0x42f3d1['as'],'attributes':_0x42f3d1[_0xe627('0x1b')],'include':_0x42f3d1['include']?_[_0xe627('0x19')](_0x42f3d1[_0xe627('0x1c')],function(_0x1a5081){return{'model':db[_0x1a5081[_0xe627('0x1a')]],'as':_0x1a5081['as'],'attributes':_0x1a5081['attributes'],'include':_0x1a5081[_0xe627('0x1c')]?_[_0xe627('0x19')](_0x1a5081[_0xe627('0x1c')],function(_0x29eb8e){return{'model':db[_0x29eb8e[_0xe627('0x1a')]],'as':_0x29eb8e['as'],'attributes':_0x29eb8e[_0xe627('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe627('0x1d')](function(_0x44c9f7){logger[_0xe627('0xb')]('GetFreshsalesAccount',_0x56559b);logger[_0xe627('0x1e')]('GetFreshsalesAccount',_0x56559b,JSON['stringify'](_0x44c9f7));_0x538b22(_0x44c9f7);})[_0xe627('0x13')](function(_0xdf63c8){logger['error'](_0xe627('0x14'),_0xdf63c8['message'],_0x56559b);_0x24fddd(_0x2fe46a[_0xe627('0x10')](0x1f4,_0xdf63c8['message']));});});};exports[_0xe627('0x1f')]=function(_0x26833a){var _0x5d8992=this;return new Promise(function(_0x33e9dd,_0x4f92c9){return db[_0xe627('0x20')][_0xe627('0x21')]({'raw':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x16')]===undefined?!![]:![]:!![],'where':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x18')]||null:null,'attributes':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x1b')]||null:null,'include':_0x26833a['options']?_0x26833a['options'][_0xe627('0x1c')]?_['map'](_0x26833a[_0xe627('0x17')]['include'],function(_0x56d1d7){return{'model':db[_0x56d1d7[_0xe627('0x1a')]],'as':_0x56d1d7['as'],'attributes':_0x56d1d7['attributes'],'include':_0x56d1d7['include']?_[_0xe627('0x19')](_0x56d1d7[_0xe627('0x1c')],function(_0x55f001){return{'model':db[_0x55f001['model']],'as':_0x55f001['as'],'attributes':_0x55f001['attributes'],'include':_0x55f001['include']?_[_0xe627('0x19')](_0x55f001['include'],function(_0x39338c){return{'model':db[_0x39338c[_0xe627('0x1a')]],'as':_0x39338c['as'],'attributes':_0x39338c['attributes']};}):[]};}):[]};}):[]:[]})[_0xe627('0x1d')](function(_0x35a303){logger['info'](_0xe627('0x1f'),_0x26833a);logger[_0xe627('0x1e')](_0xe627('0x1f'),_0x26833a,JSON[_0xe627('0xf')](_0x35a303));_0x33e9dd(_0x35a303);})[_0xe627('0x13')](function(_0x28fd59){logger['error'](_0xe627('0x1f'),_0x28fd59['message'],_0x26833a);_0x4f92c9(_0x5d8992[_0xe627('0x10')](0x1f4,_0x28fd59['message']));});});}; \ No newline at end of file +var _0x72a1=['GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','map','include','model','debug','find','ShowFreshsalesAccount','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x72a1,0x1ce));var _0x172a=function(_0x4a34ad,_0x2af1b4){_0x4a34ad=_0x4a34ad-0x0;var _0x2aab70=_0x72a1[_0x4a34ad];return _0x2aab70;};'use strict';var _=require('lodash');var util=require(_0x172a('0x0'));var moment=require('moment');var BPromise=require(_0x172a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x172a('0x2'));var db=require(_0x172a('0x3'))['db'];var utils=require(_0x172a('0x4'));var logger=require('../../config/logger')(_0x172a('0x5'));var config=require('../../config/environment');var jayson=require(_0x172a('0x6'));var client=jayson['client'][_0x172a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4859e1,_0x15e050,_0x5bf691){return new BPromise(function(_0x1164c1,_0x3efa61){return client['request'](_0x4859e1,_0x5bf691)[_0x172a('0x8')](function(_0x4928a6){logger[_0x172a('0x9')](_0x172a('0xa'),_0x15e050,_0x172a('0xb'));logger['debug'](_0x172a('0xc'),_0x15e050,_0x172a('0xb'),JSON[_0x172a('0xd')](_0x4928a6));if(_0x4928a6[_0x172a('0xe')]){if(_0x4928a6[_0x172a('0xe')]['code']===0x1f4){logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x4928a6[_0x172a('0xe')][_0x172a('0xf')]);return _0x3efa61(_0x4928a6['error'][_0x172a('0xf')]);}logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x4928a6['error'][_0x172a('0xf')]);return _0x1164c1(_0x4928a6[_0x172a('0xe')][_0x172a('0xf')]);}else{logger[_0x172a('0x9')]('FreshsalesAccount,\x20%s,\x20%s',_0x15e050,_0x172a('0xb'));_0x1164c1(_0x4928a6[_0x172a('0x10')]['message']);}})[_0x172a('0x11')](function(_0x489d1c){logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x489d1c);_0x3efa61(_0x489d1c);});});}exports[_0x172a('0x12')]=function(_0x5ad6ec){var _0x159f29=this;return new Promise(function(_0x232c5b,_0x312bac){return db[_0x172a('0x13')][_0x172a('0x14')]({'raw':_0x5ad6ec[_0x172a('0x15')]?_0x5ad6ec[_0x172a('0x15')][_0x172a('0x16')]===undefined?!![]:![]:!![],'where':_0x5ad6ec['options']?_0x5ad6ec['options'][_0x172a('0x17')]||null:null,'attributes':_0x5ad6ec[_0x172a('0x15')]?_0x5ad6ec[_0x172a('0x15')][_0x172a('0x18')]||null:null,'limit':_0x5ad6ec[_0x172a('0x15')]?_0x5ad6ec[_0x172a('0x15')][_0x172a('0x19')]||null:null,'include':_0x5ad6ec[_0x172a('0x15')]?_0x5ad6ec['options']['include']?_[_0x172a('0x1a')](_0x5ad6ec[_0x172a('0x15')][_0x172a('0x1b')],function(_0x3fb66d){return{'model':db[_0x3fb66d['model']],'as':_0x3fb66d['as'],'attributes':_0x3fb66d['attributes'],'include':_0x3fb66d[_0x172a('0x1b')]?_[_0x172a('0x1a')](_0x3fb66d[_0x172a('0x1b')],function(_0x52a9df){return{'model':db[_0x52a9df['model']],'as':_0x52a9df['as'],'attributes':_0x52a9df['attributes'],'include':_0x52a9df[_0x172a('0x1b')]?_[_0x172a('0x1a')](_0x52a9df[_0x172a('0x1b')],function(_0x250bad){return{'model':db[_0x250bad[_0x172a('0x1c')]],'as':_0x250bad['as'],'attributes':_0x250bad[_0x172a('0x18')]};}):[]};}):[]};}):[]:[]})[_0x172a('0x8')](function(_0xf6086){logger[_0x172a('0x9')](_0x172a('0x12'),_0x5ad6ec);logger[_0x172a('0x1d')](_0x172a('0x12'),_0x5ad6ec,JSON[_0x172a('0xd')](_0xf6086));_0x232c5b(_0xf6086);})[_0x172a('0x11')](function(_0x5c8699){logger[_0x172a('0xe')](_0x172a('0x12'),_0x5c8699[_0x172a('0xf')],_0x5ad6ec);_0x312bac(_0x159f29[_0x172a('0xe')](0x1f4,_0x5c8699['message']));});});};exports['ShowFreshsalesAccount']=function(_0x585b09){var _0x473ca2=this;return new Promise(function(_0x876b16,_0x569e25){return db['FreshsalesAccount'][_0x172a('0x1e')]({'raw':_0x585b09[_0x172a('0x15')]?_0x585b09[_0x172a('0x15')][_0x172a('0x16')]===undefined?!![]:![]:!![],'where':_0x585b09[_0x172a('0x15')]?_0x585b09[_0x172a('0x15')][_0x172a('0x17')]||null:null,'attributes':_0x585b09[_0x172a('0x15')]?_0x585b09[_0x172a('0x15')][_0x172a('0x18')]||null:null,'include':_0x585b09[_0x172a('0x15')]?_0x585b09[_0x172a('0x15')][_0x172a('0x1b')]?_[_0x172a('0x1a')](_0x585b09[_0x172a('0x15')][_0x172a('0x1b')],function(_0x5a6fab){return{'model':db[_0x5a6fab['model']],'as':_0x5a6fab['as'],'attributes':_0x5a6fab[_0x172a('0x18')],'include':_0x5a6fab[_0x172a('0x1b')]?_[_0x172a('0x1a')](_0x5a6fab[_0x172a('0x1b')],function(_0x58ae27){return{'model':db[_0x58ae27[_0x172a('0x1c')]],'as':_0x58ae27['as'],'attributes':_0x58ae27[_0x172a('0x18')],'include':_0x58ae27[_0x172a('0x1b')]?_['map'](_0x58ae27['include'],function(_0x5a2d2b){return{'model':db[_0x5a2d2b[_0x172a('0x1c')]],'as':_0x5a2d2b['as'],'attributes':_0x5a2d2b[_0x172a('0x18')]};}):[]};}):[]};}):[]:[]})[_0x172a('0x8')](function(_0x4e7fcf){logger[_0x172a('0x9')](_0x172a('0x1f'),_0x585b09);logger['debug'](_0x172a('0x1f'),_0x585b09,JSON[_0x172a('0xd')](_0x4e7fcf));_0x876b16(_0x4e7fcf);})[_0x172a('0x11')](function(_0xa00627){logger[_0x172a('0xe')]('ShowFreshsalesAccount',_0xa00627[_0x172a('0xf')],_0x585b09);_0x569e25(_0x473ca2['error'](0x1f4,_0xa00627[_0x172a('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 78a7ee6..41fbd36 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 _0x1485=['show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','delete','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id'];(function(_0x5519a9,_0x1c5147){var _0x32f2cc=function(_0x52ed58){while(--_0x52ed58){_0x5519a9['push'](_0x5519a9['shift']());}};_0x32f2cc(++_0x1c5147);}(_0x1485,0x17c));var _0x5148=function(_0x55b8b7,_0x10adec){_0x55b8b7=_0x55b8b7-0x0;var _0x5632b8=_0x1485[_0x55b8b7];return _0x5632b8;};'use strict';var multer=require(_0x5148('0x0'));var util=require(_0x5148('0x1'));var path=require(_0x5148('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5148('0x3')]();var auth=require(_0x5148('0x4'));var interaction=require(_0x5148('0x5'));var config=require('../../config/environment');var controller=require(_0x5148('0x6'));router['get']('/',auth[_0x5148('0x7')](),controller[_0x5148('0x8')]);router[_0x5148('0x9')](_0x5148('0xa'),auth[_0x5148('0x7')](),controller[_0x5148('0xb')]);router[_0x5148('0x9')](_0x5148('0xc'),auth['isAuthenticated'](),controller[_0x5148('0xd')]);router[_0x5148('0x9')](_0x5148('0xe'),auth[_0x5148('0x7')](),controller[_0x5148('0xf')]);router[_0x5148('0x9')](_0x5148('0x10'),auth[_0x5148('0x7')](),controller[_0x5148('0x11')]);router[_0x5148('0x12')]('/',auth[_0x5148('0x7')](),controller[_0x5148('0x13')]);router[_0x5148('0x14')](_0x5148('0xa'),auth['isAuthenticated'](),controller[_0x5148('0x15')]);router[_0x5148('0x16')](_0x5148('0xa'),auth[_0x5148('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x816c=['getFields','post','put','update','delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields'];(function(_0x57a670,_0x30e402){var _0x41ce21=function(_0x11bd34){while(--_0x11bd34){_0x57a670['push'](_0x57a670['shift']());}};_0x41ce21(++_0x30e402);}(_0x816c,0xc7));var _0xc816=function(_0x549c39,_0x1f88de){_0x549c39=_0x549c39-0x0;var _0xb88b84=_0x816c[_0x549c39];return _0xb88b84;};'use strict';var multer=require(_0xc816('0x0'));var util=require('util');var path=require(_0xc816('0x1'));var timeout=require('connect-timeout');var express=require(_0xc816('0x2'));var router=express['Router']();var auth=require(_0xc816('0x3'));var interaction=require(_0xc816('0x4'));var config=require(_0xc816('0x5'));var controller=require(_0xc816('0x6'));router[_0xc816('0x7')]('/',auth[_0xc816('0x8')](),controller[_0xc816('0x9')]);router[_0xc816('0x7')](_0xc816('0xa'),auth['isAuthenticated'](),controller[_0xc816('0xb')]);router[_0xc816('0x7')](_0xc816('0xc'),auth[_0xc816('0x8')](),controller[_0xc816('0xd')]);router['get'](_0xc816('0xe'),auth[_0xc816('0x8')](),controller[_0xc816('0xf')]);router[_0xc816('0x7')](_0xc816('0x10'),auth[_0xc816('0x8')](),controller[_0xc816('0x11')]);router[_0xc816('0x12')]('/',auth[_0xc816('0x8')](),controller['create']);router[_0xc816('0x13')](_0xc816('0xa'),auth[_0xc816('0x8')](),controller[_0xc816('0x14')]);router[_0xc816('0x15')]('/:id',auth[_0xc816('0x8')](),controller[_0xc816('0x16')]);module[_0xc816('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index d598a39..2a0b8e3 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 _0x9655=['exports','STRING','sequelize'];(function(_0x3d799f,_0x544781){var _0x354c67=function(_0x370df0){while(--_0x370df0){_0x3d799f['push'](_0x3d799f['shift']());}};_0x354c67(++_0x544781);}(_0x9655,0x11f));var _0x5965=function(_0x3b6939,_0x7eaff){_0x3b6939=_0x3b6939-0x0;var _0x423b1c=_0x9655[_0x3b6939];return _0x423b1c;};'use strict';var Sequelize=require(_0x5965('0x0'));module[_0x5965('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5965('0x2')]}}; \ No newline at end of file +var _0x8b00=['sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8b00,0x153));var _0x08b0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8b00[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x08b0('0x0'));module[_0x08b0('0x1')]={'name':{'type':Sequelize[_0x08b0('0x2')]},'description':{'type':Sequelize[_0x08b0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 651cb25..76940bd 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 _0x4819=['includeAll','include','findAll','rows','show','params','keys','create','body','update','find','destroy','findOne','FreshsalesField','rawAttributes','getSubjects','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','stringify','error','code','message','info','FreshsalesConfiguration,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','apply','stack','name','send','index','FreshsalesConfiguration','fieldName','type','key','map','query','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','options'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x4819,0xcd));var _0x9481=function(_0x115683,_0x4a1c36){_0x115683=_0x115683-0x0;var _0x5715b0=_0x4819[_0x115683];return _0x5715b0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9481('0x0'));var rimraf=require(_0x9481('0x1'));var zipdir=require(_0x9481('0x2'));var jsonpatch=require(_0x9481('0x3'));var rp=require(_0x9481('0x4'));var moment=require(_0x9481('0x5'));var BPromise=require(_0x9481('0x6'));var Mustache=require(_0x9481('0x7'));var util=require(_0x9481('0x8'));var path=require(_0x9481('0x9'));var sox=require('sox');var csv=require(_0x9481('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xa'));var querystring=require('querystring');var Papa=require(_0x9481('0xf'));var Redis=require('ioredis');var authService=require(_0x9481('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x11'));var hardwareService=require(_0x9481('0x12'));var logger=require(_0x9481('0x13'))(_0x9481('0x14'));var utils=require(_0x9481('0x15'));var config=require(_0x9481('0x16'));var db=require(_0x9481('0x17'))['db'];var jayson=require(_0x9481('0x18'));var client=jayson[_0x9481('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x5aac02,_0xce6fa2,_0x150276){if(_0x150276){var _0x2f0032=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2f0032[_0x9481('0x1a')](_0xce6fa2)){return _0x5aac02;}else{throw new db[(_0x9481('0x1b'))][(_0x9481('0x1c'))](_0x9481('0x1d'));}}else{return _0x5aac02;}}function respondWithRpcPromise(_0x495b30,_0x4220f1,_0x7a7ee,_0x5b1fe6){return new BPromise(function(_0x2266d5,_0x518150){var _0x34108d=_0x5b1fe6||client;return _0x34108d[_0x9481('0x1e')](_0x495b30,_0x7a7ee)[_0x9481('0x1f')](function(_0x2bb2a4){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x4220f1,_0x9481('0x20'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x4220f1,_0x9481('0x20'),JSON[_0x9481('0x21')](_0x2bb2a4));if(_0x2bb2a4[_0x9481('0x22')]){if(_0x2bb2a4[_0x9481('0x22')][_0x9481('0x23')]===0x1f4){logger[_0x9481('0x22')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4220f1,_0x2bb2a4[_0x9481('0x22')][_0x9481('0x24')]);return _0x518150(_0x2bb2a4[_0x9481('0x22')][_0x9481('0x24')]);}logger[_0x9481('0x22')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4220f1,_0x2bb2a4[_0x9481('0x22')][_0x9481('0x24')]);return _0x2266d5(_0x2bb2a4['error'][_0x9481('0x24')]);}else{logger[_0x9481('0x25')](_0x9481('0x26'),_0x4220f1,_0x9481('0x20'));_0x2266d5(_0x2bb2a4[_0x9481('0x27')]['message']);}})[_0x9481('0x28')](function(_0x22f0b5){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x4220f1,_0x22f0b5);_0x518150(_0x22f0b5);});});}function respondWithStatusCode(_0x12b0c3,_0x299e28){_0x299e28=_0x299e28||0xcc;return function(_0x550fce){if(_0x550fce){return _0x12b0c3[_0x9481('0x29')](_0x299e28);}return _0x12b0c3[_0x9481('0x2a')](_0x299e28)[_0x9481('0x2b')]();};}function respondWithResult(_0x28ae1b,_0x5a1300){_0x5a1300=_0x5a1300||0xc8;return function(_0x14f03e){if(_0x14f03e){return _0x28ae1b[_0x9481('0x2a')](_0x5a1300)[_0x9481('0x2c')](_0x14f03e);}};}function respondWithFilteredResult(_0x587706,_0x1791b2){return function(_0x56e944){if(_0x56e944){var _0x2e1eff=_0x56e944[_0x9481('0x2d')],_0xe153ab=_0x1791b2['offset'],_0x22ab26=_0x1791b2[_0x9481('0x2e')]+_0x1791b2[_0x9481('0x2f')],_0x13ef93;if(_0x22ab26>=_0x2e1eff){_0x22ab26=_0x2e1eff;_0x13ef93=0xc8;}else{_0x13ef93=0xce;}_0x587706[_0x9481('0x2a')](_0x13ef93);return _0x587706['set']('Content-Range',_0xe153ab+'-'+_0x22ab26+'/'+_0x2e1eff)[_0x9481('0x2c')](_0x56e944);}return null;};}function patchUpdates(_0x427c25){return function(_0x42df68){try{jsonpatch[_0x9481('0x30')](_0x42df68,_0x427c25,!![]);}catch(_0x5d9926){return BPromise['reject'](_0x5d9926);}return _0x42df68['save']();};}function saveUpdates(_0x29e6b6,_0x5d6c65){return function(_0x28e9d6){if(_0x28e9d6){return _0x28e9d6['update'](_0x29e6b6)[_0x9481('0x1f')](function(_0x384bfd){return _0x384bfd;});}return null;};}function removeEntity(_0x40a2d7,_0x71d97f){return function(_0x149113){if(_0x149113){return _0x149113['destroy']()[_0x9481('0x1f')](function(){_0x40a2d7[_0x9481('0x2a')](0xcc)[_0x9481('0x2b')]();});}};}function handleEntityNotFound(_0x529a0b,_0x30063f){return function(_0x2079b1){if(!_0x2079b1){_0x529a0b[_0x9481('0x29')](0x194);}return _0x2079b1;};}function handleError(_0x221aa2,_0xdc87e6){_0xdc87e6=_0xdc87e6||0x1f4;return function(_0x26bfb2){logger['error'](_0x26bfb2[_0x9481('0x31')]);if(_0x26bfb2['name']){delete _0x26bfb2[_0x9481('0x32')];}_0x221aa2[_0x9481('0x2a')](_0xdc87e6)[_0x9481('0x33')](_0x26bfb2);};}exports[_0x9481('0x34')]=function(_0x2ebcbd,_0x2face9){var _0x541d8b={},_0x6043a4={},_0x15e27f={'count':0x0,'rows':[]};var _0x4ed991=_['map'](db[_0x9481('0x35')]['rawAttributes'],function(_0x224b88){return{'name':_0x224b88[_0x9481('0x36')],'type':_0x224b88[_0x9481('0x37')][_0x9481('0x38')]};});_0x6043a4['model']=_[_0x9481('0x39')](_0x4ed991,'name');_0x6043a4[_0x9481('0x3a')]=_['keys'](_0x2ebcbd[_0x9481('0x3a')]);_0x6043a4['filters']=_[_0x9481('0x3b')](_0x6043a4[_0x9481('0x3c')],_0x6043a4[_0x9481('0x3a')]);_0x541d8b[_0x9481('0x3d')]=_[_0x9481('0x3b')](_0x6043a4[_0x9481('0x3c')],qs[_0x9481('0x3e')](_0x2ebcbd['query'][_0x9481('0x3e')]));_0x541d8b[_0x9481('0x3d')]=_0x541d8b[_0x9481('0x3d')][_0x9481('0x3f')]?_0x541d8b[_0x9481('0x3d')]:_0x6043a4[_0x9481('0x3c')];if(!_0x2ebcbd[_0x9481('0x3a')]['hasOwnProperty'](_0x9481('0x40'))){_0x541d8b[_0x9481('0x2f')]=qs['limit'](_0x2ebcbd[_0x9481('0x3a')][_0x9481('0x2f')]);_0x541d8b[_0x9481('0x2e')]=qs[_0x9481('0x2e')](_0x2ebcbd[_0x9481('0x3a')]['offset']);}_0x541d8b[_0x9481('0x41')]=qs['sort'](_0x2ebcbd[_0x9481('0x3a')][_0x9481('0x42')]);_0x541d8b['where']=qs['filters'](_[_0x9481('0x43')](_0x2ebcbd[_0x9481('0x3a')],_0x6043a4[_0x9481('0x44')]));if(_0x2ebcbd['query'][_0x9481('0x45')]){_0x541d8b[_0x9481('0x46')]=_['merge'](_0x541d8b['where'],{'$or':_[_0x9481('0x39')](_0x4ed991,function(_0x5f063a){if(_0x5f063a[_0x9481('0x37')]!==_0x9481('0x47')){var _0x41b30b={};_0x41b30b[_0x5f063a[_0x9481('0x32')]]={'$like':'%'+_0x2ebcbd[_0x9481('0x3a')]['filter']+'%'};return _0x41b30b;}})});}_0x541d8b=_[_0x9481('0x48')]({},_0x541d8b,_0x2ebcbd[_0x9481('0x49')]);var _0x4d6a2f={'where':_0x541d8b[_0x9481('0x46')]};return db[_0x9481('0x35')][_0x9481('0x2d')](_0x4d6a2f)[_0x9481('0x1f')](function(_0x4db2d3){_0x15e27f[_0x9481('0x2d')]=_0x4db2d3;if(_0x2ebcbd[_0x9481('0x3a')][_0x9481('0x4a')]){_0x541d8b[_0x9481('0x4b')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x9481('0x4c')](_0x541d8b);})['then'](function(_0x5c4d18){_0x15e27f[_0x9481('0x4d')]=_0x5c4d18;return _0x15e27f;})['then'](respondWithFilteredResult(_0x2face9,_0x541d8b))[_0x9481('0x28')](handleError(_0x2face9,null));};exports[_0x9481('0x4e')]=function(_0x47f8b2,_0x277e2a){var _0x1044a2={'raw':![],'where':{'id':_0x47f8b2[_0x9481('0x4f')]['id']}},_0x2f3413={};_0x2f3413[_0x9481('0x3c')]=_[_0x9481('0x50')](db['FreshsalesConfiguration']['rawAttributes']);_0x2f3413[_0x9481('0x3a')]=_[_0x9481('0x50')](_0x47f8b2[_0x9481('0x3a')]);_0x2f3413[_0x9481('0x44')]=_[_0x9481('0x3b')](_0x2f3413[_0x9481('0x3c')],_0x2f3413[_0x9481('0x3a')]);_0x1044a2[_0x9481('0x3d')]=_['intersection'](_0x2f3413[_0x9481('0x3c')],qs[_0x9481('0x3e')](_0x47f8b2[_0x9481('0x3a')][_0x9481('0x3e')]));_0x1044a2[_0x9481('0x3d')]=_0x1044a2['attributes']['length']?_0x1044a2[_0x9481('0x3d')]:_0x2f3413[_0x9481('0x3c')];if(_0x47f8b2[_0x9481('0x3a')]['includeAll']){_0x1044a2['include']=[{'all':!![]}];}_0x1044a2=_['merge']({},_0x1044a2,_0x47f8b2['options']);return db['FreshsalesConfiguration']['find'](_0x1044a2)['then'](handleEntityNotFound(_0x277e2a,null))[_0x9481('0x1f')](respondWithResult(_0x277e2a,null))[_0x9481('0x28')](handleError(_0x277e2a,null));};exports['create']=function(_0xd8351c,_0x5f210c){return db[_0x9481('0x35')][_0x9481('0x51')](_0xd8351c[_0x9481('0x52')],{})[_0x9481('0x1f')](respondWithResult(_0x5f210c,0xc9))[_0x9481('0x28')](handleError(_0x5f210c,null));};exports[_0x9481('0x53')]=function(_0x25c03b,_0x4c27e4){if(_0x25c03b[_0x9481('0x52')]['id']){delete _0x25c03b[_0x9481('0x52')]['id'];}return db['FreshsalesConfiguration'][_0x9481('0x54')]({'where':{'id':_0x25c03b[_0x9481('0x4f')]['id']}})[_0x9481('0x1f')](handleEntityNotFound(_0x4c27e4,null))[_0x9481('0x1f')](saveUpdates(_0x25c03b[_0x9481('0x52')],null))['then'](respondWithResult(_0x4c27e4,null))[_0x9481('0x28')](handleError(_0x4c27e4,null));};exports[_0x9481('0x55')]=function(_0x382f0,_0x3fc0f9){return db[_0x9481('0x35')][_0x9481('0x54')]({'where':{'id':_0x382f0[_0x9481('0x4f')]['id']}})[_0x9481('0x1f')](handleEntityNotFound(_0x3fc0f9,null))[_0x9481('0x1f')](removeEntity(_0x3fc0f9,null))['catch'](handleError(_0x3fc0f9,null));};exports['getSubjects']=function(_0x5b4234,_0x3240df,_0xc06b4d){var _0x4e1c07={};var _0xe8ce2a={};var _0x45aede;var _0x36fd7d;return db[_0x9481('0x35')][_0x9481('0x56')]({'where':{'id':_0x5b4234[_0x9481('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3240df,null))['then'](function(_0xfa9737){if(_0xfa9737){_0x45aede=_0xfa9737;_0xe8ce2a[_0x9481('0x3c')]=_[_0x9481('0x50')](db[_0x9481('0x57')][_0x9481('0x58')]);_0xe8ce2a[_0x9481('0x3a')]=_['keys'](_0x5b4234['query']);_0xe8ce2a[_0x9481('0x44')]=_['intersection'](_0xe8ce2a[_0x9481('0x3c')],_0xe8ce2a['query']);_0x4e1c07[_0x9481('0x3d')]=_[_0x9481('0x3b')](_0xe8ce2a[_0x9481('0x3c')],qs['fields'](_0x5b4234[_0x9481('0x3a')][_0x9481('0x3e')]));_0x4e1c07['attributes']=_0x4e1c07['attributes']['length']?_0x4e1c07['attributes']:_0xe8ce2a[_0x9481('0x3c')];_0x4e1c07['order']=qs[_0x9481('0x42')](_0x5b4234[_0x9481('0x3a')][_0x9481('0x42')]);_0x4e1c07['where']=qs[_0x9481('0x44')](_['pick'](_0x5b4234[_0x9481('0x3a')],_0xe8ce2a[_0x9481('0x44')]));if(_0x5b4234[_0x9481('0x3a')]['filter']){_0x4e1c07[_0x9481('0x46')]=_[_0x9481('0x48')](_0x4e1c07['where'],{'$or':_[_0x9481('0x39')](_0x4e1c07[_0x9481('0x3d')],function(_0x221942){var _0x2802a1={};_0x2802a1[_0x221942]={'$like':'%'+_0x5b4234[_0x9481('0x3a')][_0x9481('0x45')]+'%'};return _0x2802a1;})});}_0x4e1c07=_[_0x9481('0x48')]({},_0x4e1c07,_0x5b4234[_0x9481('0x49')]);return _0x45aede[_0x9481('0x59')](_0x4e1c07);}})[_0x9481('0x1f')](function(_0x237d9b){if(_0x237d9b){_0x36fd7d=_0x237d9b[_0x9481('0x3f')];if(!_0x5b4234[_0x9481('0x3a')][_0x9481('0x5a')](_0x9481('0x40'))){_0x4e1c07[_0x9481('0x2f')]=qs[_0x9481('0x2f')](_0x5b4234['query'][_0x9481('0x2f')]);_0x4e1c07['offset']=qs['offset'](_0x5b4234[_0x9481('0x3a')]['offset']);}return _0x45aede['getSubjects'](_0x4e1c07);}})['then'](function(_0x1b1967){if(_0x1b1967){return _0x1b1967?{'count':_0x36fd7d,'rows':_0x1b1967}:null;}})[_0x9481('0x1f')](respondWithResult(_0x3240df,null))[_0x9481('0x28')](handleError(_0x3240df,null));};exports[_0x9481('0x5b')]=function(_0x59bffa,_0xa83176,_0x265f1c){var _0x2a053a={};var _0x2a4517={};var _0x54323e;var _0x4b4e4c;return db[_0x9481('0x35')][_0x9481('0x56')]({'where':{'id':_0x59bffa[_0x9481('0x4f')]['id']}})[_0x9481('0x1f')](handleEntityNotFound(_0xa83176,null))[_0x9481('0x1f')](function(_0x5bf10b){if(_0x5bf10b){_0x54323e=_0x5bf10b;_0x2a4517[_0x9481('0x3c')]=_[_0x9481('0x50')](db[_0x9481('0x57')][_0x9481('0x58')]);_0x2a4517[_0x9481('0x3a')]=_[_0x9481('0x50')](_0x59bffa[_0x9481('0x3a')]);_0x2a4517[_0x9481('0x44')]=_[_0x9481('0x3b')](_0x2a4517[_0x9481('0x3c')],_0x2a4517[_0x9481('0x3a')]);_0x2a053a[_0x9481('0x3d')]=_[_0x9481('0x3b')](_0x2a4517[_0x9481('0x3c')],qs[_0x9481('0x3e')](_0x59bffa['query'][_0x9481('0x3e')]));_0x2a053a[_0x9481('0x3d')]=_0x2a053a[_0x9481('0x3d')][_0x9481('0x3f')]?_0x2a053a[_0x9481('0x3d')]:_0x2a4517[_0x9481('0x3c')];_0x2a053a[_0x9481('0x41')]=qs['sort'](_0x59bffa[_0x9481('0x3a')][_0x9481('0x42')]);_0x2a053a['where']=qs['filters'](_[_0x9481('0x43')](_0x59bffa['query'],_0x2a4517['filters']));if(_0x59bffa[_0x9481('0x3a')]['filter']){_0x2a053a[_0x9481('0x46')]=_[_0x9481('0x48')](_0x2a053a[_0x9481('0x46')],{'$or':_[_0x9481('0x39')](_0x2a053a['attributes'],function(_0x39b9a2){var _0x4981b3={};_0x4981b3[_0x39b9a2]={'$like':'%'+_0x59bffa[_0x9481('0x3a')][_0x9481('0x45')]+'%'};return _0x4981b3;})});}_0x2a053a=_[_0x9481('0x48')]({},_0x2a053a,_0x59bffa['options']);return _0x54323e['getDescriptions'](_0x2a053a);}})['then'](function(_0x3d7e5c){if(_0x3d7e5c){_0x4b4e4c=_0x3d7e5c['length'];if(!_0x59bffa['query'][_0x9481('0x5a')](_0x9481('0x40'))){_0x2a053a[_0x9481('0x2f')]=qs['limit'](_0x59bffa[_0x9481('0x3a')][_0x9481('0x2f')]);_0x2a053a['offset']=qs[_0x9481('0x2e')](_0x59bffa[_0x9481('0x3a')][_0x9481('0x2e')]);}return _0x54323e[_0x9481('0x5b')](_0x2a053a);}})['then'](function(_0x2e585d){if(_0x2e585d){return _0x2e585d?{'count':_0x4b4e4c,'rows':_0x2e585d}:null;}})['then'](respondWithResult(_0xa83176,null))[_0x9481('0x28')](handleError(_0xa83176,null));};exports[_0x9481('0x5c')]=function(_0x4b99ec,_0x1c82a1,_0x17a655){var _0x47369f={};var _0x4f6e33={};var _0x5ee22d;var _0xcc7bd9;return db['FreshsalesConfiguration'][_0x9481('0x56')]({'where':{'id':_0x4b99ec[_0x9481('0x4f')]['id']}})[_0x9481('0x1f')](handleEntityNotFound(_0x1c82a1,null))['then'](function(_0x3f74f1){if(_0x3f74f1){_0x5ee22d=_0x3f74f1;_0x4f6e33[_0x9481('0x3c')]=_[_0x9481('0x50')](db['FreshsalesField'][_0x9481('0x58')]);_0x4f6e33[_0x9481('0x3a')]=_[_0x9481('0x50')](_0x4b99ec[_0x9481('0x3a')]);_0x4f6e33[_0x9481('0x44')]=_[_0x9481('0x3b')](_0x4f6e33[_0x9481('0x3c')],_0x4f6e33[_0x9481('0x3a')]);_0x47369f[_0x9481('0x3d')]=_[_0x9481('0x3b')](_0x4f6e33['model'],qs[_0x9481('0x3e')](_0x4b99ec['query']['fields']));_0x47369f['attributes']=_0x47369f[_0x9481('0x3d')][_0x9481('0x3f')]?_0x47369f[_0x9481('0x3d')]:_0x4f6e33[_0x9481('0x3c')];_0x47369f[_0x9481('0x41')]=qs['sort'](_0x4b99ec[_0x9481('0x3a')][_0x9481('0x42')]);_0x47369f[_0x9481('0x46')]=qs[_0x9481('0x44')](_[_0x9481('0x43')](_0x4b99ec[_0x9481('0x3a')],_0x4f6e33[_0x9481('0x44')]));if(_0x4b99ec[_0x9481('0x3a')][_0x9481('0x45')]){_0x47369f[_0x9481('0x46')]=_['merge'](_0x47369f[_0x9481('0x46')],{'$or':_[_0x9481('0x39')](_0x47369f[_0x9481('0x3d')],function(_0x1cbc8c){var _0x2a73ba={};_0x2a73ba[_0x1cbc8c]={'$like':'%'+_0x4b99ec[_0x9481('0x3a')][_0x9481('0x45')]+'%'};return _0x2a73ba;})});}_0x47369f=_[_0x9481('0x48')]({},_0x47369f,_0x4b99ec[_0x9481('0x49')]);return _0x5ee22d[_0x9481('0x5c')](_0x47369f);}})['then'](function(_0x12a450){if(_0x12a450){_0xcc7bd9=_0x12a450[_0x9481('0x3f')];if(!_0x4b99ec[_0x9481('0x3a')][_0x9481('0x5a')](_0x9481('0x40'))){_0x47369f[_0x9481('0x2f')]=qs[_0x9481('0x2f')](_0x4b99ec[_0x9481('0x3a')][_0x9481('0x2f')]);_0x47369f['offset']=qs[_0x9481('0x2e')](_0x4b99ec['query']['offset']);}return _0x5ee22d[_0x9481('0x5c')](_0x47369f);}})[_0x9481('0x1f')](function(_0x18cb44){if(_0x18cb44){return _0x18cb44?{'count':_0xcc7bd9,'rows':_0x18cb44}:null;}})[_0x9481('0x1f')](respondWithResult(_0x1c82a1,null))[_0x9481('0x28')](handleError(_0x1c82a1,null));}; \ No newline at end of file +var _0x9c5a=['request-promise','moment','mustache','util','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','count','offset','set','Content-Range','reject','save','update','destroy','end','send','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','body','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','html-pdf','eml-format','zip-dir','fast-json-patch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x279bb2,_0x30cb4a){_0x279bb2=_0x279bb2-0x0;var _0x2f5cba=_0x9c5a[_0x279bb2];return _0x2f5cba;};'use strict';var pdf=require(_0xa9c5('0x0'));var emlformat=require(_0xa9c5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa9c5('0x2'));var jsonpatch=require(_0xa9c5('0x3'));var rp=require(_0xa9c5('0x4'));var moment=require(_0xa9c5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa9c5('0x6'));var util=require(_0xa9c5('0x7'));var path=require('path');var sox=require(_0xa9c5('0x8'));var csv=require('to-csv');var ejs=require(_0xa9c5('0x9'));var fs=require('fs');var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var db=require(_0xa9c5('0x15'))['db'];var jayson=require(_0xa9c5('0x16'));var client=jayson[_0xa9c5('0x17')][_0xa9c5('0x18')]({'port':0x232a});function checkPasswordPattern(_0x3c5ac7,_0x1ea48,_0x5915ad){if(_0x5915ad){var _0x390ca2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x390ca2[_0xa9c5('0x19')](_0x1ea48)){return _0x3c5ac7;}else{throw new db[(_0xa9c5('0x1a'))][(_0xa9c5('0x1b'))](_0xa9c5('0x1c'));}}else{return _0x3c5ac7;}}function respondWithRpcPromise(_0x1dad66,_0x251099,_0x40b001,_0x19a43e){return new BPromise(function(_0xcf13f2,_0x4bb57e){var _0x2b0d73=_0x19a43e||client;return _0x2b0d73[_0xa9c5('0x1d')](_0x1dad66,_0x40b001)[_0xa9c5('0x1e')](function(_0x55cce5){logger[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x251099,_0xa9c5('0x21'));logger[_0xa9c5('0x22')](_0xa9c5('0x23'),_0x251099,_0xa9c5('0x21'),JSON[_0xa9c5('0x24')](_0x55cce5));if(_0x55cce5[_0xa9c5('0x25')]){if(_0x55cce5[_0xa9c5('0x25')][_0xa9c5('0x26')]===0x1f4){logger[_0xa9c5('0x25')](_0xa9c5('0x20'),_0x251099,_0x55cce5['error'][_0xa9c5('0x27')]);return _0x4bb57e(_0x55cce5[_0xa9c5('0x25')]['message']);}logger['error'](_0xa9c5('0x20'),_0x251099,_0x55cce5[_0xa9c5('0x25')][_0xa9c5('0x27')]);return _0xcf13f2(_0x55cce5[_0xa9c5('0x25')][_0xa9c5('0x27')]);}else{logger[_0xa9c5('0x1f')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x251099,'request\x20sent');_0xcf13f2(_0x55cce5[_0xa9c5('0x28')][_0xa9c5('0x27')]);}})['catch'](function(_0x6819b3){logger[_0xa9c5('0x25')](_0xa9c5('0x20'),_0x251099,_0x6819b3);_0x4bb57e(_0x6819b3);});});}function respondWithStatusCode(_0x32fc7d,_0x4cbba1){_0x4cbba1=_0x4cbba1||0xcc;return function(_0x40f08b){if(_0x40f08b){return _0x32fc7d[_0xa9c5('0x29')](_0x4cbba1);}return _0x32fc7d['status'](_0x4cbba1)['end']();};}function respondWithResult(_0x242771,_0x4cd5e6){_0x4cd5e6=_0x4cd5e6||0xc8;return function(_0x1762ac){if(_0x1762ac){return _0x242771[_0xa9c5('0x2a')](_0x4cd5e6)['json'](_0x1762ac);}};}function respondWithFilteredResult(_0x11a723,_0x320dc0){return function(_0x5f468b){if(_0x5f468b){var _0x413edf=_0x5f468b[_0xa9c5('0x2b')],_0x32baf9=_0x320dc0['offset'],_0x198cdf=_0x320dc0[_0xa9c5('0x2c')]+_0x320dc0['limit'],_0x185eb8;if(_0x198cdf>=_0x413edf){_0x198cdf=_0x413edf;_0x185eb8=0xc8;}else{_0x185eb8=0xce;}_0x11a723[_0xa9c5('0x2a')](_0x185eb8);return _0x11a723[_0xa9c5('0x2d')](_0xa9c5('0x2e'),_0x32baf9+'-'+_0x198cdf+'/'+_0x413edf)['json'](_0x5f468b);}return null;};}function patchUpdates(_0xc6d0c1){return function(_0xbe29c5){try{jsonpatch['apply'](_0xbe29c5,_0xc6d0c1,!![]);}catch(_0x3f11a9){return BPromise[_0xa9c5('0x2f')](_0x3f11a9);}return _0xbe29c5[_0xa9c5('0x30')]();};}function saveUpdates(_0x378684,_0x22ee21){return function(_0x3392d0){if(_0x3392d0){return _0x3392d0[_0xa9c5('0x31')](_0x378684)['then'](function(_0x452330){return _0x452330;});}return null;};}function removeEntity(_0x3bdf64,_0xf4a9f3){return function(_0x1c01f9){if(_0x1c01f9){return _0x1c01f9[_0xa9c5('0x32')]()[_0xa9c5('0x1e')](function(){_0x3bdf64[_0xa9c5('0x2a')](0xcc)[_0xa9c5('0x33')]();});}};}function handleEntityNotFound(_0x57ebb7,_0x4e3f3e){return function(_0x1487a4){if(!_0x1487a4){_0x57ebb7[_0xa9c5('0x29')](0x194);}return _0x1487a4;};}function handleError(_0xf2bebc,_0x1313b2){_0x1313b2=_0x1313b2||0x1f4;return function(_0x296116){logger[_0xa9c5('0x25')](_0x296116['stack']);if(_0x296116['name']){delete _0x296116['name'];}_0xf2bebc[_0xa9c5('0x2a')](_0x1313b2)[_0xa9c5('0x34')](_0x296116);};}exports['index']=function(_0x13a1f5,_0x56eb82){var _0x1f5740={},_0x1fc8bf={},_0x2567be={'count':0x0,'rows':[]};var _0x29b17c=_['map'](db[_0xa9c5('0x35')][_0xa9c5('0x36')],function(_0x191153){return{'name':_0x191153[_0xa9c5('0x37')],'type':_0x191153[_0xa9c5('0x38')][_0xa9c5('0x39')]};});_0x1fc8bf[_0xa9c5('0x3a')]=_[_0xa9c5('0x3b')](_0x29b17c,'name');_0x1fc8bf[_0xa9c5('0x3c')]=_[_0xa9c5('0x3d')](_0x13a1f5[_0xa9c5('0x3c')]);_0x1fc8bf[_0xa9c5('0x3e')]=_[_0xa9c5('0x3f')](_0x1fc8bf[_0xa9c5('0x3a')],_0x1fc8bf['query']);_0x1f5740[_0xa9c5('0x40')]=_['intersection'](_0x1fc8bf[_0xa9c5('0x3a')],qs['fields'](_0x13a1f5[_0xa9c5('0x3c')][_0xa9c5('0x41')]));_0x1f5740[_0xa9c5('0x40')]=_0x1f5740['attributes'][_0xa9c5('0x42')]?_0x1f5740[_0xa9c5('0x40')]:_0x1fc8bf[_0xa9c5('0x3a')];if(!_0x13a1f5[_0xa9c5('0x3c')]['hasOwnProperty'](_0xa9c5('0x43'))){_0x1f5740[_0xa9c5('0x44')]=qs[_0xa9c5('0x44')](_0x13a1f5[_0xa9c5('0x3c')][_0xa9c5('0x44')]);_0x1f5740['offset']=qs[_0xa9c5('0x2c')](_0x13a1f5['query'][_0xa9c5('0x2c')]);}_0x1f5740[_0xa9c5('0x45')]=qs[_0xa9c5('0x46')](_0x13a1f5[_0xa9c5('0x3c')][_0xa9c5('0x46')]);_0x1f5740[_0xa9c5('0x47')]=qs[_0xa9c5('0x3e')](_[_0xa9c5('0x48')](_0x13a1f5[_0xa9c5('0x3c')],_0x1fc8bf[_0xa9c5('0x3e')]));if(_0x13a1f5['query'][_0xa9c5('0x49')]){_0x1f5740[_0xa9c5('0x47')]=_[_0xa9c5('0x4a')](_0x1f5740[_0xa9c5('0x47')],{'$or':_[_0xa9c5('0x3b')](_0x29b17c,function(_0x3794d2){if(_0x3794d2['type']!==_0xa9c5('0x4b')){var _0x2ba81e={};_0x2ba81e[_0x3794d2['name']]={'$like':'%'+_0x13a1f5['query']['filter']+'%'};return _0x2ba81e;}})});}_0x1f5740=_['merge']({},_0x1f5740,_0x13a1f5['options']);var _0x160020={'where':_0x1f5740[_0xa9c5('0x47')]};return db[_0xa9c5('0x35')][_0xa9c5('0x2b')](_0x160020)[_0xa9c5('0x1e')](function(_0x240c40){_0x2567be[_0xa9c5('0x2b')]=_0x240c40;if(_0x13a1f5[_0xa9c5('0x3c')][_0xa9c5('0x4c')]){_0x1f5740[_0xa9c5('0x4d')]=[{'all':!![]}];}return db[_0xa9c5('0x35')][_0xa9c5('0x4e')](_0x1f5740);})[_0xa9c5('0x1e')](function(_0x4bf8b4){_0x2567be[_0xa9c5('0x4f')]=_0x4bf8b4;return _0x2567be;})['then'](respondWithFilteredResult(_0x56eb82,_0x1f5740))[_0xa9c5('0x50')](handleError(_0x56eb82,null));};exports[_0xa9c5('0x51')]=function(_0x5c1c3a,_0x5cbd33){var _0xf00970={'raw':![],'where':{'id':_0x5c1c3a[_0xa9c5('0x52')]['id']}},_0x32e64a={};_0x32e64a['model']=_['keys'](db[_0xa9c5('0x35')][_0xa9c5('0x36')]);_0x32e64a['query']=_[_0xa9c5('0x3d')](_0x5c1c3a[_0xa9c5('0x3c')]);_0x32e64a[_0xa9c5('0x3e')]=_[_0xa9c5('0x3f')](_0x32e64a[_0xa9c5('0x3a')],_0x32e64a[_0xa9c5('0x3c')]);_0xf00970['attributes']=_['intersection'](_0x32e64a['model'],qs[_0xa9c5('0x41')](_0x5c1c3a[_0xa9c5('0x3c')][_0xa9c5('0x41')]));_0xf00970[_0xa9c5('0x40')]=_0xf00970[_0xa9c5('0x40')][_0xa9c5('0x42')]?_0xf00970['attributes']:_0x32e64a[_0xa9c5('0x3a')];if(_0x5c1c3a[_0xa9c5('0x3c')][_0xa9c5('0x4c')]){_0xf00970[_0xa9c5('0x4d')]=[{'all':!![]}];}_0xf00970=_[_0xa9c5('0x4a')]({},_0xf00970,_0x5c1c3a[_0xa9c5('0x53')]);return db['FreshsalesConfiguration']['find'](_0xf00970)[_0xa9c5('0x1e')](handleEntityNotFound(_0x5cbd33,null))['then'](respondWithResult(_0x5cbd33,null))[_0xa9c5('0x50')](handleError(_0x5cbd33,null));};exports['create']=function(_0xfae271,_0x2068bc){return db[_0xa9c5('0x35')]['create'](_0xfae271[_0xa9c5('0x54')],{})[_0xa9c5('0x1e')](respondWithResult(_0x2068bc,0xc9))[_0xa9c5('0x50')](handleError(_0x2068bc,null));};exports[_0xa9c5('0x31')]=function(_0x539672,_0x49422c){if(_0x539672[_0xa9c5('0x54')]['id']){delete _0x539672[_0xa9c5('0x54')]['id'];}return db[_0xa9c5('0x35')]['find']({'where':{'id':_0x539672[_0xa9c5('0x52')]['id']}})[_0xa9c5('0x1e')](handleEntityNotFound(_0x49422c,null))[_0xa9c5('0x1e')](saveUpdates(_0x539672[_0xa9c5('0x54')],null))[_0xa9c5('0x1e')](respondWithResult(_0x49422c,null))[_0xa9c5('0x50')](handleError(_0x49422c,null));};exports[_0xa9c5('0x32')]=function(_0x298b3d,_0x5a7f0a){return db[_0xa9c5('0x35')]['find']({'where':{'id':_0x298b3d[_0xa9c5('0x52')]['id']}})[_0xa9c5('0x1e')](handleEntityNotFound(_0x5a7f0a,null))[_0xa9c5('0x1e')](removeEntity(_0x5a7f0a,null))['catch'](handleError(_0x5a7f0a,null));};exports[_0xa9c5('0x55')]=function(_0x1dd3b2,_0x4d866d,_0x1edab3){var _0x550144={};var _0x13a708={};var _0x3363fb;var _0x49f91c;return db[_0xa9c5('0x35')][_0xa9c5('0x56')]({'where':{'id':_0x1dd3b2[_0xa9c5('0x52')]['id']}})[_0xa9c5('0x1e')](handleEntityNotFound(_0x4d866d,null))['then'](function(_0x5538ad){if(_0x5538ad){_0x3363fb=_0x5538ad;_0x13a708[_0xa9c5('0x3a')]=_[_0xa9c5('0x3d')](db[_0xa9c5('0x57')][_0xa9c5('0x36')]);_0x13a708[_0xa9c5('0x3c')]=_[_0xa9c5('0x3d')](_0x1dd3b2['query']);_0x13a708[_0xa9c5('0x3e')]=_[_0xa9c5('0x3f')](_0x13a708[_0xa9c5('0x3a')],_0x13a708[_0xa9c5('0x3c')]);_0x550144[_0xa9c5('0x40')]=_[_0xa9c5('0x3f')](_0x13a708[_0xa9c5('0x3a')],qs[_0xa9c5('0x41')](_0x1dd3b2[_0xa9c5('0x3c')][_0xa9c5('0x41')]));_0x550144['attributes']=_0x550144['attributes'][_0xa9c5('0x42')]?_0x550144[_0xa9c5('0x40')]:_0x13a708[_0xa9c5('0x3a')];_0x550144[_0xa9c5('0x45')]=qs['sort'](_0x1dd3b2[_0xa9c5('0x3c')]['sort']);_0x550144[_0xa9c5('0x47')]=qs[_0xa9c5('0x3e')](_[_0xa9c5('0x48')](_0x1dd3b2[_0xa9c5('0x3c')],_0x13a708[_0xa9c5('0x3e')]));if(_0x1dd3b2[_0xa9c5('0x3c')][_0xa9c5('0x49')]){_0x550144[_0xa9c5('0x47')]=_[_0xa9c5('0x4a')](_0x550144[_0xa9c5('0x47')],{'$or':_[_0xa9c5('0x3b')](_0x550144[_0xa9c5('0x40')],function(_0x59cfee){var _0x3312d1={};_0x3312d1[_0x59cfee]={'$like':'%'+_0x1dd3b2[_0xa9c5('0x3c')][_0xa9c5('0x49')]+'%'};return _0x3312d1;})});}_0x550144=_[_0xa9c5('0x4a')]({},_0x550144,_0x1dd3b2[_0xa9c5('0x53')]);return _0x3363fb[_0xa9c5('0x55')](_0x550144);}})[_0xa9c5('0x1e')](function(_0x4dc5ab){if(_0x4dc5ab){_0x49f91c=_0x4dc5ab['length'];if(!_0x1dd3b2[_0xa9c5('0x3c')]['hasOwnProperty'](_0xa9c5('0x43'))){_0x550144[_0xa9c5('0x44')]=qs['limit'](_0x1dd3b2[_0xa9c5('0x3c')][_0xa9c5('0x44')]);_0x550144['offset']=qs['offset'](_0x1dd3b2[_0xa9c5('0x3c')][_0xa9c5('0x2c')]);}return _0x3363fb[_0xa9c5('0x55')](_0x550144);}})['then'](function(_0x4a2bce){if(_0x4a2bce){return _0x4a2bce?{'count':_0x49f91c,'rows':_0x4a2bce}:null;}})[_0xa9c5('0x1e')](respondWithResult(_0x4d866d,null))[_0xa9c5('0x50')](handleError(_0x4d866d,null));};exports['getDescriptions']=function(_0xd0371c,_0x393b00,_0x2a3368){var _0x3c0c7a={};var _0x135791={};var _0x45b0a3;var _0x4e2fb1;return db[_0xa9c5('0x35')][_0xa9c5('0x56')]({'where':{'id':_0xd0371c[_0xa9c5('0x52')]['id']}})[_0xa9c5('0x1e')](handleEntityNotFound(_0x393b00,null))['then'](function(_0x87303a){if(_0x87303a){_0x45b0a3=_0x87303a;_0x135791[_0xa9c5('0x3a')]=_['keys'](db[_0xa9c5('0x57')][_0xa9c5('0x36')]);_0x135791[_0xa9c5('0x3c')]=_['keys'](_0xd0371c[_0xa9c5('0x3c')]);_0x135791[_0xa9c5('0x3e')]=_[_0xa9c5('0x3f')](_0x135791[_0xa9c5('0x3a')],_0x135791[_0xa9c5('0x3c')]);_0x3c0c7a[_0xa9c5('0x40')]=_[_0xa9c5('0x3f')](_0x135791['model'],qs[_0xa9c5('0x41')](_0xd0371c[_0xa9c5('0x3c')][_0xa9c5('0x41')]));_0x3c0c7a[_0xa9c5('0x40')]=_0x3c0c7a[_0xa9c5('0x40')][_0xa9c5('0x42')]?_0x3c0c7a[_0xa9c5('0x40')]:_0x135791[_0xa9c5('0x3a')];_0x3c0c7a[_0xa9c5('0x45')]=qs[_0xa9c5('0x46')](_0xd0371c[_0xa9c5('0x3c')]['sort']);_0x3c0c7a[_0xa9c5('0x47')]=qs[_0xa9c5('0x3e')](_['pick'](_0xd0371c[_0xa9c5('0x3c')],_0x135791[_0xa9c5('0x3e')]));if(_0xd0371c[_0xa9c5('0x3c')]['filter']){_0x3c0c7a[_0xa9c5('0x47')]=_[_0xa9c5('0x4a')](_0x3c0c7a[_0xa9c5('0x47')],{'$or':_[_0xa9c5('0x3b')](_0x3c0c7a['attributes'],function(_0x2bcccf){var _0x24204f={};_0x24204f[_0x2bcccf]={'$like':'%'+_0xd0371c['query']['filter']+'%'};return _0x24204f;})});}_0x3c0c7a=_['merge']({},_0x3c0c7a,_0xd0371c['options']);return _0x45b0a3['getDescriptions'](_0x3c0c7a);}})['then'](function(_0x5277ee){if(_0x5277ee){_0x4e2fb1=_0x5277ee['length'];if(!_0xd0371c[_0xa9c5('0x3c')][_0xa9c5('0x58')](_0xa9c5('0x43'))){_0x3c0c7a[_0xa9c5('0x44')]=qs[_0xa9c5('0x44')](_0xd0371c['query']['limit']);_0x3c0c7a['offset']=qs['offset'](_0xd0371c[_0xa9c5('0x3c')][_0xa9c5('0x2c')]);}return _0x45b0a3[_0xa9c5('0x59')](_0x3c0c7a);}})[_0xa9c5('0x1e')](function(_0x5253e8){if(_0x5253e8){return _0x5253e8?{'count':_0x4e2fb1,'rows':_0x5253e8}:null;}})['then'](respondWithResult(_0x393b00,null))[_0xa9c5('0x50')](handleError(_0x393b00,null));};exports[_0xa9c5('0x5a')]=function(_0x144e97,_0x2b118d,_0x1d89ec){var _0x5673f1={};var _0x2b69b9={};var _0x43ae9;var _0xd063cf;return db['FreshsalesConfiguration'][_0xa9c5('0x56')]({'where':{'id':_0x144e97[_0xa9c5('0x52')]['id']}})[_0xa9c5('0x1e')](handleEntityNotFound(_0x2b118d,null))[_0xa9c5('0x1e')](function(_0x5b39ea){if(_0x5b39ea){_0x43ae9=_0x5b39ea;_0x2b69b9[_0xa9c5('0x3a')]=_[_0xa9c5('0x3d')](db['FreshsalesField']['rawAttributes']);_0x2b69b9[_0xa9c5('0x3c')]=_['keys'](_0x144e97['query']);_0x2b69b9[_0xa9c5('0x3e')]=_[_0xa9c5('0x3f')](_0x2b69b9[_0xa9c5('0x3a')],_0x2b69b9[_0xa9c5('0x3c')]);_0x5673f1[_0xa9c5('0x40')]=_['intersection'](_0x2b69b9[_0xa9c5('0x3a')],qs['fields'](_0x144e97[_0xa9c5('0x3c')][_0xa9c5('0x41')]));_0x5673f1[_0xa9c5('0x40')]=_0x5673f1[_0xa9c5('0x40')]['length']?_0x5673f1['attributes']:_0x2b69b9[_0xa9c5('0x3a')];_0x5673f1['order']=qs['sort'](_0x144e97[_0xa9c5('0x3c')][_0xa9c5('0x46')]);_0x5673f1['where']=qs['filters'](_[_0xa9c5('0x48')](_0x144e97[_0xa9c5('0x3c')],_0x2b69b9[_0xa9c5('0x3e')]));if(_0x144e97[_0xa9c5('0x3c')]['filter']){_0x5673f1['where']=_[_0xa9c5('0x4a')](_0x5673f1[_0xa9c5('0x47')],{'$or':_[_0xa9c5('0x3b')](_0x5673f1[_0xa9c5('0x40')],function(_0x2f80d9){var _0x22cfd5={};_0x22cfd5[_0x2f80d9]={'$like':'%'+_0x144e97[_0xa9c5('0x3c')]['filter']+'%'};return _0x22cfd5;})});}_0x5673f1=_[_0xa9c5('0x4a')]({},_0x5673f1,_0x144e97[_0xa9c5('0x53')]);return _0x43ae9['getFields'](_0x5673f1);}})[_0xa9c5('0x1e')](function(_0x2488aa){if(_0x2488aa){_0xd063cf=_0x2488aa['length'];if(!_0x144e97[_0xa9c5('0x3c')][_0xa9c5('0x58')](_0xa9c5('0x43'))){_0x5673f1[_0xa9c5('0x44')]=qs[_0xa9c5('0x44')](_0x144e97[_0xa9c5('0x3c')][_0xa9c5('0x44')]);_0x5673f1[_0xa9c5('0x2c')]=qs[_0xa9c5('0x2c')](_0x144e97[_0xa9c5('0x3c')][_0xa9c5('0x2c')]);}return _0x43ae9[_0xa9c5('0x5a')](_0x5673f1);}})[_0xa9c5('0x1e')](function(_0x18db93){if(_0x18db93){return _0x18db93?{'count':_0xd063cf,'rows':_0x18db93}:null;}})[_0xa9c5('0x1e')](respondWithResult(_0x2b118d,null))[_0xa9c5('0x50')](handleError(_0x2b118d,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 58f7bdd..efffca9 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 _0xc524=['bluebird','request-promise','path','rimraf','exports','define','../../config/logger','api','moment'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0xc524,0x1bf));var _0x4c52=function(_0x29142e,_0xfc5058){_0x29142e=_0x29142e-0x0;var _0x5dc96c=_0xc524[_0x29142e];return _0x5dc96c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4c52('0x0'))(_0x4c52('0x1'));var moment=require(_0x4c52('0x2'));var BPromise=require(_0x4c52('0x3'));var rp=require(_0x4c52('0x4'));var fs=require('fs');var path=require(_0x4c52('0x5'));var rimraf=require(_0x4c52('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x4c52('0x7')]=function(_0xdaf126,_0x72d0ec){return _0xdaf126[_0x4c52('0x8')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x639a=['rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5297ad,_0x3a4bee){var _0x453b80=function(_0x960312){while(--_0x960312){_0x5297ad['push'](_0x5297ad['shift']());}};_0x453b80(++_0x3a4bee);}(_0x639a,0xec));var _0xa639=function(_0x1d62c8,_0x2ad15a){_0x1d62c8=_0x1d62c8-0x0;var _0x3cbc92=_0x639a[_0x1d62c8];return _0x3cbc92;};'use strict';var _=require('lodash');var util=require(_0xa639('0x0'));var logger=require(_0xa639('0x1'))(_0xa639('0x2'));var moment=require(_0xa639('0x3'));var BPromise=require(_0xa639('0x4'));var rp=require(_0xa639('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa639('0x6'));var config=require(_0xa639('0x7'));var attributes=require(_0xa639('0x8'));module['exports']=function(_0xa1931a,_0x21aca9){return _0xa1931a[_0xa639('0x9')](_0xa639('0xa'),attributes,{'tableName':'int_freshsales_configurations','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 26ed561..7961602 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 _0x5ec6=['FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','debug'];(function(_0x496fd4,_0x1419d8){var _0x868626=function(_0x18aed3){while(--_0x18aed3){_0x496fd4['push'](_0x496fd4['shift']());}};_0x868626(++_0x1419d8);}(_0x5ec6,0x7f));var _0x65ec=function(_0xaf73c9,_0x4b3d64){_0xaf73c9=_0xaf73c9-0x0;var _0x5e5fe4=_0x5ec6[_0xaf73c9];return _0x5e5fe4;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var moment=require(_0x65ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x65ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65ec('0x5'))('rpc');var config=require(_0x65ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x65ec('0x7')][_0x65ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d6254,_0xb3600b,_0x266254){return new BPromise(function(_0x4f8653,_0x28aa8f){return client[_0x65ec('0x9')](_0x5d6254,_0x266254)[_0x65ec('0xa')](function(_0x50e5c4){logger['info'](_0x65ec('0xb'),_0xb3600b,'request\x20sent');logger[_0x65ec('0xc')](_0x65ec('0xd'),_0xb3600b,'request\x20sent',JSON[_0x65ec('0xe')](_0x50e5c4));if(_0x50e5c4[_0x65ec('0xf')]){if(_0x50e5c4['error'][_0x65ec('0x10')]===0x1f4){logger[_0x65ec('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x28aa8f(_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);}logger[_0x65ec('0xf')](_0x65ec('0xb'),_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x4f8653(_0x50e5c4['error'][_0x65ec('0x11')]);}else{logger[_0x65ec('0x12')](_0x65ec('0xb'),_0xb3600b,'request\x20sent');_0x4f8653(_0x50e5c4['result'][_0x65ec('0x11')]);}})[_0x65ec('0x13')](function(_0xa597d4){logger['error'](_0x65ec('0xb'),_0xb3600b,_0xa597d4);_0x28aa8f(_0xa597d4);});});} \ No newline at end of file +var _0xf323=['client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x40dd8b,_0x5663aa){var _0x13ac0b=function(_0x59c65c){while(--_0x59c65c){_0x40dd8b['push'](_0x40dd8b['shift']());}};_0x13ac0b(++_0x5663aa);}(_0xf323,0x1c6));var _0x3f32=function(_0x46f465,_0x41516b){_0x46f465=_0x46f465-0x0;var _0x2a7538=_0xf323[_0x46f465];return _0x2a7538;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3f32('0x0'));var BPromise=require(_0x3f32('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f32('0x2'));var db=require(_0x3f32('0x3'))['db'];var utils=require(_0x3f32('0x4'));var logger=require(_0x3f32('0x5'))(_0x3f32('0x6'));var config=require('../../config/environment');var jayson=require(_0x3f32('0x7'));var client=jayson[_0x3f32('0x8')][_0x3f32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1134e9,_0x5c9dc2,_0x567ab1){return new BPromise(function(_0x34b93e,_0x109af2){return client[_0x3f32('0xa')](_0x1134e9,_0x567ab1)[_0x3f32('0xb')](function(_0x22a9d3){logger[_0x3f32('0xc')](_0x3f32('0xd'),_0x5c9dc2,_0x3f32('0xe'));logger['debug'](_0x3f32('0xf'),_0x5c9dc2,_0x3f32('0xe'),JSON[_0x3f32('0x10')](_0x22a9d3));if(_0x22a9d3['error']){if(_0x22a9d3[_0x3f32('0x11')][_0x3f32('0x12')]===0x1f4){logger[_0x3f32('0x11')](_0x3f32('0xd'),_0x5c9dc2,_0x22a9d3['error']['message']);return _0x109af2(_0x22a9d3[_0x3f32('0x11')][_0x3f32('0x13')]);}logger['error'](_0x3f32('0xd'),_0x5c9dc2,_0x22a9d3[_0x3f32('0x11')][_0x3f32('0x13')]);return _0x34b93e(_0x22a9d3['error']['message']);}else{logger[_0x3f32('0xc')](_0x3f32('0xd'),_0x5c9dc2,_0x3f32('0xe'));_0x34b93e(_0x22a9d3[_0x3f32('0x14')]['message']);}})['catch'](function(_0x352010){logger[_0x3f32('0x11')](_0x3f32('0xd'),_0x5c9dc2,_0x352010);_0x109af2(_0x352010);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index a180f02..ddaa8d8 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 _0x2482=['get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./intFreshsalesField.controller','index'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2482,0x1de));var _0x2248=function(_0x6b942a,_0x311643){_0x6b942a=_0x6b942a-0x0;var _0x22129d=_0x2482[_0x6b942a];return _0x22129d;};'use strict';var multer=require('multer');var util=require(_0x2248('0x0'));var path=require(_0x2248('0x1'));var timeout=require(_0x2248('0x2'));var express=require(_0x2248('0x3'));var router=express[_0x2248('0x4')]();var auth=require(_0x2248('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2248('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x2248('0x7')]);router[_0x2248('0x8')](_0x2248('0x9'),auth[_0x2248('0xa')](),controller[_0x2248('0xb')]);router[_0x2248('0xc')]('/',auth['isAuthenticated'](),controller[_0x2248('0xd')]);router[_0x2248('0xe')](_0x2248('0x9'),auth[_0x2248('0xa')](),controller['update']);router[_0x2248('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2248('0x10')]);module[_0x2248('0x11')]=router; \ No newline at end of file +var _0x37b2=['./intFreshsalesField.controller','get','index','/:id','isAuthenticated','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x4bc4f3,_0x5704d9){var _0xcdd806=function(_0x1ab7f5){while(--_0x1ab7f5){_0x4bc4f3['push'](_0x4bc4f3['shift']());}};_0xcdd806(++_0x5704d9);}(_0x37b2,0x106));var _0x237b=function(_0x5afbb8,_0x2246e2){_0x5afbb8=_0x5afbb8-0x0;var _0x2c53cf=_0x37b2[_0x5afbb8];return _0x2c53cf;};'use strict';var multer=require(_0x237b('0x0'));var util=require(_0x237b('0x1'));var path=require(_0x237b('0x2'));var timeout=require(_0x237b('0x3'));var express=require(_0x237b('0x4'));var router=express[_0x237b('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x237b('0x6'));var config=require(_0x237b('0x7'));var controller=require(_0x237b('0x8'));router[_0x237b('0x9')]('/',auth['isAuthenticated'](),controller[_0x237b('0xa')]);router['get'](_0x237b('0xb'),auth[_0x237b('0xc')](),controller[_0x237b('0xd')]);router[_0x237b('0xe')]('/',auth[_0x237b('0xc')](),controller[_0x237b('0xf')]);router['put'](_0x237b('0xb'),auth[_0x237b('0xc')](),controller['update']);router[_0x237b('0x10')](_0x237b('0xb'),auth[_0x237b('0xc')](),controller[_0x237b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 7a2a395..7260113 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 _0x021a=['string','STRING','customVariable','sequelize','exports','ENUM','variable'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0x021a,0xff));var _0xa021=function(_0x48bab2,_0x4f3b53){_0x48bab2=_0x48bab2-0x0;var _0xf41d3c=_0x021a[_0x48bab2];return _0xf41d3c;};'use strict';var Sequelize=require(_0xa021('0x0'));module[_0xa021('0x1')]={'type':{'type':Sequelize[_0xa021('0x2')]('string',_0xa021('0x3'),'customVariable','keyValue'),'defaultValue':_0xa021('0x4')},'content':{'type':Sequelize[_0xa021('0x5')]},'key':{'type':Sequelize[_0xa021('0x5')]},'keyType':{'type':Sequelize[_0xa021('0x2')](_0xa021('0x4'),_0xa021('0x3'),_0xa021('0x6'))},'keyContent':{'type':Sequelize[_0xa021('0x5')]},'idField':{'type':Sequelize[_0xa021('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa021('0x5')]}}; \ No newline at end of file +var _0xd38d=['sequelize','string','variable','customVariable','keyValue','STRING','ENUM','BOOLEAN'];(function(_0x21cb7f,_0x48cd16){var _0x5a079a=function(_0x569a4f){while(--_0x569a4f){_0x21cb7f['push'](_0x21cb7f['shift']());}};_0x5a079a(++_0x48cd16);}(_0xd38d,0x150));var _0xdd38=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0xd38d[_0x4f5108];return _0x2d56ca;};'use strict';var Sequelize=require(_0xdd38('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xdd38('0x1'),_0xdd38('0x2'),_0xdd38('0x3'),_0xdd38('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xdd38('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xdd38('0x6')](_0xdd38('0x1'),_0xdd38('0x2'),_0xdd38('0x3'))},'keyContent':{'type':Sequelize[_0xdd38('0x5')]},'idField':{'type':Sequelize[_0xdd38('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xdd38('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdd38('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 7699a26..1cfb0bf 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 _0xbc9d=['map','FreshsalesField','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','params','rawAttributes','includeAll','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','name','send','index'];(function(_0x37ad3f,_0x4d4aba){var _0x45db28=function(_0x102c26){while(--_0x102c26){_0x37ad3f['push'](_0x37ad3f['shift']());}};_0x45db28(++_0x4d4aba);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x15ada4,_0x46091c){_0x15ada4=_0x15ada4-0x0;var _0x1acefe=_0xbc9d[_0x15ada4];return _0x1acefe;};'use strict';var pdf=require(_0xdbc9('0x0'));var emlformat=require(_0xdbc9('0x1'));var rimraf=require(_0xdbc9('0x2'));var zipdir=require(_0xdbc9('0x3'));var jsonpatch=require(_0xdbc9('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdbc9('0x5'));var util=require(_0xdbc9('0x6'));var path=require(_0xdbc9('0x7'));var sox=require(_0xdbc9('0x8'));var csv=require(_0xdbc9('0x9'));var ejs=require(_0xdbc9('0xa'));var fs=require('fs');var _=require(_0xdbc9('0xb'));var squel=require('squel');var crypto=require(_0xdbc9('0xc'));var jsforce=require(_0xdbc9('0xd'));var deskjs=require(_0xdbc9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbc9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbc9('0x10'));var qs=require(_0xdbc9('0x11'));var as=require(_0xdbc9('0x12'));var hardwareService=require(_0xdbc9('0x13'));var logger=require('../../config/logger')(_0xdbc9('0x14'));var utils=require(_0xdbc9('0x15'));var config=require(_0xdbc9('0x16'));var db=require(_0xdbc9('0x17'))['db'];function respondWithStatusCode(_0x34a15d,_0x103d54){_0x103d54=_0x103d54||0xcc;return function(_0x48bc83){if(_0x48bc83){return _0x34a15d['sendStatus'](_0x103d54);}return _0x34a15d[_0xdbc9('0x18')](_0x103d54)[_0xdbc9('0x19')]();};}function respondWithResult(_0x3df2dd,_0x436e50){_0x436e50=_0x436e50||0xc8;return function(_0x53495d){if(_0x53495d){return _0x3df2dd['status'](_0x436e50)[_0xdbc9('0x1a')](_0x53495d);}};}function respondWithFilteredResult(_0x1e41cf,_0x3a8a7b){return function(_0x4c7b4f){if(_0x4c7b4f){var _0x1b4616=_0x4c7b4f[_0xdbc9('0x1b')],_0x1abee8=_0x3a8a7b[_0xdbc9('0x1c')],_0x4fdb81=_0x3a8a7b[_0xdbc9('0x1c')]+_0x3a8a7b[_0xdbc9('0x1d')],_0x38bf4b;if(_0x4fdb81>=_0x1b4616){_0x4fdb81=_0x1b4616;_0x38bf4b=0xc8;}else{_0x38bf4b=0xce;}_0x1e41cf[_0xdbc9('0x18')](_0x38bf4b);return _0x1e41cf[_0xdbc9('0x1e')](_0xdbc9('0x1f'),_0x1abee8+'-'+_0x4fdb81+'/'+_0x1b4616)[_0xdbc9('0x1a')](_0x4c7b4f);}return null;};}function patchUpdates(_0x981fc0){return function(_0x57a546){try{jsonpatch[_0xdbc9('0x20')](_0x57a546,_0x981fc0,!![]);}catch(_0x497be2){return BPromise[_0xdbc9('0x21')](_0x497be2);}return _0x57a546[_0xdbc9('0x22')]();};}function saveUpdates(_0x510710,_0x4408e9){return function(_0x5367dc){if(_0x5367dc){return _0x5367dc['update'](_0x510710)['then'](function(_0x4f3b5d){return _0x4f3b5d;});}return null;};}function removeEntity(_0x2f229c,_0x2011a2){return function(_0x570ad9){if(_0x570ad9){return _0x570ad9[_0xdbc9('0x23')]()[_0xdbc9('0x24')](function(){_0x2f229c['status'](0xcc)[_0xdbc9('0x19')]();});}};}function handleEntityNotFound(_0x6b788,_0x1b1c0d){return function(_0x119230){if(!_0x119230){_0x6b788[_0xdbc9('0x25')](0x194);}return _0x119230;};}function handleError(_0x28331f,_0x32822f){_0x32822f=_0x32822f||0x1f4;return function(_0x2d8c41){logger[_0xdbc9('0x26')](_0x2d8c41['stack']);if(_0x2d8c41[_0xdbc9('0x27')]){delete _0x2d8c41[_0xdbc9('0x27')];}_0x28331f[_0xdbc9('0x18')](_0x32822f)[_0xdbc9('0x28')](_0x2d8c41);};}exports[_0xdbc9('0x29')]=function(_0x50c3ee,_0xf121e9){var _0x2ee00a={},_0x5300bd={},_0x5f40ab={'count':0x0,'rows':[]};var _0x45aebe=_[_0xdbc9('0x2a')](db[_0xdbc9('0x2b')]['rawAttributes'],function(_0x13a432){return{'name':_0x13a432['fieldName'],'type':_0x13a432['type'][_0xdbc9('0x2c')]};});_0x5300bd['model']=_['map'](_0x45aebe,_0xdbc9('0x27'));_0x5300bd[_0xdbc9('0x2d')]=_[_0xdbc9('0x2e')](_0x50c3ee['query']);_0x5300bd[_0xdbc9('0x2f')]=_[_0xdbc9('0x30')](_0x5300bd['model'],_0x5300bd['query']);_0x2ee00a[_0xdbc9('0x31')]=_[_0xdbc9('0x30')](_0x5300bd[_0xdbc9('0x32')],qs[_0xdbc9('0x33')](_0x50c3ee[_0xdbc9('0x2d')][_0xdbc9('0x33')]));_0x2ee00a[_0xdbc9('0x31')]=_0x2ee00a['attributes'][_0xdbc9('0x34')]?_0x2ee00a[_0xdbc9('0x31')]:_0x5300bd[_0xdbc9('0x32')];if(!_0x50c3ee[_0xdbc9('0x2d')][_0xdbc9('0x35')](_0xdbc9('0x36'))){_0x2ee00a['limit']=qs[_0xdbc9('0x1d')](_0x50c3ee['query']['limit']);_0x2ee00a['offset']=qs['offset'](_0x50c3ee['query'][_0xdbc9('0x1c')]);}_0x2ee00a[_0xdbc9('0x37')]=qs[_0xdbc9('0x38')](_0x50c3ee['query'][_0xdbc9('0x38')]);_0x2ee00a[_0xdbc9('0x39')]=qs[_0xdbc9('0x2f')](_[_0xdbc9('0x3a')](_0x50c3ee[_0xdbc9('0x2d')],_0x5300bd[_0xdbc9('0x2f')]));if(_0x50c3ee['query'][_0xdbc9('0x3b')]){_0x2ee00a[_0xdbc9('0x39')]=_[_0xdbc9('0x3c')](_0x2ee00a['where'],{'$or':_[_0xdbc9('0x2a')](_0x45aebe,function(_0x3ce16e){if(_0x3ce16e[_0xdbc9('0x3d')]!==_0xdbc9('0x3e')){var _0x5a063a={};_0x5a063a[_0x3ce16e['name']]={'$like':'%'+_0x50c3ee[_0xdbc9('0x2d')][_0xdbc9('0x3b')]+'%'};return _0x5a063a;}})});}_0x2ee00a=_[_0xdbc9('0x3c')]({},_0x2ee00a,_0x50c3ee[_0xdbc9('0x3f')]);var _0x5812f2={'where':_0x2ee00a[_0xdbc9('0x39')]};return db[_0xdbc9('0x2b')][_0xdbc9('0x1b')](_0x5812f2)['then'](function(_0xe6884e){_0x5f40ab[_0xdbc9('0x1b')]=_0xe6884e;if(_0x50c3ee[_0xdbc9('0x2d')]['includeAll']){_0x2ee00a[_0xdbc9('0x40')]=[{'all':!![]}];}return db[_0xdbc9('0x2b')]['findAll'](_0x2ee00a);})['then'](function(_0xfc34d5){_0x5f40ab[_0xdbc9('0x41')]=_0xfc34d5;return _0x5f40ab;})[_0xdbc9('0x24')](respondWithFilteredResult(_0xf121e9,_0x2ee00a))[_0xdbc9('0x42')](handleError(_0xf121e9,null));};exports['show']=function(_0xb3a9e9,_0x2427b5){var _0x577725={'raw':!![],'where':{'id':_0xb3a9e9[_0xdbc9('0x43')]['id']}},_0x8445b8={};_0x8445b8['model']=_[_0xdbc9('0x2e')](db[_0xdbc9('0x2b')][_0xdbc9('0x44')]);_0x8445b8[_0xdbc9('0x2d')]=_[_0xdbc9('0x2e')](_0xb3a9e9[_0xdbc9('0x2d')]);_0x8445b8[_0xdbc9('0x2f')]=_['intersection'](_0x8445b8['model'],_0x8445b8[_0xdbc9('0x2d')]);_0x577725[_0xdbc9('0x31')]=_[_0xdbc9('0x30')](_0x8445b8[_0xdbc9('0x32')],qs[_0xdbc9('0x33')](_0xb3a9e9[_0xdbc9('0x2d')][_0xdbc9('0x33')]));_0x577725[_0xdbc9('0x31')]=_0x577725[_0xdbc9('0x31')][_0xdbc9('0x34')]?_0x577725[_0xdbc9('0x31')]:_0x8445b8['model'];if(_0xb3a9e9['query'][_0xdbc9('0x45')]){_0x577725[_0xdbc9('0x40')]=[{'all':!![]}];}_0x577725=_[_0xdbc9('0x3c')]({},_0x577725,_0xb3a9e9[_0xdbc9('0x3f')]);return db[_0xdbc9('0x2b')][_0xdbc9('0x46')](_0x577725)[_0xdbc9('0x24')](handleEntityNotFound(_0x2427b5,null))[_0xdbc9('0x24')](respondWithResult(_0x2427b5,null))['catch'](handleError(_0x2427b5,null));};exports['create']=function(_0xf24b3f,_0x1e69b9){return db[_0xdbc9('0x2b')][_0xdbc9('0x47')](_0xf24b3f[_0xdbc9('0x48')],{})[_0xdbc9('0x24')](respondWithResult(_0x1e69b9,0xc9))[_0xdbc9('0x42')](handleError(_0x1e69b9,null));};exports[_0xdbc9('0x49')]=function(_0x43e3ec,_0x589557){if(_0x43e3ec[_0xdbc9('0x48')]['id']){delete _0x43e3ec[_0xdbc9('0x48')]['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x43e3ec[_0xdbc9('0x43')]['id']}})[_0xdbc9('0x24')](handleEntityNotFound(_0x589557,null))[_0xdbc9('0x24')](saveUpdates(_0x43e3ec['body'],null))[_0xdbc9('0x24')](respondWithResult(_0x589557,null))[_0xdbc9('0x42')](handleError(_0x589557,null));};exports[_0xdbc9('0x23')]=function(_0x274607,_0x5aee83){return db[_0xdbc9('0x2b')][_0xdbc9('0x46')]({'where':{'id':_0x274607[_0xdbc9('0x43')]['id']}})[_0xdbc9('0x24')](handleEntityNotFound(_0x5aee83,null))['then'](removeEntity(_0x5aee83,null))[_0xdbc9('0x42')](handleError(_0x5aee83,null));}; \ No newline at end of file +var _0x263f=['FreshsalesField','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','rows','params','length','include','create','body','update','find','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','offset','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index'];(function(_0x3f9584,_0x5ab12c){var _0x9d54c=function(_0x2882df){while(--_0x2882df){_0x3f9584['push'](_0x3f9584['shift']());}};_0x9d54c(++_0x5ab12c);}(_0x263f,0x182));var _0xf263=function(_0x222d60,_0x3e1ffb){_0x222d60=_0x222d60-0x0;var _0x3d44ea=_0x263f[_0x222d60];return _0x3d44ea;};'use strict';var pdf=require(_0xf263('0x0'));var emlformat=require(_0xf263('0x1'));var rimraf=require(_0xf263('0x2'));var zipdir=require(_0xf263('0x3'));var jsonpatch=require(_0xf263('0x4'));var rp=require(_0xf263('0x5'));var moment=require('moment');var BPromise=require(_0xf263('0x6'));var Mustache=require(_0xf263('0x7'));var util=require(_0xf263('0x8'));var path=require('path');var sox=require(_0xf263('0x9'));var csv=require(_0xf263('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf263('0xb'));var crypto=require(_0xf263('0xc'));var jsforce=require(_0xf263('0xd'));var deskjs=require(_0xf263('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf263('0xf'));var Papa=require(_0xf263('0x10'));var Redis=require(_0xf263('0x11'));var authService=require(_0xf263('0x12'));var qs=require(_0xf263('0x13'));var as=require(_0xf263('0x14'));var hardwareService=require(_0xf263('0x15'));var logger=require('../../config/logger')(_0xf263('0x16'));var utils=require('../../config/utils');var config=require(_0xf263('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e46a6,_0x2fc9f0){_0x2fc9f0=_0x2fc9f0||0xcc;return function(_0x2b1145){if(_0x2b1145){return _0x5e46a6[_0xf263('0x18')](_0x2fc9f0);}return _0x5e46a6[_0xf263('0x19')](_0x2fc9f0)[_0xf263('0x1a')]();};}function respondWithResult(_0xc6a733,_0xc75366){_0xc75366=_0xc75366||0xc8;return function(_0x559c6c){if(_0x559c6c){return _0xc6a733[_0xf263('0x19')](_0xc75366)['json'](_0x559c6c);}};}function respondWithFilteredResult(_0x2a79aa,_0x27b16a){return function(_0x3ac432){if(_0x3ac432){var _0x402739=_0x3ac432['count'],_0x16b4dd=_0x27b16a['offset'],_0xf45ebe=_0x27b16a[_0xf263('0x1b')]+_0x27b16a[_0xf263('0x1c')],_0x506789;if(_0xf45ebe>=_0x402739){_0xf45ebe=_0x402739;_0x506789=0xc8;}else{_0x506789=0xce;}_0x2a79aa[_0xf263('0x19')](_0x506789);return _0x2a79aa[_0xf263('0x1d')](_0xf263('0x1e'),_0x16b4dd+'-'+_0xf45ebe+'/'+_0x402739)['json'](_0x3ac432);}return null;};}function patchUpdates(_0x1adb66){return function(_0x523061){try{jsonpatch[_0xf263('0x1f')](_0x523061,_0x1adb66,!![]);}catch(_0x22e399){return BPromise[_0xf263('0x20')](_0x22e399);}return _0x523061['save']();};}function saveUpdates(_0x4c44ea,_0x169328){return function(_0x127135){if(_0x127135){return _0x127135['update'](_0x4c44ea)[_0xf263('0x21')](function(_0x4202d1){return _0x4202d1;});}return null;};}function removeEntity(_0x431c10,_0x426667){return function(_0xa0695){if(_0xa0695){return _0xa0695[_0xf263('0x22')]()[_0xf263('0x21')](function(){_0x431c10[_0xf263('0x19')](0xcc)[_0xf263('0x1a')]();});}};}function handleEntityNotFound(_0xe32b07,_0x29eb45){return function(_0x4de045){if(!_0x4de045){_0xe32b07['sendStatus'](0x194);}return _0x4de045;};}function handleError(_0x5dc48f,_0x2de7aa){_0x2de7aa=_0x2de7aa||0x1f4;return function(_0x4175a6){logger[_0xf263('0x23')](_0x4175a6[_0xf263('0x24')]);if(_0x4175a6[_0xf263('0x25')]){delete _0x4175a6[_0xf263('0x25')];}_0x5dc48f[_0xf263('0x19')](_0x2de7aa)[_0xf263('0x26')](_0x4175a6);};}exports[_0xf263('0x27')]=function(_0xbeabe5,_0x2411a2){var _0x5e9ba3={},_0x2046d9={},_0x4ea2c4={'count':0x0,'rows':[]};var _0x3f74ed=_['map'](db[_0xf263('0x28')][_0xf263('0x29')],function(_0x5a11bf){return{'name':_0x5a11bf['fieldName'],'type':_0x5a11bf[_0xf263('0x2a')][_0xf263('0x2b')]};});_0x2046d9[_0xf263('0x2c')]=_[_0xf263('0x2d')](_0x3f74ed,_0xf263('0x25'));_0x2046d9[_0xf263('0x2e')]=_[_0xf263('0x2f')](_0xbeabe5[_0xf263('0x2e')]);_0x2046d9['filters']=_[_0xf263('0x30')](_0x2046d9[_0xf263('0x2c')],_0x2046d9[_0xf263('0x2e')]);_0x5e9ba3[_0xf263('0x31')]=_[_0xf263('0x30')](_0x2046d9[_0xf263('0x2c')],qs[_0xf263('0x32')](_0xbeabe5[_0xf263('0x2e')][_0xf263('0x32')]));_0x5e9ba3['attributes']=_0x5e9ba3[_0xf263('0x31')]['length']?_0x5e9ba3['attributes']:_0x2046d9[_0xf263('0x2c')];if(!_0xbeabe5[_0xf263('0x2e')]['hasOwnProperty'](_0xf263('0x33'))){_0x5e9ba3[_0xf263('0x1c')]=qs['limit'](_0xbeabe5[_0xf263('0x2e')][_0xf263('0x1c')]);_0x5e9ba3[_0xf263('0x1b')]=qs[_0xf263('0x1b')](_0xbeabe5[_0xf263('0x2e')][_0xf263('0x1b')]);}_0x5e9ba3['order']=qs[_0xf263('0x34')](_0xbeabe5[_0xf263('0x2e')]['sort']);_0x5e9ba3['where']=qs[_0xf263('0x35')](_[_0xf263('0x36')](_0xbeabe5[_0xf263('0x2e')],_0x2046d9[_0xf263('0x35')]));if(_0xbeabe5['query'][_0xf263('0x37')]){_0x5e9ba3[_0xf263('0x38')]=_[_0xf263('0x39')](_0x5e9ba3[_0xf263('0x38')],{'$or':_[_0xf263('0x2d')](_0x3f74ed,function(_0x49c9a1){if(_0x49c9a1[_0xf263('0x2a')]!==_0xf263('0x3a')){var _0x1600f8={};_0x1600f8[_0x49c9a1['name']]={'$like':'%'+_0xbeabe5[_0xf263('0x2e')][_0xf263('0x37')]+'%'};return _0x1600f8;}})});}_0x5e9ba3=_[_0xf263('0x39')]({},_0x5e9ba3,_0xbeabe5[_0xf263('0x3b')]);var _0x3bbe13={'where':_0x5e9ba3['where']};return db[_0xf263('0x28')][_0xf263('0x3c')](_0x3bbe13)[_0xf263('0x21')](function(_0x53f785){_0x4ea2c4[_0xf263('0x3c')]=_0x53f785;if(_0xbeabe5[_0xf263('0x2e')][_0xf263('0x3d')]){_0x5e9ba3['include']=[{'all':!![]}];}return db[_0xf263('0x28')]['findAll'](_0x5e9ba3);})[_0xf263('0x21')](function(_0x2861ba){_0x4ea2c4[_0xf263('0x3e')]=_0x2861ba;return _0x4ea2c4;})['then'](respondWithFilteredResult(_0x2411a2,_0x5e9ba3))['catch'](handleError(_0x2411a2,null));};exports['show']=function(_0x223c4e,_0x594bf3){var _0x56303f={'raw':!![],'where':{'id':_0x223c4e[_0xf263('0x3f')]['id']}},_0x5e33ba={};_0x5e33ba[_0xf263('0x2c')]=_[_0xf263('0x2f')](db[_0xf263('0x28')][_0xf263('0x29')]);_0x5e33ba['query']=_[_0xf263('0x2f')](_0x223c4e[_0xf263('0x2e')]);_0x5e33ba[_0xf263('0x35')]=_[_0xf263('0x30')](_0x5e33ba[_0xf263('0x2c')],_0x5e33ba['query']);_0x56303f[_0xf263('0x31')]=_[_0xf263('0x30')](_0x5e33ba[_0xf263('0x2c')],qs['fields'](_0x223c4e['query'][_0xf263('0x32')]));_0x56303f['attributes']=_0x56303f['attributes'][_0xf263('0x40')]?_0x56303f[_0xf263('0x31')]:_0x5e33ba[_0xf263('0x2c')];if(_0x223c4e['query'][_0xf263('0x3d')]){_0x56303f[_0xf263('0x41')]=[{'all':!![]}];}_0x56303f=_['merge']({},_0x56303f,_0x223c4e[_0xf263('0x3b')]);return db[_0xf263('0x28')]['find'](_0x56303f)[_0xf263('0x21')](handleEntityNotFound(_0x594bf3,null))[_0xf263('0x21')](respondWithResult(_0x594bf3,null))['catch'](handleError(_0x594bf3,null));};exports[_0xf263('0x42')]=function(_0xac51d,_0x2d7a2b){return db[_0xf263('0x28')][_0xf263('0x42')](_0xac51d[_0xf263('0x43')],{})[_0xf263('0x21')](respondWithResult(_0x2d7a2b,0xc9))['catch'](handleError(_0x2d7a2b,null));};exports[_0xf263('0x44')]=function(_0x2e8cbe,_0x19e09c){if(_0x2e8cbe[_0xf263('0x43')]['id']){delete _0x2e8cbe[_0xf263('0x43')]['id'];}return db[_0xf263('0x28')][_0xf263('0x45')]({'where':{'id':_0x2e8cbe[_0xf263('0x3f')]['id']}})['then'](handleEntityNotFound(_0x19e09c,null))[_0xf263('0x21')](saveUpdates(_0x2e8cbe[_0xf263('0x43')],null))[_0xf263('0x21')](respondWithResult(_0x19e09c,null))[_0xf263('0x46')](handleError(_0x19e09c,null));};exports['destroy']=function(_0x13e2c7,_0x4a3f83){return db[_0xf263('0x28')][_0xf263('0x45')]({'where':{'id':_0x13e2c7[_0xf263('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4a3f83,null))['then'](removeEntity(_0x4a3f83,null))['catch'](handleError(_0x4a3f83,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 4f3cd44..776e554 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 _0x8612=['exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','util','../../config/logger','api','moment','rimraf','../../config/environment','./intFreshsalesField.attributes'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0x8612,0xe7));var _0x2861=function(_0x3df3fb,_0x5279ba){_0x3df3fb=_0x3df3fb-0x0;var _0x40e0cc=_0x8612[_0x3df3fb];return _0x40e0cc;};'use strict';var _=require('lodash');var util=require(_0x2861('0x0'));var logger=require(_0x2861('0x1'))(_0x2861('0x2'));var moment=require(_0x2861('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2861('0x4'));var config=require(_0x2861('0x5'));var attributes=require(_0x2861('0x6'));module[_0x2861('0x7')]=function(_0x3e7246,_0x5f363a){return _0x3e7246[_0x2861('0x8')](_0x2861('0x9'),attributes,{'tableName':_0x2861('0xa'),'paranoid':![],'indexes':[{'name':_0x2861('0xb'),'fields':[_0x2861('0xc'),_0x2861('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xccde=['lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId'];(function(_0x5adbb4,_0x5092e0){var _0x48e176=function(_0x2af1c8){while(--_0x2af1c8){_0x5adbb4['push'](_0x5adbb4['shift']());}};_0x48e176(++_0x5092e0);}(_0xccde,0x1e1));var _0xeccd=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0xccde[_0x2ef44b];return _0x2405b9;};'use strict';var _=require(_0xeccd('0x0'));var util=require('util');var logger=require(_0xeccd('0x1'))('api');var moment=require(_0xeccd('0x2'));var BPromise=require(_0xeccd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeccd('0x4'));var config=require(_0xeccd('0x5'));var attributes=require(_0xeccd('0x6'));module[_0xeccd('0x7')]=function(_0x323c74,_0x56972a){return _0x323c74[_0xeccd('0x8')](_0xeccd('0x9'),attributes,{'tableName':_0xeccd('0xa'),'paranoid':![],'indexes':[{'name':_0xeccd('0xb'),'fields':['idField',_0xeccd('0xc')],'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 9a36a21..33d1c2b 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 _0xe228=['rpc','../../config/environment','client','http','then','info','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x45cd8b,_0xf6d77b){var _0x5b0d06=function(_0x32406a){while(--_0x32406a){_0x45cd8b['push'](_0x45cd8b['shift']());}};_0x5b0d06(++_0xf6d77b);}(_0xe228,0x1f0));var _0x8e22=function(_0x19da23,_0x56a072){_0x19da23=_0x19da23-0x0;var _0xf5e62b=_0xe228[_0x19da23];return _0xf5e62b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8e22('0x0'));var rs=require(_0x8e22('0x1'));var fs=require('fs');var Redis=require(_0x8e22('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8e22('0x3'))(_0x8e22('0x4'));var config=require(_0x8e22('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8e22('0x6')][_0x8e22('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ea51a,_0xde8a4b,_0x4410c9){return new BPromise(function(_0x1e28d3,_0x50fdc9){return client['request'](_0x1ea51a,_0x4410c9)[_0x8e22('0x8')](function(_0x100b4a){logger[_0x8e22('0x9')]('FreshsalesField,\x20%s,\x20%s',_0xde8a4b,_0x8e22('0xa'));logger[_0x8e22('0xb')](_0x8e22('0xc'),_0xde8a4b,_0x8e22('0xa'),JSON[_0x8e22('0xd')](_0x100b4a));if(_0x100b4a[_0x8e22('0xe')]){if(_0x100b4a['error'][_0x8e22('0xf')]===0x1f4){logger[_0x8e22('0xe')](_0x8e22('0x10'),_0xde8a4b,_0x100b4a[_0x8e22('0xe')][_0x8e22('0x11')]);return _0x50fdc9(_0x100b4a['error']['message']);}logger[_0x8e22('0xe')]('FreshsalesField,\x20%s,\x20%s',_0xde8a4b,_0x100b4a['error'][_0x8e22('0x11')]);return _0x1e28d3(_0x100b4a[_0x8e22('0xe')][_0x8e22('0x11')]);}else{logger[_0x8e22('0x9')](_0x8e22('0x10'),_0xde8a4b,_0x8e22('0xa'));_0x1e28d3(_0x100b4a[_0x8e22('0x12')][_0x8e22('0x11')]);}})[_0x8e22('0x13')](function(_0x12747b){logger[_0x8e22('0xe')]('FreshsalesField,\x20%s,\x20%s',_0xde8a4b,_0x12747b);_0x50fdc9(_0x12747b);});});} \ No newline at end of file +var _0x7a12=['FreshsalesField,\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','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0x7a12,0xe8));var _0x27a1=function(_0xccaeba,_0x29fb00){_0xccaeba=_0xccaeba-0x0;var _0x307313=_0x7a12[_0xccaeba];return _0x307313;};'use strict';var _=require(_0x27a1('0x0'));var util=require(_0x27a1('0x1'));var moment=require(_0x27a1('0x2'));var BPromise=require(_0x27a1('0x3'));var rs=require(_0x27a1('0x4'));var fs=require('fs');var Redis=require(_0x27a1('0x5'));var db=require(_0x27a1('0x6'))['db'];var utils=require(_0x27a1('0x7'));var logger=require('../../config/logger')(_0x27a1('0x8'));var config=require(_0x27a1('0x9'));var jayson=require(_0x27a1('0xa'));var client=jayson[_0x27a1('0xb')][_0x27a1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xed784f,_0x4a4e2c,_0x3f0bbd){return new BPromise(function(_0x34efbb,_0x5431f4){return client[_0x27a1('0xd')](_0xed784f,_0x3f0bbd)[_0x27a1('0xe')](function(_0x586984){logger[_0x27a1('0xf')](_0x27a1('0x10'),_0x4a4e2c,_0x27a1('0x11'));logger['debug'](_0x27a1('0x12'),_0x4a4e2c,_0x27a1('0x11'),JSON[_0x27a1('0x13')](_0x586984));if(_0x586984[_0x27a1('0x14')]){if(_0x586984[_0x27a1('0x14')][_0x27a1('0x15')]===0x1f4){logger[_0x27a1('0x14')]('FreshsalesField,\x20%s,\x20%s',_0x4a4e2c,_0x586984[_0x27a1('0x14')][_0x27a1('0x16')]);return _0x5431f4(_0x586984[_0x27a1('0x14')][_0x27a1('0x16')]);}logger['error'](_0x27a1('0x10'),_0x4a4e2c,_0x586984[_0x27a1('0x14')]['message']);return _0x34efbb(_0x586984['error'][_0x27a1('0x16')]);}else{logger[_0x27a1('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x4a4e2c,_0x27a1('0x11'));_0x34efbb(_0x586984[_0x27a1('0x17')]['message']);}})[_0x27a1('0x18')](function(_0x3efeff){logger[_0x27a1('0x14')](_0x27a1('0x10'),_0x4a4e2c,_0x3efeff);_0x5431f4(_0x3efeff);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 4381273..a98ec85 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 _0x1a8f=['/:id/configurations','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','isAuthenticated','index','get'];(function(_0x36d5dc,_0xfa3b73){var _0x473c9f=function(_0x1c182b){while(--_0x1c182b){_0x36d5dc['push'](_0x36d5dc['shift']());}};_0x473c9f(++_0xfa3b73);}(_0x1a8f,0x87));var _0xf1a8=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0x1a8f[_0x3a8dc1];return _0x4b3595;};'use strict';var multer=require(_0xf1a8('0x0'));var util=require('util');var path=require(_0xf1a8('0x1'));var timeout=require(_0xf1a8('0x2'));var express=require(_0xf1a8('0x3'));var router=express[_0xf1a8('0x4')]();var auth=require(_0xf1a8('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSalesforceAccount.controller');router['get']('/',auth[_0xf1a8('0x6')](),controller[_0xf1a8('0x7')]);router[_0xf1a8('0x8')]('/:id',auth[_0xf1a8('0x6')](),controller['show']);router[_0xf1a8('0x8')](_0xf1a8('0x9'),auth[_0xf1a8('0x6')](),controller['getConfigurations']);router[_0xf1a8('0x8')]('/:id/fields',auth[_0xf1a8('0x6')](),controller['getFields']);router[_0xf1a8('0xa')]('/',auth[_0xf1a8('0x6')](),controller[_0xf1a8('0xb')]);router[_0xf1a8('0xa')]('/:id/configurations',auth[_0xf1a8('0x6')](),controller['addConfiguration']);router[_0xf1a8('0xc')]('/:id',auth[_0xf1a8('0x6')](),controller[_0xf1a8('0xd')]);router[_0xf1a8('0xe')](_0xf1a8('0xf'),auth[_0xf1a8('0x6')](),controller[_0xf1a8('0x10')]);module[_0xf1a8('0x11')]=router; \ No newline at end of file +var _0x1e9d=['/:id','isAuthenticated','show','/:id/configurations','getConfigurations','get','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x4cbc1b,_0xbffc0e){var _0x4bdae9=function(_0x270c1f){while(--_0x270c1f){_0x4cbc1b['push'](_0x4cbc1b['shift']());}};_0x4bdae9(++_0xbffc0e);}(_0x1e9d,0x1dd));var _0xd1e9=function(_0x46fdda,_0x751318){_0x46fdda=_0x46fdda-0x0;var _0x580d57=_0x1e9d[_0x46fdda];return _0x580d57;};'use strict';var multer=require(_0xd1e9('0x0'));var util=require('util');var path=require(_0xd1e9('0x1'));var timeout=require(_0xd1e9('0x2'));var express=require(_0xd1e9('0x3'));var router=express[_0xd1e9('0x4')]();var auth=require(_0xd1e9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd1e9('0x6'));var controller=require('./intSalesforceAccount.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd1e9('0x7'),auth[_0xd1e9('0x8')](),controller[_0xd1e9('0x9')]);router['get'](_0xd1e9('0xa'),auth['isAuthenticated'](),controller[_0xd1e9('0xb')]);router[_0xd1e9('0xc')](_0xd1e9('0xd'),auth[_0xd1e9('0x8')](),controller[_0xd1e9('0xe')]);router[_0xd1e9('0xf')]('/',auth[_0xd1e9('0x8')](),controller[_0xd1e9('0x10')]);router[_0xd1e9('0xf')](_0xd1e9('0xa'),auth[_0xd1e9('0x8')](),controller['addConfiguration']);router[_0xd1e9('0x11')](_0xd1e9('0x7'),auth[_0xd1e9('0x8')](),controller[_0xd1e9('0x12')]);router[_0xd1e9('0x13')]('/:id',auth[_0xd1e9('0x8')](),controller[_0xd1e9('0x14')]);module[_0xd1e9('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 02eafe4..a1ef8ee 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 _0x7fbe=['integrationTab','newTab','STRING','username','ENUM'];(function(_0xa66c5,_0x114c08){var _0x208f3a=function(_0x325b49){while(--_0x325b49){_0xa66c5['push'](_0xa66c5['shift']());}};_0x208f3a(++_0x114c08);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2b9e76,_0x467e25){_0x2b9e76=_0x2b9e76-0x0;var _0x4c014e=_0x7fbe[_0x2b9e76];return _0x4c014e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'username':{'type':Sequelize[_0xe7fb('0x0')],'unique':_0xe7fb('0x1')},'remoteUri':{'type':Sequelize[_0xe7fb('0x0')]},'password':{'type':Sequelize[_0xe7fb('0x0')]},'clientId':{'type':Sequelize[_0xe7fb('0x0')]},'clientSecret':{'type':Sequelize[_0xe7fb('0x0')]},'securityToken':{'type':Sequelize[_0xe7fb('0x0')]},'serverUrl':{'type':Sequelize[_0xe7fb('0x0')]},'type':{'type':Sequelize[_0xe7fb('0x2')](_0xe7fb('0x3'),_0xe7fb('0x4')),'defaultValue':_0xe7fb('0x3')}}; \ No newline at end of file +var _0x7217=['sequelize','STRING','username','ENUM','integrationTab','newTab'];(function(_0x7b484,_0x195ad4){var _0x2ae1cf=function(_0x2e6247){while(--_0x2e6247){_0x7b484['push'](_0x7b484['shift']());}};_0x2ae1cf(++_0x195ad4);}(_0x7217,0x19e));var _0x7721=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x7217[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')]},'description':{'type':Sequelize[_0x7721('0x1')]},'username':{'type':Sequelize[_0x7721('0x1')],'unique':_0x7721('0x2')},'remoteUri':{'type':Sequelize[_0x7721('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x7721('0x1')]},'securityToken':{'type':Sequelize[_0x7721('0x1')]},'serverUrl':{'type':Sequelize[_0x7721('0x1')]},'type':{'type':Sequelize[_0x7721('0x3')](_0x7721('0x4'),_0x7721('0x5')),'defaultValue':_0x7721('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index e41e9bd..8aba34c 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 _0x53ec=['Priority','SuppliedName','SuppliedCompany','remove','custom','includes','label','picklistValues','value','True','true','False','false','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','end','status','count','offset','limit','set','json','save','update','destroy','name','send','map','SalesforceAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','order','sort','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','fields','find','create','body','getConfigurations','findOne','SalesforceConfiguration','pick','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','Descriptions','channel','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','substring','Connection','concat','isNil','ticketType','sobject','CallDisposition','CallDurationInSeconds','IsArchived','Status','Type','Origin','Reason'];(function(_0xea9d73,_0x215d2e){var _0x4d8ff5=function(_0x15e776){while(--_0x15e776){_0xea9d73['push'](_0xea9d73['shift']());}};_0x4d8ff5(++_0x215d2e);}(_0x53ec,0x192));var _0xc53e=function(_0x4cde9e,_0x57150a){_0x4cde9e=_0x4cde9e-0x0;var _0x38df0c=_0x53ec[_0x4cde9e];return _0x38df0c;};'use strict';var pdf=require(_0xc53e('0x0'));var emlformat=require(_0xc53e('0x1'));var rimraf=require(_0xc53e('0x2'));var zipdir=require(_0xc53e('0x3'));var jsonpatch=require(_0xc53e('0x4'));var rp=require(_0xc53e('0x5'));var moment=require('moment');var BPromise=require(_0xc53e('0x6'));var Mustache=require('mustache');var util=require(_0xc53e('0x7'));var path=require(_0xc53e('0x8'));var sox=require('sox');var csv=require(_0xc53e('0x9'));var ejs=require('ejs');var fs=require('fs');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('0x9'));var querystring=require(_0xc53e('0xe'));var Papa=require(_0xc53e('0xf'));var Redis=require(_0xc53e('0x10'));var authService=require(_0xc53e('0x11'));var qs=require(_0xc53e('0x12'));var as=require(_0xc53e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc53e('0x15'))['db'];var integrations=require(_0xc53e('0x16'));var jayson=require(_0xc53e('0x17'));var client=jayson[_0xc53e('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x4e74c9,_0x1c06cd,_0x19a772){if(_0x19a772){var _0x7cd798=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x7cd798[_0xc53e('0x19')](_0x1c06cd)){return _0x4e74c9;}else{throw new db[(_0xc53e('0x1a'))][(_0xc53e('0x1b'))](_0xc53e('0x1c'));}}else{return _0x4e74c9;}}function respondWithRpcPromise(_0x19c0d1,_0x455e4d,_0x2ad6eb,_0x5b0a88){return new BPromise(function(_0x8a522e,_0x191567){var _0x535cd4=_0x5b0a88||client;return _0x535cd4[_0xc53e('0x1d')](_0x19c0d1,_0x2ad6eb)[_0xc53e('0x1e')](function(_0x270c78){logger[_0xc53e('0x1f')](_0xc53e('0x20'),_0x455e4d,_0xc53e('0x21'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x455e4d,_0xc53e('0x21'),JSON[_0xc53e('0x22')](_0x270c78));if(_0x270c78[_0xc53e('0x23')]){if(_0x270c78[_0xc53e('0x23')][_0xc53e('0x24')]===0x1f4){logger[_0xc53e('0x23')](_0xc53e('0x20'),_0x455e4d,_0x270c78[_0xc53e('0x23')][_0xc53e('0x25')]);return _0x191567(_0x270c78[_0xc53e('0x23')][_0xc53e('0x25')]);}logger[_0xc53e('0x23')](_0xc53e('0x20'),_0x455e4d,_0x270c78['error']['message']);return _0x8a522e(_0x270c78['error'][_0xc53e('0x25')]);}else{logger[_0xc53e('0x1f')](_0xc53e('0x20'),_0x455e4d,_0xc53e('0x21'));_0x8a522e(_0x270c78[_0xc53e('0x26')]['message']);}})['catch'](function(_0xe06e42){logger['error'](_0xc53e('0x20'),_0x455e4d,_0xe06e42);_0x191567(_0xe06e42);});});}function respondWithStatusCode(_0x3a5ce8,_0x443179){_0x443179=_0x443179||0xcc;return function(_0x1166e6){if(_0x1166e6){return _0x3a5ce8[_0xc53e('0x27')](_0x443179);}return _0x3a5ce8['status'](_0x443179)[_0xc53e('0x28')]();};}function respondWithResult(_0x4b9f6a,_0x4d9a68){_0x4d9a68=_0x4d9a68||0xc8;return function(_0x5c65d3){if(_0x5c65d3){return _0x4b9f6a[_0xc53e('0x29')](_0x4d9a68)['json'](_0x5c65d3);}};}function respondWithFilteredResult(_0x28240a,_0x4f203d){return function(_0x24a77e){if(_0x24a77e){var _0x5112d2=_0x24a77e[_0xc53e('0x2a')],_0x5ce216=_0x4f203d[_0xc53e('0x2b')],_0x8f0ee6=_0x4f203d[_0xc53e('0x2b')]+_0x4f203d[_0xc53e('0x2c')],_0x6a62b0;if(_0x8f0ee6>=_0x5112d2){_0x8f0ee6=_0x5112d2;_0x6a62b0=0xc8;}else{_0x6a62b0=0xce;}_0x28240a[_0xc53e('0x29')](_0x6a62b0);return _0x28240a[_0xc53e('0x2d')]('Content-Range',_0x5ce216+'-'+_0x8f0ee6+'/'+_0x5112d2)[_0xc53e('0x2e')](_0x24a77e);}return null;};}function patchUpdates(_0x311835){return function(_0x2d36c0){try{jsonpatch['apply'](_0x2d36c0,_0x311835,!![]);}catch(_0x4057f9){return BPromise['reject'](_0x4057f9);}return _0x2d36c0[_0xc53e('0x2f')]();};}function saveUpdates(_0x2467f4,_0x49ab9b){return function(_0x5a64e2){if(_0x5a64e2){return _0x5a64e2[_0xc53e('0x30')](_0x2467f4)[_0xc53e('0x1e')](function(_0x3f4547){return _0x3f4547;});}return null;};}function removeEntity(_0x30d037,_0x1b95c2){return function(_0x45fedc){if(_0x45fedc){return _0x45fedc[_0xc53e('0x31')]()[_0xc53e('0x1e')](function(){_0x30d037['status'](0xcc)[_0xc53e('0x28')]();});}};}function handleEntityNotFound(_0x3bae8a,_0x19020b){return function(_0x17ad32){if(!_0x17ad32){_0x3bae8a[_0xc53e('0x27')](0x194);}return _0x17ad32;};}function handleError(_0x12b32c,_0x1920c8){_0x1920c8=_0x1920c8||0x1f4;return function(_0x16942c){logger[_0xc53e('0x23')](_0x16942c['stack']);if(_0x16942c[_0xc53e('0x32')]){delete _0x16942c['name'];}_0x12b32c[_0xc53e('0x29')](_0x1920c8)[_0xc53e('0x33')](_0x16942c);};}exports['index']=function(_0x37452a,_0x154f8b){var _0x3254e9={},_0x5ed90b={},_0x4b82bb={'count':0x0,'rows':[]};var _0x17ec92=_[_0xc53e('0x34')](db[_0xc53e('0x35')][_0xc53e('0x36')],function(_0x143101){return{'name':_0x143101[_0xc53e('0x37')],'type':_0x143101['type'][_0xc53e('0x38')]};});_0x5ed90b[_0xc53e('0x39')]=_[_0xc53e('0x34')](_0x17ec92,'name');_0x5ed90b[_0xc53e('0x3a')]=_['keys'](_0x37452a[_0xc53e('0x3a')]);_0x5ed90b[_0xc53e('0x3b')]=_[_0xc53e('0x3c')](_0x5ed90b[_0xc53e('0x39')],_0x5ed90b[_0xc53e('0x3a')]);_0x3254e9['attributes']=_[_0xc53e('0x3c')](_0x5ed90b[_0xc53e('0x39')],qs['fields'](_0x37452a['query']['fields']));_0x3254e9['attributes']=_0x3254e9[_0xc53e('0x3d')][_0xc53e('0x3e')]?_0x3254e9['attributes']:_0x5ed90b[_0xc53e('0x39')];if(!_0x37452a['query']['hasOwnProperty']('nolimit')){_0x3254e9[_0xc53e('0x2c')]=qs['limit'](_0x37452a['query'][_0xc53e('0x2c')]);_0x3254e9['offset']=qs[_0xc53e('0x2b')](_0x37452a[_0xc53e('0x3a')]['offset']);}_0x3254e9[_0xc53e('0x3f')]=qs[_0xc53e('0x40')](_0x37452a['query'][_0xc53e('0x40')]);_0x3254e9['where']=qs['filters'](_['pick'](_0x37452a['query'],_0x5ed90b[_0xc53e('0x3b')]));if(_0x37452a[_0xc53e('0x3a')][_0xc53e('0x41')]){_0x3254e9['where']=_[_0xc53e('0x42')](_0x3254e9[_0xc53e('0x43')],{'$or':_['map'](_0x17ec92,function(_0x58ede2){if(_0x58ede2[_0xc53e('0x44')]!==_0xc53e('0x45')){var _0x162acd={};_0x162acd[_0x58ede2['name']]={'$like':'%'+_0x37452a[_0xc53e('0x3a')][_0xc53e('0x41')]+'%'};return _0x162acd;}})});}_0x3254e9=_[_0xc53e('0x42')]({},_0x3254e9,_0x37452a[_0xc53e('0x46')]);var _0x1295cc={'where':_0x3254e9[_0xc53e('0x43')]};return db[_0xc53e('0x35')]['count'](_0x1295cc)[_0xc53e('0x1e')](function(_0x39c467){_0x4b82bb[_0xc53e('0x2a')]=_0x39c467;if(_0x37452a['query'][_0xc53e('0x47')]){_0x3254e9[_0xc53e('0x48')]=[{'all':!![]}];}return db[_0xc53e('0x35')][_0xc53e('0x49')](_0x3254e9);})[_0xc53e('0x1e')](function(_0x17cea5){_0x4b82bb['rows']=_0x17cea5;return _0x4b82bb;})[_0xc53e('0x1e')](respondWithFilteredResult(_0x154f8b,_0x3254e9))[_0xc53e('0x4a')](handleError(_0x154f8b,null));};exports[_0xc53e('0x4b')]=function(_0x5a6e41,_0x33d45c){var _0x1d2491={'raw':![],'where':{'id':_0x5a6e41[_0xc53e('0x4c')]['id']}},_0x1eeb65={};_0x1eeb65[_0xc53e('0x39')]=_[_0xc53e('0x4d')](db[_0xc53e('0x35')][_0xc53e('0x36')]);_0x1eeb65[_0xc53e('0x3a')]=_[_0xc53e('0x4d')](_0x5a6e41['query']);_0x1eeb65[_0xc53e('0x3b')]=_[_0xc53e('0x3c')](_0x1eeb65[_0xc53e('0x39')],_0x1eeb65[_0xc53e('0x3a')]);_0x1d2491[_0xc53e('0x3d')]=_['intersection'](_0x1eeb65['model'],qs[_0xc53e('0x4e')](_0x5a6e41['query'][_0xc53e('0x4e')]));_0x1d2491['attributes']=_0x1d2491[_0xc53e('0x3d')][_0xc53e('0x3e')]?_0x1d2491[_0xc53e('0x3d')]:_0x1eeb65['model'];if(_0x5a6e41[_0xc53e('0x3a')][_0xc53e('0x47')]){_0x1d2491[_0xc53e('0x48')]=[{'all':!![]}];}_0x1d2491=_['merge']({},_0x1d2491,_0x5a6e41[_0xc53e('0x46')]);return db['SalesforceAccount'][_0xc53e('0x4f')](_0x1d2491)[_0xc53e('0x1e')](handleEntityNotFound(_0x33d45c,null))['then'](respondWithResult(_0x33d45c,null))[_0xc53e('0x4a')](handleError(_0x33d45c,null));};exports[_0xc53e('0x50')]=function(_0x5bba72,_0x44f7cc){return db[_0xc53e('0x35')][_0xc53e('0x50')](_0x5bba72[_0xc53e('0x51')],{})[_0xc53e('0x1e')](respondWithResult(_0x44f7cc,0xc9))[_0xc53e('0x4a')](handleError(_0x44f7cc,null));};exports[_0xc53e('0x30')]=function(_0x117c9b,_0x8e5630){if(_0x117c9b[_0xc53e('0x51')]['id']){delete _0x117c9b[_0xc53e('0x51')]['id'];}return db['SalesforceAccount'][_0xc53e('0x4f')]({'where':{'id':_0x117c9b['params']['id']}})[_0xc53e('0x1e')](handleEntityNotFound(_0x8e5630,null))['then'](saveUpdates(_0x117c9b[_0xc53e('0x51')],null))[_0xc53e('0x1e')](respondWithResult(_0x8e5630,null))['catch'](handleError(_0x8e5630,null));};exports[_0xc53e('0x31')]=function(_0x7f0bc0,_0x9c0112){return db[_0xc53e('0x35')]['find']({'where':{'id':_0x7f0bc0[_0xc53e('0x4c')]['id']}})[_0xc53e('0x1e')](handleEntityNotFound(_0x9c0112,null))['then'](removeEntity(_0x9c0112,null))['catch'](handleError(_0x9c0112,null));};exports[_0xc53e('0x52')]=function(_0x51db9a,_0x5c62c7,_0x57c822){var _0x23a4ee={};var _0x5f5dad={};var _0x32b390;var _0x4ee995;return db[_0xc53e('0x35')][_0xc53e('0x53')]({'where':{'id':_0x51db9a[_0xc53e('0x4c')]['id']}})[_0xc53e('0x1e')](handleEntityNotFound(_0x5c62c7,null))[_0xc53e('0x1e')](function(_0x4caf5f){if(_0x4caf5f){_0x32b390=_0x4caf5f;_0x5f5dad['model']=_[_0xc53e('0x4d')](db[_0xc53e('0x54')][_0xc53e('0x36')]);_0x5f5dad[_0xc53e('0x3a')]=_[_0xc53e('0x4d')](_0x51db9a[_0xc53e('0x3a')]);_0x5f5dad[_0xc53e('0x3b')]=_[_0xc53e('0x3c')](_0x5f5dad[_0xc53e('0x39')],_0x5f5dad[_0xc53e('0x3a')]);_0x23a4ee[_0xc53e('0x3d')]=_[_0xc53e('0x3c')](_0x5f5dad[_0xc53e('0x39')],qs['fields'](_0x51db9a[_0xc53e('0x3a')]['fields']));_0x23a4ee[_0xc53e('0x3d')]=_0x23a4ee[_0xc53e('0x3d')][_0xc53e('0x3e')]?_0x23a4ee[_0xc53e('0x3d')]:_0x5f5dad[_0xc53e('0x39')];_0x23a4ee[_0xc53e('0x3f')]=qs[_0xc53e('0x40')](_0x51db9a[_0xc53e('0x3a')]['sort']);_0x23a4ee['where']=qs['filters'](_[_0xc53e('0x55')](_0x51db9a[_0xc53e('0x3a')],_0x5f5dad[_0xc53e('0x3b')]));if(_0x51db9a[_0xc53e('0x3a')][_0xc53e('0x41')]){_0x23a4ee[_0xc53e('0x43')]=_[_0xc53e('0x42')](_0x23a4ee['where'],{'$or':_['map'](_0x23a4ee['attributes'],function(_0x40c8ba){var _0x150212={};_0x150212[_0x40c8ba]={'$like':'%'+_0x51db9a['query'][_0xc53e('0x41')]+'%'};return _0x150212;})});}_0x23a4ee=_[_0xc53e('0x42')]({},_0x23a4ee,_0x51db9a[_0xc53e('0x46')]);return _0x32b390[_0xc53e('0x52')](_0x23a4ee);}})[_0xc53e('0x1e')](function(_0x20cb31){if(_0x20cb31){_0x4ee995=_0x20cb31['length'];if(!_0x51db9a['query'][_0xc53e('0x56')](_0xc53e('0x57'))){_0x23a4ee[_0xc53e('0x2c')]=qs[_0xc53e('0x2c')](_0x51db9a[_0xc53e('0x3a')][_0xc53e('0x2c')]);_0x23a4ee['offset']=qs[_0xc53e('0x2b')](_0x51db9a[_0xc53e('0x3a')][_0xc53e('0x2b')]);}return _0x32b390[_0xc53e('0x52')](_0x23a4ee);}})['then'](function(_0xdd851e){if(_0xdd851e){return _0xdd851e?{'count':_0x4ee995,'rows':_0xdd851e}:null;}})[_0xc53e('0x1e')](respondWithResult(_0x5c62c7,null))[_0xc53e('0x4a')](handleError(_0x5c62c7,null));};exports[_0xc53e('0x58')]=function(_0x32f954,_0x2d9803,_0x51638a){if(_0x32f954[_0xc53e('0x51')]['id']){delete _0x32f954[_0xc53e('0x51')]['id'];}return db[_0xc53e('0x35')][_0xc53e('0x53')]({'where':{'id':_0x32f954['params']['id']}})['then'](handleEntityNotFound(_0x2d9803,null))[_0xc53e('0x1e')](function(_0x340123){if(_0x340123){_0x32f954[_0xc53e('0x51')][_0xc53e('0x59')]=_0x340123['id'];_0x32f954['body'][_0xc53e('0x5a')]=integrations['getSubjects'](_0x32f954[_0xc53e('0x51')]['channel'],_0x32f954[_0xc53e('0x51')]['type']);_0x32f954[_0xc53e('0x51')][_0xc53e('0x5b')]=integrations['getDescriptions'](_0x32f954[_0xc53e('0x51')][_0xc53e('0x5c')],_0x32f954['body']['type']);return db[_0xc53e('0x54')][_0xc53e('0x50')](_0x32f954['body'],{'include':[{'model':db['SalesforceField'],'as':_0xc53e('0x5a')},{'model':db['SalesforceField'],'as':_0xc53e('0x5b')}]});}return null;})['then'](respondWithResult(_0x2d9803,null))[_0xc53e('0x4a')](handleError(_0x2d9803,null));};exports[_0xc53e('0x5d')]=function(_0x10167b,_0x388874,_0x45cee1){var _0x20067c;var _0x143f15='';var _0x15eac2=_0xc53e('0x5e');return db[_0xc53e('0x35')]['findOne']({'where':{'id':_0x10167b[_0xc53e('0x4c')]['id']},'attributes':['id','remoteUri',_0xc53e('0x5f'),_0xc53e('0x60'),_0xc53e('0x61'),_0xc53e('0x62'),_0xc53e('0x63')]})[_0xc53e('0x1e')](handleEntityNotFound(_0x388874,null))[_0xc53e('0x1e')](function(_0x3cc2c7){if(_0x3cc2c7){_0x143f15=_0x3cc2c7[_0xc53e('0x64')];var _0x1f572b=_0x143f15['slice'](-0x1);if(_0x1f572b==='/'){_0x143f15=_0x143f15[_0xc53e('0x65')](0x0,_0x143f15['lastIndexOf'](_0x1f572b));}_0x20067c=new jsforce[(_0xc53e('0x66'))]({'oauth2':{'loginUrl':_0x143f15,'clientId':_0x3cc2c7[_0xc53e('0x5f')],'clientSecret':_0x3cc2c7[_0xc53e('0x60')]}});return _0x20067c['login'](_0x3cc2c7[_0xc53e('0x61')],_0x3cc2c7[_0xc53e('0x62')][_0xc53e('0x67')](_0x3cc2c7[_0xc53e('0x63')]));}})[_0xc53e('0x1e')](function(_0x508671){if(_0x508671){if(!_[_0xc53e('0x68')](_0x10167b[_0xc53e('0x3a')]['ticketType'])){_0x15eac2=_0x10167b[_0xc53e('0x3a')][_0xc53e('0x69')];}return _0x20067c[_0xc53e('0x6a')](_0x15eac2)['describe']();}})[_0xc53e('0x1e')](function(_0x499725){var _0x49bed2=[_0xc53e('0x6b'),_0xc53e('0x6c'),'CallObject','CallType',_0xc53e('0x6d'),'Priority',_0xc53e('0x6e'),_0xc53e('0x6f')];if(!_[_0xc53e('0x68')](_0x10167b['query'][_0xc53e('0x69')])&&_0x10167b[_0xc53e('0x3a')][_0xc53e('0x69')]==='Case'){_0x49bed2=[_0xc53e('0x6f'),_0xc53e('0x70'),_0xc53e('0x71'),_0xc53e('0x6e'),_0xc53e('0x72'),'IsEscalated',_0xc53e('0x73'),_0xc53e('0x74')];}if(_0x499725){_[_0xc53e('0x75')](_0x499725[_0xc53e('0x4e')],function(_0xe6a976){return _0xe6a976[_0xc53e('0x76')]===![]&&!_0x49bed2[_0xc53e('0x77')](_0xe6a976[_0xc53e('0x32')]);});return{'count':_0x499725[_0xc53e('0x4e')]['length'],'rows':_[_0xc53e('0x34')](_0x499725[_0xc53e('0x4e')],function(_0x1c06bc){return{'id':_0x1c06bc[_0xc53e('0x32')],'name':_0x1c06bc[_0xc53e('0x78')],'custom':_0x1c06bc[_0xc53e('0x76')],'options':_0x1c06bc[_0xc53e('0x79')][_0xc53e('0x3e')]>0x0?_[_0xc53e('0x34')](_0x1c06bc['picklistValues'],function(_0x3a54ef){return{'name':_0x3a54ef[_0xc53e('0x78')],'value':_0x3a54ef[_0xc53e('0x7a')]};}):_0x1c06bc[_0xc53e('0x44')]=='boolean'?[{'name':_0xc53e('0x7b'),'value':_0xc53e('0x7c')},{'name':_0xc53e('0x7d'),'value':_0xc53e('0x7e')}]:[]};})};}})['then'](respondWithResult(_0x388874,null))[_0xc53e('0x4a')](function(_0x138870){var _0xa90198=_0x10167b[_0xc53e('0x3a')][_0xc53e('0x19')]?0x1f4:_0x138870[_0xc53e('0x7f')]||0x1f4;logger[_0xc53e('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xc53e('0x5d'),_0xa90198,JSON['stringify'](_0x138870));delete _0x138870[_0xc53e('0x32')];if(_0xa90198===0x191){_0xa90198=0x190;}_0x388874[_0xc53e('0x29')](_0xa90198)[_0xc53e('0x33')](_0x10167b['query'][_0xc53e('0x19')]?{'message':_0xc53e('0x80'),'statusCode':_0x138870[_0xc53e('0x7f')]}:_0x138870);});}; \ No newline at end of file +var _0xf494=['addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','getFields','Task','clientId','username','securityToken','remoteUri','substring','Connection','clientSecret','password','concat','isNil','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallObject','IsArchived','Priority','Status','Type','Case','Origin','Reason','SuppliedName','remove','custom','includes','picklistValues','label','value','boolean','True','true','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','result','status','end','count','limit','set','json','apply','reject','save','update','destroy','sendStatus','stack','name','send','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','keys','find','create','body','getConfigurations','findOne','SalesforceConfiguration','order'];(function(_0x2d1cf4,_0x2ea9ee){var _0x554a7c=function(_0x55cc39){while(--_0x55cc39){_0x2d1cf4['push'](_0x2d1cf4['shift']());}};_0x554a7c(++_0x2ea9ee);}(_0xf494,0x1c6));var _0x4f49=function(_0x136301,_0xd06f76){_0x136301=_0x136301-0x0;var _0x4d0379=_0xf494[_0x136301];return _0x4d0379;};'use strict';var pdf=require(_0x4f49('0x0'));var emlformat=require(_0x4f49('0x1'));var rimraf=require(_0x4f49('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f49('0x3'));var rp=require(_0x4f49('0x4'));var moment=require(_0x4f49('0x5'));var BPromise=require(_0x4f49('0x6'));var Mustache=require(_0x4f49('0x7'));var util=require(_0x4f49('0x8'));var path=require(_0x4f49('0x9'));var sox=require(_0x4f49('0xa'));var csv=require(_0x4f49('0xb'));var ejs=require(_0x4f49('0xc'));var fs=require('fs');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('0xb'));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 db=require('../../mysqldb')['db'];var integrations=require(_0x4f49('0x18'));var jayson=require(_0x4f49('0x19'));var client=jayson['client'][_0x4f49('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x111a8b,_0x1b9145,_0x2efe49){if(_0x2efe49){var _0x1a0f1e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a0f1e[_0x4f49('0x1b')](_0x1b9145)){return _0x111a8b;}else{throw new db[(_0x4f49('0x1c'))]['ValidationError'](_0x4f49('0x1d'));}}else{return _0x111a8b;}}function respondWithRpcPromise(_0x1f2d0d,_0x415e83,_0x5878f4,_0x5bdfaf){return new BPromise(function(_0x2f0a0d,_0x2ecaaa){var _0x74886e=_0x5bdfaf||client;return _0x74886e['request'](_0x1f2d0d,_0x5878f4)[_0x4f49('0x1e')](function(_0x399be7){logger[_0x4f49('0x1f')]('SalesforceAccount,\x20%s,\x20%s',_0x415e83,'request\x20sent');logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x415e83,_0x4f49('0x20'),JSON[_0x4f49('0x21')](_0x399be7));if(_0x399be7[_0x4f49('0x22')]){if(_0x399be7[_0x4f49('0x22')]['code']===0x1f4){logger[_0x4f49('0x22')](_0x4f49('0x23'),_0x415e83,_0x399be7[_0x4f49('0x22')][_0x4f49('0x24')]);return _0x2ecaaa(_0x399be7[_0x4f49('0x22')]['message']);}logger[_0x4f49('0x22')](_0x4f49('0x23'),_0x415e83,_0x399be7[_0x4f49('0x22')]['message']);return _0x2f0a0d(_0x399be7[_0x4f49('0x22')][_0x4f49('0x24')]);}else{logger[_0x4f49('0x1f')](_0x4f49('0x23'),_0x415e83,_0x4f49('0x20'));_0x2f0a0d(_0x399be7[_0x4f49('0x25')]['message']);}})['catch'](function(_0x3a947b){logger[_0x4f49('0x22')]('SalesforceAccount,\x20%s,\x20%s',_0x415e83,_0x3a947b);_0x2ecaaa(_0x3a947b);});});}function respondWithStatusCode(_0x408552,_0x2c1519){_0x2c1519=_0x2c1519||0xcc;return function(_0x35f8e0){if(_0x35f8e0){return _0x408552['sendStatus'](_0x2c1519);}return _0x408552[_0x4f49('0x26')](_0x2c1519)[_0x4f49('0x27')]();};}function respondWithResult(_0x298785,_0x148153){_0x148153=_0x148153||0xc8;return function(_0xfefbab){if(_0xfefbab){return _0x298785[_0x4f49('0x26')](_0x148153)['json'](_0xfefbab);}};}function respondWithFilteredResult(_0x50c571,_0x239f44){return function(_0x2c00ee){if(_0x2c00ee){var _0x605c91=_0x2c00ee[_0x4f49('0x28')],_0x560050=_0x239f44['offset'],_0x3cbfbd=_0x239f44['offset']+_0x239f44[_0x4f49('0x29')],_0x206203;if(_0x3cbfbd>=_0x605c91){_0x3cbfbd=_0x605c91;_0x206203=0xc8;}else{_0x206203=0xce;}_0x50c571[_0x4f49('0x26')](_0x206203);return _0x50c571[_0x4f49('0x2a')]('Content-Range',_0x560050+'-'+_0x3cbfbd+'/'+_0x605c91)[_0x4f49('0x2b')](_0x2c00ee);}return null;};}function patchUpdates(_0x35aa33){return function(_0x173657){try{jsonpatch[_0x4f49('0x2c')](_0x173657,_0x35aa33,!![]);}catch(_0x3e103b){return BPromise[_0x4f49('0x2d')](_0x3e103b);}return _0x173657[_0x4f49('0x2e')]();};}function saveUpdates(_0x45ae19,_0x1f38d3){return function(_0x310ee2){if(_0x310ee2){return _0x310ee2[_0x4f49('0x2f')](_0x45ae19)[_0x4f49('0x1e')](function(_0x29ff83){return _0x29ff83;});}return null;};}function removeEntity(_0x6625cd,_0x135d17){return function(_0x97ef98){if(_0x97ef98){return _0x97ef98[_0x4f49('0x30')]()[_0x4f49('0x1e')](function(){_0x6625cd[_0x4f49('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45d0d2,_0x46b7ba){return function(_0x24f568){if(!_0x24f568){_0x45d0d2[_0x4f49('0x31')](0x194);}return _0x24f568;};}function handleError(_0x1c3af8,_0x15e82b){_0x15e82b=_0x15e82b||0x1f4;return function(_0x2cbe4e){logger[_0x4f49('0x22')](_0x2cbe4e[_0x4f49('0x32')]);if(_0x2cbe4e[_0x4f49('0x33')]){delete _0x2cbe4e[_0x4f49('0x33')];}_0x1c3af8[_0x4f49('0x26')](_0x15e82b)[_0x4f49('0x34')](_0x2cbe4e);};}exports['index']=function(_0x371282,_0x27b7a9){var _0x36000a={},_0x26014f={},_0x1c1e9b={'count':0x0,'rows':[]};var _0x3ee818=_[_0x4f49('0x35')](db[_0x4f49('0x36')][_0x4f49('0x37')],function(_0xf8c377){return{'name':_0xf8c377[_0x4f49('0x38')],'type':_0xf8c377[_0x4f49('0x39')][_0x4f49('0x3a')]};});_0x26014f[_0x4f49('0x3b')]=_['map'](_0x3ee818,_0x4f49('0x33'));_0x26014f[_0x4f49('0x3c')]=_['keys'](_0x371282[_0x4f49('0x3c')]);_0x26014f[_0x4f49('0x3d')]=_['intersection'](_0x26014f[_0x4f49('0x3b')],_0x26014f[_0x4f49('0x3c')]);_0x36000a[_0x4f49('0x3e')]=_[_0x4f49('0x3f')](_0x26014f[_0x4f49('0x3b')],qs[_0x4f49('0x40')](_0x371282[_0x4f49('0x3c')]['fields']));_0x36000a['attributes']=_0x36000a['attributes'][_0x4f49('0x41')]?_0x36000a[_0x4f49('0x3e')]:_0x26014f[_0x4f49('0x3b')];if(!_0x371282[_0x4f49('0x3c')][_0x4f49('0x42')](_0x4f49('0x43'))){_0x36000a[_0x4f49('0x29')]=qs[_0x4f49('0x29')](_0x371282[_0x4f49('0x3c')]['limit']);_0x36000a['offset']=qs[_0x4f49('0x44')](_0x371282[_0x4f49('0x3c')][_0x4f49('0x44')]);}_0x36000a['order']=qs[_0x4f49('0x45')](_0x371282['query']['sort']);_0x36000a[_0x4f49('0x46')]=qs[_0x4f49('0x3d')](_[_0x4f49('0x47')](_0x371282['query'],_0x26014f[_0x4f49('0x3d')]));if(_0x371282[_0x4f49('0x3c')]['filter']){_0x36000a[_0x4f49('0x46')]=_['merge'](_0x36000a[_0x4f49('0x46')],{'$or':_[_0x4f49('0x35')](_0x3ee818,function(_0x133f39){if(_0x133f39['type']!==_0x4f49('0x48')){var _0x1e5f0b={};_0x1e5f0b[_0x133f39[_0x4f49('0x33')]]={'$like':'%'+_0x371282[_0x4f49('0x3c')][_0x4f49('0x49')]+'%'};return _0x1e5f0b;}})});}_0x36000a=_[_0x4f49('0x4a')]({},_0x36000a,_0x371282[_0x4f49('0x4b')]);var _0x356785={'where':_0x36000a[_0x4f49('0x46')]};return db[_0x4f49('0x36')]['count'](_0x356785)[_0x4f49('0x1e')](function(_0x44bf1d){_0x1c1e9b['count']=_0x44bf1d;if(_0x371282[_0x4f49('0x3c')]['includeAll']){_0x36000a[_0x4f49('0x4c')]=[{'all':!![]}];}return db[_0x4f49('0x36')][_0x4f49('0x4d')](_0x36000a);})[_0x4f49('0x1e')](function(_0x4a91ec){_0x1c1e9b[_0x4f49('0x4e')]=_0x4a91ec;return _0x1c1e9b;})[_0x4f49('0x1e')](respondWithFilteredResult(_0x27b7a9,_0x36000a))[_0x4f49('0x4f')](handleError(_0x27b7a9,null));};exports[_0x4f49('0x50')]=function(_0x3ec266,_0x72ea05){var _0x37fdb7={'raw':![],'where':{'id':_0x3ec266[_0x4f49('0x51')]['id']}},_0xd282c={};_0xd282c[_0x4f49('0x3b')]=_[_0x4f49('0x52')](db[_0x4f49('0x36')][_0x4f49('0x37')]);_0xd282c[_0x4f49('0x3c')]=_[_0x4f49('0x52')](_0x3ec266[_0x4f49('0x3c')]);_0xd282c['filters']=_['intersection'](_0xd282c[_0x4f49('0x3b')],_0xd282c[_0x4f49('0x3c')]);_0x37fdb7[_0x4f49('0x3e')]=_[_0x4f49('0x3f')](_0xd282c[_0x4f49('0x3b')],qs[_0x4f49('0x40')](_0x3ec266[_0x4f49('0x3c')]['fields']));_0x37fdb7[_0x4f49('0x3e')]=_0x37fdb7['attributes'][_0x4f49('0x41')]?_0x37fdb7[_0x4f49('0x3e')]:_0xd282c[_0x4f49('0x3b')];if(_0x3ec266[_0x4f49('0x3c')]['includeAll']){_0x37fdb7[_0x4f49('0x4c')]=[{'all':!![]}];}_0x37fdb7=_['merge']({},_0x37fdb7,_0x3ec266['options']);return db[_0x4f49('0x36')][_0x4f49('0x53')](_0x37fdb7)[_0x4f49('0x1e')](handleEntityNotFound(_0x72ea05,null))[_0x4f49('0x1e')](respondWithResult(_0x72ea05,null))['catch'](handleError(_0x72ea05,null));};exports['create']=function(_0xd7f47b,_0x291a45){return db['SalesforceAccount'][_0x4f49('0x54')](_0xd7f47b['body'],{})['then'](respondWithResult(_0x291a45,0xc9))[_0x4f49('0x4f')](handleError(_0x291a45,null));};exports['update']=function(_0xfa7dd6,_0x492aaa){if(_0xfa7dd6[_0x4f49('0x55')]['id']){delete _0xfa7dd6[_0x4f49('0x55')]['id'];}return db[_0x4f49('0x36')][_0x4f49('0x53')]({'where':{'id':_0xfa7dd6[_0x4f49('0x51')]['id']}})[_0x4f49('0x1e')](handleEntityNotFound(_0x492aaa,null))[_0x4f49('0x1e')](saveUpdates(_0xfa7dd6[_0x4f49('0x55')],null))['then'](respondWithResult(_0x492aaa,null))[_0x4f49('0x4f')](handleError(_0x492aaa,null));};exports['destroy']=function(_0x213608,_0x1f640d){return db[_0x4f49('0x36')][_0x4f49('0x53')]({'where':{'id':_0x213608[_0x4f49('0x51')]['id']}})[_0x4f49('0x1e')](handleEntityNotFound(_0x1f640d,null))['then'](removeEntity(_0x1f640d,null))[_0x4f49('0x4f')](handleError(_0x1f640d,null));};exports[_0x4f49('0x56')]=function(_0x5e3568,_0x5d2b3c,_0x121c04){var _0x447dde={};var _0x2e0df5={};var _0x2409f1;var _0x19a788;return db['SalesforceAccount'][_0x4f49('0x57')]({'where':{'id':_0x5e3568['params']['id']}})[_0x4f49('0x1e')](handleEntityNotFound(_0x5d2b3c,null))[_0x4f49('0x1e')](function(_0x2a2b0d){if(_0x2a2b0d){_0x2409f1=_0x2a2b0d;_0x2e0df5['model']=_[_0x4f49('0x52')](db[_0x4f49('0x58')][_0x4f49('0x37')]);_0x2e0df5[_0x4f49('0x3c')]=_['keys'](_0x5e3568[_0x4f49('0x3c')]);_0x2e0df5[_0x4f49('0x3d')]=_['intersection'](_0x2e0df5[_0x4f49('0x3b')],_0x2e0df5[_0x4f49('0x3c')]);_0x447dde[_0x4f49('0x3e')]=_[_0x4f49('0x3f')](_0x2e0df5[_0x4f49('0x3b')],qs[_0x4f49('0x40')](_0x5e3568[_0x4f49('0x3c')][_0x4f49('0x40')]));_0x447dde['attributes']=_0x447dde[_0x4f49('0x3e')][_0x4f49('0x41')]?_0x447dde[_0x4f49('0x3e')]:_0x2e0df5[_0x4f49('0x3b')];_0x447dde[_0x4f49('0x59')]=qs[_0x4f49('0x45')](_0x5e3568[_0x4f49('0x3c')]['sort']);_0x447dde[_0x4f49('0x46')]=qs['filters'](_[_0x4f49('0x47')](_0x5e3568[_0x4f49('0x3c')],_0x2e0df5[_0x4f49('0x3d')]));if(_0x5e3568[_0x4f49('0x3c')][_0x4f49('0x49')]){_0x447dde[_0x4f49('0x46')]=_[_0x4f49('0x4a')](_0x447dde[_0x4f49('0x46')],{'$or':_[_0x4f49('0x35')](_0x447dde[_0x4f49('0x3e')],function(_0x545552){var _0x2f9f2e={};_0x2f9f2e[_0x545552]={'$like':'%'+_0x5e3568[_0x4f49('0x3c')][_0x4f49('0x49')]+'%'};return _0x2f9f2e;})});}_0x447dde=_[_0x4f49('0x4a')]({},_0x447dde,_0x5e3568['options']);return _0x2409f1['getConfigurations'](_0x447dde);}})[_0x4f49('0x1e')](function(_0x5e4879){if(_0x5e4879){_0x19a788=_0x5e4879[_0x4f49('0x41')];if(!_0x5e3568[_0x4f49('0x3c')][_0x4f49('0x42')](_0x4f49('0x43'))){_0x447dde[_0x4f49('0x29')]=qs[_0x4f49('0x29')](_0x5e3568[_0x4f49('0x3c')][_0x4f49('0x29')]);_0x447dde[_0x4f49('0x44')]=qs[_0x4f49('0x44')](_0x5e3568[_0x4f49('0x3c')][_0x4f49('0x44')]);}return _0x2409f1[_0x4f49('0x56')](_0x447dde);}})[_0x4f49('0x1e')](function(_0x234984){if(_0x234984){return _0x234984?{'count':_0x19a788,'rows':_0x234984}:null;}})[_0x4f49('0x1e')](respondWithResult(_0x5d2b3c,null))[_0x4f49('0x4f')](handleError(_0x5d2b3c,null));};exports[_0x4f49('0x5a')]=function(_0x1f9161,_0x1434ea,_0x2c3962){if(_0x1f9161[_0x4f49('0x55')]['id']){delete _0x1f9161[_0x4f49('0x55')]['id'];}return db[_0x4f49('0x36')][_0x4f49('0x57')]({'where':{'id':_0x1f9161['params']['id']}})[_0x4f49('0x1e')](handleEntityNotFound(_0x1434ea,null))['then'](function(_0x31df7f){if(_0x31df7f){_0x1f9161[_0x4f49('0x55')][_0x4f49('0x5b')]=_0x31df7f['id'];_0x1f9161[_0x4f49('0x55')][_0x4f49('0x5c')]=integrations[_0x4f49('0x5d')](_0x1f9161[_0x4f49('0x55')][_0x4f49('0x5e')],_0x1f9161[_0x4f49('0x55')]['type']);_0x1f9161['body'][_0x4f49('0x5f')]=integrations['getDescriptions'](_0x1f9161[_0x4f49('0x55')][_0x4f49('0x5e')],_0x1f9161[_0x4f49('0x55')][_0x4f49('0x39')]);return db[_0x4f49('0x58')]['create'](_0x1f9161['body'],{'include':[{'model':db[_0x4f49('0x60')],'as':_0x4f49('0x5c')},{'model':db['SalesforceField'],'as':_0x4f49('0x5f')}]});}return null;})[_0x4f49('0x1e')](respondWithResult(_0x1434ea,null))['catch'](handleError(_0x1434ea,null));};exports[_0x4f49('0x61')]=function(_0x5b88aa,_0x121972,_0x160cf8){var _0x544356;var _0x15ed6c='';var _0x4551d9=_0x4f49('0x62');return db[_0x4f49('0x36')][_0x4f49('0x57')]({'where':{'id':_0x5b88aa[_0x4f49('0x51')]['id']},'attributes':['id','remoteUri',_0x4f49('0x63'),'clientSecret',_0x4f49('0x64'),'password',_0x4f49('0x65')]})['then'](handleEntityNotFound(_0x121972,null))[_0x4f49('0x1e')](function(_0x16fad9){if(_0x16fad9){_0x15ed6c=_0x16fad9[_0x4f49('0x66')];var _0x2dbd0f=_0x15ed6c['slice'](-0x1);if(_0x2dbd0f==='/'){_0x15ed6c=_0x15ed6c[_0x4f49('0x67')](0x0,_0x15ed6c['lastIndexOf'](_0x2dbd0f));}_0x544356=new jsforce[(_0x4f49('0x68'))]({'oauth2':{'loginUrl':_0x15ed6c,'clientId':_0x16fad9['clientId'],'clientSecret':_0x16fad9[_0x4f49('0x69')]}});return _0x544356['login'](_0x16fad9['username'],_0x16fad9[_0x4f49('0x6a')][_0x4f49('0x6b')](_0x16fad9[_0x4f49('0x65')]));}})['then'](function(_0x289810){if(_0x289810){if(!_[_0x4f49('0x6c')](_0x5b88aa['query']['ticketType'])){_0x4551d9=_0x5b88aa['query'][_0x4f49('0x6d')];}return _0x544356[_0x4f49('0x6e')](_0x4551d9)[_0x4f49('0x6f')]();}})[_0x4f49('0x1e')](function(_0x1643fc){var _0x517144=[_0x4f49('0x70'),_0x4f49('0x71'),_0x4f49('0x72'),'CallType',_0x4f49('0x73'),_0x4f49('0x74'),_0x4f49('0x75'),_0x4f49('0x76')];if(!_['isNil'](_0x5b88aa[_0x4f49('0x3c')][_0x4f49('0x6d')])&&_0x5b88aa[_0x4f49('0x3c')][_0x4f49('0x6d')]===_0x4f49('0x77')){_0x517144=['Type',_0x4f49('0x78'),_0x4f49('0x79'),'Status',_0x4f49('0x74'),'IsEscalated',_0x4f49('0x7a'),'SuppliedCompany'];}if(_0x1643fc){_[_0x4f49('0x7b')](_0x1643fc[_0x4f49('0x40')],function(_0x2ef19e){return _0x2ef19e[_0x4f49('0x7c')]===![]&&!_0x517144[_0x4f49('0x7d')](_0x2ef19e['name']);});return{'count':_0x1643fc[_0x4f49('0x40')][_0x4f49('0x41')],'rows':_[_0x4f49('0x35')](_0x1643fc[_0x4f49('0x40')],function(_0x4b7c61){return{'id':_0x4b7c61[_0x4f49('0x33')],'name':_0x4b7c61['label'],'custom':_0x4b7c61[_0x4f49('0x7c')],'options':_0x4b7c61['picklistValues'][_0x4f49('0x41')]>0x0?_[_0x4f49('0x35')](_0x4b7c61[_0x4f49('0x7e')],function(_0x34fca3){return{'name':_0x34fca3[_0x4f49('0x7f')],'value':_0x34fca3[_0x4f49('0x80')]};}):_0x4b7c61[_0x4f49('0x39')]==_0x4f49('0x81')?[{'name':_0x4f49('0x82'),'value':_0x4f49('0x83')},{'name':'False','value':_0x4f49('0x84')}]:[]};})};}})[_0x4f49('0x1e')](respondWithResult(_0x121972,null))[_0x4f49('0x4f')](function(_0x299849){var _0x302861=_0x5b88aa[_0x4f49('0x3c')]['test']?0x1f4:_0x299849[_0x4f49('0x85')]||0x1f4;logger[_0x4f49('0x22')](_0x4f49('0x86'),_0x4f49('0x61'),_0x302861,JSON['stringify'](_0x299849));delete _0x299849[_0x4f49('0x33')];if(_0x302861===0x191){_0x302861=0x190;}_0x121972['status'](_0x302861)[_0x4f49('0x34')](_0x5b88aa[_0x4f49('0x3c')][_0x4f49('0x1b')]?{'message':_0x4f49('0x87'),'statusCode':_0x299849['statusCode']}:_0x299849);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 0959bd7..cdc02e9 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 _0xee03=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xee03,0x1bc));var _0x3ee0=function(_0x363450,_0x10fb6d){_0x363450=_0x363450-0x0;var _0x33b1e1=_0xee03[_0x363450];return _0x33b1e1;};'use strict';var _=require('lodash');var util=require(_0x3ee0('0x0'));var logger=require(_0x3ee0('0x1'))(_0x3ee0('0x2'));var moment=require(_0x3ee0('0x3'));var BPromise=require(_0x3ee0('0x4'));var rp=require(_0x3ee0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ee0('0x6'));var config=require(_0x3ee0('0x7'));var attributes=require(_0x3ee0('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x3ee0('0x9')]=function(_0x44897d,_0x27513a){return _0x44897d[_0x3ee0('0xa')](_0x3ee0('0xb'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3360=['../../config/environment','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1fb385,_0x5ddc8f){var _0x140dc3=function(_0x373ea0){while(--_0x373ea0){_0x1fb385['push'](_0x1fb385['shift']());}};_0x140dc3(++_0x5ddc8f);}(_0x3360,0xbb));var _0x0336=function(_0x4b0a88,_0x2a4137){_0x4b0a88=_0x4b0a88-0x0;var _0x45e282=_0x3360[_0x4b0a88];return _0x45e282;};'use strict';var _=require(_0x0336('0x0'));var util=require(_0x0336('0x1'));var logger=require(_0x0336('0x2'))(_0x0336('0x3'));var moment=require(_0x0336('0x4'));var BPromise=require(_0x0336('0x5'));var rp=require(_0x0336('0x6'));var fs=require('fs');var path=require(_0x0336('0x7'));var rimraf=require(_0x0336('0x8'));var config=require(_0x0336('0x9'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0336('0xa')]=function(_0x22e12f,_0x65175c){return _0x22e12f[_0x0336('0xb')](_0x0336('0xc'),attributes,{'tableName':_0x0336('0xd'),'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 6887139..9e25b31 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 _0x6737=['options','raw','where','attributes','include','map','model','catch','ShowSalesforceAccount','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','GetSalesforceAccount','SalesforceAccount'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6737,0xe2));var _0x7673=function(_0x287cdb,_0x51c931){_0x287cdb=_0x287cdb-0x0;var _0x3a4a3e=_0x6737[_0x287cdb];return _0x3a4a3e;};'use strict';var _=require('lodash');var util=require(_0x7673('0x0'));var moment=require(_0x7673('0x1'));var BPromise=require('bluebird');var rs=require(_0x7673('0x2'));var fs=require('fs');var Redis=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];var utils=require(_0x7673('0x5'));var logger=require('../../config/logger')(_0x7673('0x6'));var config=require(_0x7673('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7673('0x8')][_0x7673('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af802,_0x4e4b24,_0x53d67d){return new BPromise(function(_0x5292f7,_0x285c6d){return client['request'](_0x5af802,_0x53d67d)[_0x7673('0xa')](function(_0x1fb769){logger['info'](_0x7673('0xb'),_0x4e4b24,_0x7673('0xc'));logger[_0x7673('0xd')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4e4b24,'request\x20sent',JSON[_0x7673('0xe')](_0x1fb769));if(_0x1fb769['error']){if(_0x1fb769[_0x7673('0xf')][_0x7673('0x10')]===0x1f4){logger[_0x7673('0xf')](_0x7673('0xb'),_0x4e4b24,_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);return _0x285c6d(_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);}logger[_0x7673('0xf')](_0x7673('0xb'),_0x4e4b24,_0x1fb769['error'][_0x7673('0x11')]);return _0x5292f7(_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);}else{logger[_0x7673('0x12')](_0x7673('0xb'),_0x4e4b24,_0x7673('0xc'));_0x5292f7(_0x1fb769[_0x7673('0x13')]['message']);}})['catch'](function(_0x164d05){logger[_0x7673('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x4e4b24,_0x164d05);_0x285c6d(_0x164d05);});});}exports[_0x7673('0x14')]=function(_0x17699a){var _0x58a821=this;return new Promise(function(_0x33ff7d,_0x44704d){return db[_0x7673('0x15')]['findAll']({'raw':_0x17699a['options']?_0x17699a[_0x7673('0x16')][_0x7673('0x17')]===undefined?!![]:![]:!![],'where':_0x17699a['options']?_0x17699a[_0x7673('0x16')][_0x7673('0x18')]||null:null,'attributes':_0x17699a[_0x7673('0x16')]?_0x17699a[_0x7673('0x16')][_0x7673('0x19')]||null:null,'limit':_0x17699a[_0x7673('0x16')]?_0x17699a['options']['limit']||null:null,'include':_0x17699a[_0x7673('0x16')]?_0x17699a[_0x7673('0x16')][_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x17699a[_0x7673('0x16')]['include'],function(_0x2009e1){return{'model':db[_0x2009e1[_0x7673('0x1c')]],'as':_0x2009e1['as'],'attributes':_0x2009e1[_0x7673('0x19')],'include':_0x2009e1[_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x2009e1[_0x7673('0x1a')],function(_0x538280){return{'model':db[_0x538280[_0x7673('0x1c')]],'as':_0x538280['as'],'attributes':_0x538280[_0x7673('0x19')],'include':_0x538280[_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x538280['include'],function(_0x5e2cd7){return{'model':db[_0x5e2cd7[_0x7673('0x1c')]],'as':_0x5e2cd7['as'],'attributes':_0x5e2cd7[_0x7673('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7673('0xa')](function(_0x9d9eab){logger[_0x7673('0x12')](_0x7673('0x14'),_0x17699a);logger[_0x7673('0xd')]('GetSalesforceAccount',_0x17699a,JSON['stringify'](_0x9d9eab));_0x33ff7d(_0x9d9eab);})[_0x7673('0x1d')](function(_0x2d4c0a){logger[_0x7673('0xf')](_0x7673('0x14'),_0x2d4c0a[_0x7673('0x11')],_0x17699a);_0x44704d(_0x58a821[_0x7673('0xf')](0x1f4,_0x2d4c0a[_0x7673('0x11')]));});});};exports['ShowSalesforceAccount']=function(_0x4fcacc){var _0xe7e528=this;return new Promise(function(_0x36c841,_0x268863){return db[_0x7673('0x15')]['find']({'raw':_0x4fcacc[_0x7673('0x16')]?_0x4fcacc['options'][_0x7673('0x17')]===undefined?!![]:![]:!![],'where':_0x4fcacc[_0x7673('0x16')]?_0x4fcacc[_0x7673('0x16')][_0x7673('0x18')]||null:null,'attributes':_0x4fcacc[_0x7673('0x16')]?_0x4fcacc[_0x7673('0x16')][_0x7673('0x19')]||null:null,'include':_0x4fcacc[_0x7673('0x16')]?_0x4fcacc[_0x7673('0x16')][_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x4fcacc[_0x7673('0x16')][_0x7673('0x1a')],function(_0x485b39){return{'model':db[_0x485b39[_0x7673('0x1c')]],'as':_0x485b39['as'],'attributes':_0x485b39[_0x7673('0x19')],'include':_0x485b39[_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x485b39[_0x7673('0x1a')],function(_0x7b2313){return{'model':db[_0x7b2313[_0x7673('0x1c')]],'as':_0x7b2313['as'],'attributes':_0x7b2313['attributes'],'include':_0x7b2313['include']?_[_0x7673('0x1b')](_0x7b2313[_0x7673('0x1a')],function(_0x2d34cb){return{'model':db[_0x2d34cb[_0x7673('0x1c')]],'as':_0x2d34cb['as'],'attributes':_0x2d34cb[_0x7673('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7673('0xa')](function(_0x159afd){logger['info'](_0x7673('0x1e'),_0x4fcacc);logger[_0x7673('0xd')]('ShowSalesforceAccount',_0x4fcacc,JSON[_0x7673('0xe')](_0x159afd));_0x36c841(_0x159afd);})[_0x7673('0x1d')](function(_0x287eee){logger[_0x7673('0xf')]('ShowSalesforceAccount',_0x287eee[_0x7673('0x11')],_0x4fcacc);_0x268863(_0xe7e528[_0x7673('0xf')](0x1f4,_0x287eee['message']));});});}; \ No newline at end of file +var _0x5ff3=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','attributes','limit','include','map','model','ShowSalesforceAccount','raw','util','bluebird','ioredis'];(function(_0xe63472,_0x5ac604){var _0x1bfa86=function(_0x56c080){while(--_0x56c080){_0xe63472['push'](_0xe63472['shift']());}};_0x1bfa86(++_0x5ac604);}(_0x5ff3,0x17d));var _0x35ff=function(_0x3cac2a,_0x3be23d){_0x3cac2a=_0x3cac2a-0x0;var _0x3b249b=_0x5ff3[_0x3cac2a];return _0x3b249b;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var moment=require('moment');var BPromise=require(_0x35ff('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ff('0x2'));var db=require(_0x35ff('0x3'))['db'];var utils=require(_0x35ff('0x4'));var logger=require(_0x35ff('0x5'))('rpc');var config=require(_0x35ff('0x6'));var jayson=require(_0x35ff('0x7'));var client=jayson[_0x35ff('0x8')][_0x35ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30c3ff,_0x495c31,_0x92b403){return new BPromise(function(_0x4c9fab,_0x2e7470){return client[_0x35ff('0xa')](_0x30c3ff,_0x92b403)[_0x35ff('0xb')](function(_0x51967a){logger[_0x35ff('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x495c31,_0x35ff('0xd'));logger[_0x35ff('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x495c31,'request\x20sent',JSON[_0x35ff('0xf')](_0x51967a));if(_0x51967a['error']){if(_0x51967a['error']['code']===0x1f4){logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x51967a[_0x35ff('0x10')][_0x35ff('0x12')]);return _0x2e7470(_0x51967a['error'][_0x35ff('0x12')]);}logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x51967a['error'][_0x35ff('0x12')]);return _0x4c9fab(_0x51967a[_0x35ff('0x10')][_0x35ff('0x12')]);}else{logger[_0x35ff('0xc')](_0x35ff('0x11'),_0x495c31,_0x35ff('0xd'));_0x4c9fab(_0x51967a[_0x35ff('0x13')][_0x35ff('0x12')]);}})[_0x35ff('0x14')](function(_0x2f3456){logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x2f3456);_0x2e7470(_0x2f3456);});});}exports[_0x35ff('0x15')]=function(_0x16c803){var _0x186f6a=this;return new Promise(function(_0x5f470e,_0x2404e5){return db[_0x35ff('0x16')][_0x35ff('0x17')]({'raw':_0x16c803[_0x35ff('0x18')]?_0x16c803['options']['raw']===undefined?!![]:![]:!![],'where':_0x16c803[_0x35ff('0x18')]?_0x16c803[_0x35ff('0x18')]['where']||null:null,'attributes':_0x16c803[_0x35ff('0x18')]?_0x16c803[_0x35ff('0x18')][_0x35ff('0x19')]||null:null,'limit':_0x16c803[_0x35ff('0x18')]?_0x16c803['options'][_0x35ff('0x1a')]||null:null,'include':_0x16c803['options']?_0x16c803[_0x35ff('0x18')][_0x35ff('0x1b')]?_[_0x35ff('0x1c')](_0x16c803[_0x35ff('0x18')][_0x35ff('0x1b')],function(_0x2b3782){return{'model':db[_0x2b3782[_0x35ff('0x1d')]],'as':_0x2b3782['as'],'attributes':_0x2b3782['attributes'],'include':_0x2b3782[_0x35ff('0x1b')]?_[_0x35ff('0x1c')](_0x2b3782['include'],function(_0x426e4e){return{'model':db[_0x426e4e['model']],'as':_0x426e4e['as'],'attributes':_0x426e4e['attributes'],'include':_0x426e4e[_0x35ff('0x1b')]?_[_0x35ff('0x1c')](_0x426e4e[_0x35ff('0x1b')],function(_0x11a5eb){return{'model':db[_0x11a5eb[_0x35ff('0x1d')]],'as':_0x11a5eb['as'],'attributes':_0x11a5eb['attributes']};}):[]};}):[]};}):[]:[]})[_0x35ff('0xb')](function(_0x412873){logger[_0x35ff('0xc')]('GetSalesforceAccount',_0x16c803);logger[_0x35ff('0xe')](_0x35ff('0x15'),_0x16c803,JSON[_0x35ff('0xf')](_0x412873));_0x5f470e(_0x412873);})[_0x35ff('0x14')](function(_0x47fcb5){logger[_0x35ff('0x10')](_0x35ff('0x15'),_0x47fcb5[_0x35ff('0x12')],_0x16c803);_0x2404e5(_0x186f6a[_0x35ff('0x10')](0x1f4,_0x47fcb5['message']));});});};exports[_0x35ff('0x1e')]=function(_0x57339d){var _0x1cb370=this;return new Promise(function(_0x257501,_0x2bc118){return db[_0x35ff('0x16')]['find']({'raw':_0x57339d[_0x35ff('0x18')]?_0x57339d['options'][_0x35ff('0x1f')]===undefined?!![]:![]:!![],'where':_0x57339d[_0x35ff('0x18')]?_0x57339d['options']['where']||null:null,'attributes':_0x57339d[_0x35ff('0x18')]?_0x57339d[_0x35ff('0x18')]['attributes']||null:null,'include':_0x57339d[_0x35ff('0x18')]?_0x57339d[_0x35ff('0x18')]['include']?_[_0x35ff('0x1c')](_0x57339d[_0x35ff('0x18')][_0x35ff('0x1b')],function(_0x2727c3){return{'model':db[_0x2727c3[_0x35ff('0x1d')]],'as':_0x2727c3['as'],'attributes':_0x2727c3[_0x35ff('0x19')],'include':_0x2727c3[_0x35ff('0x1b')]?_[_0x35ff('0x1c')](_0x2727c3[_0x35ff('0x1b')],function(_0x1a5c81){return{'model':db[_0x1a5c81[_0x35ff('0x1d')]],'as':_0x1a5c81['as'],'attributes':_0x1a5c81[_0x35ff('0x19')],'include':_0x1a5c81[_0x35ff('0x1b')]?_['map'](_0x1a5c81[_0x35ff('0x1b')],function(_0x5c5dcb){return{'model':db[_0x5c5dcb[_0x35ff('0x1d')]],'as':_0x5c5dcb['as'],'attributes':_0x5c5dcb[_0x35ff('0x19')]};}):[]};}):[]};}):[]:[]})[_0x35ff('0xb')](function(_0x11115d){logger[_0x35ff('0xc')]('ShowSalesforceAccount',_0x57339d);logger[_0x35ff('0xe')](_0x35ff('0x1e'),_0x57339d,JSON[_0x35ff('0xf')](_0x11115d));_0x257501(_0x11115d);})[_0x35ff('0x14')](function(_0x324f6c){logger['error'](_0x35ff('0x1e'),_0x324f6c[_0x35ff('0x12')],_0x57339d);_0x2bc118(_0x1cb370[_0x35ff('0x10')](0x1f4,_0x324f6c['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index aa1def1..5e26ca2 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 _0xb590=['./intSalesforceConfiguration.controller','get','/:id','show','/:id/fields','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','multer','path','express','../../components/auth/service','../../config/environment'];(function(_0x685fbc,_0x2185c4){var _0x1b3e67=function(_0x24b801){while(--_0x24b801){_0x685fbc['push'](_0x685fbc['shift']());}};_0x1b3e67(++_0x2185c4);}(_0xb590,0x1b3));var _0x0b59=function(_0x222a7a,_0x15e945){_0x222a7a=_0x222a7a-0x0;var _0x27b78f=_0xb590[_0x222a7a];return _0x27b78f;};'use strict';var multer=require(_0x0b59('0x0'));var util=require('util');var path=require(_0x0b59('0x1'));var timeout=require('connect-timeout');var express=require(_0x0b59('0x2'));var router=express['Router']();var auth=require(_0x0b59('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0b59('0x4'));var controller=require(_0x0b59('0x5'));router[_0x0b59('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0b59('0x7'),auth['isAuthenticated'](),controller[_0x0b59('0x8')]);router[_0x0b59('0x6')](_0x0b59('0x9'),auth[_0x0b59('0xa')](),controller['getFields']);router[_0x0b59('0x6')](_0x0b59('0xb'),auth['isAuthenticated'](),controller[_0x0b59('0xc')]);router[_0x0b59('0x6')](_0x0b59('0xd'),auth[_0x0b59('0xa')](),controller[_0x0b59('0xe')]);router[_0x0b59('0xf')]('/',auth[_0x0b59('0xa')](),controller[_0x0b59('0x10')]);router[_0x0b59('0x11')](_0x0b59('0x7'),auth[_0x0b59('0xa')](),controller[_0x0b59('0x12')]);router['delete'](_0x0b59('0x7'),auth['isAuthenticated'](),controller[_0x0b59('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7e65=['index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','update','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','isAuthenticated'];(function(_0x215a9e,_0x55ac5e){var _0x44240e=function(_0x2de815){while(--_0x2de815){_0x215a9e['push'](_0x215a9e['shift']());}};_0x44240e(++_0x55ac5e);}(_0x7e65,0x15d));var _0x57e6=function(_0xa247b,_0xbc0794){_0xa247b=_0xa247b-0x0;var _0x3583fb=_0x7e65[_0xa247b];return _0x3583fb;};'use strict';var multer=require(_0x57e6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x57e6('0x1'));var router=express[_0x57e6('0x2')]();var auth=require(_0x57e6('0x3'));var interaction=require(_0x57e6('0x4'));var config=require('../../config/environment');var controller=require(_0x57e6('0x5'));router[_0x57e6('0x6')]('/',auth[_0x57e6('0x7')](),controller[_0x57e6('0x8')]);router[_0x57e6('0x6')](_0x57e6('0x9'),auth[_0x57e6('0x7')](),controller[_0x57e6('0xa')]);router[_0x57e6('0x6')](_0x57e6('0xb'),auth[_0x57e6('0x7')](),controller[_0x57e6('0xc')]);router[_0x57e6('0x6')]('/:id/subjects',auth[_0x57e6('0x7')](),controller[_0x57e6('0xd')]);router[_0x57e6('0x6')](_0x57e6('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x57e6('0xf')]('/',auth[_0x57e6('0x7')](),controller[_0x57e6('0x10')]);router['put'](_0x57e6('0x9'),auth[_0x57e6('0x7')](),controller[_0x57e6('0x11')]);router[_0x57e6('0x12')](_0x57e6('0x9'),auth['isAuthenticated'](),controller[_0x57e6('0x13')]);module[_0x57e6('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 9dc00db..7d0dd15 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 _0x3032=['STRING','ENUM','Task','Case','contact_lead','contact','lead','sequelize','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3032,0x166));var _0x2303=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3032[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2303('0x0'));module[_0x2303('0x1')]={'name':{'type':Sequelize[_0x2303('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x2303('0x3')](_0x2303('0x4'),_0x2303('0x5')),'defaultValue':_0x2303('0x4')},'moduleSearch':{'type':Sequelize[_0x2303('0x3')](_0x2303('0x6'),_0x2303('0x7'),_0x2303('0x8')),'defaultValue':_0x2303('0x6')},'moduleCreate':{'type':Sequelize[_0x2303('0x3')]('nothing',_0x2303('0x7'),'lead'),'defaultValue':_0x2303('0x8')}}; \ No newline at end of file +var _0x9f1f=['lead','sequelize','exports','STRING','ENUM','Task','Case','contact','contact_lead'];(function(_0x36d587,_0x4a8054){var _0x462e1f=function(_0x3a1974){while(--_0x3a1974){_0x36d587['push'](_0x36d587['shift']());}};_0x462e1f(++_0x4a8054);}(_0x9f1f,0xb5));var _0xf9f1=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x9f1f[_0x5a9c0c];return _0x53c77d;};'use strict';var Sequelize=require(_0xf9f1('0x0'));module[_0xf9f1('0x1')]={'name':{'type':Sequelize[_0xf9f1('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xf9f1('0x3')](_0xf9f1('0x4'),_0xf9f1('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0xf9f1('0x6'),'lead'),'defaultValue':_0xf9f1('0x7')},'moduleCreate':{'type':Sequelize[_0xf9f1('0x3')]('nothing','contact','lead'),'defaultValue':_0xf9f1('0x8')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index e9b0b2e..09ca386 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 _0x94c0=['merge','includeAll','include','findAll','rows','show','params','length','options','create','body','find','findOne','SalesforceField','getFields','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','send','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x94c0,0xcd));var _0x094c=function(_0x22da61,_0x237ba9){_0x22da61=_0x22da61-0x0;var _0x40b728=_0x94c0[_0x22da61];return _0x40b728;};'use strict';var pdf=require(_0x094c('0x0'));var emlformat=require(_0x094c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x094c('0x2'));var jsonpatch=require(_0x094c('0x3'));var rp=require(_0x094c('0x4'));var moment=require(_0x094c('0x5'));var BPromise=require(_0x094c('0x6'));var Mustache=require('mustache');var util=require(_0x094c('0x7'));var path=require(_0x094c('0x8'));var sox=require(_0x094c('0x9'));var csv=require(_0x094c('0xa'));var ejs=require(_0x094c('0xb'));var fs=require('fs');var _=require(_0x094c('0xc'));var squel=require('squel');var crypto=require(_0x094c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x094c('0xe'));var toCsv=require(_0x094c('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x094c('0xf'));var authService=require(_0x094c('0x10'));var qs=require(_0x094c('0x11'));var as=require(_0x094c('0x12'));var hardwareService=require(_0x094c('0x13'));var logger=require(_0x094c('0x14'))(_0x094c('0x15'));var utils=require(_0x094c('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x094c('0x17'));var client=jayson[_0x094c('0x18')][_0x094c('0x19')]({'port':0x232a});function checkPasswordPattern(_0x1e8048,_0x3ccd99,_0x2de4b3){if(_0x2de4b3){var _0x378269=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x378269['test'](_0x3ccd99)){return _0x1e8048;}else{throw new db[(_0x094c('0x1a'))][(_0x094c('0x1b'))](_0x094c('0x1c'));}}else{return _0x1e8048;}}function respondWithRpcPromise(_0x1b9157,_0x9e0fcf,_0x4e7e06,_0x5c3bc1){return new BPromise(function(_0x45fb57,_0x2e7188){var _0xb09c75=_0x5c3bc1||client;return _0xb09c75[_0x094c('0x1d')](_0x1b9157,_0x4e7e06)[_0x094c('0x1e')](function(_0x1ccdb4){logger[_0x094c('0x1f')]('SalesforceConfiguration,\x20%s,\x20%s',_0x9e0fcf,'request\x20sent');logger['debug'](_0x094c('0x20'),_0x9e0fcf,_0x094c('0x21'),JSON[_0x094c('0x22')](_0x1ccdb4));if(_0x1ccdb4[_0x094c('0x23')]){if(_0x1ccdb4['error'][_0x094c('0x24')]===0x1f4){logger[_0x094c('0x23')](_0x094c('0x25'),_0x9e0fcf,_0x1ccdb4['error'][_0x094c('0x26')]);return _0x2e7188(_0x1ccdb4[_0x094c('0x23')][_0x094c('0x26')]);}logger[_0x094c('0x23')]('SalesforceConfiguration,\x20%s,\x20%s',_0x9e0fcf,_0x1ccdb4[_0x094c('0x23')]['message']);return _0x45fb57(_0x1ccdb4[_0x094c('0x23')][_0x094c('0x26')]);}else{logger[_0x094c('0x1f')](_0x094c('0x25'),_0x9e0fcf,'request\x20sent');_0x45fb57(_0x1ccdb4[_0x094c('0x27')][_0x094c('0x26')]);}})[_0x094c('0x28')](function(_0x1767ab){logger['error'](_0x094c('0x25'),_0x9e0fcf,_0x1767ab);_0x2e7188(_0x1767ab);});});}function respondWithStatusCode(_0x414006,_0x4d992d){_0x4d992d=_0x4d992d||0xcc;return function(_0xf679d){if(_0xf679d){return _0x414006[_0x094c('0x29')](_0x4d992d);}return _0x414006[_0x094c('0x2a')](_0x4d992d)[_0x094c('0x2b')]();};}function respondWithResult(_0x3aaa4b,_0x3aa4cf){_0x3aa4cf=_0x3aa4cf||0xc8;return function(_0x480cf5){if(_0x480cf5){return _0x3aaa4b['status'](_0x3aa4cf)[_0x094c('0x2c')](_0x480cf5);}};}function respondWithFilteredResult(_0x36277c,_0x37fbf2){return function(_0x2cb979){if(_0x2cb979){var _0xf029b7=_0x2cb979[_0x094c('0x2d')],_0xfd6bc9=_0x37fbf2[_0x094c('0x2e')],_0x59bac7=_0x37fbf2['offset']+_0x37fbf2[_0x094c('0x2f')],_0x8cce33;if(_0x59bac7>=_0xf029b7){_0x59bac7=_0xf029b7;_0x8cce33=0xc8;}else{_0x8cce33=0xce;}_0x36277c[_0x094c('0x2a')](_0x8cce33);return _0x36277c[_0x094c('0x30')](_0x094c('0x31'),_0xfd6bc9+'-'+_0x59bac7+'/'+_0xf029b7)['json'](_0x2cb979);}return null;};}function patchUpdates(_0x2a1ede){return function(_0x2fec0e){try{jsonpatch[_0x094c('0x32')](_0x2fec0e,_0x2a1ede,!![]);}catch(_0x4167d9){return BPromise[_0x094c('0x33')](_0x4167d9);}return _0x2fec0e['save']();};}function saveUpdates(_0x4c584f,_0x499a21){return function(_0x50e71a){if(_0x50e71a){return _0x50e71a[_0x094c('0x34')](_0x4c584f)[_0x094c('0x1e')](function(_0x19aa3c){return _0x19aa3c;});}return null;};}function removeEntity(_0x3f02f5,_0x5c3d04){return function(_0x3f46b0){if(_0x3f46b0){return _0x3f46b0[_0x094c('0x35')]()[_0x094c('0x1e')](function(){_0x3f02f5[_0x094c('0x2a')](0xcc)[_0x094c('0x2b')]();});}};}function handleEntityNotFound(_0x3b7910,_0xe1edba){return function(_0x326f17){if(!_0x326f17){_0x3b7910['sendStatus'](0x194);}return _0x326f17;};}function handleError(_0x4fa694,_0x4fc6de){_0x4fc6de=_0x4fc6de||0x1f4;return function(_0x14299e){logger[_0x094c('0x23')](_0x14299e[_0x094c('0x36')]);if(_0x14299e[_0x094c('0x37')]){delete _0x14299e['name'];}_0x4fa694[_0x094c('0x2a')](_0x4fc6de)[_0x094c('0x38')](_0x14299e);};}exports['index']=function(_0x1d8bb1,_0x1f42a7){var _0x25d5f7={},_0x167a56={},_0x34c968={'count':0x0,'rows':[]};var _0x3512b5=_['map'](db[_0x094c('0x39')][_0x094c('0x3a')],function(_0x19b4ce){return{'name':_0x19b4ce[_0x094c('0x3b')],'type':_0x19b4ce[_0x094c('0x3c')][_0x094c('0x3d')]};});_0x167a56[_0x094c('0x3e')]=_[_0x094c('0x3f')](_0x3512b5,_0x094c('0x37'));_0x167a56[_0x094c('0x40')]=_[_0x094c('0x41')](_0x1d8bb1['query']);_0x167a56[_0x094c('0x42')]=_[_0x094c('0x43')](_0x167a56[_0x094c('0x3e')],_0x167a56[_0x094c('0x40')]);_0x25d5f7[_0x094c('0x44')]=_[_0x094c('0x43')](_0x167a56[_0x094c('0x3e')],qs[_0x094c('0x45')](_0x1d8bb1['query'][_0x094c('0x45')]));_0x25d5f7[_0x094c('0x44')]=_0x25d5f7[_0x094c('0x44')]['length']?_0x25d5f7['attributes']:_0x167a56[_0x094c('0x3e')];if(!_0x1d8bb1[_0x094c('0x40')][_0x094c('0x46')](_0x094c('0x47'))){_0x25d5f7[_0x094c('0x2f')]=qs[_0x094c('0x2f')](_0x1d8bb1[_0x094c('0x40')][_0x094c('0x2f')]);_0x25d5f7[_0x094c('0x2e')]=qs[_0x094c('0x2e')](_0x1d8bb1['query'][_0x094c('0x2e')]);}_0x25d5f7[_0x094c('0x48')]=qs[_0x094c('0x49')](_0x1d8bb1['query'][_0x094c('0x49')]);_0x25d5f7[_0x094c('0x4a')]=qs[_0x094c('0x42')](_[_0x094c('0x4b')](_0x1d8bb1[_0x094c('0x40')],_0x167a56[_0x094c('0x42')]));if(_0x1d8bb1[_0x094c('0x40')][_0x094c('0x4c')]){_0x25d5f7['where']=_[_0x094c('0x4d')](_0x25d5f7[_0x094c('0x4a')],{'$or':_[_0x094c('0x3f')](_0x3512b5,function(_0x1219fb){if(_0x1219fb[_0x094c('0x3c')]!=='VIRTUAL'){var _0x4e4581={};_0x4e4581[_0x1219fb['name']]={'$like':'%'+_0x1d8bb1[_0x094c('0x40')]['filter']+'%'};return _0x4e4581;}})});}_0x25d5f7=_[_0x094c('0x4d')]({},_0x25d5f7,_0x1d8bb1['options']);var _0x261748={'where':_0x25d5f7['where']};return db['SalesforceConfiguration'][_0x094c('0x2d')](_0x261748)[_0x094c('0x1e')](function(_0x55a40f){_0x34c968['count']=_0x55a40f;if(_0x1d8bb1['query'][_0x094c('0x4e')]){_0x25d5f7[_0x094c('0x4f')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x094c('0x50')](_0x25d5f7);})['then'](function(_0x3e5a17){_0x34c968[_0x094c('0x51')]=_0x3e5a17;return _0x34c968;})[_0x094c('0x1e')](respondWithFilteredResult(_0x1f42a7,_0x25d5f7))['catch'](handleError(_0x1f42a7,null));};exports[_0x094c('0x52')]=function(_0x17883e,_0x117c26){var _0xee1d8d={'raw':![],'where':{'id':_0x17883e[_0x094c('0x53')]['id']}},_0xde8d55={};_0xde8d55['model']=_[_0x094c('0x41')](db['SalesforceConfiguration'][_0x094c('0x3a')]);_0xde8d55[_0x094c('0x40')]=_['keys'](_0x17883e['query']);_0xde8d55['filters']=_[_0x094c('0x43')](_0xde8d55['model'],_0xde8d55[_0x094c('0x40')]);_0xee1d8d['attributes']=_[_0x094c('0x43')](_0xde8d55[_0x094c('0x3e')],qs[_0x094c('0x45')](_0x17883e['query'][_0x094c('0x45')]));_0xee1d8d['attributes']=_0xee1d8d[_0x094c('0x44')][_0x094c('0x54')]?_0xee1d8d[_0x094c('0x44')]:_0xde8d55[_0x094c('0x3e')];if(_0x17883e[_0x094c('0x40')][_0x094c('0x4e')]){_0xee1d8d[_0x094c('0x4f')]=[{'all':!![]}];}_0xee1d8d=_[_0x094c('0x4d')]({},_0xee1d8d,_0x17883e[_0x094c('0x55')]);return db[_0x094c('0x39')]['find'](_0xee1d8d)['then'](handleEntityNotFound(_0x117c26,null))[_0x094c('0x1e')](respondWithResult(_0x117c26,null))[_0x094c('0x28')](handleError(_0x117c26,null));};exports[_0x094c('0x56')]=function(_0x167bb7,_0x457ec5){return db['SalesforceConfiguration'][_0x094c('0x56')](_0x167bb7[_0x094c('0x57')],{})[_0x094c('0x1e')](respondWithResult(_0x457ec5,0xc9))[_0x094c('0x28')](handleError(_0x457ec5,null));};exports[_0x094c('0x34')]=function(_0x4b0710,_0x193f0c){if(_0x4b0710[_0x094c('0x57')]['id']){delete _0x4b0710[_0x094c('0x57')]['id'];}return db['SalesforceConfiguration'][_0x094c('0x58')]({'where':{'id':_0x4b0710[_0x094c('0x53')]['id']}})[_0x094c('0x1e')](handleEntityNotFound(_0x193f0c,null))[_0x094c('0x1e')](saveUpdates(_0x4b0710[_0x094c('0x57')],null))[_0x094c('0x1e')](respondWithResult(_0x193f0c,null))[_0x094c('0x28')](handleError(_0x193f0c,null));};exports[_0x094c('0x35')]=function(_0x42caeb,_0x3b798c){return db[_0x094c('0x39')][_0x094c('0x58')]({'where':{'id':_0x42caeb[_0x094c('0x53')]['id']}})[_0x094c('0x1e')](handleEntityNotFound(_0x3b798c,null))[_0x094c('0x1e')](removeEntity(_0x3b798c,null))['catch'](handleError(_0x3b798c,null));};exports['getFields']=function(_0x386708,_0x12ecee,_0x18c84b){var _0x5aca09={};var _0x104cf0={};var _0x34b6e9;var _0x3d1dae;return db[_0x094c('0x39')][_0x094c('0x59')]({'where':{'id':_0x386708[_0x094c('0x53')]['id']}})['then'](handleEntityNotFound(_0x12ecee,null))[_0x094c('0x1e')](function(_0x5ec367){if(_0x5ec367){_0x34b6e9=_0x5ec367;_0x104cf0[_0x094c('0x3e')]=_[_0x094c('0x41')](db[_0x094c('0x5a')]['rawAttributes']);_0x104cf0[_0x094c('0x40')]=_[_0x094c('0x41')](_0x386708[_0x094c('0x40')]);_0x104cf0[_0x094c('0x42')]=_[_0x094c('0x43')](_0x104cf0['model'],_0x104cf0['query']);_0x5aca09[_0x094c('0x44')]=_[_0x094c('0x43')](_0x104cf0[_0x094c('0x3e')],qs[_0x094c('0x45')](_0x386708[_0x094c('0x40')][_0x094c('0x45')]));_0x5aca09[_0x094c('0x44')]=_0x5aca09[_0x094c('0x44')][_0x094c('0x54')]?_0x5aca09[_0x094c('0x44')]:_0x104cf0['model'];_0x5aca09[_0x094c('0x48')]=qs[_0x094c('0x49')](_0x386708[_0x094c('0x40')]['sort']);_0x5aca09[_0x094c('0x4a')]=qs[_0x094c('0x42')](_['pick'](_0x386708[_0x094c('0x40')],_0x104cf0[_0x094c('0x42')]));if(_0x386708[_0x094c('0x40')][_0x094c('0x4c')]){_0x5aca09['where']=_[_0x094c('0x4d')](_0x5aca09[_0x094c('0x4a')],{'$or':_[_0x094c('0x3f')](_0x5aca09[_0x094c('0x44')],function(_0x5a0e5c){var _0x307085={};_0x307085[_0x5a0e5c]={'$like':'%'+_0x386708[_0x094c('0x40')][_0x094c('0x4c')]+'%'};return _0x307085;})});}_0x5aca09=_[_0x094c('0x4d')]({},_0x5aca09,_0x386708['options']);return _0x34b6e9['getFields'](_0x5aca09);}})['then'](function(_0x16c9f2){if(_0x16c9f2){_0x3d1dae=_0x16c9f2['length'];if(!_0x386708[_0x094c('0x40')]['hasOwnProperty']('nolimit')){_0x5aca09[_0x094c('0x2f')]=qs[_0x094c('0x2f')](_0x386708[_0x094c('0x40')]['limit']);_0x5aca09[_0x094c('0x2e')]=qs[_0x094c('0x2e')](_0x386708[_0x094c('0x40')][_0x094c('0x2e')]);}return _0x34b6e9[_0x094c('0x5b')](_0x5aca09);}})[_0x094c('0x1e')](function(_0x3212da){if(_0x3212da){return _0x3212da?{'count':_0x3d1dae,'rows':_0x3212da}:null;}})[_0x094c('0x1e')](respondWithResult(_0x12ecee,null))['catch'](handleError(_0x12ecee,null));};exports[_0x094c('0x5c')]=function(_0x2a73f8,_0x51e952,_0x4b3862){var _0x14b05c={};var _0x1419ef={};var _0x15fcde;var _0x1be4d9;return db[_0x094c('0x39')][_0x094c('0x59')]({'where':{'id':_0x2a73f8[_0x094c('0x53')]['id']}})[_0x094c('0x1e')](handleEntityNotFound(_0x51e952,null))[_0x094c('0x1e')](function(_0x2480ab){if(_0x2480ab){_0x15fcde=_0x2480ab;_0x1419ef[_0x094c('0x3e')]=_[_0x094c('0x41')](db[_0x094c('0x5a')][_0x094c('0x3a')]);_0x1419ef[_0x094c('0x40')]=_['keys'](_0x2a73f8['query']);_0x1419ef[_0x094c('0x42')]=_[_0x094c('0x43')](_0x1419ef[_0x094c('0x3e')],_0x1419ef[_0x094c('0x40')]);_0x14b05c[_0x094c('0x44')]=_[_0x094c('0x43')](_0x1419ef[_0x094c('0x3e')],qs[_0x094c('0x45')](_0x2a73f8[_0x094c('0x40')]['fields']));_0x14b05c[_0x094c('0x44')]=_0x14b05c[_0x094c('0x44')][_0x094c('0x54')]?_0x14b05c[_0x094c('0x44')]:_0x1419ef[_0x094c('0x3e')];_0x14b05c[_0x094c('0x48')]=qs['sort'](_0x2a73f8[_0x094c('0x40')]['sort']);_0x14b05c[_0x094c('0x4a')]=qs['filters'](_[_0x094c('0x4b')](_0x2a73f8[_0x094c('0x40')],_0x1419ef['filters']));if(_0x2a73f8[_0x094c('0x40')][_0x094c('0x4c')]){_0x14b05c[_0x094c('0x4a')]=_[_0x094c('0x4d')](_0x14b05c[_0x094c('0x4a')],{'$or':_['map'](_0x14b05c[_0x094c('0x44')],function(_0x5d1a94){var _0x11ce54={};_0x11ce54[_0x5d1a94]={'$like':'%'+_0x2a73f8[_0x094c('0x40')][_0x094c('0x4c')]+'%'};return _0x11ce54;})});}_0x14b05c=_['merge']({},_0x14b05c,_0x2a73f8[_0x094c('0x55')]);return _0x15fcde[_0x094c('0x5c')](_0x14b05c);}})[_0x094c('0x1e')](function(_0x31cd43){if(_0x31cd43){_0x1be4d9=_0x31cd43[_0x094c('0x54')];if(!_0x2a73f8[_0x094c('0x40')][_0x094c('0x46')](_0x094c('0x47'))){_0x14b05c[_0x094c('0x2f')]=qs[_0x094c('0x2f')](_0x2a73f8[_0x094c('0x40')]['limit']);_0x14b05c[_0x094c('0x2e')]=qs['offset'](_0x2a73f8[_0x094c('0x40')]['offset']);}return _0x15fcde[_0x094c('0x5c')](_0x14b05c);}})[_0x094c('0x1e')](function(_0x4c224a){if(_0x4c224a){return _0x4c224a?{'count':_0x1be4d9,'rows':_0x4c224a}:null;}})[_0x094c('0x1e')](respondWithResult(_0x51e952,null))[_0x094c('0x28')](handleError(_0x51e952,null));};exports[_0x094c('0x5d')]=function(_0x1d5d4a,_0xd68480,_0x424380){var _0x65a1c0={};var _0x47cd36={};var _0x3f6bbd;var _0x4a7b42;return db['SalesforceConfiguration'][_0x094c('0x59')]({'where':{'id':_0x1d5d4a[_0x094c('0x53')]['id']}})[_0x094c('0x1e')](handleEntityNotFound(_0xd68480,null))[_0x094c('0x1e')](function(_0xacd483){if(_0xacd483){_0x3f6bbd=_0xacd483;_0x47cd36[_0x094c('0x3e')]=_[_0x094c('0x41')](db[_0x094c('0x5a')][_0x094c('0x3a')]);_0x47cd36[_0x094c('0x40')]=_['keys'](_0x1d5d4a[_0x094c('0x40')]);_0x47cd36[_0x094c('0x42')]=_[_0x094c('0x43')](_0x47cd36[_0x094c('0x3e')],_0x47cd36[_0x094c('0x40')]);_0x65a1c0[_0x094c('0x44')]=_[_0x094c('0x43')](_0x47cd36[_0x094c('0x3e')],qs[_0x094c('0x45')](_0x1d5d4a[_0x094c('0x40')][_0x094c('0x45')]));_0x65a1c0[_0x094c('0x44')]=_0x65a1c0['attributes'][_0x094c('0x54')]?_0x65a1c0[_0x094c('0x44')]:_0x47cd36[_0x094c('0x3e')];_0x65a1c0[_0x094c('0x48')]=qs[_0x094c('0x49')](_0x1d5d4a[_0x094c('0x40')][_0x094c('0x49')]);_0x65a1c0[_0x094c('0x4a')]=qs[_0x094c('0x42')](_['pick'](_0x1d5d4a[_0x094c('0x40')],_0x47cd36['filters']));if(_0x1d5d4a[_0x094c('0x40')][_0x094c('0x4c')]){_0x65a1c0[_0x094c('0x4a')]=_['merge'](_0x65a1c0['where'],{'$or':_[_0x094c('0x3f')](_0x65a1c0[_0x094c('0x44')],function(_0x570008){var _0x52d816={};_0x52d816[_0x570008]={'$like':'%'+_0x1d5d4a[_0x094c('0x40')][_0x094c('0x4c')]+'%'};return _0x52d816;})});}_0x65a1c0=_['merge']({},_0x65a1c0,_0x1d5d4a[_0x094c('0x55')]);return _0x3f6bbd[_0x094c('0x5d')](_0x65a1c0);}})[_0x094c('0x1e')](function(_0x2dfabc){if(_0x2dfabc){_0x4a7b42=_0x2dfabc[_0x094c('0x54')];if(!_0x1d5d4a['query'][_0x094c('0x46')]('nolimit')){_0x65a1c0[_0x094c('0x2f')]=qs['limit'](_0x1d5d4a[_0x094c('0x40')][_0x094c('0x2f')]);_0x65a1c0[_0x094c('0x2e')]=qs[_0x094c('0x2e')](_0x1d5d4a[_0x094c('0x40')][_0x094c('0x2e')]);}return _0x3f6bbd[_0x094c('0x5d')](_0x65a1c0);}})[_0x094c('0x1e')](function(_0x48e968){if(_0x48e968){return _0x48e968?{'count':_0x4a7b42,'rows':_0x48e968}:null;}})[_0x094c('0x1e')](respondWithResult(_0xd68480,null))['catch'](handleError(_0xd68480,null));}; \ No newline at end of file +var _0x9c71=['fieldName','type','key','model','keys','filters','fields','query','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','count','SalesforceConfiguration','findAll','rows','params','intersection','length','includeAll','include','find','body','SalesforceField','options','getFields','getSubjects','findOne','map','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','SalesforceConfiguration,\x20%s,\x20%s','result','catch','status','end','offset','limit','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','index','rawAttributes'];(function(_0x368693,_0x4d18c1){var _0x469b80=function(_0x3026d6){while(--_0x3026d6){_0x368693['push'](_0x368693['shift']());}};_0x469b80(++_0x4d18c1);}(_0x9c71,0x1e5));var _0x19c7=function(_0x4c91cb,_0x5b71c7){_0x4c91cb=_0x4c91cb-0x0;var _0x12c652=_0x9c71[_0x4c91cb];return _0x12c652;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x19c7('0x0'));var rimraf=require(_0x19c7('0x1'));var zipdir=require(_0x19c7('0x2'));var jsonpatch=require(_0x19c7('0x3'));var rp=require('request-promise');var moment=require(_0x19c7('0x4'));var BPromise=require(_0x19c7('0x5'));var Mustache=require(_0x19c7('0x6'));var util=require(_0x19c7('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x19c7('0x8'));var ejs=require(_0x19c7('0x9'));var fs=require('fs');var _=require(_0x19c7('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x19c7('0xb'));var toCsv=require(_0x19c7('0x8'));var querystring=require(_0x19c7('0xc'));var Papa=require(_0x19c7('0xd'));var Redis=require('ioredis');var authService=require(_0x19c7('0xe'));var qs=require(_0x19c7('0xf'));var as=require(_0x19c7('0x10'));var hardwareService=require(_0x19c7('0x11'));var logger=require(_0x19c7('0x12'))(_0x19c7('0x13'));var utils=require(_0x19c7('0x14'));var config=require(_0x19c7('0x15'));var db=require(_0x19c7('0x16'))['db'];var jayson=require(_0x19c7('0x17'));var client=jayson[_0x19c7('0x18')][_0x19c7('0x19')]({'port':0x232a});function checkPasswordPattern(_0x48e41d,_0x3ac504,_0x5d109c){if(_0x5d109c){var _0x3fae75=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3fae75[_0x19c7('0x1a')](_0x3ac504)){return _0x48e41d;}else{throw new db[(_0x19c7('0x1b'))][(_0x19c7('0x1c'))](_0x19c7('0x1d'));}}else{return _0x48e41d;}}function respondWithRpcPromise(_0x36dbb9,_0x454218,_0xf5c6be,_0x408428){return new BPromise(function(_0x2f7da3,_0x24f447){var _0x51778e=_0x408428||client;return _0x51778e['request'](_0x36dbb9,_0xf5c6be)[_0x19c7('0x1e')](function(_0x3576cf){logger[_0x19c7('0x1f')]('SalesforceConfiguration,\x20%s,\x20%s',_0x454218,_0x19c7('0x20'));logger[_0x19c7('0x21')](_0x19c7('0x22'),_0x454218,_0x19c7('0x20'),JSON[_0x19c7('0x23')](_0x3576cf));if(_0x3576cf['error']){if(_0x3576cf[_0x19c7('0x24')]['code']===0x1f4){logger[_0x19c7('0x24')]('SalesforceConfiguration,\x20%s,\x20%s',_0x454218,_0x3576cf['error']['message']);return _0x24f447(_0x3576cf['error'][_0x19c7('0x25')]);}logger[_0x19c7('0x24')](_0x19c7('0x26'),_0x454218,_0x3576cf[_0x19c7('0x24')][_0x19c7('0x25')]);return _0x2f7da3(_0x3576cf[_0x19c7('0x24')][_0x19c7('0x25')]);}else{logger[_0x19c7('0x1f')](_0x19c7('0x26'),_0x454218,'request\x20sent');_0x2f7da3(_0x3576cf[_0x19c7('0x27')]['message']);}})[_0x19c7('0x28')](function(_0x476be2){logger[_0x19c7('0x24')](_0x19c7('0x26'),_0x454218,_0x476be2);_0x24f447(_0x476be2);});});}function respondWithStatusCode(_0x3b84d6,_0x572a73){_0x572a73=_0x572a73||0xcc;return function(_0x5ea9c4){if(_0x5ea9c4){return _0x3b84d6['sendStatus'](_0x572a73);}return _0x3b84d6[_0x19c7('0x29')](_0x572a73)[_0x19c7('0x2a')]();};}function respondWithResult(_0x5c40a5,_0x2e213e){_0x2e213e=_0x2e213e||0xc8;return function(_0x14a1a8){if(_0x14a1a8){return _0x5c40a5[_0x19c7('0x29')](_0x2e213e)['json'](_0x14a1a8);}};}function respondWithFilteredResult(_0x33e1f5,_0x476a90){return function(_0x244a88){if(_0x244a88){var _0x3ca315=_0x244a88['count'],_0x3198f8=_0x476a90[_0x19c7('0x2b')],_0x357012=_0x476a90[_0x19c7('0x2b')]+_0x476a90[_0x19c7('0x2c')],_0x28a953;if(_0x357012>=_0x3ca315){_0x357012=_0x3ca315;_0x28a953=0xc8;}else{_0x28a953=0xce;}_0x33e1f5[_0x19c7('0x29')](_0x28a953);return _0x33e1f5['set'](_0x19c7('0x2d'),_0x3198f8+'-'+_0x357012+'/'+_0x3ca315)['json'](_0x244a88);}return null;};}function patchUpdates(_0x319069){return function(_0x1b6d75){try{jsonpatch[_0x19c7('0x2e')](_0x1b6d75,_0x319069,!![]);}catch(_0x3afa05){return BPromise[_0x19c7('0x2f')](_0x3afa05);}return _0x1b6d75[_0x19c7('0x30')]();};}function saveUpdates(_0xa60967,_0x2894b2){return function(_0x2c05f0){if(_0x2c05f0){return _0x2c05f0['update'](_0xa60967)['then'](function(_0x524768){return _0x524768;});}return null;};}function removeEntity(_0x4d9dfa,_0x2896bb){return function(_0x3633a1){if(_0x3633a1){return _0x3633a1[_0x19c7('0x31')]()['then'](function(){_0x4d9dfa['status'](0xcc)[_0x19c7('0x2a')]();});}};}function handleEntityNotFound(_0x47456c,_0x466e3e){return function(_0x5d8795){if(!_0x5d8795){_0x47456c[_0x19c7('0x32')](0x194);}return _0x5d8795;};}function handleError(_0x258793,_0x5adbb2){_0x5adbb2=_0x5adbb2||0x1f4;return function(_0x4cfdb5){logger['error'](_0x4cfdb5[_0x19c7('0x33')]);if(_0x4cfdb5['name']){delete _0x4cfdb5[_0x19c7('0x34')];}_0x258793[_0x19c7('0x29')](_0x5adbb2)['send'](_0x4cfdb5);};}exports[_0x19c7('0x35')]=function(_0x3535df,_0x1fafd7){var _0x8e7d0e={},_0x505253={},_0x4e12f0={'count':0x0,'rows':[]};var _0x4cce2b=_['map'](db['SalesforceConfiguration'][_0x19c7('0x36')],function(_0x480d41){return{'name':_0x480d41[_0x19c7('0x37')],'type':_0x480d41[_0x19c7('0x38')][_0x19c7('0x39')]};});_0x505253[_0x19c7('0x3a')]=_['map'](_0x4cce2b,_0x19c7('0x34'));_0x505253['query']=_[_0x19c7('0x3b')](_0x3535df['query']);_0x505253[_0x19c7('0x3c')]=_['intersection'](_0x505253[_0x19c7('0x3a')],_0x505253['query']);_0x8e7d0e['attributes']=_['intersection'](_0x505253['model'],qs[_0x19c7('0x3d')](_0x3535df[_0x19c7('0x3e')]['fields']));_0x8e7d0e[_0x19c7('0x3f')]=_0x8e7d0e[_0x19c7('0x3f')]['length']?_0x8e7d0e[_0x19c7('0x3f')]:_0x505253['model'];if(!_0x3535df['query'][_0x19c7('0x40')](_0x19c7('0x41'))){_0x8e7d0e[_0x19c7('0x2c')]=qs[_0x19c7('0x2c')](_0x3535df['query']['limit']);_0x8e7d0e[_0x19c7('0x2b')]=qs['offset'](_0x3535df[_0x19c7('0x3e')][_0x19c7('0x2b')]);}_0x8e7d0e[_0x19c7('0x42')]=qs[_0x19c7('0x43')](_0x3535df['query'][_0x19c7('0x43')]);_0x8e7d0e['where']=qs[_0x19c7('0x3c')](_[_0x19c7('0x44')](_0x3535df['query'],_0x505253['filters']));if(_0x3535df['query'][_0x19c7('0x45')]){_0x8e7d0e[_0x19c7('0x46')]=_['merge'](_0x8e7d0e[_0x19c7('0x46')],{'$or':_['map'](_0x4cce2b,function(_0x4388be){if(_0x4388be[_0x19c7('0x38')]!=='VIRTUAL'){var _0x149d09={};_0x149d09[_0x4388be[_0x19c7('0x34')]]={'$like':'%'+_0x3535df[_0x19c7('0x3e')][_0x19c7('0x45')]+'%'};return _0x149d09;}})});}_0x8e7d0e=_[_0x19c7('0x47')]({},_0x8e7d0e,_0x3535df['options']);var _0x521d7b={'where':_0x8e7d0e['where']};return db['SalesforceConfiguration'][_0x19c7('0x48')](_0x521d7b)[_0x19c7('0x1e')](function(_0x2a3322){_0x4e12f0[_0x19c7('0x48')]=_0x2a3322;if(_0x3535df[_0x19c7('0x3e')]['includeAll']){_0x8e7d0e['include']=[{'all':!![]}];}return db[_0x19c7('0x49')][_0x19c7('0x4a')](_0x8e7d0e);})[_0x19c7('0x1e')](function(_0x22f63e){_0x4e12f0[_0x19c7('0x4b')]=_0x22f63e;return _0x4e12f0;})[_0x19c7('0x1e')](respondWithFilteredResult(_0x1fafd7,_0x8e7d0e))[_0x19c7('0x28')](handleError(_0x1fafd7,null));};exports['show']=function(_0x4e9493,_0x7d27c6){var _0x29def3={'raw':![],'where':{'id':_0x4e9493[_0x19c7('0x4c')]['id']}},_0x401249={};_0x401249['model']=_[_0x19c7('0x3b')](db[_0x19c7('0x49')][_0x19c7('0x36')]);_0x401249['query']=_[_0x19c7('0x3b')](_0x4e9493[_0x19c7('0x3e')]);_0x401249[_0x19c7('0x3c')]=_[_0x19c7('0x4d')](_0x401249[_0x19c7('0x3a')],_0x401249[_0x19c7('0x3e')]);_0x29def3['attributes']=_[_0x19c7('0x4d')](_0x401249[_0x19c7('0x3a')],qs[_0x19c7('0x3d')](_0x4e9493[_0x19c7('0x3e')][_0x19c7('0x3d')]));_0x29def3[_0x19c7('0x3f')]=_0x29def3[_0x19c7('0x3f')][_0x19c7('0x4e')]?_0x29def3['attributes']:_0x401249['model'];if(_0x4e9493[_0x19c7('0x3e')][_0x19c7('0x4f')]){_0x29def3[_0x19c7('0x50')]=[{'all':!![]}];}_0x29def3=_[_0x19c7('0x47')]({},_0x29def3,_0x4e9493['options']);return db[_0x19c7('0x49')][_0x19c7('0x51')](_0x29def3)[_0x19c7('0x1e')](handleEntityNotFound(_0x7d27c6,null))[_0x19c7('0x1e')](respondWithResult(_0x7d27c6,null))['catch'](handleError(_0x7d27c6,null));};exports['create']=function(_0x5cde2c,_0x2d3366){return db['SalesforceConfiguration']['create'](_0x5cde2c[_0x19c7('0x52')],{})[_0x19c7('0x1e')](respondWithResult(_0x2d3366,0xc9))[_0x19c7('0x28')](handleError(_0x2d3366,null));};exports['update']=function(_0x3fd05b,_0x476801){if(_0x3fd05b[_0x19c7('0x52')]['id']){delete _0x3fd05b['body']['id'];}return db['SalesforceConfiguration'][_0x19c7('0x51')]({'where':{'id':_0x3fd05b[_0x19c7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x476801,null))['then'](saveUpdates(_0x3fd05b[_0x19c7('0x52')],null))[_0x19c7('0x1e')](respondWithResult(_0x476801,null))[_0x19c7('0x28')](handleError(_0x476801,null));};exports[_0x19c7('0x31')]=function(_0x387bb4,_0x5072d5){return db['SalesforceConfiguration'][_0x19c7('0x51')]({'where':{'id':_0x387bb4[_0x19c7('0x4c')]['id']}})[_0x19c7('0x1e')](handleEntityNotFound(_0x5072d5,null))[_0x19c7('0x1e')](removeEntity(_0x5072d5,null))[_0x19c7('0x28')](handleError(_0x5072d5,null));};exports['getFields']=function(_0x31462d,_0xd881c2,_0x14e3ac){var _0x41e1a8={};var _0x59b416={};var _0x1c410b;var _0x49a7f3;return db[_0x19c7('0x49')]['findOne']({'where':{'id':_0x31462d[_0x19c7('0x4c')]['id']}})[_0x19c7('0x1e')](handleEntityNotFound(_0xd881c2,null))[_0x19c7('0x1e')](function(_0x52bf6f){if(_0x52bf6f){_0x1c410b=_0x52bf6f;_0x59b416['model']=_['keys'](db[_0x19c7('0x53')][_0x19c7('0x36')]);_0x59b416[_0x19c7('0x3e')]=_[_0x19c7('0x3b')](_0x31462d[_0x19c7('0x3e')]);_0x59b416['filters']=_['intersection'](_0x59b416['model'],_0x59b416[_0x19c7('0x3e')]);_0x41e1a8[_0x19c7('0x3f')]=_[_0x19c7('0x4d')](_0x59b416[_0x19c7('0x3a')],qs[_0x19c7('0x3d')](_0x31462d[_0x19c7('0x3e')][_0x19c7('0x3d')]));_0x41e1a8['attributes']=_0x41e1a8['attributes'][_0x19c7('0x4e')]?_0x41e1a8[_0x19c7('0x3f')]:_0x59b416[_0x19c7('0x3a')];_0x41e1a8['order']=qs[_0x19c7('0x43')](_0x31462d[_0x19c7('0x3e')]['sort']);_0x41e1a8[_0x19c7('0x46')]=qs[_0x19c7('0x3c')](_['pick'](_0x31462d[_0x19c7('0x3e')],_0x59b416['filters']));if(_0x31462d[_0x19c7('0x3e')][_0x19c7('0x45')]){_0x41e1a8[_0x19c7('0x46')]=_[_0x19c7('0x47')](_0x41e1a8[_0x19c7('0x46')],{'$or':_['map'](_0x41e1a8[_0x19c7('0x3f')],function(_0x535a96){var _0x261632={};_0x261632[_0x535a96]={'$like':'%'+_0x31462d[_0x19c7('0x3e')]['filter']+'%'};return _0x261632;})});}_0x41e1a8=_[_0x19c7('0x47')]({},_0x41e1a8,_0x31462d[_0x19c7('0x54')]);return _0x1c410b[_0x19c7('0x55')](_0x41e1a8);}})[_0x19c7('0x1e')](function(_0x8b71fe){if(_0x8b71fe){_0x49a7f3=_0x8b71fe['length'];if(!_0x31462d[_0x19c7('0x3e')][_0x19c7('0x40')](_0x19c7('0x41'))){_0x41e1a8[_0x19c7('0x2c')]=qs[_0x19c7('0x2c')](_0x31462d['query']['limit']);_0x41e1a8['offset']=qs[_0x19c7('0x2b')](_0x31462d[_0x19c7('0x3e')]['offset']);}return _0x1c410b[_0x19c7('0x55')](_0x41e1a8);}})[_0x19c7('0x1e')](function(_0x5e371e){if(_0x5e371e){return _0x5e371e?{'count':_0x49a7f3,'rows':_0x5e371e}:null;}})[_0x19c7('0x1e')](respondWithResult(_0xd881c2,null))[_0x19c7('0x28')](handleError(_0xd881c2,null));};exports[_0x19c7('0x56')]=function(_0x1b3981,_0x5f3f03,_0xeb1237){var _0x2a2f35={};var _0x3e9afe={};var _0xd24b3c;var _0x433ab0;return db['SalesforceConfiguration'][_0x19c7('0x57')]({'where':{'id':_0x1b3981[_0x19c7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5f3f03,null))[_0x19c7('0x1e')](function(_0x2bc302){if(_0x2bc302){_0xd24b3c=_0x2bc302;_0x3e9afe[_0x19c7('0x3a')]=_[_0x19c7('0x3b')](db[_0x19c7('0x53')]['rawAttributes']);_0x3e9afe[_0x19c7('0x3e')]=_[_0x19c7('0x3b')](_0x1b3981[_0x19c7('0x3e')]);_0x3e9afe['filters']=_['intersection'](_0x3e9afe[_0x19c7('0x3a')],_0x3e9afe[_0x19c7('0x3e')]);_0x2a2f35[_0x19c7('0x3f')]=_[_0x19c7('0x4d')](_0x3e9afe[_0x19c7('0x3a')],qs['fields'](_0x1b3981['query'][_0x19c7('0x3d')]));_0x2a2f35[_0x19c7('0x3f')]=_0x2a2f35['attributes']['length']?_0x2a2f35['attributes']:_0x3e9afe['model'];_0x2a2f35[_0x19c7('0x42')]=qs[_0x19c7('0x43')](_0x1b3981[_0x19c7('0x3e')][_0x19c7('0x43')]);_0x2a2f35['where']=qs[_0x19c7('0x3c')](_[_0x19c7('0x44')](_0x1b3981['query'],_0x3e9afe[_0x19c7('0x3c')]));if(_0x1b3981[_0x19c7('0x3e')]['filter']){_0x2a2f35['where']=_[_0x19c7('0x47')](_0x2a2f35[_0x19c7('0x46')],{'$or':_['map'](_0x2a2f35[_0x19c7('0x3f')],function(_0x11be19){var _0x236484={};_0x236484[_0x11be19]={'$like':'%'+_0x1b3981[_0x19c7('0x3e')][_0x19c7('0x45')]+'%'};return _0x236484;})});}_0x2a2f35=_['merge']({},_0x2a2f35,_0x1b3981[_0x19c7('0x54')]);return _0xd24b3c['getSubjects'](_0x2a2f35);}})[_0x19c7('0x1e')](function(_0x1fca44){if(_0x1fca44){_0x433ab0=_0x1fca44['length'];if(!_0x1b3981[_0x19c7('0x3e')][_0x19c7('0x40')](_0x19c7('0x41'))){_0x2a2f35[_0x19c7('0x2c')]=qs[_0x19c7('0x2c')](_0x1b3981['query'][_0x19c7('0x2c')]);_0x2a2f35[_0x19c7('0x2b')]=qs[_0x19c7('0x2b')](_0x1b3981['query'][_0x19c7('0x2b')]);}return _0xd24b3c[_0x19c7('0x56')](_0x2a2f35);}})['then'](function(_0x167db2){if(_0x167db2){return _0x167db2?{'count':_0x433ab0,'rows':_0x167db2}:null;}})[_0x19c7('0x1e')](respondWithResult(_0x5f3f03,null))[_0x19c7('0x28')](handleError(_0x5f3f03,null));};exports['getDescriptions']=function(_0x19e847,_0x1d8db4,_0x351b49){var _0x2dceaf={};var _0x565b62={};var _0x172ced;var _0x463df1;return db['SalesforceConfiguration'][_0x19c7('0x57')]({'where':{'id':_0x19e847[_0x19c7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1d8db4,null))['then'](function(_0x36fb34){if(_0x36fb34){_0x172ced=_0x36fb34;_0x565b62['model']=_['keys'](db['SalesforceField'][_0x19c7('0x36')]);_0x565b62[_0x19c7('0x3e')]=_[_0x19c7('0x3b')](_0x19e847[_0x19c7('0x3e')]);_0x565b62['filters']=_[_0x19c7('0x4d')](_0x565b62[_0x19c7('0x3a')],_0x565b62[_0x19c7('0x3e')]);_0x2dceaf[_0x19c7('0x3f')]=_[_0x19c7('0x4d')](_0x565b62[_0x19c7('0x3a')],qs[_0x19c7('0x3d')](_0x19e847['query'][_0x19c7('0x3d')]));_0x2dceaf[_0x19c7('0x3f')]=_0x2dceaf[_0x19c7('0x3f')]['length']?_0x2dceaf['attributes']:_0x565b62['model'];_0x2dceaf[_0x19c7('0x42')]=qs[_0x19c7('0x43')](_0x19e847[_0x19c7('0x3e')][_0x19c7('0x43')]);_0x2dceaf[_0x19c7('0x46')]=qs[_0x19c7('0x3c')](_[_0x19c7('0x44')](_0x19e847['query'],_0x565b62[_0x19c7('0x3c')]));if(_0x19e847[_0x19c7('0x3e')]['filter']){_0x2dceaf['where']=_[_0x19c7('0x47')](_0x2dceaf[_0x19c7('0x46')],{'$or':_[_0x19c7('0x58')](_0x2dceaf['attributes'],function(_0x543cb9){var _0x180e33={};_0x180e33[_0x543cb9]={'$like':'%'+_0x19e847[_0x19c7('0x3e')]['filter']+'%'};return _0x180e33;})});}_0x2dceaf=_[_0x19c7('0x47')]({},_0x2dceaf,_0x19e847[_0x19c7('0x54')]);return _0x172ced[_0x19c7('0x59')](_0x2dceaf);}})['then'](function(_0x567672){if(_0x567672){_0x463df1=_0x567672[_0x19c7('0x4e')];if(!_0x19e847[_0x19c7('0x3e')][_0x19c7('0x40')](_0x19c7('0x41'))){_0x2dceaf['limit']=qs['limit'](_0x19e847[_0x19c7('0x3e')]['limit']);_0x2dceaf[_0x19c7('0x2b')]=qs[_0x19c7('0x2b')](_0x19e847[_0x19c7('0x3e')]['offset']);}return _0x172ced[_0x19c7('0x59')](_0x2dceaf);}})[_0x19c7('0x1e')](function(_0xe05896){if(_0xe05896){return _0xe05896?{'count':_0x463df1,'rows':_0xe05896}:null;}})[_0x19c7('0x1e')](respondWithResult(_0x1d8db4,null))[_0x19c7('0x28')](handleError(_0x1d8db4,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 9f1b186..b23bd5f 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 _0xab76=['../../config/logger','moment','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','util'];(function(_0x5ef63d,_0x192daf){var _0x52857e=function(_0x4cc42a){while(--_0x4cc42a){_0x5ef63d['push'](_0x5ef63d['shift']());}};_0x52857e(++_0x192daf);}(_0xab76,0xfb));var _0x6ab7=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xab76[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x6ab7('0x0'));var logger=require(_0x6ab7('0x1'))('api');var moment=require(_0x6ab7('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6ab7('0x3'));var config=require(_0x6ab7('0x4'));var attributes=require(_0x6ab7('0x5'));module['exports']=function(_0x437735,_0x3432b9){return _0x437735[_0x6ab7('0x6')](_0x6ab7('0x7'),attributes,{'tableName':_0x6ab7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ac9=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x0ac9,0x19e));var _0x90ac=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0x0ac9[_0x1fafa5];return _0xcf08c9;};'use strict';var _=require(_0x90ac('0x0'));var util=require(_0x90ac('0x1'));var logger=require(_0x90ac('0x2'))(_0x90ac('0x3'));var moment=require(_0x90ac('0x4'));var BPromise=require(_0x90ac('0x5'));var rp=require(_0x90ac('0x6'));var fs=require('fs');var path=require(_0x90ac('0x7'));var rimraf=require('rimraf');var config=require(_0x90ac('0x8'));var attributes=require(_0x90ac('0x9'));module[_0x90ac('0xa')]=function(_0x3720dc,_0x1628fe){return _0x3720dc['define'](_0x90ac('0xb'),attributes,{'tableName':_0x90ac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index d23450a..dd91c71 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 _0x56f8=['request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x4b8f70,_0x23d6ab){var _0x215d59=function(_0x134672){while(--_0x134672){_0x4b8f70['push'](_0x4b8f70['shift']());}};_0x215d59(++_0x23d6ab);}(_0x56f8,0x1c1));var _0x856f=function(_0x5114c9,_0x496b99){_0x5114c9=_0x5114c9-0x0;var _0x257534=_0x56f8[_0x5114c9];return _0x257534;};'use strict';var _=require(_0x856f('0x0'));var util=require(_0x856f('0x1'));var moment=require('moment');var BPromise=require(_0x856f('0x2'));var rs=require(_0x856f('0x3'));var fs=require('fs');var Redis=require(_0x856f('0x4'));var db=require(_0x856f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x856f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x856f('0x7')][_0x856f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x513e74,_0x1fd69b,_0x39665a){return new BPromise(function(_0x45c754,_0x10d377){return client[_0x856f('0x9')](_0x513e74,_0x39665a)[_0x856f('0xa')](function(_0x540c68){logger[_0x856f('0xb')](_0x856f('0xc'),_0x1fd69b,_0x856f('0xd'));logger[_0x856f('0xe')](_0x856f('0xf'),_0x1fd69b,_0x856f('0xd'),JSON[_0x856f('0x10')](_0x540c68));if(_0x540c68['error']){if(_0x540c68[_0x856f('0x11')][_0x856f('0x12')]===0x1f4){logger[_0x856f('0x11')](_0x856f('0xc'),_0x1fd69b,_0x540c68[_0x856f('0x11')][_0x856f('0x13')]);return _0x10d377(_0x540c68[_0x856f('0x11')][_0x856f('0x13')]);}logger[_0x856f('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1fd69b,_0x540c68[_0x856f('0x11')][_0x856f('0x13')]);return _0x45c754(_0x540c68['error']['message']);}else{logger['info'](_0x856f('0xc'),_0x1fd69b,_0x856f('0xd'));_0x45c754(_0x540c68['result'][_0x856f('0x13')]);}})[_0x856f('0x14')](function(_0x381145){logger[_0x856f('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1fd69b,_0x381145);_0x10d377(_0x381145);});});} \ No newline at end of file +var _0xdabb=['jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4ecf23,_0x167c1c){var _0x2fb9db=function(_0x5320ce){while(--_0x5320ce){_0x4ecf23['push'](_0x4ecf23['shift']());}};_0x2fb9db(++_0x167c1c);}(_0xdabb,0x1ab));var _0xbdab=function(_0x3d75f1,_0xc92bba){_0x3d75f1=_0x3d75f1-0x0;var _0x30c8af=_0xdabb[_0x3d75f1];return _0x30c8af;};'use strict';var _=require(_0xbdab('0x0'));var util=require(_0xbdab('0x1'));var moment=require(_0xbdab('0x2'));var BPromise=require(_0xbdab('0x3'));var rs=require(_0xbdab('0x4'));var fs=require('fs');var Redis=require(_0xbdab('0x5'));var db=require(_0xbdab('0x6'))['db'];var utils=require(_0xbdab('0x7'));var logger=require(_0xbdab('0x8'))('rpc');var config=require(_0xbdab('0x9'));var jayson=require(_0xbdab('0xa'));var client=jayson[_0xbdab('0xb')][_0xbdab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x212c31,_0xc2fca4,_0x1ea89f){return new BPromise(function(_0x59b269,_0x56a0de){return client[_0xbdab('0xd')](_0x212c31,_0x1ea89f)[_0xbdab('0xe')](function(_0x2c1a2c){logger[_0xbdab('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0xc2fca4,_0xbdab('0x10'));logger[_0xbdab('0x11')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0xc2fca4,_0xbdab('0x10'),JSON[_0xbdab('0x12')](_0x2c1a2c));if(_0x2c1a2c['error']){if(_0x2c1a2c[_0xbdab('0x13')]['code']===0x1f4){logger['error'](_0xbdab('0x14'),_0xc2fca4,_0x2c1a2c[_0xbdab('0x13')]['message']);return _0x56a0de(_0x2c1a2c[_0xbdab('0x13')][_0xbdab('0x15')]);}logger[_0xbdab('0x13')](_0xbdab('0x14'),_0xc2fca4,_0x2c1a2c['error']['message']);return _0x59b269(_0x2c1a2c['error']['message']);}else{logger['info'](_0xbdab('0x14'),_0xc2fca4,_0xbdab('0x10'));_0x59b269(_0x2c1a2c['result'][_0xbdab('0x15')]);}})[_0xbdab('0x16')](function(_0x14d92c){logger[_0xbdab('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0xc2fca4,_0x14d92c);_0x56a0de(_0x14d92c);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index fdf866e..fc7a8c0 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 _0x2eb2=['/:id','show','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get'];(function(_0x57b9c0,_0x352423){var _0x17f513=function(_0x3c0c9f){while(--_0x3c0c9f){_0x57b9c0['push'](_0x57b9c0['shift']());}};_0x17f513(++_0x352423);}(_0x2eb2,0x19f));var _0x22eb=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2eb2[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var auth=require(_0x22eb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x22eb('0x6'));var controller=require('./intSalesforceField.controller');router['get']('/',auth[_0x22eb('0x7')](),controller[_0x22eb('0x8')]);router[_0x22eb('0x9')](_0x22eb('0xa'),auth[_0x22eb('0x7')](),controller[_0x22eb('0xb')]);router[_0x22eb('0xc')]('/',auth[_0x22eb('0x7')](),controller[_0x22eb('0xd')]);router[_0x22eb('0xe')](_0x22eb('0xa'),auth[_0x22eb('0x7')](),controller['update']);router[_0x22eb('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x22eb('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6d38=['path','connect-timeout','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','index','/:id','isAuthenticated','create','put','update','delete','destroy','exports','util'];(function(_0x2b355f,_0x4b5758){var _0x3ae502=function(_0x3c3bc9){while(--_0x3c3bc9){_0x2b355f['push'](_0x2b355f['shift']());}};_0x3ae502(++_0x4b5758);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x6d38[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x86d3('0x0'));var path=require(_0x86d3('0x1'));var timeout=require(_0x86d3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x86d3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x86d3('0x4'));var controller=require(_0x86d3('0x5'));router[_0x86d3('0x6')]('/',auth['isAuthenticated'](),controller[_0x86d3('0x7')]);router[_0x86d3('0x6')](_0x86d3('0x8'),auth[_0x86d3('0x9')](),controller['show']);router['post']('/',auth[_0x86d3('0x9')](),controller[_0x86d3('0xa')]);router[_0x86d3('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x86d3('0xc')]);router[_0x86d3('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x86d3('0xe')]);module[_0x86d3('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 8bfa0a2..e4f0f26 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 _0xa1e5=['customVariable','sequelize','exports','ENUM','string','variable','keyValue','STRING'];(function(_0x454041,_0x4dcaf5){var _0x21da0d=function(_0x17c276){while(--_0x17c276){_0x454041['push'](_0x454041['shift']());}};_0x21da0d(++_0x4dcaf5);}(_0xa1e5,0x191));var _0x5a1e=function(_0x15a6cf,_0x14b175){_0x15a6cf=_0x15a6cf-0x0;var _0x1b202b=_0xa1e5[_0x15a6cf];return _0x1b202b;};'use strict';var Sequelize=require(_0x5a1e('0x0'));module[_0x5a1e('0x1')]={'type':{'type':Sequelize[_0x5a1e('0x2')](_0x5a1e('0x3'),_0x5a1e('0x4'),'customVariable',_0x5a1e('0x5')),'defaultValue':_0x5a1e('0x3')},'content':{'type':Sequelize[_0x5a1e('0x6')]},'key':{'type':Sequelize[_0x5a1e('0x6')]},'keyType':{'type':Sequelize[_0x5a1e('0x2')]('string','variable',_0x5a1e('0x7'))},'keyContent':{'type':Sequelize[_0x5a1e('0x6')]},'idField':{'type':Sequelize[_0x5a1e('0x6')]},'variableName':{'type':Sequelize[_0x5a1e('0x6')]}}; \ No newline at end of file +var _0x090e=['sequelize','ENUM','customVariable','string','STRING','variable'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0x090e,0x1b0));var _0xe090=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x090e[_0x107f10];return _0x811cab;};'use strict';var Sequelize=require(_0xe090('0x0'));module['exports']={'type':{'type':Sequelize[_0xe090('0x1')]('string','variable',_0xe090('0x2'),'keyValue'),'defaultValue':_0xe090('0x3')},'content':{'type':Sequelize[_0xe090('0x4')]},'key':{'type':Sequelize[_0xe090('0x4')]},'keyType':{'type':Sequelize[_0xe090('0x1')](_0xe090('0x3'),_0xe090('0x5'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 5fedb8c..4288433 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 _0x2ef3=['then','stack','name','send','index','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','sort','pick','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','limit','set','apply','reject','save','update','destroy'];(function(_0x43316d,_0x5ebd8f){var _0x52d343=function(_0x231e52){while(--_0x231e52){_0x43316d['push'](_0x43316d['shift']());}};_0x52d343(++_0x5ebd8f);}(_0x2ef3,0xba));var _0x32ef=function(_0x2f1859,_0x8a278b){_0x2f1859=_0x2f1859-0x0;var _0xf30f20=_0x2ef3[_0x2f1859];return _0xf30f20;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x14'));var logger=require(_0x32ef('0x15'))(_0x32ef('0x16'));var utils=require(_0x32ef('0x17'));var config=require('../../config/environment');var db=require(_0x32ef('0x18'))['db'];function respondWithStatusCode(_0x5afcc2,_0x1a5106){_0x1a5106=_0x1a5106||0xcc;return function(_0x49d590){if(_0x49d590){return _0x5afcc2[_0x32ef('0x19')](_0x1a5106);}return _0x5afcc2[_0x32ef('0x1a')](_0x1a5106)['end']();};}function respondWithResult(_0x539d18,_0x19ce1){_0x19ce1=_0x19ce1||0xc8;return function(_0x4d8009){if(_0x4d8009){return _0x539d18[_0x32ef('0x1a')](_0x19ce1)[_0x32ef('0x1b')](_0x4d8009);}};}function respondWithFilteredResult(_0x93d492,_0x54c7f5){return function(_0x57aff1){if(_0x57aff1){var _0x55bf0b=_0x57aff1[_0x32ef('0x1c')],_0x531e30=_0x54c7f5['offset'],_0x13db1a=_0x54c7f5['offset']+_0x54c7f5[_0x32ef('0x1d')],_0x3950e6;if(_0x13db1a>=_0x55bf0b){_0x13db1a=_0x55bf0b;_0x3950e6=0xc8;}else{_0x3950e6=0xce;}_0x93d492[_0x32ef('0x1a')](_0x3950e6);return _0x93d492[_0x32ef('0x1e')]('Content-Range',_0x531e30+'-'+_0x13db1a+'/'+_0x55bf0b)[_0x32ef('0x1b')](_0x57aff1);}return null;};}function patchUpdates(_0x33e230){return function(_0x4f4c98){try{jsonpatch[_0x32ef('0x1f')](_0x4f4c98,_0x33e230,!![]);}catch(_0x314ef1){return BPromise[_0x32ef('0x20')](_0x314ef1);}return _0x4f4c98[_0x32ef('0x21')]();};}function saveUpdates(_0x445cda,_0x3aec05){return function(_0x4de441){if(_0x4de441){return _0x4de441[_0x32ef('0x22')](_0x445cda)['then'](function(_0x309866){return _0x309866;});}return null;};}function removeEntity(_0x3a20ca,_0x49f2d8){return function(_0x1af371){if(_0x1af371){return _0x1af371[_0x32ef('0x23')]()[_0x32ef('0x24')](function(){_0x3a20ca['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(!_0x225feb){_0x22f2d7['sendStatus'](0x194);}return _0x225feb;};}function handleError(_0x59585f,_0x19ea6){_0x19ea6=_0x19ea6||0x1f4;return function(_0x4d584b){logger['error'](_0x4d584b[_0x32ef('0x25')]);if(_0x4d584b[_0x32ef('0x26')]){delete _0x4d584b[_0x32ef('0x26')];}_0x59585f[_0x32ef('0x1a')](_0x19ea6)[_0x32ef('0x27')](_0x4d584b);};}exports[_0x32ef('0x28')]=function(_0x1874ea,_0x38aed5){var _0x338f19={},_0x2f52d7={},_0x1335e2={'count':0x0,'rows':[]};var _0xba4b3f=_['map'](db[_0x32ef('0x29')][_0x32ef('0x2a')],function(_0x5a04cd){return{'name':_0x5a04cd[_0x32ef('0x2b')],'type':_0x5a04cd[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x2f52d7[_0x32ef('0x2e')]=_['map'](_0xba4b3f,_0x32ef('0x26'));_0x2f52d7[_0x32ef('0x2f')]=_[_0x32ef('0x30')](_0x1874ea[_0x32ef('0x2f')]);_0x2f52d7[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2f52d7[_0x32ef('0x2e')],_0x2f52d7['query']);_0x338f19[_0x32ef('0x33')]=_['intersection'](_0x2f52d7[_0x32ef('0x2e')],qs[_0x32ef('0x34')](_0x1874ea['query'][_0x32ef('0x34')]));_0x338f19[_0x32ef('0x33')]=_0x338f19[_0x32ef('0x33')][_0x32ef('0x35')]?_0x338f19[_0x32ef('0x33')]:_0x2f52d7['model'];if(!_0x1874ea['query'][_0x32ef('0x36')]('nolimit')){_0x338f19[_0x32ef('0x1d')]=qs[_0x32ef('0x1d')](_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x338f19[_0x32ef('0x37')]=qs[_0x32ef('0x37')](_0x1874ea['query']['offset']);}_0x338f19['order']=qs[_0x32ef('0x38')](_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x38')]);_0x338f19['where']=qs['filters'](_[_0x32ef('0x39')](_0x1874ea[_0x32ef('0x2f')],_0x2f52d7[_0x32ef('0x31')]));if(_0x1874ea['query']['filter']){_0x338f19[_0x32ef('0x3a')]=_[_0x32ef('0x3b')](_0x338f19[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x3c')](_0xba4b3f,function(_0x3a7c49){if(_0x3a7c49[_0x32ef('0x2c')]!==_0x32ef('0x3d')){var _0x21da90={};_0x21da90[_0x3a7c49[_0x32ef('0x26')]]={'$like':'%'+_0x1874ea['query'][_0x32ef('0x3e')]+'%'};return _0x21da90;}})});}_0x338f19=_[_0x32ef('0x3b')]({},_0x338f19,_0x1874ea[_0x32ef('0x3f')]);var _0x4b97dc={'where':_0x338f19[_0x32ef('0x3a')]};return db[_0x32ef('0x29')][_0x32ef('0x1c')](_0x4b97dc)[_0x32ef('0x24')](function(_0x1faf72){_0x1335e2[_0x32ef('0x1c')]=_0x1faf72;if(_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x40')]){_0x338f19[_0x32ef('0x41')]=[{'all':!![]}];}return db[_0x32ef('0x29')][_0x32ef('0x42')](_0x338f19);})[_0x32ef('0x24')](function(_0x48e071){_0x1335e2[_0x32ef('0x43')]=_0x48e071;return _0x1335e2;})[_0x32ef('0x24')](respondWithFilteredResult(_0x38aed5,_0x338f19))[_0x32ef('0x44')](handleError(_0x38aed5,null));};exports[_0x32ef('0x45')]=function(_0x2f92f5,_0x2ca66b){var _0x3c0e44={'raw':!![],'where':{'id':_0x2f92f5['params']['id']}},_0x596d5a={};_0x596d5a[_0x32ef('0x2e')]=_[_0x32ef('0x30')](db[_0x32ef('0x29')][_0x32ef('0x2a')]);_0x596d5a['query']=_[_0x32ef('0x30')](_0x2f92f5[_0x32ef('0x2f')]);_0x596d5a['filters']=_[_0x32ef('0x32')](_0x596d5a['model'],_0x596d5a[_0x32ef('0x2f')]);_0x3c0e44[_0x32ef('0x33')]=_[_0x32ef('0x32')](_0x596d5a[_0x32ef('0x2e')],qs[_0x32ef('0x34')](_0x2f92f5[_0x32ef('0x2f')][_0x32ef('0x34')]));_0x3c0e44[_0x32ef('0x33')]=_0x3c0e44[_0x32ef('0x33')][_0x32ef('0x35')]?_0x3c0e44['attributes']:_0x596d5a[_0x32ef('0x2e')];if(_0x2f92f5['query'][_0x32ef('0x40')]){_0x3c0e44[_0x32ef('0x41')]=[{'all':!![]}];}_0x3c0e44=_[_0x32ef('0x3b')]({},_0x3c0e44,_0x2f92f5['options']);return db[_0x32ef('0x29')][_0x32ef('0x46')](_0x3c0e44)[_0x32ef('0x24')](handleEntityNotFound(_0x2ca66b,null))[_0x32ef('0x24')](respondWithResult(_0x2ca66b,null))[_0x32ef('0x44')](handleError(_0x2ca66b,null));};exports[_0x32ef('0x47')]=function(_0x12c9e6,_0x47dbe1){return db['SalesforceField'][_0x32ef('0x47')](_0x12c9e6[_0x32ef('0x48')],{})[_0x32ef('0x24')](respondWithResult(_0x47dbe1,0xc9))[_0x32ef('0x44')](handleError(_0x47dbe1,null));};exports[_0x32ef('0x22')]=function(_0xd67dc9,_0x44ad11){if(_0xd67dc9[_0x32ef('0x48')]['id']){delete _0xd67dc9[_0x32ef('0x48')]['id'];}return db[_0x32ef('0x29')][_0x32ef('0x46')]({'where':{'id':_0xd67dc9[_0x32ef('0x49')]['id']}})[_0x32ef('0x24')](handleEntityNotFound(_0x44ad11,null))['then'](saveUpdates(_0xd67dc9[_0x32ef('0x48')],null))[_0x32ef('0x24')](respondWithResult(_0x44ad11,null))[_0x32ef('0x44')](handleError(_0x44ad11,null));};exports[_0x32ef('0x23')]=function(_0x1cc9f3,_0x4353f0){return db[_0x32ef('0x29')][_0x32ef('0x46')]({'where':{'id':_0x1cc9f3[_0x32ef('0x49')]['id']}})[_0x32ef('0x24')](handleEntityNotFound(_0x4353f0,null))[_0x32ef('0x24')](removeEntity(_0x4353f0,null))[_0x32ef('0x44')](handleError(_0x4353f0,null));}; \ No newline at end of file +var _0x2ef3=['then','stack','name','send','index','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','sort','pick','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','limit','set','apply','reject','save','update','destroy'];(function(_0x1ca741,_0x5c758c){var _0x54a577=function(_0x574b9f){while(--_0x574b9f){_0x1ca741['push'](_0x1ca741['shift']());}};_0x54a577(++_0x5c758c);}(_0x2ef3,0xba));var _0x32ef=function(_0x4328d1,_0x69ebac){_0x4328d1=_0x4328d1-0x0;var _0x56ee81=_0x2ef3[_0x4328d1];return _0x56ee81;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x14'));var logger=require(_0x32ef('0x15'))(_0x32ef('0x16'));var utils=require(_0x32ef('0x17'));var config=require('../../config/environment');var db=require(_0x32ef('0x18'))['db'];function respondWithStatusCode(_0x5afcc2,_0x1a5106){_0x1a5106=_0x1a5106||0xcc;return function(_0x49d590){if(_0x49d590){return _0x5afcc2[_0x32ef('0x19')](_0x1a5106);}return _0x5afcc2[_0x32ef('0x1a')](_0x1a5106)['end']();};}function respondWithResult(_0x539d18,_0x19ce1){_0x19ce1=_0x19ce1||0xc8;return function(_0x4d8009){if(_0x4d8009){return _0x539d18[_0x32ef('0x1a')](_0x19ce1)[_0x32ef('0x1b')](_0x4d8009);}};}function respondWithFilteredResult(_0x93d492,_0x54c7f5){return function(_0x57aff1){if(_0x57aff1){var _0x55bf0b=_0x57aff1[_0x32ef('0x1c')],_0x531e30=_0x54c7f5['offset'],_0x13db1a=_0x54c7f5['offset']+_0x54c7f5[_0x32ef('0x1d')],_0x3950e6;if(_0x13db1a>=_0x55bf0b){_0x13db1a=_0x55bf0b;_0x3950e6=0xc8;}else{_0x3950e6=0xce;}_0x93d492[_0x32ef('0x1a')](_0x3950e6);return _0x93d492[_0x32ef('0x1e')]('Content-Range',_0x531e30+'-'+_0x13db1a+'/'+_0x55bf0b)[_0x32ef('0x1b')](_0x57aff1);}return null;};}function patchUpdates(_0x33e230){return function(_0x4f4c98){try{jsonpatch[_0x32ef('0x1f')](_0x4f4c98,_0x33e230,!![]);}catch(_0x314ef1){return BPromise[_0x32ef('0x20')](_0x314ef1);}return _0x4f4c98[_0x32ef('0x21')]();};}function saveUpdates(_0x445cda,_0x3aec05){return function(_0x4de441){if(_0x4de441){return _0x4de441[_0x32ef('0x22')](_0x445cda)['then'](function(_0x309866){return _0x309866;});}return null;};}function removeEntity(_0x3a20ca,_0x49f2d8){return function(_0x1af371){if(_0x1af371){return _0x1af371[_0x32ef('0x23')]()[_0x32ef('0x24')](function(){_0x3a20ca['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(!_0x225feb){_0x22f2d7['sendStatus'](0x194);}return _0x225feb;};}function handleError(_0x59585f,_0x19ea6){_0x19ea6=_0x19ea6||0x1f4;return function(_0x4d584b){logger['error'](_0x4d584b[_0x32ef('0x25')]);if(_0x4d584b[_0x32ef('0x26')]){delete _0x4d584b[_0x32ef('0x26')];}_0x59585f[_0x32ef('0x1a')](_0x19ea6)[_0x32ef('0x27')](_0x4d584b);};}exports[_0x32ef('0x28')]=function(_0x1874ea,_0x38aed5){var _0x338f19={},_0x2f52d7={},_0x1335e2={'count':0x0,'rows':[]};var _0xba4b3f=_['map'](db[_0x32ef('0x29')][_0x32ef('0x2a')],function(_0x5a04cd){return{'name':_0x5a04cd[_0x32ef('0x2b')],'type':_0x5a04cd[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x2f52d7[_0x32ef('0x2e')]=_['map'](_0xba4b3f,_0x32ef('0x26'));_0x2f52d7[_0x32ef('0x2f')]=_[_0x32ef('0x30')](_0x1874ea[_0x32ef('0x2f')]);_0x2f52d7[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2f52d7[_0x32ef('0x2e')],_0x2f52d7['query']);_0x338f19[_0x32ef('0x33')]=_['intersection'](_0x2f52d7[_0x32ef('0x2e')],qs[_0x32ef('0x34')](_0x1874ea['query'][_0x32ef('0x34')]));_0x338f19[_0x32ef('0x33')]=_0x338f19[_0x32ef('0x33')][_0x32ef('0x35')]?_0x338f19[_0x32ef('0x33')]:_0x2f52d7['model'];if(!_0x1874ea['query'][_0x32ef('0x36')]('nolimit')){_0x338f19[_0x32ef('0x1d')]=qs[_0x32ef('0x1d')](_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x338f19[_0x32ef('0x37')]=qs[_0x32ef('0x37')](_0x1874ea['query']['offset']);}_0x338f19['order']=qs[_0x32ef('0x38')](_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x38')]);_0x338f19['where']=qs['filters'](_[_0x32ef('0x39')](_0x1874ea[_0x32ef('0x2f')],_0x2f52d7[_0x32ef('0x31')]));if(_0x1874ea['query']['filter']){_0x338f19[_0x32ef('0x3a')]=_[_0x32ef('0x3b')](_0x338f19[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x3c')](_0xba4b3f,function(_0x3a7c49){if(_0x3a7c49[_0x32ef('0x2c')]!==_0x32ef('0x3d')){var _0x21da90={};_0x21da90[_0x3a7c49[_0x32ef('0x26')]]={'$like':'%'+_0x1874ea['query'][_0x32ef('0x3e')]+'%'};return _0x21da90;}})});}_0x338f19=_[_0x32ef('0x3b')]({},_0x338f19,_0x1874ea[_0x32ef('0x3f')]);var _0x4b97dc={'where':_0x338f19[_0x32ef('0x3a')]};return db[_0x32ef('0x29')][_0x32ef('0x1c')](_0x4b97dc)[_0x32ef('0x24')](function(_0x1faf72){_0x1335e2[_0x32ef('0x1c')]=_0x1faf72;if(_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x40')]){_0x338f19[_0x32ef('0x41')]=[{'all':!![]}];}return db[_0x32ef('0x29')][_0x32ef('0x42')](_0x338f19);})[_0x32ef('0x24')](function(_0x48e071){_0x1335e2[_0x32ef('0x43')]=_0x48e071;return _0x1335e2;})[_0x32ef('0x24')](respondWithFilteredResult(_0x38aed5,_0x338f19))[_0x32ef('0x44')](handleError(_0x38aed5,null));};exports[_0x32ef('0x45')]=function(_0x2f92f5,_0x2ca66b){var _0x3c0e44={'raw':!![],'where':{'id':_0x2f92f5['params']['id']}},_0x596d5a={};_0x596d5a[_0x32ef('0x2e')]=_[_0x32ef('0x30')](db[_0x32ef('0x29')][_0x32ef('0x2a')]);_0x596d5a['query']=_[_0x32ef('0x30')](_0x2f92f5[_0x32ef('0x2f')]);_0x596d5a['filters']=_[_0x32ef('0x32')](_0x596d5a['model'],_0x596d5a[_0x32ef('0x2f')]);_0x3c0e44[_0x32ef('0x33')]=_[_0x32ef('0x32')](_0x596d5a[_0x32ef('0x2e')],qs[_0x32ef('0x34')](_0x2f92f5[_0x32ef('0x2f')][_0x32ef('0x34')]));_0x3c0e44[_0x32ef('0x33')]=_0x3c0e44[_0x32ef('0x33')][_0x32ef('0x35')]?_0x3c0e44['attributes']:_0x596d5a[_0x32ef('0x2e')];if(_0x2f92f5['query'][_0x32ef('0x40')]){_0x3c0e44[_0x32ef('0x41')]=[{'all':!![]}];}_0x3c0e44=_[_0x32ef('0x3b')]({},_0x3c0e44,_0x2f92f5['options']);return db[_0x32ef('0x29')][_0x32ef('0x46')](_0x3c0e44)[_0x32ef('0x24')](handleEntityNotFound(_0x2ca66b,null))[_0x32ef('0x24')](respondWithResult(_0x2ca66b,null))[_0x32ef('0x44')](handleError(_0x2ca66b,null));};exports[_0x32ef('0x47')]=function(_0x12c9e6,_0x47dbe1){return db['SalesforceField'][_0x32ef('0x47')](_0x12c9e6[_0x32ef('0x48')],{})[_0x32ef('0x24')](respondWithResult(_0x47dbe1,0xc9))[_0x32ef('0x44')](handleError(_0x47dbe1,null));};exports[_0x32ef('0x22')]=function(_0xd67dc9,_0x44ad11){if(_0xd67dc9[_0x32ef('0x48')]['id']){delete _0xd67dc9[_0x32ef('0x48')]['id'];}return db[_0x32ef('0x29')][_0x32ef('0x46')]({'where':{'id':_0xd67dc9[_0x32ef('0x49')]['id']}})[_0x32ef('0x24')](handleEntityNotFound(_0x44ad11,null))['then'](saveUpdates(_0xd67dc9[_0x32ef('0x48')],null))[_0x32ef('0x24')](respondWithResult(_0x44ad11,null))[_0x32ef('0x44')](handleError(_0x44ad11,null));};exports[_0x32ef('0x23')]=function(_0x1cc9f3,_0x4353f0){return db[_0x32ef('0x29')][_0x32ef('0x46')]({'where':{'id':_0x1cc9f3[_0x32ef('0x49')]['id']}})[_0x32ef('0x24')](handleEntityNotFound(_0x4353f0,null))[_0x32ef('0x24')](removeEntity(_0x4353f0,null))[_0x32ef('0x44')](handleError(_0x4353f0,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index f6f4805..9ef1869 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 _0xc770=['FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','int_salesforce_fields','idField'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc770,0xd3));var _0x0c77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc770[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0c77('0x0'));var util=require(_0x0c77('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0c77('0x2'));var BPromise=require(_0x0c77('0x3'));var rp=require(_0x0c77('0x4'));var fs=require('fs');var path=require(_0x0c77('0x5'));var rimraf=require(_0x0c77('0x6'));var config=require(_0x0c77('0x7'));var attributes=require(_0x0c77('0x8'));module[_0x0c77('0x9')]=function(_0x575bb3,_0x26a0ff){return _0x575bb3[_0x0c77('0xa')]('SalesforceField',attributes,{'tableName':_0x0c77('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x0c77('0xc'),_0x0c77('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd34e=['path','rimraf','./intSalesforceField.attributes','exports','define','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1c8253,_0x1c4de2){var _0x380d59=function(_0x5bbf67){while(--_0x5bbf67){_0x1c8253['push'](_0x1c8253['shift']());}};_0x380d59(++_0x1c4de2);}(_0xd34e,0x1d6));var _0xed34=function(_0x3e2356,_0x71ae8a){_0x3e2356=_0x3e2356-0x0;var _0xf2318d=_0xd34e[_0x3e2356];return _0xf2318d;};'use strict';var _=require(_0xed34('0x0'));var util=require(_0xed34('0x1'));var logger=require(_0xed34('0x2'))(_0xed34('0x3'));var moment=require(_0xed34('0x4'));var BPromise=require(_0xed34('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed34('0x6'));var rimraf=require(_0xed34('0x7'));var config=require('../../config/environment');var attributes=require(_0xed34('0x8'));module[_0xed34('0x9')]=function(_0x12bfca,_0x3b3822){return _0x12bfca[_0xed34('0xa')]('SalesforceField',attributes,{'tableName':_0xed34('0xb'),'paranoid':![],'indexes':[{'name':_0xed34('0xc'),'fields':['idField',_0xed34('0xd')],'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 2b3dd24..ac1b4d0 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 _0xdace=['request\x20sent','debug','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0xdace,0xc5));var _0xedac=function(_0x5af97c,_0x24a49f){_0x5af97c=_0x5af97c-0x0;var _0x3472ae=_0xdace[_0x5af97c];return _0x3472ae;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbd3,_0x4081c6,_0x21440e){return new BPromise(function(_0x162eea,_0x53fa43){return client[_0xedac('0xb')](_0x5ecbd3,_0x21440e)[_0xedac('0xc')](function(_0xc98887){logger['info']('SalesforceField,\x20%s,\x20%s',_0x4081c6,_0xedac('0xd'));logger[_0xedac('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4081c6,'request\x20sent',JSON[_0xedac('0xf')](_0xc98887));if(_0xc98887[_0xedac('0x10')]){if(_0xc98887['error'][_0xedac('0x11')]===0x1f4){logger['error'](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);return _0x53fa43(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')]['message']);return _0x162eea(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}else{logger[_0xedac('0x14')](_0xedac('0x12'),_0x4081c6,_0xedac('0xd'));_0x162eea(_0xc98887['result'][_0xedac('0x13')]);}})['catch'](function(_0xddc7b8){logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xddc7b8);_0x53fa43(_0xddc7b8);});});} \ No newline at end of file +var _0xb4e6=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0xb4e6[_0x31b5b2];return _0x364f13;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var moment=require(_0x6b4e('0x1'));var BPromise=require(_0x6b4e('0x2'));var rs=require(_0x6b4e('0x3'));var fs=require('fs');var Redis=require(_0x6b4e('0x4'));var db=require(_0x6b4e('0x5'))['db'];var utils=require(_0x6b4e('0x6'));var logger=require(_0x6b4e('0x7'))('rpc');var config=require(_0x6b4e('0x8'));var jayson=require(_0x6b4e('0x9'));var client=jayson[_0x6b4e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd3138f,_0x570346,_0x4f00be){return new BPromise(function(_0x2311d9,_0x48c870){return client['request'](_0xd3138f,_0x4f00be)[_0x6b4e('0xb')](function(_0x2bd576){logger[_0x6b4e('0xc')](_0x6b4e('0xd'),_0x570346,_0x6b4e('0xe'));logger[_0x6b4e('0xf')](_0x6b4e('0x10'),_0x570346,'request\x20sent',JSON[_0x6b4e('0x11')](_0x2bd576));if(_0x2bd576[_0x6b4e('0x12')]){if(_0x2bd576['error'][_0x6b4e('0x13')]===0x1f4){logger[_0x6b4e('0x12')](_0x6b4e('0xd'),_0x570346,_0x2bd576[_0x6b4e('0x12')][_0x6b4e('0x14')]);return _0x48c870(_0x2bd576[_0x6b4e('0x12')][_0x6b4e('0x14')]);}logger['error'](_0x6b4e('0xd'),_0x570346,_0x2bd576[_0x6b4e('0x12')]['message']);return _0x2311d9(_0x2bd576[_0x6b4e('0x12')]['message']);}else{logger[_0x6b4e('0xc')](_0x6b4e('0xd'),_0x570346,_0x6b4e('0xe'));_0x2311d9(_0x2bd576[_0x6b4e('0x15')][_0x6b4e('0x14')]);}})[_0x6b4e('0x16')](function(_0x53a934){logger['error'](_0x6b4e('0xd'),_0x570346,_0x53a934);_0x48c870(_0x53a934);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 8c2390f..f2e8884 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 _0x4a9c=['post','create','/:id/configurations','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','index','get','/:id','isAuthenticated','getConfigurations','/:id/fields','getFields'];(function(_0xd6a568,_0x4d39e9){var _0x56e5ab=function(_0x205d9e){while(--_0x205d9e){_0xd6a568['push'](_0xd6a568['shift']());}};_0x56e5ab(++_0x4d39e9);}(_0x4a9c,0xcc));var _0xc4a9=function(_0xaffd31,_0x588f1c){_0xaffd31=_0xaffd31-0x0;var _0x35e3b5=_0x4a9c[_0xaffd31];return _0x35e3b5;};'use strict';var multer=require(_0xc4a9('0x0'));var util=require(_0xc4a9('0x1'));var path=require(_0xc4a9('0x2'));var timeout=require(_0xc4a9('0x3'));var express=require(_0xc4a9('0x4'));var router=express[_0xc4a9('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc4a9('0x6'));var config=require(_0xc4a9('0x7'));var controller=require(_0xc4a9('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc4a9('0x9')]);router[_0xc4a9('0xa')](_0xc4a9('0xb'),auth[_0xc4a9('0xc')](),controller['show']);router[_0xc4a9('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xc4a9('0xd')]);router[_0xc4a9('0xa')](_0xc4a9('0xe'),auth[_0xc4a9('0xc')](),controller[_0xc4a9('0xf')]);router[_0xc4a9('0x10')]('/',auth[_0xc4a9('0xc')](),controller[_0xc4a9('0x11')]);router[_0xc4a9('0x10')](_0xc4a9('0x12'),auth[_0xc4a9('0xc')](),controller['addConfiguration']);router[_0xc4a9('0x13')](_0xc4a9('0xb'),auth[_0xc4a9('0xc')](),controller['update']);router[_0xc4a9('0x14')](_0xc4a9('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xc4a9('0x15')]=router; \ No newline at end of file +var _0xf698=['../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x1bb5ff,_0x487481){var _0x59ed62=function(_0x2965b8){while(--_0x2965b8){_0x1bb5ff['push'](_0x1bb5ff['shift']());}};_0x59ed62(++_0x487481);}(_0xf698,0x1de));var _0x8f69=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0xf698[_0x26bf51];return _0x503415;};'use strict';var multer=require(_0x8f69('0x0'));var util=require(_0x8f69('0x1'));var path=require('path');var timeout=require(_0x8f69('0x2'));var express=require(_0x8f69('0x3'));var router=express['Router']();var auth=require(_0x8f69('0x4'));var interaction=require(_0x8f69('0x5'));var config=require(_0x8f69('0x6'));var controller=require(_0x8f69('0x7'));router['get']('/',auth[_0x8f69('0x8')](),controller['index']);router['get']('/:id',auth[_0x8f69('0x8')](),controller[_0x8f69('0x9')]);router[_0x8f69('0xa')](_0x8f69('0xb'),auth[_0x8f69('0x8')](),controller[_0x8f69('0xc')]);router[_0x8f69('0xa')](_0x8f69('0xd'),auth[_0x8f69('0x8')](),controller[_0x8f69('0xe')]);router[_0x8f69('0xf')]('/',auth[_0x8f69('0x8')](),controller['create']);router[_0x8f69('0xf')]('/:id/configurations',auth[_0x8f69('0x8')](),controller['addConfiguration']);router[_0x8f69('0x10')]('/:id',auth[_0x8f69('0x8')](),controller[_0x8f69('0x11')]);router[_0x8f69('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8f69('0x13')]);module[_0x8f69('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 d23a2f7..f3640f5 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 _0x4cea=['username','STRING','sequelize','exports'];(function(_0x39803d,_0x360e50){var _0x33a9c9=function(_0x39d448){while(--_0x39d448){_0x39803d['push'](_0x39803d['shift']());}};_0x33a9c9(++_0x360e50);}(_0x4cea,0x6e));var _0xa4ce=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4cea[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xa4ce('0x0'));module[_0xa4ce('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xa4ce('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa4ce('0x3')]},'remoteUri':{'type':Sequelize[_0xa4ce('0x3')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xa4ce('0x3')]}}; \ No newline at end of file +var _0x4572=['STRING','username','remoteUri','sequelize','exports'];(function(_0x3d4ef1,_0x5a957c){var _0x409423=function(_0x1ab129){while(--_0x1ab129){_0x3d4ef1['push'](_0x3d4ef1['shift']());}};_0x409423(++_0x5a957c);}(_0x4572,0x1e8));var _0x2457=function(_0x45ce08,_0x59dcc7){_0x45ce08=_0x45ce08-0x0;var _0x23dff2=_0x4572[_0x45ce08];return _0x23dff2;};'use strict';var Sequelize=require(_0x2457('0x0'));module[_0x2457('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2457('0x2')]},'username':{'type':Sequelize[_0x2457('0x2')],'unique':_0x2457('0x3')},'password':{'type':Sequelize[_0x2457('0x2')]},'email':{'type':Sequelize[_0x2457('0x2')]},'remoteUri':{'type':Sequelize[_0x2457('0x2')],'unique':_0x2457('0x4')},'serverUrl':{'type':Sequelize[_0x2457('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 0dc7528..781d597 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 _0x3aa2=['work_notes_list','sys_domain_path','rfc','expected_start','opened_at','group_list','reopened_time','caller_id','approval_set','work_notes','short_description','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','severity','comments','sla_due','comments_and_work_notes','due_date','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','email','serverUrl','remoteUri','slice','substring','format','%s/api/now/doc/table/schema/','username','incident?sysparm_display_value=all','result','assign','remove','includes','label','push','all','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','internalType','ServiceNow\x20error:\x20','test','statusCode','stack','Wrong\x20credentials','boolean','False','false','GET','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','catch','create','body','ServicenowConfiguration','pick','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','category','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_domain','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active'];(function(_0x3e0aa6,_0x1a542b){var _0x2443cb=function(_0x3578ec){while(--_0x3578ec){_0x3e0aa6['push'](_0x3e0aa6['shift']());}};_0x2443cb(++_0x1a542b);}(_0x3aa2,0x1d3));var _0x23aa=function(_0x2558ee,_0x2a2574){_0x2558ee=_0x2558ee-0x0;var _0x431306=_0x3aa2[_0x2558ee];return _0x431306;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x23aa('0x0'));var rimraf=require(_0x23aa('0x1'));var zipdir=require(_0x23aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23aa('0x3'));var moment=require(_0x23aa('0x4'));var BPromise=require(_0x23aa('0x5'));var Mustache=require(_0x23aa('0x6'));var util=require(_0x23aa('0x7'));var path=require(_0x23aa('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x23aa('0x9'));var crypto=require(_0x23aa('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x23aa('0xb'));var toCsv=require(_0x23aa('0xc'));var querystring=require('querystring');var Papa=require(_0x23aa('0xd'));var Redis=require(_0x23aa('0xe'));var authService=require(_0x23aa('0xf'));var qs=require(_0x23aa('0x10'));var as=require(_0x23aa('0x11'));var hardwareService=require(_0x23aa('0x12'));var logger=require(_0x23aa('0x13'))('api');var utils=require(_0x23aa('0x14'));var config=require(_0x23aa('0x15'));var db=require(_0x23aa('0x16'))['db'];var integrations=require(_0x23aa('0x17'));var jayson=require(_0x23aa('0x18'));var client=jayson[_0x23aa('0x19')][_0x23aa('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x52a66c,_0x39592c,_0x156421){if(_0x156421){var _0x500492=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x500492['test'](_0x39592c)){return _0x52a66c;}else{throw new db[(_0x23aa('0x1b'))][(_0x23aa('0x1c'))](_0x23aa('0x1d'));}}else{return _0x52a66c;}}function respondWithRpcPromise(_0x1288b5,_0xba99,_0x8673da,_0x5f5405){return new BPromise(function(_0x6c26ef,_0x487d1d){var _0x3e15fe=_0x5f5405||client;return _0x3e15fe[_0x23aa('0x1e')](_0x1288b5,_0x8673da)['then'](function(_0x5eb853){logger[_0x23aa('0x1f')](_0x23aa('0x20'),_0xba99,_0x23aa('0x21'));logger[_0x23aa('0x22')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xba99,_0x23aa('0x21'),JSON['stringify'](_0x5eb853));if(_0x5eb853[_0x23aa('0x23')]){if(_0x5eb853[_0x23aa('0x23')]['code']===0x1f4){logger[_0x23aa('0x23')](_0x23aa('0x20'),_0xba99,_0x5eb853[_0x23aa('0x23')][_0x23aa('0x24')]);return _0x487d1d(_0x5eb853[_0x23aa('0x23')][_0x23aa('0x24')]);}logger[_0x23aa('0x23')]('ServicenowAccount,\x20%s,\x20%s',_0xba99,_0x5eb853[_0x23aa('0x23')][_0x23aa('0x24')]);return _0x6c26ef(_0x5eb853[_0x23aa('0x23')][_0x23aa('0x24')]);}else{logger[_0x23aa('0x1f')](_0x23aa('0x20'),_0xba99,_0x23aa('0x21'));_0x6c26ef(_0x5eb853['result'][_0x23aa('0x24')]);}})['catch'](function(_0x2488a5){logger[_0x23aa('0x23')]('ServicenowAccount,\x20%s,\x20%s',_0xba99,_0x2488a5);_0x487d1d(_0x2488a5);});});}function respondWithStatusCode(_0x43a2a0,_0x4ee74f){_0x4ee74f=_0x4ee74f||0xcc;return function(_0x30e5a6){if(_0x30e5a6){return _0x43a2a0[_0x23aa('0x25')](_0x4ee74f);}return _0x43a2a0[_0x23aa('0x26')](_0x4ee74f)[_0x23aa('0x27')]();};}function respondWithResult(_0x5f461a,_0x4b6f9f){_0x4b6f9f=_0x4b6f9f||0xc8;return function(_0x4b9ccc){if(_0x4b9ccc){return _0x5f461a[_0x23aa('0x26')](_0x4b6f9f)[_0x23aa('0x28')](_0x4b9ccc);}};}function respondWithFilteredResult(_0x38c5ce,_0x45e398){return function(_0x422053){if(_0x422053){var _0x5bd0e9=_0x422053[_0x23aa('0x29')],_0x54e881=_0x45e398[_0x23aa('0x2a')],_0x4901d3=_0x45e398[_0x23aa('0x2a')]+_0x45e398['limit'],_0x8caa3;if(_0x4901d3>=_0x5bd0e9){_0x4901d3=_0x5bd0e9;_0x8caa3=0xc8;}else{_0x8caa3=0xce;}_0x38c5ce['status'](_0x8caa3);return _0x38c5ce[_0x23aa('0x2b')](_0x23aa('0x2c'),_0x54e881+'-'+_0x4901d3+'/'+_0x5bd0e9)[_0x23aa('0x28')](_0x422053);}return null;};}function patchUpdates(_0x45f5d4){return function(_0x1a3aff){try{jsonpatch[_0x23aa('0x2d')](_0x1a3aff,_0x45f5d4,!![]);}catch(_0x3c3bb8){return BPromise[_0x23aa('0x2e')](_0x3c3bb8);}return _0x1a3aff[_0x23aa('0x2f')]();};}function saveUpdates(_0x48e3e2,_0x1bc388){return function(_0x1f3255){if(_0x1f3255){return _0x1f3255[_0x23aa('0x30')](_0x48e3e2)[_0x23aa('0x31')](function(_0x5534d8){return _0x5534d8;});}return null;};}function removeEntity(_0x25884b,_0x4e2126){return function(_0x31c809){if(_0x31c809){return _0x31c809[_0x23aa('0x32')]()['then'](function(){_0x25884b[_0x23aa('0x26')](0xcc)[_0x23aa('0x27')]();});}};}function handleEntityNotFound(_0x45636,_0x3f8f86){return function(_0x486874){if(!_0x486874){_0x45636[_0x23aa('0x25')](0x194);}return _0x486874;};}function handleError(_0x4b867a,_0x2137a7){_0x2137a7=_0x2137a7||0x1f4;return function(_0x18eb08){logger[_0x23aa('0x23')](_0x18eb08['stack']);if(_0x18eb08[_0x23aa('0x33')]){delete _0x18eb08['name'];}_0x4b867a[_0x23aa('0x26')](_0x2137a7)[_0x23aa('0x34')](_0x18eb08);};}exports[_0x23aa('0x35')]=function(_0x38de51,_0x5ee551){var _0xa51583={},_0x2776d4={},_0xddbe76={'count':0x0,'rows':[]};var _0xc1c266=_[_0x23aa('0x36')](db[_0x23aa('0x37')][_0x23aa('0x38')],function(_0x109914){return{'name':_0x109914[_0x23aa('0x39')],'type':_0x109914[_0x23aa('0x3a')][_0x23aa('0x3b')]};});_0x2776d4[_0x23aa('0x3c')]=_[_0x23aa('0x36')](_0xc1c266,_0x23aa('0x33'));_0x2776d4[_0x23aa('0x3d')]=_[_0x23aa('0x3e')](_0x38de51[_0x23aa('0x3d')]);_0x2776d4[_0x23aa('0x3f')]=_[_0x23aa('0x40')](_0x2776d4[_0x23aa('0x3c')],_0x2776d4['query']);_0xa51583[_0x23aa('0x41')]=_[_0x23aa('0x40')](_0x2776d4[_0x23aa('0x3c')],qs[_0x23aa('0x42')](_0x38de51['query']['fields']));_0xa51583[_0x23aa('0x41')]=_0xa51583[_0x23aa('0x41')][_0x23aa('0x43')]?_0xa51583[_0x23aa('0x41')]:_0x2776d4['model'];if(!_0x38de51[_0x23aa('0x3d')][_0x23aa('0x44')](_0x23aa('0x45'))){_0xa51583['limit']=qs['limit'](_0x38de51['query'][_0x23aa('0x46')]);_0xa51583[_0x23aa('0x2a')]=qs[_0x23aa('0x2a')](_0x38de51[_0x23aa('0x3d')]['offset']);}_0xa51583[_0x23aa('0x47')]=qs[_0x23aa('0x48')](_0x38de51[_0x23aa('0x3d')][_0x23aa('0x48')]);_0xa51583[_0x23aa('0x49')]=qs['filters'](_['pick'](_0x38de51[_0x23aa('0x3d')],_0x2776d4['filters']));if(_0x38de51[_0x23aa('0x3d')][_0x23aa('0x4a')]){_0xa51583[_0x23aa('0x49')]=_[_0x23aa('0x4b')](_0xa51583['where'],{'$or':_[_0x23aa('0x36')](_0xc1c266,function(_0x3c6d3f){if(_0x3c6d3f['type']!==_0x23aa('0x4c')){var _0x315102={};_0x315102[_0x3c6d3f['name']]={'$like':'%'+_0x38de51[_0x23aa('0x3d')][_0x23aa('0x4a')]+'%'};return _0x315102;}})});}_0xa51583=_[_0x23aa('0x4b')]({},_0xa51583,_0x38de51[_0x23aa('0x4d')]);var _0x285615={'where':_0xa51583[_0x23aa('0x49')]};return db[_0x23aa('0x37')][_0x23aa('0x29')](_0x285615)[_0x23aa('0x31')](function(_0x2b8185){_0xddbe76[_0x23aa('0x29')]=_0x2b8185;if(_0x38de51[_0x23aa('0x3d')][_0x23aa('0x4e')]){_0xa51583['include']=[{'all':!![]}];}return db[_0x23aa('0x37')]['findAll'](_0xa51583);})[_0x23aa('0x31')](function(_0x395a9f){_0xddbe76[_0x23aa('0x4f')]=_0x395a9f;return _0xddbe76;})[_0x23aa('0x31')](respondWithFilteredResult(_0x5ee551,_0xa51583))['catch'](handleError(_0x5ee551,null));};exports[_0x23aa('0x50')]=function(_0x1d46e,_0x5c58e0){var _0x462e58={'raw':![],'where':{'id':_0x1d46e[_0x23aa('0x51')]['id']}},_0x115a7f={};_0x115a7f['model']=_[_0x23aa('0x3e')](db[_0x23aa('0x37')]['rawAttributes']);_0x115a7f[_0x23aa('0x3d')]=_['keys'](_0x1d46e[_0x23aa('0x3d')]);_0x115a7f[_0x23aa('0x3f')]=_[_0x23aa('0x40')](_0x115a7f[_0x23aa('0x3c')],_0x115a7f[_0x23aa('0x3d')]);_0x462e58[_0x23aa('0x41')]=_[_0x23aa('0x40')](_0x115a7f[_0x23aa('0x3c')],qs[_0x23aa('0x42')](_0x1d46e[_0x23aa('0x3d')][_0x23aa('0x42')]));_0x462e58[_0x23aa('0x41')]=_0x462e58['attributes']['length']?_0x462e58['attributes']:_0x115a7f[_0x23aa('0x3c')];if(_0x1d46e['query'][_0x23aa('0x4e')]){_0x462e58[_0x23aa('0x52')]=[{'all':!![]}];}_0x462e58=_[_0x23aa('0x4b')]({},_0x462e58,_0x1d46e[_0x23aa('0x4d')]);return db[_0x23aa('0x37')][_0x23aa('0x53')](_0x462e58)['then'](handleEntityNotFound(_0x5c58e0,null))[_0x23aa('0x31')](respondWithResult(_0x5c58e0,null))[_0x23aa('0x54')](handleError(_0x5c58e0,null));};exports['create']=function(_0x1311df,_0x3e2eaa){return db[_0x23aa('0x37')][_0x23aa('0x55')](_0x1311df[_0x23aa('0x56')],{})['then'](respondWithResult(_0x3e2eaa,0xc9))['catch'](handleError(_0x3e2eaa,null));};exports[_0x23aa('0x30')]=function(_0x4dad55,_0x2aed59){if(_0x4dad55[_0x23aa('0x56')]['id']){delete _0x4dad55[_0x23aa('0x56')]['id'];}return db[_0x23aa('0x37')][_0x23aa('0x53')]({'where':{'id':_0x4dad55[_0x23aa('0x51')]['id']}})[_0x23aa('0x31')](handleEntityNotFound(_0x2aed59,null))[_0x23aa('0x31')](saveUpdates(_0x4dad55[_0x23aa('0x56')],null))['then'](respondWithResult(_0x2aed59,null))['catch'](handleError(_0x2aed59,null));};exports[_0x23aa('0x32')]=function(_0x1cf933,_0x497940){return db[_0x23aa('0x37')][_0x23aa('0x53')]({'where':{'id':_0x1cf933[_0x23aa('0x51')]['id']}})['then'](handleEntityNotFound(_0x497940,null))['then'](removeEntity(_0x497940,null))[_0x23aa('0x54')](handleError(_0x497940,null));};exports['getConfigurations']=function(_0x34adc6,_0x4ad30e,_0x18227c){var _0x4c0e12={};var _0x2b355d={};var _0x6df981;var _0x5a1107;return db[_0x23aa('0x37')]['findOne']({'where':{'id':_0x34adc6[_0x23aa('0x51')]['id']}})[_0x23aa('0x31')](handleEntityNotFound(_0x4ad30e,null))[_0x23aa('0x31')](function(_0x5db3bb){if(_0x5db3bb){_0x6df981=_0x5db3bb;_0x2b355d[_0x23aa('0x3c')]=_[_0x23aa('0x3e')](db[_0x23aa('0x57')][_0x23aa('0x38')]);_0x2b355d[_0x23aa('0x3d')]=_[_0x23aa('0x3e')](_0x34adc6['query']);_0x2b355d['filters']=_[_0x23aa('0x40')](_0x2b355d[_0x23aa('0x3c')],_0x2b355d['query']);_0x4c0e12[_0x23aa('0x41')]=_['intersection'](_0x2b355d[_0x23aa('0x3c')],qs[_0x23aa('0x42')](_0x34adc6['query'][_0x23aa('0x42')]));_0x4c0e12[_0x23aa('0x41')]=_0x4c0e12[_0x23aa('0x41')]['length']?_0x4c0e12[_0x23aa('0x41')]:_0x2b355d[_0x23aa('0x3c')];_0x4c0e12[_0x23aa('0x47')]=qs[_0x23aa('0x48')](_0x34adc6['query']['sort']);_0x4c0e12[_0x23aa('0x49')]=qs[_0x23aa('0x3f')](_[_0x23aa('0x58')](_0x34adc6[_0x23aa('0x3d')],_0x2b355d[_0x23aa('0x3f')]));if(_0x34adc6[_0x23aa('0x3d')][_0x23aa('0x4a')]){_0x4c0e12[_0x23aa('0x49')]=_[_0x23aa('0x4b')](_0x4c0e12['where'],{'$or':_[_0x23aa('0x36')](_0x4c0e12['attributes'],function(_0x469950){var _0x550bd2={};_0x550bd2[_0x469950]={'$like':'%'+_0x34adc6[_0x23aa('0x3d')][_0x23aa('0x4a')]+'%'};return _0x550bd2;})});}_0x4c0e12=_['merge']({},_0x4c0e12,_0x34adc6[_0x23aa('0x4d')]);return _0x6df981[_0x23aa('0x59')](_0x4c0e12);}})[_0x23aa('0x31')](function(_0x2d5987){if(_0x2d5987){_0x5a1107=_0x2d5987['length'];if(!_0x34adc6['query'][_0x23aa('0x44')](_0x23aa('0x45'))){_0x4c0e12[_0x23aa('0x46')]=qs[_0x23aa('0x46')](_0x34adc6[_0x23aa('0x3d')][_0x23aa('0x46')]);_0x4c0e12[_0x23aa('0x2a')]=qs[_0x23aa('0x2a')](_0x34adc6['query']['offset']);}return _0x6df981[_0x23aa('0x59')](_0x4c0e12);}})[_0x23aa('0x31')](function(_0x181ae5){if(_0x181ae5){return _0x181ae5?{'count':_0x5a1107,'rows':_0x181ae5}:null;}})[_0x23aa('0x31')](respondWithResult(_0x4ad30e,null))[_0x23aa('0x54')](handleError(_0x4ad30e,null));};exports['addConfiguration']=function(_0x26b666,_0x3e92e2,_0x2d9bed){if(_0x26b666[_0x23aa('0x56')]['id']){delete _0x26b666[_0x23aa('0x56')]['id'];}return db[_0x23aa('0x37')][_0x23aa('0x5a')]({'where':{'id':_0x26b666[_0x23aa('0x51')]['id']}})[_0x23aa('0x31')](handleEntityNotFound(_0x3e92e2,null))[_0x23aa('0x31')](function(_0x2638da){if(_0x2638da){_0x26b666[_0x23aa('0x56')][_0x23aa('0x5b')]=_0x2638da['id'];_0x26b666[_0x23aa('0x56')][_0x23aa('0x5c')]=integrations[_0x23aa('0x5d')](_0x26b666[_0x23aa('0x56')][_0x23aa('0x5e')],_0x26b666[_0x23aa('0x56')][_0x23aa('0x3a')]);_0x26b666[_0x23aa('0x56')][_0x23aa('0x5f')]=integrations[_0x23aa('0x60')](_0x26b666[_0x23aa('0x56')][_0x23aa('0x5e')],_0x26b666[_0x23aa('0x56')][_0x23aa('0x3a')]);return db['ServicenowConfiguration']['create'](_0x26b666[_0x23aa('0x56')],{'include':[{'model':db[_0x23aa('0x61')],'as':'Subjects'},{'model':db[_0x23aa('0x61')],'as':_0x23aa('0x5f')}]});}return null;})[_0x23aa('0x31')](respondWithResult(_0x3e92e2,null))[_0x23aa('0x54')](handleError(_0x3e92e2,null));};exports[_0x23aa('0x62')]=function(_0x5f240a,_0x152e6c,_0x4def90){var _0x4729c7=[_0x23aa('0x63'),_0x23aa('0x64'),'knowledge',_0x23aa('0x65'),_0x23aa('0x66'),_0x23aa('0x67'),_0x23aa('0x68'),'severity',_0x23aa('0x69')];var _0xe88a69=[_0x23aa('0x6a'),_0x23aa('0x63'),_0x23aa('0x6b'),_0x23aa('0x6c'),_0x23aa('0x6d'),_0x23aa('0x6e'),_0x23aa('0x6f'),'hold_reason',_0x23aa('0x70'),_0x23aa('0x71'),_0x23aa('0x72'),_0x23aa('0x73'),_0x23aa('0x74'),_0x23aa('0x75'),'sys_created_on',_0x23aa('0x76'),'state',_0x23aa('0x77'),_0x23aa('0x78'),_0x23aa('0x47'),_0x23aa('0x79'),_0x23aa('0x7a'),_0x23aa('0x7b'),_0x23aa('0x7c'),_0x23aa('0x7d'),_0x23aa('0x7e'),_0x23aa('0x7f'),'business_service','priority',_0x23aa('0x80'),_0x23aa('0x81'),'time_worked',_0x23aa('0x82'),_0x23aa('0x83'),'business_duration',_0x23aa('0x84'),'work_end',_0x23aa('0x85'),'resolved_at',_0x23aa('0x86'),_0x23aa('0x87'),'subcategory',_0x23aa('0x88'),_0x23aa('0x89'),_0x23aa('0x66'),'correlation_display','delivery_task',_0x23aa('0x8a'),_0x23aa('0x8b'),_0x23aa('0x8c'),_0x23aa('0x8d'),_0x23aa('0x8e'),_0x23aa('0x8f'),_0x23aa('0x67'),_0x23aa('0x90'),'close_notes',_0x23aa('0x91'),_0x23aa('0x92'),_0x23aa('0x93'),_0x23aa('0x94'),_0x23aa('0x95'),_0x23aa('0x96'),_0x23aa('0x68'),_0x23aa('0x97'),_0x23aa('0x98'),_0x23aa('0x99'),_0x23aa('0x9a'),_0x23aa('0x9b'),'assigned_to',_0x23aa('0x9c'),_0x23aa('0x9d'),_0x23aa('0x9e'),'approval',_0x23aa('0x9f'),_0x23aa('0xa0'),'sys_mod_count',_0x23aa('0xa1'),_0x23aa('0xa2'),_0x23aa('0xa3'),_0x23aa('0xa4'),_0x23aa('0xa5'),_0x23aa('0xa6'),_0x23aa('0x69')];var _0x535dbe='';var _0x1aa017='';var _0x21eaff=[];var _0x316c19='';var _0x134091='';var _0x248d80=[];var _0x40fbe1='';var _0x145da3='';var _0x3b0149={};var _0x5894af='';return db[_0x23aa('0x37')]['findOne']({'where':{'id':_0x5f240a[_0x23aa('0x51')]['id']},'attributes':['id','username','password',_0x23aa('0xa7'),'remoteUri',_0x23aa('0xa8')]})[_0x23aa('0x31')](handleEntityNotFound(_0x152e6c,null))[_0x23aa('0x31')](function(_0x499e9f){if(_0x499e9f){_0x5894af=_0x499e9f[_0x23aa('0xa9')];var _0x30ec75=_0x5894af[_0x23aa('0xaa')](-0x1);if(_0x30ec75==='/'){_0x5894af=_0x5894af[_0x23aa('0xab')](0x0,_0x5894af['lastIndexOf'](_0x30ec75));}_0x145da3=util[_0x23aa('0xac')](_0x23aa('0xad'),_0x5894af);_0x40fbe1=util['format']('%s/api/now/table/',_0x5894af);_0x3b0149={'user':_0x499e9f[_0x23aa('0xae')],'pass':_0x499e9f['password']};var _0x517f17={'method':'GET','uri':_0x145da3+_0x23aa('0xaf'),'auth':_0x3b0149,'json':!![]};return rp(_0x517f17);}})[_0x23aa('0x31')](function(_0x358eb3){if(_0x358eb3[_0x23aa('0xb0')][_0x23aa('0x43')]>0x0){_0x535dbe=_0x358eb3[_0x23aa('0xb0')];}console['log']('incident\x20table\x20objects',_0x535dbe);_0x248d80=[];_0x1aa017=Object[_0x23aa('0xb1')]([],_0x535dbe);_[_0x23aa('0xb2')](_0x1aa017,function(_0x5e63ad){return!_0x4729c7[_0x23aa('0xb3')](_0x5e63ad[_0x23aa('0x33')]);});_0x1aa017['forEach'](function(_0x39e7a5){var _0x4ec974=createFieldObject(_0x40fbe1,_0x3b0149,_0x39e7a5['internalType'],_0x39e7a5['name'],_0x39e7a5[_0x23aa('0xb4')],![]);_0x248d80[_0x23aa('0xb5')](_0x4ec974);});return Promise[_0x23aa('0xb6')](_0x248d80);})[_0x23aa('0x31')](function(_0xf84230){_0x21eaff=_0xf84230;_0x316c19=Object[_0x23aa('0xb1')]([],_0x535dbe);console[_0x23aa('0xb7')]('TCL:\x20_object',_0x535dbe);_[_0x23aa('0xb2')](_0x316c19,function(_0x41adf7){return _0xe88a69[_0x23aa('0xb3')](_0x41adf7[_0x23aa('0x33')]);});console[_0x23aa('0xb7')](_0x23aa('0xb8'),_0x316c19);_0x248d80=[];_0x316c19[_0x23aa('0xb9')](function(_0x5134d1){var _0xaf8d7=createFieldObject(_0x40fbe1,_0x3b0149,_0x5134d1[_0x23aa('0xba')],_0x5134d1[_0x23aa('0x33')],_0x5134d1['label'],!![]);_0x248d80[_0x23aa('0xb5')](_0xaf8d7);});return Promise[_0x23aa('0xb6')](_0x248d80);})[_0x23aa('0x31')](function(_0x384d80){_0x134091=_0x384d80;var _0x3a51ee=_0x21eaff['concat'](_0x134091);return{'count':_0x3a51ee['length'],'rows':_0x3a51ee};})[_0x23aa('0x31')](respondWithResult(_0x152e6c,null))[_0x23aa('0x54')](function(_0x2e1ceb){console[_0x23aa('0xb7')](_0x23aa('0xbb')+_0x2e1ceb);var _0x532325=_0x5f240a[_0x23aa('0x3d')][_0x23aa('0xbc')]?0x1f4:_0x2e1ceb[_0x23aa('0xbd')]||0x1f4;logger['error'](_0x2e1ceb[_0x23aa('0xbe')]);delete _0x2e1ceb[_0x23aa('0x33')];if(_0x532325===0x191){_0x532325=0x190;}_0x152e6c[_0x23aa('0x26')](_0x532325)['send'](_0x5f240a[_0x23aa('0x3d')][_0x23aa('0xbc')]?{'message':_0x23aa('0xbf'),'statusCode':_0x2e1ceb[_0x23aa('0xbd')]}:_0x2e1ceb);});};function createFieldObject(_0x14517e,_0x1cb0a7,_0x3585d0,_0x5a49a9,_0x385c86,_0xadeddf){return new Promise(function(_0x5da15d,_0x1cc6d7){var _0xa7527b={'id':_0x5a49a9,'name':_0x385c86,'custom':_0xadeddf};if(_0x3585d0===_0x23aa('0xc0')){_0xa7527b[_0x23aa('0x4d')]=[{'name':'True','value':'true'},{'name':_0x23aa('0xc1'),'value':_0x23aa('0xc2')}];_0x5da15d(_0xa7527b);}else{var _0x43b8e4={'method':_0x23aa('0xc3'),'uri':_0x14517e+_0x23aa('0xc4')+_0x5a49a9,'auth':_0x1cb0a7,'json':!![]};return rp(_0x43b8e4)[_0x23aa('0x31')](function(_0x33223a){var _0x1d2d27=[];if(_0x33223a[_0x23aa('0xb0')][_0x23aa('0x43')]>0x0){_0x33223a['result'][_0x23aa('0xb9')](function(_0x5d1e9c){if(_0x5d1e9c['inactive']===_0x23aa('0xc2')){var _0x5cf26d={'name':_0x5d1e9c[_0x23aa('0xb4')],'value':_0x5d1e9c[_0x23aa('0xc5')]};_0x1d2d27[_0x23aa('0xb5')](_0x5cf26d);}});}_0xa7527b['options']=_0x1d2d27;if(_0xa7527b[_0x23aa('0x4d')][_0x23aa('0x43')]>0x0){_0x5da15d(_0xa7527b);}else{if(_0xadeddf==![]){_0x5da15d();}else{_0x5da15d(_0xa7527b);}}});}});} \ No newline at end of file +var _0x665c=['value','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','code','ServicenowAccount,\x20%s,\x20%s','message','catch','sendStatus','status','json','count','offset','limit','apply','reject','save','update','destroy','end','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','show','params','keys','find','create','body','getConfigurations','findOne','ServicenowConfiguration','options','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','subcategory','close_code','notify','severity','category','parent','watch_list','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','active','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','correlation_id','location','username','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','result','log','assign','remove','forEach','internalType','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','statusCode','stack','Wrong\x20credentials','boolean','True','true','False','GET','inactive','false'];(function(_0x7d2837,_0x1aa4cd){var _0x3b57e8=function(_0x3a414c){while(--_0x3a414c){_0x7d2837['push'](_0x7d2837['shift']());}};_0x3b57e8(++_0x1aa4cd);}(_0x665c,0x18d));var _0xc665=function(_0x1e4a9f,_0x181033){_0x1e4a9f=_0x1e4a9f-0x0;var _0xd8a259=_0x665c[_0x1e4a9f];return _0xd8a259;};'use strict';var pdf=require(_0xc665('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc665('0x1'));var zipdir=require(_0xc665('0x2'));var jsonpatch=require(_0xc665('0x3'));var rp=require('request-promise');var moment=require(_0xc665('0x4'));var BPromise=require(_0xc665('0x5'));var Mustache=require(_0xc665('0x6'));var util=require(_0xc665('0x7'));var path=require(_0xc665('0x8'));var sox=require(_0xc665('0x9'));var csv=require(_0xc665('0xa'));var ejs=require(_0xc665('0xb'));var fs=require('fs');var _=require(_0xc665('0xc'));var squel=require(_0xc665('0xd'));var crypto=require(_0xc665('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc665('0xf'));var toCsv=require(_0xc665('0xa'));var querystring=require(_0xc665('0x10'));var Papa=require(_0xc665('0x11'));var Redis=require(_0xc665('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc665('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc665('0x14'))(_0xc665('0x15'));var utils=require(_0xc665('0x16'));var config=require(_0xc665('0x17'));var db=require(_0xc665('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xc665('0x19'));var client=jayson[_0xc665('0x1a')][_0xc665('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2b2e35,_0x5eee7b,_0x4bfe01){if(_0x4bfe01){var _0x2c5bb0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c5bb0[_0xc665('0x1c')](_0x5eee7b)){return _0x2b2e35;}else{throw new db['Sequelize'][(_0xc665('0x1d'))](_0xc665('0x1e'));}}else{return _0x2b2e35;}}function respondWithRpcPromise(_0x162049,_0x5f0471,_0x24f166,_0x5b3c73){return new BPromise(function(_0x2b122f,_0x566dea){var _0x5774ab=_0x5b3c73||client;return _0x5774ab[_0xc665('0x1f')](_0x162049,_0x24f166)[_0xc665('0x20')](function(_0x138dbc){logger[_0xc665('0x21')]('ServicenowAccount,\x20%s,\x20%s',_0x5f0471,_0xc665('0x22'));logger[_0xc665('0x23')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x5f0471,_0xc665('0x22'),JSON['stringify'](_0x138dbc));if(_0x138dbc[_0xc665('0x24')]){if(_0x138dbc[_0xc665('0x24')][_0xc665('0x25')]===0x1f4){logger[_0xc665('0x24')](_0xc665('0x26'),_0x5f0471,_0x138dbc[_0xc665('0x24')][_0xc665('0x27')]);return _0x566dea(_0x138dbc[_0xc665('0x24')][_0xc665('0x27')]);}logger[_0xc665('0x24')]('ServicenowAccount,\x20%s,\x20%s',_0x5f0471,_0x138dbc[_0xc665('0x24')][_0xc665('0x27')]);return _0x2b122f(_0x138dbc[_0xc665('0x24')]['message']);}else{logger[_0xc665('0x21')](_0xc665('0x26'),_0x5f0471,_0xc665('0x22'));_0x2b122f(_0x138dbc['result'][_0xc665('0x27')]);}})[_0xc665('0x28')](function(_0x2e178c){logger[_0xc665('0x24')](_0xc665('0x26'),_0x5f0471,_0x2e178c);_0x566dea(_0x2e178c);});});}function respondWithStatusCode(_0xe25183,_0x1edd86){_0x1edd86=_0x1edd86||0xcc;return function(_0x13918b){if(_0x13918b){return _0xe25183[_0xc665('0x29')](_0x1edd86);}return _0xe25183['status'](_0x1edd86)['end']();};}function respondWithResult(_0x2a4436,_0x29a682){_0x29a682=_0x29a682||0xc8;return function(_0x227e09){if(_0x227e09){return _0x2a4436[_0xc665('0x2a')](_0x29a682)[_0xc665('0x2b')](_0x227e09);}};}function respondWithFilteredResult(_0x3c767e,_0x190f93){return function(_0x3d569d){if(_0x3d569d){var _0x4f8ec7=_0x3d569d[_0xc665('0x2c')],_0x315bc8=_0x190f93['offset'],_0x57f468=_0x190f93[_0xc665('0x2d')]+_0x190f93[_0xc665('0x2e')],_0x3ff23e;if(_0x57f468>=_0x4f8ec7){_0x57f468=_0x4f8ec7;_0x3ff23e=0xc8;}else{_0x3ff23e=0xce;}_0x3c767e[_0xc665('0x2a')](_0x3ff23e);return _0x3c767e['set']('Content-Range',_0x315bc8+'-'+_0x57f468+'/'+_0x4f8ec7)[_0xc665('0x2b')](_0x3d569d);}return null;};}function patchUpdates(_0x5782fc){return function(_0x59c039){try{jsonpatch[_0xc665('0x2f')](_0x59c039,_0x5782fc,!![]);}catch(_0x5cedf7){return BPromise[_0xc665('0x30')](_0x5cedf7);}return _0x59c039[_0xc665('0x31')]();};}function saveUpdates(_0x53e739,_0x1e0493){return function(_0x521d7a){if(_0x521d7a){return _0x521d7a[_0xc665('0x32')](_0x53e739)['then'](function(_0x53e742){return _0x53e742;});}return null;};}function removeEntity(_0x379ea0,_0x1a305a){return function(_0x5d1080){if(_0x5d1080){return _0x5d1080[_0xc665('0x33')]()[_0xc665('0x20')](function(){_0x379ea0[_0xc665('0x2a')](0xcc)[_0xc665('0x34')]();});}};}function handleEntityNotFound(_0x599b63,_0x3009f3){return function(_0x3034e0){if(!_0x3034e0){_0x599b63['sendStatus'](0x194);}return _0x3034e0;};}function handleError(_0x2ea8cb,_0x4815bc){_0x4815bc=_0x4815bc||0x1f4;return function(_0x9a0bd4){logger[_0xc665('0x24')](_0x9a0bd4['stack']);if(_0x9a0bd4[_0xc665('0x35')]){delete _0x9a0bd4[_0xc665('0x35')];}_0x2ea8cb[_0xc665('0x2a')](_0x4815bc)[_0xc665('0x36')](_0x9a0bd4);};}exports[_0xc665('0x37')]=function(_0x3d4650,_0x11e6b3){var _0x2ff51d={},_0x15e248={},_0xfff79f={'count':0x0,'rows':[]};var _0x4d8cb9=_[_0xc665('0x38')](db[_0xc665('0x39')][_0xc665('0x3a')],function(_0x402bba){return{'name':_0x402bba[_0xc665('0x3b')],'type':_0x402bba[_0xc665('0x3c')][_0xc665('0x3d')]};});_0x15e248[_0xc665('0x3e')]=_['map'](_0x4d8cb9,_0xc665('0x35'));_0x15e248[_0xc665('0x3f')]=_['keys'](_0x3d4650[_0xc665('0x3f')]);_0x15e248['filters']=_[_0xc665('0x40')](_0x15e248['model'],_0x15e248[_0xc665('0x3f')]);_0x2ff51d['attributes']=_[_0xc665('0x40')](_0x15e248[_0xc665('0x3e')],qs[_0xc665('0x41')](_0x3d4650[_0xc665('0x3f')]['fields']));_0x2ff51d[_0xc665('0x42')]=_0x2ff51d[_0xc665('0x42')][_0xc665('0x43')]?_0x2ff51d[_0xc665('0x42')]:_0x15e248[_0xc665('0x3e')];if(!_0x3d4650[_0xc665('0x3f')][_0xc665('0x44')](_0xc665('0x45'))){_0x2ff51d[_0xc665('0x2e')]=qs[_0xc665('0x2e')](_0x3d4650['query']['limit']);_0x2ff51d[_0xc665('0x2d')]=qs['offset'](_0x3d4650['query']['offset']);}_0x2ff51d[_0xc665('0x46')]=qs[_0xc665('0x47')](_0x3d4650[_0xc665('0x3f')][_0xc665('0x47')]);_0x2ff51d['where']=qs[_0xc665('0x48')](_[_0xc665('0x49')](_0x3d4650[_0xc665('0x3f')],_0x15e248['filters']));if(_0x3d4650['query'][_0xc665('0x4a')]){_0x2ff51d['where']=_[_0xc665('0x4b')](_0x2ff51d[_0xc665('0x4c')],{'$or':_[_0xc665('0x38')](_0x4d8cb9,function(_0xcf6e3c){if(_0xcf6e3c[_0xc665('0x3c')]!==_0xc665('0x4d')){var _0x171961={};_0x171961[_0xcf6e3c[_0xc665('0x35')]]={'$like':'%'+_0x3d4650['query'][_0xc665('0x4a')]+'%'};return _0x171961;}})});}_0x2ff51d=_[_0xc665('0x4b')]({},_0x2ff51d,_0x3d4650['options']);var _0x36b1c9={'where':_0x2ff51d['where']};return db['ServicenowAccount']['count'](_0x36b1c9)[_0xc665('0x20')](function(_0x200222){_0xfff79f['count']=_0x200222;if(_0x3d4650[_0xc665('0x3f')][_0xc665('0x4e')]){_0x2ff51d[_0xc665('0x4f')]=[{'all':!![]}];}return db[_0xc665('0x39')]['findAll'](_0x2ff51d);})[_0xc665('0x20')](function(_0x1c4a58){_0xfff79f[_0xc665('0x50')]=_0x1c4a58;return _0xfff79f;})[_0xc665('0x20')](respondWithFilteredResult(_0x11e6b3,_0x2ff51d))[_0xc665('0x28')](handleError(_0x11e6b3,null));};exports[_0xc665('0x51')]=function(_0x30c3ba,_0x465ef2){var _0x51f9e3={'raw':![],'where':{'id':_0x30c3ba[_0xc665('0x52')]['id']}},_0x4f0bc7={};_0x4f0bc7[_0xc665('0x3e')]=_[_0xc665('0x53')](db[_0xc665('0x39')][_0xc665('0x3a')]);_0x4f0bc7['query']=_[_0xc665('0x53')](_0x30c3ba[_0xc665('0x3f')]);_0x4f0bc7[_0xc665('0x48')]=_['intersection'](_0x4f0bc7[_0xc665('0x3e')],_0x4f0bc7['query']);_0x51f9e3[_0xc665('0x42')]=_[_0xc665('0x40')](_0x4f0bc7[_0xc665('0x3e')],qs['fields'](_0x30c3ba[_0xc665('0x3f')][_0xc665('0x41')]));_0x51f9e3[_0xc665('0x42')]=_0x51f9e3[_0xc665('0x42')][_0xc665('0x43')]?_0x51f9e3['attributes']:_0x4f0bc7[_0xc665('0x3e')];if(_0x30c3ba[_0xc665('0x3f')][_0xc665('0x4e')]){_0x51f9e3[_0xc665('0x4f')]=[{'all':!![]}];}_0x51f9e3=_[_0xc665('0x4b')]({},_0x51f9e3,_0x30c3ba['options']);return db['ServicenowAccount'][_0xc665('0x54')](_0x51f9e3)[_0xc665('0x20')](handleEntityNotFound(_0x465ef2,null))[_0xc665('0x20')](respondWithResult(_0x465ef2,null))[_0xc665('0x28')](handleError(_0x465ef2,null));};exports[_0xc665('0x55')]=function(_0x36277e,_0x396ea7){return db[_0xc665('0x39')][_0xc665('0x55')](_0x36277e[_0xc665('0x56')],{})[_0xc665('0x20')](respondWithResult(_0x396ea7,0xc9))[_0xc665('0x28')](handleError(_0x396ea7,null));};exports[_0xc665('0x32')]=function(_0x38203f,_0x2eae6e){if(_0x38203f['body']['id']){delete _0x38203f[_0xc665('0x56')]['id'];}return db['ServicenowAccount'][_0xc665('0x54')]({'where':{'id':_0x38203f[_0xc665('0x52')]['id']}})[_0xc665('0x20')](handleEntityNotFound(_0x2eae6e,null))[_0xc665('0x20')](saveUpdates(_0x38203f['body'],null))['then'](respondWithResult(_0x2eae6e,null))[_0xc665('0x28')](handleError(_0x2eae6e,null));};exports[_0xc665('0x33')]=function(_0x3bcb5f,_0xe92d85){return db[_0xc665('0x39')][_0xc665('0x54')]({'where':{'id':_0x3bcb5f[_0xc665('0x52')]['id']}})[_0xc665('0x20')](handleEntityNotFound(_0xe92d85,null))['then'](removeEntity(_0xe92d85,null))['catch'](handleError(_0xe92d85,null));};exports[_0xc665('0x57')]=function(_0x3f1c47,_0x342176,_0x4f13bf){var _0x1f6cbf={};var _0x40ea7a={};var _0x49f060;var _0x215b29;return db[_0xc665('0x39')][_0xc665('0x58')]({'where':{'id':_0x3f1c47[_0xc665('0x52')]['id']}})[_0xc665('0x20')](handleEntityNotFound(_0x342176,null))[_0xc665('0x20')](function(_0x4c73f3){if(_0x4c73f3){_0x49f060=_0x4c73f3;_0x40ea7a[_0xc665('0x3e')]=_[_0xc665('0x53')](db[_0xc665('0x59')]['rawAttributes']);_0x40ea7a[_0xc665('0x3f')]=_[_0xc665('0x53')](_0x3f1c47[_0xc665('0x3f')]);_0x40ea7a[_0xc665('0x48')]=_[_0xc665('0x40')](_0x40ea7a[_0xc665('0x3e')],_0x40ea7a[_0xc665('0x3f')]);_0x1f6cbf[_0xc665('0x42')]=_['intersection'](_0x40ea7a[_0xc665('0x3e')],qs[_0xc665('0x41')](_0x3f1c47['query']['fields']));_0x1f6cbf[_0xc665('0x42')]=_0x1f6cbf[_0xc665('0x42')][_0xc665('0x43')]?_0x1f6cbf[_0xc665('0x42')]:_0x40ea7a[_0xc665('0x3e')];_0x1f6cbf[_0xc665('0x46')]=qs[_0xc665('0x47')](_0x3f1c47[_0xc665('0x3f')][_0xc665('0x47')]);_0x1f6cbf[_0xc665('0x4c')]=qs['filters'](_[_0xc665('0x49')](_0x3f1c47['query'],_0x40ea7a[_0xc665('0x48')]));if(_0x3f1c47[_0xc665('0x3f')][_0xc665('0x4a')]){_0x1f6cbf[_0xc665('0x4c')]=_['merge'](_0x1f6cbf[_0xc665('0x4c')],{'$or':_[_0xc665('0x38')](_0x1f6cbf[_0xc665('0x42')],function(_0x2a3bdd){var _0x2251e8={};_0x2251e8[_0x2a3bdd]={'$like':'%'+_0x3f1c47[_0xc665('0x3f')]['filter']+'%'};return _0x2251e8;})});}_0x1f6cbf=_['merge']({},_0x1f6cbf,_0x3f1c47[_0xc665('0x5a')]);return _0x49f060[_0xc665('0x57')](_0x1f6cbf);}})['then'](function(_0x3f2192){if(_0x3f2192){_0x215b29=_0x3f2192[_0xc665('0x43')];if(!_0x3f1c47[_0xc665('0x3f')][_0xc665('0x44')](_0xc665('0x45'))){_0x1f6cbf[_0xc665('0x2e')]=qs[_0xc665('0x2e')](_0x3f1c47[_0xc665('0x3f')][_0xc665('0x2e')]);_0x1f6cbf['offset']=qs[_0xc665('0x2d')](_0x3f1c47[_0xc665('0x3f')]['offset']);}return _0x49f060[_0xc665('0x57')](_0x1f6cbf);}})[_0xc665('0x20')](function(_0x44aee4){if(_0x44aee4){return _0x44aee4?{'count':_0x215b29,'rows':_0x44aee4}:null;}})[_0xc665('0x20')](respondWithResult(_0x342176,null))[_0xc665('0x28')](handleError(_0x342176,null));};exports['addConfiguration']=function(_0x54aff4,_0x59bac5,_0x24622a){if(_0x54aff4[_0xc665('0x56')]['id']){delete _0x54aff4['body']['id'];}return db[_0xc665('0x39')][_0xc665('0x58')]({'where':{'id':_0x54aff4['params']['id']}})['then'](handleEntityNotFound(_0x59bac5,null))[_0xc665('0x20')](function(_0x5e8370){if(_0x5e8370){_0x54aff4[_0xc665('0x56')][_0xc665('0x5b')]=_0x5e8370['id'];_0x54aff4['body'][_0xc665('0x5c')]=integrations[_0xc665('0x5d')](_0x54aff4['body'][_0xc665('0x5e')],_0x54aff4['body'][_0xc665('0x3c')]);_0x54aff4[_0xc665('0x56')][_0xc665('0x5f')]=integrations[_0xc665('0x60')](_0x54aff4['body']['channel'],_0x54aff4[_0xc665('0x56')]['type']);return db[_0xc665('0x59')][_0xc665('0x55')](_0x54aff4[_0xc665('0x56')],{'include':[{'model':db[_0xc665('0x61')],'as':_0xc665('0x5c')},{'model':db[_0xc665('0x61')],'as':_0xc665('0x5f')}]});}return null;})[_0xc665('0x20')](respondWithResult(_0x59bac5,null))[_0xc665('0x28')](handleError(_0x59bac5,null));};exports['getFields']=function(_0x1c0d4f,_0x48c778,_0x3a9726){var _0x429d26=[_0xc665('0x62'),_0xc665('0x63'),'knowledge',_0xc665('0x64'),_0xc665('0x65'),_0xc665('0x66'),'incident_state',_0xc665('0x67'),_0xc665('0x68')];var _0x166860=[_0xc665('0x69'),_0xc665('0x62'),'caused_by',_0xc665('0x6a'),'upon_reject','sys_updated_on','child_incidents',_0xc665('0x63'),_0xc665('0x6b'),_0xc665('0x6c'),_0xc665('0x6d'),'sys_updated_by',_0xc665('0x6e'),_0xc665('0x6f'),_0xc665('0x70'),_0xc665('0x71'),_0xc665('0x72'),_0xc665('0x73'),'knowledge',_0xc665('0x46'),_0xc665('0x74'),_0xc665('0x75'),_0xc665('0x76'),'delivery_plan','impact',_0xc665('0x77'),'work_notes_list',_0xc665('0x78'),_0xc665('0x79'),_0xc665('0x7a'),_0xc665('0x7b'),_0xc665('0x7c'),_0xc665('0x7d'),_0xc665('0x7e'),_0xc665('0x7f'),'group_list',_0xc665('0x80'),_0xc665('0x81'),_0xc665('0x82'),'caller_id',_0xc665('0x83'),_0xc665('0x64'),_0xc665('0x84'),_0xc665('0x85'),_0xc665('0x65'),_0xc665('0x86'),'delivery_task','work_start',_0xc665('0x87'),_0xc665('0x88'),'additional_assignee_list',_0xc665('0x89'),_0xc665('0x8a'),'notify',_0xc665('0x8b'),_0xc665('0x8c'),_0xc665('0x8d'),_0xc665('0x8e'),_0xc665('0x8f'),_0xc665('0x90'),_0xc665('0x91'),_0xc665('0x92'),_0xc665('0x93'),'urgency',_0xc665('0x94'),_0xc665('0x95'),_0xc665('0x96'),_0xc665('0x97'),_0xc665('0x98'),_0xc665('0x67'),_0xc665('0x99'),_0xc665('0x9a'),_0xc665('0x9b'),_0xc665('0x9c'),_0xc665('0x9d'),_0xc665('0x9e'),_0xc665('0x9f'),_0xc665('0xa0'),'escalation','upon_approval',_0xc665('0xa1'),_0xc665('0xa2'),_0xc665('0x68')];var _0x4c6c6a='';var _0x3bc2ab='';var _0x37cb29=[];var _0x2d6cdb='';var _0x58eb8a='';var _0x5a037e=[];var _0x2df3a8='';var _0x66b604='';var _0x56427f={};var _0x168101='';return db[_0xc665('0x39')][_0xc665('0x58')]({'where':{'id':_0x1c0d4f[_0xc665('0x52')]['id']},'attributes':['id',_0xc665('0xa3'),_0xc665('0xa4'),'email',_0xc665('0xa5'),_0xc665('0xa6')]})[_0xc665('0x20')](handleEntityNotFound(_0x48c778,null))[_0xc665('0x20')](function(_0x9d2b8a){if(_0x9d2b8a){_0x168101=_0x9d2b8a[_0xc665('0xa5')];var _0x4e5110=_0x168101[_0xc665('0xa7')](-0x1);if(_0x4e5110==='/'){_0x168101=_0x168101[_0xc665('0xa8')](0x0,_0x168101[_0xc665('0xa9')](_0x4e5110));}_0x66b604=util[_0xc665('0xaa')](_0xc665('0xab'),_0x168101);_0x2df3a8=util['format'](_0xc665('0xac'),_0x168101);_0x56427f={'user':_0x9d2b8a['username'],'pass':_0x9d2b8a[_0xc665('0xa4')]};var _0x1d9d74={'method':'GET','uri':_0x66b604+'incident?sysparm_display_value=all','auth':_0x56427f,'json':!![]};return rp(_0x1d9d74);}})[_0xc665('0x20')](function(_0x42aa52){if(_0x42aa52[_0xc665('0xad')]['length']>0x0){_0x4c6c6a=_0x42aa52[_0xc665('0xad')];}console[_0xc665('0xae')]('incident\x20table\x20objects',_0x4c6c6a);_0x5a037e=[];_0x3bc2ab=Object[_0xc665('0xaf')]([],_0x4c6c6a);_[_0xc665('0xb0')](_0x3bc2ab,function(_0x523a1d){return!_0x429d26['includes'](_0x523a1d[_0xc665('0x35')]);});_0x3bc2ab[_0xc665('0xb1')](function(_0x177831){var _0x44351b=createFieldObject(_0x2df3a8,_0x56427f,_0x177831[_0xc665('0xb2')],_0x177831[_0xc665('0x35')],_0x177831['label'],![]);_0x5a037e[_0xc665('0xb3')](_0x44351b);});return Promise[_0xc665('0xb4')](_0x5a037e);})[_0xc665('0x20')](function(_0x1b82e6){_0x37cb29=_0x1b82e6;_0x2d6cdb=Object[_0xc665('0xaf')]([],_0x4c6c6a);console[_0xc665('0xae')](_0xc665('0xb5'),_0x4c6c6a);_[_0xc665('0xb0')](_0x2d6cdb,function(_0x2fda47){return _0x166860[_0xc665('0xb6')](_0x2fda47['name']);});console['log'](_0xc665('0xb7'),_0x2d6cdb);_0x5a037e=[];_0x2d6cdb['forEach'](function(_0x2fe5ed){var _0x1a6af8=createFieldObject(_0x2df3a8,_0x56427f,_0x2fe5ed[_0xc665('0xb2')],_0x2fe5ed[_0xc665('0x35')],_0x2fe5ed[_0xc665('0xb8')],!![]);_0x5a037e[_0xc665('0xb3')](_0x1a6af8);});return Promise[_0xc665('0xb4')](_0x5a037e);})[_0xc665('0x20')](function(_0x115fcb){_0x58eb8a=_0x115fcb;var _0x172538=_0x37cb29[_0xc665('0xb9')](_0x58eb8a);return{'count':_0x172538[_0xc665('0x43')],'rows':_0x172538};})[_0xc665('0x20')](respondWithResult(_0x48c778,null))[_0xc665('0x28')](function(_0x330f17){console[_0xc665('0xae')](_0xc665('0xba')+_0x330f17);var _0x32efc=_0x1c0d4f[_0xc665('0x3f')][_0xc665('0x1c')]?0x1f4:_0x330f17[_0xc665('0xbb')]||0x1f4;logger[_0xc665('0x24')](_0x330f17[_0xc665('0xbc')]);delete _0x330f17[_0xc665('0x35')];if(_0x32efc===0x191){_0x32efc=0x190;}_0x48c778['status'](_0x32efc)['send'](_0x1c0d4f[_0xc665('0x3f')]['test']?{'message':_0xc665('0xbd'),'statusCode':_0x330f17['statusCode']}:_0x330f17);});};function createFieldObject(_0x1f04f7,_0x2804e1,_0x447778,_0x4614f3,_0x29c4b9,_0x33852b){return new Promise(function(_0x4ca79d,_0x400776){var _0x2e71d0={'id':_0x4614f3,'name':_0x29c4b9,'custom':_0x33852b};if(_0x447778===_0xc665('0xbe')){_0x2e71d0[_0xc665('0x5a')]=[{'name':_0xc665('0xbf'),'value':_0xc665('0xc0')},{'name':_0xc665('0xc1'),'value':'false'}];_0x4ca79d(_0x2e71d0);}else{var _0x5b9341={'method':_0xc665('0xc2'),'uri':_0x1f04f7+'sys_choice?sysparm_query=name=incident^element='+_0x4614f3,'auth':_0x2804e1,'json':!![]};return rp(_0x5b9341)[_0xc665('0x20')](function(_0x11b317){var _0x51c922=[];if(_0x11b317[_0xc665('0xad')][_0xc665('0x43')]>0x0){_0x11b317[_0xc665('0xad')][_0xc665('0xb1')](function(_0x1b511f){if(_0x1b511f[_0xc665('0xc3')]===_0xc665('0xc4')){var _0x8042da={'name':_0x1b511f['label'],'value':_0x1b511f[_0xc665('0xc5')]};_0x51c922[_0xc665('0xb3')](_0x8042da);}});}_0x2e71d0['options']=_0x51c922;if(_0x2e71d0[_0xc665('0x5a')][_0xc665('0x43')]>0x0){_0x4ca79d(_0x2e71d0);}else{if(_0x33852b==![]){_0x4ca79d();}else{_0x4ca79d(_0x2e71d0);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index ad3af20..e954a0b 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 _0xe0ae=['ServicenowAccount','../../config/logger','api','bluebird','path','rimraf','./intServicenowAccount.attributes','define'];(function(_0x5914f9,_0x3c278e){var _0x4f6738=function(_0x1d6b06){while(--_0x1d6b06){_0x5914f9['push'](_0x5914f9['shift']());}};_0x4f6738(++_0x3c278e);}(_0xe0ae,0xa1));var _0xee0a=function(_0x4d05a0,_0x53aa7e){_0x4d05a0=_0x4d05a0-0x0;var _0x4c999c=_0xe0ae[_0x4d05a0];return _0x4c999c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xee0a('0x0'))(_0xee0a('0x1'));var moment=require('moment');var BPromise=require(_0xee0a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee0a('0x3'));var rimraf=require(_0xee0a('0x4'));var config=require('../../config/environment');var attributes=require(_0xee0a('0x5'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x39a302,_0x1c5071){return _0x39a302[_0xee0a('0x6')](_0xee0a('0x7'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc97=['request-promise','path','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','int_servicenow_accounts','lodash','util','../../config/logger','moment'];(function(_0x19225a,_0x3b01dd){var _0x4d7cec=function(_0x3c071b){while(--_0x3c071b){_0x19225a['push'](_0x19225a['shift']());}};_0x4d7cec(++_0x3b01dd);}(_0xdc97,0x13b));var _0x7dc9=function(_0x586f94,_0x5e3ee4){_0x586f94=_0x586f94-0x0;var _0x11ac3c=_0xdc97[_0x586f94];return _0x11ac3c;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var logger=require(_0x7dc9('0x2'))('api');var moment=require(_0x7dc9('0x3'));var BPromise=require('bluebird');var rp=require(_0x7dc9('0x4'));var fs=require('fs');var path=require(_0x7dc9('0x5'));var rimraf=require('rimraf');var config=require(_0x7dc9('0x6'));var attributes=require(_0x7dc9('0x7'));var integrations=require(_0x7dc9('0x8'));module[_0x7dc9('0x9')]=function(_0x589f02,_0x2636ef){return _0x589f02['define']('ServicenowAccount',attributes,{'tableName':_0x7dc9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index c476358..d1b4e1f 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 _0x6420=['raw','where','include','map','model','ShowServicenowAccount','attributes','info','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','client','then','ServicenowAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','GetServicenowAccount','ServicenowAccount','options'];(function(_0x39714b,_0x5e0b0e){var _0x45ed60=function(_0x3ce5c8){while(--_0x3ce5c8){_0x39714b['push'](_0x39714b['shift']());}};_0x45ed60(++_0x5e0b0e);}(_0x6420,0x140));var _0x0642=function(_0x1ccbcc,_0x5c948b){_0x1ccbcc=_0x1ccbcc-0x0;var _0x1e873f=_0x6420[_0x1ccbcc];return _0x1e873f;};'use strict';var _=require(_0x0642('0x0'));var util=require('util');var moment=require(_0x0642('0x1'));var BPromise=require(_0x0642('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0642('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0642('0x4'));var logger=require(_0x0642('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0642('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b2823,_0x9fe633,_0xdc363){return new BPromise(function(_0xba316b,_0x24d91f){return client['request'](_0x1b2823,_0xdc363)[_0x0642('0x7')](function(_0x503634){logger['info'](_0x0642('0x8'),_0x9fe633,'request\x20sent');logger[_0x0642('0x9')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x9fe633,_0x0642('0xa'),JSON[_0x0642('0xb')](_0x503634));if(_0x503634['error']){if(_0x503634[_0x0642('0xc')]['code']===0x1f4){logger[_0x0642('0xc')](_0x0642('0x8'),_0x9fe633,_0x503634[_0x0642('0xc')]['message']);return _0x24d91f(_0x503634[_0x0642('0xc')][_0x0642('0xd')]);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x9fe633,_0x503634[_0x0642('0xc')]['message']);return _0xba316b(_0x503634[_0x0642('0xc')]['message']);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x9fe633,_0x0642('0xa'));_0xba316b(_0x503634['result']['message']);}})[_0x0642('0xe')](function(_0x2d1d72){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x9fe633,_0x2d1d72);_0x24d91f(_0x2d1d72);});});}exports[_0x0642('0xf')]=function(_0x1d88d7){var _0x5bb1ba=this;return new Promise(function(_0x403e36,_0x4a9f4d){return db[_0x0642('0x10')]['findAll']({'raw':_0x1d88d7[_0x0642('0x11')]?_0x1d88d7[_0x0642('0x11')][_0x0642('0x12')]===undefined?!![]:![]:!![],'where':_0x1d88d7[_0x0642('0x11')]?_0x1d88d7[_0x0642('0x11')][_0x0642('0x13')]||null:null,'attributes':_0x1d88d7['options']?_0x1d88d7[_0x0642('0x11')]['attributes']||null:null,'limit':_0x1d88d7[_0x0642('0x11')]?_0x1d88d7[_0x0642('0x11')]['limit']||null:null,'include':_0x1d88d7['options']?_0x1d88d7['options'][_0x0642('0x14')]?_[_0x0642('0x15')](_0x1d88d7[_0x0642('0x11')][_0x0642('0x14')],function(_0x46762b){return{'model':db[_0x46762b['model']],'as':_0x46762b['as'],'attributes':_0x46762b['attributes'],'include':_0x46762b[_0x0642('0x14')]?_[_0x0642('0x15')](_0x46762b[_0x0642('0x14')],function(_0x220fdc){return{'model':db[_0x220fdc[_0x0642('0x16')]],'as':_0x220fdc['as'],'attributes':_0x220fdc['attributes'],'include':_0x220fdc[_0x0642('0x14')]?_[_0x0642('0x15')](_0x220fdc['include'],function(_0x35128f){return{'model':db[_0x35128f[_0x0642('0x16')]],'as':_0x35128f['as'],'attributes':_0x35128f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0642('0x7')](function(_0x199364){logger['info'](_0x0642('0xf'),_0x1d88d7);logger[_0x0642('0x9')](_0x0642('0xf'),_0x1d88d7,JSON['stringify'](_0x199364));_0x403e36(_0x199364);})[_0x0642('0xe')](function(_0x5f3378){logger[_0x0642('0xc')](_0x0642('0xf'),_0x5f3378[_0x0642('0xd')],_0x1d88d7);_0x4a9f4d(_0x5bb1ba[_0x0642('0xc')](0x1f4,_0x5f3378[_0x0642('0xd')]));});});};exports[_0x0642('0x17')]=function(_0x5685b5){var _0x55fe4f=this;return new Promise(function(_0x26763c,_0x5725ca){return db[_0x0642('0x10')]['find']({'raw':_0x5685b5[_0x0642('0x11')]?_0x5685b5[_0x0642('0x11')][_0x0642('0x12')]===undefined?!![]:![]:!![],'where':_0x5685b5[_0x0642('0x11')]?_0x5685b5['options'][_0x0642('0x13')]||null:null,'attributes':_0x5685b5[_0x0642('0x11')]?_0x5685b5['options'][_0x0642('0x18')]||null:null,'include':_0x5685b5[_0x0642('0x11')]?_0x5685b5[_0x0642('0x11')][_0x0642('0x14')]?_[_0x0642('0x15')](_0x5685b5[_0x0642('0x11')][_0x0642('0x14')],function(_0x4643a6){return{'model':db[_0x4643a6[_0x0642('0x16')]],'as':_0x4643a6['as'],'attributes':_0x4643a6['attributes'],'include':_0x4643a6['include']?_['map'](_0x4643a6[_0x0642('0x14')],function(_0x2bbfb4){return{'model':db[_0x2bbfb4[_0x0642('0x16')]],'as':_0x2bbfb4['as'],'attributes':_0x2bbfb4[_0x0642('0x18')],'include':_0x2bbfb4[_0x0642('0x14')]?_[_0x0642('0x15')](_0x2bbfb4[_0x0642('0x14')],function(_0x12a02d){return{'model':db[_0x12a02d[_0x0642('0x16')]],'as':_0x12a02d['as'],'attributes':_0x12a02d['attributes']};}):[]};}):[]};}):[]:[]})[_0x0642('0x7')](function(_0x18f652){logger[_0x0642('0x19')]('ShowServicenowAccount',_0x5685b5);logger[_0x0642('0x9')](_0x0642('0x17'),_0x5685b5,JSON['stringify'](_0x18f652));_0x26763c(_0x18f652);})[_0x0642('0xe')](function(_0x528f9e){logger[_0x0642('0xc')]('ShowServicenowAccount',_0x528f9e[_0x0642('0xd')],_0x5685b5);_0x5725ca(_0x55fe4f[_0x0642('0xc')](0x1f4,_0x528f9e[_0x0642('0xd')]));});});}; \ No newline at end of file +var _0x8da1=['model','attributes','include','map','ShowServicenowAccount','find','where','debug','stringify','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','limit'];(function(_0x1ae177,_0x136c08){var _0xa995ae=function(_0x5c70da){while(--_0x5c70da){_0x1ae177['push'](_0x1ae177['shift']());}};_0xa995ae(++_0x136c08);}(_0x8da1,0x1f3));var _0x18da=function(_0x5e8897,_0x299e79){_0x5e8897=_0x5e8897-0x0;var _0x271b50=_0x8da1[_0x5e8897];return _0x271b50;};'use strict';var _=require(_0x18da('0x0'));var util=require('util');var moment=require(_0x18da('0x1'));var BPromise=require('bluebird');var rs=require(_0x18da('0x2'));var fs=require('fs');var Redis=require(_0x18da('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x18da('0x4'));var logger=require('../../config/logger')(_0x18da('0x5'));var config=require(_0x18da('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x18da('0x7')][_0x18da('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3708c3,_0x25a4f2,_0x15a136){return new BPromise(function(_0x1f67d6,_0x401cd2){return client[_0x18da('0x9')](_0x3708c3,_0x15a136)[_0x18da('0xa')](function(_0x4d84d1){logger[_0x18da('0xb')](_0x18da('0xc'),_0x25a4f2,_0x18da('0xd'));logger['debug'](_0x18da('0xe'),_0x25a4f2,_0x18da('0xd'),JSON['stringify'](_0x4d84d1));if(_0x4d84d1[_0x18da('0xf')]){if(_0x4d84d1['error'][_0x18da('0x10')]===0x1f4){logger[_0x18da('0xf')](_0x18da('0xc'),_0x25a4f2,_0x4d84d1[_0x18da('0xf')][_0x18da('0x11')]);return _0x401cd2(_0x4d84d1['error'][_0x18da('0x11')]);}logger[_0x18da('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x25a4f2,_0x4d84d1[_0x18da('0xf')][_0x18da('0x11')]);return _0x1f67d6(_0x4d84d1[_0x18da('0xf')]['message']);}else{logger[_0x18da('0xb')](_0x18da('0xc'),_0x25a4f2,_0x18da('0xd'));_0x1f67d6(_0x4d84d1[_0x18da('0x12')][_0x18da('0x11')]);}})[_0x18da('0x13')](function(_0xd30535){logger[_0x18da('0xf')](_0x18da('0xc'),_0x25a4f2,_0xd30535);_0x401cd2(_0xd30535);});});}exports[_0x18da('0x14')]=function(_0x426dff){var _0x33ccc6=this;return new Promise(function(_0x83038,_0xd59ee5){return db[_0x18da('0x15')][_0x18da('0x16')]({'raw':_0x426dff[_0x18da('0x17')]?_0x426dff['options'][_0x18da('0x18')]===undefined?!![]:![]:!![],'where':_0x426dff[_0x18da('0x17')]?_0x426dff['options']['where']||null:null,'attributes':_0x426dff[_0x18da('0x17')]?_0x426dff[_0x18da('0x17')]['attributes']||null:null,'limit':_0x426dff[_0x18da('0x17')]?_0x426dff[_0x18da('0x17')][_0x18da('0x19')]||null:null,'include':_0x426dff[_0x18da('0x17')]?_0x426dff[_0x18da('0x17')]['include']?_['map'](_0x426dff['options']['include'],function(_0x1e63dd){return{'model':db[_0x1e63dd[_0x18da('0x1a')]],'as':_0x1e63dd['as'],'attributes':_0x1e63dd[_0x18da('0x1b')],'include':_0x1e63dd[_0x18da('0x1c')]?_[_0x18da('0x1d')](_0x1e63dd[_0x18da('0x1c')],function(_0x4d26ae){return{'model':db[_0x4d26ae[_0x18da('0x1a')]],'as':_0x4d26ae['as'],'attributes':_0x4d26ae[_0x18da('0x1b')],'include':_0x4d26ae[_0x18da('0x1c')]?_[_0x18da('0x1d')](_0x4d26ae[_0x18da('0x1c')],function(_0x45da95){return{'model':db[_0x45da95[_0x18da('0x1a')]],'as':_0x45da95['as'],'attributes':_0x45da95['attributes']};}):[]};}):[]};}):[]:[]})[_0x18da('0xa')](function(_0x603273){logger[_0x18da('0xb')]('GetServicenowAccount',_0x426dff);logger['debug']('GetServicenowAccount',_0x426dff,JSON['stringify'](_0x603273));_0x83038(_0x603273);})[_0x18da('0x13')](function(_0x3def8c){logger[_0x18da('0xf')]('GetServicenowAccount',_0x3def8c[_0x18da('0x11')],_0x426dff);_0xd59ee5(_0x33ccc6[_0x18da('0xf')](0x1f4,_0x3def8c[_0x18da('0x11')]));});});};exports[_0x18da('0x1e')]=function(_0x5c4616){var _0x54d2c6=this;return new Promise(function(_0x5e7aca,_0x18113d){return db[_0x18da('0x15')][_0x18da('0x1f')]({'raw':_0x5c4616['options']?_0x5c4616[_0x18da('0x17')][_0x18da('0x18')]===undefined?!![]:![]:!![],'where':_0x5c4616[_0x18da('0x17')]?_0x5c4616['options'][_0x18da('0x20')]||null:null,'attributes':_0x5c4616[_0x18da('0x17')]?_0x5c4616['options']['attributes']||null:null,'include':_0x5c4616['options']?_0x5c4616[_0x18da('0x17')]['include']?_[_0x18da('0x1d')](_0x5c4616[_0x18da('0x17')][_0x18da('0x1c')],function(_0x388b33){return{'model':db[_0x388b33[_0x18da('0x1a')]],'as':_0x388b33['as'],'attributes':_0x388b33['attributes'],'include':_0x388b33['include']?_[_0x18da('0x1d')](_0x388b33[_0x18da('0x1c')],function(_0x1b9ff2){return{'model':db[_0x1b9ff2[_0x18da('0x1a')]],'as':_0x1b9ff2['as'],'attributes':_0x1b9ff2[_0x18da('0x1b')],'include':_0x1b9ff2['include']?_['map'](_0x1b9ff2[_0x18da('0x1c')],function(_0xb130ce){return{'model':db[_0xb130ce['model']],'as':_0xb130ce['as'],'attributes':_0xb130ce[_0x18da('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x18da('0xa')](function(_0x35f8dd){logger[_0x18da('0xb')](_0x18da('0x1e'),_0x5c4616);logger[_0x18da('0x21')]('ShowServicenowAccount',_0x5c4616,JSON[_0x18da('0x22')](_0x35f8dd));_0x5e7aca(_0x35f8dd);})[_0x18da('0x13')](function(_0xc82b35){logger[_0x18da('0xf')](_0x18da('0x1e'),_0xc82b35[_0x18da('0x11')],_0x5c4616);_0x18113d(_0x54d2c6[_0x18da('0xf')](0x1f4,_0xc82b35['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 28e36ef..c5d33e5 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 _0x8038=['/:id/descriptions','getDescriptions','post','put','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8038,0x1ea));var _0x8803=function(_0x29117b,_0x5c2085){_0x29117b=_0x29117b-0x0;var _0x2bd3fa=_0x8038[_0x29117b];return _0x2bd3fa;};'use strict';var multer=require(_0x8803('0x0'));var util=require('util');var path=require(_0x8803('0x1'));var timeout=require(_0x8803('0x2'));var express=require(_0x8803('0x3'));var router=express[_0x8803('0x4')]();var auth=require(_0x8803('0x5'));var interaction=require(_0x8803('0x6'));var config=require(_0x8803('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0x8803('0x8')]('/',auth[_0x8803('0x9')](),controller[_0x8803('0xa')]);router['get'](_0x8803('0xb'),auth[_0x8803('0x9')](),controller[_0x8803('0xc')]);router[_0x8803('0x8')]('/:id/fields',auth[_0x8803('0x9')](),controller[_0x8803('0xd')]);router[_0x8803('0x8')](_0x8803('0xe'),auth[_0x8803('0x9')](),controller[_0x8803('0xf')]);router['get'](_0x8803('0x10'),auth[_0x8803('0x9')](),controller[_0x8803('0x11')]);router[_0x8803('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8803('0x13')]('/:id',auth[_0x8803('0x9')](),controller[_0x8803('0x14')]);router['delete'](_0x8803('0xb'),auth[_0x8803('0x9')](),controller['destroy']);module[_0x8803('0x15')]=router; \ No newline at end of file +var _0x149a=['get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0x149a,0xb7));var _0xa149=function(_0x12daf7,_0x1ed26b){_0x12daf7=_0x12daf7-0x0;var _0xad41de=_0x149a[_0x12daf7];return _0xad41de;};'use strict';var multer=require('multer');var util=require(_0xa149('0x0'));var path=require(_0xa149('0x1'));var timeout=require(_0xa149('0x2'));var express=require('express');var router=express[_0xa149('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa149('0x4'));var config=require(_0xa149('0x5'));var controller=require('./intServicenowConfiguration.controller');router[_0xa149('0x6')]('/',auth[_0xa149('0x7')](),controller[_0xa149('0x8')]);router[_0xa149('0x6')](_0xa149('0x9'),auth['isAuthenticated'](),controller[_0xa149('0xa')]);router['get']('/:id/fields',auth[_0xa149('0x7')](),controller[_0xa149('0xb')]);router['get'](_0xa149('0xc'),auth[_0xa149('0x7')](),controller[_0xa149('0xd')]);router[_0xa149('0x6')](_0xa149('0xe'),auth[_0xa149('0x7')](),controller[_0xa149('0xf')]);router['post']('/',auth[_0xa149('0x7')](),controller[_0xa149('0x10')]);router[_0xa149('0x11')](_0xa149('0x9'),auth[_0xa149('0x7')](),controller[_0xa149('0x12')]);router[_0xa149('0x13')]('/:id',auth[_0xa149('0x7')](),controller[_0xa149('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 83725b8..34d38f7 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 _0x1725=['exports','STRING','sequelize'];(function(_0x5e10b4,_0x10850b){var _0x58b29b=function(_0x3b52){while(--_0x3b52){_0x5e10b4['push'](_0x5e10b4['shift']());}};_0x58b29b(++_0x10850b);}(_0x1725,0x1bb));var _0x5172=function(_0x487bb1,_0x536170){_0x487bb1=_0x487bb1-0x0;var _0x8a1331=_0x1725[_0x487bb1];return _0x8a1331;};'use strict';var Sequelize=require(_0x5172('0x0'));module[_0x5172('0x1')]={'name':{'type':Sequelize[_0x5172('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa3bc=['STRING','exports'];(function(_0x3dc2ea,_0x5f49f1){var _0x1eaf2c=function(_0x4006c5){while(--_0x4006c5){_0x3dc2ea['push'](_0x3dc2ea['shift']());}};_0x1eaf2c(++_0x5f49f1);}(_0xa3bc,0x1dd));var _0xca3b=function(_0x5de6ab,_0x4a9c5c){_0x5de6ab=_0x5de6ab-0x0;var _0x41fcd1=_0xa3bc[_0x5de6ab];return _0x41fcd1;};'use strict';var Sequelize=require('sequelize');module[_0xca3b('0x0')]={'name':{'type':Sequelize[_0xca3b('0x1')]},'description':{'type':Sequelize[_0xca3b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 361e423..1c43ffc 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 _0xe2b0=['getSubjects','findOne','ServicenowField','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','getFields'];(function(_0x51f36c,_0x55656e){var _0x2a9bfa=function(_0x2609f9){while(--_0x2609f9){_0x51f36c['push'](_0x51f36c['shift']());}};_0x2a9bfa(++_0x55656e);}(_0xe2b0,0x178));var _0x0e2b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xe2b0[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0e2b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e2b('0x1'));var jsonpatch=require(_0x0e2b('0x2'));var rp=require('request-promise');var moment=require(_0x0e2b('0x3'));var BPromise=require(_0x0e2b('0x4'));var Mustache=require(_0x0e2b('0x5'));var util=require(_0x0e2b('0x6'));var path=require(_0x0e2b('0x7'));var sox=require('sox');var csv=require(_0x0e2b('0x8'));var ejs=require(_0x0e2b('0x9'));var fs=require('fs');var _=require(_0x0e2b('0xa'));var squel=require(_0x0e2b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0e2b('0xc'));var toCsv=require(_0x0e2b('0x8'));var querystring=require('querystring');var Papa=require(_0x0e2b('0xd'));var Redis=require('ioredis');var authService=require(_0x0e2b('0xe'));var qs=require(_0x0e2b('0xf'));var as=require(_0x0e2b('0x10'));var hardwareService=require(_0x0e2b('0x11'));var logger=require(_0x0e2b('0x12'))('api');var utils=require(_0x0e2b('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x0e2b('0x14'));var client=jayson[_0x0e2b('0x15')][_0x0e2b('0x16')]({'port':0x232a});function checkPasswordPattern(_0x3365ff,_0x45edb9,_0x48e43c){if(_0x48e43c){var _0x3a3ca9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a3ca9[_0x0e2b('0x17')](_0x45edb9)){return _0x3365ff;}else{throw new db[(_0x0e2b('0x18'))][(_0x0e2b('0x19'))](_0x0e2b('0x1a'));}}else{return _0x3365ff;}}function respondWithRpcPromise(_0x25f675,_0x36669e,_0x2d62d5,_0x55382b){return new BPromise(function(_0x643dff,_0x1f1249){var _0x239f30=_0x55382b||client;return _0x239f30[_0x0e2b('0x1b')](_0x25f675,_0x2d62d5)[_0x0e2b('0x1c')](function(_0x1170f1){logger[_0x0e2b('0x1d')](_0x0e2b('0x1e'),_0x36669e,'request\x20sent');logger['debug'](_0x0e2b('0x1f'),_0x36669e,_0x0e2b('0x20'),JSON[_0x0e2b('0x21')](_0x1170f1));if(_0x1170f1['error']){if(_0x1170f1[_0x0e2b('0x22')][_0x0e2b('0x23')]===0x1f4){logger[_0x0e2b('0x22')](_0x0e2b('0x1e'),_0x36669e,_0x1170f1[_0x0e2b('0x22')]['message']);return _0x1f1249(_0x1170f1[_0x0e2b('0x22')][_0x0e2b('0x24')]);}logger[_0x0e2b('0x22')](_0x0e2b('0x1e'),_0x36669e,_0x1170f1['error']['message']);return _0x643dff(_0x1170f1['error']['message']);}else{logger[_0x0e2b('0x1d')]('ServicenowConfiguration,\x20%s,\x20%s',_0x36669e,_0x0e2b('0x20'));_0x643dff(_0x1170f1['result'][_0x0e2b('0x24')]);}})['catch'](function(_0x31f925){logger['error'](_0x0e2b('0x1e'),_0x36669e,_0x31f925);_0x1f1249(_0x31f925);});});}function respondWithStatusCode(_0x615e66,_0x2306f3){_0x2306f3=_0x2306f3||0xcc;return function(_0x337344){if(_0x337344){return _0x615e66[_0x0e2b('0x25')](_0x2306f3);}return _0x615e66[_0x0e2b('0x26')](_0x2306f3)[_0x0e2b('0x27')]();};}function respondWithResult(_0x4ebfa7,_0x22fa37){_0x22fa37=_0x22fa37||0xc8;return function(_0xe22cf2){if(_0xe22cf2){return _0x4ebfa7[_0x0e2b('0x26')](_0x22fa37)[_0x0e2b('0x28')](_0xe22cf2);}};}function respondWithFilteredResult(_0xb5788a,_0x2965eb){return function(_0x38cf12){if(_0x38cf12){var _0x3d7749=_0x38cf12[_0x0e2b('0x29')],_0xdccfbb=_0x2965eb['offset'],_0x56553b=_0x2965eb[_0x0e2b('0x2a')]+_0x2965eb[_0x0e2b('0x2b')],_0x58a6b6;if(_0x56553b>=_0x3d7749){_0x56553b=_0x3d7749;_0x58a6b6=0xc8;}else{_0x58a6b6=0xce;}_0xb5788a['status'](_0x58a6b6);return _0xb5788a[_0x0e2b('0x2c')](_0x0e2b('0x2d'),_0xdccfbb+'-'+_0x56553b+'/'+_0x3d7749)[_0x0e2b('0x28')](_0x38cf12);}return null;};}function patchUpdates(_0x606981){return function(_0x538596){try{jsonpatch[_0x0e2b('0x2e')](_0x538596,_0x606981,!![]);}catch(_0x2954bd){return BPromise[_0x0e2b('0x2f')](_0x2954bd);}return _0x538596[_0x0e2b('0x30')]();};}function saveUpdates(_0x1650bf,_0x1e2b86){return function(_0x4992b9){if(_0x4992b9){return _0x4992b9[_0x0e2b('0x31')](_0x1650bf)[_0x0e2b('0x1c')](function(_0x53e413){return _0x53e413;});}return null;};}function removeEntity(_0x2dd417,_0x65857b){return function(_0x2af45f){if(_0x2af45f){return _0x2af45f[_0x0e2b('0x32')]()[_0x0e2b('0x1c')](function(){_0x2dd417[_0x0e2b('0x26')](0xcc)[_0x0e2b('0x27')]();});}};}function handleEntityNotFound(_0x425b32,_0x39e4d5){return function(_0x41cc03){if(!_0x41cc03){_0x425b32[_0x0e2b('0x25')](0x194);}return _0x41cc03;};}function handleError(_0x3a5623,_0x294956){_0x294956=_0x294956||0x1f4;return function(_0x1156d1){logger[_0x0e2b('0x22')](_0x1156d1[_0x0e2b('0x33')]);if(_0x1156d1[_0x0e2b('0x34')]){delete _0x1156d1[_0x0e2b('0x34')];}_0x3a5623[_0x0e2b('0x26')](_0x294956)[_0x0e2b('0x35')](_0x1156d1);};}exports[_0x0e2b('0x36')]=function(_0x28de0b,_0x388c3a){var _0xdc19d7={},_0x453679={},_0x52e69c={'count':0x0,'rows':[]};var _0x4c2e9c=_[_0x0e2b('0x37')](db[_0x0e2b('0x38')][_0x0e2b('0x39')],function(_0x143da0){return{'name':_0x143da0[_0x0e2b('0x3a')],'type':_0x143da0[_0x0e2b('0x3b')][_0x0e2b('0x3c')]};});_0x453679[_0x0e2b('0x3d')]=_[_0x0e2b('0x37')](_0x4c2e9c,_0x0e2b('0x34'));_0x453679['query']=_[_0x0e2b('0x3e')](_0x28de0b['query']);_0x453679[_0x0e2b('0x3f')]=_[_0x0e2b('0x40')](_0x453679[_0x0e2b('0x3d')],_0x453679[_0x0e2b('0x41')]);_0xdc19d7[_0x0e2b('0x42')]=_[_0x0e2b('0x40')](_0x453679[_0x0e2b('0x3d')],qs['fields'](_0x28de0b['query'][_0x0e2b('0x43')]));_0xdc19d7[_0x0e2b('0x42')]=_0xdc19d7[_0x0e2b('0x42')][_0x0e2b('0x44')]?_0xdc19d7[_0x0e2b('0x42')]:_0x453679[_0x0e2b('0x3d')];if(!_0x28de0b[_0x0e2b('0x41')][_0x0e2b('0x45')](_0x0e2b('0x46'))){_0xdc19d7['limit']=qs[_0x0e2b('0x2b')](_0x28de0b[_0x0e2b('0x41')][_0x0e2b('0x2b')]);_0xdc19d7[_0x0e2b('0x2a')]=qs[_0x0e2b('0x2a')](_0x28de0b['query'][_0x0e2b('0x2a')]);}_0xdc19d7[_0x0e2b('0x47')]=qs[_0x0e2b('0x48')](_0x28de0b[_0x0e2b('0x41')]['sort']);_0xdc19d7[_0x0e2b('0x49')]=qs[_0x0e2b('0x3f')](_[_0x0e2b('0x4a')](_0x28de0b['query'],_0x453679[_0x0e2b('0x3f')]));if(_0x28de0b['query']['filter']){_0xdc19d7[_0x0e2b('0x49')]=_[_0x0e2b('0x4b')](_0xdc19d7[_0x0e2b('0x49')],{'$or':_[_0x0e2b('0x37')](_0x4c2e9c,function(_0x15dffc){if(_0x15dffc[_0x0e2b('0x3b')]!==_0x0e2b('0x4c')){var _0x104280={};_0x104280[_0x15dffc[_0x0e2b('0x34')]]={'$like':'%'+_0x28de0b[_0x0e2b('0x41')][_0x0e2b('0x4d')]+'%'};return _0x104280;}})});}_0xdc19d7=_['merge']({},_0xdc19d7,_0x28de0b[_0x0e2b('0x4e')]);var _0x108053={'where':_0xdc19d7[_0x0e2b('0x49')]};return db[_0x0e2b('0x38')][_0x0e2b('0x29')](_0x108053)[_0x0e2b('0x1c')](function(_0x2c66e6){_0x52e69c[_0x0e2b('0x29')]=_0x2c66e6;if(_0x28de0b[_0x0e2b('0x41')][_0x0e2b('0x4f')]){_0xdc19d7[_0x0e2b('0x50')]=[{'all':!![]}];}return db[_0x0e2b('0x38')]['findAll'](_0xdc19d7);})[_0x0e2b('0x1c')](function(_0x56a619){_0x52e69c[_0x0e2b('0x51')]=_0x56a619;return _0x52e69c;})[_0x0e2b('0x1c')](respondWithFilteredResult(_0x388c3a,_0xdc19d7))[_0x0e2b('0x52')](handleError(_0x388c3a,null));};exports[_0x0e2b('0x53')]=function(_0x2a0aa5,_0xbfb8de){var _0x5e094a={'raw':![],'where':{'id':_0x2a0aa5[_0x0e2b('0x54')]['id']}},_0x5a5fb5={};_0x5a5fb5[_0x0e2b('0x3d')]=_[_0x0e2b('0x3e')](db[_0x0e2b('0x38')]['rawAttributes']);_0x5a5fb5[_0x0e2b('0x41')]=_['keys'](_0x2a0aa5[_0x0e2b('0x41')]);_0x5a5fb5[_0x0e2b('0x3f')]=_[_0x0e2b('0x40')](_0x5a5fb5[_0x0e2b('0x3d')],_0x5a5fb5[_0x0e2b('0x41')]);_0x5e094a[_0x0e2b('0x42')]=_[_0x0e2b('0x40')](_0x5a5fb5[_0x0e2b('0x3d')],qs[_0x0e2b('0x43')](_0x2a0aa5['query'][_0x0e2b('0x43')]));_0x5e094a[_0x0e2b('0x42')]=_0x5e094a[_0x0e2b('0x42')][_0x0e2b('0x44')]?_0x5e094a[_0x0e2b('0x42')]:_0x5a5fb5[_0x0e2b('0x3d')];if(_0x2a0aa5[_0x0e2b('0x41')]['includeAll']){_0x5e094a[_0x0e2b('0x50')]=[{'all':!![]}];}_0x5e094a=_[_0x0e2b('0x4b')]({},_0x5e094a,_0x2a0aa5[_0x0e2b('0x4e')]);return db[_0x0e2b('0x38')][_0x0e2b('0x55')](_0x5e094a)['then'](handleEntityNotFound(_0xbfb8de,null))['then'](respondWithResult(_0xbfb8de,null))[_0x0e2b('0x52')](handleError(_0xbfb8de,null));};exports[_0x0e2b('0x56')]=function(_0x12f875,_0x2737d4){return db[_0x0e2b('0x38')][_0x0e2b('0x56')](_0x12f875[_0x0e2b('0x57')],{})[_0x0e2b('0x1c')](respondWithResult(_0x2737d4,0xc9))[_0x0e2b('0x52')](handleError(_0x2737d4,null));};exports['update']=function(_0x5bd8ed,_0x580531){if(_0x5bd8ed[_0x0e2b('0x57')]['id']){delete _0x5bd8ed['body']['id'];}return db[_0x0e2b('0x38')][_0x0e2b('0x55')]({'where':{'id':_0x5bd8ed['params']['id']}})[_0x0e2b('0x1c')](handleEntityNotFound(_0x580531,null))[_0x0e2b('0x1c')](saveUpdates(_0x5bd8ed[_0x0e2b('0x57')],null))[_0x0e2b('0x1c')](respondWithResult(_0x580531,null))['catch'](handleError(_0x580531,null));};exports[_0x0e2b('0x32')]=function(_0x24edbe,_0x2b0e5c){return db[_0x0e2b('0x38')][_0x0e2b('0x55')]({'where':{'id':_0x24edbe[_0x0e2b('0x54')]['id']}})['then'](handleEntityNotFound(_0x2b0e5c,null))[_0x0e2b('0x1c')](removeEntity(_0x2b0e5c,null))[_0x0e2b('0x52')](handleError(_0x2b0e5c,null));};exports['getFields']=function(_0xd4dae1,_0x44ae54,_0x1529ba){var _0x409619={};var _0x11f3fb={};var _0x4f82ae;var _0x3b9ad3;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0xd4dae1[_0x0e2b('0x54')]['id']}})[_0x0e2b('0x1c')](handleEntityNotFound(_0x44ae54,null))[_0x0e2b('0x1c')](function(_0x1ee941){if(_0x1ee941){_0x4f82ae=_0x1ee941;_0x11f3fb[_0x0e2b('0x3d')]=_[_0x0e2b('0x3e')](db['ServicenowField']['rawAttributes']);_0x11f3fb[_0x0e2b('0x41')]=_[_0x0e2b('0x3e')](_0xd4dae1['query']);_0x11f3fb[_0x0e2b('0x3f')]=_['intersection'](_0x11f3fb['model'],_0x11f3fb['query']);_0x409619[_0x0e2b('0x42')]=_[_0x0e2b('0x40')](_0x11f3fb[_0x0e2b('0x3d')],qs[_0x0e2b('0x43')](_0xd4dae1[_0x0e2b('0x41')][_0x0e2b('0x43')]));_0x409619[_0x0e2b('0x42')]=_0x409619['attributes'][_0x0e2b('0x44')]?_0x409619[_0x0e2b('0x42')]:_0x11f3fb[_0x0e2b('0x3d')];_0x409619[_0x0e2b('0x47')]=qs['sort'](_0xd4dae1[_0x0e2b('0x41')][_0x0e2b('0x48')]);_0x409619[_0x0e2b('0x49')]=qs['filters'](_[_0x0e2b('0x4a')](_0xd4dae1[_0x0e2b('0x41')],_0x11f3fb[_0x0e2b('0x3f')]));if(_0xd4dae1[_0x0e2b('0x41')][_0x0e2b('0x4d')]){_0x409619[_0x0e2b('0x49')]=_[_0x0e2b('0x4b')](_0x409619[_0x0e2b('0x49')],{'$or':_['map'](_0x409619[_0x0e2b('0x42')],function(_0x2486e6){var _0x4d9322={};_0x4d9322[_0x2486e6]={'$like':'%'+_0xd4dae1[_0x0e2b('0x41')][_0x0e2b('0x4d')]+'%'};return _0x4d9322;})});}_0x409619=_[_0x0e2b('0x4b')]({},_0x409619,_0xd4dae1[_0x0e2b('0x4e')]);return _0x4f82ae[_0x0e2b('0x58')](_0x409619);}})[_0x0e2b('0x1c')](function(_0x97d8fa){if(_0x97d8fa){_0x3b9ad3=_0x97d8fa[_0x0e2b('0x44')];if(!_0xd4dae1[_0x0e2b('0x41')][_0x0e2b('0x45')](_0x0e2b('0x46'))){_0x409619[_0x0e2b('0x2b')]=qs[_0x0e2b('0x2b')](_0xd4dae1['query'][_0x0e2b('0x2b')]);_0x409619[_0x0e2b('0x2a')]=qs[_0x0e2b('0x2a')](_0xd4dae1[_0x0e2b('0x41')][_0x0e2b('0x2a')]);}return _0x4f82ae['getFields'](_0x409619);}})[_0x0e2b('0x1c')](function(_0x4eae28){if(_0x4eae28){return _0x4eae28?{'count':_0x3b9ad3,'rows':_0x4eae28}:null;}})[_0x0e2b('0x1c')](respondWithResult(_0x44ae54,null))[_0x0e2b('0x52')](handleError(_0x44ae54,null));};exports[_0x0e2b('0x59')]=function(_0x7f8348,_0x3fa869,_0x1eeed2){var _0x9a75e3={};var _0x15c970={};var _0x53a4a7;var _0x2ca867;return db[_0x0e2b('0x38')][_0x0e2b('0x5a')]({'where':{'id':_0x7f8348[_0x0e2b('0x54')]['id']}})[_0x0e2b('0x1c')](handleEntityNotFound(_0x3fa869,null))['then'](function(_0x5a68fc){if(_0x5a68fc){_0x53a4a7=_0x5a68fc;_0x15c970[_0x0e2b('0x3d')]=_['keys'](db[_0x0e2b('0x5b')]['rawAttributes']);_0x15c970[_0x0e2b('0x41')]=_['keys'](_0x7f8348[_0x0e2b('0x41')]);_0x15c970[_0x0e2b('0x3f')]=_[_0x0e2b('0x40')](_0x15c970[_0x0e2b('0x3d')],_0x15c970[_0x0e2b('0x41')]);_0x9a75e3['attributes']=_[_0x0e2b('0x40')](_0x15c970[_0x0e2b('0x3d')],qs[_0x0e2b('0x43')](_0x7f8348[_0x0e2b('0x41')]['fields']));_0x9a75e3[_0x0e2b('0x42')]=_0x9a75e3['attributes']['length']?_0x9a75e3['attributes']:_0x15c970['model'];_0x9a75e3[_0x0e2b('0x47')]=qs[_0x0e2b('0x48')](_0x7f8348[_0x0e2b('0x41')]['sort']);_0x9a75e3[_0x0e2b('0x49')]=qs[_0x0e2b('0x3f')](_[_0x0e2b('0x4a')](_0x7f8348['query'],_0x15c970[_0x0e2b('0x3f')]));if(_0x7f8348[_0x0e2b('0x41')]['filter']){_0x9a75e3['where']=_['merge'](_0x9a75e3[_0x0e2b('0x49')],{'$or':_[_0x0e2b('0x37')](_0x9a75e3[_0x0e2b('0x42')],function(_0x18e28b){var _0x440bf4={};_0x440bf4[_0x18e28b]={'$like':'%'+_0x7f8348[_0x0e2b('0x41')][_0x0e2b('0x4d')]+'%'};return _0x440bf4;})});}_0x9a75e3=_[_0x0e2b('0x4b')]({},_0x9a75e3,_0x7f8348['options']);return _0x53a4a7[_0x0e2b('0x59')](_0x9a75e3);}})['then'](function(_0x44731e){if(_0x44731e){_0x2ca867=_0x44731e['length'];if(!_0x7f8348['query'][_0x0e2b('0x45')](_0x0e2b('0x46'))){_0x9a75e3[_0x0e2b('0x2b')]=qs[_0x0e2b('0x2b')](_0x7f8348[_0x0e2b('0x41')]['limit']);_0x9a75e3[_0x0e2b('0x2a')]=qs[_0x0e2b('0x2a')](_0x7f8348['query'][_0x0e2b('0x2a')]);}return _0x53a4a7[_0x0e2b('0x59')](_0x9a75e3);}})[_0x0e2b('0x1c')](function(_0x13e9aa){if(_0x13e9aa){return _0x13e9aa?{'count':_0x2ca867,'rows':_0x13e9aa}:null;}})['then'](respondWithResult(_0x3fa869,null))['catch'](handleError(_0x3fa869,null));};exports['getDescriptions']=function(_0x68fa32,_0x550704,_0x4a64ff){var _0x530de8={};var _0x42e380={};var _0x41b3a8;var _0x3a378a;return db[_0x0e2b('0x38')][_0x0e2b('0x5a')]({'where':{'id':_0x68fa32[_0x0e2b('0x54')]['id']}})[_0x0e2b('0x1c')](handleEntityNotFound(_0x550704,null))[_0x0e2b('0x1c')](function(_0x580263){if(_0x580263){_0x41b3a8=_0x580263;_0x42e380[_0x0e2b('0x3d')]=_[_0x0e2b('0x3e')](db[_0x0e2b('0x5b')]['rawAttributes']);_0x42e380[_0x0e2b('0x41')]=_[_0x0e2b('0x3e')](_0x68fa32[_0x0e2b('0x41')]);_0x42e380['filters']=_[_0x0e2b('0x40')](_0x42e380[_0x0e2b('0x3d')],_0x42e380['query']);_0x530de8[_0x0e2b('0x42')]=_['intersection'](_0x42e380[_0x0e2b('0x3d')],qs['fields'](_0x68fa32['query'][_0x0e2b('0x43')]));_0x530de8[_0x0e2b('0x42')]=_0x530de8[_0x0e2b('0x42')][_0x0e2b('0x44')]?_0x530de8[_0x0e2b('0x42')]:_0x42e380[_0x0e2b('0x3d')];_0x530de8['order']=qs[_0x0e2b('0x48')](_0x68fa32[_0x0e2b('0x41')]['sort']);_0x530de8['where']=qs[_0x0e2b('0x3f')](_[_0x0e2b('0x4a')](_0x68fa32[_0x0e2b('0x41')],_0x42e380[_0x0e2b('0x3f')]));if(_0x68fa32[_0x0e2b('0x41')][_0x0e2b('0x4d')]){_0x530de8[_0x0e2b('0x49')]=_[_0x0e2b('0x4b')](_0x530de8[_0x0e2b('0x49')],{'$or':_[_0x0e2b('0x37')](_0x530de8[_0x0e2b('0x42')],function(_0x3b4507){var _0xf8a763={};_0xf8a763[_0x3b4507]={'$like':'%'+_0x68fa32[_0x0e2b('0x41')][_0x0e2b('0x4d')]+'%'};return _0xf8a763;})});}_0x530de8=_[_0x0e2b('0x4b')]({},_0x530de8,_0x68fa32[_0x0e2b('0x4e')]);return _0x41b3a8[_0x0e2b('0x5c')](_0x530de8);}})[_0x0e2b('0x1c')](function(_0x37aae4){if(_0x37aae4){_0x3a378a=_0x37aae4[_0x0e2b('0x44')];if(!_0x68fa32['query'][_0x0e2b('0x45')]('nolimit')){_0x530de8['limit']=qs['limit'](_0x68fa32[_0x0e2b('0x41')]['limit']);_0x530de8['offset']=qs[_0x0e2b('0x2a')](_0x68fa32['query'][_0x0e2b('0x2a')]);}return _0x41b3a8[_0x0e2b('0x5c')](_0x530de8);}})['then'](function(_0xd2b8f){if(_0xd2b8f){return _0xd2b8f?{'count':_0x3a378a,'rows':_0xd2b8f}:null;}})['then'](respondWithResult(_0x550704,null))['catch'](handleError(_0x550704,null));}; \ No newline at end of file +var _0x8714=['merge','create','body','find','destroy','getFields','findOne','nolimit','getSubjects','ServicenowField','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','update','name','send','index','map','ServicenowConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','rows','params','rawAttributes'];(function(_0x149c3c,_0x5680d5){var _0x143df6=function(_0x3fd363){while(--_0x3fd363){_0x149c3c['push'](_0x149c3c['shift']());}};_0x143df6(++_0x5680d5);}(_0x8714,0xc1));var _0x4871=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x8714[_0x15bc81];return _0x59440e;};'use strict';var pdf=require(_0x4871('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4871('0x1'));var zipdir=require(_0x4871('0x2'));var jsonpatch=require(_0x4871('0x3'));var rp=require(_0x4871('0x4'));var moment=require(_0x4871('0x5'));var BPromise=require(_0x4871('0x6'));var Mustache=require(_0x4871('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4871('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4871('0x9'));var squel=require(_0x4871('0xa'));var crypto=require(_0x4871('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4871('0x8'));var querystring=require(_0x4871('0xc'));var Papa=require(_0x4871('0xd'));var Redis=require(_0x4871('0xe'));var authService=require(_0x4871('0xf'));var qs=require(_0x4871('0x10'));var as=require(_0x4871('0x11'));var hardwareService=require(_0x4871('0x12'));var logger=require(_0x4871('0x13'))('api');var utils=require(_0x4871('0x14'));var config=require(_0x4871('0x15'));var db=require(_0x4871('0x16'))['db'];var jayson=require(_0x4871('0x17'));var client=jayson[_0x4871('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x169886,_0x13c89f,_0x46aa4d){if(_0x46aa4d){var _0x9b940e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9b940e[_0x4871('0x19')](_0x13c89f)){return _0x169886;}else{throw new db[(_0x4871('0x1a'))][(_0x4871('0x1b'))](_0x4871('0x1c'));}}else{return _0x169886;}}function respondWithRpcPromise(_0x5c3447,_0x47ba36,_0x437d8f,_0x3ba5c3){return new BPromise(function(_0x35b1c8,_0xac424e){var _0x5b84a2=_0x3ba5c3||client;return _0x5b84a2[_0x4871('0x1d')](_0x5c3447,_0x437d8f)[_0x4871('0x1e')](function(_0x536e76){logger['info'](_0x4871('0x1f'),_0x47ba36,'request\x20sent');logger[_0x4871('0x20')](_0x4871('0x21'),_0x47ba36,'request\x20sent',JSON[_0x4871('0x22')](_0x536e76));if(_0x536e76['error']){if(_0x536e76[_0x4871('0x23')]['code']===0x1f4){logger[_0x4871('0x23')](_0x4871('0x1f'),_0x47ba36,_0x536e76[_0x4871('0x23')][_0x4871('0x24')]);return _0xac424e(_0x536e76[_0x4871('0x23')][_0x4871('0x24')]);}logger['error'](_0x4871('0x1f'),_0x47ba36,_0x536e76['error'][_0x4871('0x24')]);return _0x35b1c8(_0x536e76[_0x4871('0x23')][_0x4871('0x24')]);}else{logger[_0x4871('0x25')](_0x4871('0x1f'),_0x47ba36,_0x4871('0x26'));_0x35b1c8(_0x536e76['result'][_0x4871('0x24')]);}})[_0x4871('0x27')](function(_0x514af1){logger[_0x4871('0x23')](_0x4871('0x1f'),_0x47ba36,_0x514af1);_0xac424e(_0x514af1);});});}function respondWithStatusCode(_0xe48902,_0x1a53b5){_0x1a53b5=_0x1a53b5||0xcc;return function(_0x554b62){if(_0x554b62){return _0xe48902[_0x4871('0x28')](_0x1a53b5);}return _0xe48902[_0x4871('0x29')](_0x1a53b5)[_0x4871('0x2a')]();};}function respondWithResult(_0x8a591d,_0x9304d0){_0x9304d0=_0x9304d0||0xc8;return function(_0x58029e){if(_0x58029e){return _0x8a591d[_0x4871('0x29')](_0x9304d0)[_0x4871('0x2b')](_0x58029e);}};}function respondWithFilteredResult(_0x34c99c,_0x39c386){return function(_0x3e982b){if(_0x3e982b){var _0x2682b8=_0x3e982b[_0x4871('0x2c')],_0x3951c4=_0x39c386[_0x4871('0x2d')],_0x39c5fb=_0x39c386[_0x4871('0x2d')]+_0x39c386['limit'],_0x54cd37;if(_0x39c5fb>=_0x2682b8){_0x39c5fb=_0x2682b8;_0x54cd37=0xc8;}else{_0x54cd37=0xce;}_0x34c99c[_0x4871('0x29')](_0x54cd37);return _0x34c99c[_0x4871('0x2e')](_0x4871('0x2f'),_0x3951c4+'-'+_0x39c5fb+'/'+_0x2682b8)[_0x4871('0x2b')](_0x3e982b);}return null;};}function patchUpdates(_0x5d2b9f){return function(_0x74be8e){try{jsonpatch[_0x4871('0x30')](_0x74be8e,_0x5d2b9f,!![]);}catch(_0x2eba30){return BPromise['reject'](_0x2eba30);}return _0x74be8e['save']();};}function saveUpdates(_0x35614b,_0x177cef){return function(_0xd20271){if(_0xd20271){return _0xd20271[_0x4871('0x31')](_0x35614b)['then'](function(_0x5cae8f){return _0x5cae8f;});}return null;};}function removeEntity(_0x37eb9c,_0xb42237){return function(_0x34f430){if(_0x34f430){return _0x34f430['destroy']()['then'](function(){_0x37eb9c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c4233,_0x3bfcc0){return function(_0xed9b6d){if(!_0xed9b6d){_0x3c4233[_0x4871('0x28')](0x194);}return _0xed9b6d;};}function handleError(_0x3d852f,_0x94ff59){_0x94ff59=_0x94ff59||0x1f4;return function(_0xbb78f5){logger[_0x4871('0x23')](_0xbb78f5['stack']);if(_0xbb78f5[_0x4871('0x32')]){delete _0xbb78f5[_0x4871('0x32')];}_0x3d852f[_0x4871('0x29')](_0x94ff59)[_0x4871('0x33')](_0xbb78f5);};}exports[_0x4871('0x34')]=function(_0x138fc9,_0x466870){var _0x538f31={},_0x23b0fa={},_0x19765b={'count':0x0,'rows':[]};var _0x5a6cc4=_[_0x4871('0x35')](db[_0x4871('0x36')]['rawAttributes'],function(_0xaf5048){return{'name':_0xaf5048[_0x4871('0x37')],'type':_0xaf5048[_0x4871('0x38')][_0x4871('0x39')]};});_0x23b0fa[_0x4871('0x3a')]=_[_0x4871('0x35')](_0x5a6cc4,_0x4871('0x32'));_0x23b0fa[_0x4871('0x3b')]=_[_0x4871('0x3c')](_0x138fc9[_0x4871('0x3b')]);_0x23b0fa[_0x4871('0x3d')]=_[_0x4871('0x3e')](_0x23b0fa[_0x4871('0x3a')],_0x23b0fa[_0x4871('0x3b')]);_0x538f31[_0x4871('0x3f')]=_[_0x4871('0x3e')](_0x23b0fa[_0x4871('0x3a')],qs[_0x4871('0x40')](_0x138fc9[_0x4871('0x3b')][_0x4871('0x40')]));_0x538f31[_0x4871('0x3f')]=_0x538f31[_0x4871('0x3f')][_0x4871('0x41')]?_0x538f31[_0x4871('0x3f')]:_0x23b0fa['model'];if(!_0x138fc9[_0x4871('0x3b')][_0x4871('0x42')]('nolimit')){_0x538f31['limit']=qs[_0x4871('0x43')](_0x138fc9[_0x4871('0x3b')][_0x4871('0x43')]);_0x538f31[_0x4871('0x2d')]=qs['offset'](_0x138fc9[_0x4871('0x3b')]['offset']);}_0x538f31[_0x4871('0x44')]=qs[_0x4871('0x45')](_0x138fc9[_0x4871('0x3b')][_0x4871('0x45')]);_0x538f31['where']=qs['filters'](_[_0x4871('0x46')](_0x138fc9[_0x4871('0x3b')],_0x23b0fa['filters']));if(_0x138fc9[_0x4871('0x3b')][_0x4871('0x47')]){_0x538f31[_0x4871('0x48')]=_['merge'](_0x538f31[_0x4871('0x48')],{'$or':_['map'](_0x5a6cc4,function(_0x211bf5){if(_0x211bf5[_0x4871('0x38')]!==_0x4871('0x49')){var _0x9341e9={};_0x9341e9[_0x211bf5[_0x4871('0x32')]]={'$like':'%'+_0x138fc9['query'][_0x4871('0x47')]+'%'};return _0x9341e9;}})});}_0x538f31=_['merge']({},_0x538f31,_0x138fc9[_0x4871('0x4a')]);var _0xe3f773={'where':_0x538f31[_0x4871('0x48')]};return db[_0x4871('0x36')]['count'](_0xe3f773)[_0x4871('0x1e')](function(_0x4829dd){_0x19765b[_0x4871('0x2c')]=_0x4829dd;if(_0x138fc9['query'][_0x4871('0x4b')]){_0x538f31[_0x4871('0x4c')]=[{'all':!![]}];}return db[_0x4871('0x36')]['findAll'](_0x538f31);})[_0x4871('0x1e')](function(_0x1fde91){_0x19765b[_0x4871('0x4d')]=_0x1fde91;return _0x19765b;})[_0x4871('0x1e')](respondWithFilteredResult(_0x466870,_0x538f31))[_0x4871('0x27')](handleError(_0x466870,null));};exports['show']=function(_0xd3d430,_0x2c2476){var _0x4f3319={'raw':![],'where':{'id':_0xd3d430[_0x4871('0x4e')]['id']}},_0x4d13ec={};_0x4d13ec[_0x4871('0x3a')]=_[_0x4871('0x3c')](db[_0x4871('0x36')][_0x4871('0x4f')]);_0x4d13ec[_0x4871('0x3b')]=_['keys'](_0xd3d430['query']);_0x4d13ec['filters']=_[_0x4871('0x3e')](_0x4d13ec[_0x4871('0x3a')],_0x4d13ec[_0x4871('0x3b')]);_0x4f3319[_0x4871('0x3f')]=_[_0x4871('0x3e')](_0x4d13ec[_0x4871('0x3a')],qs[_0x4871('0x40')](_0xd3d430[_0x4871('0x3b')][_0x4871('0x40')]));_0x4f3319[_0x4871('0x3f')]=_0x4f3319[_0x4871('0x3f')][_0x4871('0x41')]?_0x4f3319['attributes']:_0x4d13ec['model'];if(_0xd3d430[_0x4871('0x3b')][_0x4871('0x4b')]){_0x4f3319[_0x4871('0x4c')]=[{'all':!![]}];}_0x4f3319=_[_0x4871('0x50')]({},_0x4f3319,_0xd3d430[_0x4871('0x4a')]);return db[_0x4871('0x36')]['find'](_0x4f3319)[_0x4871('0x1e')](handleEntityNotFound(_0x2c2476,null))[_0x4871('0x1e')](respondWithResult(_0x2c2476,null))[_0x4871('0x27')](handleError(_0x2c2476,null));};exports[_0x4871('0x51')]=function(_0x1582b8,_0x4e6bba){return db['ServicenowConfiguration']['create'](_0x1582b8[_0x4871('0x52')],{})['then'](respondWithResult(_0x4e6bba,0xc9))[_0x4871('0x27')](handleError(_0x4e6bba,null));};exports[_0x4871('0x31')]=function(_0xb56d08,_0x540cf8){if(_0xb56d08[_0x4871('0x52')]['id']){delete _0xb56d08[_0x4871('0x52')]['id'];}return db[_0x4871('0x36')][_0x4871('0x53')]({'where':{'id':_0xb56d08[_0x4871('0x4e')]['id']}})['then'](handleEntityNotFound(_0x540cf8,null))[_0x4871('0x1e')](saveUpdates(_0xb56d08[_0x4871('0x52')],null))[_0x4871('0x1e')](respondWithResult(_0x540cf8,null))[_0x4871('0x27')](handleError(_0x540cf8,null));};exports[_0x4871('0x54')]=function(_0x535b7d,_0x2a9a51){return db[_0x4871('0x36')][_0x4871('0x53')]({'where':{'id':_0x535b7d[_0x4871('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2a9a51,null))['then'](removeEntity(_0x2a9a51,null))[_0x4871('0x27')](handleError(_0x2a9a51,null));};exports[_0x4871('0x55')]=function(_0x3b0d4e,_0x4ec3c1,_0x4606d2){var _0x165f39={};var _0xf4a168={};var _0x4d2bb7;var _0x4620fa;return db[_0x4871('0x36')][_0x4871('0x56')]({'where':{'id':_0x3b0d4e[_0x4871('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4ec3c1,null))[_0x4871('0x1e')](function(_0x2a0415){if(_0x2a0415){_0x4d2bb7=_0x2a0415;_0xf4a168[_0x4871('0x3a')]=_[_0x4871('0x3c')](db['ServicenowField']['rawAttributes']);_0xf4a168[_0x4871('0x3b')]=_[_0x4871('0x3c')](_0x3b0d4e[_0x4871('0x3b')]);_0xf4a168[_0x4871('0x3d')]=_[_0x4871('0x3e')](_0xf4a168[_0x4871('0x3a')],_0xf4a168[_0x4871('0x3b')]);_0x165f39[_0x4871('0x3f')]=_[_0x4871('0x3e')](_0xf4a168[_0x4871('0x3a')],qs['fields'](_0x3b0d4e[_0x4871('0x3b')][_0x4871('0x40')]));_0x165f39[_0x4871('0x3f')]=_0x165f39['attributes'][_0x4871('0x41')]?_0x165f39['attributes']:_0xf4a168[_0x4871('0x3a')];_0x165f39[_0x4871('0x44')]=qs[_0x4871('0x45')](_0x3b0d4e[_0x4871('0x3b')][_0x4871('0x45')]);_0x165f39[_0x4871('0x48')]=qs[_0x4871('0x3d')](_[_0x4871('0x46')](_0x3b0d4e[_0x4871('0x3b')],_0xf4a168[_0x4871('0x3d')]));if(_0x3b0d4e[_0x4871('0x3b')][_0x4871('0x47')]){_0x165f39['where']=_[_0x4871('0x50')](_0x165f39[_0x4871('0x48')],{'$or':_[_0x4871('0x35')](_0x165f39[_0x4871('0x3f')],function(_0x42b5ab){var _0x56e297={};_0x56e297[_0x42b5ab]={'$like':'%'+_0x3b0d4e[_0x4871('0x3b')][_0x4871('0x47')]+'%'};return _0x56e297;})});}_0x165f39=_[_0x4871('0x50')]({},_0x165f39,_0x3b0d4e[_0x4871('0x4a')]);return _0x4d2bb7[_0x4871('0x55')](_0x165f39);}})[_0x4871('0x1e')](function(_0x387aa3){if(_0x387aa3){_0x4620fa=_0x387aa3[_0x4871('0x41')];if(!_0x3b0d4e[_0x4871('0x3b')]['hasOwnProperty'](_0x4871('0x57'))){_0x165f39['limit']=qs[_0x4871('0x43')](_0x3b0d4e['query'][_0x4871('0x43')]);_0x165f39['offset']=qs[_0x4871('0x2d')](_0x3b0d4e['query'][_0x4871('0x2d')]);}return _0x4d2bb7[_0x4871('0x55')](_0x165f39);}})['then'](function(_0x4d8fa9){if(_0x4d8fa9){return _0x4d8fa9?{'count':_0x4620fa,'rows':_0x4d8fa9}:null;}})['then'](respondWithResult(_0x4ec3c1,null))[_0x4871('0x27')](handleError(_0x4ec3c1,null));};exports[_0x4871('0x58')]=function(_0x4e8e62,_0x4ef35f,_0x130810){var _0x77d442={};var _0x4ae9bc={};var _0x4ed5b0;var _0xb4043d;return db[_0x4871('0x36')][_0x4871('0x56')]({'where':{'id':_0x4e8e62[_0x4871('0x4e')]['id']}})[_0x4871('0x1e')](handleEntityNotFound(_0x4ef35f,null))['then'](function(_0x374e43){if(_0x374e43){_0x4ed5b0=_0x374e43;_0x4ae9bc[_0x4871('0x3a')]=_[_0x4871('0x3c')](db[_0x4871('0x59')][_0x4871('0x4f')]);_0x4ae9bc[_0x4871('0x3b')]=_[_0x4871('0x3c')](_0x4e8e62[_0x4871('0x3b')]);_0x4ae9bc[_0x4871('0x3d')]=_[_0x4871('0x3e')](_0x4ae9bc[_0x4871('0x3a')],_0x4ae9bc['query']);_0x77d442[_0x4871('0x3f')]=_[_0x4871('0x3e')](_0x4ae9bc['model'],qs[_0x4871('0x40')](_0x4e8e62[_0x4871('0x3b')][_0x4871('0x40')]));_0x77d442[_0x4871('0x3f')]=_0x77d442[_0x4871('0x3f')][_0x4871('0x41')]?_0x77d442[_0x4871('0x3f')]:_0x4ae9bc[_0x4871('0x3a')];_0x77d442[_0x4871('0x44')]=qs[_0x4871('0x45')](_0x4e8e62['query']['sort']);_0x77d442[_0x4871('0x48')]=qs[_0x4871('0x3d')](_['pick'](_0x4e8e62[_0x4871('0x3b')],_0x4ae9bc[_0x4871('0x3d')]));if(_0x4e8e62['query'][_0x4871('0x47')]){_0x77d442[_0x4871('0x48')]=_[_0x4871('0x50')](_0x77d442[_0x4871('0x48')],{'$or':_['map'](_0x77d442['attributes'],function(_0x5f38ca){var _0x535aa8={};_0x535aa8[_0x5f38ca]={'$like':'%'+_0x4e8e62[_0x4871('0x3b')][_0x4871('0x47')]+'%'};return _0x535aa8;})});}_0x77d442=_[_0x4871('0x50')]({},_0x77d442,_0x4e8e62['options']);return _0x4ed5b0[_0x4871('0x58')](_0x77d442);}})[_0x4871('0x1e')](function(_0x52f5e2){if(_0x52f5e2){_0xb4043d=_0x52f5e2['length'];if(!_0x4e8e62[_0x4871('0x3b')]['hasOwnProperty'](_0x4871('0x57'))){_0x77d442[_0x4871('0x43')]=qs[_0x4871('0x43')](_0x4e8e62[_0x4871('0x3b')][_0x4871('0x43')]);_0x77d442['offset']=qs['offset'](_0x4e8e62[_0x4871('0x3b')][_0x4871('0x2d')]);}return _0x4ed5b0['getSubjects'](_0x77d442);}})[_0x4871('0x1e')](function(_0x474d68){if(_0x474d68){return _0x474d68?{'count':_0xb4043d,'rows':_0x474d68}:null;}})['then'](respondWithResult(_0x4ef35f,null))[_0x4871('0x27')](handleError(_0x4ef35f,null));};exports[_0x4871('0x5a')]=function(_0x5063d9,_0x1e0e51,_0x3fb8a5){var _0x15c94d={};var _0xa00950={};var _0x2b91b0;var _0x2a9d38;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x5063d9['params']['id']}})[_0x4871('0x1e')](handleEntityNotFound(_0x1e0e51,null))['then'](function(_0x13c591){if(_0x13c591){_0x2b91b0=_0x13c591;_0xa00950[_0x4871('0x3a')]=_[_0x4871('0x3c')](db[_0x4871('0x59')][_0x4871('0x4f')]);_0xa00950[_0x4871('0x3b')]=_[_0x4871('0x3c')](_0x5063d9[_0x4871('0x3b')]);_0xa00950[_0x4871('0x3d')]=_[_0x4871('0x3e')](_0xa00950[_0x4871('0x3a')],_0xa00950['query']);_0x15c94d['attributes']=_[_0x4871('0x3e')](_0xa00950['model'],qs[_0x4871('0x40')](_0x5063d9[_0x4871('0x3b')]['fields']));_0x15c94d[_0x4871('0x3f')]=_0x15c94d[_0x4871('0x3f')]['length']?_0x15c94d[_0x4871('0x3f')]:_0xa00950[_0x4871('0x3a')];_0x15c94d['order']=qs[_0x4871('0x45')](_0x5063d9[_0x4871('0x3b')][_0x4871('0x45')]);_0x15c94d[_0x4871('0x48')]=qs[_0x4871('0x3d')](_['pick'](_0x5063d9['query'],_0xa00950['filters']));if(_0x5063d9[_0x4871('0x3b')]['filter']){_0x15c94d[_0x4871('0x48')]=_[_0x4871('0x50')](_0x15c94d[_0x4871('0x48')],{'$or':_[_0x4871('0x35')](_0x15c94d[_0x4871('0x3f')],function(_0x427313){var _0x40e661={};_0x40e661[_0x427313]={'$like':'%'+_0x5063d9[_0x4871('0x3b')][_0x4871('0x47')]+'%'};return _0x40e661;})});}_0x15c94d=_[_0x4871('0x50')]({},_0x15c94d,_0x5063d9[_0x4871('0x4a')]);return _0x2b91b0[_0x4871('0x5a')](_0x15c94d);}})['then'](function(_0x150ed1){if(_0x150ed1){_0x2a9d38=_0x150ed1[_0x4871('0x41')];if(!_0x5063d9[_0x4871('0x3b')]['hasOwnProperty']('nolimit')){_0x15c94d[_0x4871('0x43')]=qs[_0x4871('0x43')](_0x5063d9[_0x4871('0x3b')][_0x4871('0x43')]);_0x15c94d[_0x4871('0x2d')]=qs['offset'](_0x5063d9['query'][_0x4871('0x2d')]);}return _0x2b91b0[_0x4871('0x5a')](_0x15c94d);}})[_0x4871('0x1e')](function(_0x5a9cfb){if(_0x5a9cfb){return _0x5a9cfb?{'count':_0x2a9d38,'rows':_0x5a9cfb}:null;}})[_0x4871('0x1e')](respondWithResult(_0x1e0e51,null))[_0x4871('0x27')](handleError(_0x1e0e51,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 21afdfb..4e72581 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 _0xcf9a=['api','moment','bluebird','request-promise','rimraf','exports','define','util'];(function(_0xf75187,_0x398958){var _0x295303=function(_0x495970){while(--_0x495970){_0xf75187['push'](_0xf75187['shift']());}};_0x295303(++_0x398958);}(_0xcf9a,0x147));var _0xacf9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xcf9a[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0xacf9('0x0'));var logger=require('../../config/logger')(_0xacf9('0x1'));var moment=require(_0xacf9('0x2'));var BPromise=require(_0xacf9('0x3'));var rp=require(_0xacf9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xacf9('0x5'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module[_0xacf9('0x6')]=function(_0x17df40,_0x3a4147){return _0x17df40[_0xacf9('0x7')]('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9bf=['util','../../config/logger','moment','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x2c700d,_0x31741f){var _0x2e6508=function(_0x134ac9){while(--_0x134ac9){_0x2c700d['push'](_0x2c700d['shift']());}};_0x2e6508(++_0x31741f);}(_0xb9bf,0xaf));var _0xfb9b=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xb9bf[_0x3c8e9a];return _0x2d4c57;};'use strict';var _=require(_0xfb9b('0x0'));var util=require(_0xfb9b('0x1'));var logger=require(_0xfb9b('0x2'))('api');var moment=require(_0xfb9b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb9b('0x4'));var rimraf=require(_0xfb9b('0x5'));var config=require(_0xfb9b('0x6'));var attributes=require(_0xfb9b('0x7'));module['exports']=function(_0x33da88,_0x2ef841){return _0x33da88[_0xfb9b('0x8')](_0xfb9b('0x9'),attributes,{'tableName':_0xfb9b('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 b198093..3843c92 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 _0xcc98=['lodash','util','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','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0xcc98,0x180));var _0x8cc9=function(_0x32a1ee,_0x3373b9){_0x32a1ee=_0x32a1ee-0x0;var _0x2c8083=_0xcc98[_0x32a1ee];return _0x2c8083;};'use strict';var _=require(_0x8cc9('0x0'));var util=require(_0x8cc9('0x1'));var moment=require('moment');var BPromise=require(_0x8cc9('0x2'));var rs=require(_0x8cc9('0x3'));var fs=require('fs');var Redis=require(_0x8cc9('0x4'));var db=require(_0x8cc9('0x5'))['db'];var utils=require(_0x8cc9('0x6'));var logger=require(_0x8cc9('0x7'))(_0x8cc9('0x8'));var config=require(_0x8cc9('0x9'));var jayson=require(_0x8cc9('0xa'));var client=jayson[_0x8cc9('0xb')][_0x8cc9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d42c1,_0x44f1b5,_0x34e5a2){return new BPromise(function(_0x219eb0,_0x47ad21){return client[_0x8cc9('0xd')](_0x1d42c1,_0x34e5a2)[_0x8cc9('0xe')](function(_0x557c5d){logger[_0x8cc9('0xf')](_0x8cc9('0x10'),_0x44f1b5,_0x8cc9('0x11'));logger[_0x8cc9('0x12')](_0x8cc9('0x13'),_0x44f1b5,_0x8cc9('0x11'),JSON[_0x8cc9('0x14')](_0x557c5d));if(_0x557c5d[_0x8cc9('0x15')]){if(_0x557c5d[_0x8cc9('0x15')]['code']===0x1f4){logger[_0x8cc9('0x15')](_0x8cc9('0x10'),_0x44f1b5,_0x557c5d[_0x8cc9('0x15')][_0x8cc9('0x16')]);return _0x47ad21(_0x557c5d[_0x8cc9('0x15')]['message']);}logger[_0x8cc9('0x15')](_0x8cc9('0x10'),_0x44f1b5,_0x557c5d['error'][_0x8cc9('0x16')]);return _0x219eb0(_0x557c5d[_0x8cc9('0x15')]['message']);}else{logger[_0x8cc9('0xf')](_0x8cc9('0x10'),_0x44f1b5,_0x8cc9('0x11'));_0x219eb0(_0x557c5d[_0x8cc9('0x17')]['message']);}})['catch'](function(_0x4b7019){logger[_0x8cc9('0x15')]('ServicenowConfiguration,\x20%s,\x20%s',_0x44f1b5,_0x4b7019);_0x47ad21(_0x4b7019);});});} \ No newline at end of file +var _0xe667=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1e3d0f,_0x91f49){var _0x482801=function(_0x556d7b){while(--_0x556d7b){_0x1e3d0f['push'](_0x1e3d0f['shift']());}};_0x482801(++_0x91f49);}(_0xe667,0x79));var _0x7e66=function(_0x4ff3d1,_0x4cb2fa){_0x4ff3d1=_0x4ff3d1-0x0;var _0x375e59=_0xe667[_0x4ff3d1];return _0x375e59;};'use strict';var _=require(_0x7e66('0x0'));var util=require(_0x7e66('0x1'));var moment=require(_0x7e66('0x2'));var BPromise=require(_0x7e66('0x3'));var rs=require(_0x7e66('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e66('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e66('0x6'))('rpc');var config=require(_0x7e66('0x7'));var jayson=require(_0x7e66('0x8'));var client=jayson[_0x7e66('0x9')][_0x7e66('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2db444,_0x2a239d,_0x3741ae){return new BPromise(function(_0x4e7f32,_0x34e1d9){return client[_0x7e66('0xb')](_0x2db444,_0x3741ae)[_0x7e66('0xc')](function(_0x5207ee){logger[_0x7e66('0xd')](_0x7e66('0xe'),_0x2a239d,_0x7e66('0xf'));logger[_0x7e66('0x10')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x2a239d,'request\x20sent',JSON[_0x7e66('0x11')](_0x5207ee));if(_0x5207ee[_0x7e66('0x12')]){if(_0x5207ee['error'][_0x7e66('0x13')]===0x1f4){logger[_0x7e66('0x12')](_0x7e66('0xe'),_0x2a239d,_0x5207ee[_0x7e66('0x12')][_0x7e66('0x14')]);return _0x34e1d9(_0x5207ee[_0x7e66('0x12')][_0x7e66('0x14')]);}logger['error'](_0x7e66('0xe'),_0x2a239d,_0x5207ee['error']['message']);return _0x4e7f32(_0x5207ee[_0x7e66('0x12')]['message']);}else{logger['info'](_0x7e66('0xe'),_0x2a239d,_0x7e66('0xf'));_0x4e7f32(_0x5207ee[_0x7e66('0x15')][_0x7e66('0x14')]);}})[_0x7e66('0x16')](function(_0x551dea){logger[_0x7e66('0x12')](_0x7e66('0xe'),_0x2a239d,_0x551dea);_0x34e1d9(_0x551dea);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 735c7dd..0537fdd 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 _0x290f=['show','update','delete','destroy','exports','multer','util','path','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id'];(function(_0x33b75b,_0x326c1a){var _0x45f55e=function(_0x5dc497){while(--_0x5dc497){_0x33b75b['push'](_0x33b75b['shift']());}};_0x45f55e(++_0x326c1a);}(_0x290f,0xd7));var _0xf290=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x290f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf290('0x0'));var util=require(_0xf290('0x1'));var path=require(_0xf290('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xf290('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf290('0x4'));var controller=require(_0xf290('0x5'));router[_0xf290('0x6')]('/',auth[_0xf290('0x7')](),controller[_0xf290('0x8')]);router[_0xf290('0x6')](_0xf290('0x9'),auth['isAuthenticated'](),controller[_0xf290('0xa')]);router['post']('/',auth[_0xf290('0x7')](),controller['create']);router['put'](_0xf290('0x9'),auth[_0xf290('0x7')](),controller[_0xf290('0xb')]);router[_0xf290('0xc')](_0xf290('0x9'),auth['isAuthenticated'](),controller[_0xf290('0xd')]);module[_0xf290('0xe')]=router; \ No newline at end of file +var _0x0dd1=['/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index'];(function(_0x4660b9,_0x172664){var _0x3d0b6b=function(_0x3632e1){while(--_0x3632e1){_0x4660b9['push'](_0x4660b9['shift']());}};_0x3d0b6b(++_0x172664);}(_0x0dd1,0x14a));var _0x10dd=function(_0x133838,_0x5f19a7){_0x133838=_0x133838-0x0;var _0x3a5239=_0x0dd1[_0x133838];return _0x3a5239;};'use strict';var multer=require(_0x10dd('0x0'));var util=require(_0x10dd('0x1'));var path=require(_0x10dd('0x2'));var timeout=require(_0x10dd('0x3'));var express=require('express');var router=express[_0x10dd('0x4')]();var auth=require(_0x10dd('0x5'));var interaction=require(_0x10dd('0x6'));var config=require(_0x10dd('0x7'));var controller=require(_0x10dd('0x8'));router[_0x10dd('0x9')]('/',auth[_0x10dd('0xa')](),controller[_0x10dd('0xb')]);router[_0x10dd('0x9')](_0x10dd('0xc'),auth[_0x10dd('0xa')](),controller[_0x10dd('0xd')]);router['post']('/',auth[_0x10dd('0xa')](),controller[_0x10dd('0xe')]);router[_0x10dd('0xf')](_0x10dd('0xc'),auth['isAuthenticated'](),controller[_0x10dd('0x10')]);router[_0x10dd('0x11')](_0x10dd('0xc'),auth[_0x10dd('0xa')](),controller[_0x10dd('0x12')]);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 1735877..e4a082e 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 _0xa85e=['string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x246119,_0x30a4f3){var _0x59c74f=function(_0x313fb5){while(--_0x313fb5){_0x246119['push'](_0x246119['shift']());}};_0x59c74f(++_0x30a4f3);}(_0xa85e,0x141));var _0xea85=function(_0x430f44,_0x4ae21b){_0x430f44=_0x430f44-0x0;var _0x1f6b0f=_0xa85e[_0x430f44];return _0x1f6b0f;};'use strict';var Sequelize=require(_0xea85('0x0'));module[_0xea85('0x1')]={'type':{'type':Sequelize[_0xea85('0x2')](_0xea85('0x3'),_0xea85('0x4'),'customVariable',_0xea85('0x5')),'defaultValue':_0xea85('0x3')},'content':{'type':Sequelize[_0xea85('0x6')]},'key':{'type':Sequelize[_0xea85('0x6')]},'keyType':{'type':Sequelize[_0xea85('0x2')]('string',_0xea85('0x4'),_0xea85('0x7'))},'keyContent':{'type':Sequelize[_0xea85('0x6')]},'idField':{'type':Sequelize[_0xea85('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xea85('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xea85('0x6')]}}; \ No newline at end of file +var _0x183d=['variable','keyValue','STRING','ENUM','sequelize','string'];(function(_0xf4666e,_0x571140){var _0x1853f1=function(_0x5160a5){while(--_0x5160a5){_0xf4666e['push'](_0xf4666e['shift']());}};_0x1853f1(++_0x571140);}(_0x183d,0x11e));var _0xd183=function(_0xd5f327,_0x252dd4){_0xd5f327=_0xd5f327-0x0;var _0x10e633=_0x183d[_0xd5f327];return _0x10e633;};'use strict';var Sequelize=require(_0xd183('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xd183('0x1'),_0xd183('0x2'),'customVariable',_0xd183('0x3')),'defaultValue':_0xd183('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd183('0x4')]},'keyType':{'type':Sequelize[_0xd183('0x5')](_0xd183('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xd183('0x4')]},'idField':{'type':Sequelize[_0xd183('0x4')]},'nameField':{'type':Sequelize[_0xd183('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 5a82adf..f472075 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 _0xbad2=['show','rawAttributes','create','body','destroy','find','params','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','Content-Range','json','reject','save','then','end','sendStatus','error','stack','name','send','index','map','ServicenowField','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0xbad2,0x127));var _0x2bad=function(_0x55545c,_0x4af045){_0x55545c=_0x55545c-0x0;var _0x3c7229=_0xbad2[_0x55545c];return _0x3c7229;};'use strict';var pdf=require(_0x2bad('0x0'));var emlformat=require(_0x2bad('0x1'));var rimraf=require(_0x2bad('0x2'));var zipdir=require(_0x2bad('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2bad('0x4'));var BPromise=require(_0x2bad('0x5'));var Mustache=require(_0x2bad('0x6'));var util=require('util');var path=require(_0x2bad('0x7'));var sox=require(_0x2bad('0x8'));var csv=require('to-csv');var ejs=require(_0x2bad('0x9'));var fs=require('fs');var _=require(_0x2bad('0xa'));var squel=require(_0x2bad('0xb'));var crypto=require(_0x2bad('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2bad('0xd'));var toCsv=require(_0x2bad('0xe'));var querystring=require(_0x2bad('0xf'));var Papa=require('papaparse');var Redis=require(_0x2bad('0x10'));var authService=require(_0x2bad('0x11'));var qs=require(_0x2bad('0x12'));var as=require(_0x2bad('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2bad('0x14'))(_0x2bad('0x15'));var utils=require(_0x2bad('0x16'));var config=require(_0x2bad('0x17'));var db=require(_0x2bad('0x18'))['db'];function respondWithStatusCode(_0x203b23,_0x4eb592){_0x4eb592=_0x4eb592||0xcc;return function(_0x574f45){if(_0x574f45){return _0x203b23['sendStatus'](_0x4eb592);}return _0x203b23['status'](_0x4eb592)['end']();};}function respondWithResult(_0x58490a,_0x4e56de){_0x4e56de=_0x4e56de||0xc8;return function(_0x466863){if(_0x466863){return _0x58490a[_0x2bad('0x19')](_0x4e56de)['json'](_0x466863);}};}function respondWithFilteredResult(_0x4eed87,_0xeaaa3f){return function(_0x5798bf){if(_0x5798bf){var _0x49f465=_0x5798bf[_0x2bad('0x1a')],_0xba4117=_0xeaaa3f[_0x2bad('0x1b')],_0xbd38d2=_0xeaaa3f[_0x2bad('0x1b')]+_0xeaaa3f[_0x2bad('0x1c')],_0x2ffcbf;if(_0xbd38d2>=_0x49f465){_0xbd38d2=_0x49f465;_0x2ffcbf=0xc8;}else{_0x2ffcbf=0xce;}_0x4eed87['status'](_0x2ffcbf);return _0x4eed87['set'](_0x2bad('0x1d'),_0xba4117+'-'+_0xbd38d2+'/'+_0x49f465)[_0x2bad('0x1e')](_0x5798bf);}return null;};}function patchUpdates(_0x1227b6){return function(_0x28c171){try{jsonpatch['apply'](_0x28c171,_0x1227b6,!![]);}catch(_0x4a58c7){return BPromise[_0x2bad('0x1f')](_0x4a58c7);}return _0x28c171[_0x2bad('0x20')]();};}function saveUpdates(_0x94b0b2,_0x32a3a1){return function(_0x18f92e){if(_0x18f92e){return _0x18f92e['update'](_0x94b0b2)[_0x2bad('0x21')](function(_0x5899ec){return _0x5899ec;});}return null;};}function removeEntity(_0x162329,_0x5f5496){return function(_0x1e4fe3){if(_0x1e4fe3){return _0x1e4fe3['destroy']()[_0x2bad('0x21')](function(){_0x162329[_0x2bad('0x19')](0xcc)[_0x2bad('0x22')]();});}};}function handleEntityNotFound(_0x1881df,_0x30e92a){return function(_0x53aff1){if(!_0x53aff1){_0x1881df[_0x2bad('0x23')](0x194);}return _0x53aff1;};}function handleError(_0x463947,_0x22e33c){_0x22e33c=_0x22e33c||0x1f4;return function(_0x38bc0a){logger[_0x2bad('0x24')](_0x38bc0a[_0x2bad('0x25')]);if(_0x38bc0a[_0x2bad('0x26')]){delete _0x38bc0a['name'];}_0x463947[_0x2bad('0x19')](_0x22e33c)[_0x2bad('0x27')](_0x38bc0a);};}exports[_0x2bad('0x28')]=function(_0x3387b0,_0x52b709){var _0x3e66dc={},_0x1244b5={},_0x44fe10={'count':0x0,'rows':[]};var _0x48bcdc=_[_0x2bad('0x29')](db[_0x2bad('0x2a')]['rawAttributes'],function(_0x2cb5ed){return{'name':_0x2cb5ed[_0x2bad('0x2b')],'type':_0x2cb5ed[_0x2bad('0x2c')][_0x2bad('0x2d')]};});_0x1244b5[_0x2bad('0x2e')]=_['map'](_0x48bcdc,'name');_0x1244b5[_0x2bad('0x2f')]=_[_0x2bad('0x30')](_0x3387b0[_0x2bad('0x2f')]);_0x1244b5['filters']=_[_0x2bad('0x31')](_0x1244b5[_0x2bad('0x2e')],_0x1244b5['query']);_0x3e66dc[_0x2bad('0x32')]=_['intersection'](_0x1244b5['model'],qs[_0x2bad('0x33')](_0x3387b0[_0x2bad('0x2f')][_0x2bad('0x33')]));_0x3e66dc[_0x2bad('0x32')]=_0x3e66dc[_0x2bad('0x32')]['length']?_0x3e66dc[_0x2bad('0x32')]:_0x1244b5[_0x2bad('0x2e')];if(!_0x3387b0['query'][_0x2bad('0x34')](_0x2bad('0x35'))){_0x3e66dc[_0x2bad('0x1c')]=qs[_0x2bad('0x1c')](_0x3387b0['query'][_0x2bad('0x1c')]);_0x3e66dc[_0x2bad('0x1b')]=qs['offset'](_0x3387b0[_0x2bad('0x2f')][_0x2bad('0x1b')]);}_0x3e66dc['order']=qs[_0x2bad('0x36')](_0x3387b0['query'][_0x2bad('0x36')]);_0x3e66dc[_0x2bad('0x37')]=qs['filters'](_['pick'](_0x3387b0['query'],_0x1244b5[_0x2bad('0x38')]));if(_0x3387b0[_0x2bad('0x2f')][_0x2bad('0x39')]){_0x3e66dc['where']=_[_0x2bad('0x3a')](_0x3e66dc[_0x2bad('0x37')],{'$or':_['map'](_0x48bcdc,function(_0x51778c){if(_0x51778c['type']!=='VIRTUAL'){var _0x43bc52={};_0x43bc52[_0x51778c[_0x2bad('0x26')]]={'$like':'%'+_0x3387b0[_0x2bad('0x2f')][_0x2bad('0x39')]+'%'};return _0x43bc52;}})});}_0x3e66dc=_['merge']({},_0x3e66dc,_0x3387b0[_0x2bad('0x3b')]);var _0x34cbc6={'where':_0x3e66dc[_0x2bad('0x37')]};return db['ServicenowField'][_0x2bad('0x1a')](_0x34cbc6)[_0x2bad('0x21')](function(_0x5ab234){_0x44fe10['count']=_0x5ab234;if(_0x3387b0[_0x2bad('0x2f')][_0x2bad('0x3c')]){_0x3e66dc[_0x2bad('0x3d')]=[{'all':!![]}];}return db[_0x2bad('0x2a')][_0x2bad('0x3e')](_0x3e66dc);})[_0x2bad('0x21')](function(_0x57da1a){_0x44fe10[_0x2bad('0x3f')]=_0x57da1a;return _0x44fe10;})['then'](respondWithFilteredResult(_0x52b709,_0x3e66dc))[_0x2bad('0x40')](handleError(_0x52b709,null));};exports[_0x2bad('0x41')]=function(_0x4af284,_0x581baa){var _0x360647={'raw':!![],'where':{'id':_0x4af284['params']['id']}},_0x4229c7={};_0x4229c7[_0x2bad('0x2e')]=_[_0x2bad('0x30')](db[_0x2bad('0x2a')][_0x2bad('0x42')]);_0x4229c7[_0x2bad('0x2f')]=_[_0x2bad('0x30')](_0x4af284[_0x2bad('0x2f')]);_0x4229c7[_0x2bad('0x38')]=_[_0x2bad('0x31')](_0x4229c7['model'],_0x4229c7[_0x2bad('0x2f')]);_0x360647['attributes']=_[_0x2bad('0x31')](_0x4229c7[_0x2bad('0x2e')],qs[_0x2bad('0x33')](_0x4af284[_0x2bad('0x2f')][_0x2bad('0x33')]));_0x360647['attributes']=_0x360647[_0x2bad('0x32')]['length']?_0x360647[_0x2bad('0x32')]:_0x4229c7[_0x2bad('0x2e')];if(_0x4af284[_0x2bad('0x2f')][_0x2bad('0x3c')]){_0x360647[_0x2bad('0x3d')]=[{'all':!![]}];}_0x360647=_['merge']({},_0x360647,_0x4af284['options']);return db[_0x2bad('0x2a')]['find'](_0x360647)['then'](handleEntityNotFound(_0x581baa,null))['then'](respondWithResult(_0x581baa,null))[_0x2bad('0x40')](handleError(_0x581baa,null));};exports[_0x2bad('0x43')]=function(_0x14cf2e,_0x282ef6){return db[_0x2bad('0x2a')][_0x2bad('0x43')](_0x14cf2e[_0x2bad('0x44')],{})[_0x2bad('0x21')](respondWithResult(_0x282ef6,0xc9))[_0x2bad('0x40')](handleError(_0x282ef6,null));};exports['update']=function(_0x25f42a,_0x265996){if(_0x25f42a[_0x2bad('0x44')]['id']){delete _0x25f42a['body']['id'];}return db['ServicenowField']['find']({'where':{'id':_0x25f42a['params']['id']}})[_0x2bad('0x21')](handleEntityNotFound(_0x265996,null))[_0x2bad('0x21')](saveUpdates(_0x25f42a['body'],null))[_0x2bad('0x21')](respondWithResult(_0x265996,null))[_0x2bad('0x40')](handleError(_0x265996,null));};exports[_0x2bad('0x45')]=function(_0x28c529,_0x22ed45){return db['ServicenowField'][_0x2bad('0x46')]({'where':{'id':_0x28c529[_0x2bad('0x47')]['id']}})[_0x2bad('0x21')](handleEntityNotFound(_0x22ed45,null))[_0x2bad('0x21')](removeEntity(_0x22ed45,null))[_0x2bad('0x40')](handleError(_0x22ed45,null));}; \ No newline at end of file +var _0xb486=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','then','destroy','name','send','index','ServicenowField','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','type','VIRTUAL','options','count','includeAll','findAll','rows','catch','params','include','find','create','body','update','html-pdf','eml-format'];(function(_0x241802,_0x45131b){var _0x1422ba=function(_0x35d657){while(--_0x35d657){_0x241802['push'](_0x241802['shift']());}};_0x1422ba(++_0x45131b);}(_0xb486,0x92));var _0x6b48=function(_0x3c768e,_0x82e542){_0x3c768e=_0x3c768e-0x0;var _0x72c80d=_0xb486[_0x3c768e];return _0x72c80d;};'use strict';var pdf=require(_0x6b48('0x0'));var emlformat=require(_0x6b48('0x1'));var rimraf=require(_0x6b48('0x2'));var zipdir=require(_0x6b48('0x3'));var jsonpatch=require(_0x6b48('0x4'));var rp=require(_0x6b48('0x5'));var moment=require(_0x6b48('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x6b48('0x7'));var util=require(_0x6b48('0x8'));var path=require('path');var sox=require(_0x6b48('0x9'));var csv=require('to-csv');var ejs=require(_0x6b48('0xa'));var fs=require('fs');var _=require(_0x6b48('0xb'));var squel=require(_0x6b48('0xc'));var crypto=require(_0x6b48('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6b48('0xe'));var toCsv=require(_0x6b48('0xf'));var querystring=require(_0x6b48('0x10'));var Papa=require(_0x6b48('0x11'));var Redis=require(_0x6b48('0x12'));var authService=require(_0x6b48('0x13'));var qs=require(_0x6b48('0x14'));var as=require(_0x6b48('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b48('0x16'))(_0x6b48('0x17'));var utils=require(_0x6b48('0x18'));var config=require(_0x6b48('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2df21d,_0x2c664c){_0x2c664c=_0x2c664c||0xcc;return function(_0x469820){if(_0x469820){return _0x2df21d[_0x6b48('0x1a')](_0x2c664c);}return _0x2df21d[_0x6b48('0x1b')](_0x2c664c)[_0x6b48('0x1c')]();};}function respondWithResult(_0x5c76f4,_0x2c4879){_0x2c4879=_0x2c4879||0xc8;return function(_0x30a813){if(_0x30a813){return _0x5c76f4[_0x6b48('0x1b')](_0x2c4879)[_0x6b48('0x1d')](_0x30a813);}};}function respondWithFilteredResult(_0x45d5ea,_0x218e2c){return function(_0x3bd59e){if(_0x3bd59e){var _0x80f53=_0x3bd59e['count'],_0xd48f5f=_0x218e2c[_0x6b48('0x1e')],_0x4eea3a=_0x218e2c[_0x6b48('0x1e')]+_0x218e2c[_0x6b48('0x1f')],_0x206664;if(_0x4eea3a>=_0x80f53){_0x4eea3a=_0x80f53;_0x206664=0xc8;}else{_0x206664=0xce;}_0x45d5ea['status'](_0x206664);return _0x45d5ea['set'](_0x6b48('0x20'),_0xd48f5f+'-'+_0x4eea3a+'/'+_0x80f53)[_0x6b48('0x1d')](_0x3bd59e);}return null;};}function patchUpdates(_0xd27c5d){return function(_0x37c885){try{jsonpatch[_0x6b48('0x21')](_0x37c885,_0xd27c5d,!![]);}catch(_0x3f10b7){return BPromise[_0x6b48('0x22')](_0x3f10b7);}return _0x37c885[_0x6b48('0x23')]();};}function saveUpdates(_0x355784,_0x3f7b67){return function(_0x25c6d5){if(_0x25c6d5){return _0x25c6d5['update'](_0x355784)[_0x6b48('0x24')](function(_0x445148){return _0x445148;});}return null;};}function removeEntity(_0x3458ed,_0x15fe6){return function(_0x25d661){if(_0x25d661){return _0x25d661[_0x6b48('0x25')]()['then'](function(){_0x3458ed[_0x6b48('0x1b')](0xcc)[_0x6b48('0x1c')]();});}};}function handleEntityNotFound(_0x23d836,_0x11e78e){return function(_0x5d29a7){if(!_0x5d29a7){_0x23d836[_0x6b48('0x1a')](0x194);}return _0x5d29a7;};}function handleError(_0x32894c,_0x5b85a2){_0x5b85a2=_0x5b85a2||0x1f4;return function(_0x140095){logger['error'](_0x140095['stack']);if(_0x140095[_0x6b48('0x26')]){delete _0x140095[_0x6b48('0x26')];}_0x32894c[_0x6b48('0x1b')](_0x5b85a2)[_0x6b48('0x27')](_0x140095);};}exports[_0x6b48('0x28')]=function(_0xc57083,_0x3327de){var _0x568192={},_0x542363={},_0x383d0d={'count':0x0,'rows':[]};var _0x28219d=_['map'](db[_0x6b48('0x29')][_0x6b48('0x2a')],function(_0x932dd){return{'name':_0x932dd['fieldName'],'type':_0x932dd['type']['key']};});_0x542363[_0x6b48('0x2b')]=_['map'](_0x28219d,'name');_0x542363[_0x6b48('0x2c')]=_[_0x6b48('0x2d')](_0xc57083[_0x6b48('0x2c')]);_0x542363['filters']=_[_0x6b48('0x2e')](_0x542363['model'],_0x542363['query']);_0x568192[_0x6b48('0x2f')]=_[_0x6b48('0x2e')](_0x542363['model'],qs['fields'](_0xc57083['query'][_0x6b48('0x30')]));_0x568192[_0x6b48('0x2f')]=_0x568192['attributes'][_0x6b48('0x31')]?_0x568192[_0x6b48('0x2f')]:_0x542363['model'];if(!_0xc57083[_0x6b48('0x2c')][_0x6b48('0x32')](_0x6b48('0x33'))){_0x568192[_0x6b48('0x1f')]=qs[_0x6b48('0x1f')](_0xc57083[_0x6b48('0x2c')][_0x6b48('0x1f')]);_0x568192['offset']=qs[_0x6b48('0x1e')](_0xc57083[_0x6b48('0x2c')]['offset']);}_0x568192[_0x6b48('0x34')]=qs[_0x6b48('0x35')](_0xc57083[_0x6b48('0x2c')][_0x6b48('0x35')]);_0x568192[_0x6b48('0x36')]=qs['filters'](_[_0x6b48('0x37')](_0xc57083[_0x6b48('0x2c')],_0x542363[_0x6b48('0x38')]));if(_0xc57083[_0x6b48('0x2c')][_0x6b48('0x39')]){_0x568192['where']=_[_0x6b48('0x3a')](_0x568192[_0x6b48('0x36')],{'$or':_[_0x6b48('0x3b')](_0x28219d,function(_0x3d5246){if(_0x3d5246[_0x6b48('0x3c')]!==_0x6b48('0x3d')){var _0x42edbf={};_0x42edbf[_0x3d5246[_0x6b48('0x26')]]={'$like':'%'+_0xc57083[_0x6b48('0x2c')]['filter']+'%'};return _0x42edbf;}})});}_0x568192=_[_0x6b48('0x3a')]({},_0x568192,_0xc57083[_0x6b48('0x3e')]);var _0x442239={'where':_0x568192['where']};return db['ServicenowField']['count'](_0x442239)[_0x6b48('0x24')](function(_0x4fc086){_0x383d0d[_0x6b48('0x3f')]=_0x4fc086;if(_0xc57083['query'][_0x6b48('0x40')]){_0x568192['include']=[{'all':!![]}];}return db['ServicenowField'][_0x6b48('0x41')](_0x568192);})[_0x6b48('0x24')](function(_0x461417){_0x383d0d[_0x6b48('0x42')]=_0x461417;return _0x383d0d;})[_0x6b48('0x24')](respondWithFilteredResult(_0x3327de,_0x568192))[_0x6b48('0x43')](handleError(_0x3327de,null));};exports['show']=function(_0x510991,_0x3b47b9){var _0x1934cb={'raw':!![],'where':{'id':_0x510991[_0x6b48('0x44')]['id']}},_0x2c8e01={};_0x2c8e01[_0x6b48('0x2b')]=_[_0x6b48('0x2d')](db[_0x6b48('0x29')][_0x6b48('0x2a')]);_0x2c8e01[_0x6b48('0x2c')]=_[_0x6b48('0x2d')](_0x510991['query']);_0x2c8e01[_0x6b48('0x38')]=_[_0x6b48('0x2e')](_0x2c8e01[_0x6b48('0x2b')],_0x2c8e01['query']);_0x1934cb['attributes']=_['intersection'](_0x2c8e01[_0x6b48('0x2b')],qs['fields'](_0x510991[_0x6b48('0x2c')]['fields']));_0x1934cb[_0x6b48('0x2f')]=_0x1934cb[_0x6b48('0x2f')][_0x6b48('0x31')]?_0x1934cb[_0x6b48('0x2f')]:_0x2c8e01[_0x6b48('0x2b')];if(_0x510991[_0x6b48('0x2c')]['includeAll']){_0x1934cb[_0x6b48('0x45')]=[{'all':!![]}];}_0x1934cb=_['merge']({},_0x1934cb,_0x510991[_0x6b48('0x3e')]);return db[_0x6b48('0x29')][_0x6b48('0x46')](_0x1934cb)['then'](handleEntityNotFound(_0x3b47b9,null))[_0x6b48('0x24')](respondWithResult(_0x3b47b9,null))[_0x6b48('0x43')](handleError(_0x3b47b9,null));};exports['create']=function(_0x4c4200,_0x1bde2a){return db[_0x6b48('0x29')][_0x6b48('0x47')](_0x4c4200[_0x6b48('0x48')],{})['then'](respondWithResult(_0x1bde2a,0xc9))[_0x6b48('0x43')](handleError(_0x1bde2a,null));};exports[_0x6b48('0x49')]=function(_0x224e56,_0x22b3ce){if(_0x224e56[_0x6b48('0x48')]['id']){delete _0x224e56[_0x6b48('0x48')]['id'];}return db['ServicenowField'][_0x6b48('0x46')]({'where':{'id':_0x224e56[_0x6b48('0x44')]['id']}})[_0x6b48('0x24')](handleEntityNotFound(_0x22b3ce,null))[_0x6b48('0x24')](saveUpdates(_0x224e56[_0x6b48('0x48')],null))[_0x6b48('0x24')](respondWithResult(_0x22b3ce,null))['catch'](handleError(_0x22b3ce,null));};exports[_0x6b48('0x25')]=function(_0x15261f,_0x523d95){return db[_0x6b48('0x29')][_0x6b48('0x46')]({'where':{'id':_0x15261f[_0x6b48('0x44')]['id']}})['then'](handleEntityNotFound(_0x523d95,null))[_0x6b48('0x24')](removeEntity(_0x523d95,null))['catch'](handleError(_0x523d95,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 5cafbc6..5261464 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 _0xe97d=['FieldId','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField'];(function(_0x4af72f,_0xd67b2e){var _0x5a25e4=function(_0x3f7724){while(--_0x3f7724){_0x4af72f['push'](_0x4af72f['shift']());}};_0x5a25e4(++_0xd67b2e);}(_0xe97d,0x1e1));var _0xde97=function(_0x196a3b,_0x5f13ce){_0x196a3b=_0x196a3b-0x0;var _0x1f3d3c=_0xe97d[_0x196a3b];return _0x1f3d3c;};'use strict';var _=require('lodash');var util=require(_0xde97('0x0'));var logger=require(_0xde97('0x1'))(_0xde97('0x2'));var moment=require(_0xde97('0x3'));var BPromise=require(_0xde97('0x4'));var rp=require(_0xde97('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde97('0x6'));var config=require(_0xde97('0x7'));var attributes=require(_0xde97('0x8'));module[_0xde97('0x9')]=function(_0x1de0bb,_0x2e57a1){return _0x1de0bb['define'](_0xde97('0xa'),attributes,{'tableName':_0xde97('0xb'),'paranoid':![],'indexes':[{'name':_0xde97('0xc'),'fields':[_0xde97('0xd'),_0xde97('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x402d=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash'];(function(_0x363b64,_0x165144){var _0xfc8e02=function(_0x5223f7){while(--_0x5223f7){_0x363b64['push'](_0x363b64['shift']());}};_0xfc8e02(++_0x165144);}(_0x402d,0x175));var _0xd402=function(_0x729039,_0x5929f3){_0x729039=_0x729039-0x0;var _0x4697c3=_0x402d[_0x729039];return _0x4697c3;};'use strict';var _=require(_0xd402('0x0'));var util=require(_0xd402('0x1'));var logger=require(_0xd402('0x2'))(_0xd402('0x3'));var moment=require(_0xd402('0x4'));var BPromise=require('bluebird');var rp=require(_0xd402('0x5'));var fs=require('fs');var path=require(_0xd402('0x6'));var rimraf=require(_0xd402('0x7'));var config=require(_0xd402('0x8'));var attributes=require(_0xd402('0x9'));module[_0xd402('0xa')]=function(_0x35e014,_0x1adb83){return _0x35e014[_0xd402('0xb')](_0xd402('0xc'),attributes,{'tableName':_0xd402('0xd'),'paranoid':![],'indexes':[{'name':_0xd402('0xe'),'fields':[_0xd402('0xf'),_0xd402('0x10')],'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 6b63b63..618f548 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 _0xa745=['then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xda06bb,_0x597838){var _0x15c229=function(_0x585b15){while(--_0x585b15){_0xda06bb['push'](_0xda06bb['shift']());}};_0x15c229(++_0x597838);}(_0xa745,0x6f));var _0x5a74=function(_0x17d455,_0x161e69){_0x17d455=_0x17d455-0x0;var _0x35ebf6=_0xa745[_0x17d455];return _0x35ebf6;};'use strict';var _=require(_0x5a74('0x0'));var util=require('util');var moment=require(_0x5a74('0x1'));var BPromise=require(_0x5a74('0x2'));var rs=require(_0x5a74('0x3'));var fs=require('fs');var Redis=require(_0x5a74('0x4'));var db=require(_0x5a74('0x5'))['db'];var utils=require(_0x5a74('0x6'));var logger=require(_0x5a74('0x7'))(_0x5a74('0x8'));var config=require(_0x5a74('0x9'));var jayson=require(_0x5a74('0xa'));var client=jayson[_0x5a74('0xb')][_0x5a74('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x302b56,_0x2b4a6c,_0x43db28){return new BPromise(function(_0x4934d8,_0x578f69){return client[_0x5a74('0xd')](_0x302b56,_0x43db28)[_0x5a74('0xe')](function(_0x3e57f0){logger[_0x5a74('0xf')]('ServicenowField,\x20%s,\x20%s',_0x2b4a6c,'request\x20sent');logger[_0x5a74('0x10')](_0x5a74('0x11'),_0x2b4a6c,_0x5a74('0x12'),JSON['stringify'](_0x3e57f0));if(_0x3e57f0[_0x5a74('0x13')]){if(_0x3e57f0[_0x5a74('0x13')][_0x5a74('0x14')]===0x1f4){logger[_0x5a74('0x13')](_0x5a74('0x15'),_0x2b4a6c,_0x3e57f0[_0x5a74('0x13')][_0x5a74('0x16')]);return _0x578f69(_0x3e57f0['error'][_0x5a74('0x16')]);}logger['error'](_0x5a74('0x15'),_0x2b4a6c,_0x3e57f0['error']['message']);return _0x4934d8(_0x3e57f0[_0x5a74('0x13')]['message']);}else{logger['info'](_0x5a74('0x15'),_0x2b4a6c,'request\x20sent');_0x4934d8(_0x3e57f0[_0x5a74('0x17')][_0x5a74('0x16')]);}})[_0x5a74('0x18')](function(_0x1b8169){logger[_0x5a74('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2b4a6c,_0x1b8169);_0x578f69(_0x1b8169);});});} \ No newline at end of file +var _0xe8c1=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x463b24,_0x196512){var _0x3c8cd8=function(_0x3878fe){while(--_0x3878fe){_0x463b24['push'](_0x463b24['shift']());}};_0x3c8cd8(++_0x196512);}(_0xe8c1,0x1de));var _0x1e8c=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xe8c1[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x1e8c('0x0'));var util=require(_0x1e8c('0x1'));var moment=require(_0x1e8c('0x2'));var BPromise=require(_0x1e8c('0x3'));var rs=require(_0x1e8c('0x4'));var fs=require('fs');var Redis=require(_0x1e8c('0x5'));var db=require(_0x1e8c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e8c('0x7'))(_0x1e8c('0x8'));var config=require(_0x1e8c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1e8c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3505db,_0x43b169,_0x16c106){return new BPromise(function(_0x441e9,_0xa97164){return client[_0x1e8c('0xb')](_0x3505db,_0x16c106)[_0x1e8c('0xc')](function(_0x21eb8a){logger[_0x1e8c('0xd')](_0x1e8c('0xe'),_0x43b169,_0x1e8c('0xf'));logger[_0x1e8c('0x10')](_0x1e8c('0x11'),_0x43b169,_0x1e8c('0xf'),JSON[_0x1e8c('0x12')](_0x21eb8a));if(_0x21eb8a[_0x1e8c('0x13')]){if(_0x21eb8a[_0x1e8c('0x13')]['code']===0x1f4){logger[_0x1e8c('0x13')](_0x1e8c('0xe'),_0x43b169,_0x21eb8a[_0x1e8c('0x13')][_0x1e8c('0x14')]);return _0xa97164(_0x21eb8a['error'][_0x1e8c('0x14')]);}logger['error'](_0x1e8c('0xe'),_0x43b169,_0x21eb8a[_0x1e8c('0x13')][_0x1e8c('0x14')]);return _0x441e9(_0x21eb8a[_0x1e8c('0x13')]['message']);}else{logger[_0x1e8c('0xd')](_0x1e8c('0xe'),_0x43b169,_0x1e8c('0xf'));_0x441e9(_0x21eb8a[_0x1e8c('0x15')]['message']);}})['catch'](function(_0x406fdb){logger[_0x1e8c('0x13')](_0x1e8c('0xe'),_0x43b169,_0x406fdb);_0xa97164(_0x406fdb);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 1201700..66a3e55 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 _0xebab=['./intSugarcrmAccount.controller','index','/:id','isAuthenticated','show','/:id/configurations','get','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x40c916,_0x59aa12){var _0x5b9f16=function(_0x2d3914){while(--_0x2d3914){_0x40c916['push'](_0x40c916['shift']());}};_0x5b9f16(++_0x59aa12);}(_0xebab,0x74));var _0xbeba=function(_0x2b2759,_0x1c7bfd){_0x2b2759=_0x2b2759-0x0;var _0x503d06=_0xebab[_0x2b2759];return _0x503d06;};'use strict';var multer=require(_0xbeba('0x0'));var util=require(_0xbeba('0x1'));var path=require(_0xbeba('0x2'));var timeout=require(_0xbeba('0x3'));var express=require(_0xbeba('0x4'));var router=express[_0xbeba('0x5')]();var auth=require(_0xbeba('0x6'));var interaction=require(_0xbeba('0x7'));var config=require(_0xbeba('0x8'));var controller=require(_0xbeba('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xbeba('0xa')]);router['get'](_0xbeba('0xb'),auth[_0xbeba('0xc')](),controller[_0xbeba('0xd')]);router['get'](_0xbeba('0xe'),auth[_0xbeba('0xc')](),controller['getConfigurations']);router[_0xbeba('0xf')](_0xbeba('0x10'),auth[_0xbeba('0xc')](),controller[_0xbeba('0x11')]);router[_0xbeba('0x12')]('/',auth['isAuthenticated'](),controller[_0xbeba('0x13')]);router[_0xbeba('0x12')](_0xbeba('0xe'),auth['isAuthenticated'](),controller[_0xbeba('0x14')]);router['put'](_0xbeba('0xb'),auth[_0xbeba('0xc')](),controller[_0xbeba('0x15')]);router[_0xbeba('0x16')](_0xbeba('0xb'),auth['isAuthenticated'](),controller[_0xbeba('0x17')]);module[_0xbeba('0x18')]=router; \ No newline at end of file +var _0xed86=['Router','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','isAuthenticated','index','/:id','show','get','/:id/fields','post','addConfiguration','update','delete','util','path','connect-timeout','express'];(function(_0x362f29,_0x410084){var _0xbbe16c=function(_0xfd30f9){while(--_0xfd30f9){_0x362f29['push'](_0x362f29['shift']());}};_0xbbe16c(++_0x410084);}(_0xed86,0xb0));var _0x6ed8=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xed86[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require('multer');var util=require(_0x6ed8('0x0'));var path=require(_0x6ed8('0x1'));var timeout=require(_0x6ed8('0x2'));var express=require(_0x6ed8('0x3'));var router=express[_0x6ed8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6ed8('0x5'));var config=require(_0x6ed8('0x6'));var controller=require(_0x6ed8('0x7'));router['get']('/',auth[_0x6ed8('0x8')](),controller[_0x6ed8('0x9')]);router['get'](_0x6ed8('0xa'),auth[_0x6ed8('0x8')](),controller[_0x6ed8('0xb')]);router[_0x6ed8('0xc')]('/:id/configurations',auth[_0x6ed8('0x8')](),controller['getConfigurations']);router['get'](_0x6ed8('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0x6ed8('0xe')]('/',auth[_0x6ed8('0x8')](),controller['create']);router[_0x6ed8('0xe')]('/:id/configurations',auth[_0x6ed8('0x8')](),controller[_0x6ed8('0xf')]);router['put'](_0x6ed8('0xa'),auth[_0x6ed8('0x8')](),controller[_0x6ed8('0x10')]);router[_0x6ed8('0x11')]('/:id',auth[_0x6ed8('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 1549d5f..f935d18 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 _0xdfe8=['sequelize','exports','STRING','username','remoteUri'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xdfe8,0x12c));var _0x8dfe=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0xdfe8[_0x1a0ef3];return _0x2b86da;};'use strict';var Sequelize=require(_0x8dfe('0x0'));module[_0x8dfe('0x1')]={'name':{'type':Sequelize[_0x8dfe('0x2')]},'description':{'type':Sequelize[_0x8dfe('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x8dfe('0x3')},'password':{'type':Sequelize[_0x8dfe('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8dfe('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x91cb=['sequelize','exports','STRING','remoteUri'];(function(_0x3ccd11,_0x41aeaf){var _0x139e5e=function(_0x4cf3a7){while(--_0x4cf3a7){_0x3ccd11['push'](_0x3ccd11['shift']());}};_0x139e5e(++_0x41aeaf);}(_0x91cb,0xbc));var _0xb91c=function(_0x2ea857,_0x466b31){_0x2ea857=_0x2ea857-0x0;var _0x20429a=_0x91cb[_0x2ea857];return _0x20429a;};'use strict';var Sequelize=require(_0xb91c('0x0'));module[_0xb91c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb91c('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xb91c('0x2')]},'remoteUri':{'type':Sequelize[_0xb91c('0x2')],'unique':_0xb91c('0x3')},'serverUrl':{'type':Sequelize[_0xb91c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 8edb6fd..433b448 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 _0xe83d=['../../mysqldb','client','http','test','Sequelize','request','then','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmAccount,\x20%s,\x20%s','info','result','sendStatus','status','count','Content-Range','json','apply','reject','update','end','name','index','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filters','pick','filter','map','merge','options','includeAll','include','findAll','catch','params','find','create','body','destroy','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','direction','password','remoteUri','slice','POST','/service/v4_1/rest.php','login','JSON','username','PLAIN','Invalid\x20Login','Password\x20Expired','format','get_module_fields','Calls','values','remove','includes','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','send','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xe83d,0x164));var _0xde83=function(_0x40d3cc,_0x20a8a2){_0x40d3cc=_0x40d3cc-0x0;var _0x3759b3=_0xe83d[_0x40d3cc];return _0x3759b3;};'use strict';var pdf=require(_0xde83('0x0'));var emlformat=require(_0xde83('0x1'));var rimraf=require(_0xde83('0x2'));var zipdir=require(_0xde83('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde83('0x4'));var moment=require('moment');var BPromise=require(_0xde83('0x5'));var Mustache=require(_0xde83('0x6'));var util=require(_0xde83('0x7'));var path=require('path');var sox=require(_0xde83('0x8'));var csv=require(_0xde83('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xde83('0xa'));var squel=require(_0xde83('0xb'));var crypto=require(_0xde83('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xde83('0x9'));var querystring=require(_0xde83('0xd'));var Papa=require(_0xde83('0xe'));var Redis=require(_0xde83('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xde83('0x10'));var as=require(_0xde83('0x11'));var hardwareService=require(_0xde83('0x12'));var logger=require(_0xde83('0x13'))(_0xde83('0x14'));var utils=require('../../config/utils');var config=require(_0xde83('0x15'));var db=require(_0xde83('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0xde83('0x17')][_0xde83('0x18')]({'port':0x232a});function checkPasswordPattern(_0x3d55f0,_0x582e13,_0xdb8347){if(_0xdb8347){var _0x2b6425=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b6425[_0xde83('0x19')](_0x582e13)){return _0x3d55f0;}else{throw new db[(_0xde83('0x1a'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3d55f0;}}function respondWithRpcPromise(_0x3c23d3,_0xfe99ef,_0xfdb36b,_0x355966){return new BPromise(function(_0x4c3a48,_0x2083f9){var _0xee9ee8=_0x355966||client;return _0xee9ee8[_0xde83('0x1b')](_0x3c23d3,_0xfdb36b)[_0xde83('0x1c')](function(_0x26e1f0){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0xfe99ef,_0xde83('0x1d'));logger[_0xde83('0x1e')](_0xde83('0x1f'),_0xfe99ef,_0xde83('0x1d'),JSON[_0xde83('0x20')](_0x26e1f0));if(_0x26e1f0[_0xde83('0x21')]){if(_0x26e1f0[_0xde83('0x21')][_0xde83('0x22')]===0x1f4){logger[_0xde83('0x21')]('SugarcrmAccount,\x20%s,\x20%s',_0xfe99ef,_0x26e1f0[_0xde83('0x21')][_0xde83('0x23')]);return _0x2083f9(_0x26e1f0['error']['message']);}logger[_0xde83('0x21')](_0xde83('0x24'),_0xfe99ef,_0x26e1f0['error'][_0xde83('0x23')]);return _0x4c3a48(_0x26e1f0[_0xde83('0x21')]['message']);}else{logger[_0xde83('0x25')](_0xde83('0x24'),_0xfe99ef,_0xde83('0x1d'));_0x4c3a48(_0x26e1f0[_0xde83('0x26')][_0xde83('0x23')]);}})['catch'](function(_0x4ec30e){logger['error'](_0xde83('0x24'),_0xfe99ef,_0x4ec30e);_0x2083f9(_0x4ec30e);});});}function respondWithStatusCode(_0x58be39,_0x45bbb6){_0x45bbb6=_0x45bbb6||0xcc;return function(_0x471543){if(_0x471543){return _0x58be39[_0xde83('0x27')](_0x45bbb6);}return _0x58be39[_0xde83('0x28')](_0x45bbb6)['end']();};}function respondWithResult(_0x328e25,_0x1f74c5){_0x1f74c5=_0x1f74c5||0xc8;return function(_0x498422){if(_0x498422){return _0x328e25[_0xde83('0x28')](_0x1f74c5)['json'](_0x498422);}};}function respondWithFilteredResult(_0x4117c8,_0x440952){return function(_0x4f14c1){if(_0x4f14c1){var _0x4f7df7=_0x4f14c1[_0xde83('0x29')],_0x4cc71a=_0x440952['offset'],_0x550a16=_0x440952['offset']+_0x440952['limit'],_0x5185c2;if(_0x550a16>=_0x4f7df7){_0x550a16=_0x4f7df7;_0x5185c2=0xc8;}else{_0x5185c2=0xce;}_0x4117c8[_0xde83('0x28')](_0x5185c2);return _0x4117c8['set'](_0xde83('0x2a'),_0x4cc71a+'-'+_0x550a16+'/'+_0x4f7df7)[_0xde83('0x2b')](_0x4f14c1);}return null;};}function patchUpdates(_0x49013c){return function(_0x218258){try{jsonpatch[_0xde83('0x2c')](_0x218258,_0x49013c,!![]);}catch(_0x1206e2){return BPromise[_0xde83('0x2d')](_0x1206e2);}return _0x218258['save']();};}function saveUpdates(_0x4d2d6a,_0x5a4eed){return function(_0x57ea11){if(_0x57ea11){return _0x57ea11[_0xde83('0x2e')](_0x4d2d6a)[_0xde83('0x1c')](function(_0x533ec6){return _0x533ec6;});}return null;};}function removeEntity(_0x3d0ae2,_0x11463a){return function(_0x3dae34){if(_0x3dae34){return _0x3dae34['destroy']()[_0xde83('0x1c')](function(){_0x3d0ae2[_0xde83('0x28')](0xcc)[_0xde83('0x2f')]();});}};}function handleEntityNotFound(_0x30ac61,_0x5d81bb){return function(_0x13a84f){if(!_0x13a84f){_0x30ac61[_0xde83('0x27')](0x194);}return _0x13a84f;};}function handleError(_0x4f1b28,_0x53de87){_0x53de87=_0x53de87||0x1f4;return function(_0x287282){logger[_0xde83('0x21')](_0x287282['stack']);if(_0x287282[_0xde83('0x30')]){delete _0x287282[_0xde83('0x30')];}_0x4f1b28[_0xde83('0x28')](_0x53de87)['send'](_0x287282);};}exports[_0xde83('0x31')]=function(_0x14a5ac,_0x213845){var _0x58c704={},_0x3d8025={},_0x4e4594={'count':0x0,'rows':[]};var _0x780233=_['map'](db[_0xde83('0x32')][_0xde83('0x33')],function(_0x1f4480){return{'name':_0x1f4480[_0xde83('0x34')],'type':_0x1f4480[_0xde83('0x35')][_0xde83('0x36')]};});_0x3d8025[_0xde83('0x37')]=_['map'](_0x780233,_0xde83('0x30'));_0x3d8025[_0xde83('0x38')]=_[_0xde83('0x39')](_0x14a5ac[_0xde83('0x38')]);_0x3d8025['filters']=_[_0xde83('0x3a')](_0x3d8025[_0xde83('0x37')],_0x3d8025[_0xde83('0x38')]);_0x58c704[_0xde83('0x3b')]=_[_0xde83('0x3a')](_0x3d8025[_0xde83('0x37')],qs[_0xde83('0x3c')](_0x14a5ac[_0xde83('0x38')][_0xde83('0x3c')]));_0x58c704[_0xde83('0x3b')]=_0x58c704[_0xde83('0x3b')][_0xde83('0x3d')]?_0x58c704[_0xde83('0x3b')]:_0x3d8025[_0xde83('0x37')];if(!_0x14a5ac['query'][_0xde83('0x3e')](_0xde83('0x3f'))){_0x58c704[_0xde83('0x40')]=qs[_0xde83('0x40')](_0x14a5ac[_0xde83('0x38')]['limit']);_0x58c704[_0xde83('0x41')]=qs[_0xde83('0x41')](_0x14a5ac[_0xde83('0x38')][_0xde83('0x41')]);}_0x58c704[_0xde83('0x42')]=qs[_0xde83('0x43')](_0x14a5ac[_0xde83('0x38')][_0xde83('0x43')]);_0x58c704[_0xde83('0x44')]=qs[_0xde83('0x45')](_[_0xde83('0x46')](_0x14a5ac[_0xde83('0x38')],_0x3d8025[_0xde83('0x45')]));if(_0x14a5ac['query'][_0xde83('0x47')]){_0x58c704[_0xde83('0x44')]=_['merge'](_0x58c704[_0xde83('0x44')],{'$or':_[_0xde83('0x48')](_0x780233,function(_0x1677e2){if(_0x1677e2[_0xde83('0x35')]!=='VIRTUAL'){var _0x19a27f={};_0x19a27f[_0x1677e2[_0xde83('0x30')]]={'$like':'%'+_0x14a5ac['query'][_0xde83('0x47')]+'%'};return _0x19a27f;}})});}_0x58c704=_[_0xde83('0x49')]({},_0x58c704,_0x14a5ac[_0xde83('0x4a')]);var _0x3e2aab={'where':_0x58c704[_0xde83('0x44')]};return db[_0xde83('0x32')]['count'](_0x3e2aab)[_0xde83('0x1c')](function(_0x55373c){_0x4e4594['count']=_0x55373c;if(_0x14a5ac[_0xde83('0x38')][_0xde83('0x4b')]){_0x58c704[_0xde83('0x4c')]=[{'all':!![]}];}return db[_0xde83('0x32')][_0xde83('0x4d')](_0x58c704);})[_0xde83('0x1c')](function(_0x21b54a){_0x4e4594['rows']=_0x21b54a;return _0x4e4594;})[_0xde83('0x1c')](respondWithFilteredResult(_0x213845,_0x58c704))[_0xde83('0x4e')](handleError(_0x213845,null));};exports['show']=function(_0x43a23a,_0x4de0ee){var _0x4dc3d6={'raw':![],'where':{'id':_0x43a23a[_0xde83('0x4f')]['id']}},_0x5c3f4f={};_0x5c3f4f['model']=_['keys'](db['SugarcrmAccount'][_0xde83('0x33')]);_0x5c3f4f['query']=_[_0xde83('0x39')](_0x43a23a[_0xde83('0x38')]);_0x5c3f4f['filters']=_[_0xde83('0x3a')](_0x5c3f4f[_0xde83('0x37')],_0x5c3f4f[_0xde83('0x38')]);_0x4dc3d6[_0xde83('0x3b')]=_[_0xde83('0x3a')](_0x5c3f4f[_0xde83('0x37')],qs[_0xde83('0x3c')](_0x43a23a[_0xde83('0x38')]['fields']));_0x4dc3d6[_0xde83('0x3b')]=_0x4dc3d6[_0xde83('0x3b')][_0xde83('0x3d')]?_0x4dc3d6[_0xde83('0x3b')]:_0x5c3f4f[_0xde83('0x37')];if(_0x43a23a[_0xde83('0x38')][_0xde83('0x4b')]){_0x4dc3d6[_0xde83('0x4c')]=[{'all':!![]}];}_0x4dc3d6=_[_0xde83('0x49')]({},_0x4dc3d6,_0x43a23a[_0xde83('0x4a')]);return db['SugarcrmAccount'][_0xde83('0x50')](_0x4dc3d6)[_0xde83('0x1c')](handleEntityNotFound(_0x4de0ee,null))[_0xde83('0x1c')](respondWithResult(_0x4de0ee,null))[_0xde83('0x4e')](handleError(_0x4de0ee,null));};exports[_0xde83('0x51')]=function(_0x342ad3,_0x36b22d){return db[_0xde83('0x32')]['create'](_0x342ad3[_0xde83('0x52')],{})[_0xde83('0x1c')](respondWithResult(_0x36b22d,0xc9))[_0xde83('0x4e')](handleError(_0x36b22d,null));};exports[_0xde83('0x2e')]=function(_0x425e70,_0x279f2a){if(_0x425e70[_0xde83('0x52')]['id']){delete _0x425e70[_0xde83('0x52')]['id'];}return db['SugarcrmAccount'][_0xde83('0x50')]({'where':{'id':_0x425e70[_0xde83('0x4f')]['id']}})[_0xde83('0x1c')](handleEntityNotFound(_0x279f2a,null))['then'](saveUpdates(_0x425e70[_0xde83('0x52')],null))[_0xde83('0x1c')](respondWithResult(_0x279f2a,null))[_0xde83('0x4e')](handleError(_0x279f2a,null));};exports[_0xde83('0x53')]=function(_0x2da023,_0x57fe99){return db[_0xde83('0x32')][_0xde83('0x50')]({'where':{'id':_0x2da023['params']['id']}})['then'](handleEntityNotFound(_0x57fe99,null))[_0xde83('0x1c')](removeEntity(_0x57fe99,null))['catch'](handleError(_0x57fe99,null));};exports[_0xde83('0x54')]=function(_0x38b100,_0x4b5604,_0x5295cb){var _0x4ec85a={};var _0x48fcdd={};var _0x3794be;var _0x20d2b5;return db[_0xde83('0x32')][_0xde83('0x55')]({'where':{'id':_0x38b100[_0xde83('0x4f')]['id']}})[_0xde83('0x1c')](handleEntityNotFound(_0x4b5604,null))[_0xde83('0x1c')](function(_0x2de7d6){if(_0x2de7d6){_0x3794be=_0x2de7d6;_0x48fcdd[_0xde83('0x37')]=_[_0xde83('0x39')](db['SugarcrmConfiguration'][_0xde83('0x33')]);_0x48fcdd[_0xde83('0x38')]=_[_0xde83('0x39')](_0x38b100[_0xde83('0x38')]);_0x48fcdd[_0xde83('0x45')]=_['intersection'](_0x48fcdd[_0xde83('0x37')],_0x48fcdd['query']);_0x4ec85a['attributes']=_[_0xde83('0x3a')](_0x48fcdd[_0xde83('0x37')],qs[_0xde83('0x3c')](_0x38b100[_0xde83('0x38')][_0xde83('0x3c')]));_0x4ec85a[_0xde83('0x3b')]=_0x4ec85a[_0xde83('0x3b')][_0xde83('0x3d')]?_0x4ec85a[_0xde83('0x3b')]:_0x48fcdd['model'];_0x4ec85a[_0xde83('0x42')]=qs[_0xde83('0x43')](_0x38b100[_0xde83('0x38')][_0xde83('0x43')]);_0x4ec85a[_0xde83('0x44')]=qs[_0xde83('0x45')](_['pick'](_0x38b100[_0xde83('0x38')],_0x48fcdd[_0xde83('0x45')]));if(_0x38b100['query'][_0xde83('0x47')]){_0x4ec85a[_0xde83('0x44')]=_[_0xde83('0x49')](_0x4ec85a[_0xde83('0x44')],{'$or':_[_0xde83('0x48')](_0x4ec85a[_0xde83('0x3b')],function(_0x1e8ea7){var _0x3e5861={};_0x3e5861[_0x1e8ea7]={'$like':'%'+_0x38b100['query'][_0xde83('0x47')]+'%'};return _0x3e5861;})});}_0x4ec85a=_[_0xde83('0x49')]({},_0x4ec85a,_0x38b100[_0xde83('0x4a')]);return _0x3794be[_0xde83('0x54')](_0x4ec85a);}})['then'](function(_0x50d94e){if(_0x50d94e){_0x20d2b5=_0x50d94e[_0xde83('0x3d')];if(!_0x38b100[_0xde83('0x38')]['hasOwnProperty']('nolimit')){_0x4ec85a[_0xde83('0x40')]=qs[_0xde83('0x40')](_0x38b100[_0xde83('0x38')][_0xde83('0x40')]);_0x4ec85a[_0xde83('0x41')]=qs[_0xde83('0x41')](_0x38b100[_0xde83('0x38')]['offset']);}return _0x3794be[_0xde83('0x54')](_0x4ec85a);}})[_0xde83('0x1c')](function(_0x45eafa){if(_0x45eafa){return _0x45eafa?{'count':_0x20d2b5,'rows':_0x45eafa}:null;}})[_0xde83('0x1c')](respondWithResult(_0x4b5604,null))[_0xde83('0x4e')](handleError(_0x4b5604,null));};exports[_0xde83('0x56')]=function(_0x324135,_0x19ff42,_0xe74945){if(_0x324135[_0xde83('0x52')]['id']){delete _0x324135['body']['id'];}return db[_0xde83('0x32')]['findOne']({'where':{'id':_0x324135[_0xde83('0x4f')]['id']}})['then'](handleEntityNotFound(_0x19ff42,null))[_0xde83('0x1c')](function(_0x33a945){if(_0x33a945){_0x324135[_0xde83('0x52')]['AccountId']=_0x33a945['id'];_0x324135['body'][_0xde83('0x57')]=integrations[_0xde83('0x58')](_0x324135[_0xde83('0x52')][_0xde83('0x59')],_0x324135['body'][_0xde83('0x35')]);_0x324135[_0xde83('0x52')][_0xde83('0x5a')]=integrations[_0xde83('0x5b')](_0x324135[_0xde83('0x52')][_0xde83('0x59')],_0x324135['body']['type']);return db[_0xde83('0x5c')][_0xde83('0x51')](_0x324135[_0xde83('0x52')],{'include':[{'model':db[_0xde83('0x5d')],'as':_0xde83('0x57')},{'model':db[_0xde83('0x5d')],'as':_0xde83('0x5a')}]});}return null;})['then'](respondWithResult(_0x19ff42,null))[_0xde83('0x4e')](handleError(_0x19ff42,null));};exports['getFields']=function(_0x486a7b,_0x5294ad,_0x57e7b3){var _0x31544e='';var _0x2ce79f=['id',_0xde83('0x30'),_0xde83('0x5e'),_0xde83('0x5f'),_0xde83('0x60'),_0xde83('0x61'),_0xde83('0x62'),_0xde83('0x63'),_0xde83('0x64'),'parent_type','parent_name',_0xde83('0x65')];return db[_0xde83('0x32')]['findOne']({'where':{'id':_0x486a7b['params']['id']},'attributes':['id','username',_0xde83('0x66'),_0xde83('0x67')]})['then'](handleEntityNotFound(_0x5294ad,null))[_0xde83('0x1c')](function(_0xbf3ae4){if(_0xbf3ae4){_0x31544e=_0xbf3ae4['remoteUri'];var _0x20f41d=_0x31544e[_0xde83('0x68')](-0x1);if(_0x20f41d==='/'){_0x31544e=_0x31544e['substring'](0x0,_0x31544e['lastIndexOf'](_0x20f41d));}return rp({'method':_0xde83('0x69'),'uri':util['format']('%s%s',_0x31544e,_0xde83('0x6a')),'json':!![],'form':{'method':_0xde83('0x6b'),'input_type':_0xde83('0x6c'),'response_type':_0xde83('0x6c'),'rest_data':JSON[_0xde83('0x20')]({'user_auth':{'user_name':_0xbf3ae4[_0xde83('0x6d')],'password':_0xbf3ae4[_0xde83('0x66')],'encryption':_0xde83('0x6e')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xde83('0x1c')](function(_0x9a8a60){if(_0x9a8a60&&_0x9a8a60[_0xde83('0x30')]!==_0xde83('0x6f')&&_0x9a8a60['name']!==_0xde83('0x70')){return rp({'method':_0xde83('0x69'),'uri':util[_0xde83('0x71')]('%s%s',_0x31544e,_0xde83('0x6a')),'json':!![],'form':{'method':_0xde83('0x72'),'input_type':_0xde83('0x6c'),'response_type':_0xde83('0x6c'),'rest_data':JSON[_0xde83('0x20')]({'session':_0x9a8a60['id'],'module_name':_0xde83('0x73')})}})['then'](function(_0x1f06cd){if(_0x1f06cd){var _0x17de42=_[_0xde83('0x74')](_0x1f06cd['module_fields']);_[_0xde83('0x75')](_0x17de42,function(_0x5d2b6c){return _0x2ce79f[_0xde83('0x76')](_0x5d2b6c[_0xde83('0x30')]);});return{'count':_0x17de42[_0xde83('0x3d')],'rows':_[_0xde83('0x48')](_0x17de42,function(_0x3d605c){return{'id':_0x3d605c[_0xde83('0x30')],'name':_0x3d605c['label'],'custom':_[_0xde83('0x77')](_0x3d605c[_0xde83('0x30')],'_c')?!![]:![],'options':_0x3d605c[_0xde83('0x4a')]?_[_0xde83('0x48')](_[_0xde83('0x74')](_0x3d605c[_0xde83('0x4a')]),function(_0x5ca141){return{'name':_0x5ca141[_0xde83('0x78')],'value':_0x5ca141[_0xde83('0x30')]};}):[]};})};}})[_0xde83('0x1c')](respondWithResult(_0x5294ad,null))['catch'](function(_0xe4a8b8){var _0x300108=_0x486a7b[_0xde83('0x38')][_0xde83('0x19')]?0x1f4:_0xe4a8b8[_0xde83('0x79')]||0x1f4;logger[_0xde83('0x21')](_0xde83('0x7a'),_0xde83('0x7b'),_0x300108,JSON['stringify'](_0xe4a8b8));delete _0xe4a8b8[_0xde83('0x30')];if(_0x300108===0x191){_0x300108=0x190;}_0x5294ad[_0xde83('0x28')](_0x300108)['send'](_0x486a7b[_0xde83('0x38')][_0xde83('0x19')]?{'message':_0xde83('0x7c'),'statusCode':_0xe4a8b8['statusCode']}:_0xe4a8b8);});}else{var _0x38d74c=0x1f4;_0x5294ad[_0xde83('0x28')](_0x38d74c)[_0xde83('0x7d')]({'message':_0xde83('0x7c'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x2605=['Invalid\x20Login','POST','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','test','Sequelize','ValidationError','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','count','offset','limit','apply','reject','save','update','destroy','sendStatus','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','SugarcrmAccount','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','pick','nolimit','addConfiguration','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','assigned_user_id','created_by','description','date_start','parent_type','parent_name','direction','username','password','slice','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','JSON','stringify','xCALLY\x20Motion\x20Integration'];(function(_0x18d5d7,_0x19074b){var _0x30a9ea=function(_0x514f3f){while(--_0x514f3f){_0x18d5d7['push'](_0x18d5d7['shift']());}};_0x30a9ea(++_0x19074b);}(_0x2605,0x92));var _0x5260=function(_0xcfd89f,_0x106e8f){_0xcfd89f=_0xcfd89f-0x0;var _0x59acd4=_0x2605[_0xcfd89f];return _0x59acd4;};'use strict';var pdf=require(_0x5260('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5260('0x1'));var zipdir=require(_0x5260('0x2'));var jsonpatch=require(_0x5260('0x3'));var rp=require(_0x5260('0x4'));var moment=require(_0x5260('0x5'));var BPromise=require(_0x5260('0x6'));var Mustache=require('mustache');var util=require(_0x5260('0x7'));var path=require(_0x5260('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5260('0x9'));var fs=require('fs');var _=require(_0x5260('0xa'));var squel=require(_0x5260('0xb'));var crypto=require(_0x5260('0xc'));var jsforce=require(_0x5260('0xd'));var deskjs=require(_0x5260('0xe'));var toCsv=require(_0x5260('0xf'));var querystring=require(_0x5260('0x10'));var Papa=require(_0x5260('0x11'));var Redis=require('ioredis');var authService=require(_0x5260('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5260('0x13'));var hardwareService=require(_0x5260('0x14'));var logger=require(_0x5260('0x15'))(_0x5260('0x16'));var utils=require(_0x5260('0x17'));var config=require(_0x5260('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x5260('0x19'));var client=jayson['client'][_0x5260('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2a21e5,_0x20a911,_0x2d01c9){if(_0x2d01c9){var _0x5b0a24=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5b0a24[_0x5260('0x1b')](_0x20a911)){return _0x2a21e5;}else{throw new db[(_0x5260('0x1c'))][(_0x5260('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2a21e5;}}function respondWithRpcPromise(_0x42f8d1,_0x133288,_0x5bbdd6,_0x4a0fcb){return new BPromise(function(_0x173b90,_0x213baf){var _0x28a05a=_0x4a0fcb||client;return _0x28a05a[_0x5260('0x1e')](_0x42f8d1,_0x5bbdd6)[_0x5260('0x1f')](function(_0x24dfbd){logger[_0x5260('0x20')](_0x5260('0x21'),_0x133288,_0x5260('0x22'));logger[_0x5260('0x23')](_0x5260('0x24'),_0x133288,_0x5260('0x22'),JSON['stringify'](_0x24dfbd));if(_0x24dfbd['error']){if(_0x24dfbd[_0x5260('0x25')][_0x5260('0x26')]===0x1f4){logger[_0x5260('0x25')](_0x5260('0x21'),_0x133288,_0x24dfbd[_0x5260('0x25')][_0x5260('0x27')]);return _0x213baf(_0x24dfbd[_0x5260('0x25')][_0x5260('0x27')]);}logger[_0x5260('0x25')](_0x5260('0x21'),_0x133288,_0x24dfbd['error'][_0x5260('0x27')]);return _0x173b90(_0x24dfbd[_0x5260('0x25')][_0x5260('0x27')]);}else{logger[_0x5260('0x20')](_0x5260('0x21'),_0x133288,'request\x20sent');_0x173b90(_0x24dfbd[_0x5260('0x28')][_0x5260('0x27')]);}})[_0x5260('0x29')](function(_0x106b07){logger[_0x5260('0x25')](_0x5260('0x21'),_0x133288,_0x106b07);_0x213baf(_0x106b07);});});}function respondWithStatusCode(_0xf037e6,_0x1a869a){_0x1a869a=_0x1a869a||0xcc;return function(_0x5e5a74){if(_0x5e5a74){return _0xf037e6['sendStatus'](_0x1a869a);}return _0xf037e6[_0x5260('0x2a')](_0x1a869a)[_0x5260('0x2b')]();};}function respondWithResult(_0x4be6fe,_0x4be20d){_0x4be20d=_0x4be20d||0xc8;return function(_0x323a36){if(_0x323a36){return _0x4be6fe[_0x5260('0x2a')](_0x4be20d)[_0x5260('0x2c')](_0x323a36);}};}function respondWithFilteredResult(_0x3a530b,_0x598383){return function(_0x388605){if(_0x388605){var _0x2ff403=_0x388605[_0x5260('0x2d')],_0xc630d7=_0x598383[_0x5260('0x2e')],_0x4b3bc9=_0x598383[_0x5260('0x2e')]+_0x598383[_0x5260('0x2f')],_0x5a5c07;if(_0x4b3bc9>=_0x2ff403){_0x4b3bc9=_0x2ff403;_0x5a5c07=0xc8;}else{_0x5a5c07=0xce;}_0x3a530b[_0x5260('0x2a')](_0x5a5c07);return _0x3a530b['set']('Content-Range',_0xc630d7+'-'+_0x4b3bc9+'/'+_0x2ff403)['json'](_0x388605);}return null;};}function patchUpdates(_0x5e0044){return function(_0x4f5420){try{jsonpatch[_0x5260('0x30')](_0x4f5420,_0x5e0044,!![]);}catch(_0x46c54c){return BPromise[_0x5260('0x31')](_0x46c54c);}return _0x4f5420[_0x5260('0x32')]();};}function saveUpdates(_0x28a895,_0x5a3309){return function(_0x18369b){if(_0x18369b){return _0x18369b[_0x5260('0x33')](_0x28a895)['then'](function(_0x23e36c){return _0x23e36c;});}return null;};}function removeEntity(_0x2b1f45,_0x17b9c2){return function(_0x23dae1){if(_0x23dae1){return _0x23dae1[_0x5260('0x34')]()[_0x5260('0x1f')](function(){_0x2b1f45[_0x5260('0x2a')](0xcc)[_0x5260('0x2b')]();});}};}function handleEntityNotFound(_0x264981,_0x3d9ec1){return function(_0x456641){if(!_0x456641){_0x264981[_0x5260('0x35')](0x194);}return _0x456641;};}function handleError(_0x24f2a3,_0x1c0939){_0x1c0939=_0x1c0939||0x1f4;return function(_0xe98e1a){logger[_0x5260('0x25')](_0xe98e1a[_0x5260('0x36')]);if(_0xe98e1a['name']){delete _0xe98e1a['name'];}_0x24f2a3[_0x5260('0x2a')](_0x1c0939)[_0x5260('0x37')](_0xe98e1a);};}exports[_0x5260('0x38')]=function(_0x28aa22,_0x529bc0){var _0x3e5b9d={},_0x2ccfa4={},_0x1101cb={'count':0x0,'rows':[]};var _0x42ba7a=_[_0x5260('0x39')](db['SugarcrmAccount'][_0x5260('0x3a')],function(_0x3b5139){return{'name':_0x3b5139[_0x5260('0x3b')],'type':_0x3b5139[_0x5260('0x3c')][_0x5260('0x3d')]};});_0x2ccfa4[_0x5260('0x3e')]=_[_0x5260('0x39')](_0x42ba7a,_0x5260('0x3f'));_0x2ccfa4[_0x5260('0x40')]=_[_0x5260('0x41')](_0x28aa22[_0x5260('0x40')]);_0x2ccfa4[_0x5260('0x42')]=_[_0x5260('0x43')](_0x2ccfa4[_0x5260('0x3e')],_0x2ccfa4['query']);_0x3e5b9d[_0x5260('0x44')]=_[_0x5260('0x43')](_0x2ccfa4[_0x5260('0x3e')],qs[_0x5260('0x45')](_0x28aa22['query']['fields']));_0x3e5b9d[_0x5260('0x44')]=_0x3e5b9d[_0x5260('0x44')][_0x5260('0x46')]?_0x3e5b9d[_0x5260('0x44')]:_0x2ccfa4[_0x5260('0x3e')];if(!_0x28aa22[_0x5260('0x40')][_0x5260('0x47')]('nolimit')){_0x3e5b9d[_0x5260('0x2f')]=qs[_0x5260('0x2f')](_0x28aa22[_0x5260('0x40')][_0x5260('0x2f')]);_0x3e5b9d['offset']=qs[_0x5260('0x2e')](_0x28aa22[_0x5260('0x40')][_0x5260('0x2e')]);}_0x3e5b9d['order']=qs['sort'](_0x28aa22['query'][_0x5260('0x48')]);_0x3e5b9d[_0x5260('0x49')]=qs[_0x5260('0x42')](_['pick'](_0x28aa22[_0x5260('0x40')],_0x2ccfa4[_0x5260('0x42')]));if(_0x28aa22[_0x5260('0x40')][_0x5260('0x4a')]){_0x3e5b9d[_0x5260('0x49')]=_[_0x5260('0x4b')](_0x3e5b9d[_0x5260('0x49')],{'$or':_[_0x5260('0x39')](_0x42ba7a,function(_0x5277ef){if(_0x5277ef[_0x5260('0x3c')]!==_0x5260('0x4c')){var _0x40d5a9={};_0x40d5a9[_0x5277ef[_0x5260('0x3f')]]={'$like':'%'+_0x28aa22[_0x5260('0x40')][_0x5260('0x4a')]+'%'};return _0x40d5a9;}})});}_0x3e5b9d=_[_0x5260('0x4b')]({},_0x3e5b9d,_0x28aa22[_0x5260('0x4d')]);var _0x102caa={'where':_0x3e5b9d[_0x5260('0x49')]};return db[_0x5260('0x4e')][_0x5260('0x2d')](_0x102caa)[_0x5260('0x1f')](function(_0x27682c){_0x1101cb[_0x5260('0x2d')]=_0x27682c;if(_0x28aa22['query'][_0x5260('0x4f')]){_0x3e5b9d[_0x5260('0x50')]=[{'all':!![]}];}return db[_0x5260('0x4e')][_0x5260('0x51')](_0x3e5b9d);})['then'](function(_0xeda645){_0x1101cb[_0x5260('0x52')]=_0xeda645;return _0x1101cb;})[_0x5260('0x1f')](respondWithFilteredResult(_0x529bc0,_0x3e5b9d))[_0x5260('0x29')](handleError(_0x529bc0,null));};exports[_0x5260('0x53')]=function(_0x297f58,_0x108415){var _0x57222b={'raw':![],'where':{'id':_0x297f58[_0x5260('0x54')]['id']}},_0x50af24={};_0x50af24[_0x5260('0x3e')]=_[_0x5260('0x41')](db['SugarcrmAccount']['rawAttributes']);_0x50af24[_0x5260('0x40')]=_['keys'](_0x297f58[_0x5260('0x40')]);_0x50af24[_0x5260('0x42')]=_[_0x5260('0x43')](_0x50af24['model'],_0x50af24['query']);_0x57222b[_0x5260('0x44')]=_[_0x5260('0x43')](_0x50af24[_0x5260('0x3e')],qs[_0x5260('0x45')](_0x297f58[_0x5260('0x40')][_0x5260('0x45')]));_0x57222b[_0x5260('0x44')]=_0x57222b[_0x5260('0x44')][_0x5260('0x46')]?_0x57222b[_0x5260('0x44')]:_0x50af24[_0x5260('0x3e')];if(_0x297f58['query'][_0x5260('0x4f')]){_0x57222b[_0x5260('0x50')]=[{'all':!![]}];}_0x57222b=_[_0x5260('0x4b')]({},_0x57222b,_0x297f58[_0x5260('0x4d')]);return db['SugarcrmAccount'][_0x5260('0x55')](_0x57222b)[_0x5260('0x1f')](handleEntityNotFound(_0x108415,null))[_0x5260('0x1f')](respondWithResult(_0x108415,null))[_0x5260('0x29')](handleError(_0x108415,null));};exports[_0x5260('0x56')]=function(_0x4ed0b8,_0x261388){return db[_0x5260('0x4e')][_0x5260('0x56')](_0x4ed0b8[_0x5260('0x57')],{})[_0x5260('0x1f')](respondWithResult(_0x261388,0xc9))[_0x5260('0x29')](handleError(_0x261388,null));};exports[_0x5260('0x33')]=function(_0x2db0aa,_0x10f938){if(_0x2db0aa[_0x5260('0x57')]['id']){delete _0x2db0aa[_0x5260('0x57')]['id'];}return db['SugarcrmAccount'][_0x5260('0x55')]({'where':{'id':_0x2db0aa[_0x5260('0x54')]['id']}})[_0x5260('0x1f')](handleEntityNotFound(_0x10f938,null))[_0x5260('0x1f')](saveUpdates(_0x2db0aa[_0x5260('0x57')],null))[_0x5260('0x1f')](respondWithResult(_0x10f938,null))[_0x5260('0x29')](handleError(_0x10f938,null));};exports[_0x5260('0x34')]=function(_0x23829c,_0x4d01a6){return db[_0x5260('0x4e')][_0x5260('0x55')]({'where':{'id':_0x23829c[_0x5260('0x54')]['id']}})[_0x5260('0x1f')](handleEntityNotFound(_0x4d01a6,null))[_0x5260('0x1f')](removeEntity(_0x4d01a6,null))[_0x5260('0x29')](handleError(_0x4d01a6,null));};exports[_0x5260('0x58')]=function(_0x38eb02,_0x2e2a46,_0x1a9b06){var _0x11282f={};var _0x5e8019={};var _0x864fc3;var _0x4f1056;return db['SugarcrmAccount'][_0x5260('0x59')]({'where':{'id':_0x38eb02[_0x5260('0x54')]['id']}})[_0x5260('0x1f')](handleEntityNotFound(_0x2e2a46,null))[_0x5260('0x1f')](function(_0x277401){if(_0x277401){_0x864fc3=_0x277401;_0x5e8019[_0x5260('0x3e')]=_[_0x5260('0x41')](db[_0x5260('0x5a')][_0x5260('0x3a')]);_0x5e8019[_0x5260('0x40')]=_[_0x5260('0x41')](_0x38eb02[_0x5260('0x40')]);_0x5e8019[_0x5260('0x42')]=_['intersection'](_0x5e8019[_0x5260('0x3e')],_0x5e8019[_0x5260('0x40')]);_0x11282f[_0x5260('0x44')]=_[_0x5260('0x43')](_0x5e8019[_0x5260('0x3e')],qs['fields'](_0x38eb02[_0x5260('0x40')][_0x5260('0x45')]));_0x11282f[_0x5260('0x44')]=_0x11282f[_0x5260('0x44')]['length']?_0x11282f[_0x5260('0x44')]:_0x5e8019[_0x5260('0x3e')];_0x11282f[_0x5260('0x5b')]=qs[_0x5260('0x48')](_0x38eb02[_0x5260('0x40')][_0x5260('0x48')]);_0x11282f[_0x5260('0x49')]=qs[_0x5260('0x42')](_[_0x5260('0x5c')](_0x38eb02[_0x5260('0x40')],_0x5e8019[_0x5260('0x42')]));if(_0x38eb02[_0x5260('0x40')][_0x5260('0x4a')]){_0x11282f[_0x5260('0x49')]=_[_0x5260('0x4b')](_0x11282f[_0x5260('0x49')],{'$or':_[_0x5260('0x39')](_0x11282f['attributes'],function(_0x4c973f){var _0x2a9bf7={};_0x2a9bf7[_0x4c973f]={'$like':'%'+_0x38eb02[_0x5260('0x40')][_0x5260('0x4a')]+'%'};return _0x2a9bf7;})});}_0x11282f=_[_0x5260('0x4b')]({},_0x11282f,_0x38eb02[_0x5260('0x4d')]);return _0x864fc3['getConfigurations'](_0x11282f);}})[_0x5260('0x1f')](function(_0x18dfb1){if(_0x18dfb1){_0x4f1056=_0x18dfb1[_0x5260('0x46')];if(!_0x38eb02[_0x5260('0x40')][_0x5260('0x47')](_0x5260('0x5d'))){_0x11282f[_0x5260('0x2f')]=qs[_0x5260('0x2f')](_0x38eb02[_0x5260('0x40')][_0x5260('0x2f')]);_0x11282f[_0x5260('0x2e')]=qs[_0x5260('0x2e')](_0x38eb02[_0x5260('0x40')][_0x5260('0x2e')]);}return _0x864fc3[_0x5260('0x58')](_0x11282f);}})['then'](function(_0x3c828f){if(_0x3c828f){return _0x3c828f?{'count':_0x4f1056,'rows':_0x3c828f}:null;}})[_0x5260('0x1f')](respondWithResult(_0x2e2a46,null))['catch'](handleError(_0x2e2a46,null));};exports[_0x5260('0x5e')]=function(_0x4d96b7,_0x52e6f7,_0x43e600){if(_0x4d96b7[_0x5260('0x57')]['id']){delete _0x4d96b7[_0x5260('0x57')]['id'];}return db[_0x5260('0x4e')]['findOne']({'where':{'id':_0x4d96b7[_0x5260('0x54')]['id']}})[_0x5260('0x1f')](handleEntityNotFound(_0x52e6f7,null))[_0x5260('0x1f')](function(_0x3f4b0b){if(_0x3f4b0b){_0x4d96b7['body']['AccountId']=_0x3f4b0b['id'];_0x4d96b7[_0x5260('0x57')][_0x5260('0x5f')]=integrations[_0x5260('0x60')](_0x4d96b7['body'][_0x5260('0x61')],_0x4d96b7[_0x5260('0x57')][_0x5260('0x3c')]);_0x4d96b7[_0x5260('0x57')]['Descriptions']=integrations[_0x5260('0x62')](_0x4d96b7['body'][_0x5260('0x61')],_0x4d96b7[_0x5260('0x57')]['type']);return db['SugarcrmConfiguration']['create'](_0x4d96b7[_0x5260('0x57')],{'include':[{'model':db[_0x5260('0x63')],'as':_0x5260('0x5f')},{'model':db['SugarcrmField'],'as':'Descriptions'}]});}return null;})[_0x5260('0x1f')](respondWithResult(_0x52e6f7,null))[_0x5260('0x29')](handleError(_0x52e6f7,null));};exports['getFields']=function(_0x3b857e,_0xa557d2,_0x1ec16f){var _0x349896='';var _0x4fd668=['id',_0x5260('0x3f'),_0x5260('0x64'),_0x5260('0x65'),_0x5260('0x66'),_0x5260('0x67'),'duration_hours','duration_minutes','parent_id',_0x5260('0x68'),_0x5260('0x69'),_0x5260('0x6a')];return db[_0x5260('0x4e')][_0x5260('0x59')]({'where':{'id':_0x3b857e[_0x5260('0x54')]['id']},'attributes':['id',_0x5260('0x6b'),_0x5260('0x6c'),'remoteUri']})[_0x5260('0x1f')](handleEntityNotFound(_0xa557d2,null))[_0x5260('0x1f')](function(_0x612302){if(_0x612302){_0x349896=_0x612302['remoteUri'];var _0xcfbd0=_0x349896[_0x5260('0x6d')](-0x1);if(_0xcfbd0==='/'){_0x349896=_0x349896[_0x5260('0x6e')](0x0,_0x349896[_0x5260('0x6f')](_0xcfbd0));}return rp({'method':'POST','uri':util[_0x5260('0x70')](_0x5260('0x71'),_0x349896,_0x5260('0x72')),'json':!![],'form':{'method':'login','input_type':_0x5260('0x73'),'response_type':_0x5260('0x73'),'rest_data':JSON[_0x5260('0x74')]({'user_auth':{'user_name':_0x612302['username'],'password':_0x612302[_0x5260('0x6c')],'encryption':'PLAIN'},'application':_0x5260('0x75')})}});}})['then'](function(_0x4d104b){if(_0x4d104b&&_0x4d104b[_0x5260('0x3f')]!==_0x5260('0x76')&&_0x4d104b[_0x5260('0x3f')]!=='Password\x20Expired'){return rp({'method':_0x5260('0x77'),'uri':util[_0x5260('0x70')](_0x5260('0x71'),_0x349896,_0x5260('0x72')),'json':!![],'form':{'method':_0x5260('0x78'),'input_type':_0x5260('0x73'),'response_type':_0x5260('0x73'),'rest_data':JSON['stringify']({'session':_0x4d104b['id'],'module_name':_0x5260('0x79')})}})[_0x5260('0x1f')](function(_0x3185ea){if(_0x3185ea){var _0x1c8ed0=_[_0x5260('0x7a')](_0x3185ea[_0x5260('0x7b')]);_[_0x5260('0x7c')](_0x1c8ed0,function(_0x421b4f){return _0x4fd668[_0x5260('0x7d')](_0x421b4f[_0x5260('0x3f')]);});return{'count':_0x1c8ed0[_0x5260('0x46')],'rows':_[_0x5260('0x39')](_0x1c8ed0,function(_0x345ef2){return{'id':_0x345ef2[_0x5260('0x3f')],'name':_0x345ef2[_0x5260('0x7e')],'custom':_[_0x5260('0x7f')](_0x345ef2[_0x5260('0x3f')],'_c')?!![]:![],'options':_0x345ef2[_0x5260('0x4d')]?_['map'](_['values'](_0x345ef2['options']),function(_0x4d64be){return{'name':_0x4d64be[_0x5260('0x80')],'value':_0x4d64be[_0x5260('0x3f')]};}):[]};})};}})[_0x5260('0x1f')](respondWithResult(_0xa557d2,null))['catch'](function(_0x1df481){var _0x28f264=_0x3b857e[_0x5260('0x40')][_0x5260('0x1b')]?0x1f4:_0x1df481[_0x5260('0x81')]||0x1f4;logger[_0x5260('0x25')](_0x5260('0x82'),'getFields',_0x28f264,JSON['stringify'](_0x1df481));delete _0x1df481[_0x5260('0x3f')];if(_0x28f264===0x191){_0x28f264=0x190;}_0xa557d2['status'](_0x28f264)[_0x5260('0x37')](_0x3b857e['query'][_0x5260('0x1b')]?{'message':_0x5260('0x83'),'statusCode':_0x1df481[_0x5260('0x81')]}:_0x1df481);});}else{var _0x154107=0x1f4;_0xa557d2[_0x5260('0x2a')](_0x154107)[_0x5260('0x37')]({'message':_0x5260('0x83'),'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 45cd9fc..5ec4a2d 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 _0x7743=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7743,0x1c2));var _0x3774=function(_0x43bb5b,_0x6e6506){_0x43bb5b=_0x43bb5b-0x0;var _0x371365=_0x7743[_0x43bb5b];return _0x371365;};'use strict';var _=require(_0x3774('0x0'));var util=require('util');var logger=require(_0x3774('0x1'))(_0x3774('0x2'));var moment=require('moment');var BPromise=require(_0x3774('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3774('0x4'));var rimraf=require(_0x3774('0x5'));var config=require(_0x3774('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x3774('0x7'));module[_0x3774('0x8')]=function(_0x41ff22,_0x2a10af){return _0x41ff22['define'](_0x3774('0x9'),attributes,{'tableName':_0x3774('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x028e=['request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x028e,0x1cf));var _0xe028=function(_0x2ee122,_0x29a979){_0x2ee122=_0x2ee122-0x0;var _0x3d9be6=_0x028e[_0x2ee122];return _0x3d9be6;};'use strict';var _=require(_0xe028('0x0'));var util=require('util');var logger=require(_0xe028('0x1'))(_0xe028('0x2'));var moment=require(_0xe028('0x3'));var BPromise=require(_0xe028('0x4'));var rp=require(_0xe028('0x5'));var fs=require('fs');var path=require(_0xe028('0x6'));var rimraf=require(_0xe028('0x7'));var config=require(_0xe028('0x8'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xe028('0x9'));module['exports']=function(_0x6080c8,_0x5c45eb){return _0x6080c8[_0xe028('0xa')](_0xe028('0xb'),attributes,{'tableName':_0xe028('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 52ec0f9..4b3b6cc 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 _0x1508=['client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','options','raw','limit','map','model','include','attributes','then','GetSugarcrmAccount','debug','SugarcrmAccount','where','ShowSugarcrmAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1a21ff,_0x4a7550){var _0x25afc1=function(_0x4a66ec){while(--_0x4a66ec){_0x1a21ff['push'](_0x1a21ff['shift']());}};_0x25afc1(++_0x4a7550);}(_0x1508,0xa5));var _0x8150=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1508[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8150('0x0'));var util=require(_0x8150('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8150('0x2'));var fs=require('fs');var Redis=require(_0x8150('0x3'));var db=require(_0x8150('0x4'))['db'];var utils=require(_0x8150('0x5'));var logger=require(_0x8150('0x6'))(_0x8150('0x7'));var config=require(_0x8150('0x8'));var jayson=require(_0x8150('0x9'));var client=jayson[_0x8150('0xa')][_0x8150('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35d9a2,_0x53e74a,_0x4eaddd){return new BPromise(function(_0x1e473c,_0x42ff2f){return client[_0x8150('0xc')](_0x35d9a2,_0x4eaddd)['then'](function(_0x1a5e18){logger[_0x8150('0xd')](_0x8150('0xe'),_0x53e74a,_0x8150('0xf'));logger['debug'](_0x8150('0x10'),_0x53e74a,_0x8150('0xf'),JSON[_0x8150('0x11')](_0x1a5e18));if(_0x1a5e18[_0x8150('0x12')]){if(_0x1a5e18['error'][_0x8150('0x13')]===0x1f4){logger['error'](_0x8150('0xe'),_0x53e74a,_0x1a5e18[_0x8150('0x12')][_0x8150('0x14')]);return _0x42ff2f(_0x1a5e18['error']['message']);}logger[_0x8150('0x12')](_0x8150('0xe'),_0x53e74a,_0x1a5e18['error'][_0x8150('0x14')]);return _0x1e473c(_0x1a5e18[_0x8150('0x12')][_0x8150('0x14')]);}else{logger[_0x8150('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x53e74a,_0x8150('0xf'));_0x1e473c(_0x1a5e18['result']['message']);}})[_0x8150('0x15')](function(_0x25b076){logger[_0x8150('0x12')](_0x8150('0xe'),_0x53e74a,_0x25b076);_0x42ff2f(_0x25b076);});});}exports['GetSugarcrmAccount']=function(_0x1b51f7){var _0x4d8c72=this;return new Promise(function(_0x4e8f2e,_0x5eb9f1){return db['SugarcrmAccount']['findAll']({'raw':_0x1b51f7['options']?_0x1b51f7[_0x8150('0x16')][_0x8150('0x17')]===undefined?!![]:![]:!![],'where':_0x1b51f7['options']?_0x1b51f7['options']['where']||null:null,'attributes':_0x1b51f7[_0x8150('0x16')]?_0x1b51f7[_0x8150('0x16')]['attributes']||null:null,'limit':_0x1b51f7['options']?_0x1b51f7['options'][_0x8150('0x18')]||null:null,'include':_0x1b51f7['options']?_0x1b51f7[_0x8150('0x16')]['include']?_[_0x8150('0x19')](_0x1b51f7[_0x8150('0x16')]['include'],function(_0x4c062c){return{'model':db[_0x4c062c[_0x8150('0x1a')]],'as':_0x4c062c['as'],'attributes':_0x4c062c['attributes'],'include':_0x4c062c[_0x8150('0x1b')]?_['map'](_0x4c062c[_0x8150('0x1b')],function(_0x35c4b6){return{'model':db[_0x35c4b6[_0x8150('0x1a')]],'as':_0x35c4b6['as'],'attributes':_0x35c4b6[_0x8150('0x1c')],'include':_0x35c4b6[_0x8150('0x1b')]?_[_0x8150('0x19')](_0x35c4b6['include'],function(_0xf738ee){return{'model':db[_0xf738ee[_0x8150('0x1a')]],'as':_0xf738ee['as'],'attributes':_0xf738ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x8150('0x1d')](function(_0x5e5e90){logger[_0x8150('0xd')](_0x8150('0x1e'),_0x1b51f7);logger[_0x8150('0x1f')](_0x8150('0x1e'),_0x1b51f7,JSON[_0x8150('0x11')](_0x5e5e90));_0x4e8f2e(_0x5e5e90);})[_0x8150('0x15')](function(_0x4a2c84){logger['error']('GetSugarcrmAccount',_0x4a2c84[_0x8150('0x14')],_0x1b51f7);_0x5eb9f1(_0x4d8c72[_0x8150('0x12')](0x1f4,_0x4a2c84[_0x8150('0x14')]));});});};exports['ShowSugarcrmAccount']=function(_0x5950d8){var _0x10d379=this;return new Promise(function(_0x34c455,_0x5cf30c){return db[_0x8150('0x20')]['find']({'raw':_0x5950d8[_0x8150('0x16')]?_0x5950d8[_0x8150('0x16')][_0x8150('0x17')]===undefined?!![]:![]:!![],'where':_0x5950d8[_0x8150('0x16')]?_0x5950d8['options'][_0x8150('0x21')]||null:null,'attributes':_0x5950d8[_0x8150('0x16')]?_0x5950d8[_0x8150('0x16')]['attributes']||null:null,'include':_0x5950d8['options']?_0x5950d8[_0x8150('0x16')][_0x8150('0x1b')]?_['map'](_0x5950d8[_0x8150('0x16')][_0x8150('0x1b')],function(_0x5a8462){return{'model':db[_0x5a8462[_0x8150('0x1a')]],'as':_0x5a8462['as'],'attributes':_0x5a8462[_0x8150('0x1c')],'include':_0x5a8462[_0x8150('0x1b')]?_[_0x8150('0x19')](_0x5a8462[_0x8150('0x1b')],function(_0x194016){return{'model':db[_0x194016['model']],'as':_0x194016['as'],'attributes':_0x194016[_0x8150('0x1c')],'include':_0x194016[_0x8150('0x1b')]?_['map'](_0x194016[_0x8150('0x1b')],function(_0x4921bb){return{'model':db[_0x4921bb['model']],'as':_0x4921bb['as'],'attributes':_0x4921bb[_0x8150('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8150('0x1d')](function(_0x45110c){logger[_0x8150('0xd')]('ShowSugarcrmAccount',_0x5950d8);logger[_0x8150('0x1f')](_0x8150('0x22'),_0x5950d8,JSON[_0x8150('0x11')](_0x45110c));_0x34c455(_0x45110c);})[_0x8150('0x15')](function(_0x1d8a99){logger[_0x8150('0x12')](_0x8150('0x22'),_0x1d8a99[_0x8150('0x14')],_0x5950d8);_0x5cf30c(_0x10d379[_0x8150('0x12')](0x1f4,_0x1d8a99[_0x8150('0x14')]));});});}; \ No newline at end of file +var _0xf641=['SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','findAll','options','raw','where','limit','include','map','attributes','model','info','GetSugarcrmAccount','debug','ShowSugarcrmAccount','SugarcrmAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','then'];(function(_0x3ef474,_0x2ad71e){var _0x25494a=function(_0x2a282c){while(--_0x2a282c){_0x3ef474['push'](_0x3ef474['shift']());}};_0x25494a(++_0x2ad71e);}(_0xf641,0xdd));var _0x1f64=function(_0x27fb50,_0x33a207){_0x27fb50=_0x27fb50-0x0;var _0x24a89a=_0xf641[_0x27fb50];return _0x24a89a;};'use strict';var _=require(_0x1f64('0x0'));var util=require('util');var moment=require(_0x1f64('0x1'));var BPromise=require(_0x1f64('0x2'));var rs=require(_0x1f64('0x3'));var fs=require('fs');var Redis=require(_0x1f64('0x4'));var db=require(_0x1f64('0x5'))['db'];var utils=require(_0x1f64('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1f64('0x7')][_0x1f64('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd83664,_0x3f7b5f,_0x2a0615){return new BPromise(function(_0x3bfb61,_0x282808){return client['request'](_0xd83664,_0x2a0615)[_0x1f64('0x9')](function(_0xe407bb){logger['info'](_0x1f64('0xa'),_0x3f7b5f,'request\x20sent');logger['debug'](_0x1f64('0xb'),_0x3f7b5f,'request\x20sent',JSON[_0x1f64('0xc')](_0xe407bb));if(_0xe407bb['error']){if(_0xe407bb[_0x1f64('0xd')][_0x1f64('0xe')]===0x1f4){logger[_0x1f64('0xd')](_0x1f64('0xa'),_0x3f7b5f,_0xe407bb[_0x1f64('0xd')][_0x1f64('0xf')]);return _0x282808(_0xe407bb[_0x1f64('0xd')][_0x1f64('0xf')]);}logger[_0x1f64('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x3f7b5f,_0xe407bb[_0x1f64('0xd')][_0x1f64('0xf')]);return _0x3bfb61(_0xe407bb[_0x1f64('0xd')][_0x1f64('0xf')]);}else{logger['info'](_0x1f64('0xa'),_0x3f7b5f,_0x1f64('0x10'));_0x3bfb61(_0xe407bb[_0x1f64('0x11')][_0x1f64('0xf')]);}})[_0x1f64('0x12')](function(_0x1d0f93){logger[_0x1f64('0xd')](_0x1f64('0xa'),_0x3f7b5f,_0x1d0f93);_0x282808(_0x1d0f93);});});}exports['GetSugarcrmAccount']=function(_0x1f6474){var _0x2843a1=this;return new Promise(function(_0x10b59d,_0x5f1024){return db['SugarcrmAccount'][_0x1f64('0x13')]({'raw':_0x1f6474[_0x1f64('0x14')]?_0x1f6474[_0x1f64('0x14')][_0x1f64('0x15')]===undefined?!![]:![]:!![],'where':_0x1f6474[_0x1f64('0x14')]?_0x1f6474[_0x1f64('0x14')][_0x1f64('0x16')]||null:null,'attributes':_0x1f6474['options']?_0x1f6474['options']['attributes']||null:null,'limit':_0x1f6474['options']?_0x1f6474[_0x1f64('0x14')][_0x1f64('0x17')]||null:null,'include':_0x1f6474[_0x1f64('0x14')]?_0x1f6474[_0x1f64('0x14')][_0x1f64('0x18')]?_[_0x1f64('0x19')](_0x1f6474[_0x1f64('0x14')][_0x1f64('0x18')],function(_0x45e63f){return{'model':db[_0x45e63f['model']],'as':_0x45e63f['as'],'attributes':_0x45e63f[_0x1f64('0x1a')],'include':_0x45e63f['include']?_['map'](_0x45e63f[_0x1f64('0x18')],function(_0x15bf8f){return{'model':db[_0x15bf8f[_0x1f64('0x1b')]],'as':_0x15bf8f['as'],'attributes':_0x15bf8f[_0x1f64('0x1a')],'include':_0x15bf8f[_0x1f64('0x18')]?_['map'](_0x15bf8f[_0x1f64('0x18')],function(_0x3255fb){return{'model':db[_0x3255fb[_0x1f64('0x1b')]],'as':_0x3255fb['as'],'attributes':_0x3255fb[_0x1f64('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d57bf){logger[_0x1f64('0x1c')](_0x1f64('0x1d'),_0x1f6474);logger[_0x1f64('0x1e')](_0x1f64('0x1d'),_0x1f6474,JSON['stringify'](_0x1d57bf));_0x10b59d(_0x1d57bf);})[_0x1f64('0x12')](function(_0x1094e2){logger['error'](_0x1f64('0x1d'),_0x1094e2[_0x1f64('0xf')],_0x1f6474);_0x5f1024(_0x2843a1[_0x1f64('0xd')](0x1f4,_0x1094e2['message']));});});};exports[_0x1f64('0x1f')]=function(_0x167c75){var _0x1fee30=this;return new Promise(function(_0x210ee7,_0x2b17c4){return db[_0x1f64('0x20')]['find']({'raw':_0x167c75[_0x1f64('0x14')]?_0x167c75[_0x1f64('0x14')][_0x1f64('0x15')]===undefined?!![]:![]:!![],'where':_0x167c75[_0x1f64('0x14')]?_0x167c75['options'][_0x1f64('0x16')]||null:null,'attributes':_0x167c75[_0x1f64('0x14')]?_0x167c75[_0x1f64('0x14')][_0x1f64('0x1a')]||null:null,'include':_0x167c75['options']?_0x167c75[_0x1f64('0x14')][_0x1f64('0x18')]?_[_0x1f64('0x19')](_0x167c75[_0x1f64('0x14')][_0x1f64('0x18')],function(_0x3de0ba){return{'model':db[_0x3de0ba['model']],'as':_0x3de0ba['as'],'attributes':_0x3de0ba[_0x1f64('0x1a')],'include':_0x3de0ba[_0x1f64('0x18')]?_[_0x1f64('0x19')](_0x3de0ba[_0x1f64('0x18')],function(_0x3d0b9e){return{'model':db[_0x3d0b9e['model']],'as':_0x3d0b9e['as'],'attributes':_0x3d0b9e[_0x1f64('0x1a')],'include':_0x3d0b9e['include']?_[_0x1f64('0x19')](_0x3d0b9e[_0x1f64('0x18')],function(_0x4fd705){return{'model':db[_0x4fd705[_0x1f64('0x1b')]],'as':_0x4fd705['as'],'attributes':_0x4fd705[_0x1f64('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1f64('0x9')](function(_0x3ac3ce){logger[_0x1f64('0x1c')](_0x1f64('0x1f'),_0x167c75);logger[_0x1f64('0x1e')](_0x1f64('0x1f'),_0x167c75,JSON[_0x1f64('0xc')](_0x3ac3ce));_0x210ee7(_0x3ac3ce);})[_0x1f64('0x12')](function(_0x52ba7a){logger['error']('ShowSugarcrmAccount',_0x52ba7a[_0x1f64('0xf')],_0x167c75);_0x2b17c4(_0x1fee30[_0x1f64('0xd')](0x1f4,_0x52ba7a[_0x1f64('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 4b9fdf4..7dad1d3 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 _0x4945=['/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','put','/:id','delete','destroy','multer','util','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','get'];(function(_0xdd6f0b,_0x1c65d7){var _0x2ff9d3=function(_0x33cd6b){while(--_0x33cd6b){_0xdd6f0b['push'](_0xdd6f0b['shift']());}};_0x2ff9d3(++_0x1c65d7);}(_0x4945,0xbd));var _0x5494=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x4945[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require(_0x5494('0x0'));var util=require(_0x5494('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5494('0x2'));var router=express[_0x5494('0x3')]();var auth=require(_0x5494('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5494('0x5'));var controller=require(_0x5494('0x6'));router['get']('/',auth[_0x5494('0x7')](),controller['index']);router[_0x5494('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5494('0x8')](_0x5494('0x9'),auth[_0x5494('0x7')](),controller[_0x5494('0xa')]);router[_0x5494('0x8')]('/:id/subjects',auth[_0x5494('0x7')](),controller[_0x5494('0xb')]);router[_0x5494('0x8')](_0x5494('0xc'),auth['isAuthenticated'](),controller[_0x5494('0xd')]);router['post']('/',auth[_0x5494('0x7')](),controller['create']);router[_0x5494('0xe')](_0x5494('0xf'),auth[_0x5494('0x7')](),controller['update']);router[_0x5494('0x10')](_0x5494('0xf'),auth[_0x5494('0x7')](),controller[_0x5494('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa293=['post','create','put','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions'];(function(_0x36f945,_0x35e22f){var _0x13a085=function(_0x3c5903){while(--_0x3c5903){_0x36f945['push'](_0x36f945['shift']());}};_0x13a085(++_0x35e22f);}(_0xa293,0x130));var _0x3a29=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xa293[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x3a29('0x0'));var path=require(_0x3a29('0x1'));var timeout=require(_0x3a29('0x2'));var express=require(_0x3a29('0x3'));var router=express[_0x3a29('0x4')]();var auth=require(_0x3a29('0x5'));var interaction=require(_0x3a29('0x6'));var config=require(_0x3a29('0x7'));var controller=require(_0x3a29('0x8'));router[_0x3a29('0x9')]('/',auth[_0x3a29('0xa')](),controller[_0x3a29('0xb')]);router['get'](_0x3a29('0xc'),auth[_0x3a29('0xa')](),controller[_0x3a29('0xd')]);router['get'](_0x3a29('0xe'),auth[_0x3a29('0xa')](),controller[_0x3a29('0xf')]);router[_0x3a29('0x9')](_0x3a29('0x10'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x3a29('0x9')](_0x3a29('0x11'),auth[_0x3a29('0xa')](),controller['getDescriptions']);router[_0x3a29('0x12')]('/',auth['isAuthenticated'](),controller[_0x3a29('0x13')]);router[_0x3a29('0x14')](_0x3a29('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x3a29('0xc'),auth[_0x3a29('0xa')](),controller[_0x3a29('0x15')]);module[_0x3a29('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 2c28feb..05b67b9 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 _0x51cf=['exports','STRING','sequelize'];(function(_0x38a56b,_0x1d491c){var _0x2bb0bb=function(_0x2a6145){while(--_0x2a6145){_0x38a56b['push'](_0x38a56b['shift']());}};_0x2bb0bb(++_0x1d491c);}(_0x51cf,0x65));var _0xf51c=function(_0x192d02,_0x50dbc3){_0x192d02=_0x192d02-0x0;var _0x47c11a=_0x51cf[_0x192d02];return _0x47c11a;};'use strict';var Sequelize=require(_0xf51c('0x0'));module[_0xf51c('0x1')]={'name':{'type':Sequelize[_0xf51c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd3fa=['exports','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd3fa,0x163));var _0xad3f=function(_0x2a27bb,_0x11d89d){_0x2a27bb=_0x2a27bb-0x0;var _0x7f66c4=_0xd3fa[_0x2a27bb];return _0x7f66c4;};'use strict';var Sequelize=require(_0xad3f('0x0'));module[_0xad3f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index c766612..25a515b 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 _0xdc06=['getSubjects','findOne','pick','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','count','offset','limit','set','json','apply','reject','save','update','destroy','end','name','send','index','map','SugarcrmConfiguration','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','filter','where','VIRTUAL','merge','options','rows','catch','params','rawAttributes','length','includeAll','create','body','find','getFields','SugarcrmField','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc06,0x112));var _0x6dc0=function(_0x2cfd94,_0x27e2eb){_0x2cfd94=_0x2cfd94-0x0;var _0x5855ae=_0xdc06[_0x2cfd94];return _0x5855ae;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6dc0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6dc0('0x1'));var jsonpatch=require(_0x6dc0('0x2'));var rp=require(_0x6dc0('0x3'));var moment=require(_0x6dc0('0x4'));var BPromise=require(_0x6dc0('0x5'));var Mustache=require(_0x6dc0('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6dc0('0x7'));var csv=require(_0x6dc0('0x8'));var ejs=require(_0x6dc0('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6dc0('0xa'));var crypto=require(_0x6dc0('0xb'));var jsforce=require(_0x6dc0('0xc'));var deskjs=require(_0x6dc0('0xd'));var toCsv=require(_0x6dc0('0x8'));var querystring=require(_0x6dc0('0xe'));var Papa=require(_0x6dc0('0xf'));var Redis=require(_0x6dc0('0x10'));var authService=require(_0x6dc0('0x11'));var qs=require(_0x6dc0('0x12'));var as=require(_0x6dc0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6dc0('0x14'))('api');var utils=require(_0x6dc0('0x15'));var config=require('../../config/environment');var db=require(_0x6dc0('0x16'))['db'];var jayson=require(_0x6dc0('0x17'));var client=jayson[_0x6dc0('0x18')][_0x6dc0('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5b3452,_0x35823e,_0x2b1f45){if(_0x2b1f45){var _0x54516e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x54516e['test'](_0x35823e)){return _0x5b3452;}else{throw new db[(_0x6dc0('0x1a'))]['ValidationError'](_0x6dc0('0x1b'));}}else{return _0x5b3452;}}function respondWithRpcPromise(_0x2805ee,_0x31e6b0,_0x1887ff,_0x10716f){return new BPromise(function(_0x31a467,_0x388ac8){var _0x1b377e=_0x10716f||client;return _0x1b377e[_0x6dc0('0x1c')](_0x2805ee,_0x1887ff)[_0x6dc0('0x1d')](function(_0x2633e6){logger['info'](_0x6dc0('0x1e'),_0x31e6b0,'request\x20sent');logger[_0x6dc0('0x1f')](_0x6dc0('0x20'),_0x31e6b0,_0x6dc0('0x21'),JSON[_0x6dc0('0x22')](_0x2633e6));if(_0x2633e6[_0x6dc0('0x23')]){if(_0x2633e6['error'][_0x6dc0('0x24')]===0x1f4){logger[_0x6dc0('0x23')](_0x6dc0('0x1e'),_0x31e6b0,_0x2633e6[_0x6dc0('0x23')][_0x6dc0('0x25')]);return _0x388ac8(_0x2633e6['error'][_0x6dc0('0x25')]);}logger[_0x6dc0('0x23')](_0x6dc0('0x1e'),_0x31e6b0,_0x2633e6[_0x6dc0('0x23')][_0x6dc0('0x25')]);return _0x31a467(_0x2633e6[_0x6dc0('0x23')]['message']);}else{logger[_0x6dc0('0x26')](_0x6dc0('0x1e'),_0x31e6b0,_0x6dc0('0x21'));_0x31a467(_0x2633e6[_0x6dc0('0x27')]['message']);}})['catch'](function(_0x4cd3c0){logger[_0x6dc0('0x23')](_0x6dc0('0x1e'),_0x31e6b0,_0x4cd3c0);_0x388ac8(_0x4cd3c0);});});}function respondWithStatusCode(_0x390d50,_0x20978d){_0x20978d=_0x20978d||0xcc;return function(_0x162425){if(_0x162425){return _0x390d50[_0x6dc0('0x28')](_0x20978d);}return _0x390d50['status'](_0x20978d)['end']();};}function respondWithResult(_0x2ce26e,_0x718a19){_0x718a19=_0x718a19||0xc8;return function(_0x1276f3){if(_0x1276f3){return _0x2ce26e[_0x6dc0('0x29')](_0x718a19)['json'](_0x1276f3);}};}function respondWithFilteredResult(_0x2c631f,_0x56a059){return function(_0x49822e){if(_0x49822e){var _0x756777=_0x49822e[_0x6dc0('0x2a')],_0x4aa0e9=_0x56a059[_0x6dc0('0x2b')],_0x304c16=_0x56a059[_0x6dc0('0x2b')]+_0x56a059[_0x6dc0('0x2c')],_0x241a74;if(_0x304c16>=_0x756777){_0x304c16=_0x756777;_0x241a74=0xc8;}else{_0x241a74=0xce;}_0x2c631f[_0x6dc0('0x29')](_0x241a74);return _0x2c631f[_0x6dc0('0x2d')]('Content-Range',_0x4aa0e9+'-'+_0x304c16+'/'+_0x756777)[_0x6dc0('0x2e')](_0x49822e);}return null;};}function patchUpdates(_0x43529d){return function(_0x4e041a){try{jsonpatch[_0x6dc0('0x2f')](_0x4e041a,_0x43529d,!![]);}catch(_0x2c5941){return BPromise[_0x6dc0('0x30')](_0x2c5941);}return _0x4e041a[_0x6dc0('0x31')]();};}function saveUpdates(_0xda3bcb,_0xce2954){return function(_0x3df2c8){if(_0x3df2c8){return _0x3df2c8[_0x6dc0('0x32')](_0xda3bcb)['then'](function(_0x18558c){return _0x18558c;});}return null;};}function removeEntity(_0x4346a5,_0x282918){return function(_0x3d3add){if(_0x3d3add){return _0x3d3add[_0x6dc0('0x33')]()[_0x6dc0('0x1d')](function(){_0x4346a5[_0x6dc0('0x29')](0xcc)[_0x6dc0('0x34')]();});}};}function handleEntityNotFound(_0x4b485a,_0x5e87a7){return function(_0x47a89a){if(!_0x47a89a){_0x4b485a['sendStatus'](0x194);}return _0x47a89a;};}function handleError(_0x1a640d,_0x57ad5d){_0x57ad5d=_0x57ad5d||0x1f4;return function(_0x144129){logger[_0x6dc0('0x23')](_0x144129['stack']);if(_0x144129[_0x6dc0('0x35')]){delete _0x144129[_0x6dc0('0x35')];}_0x1a640d[_0x6dc0('0x29')](_0x57ad5d)[_0x6dc0('0x36')](_0x144129);};}exports[_0x6dc0('0x37')]=function(_0x3324fa,_0x2c8aa8){var _0x2845c0={},_0x2149a3={},_0x39d2c0={'count':0x0,'rows':[]};var _0x299a73=_[_0x6dc0('0x38')](db[_0x6dc0('0x39')]['rawAttributes'],function(_0x1597a0){return{'name':_0x1597a0['fieldName'],'type':_0x1597a0[_0x6dc0('0x3a')]['key']};});_0x2149a3[_0x6dc0('0x3b')]=_['map'](_0x299a73,_0x6dc0('0x35'));_0x2149a3[_0x6dc0('0x3c')]=_[_0x6dc0('0x3d')](_0x3324fa[_0x6dc0('0x3c')]);_0x2149a3[_0x6dc0('0x3e')]=_['intersection'](_0x2149a3['model'],_0x2149a3['query']);_0x2845c0[_0x6dc0('0x3f')]=_[_0x6dc0('0x40')](_0x2149a3[_0x6dc0('0x3b')],qs[_0x6dc0('0x41')](_0x3324fa[_0x6dc0('0x3c')][_0x6dc0('0x41')]));_0x2845c0['attributes']=_0x2845c0[_0x6dc0('0x3f')]['length']?_0x2845c0[_0x6dc0('0x3f')]:_0x2149a3[_0x6dc0('0x3b')];if(!_0x3324fa['query'][_0x6dc0('0x42')]('nolimit')){_0x2845c0[_0x6dc0('0x2c')]=qs[_0x6dc0('0x2c')](_0x3324fa[_0x6dc0('0x3c')]['limit']);_0x2845c0[_0x6dc0('0x2b')]=qs[_0x6dc0('0x2b')](_0x3324fa[_0x6dc0('0x3c')]['offset']);}_0x2845c0[_0x6dc0('0x43')]=qs['sort'](_0x3324fa['query'][_0x6dc0('0x44')]);_0x2845c0['where']=qs['filters'](_['pick'](_0x3324fa[_0x6dc0('0x3c')],_0x2149a3[_0x6dc0('0x3e')]));if(_0x3324fa['query'][_0x6dc0('0x45')]){_0x2845c0[_0x6dc0('0x46')]=_['merge'](_0x2845c0[_0x6dc0('0x46')],{'$or':_[_0x6dc0('0x38')](_0x299a73,function(_0x2bee01){if(_0x2bee01[_0x6dc0('0x3a')]!==_0x6dc0('0x47')){var _0x5b54aa={};_0x5b54aa[_0x2bee01['name']]={'$like':'%'+_0x3324fa['query'][_0x6dc0('0x45')]+'%'};return _0x5b54aa;}})});}_0x2845c0=_[_0x6dc0('0x48')]({},_0x2845c0,_0x3324fa[_0x6dc0('0x49')]);var _0x1b915e={'where':_0x2845c0[_0x6dc0('0x46')]};return db[_0x6dc0('0x39')][_0x6dc0('0x2a')](_0x1b915e)['then'](function(_0x45a4d4){_0x39d2c0[_0x6dc0('0x2a')]=_0x45a4d4;if(_0x3324fa['query']['includeAll']){_0x2845c0['include']=[{'all':!![]}];}return db[_0x6dc0('0x39')]['findAll'](_0x2845c0);})[_0x6dc0('0x1d')](function(_0x5c75e3){_0x39d2c0[_0x6dc0('0x4a')]=_0x5c75e3;return _0x39d2c0;})[_0x6dc0('0x1d')](respondWithFilteredResult(_0x2c8aa8,_0x2845c0))[_0x6dc0('0x4b')](handleError(_0x2c8aa8,null));};exports['show']=function(_0x441b4b,_0x1b318d){var _0x58c9b2={'raw':![],'where':{'id':_0x441b4b[_0x6dc0('0x4c')]['id']}},_0x5ea9f3={};_0x5ea9f3[_0x6dc0('0x3b')]=_[_0x6dc0('0x3d')](db['SugarcrmConfiguration'][_0x6dc0('0x4d')]);_0x5ea9f3[_0x6dc0('0x3c')]=_[_0x6dc0('0x3d')](_0x441b4b[_0x6dc0('0x3c')]);_0x5ea9f3['filters']=_['intersection'](_0x5ea9f3[_0x6dc0('0x3b')],_0x5ea9f3['query']);_0x58c9b2['attributes']=_[_0x6dc0('0x40')](_0x5ea9f3['model'],qs[_0x6dc0('0x41')](_0x441b4b[_0x6dc0('0x3c')]['fields']));_0x58c9b2[_0x6dc0('0x3f')]=_0x58c9b2[_0x6dc0('0x3f')][_0x6dc0('0x4e')]?_0x58c9b2[_0x6dc0('0x3f')]:_0x5ea9f3[_0x6dc0('0x3b')];if(_0x441b4b[_0x6dc0('0x3c')][_0x6dc0('0x4f')]){_0x58c9b2['include']=[{'all':!![]}];}_0x58c9b2=_['merge']({},_0x58c9b2,_0x441b4b[_0x6dc0('0x49')]);return db[_0x6dc0('0x39')]['find'](_0x58c9b2)['then'](handleEntityNotFound(_0x1b318d,null))[_0x6dc0('0x1d')](respondWithResult(_0x1b318d,null))[_0x6dc0('0x4b')](handleError(_0x1b318d,null));};exports[_0x6dc0('0x50')]=function(_0x1ab57a,_0x315443){return db[_0x6dc0('0x39')][_0x6dc0('0x50')](_0x1ab57a[_0x6dc0('0x51')],{})[_0x6dc0('0x1d')](respondWithResult(_0x315443,0xc9))['catch'](handleError(_0x315443,null));};exports['update']=function(_0x5d18b2,_0x489014){if(_0x5d18b2['body']['id']){delete _0x5d18b2[_0x6dc0('0x51')]['id'];}return db[_0x6dc0('0x39')][_0x6dc0('0x52')]({'where':{'id':_0x5d18b2[_0x6dc0('0x4c')]['id']}})[_0x6dc0('0x1d')](handleEntityNotFound(_0x489014,null))[_0x6dc0('0x1d')](saveUpdates(_0x5d18b2[_0x6dc0('0x51')],null))[_0x6dc0('0x1d')](respondWithResult(_0x489014,null))[_0x6dc0('0x4b')](handleError(_0x489014,null));};exports[_0x6dc0('0x33')]=function(_0x472650,_0x5b6945){return db['SugarcrmConfiguration'][_0x6dc0('0x52')]({'where':{'id':_0x472650[_0x6dc0('0x4c')]['id']}})[_0x6dc0('0x1d')](handleEntityNotFound(_0x5b6945,null))['then'](removeEntity(_0x5b6945,null))[_0x6dc0('0x4b')](handleError(_0x5b6945,null));};exports[_0x6dc0('0x53')]=function(_0x1ee8d4,_0x1a5912,_0x1bc069){var _0x122306={};var _0x30e134={};var _0x124616;var _0x885fae;return db[_0x6dc0('0x39')]['findOne']({'where':{'id':_0x1ee8d4[_0x6dc0('0x4c')]['id']}})[_0x6dc0('0x1d')](handleEntityNotFound(_0x1a5912,null))['then'](function(_0x3a9c15){if(_0x3a9c15){_0x124616=_0x3a9c15;_0x30e134[_0x6dc0('0x3b')]=_['keys'](db[_0x6dc0('0x54')]['rawAttributes']);_0x30e134[_0x6dc0('0x3c')]=_[_0x6dc0('0x3d')](_0x1ee8d4[_0x6dc0('0x3c')]);_0x30e134[_0x6dc0('0x3e')]=_[_0x6dc0('0x40')](_0x30e134[_0x6dc0('0x3b')],_0x30e134['query']);_0x122306[_0x6dc0('0x3f')]=_[_0x6dc0('0x40')](_0x30e134['model'],qs['fields'](_0x1ee8d4[_0x6dc0('0x3c')][_0x6dc0('0x41')]));_0x122306[_0x6dc0('0x3f')]=_0x122306[_0x6dc0('0x3f')][_0x6dc0('0x4e')]?_0x122306[_0x6dc0('0x3f')]:_0x30e134[_0x6dc0('0x3b')];_0x122306['order']=qs[_0x6dc0('0x44')](_0x1ee8d4[_0x6dc0('0x3c')][_0x6dc0('0x44')]);_0x122306[_0x6dc0('0x46')]=qs[_0x6dc0('0x3e')](_['pick'](_0x1ee8d4['query'],_0x30e134['filters']));if(_0x1ee8d4[_0x6dc0('0x3c')][_0x6dc0('0x45')]){_0x122306[_0x6dc0('0x46')]=_[_0x6dc0('0x48')](_0x122306[_0x6dc0('0x46')],{'$or':_['map'](_0x122306[_0x6dc0('0x3f')],function(_0xf88283){var _0xc418d5={};_0xc418d5[_0xf88283]={'$like':'%'+_0x1ee8d4[_0x6dc0('0x3c')][_0x6dc0('0x45')]+'%'};return _0xc418d5;})});}_0x122306=_['merge']({},_0x122306,_0x1ee8d4[_0x6dc0('0x49')]);return _0x124616[_0x6dc0('0x53')](_0x122306);}})[_0x6dc0('0x1d')](function(_0x57e72){if(_0x57e72){_0x885fae=_0x57e72[_0x6dc0('0x4e')];if(!_0x1ee8d4[_0x6dc0('0x3c')][_0x6dc0('0x42')](_0x6dc0('0x55'))){_0x122306['limit']=qs[_0x6dc0('0x2c')](_0x1ee8d4[_0x6dc0('0x3c')]['limit']);_0x122306['offset']=qs[_0x6dc0('0x2b')](_0x1ee8d4['query'][_0x6dc0('0x2b')]);}return _0x124616[_0x6dc0('0x53')](_0x122306);}})[_0x6dc0('0x1d')](function(_0x439445){if(_0x439445){return _0x439445?{'count':_0x885fae,'rows':_0x439445}:null;}})[_0x6dc0('0x1d')](respondWithResult(_0x1a5912,null))[_0x6dc0('0x4b')](handleError(_0x1a5912,null));};exports[_0x6dc0('0x56')]=function(_0x2a4c68,_0x99682,_0x19c977){var _0x4873db={};var _0x111870={};var _0xbb733a;var _0x3cb84f;return db[_0x6dc0('0x39')][_0x6dc0('0x57')]({'where':{'id':_0x2a4c68[_0x6dc0('0x4c')]['id']}})[_0x6dc0('0x1d')](handleEntityNotFound(_0x99682,null))[_0x6dc0('0x1d')](function(_0x17aedf){if(_0x17aedf){_0xbb733a=_0x17aedf;_0x111870['model']=_['keys'](db[_0x6dc0('0x54')][_0x6dc0('0x4d')]);_0x111870['query']=_['keys'](_0x2a4c68[_0x6dc0('0x3c')]);_0x111870['filters']=_[_0x6dc0('0x40')](_0x111870[_0x6dc0('0x3b')],_0x111870[_0x6dc0('0x3c')]);_0x4873db['attributes']=_[_0x6dc0('0x40')](_0x111870[_0x6dc0('0x3b')],qs[_0x6dc0('0x41')](_0x2a4c68[_0x6dc0('0x3c')][_0x6dc0('0x41')]));_0x4873db[_0x6dc0('0x3f')]=_0x4873db[_0x6dc0('0x3f')][_0x6dc0('0x4e')]?_0x4873db[_0x6dc0('0x3f')]:_0x111870[_0x6dc0('0x3b')];_0x4873db[_0x6dc0('0x43')]=qs[_0x6dc0('0x44')](_0x2a4c68[_0x6dc0('0x3c')][_0x6dc0('0x44')]);_0x4873db[_0x6dc0('0x46')]=qs['filters'](_[_0x6dc0('0x58')](_0x2a4c68[_0x6dc0('0x3c')],_0x111870['filters']));if(_0x2a4c68[_0x6dc0('0x3c')][_0x6dc0('0x45')]){_0x4873db[_0x6dc0('0x46')]=_['merge'](_0x4873db[_0x6dc0('0x46')],{'$or':_[_0x6dc0('0x38')](_0x4873db[_0x6dc0('0x3f')],function(_0x3ff6e0){var _0xd2c4a0={};_0xd2c4a0[_0x3ff6e0]={'$like':'%'+_0x2a4c68[_0x6dc0('0x3c')][_0x6dc0('0x45')]+'%'};return _0xd2c4a0;})});}_0x4873db=_['merge']({},_0x4873db,_0x2a4c68[_0x6dc0('0x49')]);return _0xbb733a[_0x6dc0('0x56')](_0x4873db);}})[_0x6dc0('0x1d')](function(_0x3d372d){if(_0x3d372d){_0x3cb84f=_0x3d372d[_0x6dc0('0x4e')];if(!_0x2a4c68[_0x6dc0('0x3c')]['hasOwnProperty'](_0x6dc0('0x55'))){_0x4873db[_0x6dc0('0x2c')]=qs['limit'](_0x2a4c68[_0x6dc0('0x3c')][_0x6dc0('0x2c')]);_0x4873db[_0x6dc0('0x2b')]=qs[_0x6dc0('0x2b')](_0x2a4c68[_0x6dc0('0x3c')][_0x6dc0('0x2b')]);}return _0xbb733a[_0x6dc0('0x56')](_0x4873db);}})[_0x6dc0('0x1d')](function(_0x506898){if(_0x506898){return _0x506898?{'count':_0x3cb84f,'rows':_0x506898}:null;}})[_0x6dc0('0x1d')](respondWithResult(_0x99682,null))[_0x6dc0('0x4b')](handleError(_0x99682,null));};exports[_0x6dc0('0x59')]=function(_0x3dd10b,_0x58beb6,_0x37d9ff){var _0x5da1af={};var _0x489278={};var _0x1f87f8;var _0x4760a6;return db[_0x6dc0('0x39')][_0x6dc0('0x57')]({'where':{'id':_0x3dd10b[_0x6dc0('0x4c')]['id']}})[_0x6dc0('0x1d')](handleEntityNotFound(_0x58beb6,null))[_0x6dc0('0x1d')](function(_0x38b2cc){if(_0x38b2cc){_0x1f87f8=_0x38b2cc;_0x489278['model']=_['keys'](db[_0x6dc0('0x54')][_0x6dc0('0x4d')]);_0x489278['query']=_['keys'](_0x3dd10b[_0x6dc0('0x3c')]);_0x489278['filters']=_['intersection'](_0x489278[_0x6dc0('0x3b')],_0x489278[_0x6dc0('0x3c')]);_0x5da1af[_0x6dc0('0x3f')]=_['intersection'](_0x489278[_0x6dc0('0x3b')],qs[_0x6dc0('0x41')](_0x3dd10b[_0x6dc0('0x3c')][_0x6dc0('0x41')]));_0x5da1af[_0x6dc0('0x3f')]=_0x5da1af[_0x6dc0('0x3f')][_0x6dc0('0x4e')]?_0x5da1af['attributes']:_0x489278[_0x6dc0('0x3b')];_0x5da1af[_0x6dc0('0x43')]=qs[_0x6dc0('0x44')](_0x3dd10b[_0x6dc0('0x3c')]['sort']);_0x5da1af[_0x6dc0('0x46')]=qs[_0x6dc0('0x3e')](_[_0x6dc0('0x58')](_0x3dd10b[_0x6dc0('0x3c')],_0x489278['filters']));if(_0x3dd10b[_0x6dc0('0x3c')][_0x6dc0('0x45')]){_0x5da1af[_0x6dc0('0x46')]=_[_0x6dc0('0x48')](_0x5da1af[_0x6dc0('0x46')],{'$or':_['map'](_0x5da1af[_0x6dc0('0x3f')],function(_0x3a8a0a){var _0x41b182={};_0x41b182[_0x3a8a0a]={'$like':'%'+_0x3dd10b[_0x6dc0('0x3c')][_0x6dc0('0x45')]+'%'};return _0x41b182;})});}_0x5da1af=_[_0x6dc0('0x48')]({},_0x5da1af,_0x3dd10b[_0x6dc0('0x49')]);return _0x1f87f8[_0x6dc0('0x59')](_0x5da1af);}})[_0x6dc0('0x1d')](function(_0x312863){if(_0x312863){_0x4760a6=_0x312863[_0x6dc0('0x4e')];if(!_0x3dd10b[_0x6dc0('0x3c')]['hasOwnProperty']('nolimit')){_0x5da1af[_0x6dc0('0x2c')]=qs[_0x6dc0('0x2c')](_0x3dd10b[_0x6dc0('0x3c')][_0x6dc0('0x2c')]);_0x5da1af[_0x6dc0('0x2b')]=qs[_0x6dc0('0x2b')](_0x3dd10b[_0x6dc0('0x3c')]['offset']);}return _0x1f87f8[_0x6dc0('0x59')](_0x5da1af);}})['then'](function(_0x1cd52e){if(_0x1cd52e){return _0x1cd52e?{'count':_0x4760a6,'rows':_0x1cd52e}:null;}})[_0x6dc0('0x1d')](respondWithResult(_0x58beb6,null))[_0x6dc0('0x4b')](handleError(_0x58beb6,null));}; \ No newline at end of file +var _0x2a20=['filters','filter','merge','VIRTUAL','count','includeAll','include','findAll','catch','show','params','options','find','create','body','destroy','getFields','findOne','getSubjects','hasOwnProperty','getDescriptions','SugarcrmField','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','status','end','offset','Content-Range','json','reject','save','update','sendStatus','name','index','SugarcrmConfiguration','rawAttributes','fieldName','key','model','map','keys','intersection','query','fields','attributes','length','nolimit','limit','order','sort','where','pick'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2a20,0x11e));var _0x02a2=function(_0x4d0382,_0x52b330){_0x4d0382=_0x4d0382-0x0;var _0x47b142=_0x2a20[_0x4d0382];return _0x47b142;};'use strict';var pdf=require(_0x02a2('0x0'));var emlformat=require(_0x02a2('0x1'));var rimraf=require(_0x02a2('0x2'));var zipdir=require(_0x02a2('0x3'));var jsonpatch=require(_0x02a2('0x4'));var rp=require(_0x02a2('0x5'));var moment=require(_0x02a2('0x6'));var BPromise=require(_0x02a2('0x7'));var Mustache=require('mustache');var util=require(_0x02a2('0x8'));var path=require(_0x02a2('0x9'));var sox=require(_0x02a2('0xa'));var csv=require(_0x02a2('0xb'));var ejs=require(_0x02a2('0xc'));var fs=require('fs');var _=require(_0x02a2('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x02a2('0xe'));var deskjs=require(_0x02a2('0xf'));var toCsv=require(_0x02a2('0xb'));var querystring=require(_0x02a2('0x10'));var Papa=require(_0x02a2('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x02a2('0x12'));var as=require(_0x02a2('0x13'));var hardwareService=require(_0x02a2('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x02a2('0x15'));var config=require(_0x02a2('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x02a2('0x17'));var client=jayson[_0x02a2('0x18')][_0x02a2('0x19')]({'port':0x232a});function checkPasswordPattern(_0x153bd5,_0x184e4c,_0x18a863){if(_0x18a863){var _0x294767=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x294767[_0x02a2('0x1a')](_0x184e4c)){return _0x153bd5;}else{throw new db[(_0x02a2('0x1b'))]['ValidationError'](_0x02a2('0x1c'));}}else{return _0x153bd5;}}function respondWithRpcPromise(_0x4626fc,_0x3d4728,_0x363b75,_0x41c581){return new BPromise(function(_0x49c41b,_0x331dbf){var _0x50363e=_0x41c581||client;return _0x50363e[_0x02a2('0x1d')](_0x4626fc,_0x363b75)[_0x02a2('0x1e')](function(_0x50dc5d){logger[_0x02a2('0x1f')](_0x02a2('0x20'),_0x3d4728,_0x02a2('0x21'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x3d4728,_0x02a2('0x21'),JSON['stringify'](_0x50dc5d));if(_0x50dc5d['error']){if(_0x50dc5d[_0x02a2('0x22')][_0x02a2('0x23')]===0x1f4){logger[_0x02a2('0x22')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3d4728,_0x50dc5d[_0x02a2('0x22')][_0x02a2('0x24')]);return _0x331dbf(_0x50dc5d[_0x02a2('0x22')][_0x02a2('0x24')]);}logger[_0x02a2('0x22')](_0x02a2('0x20'),_0x3d4728,_0x50dc5d['error'][_0x02a2('0x24')]);return _0x49c41b(_0x50dc5d['error'][_0x02a2('0x24')]);}else{logger[_0x02a2('0x1f')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3d4728,_0x02a2('0x21'));_0x49c41b(_0x50dc5d['result'][_0x02a2('0x24')]);}})['catch'](function(_0x3b340f){logger[_0x02a2('0x22')](_0x02a2('0x20'),_0x3d4728,_0x3b340f);_0x331dbf(_0x3b340f);});});}function respondWithStatusCode(_0x4c16c4,_0x357a69){_0x357a69=_0x357a69||0xcc;return function(_0x4a6139){if(_0x4a6139){return _0x4c16c4['sendStatus'](_0x357a69);}return _0x4c16c4[_0x02a2('0x25')](_0x357a69)[_0x02a2('0x26')]();};}function respondWithResult(_0x5390d5,_0x4223a9){_0x4223a9=_0x4223a9||0xc8;return function(_0x1c21f5){if(_0x1c21f5){return _0x5390d5[_0x02a2('0x25')](_0x4223a9)['json'](_0x1c21f5);}};}function respondWithFilteredResult(_0x1c06ef,_0x532800){return function(_0x1647eb){if(_0x1647eb){var _0x152798=_0x1647eb['count'],_0x4e6ae8=_0x532800[_0x02a2('0x27')],_0xcbcee9=_0x532800[_0x02a2('0x27')]+_0x532800['limit'],_0x4afab4;if(_0xcbcee9>=_0x152798){_0xcbcee9=_0x152798;_0x4afab4=0xc8;}else{_0x4afab4=0xce;}_0x1c06ef['status'](_0x4afab4);return _0x1c06ef['set'](_0x02a2('0x28'),_0x4e6ae8+'-'+_0xcbcee9+'/'+_0x152798)[_0x02a2('0x29')](_0x1647eb);}return null;};}function patchUpdates(_0x5046be){return function(_0x33c8fe){try{jsonpatch['apply'](_0x33c8fe,_0x5046be,!![]);}catch(_0x239e31){return BPromise[_0x02a2('0x2a')](_0x239e31);}return _0x33c8fe[_0x02a2('0x2b')]();};}function saveUpdates(_0x33c924,_0x1bce6c){return function(_0x45469f){if(_0x45469f){return _0x45469f[_0x02a2('0x2c')](_0x33c924)['then'](function(_0x4e7703){return _0x4e7703;});}return null;};}function removeEntity(_0x52a676,_0x2d2695){return function(_0x456c06){if(_0x456c06){return _0x456c06['destroy']()[_0x02a2('0x1e')](function(){_0x52a676[_0x02a2('0x25')](0xcc)[_0x02a2('0x26')]();});}};}function handleEntityNotFound(_0x2de9bf,_0x128fb8){return function(_0x2affb8){if(!_0x2affb8){_0x2de9bf[_0x02a2('0x2d')](0x194);}return _0x2affb8;};}function handleError(_0x1b7531,_0x5c1ab7){_0x5c1ab7=_0x5c1ab7||0x1f4;return function(_0x57f930){logger['error'](_0x57f930['stack']);if(_0x57f930['name']){delete _0x57f930[_0x02a2('0x2e')];}_0x1b7531[_0x02a2('0x25')](_0x5c1ab7)['send'](_0x57f930);};}exports[_0x02a2('0x2f')]=function(_0x5f1791,_0x43a4b9){var _0xfa13bc={},_0xf08e1e={},_0x197041={'count':0x0,'rows':[]};var _0x1f86e9=_['map'](db[_0x02a2('0x30')][_0x02a2('0x31')],function(_0x16c272){return{'name':_0x16c272[_0x02a2('0x32')],'type':_0x16c272['type'][_0x02a2('0x33')]};});_0xf08e1e[_0x02a2('0x34')]=_[_0x02a2('0x35')](_0x1f86e9,'name');_0xf08e1e['query']=_[_0x02a2('0x36')](_0x5f1791['query']);_0xf08e1e['filters']=_[_0x02a2('0x37')](_0xf08e1e['model'],_0xf08e1e[_0x02a2('0x38')]);_0xfa13bc['attributes']=_[_0x02a2('0x37')](_0xf08e1e['model'],qs[_0x02a2('0x39')](_0x5f1791[_0x02a2('0x38')]['fields']));_0xfa13bc[_0x02a2('0x3a')]=_0xfa13bc[_0x02a2('0x3a')][_0x02a2('0x3b')]?_0xfa13bc[_0x02a2('0x3a')]:_0xf08e1e[_0x02a2('0x34')];if(!_0x5f1791['query']['hasOwnProperty'](_0x02a2('0x3c'))){_0xfa13bc[_0x02a2('0x3d')]=qs['limit'](_0x5f1791[_0x02a2('0x38')][_0x02a2('0x3d')]);_0xfa13bc[_0x02a2('0x27')]=qs[_0x02a2('0x27')](_0x5f1791['query'][_0x02a2('0x27')]);}_0xfa13bc[_0x02a2('0x3e')]=qs['sort'](_0x5f1791[_0x02a2('0x38')][_0x02a2('0x3f')]);_0xfa13bc[_0x02a2('0x40')]=qs['filters'](_[_0x02a2('0x41')](_0x5f1791[_0x02a2('0x38')],_0xf08e1e[_0x02a2('0x42')]));if(_0x5f1791[_0x02a2('0x38')][_0x02a2('0x43')]){_0xfa13bc[_0x02a2('0x40')]=_[_0x02a2('0x44')](_0xfa13bc[_0x02a2('0x40')],{'$or':_[_0x02a2('0x35')](_0x1f86e9,function(_0x47af27){if(_0x47af27['type']!==_0x02a2('0x45')){var _0x7ada07={};_0x7ada07[_0x47af27[_0x02a2('0x2e')]]={'$like':'%'+_0x5f1791['query'][_0x02a2('0x43')]+'%'};return _0x7ada07;}})});}_0xfa13bc=_['merge']({},_0xfa13bc,_0x5f1791['options']);var _0x15e598={'where':_0xfa13bc['where']};return db[_0x02a2('0x30')][_0x02a2('0x46')](_0x15e598)[_0x02a2('0x1e')](function(_0x1e96e9){_0x197041[_0x02a2('0x46')]=_0x1e96e9;if(_0x5f1791[_0x02a2('0x38')][_0x02a2('0x47')]){_0xfa13bc[_0x02a2('0x48')]=[{'all':!![]}];}return db[_0x02a2('0x30')][_0x02a2('0x49')](_0xfa13bc);})['then'](function(_0x2a541a){_0x197041['rows']=_0x2a541a;return _0x197041;})[_0x02a2('0x1e')](respondWithFilteredResult(_0x43a4b9,_0xfa13bc))[_0x02a2('0x4a')](handleError(_0x43a4b9,null));};exports[_0x02a2('0x4b')]=function(_0x559907,_0x1a034d){var _0x834eeb={'raw':![],'where':{'id':_0x559907[_0x02a2('0x4c')]['id']}},_0x42c087={};_0x42c087[_0x02a2('0x34')]=_[_0x02a2('0x36')](db[_0x02a2('0x30')][_0x02a2('0x31')]);_0x42c087[_0x02a2('0x38')]=_[_0x02a2('0x36')](_0x559907['query']);_0x42c087[_0x02a2('0x42')]=_[_0x02a2('0x37')](_0x42c087[_0x02a2('0x34')],_0x42c087[_0x02a2('0x38')]);_0x834eeb[_0x02a2('0x3a')]=_[_0x02a2('0x37')](_0x42c087['model'],qs[_0x02a2('0x39')](_0x559907[_0x02a2('0x38')][_0x02a2('0x39')]));_0x834eeb[_0x02a2('0x3a')]=_0x834eeb['attributes']['length']?_0x834eeb[_0x02a2('0x3a')]:_0x42c087[_0x02a2('0x34')];if(_0x559907['query'][_0x02a2('0x47')]){_0x834eeb[_0x02a2('0x48')]=[{'all':!![]}];}_0x834eeb=_['merge']({},_0x834eeb,_0x559907[_0x02a2('0x4d')]);return db[_0x02a2('0x30')][_0x02a2('0x4e')](_0x834eeb)[_0x02a2('0x1e')](handleEntityNotFound(_0x1a034d,null))[_0x02a2('0x1e')](respondWithResult(_0x1a034d,null))[_0x02a2('0x4a')](handleError(_0x1a034d,null));};exports[_0x02a2('0x4f')]=function(_0x1cab2c,_0x581600){return db[_0x02a2('0x30')][_0x02a2('0x4f')](_0x1cab2c[_0x02a2('0x50')],{})[_0x02a2('0x1e')](respondWithResult(_0x581600,0xc9))[_0x02a2('0x4a')](handleError(_0x581600,null));};exports['update']=function(_0x256e97,_0x2045bb){if(_0x256e97['body']['id']){delete _0x256e97[_0x02a2('0x50')]['id'];}return db[_0x02a2('0x30')][_0x02a2('0x4e')]({'where':{'id':_0x256e97[_0x02a2('0x4c')]['id']}})[_0x02a2('0x1e')](handleEntityNotFound(_0x2045bb,null))[_0x02a2('0x1e')](saveUpdates(_0x256e97[_0x02a2('0x50')],null))[_0x02a2('0x1e')](respondWithResult(_0x2045bb,null))['catch'](handleError(_0x2045bb,null));};exports[_0x02a2('0x51')]=function(_0x1df68a,_0x44a857){return db[_0x02a2('0x30')][_0x02a2('0x4e')]({'where':{'id':_0x1df68a[_0x02a2('0x4c')]['id']}})[_0x02a2('0x1e')](handleEntityNotFound(_0x44a857,null))[_0x02a2('0x1e')](removeEntity(_0x44a857,null))[_0x02a2('0x4a')](handleError(_0x44a857,null));};exports[_0x02a2('0x52')]=function(_0x3002a9,_0x3bd217,_0x2e9b46){var _0x240dc7={};var _0x4f7efb={};var _0x2da2c3;var _0x39060f;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x3002a9['params']['id']}})['then'](handleEntityNotFound(_0x3bd217,null))[_0x02a2('0x1e')](function(_0x429d38){if(_0x429d38){_0x2da2c3=_0x429d38;_0x4f7efb[_0x02a2('0x34')]=_[_0x02a2('0x36')](db['SugarcrmField'][_0x02a2('0x31')]);_0x4f7efb[_0x02a2('0x38')]=_[_0x02a2('0x36')](_0x3002a9[_0x02a2('0x38')]);_0x4f7efb[_0x02a2('0x42')]=_['intersection'](_0x4f7efb[_0x02a2('0x34')],_0x4f7efb[_0x02a2('0x38')]);_0x240dc7[_0x02a2('0x3a')]=_[_0x02a2('0x37')](_0x4f7efb[_0x02a2('0x34')],qs[_0x02a2('0x39')](_0x3002a9['query'][_0x02a2('0x39')]));_0x240dc7[_0x02a2('0x3a')]=_0x240dc7[_0x02a2('0x3a')]['length']?_0x240dc7[_0x02a2('0x3a')]:_0x4f7efb[_0x02a2('0x34')];_0x240dc7[_0x02a2('0x3e')]=qs[_0x02a2('0x3f')](_0x3002a9[_0x02a2('0x38')][_0x02a2('0x3f')]);_0x240dc7[_0x02a2('0x40')]=qs['filters'](_[_0x02a2('0x41')](_0x3002a9[_0x02a2('0x38')],_0x4f7efb[_0x02a2('0x42')]));if(_0x3002a9['query'][_0x02a2('0x43')]){_0x240dc7[_0x02a2('0x40')]=_['merge'](_0x240dc7[_0x02a2('0x40')],{'$or':_['map'](_0x240dc7[_0x02a2('0x3a')],function(_0x5a2a1e){var _0x33a7df={};_0x33a7df[_0x5a2a1e]={'$like':'%'+_0x3002a9[_0x02a2('0x38')][_0x02a2('0x43')]+'%'};return _0x33a7df;})});}_0x240dc7=_[_0x02a2('0x44')]({},_0x240dc7,_0x3002a9['options']);return _0x2da2c3['getFields'](_0x240dc7);}})[_0x02a2('0x1e')](function(_0xfeeec0){if(_0xfeeec0){_0x39060f=_0xfeeec0['length'];if(!_0x3002a9[_0x02a2('0x38')]['hasOwnProperty'](_0x02a2('0x3c'))){_0x240dc7[_0x02a2('0x3d')]=qs[_0x02a2('0x3d')](_0x3002a9['query'][_0x02a2('0x3d')]);_0x240dc7['offset']=qs[_0x02a2('0x27')](_0x3002a9[_0x02a2('0x38')]['offset']);}return _0x2da2c3[_0x02a2('0x52')](_0x240dc7);}})[_0x02a2('0x1e')](function(_0x4817e6){if(_0x4817e6){return _0x4817e6?{'count':_0x39060f,'rows':_0x4817e6}:null;}})['then'](respondWithResult(_0x3bd217,null))[_0x02a2('0x4a')](handleError(_0x3bd217,null));};exports['getSubjects']=function(_0x18d2fb,_0x18f135,_0x41ee29){var _0x3ecd2d={};var _0x40d74d={};var _0x126773;var _0x1a38d7;return db['SugarcrmConfiguration'][_0x02a2('0x53')]({'where':{'id':_0x18d2fb[_0x02a2('0x4c')]['id']}})[_0x02a2('0x1e')](handleEntityNotFound(_0x18f135,null))[_0x02a2('0x1e')](function(_0x33a10c){if(_0x33a10c){_0x126773=_0x33a10c;_0x40d74d[_0x02a2('0x34')]=_[_0x02a2('0x36')](db['SugarcrmField'][_0x02a2('0x31')]);_0x40d74d[_0x02a2('0x38')]=_['keys'](_0x18d2fb[_0x02a2('0x38')]);_0x40d74d['filters']=_[_0x02a2('0x37')](_0x40d74d['model'],_0x40d74d[_0x02a2('0x38')]);_0x3ecd2d[_0x02a2('0x3a')]=_['intersection'](_0x40d74d[_0x02a2('0x34')],qs['fields'](_0x18d2fb[_0x02a2('0x38')]['fields']));_0x3ecd2d[_0x02a2('0x3a')]=_0x3ecd2d[_0x02a2('0x3a')]['length']?_0x3ecd2d[_0x02a2('0x3a')]:_0x40d74d['model'];_0x3ecd2d[_0x02a2('0x3e')]=qs[_0x02a2('0x3f')](_0x18d2fb[_0x02a2('0x38')]['sort']);_0x3ecd2d[_0x02a2('0x40')]=qs['filters'](_[_0x02a2('0x41')](_0x18d2fb[_0x02a2('0x38')],_0x40d74d[_0x02a2('0x42')]));if(_0x18d2fb[_0x02a2('0x38')][_0x02a2('0x43')]){_0x3ecd2d[_0x02a2('0x40')]=_[_0x02a2('0x44')](_0x3ecd2d[_0x02a2('0x40')],{'$or':_['map'](_0x3ecd2d[_0x02a2('0x3a')],function(_0x59a1b5){var _0x4d7120={};_0x4d7120[_0x59a1b5]={'$like':'%'+_0x18d2fb[_0x02a2('0x38')][_0x02a2('0x43')]+'%'};return _0x4d7120;})});}_0x3ecd2d=_[_0x02a2('0x44')]({},_0x3ecd2d,_0x18d2fb[_0x02a2('0x4d')]);return _0x126773[_0x02a2('0x54')](_0x3ecd2d);}})['then'](function(_0x4f1e8f){if(_0x4f1e8f){_0x1a38d7=_0x4f1e8f['length'];if(!_0x18d2fb['query'][_0x02a2('0x55')](_0x02a2('0x3c'))){_0x3ecd2d[_0x02a2('0x3d')]=qs['limit'](_0x18d2fb[_0x02a2('0x38')][_0x02a2('0x3d')]);_0x3ecd2d[_0x02a2('0x27')]=qs[_0x02a2('0x27')](_0x18d2fb['query'][_0x02a2('0x27')]);}return _0x126773[_0x02a2('0x54')](_0x3ecd2d);}})['then'](function(_0x1d6612){if(_0x1d6612){return _0x1d6612?{'count':_0x1a38d7,'rows':_0x1d6612}:null;}})[_0x02a2('0x1e')](respondWithResult(_0x18f135,null))['catch'](handleError(_0x18f135,null));};exports[_0x02a2('0x56')]=function(_0x5cbcc9,_0x569e6d,_0x18a9ee){var _0x28fb43={};var _0xbce9a4={};var _0x1f9ca5;var _0x3831d2;return db['SugarcrmConfiguration'][_0x02a2('0x53')]({'where':{'id':_0x5cbcc9['params']['id']}})[_0x02a2('0x1e')](handleEntityNotFound(_0x569e6d,null))['then'](function(_0x5d2eec){if(_0x5d2eec){_0x1f9ca5=_0x5d2eec;_0xbce9a4[_0x02a2('0x34')]=_[_0x02a2('0x36')](db[_0x02a2('0x57')]['rawAttributes']);_0xbce9a4['query']=_[_0x02a2('0x36')](_0x5cbcc9['query']);_0xbce9a4['filters']=_[_0x02a2('0x37')](_0xbce9a4[_0x02a2('0x34')],_0xbce9a4[_0x02a2('0x38')]);_0x28fb43['attributes']=_[_0x02a2('0x37')](_0xbce9a4['model'],qs[_0x02a2('0x39')](_0x5cbcc9['query'][_0x02a2('0x39')]));_0x28fb43[_0x02a2('0x3a')]=_0x28fb43[_0x02a2('0x3a')][_0x02a2('0x3b')]?_0x28fb43[_0x02a2('0x3a')]:_0xbce9a4[_0x02a2('0x34')];_0x28fb43[_0x02a2('0x3e')]=qs['sort'](_0x5cbcc9[_0x02a2('0x38')][_0x02a2('0x3f')]);_0x28fb43[_0x02a2('0x40')]=qs[_0x02a2('0x42')](_[_0x02a2('0x41')](_0x5cbcc9[_0x02a2('0x38')],_0xbce9a4[_0x02a2('0x42')]));if(_0x5cbcc9['query'][_0x02a2('0x43')]){_0x28fb43[_0x02a2('0x40')]=_['merge'](_0x28fb43[_0x02a2('0x40')],{'$or':_[_0x02a2('0x35')](_0x28fb43['attributes'],function(_0x314dd0){var _0x3ee8ce={};_0x3ee8ce[_0x314dd0]={'$like':'%'+_0x5cbcc9[_0x02a2('0x38')]['filter']+'%'};return _0x3ee8ce;})});}_0x28fb43=_[_0x02a2('0x44')]({},_0x28fb43,_0x5cbcc9[_0x02a2('0x4d')]);return _0x1f9ca5[_0x02a2('0x56')](_0x28fb43);}})[_0x02a2('0x1e')](function(_0x4c5b14){if(_0x4c5b14){_0x3831d2=_0x4c5b14[_0x02a2('0x3b')];if(!_0x5cbcc9[_0x02a2('0x38')]['hasOwnProperty'](_0x02a2('0x3c'))){_0x28fb43[_0x02a2('0x3d')]=qs['limit'](_0x5cbcc9['query'][_0x02a2('0x3d')]);_0x28fb43[_0x02a2('0x27')]=qs['offset'](_0x5cbcc9[_0x02a2('0x38')][_0x02a2('0x27')]);}return _0x1f9ca5[_0x02a2('0x56')](_0x28fb43);}})[_0x02a2('0x1e')](function(_0x3a7e2a){if(_0x3a7e2a){return _0x3a7e2a?{'count':_0x3831d2,'rows':_0x3a7e2a}:null;}})[_0x02a2('0x1e')](respondWithResult(_0x569e6d,null))[_0x02a2('0x4a')](handleError(_0x569e6d,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 65bfa63..5e782ba 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 _0xb3c1=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','int_sugarcrm_configurations','util'];(function(_0x59f7b8,_0xb2ac21){var _0x7b28c5=function(_0x427d2d){while(--_0x427d2d){_0x59f7b8['push'](_0x59f7b8['shift']());}};_0x7b28c5(++_0xb2ac21);}(_0xb3c1,0x1af));var _0x1b3c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb3c1[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x1b3c('0x0'));var logger=require(_0x1b3c('0x1'))(_0x1b3c('0x2'));var moment=require(_0x1b3c('0x3'));var BPromise=require(_0x1b3c('0x4'));var rp=require(_0x1b3c('0x5'));var fs=require('fs');var path=require(_0x1b3c('0x6'));var rimraf=require(_0x1b3c('0x7'));var config=require(_0x1b3c('0x8'));var attributes=require(_0x1b3c('0x9'));module['exports']=function(_0x205f3b,_0x5d7248){return _0x205f3b[_0x1b3c('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0x1b3c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3332=['bluebird','path','rimraf','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3332,0x1eb));var _0x2333=function(_0x248f6b,_0x401324){_0x248f6b=_0x248f6b-0x0;var _0x54b829=_0x3332[_0x248f6b];return _0x54b829;};'use strict';var _=require(_0x2333('0x0'));var util=require(_0x2333('0x1'));var logger=require('../../config/logger')(_0x2333('0x2'));var moment=require(_0x2333('0x3'));var BPromise=require(_0x2333('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2333('0x5'));var rimraf=require(_0x2333('0x6'));var config=require('../../config/environment');var attributes=require(_0x2333('0x7'));module['exports']=function(_0x44d9f1,_0x399023){return _0x44d9f1[_0x2333('0x8')](_0x2333('0x9'),attributes,{'tableName':_0x2333('0xa'),'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 f11547b..8b833ab 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 _0x0bba=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x0bba,0x8b));var _0xa0bb=function(_0x394495,_0x3f4435){_0x394495=_0x394495-0x0;var _0x43444e=_0x0bba[_0x394495];return _0x43444e;};'use strict';var _=require('lodash');var util=require(_0xa0bb('0x0'));var moment=require('moment');var BPromise=require(_0xa0bb('0x1'));var rs=require(_0xa0bb('0x2'));var fs=require('fs');var Redis=require(_0xa0bb('0x3'));var db=require(_0xa0bb('0x4'))['db'];var utils=require(_0xa0bb('0x5'));var logger=require(_0xa0bb('0x6'))(_0xa0bb('0x7'));var config=require(_0xa0bb('0x8'));var jayson=require(_0xa0bb('0x9'));var client=jayson[_0xa0bb('0xa')][_0xa0bb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x951ac6,_0x1d9a15,_0x3a2d0d){return new BPromise(function(_0x1521f2,_0x2fd2f2){return client[_0xa0bb('0xc')](_0x951ac6,_0x3a2d0d)[_0xa0bb('0xd')](function(_0x2a321d){logger[_0xa0bb('0xe')](_0xa0bb('0xf'),_0x1d9a15,_0xa0bb('0x10'));logger[_0xa0bb('0x11')](_0xa0bb('0x12'),_0x1d9a15,'request\x20sent',JSON[_0xa0bb('0x13')](_0x2a321d));if(_0x2a321d[_0xa0bb('0x14')]){if(_0x2a321d[_0xa0bb('0x14')][_0xa0bb('0x15')]===0x1f4){logger[_0xa0bb('0x14')](_0xa0bb('0xf'),_0x1d9a15,_0x2a321d[_0xa0bb('0x14')][_0xa0bb('0x16')]);return _0x2fd2f2(_0x2a321d[_0xa0bb('0x14')][_0xa0bb('0x16')]);}logger[_0xa0bb('0x14')](_0xa0bb('0xf'),_0x1d9a15,_0x2a321d[_0xa0bb('0x14')][_0xa0bb('0x16')]);return _0x1521f2(_0x2a321d[_0xa0bb('0x14')]['message']);}else{logger[_0xa0bb('0xe')](_0xa0bb('0xf'),_0x1d9a15,_0xa0bb('0x10'));_0x1521f2(_0x2a321d['result']['message']);}})[_0xa0bb('0x17')](function(_0xc4d681){logger[_0xa0bb('0x14')](_0xa0bb('0xf'),_0x1d9a15,_0xc4d681);_0x2fd2f2(_0xc4d681);});});} \ No newline at end of file +var _0xe70f=['jayson/promise','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x5713cc,_0x4a2b98){var _0x23f4cf=function(_0x1eb817){while(--_0x1eb817){_0x5713cc['push'](_0x5713cc['shift']());}};_0x23f4cf(++_0x4a2b98);}(_0xe70f,0x1de));var _0xfe70=function(_0x11d3af,_0x3b5df8){_0x11d3af=_0x11d3af-0x0;var _0x43700c=_0xe70f[_0x11d3af];return _0x43700c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfe70('0x0'));var BPromise=require(_0xfe70('0x1'));var rs=require(_0xfe70('0x2'));var fs=require('fs');var Redis=require(_0xfe70('0x3'));var db=require(_0xfe70('0x4'))['db'];var utils=require(_0xfe70('0x5'));var logger=require(_0xfe70('0x6'))('rpc');var config=require(_0xfe70('0x7'));var jayson=require(_0xfe70('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1b4739,_0x503e8b,_0x3ddcb1){return new BPromise(function(_0x34d321,_0x419788){return client['request'](_0x1b4739,_0x3ddcb1)[_0xfe70('0x9')](function(_0x318b60){logger[_0xfe70('0xa')](_0xfe70('0xb'),_0x503e8b,_0xfe70('0xc'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x503e8b,'request\x20sent',JSON['stringify'](_0x318b60));if(_0x318b60[_0xfe70('0xd')]){if(_0x318b60[_0xfe70('0xd')][_0xfe70('0xe')]===0x1f4){logger[_0xfe70('0xd')](_0xfe70('0xb'),_0x503e8b,_0x318b60['error'][_0xfe70('0xf')]);return _0x419788(_0x318b60['error'][_0xfe70('0xf')]);}logger[_0xfe70('0xd')](_0xfe70('0xb'),_0x503e8b,_0x318b60[_0xfe70('0xd')]['message']);return _0x34d321(_0x318b60[_0xfe70('0xd')][_0xfe70('0xf')]);}else{logger[_0xfe70('0xa')](_0xfe70('0xb'),_0x503e8b,_0xfe70('0xc'));_0x34d321(_0x318b60[_0xfe70('0x10')]['message']);}})[_0xfe70('0x11')](function(_0x1821c6){logger[_0xfe70('0xd')](_0xfe70('0xb'),_0x503e8b,_0x1821c6);_0x419788(_0x1821c6);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index eb0c6da..df45b59 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 _0x0bb6=['connect-timeout','Router','../../components/auth/service','./intSugarcrmField.controller','isAuthenticated','get','/:id','show','create','destroy','exports','path'];(function(_0x533e1c,_0x3b7a0f){var _0x5087a9=function(_0x2ae7e2){while(--_0x2ae7e2){_0x533e1c['push'](_0x533e1c['shift']());}};_0x5087a9(++_0x3b7a0f);}(_0x0bb6,0x1eb));var _0x60bb=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0bb6[_0x4a9fb1];return _0x348672;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x60bb('0x0'));var timeout=require(_0x60bb('0x1'));var express=require('express');var router=express[_0x60bb('0x2')]();var auth=require(_0x60bb('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x60bb('0x4'));router['get']('/',auth[_0x60bb('0x5')](),controller['index']);router[_0x60bb('0x6')](_0x60bb('0x7'),auth['isAuthenticated'](),controller[_0x60bb('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0x60bb('0x9')]);router['put'](_0x60bb('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x60bb('0x7'),auth[_0x60bb('0x5')](),controller[_0x60bb('0xa')]);module[_0x60bb('0xb')]=router; \ No newline at end of file +var _0x80d9=['../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5c38cd,_0x5a6b4e){var _0xc985ef=function(_0x4aa1df){while(--_0x4aa1df){_0x5c38cd['push'](_0x5c38cd['shift']());}};_0xc985ef(++_0x5a6b4e);}(_0x80d9,0x13c));var _0x980d=function(_0x15a2d0,_0x1522ec){_0x15a2d0=_0x15a2d0-0x0;var _0x4d27df=_0x80d9[_0x15a2d0];return _0x4d27df;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x980d('0x0'));var express=require(_0x980d('0x1'));var router=express[_0x980d('0x2')]();var auth=require(_0x980d('0x3'));var interaction=require(_0x980d('0x4'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0x980d('0x5')]('/',auth[_0x980d('0x6')](),controller[_0x980d('0x7')]);router[_0x980d('0x5')](_0x980d('0x8'),auth['isAuthenticated'](),controller[_0x980d('0x9')]);router[_0x980d('0xa')]('/',auth[_0x980d('0x6')](),controller[_0x980d('0xb')]);router['put'](_0x980d('0x8'),auth[_0x980d('0x6')](),controller[_0x980d('0xc')]);router[_0x980d('0xd')](_0x980d('0x8'),auth[_0x980d('0x6')](),controller[_0x980d('0xe')]);module[_0x980d('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index f1e1696..584fe4b 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 _0x3074=['variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','ENUM','string'];(function(_0x856e14,_0x101189){var _0xb0739f=function(_0x40ef0e){while(--_0x40ef0e){_0x856e14['push'](_0x856e14['shift']());}};_0xb0739f(++_0x101189);}(_0x3074,0x1dd));var _0x4307=function(_0xcfac7,_0x32de55){_0xcfac7=_0xcfac7-0x0;var _0x249a0f=_0x3074[_0xcfac7];return _0x249a0f;};'use strict';var Sequelize=require(_0x4307('0x0'));module['exports']={'type':{'type':Sequelize[_0x4307('0x1')](_0x4307('0x2'),_0x4307('0x3'),'customVariable',_0x4307('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4307('0x5')]},'key':{'type':Sequelize[_0x4307('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x4307('0x2'),_0x4307('0x3'),_0x4307('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4307('0x5')]},'nameField':{'type':Sequelize[_0x4307('0x5')]},'customField':{'type':Sequelize[_0x4307('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4307('0x5')]}}; \ No newline at end of file +var _0xde6c=['ENUM','sequelize','exports','string','variable','customVariable','keyValue','STRING'];(function(_0x5b1770,_0x1eb404){var _0x47e838=function(_0x473e35){while(--_0x473e35){_0x5b1770['push'](_0x5b1770['shift']());}};_0x47e838(++_0x1eb404);}(_0xde6c,0x119));var _0xcde6=function(_0x2c93e2,_0x4fb5e2){_0x2c93e2=_0x2c93e2-0x0;var _0x57264e=_0xde6c[_0x2c93e2];return _0x57264e;};'use strict';var Sequelize=require(_0xcde6('0x0'));module[_0xcde6('0x1')]={'type':{'type':Sequelize['ENUM'](_0xcde6('0x2'),_0xcde6('0x3'),_0xcde6('0x4'),_0xcde6('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xcde6('0x6')]},'key':{'type':Sequelize[_0xcde6('0x6')]},'keyType':{'type':Sequelize[_0xcde6('0x7')]('string',_0xcde6('0x3'),_0xcde6('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xcde6('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcde6('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index f66ac2a..f284156 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 _0xb593=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','send','map','SugarcrmField','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5a3d10,_0x578433){var _0x4f36d5=function(_0xfbe2d9){while(--_0xfbe2d9){_0x5a3d10['push'](_0x5a3d10['shift']());}};_0x4f36d5(++_0x578433);}(_0xb593,0x1e9));var _0x3b59=function(_0x52ac91,_0x5e1bfc){_0x52ac91=_0x52ac91-0x0;var _0x5abb38=_0xb593[_0x52ac91];return _0x5abb38;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3b59('0x0'));var rimraf=require(_0x3b59('0x1'));var zipdir=require(_0x3b59('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b59('0x3'));var moment=require(_0x3b59('0x4'));var BPromise=require(_0x3b59('0x5'));var Mustache=require(_0x3b59('0x6'));var util=require('util');var path=require(_0x3b59('0x7'));var sox=require(_0x3b59('0x8'));var csv=require(_0x3b59('0x9'));var ejs=require(_0x3b59('0xa'));var fs=require('fs');var _=require(_0x3b59('0xb'));var squel=require(_0x3b59('0xc'));var crypto=require(_0x3b59('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3b59('0x9'));var querystring=require(_0x3b59('0xe'));var Papa=require(_0x3b59('0xf'));var Redis=require(_0x3b59('0x10'));var authService=require(_0x3b59('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3b59('0x12'));var hardwareService=require(_0x3b59('0x13'));var logger=require(_0x3b59('0x14'))(_0x3b59('0x15'));var utils=require(_0x3b59('0x16'));var config=require(_0x3b59('0x17'));var db=require(_0x3b59('0x18'))['db'];function respondWithStatusCode(_0x129534,_0x3c13f6){_0x3c13f6=_0x3c13f6||0xcc;return function(_0x31c167){if(_0x31c167){return _0x129534[_0x3b59('0x19')](_0x3c13f6);}return _0x129534[_0x3b59('0x1a')](_0x3c13f6)[_0x3b59('0x1b')]();};}function respondWithResult(_0x2092d9,_0x1bff8a){_0x1bff8a=_0x1bff8a||0xc8;return function(_0x459ab7){if(_0x459ab7){return _0x2092d9[_0x3b59('0x1a')](_0x1bff8a)[_0x3b59('0x1c')](_0x459ab7);}};}function respondWithFilteredResult(_0x1bf323,_0x1f2bfa){return function(_0x1b42ce){if(_0x1b42ce){var _0x48313d=_0x1b42ce['count'],_0x389f96=_0x1f2bfa[_0x3b59('0x1d')],_0x265182=_0x1f2bfa[_0x3b59('0x1d')]+_0x1f2bfa['limit'],_0x509af7;if(_0x265182>=_0x48313d){_0x265182=_0x48313d;_0x509af7=0xc8;}else{_0x509af7=0xce;}_0x1bf323[_0x3b59('0x1a')](_0x509af7);return _0x1bf323[_0x3b59('0x1e')](_0x3b59('0x1f'),_0x389f96+'-'+_0x265182+'/'+_0x48313d)[_0x3b59('0x1c')](_0x1b42ce);}return null;};}function patchUpdates(_0x270aa7){return function(_0x24972f){try{jsonpatch[_0x3b59('0x20')](_0x24972f,_0x270aa7,!![]);}catch(_0x3acb55){return BPromise[_0x3b59('0x21')](_0x3acb55);}return _0x24972f[_0x3b59('0x22')]();};}function saveUpdates(_0x3bdcf3,_0x2dde99){return function(_0x3b8c20){if(_0x3b8c20){return _0x3b8c20[_0x3b59('0x23')](_0x3bdcf3)['then'](function(_0xba80d1){return _0xba80d1;});}return null;};}function removeEntity(_0x4bdc62,_0x9bfa74){return function(_0x2b8d6e){if(_0x2b8d6e){return _0x2b8d6e[_0x3b59('0x24')]()[_0x3b59('0x25')](function(){_0x4bdc62[_0x3b59('0x1a')](0xcc)[_0x3b59('0x1b')]();});}};}function handleEntityNotFound(_0x2fac5a,_0x316400){return function(_0x246901){if(!_0x246901){_0x2fac5a[_0x3b59('0x19')](0x194);}return _0x246901;};}function handleError(_0x5a5506,_0x27f51e){_0x27f51e=_0x27f51e||0x1f4;return function(_0x28c2d5){logger[_0x3b59('0x26')](_0x28c2d5[_0x3b59('0x27')]);if(_0x28c2d5['name']){delete _0x28c2d5['name'];}_0x5a5506[_0x3b59('0x1a')](_0x27f51e)[_0x3b59('0x28')](_0x28c2d5);};}exports['index']=function(_0x65c8dc,_0xc96a83){var _0x57e330={},_0x4d9067={},_0x4d6f5f={'count':0x0,'rows':[]};var _0x20d0a0=_[_0x3b59('0x29')](db[_0x3b59('0x2a')]['rawAttributes'],function(_0x4893ab){return{'name':_0x4893ab[_0x3b59('0x2b')],'type':_0x4893ab[_0x3b59('0x2c')]['key']};});_0x4d9067[_0x3b59('0x2d')]=_[_0x3b59('0x29')](_0x20d0a0,'name');_0x4d9067[_0x3b59('0x2e')]=_[_0x3b59('0x2f')](_0x65c8dc[_0x3b59('0x2e')]);_0x4d9067[_0x3b59('0x30')]=_[_0x3b59('0x31')](_0x4d9067[_0x3b59('0x2d')],_0x4d9067[_0x3b59('0x2e')]);_0x57e330[_0x3b59('0x32')]=_[_0x3b59('0x31')](_0x4d9067[_0x3b59('0x2d')],qs[_0x3b59('0x33')](_0x65c8dc[_0x3b59('0x2e')][_0x3b59('0x33')]));_0x57e330['attributes']=_0x57e330[_0x3b59('0x32')][_0x3b59('0x34')]?_0x57e330['attributes']:_0x4d9067[_0x3b59('0x2d')];if(!_0x65c8dc[_0x3b59('0x2e')][_0x3b59('0x35')]('nolimit')){_0x57e330[_0x3b59('0x36')]=qs[_0x3b59('0x36')](_0x65c8dc[_0x3b59('0x2e')]['limit']);_0x57e330[_0x3b59('0x1d')]=qs[_0x3b59('0x1d')](_0x65c8dc[_0x3b59('0x2e')][_0x3b59('0x1d')]);}_0x57e330[_0x3b59('0x37')]=qs[_0x3b59('0x38')](_0x65c8dc[_0x3b59('0x2e')][_0x3b59('0x38')]);_0x57e330[_0x3b59('0x39')]=qs[_0x3b59('0x30')](_['pick'](_0x65c8dc[_0x3b59('0x2e')],_0x4d9067[_0x3b59('0x30')]));if(_0x65c8dc[_0x3b59('0x2e')][_0x3b59('0x3a')]){_0x57e330['where']=_[_0x3b59('0x3b')](_0x57e330[_0x3b59('0x39')],{'$or':_['map'](_0x20d0a0,function(_0x2772fa){if(_0x2772fa['type']!==_0x3b59('0x3c')){var _0x1eb425={};_0x1eb425[_0x2772fa['name']]={'$like':'%'+_0x65c8dc[_0x3b59('0x2e')][_0x3b59('0x3a')]+'%'};return _0x1eb425;}})});}_0x57e330=_[_0x3b59('0x3b')]({},_0x57e330,_0x65c8dc[_0x3b59('0x3d')]);var _0x411510={'where':_0x57e330['where']};return db[_0x3b59('0x2a')][_0x3b59('0x3e')](_0x411510)[_0x3b59('0x25')](function(_0x58d363){_0x4d6f5f[_0x3b59('0x3e')]=_0x58d363;if(_0x65c8dc['query'][_0x3b59('0x3f')]){_0x57e330[_0x3b59('0x40')]=[{'all':!![]}];}return db[_0x3b59('0x2a')][_0x3b59('0x41')](_0x57e330);})[_0x3b59('0x25')](function(_0x313511){_0x4d6f5f[_0x3b59('0x42')]=_0x313511;return _0x4d6f5f;})[_0x3b59('0x25')](respondWithFilteredResult(_0xc96a83,_0x57e330))[_0x3b59('0x43')](handleError(_0xc96a83,null));};exports['show']=function(_0x29c96a,_0x21a578){var _0x126ad5={'raw':!![],'where':{'id':_0x29c96a['params']['id']}},_0x5b8777={};_0x5b8777['model']=_[_0x3b59('0x2f')](db['SugarcrmField'][_0x3b59('0x44')]);_0x5b8777[_0x3b59('0x2e')]=_['keys'](_0x29c96a[_0x3b59('0x2e')]);_0x5b8777[_0x3b59('0x30')]=_[_0x3b59('0x31')](_0x5b8777[_0x3b59('0x2d')],_0x5b8777[_0x3b59('0x2e')]);_0x126ad5[_0x3b59('0x32')]=_[_0x3b59('0x31')](_0x5b8777[_0x3b59('0x2d')],qs['fields'](_0x29c96a[_0x3b59('0x2e')][_0x3b59('0x33')]));_0x126ad5[_0x3b59('0x32')]=_0x126ad5[_0x3b59('0x32')][_0x3b59('0x34')]?_0x126ad5[_0x3b59('0x32')]:_0x5b8777[_0x3b59('0x2d')];if(_0x29c96a[_0x3b59('0x2e')][_0x3b59('0x3f')]){_0x126ad5[_0x3b59('0x40')]=[{'all':!![]}];}_0x126ad5=_[_0x3b59('0x3b')]({},_0x126ad5,_0x29c96a[_0x3b59('0x3d')]);return db[_0x3b59('0x2a')][_0x3b59('0x45')](_0x126ad5)[_0x3b59('0x25')](handleEntityNotFound(_0x21a578,null))['then'](respondWithResult(_0x21a578,null))[_0x3b59('0x43')](handleError(_0x21a578,null));};exports['create']=function(_0x558946,_0x40db9d){return db[_0x3b59('0x2a')][_0x3b59('0x46')](_0x558946[_0x3b59('0x47')],{})[_0x3b59('0x25')](respondWithResult(_0x40db9d,0xc9))['catch'](handleError(_0x40db9d,null));};exports[_0x3b59('0x23')]=function(_0x37fed3,_0x468f2b){if(_0x37fed3[_0x3b59('0x47')]['id']){delete _0x37fed3[_0x3b59('0x47')]['id'];}return db[_0x3b59('0x2a')][_0x3b59('0x45')]({'where':{'id':_0x37fed3[_0x3b59('0x48')]['id']}})[_0x3b59('0x25')](handleEntityNotFound(_0x468f2b,null))[_0x3b59('0x25')](saveUpdates(_0x37fed3[_0x3b59('0x47')],null))[_0x3b59('0x25')](respondWithResult(_0x468f2b,null))[_0x3b59('0x43')](handleError(_0x468f2b,null));};exports[_0x3b59('0x24')]=function(_0x346868,_0x1cc398){return db[_0x3b59('0x2a')][_0x3b59('0x45')]({'where':{'id':_0x346868[_0x3b59('0x48')]['id']}})['then'](handleEntityNotFound(_0x1cc398,null))['then'](removeEntity(_0x1cc398,null))['catch'](handleError(_0x1cc398,null));}; \ No newline at end of file +var _0xe758=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','SugarcrmField','rawAttributes','key','model','map','query','keys','filters','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x39f011,_0x429873){var _0x20eafc=function(_0x1d4dc4){while(--_0x1d4dc4){_0x39f011['push'](_0x39f011['shift']());}};_0x20eafc(++_0x429873);}(_0xe758,0x193));var _0x8e75=function(_0x3bcb78,_0x393b45){_0x3bcb78=_0x3bcb78-0x0;var _0x4eab50=_0xe758[_0x3bcb78];return _0x4eab50;};'use strict';var pdf=require(_0x8e75('0x0'));var emlformat=require(_0x8e75('0x1'));var rimraf=require(_0x8e75('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8e75('0x3'));var rp=require(_0x8e75('0x4'));var moment=require(_0x8e75('0x5'));var BPromise=require(_0x8e75('0x6'));var Mustache=require(_0x8e75('0x7'));var util=require('util');var path=require('path');var sox=require(_0x8e75('0x8'));var csv=require(_0x8e75('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8e75('0xa'));var squel=require(_0x8e75('0xb'));var crypto=require(_0x8e75('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8e75('0xd'));var toCsv=require(_0x8e75('0x9'));var querystring=require(_0x8e75('0xe'));var Papa=require(_0x8e75('0xf'));var Redis=require(_0x8e75('0x10'));var authService=require(_0x8e75('0x11'));var qs=require(_0x8e75('0x12'));var as=require(_0x8e75('0x13'));var hardwareService=require(_0x8e75('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8e75('0x15'));var db=require(_0x8e75('0x16'))['db'];function respondWithStatusCode(_0xf915ab,_0xcd1db6){_0xcd1db6=_0xcd1db6||0xcc;return function(_0x5ef139){if(_0x5ef139){return _0xf915ab[_0x8e75('0x17')](_0xcd1db6);}return _0xf915ab['status'](_0xcd1db6)[_0x8e75('0x18')]();};}function respondWithResult(_0xc92a56,_0x1130b2){_0x1130b2=_0x1130b2||0xc8;return function(_0xcec1a4){if(_0xcec1a4){return _0xc92a56[_0x8e75('0x19')](_0x1130b2)[_0x8e75('0x1a')](_0xcec1a4);}};}function respondWithFilteredResult(_0x2c8bc0,_0x1ce84c){return function(_0x37a7c5){if(_0x37a7c5){var _0x2157d=_0x37a7c5[_0x8e75('0x1b')],_0x9a0049=_0x1ce84c[_0x8e75('0x1c')],_0xe8ab6d=_0x1ce84c[_0x8e75('0x1c')]+_0x1ce84c[_0x8e75('0x1d')],_0x18d045;if(_0xe8ab6d>=_0x2157d){_0xe8ab6d=_0x2157d;_0x18d045=0xc8;}else{_0x18d045=0xce;}_0x2c8bc0['status'](_0x18d045);return _0x2c8bc0['set'](_0x8e75('0x1e'),_0x9a0049+'-'+_0xe8ab6d+'/'+_0x2157d)[_0x8e75('0x1a')](_0x37a7c5);}return null;};}function patchUpdates(_0x50e097){return function(_0x432962){try{jsonpatch[_0x8e75('0x1f')](_0x432962,_0x50e097,!![]);}catch(_0x22cd0a){return BPromise[_0x8e75('0x20')](_0x22cd0a);}return _0x432962[_0x8e75('0x21')]();};}function saveUpdates(_0x38eaf2,_0x454803){return function(_0x4eefe0){if(_0x4eefe0){return _0x4eefe0[_0x8e75('0x22')](_0x38eaf2)[_0x8e75('0x23')](function(_0x3984bb){return _0x3984bb;});}return null;};}function removeEntity(_0x19e373,_0x5701a2){return function(_0x4293d8){if(_0x4293d8){return _0x4293d8[_0x8e75('0x24')]()[_0x8e75('0x23')](function(){_0x19e373[_0x8e75('0x19')](0xcc)[_0x8e75('0x18')]();});}};}function handleEntityNotFound(_0x505265,_0x1cc90f){return function(_0x3fe8ba){if(!_0x3fe8ba){_0x505265[_0x8e75('0x17')](0x194);}return _0x3fe8ba;};}function handleError(_0x4df98a,_0x450ba1){_0x450ba1=_0x450ba1||0x1f4;return function(_0x498ce7){logger[_0x8e75('0x25')](_0x498ce7['stack']);if(_0x498ce7[_0x8e75('0x26')]){delete _0x498ce7[_0x8e75('0x26')];}_0x4df98a['status'](_0x450ba1)[_0x8e75('0x27')](_0x498ce7);};}exports['index']=function(_0x2ad684,_0x50820d){var _0x267fdc={},_0x2dbe7e={},_0x2a4f97={'count':0x0,'rows':[]};var _0x7e9f53=_['map'](db[_0x8e75('0x28')][_0x8e75('0x29')],function(_0xaa3144){return{'name':_0xaa3144['fieldName'],'type':_0xaa3144['type'][_0x8e75('0x2a')]};});_0x2dbe7e[_0x8e75('0x2b')]=_[_0x8e75('0x2c')](_0x7e9f53,_0x8e75('0x26'));_0x2dbe7e[_0x8e75('0x2d')]=_[_0x8e75('0x2e')](_0x2ad684['query']);_0x2dbe7e[_0x8e75('0x2f')]=_['intersection'](_0x2dbe7e['model'],_0x2dbe7e[_0x8e75('0x2d')]);_0x267fdc['attributes']=_['intersection'](_0x2dbe7e[_0x8e75('0x2b')],qs[_0x8e75('0x30')](_0x2ad684[_0x8e75('0x2d')]['fields']));_0x267fdc[_0x8e75('0x31')]=_0x267fdc[_0x8e75('0x31')][_0x8e75('0x32')]?_0x267fdc[_0x8e75('0x31')]:_0x2dbe7e[_0x8e75('0x2b')];if(!_0x2ad684[_0x8e75('0x2d')]['hasOwnProperty'](_0x8e75('0x33'))){_0x267fdc[_0x8e75('0x1d')]=qs[_0x8e75('0x1d')](_0x2ad684[_0x8e75('0x2d')]['limit']);_0x267fdc[_0x8e75('0x1c')]=qs['offset'](_0x2ad684[_0x8e75('0x2d')]['offset']);}_0x267fdc[_0x8e75('0x34')]=qs[_0x8e75('0x35')](_0x2ad684[_0x8e75('0x2d')]['sort']);_0x267fdc[_0x8e75('0x36')]=qs[_0x8e75('0x2f')](_[_0x8e75('0x37')](_0x2ad684[_0x8e75('0x2d')],_0x2dbe7e[_0x8e75('0x2f')]));if(_0x2ad684[_0x8e75('0x2d')][_0x8e75('0x38')]){_0x267fdc['where']=_[_0x8e75('0x39')](_0x267fdc[_0x8e75('0x36')],{'$or':_[_0x8e75('0x2c')](_0x7e9f53,function(_0x4aa520){if(_0x4aa520['type']!=='VIRTUAL'){var _0x21c38b={};_0x21c38b[_0x4aa520[_0x8e75('0x26')]]={'$like':'%'+_0x2ad684[_0x8e75('0x2d')][_0x8e75('0x38')]+'%'};return _0x21c38b;}})});}_0x267fdc=_['merge']({},_0x267fdc,_0x2ad684[_0x8e75('0x3a')]);var _0xaba55e={'where':_0x267fdc['where']};return db[_0x8e75('0x28')]['count'](_0xaba55e)['then'](function(_0x5555c8){_0x2a4f97['count']=_0x5555c8;if(_0x2ad684[_0x8e75('0x2d')][_0x8e75('0x3b')]){_0x267fdc[_0x8e75('0x3c')]=[{'all':!![]}];}return db['SugarcrmField'][_0x8e75('0x3d')](_0x267fdc);})[_0x8e75('0x23')](function(_0x45d64f){_0x2a4f97[_0x8e75('0x3e')]=_0x45d64f;return _0x2a4f97;})['then'](respondWithFilteredResult(_0x50820d,_0x267fdc))[_0x8e75('0x3f')](handleError(_0x50820d,null));};exports[_0x8e75('0x40')]=function(_0x1bf9f8,_0x116c14){var _0x127c95={'raw':!![],'where':{'id':_0x1bf9f8[_0x8e75('0x41')]['id']}},_0x36ae29={};_0x36ae29[_0x8e75('0x2b')]=_[_0x8e75('0x2e')](db[_0x8e75('0x28')][_0x8e75('0x29')]);_0x36ae29['query']=_[_0x8e75('0x2e')](_0x1bf9f8[_0x8e75('0x2d')]);_0x36ae29['filters']=_[_0x8e75('0x42')](_0x36ae29[_0x8e75('0x2b')],_0x36ae29[_0x8e75('0x2d')]);_0x127c95[_0x8e75('0x31')]=_['intersection'](_0x36ae29['model'],qs['fields'](_0x1bf9f8['query']['fields']));_0x127c95[_0x8e75('0x31')]=_0x127c95['attributes'][_0x8e75('0x32')]?_0x127c95[_0x8e75('0x31')]:_0x36ae29[_0x8e75('0x2b')];if(_0x1bf9f8[_0x8e75('0x2d')][_0x8e75('0x3b')]){_0x127c95[_0x8e75('0x3c')]=[{'all':!![]}];}_0x127c95=_[_0x8e75('0x39')]({},_0x127c95,_0x1bf9f8[_0x8e75('0x3a')]);return db['SugarcrmField'][_0x8e75('0x43')](_0x127c95)[_0x8e75('0x23')](handleEntityNotFound(_0x116c14,null))['then'](respondWithResult(_0x116c14,null))[_0x8e75('0x3f')](handleError(_0x116c14,null));};exports[_0x8e75('0x44')]=function(_0x7451fb,_0x2b0f8e){return db[_0x8e75('0x28')][_0x8e75('0x44')](_0x7451fb[_0x8e75('0x45')],{})['then'](respondWithResult(_0x2b0f8e,0xc9))[_0x8e75('0x3f')](handleError(_0x2b0f8e,null));};exports[_0x8e75('0x22')]=function(_0x204975,_0x4c21dc){if(_0x204975[_0x8e75('0x45')]['id']){delete _0x204975['body']['id'];}return db[_0x8e75('0x28')][_0x8e75('0x43')]({'where':{'id':_0x204975[_0x8e75('0x41')]['id']}})[_0x8e75('0x23')](handleEntityNotFound(_0x4c21dc,null))[_0x8e75('0x23')](saveUpdates(_0x204975[_0x8e75('0x45')],null))[_0x8e75('0x23')](respondWithResult(_0x4c21dc,null))[_0x8e75('0x3f')](handleError(_0x4c21dc,null));};exports['destroy']=function(_0x123ce3,_0x236d6d){return db[_0x8e75('0x28')][_0x8e75('0x43')]({'where':{'id':_0x123ce3['params']['id']}})[_0x8e75('0x23')](handleEntityNotFound(_0x236d6d,null))[_0x8e75('0x23')](removeEntity(_0x236d6d,null))[_0x8e75('0x3f')](handleError(_0x236d6d,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 1774954..84720ce 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 _0x7cd0=['FieldId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intSugarcrmField.attributes','exports','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x4238dd,_0x1cc24d){var _0x171358=function(_0xfa631a){while(--_0xfa631a){_0x4238dd['push'](_0x4238dd['shift']());}};_0x171358(++_0x1cc24d);}(_0x7cd0,0xb5));var _0x07cd=function(_0x11315f,_0x4eabdd){_0x11315f=_0x11315f-0x0;var _0xb4c69c=_0x7cd0[_0x11315f];return _0xb4c69c;};'use strict';var _=require(_0x07cd('0x0'));var util=require(_0x07cd('0x1'));var logger=require(_0x07cd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x07cd('0x3'));var rp=require(_0x07cd('0x4'));var fs=require('fs');var path=require(_0x07cd('0x5'));var rimraf=require(_0x07cd('0x6'));var config=require('../../config/environment');var attributes=require(_0x07cd('0x7'));module[_0x07cd('0x8')]=function(_0xe5518e,_0x20fced){return _0xe5518e['define']('SugarcrmField',attributes,{'tableName':_0x07cd('0x9'),'paranoid':![],'indexes':[{'name':_0x07cd('0xa'),'fields':['idField',_0x07cd('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2b4=['define','SugarcrmField','int_sugarcrm_fields','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xe2b4,0x6d));var _0x4e2b=function(_0x3427f6,_0x4d11ee){_0x3427f6=_0x3427f6-0x0;var _0x9391f=_0xe2b4[_0x3427f6];return _0x9391f;};'use strict';var _=require('lodash');var util=require(_0x4e2b('0x0'));var logger=require(_0x4e2b('0x1'))(_0x4e2b('0x2'));var moment=require(_0x4e2b('0x3'));var BPromise=require(_0x4e2b('0x4'));var rp=require(_0x4e2b('0x5'));var fs=require('fs');var path=require(_0x4e2b('0x6'));var rimraf=require(_0x4e2b('0x7'));var config=require(_0x4e2b('0x8'));var attributes=require(_0x4e2b('0x9'));module[_0x4e2b('0xa')]=function(_0x3f47f3,_0x14da83){return _0x3f47f3[_0x4e2b('0xb')](_0x4e2b('0xc'),attributes,{'tableName':_0x4e2b('0xd'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0x4e2b('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index ef1e197..5790eea 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 _0x9ffd=['SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SugarcrmField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x34898a,_0x1c133c){var _0x36a4cd=function(_0x36671d){while(--_0x36671d){_0x34898a['push'](_0x34898a['shift']());}};_0x36a4cd(++_0x1c133c);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1e1214,_0x1ee4ba){_0x1e1214=_0x1e1214-0x0;var _0x5b3ba7=_0x9ffd[_0x1e1214];return _0x5b3ba7;};'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']('SugarcrmField,\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')]('SugarcrmField,\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')]('SugarcrmField,\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 +var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x4f0a3a,_0x14f8d9){var _0x430cca=function(_0x48ae46){while(--_0x48ae46){_0x4f0a3a['push'](_0x4f0a3a['shift']());}};_0x430cca(++_0x14f8d9);}(_0xda2d,0x102));var _0xdda2=function(_0x2ed885,_0x550ca1){_0x2ed885=_0x2ed885-0x0;var _0x4bece0=_0xda2d[_0x2ed885];return _0x4bece0;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index a4e94f4..7c507d1 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 _0x412a=['express','../../config/environment','./intVtigerAccount.controller','isAuthenticated','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x1a8008,_0x43ed13){var _0x468b0c=function(_0x584b6b){while(--_0x584b6b){_0x1a8008['push'](_0x1a8008['shift']());}};_0x468b0c(++_0x43ed13);}(_0x412a,0x13d));var _0xa412=function(_0x624d13,_0x4111af){_0x624d13=_0x624d13-0x0;var _0x60166c=_0x412a[_0x624d13];return _0x60166c;};'use strict';var multer=require(_0xa412('0x0'));var util=require('util');var path=require(_0xa412('0x1'));var timeout=require(_0xa412('0x2'));var express=require(_0xa412('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa412('0x4'));var controller=require(_0xa412('0x5'));router['get']('/',auth[_0xa412('0x6')](),controller['index']);router[_0xa412('0x7')](_0xa412('0x8'),auth[_0xa412('0x6')](),controller['show']);router['get'](_0xa412('0x9'),auth[_0xa412('0x6')](),controller[_0xa412('0xa')]);router[_0xa412('0x7')](_0xa412('0xb'),auth['isAuthenticated'](),controller[_0xa412('0xc')]);router[_0xa412('0xd')]('/',auth[_0xa412('0x6')](),controller[_0xa412('0xe')]);router[_0xa412('0xd')](_0xa412('0x9'),auth[_0xa412('0x6')](),controller[_0xa412('0xf')]);router['put'](_0xa412('0x8'),auth[_0xa412('0x6')](),controller[_0xa412('0x10')]);router[_0xa412('0x11')](_0xa412('0x8'),auth[_0xa412('0x6')](),controller[_0xa412('0x12')]);module[_0xa412('0x13')]=router; \ No newline at end of file +var _0x3559=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x524cf4,_0x2dc079){var _0x116ead=function(_0x324619){while(--_0x324619){_0x524cf4['push'](_0x524cf4['shift']());}};_0x116ead(++_0x2dc079);}(_0x3559,0x107));var _0x9355=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3559[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x9355('0x0'));var util=require(_0x9355('0x1'));var path=require(_0x9355('0x2'));var timeout=require('connect-timeout');var express=require(_0x9355('0x3'));var router=express['Router']();var auth=require(_0x9355('0x4'));var interaction=require(_0x9355('0x5'));var config=require(_0x9355('0x6'));var controller=require(_0x9355('0x7'));router[_0x9355('0x8')]('/',auth[_0x9355('0x9')](),controller[_0x9355('0xa')]);router[_0x9355('0x8')](_0x9355('0xb'),auth[_0x9355('0x9')](),controller[_0x9355('0xc')]);router[_0x9355('0x8')](_0x9355('0xd'),auth[_0x9355('0x9')](),controller[_0x9355('0xe')]);router[_0x9355('0x8')](_0x9355('0xf'),auth[_0x9355('0x9')](),controller[_0x9355('0x10')]);router[_0x9355('0x11')]('/',auth[_0x9355('0x9')](),controller[_0x9355('0x12')]);router[_0x9355('0x11')]('/:id/configurations',auth[_0x9355('0x9')](),controller['addConfiguration']);router[_0x9355('0x13')](_0x9355('0xb'),auth['isAuthenticated'](),controller[_0x9355('0x14')]);router[_0x9355('0x15')](_0x9355('0xb'),auth[_0x9355('0x9')](),controller[_0x9355('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 43d3377..a7feccd 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 _0x43fb=['exports','STRING','HelpDesk','sequelize'];(function(_0x4f386e,_0x56ffdd){var _0x4694e2=function(_0x3d16e4){while(--_0x3d16e4){_0x4f386e['push'](_0x4f386e['shift']());}};_0x4694e2(++_0x56ffdd);}(_0x43fb,0x1af));var _0xb43f=function(_0x45be9f,_0x185c13){_0x45be9f=_0x45be9f-0x0;var _0x4a9a6f=_0x43fb[_0x45be9f];return _0x4a9a6f;};'use strict';var Sequelize=require(_0xb43f('0x0'));module[_0xb43f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb43f('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xb43f('0x2')],'allowNull':![],'defaultValue':_0xb43f('0x3')},'remoteUri':{'type':Sequelize[_0xb43f('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xd872=['STRING'];(function(_0x318337,_0x104695){var _0x32654f=function(_0x4d809f){while(--_0x4d809f){_0x318337['push'](_0x318337['shift']());}};_0x32654f(++_0x104695);}(_0xd872,0xee));var _0x2d87=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd872[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x2d87('0x0')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x2d87('0x0')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING']},'accessKey':{'type':Sequelize[_0x2d87('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index ae40d68..3e08cf1 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 _0xc07b=['substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','sessionName','autogenerated','reference','owner','remove','editable','label','startsWith','cf_','picklistValues','value','log','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','apply','save','then','stack','name','index','map','VtigerAccount','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','create','update','body','find','VtigerConfiguration','getConfigurations','addConfiguration','findOne','getSubjects','channel','type','Descriptions','getDescriptions','VtigerField','Subjects','md5','getFields','username','remoteUri','serverUrl','accessKey','slice'];(function(_0x1d18d7,_0x2f186b){var _0x33f488=function(_0x140801){while(--_0x140801){_0x1d18d7['push'](_0x1d18d7['shift']());}};_0x33f488(++_0x2f186b);}(_0xc07b,0x1a3));var _0xbc07=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xc07b[_0x5608a3];return _0x1ed50a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbc07('0x0'));var rimraf=require(_0xbc07('0x1'));var zipdir=require(_0xbc07('0x2'));var jsonpatch=require(_0xbc07('0x3'));var rp=require(_0xbc07('0x4'));var moment=require(_0xbc07('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbc07('0x6'));var util=require(_0xbc07('0x7'));var path=require(_0xbc07('0x8'));var sox=require(_0xbc07('0x9'));var csv=require(_0xbc07('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbc07('0xb'));var squel=require(_0xbc07('0xc'));var crypto=require(_0xbc07('0xd'));var jsforce=require(_0xbc07('0xe'));var deskjs=require(_0xbc07('0xf'));var toCsv=require(_0xbc07('0xa'));var querystring=require(_0xbc07('0x10'));var Papa=require(_0xbc07('0x11'));var Redis=require(_0xbc07('0x12'));var authService=require(_0xbc07('0x13'));var qs=require(_0xbc07('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbc07('0x15'));var logger=require(_0xbc07('0x16'))('api');var utils=require(_0xbc07('0x17'));var config=require(_0xbc07('0x18'));var db=require(_0xbc07('0x19'))['db'];var integrations=require(_0xbc07('0x1a'));var jayson=require(_0xbc07('0x1b'));var client=jayson['client'][_0xbc07('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x31dd02,_0x1200c7,_0x50b498){if(_0x50b498){var _0x1d2c00=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d2c00[_0xbc07('0x1d')](_0x1200c7)){return _0x31dd02;}else{throw new db['Sequelize']['ValidationError'](_0xbc07('0x1e'));}}else{return _0x31dd02;}}function respondWithRpcPromise(_0x4019ea,_0x152a68,_0x2da9a5,_0x5efbc6){return new BPromise(function(_0x3401ee,_0x461fd0){var _0x434a5d=_0x5efbc6||client;return _0x434a5d[_0xbc07('0x1f')](_0x4019ea,_0x2da9a5)['then'](function(_0x17e869){logger[_0xbc07('0x20')](_0xbc07('0x21'),_0x152a68,_0xbc07('0x22'));logger[_0xbc07('0x23')](_0xbc07('0x24'),_0x152a68,_0xbc07('0x22'),JSON[_0xbc07('0x25')](_0x17e869));if(_0x17e869[_0xbc07('0x26')]){if(_0x17e869['error'][_0xbc07('0x27')]===0x1f4){logger[_0xbc07('0x26')](_0xbc07('0x21'),_0x152a68,_0x17e869['error'][_0xbc07('0x28')]);return _0x461fd0(_0x17e869[_0xbc07('0x26')][_0xbc07('0x28')]);}logger[_0xbc07('0x26')]('VtigerAccount,\x20%s,\x20%s',_0x152a68,_0x17e869[_0xbc07('0x26')][_0xbc07('0x28')]);return _0x3401ee(_0x17e869['error'][_0xbc07('0x28')]);}else{logger[_0xbc07('0x20')]('VtigerAccount,\x20%s,\x20%s',_0x152a68,'request\x20sent');_0x3401ee(_0x17e869[_0xbc07('0x29')][_0xbc07('0x28')]);}})[_0xbc07('0x2a')](function(_0x57911c){logger[_0xbc07('0x26')](_0xbc07('0x21'),_0x152a68,_0x57911c);_0x461fd0(_0x57911c);});});}function respondWithStatusCode(_0x2f949e,_0x9755cc){_0x9755cc=_0x9755cc||0xcc;return function(_0x238c8d){if(_0x238c8d){return _0x2f949e[_0xbc07('0x2b')](_0x9755cc);}return _0x2f949e['status'](_0x9755cc)[_0xbc07('0x2c')]();};}function respondWithResult(_0x4b452a,_0x419508){_0x419508=_0x419508||0xc8;return function(_0x58b83e){if(_0x58b83e){return _0x4b452a[_0xbc07('0x2d')](_0x419508)[_0xbc07('0x2e')](_0x58b83e);}};}function respondWithFilteredResult(_0x471e1a,_0x354998){return function(_0x269859){if(_0x269859){var _0x4c51c9=_0x269859[_0xbc07('0x2f')],_0x36770f=_0x354998[_0xbc07('0x30')],_0xc763df=_0x354998[_0xbc07('0x30')]+_0x354998[_0xbc07('0x31')],_0x2994cc;if(_0xc763df>=_0x4c51c9){_0xc763df=_0x4c51c9;_0x2994cc=0xc8;}else{_0x2994cc=0xce;}_0x471e1a[_0xbc07('0x2d')](_0x2994cc);return _0x471e1a[_0xbc07('0x32')]('Content-Range',_0x36770f+'-'+_0xc763df+'/'+_0x4c51c9)[_0xbc07('0x2e')](_0x269859);}return null;};}function patchUpdates(_0x2a49ee){return function(_0xb97b84){try{jsonpatch[_0xbc07('0x33')](_0xb97b84,_0x2a49ee,!![]);}catch(_0x4af326){return BPromise['reject'](_0x4af326);}return _0xb97b84[_0xbc07('0x34')]();};}function saveUpdates(_0x9af037,_0x144ec6){return function(_0x2153a4){if(_0x2153a4){return _0x2153a4['update'](_0x9af037)[_0xbc07('0x35')](function(_0x444398){return _0x444398;});}return null;};}function removeEntity(_0x12c0f8,_0x1d0449){return function(_0x38d99b){if(_0x38d99b){return _0x38d99b['destroy']()[_0xbc07('0x35')](function(){_0x12c0f8[_0xbc07('0x2d')](0xcc)[_0xbc07('0x2c')]();});}};}function handleEntityNotFound(_0x31e9b2,_0x3a7063){return function(_0x53658c){if(!_0x53658c){_0x31e9b2[_0xbc07('0x2b')](0x194);}return _0x53658c;};}function handleError(_0x318bbf,_0x163b85){_0x163b85=_0x163b85||0x1f4;return function(_0x3df197){logger[_0xbc07('0x26')](_0x3df197[_0xbc07('0x36')]);if(_0x3df197[_0xbc07('0x37')]){delete _0x3df197['name'];}_0x318bbf[_0xbc07('0x2d')](_0x163b85)['send'](_0x3df197);};}exports[_0xbc07('0x38')]=function(_0x49255a,_0x496c81){var _0x9c975b={},_0x4d14b1={},_0x1aab17={'count':0x0,'rows':[]};var _0x5db385=_[_0xbc07('0x39')](db[_0xbc07('0x3a')][_0xbc07('0x3b')],function(_0x5845f4){return{'name':_0x5845f4[_0xbc07('0x3c')],'type':_0x5845f4['type']['key']};});_0x4d14b1['model']=_['map'](_0x5db385,'name');_0x4d14b1[_0xbc07('0x3d')]=_[_0xbc07('0x3e')](_0x49255a[_0xbc07('0x3d')]);_0x4d14b1[_0xbc07('0x3f')]=_[_0xbc07('0x40')](_0x4d14b1[_0xbc07('0x41')],_0x4d14b1['query']);_0x9c975b[_0xbc07('0x42')]=_[_0xbc07('0x40')](_0x4d14b1[_0xbc07('0x41')],qs[_0xbc07('0x43')](_0x49255a[_0xbc07('0x3d')][_0xbc07('0x43')]));_0x9c975b[_0xbc07('0x42')]=_0x9c975b[_0xbc07('0x42')]['length']?_0x9c975b[_0xbc07('0x42')]:_0x4d14b1[_0xbc07('0x41')];if(!_0x49255a[_0xbc07('0x3d')][_0xbc07('0x44')](_0xbc07('0x45'))){_0x9c975b[_0xbc07('0x31')]=qs[_0xbc07('0x31')](_0x49255a[_0xbc07('0x3d')]['limit']);_0x9c975b[_0xbc07('0x30')]=qs[_0xbc07('0x30')](_0x49255a[_0xbc07('0x3d')][_0xbc07('0x30')]);}_0x9c975b['order']=qs[_0xbc07('0x46')](_0x49255a['query'][_0xbc07('0x46')]);_0x9c975b[_0xbc07('0x47')]=qs[_0xbc07('0x3f')](_['pick'](_0x49255a[_0xbc07('0x3d')],_0x4d14b1[_0xbc07('0x3f')]));if(_0x49255a[_0xbc07('0x3d')][_0xbc07('0x48')]){_0x9c975b[_0xbc07('0x47')]=_[_0xbc07('0x49')](_0x9c975b[_0xbc07('0x47')],{'$or':_[_0xbc07('0x39')](_0x5db385,function(_0x46fbb0){if(_0x46fbb0['type']!==_0xbc07('0x4a')){var _0x2ac22e={};_0x2ac22e[_0x46fbb0['name']]={'$like':'%'+_0x49255a[_0xbc07('0x3d')][_0xbc07('0x48')]+'%'};return _0x2ac22e;}})});}_0x9c975b=_[_0xbc07('0x49')]({},_0x9c975b,_0x49255a[_0xbc07('0x4b')]);var _0x22c2fa={'where':_0x9c975b['where']};return db[_0xbc07('0x3a')][_0xbc07('0x2f')](_0x22c2fa)['then'](function(_0x3be655){_0x1aab17['count']=_0x3be655;if(_0x49255a['query'][_0xbc07('0x4c')]){_0x9c975b[_0xbc07('0x4d')]=[{'all':!![]}];}return db[_0xbc07('0x3a')][_0xbc07('0x4e')](_0x9c975b);})[_0xbc07('0x35')](function(_0x67032f){_0x1aab17[_0xbc07('0x4f')]=_0x67032f;return _0x1aab17;})[_0xbc07('0x35')](respondWithFilteredResult(_0x496c81,_0x9c975b))[_0xbc07('0x2a')](handleError(_0x496c81,null));};exports[_0xbc07('0x50')]=function(_0x2bbac9,_0x50559c){var _0x12bd10={'raw':![],'where':{'id':_0x2bbac9[_0xbc07('0x51')]['id']}},_0x2b0df9={};_0x2b0df9[_0xbc07('0x41')]=_[_0xbc07('0x3e')](db['VtigerAccount'][_0xbc07('0x3b')]);_0x2b0df9[_0xbc07('0x3d')]=_[_0xbc07('0x3e')](_0x2bbac9[_0xbc07('0x3d')]);_0x2b0df9['filters']=_[_0xbc07('0x40')](_0x2b0df9[_0xbc07('0x41')],_0x2b0df9[_0xbc07('0x3d')]);_0x12bd10[_0xbc07('0x42')]=_[_0xbc07('0x40')](_0x2b0df9['model'],qs[_0xbc07('0x43')](_0x2bbac9[_0xbc07('0x3d')]['fields']));_0x12bd10[_0xbc07('0x42')]=_0x12bd10[_0xbc07('0x42')][_0xbc07('0x52')]?_0x12bd10[_0xbc07('0x42')]:_0x2b0df9[_0xbc07('0x41')];if(_0x2bbac9[_0xbc07('0x3d')][_0xbc07('0x4c')]){_0x12bd10[_0xbc07('0x4d')]=[{'all':!![]}];}_0x12bd10=_[_0xbc07('0x49')]({},_0x12bd10,_0x2bbac9[_0xbc07('0x4b')]);return db['VtigerAccount']['find'](_0x12bd10)[_0xbc07('0x35')](handleEntityNotFound(_0x50559c,null))[_0xbc07('0x35')](respondWithResult(_0x50559c,null))['catch'](handleError(_0x50559c,null));};exports[_0xbc07('0x53')]=function(_0x161e7b,_0x1340a2){return db[_0xbc07('0x3a')][_0xbc07('0x53')](_0x161e7b['body'],{})[_0xbc07('0x35')](respondWithResult(_0x1340a2,0xc9))['catch'](handleError(_0x1340a2,null));};exports[_0xbc07('0x54')]=function(_0x273b5a,_0x426655){if(_0x273b5a[_0xbc07('0x55')]['id']){delete _0x273b5a[_0xbc07('0x55')]['id'];}return db['VtigerAccount'][_0xbc07('0x56')]({'where':{'id':_0x273b5a[_0xbc07('0x51')]['id']}})[_0xbc07('0x35')](handleEntityNotFound(_0x426655,null))[_0xbc07('0x35')](saveUpdates(_0x273b5a[_0xbc07('0x55')],null))[_0xbc07('0x35')](respondWithResult(_0x426655,null))[_0xbc07('0x2a')](handleError(_0x426655,null));};exports['destroy']=function(_0x4a87b6,_0x160aa0){return db[_0xbc07('0x3a')][_0xbc07('0x56')]({'where':{'id':_0x4a87b6[_0xbc07('0x51')]['id']}})[_0xbc07('0x35')](handleEntityNotFound(_0x160aa0,null))[_0xbc07('0x35')](removeEntity(_0x160aa0,null))[_0xbc07('0x2a')](handleError(_0x160aa0,null));};exports['getConfigurations']=function(_0xc30acf,_0x3d6d5e,_0x50c653){var _0xbab59={};var _0x17774e={};var _0x71a587;var _0x11f23a;return db[_0xbc07('0x3a')]['findOne']({'where':{'id':_0xc30acf[_0xbc07('0x51')]['id']}})['then'](handleEntityNotFound(_0x3d6d5e,null))['then'](function(_0x4d126a){if(_0x4d126a){_0x71a587=_0x4d126a;_0x17774e[_0xbc07('0x41')]=_[_0xbc07('0x3e')](db[_0xbc07('0x57')]['rawAttributes']);_0x17774e[_0xbc07('0x3d')]=_[_0xbc07('0x3e')](_0xc30acf['query']);_0x17774e[_0xbc07('0x3f')]=_[_0xbc07('0x40')](_0x17774e['model'],_0x17774e[_0xbc07('0x3d')]);_0xbab59[_0xbc07('0x42')]=_[_0xbc07('0x40')](_0x17774e['model'],qs[_0xbc07('0x43')](_0xc30acf[_0xbc07('0x3d')]['fields']));_0xbab59[_0xbc07('0x42')]=_0xbab59[_0xbc07('0x42')][_0xbc07('0x52')]?_0xbab59[_0xbc07('0x42')]:_0x17774e[_0xbc07('0x41')];_0xbab59['order']=qs[_0xbc07('0x46')](_0xc30acf[_0xbc07('0x3d')][_0xbc07('0x46')]);_0xbab59[_0xbc07('0x47')]=qs[_0xbc07('0x3f')](_['pick'](_0xc30acf[_0xbc07('0x3d')],_0x17774e['filters']));if(_0xc30acf[_0xbc07('0x3d')][_0xbc07('0x48')]){_0xbab59[_0xbc07('0x47')]=_[_0xbc07('0x49')](_0xbab59[_0xbc07('0x47')],{'$or':_['map'](_0xbab59[_0xbc07('0x42')],function(_0x240395){var _0x5dd084={};_0x5dd084[_0x240395]={'$like':'%'+_0xc30acf[_0xbc07('0x3d')]['filter']+'%'};return _0x5dd084;})});}_0xbab59=_['merge']({},_0xbab59,_0xc30acf[_0xbc07('0x4b')]);return _0x71a587[_0xbc07('0x58')](_0xbab59);}})[_0xbc07('0x35')](function(_0xb1c256){if(_0xb1c256){_0x11f23a=_0xb1c256['length'];if(!_0xc30acf[_0xbc07('0x3d')][_0xbc07('0x44')](_0xbc07('0x45'))){_0xbab59[_0xbc07('0x31')]=qs[_0xbc07('0x31')](_0xc30acf[_0xbc07('0x3d')][_0xbc07('0x31')]);_0xbab59['offset']=qs['offset'](_0xc30acf[_0xbc07('0x3d')]['offset']);}return _0x71a587[_0xbc07('0x58')](_0xbab59);}})[_0xbc07('0x35')](function(_0x343336){if(_0x343336){return _0x343336?{'count':_0x11f23a,'rows':_0x343336}:null;}})[_0xbc07('0x35')](respondWithResult(_0x3d6d5e,null))[_0xbc07('0x2a')](handleError(_0x3d6d5e,null));};exports[_0xbc07('0x59')]=function(_0x2dec69,_0x2c5a98,_0x59e8f3){if(_0x2dec69['body']['id']){delete _0x2dec69[_0xbc07('0x55')]['id'];}return db[_0xbc07('0x3a')][_0xbc07('0x5a')]({'where':{'id':_0x2dec69[_0xbc07('0x51')]['id']}})['then'](handleEntityNotFound(_0x2c5a98,null))[_0xbc07('0x35')](function(_0x7b9be2){if(_0x7b9be2){_0x2dec69[_0xbc07('0x55')]['AccountId']=_0x7b9be2['id'];_0x2dec69[_0xbc07('0x55')]['Subjects']=integrations[_0xbc07('0x5b')](_0x2dec69[_0xbc07('0x55')][_0xbc07('0x5c')],_0x2dec69[_0xbc07('0x55')][_0xbc07('0x5d')]);_0x2dec69['body'][_0xbc07('0x5e')]=integrations[_0xbc07('0x5f')](_0x2dec69[_0xbc07('0x55')][_0xbc07('0x5c')],_0x2dec69['body'][_0xbc07('0x5d')]);return db['VtigerConfiguration']['create'](_0x2dec69['body'],{'include':[{'model':db[_0xbc07('0x60')],'as':_0xbc07('0x61')},{'model':db['VtigerField'],'as':_0xbc07('0x5e')}]});}return null;})[_0xbc07('0x35')](respondWithResult(_0x2c5a98,null))[_0xbc07('0x2a')](handleError(_0x2c5a98,null));};var md5=require(_0xbc07('0x62'));exports[_0xbc07('0x63')]=function(_0x37fec0,_0x2dba9f,_0x522b87){var _0x5c706e=null;var _0x9c6dfe=null;var _0x14f774=null;var _0x252b7b=null;var _0x5a52ef='';return db[_0xbc07('0x3a')]['findOne']({'where':{'id':_0x37fec0[_0xbc07('0x51')]['id']},'attributes':['id',_0xbc07('0x37'),_0xbc07('0x64'),'description','moduleName',_0xbc07('0x65'),_0xbc07('0x66'),_0xbc07('0x67')]})[_0xbc07('0x35')](handleEntityNotFound(_0x2dba9f,null))[_0xbc07('0x35')](function(_0x41b20e){if(_0x41b20e){_0x5c706e=_0x41b20e[_0xbc07('0x64')];_0x9c6dfe=_0x41b20e[_0xbc07('0x67')];_0x14f774=_0x41b20e['moduleName'];_0x5a52ef=_0x41b20e[_0xbc07('0x65')];var _0x3791b7=_0x5a52ef[_0xbc07('0x68')](-0x1);if(_0x3791b7==='/'){_0x5a52ef=_0x5a52ef[_0xbc07('0x69')](0x0,_0x5a52ef[_0xbc07('0x6a')](_0x3791b7));}_0x252b7b=util[_0xbc07('0x6b')](_0xbc07('0x6c'),_0x5a52ef);var _0x5d0743={'method':_0xbc07('0x6d'),'uri':_0x252b7b,'qs':{'operation':_0xbc07('0x6e'),'username':_0x41b20e[_0xbc07('0x64')]},'json':!![]};return rp(_0x5d0743);}})['then'](function(_0x249756){if(_0x249756[_0xbc07('0x6f')]){var _0x333048={'method':_0xbc07('0x70'),'uri':_0x252b7b,'form':{'operation':_0xbc07('0x71'),'username':_0x5c706e,'accessKey':md5(_0x249756[_0xbc07('0x29')][_0xbc07('0x72')]+_0x9c6dfe)},'json':!![]};return rp(_0x333048);}})[_0xbc07('0x35')](function(_0x2bf309){if(_0x2bf309[_0xbc07('0x6f')]){var _0xa95d95={'method':_0xbc07('0x6d'),'uri':_0x252b7b,'qs':{'operation':'describe','username':_0x5c706e,'sessionName':_0x2bf309['result'][_0xbc07('0x73')],'elementType':_0x14f774},'json':!![]};return rp(_0xa95d95);}})[_0xbc07('0x35')](function(_0x28d489){if(_0x28d489[_0xbc07('0x6f')]){var _0x57d7ad=[_0xbc07('0x74'),_0xbc07('0x75'),_0xbc07('0x76')];_[_0xbc07('0x77')](_0x28d489[_0xbc07('0x29')][_0xbc07('0x43')],function(_0x25f6cf){return _0x57d7ad['includes'](_0x25f6cf[_0xbc07('0x5d')][_0xbc07('0x37')]);});_[_0xbc07('0x77')](_0x28d489[_0xbc07('0x29')]['fields'],function(_0x386640){return _0x386640[_0xbc07('0x78')]==='false';});return{'count':_0x28d489['result'][_0xbc07('0x43')]['length'],'rows':_[_0xbc07('0x39')](_0x28d489[_0xbc07('0x29')][_0xbc07('0x43')],function(_0x15dd3c){return{'id':_0x15dd3c['name'],'name':_0x15dd3c[_0xbc07('0x79')],'custom':_[_0xbc07('0x7a')](_0x15dd3c[_0xbc07('0x37')],_0xbc07('0x7b'))?!![]:![],'options':_0x15dd3c[_0xbc07('0x5d')]['name']==='picklist'&&_0x15dd3c[_0xbc07('0x5d')][_0xbc07('0x7c')][_0xbc07('0x52')]>0x0?_['map'](_0x15dd3c['type'][_0xbc07('0x7c')],function(_0x2894ef){return{'name':_0x2894ef['label'],'value':_0x2894ef[_0xbc07('0x7d')]};}):[]};})};}})[_0xbc07('0x35')](respondWithResult(_0x2dba9f,null))[_0xbc07('0x2a')](function(_0x563e8d){console[_0xbc07('0x7e')]('vTiger\x20error:\x20'+_0x563e8d);var _0xf70a84=_0x37fec0[_0xbc07('0x3d')]['test']?0x1f4:_0x563e8d[_0xbc07('0x7f')]||0x1f4;logger['error'](_0xbc07('0x80'),_0xbc07('0x63'),_0xf70a84,JSON[_0xbc07('0x25')](_0x563e8d));delete _0x563e8d[_0xbc07('0x37')];if(_0xf70a84===0x191){_0xf70a84=0x190;}_0x2dba9f[_0xbc07('0x2d')](_0xf70a84)[_0xbc07('0x81')](_0x37fec0[_0xbc07('0x3d')][_0xbc07('0x1d')]?{'message':_0xbc07('0x82'),'statusCode':_0x563e8d['statusCode']}:_0x563e8d);});}; \ No newline at end of file +var _0x7eae=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','request','then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','request\x20sent','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','findAll','rows','show','params','include','options','create','body','find','destroy','getConfigurations','findOne','VtigerConfiguration','length','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','VtigerField','md5','getFields','username','remoteUri','serverUrl','accessKey','moduleName','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','type','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x7eae,0x104));var _0xe7ea=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7eae[_0x40ac5e];return _0x2839d6;};'use strict';var pdf=require(_0xe7ea('0x0'));var emlformat=require(_0xe7ea('0x1'));var rimraf=require(_0xe7ea('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe7ea('0x3'));var rp=require(_0xe7ea('0x4'));var moment=require(_0xe7ea('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe7ea('0x6'));var util=require(_0xe7ea('0x7'));var path=require('path');var sox=require(_0xe7ea('0x8'));var csv=require(_0xe7ea('0x9'));var ejs=require(_0xe7ea('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe7ea('0xb'));var crypto=require(_0xe7ea('0xc'));var jsforce=require(_0xe7ea('0xd'));var deskjs=require(_0xe7ea('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe7ea('0xf'));var Papa=require(_0xe7ea('0x10'));var Redis=require(_0xe7ea('0x11'));var authService=require(_0xe7ea('0x12'));var qs=require(_0xe7ea('0x13'));var as=require(_0xe7ea('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe7ea('0x15'))(_0xe7ea('0x16'));var utils=require('../../config/utils');var config=require(_0xe7ea('0x17'));var db=require(_0xe7ea('0x18'))['db'];var integrations=require(_0xe7ea('0x19'));var jayson=require(_0xe7ea('0x1a'));var client=jayson[_0xe7ea('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x40a11d,_0x2ecee2,_0x1d516c){if(_0x1d516c){var _0x1f9e59=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1f9e59[_0xe7ea('0x1c')](_0x2ecee2)){return _0x40a11d;}else{throw new db[(_0xe7ea('0x1d'))][(_0xe7ea('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x40a11d;}}function respondWithRpcPromise(_0x4da245,_0x81aca2,_0x4039de,_0x54d76f){return new BPromise(function(_0x335efa,_0x1ef1db){var _0x45a528=_0x54d76f||client;return _0x45a528[_0xe7ea('0x1f')](_0x4da245,_0x4039de)[_0xe7ea('0x20')](function(_0x182cec){logger[_0xe7ea('0x21')]('VtigerAccount,\x20%s,\x20%s',_0x81aca2,'request\x20sent');logger[_0xe7ea('0x22')](_0xe7ea('0x23'),_0x81aca2,'request\x20sent',JSON[_0xe7ea('0x24')](_0x182cec));if(_0x182cec[_0xe7ea('0x25')]){if(_0x182cec['error'][_0xe7ea('0x26')]===0x1f4){logger[_0xe7ea('0x25')](_0xe7ea('0x27'),_0x81aca2,_0x182cec[_0xe7ea('0x25')]['message']);return _0x1ef1db(_0x182cec[_0xe7ea('0x25')]['message']);}logger[_0xe7ea('0x25')](_0xe7ea('0x27'),_0x81aca2,_0x182cec[_0xe7ea('0x25')][_0xe7ea('0x28')]);return _0x335efa(_0x182cec[_0xe7ea('0x25')][_0xe7ea('0x28')]);}else{logger[_0xe7ea('0x21')](_0xe7ea('0x27'),_0x81aca2,_0xe7ea('0x29'));_0x335efa(_0x182cec['result'][_0xe7ea('0x28')]);}})[_0xe7ea('0x2a')](function(_0x2b5012){logger['error'](_0xe7ea('0x27'),_0x81aca2,_0x2b5012);_0x1ef1db(_0x2b5012);});});}function respondWithStatusCode(_0x735b89,_0x425e3e){_0x425e3e=_0x425e3e||0xcc;return function(_0x49fd0c){if(_0x49fd0c){return _0x735b89[_0xe7ea('0x2b')](_0x425e3e);}return _0x735b89[_0xe7ea('0x2c')](_0x425e3e)[_0xe7ea('0x2d')]();};}function respondWithResult(_0x412205,_0x3604c4){_0x3604c4=_0x3604c4||0xc8;return function(_0x4e7cfe){if(_0x4e7cfe){return _0x412205['status'](_0x3604c4)[_0xe7ea('0x2e')](_0x4e7cfe);}};}function respondWithFilteredResult(_0x856c19,_0x51a78f){return function(_0xb8066f){if(_0xb8066f){var _0x3a20f9=_0xb8066f[_0xe7ea('0x2f')],_0x397e65=_0x51a78f['offset'],_0x15c388=_0x51a78f[_0xe7ea('0x30')]+_0x51a78f[_0xe7ea('0x31')],_0x48427f;if(_0x15c388>=_0x3a20f9){_0x15c388=_0x3a20f9;_0x48427f=0xc8;}else{_0x48427f=0xce;}_0x856c19[_0xe7ea('0x2c')](_0x48427f);return _0x856c19[_0xe7ea('0x32')](_0xe7ea('0x33'),_0x397e65+'-'+_0x15c388+'/'+_0x3a20f9)[_0xe7ea('0x2e')](_0xb8066f);}return null;};}function patchUpdates(_0x2ec5fb){return function(_0x476a45){try{jsonpatch[_0xe7ea('0x34')](_0x476a45,_0x2ec5fb,!![]);}catch(_0x11ca02){return BPromise['reject'](_0x11ca02);}return _0x476a45[_0xe7ea('0x35')]();};}function saveUpdates(_0x55393a,_0x3885f){return function(_0x40f203){if(_0x40f203){return _0x40f203[_0xe7ea('0x36')](_0x55393a)['then'](function(_0x33cdd5){return _0x33cdd5;});}return null;};}function removeEntity(_0x56845e,_0x441b63){return function(_0x40d701){if(_0x40d701){return _0x40d701['destroy']()[_0xe7ea('0x20')](function(){_0x56845e[_0xe7ea('0x2c')](0xcc)[_0xe7ea('0x2d')]();});}};}function handleEntityNotFound(_0xe86c53,_0x57fbb8){return function(_0x1d85d1){if(!_0x1d85d1){_0xe86c53[_0xe7ea('0x2b')](0x194);}return _0x1d85d1;};}function handleError(_0x40a3e1,_0x4026a4){_0x4026a4=_0x4026a4||0x1f4;return function(_0x3de951){logger[_0xe7ea('0x25')](_0x3de951[_0xe7ea('0x37')]);if(_0x3de951[_0xe7ea('0x38')]){delete _0x3de951['name'];}_0x40a3e1[_0xe7ea('0x2c')](_0x4026a4)[_0xe7ea('0x39')](_0x3de951);};}exports[_0xe7ea('0x3a')]=function(_0x32b0e4,_0x512fdf){var _0x1bdaf3={},_0x62cb99={},_0x1af36f={'count':0x0,'rows':[]};var _0x313c68=_[_0xe7ea('0x3b')](db[_0xe7ea('0x3c')][_0xe7ea('0x3d')],function(_0x116330){return{'name':_0x116330[_0xe7ea('0x3e')],'type':_0x116330['type']['key']};});_0x62cb99[_0xe7ea('0x3f')]=_[_0xe7ea('0x3b')](_0x313c68,_0xe7ea('0x38'));_0x62cb99['query']=_[_0xe7ea('0x40')](_0x32b0e4[_0xe7ea('0x41')]);_0x62cb99[_0xe7ea('0x42')]=_[_0xe7ea('0x43')](_0x62cb99[_0xe7ea('0x3f')],_0x62cb99['query']);_0x1bdaf3[_0xe7ea('0x44')]=_[_0xe7ea('0x43')](_0x62cb99[_0xe7ea('0x3f')],qs[_0xe7ea('0x45')](_0x32b0e4['query'][_0xe7ea('0x45')]));_0x1bdaf3[_0xe7ea('0x44')]=_0x1bdaf3[_0xe7ea('0x44')]['length']?_0x1bdaf3[_0xe7ea('0x44')]:_0x62cb99[_0xe7ea('0x3f')];if(!_0x32b0e4[_0xe7ea('0x41')]['hasOwnProperty'](_0xe7ea('0x46'))){_0x1bdaf3[_0xe7ea('0x31')]=qs['limit'](_0x32b0e4['query']['limit']);_0x1bdaf3[_0xe7ea('0x30')]=qs[_0xe7ea('0x30')](_0x32b0e4['query'][_0xe7ea('0x30')]);}_0x1bdaf3[_0xe7ea('0x47')]=qs[_0xe7ea('0x48')](_0x32b0e4['query']['sort']);_0x1bdaf3['where']=qs[_0xe7ea('0x42')](_[_0xe7ea('0x49')](_0x32b0e4[_0xe7ea('0x41')],_0x62cb99[_0xe7ea('0x42')]));if(_0x32b0e4[_0xe7ea('0x41')][_0xe7ea('0x4a')]){_0x1bdaf3[_0xe7ea('0x4b')]=_['merge'](_0x1bdaf3[_0xe7ea('0x4b')],{'$or':_[_0xe7ea('0x3b')](_0x313c68,function(_0x11550a){if(_0x11550a['type']!==_0xe7ea('0x4c')){var _0x33ded5={};_0x33ded5[_0x11550a[_0xe7ea('0x38')]]={'$like':'%'+_0x32b0e4[_0xe7ea('0x41')][_0xe7ea('0x4a')]+'%'};return _0x33ded5;}})});}_0x1bdaf3=_[_0xe7ea('0x4d')]({},_0x1bdaf3,_0x32b0e4['options']);var _0x4c97cb={'where':_0x1bdaf3['where']};return db[_0xe7ea('0x3c')][_0xe7ea('0x2f')](_0x4c97cb)['then'](function(_0x355fa9){_0x1af36f['count']=_0x355fa9;if(_0x32b0e4[_0xe7ea('0x41')][_0xe7ea('0x4e')]){_0x1bdaf3['include']=[{'all':!![]}];}return db[_0xe7ea('0x3c')][_0xe7ea('0x4f')](_0x1bdaf3);})[_0xe7ea('0x20')](function(_0x40fdd3){_0x1af36f[_0xe7ea('0x50')]=_0x40fdd3;return _0x1af36f;})[_0xe7ea('0x20')](respondWithFilteredResult(_0x512fdf,_0x1bdaf3))['catch'](handleError(_0x512fdf,null));};exports[_0xe7ea('0x51')]=function(_0xd9b974,_0x5c00a3){var _0x33cfae={'raw':![],'where':{'id':_0xd9b974[_0xe7ea('0x52')]['id']}},_0x53df1f={};_0x53df1f[_0xe7ea('0x3f')]=_[_0xe7ea('0x40')](db['VtigerAccount']['rawAttributes']);_0x53df1f[_0xe7ea('0x41')]=_[_0xe7ea('0x40')](_0xd9b974[_0xe7ea('0x41')]);_0x53df1f[_0xe7ea('0x42')]=_[_0xe7ea('0x43')](_0x53df1f[_0xe7ea('0x3f')],_0x53df1f[_0xe7ea('0x41')]);_0x33cfae['attributes']=_[_0xe7ea('0x43')](_0x53df1f[_0xe7ea('0x3f')],qs[_0xe7ea('0x45')](_0xd9b974[_0xe7ea('0x41')][_0xe7ea('0x45')]));_0x33cfae[_0xe7ea('0x44')]=_0x33cfae['attributes']['length']?_0x33cfae[_0xe7ea('0x44')]:_0x53df1f[_0xe7ea('0x3f')];if(_0xd9b974[_0xe7ea('0x41')][_0xe7ea('0x4e')]){_0x33cfae[_0xe7ea('0x53')]=[{'all':!![]}];}_0x33cfae=_[_0xe7ea('0x4d')]({},_0x33cfae,_0xd9b974[_0xe7ea('0x54')]);return db[_0xe7ea('0x3c')]['find'](_0x33cfae)[_0xe7ea('0x20')](handleEntityNotFound(_0x5c00a3,null))[_0xe7ea('0x20')](respondWithResult(_0x5c00a3,null))['catch'](handleError(_0x5c00a3,null));};exports[_0xe7ea('0x55')]=function(_0x300940,_0x2da1ef){return db[_0xe7ea('0x3c')][_0xe7ea('0x55')](_0x300940[_0xe7ea('0x56')],{})[_0xe7ea('0x20')](respondWithResult(_0x2da1ef,0xc9))[_0xe7ea('0x2a')](handleError(_0x2da1ef,null));};exports[_0xe7ea('0x36')]=function(_0x35a0c3,_0x28cbd2){if(_0x35a0c3[_0xe7ea('0x56')]['id']){delete _0x35a0c3['body']['id'];}return db[_0xe7ea('0x3c')][_0xe7ea('0x57')]({'where':{'id':_0x35a0c3[_0xe7ea('0x52')]['id']}})[_0xe7ea('0x20')](handleEntityNotFound(_0x28cbd2,null))['then'](saveUpdates(_0x35a0c3[_0xe7ea('0x56')],null))[_0xe7ea('0x20')](respondWithResult(_0x28cbd2,null))[_0xe7ea('0x2a')](handleError(_0x28cbd2,null));};exports[_0xe7ea('0x58')]=function(_0x36cb7f,_0x5c6659){return db[_0xe7ea('0x3c')]['find']({'where':{'id':_0x36cb7f[_0xe7ea('0x52')]['id']}})[_0xe7ea('0x20')](handleEntityNotFound(_0x5c6659,null))[_0xe7ea('0x20')](removeEntity(_0x5c6659,null))[_0xe7ea('0x2a')](handleError(_0x5c6659,null));};exports[_0xe7ea('0x59')]=function(_0x3d4927,_0x4b1b1e,_0x391936){var _0x217ccf={};var _0x19291f={};var _0x22438d;var _0x1166fa;return db[_0xe7ea('0x3c')][_0xe7ea('0x5a')]({'where':{'id':_0x3d4927[_0xe7ea('0x52')]['id']}})['then'](handleEntityNotFound(_0x4b1b1e,null))[_0xe7ea('0x20')](function(_0x2d2582){if(_0x2d2582){_0x22438d=_0x2d2582;_0x19291f[_0xe7ea('0x3f')]=_[_0xe7ea('0x40')](db[_0xe7ea('0x5b')][_0xe7ea('0x3d')]);_0x19291f[_0xe7ea('0x41')]=_['keys'](_0x3d4927['query']);_0x19291f[_0xe7ea('0x42')]=_[_0xe7ea('0x43')](_0x19291f[_0xe7ea('0x3f')],_0x19291f['query']);_0x217ccf[_0xe7ea('0x44')]=_[_0xe7ea('0x43')](_0x19291f[_0xe7ea('0x3f')],qs['fields'](_0x3d4927[_0xe7ea('0x41')][_0xe7ea('0x45')]));_0x217ccf[_0xe7ea('0x44')]=_0x217ccf['attributes'][_0xe7ea('0x5c')]?_0x217ccf[_0xe7ea('0x44')]:_0x19291f[_0xe7ea('0x3f')];_0x217ccf[_0xe7ea('0x47')]=qs[_0xe7ea('0x48')](_0x3d4927[_0xe7ea('0x41')][_0xe7ea('0x48')]);_0x217ccf[_0xe7ea('0x4b')]=qs[_0xe7ea('0x42')](_['pick'](_0x3d4927['query'],_0x19291f['filters']));if(_0x3d4927['query'][_0xe7ea('0x4a')]){_0x217ccf[_0xe7ea('0x4b')]=_[_0xe7ea('0x4d')](_0x217ccf[_0xe7ea('0x4b')],{'$or':_['map'](_0x217ccf[_0xe7ea('0x44')],function(_0x493d59){var _0x4246b9={};_0x4246b9[_0x493d59]={'$like':'%'+_0x3d4927[_0xe7ea('0x41')][_0xe7ea('0x4a')]+'%'};return _0x4246b9;})});}_0x217ccf=_[_0xe7ea('0x4d')]({},_0x217ccf,_0x3d4927[_0xe7ea('0x54')]);return _0x22438d[_0xe7ea('0x59')](_0x217ccf);}})[_0xe7ea('0x20')](function(_0x29a42e){if(_0x29a42e){_0x1166fa=_0x29a42e['length'];if(!_0x3d4927[_0xe7ea('0x41')][_0xe7ea('0x5d')](_0xe7ea('0x46'))){_0x217ccf['limit']=qs['limit'](_0x3d4927[_0xe7ea('0x41')][_0xe7ea('0x31')]);_0x217ccf[_0xe7ea('0x30')]=qs[_0xe7ea('0x30')](_0x3d4927[_0xe7ea('0x41')][_0xe7ea('0x30')]);}return _0x22438d[_0xe7ea('0x59')](_0x217ccf);}})[_0xe7ea('0x20')](function(_0x5d4f68){if(_0x5d4f68){return _0x5d4f68?{'count':_0x1166fa,'rows':_0x5d4f68}:null;}})[_0xe7ea('0x20')](respondWithResult(_0x4b1b1e,null))['catch'](handleError(_0x4b1b1e,null));};exports[_0xe7ea('0x5e')]=function(_0x357699,_0x4776f4,_0x3fd12c){if(_0x357699[_0xe7ea('0x56')]['id']){delete _0x357699[_0xe7ea('0x56')]['id'];}return db['VtigerAccount'][_0xe7ea('0x5a')]({'where':{'id':_0x357699[_0xe7ea('0x52')]['id']}})[_0xe7ea('0x20')](handleEntityNotFound(_0x4776f4,null))[_0xe7ea('0x20')](function(_0x39b72f){if(_0x39b72f){_0x357699['body'][_0xe7ea('0x5f')]=_0x39b72f['id'];_0x357699[_0xe7ea('0x56')][_0xe7ea('0x60')]=integrations[_0xe7ea('0x61')](_0x357699[_0xe7ea('0x56')]['channel'],_0x357699[_0xe7ea('0x56')]['type']);_0x357699[_0xe7ea('0x56')][_0xe7ea('0x62')]=integrations['getDescriptions'](_0x357699[_0xe7ea('0x56')][_0xe7ea('0x63')],_0x357699[_0xe7ea('0x56')]['type']);return db['VtigerConfiguration'][_0xe7ea('0x55')](_0x357699[_0xe7ea('0x56')],{'include':[{'model':db[_0xe7ea('0x64')],'as':_0xe7ea('0x60')},{'model':db['VtigerField'],'as':_0xe7ea('0x62')}]});}return null;})['then'](respondWithResult(_0x4776f4,null))[_0xe7ea('0x2a')](handleError(_0x4776f4,null));};var md5=require(_0xe7ea('0x65'));exports[_0xe7ea('0x66')]=function(_0x16aced,_0x33470d,_0x7f8d6){var _0x3d53db=null;var _0x4f4b4d=null;var _0x1a066b=null;var _0x3d6a8f=null;var _0x22e748='';return db['VtigerAccount']['findOne']({'where':{'id':_0x16aced['params']['id']},'attributes':['id','name',_0xe7ea('0x67'),'description','moduleName',_0xe7ea('0x68'),_0xe7ea('0x69'),'accessKey']})[_0xe7ea('0x20')](handleEntityNotFound(_0x33470d,null))[_0xe7ea('0x20')](function(_0xf48a9b){if(_0xf48a9b){_0x3d53db=_0xf48a9b[_0xe7ea('0x67')];_0x4f4b4d=_0xf48a9b[_0xe7ea('0x6a')];_0x1a066b=_0xf48a9b[_0xe7ea('0x6b')];_0x22e748=_0xf48a9b[_0xe7ea('0x68')];var _0x232c22=_0x22e748['slice'](-0x1);if(_0x232c22==='/'){_0x22e748=_0x22e748[_0xe7ea('0x6c')](0x0,_0x22e748[_0xe7ea('0x6d')](_0x232c22));}_0x3d6a8f=util[_0xe7ea('0x6e')](_0xe7ea('0x6f'),_0x22e748);var _0x4a932e={'method':_0xe7ea('0x70'),'uri':_0x3d6a8f,'qs':{'operation':_0xe7ea('0x71'),'username':_0xf48a9b[_0xe7ea('0x67')]},'json':!![]};return rp(_0x4a932e);}})['then'](function(_0x25d0b3){if(_0x25d0b3[_0xe7ea('0x72')]){var _0x1bb7f4={'method':_0xe7ea('0x73'),'uri':_0x3d6a8f,'form':{'operation':_0xe7ea('0x74'),'username':_0x3d53db,'accessKey':md5(_0x25d0b3[_0xe7ea('0x75')][_0xe7ea('0x76')]+_0x4f4b4d)},'json':!![]};return rp(_0x1bb7f4);}})['then'](function(_0x22ef6e){if(_0x22ef6e['success']){var _0x444c30={'method':'GET','uri':_0x3d6a8f,'qs':{'operation':'describe','username':_0x3d53db,'sessionName':_0x22ef6e[_0xe7ea('0x75')][_0xe7ea('0x77')],'elementType':_0x1a066b},'json':!![]};return rp(_0x444c30);}})[_0xe7ea('0x20')](function(_0x20c988){if(_0x20c988[_0xe7ea('0x72')]){var _0x3e119a=[_0xe7ea('0x78'),_0xe7ea('0x79'),_0xe7ea('0x7a')];_[_0xe7ea('0x7b')](_0x20c988[_0xe7ea('0x75')][_0xe7ea('0x45')],function(_0x6cb879){return _0x3e119a[_0xe7ea('0x7c')](_0x6cb879['type'][_0xe7ea('0x38')]);});_[_0xe7ea('0x7b')](_0x20c988[_0xe7ea('0x75')]['fields'],function(_0x324d27){return _0x324d27[_0xe7ea('0x7d')]===_0xe7ea('0x7e');});return{'count':_0x20c988[_0xe7ea('0x75')][_0xe7ea('0x45')][_0xe7ea('0x5c')],'rows':_[_0xe7ea('0x3b')](_0x20c988[_0xe7ea('0x75')][_0xe7ea('0x45')],function(_0x57ef1f){return{'id':_0x57ef1f[_0xe7ea('0x38')],'name':_0x57ef1f[_0xe7ea('0x7f')],'custom':_[_0xe7ea('0x80')](_0x57ef1f[_0xe7ea('0x38')],'cf_')?!![]:![],'options':_0x57ef1f[_0xe7ea('0x81')][_0xe7ea('0x38')]===_0xe7ea('0x82')&&_0x57ef1f['type'][_0xe7ea('0x83')][_0xe7ea('0x5c')]>0x0?_['map'](_0x57ef1f[_0xe7ea('0x81')][_0xe7ea('0x83')],function(_0x54b768){return{'name':_0x54b768[_0xe7ea('0x7f')],'value':_0x54b768[_0xe7ea('0x84')]};}):[]};})};}})['then'](respondWithResult(_0x33470d,null))[_0xe7ea('0x2a')](function(_0x29ce09){console[_0xe7ea('0x85')](_0xe7ea('0x86')+_0x29ce09);var _0x1ddbb9=_0x16aced[_0xe7ea('0x41')]['test']?0x1f4:_0x29ce09[_0xe7ea('0x87')]||0x1f4;logger['error'](_0xe7ea('0x88'),'getFields',_0x1ddbb9,JSON[_0xe7ea('0x24')](_0x29ce09));delete _0x29ce09['name'];if(_0x1ddbb9===0x191){_0x1ddbb9=0x190;}_0x33470d[_0xe7ea('0x2c')](_0x1ddbb9)[_0xe7ea('0x39')](_0x16aced[_0xe7ea('0x41')][_0xe7ea('0x1c')]?{'message':'Wrong\x20credentials','statusCode':_0x29ce09[_0xe7ea('0x87')]}:_0x29ce09);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 25f6d61..6d5b720 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 _0x42aa=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger'];(function(_0x3b5c35,_0x2b429a){var _0x3d988c=function(_0x332168){while(--_0x332168){_0x3b5c35['push'](_0x3b5c35['shift']());}};_0x3d988c(++_0x2b429a);}(_0x42aa,0xcf));var _0xa42a=function(_0x39aa91,_0xae90c6){_0x39aa91=_0x39aa91-0x0;var _0x38c6f1=_0x42aa[_0x39aa91];return _0x38c6f1;};'use strict';var _=require(_0xa42a('0x0'));var util=require(_0xa42a('0x1'));var logger=require(_0xa42a('0x2'))(_0xa42a('0x3'));var moment=require(_0xa42a('0x4'));var BPromise=require(_0xa42a('0x5'));var rp=require(_0xa42a('0x6'));var fs=require('fs');var path=require(_0xa42a('0x7'));var rimraf=require(_0xa42a('0x8'));var config=require(_0xa42a('0x9'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0xa42a('0xa'));module[_0xa42a('0xb')]=function(_0x322d04,_0x499e47){return _0x322d04[_0xa42a('0xc')](_0xa42a('0xd'),attributes,{'tableName':_0xa42a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4447=['exports','define','int_vtiger_accounts','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration'];(function(_0x4e697a,_0x56a14b){var _0x88850c=function(_0x4e368a){while(--_0x4e368a){_0x4e697a['push'](_0x4e697a['shift']());}};_0x88850c(++_0x56a14b);}(_0x4447,0xb7));var _0x7444=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x4447[_0x5f3f88];return _0xd08119;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7444('0x0'))('api');var moment=require(_0x7444('0x1'));var BPromise=require(_0x7444('0x2'));var rp=require(_0x7444('0x3'));var fs=require('fs');var path=require(_0x7444('0x4'));var rimraf=require(_0x7444('0x5'));var config=require(_0x7444('0x6'));var attributes=require(_0x7444('0x7'));var integrations=require(_0x7444('0x8'));module[_0x7444('0x9')]=function(_0x5b4630,_0x3f662c){return _0x5b4630[_0x7444('0xa')]('VtigerAccount',attributes,{'tableName':_0x7444('0xb'),'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 0fe17f4..fbe7b6b 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 _0x23ab=['GetVtigerAccount','VtigerAccount','options','where','attributes','include','map','model','then','ShowVtigerAccount','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x412376,_0x482fc2){var _0xae59bf=function(_0x6e8d7e){while(--_0x6e8d7e){_0x412376['push'](_0x412376['shift']());}};_0xae59bf(++_0x482fc2);}(_0x23ab,0xc5));var _0xb23a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x23ab[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb23a('0x0'));var util=require(_0xb23a('0x1'));var moment=require(_0xb23a('0x2'));var BPromise=require('bluebird');var rs=require(_0xb23a('0x3'));var fs=require('fs');var Redis=require(_0xb23a('0x4'));var db=require(_0xb23a('0x5'))['db'];var utils=require(_0xb23a('0x6'));var logger=require(_0xb23a('0x7'))(_0xb23a('0x8'));var config=require(_0xb23a('0x9'));var jayson=require(_0xb23a('0xa'));var client=jayson[_0xb23a('0xb')][_0xb23a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3770bb,_0x26cddd,_0x1b856c){return new BPromise(function(_0x2f9686,_0x321157){return client[_0xb23a('0xd')](_0x3770bb,_0x1b856c)['then'](function(_0x12baa){logger[_0xb23a('0xe')](_0xb23a('0xf'),_0x26cddd,_0xb23a('0x10'));logger[_0xb23a('0x11')](_0xb23a('0x12'),_0x26cddd,_0xb23a('0x10'),JSON[_0xb23a('0x13')](_0x12baa));if(_0x12baa['error']){if(_0x12baa[_0xb23a('0x14')][_0xb23a('0x15')]===0x1f4){logger['error'](_0xb23a('0xf'),_0x26cddd,_0x12baa[_0xb23a('0x14')]['message']);return _0x321157(_0x12baa['error']['message']);}logger[_0xb23a('0x14')](_0xb23a('0xf'),_0x26cddd,_0x12baa['error'][_0xb23a('0x16')]);return _0x2f9686(_0x12baa[_0xb23a('0x14')][_0xb23a('0x16')]);}else{logger[_0xb23a('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x26cddd,_0xb23a('0x10'));_0x2f9686(_0x12baa[_0xb23a('0x17')][_0xb23a('0x16')]);}})[_0xb23a('0x18')](function(_0x54634f){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x26cddd,_0x54634f);_0x321157(_0x54634f);});});}exports[_0xb23a('0x19')]=function(_0x529c3f){var _0x488fed=this;return new Promise(function(_0x44dae0,_0x3cec60){return db[_0xb23a('0x1a')]['findAll']({'raw':_0x529c3f[_0xb23a('0x1b')]?_0x529c3f[_0xb23a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x529c3f[_0xb23a('0x1b')]?_0x529c3f['options'][_0xb23a('0x1c')]||null:null,'attributes':_0x529c3f[_0xb23a('0x1b')]?_0x529c3f[_0xb23a('0x1b')][_0xb23a('0x1d')]||null:null,'limit':_0x529c3f[_0xb23a('0x1b')]?_0x529c3f[_0xb23a('0x1b')]['limit']||null:null,'include':_0x529c3f[_0xb23a('0x1b')]?_0x529c3f[_0xb23a('0x1b')][_0xb23a('0x1e')]?_[_0xb23a('0x1f')](_0x529c3f['options']['include'],function(_0x5e3345){return{'model':db[_0x5e3345[_0xb23a('0x20')]],'as':_0x5e3345['as'],'attributes':_0x5e3345[_0xb23a('0x1d')],'include':_0x5e3345[_0xb23a('0x1e')]?_[_0xb23a('0x1f')](_0x5e3345['include'],function(_0x400638){return{'model':db[_0x400638[_0xb23a('0x20')]],'as':_0x400638['as'],'attributes':_0x400638['attributes'],'include':_0x400638[_0xb23a('0x1e')]?_['map'](_0x400638[_0xb23a('0x1e')],function(_0x159ad2){return{'model':db[_0x159ad2['model']],'as':_0x159ad2['as'],'attributes':_0x159ad2[_0xb23a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb23a('0x21')](function(_0xe50a7c){logger[_0xb23a('0xe')](_0xb23a('0x19'),_0x529c3f);logger[_0xb23a('0x11')](_0xb23a('0x19'),_0x529c3f,JSON[_0xb23a('0x13')](_0xe50a7c));_0x44dae0(_0xe50a7c);})['catch'](function(_0x57870f){logger['error'](_0xb23a('0x19'),_0x57870f[_0xb23a('0x16')],_0x529c3f);_0x3cec60(_0x488fed[_0xb23a('0x14')](0x1f4,_0x57870f[_0xb23a('0x16')]));});});};exports[_0xb23a('0x22')]=function(_0x2dcb4a){var _0x2909fe=this;return new Promise(function(_0x23f0f8,_0x26c5ff){return db['VtigerAccount'][_0xb23a('0x23')]({'raw':_0x2dcb4a['options']?_0x2dcb4a['options'][_0xb23a('0x24')]===undefined?!![]:![]:!![],'where':_0x2dcb4a['options']?_0x2dcb4a[_0xb23a('0x1b')]['where']||null:null,'attributes':_0x2dcb4a[_0xb23a('0x1b')]?_0x2dcb4a[_0xb23a('0x1b')]['attributes']||null:null,'include':_0x2dcb4a[_0xb23a('0x1b')]?_0x2dcb4a[_0xb23a('0x1b')][_0xb23a('0x1e')]?_[_0xb23a('0x1f')](_0x2dcb4a[_0xb23a('0x1b')][_0xb23a('0x1e')],function(_0x413a9b){return{'model':db[_0x413a9b[_0xb23a('0x20')]],'as':_0x413a9b['as'],'attributes':_0x413a9b['attributes'],'include':_0x413a9b[_0xb23a('0x1e')]?_[_0xb23a('0x1f')](_0x413a9b['include'],function(_0xfd271){return{'model':db[_0xfd271['model']],'as':_0xfd271['as'],'attributes':_0xfd271[_0xb23a('0x1d')],'include':_0xfd271[_0xb23a('0x1e')]?_[_0xb23a('0x1f')](_0xfd271[_0xb23a('0x1e')],function(_0x200820){return{'model':db[_0x200820['model']],'as':_0x200820['as'],'attributes':_0x200820[_0xb23a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb23a('0x21')](function(_0x23548e){logger[_0xb23a('0xe')](_0xb23a('0x22'),_0x2dcb4a);logger['debug']('ShowVtigerAccount',_0x2dcb4a,JSON[_0xb23a('0x13')](_0x23548e));_0x23f0f8(_0x23548e);})['catch'](function(_0x443d68){logger['error'](_0xb23a('0x22'),_0x443d68['message'],_0x2dcb4a);_0x26c5ff(_0x2909fe[_0xb23a('0x14')](0x1f4,_0x443d68[_0xb23a('0x16')]));});});}; \ No newline at end of file +var _0x9fa8=['randomstring','ioredis','../../mysqldb','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','VtigerAccount','options','raw','where','attributes','limit','include','map','model','GetVtigerAccount','catch','ShowVtigerAccount','find','moment','bluebird'];(function(_0xf77fee,_0x2e2285){var _0x3ce407=function(_0x2e49c8){while(--_0x2e49c8){_0xf77fee['push'](_0xf77fee['shift']());}};_0x3ce407(++_0x2e2285);}(_0x9fa8,0x1ee));var _0x89fa=function(_0x4cffd3,_0x4d72b8){_0x4cffd3=_0x4cffd3-0x0;var _0x12b3d2=_0x9fa8[_0x4cffd3];return _0x12b3d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x89fa('0x0'));var BPromise=require(_0x89fa('0x1'));var rs=require(_0x89fa('0x2'));var fs=require('fs');var Redis=require(_0x89fa('0x3'));var db=require(_0x89fa('0x4'))['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[_0x89fa('0x5')][_0x89fa('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x338da0,_0x51b903,_0x391524){return new BPromise(function(_0x4b5d8f,_0x54006d){return client[_0x89fa('0x7')](_0x338da0,_0x391524)[_0x89fa('0x8')](function(_0x254199){logger[_0x89fa('0x9')](_0x89fa('0xa'),_0x51b903,'request\x20sent');logger[_0x89fa('0xb')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x51b903,_0x89fa('0xc'),JSON[_0x89fa('0xd')](_0x254199));if(_0x254199['error']){if(_0x254199[_0x89fa('0xe')][_0x89fa('0xf')]===0x1f4){logger[_0x89fa('0xe')](_0x89fa('0xa'),_0x51b903,_0x254199[_0x89fa('0xe')][_0x89fa('0x10')]);return _0x54006d(_0x254199[_0x89fa('0xe')][_0x89fa('0x10')]);}logger[_0x89fa('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x51b903,_0x254199[_0x89fa('0xe')][_0x89fa('0x10')]);return _0x4b5d8f(_0x254199[_0x89fa('0xe')][_0x89fa('0x10')]);}else{logger[_0x89fa('0x9')]('VtigerAccount,\x20%s,\x20%s',_0x51b903,'request\x20sent');_0x4b5d8f(_0x254199[_0x89fa('0x11')][_0x89fa('0x10')]);}})['catch'](function(_0x3bf77e){logger[_0x89fa('0xe')](_0x89fa('0xa'),_0x51b903,_0x3bf77e);_0x54006d(_0x3bf77e);});});}exports['GetVtigerAccount']=function(_0x2adc9d){var _0x2bc746=this;return new Promise(function(_0x1ddb96,_0x5489e0){return db[_0x89fa('0x12')]['findAll']({'raw':_0x2adc9d[_0x89fa('0x13')]?_0x2adc9d[_0x89fa('0x13')][_0x89fa('0x14')]===undefined?!![]:![]:!![],'where':_0x2adc9d[_0x89fa('0x13')]?_0x2adc9d['options'][_0x89fa('0x15')]||null:null,'attributes':_0x2adc9d[_0x89fa('0x13')]?_0x2adc9d[_0x89fa('0x13')][_0x89fa('0x16')]||null:null,'limit':_0x2adc9d[_0x89fa('0x13')]?_0x2adc9d['options'][_0x89fa('0x17')]||null:null,'include':_0x2adc9d[_0x89fa('0x13')]?_0x2adc9d[_0x89fa('0x13')][_0x89fa('0x18')]?_[_0x89fa('0x19')](_0x2adc9d[_0x89fa('0x13')]['include'],function(_0x32ebe3){return{'model':db[_0x32ebe3['model']],'as':_0x32ebe3['as'],'attributes':_0x32ebe3[_0x89fa('0x16')],'include':_0x32ebe3['include']?_['map'](_0x32ebe3['include'],function(_0x1848fc){return{'model':db[_0x1848fc[_0x89fa('0x1a')]],'as':_0x1848fc['as'],'attributes':_0x1848fc[_0x89fa('0x16')],'include':_0x1848fc['include']?_[_0x89fa('0x19')](_0x1848fc[_0x89fa('0x18')],function(_0x31d036){return{'model':db[_0x31d036['model']],'as':_0x31d036['as'],'attributes':_0x31d036[_0x89fa('0x16')]};}):[]};}):[]};}):[]:[]})[_0x89fa('0x8')](function(_0x412b34){logger[_0x89fa('0x9')](_0x89fa('0x1b'),_0x2adc9d);logger[_0x89fa('0xb')](_0x89fa('0x1b'),_0x2adc9d,JSON['stringify'](_0x412b34));_0x1ddb96(_0x412b34);})[_0x89fa('0x1c')](function(_0x30a3e3){logger[_0x89fa('0xe')]('GetVtigerAccount',_0x30a3e3['message'],_0x2adc9d);_0x5489e0(_0x2bc746[_0x89fa('0xe')](0x1f4,_0x30a3e3[_0x89fa('0x10')]));});});};exports[_0x89fa('0x1d')]=function(_0x1ebbf1){var _0x3d30d2=this;return new Promise(function(_0x35870e,_0x253cb0){return db[_0x89fa('0x12')][_0x89fa('0x1e')]({'raw':_0x1ebbf1[_0x89fa('0x13')]?_0x1ebbf1[_0x89fa('0x13')][_0x89fa('0x14')]===undefined?!![]:![]:!![],'where':_0x1ebbf1[_0x89fa('0x13')]?_0x1ebbf1[_0x89fa('0x13')][_0x89fa('0x15')]||null:null,'attributes':_0x1ebbf1[_0x89fa('0x13')]?_0x1ebbf1[_0x89fa('0x13')]['attributes']||null:null,'include':_0x1ebbf1[_0x89fa('0x13')]?_0x1ebbf1[_0x89fa('0x13')][_0x89fa('0x18')]?_[_0x89fa('0x19')](_0x1ebbf1['options'][_0x89fa('0x18')],function(_0x1e7527){return{'model':db[_0x1e7527[_0x89fa('0x1a')]],'as':_0x1e7527['as'],'attributes':_0x1e7527[_0x89fa('0x16')],'include':_0x1e7527[_0x89fa('0x18')]?_['map'](_0x1e7527['include'],function(_0x18505f){return{'model':db[_0x18505f['model']],'as':_0x18505f['as'],'attributes':_0x18505f[_0x89fa('0x16')],'include':_0x18505f['include']?_[_0x89fa('0x19')](_0x18505f['include'],function(_0x5df28c){return{'model':db[_0x5df28c[_0x89fa('0x1a')]],'as':_0x5df28c['as'],'attributes':_0x5df28c['attributes']};}):[]};}):[]};}):[]:[]})[_0x89fa('0x8')](function(_0x13dc2c){logger[_0x89fa('0x9')](_0x89fa('0x1d'),_0x1ebbf1);logger[_0x89fa('0xb')](_0x89fa('0x1d'),_0x1ebbf1,JSON['stringify'](_0x13dc2c));_0x35870e(_0x13dc2c);})[_0x89fa('0x1c')](function(_0x530e26){logger['error']('ShowVtigerAccount',_0x530e26['message'],_0x1ebbf1);_0x253cb0(_0x3d30d2[_0x89fa('0xe')](0x1f4,_0x530e26['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index eada409..d7865d1 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0x483e3a,_0x568361){var _0x43fca9=function(_0x273d7e){while(--_0x273d7e){_0x483e3a['push'](_0x483e3a['shift']());}};_0x43fca9(++_0x568361);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router; \ No newline at end of file +var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x2b9491,_0x62310b){var _0x1d3524=function(_0x516b7d){while(--_0x516b7d){_0x2b9491['push'](_0x2b9491['shift']());}};_0x1d3524(++_0x62310b);}(_0xb10b,0x12a));var _0xbb10=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0xb10b[_0x3438cf];return _0x278698;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('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 2da5cb1..73acb96 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 _0xbf0b=['exports','STRING'];(function(_0x29ac6b,_0x184514){var _0x44a29b=function(_0x2dad03){while(--_0x2dad03){_0x29ac6b['push'](_0x29ac6b['shift']());}};_0x44a29b(++_0x184514);}(_0xbf0b,0xbe));var _0xbbf0=function(_0x1db637,_0x3a4f39){_0x1db637=_0x1db637-0x0;var _0x3d9f5e=_0xbf0b[_0x1db637];return _0x3d9f5e;};'use strict';var Sequelize=require('sequelize');module[_0xbbf0('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbbf0('0x1')]}}; \ No newline at end of file +var _0xbf68=['sequelize','exports','STRING'];(function(_0x453f80,_0x2f5fe7){var _0x16e018=function(_0x31b04c){while(--_0x31b04c){_0x453f80['push'](_0x453f80['shift']());}};_0x16e018(++_0x2f5fe7);}(_0xbf68,0xae));var _0x8bf6=function(_0xa656ed,_0x50b4e4){_0xa656ed=_0xa656ed-0x0;var _0x1ba6be=_0xbf68[_0xa656ed];return _0x1ba6be;};'use strict';var Sequelize=require(_0x8bf6('0x0'));module[_0x8bf6('0x1')]={'name':{'type':Sequelize[_0x8bf6('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 62bc85f..ee0a64f 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 _0x5211=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','stack','name','send','map','VtigerConfiguration','rawAttributes','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','destroy','getFields','findOne','VtigerField','order','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir'];(function(_0x5084a8,_0x11fecc){var _0x364ba4=function(_0x1ea5c1){while(--_0x1ea5c1){_0x5084a8['push'](_0x5084a8['shift']());}};_0x364ba4(++_0x11fecc);}(_0x5211,0x17d));var _0x1521=function(_0x3642d8,_0x58ab5f){_0x3642d8=_0x3642d8-0x0;var _0x41a9b0=_0x5211[_0x3642d8];return _0x41a9b0;};'use strict';var pdf=require(_0x1521('0x0'));var emlformat=require(_0x1521('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1521('0x2'));var jsonpatch=require(_0x1521('0x3'));var rp=require(_0x1521('0x4'));var moment=require(_0x1521('0x5'));var BPromise=require(_0x1521('0x6'));var Mustache=require(_0x1521('0x7'));var util=require(_0x1521('0x8'));var path=require(_0x1521('0x9'));var sox=require(_0x1521('0xa'));var csv=require('to-csv');var ejs=require(_0x1521('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1521('0xc'));var crypto=require(_0x1521('0xd'));var jsforce=require(_0x1521('0xe'));var deskjs=require(_0x1521('0xf'));var toCsv=require(_0x1521('0x10'));var querystring=require(_0x1521('0x11'));var Papa=require(_0x1521('0x12'));var Redis=require(_0x1521('0x13'));var authService=require(_0x1521('0x14'));var qs=require(_0x1521('0x15'));var as=require(_0x1521('0x16'));var hardwareService=require(_0x1521('0x17'));var logger=require(_0x1521('0x18'))(_0x1521('0x19'));var utils=require(_0x1521('0x1a'));var config=require('../../config/environment');var db=require(_0x1521('0x1b'))['db'];var jayson=require(_0x1521('0x1c'));var client=jayson[_0x1521('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x95c4c2,_0x1dc968,_0x895a2){if(_0x895a2){var _0x24e749=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x24e749[_0x1521('0x1e')](_0x1dc968)){return _0x95c4c2;}else{throw new db[(_0x1521('0x1f'))][(_0x1521('0x20'))](_0x1521('0x21'));}}else{return _0x95c4c2;}}function respondWithRpcPromise(_0x5915a7,_0x150e6a,_0x160bb4,_0x531bae){return new BPromise(function(_0xfb0723,_0x14a8b0){var _0x741f5c=_0x531bae||client;return _0x741f5c[_0x1521('0x22')](_0x5915a7,_0x160bb4)[_0x1521('0x23')](function(_0x5669f5){logger[_0x1521('0x24')]('VtigerConfiguration,\x20%s,\x20%s',_0x150e6a,_0x1521('0x25'));logger[_0x1521('0x26')](_0x1521('0x27'),_0x150e6a,_0x1521('0x25'),JSON['stringify'](_0x5669f5));if(_0x5669f5[_0x1521('0x28')]){if(_0x5669f5[_0x1521('0x28')][_0x1521('0x29')]===0x1f4){logger[_0x1521('0x28')](_0x1521('0x2a'),_0x150e6a,_0x5669f5['error']['message']);return _0x14a8b0(_0x5669f5['error'][_0x1521('0x2b')]);}logger[_0x1521('0x28')](_0x1521('0x2a'),_0x150e6a,_0x5669f5['error'][_0x1521('0x2b')]);return _0xfb0723(_0x5669f5[_0x1521('0x28')][_0x1521('0x2b')]);}else{logger['info'](_0x1521('0x2a'),_0x150e6a,'request\x20sent');_0xfb0723(_0x5669f5[_0x1521('0x2c')][_0x1521('0x2b')]);}})['catch'](function(_0x584e39){logger[_0x1521('0x28')]('VtigerConfiguration,\x20%s,\x20%s',_0x150e6a,_0x584e39);_0x14a8b0(_0x584e39);});});}function respondWithStatusCode(_0x27ae40,_0xe68570){_0xe68570=_0xe68570||0xcc;return function(_0x97d17b){if(_0x97d17b){return _0x27ae40[_0x1521('0x2d')](_0xe68570);}return _0x27ae40[_0x1521('0x2e')](_0xe68570)[_0x1521('0x2f')]();};}function respondWithResult(_0x54ad8d,_0x44f265){_0x44f265=_0x44f265||0xc8;return function(_0x29fe28){if(_0x29fe28){return _0x54ad8d['status'](_0x44f265)[_0x1521('0x30')](_0x29fe28);}};}function respondWithFilteredResult(_0x14f674,_0x498af9){return function(_0x20dba6){if(_0x20dba6){var _0x3e4138=_0x20dba6[_0x1521('0x31')],_0x4c0afe=_0x498af9[_0x1521('0x32')],_0x4f6e99=_0x498af9[_0x1521('0x32')]+_0x498af9[_0x1521('0x33')],_0x5a3522;if(_0x4f6e99>=_0x3e4138){_0x4f6e99=_0x3e4138;_0x5a3522=0xc8;}else{_0x5a3522=0xce;}_0x14f674[_0x1521('0x2e')](_0x5a3522);return _0x14f674['set'](_0x1521('0x34'),_0x4c0afe+'-'+_0x4f6e99+'/'+_0x3e4138)[_0x1521('0x30')](_0x20dba6);}return null;};}function patchUpdates(_0x451983){return function(_0x1b1cfe){try{jsonpatch['apply'](_0x1b1cfe,_0x451983,!![]);}catch(_0x1cfcd0){return BPromise[_0x1521('0x35')](_0x1cfcd0);}return _0x1b1cfe['save']();};}function saveUpdates(_0x28fdca,_0x72689d){return function(_0x30669d){if(_0x30669d){return _0x30669d[_0x1521('0x36')](_0x28fdca)[_0x1521('0x23')](function(_0xd0e95){return _0xd0e95;});}return null;};}function removeEntity(_0x335b3e,_0x261640){return function(_0x52e616){if(_0x52e616){return _0x52e616['destroy']()[_0x1521('0x23')](function(){_0x335b3e[_0x1521('0x2e')](0xcc)[_0x1521('0x2f')]();});}};}function handleEntityNotFound(_0x141887,_0x3f3625){return function(_0x1a4243){if(!_0x1a4243){_0x141887[_0x1521('0x2d')](0x194);}return _0x1a4243;};}function handleError(_0x2d8abc,_0x36d855){_0x36d855=_0x36d855||0x1f4;return function(_0x61af3a){logger[_0x1521('0x28')](_0x61af3a[_0x1521('0x37')]);if(_0x61af3a['name']){delete _0x61af3a[_0x1521('0x38')];}_0x2d8abc[_0x1521('0x2e')](_0x36d855)[_0x1521('0x39')](_0x61af3a);};}exports['index']=function(_0x3883fb,_0x4a4fcd){var _0x37547f={},_0x416e91={},_0x5e3ccc={'count':0x0,'rows':[]};var _0x5e48cd=_[_0x1521('0x3a')](db[_0x1521('0x3b')][_0x1521('0x3c')],function(_0x2a1ce1){return{'name':_0x2a1ce1['fieldName'],'type':_0x2a1ce1['type']['key']};});_0x416e91[_0x1521('0x3d')]=_[_0x1521('0x3a')](_0x5e48cd,_0x1521('0x38'));_0x416e91[_0x1521('0x3e')]=_[_0x1521('0x3f')](_0x3883fb[_0x1521('0x3e')]);_0x416e91['filters']=_[_0x1521('0x40')](_0x416e91['model'],_0x416e91[_0x1521('0x3e')]);_0x37547f[_0x1521('0x41')]=_[_0x1521('0x40')](_0x416e91['model'],qs[_0x1521('0x42')](_0x3883fb[_0x1521('0x3e')][_0x1521('0x42')]));_0x37547f[_0x1521('0x41')]=_0x37547f[_0x1521('0x41')][_0x1521('0x43')]?_0x37547f[_0x1521('0x41')]:_0x416e91[_0x1521('0x3d')];if(!_0x3883fb[_0x1521('0x3e')]['hasOwnProperty'](_0x1521('0x44'))){_0x37547f[_0x1521('0x33')]=qs[_0x1521('0x33')](_0x3883fb[_0x1521('0x3e')]['limit']);_0x37547f[_0x1521('0x32')]=qs[_0x1521('0x32')](_0x3883fb['query'][_0x1521('0x32')]);}_0x37547f['order']=qs[_0x1521('0x45')](_0x3883fb[_0x1521('0x3e')]['sort']);_0x37547f[_0x1521('0x46')]=qs[_0x1521('0x47')](_[_0x1521('0x48')](_0x3883fb['query'],_0x416e91[_0x1521('0x47')]));if(_0x3883fb[_0x1521('0x3e')][_0x1521('0x49')]){_0x37547f['where']=_['merge'](_0x37547f[_0x1521('0x46')],{'$or':_[_0x1521('0x3a')](_0x5e48cd,function(_0x4c5fc5){if(_0x4c5fc5[_0x1521('0x4a')]!==_0x1521('0x4b')){var _0x428dab={};_0x428dab[_0x4c5fc5[_0x1521('0x38')]]={'$like':'%'+_0x3883fb[_0x1521('0x3e')][_0x1521('0x49')]+'%'};return _0x428dab;}})});}_0x37547f=_[_0x1521('0x4c')]({},_0x37547f,_0x3883fb['options']);var _0x3d1372={'where':_0x37547f['where']};return db[_0x1521('0x3b')][_0x1521('0x31')](_0x3d1372)['then'](function(_0x3c2767){_0x5e3ccc[_0x1521('0x31')]=_0x3c2767;if(_0x3883fb[_0x1521('0x3e')][_0x1521('0x4d')]){_0x37547f['include']=[{'all':!![]}];}return db[_0x1521('0x3b')][_0x1521('0x4e')](_0x37547f);})[_0x1521('0x23')](function(_0x5cd14a){_0x5e3ccc[_0x1521('0x4f')]=_0x5cd14a;return _0x5e3ccc;})[_0x1521('0x23')](respondWithFilteredResult(_0x4a4fcd,_0x37547f))[_0x1521('0x50')](handleError(_0x4a4fcd,null));};exports[_0x1521('0x51')]=function(_0xcb9514,_0x32cd88){var _0x52df2f={'raw':![],'where':{'id':_0xcb9514[_0x1521('0x52')]['id']}},_0x339e47={};_0x339e47[_0x1521('0x3d')]=_[_0x1521('0x3f')](db[_0x1521('0x3b')][_0x1521('0x3c')]);_0x339e47['query']=_['keys'](_0xcb9514[_0x1521('0x3e')]);_0x339e47[_0x1521('0x47')]=_[_0x1521('0x40')](_0x339e47[_0x1521('0x3d')],_0x339e47[_0x1521('0x3e')]);_0x52df2f[_0x1521('0x41')]=_['intersection'](_0x339e47[_0x1521('0x3d')],qs[_0x1521('0x42')](_0xcb9514[_0x1521('0x3e')][_0x1521('0x42')]));_0x52df2f[_0x1521('0x41')]=_0x52df2f[_0x1521('0x41')][_0x1521('0x43')]?_0x52df2f[_0x1521('0x41')]:_0x339e47[_0x1521('0x3d')];if(_0xcb9514['query']['includeAll']){_0x52df2f[_0x1521('0x53')]=[{'all':!![]}];}_0x52df2f=_['merge']({},_0x52df2f,_0xcb9514[_0x1521('0x54')]);return db['VtigerConfiguration'][_0x1521('0x55')](_0x52df2f)[_0x1521('0x23')](handleEntityNotFound(_0x32cd88,null))[_0x1521('0x23')](respondWithResult(_0x32cd88,null))[_0x1521('0x50')](handleError(_0x32cd88,null));};exports[_0x1521('0x56')]=function(_0x40fd93,_0x326d0c){return db[_0x1521('0x3b')][_0x1521('0x56')](_0x40fd93[_0x1521('0x57')],{})[_0x1521('0x23')](respondWithResult(_0x326d0c,0xc9))['catch'](handleError(_0x326d0c,null));};exports['update']=function(_0x1fbf42,_0x381543){if(_0x1fbf42[_0x1521('0x57')]['id']){delete _0x1fbf42[_0x1521('0x57')]['id'];}return db[_0x1521('0x3b')][_0x1521('0x55')]({'where':{'id':_0x1fbf42[_0x1521('0x52')]['id']}})[_0x1521('0x23')](handleEntityNotFound(_0x381543,null))[_0x1521('0x23')](saveUpdates(_0x1fbf42[_0x1521('0x57')],null))['then'](respondWithResult(_0x381543,null))[_0x1521('0x50')](handleError(_0x381543,null));};exports[_0x1521('0x58')]=function(_0x26582b,_0x27f3a4){return db[_0x1521('0x3b')][_0x1521('0x55')]({'where':{'id':_0x26582b[_0x1521('0x52')]['id']}})[_0x1521('0x23')](handleEntityNotFound(_0x27f3a4,null))['then'](removeEntity(_0x27f3a4,null))[_0x1521('0x50')](handleError(_0x27f3a4,null));};exports[_0x1521('0x59')]=function(_0x33c061,_0x58336b,_0x3636ff){var _0x528bdb={};var _0x57ee61={};var _0x543561;var _0x56329c;return db['VtigerConfiguration'][_0x1521('0x5a')]({'where':{'id':_0x33c061[_0x1521('0x52')]['id']}})[_0x1521('0x23')](handleEntityNotFound(_0x58336b,null))['then'](function(_0x59ebda){if(_0x59ebda){_0x543561=_0x59ebda;_0x57ee61[_0x1521('0x3d')]=_[_0x1521('0x3f')](db[_0x1521('0x5b')][_0x1521('0x3c')]);_0x57ee61[_0x1521('0x3e')]=_[_0x1521('0x3f')](_0x33c061[_0x1521('0x3e')]);_0x57ee61[_0x1521('0x47')]=_['intersection'](_0x57ee61['model'],_0x57ee61[_0x1521('0x3e')]);_0x528bdb[_0x1521('0x41')]=_[_0x1521('0x40')](_0x57ee61['model'],qs[_0x1521('0x42')](_0x33c061[_0x1521('0x3e')][_0x1521('0x42')]));_0x528bdb[_0x1521('0x41')]=_0x528bdb['attributes'][_0x1521('0x43')]?_0x528bdb[_0x1521('0x41')]:_0x57ee61[_0x1521('0x3d')];_0x528bdb[_0x1521('0x5c')]=qs[_0x1521('0x45')](_0x33c061[_0x1521('0x3e')][_0x1521('0x45')]);_0x528bdb[_0x1521('0x46')]=qs[_0x1521('0x47')](_[_0x1521('0x48')](_0x33c061[_0x1521('0x3e')],_0x57ee61['filters']));if(_0x33c061[_0x1521('0x3e')][_0x1521('0x49')]){_0x528bdb[_0x1521('0x46')]=_[_0x1521('0x4c')](_0x528bdb[_0x1521('0x46')],{'$or':_[_0x1521('0x3a')](_0x528bdb[_0x1521('0x41')],function(_0x58f25c){var _0x5bf136={};_0x5bf136[_0x58f25c]={'$like':'%'+_0x33c061['query'][_0x1521('0x49')]+'%'};return _0x5bf136;})});}_0x528bdb=_[_0x1521('0x4c')]({},_0x528bdb,_0x33c061[_0x1521('0x54')]);return _0x543561[_0x1521('0x59')](_0x528bdb);}})['then'](function(_0x3efac9){if(_0x3efac9){_0x56329c=_0x3efac9[_0x1521('0x43')];if(!_0x33c061[_0x1521('0x3e')][_0x1521('0x5d')](_0x1521('0x44'))){_0x528bdb['limit']=qs[_0x1521('0x33')](_0x33c061[_0x1521('0x3e')]['limit']);_0x528bdb[_0x1521('0x32')]=qs[_0x1521('0x32')](_0x33c061[_0x1521('0x3e')]['offset']);}return _0x543561[_0x1521('0x59')](_0x528bdb);}})[_0x1521('0x23')](function(_0x21da0d){if(_0x21da0d){return _0x21da0d?{'count':_0x56329c,'rows':_0x21da0d}:null;}})['then'](respondWithResult(_0x58336b,null))[_0x1521('0x50')](handleError(_0x58336b,null));};exports[_0x1521('0x5e')]=function(_0x22d381,_0x56809d,_0xa779c8){var _0x3a442a={};var _0x2ff81f={};var _0x2deb08;var _0x1608b5;return db['VtigerConfiguration'][_0x1521('0x5a')]({'where':{'id':_0x22d381[_0x1521('0x52')]['id']}})[_0x1521('0x23')](handleEntityNotFound(_0x56809d,null))[_0x1521('0x23')](function(_0x28f0ff){if(_0x28f0ff){_0x2deb08=_0x28f0ff;_0x2ff81f['model']=_[_0x1521('0x3f')](db[_0x1521('0x5b')][_0x1521('0x3c')]);_0x2ff81f['query']=_[_0x1521('0x3f')](_0x22d381[_0x1521('0x3e')]);_0x2ff81f[_0x1521('0x47')]=_['intersection'](_0x2ff81f[_0x1521('0x3d')],_0x2ff81f[_0x1521('0x3e')]);_0x3a442a[_0x1521('0x41')]=_[_0x1521('0x40')](_0x2ff81f[_0x1521('0x3d')],qs[_0x1521('0x42')](_0x22d381['query'][_0x1521('0x42')]));_0x3a442a[_0x1521('0x41')]=_0x3a442a[_0x1521('0x41')]['length']?_0x3a442a[_0x1521('0x41')]:_0x2ff81f[_0x1521('0x3d')];_0x3a442a[_0x1521('0x5c')]=qs[_0x1521('0x45')](_0x22d381[_0x1521('0x3e')][_0x1521('0x45')]);_0x3a442a['where']=qs['filters'](_[_0x1521('0x48')](_0x22d381[_0x1521('0x3e')],_0x2ff81f[_0x1521('0x47')]));if(_0x22d381[_0x1521('0x3e')]['filter']){_0x3a442a[_0x1521('0x46')]=_['merge'](_0x3a442a[_0x1521('0x46')],{'$or':_['map'](_0x3a442a[_0x1521('0x41')],function(_0x459978){var _0x10405b={};_0x10405b[_0x459978]={'$like':'%'+_0x22d381[_0x1521('0x3e')][_0x1521('0x49')]+'%'};return _0x10405b;})});}_0x3a442a=_['merge']({},_0x3a442a,_0x22d381[_0x1521('0x54')]);return _0x2deb08['getSubjects'](_0x3a442a);}})[_0x1521('0x23')](function(_0x20a279){if(_0x20a279){_0x1608b5=_0x20a279[_0x1521('0x43')];if(!_0x22d381[_0x1521('0x3e')][_0x1521('0x5d')](_0x1521('0x44'))){_0x3a442a[_0x1521('0x33')]=qs[_0x1521('0x33')](_0x22d381[_0x1521('0x3e')][_0x1521('0x33')]);_0x3a442a['offset']=qs[_0x1521('0x32')](_0x22d381[_0x1521('0x3e')]['offset']);}return _0x2deb08[_0x1521('0x5e')](_0x3a442a);}})[_0x1521('0x23')](function(_0x15b9d4){if(_0x15b9d4){return _0x15b9d4?{'count':_0x1608b5,'rows':_0x15b9d4}:null;}})[_0x1521('0x23')](respondWithResult(_0x56809d,null))['catch'](handleError(_0x56809d,null));};exports[_0x1521('0x5f')]=function(_0x38ecee,_0x52d799,_0x12ed46){var _0x5917d9={};var _0x67009={};var _0x3a504b;var _0x47e3ec;return db[_0x1521('0x3b')][_0x1521('0x5a')]({'where':{'id':_0x38ecee[_0x1521('0x52')]['id']}})[_0x1521('0x23')](handleEntityNotFound(_0x52d799,null))[_0x1521('0x23')](function(_0x224b6c){if(_0x224b6c){_0x3a504b=_0x224b6c;_0x67009[_0x1521('0x3d')]=_[_0x1521('0x3f')](db[_0x1521('0x5b')][_0x1521('0x3c')]);_0x67009[_0x1521('0x3e')]=_[_0x1521('0x3f')](_0x38ecee['query']);_0x67009['filters']=_[_0x1521('0x40')](_0x67009[_0x1521('0x3d')],_0x67009['query']);_0x5917d9['attributes']=_[_0x1521('0x40')](_0x67009[_0x1521('0x3d')],qs[_0x1521('0x42')](_0x38ecee[_0x1521('0x3e')][_0x1521('0x42')]));_0x5917d9['attributes']=_0x5917d9[_0x1521('0x41')][_0x1521('0x43')]?_0x5917d9[_0x1521('0x41')]:_0x67009[_0x1521('0x3d')];_0x5917d9[_0x1521('0x5c')]=qs[_0x1521('0x45')](_0x38ecee[_0x1521('0x3e')][_0x1521('0x45')]);_0x5917d9[_0x1521('0x46')]=qs[_0x1521('0x47')](_[_0x1521('0x48')](_0x38ecee[_0x1521('0x3e')],_0x67009[_0x1521('0x47')]));if(_0x38ecee[_0x1521('0x3e')][_0x1521('0x49')]){_0x5917d9[_0x1521('0x46')]=_[_0x1521('0x4c')](_0x5917d9[_0x1521('0x46')],{'$or':_[_0x1521('0x3a')](_0x5917d9['attributes'],function(_0x65957b){var _0x5d1a4f={};_0x5d1a4f[_0x65957b]={'$like':'%'+_0x38ecee[_0x1521('0x3e')][_0x1521('0x49')]+'%'};return _0x5d1a4f;})});}_0x5917d9=_[_0x1521('0x4c')]({},_0x5917d9,_0x38ecee[_0x1521('0x54')]);return _0x3a504b['getDescriptions'](_0x5917d9);}})['then'](function(_0x4fb66e){if(_0x4fb66e){_0x47e3ec=_0x4fb66e['length'];if(!_0x38ecee[_0x1521('0x3e')][_0x1521('0x5d')]('nolimit')){_0x5917d9['limit']=qs[_0x1521('0x33')](_0x38ecee[_0x1521('0x3e')]['limit']);_0x5917d9[_0x1521('0x32')]=qs[_0x1521('0x32')](_0x38ecee[_0x1521('0x3e')]['offset']);}return _0x3a504b[_0x1521('0x5f')](_0x5917d9);}})[_0x1521('0x23')](function(_0xce8b72){if(_0xce8b72){return _0xce8b72?{'count':_0x47e3ec,'rows':_0xce8b72}:null;}})[_0x1521('0x23')](respondWithResult(_0x52d799,null))[_0x1521('0x50')](handleError(_0x52d799,null));}; \ No newline at end of file +var _0x97b5=['update','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','keys','filters','model','query','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerConfiguration','count','includeAll','rows','catch','show','params','length','include','find','create','body','getFields','VtigerField','hasOwnProperty','getSubjects','findOne','getDescriptions','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','test','Sequelize','then','info','request\x20sent','debug','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','status','offset','limit','set','Content-Range','json','apply','reject','save'];(function(_0xf8054a,_0x18488e){var _0x44aacf=function(_0x20ac2e){while(--_0x20ac2e){_0xf8054a['push'](_0xf8054a['shift']());}};_0x44aacf(++_0x18488e);}(_0x97b5,0x137));var _0x597b=function(_0x5e8fe9,_0x1d3d88){_0x5e8fe9=_0x5e8fe9-0x0;var _0x5158b9=_0x97b5[_0x5e8fe9];return _0x5158b9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x597b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x597b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x597b('0x2'));var moment=require(_0x597b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x597b('0x4'));var util=require('util');var path=require(_0x597b('0x5'));var sox=require(_0x597b('0x6'));var csv=require(_0x597b('0x7'));var ejs=require(_0x597b('0x8'));var fs=require('fs');var _=require(_0x597b('0x9'));var squel=require(_0x597b('0xa'));var crypto=require(_0x597b('0xb'));var jsforce=require(_0x597b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x597b('0xd'));var Papa=require('papaparse');var Redis=require(_0x597b('0xe'));var authService=require(_0x597b('0xf'));var qs=require(_0x597b('0x10'));var as=require(_0x597b('0x11'));var hardwareService=require(_0x597b('0x12'));var logger=require(_0x597b('0x13'))(_0x597b('0x14'));var utils=require(_0x597b('0x15'));var config=require(_0x597b('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x597b('0x17'));var client=jayson['client'][_0x597b('0x18')]({'port':0x232a});function checkPasswordPattern(_0x3bda57,_0xcc8d68,_0xfd0f9c){if(_0xfd0f9c){var _0x6b3e66=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6b3e66[_0x597b('0x19')](_0xcc8d68)){return _0x3bda57;}else{throw new db[(_0x597b('0x1a'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3bda57;}}function respondWithRpcPromise(_0x9f8035,_0x3a18c3,_0x412703,_0x5611d3){return new BPromise(function(_0x58a4db,_0x153834){var _0x1c6f71=_0x5611d3||client;return _0x1c6f71['request'](_0x9f8035,_0x412703)[_0x597b('0x1b')](function(_0x1cfe7e){logger[_0x597b('0x1c')]('VtigerConfiguration,\x20%s,\x20%s',_0x3a18c3,_0x597b('0x1d'));logger[_0x597b('0x1e')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x3a18c3,_0x597b('0x1d'),JSON['stringify'](_0x1cfe7e));if(_0x1cfe7e[_0x597b('0x1f')]){if(_0x1cfe7e[_0x597b('0x1f')][_0x597b('0x20')]===0x1f4){logger['error'](_0x597b('0x21'),_0x3a18c3,_0x1cfe7e[_0x597b('0x1f')]['message']);return _0x153834(_0x1cfe7e[_0x597b('0x1f')][_0x597b('0x22')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x3a18c3,_0x1cfe7e[_0x597b('0x1f')]['message']);return _0x58a4db(_0x1cfe7e[_0x597b('0x1f')]['message']);}else{logger[_0x597b('0x1c')](_0x597b('0x21'),_0x3a18c3,_0x597b('0x1d'));_0x58a4db(_0x1cfe7e[_0x597b('0x23')][_0x597b('0x22')]);}})['catch'](function(_0x3277e6){logger[_0x597b('0x1f')](_0x597b('0x21'),_0x3a18c3,_0x3277e6);_0x153834(_0x3277e6);});});}function respondWithStatusCode(_0xa5176d,_0x32b0e9){_0x32b0e9=_0x32b0e9||0xcc;return function(_0x427909){if(_0x427909){return _0xa5176d['sendStatus'](_0x32b0e9);}return _0xa5176d[_0x597b('0x24')](_0x32b0e9)['end']();};}function respondWithResult(_0x445b55,_0x50a68c){_0x50a68c=_0x50a68c||0xc8;return function(_0x3baabe){if(_0x3baabe){return _0x445b55[_0x597b('0x24')](_0x50a68c)['json'](_0x3baabe);}};}function respondWithFilteredResult(_0x4fd49d,_0x3f7389){return function(_0x78ebab){if(_0x78ebab){var _0x362665=_0x78ebab['count'],_0x3ee68c=_0x3f7389[_0x597b('0x25')],_0x15a89d=_0x3f7389[_0x597b('0x25')]+_0x3f7389[_0x597b('0x26')],_0xdbe1a8;if(_0x15a89d>=_0x362665){_0x15a89d=_0x362665;_0xdbe1a8=0xc8;}else{_0xdbe1a8=0xce;}_0x4fd49d[_0x597b('0x24')](_0xdbe1a8);return _0x4fd49d[_0x597b('0x27')](_0x597b('0x28'),_0x3ee68c+'-'+_0x15a89d+'/'+_0x362665)[_0x597b('0x29')](_0x78ebab);}return null;};}function patchUpdates(_0x18c98b){return function(_0x5d6a68){try{jsonpatch[_0x597b('0x2a')](_0x5d6a68,_0x18c98b,!![]);}catch(_0x4603b1){return BPromise[_0x597b('0x2b')](_0x4603b1);}return _0x5d6a68[_0x597b('0x2c')]();};}function saveUpdates(_0x181fa3,_0x52435f){return function(_0x1d1e0f){if(_0x1d1e0f){return _0x1d1e0f[_0x597b('0x2d')](_0x181fa3)[_0x597b('0x1b')](function(_0x3de9ca){return _0x3de9ca;});}return null;};}function removeEntity(_0x4859aa,_0x3cce96){return function(_0x2011a2){if(_0x2011a2){return _0x2011a2[_0x597b('0x2e')]()[_0x597b('0x1b')](function(){_0x4859aa[_0x597b('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18ee59,_0x5e8ac7){return function(_0x3c32f6){if(!_0x3c32f6){_0x18ee59[_0x597b('0x2f')](0x194);}return _0x3c32f6;};}function handleError(_0xfa2154,_0x18bbab){_0x18bbab=_0x18bbab||0x1f4;return function(_0x1e57f3){logger['error'](_0x1e57f3['stack']);if(_0x1e57f3[_0x597b('0x30')]){delete _0x1e57f3['name'];}_0xfa2154[_0x597b('0x24')](_0x18bbab)[_0x597b('0x31')](_0x1e57f3);};}exports[_0x597b('0x32')]=function(_0xe35030,_0x1a7434){var _0x3bcb8a={},_0xe86425={},_0x299493={'count':0x0,'rows':[]};var _0x227b0a=_[_0x597b('0x33')](db['VtigerConfiguration'][_0x597b('0x34')],function(_0x1e9a65){return{'name':_0x1e9a65[_0x597b('0x35')],'type':_0x1e9a65[_0x597b('0x36')]['key']};});_0xe86425['model']=_[_0x597b('0x33')](_0x227b0a,_0x597b('0x30'));_0xe86425['query']=_[_0x597b('0x37')](_0xe35030['query']);_0xe86425[_0x597b('0x38')]=_['intersection'](_0xe86425[_0x597b('0x39')],_0xe86425[_0x597b('0x3a')]);_0x3bcb8a[_0x597b('0x3b')]=_[_0x597b('0x3c')](_0xe86425['model'],qs[_0x597b('0x3d')](_0xe35030['query'][_0x597b('0x3d')]));_0x3bcb8a[_0x597b('0x3b')]=_0x3bcb8a[_0x597b('0x3b')]['length']?_0x3bcb8a[_0x597b('0x3b')]:_0xe86425[_0x597b('0x39')];if(!_0xe35030[_0x597b('0x3a')]['hasOwnProperty'](_0x597b('0x3e'))){_0x3bcb8a[_0x597b('0x26')]=qs[_0x597b('0x26')](_0xe35030[_0x597b('0x3a')][_0x597b('0x26')]);_0x3bcb8a[_0x597b('0x25')]=qs[_0x597b('0x25')](_0xe35030['query'][_0x597b('0x25')]);}_0x3bcb8a[_0x597b('0x3f')]=qs['sort'](_0xe35030[_0x597b('0x3a')][_0x597b('0x40')]);_0x3bcb8a[_0x597b('0x41')]=qs[_0x597b('0x38')](_[_0x597b('0x42')](_0xe35030[_0x597b('0x3a')],_0xe86425[_0x597b('0x38')]));if(_0xe35030[_0x597b('0x3a')][_0x597b('0x43')]){_0x3bcb8a[_0x597b('0x41')]=_[_0x597b('0x44')](_0x3bcb8a[_0x597b('0x41')],{'$or':_[_0x597b('0x33')](_0x227b0a,function(_0x36805){if(_0x36805[_0x597b('0x36')]!==_0x597b('0x45')){var _0xbb4b1e={};_0xbb4b1e[_0x36805[_0x597b('0x30')]]={'$like':'%'+_0xe35030[_0x597b('0x3a')]['filter']+'%'};return _0xbb4b1e;}})});}_0x3bcb8a=_[_0x597b('0x44')]({},_0x3bcb8a,_0xe35030[_0x597b('0x46')]);var _0x3e9dfd={'where':_0x3bcb8a[_0x597b('0x41')]};return db[_0x597b('0x47')]['count'](_0x3e9dfd)['then'](function(_0x1ab8b1){_0x299493[_0x597b('0x48')]=_0x1ab8b1;if(_0xe35030[_0x597b('0x3a')][_0x597b('0x49')]){_0x3bcb8a['include']=[{'all':!![]}];}return db[_0x597b('0x47')]['findAll'](_0x3bcb8a);})[_0x597b('0x1b')](function(_0xdc5421){_0x299493[_0x597b('0x4a')]=_0xdc5421;return _0x299493;})[_0x597b('0x1b')](respondWithFilteredResult(_0x1a7434,_0x3bcb8a))[_0x597b('0x4b')](handleError(_0x1a7434,null));};exports[_0x597b('0x4c')]=function(_0x57ddc8,_0x5b6c86){var _0x4972b4={'raw':![],'where':{'id':_0x57ddc8[_0x597b('0x4d')]['id']}},_0x5f2a2a={};_0x5f2a2a[_0x597b('0x39')]=_['keys'](db['VtigerConfiguration'][_0x597b('0x34')]);_0x5f2a2a[_0x597b('0x3a')]=_[_0x597b('0x37')](_0x57ddc8[_0x597b('0x3a')]);_0x5f2a2a[_0x597b('0x38')]=_[_0x597b('0x3c')](_0x5f2a2a[_0x597b('0x39')],_0x5f2a2a['query']);_0x4972b4[_0x597b('0x3b')]=_['intersection'](_0x5f2a2a['model'],qs[_0x597b('0x3d')](_0x57ddc8['query'][_0x597b('0x3d')]));_0x4972b4[_0x597b('0x3b')]=_0x4972b4[_0x597b('0x3b')][_0x597b('0x4e')]?_0x4972b4['attributes']:_0x5f2a2a[_0x597b('0x39')];if(_0x57ddc8['query']['includeAll']){_0x4972b4[_0x597b('0x4f')]=[{'all':!![]}];}_0x4972b4=_[_0x597b('0x44')]({},_0x4972b4,_0x57ddc8['options']);return db[_0x597b('0x47')][_0x597b('0x50')](_0x4972b4)[_0x597b('0x1b')](handleEntityNotFound(_0x5b6c86,null))[_0x597b('0x1b')](respondWithResult(_0x5b6c86,null))[_0x597b('0x4b')](handleError(_0x5b6c86,null));};exports[_0x597b('0x51')]=function(_0x1de423,_0x1d5061){return db[_0x597b('0x47')][_0x597b('0x51')](_0x1de423[_0x597b('0x52')],{})[_0x597b('0x1b')](respondWithResult(_0x1d5061,0xc9))[_0x597b('0x4b')](handleError(_0x1d5061,null));};exports[_0x597b('0x2d')]=function(_0x26f47e,_0x1af3cc){if(_0x26f47e[_0x597b('0x52')]['id']){delete _0x26f47e['body']['id'];}return db[_0x597b('0x47')][_0x597b('0x50')]({'where':{'id':_0x26f47e[_0x597b('0x4d')]['id']}})[_0x597b('0x1b')](handleEntityNotFound(_0x1af3cc,null))['then'](saveUpdates(_0x26f47e[_0x597b('0x52')],null))[_0x597b('0x1b')](respondWithResult(_0x1af3cc,null))[_0x597b('0x4b')](handleError(_0x1af3cc,null));};exports[_0x597b('0x2e')]=function(_0xf6b97d,_0x20e155){return db[_0x597b('0x47')][_0x597b('0x50')]({'where':{'id':_0xf6b97d['params']['id']}})[_0x597b('0x1b')](handleEntityNotFound(_0x20e155,null))[_0x597b('0x1b')](removeEntity(_0x20e155,null))['catch'](handleError(_0x20e155,null));};exports[_0x597b('0x53')]=function(_0x2393e1,_0x19a740,_0x40f0c8){var _0x5bd699={};var _0x4affce={};var _0x218afb;var _0x40d2e9;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x2393e1['params']['id']}})[_0x597b('0x1b')](handleEntityNotFound(_0x19a740,null))['then'](function(_0x371774){if(_0x371774){_0x218afb=_0x371774;_0x4affce[_0x597b('0x39')]=_[_0x597b('0x37')](db[_0x597b('0x54')][_0x597b('0x34')]);_0x4affce[_0x597b('0x3a')]=_[_0x597b('0x37')](_0x2393e1[_0x597b('0x3a')]);_0x4affce[_0x597b('0x38')]=_[_0x597b('0x3c')](_0x4affce[_0x597b('0x39')],_0x4affce['query']);_0x5bd699[_0x597b('0x3b')]=_[_0x597b('0x3c')](_0x4affce[_0x597b('0x39')],qs[_0x597b('0x3d')](_0x2393e1[_0x597b('0x3a')][_0x597b('0x3d')]));_0x5bd699[_0x597b('0x3b')]=_0x5bd699['attributes'][_0x597b('0x4e')]?_0x5bd699[_0x597b('0x3b')]:_0x4affce[_0x597b('0x39')];_0x5bd699['order']=qs[_0x597b('0x40')](_0x2393e1[_0x597b('0x3a')][_0x597b('0x40')]);_0x5bd699['where']=qs['filters'](_[_0x597b('0x42')](_0x2393e1['query'],_0x4affce[_0x597b('0x38')]));if(_0x2393e1['query'][_0x597b('0x43')]){_0x5bd699[_0x597b('0x41')]=_['merge'](_0x5bd699[_0x597b('0x41')],{'$or':_[_0x597b('0x33')](_0x5bd699[_0x597b('0x3b')],function(_0xc5f8a0){var _0x22b2b1={};_0x22b2b1[_0xc5f8a0]={'$like':'%'+_0x2393e1[_0x597b('0x3a')][_0x597b('0x43')]+'%'};return _0x22b2b1;})});}_0x5bd699=_[_0x597b('0x44')]({},_0x5bd699,_0x2393e1[_0x597b('0x46')]);return _0x218afb[_0x597b('0x53')](_0x5bd699);}})[_0x597b('0x1b')](function(_0x10b107){if(_0x10b107){_0x40d2e9=_0x10b107[_0x597b('0x4e')];if(!_0x2393e1[_0x597b('0x3a')][_0x597b('0x55')]('nolimit')){_0x5bd699[_0x597b('0x26')]=qs[_0x597b('0x26')](_0x2393e1[_0x597b('0x3a')]['limit']);_0x5bd699['offset']=qs['offset'](_0x2393e1[_0x597b('0x3a')][_0x597b('0x25')]);}return _0x218afb[_0x597b('0x53')](_0x5bd699);}})[_0x597b('0x1b')](function(_0x55f34d){if(_0x55f34d){return _0x55f34d?{'count':_0x40d2e9,'rows':_0x55f34d}:null;}})[_0x597b('0x1b')](respondWithResult(_0x19a740,null))[_0x597b('0x4b')](handleError(_0x19a740,null));};exports[_0x597b('0x56')]=function(_0x1b1443,_0x44d106,_0x29e5dc){var _0x3ed4cb={};var _0x590fc6={};var _0x46a34f;var _0x2720a1;return db[_0x597b('0x47')][_0x597b('0x57')]({'where':{'id':_0x1b1443[_0x597b('0x4d')]['id']}})['then'](handleEntityNotFound(_0x44d106,null))[_0x597b('0x1b')](function(_0x1bb8c2){if(_0x1bb8c2){_0x46a34f=_0x1bb8c2;_0x590fc6[_0x597b('0x39')]=_[_0x597b('0x37')](db[_0x597b('0x54')]['rawAttributes']);_0x590fc6[_0x597b('0x3a')]=_['keys'](_0x1b1443[_0x597b('0x3a')]);_0x590fc6[_0x597b('0x38')]=_[_0x597b('0x3c')](_0x590fc6[_0x597b('0x39')],_0x590fc6[_0x597b('0x3a')]);_0x3ed4cb[_0x597b('0x3b')]=_[_0x597b('0x3c')](_0x590fc6[_0x597b('0x39')],qs[_0x597b('0x3d')](_0x1b1443['query'][_0x597b('0x3d')]));_0x3ed4cb['attributes']=_0x3ed4cb[_0x597b('0x3b')]['length']?_0x3ed4cb['attributes']:_0x590fc6[_0x597b('0x39')];_0x3ed4cb['order']=qs[_0x597b('0x40')](_0x1b1443[_0x597b('0x3a')]['sort']);_0x3ed4cb[_0x597b('0x41')]=qs[_0x597b('0x38')](_[_0x597b('0x42')](_0x1b1443[_0x597b('0x3a')],_0x590fc6[_0x597b('0x38')]));if(_0x1b1443[_0x597b('0x3a')]['filter']){_0x3ed4cb['where']=_[_0x597b('0x44')](_0x3ed4cb[_0x597b('0x41')],{'$or':_[_0x597b('0x33')](_0x3ed4cb[_0x597b('0x3b')],function(_0x44d4d5){var _0x50d055={};_0x50d055[_0x44d4d5]={'$like':'%'+_0x1b1443[_0x597b('0x3a')]['filter']+'%'};return _0x50d055;})});}_0x3ed4cb=_['merge']({},_0x3ed4cb,_0x1b1443[_0x597b('0x46')]);return _0x46a34f['getSubjects'](_0x3ed4cb);}})[_0x597b('0x1b')](function(_0x2bb8f3){if(_0x2bb8f3){_0x2720a1=_0x2bb8f3[_0x597b('0x4e')];if(!_0x1b1443[_0x597b('0x3a')][_0x597b('0x55')](_0x597b('0x3e'))){_0x3ed4cb['limit']=qs['limit'](_0x1b1443[_0x597b('0x3a')]['limit']);_0x3ed4cb['offset']=qs[_0x597b('0x25')](_0x1b1443['query'][_0x597b('0x25')]);}return _0x46a34f['getSubjects'](_0x3ed4cb);}})[_0x597b('0x1b')](function(_0x2fc1bd){if(_0x2fc1bd){return _0x2fc1bd?{'count':_0x2720a1,'rows':_0x2fc1bd}:null;}})[_0x597b('0x1b')](respondWithResult(_0x44d106,null))[_0x597b('0x4b')](handleError(_0x44d106,null));};exports[_0x597b('0x58')]=function(_0x330da9,_0x3c5d53,_0x11d8d4){var _0x24e2a7={};var _0x23f252={};var _0x45aa89;var _0x30fafb;return db[_0x597b('0x47')][_0x597b('0x57')]({'where':{'id':_0x330da9[_0x597b('0x4d')]['id']}})[_0x597b('0x1b')](handleEntityNotFound(_0x3c5d53,null))[_0x597b('0x1b')](function(_0x4c0f90){if(_0x4c0f90){_0x45aa89=_0x4c0f90;_0x23f252[_0x597b('0x39')]=_[_0x597b('0x37')](db[_0x597b('0x54')][_0x597b('0x34')]);_0x23f252['query']=_['keys'](_0x330da9['query']);_0x23f252[_0x597b('0x38')]=_[_0x597b('0x3c')](_0x23f252[_0x597b('0x39')],_0x23f252[_0x597b('0x3a')]);_0x24e2a7[_0x597b('0x3b')]=_[_0x597b('0x3c')](_0x23f252[_0x597b('0x39')],qs[_0x597b('0x3d')](_0x330da9[_0x597b('0x3a')]['fields']));_0x24e2a7[_0x597b('0x3b')]=_0x24e2a7[_0x597b('0x3b')][_0x597b('0x4e')]?_0x24e2a7['attributes']:_0x23f252[_0x597b('0x39')];_0x24e2a7['order']=qs[_0x597b('0x40')](_0x330da9[_0x597b('0x3a')]['sort']);_0x24e2a7['where']=qs[_0x597b('0x38')](_[_0x597b('0x42')](_0x330da9[_0x597b('0x3a')],_0x23f252[_0x597b('0x38')]));if(_0x330da9[_0x597b('0x3a')]['filter']){_0x24e2a7[_0x597b('0x41')]=_['merge'](_0x24e2a7[_0x597b('0x41')],{'$or':_[_0x597b('0x33')](_0x24e2a7['attributes'],function(_0x5c7c9d){var _0x2c1e8c={};_0x2c1e8c[_0x5c7c9d]={'$like':'%'+_0x330da9[_0x597b('0x3a')][_0x597b('0x43')]+'%'};return _0x2c1e8c;})});}_0x24e2a7=_[_0x597b('0x44')]({},_0x24e2a7,_0x330da9['options']);return _0x45aa89[_0x597b('0x58')](_0x24e2a7);}})[_0x597b('0x1b')](function(_0x5f32f6){if(_0x5f32f6){_0x30fafb=_0x5f32f6[_0x597b('0x4e')];if(!_0x330da9[_0x597b('0x3a')]['hasOwnProperty']('nolimit')){_0x24e2a7[_0x597b('0x26')]=qs[_0x597b('0x26')](_0x330da9[_0x597b('0x3a')][_0x597b('0x26')]);_0x24e2a7['offset']=qs[_0x597b('0x25')](_0x330da9[_0x597b('0x3a')][_0x597b('0x25')]);}return _0x45aa89[_0x597b('0x58')](_0x24e2a7);}})[_0x597b('0x1b')](function(_0xd1f18d){if(_0xd1f18d){return _0xd1f18d?{'count':_0x30fafb,'rows':_0xd1f18d}:null;}})[_0x597b('0x1b')](respondWithResult(_0x3c5d53,null))[_0x597b('0x4b')](handleError(_0x3c5d53,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 75bffe3..6b3edd4 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 _0x1558=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','VtigerConfiguration','int_vtiger_configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1558,0x1c8));var _0x8155=function(_0x287059,_0x499940){_0x287059=_0x287059-0x0;var _0x225c79=_0x1558[_0x287059];return _0x225c79;};'use strict';var _=require(_0x8155('0x0'));var util=require(_0x8155('0x1'));var logger=require(_0x8155('0x2'))(_0x8155('0x3'));var moment=require(_0x8155('0x4'));var BPromise=require(_0x8155('0x5'));var rp=require(_0x8155('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8155('0x7'));var config=require(_0x8155('0x8'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x8155('0x9')]=function(_0x2355f0,_0x1f91a2){return _0x2355f0['define'](_0x8155('0xa'),attributes,{'tableName':_0x8155('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6561=['../../config/environment','./intVtigerConfiguration.attributes','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x337073,_0x2005d6){var _0x2c08da=function(_0x580212){while(--_0x580212){_0x337073['push'](_0x337073['shift']());}};_0x2c08da(++_0x2005d6);}(_0x6561,0x1f2));var _0x1656=function(_0x4f7014,_0x3649ef){_0x4f7014=_0x4f7014-0x0;var _0x8fa130=_0x6561[_0x4f7014];return _0x8fa130;};'use strict';var _=require(_0x1656('0x0'));var util=require(_0x1656('0x1'));var logger=require(_0x1656('0x2'))(_0x1656('0x3'));var moment=require(_0x1656('0x4'));var BPromise=require(_0x1656('0x5'));var rp=require(_0x1656('0x6'));var fs=require('fs');var path=require(_0x1656('0x7'));var rimraf=require(_0x1656('0x8'));var config=require(_0x1656('0x9'));var attributes=require(_0x1656('0xa'));module['exports']=function(_0x12f098,_0x4ae75f){return _0x12f098['define'](_0x1656('0xb'),attributes,{'tableName':_0x1656('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 640f3b7..8695b6e 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 _0xc3e4=['../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xc3e4,0x19d));var _0x4c3e=function(_0x5f11ed,_0xa3a329){_0x5f11ed=_0x5f11ed-0x0;var _0x15d226=_0xc3e4[_0x5f11ed];return _0x15d226;};'use strict';var _=require(_0x4c3e('0x0'));var util=require('util');var moment=require(_0x4c3e('0x1'));var BPromise=require(_0x4c3e('0x2'));var rs=require(_0x4c3e('0x3'));var fs=require('fs');var Redis=require(_0x4c3e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4c3e('0x5'));var jayson=require(_0x4c3e('0x6'));var client=jayson['client'][_0x4c3e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2daf7b,_0x1cc141,_0x46424a){return new BPromise(function(_0x4b8119,_0x229e30){return client[_0x4c3e('0x8')](_0x2daf7b,_0x46424a)[_0x4c3e('0x9')](function(_0x3edd3c){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x1cc141,_0x4c3e('0xa'));logger[_0x4c3e('0xb')](_0x4c3e('0xc'),_0x1cc141,_0x4c3e('0xa'),JSON[_0x4c3e('0xd')](_0x3edd3c));if(_0x3edd3c[_0x4c3e('0xe')]){if(_0x3edd3c[_0x4c3e('0xe')]['code']===0x1f4){logger[_0x4c3e('0xe')](_0x4c3e('0xf'),_0x1cc141,_0x3edd3c['error']['message']);return _0x229e30(_0x3edd3c[_0x4c3e('0xe')]['message']);}logger[_0x4c3e('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x1cc141,_0x3edd3c['error'][_0x4c3e('0x10')]);return _0x4b8119(_0x3edd3c[_0x4c3e('0xe')][_0x4c3e('0x10')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x1cc141,'request\x20sent');_0x4b8119(_0x3edd3c[_0x4c3e('0x11')][_0x4c3e('0x10')]);}})[_0x4c3e('0x12')](function(_0x13c131){logger[_0x4c3e('0xe')](_0x4c3e('0xf'),_0x1cc141,_0x13c131);_0x229e30(_0x13c131);});});} \ No newline at end of file +var _0x0d9c=['../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x55607b,_0x41b9de){var _0x20a5b0=function(_0xedafb4){while(--_0xedafb4){_0x55607b['push'](_0x55607b['shift']());}};_0x20a5b0(++_0x41b9de);}(_0x0d9c,0xa3));var _0xc0d9=function(_0x273c83,_0x2b2100){_0x273c83=_0x273c83-0x0;var _0x1ade28=_0x0d9c[_0x273c83];return _0x1ade28;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc0d9('0x0'));var BPromise=require(_0xc0d9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc0d9('0x2'));var db=require(_0xc0d9('0x3'))['db'];var utils=require(_0xc0d9('0x4'));var logger=require(_0xc0d9('0x5'))('rpc');var config=require(_0xc0d9('0x6'));var jayson=require(_0xc0d9('0x7'));var client=jayson[_0xc0d9('0x8')][_0xc0d9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b63de,_0x411bc5,_0x5cb881){return new BPromise(function(_0x5dc845,_0x5358ed){return client[_0xc0d9('0xa')](_0x4b63de,_0x5cb881)['then'](function(_0x307c3c){logger[_0xc0d9('0xb')](_0xc0d9('0xc'),_0x411bc5,'request\x20sent');logger[_0xc0d9('0xd')](_0xc0d9('0xe'),_0x411bc5,_0xc0d9('0xf'),JSON[_0xc0d9('0x10')](_0x307c3c));if(_0x307c3c['error']){if(_0x307c3c['error'][_0xc0d9('0x11')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x411bc5,_0x307c3c['error'][_0xc0d9('0x12')]);return _0x5358ed(_0x307c3c[_0xc0d9('0x13')][_0xc0d9('0x12')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x411bc5,_0x307c3c[_0xc0d9('0x13')][_0xc0d9('0x12')]);return _0x5dc845(_0x307c3c[_0xc0d9('0x13')]['message']);}else{logger[_0xc0d9('0xb')](_0xc0d9('0xc'),_0x411bc5,_0xc0d9('0xf'));_0x5dc845(_0x307c3c[_0xc0d9('0x14')][_0xc0d9('0x12')]);}})['catch'](function(_0x16002a){logger['error'](_0xc0d9('0xc'),_0x411bc5,_0x16002a);_0x5358ed(_0x16002a);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 4b5d610..a8687b9 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 _0xc560=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','put','update'];(function(_0x5d67fb,_0x1bc746){var _0x3b92e0=function(_0x512521){while(--_0x512521){_0x5d67fb['push'](_0x5d67fb['shift']());}};_0x3b92e0(++_0x1bc746);}(_0xc560,0x1c5));var _0x0c56=function(_0x108579,_0x44bc56){_0x108579=_0x108579-0x0;var _0xd11c6c=_0xc560[_0x108579];return _0xd11c6c;};'use strict';var multer=require(_0x0c56('0x0'));var util=require(_0x0c56('0x1'));var path=require('path');var timeout=require(_0x0c56('0x2'));var express=require(_0x0c56('0x3'));var router=express[_0x0c56('0x4')]();var auth=require(_0x0c56('0x5'));var interaction=require(_0x0c56('0x6'));var config=require(_0x0c56('0x7'));var controller=require('./intVtigerField.controller');router[_0x0c56('0x8')]('/',auth[_0x0c56('0x9')](),controller[_0x0c56('0xa')]);router[_0x0c56('0x8')](_0x0c56('0xb'),auth['isAuthenticated'](),controller[_0x0c56('0xc')]);router['post']('/',auth[_0x0c56('0x9')](),controller['create']);router[_0x0c56('0xd')](_0x0c56('0xb'),auth['isAuthenticated'](),controller[_0x0c56('0xe')]);router[_0x0c56('0xf')](_0x0c56('0xb'),auth[_0x0c56('0x9')](),controller[_0x0c56('0x10')]);module[_0x0c56('0x11')]=router; \ No newline at end of file +var _0xdfb2=['./intVtigerField.controller','isAuthenticated','/:id','show','post','create','put','multer','util','path','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x50552a,_0x476d7a){var _0x221483=function(_0x530d2b){while(--_0x530d2b){_0x50552a['push'](_0x50552a['shift']());}};_0x221483(++_0x476d7a);}(_0xdfb2,0x149));var _0x2dfb=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xdfb2[_0x411add];return _0x238242;};'use strict';var multer=require(_0x2dfb('0x0'));var util=require(_0x2dfb('0x1'));var path=require(_0x2dfb('0x2'));var timeout=require('connect-timeout');var express=require(_0x2dfb('0x3'));var router=express[_0x2dfb('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2dfb('0x5'));var config=require(_0x2dfb('0x6'));var controller=require(_0x2dfb('0x7'));router['get']('/',auth[_0x2dfb('0x8')](),controller['index']);router['get'](_0x2dfb('0x9'),auth['isAuthenticated'](),controller[_0x2dfb('0xa')]);router[_0x2dfb('0xb')]('/',auth[_0x2dfb('0x8')](),controller[_0x2dfb('0xc')]);router[_0x2dfb('0xd')](_0x2dfb('0x9'),auth[_0x2dfb('0x8')](),controller['update']);router['delete'](_0x2dfb('0x9'),auth[_0x2dfb('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 5d596c2..e59dfbf 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 _0x63be=['customVariable','keyValue','STRING','variable','BOOLEAN','ENUM','string'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x63be,0xd7));var _0xe63b=function(_0x4840d5,_0x4b3208){_0x4840d5=_0x4840d5-0x0;var _0x37e90f=_0x63be[_0x4840d5];return _0x37e90f;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xe63b('0x0')](_0xe63b('0x1'),'variable',_0xe63b('0x2'),_0xe63b('0x3')),'defaultValue':_0xe63b('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe63b('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xe63b('0x1'),_0xe63b('0x5'),_0xe63b('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe63b('0x4')]},'nameField':{'type':Sequelize[_0xe63b('0x4')]},'customField':{'type':Sequelize[_0xe63b('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe63b('0x4')]}}; \ No newline at end of file +var _0x8569=['keyValue','STRING','customVariable','BOOLEAN','ENUM','string','variable'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x8569,0x14d));var _0x9856=function(_0x2ab76b,_0x176579){_0x2ab76b=_0x2ab76b-0x0;var _0x201126=_0x8569[_0x2ab76b];return _0x201126;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9856('0x0')](_0x9856('0x1'),_0x9856('0x2'),'customVariable',_0x9856('0x3')),'defaultValue':_0x9856('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9856('0x4')]},'keyType':{'type':Sequelize[_0x9856('0x0')](_0x9856('0x1'),_0x9856('0x2'),_0x9856('0x5'))},'keyContent':{'type':Sequelize[_0x9856('0x4')]},'idField':{'type':Sequelize[_0x9856('0x4')]},'nameField':{'type':Sequelize[_0x9856('0x4')]},'customField':{'type':Sequelize[_0x9856('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9856('0x4')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index ae2d641..fef48cd 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 _0x7d26=['where','merge','VIRTUAL','filter','options','count','findAll','rows','catch','show','params','includeAll','find','create','body','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','save','then','destroy','end','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x3db285,_0x2ce3dc){var _0x287478=function(_0x146324){while(--_0x146324){_0x3db285['push'](_0x3db285['shift']());}};_0x287478(++_0x2ce3dc);}(_0x7d26,0x127));var _0x67d2=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7d26[_0x4b369d];return _0x571a98;};'use strict';var pdf=require(_0x67d2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x67d2('0x1'));var zipdir=require(_0x67d2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x67d2('0x3'));var BPromise=require(_0x67d2('0x4'));var Mustache=require(_0x67d2('0x5'));var util=require('util');var path=require(_0x67d2('0x6'));var sox=require(_0x67d2('0x7'));var csv=require(_0x67d2('0x8'));var ejs=require(_0x67d2('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x67d2('0xa'));var crypto=require(_0x67d2('0xb'));var jsforce=require(_0x67d2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x67d2('0x8'));var querystring=require('querystring');var Papa=require(_0x67d2('0xd'));var Redis=require('ioredis');var authService=require(_0x67d2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x67d2('0xf'));var hardwareService=require(_0x67d2('0x10'));var logger=require(_0x67d2('0x11'))(_0x67d2('0x12'));var utils=require(_0x67d2('0x13'));var config=require(_0x67d2('0x14'));var db=require(_0x67d2('0x15'))['db'];function respondWithStatusCode(_0x1c37ae,_0x1ca3bc){_0x1ca3bc=_0x1ca3bc||0xcc;return function(_0x5bf0a9){if(_0x5bf0a9){return _0x1c37ae[_0x67d2('0x16')](_0x1ca3bc);}return _0x1c37ae['status'](_0x1ca3bc)['end']();};}function respondWithResult(_0x395442,_0x49d14a){_0x49d14a=_0x49d14a||0xc8;return function(_0x55eac0){if(_0x55eac0){return _0x395442[_0x67d2('0x17')](_0x49d14a)[_0x67d2('0x18')](_0x55eac0);}};}function respondWithFilteredResult(_0x2aab20,_0x6d4a26){return function(_0x2baa15){if(_0x2baa15){var _0x4ed99f=_0x2baa15['count'],_0x3e4377=_0x6d4a26[_0x67d2('0x19')],_0x1b2bda=_0x6d4a26[_0x67d2('0x19')]+_0x6d4a26[_0x67d2('0x1a')],_0x5e634f;if(_0x1b2bda>=_0x4ed99f){_0x1b2bda=_0x4ed99f;_0x5e634f=0xc8;}else{_0x5e634f=0xce;}_0x2aab20[_0x67d2('0x17')](_0x5e634f);return _0x2aab20[_0x67d2('0x1b')]('Content-Range',_0x3e4377+'-'+_0x1b2bda+'/'+_0x4ed99f)[_0x67d2('0x18')](_0x2baa15);}return null;};}function patchUpdates(_0x548c0c){return function(_0x421910){try{jsonpatch['apply'](_0x421910,_0x548c0c,!![]);}catch(_0x4c1169){return BPromise['reject'](_0x4c1169);}return _0x421910[_0x67d2('0x1c')]();};}function saveUpdates(_0xc0ae3f,_0x4ef1f2){return function(_0x39eee7){if(_0x39eee7){return _0x39eee7['update'](_0xc0ae3f)[_0x67d2('0x1d')](function(_0x2afa95){return _0x2afa95;});}return null;};}function removeEntity(_0x2bc12b,_0x388737){return function(_0x4957c2){if(_0x4957c2){return _0x4957c2[_0x67d2('0x1e')]()[_0x67d2('0x1d')](function(){_0x2bc12b['status'](0xcc)[_0x67d2('0x1f')]();});}};}function handleEntityNotFound(_0x89792e,_0x916373){return function(_0x213398){if(!_0x213398){_0x89792e[_0x67d2('0x16')](0x194);}return _0x213398;};}function handleError(_0x47f2b8,_0x3f23a1){_0x3f23a1=_0x3f23a1||0x1f4;return function(_0x2ae6b8){logger[_0x67d2('0x20')](_0x2ae6b8[_0x67d2('0x21')]);if(_0x2ae6b8[_0x67d2('0x22')]){delete _0x2ae6b8[_0x67d2('0x22')];}_0x47f2b8['status'](_0x3f23a1)[_0x67d2('0x23')](_0x2ae6b8);};}exports[_0x67d2('0x24')]=function(_0x46ace3,_0x2c60d1){var _0x32a7ef={},_0x4369a4={},_0x15c54a={'count':0x0,'rows':[]};var _0x1dcb14=_[_0x67d2('0x25')](db[_0x67d2('0x26')][_0x67d2('0x27')],function(_0x106f8b){return{'name':_0x106f8b[_0x67d2('0x28')],'type':_0x106f8b[_0x67d2('0x29')]['key']};});_0x4369a4[_0x67d2('0x2a')]=_['map'](_0x1dcb14,_0x67d2('0x22'));_0x4369a4[_0x67d2('0x2b')]=_[_0x67d2('0x2c')](_0x46ace3[_0x67d2('0x2b')]);_0x4369a4[_0x67d2('0x2d')]=_[_0x67d2('0x2e')](_0x4369a4[_0x67d2('0x2a')],_0x4369a4[_0x67d2('0x2b')]);_0x32a7ef[_0x67d2('0x2f')]=_[_0x67d2('0x2e')](_0x4369a4[_0x67d2('0x2a')],qs[_0x67d2('0x30')](_0x46ace3[_0x67d2('0x2b')][_0x67d2('0x30')]));_0x32a7ef[_0x67d2('0x2f')]=_0x32a7ef[_0x67d2('0x2f')][_0x67d2('0x31')]?_0x32a7ef[_0x67d2('0x2f')]:_0x4369a4[_0x67d2('0x2a')];if(!_0x46ace3[_0x67d2('0x2b')][_0x67d2('0x32')](_0x67d2('0x33'))){_0x32a7ef[_0x67d2('0x1a')]=qs[_0x67d2('0x1a')](_0x46ace3[_0x67d2('0x2b')]['limit']);_0x32a7ef[_0x67d2('0x19')]=qs['offset'](_0x46ace3[_0x67d2('0x2b')][_0x67d2('0x19')]);}_0x32a7ef[_0x67d2('0x34')]=qs[_0x67d2('0x35')](_0x46ace3[_0x67d2('0x2b')][_0x67d2('0x35')]);_0x32a7ef['where']=qs['filters'](_[_0x67d2('0x36')](_0x46ace3[_0x67d2('0x2b')],_0x4369a4['filters']));if(_0x46ace3[_0x67d2('0x2b')]['filter']){_0x32a7ef[_0x67d2('0x37')]=_[_0x67d2('0x38')](_0x32a7ef[_0x67d2('0x37')],{'$or':_[_0x67d2('0x25')](_0x1dcb14,function(_0x55f381){if(_0x55f381['type']!==_0x67d2('0x39')){var _0x163488={};_0x163488[_0x55f381[_0x67d2('0x22')]]={'$like':'%'+_0x46ace3[_0x67d2('0x2b')][_0x67d2('0x3a')]+'%'};return _0x163488;}})});}_0x32a7ef=_[_0x67d2('0x38')]({},_0x32a7ef,_0x46ace3[_0x67d2('0x3b')]);var _0x52c678={'where':_0x32a7ef[_0x67d2('0x37')]};return db[_0x67d2('0x26')]['count'](_0x52c678)['then'](function(_0x31d4d4){_0x15c54a[_0x67d2('0x3c')]=_0x31d4d4;if(_0x46ace3['query']['includeAll']){_0x32a7ef['include']=[{'all':!![]}];}return db['VtigerField'][_0x67d2('0x3d')](_0x32a7ef);})[_0x67d2('0x1d')](function(_0x387e63){_0x15c54a[_0x67d2('0x3e')]=_0x387e63;return _0x15c54a;})[_0x67d2('0x1d')](respondWithFilteredResult(_0x2c60d1,_0x32a7ef))[_0x67d2('0x3f')](handleError(_0x2c60d1,null));};exports[_0x67d2('0x40')]=function(_0x3e85d8,_0x19dba6){var _0xaf94b1={'raw':!![],'where':{'id':_0x3e85d8[_0x67d2('0x41')]['id']}},_0x1f735c={};_0x1f735c[_0x67d2('0x2a')]=_[_0x67d2('0x2c')](db[_0x67d2('0x26')][_0x67d2('0x27')]);_0x1f735c[_0x67d2('0x2b')]=_['keys'](_0x3e85d8[_0x67d2('0x2b')]);_0x1f735c['filters']=_['intersection'](_0x1f735c[_0x67d2('0x2a')],_0x1f735c[_0x67d2('0x2b')]);_0xaf94b1['attributes']=_[_0x67d2('0x2e')](_0x1f735c[_0x67d2('0x2a')],qs[_0x67d2('0x30')](_0x3e85d8['query'][_0x67d2('0x30')]));_0xaf94b1[_0x67d2('0x2f')]=_0xaf94b1[_0x67d2('0x2f')][_0x67d2('0x31')]?_0xaf94b1[_0x67d2('0x2f')]:_0x1f735c['model'];if(_0x3e85d8[_0x67d2('0x2b')][_0x67d2('0x42')]){_0xaf94b1['include']=[{'all':!![]}];}_0xaf94b1=_['merge']({},_0xaf94b1,_0x3e85d8['options']);return db['VtigerField'][_0x67d2('0x43')](_0xaf94b1)[_0x67d2('0x1d')](handleEntityNotFound(_0x19dba6,null))[_0x67d2('0x1d')](respondWithResult(_0x19dba6,null))['catch'](handleError(_0x19dba6,null));};exports[_0x67d2('0x44')]=function(_0x245597,_0x127ba3){return db[_0x67d2('0x26')][_0x67d2('0x44')](_0x245597['body'],{})['then'](respondWithResult(_0x127ba3,0xc9))[_0x67d2('0x3f')](handleError(_0x127ba3,null));};exports['update']=function(_0x52e260,_0x2c6ad1){if(_0x52e260[_0x67d2('0x45')]['id']){delete _0x52e260[_0x67d2('0x45')]['id'];}return db['VtigerField'][_0x67d2('0x43')]({'where':{'id':_0x52e260[_0x67d2('0x41')]['id']}})['then'](handleEntityNotFound(_0x2c6ad1,null))[_0x67d2('0x1d')](saveUpdates(_0x52e260[_0x67d2('0x45')],null))['then'](respondWithResult(_0x2c6ad1,null))[_0x67d2('0x3f')](handleError(_0x2c6ad1,null));};exports[_0x67d2('0x1e')]=function(_0x81ca4f,_0x289ae8){return db[_0x67d2('0x26')][_0x67d2('0x43')]({'where':{'id':_0x81ca4f[_0x67d2('0x41')]['id']}})['then'](handleEntityNotFound(_0x289ae8,null))[_0x67d2('0x1d')](removeEntity(_0x289ae8,null))[_0x67d2('0x3f')](handleError(_0x289ae8,null));}; \ No newline at end of file +var _0x7c32=['then','destroy','error','name','send','index','map','VtigerField','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','limit','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','update'];(function(_0x24cf68,_0x1a70c1){var _0x238952=function(_0xa75fd6){while(--_0xa75fd6){_0x24cf68['push'](_0x24cf68['shift']());}};_0x238952(++_0x1a70c1);}(_0x7c32,0xfc));var _0x27c3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7c32[_0x3b380d];return _0x54502b;};'use strict';var pdf=require(_0x27c3('0x0'));var emlformat=require(_0x27c3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x27c3('0x2'));var jsonpatch=require(_0x27c3('0x3'));var rp=require(_0x27c3('0x4'));var moment=require(_0x27c3('0x5'));var BPromise=require(_0x27c3('0x6'));var Mustache=require(_0x27c3('0x7'));var util=require(_0x27c3('0x8'));var path=require(_0x27c3('0x9'));var sox=require('sox');var csv=require(_0x27c3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x27c3('0xb'));var squel=require(_0x27c3('0xc'));var crypto=require(_0x27c3('0xd'));var jsforce=require(_0x27c3('0xe'));var deskjs=require(_0x27c3('0xf'));var toCsv=require(_0x27c3('0xa'));var querystring=require('querystring');var Papa=require(_0x27c3('0x10'));var Redis=require(_0x27c3('0x11'));var authService=require(_0x27c3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x27c3('0x13'));var hardwareService=require(_0x27c3('0x14'));var logger=require(_0x27c3('0x15'))(_0x27c3('0x16'));var utils=require(_0x27c3('0x17'));var config=require(_0x27c3('0x18'));var db=require(_0x27c3('0x19'))['db'];function respondWithStatusCode(_0x204337,_0x144d1e){_0x144d1e=_0x144d1e||0xcc;return function(_0x3c3cf7){if(_0x3c3cf7){return _0x204337[_0x27c3('0x1a')](_0x144d1e);}return _0x204337[_0x27c3('0x1b')](_0x144d1e)[_0x27c3('0x1c')]();};}function respondWithResult(_0x49dce3,_0x2f773d){_0x2f773d=_0x2f773d||0xc8;return function(_0x397ccd){if(_0x397ccd){return _0x49dce3[_0x27c3('0x1b')](_0x2f773d)[_0x27c3('0x1d')](_0x397ccd);}};}function respondWithFilteredResult(_0x2bd772,_0x5e6606){return function(_0x6f890){if(_0x6f890){var _0x1c4468=_0x6f890[_0x27c3('0x1e')],_0x159651=_0x5e6606[_0x27c3('0x1f')],_0x2e45ac=_0x5e6606[_0x27c3('0x1f')]+_0x5e6606['limit'],_0x1ada9a;if(_0x2e45ac>=_0x1c4468){_0x2e45ac=_0x1c4468;_0x1ada9a=0xc8;}else{_0x1ada9a=0xce;}_0x2bd772['status'](_0x1ada9a);return _0x2bd772[_0x27c3('0x20')](_0x27c3('0x21'),_0x159651+'-'+_0x2e45ac+'/'+_0x1c4468)['json'](_0x6f890);}return null;};}function patchUpdates(_0x18efdf){return function(_0x11d198){try{jsonpatch['apply'](_0x11d198,_0x18efdf,!![]);}catch(_0xfa4751){return BPromise[_0x27c3('0x22')](_0xfa4751);}return _0x11d198['save']();};}function saveUpdates(_0x26e815,_0x1868bc){return function(_0x46dd2e){if(_0x46dd2e){return _0x46dd2e[_0x27c3('0x23')](_0x26e815)[_0x27c3('0x24')](function(_0x104ea4){return _0x104ea4;});}return null;};}function removeEntity(_0x5bc4bb,_0x157d97){return function(_0x75e2cd){if(_0x75e2cd){return _0x75e2cd[_0x27c3('0x25')]()['then'](function(){_0x5bc4bb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e687,_0x47e400){return function(_0x2d7f68){if(!_0x2d7f68){_0x25e687[_0x27c3('0x1a')](0x194);}return _0x2d7f68;};}function handleError(_0x3673b0,_0x29e4eb){_0x29e4eb=_0x29e4eb||0x1f4;return function(_0x312c3f){logger[_0x27c3('0x26')](_0x312c3f['stack']);if(_0x312c3f['name']){delete _0x312c3f[_0x27c3('0x27')];}_0x3673b0[_0x27c3('0x1b')](_0x29e4eb)[_0x27c3('0x28')](_0x312c3f);};}exports[_0x27c3('0x29')]=function(_0x3ceaea,_0x4bc554){var _0x45d863={},_0x373e24={},_0x1515f8={'count':0x0,'rows':[]};var _0x37ad0f=_[_0x27c3('0x2a')](db[_0x27c3('0x2b')]['rawAttributes'],function(_0x450b80){return{'name':_0x450b80['fieldName'],'type':_0x450b80[_0x27c3('0x2c')][_0x27c3('0x2d')]};});_0x373e24[_0x27c3('0x2e')]=_[_0x27c3('0x2a')](_0x37ad0f,_0x27c3('0x27'));_0x373e24[_0x27c3('0x2f')]=_[_0x27c3('0x30')](_0x3ceaea[_0x27c3('0x2f')]);_0x373e24[_0x27c3('0x31')]=_[_0x27c3('0x32')](_0x373e24['model'],_0x373e24[_0x27c3('0x2f')]);_0x45d863['attributes']=_[_0x27c3('0x32')](_0x373e24[_0x27c3('0x2e')],qs[_0x27c3('0x33')](_0x3ceaea['query'][_0x27c3('0x33')]));_0x45d863[_0x27c3('0x34')]=_0x45d863[_0x27c3('0x34')]['length']?_0x45d863[_0x27c3('0x34')]:_0x373e24[_0x27c3('0x2e')];if(!_0x3ceaea[_0x27c3('0x2f')]['hasOwnProperty'](_0x27c3('0x35'))){_0x45d863['limit']=qs['limit'](_0x3ceaea['query'][_0x27c3('0x36')]);_0x45d863['offset']=qs[_0x27c3('0x1f')](_0x3ceaea['query'][_0x27c3('0x1f')]);}_0x45d863['order']=qs['sort'](_0x3ceaea[_0x27c3('0x2f')][_0x27c3('0x37')]);_0x45d863['where']=qs[_0x27c3('0x31')](_['pick'](_0x3ceaea['query'],_0x373e24[_0x27c3('0x31')]));if(_0x3ceaea[_0x27c3('0x2f')][_0x27c3('0x38')]){_0x45d863[_0x27c3('0x39')]=_[_0x27c3('0x3a')](_0x45d863['where'],{'$or':_[_0x27c3('0x2a')](_0x37ad0f,function(_0x4dd369){if(_0x4dd369[_0x27c3('0x2c')]!==_0x27c3('0x3b')){var _0x3a2a3c={};_0x3a2a3c[_0x4dd369['name']]={'$like':'%'+_0x3ceaea['query'][_0x27c3('0x38')]+'%'};return _0x3a2a3c;}})});}_0x45d863=_['merge']({},_0x45d863,_0x3ceaea[_0x27c3('0x3c')]);var _0x48c0d7={'where':_0x45d863[_0x27c3('0x39')]};return db[_0x27c3('0x2b')][_0x27c3('0x1e')](_0x48c0d7)[_0x27c3('0x24')](function(_0x31a6b2){_0x1515f8[_0x27c3('0x1e')]=_0x31a6b2;if(_0x3ceaea['query']['includeAll']){_0x45d863[_0x27c3('0x3d')]=[{'all':!![]}];}return db['VtigerField'][_0x27c3('0x3e')](_0x45d863);})[_0x27c3('0x24')](function(_0x196ae8){_0x1515f8[_0x27c3('0x3f')]=_0x196ae8;return _0x1515f8;})[_0x27c3('0x24')](respondWithFilteredResult(_0x4bc554,_0x45d863))[_0x27c3('0x40')](handleError(_0x4bc554,null));};exports[_0x27c3('0x41')]=function(_0x1d5e5b,_0x4a2e8d){var _0xe1c9b7={'raw':!![],'where':{'id':_0x1d5e5b['params']['id']}},_0x2670a9={};_0x2670a9[_0x27c3('0x2e')]=_[_0x27c3('0x30')](db['VtigerField'][_0x27c3('0x42')]);_0x2670a9[_0x27c3('0x2f')]=_[_0x27c3('0x30')](_0x1d5e5b['query']);_0x2670a9[_0x27c3('0x31')]=_[_0x27c3('0x32')](_0x2670a9[_0x27c3('0x2e')],_0x2670a9['query']);_0xe1c9b7[_0x27c3('0x34')]=_[_0x27c3('0x32')](_0x2670a9['model'],qs[_0x27c3('0x33')](_0x1d5e5b[_0x27c3('0x2f')][_0x27c3('0x33')]));_0xe1c9b7[_0x27c3('0x34')]=_0xe1c9b7[_0x27c3('0x34')][_0x27c3('0x43')]?_0xe1c9b7['attributes']:_0x2670a9['model'];if(_0x1d5e5b[_0x27c3('0x2f')]['includeAll']){_0xe1c9b7[_0x27c3('0x3d')]=[{'all':!![]}];}_0xe1c9b7=_[_0x27c3('0x3a')]({},_0xe1c9b7,_0x1d5e5b[_0x27c3('0x3c')]);return db[_0x27c3('0x2b')][_0x27c3('0x44')](_0xe1c9b7)[_0x27c3('0x24')](handleEntityNotFound(_0x4a2e8d,null))[_0x27c3('0x24')](respondWithResult(_0x4a2e8d,null))[_0x27c3('0x40')](handleError(_0x4a2e8d,null));};exports['create']=function(_0x2e5e78,_0x169af8){return db['VtigerField'][_0x27c3('0x45')](_0x2e5e78[_0x27c3('0x46')],{})[_0x27c3('0x24')](respondWithResult(_0x169af8,0xc9))[_0x27c3('0x40')](handleError(_0x169af8,null));};exports[_0x27c3('0x23')]=function(_0x2e9d6e,_0x11870c){if(_0x2e9d6e[_0x27c3('0x46')]['id']){delete _0x2e9d6e[_0x27c3('0x46')]['id'];}return db[_0x27c3('0x2b')]['find']({'where':{'id':_0x2e9d6e[_0x27c3('0x47')]['id']}})[_0x27c3('0x24')](handleEntityNotFound(_0x11870c,null))[_0x27c3('0x24')](saveUpdates(_0x2e9d6e[_0x27c3('0x46')],null))[_0x27c3('0x24')](respondWithResult(_0x11870c,null))[_0x27c3('0x40')](handleError(_0x11870c,null));};exports[_0x27c3('0x25')]=function(_0x3fc4e6,_0x52b90b){return db[_0x27c3('0x2b')][_0x27c3('0x44')]({'where':{'id':_0x3fc4e6[_0x27c3('0x47')]['id']}})['then'](handleEntityNotFound(_0x52b90b,null))[_0x27c3('0x24')](removeEntity(_0x52b90b,null))['catch'](handleError(_0x52b90b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index d59cdfe..c43ab86 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(_0x2d774e,_0x162436){var _0x4f6fdd=function(_0x5d103e){while(--_0x5d103e){_0x2d774e['push'](_0x2d774e['shift']());}};_0x4f6fdd(++_0x162436);}(_0x7a54,0x106));var _0x47a5=function(_0x271b84,_0x5b2f52){_0x271b84=_0x271b84-0x0;var _0x195869=_0x7a54[_0x271b84];return _0x195869;};'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(_0x3fd9d3,_0x4f328c){var _0xf65a32=function(_0x5f0fbf){while(--_0x5f0fbf){_0x3fd9d3['push'](_0x3fd9d3['shift']());}};_0xf65a32(++_0x4f328c);}(_0x7a54,0x106));var _0x47a5=function(_0x4f84ba,_0x5e1db0){_0x4f84ba=_0x4f84ba-0x0;var _0x1b1b9d=_0x7a54[_0x4f84ba];return _0x1b1b9d;};'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 21a7eea..53951aa 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 _0x3c66=['jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5e3701,_0x596265){var _0x345dcf=function(_0x5eb12a){while(--_0x5eb12a){_0x5e3701['push'](_0x5e3701['shift']());}};_0x345dcf(++_0x596265);}(_0x3c66,0x8b));var _0x63c6=function(_0x2ae8fb,_0xdea0a8){_0x2ae8fb=_0x2ae8fb-0x0;var _0x344c82=_0x3c66[_0x2ae8fb];return _0x344c82;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x63c6('0x0'));var rs=require(_0x63c6('0x1'));var fs=require('fs');var Redis=require(_0x63c6('0x2'));var db=require(_0x63c6('0x3'))['db'];var utils=require(_0x63c6('0x4'));var logger=require(_0x63c6('0x5'))(_0x63c6('0x6'));var config=require(_0x63c6('0x7'));var jayson=require(_0x63c6('0x8'));var client=jayson[_0x63c6('0x9')][_0x63c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b33e8,_0x47b438,_0x232099){return new BPromise(function(_0x50ff5c,_0x44e826){return client[_0x63c6('0xb')](_0x2b33e8,_0x232099)['then'](function(_0x386110){logger[_0x63c6('0xc')](_0x63c6('0xd'),_0x47b438,_0x63c6('0xe'));logger[_0x63c6('0xf')](_0x63c6('0x10'),_0x47b438,'request\x20sent',JSON[_0x63c6('0x11')](_0x386110));if(_0x386110[_0x63c6('0x12')]){if(_0x386110[_0x63c6('0x12')]['code']===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x47b438,_0x386110['error']['message']);return _0x44e826(_0x386110['error'][_0x63c6('0x13')]);}logger[_0x63c6('0x12')](_0x63c6('0xd'),_0x47b438,_0x386110[_0x63c6('0x12')][_0x63c6('0x13')]);return _0x50ff5c(_0x386110['error'][_0x63c6('0x13')]);}else{logger[_0x63c6('0xc')]('VtigerField,\x20%s,\x20%s',_0x47b438,_0x63c6('0xe'));_0x50ff5c(_0x386110['result']['message']);}})[_0x63c6('0x14')](function(_0x571022){logger[_0x63c6('0x12')](_0x63c6('0xd'),_0x47b438,_0x571022);_0x44e826(_0x571022);});});} \ No newline at end of file +var _0xf089=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','VtigerField,\x20%s,\x20%s','message','util','moment','randomstring','ioredis'];(function(_0x168127,_0x59cea1){var _0x4c99ad=function(_0x4ab3f2){while(--_0x4ab3f2){_0x168127['push'](_0x168127['shift']());}};_0x4c99ad(++_0x59cea1);}(_0xf089,0xba));var _0x9f08=function(_0x27d582,_0x16853e){_0x27d582=_0x27d582-0x0;var _0x231073=_0xf089[_0x27d582];return _0x231073;};'use strict';var _=require('lodash');var util=require(_0x9f08('0x0'));var moment=require(_0x9f08('0x1'));var BPromise=require('bluebird');var rs=require(_0x9f08('0x2'));var fs=require('fs');var Redis=require(_0x9f08('0x3'));var db=require(_0x9f08('0x4'))['db'];var utils=require(_0x9f08('0x5'));var logger=require('../../config/logger')(_0x9f08('0x6'));var config=require(_0x9f08('0x7'));var jayson=require(_0x9f08('0x8'));var client=jayson[_0x9f08('0x9')][_0x9f08('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39abe2,_0x5341c9,_0x9cfade){return new BPromise(function(_0x4b37fc,_0x39e238){return client['request'](_0x39abe2,_0x9cfade)[_0x9f08('0xb')](function(_0x286809){logger[_0x9f08('0xc')]('VtigerField,\x20%s,\x20%s',_0x5341c9,_0x9f08('0xd'));logger[_0x9f08('0xe')](_0x9f08('0xf'),_0x5341c9,'request\x20sent',JSON['stringify'](_0x286809));if(_0x286809[_0x9f08('0x10')]){if(_0x286809[_0x9f08('0x10')]['code']===0x1f4){logger[_0x9f08('0x10')](_0x9f08('0x11'),_0x5341c9,_0x286809[_0x9f08('0x10')]['message']);return _0x39e238(_0x286809['error'][_0x9f08('0x12')]);}logger[_0x9f08('0x10')](_0x9f08('0x11'),_0x5341c9,_0x286809[_0x9f08('0x10')]['message']);return _0x4b37fc(_0x286809[_0x9f08('0x10')][_0x9f08('0x12')]);}else{logger[_0x9f08('0xc')](_0x9f08('0x11'),_0x5341c9,_0x9f08('0xd'));_0x4b37fc(_0x286809['result'][_0x9f08('0x12')]);}})['catch'](function(_0x5a562c){logger[_0x9f08('0x10')](_0x9f08('0x11'),_0x5341c9,_0x5a562c);_0x39e238(_0x5a562c);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 8bda6e0..1dba548 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 _0x356c=['../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x2486be,_0x5d7dd2){var _0x24042b=function(_0x171418){while(--_0x171418){_0x2486be['push'](_0x2486be['shift']());}};_0x24042b(++_0x5d7dd2);}(_0x356c,0x14d));var _0xc356=function(_0x28bbcf,_0x1f491a){_0x28bbcf=_0x28bbcf-0x0;var _0x3ef2c5=_0x356c[_0x28bbcf];return _0x3ef2c5;};'use strict';var multer=require(_0xc356('0x0'));var util=require(_0xc356('0x1'));var path=require(_0xc356('0x2'));var timeout=require(_0xc356('0x3'));var express=require(_0xc356('0x4'));var router=express['Router']();var auth=require(_0xc356('0x5'));var interaction=require(_0xc356('0x6'));var config=require(_0xc356('0x7'));var controller=require(_0xc356('0x8'));router['get']('/',auth[_0xc356('0x9')](),controller[_0xc356('0xa')]);router[_0xc356('0xb')](_0xc356('0xc'),auth['isAuthenticated'](),controller[_0xc356('0xd')]);router[_0xc356('0xb')](_0xc356('0xe'),auth['isAuthenticated'](),controller[_0xc356('0xf')]);router[_0xc356('0xb')](_0xc356('0x10'),auth[_0xc356('0x9')](),controller['getFields']);router['post']('/',auth[_0xc356('0x9')](),controller[_0xc356('0x11')]);router['post'](_0xc356('0xe'),auth[_0xc356('0x9')](),controller['addConfiguration']);router['put'](_0xc356('0xc'),auth[_0xc356('0x9')](),controller['update']);router['delete'](_0xc356('0xc'),auth[_0xc356('0x9')](),controller[_0xc356('0x12')]);module[_0xc356('0x13')]=router; \ No newline at end of file +var _0xcedd=['create','/:id/configurations','addConfiguration','put','/:id','update','delete','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields','post'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0xcedd,0x1c0));var _0xdced=function(_0xf2ee56,_0x565642){_0xf2ee56=_0xf2ee56-0x0;var _0x2b9bc9=_0xcedd[_0xf2ee56];return _0x2b9bc9;};'use strict';var multer=require(_0xdced('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdced('0x1'));var express=require(_0xdced('0x2'));var router=express[_0xdced('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xdced('0x4'));var config=require(_0xdced('0x5'));var controller=require(_0xdced('0x6'));router[_0xdced('0x7')]('/',auth[_0xdced('0x8')](),controller[_0xdced('0x9')]);router[_0xdced('0x7')]('/:id',auth[_0xdced('0x8')](),controller[_0xdced('0xa')]);router[_0xdced('0x7')]('/:id/configurations',auth[_0xdced('0x8')](),controller[_0xdced('0xb')]);router['get'](_0xdced('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xdced('0xd')]('/',auth[_0xdced('0x8')](),controller[_0xdced('0xe')]);router[_0xdced('0xd')](_0xdced('0xf'),auth[_0xdced('0x8')](),controller[_0xdced('0x10')]);router[_0xdced('0x11')](_0xdced('0x12'),auth[_0xdced('0x8')](),controller[_0xdced('0x13')]);router[_0xdced('0x14')](_0xdced('0x12'),auth[_0xdced('0x8')](),controller['destroy']);module[_0xdced('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 5ef4995..4420e4f 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 _0x067a=['sequelize','exports','STRING','remoteUri','ENUM','password','integrationTab'];(function(_0x493a21,_0x8c32ad){var _0x16557d=function(_0x2b542e){while(--_0x2b542e){_0x493a21['push'](_0x493a21['shift']());}};_0x16557d(++_0x8c32ad);}(_0x067a,0x157));var _0xa067=function(_0x4b8844,_0x42ce2c){_0x4b8844=_0x4b8844-0x0;var _0x3f9f30=_0x067a[_0x4b8844];return _0x3f9f30;};'use strict';var Sequelize=require(_0xa067('0x0'));module[_0xa067('0x1')]={'name':{'type':Sequelize[_0xa067('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xa067('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa067('0x2')],'unique':_0xa067('0x3')},'authType':{'type':Sequelize[_0xa067('0x4')](_0xa067('0x5'),'token'),'defaultValue':_0xa067('0x5')},'serverUrl':{'type':Sequelize[_0xa067('0x2')]},'type':{'type':Sequelize[_0xa067('0x4')](_0xa067('0x6'),'newTab'),'defaultValue':_0xa067('0x6')}}; \ No newline at end of file +var _0xea84=['newTab','sequelize','exports','STRING','username','remoteUri','ENUM','password','integrationTab'];(function(_0x262fcb,_0x504b5f){var _0x585029=function(_0x37e821){while(--_0x37e821){_0x262fcb['push'](_0x262fcb['shift']());}};_0x585029(++_0x504b5f);}(_0xea84,0x160));var _0x4ea8=function(_0x235a36,_0x3a7b34){_0x235a36=_0x235a36-0x0;var _0x2de910=_0xea84[_0x235a36];return _0x2de910;};'use strict';var Sequelize=require(_0x4ea8('0x0'));module[_0x4ea8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4ea8('0x2')]},'username':{'type':Sequelize[_0x4ea8('0x2')],'unique':_0x4ea8('0x3')},'password':{'type':Sequelize[_0x4ea8('0x2')]},'token':{'type':Sequelize[_0x4ea8('0x2')]},'remoteUri':{'type':Sequelize[_0x4ea8('0x2')],'unique':_0x4ea8('0x4')},'authType':{'type':Sequelize[_0x4ea8('0x5')]('password','token'),'defaultValue':_0x4ea8('0x6')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4ea8('0x5')](_0x4ea8('0x7'),_0x4ea8('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index bcba41b..c99c6c4 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 _0x19a4=['pick','type','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','getConfigurations','findOne','ZendeskConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','ticket_fields','headers','format','Basic\x20%s','toString','base64','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','getFields','send','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','debug','stringify','error','code','message','request\x20sent','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','index','ZendeskAccount','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x19a4,0xb6));var _0x419a=function(_0x4d1e68,_0x30eda4){_0x4d1e68=_0x4d1e68-0x0;var _0x16be97=_0x19a4[_0x4d1e68];return _0x16be97;};'use strict';var pdf=require(_0x419a('0x0'));var emlformat=require(_0x419a('0x1'));var rimraf=require(_0x419a('0x2'));var zipdir=require(_0x419a('0x3'));var jsonpatch=require(_0x419a('0x4'));var rp=require(_0x419a('0x5'));var moment=require(_0x419a('0x6'));var BPromise=require(_0x419a('0x7'));var Mustache=require(_0x419a('0x8'));var util=require(_0x419a('0x9'));var path=require(_0x419a('0xa'));var sox=require(_0x419a('0xb'));var csv=require('to-csv');var ejs=require(_0x419a('0xc'));var fs=require('fs');var _=require(_0x419a('0xd'));var squel=require('squel');var crypto=require(_0x419a('0xe'));var jsforce=require(_0x419a('0xf'));var deskjs=require(_0x419a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x419a('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x419a('0x12'));var as=require(_0x419a('0x13'));var hardwareService=require(_0x419a('0x14'));var logger=require(_0x419a('0x15'))(_0x419a('0x16'));var utils=require('../../config/utils');var config=require(_0x419a('0x17'));var db=require(_0x419a('0x18'))['db'];var integrations=require(_0x419a('0x19'));var jayson=require('jayson/promise');var client=jayson[_0x419a('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x34bf77,_0x19d18e,_0x208e95){if(_0x208e95){var _0x18ed41=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x18ed41[_0x419a('0x1b')](_0x19d18e)){return _0x34bf77;}else{throw new db[(_0x419a('0x1c'))][(_0x419a('0x1d'))](_0x419a('0x1e'));}}else{return _0x34bf77;}}function respondWithRpcPromise(_0x1b63c2,_0x58ed84,_0xe2c007,_0x16e7bb){return new BPromise(function(_0x10db47,_0x1eee89){var _0x3aff44=_0x16e7bb||client;return _0x3aff44['request'](_0x1b63c2,_0xe2c007)[_0x419a('0x1f')](function(_0x5da537){logger[_0x419a('0x20')]('ZendeskAccount,\x20%s,\x20%s',_0x58ed84,'request\x20sent');logger[_0x419a('0x21')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x58ed84,'request\x20sent',JSON[_0x419a('0x22')](_0x5da537));if(_0x5da537[_0x419a('0x23')]){if(_0x5da537[_0x419a('0x23')][_0x419a('0x24')]===0x1f4){logger[_0x419a('0x23')]('ZendeskAccount,\x20%s,\x20%s',_0x58ed84,_0x5da537[_0x419a('0x23')]['message']);return _0x1eee89(_0x5da537[_0x419a('0x23')][_0x419a('0x25')]);}logger[_0x419a('0x23')]('ZendeskAccount,\x20%s,\x20%s',_0x58ed84,_0x5da537['error'][_0x419a('0x25')]);return _0x10db47(_0x5da537['error']['message']);}else{logger[_0x419a('0x20')]('ZendeskAccount,\x20%s,\x20%s',_0x58ed84,_0x419a('0x26'));_0x10db47(_0x5da537['result'][_0x419a('0x25')]);}})['catch'](function(_0x444c6b){logger[_0x419a('0x23')]('ZendeskAccount,\x20%s,\x20%s',_0x58ed84,_0x444c6b);_0x1eee89(_0x444c6b);});});}function respondWithStatusCode(_0x2d7b76,_0x142f8a){_0x142f8a=_0x142f8a||0xcc;return function(_0x19d1d0){if(_0x19d1d0){return _0x2d7b76[_0x419a('0x27')](_0x142f8a);}return _0x2d7b76[_0x419a('0x28')](_0x142f8a)[_0x419a('0x29')]();};}function respondWithResult(_0x5a2f60,_0x56d461){_0x56d461=_0x56d461||0xc8;return function(_0x29e7f8){if(_0x29e7f8){return _0x5a2f60[_0x419a('0x28')](_0x56d461)[_0x419a('0x2a')](_0x29e7f8);}};}function respondWithFilteredResult(_0x1bbc65,_0x1cf052){return function(_0x4616f8){if(_0x4616f8){var _0x1fa68a=_0x4616f8[_0x419a('0x2b')],_0x196a63=_0x1cf052[_0x419a('0x2c')],_0x512c2a=_0x1cf052[_0x419a('0x2c')]+_0x1cf052[_0x419a('0x2d')],_0x26022c;if(_0x512c2a>=_0x1fa68a){_0x512c2a=_0x1fa68a;_0x26022c=0xc8;}else{_0x26022c=0xce;}_0x1bbc65[_0x419a('0x28')](_0x26022c);return _0x1bbc65[_0x419a('0x2e')](_0x419a('0x2f'),_0x196a63+'-'+_0x512c2a+'/'+_0x1fa68a)[_0x419a('0x2a')](_0x4616f8);}return null;};}function patchUpdates(_0x1236a4){return function(_0x2d334a){try{jsonpatch[_0x419a('0x30')](_0x2d334a,_0x1236a4,!![]);}catch(_0x29e23f){return BPromise[_0x419a('0x31')](_0x29e23f);}return _0x2d334a[_0x419a('0x32')]();};}function saveUpdates(_0xbd494f,_0x4771d6){return function(_0xede0d){if(_0xede0d){return _0xede0d[_0x419a('0x33')](_0xbd494f)[_0x419a('0x1f')](function(_0x5acf39){return _0x5acf39;});}return null;};}function removeEntity(_0x4393fb,_0x1bfc99){return function(_0x1c9500){if(_0x1c9500){return _0x1c9500[_0x419a('0x34')]()[_0x419a('0x1f')](function(){_0x4393fb[_0x419a('0x28')](0xcc)[_0x419a('0x29')]();});}};}function handleEntityNotFound(_0x4d8915,_0x2c5cb0){return function(_0x150554){if(!_0x150554){_0x4d8915[_0x419a('0x27')](0x194);}return _0x150554;};}function handleError(_0x5cb3cb,_0xea5443){_0xea5443=_0xea5443||0x1f4;return function(_0x550758){logger['error'](_0x550758['stack']);if(_0x550758['name']){delete _0x550758[_0x419a('0x35')];}_0x5cb3cb['status'](_0xea5443)['send'](_0x550758);};}exports[_0x419a('0x36')]=function(_0xfed8bd,_0x22fedf){var _0x35914d={},_0x486800={},_0x4d0b03={'count':0x0,'rows':[]};var _0x1796c8=_['map'](db[_0x419a('0x37')][_0x419a('0x38')],function(_0x52ee35){return{'name':_0x52ee35['fieldName'],'type':_0x52ee35['type'][_0x419a('0x39')]};});_0x486800[_0x419a('0x3a')]=_[_0x419a('0x3b')](_0x1796c8,_0x419a('0x35'));_0x486800[_0x419a('0x3c')]=_[_0x419a('0x3d')](_0xfed8bd[_0x419a('0x3c')]);_0x486800[_0x419a('0x3e')]=_[_0x419a('0x3f')](_0x486800[_0x419a('0x3a')],_0x486800[_0x419a('0x3c')]);_0x35914d[_0x419a('0x40')]=_[_0x419a('0x3f')](_0x486800['model'],qs['fields'](_0xfed8bd[_0x419a('0x3c')][_0x419a('0x41')]));_0x35914d[_0x419a('0x40')]=_0x35914d[_0x419a('0x40')][_0x419a('0x42')]?_0x35914d['attributes']:_0x486800[_0x419a('0x3a')];if(!_0xfed8bd[_0x419a('0x3c')][_0x419a('0x43')](_0x419a('0x44'))){_0x35914d[_0x419a('0x2d')]=qs[_0x419a('0x2d')](_0xfed8bd[_0x419a('0x3c')][_0x419a('0x2d')]);_0x35914d[_0x419a('0x2c')]=qs[_0x419a('0x2c')](_0xfed8bd[_0x419a('0x3c')]['offset']);}_0x35914d[_0x419a('0x45')]=qs['sort'](_0xfed8bd[_0x419a('0x3c')][_0x419a('0x46')]);_0x35914d[_0x419a('0x47')]=qs[_0x419a('0x3e')](_[_0x419a('0x48')](_0xfed8bd['query'],_0x486800[_0x419a('0x3e')]));if(_0xfed8bd[_0x419a('0x3c')]['filter']){_0x35914d[_0x419a('0x47')]=_['merge'](_0x35914d[_0x419a('0x47')],{'$or':_['map'](_0x1796c8,function(_0x5bfe4a){if(_0x5bfe4a[_0x419a('0x49')]!==_0x419a('0x4a')){var _0x1a9eb5={};_0x1a9eb5[_0x5bfe4a[_0x419a('0x35')]]={'$like':'%'+_0xfed8bd[_0x419a('0x3c')][_0x419a('0x4b')]+'%'};return _0x1a9eb5;}})});}_0x35914d=_[_0x419a('0x4c')]({},_0x35914d,_0xfed8bd['options']);var _0xaf2769={'where':_0x35914d[_0x419a('0x47')]};return db[_0x419a('0x37')]['count'](_0xaf2769)[_0x419a('0x1f')](function(_0x28395f){_0x4d0b03[_0x419a('0x2b')]=_0x28395f;if(_0xfed8bd[_0x419a('0x3c')][_0x419a('0x4d')]){_0x35914d[_0x419a('0x4e')]=[{'all':!![]}];}return db[_0x419a('0x37')][_0x419a('0x4f')](_0x35914d);})['then'](function(_0x54a424){_0x4d0b03[_0x419a('0x50')]=_0x54a424;return _0x4d0b03;})[_0x419a('0x1f')](respondWithFilteredResult(_0x22fedf,_0x35914d))[_0x419a('0x51')](handleError(_0x22fedf,null));};exports[_0x419a('0x52')]=function(_0xb3972a,_0x595c61){var _0xe2ec34={'raw':![],'where':{'id':_0xb3972a['params']['id']}},_0x4411a7={};_0x4411a7[_0x419a('0x3a')]=_[_0x419a('0x3d')](db[_0x419a('0x37')][_0x419a('0x38')]);_0x4411a7[_0x419a('0x3c')]=_[_0x419a('0x3d')](_0xb3972a[_0x419a('0x3c')]);_0x4411a7[_0x419a('0x3e')]=_[_0x419a('0x3f')](_0x4411a7[_0x419a('0x3a')],_0x4411a7[_0x419a('0x3c')]);_0xe2ec34[_0x419a('0x40')]=_[_0x419a('0x3f')](_0x4411a7[_0x419a('0x3a')],qs[_0x419a('0x41')](_0xb3972a[_0x419a('0x3c')][_0x419a('0x41')]));_0xe2ec34[_0x419a('0x40')]=_0xe2ec34['attributes']['length']?_0xe2ec34[_0x419a('0x40')]:_0x4411a7[_0x419a('0x3a')];if(_0xb3972a[_0x419a('0x3c')]['includeAll']){_0xe2ec34['include']=[{'all':!![]}];}_0xe2ec34=_['merge']({},_0xe2ec34,_0xb3972a[_0x419a('0x53')]);return db[_0x419a('0x37')][_0x419a('0x54')](_0xe2ec34)[_0x419a('0x1f')](handleEntityNotFound(_0x595c61,null))[_0x419a('0x1f')](respondWithResult(_0x595c61,null))[_0x419a('0x51')](handleError(_0x595c61,null));};exports[_0x419a('0x55')]=function(_0x41d00a,_0x5e6a5e){return db[_0x419a('0x37')][_0x419a('0x55')](_0x41d00a[_0x419a('0x56')],{})[_0x419a('0x1f')](respondWithResult(_0x5e6a5e,0xc9))['catch'](handleError(_0x5e6a5e,null));};exports[_0x419a('0x33')]=function(_0x54659f,_0x2ef3fa){if(_0x54659f[_0x419a('0x56')]['id']){delete _0x54659f[_0x419a('0x56')]['id'];}return db[_0x419a('0x37')]['find']({'where':{'id':_0x54659f[_0x419a('0x57')]['id']}})[_0x419a('0x1f')](handleEntityNotFound(_0x2ef3fa,null))[_0x419a('0x1f')](saveUpdates(_0x54659f[_0x419a('0x56')],null))[_0x419a('0x1f')](respondWithResult(_0x2ef3fa,null))[_0x419a('0x51')](handleError(_0x2ef3fa,null));};exports[_0x419a('0x34')]=function(_0x26a97b,_0x1d8e67){return db[_0x419a('0x37')]['find']({'where':{'id':_0x26a97b[_0x419a('0x57')]['id']}})['then'](handleEntityNotFound(_0x1d8e67,null))[_0x419a('0x1f')](removeEntity(_0x1d8e67,null))[_0x419a('0x51')](handleError(_0x1d8e67,null));};exports[_0x419a('0x58')]=function(_0x494180,_0x5721d3,_0x161f06){var _0x4b398b={};var _0x132343={};var _0xfe73e5;var _0x294dd7;return db[_0x419a('0x37')][_0x419a('0x59')]({'where':{'id':_0x494180['params']['id']}})[_0x419a('0x1f')](handleEntityNotFound(_0x5721d3,null))[_0x419a('0x1f')](function(_0x20da3a){if(_0x20da3a){_0xfe73e5=_0x20da3a;_0x132343[_0x419a('0x3a')]=_[_0x419a('0x3d')](db[_0x419a('0x5a')][_0x419a('0x38')]);_0x132343['query']=_[_0x419a('0x3d')](_0x494180[_0x419a('0x3c')]);_0x132343['filters']=_[_0x419a('0x3f')](_0x132343['model'],_0x132343[_0x419a('0x3c')]);_0x4b398b['attributes']=_[_0x419a('0x3f')](_0x132343[_0x419a('0x3a')],qs[_0x419a('0x41')](_0x494180[_0x419a('0x3c')]['fields']));_0x4b398b[_0x419a('0x40')]=_0x4b398b[_0x419a('0x40')]['length']?_0x4b398b[_0x419a('0x40')]:_0x132343[_0x419a('0x3a')];_0x4b398b[_0x419a('0x45')]=qs[_0x419a('0x46')](_0x494180[_0x419a('0x3c')][_0x419a('0x46')]);_0x4b398b[_0x419a('0x47')]=qs[_0x419a('0x3e')](_[_0x419a('0x48')](_0x494180[_0x419a('0x3c')],_0x132343[_0x419a('0x3e')]));if(_0x494180[_0x419a('0x3c')][_0x419a('0x4b')]){_0x4b398b[_0x419a('0x47')]=_['merge'](_0x4b398b[_0x419a('0x47')],{'$or':_[_0x419a('0x3b')](_0x4b398b[_0x419a('0x40')],function(_0x2bccaf){var _0x48707c={};_0x48707c[_0x2bccaf]={'$like':'%'+_0x494180[_0x419a('0x3c')][_0x419a('0x4b')]+'%'};return _0x48707c;})});}_0x4b398b=_[_0x419a('0x4c')]({},_0x4b398b,_0x494180[_0x419a('0x53')]);return _0xfe73e5[_0x419a('0x58')](_0x4b398b);}})[_0x419a('0x1f')](function(_0x5b8479){if(_0x5b8479){_0x294dd7=_0x5b8479[_0x419a('0x42')];if(!_0x494180[_0x419a('0x3c')][_0x419a('0x43')](_0x419a('0x44'))){_0x4b398b['limit']=qs[_0x419a('0x2d')](_0x494180[_0x419a('0x3c')][_0x419a('0x2d')]);_0x4b398b[_0x419a('0x2c')]=qs[_0x419a('0x2c')](_0x494180[_0x419a('0x3c')][_0x419a('0x2c')]);}return _0xfe73e5[_0x419a('0x58')](_0x4b398b);}})['then'](function(_0x393650){if(_0x393650){return _0x393650?{'count':_0x294dd7,'rows':_0x393650}:null;}})['then'](respondWithResult(_0x5721d3,null))[_0x419a('0x51')](handleError(_0x5721d3,null));};exports['addConfiguration']=function(_0x224d21,_0x232517,_0x3955db){if(_0x224d21['body']['id']){delete _0x224d21[_0x419a('0x56')]['id'];}return db[_0x419a('0x37')]['findOne']({'where':{'id':_0x224d21[_0x419a('0x57')]['id']}})[_0x419a('0x1f')](handleEntityNotFound(_0x232517,null))[_0x419a('0x1f')](function(_0x3e8b2e){if(_0x3e8b2e){_0x224d21[_0x419a('0x56')][_0x419a('0x5b')]=_0x3e8b2e['id'];_0x224d21[_0x419a('0x56')][_0x419a('0x5c')]=integrations[_0x419a('0x5d')](_0x224d21[_0x419a('0x56')][_0x419a('0x5e')],_0x224d21[_0x419a('0x56')][_0x419a('0x49')]);_0x224d21[_0x419a('0x56')][_0x419a('0x5f')]=integrations[_0x419a('0x60')](_0x224d21[_0x419a('0x56')][_0x419a('0x5e')],_0x224d21[_0x419a('0x56')][_0x419a('0x49')]);return db[_0x419a('0x5a')][_0x419a('0x55')](_0x224d21[_0x419a('0x56')],{'include':[{'model':db[_0x419a('0x61')],'as':_0x419a('0x5c')},{'model':db[_0x419a('0x61')],'as':_0x419a('0x5f')}]});}return null;})[_0x419a('0x1f')](respondWithResult(_0x232517,null))[_0x419a('0x51')](handleError(_0x232517,null));};exports['getFields']=function(_0x11b1cf,_0x2a39f5,_0x28f301){var _0x5df5a4='';return db[_0x419a('0x37')][_0x419a('0x59')]({'where':{'id':_0x11b1cf[_0x419a('0x57')]['id']},'attributes':['id',_0x419a('0x62'),_0x419a('0x63'),_0x419a('0x64'),_0x419a('0x65'),_0x419a('0x66')]})[_0x419a('0x1f')](handleEntityNotFound(_0x2a39f5,null))[_0x419a('0x1f')](function(_0x59e81f){if(_0x59e81f){_0x5df5a4=_0x59e81f[_0x419a('0x66')];var _0x44bc0d=_0x5df5a4[_0x419a('0x67')](-0x1);if(_0x44bc0d==='/'){_0x5df5a4=_0x5df5a4[_0x419a('0x68')](0x0,_0x5df5a4[_0x419a('0x69')](_0x44bc0d));}var _0x58a19e={'method':_0x419a('0x6a'),'uri':util['format']('%s/%s',_0x5df5a4,_0x419a('0x6b')),'json':!![]};switch(_0x59e81f['authType']){case _0x419a('0x63'):_0x58a19e[_0x419a('0x6c')]={'Authorization':util[_0x419a('0x6d')](_0x419a('0x6e'),new Buffer(util[_0x419a('0x6d')]('%s:%s',_0x59e81f[_0x419a('0x62')],_0x59e81f[_0x419a('0x63')]))[_0x419a('0x6f')](_0x419a('0x70')))};break;case _0x419a('0x64'):_0x58a19e[_0x419a('0x6c')]={'Authorization':util[_0x419a('0x6d')](_0x419a('0x6e'),new Buffer(util[_0x419a('0x6d')]('%s/token:%s',_0x59e81f['username'],_0x59e81f[_0x419a('0x64')]))[_0x419a('0x6f')](_0x419a('0x70')))};break;default:throw new db[(_0x419a('0x1c'))][(_0x419a('0x1d'))](_0x419a('0x71'));}return rp(_0x58a19e);}})['then'](function(_0x44ec6f){if(_0x44ec6f){var _0x501155=[_0x419a('0x72'),_0x419a('0x73'),'group',_0x419a('0x74')];_[_0x419a('0x75')](_0x44ec6f[_0x419a('0x6b')],function(_0xd9a945){return _0x501155[_0x419a('0x76')](_0xd9a945[_0x419a('0x49')]);});return{'count':_0x44ec6f[_0x419a('0x6b')][_0x419a('0x42')],'rows':_[_0x419a('0x3b')](_0x44ec6f['ticket_fields'],function(_0x4448a8){return{'id':_0x4448a8['id'],'name':_0x4448a8[_0x419a('0x77')]>0x7?_0x4448a8[_0x419a('0x78')]:_0x4448a8[_0x419a('0x49')],'custom':_0x4448a8[_0x419a('0x77')]>0x7?!![]:![],'options':_0x4448a8[_0x419a('0x79')]?_0x4448a8['system_field_options']:_0x4448a8[_0x419a('0x7a')]?_0x4448a8[_0x419a('0x7a')]:[]};})};}})['then'](respondWithResult(_0x2a39f5,null))[_0x419a('0x51')](function(_0xe3b814){var _0x38934c=_0x11b1cf['query'][_0x419a('0x1b')]?0x1f4:_0xe3b814['statusCode']||0x1f4;logger[_0x419a('0x23')](_0x419a('0x7b'),_0x419a('0x7c'),_0x38934c,JSON['stringify'](_0xe3b814));delete _0xe3b814[_0x419a('0x35')];if(_0x38934c===0x191){_0x38934c=0x190;}_0x2a39f5[_0x419a('0x28')](_0x38934c)[_0x419a('0x7d')](_0x11b1cf[_0x419a('0x3c')][_0x419a('0x1b')]?{'message':'Wrong\x20credentials','statusCode':_0xe3b814[_0x419a('0x7e')]}:_0xe3b814);});}; \ No newline at end of file +var _0x6907=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','count','offset','limit','apply','save','update','destroy','sendStatus','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','include','find','create','body','findOne','ZendeskConfiguration','length','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','username','token','authType','remoteUri','substring','password','headers','format','%s:%s','toString','%s/token:%s','base64','Unknown\x20authentication\x20type','subject','description','group','assignee','ticket_fields','includes','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash'];(function(_0x4ee881,_0x10ddc8){var _0x305f48=function(_0x5303d5){while(--_0x5303d5){_0x4ee881['push'](_0x4ee881['shift']());}};_0x305f48(++_0x10ddc8);}(_0x6907,0x1ec));var _0x7690=function(_0x586f38,_0x5835e5){_0x586f38=_0x586f38-0x0;var _0xb025f9=_0x6907[_0x586f38];return _0xb025f9;};'use strict';var pdf=require(_0x7690('0x0'));var emlformat=require(_0x7690('0x1'));var rimraf=require(_0x7690('0x2'));var zipdir=require(_0x7690('0x3'));var jsonpatch=require(_0x7690('0x4'));var rp=require(_0x7690('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7690('0x6'));var path=require(_0x7690('0x7'));var sox=require(_0x7690('0x8'));var csv=require(_0x7690('0x9'));var ejs=require(_0x7690('0xa'));var fs=require('fs');var _=require(_0x7690('0xb'));var squel=require(_0x7690('0xc'));var crypto=require(_0x7690('0xd'));var jsforce=require(_0x7690('0xe'));var deskjs=require(_0x7690('0xf'));var toCsv=require(_0x7690('0x9'));var querystring=require(_0x7690('0x10'));var Papa=require(_0x7690('0x11'));var Redis=require(_0x7690('0x12'));var authService=require(_0x7690('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7690('0x14'));var hardwareService=require(_0x7690('0x15'));var logger=require(_0x7690('0x16'))(_0x7690('0x17'));var utils=require(_0x7690('0x18'));var config=require('../../config/environment');var db=require(_0x7690('0x19'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x7690('0x1a'));var client=jayson[_0x7690('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x5bc7f6,_0x37f3e1,_0x530b59){if(_0x530b59){var _0x2cc641=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2cc641[_0x7690('0x1c')](_0x37f3e1)){return _0x5bc7f6;}else{throw new db[(_0x7690('0x1d'))][(_0x7690('0x1e'))](_0x7690('0x1f'));}}else{return _0x5bc7f6;}}function respondWithRpcPromise(_0x2c8142,_0x324907,_0x5aca7c,_0x4e4078){return new BPromise(function(_0x2328bd,_0x1e0ef7){var _0x89beab=_0x4e4078||client;return _0x89beab[_0x7690('0x20')](_0x2c8142,_0x5aca7c)[_0x7690('0x21')](function(_0x42f556){logger[_0x7690('0x22')](_0x7690('0x23'),_0x324907,'request\x20sent');logger['debug'](_0x7690('0x24'),_0x324907,_0x7690('0x25'),JSON[_0x7690('0x26')](_0x42f556));if(_0x42f556[_0x7690('0x27')]){if(_0x42f556['error'][_0x7690('0x28')]===0x1f4){logger[_0x7690('0x27')]('ZendeskAccount,\x20%s,\x20%s',_0x324907,_0x42f556[_0x7690('0x27')][_0x7690('0x29')]);return _0x1e0ef7(_0x42f556[_0x7690('0x27')][_0x7690('0x29')]);}logger['error'](_0x7690('0x23'),_0x324907,_0x42f556[_0x7690('0x27')]['message']);return _0x2328bd(_0x42f556[_0x7690('0x27')][_0x7690('0x29')]);}else{logger[_0x7690('0x22')](_0x7690('0x23'),_0x324907,'request\x20sent');_0x2328bd(_0x42f556[_0x7690('0x2a')][_0x7690('0x29')]);}})[_0x7690('0x2b')](function(_0x1f3493){logger[_0x7690('0x27')](_0x7690('0x23'),_0x324907,_0x1f3493);_0x1e0ef7(_0x1f3493);});});}function respondWithStatusCode(_0x3a149d,_0x52af63){_0x52af63=_0x52af63||0xcc;return function(_0x42dc8a){if(_0x42dc8a){return _0x3a149d['sendStatus'](_0x52af63);}return _0x3a149d[_0x7690('0x2c')](_0x52af63)[_0x7690('0x2d')]();};}function respondWithResult(_0x32ddf1,_0xbe14d6){_0xbe14d6=_0xbe14d6||0xc8;return function(_0x390545){if(_0x390545){return _0x32ddf1[_0x7690('0x2c')](_0xbe14d6)['json'](_0x390545);}};}function respondWithFilteredResult(_0x30a594,_0xcaf82c){return function(_0x563b2c){if(_0x563b2c){var _0x1847f8=_0x563b2c[_0x7690('0x2e')],_0x51bd54=_0xcaf82c[_0x7690('0x2f')],_0x5ce834=_0xcaf82c[_0x7690('0x2f')]+_0xcaf82c[_0x7690('0x30')],_0x366386;if(_0x5ce834>=_0x1847f8){_0x5ce834=_0x1847f8;_0x366386=0xc8;}else{_0x366386=0xce;}_0x30a594[_0x7690('0x2c')](_0x366386);return _0x30a594['set']('Content-Range',_0x51bd54+'-'+_0x5ce834+'/'+_0x1847f8)['json'](_0x563b2c);}return null;};}function patchUpdates(_0x1f0431){return function(_0x550294){try{jsonpatch[_0x7690('0x31')](_0x550294,_0x1f0431,!![]);}catch(_0x29afdd){return BPromise['reject'](_0x29afdd);}return _0x550294[_0x7690('0x32')]();};}function saveUpdates(_0x2963f1,_0x23011a){return function(_0xa5b5fe){if(_0xa5b5fe){return _0xa5b5fe[_0x7690('0x33')](_0x2963f1)[_0x7690('0x21')](function(_0x51bef6){return _0x51bef6;});}return null;};}function removeEntity(_0x1b71f4,_0x595f1d){return function(_0x247e5f){if(_0x247e5f){return _0x247e5f[_0x7690('0x34')]()[_0x7690('0x21')](function(){_0x1b71f4[_0x7690('0x2c')](0xcc)[_0x7690('0x2d')]();});}};}function handleEntityNotFound(_0x3b4959,_0x1bc48d){return function(_0x564b2f){if(!_0x564b2f){_0x3b4959[_0x7690('0x35')](0x194);}return _0x564b2f;};}function handleError(_0x3054b4,_0x2c4122){_0x2c4122=_0x2c4122||0x1f4;return function(_0x1a8192){logger[_0x7690('0x27')](_0x1a8192[_0x7690('0x36')]);if(_0x1a8192[_0x7690('0x37')]){delete _0x1a8192['name'];}_0x3054b4[_0x7690('0x2c')](_0x2c4122)[_0x7690('0x38')](_0x1a8192);};}exports[_0x7690('0x39')]=function(_0x4c564c,_0x4e3366){var _0x58bc87={},_0x28608b={},_0x256389={'count':0x0,'rows':[]};var _0x1cffa2=_[_0x7690('0x3a')](db[_0x7690('0x3b')][_0x7690('0x3c')],function(_0x188a92){return{'name':_0x188a92[_0x7690('0x3d')],'type':_0x188a92[_0x7690('0x3e')][_0x7690('0x3f')]};});_0x28608b[_0x7690('0x40')]=_[_0x7690('0x3a')](_0x1cffa2,_0x7690('0x37'));_0x28608b[_0x7690('0x41')]=_[_0x7690('0x42')](_0x4c564c[_0x7690('0x41')]);_0x28608b[_0x7690('0x43')]=_['intersection'](_0x28608b[_0x7690('0x40')],_0x28608b[_0x7690('0x41')]);_0x58bc87[_0x7690('0x44')]=_[_0x7690('0x45')](_0x28608b['model'],qs['fields'](_0x4c564c[_0x7690('0x41')][_0x7690('0x46')]));_0x58bc87['attributes']=_0x58bc87[_0x7690('0x44')]['length']?_0x58bc87['attributes']:_0x28608b['model'];if(!_0x4c564c[_0x7690('0x41')][_0x7690('0x47')]('nolimit')){_0x58bc87[_0x7690('0x30')]=qs[_0x7690('0x30')](_0x4c564c[_0x7690('0x41')][_0x7690('0x30')]);_0x58bc87[_0x7690('0x2f')]=qs[_0x7690('0x2f')](_0x4c564c[_0x7690('0x41')][_0x7690('0x2f')]);}_0x58bc87[_0x7690('0x48')]=qs['sort'](_0x4c564c['query'][_0x7690('0x49')]);_0x58bc87[_0x7690('0x4a')]=qs[_0x7690('0x43')](_[_0x7690('0x4b')](_0x4c564c['query'],_0x28608b[_0x7690('0x43')]));if(_0x4c564c[_0x7690('0x41')][_0x7690('0x4c')]){_0x58bc87[_0x7690('0x4a')]=_['merge'](_0x58bc87['where'],{'$or':_[_0x7690('0x3a')](_0x1cffa2,function(_0xba6247){if(_0xba6247['type']!==_0x7690('0x4d')){var _0x16f851={};_0x16f851[_0xba6247[_0x7690('0x37')]]={'$like':'%'+_0x4c564c[_0x7690('0x41')][_0x7690('0x4c')]+'%'};return _0x16f851;}})});}_0x58bc87=_[_0x7690('0x4e')]({},_0x58bc87,_0x4c564c[_0x7690('0x4f')]);var _0x2e0f75={'where':_0x58bc87[_0x7690('0x4a')]};return db[_0x7690('0x3b')][_0x7690('0x2e')](_0x2e0f75)[_0x7690('0x21')](function(_0x219a97){_0x256389['count']=_0x219a97;if(_0x4c564c[_0x7690('0x41')][_0x7690('0x50')]){_0x58bc87['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x7690('0x51')](_0x58bc87);})[_0x7690('0x21')](function(_0x46793a){_0x256389[_0x7690('0x52')]=_0x46793a;return _0x256389;})[_0x7690('0x21')](respondWithFilteredResult(_0x4e3366,_0x58bc87))[_0x7690('0x2b')](handleError(_0x4e3366,null));};exports[_0x7690('0x53')]=function(_0x2d6df9,_0xa52c05){var _0x1c823c={'raw':![],'where':{'id':_0x2d6df9[_0x7690('0x54')]['id']}},_0xb877ac={};_0xb877ac[_0x7690('0x40')]=_['keys'](db[_0x7690('0x3b')][_0x7690('0x3c')]);_0xb877ac[_0x7690('0x41')]=_[_0x7690('0x42')](_0x2d6df9['query']);_0xb877ac[_0x7690('0x43')]=_['intersection'](_0xb877ac[_0x7690('0x40')],_0xb877ac['query']);_0x1c823c[_0x7690('0x44')]=_[_0x7690('0x45')](_0xb877ac[_0x7690('0x40')],qs[_0x7690('0x46')](_0x2d6df9['query'][_0x7690('0x46')]));_0x1c823c[_0x7690('0x44')]=_0x1c823c[_0x7690('0x44')]['length']?_0x1c823c[_0x7690('0x44')]:_0xb877ac[_0x7690('0x40')];if(_0x2d6df9[_0x7690('0x41')]['includeAll']){_0x1c823c[_0x7690('0x55')]=[{'all':!![]}];}_0x1c823c=_[_0x7690('0x4e')]({},_0x1c823c,_0x2d6df9[_0x7690('0x4f')]);return db[_0x7690('0x3b')][_0x7690('0x56')](_0x1c823c)[_0x7690('0x21')](handleEntityNotFound(_0xa52c05,null))[_0x7690('0x21')](respondWithResult(_0xa52c05,null))[_0x7690('0x2b')](handleError(_0xa52c05,null));};exports[_0x7690('0x57')]=function(_0x30bb4a,_0x5c120e){return db[_0x7690('0x3b')][_0x7690('0x57')](_0x30bb4a[_0x7690('0x58')],{})['then'](respondWithResult(_0x5c120e,0xc9))[_0x7690('0x2b')](handleError(_0x5c120e,null));};exports[_0x7690('0x33')]=function(_0x2c933e,_0x23875e){if(_0x2c933e[_0x7690('0x58')]['id']){delete _0x2c933e['body']['id'];}return db['ZendeskAccount'][_0x7690('0x56')]({'where':{'id':_0x2c933e[_0x7690('0x54')]['id']}})['then'](handleEntityNotFound(_0x23875e,null))[_0x7690('0x21')](saveUpdates(_0x2c933e[_0x7690('0x58')],null))[_0x7690('0x21')](respondWithResult(_0x23875e,null))[_0x7690('0x2b')](handleError(_0x23875e,null));};exports[_0x7690('0x34')]=function(_0x909a7f,_0x9ed587){return db[_0x7690('0x3b')]['find']({'where':{'id':_0x909a7f[_0x7690('0x54')]['id']}})[_0x7690('0x21')](handleEntityNotFound(_0x9ed587,null))[_0x7690('0x21')](removeEntity(_0x9ed587,null))['catch'](handleError(_0x9ed587,null));};exports['getConfigurations']=function(_0x213275,_0x40bc8a,_0x366c83){var _0x56f007={};var _0x5cb96c={};var _0x1fc232;var _0x2cb4a2;return db[_0x7690('0x3b')][_0x7690('0x59')]({'where':{'id':_0x213275[_0x7690('0x54')]['id']}})[_0x7690('0x21')](handleEntityNotFound(_0x40bc8a,null))[_0x7690('0x21')](function(_0x2b4ca1){if(_0x2b4ca1){_0x1fc232=_0x2b4ca1;_0x5cb96c['model']=_[_0x7690('0x42')](db[_0x7690('0x5a')][_0x7690('0x3c')]);_0x5cb96c['query']=_[_0x7690('0x42')](_0x213275[_0x7690('0x41')]);_0x5cb96c[_0x7690('0x43')]=_[_0x7690('0x45')](_0x5cb96c[_0x7690('0x40')],_0x5cb96c['query']);_0x56f007[_0x7690('0x44')]=_[_0x7690('0x45')](_0x5cb96c[_0x7690('0x40')],qs[_0x7690('0x46')](_0x213275['query'][_0x7690('0x46')]));_0x56f007[_0x7690('0x44')]=_0x56f007[_0x7690('0x44')][_0x7690('0x5b')]?_0x56f007[_0x7690('0x44')]:_0x5cb96c[_0x7690('0x40')];_0x56f007[_0x7690('0x48')]=qs[_0x7690('0x49')](_0x213275[_0x7690('0x41')][_0x7690('0x49')]);_0x56f007[_0x7690('0x4a')]=qs['filters'](_[_0x7690('0x4b')](_0x213275[_0x7690('0x41')],_0x5cb96c['filters']));if(_0x213275[_0x7690('0x41')]['filter']){_0x56f007['where']=_[_0x7690('0x4e')](_0x56f007[_0x7690('0x4a')],{'$or':_[_0x7690('0x3a')](_0x56f007['attributes'],function(_0x2a4f40){var _0x269072={};_0x269072[_0x2a4f40]={'$like':'%'+_0x213275['query'][_0x7690('0x4c')]+'%'};return _0x269072;})});}_0x56f007=_[_0x7690('0x4e')]({},_0x56f007,_0x213275['options']);return _0x1fc232[_0x7690('0x5c')](_0x56f007);}})[_0x7690('0x21')](function(_0x10ccc4){if(_0x10ccc4){_0x2cb4a2=_0x10ccc4[_0x7690('0x5b')];if(!_0x213275['query'][_0x7690('0x47')]('nolimit')){_0x56f007[_0x7690('0x30')]=qs['limit'](_0x213275[_0x7690('0x41')]['limit']);_0x56f007[_0x7690('0x2f')]=qs['offset'](_0x213275[_0x7690('0x41')][_0x7690('0x2f')]);}return _0x1fc232[_0x7690('0x5c')](_0x56f007);}})['then'](function(_0x770af2){if(_0x770af2){return _0x770af2?{'count':_0x2cb4a2,'rows':_0x770af2}:null;}})['then'](respondWithResult(_0x40bc8a,null))[_0x7690('0x2b')](handleError(_0x40bc8a,null));};exports[_0x7690('0x5d')]=function(_0x5e7dfa,_0x323984,_0x202ba1){if(_0x5e7dfa[_0x7690('0x58')]['id']){delete _0x5e7dfa[_0x7690('0x58')]['id'];}return db[_0x7690('0x3b')]['findOne']({'where':{'id':_0x5e7dfa['params']['id']}})[_0x7690('0x21')](handleEntityNotFound(_0x323984,null))[_0x7690('0x21')](function(_0x485a63){if(_0x485a63){_0x5e7dfa[_0x7690('0x58')][_0x7690('0x5e')]=_0x485a63['id'];_0x5e7dfa['body'][_0x7690('0x5f')]=integrations[_0x7690('0x60')](_0x5e7dfa[_0x7690('0x58')][_0x7690('0x61')],_0x5e7dfa[_0x7690('0x58')]['type']);_0x5e7dfa[_0x7690('0x58')]['Descriptions']=integrations[_0x7690('0x62')](_0x5e7dfa[_0x7690('0x58')][_0x7690('0x61')],_0x5e7dfa[_0x7690('0x58')][_0x7690('0x3e')]);return db[_0x7690('0x5a')][_0x7690('0x57')](_0x5e7dfa[_0x7690('0x58')],{'include':[{'model':db[_0x7690('0x63')],'as':_0x7690('0x5f')},{'model':db[_0x7690('0x63')],'as':_0x7690('0x64')}]});}return null;})[_0x7690('0x21')](respondWithResult(_0x323984,null))[_0x7690('0x2b')](handleError(_0x323984,null));};exports[_0x7690('0x65')]=function(_0x934b1b,_0x43b9ff,_0x109496){var _0x4a9960='';return db['ZendeskAccount'][_0x7690('0x59')]({'where':{'id':_0x934b1b[_0x7690('0x54')]['id']},'attributes':['id',_0x7690('0x66'),'password',_0x7690('0x67'),_0x7690('0x68'),_0x7690('0x69')]})['then'](handleEntityNotFound(_0x43b9ff,null))[_0x7690('0x21')](function(_0x42d5d0){if(_0x42d5d0){_0x4a9960=_0x42d5d0[_0x7690('0x69')];var _0x778e89=_0x4a9960['slice'](-0x1);if(_0x778e89==='/'){_0x4a9960=_0x4a9960[_0x7690('0x6a')](0x0,_0x4a9960['lastIndexOf'](_0x778e89));}var _0x974ea0={'method':'GET','uri':util['format']('%s/%s',_0x4a9960,'ticket_fields'),'json':!![]};switch(_0x42d5d0['authType']){case _0x7690('0x6b'):_0x974ea0[_0x7690('0x6c')]={'Authorization':util[_0x7690('0x6d')]('Basic\x20%s',new Buffer(util[_0x7690('0x6d')](_0x7690('0x6e'),_0x42d5d0[_0x7690('0x66')],_0x42d5d0[_0x7690('0x6b')]))[_0x7690('0x6f')]('base64'))};break;case _0x7690('0x67'):_0x974ea0['headers']={'Authorization':util['format']('Basic\x20%s',new Buffer(util['format'](_0x7690('0x70'),_0x42d5d0['username'],_0x42d5d0['token']))[_0x7690('0x6f')](_0x7690('0x71')))};break;default:throw new db[(_0x7690('0x1d'))][(_0x7690('0x1e'))](_0x7690('0x72'));}return rp(_0x974ea0);}})[_0x7690('0x21')](function(_0x4924a6){if(_0x4924a6){var _0x27fb6b=[_0x7690('0x73'),_0x7690('0x74'),_0x7690('0x75'),_0x7690('0x76')];_['remove'](_0x4924a6[_0x7690('0x77')],function(_0x17ae42){return _0x27fb6b[_0x7690('0x78')](_0x17ae42[_0x7690('0x3e')]);});return{'count':_0x4924a6[_0x7690('0x77')]['length'],'rows':_['map'](_0x4924a6['ticket_fields'],function(_0x37f9f3){return{'id':_0x37f9f3['id'],'name':_0x37f9f3[_0x7690('0x79')]>0x7?_0x37f9f3['title']:_0x37f9f3[_0x7690('0x3e')],'custom':_0x37f9f3[_0x7690('0x79')]>0x7?!![]:![],'options':_0x37f9f3[_0x7690('0x7a')]?_0x37f9f3[_0x7690('0x7a')]:_0x37f9f3['custom_field_options']?_0x37f9f3[_0x7690('0x7b')]:[]};})};}})[_0x7690('0x21')](respondWithResult(_0x43b9ff,null))[_0x7690('0x2b')](function(_0x25009b){var _0x1d0d30=_0x934b1b['query'][_0x7690('0x1c')]?0x1f4:_0x25009b[_0x7690('0x7c')]||0x1f4;logger[_0x7690('0x27')](_0x7690('0x7d'),_0x7690('0x65'),_0x1d0d30,JSON['stringify'](_0x25009b));delete _0x25009b[_0x7690('0x37')];if(_0x1d0d30===0x191){_0x1d0d30=0x190;}_0x43b9ff[_0x7690('0x2c')](_0x1d0d30)[_0x7690('0x38')](_0x934b1b[_0x7690('0x41')][_0x7690('0x1c')]?{'message':'Wrong\x20credentials','statusCode':_0x25009b[_0x7690('0x7c')]}:_0x25009b);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 86a29f3..8e6518c 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 _0xb176=['ZendeskAccount','lodash','util','api','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xb176,0x169));var _0x6b17=function(_0x21f27d,_0x2305ba){_0x21f27d=_0x21f27d-0x0;var _0x504a7b=_0xb176[_0x21f27d];return _0x504a7b;};'use strict';var _=require(_0x6b17('0x0'));var util=require(_0x6b17('0x1'));var logger=require('../../config/logger')(_0x6b17('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6b17('0x3'));var config=require('../../config/environment');var attributes=require(_0x6b17('0x4'));var integrations=require(_0x6b17('0x5'));module[_0x6b17('0x6')]=function(_0x37d13b,_0x4b4e4f){return _0x37d13b[_0x6b17('0x7')](_0x6b17('0x8'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x311a=['rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','int_zendesk_accounts','../../config/logger','api','bluebird','request-promise'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x311a,0x16e));var _0xa311=function(_0x2bd6e2,_0x409b8f){_0x2bd6e2=_0x2bd6e2-0x0;var _0x300428=_0x311a[_0x2bd6e2];return _0x300428;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa311('0x0'))(_0xa311('0x1'));var moment=require('moment');var BPromise=require(_0xa311('0x2'));var rp=require(_0xa311('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa311('0x4'));var config=require(_0xa311('0x5'));var attributes=require(_0xa311('0x6'));var integrations=require(_0xa311('0x7'));module['exports']=function(_0x986e4c,_0x1a6935){return _0x986e4c[_0xa311('0x8')]('ZendeskAccount',attributes,{'tableName':_0xa311('0x9'),'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 9268495..53677dd 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 _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','include','map','model','then','ShowZendeskAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0xcb91[_0x59bcb1];return _0x4a737f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetZendeskAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['ZendeskAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowZendeskAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});}; \ No newline at end of file +var _0xe706=['options','raw','where','attributes','limit','include','map','model','stringify','ShowZendeskAccount','ZendeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZendeskAccount','findAll'];(function(_0x57c974,_0x1f855c){var _0x1d0c82=function(_0x148fbf){while(--_0x148fbf){_0x57c974['push'](_0x57c974['shift']());}};_0x1d0c82(++_0x1f855c);}(_0xe706,0xa3));var _0x6e70=function(_0x8eb4eb,_0xa70079){_0x8eb4eb=_0x8eb4eb-0x0;var _0x1ff8e3=_0xe706[_0x8eb4eb];return _0x1ff8e3;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['ZendeskAccount'][_0x6e70('0x1a')]({'raw':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'limit':_0x5ea7a5['options']?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1f')]||null:null,'include':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5['options'][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x5ea7a5[_0x6e70('0x1b')]['include'],function(_0x10fc91){return{'model':db[_0x10fc91['model']],'as':_0x10fc91['as'],'attributes':_0x10fc91['attributes'],'include':_0x10fc91['include']?_[_0x6e70('0x21')](_0x10fc91[_0x6e70('0x20')],function(_0x51d292){return{'model':db[_0x51d292[_0x6e70('0x22')]],'as':_0x51d292['as'],'attributes':_0x51d292[_0x6e70('0x1e')],'include':_0x51d292['include']?_[_0x6e70('0x21')](_0x51d292[_0x6e70('0x20')],function(_0x2bb231){return{'model':db[_0x2bb231['model']],'as':_0x2bb231['as'],'attributes':_0x2bb231['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x3af17f){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('GetZendeskAccount',_0x5ea7a5,JSON[_0x6e70('0x23')](_0x3af17f));_0x173afe(_0x3af17f);})[_0x6e70('0x18')](function(_0xecf336){logger[_0x6e70('0x14')](_0x6e70('0x19'),_0xecf336[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0xecf336[_0x6e70('0x16')]));});});};exports[_0x6e70('0x24')]=function(_0x3a5d30){var _0x4b1229=this;return new Promise(function(_0x1b27d8,_0x50d60b){return db[_0x6e70('0x25')]['find']({'raw':_0x3a5d30[_0x6e70('0x1b')]?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'include':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')],function(_0x1e3e76){return{'model':db[_0x1e3e76[_0x6e70('0x22')]],'as':_0x1e3e76['as'],'attributes':_0x1e3e76[_0x6e70('0x1e')],'include':_0x1e3e76[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x1e3e76['include'],function(_0x3b9c06){return{'model':db[_0x3b9c06['model']],'as':_0x3b9c06['as'],'attributes':_0x3b9c06[_0x6e70('0x1e')],'include':_0x3b9c06[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3b9c06[_0x6e70('0x20')],function(_0x233a83){return{'model':db[_0x233a83[_0x6e70('0x22')]],'as':_0x233a83['as'],'attributes':_0x233a83[_0x6e70('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x80bebb){logger[_0x6e70('0xf')](_0x6e70('0x24'),_0x3a5d30);logger[_0x6e70('0x12')](_0x6e70('0x24'),_0x3a5d30,JSON['stringify'](_0x80bebb));_0x1b27d8(_0x80bebb);})['catch'](function(_0x5424eb){logger[_0x6e70('0x14')](_0x6e70('0x24'),_0x5424eb[_0x6e70('0x16')],_0x3a5d30);_0x50d60b(_0x4b1229[_0x6e70('0x14')](0x1f4,_0x5424eb[_0x6e70('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 666cf3d..ed27962 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 _0x600d=['index','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','setTags','put','/:id','update','delete','destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated'];(function(_0x4d73e2,_0x33aad9){var _0x440a2b=function(_0x6d5a7f){while(--_0x6d5a7f){_0x4d73e2['push'](_0x4d73e2['shift']());}};_0x440a2b(++_0x33aad9);}(_0x600d,0x1ec));var _0xd600=function(_0x4c80ee,_0x473d16){_0x4c80ee=_0x4c80ee-0x0;var _0x358c06=_0x600d[_0x4c80ee];return _0x358c06;};'use strict';var multer=require(_0xd600('0x0'));var util=require(_0xd600('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd600('0x2'));var router=express[_0xd600('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd600('0x4'));var config=require(_0xd600('0x5'));var controller=require(_0xd600('0x6'));router['get']('/',auth[_0xd600('0x7')](),controller[_0xd600('0x8')]);router[_0xd600('0x9')]('/:id',auth[_0xd600('0x7')](),controller['show']);router[_0xd600('0x9')](_0xd600('0xa'),auth[_0xd600('0x7')](),controller[_0xd600('0xb')]);router[_0xd600('0x9')](_0xd600('0xc'),auth[_0xd600('0x7')](),controller[_0xd600('0xd')]);router['get'](_0xd600('0xe'),auth['isAuthenticated'](),controller[_0xd600('0xf')]);router['get'](_0xd600('0x10'),auth[_0xd600('0x7')](),controller['getTags']);router[_0xd600('0x11')]('/',auth[_0xd600('0x7')](),controller['create']);router[_0xd600('0x11')]('/:id/tags',auth[_0xd600('0x7')](),controller[_0xd600('0x12')]);router[_0xd600('0x13')](_0xd600('0x14'),auth[_0xd600('0x7')](),controller[_0xd600('0x15')]);router[_0xd600('0x16')](_0xd600('0x14'),auth['isAuthenticated'](),controller[_0xd600('0x17')]);module[_0xd600('0x18')]=router; \ No newline at end of file +var _0x34f2=['/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x500c4f,_0x53cfff){var _0x1785e8=function(_0x59b9b9){while(--_0x59b9b9){_0x500c4f['push'](_0x500c4f['shift']());}};_0x1785e8(++_0x53cfff);}(_0x34f2,0x146));var _0x234f=function(_0x4c938d,_0x29b729){_0x4c938d=_0x4c938d-0x0;var _0x86c8d0=_0x34f2[_0x4c938d];return _0x86c8d0;};'use strict';var multer=require('multer');var util=require(_0x234f('0x0'));var path=require(_0x234f('0x1'));var timeout=require('connect-timeout');var express=require(_0x234f('0x2'));var router=express[_0x234f('0x3')]();var auth=require(_0x234f('0x4'));var interaction=require(_0x234f('0x5'));var config=require(_0x234f('0x6'));var controller=require('./intZendeskConfiguration.controller');router[_0x234f('0x7')]('/',auth[_0x234f('0x8')](),controller['index']);router[_0x234f('0x7')](_0x234f('0x9'),auth[_0x234f('0x8')](),controller['show']);router[_0x234f('0x7')](_0x234f('0xa'),auth[_0x234f('0x8')](),controller[_0x234f('0xb')]);router[_0x234f('0x7')]('/:id/subjects',auth[_0x234f('0x8')](),controller[_0x234f('0xc')]);router[_0x234f('0x7')](_0x234f('0xd'),auth['isAuthenticated'](),controller[_0x234f('0xe')]);router[_0x234f('0x7')](_0x234f('0xf'),auth['isAuthenticated'](),controller['getTags']);router[_0x234f('0x10')]('/',auth[_0x234f('0x8')](),controller[_0x234f('0x11')]);router['post'](_0x234f('0xf'),auth[_0x234f('0x8')](),controller[_0x234f('0x12')]);router[_0x234f('0x13')](_0x234f('0x9'),auth[_0x234f('0x8')](),controller[_0x234f('0x14')]);router[_0x234f('0x15')](_0x234f('0x9'),auth['isAuthenticated'](),controller[_0x234f('0x16')]);module[_0x234f('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 8e25d8f..7ae3133 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 _0xb367=['sequelize','exports','STRING'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb367,0x162));var _0x7b36=function(_0x190d52,_0x24610d){_0x190d52=_0x190d52-0x0;var _0x325160=_0xb367[_0x190d52];return _0x325160;};'use strict';var Sequelize=require(_0x7b36('0x0'));module[_0x7b36('0x1')]={'name':{'type':Sequelize[_0x7b36('0x2')]},'description':{'type':Sequelize[_0x7b36('0x2')]}}; \ No newline at end of file +var _0x54e2=['sequelize','exports','STRING'];(function(_0x2d6f5d,_0x2cf545){var _0x54068d=function(_0x6b251a){while(--_0x6b251a){_0x2d6f5d['push'](_0x2d6f5d['shift']());}};_0x54068d(++_0x2cf545);}(_0x54e2,0x1e0));var _0x254e=function(_0x50060f,_0x33d286){_0x50060f=_0x50060f-0x0;var _0x4e146a=_0x54e2[_0x50060f];return _0x4e146a;};'use strict';var Sequelize=require(_0x254e('0x0'));module[_0x254e('0x1')]={'name':{'type':Sequelize[_0x254e('0x2')]},'description':{'type':Sequelize[_0x254e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index cf21e15..d2f3cd4 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 _0xe14b=['code','message','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','map','ZendeskConfiguration','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','body','getFields','findOne','ZendeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe14b,0x93));var _0xbe14=function(_0x53e64a,_0x372632){_0x53e64a=_0x53e64a-0x0;var _0x27de93=_0xe14b[_0x53e64a];return _0x27de93;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];var jayson=require(_0xbe14('0x15'));var client=jayson[_0xbe14('0x16')][_0xbe14('0x17')]({'port':0x232a});function checkPasswordPattern(_0x23a730,_0x2850cb,_0x16893f){if(_0x16893f){var _0xa2cf72=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa2cf72[_0xbe14('0x18')](_0x2850cb)){return _0x23a730;}else{throw new db[(_0xbe14('0x19'))][(_0xbe14('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x23a730;}}function respondWithRpcPromise(_0x55b3a7,_0x3f58f5,_0x3dc4a9,_0xf4ac9){return new BPromise(function(_0x37ce4e,_0x4e8f34){var _0x21c789=_0xf4ac9||client;return _0x21c789[_0xbe14('0x1b')](_0x55b3a7,_0x3dc4a9)[_0xbe14('0x1c')](function(_0x123ede){logger[_0xbe14('0x1d')](_0xbe14('0x1e'),_0x3f58f5,_0xbe14('0x1f'));logger['debug'](_0xbe14('0x20'),_0x3f58f5,_0xbe14('0x1f'),JSON[_0xbe14('0x21')](_0x123ede));if(_0x123ede[_0xbe14('0x22')]){if(_0x123ede[_0xbe14('0x22')][_0xbe14('0x23')]===0x1f4){logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x123ede[_0xbe14('0x22')][_0xbe14('0x24')]);return _0x4e8f34(_0x123ede[_0xbe14('0x22')][_0xbe14('0x24')]);}logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x123ede['error'][_0xbe14('0x24')]);return _0x37ce4e(_0x123ede['error'][_0xbe14('0x24')]);}else{logger['info'](_0xbe14('0x1e'),_0x3f58f5,_0xbe14('0x1f'));_0x37ce4e(_0x123ede['result'][_0xbe14('0x24')]);}})['catch'](function(_0x4587a8){logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x4587a8);_0x4e8f34(_0x4587a8);});});}function respondWithStatusCode(_0x5fa043,_0x1ee9c1){_0x1ee9c1=_0x1ee9c1||0xcc;return function(_0x39cc81){if(_0x39cc81){return _0x5fa043[_0xbe14('0x25')](_0x1ee9c1);}return _0x5fa043[_0xbe14('0x26')](_0x1ee9c1)['end']();};}function respondWithResult(_0x1822e0,_0x1ba46a){_0x1ba46a=_0x1ba46a||0xc8;return function(_0x391556){if(_0x391556){return _0x1822e0[_0xbe14('0x26')](_0x1ba46a)['json'](_0x391556);}};}function respondWithFilteredResult(_0x16f884,_0x29fc64){return function(_0x59bf34){if(_0x59bf34){var _0x3c3613=_0x59bf34[_0xbe14('0x27')],_0x3b3e84=_0x29fc64[_0xbe14('0x28')],_0x1c7cc7=_0x29fc64[_0xbe14('0x28')]+_0x29fc64[_0xbe14('0x29')],_0x19252f;if(_0x1c7cc7>=_0x3c3613){_0x1c7cc7=_0x3c3613;_0x19252f=0xc8;}else{_0x19252f=0xce;}_0x16f884[_0xbe14('0x26')](_0x19252f);return _0x16f884[_0xbe14('0x2a')](_0xbe14('0x2b'),_0x3b3e84+'-'+_0x1c7cc7+'/'+_0x3c3613)[_0xbe14('0x2c')](_0x59bf34);}return null;};}function patchUpdates(_0x39dc0a){return function(_0x10ae36){try{jsonpatch[_0xbe14('0x2d')](_0x10ae36,_0x39dc0a,!![]);}catch(_0xe6feb2){return BPromise[_0xbe14('0x2e')](_0xe6feb2);}return _0x10ae36[_0xbe14('0x2f')]();};}function saveUpdates(_0x29e76a,_0x14e7c4){return function(_0x581e86){if(_0x581e86){return _0x581e86[_0xbe14('0x30')](_0x29e76a)['then'](function(_0x58f8de){return _0x58f8de;});}return null;};}function removeEntity(_0x46c2d1,_0x4c1e7e){return function(_0x243524){if(_0x243524){return _0x243524[_0xbe14('0x31')]()['then'](function(){_0x46c2d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x412ad5,_0xa3d24){return function(_0x5f27b6){if(!_0x5f27b6){_0x412ad5[_0xbe14('0x25')](0x194);}return _0x5f27b6;};}function handleError(_0x1faf3e,_0x452635){_0x452635=_0x452635||0x1f4;return function(_0x1aa849){logger[_0xbe14('0x22')](_0x1aa849['stack']);if(_0x1aa849['name']){delete _0x1aa849[_0xbe14('0x32')];}_0x1faf3e['status'](_0x452635)['send'](_0x1aa849);};}exports['index']=function(_0x163ef7,_0x393f6b){var _0x2bb45={},_0x3dbacb={},_0x172e79={'count':0x0,'rows':[]};var _0x29356f=_[_0xbe14('0x33')](db[_0xbe14('0x34')][_0xbe14('0x35')],function(_0x2dfd5a){return{'name':_0x2dfd5a[_0xbe14('0x36')],'type':_0x2dfd5a[_0xbe14('0x37')]['key']};});_0x3dbacb['model']=_[_0xbe14('0x33')](_0x29356f,_0xbe14('0x32'));_0x3dbacb[_0xbe14('0x38')]=_['keys'](_0x163ef7[_0xbe14('0x38')]);_0x3dbacb[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x3dbacb[_0xbe14('0x3b')],_0x3dbacb[_0xbe14('0x38')]);_0x2bb45[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x3dbacb[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x163ef7['query'][_0xbe14('0x3d')]));_0x2bb45[_0xbe14('0x3c')]=_0x2bb45[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x2bb45[_0xbe14('0x3c')]:_0x3dbacb[_0xbe14('0x3b')];if(!_0x163ef7['query'][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x2bb45[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x163ef7['query']['limit']);_0x2bb45[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x163ef7[_0xbe14('0x38')]['offset']);}_0x2bb45['order']=qs[_0xbe14('0x41')](_0x163ef7['query']['sort']);_0x2bb45[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x163ef7['query'],_0x3dbacb['filters']));if(_0x163ef7['query'][_0xbe14('0x44')]){_0x2bb45[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x2bb45['where'],{'$or':_[_0xbe14('0x33')](_0x29356f,function(_0xcb0680){if(_0xcb0680[_0xbe14('0x37')]!==_0xbe14('0x46')){var _0x58351f={};_0x58351f[_0xcb0680['name']]={'$like':'%'+_0x163ef7[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x58351f;}})});}_0x2bb45=_[_0xbe14('0x45')]({},_0x2bb45,_0x163ef7[_0xbe14('0x47')]);var _0x2550dc={'where':_0x2bb45['where']};return db['ZendeskConfiguration'][_0xbe14('0x27')](_0x2550dc)[_0xbe14('0x1c')](function(_0x238c60){_0x172e79[_0xbe14('0x27')]=_0x238c60;if(_0x163ef7['query'][_0xbe14('0x48')]){_0x2bb45[_0xbe14('0x49')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xbe14('0x4a')](_0x2bb45);})[_0xbe14('0x1c')](function(_0x2d6ee8){_0x172e79[_0xbe14('0x4b')]=_0x2d6ee8;return _0x172e79;})['then'](respondWithFilteredResult(_0x393f6b,_0x2bb45))['catch'](handleError(_0x393f6b,null));};exports[_0xbe14('0x4c')]=function(_0x29564b,_0x4a1a37){var _0x5acf90={'raw':![],'where':{'id':_0x29564b[_0xbe14('0x4d')]['id']}},_0xca8cdb={};_0xca8cdb[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x34')][_0xbe14('0x35')]);_0xca8cdb[_0xbe14('0x38')]=_['keys'](_0x29564b[_0xbe14('0x38')]);_0xca8cdb[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0xca8cdb[_0xbe14('0x3b')],_0xca8cdb[_0xbe14('0x38')]);_0x5acf90['attributes']=_[_0xbe14('0x3a')](_0xca8cdb[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x29564b[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x5acf90[_0xbe14('0x3c')]=_0x5acf90['attributes']['length']?_0x5acf90[_0xbe14('0x3c')]:_0xca8cdb[_0xbe14('0x3b')];if(_0x29564b[_0xbe14('0x38')]['includeAll']){_0x5acf90['include']=[{'all':!![]}];}_0x5acf90=_[_0xbe14('0x45')]({},_0x5acf90,_0x29564b[_0xbe14('0x47')]);return db['ZendeskConfiguration'][_0xbe14('0x4f')](_0x5acf90)[_0xbe14('0x1c')](handleEntityNotFound(_0x4a1a37,null))['then'](respondWithResult(_0x4a1a37,null))[_0xbe14('0x50')](handleError(_0x4a1a37,null));};exports['create']=function(_0x41ba58,_0x410c59){return db[_0xbe14('0x34')]['create'](_0x41ba58[_0xbe14('0x51')],{})[_0xbe14('0x1c')](respondWithResult(_0x410c59,0xc9))['catch'](handleError(_0x410c59,null));};exports[_0xbe14('0x30')]=function(_0x42ca15,_0x2210cc){if(_0x42ca15[_0xbe14('0x51')]['id']){delete _0x42ca15[_0xbe14('0x51')]['id'];}return db['ZendeskConfiguration'][_0xbe14('0x4f')]({'where':{'id':_0x42ca15[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x2210cc,null))[_0xbe14('0x1c')](saveUpdates(_0x42ca15[_0xbe14('0x51')],null))[_0xbe14('0x1c')](respondWithResult(_0x2210cc,null))[_0xbe14('0x50')](handleError(_0x2210cc,null));};exports['destroy']=function(_0x72c875,_0x1b47a4){return db[_0xbe14('0x34')][_0xbe14('0x4f')]({'where':{'id':_0x72c875[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x1b47a4,null))[_0xbe14('0x1c')](removeEntity(_0x1b47a4,null))[_0xbe14('0x50')](handleError(_0x1b47a4,null));};exports[_0xbe14('0x52')]=function(_0xc61103,_0x358950,_0x4bccfc){var _0x56bcd3={};var _0x58dd79={};var _0x10c0bc;var _0x1bfcbf;return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0xc61103[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x358950,null))[_0xbe14('0x1c')](function(_0x22bf69){if(_0x22bf69){_0x10c0bc=_0x22bf69;_0x58dd79[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x54')][_0xbe14('0x35')]);_0x58dd79[_0xbe14('0x38')]=_[_0xbe14('0x4e')](_0xc61103[_0xbe14('0x38')]);_0x58dd79[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x58dd79[_0xbe14('0x3b')],_0x58dd79[_0xbe14('0x38')]);_0x56bcd3[_0xbe14('0x3c')]=_['intersection'](_0x58dd79[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0xc61103[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x56bcd3[_0xbe14('0x3c')]=_0x56bcd3[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x56bcd3[_0xbe14('0x3c')]:_0x58dd79[_0xbe14('0x3b')];_0x56bcd3[_0xbe14('0x55')]=qs['sort'](_0xc61103[_0xbe14('0x38')][_0xbe14('0x41')]);_0x56bcd3[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0xc61103['query'],_0x58dd79[_0xbe14('0x39')]));if(_0xc61103[_0xbe14('0x38')][_0xbe14('0x44')]){_0x56bcd3[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x56bcd3['where'],{'$or':_[_0xbe14('0x33')](_0x56bcd3[_0xbe14('0x3c')],function(_0x7ea146){var _0x29bb26={};_0x29bb26[_0x7ea146]={'$like':'%'+_0xc61103[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x29bb26;})});}_0x56bcd3=_[_0xbe14('0x45')]({},_0x56bcd3,_0xc61103[_0xbe14('0x47')]);return _0x10c0bc['getFields'](_0x56bcd3);}})[_0xbe14('0x1c')](function(_0x33c309){if(_0x33c309){_0x1bfcbf=_0x33c309[_0xbe14('0x3e')];if(!_0xc61103[_0xbe14('0x38')][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x56bcd3[_0xbe14('0x29')]=qs['limit'](_0xc61103['query'][_0xbe14('0x29')]);_0x56bcd3[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0xc61103[_0xbe14('0x38')][_0xbe14('0x28')]);}return _0x10c0bc[_0xbe14('0x52')](_0x56bcd3);}})[_0xbe14('0x1c')](function(_0x43511e){if(_0x43511e){return _0x43511e?{'count':_0x1bfcbf,'rows':_0x43511e}:null;}})['then'](respondWithResult(_0x358950,null))['catch'](handleError(_0x358950,null));};exports[_0xbe14('0x56')]=function(_0x1c18b6,_0x29aa52,_0x57729f){var _0x76e91e={};var _0x16bca1={};var _0x105be0;var _0x1797dd;return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0x1c18b6[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29aa52,null))[_0xbe14('0x1c')](function(_0x3b6ef5){if(_0x3b6ef5){_0x105be0=_0x3b6ef5;_0x16bca1[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x54')][_0xbe14('0x35')]);_0x16bca1[_0xbe14('0x38')]=_['keys'](_0x1c18b6[_0xbe14('0x38')]);_0x16bca1[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x16bca1[_0xbe14('0x3b')],_0x16bca1[_0xbe14('0x38')]);_0x76e91e[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x16bca1[_0xbe14('0x3b')],qs['fields'](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x76e91e[_0xbe14('0x3c')]=_0x76e91e[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x76e91e[_0xbe14('0x3c')]:_0x16bca1['model'];_0x76e91e[_0xbe14('0x55')]=qs[_0xbe14('0x41')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x41')]);_0x76e91e['where']=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x1c18b6[_0xbe14('0x38')],_0x16bca1[_0xbe14('0x39')]));if(_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x44')]){_0x76e91e[_0xbe14('0x42')]=_['merge'](_0x76e91e[_0xbe14('0x42')],{'$or':_['map'](_0x76e91e[_0xbe14('0x3c')],function(_0x5d85d3){var _0x389822={};_0x389822[_0x5d85d3]={'$like':'%'+_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x389822;})});}_0x76e91e=_['merge']({},_0x76e91e,_0x1c18b6[_0xbe14('0x47')]);return _0x105be0[_0xbe14('0x56')](_0x76e91e);}})[_0xbe14('0x1c')](function(_0x546f22){if(_0x546f22){_0x1797dd=_0x546f22[_0xbe14('0x3e')];if(!_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x76e91e['limit']=qs[_0xbe14('0x29')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x29')]);_0x76e91e[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x28')]);}return _0x105be0['getSubjects'](_0x76e91e);}})[_0xbe14('0x1c')](function(_0x123f4f){if(_0x123f4f){return _0x123f4f?{'count':_0x1797dd,'rows':_0x123f4f}:null;}})[_0xbe14('0x1c')](respondWithResult(_0x29aa52,null))['catch'](handleError(_0x29aa52,null));};exports[_0xbe14('0x57')]=function(_0x420467,_0x1ea305,_0x5bc52b){var _0xa53262={};var _0x1205d1={};var _0x47d7bb;var _0x2be969;return db['ZendeskConfiguration'][_0xbe14('0x53')]({'where':{'id':_0x420467[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1ea305,null))['then'](function(_0x54045e){if(_0x54045e){_0x47d7bb=_0x54045e;_0x1205d1[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db['ZendeskField'][_0xbe14('0x35')]);_0x1205d1[_0xbe14('0x38')]=_[_0xbe14('0x4e')](_0x420467[_0xbe14('0x38')]);_0x1205d1['filters']=_['intersection'](_0x1205d1[_0xbe14('0x3b')],_0x1205d1[_0xbe14('0x38')]);_0xa53262[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x1205d1[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x420467[_0xbe14('0x38')]['fields']));_0xa53262[_0xbe14('0x3c')]=_0xa53262['attributes'][_0xbe14('0x3e')]?_0xa53262[_0xbe14('0x3c')]:_0x1205d1[_0xbe14('0x3b')];_0xa53262[_0xbe14('0x55')]=qs['sort'](_0x420467[_0xbe14('0x38')][_0xbe14('0x41')]);_0xa53262[_0xbe14('0x42')]=qs['filters'](_[_0xbe14('0x43')](_0x420467[_0xbe14('0x38')],_0x1205d1[_0xbe14('0x39')]));if(_0x420467[_0xbe14('0x38')][_0xbe14('0x44')]){_0xa53262[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0xa53262[_0xbe14('0x42')],{'$or':_[_0xbe14('0x33')](_0xa53262[_0xbe14('0x3c')],function(_0x2bf94c){var _0x49497e={};_0x49497e[_0x2bf94c]={'$like':'%'+_0x420467[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x49497e;})});}_0xa53262=_[_0xbe14('0x45')]({},_0xa53262,_0x420467[_0xbe14('0x47')]);return _0x47d7bb[_0xbe14('0x57')](_0xa53262);}})[_0xbe14('0x1c')](function(_0x1679bd){if(_0x1679bd){_0x2be969=_0x1679bd[_0xbe14('0x3e')];if(!_0x420467['query'][_0xbe14('0x3f')]('nolimit')){_0xa53262[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x420467[_0xbe14('0x38')][_0xbe14('0x29')]);_0xa53262[_0xbe14('0x28')]=qs['offset'](_0x420467['query'][_0xbe14('0x28')]);}return _0x47d7bb[_0xbe14('0x57')](_0xa53262);}})[_0xbe14('0x1c')](function(_0x42b849){if(_0x42b849){return _0x42b849?{'count':_0x2be969,'rows':_0x42b849}:null;}})['then'](respondWithResult(_0x1ea305,null))[_0xbe14('0x50')](handleError(_0x1ea305,null));};exports[_0xbe14('0x58')]=function(_0x4d6a75,_0x186225,_0x3b8b45){var _0x31fdf2={};var _0x17b3b1={};var _0x4f9936;var _0x3c5241;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x4d6a75[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x186225,null))[_0xbe14('0x1c')](function(_0x3d890b){if(_0x3d890b){_0x4f9936=_0x3d890b;_0x17b3b1[_0xbe14('0x3b')]=_['keys'](db[_0xbe14('0x59')][_0xbe14('0x35')]);_0x17b3b1['query']=_['keys'](_0x4d6a75[_0xbe14('0x38')]);_0x17b3b1[_0xbe14('0x39')]=_['intersection'](_0x17b3b1[_0xbe14('0x3b')],_0x17b3b1['query']);_0x31fdf2[_0xbe14('0x3c')]=_['intersection'](_0x17b3b1[_0xbe14('0x3b')],qs['fields'](_0x4d6a75[_0xbe14('0x38')]['fields']));_0x31fdf2[_0xbe14('0x3c')]=_0x31fdf2[_0xbe14('0x3c')]['length']?_0x31fdf2['attributes']:_0x17b3b1[_0xbe14('0x3b')];_0x31fdf2['order']=qs['sort'](_0x4d6a75[_0xbe14('0x38')][_0xbe14('0x41')]);_0x31fdf2[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x4d6a75[_0xbe14('0x38')],_0x17b3b1[_0xbe14('0x39')]));if(_0x4d6a75['query'][_0xbe14('0x44')]){_0x31fdf2[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x31fdf2[_0xbe14('0x42')],{'$or':_['map'](_0x31fdf2[_0xbe14('0x3c')],function(_0x3c5097){var _0x1a6a91={};_0x1a6a91[_0x3c5097]={'$like':'%'+_0x4d6a75['query'][_0xbe14('0x44')]+'%'};return _0x1a6a91;})});}_0x31fdf2=_[_0xbe14('0x45')]({},_0x31fdf2,_0x4d6a75['options']);return _0x4f9936[_0xbe14('0x58')](_0x31fdf2);}})['then'](function(_0x82cbcf){if(_0x82cbcf){_0x3c5241=_0x82cbcf[_0xbe14('0x3e')];if(!_0x4d6a75[_0xbe14('0x38')]['hasOwnProperty'](_0xbe14('0x40'))){_0x31fdf2['limit']=qs[_0xbe14('0x29')](_0x4d6a75['query']['limit']);_0x31fdf2[_0xbe14('0x28')]=qs['offset'](_0x4d6a75[_0xbe14('0x38')]['offset']);}return _0x4f9936[_0xbe14('0x58')](_0x31fdf2);}})[_0xbe14('0x1c')](function(_0x8a457b){if(_0x8a457b){return _0x8a457b?{'count':_0x3c5241,'rows':_0x8a457b}:null;}})[_0xbe14('0x1c')](respondWithResult(_0x186225,null))[_0xbe14('0x50')](handleError(_0x186225,null));};exports[_0xbe14('0x5a')]=function(_0x43d406,_0x3086f3,_0x466f7f){if(_0x43d406[_0xbe14('0x51')]['id']){delete _0x43d406[_0xbe14('0x51')]['id'];}return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0x43d406['params']['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x3086f3,null))[_0xbe14('0x1c')](function(_0x342992){if(_0x342992){return _0x342992[_0xbe14('0x5a')](_0x43d406[_0xbe14('0x51')]['ids']||[]);}return null;})['then'](respondWithResult(_0x3086f3,null))[_0xbe14('0x50')](handleError(_0x3086f3,null));}; \ No newline at end of file +var _0x326f=['VIRTUAL','filter','ZendeskConfiguration','count','includeAll','include','findAll','rows','show','params','options','find','create','body','destroy','getFields','findOne','hasOwnProperty','getSubjects','ZendeskField','getDescriptions','Tag','getTags','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','client','http','test','ValidationError','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','name','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge'];(function(_0x537f7f,_0x26e3e5){var _0x26c36f=function(_0x5b3f3f){while(--_0x5b3f3f){_0x537f7f['push'](_0x537f7f['shift']());}};_0x26c36f(++_0x26e3e5);}(_0x326f,0xd1));var _0xf326=function(_0x230042,_0x2a01dd){_0x230042=_0x230042-0x0;var _0x1844af=_0x326f[_0x230042];return _0x1844af;};'use strict';var pdf=require(_0xf326('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf326('0x1'));var jsonpatch=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require(_0xf326('0x5'));var Mustache=require(_0xf326('0x6'));var util=require(_0xf326('0x7'));var path=require(_0xf326('0x8'));var sox=require(_0xf326('0x9'));var csv=require(_0xf326('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var db=require(_0xf326('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xf326('0x17')][_0xf326('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4b3966,_0x342fe5,_0x472632){if(_0x472632){var _0x3504eb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3504eb[_0xf326('0x19')](_0x342fe5)){return _0x4b3966;}else{throw new db['Sequelize'][(_0xf326('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4b3966;}}function respondWithRpcPromise(_0x54bd1a,_0xdf21d9,_0x11f6d2,_0x1f2e5a){return new BPromise(function(_0xa63d1a,_0x292f4b){var _0x287a2a=_0x1f2e5a||client;return _0x287a2a[_0xf326('0x1b')](_0x54bd1a,_0x11f6d2)[_0xf326('0x1c')](function(_0x5a682a){logger[_0xf326('0x1d')](_0xf326('0x1e'),_0xdf21d9,_0xf326('0x1f'));logger[_0xf326('0x20')](_0xf326('0x21'),_0xdf21d9,_0xf326('0x1f'),JSON['stringify'](_0x5a682a));if(_0x5a682a['error']){if(_0x5a682a['error'][_0xf326('0x22')]===0x1f4){logger[_0xf326('0x23')]('ZendeskConfiguration,\x20%s,\x20%s',_0xdf21d9,_0x5a682a['error'][_0xf326('0x24')]);return _0x292f4b(_0x5a682a['error']['message']);}logger[_0xf326('0x23')](_0xf326('0x1e'),_0xdf21d9,_0x5a682a['error']['message']);return _0xa63d1a(_0x5a682a[_0xf326('0x23')][_0xf326('0x24')]);}else{logger['info'](_0xf326('0x1e'),_0xdf21d9,_0xf326('0x1f'));_0xa63d1a(_0x5a682a[_0xf326('0x25')][_0xf326('0x24')]);}})[_0xf326('0x26')](function(_0x2049ec){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0xdf21d9,_0x2049ec);_0x292f4b(_0x2049ec);});});}function respondWithStatusCode(_0x4f31f6,_0x520d85){_0x520d85=_0x520d85||0xcc;return function(_0x1a2c4e){if(_0x1a2c4e){return _0x4f31f6[_0xf326('0x27')](_0x520d85);}return _0x4f31f6[_0xf326('0x28')](_0x520d85)[_0xf326('0x29')]();};}function respondWithResult(_0x410237,_0x5217d4){_0x5217d4=_0x5217d4||0xc8;return function(_0x201d28){if(_0x201d28){return _0x410237[_0xf326('0x28')](_0x5217d4)[_0xf326('0x2a')](_0x201d28);}};}function respondWithFilteredResult(_0x581531,_0x1617d2){return function(_0x55ad0f){if(_0x55ad0f){var _0x4a9abf=_0x55ad0f['count'],_0x6a8e89=_0x1617d2[_0xf326('0x2b')],_0x1ae23a=_0x1617d2[_0xf326('0x2b')]+_0x1617d2['limit'],_0x2fa28e;if(_0x1ae23a>=_0x4a9abf){_0x1ae23a=_0x4a9abf;_0x2fa28e=0xc8;}else{_0x2fa28e=0xce;}_0x581531[_0xf326('0x28')](_0x2fa28e);return _0x581531[_0xf326('0x2c')](_0xf326('0x2d'),_0x6a8e89+'-'+_0x1ae23a+'/'+_0x4a9abf)[_0xf326('0x2a')](_0x55ad0f);}return null;};}function patchUpdates(_0xa80156){return function(_0x269be9){try{jsonpatch[_0xf326('0x2e')](_0x269be9,_0xa80156,!![]);}catch(_0x39a1e2){return BPromise[_0xf326('0x2f')](_0x39a1e2);}return _0x269be9[_0xf326('0x30')]();};}function saveUpdates(_0x4b52f2,_0x1035ed){return function(_0x424104){if(_0x424104){return _0x424104[_0xf326('0x31')](_0x4b52f2)['then'](function(_0x2c0cac){return _0x2c0cac;});}return null;};}function removeEntity(_0x1721fd,_0x303dc6){return function(_0x4df451){if(_0x4df451){return _0x4df451['destroy']()[_0xf326('0x1c')](function(){_0x1721fd[_0xf326('0x28')](0xcc)[_0xf326('0x29')]();});}};}function handleEntityNotFound(_0xf53cf3,_0x30694f){return function(_0x2e8a64){if(!_0x2e8a64){_0xf53cf3[_0xf326('0x27')](0x194);}return _0x2e8a64;};}function handleError(_0x2d5f20,_0x580374){_0x580374=_0x580374||0x1f4;return function(_0x461e93){logger[_0xf326('0x23')](_0x461e93['stack']);if(_0x461e93[_0xf326('0x32')]){delete _0x461e93['name'];}_0x2d5f20[_0xf326('0x28')](_0x580374)['send'](_0x461e93);};}exports['index']=function(_0xadb020,_0x4d8eac){var _0x40dcb4={},_0x57aa27={},_0x310dbb={'count':0x0,'rows':[]};var _0x409260=_[_0xf326('0x33')](db['ZendeskConfiguration'][_0xf326('0x34')],function(_0x4095e6){return{'name':_0x4095e6['fieldName'],'type':_0x4095e6[_0xf326('0x35')][_0xf326('0x36')]};});_0x57aa27[_0xf326('0x37')]=_[_0xf326('0x33')](_0x409260,'name');_0x57aa27[_0xf326('0x38')]=_[_0xf326('0x39')](_0xadb020[_0xf326('0x38')]);_0x57aa27[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0x57aa27['model'],_0x57aa27[_0xf326('0x38')]);_0x40dcb4[_0xf326('0x3c')]=_['intersection'](_0x57aa27['model'],qs[_0xf326('0x3d')](_0xadb020['query']['fields']));_0x40dcb4[_0xf326('0x3c')]=_0x40dcb4['attributes'][_0xf326('0x3e')]?_0x40dcb4[_0xf326('0x3c')]:_0x57aa27[_0xf326('0x37')];if(!_0xadb020[_0xf326('0x38')]['hasOwnProperty'](_0xf326('0x3f'))){_0x40dcb4[_0xf326('0x40')]=qs[_0xf326('0x40')](_0xadb020[_0xf326('0x38')][_0xf326('0x40')]);_0x40dcb4[_0xf326('0x2b')]=qs[_0xf326('0x2b')](_0xadb020[_0xf326('0x38')][_0xf326('0x2b')]);}_0x40dcb4[_0xf326('0x41')]=qs[_0xf326('0x42')](_0xadb020[_0xf326('0x38')]['sort']);_0x40dcb4[_0xf326('0x43')]=qs[_0xf326('0x3a')](_[_0xf326('0x44')](_0xadb020[_0xf326('0x38')],_0x57aa27[_0xf326('0x3a')]));if(_0xadb020[_0xf326('0x38')]['filter']){_0x40dcb4[_0xf326('0x43')]=_[_0xf326('0x45')](_0x40dcb4['where'],{'$or':_[_0xf326('0x33')](_0x409260,function(_0x819bf6){if(_0x819bf6[_0xf326('0x35')]!==_0xf326('0x46')){var _0x427c34={};_0x427c34[_0x819bf6['name']]={'$like':'%'+_0xadb020['query'][_0xf326('0x47')]+'%'};return _0x427c34;}})});}_0x40dcb4=_[_0xf326('0x45')]({},_0x40dcb4,_0xadb020['options']);var _0x4bd865={'where':_0x40dcb4[_0xf326('0x43')]};return db[_0xf326('0x48')][_0xf326('0x49')](_0x4bd865)['then'](function(_0x301e65){_0x310dbb[_0xf326('0x49')]=_0x301e65;if(_0xadb020[_0xf326('0x38')][_0xf326('0x4a')]){_0x40dcb4[_0xf326('0x4b')]=[{'all':!![]}];}return db[_0xf326('0x48')][_0xf326('0x4c')](_0x40dcb4);})[_0xf326('0x1c')](function(_0x3df9a8){_0x310dbb[_0xf326('0x4d')]=_0x3df9a8;return _0x310dbb;})[_0xf326('0x1c')](respondWithFilteredResult(_0x4d8eac,_0x40dcb4))[_0xf326('0x26')](handleError(_0x4d8eac,null));};exports[_0xf326('0x4e')]=function(_0x395b1e,_0xeac1a1){var _0x59f9a7={'raw':![],'where':{'id':_0x395b1e[_0xf326('0x4f')]['id']}},_0x199f8b={};_0x199f8b[_0xf326('0x37')]=_[_0xf326('0x39')](db['ZendeskConfiguration'][_0xf326('0x34')]);_0x199f8b[_0xf326('0x38')]=_[_0xf326('0x39')](_0x395b1e[_0xf326('0x38')]);_0x199f8b['filters']=_[_0xf326('0x3b')](_0x199f8b[_0xf326('0x37')],_0x199f8b[_0xf326('0x38')]);_0x59f9a7[_0xf326('0x3c')]=_[_0xf326('0x3b')](_0x199f8b['model'],qs['fields'](_0x395b1e[_0xf326('0x38')][_0xf326('0x3d')]));_0x59f9a7[_0xf326('0x3c')]=_0x59f9a7['attributes'][_0xf326('0x3e')]?_0x59f9a7[_0xf326('0x3c')]:_0x199f8b[_0xf326('0x37')];if(_0x395b1e['query']['includeAll']){_0x59f9a7[_0xf326('0x4b')]=[{'all':!![]}];}_0x59f9a7=_['merge']({},_0x59f9a7,_0x395b1e[_0xf326('0x50')]);return db['ZendeskConfiguration'][_0xf326('0x51')](_0x59f9a7)[_0xf326('0x1c')](handleEntityNotFound(_0xeac1a1,null))[_0xf326('0x1c')](respondWithResult(_0xeac1a1,null))[_0xf326('0x26')](handleError(_0xeac1a1,null));};exports[_0xf326('0x52')]=function(_0x35d3c8,_0x7f7ece){return db['ZendeskConfiguration'][_0xf326('0x52')](_0x35d3c8[_0xf326('0x53')],{})[_0xf326('0x1c')](respondWithResult(_0x7f7ece,0xc9))['catch'](handleError(_0x7f7ece,null));};exports[_0xf326('0x31')]=function(_0x3a832f,_0x3b8635){if(_0x3a832f[_0xf326('0x53')]['id']){delete _0x3a832f[_0xf326('0x53')]['id'];}return db['ZendeskConfiguration'][_0xf326('0x51')]({'where':{'id':_0x3a832f[_0xf326('0x4f')]['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0x3b8635,null))[_0xf326('0x1c')](saveUpdates(_0x3a832f['body'],null))[_0xf326('0x1c')](respondWithResult(_0x3b8635,null))[_0xf326('0x26')](handleError(_0x3b8635,null));};exports[_0xf326('0x54')]=function(_0x29e52e,_0x4d3b9e){return db['ZendeskConfiguration'][_0xf326('0x51')]({'where':{'id':_0x29e52e[_0xf326('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4d3b9e,null))[_0xf326('0x1c')](removeEntity(_0x4d3b9e,null))[_0xf326('0x26')](handleError(_0x4d3b9e,null));};exports[_0xf326('0x55')]=function(_0x1258d1,_0x5765b0,_0xb1c18c){var _0x5657b7={};var _0x5dbeb9={};var _0x9d84c3;var _0x51d466;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x1258d1[_0xf326('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5765b0,null))['then'](function(_0x1fd9c9){if(_0x1fd9c9){_0x9d84c3=_0x1fd9c9;_0x5dbeb9[_0xf326('0x37')]=_[_0xf326('0x39')](db['ZendeskField'][_0xf326('0x34')]);_0x5dbeb9['query']=_[_0xf326('0x39')](_0x1258d1[_0xf326('0x38')]);_0x5dbeb9[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0x5dbeb9[_0xf326('0x37')],_0x5dbeb9[_0xf326('0x38')]);_0x5657b7[_0xf326('0x3c')]=_[_0xf326('0x3b')](_0x5dbeb9[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x1258d1[_0xf326('0x38')][_0xf326('0x3d')]));_0x5657b7[_0xf326('0x3c')]=_0x5657b7['attributes'][_0xf326('0x3e')]?_0x5657b7['attributes']:_0x5dbeb9[_0xf326('0x37')];_0x5657b7[_0xf326('0x41')]=qs['sort'](_0x1258d1[_0xf326('0x38')]['sort']);_0x5657b7[_0xf326('0x43')]=qs[_0xf326('0x3a')](_[_0xf326('0x44')](_0x1258d1[_0xf326('0x38')],_0x5dbeb9[_0xf326('0x3a')]));if(_0x1258d1['query']['filter']){_0x5657b7[_0xf326('0x43')]=_[_0xf326('0x45')](_0x5657b7[_0xf326('0x43')],{'$or':_[_0xf326('0x33')](_0x5657b7[_0xf326('0x3c')],function(_0x579d2c){var _0x28c4f2={};_0x28c4f2[_0x579d2c]={'$like':'%'+_0x1258d1[_0xf326('0x38')]['filter']+'%'};return _0x28c4f2;})});}_0x5657b7=_['merge']({},_0x5657b7,_0x1258d1['options']);return _0x9d84c3[_0xf326('0x55')](_0x5657b7);}})[_0xf326('0x1c')](function(_0x4150fa){if(_0x4150fa){_0x51d466=_0x4150fa[_0xf326('0x3e')];if(!_0x1258d1[_0xf326('0x38')][_0xf326('0x57')](_0xf326('0x3f'))){_0x5657b7['limit']=qs[_0xf326('0x40')](_0x1258d1[_0xf326('0x38')][_0xf326('0x40')]);_0x5657b7[_0xf326('0x2b')]=qs['offset'](_0x1258d1[_0xf326('0x38')]['offset']);}return _0x9d84c3['getFields'](_0x5657b7);}})[_0xf326('0x1c')](function(_0x540fa0){if(_0x540fa0){return _0x540fa0?{'count':_0x51d466,'rows':_0x540fa0}:null;}})[_0xf326('0x1c')](respondWithResult(_0x5765b0,null))[_0xf326('0x26')](handleError(_0x5765b0,null));};exports[_0xf326('0x58')]=function(_0x2ea5a2,_0x17cd36,_0x541491){var _0x4a053c={};var _0x48d84a={};var _0xeeea57;var _0x307441;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x2ea5a2[_0xf326('0x4f')]['id']}})['then'](handleEntityNotFound(_0x17cd36,null))[_0xf326('0x1c')](function(_0x372dc8){if(_0x372dc8){_0xeeea57=_0x372dc8;_0x48d84a[_0xf326('0x37')]=_['keys'](db['ZendeskField'][_0xf326('0x34')]);_0x48d84a[_0xf326('0x38')]=_['keys'](_0x2ea5a2['query']);_0x48d84a[_0xf326('0x3a')]=_['intersection'](_0x48d84a[_0xf326('0x37')],_0x48d84a['query']);_0x4a053c['attributes']=_['intersection'](_0x48d84a[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x2ea5a2[_0xf326('0x38')]['fields']));_0x4a053c[_0xf326('0x3c')]=_0x4a053c[_0xf326('0x3c')][_0xf326('0x3e')]?_0x4a053c[_0xf326('0x3c')]:_0x48d84a[_0xf326('0x37')];_0x4a053c[_0xf326('0x41')]=qs[_0xf326('0x42')](_0x2ea5a2[_0xf326('0x38')][_0xf326('0x42')]);_0x4a053c['where']=qs[_0xf326('0x3a')](_['pick'](_0x2ea5a2[_0xf326('0x38')],_0x48d84a[_0xf326('0x3a')]));if(_0x2ea5a2[_0xf326('0x38')]['filter']){_0x4a053c[_0xf326('0x43')]=_[_0xf326('0x45')](_0x4a053c[_0xf326('0x43')],{'$or':_['map'](_0x4a053c[_0xf326('0x3c')],function(_0x4057e1){var _0x3bbe4c={};_0x3bbe4c[_0x4057e1]={'$like':'%'+_0x2ea5a2[_0xf326('0x38')]['filter']+'%'};return _0x3bbe4c;})});}_0x4a053c=_[_0xf326('0x45')]({},_0x4a053c,_0x2ea5a2['options']);return _0xeeea57['getSubjects'](_0x4a053c);}})[_0xf326('0x1c')](function(_0x2c36d3){if(_0x2c36d3){_0x307441=_0x2c36d3['length'];if(!_0x2ea5a2['query']['hasOwnProperty'](_0xf326('0x3f'))){_0x4a053c['limit']=qs[_0xf326('0x40')](_0x2ea5a2[_0xf326('0x38')][_0xf326('0x40')]);_0x4a053c[_0xf326('0x2b')]=qs[_0xf326('0x2b')](_0x2ea5a2[_0xf326('0x38')]['offset']);}return _0xeeea57[_0xf326('0x58')](_0x4a053c);}})[_0xf326('0x1c')](function(_0x5f1724){if(_0x5f1724){return _0x5f1724?{'count':_0x307441,'rows':_0x5f1724}:null;}})['then'](respondWithResult(_0x17cd36,null))[_0xf326('0x26')](handleError(_0x17cd36,null));};exports['getDescriptions']=function(_0x35a7c9,_0x147d51,_0x153027){var _0x363e64={};var _0x19d676={};var _0x6e662;var _0x293600;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x35a7c9['params']['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0x147d51,null))[_0xf326('0x1c')](function(_0x4ac90e){if(_0x4ac90e){_0x6e662=_0x4ac90e;_0x19d676[_0xf326('0x37')]=_['keys'](db[_0xf326('0x59')][_0xf326('0x34')]);_0x19d676[_0xf326('0x38')]=_['keys'](_0x35a7c9[_0xf326('0x38')]);_0x19d676[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0x19d676[_0xf326('0x37')],_0x19d676[_0xf326('0x38')]);_0x363e64[_0xf326('0x3c')]=_[_0xf326('0x3b')](_0x19d676[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x35a7c9[_0xf326('0x38')][_0xf326('0x3d')]));_0x363e64[_0xf326('0x3c')]=_0x363e64[_0xf326('0x3c')][_0xf326('0x3e')]?_0x363e64[_0xf326('0x3c')]:_0x19d676['model'];_0x363e64[_0xf326('0x41')]=qs[_0xf326('0x42')](_0x35a7c9['query'][_0xf326('0x42')]);_0x363e64[_0xf326('0x43')]=qs['filters'](_[_0xf326('0x44')](_0x35a7c9[_0xf326('0x38')],_0x19d676[_0xf326('0x3a')]));if(_0x35a7c9[_0xf326('0x38')][_0xf326('0x47')]){_0x363e64[_0xf326('0x43')]=_[_0xf326('0x45')](_0x363e64['where'],{'$or':_[_0xf326('0x33')](_0x363e64[_0xf326('0x3c')],function(_0x323fb1){var _0x3c33d1={};_0x3c33d1[_0x323fb1]={'$like':'%'+_0x35a7c9[_0xf326('0x38')][_0xf326('0x47')]+'%'};return _0x3c33d1;})});}_0x363e64=_[_0xf326('0x45')]({},_0x363e64,_0x35a7c9[_0xf326('0x50')]);return _0x6e662['getDescriptions'](_0x363e64);}})[_0xf326('0x1c')](function(_0x2e2103){if(_0x2e2103){_0x293600=_0x2e2103['length'];if(!_0x35a7c9[_0xf326('0x38')]['hasOwnProperty'](_0xf326('0x3f'))){_0x363e64[_0xf326('0x40')]=qs[_0xf326('0x40')](_0x35a7c9[_0xf326('0x38')][_0xf326('0x40')]);_0x363e64[_0xf326('0x2b')]=qs[_0xf326('0x2b')](_0x35a7c9[_0xf326('0x38')][_0xf326('0x2b')]);}return _0x6e662[_0xf326('0x5a')](_0x363e64);}})[_0xf326('0x1c')](function(_0x3face2){if(_0x3face2){return _0x3face2?{'count':_0x293600,'rows':_0x3face2}:null;}})[_0xf326('0x1c')](respondWithResult(_0x147d51,null))[_0xf326('0x26')](handleError(_0x147d51,null));};exports['getTags']=function(_0x2bb6f0,_0xdb6e40,_0x27c569){var _0x3d3bd4={};var _0xdb2ad8={};var _0x550f34;var _0x1ec128;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x2bb6f0[_0xf326('0x4f')]['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0xdb6e40,null))['then'](function(_0x4b6ec0){if(_0x4b6ec0){_0x550f34=_0x4b6ec0;_0xdb2ad8[_0xf326('0x37')]=_['keys'](db[_0xf326('0x5b')][_0xf326('0x34')]);_0xdb2ad8[_0xf326('0x38')]=_['keys'](_0x2bb6f0['query']);_0xdb2ad8[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0xdb2ad8[_0xf326('0x37')],_0xdb2ad8[_0xf326('0x38')]);_0x3d3bd4[_0xf326('0x3c')]=_['intersection'](_0xdb2ad8[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x2bb6f0[_0xf326('0x38')]['fields']));_0x3d3bd4['attributes']=_0x3d3bd4['attributes'][_0xf326('0x3e')]?_0x3d3bd4[_0xf326('0x3c')]:_0xdb2ad8[_0xf326('0x37')];_0x3d3bd4[_0xf326('0x41')]=qs[_0xf326('0x42')](_0x2bb6f0[_0xf326('0x38')][_0xf326('0x42')]);_0x3d3bd4['where']=qs['filters'](_[_0xf326('0x44')](_0x2bb6f0[_0xf326('0x38')],_0xdb2ad8[_0xf326('0x3a')]));if(_0x2bb6f0['query'][_0xf326('0x47')]){_0x3d3bd4[_0xf326('0x43')]=_[_0xf326('0x45')](_0x3d3bd4['where'],{'$or':_[_0xf326('0x33')](_0x3d3bd4[_0xf326('0x3c')],function(_0x267bae){var _0x3d728a={};_0x3d728a[_0x267bae]={'$like':'%'+_0x2bb6f0['query']['filter']+'%'};return _0x3d728a;})});}_0x3d3bd4=_['merge']({},_0x3d3bd4,_0x2bb6f0[_0xf326('0x50')]);return _0x550f34[_0xf326('0x5c')](_0x3d3bd4);}})[_0xf326('0x1c')](function(_0x5f0b45){if(_0x5f0b45){_0x1ec128=_0x5f0b45[_0xf326('0x3e')];if(!_0x2bb6f0[_0xf326('0x38')][_0xf326('0x57')]('nolimit')){_0x3d3bd4[_0xf326('0x40')]=qs[_0xf326('0x40')](_0x2bb6f0[_0xf326('0x38')][_0xf326('0x40')]);_0x3d3bd4['offset']=qs[_0xf326('0x2b')](_0x2bb6f0['query'][_0xf326('0x2b')]);}return _0x550f34[_0xf326('0x5c')](_0x3d3bd4);}})[_0xf326('0x1c')](function(_0xd45708){if(_0xd45708){return _0xd45708?{'count':_0x1ec128,'rows':_0xd45708}:null;}})['then'](respondWithResult(_0xdb6e40,null))[_0xf326('0x26')](handleError(_0xdb6e40,null));};exports['setTags']=function(_0x499316,_0x1ec34d,_0x1d6962){if(_0x499316[_0xf326('0x53')]['id']){delete _0x499316[_0xf326('0x53')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x499316[_0xf326('0x4f')]['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0x1ec34d,null))[_0xf326('0x1c')](function(_0xc67315){if(_0xc67315){return _0xc67315['setTags'](_0x499316[_0xf326('0x53')]['ids']||[]);}return null;})[_0xf326('0x1c')](respondWithResult(_0x1ec34d,null))[_0xf326('0x26')](handleError(_0x1ec34d,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 2a1cbc9..4a0e4fb 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 _0x4b11=['moment','bluebird','path','../../config/environment','exports','define','int_zendesk_configurations','../../config/logger'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x4b11,0x1ef));var _0x14b1=function(_0x248e0e,_0x3e806f){_0x248e0e=_0x248e0e-0x0;var _0x178928=_0x4b11[_0x248e0e];return _0x178928;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x14b1('0x0'))('api');var moment=require(_0x14b1('0x1'));var BPromise=require(_0x14b1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x14b1('0x3'));var rimraf=require('rimraf');var config=require(_0x14b1('0x4'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x14b1('0x5')]=function(_0x437221,_0x3ecbb9){return _0x437221[_0x14b1('0x6')]('ZendeskConfiguration',attributes,{'tableName':_0x14b1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x825f=['util','api','moment','bluebird','request-promise','path','rimraf','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x29cdbc,_0x48fea5){var _0x41f484=function(_0x510fda){while(--_0x510fda){_0x29cdbc['push'](_0x29cdbc['shift']());}};_0x41f484(++_0x48fea5);}(_0x825f,0x108));var _0xf825=function(_0x1daf88,_0x4c9b1b){_0x1daf88=_0x1daf88-0x0;var _0xff8a1e=_0x825f[_0x1daf88];return _0xff8a1e;};'use strict';var _=require('lodash');var util=require(_0xf825('0x0'));var logger=require('../../config/logger')(_0xf825('0x1'));var moment=require(_0xf825('0x2'));var BPromise=require(_0xf825('0x3'));var rp=require(_0xf825('0x4'));var fs=require('fs');var path=require(_0xf825('0x5'));var rimraf=require(_0xf825('0x6'));var config=require('../../config/environment');var attributes=require(_0xf825('0x7'));module[_0xf825('0x8')]=function(_0xcfd6c6,_0x3c601b){return _0xcfd6c6[_0xf825('0x9')](_0xf825('0xa'),attributes,{'tableName':_0xf825('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 5a2ea07..fccaa98 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 _0x7306=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment'];(function(_0x1e1879,_0x163311){var _0x4760e3=function(_0x119454){while(--_0x119454){_0x1e1879['push'](_0x1e1879['shift']());}};_0x4760e3(++_0x163311);}(_0x7306,0x76));var _0x6730=function(_0x4b7cfa,_0x13583d){_0x4b7cfa=_0x4b7cfa-0x0;var _0x31875e=_0x7306[_0x4b7cfa];return _0x31875e;};'use strict';var _=require(_0x6730('0x0'));var util=require('util');var moment=require(_0x6730('0x1'));var BPromise=require(_0x6730('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6730('0x3'));var db=require(_0x6730('0x4'))['db'];var utils=require(_0x6730('0x5'));var logger=require(_0x6730('0x6'))(_0x6730('0x7'));var config=require('../../config/environment');var jayson=require(_0x6730('0x8'));var client=jayson['client'][_0x6730('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4905de,_0x413995,_0x1bfa6d){return new BPromise(function(_0x5a289e,_0x59fc4f){return client['request'](_0x4905de,_0x1bfa6d)[_0x6730('0xa')](function(_0x498599){logger['info'](_0x6730('0xb'),_0x413995,_0x6730('0xc'));logger[_0x6730('0xd')](_0x6730('0xe'),_0x413995,_0x6730('0xc'),JSON[_0x6730('0xf')](_0x498599));if(_0x498599[_0x6730('0x10')]){if(_0x498599['error'][_0x6730('0x11')]===0x1f4){logger[_0x6730('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x413995,_0x498599[_0x6730('0x10')][_0x6730('0x12')]);return _0x59fc4f(_0x498599[_0x6730('0x10')][_0x6730('0x12')]);}logger[_0x6730('0x10')](_0x6730('0xb'),_0x413995,_0x498599[_0x6730('0x10')][_0x6730('0x12')]);return _0x5a289e(_0x498599[_0x6730('0x10')][_0x6730('0x12')]);}else{logger['info'](_0x6730('0xb'),_0x413995,'request\x20sent');_0x5a289e(_0x498599['result'][_0x6730('0x12')]);}})[_0x6730('0x13')](function(_0x3ede2c){logger[_0x6730('0x10')](_0x6730('0xb'),_0x413995,_0x3ede2c);_0x59fc4f(_0x3ede2c);});});} \ No newline at end of file +var _0xda5a=['debug','stringify','error','code','message','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x53d664,_0x5c3b5a){var _0x324a1c=function(_0x5a39df){while(--_0x5a39df){_0x53d664['push'](_0x53d664['shift']());}};_0x324a1c(++_0x5c3b5a);}(_0xda5a,0x1bb));var _0xada5=function(_0x1e7060,_0x453e1a){_0x1e7060=_0x1e7060-0x0;var _0x4233cf=_0xda5a[_0x1e7060];return _0x4233cf;};'use strict';var _=require(_0xada5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xada5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xada5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xada5('0x3'));var logger=require(_0xada5('0x4'))('rpc');var config=require(_0xada5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xada5('0x6')][_0xada5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1954fb,_0x440425,_0x15fe75){return new BPromise(function(_0x59020e,_0x19b420){return client[_0xada5('0x8')](_0x1954fb,_0x15fe75)[_0xada5('0x9')](function(_0x519ee4){logger[_0xada5('0xa')](_0xada5('0xb'),_0x440425,_0xada5('0xc'));logger[_0xada5('0xd')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x440425,_0xada5('0xc'),JSON[_0xada5('0xe')](_0x519ee4));if(_0x519ee4[_0xada5('0xf')]){if(_0x519ee4['error'][_0xada5('0x10')]===0x1f4){logger[_0xada5('0xf')](_0xada5('0xb'),_0x440425,_0x519ee4[_0xada5('0xf')][_0xada5('0x11')]);return _0x19b420(_0x519ee4[_0xada5('0xf')][_0xada5('0x11')]);}logger[_0xada5('0xf')](_0xada5('0xb'),_0x440425,_0x519ee4[_0xada5('0xf')][_0xada5('0x11')]);return _0x59020e(_0x519ee4['error'][_0xada5('0x11')]);}else{logger['info'](_0xada5('0xb'),_0x440425,_0xada5('0xc'));_0x59020e(_0x519ee4['result'][_0xada5('0x11')]);}})[_0xada5('0x12')](function(_0x10b63c){logger[_0xada5('0xf')](_0xada5('0xb'),_0x440425,_0x10b63c);_0x19b420(_0x10b63c);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index ec5e03a..03aca49 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 _0x578c=['put','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','./intZendeskField.controller','index','get','/:id','isAuthenticated','show','post','create'];(function(_0x5da2df,_0x313e20){var _0x38a42d=function(_0x38b72b){while(--_0x38b72b){_0x5da2df['push'](_0x5da2df['shift']());}};_0x38a42d(++_0x313e20);}(_0x578c,0x17b));var _0xc578=function(_0x5e2bc4,_0x986b09){_0x5e2bc4=_0x5e2bc4-0x0;var _0x3cb031=_0x578c[_0x5e2bc4];return _0x3cb031;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc578('0x0'));var timeout=require(_0xc578('0x1'));var express=require(_0xc578('0x2'));var router=express['Router']();var auth=require(_0xc578('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc578('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xc578('0x5')]);router[_0xc578('0x6')](_0xc578('0x7'),auth[_0xc578('0x8')](),controller[_0xc578('0x9')]);router[_0xc578('0xa')]('/',auth[_0xc578('0x8')](),controller[_0xc578('0xb')]);router[_0xc578('0xc')](_0xc578('0x7'),auth[_0xc578('0x8')](),controller[_0xc578('0xd')]);router[_0xc578('0xe')]('/:id',auth[_0xc578('0x8')](),controller[_0xc578('0xf')]);module[_0xc578('0x10')]=router; \ No newline at end of file +var _0xf28f=['./intZendeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x92d580,_0x4928fb){var _0x4ee344=function(_0x55aa0c){while(--_0x55aa0c){_0x92d580['push'](_0x92d580['shift']());}};_0x4ee344(++_0x4928fb);}(_0xf28f,0x11a));var _0xff28=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xf28f[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0xff28('0x0'));var util=require(_0xff28('0x1'));var path=require('path');var timeout=require(_0xff28('0x2'));var express=require(_0xff28('0x3'));var router=express[_0xff28('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xff28('0x5'));var config=require(_0xff28('0x6'));var controller=require(_0xff28('0x7'));router[_0xff28('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xff28('0x8')]('/:id',auth[_0xff28('0x9')](),controller[_0xff28('0xa')]);router[_0xff28('0xb')]('/',auth['isAuthenticated'](),controller[_0xff28('0xc')]);router[_0xff28('0xd')](_0xff28('0xe'),auth[_0xff28('0x9')](),controller[_0xff28('0xf')]);router['delete'](_0xff28('0xe'),auth['isAuthenticated'](),controller[_0xff28('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 229dc3c..19ee1fb 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 _0x89c3=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x5a09b7,_0x58385b){var _0x1718e6=function(_0x55b804){while(--_0x55b804){_0x5a09b7['push'](_0x5a09b7['shift']());}};_0x1718e6(++_0x58385b);}(_0x89c3,0xff));var _0x389c=function(_0x4e8ac1,_0x19d406){_0x4e8ac1=_0x4e8ac1-0x0;var _0x113621=_0x89c3[_0x4e8ac1];return _0x113621;};'use strict';var Sequelize=require(_0x389c('0x0'));module[_0x389c('0x1')]={'type':{'type':Sequelize[_0x389c('0x2')](_0x389c('0x3'),_0x389c('0x4'),_0x389c('0x5'),_0x389c('0x6')),'defaultValue':_0x389c('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x389c('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x389c('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x389c('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x389c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x389c('0x7')]}}; \ No newline at end of file +var _0x1052=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x24a2cc,_0x455e1f){var _0x1cf0ad=function(_0x3ad71b){while(--_0x3ad71b){_0x24a2cc['push'](_0x24a2cc['shift']());}};_0x1cf0ad(++_0x455e1f);}(_0x1052,0xf4));var _0x2105=function(_0x5ab0fb,_0x355be1){_0x5ab0fb=_0x5ab0fb-0x0;var _0x15761a=_0x1052[_0x5ab0fb];return _0x15761a;};'use strict';var Sequelize=require(_0x2105('0x0'));module[_0x2105('0x1')]={'type':{'type':Sequelize[_0x2105('0x2')](_0x2105('0x3'),_0x2105('0x4'),_0x2105('0x5'),_0x2105('0x6')),'defaultValue':_0x2105('0x3')},'content':{'type':Sequelize[_0x2105('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x2105('0x3'),'variable',_0x2105('0x5'))},'keyContent':{'type':Sequelize[_0x2105('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2105('0x7')]},'customField':{'type':Sequelize[_0x2105('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2105('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 1d57b7f..2cfd1a3 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 _0x3084=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','jsforce'];(function(_0x38fb0b,_0x1fe9fb){var _0x403cb4=function(_0x6b0a08){while(--_0x6b0a08){_0x38fb0b['push'](_0x38fb0b['shift']());}};_0x403cb4(++_0x1fe9fb);}(_0x3084,0x156));var _0x4308=function(_0x443681,_0x38d25b){_0x443681=_0x443681-0x0;var _0x4e1772=_0x3084[_0x443681];return _0x4e1772;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4308('0x0'));var rimraf=require(_0x4308('0x1'));var zipdir=require(_0x4308('0x2'));var jsonpatch=require(_0x4308('0x3'));var rp=require(_0x4308('0x4'));var moment=require(_0x4308('0x5'));var BPromise=require(_0x4308('0x6'));var Mustache=require(_0x4308('0x7'));var util=require('util');var path=require(_0x4308('0x8'));var sox=require(_0x4308('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4308('0xa'));var squel=require(_0x4308('0xb'));var crypto=require('crypto');var jsforce=require(_0x4308('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4308('0xd'));var querystring=require(_0x4308('0xe'));var Papa=require(_0x4308('0xf'));var Redis=require(_0x4308('0x10'));var authService=require(_0x4308('0x11'));var qs=require(_0x4308('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4308('0x13'));var logger=require('../../config/logger')(_0x4308('0x14'));var utils=require(_0x4308('0x15'));var config=require('../../config/environment');var db=require(_0x4308('0x16'))['db'];function respondWithStatusCode(_0x40c17f,_0x4ce804){_0x4ce804=_0x4ce804||0xcc;return function(_0x3a1621){if(_0x3a1621){return _0x40c17f[_0x4308('0x17')](_0x4ce804);}return _0x40c17f[_0x4308('0x18')](_0x4ce804)[_0x4308('0x19')]();};}function respondWithResult(_0x1047f3,_0x161915){_0x161915=_0x161915||0xc8;return function(_0x2a0e99){if(_0x2a0e99){return _0x1047f3['status'](_0x161915)[_0x4308('0x1a')](_0x2a0e99);}};}function respondWithFilteredResult(_0x1045c0,_0x1ebc9a){return function(_0x5ae6ad){if(_0x5ae6ad){var _0x21a418=_0x5ae6ad[_0x4308('0x1b')],_0x1830b3=_0x1ebc9a[_0x4308('0x1c')],_0x5e3c2e=_0x1ebc9a['offset']+_0x1ebc9a[_0x4308('0x1d')],_0x3700e2;if(_0x5e3c2e>=_0x21a418){_0x5e3c2e=_0x21a418;_0x3700e2=0xc8;}else{_0x3700e2=0xce;}_0x1045c0[_0x4308('0x18')](_0x3700e2);return _0x1045c0[_0x4308('0x1e')]('Content-Range',_0x1830b3+'-'+_0x5e3c2e+'/'+_0x21a418)['json'](_0x5ae6ad);}return null;};}function patchUpdates(_0x4aea8e){return function(_0x59c4d9){try{jsonpatch['apply'](_0x59c4d9,_0x4aea8e,!![]);}catch(_0x1e43fc){return BPromise[_0x4308('0x1f')](_0x1e43fc);}return _0x59c4d9[_0x4308('0x20')]();};}function saveUpdates(_0x2b6c62,_0x538e1a){return function(_0x76c77f){if(_0x76c77f){return _0x76c77f[_0x4308('0x21')](_0x2b6c62)[_0x4308('0x22')](function(_0x16968b){return _0x16968b;});}return null;};}function removeEntity(_0x2bc30e,_0x57c25d){return function(_0x1e3a83){if(_0x1e3a83){return _0x1e3a83['destroy']()[_0x4308('0x22')](function(){_0x2bc30e[_0x4308('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31f9b2,_0x47d1c0){return function(_0x25cd72){if(!_0x25cd72){_0x31f9b2['sendStatus'](0x194);}return _0x25cd72;};}function handleError(_0x1f6bfb,_0x33cf56){_0x33cf56=_0x33cf56||0x1f4;return function(_0x15291a){logger[_0x4308('0x23')](_0x15291a[_0x4308('0x24')]);if(_0x15291a[_0x4308('0x25')]){delete _0x15291a['name'];}_0x1f6bfb[_0x4308('0x18')](_0x33cf56)[_0x4308('0x26')](_0x15291a);};}exports[_0x4308('0x27')]=function(_0x25fd4f,_0x21461a){var _0x185682={},_0x11056c={},_0x4dc861={'count':0x0,'rows':[]};var _0x4f05b0=_[_0x4308('0x28')](db[_0x4308('0x29')][_0x4308('0x2a')],function(_0x1bd165){return{'name':_0x1bd165[_0x4308('0x2b')],'type':_0x1bd165['type']['key']};});_0x11056c[_0x4308('0x2c')]=_[_0x4308('0x28')](_0x4f05b0,_0x4308('0x25'));_0x11056c['query']=_['keys'](_0x25fd4f[_0x4308('0x2d')]);_0x11056c['filters']=_[_0x4308('0x2e')](_0x11056c[_0x4308('0x2c')],_0x11056c[_0x4308('0x2d')]);_0x185682[_0x4308('0x2f')]=_[_0x4308('0x2e')](_0x11056c['model'],qs[_0x4308('0x30')](_0x25fd4f[_0x4308('0x2d')][_0x4308('0x30')]));_0x185682[_0x4308('0x2f')]=_0x185682['attributes'][_0x4308('0x31')]?_0x185682[_0x4308('0x2f')]:_0x11056c[_0x4308('0x2c')];if(!_0x25fd4f[_0x4308('0x2d')][_0x4308('0x32')](_0x4308('0x33'))){_0x185682[_0x4308('0x1d')]=qs[_0x4308('0x1d')](_0x25fd4f[_0x4308('0x2d')][_0x4308('0x1d')]);_0x185682[_0x4308('0x1c')]=qs['offset'](_0x25fd4f[_0x4308('0x2d')][_0x4308('0x1c')]);}_0x185682['order']=qs[_0x4308('0x34')](_0x25fd4f[_0x4308('0x2d')][_0x4308('0x34')]);_0x185682[_0x4308('0x35')]=qs[_0x4308('0x36')](_[_0x4308('0x37')](_0x25fd4f[_0x4308('0x2d')],_0x11056c[_0x4308('0x36')]));if(_0x25fd4f[_0x4308('0x2d')]['filter']){_0x185682[_0x4308('0x35')]=_[_0x4308('0x38')](_0x185682[_0x4308('0x35')],{'$or':_[_0x4308('0x28')](_0x4f05b0,function(_0xd45365){if(_0xd45365['type']!==_0x4308('0x39')){var _0x18d944={};_0x18d944[_0xd45365['name']]={'$like':'%'+_0x25fd4f['query']['filter']+'%'};return _0x18d944;}})});}_0x185682=_[_0x4308('0x38')]({},_0x185682,_0x25fd4f[_0x4308('0x3a')]);var _0x2adb61={'where':_0x185682['where']};return db[_0x4308('0x29')][_0x4308('0x1b')](_0x2adb61)[_0x4308('0x22')](function(_0x4f43fa){_0x4dc861[_0x4308('0x1b')]=_0x4f43fa;if(_0x25fd4f[_0x4308('0x2d')][_0x4308('0x3b')]){_0x185682['include']=[{'all':!![]}];}return db[_0x4308('0x29')][_0x4308('0x3c')](_0x185682);})[_0x4308('0x22')](function(_0x4a21b0){_0x4dc861[_0x4308('0x3d')]=_0x4a21b0;return _0x4dc861;})['then'](respondWithFilteredResult(_0x21461a,_0x185682))[_0x4308('0x3e')](handleError(_0x21461a,null));};exports[_0x4308('0x3f')]=function(_0x5e575d,_0x19d057){var _0x5345aa={'raw':!![],'where':{'id':_0x5e575d['params']['id']}},_0x121b70={};_0x121b70[_0x4308('0x2c')]=_[_0x4308('0x40')](db[_0x4308('0x29')][_0x4308('0x2a')]);_0x121b70[_0x4308('0x2d')]=_[_0x4308('0x40')](_0x5e575d[_0x4308('0x2d')]);_0x121b70['filters']=_[_0x4308('0x2e')](_0x121b70[_0x4308('0x2c')],_0x121b70['query']);_0x5345aa[_0x4308('0x2f')]=_[_0x4308('0x2e')](_0x121b70[_0x4308('0x2c')],qs[_0x4308('0x30')](_0x5e575d[_0x4308('0x2d')][_0x4308('0x30')]));_0x5345aa[_0x4308('0x2f')]=_0x5345aa[_0x4308('0x2f')]['length']?_0x5345aa[_0x4308('0x2f')]:_0x121b70['model'];if(_0x5e575d[_0x4308('0x2d')][_0x4308('0x3b')]){_0x5345aa[_0x4308('0x41')]=[{'all':!![]}];}_0x5345aa=_[_0x4308('0x38')]({},_0x5345aa,_0x5e575d['options']);return db[_0x4308('0x29')][_0x4308('0x42')](_0x5345aa)['then'](handleEntityNotFound(_0x19d057,null))[_0x4308('0x22')](respondWithResult(_0x19d057,null))['catch'](handleError(_0x19d057,null));};exports[_0x4308('0x43')]=function(_0x227f4d,_0x2c56ef){return db[_0x4308('0x29')]['create'](_0x227f4d['body'],{})[_0x4308('0x22')](respondWithResult(_0x2c56ef,0xc9))[_0x4308('0x3e')](handleError(_0x2c56ef,null));};exports[_0x4308('0x21')]=function(_0x5d008f,_0x380757){if(_0x5d008f[_0x4308('0x44')]['id']){delete _0x5d008f[_0x4308('0x44')]['id'];}return db['ZendeskField'][_0x4308('0x42')]({'where':{'id':_0x5d008f[_0x4308('0x45')]['id']}})[_0x4308('0x22')](handleEntityNotFound(_0x380757,null))[_0x4308('0x22')](saveUpdates(_0x5d008f[_0x4308('0x44')],null))['then'](respondWithResult(_0x380757,null))['catch'](handleError(_0x380757,null));};exports[_0x4308('0x46')]=function(_0x4659e6,_0x4c855d){return db['ZendeskField'][_0x4308('0x42')]({'where':{'id':_0x4659e6[_0x4308('0x45')]['id']}})[_0x4308('0x22')](handleEntityNotFound(_0x4c855d,null))[_0x4308('0x22')](removeEntity(_0x4c855d,null))[_0x4308('0x3e')](handleError(_0x4c855d,null));}; \ No newline at end of file +var _0x4859=['error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','order','sort','pick','filter','where','VIRTUAL','options','count','includeAll','include','rows','show','intersection','length','create','body','catch','update','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','destroy','then'];(function(_0x3e597a,_0x524856){var _0x2ae127=function(_0x37418c){while(--_0x37418c){_0x3e597a['push'](_0x3e597a['shift']());}};_0x2ae127(++_0x524856);}(_0x4859,0x6c));var _0x9485=function(_0x468b65,_0x57cbe6){_0x468b65=_0x468b65-0x0;var _0x894a8c=_0x4859[_0x468b65];return _0x894a8c;};'use strict';var pdf=require(_0x9485('0x0'));var emlformat=require(_0x9485('0x1'));var rimraf=require(_0x9485('0x2'));var zipdir=require(_0x9485('0x3'));var jsonpatch=require(_0x9485('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9485('0x5'));var Mustache=require(_0x9485('0x6'));var util=require(_0x9485('0x7'));var path=require(_0x9485('0x8'));var sox=require(_0x9485('0x9'));var csv=require(_0x9485('0xa'));var ejs=require(_0x9485('0xb'));var fs=require('fs');var _=require(_0x9485('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9485('0xd'));var deskjs=require(_0x9485('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9485('0xf'));var Papa=require('papaparse');var Redis=require(_0x9485('0x10'));var authService=require(_0x9485('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9485('0x12'));var hardwareService=require(_0x9485('0x13'));var logger=require('../../config/logger')(_0x9485('0x14'));var utils=require(_0x9485('0x15'));var config=require(_0x9485('0x16'));var db=require(_0x9485('0x17'))['db'];function respondWithStatusCode(_0x81cad,_0x211125){_0x211125=_0x211125||0xcc;return function(_0x15a496){if(_0x15a496){return _0x81cad[_0x9485('0x18')](_0x211125);}return _0x81cad[_0x9485('0x19')](_0x211125)[_0x9485('0x1a')]();};}function respondWithResult(_0x30e85e,_0x581734){_0x581734=_0x581734||0xc8;return function(_0x1ede15){if(_0x1ede15){return _0x30e85e['status'](_0x581734)[_0x9485('0x1b')](_0x1ede15);}};}function respondWithFilteredResult(_0x475866,_0x3ae7e1){return function(_0x74b052){if(_0x74b052){var _0x4794eb=_0x74b052['count'],_0x4d3199=_0x3ae7e1[_0x9485('0x1c')],_0x3c08b0=_0x3ae7e1[_0x9485('0x1c')]+_0x3ae7e1[_0x9485('0x1d')],_0x1d8ac8;if(_0x3c08b0>=_0x4794eb){_0x3c08b0=_0x4794eb;_0x1d8ac8=0xc8;}else{_0x1d8ac8=0xce;}_0x475866[_0x9485('0x19')](_0x1d8ac8);return _0x475866['set'](_0x9485('0x1e'),_0x4d3199+'-'+_0x3c08b0+'/'+_0x4794eb)['json'](_0x74b052);}return null;};}function patchUpdates(_0x3e0d15){return function(_0x3db03a){try{jsonpatch[_0x9485('0x1f')](_0x3db03a,_0x3e0d15,!![]);}catch(_0x5649ac){return BPromise[_0x9485('0x20')](_0x5649ac);}return _0x3db03a[_0x9485('0x21')]();};}function saveUpdates(_0x10853e,_0x5743a2){return function(_0x4474bb){if(_0x4474bb){return _0x4474bb['update'](_0x10853e)['then'](function(_0x48aa51){return _0x48aa51;});}return null;};}function removeEntity(_0x2e73b0,_0x5a08f0){return function(_0x4d81be){if(_0x4d81be){return _0x4d81be[_0x9485('0x22')]()[_0x9485('0x23')](function(){_0x2e73b0[_0x9485('0x19')](0xcc)[_0x9485('0x1a')]();});}};}function handleEntityNotFound(_0x4b4258,_0x7b36a0){return function(_0x287c02){if(!_0x287c02){_0x4b4258[_0x9485('0x18')](0x194);}return _0x287c02;};}function handleError(_0x206331,_0x1ddc20){_0x1ddc20=_0x1ddc20||0x1f4;return function(_0x1e842e){logger[_0x9485('0x24')](_0x1e842e[_0x9485('0x25')]);if(_0x1e842e[_0x9485('0x26')]){delete _0x1e842e[_0x9485('0x26')];}_0x206331[_0x9485('0x19')](_0x1ddc20)[_0x9485('0x27')](_0x1e842e);};}exports[_0x9485('0x28')]=function(_0x4b475b,_0x18f84d){var _0x30e567={},_0x2b2aa7={},_0x37825c={'count':0x0,'rows':[]};var _0x3598c9=_[_0x9485('0x29')](db[_0x9485('0x2a')][_0x9485('0x2b')],function(_0x4d1776){return{'name':_0x4d1776[_0x9485('0x2c')],'type':_0x4d1776[_0x9485('0x2d')]['key']};});_0x2b2aa7[_0x9485('0x2e')]=_[_0x9485('0x29')](_0x3598c9,'name');_0x2b2aa7[_0x9485('0x2f')]=_[_0x9485('0x30')](_0x4b475b[_0x9485('0x2f')]);_0x2b2aa7[_0x9485('0x31')]=_['intersection'](_0x2b2aa7[_0x9485('0x2e')],_0x2b2aa7['query']);_0x30e567[_0x9485('0x32')]=_['intersection'](_0x2b2aa7['model'],qs[_0x9485('0x33')](_0x4b475b[_0x9485('0x2f')]['fields']));_0x30e567[_0x9485('0x32')]=_0x30e567[_0x9485('0x32')]['length']?_0x30e567[_0x9485('0x32')]:_0x2b2aa7[_0x9485('0x2e')];if(!_0x4b475b[_0x9485('0x2f')]['hasOwnProperty']('nolimit')){_0x30e567[_0x9485('0x1d')]=qs[_0x9485('0x1d')](_0x4b475b['query']['limit']);_0x30e567[_0x9485('0x1c')]=qs[_0x9485('0x1c')](_0x4b475b[_0x9485('0x2f')][_0x9485('0x1c')]);}_0x30e567[_0x9485('0x34')]=qs[_0x9485('0x35')](_0x4b475b[_0x9485('0x2f')][_0x9485('0x35')]);_0x30e567['where']=qs['filters'](_[_0x9485('0x36')](_0x4b475b[_0x9485('0x2f')],_0x2b2aa7[_0x9485('0x31')]));if(_0x4b475b[_0x9485('0x2f')][_0x9485('0x37')]){_0x30e567[_0x9485('0x38')]=_['merge'](_0x30e567[_0x9485('0x38')],{'$or':_[_0x9485('0x29')](_0x3598c9,function(_0xd403b0){if(_0xd403b0['type']!==_0x9485('0x39')){var _0x336cee={};_0x336cee[_0xd403b0[_0x9485('0x26')]]={'$like':'%'+_0x4b475b[_0x9485('0x2f')]['filter']+'%'};return _0x336cee;}})});}_0x30e567=_['merge']({},_0x30e567,_0x4b475b[_0x9485('0x3a')]);var _0x59fa55={'where':_0x30e567[_0x9485('0x38')]};return db['ZendeskField'][_0x9485('0x3b')](_0x59fa55)[_0x9485('0x23')](function(_0x26700c){_0x37825c[_0x9485('0x3b')]=_0x26700c;if(_0x4b475b[_0x9485('0x2f')][_0x9485('0x3c')]){_0x30e567[_0x9485('0x3d')]=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x30e567);})[_0x9485('0x23')](function(_0x4462f1){_0x37825c[_0x9485('0x3e')]=_0x4462f1;return _0x37825c;})[_0x9485('0x23')](respondWithFilteredResult(_0x18f84d,_0x30e567))['catch'](handleError(_0x18f84d,null));};exports[_0x9485('0x3f')]=function(_0x53f396,_0x41adeb){var _0x3f6d9a={'raw':!![],'where':{'id':_0x53f396['params']['id']}},_0x52073a={};_0x52073a[_0x9485('0x2e')]=_['keys'](db['ZendeskField'][_0x9485('0x2b')]);_0x52073a[_0x9485('0x2f')]=_[_0x9485('0x30')](_0x53f396[_0x9485('0x2f')]);_0x52073a[_0x9485('0x31')]=_[_0x9485('0x40')](_0x52073a[_0x9485('0x2e')],_0x52073a[_0x9485('0x2f')]);_0x3f6d9a['attributes']=_[_0x9485('0x40')](_0x52073a['model'],qs[_0x9485('0x33')](_0x53f396[_0x9485('0x2f')]['fields']));_0x3f6d9a[_0x9485('0x32')]=_0x3f6d9a[_0x9485('0x32')][_0x9485('0x41')]?_0x3f6d9a[_0x9485('0x32')]:_0x52073a['model'];if(_0x53f396['query']['includeAll']){_0x3f6d9a[_0x9485('0x3d')]=[{'all':!![]}];}_0x3f6d9a=_['merge']({},_0x3f6d9a,_0x53f396[_0x9485('0x3a')]);return db['ZendeskField']['find'](_0x3f6d9a)['then'](handleEntityNotFound(_0x41adeb,null))[_0x9485('0x23')](respondWithResult(_0x41adeb,null))['catch'](handleError(_0x41adeb,null));};exports[_0x9485('0x42')]=function(_0x30b82b,_0x3363e8){return db[_0x9485('0x2a')]['create'](_0x30b82b[_0x9485('0x43')],{})[_0x9485('0x23')](respondWithResult(_0x3363e8,0xc9))[_0x9485('0x44')](handleError(_0x3363e8,null));};exports[_0x9485('0x45')]=function(_0x2a219a,_0x144afb){if(_0x2a219a[_0x9485('0x43')]['id']){delete _0x2a219a[_0x9485('0x43')]['id'];}return db[_0x9485('0x2a')][_0x9485('0x46')]({'where':{'id':_0x2a219a[_0x9485('0x47')]['id']}})[_0x9485('0x23')](handleEntityNotFound(_0x144afb,null))[_0x9485('0x23')](saveUpdates(_0x2a219a[_0x9485('0x43')],null))[_0x9485('0x23')](respondWithResult(_0x144afb,null))[_0x9485('0x44')](handleError(_0x144afb,null));};exports['destroy']=function(_0x1ddda9,_0x4177de){return db['ZendeskField'][_0x9485('0x46')]({'where':{'id':_0x1ddda9[_0x9485('0x47')]['id']}})[_0x9485('0x23')](handleEntityNotFound(_0x4177de,null))[_0x9485('0x23')](removeEntity(_0x4177de,null))['catch'](handleError(_0x4177de,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 7f30faa..8a79727 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 _0xdfe9=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField','FieldId','lodash'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xdfe9,0xc3));var _0x9dfe=function(_0x2d31be,_0x9c4f1e){_0x2d31be=_0x2d31be-0x0;var _0x540713=_0xdfe9[_0x2d31be];return _0x540713;};'use strict';var _=require(_0x9dfe('0x0'));var util=require('util');var logger=require(_0x9dfe('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9dfe('0x2'));var rp=require(_0x9dfe('0x3'));var fs=require('fs');var path=require(_0x9dfe('0x4'));var rimraf=require(_0x9dfe('0x5'));var config=require(_0x9dfe('0x6'));var attributes=require(_0x9dfe('0x7'));module[_0x9dfe('0x8')]=function(_0x3678b1,_0x2b0d0b){return _0x3678b1[_0x9dfe('0x9')](_0x9dfe('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x9dfe('0xb'),'fields':[_0x9dfe('0xc'),_0x9dfe('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9af1=['lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','define','ZendeskField','zendesk_unique_index','idField','FieldId'];(function(_0x267f1c,_0x449810){var _0x47599a=function(_0x45b7cc){while(--_0x45b7cc){_0x267f1c['push'](_0x267f1c['shift']());}};_0x47599a(++_0x449810);}(_0x9af1,0x68));var _0x19af=function(_0x4441b1,_0x17bf98){_0x4441b1=_0x4441b1-0x0;var _0x3d510f=_0x9af1[_0x4441b1];return _0x3d510f;};'use strict';var _=require(_0x19af('0x0'));var util=require(_0x19af('0x1'));var logger=require(_0x19af('0x2'))('api');var moment=require(_0x19af('0x3'));var BPromise=require(_0x19af('0x4'));var rp=require(_0x19af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x19af('0x6'));var attributes=require('./intZendeskField.attributes');module[_0x19af('0x7')]=function(_0x157fc9,_0x41a50f){return _0x157fc9[_0x19af('0x8')](_0x19af('0x9'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x19af('0xa'),'fields':[_0x19af('0xb'),_0x19af('0xc')],'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 2a18d75..7f2ff3d 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 _0x3ba7=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x3ba7,0x189));var _0x73ba=function(_0x1a6956,_0x3ee2fc){_0x1a6956=_0x1a6956-0x0;var _0x10d2bf=_0x3ba7[_0x1a6956];return _0x10d2bf;};'use strict';var _=require(_0x73ba('0x0'));var util=require(_0x73ba('0x1'));var moment=require(_0x73ba('0x2'));var BPromise=require(_0x73ba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x73ba('0x4'));var db=require(_0x73ba('0x5'))['db'];var utils=require(_0x73ba('0x6'));var logger=require(_0x73ba('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x73ba('0x8'));var client=jayson[_0x73ba('0x9')][_0x73ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36cf74,_0x413845,_0x3c49a0){return new BPromise(function(_0x33b226,_0x25aa66){return client[_0x73ba('0xb')](_0x36cf74,_0x3c49a0)[_0x73ba('0xc')](function(_0x1e7905){logger[_0x73ba('0xd')](_0x73ba('0xe'),_0x413845,'request\x20sent');logger[_0x73ba('0xf')](_0x73ba('0x10'),_0x413845,_0x73ba('0x11'),JSON[_0x73ba('0x12')](_0x1e7905));if(_0x1e7905[_0x73ba('0x13')]){if(_0x1e7905[_0x73ba('0x13')]['code']===0x1f4){logger[_0x73ba('0x13')](_0x73ba('0xe'),_0x413845,_0x1e7905['error'][_0x73ba('0x14')]);return _0x25aa66(_0x1e7905['error'][_0x73ba('0x14')]);}logger[_0x73ba('0x13')]('ZendeskField,\x20%s,\x20%s',_0x413845,_0x1e7905[_0x73ba('0x13')][_0x73ba('0x14')]);return _0x33b226(_0x1e7905['error'][_0x73ba('0x14')]);}else{logger[_0x73ba('0xd')](_0x73ba('0xe'),_0x413845,_0x73ba('0x11'));_0x33b226(_0x1e7905['result']['message']);}})[_0x73ba('0x15')](function(_0x51b0e8){logger['error'](_0x73ba('0xe'),_0x413845,_0x51b0e8);_0x25aa66(_0x51b0e8);});});} \ No newline at end of file +var _0xf854=['rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','../../mysqldb'];(function(_0x16b969,_0x4f8d09){var _0x73e023=function(_0x446840){while(--_0x446840){_0x16b969['push'](_0x16b969['shift']());}};_0x73e023(++_0x4f8d09);}(_0xf854,0x10b));var _0x4f85=function(_0xe6815e,_0xdb14ba){_0xe6815e=_0xe6815e-0x0;var _0x1e5cb7=_0xf854[_0xe6815e];return _0x1e5cb7;};'use strict';var _=require(_0x4f85('0x0'));var util=require(_0x4f85('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f85('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4f85('0x3'));var config=require(_0x4f85('0x4'));var jayson=require(_0x4f85('0x5'));var client=jayson[_0x4f85('0x6')][_0x4f85('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x24c4b4,_0x31ae4f,_0x5ead92){return new BPromise(function(_0x54807d,_0x264eaf){return client[_0x4f85('0x8')](_0x24c4b4,_0x5ead92)[_0x4f85('0x9')](function(_0x18db71){logger['info'](_0x4f85('0xa'),_0x31ae4f,'request\x20sent');logger[_0x4f85('0xb')](_0x4f85('0xc'),_0x31ae4f,'request\x20sent',JSON[_0x4f85('0xd')](_0x18db71));if(_0x18db71[_0x4f85('0xe')]){if(_0x18db71[_0x4f85('0xe')]['code']===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x31ae4f,_0x18db71['error']['message']);return _0x264eaf(_0x18db71['error'][_0x4f85('0xf')]);}logger[_0x4f85('0xe')]('ZendeskField,\x20%s,\x20%s',_0x31ae4f,_0x18db71[_0x4f85('0xe')][_0x4f85('0xf')]);return _0x54807d(_0x18db71[_0x4f85('0xe')][_0x4f85('0xf')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x31ae4f,'request\x20sent');_0x54807d(_0x18db71[_0x4f85('0x10')][_0x4f85('0xf')]);}})[_0x4f85('0x11')](function(_0x3ce26f){logger['error'](_0x4f85('0xa'),_0x31ae4f,_0x3ce26f);_0x264eaf(_0x3ce26f);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index df96045..499b053 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 _0xb9f6=['/:id/fields','getFields','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations'];(function(_0x241f64,_0x21a5b1){var _0x27dba0=function(_0x287cfd){while(--_0x287cfd){_0x241f64['push'](_0x241f64['shift']());}};_0x27dba0(++_0x21a5b1);}(_0xb9f6,0x1d6));var _0x6b9f=function(_0x2618d2,_0x31ba00){_0x2618d2=_0x2618d2-0x0;var _0x15df6a=_0xb9f6[_0x2618d2];return _0x15df6a;};'use strict';var multer=require(_0x6b9f('0x0'));var util=require('util');var path=require(_0x6b9f('0x1'));var timeout=require(_0x6b9f('0x2'));var express=require(_0x6b9f('0x3'));var router=express[_0x6b9f('0x4')]();var auth=require(_0x6b9f('0x5'));var interaction=require(_0x6b9f('0x6'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0x6b9f('0x7')]('/',auth[_0x6b9f('0x8')](),controller['index']);router['get'](_0x6b9f('0x9'),auth[_0x6b9f('0x8')](),controller[_0x6b9f('0xa')]);router[_0x6b9f('0x7')](_0x6b9f('0xb'),auth[_0x6b9f('0x8')](),controller[_0x6b9f('0xc')]);router[_0x6b9f('0x7')](_0x6b9f('0xd'),auth[_0x6b9f('0x8')](),controller[_0x6b9f('0xe')]);router[_0x6b9f('0xf')]('/',auth[_0x6b9f('0x8')](),controller[_0x6b9f('0x10')]);router[_0x6b9f('0xf')](_0x6b9f('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x6b9f('0x11')]('/:id',auth[_0x6b9f('0x8')](),controller[_0x6b9f('0x12')]);router[_0x6b9f('0x13')](_0x6b9f('0x9'),auth[_0x6b9f('0x8')](),controller['destroy']);module[_0x6b9f('0x14')]=router; \ No newline at end of file +var _0x410a=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','update','delete'];(function(_0x42a44a,_0x15ca12){var _0x1e6ab6=function(_0x5c5a3f){while(--_0x5c5a3f){_0x42a44a['push'](_0x42a44a['shift']());}};_0x1e6ab6(++_0x15ca12);}(_0x410a,0xd1));var _0xa410=function(_0x44749f,_0x39fcf0){_0x44749f=_0x44749f-0x0;var _0x1bb868=_0x410a[_0x44749f];return _0x1bb868;};'use strict';var multer=require(_0xa410('0x0'));var util=require('util');var path=require(_0xa410('0x1'));var timeout=require(_0xa410('0x2'));var express=require(_0xa410('0x3'));var router=express[_0xa410('0x4')]();var auth=require(_0xa410('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa410('0x6'));var controller=require(_0xa410('0x7'));router[_0xa410('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa410('0x9'),auth[_0xa410('0xa')](),controller[_0xa410('0xb')]);router[_0xa410('0x8')](_0xa410('0xc'),auth[_0xa410('0xa')](),controller[_0xa410('0xd')]);router['get'](_0xa410('0xe'),auth[_0xa410('0xa')](),controller[_0xa410('0xf')]);router['post']('/',auth[_0xa410('0xa')](),controller[_0xa410('0x10')]);router[_0xa410('0x11')](_0xa410('0xc'),auth[_0xa410('0xa')](),controller['addConfiguration']);router[_0xa410('0x12')]('/:id',auth[_0xa410('0xa')](),controller[_0xa410('0x13')]);router[_0xa410('0x14')](_0xa410('0x9'),auth[_0xa410('0xa')](),controller[_0xa410('0x15')]);module[_0xa410('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 5f8161b..2ad360f 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 _0x8639=['sequelize','STRING'];(function(_0x4164fd,_0x4f9317){var _0x4fe927=function(_0x44b62b){while(--_0x44b62b){_0x4164fd['push'](_0x4164fd['shift']());}};_0x4fe927(++_0x4f9317);}(_0x8639,0x186));var _0x9863=function(_0x572e92,_0x5b8c78){_0x572e92=_0x572e92-0x0;var _0x50bf10=_0x8639[_0x572e92];return _0x50bf10;};'use strict';var Sequelize=require(_0x9863('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x9863('0x1')]},'zone':{'type':Sequelize[_0x9863('0x1')]},'clientId':{'type':Sequelize[_0x9863('0x1')]},'clientSecret':{'type':Sequelize[_0x9863('0x1')]},'serverUrl':{'type':Sequelize[_0x9863('0x1')]},'code':{'type':Sequelize[_0x9863('0x1')]},'refreshToken':{'type':Sequelize[_0x9863('0x1')]}}; \ No newline at end of file +var _0x1e21=['sequelize','exports','STRING'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1e21,0x102));var _0x11e2=function(_0x49adf8,_0x4c0d19){_0x49adf8=_0x49adf8-0x0;var _0x807532=_0x1e21[_0x49adf8];return _0x807532;};'use strict';var Sequelize=require(_0x11e2('0x0'));module[_0x11e2('0x1')]={'name':{'type':Sequelize[_0x11e2('0x2')]},'description':{'type':Sequelize[_0x11e2('0x2')]},'host':{'type':Sequelize[_0x11e2('0x2')]},'zone':{'type':Sequelize[_0x11e2('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x11e2('0x2')]},'serverUrl':{'type':Sequelize[_0x11e2('0x2')]},'code':{'type':Sequelize[_0x11e2('0x2')]},'refreshToken':{'type':Sequelize[_0x11e2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 4caacfd..5241eed 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 _0x86bd=['system_mandatory','push','display_label','custom_field','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','getFields','statusCode','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','ZohoAccount','rawAttributes','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','options','count','include','findAll','show','length','find','create','body','params','getConfigurations','pick','merge','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','clientId','clientSecret','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Description','Call_Duration','Call_Result','Call_Type','includes'];(function(_0x507d43,_0x7904b2){var _0x169667=function(_0x4f6098){while(--_0x4f6098){_0x507d43['push'](_0x507d43['shift']());}};_0x169667(++_0x7904b2);}(_0x86bd,0x118));var _0xd86b=function(_0x29ff49,_0x2c89aa){_0x29ff49=_0x29ff49-0x0;var _0x2fc937=_0x86bd[_0x29ff49];return _0x2fc937;};'use strict';var pdf=require(_0xd86b('0x0'));var emlformat=require(_0xd86b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd86b('0x2'));var jsonpatch=require(_0xd86b('0x3'));var rp=require(_0xd86b('0x4'));var moment=require(_0xd86b('0x5'));var BPromise=require(_0xd86b('0x6'));var Mustache=require('mustache');var util=require(_0xd86b('0x7'));var path=require(_0xd86b('0x8'));var sox=require('sox');var csv=require(_0xd86b('0x9'));var ejs=require(_0xd86b('0xa'));var fs=require('fs');var _=require(_0xd86b('0xb'));var squel=require('squel');var crypto=require(_0xd86b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd86b('0xd'));var toCsv=require(_0xd86b('0x9'));var querystring=require('querystring');var Papa=require(_0xd86b('0xe'));var Redis=require(_0xd86b('0xf'));var authService=require(_0xd86b('0x10'));var qs=require(_0xd86b('0x11'));var as=require(_0xd86b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd86b('0x13'))(_0xd86b('0x14'));var utils=require(_0xd86b('0x15'));var config=require(_0xd86b('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd86b('0x17'));var jayson=require(_0xd86b('0x18'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x939b07,_0x49635e,_0x26c64a){if(_0x26c64a){var _0xc65045=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc65045[_0xd86b('0x19')](_0x49635e)){return _0x939b07;}else{throw new db[(_0xd86b('0x1a'))][(_0xd86b('0x1b'))](_0xd86b('0x1c'));}}else{return _0x939b07;}}function respondWithRpcPromise(_0x383e95,_0x82ac5a,_0x5dc542,_0x3b8b7c){return new BPromise(function(_0x41b7f5,_0x3e3f46){var _0x26db96=_0x3b8b7c||client;return _0x26db96[_0xd86b('0x1d')](_0x383e95,_0x5dc542)['then'](function(_0x4270f9){logger[_0xd86b('0x1e')](_0xd86b('0x1f'),_0x82ac5a,'request\x20sent');logger[_0xd86b('0x20')](_0xd86b('0x21'),_0x82ac5a,_0xd86b('0x22'),JSON['stringify'](_0x4270f9));if(_0x4270f9[_0xd86b('0x23')]){if(_0x4270f9[_0xd86b('0x23')][_0xd86b('0x24')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x82ac5a,_0x4270f9[_0xd86b('0x23')][_0xd86b('0x25')]);return _0x3e3f46(_0x4270f9[_0xd86b('0x23')][_0xd86b('0x25')]);}logger[_0xd86b('0x23')](_0xd86b('0x1f'),_0x82ac5a,_0x4270f9['error'][_0xd86b('0x25')]);return _0x41b7f5(_0x4270f9[_0xd86b('0x23')][_0xd86b('0x25')]);}else{logger[_0xd86b('0x1e')]('ZohoAccount,\x20%s,\x20%s',_0x82ac5a,_0xd86b('0x22'));_0x41b7f5(_0x4270f9[_0xd86b('0x26')][_0xd86b('0x25')]);}})[_0xd86b('0x27')](function(_0x25da72){logger[_0xd86b('0x23')]('ZohoAccount,\x20%s,\x20%s',_0x82ac5a,_0x25da72);_0x3e3f46(_0x25da72);});});}function respondWithStatusCode(_0x5935f3,_0xee84c){_0xee84c=_0xee84c||0xcc;return function(_0x2e71a7){if(_0x2e71a7){return _0x5935f3['sendStatus'](_0xee84c);}return _0x5935f3[_0xd86b('0x28')](_0xee84c)[_0xd86b('0x29')]();};}function respondWithResult(_0x3aba6c,_0x51065a){_0x51065a=_0x51065a||0xc8;return function(_0x411ea4){if(_0x411ea4){return _0x3aba6c[_0xd86b('0x28')](_0x51065a)[_0xd86b('0x2a')](_0x411ea4);}};}function respondWithFilteredResult(_0xa33966,_0x37e1f0){return function(_0x3710d3){if(_0x3710d3){var _0x32ab78=_0x3710d3['count'],_0x14874f=_0x37e1f0[_0xd86b('0x2b')],_0x1162aa=_0x37e1f0[_0xd86b('0x2b')]+_0x37e1f0[_0xd86b('0x2c')],_0x401897;if(_0x1162aa>=_0x32ab78){_0x1162aa=_0x32ab78;_0x401897=0xc8;}else{_0x401897=0xce;}_0xa33966[_0xd86b('0x28')](_0x401897);return _0xa33966[_0xd86b('0x2d')](_0xd86b('0x2e'),_0x14874f+'-'+_0x1162aa+'/'+_0x32ab78)['json'](_0x3710d3);}return null;};}function patchUpdates(_0x1df710){return function(_0x22e5d7){try{jsonpatch[_0xd86b('0x2f')](_0x22e5d7,_0x1df710,!![]);}catch(_0x702573){return BPromise[_0xd86b('0x30')](_0x702573);}return _0x22e5d7[_0xd86b('0x31')]();};}function saveUpdates(_0x5c52b5,_0x5303eb){return function(_0xe2f83e){if(_0xe2f83e){return _0xe2f83e[_0xd86b('0x32')](_0x5c52b5)[_0xd86b('0x33')](function(_0x4a4bdc){return _0x4a4bdc;});}return null;};}function removeEntity(_0x25cd9e,_0x188fec){return function(_0x63a994){if(_0x63a994){return _0x63a994[_0xd86b('0x34')]()[_0xd86b('0x33')](function(){_0x25cd9e[_0xd86b('0x28')](0xcc)[_0xd86b('0x29')]();});}};}function handleEntityNotFound(_0x128a5e,_0x3a98f9){return function(_0x54fe4a){if(!_0x54fe4a){_0x128a5e['sendStatus'](0x194);}return _0x54fe4a;};}function handleError(_0x521a0a,_0x4a79d4){_0x4a79d4=_0x4a79d4||0x1f4;return function(_0x2edae4){logger[_0xd86b('0x23')](_0x2edae4[_0xd86b('0x35')]);if(_0x2edae4[_0xd86b('0x36')]){delete _0x2edae4['name'];}_0x521a0a[_0xd86b('0x28')](_0x4a79d4)[_0xd86b('0x37')](_0x2edae4);};}exports[_0xd86b('0x38')]=function(_0x145ea7,_0xb08d2){var _0x9dffc3={},_0x4826c5={},_0x4f6cee={'count':0x0,'rows':[]};var _0x1b2d63=_['map'](db[_0xd86b('0x39')][_0xd86b('0x3a')],function(_0x121e0d){return{'name':_0x121e0d['fieldName'],'type':_0x121e0d['type'][_0xd86b('0x3b')]};});_0x4826c5[_0xd86b('0x3c')]=_[_0xd86b('0x3d')](_0x1b2d63,_0xd86b('0x36'));_0x4826c5[_0xd86b('0x3e')]=_[_0xd86b('0x3f')](_0x145ea7['query']);_0x4826c5['filters']=_['intersection'](_0x4826c5[_0xd86b('0x3c')],_0x4826c5['query']);_0x9dffc3[_0xd86b('0x40')]=_[_0xd86b('0x41')](_0x4826c5['model'],qs[_0xd86b('0x42')](_0x145ea7[_0xd86b('0x3e')]['fields']));_0x9dffc3['attributes']=_0x9dffc3[_0xd86b('0x40')]['length']?_0x9dffc3[_0xd86b('0x40')]:_0x4826c5[_0xd86b('0x3c')];if(!_0x145ea7['query'][_0xd86b('0x43')](_0xd86b('0x44'))){_0x9dffc3[_0xd86b('0x2c')]=qs[_0xd86b('0x2c')](_0x145ea7[_0xd86b('0x3e')]['limit']);_0x9dffc3['offset']=qs[_0xd86b('0x2b')](_0x145ea7[_0xd86b('0x3e')][_0xd86b('0x2b')]);}_0x9dffc3[_0xd86b('0x45')]=qs[_0xd86b('0x46')](_0x145ea7[_0xd86b('0x3e')][_0xd86b('0x46')]);_0x9dffc3[_0xd86b('0x47')]=qs[_0xd86b('0x48')](_['pick'](_0x145ea7[_0xd86b('0x3e')],_0x4826c5[_0xd86b('0x48')]));if(_0x145ea7['query'][_0xd86b('0x49')]){_0x9dffc3[_0xd86b('0x47')]=_['merge'](_0x9dffc3[_0xd86b('0x47')],{'$or':_[_0xd86b('0x3d')](_0x1b2d63,function(_0x5d1160){if(_0x5d1160[_0xd86b('0x4a')]!=='VIRTUAL'){var _0x4cc13b={};_0x4cc13b[_0x5d1160[_0xd86b('0x36')]]={'$like':'%'+_0x145ea7[_0xd86b('0x3e')][_0xd86b('0x49')]+'%'};return _0x4cc13b;}})});}_0x9dffc3=_['merge']({},_0x9dffc3,_0x145ea7[_0xd86b('0x4b')]);var _0x311ec0={'where':_0x9dffc3[_0xd86b('0x47')]};return db[_0xd86b('0x39')][_0xd86b('0x4c')](_0x311ec0)[_0xd86b('0x33')](function(_0x203794){_0x4f6cee[_0xd86b('0x4c')]=_0x203794;if(_0x145ea7[_0xd86b('0x3e')]['includeAll']){_0x9dffc3[_0xd86b('0x4d')]=[{'all':!![]}];}return db[_0xd86b('0x39')][_0xd86b('0x4e')](_0x9dffc3);})[_0xd86b('0x33')](function(_0x1fa64c){_0x4f6cee['rows']=_0x1fa64c;return _0x4f6cee;})[_0xd86b('0x33')](respondWithFilteredResult(_0xb08d2,_0x9dffc3))[_0xd86b('0x27')](handleError(_0xb08d2,null));};exports[_0xd86b('0x4f')]=function(_0x329b52,_0x151b13){var _0x590764={'raw':![],'where':{'id':_0x329b52['params']['id']}},_0x4094da={};_0x4094da[_0xd86b('0x3c')]=_[_0xd86b('0x3f')](db['ZohoAccount'][_0xd86b('0x3a')]);_0x4094da[_0xd86b('0x3e')]=_[_0xd86b('0x3f')](_0x329b52[_0xd86b('0x3e')]);_0x4094da[_0xd86b('0x48')]=_[_0xd86b('0x41')](_0x4094da[_0xd86b('0x3c')],_0x4094da[_0xd86b('0x3e')]);_0x590764['attributes']=_['intersection'](_0x4094da['model'],qs[_0xd86b('0x42')](_0x329b52[_0xd86b('0x3e')][_0xd86b('0x42')]));_0x590764[_0xd86b('0x40')]=_0x590764[_0xd86b('0x40')][_0xd86b('0x50')]?_0x590764['attributes']:_0x4094da[_0xd86b('0x3c')];if(_0x329b52[_0xd86b('0x3e')]['includeAll']){_0x590764[_0xd86b('0x4d')]=[{'all':!![]}];}_0x590764=_['merge']({},_0x590764,_0x329b52[_0xd86b('0x4b')]);return db[_0xd86b('0x39')][_0xd86b('0x51')](_0x590764)['then'](handleEntityNotFound(_0x151b13,null))['then'](respondWithResult(_0x151b13,null))[_0xd86b('0x27')](handleError(_0x151b13,null));};exports[_0xd86b('0x52')]=function(_0x197479,_0x536000){return db[_0xd86b('0x39')][_0xd86b('0x52')](_0x197479[_0xd86b('0x53')],{})['then'](respondWithResult(_0x536000,0xc9))[_0xd86b('0x27')](handleError(_0x536000,null));};exports[_0xd86b('0x32')]=function(_0x28d776,_0x4590d1){if(_0x28d776[_0xd86b('0x53')]['id']){delete _0x28d776[_0xd86b('0x53')]['id'];}return db[_0xd86b('0x39')]['find']({'where':{'id':_0x28d776[_0xd86b('0x54')]['id']}})[_0xd86b('0x33')](handleEntityNotFound(_0x4590d1,null))[_0xd86b('0x33')](saveUpdates(_0x28d776[_0xd86b('0x53')],null))[_0xd86b('0x33')](respondWithResult(_0x4590d1,null))[_0xd86b('0x27')](handleError(_0x4590d1,null));};exports[_0xd86b('0x34')]=function(_0x307386,_0x48a455){return db[_0xd86b('0x39')]['find']({'where':{'id':_0x307386['params']['id']}})[_0xd86b('0x33')](handleEntityNotFound(_0x48a455,null))['then'](removeEntity(_0x48a455,null))[_0xd86b('0x27')](handleError(_0x48a455,null));};exports[_0xd86b('0x55')]=function(_0x4c5a57,_0x163bf9,_0x3b1e3b){var _0x2d7adb={};var _0x4dbf3f={};var _0x57d0ab;var _0x48833e;return db[_0xd86b('0x39')]['findOne']({'where':{'id':_0x4c5a57[_0xd86b('0x54')]['id']}})[_0xd86b('0x33')](handleEntityNotFound(_0x163bf9,null))[_0xd86b('0x33')](function(_0x462019){if(_0x462019){_0x57d0ab=_0x462019;_0x4dbf3f['model']=_[_0xd86b('0x3f')](db['ZohoConfiguration'][_0xd86b('0x3a')]);_0x4dbf3f[_0xd86b('0x3e')]=_['keys'](_0x4c5a57['query']);_0x4dbf3f[_0xd86b('0x48')]=_[_0xd86b('0x41')](_0x4dbf3f[_0xd86b('0x3c')],_0x4dbf3f[_0xd86b('0x3e')]);_0x2d7adb['attributes']=_[_0xd86b('0x41')](_0x4dbf3f['model'],qs[_0xd86b('0x42')](_0x4c5a57[_0xd86b('0x3e')]['fields']));_0x2d7adb['attributes']=_0x2d7adb[_0xd86b('0x40')][_0xd86b('0x50')]?_0x2d7adb[_0xd86b('0x40')]:_0x4dbf3f[_0xd86b('0x3c')];_0x2d7adb[_0xd86b('0x45')]=qs[_0xd86b('0x46')](_0x4c5a57[_0xd86b('0x3e')][_0xd86b('0x46')]);_0x2d7adb[_0xd86b('0x47')]=qs[_0xd86b('0x48')](_[_0xd86b('0x56')](_0x4c5a57['query'],_0x4dbf3f['filters']));if(_0x4c5a57[_0xd86b('0x3e')]['filter']){_0x2d7adb[_0xd86b('0x47')]=_[_0xd86b('0x57')](_0x2d7adb['where'],{'$or':_[_0xd86b('0x3d')](_0x2d7adb[_0xd86b('0x40')],function(_0x348f6c){var _0x14c955={};_0x14c955[_0x348f6c]={'$like':'%'+_0x4c5a57['query']['filter']+'%'};return _0x14c955;})});}_0x2d7adb=_[_0xd86b('0x57')]({},_0x2d7adb,_0x4c5a57[_0xd86b('0x4b')]);return _0x57d0ab[_0xd86b('0x55')](_0x2d7adb);}})['then'](function(_0x48d943){if(_0x48d943){_0x48833e=_0x48d943[_0xd86b('0x50')];if(!_0x4c5a57['query'][_0xd86b('0x43')](_0xd86b('0x44'))){_0x2d7adb['limit']=qs['limit'](_0x4c5a57[_0xd86b('0x3e')][_0xd86b('0x2c')]);_0x2d7adb[_0xd86b('0x2b')]=qs[_0xd86b('0x2b')](_0x4c5a57[_0xd86b('0x3e')][_0xd86b('0x2b')]);}return _0x57d0ab[_0xd86b('0x55')](_0x2d7adb);}})[_0xd86b('0x33')](function(_0x123d66){if(_0x123d66){return _0x123d66?{'count':_0x48833e,'rows':_0x123d66}:null;}})[_0xd86b('0x33')](respondWithResult(_0x163bf9,null))['catch'](handleError(_0x163bf9,null));};exports[_0xd86b('0x58')]=function(_0x426fed,_0x35e6c6,_0x327f0e){if(_0x426fed[_0xd86b('0x53')]['id']){delete _0x426fed[_0xd86b('0x53')]['id'];}return db[_0xd86b('0x39')][_0xd86b('0x59')]({'where':{'id':_0x426fed[_0xd86b('0x54')]['id']}})['then'](handleEntityNotFound(_0x35e6c6,null))['then'](function(_0x3fa644){if(_0x3fa644){_0x426fed[_0xd86b('0x53')][_0xd86b('0x5a')]=_0x3fa644['id'];_0x426fed[_0xd86b('0x53')][_0xd86b('0x5b')]=integrations['getSubjects'](_0x426fed[_0xd86b('0x53')][_0xd86b('0x5c')],_0x426fed[_0xd86b('0x53')][_0xd86b('0x4a')]);_0x426fed['body'][_0xd86b('0x5d')]=integrations['getDescriptions'](_0x426fed[_0xd86b('0x53')]['channel'],_0x426fed['body'][_0xd86b('0x4a')]);return db[_0xd86b('0x5e')][_0xd86b('0x52')](_0x426fed[_0xd86b('0x53')],{'include':[{'model':db[_0xd86b('0x5f')],'as':'Subjects'},{'model':db[_0xd86b('0x5f')],'as':_0xd86b('0x5d')}]});}return null;})['then'](respondWithResult(_0x35e6c6,null))[_0xd86b('0x27')](handleError(_0x35e6c6,null));};function getAccessToken(_0x12d13e){return new Promise(function(_0x5a0996,_0x412b71){var _0xfd5a81;switch(_0x12d13e[_0xd86b('0x60')]){case'US':_0xfd5a81=_0xd86b('0x61');break;case'AU':_0xfd5a81='https://accounts.zoho.com.au';break;case'EU':_0xfd5a81=_0xd86b('0x62');break;case'IN':_0xfd5a81=_0xd86b('0x63');break;case'CN':_0xfd5a81=_0xd86b('0x64');break;default:_0xfd5a81='https://accounts.zoho.eu';break;}var _0xc61678={'method':_0xd86b('0x65'),'uri':_0xfd5a81+_0xd86b('0x66'),'qs':{'refresh_token':_0x12d13e[_0xd86b('0x67')],'client_id':_0x12d13e['clientId'],'client_secret':_0x12d13e['clientSecret'],'grant_type':_0xd86b('0x68')},'json':!![]};return rp(_0xc61678)[_0xd86b('0x33')](function(_0xf5f28c){if(_0xf5f28c[_0xd86b('0x69')]){_0x5a0996(_0xf5f28c[_0xd86b('0x69')]);}else{_0x412b71(_0xd86b('0x6a'));}})['catch'](function(_0x3f295a){_0x412b71(_0x3f295a);});});}exports['getFields']=function(_0x3fe128,_0x3d6764,_0x130eb9){var _0xf77b70,_0x3933ce,_0x265740,_0x33d09a,_0x3fdd8b;return db[_0xd86b('0x39')]['findOne']({'where':{'id':_0x3fe128[_0xd86b('0x54')]['id']},'attributes':['id',_0xd86b('0x6b'),_0xd86b('0x60'),_0xd86b('0x6c'),_0xd86b('0x6d'),_0xd86b('0x6e'),_0xd86b('0x24'),_0xd86b('0x67')]})[_0xd86b('0x33')](handleEntityNotFound(_0x3d6764,null))[_0xd86b('0x33')](function(_0x19e673){_0x3fdd8b=_0x19e673;_0xf77b70=_0x3fdd8b[_0xd86b('0x6b')];_0x3933ce=_0xf77b70===_0xd86b('0x6f')?'eu':_0xd86b('0x70');_0x265740=_0x3fdd8b[_0xd86b('0x6e')];var _0x3535d1=_0x265740[_0xd86b('0x71')](-0x1);if(_0x3535d1==='/'||_0x3535d1==='\x5c'||_0x3535d1===':'){_0x265740=_0x265740[_0xd86b('0x72')](0x0,_0x265740[_0xd86b('0x73')](_0x3535d1));}if(!_0x3fdd8b['refreshToken']){throw new Error(_0xd86b('0x74'));}return getAccessToken(_0x3fdd8b);})[_0xd86b('0x33')](function(_0x1bf43d){if(_0x1bf43d){return rp({'method':_0xd86b('0x75'),'uri':util['format'](_0xd86b('0x76'),_0x3933ce),'qs':{'module':_0xd86b('0x77')},'headers':{'Authorization':_0xd86b('0x78')+_0x1bf43d},'json':!![]});}})[_0xd86b('0x33')](function(_0x58f6f6){if(_0x58f6f6){if(_0x58f6f6[_0xd86b('0x79')]&&_0x58f6f6['response'][_0xd86b('0x23')]){throw new Error(_0x58f6f6[_0xd86b('0x79')]['error'][_0xd86b('0x25')]);}var _0x5ce0f9=[];var _0x3be710=[];var _0x334595=[_0xd86b('0x7a'),'Subject',_0xd86b('0x7b'),'WhoId',_0xd86b('0x7c'),_0xd86b('0x7d'),'Call_Start_Time',_0xd86b('0x7e')];_0x3be710=_['remove'](_0x58f6f6['fields'],function(_0x218c1a){return _0x334595[_0xd86b('0x7f')](_0x218c1a['api_name']);});for(var _0x467122=0x0;_0x467122<_0x3be710['length'];_0x467122++){if(_0x3be710[_0x467122][_0xd86b('0x80')]===![]){_0x5ce0f9[_0xd86b('0x81')]({'id':_0x3be710[_0x467122]['id'],'name':_0x3be710[_0x467122][_0xd86b('0x82')],'custom':_0x3be710[_0x467122][_0xd86b('0x83')],'options':_0x3be710[_0x467122]['data_type']==='picklist'&&_0x3be710[_0x467122][_0xd86b('0x84')][_0xd86b('0x50')]>-0x1?_[_0xd86b('0x3d')](_0x3be710[_0x467122][_0xd86b('0x84')],function(_0x242889){return{'name':_0x242889,'value':_0x242889};}):[]});}}return{'count':_0x5ce0f9[_0xd86b('0x50')],'rows':_0x5ce0f9};}else{return{'count':0x0,'rows':[]};}})[_0xd86b('0x33')](respondWithResult(_0x3d6764,null))[_0xd86b('0x27')](function(_0x5a1ca4){var _0x366fc7=_0x3fe128['query'][_0xd86b('0x19')]?0x1f4:_0x5a1ca4['statusCode']||0x1f4;logger[_0xd86b('0x23')](_0xd86b('0x85'),_0xd86b('0x86'),_0x366fc7,JSON['stringify'](_0x5a1ca4));delete _0x5a1ca4[_0xd86b('0x36')];if(_0x366fc7===0x191){_0x366fc7=0x190;}_0x3d6764[_0xd86b('0x28')](_0x366fc7)[_0xd86b('0x37')](_0x3fe128[_0xd86b('0x3e')][_0xd86b('0x19')]?{'message':'Wrong\x20credentials','statusCode':_0x5a1ca4[_0xd86b('0x87')]}:_0x5a1ca4);});}; \ No newline at end of file +var _0xb7a6=['error','message','result','catch','sendStatus','end','status','json','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','ZohoAccount','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','create','body','getConfigurations','ZohoConfiguration','filter','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','refreshToken','access_token','getFields','host','clientId','serverUrl','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Owner','Subject','WhoId','Call_Duration','Call_Result','Call_Type','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1392b8,_0x3194ca){var _0x185833=function(_0x4954df){while(--_0x4954df){_0x1392b8['push'](_0x1392b8['shift']());}};_0x185833(++_0x3194ca);}(_0xb7a6,0x189));var _0x6b7a=function(_0x64101b,_0x5bbfe3){_0x64101b=_0x64101b-0x0;var _0x5b93ed=_0xb7a6[_0x64101b];return _0x5b93ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6b7a('0x0'));var rimraf=require(_0x6b7a('0x1'));var zipdir=require(_0x6b7a('0x2'));var jsonpatch=require(_0x6b7a('0x3'));var rp=require(_0x6b7a('0x4'));var moment=require(_0x6b7a('0x5'));var BPromise=require(_0x6b7a('0x6'));var Mustache=require(_0x6b7a('0x7'));var util=require(_0x6b7a('0x8'));var path=require('path');var sox=require(_0x6b7a('0x9'));var csv=require(_0x6b7a('0xa'));var ejs=require(_0x6b7a('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6b7a('0xc'));var crypto=require('crypto');var jsforce=require(_0x6b7a('0xd'));var deskjs=require(_0x6b7a('0xe'));var toCsv=require(_0x6b7a('0xa'));var querystring=require(_0x6b7a('0xf'));var Papa=require('papaparse');var Redis=require(_0x6b7a('0x10'));var authService=require(_0x6b7a('0x11'));var qs=require(_0x6b7a('0x12'));var as=require(_0x6b7a('0x13'));var hardwareService=require(_0x6b7a('0x14'));var logger=require(_0x6b7a('0x15'))(_0x6b7a('0x16'));var utils=require(_0x6b7a('0x17'));var config=require('../../config/environment');var db=require(_0x6b7a('0x18'))['db'];var integrations=require(_0x6b7a('0x19'));var jayson=require(_0x6b7a('0x1a'));var client=jayson[_0x6b7a('0x1b')][_0x6b7a('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2ae9ec,_0x21521b,_0x5a6188){if(_0x5a6188){var _0x2b0015=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b0015['test'](_0x21521b)){return _0x2ae9ec;}else{throw new db['Sequelize'][(_0x6b7a('0x1d'))](_0x6b7a('0x1e'));}}else{return _0x2ae9ec;}}function respondWithRpcPromise(_0xf16ba0,_0x766e39,_0x52065a,_0x2cb977){return new BPromise(function(_0x3a0ec5,_0x3b1be3){var _0x41a1f6=_0x2cb977||client;return _0x41a1f6[_0x6b7a('0x1f')](_0xf16ba0,_0x52065a)[_0x6b7a('0x20')](function(_0x54df6b){logger[_0x6b7a('0x21')](_0x6b7a('0x22'),_0x766e39,_0x6b7a('0x23'));logger[_0x6b7a('0x24')](_0x6b7a('0x25'),_0x766e39,'request\x20sent',JSON[_0x6b7a('0x26')](_0x54df6b));if(_0x54df6b[_0x6b7a('0x27')]){if(_0x54df6b[_0x6b7a('0x27')]['code']===0x1f4){logger[_0x6b7a('0x27')]('ZohoAccount,\x20%s,\x20%s',_0x766e39,_0x54df6b['error'][_0x6b7a('0x28')]);return _0x3b1be3(_0x54df6b[_0x6b7a('0x27')][_0x6b7a('0x28')]);}logger[_0x6b7a('0x27')](_0x6b7a('0x22'),_0x766e39,_0x54df6b[_0x6b7a('0x27')][_0x6b7a('0x28')]);return _0x3a0ec5(_0x54df6b['error'][_0x6b7a('0x28')]);}else{logger[_0x6b7a('0x21')](_0x6b7a('0x22'),_0x766e39,_0x6b7a('0x23'));_0x3a0ec5(_0x54df6b[_0x6b7a('0x29')]['message']);}})[_0x6b7a('0x2a')](function(_0x27b8d8){logger[_0x6b7a('0x27')](_0x6b7a('0x22'),_0x766e39,_0x27b8d8);_0x3b1be3(_0x27b8d8);});});}function respondWithStatusCode(_0x2a7812,_0x5584f0){_0x5584f0=_0x5584f0||0xcc;return function(_0x3d0329){if(_0x3d0329){return _0x2a7812[_0x6b7a('0x2b')](_0x5584f0);}return _0x2a7812['status'](_0x5584f0)[_0x6b7a('0x2c')]();};}function respondWithResult(_0x442b90,_0x1a0cfd){_0x1a0cfd=_0x1a0cfd||0xc8;return function(_0x308711){if(_0x308711){return _0x442b90[_0x6b7a('0x2d')](_0x1a0cfd)[_0x6b7a('0x2e')](_0x308711);}};}function respondWithFilteredResult(_0x2fe7b0,_0x10b147){return function(_0x1d19eb){if(_0x1d19eb){var _0x3f3d85=_0x1d19eb[_0x6b7a('0x2f')],_0x4ce0bc=_0x10b147['offset'],_0x3d41a5=_0x10b147['offset']+_0x10b147['limit'],_0x89d08e;if(_0x3d41a5>=_0x3f3d85){_0x3d41a5=_0x3f3d85;_0x89d08e=0xc8;}else{_0x89d08e=0xce;}_0x2fe7b0[_0x6b7a('0x2d')](_0x89d08e);return _0x2fe7b0[_0x6b7a('0x30')](_0x6b7a('0x31'),_0x4ce0bc+'-'+_0x3d41a5+'/'+_0x3f3d85)[_0x6b7a('0x2e')](_0x1d19eb);}return null;};}function patchUpdates(_0x844bf7){return function(_0x4fc206){try{jsonpatch[_0x6b7a('0x32')](_0x4fc206,_0x844bf7,!![]);}catch(_0x2785e3){return BPromise[_0x6b7a('0x33')](_0x2785e3);}return _0x4fc206[_0x6b7a('0x34')]();};}function saveUpdates(_0x30ec8c,_0x249787){return function(_0x573a6f){if(_0x573a6f){return _0x573a6f[_0x6b7a('0x35')](_0x30ec8c)[_0x6b7a('0x20')](function(_0x2583af){return _0x2583af;});}return null;};}function removeEntity(_0x1f721e,_0x4af285){return function(_0x3f6ae0){if(_0x3f6ae0){return _0x3f6ae0[_0x6b7a('0x36')]()[_0x6b7a('0x20')](function(){_0x1f721e[_0x6b7a('0x2d')](0xcc)[_0x6b7a('0x2c')]();});}};}function handleEntityNotFound(_0x238a4e,_0x579395){return function(_0x5827b8){if(!_0x5827b8){_0x238a4e['sendStatus'](0x194);}return _0x5827b8;};}function handleError(_0x234749,_0x3fd9af){_0x3fd9af=_0x3fd9af||0x1f4;return function(_0x23493c){logger[_0x6b7a('0x27')](_0x23493c[_0x6b7a('0x37')]);if(_0x23493c['name']){delete _0x23493c[_0x6b7a('0x38')];}_0x234749[_0x6b7a('0x2d')](_0x3fd9af)['send'](_0x23493c);};}exports[_0x6b7a('0x39')]=function(_0x5500a1,_0xcd00cc){var _0x41153f={},_0x5c0e8c={},_0x562c98={'count':0x0,'rows':[]};var _0x207c4f=_[_0x6b7a('0x3a')](db[_0x6b7a('0x3b')]['rawAttributes'],function(_0x270a38){return{'name':_0x270a38['fieldName'],'type':_0x270a38[_0x6b7a('0x3c')][_0x6b7a('0x3d')]};});_0x5c0e8c[_0x6b7a('0x3e')]=_[_0x6b7a('0x3a')](_0x207c4f,_0x6b7a('0x38'));_0x5c0e8c[_0x6b7a('0x3f')]=_['keys'](_0x5500a1[_0x6b7a('0x3f')]);_0x5c0e8c[_0x6b7a('0x40')]=_[_0x6b7a('0x41')](_0x5c0e8c['model'],_0x5c0e8c['query']);_0x41153f['attributes']=_[_0x6b7a('0x41')](_0x5c0e8c['model'],qs[_0x6b7a('0x42')](_0x5500a1['query'][_0x6b7a('0x42')]));_0x41153f[_0x6b7a('0x43')]=_0x41153f['attributes'][_0x6b7a('0x44')]?_0x41153f[_0x6b7a('0x43')]:_0x5c0e8c[_0x6b7a('0x3e')];if(!_0x5500a1[_0x6b7a('0x3f')][_0x6b7a('0x45')](_0x6b7a('0x46'))){_0x41153f[_0x6b7a('0x47')]=qs[_0x6b7a('0x47')](_0x5500a1['query']['limit']);_0x41153f[_0x6b7a('0x48')]=qs[_0x6b7a('0x48')](_0x5500a1[_0x6b7a('0x3f')][_0x6b7a('0x48')]);}_0x41153f[_0x6b7a('0x49')]=qs[_0x6b7a('0x4a')](_0x5500a1[_0x6b7a('0x3f')]['sort']);_0x41153f['where']=qs[_0x6b7a('0x40')](_[_0x6b7a('0x4b')](_0x5500a1[_0x6b7a('0x3f')],_0x5c0e8c[_0x6b7a('0x40')]));if(_0x5500a1[_0x6b7a('0x3f')]['filter']){_0x41153f[_0x6b7a('0x4c')]=_[_0x6b7a('0x4d')](_0x41153f[_0x6b7a('0x4c')],{'$or':_['map'](_0x207c4f,function(_0x4ebefc){if(_0x4ebefc[_0x6b7a('0x3c')]!==_0x6b7a('0x4e')){var _0x5b6da6={};_0x5b6da6[_0x4ebefc['name']]={'$like':'%'+_0x5500a1['query']['filter']+'%'};return _0x5b6da6;}})});}_0x41153f=_[_0x6b7a('0x4d')]({},_0x41153f,_0x5500a1[_0x6b7a('0x4f')]);var _0x567c51={'where':_0x41153f['where']};return db[_0x6b7a('0x3b')]['count'](_0x567c51)[_0x6b7a('0x20')](function(_0x3ee7fd){_0x562c98[_0x6b7a('0x2f')]=_0x3ee7fd;if(_0x5500a1[_0x6b7a('0x3f')][_0x6b7a('0x50')]){_0x41153f[_0x6b7a('0x51')]=[{'all':!![]}];}return db[_0x6b7a('0x3b')][_0x6b7a('0x52')](_0x41153f);})[_0x6b7a('0x20')](function(_0x1948fe){_0x562c98[_0x6b7a('0x53')]=_0x1948fe;return _0x562c98;})['then'](respondWithFilteredResult(_0xcd00cc,_0x41153f))[_0x6b7a('0x2a')](handleError(_0xcd00cc,null));};exports[_0x6b7a('0x54')]=function(_0x32e9cc,_0x190761){var _0x1a7299={'raw':![],'where':{'id':_0x32e9cc[_0x6b7a('0x55')]['id']}},_0x12c839={};_0x12c839['model']=_[_0x6b7a('0x56')](db[_0x6b7a('0x3b')][_0x6b7a('0x57')]);_0x12c839[_0x6b7a('0x3f')]=_[_0x6b7a('0x56')](_0x32e9cc[_0x6b7a('0x3f')]);_0x12c839['filters']=_[_0x6b7a('0x41')](_0x12c839['model'],_0x12c839['query']);_0x1a7299['attributes']=_['intersection'](_0x12c839[_0x6b7a('0x3e')],qs[_0x6b7a('0x42')](_0x32e9cc[_0x6b7a('0x3f')][_0x6b7a('0x42')]));_0x1a7299[_0x6b7a('0x43')]=_0x1a7299[_0x6b7a('0x43')][_0x6b7a('0x44')]?_0x1a7299[_0x6b7a('0x43')]:_0x12c839[_0x6b7a('0x3e')];if(_0x32e9cc[_0x6b7a('0x3f')][_0x6b7a('0x50')]){_0x1a7299[_0x6b7a('0x51')]=[{'all':!![]}];}_0x1a7299=_[_0x6b7a('0x4d')]({},_0x1a7299,_0x32e9cc[_0x6b7a('0x4f')]);return db[_0x6b7a('0x3b')][_0x6b7a('0x58')](_0x1a7299)['then'](handleEntityNotFound(_0x190761,null))[_0x6b7a('0x20')](respondWithResult(_0x190761,null))[_0x6b7a('0x2a')](handleError(_0x190761,null));};exports[_0x6b7a('0x59')]=function(_0x410a42,_0x3610b3){return db[_0x6b7a('0x3b')]['create'](_0x410a42[_0x6b7a('0x5a')],{})['then'](respondWithResult(_0x3610b3,0xc9))[_0x6b7a('0x2a')](handleError(_0x3610b3,null));};exports[_0x6b7a('0x35')]=function(_0x3720d5,_0x3ccdd5){if(_0x3720d5[_0x6b7a('0x5a')]['id']){delete _0x3720d5[_0x6b7a('0x5a')]['id'];}return db[_0x6b7a('0x3b')][_0x6b7a('0x58')]({'where':{'id':_0x3720d5['params']['id']}})['then'](handleEntityNotFound(_0x3ccdd5,null))[_0x6b7a('0x20')](saveUpdates(_0x3720d5[_0x6b7a('0x5a')],null))['then'](respondWithResult(_0x3ccdd5,null))[_0x6b7a('0x2a')](handleError(_0x3ccdd5,null));};exports[_0x6b7a('0x36')]=function(_0x56f770,_0x3fbf97){return db[_0x6b7a('0x3b')][_0x6b7a('0x58')]({'where':{'id':_0x56f770['params']['id']}})[_0x6b7a('0x20')](handleEntityNotFound(_0x3fbf97,null))[_0x6b7a('0x20')](removeEntity(_0x3fbf97,null))['catch'](handleError(_0x3fbf97,null));};exports[_0x6b7a('0x5b')]=function(_0x2e5ace,_0x182ea3,_0x3e485a){var _0x1b09f5={};var _0x1e5003={};var _0x32fb74;var _0x2bb737;return db[_0x6b7a('0x3b')]['findOne']({'where':{'id':_0x2e5ace['params']['id']}})[_0x6b7a('0x20')](handleEntityNotFound(_0x182ea3,null))[_0x6b7a('0x20')](function(_0x546399){if(_0x546399){_0x32fb74=_0x546399;_0x1e5003[_0x6b7a('0x3e')]=_[_0x6b7a('0x56')](db[_0x6b7a('0x5c')][_0x6b7a('0x57')]);_0x1e5003[_0x6b7a('0x3f')]=_[_0x6b7a('0x56')](_0x2e5ace[_0x6b7a('0x3f')]);_0x1e5003[_0x6b7a('0x40')]=_[_0x6b7a('0x41')](_0x1e5003[_0x6b7a('0x3e')],_0x1e5003[_0x6b7a('0x3f')]);_0x1b09f5['attributes']=_[_0x6b7a('0x41')](_0x1e5003[_0x6b7a('0x3e')],qs[_0x6b7a('0x42')](_0x2e5ace[_0x6b7a('0x3f')]['fields']));_0x1b09f5['attributes']=_0x1b09f5['attributes'][_0x6b7a('0x44')]?_0x1b09f5[_0x6b7a('0x43')]:_0x1e5003[_0x6b7a('0x3e')];_0x1b09f5['order']=qs[_0x6b7a('0x4a')](_0x2e5ace['query'][_0x6b7a('0x4a')]);_0x1b09f5['where']=qs[_0x6b7a('0x40')](_[_0x6b7a('0x4b')](_0x2e5ace[_0x6b7a('0x3f')],_0x1e5003[_0x6b7a('0x40')]));if(_0x2e5ace[_0x6b7a('0x3f')]['filter']){_0x1b09f5[_0x6b7a('0x4c')]=_[_0x6b7a('0x4d')](_0x1b09f5['where'],{'$or':_[_0x6b7a('0x3a')](_0x1b09f5[_0x6b7a('0x43')],function(_0x123b86){var _0x1e1fc1={};_0x1e1fc1[_0x123b86]={'$like':'%'+_0x2e5ace[_0x6b7a('0x3f')][_0x6b7a('0x5d')]+'%'};return _0x1e1fc1;})});}_0x1b09f5=_[_0x6b7a('0x4d')]({},_0x1b09f5,_0x2e5ace[_0x6b7a('0x4f')]);return _0x32fb74[_0x6b7a('0x5b')](_0x1b09f5);}})[_0x6b7a('0x20')](function(_0x54e363){if(_0x54e363){_0x2bb737=_0x54e363[_0x6b7a('0x44')];if(!_0x2e5ace[_0x6b7a('0x3f')][_0x6b7a('0x45')](_0x6b7a('0x46'))){_0x1b09f5[_0x6b7a('0x47')]=qs[_0x6b7a('0x47')](_0x2e5ace[_0x6b7a('0x3f')][_0x6b7a('0x47')]);_0x1b09f5[_0x6b7a('0x48')]=qs[_0x6b7a('0x48')](_0x2e5ace[_0x6b7a('0x3f')]['offset']);}return _0x32fb74[_0x6b7a('0x5b')](_0x1b09f5);}})[_0x6b7a('0x20')](function(_0x5c49b5){if(_0x5c49b5){return _0x5c49b5?{'count':_0x2bb737,'rows':_0x5c49b5}:null;}})[_0x6b7a('0x20')](respondWithResult(_0x182ea3,null))[_0x6b7a('0x2a')](handleError(_0x182ea3,null));};exports[_0x6b7a('0x5e')]=function(_0x1258d5,_0x51b9fd,_0x5836a9){if(_0x1258d5[_0x6b7a('0x5a')]['id']){delete _0x1258d5[_0x6b7a('0x5a')]['id'];}return db[_0x6b7a('0x3b')][_0x6b7a('0x5f')]({'where':{'id':_0x1258d5[_0x6b7a('0x55')]['id']}})[_0x6b7a('0x20')](handleEntityNotFound(_0x51b9fd,null))[_0x6b7a('0x20')](function(_0x5efaf6){if(_0x5efaf6){_0x1258d5[_0x6b7a('0x5a')][_0x6b7a('0x60')]=_0x5efaf6['id'];_0x1258d5[_0x6b7a('0x5a')][_0x6b7a('0x61')]=integrations[_0x6b7a('0x62')](_0x1258d5[_0x6b7a('0x5a')][_0x6b7a('0x63')],_0x1258d5[_0x6b7a('0x5a')][_0x6b7a('0x3c')]);_0x1258d5['body'][_0x6b7a('0x64')]=integrations[_0x6b7a('0x65')](_0x1258d5['body'][_0x6b7a('0x63')],_0x1258d5[_0x6b7a('0x5a')][_0x6b7a('0x3c')]);return db[_0x6b7a('0x5c')][_0x6b7a('0x59')](_0x1258d5[_0x6b7a('0x5a')],{'include':[{'model':db['ZohoField'],'as':_0x6b7a('0x61')},{'model':db[_0x6b7a('0x66')],'as':_0x6b7a('0x64')}]});}return null;})[_0x6b7a('0x20')](respondWithResult(_0x51b9fd,null))['catch'](handleError(_0x51b9fd,null));};function getAccessToken(_0x4a679e){return new Promise(function(_0x58bc46,_0x33ce25){var _0x34e0e4;switch(_0x4a679e[_0x6b7a('0x67')]){case'US':_0x34e0e4=_0x6b7a('0x68');break;case'AU':_0x34e0e4=_0x6b7a('0x69');break;case'EU':_0x34e0e4=_0x6b7a('0x6a');break;case'IN':_0x34e0e4='https://accounts.zoho.in';break;case'CN':_0x34e0e4=_0x6b7a('0x6b');break;default:_0x34e0e4='https://accounts.zoho.eu';break;}var _0x586f47={'method':'POST','uri':_0x34e0e4+'/oauth/v2/token','qs':{'refresh_token':_0x4a679e[_0x6b7a('0x6c')],'client_id':_0x4a679e['clientId'],'client_secret':_0x4a679e['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x586f47)[_0x6b7a('0x20')](function(_0x2aa067){if(_0x2aa067[_0x6b7a('0x6d')]){_0x58bc46(_0x2aa067[_0x6b7a('0x6d')]);}else{_0x33ce25('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x9b52c5){_0x33ce25(_0x9b52c5);});});}exports[_0x6b7a('0x6e')]=function(_0x94d37a,_0x34ac47,_0x274041){var _0x5ad900,_0x5e3f2c,_0x5b4fed,_0x3f37c7,_0x19f908;return db[_0x6b7a('0x3b')][_0x6b7a('0x5f')]({'where':{'id':_0x94d37a[_0x6b7a('0x55')]['id']},'attributes':['id',_0x6b7a('0x6f'),_0x6b7a('0x67'),_0x6b7a('0x70'),'clientSecret',_0x6b7a('0x71'),'code',_0x6b7a('0x6c')]})['then'](handleEntityNotFound(_0x34ac47,null))[_0x6b7a('0x20')](function(_0x1fb5d2){_0x19f908=_0x1fb5d2;_0x5ad900=_0x19f908[_0x6b7a('0x6f')];_0x5e3f2c=_0x5ad900===_0x6b7a('0x72')?'eu':_0x6b7a('0x73');_0x5b4fed=_0x19f908[_0x6b7a('0x71')];var _0x1ee795=_0x5b4fed['slice'](-0x1);if(_0x1ee795==='/'||_0x1ee795==='\x5c'||_0x1ee795===':'){_0x5b4fed=_0x5b4fed[_0x6b7a('0x74')](0x0,_0x5b4fed[_0x6b7a('0x75')](_0x1ee795));}if(!_0x19f908['refreshToken']){throw new Error(_0x6b7a('0x76'));}return getAccessToken(_0x19f908);})['then'](function(_0x8bae42){if(_0x8bae42){return rp({'method':_0x6b7a('0x77'),'uri':util[_0x6b7a('0x78')](_0x6b7a('0x79'),_0x5e3f2c),'qs':{'module':_0x6b7a('0x7a')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x8bae42},'json':!![]});}})[_0x6b7a('0x20')](function(_0x511943){if(_0x511943){if(_0x511943[_0x6b7a('0x7b')]&&_0x511943[_0x6b7a('0x7b')]['error']){throw new Error(_0x511943[_0x6b7a('0x7b')][_0x6b7a('0x27')][_0x6b7a('0x28')]);}var _0xdbb543=[];var _0x1d56e8=[];var _0x477a62=[_0x6b7a('0x7c'),_0x6b7a('0x7d'),'Description',_0x6b7a('0x7e'),_0x6b7a('0x7f'),_0x6b7a('0x80'),'Call_Start_Time',_0x6b7a('0x81')];_0x1d56e8=_['remove'](_0x511943['fields'],function(_0x9688dc){return _0x477a62[_0x6b7a('0x82')](_0x9688dc[_0x6b7a('0x83')]);});for(var _0x32b101=0x0;_0x32b101<_0x1d56e8[_0x6b7a('0x44')];_0x32b101++){if(_0x1d56e8[_0x32b101][_0x6b7a('0x84')]===![]){_0xdbb543[_0x6b7a('0x85')]({'id':_0x1d56e8[_0x32b101]['id'],'name':_0x1d56e8[_0x32b101][_0x6b7a('0x86')],'custom':_0x1d56e8[_0x32b101][_0x6b7a('0x87')],'options':_0x1d56e8[_0x32b101][_0x6b7a('0x88')]===_0x6b7a('0x89')&&_0x1d56e8[_0x32b101][_0x6b7a('0x8a')][_0x6b7a('0x44')]>-0x1?_[_0x6b7a('0x3a')](_0x1d56e8[_0x32b101][_0x6b7a('0x8a')],function(_0x4a2820){return{'name':_0x4a2820,'value':_0x4a2820};}):[]});}}return{'count':_0xdbb543['length'],'rows':_0xdbb543};}else{return{'count':0x0,'rows':[]};}})[_0x6b7a('0x20')](respondWithResult(_0x34ac47,null))[_0x6b7a('0x2a')](function(_0x2fb03e){var _0x3d625d=_0x94d37a['query'][_0x6b7a('0x8b')]?0x1f4:_0x2fb03e[_0x6b7a('0x8c')]||0x1f4;logger[_0x6b7a('0x27')](_0x6b7a('0x8d'),'getFields',_0x3d625d,JSON[_0x6b7a('0x26')](_0x2fb03e));delete _0x2fb03e[_0x6b7a('0x38')];if(_0x3d625d===0x191){_0x3d625d=0x190;}_0x34ac47['status'](_0x3d625d)[_0x6b7a('0x8e')](_0x94d37a['query'][_0x6b7a('0x8b')]?{'message':_0x6b7a('0x8f'),'statusCode':_0x2fb03e['statusCode']}:_0x2fb03e);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index e3484b2..f2f27b9 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 _0xd8d5=['/oauth/v2/token','authorization_code','clientId','serverUrl','application/x-www-form-urlencoded','then','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','host','https://accounts.zoho.in','parse','info','error','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','define','int_zoho_accounts','zone','changed','clientSecret','code','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST'];(function(_0x2c1f89,_0x5aef0d){var _0x56445e=function(_0x364a5d){while(--_0x364a5d){_0x2c1f89['push'](_0x2c1f89['shift']());}};_0x56445e(++_0x5aef0d);}(_0xd8d5,0x1f3));var _0x5d8d=function(_0x3f6a2d,_0x3e0dfc){_0x3f6a2d=_0x3f6a2d-0x0;var _0x5e046a=_0xd8d5[_0x3f6a2d];return _0x5e046a;};'use strict';var _=require(_0x5d8d('0x0'));var util=require(_0x5d8d('0x1'));var logger=require('../../config/logger')(_0x5d8d('0x2'));var moment=require(_0x5d8d('0x3'));var BPromise=require('bluebird');var rp=require(_0x5d8d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5d8d('0x5'));var config=require(_0x5d8d('0x6'));var attributes=require(_0x5d8d('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4e64c0,_0x4a9443){return _0x4e64c0[_0x5d8d('0x8')]('ZohoAccount',attributes,{'tableName':_0x5d8d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x381a29,_0x51f963,_0x1b03e3){if(_0x381a29['changed'](_0x5d8d('0xa'))||_0x381a29[_0x5d8d('0xb')]('serverUrl')||_0x381a29[_0x5d8d('0xb')]('clientId')||_0x381a29['changed'](_0x5d8d('0xc'))||_0x381a29[_0x5d8d('0xb')](_0x5d8d('0xd'))||_0x381a29[_0x5d8d('0xb')]('host')){var _0x4f5c3a,_0x4a96e4;_0x4f5c3a=_0x381a29['serverUrl'];var _0x33f5e1=_0x4f5c3a['slice'](-0x1);if(_0x33f5e1==='/'||_0x33f5e1==='\x5c'||_0x33f5e1===':'){_0x4f5c3a=_0x4f5c3a[_0x5d8d('0xe')](0x0,_0x4f5c3a[_0x5d8d('0xf')](_0x33f5e1));}switch(_0x381a29[_0x5d8d('0xa')]){case'US':_0x4a96e4=_0x5d8d('0x10');break;case'AU':_0x4a96e4=_0x5d8d('0x11');break;case'IN':_0x4a96e4='https://accounts.zoho.in';break;case'CN':_0x4a96e4=_0x5d8d('0x12');break;default:_0x4a96e4=_0x5d8d('0x13');break;}var _0x1c6796={'method':_0x5d8d('0x14'),'uri':_0x4a96e4+_0x5d8d('0x15'),'form':{'grant_type':_0x5d8d('0x16'),'client_id':_0x381a29[_0x5d8d('0x17')],'client_secret':_0x381a29[_0x5d8d('0xc')],'redirect_uri':_0x381a29[_0x5d8d('0x18')],'code':_0x381a29[_0x5d8d('0xd')]},'headers':{'Content-Type':_0x5d8d('0x19')}};return rp(_0x1c6796)[_0x5d8d('0x1a')](function(_0x3ec6c1){var _0x17f270=JSON['parse'](_0x3ec6c1);if(_0x17f270[_0x5d8d('0x1b')]){_0x381a29[_0x5d8d('0x1c')]=_0x17f270[_0x5d8d('0x1b')];logger['info'](util[_0x5d8d('0x1d')](_0x5d8d('0x1e'),_0x381a29[_0x5d8d('0x1f')],_0x381a29['id']));}else{logger['error'](util[_0x5d8d('0x1d')](_0x5d8d('0x20'),_0x381a29[_0x5d8d('0x1f')],_0x381a29['id']),util[_0x5d8d('0x21')](_0x17f270,{'showHidden':![],'depth':null}));}return _0x1b03e3(null,_0x51f963);})[_0x5d8d('0x22')](function(_0x537fe3){logger['error'](util['format'](_0x5d8d('0x20'),_0x381a29[_0x5d8d('0x1f')],_0x381a29['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1b03e3(_0x537fe3);});}else{return _0x1b03e3(null,_0x51f963);}},'beforeUpdate':function(_0x3ef55b,_0x1a6240,_0x5c74ed){if(_0x3ef55b[_0x5d8d('0xb')]('zone')||_0x3ef55b['changed']('serverUrl')||_0x3ef55b[_0x5d8d('0xb')](_0x5d8d('0x17'))||_0x3ef55b[_0x5d8d('0xb')]('clientSecret')||_0x3ef55b[_0x5d8d('0xb')]('code')||_0x3ef55b['changed'](_0x5d8d('0x23'))){var _0x575c59,_0x140002;_0x575c59=_0x3ef55b[_0x5d8d('0x18')];var _0x540644=_0x575c59['slice'](-0x1);if(_0x540644==='/'||_0x540644==='\x5c'||_0x540644===':'){_0x575c59=_0x575c59[_0x5d8d('0xe')](0x0,_0x575c59[_0x5d8d('0xf')](_0x540644));}switch(_0x3ef55b[_0x5d8d('0xa')]){case'US':_0x140002=_0x5d8d('0x10');break;case'AU':_0x140002=_0x5d8d('0x11');break;case'IN':_0x140002=_0x5d8d('0x24');break;case'CN':_0x140002=_0x5d8d('0x12');break;default:_0x140002=_0x5d8d('0x13');break;}var _0x4e506a={'method':_0x5d8d('0x14'),'uri':_0x140002+_0x5d8d('0x15'),'form':{'grant_type':'authorization_code','client_id':_0x3ef55b['clientId'],'client_secret':_0x3ef55b[_0x5d8d('0xc')],'redirect_uri':_0x3ef55b[_0x5d8d('0x18')],'code':_0x3ef55b[_0x5d8d('0xd')]},'headers':{'Content-Type':_0x5d8d('0x19')}};return rp(_0x4e506a)[_0x5d8d('0x1a')](function(_0xe60f49){var _0x5671f9=JSON[_0x5d8d('0x25')](_0xe60f49);if(_0x5671f9[_0x5d8d('0x1b')]){_0x3ef55b[_0x5d8d('0x1c')]=_0x5671f9[_0x5d8d('0x1b')];logger[_0x5d8d('0x26')](util[_0x5d8d('0x1d')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3ef55b[_0x5d8d('0x1f')],_0x3ef55b['id']));}else{logger[_0x5d8d('0x27')](util[_0x5d8d('0x1d')](_0x5d8d('0x20'),_0x3ef55b[_0x5d8d('0x1f')],_0x3ef55b['id']),util['inspect'](_0x5671f9,{'showHidden':![],'depth':null}));}return _0x5c74ed(null,_0x1a6240);})[_0x5d8d('0x22')](function(_0x245293){logger['error'](util[_0x5d8d('0x1d')](_0x5d8d('0x20'),_0x3ef55b[_0x5d8d('0x1f')],_0x3ef55b['id']),util[_0x5d8d('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x5c74ed(_0x245293);});}else{return _0x5c74ed(null,_0x1a6240);}}}});}; \ No newline at end of file +var _0xdd5b=['substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','code','host','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','define','ZohoAccount','changed','zone','serverUrl','clientSecret','slice'];(function(_0x245c79,_0x50406b){var _0x3aab1d=function(_0xeca544){while(--_0xeca544){_0x245c79['push'](_0x245c79['shift']());}};_0x3aab1d(++_0x50406b);}(_0xdd5b,0x1d0));var _0xbdd5=function(_0x3d5416,_0x28a599){_0x3d5416=_0x3d5416-0x0;var _0x17712c=_0xdd5b[_0x3d5416];return _0x17712c;};'use strict';var _=require(_0xbdd5('0x0'));var util=require('util');var logger=require(_0xbdd5('0x1'))(_0xbdd5('0x2'));var moment=require(_0xbdd5('0x3'));var BPromise=require(_0xbdd5('0x4'));var rp=require(_0xbdd5('0x5'));var fs=require('fs');var path=require(_0xbdd5('0x6'));var rimraf=require('rimraf');var config=require(_0xbdd5('0x7'));var attributes=require(_0xbdd5('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x30ff72,_0x5e10f3){return _0x30ff72[_0xbdd5('0x9')](_0xbdd5('0xa'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x57e1cc,_0x3825e3,_0x3f051d){if(_0x57e1cc[_0xbdd5('0xb')](_0xbdd5('0xc'))||_0x57e1cc[_0xbdd5('0xb')](_0xbdd5('0xd'))||_0x57e1cc[_0xbdd5('0xb')]('clientId')||_0x57e1cc[_0xbdd5('0xb')](_0xbdd5('0xe'))||_0x57e1cc['changed']('code')||_0x57e1cc[_0xbdd5('0xb')]('host')){var _0x3fafa6,_0x326ab9;_0x3fafa6=_0x57e1cc['serverUrl'];var _0x4c4997=_0x3fafa6[_0xbdd5('0xf')](-0x1);if(_0x4c4997==='/'||_0x4c4997==='\x5c'||_0x4c4997===':'){_0x3fafa6=_0x3fafa6[_0xbdd5('0x10')](0x0,_0x3fafa6[_0xbdd5('0x11')](_0x4c4997));}switch(_0x57e1cc[_0xbdd5('0xc')]){case'US':_0x326ab9=_0xbdd5('0x12');break;case'AU':_0x326ab9=_0xbdd5('0x13');break;case'IN':_0x326ab9=_0xbdd5('0x14');break;case'CN':_0x326ab9='https://accounts.zoho.com.cn';break;default:_0x326ab9=_0xbdd5('0x15');break;}var _0xeef81d={'method':_0xbdd5('0x16'),'uri':_0x326ab9+_0xbdd5('0x17'),'form':{'grant_type':_0xbdd5('0x18'),'client_id':_0x57e1cc[_0xbdd5('0x19')],'client_secret':_0x57e1cc[_0xbdd5('0xe')],'redirect_uri':_0x57e1cc[_0xbdd5('0xd')],'code':_0x57e1cc['code']},'headers':{'Content-Type':_0xbdd5('0x1a')}};return rp(_0xeef81d)[_0xbdd5('0x1b')](function(_0x1b3400){var _0x56ec02=JSON['parse'](_0x1b3400);if(_0x56ec02[_0xbdd5('0x1c')]){_0x57e1cc[_0xbdd5('0x1d')]=_0x56ec02['refresh_token'];logger[_0xbdd5('0x1e')](util[_0xbdd5('0x1f')](_0xbdd5('0x20'),_0x57e1cc[_0xbdd5('0x21')],_0x57e1cc['id']));}else{logger[_0xbdd5('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x57e1cc[_0xbdd5('0x21')],_0x57e1cc['id']),util['inspect'](_0x56ec02,{'showHidden':![],'depth':null}));}return _0x3f051d(null,_0x3825e3);})[_0xbdd5('0x23')](function(_0x3f9651){logger[_0xbdd5('0x22')](util['format'](_0xbdd5('0x24'),_0x57e1cc[_0xbdd5('0x21')],_0x57e1cc['id']),util[_0xbdd5('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x3f051d(_0x3f9651);});}else{return _0x3f051d(null,_0x3825e3);}},'beforeUpdate':function(_0x4dd0ff,_0x1da39c,_0x66a71){if(_0x4dd0ff[_0xbdd5('0xb')](_0xbdd5('0xc'))||_0x4dd0ff[_0xbdd5('0xb')](_0xbdd5('0xd'))||_0x4dd0ff[_0xbdd5('0xb')](_0xbdd5('0x19'))||_0x4dd0ff[_0xbdd5('0xb')](_0xbdd5('0xe'))||_0x4dd0ff[_0xbdd5('0xb')](_0xbdd5('0x26'))||_0x4dd0ff[_0xbdd5('0xb')](_0xbdd5('0x27'))){var _0x41a57d,_0x8ebff3;_0x41a57d=_0x4dd0ff['serverUrl'];var _0x2a0f96=_0x41a57d[_0xbdd5('0xf')](-0x1);if(_0x2a0f96==='/'||_0x2a0f96==='\x5c'||_0x2a0f96===':'){_0x41a57d=_0x41a57d['substring'](0x0,_0x41a57d[_0xbdd5('0x11')](_0x2a0f96));}switch(_0x4dd0ff[_0xbdd5('0xc')]){case'US':_0x8ebff3='https://accounts.zoho.com';break;case'AU':_0x8ebff3=_0xbdd5('0x13');break;case'IN':_0x8ebff3=_0xbdd5('0x14');break;case'CN':_0x8ebff3='https://accounts.zoho.com.cn';break;default:_0x8ebff3=_0xbdd5('0x15');break;}var _0x4719c5={'method':_0xbdd5('0x16'),'uri':_0x8ebff3+_0xbdd5('0x17'),'form':{'grant_type':_0xbdd5('0x18'),'client_id':_0x4dd0ff[_0xbdd5('0x19')],'client_secret':_0x4dd0ff[_0xbdd5('0xe')],'redirect_uri':_0x4dd0ff['serverUrl'],'code':_0x4dd0ff['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4719c5)[_0xbdd5('0x1b')](function(_0x1bad0d){var _0x16b9a6=JSON['parse'](_0x1bad0d);if(_0x16b9a6['refresh_token']){_0x4dd0ff[_0xbdd5('0x1d')]=_0x16b9a6['refresh_token'];logger[_0xbdd5('0x1e')](util[_0xbdd5('0x1f')](_0xbdd5('0x20'),_0x4dd0ff[_0xbdd5('0x21')],_0x4dd0ff['id']));}else{logger[_0xbdd5('0x22')](util['format'](_0xbdd5('0x24'),_0x4dd0ff[_0xbdd5('0x21')],_0x4dd0ff['id']),util['inspect'](_0x16b9a6,{'showHidden':![],'depth':null}));}return _0x66a71(null,_0x1da39c);})['catch'](function(_0x1b634a){logger[_0xbdd5('0x22')](util[_0xbdd5('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4dd0ff[_0xbdd5('0x21')],_0x4dd0ff['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x66a71(_0x1b634a);});}else{return _0x66a71(null,_0x1da39c);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 8d85bd0..b7a5ada 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 _0x6fba=['error','code','message','info','result','catch','ZohoAccount','findAll','options','raw','attributes','limit','map','include','model','GetZohoAccount','ShowZohoAccount','find','where','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x27b53b,_0x18e3fd){var _0x5f5006=function(_0x2e7b8c){while(--_0x2e7b8c){_0x27b53b['push'](_0x27b53b['shift']());}};_0x5f5006(++_0x18e3fd);}(_0x6fba,0x97));var _0xa6fb=function(_0x259309,_0x53375d){_0x259309=_0x259309-0x0;var _0x34d9ab=_0x6fba[_0x259309];return _0x34d9ab;};'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(_0xa6fb('0x0'));var db=require(_0xa6fb('0x1'))['db'];var utils=require(_0xa6fb('0x2'));var logger=require(_0xa6fb('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa6fb('0x4'));var client=jayson[_0xa6fb('0x5')][_0xa6fb('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1be4a7,_0x2c860c,_0x44d1b6){return new BPromise(function(_0x4ab390,_0x1fbd2a){return client[_0xa6fb('0x7')](_0x1be4a7,_0x44d1b6)[_0xa6fb('0x8')](function(_0x491880){logger['info'](_0xa6fb('0x9'),_0x2c860c,'request\x20sent');logger[_0xa6fb('0xa')](_0xa6fb('0xb'),_0x2c860c,_0xa6fb('0xc'),JSON[_0xa6fb('0xd')](_0x491880));if(_0x491880[_0xa6fb('0xe')]){if(_0x491880['error'][_0xa6fb('0xf')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x2c860c,_0x491880[_0xa6fb('0xe')][_0xa6fb('0x10')]);return _0x1fbd2a(_0x491880['error'][_0xa6fb('0x10')]);}logger[_0xa6fb('0xe')](_0xa6fb('0x9'),_0x2c860c,_0x491880[_0xa6fb('0xe')][_0xa6fb('0x10')]);return _0x4ab390(_0x491880[_0xa6fb('0xe')]['message']);}else{logger[_0xa6fb('0x11')](_0xa6fb('0x9'),_0x2c860c,_0xa6fb('0xc'));_0x4ab390(_0x491880[_0xa6fb('0x12')][_0xa6fb('0x10')]);}})[_0xa6fb('0x13')](function(_0x357405){logger[_0xa6fb('0xe')](_0xa6fb('0x9'),_0x2c860c,_0x357405);_0x1fbd2a(_0x357405);});});}exports['GetZohoAccount']=function(_0x4fa149){var _0xe21734=this;return new Promise(function(_0x1b4bbe,_0x193b40){return db[_0xa6fb('0x14')][_0xa6fb('0x15')]({'raw':_0x4fa149['options']?_0x4fa149[_0xa6fb('0x16')][_0xa6fb('0x17')]===undefined?!![]:![]:!![],'where':_0x4fa149[_0xa6fb('0x16')]?_0x4fa149[_0xa6fb('0x16')]['where']||null:null,'attributes':_0x4fa149[_0xa6fb('0x16')]?_0x4fa149[_0xa6fb('0x16')][_0xa6fb('0x18')]||null:null,'limit':_0x4fa149[_0xa6fb('0x16')]?_0x4fa149['options'][_0xa6fb('0x19')]||null:null,'include':_0x4fa149[_0xa6fb('0x16')]?_0x4fa149[_0xa6fb('0x16')]['include']?_[_0xa6fb('0x1a')](_0x4fa149[_0xa6fb('0x16')][_0xa6fb('0x1b')],function(_0x5533f9){return{'model':db[_0x5533f9['model']],'as':_0x5533f9['as'],'attributes':_0x5533f9['attributes'],'include':_0x5533f9[_0xa6fb('0x1b')]?_['map'](_0x5533f9['include'],function(_0x26be24){return{'model':db[_0x26be24[_0xa6fb('0x1c')]],'as':_0x26be24['as'],'attributes':_0x26be24['attributes'],'include':_0x26be24[_0xa6fb('0x1b')]?_[_0xa6fb('0x1a')](_0x26be24[_0xa6fb('0x1b')],function(_0x1414b6){return{'model':db[_0x1414b6['model']],'as':_0x1414b6['as'],'attributes':_0x1414b6[_0xa6fb('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa6fb('0x8')](function(_0x79c165){logger[_0xa6fb('0x11')](_0xa6fb('0x1d'),_0x4fa149);logger['debug'](_0xa6fb('0x1d'),_0x4fa149,JSON['stringify'](_0x79c165));_0x1b4bbe(_0x79c165);})[_0xa6fb('0x13')](function(_0x178ec6){logger[_0xa6fb('0xe')](_0xa6fb('0x1d'),_0x178ec6[_0xa6fb('0x10')],_0x4fa149);_0x193b40(_0xe21734['error'](0x1f4,_0x178ec6['message']));});});};exports[_0xa6fb('0x1e')]=function(_0x185e09){var _0x1e2509=this;return new Promise(function(_0x5a23fb,_0x2a096d){return db['ZohoAccount'][_0xa6fb('0x1f')]({'raw':_0x185e09[_0xa6fb('0x16')]?_0x185e09[_0xa6fb('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x185e09['options']?_0x185e09[_0xa6fb('0x16')][_0xa6fb('0x20')]||null:null,'attributes':_0x185e09['options']?_0x185e09[_0xa6fb('0x16')]['attributes']||null:null,'include':_0x185e09[_0xa6fb('0x16')]?_0x185e09[_0xa6fb('0x16')][_0xa6fb('0x1b')]?_[_0xa6fb('0x1a')](_0x185e09['options']['include'],function(_0x13fa02){return{'model':db[_0x13fa02['model']],'as':_0x13fa02['as'],'attributes':_0x13fa02[_0xa6fb('0x18')],'include':_0x13fa02[_0xa6fb('0x1b')]?_[_0xa6fb('0x1a')](_0x13fa02[_0xa6fb('0x1b')],function(_0x2952ac){return{'model':db[_0x2952ac['model']],'as':_0x2952ac['as'],'attributes':_0x2952ac[_0xa6fb('0x18')],'include':_0x2952ac[_0xa6fb('0x1b')]?_[_0xa6fb('0x1a')](_0x2952ac[_0xa6fb('0x1b')],function(_0x1e272e){return{'model':db[_0x1e272e[_0xa6fb('0x1c')]],'as':_0x1e272e['as'],'attributes':_0x1e272e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xda7bf3){logger['info']('ShowZohoAccount',_0x185e09);logger[_0xa6fb('0xa')](_0xa6fb('0x1e'),_0x185e09,JSON[_0xa6fb('0xd')](_0xda7bf3));_0x5a23fb(_0xda7bf3);})[_0xa6fb('0x13')](function(_0x5da166){logger[_0xa6fb('0xe')](_0xa6fb('0x1e'),_0x5da166['message'],_0x185e09);_0x2a096d(_0x1e2509['error'](0x1f4,_0x5da166['message']));});});}; \ No newline at end of file +var _0xcdef=['error','message','info','result','GetZohoAccount','ZohoAccount','options','where','include','map','attributes','model','catch','ShowZohoAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x13be65,_0x3f288e){var _0x47f6cb=function(_0x46a905){while(--_0x46a905){_0x13be65['push'](_0x13be65['shift']());}};_0x47f6cb(++_0x3f288e);}(_0xcdef,0xb3));var _0xfcde=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xcdef[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xfcde('0x0'));var util=require(_0xfcde('0x1'));var moment=require('moment');var BPromise=require(_0xfcde('0x2'));var rs=require(_0xfcde('0x3'));var fs=require('fs');var Redis=require(_0xfcde('0x4'));var db=require(_0xfcde('0x5'))['db'];var utils=require(_0xfcde('0x6'));var logger=require(_0xfcde('0x7'))(_0xfcde('0x8'));var config=require(_0xfcde('0x9'));var jayson=require(_0xfcde('0xa'));var client=jayson['client'][_0xfcde('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x306ce0,_0x3b454a,_0x841006){return new BPromise(function(_0x3c6ded,_0x2ddcc8){return client[_0xfcde('0xc')](_0x306ce0,_0x841006)[_0xfcde('0xd')](function(_0x4185e1){logger['info'](_0xfcde('0xe'),_0x3b454a,_0xfcde('0xf'));logger[_0xfcde('0x10')](_0xfcde('0x11'),_0x3b454a,'request\x20sent',JSON[_0xfcde('0x12')](_0x4185e1));if(_0x4185e1[_0xfcde('0x13')]){if(_0x4185e1[_0xfcde('0x13')]['code']===0x1f4){logger[_0xfcde('0x13')](_0xfcde('0xe'),_0x3b454a,_0x4185e1[_0xfcde('0x13')][_0xfcde('0x14')]);return _0x2ddcc8(_0x4185e1[_0xfcde('0x13')]['message']);}logger['error'](_0xfcde('0xe'),_0x3b454a,_0x4185e1[_0xfcde('0x13')][_0xfcde('0x14')]);return _0x3c6ded(_0x4185e1[_0xfcde('0x13')][_0xfcde('0x14')]);}else{logger[_0xfcde('0x15')](_0xfcde('0xe'),_0x3b454a,_0xfcde('0xf'));_0x3c6ded(_0x4185e1[_0xfcde('0x16')][_0xfcde('0x14')]);}})['catch'](function(_0x3a49ab){logger[_0xfcde('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x3b454a,_0x3a49ab);_0x2ddcc8(_0x3a49ab);});});}exports[_0xfcde('0x17')]=function(_0x14db65){var _0x25bcf6=this;return new Promise(function(_0x55e349,_0x5adb2d){return db[_0xfcde('0x18')]['findAll']({'raw':_0x14db65[_0xfcde('0x19')]?_0x14db65[_0xfcde('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x14db65[_0xfcde('0x19')]?_0x14db65[_0xfcde('0x19')][_0xfcde('0x1a')]||null:null,'attributes':_0x14db65['options']?_0x14db65['options']['attributes']||null:null,'limit':_0x14db65[_0xfcde('0x19')]?_0x14db65[_0xfcde('0x19')]['limit']||null:null,'include':_0x14db65[_0xfcde('0x19')]?_0x14db65[_0xfcde('0x19')]['include']?_['map'](_0x14db65[_0xfcde('0x19')][_0xfcde('0x1b')],function(_0x1b8b09){return{'model':db[_0x1b8b09['model']],'as':_0x1b8b09['as'],'attributes':_0x1b8b09['attributes'],'include':_0x1b8b09[_0xfcde('0x1b')]?_[_0xfcde('0x1c')](_0x1b8b09[_0xfcde('0x1b')],function(_0x193bdb){return{'model':db[_0x193bdb['model']],'as':_0x193bdb['as'],'attributes':_0x193bdb[_0xfcde('0x1d')],'include':_0x193bdb[_0xfcde('0x1b')]?_[_0xfcde('0x1c')](_0x193bdb[_0xfcde('0x1b')],function(_0x18133d){return{'model':db[_0x18133d[_0xfcde('0x1e')]],'as':_0x18133d['as'],'attributes':_0x18133d[_0xfcde('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfcde('0xd')](function(_0x3e8d81){logger[_0xfcde('0x15')]('GetZohoAccount',_0x14db65);logger[_0xfcde('0x10')](_0xfcde('0x17'),_0x14db65,JSON['stringify'](_0x3e8d81));_0x55e349(_0x3e8d81);})[_0xfcde('0x1f')](function(_0xff40be){logger['error'](_0xfcde('0x17'),_0xff40be[_0xfcde('0x14')],_0x14db65);_0x5adb2d(_0x25bcf6[_0xfcde('0x13')](0x1f4,_0xff40be[_0xfcde('0x14')]));});});};exports['ShowZohoAccount']=function(_0x2f4a6e){var _0x37a4e8=this;return new Promise(function(_0x2769ae,_0x160e15){return db[_0xfcde('0x18')]['find']({'raw':_0x2f4a6e[_0xfcde('0x19')]?_0x2f4a6e[_0xfcde('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2f4a6e[_0xfcde('0x19')]?_0x2f4a6e[_0xfcde('0x19')]['where']||null:null,'attributes':_0x2f4a6e[_0xfcde('0x19')]?_0x2f4a6e[_0xfcde('0x19')][_0xfcde('0x1d')]||null:null,'include':_0x2f4a6e[_0xfcde('0x19')]?_0x2f4a6e[_0xfcde('0x19')][_0xfcde('0x1b')]?_[_0xfcde('0x1c')](_0x2f4a6e[_0xfcde('0x19')]['include'],function(_0x5b7eaf){return{'model':db[_0x5b7eaf[_0xfcde('0x1e')]],'as':_0x5b7eaf['as'],'attributes':_0x5b7eaf['attributes'],'include':_0x5b7eaf[_0xfcde('0x1b')]?_[_0xfcde('0x1c')](_0x5b7eaf['include'],function(_0x9c910d){return{'model':db[_0x9c910d['model']],'as':_0x9c910d['as'],'attributes':_0x9c910d[_0xfcde('0x1d')],'include':_0x9c910d['include']?_[_0xfcde('0x1c')](_0x9c910d[_0xfcde('0x1b')],function(_0x17a815){return{'model':db[_0x17a815[_0xfcde('0x1e')]],'as':_0x17a815['as'],'attributes':_0x17a815[_0xfcde('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfcde('0xd')](function(_0x593a5){logger[_0xfcde('0x15')](_0xfcde('0x20'),_0x2f4a6e);logger[_0xfcde('0x10')](_0xfcde('0x20'),_0x2f4a6e,JSON[_0xfcde('0x12')](_0x593a5));_0x2769ae(_0x593a5);})[_0xfcde('0x1f')](function(_0x23eddb){logger[_0xfcde('0x13')](_0xfcde('0x20'),_0x23eddb[_0xfcde('0x14')],_0x2f4a6e);_0x160e15(_0x37a4e8[_0xfcde('0x13')](0x1f4,_0x23eddb['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index ead8dc3..ed48b30 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 _0x3076=['create','put','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3076,0xde));var _0x6307=function(_0x2ae22a,_0x4fe753){_0x2ae22a=_0x2ae22a-0x0;var _0x286a82=_0x3076[_0x2ae22a];return _0x286a82;};'use strict';var multer=require(_0x6307('0x0'));var util=require(_0x6307('0x1'));var path=require('path');var timeout=require(_0x6307('0x2'));var express=require(_0x6307('0x3'));var router=express[_0x6307('0x4')]();var auth=require(_0x6307('0x5'));var interaction=require(_0x6307('0x6'));var config=require(_0x6307('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x6307('0x8')]('/',auth[_0x6307('0x9')](),controller[_0x6307('0xa')]);router[_0x6307('0x8')](_0x6307('0xb'),auth[_0x6307('0x9')](),controller[_0x6307('0xc')]);router[_0x6307('0x8')](_0x6307('0xd'),auth['isAuthenticated'](),controller[_0x6307('0xe')]);router['get']('/:id/subjects',auth[_0x6307('0x9')](),controller[_0x6307('0xf')]);router[_0x6307('0x8')](_0x6307('0x10'),auth[_0x6307('0x9')](),controller[_0x6307('0x11')]);router['post']('/',auth[_0x6307('0x9')](),controller[_0x6307('0x12')]);router[_0x6307('0x13')](_0x6307('0xb'),auth[_0x6307('0x9')](),controller['update']);router['delete']('/:id',auth[_0x6307('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x47f4=['put','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','./intZohoConfiguration.controller','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x2e1c09,_0x317c31){var _0x3e73f0=function(_0x3c45fc){while(--_0x3c45fc){_0x2e1c09['push'](_0x2e1c09['shift']());}};_0x3e73f0(++_0x317c31);}(_0x47f4,0x1b8));var _0x447f=function(_0x23f262,_0x413bd5){_0x23f262=_0x23f262-0x0;var _0x4cf4ba=_0x47f4[_0x23f262];return _0x4cf4ba;};'use strict';var multer=require('multer');var util=require(_0x447f('0x0'));var path=require(_0x447f('0x1'));var timeout=require(_0x447f('0x2'));var express=require(_0x447f('0x3'));var router=express[_0x447f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x447f('0x5'));var config=require('../../config/environment');var controller=require(_0x447f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x447f('0x7')]);router[_0x447f('0x8')](_0x447f('0x9'),auth['isAuthenticated'](),controller[_0x447f('0xa')]);router[_0x447f('0x8')](_0x447f('0xb'),auth['isAuthenticated'](),controller[_0x447f('0xc')]);router[_0x447f('0x8')](_0x447f('0xd'),auth[_0x447f('0xe')](),controller[_0x447f('0xf')]);router[_0x447f('0x8')](_0x447f('0x10'),auth[_0x447f('0xe')](),controller[_0x447f('0x11')]);router[_0x447f('0x12')]('/',auth[_0x447f('0xe')](),controller[_0x447f('0x13')]);router[_0x447f('0x14')](_0x447f('0x9'),auth[_0x447f('0xe')](),controller['update']);router[_0x447f('0x15')](_0x447f('0x9'),auth[_0x447f('0xe')](),controller[_0x447f('0x16')]);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 82133dd..666d093 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 _0x5138=['STRING','sequelize','exports','ENUM','Leads','Contacts'];(function(_0x46e50a,_0x2ac44b){var _0x4c8bff=function(_0x4aff52){while(--_0x4aff52){_0x46e50a['push'](_0x46e50a['shift']());}};_0x4c8bff(++_0x2ac44b);}(_0x5138,0x1b7));var _0x8513=function(_0x39cd3c,_0xa21102){_0x39cd3c=_0x39cd3c-0x0;var _0x47a0ae=_0x5138[_0x39cd3c];return _0x47a0ae;};'use strict';var Sequelize=require(_0x8513('0x0'));module[_0x8513('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x8513('0x2')](_0x8513('0x3'),_0x8513('0x4')),'defaultValue':_0x8513('0x3')},'description':{'type':Sequelize[_0x8513('0x5')]}}; \ No newline at end of file +var _0x402e=['ENUM','Leads','Contacts','sequelize','exports','STRING'];(function(_0x113c89,_0x16c3da){var _0x1da3b0=function(_0x21377c){while(--_0x21377c){_0x113c89['push'](_0x113c89['shift']());}};_0x1da3b0(++_0x16c3da);}(_0x402e,0x135));var _0xe402=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0x402e[_0x15dbca];return _0x326533;};'use strict';var Sequelize=require(_0xe402('0x0'));module[_0xe402('0x1')]={'name':{'type':Sequelize[_0xe402('0x2')]},'moduleCreate':{'type':Sequelize[_0xe402('0x3')](_0xe402('0x4'),_0xe402('0x5')),'defaultValue':_0xe402('0x4')},'description':{'type':Sequelize[_0xe402('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 379a257..ec0456f 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=['attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','findAll','rows','catch','params','keys','length','include','options','find','create','body','getFields','findOne','ZohoField','pick','getSubjects','getDescriptions','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','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','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','stack','name','index','ZohoConfiguration','rawAttributes','type','key','map','query','intersection','model','fields'];(function(_0x823eb3,_0x3bb3f3){var _0x1c946d=function(_0x3c8acf){while(--_0x3c8acf){_0x823eb3['push'](_0x823eb3['shift']());}};_0x1c946d(++_0x3bb3f3);}(_0x55ca,0x126));var _0xa55c=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0x55ca[_0x10dfdf];return _0x4d857d;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');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('0x8'));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 db=require(_0xa55c('0x16'))['db'];var jayson=require(_0xa55c('0x17'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x2a35be,_0x576044,_0x5a3672){if(_0x5a3672){var _0x59ea8d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x59ea8d[_0xa55c('0x18')](_0x576044)){return _0x2a35be;}else{throw new db[(_0xa55c('0x19'))][(_0xa55c('0x1a'))](_0xa55c('0x1b'));}}else{return _0x2a35be;}}function respondWithRpcPromise(_0x458480,_0x247e77,_0x4e0b2f,_0x3ccf65){return new BPromise(function(_0x3dcf4f,_0x25934f){var _0x31e10d=_0x3ccf65||client;return _0x31e10d[_0xa55c('0x1c')](_0x458480,_0x4e0b2f)[_0xa55c('0x1d')](function(_0x51590e){logger[_0xa55c('0x1e')](_0xa55c('0x1f'),_0x247e77,'request\x20sent');logger[_0xa55c('0x20')](_0xa55c('0x21'),_0x247e77,_0xa55c('0x22'),JSON[_0xa55c('0x23')](_0x51590e));if(_0x51590e[_0xa55c('0x24')]){if(_0x51590e[_0xa55c('0x24')]['code']===0x1f4){logger['error'](_0xa55c('0x1f'),_0x247e77,_0x51590e[_0xa55c('0x24')][_0xa55c('0x25')]);return _0x25934f(_0x51590e['error'][_0xa55c('0x25')]);}logger[_0xa55c('0x24')]('ZohoConfiguration,\x20%s,\x20%s',_0x247e77,_0x51590e[_0xa55c('0x24')][_0xa55c('0x25')]);return _0x3dcf4f(_0x51590e[_0xa55c('0x24')][_0xa55c('0x25')]);}else{logger[_0xa55c('0x1e')]('ZohoConfiguration,\x20%s,\x20%s',_0x247e77,_0xa55c('0x22'));_0x3dcf4f(_0x51590e['result']['message']);}})['catch'](function(_0x19ae88){logger['error'](_0xa55c('0x1f'),_0x247e77,_0x19ae88);_0x25934f(_0x19ae88);});});}function respondWithStatusCode(_0x190757,_0x3f64de){_0x3f64de=_0x3f64de||0xcc;return function(_0xf0e574){if(_0xf0e574){return _0x190757[_0xa55c('0x26')](_0x3f64de);}return _0x190757[_0xa55c('0x27')](_0x3f64de)[_0xa55c('0x28')]();};}function respondWithResult(_0x11e7f7,_0x192df2){_0x192df2=_0x192df2||0xc8;return function(_0x3cd152){if(_0x3cd152){return _0x11e7f7[_0xa55c('0x27')](_0x192df2)['json'](_0x3cd152);}};}function respondWithFilteredResult(_0x430d55,_0x28814f){return function(_0x1c9f6b){if(_0x1c9f6b){var _0x906caa=_0x1c9f6b[_0xa55c('0x29')],_0x5d940d=_0x28814f[_0xa55c('0x2a')],_0x1377b0=_0x28814f[_0xa55c('0x2a')]+_0x28814f[_0xa55c('0x2b')],_0x22f6b6;if(_0x1377b0>=_0x906caa){_0x1377b0=_0x906caa;_0x22f6b6=0xc8;}else{_0x22f6b6=0xce;}_0x430d55['status'](_0x22f6b6);return _0x430d55[_0xa55c('0x2c')]('Content-Range',_0x5d940d+'-'+_0x1377b0+'/'+_0x906caa)[_0xa55c('0x2d')](_0x1c9f6b);}return null;};}function patchUpdates(_0x1d730b){return function(_0x1cc53e){try{jsonpatch[_0xa55c('0x2e')](_0x1cc53e,_0x1d730b,!![]);}catch(_0x4d8416){return BPromise[_0xa55c('0x2f')](_0x4d8416);}return _0x1cc53e[_0xa55c('0x30')]();};}function saveUpdates(_0x331e58,_0x20da31){return function(_0x10f4b7){if(_0x10f4b7){return _0x10f4b7[_0xa55c('0x31')](_0x331e58)[_0xa55c('0x1d')](function(_0x24d44d){return _0x24d44d;});}return null;};}function removeEntity(_0x2808e9,_0xcbaf2e){return function(_0x197099){if(_0x197099){return _0x197099['destroy']()['then'](function(){_0x2808e9[_0xa55c('0x27')](0xcc)[_0xa55c('0x28')]();});}};}function handleEntityNotFound(_0x4932d0,_0x30fadd){return function(_0x2f0110){if(!_0x2f0110){_0x4932d0[_0xa55c('0x26')](0x194);}return _0x2f0110;};}function handleError(_0x1839ac,_0x30d4f8){_0x30d4f8=_0x30d4f8||0x1f4;return function(_0x38ff96){logger[_0xa55c('0x24')](_0x38ff96[_0xa55c('0x32')]);if(_0x38ff96[_0xa55c('0x33')]){delete _0x38ff96['name'];}_0x1839ac['status'](_0x30d4f8)['send'](_0x38ff96);};}exports[_0xa55c('0x34')]=function(_0x18e00e,_0x2bb4f0){var _0x5802e4={},_0x768408={},_0x547930={'count':0x0,'rows':[]};var _0x119220=_['map'](db[_0xa55c('0x35')][_0xa55c('0x36')],function(_0x3c0ec1){return{'name':_0x3c0ec1['fieldName'],'type':_0x3c0ec1[_0xa55c('0x37')][_0xa55c('0x38')]};});_0x768408['model']=_[_0xa55c('0x39')](_0x119220,_0xa55c('0x33'));_0x768408['query']=_['keys'](_0x18e00e[_0xa55c('0x3a')]);_0x768408['filters']=_[_0xa55c('0x3b')](_0x768408[_0xa55c('0x3c')],_0x768408['query']);_0x5802e4['attributes']=_['intersection'](_0x768408['model'],qs[_0xa55c('0x3d')](_0x18e00e[_0xa55c('0x3a')][_0xa55c('0x3d')]));_0x5802e4[_0xa55c('0x3e')]=_0x5802e4[_0xa55c('0x3e')]['length']?_0x5802e4[_0xa55c('0x3e')]:_0x768408[_0xa55c('0x3c')];if(!_0x18e00e[_0xa55c('0x3a')][_0xa55c('0x3f')](_0xa55c('0x40'))){_0x5802e4[_0xa55c('0x2b')]=qs['limit'](_0x18e00e[_0xa55c('0x3a')]['limit']);_0x5802e4['offset']=qs[_0xa55c('0x2a')](_0x18e00e[_0xa55c('0x3a')]['offset']);}_0x5802e4[_0xa55c('0x41')]=qs['sort'](_0x18e00e['query'][_0xa55c('0x42')]);_0x5802e4[_0xa55c('0x43')]=qs[_0xa55c('0x44')](_['pick'](_0x18e00e[_0xa55c('0x3a')],_0x768408[_0xa55c('0x44')]));if(_0x18e00e['query'][_0xa55c('0x45')]){_0x5802e4['where']=_[_0xa55c('0x46')](_0x5802e4[_0xa55c('0x43')],{'$or':_['map'](_0x119220,function(_0x66d1de){if(_0x66d1de[_0xa55c('0x37')]!=='VIRTUAL'){var _0x40c352={};_0x40c352[_0x66d1de[_0xa55c('0x33')]]={'$like':'%'+_0x18e00e[_0xa55c('0x3a')]['filter']+'%'};return _0x40c352;}})});}_0x5802e4=_[_0xa55c('0x46')]({},_0x5802e4,_0x18e00e['options']);var _0x2f9717={'where':_0x5802e4[_0xa55c('0x43')]};return db[_0xa55c('0x35')]['count'](_0x2f9717)[_0xa55c('0x1d')](function(_0x106adb){_0x547930['count']=_0x106adb;if(_0x18e00e[_0xa55c('0x3a')][_0xa55c('0x47')]){_0x5802e4['include']=[{'all':!![]}];}return db[_0xa55c('0x35')][_0xa55c('0x48')](_0x5802e4);})['then'](function(_0x46f839){_0x547930[_0xa55c('0x49')]=_0x46f839;return _0x547930;})[_0xa55c('0x1d')](respondWithFilteredResult(_0x2bb4f0,_0x5802e4))[_0xa55c('0x4a')](handleError(_0x2bb4f0,null));};exports['show']=function(_0x143989,_0x58a7ea){var _0x2157d6={'raw':![],'where':{'id':_0x143989[_0xa55c('0x4b')]['id']}},_0x213100={};_0x213100['model']=_[_0xa55c('0x4c')](db[_0xa55c('0x35')]['rawAttributes']);_0x213100[_0xa55c('0x3a')]=_[_0xa55c('0x4c')](_0x143989[_0xa55c('0x3a')]);_0x213100[_0xa55c('0x44')]=_[_0xa55c('0x3b')](_0x213100[_0xa55c('0x3c')],_0x213100[_0xa55c('0x3a')]);_0x2157d6[_0xa55c('0x3e')]=_[_0xa55c('0x3b')](_0x213100[_0xa55c('0x3c')],qs['fields'](_0x143989[_0xa55c('0x3a')][_0xa55c('0x3d')]));_0x2157d6[_0xa55c('0x3e')]=_0x2157d6['attributes'][_0xa55c('0x4d')]?_0x2157d6[_0xa55c('0x3e')]:_0x213100['model'];if(_0x143989[_0xa55c('0x3a')]['includeAll']){_0x2157d6[_0xa55c('0x4e')]=[{'all':!![]}];}_0x2157d6=_[_0xa55c('0x46')]({},_0x2157d6,_0x143989[_0xa55c('0x4f')]);return db[_0xa55c('0x35')][_0xa55c('0x50')](_0x2157d6)['then'](handleEntityNotFound(_0x58a7ea,null))[_0xa55c('0x1d')](respondWithResult(_0x58a7ea,null))[_0xa55c('0x4a')](handleError(_0x58a7ea,null));};exports['create']=function(_0x3929a6,_0x2291e0){return db[_0xa55c('0x35')][_0xa55c('0x51')](_0x3929a6['body'],{})['then'](respondWithResult(_0x2291e0,0xc9))[_0xa55c('0x4a')](handleError(_0x2291e0,null));};exports[_0xa55c('0x31')]=function(_0x3ca5b8,_0x44ac57){if(_0x3ca5b8['body']['id']){delete _0x3ca5b8[_0xa55c('0x52')]['id'];}return db['ZohoConfiguration'][_0xa55c('0x50')]({'where':{'id':_0x3ca5b8[_0xa55c('0x4b')]['id']}})[_0xa55c('0x1d')](handleEntityNotFound(_0x44ac57,null))[_0xa55c('0x1d')](saveUpdates(_0x3ca5b8[_0xa55c('0x52')],null))['then'](respondWithResult(_0x44ac57,null))[_0xa55c('0x4a')](handleError(_0x44ac57,null));};exports['destroy']=function(_0x23f67f,_0x157afe){return db[_0xa55c('0x35')][_0xa55c('0x50')]({'where':{'id':_0x23f67f[_0xa55c('0x4b')]['id']}})[_0xa55c('0x1d')](handleEntityNotFound(_0x157afe,null))[_0xa55c('0x1d')](removeEntity(_0x157afe,null))['catch'](handleError(_0x157afe,null));};exports[_0xa55c('0x53')]=function(_0x449e00,_0x2f2d21,_0x23a30e){var _0x3fa00f={};var _0x5ba2b0={};var _0xa72718;var _0x3cd40d;return db[_0xa55c('0x35')][_0xa55c('0x54')]({'where':{'id':_0x449e00[_0xa55c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2f2d21,null))[_0xa55c('0x1d')](function(_0x21725b){if(_0x21725b){_0xa72718=_0x21725b;_0x5ba2b0[_0xa55c('0x3c')]=_[_0xa55c('0x4c')](db[_0xa55c('0x55')]['rawAttributes']);_0x5ba2b0[_0xa55c('0x3a')]=_['keys'](_0x449e00[_0xa55c('0x3a')]);_0x5ba2b0['filters']=_[_0xa55c('0x3b')](_0x5ba2b0['model'],_0x5ba2b0[_0xa55c('0x3a')]);_0x3fa00f[_0xa55c('0x3e')]=_[_0xa55c('0x3b')](_0x5ba2b0[_0xa55c('0x3c')],qs[_0xa55c('0x3d')](_0x449e00[_0xa55c('0x3a')][_0xa55c('0x3d')]));_0x3fa00f[_0xa55c('0x3e')]=_0x3fa00f[_0xa55c('0x3e')][_0xa55c('0x4d')]?_0x3fa00f['attributes']:_0x5ba2b0[_0xa55c('0x3c')];_0x3fa00f[_0xa55c('0x41')]=qs['sort'](_0x449e00[_0xa55c('0x3a')][_0xa55c('0x42')]);_0x3fa00f[_0xa55c('0x43')]=qs[_0xa55c('0x44')](_[_0xa55c('0x56')](_0x449e00[_0xa55c('0x3a')],_0x5ba2b0[_0xa55c('0x44')]));if(_0x449e00[_0xa55c('0x3a')]['filter']){_0x3fa00f[_0xa55c('0x43')]=_[_0xa55c('0x46')](_0x3fa00f[_0xa55c('0x43')],{'$or':_[_0xa55c('0x39')](_0x3fa00f[_0xa55c('0x3e')],function(_0x1bcb40){var _0x2f1237={};_0x2f1237[_0x1bcb40]={'$like':'%'+_0x449e00[_0xa55c('0x3a')][_0xa55c('0x45')]+'%'};return _0x2f1237;})});}_0x3fa00f=_['merge']({},_0x3fa00f,_0x449e00[_0xa55c('0x4f')]);return _0xa72718[_0xa55c('0x53')](_0x3fa00f);}})[_0xa55c('0x1d')](function(_0x26606c){if(_0x26606c){_0x3cd40d=_0x26606c[_0xa55c('0x4d')];if(!_0x449e00[_0xa55c('0x3a')][_0xa55c('0x3f')](_0xa55c('0x40'))){_0x3fa00f[_0xa55c('0x2b')]=qs[_0xa55c('0x2b')](_0x449e00[_0xa55c('0x3a')]['limit']);_0x3fa00f[_0xa55c('0x2a')]=qs['offset'](_0x449e00[_0xa55c('0x3a')][_0xa55c('0x2a')]);}return _0xa72718[_0xa55c('0x53')](_0x3fa00f);}})['then'](function(_0x4d9722){if(_0x4d9722){return _0x4d9722?{'count':_0x3cd40d,'rows':_0x4d9722}:null;}})[_0xa55c('0x1d')](respondWithResult(_0x2f2d21,null))[_0xa55c('0x4a')](handleError(_0x2f2d21,null));};exports[_0xa55c('0x57')]=function(_0x42529f,_0x4c7ee1,_0x149cb9){var _0xd02251={};var _0x8ea1c6={};var _0x3a9910;var _0x21fc9b;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x42529f[_0xa55c('0x4b')]['id']}})[_0xa55c('0x1d')](handleEntityNotFound(_0x4c7ee1,null))[_0xa55c('0x1d')](function(_0x36ee32){if(_0x36ee32){_0x3a9910=_0x36ee32;_0x8ea1c6[_0xa55c('0x3c')]=_['keys'](db[_0xa55c('0x55')][_0xa55c('0x36')]);_0x8ea1c6['query']=_[_0xa55c('0x4c')](_0x42529f[_0xa55c('0x3a')]);_0x8ea1c6[_0xa55c('0x44')]=_['intersection'](_0x8ea1c6[_0xa55c('0x3c')],_0x8ea1c6[_0xa55c('0x3a')]);_0xd02251[_0xa55c('0x3e')]=_[_0xa55c('0x3b')](_0x8ea1c6[_0xa55c('0x3c')],qs['fields'](_0x42529f[_0xa55c('0x3a')][_0xa55c('0x3d')]));_0xd02251['attributes']=_0xd02251['attributes'][_0xa55c('0x4d')]?_0xd02251['attributes']:_0x8ea1c6[_0xa55c('0x3c')];_0xd02251[_0xa55c('0x41')]=qs[_0xa55c('0x42')](_0x42529f[_0xa55c('0x3a')][_0xa55c('0x42')]);_0xd02251[_0xa55c('0x43')]=qs[_0xa55c('0x44')](_[_0xa55c('0x56')](_0x42529f[_0xa55c('0x3a')],_0x8ea1c6['filters']));if(_0x42529f[_0xa55c('0x3a')][_0xa55c('0x45')]){_0xd02251[_0xa55c('0x43')]=_[_0xa55c('0x46')](_0xd02251['where'],{'$or':_[_0xa55c('0x39')](_0xd02251[_0xa55c('0x3e')],function(_0x1baa8b){var _0x2298ac={};_0x2298ac[_0x1baa8b]={'$like':'%'+_0x42529f['query']['filter']+'%'};return _0x2298ac;})});}_0xd02251=_[_0xa55c('0x46')]({},_0xd02251,_0x42529f[_0xa55c('0x4f')]);return _0x3a9910[_0xa55c('0x57')](_0xd02251);}})[_0xa55c('0x1d')](function(_0x5e87cb){if(_0x5e87cb){_0x21fc9b=_0x5e87cb['length'];if(!_0x42529f[_0xa55c('0x3a')][_0xa55c('0x3f')](_0xa55c('0x40'))){_0xd02251[_0xa55c('0x2b')]=qs[_0xa55c('0x2b')](_0x42529f[_0xa55c('0x3a')][_0xa55c('0x2b')]);_0xd02251['offset']=qs[_0xa55c('0x2a')](_0x42529f['query'][_0xa55c('0x2a')]);}return _0x3a9910['getSubjects'](_0xd02251);}})[_0xa55c('0x1d')](function(_0x313cdc){if(_0x313cdc){return _0x313cdc?{'count':_0x21fc9b,'rows':_0x313cdc}:null;}})[_0xa55c('0x1d')](respondWithResult(_0x4c7ee1,null))[_0xa55c('0x4a')](handleError(_0x4c7ee1,null));};exports[_0xa55c('0x58')]=function(_0x402f02,_0x1ea5b6,_0x2c71ca){var _0x576a1b={};var _0x59414d={};var _0x14cb74;var _0x2948b1;return db[_0xa55c('0x35')][_0xa55c('0x54')]({'where':{'id':_0x402f02[_0xa55c('0x4b')]['id']}})[_0xa55c('0x1d')](handleEntityNotFound(_0x1ea5b6,null))['then'](function(_0x889869){if(_0x889869){_0x14cb74=_0x889869;_0x59414d[_0xa55c('0x3c')]=_[_0xa55c('0x4c')](db[_0xa55c('0x55')][_0xa55c('0x36')]);_0x59414d[_0xa55c('0x3a')]=_[_0xa55c('0x4c')](_0x402f02[_0xa55c('0x3a')]);_0x59414d['filters']=_[_0xa55c('0x3b')](_0x59414d[_0xa55c('0x3c')],_0x59414d[_0xa55c('0x3a')]);_0x576a1b[_0xa55c('0x3e')]=_[_0xa55c('0x3b')](_0x59414d['model'],qs[_0xa55c('0x3d')](_0x402f02[_0xa55c('0x3a')]['fields']));_0x576a1b['attributes']=_0x576a1b[_0xa55c('0x3e')][_0xa55c('0x4d')]?_0x576a1b['attributes']:_0x59414d['model'];_0x576a1b['order']=qs['sort'](_0x402f02[_0xa55c('0x3a')][_0xa55c('0x42')]);_0x576a1b[_0xa55c('0x43')]=qs[_0xa55c('0x44')](_[_0xa55c('0x56')](_0x402f02[_0xa55c('0x3a')],_0x59414d['filters']));if(_0x402f02[_0xa55c('0x3a')][_0xa55c('0x45')]){_0x576a1b[_0xa55c('0x43')]=_[_0xa55c('0x46')](_0x576a1b['where'],{'$or':_[_0xa55c('0x39')](_0x576a1b[_0xa55c('0x3e')],function(_0x36824c){var _0x4cc104={};_0x4cc104[_0x36824c]={'$like':'%'+_0x402f02[_0xa55c('0x3a')]['filter']+'%'};return _0x4cc104;})});}_0x576a1b=_['merge']({},_0x576a1b,_0x402f02[_0xa55c('0x4f')]);return _0x14cb74[_0xa55c('0x58')](_0x576a1b);}})[_0xa55c('0x1d')](function(_0x249b0c){if(_0x249b0c){_0x2948b1=_0x249b0c[_0xa55c('0x4d')];if(!_0x402f02[_0xa55c('0x3a')][_0xa55c('0x3f')]('nolimit')){_0x576a1b['limit']=qs[_0xa55c('0x2b')](_0x402f02[_0xa55c('0x3a')][_0xa55c('0x2b')]);_0x576a1b[_0xa55c('0x2a')]=qs[_0xa55c('0x2a')](_0x402f02[_0xa55c('0x3a')][_0xa55c('0x2a')]);}return _0x14cb74[_0xa55c('0x58')](_0x576a1b);}})[_0xa55c('0x1d')](function(_0x115fc4){if(_0x115fc4){return _0x115fc4?{'count':_0x2948b1,'rows':_0x115fc4}:null;}})['then'](respondWithResult(_0x1ea5b6,null))[_0xa55c('0x4a')](handleError(_0x1ea5b6,null));}; \ No newline at end of file +var _0x008c=['save','update','stack','name','send','index','ZohoConfiguration','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','merge','options','includeAll','include','findAll','rows','params','create','body','find','getFields','findOne','ZohoField','pick','filter','map','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','ZohoConfiguration,\x20%s,\x20%s','error','message','info','request\x20sent','catch','sendStatus','status','end','count','offset','limit','apply','reject'];(function(_0x579521,_0xba6b09){var _0x206ef7=function(_0x1ca164){while(--_0x1ca164){_0x579521['push'](_0x579521['shift']());}};_0x206ef7(++_0xba6b09);}(_0x008c,0x188));var _0xc008=function(_0x2299e8,_0x3e4063){_0x2299e8=_0x2299e8-0x0;var _0x433c0e=_0x008c[_0x2299e8];return _0x433c0e;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var db=require(_0xc008('0x16'))['db'];var jayson=require(_0xc008('0x17'));var client=jayson[_0xc008('0x18')][_0xc008('0x19')]({'port':0x232a});function checkPasswordPattern(_0x69726e,_0x593f7a,_0x560e28){if(_0x560e28){var _0x33f44c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33f44c['test'](_0x593f7a)){return _0x69726e;}else{throw new db[(_0xc008('0x1a'))][(_0xc008('0x1b'))](_0xc008('0x1c'));}}else{return _0x69726e;}}function respondWithRpcPromise(_0x339ffc,_0x3f0ecf,_0x5ee00b,_0x5e894e){return new BPromise(function(_0x4bd0f4,_0x11ef38){var _0x15a6ad=_0x5e894e||client;return _0x15a6ad[_0xc008('0x1d')](_0x339ffc,_0x5ee00b)[_0xc008('0x1e')](function(_0x4fe771){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x3f0ecf,'request\x20sent');logger[_0xc008('0x1f')](_0xc008('0x20'),_0x3f0ecf,'request\x20sent',JSON[_0xc008('0x21')](_0x4fe771));if(_0x4fe771['error']){if(_0x4fe771['error']['code']===0x1f4){logger['error'](_0xc008('0x22'),_0x3f0ecf,_0x4fe771['error']['message']);return _0x11ef38(_0x4fe771['error']['message']);}logger['error'](_0xc008('0x22'),_0x3f0ecf,_0x4fe771[_0xc008('0x23')][_0xc008('0x24')]);return _0x4bd0f4(_0x4fe771[_0xc008('0x23')][_0xc008('0x24')]);}else{logger[_0xc008('0x25')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f0ecf,_0xc008('0x26'));_0x4bd0f4(_0x4fe771['result']['message']);}})[_0xc008('0x27')](function(_0x36f358){logger[_0xc008('0x23')](_0xc008('0x22'),_0x3f0ecf,_0x36f358);_0x11ef38(_0x36f358);});});}function respondWithStatusCode(_0x5410f5,_0x48582b){_0x48582b=_0x48582b||0xcc;return function(_0x5de1e9){if(_0x5de1e9){return _0x5410f5[_0xc008('0x28')](_0x48582b);}return _0x5410f5[_0xc008('0x29')](_0x48582b)[_0xc008('0x2a')]();};}function respondWithResult(_0x2e31c2,_0x5bebd9){_0x5bebd9=_0x5bebd9||0xc8;return function(_0x5e2aca){if(_0x5e2aca){return _0x2e31c2['status'](_0x5bebd9)['json'](_0x5e2aca);}};}function respondWithFilteredResult(_0x4caaf4,_0x3865c0){return function(_0x29ba43){if(_0x29ba43){var _0x25eae4=_0x29ba43[_0xc008('0x2b')],_0x529961=_0x3865c0[_0xc008('0x2c')],_0x24c14c=_0x3865c0['offset']+_0x3865c0[_0xc008('0x2d')],_0x32390d;if(_0x24c14c>=_0x25eae4){_0x24c14c=_0x25eae4;_0x32390d=0xc8;}else{_0x32390d=0xce;}_0x4caaf4[_0xc008('0x29')](_0x32390d);return _0x4caaf4['set']('Content-Range',_0x529961+'-'+_0x24c14c+'/'+_0x25eae4)['json'](_0x29ba43);}return null;};}function patchUpdates(_0x1032b2){return function(_0x267abd){try{jsonpatch[_0xc008('0x2e')](_0x267abd,_0x1032b2,!![]);}catch(_0x10889f){return BPromise[_0xc008('0x2f')](_0x10889f);}return _0x267abd[_0xc008('0x30')]();};}function saveUpdates(_0x294f97,_0x22d8e8){return function(_0x1fe1e1){if(_0x1fe1e1){return _0x1fe1e1[_0xc008('0x31')](_0x294f97)[_0xc008('0x1e')](function(_0x1ac7c8){return _0x1ac7c8;});}return null;};}function removeEntity(_0x596ee8,_0x334a09){return function(_0x4b7fd4){if(_0x4b7fd4){return _0x4b7fd4['destroy']()[_0xc008('0x1e')](function(){_0x596ee8[_0xc008('0x29')](0xcc)[_0xc008('0x2a')]();});}};}function handleEntityNotFound(_0xca0520,_0xd0e05a){return function(_0x3cd878){if(!_0x3cd878){_0xca0520[_0xc008('0x28')](0x194);}return _0x3cd878;};}function handleError(_0x470e79,_0x29d4b3){_0x29d4b3=_0x29d4b3||0x1f4;return function(_0x4f14d2){logger[_0xc008('0x23')](_0x4f14d2[_0xc008('0x32')]);if(_0x4f14d2[_0xc008('0x33')]){delete _0x4f14d2[_0xc008('0x33')];}_0x470e79[_0xc008('0x29')](_0x29d4b3)[_0xc008('0x34')](_0x4f14d2);};}exports[_0xc008('0x35')]=function(_0x5d0e06,_0x35f360){var _0x21763f={},_0x50e1d4={},_0x399b64={'count':0x0,'rows':[]};var _0x15453c=_['map'](db[_0xc008('0x36')][_0xc008('0x37')],function(_0x280e9b){return{'name':_0x280e9b['fieldName'],'type':_0x280e9b['type']['key']};});_0x50e1d4[_0xc008('0x38')]=_['map'](_0x15453c,_0xc008('0x33'));_0x50e1d4[_0xc008('0x39')]=_[_0xc008('0x3a')](_0x5d0e06[_0xc008('0x39')]);_0x50e1d4[_0xc008('0x3b')]=_[_0xc008('0x3c')](_0x50e1d4[_0xc008('0x38')],_0x50e1d4[_0xc008('0x39')]);_0x21763f[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0x50e1d4[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x5d0e06[_0xc008('0x39')][_0xc008('0x3e')]));_0x21763f['attributes']=_0x21763f[_0xc008('0x3d')][_0xc008('0x3f')]?_0x21763f[_0xc008('0x3d')]:_0x50e1d4[_0xc008('0x38')];if(!_0x5d0e06['query'][_0xc008('0x40')](_0xc008('0x41'))){_0x21763f[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x5d0e06[_0xc008('0x39')]['limit']);_0x21763f[_0xc008('0x2c')]=qs[_0xc008('0x2c')](_0x5d0e06[_0xc008('0x39')][_0xc008('0x2c')]);}_0x21763f[_0xc008('0x42')]=qs['sort'](_0x5d0e06[_0xc008('0x39')][_0xc008('0x43')]);_0x21763f[_0xc008('0x44')]=qs[_0xc008('0x3b')](_['pick'](_0x5d0e06[_0xc008('0x39')],_0x50e1d4[_0xc008('0x3b')]));if(_0x5d0e06[_0xc008('0x39')]['filter']){_0x21763f[_0xc008('0x44')]=_['merge'](_0x21763f[_0xc008('0x44')],{'$or':_['map'](_0x15453c,function(_0x46fa8f){if(_0x46fa8f[_0xc008('0x45')]!=='VIRTUAL'){var _0x31007c={};_0x31007c[_0x46fa8f[_0xc008('0x33')]]={'$like':'%'+_0x5d0e06[_0xc008('0x39')]['filter']+'%'};return _0x31007c;}})});}_0x21763f=_[_0xc008('0x46')]({},_0x21763f,_0x5d0e06[_0xc008('0x47')]);var _0x200469={'where':_0x21763f[_0xc008('0x44')]};return db[_0xc008('0x36')][_0xc008('0x2b')](_0x200469)['then'](function(_0x47cafa){_0x399b64['count']=_0x47cafa;if(_0x5d0e06[_0xc008('0x39')][_0xc008('0x48')]){_0x21763f[_0xc008('0x49')]=[{'all':!![]}];}return db[_0xc008('0x36')][_0xc008('0x4a')](_0x21763f);})[_0xc008('0x1e')](function(_0x2cf641){_0x399b64[_0xc008('0x4b')]=_0x2cf641;return _0x399b64;})['then'](respondWithFilteredResult(_0x35f360,_0x21763f))['catch'](handleError(_0x35f360,null));};exports['show']=function(_0x2d5a49,_0x2651cf){var _0x158eae={'raw':![],'where':{'id':_0x2d5a49[_0xc008('0x4c')]['id']}},_0x511383={};_0x511383[_0xc008('0x38')]=_[_0xc008('0x3a')](db[_0xc008('0x36')][_0xc008('0x37')]);_0x511383[_0xc008('0x39')]=_[_0xc008('0x3a')](_0x2d5a49[_0xc008('0x39')]);_0x511383[_0xc008('0x3b')]=_[_0xc008('0x3c')](_0x511383['model'],_0x511383['query']);_0x158eae[_0xc008('0x3d')]=_['intersection'](_0x511383[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x2d5a49[_0xc008('0x39')]['fields']));_0x158eae[_0xc008('0x3d')]=_0x158eae[_0xc008('0x3d')][_0xc008('0x3f')]?_0x158eae[_0xc008('0x3d')]:_0x511383[_0xc008('0x38')];if(_0x2d5a49['query'][_0xc008('0x48')]){_0x158eae[_0xc008('0x49')]=[{'all':!![]}];}_0x158eae=_['merge']({},_0x158eae,_0x2d5a49[_0xc008('0x47')]);return db[_0xc008('0x36')]['find'](_0x158eae)['then'](handleEntityNotFound(_0x2651cf,null))[_0xc008('0x1e')](respondWithResult(_0x2651cf,null))[_0xc008('0x27')](handleError(_0x2651cf,null));};exports[_0xc008('0x4d')]=function(_0x30d0aa,_0x14b6a0){return db['ZohoConfiguration']['create'](_0x30d0aa[_0xc008('0x4e')],{})['then'](respondWithResult(_0x14b6a0,0xc9))[_0xc008('0x27')](handleError(_0x14b6a0,null));};exports[_0xc008('0x31')]=function(_0xf94fcb,_0x2f1105){if(_0xf94fcb[_0xc008('0x4e')]['id']){delete _0xf94fcb[_0xc008('0x4e')]['id'];}return db['ZohoConfiguration'][_0xc008('0x4f')]({'where':{'id':_0xf94fcb[_0xc008('0x4c')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x2f1105,null))[_0xc008('0x1e')](saveUpdates(_0xf94fcb[_0xc008('0x4e')],null))['then'](respondWithResult(_0x2f1105,null))[_0xc008('0x27')](handleError(_0x2f1105,null));};exports['destroy']=function(_0x535e6e,_0x5dbfca){return db[_0xc008('0x36')][_0xc008('0x4f')]({'where':{'id':_0x535e6e[_0xc008('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5dbfca,null))[_0xc008('0x1e')](removeEntity(_0x5dbfca,null))[_0xc008('0x27')](handleError(_0x5dbfca,null));};exports[_0xc008('0x50')]=function(_0x47a58b,_0x3587c3,_0x1092cb){var _0x12ba3f={};var _0x1b5a22={};var _0x5baff1;var _0x4022dd;return db['ZohoConfiguration'][_0xc008('0x51')]({'where':{'id':_0x47a58b[_0xc008('0x4c')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x3587c3,null))[_0xc008('0x1e')](function(_0x192c87){if(_0x192c87){_0x5baff1=_0x192c87;_0x1b5a22[_0xc008('0x38')]=_['keys'](db[_0xc008('0x52')]['rawAttributes']);_0x1b5a22['query']=_[_0xc008('0x3a')](_0x47a58b[_0xc008('0x39')]);_0x1b5a22['filters']=_[_0xc008('0x3c')](_0x1b5a22[_0xc008('0x38')],_0x1b5a22[_0xc008('0x39')]);_0x12ba3f[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0x1b5a22[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x47a58b['query'][_0xc008('0x3e')]));_0x12ba3f[_0xc008('0x3d')]=_0x12ba3f[_0xc008('0x3d')][_0xc008('0x3f')]?_0x12ba3f[_0xc008('0x3d')]:_0x1b5a22[_0xc008('0x38')];_0x12ba3f[_0xc008('0x42')]=qs[_0xc008('0x43')](_0x47a58b[_0xc008('0x39')][_0xc008('0x43')]);_0x12ba3f[_0xc008('0x44')]=qs[_0xc008('0x3b')](_[_0xc008('0x53')](_0x47a58b[_0xc008('0x39')],_0x1b5a22['filters']));if(_0x47a58b[_0xc008('0x39')][_0xc008('0x54')]){_0x12ba3f[_0xc008('0x44')]=_['merge'](_0x12ba3f[_0xc008('0x44')],{'$or':_[_0xc008('0x55')](_0x12ba3f['attributes'],function(_0x53765c){var _0x1a03fd={};_0x1a03fd[_0x53765c]={'$like':'%'+_0x47a58b[_0xc008('0x39')][_0xc008('0x54')]+'%'};return _0x1a03fd;})});}_0x12ba3f=_[_0xc008('0x46')]({},_0x12ba3f,_0x47a58b[_0xc008('0x47')]);return _0x5baff1[_0xc008('0x50')](_0x12ba3f);}})[_0xc008('0x1e')](function(_0x38191e){if(_0x38191e){_0x4022dd=_0x38191e[_0xc008('0x3f')];if(!_0x47a58b[_0xc008('0x39')][_0xc008('0x40')]('nolimit')){_0x12ba3f[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x47a58b[_0xc008('0x39')][_0xc008('0x2d')]);_0x12ba3f['offset']=qs[_0xc008('0x2c')](_0x47a58b['query'][_0xc008('0x2c')]);}return _0x5baff1[_0xc008('0x50')](_0x12ba3f);}})[_0xc008('0x1e')](function(_0x4ccffe){if(_0x4ccffe){return _0x4ccffe?{'count':_0x4022dd,'rows':_0x4ccffe}:null;}})[_0xc008('0x1e')](respondWithResult(_0x3587c3,null))[_0xc008('0x27')](handleError(_0x3587c3,null));};exports[_0xc008('0x56')]=function(_0x553f5c,_0x35b28a,_0x539fc8){var _0x50ee03={};var _0xee7a85={};var _0x23012c;var _0x6fe732;return db[_0xc008('0x36')]['findOne']({'where':{'id':_0x553f5c[_0xc008('0x4c')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x35b28a,null))['then'](function(_0x3efb77){if(_0x3efb77){_0x23012c=_0x3efb77;_0xee7a85['model']=_[_0xc008('0x3a')](db['ZohoField'][_0xc008('0x37')]);_0xee7a85['query']=_[_0xc008('0x3a')](_0x553f5c[_0xc008('0x39')]);_0xee7a85[_0xc008('0x3b')]=_[_0xc008('0x3c')](_0xee7a85['model'],_0xee7a85[_0xc008('0x39')]);_0x50ee03[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0xee7a85[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x553f5c[_0xc008('0x39')][_0xc008('0x3e')]));_0x50ee03[_0xc008('0x3d')]=_0x50ee03['attributes'][_0xc008('0x3f')]?_0x50ee03['attributes']:_0xee7a85['model'];_0x50ee03['order']=qs[_0xc008('0x43')](_0x553f5c[_0xc008('0x39')][_0xc008('0x43')]);_0x50ee03[_0xc008('0x44')]=qs[_0xc008('0x3b')](_[_0xc008('0x53')](_0x553f5c[_0xc008('0x39')],_0xee7a85[_0xc008('0x3b')]));if(_0x553f5c[_0xc008('0x39')]['filter']){_0x50ee03[_0xc008('0x44')]=_[_0xc008('0x46')](_0x50ee03[_0xc008('0x44')],{'$or':_[_0xc008('0x55')](_0x50ee03[_0xc008('0x3d')],function(_0x3b2669){var _0x23d4ff={};_0x23d4ff[_0x3b2669]={'$like':'%'+_0x553f5c[_0xc008('0x39')][_0xc008('0x54')]+'%'};return _0x23d4ff;})});}_0x50ee03=_[_0xc008('0x46')]({},_0x50ee03,_0x553f5c[_0xc008('0x47')]);return _0x23012c[_0xc008('0x56')](_0x50ee03);}})['then'](function(_0x4e7af3){if(_0x4e7af3){_0x6fe732=_0x4e7af3[_0xc008('0x3f')];if(!_0x553f5c[_0xc008('0x39')][_0xc008('0x40')]('nolimit')){_0x50ee03[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x553f5c['query']['limit']);_0x50ee03['offset']=qs[_0xc008('0x2c')](_0x553f5c[_0xc008('0x39')][_0xc008('0x2c')]);}return _0x23012c[_0xc008('0x56')](_0x50ee03);}})[_0xc008('0x1e')](function(_0x44f515){if(_0x44f515){return _0x44f515?{'count':_0x6fe732,'rows':_0x44f515}:null;}})[_0xc008('0x1e')](respondWithResult(_0x35b28a,null))[_0xc008('0x27')](handleError(_0x35b28a,null));};exports[_0xc008('0x57')]=function(_0x1e7a11,_0x52091b,_0x57b8ad){var _0xc644fe={};var _0x31ebde={};var _0x3f3dcf;var _0x3f1e41;return db[_0xc008('0x36')][_0xc008('0x51')]({'where':{'id':_0x1e7a11['params']['id']}})['then'](handleEntityNotFound(_0x52091b,null))[_0xc008('0x1e')](function(_0x391425){if(_0x391425){_0x3f3dcf=_0x391425;_0x31ebde[_0xc008('0x38')]=_['keys'](db['ZohoField']['rawAttributes']);_0x31ebde['query']=_['keys'](_0x1e7a11['query']);_0x31ebde[_0xc008('0x3b')]=_['intersection'](_0x31ebde[_0xc008('0x38')],_0x31ebde['query']);_0xc644fe[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0x31ebde[_0xc008('0x38')],qs['fields'](_0x1e7a11['query'][_0xc008('0x3e')]));_0xc644fe['attributes']=_0xc644fe[_0xc008('0x3d')][_0xc008('0x3f')]?_0xc644fe['attributes']:_0x31ebde[_0xc008('0x38')];_0xc644fe['order']=qs['sort'](_0x1e7a11[_0xc008('0x39')][_0xc008('0x43')]);_0xc644fe['where']=qs[_0xc008('0x3b')](_[_0xc008('0x53')](_0x1e7a11[_0xc008('0x39')],_0x31ebde['filters']));if(_0x1e7a11[_0xc008('0x39')][_0xc008('0x54')]){_0xc644fe[_0xc008('0x44')]=_[_0xc008('0x46')](_0xc644fe[_0xc008('0x44')],{'$or':_[_0xc008('0x55')](_0xc644fe['attributes'],function(_0x6dfd99){var _0xdaff5b={};_0xdaff5b[_0x6dfd99]={'$like':'%'+_0x1e7a11[_0xc008('0x39')]['filter']+'%'};return _0xdaff5b;})});}_0xc644fe=_[_0xc008('0x46')]({},_0xc644fe,_0x1e7a11[_0xc008('0x47')]);return _0x3f3dcf[_0xc008('0x57')](_0xc644fe);}})['then'](function(_0x48c38b){if(_0x48c38b){_0x3f1e41=_0x48c38b['length'];if(!_0x1e7a11[_0xc008('0x39')][_0xc008('0x40')](_0xc008('0x41'))){_0xc644fe[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x1e7a11[_0xc008('0x39')][_0xc008('0x2d')]);_0xc644fe[_0xc008('0x2c')]=qs['offset'](_0x1e7a11[_0xc008('0x39')][_0xc008('0x2c')]);}return _0x3f3dcf['getDescriptions'](_0xc644fe);}})['then'](function(_0x2257b0){if(_0x2257b0){return _0x2257b0?{'count':_0x3f1e41,'rows':_0x2257b0}:null;}})[_0xc008('0x1e')](respondWithResult(_0x52091b,null))[_0xc008('0x27')](handleError(_0x52091b,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index ade8e36..3b456b3 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 _0x86be=['../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x461be8,_0x410e0e){var _0x3bd70b=function(_0x3f3dd3){while(--_0x3f3dd3){_0x461be8['push'](_0x461be8['shift']());}};_0x3bd70b(++_0x410e0e);}(_0x86be,0xba));var _0xe86b=function(_0x241139,_0x586312){_0x241139=_0x241139-0x0;var _0x12c047=_0x86be[_0x241139];return _0x12c047;};'use strict';var _=require(_0xe86b('0x0'));var util=require('util');var logger=require(_0xe86b('0x1'))(_0xe86b('0x2'));var moment=require(_0xe86b('0x3'));var BPromise=require(_0xe86b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe86b('0x5'));var rimraf=require('rimraf');var config=require(_0xe86b('0x6'));var attributes=require(_0xe86b('0x7'));module[_0xe86b('0x8')]=function(_0x9b11ce,_0x859b21){return _0x9b11ce[_0xe86b('0x9')](_0xe86b('0xa'),attributes,{'tableName':_0xe86b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd49e=['rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x36e4e0,_0x112828){var _0x5bfb39=function(_0x505265){while(--_0x505265){_0x36e4e0['push'](_0x36e4e0['shift']());}};_0x5bfb39(++_0x112828);}(_0xd49e,0x10f));var _0xed49=function(_0x3480e9,_0x1ce980){_0x3480e9=_0x3480e9-0x0;var _0x389aad=_0xd49e[_0x3480e9];return _0x389aad;};'use strict';var _=require(_0xed49('0x0'));var util=require('util');var logger=require(_0xed49('0x1'))(_0xed49('0x2'));var moment=require(_0xed49('0x3'));var BPromise=require(_0xed49('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xed49('0x5'));var config=require(_0xed49('0x6'));var attributes=require(_0xed49('0x7'));module[_0xed49('0x8')]=function(_0x611c29,_0x537909){return _0x611c29[_0xed49('0x9')](_0xed49('0xa'),attributes,{'tableName':_0xed49('0xb'),'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 676d058..93cdddc 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 _0xbe80=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment'];(function(_0x590af7,_0x51fe4f){var _0x3ad972=function(_0x1c15de){while(--_0x1c15de){_0x590af7['push'](_0x590af7['shift']());}};_0x3ad972(++_0x51fe4f);}(_0xbe80,0xca));var _0x0be8=function(_0x53bf67,_0x1c257a){_0x53bf67=_0x53bf67-0x0;var _0x2c32d4=_0xbe80[_0x53bf67];return _0x2c32d4;};'use strict';var _=require('lodash');var util=require(_0x0be8('0x0'));var moment=require(_0x0be8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0be8('0x2'))['db'];var utils=require(_0x0be8('0x3'));var logger=require(_0x0be8('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0be8('0x5'));var client=jayson[_0x0be8('0x6')][_0x0be8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2c654d,_0x19e6e7,_0x580127){return new BPromise(function(_0x4d8489,_0x19a52d){return client[_0x0be8('0x8')](_0x2c654d,_0x580127)['then'](function(_0x252155){logger['info'](_0x0be8('0x9'),_0x19e6e7,'request\x20sent');logger['debug'](_0x0be8('0xa'),_0x19e6e7,_0x0be8('0xb'),JSON[_0x0be8('0xc')](_0x252155));if(_0x252155[_0x0be8('0xd')]){if(_0x252155[_0x0be8('0xd')][_0x0be8('0xe')]===0x1f4){logger[_0x0be8('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x19e6e7,_0x252155['error'][_0x0be8('0xf')]);return _0x19a52d(_0x252155[_0x0be8('0xd')]['message']);}logger[_0x0be8('0xd')](_0x0be8('0x9'),_0x19e6e7,_0x252155['error'][_0x0be8('0xf')]);return _0x4d8489(_0x252155[_0x0be8('0xd')][_0x0be8('0xf')]);}else{logger['info'](_0x0be8('0x9'),_0x19e6e7,_0x0be8('0xb'));_0x4d8489(_0x252155['result']['message']);}})[_0x0be8('0x10')](function(_0x280595){logger['error'](_0x0be8('0x9'),_0x19e6e7,_0x280595);_0x19a52d(_0x280595);});});} \ No newline at end of file +var _0xd615=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','lodash','util','moment','bluebird'];(function(_0x127c7b,_0x1f65e7){var _0x1708eb=function(_0x2033e5){while(--_0x2033e5){_0x127c7b['push'](_0x127c7b['shift']());}};_0x1708eb(++_0x1f65e7);}(_0xd615,0x146));var _0x5d61=function(_0x25f47a,_0x251275){_0x25f47a=_0x25f47a-0x0;var _0x5b94b7=_0xd615[_0x25f47a];return _0x5b94b7;};'use strict';var _=require(_0x5d61('0x0'));var util=require(_0x5d61('0x1'));var moment=require(_0x5d61('0x2'));var BPromise=require(_0x5d61('0x3'));var rs=require(_0x5d61('0x4'));var fs=require('fs');var Redis=require(_0x5d61('0x5'));var db=require(_0x5d61('0x6'))['db'];var utils=require(_0x5d61('0x7'));var logger=require(_0x5d61('0x8'))(_0x5d61('0x9'));var config=require(_0x5d61('0xa'));var jayson=require(_0x5d61('0xb'));var client=jayson[_0x5d61('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c9c3,_0x1247ac,_0x322214){return new BPromise(function(_0xe55b1d,_0x56220f){return client[_0x5d61('0xd')](_0x2c9c3,_0x322214)[_0x5d61('0xe')](function(_0x2618e7){logger[_0x5d61('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x1247ac,_0x5d61('0x10'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x1247ac,_0x5d61('0x10'),JSON[_0x5d61('0x11')](_0x2618e7));if(_0x2618e7[_0x5d61('0x12')]){if(_0x2618e7[_0x5d61('0x12')][_0x5d61('0x13')]===0x1f4){logger[_0x5d61('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x1247ac,_0x2618e7[_0x5d61('0x12')]['message']);return _0x56220f(_0x2618e7[_0x5d61('0x12')][_0x5d61('0x14')]);}logger[_0x5d61('0x12')](_0x5d61('0x15'),_0x1247ac,_0x2618e7['error'][_0x5d61('0x14')]);return _0xe55b1d(_0x2618e7[_0x5d61('0x12')]['message']);}else{logger[_0x5d61('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x1247ac,_0x5d61('0x10'));_0xe55b1d(_0x2618e7['result']['message']);}})['catch'](function(_0x5b4e0d){logger[_0x5d61('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x1247ac,_0x5b4e0d);_0x56220f(_0x5b4e0d);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index dc73d7c..18fdbef 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 _0x3a6d=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x22c30c,_0x2efb84){var _0x455333=function(_0x218786){while(--_0x218786){_0x22c30c['push'](_0x22c30c['shift']());}};_0x455333(++_0x2efb84);}(_0x3a6d,0x143));var _0xd3a6=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x3a6d[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var path=require('path');var timeout=require(_0xd3a6('0x2'));var express=require(_0xd3a6('0x3'));var router=express[_0xd3a6('0x4')]();var auth=require(_0xd3a6('0x5'));var interaction=require(_0xd3a6('0x6'));var config=require('../../config/environment');var controller=require(_0xd3a6('0x7'));router[_0xd3a6('0x8')]('/',auth[_0xd3a6('0x9')](),controller[_0xd3a6('0xa')]);router[_0xd3a6('0x8')](_0xd3a6('0xb'),auth['isAuthenticated'](),controller[_0xd3a6('0xc')]);router[_0xd3a6('0xd')]('/',auth[_0xd3a6('0x9')](),controller[_0xd3a6('0xe')]);router[_0xd3a6('0xf')](_0xd3a6('0xb'),auth[_0xd3a6('0x9')](),controller[_0xd3a6('0x10')]);router[_0xd3a6('0x11')]('/:id',auth[_0xd3a6('0x9')](),controller[_0xd3a6('0x12')]);module[_0xd3a6('0x13')]=router; \ No newline at end of file +var _0x33af=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','update','delete','exports','util','connect-timeout','express','Router'];(function(_0x3a3b7a,_0x23d440){var _0x2644ef=function(_0x2f2f33){while(--_0x2f2f33){_0x3a3b7a['push'](_0x3a3b7a['shift']());}};_0x2644ef(++_0x23d440);}(_0x33af,0xec));var _0xf33a=function(_0x2f57b2,_0xa8e91a){_0x2f57b2=_0x2f57b2-0x0;var _0x5ace77=_0x33af[_0x2f57b2];return _0x5ace77;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var auth=require(_0xf33a('0x4'));var interaction=require(_0xf33a('0x5'));var config=require(_0xf33a('0x6'));var controller=require('./intZohoField.controller');router[_0xf33a('0x7')]('/',auth[_0xf33a('0x8')](),controller['index']);router[_0xf33a('0x7')](_0xf33a('0x9'),auth[_0xf33a('0x8')](),controller[_0xf33a('0xa')]);router[_0xf33a('0xb')]('/',auth[_0xf33a('0x8')](),controller['create']);router[_0xf33a('0xc')](_0xf33a('0x9'),auth[_0xf33a('0x8')](),controller[_0xf33a('0xd')]);router[_0xf33a('0xe')](_0xf33a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xf33a('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 19b8d3d..250ce1a 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 _0xf15e=['customVariable','keyValue','STRING','sequelize','ENUM','string','variable'];(function(_0x145dfd,_0x5748fe){var _0x53943d=function(_0x5d4a2){while(--_0x5d4a2){_0x145dfd['push'](_0x145dfd['shift']());}};_0x53943d(++_0x5748fe);}(_0xf15e,0xb9));var _0xef15=function(_0x5abba5,_0x29183d){_0x5abba5=_0x5abba5-0x0;var _0x2fff81=_0xf15e[_0x5abba5];return _0x2fff81;};'use strict';var Sequelize=require(_0xef15('0x0'));module['exports']={'type':{'type':Sequelize[_0xef15('0x1')](_0xef15('0x2'),_0xef15('0x3'),_0xef15('0x4'),_0xef15('0x5')),'defaultValue':_0xef15('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xef15('0x6')]},'keyType':{'type':Sequelize[_0xef15('0x1')](_0xef15('0x2'),_0xef15('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xef15('0x6')]},'idField':{'type':Sequelize[_0xef15('0x6')]},'nameField':{'type':Sequelize[_0xef15('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xef15('0x6')]}}; \ No newline at end of file +var _0xf452=['sequelize','exports','string','variable','customVariable','keyValue','STRING','ENUM','BOOLEAN'];(function(_0x1aa6c8,_0x217f57){var _0x595e85=function(_0x539db4){while(--_0x539db4){_0x1aa6c8['push'](_0x1aa6c8['shift']());}};_0x595e85(++_0x217f57);}(_0xf452,0x13b));var _0x2f45=function(_0x45c40c,_0x355c84){_0x45c40c=_0x45c40c-0x0;var _0x22ead7=_0xf452[_0x45c40c];return _0x22ead7;};'use strict';var Sequelize=require(_0x2f45('0x0'));module[_0x2f45('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2f45('0x2'),_0x2f45('0x3'),_0x2f45('0x4'),_0x2f45('0x5')),'defaultValue':_0x2f45('0x2')},'content':{'type':Sequelize[_0x2f45('0x6')]},'key':{'type':Sequelize[_0x2f45('0x6')]},'keyType':{'type':Sequelize[_0x2f45('0x7')](_0x2f45('0x2'),_0x2f45('0x3'),_0x2f45('0x4'))},'keyContent':{'type':Sequelize[_0x2f45('0x6')]},'idField':{'type':Sequelize[_0x2f45('0x6')]},'nameField':{'type':Sequelize[_0x2f45('0x6')]},'customField':{'type':Sequelize[_0x2f45('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2f45('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index da44fc9..8835bf1 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 _0x6e13=['path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','show','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x1aa74d,_0x641ec8){var _0x84d43b=function(_0x54695e){while(--_0x54695e){_0x1aa74d['push'](_0x1aa74d['shift']());}};_0x84d43b(++_0x641ec8);}(_0x6e13,0x124));var _0x36e1=function(_0x2a0f8f,_0x2c2836){_0x2a0f8f=_0x2a0f8f-0x0;var _0x2993fa=_0x6e13[_0x2a0f8f];return _0x2993fa;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x36e1('0x0'));var rimraf=require(_0x36e1('0x1'));var zipdir=require(_0x36e1('0x2'));var jsonpatch=require(_0x36e1('0x3'));var rp=require(_0x36e1('0x4'));var moment=require(_0x36e1('0x5'));var BPromise=require(_0x36e1('0x6'));var Mustache=require('mustache');var util=require(_0x36e1('0x7'));var path=require(_0x36e1('0x8'));var sox=require(_0x36e1('0x9'));var csv=require('to-csv');var ejs=require(_0x36e1('0xa'));var fs=require('fs');var _=require(_0x36e1('0xb'));var squel=require(_0x36e1('0xc'));var crypto=require('crypto');var jsforce=require(_0x36e1('0xd'));var deskjs=require(_0x36e1('0xe'));var toCsv=require(_0x36e1('0xf'));var querystring=require(_0x36e1('0x10'));var Papa=require(_0x36e1('0x11'));var Redis=require(_0x36e1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x36e1('0x13'));var as=require(_0x36e1('0x14'));var hardwareService=require(_0x36e1('0x15'));var logger=require(_0x36e1('0x16'))(_0x36e1('0x17'));var utils=require('../../config/utils');var config=require(_0x36e1('0x18'));var db=require(_0x36e1('0x19'))['db'];function respondWithStatusCode(_0x4abb9b,_0x225923){_0x225923=_0x225923||0xcc;return function(_0x19471f){if(_0x19471f){return _0x4abb9b[_0x36e1('0x1a')](_0x225923);}return _0x4abb9b[_0x36e1('0x1b')](_0x225923)[_0x36e1('0x1c')]();};}function respondWithResult(_0xef8eb6,_0x23fb9a){_0x23fb9a=_0x23fb9a||0xc8;return function(_0x18d56f){if(_0x18d56f){return _0xef8eb6['status'](_0x23fb9a)[_0x36e1('0x1d')](_0x18d56f);}};}function respondWithFilteredResult(_0x5719b6,_0x1d499e){return function(_0x3c892a){if(_0x3c892a){var _0x5df40b=_0x3c892a[_0x36e1('0x1e')],_0x18c5d4=_0x1d499e[_0x36e1('0x1f')],_0x4ca29b=_0x1d499e[_0x36e1('0x1f')]+_0x1d499e['limit'],_0x3ef60d;if(_0x4ca29b>=_0x5df40b){_0x4ca29b=_0x5df40b;_0x3ef60d=0xc8;}else{_0x3ef60d=0xce;}_0x5719b6['status'](_0x3ef60d);return _0x5719b6[_0x36e1('0x20')](_0x36e1('0x21'),_0x18c5d4+'-'+_0x4ca29b+'/'+_0x5df40b)[_0x36e1('0x1d')](_0x3c892a);}return null;};}function patchUpdates(_0x4cab53){return function(_0x12c0f0){try{jsonpatch['apply'](_0x12c0f0,_0x4cab53,!![]);}catch(_0x1f6d68){return BPromise['reject'](_0x1f6d68);}return _0x12c0f0[_0x36e1('0x22')]();};}function saveUpdates(_0x53305c,_0x4e5204){return function(_0x300edf){if(_0x300edf){return _0x300edf[_0x36e1('0x23')](_0x53305c)[_0x36e1('0x24')](function(_0x281ced){return _0x281ced;});}return null;};}function removeEntity(_0x71daba,_0x579b9c){return function(_0x212e11){if(_0x212e11){return _0x212e11[_0x36e1('0x25')]()[_0x36e1('0x24')](function(){_0x71daba[_0x36e1('0x1b')](0xcc)[_0x36e1('0x1c')]();});}};}function handleEntityNotFound(_0x1bb959,_0x2e7dae){return function(_0x4354a3){if(!_0x4354a3){_0x1bb959['sendStatus'](0x194);}return _0x4354a3;};}function handleError(_0x4e8946,_0x2cfdcc){_0x2cfdcc=_0x2cfdcc||0x1f4;return function(_0x1c042b){logger[_0x36e1('0x26')](_0x1c042b[_0x36e1('0x27')]);if(_0x1c042b[_0x36e1('0x28')]){delete _0x1c042b[_0x36e1('0x28')];}_0x4e8946[_0x36e1('0x1b')](_0x2cfdcc)['send'](_0x1c042b);};}exports[_0x36e1('0x29')]=function(_0x18148e,_0x496867){var _0x48c91e={},_0x20042a={},_0x31c3a7={'count':0x0,'rows':[]};var _0x8fbd0b=_[_0x36e1('0x2a')](db[_0x36e1('0x2b')][_0x36e1('0x2c')],function(_0x17a4b7){return{'name':_0x17a4b7[_0x36e1('0x2d')],'type':_0x17a4b7[_0x36e1('0x2e')][_0x36e1('0x2f')]};});_0x20042a[_0x36e1('0x30')]=_[_0x36e1('0x2a')](_0x8fbd0b,_0x36e1('0x28'));_0x20042a[_0x36e1('0x31')]=_[_0x36e1('0x32')](_0x18148e[_0x36e1('0x31')]);_0x20042a[_0x36e1('0x33')]=_[_0x36e1('0x34')](_0x20042a[_0x36e1('0x30')],_0x20042a[_0x36e1('0x31')]);_0x48c91e[_0x36e1('0x35')]=_['intersection'](_0x20042a[_0x36e1('0x30')],qs[_0x36e1('0x36')](_0x18148e[_0x36e1('0x31')][_0x36e1('0x36')]));_0x48c91e['attributes']=_0x48c91e[_0x36e1('0x35')][_0x36e1('0x37')]?_0x48c91e[_0x36e1('0x35')]:_0x20042a[_0x36e1('0x30')];if(!_0x18148e['query'][_0x36e1('0x38')](_0x36e1('0x39'))){_0x48c91e['limit']=qs[_0x36e1('0x3a')](_0x18148e[_0x36e1('0x31')][_0x36e1('0x3a')]);_0x48c91e['offset']=qs[_0x36e1('0x1f')](_0x18148e['query'][_0x36e1('0x1f')]);}_0x48c91e[_0x36e1('0x3b')]=qs[_0x36e1('0x3c')](_0x18148e[_0x36e1('0x31')][_0x36e1('0x3c')]);_0x48c91e[_0x36e1('0x3d')]=qs[_0x36e1('0x33')](_[_0x36e1('0x3e')](_0x18148e[_0x36e1('0x31')],_0x20042a['filters']));if(_0x18148e['query'][_0x36e1('0x3f')]){_0x48c91e[_0x36e1('0x3d')]=_['merge'](_0x48c91e[_0x36e1('0x3d')],{'$or':_[_0x36e1('0x2a')](_0x8fbd0b,function(_0x24680b){if(_0x24680b[_0x36e1('0x2e')]!==_0x36e1('0x40')){var _0x2363f1={};_0x2363f1[_0x24680b[_0x36e1('0x28')]]={'$like':'%'+_0x18148e[_0x36e1('0x31')][_0x36e1('0x3f')]+'%'};return _0x2363f1;}})});}_0x48c91e=_[_0x36e1('0x41')]({},_0x48c91e,_0x18148e[_0x36e1('0x42')]);var _0x3ab592={'where':_0x48c91e['where']};return db['ZohoField'][_0x36e1('0x1e')](_0x3ab592)['then'](function(_0x201819){_0x31c3a7[_0x36e1('0x1e')]=_0x201819;if(_0x18148e[_0x36e1('0x31')]['includeAll']){_0x48c91e[_0x36e1('0x43')]=[{'all':!![]}];}return db[_0x36e1('0x2b')][_0x36e1('0x44')](_0x48c91e);})[_0x36e1('0x24')](function(_0x9867be){_0x31c3a7['rows']=_0x9867be;return _0x31c3a7;})['then'](respondWithFilteredResult(_0x496867,_0x48c91e))[_0x36e1('0x45')](handleError(_0x496867,null));};exports[_0x36e1('0x46')]=function(_0x2d241c,_0x36ead0){var _0x2e4c5b={'raw':!![],'where':{'id':_0x2d241c['params']['id']}},_0x28eeee={};_0x28eeee[_0x36e1('0x30')]=_[_0x36e1('0x32')](db[_0x36e1('0x2b')][_0x36e1('0x2c')]);_0x28eeee[_0x36e1('0x31')]=_['keys'](_0x2d241c[_0x36e1('0x31')]);_0x28eeee[_0x36e1('0x33')]=_[_0x36e1('0x34')](_0x28eeee[_0x36e1('0x30')],_0x28eeee['query']);_0x2e4c5b[_0x36e1('0x35')]=_[_0x36e1('0x34')](_0x28eeee['model'],qs[_0x36e1('0x36')](_0x2d241c[_0x36e1('0x31')]['fields']));_0x2e4c5b[_0x36e1('0x35')]=_0x2e4c5b[_0x36e1('0x35')][_0x36e1('0x37')]?_0x2e4c5b[_0x36e1('0x35')]:_0x28eeee['model'];if(_0x2d241c[_0x36e1('0x31')][_0x36e1('0x47')]){_0x2e4c5b[_0x36e1('0x43')]=[{'all':!![]}];}_0x2e4c5b=_[_0x36e1('0x41')]({},_0x2e4c5b,_0x2d241c[_0x36e1('0x42')]);return db['ZohoField'][_0x36e1('0x48')](_0x2e4c5b)[_0x36e1('0x24')](handleEntityNotFound(_0x36ead0,null))[_0x36e1('0x24')](respondWithResult(_0x36ead0,null))[_0x36e1('0x45')](handleError(_0x36ead0,null));};exports[_0x36e1('0x49')]=function(_0x2e23dc,_0x4602cb){return db['ZohoField'][_0x36e1('0x49')](_0x2e23dc[_0x36e1('0x4a')],{})[_0x36e1('0x24')](respondWithResult(_0x4602cb,0xc9))[_0x36e1('0x45')](handleError(_0x4602cb,null));};exports[_0x36e1('0x23')]=function(_0x496cd2,_0x1544a7){if(_0x496cd2[_0x36e1('0x4a')]['id']){delete _0x496cd2[_0x36e1('0x4a')]['id'];}return db[_0x36e1('0x2b')]['find']({'where':{'id':_0x496cd2['params']['id']}})['then'](handleEntityNotFound(_0x1544a7,null))[_0x36e1('0x24')](saveUpdates(_0x496cd2[_0x36e1('0x4a')],null))[_0x36e1('0x24')](respondWithResult(_0x1544a7,null))['catch'](handleError(_0x1544a7,null));};exports[_0x36e1('0x25')]=function(_0x3a1983,_0x122230){return db[_0x36e1('0x2b')][_0x36e1('0x48')]({'where':{'id':_0x3a1983['params']['id']}})[_0x36e1('0x24')](handleEntityNotFound(_0x122230,null))[_0x36e1('0x24')](removeEntity(_0x122230,null))[_0x36e1('0x45')](handleError(_0x122230,null));}; \ No newline at end of file +var _0x16eb=['name','send','index','map','ZohoField','fieldName','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','type','VIRTUAL','options','count','includeAll','include','findAll','catch','show','rawAttributes','fields','merge','find','create','body','params','destroy','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','Content-Range','reject','save','update','then','error'];(function(_0x2ff83c,_0x388b41){var _0x3c851e=function(_0x2c5243){while(--_0x2c5243){_0x2ff83c['push'](_0x2ff83c['shift']());}};_0x3c851e(++_0x388b41);}(_0x16eb,0x6c));var _0xb16e=function(_0x48f5f7,_0x56d17e){_0x48f5f7=_0x48f5f7-0x0;var _0x18b17f=_0x16eb[_0x48f5f7];return _0x18b17f;};'use strict';var pdf=require(_0xb16e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb16e('0x1'));var zipdir=require(_0xb16e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb16e('0x3'));var BPromise=require(_0xb16e('0x4'));var Mustache=require(_0xb16e('0x5'));var util=require(_0xb16e('0x6'));var path=require(_0xb16e('0x7'));var sox=require(_0xb16e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb16e('0x9'));var squel=require(_0xb16e('0xa'));var crypto=require(_0xb16e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb16e('0xc'));var querystring=require(_0xb16e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb16e('0xe'));var qs=require(_0xb16e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb16e('0x10'));var logger=require(_0xb16e('0x11'))(_0xb16e('0x12'));var utils=require(_0xb16e('0x13'));var config=require(_0xb16e('0x14'));var db=require(_0xb16e('0x15'))['db'];function respondWithStatusCode(_0x56bee7,_0x5464af){_0x5464af=_0x5464af||0xcc;return function(_0x5ee3c1){if(_0x5ee3c1){return _0x56bee7[_0xb16e('0x16')](_0x5464af);}return _0x56bee7[_0xb16e('0x17')](_0x5464af)[_0xb16e('0x18')]();};}function respondWithResult(_0x3442e4,_0x5b9109){_0x5b9109=_0x5b9109||0xc8;return function(_0x458331){if(_0x458331){return _0x3442e4[_0xb16e('0x17')](_0x5b9109)['json'](_0x458331);}};}function respondWithFilteredResult(_0x46a469,_0xe7cc02){return function(_0x4237e3){if(_0x4237e3){var _0x4e93a2=_0x4237e3['count'],_0x277df7=_0xe7cc02[_0xb16e('0x19')],_0x410968=_0xe7cc02[_0xb16e('0x19')]+_0xe7cc02['limit'],_0x59a233;if(_0x410968>=_0x4e93a2){_0x410968=_0x4e93a2;_0x59a233=0xc8;}else{_0x59a233=0xce;}_0x46a469[_0xb16e('0x17')](_0x59a233);return _0x46a469['set'](_0xb16e('0x1a'),_0x277df7+'-'+_0x410968+'/'+_0x4e93a2)['json'](_0x4237e3);}return null;};}function patchUpdates(_0x2fe035){return function(_0x46dc38){try{jsonpatch['apply'](_0x46dc38,_0x2fe035,!![]);}catch(_0x3d7b9a){return BPromise[_0xb16e('0x1b')](_0x3d7b9a);}return _0x46dc38[_0xb16e('0x1c')]();};}function saveUpdates(_0x15111c,_0x4bf079){return function(_0x148b5f){if(_0x148b5f){return _0x148b5f[_0xb16e('0x1d')](_0x15111c)[_0xb16e('0x1e')](function(_0x3583d7){return _0x3583d7;});}return null;};}function removeEntity(_0xa54339,_0xf5cae3){return function(_0x5b81d0){if(_0x5b81d0){return _0x5b81d0['destroy']()[_0xb16e('0x1e')](function(){_0xa54339[_0xb16e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x494717,_0x5dcf9f){return function(_0x350110){if(!_0x350110){_0x494717[_0xb16e('0x16')](0x194);}return _0x350110;};}function handleError(_0x509089,_0x28e546){_0x28e546=_0x28e546||0x1f4;return function(_0xa31159){logger[_0xb16e('0x1f')](_0xa31159['stack']);if(_0xa31159['name']){delete _0xa31159[_0xb16e('0x20')];}_0x509089[_0xb16e('0x17')](_0x28e546)[_0xb16e('0x21')](_0xa31159);};}exports[_0xb16e('0x22')]=function(_0xfd971f,_0x586700){var _0x24bfb5={},_0x169e55={},_0x5985ac={'count':0x0,'rows':[]};var _0x4359b9=_[_0xb16e('0x23')](db[_0xb16e('0x24')]['rawAttributes'],function(_0x2479ca){return{'name':_0x2479ca[_0xb16e('0x25')],'type':_0x2479ca['type'][_0xb16e('0x26')]};});_0x169e55[_0xb16e('0x27')]=_[_0xb16e('0x23')](_0x4359b9,_0xb16e('0x20'));_0x169e55['query']=_[_0xb16e('0x28')](_0xfd971f[_0xb16e('0x29')]);_0x169e55[_0xb16e('0x2a')]=_[_0xb16e('0x2b')](_0x169e55[_0xb16e('0x27')],_0x169e55['query']);_0x24bfb5[_0xb16e('0x2c')]=_[_0xb16e('0x2b')](_0x169e55[_0xb16e('0x27')],qs['fields'](_0xfd971f['query']['fields']));_0x24bfb5[_0xb16e('0x2c')]=_0x24bfb5['attributes'][_0xb16e('0x2d')]?_0x24bfb5[_0xb16e('0x2c')]:_0x169e55[_0xb16e('0x27')];if(!_0xfd971f['query'][_0xb16e('0x2e')](_0xb16e('0x2f'))){_0x24bfb5[_0xb16e('0x30')]=qs['limit'](_0xfd971f['query'][_0xb16e('0x30')]);_0x24bfb5[_0xb16e('0x19')]=qs[_0xb16e('0x19')](_0xfd971f[_0xb16e('0x29')]['offset']);}_0x24bfb5['order']=qs[_0xb16e('0x31')](_0xfd971f[_0xb16e('0x29')][_0xb16e('0x31')]);_0x24bfb5['where']=qs[_0xb16e('0x2a')](_[_0xb16e('0x32')](_0xfd971f[_0xb16e('0x29')],_0x169e55['filters']));if(_0xfd971f[_0xb16e('0x29')][_0xb16e('0x33')]){_0x24bfb5[_0xb16e('0x34')]=_['merge'](_0x24bfb5[_0xb16e('0x34')],{'$or':_['map'](_0x4359b9,function(_0x22aa40){if(_0x22aa40[_0xb16e('0x35')]!==_0xb16e('0x36')){var _0x4b55f5={};_0x4b55f5[_0x22aa40['name']]={'$like':'%'+_0xfd971f[_0xb16e('0x29')][_0xb16e('0x33')]+'%'};return _0x4b55f5;}})});}_0x24bfb5=_['merge']({},_0x24bfb5,_0xfd971f[_0xb16e('0x37')]);var _0x507c44={'where':_0x24bfb5[_0xb16e('0x34')]};return db['ZohoField'][_0xb16e('0x38')](_0x507c44)[_0xb16e('0x1e')](function(_0x154902){_0x5985ac[_0xb16e('0x38')]=_0x154902;if(_0xfd971f['query'][_0xb16e('0x39')]){_0x24bfb5[_0xb16e('0x3a')]=[{'all':!![]}];}return db[_0xb16e('0x24')][_0xb16e('0x3b')](_0x24bfb5);})[_0xb16e('0x1e')](function(_0x1d09b4){_0x5985ac['rows']=_0x1d09b4;return _0x5985ac;})[_0xb16e('0x1e')](respondWithFilteredResult(_0x586700,_0x24bfb5))[_0xb16e('0x3c')](handleError(_0x586700,null));};exports[_0xb16e('0x3d')]=function(_0xf07018,_0x3aec85){var _0x1a55af={'raw':!![],'where':{'id':_0xf07018['params']['id']}},_0x5786e8={};_0x5786e8[_0xb16e('0x27')]=_['keys'](db[_0xb16e('0x24')][_0xb16e('0x3e')]);_0x5786e8['query']=_[_0xb16e('0x28')](_0xf07018[_0xb16e('0x29')]);_0x5786e8[_0xb16e('0x2a')]=_[_0xb16e('0x2b')](_0x5786e8[_0xb16e('0x27')],_0x5786e8['query']);_0x1a55af[_0xb16e('0x2c')]=_['intersection'](_0x5786e8['model'],qs[_0xb16e('0x3f')](_0xf07018[_0xb16e('0x29')][_0xb16e('0x3f')]));_0x1a55af[_0xb16e('0x2c')]=_0x1a55af[_0xb16e('0x2c')][_0xb16e('0x2d')]?_0x1a55af[_0xb16e('0x2c')]:_0x5786e8[_0xb16e('0x27')];if(_0xf07018['query'][_0xb16e('0x39')]){_0x1a55af[_0xb16e('0x3a')]=[{'all':!![]}];}_0x1a55af=_[_0xb16e('0x40')]({},_0x1a55af,_0xf07018[_0xb16e('0x37')]);return db[_0xb16e('0x24')][_0xb16e('0x41')](_0x1a55af)[_0xb16e('0x1e')](handleEntityNotFound(_0x3aec85,null))['then'](respondWithResult(_0x3aec85,null))[_0xb16e('0x3c')](handleError(_0x3aec85,null));};exports[_0xb16e('0x42')]=function(_0xffacbc,_0x5d90d2){return db[_0xb16e('0x24')]['create'](_0xffacbc[_0xb16e('0x43')],{})[_0xb16e('0x1e')](respondWithResult(_0x5d90d2,0xc9))[_0xb16e('0x3c')](handleError(_0x5d90d2,null));};exports[_0xb16e('0x1d')]=function(_0x5d0e8a,_0x261cb7){if(_0x5d0e8a[_0xb16e('0x43')]['id']){delete _0x5d0e8a[_0xb16e('0x43')]['id'];}return db[_0xb16e('0x24')][_0xb16e('0x41')]({'where':{'id':_0x5d0e8a[_0xb16e('0x44')]['id']}})[_0xb16e('0x1e')](handleEntityNotFound(_0x261cb7,null))[_0xb16e('0x1e')](saveUpdates(_0x5d0e8a['body'],null))['then'](respondWithResult(_0x261cb7,null))['catch'](handleError(_0x261cb7,null));};exports[_0xb16e('0x45')]=function(_0x1ad4a6,_0x1efc57){return db[_0xb16e('0x24')][_0xb16e('0x41')]({'where':{'id':_0x1ad4a6[_0xb16e('0x44')]['id']}})[_0xb16e('0x1e')](handleEntityNotFound(_0x1efc57,null))[_0xb16e('0x1e')](removeEntity(_0x1efc57,null))['catch'](handleError(_0x1efc57,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index a8953e0..96ea58a 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 _0xd267=['bluebird','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','zoho_unique_index','idField','FieldId','lodash','util','api','moment'];(function(_0xb3ca4a,_0x1cc12e){var _0x350ef4=function(_0x40417c){while(--_0x40417c){_0xb3ca4a['push'](_0xb3ca4a['shift']());}};_0x350ef4(++_0x1cc12e);}(_0xd267,0xf8));var _0x7d26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd267[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7d26('0x0'));var util=require(_0x7d26('0x1'));var logger=require('../../config/logger')(_0x7d26('0x2'));var moment=require(_0x7d26('0x3'));var BPromise=require(_0x7d26('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d26('0x5'));var rimraf=require(_0x7d26('0x6'));var config=require(_0x7d26('0x7'));var attributes=require(_0x7d26('0x8'));module[_0x7d26('0x9')]=function(_0x1f2e22,_0x29d784){return _0x1f2e22[_0x7d26('0xa')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x7d26('0xb'),'fields':[_0x7d26('0xc'),_0x7d26('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3d8f=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','int_zoho_fields','zoho_unique_index'];(function(_0x4a26c1,_0x48e32c){var _0x592413=function(_0x1a3083){while(--_0x1a3083){_0x4a26c1['push'](_0x4a26c1['shift']());}};_0x592413(++_0x48e32c);}(_0x3d8f,0x108));var _0xf3d8=function(_0x1e16e0,_0x4d4b18){_0x1e16e0=_0x1e16e0-0x0;var _0x50deb1=_0x3d8f[_0x1e16e0];return _0x50deb1;};'use strict';var _=require(_0xf3d8('0x0'));var util=require(_0xf3d8('0x1'));var logger=require('../../config/logger')(_0xf3d8('0x2'));var moment=require(_0xf3d8('0x3'));var BPromise=require(_0xf3d8('0x4'));var rp=require(_0xf3d8('0x5'));var fs=require('fs');var path=require(_0xf3d8('0x6'));var rimraf=require('rimraf');var config=require(_0xf3d8('0x7'));var attributes=require('./intZohoField.attributes');module[_0xf3d8('0x8')]=function(_0x156fb8,_0x5c7a62){return _0x156fb8[_0xf3d8('0x9')]('ZohoField',attributes,{'tableName':_0xf3d8('0xa'),'paranoid':![],'indexes':[{'name':_0xf3d8('0xb'),'fields':['idField','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 5e135fb..7aad9df 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 _0x5636=['code','ZohoField,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5636,0x102));var _0x6563=function(_0x35432e,_0x2861fd){_0x35432e=_0x35432e-0x0;var _0x10075d=_0x5636[_0x35432e];return _0x10075d;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('ZohoField,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('ZohoField,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('ZohoField,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});} \ No newline at end of file +var _0x425d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x1f471e,_0x5dc2cf){var _0x3a5aff=function(_0x2d2b81){while(--_0x2d2b81){_0x1f471e['push'](_0x1f471e['shift']());}};_0x3a5aff(++_0x5dc2cf);}(_0x425d,0x1e0));var _0xd425=function(_0x37e0a8,_0x184bc8){_0x37e0a8=_0x37e0a8-0x0;var _0x5ca63c=_0x425d[_0x37e0a8];return _0x5ca63c;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var moment=require(_0xd425('0x1'));var BPromise=require(_0xd425('0x2'));var rs=require(_0xd425('0x3'));var fs=require('fs');var Redis=require(_0xd425('0x4'));var db=require(_0xd425('0x5'))['db'];var utils=require(_0xd425('0x6'));var logger=require(_0xd425('0x7'))('rpc');var config=require(_0xd425('0x8'));var jayson=require(_0xd425('0x9'));var client=jayson[_0xd425('0xa')][_0xd425('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d97d9,_0x1d2ed0,_0x50b061){return new BPromise(function(_0xb6ba8e,_0x374c3d){return client[_0xd425('0xc')](_0x1d97d9,_0x50b061)[_0xd425('0xd')](function(_0x2db9da){logger[_0xd425('0xe')](_0xd425('0xf'),_0x1d2ed0,_0xd425('0x10'));logger[_0xd425('0x11')](_0xd425('0x12'),_0x1d2ed0,_0xd425('0x10'),JSON[_0xd425('0x13')](_0x2db9da));if(_0x2db9da[_0xd425('0x14')]){if(_0x2db9da[_0xd425('0x14')][_0xd425('0x15')]===0x1f4){logger[_0xd425('0x14')](_0xd425('0xf'),_0x1d2ed0,_0x2db9da[_0xd425('0x14')][_0xd425('0x16')]);return _0x374c3d(_0x2db9da[_0xd425('0x14')]['message']);}logger[_0xd425('0x14')](_0xd425('0xf'),_0x1d2ed0,_0x2db9da[_0xd425('0x14')]['message']);return _0xb6ba8e(_0x2db9da[_0xd425('0x14')][_0xd425('0x16')]);}else{logger[_0xd425('0xe')](_0xd425('0xf'),_0x1d2ed0,_0xd425('0x10'));_0xb6ba8e(_0x2db9da['result'][_0xd425('0x16')]);}})[_0xd425('0x17')](function(_0x7e267e){logger[_0xd425('0x14')]('ZohoField,\x20%s,\x20%s',_0x1d2ed0,_0x7e267e);_0x374c3d(_0x7e267e);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 7443052..e71e7fa 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 _0xf717=['../../config/environment','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x596102,_0xf1607b){var _0x560896=function(_0x13f08f){while(--_0x13f08f){_0x596102['push'](_0x596102['shift']());}};_0x560896(++_0xf1607b);}(_0xf717,0xb6));var _0x7f71=function(_0xefe03a,_0x44da22){_0xefe03a=_0xefe03a-0x0;var _0x30ccad=_0xf717[_0xefe03a];return _0x30ccad;};'use strict';var multer=require(_0x7f71('0x0'));var util=require(_0x7f71('0x1'));var path=require(_0x7f71('0x2'));var timeout=require(_0x7f71('0x3'));var express=require(_0x7f71('0x4'));var router=express[_0x7f71('0x5')]();var auth=require(_0x7f71('0x6'));var interaction=require(_0x7f71('0x7'));var config=require(_0x7f71('0x8'));module[_0x7f71('0x9')]=router; \ No newline at end of file +var _0x56af=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','multer'];(function(_0x4a6362,_0x9e782a){var _0x2653a5=function(_0x52b12b){while(--_0x52b12b){_0x4a6362['push'](_0x4a6362['shift']());}};_0x2653a5(++_0x9e782a);}(_0x56af,0x16f));var _0xf56a=function(_0x31d37c,_0x572b1f){_0x31d37c=_0x31d37c-0x0;var _0x25c904=_0x56af[_0x31d37c];return _0x25c904;};'use strict';var multer=require(_0xf56a('0x0'));var util=require(_0xf56a('0x1'));var path=require(_0xf56a('0x2'));var timeout=require(_0xf56a('0x3'));var express=require(_0xf56a('0x4'));var router=express[_0xf56a('0x5')]();var auth=require(_0xf56a('0x6'));var interaction=require(_0xf56a('0x7'));var config=require('../../config/environment');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 cc07df6..0ca762b 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 _0x0dd6=['exports','STRING','unique_name_and_version','INTEGER','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0dd6,0x1ea));var _0x60dd=function(_0x1cc7a2,_0x16c5c6){_0x1cc7a2=_0x1cc7a2-0x0;var _0x17dcd2=_0x0dd6[_0x1cc7a2];return _0x17dcd2;};'use strict';var Sequelize=require('sequelize');module[_0x60dd('0x0')]={'name':{'type':Sequelize[_0x60dd('0x1')],'allowNull':![],'unique':_0x60dd('0x2')},'version':{'type':Sequelize[_0x60dd('0x1')],'allowNull':![],'unique':_0x60dd('0x2')},'main':{'type':Sequelize[_0x60dd('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x60dd('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x60dd('0x1')]},'size':{'type':Sequelize[_0x60dd('0x3')]},'active':{'type':Sequelize[_0x60dd('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x60dd('0x1')]},'state':{'type':Sequelize[_0x60dd('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x60dd('0x1')]},'title':{'type':Sequelize[_0x60dd('0x1')]},'remoteUri':{'type':Sequelize[_0x60dd('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x3a33=['unique_name_and_version','STRING','app.js','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x51ed2d,_0x2af8fd){var _0x44efe9=function(_0x561395){while(--_0x561395){_0x51ed2d['push'](_0x51ed2d['shift']());}};_0x44efe9(++_0x2af8fd);}(_0x3a33,0x1e8));var _0x33a3=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x3a33[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require(_0x33a3('0x0'));module[_0x33a3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x33a3('0x2')},'version':{'type':Sequelize[_0x33a3('0x3')],'allowNull':![],'unique':_0x33a3('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x33a3('0x4')},'filename':{'type':Sequelize[_0x33a3('0x3')]},'path':{'type':Sequelize[_0x33a3('0x3')]},'type':{'type':Sequelize[_0x33a3('0x3')]},'size':{'type':Sequelize[_0x33a3('0x5')]},'active':{'type':Sequelize[_0x33a3('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x33a3('0x3')]},'logo':{'type':Sequelize[_0x33a3('0x3')]},'state':{'type':Sequelize[_0x33a3('0x3')],'unique':'state'},'description':{'type':Sequelize[_0x33a3('0x3')]},'title':{'type':Sequelize[_0x33a3('0x3')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index ef863df..6ba3a57 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 _0xc646=['apply','update','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Integration','includeAll','findAll','rows','catch','show','params','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','Content-Range','json'];(function(_0x19e08e,_0x178f46){var _0x14c229=function(_0x791b3b){while(--_0x791b3b){_0x19e08e['push'](_0x19e08e['shift']());}};_0x14c229(++_0x178f46);}(_0xc646,0x195));var _0x6c64=function(_0x389318,_0x13a53d){_0x389318=_0x389318-0x0;var _0x7919e3=_0xc646[_0x389318];return _0x7919e3;};'use strict';var pdf=require(_0x6c64('0x0'));var emlformat=require(_0x6c64('0x1'));var rimraf=require(_0x6c64('0x2'));var zipdir=require(_0x6c64('0x3'));var jsonpatch=require(_0x6c64('0x4'));var rp=require(_0x6c64('0x5'));var moment=require(_0x6c64('0x6'));var BPromise=require(_0x6c64('0x7'));var Mustache=require(_0x6c64('0x8'));var util=require(_0x6c64('0x9'));var path=require(_0x6c64('0xa'));var sox=require('sox');var csv=require(_0x6c64('0xb'));var ejs=require(_0x6c64('0xc'));var fs=require('fs');var _=require(_0x6c64('0xd'));var squel=require(_0x6c64('0xe'));var crypto=require(_0x6c64('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6c64('0xb'));var querystring=require(_0x6c64('0x10'));var Papa=require(_0x6c64('0x11'));var Redis=require(_0x6c64('0x12'));var authService=require(_0x6c64('0x13'));var qs=require(_0x6c64('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c64('0x15'));var logger=require('../../config/logger')(_0x6c64('0x16'));var utils=require(_0x6c64('0x17'));var config=require(_0x6c64('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x238635,_0x398284){_0x398284=_0x398284||0xcc;return function(_0x256af8){if(_0x256af8){return _0x238635[_0x6c64('0x19')](_0x398284);}return _0x238635[_0x6c64('0x1a')](_0x398284)[_0x6c64('0x1b')]();};}function respondWithResult(_0x1dc3d5,_0xf1be50){_0xf1be50=_0xf1be50||0xc8;return function(_0x5bc836){if(_0x5bc836){return _0x1dc3d5[_0x6c64('0x1a')](_0xf1be50)['json'](_0x5bc836);}};}function respondWithFilteredResult(_0x2c0abf,_0x356a76){return function(_0x3379c4){if(_0x3379c4){var _0x475939=_0x3379c4[_0x6c64('0x1c')],_0x15ccbb=_0x356a76['offset'],_0xe611b=_0x356a76[_0x6c64('0x1d')]+_0x356a76[_0x6c64('0x1e')],_0x2b76af;if(_0xe611b>=_0x475939){_0xe611b=_0x475939;_0x2b76af=0xc8;}else{_0x2b76af=0xce;}_0x2c0abf['status'](_0x2b76af);return _0x2c0abf['set'](_0x6c64('0x1f'),_0x15ccbb+'-'+_0xe611b+'/'+_0x475939)[_0x6c64('0x20')](_0x3379c4);}return null;};}function patchUpdates(_0x40ace9){return function(_0x3d7259){try{jsonpatch[_0x6c64('0x21')](_0x3d7259,_0x40ace9,!![]);}catch(_0xb599db){return BPromise['reject'](_0xb599db);}return _0x3d7259['save']();};}function saveUpdates(_0x1f13ec,_0x12cc77){return function(_0x9b14c6){if(_0x9b14c6){return _0x9b14c6[_0x6c64('0x22')](_0x1f13ec)[_0x6c64('0x23')](function(_0xf051e7){return _0xf051e7;});}return null;};}function removeEntity(_0x818b66,_0x3d129e){return function(_0x43e0db){if(_0x43e0db){return _0x43e0db['destroy']()['then'](function(){_0x818b66[_0x6c64('0x1a')](0xcc)[_0x6c64('0x1b')]();});}};}function handleEntityNotFound(_0x21c514,_0x52f1e8){return function(_0x3a131f){if(!_0x3a131f){_0x21c514[_0x6c64('0x19')](0x194);}return _0x3a131f;};}function handleError(_0x54a1d7,_0x23720b){_0x23720b=_0x23720b||0x1f4;return function(_0xd86eb9){logger[_0x6c64('0x24')](_0xd86eb9[_0x6c64('0x25')]);if(_0xd86eb9['name']){delete _0xd86eb9[_0x6c64('0x26')];}_0x54a1d7[_0x6c64('0x1a')](_0x23720b)[_0x6c64('0x27')](_0xd86eb9);};}exports[_0x6c64('0x28')]=function(_0x317436,_0x1f98d4){var _0x27dfd2={},_0x13f6a0={},_0x45ccbf={'count':0x0,'rows':[]};var _0x4cdcdc=_[_0x6c64('0x29')](db['Integration'][_0x6c64('0x2a')],function(_0x56218e){return{'name':_0x56218e['fieldName'],'type':_0x56218e[_0x6c64('0x2b')][_0x6c64('0x2c')]};});_0x13f6a0[_0x6c64('0x2d')]=_['map'](_0x4cdcdc,_0x6c64('0x26'));_0x13f6a0[_0x6c64('0x2e')]=_[_0x6c64('0x2f')](_0x317436['query']);_0x13f6a0[_0x6c64('0x30')]=_[_0x6c64('0x31')](_0x13f6a0['model'],_0x13f6a0[_0x6c64('0x2e')]);_0x27dfd2[_0x6c64('0x32')]=_['intersection'](_0x13f6a0[_0x6c64('0x2d')],qs[_0x6c64('0x33')](_0x317436[_0x6c64('0x2e')]['fields']));_0x27dfd2['attributes']=_0x27dfd2[_0x6c64('0x32')][_0x6c64('0x34')]?_0x27dfd2[_0x6c64('0x32')]:_0x13f6a0[_0x6c64('0x2d')];if(!_0x317436[_0x6c64('0x2e')][_0x6c64('0x35')](_0x6c64('0x36'))){_0x27dfd2[_0x6c64('0x1e')]=qs[_0x6c64('0x1e')](_0x317436[_0x6c64('0x2e')][_0x6c64('0x1e')]);_0x27dfd2[_0x6c64('0x1d')]=qs[_0x6c64('0x1d')](_0x317436['query'][_0x6c64('0x1d')]);}_0x27dfd2['order']=qs[_0x6c64('0x37')](_0x317436[_0x6c64('0x2e')]['sort']);_0x27dfd2[_0x6c64('0x38')]=qs[_0x6c64('0x30')](_[_0x6c64('0x39')](_0x317436['query'],_0x13f6a0[_0x6c64('0x30')]));if(_0x317436['query'][_0x6c64('0x3a')]){_0x27dfd2[_0x6c64('0x38')]=_[_0x6c64('0x3b')](_0x27dfd2[_0x6c64('0x38')],{'$or':_[_0x6c64('0x29')](_0x4cdcdc,function(_0x5c1704){if(_0x5c1704[_0x6c64('0x2b')]!==_0x6c64('0x3c')){var _0x5a1de0={};_0x5a1de0[_0x5c1704[_0x6c64('0x26')]]={'$like':'%'+_0x317436[_0x6c64('0x2e')][_0x6c64('0x3a')]+'%'};return _0x5a1de0;}})});}_0x27dfd2=_['merge']({},_0x27dfd2,_0x317436[_0x6c64('0x3d')]);var _0x3770b7={'where':_0x27dfd2['where']};return db[_0x6c64('0x3e')]['count'](_0x3770b7)[_0x6c64('0x23')](function(_0x317851){_0x45ccbf[_0x6c64('0x1c')]=_0x317851;if(_0x317436['query'][_0x6c64('0x3f')]){_0x27dfd2['include']=[{'all':!![]}];}return db['Integration'][_0x6c64('0x40')](_0x27dfd2);})[_0x6c64('0x23')](function(_0xdf6f61){_0x45ccbf[_0x6c64('0x41')]=_0xdf6f61;return _0x45ccbf;})[_0x6c64('0x23')](respondWithFilteredResult(_0x1f98d4,_0x27dfd2))[_0x6c64('0x42')](handleError(_0x1f98d4,null));};exports[_0x6c64('0x43')]=function(_0xbabcc5,_0x3757d4){var _0x248b11={'raw':![],'where':{'id':_0xbabcc5[_0x6c64('0x44')]['id']}},_0x22ff28={};_0x22ff28[_0x6c64('0x2d')]=_[_0x6c64('0x2f')](db[_0x6c64('0x3e')][_0x6c64('0x2a')]);_0x22ff28['query']=_[_0x6c64('0x2f')](_0xbabcc5[_0x6c64('0x2e')]);_0x22ff28[_0x6c64('0x30')]=_[_0x6c64('0x31')](_0x22ff28['model'],_0x22ff28[_0x6c64('0x2e')]);_0x248b11[_0x6c64('0x32')]=_['intersection'](_0x22ff28['model'],qs[_0x6c64('0x33')](_0xbabcc5[_0x6c64('0x2e')][_0x6c64('0x33')]));_0x248b11['attributes']=_0x248b11['attributes'][_0x6c64('0x34')]?_0x248b11[_0x6c64('0x32')]:_0x22ff28[_0x6c64('0x2d')];if(_0xbabcc5[_0x6c64('0x2e')][_0x6c64('0x3f')]){_0x248b11[_0x6c64('0x45')]=[{'all':!![]}];}_0x248b11=_['merge']({},_0x248b11,_0xbabcc5[_0x6c64('0x3d')]);return db['Integration'][_0x6c64('0x46')](_0x248b11)[_0x6c64('0x23')](handleEntityNotFound(_0x3757d4,null))[_0x6c64('0x23')](respondWithResult(_0x3757d4,null))['catch'](handleError(_0x3757d4,null));};exports[_0x6c64('0x47')]=function(_0x5c83ef,_0x2e75dd){return db[_0x6c64('0x3e')][_0x6c64('0x47')](_0x5c83ef['body'],{})['then'](respondWithResult(_0x2e75dd,0xc9))[_0x6c64('0x42')](handleError(_0x2e75dd,null));};exports[_0x6c64('0x22')]=function(_0x506a95,_0x150085){if(_0x506a95[_0x6c64('0x48')]['id']){delete _0x506a95['body']['id'];}return db[_0x6c64('0x3e')][_0x6c64('0x46')]({'where':{'id':_0x506a95['params']['id']}})[_0x6c64('0x23')](handleEntityNotFound(_0x150085,null))[_0x6c64('0x23')](saveUpdates(_0x506a95[_0x6c64('0x48')],null))[_0x6c64('0x23')](respondWithResult(_0x150085,null))[_0x6c64('0x42')](handleError(_0x150085,null));};exports['destroy']=function(_0x2172f5,_0x163db5){return db['Integration'][_0x6c64('0x46')]({'where':{'id':_0x2172f5[_0x6c64('0x44')]['id']}})[_0x6c64('0x23')](handleEntityNotFound(_0x163db5,null))[_0x6c64('0x23')](removeEntity(_0x163db5,null))['catch'](handleError(_0x163db5,null));}; \ No newline at end of file +var _0x47d0=['then','destroy','error','stack','name','index','map','Integration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','body','update','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x47d0,0xfb));var _0x047d=function(_0x4af685,_0x1c0969){_0x4af685=_0x4af685-0x0;var _0x5f2e96=_0x47d0[_0x4af685];return _0x5f2e96;};'use strict';var pdf=require(_0x047d('0x0'));var emlformat=require(_0x047d('0x1'));var rimraf=require(_0x047d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x047d('0x3'));var rp=require(_0x047d('0x4'));var moment=require(_0x047d('0x5'));var BPromise=require(_0x047d('0x6'));var Mustache=require(_0x047d('0x7'));var util=require(_0x047d('0x8'));var path=require(_0x047d('0x9'));var sox=require('sox');var csv=require(_0x047d('0xa'));var ejs=require(_0x047d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x047d('0xc'));var crypto=require(_0x047d('0xd'));var jsforce=require(_0x047d('0xe'));var deskjs=require(_0x047d('0xf'));var toCsv=require(_0x047d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x047d('0x10'));var qs=require(_0x047d('0x11'));var as=require(_0x047d('0x12'));var hardwareService=require(_0x047d('0x13'));var logger=require(_0x047d('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x047d('0x15'));var db=require(_0x047d('0x16'))['db'];function respondWithStatusCode(_0x169269,_0x2e9672){_0x2e9672=_0x2e9672||0xcc;return function(_0x4eae61){if(_0x4eae61){return _0x169269[_0x047d('0x17')](_0x2e9672);}return _0x169269[_0x047d('0x18')](_0x2e9672)[_0x047d('0x19')]();};}function respondWithResult(_0x29b836,_0x5306eb){_0x5306eb=_0x5306eb||0xc8;return function(_0x1f6104){if(_0x1f6104){return _0x29b836[_0x047d('0x18')](_0x5306eb)['json'](_0x1f6104);}};}function respondWithFilteredResult(_0xf007ea,_0x34878a){return function(_0x5f2a95){if(_0x5f2a95){var _0x375ebe=_0x5f2a95[_0x047d('0x1a')],_0x2539c4=_0x34878a['offset'],_0x223e0c=_0x34878a[_0x047d('0x1b')]+_0x34878a[_0x047d('0x1c')],_0x239410;if(_0x223e0c>=_0x375ebe){_0x223e0c=_0x375ebe;_0x239410=0xc8;}else{_0x239410=0xce;}_0xf007ea[_0x047d('0x18')](_0x239410);return _0xf007ea[_0x047d('0x1d')](_0x047d('0x1e'),_0x2539c4+'-'+_0x223e0c+'/'+_0x375ebe)[_0x047d('0x1f')](_0x5f2a95);}return null;};}function patchUpdates(_0x4e465e){return function(_0x2bbf40){try{jsonpatch['apply'](_0x2bbf40,_0x4e465e,!![]);}catch(_0x17feb9){return BPromise['reject'](_0x17feb9);}return _0x2bbf40[_0x047d('0x20')]();};}function saveUpdates(_0x192a30,_0x2dac4b){return function(_0x547972){if(_0x547972){return _0x547972['update'](_0x192a30)[_0x047d('0x21')](function(_0x12fb6d){return _0x12fb6d;});}return null;};}function removeEntity(_0x957746,_0x4a9eb8){return function(_0x3153bb){if(_0x3153bb){return _0x3153bb[_0x047d('0x22')]()['then'](function(){_0x957746['status'](0xcc)[_0x047d('0x19')]();});}};}function handleEntityNotFound(_0x1d475c,_0x3961bc){return function(_0x271beb){if(!_0x271beb){_0x1d475c[_0x047d('0x17')](0x194);}return _0x271beb;};}function handleError(_0x52f85c,_0x28dcaf){_0x28dcaf=_0x28dcaf||0x1f4;return function(_0x413a77){logger[_0x047d('0x23')](_0x413a77[_0x047d('0x24')]);if(_0x413a77[_0x047d('0x25')]){delete _0x413a77['name'];}_0x52f85c[_0x047d('0x18')](_0x28dcaf)['send'](_0x413a77);};}exports[_0x047d('0x26')]=function(_0xf4e17e,_0x7f18d4){var _0x36f3c0={},_0xdd5d5c={},_0x4ced42={'count':0x0,'rows':[]};var _0x212743=_[_0x047d('0x27')](db[_0x047d('0x28')][_0x047d('0x29')],function(_0x589b2b){return{'name':_0x589b2b['fieldName'],'type':_0x589b2b[_0x047d('0x2a')][_0x047d('0x2b')]};});_0xdd5d5c[_0x047d('0x2c')]=_[_0x047d('0x27')](_0x212743,'name');_0xdd5d5c[_0x047d('0x2d')]=_['keys'](_0xf4e17e['query']);_0xdd5d5c[_0x047d('0x2e')]=_[_0x047d('0x2f')](_0xdd5d5c[_0x047d('0x2c')],_0xdd5d5c[_0x047d('0x2d')]);_0x36f3c0[_0x047d('0x30')]=_[_0x047d('0x2f')](_0xdd5d5c['model'],qs[_0x047d('0x31')](_0xf4e17e['query'][_0x047d('0x31')]));_0x36f3c0['attributes']=_0x36f3c0[_0x047d('0x30')][_0x047d('0x32')]?_0x36f3c0[_0x047d('0x30')]:_0xdd5d5c['model'];if(!_0xf4e17e['query'][_0x047d('0x33')]('nolimit')){_0x36f3c0['limit']=qs[_0x047d('0x1c')](_0xf4e17e[_0x047d('0x2d')][_0x047d('0x1c')]);_0x36f3c0['offset']=qs[_0x047d('0x1b')](_0xf4e17e[_0x047d('0x2d')][_0x047d('0x1b')]);}_0x36f3c0[_0x047d('0x34')]=qs[_0x047d('0x35')](_0xf4e17e['query'][_0x047d('0x35')]);_0x36f3c0['where']=qs[_0x047d('0x2e')](_[_0x047d('0x36')](_0xf4e17e[_0x047d('0x2d')],_0xdd5d5c['filters']));if(_0xf4e17e[_0x047d('0x2d')]['filter']){_0x36f3c0['where']=_['merge'](_0x36f3c0[_0x047d('0x37')],{'$or':_[_0x047d('0x27')](_0x212743,function(_0x3cf0c6){if(_0x3cf0c6[_0x047d('0x2a')]!==_0x047d('0x38')){var _0x20e37a={};_0x20e37a[_0x3cf0c6[_0x047d('0x25')]]={'$like':'%'+_0xf4e17e[_0x047d('0x2d')]['filter']+'%'};return _0x20e37a;}})});}_0x36f3c0=_['merge']({},_0x36f3c0,_0xf4e17e[_0x047d('0x39')]);var _0x57e5a8={'where':_0x36f3c0[_0x047d('0x37')]};return db[_0x047d('0x28')][_0x047d('0x1a')](_0x57e5a8)[_0x047d('0x21')](function(_0x5c3fcb){_0x4ced42[_0x047d('0x1a')]=_0x5c3fcb;if(_0xf4e17e['query'][_0x047d('0x3a')]){_0x36f3c0[_0x047d('0x3b')]=[{'all':!![]}];}return db[_0x047d('0x28')][_0x047d('0x3c')](_0x36f3c0);})[_0x047d('0x21')](function(_0x58f1c5){_0x4ced42[_0x047d('0x3d')]=_0x58f1c5;return _0x4ced42;})[_0x047d('0x21')](respondWithFilteredResult(_0x7f18d4,_0x36f3c0))[_0x047d('0x3e')](handleError(_0x7f18d4,null));};exports[_0x047d('0x3f')]=function(_0x3e655b,_0x4fd07e){var _0x472190={'raw':![],'where':{'id':_0x3e655b[_0x047d('0x40')]['id']}},_0x495380={};_0x495380[_0x047d('0x2c')]=_[_0x047d('0x41')](db[_0x047d('0x28')][_0x047d('0x29')]);_0x495380[_0x047d('0x2d')]=_[_0x047d('0x41')](_0x3e655b['query']);_0x495380[_0x047d('0x2e')]=_['intersection'](_0x495380[_0x047d('0x2c')],_0x495380[_0x047d('0x2d')]);_0x472190[_0x047d('0x30')]=_[_0x047d('0x2f')](_0x495380[_0x047d('0x2c')],qs[_0x047d('0x31')](_0x3e655b[_0x047d('0x2d')][_0x047d('0x31')]));_0x472190[_0x047d('0x30')]=_0x472190['attributes']['length']?_0x472190[_0x047d('0x30')]:_0x495380[_0x047d('0x2c')];if(_0x3e655b['query'][_0x047d('0x3a')]){_0x472190['include']=[{'all':!![]}];}_0x472190=_[_0x047d('0x42')]({},_0x472190,_0x3e655b[_0x047d('0x39')]);return db[_0x047d('0x28')][_0x047d('0x43')](_0x472190)[_0x047d('0x21')](handleEntityNotFound(_0x4fd07e,null))[_0x047d('0x21')](respondWithResult(_0x4fd07e,null))[_0x047d('0x3e')](handleError(_0x4fd07e,null));};exports[_0x047d('0x44')]=function(_0x1d42ab,_0x55ad21){return db[_0x047d('0x28')][_0x047d('0x44')](_0x1d42ab[_0x047d('0x45')],{})['then'](respondWithResult(_0x55ad21,0xc9))['catch'](handleError(_0x55ad21,null));};exports[_0x047d('0x46')]=function(_0x20aba1,_0x4472c2){if(_0x20aba1[_0x047d('0x45')]['id']){delete _0x20aba1[_0x047d('0x45')]['id'];}return db['Integration'][_0x047d('0x43')]({'where':{'id':_0x20aba1[_0x047d('0x40')]['id']}})[_0x047d('0x21')](handleEntityNotFound(_0x4472c2,null))['then'](saveUpdates(_0x20aba1[_0x047d('0x45')],null))[_0x047d('0x21')](respondWithResult(_0x4472c2,null))[_0x047d('0x3e')](handleError(_0x4472c2,null));};exports['destroy']=function(_0x3636bd,_0xa396){return db['Integration']['find']({'where':{'id':_0x3636bd[_0x047d('0x40')]['id']}})[_0x047d('0x21')](handleEntityNotFound(_0xa396,null))['then'](removeEntity(_0xa396,null))[_0x047d('0x3e')](handleError(_0xa396,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 6a0d546..caad6b7 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 _0xbd58=['path','./integration.attributes','integrations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x92e6a,_0x4c3e17){var _0x687db8=function(_0x1e3cb2){while(--_0x1e3cb2){_0x92e6a['push'](_0x92e6a['shift']());}};_0x687db8(++_0x4c3e17);}(_0xbd58,0x93));var _0x8bd5=function(_0x5436c0,_0x45beac){_0x5436c0=_0x5436c0-0x0;var _0x51a455=_0xbd58[_0x5436c0];return _0x51a455;};'use strict';var _=require(_0x8bd5('0x0'));var util=require(_0x8bd5('0x1'));var logger=require(_0x8bd5('0x2'))('api');var moment=require(_0x8bd5('0x3'));var BPromise=require(_0x8bd5('0x4'));var rp=require(_0x8bd5('0x5'));var fs=require('fs');var path=require(_0x8bd5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8bd5('0x7'));module['exports']=function(_0x95781e,_0x4fbc0e){return _0x95781e['define']('Integration',attributes,{'tableName':_0x8bd5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x79ff=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','lodash','util','../../config/logger'];(function(_0x3c76a1,_0x1c4c41){var _0x31aa8e=function(_0x57b26b){while(--_0x57b26b){_0x3c76a1['push'](_0x3c76a1['shift']());}};_0x31aa8e(++_0x1c4c41);}(_0x79ff,0x1e7));var _0xf79f=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x79ff[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0xf79f('0x0'));var util=require(_0xf79f('0x1'));var logger=require(_0xf79f('0x2'))(_0xf79f('0x3'));var moment=require(_0xf79f('0x4'));var BPromise=require(_0xf79f('0x5'));var rp=require(_0xf79f('0x6'));var fs=require('fs');var path=require(_0xf79f('0x7'));var rimraf=require(_0xf79f('0x8'));var config=require(_0xf79f('0x9'));var attributes=require(_0xf79f('0xa'));module[_0xf79f('0xb')]=function(_0x1adc25,_0x1ea33a){return _0x1adc25[_0xf79f('0xc')](_0xf79f('0xd'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index dfd5cc1..b73c292 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 _0xaf3e=['debug','stringify','error','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Integration,\x20%s,\x20%s','request\x20sent'];(function(_0x440e50,_0x1313b2){var _0x33e75d=function(_0x13b482){while(--_0x13b482){_0x440e50['push'](_0x440e50['shift']());}};_0x33e75d(++_0x1313b2);}(_0xaf3e,0xcf));var _0xeaf3=function(_0x2e3107,_0x25f970){_0x2e3107=_0x2e3107-0x0;var _0x833d69=_0xaf3e[_0x2e3107];return _0x833d69;};'use strict';var _=require(_0xeaf3('0x0'));var util=require(_0xeaf3('0x1'));var moment=require('moment');var BPromise=require(_0xeaf3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeaf3('0x3'));var db=require(_0xeaf3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xeaf3('0x5'))(_0xeaf3('0x6'));var config=require(_0xeaf3('0x7'));var jayson=require(_0xeaf3('0x8'));var client=jayson[_0xeaf3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33071f,_0x1725b7,_0xa51f56){return new BPromise(function(_0x120b24,_0x3d599a){return client[_0xeaf3('0xa')](_0x33071f,_0xa51f56)['then'](function(_0x3e666b){logger['info'](_0xeaf3('0xb'),_0x1725b7,_0xeaf3('0xc'));logger[_0xeaf3('0xd')]('Integration,\x20%s,\x20%s,\x20%s',_0x1725b7,_0xeaf3('0xc'),JSON[_0xeaf3('0xe')](_0x3e666b));if(_0x3e666b['error']){if(_0x3e666b[_0xeaf3('0xf')]['code']===0x1f4){logger[_0xeaf3('0xf')](_0xeaf3('0xb'),_0x1725b7,_0x3e666b[_0xeaf3('0xf')][_0xeaf3('0x10')]);return _0x3d599a(_0x3e666b['error'][_0xeaf3('0x10')]);}logger[_0xeaf3('0xf')](_0xeaf3('0xb'),_0x1725b7,_0x3e666b[_0xeaf3('0xf')]['message']);return _0x120b24(_0x3e666b[_0xeaf3('0xf')]['message']);}else{logger[_0xeaf3('0x11')]('Integration,\x20%s,\x20%s',_0x1725b7,'request\x20sent');_0x120b24(_0x3e666b[_0xeaf3('0x12')][_0xeaf3('0x10')]);}})[_0xeaf3('0x13')](function(_0x2aea53){logger[_0xeaf3('0xf')](_0xeaf3('0xb'),_0x1725b7,_0x2aea53);_0x3d599a(_0x2aea53);});});} \ No newline at end of file +var _0xcacd=['request','info','request\x20sent','stringify','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x107654,_0x2871be){var _0x584beb=function(_0x1e8cb3){while(--_0x1e8cb3){_0x107654['push'](_0x107654['shift']());}};_0x584beb(++_0x2871be);}(_0xcacd,0x1bf));var _0xdcac=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xcacd[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xdcac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdcac('0x1'));var fs=require('fs');var Redis=require(_0xdcac('0x2'));var db=require(_0xdcac('0x3'))['db'];var utils=require(_0xdcac('0x4'));var logger=require(_0xdcac('0x5'))('rpc');var config=require(_0xdcac('0x6'));var jayson=require(_0xdcac('0x7'));var client=jayson[_0xdcac('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28e7c6,_0x2491e7,_0x4039ed){return new BPromise(function(_0x598f7e,_0x2f59c2){return client[_0xdcac('0x9')](_0x28e7c6,_0x4039ed)['then'](function(_0x22ad5e){logger[_0xdcac('0xa')]('Integration,\x20%s,\x20%s',_0x2491e7,'request\x20sent');logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2491e7,_0xdcac('0xb'),JSON[_0xdcac('0xc')](_0x22ad5e));if(_0x22ad5e[_0xdcac('0xd')]){if(_0x22ad5e[_0xdcac('0xd')][_0xdcac('0xe')]===0x1f4){logger[_0xdcac('0xd')](_0xdcac('0xf'),_0x2491e7,_0x22ad5e[_0xdcac('0xd')]['message']);return _0x2f59c2(_0x22ad5e[_0xdcac('0xd')][_0xdcac('0x10')]);}logger[_0xdcac('0xd')]('Integration,\x20%s,\x20%s',_0x2491e7,_0x22ad5e[_0xdcac('0xd')][_0xdcac('0x10')]);return _0x598f7e(_0x22ad5e[_0xdcac('0xd')][_0xdcac('0x10')]);}else{logger[_0xdcac('0xa')](_0xdcac('0xf'),_0x2491e7,_0xdcac('0xb'));_0x598f7e(_0x22ad5e[_0xdcac('0x11')][_0xdcac('0x10')]);}})[_0xdcac('0x12')](function(_0x42c88e){logger['error'](_0xdcac('0xf'),_0x2491e7,_0x42c88e);_0x2f59c2(_0x42c88e);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 2506543..73f7792 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 _0x8889=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x9119b,_0x101112){var _0x29f284=function(_0x560646){while(--_0x560646){_0x9119b['push'](_0x9119b['shift']());}};_0x29f284(++_0x101112);}(_0x8889,0x1d9));var _0x9888=function(_0x14ebd3,_0x557bed){_0x14ebd3=_0x14ebd3-0x0;var _0x28d23f=_0x8889[_0x14ebd3];return _0x28d23f;};'use strict';var multer=require(_0x9888('0x0'));var util=require(_0x9888('0x1'));var path=require(_0x9888('0x2'));var timeout=require(_0x9888('0x3'));var express=require(_0x9888('0x4'));var router=express[_0x9888('0x5')]();var auth=require(_0x9888('0x6'));var interaction=require(_0x9888('0x7'));var config=require(_0x9888('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0x9888('0x9')](),controller[_0x9888('0xa')]);router[_0x9888('0xb')]('/describe',auth[_0x9888('0x9')](),controller[_0x9888('0xc')]);router['get'](_0x9888('0xd'),auth[_0x9888('0x9')](),controller['show']);router['post']('/',auth[_0x9888('0x9')](),controller[_0x9888('0xe')]);router[_0x9888('0xf')]('/:id',auth[_0x9888('0x9')](),controller[_0x9888('0x10')]);router[_0x9888('0x11')](_0x9888('0xd'),auth[_0x9888('0x9')](),controller[_0x9888('0x12')]);module[_0x9888('0x13')]=router; \ No newline at end of file +var _0xf90e=['index','/describe','describe','show','create','/:id','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated'];(function(_0x49ed6e,_0x429278){var _0xde342=function(_0xf97f92){while(--_0xf97f92){_0x49ed6e['push'](_0x49ed6e['shift']());}};_0xde342(++_0x429278);}(_0xf90e,0x126));var _0xef90=function(_0x57511d,_0x1e55ce){_0x57511d=_0x57511d-0x0;var _0x10bb95=_0xf90e[_0x57511d];return _0x10bb95;};'use strict';var multer=require('multer');var util=require(_0xef90('0x0'));var path=require(_0xef90('0x1'));var timeout=require(_0xef90('0x2'));var express=require('express');var router=express[_0xef90('0x3')]();var auth=require(_0xef90('0x4'));var interaction=require(_0xef90('0x5'));var config=require(_0xef90('0x6'));var controller=require(_0xef90('0x7'));router[_0xef90('0x8')]('/',auth[_0xef90('0x9')](),controller[_0xef90('0xa')]);router['get'](_0xef90('0xb'),auth['isAuthenticated'](),controller[_0xef90('0xc')]);router[_0xef90('0x8')]('/:id',auth[_0xef90('0x9')](),controller[_0xef90('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xef90('0xe')]);router['put'](_0xef90('0xf'),auth[_0xef90('0x9')](),controller[_0xef90('0x10')]);router[_0xef90('0x11')](_0xef90('0xf'),auth[_0xef90('0x9')](),controller['destroy']);module[_0xef90('0x12')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index e194147..760b75b 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 _0x5737=['SENT','SENDING','RECEIVED','sequelize','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5737,0xc1));var _0x7573=function(_0x39eff9,_0x3a57a4){_0x39eff9=_0x39eff9-0x0;var _0x356d78=_0x5737[_0x39eff9];return _0x356d78;};'use strict';var Sequelize=require(_0x7573('0x0'));module['exports']={'integration':{'type':Sequelize[_0x7573('0x1')]},'eventChannel':{'type':Sequelize[_0x7573('0x1')]},'exitStatus':{'type':Sequelize[_0x7573('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x7573('0x1')]},'uniqueid':{'type':Sequelize[_0x7573('0x1')]},'calleridnum':{'type':Sequelize[_0x7573('0x1')]},'calleridname':{'type':Sequelize[_0x7573('0x1')]},'queue':{'type':Sequelize[_0x7573('0x1')]},'interface':{'type':Sequelize[_0x7573('0x1')]},'membername':{'type':Sequelize[_0x7573('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x7573('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7573('0x2')]},'talktime':{'type':Sequelize[_0x7573('0x3')]},'agentacw':{'type':Sequelize[_0x7573('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x7573('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x7573('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x7573('0x2')]},'agentdump':{'type':Sequelize[_0x7573('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x7573('0x1')]},'channel':{'type':Sequelize[_0x7573('0x1')]},'channelstate':{'type':Sequelize[_0x7573('0x3')]},'channelstatedesc':{'type':Sequelize[_0x7573('0x1')]},'connectedlinenum':{'type':Sequelize[_0x7573('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7573('0x1')]},'accountcode':{'type':Sequelize[_0x7573('0x1')]},'context':{'type':Sequelize[_0x7573('0x1')]},'exten':{'type':Sequelize[_0x7573('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7573('0x1')]},'destchannelstate':{'type':Sequelize[_0x7573('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x7573('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x7573('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x7573('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x7573('0x1')]},'destpriority':{'type':Sequelize[_0x7573('0x1')]},'destuniqueid':{'type':Sequelize[_0x7573('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x7573('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x7573('0x1')]},'to':{'type':Sequelize[_0x7573('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x7573('0x5')]},'html':{'type':Sequelize[_0x7573('0x5')]},'text':{'type':Sequelize[_0x7573('0x5')]},'status':{'type':Sequelize[_0x7573('0x6')](_0x7573('0x7'),_0x7573('0x8'),_0x7573('0x9'),'FAILED')},'url':{'type':Sequelize[_0x7573('0x1')]},'app':{'type':Sequelize[_0x7573('0x1')]},'appdata':{'type':Sequelize[_0x7573('0x1')]},'projectId':{'type':Sequelize[_0x7573('0x3')]}}; \ No newline at end of file +var _0x7e86=['STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENT','RECEIVED','FAILED','sequelize'];(function(_0x201f73,_0x17489c){var _0x24516d=function(_0x347913){while(--_0x347913){_0x201f73['push'](_0x201f73['shift']());}};_0x24516d(++_0x17489c);}(_0x7e86,0x81));var _0x67e8=function(_0x249d38,_0x2ae416){_0x249d38=_0x249d38-0x0;var _0x4d474e=_0x7e86[_0x249d38];return _0x4d474e;};'use strict';var Sequelize=require(_0x67e8('0x0'));module['exports']={'integration':{'type':Sequelize[_0x67e8('0x1')]},'eventChannel':{'type':Sequelize[_0x67e8('0x1')]},'exitStatus':{'type':Sequelize[_0x67e8('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x67e8('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x67e8('0x1')]},'interface':{'type':Sequelize[_0x67e8('0x1')]},'membername':{'type':Sequelize[_0x67e8('0x1')]},'agentcalledAt':{'type':Sequelize[_0x67e8('0x2')]},'agentconnectAt':{'type':Sequelize[_0x67e8('0x2')]},'holdtime':{'type':Sequelize[_0x67e8('0x3')]},'agentcomplete':{'type':Sequelize[_0x67e8('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x67e8('0x2')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x67e8('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x67e8('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x67e8('0x2')]},'agentdump':{'type':Sequelize[_0x67e8('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x67e8('0x2')]},'lastevent':{'type':Sequelize[_0x67e8('0x1')]},'channel':{'type':Sequelize[_0x67e8('0x1')]},'channelstate':{'type':Sequelize[_0x67e8('0x3')]},'channelstatedesc':{'type':Sequelize[_0x67e8('0x1')]},'connectedlinenum':{'type':Sequelize[_0x67e8('0x1')]},'connectedlinename':{'type':Sequelize[_0x67e8('0x1')]},'language':{'type':Sequelize[_0x67e8('0x1')]},'accountcode':{'type':Sequelize[_0x67e8('0x1')]},'context':{'type':Sequelize[_0x67e8('0x1')]},'exten':{'type':Sequelize[_0x67e8('0x1')]},'priority':{'type':Sequelize[_0x67e8('0x1')]},'destchannel':{'type':Sequelize[_0x67e8('0x1')]},'destchannelstate':{'type':Sequelize[_0x67e8('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x67e8('0x1')]},'destcalleridnum':{'type':Sequelize[_0x67e8('0x1')]},'destcalleridname':{'type':Sequelize[_0x67e8('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x67e8('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x67e8('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x67e8('0x1')]},'destcontext':{'type':Sequelize[_0x67e8('0x1')]},'destexten':{'type':Sequelize[_0x67e8('0x1')]},'destpriority':{'type':Sequelize[_0x67e8('0x1')]},'destuniqueid':{'type':Sequelize[_0x67e8('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x67e8('0x1')]},'subject':{'type':Sequelize[_0x67e8('0x1')]},'from':{'type':Sequelize[_0x67e8('0x1')]},'to':{'type':Sequelize[_0x67e8('0x1')]},'cc':{'type':Sequelize[_0x67e8('0x1')]},'attachment':{'type':Sequelize[_0x67e8('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x67e8('0x5')]},'status':{'type':Sequelize[_0x67e8('0x6')](_0x67e8('0x7'),'SENDING',_0x67e8('0x8'),_0x67e8('0x9'))},'url':{'type':Sequelize[_0x67e8('0x1')]},'app':{'type':Sequelize[_0x67e8('0x1')]},'appdata':{'type':Sequelize[_0x67e8('0x1')]},'projectId':{'type':Sequelize[_0x67e8('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 057c5c5..8449ee5 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 _0xeb3b=['util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','limit','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','IntegrationReport','rawAttributes','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','offset','order','where','pick','filter','VIRTUAL','merge','count','includeAll','rows','params','keys','length','include','options','find','catch','create','update','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird'];(function(_0x2c38de,_0x1c0a64){var _0x4e0216=function(_0x5ddc2f){while(--_0x5ddc2f){_0x2c38de['push'](_0x2c38de['shift']());}};_0x4e0216(++_0x1c0a64);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0xeb3b[_0x1d80be];return _0xf9a4f3;};'use strict';var pdf=require(_0xbeb3('0x0'));var emlformat=require(_0xbeb3('0x1'));var rimraf=require(_0xbeb3('0x2'));var zipdir=require(_0xbeb3('0x3'));var jsonpatch=require(_0xbeb3('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbeb3('0x5'));var Mustache=require('mustache');var util=require(_0xbeb3('0x6'));var path=require('path');var sox=require(_0xbeb3('0x7'));var csv=require(_0xbeb3('0x8'));var ejs=require(_0xbeb3('0x9'));var fs=require('fs');var _=require(_0xbeb3('0xa'));var squel=require(_0xbeb3('0xb'));var crypto=require(_0xbeb3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbeb3('0xd'));var toCsv=require(_0xbeb3('0x8'));var querystring=require(_0xbeb3('0xe'));var Papa=require(_0xbeb3('0xf'));var Redis=require(_0xbeb3('0x10'));var authService=require(_0xbeb3('0x11'));var qs=require(_0xbeb3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbeb3('0x13'));var logger=require(_0xbeb3('0x14'))('api');var utils=require(_0xbeb3('0x15'));var config=require(_0xbeb3('0x16'));var db=require(_0xbeb3('0x17'))['db'];function respondWithStatusCode(_0x2a7fb1,_0x19868e){_0x19868e=_0x19868e||0xcc;return function(_0x313296){if(_0x313296){return _0x2a7fb1['sendStatus'](_0x19868e);}return _0x2a7fb1['status'](_0x19868e)[_0xbeb3('0x18')]();};}function respondWithResult(_0x300c44,_0x5f521b){_0x5f521b=_0x5f521b||0xc8;return function(_0x4dfb28){if(_0x4dfb28){return _0x300c44[_0xbeb3('0x19')](_0x5f521b)[_0xbeb3('0x1a')](_0x4dfb28);}};}function respondWithFilteredResult(_0x395d2b,_0x43d58a){return function(_0x26daf2){if(_0x26daf2){var _0x535836=_0x26daf2['count'],_0x1aeaee=_0x43d58a['offset'],_0x5970a1=_0x43d58a['offset']+_0x43d58a[_0xbeb3('0x1b')],_0x80ef55;if(_0x5970a1>=_0x535836){_0x5970a1=_0x535836;_0x80ef55=0xc8;}else{_0x80ef55=0xce;}_0x395d2b[_0xbeb3('0x19')](_0x80ef55);return _0x395d2b[_0xbeb3('0x1c')](_0xbeb3('0x1d'),_0x1aeaee+'-'+_0x5970a1+'/'+_0x535836)['json'](_0x26daf2);}return null;};}function patchUpdates(_0x233a62){return function(_0x821d92){try{jsonpatch[_0xbeb3('0x1e')](_0x821d92,_0x233a62,!![]);}catch(_0x495c0a){return BPromise['reject'](_0x495c0a);}return _0x821d92[_0xbeb3('0x1f')]();};}function saveUpdates(_0x57e8b6,_0x1d917b){return function(_0x50b005){if(_0x50b005){return _0x50b005['update'](_0x57e8b6)[_0xbeb3('0x20')](function(_0x3c98f8){return _0x3c98f8;});}return null;};}function removeEntity(_0x2f3088,_0x4bd89e){return function(_0x301899){if(_0x301899){return _0x301899[_0xbeb3('0x21')]()['then'](function(){_0x2f3088[_0xbeb3('0x19')](0xcc)[_0xbeb3('0x18')]();});}};}function handleEntityNotFound(_0x55a59d,_0xfc384a){return function(_0x278fe4){if(!_0x278fe4){_0x55a59d[_0xbeb3('0x22')](0x194);}return _0x278fe4;};}function handleError(_0x42c6c3,_0x2bc188){_0x2bc188=_0x2bc188||0x1f4;return function(_0xee71d7){logger[_0xbeb3('0x23')](_0xee71d7[_0xbeb3('0x24')]);if(_0xee71d7[_0xbeb3('0x25')]){delete _0xee71d7['name'];}_0x42c6c3['status'](_0x2bc188)[_0xbeb3('0x26')](_0xee71d7);};}exports['index']=function(_0x3e7f7d,_0xda808c){var _0x138adf={},_0x400f65={},_0x4fa3c7={'count':0x0,'rows':[]};var _0x2fe7ec=_['map'](db[_0xbeb3('0x27')][_0xbeb3('0x28')],function(_0x5bd93d){return{'name':_0x5bd93d['fieldName'],'type':_0x5bd93d[_0xbeb3('0x29')]['key']};});_0x400f65['model']=_['map'](_0x2fe7ec,'name');_0x400f65[_0xbeb3('0x2a')]=_['keys'](_0x3e7f7d[_0xbeb3('0x2a')]);_0x400f65[_0xbeb3('0x2b')]=_[_0xbeb3('0x2c')](_0x400f65[_0xbeb3('0x2d')],_0x400f65[_0xbeb3('0x2a')]);_0x138adf[_0xbeb3('0x2e')]=_[_0xbeb3('0x2c')](_0x400f65[_0xbeb3('0x2d')],qs[_0xbeb3('0x2f')](_0x3e7f7d[_0xbeb3('0x2a')]['fields']));_0x138adf[_0xbeb3('0x2e')]=_0x138adf[_0xbeb3('0x2e')]['length']?_0x138adf[_0xbeb3('0x2e')]:_0x400f65[_0xbeb3('0x2d')];if(!_0x3e7f7d[_0xbeb3('0x2a')][_0xbeb3('0x30')]('nolimit')){_0x138adf[_0xbeb3('0x1b')]=qs[_0xbeb3('0x1b')](_0x3e7f7d[_0xbeb3('0x2a')][_0xbeb3('0x1b')]);_0x138adf[_0xbeb3('0x31')]=qs[_0xbeb3('0x31')](_0x3e7f7d[_0xbeb3('0x2a')][_0xbeb3('0x31')]);}_0x138adf[_0xbeb3('0x32')]=qs['sort'](_0x3e7f7d[_0xbeb3('0x2a')]['sort']);_0x138adf[_0xbeb3('0x33')]=qs[_0xbeb3('0x2b')](_[_0xbeb3('0x34')](_0x3e7f7d[_0xbeb3('0x2a')],_0x400f65[_0xbeb3('0x2b')]));if(_0x3e7f7d[_0xbeb3('0x2a')][_0xbeb3('0x35')]){_0x138adf[_0xbeb3('0x33')]=_['merge'](_0x138adf[_0xbeb3('0x33')],{'$or':_['map'](_0x2fe7ec,function(_0x59e6df){if(_0x59e6df['type']!==_0xbeb3('0x36')){var _0x2c95ce={};_0x2c95ce[_0x59e6df[_0xbeb3('0x25')]]={'$like':'%'+_0x3e7f7d[_0xbeb3('0x2a')][_0xbeb3('0x35')]+'%'};return _0x2c95ce;}})});}_0x138adf=_[_0xbeb3('0x37')]({},_0x138adf,_0x3e7f7d['options']);var _0x32db2d={'where':_0x138adf[_0xbeb3('0x33')]};return db[_0xbeb3('0x27')]['count'](_0x32db2d)['then'](function(_0x54239b){_0x4fa3c7[_0xbeb3('0x38')]=_0x54239b;if(_0x3e7f7d[_0xbeb3('0x2a')][_0xbeb3('0x39')]){_0x138adf['include']=[{'all':!![]}];}return db[_0xbeb3('0x27')]['findAll'](_0x138adf);})[_0xbeb3('0x20')](function(_0x447ac4){_0x4fa3c7[_0xbeb3('0x3a')]=_0x447ac4;return _0x4fa3c7;})[_0xbeb3('0x20')](respondWithFilteredResult(_0xda808c,_0x138adf))['catch'](handleError(_0xda808c,null));};exports['show']=function(_0x3c6ee2,_0x3684f1){var _0x3d4262={'raw':![],'where':{'id':_0x3c6ee2[_0xbeb3('0x3b')]['id']}},_0x2443a0={};_0x2443a0[_0xbeb3('0x2d')]=_[_0xbeb3('0x3c')](db[_0xbeb3('0x27')]['rawAttributes']);_0x2443a0[_0xbeb3('0x2a')]=_[_0xbeb3('0x3c')](_0x3c6ee2[_0xbeb3('0x2a')]);_0x2443a0[_0xbeb3('0x2b')]=_[_0xbeb3('0x2c')](_0x2443a0[_0xbeb3('0x2d')],_0x2443a0[_0xbeb3('0x2a')]);_0x3d4262['attributes']=_[_0xbeb3('0x2c')](_0x2443a0[_0xbeb3('0x2d')],qs[_0xbeb3('0x2f')](_0x3c6ee2[_0xbeb3('0x2a')][_0xbeb3('0x2f')]));_0x3d4262[_0xbeb3('0x2e')]=_0x3d4262[_0xbeb3('0x2e')][_0xbeb3('0x3d')]?_0x3d4262[_0xbeb3('0x2e')]:_0x2443a0[_0xbeb3('0x2d')];if(_0x3c6ee2[_0xbeb3('0x2a')][_0xbeb3('0x39')]){_0x3d4262[_0xbeb3('0x3e')]=[{'all':!![]}];}_0x3d4262=_['merge']({},_0x3d4262,_0x3c6ee2[_0xbeb3('0x3f')]);return db[_0xbeb3('0x27')][_0xbeb3('0x40')](_0x3d4262)['then'](handleEntityNotFound(_0x3684f1,null))['then'](respondWithResult(_0x3684f1,null))[_0xbeb3('0x41')](handleError(_0x3684f1,null));};exports[_0xbeb3('0x42')]=function(_0x269fe9,_0xf0fcd6){return db['IntegrationReport'][_0xbeb3('0x42')](_0x269fe9['body'],{})['then'](respondWithResult(_0xf0fcd6,0xc9))[_0xbeb3('0x41')](handleError(_0xf0fcd6,null));};exports[_0xbeb3('0x43')]=function(_0x1ff297,_0x8eaebd){if(_0x1ff297['body']['id']){delete _0x1ff297[_0xbeb3('0x44')]['id'];}return db[_0xbeb3('0x27')][_0xbeb3('0x40')]({'where':{'id':_0x1ff297['params']['id']}})[_0xbeb3('0x20')](handleEntityNotFound(_0x8eaebd,null))['then'](saveUpdates(_0x1ff297['body'],null))[_0xbeb3('0x20')](respondWithResult(_0x8eaebd,null))[_0xbeb3('0x41')](handleError(_0x8eaebd,null));};exports[_0xbeb3('0x21')]=function(_0x55e546,_0x23d63c){return db[_0xbeb3('0x27')][_0xbeb3('0x40')]({'where':{'id':_0x55e546['params']['id']}})[_0xbeb3('0x20')](handleEntityNotFound(_0x23d63c,null))['then'](removeEntity(_0x23d63c,null))[_0xbeb3('0x41')](handleError(_0x23d63c,null));};exports['describe']=function(_0x111d0d,_0x5f6542){return db[_0xbeb3('0x27')][_0xbeb3('0x45')]()[_0xbeb3('0x20')](respondWithResult(_0x5f6542,null))[_0xbeb3('0x41')](handleError(_0x5f6542,null));}; \ No newline at end of file +var _0x34bd=['sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','index','map','rawAttributes','fieldName','key','query','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','rows','show','params','IntegrationReport','intersection','create','body','find','catch','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x34bd,0x1d2));var _0xd34b=function(_0x1c676d,_0x4a62ea){_0x1c676d=_0x1c676d-0x0;var _0x287e93=_0x34bd[_0x1c676d];return _0x287e93;};'use strict';var pdf=require(_0xd34b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd34b('0x1'));var jsonpatch=require(_0xd34b('0x2'));var rp=require(_0xd34b('0x3'));var moment=require(_0xd34b('0x4'));var BPromise=require(_0xd34b('0x5'));var Mustache=require(_0xd34b('0x6'));var util=require(_0xd34b('0x7'));var path=require('path');var sox=require(_0xd34b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd34b('0x9'));var crypto=require(_0xd34b('0xa'));var jsforce=require(_0xd34b('0xb'));var deskjs=require(_0xd34b('0xc'));var toCsv=require(_0xd34b('0xd'));var querystring=require(_0xd34b('0xe'));var Papa=require(_0xd34b('0xf'));var Redis=require(_0xd34b('0x10'));var authService=require(_0xd34b('0x11'));var qs=require(_0xd34b('0x12'));var as=require(_0xd34b('0x13'));var hardwareService=require(_0xd34b('0x14'));var logger=require('../../config/logger')(_0xd34b('0x15'));var utils=require('../../config/utils');var config=require(_0xd34b('0x16'));var db=require(_0xd34b('0x17'))['db'];function respondWithStatusCode(_0x13dbae,_0x2fb7a8){_0x2fb7a8=_0x2fb7a8||0xcc;return function(_0x44c84c){if(_0x44c84c){return _0x13dbae[_0xd34b('0x18')](_0x2fb7a8);}return _0x13dbae['status'](_0x2fb7a8)[_0xd34b('0x19')]();};}function respondWithResult(_0x3af475,_0x4a2dbf){_0x4a2dbf=_0x4a2dbf||0xc8;return function(_0x14e108){if(_0x14e108){return _0x3af475[_0xd34b('0x1a')](_0x4a2dbf)[_0xd34b('0x1b')](_0x14e108);}};}function respondWithFilteredResult(_0x494105,_0x326f00){return function(_0x214c65){if(_0x214c65){var _0x5a46be=_0x214c65[_0xd34b('0x1c')],_0x3c74e2=_0x326f00[_0xd34b('0x1d')],_0x4ce87b=_0x326f00['offset']+_0x326f00[_0xd34b('0x1e')],_0xe11907;if(_0x4ce87b>=_0x5a46be){_0x4ce87b=_0x5a46be;_0xe11907=0xc8;}else{_0xe11907=0xce;}_0x494105[_0xd34b('0x1a')](_0xe11907);return _0x494105[_0xd34b('0x1f')](_0xd34b('0x20'),_0x3c74e2+'-'+_0x4ce87b+'/'+_0x5a46be)[_0xd34b('0x1b')](_0x214c65);}return null;};}function patchUpdates(_0x5d45e5){return function(_0x4c8c37){try{jsonpatch[_0xd34b('0x21')](_0x4c8c37,_0x5d45e5,!![]);}catch(_0x327b91){return BPromise[_0xd34b('0x22')](_0x327b91);}return _0x4c8c37[_0xd34b('0x23')]();};}function saveUpdates(_0x291a00,_0x3152a9){return function(_0x4a3273){if(_0x4a3273){return _0x4a3273[_0xd34b('0x24')](_0x291a00)[_0xd34b('0x25')](function(_0x1ae4ec){return _0x1ae4ec;});}return null;};}function removeEntity(_0x17466c,_0x5f1f0d){return function(_0x45c569){if(_0x45c569){return _0x45c569[_0xd34b('0x26')]()[_0xd34b('0x25')](function(){_0x17466c[_0xd34b('0x1a')](0xcc)[_0xd34b('0x19')]();});}};}function handleEntityNotFound(_0x27eb68,_0x5afc42){return function(_0x50da22){if(!_0x50da22){_0x27eb68['sendStatus'](0x194);}return _0x50da22;};}function handleError(_0x2187c0,_0x2ae0e1){_0x2ae0e1=_0x2ae0e1||0x1f4;return function(_0x54c88a){logger['error'](_0x54c88a['stack']);if(_0x54c88a[_0xd34b('0x27')]){delete _0x54c88a[_0xd34b('0x27')];}_0x2187c0[_0xd34b('0x1a')](_0x2ae0e1)['send'](_0x54c88a);};}exports[_0xd34b('0x28')]=function(_0x36b108,_0x5bac80){var _0x21a653={},_0x38637f={},_0x342885={'count':0x0,'rows':[]};var _0x5a121a=_[_0xd34b('0x29')](db['IntegrationReport'][_0xd34b('0x2a')],function(_0x27c392){return{'name':_0x27c392[_0xd34b('0x2b')],'type':_0x27c392['type'][_0xd34b('0x2c')]};});_0x38637f['model']=_[_0xd34b('0x29')](_0x5a121a,'name');_0x38637f[_0xd34b('0x2d')]=_['keys'](_0x36b108[_0xd34b('0x2d')]);_0x38637f[_0xd34b('0x2e')]=_['intersection'](_0x38637f[_0xd34b('0x2f')],_0x38637f[_0xd34b('0x2d')]);_0x21a653[_0xd34b('0x30')]=_['intersection'](_0x38637f[_0xd34b('0x2f')],qs[_0xd34b('0x31')](_0x36b108[_0xd34b('0x2d')]['fields']));_0x21a653[_0xd34b('0x30')]=_0x21a653[_0xd34b('0x30')][_0xd34b('0x32')]?_0x21a653[_0xd34b('0x30')]:_0x38637f[_0xd34b('0x2f')];if(!_0x36b108[_0xd34b('0x2d')][_0xd34b('0x33')]('nolimit')){_0x21a653[_0xd34b('0x1e')]=qs[_0xd34b('0x1e')](_0x36b108[_0xd34b('0x2d')][_0xd34b('0x1e')]);_0x21a653[_0xd34b('0x1d')]=qs['offset'](_0x36b108[_0xd34b('0x2d')][_0xd34b('0x1d')]);}_0x21a653[_0xd34b('0x34')]=qs['sort'](_0x36b108['query'][_0xd34b('0x35')]);_0x21a653[_0xd34b('0x36')]=qs[_0xd34b('0x2e')](_['pick'](_0x36b108[_0xd34b('0x2d')],_0x38637f[_0xd34b('0x2e')]));if(_0x36b108[_0xd34b('0x2d')][_0xd34b('0x37')]){_0x21a653['where']=_['merge'](_0x21a653[_0xd34b('0x36')],{'$or':_[_0xd34b('0x29')](_0x5a121a,function(_0x48938b){if(_0x48938b['type']!=='VIRTUAL'){var _0x64acdf={};_0x64acdf[_0x48938b[_0xd34b('0x27')]]={'$like':'%'+_0x36b108['query'][_0xd34b('0x37')]+'%'};return _0x64acdf;}})});}_0x21a653=_[_0xd34b('0x38')]({},_0x21a653,_0x36b108[_0xd34b('0x39')]);var _0x3ae580={'where':_0x21a653[_0xd34b('0x36')]};return db['IntegrationReport'][_0xd34b('0x1c')](_0x3ae580)[_0xd34b('0x25')](function(_0x384397){_0x342885[_0xd34b('0x1c')]=_0x384397;if(_0x36b108['query'][_0xd34b('0x3a')]){_0x21a653[_0xd34b('0x3b')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x21a653);})[_0xd34b('0x25')](function(_0x2fdb14){_0x342885[_0xd34b('0x3c')]=_0x2fdb14;return _0x342885;})[_0xd34b('0x25')](respondWithFilteredResult(_0x5bac80,_0x21a653))['catch'](handleError(_0x5bac80,null));};exports[_0xd34b('0x3d')]=function(_0x3858d5,_0x5bcd65){var _0x58fe5d={'raw':![],'where':{'id':_0x3858d5[_0xd34b('0x3e')]['id']}},_0x4d4bfa={};_0x4d4bfa['model']=_['keys'](db[_0xd34b('0x3f')]['rawAttributes']);_0x4d4bfa[_0xd34b('0x2d')]=_['keys'](_0x3858d5[_0xd34b('0x2d')]);_0x4d4bfa[_0xd34b('0x2e')]=_[_0xd34b('0x40')](_0x4d4bfa[_0xd34b('0x2f')],_0x4d4bfa[_0xd34b('0x2d')]);_0x58fe5d['attributes']=_[_0xd34b('0x40')](_0x4d4bfa[_0xd34b('0x2f')],qs[_0xd34b('0x31')](_0x3858d5[_0xd34b('0x2d')][_0xd34b('0x31')]));_0x58fe5d[_0xd34b('0x30')]=_0x58fe5d[_0xd34b('0x30')][_0xd34b('0x32')]?_0x58fe5d[_0xd34b('0x30')]:_0x4d4bfa[_0xd34b('0x2f')];if(_0x3858d5[_0xd34b('0x2d')][_0xd34b('0x3a')]){_0x58fe5d['include']=[{'all':!![]}];}_0x58fe5d=_['merge']({},_0x58fe5d,_0x3858d5[_0xd34b('0x39')]);return db[_0xd34b('0x3f')]['find'](_0x58fe5d)[_0xd34b('0x25')](handleEntityNotFound(_0x5bcd65,null))[_0xd34b('0x25')](respondWithResult(_0x5bcd65,null))['catch'](handleError(_0x5bcd65,null));};exports[_0xd34b('0x41')]=function(_0xa6c374,_0x4c6427){return db['IntegrationReport'][_0xd34b('0x41')](_0xa6c374[_0xd34b('0x42')],{})[_0xd34b('0x25')](respondWithResult(_0x4c6427,0xc9))['catch'](handleError(_0x4c6427,null));};exports[_0xd34b('0x24')]=function(_0x47acc6,_0x1818bb){if(_0x47acc6['body']['id']){delete _0x47acc6[_0xd34b('0x42')]['id'];}return db['IntegrationReport'][_0xd34b('0x43')]({'where':{'id':_0x47acc6[_0xd34b('0x3e')]['id']}})[_0xd34b('0x25')](handleEntityNotFound(_0x1818bb,null))[_0xd34b('0x25')](saveUpdates(_0x47acc6[_0xd34b('0x42')],null))[_0xd34b('0x25')](respondWithResult(_0x1818bb,null))[_0xd34b('0x44')](handleError(_0x1818bb,null));};exports[_0xd34b('0x26')]=function(_0x37c8f2,_0x149b3f){return db[_0xd34b('0x3f')][_0xd34b('0x43')]({'where':{'id':_0x37c8f2[_0xd34b('0x3e')]['id']}})[_0xd34b('0x25')](handleEntityNotFound(_0x149b3f,null))[_0xd34b('0x25')](removeEntity(_0x149b3f,null))[_0xd34b('0x44')](handleError(_0x149b3f,null));};exports['describe']=function(_0x12d59f,_0xdef8f2){return db[_0xd34b('0x3f')][_0xd34b('0x45')]()[_0xd34b('0x25')](respondWithResult(_0xdef8f2,null))[_0xd34b('0x44')](handleError(_0xdef8f2,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 11afe19..92ca9b7 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 _0x85ee=['define','IntegrationReport','report_integration','api','moment','bluebird','request-promise','path','rimraf','./integrationReport.attributes','exports'];(function(_0x5f10dd,_0x2e9685){var _0x8a13e7=function(_0x3a01c7){while(--_0x3a01c7){_0x5f10dd['push'](_0x5f10dd['shift']());}};_0x8a13e7(++_0x2e9685);}(_0x85ee,0x1bb));var _0xe85e=function(_0x513f7e,_0x32c26f){_0x513f7e=_0x513f7e-0x0;var _0x33e4da=_0x85ee[_0x513f7e];return _0x33e4da;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe85e('0x0'));var moment=require(_0xe85e('0x1'));var BPromise=require(_0xe85e('0x2'));var rp=require(_0xe85e('0x3'));var fs=require('fs');var path=require(_0xe85e('0x4'));var rimraf=require(_0xe85e('0x5'));var config=require('../../config/environment');var attributes=require(_0xe85e('0x6'));module[_0xe85e('0x7')]=function(_0x3426d7,_0x65105){return _0x3426d7[_0xe85e('0x8')](_0xe85e('0x9'),attributes,{'tableName':_0xe85e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeef7=['IntegrationReport','report_integration','lodash','util','api','moment','request-promise','path','define'];(function(_0x4c9380,_0x2fefc0){var _0x49a523=function(_0x165e85){while(--_0x165e85){_0x4c9380['push'](_0x4c9380['shift']());}};_0x49a523(++_0x2fefc0);}(_0xeef7,0xf5));var _0x7eef=function(_0x1bf461,_0x2cb2d9){_0x1bf461=_0x1bf461-0x0;var _0x40549c=_0xeef7[_0x1bf461];return _0x40549c;};'use strict';var _=require(_0x7eef('0x0'));var util=require(_0x7eef('0x1'));var logger=require('../../config/logger')(_0x7eef('0x2'));var moment=require(_0x7eef('0x3'));var BPromise=require('bluebird');var rp=require(_0x7eef('0x4'));var fs=require('fs');var path=require(_0x7eef('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module['exports']=function(_0x435bca,_0x262390){return _0x435bca[_0x7eef('0x6')](_0x7eef('0x7'),attributes,{'tableName':_0x7eef('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index b11516f..7508208 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 _0x757a=['request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\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(_0x1c3869,_0x314253){var _0x335a28=function(_0x16c0c4){while(--_0x16c0c4){_0x1c3869['push'](_0x1c3869['shift']());}};_0x335a28(++_0x314253);}(_0x757a,0xde));var _0xa757=function(_0x227e69,_0x3df3da){_0x227e69=_0x227e69-0x0;var _0xcf3f41=_0x757a[_0x227e69];return _0xcf3f41;};'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']('IntegrationReport,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('IntegrationReport,\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 _0x757a=['request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\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(_0x546835,_0xe23c18){var _0x2f5c04=function(_0x2390dd){while(--_0x2390dd){_0x546835['push'](_0x546835['shift']());}};_0x2f5c04(++_0xe23c18);}(_0x757a,0xde));var _0xa757=function(_0x28646a,_0x1d2e3f){_0x28646a=_0x28646a-0x0;var _0x56dd30=_0x757a[_0x28646a];return _0x56dd30;};'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']('IntegrationReport,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('IntegrationReport,\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 diff --git a/server/api/interval/index.js b/server/api/interval/index.js index b5711d5..9d16c9d 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 _0xedd9=['getIntervals','post','addInterval','addIntervals','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/sub_intervals'];(function(_0x1d5f98,_0x46dc3b){var _0x455d59=function(_0x1718bc){while(--_0x1718bc){_0x1d5f98['push'](_0x1d5f98['shift']());}};_0x455d59(++_0x46dc3b);}(_0xedd9,0xfc));var _0x9edd=function(_0x106158,_0x28a4a6){_0x106158=_0x106158-0x0;var _0x10c2b6=_0xedd9[_0x106158];return _0x10c2b6;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./interval.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/:id',auth[_0x9edd('0x9')](),controller['show']);router[_0x9edd('0x8')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router['post']('/',auth[_0x9edd('0x9')](),controller['create']);router[_0x9edd('0xd')](_0x9edd('0xb'),auth['isAuthenticated'](),controller[_0x9edd('0xe')]);router[_0x9edd('0xd')]('/:id/sub_intervals/create_many',auth[_0x9edd('0x9')](),controller[_0x9edd('0xf')]);router[_0x9edd('0x10')](_0x9edd('0x11'),auth[_0x9edd('0x9')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')](_0x9edd('0x11'),auth['isAuthenticated'](),controller[_0x9edd('0x14')]);module[_0x9edd('0x15')]=router; \ No newline at end of file +var _0x9c44=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addInterval','addIntervals','put','update','destroy','exports','path','connect-timeout','express','Router'];(function(_0x51ee9a,_0x22f0c7){var _0x5c07bc=function(_0x2a4493){while(--_0x2a4493){_0x51ee9a['push'](_0x51ee9a['shift']());}};_0x5c07bc(++_0x22f0c7);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x49c4('0xd')](_0x49c4('0xb'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);router[_0x49c4('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0x11')]);router['delete'](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x12')]);module[_0x49c4('0x13')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 99fa65e..8d6b05b 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 _0x0514=['exports','STRING','sequelize'];(function(_0x30c3cd,_0x14fbcf){var _0x436290=function(_0x44f108){while(--_0x44f108){_0x30c3cd['push'](_0x30c3cd['shift']());}};_0x436290(++_0x14fbcf);}(_0x0514,0x8c));var _0x4051=function(_0x56ecaa,_0xad978b){_0x56ecaa=_0x56ecaa-0x0;var _0x3d6135=_0x0514[_0x56ecaa];return _0x3d6135;};'use strict';var Sequelize=require(_0x4051('0x0'));module[_0x4051('0x1')]={'name':{'type':Sequelize[_0x4051('0x2')]},'description':{'type':Sequelize[_0x4051('0x2')]},'interval':{'type':Sequelize[_0x4051('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x2750=['STRING','sequelize'];(function(_0x56fe63,_0x4c6cc5){var _0x6956d5=function(_0x57bb63){while(--_0x57bb63){_0x56fe63['push'](_0x56fe63['shift']());}};_0x6956d5(++_0x4c6cc5);}(_0x2750,0x13b));var _0x0275=function(_0x46a676,_0x2bcea6){_0x46a676=_0x46a676-0x0;var _0x3a5213=_0x2750[_0x46a676];return _0x3a5213;};'use strict';var Sequelize=require(_0x0275('0x0'));module['exports']={'name':{'type':Sequelize[_0x0275('0x1')]},'description':{'type':Sequelize[_0x0275('0x1')]},'interval':{'type':Sequelize[_0x0275('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 fade115..e092cff 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 _0xedd9=['sequelize','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','limit','set','save','update','then','get','Intervals','destroy','end','name','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','userProfileId','UserProfileResource','error','getIntervals','addIntervals'];(function(_0x496704,_0x6de701){var _0x49973c=function(_0x454969){while(--_0x454969){_0x496704['push'](_0x496704['shift']());}};_0x49973c(++_0x6de701);}(_0xedd9,0xfc));var _0x9edd=function(_0xf019d2,_0x289841){_0xf019d2=_0xf019d2-0x0;var _0x19aee3=_0xedd9[_0xf019d2];return _0x19aee3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');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('0xa'));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 db=require(_0x9edd('0x16'))['db'];var extensions=require(_0x9edd('0x17'));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=_0x75a4ab['count'],_0x5f5bf4=_0x1042aa[_0x9edd('0x1b')],_0x448996=_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1c')],_0x449cee;if(_0x448996>=_0x4ea60f){_0x448996=_0x4ea60f;_0x449cee=0xc8;}else{_0x449cee=0xce;}_0x338f3c['status'](_0x449cee);return _0x338f3c[_0x9edd('0x1d')]('Content-Range',_0x5f5bf4+'-'+_0x448996+'/'+_0x4ea60f)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x1083e4){return function(_0x4bdb88){try{jsonpatch['apply'](_0x4bdb88,_0x1083e4,!![]);}catch(_0x45c3ab){return BPromise['reject'](_0x45c3ab);}return _0x4bdb88[_0x9edd('0x1e')]();};}function saveUpdates(_0x54a03f,_0x535f37){return function(_0x356751){if(_0x356751){return _0x356751[_0x9edd('0x1f')](_0x54a03f)['then'](function(_0x5823bc){return _0x5823bc;});}return null;};}function removeEntity(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['destroy']()[_0x9edd('0x20')](function(){var _0x1dca43=_0x477878[_0x9edd('0x21')]({'plain':!![]});var _0x2ca65f=_0x9edd('0x22');return db['UserProfileResource'][_0x9edd('0x23')]({'where':{'type':_0x2ca65f,'resourceId':_0x1dca43['id']}})[_0x9edd('0x20')](function(){return _0x477878;});})[_0x9edd('0x20')](function(){_0x341d67[_0x9edd('0x19')](0xcc)[_0x9edd('0x24')]();});}};}function handleEntityNotFound(_0x4d507f,_0x4b3d1b){return function(_0x3276ee){if(!_0x3276ee){_0x4d507f[_0x9edd('0x18')](0x194);}return _0x3276ee;};}function handleError(_0x8d67aa,_0x25e135){_0x25e135=_0x25e135||0x1f4;return function(_0x3c2227){logger['error'](_0x3c2227['stack']);if(_0x3c2227[_0x9edd('0x25')]){delete _0x3c2227[_0x9edd('0x25')];}_0x8d67aa[_0x9edd('0x19')](_0x25e135)['send'](_0x3c2227);};}exports[_0x9edd('0x26')]=function(_0x28cfae,_0x2ae8dd){var _0x41af53={},_0x5eccfb={},_0x2155a1={'count':0x0,'rows':[]};var _0x3fb556=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x42e664){return{'name':_0x42e664[_0x9edd('0x2a')],'type':_0x42e664[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x5eccfb[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x3fb556,_0x9edd('0x25'));_0x5eccfb[_0x9edd('0x2e')]=_[_0x9edd('0x2f')](_0x28cfae[_0x9edd('0x2e')]);_0x5eccfb['filters']=_[_0x9edd('0x30')](_0x5eccfb[_0x9edd('0x2d')],_0x5eccfb[_0x9edd('0x2e')]);_0x41af53['attributes']=_[_0x9edd('0x30')](_0x5eccfb[_0x9edd('0x2d')],qs[_0x9edd('0x31')](_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x31')]));_0x41af53[_0x9edd('0x32')]=_0x41af53[_0x9edd('0x32')][_0x9edd('0x33')]?_0x41af53[_0x9edd('0x32')]:_0x5eccfb[_0x9edd('0x2d')];if(!_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x34')](_0x9edd('0x35'))){_0x41af53[_0x9edd('0x1c')]=qs['limit'](_0x28cfae[_0x9edd('0x2e')]['limit']);_0x41af53[_0x9edd('0x1b')]=qs[_0x9edd('0x1b')](_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x1b')]);}_0x41af53[_0x9edd('0x36')]=qs['sort'](_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x37')]);_0x41af53[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_[_0x9edd('0x3a')](_0x28cfae[_0x9edd('0x2e')],_0x5eccfb[_0x9edd('0x39')]));if(_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x3b')]){_0x41af53[_0x9edd('0x38')]=_['merge'](_0x41af53[_0x9edd('0x38')],{'$or':_['map'](_0x3fb556,function(_0x3ef1d5){if(_0x3ef1d5['type']!==_0x9edd('0x3c')){var _0x2858b5={};_0x2858b5[_0x3ef1d5[_0x9edd('0x25')]]={'$like':'%'+_0x28cfae['query'][_0x9edd('0x3b')]+'%'};return _0x2858b5;}})});}_0x41af53=_[_0x9edd('0x3d')]({},_0x41af53,_0x28cfae[_0x9edd('0x3e')]);var _0x48958a={'where':_0x41af53[_0x9edd('0x38')]};return db['Interval'][_0x9edd('0x3f')](_0x48958a)[_0x9edd('0x20')](function(_0x50be2c){_0x2155a1[_0x9edd('0x3f')]=_0x50be2c;if(_0x28cfae[_0x9edd('0x2e')][_0x9edd('0x40')]){_0x41af53[_0x9edd('0x41')]=[{'all':!![]}];}return db['Interval'][_0x9edd('0x42')](_0x41af53);})['then'](function(_0x2bdb3f){_0x2155a1[_0x9edd('0x43')]=_0x2bdb3f;return _0x2155a1;})['then'](respondWithFilteredResult(_0x2ae8dd,_0x41af53))[_0x9edd('0x44')](handleError(_0x2ae8dd,null));};exports['show']=function(_0x548299,_0x369b69){var _0x9cab86={'raw':!![],'where':{'id':_0x548299[_0x9edd('0x45')]['id']}},_0x1f276b={};_0x1f276b[_0x9edd('0x2d')]=_[_0x9edd('0x2f')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x1f276b[_0x9edd('0x2e')]=_[_0x9edd('0x2f')](_0x548299[_0x9edd('0x2e')]);_0x1f276b[_0x9edd('0x39')]=_[_0x9edd('0x30')](_0x1f276b[_0x9edd('0x2d')],_0x1f276b[_0x9edd('0x2e')]);_0x9cab86['attributes']=_[_0x9edd('0x30')](_0x1f276b[_0x9edd('0x2d')],qs[_0x9edd('0x31')](_0x548299[_0x9edd('0x2e')][_0x9edd('0x31')]));_0x9cab86[_0x9edd('0x32')]=_0x9cab86[_0x9edd('0x32')]['length']?_0x9cab86['attributes']:_0x1f276b['model'];if(_0x548299[_0x9edd('0x2e')]['includeAll']){_0x9cab86[_0x9edd('0x41')]=[{'all':!![]}];}_0x9cab86=_[_0x9edd('0x3d')]({},_0x9cab86,_0x548299[_0x9edd('0x3e')]);return db[_0x9edd('0x28')][_0x9edd('0x46')](_0x9cab86)['then'](handleEntityNotFound(_0x369b69,null))[_0x9edd('0x20')](respondWithResult(_0x369b69,null))[_0x9edd('0x44')](handleError(_0x369b69,null));};exports[_0x9edd('0x47')]=function(_0x4a89ae,_0x3626bc){return db[_0x9edd('0x28')][_0x9edd('0x47')](_0x4a89ae[_0x9edd('0x48')],{})[_0x9edd('0x20')](function(_0x35bdec){var _0x4d4f33=_0x4a89ae[_0x9edd('0x49')][_0x9edd('0x21')]({'plain':!![]});if(!_0x4d4f33)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d4f33[_0x9edd('0x4a')]===_0x9edd('0x49')){var _0x4bb324=_0x35bdec[_0x9edd('0x21')]({'plain':!![]});var _0x8134cd=_0x9edd('0x22');return db['UserProfileSection'][_0x9edd('0x46')]({'where':{'name':_0x8134cd,'userProfileId':_0x4d4f33[_0x9edd('0x4b')]},'raw':!![]})[_0x9edd('0x20')](function(_0x28c7bd){if(_0x28c7bd&&_0x28c7bd['autoAssociation']===0x0){return db[_0x9edd('0x4c')][_0x9edd('0x47')]({'name':_0x4bb324[_0x9edd('0x25')],'resourceId':_0x4bb324['id'],'type':_0x28c7bd['name'],'sectionId':_0x28c7bd['id']},{})[_0x9edd('0x20')](function(){return _0x35bdec;});}else{return _0x35bdec;}})[_0x9edd('0x44')](function(_0x57db43){logger[_0x9edd('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57db43);throw _0x57db43;});}return _0x35bdec;})[_0x9edd('0x20')](respondWithResult(_0x3626bc,0xc9))[_0x9edd('0x44')](handleError(_0x3626bc,null));};exports[_0x9edd('0x1f')]=function(_0x3fcdf5,_0x1e3c19){if(_0x3fcdf5[_0x9edd('0x48')]['id']){delete _0x3fcdf5[_0x9edd('0x48')]['id'];}return db[_0x9edd('0x28')][_0x9edd('0x46')]({'where':{'id':_0x3fcdf5[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x1e3c19,null))['then'](saveUpdates(_0x3fcdf5[_0x9edd('0x48')],null))[_0x9edd('0x20')](respondWithResult(_0x1e3c19,null))[_0x9edd('0x44')](handleError(_0x1e3c19,null));};exports['destroy']=function(_0xe96d6a,_0x54a704){return db['Interval']['find']({'where':{'id':_0xe96d6a[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x54a704,null))[_0x9edd('0x20')](removeEntity(_0x54a704,null))[_0x9edd('0x44')](handleError(_0x54a704,null));};exports['addInterval']=function(_0x56b38b,_0x4e3c3e,_0x71820f){if(_0x56b38b[_0x9edd('0x48')]['id']){delete _0x56b38b[_0x9edd('0x48')]['id'];}return db[_0x9edd('0x28')][_0x9edd('0x46')]({'where':{'id':_0x56b38b[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x4e3c3e,null))[_0x9edd('0x20')](function(_0x4eb780){if(_0x4eb780){_0x56b38b[_0x9edd('0x48')]['IntervalId']=_0x4eb780['id'];return db[_0x9edd('0x28')][_0x9edd('0x47')](_0x56b38b['body']);}})[_0x9edd('0x20')](respondWithResult(_0x4e3c3e,null))[_0x9edd('0x44')](handleError(_0x4e3c3e,null));};exports[_0x9edd('0x4e')]=function(_0x5ec9af,_0xc648c4,_0x2e1ce3){var _0x430eb4={};var _0x15ebfa={};var _0x1720b1;var _0x2c3173;return db['Interval']['findOne']({'where':{'id':_0x5ec9af[_0x9edd('0x45')]['id']}})['then'](handleEntityNotFound(_0xc648c4,null))[_0x9edd('0x20')](function(_0x3e9a3e){if(_0x3e9a3e){_0x1720b1=_0x3e9a3e;_0x15ebfa[_0x9edd('0x2d')]=_[_0x9edd('0x2f')](db['Interval'][_0x9edd('0x29')]);_0x15ebfa['query']=_[_0x9edd('0x2f')](_0x5ec9af[_0x9edd('0x2e')]);_0x15ebfa[_0x9edd('0x39')]=_['intersection'](_0x15ebfa[_0x9edd('0x2d')],_0x15ebfa['query']);_0x430eb4[_0x9edd('0x32')]=_[_0x9edd('0x30')](_0x15ebfa['model'],qs[_0x9edd('0x31')](_0x5ec9af['query'][_0x9edd('0x31')]));_0x430eb4[_0x9edd('0x32')]=_0x430eb4[_0x9edd('0x32')]['length']?_0x430eb4[_0x9edd('0x32')]:_0x15ebfa[_0x9edd('0x2d')];_0x430eb4[_0x9edd('0x36')]=qs[_0x9edd('0x37')](_0x5ec9af[_0x9edd('0x2e')]['sort']);_0x430eb4['where']=qs[_0x9edd('0x39')](_[_0x9edd('0x3a')](_0x5ec9af['query'],_0x15ebfa['filters']));if(_0x5ec9af['query'][_0x9edd('0x3b')]){_0x430eb4['where']=_['merge'](_0x430eb4[_0x9edd('0x38')],{'$or':_[_0x9edd('0x27')](_0x430eb4['attributes'],function(_0xb9ebeb){var _0x11e082={};_0x11e082[_0xb9ebeb]={'$like':'%'+_0x5ec9af[_0x9edd('0x2e')]['filter']+'%'};return _0x11e082;})});}_0x430eb4=_[_0x9edd('0x3d')]({},_0x430eb4,_0x5ec9af['options']);return _0x1720b1[_0x9edd('0x4e')](_0x430eb4);}})[_0x9edd('0x20')](function(_0x4c8d06){if(_0x4c8d06){_0x2c3173=_0x4c8d06[_0x9edd('0x33')];if(!_0x5ec9af[_0x9edd('0x2e')]['hasOwnProperty'](_0x9edd('0x35'))){_0x430eb4[_0x9edd('0x1c')]=qs[_0x9edd('0x1c')](_0x5ec9af[_0x9edd('0x2e')]['limit']);_0x430eb4[_0x9edd('0x1b')]=qs['offset'](_0x5ec9af[_0x9edd('0x2e')][_0x9edd('0x1b')]);}return _0x1720b1[_0x9edd('0x4e')](_0x430eb4);}})['then'](function(_0x106a67){if(_0x106a67){return _0x106a67?{'count':_0x2c3173,'rows':_0x106a67}:null;}})[_0x9edd('0x20')](respondWithResult(_0xc648c4,null))[_0x9edd('0x44')](handleError(_0xc648c4,null));};exports[_0x9edd('0x4f')]=function(_0x25626a,_0x14e2e5,_0x3fa4a9){return db['Interval']['findOne']({'where':{'id':_0x25626a[_0x9edd('0x45')]['id']}})[_0x9edd('0x20')](handleEntityNotFound(_0x14e2e5,null))[_0x9edd('0x20')](function(_0x171403){if(_0x171403){return db[_0x9edd('0x50')]['transaction'](function(_0x2e40c8){return db[_0x9edd('0x28')][_0x9edd('0x23')]({'where':{'IntervalId':_0x25626a['params']['id']},'transaction':_0x2e40c8})[_0x9edd('0x20')](function(_0x29d70d){var _0x4b1c12=_[_0x9edd('0x27')](_0x25626a[_0x9edd('0x48')],function(_0x58c839){delete _0x58c839['id'];_0x58c839[_0x9edd('0x51')]=_0x25626a[_0x9edd('0x45')]['id'];return _0x58c839;});return db['Interval'][_0x9edd('0x52')](_0x4b1c12,{'transaction':_0x2e40c8});});})['then'](function(){return db['Interval'][_0x9edd('0x42')]({'where':{'IntervalId':_0x25626a[_0x9edd('0x45')]['id']}});});}})[_0x9edd('0x20')](respondWithResult(_0x14e2e5,null))['catch'](handleError(_0x14e2e5,null));}; \ No newline at end of file +var _0x70e0=['findAll','rows','catch','show','keys','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','getIntervals','findOne','order','hasOwnProperty','addIntervals','transaction','IntervalId','bulkCreate','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','end','status','json','offset','limit','set','apply','update','destroy','then','get','Intervals','sendStatus','stack','name','send','index','rawAttributes','fieldName','key','model','map','intersection','query','attributes','fields','length','sort','pick','filters','filter','merge','where','type','VIRTUAL','options','Interval','count'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x70e0,0x17b));var _0x070e=function(_0x3c9def,_0x2b3bc6){_0x3c9def=_0x3c9def-0x0;var _0x3209c6=_0x70e0[_0x3c9def];return _0x3209c6;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');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('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];var extensions=require(_0x070e('0x16'));function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x17')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x18')](_0x4a33d2)[_0x070e('0x19')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=_0x373d86['count'],_0x180897=_0x5d3a38[_0x070e('0x1a')],_0x19d9da=_0x5d3a38[_0x070e('0x1a')]+_0x5d3a38[_0x070e('0x1b')],_0x5bc71e;if(_0x19d9da>=_0xeae1a5){_0x19d9da=_0xeae1a5;_0x5bc71e=0xc8;}else{_0x5bc71e=0xce;}_0x51d14d[_0x070e('0x18')](_0x5bc71e);return _0x51d14d[_0x070e('0x1c')]('Content-Range',_0x180897+'-'+_0x19d9da+'/'+_0xeae1a5)[_0x070e('0x19')](_0x373d86);}return null;};}function patchUpdates(_0x168dc6){return function(_0x1ad3de){try{jsonpatch[_0x070e('0x1d')](_0x1ad3de,_0x168dc6,!![]);}catch(_0x259893){return BPromise['reject'](_0x259893);}return _0x1ad3de['save']();};}function saveUpdates(_0x4e958f,_0x9907cf){return function(_0x3004f0){if(_0x3004f0){return _0x3004f0[_0x070e('0x1e')](_0x4e958f)['then'](function(_0x5b184){return _0x5b184;});}return null;};}function removeEntity(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x1f')]()[_0x070e('0x20')](function(){var _0x28a1c3=_0x3f6985[_0x070e('0x21')]({'plain':!![]});var _0xe405e=_0x070e('0x22');return db['UserProfileResource'][_0x070e('0x1f')]({'where':{'type':_0xe405e,'resourceId':_0x28a1c3['id']}})[_0x070e('0x20')](function(){return _0x3f6985;});})[_0x070e('0x20')](function(){_0x5dc5d2['status'](0xcc)[_0x070e('0x17')]();});}};}function handleEntityNotFound(_0x5f3e9d,_0x4a2dbd){return function(_0x2ccbd7){if(!_0x2ccbd7){_0x5f3e9d[_0x070e('0x23')](0x194);}return _0x2ccbd7;};}function handleError(_0x41deb1,_0x1743cc){_0x1743cc=_0x1743cc||0x1f4;return function(_0x4763c6){logger['error'](_0x4763c6[_0x070e('0x24')]);if(_0x4763c6[_0x070e('0x25')]){delete _0x4763c6[_0x070e('0x25')];}_0x41deb1[_0x070e('0x18')](_0x1743cc)[_0x070e('0x26')](_0x4763c6);};}exports[_0x070e('0x27')]=function(_0x1a1892,_0x26373b){var _0x5e8326={},_0x282344={},_0x351641={'count':0x0,'rows':[]};var _0x3a16d0=_['map'](db['Interval'][_0x070e('0x28')],function(_0x46065c){return{'name':_0x46065c[_0x070e('0x29')],'type':_0x46065c['type'][_0x070e('0x2a')]};});_0x282344[_0x070e('0x2b')]=_[_0x070e('0x2c')](_0x3a16d0,_0x070e('0x25'));_0x282344['query']=_['keys'](_0x1a1892['query']);_0x282344['filters']=_[_0x070e('0x2d')](_0x282344['model'],_0x282344[_0x070e('0x2e')]);_0x5e8326[_0x070e('0x2f')]=_['intersection'](_0x282344['model'],qs[_0x070e('0x30')](_0x1a1892[_0x070e('0x2e')]['fields']));_0x5e8326['attributes']=_0x5e8326[_0x070e('0x2f')][_0x070e('0x31')]?_0x5e8326[_0x070e('0x2f')]:_0x282344[_0x070e('0x2b')];if(!_0x1a1892[_0x070e('0x2e')]['hasOwnProperty']('nolimit')){_0x5e8326[_0x070e('0x1b')]=qs[_0x070e('0x1b')](_0x1a1892[_0x070e('0x2e')][_0x070e('0x1b')]);_0x5e8326[_0x070e('0x1a')]=qs['offset'](_0x1a1892[_0x070e('0x2e')][_0x070e('0x1a')]);}_0x5e8326['order']=qs[_0x070e('0x32')](_0x1a1892[_0x070e('0x2e')]['sort']);_0x5e8326['where']=qs['filters'](_[_0x070e('0x33')](_0x1a1892[_0x070e('0x2e')],_0x282344[_0x070e('0x34')]));if(_0x1a1892[_0x070e('0x2e')][_0x070e('0x35')]){_0x5e8326['where']=_[_0x070e('0x36')](_0x5e8326[_0x070e('0x37')],{'$or':_[_0x070e('0x2c')](_0x3a16d0,function(_0x487276){if(_0x487276[_0x070e('0x38')]!==_0x070e('0x39')){var _0x165c16={};_0x165c16[_0x487276['name']]={'$like':'%'+_0x1a1892[_0x070e('0x2e')][_0x070e('0x35')]+'%'};return _0x165c16;}})});}_0x5e8326=_['merge']({},_0x5e8326,_0x1a1892[_0x070e('0x3a')]);var _0x5d689b={'where':_0x5e8326[_0x070e('0x37')]};return db[_0x070e('0x3b')][_0x070e('0x3c')](_0x5d689b)[_0x070e('0x20')](function(_0xd03404){_0x351641['count']=_0xd03404;if(_0x1a1892[_0x070e('0x2e')]['includeAll']){_0x5e8326['include']=[{'all':!![]}];}return db[_0x070e('0x3b')][_0x070e('0x3d')](_0x5e8326);})[_0x070e('0x20')](function(_0x4d52ff){_0x351641[_0x070e('0x3e')]=_0x4d52ff;return _0x351641;})[_0x070e('0x20')](respondWithFilteredResult(_0x26373b,_0x5e8326))[_0x070e('0x3f')](handleError(_0x26373b,null));};exports[_0x070e('0x40')]=function(_0x4a4ee3,_0x13e4e0){var _0x5851ab={'raw':!![],'where':{'id':_0x4a4ee3['params']['id']}},_0x544b53={};_0x544b53[_0x070e('0x2b')]=_[_0x070e('0x41')](db[_0x070e('0x3b')][_0x070e('0x28')]);_0x544b53[_0x070e('0x2e')]=_['keys'](_0x4a4ee3[_0x070e('0x2e')]);_0x544b53['filters']=_[_0x070e('0x2d')](_0x544b53[_0x070e('0x2b')],_0x544b53[_0x070e('0x2e')]);_0x5851ab['attributes']=_['intersection'](_0x544b53[_0x070e('0x2b')],qs['fields'](_0x4a4ee3[_0x070e('0x2e')][_0x070e('0x30')]));_0x5851ab[_0x070e('0x2f')]=_0x5851ab['attributes'][_0x070e('0x31')]?_0x5851ab[_0x070e('0x2f')]:_0x544b53['model'];if(_0x4a4ee3['query'][_0x070e('0x42')]){_0x5851ab[_0x070e('0x43')]=[{'all':!![]}];}_0x5851ab=_[_0x070e('0x36')]({},_0x5851ab,_0x4a4ee3[_0x070e('0x3a')]);return db[_0x070e('0x3b')]['find'](_0x5851ab)[_0x070e('0x20')](handleEntityNotFound(_0x13e4e0,null))[_0x070e('0x20')](respondWithResult(_0x13e4e0,null))[_0x070e('0x3f')](handleError(_0x13e4e0,null));};exports[_0x070e('0x44')]=function(_0x79eaa0,_0xcd1c61){return db[_0x070e('0x3b')][_0x070e('0x44')](_0x79eaa0[_0x070e('0x45')],{})[_0x070e('0x20')](function(_0x210c4d){var _0x3be553=_0x79eaa0[_0x070e('0x46')][_0x070e('0x21')]({'plain':!![]});if(!_0x3be553)throw new Error(_0x070e('0x47'));if(_0x3be553['role']===_0x070e('0x46')){var _0xa7a41b=_0x210c4d[_0x070e('0x21')]({'plain':!![]});var _0x249e3f=_0x070e('0x22');return db[_0x070e('0x48')][_0x070e('0x49')]({'where':{'name':_0x249e3f,'userProfileId':_0x3be553[_0x070e('0x4a')]},'raw':!![]})[_0x070e('0x20')](function(_0x5744c5){if(_0x5744c5&&_0x5744c5[_0x070e('0x4b')]===0x0){return db['UserProfileResource'][_0x070e('0x44')]({'name':_0xa7a41b[_0x070e('0x25')],'resourceId':_0xa7a41b['id'],'type':_0x5744c5['name'],'sectionId':_0x5744c5['id']},{})[_0x070e('0x20')](function(){return _0x210c4d;});}else{return _0x210c4d;}})[_0x070e('0x3f')](function(_0x25466f){logger[_0x070e('0x4c')](_0x070e('0x4d'),_0x25466f);throw _0x25466f;});}return _0x210c4d;})[_0x070e('0x20')](respondWithResult(_0xcd1c61,0xc9))[_0x070e('0x3f')](handleError(_0xcd1c61,null));};exports['update']=function(_0x296978,_0x5bacbd){if(_0x296978['body']['id']){delete _0x296978[_0x070e('0x45')]['id'];}return db[_0x070e('0x3b')][_0x070e('0x49')]({'where':{'id':_0x296978[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x5bacbd,null))[_0x070e('0x20')](saveUpdates(_0x296978[_0x070e('0x45')],null))[_0x070e('0x20')](respondWithResult(_0x5bacbd,null))['catch'](handleError(_0x5bacbd,null));};exports[_0x070e('0x1f')]=function(_0x51d27d,_0x564d82){return db[_0x070e('0x3b')][_0x070e('0x49')]({'where':{'id':_0x51d27d['params']['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x564d82,null))[_0x070e('0x20')](removeEntity(_0x564d82,null))[_0x070e('0x3f')](handleError(_0x564d82,null));};exports[_0x070e('0x4f')]=function(_0x1aacfc,_0x382ce3,_0x1b36cd){if(_0x1aacfc['body']['id']){delete _0x1aacfc['body']['id'];}return db['Interval'][_0x070e('0x49')]({'where':{'id':_0x1aacfc[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x382ce3,null))[_0x070e('0x20')](function(_0x5ac0b5){if(_0x5ac0b5){_0x1aacfc[_0x070e('0x45')]['IntervalId']=_0x5ac0b5['id'];return db[_0x070e('0x3b')][_0x070e('0x44')](_0x1aacfc[_0x070e('0x45')]);}})[_0x070e('0x20')](respondWithResult(_0x382ce3,null))[_0x070e('0x3f')](handleError(_0x382ce3,null));};exports[_0x070e('0x50')]=function(_0x5561ed,_0x20ff87,_0x18e8d0){var _0x8aaf00={};var _0x533431={};var _0x1d7873;var _0x1da803;return db['Interval'][_0x070e('0x51')]({'where':{'id':_0x5561ed['params']['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x20ff87,null))['then'](function(_0x4cb86f){if(_0x4cb86f){_0x1d7873=_0x4cb86f;_0x533431['model']=_[_0x070e('0x41')](db[_0x070e('0x3b')][_0x070e('0x28')]);_0x533431[_0x070e('0x2e')]=_[_0x070e('0x41')](_0x5561ed[_0x070e('0x2e')]);_0x533431['filters']=_[_0x070e('0x2d')](_0x533431['model'],_0x533431[_0x070e('0x2e')]);_0x8aaf00['attributes']=_[_0x070e('0x2d')](_0x533431[_0x070e('0x2b')],qs['fields'](_0x5561ed[_0x070e('0x2e')]['fields']));_0x8aaf00[_0x070e('0x2f')]=_0x8aaf00[_0x070e('0x2f')][_0x070e('0x31')]?_0x8aaf00[_0x070e('0x2f')]:_0x533431[_0x070e('0x2b')];_0x8aaf00[_0x070e('0x52')]=qs[_0x070e('0x32')](_0x5561ed[_0x070e('0x2e')][_0x070e('0x32')]);_0x8aaf00[_0x070e('0x37')]=qs[_0x070e('0x34')](_[_0x070e('0x33')](_0x5561ed[_0x070e('0x2e')],_0x533431[_0x070e('0x34')]));if(_0x5561ed['query'][_0x070e('0x35')]){_0x8aaf00[_0x070e('0x37')]=_[_0x070e('0x36')](_0x8aaf00[_0x070e('0x37')],{'$or':_['map'](_0x8aaf00[_0x070e('0x2f')],function(_0x4e8e58){var _0x398f54={};_0x398f54[_0x4e8e58]={'$like':'%'+_0x5561ed[_0x070e('0x2e')][_0x070e('0x35')]+'%'};return _0x398f54;})});}_0x8aaf00=_[_0x070e('0x36')]({},_0x8aaf00,_0x5561ed['options']);return _0x1d7873[_0x070e('0x50')](_0x8aaf00);}})[_0x070e('0x20')](function(_0x240ec9){if(_0x240ec9){_0x1da803=_0x240ec9[_0x070e('0x31')];if(!_0x5561ed['query'][_0x070e('0x53')]('nolimit')){_0x8aaf00[_0x070e('0x1b')]=qs[_0x070e('0x1b')](_0x5561ed[_0x070e('0x2e')][_0x070e('0x1b')]);_0x8aaf00[_0x070e('0x1a')]=qs['offset'](_0x5561ed[_0x070e('0x2e')][_0x070e('0x1a')]);}return _0x1d7873[_0x070e('0x50')](_0x8aaf00);}})[_0x070e('0x20')](function(_0x5591dd){if(_0x5591dd){return _0x5591dd?{'count':_0x1da803,'rows':_0x5591dd}:null;}})[_0x070e('0x20')](respondWithResult(_0x20ff87,null))['catch'](handleError(_0x20ff87,null));};exports[_0x070e('0x54')]=function(_0x44e465,_0x1214d2,_0x57585e){return db[_0x070e('0x3b')]['findOne']({'where':{'id':_0x44e465[_0x070e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1214d2,null))[_0x070e('0x20')](function(_0x17b28c){if(_0x17b28c){return db['sequelize'][_0x070e('0x55')](function(_0x53f9a8){return db[_0x070e('0x3b')][_0x070e('0x1f')]({'where':{'IntervalId':_0x44e465['params']['id']},'transaction':_0x53f9a8})['then'](function(_0x29ee66){var _0x3022cd=_[_0x070e('0x2c')](_0x44e465[_0x070e('0x45')],function(_0x25f1d0){delete _0x25f1d0['id'];_0x25f1d0[_0x070e('0x56')]=_0x44e465[_0x070e('0x4e')]['id'];return _0x25f1d0;});return db[_0x070e('0x3b')][_0x070e('0x57')](_0x3022cd,{'transaction':_0x53f9a8});});})[_0x070e('0x20')](function(){return db[_0x070e('0x3b')][_0x070e('0x3d')]({'where':{'IntervalId':_0x44e465[_0x070e('0x4e')]['id']}});});}})['then'](respondWithResult(_0x1214d2,null))[_0x070e('0x3f')](handleError(_0x1214d2,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 74e7aec..6e42bc3 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 _0xb549=['define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports'];(function(_0x4e2cae,_0x36a8d6){var _0x8fc819=function(_0x97a317){while(--_0x97a317){_0x4e2cae['push'](_0x4e2cae['shift']());}};_0x8fc819(++_0x36a8d6);}(_0xb549,0x164));var _0x9b54=function(_0x393d27,_0x3126e8){_0x393d27=_0x393d27-0x0;var _0x1062e7=_0xb549[_0x393d27];return _0x1062e7;};'use strict';var _=require(_0x9b54('0x0'));var util=require(_0x9b54('0x1'));var logger=require(_0x9b54('0x2'))(_0x9b54('0x3'));var moment=require(_0x9b54('0x4'));var BPromise=require(_0x9b54('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b54('0x6'));var rimraf=require(_0x9b54('0x7'));var config=require(_0x9b54('0x8'));var attributes=require(_0x9b54('0x9'));var extensions=require(_0x9b54('0xa'));module[_0x9b54('0xb')]=function(_0x7ba1e2,_0x1ca4a1){return _0x7ba1e2[_0x9b54('0xc')](_0x9b54('0xd'),attributes,{'tableName':_0x9b54('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d1723,_0xe5c713){extensions[_0x9b54('0xf')](_0x7ba1e2,_0x1d1723);},'afterBulkCreate':function(_0x470578,_0x261bb9,_0x3de6f1){_0x3de6f1();extensions['rewrite'](_0x7ba1e2,_0x470578[0x0]);},'afterUpdate':function(_0x2e0950,_0x19e4c9){extensions[_0x9b54('0xf')](_0x7ba1e2,_0x2e0950);},'afterDestroy':function(_0xbb52ea,_0xcd99b2){extensions[_0x9b54('0xf')](_0x7ba1e2,_0xbb52ea);}}});}; \ No newline at end of file +var _0xefdd=['bluebird','request-promise','path','../../components/extensions/rewrite','exports','Interval','rewrite','lodash','util','api','moment'];(function(_0x4f753f,_0x3bd6d3){var _0x43b57b=function(_0x9a489e){while(--_0x9a489e){_0x4f753f['push'](_0x4f753f['shift']());}};_0x43b57b(++_0x3bd6d3);}(_0xefdd,0x75));var _0xdefd=function(_0x4a713d,_0x583513){_0x4a713d=_0x4a713d-0x0;var _0x159ce2=_0xefdd[_0x4a713d];return _0x159ce2;};'use strict';var _=require(_0xdefd('0x0'));var util=require(_0xdefd('0x1'));var logger=require('../../config/logger')(_0xdefd('0x2'));var moment=require(_0xdefd('0x3'));var BPromise=require(_0xdefd('0x4'));var rp=require(_0xdefd('0x5'));var fs=require('fs');var path=require(_0xdefd('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require(_0xdefd('0x7'));module[_0xdefd('0x8')]=function(_0x34eb0a,_0x525fc9){return _0x34eb0a['define'](_0xdefd('0x9'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x83c14e,_0x64bf77){extensions['rewrite'](_0x34eb0a,_0x83c14e);},'afterBulkCreate':function(_0x452a78,_0x3873b6,_0x4f644c){_0x4f644c();extensions[_0xdefd('0xa')](_0x34eb0a,_0x452a78[0x0]);},'afterUpdate':function(_0x124d0e,_0x46f07b){extensions[_0xdefd('0xa')](_0x34eb0a,_0x124d0e);},'afterDestroy':function(_0x249947,_0xa1dd4c){extensions['rewrite'](_0x34eb0a,_0x249947);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 03f656b..6f36635 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 _0xf6c9=['findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowInterval','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','request\x20sent','Interval,\x20%s,\x20%s,\x20%s','stringify','error','Interval,\x20%s,\x20%s','message','info','result','catch','GetInterval','Interval'];(function(_0x5aa4cc,_0x49d641){var _0x52b505=function(_0x5c521e){while(--_0x5c521e){_0x5aa4cc['push'](_0x5aa4cc['shift']());}};_0x52b505(++_0x49d641);}(_0xf6c9,0x146));var _0x9f6c=function(_0x5420c9,_0x39e3f1){_0x5420c9=_0x5420c9-0x0;var _0x54e1de=_0xf6c9[_0x5420c9];return _0x54e1de;};'use strict';var _=require(_0x9f6c('0x0'));var util=require(_0x9f6c('0x1'));var moment=require(_0x9f6c('0x2'));var BPromise=require(_0x9f6c('0x3'));var rs=require(_0x9f6c('0x4'));var fs=require('fs');var Redis=require(_0x9f6c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9f6c('0x6'));var logger=require(_0x9f6c('0x7'))(_0x9f6c('0x8'));var config=require(_0x9f6c('0x9'));var jayson=require(_0x9f6c('0xa'));var client=jayson[_0x9f6c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ddea0,_0x2f64de,_0x3a4eb2){return new BPromise(function(_0x510899,_0x16eab8){return client['request'](_0x3ddea0,_0x3a4eb2)[_0x9f6c('0xc')](function(_0x3def10){logger['info']('Interval,\x20%s,\x20%s',_0x2f64de,_0x9f6c('0xd'));logger['debug'](_0x9f6c('0xe'),_0x2f64de,_0x9f6c('0xd'),JSON[_0x9f6c('0xf')](_0x3def10));if(_0x3def10['error']){if(_0x3def10[_0x9f6c('0x10')]['code']===0x1f4){logger[_0x9f6c('0x10')](_0x9f6c('0x11'),_0x2f64de,_0x3def10[_0x9f6c('0x10')][_0x9f6c('0x12')]);return _0x16eab8(_0x3def10[_0x9f6c('0x10')]['message']);}logger[_0x9f6c('0x10')](_0x9f6c('0x11'),_0x2f64de,_0x3def10[_0x9f6c('0x10')][_0x9f6c('0x12')]);return _0x510899(_0x3def10['error'][_0x9f6c('0x12')]);}else{logger[_0x9f6c('0x13')]('Interval,\x20%s,\x20%s',_0x2f64de,_0x9f6c('0xd'));_0x510899(_0x3def10[_0x9f6c('0x14')][_0x9f6c('0x12')]);}})[_0x9f6c('0x15')](function(_0xeddc01){logger[_0x9f6c('0x10')](_0x9f6c('0x11'),_0x2f64de,_0xeddc01);_0x16eab8(_0xeddc01);});});}exports[_0x9f6c('0x16')]=function(_0x240233){var _0x4a7c2d=this;return new Promise(function(_0x3b178b,_0x1ecc93){return db[_0x9f6c('0x17')][_0x9f6c('0x18')]({'raw':_0x240233[_0x9f6c('0x19')]?_0x240233[_0x9f6c('0x19')][_0x9f6c('0x1a')]===undefined?!![]:![]:!![],'where':_0x240233[_0x9f6c('0x19')]?_0x240233['options'][_0x9f6c('0x1b')]||null:null,'attributes':_0x240233[_0x9f6c('0x19')]?_0x240233[_0x9f6c('0x19')][_0x9f6c('0x1c')]||null:null,'limit':_0x240233['options']?_0x240233['options'][_0x9f6c('0x1d')]||null:null,'include':_0x240233[_0x9f6c('0x19')]?_0x240233[_0x9f6c('0x19')]['include']?_['map'](_0x240233['options'][_0x9f6c('0x1e')],function(_0x1f5239){return{'model':db[_0x1f5239['model']],'as':_0x1f5239['as'],'attributes':_0x1f5239[_0x9f6c('0x1c')],'include':_0x1f5239[_0x9f6c('0x1e')]?_[_0x9f6c('0x1f')](_0x1f5239['include'],function(_0x1d098c){return{'model':db[_0x1d098c[_0x9f6c('0x20')]],'as':_0x1d098c['as'],'attributes':_0x1d098c['attributes'],'include':_0x1d098c[_0x9f6c('0x1e')]?_[_0x9f6c('0x1f')](_0x1d098c['include'],function(_0x2f7006){return{'model':db[_0x2f7006[_0x9f6c('0x20')]],'as':_0x2f7006['as'],'attributes':_0x2f7006[_0x9f6c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9f6c('0xc')](function(_0x21f8dd){logger[_0x9f6c('0x13')](_0x9f6c('0x16'),_0x240233);logger[_0x9f6c('0x21')](_0x9f6c('0x16'),_0x240233,JSON[_0x9f6c('0xf')](_0x21f8dd));_0x3b178b(_0x21f8dd);})[_0x9f6c('0x15')](function(_0x5aa4a6){logger[_0x9f6c('0x10')]('GetInterval',_0x5aa4a6[_0x9f6c('0x12')],_0x240233);_0x1ecc93(_0x4a7c2d['error'](0x1f4,_0x5aa4a6[_0x9f6c('0x12')]));});});};exports[_0x9f6c('0x22')]=function(_0x21eb1e){var _0x2747f7=this;return new Promise(function(_0x16c958,_0x472ead){return db[_0x9f6c('0x17')]['find']({'raw':_0x21eb1e[_0x9f6c('0x19')]?_0x21eb1e[_0x9f6c('0x19')][_0x9f6c('0x1a')]===undefined?!![]:![]:!![],'where':_0x21eb1e[_0x9f6c('0x19')]?_0x21eb1e[_0x9f6c('0x19')]['where']||null:null,'attributes':_0x21eb1e[_0x9f6c('0x19')]?_0x21eb1e[_0x9f6c('0x19')][_0x9f6c('0x1c')]||null:null,'include':_0x21eb1e[_0x9f6c('0x19')]?_0x21eb1e[_0x9f6c('0x19')][_0x9f6c('0x1e')]?_[_0x9f6c('0x1f')](_0x21eb1e[_0x9f6c('0x19')]['include'],function(_0x4d12b7){return{'model':db[_0x4d12b7['model']],'as':_0x4d12b7['as'],'attributes':_0x4d12b7[_0x9f6c('0x1c')],'include':_0x4d12b7[_0x9f6c('0x1e')]?_['map'](_0x4d12b7[_0x9f6c('0x1e')],function(_0x468816){return{'model':db[_0x468816[_0x9f6c('0x20')]],'as':_0x468816['as'],'attributes':_0x468816[_0x9f6c('0x1c')],'include':_0x468816['include']?_[_0x9f6c('0x1f')](_0x468816[_0x9f6c('0x1e')],function(_0x252ec0){return{'model':db[_0x252ec0[_0x9f6c('0x20')]],'as':_0x252ec0['as'],'attributes':_0x252ec0[_0x9f6c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9f6c('0xc')](function(_0x41fbb8){logger[_0x9f6c('0x13')](_0x9f6c('0x22'),_0x21eb1e);logger['debug'](_0x9f6c('0x22'),_0x21eb1e,JSON['stringify'](_0x41fbb8));_0x16c958(_0x41fbb8);})['catch'](function(_0x4b95fc){logger[_0x9f6c('0x10')](_0x9f6c('0x22'),_0x4b95fc[_0x9f6c('0x12')],_0x21eb1e);_0x472ead(_0x2747f7[_0x9f6c('0x10')](0x1f4,_0x4b95fc['message']));});});}; \ No newline at end of file +var _0x67aa=['limit','include','map','model','GetInterval','catch','ShowInterval','Interval','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Interval,\x20%s,\x20%s','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','options','raw','where','attributes'];(function(_0x3b4037,_0x5158c7){var _0x5774c9=function(_0x5bb497){while(--_0x5bb497){_0x3b4037['push'](_0x3b4037['shift']());}};_0x5774c9(++_0x5158c7);}(_0x67aa,0x78));var _0xa67a=function(_0x5cc30e,_0x2646b6){_0x5cc30e=_0x5cc30e-0x0;var _0x208c6d=_0x67aa[_0x5cc30e];return _0x208c6d;};'use strict';var _=require(_0xa67a('0x0'));var util=require(_0xa67a('0x1'));var moment=require(_0xa67a('0x2'));var BPromise=require('bluebird');var rs=require(_0xa67a('0x3'));var fs=require('fs');var Redis=require(_0xa67a('0x4'));var db=require(_0xa67a('0x5'))['db'];var utils=require(_0xa67a('0x6'));var logger=require(_0xa67a('0x7'))(_0xa67a('0x8'));var config=require(_0xa67a('0x9'));var jayson=require(_0xa67a('0xa'));var client=jayson[_0xa67a('0xb')][_0xa67a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36b465,_0x4d3201,_0x5697e0){return new BPromise(function(_0x5d765c,_0x4e22f3){return client[_0xa67a('0xd')](_0x36b465,_0x5697e0)[_0xa67a('0xe')](function(_0x1116e7){logger[_0xa67a('0xf')](_0xa67a('0x10'),_0x4d3201,'request\x20sent');logger[_0xa67a('0x11')](_0xa67a('0x12'),_0x4d3201,'request\x20sent',JSON[_0xa67a('0x13')](_0x1116e7));if(_0x1116e7[_0xa67a('0x14')]){if(_0x1116e7[_0xa67a('0x14')][_0xa67a('0x15')]===0x1f4){logger[_0xa67a('0x14')]('Interval,\x20%s,\x20%s',_0x4d3201,_0x1116e7['error']['message']);return _0x4e22f3(_0x1116e7[_0xa67a('0x14')][_0xa67a('0x16')]);}logger[_0xa67a('0x14')](_0xa67a('0x10'),_0x4d3201,_0x1116e7['error']['message']);return _0x5d765c(_0x1116e7[_0xa67a('0x14')]['message']);}else{logger[_0xa67a('0xf')](_0xa67a('0x10'),_0x4d3201,_0xa67a('0x17'));_0x5d765c(_0x1116e7['result'][_0xa67a('0x16')]);}})['catch'](function(_0x449ead){logger['error'](_0xa67a('0x10'),_0x4d3201,_0x449ead);_0x4e22f3(_0x449ead);});});}exports['GetInterval']=function(_0xd7d246){var _0x4aeaa2=this;return new Promise(function(_0x942c92,_0x100c6c){return db['Interval']['findAll']({'raw':_0xd7d246[_0xa67a('0x18')]?_0xd7d246[_0xa67a('0x18')][_0xa67a('0x19')]===undefined?!![]:![]:!![],'where':_0xd7d246[_0xa67a('0x18')]?_0xd7d246[_0xa67a('0x18')][_0xa67a('0x1a')]||null:null,'attributes':_0xd7d246[_0xa67a('0x18')]?_0xd7d246[_0xa67a('0x18')][_0xa67a('0x1b')]||null:null,'limit':_0xd7d246[_0xa67a('0x18')]?_0xd7d246['options'][_0xa67a('0x1c')]||null:null,'include':_0xd7d246[_0xa67a('0x18')]?_0xd7d246[_0xa67a('0x18')][_0xa67a('0x1d')]?_[_0xa67a('0x1e')](_0xd7d246[_0xa67a('0x18')][_0xa67a('0x1d')],function(_0x4f96f4){return{'model':db[_0x4f96f4[_0xa67a('0x1f')]],'as':_0x4f96f4['as'],'attributes':_0x4f96f4[_0xa67a('0x1b')],'include':_0x4f96f4[_0xa67a('0x1d')]?_['map'](_0x4f96f4['include'],function(_0x2152b4){return{'model':db[_0x2152b4[_0xa67a('0x1f')]],'as':_0x2152b4['as'],'attributes':_0x2152b4[_0xa67a('0x1b')],'include':_0x2152b4[_0xa67a('0x1d')]?_[_0xa67a('0x1e')](_0x2152b4[_0xa67a('0x1d')],function(_0x41d548){return{'model':db[_0x41d548[_0xa67a('0x1f')]],'as':_0x41d548['as'],'attributes':_0x41d548[_0xa67a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa67a('0xe')](function(_0x25e473){logger['info']('GetInterval',_0xd7d246);logger[_0xa67a('0x11')](_0xa67a('0x20'),_0xd7d246,JSON[_0xa67a('0x13')](_0x25e473));_0x942c92(_0x25e473);})[_0xa67a('0x21')](function(_0x4e8b12){logger[_0xa67a('0x14')](_0xa67a('0x20'),_0x4e8b12[_0xa67a('0x16')],_0xd7d246);_0x100c6c(_0x4aeaa2[_0xa67a('0x14')](0x1f4,_0x4e8b12[_0xa67a('0x16')]));});});};exports[_0xa67a('0x22')]=function(_0x48f2f7){var _0x4b89d9=this;return new Promise(function(_0xfa2ae2,_0x8010e){return db[_0xa67a('0x23')][_0xa67a('0x24')]({'raw':_0x48f2f7[_0xa67a('0x18')]?_0x48f2f7[_0xa67a('0x18')][_0xa67a('0x19')]===undefined?!![]:![]:!![],'where':_0x48f2f7['options']?_0x48f2f7[_0xa67a('0x18')][_0xa67a('0x1a')]||null:null,'attributes':_0x48f2f7[_0xa67a('0x18')]?_0x48f2f7[_0xa67a('0x18')]['attributes']||null:null,'include':_0x48f2f7['options']?_0x48f2f7['options'][_0xa67a('0x1d')]?_[_0xa67a('0x1e')](_0x48f2f7[_0xa67a('0x18')]['include'],function(_0x1d49b8){return{'model':db[_0x1d49b8['model']],'as':_0x1d49b8['as'],'attributes':_0x1d49b8[_0xa67a('0x1b')],'include':_0x1d49b8[_0xa67a('0x1d')]?_[_0xa67a('0x1e')](_0x1d49b8[_0xa67a('0x1d')],function(_0x1abfff){return{'model':db[_0x1abfff[_0xa67a('0x1f')]],'as':_0x1abfff['as'],'attributes':_0x1abfff[_0xa67a('0x1b')],'include':_0x1abfff['include']?_[_0xa67a('0x1e')](_0x1abfff[_0xa67a('0x1d')],function(_0x29d90c){return{'model':db[_0x29d90c['model']],'as':_0x29d90c['as'],'attributes':_0x29d90c[_0xa67a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa67a('0xe')](function(_0x29ac66){logger[_0xa67a('0xf')](_0xa67a('0x22'),_0x48f2f7);logger[_0xa67a('0x11')](_0xa67a('0x22'),_0x48f2f7,JSON[_0xa67a('0x13')](_0x29ac66));_0xfa2ae2(_0x29ac66);})[_0xa67a('0x21')](function(_0xb4abee){logger['error'](_0xa67a('0x22'),_0xb4abee[_0xa67a('0x16')],_0x48f2f7);_0x8010e(_0x4b89d9['error'](0x1f4,_0xb4abee[_0xa67a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index fe9311b..391241f 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 _0x0787=['exports','express','../../components/auth/service','./jira.controller','isAuthenticated','send'];(function(_0x358c58,_0x32b2f4){var _0x5bae0c=function(_0x1a2711){while(--_0x1a2711){_0x358c58['push'](_0x358c58['shift']());}};_0x5bae0c(++_0x32b2f4);}(_0x0787,0x115));var _0x7078=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0x0787[_0x39cf70];return _0x580424;};'use strict';var express=require(_0x7078('0x0'));var router=express['Router']();var auth=require(_0x7078('0x1'));var controller=require(_0x7078('0x2'));router['post']('/',auth[_0x7078('0x3')](),controller[_0x7078('0x4')]);module[_0x7078('0x5')]=router; \ No newline at end of file +var _0xf098=['send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0xee3c89,_0x344e1d){var _0x4bf911=function(_0x32fb75){while(--_0x32fb75){_0xee3c89['push'](_0xee3c89['shift']());}};_0x4bf911(++_0x344e1d);}(_0xf098,0x194));var _0x8f09=function(_0x3d4a36,_0x1e7d6a){_0x3d4a36=_0x3d4a36-0x0;var _0x101769=_0xf098[_0x3d4a36];return _0x101769;};'use strict';var express=require(_0x8f09('0x0'));var router=express[_0x8f09('0x1')]();var auth=require(_0x8f09('0x2'));var controller=require(_0x8f09('0x3'));router['post']('/',auth['isAuthenticated'](),controller[_0x8f09('0x4')]);module[_0x8f09('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index bc53d7d..fd73b69 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 _0x312d=['reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','utf8','data','statusCode','json','parse','error','status','api.jira','write','end','openIssue','body','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','Bug','fields','customfield_11500','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_11504'];(function(_0x5dabef,_0xd034c9){var _0x252695=function(_0x4f523e){while(--_0x4f523e){_0x5dabef['push'](_0x5dabef['shift']());}};_0x252695(++_0xd034c9);}(_0x312d,0xc7));var _0xd312=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x312d[_0x23e7c1];return _0x1add43;};'use strict';var BPromise=require('bluebird');var https=require(_0xd312('0x0'));var logger=require(_0xd312('0x1'))(_0xd312('0x2'));var USERNAME=_0xd312('0x3');var PASSWORD=_0xd312('0x4');function openIssue(_0x2e7ddc,_0x35960a){var _0x117994={'fields':{'project':{'key':_0x2e7ddc[_0xd312('0x5')]||_0xd312('0x6')},'summary':(_0x2e7ddc[_0xd312('0x7')]||_0xd312('0x8'))+_0xd312('0x9')+_0x2e7ddc['ip'],'description':_0x2e7ddc[_0xd312('0xa')]||JSON[_0xd312('0xb')](_0x2e7ddc),'issuetype':{'name':_0x2e7ddc['issuetype']||_0xd312('0xc')}}};_0x117994[_0xd312('0xd')][_0xd312('0xe')]=_0x2e7ddc['email'];_0x117994[_0xd312('0xd')][_0xd312('0xf')]=_0x2e7ddc['oldToken'];_0x117994[_0xd312('0xd')][_0xd312('0x10')]=_0x2e7ddc[_0xd312('0x11')];_0x117994[_0xd312('0xd')][_0xd312('0x12')]=_0x2e7ddc[_0xd312('0x13')];_0x117994[_0xd312('0xd')][_0xd312('0x14')]=_0x2e7ddc[_0xd312('0x15')];_0x117994[_0xd312('0xd')][_0xd312('0x16')]=_0x2e7ddc['ip'];var _0x2e7598={'host':_0xd312('0x17'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xd312('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0xd312('0x19'),'Authorization':_0xd312('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0xd312('0x1b')]('base64')}};var _0x29c177=JSON[_0xd312('0xb')](_0x117994);var _0x4d2598=https['request'](_0x2e7598,function(_0x2b2b72){_0x2b2b72['setEncoding'](_0xd312('0x1c'));var _0x4ad67f='';_0x2b2b72['on'](_0xd312('0x1d'),function(_0x2b0a06){_0x4ad67f+=_0x2b0a06;});_0x2b2b72['on']('end',function(){if(_0x35960a){return _0x35960a['status'](_0x2b2b72[_0xd312('0x1e')])[_0xd312('0x1f')](JSON[_0xd312('0x20')](_0x4ad67f));}});});_0x4d2598['on'](_0xd312('0x21'),function(_0xc6c1fd){if(_0x35960a){return _0x35960a[_0xd312('0x22')](0x1f4)[_0xd312('0x1f')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xd312('0x23')}]});}});_0x4d2598[_0xd312('0x24')](_0x29c177);_0x4d2598[_0xd312('0x25')]();}exports[_0xd312('0x26')]=openIssue;exports['send']=function(_0x162272,_0x166c7d){_0x162272[_0xd312('0x27')]['ip']=_0x162272['headers'][_0xd312('0x28')]||_0x162272[_0xd312('0x29')]['remoteAddress']||_0x162272['socket'][_0xd312('0x2a')]||_0x162272[_0xd312('0x29')][_0xd312('0x2b')][_0xd312('0x2a')];return openIssue(_0x162272['body'],_0x166c7d);}; \ No newline at end of file +var _0xbd01=['end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','api','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','issuetype','Bug','customfield_11500','email','fields','oldToken','customfield_11502','newToken','customfield_11503','reason','customfield_10102','/rest/api/2/issue','application/json','Basic\x20','toString','base64','stringify','request','setEncoding','utf8','data'];(function(_0x12fca3,_0x1dd5e4){var _0x1aa91f=function(_0x4db804){while(--_0x4db804){_0x12fca3['push'](_0x12fca3['shift']());}};_0x1aa91f(++_0x1dd5e4);}(_0xbd01,0xc8));var _0x1bd0=function(_0x2f41b0,_0x2984a8){_0x2f41b0=_0x2f41b0-0x0;var _0x55396b=_0xbd01[_0x2f41b0];return _0x55396b;};'use strict';var BPromise=require(_0x1bd0('0x0'));var https=require('https');var logger=require('../../config/logger')(_0x1bd0('0x1'));var USERNAME=_0x1bd0('0x2');var PASSWORD=_0x1bd0('0x3');function openIssue(_0x5423aa,_0x136db3){var _0x5724c0={'fields':{'project':{'key':_0x5423aa[_0x1bd0('0x4')]||_0x1bd0('0x5')},'summary':(_0x5423aa[_0x1bd0('0x6')]||'Report')+_0x1bd0('0x7')+_0x5423aa['ip'],'description':_0x5423aa[_0x1bd0('0x8')]||JSON['stringify'](_0x5423aa),'issuetype':{'name':_0x5423aa[_0x1bd0('0x9')]||_0x1bd0('0xa')}}};_0x5724c0['fields'][_0x1bd0('0xb')]=_0x5423aa[_0x1bd0('0xc')];_0x5724c0[_0x1bd0('0xd')]['customfield_11501']=_0x5423aa[_0x1bd0('0xe')];_0x5724c0[_0x1bd0('0xd')][_0x1bd0('0xf')]=_0x5423aa[_0x1bd0('0x10')];_0x5724c0[_0x1bd0('0xd')][_0x1bd0('0x11')]=_0x5423aa['name'];_0x5724c0[_0x1bd0('0xd')]['customfield_11504']=_0x5423aa[_0x1bd0('0x12')];_0x5724c0[_0x1bd0('0xd')][_0x1bd0('0x13')]=_0x5423aa['ip'];var _0x1452bd={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x1bd0('0x14'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x1bd0('0x15'),'Authorization':_0x1bd0('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x1bd0('0x17')](_0x1bd0('0x18'))}};var _0x42a066=JSON[_0x1bd0('0x19')](_0x5724c0);var _0x2c0aef=https[_0x1bd0('0x1a')](_0x1452bd,function(_0x15169c){_0x15169c[_0x1bd0('0x1b')](_0x1bd0('0x1c'));var _0x243ea3='';_0x15169c['on'](_0x1bd0('0x1d'),function(_0x52f534){_0x243ea3+=_0x52f534;});_0x15169c['on'](_0x1bd0('0x1e'),function(){if(_0x136db3){return _0x136db3[_0x1bd0('0x1f')](_0x15169c[_0x1bd0('0x20')])[_0x1bd0('0x21')](JSON[_0x1bd0('0x22')](_0x243ea3));}});});_0x2c0aef['on'](_0x1bd0('0x23'),function(_0xff9fc5){if(_0x136db3){return _0x136db3[_0x1bd0('0x1f')](0x1f4)[_0x1bd0('0x21')]({'errors':[{'message':_0x1bd0('0x24'),'type':'api.jira'}]});}});_0x2c0aef[_0x1bd0('0x25')](_0x42a066);_0x2c0aef[_0x1bd0('0x1e')]();}exports[_0x1bd0('0x26')]=openIssue;exports[_0x1bd0('0x27')]=function(_0xd3a86e,_0x5eceec){_0xd3a86e[_0x1bd0('0x28')]['ip']=_0xd3a86e[_0x1bd0('0x29')][_0x1bd0('0x2a')]||_0xd3a86e[_0x1bd0('0x2b')][_0x1bd0('0x2c')]||_0xd3a86e[_0x1bd0('0x2d')]['remoteAddress']||_0xd3a86e[_0x1bd0('0x2b')][_0x1bd0('0x2d')][_0x1bd0('0x2c')];return openIssue(_0xd3a86e['body'],_0x5eceec);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 96e5d53..27fca87 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 _0x9ab2=['isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get'];(function(_0x2387b8,_0x12124e){var _0x30a45b=function(_0xd84851){while(--_0xd84851){_0x2387b8['push'](_0x2387b8['shift']());}};_0x30a45b(++_0x12124e);}(_0x9ab2,0x1c3));var _0x29ab=function(_0x398047,_0x179436){_0x398047=_0x398047-0x0;var _0x260f51=_0x9ab2[_0x398047];return _0x260f51;};'use strict';var multer=require(_0x29ab('0x0'));var util=require('util');var path=require(_0x29ab('0x1'));var timeout=require(_0x29ab('0x2'));var express=require(_0x29ab('0x3'));var router=express['Router']();var auth=require(_0x29ab('0x4'));var interaction=require(_0x29ab('0x5'));var config=require(_0x29ab('0x6'));var controller=require(_0x29ab('0x7'));router[_0x29ab('0x8')]('/',auth[_0x29ab('0x9')](),controller[_0x29ab('0xa')]);router[_0x29ab('0x8')]('/describe',auth[_0x29ab('0x9')](),controller['describe']);router['get']('/:id',auth[_0x29ab('0x9')](),controller[_0x29ab('0xb')]);router[_0x29ab('0xc')]('/',auth[_0x29ab('0x9')](),controller[_0x29ab('0xd')]);router[_0x29ab('0xe')](_0x29ab('0xf'),auth['isAuthenticated'](),controller[_0x29ab('0x10')]);router[_0x29ab('0x11')](_0x29ab('0xf'),auth[_0x29ab('0x9')](),controller[_0x29ab('0x12')]);module[_0x29ab('0x13')]=router; \ No newline at end of file +var _0x6755=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x5baa64,_0x1e8833){var _0x1d11d7=function(_0x2c7fd4){while(--_0x2c7fd4){_0x5baa64['push'](_0x5baa64['shift']());}};_0x1d11d7(++_0x1e8833);}(_0x6755,0x19e));var _0x5675=function(_0x825629,_0x184ebb){_0x825629=_0x825629-0x0;var _0xc88361=_0x6755[_0x825629];return _0xc88361;};'use strict';var multer=require('multer');var util=require(_0x5675('0x0'));var path=require(_0x5675('0x1'));var timeout=require('connect-timeout');var express=require(_0x5675('0x2'));var router=express[_0x5675('0x3')]();var auth=require(_0x5675('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5675('0x5'));var controller=require(_0x5675('0x6'));router[_0x5675('0x7')]('/',auth[_0x5675('0x8')](),controller[_0x5675('0x9')]);router[_0x5675('0x7')](_0x5675('0xa'),auth[_0x5675('0x8')](),controller[_0x5675('0xb')]);router[_0x5675('0x7')](_0x5675('0xc'),auth[_0x5675('0x8')](),controller['show']);router[_0x5675('0xd')]('/',auth[_0x5675('0x8')](),controller[_0x5675('0xe')]);router[_0x5675('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x5675('0x10')]);router[_0x5675('0x11')](_0x5675('0xc'),auth[_0x5675('0x8')](),controller[_0x5675('0x12')]);module[_0x5675('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index d5d491c..7ff45b0 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 _0x8a25=['STRING','long','sequelize','exports'];(function(_0x1b9ada,_0x40c20d){var _0x12b0b2=function(_0x2bd65e){while(--_0x2bd65e){_0x1b9ada['push'](_0x1b9ada['shift']());}};_0x12b0b2(++_0x40c20d);}(_0x8a25,0x196));var _0x58a2=function(_0xfc4828,_0x1bc776){_0xfc4828=_0xfc4828-0x0;var _0x3d5c0f=_0x8a25[_0xfc4828];return _0x3d5c0f;};'use strict';var Sequelize=require(_0x58a2('0x0'));module[_0x58a2('0x1')]={'question':{'type':Sequelize[_0x58a2('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x58a2('0x3'))},'membername':{'type':Sequelize[_0x58a2('0x2')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x58a2('0x2')]},'uniqueid':{'type':Sequelize[_0x58a2('0x2')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x58a2('0x2')]},'questionId':{'type':Sequelize[_0x58a2('0x2')]}}; \ No newline at end of file +var _0xb2ec=['long','STRING','exports','TEXT'];(function(_0x143565,_0x54d887){var _0x4dc1d9=function(_0x5e8838){while(--_0x5e8838){_0x143565['push'](_0x143565['shift']());}};_0x4dc1d9(++_0x54d887);}(_0xb2ec,0x8e));var _0xcb2e=function(_0x4a0c0f,_0x481289){_0x4a0c0f=_0x4a0c0f-0x0;var _0x1f06f4=_0xb2ec[_0x4a0c0f];return _0x1f06f4;};'use strict';var Sequelize=require('sequelize');module[_0xcb2e('0x0')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0xcb2e('0x1')](_0xcb2e('0x2'))},'membername':{'type':Sequelize[_0xcb2e('0x3')]},'projectname':{'type':Sequelize[_0xcb2e('0x3')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xcb2e('0x3')]},'calleridname':{'type':Sequelize[_0xcb2e('0x3')]},'calleridnum':{'type':Sequelize[_0xcb2e('0x3')]},'questionId':{'type':Sequelize[_0xcb2e('0x3')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 50d0a24..26c3e97 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 _0x7510=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x2d99a2,_0x1c9ac7){var _0x3c40ef=function(_0x5037cb){while(--_0x5037cb){_0x2d99a2['push'](_0x2d99a2['shift']());}};_0x3c40ef(++_0x1c9ac7);}(_0x7510,0xa9));var _0x0751=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7510[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0751('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0751('0x1'));var jsonpatch=require(_0x0751('0x2'));var rp=require(_0x0751('0x3'));var moment=require('moment');var BPromise=require(_0x0751('0x4'));var Mustache=require(_0x0751('0x5'));var util=require(_0x0751('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0751('0x7'));var squel=require('squel');var crypto=require(_0x0751('0x8'));var jsforce=require(_0x0751('0x9'));var deskjs=require(_0x0751('0xa'));var toCsv=require(_0x0751('0xb'));var querystring=require(_0x0751('0xc'));var Papa=require(_0x0751('0xd'));var Redis=require(_0x0751('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0751('0xf'));var as=require(_0x0751('0x10'));var hardwareService=require(_0x0751('0x11'));var logger=require(_0x0751('0x12'))(_0x0751('0x13'));var utils=require('../../config/utils');var config=require(_0x0751('0x14'));var db=require(_0x0751('0x15'))['db'];function respondWithStatusCode(_0x7f8f87,_0x16b239){_0x16b239=_0x16b239||0xcc;return function(_0x340a1d){if(_0x340a1d){return _0x7f8f87[_0x0751('0x16')](_0x16b239);}return _0x7f8f87['status'](_0x16b239)['end']();};}function respondWithResult(_0x244b35,_0x12110b){_0x12110b=_0x12110b||0xc8;return function(_0x1dc807){if(_0x1dc807){return _0x244b35[_0x0751('0x17')](_0x12110b)[_0x0751('0x18')](_0x1dc807);}};}function respondWithFilteredResult(_0x3bd842,_0x4a3c0e){return function(_0x459c8f){if(_0x459c8f){var _0x56c928=_0x459c8f[_0x0751('0x19')],_0x1a3e87=_0x4a3c0e[_0x0751('0x1a')],_0x6545db=_0x4a3c0e[_0x0751('0x1a')]+_0x4a3c0e[_0x0751('0x1b')],_0xea2eec;if(_0x6545db>=_0x56c928){_0x6545db=_0x56c928;_0xea2eec=0xc8;}else{_0xea2eec=0xce;}_0x3bd842[_0x0751('0x17')](_0xea2eec);return _0x3bd842[_0x0751('0x1c')]('Content-Range',_0x1a3e87+'-'+_0x6545db+'/'+_0x56c928)[_0x0751('0x18')](_0x459c8f);}return null;};}function patchUpdates(_0x24d034){return function(_0x305efd){try{jsonpatch[_0x0751('0x1d')](_0x305efd,_0x24d034,!![]);}catch(_0x3ddad2){return BPromise[_0x0751('0x1e')](_0x3ddad2);}return _0x305efd['save']();};}function saveUpdates(_0x5d84a9,_0x13500f){return function(_0x153564){if(_0x153564){return _0x153564[_0x0751('0x1f')](_0x5d84a9)[_0x0751('0x20')](function(_0x5c8414){return _0x5c8414;});}return null;};}function removeEntity(_0x2630cb,_0x2e72a8){return function(_0x2eacee){if(_0x2eacee){return _0x2eacee[_0x0751('0x21')]()[_0x0751('0x20')](function(){_0x2630cb[_0x0751('0x17')](0xcc)[_0x0751('0x22')]();});}};}function handleEntityNotFound(_0x459058,_0x34734a){return function(_0x578172){if(!_0x578172){_0x459058[_0x0751('0x16')](0x194);}return _0x578172;};}function handleError(_0x1efb3d,_0x20b055){_0x20b055=_0x20b055||0x1f4;return function(_0x5a237d){logger[_0x0751('0x23')](_0x5a237d[_0x0751('0x24')]);if(_0x5a237d[_0x0751('0x25')]){delete _0x5a237d[_0x0751('0x25')];}_0x1efb3d[_0x0751('0x17')](_0x20b055)[_0x0751('0x26')](_0x5a237d);};}exports[_0x0751('0x27')]=function(_0x5a9852,_0x165c59){var _0x4bc374={},_0x507b41={},_0x2c5130={'count':0x0,'rows':[]};var _0x448d93=_[_0x0751('0x28')](db[_0x0751('0x29')][_0x0751('0x2a')],function(_0x24bfe4){return{'name':_0x24bfe4[_0x0751('0x2b')],'type':_0x24bfe4[_0x0751('0x2c')][_0x0751('0x2d')]};});_0x507b41[_0x0751('0x2e')]=_['map'](_0x448d93,_0x0751('0x25'));_0x507b41[_0x0751('0x2f')]=_[_0x0751('0x30')](_0x5a9852[_0x0751('0x2f')]);_0x507b41[_0x0751('0x31')]=_[_0x0751('0x32')](_0x507b41[_0x0751('0x2e')],_0x507b41[_0x0751('0x2f')]);_0x4bc374[_0x0751('0x33')]=_['intersection'](_0x507b41[_0x0751('0x2e')],qs[_0x0751('0x34')](_0x5a9852[_0x0751('0x2f')]['fields']));_0x4bc374[_0x0751('0x33')]=_0x4bc374[_0x0751('0x33')]['length']?_0x4bc374[_0x0751('0x33')]:_0x507b41[_0x0751('0x2e')];if(!_0x5a9852[_0x0751('0x2f')][_0x0751('0x35')](_0x0751('0x36'))){_0x4bc374[_0x0751('0x1b')]=qs['limit'](_0x5a9852[_0x0751('0x2f')][_0x0751('0x1b')]);_0x4bc374[_0x0751('0x1a')]=qs[_0x0751('0x1a')](_0x5a9852['query'][_0x0751('0x1a')]);}_0x4bc374[_0x0751('0x37')]=qs[_0x0751('0x38')](_0x5a9852['query'][_0x0751('0x38')]);_0x4bc374[_0x0751('0x39')]=qs['filters'](_[_0x0751('0x3a')](_0x5a9852[_0x0751('0x2f')],_0x507b41[_0x0751('0x31')]));if(_0x5a9852[_0x0751('0x2f')][_0x0751('0x3b')]){_0x4bc374[_0x0751('0x39')]=_[_0x0751('0x3c')](_0x4bc374['where'],{'$or':_[_0x0751('0x28')](_0x448d93,function(_0x194e8c){if(_0x194e8c[_0x0751('0x2c')]!=='VIRTUAL'){var _0x5db57a={};_0x5db57a[_0x194e8c[_0x0751('0x25')]]={'$like':'%'+_0x5a9852[_0x0751('0x2f')][_0x0751('0x3b')]+'%'};return _0x5db57a;}})});}_0x4bc374=_[_0x0751('0x3c')]({},_0x4bc374,_0x5a9852[_0x0751('0x3d')]);var _0x16368a={'where':_0x4bc374[_0x0751('0x39')]};return db[_0x0751('0x29')][_0x0751('0x19')](_0x16368a)[_0x0751('0x20')](function(_0x5733ba){_0x2c5130['count']=_0x5733ba;if(_0x5a9852[_0x0751('0x2f')][_0x0751('0x3e')]){_0x4bc374[_0x0751('0x3f')]=[{'all':!![]}];}return db[_0x0751('0x29')][_0x0751('0x40')](_0x4bc374);})[_0x0751('0x20')](function(_0x263509){_0x2c5130[_0x0751('0x41')]=_0x263509;return _0x2c5130;})[_0x0751('0x20')](respondWithFilteredResult(_0x165c59,_0x4bc374))['catch'](handleError(_0x165c59,null));};exports[_0x0751('0x42')]=function(_0x2accc9,_0x2717d2){var _0x53524b={'raw':!![],'where':{'id':_0x2accc9[_0x0751('0x43')]['id']}},_0xf123c3={};_0xf123c3['model']=_[_0x0751('0x30')](db['JscriptyAnswerReport'][_0x0751('0x2a')]);_0xf123c3[_0x0751('0x2f')]=_['keys'](_0x2accc9['query']);_0xf123c3[_0x0751('0x31')]=_[_0x0751('0x32')](_0xf123c3['model'],_0xf123c3[_0x0751('0x2f')]);_0x53524b[_0x0751('0x33')]=_['intersection'](_0xf123c3[_0x0751('0x2e')],qs[_0x0751('0x34')](_0x2accc9['query'][_0x0751('0x34')]));_0x53524b['attributes']=_0x53524b[_0x0751('0x33')][_0x0751('0x44')]?_0x53524b[_0x0751('0x33')]:_0xf123c3[_0x0751('0x2e')];if(_0x2accc9[_0x0751('0x2f')][_0x0751('0x3e')]){_0x53524b[_0x0751('0x3f')]=[{'all':!![]}];}_0x53524b=_[_0x0751('0x3c')]({},_0x53524b,_0x2accc9[_0x0751('0x3d')]);return db[_0x0751('0x29')][_0x0751('0x45')](_0x53524b)[_0x0751('0x20')](handleEntityNotFound(_0x2717d2,null))[_0x0751('0x20')](respondWithResult(_0x2717d2,null))[_0x0751('0x46')](handleError(_0x2717d2,null));};exports[_0x0751('0x47')]=function(_0x220bf5,_0x1bf1fa){return db['JscriptyAnswerReport'][_0x0751('0x47')](_0x220bf5[_0x0751('0x48')],{})[_0x0751('0x20')](respondWithResult(_0x1bf1fa,0xc9))['catch'](handleError(_0x1bf1fa,null));};exports[_0x0751('0x1f')]=function(_0x386c5b,_0x414ac6){if(_0x386c5b[_0x0751('0x48')]['id']){delete _0x386c5b[_0x0751('0x48')]['id'];}return db[_0x0751('0x29')]['find']({'where':{'id':_0x386c5b[_0x0751('0x43')]['id']}})[_0x0751('0x20')](handleEntityNotFound(_0x414ac6,null))[_0x0751('0x20')](saveUpdates(_0x386c5b[_0x0751('0x48')],null))[_0x0751('0x20')](respondWithResult(_0x414ac6,null))[_0x0751('0x46')](handleError(_0x414ac6,null));};exports[_0x0751('0x21')]=function(_0x40af96,_0x1ab7d6){return db[_0x0751('0x29')][_0x0751('0x45')]({'where':{'id':_0x40af96[_0x0751('0x43')]['id']}})[_0x0751('0x20')](handleEntityNotFound(_0x1ab7d6,null))['then'](removeEntity(_0x1ab7d6,null))[_0x0751('0x46')](handleError(_0x1ab7d6,null));};exports[_0x0751('0x49')]=function(_0x928afc,_0x458389){return db['JscriptyAnswerReport'][_0x0751('0x49')]()[_0x0751('0x20')](respondWithResult(_0x458389,null))[_0x0751('0x46')](handleError(_0x458389,null));}; \ No newline at end of file +var _0x09a7=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','reject','save','then','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','rows','include','find','catch','create','body','update','destroy','params','describe','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','squel','crypto'];(function(_0x51038b,_0x11b324){var _0x30f6d2=function(_0x463d92){while(--_0x463d92){_0x51038b['push'](_0x51038b['shift']());}};_0x30f6d2(++_0x11b324);}(_0x09a7,0x15d));var _0x709a=function(_0x53dee7,_0xcfea56){_0x53dee7=_0x53dee7-0x0;var _0x399b3a=_0x09a7[_0x53dee7];return _0x399b3a;};'use strict';var pdf=require(_0x709a('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x709a('0x1'));var jsonpatch=require(_0x709a('0x2'));var rp=require(_0x709a('0x3'));var moment=require('moment');var BPromise=require(_0x709a('0x4'));var Mustache=require('mustache');var util=require(_0x709a('0x5'));var path=require('path');var sox=require(_0x709a('0x6'));var csv=require(_0x709a('0x7'));var ejs=require(_0x709a('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x709a('0x9'));var crypto=require(_0x709a('0xa'));var jsforce=require(_0x709a('0xb'));var deskjs=require(_0x709a('0xc'));var toCsv=require(_0x709a('0x7'));var querystring=require('querystring');var Papa=require(_0x709a('0xd'));var Redis=require(_0x709a('0xe'));var authService=require(_0x709a('0xf'));var qs=require(_0x709a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x709a('0x11'));var logger=require(_0x709a('0x12'))(_0x709a('0x13'));var utils=require(_0x709a('0x14'));var config=require(_0x709a('0x15'));var db=require(_0x709a('0x16'))['db'];function respondWithStatusCode(_0x5cd189,_0xb8694d){_0xb8694d=_0xb8694d||0xcc;return function(_0x368a79){if(_0x368a79){return _0x5cd189[_0x709a('0x17')](_0xb8694d);}return _0x5cd189[_0x709a('0x18')](_0xb8694d)[_0x709a('0x19')]();};}function respondWithResult(_0x2b3a58,_0x4e4f4f){_0x4e4f4f=_0x4e4f4f||0xc8;return function(_0x2198ac){if(_0x2198ac){return _0x2b3a58['status'](_0x4e4f4f)[_0x709a('0x1a')](_0x2198ac);}};}function respondWithFilteredResult(_0x4a54d9,_0x3b2492){return function(_0x50f853){if(_0x50f853){var _0xc4e75e=_0x50f853['count'],_0x1650ad=_0x3b2492['offset'],_0x45d30d=_0x3b2492[_0x709a('0x1b')]+_0x3b2492['limit'],_0x38a849;if(_0x45d30d>=_0xc4e75e){_0x45d30d=_0xc4e75e;_0x38a849=0xc8;}else{_0x38a849=0xce;}_0x4a54d9['status'](_0x38a849);return _0x4a54d9[_0x709a('0x1c')]('Content-Range',_0x1650ad+'-'+_0x45d30d+'/'+_0xc4e75e)[_0x709a('0x1a')](_0x50f853);}return null;};}function patchUpdates(_0x437e6f){return function(_0x1f9979){try{jsonpatch['apply'](_0x1f9979,_0x437e6f,!![]);}catch(_0x1f06dc){return BPromise[_0x709a('0x1d')](_0x1f06dc);}return _0x1f9979[_0x709a('0x1e')]();};}function saveUpdates(_0x4d4668,_0x298c1b){return function(_0x478e5d){if(_0x478e5d){return _0x478e5d['update'](_0x4d4668)[_0x709a('0x1f')](function(_0x3ca24a){return _0x3ca24a;});}return null;};}function removeEntity(_0xc289c7,_0x2d2432){return function(_0x3b6816){if(_0x3b6816){return _0x3b6816['destroy']()['then'](function(){_0xc289c7[_0x709a('0x18')](0xcc)[_0x709a('0x19')]();});}};}function handleEntityNotFound(_0x3a4dd1,_0x577508){return function(_0x560766){if(!_0x560766){_0x3a4dd1[_0x709a('0x17')](0x194);}return _0x560766;};}function handleError(_0x399ecc,_0x545ec8){_0x545ec8=_0x545ec8||0x1f4;return function(_0x4eefb5){logger[_0x709a('0x20')](_0x4eefb5[_0x709a('0x21')]);if(_0x4eefb5[_0x709a('0x22')]){delete _0x4eefb5[_0x709a('0x22')];}_0x399ecc[_0x709a('0x18')](_0x545ec8)[_0x709a('0x23')](_0x4eefb5);};}exports[_0x709a('0x24')]=function(_0x2c8875,_0x1a7577){var _0x5e0f70={},_0x3ba457={},_0x199872={'count':0x0,'rows':[]};var _0x1aa7e2=_[_0x709a('0x25')](db[_0x709a('0x26')][_0x709a('0x27')],function(_0x447ec6){return{'name':_0x447ec6[_0x709a('0x28')],'type':_0x447ec6[_0x709a('0x29')]['key']};});_0x3ba457[_0x709a('0x2a')]=_[_0x709a('0x25')](_0x1aa7e2,_0x709a('0x22'));_0x3ba457[_0x709a('0x2b')]=_[_0x709a('0x2c')](_0x2c8875[_0x709a('0x2b')]);_0x3ba457[_0x709a('0x2d')]=_[_0x709a('0x2e')](_0x3ba457['model'],_0x3ba457[_0x709a('0x2b')]);_0x5e0f70['attributes']=_[_0x709a('0x2e')](_0x3ba457[_0x709a('0x2a')],qs[_0x709a('0x2f')](_0x2c8875[_0x709a('0x2b')][_0x709a('0x2f')]));_0x5e0f70[_0x709a('0x30')]=_0x5e0f70[_0x709a('0x30')][_0x709a('0x31')]?_0x5e0f70[_0x709a('0x30')]:_0x3ba457[_0x709a('0x2a')];if(!_0x2c8875['query'][_0x709a('0x32')]('nolimit')){_0x5e0f70[_0x709a('0x33')]=qs['limit'](_0x2c8875['query']['limit']);_0x5e0f70[_0x709a('0x1b')]=qs[_0x709a('0x1b')](_0x2c8875[_0x709a('0x2b')][_0x709a('0x1b')]);}_0x5e0f70[_0x709a('0x34')]=qs[_0x709a('0x35')](_0x2c8875[_0x709a('0x2b')][_0x709a('0x35')]);_0x5e0f70[_0x709a('0x36')]=qs['filters'](_[_0x709a('0x37')](_0x2c8875[_0x709a('0x2b')],_0x3ba457[_0x709a('0x2d')]));if(_0x2c8875['query'][_0x709a('0x38')]){_0x5e0f70['where']=_['merge'](_0x5e0f70[_0x709a('0x36')],{'$or':_[_0x709a('0x25')](_0x1aa7e2,function(_0xaa5238){if(_0xaa5238[_0x709a('0x29')]!==_0x709a('0x39')){var _0x40f5c4={};_0x40f5c4[_0xaa5238[_0x709a('0x22')]]={'$like':'%'+_0x2c8875[_0x709a('0x2b')][_0x709a('0x38')]+'%'};return _0x40f5c4;}})});}_0x5e0f70=_[_0x709a('0x3a')]({},_0x5e0f70,_0x2c8875[_0x709a('0x3b')]);var _0x2d729e={'where':_0x5e0f70[_0x709a('0x36')]};return db[_0x709a('0x26')][_0x709a('0x3c')](_0x2d729e)['then'](function(_0x1cddda){_0x199872['count']=_0x1cddda;if(_0x2c8875[_0x709a('0x2b')][_0x709a('0x3d')]){_0x5e0f70['include']=[{'all':!![]}];}return db[_0x709a('0x26')]['findAll'](_0x5e0f70);})[_0x709a('0x1f')](function(_0x1f3b2f){_0x199872[_0x709a('0x3e')]=_0x1f3b2f;return _0x199872;})[_0x709a('0x1f')](respondWithFilteredResult(_0x1a7577,_0x5e0f70))['catch'](handleError(_0x1a7577,null));};exports['show']=function(_0x4ea284,_0x28df6f){var _0x266d6c={'raw':!![],'where':{'id':_0x4ea284['params']['id']}},_0x58b5e0={};_0x58b5e0[_0x709a('0x2a')]=_[_0x709a('0x2c')](db[_0x709a('0x26')][_0x709a('0x27')]);_0x58b5e0[_0x709a('0x2b')]=_[_0x709a('0x2c')](_0x4ea284[_0x709a('0x2b')]);_0x58b5e0[_0x709a('0x2d')]=_['intersection'](_0x58b5e0['model'],_0x58b5e0[_0x709a('0x2b')]);_0x266d6c[_0x709a('0x30')]=_[_0x709a('0x2e')](_0x58b5e0[_0x709a('0x2a')],qs['fields'](_0x4ea284[_0x709a('0x2b')][_0x709a('0x2f')]));_0x266d6c[_0x709a('0x30')]=_0x266d6c['attributes']['length']?_0x266d6c[_0x709a('0x30')]:_0x58b5e0[_0x709a('0x2a')];if(_0x4ea284[_0x709a('0x2b')][_0x709a('0x3d')]){_0x266d6c[_0x709a('0x3f')]=[{'all':!![]}];}_0x266d6c=_[_0x709a('0x3a')]({},_0x266d6c,_0x4ea284['options']);return db[_0x709a('0x26')][_0x709a('0x40')](_0x266d6c)[_0x709a('0x1f')](handleEntityNotFound(_0x28df6f,null))[_0x709a('0x1f')](respondWithResult(_0x28df6f,null))[_0x709a('0x41')](handleError(_0x28df6f,null));};exports['create']=function(_0x1f9c82,_0x337b91){return db[_0x709a('0x26')][_0x709a('0x42')](_0x1f9c82[_0x709a('0x43')],{})['then'](respondWithResult(_0x337b91,0xc9))[_0x709a('0x41')](handleError(_0x337b91,null));};exports[_0x709a('0x44')]=function(_0x20abb7,_0x279fca){if(_0x20abb7[_0x709a('0x43')]['id']){delete _0x20abb7[_0x709a('0x43')]['id'];}return db[_0x709a('0x26')][_0x709a('0x40')]({'where':{'id':_0x20abb7['params']['id']}})[_0x709a('0x1f')](handleEntityNotFound(_0x279fca,null))[_0x709a('0x1f')](saveUpdates(_0x20abb7[_0x709a('0x43')],null))[_0x709a('0x1f')](respondWithResult(_0x279fca,null))[_0x709a('0x41')](handleError(_0x279fca,null));};exports[_0x709a('0x45')]=function(_0x223c4f,_0x51ff9){return db[_0x709a('0x26')][_0x709a('0x40')]({'where':{'id':_0x223c4f[_0x709a('0x46')]['id']}})[_0x709a('0x1f')](handleEntityNotFound(_0x51ff9,null))[_0x709a('0x1f')](removeEntity(_0x51ff9,null))[_0x709a('0x41')](handleError(_0x51ff9,null));};exports[_0x709a('0x47')]=function(_0xf0f25e,_0x473fbd){return db[_0x709a('0x26')]['describe']()[_0x709a('0x1f')](respondWithResult(_0x473fbd,null))[_0x709a('0x41')](handleError(_0x473fbd,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index b34ffb0..fd765dc 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 _0x7a59=['report_jscripty_answers','lodash','util','../../config/logger','moment','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define'];(function(_0x268d91,_0xef980a){var _0x4ab93c=function(_0x20088f){while(--_0x20088f){_0x268d91['push'](_0x268d91['shift']());}};_0x4ab93c(++_0xef980a);}(_0x7a59,0x12d));var _0x97a5=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x7a59[_0x310504];return _0x5b36d0;};'use strict';var _=require(_0x97a5('0x0'));var util=require(_0x97a5('0x1'));var logger=require(_0x97a5('0x2'))('api');var moment=require(_0x97a5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x97a5('0x4'));var rimraf=require('rimraf');var config=require(_0x97a5('0x5'));var attributes=require(_0x97a5('0x6'));module[_0x97a5('0x7')]=function(_0x50936f,_0x42a1b3){return _0x50936f[_0x97a5('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0x97a5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20e7=['util','../../config/logger','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash'];(function(_0x41212d,_0x3e1ef8){var _0x15205d=function(_0x2a55c3){while(--_0x2a55c3){_0x41212d['push'](_0x41212d['shift']());}};_0x15205d(++_0x3e1ef8);}(_0x20e7,0xd1));var _0x720e=function(_0x565020,_0xb4ea53){_0x565020=_0x565020-0x0;var _0x555a74=_0x20e7[_0x565020];return _0x555a74;};'use strict';var _=require(_0x720e('0x0'));var util=require(_0x720e('0x1'));var logger=require(_0x720e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x720e('0x3'));var rimraf=require(_0x720e('0x4'));var config=require(_0x720e('0x5'));var attributes=require(_0x720e('0x6'));module[_0x720e('0x7')]=function(_0x256031,_0x38a7c1){return _0x256031[_0x720e('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0x720e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index b75ed90..66a7127 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 _0x1020=['http','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x1020,0x1a4));var _0x0102=function(_0x48961c,_0x280e9d){_0x48961c=_0x48961c-0x0;var _0x1d895d=_0x1020[_0x48961c];return _0x1d895d;};'use strict';var _=require(_0x0102('0x0'));var util=require('util');var moment=require(_0x0102('0x1'));var BPromise=require(_0x0102('0x2'));var rs=require(_0x0102('0x3'));var fs=require('fs');var Redis=require(_0x0102('0x4'));var db=require(_0x0102('0x5'))['db'];var utils=require(_0x0102('0x6'));var logger=require(_0x0102('0x7'))(_0x0102('0x8'));var config=require(_0x0102('0x9'));var jayson=require(_0x0102('0xa'));var client=jayson[_0x0102('0xb')][_0x0102('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55229f,_0x26804d,_0x1aa60e){return new BPromise(function(_0x43df9f,_0x5ea57e){return client['request'](_0x55229f,_0x1aa60e)[_0x0102('0xd')](function(_0x566659){logger['info'](_0x0102('0xe'),_0x26804d,_0x0102('0xf'));logger[_0x0102('0x10')](_0x0102('0x11'),_0x26804d,_0x0102('0xf'),JSON['stringify'](_0x566659));if(_0x566659[_0x0102('0x12')]){if(_0x566659[_0x0102('0x12')][_0x0102('0x13')]===0x1f4){logger[_0x0102('0x12')](_0x0102('0xe'),_0x26804d,_0x566659[_0x0102('0x12')][_0x0102('0x14')]);return _0x5ea57e(_0x566659[_0x0102('0x12')][_0x0102('0x14')]);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x26804d,_0x566659[_0x0102('0x12')][_0x0102('0x14')]);return _0x43df9f(_0x566659[_0x0102('0x12')][_0x0102('0x14')]);}else{logger[_0x0102('0x15')](_0x0102('0xe'),_0x26804d,_0x0102('0xf'));_0x43df9f(_0x566659[_0x0102('0x16')][_0x0102('0x14')]);}})[_0x0102('0x17')](function(_0x38fab3){logger['error'](_0x0102('0xe'),_0x26804d,_0x38fab3);_0x5ea57e(_0x38fab3);});});} \ No newline at end of file +var _0xa673=['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','bluebird','rpc','../../config/environment','jayson/promise','client'];(function(_0x42bd68,_0x4ad8a6){var _0x2c0f9a=function(_0x308f4c){while(--_0x308f4c){_0x42bd68['push'](_0x42bd68['shift']());}};_0x2c0f9a(++_0x4ad8a6);}(_0xa673,0x175));var _0x3a67=function(_0x5abf02,_0x12813c){_0x5abf02=_0x5abf02-0x0;var _0x1a5c39=_0xa673[_0x5abf02];return _0x1a5c39;};'use strict';var _=require(_0x3a67('0x0'));var util=require(_0x3a67('0x1'));var moment=require('moment');var BPromise=require(_0x3a67('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a67('0x3'));var config=require(_0x3a67('0x4'));var jayson=require(_0x3a67('0x5'));var client=jayson[_0x3a67('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38dab0,_0x581e81,_0x555cbc){return new BPromise(function(_0x763a9d,_0x463f96){return client[_0x3a67('0x7')](_0x38dab0,_0x555cbc)[_0x3a67('0x8')](function(_0x1a1d7f){logger['info'](_0x3a67('0x9'),_0x581e81,'request\x20sent');logger[_0x3a67('0xa')](_0x3a67('0xb'),_0x581e81,_0x3a67('0xc'),JSON[_0x3a67('0xd')](_0x1a1d7f));if(_0x1a1d7f[_0x3a67('0xe')]){if(_0x1a1d7f['error'][_0x3a67('0xf')]===0x1f4){logger['error'](_0x3a67('0x9'),_0x581e81,_0x1a1d7f[_0x3a67('0xe')][_0x3a67('0x10')]);return _0x463f96(_0x1a1d7f[_0x3a67('0xe')][_0x3a67('0x10')]);}logger[_0x3a67('0xe')](_0x3a67('0x9'),_0x581e81,_0x1a1d7f[_0x3a67('0xe')][_0x3a67('0x10')]);return _0x763a9d(_0x1a1d7f[_0x3a67('0xe')][_0x3a67('0x10')]);}else{logger[_0x3a67('0x11')](_0x3a67('0x9'),_0x581e81,_0x3a67('0xc'));_0x763a9d(_0x1a1d7f[_0x3a67('0x12')][_0x3a67('0x10')]);}})[_0x3a67('0x13')](function(_0x36dcfd){logger[_0x3a67('0xe')](_0x3a67('0x9'),_0x581e81,_0x36dcfd);_0x463f96(_0x36dcfd);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 208abcf..2c2f4bd 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 _0x6873=['Router','../../components/auth/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get','/:id','show','/:id/sessions','getSessions','getAnswers','getSummary','create','clone','update','delete','destroy','exports','util','path'];(function(_0x59b42e,_0x1e15df){var _0x7a645f=function(_0x5d5abc){while(--_0x5d5abc){_0x59b42e['push'](_0x59b42e['shift']());}};_0x7a645f(++_0x1e15df);}(_0x6873,0x124));var _0x3687=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x6873[_0x3c504b];return _0x2e5354;};'use strict';var multer=require('multer');var util=require(_0x3687('0x0'));var path=require(_0x3687('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3687('0x2')]();var auth=require(_0x3687('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3687('0x4'));var controller=require(_0x3687('0x5'));router['get']('/',auth[_0x3687('0x6')](),controller[_0x3687('0x7')]);router[_0x3687('0x8')](_0x3687('0x9'),auth[_0x3687('0x6')](),controller[_0x3687('0xa')]);router[_0x3687('0x8')](_0x3687('0xb'),auth['isAuthenticated'](),controller[_0x3687('0xc')]);router[_0x3687('0x8')]('/:id/answers',auth['isAuthenticated'](),controller[_0x3687('0xd')]);router['get']('/:id/summary',auth['isAuthenticated'](),timeout('30s'),controller[_0x3687('0xe')]);router['post']('/',auth[_0x3687('0x6')](),controller[_0x3687('0xf')]);router['post']('/:id/clone',auth[_0x3687('0x6')](),controller[_0x3687('0x10')]);router['put'](_0x3687('0x9'),auth[_0x3687('0x6')](),controller[_0x3687('0x11')]);router[_0x3687('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3687('0x13')]);module[_0x3687('0x14')]=router; \ No newline at end of file +var _0x9abb=['index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/clone','clone','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated'];(function(_0x40ee2c,_0x4e13bf){var _0x587b92=function(_0x13eb75){while(--_0x13eb75){_0x40ee2c['push'](_0x40ee2c['shift']());}};_0x587b92(++_0x4e13bf);}(_0x9abb,0xae));var _0xb9ab=function(_0x5be1c5,_0x54e7b8){_0x5be1c5=_0x5be1c5-0x0;var _0x155773=_0x9abb[_0x5be1c5];return _0x155773;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb9ab('0x0'));var timeout=require(_0xb9ab('0x1'));var express=require(_0xb9ab('0x2'));var router=express[_0xb9ab('0x3')]();var auth=require(_0xb9ab('0x4'));var interaction=require(_0xb9ab('0x5'));var config=require(_0xb9ab('0x6'));var controller=require(_0xb9ab('0x7'));router[_0xb9ab('0x8')]('/',auth[_0xb9ab('0x9')](),controller[_0xb9ab('0xa')]);router[_0xb9ab('0x8')](_0xb9ab('0xb'),auth[_0xb9ab('0x9')](),controller[_0xb9ab('0xc')]);router['get'](_0xb9ab('0xd'),auth['isAuthenticated'](),controller[_0xb9ab('0xe')]);router['get'](_0xb9ab('0xf'),auth[_0xb9ab('0x9')](),controller[_0xb9ab('0x10')]);router[_0xb9ab('0x8')]('/:id/summary',auth[_0xb9ab('0x9')](),timeout('30s'),controller['getSummary']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xb9ab('0x11'),auth[_0xb9ab('0x9')](),controller[_0xb9ab('0x12')]);router[_0xb9ab('0x13')](_0xb9ab('0xb'),auth['isAuthenticated'](),controller[_0xb9ab('0x14')]);router[_0xb9ab('0x15')](_0xb9ab('0xb'),auth[_0xb9ab('0x9')](),controller[_0xb9ab('0x16')]);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 275061d..79d143c 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 _0xd6f6=['TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name'];(function(_0x5651f4,_0x221396){var _0x4156c6=function(_0x4def51){while(--_0x4def51){_0x5651f4['push'](_0x5651f4['shift']());}};_0x4156c6(++_0x221396);}(_0xd6f6,0xe8));var _0x6d6f=function(_0x4a8230,_0x52df9e){_0x4a8230=_0x4a8230-0x0;var _0x495380=_0xd6f6[_0x4a8230];return _0x495380;};'use strict';var Sequelize=require(_0x6d6f('0x0'));var _=require(_0x6d6f('0x1'));var util=require(_0x6d6f('0x2'));module[_0x6d6f('0x3')]={'name':{'type':Sequelize[_0x6d6f('0x4')],'unique':_0x6d6f('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x6d6f('0x6')](_0x6d6f('0x7')),'set':function(_0x597eef){if(_[_0x6d6f('0x8')](_0x597eef)){this[_0x6d6f('0x9')](_0x6d6f('0xa'),JSON[_0x6d6f('0xb')](_0x597eef));}else if(_[_0x6d6f('0xc')](_0x597eef)){this['setDataValue'](_0x6d6f('0xa'),_0x597eef);}else{this[_0x6d6f('0x9')]('formData',util[_0x6d6f('0xd')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x6d6f('0xe')](_0x6d6f('0x5'))||'',this[_0x6d6f('0xe')](_0x6d6f('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6d6f('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x6d6f('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0x3ffc=['getDataValue','BOOLEAN','lodash','util','exports','STRING','name','TEXT','isObjectLike','formData','stringify','isString','setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x3ffc,0x8e));var _0xc3ff=function(_0x4a4c78,_0x13d5b7){_0x4a4c78=_0x4a4c78-0x0;var _0xd58f32=_0x3ffc[_0x4a4c78];return _0xd58f32;};'use strict';var Sequelize=require('sequelize');var _=require(_0xc3ff('0x0'));var util=require(_0xc3ff('0x1'));module[_0xc3ff('0x2')]={'name':{'type':Sequelize[_0xc3ff('0x3')],'unique':_0xc3ff('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xc3ff('0x5')]('long'),'set':function(_0x4fd4b1){if(_[_0xc3ff('0x6')](_0x4fd4b1)){this['setDataValue'](_0xc3ff('0x7'),JSON[_0xc3ff('0x8')](_0x4fd4b1));}else if(_[_0xc3ff('0x9')](_0x4fd4b1)){this[_0xc3ff('0xa')](_0xc3ff('0x7'),_0x4fd4b1);}else{this[_0xc3ff('0xa')](_0xc3ff('0x7'),util['format'](_0xc3ff('0xb'),this[_0xc3ff('0xc')](_0xc3ff('0x4'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xc3ff('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xc3ff('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 b9badd0..afa38ff 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 _0x6501=['download','/tmp/Jscripty_Project_%d_Summary_%s.csv','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','JscriptyProject','includeAll','include','rows','catch','show','params','rawAttributes','find','create','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','getSessions','ProjectId','JscriptySessionReport','getAnswers','findOne','JscriptyAnswerReport','fromCharCode','apply','toString','indexOf','replace','startTime','parse','JscriptyQuestionReport','findAll','-createdAt','questionId','question','starttime','YYYY-MM-DD\x20HH:mm:ss','push','now','Content-disposition','attachment;\x20filename=','format','Jscripty_Project_%d_Summary_%s.csv','Content-type'];(function(_0x450b6c,_0x41411b){var _0x47130e=function(_0x1d9bc6){while(--_0x1d9bc6){_0x450b6c['push'](_0x450b6c['shift']());}};_0x47130e(++_0x41411b);}(_0x6501,0xee));var _0x1650=function(_0x552c84,_0x2fe734){_0x552c84=_0x552c84-0x0;var _0x51d11b=_0x6501[_0x552c84];return _0x51d11b;};'use strict';var pdf=require(_0x1650('0x0'));var emlformat=require(_0x1650('0x1'));var rimraf=require(_0x1650('0x2'));var zipdir=require(_0x1650('0x3'));var jsonpatch=require(_0x1650('0x4'));var rp=require(_0x1650('0x5'));var moment=require(_0x1650('0x6'));var BPromise=require(_0x1650('0x7'));var Mustache=require(_0x1650('0x8'));var util=require('util');var path=require(_0x1650('0x9'));var sox=require(_0x1650('0xa'));var csv=require('to-csv');var ejs=require(_0x1650('0xb'));var fs=require('fs');var _=require(_0x1650('0xc'));var squel=require(_0x1650('0xd'));var crypto=require(_0x1650('0xe'));var jsforce=require(_0x1650('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1650('0x10'));var querystring=require(_0x1650('0x11'));var Papa=require(_0x1650('0x12'));var Redis=require(_0x1650('0x13'));var authService=require(_0x1650('0x14'));var qs=require(_0x1650('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1650('0x16'));var config=require(_0x1650('0x17'));var db=require(_0x1650('0x18'))['db'];function respondWithStatusCode(_0x4bf0f6,_0x412990){_0x412990=_0x412990||0xcc;return function(_0x171896){if(_0x171896){return _0x4bf0f6[_0x1650('0x19')](_0x412990);}return _0x4bf0f6[_0x1650('0x1a')](_0x412990)[_0x1650('0x1b')]();};}function respondWithResult(_0x157777,_0x257d01){_0x257d01=_0x257d01||0xc8;return function(_0x1e4c2a){if(_0x1e4c2a){return _0x157777[_0x1650('0x1a')](_0x257d01)[_0x1650('0x1c')](_0x1e4c2a);}};}function respondWithFilteredResult(_0x45a3f6,_0x201067){return function(_0x4b9aef){if(_0x4b9aef){var _0x2f09a8=_0x4b9aef[_0x1650('0x1d')],_0x3ad938=_0x201067[_0x1650('0x1e')],_0x6250b9=_0x201067[_0x1650('0x1e')]+_0x201067[_0x1650('0x1f')],_0x376120;if(_0x6250b9>=_0x2f09a8){_0x6250b9=_0x2f09a8;_0x376120=0xc8;}else{_0x376120=0xce;}_0x45a3f6[_0x1650('0x1a')](_0x376120);return _0x45a3f6['set'](_0x1650('0x20'),_0x3ad938+'-'+_0x6250b9+'/'+_0x2f09a8)[_0x1650('0x1c')](_0x4b9aef);}return null;};}function patchUpdates(_0x17e348){return function(_0x4278bd){try{jsonpatch['apply'](_0x4278bd,_0x17e348,!![]);}catch(_0xccb73){return BPromise[_0x1650('0x21')](_0xccb73);}return _0x4278bd[_0x1650('0x22')]();};}function saveUpdates(_0x326474,_0x51c249){return function(_0x33e091){if(_0x33e091){return _0x33e091[_0x1650('0x23')](_0x326474)[_0x1650('0x24')](function(_0x2ccdf4){return _0x2ccdf4;});}return null;};}function removeEntity(_0x42a8df,_0x365d4b){return function(_0xd35749){if(_0xd35749){return _0xd35749[_0x1650('0x25')]()[_0x1650('0x24')](function(){var _0x54b119=_0xd35749[_0x1650('0x26')]({'plain':!![]});var _0x162fa4=_0x1650('0x27');return db[_0x1650('0x28')]['destroy']({'where':{'type':_0x162fa4,'resourceId':_0x54b119['id']}})['then'](function(){return _0xd35749;});})['then'](function(){_0x42a8df[_0x1650('0x1a')](0xcc)[_0x1650('0x1b')]();});}};}function handleEntityNotFound(_0x397bc3,_0x4854e0){return function(_0x3fbb96){if(!_0x3fbb96){_0x397bc3[_0x1650('0x19')](0x194);}return _0x3fbb96;};}function handleError(_0x327d8b,_0x4b90b3){_0x4b90b3=_0x4b90b3||0x1f4;return function(_0x5a46fc){logger[_0x1650('0x29')](_0x5a46fc[_0x1650('0x2a')]);if(_0x5a46fc[_0x1650('0x2b')]){delete _0x5a46fc[_0x1650('0x2b')];}_0x327d8b['status'](_0x4b90b3)[_0x1650('0x2c')](_0x5a46fc);};}exports[_0x1650('0x2d')]=function(_0x558362,_0x45d5fd){var _0x44845e={},_0xa89f58={},_0x19b528={'count':0x0,'rows':[]};var _0x6bf497=_[_0x1650('0x2e')](db['JscriptyProject']['rawAttributes'],function(_0x542330){return{'name':_0x542330[_0x1650('0x2f')],'type':_0x542330[_0x1650('0x30')][_0x1650('0x31')]};});_0xa89f58['model']=_[_0x1650('0x2e')](_0x6bf497,_0x1650('0x2b'));_0xa89f58[_0x1650('0x32')]=_[_0x1650('0x33')](_0x558362[_0x1650('0x32')]);_0xa89f58[_0x1650('0x34')]=_['intersection'](_0xa89f58[_0x1650('0x35')],_0xa89f58[_0x1650('0x32')]);_0x44845e[_0x1650('0x36')]=_[_0x1650('0x37')](_0xa89f58[_0x1650('0x35')],qs['fields'](_0x558362['query'][_0x1650('0x38')]));_0x44845e[_0x1650('0x36')]=_0x44845e['attributes'][_0x1650('0x39')]?_0x44845e[_0x1650('0x36')]:_0xa89f58[_0x1650('0x35')];if(!_0x558362['query'][_0x1650('0x3a')]('nolimit')){_0x44845e[_0x1650('0x1f')]=qs['limit'](_0x558362[_0x1650('0x32')][_0x1650('0x1f')]);_0x44845e[_0x1650('0x1e')]=qs[_0x1650('0x1e')](_0x558362[_0x1650('0x32')]['offset']);}_0x44845e[_0x1650('0x3b')]=qs[_0x1650('0x3c')](_0x558362[_0x1650('0x32')][_0x1650('0x3c')]);_0x44845e[_0x1650('0x3d')]=qs[_0x1650('0x34')](_[_0x1650('0x3e')](_0x558362[_0x1650('0x32')],_0xa89f58[_0x1650('0x34')]));if(_0x558362[_0x1650('0x32')][_0x1650('0x3f')]){_0x44845e[_0x1650('0x3d')]=_[_0x1650('0x40')](_0x44845e[_0x1650('0x3d')],{'$or':_[_0x1650('0x2e')](_0x6bf497,function(_0x1244b8){if(_0x1244b8[_0x1650('0x30')]!==_0x1650('0x41')){var _0x3eb667={};_0x3eb667[_0x1244b8['name']]={'$like':'%'+_0x558362[_0x1650('0x32')][_0x1650('0x3f')]+'%'};return _0x3eb667;}})});}_0x44845e=_[_0x1650('0x40')]({},_0x44845e,_0x558362[_0x1650('0x42')]);var _0xffcdc9={'where':_0x44845e[_0x1650('0x3d')]};return db[_0x1650('0x43')]['count'](_0xffcdc9)[_0x1650('0x24')](function(_0x3efd3d){_0x19b528[_0x1650('0x1d')]=_0x3efd3d;if(_0x558362[_0x1650('0x32')][_0x1650('0x44')]){_0x44845e[_0x1650('0x45')]=[{'all':!![]}];}return db[_0x1650('0x43')]['findAll'](_0x44845e);})['then'](function(_0x4dbf61){_0x19b528[_0x1650('0x46')]=_0x4dbf61;return _0x19b528;})['then'](respondWithFilteredResult(_0x45d5fd,_0x44845e))[_0x1650('0x47')](handleError(_0x45d5fd,null));};exports[_0x1650('0x48')]=function(_0x50e2fb,_0x5a4875){var _0x371c93={'raw':![],'where':{'id':_0x50e2fb[_0x1650('0x49')]['id']}},_0x5d5396={};_0x5d5396['model']=_['keys'](db[_0x1650('0x43')][_0x1650('0x4a')]);_0x5d5396[_0x1650('0x32')]=_[_0x1650('0x33')](_0x50e2fb[_0x1650('0x32')]);_0x5d5396[_0x1650('0x34')]=_[_0x1650('0x37')](_0x5d5396[_0x1650('0x35')],_0x5d5396[_0x1650('0x32')]);_0x371c93[_0x1650('0x36')]=_[_0x1650('0x37')](_0x5d5396[_0x1650('0x35')],qs[_0x1650('0x38')](_0x50e2fb[_0x1650('0x32')][_0x1650('0x38')]));_0x371c93['attributes']=_0x371c93[_0x1650('0x36')][_0x1650('0x39')]?_0x371c93['attributes']:_0x5d5396[_0x1650('0x35')];if(_0x50e2fb[_0x1650('0x32')]['includeAll']){_0x371c93[_0x1650('0x45')]=[{'all':!![]}];}_0x371c93=_[_0x1650('0x40')]({},_0x371c93,_0x50e2fb[_0x1650('0x42')]);return db['JscriptyProject'][_0x1650('0x4b')](_0x371c93)[_0x1650('0x24')](handleEntityNotFound(_0x5a4875,null))[_0x1650('0x24')](respondWithResult(_0x5a4875,null))['catch'](handleError(_0x5a4875,null));};exports[_0x1650('0x4c')]=function(_0x304e2f,_0x5a61a7){return db['JscriptyProject'][_0x1650('0x4c')](_0x304e2f['body'],{})['then'](function(_0x4a1097){var _0x22ab72=_0x304e2f[_0x1650('0x4d')][_0x1650('0x26')]({'plain':!![]});if(!_0x22ab72)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22ab72[_0x1650('0x4e')]===_0x1650('0x4d')){var _0x52a144=_0x4a1097[_0x1650('0x26')]({'plain':!![]});var _0x35093d='Projects';return db['UserProfileSection'][_0x1650('0x4b')]({'where':{'name':_0x35093d,'userProfileId':_0x22ab72[_0x1650('0x4f')]},'raw':!![]})[_0x1650('0x24')](function(_0xe08326){if(_0xe08326&&_0xe08326[_0x1650('0x50')]===0x0){return db[_0x1650('0x28')][_0x1650('0x4c')]({'name':_0x52a144['name'],'resourceId':_0x52a144['id'],'type':_0xe08326[_0x1650('0x2b')],'sectionId':_0xe08326['id']},{})[_0x1650('0x24')](function(){return _0x4a1097;});}else{return _0x4a1097;}})[_0x1650('0x47')](function(_0x812e76){logger['error'](_0x1650('0x51'),_0x812e76);throw _0x812e76;});}return _0x4a1097;})[_0x1650('0x24')](respondWithResult(_0x5a61a7,0xc9))['catch'](handleError(_0x5a61a7,null));};exports[_0x1650('0x52')]=function(_0x5e0104,_0x39ac52){var _0x1ce62e={'where':{'id':_0x5e0104['params']['id']}},_0x5bcfa9={};_0x5bcfa9[_0x1650('0x35')]=_['keys'](db[_0x1650('0x43')][_0x1650('0x4a')]);_0x1ce62e[_0x1650('0x36')]=_[_0x1650('0x37')](_0x5bcfa9[_0x1650('0x35')],qs[_0x1650('0x38')](_0x5e0104[_0x1650('0x32')][_0x1650('0x38')]));_0x1ce62e[_0x1650('0x36')]=_0x1ce62e[_0x1650('0x36')][_0x1650('0x39')]?_0x1ce62e[_0x1650('0x36')]:_0x5bcfa9[_0x1650('0x35')];if(_0x5e0104[_0x1650('0x32')]['includeAll']){_0x1ce62e[_0x1650('0x45')]=[{'all':!![]}];}_0x1ce62e=_[_0x1650('0x40')]({},_0x1ce62e,_0x5e0104[_0x1650('0x42')]);return db[_0x1650('0x43')]['find'](_0x1ce62e)[_0x1650('0x24')](handleEntityNotFound(_0x39ac52,null))[_0x1650('0x24')](function(_0x448f6f){if(_0x448f6f){var _0xb7521a=_0x448f6f[_0x1650('0x26')]({'plain':!![]});_0xb7521a=qs[_0x1650('0x53')](_0xb7521a,['id',_0x1650('0x54'),_0x1650('0x55')]);_0x5e0104[_0x1650('0x56')]=_[_0x1650('0x53')](_0x5e0104[_0x1650('0x56')],['id',_0x1650('0x54'),_0x1650('0x55')]);return db['JscriptyProject'][_0x1650('0x4c')](_[_0x1650('0x40')](_0xb7521a,_0x5e0104['body']),{'include':_0x5e0104[_0x1650('0x32')][_0x1650('0x44')]?[{'all':!![]}]:undefined})[_0x1650('0x24')](function(_0x2713d7){var _0x294ba4=_0x5e0104[_0x1650('0x4d')][_0x1650('0x26')]({'plain':!![]});if(!_0x294ba4)throw new Error(_0x1650('0x57'));if(_0x294ba4['role']==='user'){var _0x1b9506=_0x2713d7[_0x1650('0x26')]({'plain':!![]});var _0x30afc7=_0x1650('0x27');return db[_0x1650('0x58')][_0x1650('0x4b')]({'where':{'name':_0x30afc7,'userProfileId':_0x294ba4[_0x1650('0x4f')]},'raw':!![]})[_0x1650('0x24')](function(_0x3cec98){if(_0x3cec98&&_0x3cec98[_0x1650('0x50')]===0x0){return db[_0x1650('0x28')][_0x1650('0x4c')]({'name':_0x1b9506[_0x1650('0x2b')],'resourceId':_0x1b9506['id'],'type':_0x3cec98[_0x1650('0x2b')],'sectionId':_0x3cec98['id']},{})[_0x1650('0x24')](function(){return _0x2713d7;});}else{return _0x2713d7;}})[_0x1650('0x47')](function(_0x4bcd7a){logger['error'](_0x1650('0x51'),_0x4bcd7a);throw _0x4bcd7a;});}return _0x2713d7;});}})['then'](respondWithResult(_0x39ac52,0xc9))['catch'](handleError(_0x39ac52,null));};exports[_0x1650('0x23')]=function(_0x4a4dc3,_0x2d2738){if(_0x4a4dc3[_0x1650('0x56')]['id']){delete _0x4a4dc3['body']['id'];}return db[_0x1650('0x43')][_0x1650('0x4b')]({'where':{'id':_0x4a4dc3[_0x1650('0x49')]['id']}})[_0x1650('0x24')](handleEntityNotFound(_0x2d2738,null))['then'](saveUpdates(_0x4a4dc3[_0x1650('0x56')],null))[_0x1650('0x24')](respondWithResult(_0x2d2738,null))[_0x1650('0x47')](handleError(_0x2d2738,null));};exports[_0x1650('0x25')]=function(_0x565332,_0x2b9413){return db[_0x1650('0x43')][_0x1650('0x4b')]({'where':{'id':_0x565332[_0x1650('0x49')]['id']}})[_0x1650('0x24')](handleEntityNotFound(_0x2b9413,null))[_0x1650('0x24')](removeEntity(_0x2b9413,null))[_0x1650('0x47')](handleError(_0x2b9413,null));};exports[_0x1650('0x59')]=function(_0x599a32,_0x2ec67f,_0x39b76f){var _0x5a050c={'raw':!![],'where':{}};var _0x16c8c4={};var _0x3aaed8={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x599a32[_0x1650('0x49')]['id']}})['then'](handleEntityNotFound(_0x2ec67f,null))['then'](function(_0x19fa7d){if(_0x19fa7d){_0x16c8c4[_0x1650('0x35')]=_['keys'](db['JscriptySessionReport'][_0x1650('0x4a')]);_0x16c8c4['query']=_[_0x1650('0x33')](_0x599a32['query']);_0x16c8c4['filters']=_[_0x1650('0x37')](_0x16c8c4[_0x1650('0x35')],_0x16c8c4[_0x1650('0x32')]);_0x5a050c['attributes']=_[_0x1650('0x37')](_0x16c8c4[_0x1650('0x35')],qs[_0x1650('0x38')](_0x599a32[_0x1650('0x32')][_0x1650('0x38')]));_0x5a050c[_0x1650('0x36')]=_0x5a050c['attributes']['length']?_0x5a050c[_0x1650('0x36')]:_0x16c8c4[_0x1650('0x35')];if(!_0x599a32['query'][_0x1650('0x3a')]('nolimit')){_0x5a050c['limit']=qs['limit'](_0x599a32[_0x1650('0x32')][_0x1650('0x1f')]);_0x5a050c[_0x1650('0x1e')]=qs[_0x1650('0x1e')](_0x599a32[_0x1650('0x32')][_0x1650('0x1e')]);}_0x5a050c[_0x1650('0x3b')]=qs[_0x1650('0x3c')](_0x599a32[_0x1650('0x32')]['sort']);_0x5a050c[_0x1650('0x3d')]=qs[_0x1650('0x34')](_[_0x1650('0x3e')](_0x599a32[_0x1650('0x32')],_0x16c8c4[_0x1650('0x34')]));_0x5a050c['where'][_0x1650('0x5a')]=_0x19fa7d['id'];if(_0x599a32[_0x1650('0x32')][_0x1650('0x3f')]){_0x5a050c['where']=_[_0x1650('0x40')](_0x5a050c[_0x1650('0x3d')],{'$or':_[_0x1650('0x2e')](_0x5a050c[_0x1650('0x36')],function(_0x2eb5e6){var _0x25c8fb={};_0x25c8fb[_0x2eb5e6]={'$like':'%'+_0x599a32[_0x1650('0x32')][_0x1650('0x3f')]+'%'};return _0x25c8fb;})});}_0x5a050c=_[_0x1650('0x40')]({},_0x5a050c,_0x599a32[_0x1650('0x42')]);return db[_0x1650('0x5b')]['count']({'where':_0x5a050c[_0x1650('0x3d')]})[_0x1650('0x24')](function(_0x3c0c1f){_0x3aaed8[_0x1650('0x1d')]=_0x3c0c1f;if(_0x599a32['query'][_0x1650('0x44')]){_0x5a050c[_0x1650('0x45')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x5a050c);})[_0x1650('0x24')](function(_0x50d30b){_0x3aaed8['rows']=_0x50d30b;return _0x3aaed8;});}})[_0x1650('0x24')](respondWithFilteredResult(_0x2ec67f,_0x5a050c))[_0x1650('0x47')](handleError(_0x2ec67f,null));};exports[_0x1650('0x5c')]=function(_0x4548c8,_0x2d8803,_0x29258c){var _0x4763a1={'raw':!![],'where':{}};var _0x22aa47={};var _0x4c1266={'count':0x0,'rows':[]};return db[_0x1650('0x43')][_0x1650('0x5d')]({'where':{'id':_0x4548c8[_0x1650('0x49')]['id']}})[_0x1650('0x24')](handleEntityNotFound(_0x2d8803,null))[_0x1650('0x24')](function(_0x2f4b9b){if(_0x2f4b9b){_0x22aa47[_0x1650('0x35')]=_[_0x1650('0x33')](db[_0x1650('0x5e')][_0x1650('0x4a')]);_0x22aa47['query']=_[_0x1650('0x33')](_0x4548c8['query']);_0x22aa47['filters']=_[_0x1650('0x37')](_0x22aa47[_0x1650('0x35')],_0x22aa47['query']);_0x4763a1[_0x1650('0x36')]=_[_0x1650('0x37')](_0x22aa47[_0x1650('0x35')],qs[_0x1650('0x38')](_0x4548c8[_0x1650('0x32')][_0x1650('0x38')]));_0x4763a1['attributes']=_0x4763a1['attributes'][_0x1650('0x39')]?_0x4763a1['attributes']:_0x22aa47[_0x1650('0x35')];if(!_0x4548c8[_0x1650('0x32')][_0x1650('0x3a')]('nolimit')){_0x4763a1['limit']=qs['limit'](_0x4548c8[_0x1650('0x32')][_0x1650('0x1f')]);_0x4763a1[_0x1650('0x1e')]=qs['offset'](_0x4548c8[_0x1650('0x32')]['offset']);}_0x4763a1[_0x1650('0x3b')]=qs['sort'](_0x4548c8['query']['sort']);_0x4763a1[_0x1650('0x3d')]=qs[_0x1650('0x34')](_[_0x1650('0x3e')](_0x4548c8['query'],_0x22aa47[_0x1650('0x34')]));_0x4763a1[_0x1650('0x3d')][_0x1650('0x5a')]=_0x2f4b9b['id'];if(_0x4548c8[_0x1650('0x32')][_0x1650('0x3f')]){_0x4763a1[_0x1650('0x3d')]=_[_0x1650('0x40')](_0x4763a1[_0x1650('0x3d')],{'$or':_[_0x1650('0x2e')](_0x4763a1[_0x1650('0x36')],function(_0x2193c4){var _0x190dca={};_0x190dca[_0x2193c4]={'$like':'%'+_0x4548c8['query']['filter']+'%'};return _0x190dca;})});}_0x4763a1=_[_0x1650('0x40')]({},_0x4763a1,_0x4548c8[_0x1650('0x42')]);return db[_0x1650('0x5e')][_0x1650('0x1d')]({'where':_0x4763a1['where']})['then'](function(_0x3b97e1){_0x4c1266[_0x1650('0x1d')]=_0x3b97e1;if(_0x4548c8[_0x1650('0x32')]['includeAll']){_0x4763a1[_0x1650('0x45')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x4763a1);})[_0x1650('0x24')](function(_0x5d3b0a){_0x4c1266[_0x1650('0x46')]=_0x5d3b0a;return _0x4c1266;});}})['then'](respondWithFilteredResult(_0x2d8803,_0x4763a1))['catch'](handleError(_0x2d8803,null));};function char(_0x3bef74){return'number'===typeof _0x3bef74?String[_0x1650('0x5f')][_0x1650('0x60')](null,arguments):_0x3bef74;}function needsEncapsulation(_0x2b38ca){return!!_0x2b38ca&&(_0x2b38ca[_0x1650('0x61')]()[_0x1650('0x62')](char(0xd))>=0x0||_0x2b38ca[_0x1650('0x61')]()[_0x1650('0x62')](char(0xa))>=0x0||_0x2b38ca[_0x1650('0x61')]()[_0x1650('0x62')](char(0x2c))>=0x0||_0x2b38ca[_0x1650('0x61')]()[_0x1650('0x62')](char(0x22))>=0x0);}function encapsulate(_0x98b6d4){var _0xcfdd6d=char(0x22),_0x339d15='\x5c'+char(0x22),_0x300244=_0x98b6d4[_0x1650('0x61')]()[_0x1650('0x63')](new RegExp(_0xcfdd6d,'g'),_0x339d15);return _0xcfdd6d+_0x300244+_0xcfdd6d;}exports['getSummary']=function(_0x1781ed,_0x49616c,_0x59cd42){var _0x276734,_0x1ba3d3;var _0x35aadc={'where':{'ProjectId':_0x1781ed[_0x1650('0x49')]['id']}};if(_0x1781ed[_0x1650('0x32')][_0x1650('0x64')]){_0x35aadc['where']['starttime']=JSON[_0x1650('0x65')](_0x1781ed[_0x1650('0x32')][_0x1650('0x64')]);}return db[_0x1650('0x5b')]['findAll'](_0x35aadc)[_0x1650('0x24')](handleEntityNotFound(_0x49616c,null))[_0x1650('0x24')](function(_0x568cea){if(_0x568cea){_0x276734=_0x568cea;return db[_0x1650('0x66')][_0x1650('0x67')]({'where':{'SessionId':{'$in':_[_0x1650('0x2e')](_0x276734,'id')},'ProjectId':_0x1781ed[_0x1650('0x49')]['id']},'order':_0x1650('0x68')});}})[_0x1650('0x24')](handleEntityNotFound(_0x49616c,null))[_0x1650('0x24')](function(_0x11aafa){if(_0x11aafa){_0x1ba3d3=_0x11aafa;var _0x44369d={};for(var _0x3353f9=0x0,_0x494dd3=_0x1ba3d3[_0x1650('0x39')];_0x3353f9<_0x494dd3;_0x3353f9++){if(!_0x44369d[_0x1650('0x3a')](_0x1ba3d3[_0x3353f9][_0x1650('0x69')])){_0x44369d[_0x1ba3d3[_0x3353f9][_0x1650('0x69')]]=needsEncapsulation(_0x1ba3d3[_0x3353f9][_0x1650('0x6a')])?encapsulate(_0x1ba3d3[_0x3353f9]['question']):_0x1ba3d3[_0x3353f9][_0x1650('0x6a')];}}var _0x2e6cff=[],_0x22e173={};for(var _0x31d86a=0x0,_0x39893b=_0x276734[_0x1650('0x39')];_0x31d86a<_0x39893b;_0x31d86a++){_0x22e173={'ProjectId':_0x1781ed[_0x1650('0x49')]['id'],'SessionId':_0x276734[_0x31d86a]['id'],'StartTime':moment(_0x276734[_0x31d86a][_0x1650('0x6b')])['format'](_0x1650('0x6c'))};for(var _0x5b14ca=0x0,_0x2bdf3a=_0x1ba3d3[_0x1650('0x39')];_0x5b14ca<_0x2bdf3a;_0x5b14ca++){if(_0x1ba3d3[_0x5b14ca]['SessionId']==_0x276734[_0x31d86a]['id']&&_0x44369d[_0x1650('0x3a')](_0x1ba3d3[_0x5b14ca][_0x1650('0x69')])){_0x22e173[_0x44369d[_0x1ba3d3[_0x5b14ca][_0x1650('0x69')]]]=_0x1ba3d3[_0x5b14ca]['answer'];}}for(var _0xe0369 in _0x44369d){if(!_0x22e173['hasOwnProperty'](_0x44369d[_0xe0369])){_0x22e173[_0x44369d[_0xe0369]]=null;}}_0x2e6cff[_0x1650('0x6d')](_0x22e173);}return _0x2e6cff;}})[_0x1650('0x24')](function(_0x31df40){if(!_['isEmpty'](_0x31df40)){var _0x3127c2=toCsv(_0x31df40);var _0x381811=Date[_0x1650('0x6e')]();fs['writeFileSync'](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1781ed[_0x1650('0x49')]['id'],_0x381811),_0x3127c2);_0x49616c['setHeader'](_0x1650('0x6f'),_0x1650('0x70')+util[_0x1650('0x71')](_0x1650('0x72'),_0x1781ed[_0x1650('0x49')]['id'],_0x381811));_0x49616c['setHeader'](_0x1650('0x73'),'text/csv');return _0x49616c[_0x1650('0x74')](util[_0x1650('0x71')](_0x1650('0x75'),_0x1781ed[_0x1650('0x49')]['id'],_0x381811));}else{return _0x49616c[_0x1650('0x19')](0xcc);}})['catch'](handleError(_0x49616c,null));}; \ No newline at end of file +var _0xf749=['isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','Projects','UserProfileResource','error','name','send','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','includeAll','JscriptyProject','findAll','rows','show','params','keys','include','find','create','user','role','userProfileId','autoAssociation','catch','clone','length','omit','createdAt','updatedAt','body','UserProfileSection','getSessions','findOne','JscriptySessionReport','nolimit','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','SessionId','answer','push'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf749,0xf0));var _0x9f74=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf749[_0x57b54c];return _0x59cc19;};'use strict';var pdf=require(_0x9f74('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9f74('0x1'));var zipdir=require(_0x9f74('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f74('0x3'));var moment=require(_0x9f74('0x4'));var BPromise=require(_0x9f74('0x5'));var Mustache=require(_0x9f74('0x6'));var util=require(_0x9f74('0x7'));var path=require(_0x9f74('0x8'));var sox=require('sox');var csv=require(_0x9f74('0x9'));var ejs=require(_0x9f74('0xa'));var fs=require('fs');var _=require(_0x9f74('0xb'));var squel=require(_0x9f74('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9f74('0x9'));var querystring=require(_0x9f74('0xd'));var Papa=require(_0x9f74('0xe'));var Redis=require(_0x9f74('0xf'));var authService=require(_0x9f74('0x10'));var qs=require(_0x9f74('0x11'));var as=require(_0x9f74('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f74('0x13'))(_0x9f74('0x14'));var utils=require('../../config/utils');var config=require(_0x9f74('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x289d28,_0x2dcced){_0x2dcced=_0x2dcced||0xcc;return function(_0x1f820d){if(_0x1f820d){return _0x289d28[_0x9f74('0x16')](_0x2dcced);}return _0x289d28[_0x9f74('0x17')](_0x2dcced)[_0x9f74('0x18')]();};}function respondWithResult(_0x2ec61d,_0x39f352){_0x39f352=_0x39f352||0xc8;return function(_0x3df5bd){if(_0x3df5bd){return _0x2ec61d['status'](_0x39f352)[_0x9f74('0x19')](_0x3df5bd);}};}function respondWithFilteredResult(_0x238480,_0x1de9f4){return function(_0x599055){if(_0x599055){var _0x51a00f=_0x599055[_0x9f74('0x1a')],_0x2bbd47=_0x1de9f4['offset'],_0x1c00e6=_0x1de9f4[_0x9f74('0x1b')]+_0x1de9f4[_0x9f74('0x1c')],_0x230876;if(_0x1c00e6>=_0x51a00f){_0x1c00e6=_0x51a00f;_0x230876=0xc8;}else{_0x230876=0xce;}_0x238480[_0x9f74('0x17')](_0x230876);return _0x238480[_0x9f74('0x1d')](_0x9f74('0x1e'),_0x2bbd47+'-'+_0x1c00e6+'/'+_0x51a00f)['json'](_0x599055);}return null;};}function patchUpdates(_0x1278e4){return function(_0x46e5dd){try{jsonpatch[_0x9f74('0x1f')](_0x46e5dd,_0x1278e4,!![]);}catch(_0x295fab){return BPromise[_0x9f74('0x20')](_0x295fab);}return _0x46e5dd['save']();};}function saveUpdates(_0x1081eb,_0x5db1c9){return function(_0x4446ea){if(_0x4446ea){return _0x4446ea[_0x9f74('0x21')](_0x1081eb)['then'](function(_0x4b9371){return _0x4b9371;});}return null;};}function removeEntity(_0x4ca25d,_0x393f37){return function(_0x116da4){if(_0x116da4){return _0x116da4[_0x9f74('0x22')]()[_0x9f74('0x23')](function(){var _0x1385b6=_0x116da4[_0x9f74('0x24')]({'plain':!![]});var _0x365168=_0x9f74('0x25');return db[_0x9f74('0x26')][_0x9f74('0x22')]({'where':{'type':_0x365168,'resourceId':_0x1385b6['id']}})[_0x9f74('0x23')](function(){return _0x116da4;});})[_0x9f74('0x23')](function(){_0x4ca25d['status'](0xcc)[_0x9f74('0x18')]();});}};}function handleEntityNotFound(_0x578f38,_0x5036d0){return function(_0x443fcc){if(!_0x443fcc){_0x578f38[_0x9f74('0x16')](0x194);}return _0x443fcc;};}function handleError(_0x1e3d01,_0x1326a8){_0x1326a8=_0x1326a8||0x1f4;return function(_0x3c2133){logger[_0x9f74('0x27')](_0x3c2133['stack']);if(_0x3c2133[_0x9f74('0x28')]){delete _0x3c2133[_0x9f74('0x28')];}_0x1e3d01[_0x9f74('0x17')](_0x1326a8)[_0x9f74('0x29')](_0x3c2133);};}exports['index']=function(_0x3bc14a,_0x3b106d){var _0x1aa123={},_0x150626={},_0x42c780={'count':0x0,'rows':[]};var _0x63ca49=_['map'](db['JscriptyProject'][_0x9f74('0x2a')],function(_0x7456bf){return{'name':_0x7456bf[_0x9f74('0x2b')],'type':_0x7456bf[_0x9f74('0x2c')][_0x9f74('0x2d')]};});_0x150626[_0x9f74('0x2e')]=_[_0x9f74('0x2f')](_0x63ca49,_0x9f74('0x28'));_0x150626[_0x9f74('0x30')]=_['keys'](_0x3bc14a[_0x9f74('0x30')]);_0x150626['filters']=_['intersection'](_0x150626['model'],_0x150626[_0x9f74('0x30')]);_0x1aa123['attributes']=_[_0x9f74('0x31')](_0x150626[_0x9f74('0x2e')],qs[_0x9f74('0x32')](_0x3bc14a[_0x9f74('0x30')][_0x9f74('0x32')]));_0x1aa123[_0x9f74('0x33')]=_0x1aa123[_0x9f74('0x33')]['length']?_0x1aa123['attributes']:_0x150626[_0x9f74('0x2e')];if(!_0x3bc14a[_0x9f74('0x30')][_0x9f74('0x34')]('nolimit')){_0x1aa123[_0x9f74('0x1c')]=qs[_0x9f74('0x1c')](_0x3bc14a['query']['limit']);_0x1aa123[_0x9f74('0x1b')]=qs['offset'](_0x3bc14a[_0x9f74('0x30')][_0x9f74('0x1b')]);}_0x1aa123[_0x9f74('0x35')]=qs['sort'](_0x3bc14a[_0x9f74('0x30')][_0x9f74('0x36')]);_0x1aa123['where']=qs[_0x9f74('0x37')](_[_0x9f74('0x38')](_0x3bc14a[_0x9f74('0x30')],_0x150626[_0x9f74('0x37')]));if(_0x3bc14a['query'][_0x9f74('0x39')]){_0x1aa123[_0x9f74('0x3a')]=_[_0x9f74('0x3b')](_0x1aa123[_0x9f74('0x3a')],{'$or':_[_0x9f74('0x2f')](_0x63ca49,function(_0x5e6433){if(_0x5e6433[_0x9f74('0x2c')]!=='VIRTUAL'){var _0x3553df={};_0x3553df[_0x5e6433[_0x9f74('0x28')]]={'$like':'%'+_0x3bc14a['query']['filter']+'%'};return _0x3553df;}})});}_0x1aa123=_[_0x9f74('0x3b')]({},_0x1aa123,_0x3bc14a[_0x9f74('0x3c')]);var _0x334c22={'where':_0x1aa123['where']};return db['JscriptyProject'][_0x9f74('0x1a')](_0x334c22)[_0x9f74('0x23')](function(_0x1f5851){_0x42c780['count']=_0x1f5851;if(_0x3bc14a[_0x9f74('0x30')][_0x9f74('0x3d')]){_0x1aa123['include']=[{'all':!![]}];}return db[_0x9f74('0x3e')][_0x9f74('0x3f')](_0x1aa123);})[_0x9f74('0x23')](function(_0x25eac0){_0x42c780[_0x9f74('0x40')]=_0x25eac0;return _0x42c780;})['then'](respondWithFilteredResult(_0x3b106d,_0x1aa123))['catch'](handleError(_0x3b106d,null));};exports[_0x9f74('0x41')]=function(_0x53919f,_0x398910){var _0x514ff3={'raw':![],'where':{'id':_0x53919f[_0x9f74('0x42')]['id']}},_0x6846be={};_0x6846be[_0x9f74('0x2e')]=_[_0x9f74('0x43')](db[_0x9f74('0x3e')][_0x9f74('0x2a')]);_0x6846be[_0x9f74('0x30')]=_[_0x9f74('0x43')](_0x53919f[_0x9f74('0x30')]);_0x6846be[_0x9f74('0x37')]=_[_0x9f74('0x31')](_0x6846be[_0x9f74('0x2e')],_0x6846be[_0x9f74('0x30')]);_0x514ff3['attributes']=_[_0x9f74('0x31')](_0x6846be[_0x9f74('0x2e')],qs[_0x9f74('0x32')](_0x53919f['query']['fields']));_0x514ff3[_0x9f74('0x33')]=_0x514ff3[_0x9f74('0x33')]['length']?_0x514ff3[_0x9f74('0x33')]:_0x6846be[_0x9f74('0x2e')];if(_0x53919f[_0x9f74('0x30')][_0x9f74('0x3d')]){_0x514ff3[_0x9f74('0x44')]=[{'all':!![]}];}_0x514ff3=_[_0x9f74('0x3b')]({},_0x514ff3,_0x53919f['options']);return db[_0x9f74('0x3e')][_0x9f74('0x45')](_0x514ff3)[_0x9f74('0x23')](handleEntityNotFound(_0x398910,null))[_0x9f74('0x23')](respondWithResult(_0x398910,null))['catch'](handleError(_0x398910,null));};exports[_0x9f74('0x46')]=function(_0x355dab,_0x301515){return db[_0x9f74('0x3e')][_0x9f74('0x46')](_0x355dab['body'],{})[_0x9f74('0x23')](function(_0x464e1a){var _0x14a306=_0x355dab[_0x9f74('0x47')]['get']({'plain':!![]});if(!_0x14a306)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14a306[_0x9f74('0x48')]===_0x9f74('0x47')){var _0x4f4c1a=_0x464e1a[_0x9f74('0x24')]({'plain':!![]});var _0x502f77='Projects';return db['UserProfileSection']['find']({'where':{'name':_0x502f77,'userProfileId':_0x14a306[_0x9f74('0x49')]},'raw':!![]})[_0x9f74('0x23')](function(_0x4bb2bf){if(_0x4bb2bf&&_0x4bb2bf[_0x9f74('0x4a')]===0x0){return db[_0x9f74('0x26')]['create']({'name':_0x4f4c1a[_0x9f74('0x28')],'resourceId':_0x4f4c1a['id'],'type':_0x4bb2bf[_0x9f74('0x28')],'sectionId':_0x4bb2bf['id']},{})[_0x9f74('0x23')](function(){return _0x464e1a;});}else{return _0x464e1a;}})[_0x9f74('0x4b')](function(_0x133757){logger[_0x9f74('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x133757);throw _0x133757;});}return _0x464e1a;})[_0x9f74('0x23')](respondWithResult(_0x301515,0xc9))[_0x9f74('0x4b')](handleError(_0x301515,null));};exports[_0x9f74('0x4c')]=function(_0x3478b2,_0x5b56a){var _0x2b18f9={'where':{'id':_0x3478b2[_0x9f74('0x42')]['id']}},_0x156ba7={};_0x156ba7[_0x9f74('0x2e')]=_['keys'](db[_0x9f74('0x3e')][_0x9f74('0x2a')]);_0x2b18f9[_0x9f74('0x33')]=_[_0x9f74('0x31')](_0x156ba7[_0x9f74('0x2e')],qs['fields'](_0x3478b2[_0x9f74('0x30')]['fields']));_0x2b18f9[_0x9f74('0x33')]=_0x2b18f9[_0x9f74('0x33')][_0x9f74('0x4d')]?_0x2b18f9[_0x9f74('0x33')]:_0x156ba7[_0x9f74('0x2e')];if(_0x3478b2[_0x9f74('0x30')][_0x9f74('0x3d')]){_0x2b18f9['include']=[{'all':!![]}];}_0x2b18f9=_[_0x9f74('0x3b')]({},_0x2b18f9,_0x3478b2['options']);return db[_0x9f74('0x3e')][_0x9f74('0x45')](_0x2b18f9)[_0x9f74('0x23')](handleEntityNotFound(_0x5b56a,null))[_0x9f74('0x23')](function(_0x19ff30){if(_0x19ff30){var _0x379757=_0x19ff30[_0x9f74('0x24')]({'plain':!![]});_0x379757=qs[_0x9f74('0x4e')](_0x379757,['id',_0x9f74('0x4f'),_0x9f74('0x50')]);_0x3478b2[_0x9f74('0x51')]=_[_0x9f74('0x4e')](_0x3478b2[_0x9f74('0x51')],['id','createdAt',_0x9f74('0x50')]);return db[_0x9f74('0x3e')][_0x9f74('0x46')](_[_0x9f74('0x3b')](_0x379757,_0x3478b2[_0x9f74('0x51')]),{'include':_0x3478b2['query'][_0x9f74('0x3d')]?[{'all':!![]}]:undefined})[_0x9f74('0x23')](function(_0x33f0d1){var _0x1d3814=_0x3478b2[_0x9f74('0x47')]['get']({'plain':!![]});if(!_0x1d3814)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d3814[_0x9f74('0x48')]===_0x9f74('0x47')){var _0x2e344b=_0x33f0d1[_0x9f74('0x24')]({'plain':!![]});var _0x2b46b5='Projects';return db[_0x9f74('0x52')][_0x9f74('0x45')]({'where':{'name':_0x2b46b5,'userProfileId':_0x1d3814[_0x9f74('0x49')]},'raw':!![]})['then'](function(_0x1fdb14){if(_0x1fdb14&&_0x1fdb14[_0x9f74('0x4a')]===0x0){return db[_0x9f74('0x26')][_0x9f74('0x46')]({'name':_0x2e344b[_0x9f74('0x28')],'resourceId':_0x2e344b['id'],'type':_0x1fdb14[_0x9f74('0x28')],'sectionId':_0x1fdb14['id']},{})[_0x9f74('0x23')](function(){return _0x33f0d1;});}else{return _0x33f0d1;}})[_0x9f74('0x4b')](function(_0x36c4c7){logger[_0x9f74('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36c4c7);throw _0x36c4c7;});}return _0x33f0d1;});}})[_0x9f74('0x23')](respondWithResult(_0x5b56a,0xc9))[_0x9f74('0x4b')](handleError(_0x5b56a,null));};exports[_0x9f74('0x21')]=function(_0xcb71b0,_0x264214){if(_0xcb71b0['body']['id']){delete _0xcb71b0[_0x9f74('0x51')]['id'];}return db['JscriptyProject'][_0x9f74('0x45')]({'where':{'id':_0xcb71b0[_0x9f74('0x42')]['id']}})[_0x9f74('0x23')](handleEntityNotFound(_0x264214,null))[_0x9f74('0x23')](saveUpdates(_0xcb71b0[_0x9f74('0x51')],null))[_0x9f74('0x23')](respondWithResult(_0x264214,null))[_0x9f74('0x4b')](handleError(_0x264214,null));};exports[_0x9f74('0x22')]=function(_0x466793,_0x31f5b1){return db[_0x9f74('0x3e')]['find']({'where':{'id':_0x466793[_0x9f74('0x42')]['id']}})['then'](handleEntityNotFound(_0x31f5b1,null))[_0x9f74('0x23')](removeEntity(_0x31f5b1,null))[_0x9f74('0x4b')](handleError(_0x31f5b1,null));};exports[_0x9f74('0x53')]=function(_0x57e0c1,_0x3fe446,_0x29f67e){var _0x2b92f1={'raw':!![],'where':{}};var _0x1c90d3={};var _0x1f7400={'count':0x0,'rows':[]};return db[_0x9f74('0x3e')][_0x9f74('0x54')]({'where':{'id':_0x57e0c1['params']['id']}})[_0x9f74('0x23')](handleEntityNotFound(_0x3fe446,null))['then'](function(_0x3c8c33){if(_0x3c8c33){_0x1c90d3[_0x9f74('0x2e')]=_[_0x9f74('0x43')](db[_0x9f74('0x55')][_0x9f74('0x2a')]);_0x1c90d3[_0x9f74('0x30')]=_[_0x9f74('0x43')](_0x57e0c1['query']);_0x1c90d3[_0x9f74('0x37')]=_[_0x9f74('0x31')](_0x1c90d3[_0x9f74('0x2e')],_0x1c90d3[_0x9f74('0x30')]);_0x2b92f1[_0x9f74('0x33')]=_[_0x9f74('0x31')](_0x1c90d3[_0x9f74('0x2e')],qs[_0x9f74('0x32')](_0x57e0c1['query']['fields']));_0x2b92f1[_0x9f74('0x33')]=_0x2b92f1['attributes']['length']?_0x2b92f1[_0x9f74('0x33')]:_0x1c90d3['model'];if(!_0x57e0c1[_0x9f74('0x30')][_0x9f74('0x34')](_0x9f74('0x56'))){_0x2b92f1[_0x9f74('0x1c')]=qs[_0x9f74('0x1c')](_0x57e0c1['query'][_0x9f74('0x1c')]);_0x2b92f1[_0x9f74('0x1b')]=qs[_0x9f74('0x1b')](_0x57e0c1[_0x9f74('0x30')][_0x9f74('0x1b')]);}_0x2b92f1[_0x9f74('0x35')]=qs[_0x9f74('0x36')](_0x57e0c1[_0x9f74('0x30')][_0x9f74('0x36')]);_0x2b92f1['where']=qs['filters'](_[_0x9f74('0x38')](_0x57e0c1['query'],_0x1c90d3[_0x9f74('0x37')]));_0x2b92f1['where']['ProjectId']=_0x3c8c33['id'];if(_0x57e0c1['query'][_0x9f74('0x39')]){_0x2b92f1[_0x9f74('0x3a')]=_[_0x9f74('0x3b')](_0x2b92f1[_0x9f74('0x3a')],{'$or':_[_0x9f74('0x2f')](_0x2b92f1[_0x9f74('0x33')],function(_0x5d865a){var _0x419be5={};_0x419be5[_0x5d865a]={'$like':'%'+_0x57e0c1[_0x9f74('0x30')][_0x9f74('0x39')]+'%'};return _0x419be5;})});}_0x2b92f1=_['merge']({},_0x2b92f1,_0x57e0c1[_0x9f74('0x3c')]);return db['JscriptySessionReport'][_0x9f74('0x1a')]({'where':_0x2b92f1[_0x9f74('0x3a')]})['then'](function(_0x4272ad){_0x1f7400['count']=_0x4272ad;if(_0x57e0c1['query'][_0x9f74('0x3d')]){_0x2b92f1[_0x9f74('0x44')]=[{'all':!![]}];}return db[_0x9f74('0x55')]['findAll'](_0x2b92f1);})['then'](function(_0x2551c5){_0x1f7400[_0x9f74('0x40')]=_0x2551c5;return _0x1f7400;});}})[_0x9f74('0x23')](respondWithFilteredResult(_0x3fe446,_0x2b92f1))['catch'](handleError(_0x3fe446,null));};exports['getAnswers']=function(_0x5008fb,_0x4f1222,_0x427296){var _0x1b9345={'raw':!![],'where':{}};var _0x38d78d={};var _0x58f833={'count':0x0,'rows':[]};return db[_0x9f74('0x3e')][_0x9f74('0x54')]({'where':{'id':_0x5008fb[_0x9f74('0x42')]['id']}})[_0x9f74('0x23')](handleEntityNotFound(_0x4f1222,null))['then'](function(_0x11d4f7){if(_0x11d4f7){_0x38d78d[_0x9f74('0x2e')]=_[_0x9f74('0x43')](db[_0x9f74('0x57')][_0x9f74('0x2a')]);_0x38d78d[_0x9f74('0x30')]=_['keys'](_0x5008fb[_0x9f74('0x30')]);_0x38d78d[_0x9f74('0x37')]=_[_0x9f74('0x31')](_0x38d78d[_0x9f74('0x2e')],_0x38d78d[_0x9f74('0x30')]);_0x1b9345[_0x9f74('0x33')]=_[_0x9f74('0x31')](_0x38d78d[_0x9f74('0x2e')],qs[_0x9f74('0x32')](_0x5008fb[_0x9f74('0x30')]['fields']));_0x1b9345[_0x9f74('0x33')]=_0x1b9345[_0x9f74('0x33')][_0x9f74('0x4d')]?_0x1b9345[_0x9f74('0x33')]:_0x38d78d[_0x9f74('0x2e')];if(!_0x5008fb[_0x9f74('0x30')][_0x9f74('0x34')](_0x9f74('0x56'))){_0x1b9345['limit']=qs[_0x9f74('0x1c')](_0x5008fb['query'][_0x9f74('0x1c')]);_0x1b9345[_0x9f74('0x1b')]=qs[_0x9f74('0x1b')](_0x5008fb[_0x9f74('0x30')][_0x9f74('0x1b')]);}_0x1b9345['order']=qs[_0x9f74('0x36')](_0x5008fb[_0x9f74('0x30')]['sort']);_0x1b9345[_0x9f74('0x3a')]=qs['filters'](_[_0x9f74('0x38')](_0x5008fb['query'],_0x38d78d['filters']));_0x1b9345[_0x9f74('0x3a')]['ProjectId']=_0x11d4f7['id'];if(_0x5008fb[_0x9f74('0x30')][_0x9f74('0x39')]){_0x1b9345[_0x9f74('0x3a')]=_['merge'](_0x1b9345[_0x9f74('0x3a')],{'$or':_[_0x9f74('0x2f')](_0x1b9345[_0x9f74('0x33')],function(_0x3cfbed){var _0xba4dc={};_0xba4dc[_0x3cfbed]={'$like':'%'+_0x5008fb[_0x9f74('0x30')][_0x9f74('0x39')]+'%'};return _0xba4dc;})});}_0x1b9345=_['merge']({},_0x1b9345,_0x5008fb[_0x9f74('0x3c')]);return db[_0x9f74('0x57')]['count']({'where':_0x1b9345[_0x9f74('0x3a')]})[_0x9f74('0x23')](function(_0x1ac09e){_0x58f833[_0x9f74('0x1a')]=_0x1ac09e;if(_0x5008fb[_0x9f74('0x30')][_0x9f74('0x3d')]){_0x1b9345[_0x9f74('0x44')]=[{'all':!![]}];}return db[_0x9f74('0x57')][_0x9f74('0x3f')](_0x1b9345);})[_0x9f74('0x23')](function(_0x2fde96){_0x58f833[_0x9f74('0x40')]=_0x2fde96;return _0x58f833;});}})[_0x9f74('0x23')](respondWithFilteredResult(_0x4f1222,_0x1b9345))[_0x9f74('0x4b')](handleError(_0x4f1222,null));};function char(_0xb93015){return _0x9f74('0x58')===typeof _0xb93015?String[_0x9f74('0x59')][_0x9f74('0x1f')](null,arguments):_0xb93015;}function needsEncapsulation(_0x11e96e){return!!_0x11e96e&&(_0x11e96e[_0x9f74('0x5a')]()[_0x9f74('0x5b')](char(0xd))>=0x0||_0x11e96e[_0x9f74('0x5a')]()['indexOf'](char(0xa))>=0x0||_0x11e96e[_0x9f74('0x5a')]()['indexOf'](char(0x2c))>=0x0||_0x11e96e['toString']()[_0x9f74('0x5b')](char(0x22))>=0x0);}function encapsulate(_0x59bb72){var _0x8334d6=char(0x22),_0x29e0dc='\x5c'+char(0x22),_0x275c34=_0x59bb72['toString']()[_0x9f74('0x5c')](new RegExp(_0x8334d6,'g'),_0x29e0dc);return _0x8334d6+_0x275c34+_0x8334d6;}exports[_0x9f74('0x5d')]=function(_0x45cac3,_0x4f8ec5,_0x239e41){var _0x57304b,_0x51409e;var _0x5afe95={'where':{'ProjectId':_0x45cac3[_0x9f74('0x42')]['id']}};if(_0x45cac3[_0x9f74('0x30')][_0x9f74('0x5e')]){_0x5afe95[_0x9f74('0x3a')][_0x9f74('0x5f')]=JSON[_0x9f74('0x60')](_0x45cac3['query'][_0x9f74('0x5e')]);}return db['JscriptySessionReport'][_0x9f74('0x3f')](_0x5afe95)[_0x9f74('0x23')](handleEntityNotFound(_0x4f8ec5,null))['then'](function(_0x13bc3b){if(_0x13bc3b){_0x57304b=_0x13bc3b;return db[_0x9f74('0x61')]['findAll']({'where':{'SessionId':{'$in':_[_0x9f74('0x2f')](_0x57304b,'id')},'ProjectId':_0x45cac3[_0x9f74('0x42')]['id']},'order':_0x9f74('0x62')});}})[_0x9f74('0x23')](handleEntityNotFound(_0x4f8ec5,null))[_0x9f74('0x23')](function(_0x39b913){if(_0x39b913){_0x51409e=_0x39b913;var _0x1cd70a={};for(var _0x5bd726=0x0,_0x49e276=_0x51409e[_0x9f74('0x4d')];_0x5bd726<_0x49e276;_0x5bd726++){if(!_0x1cd70a[_0x9f74('0x34')](_0x51409e[_0x5bd726]['questionId'])){_0x1cd70a[_0x51409e[_0x5bd726][_0x9f74('0x63')]]=needsEncapsulation(_0x51409e[_0x5bd726]['question'])?encapsulate(_0x51409e[_0x5bd726][_0x9f74('0x64')]):_0x51409e[_0x5bd726][_0x9f74('0x64')];}}var _0x12ea5a=[],_0x3ab1a2={};for(var _0x2a95fe=0x0,_0x34e070=_0x57304b[_0x9f74('0x4d')];_0x2a95fe<_0x34e070;_0x2a95fe++){_0x3ab1a2={'ProjectId':_0x45cac3['params']['id'],'SessionId':_0x57304b[_0x2a95fe]['id'],'StartTime':moment(_0x57304b[_0x2a95fe][_0x9f74('0x5f')])[_0x9f74('0x65')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x54a605=0x0,_0x341a14=_0x51409e[_0x9f74('0x4d')];_0x54a605<_0x341a14;_0x54a605++){if(_0x51409e[_0x54a605][_0x9f74('0x66')]==_0x57304b[_0x2a95fe]['id']&&_0x1cd70a[_0x9f74('0x34')](_0x51409e[_0x54a605][_0x9f74('0x63')])){_0x3ab1a2[_0x1cd70a[_0x51409e[_0x54a605]['questionId']]]=_0x51409e[_0x54a605][_0x9f74('0x67')];}}for(var _0x4d1c49 in _0x1cd70a){if(!_0x3ab1a2[_0x9f74('0x34')](_0x1cd70a[_0x4d1c49])){_0x3ab1a2[_0x1cd70a[_0x4d1c49]]=null;}}_0x12ea5a[_0x9f74('0x68')](_0x3ab1a2);}return _0x12ea5a;}})['then'](function(_0x5b005d){if(!_[_0x9f74('0x69')](_0x5b005d)){var _0x2f8ee3=toCsv(_0x5b005d);var _0x48c293=Date[_0x9f74('0x6a')]();fs[_0x9f74('0x6b')](util['format'](_0x9f74('0x6c'),_0x45cac3[_0x9f74('0x42')]['id'],_0x48c293),_0x2f8ee3);_0x4f8ec5[_0x9f74('0x6d')]('Content-disposition',_0x9f74('0x6e')+util[_0x9f74('0x65')](_0x9f74('0x6f'),_0x45cac3[_0x9f74('0x42')]['id'],_0x48c293));_0x4f8ec5[_0x9f74('0x6d')](_0x9f74('0x70'),_0x9f74('0x71'));return _0x4f8ec5[_0x9f74('0x72')](util['format'](_0x9f74('0x6c'),_0x45cac3[_0x9f74('0x42')]['id'],_0x48c293));}else{return _0x4f8ec5['sendStatus'](0xcc);}})[_0x9f74('0x4b')](handleError(_0x4f8ec5,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index bb65c95..c0c333d 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 _0x3e57=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','util','../../config/logger'];(function(_0x474a5e,_0x1dd168){var _0x4ed348=function(_0x23d9aa){while(--_0x23d9aa){_0x474a5e['push'](_0x474a5e['shift']());}};_0x4ed348(++_0x1dd168);}(_0x3e57,0xc1));var _0x73e5=function(_0x49a1a0,_0x48f776){_0x49a1a0=_0x49a1a0-0x0;var _0x518a4f=_0x3e57[_0x49a1a0];return _0x518a4f;};'use strict';var _=require('lodash');var util=require(_0x73e5('0x0'));var logger=require(_0x73e5('0x1'))(_0x73e5('0x2'));var moment=require(_0x73e5('0x3'));var BPromise=require(_0x73e5('0x4'));var rp=require(_0x73e5('0x5'));var fs=require('fs');var path=require(_0x73e5('0x6'));var rimraf=require(_0x73e5('0x7'));var config=require(_0x73e5('0x8'));var attributes=require(_0x73e5('0x9'));module[_0x73e5('0xa')]=function(_0x1a9968,_0x16d72c){return _0x1a9968[_0x73e5('0xb')](_0x73e5('0xc'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac10=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject'];(function(_0x341619,_0x3b96eb){var _0x5c6ec0=function(_0x3a0144){while(--_0x3a0144){_0x341619['push'](_0x341619['shift']());}};_0x5c6ec0(++_0x3b96eb);}(_0xac10,0xdc));var _0x0ac1=function(_0x208128,_0x9e2557){_0x208128=_0x208128-0x0;var _0x213a02=_0xac10[_0x208128];return _0x213a02;};'use strict';var _=require('lodash');var util=require(_0x0ac1('0x0'));var logger=require(_0x0ac1('0x1'))(_0x0ac1('0x2'));var moment=require(_0x0ac1('0x3'));var BPromise=require(_0x0ac1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ac1('0x5'));var rimraf=require('rimraf');var config=require(_0x0ac1('0x6'));var attributes=require(_0x0ac1('0x7'));module[_0x0ac1('0x8')]=function(_0x306a5e,_0x5abe01){return _0x306a5e['define'](_0x0ac1('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 3709fe6..f172885 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 _0xfc6f=['ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyProject,\x20%s,\x20%s','message','result','lodash','bluebird'];(function(_0x3ab0c4,_0x1f9dff){var _0x2c5456=function(_0x14be49){while(--_0x14be49){_0x3ab0c4['push'](_0x3ab0c4['shift']());}};_0x2c5456(++_0x1f9dff);}(_0xfc6f,0x152));var _0xffc6=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xfc6f[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0xffc6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xffc6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffc6('0x2'));var db=require(_0xffc6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xffc6('0x4'))('rpc');var config=require(_0xffc6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xffc6('0x6')][_0xffc6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c4bc2,_0x23b15c,_0x50cac2){return new BPromise(function(_0xb7f5f8,_0x2cabd5){return client[_0xffc6('0x8')](_0x1c4bc2,_0x50cac2)[_0xffc6('0x9')](function(_0xb8823c){logger[_0xffc6('0xa')]('JscriptyProject,\x20%s,\x20%s',_0x23b15c,_0xffc6('0xb'));logger[_0xffc6('0xc')](_0xffc6('0xd'),_0x23b15c,_0xffc6('0xb'),JSON[_0xffc6('0xe')](_0xb8823c));if(_0xb8823c[_0xffc6('0xf')]){if(_0xb8823c[_0xffc6('0xf')][_0xffc6('0x10')]===0x1f4){logger['error'](_0xffc6('0x11'),_0x23b15c,_0xb8823c[_0xffc6('0xf')][_0xffc6('0x12')]);return _0x2cabd5(_0xb8823c['error'][_0xffc6('0x12')]);}logger['error'](_0xffc6('0x11'),_0x23b15c,_0xb8823c[_0xffc6('0xf')][_0xffc6('0x12')]);return _0xb7f5f8(_0xb8823c['error'][_0xffc6('0x12')]);}else{logger[_0xffc6('0xa')](_0xffc6('0x11'),_0x23b15c,_0xffc6('0xb'));_0xb7f5f8(_0xb8823c[_0xffc6('0x13')][_0xffc6('0x12')]);}})['catch'](function(_0x55fbaf){logger[_0xffc6('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x23b15c,_0x55fbaf);_0x2cabd5(_0x55fbaf);});});} \ No newline at end of file +var _0x176a=['info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0xb81471,_0x7ef001){var _0x20a710=function(_0x1399cc){while(--_0x1399cc){_0xb81471['push'](_0xb81471['shift']());}};_0x20a710(++_0x7ef001);}(_0x176a,0x11e));var _0xa176=function(_0x43f99b,_0x7e2d77){_0x43f99b=_0x43f99b-0x0;var _0x33ad92=_0x176a[_0x43f99b];return _0x33ad92;};'use strict';var _=require(_0xa176('0x0'));var util=require('util');var moment=require(_0xa176('0x1'));var BPromise=require(_0xa176('0x2'));var rs=require(_0xa176('0x3'));var fs=require('fs');var Redis=require(_0xa176('0x4'));var db=require(_0xa176('0x5'))['db'];var utils=require(_0xa176('0x6'));var logger=require(_0xa176('0x7'))(_0xa176('0x8'));var config=require('../../config/environment');var jayson=require(_0xa176('0x9'));var client=jayson['client'][_0xa176('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47ca36,_0x4bb0bf,_0x339df1){return new BPromise(function(_0x558894,_0x21b10c){return client[_0xa176('0xb')](_0x47ca36,_0x339df1)[_0xa176('0xc')](function(_0x51ff30){logger[_0xa176('0xd')](_0xa176('0xe'),_0x4bb0bf,_0xa176('0xf'));logger[_0xa176('0x10')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x4bb0bf,_0xa176('0xf'),JSON[_0xa176('0x11')](_0x51ff30));if(_0x51ff30[_0xa176('0x12')]){if(_0x51ff30[_0xa176('0x12')][_0xa176('0x13')]===0x1f4){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x4bb0bf,_0x51ff30[_0xa176('0x12')][_0xa176('0x14')]);return _0x21b10c(_0x51ff30[_0xa176('0x12')][_0xa176('0x14')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x4bb0bf,_0x51ff30[_0xa176('0x12')][_0xa176('0x14')]);return _0x558894(_0x51ff30[_0xa176('0x12')][_0xa176('0x14')]);}else{logger[_0xa176('0xd')](_0xa176('0xe'),_0x4bb0bf,_0xa176('0xf'));_0x558894(_0x51ff30[_0xa176('0x15')][_0xa176('0x14')]);}})[_0xa176('0x16')](function(_0x4feec0){logger[_0xa176('0x12')](_0xa176('0xe'),_0x4bb0bf,_0x4feec0);_0x21b10c(_0x4feec0);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 9dbf523..bc26353 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 _0x5e40=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3cb69b,_0x4b81d4){var _0x40a180=function(_0x3498cb){while(--_0x3498cb){_0x3cb69b['push'](_0x3cb69b['shift']());}};_0x40a180(++_0x4b81d4);}(_0x5e40,0x156));var _0x05e4=function(_0x16311f,_0x40f002){_0x16311f=_0x16311f-0x0;var _0x42f147=_0x5e40[_0x16311f];return _0x42f147;};'use strict';var multer=require(_0x05e4('0x0'));var util=require(_0x05e4('0x1'));var path=require(_0x05e4('0x2'));var timeout=require(_0x05e4('0x3'));var express=require(_0x05e4('0x4'));var router=express[_0x05e4('0x5')]();var auth=require(_0x05e4('0x6'));var interaction=require(_0x05e4('0x7'));var config=require(_0x05e4('0x8'));var controller=require(_0x05e4('0x9'));router[_0x05e4('0xa')]('/',auth['isAuthenticated'](),controller[_0x05e4('0xb')]);router[_0x05e4('0xa')](_0x05e4('0xc'),auth[_0x05e4('0xd')](),controller['describe']);router[_0x05e4('0xa')](_0x05e4('0xe'),auth['isAuthenticated'](),controller[_0x05e4('0xf')]);router[_0x05e4('0x10')]('/',auth[_0x05e4('0xd')](),controller[_0x05e4('0x11')]);router[_0x05e4('0x12')](_0x05e4('0xe'),auth['isAuthenticated'](),controller[_0x05e4('0x13')]);router[_0x05e4('0x14')](_0x05e4('0xe'),auth[_0x05e4('0xd')](),controller[_0x05e4('0x15')]);module[_0x05e4('0x16')]=router; \ No newline at end of file +var _0xfce7=['Router','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','util','path','express'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xfce7,0x178));var _0x7fce=function(_0x540133,_0x41783f){_0x540133=_0x540133-0x0;var _0x26b6e9=_0xfce7[_0x540133];return _0x26b6e9;};'use strict';var multer=require(_0x7fce('0x0'));var util=require(_0x7fce('0x1'));var path=require(_0x7fce('0x2'));var timeout=require('connect-timeout');var express=require(_0x7fce('0x3'));var router=express[_0x7fce('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7fce('0x5'));var config=require(_0x7fce('0x6'));var controller=require(_0x7fce('0x7'));router[_0x7fce('0x8')]('/',auth[_0x7fce('0x9')](),controller[_0x7fce('0xa')]);router[_0x7fce('0x8')](_0x7fce('0xb'),auth[_0x7fce('0x9')](),controller[_0x7fce('0xc')]);router['get'](_0x7fce('0xd'),auth[_0x7fce('0x9')](),controller[_0x7fce('0xe')]);router['post']('/',auth[_0x7fce('0x9')](),controller[_0x7fce('0xf')]);router[_0x7fce('0x10')]('/:id',auth[_0x7fce('0x9')](),controller['update']);router[_0x7fce('0x11')](_0x7fce('0xd'),auth[_0x7fce('0x9')](),controller[_0x7fce('0x12')]);module[_0x7fce('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 9d5dfd1..9f18174 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 _0xacd5=['TEXT','sequelize','exports','STRING'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0xacd5,0x1bd));var _0x5acd=function(_0x5b89c7,_0x22994c){_0x5b89c7=_0x5b89c7-0x0;var _0x332b50=_0xacd5[_0x5b89c7];return _0x332b50;};'use strict';var Sequelize=require(_0x5acd('0x0'));module[_0x5acd('0x1')]={'question':{'type':Sequelize[_0x5acd('0x2')]},'answer':{'type':Sequelize[_0x5acd('0x3')]('long')},'membername':{'type':Sequelize[_0x5acd('0x2')]},'projectname':{'type':Sequelize[_0x5acd('0x2')]},'queue':{'type':Sequelize[_0x5acd('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5acd('0x2')]},'questionId':{'type':Sequelize[_0x5acd('0x2')]}}; \ No newline at end of file +var _0x1fc0=['TEXT','long','sequelize','STRING'];(function(_0x3551ec,_0x118504){var _0x5f3b97=function(_0x5b1692){while(--_0x5b1692){_0x3551ec['push'](_0x3551ec['shift']());}};_0x5f3b97(++_0x118504);}(_0x1fc0,0x18a));var _0x01fc=function(_0x375766,_0x127c19){_0x375766=_0x375766-0x0;var _0x38e8ea=_0x1fc0[_0x375766];return _0x38e8ea;};'use strict';var Sequelize=require(_0x01fc('0x0'));module['exports']={'question':{'type':Sequelize[_0x01fc('0x1')]},'answer':{'type':Sequelize[_0x01fc('0x2')](_0x01fc('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x01fc('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x01fc('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x01fc('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 4bc13fd..88fd9b9 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 _0x1ff4=['ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','save','update','then','destroy','error','stack','name','index','map','JscriptyQuestionReport','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','VIRTUAL','merge','options','count','includeAll','include','rows','catch','show','keys','rawAttributes','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv'];(function(_0xaba814,_0x3275a2){var _0x5293a7=function(_0x6633bf){while(--_0x6633bf){_0xaba814['push'](_0xaba814['shift']());}};_0x5293a7(++_0x3275a2);}(_0x1ff4,0x82));var _0x41ff=function(_0x511153,_0x5a3df2){_0x511153=_0x511153-0x0;var _0x1b22cd=_0x1ff4[_0x511153];return _0x1b22cd;};'use strict';var pdf=require(_0x41ff('0x0'));var emlformat=require(_0x41ff('0x1'));var rimraf=require(_0x41ff('0x2'));var zipdir=require(_0x41ff('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x41ff('0x4'));var Mustache=require(_0x41ff('0x5'));var util=require(_0x41ff('0x6'));var path=require(_0x41ff('0x7'));var sox=require(_0x41ff('0x8'));var csv=require(_0x41ff('0x9'));var ejs=require(_0x41ff('0xa'));var fs=require('fs');var _=require(_0x41ff('0xb'));var squel=require('squel');var crypto=require(_0x41ff('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x41ff('0xd'));var toCsv=require('to-csv');var querystring=require(_0x41ff('0xe'));var Papa=require(_0x41ff('0xf'));var Redis=require(_0x41ff('0x10'));var authService=require(_0x41ff('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x41ff('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x41ff('0x13'))(_0x41ff('0x14'));var utils=require(_0x41ff('0x15'));var config=require(_0x41ff('0x16'));var db=require(_0x41ff('0x17'))['db'];function respondWithStatusCode(_0x6a3379,_0x4bd8e2){_0x4bd8e2=_0x4bd8e2||0xcc;return function(_0x441f54){if(_0x441f54){return _0x6a3379[_0x41ff('0x18')](_0x4bd8e2);}return _0x6a3379[_0x41ff('0x19')](_0x4bd8e2)[_0x41ff('0x1a')]();};}function respondWithResult(_0x42873b,_0x218b5f){_0x218b5f=_0x218b5f||0xc8;return function(_0x53d28e){if(_0x53d28e){return _0x42873b['status'](_0x218b5f)[_0x41ff('0x1b')](_0x53d28e);}};}function respondWithFilteredResult(_0x1a4d52,_0x3ae136){return function(_0x27d673){if(_0x27d673){var _0x43f435=_0x27d673['count'],_0xe6ec9c=_0x3ae136[_0x41ff('0x1c')],_0x4ac9b8=_0x3ae136['offset']+_0x3ae136['limit'],_0x2b1293;if(_0x4ac9b8>=_0x43f435){_0x4ac9b8=_0x43f435;_0x2b1293=0xc8;}else{_0x2b1293=0xce;}_0x1a4d52[_0x41ff('0x19')](_0x2b1293);return _0x1a4d52[_0x41ff('0x1d')]('Content-Range',_0xe6ec9c+'-'+_0x4ac9b8+'/'+_0x43f435)[_0x41ff('0x1b')](_0x27d673);}return null;};}function patchUpdates(_0x46bd35){return function(_0x316b8a){try{jsonpatch['apply'](_0x316b8a,_0x46bd35,!![]);}catch(_0x2a2a68){return BPromise['reject'](_0x2a2a68);}return _0x316b8a[_0x41ff('0x1e')]();};}function saveUpdates(_0x2f30ac,_0xf5af34){return function(_0x45057f){if(_0x45057f){return _0x45057f[_0x41ff('0x1f')](_0x2f30ac)[_0x41ff('0x20')](function(_0xf1cf95){return _0xf1cf95;});}return null;};}function removeEntity(_0x51778f,_0x2af519){return function(_0x2f9791){if(_0x2f9791){return _0x2f9791[_0x41ff('0x21')]()['then'](function(){_0x51778f[_0x41ff('0x19')](0xcc)[_0x41ff('0x1a')]();});}};}function handleEntityNotFound(_0x476f92,_0x1ceeb5){return function(_0x4e2636){if(!_0x4e2636){_0x476f92[_0x41ff('0x18')](0x194);}return _0x4e2636;};}function handleError(_0x43effa,_0x12d9a6){_0x12d9a6=_0x12d9a6||0x1f4;return function(_0x5dec1f){logger[_0x41ff('0x22')](_0x5dec1f[_0x41ff('0x23')]);if(_0x5dec1f[_0x41ff('0x24')]){delete _0x5dec1f[_0x41ff('0x24')];}_0x43effa[_0x41ff('0x19')](_0x12d9a6)['send'](_0x5dec1f);};}exports[_0x41ff('0x25')]=function(_0xd06a77,_0x3060cd){var _0xf142a8={},_0x460afb={},_0x546574={'count':0x0,'rows':[]};var _0x488eb0=_[_0x41ff('0x26')](db[_0x41ff('0x27')]['rawAttributes'],function(_0x4aa6f6){return{'name':_0x4aa6f6['fieldName'],'type':_0x4aa6f6[_0x41ff('0x28')]['key']};});_0x460afb[_0x41ff('0x29')]=_[_0x41ff('0x26')](_0x488eb0,_0x41ff('0x24'));_0x460afb['query']=_['keys'](_0xd06a77[_0x41ff('0x2a')]);_0x460afb[_0x41ff('0x2b')]=_[_0x41ff('0x2c')](_0x460afb[_0x41ff('0x29')],_0x460afb[_0x41ff('0x2a')]);_0xf142a8[_0x41ff('0x2d')]=_['intersection'](_0x460afb['model'],qs[_0x41ff('0x2e')](_0xd06a77[_0x41ff('0x2a')][_0x41ff('0x2e')]));_0xf142a8[_0x41ff('0x2d')]=_0xf142a8[_0x41ff('0x2d')][_0x41ff('0x2f')]?_0xf142a8[_0x41ff('0x2d')]:_0x460afb[_0x41ff('0x29')];if(!_0xd06a77[_0x41ff('0x2a')][_0x41ff('0x30')](_0x41ff('0x31'))){_0xf142a8['limit']=qs[_0x41ff('0x32')](_0xd06a77[_0x41ff('0x2a')][_0x41ff('0x32')]);_0xf142a8[_0x41ff('0x1c')]=qs[_0x41ff('0x1c')](_0xd06a77['query'][_0x41ff('0x1c')]);}_0xf142a8[_0x41ff('0x33')]=qs['sort'](_0xd06a77['query'][_0x41ff('0x34')]);_0xf142a8['where']=qs[_0x41ff('0x2b')](_[_0x41ff('0x35')](_0xd06a77[_0x41ff('0x2a')],_0x460afb[_0x41ff('0x2b')]));if(_0xd06a77['query']['filter']){_0xf142a8['where']=_['merge'](_0xf142a8['where'],{'$or':_['map'](_0x488eb0,function(_0x5bc9c3){if(_0x5bc9c3[_0x41ff('0x28')]!==_0x41ff('0x36')){var _0x54e786={};_0x54e786[_0x5bc9c3[_0x41ff('0x24')]]={'$like':'%'+_0xd06a77[_0x41ff('0x2a')]['filter']+'%'};return _0x54e786;}})});}_0xf142a8=_[_0x41ff('0x37')]({},_0xf142a8,_0xd06a77[_0x41ff('0x38')]);var _0x139b8b={'where':_0xf142a8['where']};return db[_0x41ff('0x27')][_0x41ff('0x39')](_0x139b8b)['then'](function(_0x5f4774){_0x546574[_0x41ff('0x39')]=_0x5f4774;if(_0xd06a77[_0x41ff('0x2a')][_0x41ff('0x3a')]){_0xf142a8[_0x41ff('0x3b')]=[{'all':!![]}];}return db[_0x41ff('0x27')]['findAll'](_0xf142a8);})[_0x41ff('0x20')](function(_0x3ec94a){_0x546574[_0x41ff('0x3c')]=_0x3ec94a;return _0x546574;})[_0x41ff('0x20')](respondWithFilteredResult(_0x3060cd,_0xf142a8))[_0x41ff('0x3d')](handleError(_0x3060cd,null));};exports[_0x41ff('0x3e')]=function(_0x116bdd,_0x3941a3){var _0x291e13={'raw':!![],'where':{'id':_0x116bdd['params']['id']}},_0x223ac7={};_0x223ac7[_0x41ff('0x29')]=_[_0x41ff('0x3f')](db[_0x41ff('0x27')][_0x41ff('0x40')]);_0x223ac7['query']=_[_0x41ff('0x3f')](_0x116bdd[_0x41ff('0x2a')]);_0x223ac7['filters']=_[_0x41ff('0x2c')](_0x223ac7[_0x41ff('0x29')],_0x223ac7[_0x41ff('0x2a')]);_0x291e13['attributes']=_[_0x41ff('0x2c')](_0x223ac7[_0x41ff('0x29')],qs[_0x41ff('0x2e')](_0x116bdd['query'][_0x41ff('0x2e')]));_0x291e13[_0x41ff('0x2d')]=_0x291e13['attributes'][_0x41ff('0x2f')]?_0x291e13[_0x41ff('0x2d')]:_0x223ac7[_0x41ff('0x29')];if(_0x116bdd[_0x41ff('0x2a')][_0x41ff('0x3a')]){_0x291e13[_0x41ff('0x3b')]=[{'all':!![]}];}_0x291e13=_['merge']({},_0x291e13,_0x116bdd['options']);return db[_0x41ff('0x27')][_0x41ff('0x41')](_0x291e13)[_0x41ff('0x20')](handleEntityNotFound(_0x3941a3,null))['then'](respondWithResult(_0x3941a3,null))[_0x41ff('0x3d')](handleError(_0x3941a3,null));};exports[_0x41ff('0x42')]=function(_0x2fcf48,_0xe1173e){return db[_0x41ff('0x27')][_0x41ff('0x42')](_0x2fcf48['body'],{})['then'](respondWithResult(_0xe1173e,0xc9))[_0x41ff('0x3d')](handleError(_0xe1173e,null));};exports[_0x41ff('0x1f')]=function(_0x2313bc,_0xa6ed3d){if(_0x2313bc[_0x41ff('0x43')]['id']){delete _0x2313bc[_0x41ff('0x43')]['id'];}return db[_0x41ff('0x27')][_0x41ff('0x41')]({'where':{'id':_0x2313bc[_0x41ff('0x44')]['id']}})[_0x41ff('0x20')](handleEntityNotFound(_0xa6ed3d,null))[_0x41ff('0x20')](saveUpdates(_0x2313bc[_0x41ff('0x43')],null))['then'](respondWithResult(_0xa6ed3d,null))[_0x41ff('0x3d')](handleError(_0xa6ed3d,null));};exports['destroy']=function(_0x408874,_0x4e027b){return db[_0x41ff('0x27')][_0x41ff('0x41')]({'where':{'id':_0x408874[_0x41ff('0x44')]['id']}})[_0x41ff('0x20')](handleEntityNotFound(_0x4e027b,null))[_0x41ff('0x20')](removeEntity(_0x4e027b,null))[_0x41ff('0x3d')](handleError(_0x4e027b,null));};exports[_0x41ff('0x45')]=function(_0x52062e,_0xe1eb26){return db[_0x41ff('0x27')][_0x41ff('0x45')]()[_0x41ff('0x20')](respondWithResult(_0xe1eb26,null))[_0x41ff('0x3d')](handleError(_0xe1eb26,null));}; \ No newline at end of file +var _0xd957=['filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','count','includeAll','findAll','rows','show','params','intersection','options','catch','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','JscriptyQuestionReport','rawAttributes','key','model','map','query','keys'];(function(_0x5b2176,_0x212ba3){var _0x36d39a=function(_0x300fd0){while(--_0x300fd0){_0x5b2176['push'](_0x5b2176['shift']());}};_0x36d39a(++_0x212ba3);}(_0xd957,0xb7));var _0x7d95=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd957[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0x7d95('0x0'));var emlformat=require(_0x7d95('0x1'));var rimraf=require(_0x7d95('0x2'));var zipdir=require(_0x7d95('0x3'));var jsonpatch=require(_0x7d95('0x4'));var rp=require(_0x7d95('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7d95('0x6'));var util=require(_0x7d95('0x7'));var path=require(_0x7d95('0x8'));var sox=require(_0x7d95('0x9'));var csv=require(_0x7d95('0xa'));var ejs=require(_0x7d95('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7d95('0xc'));var crypto=require(_0x7d95('0xd'));var jsforce=require(_0x7d95('0xe'));var deskjs=require(_0x7d95('0xf'));var toCsv=require(_0x7d95('0xa'));var querystring=require(_0x7d95('0x10'));var Papa=require(_0x7d95('0x11'));var Redis=require(_0x7d95('0x12'));var authService=require(_0x7d95('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7d95('0x14'));var hardwareService=require(_0x7d95('0x15'));var logger=require(_0x7d95('0x16'))(_0x7d95('0x17'));var utils=require('../../config/utils');var config=require(_0x7d95('0x18'));var db=require(_0x7d95('0x19'))['db'];function respondWithStatusCode(_0x4ed8fc,_0x206c73){_0x206c73=_0x206c73||0xcc;return function(_0x3d8722){if(_0x3d8722){return _0x4ed8fc['sendStatus'](_0x206c73);}return _0x4ed8fc['status'](_0x206c73)['end']();};}function respondWithResult(_0xaa51e0,_0x3ae434){_0x3ae434=_0x3ae434||0xc8;return function(_0x52bef8){if(_0x52bef8){return _0xaa51e0[_0x7d95('0x1a')](_0x3ae434)[_0x7d95('0x1b')](_0x52bef8);}};}function respondWithFilteredResult(_0xd3098a,_0x4b982f){return function(_0x51d48d){if(_0x51d48d){var _0x4bb9c4=_0x51d48d['count'],_0x5bb9ec=_0x4b982f[_0x7d95('0x1c')],_0x25b090=_0x4b982f[_0x7d95('0x1c')]+_0x4b982f[_0x7d95('0x1d')],_0x338b2e;if(_0x25b090>=_0x4bb9c4){_0x25b090=_0x4bb9c4;_0x338b2e=0xc8;}else{_0x338b2e=0xce;}_0xd3098a['status'](_0x338b2e);return _0xd3098a[_0x7d95('0x1e')](_0x7d95('0x1f'),_0x5bb9ec+'-'+_0x25b090+'/'+_0x4bb9c4)[_0x7d95('0x1b')](_0x51d48d);}return null;};}function patchUpdates(_0x9dfcf1){return function(_0x15a8e6){try{jsonpatch[_0x7d95('0x20')](_0x15a8e6,_0x9dfcf1,!![]);}catch(_0x1be134){return BPromise[_0x7d95('0x21')](_0x1be134);}return _0x15a8e6[_0x7d95('0x22')]();};}function saveUpdates(_0x2cfdee,_0x82add){return function(_0x555cfe){if(_0x555cfe){return _0x555cfe[_0x7d95('0x23')](_0x2cfdee)['then'](function(_0x1bad78){return _0x1bad78;});}return null;};}function removeEntity(_0x413e66,_0x1c2332){return function(_0x52c997){if(_0x52c997){return _0x52c997[_0x7d95('0x24')]()[_0x7d95('0x25')](function(){_0x413e66[_0x7d95('0x1a')](0xcc)[_0x7d95('0x26')]();});}};}function handleEntityNotFound(_0x123d64,_0x459ae7){return function(_0x161b8a){if(!_0x161b8a){_0x123d64[_0x7d95('0x27')](0x194);}return _0x161b8a;};}function handleError(_0x2eb755,_0x1e4ce9){_0x1e4ce9=_0x1e4ce9||0x1f4;return function(_0x320d45){logger[_0x7d95('0x28')](_0x320d45[_0x7d95('0x29')]);if(_0x320d45[_0x7d95('0x2a')]){delete _0x320d45[_0x7d95('0x2a')];}_0x2eb755[_0x7d95('0x1a')](_0x1e4ce9)[_0x7d95('0x2b')](_0x320d45);};}exports['index']=function(_0x3953cb,_0x5cd2e5){var _0x482d08={},_0x10984a={},_0x3f3186={'count':0x0,'rows':[]};var _0x1c72f6=_['map'](db[_0x7d95('0x2c')][_0x7d95('0x2d')],function(_0x3baa06){return{'name':_0x3baa06['fieldName'],'type':_0x3baa06['type'][_0x7d95('0x2e')]};});_0x10984a[_0x7d95('0x2f')]=_[_0x7d95('0x30')](_0x1c72f6,'name');_0x10984a[_0x7d95('0x31')]=_[_0x7d95('0x32')](_0x3953cb[_0x7d95('0x31')]);_0x10984a[_0x7d95('0x33')]=_['intersection'](_0x10984a[_0x7d95('0x2f')],_0x10984a['query']);_0x482d08['attributes']=_['intersection'](_0x10984a[_0x7d95('0x2f')],qs[_0x7d95('0x34')](_0x3953cb['query'][_0x7d95('0x34')]));_0x482d08[_0x7d95('0x35')]=_0x482d08[_0x7d95('0x35')][_0x7d95('0x36')]?_0x482d08[_0x7d95('0x35')]:_0x10984a[_0x7d95('0x2f')];if(!_0x3953cb[_0x7d95('0x31')][_0x7d95('0x37')](_0x7d95('0x38'))){_0x482d08[_0x7d95('0x1d')]=qs[_0x7d95('0x1d')](_0x3953cb[_0x7d95('0x31')][_0x7d95('0x1d')]);_0x482d08[_0x7d95('0x1c')]=qs[_0x7d95('0x1c')](_0x3953cb[_0x7d95('0x31')]['offset']);}_0x482d08[_0x7d95('0x39')]=qs[_0x7d95('0x3a')](_0x3953cb[_0x7d95('0x31')][_0x7d95('0x3a')]);_0x482d08[_0x7d95('0x3b')]=qs[_0x7d95('0x33')](_[_0x7d95('0x3c')](_0x3953cb[_0x7d95('0x31')],_0x10984a[_0x7d95('0x33')]));if(_0x3953cb[_0x7d95('0x31')]['filter']){_0x482d08['where']=_[_0x7d95('0x3d')](_0x482d08[_0x7d95('0x3b')],{'$or':_[_0x7d95('0x30')](_0x1c72f6,function(_0x7b783){if(_0x7b783[_0x7d95('0x3e')]!==_0x7d95('0x3f')){var _0xab1c32={};_0xab1c32[_0x7b783[_0x7d95('0x2a')]]={'$like':'%'+_0x3953cb['query'][_0x7d95('0x40')]+'%'};return _0xab1c32;}})});}_0x482d08=_[_0x7d95('0x3d')]({},_0x482d08,_0x3953cb['options']);var _0x5307e3={'where':_0x482d08[_0x7d95('0x3b')]};return db['JscriptyQuestionReport']['count'](_0x5307e3)[_0x7d95('0x25')](function(_0x38531c){_0x3f3186[_0x7d95('0x41')]=_0x38531c;if(_0x3953cb[_0x7d95('0x31')][_0x7d95('0x42')]){_0x482d08['include']=[{'all':!![]}];}return db[_0x7d95('0x2c')][_0x7d95('0x43')](_0x482d08);})['then'](function(_0x1f9b52){_0x3f3186[_0x7d95('0x44')]=_0x1f9b52;return _0x3f3186;})['then'](respondWithFilteredResult(_0x5cd2e5,_0x482d08))['catch'](handleError(_0x5cd2e5,null));};exports[_0x7d95('0x45')]=function(_0x417b6e,_0xa15720){var _0x5f1e42={'raw':!![],'where':{'id':_0x417b6e[_0x7d95('0x46')]['id']}},_0x1cf446={};_0x1cf446['model']=_[_0x7d95('0x32')](db[_0x7d95('0x2c')][_0x7d95('0x2d')]);_0x1cf446[_0x7d95('0x31')]=_[_0x7d95('0x32')](_0x417b6e[_0x7d95('0x31')]);_0x1cf446['filters']=_[_0x7d95('0x47')](_0x1cf446[_0x7d95('0x2f')],_0x1cf446[_0x7d95('0x31')]);_0x5f1e42['attributes']=_['intersection'](_0x1cf446[_0x7d95('0x2f')],qs[_0x7d95('0x34')](_0x417b6e[_0x7d95('0x31')]['fields']));_0x5f1e42[_0x7d95('0x35')]=_0x5f1e42['attributes']['length']?_0x5f1e42[_0x7d95('0x35')]:_0x1cf446[_0x7d95('0x2f')];if(_0x417b6e[_0x7d95('0x31')][_0x7d95('0x42')]){_0x5f1e42['include']=[{'all':!![]}];}_0x5f1e42=_[_0x7d95('0x3d')]({},_0x5f1e42,_0x417b6e[_0x7d95('0x48')]);return db[_0x7d95('0x2c')]['find'](_0x5f1e42)[_0x7d95('0x25')](handleEntityNotFound(_0xa15720,null))[_0x7d95('0x25')](respondWithResult(_0xa15720,null))[_0x7d95('0x49')](handleError(_0xa15720,null));};exports[_0x7d95('0x4a')]=function(_0xc59bc6,_0x13a610){return db[_0x7d95('0x2c')][_0x7d95('0x4a')](_0xc59bc6['body'],{})['then'](respondWithResult(_0x13a610,0xc9))[_0x7d95('0x49')](handleError(_0x13a610,null));};exports[_0x7d95('0x23')]=function(_0x1f51e5,_0x39d150){if(_0x1f51e5[_0x7d95('0x4b')]['id']){delete _0x1f51e5[_0x7d95('0x4b')]['id'];}return db[_0x7d95('0x2c')]['find']({'where':{'id':_0x1f51e5[_0x7d95('0x46')]['id']}})[_0x7d95('0x25')](handleEntityNotFound(_0x39d150,null))[_0x7d95('0x25')](saveUpdates(_0x1f51e5[_0x7d95('0x4b')],null))[_0x7d95('0x25')](respondWithResult(_0x39d150,null))[_0x7d95('0x49')](handleError(_0x39d150,null));};exports[_0x7d95('0x24')]=function(_0x4dffa3,_0x2f45f5){return db[_0x7d95('0x2c')][_0x7d95('0x4c')]({'where':{'id':_0x4dffa3[_0x7d95('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f45f5,null))[_0x7d95('0x25')](removeEntity(_0x2f45f5,null))[_0x7d95('0x49')](handleError(_0x2f45f5,null));};exports[_0x7d95('0x4d')]=function(_0x29e28b,_0x285fc2){return db[_0x7d95('0x2c')]['describe']()['then'](respondWithResult(_0x285fc2,null))[_0x7d95('0x49')](handleError(_0x285fc2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 164a446..cdf855b 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 _0x8039=['JscriptyQuestionReport','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x8039,0x79));var _0x9803=function(_0x3ec122,_0x55150a){_0x3ec122=_0x3ec122-0x0;var _0x4ecf41=_0x8039[_0x3ec122];return _0x4ecf41;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9803('0x0'))(_0x9803('0x1'));var moment=require(_0x9803('0x2'));var BPromise=require(_0x9803('0x3'));var rp=require(_0x9803('0x4'));var fs=require('fs');var path=require(_0x9803('0x5'));var rimraf=require(_0x9803('0x6'));var config=require(_0x9803('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x9803('0x8')]=function(_0x11ed5,_0x682153){return _0x11ed5['define'](_0x9803('0x9'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9e9=['api','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','util'];(function(_0x56d976,_0x5aa6af){var _0xb49a86=function(_0x3e2aad){while(--_0x3e2aad){_0x56d976['push'](_0x56d976['shift']());}};_0xb49a86(++_0x5aa6af);}(_0xb9e9,0xbc));var _0x9b9e=function(_0x407d50,_0x1c258b){_0x407d50=_0x407d50-0x0;var _0x13e7cb=_0xb9e9[_0x407d50];return _0x13e7cb;};'use strict';var _=require(_0x9b9e('0x0'));var util=require(_0x9b9e('0x1'));var logger=require('../../config/logger')(_0x9b9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b9e('0x3'));var rimraf=require(_0x9b9e('0x4'));var config=require(_0x9b9e('0x5'));var attributes=require(_0x9b9e('0x6'));module[_0x9b9e('0x7')]=function(_0x3abe9e,_0x5c0be1){return _0x3abe9e[_0x9b9e('0x8')]('JscriptyQuestionReport',attributes,{'tableName':_0x9b9e('0x9'),'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 7c53655..c91cb43 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 _0xedfe=['../../config/utils','../../config/environment','jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x12a41a,_0x92fc82){var _0x48db75=function(_0x583b6c){while(--_0x583b6c){_0x12a41a['push'](_0x12a41a['shift']());}};_0x48db75(++_0x92fc82);}(_0xedfe,0x177));var _0xeedf=function(_0x1f475d,_0x38edd6){_0x1f475d=_0x1f475d-0x0;var _0x52fd59=_0xedfe[_0x1f475d];return _0x52fd59;};'use strict';var _=require(_0xeedf('0x0'));var util=require(_0xeedf('0x1'));var moment=require(_0xeedf('0x2'));var BPromise=require('bluebird');var rs=require(_0xeedf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeedf('0x4'))['db'];var utils=require(_0xeedf('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xeedf('0x6'));var jayson=require(_0xeedf('0x7'));var client=jayson[_0xeedf('0x8')][_0xeedf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x406345,_0x349371,_0x53a696){return new BPromise(function(_0x1f1940,_0x9ae87e){return client['request'](_0x406345,_0x53a696)[_0xeedf('0xa')](function(_0x2f7259){logger[_0xeedf('0xb')](_0xeedf('0xc'),_0x349371,_0xeedf('0xd'));logger[_0xeedf('0xe')](_0xeedf('0xf'),_0x349371,_0xeedf('0xd'),JSON['stringify'](_0x2f7259));if(_0x2f7259[_0xeedf('0x10')]){if(_0x2f7259[_0xeedf('0x10')][_0xeedf('0x11')]===0x1f4){logger[_0xeedf('0x10')](_0xeedf('0xc'),_0x349371,_0x2f7259[_0xeedf('0x10')][_0xeedf('0x12')]);return _0x9ae87e(_0x2f7259[_0xeedf('0x10')]['message']);}logger[_0xeedf('0x10')](_0xeedf('0xc'),_0x349371,_0x2f7259[_0xeedf('0x10')][_0xeedf('0x12')]);return _0x1f1940(_0x2f7259[_0xeedf('0x10')][_0xeedf('0x12')]);}else{logger[_0xeedf('0xb')](_0xeedf('0xc'),_0x349371,_0xeedf('0xd'));_0x1f1940(_0x2f7259['result']['message']);}})[_0xeedf('0x13')](function(_0x5480b4){logger[_0xeedf('0x10')](_0xeedf('0xc'),_0x349371,_0x5480b4);_0x9ae87e(_0x5480b4);});});} \ No newline at end of file +var _0x6f87=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x87cb2b,_0x33c1a6){var _0x152d0d=function(_0x26357e){while(--_0x26357e){_0x87cb2b['push'](_0x87cb2b['shift']());}};_0x152d0d(++_0x33c1a6);}(_0x6f87,0x1c9));var _0x76f8=function(_0x14766f,_0x24ccbf){_0x14766f=_0x14766f-0x0;var _0x45f141=_0x6f87[_0x14766f];return _0x45f141;};'use strict';var _=require(_0x76f8('0x0'));var util=require(_0x76f8('0x1'));var moment=require('moment');var BPromise=require(_0x76f8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76f8('0x3'));var db=require(_0x76f8('0x4'))['db'];var utils=require(_0x76f8('0x5'));var logger=require('../../config/logger')(_0x76f8('0x6'));var config=require(_0x76f8('0x7'));var jayson=require(_0x76f8('0x8'));var client=jayson[_0x76f8('0x9')][_0x76f8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x441e2c,_0x4a5a78,_0xde22b4){return new BPromise(function(_0xfdeb58,_0x50f9e8){return client[_0x76f8('0xb')](_0x441e2c,_0xde22b4)[_0x76f8('0xc')](function(_0x38aa19){logger['info'](_0x76f8('0xd'),_0x4a5a78,_0x76f8('0xe'));logger[_0x76f8('0xf')](_0x76f8('0x10'),_0x4a5a78,_0x76f8('0xe'),JSON[_0x76f8('0x11')](_0x38aa19));if(_0x38aa19[_0x76f8('0x12')]){if(_0x38aa19[_0x76f8('0x12')][_0x76f8('0x13')]===0x1f4){logger['error'](_0x76f8('0xd'),_0x4a5a78,_0x38aa19['error'][_0x76f8('0x14')]);return _0x50f9e8(_0x38aa19[_0x76f8('0x12')]['message']);}logger['error'](_0x76f8('0xd'),_0x4a5a78,_0x38aa19[_0x76f8('0x12')]['message']);return _0xfdeb58(_0x38aa19['error'][_0x76f8('0x14')]);}else{logger[_0x76f8('0x15')](_0x76f8('0xd'),_0x4a5a78,'request\x20sent');_0xfdeb58(_0x38aa19[_0x76f8('0x16')][_0x76f8('0x14')]);}})[_0x76f8('0x17')](function(_0xa2b47f){logger['error'](_0x76f8('0xd'),_0x4a5a78,_0xa2b47f);_0x50f9e8(_0xa2b47f);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 053de2d..61037b0 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 _0xa7b4=['/:id/questions','getQuestions','put','update','destroy','util','path','express','Router','./jscriptySessionReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x4efb9c,_0x5a990f){var _0x26ccca=function(_0xb8188a){while(--_0xb8188a){_0x4efb9c['push'](_0x4efb9c['shift']());}};_0x26ccca(++_0x5a990f);}(_0xa7b4,0x8d));var _0x4a7b=function(_0x562148,_0x28c75f){_0x562148=_0x562148-0x0;var _0x3fc4b3=_0xa7b4[_0x562148];return _0x3fc4b3;};'use strict';var multer=require('multer');var util=require(_0x4a7b('0x0'));var path=require(_0x4a7b('0x1'));var timeout=require('connect-timeout');var express=require(_0x4a7b('0x2'));var router=express[_0x4a7b('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4a7b('0x4'));router[_0x4a7b('0x5')]('/',auth['isAuthenticated'](),controller[_0x4a7b('0x6')]);router[_0x4a7b('0x5')](_0x4a7b('0x7'),auth[_0x4a7b('0x8')](),controller[_0x4a7b('0x9')]);router[_0x4a7b('0x5')](_0x4a7b('0xa'),auth[_0x4a7b('0x8')](),controller[_0x4a7b('0xb')]);router[_0x4a7b('0x5')](_0x4a7b('0xc'),auth[_0x4a7b('0x8')](),controller[_0x4a7b('0xd')]);router['post']('/',auth[_0x4a7b('0x8')](),controller['create']);router[_0x4a7b('0xe')](_0x4a7b('0xa'),auth[_0x4a7b('0x8')](),controller[_0x4a7b('0xf')]);router['delete']('/:id',auth[_0x4a7b('0x8')](),controller[_0x4a7b('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb2ff=['destroy','exports','multer','util','connect-timeout','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index','/:id','show','/:id/questions','getQuestions','create','put','delete'];(function(_0x492197,_0x17752e){var _0x5b0201=function(_0x29b9fc){while(--_0x29b9fc){_0x492197['push'](_0x492197['shift']());}};_0x5b0201(++_0x17752e);}(_0xb2ff,0x123));var _0xfb2f=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb2ff[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xfb2f('0x0'));var util=require(_0xfb2f('0x1'));var path=require('path');var timeout=require(_0xfb2f('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xfb2f('0x3'));var config=require('../../config/environment');var controller=require(_0xfb2f('0x4'));router[_0xfb2f('0x5')]('/',auth[_0xfb2f('0x6')](),controller[_0xfb2f('0x7')]);router['get']('/describe',auth[_0xfb2f('0x6')](),controller['describe']);router[_0xfb2f('0x5')](_0xfb2f('0x8'),auth[_0xfb2f('0x6')](),controller[_0xfb2f('0x9')]);router['get'](_0xfb2f('0xa'),auth['isAuthenticated'](),controller[_0xfb2f('0xb')]);router['post']('/',auth[_0xfb2f('0x6')](),controller[_0xfb2f('0xc')]);router[_0xfb2f('0xd')](_0xfb2f('0x8'),auth[_0xfb2f('0x6')](),controller['update']);router[_0xfb2f('0xe')](_0xfb2f('0x8'),auth[_0xfb2f('0x6')](),controller[_0xfb2f('0xf')]);module[_0xfb2f('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 9fae07a..1f27d23 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 _0x83c0=['sequelize','exports','DATE','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83c0,0x135));var _0x083c=function(_0x35e07b,_0x42db6e){_0x35e07b=_0x35e07b-0x0;var _0x32b34e=_0x83c0[_0x35e07b];return _0x32b34e;};'use strict';var moment=require(_0x083c('0x0'));var Sequelize=require(_0x083c('0x1'));module[_0x083c('0x2')]={'starttime':{'type':Sequelize[_0x083c('0x3')],'set':function(_0x2c7719){this[_0x083c('0x4')](_0x083c('0x5'),_0x2c7719);this[_0x083c('0x4')]('endtime',moment()[_0x083c('0x6')](_0x083c('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x083c('0x8')]},'projectname':{'type':Sequelize[_0x083c('0x8')]},'queue':{'type':Sequelize[_0x083c('0x8')]},'uniqueid':{'type':Sequelize[_0x083c('0x8')]},'calleridname':{'type':Sequelize[_0x083c('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x083c('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xb768=['endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue','starttime'];(function(_0x28c7a7,_0x55a356){var _0x50610f=function(_0x3a4038){while(--_0x3a4038){_0x28c7a7['push'](_0x28c7a7['shift']());}};_0x50610f(++_0x55a356);}(_0xb768,0x130));var _0x8b76=function(_0x33186c,_0x156f90){_0x33186c=_0x33186c-0x0;var _0x325e19=_0xb768[_0x33186c];return _0x325e19;};'use strict';var moment=require(_0x8b76('0x0'));var Sequelize=require(_0x8b76('0x1'));module[_0x8b76('0x2')]={'starttime':{'type':Sequelize[_0x8b76('0x3')],'set':function(_0x58760f){this[_0x8b76('0x4')](_0x8b76('0x5'),_0x58760f);this['setDataValue'](_0x8b76('0x6'),moment()['format'](_0x8b76('0x7')));}},'endtime':{'type':Sequelize[_0x8b76('0x3')]},'membername':{'type':Sequelize[_0x8b76('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8b76('0x8')]},'calleridname':{'type':Sequelize[_0x8b76('0x8')]},'calleridnum':{'type':Sequelize[_0x8b76('0x8')]},'completed':{'type':Sequelize[_0x8b76('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 4efb8d8..a5e78bd 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 _0x7fb7=['findAll','rows','catch','params','rawAttributes','find','create','body','destroy','describe','getQuestions','JscriptyQuestionReport','nolimit','order','sort','SessionId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','sendStatus','status','end','count','offset','Content-Range','json','apply','save','update','then','error','stack','name','send','map','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','limit','where','filters','pick','filter','merge','options','JscriptySessionReport','includeAll','include'];(function(_0x4f4477,_0x53bcdd){var _0x816997=function(_0x4e94f4){while(--_0x4e94f4){_0x4f4477['push'](_0x4f4477['shift']());}};_0x816997(++_0x53bcdd);}(_0x7fb7,0x187));var _0x77fb=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x7fb7[_0x39096d];return _0x13da4f;};'use strict';var pdf=require(_0x77fb('0x0'));var emlformat=require(_0x77fb('0x1'));var rimraf=require(_0x77fb('0x2'));var zipdir=require(_0x77fb('0x3'));var jsonpatch=require(_0x77fb('0x4'));var rp=require('request-promise');var moment=require(_0x77fb('0x5'));var BPromise=require(_0x77fb('0x6'));var Mustache=require(_0x77fb('0x7'));var util=require('util');var path=require(_0x77fb('0x8'));var sox=require(_0x77fb('0x9'));var csv=require(_0x77fb('0xa'));var ejs=require(_0x77fb('0xb'));var fs=require('fs');var _=require(_0x77fb('0xc'));var squel=require(_0x77fb('0xd'));var crypto=require(_0x77fb('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x77fb('0xf'));var toCsv=require(_0x77fb('0xa'));var querystring=require(_0x77fb('0x10'));var Papa=require(_0x77fb('0x11'));var Redis=require(_0x77fb('0x12'));var authService=require(_0x77fb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x77fb('0x14'));var hardwareService=require(_0x77fb('0x15'));var logger=require(_0x77fb('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2846ef,_0x362048){_0x362048=_0x362048||0xcc;return function(_0x37b96a){if(_0x37b96a){return _0x2846ef[_0x77fb('0x17')](_0x362048);}return _0x2846ef[_0x77fb('0x18')](_0x362048)[_0x77fb('0x19')]();};}function respondWithResult(_0x218644,_0x51fff9){_0x51fff9=_0x51fff9||0xc8;return function(_0x50b89e){if(_0x50b89e){return _0x218644['status'](_0x51fff9)['json'](_0x50b89e);}};}function respondWithFilteredResult(_0x352e1a,_0x1a9a3f){return function(_0x4d2947){if(_0x4d2947){var _0x1eb172=_0x4d2947[_0x77fb('0x1a')],_0x49c85a=_0x1a9a3f[_0x77fb('0x1b')],_0x387b42=_0x1a9a3f['offset']+_0x1a9a3f['limit'],_0x3accc7;if(_0x387b42>=_0x1eb172){_0x387b42=_0x1eb172;_0x3accc7=0xc8;}else{_0x3accc7=0xce;}_0x352e1a[_0x77fb('0x18')](_0x3accc7);return _0x352e1a['set'](_0x77fb('0x1c'),_0x49c85a+'-'+_0x387b42+'/'+_0x1eb172)[_0x77fb('0x1d')](_0x4d2947);}return null;};}function patchUpdates(_0x3d64bd){return function(_0x5263e0){try{jsonpatch[_0x77fb('0x1e')](_0x5263e0,_0x3d64bd,!![]);}catch(_0x2e1965){return BPromise['reject'](_0x2e1965);}return _0x5263e0[_0x77fb('0x1f')]();};}function saveUpdates(_0xdd43e0,_0x7ea790){return function(_0x17a6d9){if(_0x17a6d9){return _0x17a6d9[_0x77fb('0x20')](_0xdd43e0)[_0x77fb('0x21')](function(_0x1e68be){return _0x1e68be;});}return null;};}function removeEntity(_0x44e4d2,_0x4b04e3){return function(_0x2c4a71){if(_0x2c4a71){return _0x2c4a71['destroy']()['then'](function(){_0x44e4d2[_0x77fb('0x18')](0xcc)[_0x77fb('0x19')]();});}};}function handleEntityNotFound(_0x3d387a,_0x3f9174){return function(_0x43cbaf){if(!_0x43cbaf){_0x3d387a[_0x77fb('0x17')](0x194);}return _0x43cbaf;};}function handleError(_0x32505d,_0xff30ed){_0xff30ed=_0xff30ed||0x1f4;return function(_0x47a1be){logger[_0x77fb('0x22')](_0x47a1be[_0x77fb('0x23')]);if(_0x47a1be[_0x77fb('0x24')]){delete _0x47a1be[_0x77fb('0x24')];}_0x32505d[_0x77fb('0x18')](_0xff30ed)[_0x77fb('0x25')](_0x47a1be);};}exports['index']=function(_0x21c6b4,_0x19e32b){var _0x2e4e6b={},_0x43e878={},_0x3faa47={'count':0x0,'rows':[]};var _0xe9d2f0=_[_0x77fb('0x26')](db['JscriptySessionReport']['rawAttributes'],function(_0x2e9c39){return{'name':_0x2e9c39['fieldName'],'type':_0x2e9c39[_0x77fb('0x27')][_0x77fb('0x28')]};});_0x43e878[_0x77fb('0x29')]=_['map'](_0xe9d2f0,_0x77fb('0x24'));_0x43e878['query']=_[_0x77fb('0x2a')](_0x21c6b4[_0x77fb('0x2b')]);_0x43e878['filters']=_[_0x77fb('0x2c')](_0x43e878[_0x77fb('0x29')],_0x43e878['query']);_0x2e4e6b['attributes']=_[_0x77fb('0x2c')](_0x43e878[_0x77fb('0x29')],qs[_0x77fb('0x2d')](_0x21c6b4[_0x77fb('0x2b')][_0x77fb('0x2d')]));_0x2e4e6b[_0x77fb('0x2e')]=_0x2e4e6b[_0x77fb('0x2e')][_0x77fb('0x2f')]?_0x2e4e6b[_0x77fb('0x2e')]:_0x43e878['model'];if(!_0x21c6b4[_0x77fb('0x2b')][_0x77fb('0x30')]('nolimit')){_0x2e4e6b[_0x77fb('0x31')]=qs[_0x77fb('0x31')](_0x21c6b4[_0x77fb('0x2b')][_0x77fb('0x31')]);_0x2e4e6b[_0x77fb('0x1b')]=qs[_0x77fb('0x1b')](_0x21c6b4[_0x77fb('0x2b')]['offset']);}_0x2e4e6b['order']=qs['sort'](_0x21c6b4[_0x77fb('0x2b')]['sort']);_0x2e4e6b[_0x77fb('0x32')]=qs[_0x77fb('0x33')](_[_0x77fb('0x34')](_0x21c6b4[_0x77fb('0x2b')],_0x43e878[_0x77fb('0x33')]));if(_0x21c6b4[_0x77fb('0x2b')][_0x77fb('0x35')]){_0x2e4e6b['where']=_[_0x77fb('0x36')](_0x2e4e6b[_0x77fb('0x32')],{'$or':_['map'](_0xe9d2f0,function(_0x1123d3){if(_0x1123d3[_0x77fb('0x27')]!=='VIRTUAL'){var _0x1f41fd={};_0x1f41fd[_0x1123d3['name']]={'$like':'%'+_0x21c6b4[_0x77fb('0x2b')][_0x77fb('0x35')]+'%'};return _0x1f41fd;}})});}_0x2e4e6b=_[_0x77fb('0x36')]({},_0x2e4e6b,_0x21c6b4[_0x77fb('0x37')]);var _0x4233f1={'where':_0x2e4e6b[_0x77fb('0x32')]};return db[_0x77fb('0x38')][_0x77fb('0x1a')](_0x4233f1)[_0x77fb('0x21')](function(_0x1a3901){_0x3faa47[_0x77fb('0x1a')]=_0x1a3901;if(_0x21c6b4[_0x77fb('0x2b')][_0x77fb('0x39')]){_0x2e4e6b[_0x77fb('0x3a')]=[{'all':!![]}];}return db[_0x77fb('0x38')][_0x77fb('0x3b')](_0x2e4e6b);})['then'](function(_0x275a6a){_0x3faa47[_0x77fb('0x3c')]=_0x275a6a;return _0x3faa47;})[_0x77fb('0x21')](respondWithFilteredResult(_0x19e32b,_0x2e4e6b))[_0x77fb('0x3d')](handleError(_0x19e32b,null));};exports['show']=function(_0x3fbb4c,_0x3688a3){var _0x56f341={'raw':!![],'where':{'id':_0x3fbb4c[_0x77fb('0x3e')]['id']}},_0x22fa73={};_0x22fa73[_0x77fb('0x29')]=_[_0x77fb('0x2a')](db[_0x77fb('0x38')][_0x77fb('0x3f')]);_0x22fa73[_0x77fb('0x2b')]=_[_0x77fb('0x2a')](_0x3fbb4c[_0x77fb('0x2b')]);_0x22fa73[_0x77fb('0x33')]=_['intersection'](_0x22fa73[_0x77fb('0x29')],_0x22fa73['query']);_0x56f341['attributes']=_[_0x77fb('0x2c')](_0x22fa73[_0x77fb('0x29')],qs['fields'](_0x3fbb4c['query'][_0x77fb('0x2d')]));_0x56f341['attributes']=_0x56f341[_0x77fb('0x2e')][_0x77fb('0x2f')]?_0x56f341['attributes']:_0x22fa73[_0x77fb('0x29')];if(_0x3fbb4c['query'][_0x77fb('0x39')]){_0x56f341[_0x77fb('0x3a')]=[{'all':!![]}];}_0x56f341=_[_0x77fb('0x36')]({},_0x56f341,_0x3fbb4c['options']);return db['JscriptySessionReport'][_0x77fb('0x40')](_0x56f341)[_0x77fb('0x21')](handleEntityNotFound(_0x3688a3,null))['then'](respondWithResult(_0x3688a3,null))[_0x77fb('0x3d')](handleError(_0x3688a3,null));};exports[_0x77fb('0x41')]=function(_0x41a252,_0x1ff92f){return db[_0x77fb('0x38')][_0x77fb('0x41')](_0x41a252[_0x77fb('0x42')],{})[_0x77fb('0x21')](respondWithResult(_0x1ff92f,0xc9))[_0x77fb('0x3d')](handleError(_0x1ff92f,null));};exports[_0x77fb('0x20')]=function(_0x1ccafe,_0x2b8c15){if(_0x1ccafe[_0x77fb('0x42')]['id']){delete _0x1ccafe[_0x77fb('0x42')]['id'];}return db[_0x77fb('0x38')]['find']({'where':{'id':_0x1ccafe[_0x77fb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2b8c15,null))['then'](saveUpdates(_0x1ccafe[_0x77fb('0x42')],null))['then'](respondWithResult(_0x2b8c15,null))[_0x77fb('0x3d')](handleError(_0x2b8c15,null));};exports[_0x77fb('0x43')]=function(_0x125923,_0x191e92){return db[_0x77fb('0x38')][_0x77fb('0x40')]({'where':{'id':_0x125923[_0x77fb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x191e92,null))[_0x77fb('0x21')](removeEntity(_0x191e92,null))['catch'](handleError(_0x191e92,null));};exports[_0x77fb('0x44')]=function(_0x569941,_0x4ad6a5){return db['JscriptySessionReport'][_0x77fb('0x44')]()['then'](respondWithResult(_0x4ad6a5,null))[_0x77fb('0x3d')](handleError(_0x4ad6a5,null));};exports[_0x77fb('0x45')]=function(_0x81111f,_0x4cb5b7,_0x403163){var _0x92d7d0={'raw':!![],'where':{}};var _0x179b40={};var _0x209cfb={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x81111f[_0x77fb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4cb5b7,null))['then'](function(_0x27d5ae){if(_0x27d5ae){_0x179b40[_0x77fb('0x29')]=_[_0x77fb('0x2a')](db[_0x77fb('0x46')][_0x77fb('0x3f')]);_0x179b40[_0x77fb('0x2b')]=_[_0x77fb('0x2a')](_0x81111f[_0x77fb('0x2b')]);_0x179b40[_0x77fb('0x33')]=_[_0x77fb('0x2c')](_0x179b40[_0x77fb('0x29')],_0x179b40[_0x77fb('0x2b')]);_0x92d7d0['attributes']=_['intersection'](_0x179b40[_0x77fb('0x29')],qs[_0x77fb('0x2d')](_0x81111f['query']['fields']));_0x92d7d0['attributes']=_0x92d7d0['attributes'][_0x77fb('0x2f')]?_0x92d7d0[_0x77fb('0x2e')]:_0x179b40['model'];if(!_0x81111f['query'][_0x77fb('0x30')](_0x77fb('0x47'))){_0x92d7d0[_0x77fb('0x31')]=qs[_0x77fb('0x31')](_0x81111f['query'][_0x77fb('0x31')]);_0x92d7d0['offset']=qs[_0x77fb('0x1b')](_0x81111f[_0x77fb('0x2b')][_0x77fb('0x1b')]);}_0x92d7d0[_0x77fb('0x48')]=qs[_0x77fb('0x49')](_0x81111f['query'][_0x77fb('0x49')]);_0x92d7d0[_0x77fb('0x32')]=qs[_0x77fb('0x33')](_[_0x77fb('0x34')](_0x81111f[_0x77fb('0x2b')],_0x179b40['filters']));_0x92d7d0[_0x77fb('0x32')][_0x77fb('0x4a')]=_0x27d5ae['id'];if(_0x81111f[_0x77fb('0x2b')][_0x77fb('0x35')]){_0x92d7d0['where']=_['merge'](_0x92d7d0[_0x77fb('0x32')],{'$or':_[_0x77fb('0x26')](_0x92d7d0[_0x77fb('0x2e')],function(_0x56c05b){var _0x2090ee={};_0x2090ee[_0x56c05b]={'$like':'%'+_0x81111f[_0x77fb('0x2b')][_0x77fb('0x35')]+'%'};return _0x2090ee;})});}_0x92d7d0=_[_0x77fb('0x36')]({},_0x92d7d0,_0x81111f[_0x77fb('0x37')]);return db[_0x77fb('0x46')][_0x77fb('0x1a')]({'where':_0x92d7d0['where']})['then'](function(_0x258417){_0x209cfb[_0x77fb('0x1a')]=_0x258417;if(_0x81111f[_0x77fb('0x2b')]['includeAll']){_0x92d7d0[_0x77fb('0x3a')]=[{'all':!![]}];}return db[_0x77fb('0x46')][_0x77fb('0x3b')](_0x92d7d0);})['then'](function(_0x3273df){_0x209cfb[_0x77fb('0x3c')]=_0x3273df;return _0x209cfb;});}})[_0x77fb('0x21')](respondWithFilteredResult(_0x4cb5b7,_0x92d7d0))[_0x77fb('0x3d')](handleError(_0x4cb5b7,null));}; \ No newline at end of file +var _0xe918=['json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','intersection','create','body','find','describe','JscriptyQuestionReport','nolimit','options','findAll','html-pdf','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status'];(function(_0x300899,_0x9ad5b1){var _0x262dd0=function(_0x2597c5){while(--_0x2597c5){_0x300899['push'](_0x300899['shift']());}};_0x262dd0(++_0x9ad5b1);}(_0xe918,0x162));var _0x8e91=function(_0xfab439,_0x2a4f87){_0xfab439=_0xfab439-0x0;var _0x4dc112=_0xe918[_0xfab439];return _0x4dc112;};'use strict';var pdf=require(_0x8e91('0x0'));var emlformat=require(_0x8e91('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8e91('0x2'));var rp=require(_0x8e91('0x3'));var moment=require(_0x8e91('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8e91('0x5'));var path=require(_0x8e91('0x6'));var sox=require(_0x8e91('0x7'));var csv=require(_0x8e91('0x8'));var ejs=require(_0x8e91('0x9'));var fs=require('fs');var _=require(_0x8e91('0xa'));var squel=require(_0x8e91('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8e91('0xc'));var toCsv=require(_0x8e91('0x8'));var querystring=require(_0x8e91('0xd'));var Papa=require(_0x8e91('0xe'));var Redis=require(_0x8e91('0xf'));var authService=require(_0x8e91('0x10'));var qs=require(_0x8e91('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8e91('0x12'))(_0x8e91('0x13'));var utils=require(_0x8e91('0x14'));var config=require(_0x8e91('0x15'));var db=require(_0x8e91('0x16'))['db'];function respondWithStatusCode(_0x10690c,_0x54ff7f){_0x54ff7f=_0x54ff7f||0xcc;return function(_0x232a3c){if(_0x232a3c){return _0x10690c[_0x8e91('0x17')](_0x54ff7f);}return _0x10690c['status'](_0x54ff7f)[_0x8e91('0x18')]();};}function respondWithResult(_0xfdf99c,_0x5a15ce){_0x5a15ce=_0x5a15ce||0xc8;return function(_0x49c253){if(_0x49c253){return _0xfdf99c[_0x8e91('0x19')](_0x5a15ce)[_0x8e91('0x1a')](_0x49c253);}};}function respondWithFilteredResult(_0xa58188,_0x585074){return function(_0x4a1f80){if(_0x4a1f80){var _0x517960=_0x4a1f80[_0x8e91('0x1b')],_0x5b0bd7=_0x585074[_0x8e91('0x1c')],_0x3e26f1=_0x585074['offset']+_0x585074[_0x8e91('0x1d')],_0xc05237;if(_0x3e26f1>=_0x517960){_0x3e26f1=_0x517960;_0xc05237=0xc8;}else{_0xc05237=0xce;}_0xa58188[_0x8e91('0x19')](_0xc05237);return _0xa58188['set'](_0x8e91('0x1e'),_0x5b0bd7+'-'+_0x3e26f1+'/'+_0x517960)['json'](_0x4a1f80);}return null;};}function patchUpdates(_0x4c3caa){return function(_0x321b12){try{jsonpatch[_0x8e91('0x1f')](_0x321b12,_0x4c3caa,!![]);}catch(_0x36854a){return BPromise[_0x8e91('0x20')](_0x36854a);}return _0x321b12[_0x8e91('0x21')]();};}function saveUpdates(_0x242f75,_0x372cc1){return function(_0x2c105a){if(_0x2c105a){return _0x2c105a[_0x8e91('0x22')](_0x242f75)[_0x8e91('0x23')](function(_0x544889){return _0x544889;});}return null;};}function removeEntity(_0x16a9e8,_0x875441){return function(_0x5e5253){if(_0x5e5253){return _0x5e5253[_0x8e91('0x24')]()[_0x8e91('0x23')](function(){_0x16a9e8['status'](0xcc)[_0x8e91('0x18')]();});}};}function handleEntityNotFound(_0x304f7c,_0x2d1e8c){return function(_0x3a9f99){if(!_0x3a9f99){_0x304f7c[_0x8e91('0x17')](0x194);}return _0x3a9f99;};}function handleError(_0x5a7c0d,_0x438e57){_0x438e57=_0x438e57||0x1f4;return function(_0x5a064e){logger[_0x8e91('0x25')](_0x5a064e['stack']);if(_0x5a064e[_0x8e91('0x26')]){delete _0x5a064e[_0x8e91('0x26')];}_0x5a7c0d[_0x8e91('0x19')](_0x438e57)['send'](_0x5a064e);};}exports[_0x8e91('0x27')]=function(_0x4175a0,_0x58a814){var _0x338fbb={},_0x31f5ab={},_0x24fc3a={'count':0x0,'rows':[]};var _0x1fb669=_[_0x8e91('0x28')](db[_0x8e91('0x29')][_0x8e91('0x2a')],function(_0x955854){return{'name':_0x955854[_0x8e91('0x2b')],'type':_0x955854[_0x8e91('0x2c')][_0x8e91('0x2d')]};});_0x31f5ab['model']=_[_0x8e91('0x28')](_0x1fb669,'name');_0x31f5ab[_0x8e91('0x2e')]=_[_0x8e91('0x2f')](_0x4175a0[_0x8e91('0x2e')]);_0x31f5ab[_0x8e91('0x30')]=_['intersection'](_0x31f5ab[_0x8e91('0x31')],_0x31f5ab[_0x8e91('0x2e')]);_0x338fbb[_0x8e91('0x32')]=_['intersection'](_0x31f5ab[_0x8e91('0x31')],qs[_0x8e91('0x33')](_0x4175a0[_0x8e91('0x2e')][_0x8e91('0x33')]));_0x338fbb[_0x8e91('0x32')]=_0x338fbb[_0x8e91('0x32')][_0x8e91('0x34')]?_0x338fbb[_0x8e91('0x32')]:_0x31f5ab[_0x8e91('0x31')];if(!_0x4175a0['query'][_0x8e91('0x35')]('nolimit')){_0x338fbb[_0x8e91('0x1d')]=qs['limit'](_0x4175a0[_0x8e91('0x2e')]['limit']);_0x338fbb['offset']=qs[_0x8e91('0x1c')](_0x4175a0[_0x8e91('0x2e')][_0x8e91('0x1c')]);}_0x338fbb[_0x8e91('0x36')]=qs[_0x8e91('0x37')](_0x4175a0['query'][_0x8e91('0x37')]);_0x338fbb[_0x8e91('0x38')]=qs[_0x8e91('0x30')](_[_0x8e91('0x39')](_0x4175a0[_0x8e91('0x2e')],_0x31f5ab[_0x8e91('0x30')]));if(_0x4175a0[_0x8e91('0x2e')][_0x8e91('0x3a')]){_0x338fbb[_0x8e91('0x38')]=_[_0x8e91('0x3b')](_0x338fbb[_0x8e91('0x38')],{'$or':_[_0x8e91('0x28')](_0x1fb669,function(_0x1cf4e9){if(_0x1cf4e9[_0x8e91('0x2c')]!==_0x8e91('0x3c')){var _0x400d4b={};_0x400d4b[_0x1cf4e9[_0x8e91('0x26')]]={'$like':'%'+_0x4175a0['query'][_0x8e91('0x3a')]+'%'};return _0x400d4b;}})});}_0x338fbb=_[_0x8e91('0x3b')]({},_0x338fbb,_0x4175a0['options']);var _0x4a1771={'where':_0x338fbb[_0x8e91('0x38')]};return db['JscriptySessionReport']['count'](_0x4a1771)[_0x8e91('0x23')](function(_0x4ae6c1){_0x24fc3a[_0x8e91('0x1b')]=_0x4ae6c1;if(_0x4175a0[_0x8e91('0x2e')][_0x8e91('0x3d')]){_0x338fbb[_0x8e91('0x3e')]=[{'all':!![]}];}return db[_0x8e91('0x29')]['findAll'](_0x338fbb);})[_0x8e91('0x23')](function(_0x3278a){_0x24fc3a[_0x8e91('0x3f')]=_0x3278a;return _0x24fc3a;})[_0x8e91('0x23')](respondWithFilteredResult(_0x58a814,_0x338fbb))[_0x8e91('0x40')](handleError(_0x58a814,null));};exports[_0x8e91('0x41')]=function(_0x13f41d,_0xb43ffe){var _0x4ed135={'raw':!![],'where':{'id':_0x13f41d[_0x8e91('0x42')]['id']}},_0x328bbe={};_0x328bbe[_0x8e91('0x31')]=_[_0x8e91('0x2f')](db['JscriptySessionReport']['rawAttributes']);_0x328bbe[_0x8e91('0x2e')]=_[_0x8e91('0x2f')](_0x13f41d[_0x8e91('0x2e')]);_0x328bbe['filters']=_['intersection'](_0x328bbe[_0x8e91('0x31')],_0x328bbe['query']);_0x4ed135[_0x8e91('0x32')]=_[_0x8e91('0x43')](_0x328bbe[_0x8e91('0x31')],qs['fields'](_0x13f41d[_0x8e91('0x2e')][_0x8e91('0x33')]));_0x4ed135[_0x8e91('0x32')]=_0x4ed135[_0x8e91('0x32')]['length']?_0x4ed135[_0x8e91('0x32')]:_0x328bbe[_0x8e91('0x31')];if(_0x13f41d[_0x8e91('0x2e')][_0x8e91('0x3d')]){_0x4ed135[_0x8e91('0x3e')]=[{'all':!![]}];}_0x4ed135=_[_0x8e91('0x3b')]({},_0x4ed135,_0x13f41d['options']);return db[_0x8e91('0x29')]['find'](_0x4ed135)[_0x8e91('0x23')](handleEntityNotFound(_0xb43ffe,null))[_0x8e91('0x23')](respondWithResult(_0xb43ffe,null))['catch'](handleError(_0xb43ffe,null));};exports[_0x8e91('0x44')]=function(_0x2b0da9,_0x187c7a){return db[_0x8e91('0x29')][_0x8e91('0x44')](_0x2b0da9[_0x8e91('0x45')],{})['then'](respondWithResult(_0x187c7a,0xc9))[_0x8e91('0x40')](handleError(_0x187c7a,null));};exports['update']=function(_0x375d11,_0x4f7937){if(_0x375d11[_0x8e91('0x45')]['id']){delete _0x375d11[_0x8e91('0x45')]['id'];}return db[_0x8e91('0x29')][_0x8e91('0x46')]({'where':{'id':_0x375d11[_0x8e91('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f7937,null))[_0x8e91('0x23')](saveUpdates(_0x375d11['body'],null))[_0x8e91('0x23')](respondWithResult(_0x4f7937,null))[_0x8e91('0x40')](handleError(_0x4f7937,null));};exports[_0x8e91('0x24')]=function(_0x6da270,_0x575a43){return db['JscriptySessionReport'][_0x8e91('0x46')]({'where':{'id':_0x6da270[_0x8e91('0x42')]['id']}})[_0x8e91('0x23')](handleEntityNotFound(_0x575a43,null))[_0x8e91('0x23')](removeEntity(_0x575a43,null))[_0x8e91('0x40')](handleError(_0x575a43,null));};exports[_0x8e91('0x47')]=function(_0x2b4fa3,_0xb11f77){return db[_0x8e91('0x29')]['describe']()[_0x8e91('0x23')](respondWithResult(_0xb11f77,null))[_0x8e91('0x40')](handleError(_0xb11f77,null));};exports['getQuestions']=function(_0x5c87a7,_0x27889f,_0x2b1b65){var _0x10a152={'raw':!![],'where':{}};var _0x34a937={};var _0x565ee4={'count':0x0,'rows':[]};return db[_0x8e91('0x29')]['findOne']({'where':{'id':_0x5c87a7[_0x8e91('0x42')]['id']}})[_0x8e91('0x23')](handleEntityNotFound(_0x27889f,null))[_0x8e91('0x23')](function(_0x4f9adf){if(_0x4f9adf){_0x34a937[_0x8e91('0x31')]=_[_0x8e91('0x2f')](db[_0x8e91('0x48')][_0x8e91('0x2a')]);_0x34a937['query']=_[_0x8e91('0x2f')](_0x5c87a7[_0x8e91('0x2e')]);_0x34a937['filters']=_[_0x8e91('0x43')](_0x34a937[_0x8e91('0x31')],_0x34a937[_0x8e91('0x2e')]);_0x10a152['attributes']=_[_0x8e91('0x43')](_0x34a937[_0x8e91('0x31')],qs[_0x8e91('0x33')](_0x5c87a7['query'][_0x8e91('0x33')]));_0x10a152['attributes']=_0x10a152['attributes'][_0x8e91('0x34')]?_0x10a152[_0x8e91('0x32')]:_0x34a937[_0x8e91('0x31')];if(!_0x5c87a7[_0x8e91('0x2e')][_0x8e91('0x35')](_0x8e91('0x49'))){_0x10a152[_0x8e91('0x1d')]=qs['limit'](_0x5c87a7[_0x8e91('0x2e')][_0x8e91('0x1d')]);_0x10a152[_0x8e91('0x1c')]=qs[_0x8e91('0x1c')](_0x5c87a7['query'][_0x8e91('0x1c')]);}_0x10a152['order']=qs[_0x8e91('0x37')](_0x5c87a7[_0x8e91('0x2e')][_0x8e91('0x37')]);_0x10a152[_0x8e91('0x38')]=qs[_0x8e91('0x30')](_[_0x8e91('0x39')](_0x5c87a7[_0x8e91('0x2e')],_0x34a937[_0x8e91('0x30')]));_0x10a152[_0x8e91('0x38')]['SessionId']=_0x4f9adf['id'];if(_0x5c87a7[_0x8e91('0x2e')][_0x8e91('0x3a')]){_0x10a152['where']=_[_0x8e91('0x3b')](_0x10a152[_0x8e91('0x38')],{'$or':_[_0x8e91('0x28')](_0x10a152[_0x8e91('0x32')],function(_0x26a06){var _0x8f84c={};_0x8f84c[_0x26a06]={'$like':'%'+_0x5c87a7[_0x8e91('0x2e')][_0x8e91('0x3a')]+'%'};return _0x8f84c;})});}_0x10a152=_[_0x8e91('0x3b')]({},_0x10a152,_0x5c87a7[_0x8e91('0x4a')]);return db[_0x8e91('0x48')][_0x8e91('0x1b')]({'where':_0x10a152[_0x8e91('0x38')]})['then'](function(_0x1fb64d){_0x565ee4[_0x8e91('0x1b')]=_0x1fb64d;if(_0x5c87a7[_0x8e91('0x2e')][_0x8e91('0x3d')]){_0x10a152[_0x8e91('0x3e')]=[{'all':!![]}];}return db[_0x8e91('0x48')][_0x8e91('0x4b')](_0x10a152);})[_0x8e91('0x23')](function(_0x570af8){_0x565ee4[_0x8e91('0x3f')]=_0x570af8;return _0x565ee4;});}})[_0x8e91('0x23')](respondWithFilteredResult(_0x27889f,_0x10a152))['catch'](handleError(_0x27889f,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index a960934..e1314e4 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 _0xcaad=['moment','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','api'];(function(_0x5bda8f,_0x375070){var _0xb1474d=function(_0x58acaf){while(--_0x58acaf){_0x5bda8f['push'](_0x5bda8f['shift']());}};_0xb1474d(++_0x375070);}(_0xcaad,0x15e));var _0xdcaa=function(_0x8ad610,_0x18a204){_0x8ad610=_0x8ad610-0x0;var _0x1fc342=_0xcaad[_0x8ad610];return _0x1fc342;};'use strict';var _=require(_0xdcaa('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdcaa('0x1'));var moment=require(_0xdcaa('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdcaa('0x3'));var rimraf=require(_0xdcaa('0x4'));var config=require(_0xdcaa('0x5'));var attributes=require(_0xdcaa('0x6'));module[_0xdcaa('0x7')]=function(_0x214d14,_0x490a6a){return _0x214d14[_0xdcaa('0x8')](_0xdcaa('0x9'),attributes,{'tableName':_0xdcaa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab24=['rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','api','moment','path'];(function(_0x395341,_0x479285){var _0x163cc0=function(_0xb5e539){while(--_0xb5e539){_0x395341['push'](_0x395341['shift']());}};_0x163cc0(++_0x479285);}(_0xab24,0x18c));var _0x4ab2=function(_0x1ada06,_0x3f4beb){_0x1ada06=_0x1ada06-0x0;var _0xcc9b24=_0xab24[_0x1ada06];return _0xcc9b24;};'use strict';var _=require(_0x4ab2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4ab2('0x1'));var moment=require(_0x4ab2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ab2('0x3'));var rimraf=require(_0x4ab2('0x4'));var config=require(_0x4ab2('0x5'));var attributes=require(_0x4ab2('0x6'));module[_0x4ab2('0x7')]=function(_0x38a2e3,_0x47221d){return _0x38a2e3['define'](_0x4ab2('0x8'),attributes,{'tableName':_0x4ab2('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 1e80e8a..3565aff 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 _0x4f9d=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptySessionReport,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x5d5979,_0x3b4921){var _0x237182=function(_0xbd4df7){while(--_0xbd4df7){_0x5d5979['push'](_0x5d5979['shift']());}};_0x237182(++_0x3b4921);}(_0x4f9d,0x1b3));var _0xd4f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4f9d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd4f9('0x0'));var util=require(_0xd4f9('0x1'));var moment=require(_0xd4f9('0x2'));var BPromise=require('bluebird');var rs=require(_0xd4f9('0x3'));var fs=require('fs');var Redis=require(_0xd4f9('0x4'));var db=require(_0xd4f9('0x5'))['db'];var utils=require(_0xd4f9('0x6'));var logger=require(_0xd4f9('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd4f9('0x8'));var client=jayson[_0xd4f9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33a055,_0x333748,_0x1bada0){return new BPromise(function(_0x151221,_0x50beca){return client[_0xd4f9('0xa')](_0x33a055,_0x1bada0)[_0xd4f9('0xb')](function(_0x419183){logger[_0xd4f9('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x333748,_0xd4f9('0xd'));logger[_0xd4f9('0xe')](_0xd4f9('0xf'),_0x333748,_0xd4f9('0xd'),JSON[_0xd4f9('0x10')](_0x419183));if(_0x419183[_0xd4f9('0x11')]){if(_0x419183['error'][_0xd4f9('0x12')]===0x1f4){logger[_0xd4f9('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x333748,_0x419183[_0xd4f9('0x11')][_0xd4f9('0x13')]);return _0x50beca(_0x419183[_0xd4f9('0x11')][_0xd4f9('0x13')]);}logger['error'](_0xd4f9('0x14'),_0x333748,_0x419183[_0xd4f9('0x11')]['message']);return _0x151221(_0x419183['error'][_0xd4f9('0x13')]);}else{logger[_0xd4f9('0xc')](_0xd4f9('0x14'),_0x333748,'request\x20sent');_0x151221(_0x419183[_0xd4f9('0x15')][_0xd4f9('0x13')]);}})[_0xd4f9('0x16')](function(_0xc72e3c){logger[_0xd4f9('0x11')](_0xd4f9('0x14'),_0x333748,_0xc72e3c);_0x50beca(_0xc72e3c);});});} \ No newline at end of file +var _0x01d2=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x01d2,0x105));var _0x201d=function(_0xf2d73c,_0x2a31c1){_0xf2d73c=_0xf2d73c-0x0;var _0x3660ce=_0x01d2[_0xf2d73c];return _0x3660ce;};'use strict';var _=require(_0x201d('0x0'));var util=require(_0x201d('0x1'));var moment=require(_0x201d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x201d('0x3'));var db=require(_0x201d('0x4'))['db'];var utils=require(_0x201d('0x5'));var logger=require('../../config/logger')(_0x201d('0x6'));var config=require(_0x201d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x201d('0x8')][_0x201d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36e77e,_0x4839ba,_0x95a2e6){return new BPromise(function(_0x598350,_0x3fabe4){return client[_0x201d('0xa')](_0x36e77e,_0x95a2e6)[_0x201d('0xb')](function(_0x2e46ee){logger[_0x201d('0xc')](_0x201d('0xd'),_0x4839ba,_0x201d('0xe'));logger[_0x201d('0xf')](_0x201d('0x10'),_0x4839ba,_0x201d('0xe'),JSON['stringify'](_0x2e46ee));if(_0x2e46ee[_0x201d('0x11')]){if(_0x2e46ee[_0x201d('0x11')][_0x201d('0x12')]===0x1f4){logger[_0x201d('0x11')](_0x201d('0xd'),_0x4839ba,_0x2e46ee['error']['message']);return _0x3fabe4(_0x2e46ee[_0x201d('0x11')][_0x201d('0x13')]);}logger[_0x201d('0x11')](_0x201d('0xd'),_0x4839ba,_0x2e46ee[_0x201d('0x11')][_0x201d('0x13')]);return _0x598350(_0x2e46ee[_0x201d('0x11')][_0x201d('0x13')]);}else{logger['info'](_0x201d('0xd'),_0x4839ba,_0x201d('0xe'));_0x598350(_0x2e46ee[_0x201d('0x14')][_0x201d('0x13')]);}})[_0x201d('0x15')](function(_0x249d05){logger[_0x201d('0x11')](_0x201d('0xd'),_0x4839ba,_0x249d05);_0x3fabe4(_0x249d05);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 0a89285..c5dcd1f 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 _0x00a5=['get','index','/:id','isAuthenticated','update','exports','multer','util','path','Router','../../components/auth/service','./license.controller'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x00a5,0x156));var _0x500a=function(_0x33a998,_0x585a7e){_0x33a998=_0x33a998-0x0;var _0x3c6c4f=_0x00a5[_0x33a998];return _0x3c6c4f;};'use strict';var multer=require(_0x500a('0x0'));var util=require(_0x500a('0x1'));var path=require(_0x500a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x500a('0x3')]();var auth=require(_0x500a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x500a('0x5'));router[_0x500a('0x6')]('/',controller[_0x500a('0x7')]);router['put'](_0x500a('0x8'),auth[_0x500a('0x9')](),controller[_0x500a('0xa')]);module[_0x500a('0xb')]=router; \ No newline at end of file +var _0x1207=['exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated','update'];(function(_0x5eefd5,_0x465945){var _0x5cc116=function(_0x2a490a){while(--_0x2a490a){_0x5eefd5['push'](_0x5eefd5['shift']());}};_0x5cc116(++_0x465945);}(_0x1207,0x7f));var _0x7120=function(_0x1190a3,_0x357290){_0x1190a3=_0x1190a3-0x0;var _0x4b750b=_0x1207[_0x1190a3];return _0x4b750b;};'use strict';var multer=require(_0x7120('0x0'));var util=require(_0x7120('0x1'));var path=require(_0x7120('0x2'));var timeout=require('connect-timeout');var express=require(_0x7120('0x3'));var router=express[_0x7120('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7120('0x5'));var config=require(_0x7120('0x6'));var controller=require(_0x7120('0x7'));router[_0x7120('0x8')]('/',controller[_0x7120('0x9')]);router['put'](_0x7120('0xa'),auth[_0x7120('0xb')](),controller[_0x7120('0xc')]);module[_0x7120('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 211905c..474b227 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 _0x687b=['TEXT','STRING','sequelize','exports'];(function(_0x5e0e1e,_0x1b67fc){var _0x599059=function(_0x17123f){while(--_0x17123f){_0x5e0e1e['push'](_0x5e0e1e['shift']());}};_0x599059(++_0x1b67fc);}(_0x687b,0x14a));var _0xb687=function(_0x4d8764,_0xd13d7b){_0x4d8764=_0x4d8764-0x0;var _0x4e0b49=_0x687b[_0x4d8764];return _0x4e0b49;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'license':{'type':Sequelize[_0xb687('0x2')]},'data1':{'type':Sequelize[_0xb687('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3f8a=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x34ca41,_0x366437){var _0x639345=function(_0x4aea54){while(--_0x4aea54){_0x34ca41['push'](_0x34ca41['shift']());}};_0x639345(++_0x366437);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x4005df,_0x948f88){_0x4005df=_0x4005df-0x0;var _0x239d35=_0x3f8a[_0x4005df];return _0x239d35;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'license':{'type':Sequelize[_0xa3f8('0x2')]},'data1':{'type':Sequelize[_0xa3f8('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xa3f8('0x4')],'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 1c62900..011ec87 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 _0x5e96=['status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','../../config/license/util','index','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','key','demo','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x52a3aa,_0x1bfd3d){var _0x588bf7=function(_0x18a5b5){while(--_0x18a5b5){_0x52a3aa['push'](_0x52a3aa['shift']());}};_0x588bf7(++_0x1bfd3d);}(_0x5e96,0xe7));var _0x65e9=function(_0x33e6e9,_0x57cea5){_0x33e6e9=_0x33e6e9-0x0;var _0x3fabe0=_0x5e96[_0x33e6e9];return _0x3fabe0;};'use strict';var pdf=require(_0x65e9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x65e9('0x1'));var zipdir=require(_0x65e9('0x2'));var jsonpatch=require(_0x65e9('0x3'));var rp=require('request-promise');var moment=require(_0x65e9('0x4'));var BPromise=require(_0x65e9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x65e9('0x6'));var sox=require('sox');var csv=require(_0x65e9('0x7'));var ejs=require(_0x65e9('0x8'));var fs=require('fs');var _=require(_0x65e9('0x9'));var squel=require(_0x65e9('0xa'));var crypto=require(_0x65e9('0xb'));var jsforce=require(_0x65e9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x65e9('0x7'));var querystring=require(_0x65e9('0xd'));var Papa=require('papaparse');var Redis=require(_0x65e9('0xe'));var authService=require(_0x65e9('0xf'));var qs=require(_0x65e9('0x10'));var as=require(_0x65e9('0x11'));var hardwareService=require(_0x65e9('0x12'));var logger=require(_0x65e9('0x13'))(_0x65e9('0x14'));var utils=require(_0x65e9('0x15'));var config=require(_0x65e9('0x16'));var db=require(_0x65e9('0x17'))['db'];function respondWithStatusCode(_0x48104c,_0x44dec1){_0x44dec1=_0x44dec1||0xcc;return function(_0x5a6b64){if(_0x5a6b64){return _0x48104c[_0x65e9('0x18')](_0x44dec1);}return _0x48104c[_0x65e9('0x19')](_0x44dec1)[_0x65e9('0x1a')]();};}function respondWithResult(_0x32700e,_0x5d725f){_0x5d725f=_0x5d725f||0xc8;return function(_0x522a97){if(_0x522a97){return _0x32700e[_0x65e9('0x19')](_0x5d725f)[_0x65e9('0x1b')](_0x522a97);}};}function respondWithFilteredResult(_0x5260f7,_0x1f21d1){return function(_0x1f27f4){if(_0x1f27f4){var _0x30f510=_0x1f27f4[_0x65e9('0x1c')],_0x1fbe2b=_0x1f21d1[_0x65e9('0x1d')],_0x561df3=_0x1f21d1[_0x65e9('0x1d')]+_0x1f21d1[_0x65e9('0x1e')],_0x4f65f5;if(_0x561df3>=_0x30f510){_0x561df3=_0x30f510;_0x4f65f5=0xc8;}else{_0x4f65f5=0xce;}_0x5260f7[_0x65e9('0x19')](_0x4f65f5);return _0x5260f7[_0x65e9('0x1f')](_0x65e9('0x20'),_0x1fbe2b+'-'+_0x561df3+'/'+_0x30f510)[_0x65e9('0x1b')](_0x1f27f4);}return null;};}function patchUpdates(_0x5b1637){return function(_0x7b1857){try{jsonpatch['apply'](_0x7b1857,_0x5b1637,!![]);}catch(_0x1b4016){return BPromise[_0x65e9('0x21')](_0x1b4016);}return _0x7b1857[_0x65e9('0x22')]();};}function saveUpdates(_0x9dc136,_0x42e123){return function(_0x824da4){if(_0x824da4){return _0x824da4[_0x65e9('0x23')](_0x9dc136)[_0x65e9('0x24')](function(_0x1129ed){return _0x1129ed;});}return null;};}function removeEntity(_0x1710ae,_0x585653){return function(_0x59bf52){if(_0x59bf52){return _0x59bf52[_0x65e9('0x25')]()[_0x65e9('0x24')](function(){_0x1710ae[_0x65e9('0x19')](0xcc)[_0x65e9('0x1a')]();});}};}function handleEntityNotFound(_0x48541e,_0x112a68){return function(_0x4411ce){if(!_0x4411ce){_0x48541e[_0x65e9('0x18')](0x194);}return _0x4411ce;};}function handleError(_0x324f45,_0x49919e){_0x49919e=_0x49919e||0x1f4;return function(_0x377c40){logger[_0x65e9('0x26')](_0x377c40[_0x65e9('0x27')]);if(_0x377c40[_0x65e9('0x28')]){delete _0x377c40['name'];}_0x324f45['status'](_0x49919e)[_0x65e9('0x29')](_0x377c40);};}var utilLicense=require(_0x65e9('0x2a'));exports[_0x65e9('0x2b')]=function(_0x487258,_0x4473d){var _0x5795f9={'raw':!![],'where':{'id':0x1}},_0x1cdeb4={};_0x1cdeb4[_0x65e9('0x2c')]=_[_0x65e9('0x2d')](db['License'][_0x65e9('0x2e')]);_0x1cdeb4[_0x65e9('0x2f')]=_[_0x65e9('0x2d')](_0x487258['query']);_0x1cdeb4[_0x65e9('0x30')]=_[_0x65e9('0x31')](_0x1cdeb4[_0x65e9('0x2c')],_0x1cdeb4['query']);_0x5795f9['attributes']=_[_0x65e9('0x31')](_0x1cdeb4[_0x65e9('0x2c')],qs['fields'](_0x487258['query'][_0x65e9('0x32')]));_0x5795f9[_0x65e9('0x33')]=_0x5795f9[_0x65e9('0x33')][_0x65e9('0x34')]?_0x5795f9[_0x65e9('0x33')]:_0x1cdeb4[_0x65e9('0x2c')];_0x5795f9=_[_0x65e9('0x35')]({},_0x5795f9,_0x487258[_0x65e9('0x36')]);return utilLicense[_0x65e9('0x37')](_0x5795f9)[_0x65e9('0x24')](respondWithResult(_0x4473d,null))[_0x65e9('0x38')](handleError(_0x4473d,null));};exports[_0x65e9('0x23')]=function(_0x213d91,_0x370b22){if(_0x213d91[_0x65e9('0x39')]['id']){delete _0x213d91[_0x65e9('0x39')]['id'];}return db['License'][_0x65e9('0x3a')]({'where':{'id':_0x213d91[_0x65e9('0x3b')]['id']}})[_0x65e9('0x24')](handleEntityNotFound(_0x370b22,null))[_0x65e9('0x24')](function(_0x9199cb){var _0x7a2137=_0x9199cb[_0x65e9('0x3c')]({'plain':!![]});return utilLicense[_0x65e9('0x3d')](_0x7a2137,_0x213d91[_0x65e9('0x39')][_0x65e9('0x3e')]);})[_0x65e9('0x24')](function(_0x824403){if(!_0x824403[_0x65e9('0x3f')]){return saveUpdates(_0x213d91[_0x65e9('0x39')],null);}return _0x824403;})['then'](respondWithResult(_0x370b22,null))[_0x65e9('0x38')](handleError(_0x370b22,null));}; \ No newline at end of file +var _0x1409=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','name','../../config/license/util','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','License','get','checkLicense','key','demo','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4baebe,_0x14d67f){var _0x30e34f=function(_0x4770c6){while(--_0x4770c6){_0x4baebe['push'](_0x4baebe['shift']());}};_0x30e34f(++_0x14d67f);}(_0x1409,0x18d));var _0x9140=function(_0xf990b1,_0x254644){_0xf990b1=_0xf990b1-0x0;var _0x58067f=_0x1409[_0xf990b1];return _0x58067f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9140('0x0'));var rimraf=require(_0x9140('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9140('0x2'));var rp=require(_0x9140('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9140('0x4'));var util=require('util');var path=require(_0x9140('0x5'));var sox=require(_0x9140('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9140('0x7'));var squel=require(_0x9140('0x8'));var crypto=require(_0x9140('0x9'));var jsforce=require(_0x9140('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x9140('0xb'));var querystring=require(_0x9140('0xc'));var Papa=require('papaparse');var Redis=require(_0x9140('0xd'));var authService=require(_0x9140('0xe'));var qs=require(_0x9140('0xf'));var as=require(_0x9140('0x10'));var hardwareService=require(_0x9140('0x11'));var logger=require(_0x9140('0x12'))(_0x9140('0x13'));var utils=require(_0x9140('0x14'));var config=require(_0x9140('0x15'));var db=require(_0x9140('0x16'))['db'];function respondWithStatusCode(_0x206e9e,_0x49fd58){_0x49fd58=_0x49fd58||0xcc;return function(_0x53bdd5){if(_0x53bdd5){return _0x206e9e['sendStatus'](_0x49fd58);}return _0x206e9e[_0x9140('0x17')](_0x49fd58)[_0x9140('0x18')]();};}function respondWithResult(_0x57dcb2,_0x41c576){_0x41c576=_0x41c576||0xc8;return function(_0xcda7d3){if(_0xcda7d3){return _0x57dcb2[_0x9140('0x17')](_0x41c576)['json'](_0xcda7d3);}};}function respondWithFilteredResult(_0x528f01,_0xf3d60b){return function(_0x267a80){if(_0x267a80){var _0x1b8a95=_0x267a80[_0x9140('0x19')],_0x44b45e=_0xf3d60b[_0x9140('0x1a')],_0x26df63=_0xf3d60b[_0x9140('0x1a')]+_0xf3d60b[_0x9140('0x1b')],_0xe93e7;if(_0x26df63>=_0x1b8a95){_0x26df63=_0x1b8a95;_0xe93e7=0xc8;}else{_0xe93e7=0xce;}_0x528f01[_0x9140('0x17')](_0xe93e7);return _0x528f01[_0x9140('0x1c')](_0x9140('0x1d'),_0x44b45e+'-'+_0x26df63+'/'+_0x1b8a95)[_0x9140('0x1e')](_0x267a80);}return null;};}function patchUpdates(_0x40d178){return function(_0x22597f){try{jsonpatch['apply'](_0x22597f,_0x40d178,!![]);}catch(_0x17cc74){return BPromise[_0x9140('0x1f')](_0x17cc74);}return _0x22597f[_0x9140('0x20')]();};}function saveUpdates(_0x99315f,_0x884016){return function(_0x314177){if(_0x314177){return _0x314177[_0x9140('0x21')](_0x99315f)[_0x9140('0x22')](function(_0x4e86cb){return _0x4e86cb;});}return null;};}function removeEntity(_0x493eb8,_0xe573c){return function(_0x53653b){if(_0x53653b){return _0x53653b[_0x9140('0x23')]()['then'](function(){_0x493eb8[_0x9140('0x17')](0xcc)[_0x9140('0x18')]();});}};}function handleEntityNotFound(_0x243834,_0x2a68f4){return function(_0x53b569){if(!_0x53b569){_0x243834['sendStatus'](0x194);}return _0x53b569;};}function handleError(_0x27340c,_0x4a3906){_0x4a3906=_0x4a3906||0x1f4;return function(_0x2e03c2){logger[_0x9140('0x24')](_0x2e03c2['stack']);if(_0x2e03c2[_0x9140('0x25')]){delete _0x2e03c2[_0x9140('0x25')];}_0x27340c[_0x9140('0x17')](_0x4a3906)['send'](_0x2e03c2);};}var utilLicense=require(_0x9140('0x26'));exports[_0x9140('0x27')]=function(_0x3f263d,_0x2d8880){var _0xd8f710={'raw':!![],'where':{'id':0x1}},_0x2a72bf={};_0x2a72bf[_0x9140('0x28')]=_[_0x9140('0x29')](db['License'][_0x9140('0x2a')]);_0x2a72bf['query']=_[_0x9140('0x29')](_0x3f263d[_0x9140('0x2b')]);_0x2a72bf[_0x9140('0x2c')]=_[_0x9140('0x2d')](_0x2a72bf[_0x9140('0x28')],_0x2a72bf['query']);_0xd8f710[_0x9140('0x2e')]=_[_0x9140('0x2d')](_0x2a72bf['model'],qs['fields'](_0x3f263d[_0x9140('0x2b')][_0x9140('0x2f')]));_0xd8f710[_0x9140('0x2e')]=_0xd8f710[_0x9140('0x2e')][_0x9140('0x30')]?_0xd8f710[_0x9140('0x2e')]:_0x2a72bf[_0x9140('0x28')];_0xd8f710=_[_0x9140('0x31')]({},_0xd8f710,_0x3f263d[_0x9140('0x32')]);return utilLicense[_0x9140('0x33')](_0xd8f710)[_0x9140('0x22')](respondWithResult(_0x2d8880,null))[_0x9140('0x34')](handleError(_0x2d8880,null));};exports['update']=function(_0x5adf3b,_0x5c4708){if(_0x5adf3b[_0x9140('0x35')]['id']){delete _0x5adf3b[_0x9140('0x35')]['id'];}return db[_0x9140('0x36')]['find']({'where':{'id':_0x5adf3b['params']['id']}})[_0x9140('0x22')](handleEntityNotFound(_0x5c4708,null))[_0x9140('0x22')](function(_0x3dc390){var _0x13e497=_0x3dc390[_0x9140('0x37')]({'plain':!![]});return utilLicense[_0x9140('0x38')](_0x13e497,_0x5adf3b[_0x9140('0x35')][_0x9140('0x39')]);})[_0x9140('0x22')](function(_0x2838c4){if(!_0x2838c4[_0x9140('0x3a')]){return saveUpdates(_0x5adf3b[_0x9140('0x35')],null);}return _0x2838c4;})[_0x9140('0x22')](respondWithResult(_0x5c4708,null))[_0x9140('0x34')](handleError(_0x5c4708,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index dfd5b22..60a289c 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 _0x89c3=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3eebfc,_0x44a53e){var _0x2d4497=function(_0x49dccf){while(--_0x49dccf){_0x3eebfc['push'](_0x3eebfc['shift']());}};_0x2d4497(++_0x44a53e);}(_0x89c3,0xff));var _0x389c=function(_0x20d85b,_0x19ad7b){_0x20d85b=_0x20d85b-0x0;var _0x5c5ede=_0x89c3[_0x20d85b];return _0x5c5ede;};'use strict';var _=require(_0x389c('0x0'));var util=require(_0x389c('0x1'));var logger=require(_0x389c('0x2'))(_0x389c('0x3'));var moment=require(_0x389c('0x4'));var BPromise=require(_0x389c('0x5'));var rp=require(_0x389c('0x6'));var fs=require('fs');var path=require(_0x389c('0x7'));var rimraf=require('rimraf');var config=require(_0x389c('0x8'));var attributes=require('./license.attributes');module[_0x389c('0x9')]=function(_0x4bece6,_0x51f5f5){return _0x4bece6[_0x389c('0xa')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae7c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','License','license'];(function(_0x1a467f,_0x4a4cf3){var _0x48bab5=function(_0x4237b7){while(--_0x4237b7){_0x1a467f['push'](_0x1a467f['shift']());}};_0x48bab5(++_0x4a4cf3);}(_0xae7c,0x104));var _0xcae7=function(_0x58bc30,_0x372d71){_0x58bc30=_0x58bc30-0x0;var _0xb30ff=_0xae7c[_0x58bc30];return _0xb30ff;};'use strict';var _=require(_0xcae7('0x0'));var util=require(_0xcae7('0x1'));var logger=require(_0xcae7('0x2'))(_0xcae7('0x3'));var moment=require(_0xcae7('0x4'));var BPromise=require(_0xcae7('0x5'));var rp=require(_0xcae7('0x6'));var fs=require('fs');var path=require(_0xcae7('0x7'));var rimraf=require('rimraf');var config=require(_0xcae7('0x8'));var attributes=require(_0xcae7('0x9'));module[_0xcae7('0xa')]=function(_0x52a18c,_0x2881c6){return _0x52a18c['define'](_0xcae7('0xb'),attributes,{'tableName':_0xcae7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 44e2895..d9688cf 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 _0xd523=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0xd523,0x153));var _0x3d52=function(_0x7234e,_0x1ec6f6){_0x7234e=_0x7234e-0x0;var _0x3258bf=_0xd523[_0x7234e];return _0x3258bf;};'use strict';var _=require(_0x3d52('0x0'));var util=require(_0x3d52('0x1'));var moment=require(_0x3d52('0x2'));var BPromise=require(_0x3d52('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d52('0x4'));var db=require(_0x3d52('0x5'))['db'];var utils=require(_0x3d52('0x6'));var logger=require('../../config/logger')(_0x3d52('0x7'));var config=require(_0x3d52('0x8'));var jayson=require(_0x3d52('0x9'));var client=jayson[_0x3d52('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fcc92,_0x189147,_0x2f3ebc){return new BPromise(function(_0x232bd4,_0x2e03c0){return client[_0x3d52('0xb')](_0x4fcc92,_0x2f3ebc)[_0x3d52('0xc')](function(_0x34c184){logger[_0x3d52('0xd')](_0x3d52('0xe'),_0x189147,'request\x20sent');logger[_0x3d52('0xf')](_0x3d52('0x10'),_0x189147,_0x3d52('0x11'),JSON[_0x3d52('0x12')](_0x34c184));if(_0x34c184[_0x3d52('0x13')]){if(_0x34c184['error'][_0x3d52('0x14')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x189147,_0x34c184[_0x3d52('0x13')][_0x3d52('0x15')]);return _0x2e03c0(_0x34c184['error']['message']);}logger['error'](_0x3d52('0xe'),_0x189147,_0x34c184[_0x3d52('0x13')][_0x3d52('0x15')]);return _0x232bd4(_0x34c184[_0x3d52('0x13')][_0x3d52('0x15')]);}else{logger[_0x3d52('0xd')](_0x3d52('0xe'),_0x189147,_0x3d52('0x11'));_0x232bd4(_0x34c184[_0x3d52('0x16')][_0x3d52('0x15')]);}})[_0x3d52('0x17')](function(_0x15cc02){logger[_0x3d52('0x13')](_0x3d52('0xe'),_0x189147,_0x15cc02);_0x2e03c0(_0x15cc02);});});} \ No newline at end of file +var _0xbbfa=['License,\x20%s,\x20%s,\x20%s','error','code','License,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x5b495b,_0x2ad13e){var _0x1796ec=function(_0x4a4cb8){while(--_0x4a4cb8){_0x5b495b['push'](_0x5b495b['shift']());}};_0x1796ec(++_0x2ad13e);}(_0xbbfa,0x1e9));var _0xabbf=function(_0x5eb4bb,_0xbd4598){_0x5eb4bb=_0x5eb4bb-0x0;var _0x12d25b=_0xbbfa[_0x5eb4bb];return _0x12d25b;};'use strict';var _=require(_0xabbf('0x0'));var util=require('util');var moment=require(_0xabbf('0x1'));var BPromise=require('bluebird');var rs=require(_0xabbf('0x2'));var fs=require('fs');var Redis=require(_0xabbf('0x3'));var db=require(_0xabbf('0x4'))['db'];var utils=require(_0xabbf('0x5'));var logger=require(_0xabbf('0x6'))(_0xabbf('0x7'));var config=require(_0xabbf('0x8'));var jayson=require(_0xabbf('0x9'));var client=jayson[_0xabbf('0xa')][_0xabbf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45b7d6,_0x58f0a8,_0x5b471b){return new BPromise(function(_0x536a4c,_0x1380cd){return client[_0xabbf('0xc')](_0x45b7d6,_0x5b471b)['then'](function(_0x5f35ee){logger[_0xabbf('0xd')]('License,\x20%s,\x20%s',_0x58f0a8,_0xabbf('0xe'));logger['debug'](_0xabbf('0xf'),_0x58f0a8,'request\x20sent',JSON['stringify'](_0x5f35ee));if(_0x5f35ee[_0xabbf('0x10')]){if(_0x5f35ee[_0xabbf('0x10')][_0xabbf('0x11')]===0x1f4){logger[_0xabbf('0x10')](_0xabbf('0x12'),_0x58f0a8,_0x5f35ee[_0xabbf('0x10')][_0xabbf('0x13')]);return _0x1380cd(_0x5f35ee[_0xabbf('0x10')][_0xabbf('0x13')]);}logger['error'](_0xabbf('0x12'),_0x58f0a8,_0x5f35ee['error'][_0xabbf('0x13')]);return _0x536a4c(_0x5f35ee['error'][_0xabbf('0x13')]);}else{logger[_0xabbf('0xd')](_0xabbf('0x12'),_0x58f0a8,_0xabbf('0xe'));_0x536a4c(_0x5f35ee['result'][_0xabbf('0x13')]);}})[_0xabbf('0x14')](function(_0x31245d){logger[_0xabbf('0x10')](_0xabbf('0x12'),_0x58f0a8,_0x31245d);_0x1380cd(_0x31245d);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 6a1fd95..ee37250 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 _0x17b4=['post','addDisposition','create','addImap','/:id/interactions','addInteraction','addApplications','/:id/send','addAgents','put','update','removeDispositions','delete','removeAnswers','removeImap','removeSmtp','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','/:id/users','getAgents'];(function(_0x4ec770,_0x48d9f1){var _0x504528=function(_0x36fb99){while(--_0x36fb99){_0x4ec770['push'](_0x4ec770['shift']());}};_0x504528(++_0x48d9f1);}(_0x17b4,0xc9));var _0x417b=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x17b4[_0x23e7c1];return _0x1add43;};'use strict';var multer=require(_0x417b('0x0'));var util=require(_0x417b('0x1'));var path=require(_0x417b('0x2'));var timeout=require('connect-timeout');var express=require(_0x417b('0x3'));var router=express[_0x417b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x417b('0x5'));var config=require(_0x417b('0x6'));var controller=require(_0x417b('0x7'));router[_0x417b('0x8')]('/',auth[_0x417b('0x9')](),controller[_0x417b('0xa')]);router[_0x417b('0x8')](_0x417b('0xb'),auth[_0x417b('0x9')](),controller['describe']);router[_0x417b('0x8')](_0x417b('0xc'),auth[_0x417b('0x9')](),controller[_0x417b('0xd')]);router[_0x417b('0x8')](_0x417b('0xe'),auth[_0x417b('0x9')](),controller[_0x417b('0xf')]);router[_0x417b('0x8')](_0x417b('0x10'),auth[_0x417b('0x9')](),controller[_0x417b('0x11')]);router[_0x417b('0x8')](_0x417b('0x12'),auth['isAuthenticated'](),controller[_0x417b('0x13')]);router[_0x417b('0x8')](_0x417b('0x14'),auth['isAuthenticated'](),controller[_0x417b('0x15')]);router['get']('/:id/interactions',auth[_0x417b('0x9')](),controller['getInteractions']);router[_0x417b('0x8')](_0x417b('0x16'),auth[_0x417b('0x9')](),controller[_0x417b('0x17')]);router[_0x417b('0x8')](_0x417b('0x18'),auth['isAuthenticated'](),controller['getMessages']);router[_0x417b('0x8')](_0x417b('0x19'),auth['isAuthenticated'](),controller[_0x417b('0x1a')]);router[_0x417b('0x8')](_0x417b('0x1b'),auth[_0x417b('0x9')](),controller[_0x417b('0x1c')]);router[_0x417b('0x1d')](_0x417b('0xe'),auth[_0x417b('0x9')](),controller[_0x417b('0x1e')]);router[_0x417b('0x1d')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0x417b('0x1d')]('/',auth[_0x417b('0x9')](),controller[_0x417b('0x1f')]);router[_0x417b('0x1d')](_0x417b('0x12'),auth[_0x417b('0x9')](),controller[_0x417b('0x20')]);router['post']('/:id/out_servers',auth[_0x417b('0x9')](),controller['addSmtp']);router[_0x417b('0x1d')](_0x417b('0x21'),auth[_0x417b('0x9')](),controller[_0x417b('0x22')]);router['post'](_0x417b('0x16'),auth[_0x417b('0x9')](),controller[_0x417b('0x23')]);router['post'](_0x417b('0x24'),auth[_0x417b('0x9')](),controller['send']);router['post'](_0x417b('0x1b'),auth[_0x417b('0x9')](),controller[_0x417b('0x25')]);router[_0x417b('0x26')](_0x417b('0xc'),auth['isAuthenticated'](),controller[_0x417b('0x27')]);router['delete'](_0x417b('0xe'),auth[_0x417b('0x9')](),controller[_0x417b('0x28')]);router[_0x417b('0x29')]('/:id/canned_answers',auth[_0x417b('0x9')](),controller[_0x417b('0x2a')]);router['delete'](_0x417b('0x12'),auth[_0x417b('0x9')](),controller[_0x417b('0x2b')]);router[_0x417b('0x29')](_0x417b('0x14'),auth[_0x417b('0x9')](),controller[_0x417b('0x2c')]);router[_0x417b('0x29')]('/:id',auth['isAuthenticated'](),controller[_0x417b('0x2d')]);router[_0x417b('0x29')](_0x417b('0x1b'),auth[_0x417b('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x6641=['removeImap','removeAgents','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','post','addDisposition','addAnswer','addImap','addSmtp','/:id/interactions','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers'];(function(_0x1678c8,_0x1c32f4){var _0x387aa9=function(_0x2803bd){while(--_0x2803bd){_0x1678c8['push'](_0x1678c8['shift']());}};_0x387aa9(++_0x1c32f4);}(_0x6641,0x1e7));var _0x1664=function(_0x4145ed,_0x1965e3){_0x4145ed=_0x4145ed-0x0;var _0x2294a6=_0x6641[_0x4145ed];return _0x2294a6;};'use strict';var multer=require(_0x1664('0x0'));var util=require('util');var path=require(_0x1664('0x1'));var timeout=require(_0x1664('0x2'));var express=require('express');var router=express[_0x1664('0x3')]();var auth=require(_0x1664('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1664('0x5'));var controller=require('./mailAccount.controller');router[_0x1664('0x6')]('/',auth[_0x1664('0x7')](),controller[_0x1664('0x8')]);router[_0x1664('0x6')](_0x1664('0x9'),auth['isAuthenticated'](),controller[_0x1664('0xa')]);router[_0x1664('0x6')](_0x1664('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1664('0x6')](_0x1664('0xc'),auth[_0x1664('0x7')](),controller[_0x1664('0xd')]);router[_0x1664('0x6')](_0x1664('0xe'),auth[_0x1664('0x7')](),controller[_0x1664('0xf')]);router[_0x1664('0x6')](_0x1664('0x10'),auth[_0x1664('0x7')](),controller[_0x1664('0x11')]);router[_0x1664('0x6')](_0x1664('0x12'),auth[_0x1664('0x7')](),controller['getSmtp']);router[_0x1664('0x6')]('/:id/interactions',auth[_0x1664('0x7')](),controller[_0x1664('0x13')]);router[_0x1664('0x6')](_0x1664('0x14'),auth[_0x1664('0x7')](),controller['getApplications']);router[_0x1664('0x6')](_0x1664('0x15'),auth[_0x1664('0x7')](),controller[_0x1664('0x16')]);router[_0x1664('0x6')](_0x1664('0x17'),auth[_0x1664('0x7')](),controller['verifySmtp']);router[_0x1664('0x6')](_0x1664('0x18'),auth[_0x1664('0x7')](),controller[_0x1664('0x19')]);router[_0x1664('0x1a')](_0x1664('0xc'),auth[_0x1664('0x7')](),controller[_0x1664('0x1b')]);router[_0x1664('0x1a')](_0x1664('0xe'),auth[_0x1664('0x7')](),controller[_0x1664('0x1c')]);router[_0x1664('0x1a')]('/',auth[_0x1664('0x7')](),controller['create']);router[_0x1664('0x1a')]('/:id/in_servers',auth[_0x1664('0x7')](),controller[_0x1664('0x1d')]);router[_0x1664('0x1a')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x1664('0x1e')]);router[_0x1664('0x1a')](_0x1664('0x1f'),auth['isAuthenticated'](),controller['addInteraction']);router['post'](_0x1664('0x14'),auth['isAuthenticated'](),controller[_0x1664('0x20')]);router['post'](_0x1664('0x21'),auth[_0x1664('0x7')](),controller[_0x1664('0x22')]);router['post'](_0x1664('0x18'),auth['isAuthenticated'](),controller[_0x1664('0x23')]);router[_0x1664('0x24')](_0x1664('0xb'),auth[_0x1664('0x7')](),controller[_0x1664('0x25')]);router[_0x1664('0x26')](_0x1664('0xc'),auth['isAuthenticated'](),controller[_0x1664('0x27')]);router['delete'](_0x1664('0xe'),auth[_0x1664('0x7')](),controller[_0x1664('0x28')]);router[_0x1664('0x26')](_0x1664('0x10'),auth[_0x1664('0x7')](),controller[_0x1664('0x29')]);router['delete'](_0x1664('0x12'),auth[_0x1664('0x7')](),controller['removeSmtp']);router[_0x1664('0x26')](_0x1664('0xb'),auth[_0x1664('0x7')](),controller['destroy']);router[_0x1664('0x26')](_0x1664('0x18'),auth[_0x1664('0x7')](),controller[_0x1664('0x2a')]);module[_0x1664('0x2b')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 17b3044..609724c 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 _0x03bd=['INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','STRING','BOOLEAN','Arial,Helvetica,sans-serif'];(function(_0x5c1ade,_0xaa1212){var _0x4980b4=function(_0x522f89){while(--_0x522f89){_0x5c1ade['push'](_0x5c1ade['shift']());}};_0x4980b4(++_0xaa1212);}(_0x03bd,0x1b6));var _0xd03b=function(_0x3e66a3,_0x5136a6){_0x3e66a3=_0x3e66a3-0x0;var _0x4d5e92=_0x03bd[_0x3e66a3];return _0x4d5e92;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xd03b('0x0')]},'name':{'type':Sequelize[_0xd03b('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0xd03b('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0xd03b('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xd03b('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0xd03b('0x0')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xd03b('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xd03b('0x0')],'allowNull':![],'defaultValue':_0xd03b('0x2')},'fontSize':{'type':Sequelize[_0xd03b('0x3')](0x2)[_0xd03b('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd03b('0x5');}},'notificationSound':{'type':Sequelize[_0xd03b('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd03b('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd03b('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd03b('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd03b('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd03b('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd03b('0x3')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd03b('0x1')],'defaultValue':![],'comment':_0xd03b('0x6'),'set':function(_0x852c48){if(!_0x852c48)this[_0xd03b('0x7')](_0xd03b('0x8'),null);this[_0xd03b('0x7')]('mandatoryDisposition',_0x852c48);}}}; \ No newline at end of file +var _0xfe88=['TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','STRING','BOOLEAN'];(function(_0x3357f8,_0x4edfbc){var _0x250041=function(_0x5b352b){while(--_0x5b352b){_0x3357f8['push'](_0x3357f8['shift']());}};_0x250041(++_0x4edfbc);}(_0xfe88,0x10b));var _0x8fe8=function(_0x2272c3,_0x4e81bc){_0x2272c3=_0x2272c3-0x0;var _0x43645f=_0xfe88[_0x2272c3];return _0x43645f;};'use strict';var Sequelize=require(_0x8fe8('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x8fe8('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x8fe8('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x8fe8('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x8fe8('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x8fe8('0x3')]},'markAsUnread':{'type':Sequelize[_0x8fe8('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x8fe8('0x1')],'allowNull':![],'defaultValue':_0x8fe8('0x4')},'fontSize':{'type':Sequelize[_0x8fe8('0x5')](0x2)[_0x8fe8('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x8fe8('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x8fe8('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8fe8('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8fe8('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x8fe8('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x346f9b){if(!_0x346f9b)this[_0x8fe8('0x8')](_0x8fe8('0x9'),null);this[_0x8fe8('0x8')]('mandatoryDisposition',_0x346f9b);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index aa6db92..5be5405 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 _0x838f=['status','json','count','set','apply','reject','save','destroy','then','get','UserProfileResource','end','stack','name','send','index','MailServerIn','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','limit','offset','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','Imap','Pause','length','find','update','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','active','isNil','cservice','cauthentication','user','cuser','password','pass','authentication','host','port','service','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailAccounts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','addInteraction','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','CmList','List','Contacts','DESC','from','attachments','join','root','server/files/attachments','auth','secure','SendMail','sendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','client','http','test','ValidationError','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus'];(function(_0x265f6f,_0x5dbc66){var _0x1ff402=function(_0x279ed5){while(--_0x279ed5){_0x265f6f['push'](_0x265f6f['shift']());}};_0x1ff402(++_0x5dbc66);}(_0x838f,0x98));var _0xf838=function(_0x2e67ab,_0x42ee36){_0x2e67ab=_0x2e67ab-0x0;var _0x1e0289=_0x838f[_0x2e67ab];return _0x1e0289;};'use strict';var pdf=require(_0xf838('0x0'));var emlformat=require(_0xf838('0x1'));var rimraf=require(_0xf838('0x2'));var zipdir=require(_0xf838('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf838('0x4'));var Mustache=require(_0xf838('0x5'));var util=require(_0xf838('0x6'));var path=require('path');var sox=require(_0xf838('0x7'));var csv=require(_0xf838('0x8'));var ejs=require(_0xf838('0x9'));var fs=require('fs');var _=require(_0xf838('0xa'));var squel=require('squel');var crypto=require(_0xf838('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf838('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf838('0xd'));var Papa=require(_0xf838('0xe'));var Redis=require(_0xf838('0xf'));var authService=require(_0xf838('0x10'));var qs=require(_0xf838('0x11'));var as=require(_0xf838('0x12'));var hardwareService=require(_0xf838('0x13'));var logger=require(_0xf838('0x14'))(_0xf838('0x15'));var utils=require(_0xf838('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf838('0x17')]=_[_0xf838('0x18')](config[_0xf838('0x17')],{'host':_0xf838('0x19'),'port':0x18eb});var socket=require(_0xf838('0x1a'))(new Redis(config['redis']));require(_0xf838('0x1b'))[_0xf838('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf838('0x1d')][_0xf838('0x1e')]({'port':0x232b});function checkPasswordPattern(_0x7b33b5,_0x508961,_0x4bab14){if(_0x4bab14){var _0x2de957=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2de957[_0xf838('0x1f')](_0x508961)){return _0x7b33b5;}else{throw new db['Sequelize'][(_0xf838('0x20'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x7b33b5;}}function respondWithRpcPromise(_0x514201,_0xe39a6d,_0xed36b9,_0x1c6005){return new BPromise(function(_0x5afa2b,_0x11bf35){var _0x140b48=_0x1c6005||client;return _0x140b48[_0xf838('0x21')](_0x514201,_0xed36b9)['then'](function(_0x276906){logger[_0xf838('0x22')](_0xf838('0x23'),_0xe39a6d,_0xf838('0x24'));logger[_0xf838('0x25')](_0xf838('0x26'),_0xe39a6d,_0xf838('0x24'),JSON['stringify'](_0x276906));if(_0x276906[_0xf838('0x27')]){if(_0x276906['error']['code']===0x1f4){logger[_0xf838('0x27')](_0xf838('0x23'),_0xe39a6d,_0x276906[_0xf838('0x27')][_0xf838('0x28')]);return _0x11bf35(_0x276906[_0xf838('0x27')][_0xf838('0x28')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0xe39a6d,_0x276906['error'][_0xf838('0x28')]);return _0x5afa2b(_0x276906['error'][_0xf838('0x28')]);}else{logger[_0xf838('0x22')](_0xf838('0x23'),_0xe39a6d,_0xf838('0x24'));_0x5afa2b(_0x276906['result'][_0xf838('0x28')]);}})[_0xf838('0x29')](function(_0x3f1850){logger[_0xf838('0x27')]('MailAccount,\x20%s,\x20%s',_0xe39a6d,_0x3f1850);_0x11bf35(_0x3f1850);});});}function respondWithStatusCode(_0x4ae682,_0x4c6267){_0x4c6267=_0x4c6267||0xcc;return function(_0x507d7a){if(_0x507d7a){return _0x4ae682[_0xf838('0x2a')](_0x4c6267);}return _0x4ae682[_0xf838('0x2b')](_0x4c6267)['end']();};}function respondWithResult(_0x1abb2f,_0x339e90){_0x339e90=_0x339e90||0xc8;return function(_0x3b476d){if(_0x3b476d){return _0x1abb2f[_0xf838('0x2b')](_0x339e90)[_0xf838('0x2c')](_0x3b476d);}};}function respondWithFilteredResult(_0x81f94a,_0x16c06f){return function(_0x1ab38f){if(_0x1ab38f){var _0x4cfdd9=_0x1ab38f[_0xf838('0x2d')],_0xb879f1=_0x16c06f['offset'],_0x46a252=_0x16c06f['offset']+_0x16c06f['limit'],_0x2b54f5;if(_0x46a252>=_0x4cfdd9){_0x46a252=_0x4cfdd9;_0x2b54f5=0xc8;}else{_0x2b54f5=0xce;}_0x81f94a[_0xf838('0x2b')](_0x2b54f5);return _0x81f94a[_0xf838('0x2e')]('Content-Range',_0xb879f1+'-'+_0x46a252+'/'+_0x4cfdd9)[_0xf838('0x2c')](_0x1ab38f);}return null;};}function patchUpdates(_0x5697e5){return function(_0x3cc7ba){try{jsonpatch[_0xf838('0x2f')](_0x3cc7ba,_0x5697e5,!![]);}catch(_0x4ee875){return BPromise[_0xf838('0x30')](_0x4ee875);}return _0x3cc7ba[_0xf838('0x31')]();};}function saveUpdates(_0x26da39,_0x3ea8e7){return function(_0x267ff7){if(_0x267ff7){return _0x267ff7['update'](_0x26da39)['then'](function(_0x37aa55){return _0x37aa55;});}return null;};}function removeEntity(_0x4b9ad5,_0x6d8a06){return function(_0x3f1106){if(_0x3f1106){return _0x3f1106[_0xf838('0x32')]()[_0xf838('0x33')](function(){var _0x1fb673=_0x3f1106[_0xf838('0x34')]({'plain':!![]});var _0x4e401c='MailAccounts';return db[_0xf838('0x35')]['destroy']({'where':{'type':_0x4e401c,'resourceId':_0x1fb673['id']}})[_0xf838('0x33')](function(){return _0x3f1106;});})['then'](function(){_0x4b9ad5[_0xf838('0x2b')](0xcc)[_0xf838('0x36')]();});}};}function handleEntityNotFound(_0x14849c,_0x1d2d00){return function(_0x39ef1e){if(!_0x39ef1e){_0x14849c[_0xf838('0x2a')](0x194);}return _0x39ef1e;};}function handleError(_0x29cbd1,_0xc28df8){_0xc28df8=_0xc28df8||0x1f4;return function(_0x16a1f4){logger[_0xf838('0x27')](_0x16a1f4[_0xf838('0x37')]);if(_0x16a1f4[_0xf838('0x38')]){delete _0x16a1f4[_0xf838('0x38')];}_0x29cbd1[_0xf838('0x2b')](_0xc28df8)[_0xf838('0x39')](_0x16a1f4);};}exports[_0xf838('0x3a')]=function(_0x43a646,_0x3cf2f2){var _0x434927={'include':[{'model':db[_0xf838('0x3b')],'as':'Imap'},{'model':db[_0xf838('0x3c')],'as':_0xf838('0x3d')},{'model':db['Pause'],'as':_0xf838('0x3e')}]},_0x34705e={},_0xbce6e8={'count':0x0,'rows':[]};var _0x165548=_[_0xf838('0x3f')](db[_0xf838('0x40')][_0xf838('0x41')],function(_0x4bf0f9){return{'name':_0x4bf0f9['fieldName'],'type':_0x4bf0f9[_0xf838('0x42')][_0xf838('0x43')]};});_0x34705e[_0xf838('0x44')]=_['map'](_0x165548,_0xf838('0x38'));_0x34705e[_0xf838('0x45')]=_[_0xf838('0x46')](_0x43a646[_0xf838('0x45')]);_0x34705e['filters']=_[_0xf838('0x47')](_0x34705e[_0xf838('0x44')],_0x34705e['query']);_0x434927[_0xf838('0x48')]=_[_0xf838('0x47')](_0x34705e[_0xf838('0x44')],qs[_0xf838('0x49')](_0x43a646[_0xf838('0x45')]['fields']));_0x434927[_0xf838('0x48')]=_0x434927['attributes']['length']?_0x434927[_0xf838('0x48')]:_0x34705e[_0xf838('0x44')];if(!_0x43a646['query']['hasOwnProperty']('nolimit')){_0x434927['limit']=qs['limit'](_0x43a646['query'][_0xf838('0x4a')]);_0x434927[_0xf838('0x4b')]=qs[_0xf838('0x4b')](_0x43a646['query']['offset']);}_0x434927[_0xf838('0x4c')]=qs[_0xf838('0x4d')](_0x43a646[_0xf838('0x45')][_0xf838('0x4d')]);_0x434927[_0xf838('0x4e')]=qs[_0xf838('0x4f')](_[_0xf838('0x50')](_0x43a646['query'],_0x34705e['filters']));if(_0x43a646[_0xf838('0x45')][_0xf838('0x51')]){_0x434927['where']=_[_0xf838('0x52')](_0x434927[_0xf838('0x4e')],{'$or':_[_0xf838('0x3f')](_0x165548,function(_0x4e8731){if(_0x4e8731[_0xf838('0x42')]!=='VIRTUAL'){var _0x123e5b={};_0x123e5b[_0x4e8731[_0xf838('0x38')]]={'$like':'%'+_0x43a646['query'][_0xf838('0x51')]+'%'};return _0x123e5b;}})});}_0x434927=_[_0xf838('0x52')]({},_0x434927,_0x43a646[_0xf838('0x53')]);var _0x37f203={'where':_0x434927[_0xf838('0x4e')]};return db[_0xf838('0x40')][_0xf838('0x2d')](_0x37f203)['then'](function(_0x394a86){_0xbce6e8['count']=_0x394a86;if(_0x43a646['query'][_0xf838('0x54')]){_0x434927[_0xf838('0x55')]=[{'all':!![]}];}return db[_0xf838('0x40')][_0xf838('0x56')](_0x434927);})[_0xf838('0x33')](function(_0xc55c08){_0xbce6e8[_0xf838('0x57')]=_0xc55c08;return _0xbce6e8;})[_0xf838('0x33')](respondWithFilteredResult(_0x3cf2f2,_0x434927))['catch'](handleError(_0x3cf2f2,null));};exports[_0xf838('0x58')]=function(_0x343700,_0x57e5e4){var _0x2698e8={'raw':![],'where':{'id':_0x343700[_0xf838('0x59')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xf838('0x5a')},{'model':db[_0xf838('0x3c')],'as':_0xf838('0x3d')},{'model':db[_0xf838('0x5b')],'as':_0xf838('0x3e')}]},_0x270bed={};_0x270bed[_0xf838('0x44')]=_[_0xf838('0x46')](db['MailAccount'][_0xf838('0x41')]);_0x270bed[_0xf838('0x45')]=_[_0xf838('0x46')](_0x343700['query']);_0x270bed[_0xf838('0x4f')]=_['intersection'](_0x270bed[_0xf838('0x44')],_0x270bed[_0xf838('0x45')]);_0x2698e8[_0xf838('0x48')]=_['intersection'](_0x270bed['model'],qs[_0xf838('0x49')](_0x343700[_0xf838('0x45')][_0xf838('0x49')]));_0x2698e8['attributes']=_0x2698e8[_0xf838('0x48')][_0xf838('0x5c')]?_0x2698e8[_0xf838('0x48')]:_0x270bed['model'];if(_0x343700['query'][_0xf838('0x54')]){_0x2698e8[_0xf838('0x55')]=[{'all':!![]}];}_0x2698e8=_['merge']({},_0x2698e8,_0x343700[_0xf838('0x53')]);return db[_0xf838('0x40')][_0xf838('0x5d')](_0x2698e8)[_0xf838('0x33')](handleEntityNotFound(_0x57e5e4,null))[_0xf838('0x33')](respondWithResult(_0x57e5e4,null))[_0xf838('0x29')](handleError(_0x57e5e4,null));};exports[_0xf838('0x5e')]=function(_0x55ac1a,_0x47abb8){if(_0x55ac1a['body']['id']){delete _0x55ac1a['body']['id'];}return db[_0xf838('0x40')]['find']({'where':{'id':_0x55ac1a[_0xf838('0x59')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xf838('0x5a')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xf838('0x5b')],'as':_0xf838('0x3e')}]})[_0xf838('0x33')](handleEntityNotFound(_0x47abb8,null))[_0xf838('0x33')](saveUpdates(_0x55ac1a[_0xf838('0x5f')],null))[_0xf838('0x33')](function(_0x425151){if(_0x425151&&_0x55ac1a['body'][_0xf838('0x5a')]){return db[_0xf838('0x3b')]['update'](_0x55ac1a[_0xf838('0x5f')][_0xf838('0x5a')],{'where':{'MailAccountId':_0x425151['id']}})['then'](function(){return _0x425151;});}return _0x425151;})[_0xf838('0x33')](function(_0x4fdcb1){if(_0x4fdcb1&&_0x55ac1a[_0xf838('0x5f')][_0xf838('0x3d')]){return db[_0xf838('0x3c')]['update'](_0x55ac1a[_0xf838('0x5f')]['Smtp'],{'where':{'MailAccountId':_0x4fdcb1['id']}})['then'](function(){return _0x4fdcb1;});}return _0x4fdcb1;})[_0xf838('0x33')](respondWithResult(_0x47abb8,null))[_0xf838('0x29')](handleError(_0x47abb8,null));};exports[_0xf838('0x60')]=function(_0x51e267,_0x1fda8f){return db[_0xf838('0x40')][_0xf838('0x60')]()[_0xf838('0x33')](respondWithResult(_0x1fda8f,null))[_0xf838('0x29')](handleError(_0x1fda8f,null));};exports[_0xf838('0x61')]=function(_0x2e38f5,_0x17a336,_0x2ed552){if(_0x2e38f5[_0xf838('0x5f')]['id']){delete _0x2e38f5[_0xf838('0x5f')]['id'];}return db[_0xf838('0x40')][_0xf838('0x5d')]({'where':{'id':_0x2e38f5[_0xf838('0x59')]['id']}})[_0xf838('0x33')](handleEntityNotFound(_0x17a336,null))[_0xf838('0x33')](function(_0xeb0270){if(_0xeb0270){_0x2e38f5[_0xf838('0x5f')][_0xf838('0x62')]=_0xeb0270['id'];return db[_0xf838('0x63')][_0xf838('0x64')](_0x2e38f5[_0xf838('0x5f')]);}})[_0xf838('0x33')](respondWithResult(_0x17a336,null))['catch'](handleError(_0x17a336,null));};exports[_0xf838('0x65')]=function(_0x30f194,_0x5332a2,_0x1d186f){var _0x46e19e={'raw':![],'where':{}};var _0x572a27={};var _0x2bd6a7={'count':0x0,'rows':[]};return db['MailAccount'][_0xf838('0x66')]({'where':{'id':_0x30f194[_0xf838('0x59')]['id']}})[_0xf838('0x33')](handleEntityNotFound(_0x5332a2,null))[_0xf838('0x33')](function(_0x142e18){if(_0x142e18){_0x572a27[_0xf838('0x44')]=_['keys'](db[_0xf838('0x63')]['rawAttributes']);_0x572a27['query']=_[_0xf838('0x46')](_0x30f194[_0xf838('0x45')]);_0x572a27[_0xf838('0x4f')]=_[_0xf838('0x47')](_0x572a27[_0xf838('0x44')],_0x572a27['query']);_0x46e19e['attributes']=_[_0xf838('0x47')](_0x572a27[_0xf838('0x44')],qs[_0xf838('0x49')](_0x30f194['query'][_0xf838('0x49')]));_0x46e19e[_0xf838('0x48')]=_0x46e19e[_0xf838('0x48')][_0xf838('0x5c')]?_0x46e19e[_0xf838('0x48')]:_0x572a27[_0xf838('0x44')];if(!_0x30f194['query'][_0xf838('0x67')](_0xf838('0x68'))){_0x46e19e[_0xf838('0x4a')]=qs[_0xf838('0x4a')](_0x30f194['query'][_0xf838('0x4a')]);_0x46e19e[_0xf838('0x4b')]=qs[_0xf838('0x4b')](_0x30f194[_0xf838('0x45')]['offset']);}_0x46e19e[_0xf838('0x4c')]=qs[_0xf838('0x4d')](_0x30f194[_0xf838('0x45')]['sort']);_0x46e19e[_0xf838('0x4e')]=qs[_0xf838('0x4f')](_[_0xf838('0x50')](_0x30f194[_0xf838('0x45')],_0x572a27[_0xf838('0x4f')]));_0x46e19e[_0xf838('0x4e')]['MailAccountId']=_0x142e18['id'];if(_0x30f194[_0xf838('0x45')]['filter']){_0x46e19e['where']=_[_0xf838('0x52')](_0x46e19e['where'],{'$or':_[_0xf838('0x3f')](_0x46e19e[_0xf838('0x48')],function(_0x1c2fca){var _0xbca9a8={};_0xbca9a8[_0x1c2fca]={'$like':'%'+_0x30f194[_0xf838('0x45')]['filter']+'%'};return _0xbca9a8;})});}_0x46e19e=_[_0xf838('0x52')]({},_0x46e19e,_0x30f194[_0xf838('0x53')]);return db['Disposition'][_0xf838('0x2d')]({'where':_0x46e19e[_0xf838('0x4e')]})['then'](function(_0x15b46b){_0x2bd6a7['count']=_0x15b46b;if(_0x30f194[_0xf838('0x45')]['includeAll']){_0x46e19e[_0xf838('0x55')]=[{'all':!![]}];}return db[_0xf838('0x63')][_0xf838('0x56')](_0x46e19e);})[_0xf838('0x33')](function(_0x478d68){_0x2bd6a7[_0xf838('0x57')]=_0x478d68;return _0x2bd6a7;});}})[_0xf838('0x33')](respondWithFilteredResult(_0x5332a2,_0x46e19e))[_0xf838('0x29')](handleError(_0x5332a2,null));};exports[_0xf838('0x69')]=function(_0x27f0cd,_0x3f8981,_0xcf4a04){return db[_0xf838('0x40')]['find']({'where':{'id':_0x27f0cd[_0xf838('0x59')]['id']}})[_0xf838('0x33')](handleEntityNotFound(_0x3f8981,null))[_0xf838('0x33')](function(_0xfcf325){if(_0xfcf325){return _0xfcf325[_0xf838('0x69')](_0x27f0cd[_0xf838('0x45')][_0xf838('0x6a')]);}})[_0xf838('0x33')](respondWithStatusCode(_0x3f8981,null))[_0xf838('0x29')](handleError(_0x3f8981,null));};exports[_0xf838('0x6b')]=function(_0x49a955,_0x2289cc,_0x5ad90a){if(_0x49a955[_0xf838('0x5f')]['id']){delete _0x49a955[_0xf838('0x5f')]['id'];}return db['MailAccount'][_0xf838('0x5d')]({'where':{'id':_0x49a955[_0xf838('0x59')]['id']}})['then'](handleEntityNotFound(_0x2289cc,null))[_0xf838('0x33')](function(_0x244ceb){if(_0x244ceb){_0x49a955[_0xf838('0x5f')][_0xf838('0x62')]=_0x244ceb['id'];return db[_0xf838('0x6c')][_0xf838('0x64')](_0x49a955[_0xf838('0x5f')]);}})[_0xf838('0x33')](respondWithResult(_0x2289cc,null))['catch'](handleError(_0x2289cc,null));};exports[_0xf838('0x6d')]=function(_0x3a6642,_0x169f8f,_0x11efa3){var _0x191530={'raw':![],'where':{}};var _0x2099da={};var _0x283b91={'count':0x0,'rows':[]};return db[_0xf838('0x40')][_0xf838('0x66')]({'where':{'id':_0x3a6642['params']['id']}})[_0xf838('0x33')](handleEntityNotFound(_0x169f8f,null))['then'](function(_0xf57767){if(_0xf57767){_0x2099da[_0xf838('0x44')]=_['keys'](db['CannedAnswer'][_0xf838('0x41')]);_0x2099da[_0xf838('0x45')]=_[_0xf838('0x46')](_0x3a6642[_0xf838('0x45')]);_0x2099da['filters']=_['intersection'](_0x2099da[_0xf838('0x44')],_0x2099da['query']);_0x191530[_0xf838('0x48')]=_[_0xf838('0x47')](_0x2099da[_0xf838('0x44')],qs[_0xf838('0x49')](_0x3a6642['query'][_0xf838('0x49')]));_0x191530[_0xf838('0x48')]=_0x191530[_0xf838('0x48')][_0xf838('0x5c')]?_0x191530[_0xf838('0x48')]:_0x2099da[_0xf838('0x44')];if(!_0x3a6642['query'][_0xf838('0x67')]('nolimit')){_0x191530['limit']=qs[_0xf838('0x4a')](_0x3a6642['query']['limit']);_0x191530['offset']=qs[_0xf838('0x4b')](_0x3a6642[_0xf838('0x45')][_0xf838('0x4b')]);}_0x191530['order']=qs[_0xf838('0x4d')](_0x3a6642[_0xf838('0x45')][_0xf838('0x4d')]);_0x191530[_0xf838('0x4e')]=qs[_0xf838('0x4f')](_[_0xf838('0x50')](_0x3a6642['query'],_0x2099da[_0xf838('0x4f')]));_0x191530[_0xf838('0x4e')][_0xf838('0x62')]=_0xf57767['id'];if(_0x3a6642[_0xf838('0x45')][_0xf838('0x51')]){_0x191530[_0xf838('0x4e')]=_['merge'](_0x191530['where'],{'$or':_['map'](_0x191530[_0xf838('0x48')],function(_0x4d3ecd){var _0x16a31b={};_0x16a31b[_0x4d3ecd]={'$like':'%'+_0x3a6642[_0xf838('0x45')][_0xf838('0x51')]+'%'};return _0x16a31b;})});}_0x191530=_[_0xf838('0x52')]({},_0x191530,_0x3a6642['options']);return db['CannedAnswer']['count']({'where':_0x191530[_0xf838('0x4e')]})['then'](function(_0x46b97d){_0x283b91[_0xf838('0x2d')]=_0x46b97d;if(_0x3a6642[_0xf838('0x45')][_0xf838('0x54')]){_0x191530[_0xf838('0x55')]=[{'all':!![]}];}return db[_0xf838('0x6c')][_0xf838('0x56')](_0x191530);})[_0xf838('0x33')](function(_0x4717ac){_0x283b91[_0xf838('0x57')]=_0x4717ac;return _0x283b91;});}})['then'](respondWithFilteredResult(_0x169f8f,_0x191530))['catch'](handleError(_0x169f8f,null));};exports[_0xf838('0x6e')]=function(_0x2045d0,_0x2b0dc4,_0x5cca73){return db['MailAccount'][_0xf838('0x5d')]({'where':{'id':_0x2045d0[_0xf838('0x59')]['id']}})[_0xf838('0x33')](handleEntityNotFound(_0x2b0dc4,null))[_0xf838('0x33')](function(_0x242c6f){if(_0x242c6f){return _0x242c6f[_0xf838('0x6e')](_0x2045d0[_0xf838('0x45')][_0xf838('0x6a')]);}})[_0xf838('0x33')](respondWithStatusCode(_0x2b0dc4,null))['catch'](handleError(_0x2b0dc4,null));};exports[_0xf838('0x64')]=function(_0x4279a8,_0x165fa0){var _0x2029f3={'name':_0x4279a8[_0xf838('0x5f')][_0xf838('0x38')],'key':_0x4279a8[_0xf838('0x5f')][_0xf838('0x43')],'email':_0x4279a8[_0xf838('0x5f')][_0xf838('0x6f')],'ListId':_0x4279a8[_0xf838('0x5f')]['ListId'],'active':!_['isNil'](_0x4279a8['body']['active'])?_0x4279a8[_0xf838('0x5f')][_0xf838('0x70')]:!![],'description':_0x4279a8['body']['description']||null,'Imap':{},'Smtp':{}};if(_[_0xf838('0x71')](_0x4279a8['body'][_0xf838('0x72')])){if(_0x4279a8[_0xf838('0x5f')][_0xf838('0x73')]){_0x2029f3['Imap'][_0xf838('0x74')]=_0x2029f3[_0xf838('0x3d')][_0xf838('0x74')]=_0x4279a8[_0xf838('0x5f')][_0xf838('0x75')];_0x2029f3[_0xf838('0x5a')][_0xf838('0x76')]=_0x2029f3[_0xf838('0x3d')][_0xf838('0x77')]=_0x4279a8[_0xf838('0x5f')]['cpassword'];}else{_0x2029f3[_0xf838('0x5a')][_0xf838('0x78')]=_0x2029f3['Smtp'][_0xf838('0x78')]=![];}_0x2029f3[_0xf838('0x5a')][_0xf838('0x79')]=_0x4279a8[_0xf838('0x5f')][_0xf838('0x5a')]['host'];_0x2029f3[_0xf838('0x5a')][_0xf838('0x7a')]=_0x4279a8[_0xf838('0x5f')][_0xf838('0x5a')][_0xf838('0x7a')];_0x2029f3[_0xf838('0x3d')][_0xf838('0x79')]=_0x4279a8[_0xf838('0x5f')]['Smtp'][_0xf838('0x79')];_0x2029f3[_0xf838('0x3d')][_0xf838('0x7a')]=_0x4279a8[_0xf838('0x5f')][_0xf838('0x3d')][_0xf838('0x7a')];}else{_0x2029f3[_0xf838('0x5a')][_0xf838('0x7b')]=_0x2029f3[_0xf838('0x3d')][_0xf838('0x7b')]=_0x4279a8[_0xf838('0x5f')][_0xf838('0x72')];_0x2029f3[_0xf838('0x5a')][_0xf838('0x74')]=_0x2029f3['Smtp'][_0xf838('0x74')]=_0x4279a8[_0xf838('0x5f')][_0xf838('0x75')];_0x2029f3[_0xf838('0x5a')][_0xf838('0x76')]=_0x2029f3[_0xf838('0x3d')][_0xf838('0x77')]=_0x4279a8[_0xf838('0x5f')][_0xf838('0x7c')];}return db[_0xf838('0x40')][_0xf838('0x64')](_0x2029f3,{'include':[{'model':db['MailServerOut'],'as':_0xf838('0x3d')},{'model':db[_0xf838('0x3b')],'as':_0xf838('0x5a')}]})[_0xf838('0x33')](function(_0x4e32c1){var _0x4450df=_0x4279a8['user']['get']({'plain':!![]});if(!_0x4450df)throw new Error(_0xf838('0x7d'));if(_0x4450df[_0xf838('0x7e')]===_0xf838('0x74')){var _0x483e0a=_0x4e32c1[_0xf838('0x34')]({'plain':!![]});return db['UserProfileSection'][_0xf838('0x5d')]({'where':{'name':_0xf838('0x7f'),'userProfileId':_0x4450df[_0xf838('0x80')]},'raw':!![]})['then'](function(_0x3ca3fd){if(_0x3ca3fd&&_0x3ca3fd['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x483e0a[_0xf838('0x38')],'resourceId':_0x483e0a['id'],'type':_0x3ca3fd[_0xf838('0x38')],'sectionId':_0x3ca3fd['id']},{})[_0xf838('0x33')](function(){return _0x4e32c1;});}else{return _0x4e32c1;}})['catch'](function(_0x544284){logger[_0xf838('0x27')](_0xf838('0x81'),_0x544284);throw _0x544284;});}return _0x4e32c1;})[_0xf838('0x33')](respondWithResult(_0x165fa0,0xc9))[_0xf838('0x29')](handleError(_0x165fa0,null));};exports[_0xf838('0x82')]=function(_0x1d4a4a,_0x554131,_0x33b6dc){return db[_0xf838('0x40')][_0xf838('0x66')]({'where':{'id':_0x1d4a4a[_0xf838('0x59')]['id']}})['then'](handleEntityNotFound(_0x554131,null))[_0xf838('0x33')](function(_0x48095c){if(_0x48095c){return _0x48095c['getImap']();}return null;})['then'](respondWithResult(_0x554131,null))[_0xf838('0x29')](handleError(_0x554131,null));};exports[_0xf838('0x83')]=function(_0x42872c,_0x375c58,_0x124b5c){if(_0x42872c['body']['id']){delete _0x42872c[_0xf838('0x5f')]['id'];}return db[_0xf838('0x40')]['find']({'where':{'id':_0x42872c[_0xf838('0x59')]['id']}})[_0xf838('0x33')](handleEntityNotFound(_0x375c58,null))[_0xf838('0x33')](function(_0x26f1fe){if(_0x26f1fe){_0x42872c[_0xf838('0x5f')][_0xf838('0x62')]=_0x26f1fe['id'];return db[_0xf838('0x3b')][_0xf838('0x64')](_0x42872c[_0xf838('0x5f')]);}})[_0xf838('0x33')](respondWithResult(_0x375c58,null))[_0xf838('0x29')](handleError(_0x375c58,null));};exports[_0xf838('0x84')]=function(_0x3685a4,_0x3b06b4,_0x449e48){return db[_0xf838('0x40')][_0xf838('0x66')]({'where':{'id':_0x3685a4[_0xf838('0x59')]['id']}})[_0xf838('0x33')](handleEntityNotFound(_0x3b06b4,null))[_0xf838('0x33')](function(_0x279d13){if(_0x279d13){return _0x279d13[_0xf838('0x85')](null);}return null;})[_0xf838('0x33')](respondWithStatusCode(_0x3b06b4,null))['catch'](handleError(_0x3b06b4,null));};exports['getSmtp']=function(_0x5279bc,_0x14d8b3,_0x1b3347){return db[_0xf838('0x40')]['findOne']({'where':{'id':_0x5279bc[_0xf838('0x59')]['id']}})['then'](handleEntityNotFound(_0x14d8b3,null))[_0xf838('0x33')](function(_0x558249){if(_0x558249){return _0x558249[_0xf838('0x86')]();}return null;})['then'](respondWithResult(_0x14d8b3,null))[_0xf838('0x29')](handleError(_0x14d8b3,null));};exports['addSmtp']=function(_0x1ce1ee,_0x4a2b29,_0x28524f){if(_0x1ce1ee[_0xf838('0x5f')]['id']){delete _0x1ce1ee['body']['id'];}return db[_0xf838('0x40')][_0xf838('0x5d')]({'where':{'id':_0x1ce1ee[_0xf838('0x59')]['id']}})['then'](handleEntityNotFound(_0x4a2b29,null))['then'](function(_0xfa4fd7){if(_0xfa4fd7){_0x1ce1ee[_0xf838('0x5f')][_0xf838('0x62')]=_0xfa4fd7['id'];return db['MailServerOut'][_0xf838('0x64')](_0x1ce1ee[_0xf838('0x5f')]);}})[_0xf838('0x33')](respondWithResult(_0x4a2b29,null))[_0xf838('0x29')](handleError(_0x4a2b29,null));};exports[_0xf838('0x87')]=function(_0x33d4d6,_0x1867a0,_0x2c15f9){return db[_0xf838('0x40')][_0xf838('0x66')]({'where':{'id':_0x33d4d6[_0xf838('0x59')]['id']}})[_0xf838('0x33')](handleEntityNotFound(_0x1867a0,null))[_0xf838('0x33')](function(_0x459279){if(_0x459279){return _0x459279['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x1867a0,null))[_0xf838('0x29')](handleError(_0x1867a0,null));};exports[_0xf838('0x88')]=function(_0x595a15,_0xa4b7ba,_0x1274e8){return db['MailInteraction'][_0xf838('0x5d')]({'where':{'id':_0x595a15[_0xf838('0x59')]['id']}})[_0xf838('0x33')](handleEntityNotFound(_0xa4b7ba,null))[_0xf838('0x33')](function(_0x35868c){if(_0x35868c){return _0x35868c['addInteraction'](_0x595a15[_0xf838('0x5f')][_0xf838('0x6a')],_['omit'](_0x595a15[_0xf838('0x5f')],['ids','id'])||{});}})['then'](respondWithResult(_0xa4b7ba,null))[_0xf838('0x29')](handleError(_0xa4b7ba,null));};exports[_0xf838('0x89')]=function(_0xcaaf8,_0x4e3fdf,_0x253679){var _0x5f3a79={'raw':![],'where':{}};var _0x293d4e={};var _0x4c1945={'count':0x0,'rows':[]};return db[_0xf838('0x40')][_0xf838('0x66')]({'where':{'id':_0xcaaf8[_0xf838('0x59')]['id']}})[_0xf838('0x33')](handleEntityNotFound(_0x4e3fdf,null))['then'](function(_0x567014){if(_0x567014){_0x293d4e[_0xf838('0x44')]=_['keys'](db[_0xf838('0x8a')][_0xf838('0x41')]);_0x293d4e[_0xf838('0x45')]=_[_0xf838('0x46')](_0xcaaf8[_0xf838('0x45')]);_0x293d4e['filters']=_['intersection'](_0x293d4e['model'],_0x293d4e[_0xf838('0x45')]);_0x5f3a79[_0xf838('0x48')]=_['intersection'](_0x293d4e['model'],qs['fields'](_0xcaaf8[_0xf838('0x45')][_0xf838('0x49')]));_0x5f3a79[_0xf838('0x48')]=_0x5f3a79[_0xf838('0x48')][_0xf838('0x5c')]?_0x5f3a79[_0xf838('0x48')]:_0x293d4e[_0xf838('0x44')];if(!_0xcaaf8['query'][_0xf838('0x67')]('nolimit')){_0x5f3a79[_0xf838('0x4a')]=qs[_0xf838('0x4a')](_0xcaaf8[_0xf838('0x45')][_0xf838('0x4a')]);_0x5f3a79['offset']=qs['offset'](_0xcaaf8[_0xf838('0x45')]['offset']);}_0x5f3a79[_0xf838('0x4c')]=qs[_0xf838('0x4d')](_0xcaaf8[_0xf838('0x45')]['sort']);_0x5f3a79[_0xf838('0x4e')]=qs[_0xf838('0x4f')](_[_0xf838('0x50')](_0xcaaf8['query'],_0x293d4e['filters']));_0x5f3a79['where'][_0xf838('0x62')]=_0x567014['id'];if(_0xcaaf8[_0xf838('0x45')][_0xf838('0x51')]){_0x5f3a79[_0xf838('0x4e')]=_[_0xf838('0x52')](_0x5f3a79['where'],{'$or':_[_0xf838('0x3f')](_0x5f3a79[_0xf838('0x48')],function(_0x2fdc0e){var _0xab54ce={};_0xab54ce[_0x2fdc0e]={'$like':'%'+_0xcaaf8['query'][_0xf838('0x51')]+'%'};return _0xab54ce;})});}_0x5f3a79=_[_0xf838('0x52')]({},_0x5f3a79,_0xcaaf8['options']);return db[_0xf838('0x8a')][_0xf838('0x2d')]({'where':_0x5f3a79[_0xf838('0x4e')]})[_0xf838('0x33')](function(_0x3b3c7b){_0x4c1945[_0xf838('0x2d')]=_0x3b3c7b;if(_0xcaaf8[_0xf838('0x45')][_0xf838('0x54')]){_0x5f3a79[_0xf838('0x55')]=[{'model':db[_0xf838('0x8b')],'as':_0xf838('0x8c'),'required':![]},{'model':db[_0xf838('0x8d')],'as':_0xf838('0x8e'),'attributes':[_0xf838('0x38'),_0xf838('0x8f'),'internal'],'required':![]},{'model':db[_0xf838('0x90')],'as':_0xf838('0x91'),'attributes':['id',_0xf838('0x38'),_0xf838('0x92')],'where':_0xcaaf8[_0xf838('0x45')][_0xf838('0x93')]?{'id':_0xcaaf8[_0xf838('0x45')][_0xf838('0x93')]}:undefined,'required':_0xcaaf8[_0xf838('0x45')][_0xf838('0x93')]?!![]:![]}];}return db[_0xf838('0x8a')][_0xf838('0x56')](_0x5f3a79);})[_0xf838('0x33')](function(_0x277499){_0x4c1945[_0xf838('0x57')]=_0x277499;return _0x4c1945;});}})[_0xf838('0x33')](respondWithFilteredResult(_0x4e3fdf,_0x5f3a79))[_0xf838('0x29')](handleError(_0x4e3fdf,null));};exports[_0xf838('0x94')]=function(_0x3ca7f8,_0x52501e,_0x5b60ff){return db[_0xf838('0x40')][_0xf838('0x66')]({'where':{'id':_0x3ca7f8[_0xf838('0x59')]['id']}})[_0xf838('0x33')](handleEntityNotFound(_0x52501e,null))[_0xf838('0x33')](function(_0x560ec2){if(_0x560ec2){return db[_0xf838('0x95')][_0xf838('0x96')](function(_0x4619a8){return db[_0xf838('0x97')][_0xf838('0x32')]({'where':{'MailAccountId':_0x3ca7f8[_0xf838('0x59')]['id']},'transaction':_0x4619a8})[_0xf838('0x33')](function(_0x5de396){var _0x3c1735=_[_0xf838('0x3f')](_0x3ca7f8['body'],function(_0x2f683c){_0x2f683c[_0xf838('0x62')]=_0x3ca7f8[_0xf838('0x59')]['id'];return _0x2f683c;});return db[_0xf838('0x97')][_0xf838('0x98')](_0x3c1735,{'transaction':_0x4619a8});});})['then'](function(){return db[_0xf838('0x97')]['findAndCountAll']({'where':{'MailAccountId':_0x3ca7f8['params']['id']},'order':_0xf838('0x99')});});}})[_0xf838('0x33')](respondWithResult(_0x52501e,null))[_0xf838('0x29')](handleError(_0x52501e,null));};exports[_0xf838('0x9a')]=function(_0xfab5ff,_0x56a486,_0x35733f){var _0x561ae2={};var _0x502162={};var _0xc3dfe3;var _0xe20b41;return db[_0xf838('0x40')][_0xf838('0x66')]({'where':{'id':_0xfab5ff[_0xf838('0x59')]['id']}})[_0xf838('0x33')](handleEntityNotFound(_0x56a486,null))[_0xf838('0x33')](function(_0x391600){if(_0x391600){_0xc3dfe3=_0x391600;_0x502162['model']=_[_0xf838('0x46')](db[_0xf838('0x97')]['rawAttributes']);_0x502162[_0xf838('0x45')]=_[_0xf838('0x46')](_0xfab5ff[_0xf838('0x45')]);_0x502162[_0xf838('0x4f')]=_['intersection'](_0x502162[_0xf838('0x44')],_0x502162['query']);_0x561ae2[_0xf838('0x48')]=_[_0xf838('0x47')](_0x502162[_0xf838('0x44')],qs[_0xf838('0x49')](_0xfab5ff[_0xf838('0x45')][_0xf838('0x49')]));_0x561ae2[_0xf838('0x48')]=_0x561ae2[_0xf838('0x48')][_0xf838('0x5c')]?_0x561ae2[_0xf838('0x48')]:_0x502162[_0xf838('0x44')];_0x561ae2[_0xf838('0x4c')]=qs['sort'](_0xfab5ff[_0xf838('0x45')][_0xf838('0x4d')]);_0x561ae2['where']=qs['filters'](_[_0xf838('0x50')](_0xfab5ff[_0xf838('0x45')],_0x502162['filters']));if(_0xfab5ff[_0xf838('0x45')][_0xf838('0x51')]){_0x561ae2[_0xf838('0x4e')]=_['merge'](_0x561ae2[_0xf838('0x4e')],{'$or':_[_0xf838('0x3f')](_0x561ae2['attributes'],function(_0x3b934c){var _0x33b67b={};_0x33b67b[_0x3b934c]={'$like':'%'+_0xfab5ff[_0xf838('0x45')][_0xf838('0x51')]+'%'};return _0x33b67b;})});}_0x561ae2=_[_0xf838('0x52')]({},_0x561ae2,_0xfab5ff[_0xf838('0x53')]);return _0xc3dfe3[_0xf838('0x9a')](_0x561ae2);}})[_0xf838('0x33')](function(_0x3786e9){if(_0x3786e9){_0xe20b41=_0x3786e9['length'];if(!_0xfab5ff[_0xf838('0x45')]['hasOwnProperty'](_0xf838('0x68'))){_0x561ae2[_0xf838('0x4a')]=qs['limit'](_0xfab5ff[_0xf838('0x45')]['limit']);_0x561ae2[_0xf838('0x4b')]=qs[_0xf838('0x4b')](_0xfab5ff[_0xf838('0x45')][_0xf838('0x4b')]);}return _0xc3dfe3[_0xf838('0x9a')](_0x561ae2);}})[_0xf838('0x33')](function(_0x39df6e){if(_0x39df6e){return _0x39df6e?{'count':_0xe20b41,'rows':_0x39df6e}:null;}})[_0xf838('0x33')](respondWithResult(_0x56a486,null))[_0xf838('0x29')](handleError(_0x56a486,null));};exports[_0xf838('0x9b')]=function(_0x6cfb55,_0x551515,_0x4ad03c){var _0x2f8ada={'raw':!![],'where':{}};var _0x481bb2={};var _0x2046d8={'count':0x0,'rows':[]};return db[_0xf838('0x40')][_0xf838('0x66')]({'where':{'id':_0x6cfb55[_0xf838('0x59')]['id']}})['then'](handleEntityNotFound(_0x551515,null))[_0xf838('0x33')](function(_0x58d1e0){if(_0x58d1e0){_0x481bb2[_0xf838('0x44')]=_['keys'](db['MailMessage']['rawAttributes']);_0x481bb2[_0xf838('0x45')]=_['keys'](_0x6cfb55[_0xf838('0x45')]);_0x481bb2[_0xf838('0x4f')]=_[_0xf838('0x47')](_0x481bb2[_0xf838('0x44')],_0x481bb2['query']);_0x2f8ada[_0xf838('0x48')]=_[_0xf838('0x47')](_0x481bb2['model'],qs[_0xf838('0x49')](_0x6cfb55['query'][_0xf838('0x49')]));_0x2f8ada[_0xf838('0x48')]=_0x2f8ada[_0xf838('0x48')][_0xf838('0x5c')]?_0x2f8ada[_0xf838('0x48')]:_0x481bb2[_0xf838('0x44')];if(!_0x6cfb55[_0xf838('0x45')]['hasOwnProperty']('nolimit')){_0x2f8ada['limit']=qs[_0xf838('0x4a')](_0x6cfb55[_0xf838('0x45')][_0xf838('0x4a')]);_0x2f8ada[_0xf838('0x4b')]=qs['offset'](_0x6cfb55[_0xf838('0x45')][_0xf838('0x4b')]);}_0x2f8ada[_0xf838('0x4c')]=qs['sort'](_0x6cfb55['query'][_0xf838('0x4d')]);_0x2f8ada[_0xf838('0x4e')]=qs[_0xf838('0x4f')](_[_0xf838('0x50')](_0x6cfb55['query'],_0x481bb2['filters']));_0x2f8ada['where']['MailAccountId']=_0x58d1e0['id'];if(_0x6cfb55[_0xf838('0x45')][_0xf838('0x51')]){_0x2f8ada[_0xf838('0x4e')]=_[_0xf838('0x52')](_0x2f8ada[_0xf838('0x4e')],{'$or':_[_0xf838('0x3f')](_0x2f8ada[_0xf838('0x48')],function(_0x22a76e){var _0x46b48c={};_0x46b48c[_0x22a76e]={'$like':'%'+_0x6cfb55[_0xf838('0x45')][_0xf838('0x51')]+'%'};return _0x46b48c;})});}if(_0x6cfb55['query'][_0xf838('0x9c')]){var _0x56db2d=_0x6cfb55[_0xf838('0x45')][_0xf838('0x9c')][_0xf838('0x9d')](',');var _0x1c7460={};_0x1c7460[_0x56db2d[0x0]]={'$gte':moment(_0x56db2d[0x1])[_0xf838('0x9e')](_0xf838('0x9f'))};_0x2f8ada[_0xf838('0x4e')]=_[_0xf838('0x52')](_0x2f8ada[_0xf838('0x4e')],_0x1c7460);}_0x2f8ada=_[_0xf838('0x52')]({},_0x2f8ada,_0x6cfb55['options']);return db[_0xf838('0xa0')][_0xf838('0x2d')]({'where':_0x2f8ada[_0xf838('0x4e')]})[_0xf838('0x33')](function(_0x3f5dfd){_0x2046d8[_0xf838('0x2d')]=_0x3f5dfd;if(_0x6cfb55[_0xf838('0x45')][_0xf838('0x54')]){_0x2f8ada[_0xf838('0x55')]=[{'all':!![]}];}return db[_0xf838('0xa0')]['findAll'](_0x2f8ada);})[_0xf838('0x33')](function(_0x235557){_0x2046d8['rows']=_0x235557;return _0x2046d8;});}})['then'](respondWithFilteredResult(_0x551515,_0x2f8ada))[_0xf838('0x29')](handleError(_0x551515,null));};exports[_0xf838('0x39')]=function(_0x525542,_0x184431,_0x45bc5b){var _0x1d94a3,_0x57cdf5={},_0x59ab76;if(_0x525542[_0xf838('0x5f')]['to']){_0x59ab76=_0x525542['body']['to']['split'](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x525542[_0xf838('0x59')]['id']},'include':[{'model':db[_0xf838('0xa1')],'as':_0xf838('0xa2'),'include':[{'model':db['CmContact'],'as':_0xf838('0xa3'),'where':{'email':_0x59ab76},'limit':0x1,'order':[['updatedAt',_0xf838('0xa4')]]}]},{'model':db[_0xf838('0x3c')],'as':_0xf838('0x3d'),'raw':!![]}]})[_0xf838('0x33')](handleEntityNotFound(_0x184431,null))['then'](function(_0x479a8f){if(_0x479a8f){_0x1d94a3=_0x479a8f;if(_0x479a8f[_0xf838('0x3d')]){if(_[_0xf838('0x71')](_0x525542[_0xf838('0x5f')]['from'])){_0x525542[_0xf838('0x5f')][_0xf838('0xa5')]=util[_0xf838('0x9e')]('%s\x20<%s>',_0x479a8f[_0xf838('0x38')],_0x479a8f['email']||_0x479a8f[_0xf838('0x3d')]['user']);}if(_0x525542[_0xf838('0x5f')][_0xf838('0xa6')]&&_0x525542[_0xf838('0x5f')][_0xf838('0xa6')][_0xf838('0x5c')]){for(var _0x51cd12=0x0;_0x51cd12<_0x525542[_0xf838('0x5f')][_0xf838('0xa6')][_0xf838('0x5c')];_0x51cd12+=0x1){_0x525542[_0xf838('0x5f')][_0xf838('0xa6')][_0x51cd12]={'filename':_0x525542['body']['attachments'][_0x51cd12][_0xf838('0x38')],'path':path[_0xf838('0xa7')](config[_0xf838('0xa8')],_0xf838('0xa9'),_0x525542[_0xf838('0x5f')][_0xf838('0xa6')][_0x51cd12]['basename'])};}}var _0xc63ffc={'tls':{'rejectUnauthorized':![]}};if(_[_0xf838('0x71')](_0x479a8f[_0xf838('0x3d')][_0xf838('0x7b')])){if(_0x479a8f['Smtp'][_0xf838('0x78')]){_0xc63ffc[_0xf838('0xaa')]={'user':_0x479a8f['Smtp'][_0xf838('0x74')],'pass':_0x479a8f[_0xf838('0x3d')][_0xf838('0x77')]};}_0xc63ffc[_0xf838('0x79')]=_0x479a8f[_0xf838('0x3d')][_0xf838('0x79')];_0xc63ffc[_0xf838('0x7a')]=_0x479a8f['Smtp'][_0xf838('0x7a')];_0xc63ffc[_0xf838('0xab')]=_0x479a8f[_0xf838('0x3d')][_0xf838('0xab')];}else{_0xc63ffc['service']=_0x479a8f['Smtp'][_0xf838('0x7b')];_0xc63ffc[_0xf838('0xaa')]={'user':_0x479a8f[_0xf838('0x3d')][_0xf838('0x74')],'pass':_0x479a8f[_0xf838('0x3d')][_0xf838('0x77')]};}return respondWithRpcPromise(_0xf838('0xac'),_0xf838('0xad'),{'account':_0xc63ffc,'message':_0x525542[_0xf838('0x5f')]});}else{throw new Error(_0xf838('0xae'));}}})[_0xf838('0x33')](function(_0x354054){if(_0x354054){_0x57cdf5=_0x354054;if(_0x1d94a3['List']){if(_0x1d94a3[_0xf838('0xa2')][_0xf838('0xa3')][_0xf838('0x5c')]){return _0x1d94a3['List'][_0xf838('0xa3')][0x0];}else{return db[_0xf838('0x8b')]['create'](_['defaults'](_0x525542[_0xf838('0x5f')],{'firstName':_0x525542[_0xf838('0x5f')]['to'],'email':_0x525542['body']['to'],'phone':_0x525542[_0xf838('0x5f')]['to'],'ListId':_0x1d94a3[_0xf838('0xaf')]}));}}else{throw new Error(_0xf838('0xae'));}}})[_0xf838('0x33')](function(_0x3b1745){if(_0x3b1745){var _0x1919ed={'UserId':_0x525542[_0xf838('0x74')]['id'],'ContactId':_0x3b1745['id'],'MailAccountId':_0x1d94a3['id'],'inReplyTo':_0x57cdf5[_0xf838('0xb0')],'to':_0x525542[_0xf838('0x5f')]['from'],'cc':_0x525542[_0xf838('0x5f')]['cc'],'subject':_0x525542['body'][_0xf838('0xb1')],'attach':_0x525542['body'][_0xf838('0xb2')],'firstMsgDirection':_0xf838('0xb3'),'lastMsgAt':moment()[_0xf838('0x9e')](_0xf838('0x9f')),'lastMsgDirection':_0xf838('0xb3'),'lastMsgBody':_0x525542[_0xf838('0x5f')][_0xf838('0x5f')],'Messages':[_['merge'](_0x525542[_0xf838('0x5f')],{'messageId':_0x57cdf5[_0xf838('0xb0')],'sentAt':moment()['format'](_0xf838('0x9f')),'read':!![],'MailAccountId':_0x1d94a3['id'],'UserId':_0x525542['user']['id'],'ContactId':_0x3b1745['id']})]};if(_0x525542[_0xf838('0x5f')][_0xf838('0xb4')]){_0x1919ed=_[_0xf838('0x52')](_0x1919ed,_0x525542[_0xf838('0x5f')][_0xf838('0xb4')]);}return db[_0xf838('0x8a')][_0xf838('0x64')](_0x1919ed,{'include':[{'model':db[_0xf838('0xa0')],'as':_0xf838('0xb5')}]});}})[_0xf838('0x33')](respondWithResult(_0x184431,null))[_0xf838('0x29')](handleError(_0x184431,null));};exports[_0xf838('0xb6')]=function(_0x2aff94,_0x570cf9,_0x383d96){return db[_0xf838('0x40')][_0xf838('0x5d')]({'where':{'id':_0x2aff94[_0xf838('0x59')]['id']},'include':[{'model':db[_0xf838('0x3c')],'as':'Smtp','raw':!![]}]})[_0xf838('0x33')](handleEntityNotFound(_0x570cf9,null))[_0xf838('0x33')](function(_0x29647e){if(_0x29647e&&_0x29647e[_0xf838('0x3d')]){var _0x45120e={'id':_0x29647e['id'],'tls':{'rejectUnauthorized':![]}};if(_0x29647e['Smtp'][_0xf838('0x7b')]){_0x45120e[_0xf838('0x7b')]=_0x29647e[_0xf838('0x3d')][_0xf838('0x7b')];}else{_0x45120e[_0xf838('0x79')]=_0x29647e[_0xf838('0x3d')]['host'];_0x45120e[_0xf838('0x7a')]=_0x29647e[_0xf838('0x3d')][_0xf838('0x7a')];_0x45120e[_0xf838('0xab')]=_0x29647e['Smtp'][_0xf838('0xab')];}if(_0x29647e['Smtp']['authentication']){_0x45120e[_0xf838('0xaa')]={'user':_0x29647e['Smtp'][_0xf838('0x74')],'pass':_0x29647e[_0xf838('0x3d')][_0xf838('0x77')]};}return respondWithRpcPromise(_0xf838('0xb7'),'verifySmtp',{'account':_0x45120e});}})['then'](respondWithResult(_0x570cf9,null))[_0xf838('0x29')](handleError(_0x570cf9,null));};exports[_0xf838('0x32')]=function(_0x5519a7,_0x2d55c2){return db[_0xf838('0x40')][_0xf838('0x5d')]({'where':{'id':_0x5519a7['params']['id']}})[_0xf838('0x33')](handleEntityNotFound(_0x2d55c2,null))[_0xf838('0x33')](function(_0x1a6132){if(_0x1a6132&&_0x1a6132[_0xf838('0x7b')]){throw new db[(_0xf838('0xb8'))]['ValidationError'](_0xf838('0xb9'));}return _0x1a6132;})[_0xf838('0x33')](removeEntity(_0x2d55c2,null))['catch'](handleError(_0x2d55c2,null));};exports['addAgents']=function(_0x143f9c,_0x4dd151,_0x3a42e3){return db[_0xf838('0x40')][_0xf838('0x5d')]({'where':{'id':_0x143f9c[_0xf838('0x59')]['id']}})['then'](handleEntityNotFound(_0x4dd151,null))[_0xf838('0x33')](function(_0x279b54){if(_0x279b54){return _0x279b54[_0xf838('0xba')](_0x143f9c['body']['ids'],_[_0xf838('0xbb')](_0x143f9c[_0xf838('0x5f')],['ids','id'])||{})[_0xf838('0xbc')](function(_0x23aa04){for(var _0x2469dc=0x0;_0x2469dc<_0x143f9c[_0xf838('0x5f')][_0xf838('0x6a')][_0xf838('0x5c')];_0x2469dc+=0x1){socket['emit'](_0xf838('0xbd'),{'UserId':_0x143f9c['body'][_0xf838('0x6a')][_0x2469dc],'MailAccountId':_0x143f9c[_0xf838('0x59')]['id']});}return _0x23aa04;});}})['then'](respondWithResult(_0x4dd151,null))[_0xf838('0x29')](handleError(_0x4dd151,null));};exports[_0xf838('0xbe')]=function(_0x4d7c27,_0x1d392a,_0x2f143a){return db['MailAccount'][_0xf838('0x5d')]({'where':{'id':_0x4d7c27[_0xf838('0x59')]['id']}})[_0xf838('0x33')](handleEntityNotFound(_0x1d392a,null))[_0xf838('0x33')](function(_0x423d6e){if(_0x423d6e){return _0x423d6e[_0xf838('0xbe')](_0x4d7c27[_0xf838('0x45')][_0xf838('0x6a')])[_0xf838('0x33')](function(){if(_[_0xf838('0xbf')](_0x4d7c27[_0xf838('0x45')]['ids'])){for(var _0x1b45ae=0x0;_0x1b45ae<_0x4d7c27[_0xf838('0x45')][_0xf838('0x6a')][_0xf838('0x5c')];_0x1b45ae+=0x1){socket[_0xf838('0xc0')](_0xf838('0xc1'),{'UserId':Number(_0x4d7c27[_0xf838('0x45')][_0xf838('0x6a')][_0x1b45ae]),'MailAccountId':Number(_0x4d7c27[_0xf838('0x59')]['id'])});}}else{socket['emit'](_0xf838('0xc1'),{'UserId':Number(_0x4d7c27[_0xf838('0x45')][_0xf838('0x6a')]),'MailAccountId':Number(_0x4d7c27[_0xf838('0x59')]['id'])});}});}})[_0xf838('0x33')](respondWithStatusCode(_0x1d392a,null))['catch'](handleError(_0x1d392a,null));};exports['getAgents']=function(_0x589c59,_0x10718a,_0x41027e){var _0x4b6986={};var _0x58b453={};var _0x14a48c;var _0x4a6bbc;return db[_0xf838('0x40')]['findOne']({'where':{'id':_0x589c59[_0xf838('0x59')]['id']}})['then'](handleEntityNotFound(_0x10718a,null))[_0xf838('0x33')](function(_0x3b4b44){if(_0x3b4b44){_0x14a48c=_0x3b4b44;_0x58b453[_0xf838('0x44')]=_[_0xf838('0x46')](db[_0xf838('0x8d')][_0xf838('0x41')]);_0x58b453[_0xf838('0x45')]=_[_0xf838('0x46')](_0x589c59[_0xf838('0x45')]);_0x58b453[_0xf838('0x4f')]=_[_0xf838('0x47')](_0x58b453[_0xf838('0x44')],_0x58b453[_0xf838('0x45')]);_0x4b6986[_0xf838('0x48')]=_[_0xf838('0x47')](_0x58b453[_0xf838('0x44')],qs[_0xf838('0x49')](_0x589c59[_0xf838('0x45')]['fields']));_0x4b6986[_0xf838('0x48')]=_0x4b6986[_0xf838('0x48')]['length']?_0x4b6986[_0xf838('0x48')]:_0x58b453[_0xf838('0x44')];_0x4b6986[_0xf838('0x4c')]=qs[_0xf838('0x4d')](_0x589c59[_0xf838('0x45')]['sort']);_0x4b6986[_0xf838('0x4e')]=qs[_0xf838('0x4f')](_['pick'](_0x589c59[_0xf838('0x45')],_0x58b453[_0xf838('0x4f')]));if(_0x589c59[_0xf838('0x45')][_0xf838('0x51')]){_0x4b6986[_0xf838('0x4e')]=_[_0xf838('0x52')](_0x4b6986['where'],{'$or':_['map'](_0x4b6986[_0xf838('0x48')],function(_0x123e9c){var _0x45af1b={};_0x45af1b[_0x123e9c]={'$like':'%'+_0x589c59[_0xf838('0x45')][_0xf838('0x51')]+'%'};return _0x45af1b;})});}_0x4b6986=_[_0xf838('0x52')]({},_0x4b6986,_0x589c59[_0xf838('0x53')]);return _0x14a48c[_0xf838('0xc2')](_0x4b6986);}})[_0xf838('0x33')](function(_0x45f863){if(_0x45f863){_0x4a6bbc=_0x45f863['length'];if(!_0x589c59[_0xf838('0x45')][_0xf838('0x67')]('nolimit')){_0x4b6986[_0xf838('0x4a')]=qs[_0xf838('0x4a')](_0x589c59['query'][_0xf838('0x4a')]);_0x4b6986[_0xf838('0x4b')]=qs[_0xf838('0x4b')](_0x589c59[_0xf838('0x45')][_0xf838('0x4b')]);}return _0x14a48c[_0xf838('0xc2')](_0x4b6986);}})['then'](function(_0x1cf0a4){if(_0x1cf0a4){return _0x1cf0a4?{'count':_0x4a6bbc,'rows':_0x1cf0a4}:null;}})[_0xf838('0x33')](respondWithResult(_0x10718a,null))[_0xf838('0x29')](handleError(_0x10718a,null));}; \ No newline at end of file +var _0xfcda=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','show','MailServerOut','Smtp','includeAll','find','body','describe','params','MailAccountId','Disposition','create','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','key','isNil','active','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','setImap','getSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','List','Contacts','DESC','from','format','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','auth','List\x20not\x20found','defaults','messageId','subject','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','secure','VerifySmtp','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','MailAccounts','UserProfileResource','end','stack','name','send','index','MailServerIn','Imap','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection'];(function(_0xaec7d,_0x44dce6){var _0x54a0ce=function(_0x1e0aba){while(--_0x1e0aba){_0xaec7d['push'](_0xaec7d['shift']());}};_0x54a0ce(++_0x44dce6);}(_0xfcda,0x132));var _0xafcd=function(_0x1f269d,_0x23cc4c){_0x1f269d=_0x1f269d-0x0;var _0x4900b0=_0xfcda[_0x1f269d];return _0x4900b0;};'use strict';var pdf=require(_0xafcd('0x0'));var emlformat=require(_0xafcd('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xafcd('0x2'));var jsonpatch=require(_0xafcd('0x3'));var rp=require(_0xafcd('0x4'));var moment=require(_0xafcd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xafcd('0x6'));var util=require(_0xafcd('0x7'));var path=require(_0xafcd('0x8'));var sox=require('sox');var csv=require(_0xafcd('0x9'));var ejs=require(_0xafcd('0xa'));var fs=require('fs');var _=require(_0xafcd('0xb'));var squel=require(_0xafcd('0xc'));var crypto=require('crypto');var jsforce=require(_0xafcd('0xd'));var deskjs=require(_0xafcd('0xe'));var toCsv=require(_0xafcd('0x9'));var querystring=require(_0xafcd('0xf'));var Papa=require(_0xafcd('0x10'));var Redis=require('ioredis');var authService=require(_0xafcd('0x11'));var qs=require(_0xafcd('0x12'));var as=require(_0xafcd('0x13'));var hardwareService=require(_0xafcd('0x14'));var logger=require(_0xafcd('0x15'))(_0xafcd('0x16'));var utils=require(_0xafcd('0x17'));var config=require(_0xafcd('0x18'));var db=require(_0xafcd('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xafcd('0x1a'),'port':0x18eb});var socket=require(_0xafcd('0x1b'))(new Redis(config['redis']));require(_0xafcd('0x1c'))[_0xafcd('0x1d')](socket);var jayson=require(_0xafcd('0x1e'));var client=jayson[_0xafcd('0x1f')][_0xafcd('0x20')]({'port':0x232b});function checkPasswordPattern(_0x625f23,_0x80e58,_0xd4f04){if(_0xd4f04){var _0x400102=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x400102['test'](_0x80e58)){return _0x625f23;}else{throw new db[(_0xafcd('0x21'))][(_0xafcd('0x22'))](_0xafcd('0x23'));}}else{return _0x625f23;}}function respondWithRpcPromise(_0x1a42b7,_0x12e8fd,_0x3c34cf,_0x4044cb){return new BPromise(function(_0x572e06,_0x17c451){var _0x1b93e2=_0x4044cb||client;return _0x1b93e2[_0xafcd('0x24')](_0x1a42b7,_0x3c34cf)[_0xafcd('0x25')](function(_0x2adc2a){logger['info'](_0xafcd('0x26'),_0x12e8fd,_0xafcd('0x27'));logger[_0xafcd('0x28')](_0xafcd('0x29'),_0x12e8fd,_0xafcd('0x27'),JSON[_0xafcd('0x2a')](_0x2adc2a));if(_0x2adc2a[_0xafcd('0x2b')]){if(_0x2adc2a[_0xafcd('0x2b')][_0xafcd('0x2c')]===0x1f4){logger[_0xafcd('0x2b')]('MailAccount,\x20%s,\x20%s',_0x12e8fd,_0x2adc2a[_0xafcd('0x2b')][_0xafcd('0x2d')]);return _0x17c451(_0x2adc2a[_0xafcd('0x2b')][_0xafcd('0x2d')]);}logger[_0xafcd('0x2b')](_0xafcd('0x26'),_0x12e8fd,_0x2adc2a[_0xafcd('0x2b')]['message']);return _0x572e06(_0x2adc2a[_0xafcd('0x2b')][_0xafcd('0x2d')]);}else{logger[_0xafcd('0x2e')](_0xafcd('0x26'),_0x12e8fd,'request\x20sent');_0x572e06(_0x2adc2a[_0xafcd('0x2f')][_0xafcd('0x2d')]);}})[_0xafcd('0x30')](function(_0x1e9244){logger[_0xafcd('0x2b')]('MailAccount,\x20%s,\x20%s',_0x12e8fd,_0x1e9244);_0x17c451(_0x1e9244);});});}function respondWithStatusCode(_0x3d479c,_0xd9ee27){_0xd9ee27=_0xd9ee27||0xcc;return function(_0x287785){if(_0x287785){return _0x3d479c[_0xafcd('0x31')](_0xd9ee27);}return _0x3d479c[_0xafcd('0x32')](_0xd9ee27)['end']();};}function respondWithResult(_0x538dd8,_0x52433a){_0x52433a=_0x52433a||0xc8;return function(_0x5bd4e8){if(_0x5bd4e8){return _0x538dd8[_0xafcd('0x32')](_0x52433a)[_0xafcd('0x33')](_0x5bd4e8);}};}function respondWithFilteredResult(_0x2614ef,_0x59a9d3){return function(_0x21eec6){if(_0x21eec6){var _0x5a855d=_0x21eec6[_0xafcd('0x34')],_0x5e0c9c=_0x59a9d3[_0xafcd('0x35')],_0x5e8a67=_0x59a9d3[_0xafcd('0x35')]+_0x59a9d3[_0xafcd('0x36')],_0x479223;if(_0x5e8a67>=_0x5a855d){_0x5e8a67=_0x5a855d;_0x479223=0xc8;}else{_0x479223=0xce;}_0x2614ef[_0xafcd('0x32')](_0x479223);return _0x2614ef[_0xafcd('0x37')](_0xafcd('0x38'),_0x5e0c9c+'-'+_0x5e8a67+'/'+_0x5a855d)[_0xafcd('0x33')](_0x21eec6);}return null;};}function patchUpdates(_0x10171a){return function(_0x594c34){try{jsonpatch[_0xafcd('0x39')](_0x594c34,_0x10171a,!![]);}catch(_0x32cc92){return BPromise['reject'](_0x32cc92);}return _0x594c34[_0xafcd('0x3a')]();};}function saveUpdates(_0x3b8260,_0x51e63f){return function(_0x7c5491){if(_0x7c5491){return _0x7c5491[_0xafcd('0x3b')](_0x3b8260)[_0xafcd('0x25')](function(_0x3c8b87){return _0x3c8b87;});}return null;};}function removeEntity(_0x3eafea,_0x185247){return function(_0x2f61d2){if(_0x2f61d2){return _0x2f61d2[_0xafcd('0x3c')]()[_0xafcd('0x25')](function(){var _0x5cdcd4=_0x2f61d2['get']({'plain':!![]});var _0x359cbd=_0xafcd('0x3d');return db[_0xafcd('0x3e')][_0xafcd('0x3c')]({'where':{'type':_0x359cbd,'resourceId':_0x5cdcd4['id']}})['then'](function(){return _0x2f61d2;});})[_0xafcd('0x25')](function(){_0x3eafea[_0xafcd('0x32')](0xcc)[_0xafcd('0x3f')]();});}};}function handleEntityNotFound(_0x73cafd,_0xf8a939){return function(_0x330a4d){if(!_0x330a4d){_0x73cafd[_0xafcd('0x31')](0x194);}return _0x330a4d;};}function handleError(_0x847b5e,_0x4b32cf){_0x4b32cf=_0x4b32cf||0x1f4;return function(_0x3fe288){logger[_0xafcd('0x2b')](_0x3fe288[_0xafcd('0x40')]);if(_0x3fe288['name']){delete _0x3fe288[_0xafcd('0x41')];}_0x847b5e[_0xafcd('0x32')](_0x4b32cf)[_0xafcd('0x42')](_0x3fe288);};}exports[_0xafcd('0x43')]=function(_0xabaa29,_0x33f157){var _0x272649={'include':[{'model':db[_0xafcd('0x44')],'as':_0xafcd('0x45')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xafcd('0x46')],'as':_0xafcd('0x47')}]},_0x18c7d9={},_0x681ee1={'count':0x0,'rows':[]};var _0x5a6b1e=_[_0xafcd('0x48')](db[_0xafcd('0x49')][_0xafcd('0x4a')],function(_0x15675e){return{'name':_0x15675e[_0xafcd('0x4b')],'type':_0x15675e[_0xafcd('0x4c')]['key']};});_0x18c7d9[_0xafcd('0x4d')]=_[_0xafcd('0x48')](_0x5a6b1e,_0xafcd('0x41'));_0x18c7d9[_0xafcd('0x4e')]=_[_0xafcd('0x4f')](_0xabaa29[_0xafcd('0x4e')]);_0x18c7d9[_0xafcd('0x50')]=_[_0xafcd('0x51')](_0x18c7d9[_0xafcd('0x4d')],_0x18c7d9[_0xafcd('0x4e')]);_0x272649[_0xafcd('0x52')]=_[_0xafcd('0x51')](_0x18c7d9[_0xafcd('0x4d')],qs[_0xafcd('0x53')](_0xabaa29['query'][_0xafcd('0x53')]));_0x272649[_0xafcd('0x52')]=_0x272649[_0xafcd('0x52')][_0xafcd('0x54')]?_0x272649[_0xafcd('0x52')]:_0x18c7d9[_0xafcd('0x4d')];if(!_0xabaa29[_0xafcd('0x4e')][_0xafcd('0x55')](_0xafcd('0x56'))){_0x272649[_0xafcd('0x36')]=qs['limit'](_0xabaa29['query']['limit']);_0x272649[_0xafcd('0x35')]=qs[_0xafcd('0x35')](_0xabaa29[_0xafcd('0x4e')][_0xafcd('0x35')]);}_0x272649[_0xafcd('0x57')]=qs[_0xafcd('0x58')](_0xabaa29[_0xafcd('0x4e')][_0xafcd('0x58')]);_0x272649[_0xafcd('0x59')]=qs[_0xafcd('0x50')](_[_0xafcd('0x5a')](_0xabaa29[_0xafcd('0x4e')],_0x18c7d9['filters']));if(_0xabaa29[_0xafcd('0x4e')][_0xafcd('0x5b')]){_0x272649['where']=_['merge'](_0x272649['where'],{'$or':_[_0xafcd('0x48')](_0x5a6b1e,function(_0x4297fc){if(_0x4297fc[_0xafcd('0x4c')]!==_0xafcd('0x5c')){var _0xfef97d={};_0xfef97d[_0x4297fc[_0xafcd('0x41')]]={'$like':'%'+_0xabaa29[_0xafcd('0x4e')][_0xafcd('0x5b')]+'%'};return _0xfef97d;}})});}_0x272649=_[_0xafcd('0x5d')]({},_0x272649,_0xabaa29[_0xafcd('0x5e')]);var _0x541e8c={'where':_0x272649[_0xafcd('0x59')]};return db['MailAccount'][_0xafcd('0x34')](_0x541e8c)['then'](function(_0x4a5650){_0x681ee1[_0xafcd('0x34')]=_0x4a5650;if(_0xabaa29[_0xafcd('0x4e')]['includeAll']){_0x272649[_0xafcd('0x5f')]=[{'all':!![]}];}return db[_0xafcd('0x49')]['findAll'](_0x272649);})[_0xafcd('0x25')](function(_0x456217){_0x681ee1[_0xafcd('0x60')]=_0x456217;return _0x681ee1;})[_0xafcd('0x25')](respondWithFilteredResult(_0x33f157,_0x272649))[_0xafcd('0x30')](handleError(_0x33f157,null));};exports[_0xafcd('0x61')]=function(_0x5558e0,_0x5ccd61){var _0xe544e3={'raw':![],'where':{'id':_0x5558e0['params']['id']},'include':[{'model':db[_0xafcd('0x44')],'as':_0xafcd('0x45')},{'model':db[_0xafcd('0x62')],'as':_0xafcd('0x63')},{'model':db[_0xafcd('0x46')],'as':_0xafcd('0x47')}]},_0x1e93c9={};_0x1e93c9[_0xafcd('0x4d')]=_[_0xafcd('0x4f')](db[_0xafcd('0x49')][_0xafcd('0x4a')]);_0x1e93c9[_0xafcd('0x4e')]=_['keys'](_0x5558e0[_0xafcd('0x4e')]);_0x1e93c9[_0xafcd('0x50')]=_[_0xafcd('0x51')](_0x1e93c9['model'],_0x1e93c9[_0xafcd('0x4e')]);_0xe544e3[_0xafcd('0x52')]=_[_0xafcd('0x51')](_0x1e93c9['model'],qs[_0xafcd('0x53')](_0x5558e0[_0xafcd('0x4e')][_0xafcd('0x53')]));_0xe544e3['attributes']=_0xe544e3['attributes'][_0xafcd('0x54')]?_0xe544e3[_0xafcd('0x52')]:_0x1e93c9[_0xafcd('0x4d')];if(_0x5558e0[_0xafcd('0x4e')][_0xafcd('0x64')]){_0xe544e3[_0xafcd('0x5f')]=[{'all':!![]}];}_0xe544e3=_[_0xafcd('0x5d')]({},_0xe544e3,_0x5558e0[_0xafcd('0x5e')]);return db[_0xafcd('0x49')][_0xafcd('0x65')](_0xe544e3)[_0xafcd('0x25')](handleEntityNotFound(_0x5ccd61,null))['then'](respondWithResult(_0x5ccd61,null))['catch'](handleError(_0x5ccd61,null));};exports['update']=function(_0x592edc,_0x2c2dcb){if(_0x592edc[_0xafcd('0x66')]['id']){delete _0x592edc[_0xafcd('0x66')]['id'];}return db[_0xafcd('0x49')][_0xafcd('0x65')]({'where':{'id':_0x592edc['params']['id']},'include':[{'model':db[_0xafcd('0x44')],'as':_0xafcd('0x45')},{'model':db[_0xafcd('0x62')],'as':_0xafcd('0x63')},{'model':db[_0xafcd('0x46')],'as':_0xafcd('0x47')}]})[_0xafcd('0x25')](handleEntityNotFound(_0x2c2dcb,null))[_0xafcd('0x25')](saveUpdates(_0x592edc[_0xafcd('0x66')],null))[_0xafcd('0x25')](function(_0x4dd0bc){if(_0x4dd0bc&&_0x592edc[_0xafcd('0x66')][_0xafcd('0x45')]){return db[_0xafcd('0x44')][_0xafcd('0x3b')](_0x592edc[_0xafcd('0x66')][_0xafcd('0x45')],{'where':{'MailAccountId':_0x4dd0bc['id']}})[_0xafcd('0x25')](function(){return _0x4dd0bc;});}return _0x4dd0bc;})[_0xafcd('0x25')](function(_0x5766e4){if(_0x5766e4&&_0x592edc[_0xafcd('0x66')][_0xafcd('0x63')]){return db[_0xafcd('0x62')]['update'](_0x592edc['body'][_0xafcd('0x63')],{'where':{'MailAccountId':_0x5766e4['id']}})[_0xafcd('0x25')](function(){return _0x5766e4;});}return _0x5766e4;})[_0xafcd('0x25')](respondWithResult(_0x2c2dcb,null))[_0xafcd('0x30')](handleError(_0x2c2dcb,null));};exports['describe']=function(_0x1ca4c7,_0x37e245){return db[_0xafcd('0x49')][_0xafcd('0x67')]()[_0xafcd('0x25')](respondWithResult(_0x37e245,null))[_0xafcd('0x30')](handleError(_0x37e245,null));};exports['addDisposition']=function(_0x1f8e07,_0x333c3d,_0xa5220e){if(_0x1f8e07[_0xafcd('0x66')]['id']){delete _0x1f8e07[_0xafcd('0x66')]['id'];}return db[_0xafcd('0x49')][_0xafcd('0x65')]({'where':{'id':_0x1f8e07[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x333c3d,null))[_0xafcd('0x25')](function(_0x47cf6e){if(_0x47cf6e){_0x1f8e07[_0xafcd('0x66')][_0xafcd('0x69')]=_0x47cf6e['id'];return db[_0xafcd('0x6a')][_0xafcd('0x6b')](_0x1f8e07[_0xafcd('0x66')]);}})['then'](respondWithResult(_0x333c3d,null))[_0xafcd('0x30')](handleError(_0x333c3d,null));};exports['getDispositions']=function(_0xc4ab7b,_0x58506d,_0x2cdfcc){var _0x480b07={'raw':![],'where':{}};var _0x5d58ae={};var _0x1d996c={'count':0x0,'rows':[]};return db[_0xafcd('0x49')][_0xafcd('0x6c')]({'where':{'id':_0xc4ab7b[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x58506d,null))[_0xafcd('0x25')](function(_0x44d4c6){if(_0x44d4c6){_0x5d58ae[_0xafcd('0x4d')]=_[_0xafcd('0x4f')](db[_0xafcd('0x6a')][_0xafcd('0x4a')]);_0x5d58ae[_0xafcd('0x4e')]=_[_0xafcd('0x4f')](_0xc4ab7b[_0xafcd('0x4e')]);_0x5d58ae[_0xafcd('0x50')]=_[_0xafcd('0x51')](_0x5d58ae[_0xafcd('0x4d')],_0x5d58ae[_0xafcd('0x4e')]);_0x480b07[_0xafcd('0x52')]=_['intersection'](_0x5d58ae[_0xafcd('0x4d')],qs[_0xafcd('0x53')](_0xc4ab7b['query']['fields']));_0x480b07[_0xafcd('0x52')]=_0x480b07[_0xafcd('0x52')][_0xafcd('0x54')]?_0x480b07[_0xafcd('0x52')]:_0x5d58ae[_0xafcd('0x4d')];if(!_0xc4ab7b[_0xafcd('0x4e')][_0xafcd('0x55')](_0xafcd('0x56'))){_0x480b07[_0xafcd('0x36')]=qs[_0xafcd('0x36')](_0xc4ab7b['query']['limit']);_0x480b07['offset']=qs[_0xafcd('0x35')](_0xc4ab7b[_0xafcd('0x4e')][_0xafcd('0x35')]);}_0x480b07['order']=qs[_0xafcd('0x58')](_0xc4ab7b[_0xafcd('0x4e')][_0xafcd('0x58')]);_0x480b07[_0xafcd('0x59')]=qs['filters'](_['pick'](_0xc4ab7b['query'],_0x5d58ae[_0xafcd('0x50')]));_0x480b07[_0xafcd('0x59')][_0xafcd('0x69')]=_0x44d4c6['id'];if(_0xc4ab7b[_0xafcd('0x4e')][_0xafcd('0x5b')]){_0x480b07[_0xafcd('0x59')]=_[_0xafcd('0x5d')](_0x480b07[_0xafcd('0x59')],{'$or':_[_0xafcd('0x48')](_0x480b07[_0xafcd('0x52')],function(_0x33c88b){var _0x11f412={};_0x11f412[_0x33c88b]={'$like':'%'+_0xc4ab7b[_0xafcd('0x4e')][_0xafcd('0x5b')]+'%'};return _0x11f412;})});}_0x480b07=_[_0xafcd('0x5d')]({},_0x480b07,_0xc4ab7b[_0xafcd('0x5e')]);return db['Disposition'][_0xafcd('0x34')]({'where':_0x480b07[_0xafcd('0x59')]})[_0xafcd('0x25')](function(_0xa13586){_0x1d996c[_0xafcd('0x34')]=_0xa13586;if(_0xc4ab7b[_0xafcd('0x4e')][_0xafcd('0x64')]){_0x480b07[_0xafcd('0x5f')]=[{'all':!![]}];}return db['Disposition'][_0xafcd('0x6d')](_0x480b07);})['then'](function(_0x36e66f){_0x1d996c[_0xafcd('0x60')]=_0x36e66f;return _0x1d996c;});}})[_0xafcd('0x25')](respondWithFilteredResult(_0x58506d,_0x480b07))[_0xafcd('0x30')](handleError(_0x58506d,null));};exports[_0xafcd('0x6e')]=function(_0x238229,_0x32e5b4,_0x552d08){return db['MailAccount'][_0xafcd('0x65')]({'where':{'id':_0x238229[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x32e5b4,null))[_0xafcd('0x25')](function(_0x4c0714){if(_0x4c0714){return _0x4c0714[_0xafcd('0x6e')](_0x238229[_0xafcd('0x4e')][_0xafcd('0x6f')]);}})['then'](respondWithStatusCode(_0x32e5b4,null))['catch'](handleError(_0x32e5b4,null));};exports[_0xafcd('0x70')]=function(_0x7030bb,_0x145a17,_0x2ebe12){if(_0x7030bb[_0xafcd('0x66')]['id']){delete _0x7030bb[_0xafcd('0x66')]['id'];}return db[_0xafcd('0x49')][_0xafcd('0x65')]({'where':{'id':_0x7030bb[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x145a17,null))[_0xafcd('0x25')](function(_0x3dd002){if(_0x3dd002){_0x7030bb[_0xafcd('0x66')][_0xafcd('0x69')]=_0x3dd002['id'];return db[_0xafcd('0x71')][_0xafcd('0x6b')](_0x7030bb[_0xafcd('0x66')]);}})[_0xafcd('0x25')](respondWithResult(_0x145a17,null))[_0xafcd('0x30')](handleError(_0x145a17,null));};exports[_0xafcd('0x72')]=function(_0xa570fc,_0x200c17,_0x5df9f2){var _0x1e735c={'raw':![],'where':{}};var _0x291526={};var _0x1900ff={'count':0x0,'rows':[]};return db['MailAccount'][_0xafcd('0x6c')]({'where':{'id':_0xa570fc[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x200c17,null))[_0xafcd('0x25')](function(_0x599b0b){if(_0x599b0b){_0x291526[_0xafcd('0x4d')]=_[_0xafcd('0x4f')](db[_0xafcd('0x71')]['rawAttributes']);_0x291526[_0xafcd('0x4e')]=_['keys'](_0xa570fc['query']);_0x291526[_0xafcd('0x50')]=_[_0xafcd('0x51')](_0x291526['model'],_0x291526[_0xafcd('0x4e')]);_0x1e735c[_0xafcd('0x52')]=_[_0xafcd('0x51')](_0x291526[_0xafcd('0x4d')],qs[_0xafcd('0x53')](_0xa570fc[_0xafcd('0x4e')][_0xafcd('0x53')]));_0x1e735c[_0xafcd('0x52')]=_0x1e735c[_0xafcd('0x52')][_0xafcd('0x54')]?_0x1e735c[_0xafcd('0x52')]:_0x291526['model'];if(!_0xa570fc[_0xafcd('0x4e')][_0xafcd('0x55')](_0xafcd('0x56'))){_0x1e735c[_0xafcd('0x36')]=qs['limit'](_0xa570fc[_0xafcd('0x4e')][_0xafcd('0x36')]);_0x1e735c['offset']=qs[_0xafcd('0x35')](_0xa570fc[_0xafcd('0x4e')][_0xafcd('0x35')]);}_0x1e735c[_0xafcd('0x57')]=qs[_0xafcd('0x58')](_0xa570fc[_0xafcd('0x4e')][_0xafcd('0x58')]);_0x1e735c[_0xafcd('0x59')]=qs['filters'](_[_0xafcd('0x5a')](_0xa570fc[_0xafcd('0x4e')],_0x291526['filters']));_0x1e735c[_0xafcd('0x59')][_0xafcd('0x69')]=_0x599b0b['id'];if(_0xa570fc['query']['filter']){_0x1e735c[_0xafcd('0x59')]=_[_0xafcd('0x5d')](_0x1e735c[_0xafcd('0x59')],{'$or':_[_0xafcd('0x48')](_0x1e735c[_0xafcd('0x52')],function(_0x1105fc){var _0x56877a={};_0x56877a[_0x1105fc]={'$like':'%'+_0xa570fc['query']['filter']+'%'};return _0x56877a;})});}_0x1e735c=_[_0xafcd('0x5d')]({},_0x1e735c,_0xa570fc[_0xafcd('0x5e')]);return db[_0xafcd('0x71')][_0xafcd('0x34')]({'where':_0x1e735c['where']})[_0xafcd('0x25')](function(_0x3f15bd){_0x1900ff[_0xafcd('0x34')]=_0x3f15bd;if(_0xa570fc[_0xafcd('0x4e')][_0xafcd('0x64')]){_0x1e735c[_0xafcd('0x5f')]=[{'all':!![]}];}return db[_0xafcd('0x71')]['findAll'](_0x1e735c);})[_0xafcd('0x25')](function(_0x203d96){_0x1900ff[_0xafcd('0x60')]=_0x203d96;return _0x1900ff;});}})[_0xafcd('0x25')](respondWithFilteredResult(_0x200c17,_0x1e735c))['catch'](handleError(_0x200c17,null));};exports[_0xafcd('0x73')]=function(_0x2d6d4a,_0x1fbe50,_0x4eedf0){return db[_0xafcd('0x49')]['find']({'where':{'id':_0x2d6d4a[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x1fbe50,null))['then'](function(_0x49b9af){if(_0x49b9af){return _0x49b9af[_0xafcd('0x73')](_0x2d6d4a[_0xafcd('0x4e')][_0xafcd('0x6f')]);}})[_0xafcd('0x25')](respondWithStatusCode(_0x1fbe50,null))[_0xafcd('0x30')](handleError(_0x1fbe50,null));};exports[_0xafcd('0x6b')]=function(_0x9bed8a,_0x172aaa){var _0x43f2b7={'name':_0x9bed8a[_0xafcd('0x66')]['name'],'key':_0x9bed8a[_0xafcd('0x66')][_0xafcd('0x74')],'email':_0x9bed8a['body']['email'],'ListId':_0x9bed8a[_0xafcd('0x66')]['ListId'],'active':!_[_0xafcd('0x75')](_0x9bed8a['body'][_0xafcd('0x76')])?_0x9bed8a[_0xafcd('0x66')]['active']:!![],'description':_0x9bed8a[_0xafcd('0x66')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0xafcd('0x75')](_0x9bed8a[_0xafcd('0x66')][_0xafcd('0x77')])){if(_0x9bed8a[_0xafcd('0x66')][_0xafcd('0x78')]){_0x43f2b7[_0xafcd('0x45')][_0xafcd('0x79')]=_0x43f2b7[_0xafcd('0x63')][_0xafcd('0x79')]=_0x9bed8a[_0xafcd('0x66')][_0xafcd('0x7a')];_0x43f2b7[_0xafcd('0x45')][_0xafcd('0x7b')]=_0x43f2b7[_0xafcd('0x63')][_0xafcd('0x7c')]=_0x9bed8a[_0xafcd('0x66')][_0xafcd('0x7d')];}else{_0x43f2b7[_0xafcd('0x45')][_0xafcd('0x7e')]=_0x43f2b7[_0xafcd('0x63')]['authentication']=![];}_0x43f2b7['Imap'][_0xafcd('0x7f')]=_0x9bed8a[_0xafcd('0x66')][_0xafcd('0x45')][_0xafcd('0x7f')];_0x43f2b7[_0xafcd('0x45')][_0xafcd('0x80')]=_0x9bed8a['body'][_0xafcd('0x45')][_0xafcd('0x80')];_0x43f2b7[_0xafcd('0x63')][_0xafcd('0x7f')]=_0x9bed8a[_0xafcd('0x66')][_0xafcd('0x63')][_0xafcd('0x7f')];_0x43f2b7['Smtp'][_0xafcd('0x80')]=_0x9bed8a[_0xafcd('0x66')]['Smtp'][_0xafcd('0x80')];}else{_0x43f2b7[_0xafcd('0x45')][_0xafcd('0x81')]=_0x43f2b7[_0xafcd('0x63')][_0xafcd('0x81')]=_0x9bed8a[_0xafcd('0x66')]['cservice'];_0x43f2b7[_0xafcd('0x45')][_0xafcd('0x79')]=_0x43f2b7[_0xafcd('0x63')][_0xafcd('0x79')]=_0x9bed8a[_0xafcd('0x66')][_0xafcd('0x7a')];_0x43f2b7[_0xafcd('0x45')][_0xafcd('0x7b')]=_0x43f2b7['Smtp']['pass']=_0x9bed8a['body'][_0xafcd('0x7d')];}return db[_0xafcd('0x49')][_0xafcd('0x6b')](_0x43f2b7,{'include':[{'model':db[_0xafcd('0x62')],'as':'Smtp'},{'model':db[_0xafcd('0x44')],'as':_0xafcd('0x45')}]})[_0xafcd('0x25')](function(_0x19220e){var _0x356033=_0x9bed8a[_0xafcd('0x79')][_0xafcd('0x82')]({'plain':!![]});if(!_0x356033)throw new Error(_0xafcd('0x83'));if(_0x356033[_0xafcd('0x84')]==='user'){var _0x302a46=_0x19220e[_0xafcd('0x82')]({'plain':!![]});return db[_0xafcd('0x85')]['find']({'where':{'name':_0xafcd('0x3d'),'userProfileId':_0x356033[_0xafcd('0x86')]},'raw':!![]})['then'](function(_0x34d559){if(_0x34d559&&_0x34d559[_0xafcd('0x87')]===0x0){return db[_0xafcd('0x3e')]['create']({'name':_0x302a46[_0xafcd('0x41')],'resourceId':_0x302a46['id'],'type':_0x34d559['name'],'sectionId':_0x34d559['id']},{})[_0xafcd('0x25')](function(){return _0x19220e;});}else{return _0x19220e;}})[_0xafcd('0x30')](function(_0x227831){logger[_0xafcd('0x2b')](_0xafcd('0x88'),_0x227831);throw _0x227831;});}return _0x19220e;})[_0xafcd('0x25')](respondWithResult(_0x172aaa,0xc9))['catch'](handleError(_0x172aaa,null));};exports[_0xafcd('0x89')]=function(_0x186014,_0x14a97e,_0x135eb9){return db['MailAccount'][_0xafcd('0x6c')]({'where':{'id':_0x186014[_0xafcd('0x68')]['id']}})['then'](handleEntityNotFound(_0x14a97e,null))[_0xafcd('0x25')](function(_0x5ab01a){if(_0x5ab01a){return _0x5ab01a[_0xafcd('0x89')]();}return null;})['then'](respondWithResult(_0x14a97e,null))[_0xafcd('0x30')](handleError(_0x14a97e,null));};exports['addImap']=function(_0x587c39,_0x11c752,_0x287ac6){if(_0x587c39[_0xafcd('0x66')]['id']){delete _0x587c39['body']['id'];}return db[_0xafcd('0x49')][_0xafcd('0x65')]({'where':{'id':_0x587c39[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x11c752,null))[_0xafcd('0x25')](function(_0x4bd286){if(_0x4bd286){_0x587c39['body'][_0xafcd('0x69')]=_0x4bd286['id'];return db[_0xafcd('0x44')][_0xafcd('0x6b')](_0x587c39[_0xafcd('0x66')]);}})[_0xafcd('0x25')](respondWithResult(_0x11c752,null))[_0xafcd('0x30')](handleError(_0x11c752,null));};exports['removeImap']=function(_0x19c5ee,_0xe8ade9,_0x5cf144){return db['MailAccount']['findOne']({'where':{'id':_0x19c5ee[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0xe8ade9,null))[_0xafcd('0x25')](function(_0xeb8968){if(_0xeb8968){return _0xeb8968[_0xafcd('0x8a')](null);}return null;})[_0xafcd('0x25')](respondWithStatusCode(_0xe8ade9,null))['catch'](handleError(_0xe8ade9,null));};exports['getSmtp']=function(_0x28da09,_0x17a04f,_0x136c2c){return db[_0xafcd('0x49')]['findOne']({'where':{'id':_0x28da09[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x17a04f,null))['then'](function(_0x13ff3c){if(_0x13ff3c){return _0x13ff3c[_0xafcd('0x8b')]();}return null;})[_0xafcd('0x25')](respondWithResult(_0x17a04f,null))[_0xafcd('0x30')](handleError(_0x17a04f,null));};exports['addSmtp']=function(_0x499a87,_0x2d345c,_0x2b9e61){if(_0x499a87['body']['id']){delete _0x499a87[_0xafcd('0x66')]['id'];}return db[_0xafcd('0x49')]['find']({'where':{'id':_0x499a87['params']['id']}})['then'](handleEntityNotFound(_0x2d345c,null))['then'](function(_0xa3127){if(_0xa3127){_0x499a87[_0xafcd('0x66')][_0xafcd('0x69')]=_0xa3127['id'];return db['MailServerOut']['create'](_0x499a87[_0xafcd('0x66')]);}})[_0xafcd('0x25')](respondWithResult(_0x2d345c,null))[_0xafcd('0x30')](handleError(_0x2d345c,null));};exports['removeSmtp']=function(_0x564a14,_0x2bc1fb,_0x3c580c){return db['MailAccount'][_0xafcd('0x6c')]({'where':{'id':_0x564a14[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x2bc1fb,null))[_0xafcd('0x25')](function(_0x1e90cb){if(_0x1e90cb){return _0x1e90cb['setSmtp'](null);}return null;})[_0xafcd('0x25')](respondWithStatusCode(_0x2bc1fb,null))[_0xafcd('0x30')](handleError(_0x2bc1fb,null));};exports[_0xafcd('0x8c')]=function(_0x4be5b5,_0x1acf49,_0x29dc98){return db[_0xafcd('0x8d')][_0xafcd('0x65')]({'where':{'id':_0x4be5b5[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x1acf49,null))['then'](function(_0x4b4dcf){if(_0x4b4dcf){return _0x4b4dcf[_0xafcd('0x8c')](_0x4be5b5[_0xafcd('0x66')][_0xafcd('0x6f')],_[_0xafcd('0x8e')](_0x4be5b5['body'],['ids','id'])||{});}})[_0xafcd('0x25')](respondWithResult(_0x1acf49,null))[_0xafcd('0x30')](handleError(_0x1acf49,null));};exports[_0xafcd('0x8f')]=function(_0xe0f5af,_0x1ab024,_0x15c9c2){var _0x34f3df={'raw':![],'where':{}};var _0x1df5c4={};var _0x23bfbe={'count':0x0,'rows':[]};return db[_0xafcd('0x49')][_0xafcd('0x6c')]({'where':{'id':_0xe0f5af[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x1ab024,null))['then'](function(_0x30ef74){if(_0x30ef74){_0x1df5c4[_0xafcd('0x4d')]=_[_0xafcd('0x4f')](db[_0xafcd('0x8d')]['rawAttributes']);_0x1df5c4[_0xafcd('0x4e')]=_[_0xafcd('0x4f')](_0xe0f5af[_0xafcd('0x4e')]);_0x1df5c4[_0xafcd('0x50')]=_[_0xafcd('0x51')](_0x1df5c4['model'],_0x1df5c4['query']);_0x34f3df[_0xafcd('0x52')]=_[_0xafcd('0x51')](_0x1df5c4[_0xafcd('0x4d')],qs[_0xafcd('0x53')](_0xe0f5af['query'][_0xafcd('0x53')]));_0x34f3df[_0xafcd('0x52')]=_0x34f3df[_0xafcd('0x52')][_0xafcd('0x54')]?_0x34f3df[_0xafcd('0x52')]:_0x1df5c4['model'];if(!_0xe0f5af[_0xafcd('0x4e')][_0xafcd('0x55')](_0xafcd('0x56'))){_0x34f3df[_0xafcd('0x36')]=qs['limit'](_0xe0f5af[_0xafcd('0x4e')][_0xafcd('0x36')]);_0x34f3df[_0xafcd('0x35')]=qs[_0xafcd('0x35')](_0xe0f5af['query'][_0xafcd('0x35')]);}_0x34f3df[_0xafcd('0x57')]=qs[_0xafcd('0x58')](_0xe0f5af['query']['sort']);_0x34f3df[_0xafcd('0x59')]=qs['filters'](_[_0xafcd('0x5a')](_0xe0f5af[_0xafcd('0x4e')],_0x1df5c4[_0xafcd('0x50')]));_0x34f3df[_0xafcd('0x59')][_0xafcd('0x69')]=_0x30ef74['id'];if(_0xe0f5af[_0xafcd('0x4e')]['filter']){_0x34f3df[_0xafcd('0x59')]=_['merge'](_0x34f3df[_0xafcd('0x59')],{'$or':_[_0xafcd('0x48')](_0x34f3df['attributes'],function(_0x4c5303){var _0x3a07a4={};_0x3a07a4[_0x4c5303]={'$like':'%'+_0xe0f5af['query'][_0xafcd('0x5b')]+'%'};return _0x3a07a4;})});}_0x34f3df=_[_0xafcd('0x5d')]({},_0x34f3df,_0xe0f5af[_0xafcd('0x5e')]);return db[_0xafcd('0x8d')]['count']({'where':_0x34f3df[_0xafcd('0x59')]})['then'](function(_0x5853ae){_0x23bfbe[_0xafcd('0x34')]=_0x5853ae;if(_0xe0f5af[_0xafcd('0x4e')][_0xafcd('0x64')]){_0x34f3df[_0xafcd('0x5f')]=[{'model':db[_0xafcd('0x90')],'as':'Contact','required':![]},{'model':db[_0xafcd('0x91')],'as':_0xafcd('0x92'),'attributes':[_0xafcd('0x41'),_0xafcd('0x93'),'internal'],'required':![]},{'model':db[_0xafcd('0x94')],'as':_0xafcd('0x95'),'attributes':['id','name',_0xafcd('0x96')],'where':_0xe0f5af[_0xafcd('0x4e')][_0xafcd('0x97')]?{'id':_0xe0f5af[_0xafcd('0x4e')][_0xafcd('0x97')]}:undefined,'required':_0xe0f5af[_0xafcd('0x4e')][_0xafcd('0x97')]?!![]:![]}];}return db[_0xafcd('0x8d')][_0xafcd('0x6d')](_0x34f3df);})[_0xafcd('0x25')](function(_0x1e048c){_0x23bfbe['rows']=_0x1e048c;return _0x23bfbe;});}})[_0xafcd('0x25')](respondWithFilteredResult(_0x1ab024,_0x34f3df))['catch'](handleError(_0x1ab024,null));};exports[_0xafcd('0x98')]=function(_0x239fd5,_0x3c7e59,_0x3571e3){return db[_0xafcd('0x49')][_0xafcd('0x6c')]({'where':{'id':_0x239fd5['params']['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x3c7e59,null))[_0xafcd('0x25')](function(_0x166131){if(_0x166131){return db[_0xafcd('0x99')][_0xafcd('0x9a')](function(_0x20ac92){return db[_0xafcd('0x9b')][_0xafcd('0x3c')]({'where':{'MailAccountId':_0x239fd5[_0xafcd('0x68')]['id']},'transaction':_0x20ac92})[_0xafcd('0x25')](function(_0x512794){var _0x16efd1=_[_0xafcd('0x48')](_0x239fd5['body'],function(_0x4587e9){_0x4587e9[_0xafcd('0x69')]=_0x239fd5[_0xafcd('0x68')]['id'];return _0x4587e9;});return db[_0xafcd('0x9b')]['bulkCreate'](_0x16efd1,{'transaction':_0x20ac92});});})[_0xafcd('0x25')](function(){return db[_0xafcd('0x9b')][_0xafcd('0x9c')]({'where':{'MailAccountId':_0x239fd5[_0xafcd('0x68')]['id']},'order':_0xafcd('0x9d')});});}})[_0xafcd('0x25')](respondWithResult(_0x3c7e59,null))[_0xafcd('0x30')](handleError(_0x3c7e59,null));};exports[_0xafcd('0x9e')]=function(_0x41bc7d,_0x1992f2,_0x395d94){var _0x15685a={};var _0x39496d={};var _0x135b37;var _0x2579ac;return db[_0xafcd('0x49')][_0xafcd('0x6c')]({'where':{'id':_0x41bc7d['params']['id']}})['then'](handleEntityNotFound(_0x1992f2,null))['then'](function(_0x281383){if(_0x281383){_0x135b37=_0x281383;_0x39496d[_0xafcd('0x4d')]=_[_0xafcd('0x4f')](db[_0xafcd('0x9b')][_0xafcd('0x4a')]);_0x39496d[_0xafcd('0x4e')]=_['keys'](_0x41bc7d[_0xafcd('0x4e')]);_0x39496d[_0xafcd('0x50')]=_['intersection'](_0x39496d[_0xafcd('0x4d')],_0x39496d['query']);_0x15685a[_0xafcd('0x52')]=_[_0xafcd('0x51')](_0x39496d[_0xafcd('0x4d')],qs[_0xafcd('0x53')](_0x41bc7d[_0xafcd('0x4e')][_0xafcd('0x53')]));_0x15685a[_0xafcd('0x52')]=_0x15685a[_0xafcd('0x52')][_0xafcd('0x54')]?_0x15685a[_0xafcd('0x52')]:_0x39496d[_0xafcd('0x4d')];_0x15685a[_0xafcd('0x57')]=qs['sort'](_0x41bc7d[_0xafcd('0x4e')]['sort']);_0x15685a['where']=qs[_0xafcd('0x50')](_[_0xafcd('0x5a')](_0x41bc7d['query'],_0x39496d[_0xafcd('0x50')]));if(_0x41bc7d[_0xafcd('0x4e')][_0xafcd('0x5b')]){_0x15685a[_0xafcd('0x59')]=_['merge'](_0x15685a[_0xafcd('0x59')],{'$or':_[_0xafcd('0x48')](_0x15685a[_0xafcd('0x52')],function(_0x3758f1){var _0x41bf16={};_0x41bf16[_0x3758f1]={'$like':'%'+_0x41bc7d['query'][_0xafcd('0x5b')]+'%'};return _0x41bf16;})});}_0x15685a=_[_0xafcd('0x5d')]({},_0x15685a,_0x41bc7d[_0xafcd('0x5e')]);return _0x135b37[_0xafcd('0x9e')](_0x15685a);}})[_0xafcd('0x25')](function(_0x27a890){if(_0x27a890){_0x2579ac=_0x27a890[_0xafcd('0x54')];if(!_0x41bc7d[_0xafcd('0x4e')][_0xafcd('0x55')]('nolimit')){_0x15685a['limit']=qs[_0xafcd('0x36')](_0x41bc7d['query'][_0xafcd('0x36')]);_0x15685a[_0xafcd('0x35')]=qs[_0xafcd('0x35')](_0x41bc7d[_0xafcd('0x4e')]['offset']);}return _0x135b37[_0xafcd('0x9e')](_0x15685a);}})[_0xafcd('0x25')](function(_0x43008b){if(_0x43008b){return _0x43008b?{'count':_0x2579ac,'rows':_0x43008b}:null;}})[_0xafcd('0x25')](respondWithResult(_0x1992f2,null))[_0xafcd('0x30')](handleError(_0x1992f2,null));};exports[_0xafcd('0x9f')]=function(_0x4abcf2,_0x420364,_0x5dae65){var _0x45e87f={'raw':!![],'where':{}};var _0x2de7d9={};var _0x269f53={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x4abcf2['params']['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x420364,null))[_0xafcd('0x25')](function(_0x2af07c){if(_0x2af07c){_0x2de7d9[_0xafcd('0x4d')]=_[_0xafcd('0x4f')](db[_0xafcd('0xa0')][_0xafcd('0x4a')]);_0x2de7d9[_0xafcd('0x4e')]=_[_0xafcd('0x4f')](_0x4abcf2[_0xafcd('0x4e')]);_0x2de7d9[_0xafcd('0x50')]=_['intersection'](_0x2de7d9[_0xafcd('0x4d')],_0x2de7d9[_0xafcd('0x4e')]);_0x45e87f[_0xafcd('0x52')]=_[_0xafcd('0x51')](_0x2de7d9['model'],qs[_0xafcd('0x53')](_0x4abcf2[_0xafcd('0x4e')][_0xafcd('0x53')]));_0x45e87f[_0xafcd('0x52')]=_0x45e87f['attributes']['length']?_0x45e87f[_0xafcd('0x52')]:_0x2de7d9[_0xafcd('0x4d')];if(!_0x4abcf2[_0xafcd('0x4e')][_0xafcd('0x55')](_0xafcd('0x56'))){_0x45e87f[_0xafcd('0x36')]=qs['limit'](_0x4abcf2['query']['limit']);_0x45e87f[_0xafcd('0x35')]=qs['offset'](_0x4abcf2[_0xafcd('0x4e')][_0xafcd('0x35')]);}_0x45e87f[_0xafcd('0x57')]=qs[_0xafcd('0x58')](_0x4abcf2[_0xafcd('0x4e')][_0xafcd('0x58')]);_0x45e87f[_0xafcd('0x59')]=qs['filters'](_[_0xafcd('0x5a')](_0x4abcf2[_0xafcd('0x4e')],_0x2de7d9[_0xafcd('0x50')]));_0x45e87f['where'][_0xafcd('0x69')]=_0x2af07c['id'];if(_0x4abcf2['query']['filter']){_0x45e87f['where']=_[_0xafcd('0x5d')](_0x45e87f['where'],{'$or':_['map'](_0x45e87f['attributes'],function(_0x3840a){var _0x38d313={};_0x38d313[_0x3840a]={'$like':'%'+_0x4abcf2[_0xafcd('0x4e')][_0xafcd('0x5b')]+'%'};return _0x38d313;})});}if(_0x4abcf2[_0xafcd('0x4e')][_0xafcd('0xa1')]){var _0x4ffb7b=_0x4abcf2['query'][_0xafcd('0xa1')][_0xafcd('0xa2')](',');var _0xcd7139={};_0xcd7139[_0x4ffb7b[0x0]]={'$gte':moment(_0x4ffb7b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x45e87f[_0xafcd('0x59')]=_[_0xafcd('0x5d')](_0x45e87f['where'],_0xcd7139);}_0x45e87f=_[_0xafcd('0x5d')]({},_0x45e87f,_0x4abcf2['options']);return db['MailMessage'][_0xafcd('0x34')]({'where':_0x45e87f[_0xafcd('0x59')]})[_0xafcd('0x25')](function(_0x20c51d){_0x269f53[_0xafcd('0x34')]=_0x20c51d;if(_0x4abcf2[_0xafcd('0x4e')]['includeAll']){_0x45e87f['include']=[{'all':!![]}];}return db[_0xafcd('0xa0')]['findAll'](_0x45e87f);})[_0xafcd('0x25')](function(_0x176bd0){_0x269f53[_0xafcd('0x60')]=_0x176bd0;return _0x269f53;});}})[_0xafcd('0x25')](respondWithFilteredResult(_0x420364,_0x45e87f))[_0xafcd('0x30')](handleError(_0x420364,null));};exports[_0xafcd('0x42')]=function(_0x1e23fd,_0x59ea01,_0xa6f13b){var _0x56c168,_0x2a745a={},_0x37bed6;if(_0x1e23fd[_0xafcd('0x66')]['to']){_0x37bed6=_0x1e23fd['body']['to'][_0xafcd('0xa2')](',')[0x0];}return db[_0xafcd('0x49')][_0xafcd('0x65')]({'where':{'id':_0x1e23fd[_0xafcd('0x68')]['id']},'include':[{'model':db['CmList'],'as':_0xafcd('0xa3'),'include':[{'model':db[_0xafcd('0x90')],'as':_0xafcd('0xa4'),'where':{'email':_0x37bed6},'limit':0x1,'order':[['updatedAt',_0xafcd('0xa5')]]}]},{'model':db[_0xafcd('0x62')],'as':_0xafcd('0x63'),'raw':!![]}]})['then'](handleEntityNotFound(_0x59ea01,null))['then'](function(_0x115da9){if(_0x115da9){_0x56c168=_0x115da9;if(_0x115da9[_0xafcd('0x63')]){if(_['isNil'](_0x1e23fd[_0xafcd('0x66')][_0xafcd('0xa6')])){_0x1e23fd[_0xafcd('0x66')]['from']=util[_0xafcd('0xa7')](_0xafcd('0xa8'),_0x115da9[_0xafcd('0x41')],_0x115da9[_0xafcd('0xa9')]||_0x115da9[_0xafcd('0x63')]['user']);}if(_0x1e23fd[_0xafcd('0x66')]['attachments']&&_0x1e23fd[_0xafcd('0x66')]['attachments'][_0xafcd('0x54')]){for(var _0x1d90dd=0x0;_0x1d90dd<_0x1e23fd['body'][_0xafcd('0xaa')][_0xafcd('0x54')];_0x1d90dd+=0x1){_0x1e23fd[_0xafcd('0x66')][_0xafcd('0xaa')][_0x1d90dd]={'filename':_0x1e23fd['body'][_0xafcd('0xaa')][_0x1d90dd][_0xafcd('0x41')],'path':path[_0xafcd('0xab')](config[_0xafcd('0xac')],_0xafcd('0xad'),_0x1e23fd[_0xafcd('0x66')]['attachments'][_0x1d90dd][_0xafcd('0xae')])};}}var _0x814f74={'tls':{'rejectUnauthorized':![]}};if(_[_0xafcd('0x75')](_0x115da9[_0xafcd('0x63')][_0xafcd('0x81')])){if(_0x115da9[_0xafcd('0x63')][_0xafcd('0x7e')]){_0x814f74[_0xafcd('0xaf')]={'user':_0x115da9['Smtp'][_0xafcd('0x79')],'pass':_0x115da9[_0xafcd('0x63')][_0xafcd('0x7c')]};}_0x814f74[_0xafcd('0x7f')]=_0x115da9[_0xafcd('0x63')]['host'];_0x814f74['port']=_0x115da9[_0xafcd('0x63')][_0xafcd('0x80')];_0x814f74['secure']=_0x115da9[_0xafcd('0x63')]['secure'];}else{_0x814f74[_0xafcd('0x81')]=_0x115da9[_0xafcd('0x63')]['service'];_0x814f74['auth']={'user':_0x115da9[_0xafcd('0x63')][_0xafcd('0x79')],'pass':_0x115da9['Smtp'][_0xafcd('0x7c')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x814f74,'message':_0x1e23fd[_0xafcd('0x66')]});}else{throw new Error(_0xafcd('0xb0'));}}})[_0xafcd('0x25')](function(_0x183e56){if(_0x183e56){_0x2a745a=_0x183e56;if(_0x56c168[_0xafcd('0xa3')]){if(_0x56c168[_0xafcd('0xa3')]['Contacts']['length']){return _0x56c168[_0xafcd('0xa3')]['Contacts'][0x0];}else{return db[_0xafcd('0x90')]['create'](_[_0xafcd('0xb1')](_0x1e23fd[_0xafcd('0x66')],{'firstName':_0x1e23fd[_0xafcd('0x66')]['to'],'email':_0x1e23fd[_0xafcd('0x66')]['to'],'phone':_0x1e23fd[_0xafcd('0x66')]['to'],'ListId':_0x56c168['ListId']}));}}else{throw new Error(_0xafcd('0xb0'));}}})[_0xafcd('0x25')](function(_0x2bb1c3){if(_0x2bb1c3){var _0x2cff16={'UserId':_0x1e23fd['user']['id'],'ContactId':_0x2bb1c3['id'],'MailAccountId':_0x56c168['id'],'inReplyTo':_0x2a745a[_0xafcd('0xb2')],'to':_0x1e23fd[_0xafcd('0x66')][_0xafcd('0xa6')],'cc':_0x1e23fd[_0xafcd('0x66')]['cc'],'subject':_0x1e23fd[_0xafcd('0x66')][_0xafcd('0xb3')],'attach':_0x1e23fd[_0xafcd('0x66')]['attach'],'firstMsgDirection':_0xafcd('0xb4'),'lastMsgAt':moment()[_0xafcd('0xa7')](_0xafcd('0xb5')),'lastMsgDirection':_0xafcd('0xb4'),'lastMsgBody':_0x1e23fd[_0xafcd('0x66')]['body'],'Messages':[_[_0xafcd('0x5d')](_0x1e23fd['body'],{'messageId':_0x2a745a[_0xafcd('0xb2')],'sentAt':moment()[_0xafcd('0xa7')](_0xafcd('0xb5')),'read':!![],'MailAccountId':_0x56c168['id'],'UserId':_0x1e23fd[_0xafcd('0x79')]['id'],'ContactId':_0x2bb1c3['id']})]};if(_0x1e23fd[_0xafcd('0x66')]['Interaction']){_0x2cff16=_[_0xafcd('0x5d')](_0x2cff16,_0x1e23fd[_0xafcd('0x66')][_0xafcd('0xb6')]);}return db[_0xafcd('0x8d')]['create'](_0x2cff16,{'include':[{'model':db[_0xafcd('0xa0')],'as':_0xafcd('0xb7')}]});}})[_0xafcd('0x25')](respondWithResult(_0x59ea01,null))[_0xafcd('0x30')](handleError(_0x59ea01,null));};exports[_0xafcd('0xb8')]=function(_0x5d8e7a,_0x27527e,_0x617f28){return db[_0xafcd('0x49')][_0xafcd('0x65')]({'where':{'id':_0x5d8e7a[_0xafcd('0x68')]['id']},'include':[{'model':db[_0xafcd('0x62')],'as':_0xafcd('0x63'),'raw':!![]}]})['then'](handleEntityNotFound(_0x27527e,null))[_0xafcd('0x25')](function(_0x329062){if(_0x329062&&_0x329062[_0xafcd('0x63')]){var _0x19c306={'id':_0x329062['id'],'tls':{'rejectUnauthorized':![]}};if(_0x329062[_0xafcd('0x63')][_0xafcd('0x81')]){_0x19c306[_0xafcd('0x81')]=_0x329062[_0xafcd('0x63')][_0xafcd('0x81')];}else{_0x19c306[_0xafcd('0x7f')]=_0x329062[_0xafcd('0x63')][_0xafcd('0x7f')];_0x19c306['port']=_0x329062['Smtp'][_0xafcd('0x80')];_0x19c306[_0xafcd('0xb9')]=_0x329062[_0xafcd('0x63')][_0xafcd('0xb9')];}if(_0x329062[_0xafcd('0x63')][_0xafcd('0x7e')]){_0x19c306[_0xafcd('0xaf')]={'user':_0x329062[_0xafcd('0x63')]['user'],'pass':_0x329062[_0xafcd('0x63')][_0xafcd('0x7c')]};}return respondWithRpcPromise(_0xafcd('0xba'),'verifySmtp',{'account':_0x19c306});}})[_0xafcd('0x25')](respondWithResult(_0x27527e,null))[_0xafcd('0x30')](handleError(_0x27527e,null));};exports[_0xafcd('0x3c')]=function(_0x26f630,_0x3dd816){return db[_0xafcd('0x49')][_0xafcd('0x65')]({'where':{'id':_0x26f630[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x3dd816,null))['then'](function(_0xb55a){if(_0xb55a&&_0xb55a[_0xafcd('0x81')]){throw new db[(_0xafcd('0x21'))][(_0xafcd('0x22'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0xb55a;})[_0xafcd('0x25')](removeEntity(_0x3dd816,null))[_0xafcd('0x30')](handleError(_0x3dd816,null));};exports['addAgents']=function(_0xc3d05a,_0x1b90b7,_0xbd328d){return db[_0xafcd('0x49')]['find']({'where':{'id':_0xc3d05a[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x1b90b7,null))[_0xafcd('0x25')](function(_0x13bfa6){if(_0x13bfa6){return _0x13bfa6[_0xafcd('0xbb')](_0xc3d05a[_0xafcd('0x66')][_0xafcd('0x6f')],_[_0xafcd('0x8e')](_0xc3d05a['body'],[_0xafcd('0x6f'),'id'])||{})[_0xafcd('0xbc')](function(_0x197dbf){for(var _0x3203df=0x0;_0x3203df<_0xc3d05a['body'][_0xafcd('0x6f')][_0xafcd('0x54')];_0x3203df+=0x1){socket[_0xafcd('0xbd')](_0xafcd('0xbe'),{'UserId':_0xc3d05a[_0xafcd('0x66')][_0xafcd('0x6f')][_0x3203df],'MailAccountId':_0xc3d05a['params']['id']});}return _0x197dbf;});}})[_0xafcd('0x25')](respondWithResult(_0x1b90b7,null))[_0xafcd('0x30')](handleError(_0x1b90b7,null));};exports['removeAgents']=function(_0x1b1d49,_0xd54f72,_0x1f2c83){return db[_0xafcd('0x49')]['find']({'where':{'id':_0x1b1d49[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0xd54f72,null))['then'](function(_0x53c550){if(_0x53c550){return _0x53c550[_0xafcd('0xbf')](_0x1b1d49[_0xafcd('0x4e')][_0xafcd('0x6f')])[_0xafcd('0x25')](function(){if(_['isArray'](_0x1b1d49[_0xafcd('0x4e')][_0xafcd('0x6f')])){for(var _0x4dad50=0x0;_0x4dad50<_0x1b1d49[_0xafcd('0x4e')]['ids'][_0xafcd('0x54')];_0x4dad50+=0x1){socket[_0xafcd('0xbd')](_0xafcd('0xc0'),{'UserId':Number(_0x1b1d49[_0xafcd('0x4e')][_0xafcd('0x6f')][_0x4dad50]),'MailAccountId':Number(_0x1b1d49[_0xafcd('0x68')]['id'])});}}else{socket[_0xafcd('0xbd')](_0xafcd('0xc0'),{'UserId':Number(_0x1b1d49[_0xafcd('0x4e')][_0xafcd('0x6f')]),'MailAccountId':Number(_0x1b1d49['params']['id'])});}});}})['then'](respondWithStatusCode(_0xd54f72,null))[_0xafcd('0x30')](handleError(_0xd54f72,null));};exports[_0xafcd('0xc1')]=function(_0xc23073,_0x327fec,_0x1ebf6c){var _0x2ce711={};var _0x2bb2b6={};var _0x54f0ec;var _0x4b1e2e;return db['MailAccount'][_0xafcd('0x6c')]({'where':{'id':_0xc23073[_0xafcd('0x68')]['id']}})[_0xafcd('0x25')](handleEntityNotFound(_0x327fec,null))[_0xafcd('0x25')](function(_0x46dd3e){if(_0x46dd3e){_0x54f0ec=_0x46dd3e;_0x2bb2b6[_0xafcd('0x4d')]=_[_0xafcd('0x4f')](db['User'][_0xafcd('0x4a')]);_0x2bb2b6['query']=_[_0xafcd('0x4f')](_0xc23073[_0xafcd('0x4e')]);_0x2bb2b6[_0xafcd('0x50')]=_[_0xafcd('0x51')](_0x2bb2b6[_0xafcd('0x4d')],_0x2bb2b6[_0xafcd('0x4e')]);_0x2ce711[_0xafcd('0x52')]=_[_0xafcd('0x51')](_0x2bb2b6[_0xafcd('0x4d')],qs[_0xafcd('0x53')](_0xc23073[_0xafcd('0x4e')]['fields']));_0x2ce711[_0xafcd('0x52')]=_0x2ce711[_0xafcd('0x52')][_0xafcd('0x54')]?_0x2ce711[_0xafcd('0x52')]:_0x2bb2b6[_0xafcd('0x4d')];_0x2ce711[_0xafcd('0x57')]=qs[_0xafcd('0x58')](_0xc23073['query'][_0xafcd('0x58')]);_0x2ce711[_0xafcd('0x59')]=qs[_0xafcd('0x50')](_[_0xafcd('0x5a')](_0xc23073[_0xafcd('0x4e')],_0x2bb2b6[_0xafcd('0x50')]));if(_0xc23073[_0xafcd('0x4e')][_0xafcd('0x5b')]){_0x2ce711[_0xafcd('0x59')]=_[_0xafcd('0x5d')](_0x2ce711['where'],{'$or':_[_0xafcd('0x48')](_0x2ce711[_0xafcd('0x52')],function(_0x153b4b){var _0x5937d2={};_0x5937d2[_0x153b4b]={'$like':'%'+_0xc23073['query'][_0xafcd('0x5b')]+'%'};return _0x5937d2;})});}_0x2ce711=_[_0xafcd('0x5d')]({},_0x2ce711,_0xc23073['options']);return _0x54f0ec[_0xafcd('0xc1')](_0x2ce711);}})[_0xafcd('0x25')](function(_0x54a3dd){if(_0x54a3dd){_0x4b1e2e=_0x54a3dd[_0xafcd('0x54')];if(!_0xc23073[_0xafcd('0x4e')][_0xafcd('0x55')]('nolimit')){_0x2ce711[_0xafcd('0x36')]=qs[_0xafcd('0x36')](_0xc23073[_0xafcd('0x4e')][_0xafcd('0x36')]);_0x2ce711[_0xafcd('0x35')]=qs[_0xafcd('0x35')](_0xc23073[_0xafcd('0x4e')]['offset']);}return _0x54f0ec['getAgents'](_0x2ce711);}})[_0xafcd('0x25')](function(_0x1aff69){if(_0x1aff69){return _0x1aff69?{'count':_0x4b1e2e,'rows':_0x1aff69}:null;}})[_0xafcd('0x25')](respondWithResult(_0x327fec,null))[_0xafcd('0x30')](handleError(_0x327fec,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 8c6e508..d854a4f 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 _0xf30f=['../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0xdc16c6,_0x1e6b69){var _0x28ddf6=function(_0x158176){while(--_0x158176){_0xdc16c6['push'](_0xdc16c6['shift']());}};_0x28ddf6(++_0x1e6b69);}(_0xf30f,0xff));var _0xff30=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xf30f[_0x160c73];return _0xd9302;};'use strict';var EventEmitter=require(_0xff30('0x0'));var MailAccount=require(_0xff30('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xff30('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xff30('0x3'),'afterDestroy':'remove'};function emitEvent(_0x44dcfd){return function(_0x58b50d,_0x4be946,_0x238444){MailAccountEvents[_0xff30('0x4')](_0x44dcfd+':'+_0x58b50d['id'],_0x58b50d);MailAccountEvents['emit'](_0x44dcfd,_0x58b50d);_0x238444(null);};}for(var e in events){if(events[_0xff30('0x5')](e)){var event=events[e];MailAccount[_0xff30('0x6')](e,emitEvent(event));}}module[_0xff30('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xad81=['MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xad81,0x168));var _0x1ad8=function(_0x30ffc1,_0x556cd6){_0x30ffc1=_0x30ffc1-0x0;var _0x586b40=_0xad81[_0x30ffc1];return _0x586b40;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0x1ad8('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x1ad8('0x1')](0x0);var events={'afterCreate':_0x1ad8('0x2'),'afterUpdate':_0x1ad8('0x3'),'afterDestroy':_0x1ad8('0x4')};function emitEvent(_0x494874){return function(_0x12fb93,_0xd6649f,_0x58f97b){MailAccountEvents[_0x1ad8('0x5')](_0x494874+':'+_0x12fb93['id'],_0x12fb93);MailAccountEvents[_0x1ad8('0x5')](_0x494874,_0x12fb93);_0x58f97b(null);};}for(var e in events){if(events[_0x1ad8('0x6')](e)){var event=events[e];MailAccount[_0x1ad8('0x7')](e,emitEvent(event));}}module[_0x1ad8('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index ef20987..4c15df1 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 _0x13f7=['bluebird','path','rimraf','../../config/environment','define','lodash','util','../../config/logger','api'];(function(_0x169161,_0x505a14){var _0x372edb=function(_0x5b5f57){while(--_0x5b5f57){_0x169161['push'](_0x169161['shift']());}};_0x372edb(++_0x505a14);}(_0x13f7,0x164));var _0x713f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x13f7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x713f('0x0'));var util=require(_0x713f('0x1'));var logger=require(_0x713f('0x2'))(_0x713f('0x3'));var moment=require('moment');var BPromise=require(_0x713f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x713f('0x5'));var rimraf=require(_0x713f('0x6'));var config=require(_0x713f('0x7'));var attributes=require('./mailAccount.attributes');module['exports']=function(_0x5ea16f,_0x463eea){return _0x5ea16f[_0x713f('0x8')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x64e5=['bluebird','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','lodash','util','../../config/logger','api'];(function(_0x16529a,_0x59c4e5){var _0x4b8ec7=function(_0x2f62ba){while(--_0x2f62ba){_0x16529a['push'](_0x16529a['shift']());}};_0x4b8ec7(++_0x59c4e5);}(_0x64e5,0x10a));var _0x564e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x64e5[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x564e('0x0'));var util=require(_0x564e('0x1'));var logger=require(_0x564e('0x2'))(_0x564e('0x3'));var moment=require('moment');var BPromise=require(_0x564e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x564e('0x5'));var attributes=require(_0x564e('0x6'));module[_0x564e('0x7')]=function(_0x3eba9b,_0x45a3ad){return _0x3eba9b[_0x564e('0x8')](_0x564e('0x9'),attributes,{'tableName':'mail_accounts','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 0476c9d..875aa53 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 _0x8130=['Applications','MailServerOut','Smtp','get','omit','applications','orderBy','asc','autoclose','push','*,*,*,*','length','create','List\x20not\x20found','contact','messageId','generate','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','update','subject','interaction','attachments','originTo','originCc','Attachment','Attachments','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetMailAccount','findAll','options','raw','where','map','include','model','attributes','catch','ShowMailAccount','NotifyMailAccount','mail','difference','CmContact','rawAttributes','createdAt','CompanyId','ListId','body','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','MailAccount','find','account','CmList','List','updatedAt','DESC','MailApplication'];(function(_0x49ff8c,_0x2d94c5){var _0xb5cd09=function(_0xa81265){while(--_0xa81265){_0x49ff8c['push'](_0x49ff8c['shift']());}};_0xb5cd09(++_0x2d94c5);}(_0x8130,0x146));var _0x0813=function(_0x457f72,_0x439018){_0x457f72=_0x457f72-0x0;var _0x2f35c4=_0x8130[_0x457f72];return _0x2f35c4;};'use strict';var _=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var moment=require('moment');var BPromise=require(_0x0813('0x2'));var rs=require(_0x0813('0x3'));var fs=require('fs');var Redis=require(_0x0813('0x4'));var db=require(_0x0813('0x5'))['db'];var utils=require(_0x0813('0x6'));var logger=require(_0x0813('0x7'))('rpc');var config=require(_0x0813('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0813('0x9')]({'port':0x232c});config[_0x0813('0xa')]=_[_0x0813('0xb')](config[_0x0813('0xa')],{'host':_0x0813('0xc'),'port':0x18eb});var socket=require(_0x0813('0xd'))(new Redis(config[_0x0813('0xa')]));require('./mailAccount.socket')[_0x0813('0xe')](socket);function respondWithRpcPromise(_0x1815be,_0x251ca8,_0x5a9c5e){return new BPromise(function(_0x5550c8,_0x15f8d6){return client['request'](_0x1815be,_0x5a9c5e)[_0x0813('0xf')](function(_0x5b54ec){logger[_0x0813('0x10')](_0x0813('0x11'),_0x251ca8,_0x0813('0x12'));logger[_0x0813('0x13')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x251ca8,'request\x20sent',JSON[_0x0813('0x14')](_0x5b54ec));if(_0x5b54ec[_0x0813('0x15')]){if(_0x5b54ec['error'][_0x0813('0x16')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x251ca8,_0x5b54ec[_0x0813('0x15')][_0x0813('0x17')]);return _0x15f8d6(_0x5b54ec['error'][_0x0813('0x17')]);}logger['error'](_0x0813('0x11'),_0x251ca8,_0x5b54ec[_0x0813('0x15')][_0x0813('0x17')]);return _0x5550c8(_0x5b54ec[_0x0813('0x15')][_0x0813('0x17')]);}else{logger[_0x0813('0x10')](_0x0813('0x11'),_0x251ca8,_0x0813('0x12'));_0x5550c8(_0x5b54ec['result'][_0x0813('0x17')]);}})['catch'](function(_0x112720){logger[_0x0813('0x15')]('MailAccount,\x20%s,\x20%s',_0x251ca8,_0x112720);_0x15f8d6(_0x112720);});});}exports[_0x0813('0x18')]=function(_0x3639fc){var _0x4945df=this;return new Promise(function(_0x1ee739,_0x334741){return db['MailAccount'][_0x0813('0x19')]({'raw':_0x3639fc[_0x0813('0x1a')]?_0x3639fc[_0x0813('0x1a')][_0x0813('0x1b')]===undefined?!![]:![]:!![],'where':_0x3639fc[_0x0813('0x1a')]?_0x3639fc['options'][_0x0813('0x1c')]||null:null,'attributes':_0x3639fc[_0x0813('0x1a')]?_0x3639fc[_0x0813('0x1a')]['attributes']||null:null,'limit':_0x3639fc[_0x0813('0x1a')]?_0x3639fc['options']['limit']||null:null,'include':_0x3639fc[_0x0813('0x1a')]?_0x3639fc['options']['include']?_[_0x0813('0x1d')](_0x3639fc[_0x0813('0x1a')][_0x0813('0x1e')],function(_0x2f8849){return{'model':db[_0x2f8849[_0x0813('0x1f')]],'as':_0x2f8849['as'],'attributes':_0x2f8849[_0x0813('0x20')],'include':_0x2f8849[_0x0813('0x1e')]?_[_0x0813('0x1d')](_0x2f8849['include'],function(_0x1c76b0){return{'model':db[_0x1c76b0[_0x0813('0x1f')]],'as':_0x1c76b0['as'],'attributes':_0x1c76b0[_0x0813('0x20')],'include':_0x1c76b0[_0x0813('0x1e')]?_[_0x0813('0x1d')](_0x1c76b0[_0x0813('0x1e')],function(_0x55e115){return{'model':db[_0x55e115[_0x0813('0x1f')]],'as':_0x55e115['as'],'attributes':_0x55e115[_0x0813('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54bf5d){logger[_0x0813('0x10')](_0x0813('0x18'),_0x3639fc);logger[_0x0813('0x13')](_0x0813('0x18'),_0x3639fc,JSON[_0x0813('0x14')](_0x54bf5d));_0x1ee739(_0x54bf5d);})[_0x0813('0x21')](function(_0x5eba65){logger[_0x0813('0x15')](_0x0813('0x18'),_0x5eba65['message'],_0x3639fc);_0x334741(_0x4945df['error'](0x1f4,_0x5eba65[_0x0813('0x17')]));});});};exports[_0x0813('0x22')]=function(_0x3134bb){var _0x4e303b=this;return new Promise(function(_0x200ffa,_0x206313){return db['MailAccount']['find']({'raw':_0x3134bb[_0x0813('0x1a')]?_0x3134bb[_0x0813('0x1a')][_0x0813('0x1b')]===undefined?!![]:![]:!![],'where':_0x3134bb[_0x0813('0x1a')]?_0x3134bb['options'][_0x0813('0x1c')]||null:null,'attributes':_0x3134bb[_0x0813('0x1a')]?_0x3134bb[_0x0813('0x1a')][_0x0813('0x20')]||null:null,'include':_0x3134bb['options']?_0x3134bb['options'][_0x0813('0x1e')]?_[_0x0813('0x1d')](_0x3134bb[_0x0813('0x1a')]['include'],function(_0x2c902d){return{'model':db[_0x2c902d[_0x0813('0x1f')]],'as':_0x2c902d['as'],'attributes':_0x2c902d[_0x0813('0x20')],'include':_0x2c902d['include']?_['map'](_0x2c902d[_0x0813('0x1e')],function(_0x296565){return{'model':db[_0x296565[_0x0813('0x1f')]],'as':_0x296565['as'],'attributes':_0x296565[_0x0813('0x20')],'include':_0x296565[_0x0813('0x1e')]?_[_0x0813('0x1d')](_0x296565['include'],function(_0x18d162){return{'model':db[_0x18d162['model']],'as':_0x18d162['as'],'attributes':_0x18d162['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1cdb40){logger[_0x0813('0x10')]('ShowMailAccount',_0x3134bb);logger['debug'](_0x0813('0x22'),_0x3134bb,JSON[_0x0813('0x14')](_0x1cdb40));_0x200ffa(_0x1cdb40);})[_0x0813('0x21')](function(_0x45a1d7){logger[_0x0813('0x15')](_0x0813('0x22'),_0x45a1d7[_0x0813('0x17')],_0x3134bb);_0x206313(_0x4e303b[_0x0813('0x15')](0x1f4,_0x45a1d7[_0x0813('0x17')]));});});};exports[_0x0813('0x23')]=function(_0x54b271){var _0x4c4f29=this;return new Promise(function(_0x5af8be,_0x23036d){var _0xee399={'body':_0x54b271['body'],'channel':_0x0813('0x24')};var _0x15b4aa=_[_0x0813('0x25')](_['keys'](db[_0x0813('0x26')][_0x0813('0x27')]),[_0x0813('0x28'),'updatedAt',_0x0813('0x29'),_0x0813('0x2a')]);var _0x2931da=![];if(_0x54b271['body']['id']){delete _0x54b271[_0x0813('0x2b')]['id'];}if(_[_0x0813('0x2c')](_0x54b271['body'][_0x0813('0x2d')])){return _0x23036d(_0x4c4f29[_0x0813('0x15')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x0813('0x2c')](_0x54b271['body'][_0x0813('0x2b')])||_0x54b271[_0x0813('0x2b')][_0x0813('0x2b')]===''){return _0x23036d(_0x4c4f29['error'](0x1f4,_0x0813('0x2e')));}if(_['isNil'](_0x54b271[_0x0813('0x2b')][_0x0813('0x2f')])){return _0x23036d(_0x4c4f29[_0x0813('0x15')](0x1f4,_0x0813('0x30')+_0x15b4aa));}if(!_[_0x0813('0x31')](_0x15b4aa,_0x54b271[_0x0813('0x2b')]['mapKey'])){return _0x23036d(_0x4c4f29[_0x0813('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x15b4aa));}var _0x182154={};_0x182154[_0x54b271['body']['mapKey']]=_0x54b271['body'][_0x0813('0x2d')];return db[_0x0813('0x32')][_0x0813('0x33')]({'where':{'id':_0x54b271[_0x0813('0x34')]['id']},'include':[{'model':db[_0x0813('0x35')],'as':_0x0813('0x36'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x182154,'limit':0x1,'order':[[_0x0813('0x37'),_0x0813('0x38')]]}]},{'model':db[_0x0813('0x39')],'as':_0x0813('0x3a')},{'model':db[_0x0813('0x3b')],'as':_0x0813('0x3c')}]})[_0x0813('0xf')](function(_0x436819){if(_0x436819&&_0x436819['List']){var _0x405529=_0x436819[_0x0813('0x3d')]({'plain':!![]});_0xee399[_0x0813('0x34')]=_[_0x0813('0x3e')](_0x405529,[_0x0813('0x3a'),_0x0813('0x36')]);_0xee399['applications']=_0x405529[_0x0813('0x3a')];_0xee399['list']=_0x405529[_0x0813('0x36')];_0xee399[_0x0813('0x3f')]=_[_0x0813('0x40')](_0xee399[_0x0813('0x3f')],['priority'],[_0x0813('0x41')]);if(_0xee399[_0x0813('0x34')]&&_0xee399[_0x0813('0x34')][_0x0813('0x42')]){_0xee399['applications'][_0x0813('0x43')]({'id':0x0,'priority':_0xee399[_0x0813('0x3f')]['length']+0x1,'app':'close','appdata':_0x0813('0x42'),'interval':_0x0813('0x44')});}if(_0xee399[_0x0813('0x34')]['Applications']){delete _0xee399['account']['Applications'];}if(_0xee399['account'][_0x0813('0x36')]){delete _0xee399[_0x0813('0x34')][_0x0813('0x36')];}if(_0x405529[_0x0813('0x36')]['Contacts'][_0x0813('0x45')]){return _0x405529[_0x0813('0x36')]['Contacts'][0x0];}var _0x50047d=_[_0x0813('0xb')](_0x54b271['body'],{'firstName':_0x54b271[_0x0813('0x2b')][_0x0813('0x2d')],'ListId':_0x405529[_0x0813('0x2a')]});_0x50047d[_0x54b271['body'][_0x0813('0x2f')]]=_0x54b271[_0x0813('0x2b')][_0x0813('0x2d')];return db[_0x0813('0x26')][_0x0813('0x46')](_0x50047d);}else{throw new Error(_0x0813('0x47'));}})['then'](function(_0x50733e){_0xee399[_0x0813('0x48')]=_0x50733e;if(_0x50733e){if(!_0x54b271[_0x0813('0x2b')][_0x0813('0x17')][_0x0813('0x49')]){_0x54b271['body'][_0x0813('0x17')]['messageId']=rs[_0x0813('0x4a')]()+'\x20'+_0x54b271[_0x0813('0x2b')][_0x0813('0x17')][_0x0813('0x2d')];}var _0x19b183={'ContactId':_0x50733e['id'],'MailAccountId':_0x54b271[_0x0813('0x34')]['id'],'inReplyTo':_0x54b271[_0x0813('0x2b')][_0x0813('0x17')]['messageId'],'to':_0x54b271[_0x0813('0x2b')][_0x0813('0x17')][_0x0813('0x2d')],'cc':_0x54b271[_0x0813('0x2b')][_0x0813('0x17')]['cc'],'subject':_0x54b271[_0x0813('0x2b')][_0x0813('0x17')]['subject'],'attach':_0x54b271[_0x0813('0x2b')][_0x0813('0x17')][_0x0813('0x4b')],'lastMsgAt':moment()['format'](_0x0813('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x54b271[_0x0813('0x2b')][_0x0813('0x2b')]};return db[_0x0813('0x4d')][_0x0813('0x33')]({'where':{'closed':![],'MailAccountId':_0x54b271[_0x0813('0x34')]['id']},'include':[{'model':db[_0x0813('0x4e')],'as':_0x0813('0x4f'),'attributes':[_0x0813('0x49')],'where':{'messageId':_0x54b271[_0x0813('0x2b')][_0x0813('0x17')]['inReplyTo']}}]})[_0x0813('0xf')](function(_0x26045c){if(_0x26045c){return[_0x26045c,![]];}return db['MailInteraction'][_0x0813('0x46')](_0x19b183)['then'](function(_0x477844){return[_0x477844,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x523fbe,_0x24eab3){if(_0x523fbe){_0x2931da=_0x24eab3;if(!_0x24eab3){return _0x523fbe[_0x0813('0x50')]({'inReplyTo':_0x54b271[_0x0813('0x2b')]['message'][_0x0813('0x49')],'to':_0x54b271['body']['message'][_0x0813('0x2d')],'cc':_0x54b271['body'][_0x0813('0x17')]['cc'],'subject':_0x54b271[_0x0813('0x2b')][_0x0813('0x17')][_0x0813('0x51')],'attach':_0x523fbe[_0x0813('0x4b')]?_0x523fbe[_0x0813('0x4b')]:_0x54b271[_0x0813('0x2b')][_0x0813('0x17')][_0x0813('0x4b')],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x0813('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x54b271[_0x0813('0x2b')][_0x0813('0x2b')]});}else{return _0x523fbe;}}})[_0x0813('0xf')](function(_0x33c215){_0xee399['interaction']=_0x33c215['get']({'plain':!![]});_0xee399[_0x0813('0x52')]['created']=_0x2931da;return db[_0x0813('0x4e')]['create']({'body':_0x54b271[_0x0813('0x2b')][_0x0813('0x2b')],'MailAccountId':_0x54b271['account']['id'],'MailInteractionId':_0x33c215['id'],'direction':'in','ContactId':_0xee399['contact']['id'],'messageId':_0x54b271[_0x0813('0x2b')][_0x0813('0x17')][_0x0813('0x49')],'from':_0x54b271['body'][_0x0813('0x17')][_0x0813('0x2d')],'to':_0x54b271['body'][_0x0813('0x17')]['to'],'cc':_0x54b271[_0x0813('0x2b')]['message']['cc'],'subject':_0x54b271[_0x0813('0x2b')][_0x0813('0x17')][_0x0813('0x51')],'attach':_0x54b271['body'][_0x0813('0x17')][_0x0813('0x4b')],'Attachments':_0x54b271['body'][_0x0813('0x17')][_0x0813('0x53')],'originTo':_0x54b271[_0x0813('0x2b')][_0x0813('0x17')][_0x0813('0x54')],'originCc':_0x54b271[_0x0813('0x2b')]['message'][_0x0813('0x55')],'bcc':_0x54b271[_0x0813('0x2b')]['message']['bcc']},{'include':[{'model':db[_0x0813('0x56')],'as':_0x0813('0x57')}]});})[_0x0813('0xf')](function(_0xbbf167){_0xee399['message']=_0xbbf167;if(_0xee399['interaction'][_0x0813('0x58')]){return db[_0x0813('0x59')][_0x0813('0x33')]({'attributes':['id','name'],'where':{'id':_0xee399[_0x0813('0x52')][_0x0813('0x58')]}})[_0x0813('0xf')](function(_0x361cf5){if(_0x361cf5){_0xee399['applications'][_0x0813('0x5a')]({'id':0x0,'priority':0x0,'app':_0x0813('0x5b'),'appdata':_0x361cf5[_0x0813('0x5c')]+','+(_0xee399[_0x0813('0x34')][_0x0813('0x5d')]||0xa),'interval':_0x0813('0x44')});}return respondWithRpcPromise(_0x0813('0x5e'),_0x0813('0x5f'),_0xee399);});}return respondWithRpcPromise(_0x0813('0x5e'),_0x0813('0x5f'),_0xee399);})[_0x0813('0xf')](function(_0x154b23){_0x5af8be(_0x154b23);})[_0x0813('0x21')](function(_0x21afd0){_0x23036d(_0x4c4f29[_0x0813('0x15')](0x1f4,_0x21afd0[_0x0813('0x17')]));});});}; \ No newline at end of file +var _0x750a=['inReplyTo','spread','update','subject','interaction','created','contact','attachments','originTo','bcc','Attachment','Attachments','User','UserId','unshift','agent','name','*,*,*,*','Start','startRouting','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','MailAccount','options','where','limit','include','map','model','attributes','GetMailAccount','stringify','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','updatedAt','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','account','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','List','list','applications','priority','asc','autoclose','close','create','List\x20not\x20found','messageId','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages'];(function(_0x2f4d5f,_0xda7f63){var _0x13dfeb=function(_0x567b81){while(--_0x567b81){_0x2f4d5f['push'](_0x2f4d5f['shift']());}};_0x13dfeb(++_0xda7f63);}(_0x750a,0x140));var _0xa750=function(_0x4423bb,_0x4e0392){_0x4423bb=_0x4423bb-0x0;var _0x5410b5=_0x750a[_0x4423bb];return _0x5410b5;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232c});config[_0xa750('0xb')]=_[_0xa750('0xc')](config[_0xa750('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa750('0xb')]));require('./mailAccount.socket')[_0xa750('0xd')](socket);function respondWithRpcPromise(_0x1760f5,_0x51f594,_0x264284){return new BPromise(function(_0x2c2ea4,_0x5870f0){return client['request'](_0x1760f5,_0x264284)[_0xa750('0xe')](function(_0x4b19a1){logger[_0xa750('0xf')](_0xa750('0x10'),_0x51f594,'request\x20sent');logger[_0xa750('0x11')](_0xa750('0x12'),_0x51f594,_0xa750('0x13'),JSON['stringify'](_0x4b19a1));if(_0x4b19a1[_0xa750('0x14')]){if(_0x4b19a1[_0xa750('0x14')][_0xa750('0x15')]===0x1f4){logger[_0xa750('0x14')](_0xa750('0x10'),_0x51f594,_0x4b19a1[_0xa750('0x14')]['message']);return _0x5870f0(_0x4b19a1[_0xa750('0x14')][_0xa750('0x16')]);}logger[_0xa750('0x14')]('MailAccount,\x20%s,\x20%s',_0x51f594,_0x4b19a1[_0xa750('0x14')][_0xa750('0x16')]);return _0x2c2ea4(_0x4b19a1['error']['message']);}else{logger[_0xa750('0xf')]('MailAccount,\x20%s,\x20%s',_0x51f594,_0xa750('0x13'));_0x2c2ea4(_0x4b19a1[_0xa750('0x17')]['message']);}})[_0xa750('0x18')](function(_0x500a84){logger['error'](_0xa750('0x10'),_0x51f594,_0x500a84);_0x5870f0(_0x500a84);});});}exports['GetMailAccount']=function(_0x3fa031){var _0x4f170f=this;return new Promise(function(_0x174a8c,_0x4a007d){return db[_0xa750('0x19')]['findAll']({'raw':_0x3fa031[_0xa750('0x1a')]?_0x3fa031['options']['raw']===undefined?!![]:![]:!![],'where':_0x3fa031[_0xa750('0x1a')]?_0x3fa031['options'][_0xa750('0x1b')]||null:null,'attributes':_0x3fa031['options']?_0x3fa031['options']['attributes']||null:null,'limit':_0x3fa031['options']?_0x3fa031[_0xa750('0x1a')][_0xa750('0x1c')]||null:null,'include':_0x3fa031[_0xa750('0x1a')]?_0x3fa031[_0xa750('0x1a')][_0xa750('0x1d')]?_[_0xa750('0x1e')](_0x3fa031[_0xa750('0x1a')][_0xa750('0x1d')],function(_0x3d52b3){return{'model':db[_0x3d52b3[_0xa750('0x1f')]],'as':_0x3d52b3['as'],'attributes':_0x3d52b3[_0xa750('0x20')],'include':_0x3d52b3[_0xa750('0x1d')]?_[_0xa750('0x1e')](_0x3d52b3[_0xa750('0x1d')],function(_0x310e2d){return{'model':db[_0x310e2d['model']],'as':_0x310e2d['as'],'attributes':_0x310e2d[_0xa750('0x20')],'include':_0x310e2d[_0xa750('0x1d')]?_[_0xa750('0x1e')](_0x310e2d['include'],function(_0x35ab53){return{'model':db[_0x35ab53[_0xa750('0x1f')]],'as':_0x35ab53['as'],'attributes':_0x35ab53[_0xa750('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa750('0xe')](function(_0x579f1c){logger[_0xa750('0xf')](_0xa750('0x21'),_0x3fa031);logger[_0xa750('0x11')](_0xa750('0x21'),_0x3fa031,JSON[_0xa750('0x22')](_0x579f1c));_0x174a8c(_0x579f1c);})['catch'](function(_0x46cc11){logger['error'](_0xa750('0x21'),_0x46cc11[_0xa750('0x16')],_0x3fa031);_0x4a007d(_0x4f170f['error'](0x1f4,_0x46cc11[_0xa750('0x16')]));});});};exports[_0xa750('0x23')]=function(_0x5e66fd){var _0x314f88=this;return new Promise(function(_0xbf5164,_0xe59fe7){return db[_0xa750('0x19')][_0xa750('0x24')]({'raw':_0x5e66fd['options']?_0x5e66fd[_0xa750('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5e66fd[_0xa750('0x1a')]?_0x5e66fd[_0xa750('0x1a')][_0xa750('0x1b')]||null:null,'attributes':_0x5e66fd[_0xa750('0x1a')]?_0x5e66fd['options'][_0xa750('0x20')]||null:null,'include':_0x5e66fd[_0xa750('0x1a')]?_0x5e66fd['options'][_0xa750('0x1d')]?_[_0xa750('0x1e')](_0x5e66fd[_0xa750('0x1a')][_0xa750('0x1d')],function(_0x4b13fc){return{'model':db[_0x4b13fc[_0xa750('0x1f')]],'as':_0x4b13fc['as'],'attributes':_0x4b13fc['attributes'],'include':_0x4b13fc['include']?_[_0xa750('0x1e')](_0x4b13fc[_0xa750('0x1d')],function(_0xaa626c){return{'model':db[_0xaa626c['model']],'as':_0xaa626c['as'],'attributes':_0xaa626c[_0xa750('0x20')],'include':_0xaa626c[_0xa750('0x1d')]?_[_0xa750('0x1e')](_0xaa626c['include'],function(_0x37abd2){return{'model':db[_0x37abd2[_0xa750('0x1f')]],'as':_0x37abd2['as'],'attributes':_0x37abd2[_0xa750('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d09fb){logger[_0xa750('0xf')](_0xa750('0x23'),_0x5e66fd);logger['debug'](_0xa750('0x23'),_0x5e66fd,JSON[_0xa750('0x22')](_0x1d09fb));_0xbf5164(_0x1d09fb);})[_0xa750('0x18')](function(_0x10589b){logger['error']('ShowMailAccount',_0x10589b[_0xa750('0x16')],_0x5e66fd);_0xe59fe7(_0x314f88[_0xa750('0x14')](0x1f4,_0x10589b['message']));});});};exports[_0xa750('0x25')]=function(_0x2f57e9){var _0x15d35a=this;return new Promise(function(_0x1166ff,_0x302a79){var _0x5e0bdf={'body':_0x2f57e9[_0xa750('0x26')],'channel':_0xa750('0x27')};var _0x847081=_[_0xa750('0x28')](_[_0xa750('0x29')](db[_0xa750('0x2a')][_0xa750('0x2b')]),['createdAt',_0xa750('0x2c'),'CompanyId',_0xa750('0x2d')]);var _0x4ab922=![];if(_0x2f57e9[_0xa750('0x26')]['id']){delete _0x2f57e9[_0xa750('0x26')]['id'];}if(_[_0xa750('0x2e')](_0x2f57e9[_0xa750('0x26')][_0xa750('0x2f')])){return _0x302a79(_0x15d35a[_0xa750('0x14')](0x1f4,_0xa750('0x30')));}if(_[_0xa750('0x2e')](_0x2f57e9[_0xa750('0x26')][_0xa750('0x26')])||_0x2f57e9[_0xa750('0x26')][_0xa750('0x26')]===''){return _0x302a79(_0x15d35a[_0xa750('0x14')](0x1f4,_0xa750('0x31')));}if(_[_0xa750('0x2e')](_0x2f57e9[_0xa750('0x26')][_0xa750('0x32')])){return _0x302a79(_0x15d35a[_0xa750('0x14')](0x1f4,_0xa750('0x33')+_0x847081));}if(!_[_0xa750('0x34')](_0x847081,_0x2f57e9['body'][_0xa750('0x32')])){return _0x302a79(_0x15d35a[_0xa750('0x14')](0x1f4,_0xa750('0x35')+_0x847081));}var _0xedd9e={};_0xedd9e[_0x2f57e9[_0xa750('0x26')][_0xa750('0x32')]]=_0x2f57e9[_0xa750('0x26')][_0xa750('0x2f')];return db[_0xa750('0x19')]['find']({'where':{'id':_0x2f57e9[_0xa750('0x36')]['id']},'include':[{'model':db[_0xa750('0x37')],'as':'List','include':[{'model':db[_0xa750('0x2a')],'as':_0xa750('0x38'),'where':_0xedd9e,'limit':0x1,'order':[[_0xa750('0x2c'),_0xa750('0x39')]]}]},{'model':db[_0xa750('0x3a')],'as':_0xa750('0x3b')},{'model':db[_0xa750('0x3c')],'as':_0xa750('0x3d')}]})[_0xa750('0xe')](function(_0x6cd49f){if(_0x6cd49f&&_0x6cd49f['List']){var _0x3be7d9=_0x6cd49f[_0xa750('0x3e')]({'plain':!![]});_0x5e0bdf['account']=_[_0xa750('0x3f')](_0x3be7d9,[_0xa750('0x3b'),_0xa750('0x40')]);_0x5e0bdf['applications']=_0x3be7d9[_0xa750('0x3b')];_0x5e0bdf[_0xa750('0x41')]=_0x3be7d9[_0xa750('0x40')];_0x5e0bdf[_0xa750('0x42')]=_['orderBy'](_0x5e0bdf[_0xa750('0x42')],[_0xa750('0x43')],[_0xa750('0x44')]);if(_0x5e0bdf[_0xa750('0x36')]&&_0x5e0bdf['account'][_0xa750('0x45')]){_0x5e0bdf[_0xa750('0x42')]['push']({'id':0x0,'priority':_0x5e0bdf[_0xa750('0x42')]['length']+0x1,'app':_0xa750('0x46'),'appdata':_0xa750('0x45'),'interval':'*,*,*,*'});}if(_0x5e0bdf['account']['Applications']){delete _0x5e0bdf[_0xa750('0x36')][_0xa750('0x3b')];}if(_0x5e0bdf['account'][_0xa750('0x40')]){delete _0x5e0bdf[_0xa750('0x36')][_0xa750('0x40')];}if(_0x3be7d9['List']['Contacts']['length']){return _0x3be7d9['List'][_0xa750('0x38')][0x0];}var _0x4a1b5d=_[_0xa750('0xc')](_0x2f57e9[_0xa750('0x26')],{'firstName':_0x2f57e9['body'][_0xa750('0x2f')],'ListId':_0x3be7d9['ListId']});_0x4a1b5d[_0x2f57e9[_0xa750('0x26')]['mapKey']]=_0x2f57e9['body']['from'];return db['CmContact'][_0xa750('0x47')](_0x4a1b5d);}else{throw new Error(_0xa750('0x48'));}})['then'](function(_0x552578){_0x5e0bdf['contact']=_0x552578;if(_0x552578){if(!_0x2f57e9[_0xa750('0x26')][_0xa750('0x16')][_0xa750('0x49')]){_0x2f57e9[_0xa750('0x26')][_0xa750('0x16')][_0xa750('0x49')]=rs['generate']()+'\x20'+_0x2f57e9['body'][_0xa750('0x16')][_0xa750('0x2f')];}var _0x13d729={'ContactId':_0x552578['id'],'MailAccountId':_0x2f57e9[_0xa750('0x36')]['id'],'inReplyTo':_0x2f57e9[_0xa750('0x26')]['message'][_0xa750('0x49')],'to':_0x2f57e9[_0xa750('0x26')][_0xa750('0x16')][_0xa750('0x2f')],'cc':_0x2f57e9[_0xa750('0x26')][_0xa750('0x16')]['cc'],'subject':_0x2f57e9[_0xa750('0x26')][_0xa750('0x16')]['subject'],'attach':_0x2f57e9[_0xa750('0x26')][_0xa750('0x16')][_0xa750('0x4a')],'lastMsgAt':moment()[_0xa750('0x4b')](_0xa750('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x2f57e9['body'][_0xa750('0x26')]};return db[_0xa750('0x4d')][_0xa750('0x24')]({'where':{'closed':![],'MailAccountId':_0x2f57e9[_0xa750('0x36')]['id']},'include':[{'model':db[_0xa750('0x4e')],'as':_0xa750('0x4f'),'attributes':[_0xa750('0x49')],'where':{'messageId':_0x2f57e9[_0xa750('0x26')][_0xa750('0x16')][_0xa750('0x50')]}}]})[_0xa750('0xe')](function(_0x3e0ec8){if(_0x3e0ec8){return[_0x3e0ec8,![]];}return db[_0xa750('0x4d')][_0xa750('0x47')](_0x13d729)[_0xa750('0xe')](function(_0x313732){return[_0x313732,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xa750('0x51')](function(_0x4ad344,_0x182d2e){if(_0x4ad344){_0x4ab922=_0x182d2e;if(!_0x182d2e){return _0x4ad344[_0xa750('0x52')]({'inReplyTo':_0x2f57e9[_0xa750('0x26')]['message'][_0xa750('0x49')],'to':_0x2f57e9[_0xa750('0x26')][_0xa750('0x16')][_0xa750('0x2f')],'cc':_0x2f57e9[_0xa750('0x26')][_0xa750('0x16')]['cc'],'subject':_0x2f57e9['body'][_0xa750('0x16')][_0xa750('0x53')],'attach':_0x4ad344['attach']?_0x4ad344[_0xa750('0x4a')]:_0x2f57e9[_0xa750('0x26')][_0xa750('0x16')][_0xa750('0x4a')],'substatus':null,'substatusAt':moment()[_0xa750('0x4b')](_0xa750('0x4c')),'lastMsgAt':moment()[_0xa750('0x4b')](_0xa750('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x2f57e9[_0xa750('0x26')][_0xa750('0x26')]});}else{return _0x4ad344;}}})[_0xa750('0xe')](function(_0x5d3ae2){_0x5e0bdf['interaction']=_0x5d3ae2[_0xa750('0x3e')]({'plain':!![]});_0x5e0bdf[_0xa750('0x54')][_0xa750('0x55')]=_0x4ab922;return db[_0xa750('0x4e')]['create']({'body':_0x2f57e9[_0xa750('0x26')][_0xa750('0x26')],'MailAccountId':_0x2f57e9[_0xa750('0x36')]['id'],'MailInteractionId':_0x5d3ae2['id'],'direction':'in','ContactId':_0x5e0bdf[_0xa750('0x56')]['id'],'messageId':_0x2f57e9[_0xa750('0x26')][_0xa750('0x16')][_0xa750('0x49')],'from':_0x2f57e9[_0xa750('0x26')][_0xa750('0x16')][_0xa750('0x2f')],'to':_0x2f57e9[_0xa750('0x26')]['message']['to'],'cc':_0x2f57e9['body'][_0xa750('0x16')]['cc'],'subject':_0x2f57e9['body']['message'][_0xa750('0x53')],'attach':_0x2f57e9[_0xa750('0x26')][_0xa750('0x16')][_0xa750('0x4a')],'Attachments':_0x2f57e9[_0xa750('0x26')]['message'][_0xa750('0x57')],'originTo':_0x2f57e9[_0xa750('0x26')][_0xa750('0x16')][_0xa750('0x58')],'originCc':_0x2f57e9[_0xa750('0x26')][_0xa750('0x16')]['originCc'],'bcc':_0x2f57e9['body'][_0xa750('0x16')][_0xa750('0x59')]},{'include':[{'model':db[_0xa750('0x5a')],'as':_0xa750('0x5b')}]});})[_0xa750('0xe')](function(_0x18f74f){_0x5e0bdf[_0xa750('0x16')]=_0x18f74f;if(_0x5e0bdf[_0xa750('0x54')]['UserId']){return db[_0xa750('0x5c')]['find']({'attributes':['id','name'],'where':{'id':_0x5e0bdf[_0xa750('0x54')][_0xa750('0x5d')]}})[_0xa750('0xe')](function(_0x1f5ee4){if(_0x1f5ee4){_0x5e0bdf['applications'][_0xa750('0x5e')]({'id':0x0,'priority':0x0,'app':_0xa750('0x5f'),'appdata':_0x1f5ee4[_0xa750('0x60')]+','+(_0x5e0bdf[_0xa750('0x36')]['waitForTheAssignedAgent']||0xa),'interval':_0xa750('0x61')});}return respondWithRpcPromise(_0xa750('0x62'),_0xa750('0x63'),_0x5e0bdf);});}return respondWithRpcPromise(_0xa750('0x62'),_0xa750('0x63'),_0x5e0bdf);})[_0xa750('0xe')](function(_0x40a7f9){_0x1166ff(_0x40a7f9);})[_0xa750('0x18')](function(_0x51ea09){_0x302a79(_0x15d35a['error'](0x1f4,_0x51ea09[_0xa750('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 93d920c..dcfe9db 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 _0xd9ce=['update','emit','removeListener','register','./mailAccount.events','save','remove'];(function(_0x3ff417,_0x1217d8){var _0x208cee=function(_0x165a04){while(--_0x165a04){_0x3ff417['push'](_0x3ff417['shift']());}};_0x208cee(++_0x1217d8);}(_0xd9ce,0xeb));var _0xed9c=function(_0x87506e,_0x5680ec){_0x87506e=_0x87506e-0x0;var _0x5496a4=_0xd9ce[_0x87506e];return _0x5496a4;};'use strict';var MailAccountEvents=require(_0xed9c('0x0'));var events=[_0xed9c('0x1'),_0xed9c('0x2'),_0xed9c('0x3')];function createListener(_0x3892c2,_0x2008a1){return function(_0x1aa913){_0x2008a1[_0xed9c('0x4')](_0x3892c2,_0x1aa913);};}function removeListener(_0x5903b6,_0x3c9c4a){return function(){MailAccountEvents[_0xed9c('0x5')](_0x5903b6,_0x3c9c4a);};}exports[_0xed9c('0x6')]=function(_0x154e9d){for(var _0x3043a6=0x0,_0x434898=events['length'];_0x3043a6<_0x434898;_0x3043a6++){var _0x2ad757=events[_0x3043a6];var _0xde32e4=createListener('mailAccount:'+_0x2ad757,_0x154e9d);MailAccountEvents['on'](_0x2ad757,_0xde32e4);}}; \ No newline at end of file +var _0xfc9b=['removeListener','register','length','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x4921b9,_0x2ca43d){var _0x314984=function(_0x42b33b){while(--_0x42b33b){_0x4921b9['push'](_0x4921b9['shift']());}};_0x314984(++_0x2ca43d);}(_0xfc9b,0x74));var _0xbfc9=function(_0x2da9e3,_0x30971d){_0x2da9e3=_0x2da9e3-0x0;var _0x48055b=_0xfc9b[_0x2da9e3];return _0x48055b;};'use strict';var MailAccountEvents=require(_0xbfc9('0x0'));var events=[_0xbfc9('0x1'),_0xbfc9('0x2'),_0xbfc9('0x3')];function createListener(_0x29639e,_0x4618f9){return function(_0x397d76){_0x4618f9['emit'](_0x29639e,_0x397d76);};}function removeListener(_0x2eedb4,_0x49e470){return function(){MailAccountEvents[_0xbfc9('0x4')](_0x2eedb4,_0x49e470);};}exports[_0xbfc9('0x5')]=function(_0x523ff1){for(var _0x1dbece=0x0,_0x266c05=events[_0xbfc9('0x6')];_0x1dbece<_0x266c05;_0x1dbece++){var _0xe288d1=events[_0x1dbece];var _0x4e0f74=createListener(_0xbfc9('0x7')+_0xe288d1,_0x523ff1);MailAccountEvents['on'](_0xe288d1,_0x4e0f74);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 5289229..fddab01 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 _0x76dc=['../../config/environment','/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x76dc,0x1f2));var _0xc76d=function(_0x2ed04b,_0x858ba2){_0x2ed04b=_0x2ed04b-0x0;var _0x7822a=_0x76dc[_0x2ed04b];return _0x7822a;};'use strict';var multer=require(_0xc76d('0x0'));var util=require(_0xc76d('0x1'));var path=require(_0xc76d('0x2'));var timeout=require(_0xc76d('0x3'));var express=require('express');var router=express[_0xc76d('0x4')]();var auth=require(_0xc76d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc76d('0x6'));var controller=require('./mailApplication.controller');router['get'](_0xc76d('0x7'),auth[_0xc76d('0x8')](),controller[_0xc76d('0x9')]);router['put']('/:id',auth[_0xc76d('0x8')](),controller[_0xc76d('0xa')]);router[_0xc76d('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xc76d('0xc')]);module[_0xc76d('0xd')]=router; \ No newline at end of file +var _0x7072=['put','update','delete','exports','util','path','connect-timeout','express','Router','../../config/environment','get','/:id','isAuthenticated','show'];(function(_0x1d18d0,_0x55911d){var _0x1c8460=function(_0x255a80){while(--_0x255a80){_0x1d18d0['push'](_0x1d18d0['shift']());}};_0x1c8460(++_0x55911d);}(_0x7072,0x138));var _0x2707=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x7072[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require('multer');var util=require(_0x2707('0x0'));var path=require(_0x2707('0x1'));var timeout=require(_0x2707('0x2'));var express=require(_0x2707('0x3'));var router=express[_0x2707('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2707('0x5'));var controller=require('./mailApplication.controller');router[_0x2707('0x6')](_0x2707('0x7'),auth[_0x2707('0x8')](),controller[_0x2707('0x9')]);router[_0x2707('0xa')](_0x2707('0x7'),auth[_0x2707('0x8')](),controller[_0x2707('0xb')]);router[_0x2707('0xc')](_0x2707('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x2707('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index e78c909..6180b9f 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 _0x98f7=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x5c35c8,_0x50f45e){var _0x340e70=function(_0x1a6052){while(--_0x1a6052){_0x5c35c8['push'](_0x5c35c8['shift']());}};_0x340e70(++_0x50f45e);}(_0x98f7,0x189));var _0x798f=function(_0x4bbb55,_0x5159af){_0x4bbb55=_0x4bbb55-0x0;var _0x3af69c=_0x98f7[_0x4bbb55];return _0x3af69c;};'use strict';var Sequelize=require(_0x798f('0x0'));module[_0x798f('0x1')]={'priority':{'type':Sequelize[_0x798f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x798f('0x3')],'allowNull':![],'defaultValue':_0x798f('0x4')},'appdata':{'type':Sequelize[_0x798f('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x798f('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x7466=['noop','*,*,*,*','exports','STRING'];(function(_0x5a080f,_0x21a32f){var _0x5952b0=function(_0x1ee276){while(--_0x1ee276){_0x5a080f['push'](_0x5a080f['shift']());}};_0x5952b0(++_0x21a32f);}(_0x7466,0xfa));var _0x6746=function(_0x1016d2,_0x1c4981){_0x1016d2=_0x1016d2-0x0;var _0x2ab3ce=_0x7466[_0x1016d2];return _0x2ab3ce;};'use strict';var Sequelize=require('sequelize');module[_0x6746('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6746('0x1')],'allowNull':![],'defaultValue':_0x6746('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6746('0x1')]},'interval':{'type':Sequelize[_0x6746('0x1')],'defaultValue':_0x6746('0x3')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index dbbfc20..05c46e4 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 _0x2855=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','count','offset','set','Content-Range','json','reject','then','end','error','stack','show','params','model','keys','MailApplication','query','fields','attributes','length','include','merge','options','find','update','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x2855,0x8c));var _0x5285=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x2855[_0x220dbb];return _0x2b77de;};'use strict';var pdf=require(_0x5285('0x0'));var emlformat=require(_0x5285('0x1'));var rimraf=require(_0x5285('0x2'));var zipdir=require(_0x5285('0x3'));var jsonpatch=require(_0x5285('0x4'));var rp=require(_0x5285('0x5'));var moment=require(_0x5285('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5285('0x7'));var path=require('path');var sox=require(_0x5285('0x8'));var csv=require(_0x5285('0x9'));var ejs=require(_0x5285('0xa'));var fs=require('fs');var _=require(_0x5285('0xb'));var squel=require(_0x5285('0xc'));var crypto=require(_0x5285('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5285('0xe'));var toCsv=require(_0x5285('0x9'));var querystring=require(_0x5285('0xf'));var Papa=require('papaparse');var Redis=require(_0x5285('0x10'));var authService=require(_0x5285('0x11'));var qs=require(_0x5285('0x12'));var as=require(_0x5285('0x13'));var hardwareService=require(_0x5285('0x14'));var logger=require(_0x5285('0x15'))(_0x5285('0x16'));var utils=require(_0x5285('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fb7cc,_0x34bbb7){_0x34bbb7=_0x34bbb7||0xcc;return function(_0x5386df){if(_0x5386df){return _0x4fb7cc[_0x5285('0x18')](_0x34bbb7);}return _0x4fb7cc[_0x5285('0x19')](_0x34bbb7)['end']();};}function respondWithResult(_0x5b5cc1,_0x5c2adf){_0x5c2adf=_0x5c2adf||0xc8;return function(_0x42654f){if(_0x42654f){return _0x5b5cc1['status'](_0x5c2adf)['json'](_0x42654f);}};}function respondWithFilteredResult(_0x3a23f4,_0x8633a2){return function(_0xc88aa8){if(_0xc88aa8){var _0x3c6e51=_0xc88aa8[_0x5285('0x1a')],_0x460cea=_0x8633a2['offset'],_0x16e9ad=_0x8633a2[_0x5285('0x1b')]+_0x8633a2['limit'],_0x5b1e53;if(_0x16e9ad>=_0x3c6e51){_0x16e9ad=_0x3c6e51;_0x5b1e53=0xc8;}else{_0x5b1e53=0xce;}_0x3a23f4[_0x5285('0x19')](_0x5b1e53);return _0x3a23f4[_0x5285('0x1c')](_0x5285('0x1d'),_0x460cea+'-'+_0x16e9ad+'/'+_0x3c6e51)[_0x5285('0x1e')](_0xc88aa8);}return null;};}function patchUpdates(_0x420f4f){return function(_0x1690ec){try{jsonpatch['apply'](_0x1690ec,_0x420f4f,!![]);}catch(_0x45bf67){return BPromise[_0x5285('0x1f')](_0x45bf67);}return _0x1690ec['save']();};}function saveUpdates(_0x30add0,_0x343d52){return function(_0x2888e7){if(_0x2888e7){return _0x2888e7['update'](_0x30add0)[_0x5285('0x20')](function(_0x38fc6f){return _0x38fc6f;});}return null;};}function removeEntity(_0x4214c0,_0xc078be){return function(_0x1ead06){if(_0x1ead06){return _0x1ead06['destroy']()[_0x5285('0x20')](function(){_0x4214c0['status'](0xcc)[_0x5285('0x21')]();});}};}function handleEntityNotFound(_0x5197e0,_0x2e42fa){return function(_0x1634b3){if(!_0x1634b3){_0x5197e0[_0x5285('0x18')](0x194);}return _0x1634b3;};}function handleError(_0x51a48e,_0x3f377a){_0x3f377a=_0x3f377a||0x1f4;return function(_0x1abb68){logger[_0x5285('0x22')](_0x1abb68[_0x5285('0x23')]);if(_0x1abb68['name']){delete _0x1abb68['name'];}_0x51a48e['status'](_0x3f377a)['send'](_0x1abb68);};}exports[_0x5285('0x24')]=function(_0x123c34,_0x5f4bf7){var _0x36cc26={'raw':!![],'where':{'id':_0x123c34[_0x5285('0x25')]['id']}},_0x1aee77={};_0x1aee77[_0x5285('0x26')]=_[_0x5285('0x27')](db[_0x5285('0x28')]['rawAttributes']);_0x1aee77[_0x5285('0x29')]=_[_0x5285('0x27')](_0x123c34['query']);_0x1aee77['filters']=_['intersection'](_0x1aee77[_0x5285('0x26')],_0x1aee77[_0x5285('0x29')]);_0x36cc26['attributes']=_['intersection'](_0x1aee77[_0x5285('0x26')],qs[_0x5285('0x2a')](_0x123c34[_0x5285('0x29')][_0x5285('0x2a')]));_0x36cc26[_0x5285('0x2b')]=_0x36cc26[_0x5285('0x2b')][_0x5285('0x2c')]?_0x36cc26[_0x5285('0x2b')]:_0x1aee77[_0x5285('0x26')];if(_0x123c34['query']['includeAll']){_0x36cc26[_0x5285('0x2d')]=[{'all':!![]}];}_0x36cc26=_[_0x5285('0x2e')]({},_0x36cc26,_0x123c34[_0x5285('0x2f')]);return db[_0x5285('0x28')][_0x5285('0x30')](_0x36cc26)[_0x5285('0x20')](handleEntityNotFound(_0x5f4bf7,null))[_0x5285('0x20')](respondWithResult(_0x5f4bf7,null))['catch'](handleError(_0x5f4bf7,null));};exports[_0x5285('0x31')]=function(_0x3a2e7a,_0x2cddc3){if(_0x3a2e7a['body']['id']){delete _0x3a2e7a[_0x5285('0x32')]['id'];}return db['MailApplication'][_0x5285('0x30')]({'where':{'id':_0x3a2e7a['params']['id']}})[_0x5285('0x20')](handleEntityNotFound(_0x2cddc3,null))[_0x5285('0x20')](saveUpdates(_0x3a2e7a['body'],null))[_0x5285('0x20')](respondWithResult(_0x2cddc3,null))['catch'](handleError(_0x2cddc3,null));};exports[_0x5285('0x33')]=function(_0x3dde82,_0x3e4eb2){return db[_0x5285('0x28')][_0x5285('0x30')]({'where':{'id':_0x3dde82[_0x5285('0x25')]['id']}})[_0x5285('0x20')](handleEntityNotFound(_0x3e4eb2,null))[_0x5285('0x20')](removeEntity(_0x3e4eb2,null))['catch'](handleError(_0x3e4eb2,null));}; \ No newline at end of file +var _0xe02c=['intersection','model','fields','attributes','length','include','merge','options','find','catch','body','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','reject','save','update','then','destroy','error','stack','name','send','show','params','keys','MailApplication','rawAttributes','query','filters'];(function(_0xbc9917,_0x479324){var _0x20ab5a=function(_0x43951d){while(--_0x43951d){_0xbc9917['push'](_0xbc9917['shift']());}};_0x20ab5a(++_0x479324);}(_0xe02c,0x81));var _0xce02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe02c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xce02('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xce02('0x1'));var rp=require(_0xce02('0x2'));var moment=require(_0xce02('0x3'));var BPromise=require(_0xce02('0x4'));var Mustache=require(_0xce02('0x5'));var util=require(_0xce02('0x6'));var path=require(_0xce02('0x7'));var sox=require(_0xce02('0x8'));var csv=require('to-csv');var ejs=require(_0xce02('0x9'));var fs=require('fs');var _=require(_0xce02('0xa'));var squel=require(_0xce02('0xb'));var crypto=require(_0xce02('0xc'));var jsforce=require(_0xce02('0xd'));var deskjs=require(_0xce02('0xe'));var toCsv=require(_0xce02('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xce02('0x10'));var authService=require(_0xce02('0x11'));var qs=require(_0xce02('0x12'));var as=require(_0xce02('0x13'));var hardwareService=require(_0xce02('0x14'));var logger=require(_0xce02('0x15'))('api');var utils=require(_0xce02('0x16'));var config=require(_0xce02('0x17'));var db=require(_0xce02('0x18'))['db'];function respondWithStatusCode(_0x503ce5,_0x3436b7){_0x3436b7=_0x3436b7||0xcc;return function(_0x131520){if(_0x131520){return _0x503ce5[_0xce02('0x19')](_0x3436b7);}return _0x503ce5[_0xce02('0x1a')](_0x3436b7)[_0xce02('0x1b')]();};}function respondWithResult(_0x2ae50c,_0x5c9d19){_0x5c9d19=_0x5c9d19||0xc8;return function(_0x140c15){if(_0x140c15){return _0x2ae50c[_0xce02('0x1a')](_0x5c9d19)[_0xce02('0x1c')](_0x140c15);}};}function respondWithFilteredResult(_0x335d8d,_0x536c69){return function(_0xee2ca4){if(_0xee2ca4){var _0x4544f5=_0xee2ca4[_0xce02('0x1d')],_0x18c372=_0x536c69['offset'],_0x9affdb=_0x536c69['offset']+_0x536c69[_0xce02('0x1e')],_0x433bf6;if(_0x9affdb>=_0x4544f5){_0x9affdb=_0x4544f5;_0x433bf6=0xc8;}else{_0x433bf6=0xce;}_0x335d8d[_0xce02('0x1a')](_0x433bf6);return _0x335d8d[_0xce02('0x1f')]('Content-Range',_0x18c372+'-'+_0x9affdb+'/'+_0x4544f5)['json'](_0xee2ca4);}return null;};}function patchUpdates(_0x430ef3){return function(_0x26744d){try{jsonpatch['apply'](_0x26744d,_0x430ef3,!![]);}catch(_0x69f982){return BPromise[_0xce02('0x20')](_0x69f982);}return _0x26744d[_0xce02('0x21')]();};}function saveUpdates(_0x50f11f,_0x1b283b){return function(_0x471731){if(_0x471731){return _0x471731[_0xce02('0x22')](_0x50f11f)[_0xce02('0x23')](function(_0x15a74b){return _0x15a74b;});}return null;};}function removeEntity(_0x58790d,_0x47f780){return function(_0x2cbf1b){if(_0x2cbf1b){return _0x2cbf1b[_0xce02('0x24')]()['then'](function(){_0x58790d[_0xce02('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x68b2f5,_0x6f7c78){return function(_0x2f30f1){if(!_0x2f30f1){_0x68b2f5['sendStatus'](0x194);}return _0x2f30f1;};}function handleError(_0x39bf8c,_0x4a61ac){_0x4a61ac=_0x4a61ac||0x1f4;return function(_0x187e05){logger[_0xce02('0x25')](_0x187e05[_0xce02('0x26')]);if(_0x187e05[_0xce02('0x27')]){delete _0x187e05[_0xce02('0x27')];}_0x39bf8c[_0xce02('0x1a')](_0x4a61ac)[_0xce02('0x28')](_0x187e05);};}exports[_0xce02('0x29')]=function(_0x1f9c99,_0x5e70d7){var _0x41591b={'raw':!![],'where':{'id':_0x1f9c99[_0xce02('0x2a')]['id']}},_0x37e6ac={};_0x37e6ac['model']=_[_0xce02('0x2b')](db[_0xce02('0x2c')][_0xce02('0x2d')]);_0x37e6ac['query']=_['keys'](_0x1f9c99[_0xce02('0x2e')]);_0x37e6ac[_0xce02('0x2f')]=_[_0xce02('0x30')](_0x37e6ac[_0xce02('0x31')],_0x37e6ac[_0xce02('0x2e')]);_0x41591b['attributes']=_[_0xce02('0x30')](_0x37e6ac[_0xce02('0x31')],qs[_0xce02('0x32')](_0x1f9c99[_0xce02('0x2e')][_0xce02('0x32')]));_0x41591b['attributes']=_0x41591b[_0xce02('0x33')][_0xce02('0x34')]?_0x41591b[_0xce02('0x33')]:_0x37e6ac[_0xce02('0x31')];if(_0x1f9c99[_0xce02('0x2e')]['includeAll']){_0x41591b[_0xce02('0x35')]=[{'all':!![]}];}_0x41591b=_[_0xce02('0x36')]({},_0x41591b,_0x1f9c99[_0xce02('0x37')]);return db['MailApplication'][_0xce02('0x38')](_0x41591b)['then'](handleEntityNotFound(_0x5e70d7,null))[_0xce02('0x23')](respondWithResult(_0x5e70d7,null))[_0xce02('0x39')](handleError(_0x5e70d7,null));};exports['update']=function(_0x7b8aa7,_0x1e6af2){if(_0x7b8aa7[_0xce02('0x3a')]['id']){delete _0x7b8aa7[_0xce02('0x3a')]['id'];}return db['MailApplication'][_0xce02('0x38')]({'where':{'id':_0x7b8aa7[_0xce02('0x2a')]['id']}})[_0xce02('0x23')](handleEntityNotFound(_0x1e6af2,null))['then'](saveUpdates(_0x7b8aa7['body'],null))['then'](respondWithResult(_0x1e6af2,null))[_0xce02('0x39')](handleError(_0x1e6af2,null));};exports[_0xce02('0x24')]=function(_0xfdd65e,_0x33dc18){return db[_0xce02('0x2c')][_0xce02('0x38')]({'where':{'id':_0xfdd65e[_0xce02('0x2a')]['id']}})[_0xce02('0x23')](handleEntityNotFound(_0x33dc18,null))['then'](removeEntity(_0x33dc18,null))[_0xce02('0x39')](handleError(_0x33dc18,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 5993b36..828c830 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 _0xa03c=['exports','define','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./mailApplication.attributes'];(function(_0x328b1c,_0xec0b4f){var _0x4dbeaa=function(_0x432519){while(--_0x432519){_0x328b1c['push'](_0x328b1c['shift']());}};_0x4dbeaa(++_0xec0b4f);}(_0xa03c,0x94));var _0xca03=function(_0x534a4c,_0x1f04d2){_0x534a4c=_0x534a4c-0x0;var _0x18d1d3=_0xa03c[_0x534a4c];return _0x18d1d3;};'use strict';var _=require(_0xca03('0x0'));var util=require('util');var logger=require(_0xca03('0x1'))(_0xca03('0x2'));var moment=require(_0xca03('0x3'));var BPromise=require('bluebird');var rp=require(_0xca03('0x4'));var fs=require('fs');var path=require(_0xca03('0x5'));var rimraf=require(_0xca03('0x6'));var config=require('../../config/environment');var attributes=require(_0xca03('0x7'));module[_0xca03('0x8')]=function(_0x2f0ace,_0x20cf52){return _0x2f0ace[_0xca03('0x9')](_0xca03('0xa'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xca03('0xb'),'collate':_0xca03('0xc')});}; \ No newline at end of file +var _0x689b=['lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x27e1,_0x4b6f1a){var _0x21cab6=function(_0x14f2e0){while(--_0x14f2e0){_0x27e1['push'](_0x27e1['shift']());}};_0x21cab6(++_0x4b6f1a);}(_0x689b,0x142));var _0xb689=function(_0x36430d,_0x43ba06){_0x36430d=_0x36430d-0x0;var _0x39243e=_0x689b[_0x36430d];return _0x39243e;};'use strict';var _=require(_0xb689('0x0'));var util=require('util');var logger=require(_0xb689('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb689('0x2'));var rp=require(_0xb689('0x3'));var fs=require('fs');var path=require(_0xb689('0x4'));var rimraf=require(_0xb689('0x5'));var config=require(_0xb689('0x6'));var attributes=require(_0xb689('0x7'));module[_0xb689('0x8')]=function(_0x4bb98f,_0x1b9fed){return _0x4bb98f[_0xb689('0x9')](_0xb689('0xa'),attributes,{'tableName':_0xb689('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb689('0xc'),'collate':_0xb689('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index f9a8ae8..ba602a3 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 _0xf2db=['result','UpdateMailApplication','MailApplication','update','body','options','raw','limit','debug','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','MailApplication,\x20%s,\x20%s','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x451365,_0x39f498){var _0xd5ab9e=function(_0x4d5833){while(--_0x4d5833){_0x451365['push'](_0x451365['shift']());}};_0xd5ab9e(++_0x39f498);}(_0xf2db,0xf4));var _0xbf2d=function(_0x291601,_0x4ba7a2){_0x291601=_0x291601-0x0;var _0x548f68=_0xf2db[_0x291601];return _0x548f68;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xbf2d('0x0'));var rs=require(_0xbf2d('0x1'));var fs=require('fs');var Redis=require(_0xbf2d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf2d('0x3'));var logger=require(_0xbf2d('0x4'))(_0xbf2d('0x5'));var config=require(_0xbf2d('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbf2d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xe850d7,_0x47ac25,_0x3ab66a){return new BPromise(function(_0x29cf1,_0x155a3e){return client['request'](_0xe850d7,_0x3ab66a)['then'](function(_0x1cfb4d){logger[_0xbf2d('0x8')](_0xbf2d('0x9'),_0x47ac25,'request\x20sent');logger['debug'](_0xbf2d('0xa'),_0x47ac25,_0xbf2d('0xb'),JSON[_0xbf2d('0xc')](_0x1cfb4d));if(_0x1cfb4d['error']){if(_0x1cfb4d[_0xbf2d('0xd')][_0xbf2d('0xe')]===0x1f4){logger['error'](_0xbf2d('0x9'),_0x47ac25,_0x1cfb4d[_0xbf2d('0xd')]['message']);return _0x155a3e(_0x1cfb4d[_0xbf2d('0xd')][_0xbf2d('0xf')]);}logger['error'](_0xbf2d('0x9'),_0x47ac25,_0x1cfb4d[_0xbf2d('0xd')][_0xbf2d('0xf')]);return _0x29cf1(_0x1cfb4d[_0xbf2d('0xd')]['message']);}else{logger[_0xbf2d('0x8')](_0xbf2d('0x9'),_0x47ac25,_0xbf2d('0xb'));_0x29cf1(_0x1cfb4d[_0xbf2d('0x10')][_0xbf2d('0xf')]);}})['catch'](function(_0x5c6693){logger[_0xbf2d('0xd')](_0xbf2d('0x9'),_0x47ac25,_0x5c6693);_0x155a3e(_0x5c6693);});});}exports[_0xbf2d('0x11')]=function(_0x4a8ffc){var _0x3e19e4=this;return new Promise(function(_0xa05276,_0xfbbae){return db[_0xbf2d('0x12')][_0xbf2d('0x13')](_0x4a8ffc[_0xbf2d('0x14')],{'raw':_0x4a8ffc[_0xbf2d('0x15')]?_0x4a8ffc[_0xbf2d('0x15')][_0xbf2d('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a8ffc[_0xbf2d('0x15')]?_0x4a8ffc[_0xbf2d('0x15')]['where']||null:null,'attributes':_0x4a8ffc['options']?_0x4a8ffc[_0xbf2d('0x15')]['attributes']||null:null,'limit':_0x4a8ffc['options']?_0x4a8ffc[_0xbf2d('0x15')][_0xbf2d('0x17')]||null:null})['then'](function(_0x5c1de2){logger[_0xbf2d('0x8')](_0xbf2d('0x11'),_0x4a8ffc);logger[_0xbf2d('0x18')]('UpdateMailApplication',_0x4a8ffc,JSON[_0xbf2d('0xc')](_0x5c1de2));_0xa05276(_0x5c1de2);})[_0xbf2d('0x19')](function(_0x251b9d){logger['error'](_0xbf2d('0x11'),_0x251b9d[_0xbf2d('0xf')],_0x4a8ffc);_0xfbbae(_0x3e19e4['error'](0x1f4,_0x251b9d[_0xbf2d('0xf')]));});});}; \ No newline at end of file +var _0x61d8=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','raw','options','attributes','limit','then','util'];(function(_0x4f68ad,_0x18e57d){var _0x37821d=function(_0x28d531){while(--_0x28d531){_0x4f68ad['push'](_0x4f68ad['shift']());}};_0x37821d(++_0x18e57d);}(_0x61d8,0x86));var _0x861d=function(_0x5326f6,_0x14c655){_0x5326f6=_0x5326f6-0x0;var _0x2b3ab7=_0x61d8[_0x5326f6];return _0x2b3ab7;};'use strict';var _=require('lodash');var util=require(_0x861d('0x0'));var moment=require(_0x861d('0x1'));var BPromise=require(_0x861d('0x2'));var rs=require(_0x861d('0x3'));var fs=require('fs');var Redis=require(_0x861d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x861d('0x5'));var logger=require(_0x861d('0x6'))('rpc');var config=require(_0x861d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x861d('0x8')][_0x861d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x373ec2,_0x2a9f94,_0xd58eed){return new BPromise(function(_0x2e7bca,_0x3fea71){return client['request'](_0x373ec2,_0xd58eed)['then'](function(_0x58cc72){logger[_0x861d('0xa')](_0x861d('0xb'),_0x2a9f94,_0x861d('0xc'));logger[_0x861d('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x2a9f94,_0x861d('0xc'),JSON[_0x861d('0xe')](_0x58cc72));if(_0x58cc72[_0x861d('0xf')]){if(_0x58cc72[_0x861d('0xf')][_0x861d('0x10')]===0x1f4){logger[_0x861d('0xf')](_0x861d('0xb'),_0x2a9f94,_0x58cc72[_0x861d('0xf')]['message']);return _0x3fea71(_0x58cc72[_0x861d('0xf')][_0x861d('0x11')]);}logger[_0x861d('0xf')](_0x861d('0xb'),_0x2a9f94,_0x58cc72[_0x861d('0xf')][_0x861d('0x11')]);return _0x2e7bca(_0x58cc72[_0x861d('0xf')][_0x861d('0x11')]);}else{logger[_0x861d('0xa')](_0x861d('0xb'),_0x2a9f94,_0x861d('0xc'));_0x2e7bca(_0x58cc72[_0x861d('0x12')][_0x861d('0x11')]);}})[_0x861d('0x13')](function(_0x1308a8){logger[_0x861d('0xf')]('MailApplication,\x20%s,\x20%s',_0x2a9f94,_0x1308a8);_0x3fea71(_0x1308a8);});});}exports[_0x861d('0x14')]=function(_0x5f41e1){var _0x226332=this;return new Promise(function(_0x93b442,_0x251f61){return db[_0x861d('0x15')]['update'](_0x5f41e1['body'],{'raw':_0x5f41e1['options']?_0x5f41e1['options'][_0x861d('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f41e1[_0x861d('0x17')]?_0x5f41e1[_0x861d('0x17')]['where']||null:null,'attributes':_0x5f41e1['options']?_0x5f41e1[_0x861d('0x17')][_0x861d('0x18')]||null:null,'limit':_0x5f41e1[_0x861d('0x17')]?_0x5f41e1[_0x861d('0x17')][_0x861d('0x19')]||null:null})[_0x861d('0x1a')](function(_0x3cc497){logger['info'](_0x861d('0x14'),_0x5f41e1);logger[_0x861d('0xd')]('UpdateMailApplication',_0x5f41e1,JSON[_0x861d('0xe')](_0x3cc497));_0x93b442(_0x3cc497);})[_0x861d('0x13')](function(_0x18b064){logger[_0x861d('0xf')](_0x861d('0x14'),_0x18b064[_0x861d('0x11')],_0x5f41e1);_0x251f61(_0x226332['error'](0x1f4,_0x18b064['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 9c9280d..97b55b6 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 _0x9688=['describe','/:id','show','/:id/messages','download','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9688,0xce));var _0x8968=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9688[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0x8968('0x0'));var path=require(_0x8968('0x1'));var timeout=require(_0x8968('0x2'));var express=require(_0x8968('0x3'));var router=express[_0x8968('0x4')]();var auth=require(_0x8968('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8968('0x6'));var controller=require(_0x8968('0x7'));router[_0x8968('0x8')]('/',auth[_0x8968('0x9')](),controller[_0x8968('0xa')]);router['get']('/describe',auth[_0x8968('0x9')](),controller[_0x8968('0xb')]);router['get'](_0x8968('0xc'),auth[_0x8968('0x9')](),controller[_0x8968('0xd')]);router[_0x8968('0x8')](_0x8968('0xe'),auth[_0x8968('0x9')](),controller['getMessages']);router[_0x8968('0x8')]('/:id/download',auth[_0x8968('0x9')](),controller[_0x8968('0xf')]);router[_0x8968('0x10')]('/',auth[_0x8968('0x9')](),controller['create']);router[_0x8968('0x10')](_0x8968('0xe'),auth['isAuthenticated'](),controller[_0x8968('0x11')]);router[_0x8968('0x10')](_0x8968('0x12'),auth[_0x8968('0x9')](),interaction[_0x8968('0x13')](_0x8968('0x14'),_0x8968('0x15')),controller[_0x8968('0x16')]);router[_0x8968('0x17')](_0x8968('0xc'),auth[_0x8968('0x9')](),interaction['tracked'](_0x8968('0x14'),_0x8968('0x18')),controller[_0x8968('0x19')]);router[_0x8968('0x1a')](_0x8968('0xc'),auth[_0x8968('0x9')](),interaction[_0x8968('0x13')](_0x8968('0x14'),_0x8968('0x1b')),controller[_0x8968('0x1c')]);router[_0x8968('0x1a')](_0x8968('0x12'),auth[_0x8968('0x9')](),controller[_0x8968('0x1d')]);module[_0x8968('0x1e')]=router; \ No newline at end of file +var _0x20ec=['tracked','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','addMessage','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete'];(function(_0x3e657c,_0x157968){var _0x153702=function(_0x3fff85){while(--_0x3fff85){_0x3e657c['push'](_0x3e657c['shift']());}};_0x153702(++_0x157968);}(_0x20ec,0x12f));var _0xc20e=function(_0x24ca1f,_0x3d2164){_0x24ca1f=_0x24ca1f-0x0;var _0x5f4222=_0x20ec[_0x24ca1f];return _0x5f4222;};'use strict';var multer=require(_0xc20e('0x0'));var util=require(_0xc20e('0x1'));var path=require(_0xc20e('0x2'));var timeout=require(_0xc20e('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xc20e('0x4'));var interaction=require(_0xc20e('0x5'));var config=require(_0xc20e('0x6'));var controller=require(_0xc20e('0x7'));router[_0xc20e('0x8')]('/',auth[_0xc20e('0x9')](),controller[_0xc20e('0xa')]);router[_0xc20e('0x8')](_0xc20e('0xb'),auth[_0xc20e('0x9')](),controller[_0xc20e('0xc')]);router[_0xc20e('0x8')](_0xc20e('0xd'),auth['isAuthenticated'](),controller[_0xc20e('0xe')]);router[_0xc20e('0x8')](_0xc20e('0xf'),auth[_0xc20e('0x9')](),controller[_0xc20e('0x10')]);router[_0xc20e('0x8')]('/:id/download',auth[_0xc20e('0x9')](),controller[_0xc20e('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc20e('0x12')](_0xc20e('0xf'),auth[_0xc20e('0x9')](),controller[_0xc20e('0x13')]);router['post']('/:id/tags',auth[_0xc20e('0x9')](),interaction['tracked'](_0xc20e('0x14'),_0xc20e('0x15')),controller[_0xc20e('0x16')]);router[_0xc20e('0x17')](_0xc20e('0xd'),auth['isAuthenticated'](),interaction['tracked']('mail',_0xc20e('0x18')),controller[_0xc20e('0x19')]);router[_0xc20e('0x1a')](_0xc20e('0xd'),auth[_0xc20e('0x9')](),interaction[_0xc20e('0x1b')](_0xc20e('0x14'),_0xc20e('0x1c')),controller[_0xc20e('0x1d')]);router[_0xc20e('0x1a')](_0xc20e('0x1e'),auth['isAuthenticated'](),controller[_0xc20e('0x1f')]);module[_0xc20e('0x20')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index a604db1..2f3b66e 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 _0x64c4=['ENUM','out','sequelize','iconv','exports','BOOLEAN','STRING','TEXT','long','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64c4,0x1a6));var _0x464c=function(_0x3a9685,_0x56a2a6){_0x3a9685=_0x3a9685-0x0;var _0x57f902=_0x64c4[_0x3a9685];return _0x57f902;};'use strict';var Sequelize=require(_0x464c('0x0'));var iconv=require(_0x464c('0x1'));module[_0x464c('0x2')]={'closed':{'type':Sequelize[_0x464c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x464c('0x4')]},'note':{'type':Sequelize[_0x464c('0x4')]},'inReplyTo':{'type':Sequelize[_0x464c('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x464c('0x5')](_0x464c('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x464c('0x7')]},'substatus':{'type':Sequelize[_0x464c('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x464c('0x7')]},'firstMsgDirection':{'type':Sequelize[_0x464c('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x464c('0x8')]('in',_0x464c('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT'](_0x464c('0x6'))},'lastMsgText':{'type':Sequelize[_0x464c('0x5')]('long')}}; \ No newline at end of file +var _0xae0d=['out','sequelize','iconv','exports','STRING','TEXT','long','DATE','ENUM'];(function(_0x561fa0,_0x3987d2){var _0x1f3661=function(_0x15a614){while(--_0x15a614){_0x561fa0['push'](_0x561fa0['shift']());}};_0x1f3661(++_0x3987d2);}(_0xae0d,0xd9));var _0xdae0=function(_0x4af483,_0x409926){_0x4af483=_0x4af483-0x0;var _0x2b1a85=_0xae0d[_0x4af483];return _0x2b1a85;};'use strict';var Sequelize=require(_0xdae0('0x0'));var iconv=require(_0xdae0('0x1'));module[_0xdae0('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xdae0('0x3')]},'note':{'type':Sequelize[_0xdae0('0x3')]},'inReplyTo':{'type':Sequelize[_0xdae0('0x3')](0x1fe)},'to':{'type':Sequelize[_0xdae0('0x3')]},'cc':{'type':Sequelize[_0xdae0('0x4')](_0xdae0('0x5'))},'subject':{'type':Sequelize[_0xdae0('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xdae0('0x6')]},'firstMsgDirection':{'type':Sequelize[_0xdae0('0x7')]('in',_0xdae0('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdae0('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xdae0('0x4')](_0xdae0('0x5'))},'lastMsgText':{'type':Sequelize[_0xdae0('0x4')](_0xdae0('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 753dec9..3edd2d9 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 _0xcc73=['log','err','unlinkSync','eml-format','rimraf','request-promise','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','count','offset','Content-Range','reject','update','destroy','then','name','send','Users','map','fullname','TagIds','Tags','push','MailInteraction','findOne','lastMsgBody','lastMsgText','catch','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','value','`\x20=\x200','having','Contact','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','text','keys','some','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','DESC','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','toString','sequelize','merge','Account.key','a.mandatoryDisposition','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.MailAccountId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','describe','addMessage','ids','getMessages','MailMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','omit','emit','mailInteractionTags:save','removeTags','join','files','tmp','root','attachments','format','Attachments','Messages','bcc','subject','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','readFileSync','build','writeFileSync','download'];(function(_0x2f0d11,_0x239b18){var _0x4879cf=function(_0x4036f2){while(--_0x4036f2){_0x2f0d11['push'](_0x2f0d11['shift']());}};_0x4879cf(++_0x239b18);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xcc73[_0x432682];return _0x463d05;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3cc7('0x0'));var rimraf=require(_0x3cc7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3cc7('0x2'));var moment=require('moment');var BPromise=require(_0x3cc7('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3cc7('0x4'));var sox=require(_0x3cc7('0x5'));var csv=require(_0x3cc7('0x6'));var ejs=require(_0x3cc7('0x7'));var fs=require('fs');var _=require(_0x3cc7('0x8'));var squel=require('squel');var crypto=require(_0x3cc7('0x9'));var jsforce=require(_0x3cc7('0xa'));var deskjs=require(_0x3cc7('0xb'));var toCsv=require(_0x3cc7('0x6'));var querystring=require('querystring');var Papa=require(_0x3cc7('0xc'));var htmlToText=require(_0x3cc7('0xd'));var Redis=require(_0x3cc7('0xe'));var authService=require(_0x3cc7('0xf'));var qs=require(_0x3cc7('0x10'));var as=require(_0x3cc7('0x11'));var hardwareService=require(_0x3cc7('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x3cc7('0x13'));var config=require('../../config/environment');var db=require(_0x3cc7('0x14'))['db'];config[_0x3cc7('0x15')]=_[_0x3cc7('0x16')](config[_0x3cc7('0x15')],{'host':_0x3cc7('0x17'),'port':0x18eb});var socket=require(_0x3cc7('0x18'))(new Redis(config[_0x3cc7('0x15')]));require(_0x3cc7('0x19'))[_0x3cc7('0x1a')](socket);function respondWithStatusCode(_0xab7f06,_0x4238d5){_0x4238d5=_0x4238d5||0xcc;return function(_0x129d5b){if(_0x129d5b){return _0xab7f06[_0x3cc7('0x1b')](_0x4238d5);}return _0xab7f06[_0x3cc7('0x1c')](_0x4238d5)[_0x3cc7('0x1d')]();};}function respondWithResult(_0x857775,_0x2c4688){_0x2c4688=_0x2c4688||0xc8;return function(_0x1320a8){if(_0x1320a8){return _0x857775[_0x3cc7('0x1c')](_0x2c4688)[_0x3cc7('0x1e')](_0x1320a8);}};}function respondWithFilteredResult(_0xfa1cc8,_0x1bf3b7){return function(_0x2a4ddf){if(_0x2a4ddf){var _0xff4317=_0x2a4ddf[_0x3cc7('0x1f')],_0x118aa0=_0x1bf3b7[_0x3cc7('0x20')],_0x2f196a=_0x1bf3b7['offset']+_0x1bf3b7['limit'],_0x1545a0;if(_0x2f196a>=_0xff4317){_0x2f196a=_0xff4317;_0x1545a0=0xc8;}else{_0x1545a0=0xce;}_0xfa1cc8[_0x3cc7('0x1c')](_0x1545a0);return _0xfa1cc8['set'](_0x3cc7('0x21'),_0x118aa0+'-'+_0x2f196a+'/'+_0xff4317)[_0x3cc7('0x1e')](_0x2a4ddf);}return null;};}function patchUpdates(_0x252a35){return function(_0x576bf5){try{jsonpatch['apply'](_0x576bf5,_0x252a35,!![]);}catch(_0x2434f2){return BPromise[_0x3cc7('0x22')](_0x2434f2);}return _0x576bf5['save']();};}function saveUpdates(_0x40906b,_0x2ff800){return function(_0x4bc893){if(_0x4bc893){return _0x4bc893[_0x3cc7('0x23')](_0x40906b)['then'](function(_0x338cd3){return _0x338cd3;});}return null;};}function removeEntity(_0x50a8fb,_0x1cfcee){return function(_0x3b1fe6){if(_0x3b1fe6){return _0x3b1fe6[_0x3cc7('0x24')]()[_0x3cc7('0x25')](function(){_0x50a8fb[_0x3cc7('0x1c')](0xcc)[_0x3cc7('0x1d')]();});}};}function handleEntityNotFound(_0x534cea,_0x2fa3d5){return function(_0x1559b6){if(!_0x1559b6){_0x534cea[_0x3cc7('0x1b')](0x194);}return _0x1559b6;};}function handleError(_0x5f0a09,_0x358c12){_0x358c12=_0x358c12||0x1f4;return function(_0x595e7e){logger['error'](_0x595e7e['stack']);if(_0x595e7e[_0x3cc7('0x26')]){delete _0x595e7e[_0x3cc7('0x26')];}_0x5f0a09['status'](_0x358c12)[_0x3cc7('0x27')](_0x595e7e);};}function getInteractionUsers(_0xb6480e,_0x2bc904){return new BPromise(function(_0x17aa73,_0x40a01c){try{if(_0x2bc904[_0xb6480e['id']]){_0xb6480e[_0x3cc7('0x28')]=_[_0x3cc7('0x29')](_0x2bc904[_0xb6480e['id']],function(_0x1e14b4){return{'id':_0x1e14b4['id'],'fullname':_0x1e14b4[_0x3cc7('0x2a')]};});}}catch(_0x30ccb6){_0x40a01c(_0x30ccb6);}_0x17aa73(_0xb6480e);});}function getInteractionTags(_0x40ab90,_0x30480e){return new BPromise(function(_0xded386,_0x65e2df){try{if(_0x40ab90[_0x3cc7('0x2b')]){_0x40ab90['Tags']=[];_0x40ab90[_0x3cc7('0x2b')]['split'](',')['forEach'](function(_0x5f4c6f){_0x40ab90[_0x3cc7('0x2c')][_0x3cc7('0x2d')](_0x30480e[_0x5f4c6f]);});}delete _0x40ab90[_0x3cc7('0x2b')];}catch(_0x12a828){_0x65e2df(_0x12a828);}_0xded386(_0x40ab90);});}function getLastMessageText(_0x713682){return new BPromise(function(_0x45494a,_0x2ecdc2){return db[_0x3cc7('0x2e')][_0x3cc7('0x2f')]({'where':{'id':_0x713682['id']},'attributes':[_0x3cc7('0x30'),_0x3cc7('0x31')],'raw':!![]})['then'](function(_0x1d0580){if(!_0x1d0580[_0x3cc7('0x31')]){_0x713682[_0x3cc7('0x31')]=_['trimStart'](htmlToText['fromString'](_0x1d0580[_0x3cc7('0x30')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x713682[_0x3cc7('0x31')]=_0x1d0580['lastMsgText'];}_0x45494a(_0x713682);})[_0x3cc7('0x32')](function(_0x4b89af){_0x2ecdc2(_0x4b89af);});});}function updateMailInteraction(_0x297c19,_0x202cc8,_0x51fdc3,_0x96847b){return new BPromise(function(_0x301116,_0x2fba36){return getInteractionUsers(_0x297c19,_0x51fdc3)[_0x3cc7('0x25')](function(_0x428ad2){return getInteractionTags(_0x428ad2,_0x202cc8);})[_0x3cc7('0x25')](function(_0x5771c2){if(_0x96847b){_0x301116(getLastMessageText(_0x5771c2));}else{_0x301116(_0x5771c2);}})[_0x3cc7('0x32')](function(_0x1d3e94){_0x2fba36(_0x1d3e94);});});}exports['index']=function(_0x24409c,_0x1b0a1f){var _0x538cfe={},_0x3abeda={},_0x53cc1d={'count':0x0,'rows':[]};var _0x16e66a=_[_0x3cc7('0x29')](db[_0x3cc7('0x2e')][_0x3cc7('0x33')],function(_0x22ff63){return{'name':_0x22ff63[_0x3cc7('0x34')],'type':_0x22ff63[_0x3cc7('0x35')][_0x3cc7('0x36')]};});_0x3abeda[_0x3cc7('0x37')]=_[_0x3cc7('0x29')](_0x16e66a,_0x3cc7('0x26'));_0x3abeda[_0x3cc7('0x38')]=_['keys'](_0x24409c[_0x3cc7('0x38')]);_0x3abeda[_0x3cc7('0x39')]=_[_0x3cc7('0x3a')](_0x3abeda[_0x3cc7('0x37')],_0x3abeda[_0x3cc7('0x38')]);_0x538cfe[_0x3cc7('0x3b')]=_[_0x3cc7('0x3a')](_0x3abeda[_0x3cc7('0x37')],qs[_0x3cc7('0x3c')](_0x24409c[_0x3cc7('0x38')]['fields']));_0x538cfe[_0x3cc7('0x3b')]=_0x538cfe[_0x3cc7('0x3b')][_0x3cc7('0x3d')]?_0x538cfe[_0x3cc7('0x3b')]:_0x3abeda[_0x3cc7('0x37')];if(!_0x24409c[_0x3cc7('0x38')][_0x3cc7('0x3e')]('nolimit')){_0x538cfe[_0x3cc7('0x3f')]=qs[_0x3cc7('0x3f')](_0x24409c[_0x3cc7('0x38')][_0x3cc7('0x3f')]);_0x538cfe[_0x3cc7('0x20')]=qs[_0x3cc7('0x20')](_0x24409c[_0x3cc7('0x38')][_0x3cc7('0x20')]);}_0x538cfe['order']=qs[_0x3cc7('0x40')](_0x24409c[_0x3cc7('0x38')]['sort']);_0x538cfe[_0x3cc7('0x41')]=qs[_0x3cc7('0x39')](_[_0x3cc7('0x42')](_0x24409c[_0x3cc7('0x38')],_0x3abeda[_0x3cc7('0x39')]));var _0x447504=[];var _0x9625d0=squel[_0x3cc7('0x43')]()[_0x3cc7('0x44')]('id')[_0x3cc7('0x44')](_0x3cc7('0x26'))[_0x3cc7('0x44')](_0x3cc7('0x45'))[_0x3cc7('0x46')](_0x3cc7('0x47'));var _0x477278=squel['select']()[_0x3cc7('0x44')](_0x3cc7('0x48'))[_0x3cc7('0x44')](_0x3cc7('0x49'))['field'](_0x3cc7('0x4a'))[_0x3cc7('0x46')]('user_has_mail_interactions','ui')[_0x3cc7('0x4b')](_0x3cc7('0x4c'),'u',_0x3cc7('0x4d'));var _0x11ff4e=squel[_0x3cc7('0x43')]()['from'](_0x3cc7('0x4e'),'i')['left_join'](_0x3cc7('0x4f'),'c',_0x3cc7('0x50'))[_0x3cc7('0x4b')](_0x3cc7('0x4c'),'o',_0x3cc7('0x51'))['left_join'](_0x3cc7('0x52'),'a',_0x3cc7('0x53'))[_0x3cc7('0x4b')](_0x3cc7('0x54'),'me',_0x3cc7('0x55'))['left_join'](_0x3cc7('0x56'),'it',_0x3cc7('0x57'))[_0x3cc7('0x4b')]('tools_tags','t',_0x3cc7('0x58'));var _0x212a1a=squel[_0x3cc7('0x59')]();var _0x1aaac9=[];var _0x569774=squel[_0x3cc7('0x59')]();var _0x33e5fd;if(_0x24409c[_0x3cc7('0x38')][_0x3cc7('0x5a')]){_0x33e5fd=as[_0x3cc7('0x5b')](_0x24409c[_0x3cc7('0x38')][_0x3cc7('0x5a')]);var _0x478255=_0x33e5fd['sqlOperator'];for(var _0x5cb126=0x0;_0x5cb126<_0x33e5fd['conditions'][_0x3cc7('0x3d')];_0x5cb126++){var _0x554620=_0x33e5fd[_0x3cc7('0x5c')][_0x5cb126];var _0x1ce589='i';var _0x12b95b=_[_0x3cc7('0x5d')](_0x16e66a,[_0x3cc7('0x26'),_0x554620[_0x3cc7('0x44')]]);if(!_0x12b95b){switch(_0x554620[_0x3cc7('0x44')]){case'unreadMessages':if(_0x554620[_0x3cc7('0x5e')]==0x1){_0x11ff4e['having']('`'+_0x554620['field']+_0x3cc7('0x5f'));}else{_0x11ff4e[_0x3cc7('0x60')]('`'+_0x554620[_0x3cc7('0x44')]+'`\x20>\x200');}break;case _0x3cc7('0x61'):if(_0x554620['operator']==='$substring'){if(_0x554620[_0x3cc7('0x5e')][_0x3cc7('0x62')]('\x20')[_0x3cc7('0x3d')]>0x1){_0x212a1a[_0x478255](_0x3cc7('0x63'),qs['getFullTextValue'](_0x554620[_0x3cc7('0x5e')]),null);}else{var _0x2dfedc='%'+_0x554620[_0x3cc7('0x5e')]+'%';_0x212a1a[_0x478255](_0x3cc7('0x64'),_0x2dfedc,_0x2dfedc,_0x2dfedc);}}else{_0x12b95b=_['find'](_0x16e66a,[_0x3cc7('0x26'),_0x3cc7('0x65')]);_0x554620[_0x3cc7('0x44')]=_0x3cc7('0x65');_0x2fb030=as[_0x3cc7('0x66')](_0x1ce589,_0x12b95b[_0x3cc7('0x35')],_0x554620);_0x212a1a[_0x478255](_0x2fb030['text'],_0x2fb030['value'][_0x3cc7('0x67')],_0x2fb030['value']['end']);}break;case _0x3cc7('0x68'):var _0x30c69f=_0x554620[_0x3cc7('0x5e')][_0x3cc7('0x62')](',')[_0x3cc7('0x29')](function(_0x1c60b0){return Number(_0x1c60b0);});_0x30c69f[_0x3cc7('0x69')](function(_0x17eea9){_0x569774['or'](_0x3cc7('0x6a'),'%,'+_0x17eea9+',%');});_0x1aaac9=_['union'](_0x1aaac9,_0x30c69f);break;case _0x3cc7('0x6b'):if(_0x554620[_0x3cc7('0x6c')]===_0x3cc7('0x6d')){_0x212a1a[_0x478255](_0x3cc7('0x6e'),'%'+_0x554620['value']+'%',null);}else{_0x12b95b=_[_0x3cc7('0x5d')](_0x16e66a,['name',_0x3cc7('0x6f')]);_0x554620['field']=_0x3cc7('0x6f');_0x2fb030=as[_0x3cc7('0x66')](_0x1ce589,_0x12b95b[_0x3cc7('0x35')],_0x554620);_0x212a1a[_0x478255](_0x2fb030['text'],_0x2fb030[_0x3cc7('0x5e')][_0x3cc7('0x67')],_0x2fb030['value'][_0x3cc7('0x1d')]);}break;case _0x3cc7('0x70'):_0x2fb030=as[_0x3cc7('0x66')]('me',null,_0x554620);_0x212a1a[_0x478255](_0x2fb030[_0x3cc7('0x71')],_0x2fb030['value']['start'],_0x2fb030['value'][_0x3cc7('0x1d')]);break;}}else{var _0x2fb030=as[_0x3cc7('0x66')](_0x1ce589,_0x12b95b[_0x3cc7('0x35')],_0x554620);_0x212a1a[_0x478255](_0x2fb030[_0x3cc7('0x71')],_0x2fb030[_0x3cc7('0x5e')][_0x3cc7('0x67')],_0x2fb030[_0x3cc7('0x5e')]['end']);}}}else{var _0x1be864=_(_0x24409c[_0x3cc7('0x38')])[_0x3cc7('0x72')]()[_0x3cc7('0x29')](function(_0xb12795){return _[_0x3cc7('0x73')](_0x16e66a,[_0x3cc7('0x26'),_0xb12795])?_0xb12795:undefined;})['compact']()[_0x3cc7('0x5e')]();if(!_[_0x3cc7('0x74')](_0x1be864)){_0x1be864['forEach'](function(_0x1b17b4){if(_0x1b17b4==='MailAccountId'){_0x11ff4e[_0x3cc7('0x41')](_0x3cc7('0x75'),[][_0x3cc7('0x76')](_0x24409c['query'][_0x1b17b4]));}else if(_0x1b17b4===_0x3cc7('0x77')){var _0x5f14bb=JSON[_0x3cc7('0x78')](_0x24409c[_0x3cc7('0x38')][_0x1b17b4])['$gte'];var _0x44e908=JSON[_0x3cc7('0x78')](_0x24409c[_0x3cc7('0x38')][_0x1b17b4])['$lte'];_0x11ff4e['where'](_0x3cc7('0x79'),_0x5f14bb,_0x44e908);}else{if(_0x24409c[_0x3cc7('0x38')][_0x1b17b4]==='null'){_0x11ff4e[_0x3cc7('0x41')]('i.'+_0x1b17b4+'\x20IS\x20NULL');}else{_0x11ff4e[_0x3cc7('0x41')]('i.'+_0x1b17b4+_0x3cc7('0x7a'),_0x24409c['query'][_0x1b17b4]);}}});}if(_0x24409c[_0x3cc7('0x38')]['read']){if(_0x24409c[_0x3cc7('0x38')][_0x3cc7('0x7b')]==0x1){_0x11ff4e[_0x3cc7('0x60')](_0x3cc7('0x7c'));}else{_0x11ff4e['having'](_0x3cc7('0x7d'));}}if(_0x24409c[_0x3cc7('0x38')][_0x3cc7('0x7e')]){_0x1aaac9=_[_0x3cc7('0x7f')](_0x24409c[_0x3cc7('0x38')][_0x3cc7('0x7e')])?_0x24409c[_0x3cc7('0x38')][_0x3cc7('0x7e')]:new Array(_0x24409c[_0x3cc7('0x38')][_0x3cc7('0x7e')]);_0x1aaac9['forEach'](function(_0x1f51a7){_0x569774['or'](_0x3cc7('0x6a'),'%,'+_0x1f51a7+',%');});}if(_0x24409c[_0x3cc7('0x38')][_0x3cc7('0x80')]){var _0x7b1e55=_0x24409c[_0x3cc7('0x38')][_0x3cc7('0x80')]['replace']('\x5c','\x5c\x5c')[_0x3cc7('0x81')]('\x27\x27',_0x3cc7('0x82'));if(qs[_0x3cc7('0x83')](_0x7b1e55)){_0x212a1a['or'](_0x3cc7('0x84'),_0x7b1e55+'%');}else if(qs[_0x3cc7('0x85')](_0x7b1e55)){_0x212a1a['or'](_0x3cc7('0x86'),_0x7b1e55+'%');}else{_0x212a1a['or'](_0x3cc7('0x87'),qs[_0x3cc7('0x88')](_0x7b1e55))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x7b1e55));}}}_0x11ff4e['where'](_0x212a1a);_0x11ff4e['group']('i.id');var _0x256902={'type':db[_0x3cc7('0x89')][_0x3cc7('0x8a')][_0x3cc7('0x8b')],'raw':!![]};var _0x232101=_0x11ff4e[_0x3cc7('0x8c')]();_0x232101[_0x3cc7('0x44')]('i.id');_0x232101[_0x3cc7('0x44')](_0x3cc7('0x8d'),_0x3cc7('0x8e'));if(_0x538cfe[_0x3cc7('0x8f')]){_0x538cfe[_0x3cc7('0x8f')][_0x3cc7('0x69')](function(_0x5cafae){_0x11ff4e[_0x3cc7('0x8f')]('i.'+_0x5cafae[0x0],_0x5cafae[0x1]===_0x3cc7('0x90')?![]:!![]);});}if(!_[_0x3cc7('0x74')](_0x1aaac9)){_0x11ff4e[_0x3cc7('0x60')](_0x569774);_0x232101['where']('t.id\x20IN\x20?',_0x1aaac9);}BPromise[_0x3cc7('0x91')]()[_0x3cc7('0x25')](function(){if(!_0x33e5fd){if(_0x24409c[_0x3cc7('0x38')]['MailAccountId']||_0x24409c[_0x3cc7('0x38')]['journey'])return;_0x232101[_0x3cc7('0x41')](_0x3cc7('0x92'));_0x11ff4e['where'](_0x3cc7('0x92'));return;}return _0x24409c[_0x3cc7('0x93')][_0x3cc7('0x94')]({'attributes':['id'],'raw':!![]})[_0x3cc7('0x25')](function(_0x16d91a){if(_[_0x3cc7('0x74')](_0x16d91a)){_0x232101[_0x3cc7('0x41')](_0x3cc7('0x95'));_0x11ff4e['where'](_0x3cc7('0x95'));}else{_0x232101['where'](_0x3cc7('0x75'),_[_0x3cc7('0x29')](_0x16d91a,'id'));_0x11ff4e[_0x3cc7('0x41')](_0x3cc7('0x75'),_[_0x3cc7('0x29')](_0x16d91a,'id'));}});})[_0x3cc7('0x25')](function(){db['sequelize'][_0x3cc7('0x38')](_0x232101[_0x3cc7('0x96')](),_0x256902)[_0x3cc7('0x25')](function(_0x1d979c){_0x53cc1d['count']=_0x1d979c[_0x3cc7('0x3d')];if(_0x53cc1d[_0x3cc7('0x1f')]===0x0)return[];return db[_0x3cc7('0x97')][_0x3cc7('0x38')](_0x9625d0['toString'](),_0x256902)[_0x3cc7('0x25')](function(_0x1a0d27){_0x447504=_['keyBy'](_0x1a0d27,'id');_0x256902=_[_0x3cc7('0x98')](_0x256902,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x24409c[_0x3cc7('0x38')][_0x3cc7('0x3c')]){_0x538cfe['attributes']['forEach'](function(_0x2ab4cf){_0x11ff4e[_0x3cc7('0x44')]('i.'+_0x2ab4cf);});}else{_0x11ff4e[_0x3cc7('0x44')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3cc7('0x8e'));_0x11ff4e[_0x3cc7('0x44')]('a.key',_0x3cc7('0x99'));_0x11ff4e['field'](_0x3cc7('0x9a'),'Account.mandatoryDisposition');_0x11ff4e['field']('i.id');_0x11ff4e['field']('i.createdAt');_0x11ff4e[_0x3cc7('0x44')](_0x3cc7('0x9b'));_0x11ff4e[_0x3cc7('0x44')](_0x3cc7('0x9c'));_0x11ff4e[_0x3cc7('0x44')](_0x3cc7('0x9d'));_0x11ff4e[_0x3cc7('0x44')](_0x3cc7('0x9e'));_0x11ff4e[_0x3cc7('0x44')](_0x3cc7('0x9f'));_0x11ff4e['field'](_0x3cc7('0xa0'));_0x11ff4e['field'](_0x3cc7('0xa1'));_0x11ff4e['field']('i.disposition');_0x11ff4e[_0x3cc7('0x44')]('i.substatus');_0x11ff4e[_0x3cc7('0x44')](_0x3cc7('0xa2'));_0x11ff4e[_0x3cc7('0x44')](_0x3cc7('0xa3'));_0x11ff4e[_0x3cc7('0x44')](_0x3cc7('0xa4'));_0x11ff4e[_0x3cc7('0x44')]('i.UserId');_0x11ff4e[_0x3cc7('0x44')](_0x3cc7('0xa5'),_0x3cc7('0xa6'));_0x11ff4e[_0x3cc7('0x44')](_0x3cc7('0xa7'),_0x3cc7('0xa8'));_0x11ff4e['field']('c.email',_0x3cc7('0xa9'));_0x11ff4e[_0x3cc7('0x44')](_0x3cc7('0xaa'),_0x3cc7('0xab'));_0x11ff4e[_0x3cc7('0x44')](_0x3cc7('0xac'),_0x3cc7('0xad'));_0x11ff4e['field']('c.fax','Contact.fax');_0x11ff4e[_0x3cc7('0x44')](_0x3cc7('0xae'),_0x3cc7('0xaf'));_0x11ff4e[_0x3cc7('0x44')](_0x3cc7('0xb0'),'Owner.internal');_0x11ff4e[_0x3cc7('0x44')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3cc7('0x2b'));}_0x11ff4e[_0x3cc7('0x3f')](_0x538cfe[_0x3cc7('0x3f')]);_0x11ff4e[_0x3cc7('0x20')](_0x538cfe[_0x3cc7('0x20')]);return db[_0x3cc7('0x97')]['query'](_0x11ff4e[_0x3cc7('0x96')](),_0x256902);})[_0x3cc7('0x25')](function(_0x194b06){_0x477278[_0x3cc7('0x41')](_0x3cc7('0xb1'),_[_0x3cc7('0x29')](_0x194b06,'id'));return db[_0x3cc7('0x97')]['query'](_0x477278[_0x3cc7('0x96')](),_0x256902)['then'](function(_0x47c42d){var _0xf6d4c5=_[_0x3cc7('0xb2')](_0x47c42d,_0x3cc7('0xb3'));var _0x3ab25b=[];return db[_0x3cc7('0xb4')][_0x3cc7('0x2f')]({'attributes':[_0x3cc7('0xb5')],'raw':!![]})[_0x3cc7('0x25')](function(_0x137842){var _0x276b1b=_0x137842[_0x3cc7('0xb5')];_0x194b06[_0x3cc7('0x69')](function(_0x156feb){_0x3ab25b['push'](updateMailInteraction(_0x156feb,_0x447504,_0xf6d4c5,_0x276b1b));});return BPromise[_0x3cc7('0xb6')](_0x3ab25b);});});});})[_0x3cc7('0x25')](function(_0x4f8865){_0x53cc1d[_0x3cc7('0xb7')]=_0x4f8865;return _0x53cc1d;})['then'](respondWithFilteredResult(_0x1b0a1f,_0x538cfe));})['catch'](handleError(_0x1b0a1f,null));};exports[_0x3cc7('0xb8')]=function(_0x20bdf6,_0x256c8a){var _0x2b94b2={'raw':![],'where':{'id':_0x20bdf6[_0x3cc7('0xb9')]['id']}},_0x4e5067={};_0x4e5067['model']=_['keys'](db['MailInteraction']['rawAttributes']);_0x4e5067[_0x3cc7('0x38')]=_['keys'](_0x20bdf6[_0x3cc7('0x38')]);_0x4e5067['filters']=_[_0x3cc7('0x3a')](_0x4e5067['model'],_0x4e5067['query']);_0x2b94b2[_0x3cc7('0x3b')]=_[_0x3cc7('0x3a')](_0x4e5067[_0x3cc7('0x37')],qs[_0x3cc7('0x3c')](_0x20bdf6[_0x3cc7('0x38')][_0x3cc7('0x3c')]));_0x2b94b2[_0x3cc7('0x3b')]=_0x2b94b2['attributes'][_0x3cc7('0x3d')]?_0x2b94b2['attributes']:_0x4e5067[_0x3cc7('0x37')];if(_0x20bdf6[_0x3cc7('0x38')][_0x3cc7('0xba')]){_0x2b94b2[_0x3cc7('0xbb')]=[{'all':!![]}];}_0x2b94b2=_[_0x3cc7('0x98')]({},_0x2b94b2,_0x20bdf6[_0x3cc7('0xbc')]);return db[_0x3cc7('0x2e')][_0x3cc7('0x5d')](_0x2b94b2)[_0x3cc7('0x25')](handleEntityNotFound(_0x256c8a,null))['then'](respondWithResult(_0x256c8a,null))[_0x3cc7('0x32')](handleError(_0x256c8a,null));};exports['create']=function(_0x3dd3aa,_0x1683bc){return db[_0x3cc7('0x2e')][_0x3cc7('0xbd')](_0x3dd3aa[_0x3cc7('0xbe')],{})['then'](respondWithResult(_0x1683bc,0xc9))[_0x3cc7('0x32')](handleError(_0x1683bc,null));};exports[_0x3cc7('0x23')]=function(_0x479fe1,_0x2e6d65){if(_0x479fe1[_0x3cc7('0xbe')]['id']){delete _0x479fe1[_0x3cc7('0xbe')]['id'];}return db['MailInteraction'][_0x3cc7('0x5d')]({'where':{'id':_0x479fe1[_0x3cc7('0xb9')]['id']}})[_0x3cc7('0x25')](handleEntityNotFound(_0x2e6d65,null))[_0x3cc7('0x25')](saveUpdates(_0x479fe1[_0x3cc7('0xbe')],null))[_0x3cc7('0x25')](respondWithResult(_0x2e6d65,null))['catch'](handleError(_0x2e6d65,null));};exports['destroy']=function(_0x1db436,_0x581d59){return db[_0x3cc7('0x2e')][_0x3cc7('0x5d')]({'where':{'id':_0x1db436[_0x3cc7('0xb9')]['id']}})['then'](handleEntityNotFound(_0x581d59,null))[_0x3cc7('0x25')](removeEntity(_0x581d59,null))[_0x3cc7('0x32')](handleError(_0x581d59,null));};exports[_0x3cc7('0xbf')]=function(_0x2e945e,_0x2dd8e3){return db[_0x3cc7('0x2e')]['describe']()[_0x3cc7('0x25')](respondWithResult(_0x2dd8e3,null))['catch'](handleError(_0x2dd8e3,null));};exports[_0x3cc7('0xc0')]=function(_0x1aee0c,_0x210986,_0x8b94c1){return db['MailMessage'][_0x3cc7('0x5d')]({'where':{'id':_0x1aee0c[_0x3cc7('0xb9')]['id']}})[_0x3cc7('0x25')](handleEntityNotFound(_0x210986,null))['then'](function(_0x4e84a1){if(_0x4e84a1){return _0x4e84a1['addMessage'](_0x1aee0c[_0x3cc7('0xbe')][_0x3cc7('0xc1')],_['omit'](_0x1aee0c[_0x3cc7('0xbe')],['ids','id'])||{});}})[_0x3cc7('0x25')](respondWithResult(_0x210986,null))['catch'](handleError(_0x210986,null));};exports[_0x3cc7('0xc2')]=function(_0x352a67,_0x33a61d,_0x75ac33){var _0x4e0ce5={'raw':![],'where':{}};var _0x30472c={};var _0x19efca={'count':0x0,'rows':[]};return db['MailInteraction'][_0x3cc7('0x2f')]({'where':{'id':_0x352a67['params']['id']}})[_0x3cc7('0x25')](handleEntityNotFound(_0x33a61d,null))[_0x3cc7('0x25')](function(_0x7ad601){if(_0x7ad601){_0x30472c[_0x3cc7('0x37')]=_[_0x3cc7('0x72')](db[_0x3cc7('0xc3')][_0x3cc7('0x33')]);_0x30472c[_0x3cc7('0x38')]=_[_0x3cc7('0x72')](_0x352a67[_0x3cc7('0x38')]);_0x30472c[_0x3cc7('0x39')]=_[_0x3cc7('0x3a')](_0x30472c['model'],_0x30472c[_0x3cc7('0x38')]);_0x4e0ce5[_0x3cc7('0x3b')]=_[_0x3cc7('0x3a')](_0x30472c[_0x3cc7('0x37')],qs[_0x3cc7('0x3c')](_0x352a67['query'][_0x3cc7('0x3c')]));_0x4e0ce5[_0x3cc7('0x3b')]=_0x4e0ce5['attributes'][_0x3cc7('0x3d')]?_0x4e0ce5['attributes']:_0x30472c['model'];if(!_0x352a67['query'][_0x3cc7('0x3e')]('nolimit')){_0x4e0ce5['limit']=qs[_0x3cc7('0x3f')](_0x352a67[_0x3cc7('0x38')][_0x3cc7('0x3f')]);_0x4e0ce5[_0x3cc7('0x20')]=qs[_0x3cc7('0x20')](_0x352a67['query']['offset']);}_0x4e0ce5['order']=qs[_0x3cc7('0x40')](_0x352a67[_0x3cc7('0x38')]['sort']);_0x4e0ce5[_0x3cc7('0x41')]=qs[_0x3cc7('0x39')](_[_0x3cc7('0x42')](_0x352a67[_0x3cc7('0x38')],_0x30472c['filters']));_0x4e0ce5[_0x3cc7('0x41')][_0x3cc7('0xb3')]=_0x7ad601['id'];if(_0x352a67[_0x3cc7('0x38')][_0x3cc7('0x80')]){_0x4e0ce5['where']=_[_0x3cc7('0x98')](_0x4e0ce5[_0x3cc7('0x41')],{'$or':_[_0x3cc7('0x29')](_0x4e0ce5[_0x3cc7('0x3b')],function(_0x428f41){var _0x30b08b={};_0x30b08b[_0x428f41]={'$like':'%'+_0x352a67['query'][_0x3cc7('0x80')]+'%'};return _0x30b08b;})});}if(_0x352a67[_0x3cc7('0x38')][_0x3cc7('0xc4')]){var _0x29a358=_0x352a67[_0x3cc7('0x38')][_0x3cc7('0xc4')][_0x3cc7('0x62')](',');var _0x1fa4d0={};_0x1fa4d0[_0x29a358[0x0]]={'$gte':moment(_0x29a358[0x1])['format'](_0x3cc7('0xc5'))};_0x4e0ce5['where']=_[_0x3cc7('0x98')](_0x4e0ce5[_0x3cc7('0x41')],_0x1fa4d0);}_0x4e0ce5=_['merge']({},_0x4e0ce5,_0x352a67[_0x3cc7('0xbc')]);return db['MailMessage'][_0x3cc7('0x1f')]({'where':_0x4e0ce5[_0x3cc7('0x41')]})[_0x3cc7('0x25')](function(_0x1038e3){_0x19efca['count']=_0x1038e3;if(_0x352a67[_0x3cc7('0x38')][_0x3cc7('0xba')]){_0x4e0ce5[_0x3cc7('0xbb')]=[{'all':!![]}];}return db['MailMessage'][_0x3cc7('0xc6')](_0x4e0ce5);})[_0x3cc7('0x25')](function(_0x5acfbc){_0x19efca[_0x3cc7('0xb7')]=_0x5acfbc;return _0x19efca;});}})[_0x3cc7('0x25')](respondWithFilteredResult(_0x33a61d,_0x4e0ce5))[_0x3cc7('0x32')](handleError(_0x33a61d,null));};exports['addTags']=function(_0x5e7f32,_0x406d5e,_0x3833f2){return db[_0x3cc7('0x2e')]['find']({'where':{'id':_0x5e7f32[_0x3cc7('0xb9')]['id']}})['then'](handleEntityNotFound(_0x406d5e,null))[_0x3cc7('0x25')](function(_0xd48403){if(_0xd48403){return _0xd48403[_0x3cc7('0xc7')](_0x5e7f32[_0x3cc7('0xbe')][_0x3cc7('0xc1')],_[_0x3cc7('0xc8')](_0x5e7f32[_0x3cc7('0xbe')],[_0x3cc7('0xc1'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x3cc7('0x26'),'color'],'where':{'id':_0x5e7f32[_0x3cc7('0xbe')][_0x3cc7('0xc1')]}});})[_0x3cc7('0x25')](function(_0x4fce9e){socket[_0x3cc7('0xc9')](_0x3cc7('0xca'),{'id':Number(_0x5e7f32[_0x3cc7('0xb9')]['id']),'tags':_0x4fce9e||[]});return{'id':Number(_0x5e7f32[_0x3cc7('0xb9')]['id']),'tags':_0x4fce9e||[]};});}})[_0x3cc7('0x25')](respondWithResult(_0x406d5e,null))['catch'](handleError(_0x406d5e,null));};exports[_0x3cc7('0xcb')]=function(_0x289d89,_0x3f1fe9,_0x2ccfd6){return db['MailInteraction'][_0x3cc7('0x5d')]({'where':{'id':_0x289d89[_0x3cc7('0xb9')]['id']}})[_0x3cc7('0x25')](handleEntityNotFound(_0x3f1fe9,null))['then'](function(_0x589e56){if(_0x589e56){return _0x589e56[_0x3cc7('0xcb')](_0x289d89[_0x3cc7('0x38')][_0x3cc7('0xc1')]);}})['then'](respondWithStatusCode(_0x3f1fe9,null))[_0x3cc7('0x32')](handleError(_0x3f1fe9,null));};exports['download']=function(_0x43109b,_0x5b91cb){var _0x3f2780=moment()['unix']()['toString']();var _0xd6c72c=path[_0x3cc7('0xcc')](config['root'],'server',_0x3cc7('0xcd'),_0x3cc7('0xce'));var _0xc7b7a3=path[_0x3cc7('0xcc')](config[_0x3cc7('0xcf')],'server',_0x3cc7('0xcd'),_0x3cc7('0xd0'));var _0x597622=path['join'](_0xd6c72c,_0x3f2780);var _0x133012=util[_0x3cc7('0xd1')]('transcript-%d-%s.zip',_0x43109b[_0x3cc7('0xb9')]['id'],_0x3f2780);var _0x190134=path[_0x3cc7('0xcc')](_0xd6c72c,_0x133012);var _0x44afbe=[];if(_0x43109b[_0x3cc7('0x38')][_0x3cc7('0xd0')]){_0x44afbe[_0x3cc7('0x2d')]({'model':db['Attachment'],'as':_0x3cc7('0xd2'),'raw':!![]});}var _0x509368=[{'model':db[_0x3cc7('0xc3')],'as':_0x3cc7('0xd3'),'attributes':['id','body','from','to','cc',_0x3cc7('0xd4'),_0x3cc7('0xd5'),_0x3cc7('0x77')],'where':{'secret':![]},'order':qs[_0x3cc7('0x40')]('id'),'include':_0x44afbe}];return db['MailInteraction'][_0x3cc7('0x5d')]({'where':{'id':_0x43109b['params']['id']},'include':_0x509368})[_0x3cc7('0x25')](handleEntityNotFound(_0x5b91cb,null))[_0x3cc7('0x25')](function(_0x4a7a98){if(_0x4a7a98&&_0x4a7a98[_0x3cc7('0xd3')]){var _0x1f3fde=_0x4a7a98[_0x3cc7('0xd6')]({'plain':!![]});fs[_0x3cc7('0xd7')](_0x597622);return BPromise[_0x3cc7('0xd8')](_0x1f3fde[_0x3cc7('0xd3')],function(_0x396707,_0x59b30b){var _0x45bc09={'from':_0x396707[_0x3cc7('0x46')],'to':_0x396707['to'],'subject':_0x396707[_0x3cc7('0xd5')],'html':_0x396707[_0x3cc7('0xbe')],'headers':{'Date':moment(_0x396707['createdAt'])[_0x3cc7('0xd1')](_0x3cc7('0xd9'))},'attachments':[]};if(_0x396707['cc']){_0x45bc09['headers']['Cc']=_0x396707['cc'];}if(_0x396707[_0x3cc7('0xd4')]){_0x45bc09[_0x3cc7('0xda')]['Bcc']=_0x396707[_0x3cc7('0xd4')];}return new BPromise(function(_0x493eab,_0x2dfe6d){if(_0x396707['Attachments']){for(var _0x3c5c42=0x0;_0x3c5c42<_0x396707['Attachments'][_0x3cc7('0x3d')];_0x3c5c42++){var _0x46f91a=_0x396707['Attachments'][_0x3c5c42];var _0x3a9027=path[_0x3cc7('0xcc')](_0xc7b7a3,_0x46f91a[_0x3cc7('0xdb')]);if(fs[_0x3cc7('0xdc')](_0x3a9027)){_0x45bc09[_0x3cc7('0xd0')][_0x3cc7('0x2d')]({'name':_0x46f91a['name'],'contentType':_0x46f91a['type'],'data':fs[_0x3cc7('0xdd')](_0x3a9027)});}}}emlformat[_0x3cc7('0xde')](_0x45bc09,function(_0x171cd3,_0x5cf2d9){if(_0x171cd3)return _0x2dfe6d(_0x171cd3);fs[_0x3cc7('0xdf')](path[_0x3cc7('0xcc')](_0x597622,util[_0x3cc7('0xd1')]('message%d.eml',_0x59b30b)),_0x5cf2d9);return _0x493eab(_0x5cf2d9);});});})[_0x3cc7('0x25')](function(){return new BPromise(function(_0x2b0295,_0x2b9fd2){zipdir(_0x597622,{'saveTo':_0x190134},function(_0x12c01f,_0x2aae2a){if(_0x12c01f)return _0x2b9fd2(_0x12c01f);return _0x2b0295(_0x2aae2a);});})[_0x3cc7('0x25')](function(){return new BPromise(function(_0x2e417c,_0x5d2cfd){rimraf(_0x597622,function(_0x362b88){if(_0x362b88)_0x5d2cfd(_0x362b88);return _0x2e417c();});});})[_0x3cc7('0x25')](function(){return _0x5b91cb[_0x3cc7('0xe0')](_0x190134,_0x133012,function(_0x4dbaa4){if(_0x4dbaa4){console[_0x3cc7('0xe1')](_0x3cc7('0xe2'),_0x4dbaa4);}else{fs[_0x3cc7('0xe3')](_0x190134);}});});});}else{return _0x5b91cb['sendStatus'](0xc8);}})[_0x3cc7('0x32')](handleError(_0x5b91cb,null));}; \ No newline at end of file +var _0xf491=['mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','buildExpression','plainBody','some','compact','isEmpty','MailAccountId','where','i.MailAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','\x27\x27\x27\x27','isNumeric','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','c.firstName','c.lastName','Contact.lastName','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','enableEmailPreview','all','rows','show','params','rawAttributes','includeAll','include','options','body','describe','MailMessage','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','pick','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','Tag','findAll','emit','mailInteractionTags:save','removeTags','unix','root','server','tmp','join','files','attachments','transcript-%d-%s.zip','Attachment','Messages','subject','createdAt','get','mkdirSync','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','download','log','html-pdf','eml-format','rimraf','request-promise','bluebird','util','path','sox','lodash','desk.js','to-csv','querystring','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','end','count','offset','limit','set','json','apply','reject','save','update','destroy','status','error','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','MailInteraction','findOne','lastMsgBody','lastMsgText','then','trimStart','fromString','catch','fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','sort','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId'];(function(_0x51dbba,_0x817f0d){var _0x34906d=function(_0x192a8b){while(--_0x192a8b){_0x51dbba['push'](_0x51dbba['shift']());}};_0x34906d(++_0x817f0d);}(_0xf491,0x178));var _0x1f49=function(_0x54ea4f,_0x472285){_0x54ea4f=_0x54ea4f-0x0;var _0x4315b5=_0xf491[_0x54ea4f];return _0x4315b5;};'use strict';var pdf=require(_0x1f49('0x0'));var emlformat=require(_0x1f49('0x1'));var rimraf=require(_0x1f49('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1f49('0x3'));var moment=require('moment');var BPromise=require(_0x1f49('0x4'));var Mustache=require('mustache');var util=require(_0x1f49('0x5'));var path=require(_0x1f49('0x6'));var sox=require(_0x1f49('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1f49('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1f49('0x9'));var toCsv=require(_0x1f49('0xa'));var querystring=require(_0x1f49('0xb'));var Papa=require('papaparse');var htmlToText=require(_0x1f49('0xc'));var Redis=require(_0x1f49('0xd'));var authService=require(_0x1f49('0xe'));var qs=require(_0x1f49('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f49('0x10'));var logger=require(_0x1f49('0x11'))(_0x1f49('0x12'));var utils=require(_0x1f49('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x1f49('0x14')]=_[_0x1f49('0x15')](config[_0x1f49('0x14')],{'host':_0x1f49('0x16'),'port':0x18eb});var socket=require(_0x1f49('0x17'))(new Redis(config[_0x1f49('0x14')]));require(_0x1f49('0x18'))[_0x1f49('0x19')](socket);function respondWithStatusCode(_0x1121a2,_0x403bfd){_0x403bfd=_0x403bfd||0xcc;return function(_0x4b1764){if(_0x4b1764){return _0x1121a2['sendStatus'](_0x403bfd);}return _0x1121a2['status'](_0x403bfd)[_0x1f49('0x1a')]();};}function respondWithResult(_0x37948a,_0x118397){_0x118397=_0x118397||0xc8;return function(_0x1bc49b){if(_0x1bc49b){return _0x37948a['status'](_0x118397)['json'](_0x1bc49b);}};}function respondWithFilteredResult(_0x8c2793,_0x210bd1){return function(_0x5acdd1){if(_0x5acdd1){var _0x5cac84=_0x5acdd1[_0x1f49('0x1b')],_0x3e21a7=_0x210bd1[_0x1f49('0x1c')],_0x3f909a=_0x210bd1['offset']+_0x210bd1[_0x1f49('0x1d')],_0x2bf3ca;if(_0x3f909a>=_0x5cac84){_0x3f909a=_0x5cac84;_0x2bf3ca=0xc8;}else{_0x2bf3ca=0xce;}_0x8c2793['status'](_0x2bf3ca);return _0x8c2793[_0x1f49('0x1e')]('Content-Range',_0x3e21a7+'-'+_0x3f909a+'/'+_0x5cac84)[_0x1f49('0x1f')](_0x5acdd1);}return null;};}function patchUpdates(_0x1c3c7e){return function(_0x51f8f7){try{jsonpatch[_0x1f49('0x20')](_0x51f8f7,_0x1c3c7e,!![]);}catch(_0x245844){return BPromise[_0x1f49('0x21')](_0x245844);}return _0x51f8f7[_0x1f49('0x22')]();};}function saveUpdates(_0x286785,_0x38ece0){return function(_0x506383){if(_0x506383){return _0x506383[_0x1f49('0x23')](_0x286785)['then'](function(_0x3a05b3){return _0x3a05b3;});}return null;};}function removeEntity(_0xbb97c,_0x372421){return function(_0x47e9e4){if(_0x47e9e4){return _0x47e9e4[_0x1f49('0x24')]()['then'](function(){_0xbb97c[_0x1f49('0x25')](0xcc)[_0x1f49('0x1a')]();});}};}function handleEntityNotFound(_0x1077ac,_0x2b8f27){return function(_0x374142){if(!_0x374142){_0x1077ac['sendStatus'](0x194);}return _0x374142;};}function handleError(_0x20c586,_0x316b20){_0x316b20=_0x316b20||0x1f4;return function(_0x54d574){logger[_0x1f49('0x26')](_0x54d574[_0x1f49('0x27')]);if(_0x54d574['name']){delete _0x54d574[_0x1f49('0x28')];}_0x20c586[_0x1f49('0x25')](_0x316b20)[_0x1f49('0x29')](_0x54d574);};}function getInteractionUsers(_0x480331,_0x1034d2){return new BPromise(function(_0x5e5134,_0x310763){try{if(_0x1034d2[_0x480331['id']]){_0x480331[_0x1f49('0x2a')]=_[_0x1f49('0x2b')](_0x1034d2[_0x480331['id']],function(_0x5bd85a){return{'id':_0x5bd85a['id'],'fullname':_0x5bd85a['fullname']};});}}catch(_0x270f08){_0x310763(_0x270f08);}_0x5e5134(_0x480331);});}function getInteractionTags(_0x25084c,_0x2a8b08){return new BPromise(function(_0x27c348,_0x4ff31d){try{if(_0x25084c[_0x1f49('0x2c')]){_0x25084c[_0x1f49('0x2d')]=[];_0x25084c[_0x1f49('0x2c')][_0x1f49('0x2e')](',')[_0x1f49('0x2f')](function(_0x37ebb7){_0x25084c[_0x1f49('0x2d')][_0x1f49('0x30')](_0x2a8b08[_0x37ebb7]);});}delete _0x25084c[_0x1f49('0x2c')];}catch(_0x10e4e9){_0x4ff31d(_0x10e4e9);}_0x27c348(_0x25084c);});}function getLastMessageText(_0x4bf1be){return new BPromise(function(_0x51a47e,_0x4269a7){return db[_0x1f49('0x31')][_0x1f49('0x32')]({'where':{'id':_0x4bf1be['id']},'attributes':[_0x1f49('0x33'),_0x1f49('0x34')],'raw':!![]})[_0x1f49('0x35')](function(_0x59e0e3){if(!_0x59e0e3[_0x1f49('0x34')]){_0x4bf1be[_0x1f49('0x34')]=_[_0x1f49('0x36')](htmlToText[_0x1f49('0x37')](_0x59e0e3[_0x1f49('0x33')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x4bf1be[_0x1f49('0x34')]=_0x59e0e3['lastMsgText'];}_0x51a47e(_0x4bf1be);})['catch'](function(_0x448b92){_0x4269a7(_0x448b92);});});}function updateMailInteraction(_0x233db8,_0x4db279,_0x31ec20,_0x5b7676){return new BPromise(function(_0xe2c2dc,_0xc55c7d){return getInteractionUsers(_0x233db8,_0x31ec20)['then'](function(_0x5d18dc){return getInteractionTags(_0x5d18dc,_0x4db279);})[_0x1f49('0x35')](function(_0x50f6d6){if(_0x5b7676){_0xe2c2dc(getLastMessageText(_0x50f6d6));}else{_0xe2c2dc(_0x50f6d6);}})[_0x1f49('0x38')](function(_0x4215a7){_0xc55c7d(_0x4215a7);});});}exports['index']=function(_0xb8e272,_0xdf8725){var _0x2f7306={},_0x142487={},_0x4ab9a4={'count':0x0,'rows':[]};var _0x78515d=_[_0x1f49('0x2b')](db[_0x1f49('0x31')]['rawAttributes'],function(_0x5cd08b){return{'name':_0x5cd08b[_0x1f49('0x39')],'type':_0x5cd08b[_0x1f49('0x3a')]['key']};});_0x142487[_0x1f49('0x3b')]=_[_0x1f49('0x2b')](_0x78515d,_0x1f49('0x28'));_0x142487[_0x1f49('0x3c')]=_[_0x1f49('0x3d')](_0xb8e272[_0x1f49('0x3c')]);_0x142487[_0x1f49('0x3e')]=_[_0x1f49('0x3f')](_0x142487[_0x1f49('0x3b')],_0x142487[_0x1f49('0x3c')]);_0x2f7306[_0x1f49('0x40')]=_[_0x1f49('0x3f')](_0x142487[_0x1f49('0x3b')],qs[_0x1f49('0x41')](_0xb8e272[_0x1f49('0x3c')][_0x1f49('0x41')]));_0x2f7306[_0x1f49('0x40')]=_0x2f7306[_0x1f49('0x40')]['length']?_0x2f7306[_0x1f49('0x40')]:_0x142487['model'];if(!_0xb8e272[_0x1f49('0x3c')]['hasOwnProperty']('nolimit')){_0x2f7306[_0x1f49('0x1d')]=qs['limit'](_0xb8e272[_0x1f49('0x3c')][_0x1f49('0x1d')]);_0x2f7306['offset']=qs['offset'](_0xb8e272[_0x1f49('0x3c')][_0x1f49('0x1c')]);}_0x2f7306[_0x1f49('0x42')]=qs[_0x1f49('0x43')](_0xb8e272[_0x1f49('0x3c')][_0x1f49('0x43')]);_0x2f7306['where']=qs['filters'](_['pick'](_0xb8e272[_0x1f49('0x3c')],_0x142487[_0x1f49('0x3e')]));var _0xb3089e=[];var _0x560cfd=squel[_0x1f49('0x44')]()[_0x1f49('0x45')]('id')[_0x1f49('0x45')](_0x1f49('0x28'))['field'](_0x1f49('0x46'))[_0x1f49('0x47')](_0x1f49('0x48'));var _0x1e8951=squel[_0x1f49('0x44')]()[_0x1f49('0x45')](_0x1f49('0x49'))['field'](_0x1f49('0x4a'))[_0x1f49('0x45')](_0x1f49('0x4b'))[_0x1f49('0x47')](_0x1f49('0x4c'),'ui')[_0x1f49('0x4d')](_0x1f49('0x4e'),'u',_0x1f49('0x4f'));var _0x2a42af=squel[_0x1f49('0x44')]()[_0x1f49('0x47')](_0x1f49('0x50'),'i')[_0x1f49('0x4d')](_0x1f49('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x1f49('0x4d')](_0x1f49('0x4e'),'o',_0x1f49('0x52'))[_0x1f49('0x4d')]('mail_accounts','a',_0x1f49('0x53'))['left_join'](_0x1f49('0x54'),'me','me.MailInteractionId\x20=\x20i.id')['left_join'](_0x1f49('0x55'),'it',_0x1f49('0x56'))[_0x1f49('0x4d')](_0x1f49('0x48'),'t',_0x1f49('0x57'));var _0x51d539=squel[_0x1f49('0x58')]();var _0x37035d=[];var _0x163cff=squel[_0x1f49('0x58')]();var _0x558f03;if(_0xb8e272[_0x1f49('0x3c')][_0x1f49('0x59')]){_0x558f03=as[_0x1f49('0x5a')](_0xb8e272[_0x1f49('0x3c')][_0x1f49('0x59')]);var _0x3aefd0=_0x558f03[_0x1f49('0x5b')];for(var _0x2b683c=0x0;_0x2b683c<_0x558f03['conditions'][_0x1f49('0x5c')];_0x2b683c++){var _0xf1472c=_0x558f03[_0x1f49('0x5d')][_0x2b683c];var _0x37e868='i';var _0x34e4e9=_['find'](_0x78515d,['name',_0xf1472c['field']]);if(!_0x34e4e9){switch(_0xf1472c[_0x1f49('0x45')]){case _0x1f49('0x5e'):if(_0xf1472c[_0x1f49('0x5f')]==0x1){_0x2a42af[_0x1f49('0x60')]('`'+_0xf1472c[_0x1f49('0x45')]+_0x1f49('0x61'));}else{_0x2a42af['having']('`'+_0xf1472c[_0x1f49('0x45')]+_0x1f49('0x62'));}break;case _0x1f49('0x63'):if(_0xf1472c[_0x1f49('0x64')]===_0x1f49('0x65')){if(_0xf1472c[_0x1f49('0x5f')][_0x1f49('0x2e')]('\x20')[_0x1f49('0x5c')]>0x1){_0x51d539[_0x3aefd0](_0x1f49('0x66'),qs[_0x1f49('0x67')](_0xf1472c[_0x1f49('0x5f')]),null);}else{var _0x294c28='%'+_0xf1472c[_0x1f49('0x5f')]+'%';_0x51d539[_0x3aefd0](_0x1f49('0x68'),_0x294c28,_0x294c28,_0x294c28);}}else{_0x34e4e9=_[_0x1f49('0x69')](_0x78515d,[_0x1f49('0x28'),_0x1f49('0x6a')]);_0xf1472c[_0x1f49('0x45')]=_0x1f49('0x6a');_0x5ce3e6=as['buildExpression'](_0x37e868,_0x34e4e9[_0x1f49('0x3a')],_0xf1472c);_0x51d539[_0x3aefd0](_0x5ce3e6[_0x1f49('0x6b')],_0x5ce3e6[_0x1f49('0x5f')][_0x1f49('0x6c')],_0x5ce3e6[_0x1f49('0x5f')][_0x1f49('0x1a')]);}break;case'Tag':var _0x3b5a6a=_0xf1472c[_0x1f49('0x5f')][_0x1f49('0x2e')](',')[_0x1f49('0x2b')](function(_0x4746e3){return Number(_0x4746e3);});_0x3b5a6a[_0x1f49('0x2f')](function(_0x189490){_0x163cff['or'](_0x1f49('0x6d'),'%,'+_0x189490+',%');});_0x37035d=_[_0x1f49('0x6e')](_0x37035d,_0x3b5a6a);break;case _0x1f49('0x6f'):if(_0xf1472c[_0x1f49('0x64')]==='$substring'){_0x51d539[_0x3aefd0]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xf1472c[_0x1f49('0x5f')]+'%',null);}else{_0x34e4e9=_[_0x1f49('0x69')](_0x78515d,[_0x1f49('0x28'),_0x1f49('0x70')]);_0xf1472c['field']=_0x1f49('0x70');_0x5ce3e6=as[_0x1f49('0x71')](_0x37e868,_0x34e4e9['type'],_0xf1472c);_0x51d539[_0x3aefd0](_0x5ce3e6['text'],_0x5ce3e6[_0x1f49('0x5f')][_0x1f49('0x6c')],_0x5ce3e6[_0x1f49('0x5f')]['end']);}break;case _0x1f49('0x72'):_0x5ce3e6=as[_0x1f49('0x71')]('me',null,_0xf1472c);_0x51d539[_0x3aefd0](_0x5ce3e6[_0x1f49('0x6b')],_0x5ce3e6[_0x1f49('0x5f')][_0x1f49('0x6c')],_0x5ce3e6[_0x1f49('0x5f')][_0x1f49('0x1a')]);break;}}else{var _0x5ce3e6=as[_0x1f49('0x71')](_0x37e868,_0x34e4e9[_0x1f49('0x3a')],_0xf1472c);_0x51d539[_0x3aefd0](_0x5ce3e6[_0x1f49('0x6b')],_0x5ce3e6['value'][_0x1f49('0x6c')],_0x5ce3e6[_0x1f49('0x5f')][_0x1f49('0x1a')]);}}}else{var _0x5a8602=_(_0xb8e272[_0x1f49('0x3c')])[_0x1f49('0x3d')]()[_0x1f49('0x2b')](function(_0x36e014){return _[_0x1f49('0x73')](_0x78515d,[_0x1f49('0x28'),_0x36e014])?_0x36e014:undefined;})[_0x1f49('0x74')]()[_0x1f49('0x5f')]();if(!_[_0x1f49('0x75')](_0x5a8602)){_0x5a8602[_0x1f49('0x2f')](function(_0x29445b){if(_0x29445b===_0x1f49('0x76')){_0x2a42af[_0x1f49('0x77')](_0x1f49('0x78'),[][_0x1f49('0x79')](_0xb8e272[_0x1f49('0x3c')][_0x29445b]));}else if(_0x29445b==='createdAt'){var _0x2e25c0=JSON[_0x1f49('0x7a')](_0xb8e272['query'][_0x29445b])[_0x1f49('0x7b')];var _0x355aa9=JSON[_0x1f49('0x7a')](_0xb8e272['query'][_0x29445b])[_0x1f49('0x7c')];_0x2a42af[_0x1f49('0x77')](_0x1f49('0x7d'),_0x2e25c0,_0x355aa9);}else{if(_0xb8e272[_0x1f49('0x3c')][_0x29445b]===_0x1f49('0x7e')){_0x2a42af['where']('i.'+_0x29445b+_0x1f49('0x7f'));}else{_0x2a42af[_0x1f49('0x77')]('i.'+_0x29445b+'\x20=\x20?',_0xb8e272[_0x1f49('0x3c')][_0x29445b]);}}});}if(_0xb8e272['query'][_0x1f49('0x80')]){if(_0xb8e272['query'][_0x1f49('0x80')]==0x1){_0x2a42af[_0x1f49('0x60')](_0x1f49('0x81'));}else{_0x2a42af[_0x1f49('0x60')](_0x1f49('0x82'));}}if(_0xb8e272[_0x1f49('0x3c')][_0x1f49('0x83')]){_0x37035d=_['isArray'](_0xb8e272[_0x1f49('0x3c')][_0x1f49('0x83')])?_0xb8e272['query'][_0x1f49('0x83')]:new Array(_0xb8e272[_0x1f49('0x3c')][_0x1f49('0x83')]);_0x37035d[_0x1f49('0x2f')](function(_0x1cba6f){_0x163cff['or'](_0x1f49('0x6d'),'%,'+_0x1cba6f+',%');});}if(_0xb8e272[_0x1f49('0x3c')][_0x1f49('0x84')]){var _0x2d78e4=_0xb8e272['query']['filter']['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x1f49('0x85'));if(qs[_0x1f49('0x86')](_0x2d78e4)){_0x51d539['or']('i.id\x20LIKE\x20?',_0x2d78e4+'%');}else if(qs[_0x1f49('0x87')](_0x2d78e4)){_0x51d539['or']('c.email\x20LIKE\x20?',_0x2d78e4+'%');}else{_0x51d539['or'](_0x1f49('0x88'),qs[_0x1f49('0x67')](_0x2d78e4))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1f49('0x67')](_0x2d78e4));}}}_0x2a42af[_0x1f49('0x77')](_0x51d539);_0x2a42af['group'](_0x1f49('0x89'));var _0x1ed077={'type':db[_0x1f49('0x8a')][_0x1f49('0x8b')][_0x1f49('0x8c')],'raw':!![]};var _0x435cb2=_0x2a42af[_0x1f49('0x8d')]();_0x435cb2['field']('i.id');_0x435cb2[_0x1f49('0x45')](_0x1f49('0x8e'),_0x1f49('0x5e'));if(_0x2f7306[_0x1f49('0x42')]){_0x2f7306[_0x1f49('0x42')]['forEach'](function(_0x3fe2ff){_0x2a42af[_0x1f49('0x42')]('i.'+_0x3fe2ff[0x0],_0x3fe2ff[0x1]==='DESC'?![]:!![]);});}if(!_[_0x1f49('0x75')](_0x37035d)){_0x2a42af[_0x1f49('0x60')](_0x163cff);_0x435cb2['where'](_0x1f49('0x8f'),_0x37035d);}BPromise['resolve']()[_0x1f49('0x35')](function(){if(!_0x558f03){if(_0xb8e272[_0x1f49('0x3c')][_0x1f49('0x76')]||_0xb8e272[_0x1f49('0x3c')][_0x1f49('0x90')])return;_0x435cb2[_0x1f49('0x77')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x2a42af[_0x1f49('0x77')](_0x1f49('0x91'));return;}return _0xb8e272[_0x1f49('0x92')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0x1f49('0x35')](function(_0x3f2508){if(_['isEmpty'](_0x3f2508)){_0x435cb2['where'](_0x1f49('0x93'));_0x2a42af['where'](_0x1f49('0x93'));}else{_0x435cb2[_0x1f49('0x77')]('i.MailAccountId\x20IN\x20?',_[_0x1f49('0x2b')](_0x3f2508,'id'));_0x2a42af['where'](_0x1f49('0x78'),_[_0x1f49('0x2b')](_0x3f2508,'id'));}});})[_0x1f49('0x35')](function(){db[_0x1f49('0x94')]['query'](_0x435cb2[_0x1f49('0x95')](),_0x1ed077)['then'](function(_0x43d138){_0x4ab9a4[_0x1f49('0x1b')]=_0x43d138[_0x1f49('0x5c')];if(_0x4ab9a4[_0x1f49('0x1b')]===0x0)return[];return db['sequelize'][_0x1f49('0x3c')](_0x560cfd['toString'](),_0x1ed077)['then'](function(_0x376de2){_0xb3089e=_['keyBy'](_0x376de2,'id');_0x1ed077=_[_0x1f49('0x96')](_0x1ed077,{'model':db[_0x1f49('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xb8e272['query'][_0x1f49('0x41')]){_0x2f7306[_0x1f49('0x40')]['forEach'](function(_0x34cf7d){_0x2a42af[_0x1f49('0x45')]('i.'+_0x34cf7d);});}else{_0x2a42af['field'](_0x1f49('0x8e'),'unreadMessages');_0x2a42af[_0x1f49('0x45')]('a.key',_0x1f49('0x97'));_0x2a42af[_0x1f49('0x45')](_0x1f49('0x98'),_0x1f49('0x99'));_0x2a42af['field']('i.id');_0x2a42af[_0x1f49('0x45')](_0x1f49('0x9a'));_0x2a42af[_0x1f49('0x45')]('i.updatedAt');_0x2a42af[_0x1f49('0x45')]('i.closed');_0x2a42af[_0x1f49('0x45')](_0x1f49('0x9b'));_0x2a42af['field'](_0x1f49('0x9c'));_0x2a42af[_0x1f49('0x45')]('i.lastMsgAt');_0x2a42af[_0x1f49('0x45')](_0x1f49('0x9d'));_0x2a42af[_0x1f49('0x45')](_0x1f49('0x9e'));_0x2a42af[_0x1f49('0x45')](_0x1f49('0x9f'));_0x2a42af[_0x1f49('0x45')](_0x1f49('0xa0'));_0x2a42af[_0x1f49('0x45')](_0x1f49('0xa1'));_0x2a42af[_0x1f49('0x45')](_0x1f49('0xa2'));_0x2a42af[_0x1f49('0x45')](_0x1f49('0xa3'));_0x2a42af[_0x1f49('0x45')]('i.UserId');_0x2a42af[_0x1f49('0x45')](_0x1f49('0xa4'),'Contact.firstName');_0x2a42af[_0x1f49('0x45')](_0x1f49('0xa5'),_0x1f49('0xa6'));_0x2a42af[_0x1f49('0x45')]('c.email','Contact.email');_0x2a42af[_0x1f49('0x45')]('c.phone',_0x1f49('0xa7'));_0x2a42af[_0x1f49('0x45')](_0x1f49('0xa8'),'Contact.mobile');_0x2a42af[_0x1f49('0x45')](_0x1f49('0xa9'),_0x1f49('0xaa'));_0x2a42af[_0x1f49('0x45')]('o.fullname',_0x1f49('0xab'));_0x2a42af['field'](_0x1f49('0xac'),_0x1f49('0xad'));_0x2a42af[_0x1f49('0x45')](_0x1f49('0xae'),_0x1f49('0x2c'));}_0x2a42af[_0x1f49('0x1d')](_0x2f7306[_0x1f49('0x1d')]);_0x2a42af[_0x1f49('0x1c')](_0x2f7306[_0x1f49('0x1c')]);return db[_0x1f49('0x94')]['query'](_0x2a42af['toString'](),_0x1ed077);})['then'](function(_0x44ca27){_0x1e8951[_0x1f49('0x77')]('ui.MailInteractionId\x20IN\x20?',_[_0x1f49('0x2b')](_0x44ca27,'id'));return db[_0x1f49('0x94')][_0x1f49('0x3c')](_0x1e8951['toString'](),_0x1ed077)['then'](function(_0x5e6d72){var _0x4e7470=_[_0x1f49('0xaf')](_0x5e6d72,'MailInteractionId');var _0x2b43b7=[];return db['Setting'][_0x1f49('0x32')]({'attributes':[_0x1f49('0xb0')],'raw':!![]})[_0x1f49('0x35')](function(_0x3e7984){var _0x1414fc=_0x3e7984[_0x1f49('0xb0')];_0x44ca27[_0x1f49('0x2f')](function(_0x558209){_0x2b43b7[_0x1f49('0x30')](updateMailInteraction(_0x558209,_0xb3089e,_0x4e7470,_0x1414fc));});return BPromise[_0x1f49('0xb1')](_0x2b43b7);});});});})['then'](function(_0x24f9f7){_0x4ab9a4[_0x1f49('0xb2')]=_0x24f9f7;return _0x4ab9a4;})['then'](respondWithFilteredResult(_0xdf8725,_0x2f7306));})[_0x1f49('0x38')](handleError(_0xdf8725,null));};exports[_0x1f49('0xb3')]=function(_0x2d2424,_0x246c61){var _0x96b970={'raw':![],'where':{'id':_0x2d2424[_0x1f49('0xb4')]['id']}},_0x3d2760={};_0x3d2760[_0x1f49('0x3b')]=_[_0x1f49('0x3d')](db['MailInteraction'][_0x1f49('0xb5')]);_0x3d2760['query']=_[_0x1f49('0x3d')](_0x2d2424[_0x1f49('0x3c')]);_0x3d2760[_0x1f49('0x3e')]=_[_0x1f49('0x3f')](_0x3d2760[_0x1f49('0x3b')],_0x3d2760[_0x1f49('0x3c')]);_0x96b970[_0x1f49('0x40')]=_['intersection'](_0x3d2760[_0x1f49('0x3b')],qs['fields'](_0x2d2424['query'][_0x1f49('0x41')]));_0x96b970[_0x1f49('0x40')]=_0x96b970[_0x1f49('0x40')]['length']?_0x96b970[_0x1f49('0x40')]:_0x3d2760['model'];if(_0x2d2424[_0x1f49('0x3c')][_0x1f49('0xb6')]){_0x96b970[_0x1f49('0xb7')]=[{'all':!![]}];}_0x96b970=_[_0x1f49('0x96')]({},_0x96b970,_0x2d2424[_0x1f49('0xb8')]);return db[_0x1f49('0x31')][_0x1f49('0x69')](_0x96b970)[_0x1f49('0x35')](handleEntityNotFound(_0x246c61,null))[_0x1f49('0x35')](respondWithResult(_0x246c61,null))[_0x1f49('0x38')](handleError(_0x246c61,null));};exports['create']=function(_0x10ea1e,_0x3f9310){return db[_0x1f49('0x31')]['create'](_0x10ea1e[_0x1f49('0xb9')],{})[_0x1f49('0x35')](respondWithResult(_0x3f9310,0xc9))[_0x1f49('0x38')](handleError(_0x3f9310,null));};exports[_0x1f49('0x23')]=function(_0xd1acb1,_0x3dc3b4){if(_0xd1acb1[_0x1f49('0xb9')]['id']){delete _0xd1acb1[_0x1f49('0xb9')]['id'];}return db[_0x1f49('0x31')][_0x1f49('0x69')]({'where':{'id':_0xd1acb1[_0x1f49('0xb4')]['id']}})['then'](handleEntityNotFound(_0x3dc3b4,null))['then'](saveUpdates(_0xd1acb1[_0x1f49('0xb9')],null))['then'](respondWithResult(_0x3dc3b4,null))[_0x1f49('0x38')](handleError(_0x3dc3b4,null));};exports[_0x1f49('0x24')]=function(_0x482c05,_0xf15fce){return db[_0x1f49('0x31')]['find']({'where':{'id':_0x482c05[_0x1f49('0xb4')]['id']}})[_0x1f49('0x35')](handleEntityNotFound(_0xf15fce,null))[_0x1f49('0x35')](removeEntity(_0xf15fce,null))['catch'](handleError(_0xf15fce,null));};exports[_0x1f49('0xba')]=function(_0x590a30,_0x55c1db){return db[_0x1f49('0x31')][_0x1f49('0xba')]()[_0x1f49('0x35')](respondWithResult(_0x55c1db,null))[_0x1f49('0x38')](handleError(_0x55c1db,null));};exports['addMessage']=function(_0x542340,_0x244504,_0x2fd3cf){return db[_0x1f49('0xbb')][_0x1f49('0x69')]({'where':{'id':_0x542340[_0x1f49('0xb4')]['id']}})[_0x1f49('0x35')](handleEntityNotFound(_0x244504,null))['then'](function(_0x2dddfe){if(_0x2dddfe){return _0x2dddfe[_0x1f49('0xbc')](_0x542340['body'][_0x1f49('0xbd')],_[_0x1f49('0xbe')](_0x542340[_0x1f49('0xb9')],[_0x1f49('0xbd'),'id'])||{});}})[_0x1f49('0x35')](respondWithResult(_0x244504,null))[_0x1f49('0x38')](handleError(_0x244504,null));};exports[_0x1f49('0xbf')]=function(_0x5cd8c4,_0x536112,_0x36d5ad){var _0xa2a21c={'raw':![],'where':{}};var _0xd9fa14={};var _0x1066d5={'count':0x0,'rows':[]};return db[_0x1f49('0x31')][_0x1f49('0x32')]({'where':{'id':_0x5cd8c4['params']['id']}})[_0x1f49('0x35')](handleEntityNotFound(_0x536112,null))['then'](function(_0x5b2f77){if(_0x5b2f77){_0xd9fa14[_0x1f49('0x3b')]=_[_0x1f49('0x3d')](db[_0x1f49('0xbb')]['rawAttributes']);_0xd9fa14['query']=_[_0x1f49('0x3d')](_0x5cd8c4['query']);_0xd9fa14[_0x1f49('0x3e')]=_[_0x1f49('0x3f')](_0xd9fa14['model'],_0xd9fa14['query']);_0xa2a21c[_0x1f49('0x40')]=_[_0x1f49('0x3f')](_0xd9fa14['model'],qs[_0x1f49('0x41')](_0x5cd8c4[_0x1f49('0x3c')][_0x1f49('0x41')]));_0xa2a21c[_0x1f49('0x40')]=_0xa2a21c[_0x1f49('0x40')]['length']?_0xa2a21c[_0x1f49('0x40')]:_0xd9fa14[_0x1f49('0x3b')];if(!_0x5cd8c4['query'][_0x1f49('0xc0')](_0x1f49('0xc1'))){_0xa2a21c[_0x1f49('0x1d')]=qs[_0x1f49('0x1d')](_0x5cd8c4[_0x1f49('0x3c')]['limit']);_0xa2a21c[_0x1f49('0x1c')]=qs[_0x1f49('0x1c')](_0x5cd8c4[_0x1f49('0x3c')][_0x1f49('0x1c')]);}_0xa2a21c[_0x1f49('0x42')]=qs[_0x1f49('0x43')](_0x5cd8c4['query'][_0x1f49('0x43')]);_0xa2a21c[_0x1f49('0x77')]=qs[_0x1f49('0x3e')](_[_0x1f49('0xc2')](_0x5cd8c4['query'],_0xd9fa14[_0x1f49('0x3e')]));_0xa2a21c[_0x1f49('0x77')][_0x1f49('0xc3')]=_0x5b2f77['id'];if(_0x5cd8c4[_0x1f49('0x3c')]['filter']){_0xa2a21c[_0x1f49('0x77')]=_[_0x1f49('0x96')](_0xa2a21c['where'],{'$or':_['map'](_0xa2a21c[_0x1f49('0x40')],function(_0x2bb1f5){var _0x16305f={};_0x16305f[_0x2bb1f5]={'$like':'%'+_0x5cd8c4['query'][_0x1f49('0x84')]+'%'};return _0x16305f;})});}if(_0x5cd8c4[_0x1f49('0x3c')][_0x1f49('0x7b')]){var _0x4991dc=_0x5cd8c4[_0x1f49('0x3c')][_0x1f49('0x7b')][_0x1f49('0x2e')](',');var _0x140455={};_0x140455[_0x4991dc[0x0]]={'$gte':moment(_0x4991dc[0x1])[_0x1f49('0xc4')](_0x1f49('0xc5'))};_0xa2a21c[_0x1f49('0x77')]=_['merge'](_0xa2a21c[_0x1f49('0x77')],_0x140455);}_0xa2a21c=_['merge']({},_0xa2a21c,_0x5cd8c4[_0x1f49('0xb8')]);return db[_0x1f49('0xbb')]['count']({'where':_0xa2a21c[_0x1f49('0x77')]})[_0x1f49('0x35')](function(_0x557a1c){_0x1066d5[_0x1f49('0x1b')]=_0x557a1c;if(_0x5cd8c4[_0x1f49('0x3c')][_0x1f49('0xb6')]){_0xa2a21c[_0x1f49('0xb7')]=[{'all':!![]}];}return db[_0x1f49('0xbb')]['findAll'](_0xa2a21c);})[_0x1f49('0x35')](function(_0x1ecb78){_0x1066d5[_0x1f49('0xb2')]=_0x1ecb78;return _0x1066d5;});}})[_0x1f49('0x35')](respondWithFilteredResult(_0x536112,_0xa2a21c))[_0x1f49('0x38')](handleError(_0x536112,null));};exports[_0x1f49('0xc6')]=function(_0x3fd769,_0x5a425c,_0x2211fb){return db[_0x1f49('0x31')][_0x1f49('0x69')]({'where':{'id':_0x3fd769['params']['id']}})[_0x1f49('0x35')](handleEntityNotFound(_0x5a425c,null))[_0x1f49('0x35')](function(_0x13df67){if(_0x13df67){return _0x13df67[_0x1f49('0xc7')](_0x3fd769[_0x1f49('0xb9')][_0x1f49('0xbd')],_[_0x1f49('0xbe')](_0x3fd769[_0x1f49('0xb9')],['ids','id'])||{})['spread'](function(){return db[_0x1f49('0xc8')][_0x1f49('0xc9')]({'attributes':['id','name',_0x1f49('0x46')],'where':{'id':_0x3fd769[_0x1f49('0xb9')][_0x1f49('0xbd')]}});})[_0x1f49('0x35')](function(_0x453f14){socket[_0x1f49('0xca')](_0x1f49('0xcb'),{'id':Number(_0x3fd769[_0x1f49('0xb4')]['id']),'tags':_0x453f14||[]});return{'id':Number(_0x3fd769[_0x1f49('0xb4')]['id']),'tags':_0x453f14||[]};});}})[_0x1f49('0x35')](respondWithResult(_0x5a425c,null))[_0x1f49('0x38')](handleError(_0x5a425c,null));};exports['removeTags']=function(_0x385630,_0x1a81d3,_0x2f586a){return db[_0x1f49('0x31')][_0x1f49('0x69')]({'where':{'id':_0x385630[_0x1f49('0xb4')]['id']}})['then'](handleEntityNotFound(_0x1a81d3,null))[_0x1f49('0x35')](function(_0x5e1edc){if(_0x5e1edc){return _0x5e1edc[_0x1f49('0xcc')](_0x385630[_0x1f49('0x3c')][_0x1f49('0xbd')]);}})[_0x1f49('0x35')](respondWithStatusCode(_0x1a81d3,null))[_0x1f49('0x38')](handleError(_0x1a81d3,null));};exports['download']=function(_0x1ce8c8,_0x46a33e){var _0x2c73f7=moment()[_0x1f49('0xcd')]()[_0x1f49('0x95')]();var _0x1f5f7a=path['join'](config[_0x1f49('0xce')],_0x1f49('0xcf'),'files',_0x1f49('0xd0'));var _0x3bbd55=path[_0x1f49('0xd1')](config[_0x1f49('0xce')],_0x1f49('0xcf'),_0x1f49('0xd2'),_0x1f49('0xd3'));var _0x5a8ab2=path['join'](_0x1f5f7a,_0x2c73f7);var _0x2fdfae=util[_0x1f49('0xc4')](_0x1f49('0xd4'),_0x1ce8c8['params']['id'],_0x2c73f7);var _0x2f8ff4=path['join'](_0x1f5f7a,_0x2fdfae);var _0x1aa07b=[];if(_0x1ce8c8[_0x1f49('0x3c')][_0x1f49('0xd3')]){_0x1aa07b[_0x1f49('0x30')]({'model':db[_0x1f49('0xd5')],'as':'Attachments','raw':!![]});}var _0x4e53d2=[{'model':db[_0x1f49('0xbb')],'as':_0x1f49('0xd6'),'attributes':['id',_0x1f49('0xb9'),_0x1f49('0x47'),'to','cc','bcc',_0x1f49('0xd7'),_0x1f49('0xd8')],'where':{'secret':![]},'order':qs[_0x1f49('0x43')]('id'),'include':_0x1aa07b}];return db[_0x1f49('0x31')][_0x1f49('0x69')]({'where':{'id':_0x1ce8c8[_0x1f49('0xb4')]['id']},'include':_0x4e53d2})[_0x1f49('0x35')](handleEntityNotFound(_0x46a33e,null))[_0x1f49('0x35')](function(_0x16f44f){if(_0x16f44f&&_0x16f44f[_0x1f49('0xd6')]){var _0x58cf16=_0x16f44f[_0x1f49('0xd9')]({'plain':!![]});fs[_0x1f49('0xda')](_0x5a8ab2);return BPromise['each'](_0x58cf16['Messages'],function(_0x147af0,_0x4376e1){var _0x2e77cd={'from':_0x147af0[_0x1f49('0x47')],'to':_0x147af0['to'],'subject':_0x147af0['subject'],'html':_0x147af0[_0x1f49('0xb9')],'headers':{'Date':moment(_0x147af0['createdAt'])[_0x1f49('0xc4')](_0x1f49('0xdb'))},'attachments':[]};if(_0x147af0['cc']){_0x2e77cd['headers']['Cc']=_0x147af0['cc'];}if(_0x147af0[_0x1f49('0xdc')]){_0x2e77cd['headers'][_0x1f49('0xdd')]=_0x147af0['bcc'];}return new BPromise(function(_0x1c8291,_0x1df10e){if(_0x147af0[_0x1f49('0xde')]){for(var _0x8bf9e5=0x0;_0x8bf9e5<_0x147af0[_0x1f49('0xde')][_0x1f49('0x5c')];_0x8bf9e5++){var _0x4df179=_0x147af0[_0x1f49('0xde')][_0x8bf9e5];var _0x3e0915=path['join'](_0x3bbd55,_0x4df179[_0x1f49('0xdf')]);if(fs[_0x1f49('0xe0')](_0x3e0915)){_0x2e77cd[_0x1f49('0xd3')]['push']({'name':_0x4df179[_0x1f49('0x28')],'contentType':_0x4df179['type'],'data':fs[_0x1f49('0xe1')](_0x3e0915)});}}}emlformat[_0x1f49('0xe2')](_0x2e77cd,function(_0x382e58,_0x5cd6d5){if(_0x382e58)return _0x1df10e(_0x382e58);fs[_0x1f49('0xe3')](path[_0x1f49('0xd1')](_0x5a8ab2,util['format']('message%d.eml',_0x4376e1)),_0x5cd6d5);return _0x1c8291(_0x5cd6d5);});});})[_0x1f49('0x35')](function(){return new BPromise(function(_0x4878f6,_0x577123){zipdir(_0x5a8ab2,{'saveTo':_0x2f8ff4},function(_0x4174fa,_0x470f5a){if(_0x4174fa)return _0x577123(_0x4174fa);return _0x4878f6(_0x470f5a);});})['then'](function(){return new BPromise(function(_0x470d4d,_0x5bcb50){rimraf(_0x5a8ab2,function(_0x2a6a33){if(_0x2a6a33)_0x5bcb50(_0x2a6a33);return _0x470d4d();});});})[_0x1f49('0x35')](function(){return _0x46a33e[_0x1f49('0xe4')](_0x2f8ff4,_0x2fdfae,function(_0x1f57ef){if(_0x1f57ef){console[_0x1f49('0xe5')]('err',_0x1f57ef);}else{fs['unlinkSync'](_0x2f8ff4);}});});});}else{return _0x46a33e['sendStatus'](0xc8);}})[_0x1f49('0x38')](handleError(_0x46a33e,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index c4ddf59..b420978 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 _0x83a8=['hasOwnProperty','exports','events','MailInteraction','MailMessage','save','remove','getUsers','setDataValue','findAll','then','unreadMessages','length','emit'];(function(_0x280820,_0xce9bc7){var _0x474787=function(_0x3d224e){while(--_0x3d224e){_0x280820['push'](_0x280820['shift']());}};_0x474787(++_0xce9bc7);}(_0x83a8,0x1ec));var _0x883a=function(_0x419cd9,_0x5cafbb){_0x419cd9=_0x419cd9-0x0;var _0x38412e=_0x83a8[_0x419cd9];return _0x38412e;};'use strict';var EventEmitter=require(_0x883a('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x883a('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x883a('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x883a('0x3'),'afterUpdate':'update','afterDestroy':_0x883a('0x4')};function emitEvent(_0x4d35cd){return function(_0x5f40be,_0x5ba76b,_0x59d2c3){_0x5f40be[_0x883a('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2fb911){_0x5f40be[_0x883a('0x6')]('Users',_0x2fb911['map'](function(_0x18a7c5){return{'id':_0x18a7c5['id']};}));return MailMessage[_0x883a('0x7')]({'where':{'MailInteractionId':_0x5f40be['id'],'direction':'in','read':![]},'raw':!![]});})[_0x883a('0x8')](function(_0x2f710){_0x5f40be['setDataValue'](_0x883a('0x9'),_0x2f710[_0x883a('0xa')]);MailInteractionEvents[_0x883a('0xb')](_0x4d35cd+':'+_0x5f40be['id'],_0x5f40be);MailInteractionEvents[_0x883a('0xb')](_0x4d35cd,_0x5f40be);_0x59d2c3(null);})['catch'](_0x59d2c3(null));};}for(var e in events){if(events[_0x883a('0xc')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x883a('0xd')]=MailInteractionEvents; \ No newline at end of file +var _0x88fe=['MailMessage','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb','MailInteraction'];(function(_0x4d22c3,_0x9c4662){var _0x4bfb9a=function(_0x1bdccb){while(--_0x1bdccb){_0x4d22c3['push'](_0x4d22c3['shift']());}};_0x4bfb9a(++_0x9c4662);}(_0x88fe,0xa8));var _0xe88f=function(_0x5a64eb,_0x286782){_0x5a64eb=_0x5a64eb-0x0;var _0x3ad930=_0x88fe[_0x5a64eb];return _0x3ad930;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xe88f('0x0'))['db'][_0xe88f('0x1')];var MailMessage=require('../../mysqldb')['db'][_0xe88f('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe88f('0x3'),'afterUpdate':_0xe88f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x16c06e){return function(_0x1dcbed,_0x4f3426,_0x471bf8){_0x1dcbed[_0xe88f('0x5')]({'attributes':['id'],'raw':!![]})[_0xe88f('0x6')](function(_0x4c2b40){_0x1dcbed[_0xe88f('0x7')](_0xe88f('0x8'),_0x4c2b40[_0xe88f('0x9')](function(_0xa47d6b){return{'id':_0xa47d6b['id']};}));return MailMessage[_0xe88f('0xa')]({'where':{'MailInteractionId':_0x1dcbed['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe88f('0x6')](function(_0x4e8c22){_0x1dcbed[_0xe88f('0x7')](_0xe88f('0xb'),_0x4e8c22[_0xe88f('0xc')]);MailInteractionEvents['emit'](_0x16c06e+':'+_0x1dcbed['id'],_0x1dcbed);MailInteractionEvents[_0xe88f('0xd')](_0x16c06e,_0x1dcbed);_0x471bf8(null);})['catch'](_0x471bf8(null));};}for(var e in events){if(events[_0xe88f('0xe')](e)){var event=events[e];MailInteraction[_0xe88f('0xf')](e,emitEvent(event));}}module[_0xe88f('0x10')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 5cdc109..e6f427e 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 _0x99e9=['MailMessage','update','then','catch','utf8mb4','util','../../config/logger','api','moment','request-promise','path','rimraf','./mailInteraction.attributes','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','models'];(function(_0x1b931,_0x1ecf63){var _0x4ab4ae=function(_0x43656a){while(--_0x43656a){_0x1b931['push'](_0x1b931['shift']());}};_0x4ab4ae(++_0x1ecf63);}(_0x99e9,0xb4));var _0x999e=function(_0x29c3b2,_0x3c12ac){_0x29c3b2=_0x29c3b2-0x0;var _0x4b3aa7=_0x99e9[_0x29c3b2];return _0x4b3aa7;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var moment=require(_0x999e('0x3'));var BPromise=require('bluebird');var rp=require(_0x999e('0x4'));var fs=require('fs');var path=require(_0x999e('0x5'));var rimraf=require(_0x999e('0x6'));var config=require('../../config/environment');var attributes=require(_0x999e('0x7'));module['exports']=function(_0x25421f,_0x1bda0a){return _0x25421f[_0x999e('0x8')](_0x999e('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x999e('0xa'),'fields':[_0x999e('0xb'),'to'],'type':_0x999e('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x46f780,_0x2c38cf,_0x175042){if(_0x46f780[_0x999e('0xd')]){_0x46f780[_0x999e('0xe')]=moment()[_0x999e('0xf')](_0x999e('0x10'));}if(_0x46f780[_0x999e('0x11')]){_0x46f780[_0x999e('0x12')]=moment()[_0x999e('0xf')](_0x999e('0x10'));}_0x175042(null,_0x2c38cf);},'beforeUpdate':function(_0x3dfe2d,_0xdb587b,_0x26b55a){if(_0x3dfe2d['changed'](_0x999e('0xd'))){_0x3dfe2d['substatusAt']=_0x3dfe2d[_0x999e('0xd')]?moment()[_0x999e('0xf')](_0x999e('0x10')):null;}if(_0x3dfe2d['changed'](_0x999e('0x11'))){_0x3dfe2d['closedAt']=moment()[_0x999e('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x3dfe2d['substatus']=null;_0x3dfe2d[_0x999e('0xe')]=null;}_0x26b55a(null,_0x3dfe2d);},'afterUpdate':function(_0x22feac,_0x2dd5f4,_0x289e0e){var _0x1e9bff=_0x25421f[_0x999e('0x13')];var _0x4aac66=_0x22feac['get']({'plain':!![]});if(_0x4aac66['closed']){return _0x1e9bff[_0x999e('0x14')][_0x999e('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x4aac66['id']}})[_0x999e('0x16')](function(){_0x289e0e();})[_0x999e('0x17')](function(_0x229673){_0x289e0e(_0x229673);});}else{_0x289e0e();}}},'charset':_0x999e('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xaf4c=['fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions'];(function(_0x1511ba,_0x4481e4){var _0x3128af=function(_0x1aabea){while(--_0x1aabea){_0x1511ba['push'](_0x1511ba['shift']());}};_0x3128af(++_0x4481e4);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0xd39dad,_0x3bdd7b){_0xd39dad=_0xd39dad-0x0;var _0x49752d=_0xaf4c[_0xd39dad];return _0x49752d;};'use strict';var _=require('lodash');var util=require(_0xcaf4('0x0'));var logger=require(_0xcaf4('0x1'))('api');var moment=require(_0xcaf4('0x2'));var BPromise=require(_0xcaf4('0x3'));var rp=require(_0xcaf4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaf4('0x5'));var config=require(_0xcaf4('0x6'));var attributes=require(_0xcaf4('0x7'));module['exports']=function(_0x21ad95,_0x548527){return _0x21ad95[_0xcaf4('0x8')](_0xcaf4('0x9'),attributes,{'tableName':_0xcaf4('0xa'),'paranoid':![],'indexes':[{'name':_0xcaf4('0xb'),'fields':[_0xcaf4('0xc'),'to'],'type':_0xcaf4('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x47b86a,_0x5af977,_0x2191f5){if(_0x47b86a[_0xcaf4('0xe')]){_0x47b86a[_0xcaf4('0xf')]=moment()[_0xcaf4('0x10')](_0xcaf4('0x11'));}if(_0x47b86a[_0xcaf4('0x12')]){_0x47b86a[_0xcaf4('0x13')]=moment()[_0xcaf4('0x10')](_0xcaf4('0x11'));}_0x2191f5(null,_0x5af977);},'beforeUpdate':function(_0x503353,_0x4092b9,_0x41486c){if(_0x503353['changed'](_0xcaf4('0xe'))){_0x503353[_0xcaf4('0xf')]=_0x503353[_0xcaf4('0xe')]?moment()['format'](_0xcaf4('0x11')):null;}if(_0x503353[_0xcaf4('0x14')]('closed')){_0x503353[_0xcaf4('0x13')]=moment()['format'](_0xcaf4('0x11'));_0x503353[_0xcaf4('0xe')]=null;_0x503353[_0xcaf4('0xf')]=null;}_0x41486c(null,_0x503353);},'afterUpdate':function(_0x1ec93e,_0x1380f9,_0x3bfcc5){var _0x4d2817=_0x21ad95[_0xcaf4('0x15')];var _0x488bac=_0x1ec93e[_0xcaf4('0x16')]({'plain':!![]});if(_0x488bac['closed']){return _0x4d2817[_0xcaf4('0x17')][_0xcaf4('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x488bac['id']}})[_0xcaf4('0x19')](function(){_0x3bfcc5();})['catch'](function(_0x585d18){_0x3bfcc5(_0x585d18);});}else{_0x3bfcc5();}}},'charset':_0xcaf4('0x1a'),'collate':_0xcaf4('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index c2f66b4..e98f5b1 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 _0xa1e8=['UpdateMailInteraction','MailInteraction','options','raw','where','attributes','AddTagsToMailInteraction','find','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa1e8,0x1af));var _0x8a1e=function(_0x18e7d7,_0xf62a49){_0x18e7d7=_0x18e7d7-0x0;var _0x3e538e=_0xa1e8[_0x18e7d7];return _0x3e538e;};'use strict';var _=require(_0x8a1e('0x0'));var util=require('util');var moment=require(_0x8a1e('0x1'));var BPromise=require(_0x8a1e('0x2'));var rs=require(_0x8a1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a1e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a1e('0x5'))(_0x8a1e('0x6'));var config=require(_0x8a1e('0x7'));var jayson=require(_0x8a1e('0x8'));var client=jayson['client'][_0x8a1e('0x9')]({'port':0x232a});config[_0x8a1e('0xa')]=_[_0x8a1e('0xb')](config[_0x8a1e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8a1e('0xc'))(new Redis(config[_0x8a1e('0xa')]));require(_0x8a1e('0xd'))['register'](socket);function respondWithRpcPromise(_0x31afa4,_0x5d3318,_0x413ef7){return new BPromise(function(_0xe9a595,_0x5aa5e5){return client['request'](_0x31afa4,_0x413ef7)[_0x8a1e('0xe')](function(_0x46cddc){logger[_0x8a1e('0xf')](_0x8a1e('0x10'),_0x5d3318,_0x8a1e('0x11'));logger[_0x8a1e('0x12')](_0x8a1e('0x13'),_0x5d3318,'request\x20sent',JSON[_0x8a1e('0x14')](_0x46cddc));if(_0x46cddc[_0x8a1e('0x15')]){if(_0x46cddc[_0x8a1e('0x15')]['code']===0x1f4){logger[_0x8a1e('0x15')](_0x8a1e('0x10'),_0x5d3318,_0x46cddc[_0x8a1e('0x15')]['message']);return _0x5aa5e5(_0x46cddc[_0x8a1e('0x15')][_0x8a1e('0x16')]);}logger[_0x8a1e('0x15')]('MailInteraction,\x20%s,\x20%s',_0x5d3318,_0x46cddc['error']['message']);return _0xe9a595(_0x46cddc[_0x8a1e('0x15')][_0x8a1e('0x16')]);}else{logger['info'](_0x8a1e('0x10'),_0x5d3318,_0x8a1e('0x11'));_0xe9a595(_0x46cddc[_0x8a1e('0x17')][_0x8a1e('0x16')]);}})[_0x8a1e('0x18')](function(_0x13670e){logger['error'](_0x8a1e('0x10'),_0x5d3318,_0x13670e);_0x5aa5e5(_0x13670e);});});}exports[_0x8a1e('0x19')]=function(_0x574c88){var _0x3d28f5=this;return new Promise(function(_0x34ef67,_0x2208a5){return db[_0x8a1e('0x1a')]['update'](_0x574c88['body'],{'raw':_0x574c88[_0x8a1e('0x1b')]?_0x574c88[_0x8a1e('0x1b')][_0x8a1e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x574c88[_0x8a1e('0x1b')]?_0x574c88[_0x8a1e('0x1b')][_0x8a1e('0x1d')]||null:null,'attributes':_0x574c88[_0x8a1e('0x1b')]?_0x574c88[_0x8a1e('0x1b')][_0x8a1e('0x1e')]||null:null,'limit':_0x574c88[_0x8a1e('0x1b')]?_0x574c88[_0x8a1e('0x1b')]['limit']||null:null})[_0x8a1e('0xe')](function(_0x2e0798){logger[_0x8a1e('0xf')]('UpdateMailInteraction',_0x574c88);logger[_0x8a1e('0x12')](_0x8a1e('0x19'),_0x574c88,JSON[_0x8a1e('0x14')](_0x2e0798));_0x34ef67(_0x2e0798);})[_0x8a1e('0x18')](function(_0x568dab){logger[_0x8a1e('0x15')](_0x8a1e('0x19'),_0x568dab[_0x8a1e('0x16')],_0x574c88);_0x2208a5(_0x3d28f5[_0x8a1e('0x15')](0x1f4,_0x568dab[_0x8a1e('0x16')]));});});};exports[_0x8a1e('0x1f')]=function(_0x4c7f91){return new Promise(function(_0x2b5210,_0x1289ac){return db[_0x8a1e('0x1a')][_0x8a1e('0x20')]({'where':_0x4c7f91[_0x8a1e('0x1b')]?_0x4c7f91['options']['where']||null:null})[_0x8a1e('0xe')](function(_0xf3fcc1){if(_0xf3fcc1){return _0xf3fcc1['addTags'](_0x4c7f91[_0x8a1e('0x21')][_0x8a1e('0x22')],_[_0x8a1e('0x23')](_0x4c7f91[_0x8a1e('0x21')],[_0x8a1e('0x22'),'id'])||{});}})[_0x8a1e('0x24')](function(_0x3e0c9d){logger['info'](_0x8a1e('0x25'),_0x4c7f91);logger[_0x8a1e('0x12')]('AddTags',_0x4c7f91,JSON['stringify'](_0x3e0c9d));_0x2b5210(_0x3e0c9d);})['catch'](function(_0x5b0bc0){logger[_0x8a1e('0x15')](_0x8a1e('0x25'),_0x5b0bc0[_0x8a1e('0x16')],_0x4c7f91);_0x1289ac(_this['error'](0x1f4,_0x5b0bc0[_0x8a1e('0x16')]));});});}; \ No newline at end of file +var _0xf151=['error','code','message','result','catch','MailInteraction','update','body','options','raw','where','limit','UpdateMailInteraction','debug','AddTagsToMailInteraction','omit','ids','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','redis','localhost','./mailInteraction.socket','then','info','MailInteraction,\x20%s,\x20%s','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3a4fdd,_0x228c1c){var _0x28ea81=function(_0x3af9fa){while(--_0x3af9fa){_0x3a4fdd['push'](_0x3a4fdd['shift']());}};_0x28ea81(++_0x228c1c);}(_0xf151,0xab));var _0x1f15=function(_0x1944d6,_0x59bc17){_0x1944d6=_0x1944d6-0x0;var _0x33cad4=_0xf151[_0x1944d6];return _0x33cad4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1f15('0x0'));var BPromise=require(_0x1f15('0x1'));var rs=require(_0x1f15('0x2'));var fs=require('fs');var Redis=require(_0x1f15('0x3'));var db=require(_0x1f15('0x4'))['db'];var utils=require(_0x1f15('0x5'));var logger=require(_0x1f15('0x6'))(_0x1f15('0x7'));var config=require('../../config/environment');var jayson=require(_0x1f15('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x1f15('0x9')](config[_0x1f15('0xa')],{'host':_0x1f15('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f15('0xa')]));require(_0x1f15('0xc'))['register'](socket);function respondWithRpcPromise(_0x4e6f42,_0x111a59,_0x2baa12){return new BPromise(function(_0x151020,_0x435cf2){return client['request'](_0x4e6f42,_0x2baa12)[_0x1f15('0xd')](function(_0x25d5f3){logger[_0x1f15('0xe')](_0x1f15('0xf'),_0x111a59,'request\x20sent');logger['debug'](_0x1f15('0x10'),_0x111a59,_0x1f15('0x11'),JSON[_0x1f15('0x12')](_0x25d5f3));if(_0x25d5f3[_0x1f15('0x13')]){if(_0x25d5f3[_0x1f15('0x13')][_0x1f15('0x14')]===0x1f4){logger['error'](_0x1f15('0xf'),_0x111a59,_0x25d5f3[_0x1f15('0x13')][_0x1f15('0x15')]);return _0x435cf2(_0x25d5f3[_0x1f15('0x13')]['message']);}logger[_0x1f15('0x13')]('MailInteraction,\x20%s,\x20%s',_0x111a59,_0x25d5f3[_0x1f15('0x13')][_0x1f15('0x15')]);return _0x151020(_0x25d5f3[_0x1f15('0x13')]['message']);}else{logger['info'](_0x1f15('0xf'),_0x111a59,_0x1f15('0x11'));_0x151020(_0x25d5f3[_0x1f15('0x16')]['message']);}})[_0x1f15('0x17')](function(_0x4c1b19){logger[_0x1f15('0x13')](_0x1f15('0xf'),_0x111a59,_0x4c1b19);_0x435cf2(_0x4c1b19);});});}exports['UpdateMailInteraction']=function(_0x566a61){var _0x274273=this;return new Promise(function(_0x5d2140,_0x4542a8){return db[_0x1f15('0x18')][_0x1f15('0x19')](_0x566a61[_0x1f15('0x1a')],{'raw':_0x566a61[_0x1f15('0x1b')]?_0x566a61[_0x1f15('0x1b')][_0x1f15('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x566a61['options']?_0x566a61['options'][_0x1f15('0x1d')]||null:null,'attributes':_0x566a61[_0x1f15('0x1b')]?_0x566a61['options']['attributes']||null:null,'limit':_0x566a61[_0x1f15('0x1b')]?_0x566a61[_0x1f15('0x1b')][_0x1f15('0x1e')]||null:null})['then'](function(_0x2409b4){logger[_0x1f15('0xe')](_0x1f15('0x1f'),_0x566a61);logger[_0x1f15('0x20')](_0x1f15('0x1f'),_0x566a61,JSON[_0x1f15('0x12')](_0x2409b4));_0x5d2140(_0x2409b4);})[_0x1f15('0x17')](function(_0x317bfc){logger[_0x1f15('0x13')]('UpdateMailInteraction',_0x317bfc[_0x1f15('0x15')],_0x566a61);_0x4542a8(_0x274273['error'](0x1f4,_0x317bfc[_0x1f15('0x15')]));});});};exports[_0x1f15('0x21')]=function(_0x5660e6){return new Promise(function(_0x9efb14,_0x610939){return db[_0x1f15('0x18')]['find']({'where':_0x5660e6[_0x1f15('0x1b')]?_0x5660e6[_0x1f15('0x1b')][_0x1f15('0x1d')]||null:null})['then'](function(_0x35bf35){if(_0x35bf35){return _0x35bf35['addTags'](_0x5660e6[_0x1f15('0x1a')]['ids'],_[_0x1f15('0x22')](_0x5660e6[_0x1f15('0x1a')],[_0x1f15('0x23'),'id'])||{});}})[_0x1f15('0x24')](function(_0x22fe81){logger[_0x1f15('0xe')](_0x1f15('0x25'),_0x5660e6);logger[_0x1f15('0x20')]('AddTags',_0x5660e6,JSON['stringify'](_0x22fe81));_0x9efb14(_0x22fe81);})[_0x1f15('0x17')](function(_0x438f12){logger[_0x1f15('0x13')](_0x1f15('0x25'),_0x438f12[_0x1f15('0x15')],_0x5660e6);_0x610939(_this[_0x1f15('0x13')](0x1f4,_0x438f12['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index fb16763..1c0c733 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 _0x066e=['mailInteraction:','save','emit','removeListener','register','length'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x066e,0x163));var _0xe066=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x066e[_0x40bffc];return _0x3007e9;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xe066('0x0'),'remove','update'];function createListener(_0x28489a,_0x16157b){return function(_0x24e2fe){_0x16157b[_0xe066('0x1')](_0x28489a,_0x24e2fe);};}function removeListener(_0x4359d6,_0x39cf49){return function(){MailInteractionEvents[_0xe066('0x2')](_0x4359d6,_0x39cf49);};}exports[_0xe066('0x3')]=function(_0x4e972c){for(var _0x406f0c=0x0,_0x1a3843=events[_0xe066('0x4')];_0x406f0c<_0x1a3843;_0x406f0c++){var _0x4ecad8=events[_0x406f0c];var _0x573037=createListener(_0xe066('0x5')+_0x4ecad8,_0x4e972c);MailInteractionEvents['on'](_0x4ecad8,_0x573037);}}; \ No newline at end of file +var _0xf98b=['mailInteraction:','./mailInteraction.events','remove','emit','removeListener','length'];(function(_0x4dbda8,_0xbce830){var _0x1149ed=function(_0x299a39){while(--_0x299a39){_0x4dbda8['push'](_0x4dbda8['shift']());}};_0x1149ed(++_0xbce830);}(_0xf98b,0x1c9));var _0xbf98=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xf98b[_0x55f8b4];return _0x2475f9;};'use strict';var MailInteractionEvents=require(_0xbf98('0x0'));var events=['save',_0xbf98('0x1'),'update'];function createListener(_0x402534,_0x3d8670){return function(_0x146f72){_0x3d8670[_0xbf98('0x2')](_0x402534,_0x146f72);};}function removeListener(_0x45196d,_0x17adf5){return function(){MailInteractionEvents[_0xbf98('0x3')](_0x45196d,_0x17adf5);};}exports['register']=function(_0x3e8a00){for(var _0x1e2354=0x0,_0x48b2e=events[_0xbf98('0x4')];_0x1e2354<_0x48b2e;_0x1e2354++){var _0x4324a7=events[_0x1e2354];var _0x2e6baa=createListener(_0xbf98('0x5')+_0x4324a7,_0x3e8a00);MailInteractionEvents['on'](_0x4324a7,_0x2e6baa);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 0169fc7..c2d00fb 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 _0xe5b3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','/:id/download','download','post','mail','create','put','update','/:id/accept','accept','reject','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x37d670,_0x2f76e0){var _0x238b2f=function(_0x40d77c){while(--_0x40d77c){_0x37d670['push'](_0x37d670['shift']());}};_0x238b2f(++_0x2f76e0);}(_0xe5b3,0x133));var _0x3e5b=function(_0x5b5a5f,_0x3e0da8){_0x5b5a5f=_0x5b5a5f-0x0;var _0x45d52c=_0xe5b3[_0x5b5a5f];return _0x45d52c;};'use strict';var multer=require('multer');var util=require(_0x3e5b('0x0'));var path=require(_0x3e5b('0x1'));var timeout=require(_0x3e5b('0x2'));var express=require(_0x3e5b('0x3'));var router=express[_0x3e5b('0x4')]();var auth=require(_0x3e5b('0x5'));var interaction=require(_0x3e5b('0x6'));var config=require(_0x3e5b('0x7'));var controller=require(_0x3e5b('0x8'));router[_0x3e5b('0x9')]('/',auth[_0x3e5b('0xa')](),controller['index']);router[_0x3e5b('0x9')](_0x3e5b('0xb'),auth['isAuthenticated'](),controller[_0x3e5b('0xc')]);router[_0x3e5b('0x9')](_0x3e5b('0xd'),auth[_0x3e5b('0xa')](),controller['show']);router['get'](_0x3e5b('0xe'),auth[_0x3e5b('0xa')](),controller[_0x3e5b('0xf')]);router[_0x3e5b('0x10')]('/',auth[_0x3e5b('0xa')](),interaction['tracked'](_0x3e5b('0x11'),'mailmessage:create'),controller[_0x3e5b('0x12')]);router[_0x3e5b('0x13')](_0x3e5b('0xd'),auth[_0x3e5b('0xa')](),controller[_0x3e5b('0x14')]);router[_0x3e5b('0x13')](_0x3e5b('0x15'),auth['isAuthenticated'](),controller[_0x3e5b('0x16')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x3e5b('0x17')]);router[_0x3e5b('0x18')](_0x3e5b('0xd'),auth['isAuthenticated'](),controller[_0x3e5b('0x19')]);module['exports']=router; \ No newline at end of file +var _0xe14d=['index','describe','/:id','show','/:id/download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0xe14d,0x1ee));var _0xde14=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xe14d[_0x55e08b];return _0xd1a7ff;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var auth=require(_0xde14('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xde14('0x6'));var controller=require(_0xde14('0x7'));router[_0xde14('0x8')]('/',auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router[_0xde14('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xde14('0xb')]);router[_0xde14('0x8')](_0xde14('0xc'),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router[_0xde14('0x8')](_0xde14('0xe'),auth[_0xde14('0x9')](),controller['download']);router[_0xde14('0xf')]('/',auth[_0xde14('0x9')](),interaction[_0xde14('0x10')](_0xde14('0x11'),_0xde14('0x12')),controller[_0xde14('0x13')]);router[_0xde14('0x14')](_0xde14('0xc'),auth[_0xde14('0x9')](),controller[_0xde14('0x15')]);router[_0xde14('0x14')](_0xde14('0x16'),auth[_0xde14('0x9')](),controller[_0xde14('0x17')]);router[_0xde14('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0xde14('0x18')]);router[_0xde14('0x19')](_0xde14('0xc'),auth['isAuthenticated'](),controller[_0xde14('0x1a')]);module[_0xde14('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 2698573..bdb019d 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 _0xa321=['TEXT','medium','ENUM','out','long','INTEGER','BOOLEAN','sequelize','lodash','exports'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xa321,0x9d));var _0x1a32=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xa321[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require(_0x1a32('0x0'));var _=require(_0x1a32('0x1'));module[_0x1a32('0x2')]={'body':{'type':Sequelize[_0x1a32('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x1a32('0x3')](_0x1a32('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1a32('0x5')]('in',_0x1a32('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x1a32('0x3')]('long')},'cc':{'type':Sequelize[_0x1a32('0x3')](_0x1a32('0x7'))},'bcc':{'type':Sequelize[_0x1a32('0x3')](_0x1a32('0x7'))},'subject':{'type':Sequelize[_0x1a32('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x1a32('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x1a32('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x1a32('0x3')](_0x1a32('0x7'))},'originCc':{'type':Sequelize[_0x1a32('0x3')](_0x1a32('0x7'))}}; \ No newline at end of file +var _0xf19c=['STRING','DATE','INTEGER','sequelize','lodash','exports','long','TEXT','BOOLEAN','ENUM','out'];(function(_0x4f096e,_0x30d3c3){var _0x4a33ce=function(_0x107ba6){while(--_0x107ba6){_0x4f096e['push'](_0x4f096e['shift']());}};_0x4a33ce(++_0x30d3c3);}(_0xf19c,0x10b));var _0xcf19=function(_0x5112fc,_0x16f44a){_0x5112fc=_0x5112fc-0x0;var _0x2dd464=_0xf19c[_0x5112fc];return _0x2dd464;};'use strict';var Sequelize=require(_0xcf19('0x0'));var _=require(_0xcf19('0x1'));module[_0xcf19('0x2')]={'body':{'type':Sequelize['TEXT'](_0xcf19('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xcf19('0x4')]('medium')},'read':{'type':Sequelize[_0xcf19('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcf19('0x6')]('in',_0xcf19('0x7')),'defaultValue':_0xcf19('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xcf19('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xcf19('0x4')](_0xcf19('0x3'))},'cc':{'type':Sequelize[_0xcf19('0x4')](_0xcf19('0x3'))},'bcc':{'type':Sequelize[_0xcf19('0x4')](_0xcf19('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xcf19('0x9')]},'attach':{'type':Sequelize[_0xcf19('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xcf19('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xcf19('0x9')]},'originTo':{'type':Sequelize[_0xcf19('0x4')](_0xcf19('0x3'))},'originCc':{'type':Sequelize[_0xcf19('0x4')](_0xcf19('0x3'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 7a24b8f..d126a0c 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 _0xb1ee=['request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','save','destroy','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','pick','merge','filter','options','where','MailMessage','includeAll','include','findAll','rows','show','length','update','body','find','describe','create','out','secret','split','MailAccount','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','basename','List','ListId','List\x20not\x20found','sendMail','messageId','format','stringify','mail-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','params','Contact','MailInteraction','MailInteractionId','read1stAt','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','acceptMessage','interface','channel','event','EventManager','acceptmessage','../../config/logger','reject','mail','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','SIP/%s','rejectmessage','unix','toString','server','files','tmp','message-%s.eml','from','bcc','createdAt','Attachments','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','build','writeFileSync','download','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','test','Sequelize','ValidationError','then','info','MailMessage,\x20%s,\x20%s'];(function(_0x401d08,_0x3afbb4){var _0x3a7297=function(_0x2f83a9){while(--_0x2f83a9){_0x401d08['push'](_0x401d08['shift']());}};_0x3a7297(++_0x3afbb4);}(_0xb1ee,0x12a));var _0xeb1e=function(_0x70fd53,_0x2a95a6){_0x70fd53=_0x70fd53-0x0;var _0x4b71c5=_0xb1ee[_0x70fd53];return _0x4b71c5;};'use strict';var pdf=require(_0xeb1e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xeb1e('0x1'));var zipdir=require(_0xeb1e('0x2'));var jsonpatch=require(_0xeb1e('0x3'));var rp=require(_0xeb1e('0x4'));var moment=require(_0xeb1e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xeb1e('0x6'));var util=require('util');var path=require(_0xeb1e('0x7'));var sox=require(_0xeb1e('0x8'));var csv=require(_0xeb1e('0x9'));var ejs=require(_0xeb1e('0xa'));var fs=require('fs');var _=require(_0xeb1e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xeb1e('0xc'));var deskjs=require(_0xeb1e('0xd'));var toCsv=require(_0xeb1e('0x9'));var querystring=require(_0xeb1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xeb1e('0xf'));var qs=require(_0xeb1e('0x10'));var as=require(_0xeb1e('0x11'));var hardwareService=require(_0xeb1e('0x12'));var logger=require('../../config/logger')(_0xeb1e('0x13'));var utils=require(_0xeb1e('0x14'));var config=require(_0xeb1e('0x15'));var db=require(_0xeb1e('0x16'))['db'];config[_0xeb1e('0x17')]=_[_0xeb1e('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xeb1e('0x19'))(new Redis(config[_0xeb1e('0x17')]));require(_0xeb1e('0x1a'))[_0xeb1e('0x1b')](socket);var jayson=require(_0xeb1e('0x1c'));var client=jayson[_0xeb1e('0x1d')]['http']({'port':0x232c});var client9003=jayson[_0xeb1e('0x1d')]['http']({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x5f0aa0,_0x25f27c,_0x44f466){if(_0x44f466){var _0x27b033=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27b033[_0xeb1e('0x1e')](_0x25f27c)){return _0x5f0aa0;}else{throw new db[(_0xeb1e('0x1f'))][(_0xeb1e('0x20'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5f0aa0;}}function respondWithRpcPromise(_0xffc8d,_0x3ed07f,_0x244f29,_0x261923){return new BPromise(function(_0x482966,_0x54d610){var _0x24291b=_0x261923||client;return _0x24291b['request'](_0xffc8d,_0x244f29)[_0xeb1e('0x21')](function(_0x243819){logger[_0xeb1e('0x22')](_0xeb1e('0x23'),_0x3ed07f,_0xeb1e('0x24'));logger[_0xeb1e('0x25')](_0xeb1e('0x26'),_0x3ed07f,_0xeb1e('0x24'),JSON['stringify'](_0x243819));if(_0x243819[_0xeb1e('0x27')]){if(_0x243819[_0xeb1e('0x27')]['code']===0x1f4){logger['error'](_0xeb1e('0x23'),_0x3ed07f,_0x243819[_0xeb1e('0x27')][_0xeb1e('0x28')]);return _0x54d610(_0x243819['error']['message']);}logger[_0xeb1e('0x27')]('MailMessage,\x20%s,\x20%s',_0x3ed07f,_0x243819[_0xeb1e('0x27')]['message']);return _0x482966(_0x243819[_0xeb1e('0x27')][_0xeb1e('0x28')]);}else{logger['info'](_0xeb1e('0x23'),_0x3ed07f,_0xeb1e('0x24'));_0x482966(_0x243819[_0xeb1e('0x29')]['message']);}})[_0xeb1e('0x2a')](function(_0x262644){logger[_0xeb1e('0x27')]('MailMessage,\x20%s,\x20%s',_0x3ed07f,_0x262644);_0x54d610(_0x262644);});});}function respondWithStatusCode(_0x4a7d5a,_0x1d63d7){_0x1d63d7=_0x1d63d7||0xcc;return function(_0x108c43){if(_0x108c43){return _0x4a7d5a[_0xeb1e('0x2b')](_0x1d63d7);}return _0x4a7d5a[_0xeb1e('0x2c')](_0x1d63d7)[_0xeb1e('0x2d')]();};}function respondWithResult(_0x2df837,_0x3a14e2){_0x3a14e2=_0x3a14e2||0xc8;return function(_0x2fad3b){if(_0x2fad3b){return _0x2df837['status'](_0x3a14e2)[_0xeb1e('0x2e')](_0x2fad3b);}};}function respondWithFilteredResult(_0x58f5bb,_0x18bba7){return function(_0x54fa7c){if(_0x54fa7c){var _0x32cb09=_0x54fa7c[_0xeb1e('0x2f')],_0x380755=_0x18bba7[_0xeb1e('0x30')],_0x3d8318=_0x18bba7[_0xeb1e('0x30')]+_0x18bba7['limit'],_0x339453;if(_0x3d8318>=_0x32cb09){_0x3d8318=_0x32cb09;_0x339453=0xc8;}else{_0x339453=0xce;}_0x58f5bb[_0xeb1e('0x2c')](_0x339453);return _0x58f5bb[_0xeb1e('0x31')](_0xeb1e('0x32'),_0x380755+'-'+_0x3d8318+'/'+_0x32cb09)[_0xeb1e('0x2e')](_0x54fa7c);}return null;};}function patchUpdates(_0x5ae8dd){return function(_0x15f2ee){try{jsonpatch['apply'](_0x15f2ee,_0x5ae8dd,!![]);}catch(_0x4b5cd8){return BPromise['reject'](_0x4b5cd8);}return _0x15f2ee[_0xeb1e('0x33')]();};}function saveUpdates(_0x17ac60,_0x466488){return function(_0x26bbc0){if(_0x26bbc0){return _0x26bbc0['update'](_0x17ac60)[_0xeb1e('0x21')](function(_0xe6cb50){return _0xe6cb50;});}return null;};}function removeEntity(_0x41a207,_0x4bd03f){return function(_0x4f3196){if(_0x4f3196){return _0x4f3196[_0xeb1e('0x34')]()[_0xeb1e('0x21')](function(){_0x41a207[_0xeb1e('0x2c')](0xcc)[_0xeb1e('0x2d')]();});}};}function handleEntityNotFound(_0x4114c7,_0x153299){return function(_0x18ca88){if(!_0x18ca88){_0x4114c7['sendStatus'](0x194);}return _0x18ca88;};}function handleError(_0x39ac99,_0x35db0c){_0x35db0c=_0x35db0c||0x1f4;return function(_0x124229){logger[_0xeb1e('0x27')](_0x124229[_0xeb1e('0x35')]);if(_0x124229[_0xeb1e('0x36')]){delete _0x124229[_0xeb1e('0x36')];}_0x39ac99[_0xeb1e('0x2c')](_0x35db0c)[_0xeb1e('0x37')](_0x124229);};}exports[_0xeb1e('0x38')]=function(_0xed135,_0x4c1c4c){var _0x1ba81c={},_0x56f955={},_0x5a8bf3={'count':0x0,'rows':[]};var _0x56d5e7=_[_0xeb1e('0x39')](db['MailMessage'][_0xeb1e('0x3a')],function(_0x3b0173){return{'name':_0x3b0173['fieldName'],'type':_0x3b0173[_0xeb1e('0x3b')][_0xeb1e('0x3c')]};});_0x56f955[_0xeb1e('0x3d')]=_[_0xeb1e('0x39')](_0x56d5e7,_0xeb1e('0x36'));_0x56f955[_0xeb1e('0x3e')]=_[_0xeb1e('0x3f')](_0xed135[_0xeb1e('0x3e')]);_0x56f955[_0xeb1e('0x40')]=_[_0xeb1e('0x41')](_0x56f955['model'],_0x56f955[_0xeb1e('0x3e')]);_0x1ba81c[_0xeb1e('0x42')]=_[_0xeb1e('0x41')](_0x56f955['model'],qs['fields'](_0xed135['query'][_0xeb1e('0x43')]));_0x1ba81c[_0xeb1e('0x42')]=_0x1ba81c['attributes']['length']?_0x1ba81c[_0xeb1e('0x42')]:_0x56f955['model'];if(!_0xed135[_0xeb1e('0x3e')]['hasOwnProperty'](_0xeb1e('0x44'))){_0x1ba81c['limit']=qs[_0xeb1e('0x45')](_0xed135[_0xeb1e('0x3e')][_0xeb1e('0x45')]);_0x1ba81c['offset']=qs['offset'](_0xed135['query'][_0xeb1e('0x30')]);}_0x1ba81c[_0xeb1e('0x46')]=qs[_0xeb1e('0x47')](_0xed135['query'][_0xeb1e('0x47')]);_0x1ba81c['where']=qs[_0xeb1e('0x40')](_[_0xeb1e('0x48')](_0xed135['query'],_0x56f955[_0xeb1e('0x40')]));if(_0xed135[_0xeb1e('0x3e')]['filter']){_0x1ba81c['where']=_[_0xeb1e('0x49')](_0x1ba81c['where'],{'$or':_[_0xeb1e('0x39')](_0x56d5e7,function(_0xe5b92d){if(_0xe5b92d[_0xeb1e('0x3b')]!=='VIRTUAL'){var _0x35e510={};_0x35e510[_0xe5b92d['name']]={'$like':'%'+_0xed135[_0xeb1e('0x3e')][_0xeb1e('0x4a')]+'%'};return _0x35e510;}})});}_0x1ba81c=_[_0xeb1e('0x49')]({},_0x1ba81c,_0xed135[_0xeb1e('0x4b')]);var _0x26996b={'where':_0x1ba81c[_0xeb1e('0x4c')]};return db[_0xeb1e('0x4d')]['count'](_0x26996b)[_0xeb1e('0x21')](function(_0x5e2a7e){_0x5a8bf3[_0xeb1e('0x2f')]=_0x5e2a7e;if(_0xed135[_0xeb1e('0x3e')][_0xeb1e('0x4e')]){_0x1ba81c[_0xeb1e('0x4f')]=[{'all':!![]}];}return db[_0xeb1e('0x4d')][_0xeb1e('0x50')](_0x1ba81c);})['then'](function(_0x1c6ecb){_0x5a8bf3[_0xeb1e('0x51')]=_0x1c6ecb;return _0x5a8bf3;})[_0xeb1e('0x21')](respondWithFilteredResult(_0x4c1c4c,_0x1ba81c))['catch'](handleError(_0x4c1c4c,null));};exports[_0xeb1e('0x52')]=function(_0x7c7283,_0x15cc33){var _0x3b896a={'raw':!![],'where':{'id':_0x7c7283['params']['id']}},_0x1fab2a={};_0x1fab2a[_0xeb1e('0x3d')]=_[_0xeb1e('0x3f')](db[_0xeb1e('0x4d')][_0xeb1e('0x3a')]);_0x1fab2a[_0xeb1e('0x3e')]=_[_0xeb1e('0x3f')](_0x7c7283[_0xeb1e('0x3e')]);_0x1fab2a[_0xeb1e('0x40')]=_[_0xeb1e('0x41')](_0x1fab2a['model'],_0x1fab2a[_0xeb1e('0x3e')]);_0x3b896a[_0xeb1e('0x42')]=_[_0xeb1e('0x41')](_0x1fab2a[_0xeb1e('0x3d')],qs[_0xeb1e('0x43')](_0x7c7283[_0xeb1e('0x3e')]['fields']));_0x3b896a[_0xeb1e('0x42')]=_0x3b896a[_0xeb1e('0x42')][_0xeb1e('0x53')]?_0x3b896a[_0xeb1e('0x42')]:_0x1fab2a['model'];if(_0x7c7283['query'][_0xeb1e('0x4e')]){_0x3b896a['include']=[{'all':!![]}];}_0x3b896a=_[_0xeb1e('0x49')]({},_0x3b896a,_0x7c7283[_0xeb1e('0x4b')]);return db['MailMessage']['find'](_0x3b896a)[_0xeb1e('0x21')](handleEntityNotFound(_0x15cc33,null))[_0xeb1e('0x21')](respondWithResult(_0x15cc33,null))[_0xeb1e('0x2a')](handleError(_0x15cc33,null));};exports[_0xeb1e('0x54')]=function(_0x46bd93,_0x1799f2){if(_0x46bd93[_0xeb1e('0x55')]['id']){delete _0x46bd93['body']['id'];}return db[_0xeb1e('0x4d')][_0xeb1e('0x56')]({'where':{'id':_0x46bd93['params']['id']}})['then'](handleEntityNotFound(_0x1799f2,null))[_0xeb1e('0x21')](saveUpdates(_0x46bd93[_0xeb1e('0x55')],null))[_0xeb1e('0x21')](respondWithResult(_0x1799f2,null))['catch'](handleError(_0x1799f2,null));};exports[_0xeb1e('0x34')]=function(_0x6468a0,_0x32b849){return db[_0xeb1e('0x4d')][_0xeb1e('0x56')]({'where':{'id':_0x6468a0['params']['id']}})[_0xeb1e('0x21')](handleEntityNotFound(_0x32b849,null))[_0xeb1e('0x21')](removeEntity(_0x32b849,null))['catch'](handleError(_0x32b849,null));};exports[_0xeb1e('0x57')]=function(_0x3ca24a,_0x288e0f){return db[_0xeb1e('0x4d')][_0xeb1e('0x57')]()['then'](respondWithResult(_0x288e0f,null))['catch'](handleError(_0x288e0f,null));};exports[_0xeb1e('0x58')]=function(_0x420310,_0x2e84f0){return db['MailMessage'][_0xeb1e('0x58')](_0x420310['body'])[_0xeb1e('0x21')](function(_0x2d58da){if(_0x2d58da){if(_0x2d58da['direction']===_0xeb1e('0x59')&&!_0x2d58da[_0xeb1e('0x5a')]){var _0x201907,_0x1773e0,_0x174c67;if(_0x420310['body']['to']){_0x1773e0=_0x420310[_0xeb1e('0x55')]['to'][_0xeb1e('0x5b')](',')[0x0];}return db[_0xeb1e('0x5c')]['findOne']({'where':{'id':_0x2d58da[_0xeb1e('0x5d')]},'include':[{'model':db[_0xeb1e('0x5e')],'as':'List','include':[{'model':db[_0xeb1e('0x5f')],'as':_0xeb1e('0x60'),'where':{'email':_0x1773e0},'limit':0x1,'order':[[_0xeb1e('0x61'),_0xeb1e('0x62')]]}]},{'model':db[_0xeb1e('0x63')],'as':_0xeb1e('0x64'),'raw':!![]}]})[_0xeb1e('0x21')](function(_0x46bc93){_0x201907=_0x46bc93;if(_0x201907&&_0x201907[_0xeb1e('0x64')]){var _0x57ab1c={'tls':{'rejectUnauthorized':![]}};if(_[_0xeb1e('0x65')](_0x201907[_0xeb1e('0x64')][_0xeb1e('0x66')])){_0x57ab1c[_0xeb1e('0x67')]=_0x201907[_0xeb1e('0x64')][_0xeb1e('0x67')];_0x57ab1c[_0xeb1e('0x68')]=_0x201907[_0xeb1e('0x64')][_0xeb1e('0x68')];_0x57ab1c[_0xeb1e('0x69')]=_0x201907['Smtp'][_0xeb1e('0x69')];if(_0x201907[_0xeb1e('0x64')][_0xeb1e('0x6a')]){_0x57ab1c[_0xeb1e('0x6b')]={'user':_0x201907[_0xeb1e('0x64')][_0xeb1e('0x6c')],'pass':_0x201907[_0xeb1e('0x64')][_0xeb1e('0x6d')]};}}else{_0x57ab1c[_0xeb1e('0x66')]=_0x201907[_0xeb1e('0x64')]['service'];_0x57ab1c[_0xeb1e('0x6b')]={'user':_0x201907[_0xeb1e('0x64')]['user'],'pass':_0x201907[_0xeb1e('0x64')][_0xeb1e('0x6d')]};_0x57ab1c['secure']=_0x201907[_0xeb1e('0x64')]['secure'];}if(_0x420310[_0xeb1e('0x55')][_0xeb1e('0x6e')]&&_0x420310[_0xeb1e('0x55')]['attachments'][_0xeb1e('0x53')]){for(var _0x6d4b7e=0x0;_0x6d4b7e<_0x420310['body']['attachments'][_0xeb1e('0x53')];_0x6d4b7e+=0x1){_0x420310[_0xeb1e('0x55')][_0xeb1e('0x6e')][_0x6d4b7e]={'filename':_0x420310[_0xeb1e('0x55')][_0xeb1e('0x6e')][_0x6d4b7e]['name'],'path':path[_0xeb1e('0x6f')](config[_0xeb1e('0x70')],'server/files/attachments',_0x420310[_0xeb1e('0x55')][_0xeb1e('0x6e')][_0x6d4b7e][_0xeb1e('0x71')])};}}_0x174c67={'account':_0x57ab1c,'message':_0x420310['body']};return;}})['then'](function(){if(_0x201907[_0xeb1e('0x72')]){if(_0x201907['List'][_0xeb1e('0x60')]['length']){return _0x201907[_0xeb1e('0x72')][_0xeb1e('0x60')][0x0];}else{return db[_0xeb1e('0x5f')][_0xeb1e('0x58')](_[_0xeb1e('0x18')](_0x420310[_0xeb1e('0x55')],{'firstName':_0x420310['body']['to'],'email':_0x420310[_0xeb1e('0x55')]['to'],'phone':_0x420310[_0xeb1e('0x55')]['to'],'ListId':_0x201907[_0xeb1e('0x73')]}));}}else{throw new Error(_0xeb1e('0x74'));}})[_0xeb1e('0x21')](function(){if(_0x174c67){return respondWithRpcPromise('SendMail',_0xeb1e('0x75'),_0x174c67,client9003)['then'](function(_0x50b91b){return _0x2d58da['update']({'read':!![],'messageId':_0x50b91b[_0xeb1e('0x76')],'sentAt':moment()[_0xeb1e('0x77')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xeb1e('0x2a')](function(_0x1f079f){logger[_0xeb1e('0x27')]('%s',JSON[_0xeb1e('0x78')](_0x1f079f));return _0x2d58da;});}return _0x2d58da;});}return _0x2d58da;}})['then'](respondWithResult(_0x2e84f0,0xc9))[_0xeb1e('0x2a')](handleError(_0x2e84f0,null));};var interaction_log=require('../../config/logger')(_0xeb1e('0x79'));exports[_0xeb1e('0x7a')]=function(_0x59b548,_0x3577e2,_0xeafdbf){var _0x144dfd={'channel':'mail'};if(_0x59b548['body']['id']){delete _0x59b548['body']['id'];}_0x59b548['body']['read']=!![];_0x59b548['body'][_0xeb1e('0x7b')]=moment()[_0xeb1e('0x77')](_0xeb1e('0x7c'));_0x59b548[_0xeb1e('0x55')][_0xeb1e('0x7d')]=_0x59b548['body']['UserId']||_0x59b548[_0xeb1e('0x6c')]['id'];return db[_0xeb1e('0x4d')][_0xeb1e('0x56')]({'where':{'id':_0x59b548[_0xeb1e('0x7e')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xeb1e('0x7f')}]})[_0xeb1e('0x21')](handleEntityNotFound(_0x3577e2,null))[_0xeb1e('0x21')](saveUpdates(_0x59b548['body'],null))[_0xeb1e('0x21')](function(_0x440f34){if(_0x440f34){_0x144dfd[_0xeb1e('0x28')]=_0x440f34['get']({'plain':!![]});return db[_0xeb1e('0x80')][_0xeb1e('0x56')]({'where':{'id':_0x440f34[_0xeb1e('0x81')]}});}return null;})['then'](handleEntityNotFound(_0x3577e2,null))[_0xeb1e('0x21')](function(_0x3c9e6e){if(_0x3c9e6e){return _0x3c9e6e['update']({'UserId':_0x59b548[_0xeb1e('0x55')][_0xeb1e('0x7d')],'read1stAt':_[_0xeb1e('0x65')](_0x3c9e6e[_0xeb1e('0x82')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xeb1e('0x21')](function(_0x290574){if(_0x290574){_0x144dfd['interaction']=_0x290574[_0xeb1e('0x83')]({'plain':!![]});interaction_log['info'](_0xeb1e('0x84'),_0x59b548[_0xeb1e('0x6c')]['id'],_0x59b548[_0xeb1e('0x6c')][_0xeb1e('0x36')],_0x59b548[_0xeb1e('0x6c')]['role'],_0x144dfd[_0xeb1e('0x85')]['id'],_0x59b548['body']?JSON['stringify'](_0x59b548[_0xeb1e('0x55')]):_0xeb1e('0x86'));return respondWithRpcPromise('AcceptMessage',_0xeb1e('0x87'),_0x144dfd);}return null;})[_0xeb1e('0x21')](function(_0x178faf){if(_0x178faf){if(_0x59b548[_0xeb1e('0x55')]['manual']){_0x144dfd['message'][_0xeb1e('0x88')]=util[_0xeb1e('0x77')]('SIP/%s',_0x59b548[_0xeb1e('0x6c')][_0xeb1e('0x36')]);_0x144dfd['message']['channel']=_0x144dfd[_0xeb1e('0x89')];_0x144dfd[_0xeb1e('0x28')][_0xeb1e('0x8a')]=_0xeb1e('0x7a');return respondWithRpcPromise(_0xeb1e('0x8b'),'EventManager',{'event':_0xeb1e('0x8c'),'message':_0x144dfd[_0xeb1e('0x28')]},client9002)['then'](function(){return _0x144dfd;});}return _0x144dfd;}return null;})[_0xeb1e('0x21')](respondWithResult(_0x3577e2,null))[_0xeb1e('0x2a')](handleError(_0x3577e2,null));};var interaction_log=require(_0xeb1e('0x8d'))(_0xeb1e('0x79'));exports[_0xeb1e('0x8e')]=function(_0x5269f,_0x329199,_0x5c08f3){var _0xf9e60f={'agent':{},'channel':_0xeb1e('0x8f')};if(_0x5269f[_0xeb1e('0x55')]['id']){delete _0x5269f['body']['id'];}_0x5269f[_0xeb1e('0x55')]['UserId']=_0x5269f[_0xeb1e('0x55')][_0xeb1e('0x7d')]||_0x5269f[_0xeb1e('0x6c')]['id'];_0xf9e60f[_0xeb1e('0x90')]['id']=_0x5269f[_0xeb1e('0x55')][_0xeb1e('0x7d')];return db[_0xeb1e('0x4d')]['find']({'where':{'id':_0x5269f[_0xeb1e('0x7e')]['id'],'UserId':null}})[_0xeb1e('0x21')](handleEntityNotFound(_0x329199,null))[_0xeb1e('0x21')](function(_0xbf3291){if(_0xbf3291){_0xf9e60f['message']=_0xbf3291[_0xeb1e('0x83')]({'plain':!![]});return db[_0xeb1e('0x80')][_0xeb1e('0x56')]({'where':{'id':_0xbf3291[_0xeb1e('0x81')]}});}return null;})[_0xeb1e('0x21')](handleEntityNotFound(_0x329199,null))['then'](function(_0x59519d){if(_0x59519d){_0xf9e60f[_0xeb1e('0x85')]=_0x59519d['get']({'plain':!![]});interaction_log[_0xeb1e('0x22')](_0xeb1e('0x91'),_0x5269f[_0xeb1e('0x6c')]['id'],_0x5269f[_0xeb1e('0x6c')][_0xeb1e('0x36')],_0x5269f[_0xeb1e('0x6c')][_0xeb1e('0x92')],_0xf9e60f[_0xeb1e('0x85')]['id'],_0x5269f[_0xeb1e('0x55')]?JSON[_0xeb1e('0x78')](_0x5269f[_0xeb1e('0x55')]):_0xeb1e('0x86'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0xf9e60f);}return null;})[_0xeb1e('0x21')](function(_0x4b569c){if(_0x4b569c){_0x4b569c[_0xeb1e('0x28')][_0xeb1e('0x88')]=util['format'](_0xeb1e('0x93'),_0x5269f[_0xeb1e('0x6c')][_0xeb1e('0x36')]);_0x4b569c[_0xeb1e('0x28')][_0xeb1e('0x89')]=_0xf9e60f['channel'];_0x4b569c[_0xeb1e('0x28')][_0xeb1e('0x8a')]=_0xeb1e('0x8e');respondWithRpcPromise(_0xeb1e('0x8b'),_0xeb1e('0x8b'),{'event':_0xeb1e('0x94'),'message':_0x4b569c['message']},client9002);return _0xf9e60f;}return null;})[_0xeb1e('0x21')](respondWithResult(_0x329199,null))[_0xeb1e('0x2a')](handleError(_0x329199,null));};exports['download']=function(_0x484fff,_0x86663a){var _0x437eec=moment()[_0xeb1e('0x95')]()[_0xeb1e('0x96')]();var _0x1c5ca4=path[_0xeb1e('0x6f')](config['root'],_0xeb1e('0x97'),_0xeb1e('0x98'),_0xeb1e('0x99'));var _0x3a855c=path[_0xeb1e('0x6f')](config[_0xeb1e('0x70')],_0xeb1e('0x97'),_0xeb1e('0x98'),_0xeb1e('0x6e'));var _0x3cfca6=util[_0xeb1e('0x77')](_0xeb1e('0x9a'),_0x437eec);return db[_0xeb1e('0x4d')]['find']({'where':{'id':_0x484fff[_0xeb1e('0x7e')]['id']},'attributes':['id','body',_0xeb1e('0x9b'),'to','cc',_0xeb1e('0x9c'),'subject',_0xeb1e('0x9d')],'include':_0x484fff[_0xeb1e('0x3e')]['attachments']?[{'model':db['Attachment'],'as':_0xeb1e('0x9e')}]:undefined})['then'](handleEntityNotFound(_0x86663a,null))[_0xeb1e('0x21')](function(_0x38d928){if(_0x38d928){var _0x4483d8=_0x38d928;var _0x129844={'from':_0x4483d8['from'],'to':_0x4483d8['to'],'subject':_0x4483d8[_0xeb1e('0x9f')],'html':_0x4483d8[_0xeb1e('0x55')],'headers':{'Date':moment(_0x4483d8[_0xeb1e('0x9d')])[_0xeb1e('0x77')](_0xeb1e('0xa0'))},'attachments':[]};if(_0x38d928['cc']){_0x129844[_0xeb1e('0xa1')]['Cc']=_0x38d928['cc'];}if(_0x38d928[_0xeb1e('0x9c')]){_0x129844['headers']['Bcc']=_0x38d928[_0xeb1e('0x9c')];}return new BPromise(function(_0x485510,_0xf6ad97){if(_0x38d928[_0xeb1e('0x9e')]){for(var _0x2b3798=0x0;_0x2b3798<_0x38d928[_0xeb1e('0x9e')][_0xeb1e('0x53')];_0x2b3798++){var _0x53a4a4=_0x38d928[_0xeb1e('0x9e')][_0x2b3798];var _0x1e8dac=path[_0xeb1e('0x6f')](_0x3a855c,_0x53a4a4[_0xeb1e('0x71')]);if(fs['existsSync'](_0x1e8dac)){_0x129844['attachments']['push']({'name':_0x53a4a4[_0xeb1e('0x36')],'contentType':_0x53a4a4[_0xeb1e('0x3b')],'data':fs['readFileSync'](_0x1e8dac)});}}}emlformat[_0xeb1e('0xa2')](_0x129844,function(_0x407b04,_0x122b4e){if(_0x407b04)return _0xf6ad97(_0x407b04);fs[_0xeb1e('0xa3')](path[_0xeb1e('0x6f')](_0x1c5ca4,_0x3cfca6),_0x122b4e);return _0x485510(_0x122b4e);});});}})[_0xeb1e('0x21')](function(_0x4f46ae){if(_0x4f46ae){return _0x86663a[_0xeb1e('0xa4')](path[_0xeb1e('0x6f')](_0x1c5ca4,_0x3cfca6),_0x3cfca6,function(_0x7af403){if(_0x7af403){console['log'](_0xeb1e('0xa5'),_0x7af403);}else{fs[_0xeb1e('0xa6')](path[_0xeb1e('0x6f')](_0x1c5ca4,_0x3cfca6));}});}})[_0xeb1e('0x2a')](handleError(_0x86663a,null));}; \ No newline at end of file +var _0xf56c=['test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','info','result','catch','end','status','count','offset','limit','Content-Range','json','apply','save','update','destroy','sendStatus','name','send','map','MailMessage','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','show','params','keys','include','body','find','describe','create','direction','out','secret','findOne','MailAccountId','CmList','List','CmContact','Contacts','DESC','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','get','MailInteraction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','AcceptMessage','SIP/%s','channel','event','EventManager','acceptmessage','mail-interactions','reject','agent','MailInteractionId','role','null','rejectMessage','interface','rejectmessage','unix','toString','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachment','headers','bcc','Bcc','Attachments','existsSync','push','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','http','client'];(function(_0x1c758f,_0x41bc55){var _0x2c54ba=function(_0x4d9891){while(--_0x4d9891){_0x1c758f['push'](_0x1c758f['shift']());}};_0x2c54ba(++_0x41bc55);}(_0xf56c,0x13b));var _0xcf56=function(_0x399814,_0x5066c7){_0x399814=_0x399814-0x0;var _0x1e3449=_0xf56c[_0x399814];return _0x1e3449;};'use strict';var pdf=require(_0xcf56('0x0'));var emlformat=require(_0xcf56('0x1'));var rimraf=require(_0xcf56('0x2'));var zipdir=require(_0xcf56('0x3'));var jsonpatch=require(_0xcf56('0x4'));var rp=require(_0xcf56('0x5'));var moment=require(_0xcf56('0x6'));var BPromise=require(_0xcf56('0x7'));var Mustache=require(_0xcf56('0x8'));var util=require(_0xcf56('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0xcf56('0xa'));var ejs=require(_0xcf56('0xb'));var fs=require('fs');var _=require(_0xcf56('0xc'));var squel=require('squel');var crypto=require(_0xcf56('0xd'));var jsforce=require(_0xcf56('0xe'));var deskjs=require(_0xcf56('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcf56('0x10'));var Papa=require(_0xcf56('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf56('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf56('0x13'));var logger=require(_0xcf56('0x14'))(_0xcf56('0x15'));var utils=require(_0xcf56('0x16'));var config=require(_0xcf56('0x17'));var db=require(_0xcf56('0x18'))['db'];config[_0xcf56('0x19')]=_['defaults'](config['redis'],{'host':_0xcf56('0x1a'),'port':0x18eb});var socket=require(_0xcf56('0x1b'))(new Redis(config[_0xcf56('0x19')]));require(_0xcf56('0x1c'))[_0xcf56('0x1d')](socket);var jayson=require(_0xcf56('0x1e'));var client=jayson['client'][_0xcf56('0x1f')]({'port':0x232c});var client9003=jayson[_0xcf56('0x20')][_0xcf56('0x1f')]({'port':0x232b});var client9002=jayson[_0xcf56('0x20')]['http']({'port':0x232a});function checkPasswordPattern(_0x474a03,_0x9e181f,_0x29e5ff){if(_0x29e5ff){var _0x320cb9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x320cb9[_0xcf56('0x21')](_0x9e181f)){return _0x474a03;}else{throw new db[(_0xcf56('0x22'))][(_0xcf56('0x23'))](_0xcf56('0x24'));}}else{return _0x474a03;}}function respondWithRpcPromise(_0x22b936,_0x2aa812,_0x171e01,_0x3445b8){return new BPromise(function(_0x57eabf,_0xd7a5){var _0x4af33e=_0x3445b8||client;return _0x4af33e[_0xcf56('0x25')](_0x22b936,_0x171e01)[_0xcf56('0x26')](function(_0x500735){logger['info']('MailMessage,\x20%s,\x20%s',_0x2aa812,_0xcf56('0x27'));logger[_0xcf56('0x28')](_0xcf56('0x29'),_0x2aa812,'request\x20sent',JSON[_0xcf56('0x2a')](_0x500735));if(_0x500735[_0xcf56('0x2b')]){if(_0x500735[_0xcf56('0x2b')]['code']===0x1f4){logger[_0xcf56('0x2b')](_0xcf56('0x2c'),_0x2aa812,_0x500735[_0xcf56('0x2b')][_0xcf56('0x2d')]);return _0xd7a5(_0x500735['error'][_0xcf56('0x2d')]);}logger[_0xcf56('0x2b')]('MailMessage,\x20%s,\x20%s',_0x2aa812,_0x500735['error'][_0xcf56('0x2d')]);return _0x57eabf(_0x500735['error']['message']);}else{logger[_0xcf56('0x2e')]('MailMessage,\x20%s,\x20%s',_0x2aa812,_0xcf56('0x27'));_0x57eabf(_0x500735[_0xcf56('0x2f')][_0xcf56('0x2d')]);}})[_0xcf56('0x30')](function(_0x117171){logger['error'](_0xcf56('0x2c'),_0x2aa812,_0x117171);_0xd7a5(_0x117171);});});}function respondWithStatusCode(_0x55f37e,_0x1dc337){_0x1dc337=_0x1dc337||0xcc;return function(_0x1d2807){if(_0x1d2807){return _0x55f37e['sendStatus'](_0x1dc337);}return _0x55f37e['status'](_0x1dc337)[_0xcf56('0x31')]();};}function respondWithResult(_0x11049c,_0x37d77d){_0x37d77d=_0x37d77d||0xc8;return function(_0x4b1b61){if(_0x4b1b61){return _0x11049c[_0xcf56('0x32')](_0x37d77d)['json'](_0x4b1b61);}};}function respondWithFilteredResult(_0x4eb070,_0x57e4b6){return function(_0x747eaa){if(_0x747eaa){var _0x56c06c=_0x747eaa[_0xcf56('0x33')],_0x2645f6=_0x57e4b6[_0xcf56('0x34')],_0x3290e5=_0x57e4b6[_0xcf56('0x34')]+_0x57e4b6[_0xcf56('0x35')],_0x1e10ae;if(_0x3290e5>=_0x56c06c){_0x3290e5=_0x56c06c;_0x1e10ae=0xc8;}else{_0x1e10ae=0xce;}_0x4eb070[_0xcf56('0x32')](_0x1e10ae);return _0x4eb070['set'](_0xcf56('0x36'),_0x2645f6+'-'+_0x3290e5+'/'+_0x56c06c)[_0xcf56('0x37')](_0x747eaa);}return null;};}function patchUpdates(_0x95a92e){return function(_0x5167a2){try{jsonpatch[_0xcf56('0x38')](_0x5167a2,_0x95a92e,!![]);}catch(_0x3f623b){return BPromise['reject'](_0x3f623b);}return _0x5167a2[_0xcf56('0x39')]();};}function saveUpdates(_0x7b58b7,_0x287792){return function(_0x33831f){if(_0x33831f){return _0x33831f[_0xcf56('0x3a')](_0x7b58b7)['then'](function(_0xc29415){return _0xc29415;});}return null;};}function removeEntity(_0x107b22,_0x5af886){return function(_0x160934){if(_0x160934){return _0x160934[_0xcf56('0x3b')]()['then'](function(){_0x107b22[_0xcf56('0x32')](0xcc)[_0xcf56('0x31')]();});}};}function handleEntityNotFound(_0x29a4db,_0x23b44b){return function(_0xd26a83){if(!_0xd26a83){_0x29a4db[_0xcf56('0x3c')](0x194);}return _0xd26a83;};}function handleError(_0x58b890,_0x18af49){_0x18af49=_0x18af49||0x1f4;return function(_0x29f328){logger[_0xcf56('0x2b')](_0x29f328['stack']);if(_0x29f328[_0xcf56('0x3d')]){delete _0x29f328['name'];}_0x58b890[_0xcf56('0x32')](_0x18af49)[_0xcf56('0x3e')](_0x29f328);};}exports['index']=function(_0x46dc31,_0x5f4838){var _0x5304bb={},_0x40b6e6={},_0x24fcee={'count':0x0,'rows':[]};var _0xf8379=_[_0xcf56('0x3f')](db[_0xcf56('0x40')][_0xcf56('0x41')],function(_0x5f5169){return{'name':_0x5f5169[_0xcf56('0x42')],'type':_0x5f5169[_0xcf56('0x43')][_0xcf56('0x44')]};});_0x40b6e6[_0xcf56('0x45')]=_['map'](_0xf8379,'name');_0x40b6e6['query']=_['keys'](_0x46dc31[_0xcf56('0x46')]);_0x40b6e6['filters']=_[_0xcf56('0x47')](_0x40b6e6[_0xcf56('0x45')],_0x40b6e6[_0xcf56('0x46')]);_0x5304bb[_0xcf56('0x48')]=_['intersection'](_0x40b6e6['model'],qs['fields'](_0x46dc31[_0xcf56('0x46')][_0xcf56('0x49')]));_0x5304bb[_0xcf56('0x48')]=_0x5304bb[_0xcf56('0x48')][_0xcf56('0x4a')]?_0x5304bb[_0xcf56('0x48')]:_0x40b6e6[_0xcf56('0x45')];if(!_0x46dc31['query'][_0xcf56('0x4b')](_0xcf56('0x4c'))){_0x5304bb[_0xcf56('0x35')]=qs[_0xcf56('0x35')](_0x46dc31['query']['limit']);_0x5304bb[_0xcf56('0x34')]=qs[_0xcf56('0x34')](_0x46dc31[_0xcf56('0x46')][_0xcf56('0x34')]);}_0x5304bb['order']=qs[_0xcf56('0x4d')](_0x46dc31['query'][_0xcf56('0x4d')]);_0x5304bb[_0xcf56('0x4e')]=qs[_0xcf56('0x4f')](_[_0xcf56('0x50')](_0x46dc31[_0xcf56('0x46')],_0x40b6e6[_0xcf56('0x4f')]));if(_0x46dc31['query'][_0xcf56('0x51')]){_0x5304bb[_0xcf56('0x4e')]=_[_0xcf56('0x52')](_0x5304bb[_0xcf56('0x4e')],{'$or':_[_0xcf56('0x3f')](_0xf8379,function(_0x42e5c7){if(_0x42e5c7[_0xcf56('0x43')]!=='VIRTUAL'){var _0x461986={};_0x461986[_0x42e5c7[_0xcf56('0x3d')]]={'$like':'%'+_0x46dc31['query'][_0xcf56('0x51')]+'%'};return _0x461986;}})});}_0x5304bb=_[_0xcf56('0x52')]({},_0x5304bb,_0x46dc31[_0xcf56('0x53')]);var _0x57505d={'where':_0x5304bb[_0xcf56('0x4e')]};return db[_0xcf56('0x40')][_0xcf56('0x33')](_0x57505d)[_0xcf56('0x26')](function(_0x21ca0a){_0x24fcee[_0xcf56('0x33')]=_0x21ca0a;if(_0x46dc31[_0xcf56('0x46')][_0xcf56('0x54')]){_0x5304bb['include']=[{'all':!![]}];}return db[_0xcf56('0x40')][_0xcf56('0x55')](_0x5304bb);})['then'](function(_0x28e4ef){_0x24fcee[_0xcf56('0x56')]=_0x28e4ef;return _0x24fcee;})[_0xcf56('0x26')](respondWithFilteredResult(_0x5f4838,_0x5304bb))[_0xcf56('0x30')](handleError(_0x5f4838,null));};exports[_0xcf56('0x57')]=function(_0x32f70d,_0x39afab){var _0x56c8f6={'raw':!![],'where':{'id':_0x32f70d[_0xcf56('0x58')]['id']}},_0x251fb2={};_0x251fb2[_0xcf56('0x45')]=_[_0xcf56('0x59')](db['MailMessage']['rawAttributes']);_0x251fb2['query']=_[_0xcf56('0x59')](_0x32f70d['query']);_0x251fb2[_0xcf56('0x4f')]=_[_0xcf56('0x47')](_0x251fb2[_0xcf56('0x45')],_0x251fb2[_0xcf56('0x46')]);_0x56c8f6[_0xcf56('0x48')]=_[_0xcf56('0x47')](_0x251fb2[_0xcf56('0x45')],qs['fields'](_0x32f70d[_0xcf56('0x46')][_0xcf56('0x49')]));_0x56c8f6['attributes']=_0x56c8f6[_0xcf56('0x48')][_0xcf56('0x4a')]?_0x56c8f6[_0xcf56('0x48')]:_0x251fb2[_0xcf56('0x45')];if(_0x32f70d[_0xcf56('0x46')][_0xcf56('0x54')]){_0x56c8f6[_0xcf56('0x5a')]=[{'all':!![]}];}_0x56c8f6=_[_0xcf56('0x52')]({},_0x56c8f6,_0x32f70d[_0xcf56('0x53')]);return db['MailMessage']['find'](_0x56c8f6)[_0xcf56('0x26')](handleEntityNotFound(_0x39afab,null))['then'](respondWithResult(_0x39afab,null))[_0xcf56('0x30')](handleError(_0x39afab,null));};exports[_0xcf56('0x3a')]=function(_0x305f67,_0x5ee842){if(_0x305f67[_0xcf56('0x5b')]['id']){delete _0x305f67[_0xcf56('0x5b')]['id'];}return db[_0xcf56('0x40')][_0xcf56('0x5c')]({'where':{'id':_0x305f67[_0xcf56('0x58')]['id']}})['then'](handleEntityNotFound(_0x5ee842,null))[_0xcf56('0x26')](saveUpdates(_0x305f67[_0xcf56('0x5b')],null))[_0xcf56('0x26')](respondWithResult(_0x5ee842,null))[_0xcf56('0x30')](handleError(_0x5ee842,null));};exports['destroy']=function(_0x2ffc41,_0x70f275){return db[_0xcf56('0x40')][_0xcf56('0x5c')]({'where':{'id':_0x2ffc41[_0xcf56('0x58')]['id']}})[_0xcf56('0x26')](handleEntityNotFound(_0x70f275,null))[_0xcf56('0x26')](removeEntity(_0x70f275,null))['catch'](handleError(_0x70f275,null));};exports[_0xcf56('0x5d')]=function(_0x3b19a2,_0x581d00){return db['MailMessage'][_0xcf56('0x5d')]()[_0xcf56('0x26')](respondWithResult(_0x581d00,null))[_0xcf56('0x30')](handleError(_0x581d00,null));};exports[_0xcf56('0x5e')]=function(_0x41c6d5,_0x60d3fe){return db[_0xcf56('0x40')][_0xcf56('0x5e')](_0x41c6d5['body'])[_0xcf56('0x26')](function(_0x3f3609){if(_0x3f3609){if(_0x3f3609[_0xcf56('0x5f')]===_0xcf56('0x60')&&!_0x3f3609[_0xcf56('0x61')]){var _0x3cf4cc,_0x1ccb9d,_0x689454;if(_0x41c6d5['body']['to']){_0x1ccb9d=_0x41c6d5[_0xcf56('0x5b')]['to']['split'](',')[0x0];}return db['MailAccount'][_0xcf56('0x62')]({'where':{'id':_0x3f3609[_0xcf56('0x63')]},'include':[{'model':db[_0xcf56('0x64')],'as':_0xcf56('0x65'),'include':[{'model':db[_0xcf56('0x66')],'as':_0xcf56('0x67'),'where':{'email':_0x1ccb9d},'limit':0x1,'order':[['updatedAt',_0xcf56('0x68')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xcf56('0x26')](function(_0x63dbe5){_0x3cf4cc=_0x63dbe5;if(_0x3cf4cc&&_0x3cf4cc[_0xcf56('0x69')]){var _0x330228={'tls':{'rejectUnauthorized':![]}};if(_[_0xcf56('0x6a')](_0x3cf4cc['Smtp'][_0xcf56('0x6b')])){_0x330228[_0xcf56('0x6c')]=_0x3cf4cc[_0xcf56('0x69')]['host'];_0x330228[_0xcf56('0x6d')]=_0x3cf4cc[_0xcf56('0x69')][_0xcf56('0x6d')];_0x330228[_0xcf56('0x6e')]=_0x3cf4cc['Smtp'][_0xcf56('0x6e')];if(_0x3cf4cc[_0xcf56('0x69')][_0xcf56('0x6f')]){_0x330228[_0xcf56('0x70')]={'user':_0x3cf4cc[_0xcf56('0x69')][_0xcf56('0x71')],'pass':_0x3cf4cc['Smtp'][_0xcf56('0x72')]};}}else{_0x330228[_0xcf56('0x6b')]=_0x3cf4cc['Smtp']['service'];_0x330228[_0xcf56('0x70')]={'user':_0x3cf4cc[_0xcf56('0x69')]['user'],'pass':_0x3cf4cc[_0xcf56('0x69')][_0xcf56('0x72')]};_0x330228[_0xcf56('0x6e')]=_0x3cf4cc[_0xcf56('0x69')][_0xcf56('0x6e')];}if(_0x41c6d5[_0xcf56('0x5b')]['attachments']&&_0x41c6d5['body'][_0xcf56('0x73')][_0xcf56('0x4a')]){for(var _0x443e20=0x0;_0x443e20<_0x41c6d5[_0xcf56('0x5b')][_0xcf56('0x73')][_0xcf56('0x4a')];_0x443e20+=0x1){_0x41c6d5[_0xcf56('0x5b')][_0xcf56('0x73')][_0x443e20]={'filename':_0x41c6d5[_0xcf56('0x5b')][_0xcf56('0x73')][_0x443e20][_0xcf56('0x3d')],'path':path[_0xcf56('0x74')](config[_0xcf56('0x75')],_0xcf56('0x76'),_0x41c6d5[_0xcf56('0x5b')][_0xcf56('0x73')][_0x443e20][_0xcf56('0x77')])};}}_0x689454={'account':_0x330228,'message':_0x41c6d5[_0xcf56('0x5b')]};return;}})[_0xcf56('0x26')](function(){if(_0x3cf4cc['List']){if(_0x3cf4cc[_0xcf56('0x65')][_0xcf56('0x67')][_0xcf56('0x4a')]){return _0x3cf4cc[_0xcf56('0x65')][_0xcf56('0x67')][0x0];}else{return db['CmContact']['create'](_[_0xcf56('0x78')](_0x41c6d5['body'],{'firstName':_0x41c6d5[_0xcf56('0x5b')]['to'],'email':_0x41c6d5[_0xcf56('0x5b')]['to'],'phone':_0x41c6d5[_0xcf56('0x5b')]['to'],'ListId':_0x3cf4cc[_0xcf56('0x79')]}));}}else{throw new Error(_0xcf56('0x7a'));}})[_0xcf56('0x26')](function(){if(_0x689454){return respondWithRpcPromise(_0xcf56('0x7b'),_0xcf56('0x7c'),_0x689454,client9003)[_0xcf56('0x26')](function(_0x27380b){return _0x3f3609['update']({'read':!![],'messageId':_0x27380b[_0xcf56('0x7d')],'sentAt':moment()[_0xcf56('0x7e')](_0xcf56('0x7f'))});})[_0xcf56('0x30')](function(_0x36d9ee){logger[_0xcf56('0x2b')]('%s',JSON[_0xcf56('0x2a')](_0x36d9ee));return _0x3f3609;});}return _0x3f3609;});}return _0x3f3609;}})[_0xcf56('0x26')](respondWithResult(_0x60d3fe,0xc9))[_0xcf56('0x30')](handleError(_0x60d3fe,null));};var interaction_log=require(_0xcf56('0x14'))('mail-interactions');exports['accept']=function(_0x53c1bd,_0x9bea14,_0x5c8e85){var _0xc8faf6={'channel':_0xcf56('0x80')};if(_0x53c1bd['body']['id']){delete _0x53c1bd[_0xcf56('0x5b')]['id'];}_0x53c1bd[_0xcf56('0x5b')][_0xcf56('0x81')]=!![];_0x53c1bd[_0xcf56('0x5b')][_0xcf56('0x82')]=moment()[_0xcf56('0x7e')](_0xcf56('0x7f'));_0x53c1bd['body'][_0xcf56('0x83')]=_0x53c1bd[_0xcf56('0x5b')][_0xcf56('0x83')]||_0x53c1bd['user']['id'];return db[_0xcf56('0x40')][_0xcf56('0x5c')]({'where':{'id':_0x53c1bd[_0xcf56('0x58')]['id'],'UserId':null},'include':[{'model':db[_0xcf56('0x66')],'as':'Contact'}]})[_0xcf56('0x26')](handleEntityNotFound(_0x9bea14,null))[_0xcf56('0x26')](saveUpdates(_0x53c1bd[_0xcf56('0x5b')],null))['then'](function(_0x274f53){if(_0x274f53){_0xc8faf6['message']=_0x274f53[_0xcf56('0x84')]({'plain':!![]});return db[_0xcf56('0x85')][_0xcf56('0x5c')]({'where':{'id':_0x274f53['MailInteractionId']}});}return null;})[_0xcf56('0x26')](handleEntityNotFound(_0x9bea14,null))[_0xcf56('0x26')](function(_0x531d34){if(_0x531d34){return _0x531d34['update']({'UserId':_0x53c1bd[_0xcf56('0x5b')][_0xcf56('0x83')],'read1stAt':_[_0xcf56('0x6a')](_0x531d34['read1stAt'])?moment()['format'](_0xcf56('0x7f')):undefined});}return null;})['then'](function(_0x1f0c47){if(_0x1f0c47){_0xc8faf6['interaction']=_0x1f0c47[_0xcf56('0x84')]({'plain':!![]});interaction_log[_0xcf56('0x2e')](_0xcf56('0x86'),_0x53c1bd[_0xcf56('0x71')]['id'],_0x53c1bd[_0xcf56('0x71')][_0xcf56('0x3d')],_0x53c1bd['user']['role'],_0xc8faf6[_0xcf56('0x87')]['id'],_0x53c1bd[_0xcf56('0x5b')]?JSON[_0xcf56('0x2a')](_0x53c1bd['body']):'null');return respondWithRpcPromise(_0xcf56('0x88'),'acceptMessage',_0xc8faf6);}return null;})[_0xcf56('0x26')](function(_0x2bf85c){if(_0x2bf85c){if(_0x53c1bd[_0xcf56('0x5b')]['manual']){_0xc8faf6[_0xcf56('0x2d')]['interface']=util[_0xcf56('0x7e')](_0xcf56('0x89'),_0x53c1bd['user'][_0xcf56('0x3d')]);_0xc8faf6['message']['channel']=_0xc8faf6[_0xcf56('0x8a')];_0xc8faf6[_0xcf56('0x2d')][_0xcf56('0x8b')]='accept';return respondWithRpcPromise('EventManager',_0xcf56('0x8c'),{'event':_0xcf56('0x8d'),'message':_0xc8faf6['message']},client9002)[_0xcf56('0x26')](function(){return _0xc8faf6;});}return _0xc8faf6;}return null;})['then'](respondWithResult(_0x9bea14,null))[_0xcf56('0x30')](handleError(_0x9bea14,null));};var interaction_log=require(_0xcf56('0x14'))(_0xcf56('0x8e'));exports[_0xcf56('0x8f')]=function(_0x3a8626,_0x2b0496,_0x2715b6){var _0x4c9d06={'agent':{},'channel':_0xcf56('0x80')};if(_0x3a8626[_0xcf56('0x5b')]['id']){delete _0x3a8626[_0xcf56('0x5b')]['id'];}_0x3a8626[_0xcf56('0x5b')][_0xcf56('0x83')]=_0x3a8626[_0xcf56('0x5b')][_0xcf56('0x83')]||_0x3a8626[_0xcf56('0x71')]['id'];_0x4c9d06[_0xcf56('0x90')]['id']=_0x3a8626['body'][_0xcf56('0x83')];return db[_0xcf56('0x40')][_0xcf56('0x5c')]({'where':{'id':_0x3a8626[_0xcf56('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2b0496,null))['then'](function(_0x22df5e){if(_0x22df5e){_0x4c9d06[_0xcf56('0x2d')]=_0x22df5e[_0xcf56('0x84')]({'plain':!![]});return db[_0xcf56('0x85')][_0xcf56('0x5c')]({'where':{'id':_0x22df5e[_0xcf56('0x91')]}});}return null;})[_0xcf56('0x26')](handleEntityNotFound(_0x2b0496,null))[_0xcf56('0x26')](function(_0x29b9ac){if(_0x29b9ac){_0x4c9d06[_0xcf56('0x87')]=_0x29b9ac['get']({'plain':!![]});interaction_log[_0xcf56('0x2e')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3a8626[_0xcf56('0x71')]['id'],_0x3a8626['user'][_0xcf56('0x3d')],_0x3a8626[_0xcf56('0x71')][_0xcf56('0x92')],_0x4c9d06[_0xcf56('0x87')]['id'],_0x3a8626['body']?JSON['stringify'](_0x3a8626[_0xcf56('0x5b')]):_0xcf56('0x93'));return respondWithRpcPromise('RejectMessage',_0xcf56('0x94'),_0x4c9d06);}return null;})[_0xcf56('0x26')](function(_0x52a314){if(_0x52a314){_0x52a314['message'][_0xcf56('0x95')]=util[_0xcf56('0x7e')]('SIP/%s',_0x3a8626[_0xcf56('0x71')]['name']);_0x52a314['message']['channel']=_0x4c9d06[_0xcf56('0x8a')];_0x52a314[_0xcf56('0x2d')][_0xcf56('0x8b')]='reject';respondWithRpcPromise(_0xcf56('0x8c'),'EventManager',{'event':_0xcf56('0x96'),'message':_0x52a314[_0xcf56('0x2d')]},client9002);return _0x4c9d06;}return null;})[_0xcf56('0x26')](respondWithResult(_0x2b0496,null))[_0xcf56('0x30')](handleError(_0x2b0496,null));};exports['download']=function(_0x5ceed4,_0x69ee3b){var _0xf32660=moment()[_0xcf56('0x97')]()[_0xcf56('0x98')]();var _0x24feda=path[_0xcf56('0x74')](config[_0xcf56('0x75')],_0xcf56('0x99'),_0xcf56('0x9a'),_0xcf56('0x9b'));var _0x32aeb9=path[_0xcf56('0x74')](config['root'],_0xcf56('0x99'),'files',_0xcf56('0x73'));var _0x15adae=util[_0xcf56('0x7e')](_0xcf56('0x9c'),_0xf32660);return db[_0xcf56('0x40')][_0xcf56('0x5c')]({'where':{'id':_0x5ceed4['params']['id']},'attributes':['id',_0xcf56('0x5b'),_0xcf56('0x9d'),'to','cc','bcc',_0xcf56('0x9e'),_0xcf56('0x9f')],'include':_0x5ceed4[_0xcf56('0x46')][_0xcf56('0x73')]?[{'model':db[_0xcf56('0xa0')],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x69ee3b,null))[_0xcf56('0x26')](function(_0x51b4b1){if(_0x51b4b1){var _0x1a3096=_0x51b4b1;var _0x125a69={'from':_0x1a3096[_0xcf56('0x9d')],'to':_0x1a3096['to'],'subject':_0x1a3096[_0xcf56('0x9e')],'html':_0x1a3096[_0xcf56('0x5b')],'headers':{'Date':moment(_0x1a3096[_0xcf56('0x9f')])[_0xcf56('0x7e')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x51b4b1['cc']){_0x125a69[_0xcf56('0xa1')]['Cc']=_0x51b4b1['cc'];}if(_0x51b4b1[_0xcf56('0xa2')]){_0x125a69[_0xcf56('0xa1')][_0xcf56('0xa3')]=_0x51b4b1[_0xcf56('0xa2')];}return new BPromise(function(_0x480466,_0x110053){if(_0x51b4b1[_0xcf56('0xa4')]){for(var _0x329028=0x0;_0x329028<_0x51b4b1[_0xcf56('0xa4')]['length'];_0x329028++){var _0x5ba369=_0x51b4b1[_0xcf56('0xa4')][_0x329028];var _0x329b0d=path['join'](_0x32aeb9,_0x5ba369[_0xcf56('0x77')]);if(fs[_0xcf56('0xa5')](_0x329b0d)){_0x125a69['attachments'][_0xcf56('0xa6')]({'name':_0x5ba369[_0xcf56('0x3d')],'contentType':_0x5ba369[_0xcf56('0x43')],'data':fs[_0xcf56('0xa7')](_0x329b0d)});}}}emlformat[_0xcf56('0xa8')](_0x125a69,function(_0x59105e,_0x52fc0a){if(_0x59105e)return _0x110053(_0x59105e);fs[_0xcf56('0xa9')](path[_0xcf56('0x74')](_0x24feda,_0x15adae),_0x52fc0a);return _0x480466(_0x52fc0a);});});}})[_0xcf56('0x26')](function(_0x246c26){if(_0x246c26){return _0x69ee3b[_0xcf56('0xaa')](path['join'](_0x24feda,_0x15adae),_0x15adae,function(_0x16a59a){if(_0x16a59a){console[_0xcf56('0xab')](_0xcf56('0xac'),_0x16a59a);}else{fs[_0xcf56('0xad')](path['join'](_0x24feda,_0x15adae));}});}})[_0xcf56('0x30')](handleError(_0x69ee3b,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 8f11085..f6a0256 100644 --- a/server/api/mailMessage/mailMessage.events.js +++ b/server/api/mailMessage/mailMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6ac=['exports','events','../../mysqldb','MailMessage','remove','emit','hasOwnProperty','hook'];(function(_0x262f0d,_0x51e151){var _0x21dc30=function(_0x49857c){while(--_0x49857c){_0x262f0d['push'](_0x262f0d['shift']());}};_0x21dc30(++_0x51e151);}(_0xb6ac,0x1d9));var _0xcb6a=function(_0x18d2ec,_0x358dae){_0x18d2ec=_0x18d2ec-0x0;var _0x4bc8b5=_0xb6ac[_0x18d2ec];return _0x4bc8b5;};'use strict';var EventEmitter=require(_0xcb6a('0x0'));var MailMessage=require(_0xcb6a('0x1'))['db'][_0xcb6a('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xcb6a('0x3')};function emitEvent(_0x54e94e){return function(_0xb4fc21,_0x5d8bd9,_0x2ccfbf){MailMessageEvents[_0xcb6a('0x4')](_0x54e94e+':'+_0xb4fc21['id'],_0xb4fc21);MailMessageEvents[_0xcb6a('0x4')](_0x54e94e,_0xb4fc21);_0x2ccfbf(null);};}for(var e in events){if(events[_0xcb6a('0x5')](e)){var event=events[e];MailMessage[_0xcb6a('0x6')](e,emitEvent(event));}}module[_0xcb6a('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x0c4f=['hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','emit'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0c4f,0x6f));var _0xf0c4=function(_0x106214,_0x454b8d){_0x106214=_0x106214-0x0;var _0x5f5cea=_0x0c4f[_0x106214];return _0x5f5cea;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xf0c4('0x0'))['db'][_0xf0c4('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xf0c4('0x2')](0x0);var events={'afterCreate':_0xf0c4('0x3'),'afterUpdate':_0xf0c4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2958d7){return function(_0x26ebe7,_0x94bd1b,_0x413a7a){MailMessageEvents[_0xf0c4('0x5')](_0x2958d7+':'+_0x26ebe7['id'],_0x26ebe7);MailMessageEvents[_0xf0c4('0x5')](_0x2958d7,_0x26ebe7);_0x413a7a(null);};}for(var e in events){if(events[_0xf0c4('0x6')](e)){var event=events[e];MailMessage[_0xf0c4('0x7')](e,emitEvent(event));}}module[_0xf0c4('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 42cf4d4..3b37400 100644 --- a/server/api/mailMessage/mailMessage.model.js +++ b/server/api/mailMessage/mailMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe4c7=['out','secret','isNil','UserId','MailInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','models','get','direction','toLowerCase'];(function(_0x407e8f,_0x458dad){var _0x402acd=function(_0x862ca6){while(--_0x862ca6){_0x407e8f['push'](_0x407e8f['shift']());}};_0x402acd(++_0x458dad);}(_0xe4c7,0xc1));var _0x7e4c=function(_0x5c264f,_0x571dfa){_0x5c264f=_0x5c264f-0x0;var _0x57455c=_0xe4c7[_0x5c264f];return _0x57455c;};'use strict';var _=require(_0x7e4c('0x0'));var util=require('util');var logger=require(_0x7e4c('0x1'))(_0x7e4c('0x2'));var moment=require(_0x7e4c('0x3'));var BPromise=require(_0x7e4c('0x4'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x7e4c('0x5'));var rimraf=require(_0x7e4c('0x6'));var config=require(_0x7e4c('0x7'));var attributes=require(_0x7e4c('0x8'));module[_0x7e4c('0x9')]=function(_0x4becfb,_0x580338){return _0x4becfb[_0x7e4c('0xa')](_0x7e4c('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x7e4c('0xc'),'fields':[_0x7e4c('0xc')]},{'name':_0x7e4c('0xd'),'fields':[_0x7e4c('0xe'),_0x7e4c('0xf')],'type':_0x7e4c('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x52e564,_0xfff413,_0x4de5ba){if(_0x52e564['body']){_0x52e564[_0x7e4c('0xe')]=htmlToText[_0x7e4c('0x11')](_0x52e564[_0x7e4c('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4de5ba(null,_0xfff413);},'afterCreate':function(_0x56f9bb,_0x502513,_0x3795cd){var _0x4350dd=_0x4becfb[_0x7e4c('0x13')];var _0x5af72d=_0x56f9bb[_0x7e4c('0x14')]({'plain':!![]});if(_0x5af72d[_0x7e4c('0x15')][_0x7e4c('0x16')]()==='in'||_0x5af72d['direction']['toLowerCase']()===_0x7e4c('0x17')&&!_0x5af72d[_0x7e4c('0x18')]&&!_[_0x7e4c('0x19')](_0x5af72d[_0x7e4c('0x1a')])){_0x4350dd[_0x7e4c('0x1b')][_0x7e4c('0x1c')]({'where':{'id':_0x5af72d['MailInteractionId']}})[_0x7e4c('0x1d')](function(_0x3ec31b){if(_0x3ec31b){_0x3ec31b[_0x7e4c('0x1e')]({'lastMsgAt':_0x5af72d[_0x7e4c('0x1f')],'lastMsgDirection':_0x5af72d['direction'][_0x7e4c('0x16')](),'lastMsgBody':_0x5af72d[_0x7e4c('0x12')]});}})[_0x7e4c('0x20')](function(_0x2d0818){console[_0x7e4c('0x21')](_0x2d0818);});}_0x3795cd();}},'charset':_0x7e4c('0x22'),'collate':_0x7e4c('0x23')});}; \ No newline at end of file +var _0xb986=['fti_mail_messages','plainBody','subject','body','models','get','direction','toLowerCase','out','isNil','UserId','MailInteraction','MailInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','messageId'];(function(_0x4d5e66,_0x337ad9){var _0xe68a39=function(_0x3187cf){while(--_0x3187cf){_0x4d5e66['push'](_0x4d5e66['shift']());}};_0xe68a39(++_0x337ad9);}(_0xb986,0x8a));var _0x6b98=function(_0xa4f363,_0x577275){_0xa4f363=_0xa4f363-0x0;var _0x38327f=_0xb986[_0xa4f363];return _0x38327f;};'use strict';var _=require(_0x6b98('0x0'));var util=require(_0x6b98('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6b98('0x2'));var rp=require(_0x6b98('0x3'));var htmlToText=require(_0x6b98('0x4'));var fs=require('fs');var path=require(_0x6b98('0x5'));var rimraf=require(_0x6b98('0x6'));var config=require(_0x6b98('0x7'));var attributes=require(_0x6b98('0x8'));module[_0x6b98('0x9')]=function(_0x5bcdce,_0x5502a2){return _0x5bcdce[_0x6b98('0xa')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x6b98('0xb'),'fields':[_0x6b98('0xb')]},{'name':_0x6b98('0xc'),'fields':[_0x6b98('0xd'),_0x6b98('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2409d7,_0x15af49,_0x49e4bf){if(_0x2409d7[_0x6b98('0xf')]){_0x2409d7['plainBody']=htmlToText['fromString'](_0x2409d7[_0x6b98('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x49e4bf(null,_0x15af49);},'afterCreate':function(_0x3990ba,_0x115c1a,_0x47035f){var _0x2826bb=_0x5bcdce[_0x6b98('0x10')];var _0x433ab1=_0x3990ba[_0x6b98('0x11')]({'plain':!![]});if(_0x433ab1[_0x6b98('0x12')][_0x6b98('0x13')]()==='in'||_0x433ab1['direction']['toLowerCase']()===_0x6b98('0x14')&&!_0x433ab1['secret']&&!_[_0x6b98('0x15')](_0x433ab1[_0x6b98('0x16')])){_0x2826bb[_0x6b98('0x17')]['findOne']({'where':{'id':_0x433ab1[_0x6b98('0x18')]}})[_0x6b98('0x19')](function(_0x39febc){if(_0x39febc){_0x39febc['update']({'lastMsgAt':_0x433ab1['createdAt'],'lastMsgDirection':_0x433ab1[_0x6b98('0x12')][_0x6b98('0x13')](),'lastMsgBody':_0x433ab1[_0x6b98('0xf')]});}})[_0x6b98('0x1a')](function(_0x5f3d26){console[_0x6b98('0x1b')](_0x5f3d26);});}_0x47035f();}},'charset':_0x6b98('0x1c'),'collate':_0x6b98('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index a0fd7e5..8e3113e 100644 --- a/server/api/mailMessage/mailMessage.rpc.js +++ b/server/api/mailMessage/mailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc963=['message','info','catch','CreateMailMessage','MailMessage','create','body','options','then','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s'];(function(_0x237cc7,_0x5ccd55){var _0x4cea34=function(_0x592954){while(--_0x592954){_0x237cc7['push'](_0x237cc7['shift']());}};_0x4cea34(++_0x5ccd55);}(_0xc963,0x17f));var _0x3c96=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xc963[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x3c96('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3c96('0x1'));var rs=require(_0x3c96('0x2'));var fs=require('fs');var Redis=require(_0x3c96('0x3'));var db=require(_0x3c96('0x4'))['db'];var utils=require(_0x3c96('0x5'));var logger=require('../../config/logger')(_0x3c96('0x6'));var config=require(_0x3c96('0x7'));var jayson=require(_0x3c96('0x8'));var client=jayson[_0x3c96('0x9')][_0x3c96('0xa')]({'port':0x232a});config['redis']=_[_0x3c96('0xb')](config[_0x3c96('0xc')],{'host':_0x3c96('0xd'),'port':0x18eb});var socket=require(_0x3c96('0xe'))(new Redis(config[_0x3c96('0xc')]));require(_0x3c96('0xf'))[_0x3c96('0x10')](socket);function respondWithRpcPromise(_0x2e3490,_0x51e375,_0x389618){return new BPromise(function(_0x4d6407,_0x31fa8f){return client[_0x3c96('0x11')](_0x2e3490,_0x389618)['then'](function(_0x4cbf3){logger['info']('MailMessage,\x20%s,\x20%s',_0x51e375,_0x3c96('0x12'));logger[_0x3c96('0x13')](_0x3c96('0x14'),_0x51e375,_0x3c96('0x12'),JSON[_0x3c96('0x15')](_0x4cbf3));if(_0x4cbf3[_0x3c96('0x16')]){if(_0x4cbf3[_0x3c96('0x16')][_0x3c96('0x17')]===0x1f4){logger[_0x3c96('0x16')](_0x3c96('0x18'),_0x51e375,_0x4cbf3[_0x3c96('0x16')][_0x3c96('0x19')]);return _0x31fa8f(_0x4cbf3[_0x3c96('0x16')][_0x3c96('0x19')]);}logger['error'](_0x3c96('0x18'),_0x51e375,_0x4cbf3[_0x3c96('0x16')]['message']);return _0x4d6407(_0x4cbf3[_0x3c96('0x16')][_0x3c96('0x19')]);}else{logger[_0x3c96('0x1a')](_0x3c96('0x18'),_0x51e375,'request\x20sent');_0x4d6407(_0x4cbf3['result'][_0x3c96('0x19')]);}})[_0x3c96('0x1b')](function(_0x1ce943){logger[_0x3c96('0x16')](_0x3c96('0x18'),_0x51e375,_0x1ce943);_0x31fa8f(_0x1ce943);});});}exports[_0x3c96('0x1c')]=function(_0x15aa1d){var _0xa1abd4=this;return new Promise(function(_0x4eca85,_0x363a60){return db[_0x3c96('0x1d')][_0x3c96('0x1e')](_0x15aa1d[_0x3c96('0x1f')],{'raw':_0x15aa1d[_0x3c96('0x20')]?_0x15aa1d[_0x3c96('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x3c96('0x21')](function(_0x2bc43d){logger['info'](_0x3c96('0x1c'),_0x15aa1d);logger[_0x3c96('0x13')](_0x3c96('0x1c'),_0x15aa1d,JSON[_0x3c96('0x15')](_0x2bc43d));_0x4eca85(_0x2bc43d);})[_0x3c96('0x1b')](function(_0x4f91cb){logger[_0x3c96('0x16')](_0x3c96('0x1c'),_0x4f91cb[_0x3c96('0x19')],_0x15aa1d);_0x363a60(_0xa1abd4[_0x3c96('0x16')](0x1f4,_0x4f91cb[_0x3c96('0x19')]));});});}; \ No newline at end of file +var _0xa6b0=['body','options','raw','CreateMailMessage','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','MailMessage','create'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x518e41,_0x128df9){_0x518e41=_0x518e41-0x0;var _0x4ad39d=_0xa6b0[_0x518e41];return _0x4ad39d;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0a6b('0x2'));var fs=require('fs');var Redis=require(_0x0a6b('0x3'));var db=require(_0x0a6b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a6b('0x5'))(_0x0a6b('0x6'));var config=require(_0x0a6b('0x7'));var jayson=require(_0x0a6b('0x8'));var client=jayson[_0x0a6b('0x9')][_0x0a6b('0xa')]({'port':0x232a});config[_0x0a6b('0xb')]=_[_0x0a6b('0xc')](config[_0x0a6b('0xb')],{'host':_0x0a6b('0xd'),'port':0x18eb});var socket=require(_0x0a6b('0xe'))(new Redis(config[_0x0a6b('0xb')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x25b93d,_0x100da8,_0xbdb0d0){return new BPromise(function(_0x25ad47,_0x81a412){return client[_0x0a6b('0xf')](_0x25b93d,_0xbdb0d0)[_0x0a6b('0x10')](function(_0x405046){logger[_0x0a6b('0x11')](_0x0a6b('0x12'),_0x100da8,_0x0a6b('0x13'));logger[_0x0a6b('0x14')](_0x0a6b('0x15'),_0x100da8,_0x0a6b('0x13'),JSON['stringify'](_0x405046));if(_0x405046['error']){if(_0x405046[_0x0a6b('0x16')][_0x0a6b('0x17')]===0x1f4){logger[_0x0a6b('0x16')](_0x0a6b('0x12'),_0x100da8,_0x405046[_0x0a6b('0x16')][_0x0a6b('0x18')]);return _0x81a412(_0x405046[_0x0a6b('0x16')][_0x0a6b('0x18')]);}logger[_0x0a6b('0x16')](_0x0a6b('0x12'),_0x100da8,_0x405046['error'][_0x0a6b('0x18')]);return _0x25ad47(_0x405046[_0x0a6b('0x16')]['message']);}else{logger[_0x0a6b('0x11')]('MailMessage,\x20%s,\x20%s',_0x100da8,_0x0a6b('0x13'));_0x25ad47(_0x405046[_0x0a6b('0x19')][_0x0a6b('0x18')]);}})[_0x0a6b('0x1a')](function(_0x5c512a){logger[_0x0a6b('0x16')](_0x0a6b('0x12'),_0x100da8,_0x5c512a);_0x81a412(_0x5c512a);});});}exports['CreateMailMessage']=function(_0x19848c){var _0x3f23b4=this;return new Promise(function(_0x1feb47,_0x491936){return db[_0x0a6b('0x1b')][_0x0a6b('0x1c')](_0x19848c[_0x0a6b('0x1d')],{'raw':_0x19848c['options']?_0x19848c[_0x0a6b('0x1e')][_0x0a6b('0x1f')]===undefined?!![]:![]:!![]})[_0x0a6b('0x10')](function(_0x5e8206){logger[_0x0a6b('0x11')]('CreateMailMessage',_0x19848c);logger[_0x0a6b('0x14')](_0x0a6b('0x20'),_0x19848c,JSON[_0x0a6b('0x21')](_0x5e8206));_0x1feb47(_0x5e8206);})['catch'](function(_0x2bd8b1){logger[_0x0a6b('0x16')](_0x0a6b('0x20'),_0x2bd8b1[_0x0a6b('0x18')],_0x19848c);_0x491936(_0x3f23b4[_0x0a6b('0x16')](0x1f4,_0x2bd8b1['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index e621196..10045df 100644 --- a/server/api/mailMessage/mailMessage.socket.js +++ b/server/api/mailMessage/mailMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca1d=['./mailMessage.events','remove','emit','removeListener','mailMessage:'];(function(_0x5f2ecc,_0x51f60a){var _0x1ab555=function(_0x2f3ffc){while(--_0x2f3ffc){_0x5f2ecc['push'](_0x5f2ecc['shift']());}};_0x1ab555(++_0x51f60a);}(_0xca1d,0x73));var _0xdca1=function(_0x394e47,_0x2135d5){_0x394e47=_0x394e47-0x0;var _0x5b81fd=_0xca1d[_0x394e47];return _0x5b81fd;};'use strict';var MailMessageEvents=require(_0xdca1('0x0'));var events=['save',_0xdca1('0x1'),'update'];function createListener(_0x451569,_0x499966){return function(_0x2185f4){_0x499966[_0xdca1('0x2')](_0x451569,_0x2185f4);};}function removeListener(_0x104d37,_0x4ce6b4){return function(){MailMessageEvents[_0xdca1('0x3')](_0x104d37,_0x4ce6b4);};}exports['register']=function(_0xd40ebe){for(var _0x5e33b2=0x0,_0xa1b001=events['length'];_0x5e33b2<_0xa1b001;_0x5e33b2++){var _0x40c56d=events[_0x5e33b2];var _0x4d20be=createListener(_0xdca1('0x4')+_0x40c56d,_0xd40ebe);MailMessageEvents['on'](_0x40c56d,_0x4d20be);}}; \ No newline at end of file +var _0x3eb7=['update','emit','register','length','mailMessage:','save','remove'];(function(_0x316641,_0x63dcdf){var _0x36edc3=function(_0x3f2182){while(--_0x3f2182){_0x316641['push'](_0x316641['shift']());}};_0x36edc3(++_0x63dcdf);}(_0x3eb7,0x14e));var _0x73eb=function(_0x3a4390,_0x3f23b2){_0x3a4390=_0x3a4390-0x0;var _0x2e3f20=_0x3eb7[_0x3a4390];return _0x2e3f20;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x73eb('0x0'),_0x73eb('0x1'),_0x73eb('0x2')];function createListener(_0x3e28b3,_0x585b8a){return function(_0xb0c879){_0x585b8a[_0x73eb('0x3')](_0x3e28b3,_0xb0c879);};}function removeListener(_0x362b68,_0x1bb876){return function(){MailMessageEvents['removeListener'](_0x362b68,_0x1bb876);};}exports[_0x73eb('0x4')]=function(_0x3c5191){for(var _0x16d7a2=0x0,_0x59d75d=events[_0x73eb('0x5')];_0x16d7a2<_0x59d75d;_0x16d7a2++){var _0x2413ac=events[_0x16d7a2];var _0xc560b7=createListener(_0x73eb('0x6')+_0x2413ac,_0x3c5191);MailMessageEvents['on'](_0x2413ac,_0xc560b7);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 6cf5486..c6d202b 100644 --- a/server/api/mailQueue/index.js +++ b/server/api/mailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4026=['addTeams','addAgents','put','update','destroy','delete','removeTeams','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create'];(function(_0x4eba1b,_0xfd7e19){var _0x1a8b0d=function(_0x22f344){while(--_0x22f344){_0x4eba1b['push'](_0x4eba1b['shift']());}};_0x1a8b0d(++_0xfd7e19);}(_0x4026,0x14b));var _0x6402=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4026[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x6402('0x0'));var util=require('util');var path=require(_0x6402('0x1'));var timeout=require(_0x6402('0x2'));var express=require(_0x6402('0x3'));var router=express[_0x6402('0x4')]();var auth=require(_0x6402('0x5'));var interaction=require(_0x6402('0x6'));var config=require(_0x6402('0x7'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0x6402('0x8')](),controller[_0x6402('0x9')]);router[_0x6402('0xa')](_0x6402('0xb'),auth[_0x6402('0x8')](),controller['describe']);router['get'](_0x6402('0xc'),auth[_0x6402('0x8')](),controller['show']);router[_0x6402('0xa')](_0x6402('0xd'),auth[_0x6402('0x8')](),controller[_0x6402('0xe')]);router['get'](_0x6402('0xf'),auth[_0x6402('0x8')](),controller['getTeams']);router[_0x6402('0xa')](_0x6402('0x10'),auth[_0x6402('0x8')](),controller[_0x6402('0x11')]);router[_0x6402('0x12')]('/',auth[_0x6402('0x8')](),controller[_0x6402('0x13')]);router[_0x6402('0x12')](_0x6402('0xf'),auth[_0x6402('0x8')](),controller[_0x6402('0x14')]);router[_0x6402('0x12')](_0x6402('0x10'),auth[_0x6402('0x8')](),controller[_0x6402('0x15')]);router[_0x6402('0x16')](_0x6402('0xc'),auth[_0x6402('0x8')](),controller[_0x6402('0x17')]);router['delete'](_0x6402('0xc'),auth[_0x6402('0x8')](),controller[_0x6402('0x18')]);router[_0x6402('0x19')](_0x6402('0xf'),auth['isAuthenticated'](),controller[_0x6402('0x1a')]);router[_0x6402('0x19')]('/:id/users',auth[_0x6402('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x45d6=['/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','update','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get'];(function(_0x262fad,_0x490151){var _0x48b332=function(_0xcb2d9b){while(--_0xcb2d9b){_0x262fad['push'](_0x262fad['shift']());}};_0x48b332(++_0x490151);}(_0x45d6,0x1d3));var _0x645d=function(_0x47cabb,_0x597ba4){_0x47cabb=_0x47cabb-0x0;var _0x50f6de=_0x45d6[_0x47cabb];return _0x50f6de;};'use strict';var multer=require('multer');var util=require(_0x645d('0x0'));var path=require(_0x645d('0x1'));var timeout=require(_0x645d('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x645d('0x3'));var interaction=require(_0x645d('0x4'));var config=require(_0x645d('0x5'));var controller=require('./mailQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x645d('0x6')]);router[_0x645d('0x7')](_0x645d('0x8'),auth[_0x645d('0x9')](),controller['describe']);router[_0x645d('0x7')](_0x645d('0xa'),auth[_0x645d('0x9')](),controller[_0x645d('0xb')]);router[_0x645d('0x7')](_0x645d('0xc'),auth[_0x645d('0x9')](),controller[_0x645d('0xd')]);router[_0x645d('0x7')](_0x645d('0xe'),auth[_0x645d('0x9')](),controller[_0x645d('0xf')]);router[_0x645d('0x7')](_0x645d('0x10'),auth[_0x645d('0x9')](),controller[_0x645d('0x11')]);router[_0x645d('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x645d('0x12')](_0x645d('0xe'),auth['isAuthenticated'](),controller[_0x645d('0x13')]);router['post']('/:id/users',auth[_0x645d('0x9')](),controller['addAgents']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x645d('0x14')]);router['delete'](_0x645d('0xa'),auth[_0x645d('0x9')](),controller['destroy']);router[_0x645d('0x15')](_0x645d('0xe'),auth[_0x645d('0x9')](),controller[_0x645d('0x16')]);router['delete']('/:id/users',auth[_0x645d('0x9')](),controller[_0x645d('0x17')]);module[_0x645d('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 1ab5293..5cdf6bc 100644 --- a/server/api/mailQueue/mailQueue.attributes.js +++ b/server/api/mailQueue/mailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa809=['STRING','beepall','roundrobin','exports'];(function(_0x5e9949,_0x4016d6){var _0x297080=function(_0x1c2198){while(--_0x1c2198){_0x5e9949['push'](_0x5e9949['shift']());}};_0x297080(++_0x4016d6);}(_0xa809,0x1f3));var _0x9a80=function(_0x105937,_0x34d9e6){_0x105937=_0x105937-0x0;var _0x3ee03a=_0xa809[_0x105937];return _0x3ee03a;};'use strict';var Sequelize=require('sequelize');module[_0x9a80('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9a80('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x9a80('0x2'),_0x9a80('0x3'))}}; \ No newline at end of file +var _0x7d5b=['roundrobin','sequelize','exports','name','STRING','INTEGER','rrmemory','beepall'];(function(_0x202695,_0x364c54){var _0x146319=function(_0x394b25){while(--_0x394b25){_0x202695['push'](_0x202695['shift']());}};_0x146319(++_0x364c54);}(_0x7d5b,0x131));var _0xb7d5=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7d5b[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xb7d5('0x0'));module[_0xb7d5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb7d5('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb7d5('0x3')]},'timeout':{'type':Sequelize[_0xb7d5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb7d5('0x5'),_0xb7d5('0x6'),_0xb7d5('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index c6b8bd6..b520ac4 100644 --- a/server/api/mailQueue/mailQueue.controller.js +++ b/server/api/mailQueue/mailQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ec3=['attributes','fields','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','include','rows','catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','destroy','describe','findOne','UserMailQueue','sort','MailQueueId','findAndCountAll','UserId','agent','mailPause','format','%s/%s','SIP','createdAt','updatedAt','Team','pick','getTeams','nolimit','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','forEach','emit','userMailQueue:save','findAll','select','tq.TeamId','from','user_has_teams','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','get','MailQueues','error','stack','name','send','index','MailQueue','rawAttributes','type','key','model','map','query','keys','filters','intersection'];(function(_0x5c52a3,_0x13c8d5){var _0x5537b9=function(_0x469e93){while(--_0x469e93){_0x5c52a3['push'](_0x5c52a3['shift']());}};_0x5537b9(++_0x13c8d5);}(_0x1ec3,0x165));var _0x31ec=function(_0x491252,_0x5e2e32){_0x491252=_0x491252-0x0;var _0x5cafe1=_0x1ec3[_0x491252];return _0x5cafe1;};'use strict';var pdf=require(_0x31ec('0x0'));var emlformat=require(_0x31ec('0x1'));var rimraf=require(_0x31ec('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x31ec('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x31ec('0x4'));var Mustache=require(_0x31ec('0x5'));var util=require('util');var path=require(_0x31ec('0x6'));var sox=require(_0x31ec('0x7'));var csv=require('to-csv');var ejs=require(_0x31ec('0x8'));var fs=require('fs');var _=require(_0x31ec('0x9'));var squel=require(_0x31ec('0xa'));var crypto=require(_0x31ec('0xb'));var jsforce=require(_0x31ec('0xc'));var deskjs=require(_0x31ec('0xd'));var toCsv=require(_0x31ec('0xe'));var querystring=require(_0x31ec('0xf'));var Papa=require(_0x31ec('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x31ec('0x11'));var as=require(_0x31ec('0x12'));var hardwareService=require(_0x31ec('0x13'));var logger=require(_0x31ec('0x14'))(_0x31ec('0x15'));var utils=require(_0x31ec('0x16'));var config=require(_0x31ec('0x17'));var db=require(_0x31ec('0x18'))['db'];config['redis']=_[_0x31ec('0x19')](config[_0x31ec('0x1a')],{'host':_0x31ec('0x1b'),'port':0x18eb});var socket=require(_0x31ec('0x1c'))(new Redis(config[_0x31ec('0x1a')]));require('./mailQueue.socket')[_0x31ec('0x1d')](socket);function respondWithStatusCode(_0x5d7f5d,_0x3d8815){_0x3d8815=_0x3d8815||0xcc;return function(_0x1739fb){if(_0x1739fb){return _0x5d7f5d[_0x31ec('0x1e')](_0x3d8815);}return _0x5d7f5d[_0x31ec('0x1f')](_0x3d8815)[_0x31ec('0x20')]();};}function respondWithResult(_0x3cc2c3,_0x29e879){_0x29e879=_0x29e879||0xc8;return function(_0x3a83ec){if(_0x3a83ec){return _0x3cc2c3[_0x31ec('0x1f')](_0x29e879)[_0x31ec('0x21')](_0x3a83ec);}};}function respondWithFilteredResult(_0x298003,_0x479e58){return function(_0x2dd24c){if(_0x2dd24c){var _0x5dc6fb=_0x2dd24c[_0x31ec('0x22')],_0x357e15=_0x479e58[_0x31ec('0x23')],_0x5affee=_0x479e58[_0x31ec('0x23')]+_0x479e58[_0x31ec('0x24')],_0xac0e4d;if(_0x5affee>=_0x5dc6fb){_0x5affee=_0x5dc6fb;_0xac0e4d=0xc8;}else{_0xac0e4d=0xce;}_0x298003[_0x31ec('0x1f')](_0xac0e4d);return _0x298003[_0x31ec('0x25')](_0x31ec('0x26'),_0x357e15+'-'+_0x5affee+'/'+_0x5dc6fb)[_0x31ec('0x21')](_0x2dd24c);}return null;};}function patchUpdates(_0x27e8e2){return function(_0x827eaa){try{jsonpatch['apply'](_0x827eaa,_0x27e8e2,!![]);}catch(_0x5b1e56){return BPromise[_0x31ec('0x27')](_0x5b1e56);}return _0x827eaa[_0x31ec('0x28')]();};}function saveUpdates(_0x5ef877,_0x82de5f){return function(_0x5aa339){if(_0x5aa339){return _0x5aa339[_0x31ec('0x29')](_0x5ef877)[_0x31ec('0x2a')](function(_0x26f7aa){return _0x26f7aa;});}return null;};}function removeEntity(_0x2242bd,_0x30349d){return function(_0x2c4f2e){if(_0x2c4f2e){return _0x2c4f2e['destroy']()[_0x31ec('0x2a')](function(){var _0x22a3e9=_0x2c4f2e[_0x31ec('0x2b')]({'plain':!![]});var _0x2f20fe=_0x31ec('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x2f20fe,'resourceId':_0x22a3e9['id']}})[_0x31ec('0x2a')](function(){return _0x2c4f2e;});})[_0x31ec('0x2a')](function(){_0x2242bd[_0x31ec('0x1f')](0xcc)[_0x31ec('0x20')]();});}};}function handleEntityNotFound(_0x3b088c,_0x1088a1){return function(_0x2e8c76){if(!_0x2e8c76){_0x3b088c[_0x31ec('0x1e')](0x194);}return _0x2e8c76;};}function handleError(_0x502b6f,_0x2d9a7b){_0x2d9a7b=_0x2d9a7b||0x1f4;return function(_0x312522){logger[_0x31ec('0x2d')](_0x312522[_0x31ec('0x2e')]);if(_0x312522[_0x31ec('0x2f')]){delete _0x312522[_0x31ec('0x2f')];}_0x502b6f[_0x31ec('0x1f')](_0x2d9a7b)[_0x31ec('0x30')](_0x312522);};}exports[_0x31ec('0x31')]=function(_0x1b1dd0,_0x3dee33){var _0x1fa0aa={},_0xcec4a1={},_0x3d7c5f={'count':0x0,'rows':[]};var _0x12fad5=_['map'](db[_0x31ec('0x32')][_0x31ec('0x33')],function(_0x8f74b3){return{'name':_0x8f74b3['fieldName'],'type':_0x8f74b3[_0x31ec('0x34')][_0x31ec('0x35')]};});_0xcec4a1[_0x31ec('0x36')]=_[_0x31ec('0x37')](_0x12fad5,_0x31ec('0x2f'));_0xcec4a1[_0x31ec('0x38')]=_[_0x31ec('0x39')](_0x1b1dd0['query']);_0xcec4a1[_0x31ec('0x3a')]=_[_0x31ec('0x3b')](_0xcec4a1['model'],_0xcec4a1[_0x31ec('0x38')]);_0x1fa0aa[_0x31ec('0x3c')]=_[_0x31ec('0x3b')](_0xcec4a1[_0x31ec('0x36')],qs[_0x31ec('0x3d')](_0x1b1dd0[_0x31ec('0x38')][_0x31ec('0x3d')]));_0x1fa0aa['attributes']=_0x1fa0aa[_0x31ec('0x3c')][_0x31ec('0x3e')]?_0x1fa0aa[_0x31ec('0x3c')]:_0xcec4a1[_0x31ec('0x36')];if(!_0x1b1dd0[_0x31ec('0x38')][_0x31ec('0x3f')]('nolimit')){_0x1fa0aa[_0x31ec('0x24')]=qs[_0x31ec('0x24')](_0x1b1dd0[_0x31ec('0x38')][_0x31ec('0x24')]);_0x1fa0aa[_0x31ec('0x23')]=qs['offset'](_0x1b1dd0['query'][_0x31ec('0x23')]);}_0x1fa0aa[_0x31ec('0x40')]=qs['sort'](_0x1b1dd0['query']['sort']);_0x1fa0aa[_0x31ec('0x41')]=qs[_0x31ec('0x3a')](_['pick'](_0x1b1dd0['query'],_0xcec4a1[_0x31ec('0x3a')]));if(_0x1b1dd0['query'][_0x31ec('0x42')]){_0x1fa0aa[_0x31ec('0x41')]=_[_0x31ec('0x43')](_0x1fa0aa[_0x31ec('0x41')],{'$or':_[_0x31ec('0x37')](_0x12fad5,function(_0x5dd53e){if(_0x5dd53e[_0x31ec('0x34')]!==_0x31ec('0x44')){var _0xf81395={};_0xf81395[_0x5dd53e[_0x31ec('0x2f')]]={'$like':'%'+_0x1b1dd0[_0x31ec('0x38')][_0x31ec('0x42')]+'%'};return _0xf81395;}})});}_0x1fa0aa=_[_0x31ec('0x43')]({},_0x1fa0aa,_0x1b1dd0[_0x31ec('0x45')]);var _0x537b18={'where':_0x1fa0aa[_0x31ec('0x41')]};return db[_0x31ec('0x32')][_0x31ec('0x22')](_0x537b18)[_0x31ec('0x2a')](function(_0x538def){_0x3d7c5f[_0x31ec('0x22')]=_0x538def;if(_0x1b1dd0[_0x31ec('0x38')]['includeAll']){_0x1fa0aa[_0x31ec('0x46')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x1fa0aa);})[_0x31ec('0x2a')](function(_0x3417e4){_0x3d7c5f[_0x31ec('0x47')]=_0x3417e4;return _0x3d7c5f;})[_0x31ec('0x2a')](respondWithFilteredResult(_0x3dee33,_0x1fa0aa))[_0x31ec('0x48')](handleError(_0x3dee33,null));};exports['show']=function(_0xad8702,_0x5e3d9d){var _0x3fa628={'raw':!![],'where':{'id':_0xad8702[_0x31ec('0x49')]['id']}},_0xf6ec60={};_0xf6ec60[_0x31ec('0x36')]=_['keys'](db[_0x31ec('0x32')]['rawAttributes']);_0xf6ec60['query']=_['keys'](_0xad8702[_0x31ec('0x38')]);_0xf6ec60[_0x31ec('0x3a')]=_[_0x31ec('0x3b')](_0xf6ec60[_0x31ec('0x36')],_0xf6ec60[_0x31ec('0x38')]);_0x3fa628[_0x31ec('0x3c')]=_[_0x31ec('0x3b')](_0xf6ec60['model'],qs['fields'](_0xad8702['query'][_0x31ec('0x3d')]));_0x3fa628[_0x31ec('0x3c')]=_0x3fa628[_0x31ec('0x3c')][_0x31ec('0x3e')]?_0x3fa628[_0x31ec('0x3c')]:_0xf6ec60[_0x31ec('0x36')];if(_0xad8702[_0x31ec('0x38')][_0x31ec('0x4a')]){_0x3fa628[_0x31ec('0x46')]=[{'all':!![]}];}_0x3fa628=_[_0x31ec('0x43')]({},_0x3fa628,_0xad8702[_0x31ec('0x45')]);return db['MailQueue'][_0x31ec('0x4b')](_0x3fa628)[_0x31ec('0x2a')](handleEntityNotFound(_0x5e3d9d,null))[_0x31ec('0x2a')](respondWithResult(_0x5e3d9d,null))[_0x31ec('0x48')](handleError(_0x5e3d9d,null));};exports['create']=function(_0x5f1845,_0x5e8967){return db[_0x31ec('0x32')][_0x31ec('0x4c')](_0x5f1845[_0x31ec('0x4d')],{})[_0x31ec('0x2a')](function(_0x426611){var _0x3662e4=_0x5f1845[_0x31ec('0x4e')][_0x31ec('0x2b')]({'plain':!![]});if(!_0x3662e4)throw new Error(_0x31ec('0x4f'));if(_0x3662e4[_0x31ec('0x50')]===_0x31ec('0x4e')){var _0x20cec4=_0x426611[_0x31ec('0x2b')]({'plain':!![]});var _0x3835ce=_0x31ec('0x2c');return db[_0x31ec('0x51')][_0x31ec('0x4b')]({'where':{'name':_0x3835ce,'userProfileId':_0x3662e4[_0x31ec('0x52')]},'raw':!![]})[_0x31ec('0x2a')](function(_0x96b731){if(_0x96b731&&_0x96b731[_0x31ec('0x53')]===0x0){return db[_0x31ec('0x54')][_0x31ec('0x4c')]({'name':_0x20cec4[_0x31ec('0x2f')],'resourceId':_0x20cec4['id'],'type':_0x96b731[_0x31ec('0x2f')],'sectionId':_0x96b731['id']},{})[_0x31ec('0x2a')](function(){return _0x426611;});}else{return _0x426611;}})[_0x31ec('0x48')](function(_0xe9ca4c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe9ca4c);throw _0xe9ca4c;});}return _0x426611;})[_0x31ec('0x2a')](respondWithResult(_0x5e8967,0xc9))[_0x31ec('0x48')](handleError(_0x5e8967,null));};exports[_0x31ec('0x29')]=function(_0x466b9b,_0x402c53){if(_0x466b9b['body']['id']){delete _0x466b9b[_0x31ec('0x4d')]['id'];}return db[_0x31ec('0x32')]['find']({'where':{'id':_0x466b9b['params']['id']}})[_0x31ec('0x2a')](handleEntityNotFound(_0x402c53,null))['then'](saveUpdates(_0x466b9b[_0x31ec('0x4d')],null))[_0x31ec('0x2a')](respondWithResult(_0x402c53,null))[_0x31ec('0x48')](handleError(_0x402c53,null));};exports[_0x31ec('0x55')]=function(_0xc1d481,_0x2ad294){return db[_0x31ec('0x32')]['find']({'where':{'id':_0xc1d481[_0x31ec('0x49')]['id']}})[_0x31ec('0x2a')](handleEntityNotFound(_0x2ad294,null))[_0x31ec('0x2a')](removeEntity(_0x2ad294,null))[_0x31ec('0x48')](handleError(_0x2ad294,null));};exports[_0x31ec('0x56')]=function(_0x2b152d,_0x2500c5){return db[_0x31ec('0x32')][_0x31ec('0x56')]()[_0x31ec('0x2a')](respondWithResult(_0x2500c5,null))[_0x31ec('0x48')](handleError(_0x2500c5,null));};exports['getMembers']=function(_0x567a30,_0x55e045,_0xe619a0){var _0x19ad4f={'raw':!![],'where':{}},_0x3ee300={},_0x28e8c0;return db['MailQueue'][_0x31ec('0x57')]({'where':{'id':_0x567a30[_0x31ec('0x49')]['id']}})[_0x31ec('0x2a')](handleEntityNotFound(_0x55e045,null))[_0x31ec('0x2a')](function(_0xdaa007){if(_0xdaa007){_0x28e8c0=_0xdaa007[_0x31ec('0x2b')]({'plain':!![]});_0x3ee300[_0x31ec('0x36')]=_[_0x31ec('0x39')](db[_0x31ec('0x58')]['rawAttributes']);_0x3ee300[_0x31ec('0x38')]=_['keys'](_0x567a30[_0x31ec('0x38')]);_0x3ee300[_0x31ec('0x3a')]=_[_0x31ec('0x3b')](_0x3ee300[_0x31ec('0x36')],_0x3ee300[_0x31ec('0x38')]);_0x19ad4f[_0x31ec('0x3c')]=_[_0x31ec('0x3b')](_0x3ee300[_0x31ec('0x36')],qs[_0x31ec('0x3d')](_0x567a30[_0x31ec('0x38')]['fields']));_0x19ad4f[_0x31ec('0x3c')]=_0x19ad4f[_0x31ec('0x3c')][_0x31ec('0x3e')]?_0x19ad4f[_0x31ec('0x3c')]:_0x3ee300[_0x31ec('0x36')];if(!_0x567a30[_0x31ec('0x38')][_0x31ec('0x3f')]('nolimit')){_0x19ad4f[_0x31ec('0x24')]=qs[_0x31ec('0x24')](_0x567a30[_0x31ec('0x38')][_0x31ec('0x24')]);_0x19ad4f[_0x31ec('0x23')]=qs[_0x31ec('0x23')](_0x567a30[_0x31ec('0x38')][_0x31ec('0x23')]);}_0x19ad4f['order']=qs[_0x31ec('0x59')](_0x567a30[_0x31ec('0x38')][_0x31ec('0x59')]);_0x19ad4f[_0x31ec('0x41')]=qs[_0x31ec('0x3a')](_['pick'](_0x567a30[_0x31ec('0x38')],_0x3ee300['filters']));_0x19ad4f[_0x31ec('0x41')][_0x31ec('0x5a')]=_0xdaa007['id'];if(_0x567a30['query'][_0x31ec('0x42')]){_0x19ad4f[_0x31ec('0x41')]=_[_0x31ec('0x43')](_0x19ad4f[_0x31ec('0x41')],{'$or':_['map'](_0x19ad4f[_0x31ec('0x3c')],function(_0x1c2b75){var _0x58c34c={};_0x58c34c[_0x1c2b75]={'$like':'%'+_0x567a30[_0x31ec('0x38')][_0x31ec('0x42')]+'%'};return _0x58c34c;})});}_0x19ad4f=_[_0x31ec('0x43')]({},_0x19ad4f,_0x567a30['options']);return db[_0x31ec('0x58')]['findAll'](_0x19ad4f);}})['then'](function(_0xea0215){if(_0xea0215){return db['User'][_0x31ec('0x5b')]({'where':{'id':_[_0x31ec('0x37')](_0xea0215,_0x31ec('0x5c')),'role':_0x31ec('0x5d')},'attributes':['id',_0x31ec('0x2f'),_0x31ec('0x5e'),'updatedAt','createdAt']});}})[_0x31ec('0x2a')](function(_0x2eb543){if(_0x2eb543){return{'count':_0x2eb543[_0x31ec('0x22')],'rows':_[_0x31ec('0x37')](_0x2eb543[_0x31ec('0x47')],function(_0x2eacd2){return{'membername':_0x2eacd2[_0x31ec('0x2f')],'UserId':_0x2eacd2['id'],'queue_name':_0x28e8c0['name'],'MailQueueId':_0x28e8c0['id'],'interface':util[_0x31ec('0x5f')](_0x31ec('0x60'),_0x31ec('0x61'),_0x2eacd2[_0x31ec('0x2f')]),'penalty':0x0,'paused':_0x2eacd2['mailPause'],'createdAt':_0x2eacd2[_0x31ec('0x62')],'updatedAt':_0x2eacd2[_0x31ec('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x55e045,_0x19ad4f))['catch'](handleError(_0x55e045,null));};exports['getTeams']=function(_0x381307,_0x3b479e,_0x48aa1f){var _0x24db6d={};var _0x374ff2={};var _0x1db0ce;var _0x3dc21d;return db[_0x31ec('0x32')][_0x31ec('0x57')]({'where':{'id':_0x381307['params']['id']}})['then'](handleEntityNotFound(_0x3b479e,null))[_0x31ec('0x2a')](function(_0x2f5a5b){if(_0x2f5a5b){_0x1db0ce=_0x2f5a5b;_0x374ff2[_0x31ec('0x36')]=_['keys'](db[_0x31ec('0x64')]['rawAttributes']);_0x374ff2[_0x31ec('0x38')]=_[_0x31ec('0x39')](_0x381307[_0x31ec('0x38')]);_0x374ff2[_0x31ec('0x3a')]=_[_0x31ec('0x3b')](_0x374ff2[_0x31ec('0x36')],_0x374ff2[_0x31ec('0x38')]);_0x24db6d[_0x31ec('0x3c')]=_[_0x31ec('0x3b')](_0x374ff2['model'],qs[_0x31ec('0x3d')](_0x381307[_0x31ec('0x38')]['fields']));_0x24db6d[_0x31ec('0x3c')]=_0x24db6d['attributes'][_0x31ec('0x3e')]?_0x24db6d[_0x31ec('0x3c')]:_0x374ff2[_0x31ec('0x36')];_0x24db6d['order']=qs['sort'](_0x381307[_0x31ec('0x38')][_0x31ec('0x59')]);_0x24db6d[_0x31ec('0x41')]=qs[_0x31ec('0x3a')](_[_0x31ec('0x65')](_0x381307[_0x31ec('0x38')],_0x374ff2['filters']));if(_0x381307[_0x31ec('0x38')][_0x31ec('0x42')]){_0x24db6d[_0x31ec('0x41')]=_[_0x31ec('0x43')](_0x24db6d[_0x31ec('0x41')],{'$or':_[_0x31ec('0x37')](_0x24db6d['attributes'],function(_0x3b2e47){var _0x41672e={};_0x41672e[_0x3b2e47]={'$like':'%'+_0x381307[_0x31ec('0x38')]['filter']+'%'};return _0x41672e;})});}_0x24db6d=_[_0x31ec('0x43')]({},_0x24db6d,_0x381307[_0x31ec('0x45')]);return _0x1db0ce[_0x31ec('0x66')](_0x24db6d);}})[_0x31ec('0x2a')](function(_0x403e20){if(_0x403e20){_0x3dc21d=_0x403e20[_0x31ec('0x3e')];if(!_0x381307[_0x31ec('0x38')][_0x31ec('0x3f')](_0x31ec('0x67'))){_0x24db6d['limit']=qs[_0x31ec('0x24')](_0x381307[_0x31ec('0x38')][_0x31ec('0x24')]);_0x24db6d['offset']=qs[_0x31ec('0x23')](_0x381307[_0x31ec('0x38')]['offset']);}return _0x1db0ce['getTeams'](_0x24db6d);}})[_0x31ec('0x2a')](function(_0x5482cf){if(_0x5482cf){return _0x5482cf?{'count':_0x3dc21d,'rows':_0x5482cf}:null;}})[_0x31ec('0x2a')](respondWithResult(_0x3b479e,null))[_0x31ec('0x48')](handleError(_0x3b479e,null));};exports['addTeams']=function(_0x23e160,_0x103e09,_0x320201){var _0x3b2ce2=_0x23e160[_0x31ec('0x4d')][_0x31ec('0x68')];return db[_0x31ec('0x64')]['findAll']({'where':{'id':_0x3b2ce2},'attributes':['id'],'include':[{'model':db[_0x31ec('0x69')],'as':_0x31ec('0x6a'),'attributes':['id','name',_0x31ec('0x6b'),_0x31ec('0x6c'),_0x31ec('0x6d')],'raw':!![]}]})[_0x31ec('0x2a')](function(_0x3bc179){if(_0x3bc179){var _0x4be3b1=_[_0x31ec('0x6e')](_0x3bc179,function(_0x14fe92){var _0xcc8bbd=_0x14fe92['get']({'plain':!![]});return _0xcc8bbd[_0x31ec('0x6a')];});return db[_0x31ec('0x32')][_0x31ec('0x4b')]({'where':{'id':_0x23e160[_0x31ec('0x49')]['id']}})[_0x31ec('0x2a')](function(_0x315d4e){return db[_0x31ec('0x6f')][_0x31ec('0x70')](function(_0x2f1f75){return _0x315d4e[_0x31ec('0x71')](_0x3b2ce2,{'transaction':_0x2f1f75})[_0x31ec('0x2a')](function(){return BPromise['each'](_0x4be3b1,function(_0x3db750){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x3db750['id'],'MailQueueId':_0x23e160[_0x31ec('0x49')]['id']},'transaction':_0x2f1f75});});})[_0x31ec('0x2a')](function(){_0x4be3b1[_0x31ec('0x72')](function(_0x316a31){socket[_0x31ec('0x73')](_0x31ec('0x74'),{'UserId':_0x316a31['id'],'MailQueueId':_0x315d4e['id']});});});});});}})['then'](respondWithStatusCode(_0x103e09,null))[_0x31ec('0x48')](handleError(_0x103e09,null));};exports['removeTeams']=function(_0x20621b,_0x6116ca,_0x504a6c){return db[_0x31ec('0x64')][_0x31ec('0x75')]({'where':{'id':_0x20621b[_0x31ec('0x38')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x31ec('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x31ec('0x2a')](handleEntityNotFound(_0x6116ca,null))[_0x31ec('0x2a')](function(_0x3f5ada){var _0x3c6c51=_[_0x31ec('0x37')](_0x3f5ada,'id');var _0x3ab17c=[];var _0x3b679e=[];var _0x54d12a=squel[_0x31ec('0x76')]();_0x54d12a['field'](_0x31ec('0x77'))[_0x31ec('0x78')]('team_has_mail_queues','tq')['join'](_0x31ec('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x31ec('0x41')](_0x31ec('0x7a'),_0x20621b[_0x31ec('0x49')]['id']);for(var _0x3be33b=0x0;_0x3be33b<_0x3f5ada[_0x31ec('0x3e')];_0x3be33b+=0x1){let _0x4101c4=_0x3f5ada[_0x3be33b];for(var _0x29011a=0x0;_0x29011a<_0x4101c4[_0x31ec('0x6a')]['length'];_0x29011a+=0x1){let _0x38f8d0=_0x4101c4['Agents'][_0x29011a];var _0x21dee9=_0x54d12a['clone']();_0x21dee9[_0x31ec('0x41')](_0x31ec('0x7b'),_0x38f8d0['id']);_0x3b679e[_0x31ec('0x7c')](db['sequelize']['query'](_0x21dee9['toString'](),{'type':db[_0x31ec('0x6f')][_0x31ec('0x7d')][_0x31ec('0x7e')]})['then'](function(_0xba4ae){if(_0xba4ae['length']===0x1){return _0x38f8d0['id'];}else{var _0x25c6be=_[_0x31ec('0x7f')](_[_0x31ec('0x37')](_0xba4ae,_0x31ec('0x80')),function(_0x46b923){return _[_0x31ec('0x81')](_0x3c6c51,_0x46b923);});if(_0x25c6be){return _0x38f8d0['id'];}}}));}}return BPromise[_0x31ec('0x82')](_0x3b679e)[_0x31ec('0x2a')](function(_0x18bb3c){_0x3ab17c=_(_0x3ab17c)[_0x31ec('0x83')](_0x18bb3c)['compact']()['value']();return db[_0x31ec('0x32')]['find']({'where':{'id':_0x20621b[_0x31ec('0x49')]['id']}})['then'](function(_0xb63015){return db[_0x31ec('0x6f')][_0x31ec('0x70')](function(_0x1474ce){return _0xb63015['removeTeams'](_0x20621b[_0x31ec('0x38')]['ids'],{'transaction':_0x1474ce})[_0x31ec('0x2a')](function(){if(!_['isEmpty'](_0x3ab17c)){return _0xb63015[_0x31ec('0x84')](_0x3ab17c,{'transaction':_0x1474ce});}})['then'](function(){_0x3ab17c[_0x31ec('0x72')](function(_0x1ef55c){socket[_0x31ec('0x73')](_0x31ec('0x85'),{'UserId':_0x1ef55c,'MailQueueId':_0xb63015['id']});});});});});});})[_0x31ec('0x2a')](respondWithStatusCode(_0x6116ca,null))[_0x31ec('0x48')](handleError(_0x6116ca,null));};exports['addAgents']=function(_0x50f387,_0x13a176,_0x20b8b7){return db[_0x31ec('0x32')][_0x31ec('0x4b')]({'where':{'id':_0x50f387[_0x31ec('0x49')]['id']}})[_0x31ec('0x2a')](handleEntityNotFound(_0x13a176,null))[_0x31ec('0x2a')](function(_0x190140){if(_0x190140){return _0x190140[_0x31ec('0x86')](_0x50f387[_0x31ec('0x4d')][_0x31ec('0x68')],_[_0x31ec('0x87')](_0x50f387['body'],[_0x31ec('0x68'),'id'])||{})[_0x31ec('0x88')](function(_0x3e698e){for(var _0x23214d=0x0;_0x23214d<_0x50f387['body'][_0x31ec('0x68')][_0x31ec('0x3e')];_0x23214d+=0x1){socket[_0x31ec('0x73')]('userMailQueue:save',{'UserId':_0x50f387['body'][_0x31ec('0x68')][_0x23214d],'MailQueueId':_0x50f387[_0x31ec('0x49')]['id']});}return _0x3e698e;});}})['then'](respondWithResult(_0x13a176,null))['catch'](handleError(_0x13a176,null));};exports['removeAgents']=function(_0x359891,_0x7dbad5,_0x42c7c0){return db[_0x31ec('0x32')][_0x31ec('0x4b')]({'where':{'id':_0x359891[_0x31ec('0x49')]['id']}})['then'](handleEntityNotFound(_0x7dbad5,null))[_0x31ec('0x2a')](function(_0x2f72d8){if(_0x2f72d8){return _0x2f72d8[_0x31ec('0x84')](_0x359891[_0x31ec('0x38')][_0x31ec('0x68')])[_0x31ec('0x2a')](function(){if(_[_0x31ec('0x89')](_0x359891[_0x31ec('0x38')][_0x31ec('0x68')])){for(var _0x12d7b0=0x0;_0x12d7b0<_0x359891['query'][_0x31ec('0x68')][_0x31ec('0x3e')];_0x12d7b0+=0x1){socket[_0x31ec('0x73')](_0x31ec('0x85'),{'UserId':Number(_0x359891[_0x31ec('0x38')][_0x31ec('0x68')][_0x12d7b0]),'MailQueueId':Number(_0x359891[_0x31ec('0x49')]['id'])});}}else{socket[_0x31ec('0x73')](_0x31ec('0x85'),{'UserId':Number(_0x359891['query'][_0x31ec('0x68')]),'MailQueueId':Number(_0x359891[_0x31ec('0x49')]['id'])});}});}})[_0x31ec('0x2a')](respondWithStatusCode(_0x7dbad5,null))['catch'](handleError(_0x7dbad5,null));};exports['getAgents']=function(_0x4a992a,_0x504901,_0x37e732){var _0x172080={};var _0x58911e={};var _0x46f134;var _0x380503;return db['MailQueue'][_0x31ec('0x57')]({'where':{'id':_0x4a992a['params']['id']}})[_0x31ec('0x2a')](handleEntityNotFound(_0x504901,null))['then'](function(_0x5013c3){if(_0x5013c3){_0x46f134=_0x5013c3;_0x58911e[_0x31ec('0x36')]=_[_0x31ec('0x39')](db['User']['rawAttributes']);_0x58911e['query']=_[_0x31ec('0x39')](_0x4a992a['query']);_0x58911e[_0x31ec('0x3a')]=_['intersection'](_0x58911e[_0x31ec('0x36')],_0x58911e[_0x31ec('0x38')]);_0x172080[_0x31ec('0x3c')]=_['intersection'](_0x58911e['model'],qs[_0x31ec('0x3d')](_0x4a992a[_0x31ec('0x38')][_0x31ec('0x3d')]));_0x172080[_0x31ec('0x3c')]=_0x172080['attributes'][_0x31ec('0x3e')]?_0x172080[_0x31ec('0x3c')]:_0x58911e[_0x31ec('0x36')];_0x172080['order']=qs[_0x31ec('0x59')](_0x4a992a['query'][_0x31ec('0x59')]);_0x172080[_0x31ec('0x41')]=qs[_0x31ec('0x3a')](_['pick'](_0x4a992a[_0x31ec('0x38')],_0x58911e[_0x31ec('0x3a')]));if(_0x4a992a[_0x31ec('0x38')][_0x31ec('0x42')]){_0x172080['where']=_[_0x31ec('0x43')](_0x172080[_0x31ec('0x41')],{'$or':_[_0x31ec('0x37')](_0x172080[_0x31ec('0x3c')],function(_0x2e3c48){var _0x56c85c={};_0x56c85c[_0x2e3c48]={'$like':'%'+_0x4a992a[_0x31ec('0x38')]['filter']+'%'};return _0x56c85c;})});}_0x172080=_[_0x31ec('0x43')]({},_0x172080,_0x4a992a[_0x31ec('0x45')]);return _0x46f134[_0x31ec('0x8a')](_0x172080);}})['then'](function(_0x3734a9){if(_0x3734a9){_0x380503=_0x3734a9[_0x31ec('0x3e')];if(!_0x4a992a[_0x31ec('0x38')][_0x31ec('0x3f')](_0x31ec('0x67'))){_0x172080[_0x31ec('0x24')]=qs['limit'](_0x4a992a['query']['limit']);_0x172080[_0x31ec('0x23')]=qs[_0x31ec('0x23')](_0x4a992a[_0x31ec('0x38')]['offset']);}return _0x46f134[_0x31ec('0x8a')](_0x172080);}})[_0x31ec('0x2a')](function(_0x58b287){if(_0x58b287){return _0x58b287?{'count':_0x380503,'rows':_0x58b287}:null;}})[_0x31ec('0x2a')](respondWithResult(_0x504901,null))[_0x31ec('0x48')](handleError(_0x504901,null));}; \ No newline at end of file +var _0xa87e=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','update','then','get','MailQueues','UserProfileResource','destroy','end','error','stack','name','send','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','MailQueue','include','findAll','rows','show','rawAttributes','length','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','body','params','describe','getMembers','findOne','UserMailQueue','MailQueueId','User','findAndCountAll','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','online','voicePause','flatMap','Agents','sequelize','transaction','each','emit','userMailQueue:save','removeTeams','field','team_has_mail_queues','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','union','compact','value','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','zip-dir'];(function(_0x139674,_0x1ca8d8){var _0x191caa=function(_0x10b31a){while(--_0x10b31a){_0x139674['push'](_0x139674['shift']());}};_0x191caa(++_0x1ca8d8);}(_0xa87e,0x83));var _0xea87=function(_0x306f25,_0x1f40ee){_0x306f25=_0x306f25-0x0;var _0x3d3430=_0xa87e[_0x306f25];return _0x3d3430;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xea87('0x0'));var jsonpatch=require(_0xea87('0x1'));var rp=require(_0xea87('0x2'));var moment=require(_0xea87('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xea87('0x4'));var util=require(_0xea87('0x5'));var path=require(_0xea87('0x6'));var sox=require(_0xea87('0x7'));var csv=require(_0xea87('0x8'));var ejs=require(_0xea87('0x9'));var fs=require('fs');var _=require(_0xea87('0xa'));var squel=require('squel');var crypto=require(_0xea87('0xb'));var jsforce=require(_0xea87('0xc'));var deskjs=require(_0xea87('0xd'));var toCsv=require('to-csv');var querystring=require(_0xea87('0xe'));var Papa=require(_0xea87('0xf'));var Redis=require(_0xea87('0x10'));var authService=require(_0xea87('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xea87('0x12'));var hardwareService=require(_0xea87('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xea87('0x14'));var config=require('../../config/environment');var db=require(_0xea87('0x15'))['db'];config[_0xea87('0x16')]=_['defaults'](config[_0xea87('0x16')],{'host':_0xea87('0x17'),'port':0x18eb});var socket=require(_0xea87('0x18'))(new Redis(config[_0xea87('0x16')]));require('./mailQueue.socket')[_0xea87('0x19')](socket);function respondWithStatusCode(_0x50fa88,_0x208f08){_0x208f08=_0x208f08||0xcc;return function(_0x1c67c1){if(_0x1c67c1){return _0x50fa88[_0xea87('0x1a')](_0x208f08);}return _0x50fa88[_0xea87('0x1b')](_0x208f08)['end']();};}function respondWithResult(_0x294f28,_0x599bef){_0x599bef=_0x599bef||0xc8;return function(_0x30b4d6){if(_0x30b4d6){return _0x294f28[_0xea87('0x1b')](_0x599bef)[_0xea87('0x1c')](_0x30b4d6);}};}function respondWithFilteredResult(_0x40ae71,_0x286964){return function(_0x1082e5){if(_0x1082e5){var _0x4cb7ef=_0x1082e5[_0xea87('0x1d')],_0x881771=_0x286964[_0xea87('0x1e')],_0xc9503b=_0x286964[_0xea87('0x1e')]+_0x286964[_0xea87('0x1f')],_0x244cf4;if(_0xc9503b>=_0x4cb7ef){_0xc9503b=_0x4cb7ef;_0x244cf4=0xc8;}else{_0x244cf4=0xce;}_0x40ae71[_0xea87('0x1b')](_0x244cf4);return _0x40ae71[_0xea87('0x20')](_0xea87('0x21'),_0x881771+'-'+_0xc9503b+'/'+_0x4cb7ef)[_0xea87('0x1c')](_0x1082e5);}return null;};}function patchUpdates(_0x4be554){return function(_0x14dfea){try{jsonpatch[_0xea87('0x22')](_0x14dfea,_0x4be554,!![]);}catch(_0x5e1e95){return BPromise['reject'](_0x5e1e95);}return _0x14dfea['save']();};}function saveUpdates(_0x1f9480,_0x6c37aa){return function(_0x1fcc85){if(_0x1fcc85){return _0x1fcc85[_0xea87('0x23')](_0x1f9480)[_0xea87('0x24')](function(_0x38f0c5){return _0x38f0c5;});}return null;};}function removeEntity(_0x6c4080,_0x573720){return function(_0x3fce0f){if(_0x3fce0f){return _0x3fce0f['destroy']()[_0xea87('0x24')](function(){var _0x1be135=_0x3fce0f[_0xea87('0x25')]({'plain':!![]});var _0x40f68a=_0xea87('0x26');return db[_0xea87('0x27')][_0xea87('0x28')]({'where':{'type':_0x40f68a,'resourceId':_0x1be135['id']}})[_0xea87('0x24')](function(){return _0x3fce0f;});})['then'](function(){_0x6c4080[_0xea87('0x1b')](0xcc)[_0xea87('0x29')]();});}};}function handleEntityNotFound(_0x5d59e2,_0x3209de){return function(_0x123997){if(!_0x123997){_0x5d59e2[_0xea87('0x1a')](0x194);}return _0x123997;};}function handleError(_0x40bcdf,_0x5c702a){_0x5c702a=_0x5c702a||0x1f4;return function(_0xbb4694){logger[_0xea87('0x2a')](_0xbb4694[_0xea87('0x2b')]);if(_0xbb4694[_0xea87('0x2c')]){delete _0xbb4694[_0xea87('0x2c')];}_0x40bcdf[_0xea87('0x1b')](_0x5c702a)[_0xea87('0x2d')](_0xbb4694);};}exports['index']=function(_0x521b32,_0x2aef15){var _0x405310={},_0x333a01={},_0x2ecec2={'count':0x0,'rows':[]};var _0x351b61=_['map'](db['MailQueue']['rawAttributes'],function(_0x3eaec2){return{'name':_0x3eaec2['fieldName'],'type':_0x3eaec2[_0xea87('0x2e')][_0xea87('0x2f')]};});_0x333a01[_0xea87('0x30')]=_[_0xea87('0x31')](_0x351b61,_0xea87('0x2c'));_0x333a01[_0xea87('0x32')]=_[_0xea87('0x33')](_0x521b32[_0xea87('0x32')]);_0x333a01['filters']=_[_0xea87('0x34')](_0x333a01[_0xea87('0x30')],_0x333a01[_0xea87('0x32')]);_0x405310[_0xea87('0x35')]=_[_0xea87('0x34')](_0x333a01[_0xea87('0x30')],qs[_0xea87('0x36')](_0x521b32[_0xea87('0x32')][_0xea87('0x36')]));_0x405310['attributes']=_0x405310['attributes']['length']?_0x405310[_0xea87('0x35')]:_0x333a01[_0xea87('0x30')];if(!_0x521b32['query'][_0xea87('0x37')](_0xea87('0x38'))){_0x405310['limit']=qs[_0xea87('0x1f')](_0x521b32['query'][_0xea87('0x1f')]);_0x405310['offset']=qs[_0xea87('0x1e')](_0x521b32['query']['offset']);}_0x405310[_0xea87('0x39')]=qs[_0xea87('0x3a')](_0x521b32['query'][_0xea87('0x3a')]);_0x405310['where']=qs['filters'](_[_0xea87('0x3b')](_0x521b32[_0xea87('0x32')],_0x333a01[_0xea87('0x3c')]));if(_0x521b32[_0xea87('0x32')][_0xea87('0x3d')]){_0x405310[_0xea87('0x3e')]=_[_0xea87('0x3f')](_0x405310[_0xea87('0x3e')],{'$or':_[_0xea87('0x31')](_0x351b61,function(_0x4d75d2){if(_0x4d75d2[_0xea87('0x2e')]!==_0xea87('0x40')){var _0x54f9eb={};_0x54f9eb[_0x4d75d2[_0xea87('0x2c')]]={'$like':'%'+_0x521b32[_0xea87('0x32')][_0xea87('0x3d')]+'%'};return _0x54f9eb;}})});}_0x405310=_[_0xea87('0x3f')]({},_0x405310,_0x521b32[_0xea87('0x41')]);var _0x59b87f={'where':_0x405310[_0xea87('0x3e')]};return db[_0xea87('0x42')]['count'](_0x59b87f)[_0xea87('0x24')](function(_0xdcd2a1){_0x2ecec2[_0xea87('0x1d')]=_0xdcd2a1;if(_0x521b32[_0xea87('0x32')]['includeAll']){_0x405310[_0xea87('0x43')]=[{'all':!![]}];}return db['MailQueue'][_0xea87('0x44')](_0x405310);})['then'](function(_0x344e95){_0x2ecec2[_0xea87('0x45')]=_0x344e95;return _0x2ecec2;})[_0xea87('0x24')](respondWithFilteredResult(_0x2aef15,_0x405310))['catch'](handleError(_0x2aef15,null));};exports[_0xea87('0x46')]=function(_0x3ce96a,_0x11ae43){var _0x46d6ae={'raw':!![],'where':{'id':_0x3ce96a['params']['id']}},_0x5bc30f={};_0x5bc30f[_0xea87('0x30')]=_[_0xea87('0x33')](db['MailQueue'][_0xea87('0x47')]);_0x5bc30f['query']=_[_0xea87('0x33')](_0x3ce96a['query']);_0x5bc30f[_0xea87('0x3c')]=_[_0xea87('0x34')](_0x5bc30f[_0xea87('0x30')],_0x5bc30f['query']);_0x46d6ae['attributes']=_[_0xea87('0x34')](_0x5bc30f['model'],qs[_0xea87('0x36')](_0x3ce96a[_0xea87('0x32')][_0xea87('0x36')]));_0x46d6ae[_0xea87('0x35')]=_0x46d6ae['attributes'][_0xea87('0x48')]?_0x46d6ae[_0xea87('0x35')]:_0x5bc30f[_0xea87('0x30')];if(_0x3ce96a['query']['includeAll']){_0x46d6ae[_0xea87('0x43')]=[{'all':!![]}];}_0x46d6ae=_['merge']({},_0x46d6ae,_0x3ce96a['options']);return db['MailQueue'][_0xea87('0x49')](_0x46d6ae)[_0xea87('0x24')](handleEntityNotFound(_0x11ae43,null))[_0xea87('0x24')](respondWithResult(_0x11ae43,null))['catch'](handleError(_0x11ae43,null));};exports[_0xea87('0x4a')]=function(_0x281d81,_0x50b09c){return db[_0xea87('0x42')][_0xea87('0x4a')](_0x281d81['body'],{})[_0xea87('0x24')](function(_0x5b12dc){var _0x5e4bcf=_0x281d81[_0xea87('0x4b')][_0xea87('0x25')]({'plain':!![]});if(!_0x5e4bcf)throw new Error(_0xea87('0x4c'));if(_0x5e4bcf[_0xea87('0x4d')]==='user'){var _0x25ab1c=_0x5b12dc['get']({'plain':!![]});var _0x1b4110=_0xea87('0x26');return db[_0xea87('0x4e')]['find']({'where':{'name':_0x1b4110,'userProfileId':_0x5e4bcf[_0xea87('0x4f')]},'raw':!![]})[_0xea87('0x24')](function(_0x3f14e0){if(_0x3f14e0&&_0x3f14e0[_0xea87('0x50')]===0x0){return db[_0xea87('0x27')][_0xea87('0x4a')]({'name':_0x25ab1c['name'],'resourceId':_0x25ab1c['id'],'type':_0x3f14e0['name'],'sectionId':_0x3f14e0['id']},{})[_0xea87('0x24')](function(){return _0x5b12dc;});}else{return _0x5b12dc;}})[_0xea87('0x51')](function(_0x366ecb){logger[_0xea87('0x2a')](_0xea87('0x52'),_0x366ecb);throw _0x366ecb;});}return _0x5b12dc;})[_0xea87('0x24')](respondWithResult(_0x50b09c,0xc9))[_0xea87('0x51')](handleError(_0x50b09c,null));};exports[_0xea87('0x23')]=function(_0x1e4fbd,_0x4d6556){if(_0x1e4fbd['body']['id']){delete _0x1e4fbd[_0xea87('0x53')]['id'];}return db['MailQueue'][_0xea87('0x49')]({'where':{'id':_0x1e4fbd[_0xea87('0x54')]['id']}})[_0xea87('0x24')](handleEntityNotFound(_0x4d6556,null))[_0xea87('0x24')](saveUpdates(_0x1e4fbd[_0xea87('0x53')],null))[_0xea87('0x24')](respondWithResult(_0x4d6556,null))[_0xea87('0x51')](handleError(_0x4d6556,null));};exports['destroy']=function(_0x3b8dc1,_0x543b86){return db[_0xea87('0x42')]['find']({'where':{'id':_0x3b8dc1[_0xea87('0x54')]['id']}})[_0xea87('0x24')](handleEntityNotFound(_0x543b86,null))[_0xea87('0x24')](removeEntity(_0x543b86,null))['catch'](handleError(_0x543b86,null));};exports[_0xea87('0x55')]=function(_0x2a161b,_0x3e02ab){return db[_0xea87('0x42')]['describe']()['then'](respondWithResult(_0x3e02ab,null))['catch'](handleError(_0x3e02ab,null));};exports[_0xea87('0x56')]=function(_0x499035,_0x33f718,_0x3bf49a){var _0x5d0640={'raw':!![],'where':{}},_0x3fd1ba={},_0x3a54f5;return db['MailQueue'][_0xea87('0x57')]({'where':{'id':_0x499035[_0xea87('0x54')]['id']}})[_0xea87('0x24')](handleEntityNotFound(_0x33f718,null))[_0xea87('0x24')](function(_0x27370f){if(_0x27370f){_0x3a54f5=_0x27370f[_0xea87('0x25')]({'plain':!![]});_0x3fd1ba['model']=_['keys'](db[_0xea87('0x58')][_0xea87('0x47')]);_0x3fd1ba['query']=_[_0xea87('0x33')](_0x499035[_0xea87('0x32')]);_0x3fd1ba[_0xea87('0x3c')]=_[_0xea87('0x34')](_0x3fd1ba[_0xea87('0x30')],_0x3fd1ba['query']);_0x5d0640[_0xea87('0x35')]=_[_0xea87('0x34')](_0x3fd1ba[_0xea87('0x30')],qs['fields'](_0x499035[_0xea87('0x32')][_0xea87('0x36')]));_0x5d0640[_0xea87('0x35')]=_0x5d0640[_0xea87('0x35')][_0xea87('0x48')]?_0x5d0640['attributes']:_0x3fd1ba[_0xea87('0x30')];if(!_0x499035['query'][_0xea87('0x37')](_0xea87('0x38'))){_0x5d0640[_0xea87('0x1f')]=qs[_0xea87('0x1f')](_0x499035['query']['limit']);_0x5d0640[_0xea87('0x1e')]=qs['offset'](_0x499035[_0xea87('0x32')][_0xea87('0x1e')]);}_0x5d0640[_0xea87('0x39')]=qs[_0xea87('0x3a')](_0x499035[_0xea87('0x32')][_0xea87('0x3a')]);_0x5d0640[_0xea87('0x3e')]=qs['filters'](_[_0xea87('0x3b')](_0x499035[_0xea87('0x32')],_0x3fd1ba[_0xea87('0x3c')]));_0x5d0640[_0xea87('0x3e')][_0xea87('0x59')]=_0x27370f['id'];if(_0x499035[_0xea87('0x32')][_0xea87('0x3d')]){_0x5d0640[_0xea87('0x3e')]=_['merge'](_0x5d0640[_0xea87('0x3e')],{'$or':_['map'](_0x5d0640[_0xea87('0x35')],function(_0x2a449f){var _0x2af565={};_0x2af565[_0x2a449f]={'$like':'%'+_0x499035[_0xea87('0x32')][_0xea87('0x3d')]+'%'};return _0x2af565;})});}_0x5d0640=_['merge']({},_0x5d0640,_0x499035['options']);return db[_0xea87('0x58')][_0xea87('0x44')](_0x5d0640);}})[_0xea87('0x24')](function(_0x5c8c1f){if(_0x5c8c1f){return db[_0xea87('0x5a')][_0xea87('0x5b')]({'where':{'id':_[_0xea87('0x31')](_0x5c8c1f,'UserId'),'role':'agent'},'attributes':['id',_0xea87('0x2c'),_0xea87('0x5c'),_0xea87('0x5d'),_0xea87('0x5e')]});}})[_0xea87('0x24')](function(_0x51eedf){if(_0x51eedf){return{'count':_0x51eedf[_0xea87('0x1d')],'rows':_['map'](_0x51eedf[_0xea87('0x45')],function(_0x18c257){return{'membername':_0x18c257['name'],'UserId':_0x18c257['id'],'queue_name':_0x3a54f5['name'],'MailQueueId':_0x3a54f5['id'],'interface':util[_0xea87('0x5f')]('%s/%s',_0xea87('0x60'),_0x18c257['name']),'penalty':0x0,'paused':_0x18c257[_0xea87('0x5c')],'createdAt':_0x18c257[_0xea87('0x5e')],'updatedAt':_0x18c257[_0xea87('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xea87('0x24')](respondWithFilteredResult(_0x33f718,_0x5d0640))[_0xea87('0x51')](handleError(_0x33f718,null));};exports[_0xea87('0x61')]=function(_0x466200,_0x2bd61d,_0x472077){var _0x79adf0={};var _0x14638d={};var _0x3f4d70;var _0x2ccfb3;return db[_0xea87('0x42')][_0xea87('0x57')]({'where':{'id':_0x466200[_0xea87('0x54')]['id']}})['then'](handleEntityNotFound(_0x2bd61d,null))[_0xea87('0x24')](function(_0x3406a8){if(_0x3406a8){_0x3f4d70=_0x3406a8;_0x14638d['model']=_[_0xea87('0x33')](db[_0xea87('0x62')][_0xea87('0x47')]);_0x14638d[_0xea87('0x32')]=_[_0xea87('0x33')](_0x466200[_0xea87('0x32')]);_0x14638d[_0xea87('0x3c')]=_['intersection'](_0x14638d['model'],_0x14638d['query']);_0x79adf0[_0xea87('0x35')]=_[_0xea87('0x34')](_0x14638d[_0xea87('0x30')],qs[_0xea87('0x36')](_0x466200['query'][_0xea87('0x36')]));_0x79adf0[_0xea87('0x35')]=_0x79adf0['attributes'][_0xea87('0x48')]?_0x79adf0[_0xea87('0x35')]:_0x14638d['model'];_0x79adf0['order']=qs[_0xea87('0x3a')](_0x466200[_0xea87('0x32')][_0xea87('0x3a')]);_0x79adf0[_0xea87('0x3e')]=qs[_0xea87('0x3c')](_[_0xea87('0x3b')](_0x466200['query'],_0x14638d['filters']));if(_0x466200[_0xea87('0x32')][_0xea87('0x3d')]){_0x79adf0['where']=_[_0xea87('0x3f')](_0x79adf0[_0xea87('0x3e')],{'$or':_['map'](_0x79adf0[_0xea87('0x35')],function(_0x38f1da){var _0x4aff6b={};_0x4aff6b[_0x38f1da]={'$like':'%'+_0x466200['query'][_0xea87('0x3d')]+'%'};return _0x4aff6b;})});}_0x79adf0=_[_0xea87('0x3f')]({},_0x79adf0,_0x466200[_0xea87('0x41')]);return _0x3f4d70[_0xea87('0x61')](_0x79adf0);}})[_0xea87('0x24')](function(_0x387775){if(_0x387775){_0x2ccfb3=_0x387775[_0xea87('0x48')];if(!_0x466200[_0xea87('0x32')][_0xea87('0x37')]('nolimit')){_0x79adf0[_0xea87('0x1f')]=qs[_0xea87('0x1f')](_0x466200['query'][_0xea87('0x1f')]);_0x79adf0[_0xea87('0x1e')]=qs['offset'](_0x466200[_0xea87('0x32')][_0xea87('0x1e')]);}return _0x3f4d70['getTeams'](_0x79adf0);}})[_0xea87('0x24')](function(_0x801117){if(_0x801117){return _0x801117?{'count':_0x2ccfb3,'rows':_0x801117}:null;}})[_0xea87('0x24')](respondWithResult(_0x2bd61d,null))[_0xea87('0x51')](handleError(_0x2bd61d,null));};exports[_0xea87('0x63')]=function(_0x4ba7e1,_0x131d15,_0x5442e8){var _0x9319c3=_0x4ba7e1['body'][_0xea87('0x64')];return db[_0xea87('0x62')][_0xea87('0x44')]({'where':{'id':_0x9319c3},'attributes':['id'],'include':[{'model':db[_0xea87('0x5a')],'as':'Agents','attributes':['id',_0xea87('0x2c'),_0xea87('0x65'),_0xea87('0x66'),'interface'],'raw':!![]}]})[_0xea87('0x24')](function(_0x241f8c){if(_0x241f8c){var _0x3bd3e2=_[_0xea87('0x67')](_0x241f8c,function(_0x132630){var _0x2da41b=_0x132630[_0xea87('0x25')]({'plain':!![]});return _0x2da41b[_0xea87('0x68')];});return db['MailQueue'][_0xea87('0x49')]({'where':{'id':_0x4ba7e1['params']['id']}})[_0xea87('0x24')](function(_0x226afc){return db[_0xea87('0x69')][_0xea87('0x6a')](function(_0x4d6314){return _0x226afc[_0xea87('0x63')](_0x9319c3,{'transaction':_0x4d6314})[_0xea87('0x24')](function(){return BPromise[_0xea87('0x6b')](_0x3bd3e2,function(_0x362729){return db[_0xea87('0x58')]['findOrCreate']({'where':{'UserId':_0x362729['id'],'MailQueueId':_0x4ba7e1['params']['id']},'transaction':_0x4d6314});});})[_0xea87('0x24')](function(){_0x3bd3e2['forEach'](function(_0xd118f){socket[_0xea87('0x6c')](_0xea87('0x6d'),{'UserId':_0xd118f['id'],'MailQueueId':_0x226afc['id']});});});});});}})[_0xea87('0x24')](respondWithStatusCode(_0x131d15,null))[_0xea87('0x51')](handleError(_0x131d15,null));};exports[_0xea87('0x6e')]=function(_0x7a8cd9,_0x15352f,_0x4db4c0){return db[_0xea87('0x62')][_0xea87('0x44')]({'where':{'id':_0x7a8cd9[_0xea87('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0xea87('0x5a')],'as':_0xea87('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x15352f,null))['then'](function(_0x6a1f14){var _0x3a20ae=_['map'](_0x6a1f14,'id');var _0x5a909f=[];var _0x486e36=[];var _0x4c1804=squel['select']();_0x4c1804[_0xea87('0x6f')]('tq.TeamId')['from'](_0xea87('0x70'),'tq')['join'](_0xea87('0x71'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xea87('0x3e')](_0xea87('0x72'),_0x7a8cd9[_0xea87('0x54')]['id']);for(var _0x156c36=0x0;_0x156c36<_0x6a1f14[_0xea87('0x48')];_0x156c36+=0x1){let _0xfb7d69=_0x6a1f14[_0x156c36];for(var _0x385ab7=0x0;_0x385ab7<_0xfb7d69['Agents']['length'];_0x385ab7+=0x1){let _0x4df572=_0xfb7d69['Agents'][_0x385ab7];var _0xb444eb=_0x4c1804[_0xea87('0x73')]();_0xb444eb['where'](_0xea87('0x74'),_0x4df572['id']);_0x486e36['push'](db[_0xea87('0x69')][_0xea87('0x32')](_0xb444eb[_0xea87('0x75')](),{'type':db['sequelize'][_0xea87('0x76')]['SELECT']})[_0xea87('0x24')](function(_0x3495ad){if(_0x3495ad['length']===0x1){return _0x4df572['id'];}else{var _0x41bdf2=_[_0xea87('0x77')](_[_0xea87('0x31')](_0x3495ad,_0xea87('0x78')),function(_0x1cbb51){return _[_0xea87('0x79')](_0x3a20ae,_0x1cbb51);});if(_0x41bdf2){return _0x4df572['id'];}}}));}}return BPromise['all'](_0x486e36)['then'](function(_0x127237){_0x5a909f=_(_0x5a909f)[_0xea87('0x7a')](_0x127237)[_0xea87('0x7b')]()[_0xea87('0x7c')]();return db['MailQueue'][_0xea87('0x49')]({'where':{'id':_0x7a8cd9['params']['id']}})[_0xea87('0x24')](function(_0x430da6){return db['sequelize']['transaction'](function(_0x442f63){return _0x430da6[_0xea87('0x6e')](_0x7a8cd9[_0xea87('0x32')]['ids'],{'transaction':_0x442f63})['then'](function(){if(!_['isEmpty'](_0x5a909f)){return _0x430da6[_0xea87('0x7d')](_0x5a909f,{'transaction':_0x442f63});}})['then'](function(){_0x5a909f['forEach'](function(_0x23cc1a){socket['emit'](_0xea87('0x7e'),{'UserId':_0x23cc1a,'MailQueueId':_0x430da6['id']});});});});});});})[_0xea87('0x24')](respondWithStatusCode(_0x15352f,null))[_0xea87('0x51')](handleError(_0x15352f,null));};exports[_0xea87('0x7f')]=function(_0x2a8598,_0xe26bdd,_0x3d6047){return db['MailQueue'][_0xea87('0x49')]({'where':{'id':_0x2a8598[_0xea87('0x54')]['id']}})['then'](handleEntityNotFound(_0xe26bdd,null))[_0xea87('0x24')](function(_0x3b94c9){if(_0x3b94c9){return _0x3b94c9[_0xea87('0x7f')](_0x2a8598[_0xea87('0x53')][_0xea87('0x64')],_[_0xea87('0x80')](_0x2a8598['body'],[_0xea87('0x64'),'id'])||{})[_0xea87('0x81')](function(_0x42969e){for(var _0xd92a90=0x0;_0xd92a90<_0x2a8598[_0xea87('0x53')][_0xea87('0x64')][_0xea87('0x48')];_0xd92a90+=0x1){socket[_0xea87('0x6c')](_0xea87('0x6d'),{'UserId':_0x2a8598['body'][_0xea87('0x64')][_0xd92a90],'MailQueueId':_0x2a8598[_0xea87('0x54')]['id']});}return _0x42969e;});}})[_0xea87('0x24')](respondWithResult(_0xe26bdd,null))[_0xea87('0x51')](handleError(_0xe26bdd,null));};exports[_0xea87('0x7d')]=function(_0x42bc50,_0x304107,_0x5eba44){return db[_0xea87('0x42')][_0xea87('0x49')]({'where':{'id':_0x42bc50[_0xea87('0x54')]['id']}})[_0xea87('0x24')](handleEntityNotFound(_0x304107,null))['then'](function(_0x50694a){if(_0x50694a){return _0x50694a['removeAgents'](_0x42bc50[_0xea87('0x32')][_0xea87('0x64')])[_0xea87('0x24')](function(){if(_[_0xea87('0x82')](_0x42bc50[_0xea87('0x32')][_0xea87('0x64')])){for(var _0x1a5c32=0x0;_0x1a5c32<_0x42bc50[_0xea87('0x32')][_0xea87('0x64')][_0xea87('0x48')];_0x1a5c32+=0x1){socket['emit'](_0xea87('0x7e'),{'UserId':Number(_0x42bc50[_0xea87('0x32')][_0xea87('0x64')][_0x1a5c32]),'MailQueueId':Number(_0x42bc50[_0xea87('0x54')]['id'])});}}else{socket[_0xea87('0x6c')](_0xea87('0x7e'),{'UserId':Number(_0x42bc50['query']['ids']),'MailQueueId':Number(_0x42bc50[_0xea87('0x54')]['id'])});}});}})[_0xea87('0x24')](respondWithStatusCode(_0x304107,null))['catch'](handleError(_0x304107,null));};exports['getAgents']=function(_0x8bc3d4,_0x356fc9,_0x4ac0f9){var _0x164f13={};var _0x41172d={};var _0x16f4c4;var _0x10644d;return db[_0xea87('0x42')][_0xea87('0x57')]({'where':{'id':_0x8bc3d4[_0xea87('0x54')]['id']}})[_0xea87('0x24')](handleEntityNotFound(_0x356fc9,null))[_0xea87('0x24')](function(_0x4c323a){if(_0x4c323a){_0x16f4c4=_0x4c323a;_0x41172d[_0xea87('0x30')]=_[_0xea87('0x33')](db['User'][_0xea87('0x47')]);_0x41172d[_0xea87('0x32')]=_[_0xea87('0x33')](_0x8bc3d4[_0xea87('0x32')]);_0x41172d[_0xea87('0x3c')]=_[_0xea87('0x34')](_0x41172d[_0xea87('0x30')],_0x41172d[_0xea87('0x32')]);_0x164f13['attributes']=_[_0xea87('0x34')](_0x41172d[_0xea87('0x30')],qs['fields'](_0x8bc3d4[_0xea87('0x32')]['fields']));_0x164f13[_0xea87('0x35')]=_0x164f13['attributes']['length']?_0x164f13['attributes']:_0x41172d[_0xea87('0x30')];_0x164f13[_0xea87('0x39')]=qs[_0xea87('0x3a')](_0x8bc3d4[_0xea87('0x32')][_0xea87('0x3a')]);_0x164f13[_0xea87('0x3e')]=qs[_0xea87('0x3c')](_['pick'](_0x8bc3d4['query'],_0x41172d[_0xea87('0x3c')]));if(_0x8bc3d4['query']['filter']){_0x164f13[_0xea87('0x3e')]=_[_0xea87('0x3f')](_0x164f13[_0xea87('0x3e')],{'$or':_[_0xea87('0x31')](_0x164f13[_0xea87('0x35')],function(_0x470a3e){var _0x430f0f={};_0x430f0f[_0x470a3e]={'$like':'%'+_0x8bc3d4[_0xea87('0x32')][_0xea87('0x3d')]+'%'};return _0x430f0f;})});}_0x164f13=_[_0xea87('0x3f')]({},_0x164f13,_0x8bc3d4['options']);return _0x16f4c4[_0xea87('0x83')](_0x164f13);}})['then'](function(_0x58afff){if(_0x58afff){_0x10644d=_0x58afff[_0xea87('0x48')];if(!_0x8bc3d4[_0xea87('0x32')][_0xea87('0x37')](_0xea87('0x38'))){_0x164f13[_0xea87('0x1f')]=qs[_0xea87('0x1f')](_0x8bc3d4[_0xea87('0x32')][_0xea87('0x1f')]);_0x164f13[_0xea87('0x1e')]=qs['offset'](_0x8bc3d4[_0xea87('0x32')][_0xea87('0x1e')]);}return _0x16f4c4[_0xea87('0x83')](_0x164f13);}})[_0xea87('0x24')](function(_0x25c025){if(_0x25c025){return _0x25c025?{'count':_0x10644d,'rows':_0x25c025}:null;}})['then'](respondWithResult(_0x356fc9,null))[_0xea87('0x51')](handleError(_0x356fc9,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index a9f7020..71a33b6 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 _0xa223=['hasOwnProperty','hook','exports','../../mysqldb','MailQueue','setMaxListeners','save','remove','emit'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xa223,0x150));var _0x3a22=function(_0x5f0a47,_0x29f049){_0x5f0a47=_0x5f0a47-0x0;var _0x1752ae=_0xa223[_0x5f0a47];return _0x1752ae;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x3a22('0x0'))['db'][_0x3a22('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x3a22('0x2')](0x0);var events={'afterCreate':_0x3a22('0x3'),'afterUpdate':'update','afterDestroy':_0x3a22('0x4')};function emitEvent(_0x2f9f2c){return function(_0x4910d4,_0xc481e9,_0x10fae7){MailQueueEvents['emit'](_0x2f9f2c+':'+_0x4910d4['id'],_0x4910d4);MailQueueEvents[_0x3a22('0x5')](_0x2f9f2c,_0x4910d4);_0x10fae7(null);};}for(var e in events){if(events[_0x3a22('0x6')](e)){var event=events[e];MailQueue[_0x3a22('0x7')](e,emitEvent(event));}}module[_0x3a22('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x5e8e=['MailQueue','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x34651f,_0x1b07dd){var _0x2d88fe=function(_0x1bc817){while(--_0x1bc817){_0x34651f['push'](_0x34651f['shift']());}};_0x2d88fe(++_0x1b07dd);}(_0x5e8e,0x193));var _0xe5e8=function(_0x24724b,_0x134d50){_0x24724b=_0x24724b-0x0;var _0x481080=_0x5e8e[_0x24724b];return _0x481080;};'use strict';var EventEmitter=require(_0xe5e8('0x0'));var MailQueue=require(_0xe5e8('0x1'))['db'][_0xe5e8('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe5e8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe5e8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3c514e){return function(_0x31852b,_0x337425,_0x4eb7d7){MailQueueEvents[_0xe5e8('0x5')](_0x3c514e+':'+_0x31852b['id'],_0x31852b);MailQueueEvents[_0xe5e8('0x5')](_0x3c514e,_0x31852b);_0x4eb7d7(null);};}for(var e in events){if(events[_0xe5e8('0x6')](e)){var event=events[e];MailQueue[_0xe5e8('0x7')](e,emitEvent(event));}}module[_0xe5e8('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 9bd365f..916a55d 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 _0xee72=['define','MailQueue','mail_queues','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./mailQueue.attributes','exports'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0xee72,0x123));var _0x2ee7=function(_0x52131e,_0x324857){_0x52131e=_0x52131e-0x0;var _0x3b8e2d=_0xee72[_0x52131e];return _0x3b8e2d;};'use strict';var _=require('lodash');var util=require(_0x2ee7('0x0'));var logger=require(_0x2ee7('0x1'))(_0x2ee7('0x2'));var moment=require(_0x2ee7('0x3'));var BPromise=require(_0x2ee7('0x4'));var rp=require(_0x2ee7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2ee7('0x6'));var config=require('../../config/environment');var attributes=require(_0x2ee7('0x7'));module[_0x2ee7('0x8')]=function(_0x4526ef,_0x458023){return _0x4526ef[_0x2ee7('0x9')](_0x2ee7('0xa'),attributes,{'tableName':_0x2ee7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec1b=['../../config/environment','exports','MailQueue','mail_queues','lodash','util','moment','request-promise','path','rimraf'];(function(_0x309ffc,_0x2c1378){var _0x2a6bc1=function(_0x5bfe11){while(--_0x5bfe11){_0x309ffc['push'](_0x309ffc['shift']());}};_0x2a6bc1(++_0x2c1378);}(_0xec1b,0x7c));var _0xbec1=function(_0x373ba3,_0x265ccc){_0x373ba3=_0x373ba3-0x0;var _0x151f21=_0xec1b[_0x373ba3];return _0x151f21;};'use strict';var _=require(_0xbec1('0x0'));var util=require(_0xbec1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbec1('0x2'));var BPromise=require('bluebird');var rp=require(_0xbec1('0x3'));var fs=require('fs');var path=require(_0xbec1('0x4'));var rimraf=require(_0xbec1('0x5'));var config=require(_0xbec1('0x6'));var attributes=require('./mailQueue.attributes');module[_0xbec1('0x7')]=function(_0x223523,_0x2f1719){return _0x223523['define'](_0xbec1('0x8'),attributes,{'tableName':_0xbec1('0x9'),'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 47a96d7..6d79723 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 _0x0613=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailQueue','options','raw','where','attributes','include','map','model','GetMailQueue','find','ShowMailQueue','util','moment','bluebird','randomstring','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0613,0x133));var _0x3061=function(_0x3dd567,_0x276ca9){_0x3dd567=_0x3dd567-0x0;var _0x415024=_0x0613[_0x3dd567];return _0x415024;};'use strict';var _=require('lodash');var util=require(_0x3061('0x0'));var moment=require(_0x3061('0x1'));var BPromise=require(_0x3061('0x2'));var rs=require(_0x3061('0x3'));var fs=require('fs');var Redis=require(_0x3061('0x4'));var db=require(_0x3061('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3061('0x6'))(_0x3061('0x7'));var config=require(_0x3061('0x8'));var jayson=require(_0x3061('0x9'));var client=jayson['client'][_0x3061('0xa')]({'port':0x232a});config[_0x3061('0xb')]=_[_0x3061('0xc')](config[_0x3061('0xb')],{'host':_0x3061('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3061('0xb')]));require(_0x3061('0xe'))['register'](socket);function respondWithRpcPromise(_0x282fb9,_0x4dd679,_0x13e824){return new BPromise(function(_0xb6d4a4,_0x3163e9){return client[_0x3061('0xf')](_0x282fb9,_0x13e824)[_0x3061('0x10')](function(_0x5168dc){logger[_0x3061('0x11')](_0x3061('0x12'),_0x4dd679,'request\x20sent');logger[_0x3061('0x13')](_0x3061('0x14'),_0x4dd679,_0x3061('0x15'),JSON[_0x3061('0x16')](_0x5168dc));if(_0x5168dc[_0x3061('0x17')]){if(_0x5168dc['error'][_0x3061('0x18')]===0x1f4){logger[_0x3061('0x17')]('MailQueue,\x20%s,\x20%s',_0x4dd679,_0x5168dc['error'][_0x3061('0x19')]);return _0x3163e9(_0x5168dc[_0x3061('0x17')][_0x3061('0x19')]);}logger[_0x3061('0x17')]('MailQueue,\x20%s,\x20%s',_0x4dd679,_0x5168dc[_0x3061('0x17')][_0x3061('0x19')]);return _0xb6d4a4(_0x5168dc[_0x3061('0x17')][_0x3061('0x19')]);}else{logger[_0x3061('0x11')](_0x3061('0x12'),_0x4dd679,'request\x20sent');_0xb6d4a4(_0x5168dc[_0x3061('0x1a')][_0x3061('0x19')]);}})[_0x3061('0x1b')](function(_0x20ffc9){logger[_0x3061('0x17')](_0x3061('0x12'),_0x4dd679,_0x20ffc9);_0x3163e9(_0x20ffc9);});});}exports['GetMailQueue']=function(_0x204b6f){var _0xa881f6=this;return new Promise(function(_0x356df7,_0x5075ea){return db[_0x3061('0x1c')]['findAll']({'raw':_0x204b6f[_0x3061('0x1d')]?_0x204b6f[_0x3061('0x1d')][_0x3061('0x1e')]===undefined?!![]:![]:!![],'where':_0x204b6f[_0x3061('0x1d')]?_0x204b6f[_0x3061('0x1d')][_0x3061('0x1f')]||null:null,'attributes':_0x204b6f['options']?_0x204b6f[_0x3061('0x1d')][_0x3061('0x20')]||null:null,'limit':_0x204b6f[_0x3061('0x1d')]?_0x204b6f[_0x3061('0x1d')]['limit']||null:null,'include':_0x204b6f['options']?_0x204b6f[_0x3061('0x1d')][_0x3061('0x21')]?_[_0x3061('0x22')](_0x204b6f[_0x3061('0x1d')]['include'],function(_0x21f435){return{'model':db[_0x21f435[_0x3061('0x23')]],'as':_0x21f435['as'],'attributes':_0x21f435['attributes'],'include':_0x21f435[_0x3061('0x21')]?_['map'](_0x21f435[_0x3061('0x21')],function(_0xc628fc){return{'model':db[_0xc628fc[_0x3061('0x23')]],'as':_0xc628fc['as'],'attributes':_0xc628fc[_0x3061('0x20')],'include':_0xc628fc[_0x3061('0x21')]?_[_0x3061('0x22')](_0xc628fc[_0x3061('0x21')],function(_0x41663a){return{'model':db[_0x41663a[_0x3061('0x23')]],'as':_0x41663a['as'],'attributes':_0x41663a[_0x3061('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3061('0x10')](function(_0x1dd142){logger[_0x3061('0x11')]('GetMailQueue',_0x204b6f);logger['debug'](_0x3061('0x24'),_0x204b6f,JSON[_0x3061('0x16')](_0x1dd142));_0x356df7(_0x1dd142);})[_0x3061('0x1b')](function(_0x362508){logger['error'](_0x3061('0x24'),_0x362508[_0x3061('0x19')],_0x204b6f);_0x5075ea(_0xa881f6[_0x3061('0x17')](0x1f4,_0x362508[_0x3061('0x19')]));});});};exports['ShowMailQueue']=function(_0x28d8cd){var _0x33ee6a=this;return new Promise(function(_0x5643ca,_0x330929){return db['MailQueue'][_0x3061('0x25')]({'raw':_0x28d8cd['options']?_0x28d8cd['options'][_0x3061('0x1e')]===undefined?!![]:![]:!![],'where':_0x28d8cd[_0x3061('0x1d')]?_0x28d8cd[_0x3061('0x1d')][_0x3061('0x1f')]||null:null,'attributes':_0x28d8cd['options']?_0x28d8cd[_0x3061('0x1d')][_0x3061('0x20')]||null:null,'include':_0x28d8cd[_0x3061('0x1d')]?_0x28d8cd[_0x3061('0x1d')]['include']?_[_0x3061('0x22')](_0x28d8cd[_0x3061('0x1d')][_0x3061('0x21')],function(_0x51d1c9){return{'model':db[_0x51d1c9['model']],'as':_0x51d1c9['as'],'attributes':_0x51d1c9[_0x3061('0x20')],'include':_0x51d1c9[_0x3061('0x21')]?_['map'](_0x51d1c9[_0x3061('0x21')],function(_0x7a0ec8){return{'model':db[_0x7a0ec8[_0x3061('0x23')]],'as':_0x7a0ec8['as'],'attributes':_0x7a0ec8['attributes'],'include':_0x7a0ec8[_0x3061('0x21')]?_['map'](_0x7a0ec8['include'],function(_0x228eba){return{'model':db[_0x228eba['model']],'as':_0x228eba['as'],'attributes':_0x228eba['attributes']};}):[]};}):[]};}):[]:[]})[_0x3061('0x10')](function(_0x40948e){logger[_0x3061('0x11')](_0x3061('0x26'),_0x28d8cd);logger['debug']('ShowMailQueue',_0x28d8cd,JSON[_0x3061('0x16')](_0x40948e));_0x5643ca(_0x40948e);})[_0x3061('0x1b')](function(_0x2d7ce2){logger[_0x3061('0x17')](_0x3061('0x26'),_0x2d7ce2[_0x3061('0x19')],_0x28d8cd);_0x330929(_0x33ee6a[_0x3061('0x17')](0x1f4,_0x2d7ce2[_0x3061('0x19')]));});});}; \ No newline at end of file +var _0xdddf=['limit','include','map','model','then','ShowMailQueue','find','raw','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailQueue','MailQueue','findAll','options','where'];(function(_0x49f116,_0x5ddff1){var _0x5421a3=function(_0x11ef82){while(--_0x11ef82){_0x49f116['push'](_0x49f116['shift']());}};_0x5421a3(++_0x5ddff1);}(_0xdddf,0x17a));var _0xfddd=function(_0x5dd9f6,_0x1ffa37){_0x5dd9f6=_0x5dd9f6-0x0;var _0x1243d4=_0xdddf[_0x5dd9f6];return _0x1243d4;};'use strict';var _=require(_0xfddd('0x0'));var util=require(_0xfddd('0x1'));var moment=require(_0xfddd('0x2'));var BPromise=require(_0xfddd('0x3'));var rs=require(_0xfddd('0x4'));var fs=require('fs');var Redis=require(_0xfddd('0x5'));var db=require(_0xfddd('0x6'))['db'];var utils=require(_0xfddd('0x7'));var logger=require('../../config/logger')(_0xfddd('0x8'));var config=require('../../config/environment');var jayson=require(_0xfddd('0x9'));var client=jayson[_0xfddd('0xa')][_0xfddd('0xb')]({'port':0x232a});config[_0xfddd('0xc')]=_[_0xfddd('0xd')](config['redis'],{'host':_0xfddd('0xe'),'port':0x18eb});var socket=require(_0xfddd('0xf'))(new Redis(config[_0xfddd('0xc')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4de914,_0xdff2a9,_0x44d81b){return new BPromise(function(_0x5632b5,_0x35c1b8){return client[_0xfddd('0x10')](_0x4de914,_0x44d81b)['then'](function(_0x5e4b0a){logger[_0xfddd('0x11')](_0xfddd('0x12'),_0xdff2a9,_0xfddd('0x13'));logger[_0xfddd('0x14')](_0xfddd('0x15'),_0xdff2a9,'request\x20sent',JSON[_0xfddd('0x16')](_0x5e4b0a));if(_0x5e4b0a[_0xfddd('0x17')]){if(_0x5e4b0a[_0xfddd('0x17')]['code']===0x1f4){logger[_0xfddd('0x17')](_0xfddd('0x12'),_0xdff2a9,_0x5e4b0a[_0xfddd('0x17')][_0xfddd('0x18')]);return _0x35c1b8(_0x5e4b0a['error']['message']);}logger['error'](_0xfddd('0x12'),_0xdff2a9,_0x5e4b0a[_0xfddd('0x17')][_0xfddd('0x18')]);return _0x5632b5(_0x5e4b0a[_0xfddd('0x17')]['message']);}else{logger['info'](_0xfddd('0x12'),_0xdff2a9,_0xfddd('0x13'));_0x5632b5(_0x5e4b0a[_0xfddd('0x19')]['message']);}})[_0xfddd('0x1a')](function(_0x50dd4f){logger[_0xfddd('0x17')](_0xfddd('0x12'),_0xdff2a9,_0x50dd4f);_0x35c1b8(_0x50dd4f);});});}exports[_0xfddd('0x1b')]=function(_0x3994bd){var _0x5e6682=this;return new Promise(function(_0x1f5549,_0x3a507a){return db[_0xfddd('0x1c')][_0xfddd('0x1d')]({'raw':_0x3994bd['options']?_0x3994bd[_0xfddd('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3994bd[_0xfddd('0x1e')]?_0x3994bd[_0xfddd('0x1e')][_0xfddd('0x1f')]||null:null,'attributes':_0x3994bd[_0xfddd('0x1e')]?_0x3994bd[_0xfddd('0x1e')]['attributes']||null:null,'limit':_0x3994bd[_0xfddd('0x1e')]?_0x3994bd[_0xfddd('0x1e')][_0xfddd('0x20')]||null:null,'include':_0x3994bd[_0xfddd('0x1e')]?_0x3994bd['options'][_0xfddd('0x21')]?_[_0xfddd('0x22')](_0x3994bd['options']['include'],function(_0x295c8c){return{'model':db[_0x295c8c[_0xfddd('0x23')]],'as':_0x295c8c['as'],'attributes':_0x295c8c['attributes'],'include':_0x295c8c['include']?_[_0xfddd('0x22')](_0x295c8c[_0xfddd('0x21')],function(_0x112567){return{'model':db[_0x112567[_0xfddd('0x23')]],'as':_0x112567['as'],'attributes':_0x112567['attributes'],'include':_0x112567[_0xfddd('0x21')]?_[_0xfddd('0x22')](_0x112567[_0xfddd('0x21')],function(_0x360140){return{'model':db[_0x360140[_0xfddd('0x23')]],'as':_0x360140['as'],'attributes':_0x360140['attributes']};}):[]};}):[]};}):[]:[]})[_0xfddd('0x24')](function(_0x44bc79){logger[_0xfddd('0x11')](_0xfddd('0x1b'),_0x3994bd);logger[_0xfddd('0x14')](_0xfddd('0x1b'),_0x3994bd,JSON['stringify'](_0x44bc79));_0x1f5549(_0x44bc79);})[_0xfddd('0x1a')](function(_0x212f33){logger[_0xfddd('0x17')](_0xfddd('0x1b'),_0x212f33[_0xfddd('0x18')],_0x3994bd);_0x3a507a(_0x5e6682[_0xfddd('0x17')](0x1f4,_0x212f33['message']));});});};exports[_0xfddd('0x25')]=function(_0x52d3af){var _0x565568=this;return new Promise(function(_0x16c4e7,_0x5dfe53){return db['MailQueue'][_0xfddd('0x26')]({'raw':_0x52d3af['options']?_0x52d3af[_0xfddd('0x1e')][_0xfddd('0x27')]===undefined?!![]:![]:!![],'where':_0x52d3af[_0xfddd('0x1e')]?_0x52d3af[_0xfddd('0x1e')]['where']||null:null,'attributes':_0x52d3af[_0xfddd('0x1e')]?_0x52d3af[_0xfddd('0x1e')]['attributes']||null:null,'include':_0x52d3af[_0xfddd('0x1e')]?_0x52d3af[_0xfddd('0x1e')][_0xfddd('0x21')]?_['map'](_0x52d3af[_0xfddd('0x1e')]['include'],function(_0x12c3f3){return{'model':db[_0x12c3f3[_0xfddd('0x23')]],'as':_0x12c3f3['as'],'attributes':_0x12c3f3[_0xfddd('0x28')],'include':_0x12c3f3[_0xfddd('0x21')]?_[_0xfddd('0x22')](_0x12c3f3[_0xfddd('0x21')],function(_0x372857){return{'model':db[_0x372857[_0xfddd('0x23')]],'as':_0x372857['as'],'attributes':_0x372857[_0xfddd('0x28')],'include':_0x372857[_0xfddd('0x21')]?_[_0xfddd('0x22')](_0x372857[_0xfddd('0x21')],function(_0x50685b){return{'model':db[_0x50685b[_0xfddd('0x23')]],'as':_0x50685b['as'],'attributes':_0x50685b['attributes']};}):[]};}):[]};}):[]:[]})[_0xfddd('0x24')](function(_0x3ef5cc){logger[_0xfddd('0x11')](_0xfddd('0x25'),_0x52d3af);logger[_0xfddd('0x14')](_0xfddd('0x25'),_0x52d3af,JSON[_0xfddd('0x16')](_0x3ef5cc));_0x16c4e7(_0x3ef5cc);})[_0xfddd('0x1a')](function(_0x52456b){logger[_0xfddd('0x17')]('ShowMailQueue',_0x52456b[_0xfddd('0x18')],_0x52d3af);_0x5dfe53(_0x565568[_0xfddd('0x17')](0x1f4,_0x52456b['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 26fab5d..53c4503 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 _0x0aaf=['emit','length','mailQueue:','./mailQueue.events','save','update'];(function(_0x26586c,_0x2a227d){var _0x3efff0=function(_0x585bad){while(--_0x585bad){_0x26586c['push'](_0x26586c['shift']());}};_0x3efff0(++_0x2a227d);}(_0x0aaf,0x69));var _0xf0aa=function(_0x3fad5a,_0x2d3b02){_0x3fad5a=_0x3fad5a-0x0;var _0x4ca713=_0x0aaf[_0x3fad5a];return _0x4ca713;};'use strict';var MailQueueEvents=require(_0xf0aa('0x0'));var events=[_0xf0aa('0x1'),'remove',_0xf0aa('0x2')];function createListener(_0x184b9d,_0x27cf6c){return function(_0x407ba2){_0x27cf6c[_0xf0aa('0x3')](_0x184b9d,_0x407ba2);};}function removeListener(_0x45f93d,_0x4be259){return function(){MailQueueEvents['removeListener'](_0x45f93d,_0x4be259);};}exports['register']=function(_0x5a0e10){for(var _0x121cea=0x0,_0x389fa4=events[_0xf0aa('0x4')];_0x121cea<_0x389fa4;_0x121cea++){var _0x37e1f6=events[_0x121cea];var _0x49e4c9=createListener(_0xf0aa('0x5')+_0x37e1f6,_0x5a0e10);MailQueueEvents['on'](_0x37e1f6,_0x49e4c9);}}; \ No newline at end of file +var _0xd701=['removeListener','mailQueue:','./mailQueue.events','save','remove','update','emit'];(function(_0x8dbf2d,_0x1abfa4){var _0x160088=function(_0x1a1c64){while(--_0x1a1c64){_0x8dbf2d['push'](_0x8dbf2d['shift']());}};_0x160088(++_0x1abfa4);}(_0xd701,0x95));var _0x1d70=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xd701[_0x36eaaa];return _0x461349;};'use strict';var MailQueueEvents=require(_0x1d70('0x0'));var events=[_0x1d70('0x1'),_0x1d70('0x2'),_0x1d70('0x3')];function createListener(_0x195b13,_0x4eddb0){return function(_0x3dea8f){_0x4eddb0[_0x1d70('0x4')](_0x195b13,_0x3dea8f);};}function removeListener(_0x18f082,_0x8e0d19){return function(){MailQueueEvents[_0x1d70('0x5')](_0x18f082,_0x8e0d19);};}exports['register']=function(_0x253b3e){for(var _0x75a227=0x0,_0x2d299d=events['length'];_0x75a227<_0x2d299d;_0x75a227++){var _0x3c042a=events[_0x75a227];var _0x4b0ea4=createListener(_0x1d70('0x6')+_0x3c042a,_0x253b3e);MailQueueEvents['on'](_0x3c042a,_0x4b0ea4);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 3eaa903..dd2a5f8 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 _0xa52e=['../../components/interaction/service','./mailQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','update','delete','exports','util','path','connect-timeout','express'];(function(_0x43790f,_0x471b2f){var _0x4a50a1=function(_0x98ce2){while(--_0x98ce2){_0x43790f['push'](_0x43790f['shift']());}};_0x4a50a1(++_0x471b2f);}(_0xa52e,0x18c));var _0xea52=function(_0x5b7010,_0x25982d){_0x5b7010=_0x5b7010-0x0;var _0x4ddb9a=_0xa52e[_0x5b7010];return _0x4ddb9a;};'use strict';var multer=require('multer');var util=require(_0xea52('0x0'));var path=require(_0xea52('0x1'));var timeout=require(_0xea52('0x2'));var express=require(_0xea52('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xea52('0x4'));var config=require('../../config/environment');var controller=require(_0xea52('0x5'));router[_0xea52('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xea52('0x7'),auth[_0xea52('0x8')](),controller[_0xea52('0x9')]);router[_0xea52('0x6')](_0xea52('0xa'),auth[_0xea52('0x8')](),controller[_0xea52('0xb')]);router[_0xea52('0xc')]('/',auth[_0xea52('0x8')](),controller['create']);router['put'](_0xea52('0xa'),auth['isAuthenticated'](),controller[_0xea52('0xd')]);router[_0xea52('0xe')](_0xea52('0xa'),auth[_0xea52('0x8')](),controller['destroy']);module[_0xea52('0xf')]=router; \ No newline at end of file +var _0x3020=['get','isAuthenticated','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','index'];(function(_0x10d4f4,_0x188372){var _0x184be5=function(_0x2d92bd){while(--_0x2d92bd){_0x10d4f4['push'](_0x10d4f4['shift']());}};_0x184be5(++_0x188372);}(_0x3020,0xc4));var _0x0302=function(_0x577d55,_0x17683c){_0x577d55=_0x577d55-0x0;var _0xde170=_0x3020[_0x577d55];return _0xde170;};'use strict';var multer=require(_0x0302('0x0'));var util=require(_0x0302('0x1'));var path=require(_0x0302('0x2'));var timeout=require('connect-timeout');var express=require(_0x0302('0x3'));var router=express[_0x0302('0x4')]();var auth=require(_0x0302('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0302('0x6'));var controller=require('./mailQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0302('0x7')]);router[_0x0302('0x8')]('/describe',auth[_0x0302('0x9')](),controller['describe']);router['get'](_0x0302('0xa'),auth[_0x0302('0x9')](),controller[_0x0302('0xb')]);router[_0x0302('0xc')]('/',auth[_0x0302('0x9')](),controller[_0x0302('0xd')]);router[_0x0302('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x0302('0xa'),auth[_0x0302('0x9')](),controller[_0x0302('0xf')]);module[_0x0302('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index ced32d0..d02413e 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 _0x6421=['sequelize','exports','STRING','DATE'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6421,0x1a8));var _0x1642=function(_0x41d752,_0x181727){_0x41d752=_0x41d752-0x0;var _0x30e55c=_0x6421[_0x41d752];return _0x30e55c;};'use strict';var moment=require('moment');var Sequelize=require(_0x1642('0x0'));module[_0x1642('0x1')]={'uniqueid':{'type':Sequelize[_0x1642('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1642('0x2')]},'joinAt':{'type':Sequelize[_0x1642('0x3')]},'leaveAt':{'type':Sequelize[_0x1642('0x3')]},'acceptAt':{'type':Sequelize[_0x1642('0x3')]},'exitAt':{'type':Sequelize[_0x1642('0x3')]},'reason':{'type':Sequelize[_0x1642('0x2')]}}; \ No newline at end of file +var _0xe21d=['exports','STRING','DATE','moment','sequelize'];(function(_0x305c31,_0x466b17){var _0x17f39f=function(_0x53ae03){while(--_0x53ae03){_0x305c31['push'](_0x305c31['shift']());}};_0x17f39f(++_0x466b17);}(_0xe21d,0x148));var _0xde21=function(_0x2397ea,_0x3cd83e){_0x2397ea=_0x2397ea-0x0;var _0x1636f8=_0xe21d[_0x2397ea];return _0x1636f8;};'use strict';var moment=require(_0xde21('0x0'));var Sequelize=require(_0xde21('0x1'));module[_0xde21('0x2')]={'uniqueid':{'type':Sequelize[_0xde21('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xde21('0x3')]},'joinAt':{'type':Sequelize[_0xde21('0x4')]},'leaveAt':{'type':Sequelize[_0xde21('0x4')]},'acceptAt':{'type':Sequelize[_0xde21('0x4')]},'exitAt':{'type':Sequelize[_0xde21('0x4')]},'reason':{'type':Sequelize[_0xde21('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 9d14511..7893a37 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 _0x3ed2=['rawAttributes','type','model','query','keys','intersection','fields','attributes','length','nolimit','limit','order','sort','filters','filter','merge','where','then','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','MailQueueReport'];(function(_0x1757f2,_0x1b09fa){var _0x5e7212=function(_0x4f1794){while(--_0x4f1794){_0x1757f2['push'](_0x1757f2['shift']());}};_0x5e7212(++_0x1b09fa);}(_0x3ed2,0xfc));var _0x23ed=function(_0x4649c4,_0x4c8c1a){_0x4649c4=_0x4649c4-0x0;var _0x4166e2=_0x3ed2[_0x4649c4];return _0x4166e2;};'use strict';var pdf=require(_0x23ed('0x0'));var emlformat=require(_0x23ed('0x1'));var rimraf=require(_0x23ed('0x2'));var zipdir=require(_0x23ed('0x3'));var jsonpatch=require(_0x23ed('0x4'));var rp=require('request-promise');var moment=require(_0x23ed('0x5'));var BPromise=require(_0x23ed('0x6'));var Mustache=require(_0x23ed('0x7'));var util=require(_0x23ed('0x8'));var path=require(_0x23ed('0x9'));var sox=require(_0x23ed('0xa'));var csv=require(_0x23ed('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x23ed('0xc'));var squel=require(_0x23ed('0xd'));var crypto=require(_0x23ed('0xe'));var jsforce=require(_0x23ed('0xf'));var deskjs=require(_0x23ed('0x10'));var toCsv=require('to-csv');var querystring=require(_0x23ed('0x11'));var Papa=require(_0x23ed('0x12'));var Redis=require(_0x23ed('0x13'));var authService=require(_0x23ed('0x14'));var qs=require(_0x23ed('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x23ed('0x16'));var logger=require(_0x23ed('0x17'))(_0x23ed('0x18'));var utils=require(_0x23ed('0x19'));var config=require('../../config/environment');var db=require(_0x23ed('0x1a'))['db'];function respondWithStatusCode(_0xe83379,_0x10886a){_0x10886a=_0x10886a||0xcc;return function(_0x289e64){if(_0x289e64){return _0xe83379[_0x23ed('0x1b')](_0x10886a);}return _0xe83379[_0x23ed('0x1c')](_0x10886a)[_0x23ed('0x1d')]();};}function respondWithResult(_0xd75bf5,_0x40ddc7){_0x40ddc7=_0x40ddc7||0xc8;return function(_0x288086){if(_0x288086){return _0xd75bf5[_0x23ed('0x1c')](_0x40ddc7)[_0x23ed('0x1e')](_0x288086);}};}function respondWithFilteredResult(_0x50d153,_0x217f10){return function(_0x5cd68a){if(_0x5cd68a){var _0x3210c1=_0x5cd68a[_0x23ed('0x1f')],_0x458e7b=_0x217f10[_0x23ed('0x20')],_0x32d20d=_0x217f10[_0x23ed('0x20')]+_0x217f10['limit'],_0x330fc3;if(_0x32d20d>=_0x3210c1){_0x32d20d=_0x3210c1;_0x330fc3=0xc8;}else{_0x330fc3=0xce;}_0x50d153[_0x23ed('0x1c')](_0x330fc3);return _0x50d153['set'](_0x23ed('0x21'),_0x458e7b+'-'+_0x32d20d+'/'+_0x3210c1)['json'](_0x5cd68a);}return null;};}function patchUpdates(_0x45d17a){return function(_0x358af8){try{jsonpatch[_0x23ed('0x22')](_0x358af8,_0x45d17a,!![]);}catch(_0x5d3c86){return BPromise[_0x23ed('0x23')](_0x5d3c86);}return _0x358af8[_0x23ed('0x24')]();};}function saveUpdates(_0x1c492b,_0x3b392c){return function(_0x3a44cf){if(_0x3a44cf){return _0x3a44cf['update'](_0x1c492b)['then'](function(_0x19d96c){return _0x19d96c;});}return null;};}function removeEntity(_0x582b88,_0x5aa653){return function(_0xd8b994){if(_0xd8b994){return _0xd8b994[_0x23ed('0x25')]()['then'](function(){_0x582b88['status'](0xcc)[_0x23ed('0x1d')]();});}};}function handleEntityNotFound(_0x3b7de9,_0x1b3651){return function(_0xec3bef){if(!_0xec3bef){_0x3b7de9[_0x23ed('0x1b')](0x194);}return _0xec3bef;};}function handleError(_0x37ea3e,_0x16c083){_0x16c083=_0x16c083||0x1f4;return function(_0x16a94b){logger['error'](_0x16a94b[_0x23ed('0x26')]);if(_0x16a94b[_0x23ed('0x27')]){delete _0x16a94b[_0x23ed('0x27')];}_0x37ea3e['status'](_0x16c083)[_0x23ed('0x28')](_0x16a94b);};}exports[_0x23ed('0x29')]=function(_0x244005,_0x2d338b){var _0x31f1bf={},_0x37be5d={},_0x33005d={'count':0x0,'rows':[]};var _0x26f309=_[_0x23ed('0x2a')](db[_0x23ed('0x2b')][_0x23ed('0x2c')],function(_0x4c3ccc){return{'name':_0x4c3ccc['fieldName'],'type':_0x4c3ccc[_0x23ed('0x2d')]['key']};});_0x37be5d[_0x23ed('0x2e')]=_[_0x23ed('0x2a')](_0x26f309,_0x23ed('0x27'));_0x37be5d[_0x23ed('0x2f')]=_[_0x23ed('0x30')](_0x244005[_0x23ed('0x2f')]);_0x37be5d['filters']=_['intersection'](_0x37be5d[_0x23ed('0x2e')],_0x37be5d[_0x23ed('0x2f')]);_0x31f1bf['attributes']=_[_0x23ed('0x31')](_0x37be5d[_0x23ed('0x2e')],qs[_0x23ed('0x32')](_0x244005[_0x23ed('0x2f')][_0x23ed('0x32')]));_0x31f1bf[_0x23ed('0x33')]=_0x31f1bf[_0x23ed('0x33')][_0x23ed('0x34')]?_0x31f1bf[_0x23ed('0x33')]:_0x37be5d[_0x23ed('0x2e')];if(!_0x244005[_0x23ed('0x2f')]['hasOwnProperty'](_0x23ed('0x35'))){_0x31f1bf[_0x23ed('0x36')]=qs['limit'](_0x244005[_0x23ed('0x2f')][_0x23ed('0x36')]);_0x31f1bf[_0x23ed('0x20')]=qs[_0x23ed('0x20')](_0x244005[_0x23ed('0x2f')][_0x23ed('0x20')]);}_0x31f1bf[_0x23ed('0x37')]=qs[_0x23ed('0x38')](_0x244005[_0x23ed('0x2f')][_0x23ed('0x38')]);_0x31f1bf['where']=qs[_0x23ed('0x39')](_['pick'](_0x244005[_0x23ed('0x2f')],_0x37be5d['filters']));if(_0x244005['query'][_0x23ed('0x3a')]){_0x31f1bf['where']=_[_0x23ed('0x3b')](_0x31f1bf['where'],{'$or':_[_0x23ed('0x2a')](_0x26f309,function(_0x220cc6){if(_0x220cc6[_0x23ed('0x2d')]!=='VIRTUAL'){var _0x529c29={};_0x529c29[_0x220cc6[_0x23ed('0x27')]]={'$like':'%'+_0x244005['query'][_0x23ed('0x3a')]+'%'};return _0x529c29;}})});}_0x31f1bf=_[_0x23ed('0x3b')]({},_0x31f1bf,_0x244005['options']);var _0x8b66da={'where':_0x31f1bf[_0x23ed('0x3c')]};return db[_0x23ed('0x2b')][_0x23ed('0x1f')](_0x8b66da)[_0x23ed('0x3d')](function(_0xa71853){_0x33005d['count']=_0xa71853;if(_0x244005[_0x23ed('0x2f')][_0x23ed('0x3e')]){_0x31f1bf[_0x23ed('0x3f')]=[{'all':!![]}];}return db[_0x23ed('0x2b')][_0x23ed('0x40')](_0x31f1bf);})['then'](function(_0x57dce2){_0x33005d[_0x23ed('0x41')]=_0x57dce2;return _0x33005d;})['then'](respondWithFilteredResult(_0x2d338b,_0x31f1bf))[_0x23ed('0x42')](handleError(_0x2d338b,null));};exports[_0x23ed('0x43')]=function(_0x525345,_0x18dcbb){var _0x4a9178={'raw':!![],'where':{'id':_0x525345['params']['id']}},_0x411758={};_0x411758[_0x23ed('0x2e')]=_['keys'](db['MailQueueReport'][_0x23ed('0x2c')]);_0x411758[_0x23ed('0x2f')]=_[_0x23ed('0x30')](_0x525345[_0x23ed('0x2f')]);_0x411758['filters']=_[_0x23ed('0x31')](_0x411758[_0x23ed('0x2e')],_0x411758[_0x23ed('0x2f')]);_0x4a9178[_0x23ed('0x33')]=_['intersection'](_0x411758[_0x23ed('0x2e')],qs['fields'](_0x525345['query'][_0x23ed('0x32')]));_0x4a9178[_0x23ed('0x33')]=_0x4a9178[_0x23ed('0x33')]['length']?_0x4a9178[_0x23ed('0x33')]:_0x411758[_0x23ed('0x2e')];if(_0x525345['query'][_0x23ed('0x3e')]){_0x4a9178[_0x23ed('0x3f')]=[{'all':!![]}];}_0x4a9178=_[_0x23ed('0x3b')]({},_0x4a9178,_0x525345['options']);return db[_0x23ed('0x2b')][_0x23ed('0x44')](_0x4a9178)[_0x23ed('0x3d')](handleEntityNotFound(_0x18dcbb,null))[_0x23ed('0x3d')](respondWithResult(_0x18dcbb,null))['catch'](handleError(_0x18dcbb,null));};exports[_0x23ed('0x45')]=function(_0x9b9509,_0x27c949){return db[_0x23ed('0x2b')][_0x23ed('0x45')](_0x9b9509[_0x23ed('0x46')],{})[_0x23ed('0x3d')](respondWithResult(_0x27c949,0xc9))[_0x23ed('0x42')](handleError(_0x27c949,null));};exports[_0x23ed('0x47')]=function(_0x34f1ff,_0x576392){if(_0x34f1ff[_0x23ed('0x46')]['id']){delete _0x34f1ff[_0x23ed('0x46')]['id'];}return db[_0x23ed('0x2b')][_0x23ed('0x44')]({'where':{'id':_0x34f1ff['params']['id']}})['then'](handleEntityNotFound(_0x576392,null))[_0x23ed('0x3d')](saveUpdates(_0x34f1ff['body'],null))[_0x23ed('0x3d')](respondWithResult(_0x576392,null))[_0x23ed('0x42')](handleError(_0x576392,null));};exports[_0x23ed('0x25')]=function(_0x4e350f,_0x46605f){return db[_0x23ed('0x2b')]['find']({'where':{'id':_0x4e350f[_0x23ed('0x48')]['id']}})[_0x23ed('0x3d')](handleEntityNotFound(_0x46605f,null))['then'](removeEntity(_0x46605f,null))[_0x23ed('0x42')](handleError(_0x46605f,null));};exports[_0x23ed('0x49')]=function(_0x47a816,_0x181579){return db[_0x23ed('0x2b')]['describe']()[_0x23ed('0x3d')](respondWithResult(_0x181579,null))[_0x23ed('0x42')](handleError(_0x181579,null));}; \ No newline at end of file +var _0xb196=['then','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update'];(function(_0x41e3a0,_0x50046a){var _0x2b908d=function(_0x3d55b0){while(--_0x3d55b0){_0x41e3a0['push'](_0x41e3a0['shift']());}};_0x2b908d(++_0x50046a);}(_0xb196,0xbe));var _0x6b19=function(_0x397df4,_0x3272fd){_0x397df4=_0x397df4-0x0;var _0x5c8ed9=_0xb196[_0x397df4];return _0x5c8ed9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6b19('0x0'));var rimraf=require(_0x6b19('0x1'));var zipdir=require(_0x6b19('0x2'));var jsonpatch=require(_0x6b19('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6b19('0x4'));var Mustache=require(_0x6b19('0x5'));var util=require(_0x6b19('0x6'));var path=require('path');var sox=require(_0x6b19('0x7'));var csv=require(_0x6b19('0x8'));var ejs=require(_0x6b19('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b19('0xa'));var jsforce=require(_0x6b19('0xb'));var deskjs=require(_0x6b19('0xc'));var toCsv=require(_0x6b19('0x8'));var querystring=require(_0x6b19('0xd'));var Papa=require('papaparse');var Redis=require(_0x6b19('0xe'));var authService=require(_0x6b19('0xf'));var qs=require(_0x6b19('0x10'));var as=require(_0x6b19('0x11'));var hardwareService=require(_0x6b19('0x12'));var logger=require(_0x6b19('0x13'))(_0x6b19('0x14'));var utils=require(_0x6b19('0x15'));var config=require(_0x6b19('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e2edb,_0x87d7af){_0x87d7af=_0x87d7af||0xcc;return function(_0x4d863c){if(_0x4d863c){return _0x5e2edb[_0x6b19('0x17')](_0x87d7af);}return _0x5e2edb[_0x6b19('0x18')](_0x87d7af)[_0x6b19('0x19')]();};}function respondWithResult(_0xd1336a,_0x8a0a0e){_0x8a0a0e=_0x8a0a0e||0xc8;return function(_0x462abd){if(_0x462abd){return _0xd1336a[_0x6b19('0x18')](_0x8a0a0e)[_0x6b19('0x1a')](_0x462abd);}};}function respondWithFilteredResult(_0x279066,_0x4bea3c){return function(_0x6f7f19){if(_0x6f7f19){var _0x34826f=_0x6f7f19[_0x6b19('0x1b')],_0x379dfb=_0x4bea3c[_0x6b19('0x1c')],_0xaf3e9d=_0x4bea3c['offset']+_0x4bea3c[_0x6b19('0x1d')],_0x13c9f1;if(_0xaf3e9d>=_0x34826f){_0xaf3e9d=_0x34826f;_0x13c9f1=0xc8;}else{_0x13c9f1=0xce;}_0x279066['status'](_0x13c9f1);return _0x279066[_0x6b19('0x1e')](_0x6b19('0x1f'),_0x379dfb+'-'+_0xaf3e9d+'/'+_0x34826f)['json'](_0x6f7f19);}return null;};}function patchUpdates(_0x6aca3d){return function(_0x3d9860){try{jsonpatch[_0x6b19('0x20')](_0x3d9860,_0x6aca3d,!![]);}catch(_0x2255fe){return BPromise[_0x6b19('0x21')](_0x2255fe);}return _0x3d9860['save']();};}function saveUpdates(_0x1d4154,_0x1164a5){return function(_0x27f331){if(_0x27f331){return _0x27f331[_0x6b19('0x22')](_0x1d4154)[_0x6b19('0x23')](function(_0x29adc2){return _0x29adc2;});}return null;};}function removeEntity(_0x83422,_0xf9641){return function(_0x10e298){if(_0x10e298){return _0x10e298['destroy']()[_0x6b19('0x23')](function(){_0x83422[_0x6b19('0x18')](0xcc)[_0x6b19('0x19')]();});}};}function handleEntityNotFound(_0x464a45,_0x4e3f85){return function(_0x511d7b){if(!_0x511d7b){_0x464a45[_0x6b19('0x17')](0x194);}return _0x511d7b;};}function handleError(_0x325d3f,_0x3e9b40){_0x3e9b40=_0x3e9b40||0x1f4;return function(_0x105360){logger[_0x6b19('0x24')](_0x105360[_0x6b19('0x25')]);if(_0x105360[_0x6b19('0x26')]){delete _0x105360['name'];}_0x325d3f['status'](_0x3e9b40)[_0x6b19('0x27')](_0x105360);};}exports[_0x6b19('0x28')]=function(_0x2946bc,_0x3a6a70){var _0x359f57={},_0x257002={},_0x5a7a4f={'count':0x0,'rows':[]};var _0x57a6b2=_[_0x6b19('0x29')](db[_0x6b19('0x2a')][_0x6b19('0x2b')],function(_0x758cc0){return{'name':_0x758cc0[_0x6b19('0x2c')],'type':_0x758cc0['type'][_0x6b19('0x2d')]};});_0x257002[_0x6b19('0x2e')]=_[_0x6b19('0x29')](_0x57a6b2,_0x6b19('0x26'));_0x257002[_0x6b19('0x2f')]=_['keys'](_0x2946bc['query']);_0x257002[_0x6b19('0x30')]=_[_0x6b19('0x31')](_0x257002[_0x6b19('0x2e')],_0x257002[_0x6b19('0x2f')]);_0x359f57['attributes']=_['intersection'](_0x257002[_0x6b19('0x2e')],qs[_0x6b19('0x32')](_0x2946bc[_0x6b19('0x2f')][_0x6b19('0x32')]));_0x359f57[_0x6b19('0x33')]=_0x359f57[_0x6b19('0x33')]['length']?_0x359f57[_0x6b19('0x33')]:_0x257002['model'];if(!_0x2946bc['query'][_0x6b19('0x34')](_0x6b19('0x35'))){_0x359f57[_0x6b19('0x1d')]=qs[_0x6b19('0x1d')](_0x2946bc['query'][_0x6b19('0x1d')]);_0x359f57[_0x6b19('0x1c')]=qs[_0x6b19('0x1c')](_0x2946bc[_0x6b19('0x2f')]['offset']);}_0x359f57['order']=qs[_0x6b19('0x36')](_0x2946bc[_0x6b19('0x2f')]['sort']);_0x359f57['where']=qs[_0x6b19('0x30')](_[_0x6b19('0x37')](_0x2946bc['query'],_0x257002['filters']));if(_0x2946bc[_0x6b19('0x2f')][_0x6b19('0x38')]){_0x359f57['where']=_['merge'](_0x359f57[_0x6b19('0x39')],{'$or':_[_0x6b19('0x29')](_0x57a6b2,function(_0x3fc4e){if(_0x3fc4e[_0x6b19('0x3a')]!==_0x6b19('0x3b')){var _0x1960d0={};_0x1960d0[_0x3fc4e[_0x6b19('0x26')]]={'$like':'%'+_0x2946bc['query']['filter']+'%'};return _0x1960d0;}})});}_0x359f57=_[_0x6b19('0x3c')]({},_0x359f57,_0x2946bc[_0x6b19('0x3d')]);var _0xe6e12a={'where':_0x359f57['where']};return db[_0x6b19('0x2a')][_0x6b19('0x1b')](_0xe6e12a)['then'](function(_0x312ee1){_0x5a7a4f[_0x6b19('0x1b')]=_0x312ee1;if(_0x2946bc[_0x6b19('0x2f')][_0x6b19('0x3e')]){_0x359f57[_0x6b19('0x3f')]=[{'all':!![]}];}return db[_0x6b19('0x2a')][_0x6b19('0x40')](_0x359f57);})[_0x6b19('0x23')](function(_0x5207cb){_0x5a7a4f['rows']=_0x5207cb;return _0x5a7a4f;})[_0x6b19('0x23')](respondWithFilteredResult(_0x3a6a70,_0x359f57))[_0x6b19('0x41')](handleError(_0x3a6a70,null));};exports[_0x6b19('0x42')]=function(_0x31f1ff,_0x1e1111){var _0x324419={'raw':!![],'where':{'id':_0x31f1ff[_0x6b19('0x43')]['id']}},_0x524bc0={};_0x524bc0[_0x6b19('0x2e')]=_[_0x6b19('0x44')](db[_0x6b19('0x2a')][_0x6b19('0x2b')]);_0x524bc0[_0x6b19('0x2f')]=_[_0x6b19('0x44')](_0x31f1ff[_0x6b19('0x2f')]);_0x524bc0[_0x6b19('0x30')]=_['intersection'](_0x524bc0[_0x6b19('0x2e')],_0x524bc0[_0x6b19('0x2f')]);_0x324419[_0x6b19('0x33')]=_['intersection'](_0x524bc0[_0x6b19('0x2e')],qs[_0x6b19('0x32')](_0x31f1ff[_0x6b19('0x2f')][_0x6b19('0x32')]));_0x324419[_0x6b19('0x33')]=_0x324419[_0x6b19('0x33')][_0x6b19('0x45')]?_0x324419['attributes']:_0x524bc0['model'];if(_0x31f1ff[_0x6b19('0x2f')][_0x6b19('0x3e')]){_0x324419[_0x6b19('0x3f')]=[{'all':!![]}];}_0x324419=_[_0x6b19('0x3c')]({},_0x324419,_0x31f1ff[_0x6b19('0x3d')]);return db[_0x6b19('0x2a')][_0x6b19('0x46')](_0x324419)['then'](handleEntityNotFound(_0x1e1111,null))[_0x6b19('0x23')](respondWithResult(_0x1e1111,null))[_0x6b19('0x41')](handleError(_0x1e1111,null));};exports['create']=function(_0x374c74,_0x30a5ce){return db[_0x6b19('0x2a')][_0x6b19('0x47')](_0x374c74[_0x6b19('0x48')],{})['then'](respondWithResult(_0x30a5ce,0xc9))[_0x6b19('0x41')](handleError(_0x30a5ce,null));};exports[_0x6b19('0x22')]=function(_0x578465,_0x29fce1){if(_0x578465[_0x6b19('0x48')]['id']){delete _0x578465['body']['id'];}return db[_0x6b19('0x2a')][_0x6b19('0x46')]({'where':{'id':_0x578465[_0x6b19('0x43')]['id']}})['then'](handleEntityNotFound(_0x29fce1,null))[_0x6b19('0x23')](saveUpdates(_0x578465['body'],null))['then'](respondWithResult(_0x29fce1,null))[_0x6b19('0x41')](handleError(_0x29fce1,null));};exports[_0x6b19('0x49')]=function(_0x34def2,_0x47c119){return db['MailQueueReport'][_0x6b19('0x46')]({'where':{'id':_0x34def2['params']['id']}})[_0x6b19('0x23')](handleEntityNotFound(_0x47c119,null))[_0x6b19('0x23')](removeEntity(_0x47c119,null))[_0x6b19('0x41')](handleError(_0x47c119,null));};exports[_0x6b19('0x4a')]=function(_0x41857f,_0xbe240a){return db[_0x6b19('0x2a')][_0x6b19('0x4a')]()['then'](respondWithResult(_0xbe240a,null))[_0x6b19('0x41')](handleError(_0xbe240a,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index b500f74..0c9bb61 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 _0x2eb1=['path','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0xe947,_0x26e99f){var _0x79efb1=function(_0x56f321){while(--_0x56f321){_0xe947['push'](_0xe947['shift']());}};_0x79efb1(++_0x26e99f);}(_0x2eb1,0xb0));var _0x12eb=function(_0x1ed5c5,_0x132155){_0x1ed5c5=_0x1ed5c5-0x0;var _0x1af3fa=_0x2eb1[_0x1ed5c5];return _0x1af3fa;};'use strict';var _=require(_0x12eb('0x0'));var util=require(_0x12eb('0x1'));var logger=require('../../config/logger')(_0x12eb('0x2'));var moment=require(_0x12eb('0x3'));var BPromise=require(_0x12eb('0x4'));var rp=require(_0x12eb('0x5'));var fs=require('fs');var path=require(_0x12eb('0x6'));var rimraf=require('rimraf');var config=require(_0x12eb('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x12eb('0x8')]=function(_0x261315,_0x19cdd2){return _0x261315[_0x12eb('0x9')](_0x12eb('0xa'),attributes,{'tableName':_0x12eb('0xb'),'paranoid':![],'indexes':[{'name':_0x12eb('0xc'),'fields':[_0x12eb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3b79=['util','../../config/logger','api','moment','path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash'];(function(_0x31285d,_0x28f6b7){var _0x308a9b=function(_0x251c75){while(--_0x251c75){_0x31285d['push'](_0x31285d['shift']());}};_0x308a9b(++_0x28f6b7);}(_0x3b79,0xb5));var _0x93b7=function(_0xf755e1,_0x1cbbd2){_0xf755e1=_0xf755e1-0x0;var _0x184ad6=_0x3b79[_0xf755e1];return _0x184ad6;};'use strict';var _=require(_0x93b7('0x0'));var util=require(_0x93b7('0x1'));var logger=require(_0x93b7('0x2'))(_0x93b7('0x3'));var moment=require(_0x93b7('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x93b7('0x5'));var rimraf=require(_0x93b7('0x6'));var config=require('../../config/environment');var attributes=require(_0x93b7('0x7'));module[_0x93b7('0x8')]=function(_0x210600,_0x52d760){return _0x210600[_0x93b7('0x9')](_0x93b7('0xa'),attributes,{'tableName':_0x93b7('0xb'),'paranoid':![],'indexes':[{'name':_0x93b7('0xc'),'fields':[_0x93b7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 94fea8b..6da70e6 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 _0xafc4=['info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateMailQueueReport','MailQueueReport','body','options','raw','debug','UpdateMailQueueReport','update','attributes','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then'];(function(_0x1ebe53,_0x35cc29){var _0x56cb47=function(_0x1fc9fc){while(--_0x1fc9fc){_0x1ebe53['push'](_0x1ebe53['shift']());}};_0x56cb47(++_0x35cc29);}(_0xafc4,0x69));var _0x4afc=function(_0x3cd7bf,_0x2b6472){_0x3cd7bf=_0x3cd7bf-0x0;var _0x3ee6b9=_0xafc4[_0x3cd7bf];return _0x3ee6b9;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('MailQueueReport,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('MailQueueReport,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});}exports[_0x4afc('0x14')]=function(_0x22f809){var _0x3ad418=this;return new Promise(function(_0x16365f,_0x135349){return db[_0x4afc('0x15')]['create'](_0x22f809[_0x4afc('0x16')],{'raw':_0x22f809[_0x4afc('0x17')]?_0x22f809[_0x4afc('0x17')][_0x4afc('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3bddc0){logger[_0x4afc('0xb')](_0x4afc('0x14'),_0x22f809);logger[_0x4afc('0x19')](_0x4afc('0x14'),_0x22f809,JSON[_0x4afc('0xe')](_0x3bddc0));_0x16365f(_0x3bddc0);})[_0x4afc('0x13')](function(_0x573a75){logger[_0x4afc('0xf')](_0x4afc('0x14'),_0x573a75['message'],_0x22f809);_0x135349(_0x3ad418[_0x4afc('0xf')](0x1f4,_0x573a75['message']));});});};exports[_0x4afc('0x1a')]=function(_0x2a0314){var _0x1e454e=this;return new Promise(function(_0x2876f2,_0x86dbd4){return db[_0x4afc('0x15')][_0x4afc('0x1b')](_0x2a0314[_0x4afc('0x16')],{'raw':_0x2a0314[_0x4afc('0x17')]?_0x2a0314[_0x4afc('0x17')][_0x4afc('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a0314[_0x4afc('0x17')]?_0x2a0314[_0x4afc('0x17')]['where']||null:null,'attributes':_0x2a0314[_0x4afc('0x17')]?_0x2a0314[_0x4afc('0x17')][_0x4afc('0x1c')]||null:null,'limit':_0x2a0314['options']?_0x2a0314['options']['limit']||null:null})[_0x4afc('0xa')](function(_0x5db47e){logger['info'](_0x4afc('0x1a'),_0x2a0314);logger[_0x4afc('0x19')]('UpdateMailQueueReport',_0x2a0314,JSON['stringify'](_0x5db47e));_0x2876f2(_0x5db47e);})['catch'](function(_0x3bae1a){logger[_0x4afc('0xf')](_0x4afc('0x1a'),_0x3bae1a[_0x4afc('0x11')],_0x2a0314);_0x86dbd4(_0x1e454e[_0x4afc('0xf')](0x1f4,_0x3bae1a[_0x4afc('0x11')]));});});}; \ No newline at end of file +var _0x3f8a=['code','message','info','result','catch','CreateMailQueueReport','create','body','options','UpdateMailQueueReport','MailQueueReport','update','where','limit','lodash','util','moment','bluebird','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','stringify','error'];(function(_0x16c425,_0x3c95d3){var _0x4bb082=function(_0x50f8fa){while(--_0x50f8fa){_0x16c425['push'](_0x16c425['shift']());}};_0x4bb082(++_0x3c95d3);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x26132e,_0x5c7869){_0x26132e=_0x26132e-0x0;var _0x7cca72=_0x3f8a[_0x26132e];return _0x7cca72;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('MailQueueReport,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});}exports[_0xa3f8('0x1a')]=function(_0x2cb49f){var _0x267e73=this;return new Promise(function(_0x54b870,_0x3ad8cd){return db['MailQueueReport'][_0xa3f8('0x1b')](_0x2cb49f[_0xa3f8('0x1c')],{'raw':_0x2cb49f[_0xa3f8('0x1d')]?_0x2cb49f[_0xa3f8('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xa3f8('0xe')](function(_0x5b0d57){logger[_0xa3f8('0x17')]('CreateMailQueueReport',_0x2cb49f);logger[_0xa3f8('0x11')](_0xa3f8('0x1a'),_0x2cb49f,JSON[_0xa3f8('0x13')](_0x5b0d57));_0x54b870(_0x5b0d57);})[_0xa3f8('0x19')](function(_0x3a6a57){logger[_0xa3f8('0x14')](_0xa3f8('0x1a'),_0x3a6a57['message'],_0x2cb49f);_0x3ad8cd(_0x267e73[_0xa3f8('0x14')](0x1f4,_0x3a6a57['message']));});});};exports[_0xa3f8('0x1e')]=function(_0xa5a697){var _0x24985a=this;return new Promise(function(_0x37b290,_0x24ead6){return db[_0xa3f8('0x1f')][_0xa3f8('0x20')](_0xa5a697[_0xa3f8('0x1c')],{'raw':_0xa5a697[_0xa3f8('0x1d')]?_0xa5a697[_0xa3f8('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa5a697[_0xa3f8('0x1d')]?_0xa5a697[_0xa3f8('0x1d')][_0xa3f8('0x21')]||null:null,'attributes':_0xa5a697['options']?_0xa5a697[_0xa3f8('0x1d')]['attributes']||null:null,'limit':_0xa5a697[_0xa3f8('0x1d')]?_0xa5a697[_0xa3f8('0x1d')][_0xa3f8('0x22')]||null:null})['then'](function(_0x458824){logger['info'](_0xa3f8('0x1e'),_0xa5a697);logger[_0xa3f8('0x11')](_0xa3f8('0x1e'),_0xa5a697,JSON[_0xa3f8('0x13')](_0x458824));_0x37b290(_0x458824);})[_0xa3f8('0x19')](function(_0x3bf3f8){logger[_0xa3f8('0x14')](_0xa3f8('0x1e'),_0x3bf3f8[_0xa3f8('0x16')],_0xa5a697);_0x24ead6(_0x24985a[_0xa3f8('0x14')](0x1f4,_0x3bf3f8[_0xa3f8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index fb44991..5fb75ec 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 _0xb715=['connect-timeout','express','../../components/auth/service','../../config/environment','exports','util'];(function(_0x46ec65,_0x4cfbaf){var _0x1dc36f=function(_0x30b82f){while(--_0x30b82f){_0x46ec65['push'](_0x46ec65['shift']());}};_0x1dc36f(++_0x4cfbaf);}(_0xb715,0x16d));var _0x5b71=function(_0x247443,_0x5d8c01){_0x247443=_0x247443-0x0;var _0x59ee08=_0xb715[_0x247443];return _0x59ee08;};'use strict';var multer=require('multer');var util=require(_0x5b71('0x0'));var path=require('path');var timeout=require(_0x5b71('0x1'));var express=require(_0x5b71('0x2'));var router=express['Router']();var auth=require(_0x5b71('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5b71('0x4'));module[_0x5b71('0x5')]=router; \ No newline at end of file +var _0x9e81=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path','connect-timeout','express'];(function(_0x4c06a3,_0x1e6b6f){var _0x7ff53c=function(_0x559eff){while(--_0x559eff){_0x4c06a3['push'](_0x4c06a3['shift']());}};_0x7ff53c(++_0x1e6b6f);}(_0x9e81,0xf8));var _0x19e8=function(_0x4bedce,_0x265ebf){_0x4bedce=_0x4bedce-0x0;var _0x4fd2fb=_0x9e81[_0x4bedce];return _0x4fd2fb;};'use strict';var multer=require('multer');var util=require(_0x19e8('0x0'));var path=require(_0x19e8('0x1'));var timeout=require(_0x19e8('0x2'));var express=require(_0x19e8('0x3'));var router=express[_0x19e8('0x4')]();var auth=require(_0x19e8('0x5'));var interaction=require(_0x19e8('0x6'));var config=require(_0x19e8('0x7'));module[_0x19e8('0x8')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index de9be01..d31bd43 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 _0x1784=['INTEGER','INBOX','exports','STRING'];(function(_0x8bea6d,_0x979bdd){var _0x593a97=function(_0x5d3dd0){while(--_0x5d3dd0){_0x8bea6d['push'](_0x8bea6d['shift']());}};_0x593a97(++_0x979bdd);}(_0x1784,0xaa));var _0x4178=function(_0xe406e8,_0x2dbfd8){_0xe406e8=_0xe406e8-0x0;var _0x3f8fbe=_0x1784[_0xe406e8];return _0x3f8fbe;};'use strict';var Sequelize=require('sequelize');module[_0x4178('0x0')]={'description':{'type':Sequelize[_0x4178('0x1')]},'host':{'type':Sequelize[_0x4178('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x4178('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x4178('0x1')]},'port':{'type':Sequelize[_0x4178('0x2')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x4178('0x1')],'defaultValue':_0x4178('0x3')},'connTimeout':{'type':Sequelize[_0x4178('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x4178('0x1')]}}; \ No newline at end of file +var _0x70c2=['username','INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x4df337,_0x3bf41d){var _0x4a1c4e=function(_0x248214){while(--_0x248214){_0x4df337['push'](_0x4df337['shift']());}};_0x4a1c4e(++_0x3bf41d);}(_0x70c2,0x1e2));var _0x270c=function(_0x4e9ae6,_0x274399){_0x4e9ae6=_0x4e9ae6-0x0;var _0x27255d=_0x70c2[_0x4e9ae6];return _0x27255d;};'use strict';var Sequelize=require(_0x270c('0x0'));module[_0x270c('0x1')]={'description':{'type':Sequelize[_0x270c('0x2')]},'host':{'type':Sequelize[_0x270c('0x2')]},'authentication':{'type':Sequelize[_0x270c('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x270c('0x2')],'unique':_0x270c('0x4')},'password':{'type':Sequelize[_0x270c('0x2')]},'port':{'type':Sequelize[_0x270c('0x5')]},'tls':{'type':Sequelize[_0x270c('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x270c('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x270c('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x270c('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x270c('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 7d29535..1a14066 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 _0x96cc=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in'];(function(_0x527957,_0x5ddfb4){var _0x48b5c0=function(_0x4f8d5c){while(--_0x4f8d5c){_0x527957['push'](_0x527957['shift']());}};_0x48b5c0(++_0x5ddfb4);}(_0x96cc,0x16c));var _0xc96c=function(_0x5be956,_0x33900b){_0x5be956=_0x5be956-0x0;var _0x3de158=_0x96cc[_0x5be956];return _0x3de158;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var logger=require(_0xc96c('0x1'))('api');var moment=require(_0xc96c('0x2'));var BPromise=require(_0xc96c('0x3'));var rp=require(_0xc96c('0x4'));var fs=require('fs');var path=require(_0xc96c('0x5'));var rimraf=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var attributes=require(_0xc96c('0x8'));module[_0xc96c('0x9')]=function(_0x3b7f45,_0x5142cd){return _0x3b7f45[_0xc96c('0xa')](_0xc96c('0xb'),attributes,{'tableName':_0xc96c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b0e=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','MailServerIn','mail_servers_in','lodash','util'];(function(_0x5e6cb1,_0x30ae58){var _0x361b2f=function(_0x34d16f){while(--_0x34d16f){_0x5e6cb1['push'](_0x5e6cb1['shift']());}};_0x361b2f(++_0x30ae58);}(_0x1b0e,0x132));var _0xe1b0=function(_0x6ec2c7,_0x2dd285){_0x6ec2c7=_0x6ec2c7-0x0;var _0x5555ec=_0x1b0e[_0x6ec2c7];return _0x5555ec;};'use strict';var _=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var logger=require(_0xe1b0('0x2'))(_0xe1b0('0x3'));var moment=require(_0xe1b0('0x4'));var BPromise=require(_0xe1b0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe1b0('0x6'));var config=require(_0xe1b0('0x7'));var attributes=require('./mailServerIn.attributes');module[_0xe1b0('0x8')]=function(_0x2a049f,_0xfb57ae){return _0x2a049f['define'](_0xe1b0('0x9'),attributes,{'tableName':_0xe1b0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 8cad717..7407181 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 _0x0d0a=['then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xdb3583,_0x231513){var _0x441656=function(_0x396701){while(--_0x396701){_0xdb3583['push'](_0xdb3583['shift']());}};_0x441656(++_0x231513);}(_0x0d0a,0x155));var _0xa0d0=function(_0x109874,_0x125a13){_0x109874=_0x109874-0x0;var _0x34d588=_0x0d0a[_0x109874];return _0x34d588;};'use strict';var _=require(_0xa0d0('0x0'));var util=require(_0xa0d0('0x1'));var moment=require('moment');var BPromise=require(_0xa0d0('0x2'));var rs=require(_0xa0d0('0x3'));var fs=require('fs');var Redis=require(_0xa0d0('0x4'));var db=require(_0xa0d0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa0d0('0x6'));var config=require(_0xa0d0('0x7'));var jayson=require(_0xa0d0('0x8'));var client=jayson[_0xa0d0('0x9')][_0xa0d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17ecd8,_0x5843fa,_0x52b116){return new BPromise(function(_0x61c692,_0x309fb2){return client['request'](_0x17ecd8,_0x52b116)[_0xa0d0('0xb')](function(_0x5bde00){logger[_0xa0d0('0xc')](_0xa0d0('0xd'),_0x5843fa,'request\x20sent');logger[_0xa0d0('0xe')](_0xa0d0('0xf'),_0x5843fa,_0xa0d0('0x10'),JSON['stringify'](_0x5bde00));if(_0x5bde00[_0xa0d0('0x11')]){if(_0x5bde00[_0xa0d0('0x11')]['code']===0x1f4){logger[_0xa0d0('0x11')](_0xa0d0('0xd'),_0x5843fa,_0x5bde00['error'][_0xa0d0('0x12')]);return _0x309fb2(_0x5bde00[_0xa0d0('0x11')][_0xa0d0('0x12')]);}logger[_0xa0d0('0x11')]('MailServerIn,\x20%s,\x20%s',_0x5843fa,_0x5bde00[_0xa0d0('0x11')]['message']);return _0x61c692(_0x5bde00[_0xa0d0('0x11')]['message']);}else{logger['info'](_0xa0d0('0xd'),_0x5843fa,_0xa0d0('0x10'));_0x61c692(_0x5bde00[_0xa0d0('0x13')][_0xa0d0('0x12')]);}})[_0xa0d0('0x14')](function(_0x5a73d4){logger['error'](_0xa0d0('0xd'),_0x5843fa,_0x5a73d4);_0x309fb2(_0x5a73d4);});});}exports[_0xa0d0('0x15')]=function(_0x102245){var _0x4e95e5=this;return new Promise(function(_0x5995ae,_0x21fdba){return db[_0xa0d0('0x16')][_0xa0d0('0x17')]({'raw':_0x102245['options']?_0x102245[_0xa0d0('0x18')][_0xa0d0('0x19')]===undefined?!![]:![]:!![],'where':_0x102245[_0xa0d0('0x18')]?_0x102245[_0xa0d0('0x18')][_0xa0d0('0x1a')]||null:null,'attributes':_0x102245[_0xa0d0('0x18')]?_0x102245[_0xa0d0('0x18')][_0xa0d0('0x1b')]||null:null,'limit':_0x102245[_0xa0d0('0x18')]?_0x102245[_0xa0d0('0x18')][_0xa0d0('0x1c')]||null:null,'include':_0x102245[_0xa0d0('0x18')]?_0x102245[_0xa0d0('0x18')][_0xa0d0('0x1d')]?_['map'](_0x102245[_0xa0d0('0x18')][_0xa0d0('0x1d')],function(_0x5726f3){return{'model':db[_0x5726f3[_0xa0d0('0x1e')]],'as':_0x5726f3['as'],'attributes':_0x5726f3['attributes'],'include':_0x5726f3[_0xa0d0('0x1d')]?_[_0xa0d0('0x1f')](_0x5726f3[_0xa0d0('0x1d')],function(_0x5a99c9){return{'model':db[_0x5a99c9['model']],'as':_0x5a99c9['as'],'attributes':_0x5a99c9[_0xa0d0('0x1b')],'include':_0x5a99c9[_0xa0d0('0x1d')]?_['map'](_0x5a99c9['include'],function(_0x453fa0){return{'model':db[_0x453fa0[_0xa0d0('0x1e')]],'as':_0x453fa0['as'],'attributes':_0x453fa0['attributes']};}):[]};}):[]};}):[]:[]})[_0xa0d0('0xb')](function(_0x52d89b){logger[_0xa0d0('0xc')]('GetMailServerIn',_0x102245);logger[_0xa0d0('0xe')](_0xa0d0('0x15'),_0x102245,JSON['stringify'](_0x52d89b));_0x5995ae(_0x52d89b);})['catch'](function(_0x36bc41){logger[_0xa0d0('0x11')](_0xa0d0('0x15'),_0x36bc41[_0xa0d0('0x12')],_0x102245);_0x21fdba(_0x4e95e5[_0xa0d0('0x11')](0x1f4,_0x36bc41[_0xa0d0('0x12')]));});});}; \ No newline at end of file +var _0x92fb=['where','include','model','attributes','map','stringify','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetMailServerIn','MailServerIn','options','raw'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x92fb,0x150));var _0xb92f=function(_0x25ff14,_0x384501){_0x25ff14=_0x25ff14-0x0;var _0x1eef4d=_0x92fb[_0x25ff14];return _0x1eef4d;};'use strict';var _=require(_0xb92f('0x0'));var util=require(_0xb92f('0x1'));var moment=require(_0xb92f('0x2'));var BPromise=require(_0xb92f('0x3'));var rs=require(_0xb92f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb92f('0x5'))('rpc');var config=require(_0xb92f('0x6'));var jayson=require(_0xb92f('0x7'));var client=jayson[_0xb92f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x363350,_0x233d10,_0x1f88fd){return new BPromise(function(_0x1812f4,_0x2490ab){return client[_0xb92f('0x9')](_0x363350,_0x1f88fd)[_0xb92f('0xa')](function(_0x173f09){logger[_0xb92f('0xb')](_0xb92f('0xc'),_0x233d10,_0xb92f('0xd'));logger[_0xb92f('0xe')](_0xb92f('0xf'),_0x233d10,_0xb92f('0xd'),JSON['stringify'](_0x173f09));if(_0x173f09[_0xb92f('0x10')]){if(_0x173f09[_0xb92f('0x10')]['code']===0x1f4){logger[_0xb92f('0x10')](_0xb92f('0xc'),_0x233d10,_0x173f09[_0xb92f('0x10')][_0xb92f('0x11')]);return _0x2490ab(_0x173f09[_0xb92f('0x10')][_0xb92f('0x11')]);}logger[_0xb92f('0x10')](_0xb92f('0xc'),_0x233d10,_0x173f09[_0xb92f('0x10')]['message']);return _0x1812f4(_0x173f09[_0xb92f('0x10')]['message']);}else{logger[_0xb92f('0xb')]('MailServerIn,\x20%s,\x20%s',_0x233d10,_0xb92f('0xd'));_0x1812f4(_0x173f09[_0xb92f('0x12')][_0xb92f('0x11')]);}})[_0xb92f('0x13')](function(_0x5661c0){logger['error'](_0xb92f('0xc'),_0x233d10,_0x5661c0);_0x2490ab(_0x5661c0);});});}exports[_0xb92f('0x14')]=function(_0x1ded2b){var _0x14988c=this;return new Promise(function(_0x2dba32,_0x17caaa){return db[_0xb92f('0x15')]['findAll']({'raw':_0x1ded2b['options']?_0x1ded2b[_0xb92f('0x16')][_0xb92f('0x17')]===undefined?!![]:![]:!![],'where':_0x1ded2b[_0xb92f('0x16')]?_0x1ded2b['options'][_0xb92f('0x18')]||null:null,'attributes':_0x1ded2b[_0xb92f('0x16')]?_0x1ded2b[_0xb92f('0x16')]['attributes']||null:null,'limit':_0x1ded2b[_0xb92f('0x16')]?_0x1ded2b[_0xb92f('0x16')]['limit']||null:null,'include':_0x1ded2b[_0xb92f('0x16')]?_0x1ded2b[_0xb92f('0x16')][_0xb92f('0x19')]?_['map'](_0x1ded2b[_0xb92f('0x16')][_0xb92f('0x19')],function(_0x79a4c6){return{'model':db[_0x79a4c6[_0xb92f('0x1a')]],'as':_0x79a4c6['as'],'attributes':_0x79a4c6[_0xb92f('0x1b')],'include':_0x79a4c6[_0xb92f('0x19')]?_[_0xb92f('0x1c')](_0x79a4c6[_0xb92f('0x19')],function(_0x25fbc2){return{'model':db[_0x25fbc2[_0xb92f('0x1a')]],'as':_0x25fbc2['as'],'attributes':_0x25fbc2[_0xb92f('0x1b')],'include':_0x25fbc2['include']?_[_0xb92f('0x1c')](_0x25fbc2[_0xb92f('0x19')],function(_0x189a1c){return{'model':db[_0x189a1c[_0xb92f('0x1a')]],'as':_0x189a1c['as'],'attributes':_0x189a1c[_0xb92f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb92f('0xa')](function(_0x17b3a5){logger[_0xb92f('0xb')](_0xb92f('0x14'),_0x1ded2b);logger['debug'](_0xb92f('0x14'),_0x1ded2b,JSON[_0xb92f('0x1d')](_0x17b3a5));_0x2dba32(_0x17b3a5);})['catch'](function(_0x10f0f7){logger[_0xb92f('0x10')]('GetMailServerIn',_0x10f0f7[_0xb92f('0x11')],_0x1ded2b);_0x17caaa(_0x14988c[_0xb92f('0x10')](0x1f4,_0x10f0f7[_0xb92f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 7ca04ef..bcef05e 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 _0xe4ab=['index','/:id','isAuthenticated','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','./mailServerOut.controller','get'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe4ab,0x129));var _0xbe4a=function(_0x279687,_0x5d8b08){_0x279687=_0x279687-0x0;var _0x14b74d=_0xe4ab[_0x279687];return _0x14b74d;};'use strict';var multer=require('multer');var util=require(_0xbe4a('0x0'));var path=require(_0xbe4a('0x1'));var timeout=require(_0xbe4a('0x2'));var express=require(_0xbe4a('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbe4a('0x4'));var config=require('../../config/environment');var controller=require(_0xbe4a('0x5'));router[_0xbe4a('0x6')]('/',auth['isAuthenticated'](),controller[_0xbe4a('0x7')]);router['get'](_0xbe4a('0x8'),auth[_0xbe4a('0x9')](),controller['show']);router[_0xbe4a('0xa')]('/',auth[_0xbe4a('0x9')](),controller[_0xbe4a('0xb')]);router['put'](_0xbe4a('0x8'),auth['isAuthenticated'](),controller[_0xbe4a('0xc')]);router[_0xbe4a('0xd')](_0xbe4a('0x8'),auth[_0xbe4a('0x9')](),controller[_0xbe4a('0xe')]);module[_0xbe4a('0xf')]=router; \ No newline at end of file +var _0x1f8a=['get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller'];(function(_0x5b086e,_0x5eb6c0){var _0x3e2c2c=function(_0x1c5de7){while(--_0x1c5de7){_0x5b086e['push'](_0x5b086e['shift']());}};_0x3e2c2c(++_0x5eb6c0);}(_0x1f8a,0x128));var _0xa1f8=function(_0x5e9eae,_0xfb382f){_0x5e9eae=_0x5e9eae-0x0;var _0x18209e=_0x1f8a[_0x5e9eae];return _0x18209e;};'use strict';var multer=require(_0xa1f8('0x0'));var util=require(_0xa1f8('0x1'));var path=require(_0xa1f8('0x2'));var timeout=require('connect-timeout');var express=require(_0xa1f8('0x3'));var router=express['Router']();var auth=require(_0xa1f8('0x4'));var interaction=require(_0xa1f8('0x5'));var config=require(_0xa1f8('0x6'));var controller=require(_0xa1f8('0x7'));router[_0xa1f8('0x8')]('/',auth[_0xa1f8('0x9')](),controller[_0xa1f8('0xa')]);router[_0xa1f8('0x8')](_0xa1f8('0xb'),auth['isAuthenticated'](),controller[_0xa1f8('0xc')]);router[_0xa1f8('0xd')]('/',auth[_0xa1f8('0x9')](),controller[_0xa1f8('0xe')]);router['put'](_0xa1f8('0xb'),auth[_0xa1f8('0x9')](),controller[_0xa1f8('0xf')]);router[_0xa1f8('0x10')](_0xa1f8('0xb'),auth[_0xa1f8('0x9')](),controller[_0xa1f8('0x11')]);module[_0xa1f8('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 776ac23..6eb4f35 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 _0xc7bd=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x4b2069,_0x46d675){var _0x2a2ae5=function(_0x495703){while(--_0x495703){_0x4b2069['push'](_0x4b2069['shift']());}};_0x2a2ae5(++_0x46d675);}(_0xc7bd,0x86));var _0xdc7b=function(_0x2a7920,_0x886981){_0x2a7920=_0x2a7920-0x0;var _0x545c0a=_0xc7bd[_0x2a7920];return _0x545c0a;};'use strict';var Sequelize=require('sequelize');module[_0xdc7b('0x0')]={'description':{'type':Sequelize[_0xdc7b('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xdc7b('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xdc7b('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xdc7b('0x1')]},'authentication':{'type':Sequelize[_0xdc7b('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb091=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x5d1f9b,_0x518d56){var _0x47e0e6=function(_0x24b710){while(--_0x24b710){_0x5d1f9b['push'](_0x5d1f9b['shift']());}};_0x47e0e6(++_0x518d56);}(_0xb091,0x16e));var _0x1b09=function(_0x4be36c,_0x46cfe2){_0x4be36c=_0x4be36c-0x0;var _0x3d7e32=_0xb091[_0x4be36c];return _0x3d7e32;};'use strict';var Sequelize=require('sequelize');module[_0x1b09('0x0')]={'description':{'type':Sequelize[_0x1b09('0x1')]},'host':{'type':Sequelize[_0x1b09('0x1')]},'user':{'type':Sequelize[_0x1b09('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x1b09('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x1b09('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 215c76f..2492f14 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 _0x430a=['filter','type','VIRTUAL','merge','options','MailServerOut','findAll','catch','show','params','length','includeAll','include','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','limit','order','sort','where','pick'];(function(_0x23f1a8,_0x32fd1e){var _0xabb4f1=function(_0x3e7c63){while(--_0x3e7c63){_0x23f1a8['push'](_0x23f1a8['shift']());}};_0xabb4f1(++_0x32fd1e);}(_0x430a,0xf8));var _0xa430=function(_0x2297bb,_0x220e3c){_0x2297bb=_0x2297bb-0x0;var _0xa8c84=_0x430a[_0x2297bb];return _0xa8c84;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa430('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa430('0x1'));var jsonpatch=require(_0xa430('0x2'));var rp=require(_0xa430('0x3'));var moment=require(_0xa430('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa430('0x5'));var util=require(_0xa430('0x6'));var path=require(_0xa430('0x7'));var sox=require(_0xa430('0x8'));var csv=require(_0xa430('0x9'));var ejs=require(_0xa430('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa430('0xb'));var jsforce=require(_0xa430('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa430('0x9'));var querystring=require(_0xa430('0xd'));var Papa=require(_0xa430('0xe'));var Redis=require(_0xa430('0xf'));var authService=require(_0xa430('0x10'));var qs=require(_0xa430('0x11'));var as=require(_0xa430('0x12'));var hardwareService=require(_0xa430('0x13'));var logger=require(_0xa430('0x14'))(_0xa430('0x15'));var utils=require(_0xa430('0x16'));var config=require(_0xa430('0x17'));var db=require(_0xa430('0x18'))['db'];function respondWithStatusCode(_0x17af22,_0x5a49df){_0x5a49df=_0x5a49df||0xcc;return function(_0x3755d0){if(_0x3755d0){return _0x17af22[_0xa430('0x19')](_0x5a49df);}return _0x17af22[_0xa430('0x1a')](_0x5a49df)[_0xa430('0x1b')]();};}function respondWithResult(_0xdd75f7,_0x46f2f5){_0x46f2f5=_0x46f2f5||0xc8;return function(_0x22e885){if(_0x22e885){return _0xdd75f7[_0xa430('0x1a')](_0x46f2f5)[_0xa430('0x1c')](_0x22e885);}};}function respondWithFilteredResult(_0x31395b,_0x47eb5e){return function(_0xc6ccbc){if(_0xc6ccbc){var _0x3904b3=_0xc6ccbc[_0xa430('0x1d')],_0x4c8531=_0x47eb5e[_0xa430('0x1e')],_0x50d6c6=_0x47eb5e['offset']+_0x47eb5e['limit'],_0x3562ad;if(_0x50d6c6>=_0x3904b3){_0x50d6c6=_0x3904b3;_0x3562ad=0xc8;}else{_0x3562ad=0xce;}_0x31395b['status'](_0x3562ad);return _0x31395b[_0xa430('0x1f')](_0xa430('0x20'),_0x4c8531+'-'+_0x50d6c6+'/'+_0x3904b3)['json'](_0xc6ccbc);}return null;};}function patchUpdates(_0x34637b){return function(_0x50d5b9){try{jsonpatch[_0xa430('0x21')](_0x50d5b9,_0x34637b,!![]);}catch(_0x86fdf9){return BPromise[_0xa430('0x22')](_0x86fdf9);}return _0x50d5b9[_0xa430('0x23')]();};}function saveUpdates(_0x537b66,_0x50b72c){return function(_0x17faea){if(_0x17faea){return _0x17faea[_0xa430('0x24')](_0x537b66)[_0xa430('0x25')](function(_0x174d6b){return _0x174d6b;});}return null;};}function removeEntity(_0x175e25,_0x1df7c4){return function(_0x3ab517){if(_0x3ab517){return _0x3ab517['destroy']()[_0xa430('0x25')](function(){_0x175e25['status'](0xcc)[_0xa430('0x1b')]();});}};}function handleEntityNotFound(_0x89375f,_0x5482fa){return function(_0x442281){if(!_0x442281){_0x89375f['sendStatus'](0x194);}return _0x442281;};}function handleError(_0x14f43b,_0x2e62f0){_0x2e62f0=_0x2e62f0||0x1f4;return function(_0x266274){logger[_0xa430('0x26')](_0x266274[_0xa430('0x27')]);if(_0x266274['name']){delete _0x266274[_0xa430('0x28')];}_0x14f43b[_0xa430('0x1a')](_0x2e62f0)[_0xa430('0x29')](_0x266274);};}exports[_0xa430('0x2a')]=function(_0x2330f6,_0x25944c){var _0x4a7e0c={},_0x3ced44={},_0x767c8e={'count':0x0,'rows':[]};var _0x1629a3=_[_0xa430('0x2b')](db['MailServerOut'][_0xa430('0x2c')],function(_0x4cfcd7){return{'name':_0x4cfcd7[_0xa430('0x2d')],'type':_0x4cfcd7['type'][_0xa430('0x2e')]};});_0x3ced44['model']=_[_0xa430('0x2b')](_0x1629a3,'name');_0x3ced44[_0xa430('0x2f')]=_[_0xa430('0x30')](_0x2330f6[_0xa430('0x2f')]);_0x3ced44[_0xa430('0x31')]=_[_0xa430('0x32')](_0x3ced44[_0xa430('0x33')],_0x3ced44[_0xa430('0x2f')]);_0x4a7e0c[_0xa430('0x34')]=_[_0xa430('0x32')](_0x3ced44[_0xa430('0x33')],qs['fields'](_0x2330f6['query'][_0xa430('0x35')]));_0x4a7e0c[_0xa430('0x34')]=_0x4a7e0c[_0xa430('0x34')]['length']?_0x4a7e0c[_0xa430('0x34')]:_0x3ced44[_0xa430('0x33')];if(!_0x2330f6['query'][_0xa430('0x36')]('nolimit')){_0x4a7e0c[_0xa430('0x37')]=qs[_0xa430('0x37')](_0x2330f6['query'][_0xa430('0x37')]);_0x4a7e0c[_0xa430('0x1e')]=qs[_0xa430('0x1e')](_0x2330f6[_0xa430('0x2f')]['offset']);}_0x4a7e0c[_0xa430('0x38')]=qs[_0xa430('0x39')](_0x2330f6[_0xa430('0x2f')][_0xa430('0x39')]);_0x4a7e0c[_0xa430('0x3a')]=qs[_0xa430('0x31')](_[_0xa430('0x3b')](_0x2330f6[_0xa430('0x2f')],_0x3ced44[_0xa430('0x31')]));if(_0x2330f6[_0xa430('0x2f')][_0xa430('0x3c')]){_0x4a7e0c['where']=_['merge'](_0x4a7e0c[_0xa430('0x3a')],{'$or':_[_0xa430('0x2b')](_0x1629a3,function(_0x35c017){if(_0x35c017[_0xa430('0x3d')]!==_0xa430('0x3e')){var _0x4d655b={};_0x4d655b[_0x35c017[_0xa430('0x28')]]={'$like':'%'+_0x2330f6[_0xa430('0x2f')][_0xa430('0x3c')]+'%'};return _0x4d655b;}})});}_0x4a7e0c=_[_0xa430('0x3f')]({},_0x4a7e0c,_0x2330f6[_0xa430('0x40')]);var _0x287515={'where':_0x4a7e0c[_0xa430('0x3a')]};return db['MailServerOut'][_0xa430('0x1d')](_0x287515)[_0xa430('0x25')](function(_0xffe3cf){_0x767c8e[_0xa430('0x1d')]=_0xffe3cf;if(_0x2330f6[_0xa430('0x2f')]['includeAll']){_0x4a7e0c['include']=[{'all':!![]}];}return db[_0xa430('0x41')][_0xa430('0x42')](_0x4a7e0c);})[_0xa430('0x25')](function(_0x4991db){_0x767c8e['rows']=_0x4991db;return _0x767c8e;})['then'](respondWithFilteredResult(_0x25944c,_0x4a7e0c))[_0xa430('0x43')](handleError(_0x25944c,null));};exports[_0xa430('0x44')]=function(_0x62c79e,_0x67d7d3){var _0x4ce9a1={'raw':!![],'where':{'id':_0x62c79e[_0xa430('0x45')]['id']}},_0x23c48b={};_0x23c48b['model']=_[_0xa430('0x30')](db[_0xa430('0x41')][_0xa430('0x2c')]);_0x23c48b[_0xa430('0x2f')]=_[_0xa430('0x30')](_0x62c79e['query']);_0x23c48b[_0xa430('0x31')]=_['intersection'](_0x23c48b[_0xa430('0x33')],_0x23c48b[_0xa430('0x2f')]);_0x4ce9a1[_0xa430('0x34')]=_[_0xa430('0x32')](_0x23c48b[_0xa430('0x33')],qs[_0xa430('0x35')](_0x62c79e[_0xa430('0x2f')][_0xa430('0x35')]));_0x4ce9a1[_0xa430('0x34')]=_0x4ce9a1[_0xa430('0x34')][_0xa430('0x46')]?_0x4ce9a1[_0xa430('0x34')]:_0x23c48b[_0xa430('0x33')];if(_0x62c79e[_0xa430('0x2f')][_0xa430('0x47')]){_0x4ce9a1[_0xa430('0x48')]=[{'all':!![]}];}_0x4ce9a1=_[_0xa430('0x3f')]({},_0x4ce9a1,_0x62c79e['options']);return db['MailServerOut'][_0xa430('0x49')](_0x4ce9a1)[_0xa430('0x25')](handleEntityNotFound(_0x67d7d3,null))['then'](respondWithResult(_0x67d7d3,null))[_0xa430('0x43')](handleError(_0x67d7d3,null));};exports[_0xa430('0x4a')]=function(_0x2b740f,_0x3bcf57){return db[_0xa430('0x41')][_0xa430('0x4a')](_0x2b740f[_0xa430('0x4b')],{})[_0xa430('0x25')](respondWithResult(_0x3bcf57,0xc9))[_0xa430('0x43')](handleError(_0x3bcf57,null));};exports[_0xa430('0x24')]=function(_0x39c417,_0x476a9d){if(_0x39c417[_0xa430('0x4b')]['id']){delete _0x39c417['body']['id'];}return db[_0xa430('0x41')][_0xa430('0x49')]({'where':{'id':_0x39c417[_0xa430('0x45')]['id']}})[_0xa430('0x25')](handleEntityNotFound(_0x476a9d,null))['then'](saveUpdates(_0x39c417[_0xa430('0x4b')],null))['then'](respondWithResult(_0x476a9d,null))[_0xa430('0x43')](handleError(_0x476a9d,null));};exports[_0xa430('0x4c')]=function(_0x1b7d81,_0xfdac99){return db[_0xa430('0x41')][_0xa430('0x49')]({'where':{'id':_0x1b7d81[_0xa430('0x45')]['id']}})[_0xa430('0x25')](handleEntityNotFound(_0xfdac99,null))[_0xa430('0x25')](removeEntity(_0xfdac99,null))['catch'](handleError(_0xfdac99,null));}; \ No newline at end of file +var _0x679b=['to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','error','name','index','MailServerOut','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js'];(function(_0x457bed,_0x5ea1f3){var _0x3b866d=function(_0xbfc7c5){while(--_0xbfc7c5){_0x457bed['push'](_0x457bed['shift']());}};_0x3b866d(++_0x5ea1f3);}(_0x679b,0xca));var _0xb679=function(_0x5ccbab,_0x483ca6){_0x5ccbab=_0x5ccbab-0x0;var _0x5a8111=_0x679b[_0x5ccbab];return _0x5a8111;};'use strict';var pdf=require(_0xb679('0x0'));var emlformat=require(_0xb679('0x1'));var rimraf=require(_0xb679('0x2'));var zipdir=require(_0xb679('0x3'));var jsonpatch=require(_0xb679('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb679('0x5'));var Mustache=require('mustache');var util=require(_0xb679('0x6'));var path=require(_0xb679('0x7'));var sox=require(_0xb679('0x8'));var csv=require('to-csv');var ejs=require(_0xb679('0x9'));var fs=require('fs');var _=require(_0xb679('0xa'));var squel=require(_0xb679('0xb'));var crypto=require(_0xb679('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb679('0xd'));var toCsv=require(_0xb679('0xe'));var querystring=require(_0xb679('0xf'));var Papa=require(_0xb679('0x10'));var Redis=require('ioredis');var authService=require(_0xb679('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb679('0x12'));var hardwareService=require(_0xb679('0x13'));var logger=require(_0xb679('0x14'))(_0xb679('0x15'));var utils=require('../../config/utils');var config=require(_0xb679('0x16'));var db=require(_0xb679('0x17'))['db'];function respondWithStatusCode(_0x5e8074,_0x33dd2c){_0x33dd2c=_0x33dd2c||0xcc;return function(_0x5601ba){if(_0x5601ba){return _0x5e8074[_0xb679('0x18')](_0x33dd2c);}return _0x5e8074[_0xb679('0x19')](_0x33dd2c)[_0xb679('0x1a')]();};}function respondWithResult(_0x2398a2,_0x4206d0){_0x4206d0=_0x4206d0||0xc8;return function(_0x190d42){if(_0x190d42){return _0x2398a2[_0xb679('0x19')](_0x4206d0)[_0xb679('0x1b')](_0x190d42);}};}function respondWithFilteredResult(_0x5baf83,_0x460c7b){return function(_0x3271ed){if(_0x3271ed){var _0x25dacb=_0x3271ed[_0xb679('0x1c')],_0x1e3361=_0x460c7b[_0xb679('0x1d')],_0xacfb94=_0x460c7b[_0xb679('0x1d')]+_0x460c7b[_0xb679('0x1e')],_0x2b8bd3;if(_0xacfb94>=_0x25dacb){_0xacfb94=_0x25dacb;_0x2b8bd3=0xc8;}else{_0x2b8bd3=0xce;}_0x5baf83['status'](_0x2b8bd3);return _0x5baf83[_0xb679('0x1f')]('Content-Range',_0x1e3361+'-'+_0xacfb94+'/'+_0x25dacb)[_0xb679('0x1b')](_0x3271ed);}return null;};}function patchUpdates(_0x390244){return function(_0x4a4f09){try{jsonpatch['apply'](_0x4a4f09,_0x390244,!![]);}catch(_0x2616de){return BPromise[_0xb679('0x20')](_0x2616de);}return _0x4a4f09[_0xb679('0x21')]();};}function saveUpdates(_0x3cf4bd,_0x52db47){return function(_0x2b1bb3){if(_0x2b1bb3){return _0x2b1bb3[_0xb679('0x22')](_0x3cf4bd)[_0xb679('0x23')](function(_0x19c141){return _0x19c141;});}return null;};}function removeEntity(_0x13d991,_0x119a63){return function(_0x5b367c){if(_0x5b367c){return _0x5b367c['destroy']()[_0xb679('0x23')](function(){_0x13d991[_0xb679('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x89fc9e,_0x359803){return function(_0x175d58){if(!_0x175d58){_0x89fc9e['sendStatus'](0x194);}return _0x175d58;};}function handleError(_0x3e53c5,_0xed6b6c){_0xed6b6c=_0xed6b6c||0x1f4;return function(_0x482d07){logger[_0xb679('0x24')](_0x482d07['stack']);if(_0x482d07[_0xb679('0x25')]){delete _0x482d07[_0xb679('0x25')];}_0x3e53c5[_0xb679('0x19')](_0xed6b6c)['send'](_0x482d07);};}exports[_0xb679('0x26')]=function(_0x501963,_0xc0aaff){var _0x136e95={},_0x3b4f15={},_0x56a554={'count':0x0,'rows':[]};var _0x39b534=_['map'](db[_0xb679('0x27')][_0xb679('0x28')],function(_0x1ccac){return{'name':_0x1ccac[_0xb679('0x29')],'type':_0x1ccac['type']['key']};});_0x3b4f15[_0xb679('0x2a')]=_['map'](_0x39b534,_0xb679('0x25'));_0x3b4f15[_0xb679('0x2b')]=_[_0xb679('0x2c')](_0x501963[_0xb679('0x2b')]);_0x3b4f15[_0xb679('0x2d')]=_[_0xb679('0x2e')](_0x3b4f15[_0xb679('0x2a')],_0x3b4f15[_0xb679('0x2b')]);_0x136e95[_0xb679('0x2f')]=_[_0xb679('0x2e')](_0x3b4f15[_0xb679('0x2a')],qs['fields'](_0x501963[_0xb679('0x2b')][_0xb679('0x30')]));_0x136e95['attributes']=_0x136e95[_0xb679('0x2f')][_0xb679('0x31')]?_0x136e95['attributes']:_0x3b4f15['model'];if(!_0x501963[_0xb679('0x2b')][_0xb679('0x32')](_0xb679('0x33'))){_0x136e95[_0xb679('0x1e')]=qs[_0xb679('0x1e')](_0x501963[_0xb679('0x2b')][_0xb679('0x1e')]);_0x136e95[_0xb679('0x1d')]=qs[_0xb679('0x1d')](_0x501963[_0xb679('0x2b')]['offset']);}_0x136e95[_0xb679('0x34')]=qs[_0xb679('0x35')](_0x501963[_0xb679('0x2b')][_0xb679('0x35')]);_0x136e95[_0xb679('0x36')]=qs[_0xb679('0x2d')](_[_0xb679('0x37')](_0x501963[_0xb679('0x2b')],_0x3b4f15['filters']));if(_0x501963[_0xb679('0x2b')][_0xb679('0x38')]){_0x136e95[_0xb679('0x36')]=_[_0xb679('0x39')](_0x136e95['where'],{'$or':_[_0xb679('0x3a')](_0x39b534,function(_0x5140f9){if(_0x5140f9[_0xb679('0x3b')]!==_0xb679('0x3c')){var _0xef24d6={};_0xef24d6[_0x5140f9[_0xb679('0x25')]]={'$like':'%'+_0x501963['query'][_0xb679('0x38')]+'%'};return _0xef24d6;}})});}_0x136e95=_[_0xb679('0x39')]({},_0x136e95,_0x501963[_0xb679('0x3d')]);var _0x428e7e={'where':_0x136e95[_0xb679('0x36')]};return db['MailServerOut'][_0xb679('0x1c')](_0x428e7e)['then'](function(_0x3cad79){_0x56a554[_0xb679('0x1c')]=_0x3cad79;if(_0x501963[_0xb679('0x2b')][_0xb679('0x3e')]){_0x136e95[_0xb679('0x3f')]=[{'all':!![]}];}return db[_0xb679('0x27')][_0xb679('0x40')](_0x136e95);})[_0xb679('0x23')](function(_0x5c9d48){_0x56a554['rows']=_0x5c9d48;return _0x56a554;})[_0xb679('0x23')](respondWithFilteredResult(_0xc0aaff,_0x136e95))[_0xb679('0x41')](handleError(_0xc0aaff,null));};exports[_0xb679('0x42')]=function(_0x580a45,_0x2fd86f){var _0x3eab4b={'raw':!![],'where':{'id':_0x580a45[_0xb679('0x43')]['id']}},_0x23caba={};_0x23caba[_0xb679('0x2a')]=_[_0xb679('0x2c')](db[_0xb679('0x27')]['rawAttributes']);_0x23caba[_0xb679('0x2b')]=_[_0xb679('0x2c')](_0x580a45[_0xb679('0x2b')]);_0x23caba[_0xb679('0x2d')]=_['intersection'](_0x23caba[_0xb679('0x2a')],_0x23caba[_0xb679('0x2b')]);_0x3eab4b[_0xb679('0x2f')]=_[_0xb679('0x2e')](_0x23caba['model'],qs[_0xb679('0x30')](_0x580a45[_0xb679('0x2b')][_0xb679('0x30')]));_0x3eab4b[_0xb679('0x2f')]=_0x3eab4b[_0xb679('0x2f')][_0xb679('0x31')]?_0x3eab4b['attributes']:_0x23caba['model'];if(_0x580a45[_0xb679('0x2b')][_0xb679('0x3e')]){_0x3eab4b[_0xb679('0x3f')]=[{'all':!![]}];}_0x3eab4b=_[_0xb679('0x39')]({},_0x3eab4b,_0x580a45[_0xb679('0x3d')]);return db['MailServerOut'][_0xb679('0x44')](_0x3eab4b)[_0xb679('0x23')](handleEntityNotFound(_0x2fd86f,null))[_0xb679('0x23')](respondWithResult(_0x2fd86f,null))[_0xb679('0x41')](handleError(_0x2fd86f,null));};exports[_0xb679('0x45')]=function(_0x237a58,_0x415834){return db[_0xb679('0x27')][_0xb679('0x45')](_0x237a58['body'],{})[_0xb679('0x23')](respondWithResult(_0x415834,0xc9))[_0xb679('0x41')](handleError(_0x415834,null));};exports[_0xb679('0x22')]=function(_0x3f1510,_0x21767e){if(_0x3f1510[_0xb679('0x46')]['id']){delete _0x3f1510[_0xb679('0x46')]['id'];}return db[_0xb679('0x27')]['find']({'where':{'id':_0x3f1510['params']['id']}})['then'](handleEntityNotFound(_0x21767e,null))['then'](saveUpdates(_0x3f1510[_0xb679('0x46')],null))['then'](respondWithResult(_0x21767e,null))[_0xb679('0x41')](handleError(_0x21767e,null));};exports[_0xb679('0x47')]=function(_0x220549,_0x581d35){return db[_0xb679('0x27')][_0xb679('0x44')]({'where':{'id':_0x220549['params']['id']}})[_0xb679('0x23')](handleEntityNotFound(_0x581d35,null))['then'](removeEntity(_0x581d35,null))[_0xb679('0x41')](handleError(_0x581d35,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 693d759..f092357 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 _0xdc97=['path','../../config/environment','./mailServerOut.attributes','exports','define','lodash','util','../../config/logger','moment','request-promise'];(function(_0x4f2b8c,_0x4012c8){var _0x1226ae=function(_0x495689){while(--_0x495689){_0x4f2b8c['push'](_0x4f2b8c['shift']());}};_0x1226ae(++_0x4012c8);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2af76a,_0x2b96b8){_0x2af76a=_0x2af76a-0x0;var _0x393ee2=_0xdc97[_0x2af76a];return _0x393ee2;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var logger=require(_0x7dc9('0x2'))('api');var moment=require(_0x7dc9('0x3'));var BPromise=require('bluebird');var rp=require(_0x7dc9('0x4'));var fs=require('fs');var path=require(_0x7dc9('0x5'));var rimraf=require('rimraf');var config=require(_0x7dc9('0x6'));var attributes=require(_0x7dc9('0x7'));module[_0x7dc9('0x8')]=function(_0x3ba3ca,_0x589f02){return _0x3ba3ca[_0x7dc9('0x9')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31f0=['./mailServerOut.attributes','define','mail_servers_out','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x313074,_0x4b6d08){var _0x3716c2=function(_0xb9b626){while(--_0xb9b626){_0x313074['push'](_0x313074['shift']());}};_0x3716c2(++_0x4b6d08);}(_0x31f0,0xb7));var _0x031f=function(_0x5dbb43,_0x231269){_0x5dbb43=_0x5dbb43-0x0;var _0x5601a5=_0x31f0[_0x5dbb43];return _0x5601a5;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));module['exports']=function(_0x4c0f94,_0x56328c){return _0x4c0f94[_0x031f('0x8')]('MailServerOut',attributes,{'tableName':_0x031f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index cbdcc3d..e41e668 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 _0x0595=['info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x0595,0x1ec));var _0x5059=function(_0x3378ff,_0x280326){_0x3378ff=_0x3378ff-0x0;var _0x13bf82=_0x0595[_0x3378ff];return _0x13bf82;};'use strict';var _=require('lodash');var util=require(_0x5059('0x0'));var moment=require(_0x5059('0x1'));var BPromise=require(_0x5059('0x2'));var rs=require(_0x5059('0x3'));var fs=require('fs');var Redis=require(_0x5059('0x4'));var db=require(_0x5059('0x5'))['db'];var utils=require(_0x5059('0x6'));var logger=require(_0x5059('0x7'))('rpc');var config=require(_0x5059('0x8'));var jayson=require(_0x5059('0x9'));var client=jayson[_0x5059('0xa')][_0x5059('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5676eb,_0x1d43f8,_0x3edb8a){return new BPromise(function(_0x4dec62,_0x38ac79){return client[_0x5059('0xc')](_0x5676eb,_0x3edb8a)[_0x5059('0xd')](function(_0x220621){logger[_0x5059('0xe')](_0x5059('0xf'),_0x1d43f8,'request\x20sent');logger['debug'](_0x5059('0x10'),_0x1d43f8,_0x5059('0x11'),JSON[_0x5059('0x12')](_0x220621));if(_0x220621[_0x5059('0x13')]){if(_0x220621[_0x5059('0x13')][_0x5059('0x14')]===0x1f4){logger['error'](_0x5059('0xf'),_0x1d43f8,_0x220621[_0x5059('0x13')]['message']);return _0x38ac79(_0x220621['error']['message']);}logger['error']('MailServerOut,\x20%s,\x20%s',_0x1d43f8,_0x220621['error'][_0x5059('0x15')]);return _0x4dec62(_0x220621[_0x5059('0x13')][_0x5059('0x15')]);}else{logger['info'](_0x5059('0xf'),_0x1d43f8,_0x5059('0x11'));_0x4dec62(_0x220621[_0x5059('0x16')][_0x5059('0x15')]);}})['catch'](function(_0x5f4998){logger[_0x5059('0x13')](_0x5059('0xf'),_0x1d43f8,_0x5f4998);_0x38ac79(_0x5f4998);});});} \ No newline at end of file +var _0x7788=['info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7788,0x1d6));var _0x8778=function(_0x21f931,_0x598b2d){_0x21f931=_0x21f931-0x0;var _0x3f083c=_0x7788[_0x21f931];return _0x3f083c;};'use strict';var _=require(_0x8778('0x0'));var util=require(_0x8778('0x1'));var moment=require(_0x8778('0x2'));var BPromise=require(_0x8778('0x3'));var rs=require(_0x8778('0x4'));var fs=require('fs');var Redis=require(_0x8778('0x5'));var db=require(_0x8778('0x6'))['db'];var utils=require(_0x8778('0x7'));var logger=require(_0x8778('0x8'))(_0x8778('0x9'));var config=require(_0x8778('0xa'));var jayson=require(_0x8778('0xb'));var client=jayson[_0x8778('0xc')][_0x8778('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x415da0,_0x10884c,_0x17137b){return new BPromise(function(_0x480a2d,_0x104662){return client[_0x8778('0xe')](_0x415da0,_0x17137b)[_0x8778('0xf')](function(_0x38d08b){logger[_0x8778('0x10')](_0x8778('0x11'),_0x10884c,_0x8778('0x12'));logger[_0x8778('0x13')](_0x8778('0x14'),_0x10884c,_0x8778('0x12'),JSON[_0x8778('0x15')](_0x38d08b));if(_0x38d08b[_0x8778('0x16')]){if(_0x38d08b[_0x8778('0x16')][_0x8778('0x17')]===0x1f4){logger['error'](_0x8778('0x11'),_0x10884c,_0x38d08b[_0x8778('0x16')][_0x8778('0x18')]);return _0x104662(_0x38d08b[_0x8778('0x16')][_0x8778('0x18')]);}logger[_0x8778('0x16')](_0x8778('0x11'),_0x10884c,_0x38d08b[_0x8778('0x16')]['message']);return _0x480a2d(_0x38d08b[_0x8778('0x16')][_0x8778('0x18')]);}else{logger['info']('MailServerOut,\x20%s,\x20%s',_0x10884c,'request\x20sent');_0x480a2d(_0x38d08b[_0x8778('0x19')]['message']);}})[_0x8778('0x1a')](function(_0x153663){logger['error']('MailServerOut,\x20%s,\x20%s',_0x10884c,_0x153663);_0x104662(_0x153663);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index efca90d..13c2cde 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 _0x8294=['post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/:id','show'];(function(_0x32d414,_0x4d23da){var _0x4e0bca=function(_0x15d397){while(--_0x15d397){_0x32d414['push'](_0x32d414['shift']());}};_0x4e0bca(++_0x4d23da);}(_0x8294,0x10a));var _0x4829=function(_0x169f48,_0x11fe57){_0x169f48=_0x169f48-0x0;var _0x323b38=_0x8294[_0x169f48];return _0x323b38;};'use strict';var multer=require(_0x4829('0x0'));var util=require(_0x4829('0x1'));var path=require(_0x4829('0x2'));var timeout=require(_0x4829('0x3'));var express=require(_0x4829('0x4'));var router=express[_0x4829('0x5')]();var auth=require(_0x4829('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4829('0x7'));var controller=require(_0x4829('0x8'));router[_0x4829('0x9')]('/',auth[_0x4829('0xa')](),controller[_0x4829('0xb')]);router['get']('/describe',auth[_0x4829('0xa')](),controller['describe']);router[_0x4829('0x9')](_0x4829('0xc'),auth[_0x4829('0xa')](),controller[_0x4829('0xd')]);router[_0x4829('0xe')]('/',auth['isAuthenticated'](),controller[_0x4829('0xf')]);router[_0x4829('0x10')](_0x4829('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4829('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x4829('0x12')]);module[_0x4829('0x13')]=router; \ No newline at end of file +var _0xa082=['post','update','delete','destroy','exports','util','connect-timeout','express','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x1acbc6,_0x10598d){var _0x48738f=function(_0x1bb364){while(--_0x1bb364){_0x1acbc6['push'](_0x1acbc6['shift']());}};_0x48738f(++_0x10598d);}(_0xa082,0x18b));var _0x2a08=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa082[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0x2a08('0x0'));var path=require('path');var timeout=require(_0x2a08('0x1'));var express=require(_0x2a08('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2a08('0x3'));var controller=require('./mailSubstatus.controller');router[_0x2a08('0x4')]('/',auth[_0x2a08('0x5')](),controller['index']);router[_0x2a08('0x4')](_0x2a08('0x6'),auth[_0x2a08('0x5')](),controller[_0x2a08('0x7')]);router[_0x2a08('0x4')](_0x2a08('0x8'),auth[_0x2a08('0x5')](),controller[_0x2a08('0x9')]);router[_0x2a08('0xa')]('/',auth[_0x2a08('0x5')](),controller['create']);router['put']('/:id',auth[_0x2a08('0x5')](),controller[_0x2a08('0xb')]);router[_0x2a08('0xc')](_0x2a08('0x8'),auth['isAuthenticated'](),controller[_0x2a08('0xd')]);module[_0x2a08('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index cccb5b2..f56419c 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 _0x14b2=['STRING','sequelize','exports','name'];(function(_0x4b2cc6,_0x29ef43){var _0x3e0b08=function(_0x3b4131){while(--_0x3b4131){_0x4b2cc6['push'](_0x4b2cc6['shift']());}};_0x3e0b08(++_0x29ef43);}(_0x14b2,0x1a1));var _0x214b=function(_0x2d62c1,_0x147603){_0x2d62c1=_0x2d62c1-0x0;var _0x31d444=_0x14b2[_0x2d62c1];return _0x31d444;};'use strict';var Sequelize=require(_0x214b('0x0'));module[_0x214b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x214b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x214b('0x3')]}}; \ No newline at end of file +var _0x5386=['name','sequelize','exports','STRING'];(function(_0x321d3e,_0x598f6f){var _0x5b8198=function(_0x7a9c78){while(--_0x7a9c78){_0x321d3e['push'](_0x321d3e['shift']());}};_0x5b8198(++_0x598f6f);}(_0x5386,0x1e1));var _0x6538=function(_0x15b192,_0x38c235){_0x15b192=_0x15b192-0x0;var _0x396e73=_0x5386[_0x15b192];return _0x396e73;};'use strict';var Sequelize=require(_0x6538('0x0'));module[_0x6538('0x1')]={'name':{'type':Sequelize[_0x6538('0x2')],'unique':_0x6538('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 93785bb..f32406a 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 _0x71ab=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','include','body','update','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','filters','attributes'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x71ab,0x64));var _0xb71a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x71ab[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb71a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb71a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb71a('0x2'));var moment=require(_0xb71a('0x3'));var BPromise=require(_0xb71a('0x4'));var Mustache=require(_0xb71a('0x5'));var util=require(_0xb71a('0x6'));var path=require(_0xb71a('0x7'));var sox=require(_0xb71a('0x8'));var csv=require(_0xb71a('0x9'));var ejs=require(_0xb71a('0xa'));var fs=require('fs');var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x9'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a2d75,_0x50030d){_0x50030d=_0x50030d||0xcc;return function(_0x50b43b){if(_0x50b43b){return _0x2a2d75[_0xb71a('0x18')](_0x50030d);}return _0x2a2d75[_0xb71a('0x19')](_0x50030d)[_0xb71a('0x1a')]();};}function respondWithResult(_0xd8d3ae,_0x483d77){_0x483d77=_0x483d77||0xc8;return function(_0x47ee48){if(_0x47ee48){return _0xd8d3ae['status'](_0x483d77)[_0xb71a('0x1b')](_0x47ee48);}};}function respondWithFilteredResult(_0xc189cd,_0x15252a){return function(_0x42fc55){if(_0x42fc55){var _0x3cd0f0=_0x42fc55[_0xb71a('0x1c')],_0x1e9363=_0x15252a['offset'],_0x31def2=_0x15252a[_0xb71a('0x1d')]+_0x15252a[_0xb71a('0x1e')],_0x2ec64a;if(_0x31def2>=_0x3cd0f0){_0x31def2=_0x3cd0f0;_0x2ec64a=0xc8;}else{_0x2ec64a=0xce;}_0xc189cd[_0xb71a('0x19')](_0x2ec64a);return _0xc189cd[_0xb71a('0x1f')](_0xb71a('0x20'),_0x1e9363+'-'+_0x31def2+'/'+_0x3cd0f0)[_0xb71a('0x1b')](_0x42fc55);}return null;};}function patchUpdates(_0x349de1){return function(_0x7cd1f9){try{jsonpatch[_0xb71a('0x21')](_0x7cd1f9,_0x349de1,!![]);}catch(_0x2eab08){return BPromise[_0xb71a('0x22')](_0x2eab08);}return _0x7cd1f9['save']();};}function saveUpdates(_0x5bb77a,_0x1358f2){return function(_0x578fe4){if(_0x578fe4){return _0x578fe4['update'](_0x5bb77a)['then'](function(_0x1cfd1c){return _0x1cfd1c;});}return null;};}function removeEntity(_0x4fe4fb,_0x76d6dc){return function(_0x4227c7){if(_0x4227c7){return _0x4227c7[_0xb71a('0x23')]()[_0xb71a('0x24')](function(){_0x4fe4fb[_0xb71a('0x19')](0xcc)[_0xb71a('0x1a')]();});}};}function handleEntityNotFound(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(!_0x5f3f19){_0x2f4fac[_0xb71a('0x18')](0x194);}return _0x5f3f19;};}function handleError(_0x2c15bc,_0x353930){_0x353930=_0x353930||0x1f4;return function(_0xa0743a){logger[_0xb71a('0x25')](_0xa0743a[_0xb71a('0x26')]);if(_0xa0743a[_0xb71a('0x27')]){delete _0xa0743a[_0xb71a('0x27')];}_0x2c15bc[_0xb71a('0x19')](_0x353930)[_0xb71a('0x28')](_0xa0743a);};}exports[_0xb71a('0x29')]=function(_0x17f8b2,_0x160f0f){var _0x5ae0ed={},_0x2e8ea6={},_0x39d874={'count':0x0,'rows':[]};var _0x1689ce=_[_0xb71a('0x2a')](db[_0xb71a('0x2b')][_0xb71a('0x2c')],function(_0x44826e){return{'name':_0x44826e[_0xb71a('0x2d')],'type':_0x44826e[_0xb71a('0x2e')][_0xb71a('0x2f')]};});_0x2e8ea6[_0xb71a('0x30')]=_['map'](_0x1689ce,'name');_0x2e8ea6[_0xb71a('0x31')]=_['keys'](_0x17f8b2[_0xb71a('0x31')]);_0x2e8ea6[_0xb71a('0x32')]=_['intersection'](_0x2e8ea6[_0xb71a('0x30')],_0x2e8ea6[_0xb71a('0x31')]);_0x5ae0ed[_0xb71a('0x33')]=_[_0xb71a('0x34')](_0x2e8ea6[_0xb71a('0x30')],qs[_0xb71a('0x35')](_0x17f8b2['query'][_0xb71a('0x35')]));_0x5ae0ed[_0xb71a('0x33')]=_0x5ae0ed[_0xb71a('0x33')][_0xb71a('0x36')]?_0x5ae0ed['attributes']:_0x2e8ea6[_0xb71a('0x30')];if(!_0x17f8b2[_0xb71a('0x31')][_0xb71a('0x37')](_0xb71a('0x38'))){_0x5ae0ed[_0xb71a('0x1e')]=qs[_0xb71a('0x1e')](_0x17f8b2[_0xb71a('0x31')][_0xb71a('0x1e')]);_0x5ae0ed[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x17f8b2['query']['offset']);}_0x5ae0ed[_0xb71a('0x39')]=qs[_0xb71a('0x3a')](_0x17f8b2[_0xb71a('0x31')][_0xb71a('0x3a')]);_0x5ae0ed[_0xb71a('0x3b')]=qs[_0xb71a('0x32')](_[_0xb71a('0x3c')](_0x17f8b2['query'],_0x2e8ea6[_0xb71a('0x32')]));if(_0x17f8b2['query'][_0xb71a('0x3d')]){_0x5ae0ed[_0xb71a('0x3b')]=_[_0xb71a('0x3e')](_0x5ae0ed[_0xb71a('0x3b')],{'$or':_['map'](_0x1689ce,function(_0x39d12c){if(_0x39d12c[_0xb71a('0x2e')]!==_0xb71a('0x3f')){var _0x1fa15c={};_0x1fa15c[_0x39d12c[_0xb71a('0x27')]]={'$like':'%'+_0x17f8b2[_0xb71a('0x31')][_0xb71a('0x3d')]+'%'};return _0x1fa15c;}})});}_0x5ae0ed=_[_0xb71a('0x3e')]({},_0x5ae0ed,_0x17f8b2[_0xb71a('0x40')]);var _0x59c61a={'where':_0x5ae0ed[_0xb71a('0x3b')]};return db['MailSubstatus'][_0xb71a('0x1c')](_0x59c61a)[_0xb71a('0x24')](function(_0x9ecf61){_0x39d874[_0xb71a('0x1c')]=_0x9ecf61;if(_0x17f8b2[_0xb71a('0x31')][_0xb71a('0x41')]){_0x5ae0ed['include']=[{'all':!![]}];}return db['MailSubstatus']['findAll'](_0x5ae0ed);})[_0xb71a('0x24')](function(_0x4c8436){_0x39d874[_0xb71a('0x42')]=_0x4c8436;return _0x39d874;})[_0xb71a('0x24')](respondWithFilteredResult(_0x160f0f,_0x5ae0ed))[_0xb71a('0x43')](handleError(_0x160f0f,null));};exports[_0xb71a('0x44')]=function(_0x1cb355,_0x2fc353){var _0x59530a={'raw':!![],'where':{'id':_0x1cb355[_0xb71a('0x45')]['id']}},_0x29985a={};_0x29985a[_0xb71a('0x30')]=_[_0xb71a('0x46')](db[_0xb71a('0x2b')][_0xb71a('0x2c')]);_0x29985a['query']=_[_0xb71a('0x46')](_0x1cb355[_0xb71a('0x31')]);_0x29985a[_0xb71a('0x32')]=_[_0xb71a('0x34')](_0x29985a[_0xb71a('0x30')],_0x29985a[_0xb71a('0x31')]);_0x59530a[_0xb71a('0x33')]=_['intersection'](_0x29985a['model'],qs[_0xb71a('0x35')](_0x1cb355[_0xb71a('0x31')][_0xb71a('0x35')]));_0x59530a[_0xb71a('0x33')]=_0x59530a['attributes'][_0xb71a('0x36')]?_0x59530a['attributes']:_0x29985a[_0xb71a('0x30')];if(_0x1cb355[_0xb71a('0x31')]['includeAll']){_0x59530a[_0xb71a('0x47')]=[{'all':!![]}];}_0x59530a=_[_0xb71a('0x3e')]({},_0x59530a,_0x1cb355[_0xb71a('0x40')]);return db[_0xb71a('0x2b')]['find'](_0x59530a)[_0xb71a('0x24')](handleEntityNotFound(_0x2fc353,null))[_0xb71a('0x24')](respondWithResult(_0x2fc353,null))[_0xb71a('0x43')](handleError(_0x2fc353,null));};exports['create']=function(_0x350c89,_0x1cd434){return db[_0xb71a('0x2b')]['create'](_0x350c89[_0xb71a('0x48')],{})[_0xb71a('0x24')](respondWithResult(_0x1cd434,0xc9))[_0xb71a('0x43')](handleError(_0x1cd434,null));};exports[_0xb71a('0x49')]=function(_0x365bed,_0x550a67){if(_0x365bed[_0xb71a('0x48')]['id']){delete _0x365bed[_0xb71a('0x48')]['id'];}return db[_0xb71a('0x2b')][_0xb71a('0x4a')]({'where':{'id':_0x365bed['params']['id']}})['then'](handleEntityNotFound(_0x550a67,null))[_0xb71a('0x24')](saveUpdates(_0x365bed[_0xb71a('0x48')],null))[_0xb71a('0x24')](respondWithResult(_0x550a67,null))[_0xb71a('0x43')](handleError(_0x550a67,null));};exports[_0xb71a('0x23')]=function(_0x2f2187,_0x2a7804){return db[_0xb71a('0x2b')][_0xb71a('0x4a')]({'where':{'id':_0x2f2187[_0xb71a('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a7804,null))[_0xb71a('0x24')](removeEntity(_0x2a7804,null))[_0xb71a('0x43')](handleError(_0x2a7804,null));};exports['describe']=function(_0x1c0536,_0x58116c){return db[_0xb71a('0x2b')][_0xb71a('0x4b')]()[_0xb71a('0x24')](respondWithResult(_0x58116c,null))[_0xb71a('0x43')](handleError(_0x58116c,null));}; \ No newline at end of file +var _0x687b=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','show','params','length','includeAll','find','create','update','body','describe','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','save','then','sendStatus','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','key','model','query','keys','intersection'];(function(_0x3a4464,_0x37afa0){var _0x42503f=function(_0x379ce7){while(--_0x379ce7){_0x3a4464['push'](_0x3a4464['shift']());}};_0x42503f(++_0x37afa0);}(_0x687b,0x14a));var _0xb687=function(_0x2f2ed0,_0x1c6435){_0x2f2ed0=_0x2f2ed0-0x0;var _0x250b0d=_0x687b[_0x2f2ed0];return _0x250b0d;};'use strict';var pdf=require(_0xb687('0x0'));var emlformat=require(_0xb687('0x1'));var rimraf=require(_0xb687('0x2'));var zipdir=require(_0xb687('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb687('0x4'));var BPromise=require(_0xb687('0x5'));var Mustache=require(_0xb687('0x6'));var util=require(_0xb687('0x7'));var path=require(_0xb687('0x8'));var sox=require(_0xb687('0x9'));var csv=require(_0xb687('0xa'));var ejs=require(_0xb687('0xb'));var fs=require('fs');var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var db=require(_0xb687('0x1a'))['db'];function respondWithStatusCode(_0x3ca723,_0x12a0be){_0x12a0be=_0x12a0be||0xcc;return function(_0x4f9c19){if(_0x4f9c19){return _0x3ca723['sendStatus'](_0x12a0be);}return _0x3ca723[_0xb687('0x1b')](_0x12a0be)[_0xb687('0x1c')]();};}function respondWithResult(_0x49e233,_0x108fd0){_0x108fd0=_0x108fd0||0xc8;return function(_0x2f1ac0){if(_0x2f1ac0){return _0x49e233[_0xb687('0x1b')](_0x108fd0)[_0xb687('0x1d')](_0x2f1ac0);}};}function respondWithFilteredResult(_0x838dd4,_0x3ab914){return function(_0x30622f){if(_0x30622f){var _0x141375=_0x30622f[_0xb687('0x1e')],_0x263085=_0x3ab914['offset'],_0x2c7a18=_0x3ab914[_0xb687('0x1f')]+_0x3ab914[_0xb687('0x20')],_0x25124a;if(_0x2c7a18>=_0x141375){_0x2c7a18=_0x141375;_0x25124a=0xc8;}else{_0x25124a=0xce;}_0x838dd4[_0xb687('0x1b')](_0x25124a);return _0x838dd4['set']('Content-Range',_0x263085+'-'+_0x2c7a18+'/'+_0x141375)[_0xb687('0x1d')](_0x30622f);}return null;};}function patchUpdates(_0x3a10ef){return function(_0x19ee14){try{jsonpatch['apply'](_0x19ee14,_0x3a10ef,!![]);}catch(_0x42cdd2){return BPromise['reject'](_0x42cdd2);}return _0x19ee14[_0xb687('0x21')]();};}function saveUpdates(_0x243236,_0x170dc0){return function(_0x44bd0b){if(_0x44bd0b){return _0x44bd0b['update'](_0x243236)[_0xb687('0x22')](function(_0x58e83c){return _0x58e83c;});}return null;};}function removeEntity(_0x335541,_0x90e892){return function(_0x274241){if(_0x274241){return _0x274241['destroy']()[_0xb687('0x22')](function(){_0x335541[_0xb687('0x1b')](0xcc)[_0xb687('0x1c')]();});}};}function handleEntityNotFound(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(!_0x38866c){_0x16cdcb[_0xb687('0x23')](0x194);}return _0x38866c;};}function handleError(_0x2f0a0a,_0x57cd51){_0x57cd51=_0x57cd51||0x1f4;return function(_0xf45db0){logger[_0xb687('0x24')](_0xf45db0[_0xb687('0x25')]);if(_0xf45db0[_0xb687('0x26')]){delete _0xf45db0[_0xb687('0x26')];}_0x2f0a0a[_0xb687('0x1b')](_0x57cd51)[_0xb687('0x27')](_0xf45db0);};}exports[_0xb687('0x28')]=function(_0x3ff9e1,_0x2e6185){var _0x4a61ec={},_0x3712cf={},_0x192966={'count':0x0,'rows':[]};var _0x392721=_[_0xb687('0x29')](db[_0xb687('0x2a')][_0xb687('0x2b')],function(_0x4e9a06){return{'name':_0x4e9a06[_0xb687('0x2c')],'type':_0x4e9a06['type'][_0xb687('0x2d')]};});_0x3712cf[_0xb687('0x2e')]=_[_0xb687('0x29')](_0x392721,_0xb687('0x26'));_0x3712cf[_0xb687('0x2f')]=_[_0xb687('0x30')](_0x3ff9e1[_0xb687('0x2f')]);_0x3712cf['filters']=_[_0xb687('0x31')](_0x3712cf[_0xb687('0x2e')],_0x3712cf[_0xb687('0x2f')]);_0x4a61ec[_0xb687('0x32')]=_[_0xb687('0x31')](_0x3712cf[_0xb687('0x2e')],qs[_0xb687('0x33')](_0x3ff9e1[_0xb687('0x2f')][_0xb687('0x33')]));_0x4a61ec[_0xb687('0x32')]=_0x4a61ec[_0xb687('0x32')]['length']?_0x4a61ec['attributes']:_0x3712cf[_0xb687('0x2e')];if(!_0x3ff9e1[_0xb687('0x2f')][_0xb687('0x34')](_0xb687('0x35'))){_0x4a61ec['limit']=qs['limit'](_0x3ff9e1[_0xb687('0x2f')][_0xb687('0x20')]);_0x4a61ec['offset']=qs[_0xb687('0x1f')](_0x3ff9e1[_0xb687('0x2f')]['offset']);}_0x4a61ec[_0xb687('0x36')]=qs['sort'](_0x3ff9e1[_0xb687('0x2f')][_0xb687('0x37')]);_0x4a61ec[_0xb687('0x38')]=qs[_0xb687('0x39')](_[_0xb687('0x3a')](_0x3ff9e1[_0xb687('0x2f')],_0x3712cf['filters']));if(_0x3ff9e1[_0xb687('0x2f')][_0xb687('0x3b')]){_0x4a61ec[_0xb687('0x38')]=_[_0xb687('0x3c')](_0x4a61ec['where'],{'$or':_[_0xb687('0x29')](_0x392721,function(_0x100f4a){if(_0x100f4a[_0xb687('0x3d')]!==_0xb687('0x3e')){var _0xa3f0f9={};_0xa3f0f9[_0x100f4a['name']]={'$like':'%'+_0x3ff9e1[_0xb687('0x2f')][_0xb687('0x3b')]+'%'};return _0xa3f0f9;}})});}_0x4a61ec=_[_0xb687('0x3c')]({},_0x4a61ec,_0x3ff9e1[_0xb687('0x3f')]);var _0x24b785={'where':_0x4a61ec[_0xb687('0x38')]};return db['MailSubstatus']['count'](_0x24b785)[_0xb687('0x22')](function(_0x5460a2){_0x192966[_0xb687('0x1e')]=_0x5460a2;if(_0x3ff9e1[_0xb687('0x2f')]['includeAll']){_0x4a61ec[_0xb687('0x40')]=[{'all':!![]}];}return db[_0xb687('0x2a')]['findAll'](_0x4a61ec);})[_0xb687('0x22')](function(_0x28031e){_0x192966[_0xb687('0x41')]=_0x28031e;return _0x192966;})['then'](respondWithFilteredResult(_0x2e6185,_0x4a61ec))[_0xb687('0x42')](handleError(_0x2e6185,null));};exports[_0xb687('0x43')]=function(_0x38abe5,_0x75102a){var _0x140388={'raw':!![],'where':{'id':_0x38abe5[_0xb687('0x44')]['id']}},_0x1375f7={};_0x1375f7['model']=_[_0xb687('0x30')](db['MailSubstatus']['rawAttributes']);_0x1375f7[_0xb687('0x2f')]=_[_0xb687('0x30')](_0x38abe5['query']);_0x1375f7[_0xb687('0x39')]=_['intersection'](_0x1375f7[_0xb687('0x2e')],_0x1375f7[_0xb687('0x2f')]);_0x140388['attributes']=_[_0xb687('0x31')](_0x1375f7[_0xb687('0x2e')],qs['fields'](_0x38abe5[_0xb687('0x2f')][_0xb687('0x33')]));_0x140388[_0xb687('0x32')]=_0x140388[_0xb687('0x32')][_0xb687('0x45')]?_0x140388[_0xb687('0x32')]:_0x1375f7[_0xb687('0x2e')];if(_0x38abe5[_0xb687('0x2f')][_0xb687('0x46')]){_0x140388[_0xb687('0x40')]=[{'all':!![]}];}_0x140388=_[_0xb687('0x3c')]({},_0x140388,_0x38abe5[_0xb687('0x3f')]);return db['MailSubstatus'][_0xb687('0x47')](_0x140388)['then'](handleEntityNotFound(_0x75102a,null))[_0xb687('0x22')](respondWithResult(_0x75102a,null))[_0xb687('0x42')](handleError(_0x75102a,null));};exports[_0xb687('0x48')]=function(_0x2c9110,_0x113b76){return db[_0xb687('0x2a')]['create'](_0x2c9110['body'],{})[_0xb687('0x22')](respondWithResult(_0x113b76,0xc9))[_0xb687('0x42')](handleError(_0x113b76,null));};exports[_0xb687('0x49')]=function(_0x4f3069,_0x4f5736){if(_0x4f3069[_0xb687('0x4a')]['id']){delete _0x4f3069[_0xb687('0x4a')]['id'];}return db[_0xb687('0x2a')][_0xb687('0x47')]({'where':{'id':_0x4f3069['params']['id']}})[_0xb687('0x22')](handleEntityNotFound(_0x4f5736,null))[_0xb687('0x22')](saveUpdates(_0x4f3069[_0xb687('0x4a')],null))[_0xb687('0x22')](respondWithResult(_0x4f5736,null))['catch'](handleError(_0x4f5736,null));};exports['destroy']=function(_0x3f654a,_0x170b26){return db[_0xb687('0x2a')]['find']({'where':{'id':_0x3f654a['params']['id']}})[_0xb687('0x22')](handleEntityNotFound(_0x170b26,null))[_0xb687('0x22')](removeEntity(_0x170b26,null))[_0xb687('0x42')](handleError(_0x170b26,null));};exports[_0xb687('0x4b')]=function(_0x34205d,_0x1fb31a){return db[_0xb687('0x2a')][_0xb687('0x4b')]()['then'](respondWithResult(_0x1fb31a,null))[_0xb687('0x42')](handleError(_0x1fb31a,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 4d09281..e15f836 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 _0x7a12=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailSubstatus.attributes','exports','define','mail_substatuses','lodash','util'];(function(_0x2eb828,_0x5b4396){var _0xdb47b7=function(_0x5797cb){while(--_0x5797cb){_0x2eb828['push'](_0x2eb828['shift']());}};_0xdb47b7(++_0x5b4396);}(_0x7a12,0xe8));var _0x27a1=function(_0x4abec1,_0x5c58bc){_0x4abec1=_0x4abec1-0x0;var _0x5bc5f4=_0x7a12[_0x4abec1];return _0x5bc5f4;};'use strict';var _=require(_0x27a1('0x0'));var util=require(_0x27a1('0x1'));var logger=require(_0x27a1('0x2'))(_0x27a1('0x3'));var moment=require(_0x27a1('0x4'));var BPromise=require(_0x27a1('0x5'));var rp=require(_0x27a1('0x6'));var fs=require('fs');var path=require(_0x27a1('0x7'));var rimraf=require('rimraf');var config=require(_0x27a1('0x8'));var attributes=require(_0x27a1('0x9'));module[_0x27a1('0xa')]=function(_0x389116,_0x2ccadb){return _0x389116[_0x27a1('0xb')]('MailSubstatus',attributes,{'tableName':_0x27a1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14a0=['../../config/logger','api','moment','bluebird','request-promise','path','./mailSubstatus.attributes','exports','MailSubstatus','mail_substatuses','util'];(function(_0x2b69ad,_0x30a41a){var _0x54a689=function(_0x380f6a){while(--_0x380f6a){_0x2b69ad['push'](_0x2b69ad['shift']());}};_0x54a689(++_0x30a41a);}(_0x14a0,0x8e));var _0x014a=function(_0x2d8f06,_0x3629bf){_0x2d8f06=_0x2d8f06-0x0;var _0x554413=_0x14a0[_0x2d8f06];return _0x554413;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var logger=require(_0x014a('0x1'))(_0x014a('0x2'));var moment=require(_0x014a('0x3'));var BPromise=require(_0x014a('0x4'));var rp=require(_0x014a('0x5'));var fs=require('fs');var path=require(_0x014a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x014a('0x7'));module[_0x014a('0x8')]=function(_0x38a22c,_0x5ec84d){return _0x38a22c['define'](_0x014a('0x9'),attributes,{'tableName':_0x014a('0xa'),'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 58348ef..c06ea49 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 _0xd2ea=['../../config/environment','jayson/promise','client','request','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x48c626,_0x263848){var _0x3bf0de=function(_0x189b6d){while(--_0x189b6d){_0x48c626['push'](_0x48c626['shift']());}};_0x3bf0de(++_0x263848);}(_0xd2ea,0x15f));var _0xad2e=function(_0x2819a0,_0xb319c6){_0x2819a0=_0x2819a0-0x0;var _0x2947a7=_0xd2ea[_0x2819a0];return _0x2947a7;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b5170,_0x3e3d1f,_0x2ff7b2){return new BPromise(function(_0x5710ac,_0x1e0e9e){return client[_0xad2e('0xc')](_0x3b5170,_0x2ff7b2)['then'](function(_0x1eed2f){logger['info'](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));logger[_0xad2e('0xf')](_0xad2e('0x10'),_0x3e3d1f,'request\x20sent',JSON[_0xad2e('0x11')](_0x1eed2f));if(_0x1eed2f['error']){if(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x13')]===0x1f4){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0x1eed2f['error'][_0xad2e('0x14')]);return _0x1e0e9e(_0x1eed2f['error'][_0xad2e('0x14')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x3e3d1f,_0x1eed2f['error']['message']);return _0x5710ac(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x14')]);}else{logger[_0xad2e('0x15')](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));_0x5710ac(_0x1eed2f[_0xad2e('0x16')][_0xad2e('0x14')]);}})[_0xad2e('0x17')](function(_0xd40b31){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0xd40b31);_0x1e0e9e(_0xd40b31);});});} \ No newline at end of file +var _0x55e0=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x55e0,0xdc));var _0x055e=function(_0x183e1d,_0x550bbe){_0x183e1d=_0x183e1d-0x0;var _0x58ca3e=_0x55e0[_0x183e1d];return _0x58ca3e;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4384ff,_0x4a442e,_0x8e7824){return new BPromise(function(_0x3c4cf,_0x376618){return client[_0x055e('0xa')](_0x4384ff,_0x8e7824)[_0x055e('0xb')](function(_0x49540c){logger[_0x055e('0xc')](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));logger[_0x055e('0xf')](_0x055e('0x10'),_0x4a442e,'request\x20sent',JSON['stringify'](_0x49540c));if(_0x49540c[_0x055e('0x11')]){if(_0x49540c['error'][_0x055e('0x12')]===0x1f4){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x376618(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}logger['error'](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x3c4cf(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}else{logger['info'](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));_0x3c4cf(_0x49540c[_0x055e('0x14')]['message']);}})[_0x055e('0x15')](function(_0x2c377c){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x2c377c);_0x376618(_0x2c377c);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 6f78baa..d495c51 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 _0xf75d=['create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post'];(function(_0x1a0967,_0x51bc82){var _0x5a169f=function(_0x43fda2){while(--_0x43fda2){_0x1a0967['push'](_0x1a0967['shift']());}};_0x5a169f(++_0x51bc82);}(_0xf75d,0x10a));var _0xdf75=function(_0x4888e0,_0x35f563){_0x4888e0=_0x4888e0-0x0;var _0x346fee=_0xf75d[_0x4888e0];return _0x346fee;};'use strict';var multer=require(_0xdf75('0x0'));var util=require('util');var path=require(_0xdf75('0x1'));var timeout=require('connect-timeout');var express=require(_0xdf75('0x2'));var router=express[_0xdf75('0x3')]();var auth=require(_0xdf75('0x4'));var interaction=require(_0xdf75('0x5'));var config=require(_0xdf75('0x6'));var controller=require(_0xdf75('0x7'));router[_0xdf75('0x8')]('/',auth[_0xdf75('0x9')](),controller[_0xdf75('0xa')]);router[_0xdf75('0x8')](_0xdf75('0xb'),auth[_0xdf75('0x9')](),controller['describe']);router[_0xdf75('0x8')](_0xdf75('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xdf75('0xd')]('/',auth['isAuthenticated'](),controller[_0xdf75('0xe')]);router[_0xdf75('0xf')](_0xdf75('0xc'),auth[_0xdf75('0x9')](),controller[_0xdf75('0x10')]);router[_0xdf75('0x11')](_0xdf75('0xc'),auth['isAuthenticated'](),controller[_0xdf75('0x12')]);module[_0xdf75('0x13')]=router; \ No newline at end of file +var _0x5e73=['/:id','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated'];(function(_0x2b0834,_0x127ebe){var _0x16dc89=function(_0x34bd49){while(--_0x34bd49){_0x2b0834['push'](_0x2b0834['shift']());}};_0x16dc89(++_0x127ebe);}(_0x5e73,0x1ed));var _0x35e7=function(_0x1e10d4,_0x18ae30){_0x1e10d4=_0x1e10d4-0x0;var _0x483e9b=_0x5e73[_0x1e10d4];return _0x483e9b;};'use strict';var multer=require(_0x35e7('0x0'));var util=require('util');var path=require(_0x35e7('0x1'));var timeout=require(_0x35e7('0x2'));var express=require(_0x35e7('0x3'));var router=express[_0x35e7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x35e7('0x5'));var config=require(_0x35e7('0x6'));var controller=require('./mailTransferReport.controller');router[_0x35e7('0x7')]('/',auth['isAuthenticated'](),controller[_0x35e7('0x8')]);router[_0x35e7('0x7')](_0x35e7('0x9'),auth[_0x35e7('0xa')](),controller['describe']);router['get'](_0x35e7('0xb'),auth[_0x35e7('0xa')](),controller['show']);router[_0x35e7('0xc')]('/',auth[_0x35e7('0xa')](),controller[_0x35e7('0xd')]);router['put'](_0x35e7('0xb'),auth[_0x35e7('0xa')](),controller[_0x35e7('0xe')]);router[_0x35e7('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x35e7('0x10')]);module[_0x35e7('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 1417045..493cb7e 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 _0x2d89=['NOW','moment','exports','STRING','ENUM','account','agent','queue','DATE'];(function(_0x4c46d6,_0x26f13f){var _0xddb3d5=function(_0xbcd35d){while(--_0xbcd35d){_0x4c46d6['push'](_0x4c46d6['shift']());}};_0xddb3d5(++_0x26f13f);}(_0x2d89,0x1c3));var _0x92d8=function(_0x41101b,_0x1cfec7){_0x41101b=_0x41101b-0x0;var _0x56c6e4=_0x2d89[_0x41101b];return _0x56c6e4;};'use strict';var moment=require(_0x92d8('0x0'));var Sequelize=require('sequelize');module[_0x92d8('0x1')]={'uniqueid':{'type':Sequelize[_0x92d8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x92d8('0x3')](_0x92d8('0x4'),_0x92d8('0x5'),'queue'),'allowNull':![],'defaultValue':_0x92d8('0x6')},'transferredAt':{'type':Sequelize[_0x92d8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x92d8('0x8')]}}; \ No newline at end of file +var _0x35ad=['queue','DATE','moment','sequelize','exports','STRING','ENUM'];(function(_0x31a3cd,_0x8fe4a4){var _0x4ebaad=function(_0x4d89be){while(--_0x4d89be){_0x31a3cd['push'](_0x31a3cd['shift']());}};_0x4ebaad(++_0x8fe4a4);}(_0x35ad,0x87));var _0xd35a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x35ad[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xd35a('0x0'));var Sequelize=require(_0xd35a('0x1'));module[_0xd35a('0x2')]={'uniqueid':{'type':Sequelize[_0xd35a('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd35a('0x4')]('account','agent',_0xd35a('0x5')),'allowNull':![],'defaultValue':_0xd35a('0x5')},'transferredAt':{'type':Sequelize[_0xd35a('0x6')],'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 c99a9d0..f78d215 100644 --- a/server/api/mailTransferReport/mailTransferReport.controller.js +++ b/server/api/mailTransferReport/mailTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x507506,_0x332dc0){var _0x17f5d8=function(_0x31ba26){while(--_0x31ba26){_0x507506['push'](_0x507506['shift']());}};_0x17f5d8(++_0x332dc0);}(_0x7a54,0x106));var _0x47a5=function(_0x1aa0e1,_0x2ea7c4){_0x1aa0e1=_0x1aa0e1-0x0;var _0x20b156=_0x7a54[_0x1aa0e1];return _0x20b156;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['MailTransferReport'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['MailTransferReport'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};exports[_0x47a5('0x47')]=function(_0x1163e3,_0x9ea93e){return db[_0x47a5('0x25')][_0x47a5('0x47')]()[_0x47a5('0x1e')](respondWithResult(_0x9ea93e,null))['catch'](handleError(_0x9ea93e,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','pick','filter','where','merge','VIRTUAL','options','MailTransferReport','count','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','describe','html-pdf'];(function(_0xb37061,_0x44f8ab){var _0x2cd124=function(_0x1b1ce6){while(--_0x1b1ce6){_0xb37061['push'](_0xb37061['shift']());}};_0x2cd124(++_0x44f8ab);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=_[_0x7995('0x2a')](db['MailTransferReport'][_0x7995('0x2b')],function(_0x514445){return{'name':_0x514445[_0x7995('0x2c')],'type':_0x514445[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x49bc7e['model']=_['map'](_0x132a42,'name');_0x49bc7e[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x47625f[_0x7995('0x2f')]);_0x49bc7e[_0x7995('0x31')]=_[_0x7995('0x32')](_0x49bc7e[_0x7995('0x33')],_0x49bc7e['query']);_0x229742['attributes']=_[_0x7995('0x32')](_0x49bc7e['model'],qs[_0x7995('0x34')](_0x47625f[_0x7995('0x2f')][_0x7995('0x34')]));_0x229742[_0x7995('0x35')]=_0x229742[_0x7995('0x35')]['length']?_0x229742[_0x7995('0x35')]:_0x49bc7e[_0x7995('0x33')];if(!_0x47625f['query']['hasOwnProperty']('nolimit')){_0x229742[_0x7995('0x1f')]=qs[_0x7995('0x1f')](_0x47625f['query'][_0x7995('0x1f')]);_0x229742['offset']=qs[_0x7995('0x1e')](_0x47625f[_0x7995('0x2f')][_0x7995('0x1e')]);}_0x229742['order']=qs['sort'](_0x47625f[_0x7995('0x2f')]['sort']);_0x229742['where']=qs[_0x7995('0x31')](_[_0x7995('0x36')](_0x47625f['query'],_0x49bc7e[_0x7995('0x31')]));if(_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]){_0x229742[_0x7995('0x38')]=_[_0x7995('0x39')](_0x229742['where'],{'$or':_[_0x7995('0x2a')](_0x132a42,function(_0x242713){if(_0x242713[_0x7995('0x2d')]!==_0x7995('0x3a')){var _0x4b1541={};_0x4b1541[_0x242713[_0x7995('0x28')]]={'$like':'%'+_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]+'%'};return _0x4b1541;}})});}_0x229742=_[_0x7995('0x39')]({},_0x229742,_0x47625f[_0x7995('0x3b')]);var _0x1035dc={'where':_0x229742['where']};return db[_0x7995('0x3c')][_0x7995('0x3d')](_0x1035dc)[_0x7995('0x24')](function(_0x2ea47f){_0xf16cc2[_0x7995('0x3d')]=_0x2ea47f;if(_0x47625f[_0x7995('0x2f')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x3c')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x270d52){_0xf16cc2[_0x7995('0x41')]=_0x270d52;return _0xf16cc2;})['then'](respondWithFilteredResult(_0x5911c3,_0x229742))['catch'](handleError(_0x5911c3,null));};exports[_0x7995('0x42')]=function(_0x7325e8,_0x58523e){var _0x4b0855={'raw':!![],'where':{'id':_0x7325e8['params']['id']}},_0x3f8522={};_0x3f8522['model']=_[_0x7995('0x30')](db[_0x7995('0x3c')][_0x7995('0x2b')]);_0x3f8522['query']=_[_0x7995('0x30')](_0x7325e8['query']);_0x3f8522[_0x7995('0x31')]=_['intersection'](_0x3f8522['model'],_0x3f8522[_0x7995('0x2f')]);_0x4b0855[_0x7995('0x35')]=_[_0x7995('0x32')](_0x3f8522[_0x7995('0x33')],qs['fields'](_0x7325e8[_0x7995('0x2f')][_0x7995('0x34')]));_0x4b0855[_0x7995('0x35')]=_0x4b0855[_0x7995('0x35')]['length']?_0x4b0855['attributes']:_0x3f8522[_0x7995('0x33')];if(_0x7325e8['query'][_0x7995('0x3e')]){_0x4b0855['include']=[{'all':!![]}];}_0x4b0855=_[_0x7995('0x39')]({},_0x4b0855,_0x7325e8['options']);return db[_0x7995('0x3c')][_0x7995('0x43')](_0x4b0855)['then'](handleEntityNotFound(_0x58523e,null))[_0x7995('0x24')](respondWithResult(_0x58523e,null))[_0x7995('0x44')](handleError(_0x58523e,null));};exports[_0x7995('0x45')]=function(_0xb70a51,_0x4c6837){return db[_0x7995('0x3c')][_0x7995('0x45')](_0xb70a51[_0x7995('0x46')],{})['then'](respondWithResult(_0x4c6837,0xc9))[_0x7995('0x44')](handleError(_0x4c6837,null));};exports[_0x7995('0x47')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x46')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3c')][_0x7995('0x43')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x46')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x44')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3c')]['find']({'where':{'id':_0xddf537[_0x7995('0x48')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x49')]=function(_0x1fe77e,_0x12d4b8){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x12d4b8,null))[_0x7995('0x44')](handleError(_0x12d4b8,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 2de35ac..11828dc 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 _0x7795=['MailTransferReport','uniqueid','lodash','util','api','moment','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define'];(function(_0x56e6bc,_0x5efd16){var _0x17f211=function(_0xd57ca0){while(--_0xd57ca0){_0x56e6bc['push'](_0x56e6bc['shift']());}};_0x17f211(++_0x5efd16);}(_0x7795,0x141));var _0x5779=function(_0x145d65,_0x1a05b5){_0x145d65=_0x145d65-0x0;var _0xde3ddb=_0x7795[_0x145d65];return _0xde3ddb;};'use strict';var _=require(_0x5779('0x0'));var util=require(_0x5779('0x1'));var logger=require('../../config/logger')(_0x5779('0x2'));var moment=require(_0x5779('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5779('0x4'));var config=require(_0x5779('0x5'));var attributes=require(_0x5779('0x6'));module[_0x5779('0x7')]=function(_0xa1ce06,_0x142fb2){return _0xa1ce06[_0x5779('0x8')](_0x5779('0x9'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x5779('0xa'),'fields':[_0x5779('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa4ac=['define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xa4ac,0x16c));var _0xca4a=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0xa4ac[_0x490be3];return _0x3f5140;};'use strict';var _=require(_0xca4a('0x0'));var util=require(_0xca4a('0x1'));var logger=require(_0xca4a('0x2'))(_0xca4a('0x3'));var moment=require('moment');var BPromise=require(_0xca4a('0x4'));var rp=require(_0xca4a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca4a('0x6'));var config=require(_0xca4a('0x7'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x23a1a6,_0x13ff06){return _0x23a1a6[_0xca4a('0x8')](_0xca4a('0x9'),attributes,{'tableName':_0xca4a('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xca4a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 6b72e6c..592649e 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 _0x8b1f=['ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x440917,_0x20ea7b){var _0x5e906b=function(_0x27cba5){while(--_0x27cba5){_0x440917['push'](_0x440917['shift']());}};_0x5e906b(++_0x20ea7b);}(_0x8b1f,0x1b5));var _0xf8b1=function(_0x5a5199,_0x262edd){_0x5a5199=_0x5a5199-0x0;var _0x2a06e0=_0x8b1f[_0x5a5199];return _0x2a06e0;};'use strict';var _=require(_0xf8b1('0x0'));var util=require(_0xf8b1('0x1'));var moment=require(_0xf8b1('0x2'));var BPromise=require(_0xf8b1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf8b1('0x4'));var db=require(_0xf8b1('0x5'))['db'];var utils=require(_0xf8b1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xf8b1('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf8b1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13c714,_0x21b339,_0x1caf48){return new BPromise(function(_0x57bf99,_0x4f0cb6){return client[_0xf8b1('0x9')](_0x13c714,_0x1caf48)[_0xf8b1('0xa')](function(_0x21ff39){logger[_0xf8b1('0xb')](_0xf8b1('0xc'),_0x21b339,'request\x20sent');logger[_0xf8b1('0xd')](_0xf8b1('0xe'),_0x21b339,_0xf8b1('0xf'),JSON[_0xf8b1('0x10')](_0x21ff39));if(_0x21ff39[_0xf8b1('0x11')]){if(_0x21ff39[_0xf8b1('0x11')]['code']===0x1f4){logger[_0xf8b1('0x11')](_0xf8b1('0xc'),_0x21b339,_0x21ff39[_0xf8b1('0x11')][_0xf8b1('0x12')]);return _0x4f0cb6(_0x21ff39['error'][_0xf8b1('0x12')]);}logger[_0xf8b1('0x11')](_0xf8b1('0xc'),_0x21b339,_0x21ff39[_0xf8b1('0x11')][_0xf8b1('0x12')]);return _0x57bf99(_0x21ff39[_0xf8b1('0x11')][_0xf8b1('0x12')]);}else{logger['info'](_0xf8b1('0xc'),_0x21b339,_0xf8b1('0xf'));_0x57bf99(_0x21ff39[_0xf8b1('0x13')]['message']);}})[_0xf8b1('0x14')](function(_0x13ade9){logger[_0xf8b1('0x11')](_0xf8b1('0xc'),_0x21b339,_0x13ade9);_0x4f0cb6(_0x13ade9);});});} \ No newline at end of file +var _0x126e=['../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x45ba49,_0x27b3b3){var _0x333c1a=function(_0x322413){while(--_0x322413){_0x45ba49['push'](_0x45ba49['shift']());}};_0x333c1a(++_0x27b3b3);}(_0x126e,0xae));var _0xe126=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x126e[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require(_0xe126('0x0'));var moment=require('moment');var BPromise=require(_0xe126('0x1'));var rs=require(_0xe126('0x2'));var fs=require('fs');var Redis=require(_0xe126('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe126('0x4'));var logger=require('../../config/logger')(_0xe126('0x5'));var config=require(_0xe126('0x6'));var jayson=require(_0xe126('0x7'));var client=jayson[_0xe126('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28fb01,_0x5afe50,_0x2791ee){return new BPromise(function(_0x25b533,_0x504f7e){return client[_0xe126('0x9')](_0x28fb01,_0x2791ee)[_0xe126('0xa')](function(_0xa01d4a){logger[_0xe126('0xb')](_0xe126('0xc'),_0x5afe50,_0xe126('0xd'));logger['debug'](_0xe126('0xe'),_0x5afe50,'request\x20sent',JSON[_0xe126('0xf')](_0xa01d4a));if(_0xa01d4a[_0xe126('0x10')]){if(_0xa01d4a['error'][_0xe126('0x11')]===0x1f4){logger[_0xe126('0x10')](_0xe126('0xc'),_0x5afe50,_0xa01d4a[_0xe126('0x10')][_0xe126('0x12')]);return _0x504f7e(_0xa01d4a[_0xe126('0x10')]['message']);}logger[_0xe126('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x5afe50,_0xa01d4a['error'][_0xe126('0x12')]);return _0x25b533(_0xa01d4a[_0xe126('0x10')][_0xe126('0x12')]);}else{logger[_0xe126('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x5afe50,_0xe126('0xd'));_0x25b533(_0xa01d4a[_0xe126('0x13')][_0xe126('0x12')]);}})['catch'](function(_0x28d415){logger[_0xe126('0x10')](_0xe126('0xc'),_0x5afe50,_0x28d415);_0x504f7e(_0x28d415);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 979d921..6a791d6 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 _0x320e=['multer','express','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x534ae9,_0x5735c1){var _0x2dc1e7=function(_0x58048a){while(--_0x58048a){_0x534ae9['push'](_0x534ae9['shift']());}};_0x2dc1e7(++_0x5735c1);}(_0x320e,0x8c));var _0xe320=function(_0x55e659,_0x233aa4){_0x55e659=_0x55e659-0x0;var _0xca08c7=_0x320e[_0x55e659];return _0xca08c7;};'use strict';var multer=require(_0xe320('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe320('0x1'));var router=express[_0xe320('0x2')]();var auth=require(_0xe320('0x3'));var interaction=require(_0xe320('0x4'));var config=require('../../config/environment');var controller=require(_0xe320('0x5'));router[_0xe320('0x6')]('/',auth[_0xe320('0x7')](),controller[_0xe320('0x8')]);router[_0xe320('0x6')](_0xe320('0x9'),auth['isAuthenticated'](),controller[_0xe320('0xa')]);router[_0xe320('0x6')](_0xe320('0xb'),auth[_0xe320('0x7')](),controller[_0xe320('0xc')]);router[_0xe320('0xd')]('/',auth[_0xe320('0x7')](),controller[_0xe320('0xe')]);router[_0xe320('0xf')](_0xe320('0xb'),auth[_0xe320('0x7')](),controller[_0xe320('0x10')]);router[_0xe320('0x11')]('/:id',auth[_0xe320('0x7')](),controller[_0xe320('0x12')]);module[_0xe320('0x13')]=router; \ No newline at end of file +var _0x9839=['Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express'];(function(_0xd9637d,_0x23e20f){var _0x5042d4=function(_0x4e4c83){while(--_0x4e4c83){_0xd9637d['push'](_0xd9637d['shift']());}};_0x5042d4(++_0x23e20f);}(_0x9839,0x1df));var _0x9983=function(_0x12990e,_0x18c06a){_0x12990e=_0x12990e-0x0;var _0x145dff=_0x9839[_0x12990e];return _0x145dff;};'use strict';var multer=require(_0x9983('0x0'));var util=require(_0x9983('0x1'));var path=require(_0x9983('0x2'));var timeout=require('connect-timeout');var express=require(_0x9983('0x3'));var router=express[_0x9983('0x4')]();var auth=require(_0x9983('0x5'));var interaction=require(_0x9983('0x6'));var config=require('../../config/environment');var controller=require(_0x9983('0x7'));router['get']('/',auth[_0x9983('0x8')](),controller[_0x9983('0x9')]);router[_0x9983('0xa')](_0x9983('0xb'),auth[_0x9983('0x8')](),controller[_0x9983('0xc')]);router[_0x9983('0xa')](_0x9983('0xd'),auth['isAuthenticated'](),controller[_0x9983('0xe')]);router[_0x9983('0xf')]('/',auth['isAuthenticated'](),controller[_0x9983('0x10')]);router[_0x9983('0x11')](_0x9983('0xd'),auth['isAuthenticated'](),controller[_0x9983('0x12')]);router[_0x9983('0x13')]('/:id',auth[_0x9983('0x8')](),controller[_0x9983('0x14')]);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 b116002..5596d01 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 _0x0419=['STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports'];(function(_0x5b2742,_0x2f8729){var _0x2e5723=function(_0x35f2b9){while(--_0x35f2b9){_0x5b2742['push'](_0x5b2742['shift']());}};_0x2e5723(++_0x2f8729);}(_0x0419,0x67));var _0x9041=function(_0xb4f240,_0x15f734){_0xb4f240=_0xb4f240-0x0;var _0x30682a=_0x0419[_0xb4f240];return _0x30682a;};'use strict';var Sequelize=require(_0x9041('0x0'));var moment=require('moment');module[_0x9041('0x1')]={'channel':{'type':Sequelize[_0x9041('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x9041('0x2')]},'type':{'type':Sequelize[_0x9041('0x2')],'defaultValue':_0x9041('0x3'),'comment':_0x9041('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x9041('0x5')]},'exitAt':{'type':Sequelize[_0x9041('0x5')],'set':function(_0x2ccb96){var _0x23d7d6=moment(_0x2ccb96);var _0x24ebe3=moment(this['getDataValue']('enterAt'));var _0x3e81b7=_0x23d7d6[_0x9041('0x6')](_0x24ebe3,'seconds');this[_0x9041('0x7')](_0x9041('0x8'),_0x2ccb96);this['setDataValue'](_0x9041('0x9'),_0x3e81b7||null);}},'data1':{'type':Sequelize[_0x9041('0x2')],'comment':_0x9041('0xa')},'data2':{'type':Sequelize[_0x9041('0x2')],'comment':_0x9041('0xb')},'data3':{'type':Sequelize[_0x9041('0x2')],'comment':_0x9041('0xc')},'data4':{'type':Sequelize['STRING'],'comment':_0x9041('0xd')},'data5':{'type':Sequelize['STRING'],'comment':_0x9041('0xe')},'role':{'type':Sequelize[_0x9041('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x9041('0x2')]}}; \ No newline at end of file +var _0xc3bd=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[queue]','sequelize','moment','exports','STRING'];(function(_0x4a04ab,_0x4d5245){var _0x19b95a=function(_0x19fd10){while(--_0x19fd10){_0x4a04ab['push'](_0x4a04ab['shift']());}};_0x19b95a(++_0x4d5245);}(_0xc3bd,0x1a0));var _0xdc3b=function(_0x277306,_0x49fa48){_0x277306=_0x277306-0x0;var _0x1694aa=_0xc3bd[_0x277306];return _0x1694aa;};'use strict';var Sequelize=require(_0xdc3b('0x0'));var moment=require(_0xdc3b('0x1'));module[_0xdc3b('0x2')]={'channel':{'type':Sequelize[_0xdc3b('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xdc3b('0x3')]},'type':{'type':Sequelize[_0xdc3b('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xdc3b('0x4')},'duration':{'type':Sequelize[_0xdc3b('0x5')]},'enterAt':{'type':Sequelize[_0xdc3b('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x3e42c0){var _0x41cbe4=moment(_0x3e42c0);var _0x1c9935=moment(this[_0xdc3b('0x7')](_0xdc3b('0x8')));var _0x76be52=_0x41cbe4['diff'](_0x1c9935,_0xdc3b('0x9'));this[_0xdc3b('0xa')]('exitAt',_0x3e42c0);this[_0xdc3b('0xa')]('duration',_0x76be52||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xdc3b('0xb')},'data2':{'type':Sequelize[_0xdc3b('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0xdc3b('0xc')},'data4':{'type':Sequelize[_0xdc3b('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0xdc3b('0xd')},'role':{'type':Sequelize[_0xdc3b('0x3')]},'internal':{'type':Sequelize[_0xdc3b('0x5')]},'uniqueid':{'type':Sequelize[_0xdc3b('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index ed7b79a..c53baec 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 _0x53b6=['sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','set','apply','save','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','MemberReport','findAll','rows','catch','show','params','create','body','update','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x221e6d,_0x513ef7){var _0x1505c0=function(_0x4e042d){while(--_0x4e042d){_0x221e6d['push'](_0x221e6d['shift']());}};_0x1505c0(++_0x513ef7);}(_0x53b6,0x93));var _0x653b=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x53b6[_0x618414];return _0x21c19a;};'use strict';var pdf=require(_0x653b('0x0'));var emlformat=require(_0x653b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x653b('0x2'));var jsonpatch=require(_0x653b('0x3'));var rp=require(_0x653b('0x4'));var moment=require(_0x653b('0x5'));var BPromise=require(_0x653b('0x6'));var Mustache=require(_0x653b('0x7'));var util=require(_0x653b('0x8'));var path=require('path');var sox=require(_0x653b('0x9'));var csv=require(_0x653b('0xa'));var ejs=require(_0x653b('0xb'));var fs=require('fs');var _=require(_0x653b('0xc'));var squel=require('squel');var crypto=require(_0x653b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x653b('0xe'));var toCsv=require(_0x653b('0xa'));var querystring=require(_0x653b('0xf'));var Papa=require(_0x653b('0x10'));var Redis=require(_0x653b('0x11'));var authService=require(_0x653b('0x12'));var qs=require(_0x653b('0x13'));var as=require(_0x653b('0x14'));var hardwareService=require(_0x653b('0x15'));var logger=require(_0x653b('0x16'))(_0x653b('0x17'));var utils=require(_0x653b('0x18'));var config=require(_0x653b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b1be8,_0x547759){_0x547759=_0x547759||0xcc;return function(_0x49c7a6){if(_0x49c7a6){return _0x4b1be8['sendStatus'](_0x547759);}return _0x4b1be8[_0x653b('0x1a')](_0x547759)[_0x653b('0x1b')]();};}function respondWithResult(_0x17e0ca,_0x482c88){_0x482c88=_0x482c88||0xc8;return function(_0x18c5db){if(_0x18c5db){return _0x17e0ca[_0x653b('0x1a')](_0x482c88)[_0x653b('0x1c')](_0x18c5db);}};}function respondWithFilteredResult(_0x3b74e5,_0x493111){return function(_0x1a27f5){if(_0x1a27f5){var _0x43d2bd=_0x1a27f5[_0x653b('0x1d')],_0x43b7e4=_0x493111[_0x653b('0x1e')],_0x3d5e7c=_0x493111['offset']+_0x493111['limit'],_0x507ee3;if(_0x3d5e7c>=_0x43d2bd){_0x3d5e7c=_0x43d2bd;_0x507ee3=0xc8;}else{_0x507ee3=0xce;}_0x3b74e5[_0x653b('0x1a')](_0x507ee3);return _0x3b74e5[_0x653b('0x1f')]('Content-Range',_0x43b7e4+'-'+_0x3d5e7c+'/'+_0x43d2bd)[_0x653b('0x1c')](_0x1a27f5);}return null;};}function patchUpdates(_0x451922){return function(_0x2f054a){try{jsonpatch[_0x653b('0x20')](_0x2f054a,_0x451922,!![]);}catch(_0xc16edc){return BPromise['reject'](_0xc16edc);}return _0x2f054a[_0x653b('0x21')]();};}function saveUpdates(_0x57e385,_0xa3b3c0){return function(_0xe89165){if(_0xe89165){return _0xe89165['update'](_0x57e385)['then'](function(_0xe0c207){return _0xe0c207;});}return null;};}function removeEntity(_0x24e051,_0x552a0a){return function(_0x243b6c){if(_0x243b6c){return _0x243b6c[_0x653b('0x22')]()[_0x653b('0x23')](function(){_0x24e051[_0x653b('0x1a')](0xcc)[_0x653b('0x1b')]();});}};}function handleEntityNotFound(_0x513f25,_0xd3ae83){return function(_0x4a2f96){if(!_0x4a2f96){_0x513f25[_0x653b('0x24')](0x194);}return _0x4a2f96;};}function handleError(_0x15528d,_0x1bbf02){_0x1bbf02=_0x1bbf02||0x1f4;return function(_0x609272){logger[_0x653b('0x25')](_0x609272[_0x653b('0x26')]);if(_0x609272[_0x653b('0x27')]){delete _0x609272['name'];}_0x15528d[_0x653b('0x1a')](_0x1bbf02)[_0x653b('0x28')](_0x609272);};}exports[_0x653b('0x29')]=function(_0x38d066,_0x4fe84c){var _0x385ce7={},_0x3d3d06={},_0x12373c={'count':0x0,'rows':[]};var _0x445556=_[_0x653b('0x2a')](db['MemberReport'][_0x653b('0x2b')],function(_0x11b7f5){return{'name':_0x11b7f5[_0x653b('0x2c')],'type':_0x11b7f5[_0x653b('0x2d')][_0x653b('0x2e')]};});_0x3d3d06['model']=_[_0x653b('0x2a')](_0x445556,_0x653b('0x27'));_0x3d3d06[_0x653b('0x2f')]=_[_0x653b('0x30')](_0x38d066[_0x653b('0x2f')]);_0x3d3d06['filters']=_[_0x653b('0x31')](_0x3d3d06['model'],_0x3d3d06[_0x653b('0x2f')]);_0x385ce7[_0x653b('0x32')]=_[_0x653b('0x31')](_0x3d3d06[_0x653b('0x33')],qs[_0x653b('0x34')](_0x38d066[_0x653b('0x2f')][_0x653b('0x34')]));_0x385ce7['attributes']=_0x385ce7['attributes'][_0x653b('0x35')]?_0x385ce7[_0x653b('0x32')]:_0x3d3d06[_0x653b('0x33')];if(!_0x38d066[_0x653b('0x2f')][_0x653b('0x36')]('nolimit')){_0x385ce7['limit']=qs[_0x653b('0x37')](_0x38d066['query']['limit']);_0x385ce7['offset']=qs[_0x653b('0x1e')](_0x38d066[_0x653b('0x2f')]['offset']);}_0x385ce7[_0x653b('0x38')]=qs[_0x653b('0x39')](_0x38d066[_0x653b('0x2f')][_0x653b('0x39')]);_0x385ce7[_0x653b('0x3a')]=qs[_0x653b('0x3b')](_[_0x653b('0x3c')](_0x38d066[_0x653b('0x2f')],_0x3d3d06['filters']));if(_0x38d066[_0x653b('0x2f')][_0x653b('0x3d')]){_0x385ce7[_0x653b('0x3a')]=_[_0x653b('0x3e')](_0x385ce7['where'],{'$or':_[_0x653b('0x2a')](_0x445556,function(_0x2fcb89){if(_0x2fcb89[_0x653b('0x2d')]!==_0x653b('0x3f')){var _0x1956ab={};_0x1956ab[_0x2fcb89[_0x653b('0x27')]]={'$like':'%'+_0x38d066[_0x653b('0x2f')][_0x653b('0x3d')]+'%'};return _0x1956ab;}})});}_0x385ce7=_[_0x653b('0x3e')]({},_0x385ce7,_0x38d066[_0x653b('0x40')]);var _0x1a197a={'where':_0x385ce7[_0x653b('0x3a')]};return db['MemberReport'][_0x653b('0x1d')](_0x1a197a)[_0x653b('0x23')](function(_0x50c5a6){_0x12373c[_0x653b('0x1d')]=_0x50c5a6;if(_0x38d066[_0x653b('0x2f')][_0x653b('0x41')]){_0x385ce7[_0x653b('0x42')]=[{'all':!![]}];}return db[_0x653b('0x43')][_0x653b('0x44')](_0x385ce7);})[_0x653b('0x23')](function(_0x409456){_0x12373c[_0x653b('0x45')]=_0x409456;return _0x12373c;})['then'](respondWithFilteredResult(_0x4fe84c,_0x385ce7))[_0x653b('0x46')](handleError(_0x4fe84c,null));};exports[_0x653b('0x47')]=function(_0x59c4e0,_0x5c8429){var _0x4d7a77={'raw':!![],'where':{'id':_0x59c4e0[_0x653b('0x48')]['id']}},_0x1458f4={};_0x1458f4['model']=_[_0x653b('0x30')](db[_0x653b('0x43')]['rawAttributes']);_0x1458f4['query']=_['keys'](_0x59c4e0[_0x653b('0x2f')]);_0x1458f4[_0x653b('0x3b')]=_[_0x653b('0x31')](_0x1458f4[_0x653b('0x33')],_0x1458f4[_0x653b('0x2f')]);_0x4d7a77[_0x653b('0x32')]=_[_0x653b('0x31')](_0x1458f4['model'],qs['fields'](_0x59c4e0['query'][_0x653b('0x34')]));_0x4d7a77['attributes']=_0x4d7a77[_0x653b('0x32')][_0x653b('0x35')]?_0x4d7a77[_0x653b('0x32')]:_0x1458f4[_0x653b('0x33')];if(_0x59c4e0[_0x653b('0x2f')][_0x653b('0x41')]){_0x4d7a77[_0x653b('0x42')]=[{'all':!![]}];}_0x4d7a77=_[_0x653b('0x3e')]({},_0x4d7a77,_0x59c4e0[_0x653b('0x40')]);return db['MemberReport']['find'](_0x4d7a77)['then'](handleEntityNotFound(_0x5c8429,null))['then'](respondWithResult(_0x5c8429,null))[_0x653b('0x46')](handleError(_0x5c8429,null));};exports[_0x653b('0x49')]=function(_0x3957bd,_0x11cd05){return db['MemberReport'][_0x653b('0x49')](_0x3957bd[_0x653b('0x4a')],{})[_0x653b('0x23')](respondWithResult(_0x11cd05,0xc9))[_0x653b('0x46')](handleError(_0x11cd05,null));};exports[_0x653b('0x4b')]=function(_0x2ee428,_0x927387){if(_0x2ee428['body']['id']){delete _0x2ee428[_0x653b('0x4a')]['id'];}return db[_0x653b('0x43')][_0x653b('0x4c')]({'where':{'id':_0x2ee428[_0x653b('0x48')]['id']}})[_0x653b('0x23')](handleEntityNotFound(_0x927387,null))[_0x653b('0x23')](saveUpdates(_0x2ee428[_0x653b('0x4a')],null))[_0x653b('0x23')](respondWithResult(_0x927387,null))[_0x653b('0x46')](handleError(_0x927387,null));};exports[_0x653b('0x22')]=function(_0x27f725,_0xf65f68){return db[_0x653b('0x43')]['find']({'where':{'id':_0x27f725[_0x653b('0x48')]['id']}})['then'](handleEntityNotFound(_0xf65f68,null))[_0x653b('0x23')](removeEntity(_0xf65f68,null))[_0x653b('0x46')](handleError(_0xf65f68,null));};exports[_0x653b('0x4d')]=function(_0x496c63,_0x112142){return db[_0x653b('0x43')][_0x653b('0x4d')]()[_0x653b('0x23')](respondWithResult(_0x112142,null))[_0x653b('0x46')](handleError(_0x112142,null));}; \ No newline at end of file +var _0xac61=['end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','name','index','map','MemberReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status'];(function(_0x522844,_0x2c7952){var _0x272f2c=function(_0x19812a){while(--_0x19812a){_0x522844['push'](_0x522844['shift']());}};_0x272f2c(++_0x2c7952);}(_0xac61,0xba));var _0x1ac6=function(_0x4dd611,_0x5d5084){_0x4dd611=_0x4dd611-0x0;var _0x3296b7=_0xac61[_0x4dd611];return _0x3296b7;};'use strict';var pdf=require(_0x1ac6('0x0'));var emlformat=require(_0x1ac6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1ac6('0x2'));var jsonpatch=require(_0x1ac6('0x3'));var rp=require(_0x1ac6('0x4'));var moment=require(_0x1ac6('0x5'));var BPromise=require(_0x1ac6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1ac6('0x7'));var sox=require('sox');var csv=require(_0x1ac6('0x8'));var ejs=require(_0x1ac6('0x9'));var fs=require('fs');var _=require(_0x1ac6('0xa'));var squel=require(_0x1ac6('0xb'));var crypto=require(_0x1ac6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1ac6('0xd'));var toCsv=require(_0x1ac6('0x8'));var querystring=require(_0x1ac6('0xe'));var Papa=require(_0x1ac6('0xf'));var Redis=require(_0x1ac6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1ac6('0x11'));var as=require(_0x1ac6('0x12'));var hardwareService=require(_0x1ac6('0x13'));var logger=require(_0x1ac6('0x14'))('api');var utils=require(_0x1ac6('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x277ef6,_0x55034a){_0x55034a=_0x55034a||0xcc;return function(_0x4cb2f0){if(_0x4cb2f0){return _0x277ef6[_0x1ac6('0x16')](_0x55034a);}return _0x277ef6[_0x1ac6('0x17')](_0x55034a)[_0x1ac6('0x18')]();};}function respondWithResult(_0x3a62e5,_0x4ae865){_0x4ae865=_0x4ae865||0xc8;return function(_0x58da24){if(_0x58da24){return _0x3a62e5['status'](_0x4ae865)['json'](_0x58da24);}};}function respondWithFilteredResult(_0x507a01,_0x4151b4){return function(_0x1d467f){if(_0x1d467f){var _0x90bf8b=_0x1d467f[_0x1ac6('0x19')],_0x5e073e=_0x4151b4[_0x1ac6('0x1a')],_0x37ef90=_0x4151b4[_0x1ac6('0x1a')]+_0x4151b4[_0x1ac6('0x1b')],_0x49e806;if(_0x37ef90>=_0x90bf8b){_0x37ef90=_0x90bf8b;_0x49e806=0xc8;}else{_0x49e806=0xce;}_0x507a01[_0x1ac6('0x17')](_0x49e806);return _0x507a01[_0x1ac6('0x1c')](_0x1ac6('0x1d'),_0x5e073e+'-'+_0x37ef90+'/'+_0x90bf8b)[_0x1ac6('0x1e')](_0x1d467f);}return null;};}function patchUpdates(_0x162172){return function(_0x571682){try{jsonpatch['apply'](_0x571682,_0x162172,!![]);}catch(_0x50521a){return BPromise[_0x1ac6('0x1f')](_0x50521a);}return _0x571682[_0x1ac6('0x20')]();};}function saveUpdates(_0x3bf9b6,_0x1a8def){return function(_0x3d899e){if(_0x3d899e){return _0x3d899e[_0x1ac6('0x21')](_0x3bf9b6)[_0x1ac6('0x22')](function(_0x5a4190){return _0x5a4190;});}return null;};}function removeEntity(_0x58c49d,_0x5de815){return function(_0x577817){if(_0x577817){return _0x577817[_0x1ac6('0x23')]()[_0x1ac6('0x22')](function(){_0x58c49d[_0x1ac6('0x17')](0xcc)[_0x1ac6('0x18')]();});}};}function handleEntityNotFound(_0x317297,_0x2c0b64){return function(_0x1c2138){if(!_0x1c2138){_0x317297[_0x1ac6('0x16')](0x194);}return _0x1c2138;};}function handleError(_0x2af7d0,_0x14b0e2){_0x14b0e2=_0x14b0e2||0x1f4;return function(_0x10da7f){logger[_0x1ac6('0x24')](_0x10da7f['stack']);if(_0x10da7f[_0x1ac6('0x25')]){delete _0x10da7f[_0x1ac6('0x25')];}_0x2af7d0[_0x1ac6('0x17')](_0x14b0e2)['send'](_0x10da7f);};}exports[_0x1ac6('0x26')]=function(_0x4dd3b1,_0x7b9769){var _0x289c06={},_0x5c041b={},_0x2d421a={'count':0x0,'rows':[]};var _0x27a161=_[_0x1ac6('0x27')](db[_0x1ac6('0x28')][_0x1ac6('0x29')],function(_0x47d2d1){return{'name':_0x47d2d1[_0x1ac6('0x2a')],'type':_0x47d2d1[_0x1ac6('0x2b')]['key']};});_0x5c041b[_0x1ac6('0x2c')]=_[_0x1ac6('0x27')](_0x27a161,'name');_0x5c041b[_0x1ac6('0x2d')]=_[_0x1ac6('0x2e')](_0x4dd3b1[_0x1ac6('0x2d')]);_0x5c041b['filters']=_[_0x1ac6('0x2f')](_0x5c041b[_0x1ac6('0x2c')],_0x5c041b[_0x1ac6('0x2d')]);_0x289c06[_0x1ac6('0x30')]=_['intersection'](_0x5c041b[_0x1ac6('0x2c')],qs[_0x1ac6('0x31')](_0x4dd3b1[_0x1ac6('0x2d')][_0x1ac6('0x31')]));_0x289c06['attributes']=_0x289c06[_0x1ac6('0x30')][_0x1ac6('0x32')]?_0x289c06[_0x1ac6('0x30')]:_0x5c041b[_0x1ac6('0x2c')];if(!_0x4dd3b1['query']['hasOwnProperty'](_0x1ac6('0x33'))){_0x289c06['limit']=qs[_0x1ac6('0x1b')](_0x4dd3b1[_0x1ac6('0x2d')][_0x1ac6('0x1b')]);_0x289c06[_0x1ac6('0x1a')]=qs[_0x1ac6('0x1a')](_0x4dd3b1[_0x1ac6('0x2d')][_0x1ac6('0x1a')]);}_0x289c06[_0x1ac6('0x34')]=qs['sort'](_0x4dd3b1[_0x1ac6('0x2d')][_0x1ac6('0x35')]);_0x289c06[_0x1ac6('0x36')]=qs[_0x1ac6('0x37')](_[_0x1ac6('0x38')](_0x4dd3b1[_0x1ac6('0x2d')],_0x5c041b[_0x1ac6('0x37')]));if(_0x4dd3b1[_0x1ac6('0x2d')][_0x1ac6('0x39')]){_0x289c06[_0x1ac6('0x36')]=_[_0x1ac6('0x3a')](_0x289c06[_0x1ac6('0x36')],{'$or':_[_0x1ac6('0x27')](_0x27a161,function(_0x1d6936){if(_0x1d6936['type']!==_0x1ac6('0x3b')){var _0x20bd61={};_0x20bd61[_0x1d6936[_0x1ac6('0x25')]]={'$like':'%'+_0x4dd3b1['query'][_0x1ac6('0x39')]+'%'};return _0x20bd61;}})});}_0x289c06=_[_0x1ac6('0x3a')]({},_0x289c06,_0x4dd3b1[_0x1ac6('0x3c')]);var _0x3697fc={'where':_0x289c06['where']};return db[_0x1ac6('0x28')]['count'](_0x3697fc)[_0x1ac6('0x22')](function(_0x5781dc){_0x2d421a[_0x1ac6('0x19')]=_0x5781dc;if(_0x4dd3b1[_0x1ac6('0x2d')][_0x1ac6('0x3d')]){_0x289c06['include']=[{'all':!![]}];}return db[_0x1ac6('0x28')][_0x1ac6('0x3e')](_0x289c06);})[_0x1ac6('0x22')](function(_0x1fb8f6){_0x2d421a['rows']=_0x1fb8f6;return _0x2d421a;})[_0x1ac6('0x22')](respondWithFilteredResult(_0x7b9769,_0x289c06))[_0x1ac6('0x3f')](handleError(_0x7b9769,null));};exports[_0x1ac6('0x40')]=function(_0x169567,_0x4484f4){var _0x52d6da={'raw':!![],'where':{'id':_0x169567[_0x1ac6('0x41')]['id']}},_0x45b176={};_0x45b176[_0x1ac6('0x2c')]=_[_0x1ac6('0x2e')](db[_0x1ac6('0x28')][_0x1ac6('0x29')]);_0x45b176['query']=_[_0x1ac6('0x2e')](_0x169567[_0x1ac6('0x2d')]);_0x45b176[_0x1ac6('0x37')]=_[_0x1ac6('0x2f')](_0x45b176[_0x1ac6('0x2c')],_0x45b176[_0x1ac6('0x2d')]);_0x52d6da[_0x1ac6('0x30')]=_[_0x1ac6('0x2f')](_0x45b176[_0x1ac6('0x2c')],qs['fields'](_0x169567['query']['fields']));_0x52d6da[_0x1ac6('0x30')]=_0x52d6da[_0x1ac6('0x30')]['length']?_0x52d6da[_0x1ac6('0x30')]:_0x45b176[_0x1ac6('0x2c')];if(_0x169567[_0x1ac6('0x2d')][_0x1ac6('0x3d')]){_0x52d6da['include']=[{'all':!![]}];}_0x52d6da=_[_0x1ac6('0x3a')]({},_0x52d6da,_0x169567[_0x1ac6('0x3c')]);return db[_0x1ac6('0x28')][_0x1ac6('0x42')](_0x52d6da)['then'](handleEntityNotFound(_0x4484f4,null))[_0x1ac6('0x22')](respondWithResult(_0x4484f4,null))[_0x1ac6('0x3f')](handleError(_0x4484f4,null));};exports[_0x1ac6('0x43')]=function(_0x5479ce,_0x4af320){return db['MemberReport'][_0x1ac6('0x43')](_0x5479ce[_0x1ac6('0x44')],{})[_0x1ac6('0x22')](respondWithResult(_0x4af320,0xc9))[_0x1ac6('0x3f')](handleError(_0x4af320,null));};exports[_0x1ac6('0x21')]=function(_0x2fe814,_0x4dd333){if(_0x2fe814[_0x1ac6('0x44')]['id']){delete _0x2fe814['body']['id'];}return db[_0x1ac6('0x28')][_0x1ac6('0x42')]({'where':{'id':_0x2fe814['params']['id']}})['then'](handleEntityNotFound(_0x4dd333,null))['then'](saveUpdates(_0x2fe814['body'],null))[_0x1ac6('0x22')](respondWithResult(_0x4dd333,null))[_0x1ac6('0x3f')](handleError(_0x4dd333,null));};exports['destroy']=function(_0x5e65cb,_0x2c4fb7){return db[_0x1ac6('0x28')][_0x1ac6('0x42')]({'where':{'id':_0x5e65cb[_0x1ac6('0x41')]['id']}})[_0x1ac6('0x22')](handleEntityNotFound(_0x2c4fb7,null))[_0x1ac6('0x22')](removeEntity(_0x2c4fb7,null))[_0x1ac6('0x3f')](handleError(_0x2c4fb7,null));};exports[_0x1ac6('0x45')]=function(_0x37e34a,_0xa50013){return db['MemberReport']['describe']()[_0x1ac6('0x22')](respondWithResult(_0xa50013,null))[_0x1ac6('0x3f')](handleError(_0xa50013,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 31de0f5..30eb47b 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 _0xf33b=['bluebird','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','util','../../config/logger','api','moment'];(function(_0x3594ee,_0x590e85){var _0x1ece8a=function(_0x562e88){while(--_0x562e88){_0x3594ee['push'](_0x3594ee['shift']());}};_0x1ece8a(++_0x590e85);}(_0xf33b,0x146));var _0xbf33=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0xf33b[_0x5466ab];return _0x40751a;};'use strict';var _=require('lodash');var util=require(_0xbf33('0x0'));var logger=require(_0xbf33('0x1'))(_0xbf33('0x2'));var moment=require(_0xbf33('0x3'));var BPromise=require(_0xbf33('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf33('0x5'));var rimraf=require(_0xbf33('0x6'));var config=require(_0xbf33('0x7'));var attributes=require(_0xbf33('0x8'));module[_0xbf33('0x9')]=function(_0x39586f,_0x40f7b3){return _0x39586f[_0xbf33('0xa')](_0xbf33('0xb'),attributes,{'tableName':_0xbf33('0xc'),'paranoid':![],'indexes':[{'name':_0xbf33('0xd'),'fields':[_0xbf33('0xe'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2303=['request-promise','../../config/environment','./memberReport.attributes','exports','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x527f65,_0xe880f2){var _0x3cd9c9=function(_0x53c7fb){while(--_0x53c7fb){_0x527f65['push'](_0x527f65['shift']());}};_0x3cd9c9(++_0xe880f2);}(_0x2303,0x1ba));var _0x3230=function(_0x335c9e,_0xf265bd){_0x335c9e=_0x335c9e-0x0;var _0x318ba5=_0x2303[_0x335c9e];return _0x318ba5;};'use strict';var _=require(_0x3230('0x0'));var util=require(_0x3230('0x1'));var logger=require(_0x3230('0x2'))(_0x3230('0x3'));var moment=require(_0x3230('0x4'));var BPromise=require(_0x3230('0x5'));var rp=require(_0x3230('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3230('0x7'));var attributes=require(_0x3230('0x8'));module[_0x3230('0x9')]=function(_0x2c6d26,_0x3c6e69){return _0x2c6d26['define']('MemberReport',attributes,{'tableName':_0x3230('0xa'),'paranoid':![],'indexes':[{'name':_0x3230('0xb'),'fields':[_0x3230('0xc'),_0x3230('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 199a9d2..1b0fbe8 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 _0x5c0f=['body','stringify','UpdateMemberReport','update','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','MemberReport,\x20%s,\x20%s','result','GetMemberReport','MemberReport','findAll','options','raw','where','include','map','model','attributes','info','CreateMemberReport','create'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x5c0f,0xcd));var _0xf5c0=function(_0x228ac9,_0x42f065){_0x228ac9=_0x228ac9-0x0;var _0x69fe02=_0x5c0f[_0x228ac9];return _0x69fe02;};'use strict';var _=require(_0xf5c0('0x0'));var util=require(_0xf5c0('0x1'));var moment=require(_0xf5c0('0x2'));var BPromise=require(_0xf5c0('0x3'));var rs=require(_0xf5c0('0x4'));var fs=require('fs');var Redis=require(_0xf5c0('0x5'));var db=require(_0xf5c0('0x6'))['db'];var utils=require(_0xf5c0('0x7'));var logger=require(_0xf5c0('0x8'))(_0xf5c0('0x9'));var config=require('../../config/environment');var jayson=require(_0xf5c0('0xa'));var client=jayson[_0xf5c0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x193670,_0x20f28b,_0x14bbc0){return new BPromise(function(_0xde1d3b,_0x2de227){return client[_0xf5c0('0xc')](_0x193670,_0x14bbc0)[_0xf5c0('0xd')](function(_0x3e0980){logger['info']('MemberReport,\x20%s,\x20%s',_0x20f28b,_0xf5c0('0xe'));logger[_0xf5c0('0xf')](_0xf5c0('0x10'),_0x20f28b,_0xf5c0('0xe'),JSON['stringify'](_0x3e0980));if(_0x3e0980['error']){if(_0x3e0980[_0xf5c0('0x11')][_0xf5c0('0x12')]===0x1f4){logger[_0xf5c0('0x11')]('MemberReport,\x20%s,\x20%s',_0x20f28b,_0x3e0980[_0xf5c0('0x11')]['message']);return _0x2de227(_0x3e0980[_0xf5c0('0x11')][_0xf5c0('0x13')]);}logger[_0xf5c0('0x11')](_0xf5c0('0x14'),_0x20f28b,_0x3e0980[_0xf5c0('0x11')][_0xf5c0('0x13')]);return _0xde1d3b(_0x3e0980[_0xf5c0('0x11')]['message']);}else{logger['info'](_0xf5c0('0x14'),_0x20f28b,_0xf5c0('0xe'));_0xde1d3b(_0x3e0980[_0xf5c0('0x15')][_0xf5c0('0x13')]);}})['catch'](function(_0x3f467e){logger[_0xf5c0('0x11')]('MemberReport,\x20%s,\x20%s',_0x20f28b,_0x3f467e);_0x2de227(_0x3f467e);});});}exports[_0xf5c0('0x16')]=function(_0x54216e){var _0x5ab895=this;return new Promise(function(_0x424f53,_0x4467e0){return db[_0xf5c0('0x17')][_0xf5c0('0x18')]({'raw':_0x54216e[_0xf5c0('0x19')]?_0x54216e['options'][_0xf5c0('0x1a')]===undefined?!![]:![]:!![],'where':_0x54216e[_0xf5c0('0x19')]?_0x54216e[_0xf5c0('0x19')][_0xf5c0('0x1b')]||null:null,'attributes':_0x54216e[_0xf5c0('0x19')]?_0x54216e['options']['attributes']||null:null,'limit':_0x54216e[_0xf5c0('0x19')]?_0x54216e[_0xf5c0('0x19')]['limit']||null:null,'include':_0x54216e[_0xf5c0('0x19')]?_0x54216e[_0xf5c0('0x19')][_0xf5c0('0x1c')]?_[_0xf5c0('0x1d')](_0x54216e[_0xf5c0('0x19')][_0xf5c0('0x1c')],function(_0x2444dd){return{'model':db[_0x2444dd[_0xf5c0('0x1e')]],'as':_0x2444dd['as'],'attributes':_0x2444dd[_0xf5c0('0x1f')],'include':_0x2444dd['include']?_[_0xf5c0('0x1d')](_0x2444dd['include'],function(_0x2bcd13){return{'model':db[_0x2bcd13[_0xf5c0('0x1e')]],'as':_0x2bcd13['as'],'attributes':_0x2bcd13[_0xf5c0('0x1f')],'include':_0x2bcd13['include']?_[_0xf5c0('0x1d')](_0x2bcd13[_0xf5c0('0x1c')],function(_0x39f784){return{'model':db[_0x39f784[_0xf5c0('0x1e')]],'as':_0x39f784['as'],'attributes':_0x39f784[_0xf5c0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf5c0('0xd')](function(_0x683384){logger[_0xf5c0('0x20')]('GetMemberReport',_0x54216e);logger[_0xf5c0('0xf')]('GetMemberReport',_0x54216e,JSON['stringify'](_0x683384));_0x424f53(_0x683384);})['catch'](function(_0x1b9584){logger[_0xf5c0('0x11')](_0xf5c0('0x16'),_0x1b9584[_0xf5c0('0x13')],_0x54216e);_0x4467e0(_0x5ab895[_0xf5c0('0x11')](0x1f4,_0x1b9584[_0xf5c0('0x13')]));});});};exports[_0xf5c0('0x21')]=function(_0x196ce7){var _0x56a0ca=this;return new Promise(function(_0x343598,_0x31a348){return db[_0xf5c0('0x17')][_0xf5c0('0x22')](_0x196ce7[_0xf5c0('0x23')],{'raw':_0x196ce7[_0xf5c0('0x19')]?_0x196ce7[_0xf5c0('0x19')][_0xf5c0('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x89e13b){logger[_0xf5c0('0x20')](_0xf5c0('0x21'),_0x196ce7);logger[_0xf5c0('0xf')](_0xf5c0('0x21'),_0x196ce7,JSON[_0xf5c0('0x24')](_0x89e13b));_0x343598(_0x89e13b);})['catch'](function(_0x1e559a){logger[_0xf5c0('0x11')](_0xf5c0('0x21'),_0x1e559a[_0xf5c0('0x13')],_0x196ce7);_0x31a348(_0x56a0ca['error'](0x1f4,_0x1e559a[_0xf5c0('0x13')]));});});};exports[_0xf5c0('0x25')]=function(_0x156ec5){var _0x340982=this;return new Promise(function(_0x1ab27d,_0x329180){return db[_0xf5c0('0x17')][_0xf5c0('0x26')](_0x156ec5[_0xf5c0('0x23')],{'raw':_0x156ec5[_0xf5c0('0x19')]?_0x156ec5[_0xf5c0('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x156ec5[_0xf5c0('0x19')]?_0x156ec5[_0xf5c0('0x19')]['where']||null:null,'attributes':_0x156ec5[_0xf5c0('0x19')]?_0x156ec5[_0xf5c0('0x19')][_0xf5c0('0x1f')]||null:null,'limit':_0x156ec5['options']?_0x156ec5[_0xf5c0('0x19')][_0xf5c0('0x27')]||null:null})['then'](function(_0x4adf3d){logger[_0xf5c0('0x20')](_0xf5c0('0x25'),_0x156ec5);logger['debug'](_0xf5c0('0x25'),_0x156ec5,JSON[_0xf5c0('0x24')](_0x4adf3d));_0x1ab27d(_0x4adf3d);})['catch'](function(_0x442c41){logger[_0xf5c0('0x11')]('UpdateMemberReport',_0x442c41[_0xf5c0('0x13')],_0x156ec5);_0x329180(_0x340982[_0xf5c0('0x11')](0x1f4,_0x442c41[_0xf5c0('0x13')]));});});}; \ No newline at end of file +var _0x61bc=['request\x20sent','debug','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','options','where','attributes','limit','include','map','model','CreateMemberReport','create','body','raw','UpdateMemberReport','update','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','MemberReport,\x20%s,\x20%s'];(function(_0x1f47eb,_0x293500){var _0x4c677f=function(_0x32ce58){while(--_0x32ce58){_0x1f47eb['push'](_0x1f47eb['shift']());}};_0x4c677f(++_0x293500);}(_0x61bc,0x13f));var _0xc61b=function(_0x50f93d,_0x5923d9){_0x50f93d=_0x50f93d-0x0;var _0x57d80d=_0x61bc[_0x50f93d];return _0x57d80d;};'use strict';var _=require(_0xc61b('0x0'));var util=require(_0xc61b('0x1'));var moment=require(_0xc61b('0x2'));var BPromise=require('bluebird');var rs=require(_0xc61b('0x3'));var fs=require('fs');var Redis=require(_0xc61b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc61b('0x5'));var logger=require(_0xc61b('0x6'))(_0xc61b('0x7'));var config=require(_0xc61b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc61b('0x9')][_0xc61b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x522604,_0x350ca7,_0x4f3380){return new BPromise(function(_0x11723c,_0x43627d){return client['request'](_0x522604,_0x4f3380)[_0xc61b('0xb')](function(_0x36fb82){logger[_0xc61b('0xc')](_0xc61b('0xd'),_0x350ca7,_0xc61b('0xe'));logger[_0xc61b('0xf')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x350ca7,_0xc61b('0xe'),JSON[_0xc61b('0x10')](_0x36fb82));if(_0x36fb82[_0xc61b('0x11')]){if(_0x36fb82['error'][_0xc61b('0x12')]===0x1f4){logger[_0xc61b('0x11')](_0xc61b('0xd'),_0x350ca7,_0x36fb82[_0xc61b('0x11')][_0xc61b('0x13')]);return _0x43627d(_0x36fb82[_0xc61b('0x11')][_0xc61b('0x13')]);}logger[_0xc61b('0x11')]('MemberReport,\x20%s,\x20%s',_0x350ca7,_0x36fb82[_0xc61b('0x11')][_0xc61b('0x13')]);return _0x11723c(_0x36fb82[_0xc61b('0x11')]['message']);}else{logger[_0xc61b('0xc')](_0xc61b('0xd'),_0x350ca7,_0xc61b('0xe'));_0x11723c(_0x36fb82[_0xc61b('0x14')]['message']);}})[_0xc61b('0x15')](function(_0x38be37){logger['error'](_0xc61b('0xd'),_0x350ca7,_0x38be37);_0x43627d(_0x38be37);});});}exports[_0xc61b('0x16')]=function(_0x16813e){var _0x479c6b=this;return new Promise(function(_0x335320,_0x497bbe){return db[_0xc61b('0x17')]['findAll']({'raw':_0x16813e[_0xc61b('0x18')]?_0x16813e['options']['raw']===undefined?!![]:![]:!![],'where':_0x16813e[_0xc61b('0x18')]?_0x16813e['options'][_0xc61b('0x19')]||null:null,'attributes':_0x16813e[_0xc61b('0x18')]?_0x16813e[_0xc61b('0x18')][_0xc61b('0x1a')]||null:null,'limit':_0x16813e['options']?_0x16813e['options'][_0xc61b('0x1b')]||null:null,'include':_0x16813e[_0xc61b('0x18')]?_0x16813e[_0xc61b('0x18')][_0xc61b('0x1c')]?_[_0xc61b('0x1d')](_0x16813e[_0xc61b('0x18')][_0xc61b('0x1c')],function(_0x1b4f24){return{'model':db[_0x1b4f24[_0xc61b('0x1e')]],'as':_0x1b4f24['as'],'attributes':_0x1b4f24[_0xc61b('0x1a')],'include':_0x1b4f24['include']?_[_0xc61b('0x1d')](_0x1b4f24[_0xc61b('0x1c')],function(_0x54021c){return{'model':db[_0x54021c[_0xc61b('0x1e')]],'as':_0x54021c['as'],'attributes':_0x54021c[_0xc61b('0x1a')],'include':_0x54021c['include']?_[_0xc61b('0x1d')](_0x54021c['include'],function(_0x23c10c){return{'model':db[_0x23c10c[_0xc61b('0x1e')]],'as':_0x23c10c['as'],'attributes':_0x23c10c[_0xc61b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc61b('0xb')](function(_0x1c3e8c){logger[_0xc61b('0xc')]('GetMemberReport',_0x16813e);logger['debug'](_0xc61b('0x16'),_0x16813e,JSON[_0xc61b('0x10')](_0x1c3e8c));_0x335320(_0x1c3e8c);})[_0xc61b('0x15')](function(_0x33b694){logger[_0xc61b('0x11')](_0xc61b('0x16'),_0x33b694[_0xc61b('0x13')],_0x16813e);_0x497bbe(_0x479c6b[_0xc61b('0x11')](0x1f4,_0x33b694[_0xc61b('0x13')]));});});};exports[_0xc61b('0x1f')]=function(_0x5258c0){var _0x257b43=this;return new Promise(function(_0x38463b,_0x37c773){return db[_0xc61b('0x17')][_0xc61b('0x20')](_0x5258c0[_0xc61b('0x21')],{'raw':_0x5258c0['options']?_0x5258c0[_0xc61b('0x18')][_0xc61b('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x284f89){logger['info'](_0xc61b('0x1f'),_0x5258c0);logger[_0xc61b('0xf')](_0xc61b('0x1f'),_0x5258c0,JSON[_0xc61b('0x10')](_0x284f89));_0x38463b(_0x284f89);})[_0xc61b('0x15')](function(_0x58e7f9){logger['error'](_0xc61b('0x1f'),_0x58e7f9['message'],_0x5258c0);_0x37c773(_0x257b43[_0xc61b('0x11')](0x1f4,_0x58e7f9[_0xc61b('0x13')]));});});};exports[_0xc61b('0x23')]=function(_0x36bf8f){var _0x5031f9=this;return new Promise(function(_0x18527a,_0x2b670d){return db[_0xc61b('0x17')][_0xc61b('0x24')](_0x36bf8f[_0xc61b('0x21')],{'raw':_0x36bf8f[_0xc61b('0x18')]?_0x36bf8f[_0xc61b('0x18')][_0xc61b('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36bf8f[_0xc61b('0x18')]?_0x36bf8f[_0xc61b('0x18')][_0xc61b('0x19')]||null:null,'attributes':_0x36bf8f['options']?_0x36bf8f[_0xc61b('0x18')][_0xc61b('0x1a')]||null:null,'limit':_0x36bf8f['options']?_0x36bf8f[_0xc61b('0x18')]['limit']||null:null})['then'](function(_0x37165e){logger[_0xc61b('0xc')](_0xc61b('0x23'),_0x36bf8f);logger[_0xc61b('0xf')]('UpdateMemberReport',_0x36bf8f,JSON[_0xc61b('0x10')](_0x37165e));_0x18527a(_0x37165e);})[_0xc61b('0x15')](function(_0x271e7e){logger[_0xc61b('0x11')](_0xc61b('0x23'),_0x271e7e['message'],_0x36bf8f);_0x2b670d(_0x5031f9[_0xc61b('0x11')](0x1f4,_0x271e7e['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index c55d0f7..93cf4d2 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 _0xb7e7=['./migration.controller','get','multer','path','express','../../components/auth/service','../../config/environment'];(function(_0xd788b,_0x4e70cc){var _0x446300=function(_0xb2b463){while(--_0xb2b463){_0xd788b['push'](_0xd788b['shift']());}};_0x446300(++_0x4e70cc);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xb7e7[_0x1c8c28];return _0x1f59b4;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',controller['index']);module['exports']=router; \ No newline at end of file +var _0x34b7=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x493480,_0x333672){var _0x3efee8=function(_0x510128){while(--_0x510128){_0x493480['push'](_0x493480['shift']());}};_0x3efee8(++_0x333672);}(_0x34b7,0x196));var _0x734b=function(_0x15c5b8,_0x3b670f){_0x15c5b8=_0x15c5b8-0x0;var _0xd45fe6=_0x34b7[_0x15c5b8];return _0xd45fe6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var auth=require(_0x734b('0x4'));var interaction=require(_0x734b('0x5'));var config=require('../../config/environment');var controller=require('./migration.controller');router[_0x734b('0x6')]('/',controller[_0x734b('0x7')]);module[_0x734b('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 7c3bcd8..9cc40de 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 _0x7ba1=['version','sequelize','exports','STRING'];(function(_0xa03db6,_0x436e2c){var _0x1e7e80=function(_0x4d4747){while(--_0x4d4747){_0xa03db6['push'](_0xa03db6['shift']());}};_0x1e7e80(++_0x436e2c);}(_0x7ba1,0x1a1));var _0x17ba=function(_0x484075,_0x294942){_0x484075=_0x484075-0x0;var _0x4f6eaf=_0x7ba1[_0x484075];return _0x4f6eaf;};'use strict';var Sequelize=require(_0x17ba('0x0'));module[_0x17ba('0x1')]={'version':{'type':Sequelize[_0x17ba('0x2')],'unique':_0x17ba('0x3')}}; \ No newline at end of file +var _0xcf92=['version'];(function(_0x5e5568,_0x300d0d){var _0x557045=function(_0x2ee76c){while(--_0x2ee76c){_0x5e5568['push'](_0x5e5568['shift']());}};_0x557045(++_0x300d0d);}(_0xcf92,0x1eb));var _0x2cf9=function(_0x3e42dc,_0x1c84fe){_0x3e42dc=_0x3e42dc-0x0;var _0x3b8d5f=_0xcf92[_0x3e42dc];return _0x3b8d5f;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0x2cf9('0x0')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 49060ca..a1a94dc 100644 --- a/server/api/migration/migration.controller.js +++ b/server/api/migration/migration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','Migration','then','include','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0xd6dce0,_0x25f5cf){var _0x1cbb77=function(_0x489312){while(--_0x489312){_0xd6dce0['push'](_0xd6dce0['shift']());}};_0x1cbb77(++_0x25f5cf);}(_0x5f2f,0x73));var _0xf5f2=function(_0xd34c38,_0x455c59){_0xd34c38=_0xd34c38-0x0;var _0xd180d6=_0x5f2f[_0xd34c38];return _0xd180d6;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var db=require(_0xf5f2('0x16'))['db'];function respondWithStatusCode(_0x14b51f,_0x331482){_0x331482=_0x331482||0xcc;return function(_0x3f2997){if(_0x3f2997){return _0x14b51f[_0xf5f2('0x17')](_0x331482);}return _0x14b51f[_0xf5f2('0x18')](_0x331482)['end']();};}function respondWithResult(_0x5850f4,_0xea612c){_0xea612c=_0xea612c||0xc8;return function(_0x269909){if(_0x269909){return _0x5850f4[_0xf5f2('0x18')](_0xea612c)[_0xf5f2('0x19')](_0x269909);}};}function respondWithFilteredResult(_0x4d97fc,_0xafe430){return function(_0x286197){if(_0x286197){var _0x17d656=_0x286197[_0xf5f2('0x1a')],_0x1b6dd2=_0xafe430[_0xf5f2('0x1b')],_0x23e23a=_0xafe430[_0xf5f2('0x1b')]+_0xafe430[_0xf5f2('0x1c')],_0x3a9dbb;if(_0x23e23a>=_0x17d656){_0x23e23a=_0x17d656;_0x3a9dbb=0xc8;}else{_0x3a9dbb=0xce;}_0x4d97fc[_0xf5f2('0x18')](_0x3a9dbb);return _0x4d97fc[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x1b6dd2+'-'+_0x23e23a+'/'+_0x17d656)[_0xf5f2('0x19')](_0x286197);}return null;};}function patchUpdates(_0x3cf5ea){return function(_0x626999){try{jsonpatch[_0xf5f2('0x1f')](_0x626999,_0x3cf5ea,!![]);}catch(_0x56acc5){return BPromise[_0xf5f2('0x20')](_0x56acc5);}return _0x626999[_0xf5f2('0x21')]();};}function saveUpdates(_0x49dac2,_0x47acfc){return function(_0x2d2805){if(_0x2d2805){return _0x2d2805[_0xf5f2('0x22')](_0x49dac2)['then'](function(_0x45b74f){return _0x45b74f;});}return null;};}function removeEntity(_0x170042,_0x39e44a){return function(_0x39c024){if(_0x39c024){return _0x39c024[_0xf5f2('0x23')]()['then'](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x24')]();});}};}function handleEntityNotFound(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(!_0x287ad5){_0x4e8bda['sendStatus'](0x194);}return _0x287ad5;};}function handleError(_0x529f07,_0x5f1124){_0x5f1124=_0x5f1124||0x1f4;return function(_0x3f79d5){logger[_0xf5f2('0x25')](_0x3f79d5[_0xf5f2('0x26')]);if(_0x3f79d5[_0xf5f2('0x27')]){delete _0x3f79d5[_0xf5f2('0x27')];}_0x529f07[_0xf5f2('0x18')](_0x5f1124)[_0xf5f2('0x28')](_0x3f79d5);};}exports[_0xf5f2('0x29')]=function(_0x4ab014,_0xaa2602){var _0x102449={},_0x375ca8={},_0x31bfcb={'count':0x0,'rows':[]};var _0x198c73=_[_0xf5f2('0x2a')](db['Migration']['rawAttributes'],function(_0x22c826){return{'name':_0x22c826[_0xf5f2('0x2b')],'type':_0x22c826[_0xf5f2('0x2c')]['key']};});_0x375ca8['model']=_[_0xf5f2('0x2a')](_0x198c73,_0xf5f2('0x27'));_0x375ca8[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x4ab014[_0xf5f2('0x2d')]);_0x375ca8['filters']=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],_0x375ca8['query']);_0x102449[_0xf5f2('0x30')]=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x102449[_0xf5f2('0x30')]=_0x102449[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x102449[_0xf5f2('0x30')]:_0x375ca8['model'];if(!_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x33')](_0xf5f2('0x34'))){_0x102449[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x1c')]);_0x102449['offset']=qs[_0xf5f2('0x1b')](_0x4ab014[_0xf5f2('0x2d')]['offset']);}_0x102449[_0xf5f2('0x35')]=qs['sort'](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x36')]);_0x102449[_0xf5f2('0x37')]=qs[_0xf5f2('0x38')](_['pick'](_0x4ab014['query'],_0x375ca8[_0xf5f2('0x38')]));if(_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]){_0x102449['where']=_[_0xf5f2('0x3a')](_0x102449['where'],{'$or':_[_0xf5f2('0x2a')](_0x198c73,function(_0x566c47){if(_0x566c47[_0xf5f2('0x2c')]!==_0xf5f2('0x3b')){var _0x5337a6={};_0x5337a6[_0x566c47[_0xf5f2('0x27')]]={'$like':'%'+_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]+'%'};return _0x5337a6;}})});}_0x102449=_[_0xf5f2('0x3a')]({},_0x102449,_0x4ab014['options']);var _0x5d2d82={'where':_0x102449[_0xf5f2('0x37')]};return db[_0xf5f2('0x3c')][_0xf5f2('0x1a')](_0x5d2d82)[_0xf5f2('0x3d')](function(_0x2c7f65){_0x31bfcb[_0xf5f2('0x1a')]=_0x2c7f65;if(_0x4ab014[_0xf5f2('0x2d')]['includeAll']){_0x102449[_0xf5f2('0x3e')]=[{'all':!![]}];}return db[_0xf5f2('0x3c')]['findAll'](_0x102449);})[_0xf5f2('0x3d')](function(_0x3f3895){_0x31bfcb[_0xf5f2('0x3f')]=_0x3f3895;return _0x31bfcb;})[_0xf5f2('0x3d')](respondWithFilteredResult(_0xaa2602,_0x102449))[_0xf5f2('0x40')](handleError(_0xaa2602,null));}; \ No newline at end of file +var _0xb10b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','Migration','include','rows','catch','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x2589cc,_0x137e46){var _0x569f34=function(_0x1bb08b){while(--_0x1bb08b){_0x2589cc['push'](_0x2589cc['shift']());}};_0x569f34(++_0x137e46);}(_0xb10b,0x12a));var _0xbb10=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0xb10b[_0x137d1d];return _0x485108;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['Migration'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]));if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]!=='VIRTUAL'){var _0x5e3fbd={};_0x5e3fbd[_0x1e5bbd['name']]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5e3fbd;}})});}_0x6ed43b=_[_0xbb10('0x3a')]({},_0x6ed43b,_0x2fdde9['options']);var _0x3c0cd7={'where':_0x6ed43b[_0xbb10('0x39')]};return db[_0xbb10('0x3b')]['count'](_0x3c0cd7)[_0xbb10('0x23')](function(_0x12238a){_0x1acce9[_0xbb10('0x1c')]=_0x12238a;if(_0x2fdde9[_0xbb10('0x30')]['includeAll']){_0x6ed43b[_0xbb10('0x3c')]=[{'all':!![]}];}return db[_0xbb10('0x3b')]['findAll'](_0x6ed43b);})[_0xbb10('0x23')](function(_0x2e3214){_0x1acce9[_0xbb10('0x3d')]=_0x2e3214;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x3e')](handleError(_0x24d586,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 18946f1..b6497b4 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 _0xe960=['migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','define','Migration'];(function(_0x2e85af,_0x4e8ad4){var _0x2ca79e=function(_0x466941){while(--_0x466941){_0x2e85af['push'](_0x2e85af['shift']());}};_0x2ca79e(++_0x4e8ad4);}(_0xe960,0x90));var _0x0e96=function(_0xfd4d2,_0x52e006){_0xfd4d2=_0xfd4d2-0x0;var _0xc51a6f=_0xe960[_0xfd4d2];return _0xc51a6f;};'use strict';var _=require(_0x0e96('0x0'));var util=require(_0x0e96('0x1'));var logger=require(_0x0e96('0x2'))(_0x0e96('0x3'));var moment=require(_0x0e96('0x4'));var BPromise=require(_0x0e96('0x5'));var rp=require(_0x0e96('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0e96('0x7'));var attributes=require('./migration.attributes');module['exports']=function(_0x448e25,_0x320d69){return _0x448e25[_0x0e96('0x8')](_0x0e96('0x9'),attributes,{'tableName':_0x0e96('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x934c=['moment','bluebird','path','rimraf','../../config/environment','./migration.attributes','exports','Migration','migrations','lodash','util','../../config/logger','api'];(function(_0x1e85e4,_0x4329e1){var _0x3d63eb=function(_0x81bdb5){while(--_0x81bdb5){_0x1e85e4['push'](_0x1e85e4['shift']());}};_0x3d63eb(++_0x4329e1);}(_0x934c,0x98));var _0xc934=function(_0x45c1d5,_0x39bb75){_0x45c1d5=_0x45c1d5-0x0;var _0x462dbf=_0x934c[_0x45c1d5];return _0x462dbf;};'use strict';var _=require(_0xc934('0x0'));var util=require(_0xc934('0x1'));var logger=require(_0xc934('0x2'))(_0xc934('0x3'));var moment=require(_0xc934('0x4'));var BPromise=require(_0xc934('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc934('0x6'));var rimraf=require(_0xc934('0x7'));var config=require(_0xc934('0x8'));var attributes=require(_0xc934('0x9'));module[_0xc934('0xa')]=function(_0x329a10,_0xa963ae){return _0x329a10['define'](_0xc934('0xb'),attributes,{'tableName':_0xc934('0xc'),'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 a912e23..9aad8ce 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 _0x4c96=['http','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x58da1d,_0x4c0dcd){var _0x20491a=function(_0x2eb867){while(--_0x2eb867){_0x58da1d['push'](_0x58da1d['shift']());}};_0x20491a(++_0x4c0dcd);}(_0x4c96,0xbb));var _0x64c9=function(_0x1719ac,_0x4ada21){_0x1719ac=_0x1719ac-0x0;var _0x493da6=_0x4c96[_0x1719ac];return _0x493da6;};'use strict';var _=require(_0x64c9('0x0'));var util=require(_0x64c9('0x1'));var moment=require(_0x64c9('0x2'));var BPromise=require(_0x64c9('0x3'));var rs=require(_0x64c9('0x4'));var fs=require('fs');var Redis=require(_0x64c9('0x5'));var db=require(_0x64c9('0x6'))['db'];var utils=require(_0x64c9('0x7'));var logger=require('../../config/logger')(_0x64c9('0x8'));var config=require(_0x64c9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x64c9('0xa')][_0x64c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3150d8,_0xb5f443,_0x5830f4){return new BPromise(function(_0x1345aa,_0x330e4e){return client['request'](_0x3150d8,_0x5830f4)[_0x64c9('0xc')](function(_0x43676a){logger[_0x64c9('0xd')](_0x64c9('0xe'),_0xb5f443,_0x64c9('0xf'));logger[_0x64c9('0x10')]('Migration,\x20%s,\x20%s,\x20%s',_0xb5f443,_0x64c9('0xf'),JSON[_0x64c9('0x11')](_0x43676a));if(_0x43676a[_0x64c9('0x12')]){if(_0x43676a[_0x64c9('0x12')][_0x64c9('0x13')]===0x1f4){logger[_0x64c9('0x12')]('Migration,\x20%s,\x20%s',_0xb5f443,_0x43676a['error'][_0x64c9('0x14')]);return _0x330e4e(_0x43676a['error'][_0x64c9('0x14')]);}logger[_0x64c9('0x12')](_0x64c9('0xe'),_0xb5f443,_0x43676a[_0x64c9('0x12')]['message']);return _0x1345aa(_0x43676a[_0x64c9('0x12')]['message']);}else{logger[_0x64c9('0xd')](_0x64c9('0xe'),_0xb5f443,_0x64c9('0xf'));_0x1345aa(_0x43676a['result'][_0x64c9('0x14')]);}})[_0x64c9('0x15')](function(_0x1bc8da){logger[_0x64c9('0x12')](_0x64c9('0xe'),_0xb5f443,_0x1bc8da);_0x330e4e(_0x1bc8da);});});} \ No newline at end of file +var _0xae41=['error','code','message','Migration,\x20%s,\x20%s','result','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent'];(function(_0x5c5c52,_0x36d085){var _0x4229ff=function(_0x3806df){while(--_0x3806df){_0x5c5c52['push'](_0x5c5c52['shift']());}};_0x4229ff(++_0x36d085);}(_0xae41,0xaf));var _0x1ae4=function(_0x5ee216,_0x1588fc){_0x5ee216=_0x5ee216-0x0;var _0x3589fb=_0xae41[_0x5ee216];return _0x3589fb;};'use strict';var _=require(_0x1ae4('0x0'));var util=require(_0x1ae4('0x1'));var moment=require(_0x1ae4('0x2'));var BPromise=require(_0x1ae4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1ae4('0x4'));var logger=require('../../config/logger')(_0x1ae4('0x5'));var config=require(_0x1ae4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1ae4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14b07a,_0xd7c5,_0x435721){return new BPromise(function(_0x5e7371,_0xfc7fb3){return client[_0x1ae4('0x8')](_0x14b07a,_0x435721)[_0x1ae4('0x9')](function(_0x1a0de1){logger[_0x1ae4('0xa')]('Migration,\x20%s,\x20%s',_0xd7c5,'request\x20sent');logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0xd7c5,_0x1ae4('0xb'),JSON['stringify'](_0x1a0de1));if(_0x1a0de1[_0x1ae4('0xc')]){if(_0x1a0de1[_0x1ae4('0xc')][_0x1ae4('0xd')]===0x1f4){logger[_0x1ae4('0xc')]('Migration,\x20%s,\x20%s',_0xd7c5,_0x1a0de1[_0x1ae4('0xc')][_0x1ae4('0xe')]);return _0xfc7fb3(_0x1a0de1[_0x1ae4('0xc')][_0x1ae4('0xe')]);}logger[_0x1ae4('0xc')](_0x1ae4('0xf'),_0xd7c5,_0x1a0de1['error']['message']);return _0x5e7371(_0x1a0de1[_0x1ae4('0xc')][_0x1ae4('0xe')]);}else{logger[_0x1ae4('0xa')](_0x1ae4('0xf'),_0xd7c5,_0x1ae4('0xb'));_0x5e7371(_0x1a0de1[_0x1ae4('0x10')][_0x1ae4('0xe')]);}})['catch'](function(_0xe075){logger['error'](_0x1ae4('0xf'),_0xd7c5,_0xe075);_0xfc7fb3(_0xe075);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index e068e80..3a394b4 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 _0x521f=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x521f,0xe8));var _0xf521=function(_0x3dc068,_0x408431){_0x3dc068=_0x3dc068-0x0;var _0x4d4786=_0x521f[_0x3dc068];return _0x4d4786;};'use strict';var multer=require(_0xf521('0x0'));var util=require(_0xf521('0x1'));var path=require('path');var timeout=require(_0xf521('0x2'));var express=require(_0xf521('0x3'));var router=express[_0xf521('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xf521('0x5'));var config=require(_0xf521('0x6'));var controller=require(_0xf521('0x7'));router[_0xf521('0x8')]('/',auth[_0xf521('0x9')](),controller[_0xf521('0xa')]);router[_0xf521('0x8')](_0xf521('0xb'),auth['isAuthenticated'](),controller[_0xf521('0xc')]);router['post']('/',auth[_0xf521('0x9')](),controller[_0xf521('0xd')]);router['put'](_0xf521('0xb'),auth[_0xf521('0x9')](),controller[_0xf521('0xe')]);router[_0xf521('0xf')]('/:id',auth[_0xf521('0x9')](),controller[_0xf521('0x10')]);module[_0xf521('0x11')]=router; \ No newline at end of file +var _0x81d1=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports','multer','util','connect-timeout','express'];(function(_0x5d2a66,_0x5387a3){var _0x52a709=function(_0x4796bf){while(--_0x4796bf){_0x5d2a66['push'](_0x5d2a66['shift']());}};_0x52a709(++_0x5387a3);}(_0x81d1,0x13f));var _0x181d=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0x81d1[_0x5e8d3e];return _0x1348c0;};'use strict';var multer=require(_0x181d('0x0'));var util=require(_0x181d('0x1'));var path=require('path');var timeout=require(_0x181d('0x2'));var express=require(_0x181d('0x3'));var router=express[_0x181d('0x4')]();var auth=require(_0x181d('0x5'));var interaction=require(_0x181d('0x6'));var config=require(_0x181d('0x7'));var controller=require(_0x181d('0x8'));router[_0x181d('0x9')]('/',auth[_0x181d('0xa')](),controller[_0x181d('0xb')]);router[_0x181d('0x9')](_0x181d('0xc'),auth[_0x181d('0xa')](),controller[_0x181d('0xd')]);router[_0x181d('0xe')]('/',auth[_0x181d('0xa')](),controller[_0x181d('0xf')]);router['put']('/:id',auth[_0x181d('0xa')](),controller[_0x181d('0x10')]);router[_0x181d('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x181d('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 13c4642..9cc1d2a 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 _0xc5f6=['ENUM','localnet','externip','STRING','exports'];(function(_0x1a0a32,_0x75ce5f){var _0x535d31=function(_0x58b7f4){while(--_0x58b7f4){_0x1a0a32['push'](_0x1a0a32['shift']());}};_0x535d31(++_0x75ce5f);}(_0xc5f6,0xc7));var _0x6c5f=function(_0x36776d,_0x4a6627){_0x36776d=_0x36776d-0x0;var _0x3d5381=_0xc5f6[_0x36776d];return _0x3d5381;};'use strict';var Sequelize=require('sequelize');module[_0x6c5f('0x0')]={'type':{'type':Sequelize[_0x6c5f('0x1')](_0x6c5f('0x2'),_0x6c5f('0x3'))},'value':{'type':Sequelize[_0x6c5f('0x4')]}}; \ No newline at end of file +var _0x77f2=['externip','STRING','exports','ENUM','localnet'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x77f2,0x151));var _0x277f=function(_0x5a5395,_0x5361f6){_0x5a5395=_0x5a5395-0x0;var _0x4da43d=_0x77f2[_0x5a5395];return _0x4da43d;};'use strict';var Sequelize=require('sequelize');module[_0x277f('0x0')]={'type':{'type':Sequelize[_0x277f('0x1')](_0x277f('0x2'),_0x277f('0x3'))},'value':{'type':Sequelize[_0x277f('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index d9e7b5b..4e45088 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 _0x4147=['includeAll','include','Network','findAll','rows','show','params','create','sequelize','transaction','body','readFileSync','join','root','server/files/templates/network.ejs','utf8','render','format','/etc/asterisk/sip_xcally_%s.conf','Reload','find','writeFileSync','toLowerCase','chan_sip.so','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','set','Content-Range','save','update','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x4147,0x1b8));var _0x7414=function(_0x5b9a9f,_0x4e5c97){_0x5b9a9f=_0x5b9a9f-0x0;var _0x4e7e4a=_0x4147[_0x5b9a9f];return _0x4e7e4a;};'use strict';var pdf=require(_0x7414('0x0'));var emlformat=require(_0x7414('0x1'));var rimraf=require(_0x7414('0x2'));var zipdir=require(_0x7414('0x3'));var jsonpatch=require(_0x7414('0x4'));var rp=require('request-promise');var moment=require(_0x7414('0x5'));var BPromise=require(_0x7414('0x6'));var Mustache=require('mustache');var util=require(_0x7414('0x7'));var path=require(_0x7414('0x8'));var sox=require(_0x7414('0x9'));var csv=require(_0x7414('0xa'));var ejs=require(_0x7414('0xb'));var fs=require('fs');var _=require(_0x7414('0xc'));var squel=require(_0x7414('0xd'));var crypto=require(_0x7414('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7414('0xf'));var toCsv=require(_0x7414('0xa'));var querystring=require(_0x7414('0x10'));var Papa=require(_0x7414('0x11'));var Redis=require(_0x7414('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7414('0x13'));var as=require(_0x7414('0x14'));var hardwareService=require(_0x7414('0x15'));var logger=require(_0x7414('0x16'))(_0x7414('0x17'));var utils=require(_0x7414('0x18'));var config=require(_0x7414('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7414('0x1a'));var client=jayson['client'][_0x7414('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2b03ae,_0x4e87c1,_0x4f3eef){if(_0x4f3eef){var _0x42efc3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42efc3[_0x7414('0x1c')](_0x4e87c1)){return _0x2b03ae;}else{throw new db[(_0x7414('0x1d'))][(_0x7414('0x1e'))](_0x7414('0x1f'));}}else{return _0x2b03ae;}}function respondWithRpcPromise(_0x4cd659,_0x406ffc,_0x4ac4d0,_0xd0ba67){return new BPromise(function(_0x561cbd,_0x46bc3f){var _0x1df9d8=_0xd0ba67||client;return _0x1df9d8[_0x7414('0x20')](_0x4cd659,_0x4ac4d0)[_0x7414('0x21')](function(_0x4b9d8d){logger[_0x7414('0x22')](_0x7414('0x23'),_0x406ffc,'request\x20sent');logger['debug'](_0x7414('0x24'),_0x406ffc,'request\x20sent',JSON[_0x7414('0x25')](_0x4b9d8d));if(_0x4b9d8d[_0x7414('0x26')]){if(_0x4b9d8d['error'][_0x7414('0x27')]===0x1f4){logger[_0x7414('0x26')](_0x7414('0x23'),_0x406ffc,_0x4b9d8d['error'][_0x7414('0x28')]);return _0x46bc3f(_0x4b9d8d[_0x7414('0x26')][_0x7414('0x28')]);}logger['error'](_0x7414('0x23'),_0x406ffc,_0x4b9d8d[_0x7414('0x26')][_0x7414('0x28')]);return _0x561cbd(_0x4b9d8d[_0x7414('0x26')][_0x7414('0x28')]);}else{logger[_0x7414('0x22')](_0x7414('0x23'),_0x406ffc,'request\x20sent');_0x561cbd(_0x4b9d8d[_0x7414('0x29')]['message']);}})[_0x7414('0x2a')](function(_0x331aeb){logger['error']('Network,\x20%s,\x20%s',_0x406ffc,_0x331aeb);_0x46bc3f(_0x331aeb);});});}function respondWithStatusCode(_0x34abec,_0x1f498d){_0x1f498d=_0x1f498d||0xcc;return function(_0x367a4a){if(_0x367a4a){return _0x34abec[_0x7414('0x2b')](_0x1f498d);}return _0x34abec['status'](_0x1f498d)['end']();};}function respondWithResult(_0x183e5c,_0xc3b2ad){_0xc3b2ad=_0xc3b2ad||0xc8;return function(_0x165cd0){if(_0x165cd0){return _0x183e5c[_0x7414('0x2c')](_0xc3b2ad)[_0x7414('0x2d')](_0x165cd0);}};}function respondWithFilteredResult(_0x449a10,_0x1d5fad){return function(_0x618261){if(_0x618261){var _0x11d40c=_0x618261['count'],_0x5955dd=_0x1d5fad[_0x7414('0x2e')],_0x3b74eb=_0x1d5fad['offset']+_0x1d5fad['limit'],_0x12c620;if(_0x3b74eb>=_0x11d40c){_0x3b74eb=_0x11d40c;_0x12c620=0xc8;}else{_0x12c620=0xce;}_0x449a10[_0x7414('0x2c')](_0x12c620);return _0x449a10[_0x7414('0x2f')](_0x7414('0x30'),_0x5955dd+'-'+_0x3b74eb+'/'+_0x11d40c)[_0x7414('0x2d')](_0x618261);}return null;};}function patchUpdates(_0x1711b4){return function(_0x5949f2){try{jsonpatch['apply'](_0x5949f2,_0x1711b4,!![]);}catch(_0x4663c2){return BPromise['reject'](_0x4663c2);}return _0x5949f2[_0x7414('0x31')]();};}function saveUpdates(_0x620922,_0x20941d){return function(_0x4db2f8){if(_0x4db2f8){return _0x4db2f8[_0x7414('0x32')](_0x620922)[_0x7414('0x21')](function(_0x106502){return _0x106502;});}return null;};}function removeEntity(_0x557c58,_0x4c7778){return function(_0x375351){if(_0x375351){return _0x375351[_0x7414('0x33')]()[_0x7414('0x21')](function(){_0x557c58[_0x7414('0x2c')](0xcc)[_0x7414('0x34')]();});}};}function handleEntityNotFound(_0x52520d,_0xbadf84){return function(_0x224c8d){if(!_0x224c8d){_0x52520d[_0x7414('0x2b')](0x194);}return _0x224c8d;};}function handleError(_0x34da31,_0x3e99c5){_0x3e99c5=_0x3e99c5||0x1f4;return function(_0x539376){logger[_0x7414('0x26')](_0x539376[_0x7414('0x35')]);if(_0x539376['name']){delete _0x539376[_0x7414('0x36')];}_0x34da31['status'](_0x3e99c5)[_0x7414('0x37')](_0x539376);};}exports[_0x7414('0x38')]=function(_0x5eaa64,_0x341851){var _0x29a3b1={},_0x2b5fcc={},_0x1d8422={'count':0x0,'rows':[]};var _0x597184=_[_0x7414('0x39')](db['Network'][_0x7414('0x3a')],function(_0x1ff07e){return{'name':_0x1ff07e[_0x7414('0x3b')],'type':_0x1ff07e[_0x7414('0x3c')][_0x7414('0x3d')]};});_0x2b5fcc[_0x7414('0x3e')]=_[_0x7414('0x39')](_0x597184,_0x7414('0x36'));_0x2b5fcc['query']=_[_0x7414('0x3f')](_0x5eaa64[_0x7414('0x40')]);_0x2b5fcc[_0x7414('0x41')]=_[_0x7414('0x42')](_0x2b5fcc[_0x7414('0x3e')],_0x2b5fcc[_0x7414('0x40')]);_0x29a3b1[_0x7414('0x43')]=_[_0x7414('0x42')](_0x2b5fcc[_0x7414('0x3e')],qs[_0x7414('0x44')](_0x5eaa64[_0x7414('0x40')][_0x7414('0x44')]));_0x29a3b1[_0x7414('0x43')]=_0x29a3b1['attributes']['length']?_0x29a3b1['attributes']:_0x2b5fcc[_0x7414('0x3e')];if(!_0x5eaa64[_0x7414('0x40')]['hasOwnProperty'](_0x7414('0x45'))){_0x29a3b1[_0x7414('0x46')]=qs[_0x7414('0x46')](_0x5eaa64['query'][_0x7414('0x46')]);_0x29a3b1[_0x7414('0x2e')]=qs['offset'](_0x5eaa64[_0x7414('0x40')][_0x7414('0x2e')]);}_0x29a3b1[_0x7414('0x47')]=qs[_0x7414('0x48')](_0x5eaa64[_0x7414('0x40')][_0x7414('0x48')]);_0x29a3b1[_0x7414('0x49')]=qs['filters'](_[_0x7414('0x4a')](_0x5eaa64[_0x7414('0x40')],_0x2b5fcc[_0x7414('0x41')]));if(_0x5eaa64[_0x7414('0x40')][_0x7414('0x4b')]){_0x29a3b1['where']=_[_0x7414('0x4c')](_0x29a3b1[_0x7414('0x49')],{'$or':_[_0x7414('0x39')](_0x597184,function(_0x30c068){if(_0x30c068['type']!==_0x7414('0x4d')){var _0x24bd50={};_0x24bd50[_0x30c068['name']]={'$like':'%'+_0x5eaa64[_0x7414('0x40')]['filter']+'%'};return _0x24bd50;}})});}_0x29a3b1=_['merge']({},_0x29a3b1,_0x5eaa64[_0x7414('0x4e')]);var _0x5773fa={'where':_0x29a3b1[_0x7414('0x49')]};return db['Network'][_0x7414('0x4f')](_0x5773fa)[_0x7414('0x21')](function(_0x76c8ea){_0x1d8422[_0x7414('0x4f')]=_0x76c8ea;if(_0x5eaa64[_0x7414('0x40')][_0x7414('0x50')]){_0x29a3b1[_0x7414('0x51')]=[{'all':!![]}];}return db[_0x7414('0x52')][_0x7414('0x53')](_0x29a3b1);})['then'](function(_0x263134){_0x1d8422[_0x7414('0x54')]=_0x263134;return _0x1d8422;})[_0x7414('0x21')](respondWithFilteredResult(_0x341851,_0x29a3b1))[_0x7414('0x2a')](handleError(_0x341851,null));};exports[_0x7414('0x55')]=function(_0x1705c7,_0x3e8e93){var _0x38ed6a={'raw':!![],'where':{'id':_0x1705c7[_0x7414('0x56')]['id']}},_0x3beee2={};_0x3beee2[_0x7414('0x3e')]=_['keys'](db['Network']['rawAttributes']);_0x3beee2['query']=_[_0x7414('0x3f')](_0x1705c7[_0x7414('0x40')]);_0x3beee2['filters']=_[_0x7414('0x42')](_0x3beee2[_0x7414('0x3e')],_0x3beee2[_0x7414('0x40')]);_0x38ed6a['attributes']=_[_0x7414('0x42')](_0x3beee2[_0x7414('0x3e')],qs[_0x7414('0x44')](_0x1705c7['query'][_0x7414('0x44')]));_0x38ed6a['attributes']=_0x38ed6a[_0x7414('0x43')]['length']?_0x38ed6a[_0x7414('0x43')]:_0x3beee2['model'];if(_0x1705c7[_0x7414('0x40')]['includeAll']){_0x38ed6a[_0x7414('0x51')]=[{'all':!![]}];}_0x38ed6a=_[_0x7414('0x4c')]({},_0x38ed6a,_0x1705c7[_0x7414('0x4e')]);return db[_0x7414('0x52')]['find'](_0x38ed6a)[_0x7414('0x21')](handleEntityNotFound(_0x3e8e93,null))[_0x7414('0x21')](respondWithResult(_0x3e8e93,null))['catch'](handleError(_0x3e8e93,null));};exports[_0x7414('0x57')]=function(_0x202897,_0xb5009e,_0x33b909){var _0xb9b7e4;return db[_0x7414('0x58')][_0x7414('0x59')](function(_0x399080){return db['Network'][_0x7414('0x57')](_0x202897[_0x7414('0x5a')],{'raw':!![]})['then'](function(_0x4aa2b8){_0xb9b7e4=_0x4aa2b8;return db['Network'][_0x7414('0x53')]({'where':{'type':_0x202897['body']['type']},'raw':!![]});})[_0x7414('0x21')](function(_0xd3e7bb){var _0x54df2e=fs[_0x7414('0x5b')](path[_0x7414('0x5c')](config[_0x7414('0x5d')],_0x7414('0x5e')),_0x7414('0x5f'));var _0x1304e0=ejs[_0x7414('0x60')](_0x54df2e,{'networks':_0xd3e7bb||[]});fs['writeFileSync'](util[_0x7414('0x61')](_0x7414('0x62'),_0x202897[_0x7414('0x5a')][_0x7414('0x3c')]['toLowerCase']()),_0x1304e0);})[_0x7414('0x21')](function(){return respondWithRpcPromise(_0x7414('0x63'),_0x7414('0x57'),{'module':'chan_sip.so'});})[_0x7414('0x21')](function(){return _0xb9b7e4;});})[_0x7414('0x21')](respondWithResult(_0xb5009e,0xc9))[_0x7414('0x2a')](handleError(_0xb5009e,null));};exports[_0x7414('0x32')]=function(_0x56600c,_0x3f23c4,_0x3c331c){var _0x4ead06;return db[_0x7414('0x58')][_0x7414('0x59')](function(_0x26550a){return db[_0x7414('0x52')][_0x7414('0x64')]({'where':{'id':_0x56600c[_0x7414('0x56')]['id']}})[_0x7414('0x21')](handleEntityNotFound(_0x3f23c4,null))['then'](saveUpdates(_0x56600c[_0x7414('0x5a')],null))['then'](function(_0x3c388a){if(_0x3c388a){_0x4ead06=_0x3c388a;return db[_0x7414('0x52')][_0x7414('0x53')]({'where':{'type':_0x4ead06[_0x7414('0x3c')]},'raw':!![]});}return null;})[_0x7414('0x21')](function(_0x438d21){if(_0x438d21){var _0x2696f6=fs['readFileSync'](path[_0x7414('0x5c')](config[_0x7414('0x5d')],_0x7414('0x5e')),_0x7414('0x5f'));var _0x1a719c=ejs[_0x7414('0x60')](_0x2696f6,{'networks':_0x438d21||[]});fs[_0x7414('0x65')](util['format'](_0x7414('0x62'),_0x4ead06['type'][_0x7414('0x66')]()),_0x1a719c);return respondWithRpcPromise(_0x7414('0x63'),_0x7414('0x32'),{'module':_0x7414('0x67')});}return null;})['then'](function(_0x2e62d6){if(_0x2e62d6){return _0x4ead06;}return null;});})['then'](respondWithResult(_0x3f23c4,null))[_0x7414('0x2a')](handleError(_0x3f23c4,null));};exports[_0x7414('0x33')]=function(_0x230ad6,_0x2ee58f,_0x1ab0ab){var _0x484351;return db[_0x7414('0x52')][_0x7414('0x64')]({'where':{'id':_0x230ad6[_0x7414('0x56')]['id']}})[_0x7414('0x21')](function(_0x397928){_0x484351=_0x397928;return _0x397928;})[_0x7414('0x21')](handleEntityNotFound(_0x2ee58f,null))[_0x7414('0x21')](removeEntity(_0x2ee58f,null))['then'](function(){if(_0x484351){return db[_0x7414('0x52')][_0x7414('0x53')]({'where':{'type':_0x484351['type']},'raw':!![]});}})[_0x7414('0x21')](function(_0x378c4e){if(_0x378c4e){var _0x23df76=fs[_0x7414('0x5b')](path[_0x7414('0x5c')](config[_0x7414('0x5d')],_0x7414('0x5e')),_0x7414('0x5f'));var _0x235a02=ejs[_0x7414('0x60')](_0x23df76,{'networks':_0x378c4e||[]});fs[_0x7414('0x65')](util[_0x7414('0x61')](_0x7414('0x62'),_0x484351[_0x7414('0x3c')][_0x7414('0x66')]()),_0x235a02);return respondWithRpcPromise(_0x7414('0x63'),_0x7414('0x33'),{'module':'chan_sip.so'});}})[_0x7414('0x2a')](handleError(_0x2ee58f,null));}; \ No newline at end of file +var _0x2440=['Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','destroy','stack','name','map','Network','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','find','create','transaction','body','readFileSync','join','root','server/files/templates/network.ejs','utf8','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','render','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info'];(function(_0x50c322,_0x3c4803){var _0x147f29=function(_0x2d46a9){while(--_0x2d46a9){_0x50c322['push'](_0x50c322['shift']());}};_0x147f29(++_0x3c4803);}(_0x2440,0x1db));var _0x0244=function(_0x6c8d99,_0x4740f7){_0x6c8d99=_0x6c8d99-0x0;var _0x19d74b=_0x2440[_0x6c8d99];return _0x19d74b;};'use strict';var pdf=require(_0x0244('0x0'));var emlformat=require(_0x0244('0x1'));var rimraf=require(_0x0244('0x2'));var zipdir=require(_0x0244('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0244('0x4'));var moment=require(_0x0244('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0244('0x6'));var util=require(_0x0244('0x7'));var path=require(_0x0244('0x8'));var sox=require(_0x0244('0x9'));var csv=require(_0x0244('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0244('0xb'));var squel=require('squel');var crypto=require(_0x0244('0xc'));var jsforce=require(_0x0244('0xd'));var deskjs=require(_0x0244('0xe'));var toCsv=require(_0x0244('0xa'));var querystring=require(_0x0244('0xf'));var Papa=require(_0x0244('0x10'));var Redis=require(_0x0244('0x11'));var authService=require(_0x0244('0x12'));var qs=require(_0x0244('0x13'));var as=require(_0x0244('0x14'));var hardwareService=require(_0x0244('0x15'));var logger=require(_0x0244('0x16'))(_0x0244('0x17'));var utils=require(_0x0244('0x18'));var config=require(_0x0244('0x19'));var db=require(_0x0244('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x0244('0x1b')][_0x0244('0x1c')]({'port':0x232a});function checkPasswordPattern(_0xc81eb0,_0x36b62b,_0x20fe31){if(_0x20fe31){var _0x504461=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x504461['test'](_0x36b62b)){return _0xc81eb0;}else{throw new db[(_0x0244('0x1d'))][(_0x0244('0x1e'))](_0x0244('0x1f'));}}else{return _0xc81eb0;}}function respondWithRpcPromise(_0x5c6382,_0x3c4ab3,_0x3b9a26,_0x12b6e3){return new BPromise(function(_0x43429f,_0x32f56a){var _0x17ab63=_0x12b6e3||client;return _0x17ab63[_0x0244('0x20')](_0x5c6382,_0x3b9a26)[_0x0244('0x21')](function(_0x5c7967){logger[_0x0244('0x22')](_0x0244('0x23'),_0x3c4ab3,'request\x20sent');logger[_0x0244('0x24')](_0x0244('0x25'),_0x3c4ab3,'request\x20sent',JSON[_0x0244('0x26')](_0x5c7967));if(_0x5c7967['error']){if(_0x5c7967[_0x0244('0x27')][_0x0244('0x28')]===0x1f4){logger[_0x0244('0x27')](_0x0244('0x23'),_0x3c4ab3,_0x5c7967['error'][_0x0244('0x29')]);return _0x32f56a(_0x5c7967[_0x0244('0x27')][_0x0244('0x29')]);}logger[_0x0244('0x27')](_0x0244('0x23'),_0x3c4ab3,_0x5c7967[_0x0244('0x27')][_0x0244('0x29')]);return _0x43429f(_0x5c7967[_0x0244('0x27')][_0x0244('0x29')]);}else{logger[_0x0244('0x22')]('Network,\x20%s,\x20%s',_0x3c4ab3,_0x0244('0x2a'));_0x43429f(_0x5c7967[_0x0244('0x2b')]['message']);}})[_0x0244('0x2c')](function(_0x3e5c6a){logger[_0x0244('0x27')](_0x0244('0x23'),_0x3c4ab3,_0x3e5c6a);_0x32f56a(_0x3e5c6a);});});}function respondWithStatusCode(_0x2c711,_0x14356a){_0x14356a=_0x14356a||0xcc;return function(_0x44dfa7){if(_0x44dfa7){return _0x2c711[_0x0244('0x2d')](_0x14356a);}return _0x2c711[_0x0244('0x2e')](_0x14356a)[_0x0244('0x2f')]();};}function respondWithResult(_0x33939c,_0x4d4eca){_0x4d4eca=_0x4d4eca||0xc8;return function(_0xaf79c0){if(_0xaf79c0){return _0x33939c[_0x0244('0x2e')](_0x4d4eca)[_0x0244('0x30')](_0xaf79c0);}};}function respondWithFilteredResult(_0x1e9b76,_0x474b4e){return function(_0x3e48c7){if(_0x3e48c7){var _0x1ce449=_0x3e48c7[_0x0244('0x31')],_0x231b8a=_0x474b4e[_0x0244('0x32')],_0x3e01a0=_0x474b4e['offset']+_0x474b4e[_0x0244('0x33')],_0x138485;if(_0x3e01a0>=_0x1ce449){_0x3e01a0=_0x1ce449;_0x138485=0xc8;}else{_0x138485=0xce;}_0x1e9b76['status'](_0x138485);return _0x1e9b76[_0x0244('0x34')]('Content-Range',_0x231b8a+'-'+_0x3e01a0+'/'+_0x1ce449)[_0x0244('0x30')](_0x3e48c7);}return null;};}function patchUpdates(_0x4de84e){return function(_0xa88ed){try{jsonpatch['apply'](_0xa88ed,_0x4de84e,!![]);}catch(_0x424902){return BPromise[_0x0244('0x35')](_0x424902);}return _0xa88ed[_0x0244('0x36')]();};}function saveUpdates(_0x371516,_0x1f6047){return function(_0x1ea726){if(_0x1ea726){return _0x1ea726[_0x0244('0x37')](_0x371516)[_0x0244('0x21')](function(_0x1b8a45){return _0x1b8a45;});}return null;};}function removeEntity(_0x2d9cb8,_0x2415cd){return function(_0x38ef13){if(_0x38ef13){return _0x38ef13[_0x0244('0x38')]()[_0x0244('0x21')](function(){_0x2d9cb8[_0x0244('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24e3f6,_0x3ff6a0){return function(_0x43eb43){if(!_0x43eb43){_0x24e3f6[_0x0244('0x2d')](0x194);}return _0x43eb43;};}function handleError(_0x3e24d2,_0x2e7c08){_0x2e7c08=_0x2e7c08||0x1f4;return function(_0x5d0bee){logger['error'](_0x5d0bee[_0x0244('0x39')]);if(_0x5d0bee[_0x0244('0x3a')]){delete _0x5d0bee['name'];}_0x3e24d2[_0x0244('0x2e')](_0x2e7c08)['send'](_0x5d0bee);};}exports['index']=function(_0x33031c,_0x6bbed3){var _0x4491ef={},_0x1c00a7={},_0x37e065={'count':0x0,'rows':[]};var _0xd00d64=_[_0x0244('0x3b')](db[_0x0244('0x3c')][_0x0244('0x3d')],function(_0x370e82){return{'name':_0x370e82['fieldName'],'type':_0x370e82[_0x0244('0x3e')][_0x0244('0x3f')]};});_0x1c00a7[_0x0244('0x40')]=_[_0x0244('0x3b')](_0xd00d64,_0x0244('0x3a'));_0x1c00a7[_0x0244('0x41')]=_[_0x0244('0x42')](_0x33031c[_0x0244('0x41')]);_0x1c00a7[_0x0244('0x43')]=_[_0x0244('0x44')](_0x1c00a7[_0x0244('0x40')],_0x1c00a7[_0x0244('0x41')]);_0x4491ef[_0x0244('0x45')]=_['intersection'](_0x1c00a7[_0x0244('0x40')],qs['fields'](_0x33031c[_0x0244('0x41')][_0x0244('0x46')]));_0x4491ef[_0x0244('0x45')]=_0x4491ef[_0x0244('0x45')][_0x0244('0x47')]?_0x4491ef[_0x0244('0x45')]:_0x1c00a7[_0x0244('0x40')];if(!_0x33031c['query'][_0x0244('0x48')]('nolimit')){_0x4491ef[_0x0244('0x33')]=qs[_0x0244('0x33')](_0x33031c[_0x0244('0x41')][_0x0244('0x33')]);_0x4491ef['offset']=qs[_0x0244('0x32')](_0x33031c[_0x0244('0x41')]['offset']);}_0x4491ef[_0x0244('0x49')]=qs[_0x0244('0x4a')](_0x33031c[_0x0244('0x41')][_0x0244('0x4a')]);_0x4491ef['where']=qs['filters'](_[_0x0244('0x4b')](_0x33031c[_0x0244('0x41')],_0x1c00a7[_0x0244('0x43')]));if(_0x33031c[_0x0244('0x41')][_0x0244('0x4c')]){_0x4491ef[_0x0244('0x4d')]=_[_0x0244('0x4e')](_0x4491ef[_0x0244('0x4d')],{'$or':_[_0x0244('0x3b')](_0xd00d64,function(_0x399329){if(_0x399329['type']!=='VIRTUAL'){var _0xca67b3={};_0xca67b3[_0x399329[_0x0244('0x3a')]]={'$like':'%'+_0x33031c[_0x0244('0x41')][_0x0244('0x4c')]+'%'};return _0xca67b3;}})});}_0x4491ef=_[_0x0244('0x4e')]({},_0x4491ef,_0x33031c[_0x0244('0x4f')]);var _0x104248={'where':_0x4491ef[_0x0244('0x4d')]};return db[_0x0244('0x3c')][_0x0244('0x31')](_0x104248)[_0x0244('0x21')](function(_0x175912){_0x37e065['count']=_0x175912;if(_0x33031c[_0x0244('0x41')][_0x0244('0x50')]){_0x4491ef[_0x0244('0x51')]=[{'all':!![]}];}return db[_0x0244('0x3c')][_0x0244('0x52')](_0x4491ef);})[_0x0244('0x21')](function(_0x19ab18){_0x37e065[_0x0244('0x53')]=_0x19ab18;return _0x37e065;})[_0x0244('0x21')](respondWithFilteredResult(_0x6bbed3,_0x4491ef))[_0x0244('0x2c')](handleError(_0x6bbed3,null));};exports[_0x0244('0x54')]=function(_0x46fe97,_0x1831dd){var _0x43764a={'raw':!![],'where':{'id':_0x46fe97[_0x0244('0x55')]['id']}},_0xae2c20={};_0xae2c20['model']=_[_0x0244('0x42')](db['Network'][_0x0244('0x3d')]);_0xae2c20[_0x0244('0x41')]=_[_0x0244('0x42')](_0x46fe97['query']);_0xae2c20[_0x0244('0x43')]=_[_0x0244('0x44')](_0xae2c20[_0x0244('0x40')],_0xae2c20[_0x0244('0x41')]);_0x43764a[_0x0244('0x45')]=_[_0x0244('0x44')](_0xae2c20[_0x0244('0x40')],qs[_0x0244('0x46')](_0x46fe97[_0x0244('0x41')]['fields']));_0x43764a[_0x0244('0x45')]=_0x43764a['attributes']['length']?_0x43764a[_0x0244('0x45')]:_0xae2c20['model'];if(_0x46fe97[_0x0244('0x41')][_0x0244('0x50')]){_0x43764a[_0x0244('0x51')]=[{'all':!![]}];}_0x43764a=_['merge']({},_0x43764a,_0x46fe97[_0x0244('0x4f')]);return db['Network'][_0x0244('0x56')](_0x43764a)[_0x0244('0x21')](handleEntityNotFound(_0x1831dd,null))[_0x0244('0x21')](respondWithResult(_0x1831dd,null))[_0x0244('0x2c')](handleError(_0x1831dd,null));};exports[_0x0244('0x57')]=function(_0x11cc4c,_0x38d608,_0x418bd0){var _0x486cf4;return db['sequelize'][_0x0244('0x58')](function(_0x48d9f6){return db['Network'][_0x0244('0x57')](_0x11cc4c[_0x0244('0x59')],{'raw':!![]})['then'](function(_0x44ce74){_0x486cf4=_0x44ce74;return db['Network'][_0x0244('0x52')]({'where':{'type':_0x11cc4c[_0x0244('0x59')]['type']},'raw':!![]});})[_0x0244('0x21')](function(_0x21a269){var _0x2eb0fe=fs[_0x0244('0x5a')](path[_0x0244('0x5b')](config[_0x0244('0x5c')],_0x0244('0x5d')),_0x0244('0x5e'));var _0x5c3ea7=ejs['render'](_0x2eb0fe,{'networks':_0x21a269||[]});fs[_0x0244('0x5f')](util[_0x0244('0x60')](_0x0244('0x61'),_0x11cc4c[_0x0244('0x59')][_0x0244('0x3e')][_0x0244('0x62')]()),_0x5c3ea7);})['then'](function(){return respondWithRpcPromise(_0x0244('0x63'),_0x0244('0x57'),{'module':_0x0244('0x64')});})['then'](function(){return _0x486cf4;});})[_0x0244('0x21')](respondWithResult(_0x38d608,0xc9))[_0x0244('0x2c')](handleError(_0x38d608,null));};exports[_0x0244('0x37')]=function(_0x54d624,_0x1732bd,_0x34fad2){var _0xfc2ac;return db['sequelize'][_0x0244('0x58')](function(_0x339127){return db[_0x0244('0x3c')][_0x0244('0x56')]({'where':{'id':_0x54d624[_0x0244('0x55')]['id']}})[_0x0244('0x21')](handleEntityNotFound(_0x1732bd,null))[_0x0244('0x21')](saveUpdates(_0x54d624['body'],null))[_0x0244('0x21')](function(_0x4016b6){if(_0x4016b6){_0xfc2ac=_0x4016b6;return db[_0x0244('0x3c')][_0x0244('0x52')]({'where':{'type':_0xfc2ac['type']},'raw':!![]});}return null;})[_0x0244('0x21')](function(_0x266aad){if(_0x266aad){var _0x1d2cd5=fs[_0x0244('0x5a')](path[_0x0244('0x5b')](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x5264a1=ejs[_0x0244('0x65')](_0x1d2cd5,{'networks':_0x266aad||[]});fs[_0x0244('0x5f')](util[_0x0244('0x60')]('/etc/asterisk/sip_xcally_%s.conf',_0xfc2ac[_0x0244('0x3e')]['toLowerCase']()),_0x5264a1);return respondWithRpcPromise(_0x0244('0x63'),_0x0244('0x37'),{'module':'chan_sip.so'});}return null;})[_0x0244('0x21')](function(_0x5e8e3c){if(_0x5e8e3c){return _0xfc2ac;}return null;});})[_0x0244('0x21')](respondWithResult(_0x1732bd,null))[_0x0244('0x2c')](handleError(_0x1732bd,null));};exports[_0x0244('0x38')]=function(_0x226f57,_0x49fbed,_0xe57526){var _0x3ec2e9;return db[_0x0244('0x3c')][_0x0244('0x56')]({'where':{'id':_0x226f57[_0x0244('0x55')]['id']}})['then'](function(_0x49f843){_0x3ec2e9=_0x49f843;return _0x49f843;})['then'](handleEntityNotFound(_0x49fbed,null))['then'](removeEntity(_0x49fbed,null))[_0x0244('0x21')](function(){if(_0x3ec2e9){return db['Network'][_0x0244('0x52')]({'where':{'type':_0x3ec2e9[_0x0244('0x3e')]},'raw':!![]});}})[_0x0244('0x21')](function(_0x4da400){if(_0x4da400){var _0x2f7776=fs[_0x0244('0x5a')](path[_0x0244('0x5b')](config['root'],_0x0244('0x5d')),_0x0244('0x5e'));var _0x5aec58=ejs[_0x0244('0x65')](_0x2f7776,{'networks':_0x4da400||[]});fs[_0x0244('0x5f')](util[_0x0244('0x60')]('/etc/asterisk/sip_xcally_%s.conf',_0x3ec2e9['type'][_0x0244('0x62')]()),_0x5aec58);return respondWithRpcPromise(_0x0244('0x63'),_0x0244('0x38'),{'module':_0x0244('0x64')});}})[_0x0244('0x2c')](handleError(_0x49fbed,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 47e24ac..5cb06c4 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 _0x44aa=['request-promise','path','rimraf','exports','Network','network','util','api','moment'];(function(_0x32e4fa,_0x2b7dec){var _0x516f49=function(_0x298aad){while(--_0x298aad){_0x32e4fa['push'](_0x32e4fa['shift']());}};_0x516f49(++_0x2b7dec);}(_0x44aa,0x1e3));var _0xa44a=function(_0x40cf6d,_0x126294){_0x40cf6d=_0x40cf6d-0x0;var _0x2a494e=_0x44aa[_0x40cf6d];return _0x2a494e;};'use strict';var _=require('lodash');var util=require(_0xa44a('0x0'));var logger=require('../../config/logger')(_0xa44a('0x1'));var moment=require(_0xa44a('0x2'));var BPromise=require('bluebird');var rp=require(_0xa44a('0x3'));var fs=require('fs');var path=require(_0xa44a('0x4'));var rimraf=require(_0xa44a('0x5'));var config=require('../../config/environment');var attributes=require('./network.attributes');module[_0xa44a('0x6')]=function(_0x42176c,_0x8a2313){return _0x42176c['define'](_0xa44a('0x7'),attributes,{'tableName':_0xa44a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7aae=['../../config/environment','./network.attributes','exports','define','Network','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0x7aae,0x1c7));var _0xe7aa=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7aae[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xe7aa('0x0'));var util=require('util');var logger=require(_0xe7aa('0x1'))(_0xe7aa('0x2'));var moment=require('moment');var BPromise=require(_0xe7aa('0x3'));var rp=require(_0xe7aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe7aa('0x5'));var attributes=require(_0xe7aa('0x6'));module[_0xe7aa('0x7')]=function(_0x291eb1,_0x59b8c){return _0x291eb1[_0xe7aa('0x8')](_0xe7aa('0x9'),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 028ae0b..0e34a8f 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 _0x521c=['error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Network,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x28e0ab,_0x48a7e9){var _0x53cad1=function(_0x208ef2){while(--_0x208ef2){_0x28e0ab['push'](_0x28e0ab['shift']());}};_0x53cad1(++_0x48a7e9);}(_0x521c,0xb6));var _0xc521=function(_0x34a512,_0x4af833){_0x34a512=_0x34a512-0x0;var _0x53e413=_0x521c[_0x34a512];return _0x53e413;};'use strict';var _=require(_0xc521('0x0'));var util=require(_0xc521('0x1'));var moment=require(_0xc521('0x2'));var BPromise=require(_0xc521('0x3'));var rs=require(_0xc521('0x4'));var fs=require('fs');var Redis=require(_0xc521('0x5'));var db=require(_0xc521('0x6'))['db'];var utils=require(_0xc521('0x7'));var logger=require(_0xc521('0x8'))(_0xc521('0x9'));var config=require(_0xc521('0xa'));var jayson=require(_0xc521('0xb'));var client=jayson[_0xc521('0xc')][_0xc521('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4650f6,_0x2a0396,_0x4d3f7a){return new BPromise(function(_0x52842a,_0x297d54){return client['request'](_0x4650f6,_0x4d3f7a)[_0xc521('0xe')](function(_0x23960e){logger['info'](_0xc521('0xf'),_0x2a0396,_0xc521('0x10'));logger[_0xc521('0x11')]('Network,\x20%s,\x20%s,\x20%s',_0x2a0396,_0xc521('0x10'),JSON['stringify'](_0x23960e));if(_0x23960e[_0xc521('0x12')]){if(_0x23960e[_0xc521('0x12')]['code']===0x1f4){logger[_0xc521('0x12')](_0xc521('0xf'),_0x2a0396,_0x23960e[_0xc521('0x12')]['message']);return _0x297d54(_0x23960e[_0xc521('0x12')][_0xc521('0x13')]);}logger[_0xc521('0x12')](_0xc521('0xf'),_0x2a0396,_0x23960e[_0xc521('0x12')][_0xc521('0x13')]);return _0x52842a(_0x23960e['error'][_0xc521('0x13')]);}else{logger['info'](_0xc521('0xf'),_0x2a0396,'request\x20sent');_0x52842a(_0x23960e['result'][_0xc521('0x13')]);}})['catch'](function(_0x42cda2){logger[_0xc521('0x12')]('Network,\x20%s,\x20%s',_0x2a0396,_0x42cda2);_0x297d54(_0x42cda2);});});} \ No newline at end of file +var _0xf5e1=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','Network,\x20%s,\x20%s','message','info','result','util','moment'];(function(_0x292f35,_0x72e859){var _0x288e75=function(_0x1bba68){while(--_0x1bba68){_0x292f35['push'](_0x292f35['shift']());}};_0x288e75(++_0x72e859);}(_0xf5e1,0x139));var _0x1f5e=function(_0x433b81,_0x58f15b){_0x433b81=_0x433b81-0x0;var _0x295221=_0xf5e1[_0x433b81];return _0x295221;};'use strict';var _=require('lodash');var util=require(_0x1f5e('0x0'));var moment=require(_0x1f5e('0x1'));var BPromise=require(_0x1f5e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f5e('0x3'))['db'];var utils=require(_0x1f5e('0x4'));var logger=require(_0x1f5e('0x5'))(_0x1f5e('0x6'));var config=require(_0x1f5e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1f5e('0x8')][_0x1f5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11e0d5,_0x1ce1f8,_0x56339f){return new BPromise(function(_0x27d1fa,_0x1ad31d){return client[_0x1f5e('0xa')](_0x11e0d5,_0x56339f)[_0x1f5e('0xb')](function(_0x306f7f){logger['info']('Network,\x20%s,\x20%s',_0x1ce1f8,_0x1f5e('0xc'));logger[_0x1f5e('0xd')](_0x1f5e('0xe'),_0x1ce1f8,_0x1f5e('0xc'),JSON['stringify'](_0x306f7f));if(_0x306f7f[_0x1f5e('0xf')]){if(_0x306f7f[_0x1f5e('0xf')][_0x1f5e('0x10')]===0x1f4){logger[_0x1f5e('0xf')](_0x1f5e('0x11'),_0x1ce1f8,_0x306f7f[_0x1f5e('0xf')][_0x1f5e('0x12')]);return _0x1ad31d(_0x306f7f[_0x1f5e('0xf')][_0x1f5e('0x12')]);}logger['error'](_0x1f5e('0x11'),_0x1ce1f8,_0x306f7f[_0x1f5e('0xf')]['message']);return _0x27d1fa(_0x306f7f[_0x1f5e('0xf')][_0x1f5e('0x12')]);}else{logger[_0x1f5e('0x13')](_0x1f5e('0x11'),_0x1ce1f8,_0x1f5e('0xc'));_0x27d1fa(_0x306f7f[_0x1f5e('0x14')][_0x1f5e('0x12')]);}})['catch'](function(_0x2e0d74){logger[_0x1f5e('0xf')](_0x1f5e('0x11'),_0x1ce1f8,_0x2e0d74);_0x1ad31d(_0x2e0d74);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index f18c655..1699046 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 _0xfb53=['getInteractions','getAgents','post','addDisposition','addAnswer','/:id/notify','notify','addAgents','/:id/send','send','/:id','update','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./openchannelAccount.controller','get','isAuthenticated','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x1efb53,_0x47a4b3){var _0x691a5c=function(_0x23e8b4){while(--_0x23e8b4){_0x1efb53['push'](_0x1efb53['shift']());}};_0x691a5c(++_0x47a4b3);}(_0xfb53,0x19f));var _0x3fb5=function(_0xf3b3e7,_0x1b2afc){_0xf3b3e7=_0xf3b3e7-0x0;var _0x4a22a2=_0xfb53[_0xf3b3e7];return _0x4a22a2;};'use strict';var multer=require(_0x3fb5('0x0'));var util=require(_0x3fb5('0x1'));var path=require('path');var timeout=require(_0x3fb5('0x2'));var express=require(_0x3fb5('0x3'));var router=express[_0x3fb5('0x4')]();var auth=require(_0x3fb5('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3fb5('0x6'));router[_0x3fb5('0x7')]('/',auth[_0x3fb5('0x8')](),controller['index']);router[_0x3fb5('0x7')](_0x3fb5('0x9'),auth[_0x3fb5('0x8')](),controller['describe']);router['get']('/:id',auth[_0x3fb5('0x8')](),controller[_0x3fb5('0xa')]);router[_0x3fb5('0x7')](_0x3fb5('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x3fb5('0xc'),auth[_0x3fb5('0x8')](),controller[_0x3fb5('0xd')]);router[_0x3fb5('0x7')](_0x3fb5('0xe'),auth['isAuthenticated'](),controller[_0x3fb5('0xf')]);router[_0x3fb5('0x7')](_0x3fb5('0x10'),auth[_0x3fb5('0x8')](),controller[_0x3fb5('0x11')]);router[_0x3fb5('0x7')]('/:id/users',auth[_0x3fb5('0x8')](),controller[_0x3fb5('0x12')]);router[_0x3fb5('0x13')]('/',auth[_0x3fb5('0x8')](),controller['create']);router[_0x3fb5('0x13')](_0x3fb5('0xb'),auth[_0x3fb5('0x8')](),controller[_0x3fb5('0x14')]);router['post'](_0x3fb5('0xc'),auth['isAuthenticated'](),controller[_0x3fb5('0x15')]);router[_0x3fb5('0x13')](_0x3fb5('0x16'),controller[_0x3fb5('0x17')]);router[_0x3fb5('0x13')](_0x3fb5('0xe'),auth['isAuthenticated'](),controller['addApplications']);router[_0x3fb5('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x3fb5('0x18')]);router[_0x3fb5('0x13')](_0x3fb5('0x19'),auth['isAuthenticated'](),controller[_0x3fb5('0x1a')]);router['put'](_0x3fb5('0x1b'),auth[_0x3fb5('0x8')](),controller[_0x3fb5('0x1c')]);router[_0x3fb5('0x1d')](_0x3fb5('0x1b'),auth[_0x3fb5('0x8')](),controller[_0x3fb5('0x1e')]);router['delete'](_0x3fb5('0xb'),auth[_0x3fb5('0x8')](),controller[_0x3fb5('0x1f')]);router[_0x3fb5('0x1d')](_0x3fb5('0xc'),auth[_0x3fb5('0x8')](),controller[_0x3fb5('0x20')]);router['delete'](_0x3fb5('0x21'),auth[_0x3fb5('0x8')](),controller[_0x3fb5('0x22')]);module[_0x3fb5('0x23')]=router; \ No newline at end of file +var _0xc949=['post','addDisposition','/:id/notify','notify','addApplications','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents'];(function(_0xaf25ae,_0x2001c1){var _0x49732d=function(_0x5b764d){while(--_0x5b764d){_0xaf25ae['push'](_0xaf25ae['shift']());}};_0x49732d(++_0x2001c1);}(_0xc949,0x7a));var _0x9c94=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xc949[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x9c94('0x0'));var util=require(_0x9c94('0x1'));var path=require(_0x9c94('0x2'));var timeout=require(_0x9c94('0x3'));var express=require(_0x9c94('0x4'));var router=express[_0x9c94('0x5')]();var auth=require(_0x9c94('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9c94('0x7'));router[_0x9c94('0x8')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0xa')]);router[_0x9c94('0x8')](_0x9c94('0xb'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xc')]);router[_0x9c94('0x8')](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller['show']);router[_0x9c94('0x8')](_0x9c94('0xe'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xf')]);router[_0x9c94('0x8')](_0x9c94('0x10'),auth[_0x9c94('0x9')](),controller['getAnswers']);router[_0x9c94('0x8')](_0x9c94('0x11'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x12')]);router[_0x9c94('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x9c94('0x13')]);router[_0x9c94('0x8')](_0x9c94('0x14'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x15')]);router[_0x9c94('0x16')]('/',auth[_0x9c94('0x9')](),controller['create']);router['post'](_0x9c94('0xe'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x17')]);router[_0x9c94('0x16')](_0x9c94('0x10'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x9c94('0x16')](_0x9c94('0x18'),controller[_0x9c94('0x19')]);router[_0x9c94('0x16')](_0x9c94('0x11'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x1a')]);router[_0x9c94('0x16')]('/:id/users',auth[_0x9c94('0x9')](),controller['addAgents']);router[_0x9c94('0x16')](_0x9c94('0x1b'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x1c')]);router[_0x9c94('0x1d')](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x1e')]);router['delete'](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x1f')]);router[_0x9c94('0x20')](_0x9c94('0xe'),auth['isAuthenticated'](),controller[_0x9c94('0x21')]);router[_0x9c94('0x20')](_0x9c94('0x10'),auth['isAuthenticated'](),controller[_0x9c94('0x22')]);router['delete']('/:id/users',auth[_0x9c94('0x9')](),controller[_0x9c94('0x23')]);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 0b30193..545dd63 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 _0x87e1=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT'];(function(_0x4eb704,_0x87bedb){var _0x2ccbe3=function(_0x5d4d52){while(--_0x5d4d52){_0x4eb704['push'](_0x4eb704['shift']());}};_0x2ccbe3(++_0x87bedb);}(_0x87e1,0xbc));var _0x187e=function(_0x243cca,_0x514c2d){_0x243cca=_0x243cca-0x0;var _0xf94771=_0x87e1[_0x243cca];return _0xf94771;};'use strict';var Sequelize=require(_0x187e('0x0'));var rs=require(_0x187e('0x1'));module[_0x187e('0x2')]={'name':{'type':Sequelize[_0x187e('0x3')],'unique':_0x187e('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x187e('0x3')]},'token':{'type':Sequelize[_0x187e('0x3')],'defaultValue':function(){return rs[_0x187e('0x5')]();}},'replyUri':{'type':Sequelize[_0x187e('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x187e('0x6')],'defaultValue':function(){return _0x187e('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x187e('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x187e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x187e('0x3')]},'queueTransfer':{'type':Sequelize[_0x187e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x187e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x187e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x187e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x187e('0x9')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x187e('0x8')],'defaultValue':![],'comment':_0x187e('0xa'),'set':function(_0x23cd59){if(!_0x23cd59)this[_0x187e('0xb')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x187e('0xc'),_0x23cd59);}}}; \ No newline at end of file +var _0x1bd3=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x50a330,_0x2e003c){var _0x475636=function(_0x1ce9ab){while(--_0x1ce9ab){_0x50a330['push'](_0x50a330['shift']());}};_0x475636(++_0x2e003c);}(_0x1bd3,0xc5));var _0x31bd=function(_0x43c572,_0xaaa7d0){_0x43c572=_0x43c572-0x0;var _0x101f2a=_0x1bd3[_0x43c572];return _0x101f2a;};'use strict';var Sequelize=require(_0x31bd('0x0'));var rs=require(_0x31bd('0x1'));module[_0x31bd('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x31bd('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x31bd('0x4')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x31bd('0x5')]();}},'replyUri':{'type':Sequelize[_0x31bd('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x31bd('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x31bd('0x6')],'defaultValue':function(){return _0x31bd('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x31bd('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x31bd('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x31bd('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x31bd('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x31bd('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x31bd('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x31bd('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x31bd('0x8')],'defaultValue':![],'comment':_0x31bd('0xb'),'set':function(_0x250a2c){if(!_0x250a2c)this[_0x31bd('0xc')](_0x31bd('0xd'),null);this[_0x31bd('0xc')](_0x31bd('0xe'),_0x250a2c);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 54a34d9..1ea9c57 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 _0x8d9e=['Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','include','rows','params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpnechannelAccountId','getDispositions','findOne','Disposition','pick','OpenchannelAccountId','removeDispositions','ids','CannedAnswer','getAnswers','findAll','notify','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','CmContact','Contacts','DESC','applications','list','asc','Applications','account','contact','firstName','lastName','threadId','OpenchannelInteraction','ContactId','messageId','created','autoclose','push','close','unmanaged','AttachmentId','interaction','UserId','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','tag','addAgents','omit','spread','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','User','send','CmList','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','OpenchannelAccounts','UserProfileResource','stack','name','index'];(function(_0x4b368e,_0x2d03d5){var _0x4478a2=function(_0x5ce42d){while(--_0x5ce42d){_0x4b368e['push'](_0x4b368e['shift']());}};_0x4478a2(++_0x2d03d5);}(_0x8d9e,0x13f));var _0xe8d9=function(_0xadf681,_0x529d62){_0xadf681=_0xadf681-0x0;var _0x10f1da=_0x8d9e[_0xadf681];return _0x10f1da;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe8d9('0x0'));var rimraf=require(_0xe8d9('0x1'));var zipdir=require(_0xe8d9('0x2'));var jsonpatch=require(_0xe8d9('0x3'));var rp=require(_0xe8d9('0x4'));var moment=require(_0xe8d9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe8d9('0x6'));var util=require(_0xe8d9('0x7'));var path=require('path');var sox=require(_0xe8d9('0x8'));var csv=require(_0xe8d9('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe8d9('0xa'));var squel=require(_0xe8d9('0xb'));var crypto=require(_0xe8d9('0xc'));var jsforce=require(_0xe8d9('0xd'));var deskjs=require(_0xe8d9('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe8d9('0xf'));var Redis=require(_0xe8d9('0x10'));var authService=require(_0xe8d9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d9('0x12'))(_0xe8d9('0x13'));var utils=require('../../config/utils');var config=require(_0xe8d9('0x14'));var db=require(_0xe8d9('0x15'))['db'];config[_0xe8d9('0x16')]=_[_0xe8d9('0x17')](config[_0xe8d9('0x16')],{'host':_0xe8d9('0x18'),'port':0x18eb});var socket=require(_0xe8d9('0x19'))(new Redis(config['redis']));require(_0xe8d9('0x1a'))[_0xe8d9('0x1b')](socket);var jayson=require(_0xe8d9('0x1c'));var client=jayson[_0xe8d9('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xe8d9('0x1d')][_0xe8d9('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x32ccd4,_0xc42d99,_0x36aaeb){if(_0x36aaeb){var _0x27c313=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27c313['test'](_0xc42d99)){return _0x32ccd4;}else{throw new db[(_0xe8d9('0x1f'))]['ValidationError'](_0xe8d9('0x20'));}}else{return _0x32ccd4;}}function respondWithRpcPromise(_0x29faeb,_0x48c21d,_0x166794,_0x367675){return new BPromise(function(_0x5ee79f,_0x84e80f){var _0x5cb8ba=_0x367675||client;return _0x5cb8ba['request'](_0x29faeb,_0x166794)[_0xe8d9('0x21')](function(_0x26168e){logger[_0xe8d9('0x22')](_0xe8d9('0x23'),_0x48c21d,_0xe8d9('0x24'));logger[_0xe8d9('0x25')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x48c21d,_0xe8d9('0x24'),JSON[_0xe8d9('0x26')](_0x26168e));if(_0x26168e[_0xe8d9('0x27')]){if(_0x26168e[_0xe8d9('0x27')]['code']===0x1f4){logger[_0xe8d9('0x27')](_0xe8d9('0x23'),_0x48c21d,_0x26168e[_0xe8d9('0x27')][_0xe8d9('0x28')]);return _0x84e80f(_0x26168e[_0xe8d9('0x27')][_0xe8d9('0x28')]);}logger[_0xe8d9('0x27')](_0xe8d9('0x23'),_0x48c21d,_0x26168e[_0xe8d9('0x27')][_0xe8d9('0x28')]);return _0x5ee79f(_0x26168e[_0xe8d9('0x27')]['message']);}else{logger[_0xe8d9('0x22')](_0xe8d9('0x23'),_0x48c21d,'request\x20sent');_0x5ee79f(_0x26168e[_0xe8d9('0x29')][_0xe8d9('0x28')]);}})[_0xe8d9('0x2a')](function(_0x52c52d){logger[_0xe8d9('0x27')](_0xe8d9('0x23'),_0x48c21d,_0x52c52d);_0x84e80f(_0x52c52d);});});}function respondWithStatusCode(_0x454747,_0x57b919){_0x57b919=_0x57b919||0xcc;return function(_0x504cac){if(_0x504cac){return _0x454747[_0xe8d9('0x2b')](_0x57b919);}return _0x454747['status'](_0x57b919)[_0xe8d9('0x2c')]();};}function respondWithResult(_0x542d2a,_0x21e3e0){_0x21e3e0=_0x21e3e0||0xc8;return function(_0x1dd62a){if(_0x1dd62a){return _0x542d2a[_0xe8d9('0x2d')](_0x21e3e0)[_0xe8d9('0x2e')](_0x1dd62a);}};}function respondWithFilteredResult(_0x685696,_0x4fd1f8){return function(_0x416ad5){if(_0x416ad5){var _0x3011bf=_0x416ad5[_0xe8d9('0x2f')],_0xe19446=_0x4fd1f8[_0xe8d9('0x30')],_0x134fe4=_0x4fd1f8[_0xe8d9('0x30')]+_0x4fd1f8['limit'],_0x5cff77;if(_0x134fe4>=_0x3011bf){_0x134fe4=_0x3011bf;_0x5cff77=0xc8;}else{_0x5cff77=0xce;}_0x685696['status'](_0x5cff77);return _0x685696[_0xe8d9('0x31')](_0xe8d9('0x32'),_0xe19446+'-'+_0x134fe4+'/'+_0x3011bf)[_0xe8d9('0x2e')](_0x416ad5);}return null;};}function patchUpdates(_0x5abc27){return function(_0x4f462c){try{jsonpatch[_0xe8d9('0x33')](_0x4f462c,_0x5abc27,!![]);}catch(_0x10e9a2){return BPromise[_0xe8d9('0x34')](_0x10e9a2);}return _0x4f462c[_0xe8d9('0x35')]();};}function saveUpdates(_0x1c0175,_0x589549){return function(_0xf3a43b){if(_0xf3a43b){return _0xf3a43b[_0xe8d9('0x36')](_0x1c0175)[_0xe8d9('0x21')](function(_0xf2dd8){return _0xf2dd8;});}return null;};}function removeEntity(_0x421a5d,_0x15326b){return function(_0x4cdb43){if(_0x4cdb43){return _0x4cdb43[_0xe8d9('0x37')]()['then'](function(){var _0x1c250f=_0x4cdb43['get']({'plain':!![]});var _0x5a17a0=_0xe8d9('0x38');return db[_0xe8d9('0x39')][_0xe8d9('0x37')]({'where':{'type':_0x5a17a0,'resourceId':_0x1c250f['id']}})['then'](function(){return _0x4cdb43;});})[_0xe8d9('0x21')](function(){_0x421a5d['status'](0xcc)[_0xe8d9('0x2c')]();});}};}function handleEntityNotFound(_0x5a0178,_0x3e4ab6){return function(_0x527aa5){if(!_0x527aa5){_0x5a0178[_0xe8d9('0x2b')](0x194);}return _0x527aa5;};}function handleError(_0x4e0192,_0x5e85f2){_0x5e85f2=_0x5e85f2||0x1f4;return function(_0xff423e){logger[_0xe8d9('0x27')](_0xff423e[_0xe8d9('0x3a')]);if(_0xff423e['name']){delete _0xff423e[_0xe8d9('0x3b')];}_0x4e0192[_0xe8d9('0x2d')](_0x5e85f2)['send'](_0xff423e);};}exports[_0xe8d9('0x3c')]=function(_0x387863,_0x3b0507){var _0x2d219a={'include':[{'model':db[_0xe8d9('0x3d')],'as':_0xe8d9('0x3e')}]},_0x7fdad3={},_0x565d0e={'count':0x0,'rows':[]};var _0x1f8e63=_[_0xe8d9('0x3f')](db[_0xe8d9('0x40')][_0xe8d9('0x41')],function(_0x45fc1d){return{'name':_0x45fc1d[_0xe8d9('0x42')],'type':_0x45fc1d[_0xe8d9('0x43')][_0xe8d9('0x44')]};});_0x7fdad3['model']=_[_0xe8d9('0x3f')](_0x1f8e63,'name');_0x7fdad3[_0xe8d9('0x45')]=_[_0xe8d9('0x46')](_0x387863[_0xe8d9('0x45')]);_0x7fdad3[_0xe8d9('0x47')]=_[_0xe8d9('0x48')](_0x7fdad3['model'],_0x7fdad3[_0xe8d9('0x45')]);_0x2d219a['attributes']=_[_0xe8d9('0x48')](_0x7fdad3[_0xe8d9('0x49')],qs[_0xe8d9('0x4a')](_0x387863[_0xe8d9('0x45')][_0xe8d9('0x4a')]));_0x2d219a[_0xe8d9('0x4b')]=_0x2d219a[_0xe8d9('0x4b')][_0xe8d9('0x4c')]?_0x2d219a[_0xe8d9('0x4b')]:_0x7fdad3[_0xe8d9('0x49')];if(!_0x387863[_0xe8d9('0x45')][_0xe8d9('0x4d')](_0xe8d9('0x4e'))){_0x2d219a[_0xe8d9('0x4f')]=qs[_0xe8d9('0x4f')](_0x387863[_0xe8d9('0x45')][_0xe8d9('0x4f')]);_0x2d219a[_0xe8d9('0x30')]=qs[_0xe8d9('0x30')](_0x387863[_0xe8d9('0x45')][_0xe8d9('0x30')]);}_0x2d219a[_0xe8d9('0x50')]=qs[_0xe8d9('0x51')](_0x387863[_0xe8d9('0x45')][_0xe8d9('0x51')]);_0x2d219a[_0xe8d9('0x52')]=qs['filters'](_['pick'](_0x387863[_0xe8d9('0x45')],_0x7fdad3[_0xe8d9('0x47')]));if(_0x387863[_0xe8d9('0x45')]['filter']){_0x2d219a[_0xe8d9('0x52')]=_[_0xe8d9('0x53')](_0x2d219a[_0xe8d9('0x52')],{'$or':_[_0xe8d9('0x3f')](_0x1f8e63,function(_0x498d2c){if(_0x498d2c['type']!==_0xe8d9('0x54')){var _0x4d0b40={};_0x4d0b40[_0x498d2c['name']]={'$like':'%'+_0x387863['query'][_0xe8d9('0x55')]+'%'};return _0x4d0b40;}})});}_0x2d219a=_[_0xe8d9('0x53')]({},_0x2d219a,_0x387863[_0xe8d9('0x56')]);var _0x293ea7={'where':_0x2d219a[_0xe8d9('0x52')]};return db[_0xe8d9('0x40')][_0xe8d9('0x2f')](_0x293ea7)[_0xe8d9('0x21')](function(_0x58c2ce){_0x565d0e[_0xe8d9('0x2f')]=_0x58c2ce;if(_0x387863[_0xe8d9('0x45')]['includeAll']){_0x2d219a[_0xe8d9('0x57')]=[{'all':!![]}];}return db[_0xe8d9('0x40')]['findAll'](_0x2d219a);})[_0xe8d9('0x21')](function(_0x24fec3){_0x565d0e[_0xe8d9('0x58')]=_0x24fec3;return _0x565d0e;})[_0xe8d9('0x21')](respondWithFilteredResult(_0x3b0507,_0x2d219a))[_0xe8d9('0x2a')](handleError(_0x3b0507,null));};exports['show']=function(_0x457580,_0x1378b7){var _0x429d43={'raw':![],'where':{'id':_0x457580[_0xe8d9('0x59')]['id']},'include':[{'model':db[_0xe8d9('0x3d')],'as':_0xe8d9('0x3e')}]},_0x45f09b={};_0x45f09b[_0xe8d9('0x49')]=_[_0xe8d9('0x46')](db[_0xe8d9('0x40')][_0xe8d9('0x41')]);_0x45f09b[_0xe8d9('0x45')]=_['keys'](_0x457580['query']);_0x45f09b[_0xe8d9('0x47')]=_[_0xe8d9('0x48')](_0x45f09b['model'],_0x45f09b['query']);_0x429d43[_0xe8d9('0x4b')]=_[_0xe8d9('0x48')](_0x45f09b[_0xe8d9('0x49')],qs[_0xe8d9('0x4a')](_0x457580[_0xe8d9('0x45')][_0xe8d9('0x4a')]));_0x429d43[_0xe8d9('0x4b')]=_0x429d43[_0xe8d9('0x4b')][_0xe8d9('0x4c')]?_0x429d43['attributes']:_0x45f09b['model'];if(_0x457580[_0xe8d9('0x45')][_0xe8d9('0x5a')]){_0x429d43[_0xe8d9('0x57')]=[{'all':!![]}];}_0x429d43=_[_0xe8d9('0x53')]({},_0x429d43,_0x457580[_0xe8d9('0x56')]);return db[_0xe8d9('0x40')][_0xe8d9('0x5b')](_0x429d43)['then'](handleEntityNotFound(_0x1378b7,null))[_0xe8d9('0x21')](respondWithResult(_0x1378b7,null))[_0xe8d9('0x2a')](handleError(_0x1378b7,null));};exports[_0xe8d9('0x5c')]=function(_0x335e54,_0x153634){return db['OpenchannelAccount']['create'](_0x335e54[_0xe8d9('0x5d')],{})['then'](function(_0x576e88){var _0x465902=_0x335e54[_0xe8d9('0x5e')][_0xe8d9('0x5f')]({'plain':!![]});if(!_0x465902)throw new Error(_0xe8d9('0x60'));if(_0x465902[_0xe8d9('0x61')]===_0xe8d9('0x5e')){var _0xae7d18=_0x576e88[_0xe8d9('0x5f')]({'plain':!![]});var _0x109e8c=_0xe8d9('0x38');return db[_0xe8d9('0x62')]['find']({'where':{'name':_0x109e8c,'userProfileId':_0x465902['userProfileId']},'raw':!![]})[_0xe8d9('0x21')](function(_0x8fd691){if(_0x8fd691&&_0x8fd691[_0xe8d9('0x63')]===0x0){return db[_0xe8d9('0x39')]['create']({'name':_0xae7d18[_0xe8d9('0x3b')],'resourceId':_0xae7d18['id'],'type':_0x8fd691[_0xe8d9('0x3b')],'sectionId':_0x8fd691['id']},{})[_0xe8d9('0x21')](function(){return _0x576e88;});}else{return _0x576e88;}})[_0xe8d9('0x2a')](function(_0x35c79c){logger[_0xe8d9('0x27')](_0xe8d9('0x64'),_0x35c79c);throw _0x35c79c;});}return _0x576e88;})['then'](respondWithResult(_0x153634,0xc9))['catch'](handleError(_0x153634,null));};exports[_0xe8d9('0x36')]=function(_0x383fd0,_0xa52c64){if(_0x383fd0['body']['id']){delete _0x383fd0[_0xe8d9('0x5d')]['id'];}return db['OpenchannelAccount'][_0xe8d9('0x5b')]({'where':{'id':_0x383fd0[_0xe8d9('0x59')]['id']},'include':[{'model':db[_0xe8d9('0x3d')],'as':_0xe8d9('0x3e')}]})[_0xe8d9('0x21')](handleEntityNotFound(_0xa52c64,null))[_0xe8d9('0x21')](saveUpdates(_0x383fd0['body'],null))[_0xe8d9('0x21')](respondWithResult(_0xa52c64,null))['catch'](handleError(_0xa52c64,null));};exports[_0xe8d9('0x37')]=function(_0x10c0cf,_0xc394fe){return db[_0xe8d9('0x40')][_0xe8d9('0x5b')]({'where':{'id':_0x10c0cf[_0xe8d9('0x59')]['id']}})[_0xe8d9('0x21')](handleEntityNotFound(_0xc394fe,null))[_0xe8d9('0x21')](removeEntity(_0xc394fe,null))[_0xe8d9('0x2a')](handleError(_0xc394fe,null));};exports[_0xe8d9('0x65')]=function(_0x960d28,_0x11ca30){return db[_0xe8d9('0x40')][_0xe8d9('0x65')]()[_0xe8d9('0x21')](respondWithResult(_0x11ca30,null))[_0xe8d9('0x2a')](handleError(_0x11ca30,null));};exports[_0xe8d9('0x66')]=function(_0x27cf0b,_0x3a7bd0,_0x23f74e){if(_0x27cf0b[_0xe8d9('0x5d')]['id']){delete _0x27cf0b['body']['id'];}return db[_0xe8d9('0x40')]['find']({'where':{'id':_0x27cf0b[_0xe8d9('0x59')]['id']}})[_0xe8d9('0x21')](handleEntityNotFound(_0x3a7bd0,null))[_0xe8d9('0x21')](function(_0x2c270b){if(_0x2c270b){_0x27cf0b[_0xe8d9('0x5d')][_0xe8d9('0x67')]=_0x2c270b['id'];return db['Disposition'][_0xe8d9('0x5c')](_0x27cf0b[_0xe8d9('0x5d')]);}})[_0xe8d9('0x21')](respondWithResult(_0x3a7bd0,null))[_0xe8d9('0x2a')](handleError(_0x3a7bd0,null));};exports[_0xe8d9('0x68')]=function(_0x3fa767,_0x624cea,_0x394dc2){var _0x2e1e94={'raw':![],'where':{}};var _0x50a210={};var _0x48011d={'count':0x0,'rows':[]};return db[_0xe8d9('0x40')][_0xe8d9('0x69')]({'where':{'id':_0x3fa767[_0xe8d9('0x59')]['id']}})[_0xe8d9('0x21')](handleEntityNotFound(_0x624cea,null))[_0xe8d9('0x21')](function(_0x179b65){if(_0x179b65){_0x50a210['model']=_[_0xe8d9('0x46')](db[_0xe8d9('0x6a')][_0xe8d9('0x41')]);_0x50a210[_0xe8d9('0x45')]=_[_0xe8d9('0x46')](_0x3fa767[_0xe8d9('0x45')]);_0x50a210[_0xe8d9('0x47')]=_[_0xe8d9('0x48')](_0x50a210['model'],_0x50a210[_0xe8d9('0x45')]);_0x2e1e94[_0xe8d9('0x4b')]=_[_0xe8d9('0x48')](_0x50a210['model'],qs[_0xe8d9('0x4a')](_0x3fa767[_0xe8d9('0x45')][_0xe8d9('0x4a')]));_0x2e1e94['attributes']=_0x2e1e94[_0xe8d9('0x4b')][_0xe8d9('0x4c')]?_0x2e1e94[_0xe8d9('0x4b')]:_0x50a210[_0xe8d9('0x49')];if(!_0x3fa767['query'][_0xe8d9('0x4d')](_0xe8d9('0x4e'))){_0x2e1e94[_0xe8d9('0x4f')]=qs['limit'](_0x3fa767[_0xe8d9('0x45')][_0xe8d9('0x4f')]);_0x2e1e94[_0xe8d9('0x30')]=qs[_0xe8d9('0x30')](_0x3fa767[_0xe8d9('0x45')][_0xe8d9('0x30')]);}_0x2e1e94[_0xe8d9('0x50')]=qs['sort'](_0x3fa767[_0xe8d9('0x45')][_0xe8d9('0x51')]);_0x2e1e94['where']=qs[_0xe8d9('0x47')](_[_0xe8d9('0x6b')](_0x3fa767[_0xe8d9('0x45')],_0x50a210[_0xe8d9('0x47')]));_0x2e1e94[_0xe8d9('0x52')][_0xe8d9('0x6c')]=_0x179b65['id'];if(_0x3fa767['query']['filter']){_0x2e1e94[_0xe8d9('0x52')]=_[_0xe8d9('0x53')](_0x2e1e94[_0xe8d9('0x52')],{'$or':_[_0xe8d9('0x3f')](_0x2e1e94[_0xe8d9('0x4b')],function(_0x4e3a75){var _0x213c58={};_0x213c58[_0x4e3a75]={'$like':'%'+_0x3fa767['query'][_0xe8d9('0x55')]+'%'};return _0x213c58;})});}_0x2e1e94=_[_0xe8d9('0x53')]({},_0x2e1e94,_0x3fa767[_0xe8d9('0x56')]);return db[_0xe8d9('0x6a')]['count']({'where':_0x2e1e94[_0xe8d9('0x52')]})[_0xe8d9('0x21')](function(_0x1af3c2){_0x48011d['count']=_0x1af3c2;if(_0x3fa767[_0xe8d9('0x45')][_0xe8d9('0x5a')]){_0x2e1e94[_0xe8d9('0x57')]=[{'all':!![]}];}return db[_0xe8d9('0x6a')]['findAll'](_0x2e1e94);})['then'](function(_0x59f857){_0x48011d['rows']=_0x59f857;return _0x48011d;});}})[_0xe8d9('0x21')](respondWithFilteredResult(_0x624cea,_0x2e1e94))[_0xe8d9('0x2a')](handleError(_0x624cea,null));};exports[_0xe8d9('0x6d')]=function(_0x47a817,_0x2f7ed8,_0x826e8b){return db[_0xe8d9('0x40')]['find']({'where':{'id':_0x47a817[_0xe8d9('0x59')]['id']}})[_0xe8d9('0x21')](handleEntityNotFound(_0x2f7ed8,null))['then'](function(_0x1dbaf1){if(_0x1dbaf1){return _0x1dbaf1[_0xe8d9('0x6d')](_0x47a817['query'][_0xe8d9('0x6e')]);}})[_0xe8d9('0x21')](respondWithStatusCode(_0x2f7ed8,null))[_0xe8d9('0x2a')](handleError(_0x2f7ed8,null));};exports['addAnswer']=function(_0x58c248,_0x230e85,_0xc0ff42){if(_0x58c248[_0xe8d9('0x5d')]['id']){delete _0x58c248['body']['id'];}return db[_0xe8d9('0x40')]['find']({'where':{'id':_0x58c248[_0xe8d9('0x59')]['id']}})[_0xe8d9('0x21')](handleEntityNotFound(_0x230e85,null))[_0xe8d9('0x21')](function(_0x530aef){if(_0x530aef){_0x58c248[_0xe8d9('0x5d')]['OpenchannelAccountId']=_0x530aef['id'];return db[_0xe8d9('0x6f')][_0xe8d9('0x5c')](_0x58c248['body']);}})['then'](respondWithResult(_0x230e85,null))['catch'](handleError(_0x230e85,null));};exports[_0xe8d9('0x70')]=function(_0x2b5cd1,_0x183d14,_0xc6bf07){var _0x515d1f={'raw':![],'where':{}};var _0xee080b={};var _0x7e7a96={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe8d9('0x69')]({'where':{'id':_0x2b5cd1[_0xe8d9('0x59')]['id']}})[_0xe8d9('0x21')](handleEntityNotFound(_0x183d14,null))['then'](function(_0x202fb3){if(_0x202fb3){_0xee080b[_0xe8d9('0x49')]=_[_0xe8d9('0x46')](db[_0xe8d9('0x6f')][_0xe8d9('0x41')]);_0xee080b['query']=_[_0xe8d9('0x46')](_0x2b5cd1[_0xe8d9('0x45')]);_0xee080b[_0xe8d9('0x47')]=_[_0xe8d9('0x48')](_0xee080b[_0xe8d9('0x49')],_0xee080b['query']);_0x515d1f['attributes']=_['intersection'](_0xee080b[_0xe8d9('0x49')],qs[_0xe8d9('0x4a')](_0x2b5cd1['query']['fields']));_0x515d1f[_0xe8d9('0x4b')]=_0x515d1f[_0xe8d9('0x4b')][_0xe8d9('0x4c')]?_0x515d1f[_0xe8d9('0x4b')]:_0xee080b[_0xe8d9('0x49')];if(!_0x2b5cd1[_0xe8d9('0x45')][_0xe8d9('0x4d')]('nolimit')){_0x515d1f['limit']=qs[_0xe8d9('0x4f')](_0x2b5cd1[_0xe8d9('0x45')]['limit']);_0x515d1f[_0xe8d9('0x30')]=qs[_0xe8d9('0x30')](_0x2b5cd1['query'][_0xe8d9('0x30')]);}_0x515d1f[_0xe8d9('0x50')]=qs[_0xe8d9('0x51')](_0x2b5cd1['query']['sort']);_0x515d1f[_0xe8d9('0x52')]=qs['filters'](_[_0xe8d9('0x6b')](_0x2b5cd1[_0xe8d9('0x45')],_0xee080b[_0xe8d9('0x47')]));_0x515d1f['where']['OpenchannelAccountId']=_0x202fb3['id'];if(_0x2b5cd1[_0xe8d9('0x45')][_0xe8d9('0x55')]){_0x515d1f[_0xe8d9('0x52')]=_[_0xe8d9('0x53')](_0x515d1f[_0xe8d9('0x52')],{'$or':_[_0xe8d9('0x3f')](_0x515d1f['attributes'],function(_0x500bb3){var _0x23ee39={};_0x23ee39[_0x500bb3]={'$like':'%'+_0x2b5cd1[_0xe8d9('0x45')][_0xe8d9('0x55')]+'%'};return _0x23ee39;})});}_0x515d1f=_[_0xe8d9('0x53')]({},_0x515d1f,_0x2b5cd1[_0xe8d9('0x56')]);return db['CannedAnswer'][_0xe8d9('0x2f')]({'where':_0x515d1f[_0xe8d9('0x52')]})['then'](function(_0xd757ed){_0x7e7a96[_0xe8d9('0x2f')]=_0xd757ed;if(_0x2b5cd1['query'][_0xe8d9('0x5a')]){_0x515d1f[_0xe8d9('0x57')]=[{'all':!![]}];}return db[_0xe8d9('0x6f')][_0xe8d9('0x71')](_0x515d1f);})[_0xe8d9('0x21')](function(_0x31e102){_0x7e7a96[_0xe8d9('0x58')]=_0x31e102;return _0x7e7a96;});}})[_0xe8d9('0x21')](respondWithFilteredResult(_0x183d14,_0x515d1f))[_0xe8d9('0x2a')](handleError(_0x183d14,null));};exports['removeAnswers']=function(_0x1092b7,_0x1f22e1,_0xad1023){return db[_0xe8d9('0x40')][_0xe8d9('0x5b')]({'where':{'id':_0x1092b7[_0xe8d9('0x59')]['id']}})[_0xe8d9('0x21')](handleEntityNotFound(_0x1f22e1,null))[_0xe8d9('0x21')](function(_0x459476){if(_0x459476){return _0x459476['removeAnswers'](_0x1092b7['query'][_0xe8d9('0x6e')]);}})[_0xe8d9('0x21')](respondWithStatusCode(_0x1f22e1,null))[_0xe8d9('0x2a')](handleError(_0x1f22e1,null));};exports[_0xe8d9('0x72')]=function(_0x27b766,_0x237812,_0xebb0c2){var _0x42f358={'body':_0x27b766[_0xe8d9('0x5d')],'channel':'openchannel'};var _0x1aad2b=[];var _0x233914=[];var _0x400da6={};var _0x196944=![];return db['CmContact']['describe']()[_0xe8d9('0x21')](function(_0x2b3a2b){if(!_0x2b3a2b){throw new db['Sequelize'][(_0xe8d9('0x73'))]('no\x20available\x20attributes');}_0x1aad2b=_[_0xe8d9('0x74')](_[_0xe8d9('0x46')](_0x2b3a2b),[_0xe8d9('0x75'),_0xe8d9('0x76')]);_0x233914=_['difference'](_[_0xe8d9('0x46')](_0x2b3a2b),[_0xe8d9('0x75'),_0xe8d9('0x76'),_0xe8d9('0x77'),_0xe8d9('0x78')]);if(_0x27b766[_0xe8d9('0x5d')]['id']){delete _0x27b766[_0xe8d9('0x5d')]['id'];}if(_['isNil'](_0x27b766[_0xe8d9('0x5d')][_0xe8d9('0x79')])){throw new db['Sequelize'][(_0xe8d9('0x73'))](_0xe8d9('0x7a'));}if(_[_0xe8d9('0x7b')](_0x27b766[_0xe8d9('0x5d')][_0xe8d9('0x5d')])||_0x27b766[_0xe8d9('0x5d')][_0xe8d9('0x5d')]===''){throw new db[(_0xe8d9('0x1f'))][(_0xe8d9('0x73'))](_0xe8d9('0x7c'));}if(_[_0xe8d9('0x7b')](_0x27b766[_0xe8d9('0x5d')]['mapKey'])){throw new db[(_0xe8d9('0x1f'))][(_0xe8d9('0x73'))](_0xe8d9('0x7d')+_0x233914);}if(!_[_0xe8d9('0x7e')](_0x233914,_0x27b766[_0xe8d9('0x5d')][_0xe8d9('0x7f')])){throw new db[(_0xe8d9('0x1f'))]['ValidationError'](_0xe8d9('0x80')+_0x233914);}_0x400da6[_0x27b766[_0xe8d9('0x5d')][_0xe8d9('0x7f')]]=_0x27b766[_0xe8d9('0x5d')][_0xe8d9('0x79')];})['then'](function(){return db[_0xe8d9('0x40')][_0xe8d9('0x5b')]({'where':{'id':_0x27b766[_0xe8d9('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0xe8d9('0x81'),'include':[{'model':db[_0xe8d9('0x82')],'as':_0xe8d9('0x83'),'where':_0x400da6,'limit':0x1,'order':[['updatedAt',_0xe8d9('0x84')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x237812,null))['then'](function(_0x4e0bfb){if(_0x4e0bfb&&_0x4e0bfb['List']){_0x42f358['account']=_0x4e0bfb;_0x42f358[_0xe8d9('0x85')]=_0x4e0bfb['Applications'];_0x42f358[_0xe8d9('0x86')]=_0x4e0bfb['List'];_0x42f358['applications']=_['orderBy'](_0x42f358[_0xe8d9('0x85')],['priority'],[_0xe8d9('0x87')]);if(_0x42f358['account'][_0xe8d9('0x88')]){delete _0x42f358['account'][_0xe8d9('0x88')];}if(_0x42f358[_0xe8d9('0x89')][_0xe8d9('0x81')]&&_0x42f358[_0xe8d9('0x89')]['List']['Contacts']['length']){return _0x42f358[_0xe8d9('0x89')][_0xe8d9('0x81')]['Contacts'][0x0];}var _0x2512d2=_[_0xe8d9('0x17')](_0x27b766[_0xe8d9('0x5d')],{'firstName':_0x27b766[_0xe8d9('0x5d')][_0xe8d9('0x79')],'ListId':_0x4e0bfb[_0xe8d9('0x78')]});_0x2512d2[_0x27b766[_0xe8d9('0x5d')]['mapKey']]=_0x27b766['body']['from'];return db[_0xe8d9('0x82')][_0xe8d9('0x5c')](_0x2512d2,{'fields':_0x1aad2b,'raw':!![]});}})['then'](handleEntityNotFound(_0x237812,null))[_0xe8d9('0x21')](function(_0x166fe0){_0x42f358[_0xe8d9('0x8a')]=_0x166fe0;if(_0x166fe0){var _0x466bfb={'ContactId':_0x166fe0['id'],'OpenchannelAccountId':_0x27b766[_0xe8d9('0x59')]['id'],'from':(_0x166fe0[_0xe8d9('0x8b')]||'')+'\x20'+(_0x166fe0[_0xe8d9('0x8c')]||'')};var _0x5a80c4={'OpenchannelAccountId':_0x27b766[_0xe8d9('0x59')]['id'],'closed':![]};if(_0x27b766['body'][_0xe8d9('0x8d')]){_0x5a80c4[_0xe8d9('0x8d')]=_0x27b766[_0xe8d9('0x5d')]['threadId'];return db[_0xe8d9('0x8e')][_0xe8d9('0x5b')]({'where':_0x5a80c4})['then'](function(_0x4ee7f0){if(_0x4ee7f0){return[_0x4ee7f0,![]];}_0x466bfb[_0xe8d9('0x8d')]=_0x27b766[_0xe8d9('0x5d')][_0xe8d9('0x8d')];_0x466bfb['externalUrl']=_0x27b766[_0xe8d9('0x5d')]['externalUrl'];return db[_0xe8d9('0x8e')]['create'](_0x466bfb)['then'](function(_0x4c46d6){return[_0x4c46d6,!![]];});});}else{_0x5a80c4['threadId']=null;}_0x5a80c4[_0xe8d9('0x8f')]=_0x166fe0['id'];return db[_0xe8d9('0x8e')][_0xe8d9('0x5b')]({'where':_0x5a80c4})['then'](function(_0x5604ef){if(_0x5604ef){return[_0x5604ef,![]];}return db[_0xe8d9('0x8e')][_0xe8d9('0x5c')](_0x466bfb)['then'](function(_0x5cc2bf){return[_0x5cc2bf,!![]];});});}})['spread'](function(_0x95b33f,_0x296f7e){if(_0x95b33f){_0x196944=_0x296f7e;if(!_0x296f7e){var _0x1e9507={'from':(_0x42f358[_0xe8d9('0x8a')][_0xe8d9('0x8b')]||'')+'\x20'+(_0x42f358[_0xe8d9('0x8a')][_0xe8d9('0x8c')]||'')};if(_0x27b766['body'][_0xe8d9('0x8d')]&&_0x27b766[_0xe8d9('0x5d')][_0xe8d9('0x90')]&&_0x27b766[_0xe8d9('0x5d')]['threadId']!=_0x27b766[_0xe8d9('0x5d')][_0xe8d9('0x90')]){_0x1e9507[_0xe8d9('0x8d')]=_0x27b766[_0xe8d9('0x5d')][_0xe8d9('0x90')];}return _0x95b33f['update'](_0x1e9507);}else{return _0x95b33f;}}})[_0xe8d9('0x21')](function(_0x2372eb){_0x42f358['interaction']=_0x2372eb[_0xe8d9('0x5f')]({'plain':!![]});_0x42f358['interaction'][_0xe8d9('0x91')]=_0x196944;if(_0x42f358['interaction'][_0xe8d9('0x91')]){if(_0x42f358['account'][_0xe8d9('0x92')]){_0x42f358[_0xe8d9('0x85')][_0xe8d9('0x93')]({'id':0x0,'priority':_0x42f358[_0xe8d9('0x85')][_0xe8d9('0x4c')]+0x1,'app':_0xe8d9('0x94'),'appdata':_0xe8d9('0x95'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage'][_0xe8d9('0x5c')]({'body':_0x27b766['body'][_0xe8d9('0x5d')],'OpenchannelAccountId':_0x27b766[_0xe8d9('0x59')]['id'],'OpenchannelInteractionId':_0x2372eb['id'],'direction':'in','ContactId':_0x42f358[_0xe8d9('0x8a')]['id'],'AttachmentId':_0x27b766[_0xe8d9('0x5d')][_0xe8d9('0x96')]});})[_0xe8d9('0x21')](function(_0x226113){_0x42f358['message']=_0x226113;if(_0x42f358[_0xe8d9('0x97')][_0xe8d9('0x98')]){return db['User'][_0xe8d9('0x5b')]({'attributes':['id',_0xe8d9('0x3b')],'where':{'id':_0x42f358[_0xe8d9('0x97')][_0xe8d9('0x98')]}})[_0xe8d9('0x21')](function(_0x21c471){if(_0x21c471){_0x42f358[_0xe8d9('0x85')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe8d9('0x99'),'appdata':_0x21c471[_0xe8d9('0x3b')]+','+(_0x42f358[_0xe8d9('0x89')][_0xe8d9('0x9a')]||0xa),'interval':_0xe8d9('0x9b')});_0x42f358['forcedOwnership']=![];}return respondWithRpcPromise(_0xe8d9('0x9c'),_0xe8d9('0x9d'),_0x42f358);});}return respondWithRpcPromise(_0xe8d9('0x9c'),_0xe8d9('0x9d'),_0x42f358);})[_0xe8d9('0x21')](function(_0x187173){respondWithRpcPromise(_0xe8d9('0x9e'),'EventManager',{'event':_0xe8d9('0x72'),'message':_0x187173},client9002);return _0x187173;})[_0xe8d9('0x21')](respondWithResult(_0x237812,null))[_0xe8d9('0x2a')](handleError(_0x237812,null));};exports[_0xe8d9('0x9f')]=function(_0x18b13d,_0x3662dc,_0x49092c){return db['OpenchannelAccount'][_0xe8d9('0x69')]({'where':{'id':_0x18b13d[_0xe8d9('0x59')]['id']}})[_0xe8d9('0x21')](handleEntityNotFound(_0x3662dc,null))[_0xe8d9('0x21')](function(_0x3b2dfc){if(_0x3b2dfc){return db[_0xe8d9('0xa0')][_0xe8d9('0xa1')](function(_0x418896){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x18b13d[_0xe8d9('0x59')]['id']},'transaction':_0x418896})['then'](function(_0xae7cde){var _0x245741=_[_0xe8d9('0x3f')](_0x18b13d[_0xe8d9('0x5d')],function(_0x3cf489){_0x3cf489['OpenchannelAccountId']=_0x18b13d['params']['id'];return _0x3cf489;});return db[_0xe8d9('0xa2')][_0xe8d9('0xa3')](_0x245741,{'transaction':_0x418896});});})['then'](function(){return db[_0xe8d9('0xa2')][_0xe8d9('0xa4')]({'where':{'OpenchannelAccountId':_0x18b13d[_0xe8d9('0x59')]['id']},'order':_0xe8d9('0xa5')});});}})[_0xe8d9('0x21')](respondWithResult(_0x3662dc,null))[_0xe8d9('0x2a')](handleError(_0x3662dc,null));};exports[_0xe8d9('0xa6')]=function(_0x925ac3,_0x4baec9,_0x413713){var _0x1fc6e5={};var _0x3888e5={};var _0x1ab77f;var _0x30cf01;return db[_0xe8d9('0x40')][_0xe8d9('0x69')]({'where':{'id':_0x925ac3[_0xe8d9('0x59')]['id']}})[_0xe8d9('0x21')](handleEntityNotFound(_0x4baec9,null))[_0xe8d9('0x21')](function(_0x5baa69){if(_0x5baa69){_0x1ab77f=_0x5baa69;_0x3888e5[_0xe8d9('0x49')]=_[_0xe8d9('0x46')](db[_0xe8d9('0xa2')][_0xe8d9('0x41')]);_0x3888e5['query']=_[_0xe8d9('0x46')](_0x925ac3[_0xe8d9('0x45')]);_0x3888e5[_0xe8d9('0x47')]=_[_0xe8d9('0x48')](_0x3888e5['model'],_0x3888e5[_0xe8d9('0x45')]);_0x1fc6e5['attributes']=_[_0xe8d9('0x48')](_0x3888e5[_0xe8d9('0x49')],qs[_0xe8d9('0x4a')](_0x925ac3[_0xe8d9('0x45')][_0xe8d9('0x4a')]));_0x1fc6e5[_0xe8d9('0x4b')]=_0x1fc6e5[_0xe8d9('0x4b')][_0xe8d9('0x4c')]?_0x1fc6e5['attributes']:_0x3888e5[_0xe8d9('0x49')];_0x1fc6e5[_0xe8d9('0x50')]=qs[_0xe8d9('0x51')](_0x925ac3[_0xe8d9('0x45')][_0xe8d9('0x51')]);_0x1fc6e5['where']=qs[_0xe8d9('0x47')](_['pick'](_0x925ac3[_0xe8d9('0x45')],_0x3888e5[_0xe8d9('0x47')]));if(_0x925ac3['query'][_0xe8d9('0x55')]){_0x1fc6e5[_0xe8d9('0x52')]=_[_0xe8d9('0x53')](_0x1fc6e5[_0xe8d9('0x52')],{'$or':_[_0xe8d9('0x3f')](_0x1fc6e5[_0xe8d9('0x4b')],function(_0x28b9a8){var _0x3f67f3={};_0x3f67f3[_0x28b9a8]={'$like':'%'+_0x925ac3[_0xe8d9('0x45')][_0xe8d9('0x55')]+'%'};return _0x3f67f3;})});}_0x1fc6e5=_[_0xe8d9('0x53')]({},_0x1fc6e5,_0x925ac3[_0xe8d9('0x56')]);return _0x1ab77f[_0xe8d9('0xa6')](_0x1fc6e5);}})[_0xe8d9('0x21')](function(_0x565fc0){if(_0x565fc0){_0x30cf01=_0x565fc0[_0xe8d9('0x4c')];if(!_0x925ac3[_0xe8d9('0x45')][_0xe8d9('0x4d')](_0xe8d9('0x4e'))){_0x1fc6e5['limit']=qs['limit'](_0x925ac3['query'][_0xe8d9('0x4f')]);_0x1fc6e5['offset']=qs[_0xe8d9('0x30')](_0x925ac3[_0xe8d9('0x45')][_0xe8d9('0x30')]);}return _0x1ab77f[_0xe8d9('0xa6')](_0x1fc6e5);}})[_0xe8d9('0x21')](function(_0x1608c8){if(_0x1608c8){return _0x1608c8?{'count':_0x30cf01,'rows':_0x1608c8}:null;}})[_0xe8d9('0x21')](respondWithResult(_0x4baec9,null))['catch'](handleError(_0x4baec9,null));};exports[_0xe8d9('0xa7')]=function(_0x5e528b,_0x4033a9,_0x2401da){var _0x4fc53a={'raw':![],'where':{}};var _0x27ab0c={};var _0x4a6989={'count':0x0,'rows':[]};return db[_0xe8d9('0x40')]['findOne']({'where':{'id':_0x5e528b['params']['id']}})[_0xe8d9('0x21')](handleEntityNotFound(_0x4033a9,null))[_0xe8d9('0x21')](function(_0x472594){if(_0x472594){_0x27ab0c[_0xe8d9('0x49')]=_[_0xe8d9('0x46')](db['OpenchannelInteraction'][_0xe8d9('0x41')]);_0x27ab0c['query']=_['keys'](_0x5e528b['query']);_0x27ab0c[_0xe8d9('0x47')]=_[_0xe8d9('0x48')](_0x27ab0c[_0xe8d9('0x49')],_0x27ab0c[_0xe8d9('0x45')]);_0x4fc53a[_0xe8d9('0x4b')]=_[_0xe8d9('0x48')](_0x27ab0c[_0xe8d9('0x49')],qs['fields'](_0x5e528b['query'][_0xe8d9('0x4a')]));_0x4fc53a[_0xe8d9('0x4b')]=_0x4fc53a[_0xe8d9('0x4b')][_0xe8d9('0x4c')]?_0x4fc53a[_0xe8d9('0x4b')]:_0x27ab0c[_0xe8d9('0x49')];if(!_0x5e528b[_0xe8d9('0x45')]['hasOwnProperty']('nolimit')){_0x4fc53a[_0xe8d9('0x4f')]=qs[_0xe8d9('0x4f')](_0x5e528b[_0xe8d9('0x45')]['limit']);_0x4fc53a[_0xe8d9('0x30')]=qs[_0xe8d9('0x30')](_0x5e528b[_0xe8d9('0x45')][_0xe8d9('0x30')]);}_0x4fc53a['order']=qs['sort'](_0x5e528b['query'][_0xe8d9('0x51')]);_0x4fc53a['where']=qs[_0xe8d9('0x47')](_[_0xe8d9('0x6b')](_0x5e528b[_0xe8d9('0x45')],_0x27ab0c[_0xe8d9('0x47')]));_0x4fc53a['where']['OpenchannelAccountId']=_0x472594['id'];if(_0x5e528b[_0xe8d9('0x45')]['filter']){_0x4fc53a['where']=_[_0xe8d9('0x53')](_0x4fc53a[_0xe8d9('0x52')],{'$or':_[_0xe8d9('0x3f')](_0x4fc53a[_0xe8d9('0x4b')],function(_0x1d7d05){var _0x4276e0={};_0x4276e0[_0x1d7d05]={'$like':'%'+_0x5e528b[_0xe8d9('0x45')]['filter']+'%'};return _0x4276e0;})});}_0x4fc53a=_[_0xe8d9('0x53')]({},_0x4fc53a,_0x5e528b[_0xe8d9('0x56')]);return db[_0xe8d9('0x8e')]['count']({'where':_0x4fc53a[_0xe8d9('0x52')]})[_0xe8d9('0x21')](function(_0x475b07){_0x4a6989[_0xe8d9('0x2f')]=_0x475b07;if(_0x5e528b[_0xe8d9('0x45')][_0xe8d9('0x5a')]){_0x4fc53a[_0xe8d9('0x57')]=[{'model':db[_0xe8d9('0x82')],'as':_0xe8d9('0xa8'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xe8d9('0x3b'),_0xe8d9('0xa9'),_0xe8d9('0xaa')],'required':![]},{'model':db[_0xe8d9('0xab')],'as':_0xe8d9('0xac'),'attributes':['id',_0xe8d9('0x3b'),'color'],'where':_0x5e528b['query'][_0xe8d9('0xad')]?{'id':_0x5e528b[_0xe8d9('0x45')][_0xe8d9('0xad')]}:undefined,'required':_0x5e528b[_0xe8d9('0x45')]['tag']?!![]:![]}];}return db['OpenchannelInteraction'][_0xe8d9('0x71')](_0x4fc53a);})[_0xe8d9('0x21')](function(_0x585d65){_0x4a6989[_0xe8d9('0x58')]=_0x585d65;return _0x4a6989;});}})['then'](respondWithFilteredResult(_0x4033a9,_0x4fc53a))[_0xe8d9('0x2a')](handleError(_0x4033a9,null));};exports[_0xe8d9('0xae')]=function(_0x1fafc6,_0xf9023,_0x34f54c){return db[_0xe8d9('0x40')][_0xe8d9('0x5b')]({'where':{'id':_0x1fafc6['params']['id']}})[_0xe8d9('0x21')](handleEntityNotFound(_0xf9023,null))[_0xe8d9('0x21')](function(_0x335de0){if(_0x335de0){return _0x335de0[_0xe8d9('0xae')](_0x1fafc6[_0xe8d9('0x5d')][_0xe8d9('0x6e')],_[_0xe8d9('0xaf')](_0x1fafc6[_0xe8d9('0x5d')],[_0xe8d9('0x6e'),'id'])||{})[_0xe8d9('0xb0')](function(_0x3fc062){for(var _0xa64695=0x0;_0xa64695<_0x1fafc6[_0xe8d9('0x5d')]['ids'][_0xe8d9('0x4c')];_0xa64695+=0x1){socket['emit'](_0xe8d9('0xb1'),{'UserId':_0x1fafc6['body'][_0xe8d9('0x6e')][_0xa64695],'OpenchannelAccountId':_0x1fafc6[_0xe8d9('0x59')]['id']});}return _0x3fc062;});}})[_0xe8d9('0x21')](respondWithResult(_0xf9023,null))[_0xe8d9('0x2a')](handleError(_0xf9023,null));};exports[_0xe8d9('0xb2')]=function(_0x3ec00c,_0x278a78,_0x5e61c9){return db[_0xe8d9('0x40')]['find']({'where':{'id':_0x3ec00c['params']['id']}})[_0xe8d9('0x21')](handleEntityNotFound(_0x278a78,null))['then'](function(_0x4cc96e){if(_0x4cc96e){return _0x4cc96e[_0xe8d9('0xb2')](_0x3ec00c[_0xe8d9('0x45')]['ids'])[_0xe8d9('0x21')](function(){if(_[_0xe8d9('0xb3')](_0x3ec00c[_0xe8d9('0x45')][_0xe8d9('0x6e')])){for(var _0x4557d4=0x0;_0x4557d4<_0x3ec00c[_0xe8d9('0x45')]['ids'][_0xe8d9('0x4c')];_0x4557d4+=0x1){socket[_0xe8d9('0xb4')](_0xe8d9('0xb5'),{'UserId':Number(_0x3ec00c['query'][_0xe8d9('0x6e')][_0x4557d4]),'OpenchannelAccountId':Number(_0x3ec00c[_0xe8d9('0x59')]['id'])});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x3ec00c[_0xe8d9('0x45')]['ids']),'OpenchannelAccountId':Number(_0x3ec00c[_0xe8d9('0x59')]['id'])});}});}})[_0xe8d9('0x21')](respondWithStatusCode(_0x278a78,null))[_0xe8d9('0x2a')](handleError(_0x278a78,null));};exports[_0xe8d9('0xb6')]=function(_0x3d611a,_0x4dd3a1,_0x415a1d){var _0x84092={};var _0x3bc1ad={};var _0x5a4e5a;var _0x2ecfad;return db[_0xe8d9('0x40')][_0xe8d9('0x69')]({'where':{'id':_0x3d611a[_0xe8d9('0x59')]['id']}})[_0xe8d9('0x21')](handleEntityNotFound(_0x4dd3a1,null))['then'](function(_0x2f839a){if(_0x2f839a){_0x5a4e5a=_0x2f839a;_0x3bc1ad[_0xe8d9('0x49')]=_[_0xe8d9('0x46')](db[_0xe8d9('0xb7')][_0xe8d9('0x41')]);_0x3bc1ad[_0xe8d9('0x45')]=_[_0xe8d9('0x46')](_0x3d611a[_0xe8d9('0x45')]);_0x3bc1ad[_0xe8d9('0x47')]=_['intersection'](_0x3bc1ad['model'],_0x3bc1ad[_0xe8d9('0x45')]);_0x84092[_0xe8d9('0x4b')]=_[_0xe8d9('0x48')](_0x3bc1ad[_0xe8d9('0x49')],qs['fields'](_0x3d611a[_0xe8d9('0x45')][_0xe8d9('0x4a')]));_0x84092['attributes']=_0x84092['attributes']['length']?_0x84092[_0xe8d9('0x4b')]:_0x3bc1ad[_0xe8d9('0x49')];_0x84092[_0xe8d9('0x50')]=qs[_0xe8d9('0x51')](_0x3d611a[_0xe8d9('0x45')][_0xe8d9('0x51')]);_0x84092[_0xe8d9('0x52')]=qs[_0xe8d9('0x47')](_[_0xe8d9('0x6b')](_0x3d611a[_0xe8d9('0x45')],_0x3bc1ad[_0xe8d9('0x47')]));if(_0x3d611a[_0xe8d9('0x45')][_0xe8d9('0x55')]){_0x84092[_0xe8d9('0x52')]=_[_0xe8d9('0x53')](_0x84092[_0xe8d9('0x52')],{'$or':_['map'](_0x84092[_0xe8d9('0x4b')],function(_0x4d2175){var _0x12aa31={};_0x12aa31[_0x4d2175]={'$like':'%'+_0x3d611a[_0xe8d9('0x45')][_0xe8d9('0x55')]+'%'};return _0x12aa31;})});}_0x84092=_[_0xe8d9('0x53')]({},_0x84092,_0x3d611a['options']);return _0x5a4e5a[_0xe8d9('0xb6')](_0x84092);}})['then'](function(_0x2e93fa){if(_0x2e93fa){_0x2ecfad=_0x2e93fa[_0xe8d9('0x4c')];if(!_0x3d611a[_0xe8d9('0x45')][_0xe8d9('0x4d')](_0xe8d9('0x4e'))){_0x84092['limit']=qs[_0xe8d9('0x4f')](_0x3d611a[_0xe8d9('0x45')][_0xe8d9('0x4f')]);_0x84092[_0xe8d9('0x30')]=qs[_0xe8d9('0x30')](_0x3d611a[_0xe8d9('0x45')][_0xe8d9('0x30')]);}return _0x5a4e5a[_0xe8d9('0xb6')](_0x84092);}})[_0xe8d9('0x21')](function(_0x49d1b8){if(_0x49d1b8){return _0x49d1b8?{'count':_0x2ecfad,'rows':_0x49d1b8}:null;}})[_0xe8d9('0x21')](respondWithResult(_0x4dd3a1,null))['catch'](handleError(_0x4dd3a1,null));};exports[_0xe8d9('0xb8')]=function(_0x445e68,_0x2f7b94,_0x172b1a){var _0x3f7b19,_0x134eba,_0x5d5741;if(_[_0xe8d9('0x7b')](_0x445e68[_0xe8d9('0x5d')][_0xe8d9('0x5d')])||_0x445e68['body'][_0xe8d9('0x5d')]===''){throw new db[(_0xe8d9('0x1f'))]['ValidationError'](_0xe8d9('0x7c'));}if(_[_0xe8d9('0x7b')](_0x445e68[_0xe8d9('0x5d')]['to'])){}_0x3f7b19=_0x445e68[_0xe8d9('0x5d')]['to'];return db[_0xe8d9('0x40')][_0xe8d9('0x69')]({'where':{'id':_0x445e68[_0xe8d9('0x59')]['id']}})[_0xe8d9('0x21')](handleEntityNotFound(_0x2f7b94,null))[_0xe8d9('0x21')](function(_0x20420e){if(_0x20420e){return db[_0xe8d9('0x40')][_0xe8d9('0x5b')]({'where':{'id':_0x20420e['id']},'include':[{'model':db[_0xe8d9('0xb9')],'as':_0xe8d9('0x81'),'include':[{'model':db[_0xe8d9('0x82')],'as':'Contacts','where':{[_0x20420e[_0xe8d9('0x7f')]]:_0x3f7b19},'limit':0x1,'order':[[_0xe8d9('0x76'),_0xe8d9('0x84')]]}]}]})[_0xe8d9('0x21')](handleEntityNotFound(_0x2f7b94,null))[_0xe8d9('0x21')](function(_0x1f657d){if(_0x1f657d&&_0x1f657d[_0xe8d9('0x81')]){_0x134eba=_0x1f657d[_0xe8d9('0x5f')]({'plain':!![]});if(_0x134eba['List']&&_0x134eba[_0xe8d9('0x81')]['Contacts'][_0xe8d9('0x4c')]){return _0x134eba[_0xe8d9('0x81')][_0xe8d9('0x83')][0x0];}return db[_0xe8d9('0x82')]['create'](_['defaults'](_0x445e68[_0xe8d9('0x5d')],{'firstName':_0x3f7b19,[_0x1f657d[_0xe8d9('0x7f')]]:_0x3f7b19,'phone':_0x3f7b19,'ListId':_0x134eba[_0xe8d9('0x78')]}));}})[_0xe8d9('0x21')](handleEntityNotFound(_0x2f7b94,null))[_0xe8d9('0x21')](function(_0x448c43){if(_0x448c43){_0x5d5741=_0x448c43;return db[_0xe8d9('0x8e')][_0xe8d9('0x5b')]({'where':{'ContactId':_0x5d5741['id'],'closed':![],'OpenchannelAccountId':_0x134eba['id']}})['then'](function(_0x60e1be){if(_0x60e1be){return[_0x60e1be,![]];}return db[_0xe8d9('0x8e')][_0xe8d9('0x5c')]({'UserId':_0x445e68[_0xe8d9('0x5e')]['id'],'ContactId':_0x5d5741['id'],'OpenchannelAccountId':_0x134eba['id'],'lastMsgDirection':_0xe8d9('0xba'),'Messages':[_['merge'](_0x445e68[_0xe8d9('0x5d')],{'read':![],'body':_0x445e68['body']['body'],'OpenchannelAccountId':_0x134eba['id'],'UserId':_0x445e68[_0xe8d9('0x5e')]['id'],'ContactId':_0x5d5741['id']})]},{'include':[{'model':db[_0xe8d9('0xbb')],'as':_0xe8d9('0xbc')}]})[_0xe8d9('0x21')](function(_0x1b97ed){return[_0x1b97ed,!![]];});});}})[_0xe8d9('0xb0')](function(_0x1a8fa8,_0x27bcf6){if(_0x27bcf6){return _0x1a8fa8;}return db[_0xe8d9('0xbb')][_0xe8d9('0x5c')](_[_0xe8d9('0x53')](_0x445e68[_0xe8d9('0x5d')],{'read':![],'body':_0x445e68['body'][_0xe8d9('0x5d')],'OpenchannelAccountId':_0x134eba['id'],'OpenchannelInteractionId':_0x1a8fa8['id'],'UserId':_0x445e68[_0xe8d9('0x5e')]['id'],'ContactId':_0x5d5741['id']}))[_0xe8d9('0x21')](function(_0x16fa4b){_0x1a8fa8[_0xe8d9('0xbd')]['Messages']=[];_0x1a8fa8[_0xe8d9('0xbd')][_0xe8d9('0xbc')]['push'](_0x16fa4b[_0xe8d9('0xbd')]);return _0x1a8fa8;});});}})['then'](respondWithResult(_0x2f7b94,null))[_0xe8d9('0x2a')](handleError(_0x2f7b94,null));}; \ No newline at end of file +var _0x3d76=['where','filters','pick','merge','filter','count','includeAll','include','findAll','rows','show','params','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','findOne','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','notify','no\x20available\x20attributes','difference','createdAt','CompanyId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','updatedAt','DESC','OpenchannelApplication','Applications','applications','list','orderBy','asc','account','ListId','CmContact','firstName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','lastName','messageId','interaction','created','push','unmanaged','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','sequelize','OpenchannelAccountId','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','fullname','Tags','color','tag','addAgents','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','dataValues','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','set','apply','reject','save','update','OpenchannelAccounts','destroy','stack','name','send','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x3d76,0x1d8));var _0x63d7=function(_0x602ca8,_0x568e82){_0x602ca8=_0x602ca8-0x0;var _0x26e8ab=_0x3d76[_0x602ca8];return _0x26e8ab;};'use strict';var pdf=require(_0x63d7('0x0'));var emlformat=require(_0x63d7('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x63d7('0x2'));var rp=require(_0x63d7('0x3'));var moment=require(_0x63d7('0x4'));var BPromise=require(_0x63d7('0x5'));var Mustache=require(_0x63d7('0x6'));var util=require('util');var path=require(_0x63d7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x63d7('0x8'));var fs=require('fs');var _=require(_0x63d7('0x9'));var squel=require(_0x63d7('0xa'));var crypto=require(_0x63d7('0xb'));var jsforce=require(_0x63d7('0xc'));var deskjs=require(_0x63d7('0xd'));var toCsv=require('to-csv');var querystring=require(_0x63d7('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x63d7('0xf'));var as=require(_0x63d7('0x10'));var hardwareService=require(_0x63d7('0x11'));var logger=require('../../config/logger')(_0x63d7('0x12'));var utils=require('../../config/utils');var config=require(_0x63d7('0x13'));var db=require(_0x63d7('0x14'))['db'];config[_0x63d7('0x15')]=_[_0x63d7('0x16')](config['redis'],{'host':_0x63d7('0x17'),'port':0x18eb});var socket=require(_0x63d7('0x18'))(new Redis(config['redis']));require(_0x63d7('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x63d7('0x1a')][_0x63d7('0x1b')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x5ca234,_0x2bee1d,_0x469bf9){if(_0x469bf9){var _0x530302=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x530302[_0x63d7('0x1c')](_0x2bee1d)){return _0x5ca234;}else{throw new db[(_0x63d7('0x1d'))]['ValidationError'](_0x63d7('0x1e'));}}else{return _0x5ca234;}}function respondWithRpcPromise(_0x4ea4f2,_0x2c7ecd,_0xf700e5,_0x1c752f){return new BPromise(function(_0x5fc791,_0x40f322){var _0x33d93f=_0x1c752f||client;return _0x33d93f['request'](_0x4ea4f2,_0xf700e5)[_0x63d7('0x1f')](function(_0xef2952){logger[_0x63d7('0x20')](_0x63d7('0x21'),_0x2c7ecd,_0x63d7('0x22'));logger[_0x63d7('0x23')](_0x63d7('0x24'),_0x2c7ecd,'request\x20sent',JSON[_0x63d7('0x25')](_0xef2952));if(_0xef2952[_0x63d7('0x26')]){if(_0xef2952['error'][_0x63d7('0x27')]===0x1f4){logger[_0x63d7('0x26')](_0x63d7('0x21'),_0x2c7ecd,_0xef2952[_0x63d7('0x26')][_0x63d7('0x28')]);return _0x40f322(_0xef2952[_0x63d7('0x26')][_0x63d7('0x28')]);}logger[_0x63d7('0x26')](_0x63d7('0x21'),_0x2c7ecd,_0xef2952[_0x63d7('0x26')][_0x63d7('0x28')]);return _0x5fc791(_0xef2952[_0x63d7('0x26')][_0x63d7('0x28')]);}else{logger[_0x63d7('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x2c7ecd,_0x63d7('0x22'));_0x5fc791(_0xef2952[_0x63d7('0x29')][_0x63d7('0x28')]);}})[_0x63d7('0x2a')](function(_0x37a3f1){logger['error'](_0x63d7('0x21'),_0x2c7ecd,_0x37a3f1);_0x40f322(_0x37a3f1);});});}function respondWithStatusCode(_0x1bf75c,_0x1f46cd){_0x1f46cd=_0x1f46cd||0xcc;return function(_0x457f2f){if(_0x457f2f){return _0x1bf75c[_0x63d7('0x2b')](_0x1f46cd);}return _0x1bf75c[_0x63d7('0x2c')](_0x1f46cd)[_0x63d7('0x2d')]();};}function respondWithResult(_0x4ed6c4,_0x56e9c5){_0x56e9c5=_0x56e9c5||0xc8;return function(_0x2f2f60){if(_0x2f2f60){return _0x4ed6c4[_0x63d7('0x2c')](_0x56e9c5)[_0x63d7('0x2e')](_0x2f2f60);}};}function respondWithFilteredResult(_0x31d76c,_0x44851d){return function(_0x4acdac){if(_0x4acdac){var _0x3391c5=_0x4acdac['count'],_0x2bce07=_0x44851d[_0x63d7('0x2f')],_0x42dd5f=_0x44851d[_0x63d7('0x2f')]+_0x44851d['limit'],_0x5a9a2a;if(_0x42dd5f>=_0x3391c5){_0x42dd5f=_0x3391c5;_0x5a9a2a=0xc8;}else{_0x5a9a2a=0xce;}_0x31d76c[_0x63d7('0x2c')](_0x5a9a2a);return _0x31d76c[_0x63d7('0x30')]('Content-Range',_0x2bce07+'-'+_0x42dd5f+'/'+_0x3391c5)[_0x63d7('0x2e')](_0x4acdac);}return null;};}function patchUpdates(_0x22ada0){return function(_0x835200){try{jsonpatch[_0x63d7('0x31')](_0x835200,_0x22ada0,!![]);}catch(_0x38ffaf){return BPromise[_0x63d7('0x32')](_0x38ffaf);}return _0x835200[_0x63d7('0x33')]();};}function saveUpdates(_0x403104,_0x5d26f3){return function(_0x45a247){if(_0x45a247){return _0x45a247[_0x63d7('0x34')](_0x403104)[_0x63d7('0x1f')](function(_0x26c18c){return _0x26c18c;});}return null;};}function removeEntity(_0x33d6cf,_0x4af9d9){return function(_0x4492fa){if(_0x4492fa){return _0x4492fa['destroy']()[_0x63d7('0x1f')](function(){var _0x1485b3=_0x4492fa['get']({'plain':!![]});var _0x4842bb=_0x63d7('0x35');return db['UserProfileResource'][_0x63d7('0x36')]({'where':{'type':_0x4842bb,'resourceId':_0x1485b3['id']}})[_0x63d7('0x1f')](function(){return _0x4492fa;});})[_0x63d7('0x1f')](function(){_0x33d6cf['status'](0xcc)[_0x63d7('0x2d')]();});}};}function handleEntityNotFound(_0x1defde,_0x3c6e88){return function(_0x1761d9){if(!_0x1761d9){_0x1defde['sendStatus'](0x194);}return _0x1761d9;};}function handleError(_0x839325,_0x40f0fa){_0x40f0fa=_0x40f0fa||0x1f4;return function(_0x5bbee0){logger[_0x63d7('0x26')](_0x5bbee0[_0x63d7('0x37')]);if(_0x5bbee0[_0x63d7('0x38')]){delete _0x5bbee0[_0x63d7('0x38')];}_0x839325[_0x63d7('0x2c')](_0x40f0fa)[_0x63d7('0x39')](_0x5bbee0);};}exports['index']=function(_0x2bbca4,_0x414229){var _0x37fd6d={'include':[{'model':db[_0x63d7('0x3a')],'as':_0x63d7('0x3b')}]},_0x3926ed={},_0x23553e={'count':0x0,'rows':[]};var _0x3e909f=_[_0x63d7('0x3c')](db[_0x63d7('0x3d')][_0x63d7('0x3e')],function(_0x12e175){return{'name':_0x12e175[_0x63d7('0x3f')],'type':_0x12e175[_0x63d7('0x40')]['key']};});_0x3926ed[_0x63d7('0x41')]=_[_0x63d7('0x3c')](_0x3e909f,_0x63d7('0x38'));_0x3926ed[_0x63d7('0x42')]=_[_0x63d7('0x43')](_0x2bbca4[_0x63d7('0x42')]);_0x3926ed['filters']=_['intersection'](_0x3926ed[_0x63d7('0x41')],_0x3926ed['query']);_0x37fd6d[_0x63d7('0x44')]=_[_0x63d7('0x45')](_0x3926ed[_0x63d7('0x41')],qs[_0x63d7('0x46')](_0x2bbca4['query'][_0x63d7('0x46')]));_0x37fd6d[_0x63d7('0x44')]=_0x37fd6d[_0x63d7('0x44')][_0x63d7('0x47')]?_0x37fd6d[_0x63d7('0x44')]:_0x3926ed[_0x63d7('0x41')];if(!_0x2bbca4[_0x63d7('0x42')][_0x63d7('0x48')](_0x63d7('0x49'))){_0x37fd6d[_0x63d7('0x4a')]=qs[_0x63d7('0x4a')](_0x2bbca4[_0x63d7('0x42')][_0x63d7('0x4a')]);_0x37fd6d[_0x63d7('0x2f')]=qs['offset'](_0x2bbca4['query'][_0x63d7('0x2f')]);}_0x37fd6d[_0x63d7('0x4b')]=qs[_0x63d7('0x4c')](_0x2bbca4[_0x63d7('0x42')][_0x63d7('0x4c')]);_0x37fd6d[_0x63d7('0x4d')]=qs[_0x63d7('0x4e')](_[_0x63d7('0x4f')](_0x2bbca4[_0x63d7('0x42')],_0x3926ed['filters']));if(_0x2bbca4[_0x63d7('0x42')]['filter']){_0x37fd6d[_0x63d7('0x4d')]=_[_0x63d7('0x50')](_0x37fd6d[_0x63d7('0x4d')],{'$or':_[_0x63d7('0x3c')](_0x3e909f,function(_0x220955){if(_0x220955[_0x63d7('0x40')]!=='VIRTUAL'){var _0x5afa2c={};_0x5afa2c[_0x220955[_0x63d7('0x38')]]={'$like':'%'+_0x2bbca4[_0x63d7('0x42')][_0x63d7('0x51')]+'%'};return _0x5afa2c;}})});}_0x37fd6d=_[_0x63d7('0x50')]({},_0x37fd6d,_0x2bbca4['options']);var _0x3acf7f={'where':_0x37fd6d[_0x63d7('0x4d')]};return db[_0x63d7('0x3d')][_0x63d7('0x52')](_0x3acf7f)[_0x63d7('0x1f')](function(_0x356794){_0x23553e[_0x63d7('0x52')]=_0x356794;if(_0x2bbca4[_0x63d7('0x42')][_0x63d7('0x53')]){_0x37fd6d[_0x63d7('0x54')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x63d7('0x55')](_0x37fd6d);})[_0x63d7('0x1f')](function(_0x42b1cc){_0x23553e[_0x63d7('0x56')]=_0x42b1cc;return _0x23553e;})[_0x63d7('0x1f')](respondWithFilteredResult(_0x414229,_0x37fd6d))[_0x63d7('0x2a')](handleError(_0x414229,null));};exports[_0x63d7('0x57')]=function(_0x23e5a3,_0x34533b){var _0x41c93d={'raw':![],'where':{'id':_0x23e5a3[_0x63d7('0x58')]['id']},'include':[{'model':db[_0x63d7('0x3a')],'as':_0x63d7('0x3b')}]},_0x3e6cf2={};_0x3e6cf2[_0x63d7('0x41')]=_['keys'](db['OpenchannelAccount']['rawAttributes']);_0x3e6cf2[_0x63d7('0x42')]=_['keys'](_0x23e5a3['query']);_0x3e6cf2[_0x63d7('0x4e')]=_['intersection'](_0x3e6cf2['model'],_0x3e6cf2['query']);_0x41c93d[_0x63d7('0x44')]=_[_0x63d7('0x45')](_0x3e6cf2[_0x63d7('0x41')],qs[_0x63d7('0x46')](_0x23e5a3['query'][_0x63d7('0x46')]));_0x41c93d[_0x63d7('0x44')]=_0x41c93d[_0x63d7('0x44')][_0x63d7('0x47')]?_0x41c93d['attributes']:_0x3e6cf2[_0x63d7('0x41')];if(_0x23e5a3[_0x63d7('0x42')][_0x63d7('0x53')]){_0x41c93d[_0x63d7('0x54')]=[{'all':!![]}];}_0x41c93d=_[_0x63d7('0x50')]({},_0x41c93d,_0x23e5a3[_0x63d7('0x59')]);return db[_0x63d7('0x3d')]['find'](_0x41c93d)['then'](handleEntityNotFound(_0x34533b,null))['then'](respondWithResult(_0x34533b,null))[_0x63d7('0x2a')](handleError(_0x34533b,null));};exports[_0x63d7('0x5a')]=function(_0x572979,_0x5dfa89){return db[_0x63d7('0x3d')][_0x63d7('0x5a')](_0x572979['body'],{})[_0x63d7('0x1f')](function(_0x49d9da){var _0x1ac764=_0x572979[_0x63d7('0x5b')][_0x63d7('0x5c')]({'plain':!![]});if(!_0x1ac764)throw new Error(_0x63d7('0x5d'));if(_0x1ac764['role']===_0x63d7('0x5b')){var _0x4dae68=_0x49d9da[_0x63d7('0x5c')]({'plain':!![]});var _0x32bb3c=_0x63d7('0x35');return db[_0x63d7('0x5e')][_0x63d7('0x5f')]({'where':{'name':_0x32bb3c,'userProfileId':_0x1ac764[_0x63d7('0x60')]},'raw':!![]})[_0x63d7('0x1f')](function(_0x3224e7){if(_0x3224e7&&_0x3224e7[_0x63d7('0x61')]===0x0){return db[_0x63d7('0x62')][_0x63d7('0x5a')]({'name':_0x4dae68[_0x63d7('0x38')],'resourceId':_0x4dae68['id'],'type':_0x3224e7[_0x63d7('0x38')],'sectionId':_0x3224e7['id']},{})['then'](function(){return _0x49d9da;});}else{return _0x49d9da;}})[_0x63d7('0x2a')](function(_0x3d0453){logger['error'](_0x63d7('0x63'),_0x3d0453);throw _0x3d0453;});}return _0x49d9da;})[_0x63d7('0x1f')](respondWithResult(_0x5dfa89,0xc9))[_0x63d7('0x2a')](handleError(_0x5dfa89,null));};exports[_0x63d7('0x34')]=function(_0x3ec4a1,_0x4ff136){if(_0x3ec4a1[_0x63d7('0x64')]['id']){delete _0x3ec4a1['body']['id'];}return db[_0x63d7('0x3d')][_0x63d7('0x5f')]({'where':{'id':_0x3ec4a1[_0x63d7('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x63d7('0x1f')](handleEntityNotFound(_0x4ff136,null))[_0x63d7('0x1f')](saveUpdates(_0x3ec4a1[_0x63d7('0x64')],null))[_0x63d7('0x1f')](respondWithResult(_0x4ff136,null))[_0x63d7('0x2a')](handleError(_0x4ff136,null));};exports[_0x63d7('0x36')]=function(_0x59481a,_0xc2fe0f){return db[_0x63d7('0x3d')][_0x63d7('0x5f')]({'where':{'id':_0x59481a[_0x63d7('0x58')]['id']}})[_0x63d7('0x1f')](handleEntityNotFound(_0xc2fe0f,null))[_0x63d7('0x1f')](removeEntity(_0xc2fe0f,null))[_0x63d7('0x2a')](handleError(_0xc2fe0f,null));};exports[_0x63d7('0x65')]=function(_0x5863f9,_0x26fa6c){return db[_0x63d7('0x3d')][_0x63d7('0x65')]()[_0x63d7('0x1f')](respondWithResult(_0x26fa6c,null))[_0x63d7('0x2a')](handleError(_0x26fa6c,null));};exports[_0x63d7('0x66')]=function(_0x2b0efc,_0x7f5ac,_0x3cdef5){if(_0x2b0efc[_0x63d7('0x64')]['id']){delete _0x2b0efc[_0x63d7('0x64')]['id'];}return db[_0x63d7('0x3d')][_0x63d7('0x5f')]({'where':{'id':_0x2b0efc[_0x63d7('0x58')]['id']}})[_0x63d7('0x1f')](handleEntityNotFound(_0x7f5ac,null))[_0x63d7('0x1f')](function(_0x2b1732){if(_0x2b1732){_0x2b0efc[_0x63d7('0x64')]['OpnechannelAccountId']=_0x2b1732['id'];return db[_0x63d7('0x67')][_0x63d7('0x5a')](_0x2b0efc[_0x63d7('0x64')]);}})[_0x63d7('0x1f')](respondWithResult(_0x7f5ac,null))[_0x63d7('0x2a')](handleError(_0x7f5ac,null));};exports[_0x63d7('0x68')]=function(_0xe7cdde,_0x4d5e08,_0x39833b){var _0x57781c={'raw':![],'where':{}};var _0x1051a3={};var _0x109fbe={'count':0x0,'rows':[]};return db[_0x63d7('0x3d')][_0x63d7('0x69')]({'where':{'id':_0xe7cdde['params']['id']}})['then'](handleEntityNotFound(_0x4d5e08,null))[_0x63d7('0x1f')](function(_0x2c1e76){if(_0x2c1e76){_0x1051a3['model']=_[_0x63d7('0x43')](db[_0x63d7('0x67')]['rawAttributes']);_0x1051a3[_0x63d7('0x42')]=_[_0x63d7('0x43')](_0xe7cdde[_0x63d7('0x42')]);_0x1051a3[_0x63d7('0x4e')]=_['intersection'](_0x1051a3['model'],_0x1051a3[_0x63d7('0x42')]);_0x57781c[_0x63d7('0x44')]=_[_0x63d7('0x45')](_0x1051a3['model'],qs[_0x63d7('0x46')](_0xe7cdde[_0x63d7('0x42')]['fields']));_0x57781c['attributes']=_0x57781c[_0x63d7('0x44')][_0x63d7('0x47')]?_0x57781c['attributes']:_0x1051a3[_0x63d7('0x41')];if(!_0xe7cdde[_0x63d7('0x42')][_0x63d7('0x48')]('nolimit')){_0x57781c[_0x63d7('0x4a')]=qs[_0x63d7('0x4a')](_0xe7cdde[_0x63d7('0x42')][_0x63d7('0x4a')]);_0x57781c['offset']=qs[_0x63d7('0x2f')](_0xe7cdde[_0x63d7('0x42')][_0x63d7('0x2f')]);}_0x57781c[_0x63d7('0x4b')]=qs[_0x63d7('0x4c')](_0xe7cdde[_0x63d7('0x42')][_0x63d7('0x4c')]);_0x57781c[_0x63d7('0x4d')]=qs['filters'](_[_0x63d7('0x4f')](_0xe7cdde[_0x63d7('0x42')],_0x1051a3[_0x63d7('0x4e')]));_0x57781c[_0x63d7('0x4d')]['OpenchannelAccountId']=_0x2c1e76['id'];if(_0xe7cdde[_0x63d7('0x42')][_0x63d7('0x51')]){_0x57781c['where']=_[_0x63d7('0x50')](_0x57781c[_0x63d7('0x4d')],{'$or':_[_0x63d7('0x3c')](_0x57781c['attributes'],function(_0x302d04){var _0x1745ca={};_0x1745ca[_0x302d04]={'$like':'%'+_0xe7cdde['query'][_0x63d7('0x51')]+'%'};return _0x1745ca;})});}_0x57781c=_[_0x63d7('0x50')]({},_0x57781c,_0xe7cdde[_0x63d7('0x59')]);return db[_0x63d7('0x67')][_0x63d7('0x52')]({'where':_0x57781c['where']})[_0x63d7('0x1f')](function(_0x2e42ff){_0x109fbe[_0x63d7('0x52')]=_0x2e42ff;if(_0xe7cdde['query'][_0x63d7('0x53')]){_0x57781c[_0x63d7('0x54')]=[{'all':!![]}];}return db[_0x63d7('0x67')][_0x63d7('0x55')](_0x57781c);})['then'](function(_0xad8b18){_0x109fbe['rows']=_0xad8b18;return _0x109fbe;});}})[_0x63d7('0x1f')](respondWithFilteredResult(_0x4d5e08,_0x57781c))[_0x63d7('0x2a')](handleError(_0x4d5e08,null));};exports['removeDispositions']=function(_0x2a28e7,_0xc764c0,_0x3ae31a){return db[_0x63d7('0x3d')]['find']({'where':{'id':_0x2a28e7['params']['id']}})[_0x63d7('0x1f')](handleEntityNotFound(_0xc764c0,null))[_0x63d7('0x1f')](function(_0x5956c6){if(_0x5956c6){return _0x5956c6[_0x63d7('0x6a')](_0x2a28e7[_0x63d7('0x42')]['ids']);}})[_0x63d7('0x1f')](respondWithStatusCode(_0xc764c0,null))['catch'](handleError(_0xc764c0,null));};exports['addAnswer']=function(_0x4dface,_0x707f08,_0x5e1a13){if(_0x4dface[_0x63d7('0x64')]['id']){delete _0x4dface[_0x63d7('0x64')]['id'];}return db[_0x63d7('0x3d')][_0x63d7('0x5f')]({'where':{'id':_0x4dface[_0x63d7('0x58')]['id']}})[_0x63d7('0x1f')](handleEntityNotFound(_0x707f08,null))[_0x63d7('0x1f')](function(_0x885b46){if(_0x885b46){_0x4dface[_0x63d7('0x64')]['OpenchannelAccountId']=_0x885b46['id'];return db[_0x63d7('0x6b')][_0x63d7('0x5a')](_0x4dface[_0x63d7('0x64')]);}})['then'](respondWithResult(_0x707f08,null))['catch'](handleError(_0x707f08,null));};exports[_0x63d7('0x6c')]=function(_0x4dbd1a,_0x7bce0c,_0x440941){var _0xa01b43={'raw':![],'where':{}};var _0x4fadca={};var _0x379d46={'count':0x0,'rows':[]};return db[_0x63d7('0x3d')][_0x63d7('0x69')]({'where':{'id':_0x4dbd1a[_0x63d7('0x58')]['id']}})['then'](handleEntityNotFound(_0x7bce0c,null))[_0x63d7('0x1f')](function(_0xfc02a){if(_0xfc02a){_0x4fadca[_0x63d7('0x41')]=_[_0x63d7('0x43')](db[_0x63d7('0x6b')]['rawAttributes']);_0x4fadca['query']=_[_0x63d7('0x43')](_0x4dbd1a[_0x63d7('0x42')]);_0x4fadca[_0x63d7('0x4e')]=_[_0x63d7('0x45')](_0x4fadca['model'],_0x4fadca[_0x63d7('0x42')]);_0xa01b43[_0x63d7('0x44')]=_['intersection'](_0x4fadca[_0x63d7('0x41')],qs[_0x63d7('0x46')](_0x4dbd1a[_0x63d7('0x42')][_0x63d7('0x46')]));_0xa01b43[_0x63d7('0x44')]=_0xa01b43[_0x63d7('0x44')][_0x63d7('0x47')]?_0xa01b43[_0x63d7('0x44')]:_0x4fadca[_0x63d7('0x41')];if(!_0x4dbd1a[_0x63d7('0x42')][_0x63d7('0x48')](_0x63d7('0x49'))){_0xa01b43[_0x63d7('0x4a')]=qs[_0x63d7('0x4a')](_0x4dbd1a['query'][_0x63d7('0x4a')]);_0xa01b43[_0x63d7('0x2f')]=qs[_0x63d7('0x2f')](_0x4dbd1a['query'][_0x63d7('0x2f')]);}_0xa01b43[_0x63d7('0x4b')]=qs[_0x63d7('0x4c')](_0x4dbd1a[_0x63d7('0x42')][_0x63d7('0x4c')]);_0xa01b43[_0x63d7('0x4d')]=qs[_0x63d7('0x4e')](_[_0x63d7('0x4f')](_0x4dbd1a['query'],_0x4fadca['filters']));_0xa01b43['where']['OpenchannelAccountId']=_0xfc02a['id'];if(_0x4dbd1a[_0x63d7('0x42')][_0x63d7('0x51')]){_0xa01b43[_0x63d7('0x4d')]=_[_0x63d7('0x50')](_0xa01b43[_0x63d7('0x4d')],{'$or':_[_0x63d7('0x3c')](_0xa01b43[_0x63d7('0x44')],function(_0x12ac26){var _0x1a778f={};_0x1a778f[_0x12ac26]={'$like':'%'+_0x4dbd1a[_0x63d7('0x42')][_0x63d7('0x51')]+'%'};return _0x1a778f;})});}_0xa01b43=_['merge']({},_0xa01b43,_0x4dbd1a[_0x63d7('0x59')]);return db[_0x63d7('0x6b')][_0x63d7('0x52')]({'where':_0xa01b43['where']})[_0x63d7('0x1f')](function(_0x33969a){_0x379d46[_0x63d7('0x52')]=_0x33969a;if(_0x4dbd1a[_0x63d7('0x42')][_0x63d7('0x53')]){_0xa01b43[_0x63d7('0x54')]=[{'all':!![]}];}return db[_0x63d7('0x6b')]['findAll'](_0xa01b43);})[_0x63d7('0x1f')](function(_0xfefdf3){_0x379d46[_0x63d7('0x56')]=_0xfefdf3;return _0x379d46;});}})[_0x63d7('0x1f')](respondWithFilteredResult(_0x7bce0c,_0xa01b43))['catch'](handleError(_0x7bce0c,null));};exports[_0x63d7('0x6d')]=function(_0x19146c,_0x5c3174,_0x4f4b87){return db[_0x63d7('0x3d')][_0x63d7('0x5f')]({'where':{'id':_0x19146c[_0x63d7('0x58')]['id']}})['then'](handleEntityNotFound(_0x5c3174,null))['then'](function(_0x2dfdfb){if(_0x2dfdfb){return _0x2dfdfb[_0x63d7('0x6d')](_0x19146c['query'][_0x63d7('0x6e')]);}})['then'](respondWithStatusCode(_0x5c3174,null))['catch'](handleError(_0x5c3174,null));};exports[_0x63d7('0x6f')]=function(_0x3d161b,_0x38cd91,_0x4a045e){var _0x72be6c={'body':_0x3d161b[_0x63d7('0x64')],'channel':'openchannel'};var _0x3d4259=[];var _0x1a3472=[];var _0x47eb62={};var _0x305a1e=![];return db['CmContact'][_0x63d7('0x65')]()[_0x63d7('0x1f')](function(_0x450c65){if(!_0x450c65){throw new db[(_0x63d7('0x1d'))]['ValidationError'](_0x63d7('0x70'));}_0x3d4259=_[_0x63d7('0x71')](_[_0x63d7('0x43')](_0x450c65),[_0x63d7('0x72'),'updatedAt']);_0x1a3472=_[_0x63d7('0x71')](_['keys'](_0x450c65),[_0x63d7('0x72'),'updatedAt',_0x63d7('0x73'),'ListId']);if(_0x3d161b[_0x63d7('0x64')]['id']){delete _0x3d161b[_0x63d7('0x64')]['id'];}if(_[_0x63d7('0x74')](_0x3d161b[_0x63d7('0x64')][_0x63d7('0x75')])){throw new db[(_0x63d7('0x1d'))][(_0x63d7('0x76'))](_0x63d7('0x77'));}if(_['isNil'](_0x3d161b[_0x63d7('0x64')][_0x63d7('0x64')])||_0x3d161b[_0x63d7('0x64')][_0x63d7('0x64')]===''){throw new db[(_0x63d7('0x1d'))][(_0x63d7('0x76'))](_0x63d7('0x78'));}if(_[_0x63d7('0x74')](_0x3d161b[_0x63d7('0x64')][_0x63d7('0x79')])){throw new db['Sequelize'][(_0x63d7('0x76'))](_0x63d7('0x7a')+_0x1a3472);}if(!_[_0x63d7('0x7b')](_0x1a3472,_0x3d161b[_0x63d7('0x64')]['mapKey'])){throw new db[(_0x63d7('0x1d'))][(_0x63d7('0x76'))](_0x63d7('0x7c')+_0x1a3472);}_0x47eb62[_0x3d161b[_0x63d7('0x64')][_0x63d7('0x79')]]=_0x3d161b['body'][_0x63d7('0x75')];})[_0x63d7('0x1f')](function(){return db[_0x63d7('0x3d')][_0x63d7('0x5f')]({'where':{'id':_0x3d161b[_0x63d7('0x58')]['id']},'include':[{'model':db[_0x63d7('0x7d')],'as':_0x63d7('0x7e'),'include':[{'model':db['CmContact'],'as':_0x63d7('0x7f'),'where':_0x47eb62,'limit':0x1,'order':[[_0x63d7('0x80'),_0x63d7('0x81')]]}]},{'model':db[_0x63d7('0x82')],'as':_0x63d7('0x83')}]});})['then'](handleEntityNotFound(_0x38cd91,null))[_0x63d7('0x1f')](function(_0x40d133){if(_0x40d133&&_0x40d133[_0x63d7('0x7e')]){_0x72be6c['account']=_0x40d133;_0x72be6c[_0x63d7('0x84')]=_0x40d133['Applications'];_0x72be6c[_0x63d7('0x85')]=_0x40d133[_0x63d7('0x7e')];_0x72be6c[_0x63d7('0x84')]=_[_0x63d7('0x86')](_0x72be6c[_0x63d7('0x84')],['priority'],[_0x63d7('0x87')]);if(_0x72be6c['account'][_0x63d7('0x83')]){delete _0x72be6c[_0x63d7('0x88')][_0x63d7('0x83')];}if(_0x72be6c[_0x63d7('0x88')][_0x63d7('0x7e')]&&_0x72be6c['account'][_0x63d7('0x7e')][_0x63d7('0x7f')][_0x63d7('0x47')]){return _0x72be6c[_0x63d7('0x88')][_0x63d7('0x7e')]['Contacts'][0x0];}var _0x1caa22=_[_0x63d7('0x16')](_0x3d161b[_0x63d7('0x64')],{'firstName':_0x3d161b[_0x63d7('0x64')][_0x63d7('0x75')],'ListId':_0x40d133[_0x63d7('0x89')]});_0x1caa22[_0x3d161b[_0x63d7('0x64')]['mapKey']]=_0x3d161b[_0x63d7('0x64')][_0x63d7('0x75')];return db[_0x63d7('0x8a')][_0x63d7('0x5a')](_0x1caa22,{'fields':_0x3d4259,'raw':!![]});}})['then'](handleEntityNotFound(_0x38cd91,null))[_0x63d7('0x1f')](function(_0x175691){_0x72be6c['contact']=_0x175691;if(_0x175691){var _0x144760={'ContactId':_0x175691['id'],'OpenchannelAccountId':_0x3d161b['params']['id'],'from':(_0x175691[_0x63d7('0x8b')]||'')+'\x20'+(_0x175691['lastName']||'')};var _0x316ce8={'OpenchannelAccountId':_0x3d161b['params']['id'],'closed':![]};if(_0x3d161b[_0x63d7('0x64')][_0x63d7('0x8c')]){_0x316ce8[_0x63d7('0x8c')]=_0x3d161b[_0x63d7('0x64')][_0x63d7('0x8c')];return db['OpenchannelInteraction']['find']({'where':_0x316ce8})[_0x63d7('0x1f')](function(_0x31ee3f){if(_0x31ee3f){return[_0x31ee3f,![]];}_0x144760['threadId']=_0x3d161b[_0x63d7('0x64')][_0x63d7('0x8c')];_0x144760[_0x63d7('0x8d')]=_0x3d161b[_0x63d7('0x64')][_0x63d7('0x8d')];return db[_0x63d7('0x8e')][_0x63d7('0x5a')](_0x144760)[_0x63d7('0x1f')](function(_0x4e6acc){return[_0x4e6acc,!![]];});});}else{_0x316ce8[_0x63d7('0x8c')]=null;}_0x316ce8[_0x63d7('0x8f')]=_0x175691['id'];return db[_0x63d7('0x8e')][_0x63d7('0x5f')]({'where':_0x316ce8})[_0x63d7('0x1f')](function(_0x1a67c4){if(_0x1a67c4){return[_0x1a67c4,![]];}return db[_0x63d7('0x8e')][_0x63d7('0x5a')](_0x144760)[_0x63d7('0x1f')](function(_0x4ee337){return[_0x4ee337,!![]];});});}})[_0x63d7('0x90')](function(_0x7238f,_0x3bcf10){if(_0x7238f){_0x305a1e=_0x3bcf10;if(!_0x3bcf10){var _0x58fb68={'from':(_0x72be6c[_0x63d7('0x91')]['firstName']||'')+'\x20'+(_0x72be6c[_0x63d7('0x91')][_0x63d7('0x92')]||'')};if(_0x3d161b[_0x63d7('0x64')]['threadId']&&_0x3d161b[_0x63d7('0x64')][_0x63d7('0x93')]&&_0x3d161b['body'][_0x63d7('0x8c')]!=_0x3d161b[_0x63d7('0x64')][_0x63d7('0x93')]){_0x58fb68['threadId']=_0x3d161b['body'][_0x63d7('0x93')];}return _0x7238f[_0x63d7('0x34')](_0x58fb68);}else{return _0x7238f;}}})[_0x63d7('0x1f')](function(_0x627d21){_0x72be6c[_0x63d7('0x94')]=_0x627d21['get']({'plain':!![]});_0x72be6c[_0x63d7('0x94')][_0x63d7('0x95')]=_0x305a1e;if(_0x72be6c[_0x63d7('0x94')][_0x63d7('0x95')]){if(_0x72be6c[_0x63d7('0x88')]['autoclose']){_0x72be6c[_0x63d7('0x84')][_0x63d7('0x96')]({'id':0x0,'priority':_0x72be6c[_0x63d7('0x84')][_0x63d7('0x47')]+0x1,'app':'close','appdata':_0x63d7('0x97'),'interval':'*,*,*,*'});}}return db[_0x63d7('0x98')][_0x63d7('0x5a')]({'body':_0x3d161b[_0x63d7('0x64')]['body'],'OpenchannelAccountId':_0x3d161b[_0x63d7('0x58')]['id'],'OpenchannelInteractionId':_0x627d21['id'],'direction':'in','ContactId':_0x72be6c[_0x63d7('0x91')]['id'],'AttachmentId':_0x3d161b[_0x63d7('0x64')][_0x63d7('0x99')]});})[_0x63d7('0x1f')](function(_0x3eec2a){_0x72be6c[_0x63d7('0x28')]=_0x3eec2a;if(_0x72be6c[_0x63d7('0x94')][_0x63d7('0x9a')]){return db['User'][_0x63d7('0x5f')]({'attributes':['id',_0x63d7('0x38')],'where':{'id':_0x72be6c[_0x63d7('0x94')][_0x63d7('0x9a')]}})['then'](function(_0x3fdec8){if(_0x3fdec8){_0x72be6c[_0x63d7('0x84')][_0x63d7('0x9b')]({'id':0x0,'priority':0x0,'app':_0x63d7('0x9c'),'appdata':_0x3fdec8[_0x63d7('0x38')]+','+(_0x72be6c[_0x63d7('0x88')][_0x63d7('0x9d')]||0xa),'interval':_0x63d7('0x9e')});_0x72be6c[_0x63d7('0x9f')]=![];}return respondWithRpcPromise('Start',_0x63d7('0xa0'),_0x72be6c);});}return respondWithRpcPromise(_0x63d7('0xa1'),_0x63d7('0xa0'),_0x72be6c);})[_0x63d7('0x1f')](function(_0x48d284){respondWithRpcPromise('EventManager',_0x63d7('0xa2'),{'event':_0x63d7('0x6f'),'message':_0x48d284},client9002);return _0x48d284;})[_0x63d7('0x1f')](respondWithResult(_0x38cd91,null))[_0x63d7('0x2a')](handleError(_0x38cd91,null));};exports['addApplications']=function(_0x3c888e,_0xa66d90,_0x3dd676){return db[_0x63d7('0x3d')][_0x63d7('0x69')]({'where':{'id':_0x3c888e['params']['id']}})[_0x63d7('0x1f')](handleEntityNotFound(_0xa66d90,null))['then'](function(_0x376711){if(_0x376711){return db[_0x63d7('0xa3')]['transaction'](function(_0x51c328){return db[_0x63d7('0x82')]['destroy']({'where':{'OpenchannelAccountId':_0x3c888e[_0x63d7('0x58')]['id']},'transaction':_0x51c328})[_0x63d7('0x1f')](function(_0x1efe89){var _0x52f53c=_[_0x63d7('0x3c')](_0x3c888e[_0x63d7('0x64')],function(_0x5ce0b8){_0x5ce0b8[_0x63d7('0xa4')]=_0x3c888e[_0x63d7('0x58')]['id'];return _0x5ce0b8;});return db[_0x63d7('0x82')][_0x63d7('0xa5')](_0x52f53c,{'transaction':_0x51c328});});})[_0x63d7('0x1f')](function(){return db[_0x63d7('0x82')][_0x63d7('0xa6')]({'where':{'OpenchannelAccountId':_0x3c888e['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0xa66d90,null))[_0x63d7('0x2a')](handleError(_0xa66d90,null));};exports[_0x63d7('0xa7')]=function(_0x1acc6e,_0x5c623c,_0x597d70){var _0x5bd991={};var _0x226733={};var _0xe1fc8c;var _0x4d4191;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x1acc6e[_0x63d7('0x58')]['id']}})['then'](handleEntityNotFound(_0x5c623c,null))['then'](function(_0x26148f){if(_0x26148f){_0xe1fc8c=_0x26148f;_0x226733['model']=_[_0x63d7('0x43')](db[_0x63d7('0x82')][_0x63d7('0x3e')]);_0x226733['query']=_[_0x63d7('0x43')](_0x1acc6e[_0x63d7('0x42')]);_0x226733[_0x63d7('0x4e')]=_['intersection'](_0x226733['model'],_0x226733[_0x63d7('0x42')]);_0x5bd991[_0x63d7('0x44')]=_['intersection'](_0x226733[_0x63d7('0x41')],qs[_0x63d7('0x46')](_0x1acc6e[_0x63d7('0x42')][_0x63d7('0x46')]));_0x5bd991[_0x63d7('0x44')]=_0x5bd991['attributes'][_0x63d7('0x47')]?_0x5bd991[_0x63d7('0x44')]:_0x226733[_0x63d7('0x41')];_0x5bd991[_0x63d7('0x4b')]=qs[_0x63d7('0x4c')](_0x1acc6e['query'][_0x63d7('0x4c')]);_0x5bd991['where']=qs[_0x63d7('0x4e')](_[_0x63d7('0x4f')](_0x1acc6e[_0x63d7('0x42')],_0x226733['filters']));if(_0x1acc6e[_0x63d7('0x42')][_0x63d7('0x51')]){_0x5bd991[_0x63d7('0x4d')]=_[_0x63d7('0x50')](_0x5bd991['where'],{'$or':_['map'](_0x5bd991[_0x63d7('0x44')],function(_0x292a29){var _0x3d98b8={};_0x3d98b8[_0x292a29]={'$like':'%'+_0x1acc6e['query'][_0x63d7('0x51')]+'%'};return _0x3d98b8;})});}_0x5bd991=_['merge']({},_0x5bd991,_0x1acc6e['options']);return _0xe1fc8c['getApplications'](_0x5bd991);}})[_0x63d7('0x1f')](function(_0x2e6eb1){if(_0x2e6eb1){_0x4d4191=_0x2e6eb1[_0x63d7('0x47')];if(!_0x1acc6e[_0x63d7('0x42')][_0x63d7('0x48')](_0x63d7('0x49'))){_0x5bd991[_0x63d7('0x4a')]=qs['limit'](_0x1acc6e[_0x63d7('0x42')][_0x63d7('0x4a')]);_0x5bd991[_0x63d7('0x2f')]=qs['offset'](_0x1acc6e['query'][_0x63d7('0x2f')]);}return _0xe1fc8c[_0x63d7('0xa7')](_0x5bd991);}})[_0x63d7('0x1f')](function(_0x4f2546){if(_0x4f2546){return _0x4f2546?{'count':_0x4d4191,'rows':_0x4f2546}:null;}})[_0x63d7('0x1f')](respondWithResult(_0x5c623c,null))[_0x63d7('0x2a')](handleError(_0x5c623c,null));};exports[_0x63d7('0xa8')]=function(_0x56dfe0,_0x2caf82,_0x152cbc){var _0x34c6cd={'raw':![],'where':{}};var _0x70c143={};var _0x72a64c={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x63d7('0x69')]({'where':{'id':_0x56dfe0[_0x63d7('0x58')]['id']}})[_0x63d7('0x1f')](handleEntityNotFound(_0x2caf82,null))[_0x63d7('0x1f')](function(_0x500054){if(_0x500054){_0x70c143['model']=_[_0x63d7('0x43')](db['OpenchannelInteraction'][_0x63d7('0x3e')]);_0x70c143[_0x63d7('0x42')]=_[_0x63d7('0x43')](_0x56dfe0[_0x63d7('0x42')]);_0x70c143[_0x63d7('0x4e')]=_['intersection'](_0x70c143['model'],_0x70c143[_0x63d7('0x42')]);_0x34c6cd[_0x63d7('0x44')]=_[_0x63d7('0x45')](_0x70c143[_0x63d7('0x41')],qs[_0x63d7('0x46')](_0x56dfe0['query'][_0x63d7('0x46')]));_0x34c6cd[_0x63d7('0x44')]=_0x34c6cd[_0x63d7('0x44')][_0x63d7('0x47')]?_0x34c6cd[_0x63d7('0x44')]:_0x70c143[_0x63d7('0x41')];if(!_0x56dfe0[_0x63d7('0x42')][_0x63d7('0x48')]('nolimit')){_0x34c6cd[_0x63d7('0x4a')]=qs['limit'](_0x56dfe0[_0x63d7('0x42')][_0x63d7('0x4a')]);_0x34c6cd[_0x63d7('0x2f')]=qs[_0x63d7('0x2f')](_0x56dfe0[_0x63d7('0x42')][_0x63d7('0x2f')]);}_0x34c6cd[_0x63d7('0x4b')]=qs[_0x63d7('0x4c')](_0x56dfe0['query'][_0x63d7('0x4c')]);_0x34c6cd[_0x63d7('0x4d')]=qs[_0x63d7('0x4e')](_['pick'](_0x56dfe0['query'],_0x70c143[_0x63d7('0x4e')]));_0x34c6cd[_0x63d7('0x4d')][_0x63d7('0xa4')]=_0x500054['id'];if(_0x56dfe0[_0x63d7('0x42')]['filter']){_0x34c6cd[_0x63d7('0x4d')]=_[_0x63d7('0x50')](_0x34c6cd[_0x63d7('0x4d')],{'$or':_[_0x63d7('0x3c')](_0x34c6cd[_0x63d7('0x44')],function(_0x569700){var _0x32a38d={};_0x32a38d[_0x569700]={'$like':'%'+_0x56dfe0['query']['filter']+'%'};return _0x32a38d;})});}_0x34c6cd=_['merge']({},_0x34c6cd,_0x56dfe0['options']);return db[_0x63d7('0x8e')][_0x63d7('0x52')]({'where':_0x34c6cd[_0x63d7('0x4d')]})[_0x63d7('0x1f')](function(_0x26d088){_0x72a64c['count']=_0x26d088;if(_0x56dfe0['query'][_0x63d7('0x53')]){_0x34c6cd['include']=[{'model':db[_0x63d7('0x8a')],'as':_0x63d7('0xa9'),'required':![]},{'model':db[_0x63d7('0xaa')],'as':'Owner','attributes':['name',_0x63d7('0xab'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x63d7('0xac'),'attributes':['id','name',_0x63d7('0xad')],'where':_0x56dfe0[_0x63d7('0x42')][_0x63d7('0xae')]?{'id':_0x56dfe0[_0x63d7('0x42')][_0x63d7('0xae')]}:undefined,'required':_0x56dfe0[_0x63d7('0x42')][_0x63d7('0xae')]?!![]:![]}];}return db[_0x63d7('0x8e')][_0x63d7('0x55')](_0x34c6cd);})[_0x63d7('0x1f')](function(_0x1508ab){_0x72a64c['rows']=_0x1508ab;return _0x72a64c;});}})['then'](respondWithFilteredResult(_0x2caf82,_0x34c6cd))[_0x63d7('0x2a')](handleError(_0x2caf82,null));};exports[_0x63d7('0xaf')]=function(_0x13e0e6,_0x298366,_0xa222f1){return db[_0x63d7('0x3d')]['find']({'where':{'id':_0x13e0e6['params']['id']}})['then'](handleEntityNotFound(_0x298366,null))[_0x63d7('0x1f')](function(_0x148794){if(_0x148794){return _0x148794[_0x63d7('0xaf')](_0x13e0e6[_0x63d7('0x64')]['ids'],_['omit'](_0x13e0e6[_0x63d7('0x64')],['ids','id'])||{})['spread'](function(_0x15a3c7){for(var _0x93adb4=0x0;_0x93adb4<_0x13e0e6[_0x63d7('0x64')][_0x63d7('0x6e')]['length'];_0x93adb4+=0x1){socket[_0x63d7('0xb0')]('userOpenchannelAccount:save',{'UserId':_0x13e0e6[_0x63d7('0x64')][_0x63d7('0x6e')][_0x93adb4],'OpenchannelAccountId':_0x13e0e6[_0x63d7('0x58')]['id']});}return _0x15a3c7;});}})[_0x63d7('0x1f')](respondWithResult(_0x298366,null))[_0x63d7('0x2a')](handleError(_0x298366,null));};exports[_0x63d7('0xb1')]=function(_0x1285e8,_0x1b108c,_0x5da0cd){return db[_0x63d7('0x3d')]['find']({'where':{'id':_0x1285e8[_0x63d7('0x58')]['id']}})[_0x63d7('0x1f')](handleEntityNotFound(_0x1b108c,null))[_0x63d7('0x1f')](function(_0x522229){if(_0x522229){return _0x522229[_0x63d7('0xb1')](_0x1285e8[_0x63d7('0x42')]['ids'])[_0x63d7('0x1f')](function(){if(_[_0x63d7('0xb2')](_0x1285e8[_0x63d7('0x42')][_0x63d7('0x6e')])){for(var _0xc266bf=0x0;_0xc266bf<_0x1285e8[_0x63d7('0x42')]['ids'][_0x63d7('0x47')];_0xc266bf+=0x1){socket[_0x63d7('0xb0')](_0x63d7('0xb3'),{'UserId':Number(_0x1285e8['query']['ids'][_0xc266bf]),'OpenchannelAccountId':Number(_0x1285e8[_0x63d7('0x58')]['id'])});}}else{socket[_0x63d7('0xb0')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1285e8[_0x63d7('0x42')][_0x63d7('0x6e')]),'OpenchannelAccountId':Number(_0x1285e8['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1b108c,null))[_0x63d7('0x2a')](handleError(_0x1b108c,null));};exports[_0x63d7('0xb4')]=function(_0x7908ff,_0x5d42e0,_0x453993){var _0x3d3cd5={};var _0x43adec={};var _0x2a1ff3;var _0x3d549e;return db[_0x63d7('0x3d')][_0x63d7('0x69')]({'where':{'id':_0x7908ff[_0x63d7('0x58')]['id']}})['then'](handleEntityNotFound(_0x5d42e0,null))['then'](function(_0x338423){if(_0x338423){_0x2a1ff3=_0x338423;_0x43adec[_0x63d7('0x41')]=_[_0x63d7('0x43')](db[_0x63d7('0xaa')][_0x63d7('0x3e')]);_0x43adec['query']=_[_0x63d7('0x43')](_0x7908ff[_0x63d7('0x42')]);_0x43adec['filters']=_[_0x63d7('0x45')](_0x43adec[_0x63d7('0x41')],_0x43adec[_0x63d7('0x42')]);_0x3d3cd5[_0x63d7('0x44')]=_['intersection'](_0x43adec['model'],qs[_0x63d7('0x46')](_0x7908ff[_0x63d7('0x42')]['fields']));_0x3d3cd5[_0x63d7('0x44')]=_0x3d3cd5[_0x63d7('0x44')][_0x63d7('0x47')]?_0x3d3cd5[_0x63d7('0x44')]:_0x43adec['model'];_0x3d3cd5[_0x63d7('0x4b')]=qs[_0x63d7('0x4c')](_0x7908ff['query']['sort']);_0x3d3cd5[_0x63d7('0x4d')]=qs[_0x63d7('0x4e')](_['pick'](_0x7908ff[_0x63d7('0x42')],_0x43adec[_0x63d7('0x4e')]));if(_0x7908ff[_0x63d7('0x42')][_0x63d7('0x51')]){_0x3d3cd5[_0x63d7('0x4d')]=_[_0x63d7('0x50')](_0x3d3cd5['where'],{'$or':_[_0x63d7('0x3c')](_0x3d3cd5[_0x63d7('0x44')],function(_0x1875d0){var _0x3a2d70={};_0x3a2d70[_0x1875d0]={'$like':'%'+_0x7908ff[_0x63d7('0x42')][_0x63d7('0x51')]+'%'};return _0x3a2d70;})});}_0x3d3cd5=_[_0x63d7('0x50')]({},_0x3d3cd5,_0x7908ff[_0x63d7('0x59')]);return _0x2a1ff3[_0x63d7('0xb4')](_0x3d3cd5);}})['then'](function(_0x2c8047){if(_0x2c8047){_0x3d549e=_0x2c8047[_0x63d7('0x47')];if(!_0x7908ff[_0x63d7('0x42')][_0x63d7('0x48')](_0x63d7('0x49'))){_0x3d3cd5[_0x63d7('0x4a')]=qs[_0x63d7('0x4a')](_0x7908ff['query'][_0x63d7('0x4a')]);_0x3d3cd5[_0x63d7('0x2f')]=qs[_0x63d7('0x2f')](_0x7908ff[_0x63d7('0x42')][_0x63d7('0x2f')]);}return _0x2a1ff3['getAgents'](_0x3d3cd5);}})[_0x63d7('0x1f')](function(_0x2eacd5){if(_0x2eacd5){return _0x2eacd5?{'count':_0x3d549e,'rows':_0x2eacd5}:null;}})[_0x63d7('0x1f')](respondWithResult(_0x5d42e0,null))[_0x63d7('0x2a')](handleError(_0x5d42e0,null));};exports[_0x63d7('0x39')]=function(_0x2155e1,_0x50f944,_0x6c277a){var _0x48707b,_0x2ba960,_0x1de516;if(_[_0x63d7('0x74')](_0x2155e1[_0x63d7('0x64')]['body'])||_0x2155e1[_0x63d7('0x64')][_0x63d7('0x64')]===''){throw new db['Sequelize'][(_0x63d7('0x76'))](_0x63d7('0x78'));}if(_['isNil'](_0x2155e1[_0x63d7('0x64')]['to'])){}_0x48707b=_0x2155e1['body']['to'];return db[_0x63d7('0x3d')][_0x63d7('0x69')]({'where':{'id':_0x2155e1[_0x63d7('0x58')]['id']}})[_0x63d7('0x1f')](handleEntityNotFound(_0x50f944,null))[_0x63d7('0x1f')](function(_0x535984){if(_0x535984){return db['OpenchannelAccount']['find']({'where':{'id':_0x535984['id']},'include':[{'model':db['CmList'],'as':_0x63d7('0x7e'),'include':[{'model':db[_0x63d7('0x8a')],'as':_0x63d7('0x7f'),'where':{[_0x535984[_0x63d7('0x79')]]:_0x48707b},'limit':0x1,'order':[[_0x63d7('0x80'),_0x63d7('0x81')]]}]}]})['then'](handleEntityNotFound(_0x50f944,null))[_0x63d7('0x1f')](function(_0x3b267f){if(_0x3b267f&&_0x3b267f[_0x63d7('0x7e')]){_0x2ba960=_0x3b267f[_0x63d7('0x5c')]({'plain':!![]});if(_0x2ba960[_0x63d7('0x7e')]&&_0x2ba960[_0x63d7('0x7e')][_0x63d7('0x7f')][_0x63d7('0x47')]){return _0x2ba960['List'][_0x63d7('0x7f')][0x0];}return db['CmContact'][_0x63d7('0x5a')](_[_0x63d7('0x16')](_0x2155e1[_0x63d7('0x64')],{'firstName':_0x48707b,[_0x3b267f[_0x63d7('0x79')]]:_0x48707b,'phone':_0x48707b,'ListId':_0x2ba960[_0x63d7('0x89')]}));}})[_0x63d7('0x1f')](handleEntityNotFound(_0x50f944,null))['then'](function(_0x5b395b){if(_0x5b395b){_0x1de516=_0x5b395b;return db[_0x63d7('0x8e')][_0x63d7('0x5f')]({'where':{'ContactId':_0x1de516['id'],'closed':![],'OpenchannelAccountId':_0x2ba960['id']}})[_0x63d7('0x1f')](function(_0x5f4579){if(_0x5f4579){return[_0x5f4579,![]];}return db[_0x63d7('0x8e')][_0x63d7('0x5a')]({'UserId':_0x2155e1[_0x63d7('0x5b')]['id'],'ContactId':_0x1de516['id'],'OpenchannelAccountId':_0x2ba960['id'],'lastMsgDirection':_0x63d7('0xb5'),'Messages':[_['merge'](_0x2155e1[_0x63d7('0x64')],{'read':![],'body':_0x2155e1[_0x63d7('0x64')]['body'],'OpenchannelAccountId':_0x2ba960['id'],'UserId':_0x2155e1['user']['id'],'ContactId':_0x1de516['id']})]},{'include':[{'model':db[_0x63d7('0x98')],'as':'Messages'}]})[_0x63d7('0x1f')](function(_0x21fbb1){return[_0x21fbb1,!![]];});});}})[_0x63d7('0x90')](function(_0x15a250,_0x1dd6e1){if(_0x1dd6e1){return _0x15a250;}return db[_0x63d7('0x98')][_0x63d7('0x5a')](_['merge'](_0x2155e1[_0x63d7('0x64')],{'read':![],'body':_0x2155e1[_0x63d7('0x64')][_0x63d7('0x64')],'OpenchannelAccountId':_0x2ba960['id'],'OpenchannelInteractionId':_0x15a250['id'],'UserId':_0x2155e1[_0x63d7('0x5b')]['id'],'ContactId':_0x1de516['id']}))[_0x63d7('0x1f')](function(_0xc43278){_0x15a250[_0x63d7('0xb6')]['Messages']=[];_0x15a250[_0x63d7('0xb6')]['Messages']['push'](_0xc43278[_0x63d7('0xb6')]);return _0x15a250;});});}})[_0x63d7('0x1f')](respondWithResult(_0x50f944,null))[_0x63d7('0x2a')](handleError(_0x50f944,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 10ee253..4af23fa 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 _0x1300=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount'];(function(_0x13d09c,_0x37a2f9){var _0x4985f9=function(_0x50f4da){while(--_0x50f4da){_0x13d09c['push'](_0x13d09c['shift']());}};_0x4985f9(++_0x37a2f9);}(_0x1300,0x16e));var _0x0130=function(_0x6b350e,_0x41f42f){_0x6b350e=_0x6b350e-0x0;var _0x26c664=_0x1300[_0x6b350e];return _0x26c664;};'use strict';var EventEmitter=require(_0x0130('0x0'));var OpenchannelAccount=require(_0x0130('0x1'))['db'][_0x0130('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0130('0x3'),'afterUpdate':'update','afterDestroy':_0x0130('0x4')};function emitEvent(_0x305a93){return function(_0xf032f6,_0xf367ef,_0x2fee0c){OpenchannelAccountEvents[_0x0130('0x5')](_0x305a93+':'+_0xf032f6['id'],_0xf032f6);OpenchannelAccountEvents[_0x0130('0x5')](_0x305a93,_0xf032f6);_0x2fee0c(null);};}for(var e in events){if(events[_0x0130('0x6')](e)){var event=events[e];OpenchannelAccount[_0x0130('0x7')](e,emitEvent(event));}}module[_0x0130('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x98e7=['exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x56f14f,_0x50460f){var _0x408256=function(_0xc333bb){while(--_0xc333bb){_0x56f14f['push'](_0x56f14f['shift']());}};_0x408256(++_0x50460f);}(_0x98e7,0x14b));var _0x798e=function(_0x4ff7d1,_0x3331d1){_0x4ff7d1=_0x4ff7d1-0x0;var _0x16e063=_0x98e7[_0x4ff7d1];return _0x16e063;};'use strict';var EventEmitter=require(_0x798e('0x0'));var OpenchannelAccount=require(_0x798e('0x1'))['db'][_0x798e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x798e('0x3')](0x0);var events={'afterCreate':_0x798e('0x4'),'afterUpdate':_0x798e('0x5'),'afterDestroy':_0x798e('0x6')};function emitEvent(_0x3cfe53){return function(_0xde751c,_0x5e5965,_0x390618){OpenchannelAccountEvents[_0x798e('0x7')](_0x3cfe53+':'+_0xde751c['id'],_0xde751c);OpenchannelAccountEvents[_0x798e('0x7')](_0x3cfe53,_0xde751c);_0x390618(null);};}for(var e in events){if(events[_0x798e('0x8')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x798e('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 51a13e8..e32b989 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 _0x4b1f=['api','moment','bluebird','path','rimraf','../../config/environment','define','OpenchannelAccount','openchannel_accounts','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4b1f,0x195));var _0xf4b1=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4b1f[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf4b1('0x0'));var util=require(_0xf4b1('0x1'));var logger=require('../../config/logger')(_0xf4b1('0x2'));var moment=require(_0xf4b1('0x3'));var BPromise=require(_0xf4b1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4b1('0x5'));var rimraf=require(_0xf4b1('0x6'));var config=require(_0xf4b1('0x7'));var attributes=require('./openchannelAccount.attributes');module['exports']=function(_0x1ab96b,_0x4b676){return _0x1ab96b[_0xf4b1('0x8')](_0xf4b1('0x9'),attributes,{'tableName':_0xf4b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48d5=['request-promise','../../config/environment','./openchannelAccount.attributes','exports','define','openchannel_accounts','lodash','api','bluebird'];(function(_0xec1043,_0x2a0be1){var _0x2bbb3e=function(_0x16f50b){while(--_0x16f50b){_0xec1043['push'](_0xec1043['shift']());}};_0x2bbb3e(++_0x2a0be1);}(_0x48d5,0xa8));var _0x548d=function(_0x45c48f,_0x4aa891){_0x45c48f=_0x45c48f-0x0;var _0xaf5037=_0x48d5[_0x45c48f];return _0xaf5037;};'use strict';var _=require(_0x548d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x548d('0x1'));var moment=require('moment');var BPromise=require(_0x548d('0x2'));var rp=require(_0x548d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x548d('0x4'));var attributes=require(_0x548d('0x5'));module[_0x548d('0x6')]=function(_0x230d89,_0x340cc5){return _0x230d89[_0x548d('0x7')]('OpenchannelAccount',attributes,{'tableName':_0x548d('0x8'),'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 cf64786..761613f 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 _0xc0bb=['then','info','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request'];(function(_0x22a73e,_0x5f021c){var _0x56c911=function(_0x6a9e63){while(--_0x6a9e63){_0x22a73e['push'](_0x22a73e['shift']());}};_0x56c911(++_0x5f021c);}(_0xc0bb,0x72));var _0xbc0b=function(_0x21c601,_0x26f456){_0x21c601=_0x21c601-0x0;var _0xd423f=_0xc0bb[_0x21c601];return _0xd423f;};'use strict';var _=require('lodash');var util=require(_0xbc0b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc0b('0x1'));var db=require(_0xbc0b('0x2'))['db'];var utils=require(_0xbc0b('0x3'));var logger=require(_0xbc0b('0x4'))('rpc');var config=require(_0xbc0b('0x5'));var jayson=require(_0xbc0b('0x6'));var client=jayson[_0xbc0b('0x7')][_0xbc0b('0x8')]({'port':0x232a});config[_0xbc0b('0x9')]=_[_0xbc0b('0xa')](config[_0xbc0b('0x9')],{'host':_0xbc0b('0xb'),'port':0x18eb});var socket=require(_0xbc0b('0xc'))(new Redis(config[_0xbc0b('0x9')]));require(_0xbc0b('0xd'))[_0xbc0b('0xe')](socket);function respondWithRpcPromise(_0x42a788,_0x3117b7,_0x8882e7){return new BPromise(function(_0x4901c0,_0x310aa7){return client[_0xbc0b('0xf')](_0x42a788,_0x8882e7)[_0xbc0b('0x10')](function(_0x4329b3){logger[_0xbc0b('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x3117b7,_0xbc0b('0x12'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x3117b7,'request\x20sent',JSON[_0xbc0b('0x13')](_0x4329b3));if(_0x4329b3[_0xbc0b('0x14')]){if(_0x4329b3['error'][_0xbc0b('0x15')]===0x1f4){logger[_0xbc0b('0x14')](_0xbc0b('0x16'),_0x3117b7,_0x4329b3[_0xbc0b('0x14')][_0xbc0b('0x17')]);return _0x310aa7(_0x4329b3['error']['message']);}logger[_0xbc0b('0x14')](_0xbc0b('0x16'),_0x3117b7,_0x4329b3[_0xbc0b('0x14')][_0xbc0b('0x17')]);return _0x4901c0(_0x4329b3['error']['message']);}else{logger['info'](_0xbc0b('0x16'),_0x3117b7,'request\x20sent');_0x4901c0(_0x4329b3[_0xbc0b('0x18')][_0xbc0b('0x17')]);}})[_0xbc0b('0x19')](function(_0xf78290){logger[_0xbc0b('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x3117b7,_0xf78290);_0x310aa7(_0xf78290);});});} \ No newline at end of file +var _0xc5d7=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2a72ea,_0xce2c5b){var _0x1c2a61=function(_0x3a3944){while(--_0x3a3944){_0x2a72ea['push'](_0x2a72ea['shift']());}};_0x1c2a61(++_0xce2c5b);}(_0xc5d7,0x119));var _0x7c5d=function(_0x523cd1,_0x4bcd0c){_0x523cd1=_0x523cd1-0x0;var _0x2344ae=_0xc5d7[_0x523cd1];return _0x2344ae;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7c5d('0x0'));var BPromise=require(_0x7c5d('0x1'));var rs=require(_0x7c5d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7c5d('0x3'))(_0x7c5d('0x4'));var config=require(_0x7c5d('0x5'));var jayson=require(_0x7c5d('0x6'));var client=jayson[_0x7c5d('0x7')][_0x7c5d('0x8')]({'port':0x232a});config['redis']=_[_0x7c5d('0x9')](config[_0x7c5d('0xa')],{'host':_0x7c5d('0xb'),'port':0x18eb});var socket=require(_0x7c5d('0xc'))(new Redis(config[_0x7c5d('0xa')]));require(_0x7c5d('0xd'))['register'](socket);function respondWithRpcPromise(_0x1a2e8a,_0x2d8f8b,_0x423c70){return new BPromise(function(_0x39d80f,_0xb2608b){return client[_0x7c5d('0xe')](_0x1a2e8a,_0x423c70)[_0x7c5d('0xf')](function(_0x8d1502){logger['info'](_0x7c5d('0x10'),_0x2d8f8b,_0x7c5d('0x11'));logger[_0x7c5d('0x12')](_0x7c5d('0x13'),_0x2d8f8b,'request\x20sent',JSON[_0x7c5d('0x14')](_0x8d1502));if(_0x8d1502[_0x7c5d('0x15')]){if(_0x8d1502[_0x7c5d('0x15')]['code']===0x1f4){logger[_0x7c5d('0x15')](_0x7c5d('0x10'),_0x2d8f8b,_0x8d1502[_0x7c5d('0x15')][_0x7c5d('0x16')]);return _0xb2608b(_0x8d1502[_0x7c5d('0x15')][_0x7c5d('0x16')]);}logger[_0x7c5d('0x15')](_0x7c5d('0x10'),_0x2d8f8b,_0x8d1502['error']['message']);return _0x39d80f(_0x8d1502['error']['message']);}else{logger[_0x7c5d('0x17')](_0x7c5d('0x10'),_0x2d8f8b,'request\x20sent');_0x39d80f(_0x8d1502[_0x7c5d('0x18')][_0x7c5d('0x16')]);}})['catch'](function(_0x45265b){logger[_0x7c5d('0x15')](_0x7c5d('0x10'),_0x2d8f8b,_0x45265b);_0xb2608b(_0x45265b);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index d29becb..c03f5ab 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 _0x7453=['emit','removeListener','register','length','save','remove','update'];(function(_0xdc850e,_0xdb05c8){var _0x1e0acb=function(_0x4031bb){while(--_0x4031bb){_0xdc850e['push'](_0xdc850e['shift']());}};_0x1e0acb(++_0xdb05c8);}(_0x7453,0x15b));var _0x3745=function(_0x2a615d,_0x203075){_0x2a615d=_0x2a615d-0x0;var _0x45060f=_0x7453[_0x2a615d];return _0x45060f;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x3745('0x0'),_0x3745('0x1'),_0x3745('0x2')];function createListener(_0x116d23,_0x4fefde){return function(_0x43cfa8){_0x4fefde[_0x3745('0x3')](_0x116d23,_0x43cfa8);};}function removeListener(_0x155c99,_0x19d22e){return function(){OpenchannelAccountEvents[_0x3745('0x4')](_0x155c99,_0x19d22e);};}exports[_0x3745('0x5')]=function(_0x17fb13){for(var _0x134b91=0x0,_0xfded96=events[_0x3745('0x6')];_0x134b91<_0xfded96;_0x134b91++){var _0x56bf6e=events[_0x134b91];var _0x452a70=createListener('openchannelAccount:'+_0x56bf6e,_0x17fb13);OpenchannelAccountEvents['on'](_0x56bf6e,_0x452a70);}}; \ No newline at end of file +var _0x1e78=['./openchannelAccount.events','update','emit','removeListener','register','length','openchannelAccount:'];(function(_0x17c1d4,_0x32c94f){var _0x57bee2=function(_0x1ac385){while(--_0x1ac385){_0x17c1d4['push'](_0x17c1d4['shift']());}};_0x57bee2(++_0x32c94f);}(_0x1e78,0x1f1));var _0x81e7=function(_0x5c6abf,_0x559423){_0x5c6abf=_0x5c6abf-0x0;var _0x20f1b0=_0x1e78[_0x5c6abf];return _0x20f1b0;};'use strict';var OpenchannelAccountEvents=require(_0x81e7('0x0'));var events=['save','remove',_0x81e7('0x1')];function createListener(_0x43fa42,_0x431ad1){return function(_0x519c0c){_0x431ad1[_0x81e7('0x2')](_0x43fa42,_0x519c0c);};}function removeListener(_0x50b3e2,_0x2f5da0){return function(){OpenchannelAccountEvents[_0x81e7('0x3')](_0x50b3e2,_0x2f5da0);};}exports[_0x81e7('0x4')]=function(_0x2fa4a7){for(var _0x370f97=0x0,_0x8add8f=events[_0x81e7('0x5')];_0x370f97<_0x8add8f;_0x370f97++){var _0x5d9558=events[_0x370f97];var _0x1dac45=createListener(_0x81e7('0x6')+_0x5d9558,_0x2fa4a7);OpenchannelAccountEvents['on'](_0x5d9558,_0x1dac45);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 8be1d35..aa1f79d 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 _0xc987=['post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xc987,0xf6));var _0x7c98=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0xc987[_0x43b06b];return _0x2c555b;};'use strict';var multer=require(_0x7c98('0x0'));var util=require(_0x7c98('0x1'));var path=require(_0x7c98('0x2'));var timeout=require('connect-timeout');var express=require(_0x7c98('0x3'));var router=express[_0x7c98('0x4')]();var auth=require(_0x7c98('0x5'));var interaction=require(_0x7c98('0x6'));var config=require(_0x7c98('0x7'));var controller=require(_0x7c98('0x8'));router[_0x7c98('0x9')]('/',auth[_0x7c98('0xa')](),controller[_0x7c98('0xb')]);router[_0x7c98('0x9')](_0x7c98('0xc'),auth[_0x7c98('0xa')](),controller[_0x7c98('0xd')]);router[_0x7c98('0xe')]('/',auth[_0x7c98('0xa')](),controller[_0x7c98('0xf')]);router[_0x7c98('0x10')](_0x7c98('0xc'),auth['isAuthenticated'](),controller[_0x7c98('0x11')]);router[_0x7c98('0x12')](_0x7c98('0xc'),auth['isAuthenticated'](),controller[_0x7c98('0x13')]);module['exports']=router; \ No newline at end of file +var _0x67d1=['index','/:id','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelApplication.controller','isAuthenticated'];(function(_0x1c83de,_0x242d60){var _0x4011b1=function(_0xd0a8ea){while(--_0xd0a8ea){_0x1c83de['push'](_0x1c83de['shift']());}};_0x4011b1(++_0x242d60);}(_0x67d1,0x87));var _0x167d=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x67d1[_0x3070dc];return _0x431489;};'use strict';var multer=require(_0x167d('0x0'));var util=require('util');var path=require(_0x167d('0x1'));var timeout=require(_0x167d('0x2'));var express=require(_0x167d('0x3'));var router=express[_0x167d('0x4')]();var auth=require(_0x167d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x167d('0x6'));var controller=require(_0x167d('0x7'));router['get']('/',auth[_0x167d('0x8')](),controller[_0x167d('0x9')]);router['get'](_0x167d('0xa'),auth[_0x167d('0x8')](),controller['show']);router['post']('/',auth[_0x167d('0x8')](),controller[_0x167d('0xb')]);router['put']('/:id',auth[_0x167d('0x8')](),controller[_0x167d('0xc')]);router[_0x167d('0xd')]('/:id',auth[_0x167d('0x8')](),controller[_0x167d('0xe')]);module[_0x167d('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 6affaf2..0a818f4 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 _0x39da=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x3a96ac,_0x3d8417){var _0x65743=function(_0x473c34){while(--_0x473c34){_0x3a96ac['push'](_0x3a96ac['shift']());}};_0x65743(++_0x3d8417);}(_0x39da,0x1b3));var _0xa39d=function(_0x3d34fb,_0x312734){_0x3d34fb=_0x3d34fb-0x0;var _0x2d969d=_0x39da[_0x3d34fb];return _0x2d969d;};'use strict';var Sequelize=require('sequelize');module[_0xa39d('0x0')]={'priority':{'type':Sequelize[_0xa39d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa39d('0x2')],'allowNull':![],'defaultValue':_0xa39d('0x3')},'appdata':{'type':Sequelize[_0xa39d('0x4')]()},'description':{'type':Sequelize[_0xa39d('0x2')]},'interval':{'type':Sequelize[_0xa39d('0x2')],'defaultValue':_0xa39d('0x5')}}; \ No newline at end of file +var _0x3d5d=['STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x3d5d,0x126));var _0xd3d5=function(_0x2797c6,_0x37421b){_0x2797c6=_0x2797c6-0x0;var _0x54809f=_0x3d5d[_0x2797c6];return _0x54809f;};'use strict';var Sequelize=require('sequelize');module[_0xd3d5('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd3d5('0x1')],'allowNull':![],'defaultValue':_0xd3d5('0x2')},'appdata':{'type':Sequelize[_0xd3d5('0x3')]()},'description':{'type':Sequelize[_0xd3d5('0x1')]},'interval':{'type':Sequelize[_0xd3d5('0x1')],'defaultValue':_0xd3d5('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 15a2306..0ce8937 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 _0x29e0=['nolimit','order','sort','where','filter','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','OpenchannelApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x49fd08,_0x42348f){var _0x23e5a9=function(_0x3e69f9){while(--_0x3e69f9){_0x49fd08['push'](_0x49fd08['shift']());}};_0x23e5a9(++_0x42348f);}(_0x29e0,0x184));var _0x029e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e0[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x029e('0x0'));var emlformat=require(_0x029e('0x1'));var rimraf=require(_0x029e('0x2'));var zipdir=require(_0x029e('0x3'));var jsonpatch=require(_0x029e('0x4'));var rp=require(_0x029e('0x5'));var moment=require(_0x029e('0x6'));var BPromise=require(_0x029e('0x7'));var Mustache=require(_0x029e('0x8'));var util=require(_0x029e('0x9'));var path=require(_0x029e('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x029e('0xb'));var fs=require('fs');var _=require(_0x029e('0xc'));var squel=require(_0x029e('0xd'));var crypto=require('crypto');var jsforce=require(_0x029e('0xe'));var deskjs=require(_0x029e('0xf'));var toCsv=require(_0x029e('0x10'));var querystring=require(_0x029e('0x11'));var Papa=require('papaparse');var Redis=require(_0x029e('0x12'));var authService=require(_0x029e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x029e('0x14'));var hardwareService=require(_0x029e('0x15'));var logger=require(_0x029e('0x16'))(_0x029e('0x17'));var utils=require(_0x029e('0x18'));var config=require('../../config/environment');var db=require(_0x029e('0x19'))['db'];function respondWithStatusCode(_0x3a56a7,_0x517eea){_0x517eea=_0x517eea||0xcc;return function(_0x1ee541){if(_0x1ee541){return _0x3a56a7[_0x029e('0x1a')](_0x517eea);}return _0x3a56a7[_0x029e('0x1b')](_0x517eea)[_0x029e('0x1c')]();};}function respondWithResult(_0xabfa7e,_0x28bdfe){_0x28bdfe=_0x28bdfe||0xc8;return function(_0x2a067a){if(_0x2a067a){return _0xabfa7e[_0x029e('0x1b')](_0x28bdfe)[_0x029e('0x1d')](_0x2a067a);}};}function respondWithFilteredResult(_0x283bd7,_0x3c8ab2){return function(_0x47fec5){if(_0x47fec5){var _0x3565ce=_0x47fec5['count'],_0x4e39fa=_0x3c8ab2[_0x029e('0x1e')],_0x4a7613=_0x3c8ab2['offset']+_0x3c8ab2[_0x029e('0x1f')],_0x326859;if(_0x4a7613>=_0x3565ce){_0x4a7613=_0x3565ce;_0x326859=0xc8;}else{_0x326859=0xce;}_0x283bd7['status'](_0x326859);return _0x283bd7['set'](_0x029e('0x20'),_0x4e39fa+'-'+_0x4a7613+'/'+_0x3565ce)[_0x029e('0x1d')](_0x47fec5);}return null;};}function patchUpdates(_0x42886d){return function(_0xb153d6){try{jsonpatch[_0x029e('0x21')](_0xb153d6,_0x42886d,!![]);}catch(_0x4beb28){return BPromise[_0x029e('0x22')](_0x4beb28);}return _0xb153d6['save']();};}function saveUpdates(_0x130d36,_0x3ff645){return function(_0x3c9c3c){if(_0x3c9c3c){return _0x3c9c3c[_0x029e('0x23')](_0x130d36)['then'](function(_0x1ddae0){return _0x1ddae0;});}return null;};}function removeEntity(_0x59ac64,_0x101ec5){return function(_0x9a7dc9){if(_0x9a7dc9){return _0x9a7dc9['destroy']()[_0x029e('0x24')](function(){_0x59ac64[_0x029e('0x1b')](0xcc)[_0x029e('0x1c')]();});}};}function handleEntityNotFound(_0x2a3179,_0x359615){return function(_0x4353c7){if(!_0x4353c7){_0x2a3179[_0x029e('0x1a')](0x194);}return _0x4353c7;};}function handleError(_0x1bd590,_0x5d91c3){_0x5d91c3=_0x5d91c3||0x1f4;return function(_0x243959){logger[_0x029e('0x25')](_0x243959[_0x029e('0x26')]);if(_0x243959[_0x029e('0x27')]){delete _0x243959[_0x029e('0x27')];}_0x1bd590['status'](_0x5d91c3)[_0x029e('0x28')](_0x243959);};}exports[_0x029e('0x29')]=function(_0x49dd17,_0x327d3f){var _0x4a2102={},_0x4ba0c8={},_0xf6f92={'count':0x0,'rows':[]};var _0x5dfa4e=_[_0x029e('0x2a')](db[_0x029e('0x2b')]['rawAttributes'],function(_0x5a2893){return{'name':_0x5a2893[_0x029e('0x2c')],'type':_0x5a2893[_0x029e('0x2d')][_0x029e('0x2e')]};});_0x4ba0c8[_0x029e('0x2f')]=_[_0x029e('0x2a')](_0x5dfa4e,'name');_0x4ba0c8[_0x029e('0x30')]=_[_0x029e('0x31')](_0x49dd17[_0x029e('0x30')]);_0x4ba0c8[_0x029e('0x32')]=_[_0x029e('0x33')](_0x4ba0c8['model'],_0x4ba0c8[_0x029e('0x30')]);_0x4a2102[_0x029e('0x34')]=_[_0x029e('0x33')](_0x4ba0c8['model'],qs[_0x029e('0x35')](_0x49dd17[_0x029e('0x30')]['fields']));_0x4a2102['attributes']=_0x4a2102['attributes'][_0x029e('0x36')]?_0x4a2102[_0x029e('0x34')]:_0x4ba0c8[_0x029e('0x2f')];if(!_0x49dd17['query'][_0x029e('0x37')](_0x029e('0x38'))){_0x4a2102[_0x029e('0x1f')]=qs[_0x029e('0x1f')](_0x49dd17[_0x029e('0x30')][_0x029e('0x1f')]);_0x4a2102[_0x029e('0x1e')]=qs['offset'](_0x49dd17[_0x029e('0x30')]['offset']);}_0x4a2102[_0x029e('0x39')]=qs[_0x029e('0x3a')](_0x49dd17[_0x029e('0x30')]['sort']);_0x4a2102[_0x029e('0x3b')]=qs[_0x029e('0x32')](_['pick'](_0x49dd17[_0x029e('0x30')],_0x4ba0c8[_0x029e('0x32')]));if(_0x49dd17[_0x029e('0x30')][_0x029e('0x3c')]){_0x4a2102[_0x029e('0x3b')]=_[_0x029e('0x3d')](_0x4a2102[_0x029e('0x3b')],{'$or':_[_0x029e('0x2a')](_0x5dfa4e,function(_0x4f00a8){if(_0x4f00a8[_0x029e('0x2d')]!==_0x029e('0x3e')){var _0x55f21a={};_0x55f21a[_0x4f00a8[_0x029e('0x27')]]={'$like':'%'+_0x49dd17[_0x029e('0x30')][_0x029e('0x3c')]+'%'};return _0x55f21a;}})});}_0x4a2102=_[_0x029e('0x3d')]({},_0x4a2102,_0x49dd17['options']);var _0x4fc824={'where':_0x4a2102[_0x029e('0x3b')]};return db[_0x029e('0x2b')][_0x029e('0x3f')](_0x4fc824)[_0x029e('0x24')](function(_0x144d23){_0xf6f92[_0x029e('0x3f')]=_0x144d23;if(_0x49dd17[_0x029e('0x30')][_0x029e('0x40')]){_0x4a2102['include']=[{'all':!![]}];}return db[_0x029e('0x2b')][_0x029e('0x41')](_0x4a2102);})[_0x029e('0x24')](function(_0x19bbe4){_0xf6f92[_0x029e('0x42')]=_0x19bbe4;return _0xf6f92;})[_0x029e('0x24')](respondWithFilteredResult(_0x327d3f,_0x4a2102))[_0x029e('0x43')](handleError(_0x327d3f,null));};exports[_0x029e('0x44')]=function(_0x57989f,_0x287c40){var _0x2f058f={'raw':!![],'where':{'id':_0x57989f[_0x029e('0x45')]['id']}},_0x120527={};_0x120527[_0x029e('0x2f')]=_['keys'](db['OpenchannelApplication']['rawAttributes']);_0x120527[_0x029e('0x30')]=_[_0x029e('0x31')](_0x57989f['query']);_0x120527[_0x029e('0x32')]=_['intersection'](_0x120527[_0x029e('0x2f')],_0x120527['query']);_0x2f058f[_0x029e('0x34')]=_[_0x029e('0x33')](_0x120527[_0x029e('0x2f')],qs[_0x029e('0x35')](_0x57989f[_0x029e('0x30')][_0x029e('0x35')]));_0x2f058f['attributes']=_0x2f058f[_0x029e('0x34')][_0x029e('0x36')]?_0x2f058f[_0x029e('0x34')]:_0x120527[_0x029e('0x2f')];if(_0x57989f[_0x029e('0x30')][_0x029e('0x40')]){_0x2f058f['include']=[{'all':!![]}];}_0x2f058f=_[_0x029e('0x3d')]({},_0x2f058f,_0x57989f[_0x029e('0x46')]);return db[_0x029e('0x2b')][_0x029e('0x47')](_0x2f058f)[_0x029e('0x24')](handleEntityNotFound(_0x287c40,null))[_0x029e('0x24')](respondWithResult(_0x287c40,null))[_0x029e('0x43')](handleError(_0x287c40,null));};exports[_0x029e('0x48')]=function(_0x317b9d,_0x2e5c5d){return db[_0x029e('0x2b')][_0x029e('0x48')](_0x317b9d[_0x029e('0x49')],{})[_0x029e('0x24')](respondWithResult(_0x2e5c5d,0xc9))['catch'](handleError(_0x2e5c5d,null));};exports['update']=function(_0x4b18e7,_0x19b06c){if(_0x4b18e7[_0x029e('0x49')]['id']){delete _0x4b18e7[_0x029e('0x49')]['id'];}return db[_0x029e('0x2b')][_0x029e('0x47')]({'where':{'id':_0x4b18e7[_0x029e('0x45')]['id']}})['then'](handleEntityNotFound(_0x19b06c,null))['then'](saveUpdates(_0x4b18e7['body'],null))[_0x029e('0x24')](respondWithResult(_0x19b06c,null))['catch'](handleError(_0x19b06c,null));};exports['destroy']=function(_0x220563,_0x4ae1fa){return db['OpenchannelApplication'][_0x029e('0x47')]({'where':{'id':_0x220563['params']['id']}})[_0x029e('0x24')](handleEntityNotFound(_0x4ae1fa,null))['then'](removeEntity(_0x4ae1fa,null))['catch'](handleError(_0x4ae1fa,null));}; \ No newline at end of file +var _0x8895=['lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','index','map','rawAttributes','type','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','OpenchannelApplication','includeAll','include','findAll','rows','catch','fields','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox'];(function(_0x14065a,_0xa7a50){var _0x320a48=function(_0x22ceda){while(--_0x22ceda){_0x14065a['push'](_0x14065a['shift']());}};_0x320a48(++_0xa7a50);}(_0x8895,0x169));var _0x5889=function(_0x582bc1,_0x32c4e1){_0x582bc1=_0x582bc1-0x0;var _0x231a24=_0x8895[_0x582bc1];return _0x231a24;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5889('0x0'));var rimraf=require(_0x5889('0x1'));var zipdir=require(_0x5889('0x2'));var jsonpatch=require(_0x5889('0x3'));var rp=require(_0x5889('0x4'));var moment=require('moment');var BPromise=require(_0x5889('0x5'));var Mustache=require(_0x5889('0x6'));var util=require(_0x5889('0x7'));var path=require('path');var sox=require(_0x5889('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x5889('0x9'));var squel=require(_0x5889('0xa'));var crypto=require(_0x5889('0xb'));var jsforce=require(_0x5889('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5889('0xd'));var querystring=require(_0x5889('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5889('0xf'));var qs=require(_0x5889('0x10'));var as=require(_0x5889('0x11'));var hardwareService=require(_0x5889('0x12'));var logger=require(_0x5889('0x13'))(_0x5889('0x14'));var utils=require(_0x5889('0x15'));var config=require(_0x5889('0x16'));var db=require(_0x5889('0x17'))['db'];function respondWithStatusCode(_0x56f344,_0x26aed4){_0x26aed4=_0x26aed4||0xcc;return function(_0x4c6081){if(_0x4c6081){return _0x56f344[_0x5889('0x18')](_0x26aed4);}return _0x56f344[_0x5889('0x19')](_0x26aed4)[_0x5889('0x1a')]();};}function respondWithResult(_0x2e9c43,_0x344b22){_0x344b22=_0x344b22||0xc8;return function(_0x453fd3){if(_0x453fd3){return _0x2e9c43[_0x5889('0x19')](_0x344b22)['json'](_0x453fd3);}};}function respondWithFilteredResult(_0x40b0fa,_0x9be79c){return function(_0x4abd28){if(_0x4abd28){var _0x31c9fb=_0x4abd28[_0x5889('0x1b')],_0x3c7a35=_0x9be79c[_0x5889('0x1c')],_0x216ad2=_0x9be79c['offset']+_0x9be79c[_0x5889('0x1d')],_0x27337e;if(_0x216ad2>=_0x31c9fb){_0x216ad2=_0x31c9fb;_0x27337e=0xc8;}else{_0x27337e=0xce;}_0x40b0fa['status'](_0x27337e);return _0x40b0fa[_0x5889('0x1e')](_0x5889('0x1f'),_0x3c7a35+'-'+_0x216ad2+'/'+_0x31c9fb)[_0x5889('0x20')](_0x4abd28);}return null;};}function patchUpdates(_0x2134ff){return function(_0x258b54){try{jsonpatch[_0x5889('0x21')](_0x258b54,_0x2134ff,!![]);}catch(_0x1a9479){return BPromise[_0x5889('0x22')](_0x1a9479);}return _0x258b54[_0x5889('0x23')]();};}function saveUpdates(_0x14f24e,_0x15d1cd){return function(_0x3996f6){if(_0x3996f6){return _0x3996f6[_0x5889('0x24')](_0x14f24e)['then'](function(_0x3f93ea){return _0x3f93ea;});}return null;};}function removeEntity(_0x1e0705,_0x2ba161){return function(_0x330a7a){if(_0x330a7a){return _0x330a7a[_0x5889('0x25')]()[_0x5889('0x26')](function(){_0x1e0705['status'](0xcc)[_0x5889('0x1a')]();});}};}function handleEntityNotFound(_0x4eb7ff,_0x813b5f){return function(_0x4d6019){if(!_0x4d6019){_0x4eb7ff[_0x5889('0x18')](0x194);}return _0x4d6019;};}function handleError(_0x2a1856,_0x56d92f){_0x56d92f=_0x56d92f||0x1f4;return function(_0x82a865){logger[_0x5889('0x27')](_0x82a865[_0x5889('0x28')]);if(_0x82a865[_0x5889('0x29')]){delete _0x82a865[_0x5889('0x29')];}_0x2a1856[_0x5889('0x19')](_0x56d92f)['send'](_0x82a865);};}exports[_0x5889('0x2a')]=function(_0x5a4bba,_0x3526f9){var _0x445b6f={},_0x5cbdde={},_0x2864e5={'count':0x0,'rows':[]};var _0x17867f=_[_0x5889('0x2b')](db['OpenchannelApplication'][_0x5889('0x2c')],function(_0x35b302){return{'name':_0x35b302['fieldName'],'type':_0x35b302[_0x5889('0x2d')][_0x5889('0x2e')]};});_0x5cbdde['model']=_['map'](_0x17867f,_0x5889('0x29'));_0x5cbdde[_0x5889('0x2f')]=_[_0x5889('0x30')](_0x5a4bba[_0x5889('0x2f')]);_0x5cbdde['filters']=_[_0x5889('0x31')](_0x5cbdde[_0x5889('0x32')],_0x5cbdde['query']);_0x445b6f['attributes']=_[_0x5889('0x31')](_0x5cbdde[_0x5889('0x32')],qs['fields'](_0x5a4bba[_0x5889('0x2f')]['fields']));_0x445b6f[_0x5889('0x33')]=_0x445b6f[_0x5889('0x33')][_0x5889('0x34')]?_0x445b6f[_0x5889('0x33')]:_0x5cbdde['model'];if(!_0x5a4bba[_0x5889('0x2f')][_0x5889('0x35')](_0x5889('0x36'))){_0x445b6f[_0x5889('0x1d')]=qs[_0x5889('0x1d')](_0x5a4bba[_0x5889('0x2f')]['limit']);_0x445b6f[_0x5889('0x1c')]=qs[_0x5889('0x1c')](_0x5a4bba[_0x5889('0x2f')]['offset']);}_0x445b6f['order']=qs[_0x5889('0x37')](_0x5a4bba[_0x5889('0x2f')][_0x5889('0x37')]);_0x445b6f['where']=qs[_0x5889('0x38')](_[_0x5889('0x39')](_0x5a4bba[_0x5889('0x2f')],_0x5cbdde[_0x5889('0x38')]));if(_0x5a4bba[_0x5889('0x2f')][_0x5889('0x3a')]){_0x445b6f[_0x5889('0x3b')]=_[_0x5889('0x3c')](_0x445b6f['where'],{'$or':_[_0x5889('0x2b')](_0x17867f,function(_0x598ded){if(_0x598ded[_0x5889('0x2d')]!==_0x5889('0x3d')){var _0x5b9fc3={};_0x5b9fc3[_0x598ded[_0x5889('0x29')]]={'$like':'%'+_0x5a4bba[_0x5889('0x2f')]['filter']+'%'};return _0x5b9fc3;}})});}_0x445b6f=_[_0x5889('0x3c')]({},_0x445b6f,_0x5a4bba[_0x5889('0x3e')]);var _0x23f3b8={'where':_0x445b6f[_0x5889('0x3b')]};return db[_0x5889('0x3f')][_0x5889('0x1b')](_0x23f3b8)[_0x5889('0x26')](function(_0x3b6247){_0x2864e5[_0x5889('0x1b')]=_0x3b6247;if(_0x5a4bba[_0x5889('0x2f')][_0x5889('0x40')]){_0x445b6f[_0x5889('0x41')]=[{'all':!![]}];}return db[_0x5889('0x3f')][_0x5889('0x42')](_0x445b6f);})[_0x5889('0x26')](function(_0x214875){_0x2864e5[_0x5889('0x43')]=_0x214875;return _0x2864e5;})[_0x5889('0x26')](respondWithFilteredResult(_0x3526f9,_0x445b6f))[_0x5889('0x44')](handleError(_0x3526f9,null));};exports['show']=function(_0x9b7847,_0x499571){var _0x196207={'raw':!![],'where':{'id':_0x9b7847['params']['id']}},_0x47a32e={};_0x47a32e[_0x5889('0x32')]=_['keys'](db[_0x5889('0x3f')][_0x5889('0x2c')]);_0x47a32e['query']=_[_0x5889('0x30')](_0x9b7847['query']);_0x47a32e[_0x5889('0x38')]=_[_0x5889('0x31')](_0x47a32e[_0x5889('0x32')],_0x47a32e['query']);_0x196207[_0x5889('0x33')]=_[_0x5889('0x31')](_0x47a32e[_0x5889('0x32')],qs[_0x5889('0x45')](_0x9b7847['query'][_0x5889('0x45')]));_0x196207[_0x5889('0x33')]=_0x196207[_0x5889('0x33')][_0x5889('0x34')]?_0x196207['attributes']:_0x47a32e[_0x5889('0x32')];if(_0x9b7847[_0x5889('0x2f')]['includeAll']){_0x196207[_0x5889('0x41')]=[{'all':!![]}];}_0x196207=_[_0x5889('0x3c')]({},_0x196207,_0x9b7847[_0x5889('0x3e')]);return db['OpenchannelApplication']['find'](_0x196207)[_0x5889('0x26')](handleEntityNotFound(_0x499571,null))[_0x5889('0x26')](respondWithResult(_0x499571,null))['catch'](handleError(_0x499571,null));};exports[_0x5889('0x46')]=function(_0x5e5382,_0x3c8bd2){return db['OpenchannelApplication'][_0x5889('0x46')](_0x5e5382[_0x5889('0x47')],{})[_0x5889('0x26')](respondWithResult(_0x3c8bd2,0xc9))['catch'](handleError(_0x3c8bd2,null));};exports[_0x5889('0x24')]=function(_0x1057d6,_0x1cda1d){if(_0x1057d6[_0x5889('0x47')]['id']){delete _0x1057d6[_0x5889('0x47')]['id'];}return db[_0x5889('0x3f')][_0x5889('0x48')]({'where':{'id':_0x1057d6['params']['id']}})[_0x5889('0x26')](handleEntityNotFound(_0x1cda1d,null))['then'](saveUpdates(_0x1057d6[_0x5889('0x47')],null))[_0x5889('0x26')](respondWithResult(_0x1cda1d,null))['catch'](handleError(_0x1cda1d,null));};exports['destroy']=function(_0x34c38c,_0x88b443){return db[_0x5889('0x3f')][_0x5889('0x48')]({'where':{'id':_0x34c38c[_0x5889('0x49')]['id']}})[_0x5889('0x26')](handleEntityNotFound(_0x88b443,null))[_0x5889('0x26')](removeEntity(_0x88b443,null))[_0x5889('0x44')](handleError(_0x88b443,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 65d2a4d..be363c0 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 _0x44f2=['lodash','api','bluebird','request-promise','path','rimraf','./openchannelApplication.attributes','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x7b717,_0x311539){var _0x50d254=function(_0xfdf8b8){while(--_0xfdf8b8){_0x7b717['push'](_0x7b717['shift']());}};_0x50d254(++_0x311539);}(_0x44f2,0x120));var _0x244f=function(_0x4863bc,_0x26dd88){_0x4863bc=_0x4863bc-0x0;var _0xa20d45=_0x44f2[_0x4863bc];return _0xa20d45;};'use strict';var _=require(_0x244f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x244f('0x1'));var moment=require('moment');var BPromise=require(_0x244f('0x2'));var rp=require(_0x244f('0x3'));var fs=require('fs');var path=require(_0x244f('0x4'));var rimraf=require(_0x244f('0x5'));var config=require('../../config/environment');var attributes=require(_0x244f('0x6'));module['exports']=function(_0x3322da,_0x1d352b){return _0x3322da[_0x244f('0x7')](_0x244f('0x8'),attributes,{'tableName':_0x244f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x244f('0xa'),'collate':_0x244f('0xb')});}; \ No newline at end of file +var _0x0814=['utf8mb4','lodash','api','moment','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','OpenchannelApplication'];(function(_0x54a45b,_0x42c0b9){var _0x1e4999=function(_0x27e516){while(--_0x27e516){_0x54a45b['push'](_0x54a45b['shift']());}};_0x1e4999(++_0x42c0b9);}(_0x0814,0x88));var _0x4081=function(_0x45ce27,_0xa9b6b0){_0x45ce27=_0x45ce27-0x0;var _0x59a755=_0x0814[_0x45ce27];return _0x59a755;};'use strict';var _=require(_0x4081('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4081('0x1'));var moment=require(_0x4081('0x2'));var BPromise=require('bluebird');var rp=require(_0x4081('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4081('0x4'));var config=require(_0x4081('0x5'));var attributes=require(_0x4081('0x6'));module['exports']=function(_0x2b6b0d,_0x18e3c4){return _0x2b6b0d['define'](_0x4081('0x7'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4081('0x8'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 8299885..886a561 100644 --- a/server/api/openchannelApplication/openchannelApplication.rpc.js +++ b/server/api/openchannelApplication/openchannelApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x44c12e,_0x11d2f6){var _0x1c3701=function(_0x5b905f){while(--_0x5b905f){_0x44c12e['push'](_0x44c12e['shift']());}};_0x1c3701(++_0x11d2f6);}(_0xb10b,0x12a));var _0xbb10=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xb10b[_0x455c6c];return _0x488242;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file +var _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(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_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 diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index ca114c9..9148cf4 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 _0x057e=['show','getMessages','download','/:id/messages','addMessage','post','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','tracked','update','openchannelinteraction:destroy','delete','removeTags','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x961134,_0x15e0f3){var _0x45dcf3=function(_0x261cc2){while(--_0x261cc2){_0x961134['push'](_0x961134['shift']());}};_0x45dcf3(++_0x15e0f3);}(_0x057e,0x1c3));var _0xe057=function(_0x2cd003,_0x830d5f){_0x2cd003=_0x2cd003-0x0;var _0x5f0cdf=_0x057e[_0x2cd003];return _0x5f0cdf;};'use strict';var multer=require(_0xe057('0x0'));var util=require(_0xe057('0x1'));var path=require('path');var timeout=require(_0xe057('0x2'));var express=require(_0xe057('0x3'));var router=express[_0xe057('0x4')]();var auth=require(_0xe057('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe057('0x6'));var controller=require(_0xe057('0x7'));router['get']('/',auth[_0xe057('0x8')](),controller[_0xe057('0x9')]);router[_0xe057('0xa')](_0xe057('0xb'),auth[_0xe057('0x8')](),controller[_0xe057('0xc')]);router[_0xe057('0xa')](_0xe057('0xd'),auth[_0xe057('0x8')](),controller[_0xe057('0xe')]);router['get']('/:id/messages',auth[_0xe057('0x8')](),controller[_0xe057('0xf')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xe057('0x10')]);router['post']('/',auth[_0xe057('0x8')](),controller['create']);router['post'](_0xe057('0x11'),auth[_0xe057('0x8')](),controller[_0xe057('0x12')]);router[_0xe057('0x13')](_0xe057('0x14'),auth[_0xe057('0x8')](),interaction['tracked'](_0xe057('0x15'),_0xe057('0x16')),controller[_0xe057('0x17')]);router[_0xe057('0x18')]('/:id',auth[_0xe057('0x8')](),interaction[_0xe057('0x19')](_0xe057('0x15'),'openchannelinteraction:update'),controller[_0xe057('0x1a')]);router['delete'](_0xe057('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0xe057('0x15'),_0xe057('0x1b')),controller['destroy']);router[_0xe057('0x1c')](_0xe057('0x14'),auth[_0xe057('0x8')](),controller[_0xe057('0x1d')]);module[_0xe057('0x1e')]=router; \ No newline at end of file +var _0x13e9=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','openchannelinteraction:addtags','addTags','put','openchannel','openchannelinteraction:update','update','delete','tracked','openchannelinteraction:destroy','destroy','removeTags'];(function(_0x5cf90e,_0x5df405){var _0xae958d=function(_0x52c27c){while(--_0x52c27c){_0x5cf90e['push'](_0x5cf90e['shift']());}};_0xae958d(++_0x5df405);}(_0x13e9,0x18d));var _0x913e=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x13e9[_0x1969a7];return _0x3d665f;};'use strict';var multer=require(_0x913e('0x0'));var util=require(_0x913e('0x1'));var path=require(_0x913e('0x2'));var timeout=require(_0x913e('0x3'));var express=require(_0x913e('0x4'));var router=express[_0x913e('0x5')]();var auth=require(_0x913e('0x6'));var interaction=require(_0x913e('0x7'));var config=require(_0x913e('0x8'));var controller=require(_0x913e('0x9'));router[_0x913e('0xa')]('/',auth[_0x913e('0xb')](),controller[_0x913e('0xc')]);router[_0x913e('0xa')](_0x913e('0xd'),auth['isAuthenticated'](),controller[_0x913e('0xe')]);router[_0x913e('0xa')](_0x913e('0xf'),auth['isAuthenticated'](),controller[_0x913e('0x10')]);router['get'](_0x913e('0x11'),auth[_0x913e('0xb')](),controller[_0x913e('0x12')]);router[_0x913e('0xa')](_0x913e('0x13'),auth[_0x913e('0xb')](),controller[_0x913e('0x14')]);router[_0x913e('0x15')]('/',auth[_0x913e('0xb')](),controller[_0x913e('0x16')]);router[_0x913e('0x15')](_0x913e('0x11'),auth[_0x913e('0xb')](),controller['addMessage']);router[_0x913e('0x15')](_0x913e('0x17'),auth['isAuthenticated'](),interaction['tracked']('openchannel',_0x913e('0x18')),controller[_0x913e('0x19')]);router[_0x913e('0x1a')]('/:id',auth[_0x913e('0xb')](),interaction['tracked'](_0x913e('0x1b'),_0x913e('0x1c')),controller[_0x913e('0x1d')]);router[_0x913e('0x1e')](_0x913e('0xf'),auth[_0x913e('0xb')](),interaction[_0x913e('0x1f')](_0x913e('0x1b'),_0x913e('0x20')),controller[_0x913e('0x21')]);router[_0x913e('0x1e')]('/:id/tags',auth[_0x913e('0xb')](),controller[_0x913e('0x22')]);module[_0x913e('0x23')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 2b27ed7..fb2df35 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 _0xedf6=['out','exports','BOOLEAN','DATE','STRING'];(function(_0x2e740d,_0x531abe){var _0x2295e4=function(_0x57a5ad){while(--_0x57a5ad){_0x2e740d['push'](_0x2e740d['shift']());}};_0x2295e4(++_0x531abe);}(_0xedf6,0x1d2));var _0x6edf=function(_0x205b46,_0x3ca65b){_0x205b46=_0x205b46-0x0;var _0x2b6ae8=_0xedf6[_0x205b46];return _0x2b6ae8;};'use strict';var Sequelize=require('sequelize');module[_0x6edf('0x0')]={'closed':{'type':Sequelize[_0x6edf('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6edf('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x6edf('0x2')]},'threadId':{'type':Sequelize[_0x6edf('0x3')]},'externalUrl':{'type':Sequelize[_0x6edf('0x3')]},'lastMsgAt':{'type':Sequelize[_0x6edf('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6edf('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6edf('0x3')]}}; \ No newline at end of file +var _0xa970=['STRING','ENUM','out','sequelize','exports','DATE'];(function(_0x378bd7,_0x19168){var _0x19a1df=function(_0x224153){while(--_0x224153){_0x378bd7['push'](_0x378bd7['shift']());}};_0x19a1df(++_0x19168);}(_0xa970,0x9f));var _0x0a97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa970[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0a97('0x0'));module[_0x0a97('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0a97('0x2')]},'disposition':{'type':Sequelize[_0x0a97('0x3')]},'note':{'type':Sequelize[_0x0a97('0x3')]},'read1stAt':{'type':Sequelize[_0x0a97('0x2')]},'threadId':{'type':Sequelize[_0x0a97('0x3')]},'externalUrl':{'type':Sequelize[_0x0a97('0x3')]},'lastMsgAt':{'type':Sequelize[_0x0a97('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x0a97('0x4')]('in',_0x0a97('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0a97('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index ea96815..2cefa29 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 _0xd7d1=['merge','create','describe','addMessage','omit','ids','getMessages','findOne','OpenchannelMessage','hasOwnProperty','nolimit','$gte','format','findAll','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','unix','join','root','server','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','fullname','get','mkdirSync','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','YYYY-MM-DD','Owner','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','Public','Private','basename','existsSync','pipe','createWriteStream','out','System','renderFile','views','toFile','transcript-','.pdf','download','log','html-pdf','rimraf','fast-json-patch','request-promise','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','Users','TagIds','Tags','split','forEach','push','catch','index','map','OpenchannelInteraction','type','key','query','keys','filters','intersection','model','fields','attributes','length','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','Tag','User','UserId','body','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','params','rawAttributes','includeAll','include'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xd7d1,0x132));var _0x1d7d=function(_0x55f842,_0x290873){_0x55f842=_0x55f842-0x0;var _0x1beb0c=_0xd7d1[_0x55f842];return _0x1beb0c;};'use strict';var pdf=require(_0x1d7d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1d7d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1d7d('0x2'));var rp=require(_0x1d7d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1d7d('0x4'));var util=require(_0x1d7d('0x5'));var path=require('path');var sox=require(_0x1d7d('0x6'));var csv=require('to-csv');var ejs=require(_0x1d7d('0x7'));var fs=require('fs');var _=require(_0x1d7d('0x8'));var squel=require(_0x1d7d('0x9'));var crypto=require(_0x1d7d('0xa'));var jsforce=require(_0x1d7d('0xb'));var deskjs=require(_0x1d7d('0xc'));var toCsv=require(_0x1d7d('0xd'));var querystring=require(_0x1d7d('0xe'));var Papa=require(_0x1d7d('0xf'));var Redis=require(_0x1d7d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1d7d('0x11'));var as=require(_0x1d7d('0x12'));var hardwareService=require(_0x1d7d('0x13'));var logger=require('../../config/logger')(_0x1d7d('0x14'));var utils=require('../../config/utils');var config=require(_0x1d7d('0x15'));var db=require('../../mysqldb')['db'];config[_0x1d7d('0x16')]=_['defaults'](config['redis'],{'host':_0x1d7d('0x17'),'port':0x18eb});var socket=require(_0x1d7d('0x18'))(new Redis(config['redis']));require(_0x1d7d('0x19'))[_0x1d7d('0x1a')](socket);function respondWithStatusCode(_0x11e3a7,_0x355df7){_0x355df7=_0x355df7||0xcc;return function(_0x556cd8){if(_0x556cd8){return _0x11e3a7['sendStatus'](_0x355df7);}return _0x11e3a7[_0x1d7d('0x1b')](_0x355df7)[_0x1d7d('0x1c')]();};}function respondWithResult(_0x294679,_0x45ecda){_0x45ecda=_0x45ecda||0xc8;return function(_0x5ed4a3){if(_0x5ed4a3){return _0x294679[_0x1d7d('0x1b')](_0x45ecda)[_0x1d7d('0x1d')](_0x5ed4a3);}};}function respondWithFilteredResult(_0x26a467,_0x3b998b){return function(_0x2f6836){if(_0x2f6836){var _0x406029=_0x2f6836[_0x1d7d('0x1e')],_0x154d6c=_0x3b998b[_0x1d7d('0x1f')],_0x425168=_0x3b998b[_0x1d7d('0x1f')]+_0x3b998b[_0x1d7d('0x20')],_0xc5f25;if(_0x425168>=_0x406029){_0x425168=_0x406029;_0xc5f25=0xc8;}else{_0xc5f25=0xce;}_0x26a467[_0x1d7d('0x1b')](_0xc5f25);return _0x26a467[_0x1d7d('0x21')](_0x1d7d('0x22'),_0x154d6c+'-'+_0x425168+'/'+_0x406029)[_0x1d7d('0x1d')](_0x2f6836);}return null;};}function patchUpdates(_0x5f0bc4){return function(_0x52fe71){try{jsonpatch[_0x1d7d('0x23')](_0x52fe71,_0x5f0bc4,!![]);}catch(_0x14a1d8){return BPromise[_0x1d7d('0x24')](_0x14a1d8);}return _0x52fe71[_0x1d7d('0x25')]();};}function saveUpdates(_0x309cf7,_0x25b882){return function(_0x545d32){if(_0x545d32){return _0x545d32[_0x1d7d('0x26')](_0x309cf7)[_0x1d7d('0x27')](function(_0x858c12){return _0x858c12;});}return null;};}function removeEntity(_0x491751,_0x1077ca){return function(_0x456a76){if(_0x456a76){return _0x456a76['destroy']()[_0x1d7d('0x27')](function(){_0x491751[_0x1d7d('0x1b')](0xcc)[_0x1d7d('0x1c')]();});}};}function handleEntityNotFound(_0x2dc1f6,_0x1b262d){return function(_0xd0f187){if(!_0xd0f187){_0x2dc1f6[_0x1d7d('0x28')](0x194);}return _0xd0f187;};}function handleError(_0x152904,_0x509d3c){_0x509d3c=_0x509d3c||0x1f4;return function(_0x1bf43f){logger[_0x1d7d('0x29')](_0x1bf43f[_0x1d7d('0x2a')]);if(_0x1bf43f[_0x1d7d('0x2b')]){delete _0x1bf43f[_0x1d7d('0x2b')];}_0x152904[_0x1d7d('0x1b')](_0x509d3c)[_0x1d7d('0x2c')](_0x1bf43f);};}function getInteractionUsers(_0x28c4e0,_0x24bd0a){return new BPromise(function(_0x2602f4,_0x19e6b9){try{if(_0x24bd0a[_0x28c4e0['id']]){_0x28c4e0[_0x1d7d('0x2d')]=_['map'](_0x24bd0a[_0x28c4e0['id']],function(_0x39baf2){return{'id':_0x39baf2['id'],'fullname':_0x39baf2['fullname']};});}}catch(_0x4e5da4){_0x19e6b9(_0x4e5da4);}_0x2602f4(_0x28c4e0);});}function getInteractionTags(_0x4ffd35,_0x161e6b){return new BPromise(function(_0x57576b,_0xb9f474){try{if(_0x4ffd35[_0x1d7d('0x2e')]){_0x4ffd35[_0x1d7d('0x2f')]=[];_0x4ffd35[_0x1d7d('0x2e')][_0x1d7d('0x30')](',')[_0x1d7d('0x31')](function(_0x2f5055){_0x4ffd35['Tags'][_0x1d7d('0x32')](_0x161e6b[_0x2f5055]);});}delete _0x4ffd35[_0x1d7d('0x2e')];}catch(_0xb7ca1f){_0xb9f474(_0xb7ca1f);}_0x57576b(_0x4ffd35);});}function updateOpenchannelInteraction(_0x1f45d6,_0x115733,_0x3a8044){return new BPromise(function(_0x216b46,_0x20fb78){return getInteractionUsers(_0x1f45d6,_0x3a8044)['then'](function(_0x32192d){return getInteractionTags(_0x32192d,_0x115733);})[_0x1d7d('0x27')](function(_0x2eee03){_0x216b46(_0x2eee03);})[_0x1d7d('0x33')](function(_0x17854b){_0x20fb78(_0x17854b);});});}exports[_0x1d7d('0x34')]=function(_0x13634c,_0x5aa545){var _0x45f72d={},_0x32522e={},_0x48c740={'count':0x0,'rows':[]};var _0x21ee2c=_[_0x1d7d('0x35')](db[_0x1d7d('0x36')]['rawAttributes'],function(_0x520e9f){return{'name':_0x520e9f['fieldName'],'type':_0x520e9f[_0x1d7d('0x37')][_0x1d7d('0x38')]};});_0x32522e['model']=_['map'](_0x21ee2c,'name');_0x32522e[_0x1d7d('0x39')]=_[_0x1d7d('0x3a')](_0x13634c[_0x1d7d('0x39')]);_0x32522e[_0x1d7d('0x3b')]=_[_0x1d7d('0x3c')](_0x32522e[_0x1d7d('0x3d')],_0x32522e[_0x1d7d('0x39')]);_0x45f72d['attributes']=_['intersection'](_0x32522e[_0x1d7d('0x3d')],qs[_0x1d7d('0x3e')](_0x13634c['query'][_0x1d7d('0x3e')]));_0x45f72d[_0x1d7d('0x3f')]=_0x45f72d['attributes'][_0x1d7d('0x40')]?_0x45f72d[_0x1d7d('0x3f')]:_0x32522e[_0x1d7d('0x3d')];if(!_0x13634c[_0x1d7d('0x39')]['hasOwnProperty']('nolimit')){_0x45f72d[_0x1d7d('0x20')]=qs['limit'](_0x13634c[_0x1d7d('0x39')]['limit']);_0x45f72d[_0x1d7d('0x1f')]=qs[_0x1d7d('0x1f')](_0x13634c[_0x1d7d('0x39')]['offset']);}_0x45f72d[_0x1d7d('0x41')]=qs[_0x1d7d('0x42')](_0x13634c[_0x1d7d('0x39')][_0x1d7d('0x42')]);_0x45f72d[_0x1d7d('0x43')]=qs['filters'](_[_0x1d7d('0x44')](_0x13634c['query'],_0x32522e['filters']));var _0x4a87f5=[];var _0x49506a=squel[_0x1d7d('0x45')]()[_0x1d7d('0x46')]('id')[_0x1d7d('0x46')]('name')['field'](_0x1d7d('0x47'))[_0x1d7d('0x48')](_0x1d7d('0x49'));var _0x41cfb3=squel[_0x1d7d('0x45')]()[_0x1d7d('0x46')](_0x1d7d('0x4a'))['field'](_0x1d7d('0x4b'))['field']('ui.OpenchannelInteractionId')[_0x1d7d('0x48')](_0x1d7d('0x4c'),'ui')[_0x1d7d('0x4d')](_0x1d7d('0x4e'),'u',_0x1d7d('0x4f'));var _0x197e2d=squel[_0x1d7d('0x45')]()[_0x1d7d('0x48')]('openchannel_interactions','i')[_0x1d7d('0x4d')]('cm_contacts','c',_0x1d7d('0x50'))[_0x1d7d('0x4d')](_0x1d7d('0x4e'),'o',_0x1d7d('0x51'))['left_join']('openchannel_accounts','a',_0x1d7d('0x52'))[_0x1d7d('0x4d')](_0x1d7d('0x53'),'me',_0x1d7d('0x54'))[_0x1d7d('0x4d')](_0x1d7d('0x55'),'it',_0x1d7d('0x56'))[_0x1d7d('0x4d')](_0x1d7d('0x49'),'t',_0x1d7d('0x57'));var _0x593770=squel[_0x1d7d('0x58')]();var _0x16a08b=[];var _0x48d52e=squel[_0x1d7d('0x58')]();var _0x1b5514;if(_0x13634c[_0x1d7d('0x39')][_0x1d7d('0x59')]){_0x1b5514=as['parseSearch'](_0x13634c[_0x1d7d('0x39')][_0x1d7d('0x59')]);var _0x280717=_0x1b5514[_0x1d7d('0x5a')];for(var _0x3ad261=0x0;_0x3ad261<_0x1b5514[_0x1d7d('0x5b')][_0x1d7d('0x40')];_0x3ad261++){var _0x5c6764=_0x1b5514[_0x1d7d('0x5b')][_0x3ad261];var _0x426885='i';var _0x5601f9=_[_0x1d7d('0x5c')](_0x21ee2c,[_0x1d7d('0x2b'),_0x5c6764[_0x1d7d('0x46')]]);if(!_0x5601f9){switch(_0x5c6764[_0x1d7d('0x46')]){case _0x1d7d('0x5d'):if(_0x5c6764['value']==0x1){_0x197e2d[_0x1d7d('0x5e')]('`'+_0x5c6764[_0x1d7d('0x46')]+_0x1d7d('0x5f'));}else{_0x197e2d['having']('`'+_0x5c6764[_0x1d7d('0x46')]+_0x1d7d('0x60'));}break;case'Contact':if(_0x5c6764[_0x1d7d('0x61')]===_0x1d7d('0x62')){if(_0x5c6764[_0x1d7d('0x63')][_0x1d7d('0x30')]('\x20')['length']>0x1){_0x593770[_0x280717](_0x1d7d('0x64'),qs['getFullTextValue'](_0x5c6764[_0x1d7d('0x63')]),null);}else{var _0x504c87='%'+_0x5c6764[_0x1d7d('0x63')]+'%';_0x593770[_0x280717]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x504c87,_0x504c87,_0x504c87);}}else{_0x5601f9=_['find'](_0x21ee2c,[_0x1d7d('0x2b'),_0x1d7d('0x65')]);_0x5c6764[_0x1d7d('0x46')]=_0x1d7d('0x65');_0x54d3c1=as[_0x1d7d('0x66')](_0x426885,_0x5601f9[_0x1d7d('0x37')],_0x5c6764);_0x593770[_0x280717](_0x54d3c1[_0x1d7d('0x67')],_0x54d3c1['value'][_0x1d7d('0x68')],_0x54d3c1[_0x1d7d('0x63')][_0x1d7d('0x1c')]);}break;case _0x1d7d('0x69'):var _0x5d94b5=_0x5c6764[_0x1d7d('0x63')][_0x1d7d('0x30')](',')[_0x1d7d('0x35')](function(_0x1199f4){return Number(_0x1199f4);});_0x5d94b5[_0x1d7d('0x31')](function(_0x3da1fa){_0x48d52e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3da1fa+',%');});_0x16a08b=_['union'](_0x16a08b,_0x5d94b5);break;case _0x1d7d('0x6a'):if(_0x5c6764[_0x1d7d('0x61')]===_0x1d7d('0x62')){_0x593770[_0x280717]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5c6764[_0x1d7d('0x63')]+'%',null);}else{_0x5601f9=_[_0x1d7d('0x5c')](_0x21ee2c,[_0x1d7d('0x2b'),_0x1d7d('0x6b')]);_0x5c6764[_0x1d7d('0x46')]=_0x1d7d('0x6b');_0x54d3c1=as[_0x1d7d('0x66')](_0x426885,_0x5601f9[_0x1d7d('0x37')],_0x5c6764);_0x593770[_0x280717](_0x54d3c1[_0x1d7d('0x67')],_0x54d3c1[_0x1d7d('0x63')][_0x1d7d('0x68')],_0x54d3c1[_0x1d7d('0x63')][_0x1d7d('0x1c')]);}break;case _0x1d7d('0x6c'):_0x54d3c1=as[_0x1d7d('0x66')]('me',null,_0x5c6764);_0x593770[_0x280717](_0x54d3c1[_0x1d7d('0x67')],_0x54d3c1['value'][_0x1d7d('0x68')],_0x54d3c1[_0x1d7d('0x63')]['end']);break;}}else{var _0x54d3c1=as[_0x1d7d('0x66')](_0x426885,_0x5601f9[_0x1d7d('0x37')],_0x5c6764);_0x593770[_0x280717](_0x54d3c1[_0x1d7d('0x67')],_0x54d3c1[_0x1d7d('0x63')][_0x1d7d('0x68')],_0x54d3c1[_0x1d7d('0x63')][_0x1d7d('0x1c')]);}}}else{var _0x1ab5e3=_(_0x13634c[_0x1d7d('0x39')])['keys']()[_0x1d7d('0x35')](function(_0x31a753){return _['some'](_0x21ee2c,[_0x1d7d('0x2b'),_0x31a753])?_0x31a753:undefined;})[_0x1d7d('0x6d')]()[_0x1d7d('0x63')]();if(!_[_0x1d7d('0x6e')](_0x1ab5e3)){_0x1ab5e3[_0x1d7d('0x31')](function(_0x4afe2f){if(_0x4afe2f===_0x1d7d('0x6f')){_0x197e2d[_0x1d7d('0x43')](_0x1d7d('0x70'),[]['concat'](_0x13634c['query'][_0x4afe2f]));}else if(_0x4afe2f==='createdAt'){var _0x15dfb9=JSON[_0x1d7d('0x71')](_0x13634c[_0x1d7d('0x39')][_0x4afe2f])['$gte'];var _0x3a7c0a=JSON[_0x1d7d('0x71')](_0x13634c[_0x1d7d('0x39')][_0x4afe2f])[_0x1d7d('0x72')];_0x197e2d[_0x1d7d('0x43')](_0x1d7d('0x73'),_0x15dfb9,_0x3a7c0a);}else{if(_0x13634c[_0x1d7d('0x39')][_0x4afe2f]===_0x1d7d('0x74')){_0x197e2d[_0x1d7d('0x43')]('i.'+_0x4afe2f+_0x1d7d('0x75'));}else{_0x197e2d['where']('i.'+_0x4afe2f+'\x20=\x20?',_0x13634c[_0x1d7d('0x39')][_0x4afe2f]);}}});}if(_0x13634c['query']['read']){if(_0x13634c[_0x1d7d('0x39')]['read']==0x1){_0x197e2d['having'](_0x1d7d('0x76'));}else{_0x197e2d[_0x1d7d('0x5e')](_0x1d7d('0x77'));}}if(_0x13634c['query'][_0x1d7d('0x78')]){_0x16a08b=_[_0x1d7d('0x79')](_0x13634c['query']['tag'])?_0x13634c[_0x1d7d('0x39')]['tag']:new Array(_0x13634c[_0x1d7d('0x39')][_0x1d7d('0x78')]);_0x16a08b['forEach'](function(_0x5a1d0b){_0x48d52e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5a1d0b+',%');});}if(_0x13634c[_0x1d7d('0x39')][_0x1d7d('0x7a')]){var _0x15642c=_0x13634c['query'][_0x1d7d('0x7a')]['replace']('\x5c','\x5c\x5c')[_0x1d7d('0x7b')]('\x27\x27',_0x1d7d('0x7c'));if(qs[_0x1d7d('0x7d')](_0x15642c)){_0x593770['or']('i.id\x20LIKE\x20?',_0x15642c+'%');}else{_0x593770['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1d7d('0x7e')](_0x15642c))['or'](_0x1d7d('0x7f'),_0x15642c+'%')['or'](_0x1d7d('0x80'),_0x15642c+'%');}}}_0x197e2d[_0x1d7d('0x43')](_0x593770);_0x197e2d['group']('i.id');var _0x8f5f51={'type':db[_0x1d7d('0x81')]['QueryTypes'][_0x1d7d('0x82')],'raw':!![]};var _0x43846f=_0x197e2d[_0x1d7d('0x83')]();_0x43846f['field']('i.id');_0x43846f['field'](_0x1d7d('0x84'),_0x1d7d('0x5d'));if(_0x45f72d[_0x1d7d('0x41')]){_0x45f72d['order'][_0x1d7d('0x31')](function(_0x551c66){_0x197e2d['order']('i.'+_0x551c66[0x0],_0x551c66[0x1]===_0x1d7d('0x85')?![]:!![]);});}if(!_['isEmpty'](_0x16a08b)){_0x197e2d['having'](_0x48d52e);_0x43846f['where'](_0x1d7d('0x86'),_0x16a08b);}BPromise[_0x1d7d('0x87')]()[_0x1d7d('0x27')](function(){if(!_0x1b5514){if(_0x13634c[_0x1d7d('0x39')][_0x1d7d('0x6f')]||_0x13634c['query'][_0x1d7d('0x88')])return;_0x43846f[_0x1d7d('0x43')](_0x1d7d('0x89'));_0x197e2d[_0x1d7d('0x43')](_0x1d7d('0x89'));return;}return _0x13634c[_0x1d7d('0x8a')][_0x1d7d('0x8b')]({'attributes':['id'],'raw':!![]})[_0x1d7d('0x27')](function(_0x30ad18){if(_[_0x1d7d('0x6e')](_0x30ad18)){_0x43846f[_0x1d7d('0x43')](_0x1d7d('0x8c'));_0x197e2d[_0x1d7d('0x43')](_0x1d7d('0x8c'));}else{_0x43846f[_0x1d7d('0x43')](_0x1d7d('0x70'),_[_0x1d7d('0x35')](_0x30ad18,'id'));_0x197e2d[_0x1d7d('0x43')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x1d7d('0x35')](_0x30ad18,'id'));}});})[_0x1d7d('0x27')](function(){db[_0x1d7d('0x8d')][_0x1d7d('0x39')](_0x43846f[_0x1d7d('0x8e')](),_0x8f5f51)[_0x1d7d('0x27')](function(_0xa8c4b8){_0x48c740['count']=_0xa8c4b8[_0x1d7d('0x40')];if(_0x48c740['count']===0x0)return[];return db[_0x1d7d('0x8d')][_0x1d7d('0x39')](_0x49506a[_0x1d7d('0x8e')](),_0x8f5f51)['then'](function(_0x44bca3){_0x4a87f5=_[_0x1d7d('0x8f')](_0x44bca3,'id');_0x8f5f51=_['merge'](_0x8f5f51,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x13634c['query'][_0x1d7d('0x3e')]){_0x45f72d[_0x1d7d('0x3f')][_0x1d7d('0x31')](function(_0x187b85){_0x197e2d[_0x1d7d('0x46')]('i.'+_0x187b85);});}else{_0x197e2d[_0x1d7d('0x46')](_0x1d7d('0x84'),'unreadMessages');_0x197e2d[_0x1d7d('0x46')](_0x1d7d('0x90'),_0x1d7d('0x91'));_0x197e2d[_0x1d7d('0x46')](_0x1d7d('0x92'),_0x1d7d('0x93'));_0x197e2d[_0x1d7d('0x46')](_0x1d7d('0x94'));_0x197e2d['field']('c.firstName',_0x1d7d('0x95'));_0x197e2d['field'](_0x1d7d('0x96'),'Contact.lastName');_0x197e2d[_0x1d7d('0x46')](_0x1d7d('0x97'),_0x1d7d('0x98'));_0x197e2d[_0x1d7d('0x46')](_0x1d7d('0x99'),_0x1d7d('0x9a'));_0x197e2d['field']('c.mobile',_0x1d7d('0x9b'));_0x197e2d[_0x1d7d('0x46')](_0x1d7d('0x9c'),_0x1d7d('0x9d'));_0x197e2d[_0x1d7d('0x46')](_0x1d7d('0x9e'),'Owner.fullname');_0x197e2d[_0x1d7d('0x46')](_0x1d7d('0x9f'),_0x1d7d('0xa0'));_0x197e2d[_0x1d7d('0x46')](_0x1d7d('0xa1'),_0x1d7d('0x2e'));}_0x197e2d['limit'](_0x45f72d[_0x1d7d('0x20')]);_0x197e2d['offset'](_0x45f72d[_0x1d7d('0x1f')]);return db['sequelize'][_0x1d7d('0x39')](_0x197e2d['toString'](),_0x8f5f51);})[_0x1d7d('0x27')](function(_0x578350){_0x41cfb3['where'](_0x1d7d('0xa2'),_[_0x1d7d('0x35')](_0x578350,'id'));return db[_0x1d7d('0x8d')]['query'](_0x41cfb3[_0x1d7d('0x8e')](),_0x8f5f51)[_0x1d7d('0x27')](function(_0x3d3d92){var _0x47e89c=_['groupBy'](_0x3d3d92,_0x1d7d('0xa3'));var _0x422c7b=[];_0x578350['forEach'](function(_0x31730f){_0x422c7b[_0x1d7d('0x32')](updateOpenchannelInteraction(_0x31730f,_0x4a87f5,_0x47e89c));});return BPromise[_0x1d7d('0xa4')](_0x422c7b);});});})[_0x1d7d('0x27')](function(_0x212dbc){_0x48c740[_0x1d7d('0xa5')]=_0x212dbc;return _0x48c740;})[_0x1d7d('0x27')](respondWithFilteredResult(_0x5aa545,_0x45f72d));})[_0x1d7d('0x33')](handleError(_0x5aa545,null));};exports['show']=function(_0x4d6bc7,_0x15d0e3){var _0x3b69fa={'raw':![],'where':{'id':_0x4d6bc7[_0x1d7d('0xa6')]['id']}},_0x3e1d91={};_0x3e1d91[_0x1d7d('0x3d')]=_[_0x1d7d('0x3a')](db[_0x1d7d('0x36')][_0x1d7d('0xa7')]);_0x3e1d91[_0x1d7d('0x39')]=_[_0x1d7d('0x3a')](_0x4d6bc7[_0x1d7d('0x39')]);_0x3e1d91[_0x1d7d('0x3b')]=_[_0x1d7d('0x3c')](_0x3e1d91[_0x1d7d('0x3d')],_0x3e1d91[_0x1d7d('0x39')]);_0x3b69fa[_0x1d7d('0x3f')]=_['intersection'](_0x3e1d91[_0x1d7d('0x3d')],qs[_0x1d7d('0x3e')](_0x4d6bc7['query'][_0x1d7d('0x3e')]));_0x3b69fa[_0x1d7d('0x3f')]=_0x3b69fa[_0x1d7d('0x3f')][_0x1d7d('0x40')]?_0x3b69fa[_0x1d7d('0x3f')]:_0x3e1d91[_0x1d7d('0x3d')];if(_0x4d6bc7[_0x1d7d('0x39')][_0x1d7d('0xa8')]){_0x3b69fa[_0x1d7d('0xa9')]=[{'all':!![]}];}_0x3b69fa=_[_0x1d7d('0xaa')]({},_0x3b69fa,_0x4d6bc7['options']);return db[_0x1d7d('0x36')][_0x1d7d('0x5c')](_0x3b69fa)[_0x1d7d('0x27')](handleEntityNotFound(_0x15d0e3,null))[_0x1d7d('0x27')](respondWithResult(_0x15d0e3,null))[_0x1d7d('0x33')](handleError(_0x15d0e3,null));};exports[_0x1d7d('0xab')]=function(_0x50fb02,_0x4b3382){return db[_0x1d7d('0x36')]['create'](_0x50fb02[_0x1d7d('0x6c')],{})[_0x1d7d('0x27')](respondWithResult(_0x4b3382,0xc9))[_0x1d7d('0x33')](handleError(_0x4b3382,null));};exports['update']=function(_0x4cdd71,_0x4fce35){if(_0x4cdd71[_0x1d7d('0x6c')]['id']){delete _0x4cdd71['body']['id'];}return db['OpenchannelInteraction'][_0x1d7d('0x5c')]({'where':{'id':_0x4cdd71[_0x1d7d('0xa6')]['id']}})[_0x1d7d('0x27')](handleEntityNotFound(_0x4fce35,null))[_0x1d7d('0x27')](saveUpdates(_0x4cdd71[_0x1d7d('0x6c')],null))['then'](respondWithResult(_0x4fce35,null))[_0x1d7d('0x33')](handleError(_0x4fce35,null));};exports['destroy']=function(_0x47aa39,_0x1045e6){return db[_0x1d7d('0x36')][_0x1d7d('0x5c')]({'where':{'id':_0x47aa39['params']['id']}})[_0x1d7d('0x27')](handleEntityNotFound(_0x1045e6,null))[_0x1d7d('0x27')](removeEntity(_0x1045e6,null))[_0x1d7d('0x33')](handleError(_0x1045e6,null));};exports[_0x1d7d('0xac')]=function(_0x160250,_0x36a611){return db['OpenchannelInteraction'][_0x1d7d('0xac')]()[_0x1d7d('0x27')](respondWithResult(_0x36a611,null))['catch'](handleError(_0x36a611,null));};exports[_0x1d7d('0xad')]=function(_0x5a1fbc,_0x5f042f,_0x43b894){return db['OpenchannelMessage'][_0x1d7d('0x5c')]({'where':{'id':_0x5a1fbc[_0x1d7d('0xa6')]['id']}})[_0x1d7d('0x27')](handleEntityNotFound(_0x5f042f,null))['then'](function(_0xdebdff){if(_0xdebdff){return _0xdebdff['addMessage'](_0x5a1fbc[_0x1d7d('0x6c')]['ids'],_[_0x1d7d('0xae')](_0x5a1fbc['body'],[_0x1d7d('0xaf'),'id'])||{});}})['then'](respondWithResult(_0x5f042f,null))[_0x1d7d('0x33')](handleError(_0x5f042f,null));};exports[_0x1d7d('0xb0')]=function(_0x33f525,_0x2edef2,_0xfc87b8){var _0x1de8e3={'raw':![],'where':{}};var _0x3125e3={};var _0x510f59={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x1d7d('0xb1')]({'where':{'id':_0x33f525[_0x1d7d('0xa6')]['id']}})['then'](handleEntityNotFound(_0x2edef2,null))[_0x1d7d('0x27')](function(_0xe837ca){if(_0xe837ca){_0x3125e3['model']=_[_0x1d7d('0x3a')](db[_0x1d7d('0xb2')][_0x1d7d('0xa7')]);_0x3125e3[_0x1d7d('0x39')]=_[_0x1d7d('0x3a')](_0x33f525[_0x1d7d('0x39')]);_0x3125e3[_0x1d7d('0x3b')]=_[_0x1d7d('0x3c')](_0x3125e3['model'],_0x3125e3[_0x1d7d('0x39')]);_0x1de8e3[_0x1d7d('0x3f')]=_[_0x1d7d('0x3c')](_0x3125e3[_0x1d7d('0x3d')],qs[_0x1d7d('0x3e')](_0x33f525[_0x1d7d('0x39')]['fields']));_0x1de8e3[_0x1d7d('0x3f')]=_0x1de8e3['attributes']['length']?_0x1de8e3[_0x1d7d('0x3f')]:_0x3125e3['model'];if(!_0x33f525['query'][_0x1d7d('0xb3')](_0x1d7d('0xb4'))){_0x1de8e3[_0x1d7d('0x20')]=qs[_0x1d7d('0x20')](_0x33f525[_0x1d7d('0x39')][_0x1d7d('0x20')]);_0x1de8e3[_0x1d7d('0x1f')]=qs[_0x1d7d('0x1f')](_0x33f525[_0x1d7d('0x39')][_0x1d7d('0x1f')]);}_0x1de8e3[_0x1d7d('0x41')]=qs[_0x1d7d('0x42')](_0x33f525[_0x1d7d('0x39')][_0x1d7d('0x42')]);_0x1de8e3['where']=qs[_0x1d7d('0x3b')](_[_0x1d7d('0x44')](_0x33f525['query'],_0x3125e3[_0x1d7d('0x3b')]));_0x1de8e3[_0x1d7d('0x43')][_0x1d7d('0xa3')]=_0xe837ca['id'];if(_0x33f525[_0x1d7d('0x39')]['filter']){_0x1de8e3[_0x1d7d('0x43')]=_['merge'](_0x1de8e3['where'],{'$or':_[_0x1d7d('0x35')](_0x1de8e3['attributes'],function(_0x5c5c88){var _0x561bfa={};_0x561bfa[_0x5c5c88]={'$like':'%'+_0x33f525['query']['filter']+'%'};return _0x561bfa;})});}if(_0x33f525[_0x1d7d('0x39')][_0x1d7d('0xb5')]){var _0x5d7ff4=_0x33f525['query'][_0x1d7d('0xb5')][_0x1d7d('0x30')](',');var _0x3c6ba3={};_0x3c6ba3[_0x5d7ff4[0x0]]={'$gte':moment(_0x5d7ff4[0x1])[_0x1d7d('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1de8e3[_0x1d7d('0x43')]=_[_0x1d7d('0xaa')](_0x1de8e3[_0x1d7d('0x43')],_0x3c6ba3);}_0x1de8e3=_[_0x1d7d('0xaa')]({},_0x1de8e3,_0x33f525['options']);return db['OpenchannelMessage']['count']({'where':_0x1de8e3[_0x1d7d('0x43')]})['then'](function(_0x2fd8f9){_0x510f59[_0x1d7d('0x1e')]=_0x2fd8f9;if(_0x33f525['query'][_0x1d7d('0xa8')]){_0x1de8e3[_0x1d7d('0xa9')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x1d7d('0xb7')](_0x1de8e3);})[_0x1d7d('0x27')](function(_0x5a4584){_0x510f59[_0x1d7d('0xa5')]=_0x5a4584;return _0x510f59;});}})[_0x1d7d('0x27')](respondWithFilteredResult(_0x2edef2,_0x1de8e3))[_0x1d7d('0x33')](handleError(_0x2edef2,null));};exports[_0x1d7d('0xb8')]=function(_0x4df7f1,_0x8ab367,_0x388eed){return db[_0x1d7d('0x36')]['find']({'where':{'id':_0x4df7f1['params']['id']}})[_0x1d7d('0x27')](handleEntityNotFound(_0x8ab367,null))[_0x1d7d('0x27')](function(_0x4bd6d4){if(_0x4bd6d4){return _0x4bd6d4[_0x1d7d('0xb9')](_0x4df7f1['body'][_0x1d7d('0xaf')],_[_0x1d7d('0xae')](_0x4df7f1[_0x1d7d('0x6c')],[_0x1d7d('0xaf'),'id'])||{})[_0x1d7d('0xba')](function(){return db[_0x1d7d('0x69')][_0x1d7d('0xb7')]({'attributes':['id','name',_0x1d7d('0x47')],'where':{'id':_0x4df7f1['body'][_0x1d7d('0xaf')]}});})[_0x1d7d('0x27')](function(_0x18f66e){socket[_0x1d7d('0xbb')](_0x1d7d('0xbc'),{'id':Number(_0x4df7f1[_0x1d7d('0xa6')]['id']),'tags':_0x18f66e||[]});return{'id':Number(_0x4df7f1[_0x1d7d('0xa6')]['id']),'tags':_0x18f66e||[]};});}})['then'](respondWithResult(_0x8ab367,null))[_0x1d7d('0x33')](handleError(_0x8ab367,null));};exports[_0x1d7d('0xbd')]=function(_0x11d274,_0x1d3c41,_0x2a4dff){return db[_0x1d7d('0x36')]['find']({'where':{'id':_0x11d274[_0x1d7d('0xa6')]['id']}})[_0x1d7d('0x27')](handleEntityNotFound(_0x1d3c41,null))[_0x1d7d('0x27')](function(_0x1a0ed7){if(_0x1a0ed7){return _0x1a0ed7[_0x1d7d('0xbd')](_0x11d274[_0x1d7d('0x39')]['ids']);}})[_0x1d7d('0x27')](respondWithStatusCode(_0x1d3c41,null))['catch'](handleError(_0x1d3c41,null));};exports['download']=function(_0x309f70,_0x3fb880){var _0x5875e9=moment()[_0x1d7d('0xbe')]()[_0x1d7d('0x8e')]();var _0x2f6905=path[_0x1d7d('0xbf')](config[_0x1d7d('0xc0')],_0x1d7d('0xc1'),'files','tmp');var _0x1fabc4=path[_0x1d7d('0xbf')](config['root'],_0x1d7d('0xc1'),'files',_0x1d7d('0xc2'));var _0x231514=path[_0x1d7d('0xbf')](_0x2f6905,_0x5875e9);var _0x4aad1e=util['format'](_0x1d7d('0xc3'),_0x309f70[_0x1d7d('0xa6')]['id'],_0x5875e9);var _0x5cb5cf=path[_0x1d7d('0xbf')](_0x2f6905,_0x4aad1e);var _0x2aa73e=[];_0x2aa73e['push']({'model':db[_0x1d7d('0x6a')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x2aa73e[_0x1d7d('0x32')]({'model':db['CmContact'],'as':_0x1d7d('0xc4'),'attributes':['id',_0x1d7d('0xc5'),_0x1d7d('0xc6')],'raw':!![]});if(_0x309f70[_0x1d7d('0x39')][_0x1d7d('0xc2')]){_0x2aa73e['push']({'model':db[_0x1d7d('0xc7')],'as':_0x1d7d('0xc7'),'raw':!![]});}var _0x3cd80e=[{'model':db['OpenchannelMessage'],'as':_0x1d7d('0xc8'),'attributes':['id',_0x1d7d('0x6c'),_0x1d7d('0xc9'),_0x1d7d('0xca'),_0x1d7d('0xcb'),_0x1d7d('0xcc')],'include':_0x2aa73e}];_0x3cd80e[_0x1d7d('0x32')]({'model':db[_0x1d7d('0xcd')],'as':_0x1d7d('0xce'),'attributes':['id',_0x1d7d('0x2b')]});_0x3cd80e[_0x1d7d('0x32')]({'model':db[_0x1d7d('0x6a')],'as':'Owner','attributes':['id',_0x1d7d('0xcf')]});return db[_0x1d7d('0x36')][_0x1d7d('0x5c')]({'where':{'id':_0x309f70['params']['id']},'include':_0x3cd80e})[_0x1d7d('0x27')](handleEntityNotFound(_0x3fb880,null))[_0x1d7d('0x27')](function(_0x383325){if(_0x383325){var _0x4a7cf2=_0x383325[_0x1d7d('0xd0')]({'plain':!![]});fs[_0x1d7d('0xd1')](_0x231514);var _0x1830b3={'format':'A4','border':_0x1d7d('0xd2'),'header':{'height':_0x1d7d('0xd3'),'contents':{'first':_0x1d7d('0xd4')}},'footer':{'height':_0x1d7d('0xd5'),'contents':{'default':util[_0x1d7d('0xb6')](_0x1d7d('0xd6'),util[_0x1d7d('0xb6')](_0x1d7d('0xd7'),_0x1d7d('0xd8'),_0x4a7cf2['id']),moment()[_0x1d7d('0xb6')](_0x1d7d('0xd9'))[_0x1d7d('0x8e')]())}}};var _0x126e8c={'channel':_0x1d7d('0xd8'),'account':_0x4a7cf2[_0x1d7d('0xce')][_0x1d7d('0x2b')],'agent':_0x4a7cf2['Owner']?_0x4a7cf2[_0x1d7d('0xda')][_0x1d7d('0xcf')]:'N.A.','createdAt':moment(_0x4a7cf2[_0x1d7d('0xc9')])[_0x1d7d('0xb6')](_0x1d7d('0xdb'))[_0x1d7d('0x8e')](),'closedAt':_0x4a7cf2[_0x1d7d('0xdc')]?moment(_0x4a7cf2[_0x1d7d('0xdd')])['format'](_0x1d7d('0xdb'))[_0x1d7d('0x8e')]():'','disposition':_0x4a7cf2[_0x1d7d('0xde')],'visibility':_0x4a7cf2['threadId']?_0x1d7d('0xdf'):_0x1d7d('0xe0'),'messages':_(_0x4a7cf2[_0x1d7d('0xc8')])[_0x1d7d('0x7a')]({'secret':![]})[_0x1d7d('0x35')](function(_0x589ba3){if(_0x589ba3[_0x1d7d('0xc7')]){var _0x22d273=path[_0x1d7d('0xbf')](_0x1fabc4,_0x589ba3[_0x1d7d('0xc7')][_0x1d7d('0xe1')]);if(fs[_0x1d7d('0xe2')](_0x22d273)){fs['createReadStream'](_0x22d273)[_0x1d7d('0xe3')](fs[_0x1d7d('0xe4')](path['join'](_0x231514,_0x589ba3[_0x1d7d('0xc7')][_0x1d7d('0xe1')])));}}return{'date':moment(_0x589ba3[_0x1d7d('0xc9')])['format'](_0x1d7d('0xdb'))[_0x1d7d('0x8e')](),'sender':_0x589ba3[_0x1d7d('0xca')]===_0x1d7d('0xe5')?_0x589ba3['User']?_0x589ba3[_0x1d7d('0x6a')]['fullname']:_0x1d7d('0xe6'):_0x589ba3[_0x1d7d('0xc4')][_0x1d7d('0xc5')]+(_0x589ba3[_0x1d7d('0xc4')][_0x1d7d('0xc6')]?'\x20'+_0x589ba3[_0x1d7d('0xc4')]['lastName']:''),'body':_0x589ba3[_0x1d7d('0xc7')]?_0x589ba3[_0x1d7d('0xc7')][_0x1d7d('0xe1')]:_0x589ba3['body'],'direction':_0x589ba3[_0x1d7d('0xca')]==='out'?'A':'C','secret':_0x589ba3[_0x1d7d('0xcb')],'read':_0x589ba3[_0x1d7d('0xcc')],'attachment':_0x589ba3[_0x1d7d('0xc7')]};})[_0x1d7d('0x63')]()};return ejs[_0x1d7d('0xe7')](path[_0x1d7d('0xbf')](config[_0x1d7d('0xc0')],_0x1d7d('0xc1'),_0x1d7d('0xe8'),'downloadInteraction.html'),{'interaction':_0x126e8c})[_0x1d7d('0x27')](function(_0xe84f17){return new BPromise(function(_0x30d6f2,_0x3350f2){pdf[_0x1d7d('0xab')](_0xe84f17,_0x1830b3)[_0x1d7d('0xe9')](path[_0x1d7d('0xbf')](_0x231514,_0x1d7d('0xea')+_0x4a7cf2['id']+'-'+_0x5875e9+_0x1d7d('0xeb')),function(_0x1ab96f,_0x2ea470){if(_0x1ab96f)return _0x3350f2(_0x1ab96f);_0x30d6f2(_0x2ea470);});});})[_0x1d7d('0x27')](function(){return new BPromise(function(_0x38b54d,_0x4284be){zipdir(_0x231514,{'saveTo':_0x5cb5cf},function(_0x24575f,_0x1fc44e){if(_0x24575f)return _0x4284be(_0x24575f);return _0x38b54d(_0x1fc44e);});})['then'](function(){return new BPromise(function(_0x8ee79d,_0x1c5669){rimraf(_0x231514,function(_0x4859bc){if(_0x4859bc)_0x1c5669(_0x4859bc);return _0x8ee79d();});});})[_0x1d7d('0x27')](function(){return _0x3fb880[_0x1d7d('0xec')](_0x5cb5cf,_0x4aad1e,function(_0x4d9a8d){if(_0x4d9a8d){console[_0x1d7d('0xed')]('err',_0x4d9a8d);}else{fs['unlinkSync'](_0x5cb5cf);}});});});}else{return _0x3fb880[_0x1d7d('0x28')](0xc8);}})[_0x1d7d('0x33')](handleError(_0x3fb880,null));}; \ No newline at end of file +var _0x96c3=['%s\x20#%d','Openchannel','YYYY-MM-DD','N.A.','closed','threadId','Public','Private','Messages','basename','existsSync','createReadStream','createWriteStream','out','firstName','secret','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','end','status','offset','limit','set','apply','save','update','then','destroy','error','name','send','map','fullname','TagIds','forEach','Tags','push','catch','index','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','tools_tags','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','OpenchannelAccountId','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','count','keyBy','OpenchannelInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','show','params','keys','includeAll','include','merge','options','create','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','Tag','emit','removeTags','download','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','lastName','Attachment','direction','OpenchannelAccount','Account','Owner','mkdirSync','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'];(function(_0x16cf52,_0x2e9f35){var _0x499446=function(_0x442a7e){while(--_0x442a7e){_0x16cf52['push'](_0x16cf52['shift']());}};_0x499446(++_0x2e9f35);}(_0x96c3,0x1df));var _0x396c=function(_0x53203c,_0x38e41c){_0x53203c=_0x53203c-0x0;var _0x364a18=_0x96c3[_0x53203c];return _0x364a18;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x396c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x396c('0x1'));var jsonpatch=require(_0x396c('0x2'));var rp=require('request-promise');var moment=require(_0x396c('0x3'));var BPromise=require(_0x396c('0x4'));var Mustache=require(_0x396c('0x5'));var util=require(_0x396c('0x6'));var path=require('path');var sox=require(_0x396c('0x7'));var csv=require('to-csv');var ejs=require(_0x396c('0x8'));var fs=require('fs');var _=require(_0x396c('0x9'));var squel=require(_0x396c('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x396c('0xb'));var toCsv=require(_0x396c('0xc'));var querystring=require(_0x396c('0xd'));var Papa=require(_0x396c('0xe'));var Redis=require('ioredis');var authService=require(_0x396c('0xf'));var qs=require(_0x396c('0x10'));var as=require(_0x396c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x396c('0x12'))(_0x396c('0x13'));var utils=require(_0x396c('0x14'));var config=require(_0x396c('0x15'));var db=require(_0x396c('0x16'))['db'];config[_0x396c('0x17')]=_[_0x396c('0x18')](config[_0x396c('0x17')],{'host':_0x396c('0x19'),'port':0x18eb});var socket=require(_0x396c('0x1a'))(new Redis(config[_0x396c('0x17')]));require(_0x396c('0x1b'))['register'](socket);function respondWithStatusCode(_0xf02c06,_0x273bd8){_0x273bd8=_0x273bd8||0xcc;return function(_0x46ff24){if(_0x46ff24){return _0xf02c06[_0x396c('0x1c')](_0x273bd8);}return _0xf02c06['status'](_0x273bd8)[_0x396c('0x1d')]();};}function respondWithResult(_0x56f1cf,_0x5282f6){_0x5282f6=_0x5282f6||0xc8;return function(_0x4ab11e){if(_0x4ab11e){return _0x56f1cf[_0x396c('0x1e')](_0x5282f6)['json'](_0x4ab11e);}};}function respondWithFilteredResult(_0x5ce77d,_0x262976){return function(_0x502f88){if(_0x502f88){var _0x1d1897=_0x502f88['count'],_0x543902=_0x262976[_0x396c('0x1f')],_0xf384ba=_0x262976['offset']+_0x262976[_0x396c('0x20')],_0x54aa0e;if(_0xf384ba>=_0x1d1897){_0xf384ba=_0x1d1897;_0x54aa0e=0xc8;}else{_0x54aa0e=0xce;}_0x5ce77d[_0x396c('0x1e')](_0x54aa0e);return _0x5ce77d[_0x396c('0x21')]('Content-Range',_0x543902+'-'+_0xf384ba+'/'+_0x1d1897)['json'](_0x502f88);}return null;};}function patchUpdates(_0x4177aa){return function(_0xe03dea){try{jsonpatch[_0x396c('0x22')](_0xe03dea,_0x4177aa,!![]);}catch(_0x2c66f9){return BPromise['reject'](_0x2c66f9);}return _0xe03dea[_0x396c('0x23')]();};}function saveUpdates(_0x662a5a,_0x3f4736){return function(_0x506678){if(_0x506678){return _0x506678[_0x396c('0x24')](_0x662a5a)[_0x396c('0x25')](function(_0x4de2c3){return _0x4de2c3;});}return null;};}function removeEntity(_0xb8d546,_0x282f77){return function(_0x7af5b9){if(_0x7af5b9){return _0x7af5b9[_0x396c('0x26')]()['then'](function(){_0xb8d546[_0x396c('0x1e')](0xcc)[_0x396c('0x1d')]();});}};}function handleEntityNotFound(_0x5af2ae,_0x133bb4){return function(_0x171844){if(!_0x171844){_0x5af2ae[_0x396c('0x1c')](0x194);}return _0x171844;};}function handleError(_0x15d35d,_0x36ba7e){_0x36ba7e=_0x36ba7e||0x1f4;return function(_0x316ed2){logger[_0x396c('0x27')](_0x316ed2['stack']);if(_0x316ed2[_0x396c('0x28')]){delete _0x316ed2['name'];}_0x15d35d[_0x396c('0x1e')](_0x36ba7e)[_0x396c('0x29')](_0x316ed2);};}function getInteractionUsers(_0x70dd2e,_0x39ccf9){return new BPromise(function(_0x5cab62,_0x1ac9e1){try{if(_0x39ccf9[_0x70dd2e['id']]){_0x70dd2e['Users']=_[_0x396c('0x2a')](_0x39ccf9[_0x70dd2e['id']],function(_0x1698b5){return{'id':_0x1698b5['id'],'fullname':_0x1698b5[_0x396c('0x2b')]};});}}catch(_0x48a342){_0x1ac9e1(_0x48a342);}_0x5cab62(_0x70dd2e);});}function getInteractionTags(_0x170c1b,_0x2bb8cd){return new BPromise(function(_0x5b7e20,_0x17e57a){try{if(_0x170c1b['TagIds']){_0x170c1b['Tags']=[];_0x170c1b[_0x396c('0x2c')]['split'](',')[_0x396c('0x2d')](function(_0x469346){_0x170c1b[_0x396c('0x2e')][_0x396c('0x2f')](_0x2bb8cd[_0x469346]);});}delete _0x170c1b['TagIds'];}catch(_0x402660){_0x17e57a(_0x402660);}_0x5b7e20(_0x170c1b);});}function updateOpenchannelInteraction(_0x1be202,_0x8d0761,_0x4ccbe2){return new BPromise(function(_0x2162a3,_0x23e8d9){return getInteractionUsers(_0x1be202,_0x4ccbe2)['then'](function(_0x401266){return getInteractionTags(_0x401266,_0x8d0761);})[_0x396c('0x25')](function(_0x522256){_0x2162a3(_0x522256);})[_0x396c('0x30')](function(_0x109b98){_0x23e8d9(_0x109b98);});});}exports[_0x396c('0x31')]=function(_0x234c4e,_0x18521f){var _0x21dfe4={},_0x387683={},_0x5ae218={'count':0x0,'rows':[]};var _0x1076bc=_['map'](db['OpenchannelInteraction'][_0x396c('0x32')],function(_0x2a3b44){return{'name':_0x2a3b44['fieldName'],'type':_0x2a3b44[_0x396c('0x33')][_0x396c('0x34')]};});_0x387683[_0x396c('0x35')]=_[_0x396c('0x2a')](_0x1076bc,_0x396c('0x28'));_0x387683[_0x396c('0x36')]=_['keys'](_0x234c4e[_0x396c('0x36')]);_0x387683[_0x396c('0x37')]=_[_0x396c('0x38')](_0x387683['model'],_0x387683['query']);_0x21dfe4['attributes']=_['intersection'](_0x387683['model'],qs[_0x396c('0x39')](_0x234c4e[_0x396c('0x36')][_0x396c('0x39')]));_0x21dfe4[_0x396c('0x3a')]=_0x21dfe4[_0x396c('0x3a')][_0x396c('0x3b')]?_0x21dfe4[_0x396c('0x3a')]:_0x387683[_0x396c('0x35')];if(!_0x234c4e[_0x396c('0x36')][_0x396c('0x3c')](_0x396c('0x3d'))){_0x21dfe4[_0x396c('0x20')]=qs[_0x396c('0x20')](_0x234c4e['query'][_0x396c('0x20')]);_0x21dfe4[_0x396c('0x1f')]=qs[_0x396c('0x1f')](_0x234c4e[_0x396c('0x36')]['offset']);}_0x21dfe4[_0x396c('0x3e')]=qs['sort'](_0x234c4e[_0x396c('0x36')][_0x396c('0x3f')]);_0x21dfe4[_0x396c('0x40')]=qs[_0x396c('0x37')](_['pick'](_0x234c4e[_0x396c('0x36')],_0x387683[_0x396c('0x37')]));var _0x1bb4f3=[];var _0x1b0bcd=squel[_0x396c('0x41')]()['field']('id')[_0x396c('0x42')]('name')['field'](_0x396c('0x43'))[_0x396c('0x44')](_0x396c('0x45'));var _0x1560ea=squel[_0x396c('0x41')]()[_0x396c('0x42')]('u.id')[_0x396c('0x42')]('u.fullname')[_0x396c('0x42')]('ui.OpenchannelInteractionId')[_0x396c('0x44')]('user_has_openchannel_interactions','ui')[_0x396c('0x46')]('users','u',_0x396c('0x47'));var _0x40523f=squel['select']()[_0x396c('0x44')](_0x396c('0x48'),'i')['left_join'](_0x396c('0x49'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x396c('0x46')]('users','o',_0x396c('0x4a'))[_0x396c('0x46')]('openchannel_accounts','a',_0x396c('0x4b'))['left_join']('openchannel_messages','me',_0x396c('0x4c'))['left_join'](_0x396c('0x4d'),'it',_0x396c('0x4e'))[_0x396c('0x46')](_0x396c('0x45'),'t',_0x396c('0x4f'));var _0x2a9dd1=squel[_0x396c('0x50')]();var _0x54eda5=[];var _0xedc53a=squel[_0x396c('0x50')]();var _0x29a71e;if(_0x234c4e['query'][_0x396c('0x51')]){_0x29a71e=as[_0x396c('0x52')](_0x234c4e['query'][_0x396c('0x51')]);var _0x122b27=_0x29a71e[_0x396c('0x53')];for(var _0x192848=0x0;_0x192848<_0x29a71e[_0x396c('0x54')][_0x396c('0x3b')];_0x192848++){var _0xc0dc5e=_0x29a71e['conditions'][_0x192848];var _0x3fe3e9='i';var _0x419cc8=_[_0x396c('0x55')](_0x1076bc,[_0x396c('0x28'),_0xc0dc5e[_0x396c('0x42')]]);if(!_0x419cc8){switch(_0xc0dc5e['field']){case _0x396c('0x56'):if(_0xc0dc5e[_0x396c('0x57')]==0x1){_0x40523f[_0x396c('0x58')]('`'+_0xc0dc5e['field']+_0x396c('0x59'));}else{_0x40523f['having']('`'+_0xc0dc5e[_0x396c('0x42')]+_0x396c('0x5a'));}break;case _0x396c('0x5b'):if(_0xc0dc5e[_0x396c('0x5c')]===_0x396c('0x5d')){if(_0xc0dc5e['value']['split']('\x20')[_0x396c('0x3b')]>0x1){_0x2a9dd1[_0x122b27](_0x396c('0x5e'),qs['getFullTextValue'](_0xc0dc5e[_0x396c('0x57')]),null);}else{var _0x461964='%'+_0xc0dc5e[_0x396c('0x57')]+'%';_0x2a9dd1[_0x122b27](_0x396c('0x5f'),_0x461964,_0x461964,_0x461964);}}else{_0x419cc8=_[_0x396c('0x55')](_0x1076bc,[_0x396c('0x28'),_0x396c('0x60')]);_0xc0dc5e[_0x396c('0x42')]='ContactId';_0x46938f=as[_0x396c('0x61')](_0x3fe3e9,_0x419cc8['type'],_0xc0dc5e);_0x2a9dd1[_0x122b27](_0x46938f[_0x396c('0x62')],_0x46938f[_0x396c('0x57')][_0x396c('0x63')],_0x46938f[_0x396c('0x57')][_0x396c('0x1d')]);}break;case'Tag':var _0x446c3e=_0xc0dc5e[_0x396c('0x57')][_0x396c('0x64')](',')[_0x396c('0x2a')](function(_0x23f525){return Number(_0x23f525);});_0x446c3e[_0x396c('0x2d')](function(_0x148ac7){_0xedc53a['or'](_0x396c('0x65'),'%,'+_0x148ac7+',%');});_0x54eda5=_[_0x396c('0x66')](_0x54eda5,_0x446c3e);break;case _0x396c('0x67'):if(_0xc0dc5e[_0x396c('0x5c')]===_0x396c('0x5d')){_0x2a9dd1[_0x122b27](_0x396c('0x68'),'%'+_0xc0dc5e[_0x396c('0x57')]+'%',null);}else{_0x419cc8=_[_0x396c('0x55')](_0x1076bc,[_0x396c('0x28'),_0x396c('0x69')]);_0xc0dc5e[_0x396c('0x42')]=_0x396c('0x69');_0x46938f=as[_0x396c('0x61')](_0x3fe3e9,_0x419cc8[_0x396c('0x33')],_0xc0dc5e);_0x2a9dd1[_0x122b27](_0x46938f[_0x396c('0x62')],_0x46938f[_0x396c('0x57')]['start'],_0x46938f[_0x396c('0x57')][_0x396c('0x1d')]);}break;case _0x396c('0x6a'):_0x46938f=as[_0x396c('0x61')]('me',null,_0xc0dc5e);_0x2a9dd1[_0x122b27](_0x46938f[_0x396c('0x62')],_0x46938f[_0x396c('0x57')]['start'],_0x46938f[_0x396c('0x57')]['end']);break;}}else{var _0x46938f=as[_0x396c('0x61')](_0x3fe3e9,_0x419cc8[_0x396c('0x33')],_0xc0dc5e);_0x2a9dd1[_0x122b27](_0x46938f[_0x396c('0x62')],_0x46938f[_0x396c('0x57')]['start'],_0x46938f[_0x396c('0x57')][_0x396c('0x1d')]);}}}else{var _0xecf2c4=_(_0x234c4e[_0x396c('0x36')])['keys']()[_0x396c('0x2a')](function(_0x58f31e){return _[_0x396c('0x6b')](_0x1076bc,[_0x396c('0x28'),_0x58f31e])?_0x58f31e:undefined;})[_0x396c('0x6c')]()[_0x396c('0x57')]();if(!_[_0x396c('0x6d')](_0xecf2c4)){_0xecf2c4[_0x396c('0x2d')](function(_0x45ff9e){if(_0x45ff9e===_0x396c('0x6e')){_0x40523f[_0x396c('0x40')]('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x234c4e[_0x396c('0x36')][_0x45ff9e]));}else if(_0x45ff9e===_0x396c('0x6f')){var _0x4f6bf0=JSON[_0x396c('0x70')](_0x234c4e['query'][_0x45ff9e])['$gte'];var _0x530a9d=JSON[_0x396c('0x70')](_0x234c4e[_0x396c('0x36')][_0x45ff9e])[_0x396c('0x71')];_0x40523f[_0x396c('0x40')](_0x396c('0x72'),_0x4f6bf0,_0x530a9d);}else{if(_0x234c4e[_0x396c('0x36')][_0x45ff9e]===_0x396c('0x73')){_0x40523f[_0x396c('0x40')]('i.'+_0x45ff9e+_0x396c('0x74'));}else{_0x40523f[_0x396c('0x40')]('i.'+_0x45ff9e+_0x396c('0x75'),_0x234c4e['query'][_0x45ff9e]);}}});}if(_0x234c4e['query'][_0x396c('0x76')]){if(_0x234c4e[_0x396c('0x36')]['read']==0x1){_0x40523f[_0x396c('0x58')](_0x396c('0x77'));}else{_0x40523f['having'](_0x396c('0x78'));}}if(_0x234c4e[_0x396c('0x36')][_0x396c('0x79')]){_0x54eda5=_[_0x396c('0x7a')](_0x234c4e[_0x396c('0x36')][_0x396c('0x79')])?_0x234c4e['query']['tag']:new Array(_0x234c4e[_0x396c('0x36')][_0x396c('0x79')]);_0x54eda5[_0x396c('0x2d')](function(_0x31751d){_0xedc53a['or'](_0x396c('0x65'),'%,'+_0x31751d+',%');});}if(_0x234c4e['query'][_0x396c('0x7b')]){var _0x2aaf1f=_0x234c4e[_0x396c('0x36')][_0x396c('0x7b')][_0x396c('0x7c')]('\x5c','\x5c\x5c')[_0x396c('0x7c')]('\x27\x27',_0x396c('0x7d'));if(qs['isNumeric'](_0x2aaf1f)){_0x2a9dd1['or'](_0x396c('0x7e'),_0x2aaf1f+'%');}else{_0x2a9dd1['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x396c('0x7f')](_0x2aaf1f))['or']('i.from\x20LIKE\x20?',_0x2aaf1f+'%')['or'](_0x396c('0x80'),_0x2aaf1f+'%');}}}_0x40523f[_0x396c('0x40')](_0x2a9dd1);_0x40523f[_0x396c('0x81')](_0x396c('0x82'));var _0x3df885={'type':db[_0x396c('0x83')][_0x396c('0x84')][_0x396c('0x85')],'raw':!![]};var _0x506246=_0x40523f[_0x396c('0x86')]();_0x506246[_0x396c('0x42')](_0x396c('0x82'));_0x506246[_0x396c('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x396c('0x56'));if(_0x21dfe4[_0x396c('0x3e')]){_0x21dfe4[_0x396c('0x3e')]['forEach'](function(_0x2b3653){_0x40523f[_0x396c('0x3e')]('i.'+_0x2b3653[0x0],_0x2b3653[0x1]===_0x396c('0x87')?![]:!![]);});}if(!_[_0x396c('0x6d')](_0x54eda5)){_0x40523f[_0x396c('0x58')](_0xedc53a);_0x506246[_0x396c('0x40')]('t.id\x20IN\x20?',_0x54eda5);}BPromise['resolve']()[_0x396c('0x25')](function(){if(!_0x29a71e){if(_0x234c4e[_0x396c('0x36')]['OpenchannelAccountId']||_0x234c4e['query'][_0x396c('0x88')])return;_0x506246[_0x396c('0x40')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x40523f[_0x396c('0x40')](_0x396c('0x89'));return;}return _0x234c4e[_0x396c('0x8a')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x396c('0x25')](function(_0x53b365){if(_[_0x396c('0x6d')](_0x53b365)){_0x506246['where'](_0x396c('0x8b'));_0x40523f[_0x396c('0x40')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x506246['where'](_0x396c('0x8c'),_[_0x396c('0x2a')](_0x53b365,'id'));_0x40523f[_0x396c('0x40')](_0x396c('0x8c'),_[_0x396c('0x2a')](_0x53b365,'id'));}});})[_0x396c('0x25')](function(){db[_0x396c('0x8d')]['query'](_0x506246[_0x396c('0x8e')](),_0x3df885)[_0x396c('0x25')](function(_0x56d03a){_0x5ae218[_0x396c('0x8f')]=_0x56d03a[_0x396c('0x3b')];if(_0x5ae218[_0x396c('0x8f')]===0x0)return[];return db['sequelize'][_0x396c('0x36')](_0x1b0bcd[_0x396c('0x8e')](),_0x3df885)['then'](function(_0x531700){_0x1bb4f3=_[_0x396c('0x90')](_0x531700,'id');_0x3df885=_['merge'](_0x3df885,{'model':db[_0x396c('0x91')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x234c4e[_0x396c('0x36')]['fields']){_0x21dfe4['attributes'][_0x396c('0x2d')](function(_0x305b1b){_0x40523f[_0x396c('0x42')]('i.'+_0x305b1b);});}else{_0x40523f[_0x396c('0x42')](_0x396c('0x92'),'unreadMessages');_0x40523f[_0x396c('0x42')](_0x396c('0x93'),_0x396c('0x94'));_0x40523f[_0x396c('0x42')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x40523f[_0x396c('0x42')](_0x396c('0x95'));_0x40523f[_0x396c('0x42')]('c.firstName',_0x396c('0x96'));_0x40523f[_0x396c('0x42')](_0x396c('0x97'),_0x396c('0x98'));_0x40523f[_0x396c('0x42')]('c.email',_0x396c('0x99'));_0x40523f['field'](_0x396c('0x9a'),_0x396c('0x9b'));_0x40523f[_0x396c('0x42')](_0x396c('0x9c'),_0x396c('0x9d'));_0x40523f[_0x396c('0x42')](_0x396c('0x9e'),'Contact.fax');_0x40523f['field'](_0x396c('0x9f'),'Owner.fullname');_0x40523f[_0x396c('0x42')]('o.internal','Owner.internal');_0x40523f[_0x396c('0x42')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x396c('0x2c'));}_0x40523f[_0x396c('0x20')](_0x21dfe4[_0x396c('0x20')]);_0x40523f[_0x396c('0x1f')](_0x21dfe4['offset']);return db[_0x396c('0x8d')][_0x396c('0x36')](_0x40523f['toString'](),_0x3df885);})[_0x396c('0x25')](function(_0x353b51){_0x1560ea[_0x396c('0x40')](_0x396c('0xa0'),_[_0x396c('0x2a')](_0x353b51,'id'));return db[_0x396c('0x8d')]['query'](_0x1560ea[_0x396c('0x8e')](),_0x3df885)[_0x396c('0x25')](function(_0x11348e){var _0xdc164d=_['groupBy'](_0x11348e,_0x396c('0xa1'));var _0xa33ce9=[];_0x353b51['forEach'](function(_0x5af23c){_0xa33ce9[_0x396c('0x2f')](updateOpenchannelInteraction(_0x5af23c,_0x1bb4f3,_0xdc164d));});return BPromise[_0x396c('0xa2')](_0xa33ce9);});});})[_0x396c('0x25')](function(_0x3718c8){_0x5ae218[_0x396c('0xa3')]=_0x3718c8;return _0x5ae218;})[_0x396c('0x25')](respondWithFilteredResult(_0x18521f,_0x21dfe4));})['catch'](handleError(_0x18521f,null));};exports[_0x396c('0xa4')]=function(_0x43760b,_0x598a8a){var _0x166764={'raw':![],'where':{'id':_0x43760b[_0x396c('0xa5')]['id']}},_0xedec14={};_0xedec14['model']=_['keys'](db[_0x396c('0x91')][_0x396c('0x32')]);_0xedec14['query']=_[_0x396c('0xa6')](_0x43760b[_0x396c('0x36')]);_0xedec14[_0x396c('0x37')]=_[_0x396c('0x38')](_0xedec14['model'],_0xedec14[_0x396c('0x36')]);_0x166764[_0x396c('0x3a')]=_[_0x396c('0x38')](_0xedec14[_0x396c('0x35')],qs[_0x396c('0x39')](_0x43760b[_0x396c('0x36')][_0x396c('0x39')]));_0x166764[_0x396c('0x3a')]=_0x166764[_0x396c('0x3a')][_0x396c('0x3b')]?_0x166764[_0x396c('0x3a')]:_0xedec14[_0x396c('0x35')];if(_0x43760b[_0x396c('0x36')][_0x396c('0xa7')]){_0x166764[_0x396c('0xa8')]=[{'all':!![]}];}_0x166764=_[_0x396c('0xa9')]({},_0x166764,_0x43760b[_0x396c('0xaa')]);return db[_0x396c('0x91')][_0x396c('0x55')](_0x166764)[_0x396c('0x25')](handleEntityNotFound(_0x598a8a,null))['then'](respondWithResult(_0x598a8a,null))[_0x396c('0x30')](handleError(_0x598a8a,null));};exports[_0x396c('0xab')]=function(_0x4c0a0d,_0x1f57fb){return db[_0x396c('0x91')][_0x396c('0xab')](_0x4c0a0d[_0x396c('0x6a')],{})[_0x396c('0x25')](respondWithResult(_0x1f57fb,0xc9))[_0x396c('0x30')](handleError(_0x1f57fb,null));};exports[_0x396c('0x24')]=function(_0xc019a0,_0x3721a7){if(_0xc019a0[_0x396c('0x6a')]['id']){delete _0xc019a0[_0x396c('0x6a')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0xc019a0[_0x396c('0xa5')]['id']}})[_0x396c('0x25')](handleEntityNotFound(_0x3721a7,null))[_0x396c('0x25')](saveUpdates(_0xc019a0['body'],null))[_0x396c('0x25')](respondWithResult(_0x3721a7,null))[_0x396c('0x30')](handleError(_0x3721a7,null));};exports['destroy']=function(_0x45fc99,_0x1c8d3c){return db['OpenchannelInteraction'][_0x396c('0x55')]({'where':{'id':_0x45fc99['params']['id']}})[_0x396c('0x25')](handleEntityNotFound(_0x1c8d3c,null))[_0x396c('0x25')](removeEntity(_0x1c8d3c,null))['catch'](handleError(_0x1c8d3c,null));};exports['describe']=function(_0x22f5de,_0x3e41bf){return db[_0x396c('0x91')][_0x396c('0xac')]()['then'](respondWithResult(_0x3e41bf,null))[_0x396c('0x30')](handleError(_0x3e41bf,null));};exports[_0x396c('0xad')]=function(_0x5ecf80,_0xbd0548,_0x2a4728){return db['OpenchannelMessage'][_0x396c('0x55')]({'where':{'id':_0x5ecf80[_0x396c('0xa5')]['id']}})['then'](handleEntityNotFound(_0xbd0548,null))[_0x396c('0x25')](function(_0x4bf3e9){if(_0x4bf3e9){return _0x4bf3e9[_0x396c('0xad')](_0x5ecf80[_0x396c('0x6a')][_0x396c('0xae')],_[_0x396c('0xaf')](_0x5ecf80[_0x396c('0x6a')],[_0x396c('0xae'),'id'])||{});}})[_0x396c('0x25')](respondWithResult(_0xbd0548,null))['catch'](handleError(_0xbd0548,null));};exports[_0x396c('0xb0')]=function(_0x18c1fd,_0x1c49fb,_0x1e3efd){var _0x20d241={'raw':![],'where':{}};var _0x23ce58={};var _0x284a10={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x396c('0xb1')]({'where':{'id':_0x18c1fd[_0x396c('0xa5')]['id']}})[_0x396c('0x25')](handleEntityNotFound(_0x1c49fb,null))['then'](function(_0x4230a9){if(_0x4230a9){_0x23ce58[_0x396c('0x35')]=_[_0x396c('0xa6')](db[_0x396c('0xb2')][_0x396c('0x32')]);_0x23ce58[_0x396c('0x36')]=_['keys'](_0x18c1fd[_0x396c('0x36')]);_0x23ce58['filters']=_[_0x396c('0x38')](_0x23ce58[_0x396c('0x35')],_0x23ce58[_0x396c('0x36')]);_0x20d241[_0x396c('0x3a')]=_[_0x396c('0x38')](_0x23ce58[_0x396c('0x35')],qs[_0x396c('0x39')](_0x18c1fd[_0x396c('0x36')][_0x396c('0x39')]));_0x20d241['attributes']=_0x20d241['attributes'][_0x396c('0x3b')]?_0x20d241[_0x396c('0x3a')]:_0x23ce58['model'];if(!_0x18c1fd[_0x396c('0x36')][_0x396c('0x3c')](_0x396c('0x3d'))){_0x20d241['limit']=qs[_0x396c('0x20')](_0x18c1fd[_0x396c('0x36')][_0x396c('0x20')]);_0x20d241[_0x396c('0x1f')]=qs[_0x396c('0x1f')](_0x18c1fd[_0x396c('0x36')][_0x396c('0x1f')]);}_0x20d241[_0x396c('0x3e')]=qs[_0x396c('0x3f')](_0x18c1fd[_0x396c('0x36')][_0x396c('0x3f')]);_0x20d241[_0x396c('0x40')]=qs[_0x396c('0x37')](_['pick'](_0x18c1fd['query'],_0x23ce58['filters']));_0x20d241[_0x396c('0x40')][_0x396c('0xa1')]=_0x4230a9['id'];if(_0x18c1fd[_0x396c('0x36')][_0x396c('0x7b')]){_0x20d241[_0x396c('0x40')]=_['merge'](_0x20d241[_0x396c('0x40')],{'$or':_[_0x396c('0x2a')](_0x20d241[_0x396c('0x3a')],function(_0x36fd9c){var _0x4eb4ac={};_0x4eb4ac[_0x36fd9c]={'$like':'%'+_0x18c1fd[_0x396c('0x36')][_0x396c('0x7b')]+'%'};return _0x4eb4ac;})});}if(_0x18c1fd['query'][_0x396c('0xb3')]){var _0x10d14d=_0x18c1fd[_0x396c('0x36')]['$gte']['split'](',');var _0x56b521={};_0x56b521[_0x10d14d[0x0]]={'$gte':moment(_0x10d14d[0x1])[_0x396c('0xb4')](_0x396c('0xb5'))};_0x20d241['where']=_[_0x396c('0xa9')](_0x20d241[_0x396c('0x40')],_0x56b521);}_0x20d241=_[_0x396c('0xa9')]({},_0x20d241,_0x18c1fd[_0x396c('0xaa')]);return db['OpenchannelMessage'][_0x396c('0x8f')]({'where':_0x20d241['where']})[_0x396c('0x25')](function(_0x40bee5){_0x284a10[_0x396c('0x8f')]=_0x40bee5;if(_0x18c1fd[_0x396c('0x36')][_0x396c('0xa7')]){_0x20d241[_0x396c('0xa8')]=[{'all':!![]}];}return db[_0x396c('0xb2')][_0x396c('0xb6')](_0x20d241);})[_0x396c('0x25')](function(_0x4990d6){_0x284a10[_0x396c('0xa3')]=_0x4990d6;return _0x284a10;});}})[_0x396c('0x25')](respondWithFilteredResult(_0x1c49fb,_0x20d241))[_0x396c('0x30')](handleError(_0x1c49fb,null));};exports[_0x396c('0xb7')]=function(_0x103d6d,_0x1d73db,_0x33b331){return db[_0x396c('0x91')]['find']({'where':{'id':_0x103d6d[_0x396c('0xa5')]['id']}})['then'](handleEntityNotFound(_0x1d73db,null))[_0x396c('0x25')](function(_0x22c5ac){if(_0x22c5ac){return _0x22c5ac[_0x396c('0xb8')](_0x103d6d['body'][_0x396c('0xae')],_[_0x396c('0xaf')](_0x103d6d['body'],['ids','id'])||{})['spread'](function(){return db[_0x396c('0xb9')][_0x396c('0xb6')]({'attributes':['id',_0x396c('0x28'),_0x396c('0x43')],'where':{'id':_0x103d6d[_0x396c('0x6a')][_0x396c('0xae')]}});})[_0x396c('0x25')](function(_0x5bef09){socket[_0x396c('0xba')]('openchannelInteractionTags:save',{'id':Number(_0x103d6d[_0x396c('0xa5')]['id']),'tags':_0x5bef09||[]});return{'id':Number(_0x103d6d['params']['id']),'tags':_0x5bef09||[]};});}})[_0x396c('0x25')](respondWithResult(_0x1d73db,null))[_0x396c('0x30')](handleError(_0x1d73db,null));};exports[_0x396c('0xbb')]=function(_0x301eb2,_0x367e1b,_0x2b82da){return db[_0x396c('0x91')]['find']({'where':{'id':_0x301eb2['params']['id']}})['then'](handleEntityNotFound(_0x367e1b,null))[_0x396c('0x25')](function(_0x308d90){if(_0x308d90){return _0x308d90[_0x396c('0xbb')](_0x301eb2[_0x396c('0x36')][_0x396c('0xae')]);}})[_0x396c('0x25')](respondWithStatusCode(_0x367e1b,null))['catch'](handleError(_0x367e1b,null));};exports[_0x396c('0xbc')]=function(_0x10b3f4,_0x11b66c){var _0x536910=moment()['unix']()[_0x396c('0x8e')]();var _0x2f542f=path[_0x396c('0xbd')](config[_0x396c('0xbe')],_0x396c('0xbf'),'files',_0x396c('0xc0'));var _0x3745cd=path[_0x396c('0xbd')](config['root'],_0x396c('0xbf'),_0x396c('0xc1'),_0x396c('0xc2'));var _0x4f94ff=path[_0x396c('0xbd')](_0x2f542f,_0x536910);var _0x4a14c2=util[_0x396c('0xb4')](_0x396c('0xc3'),_0x10b3f4[_0x396c('0xa5')]['id'],_0x536910);var _0x47bfb5=path[_0x396c('0xbd')](_0x2f542f,_0x4a14c2);var _0x2325f0=[];_0x2325f0[_0x396c('0x2f')]({'model':db[_0x396c('0x67')],'as':_0x396c('0x67'),'attributes':['id','fullname'],'raw':!![]});_0x2325f0['push']({'model':db['CmContact'],'as':_0x396c('0x5b'),'attributes':['id','firstName',_0x396c('0xc4')],'raw':!![]});if(_0x10b3f4[_0x396c('0x36')][_0x396c('0xc2')]){_0x2325f0['push']({'model':db[_0x396c('0xc5')],'as':_0x396c('0xc5'),'raw':!![]});}var _0x25a907=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0x396c('0x6a'),_0x396c('0x6f'),_0x396c('0xc6'),'secret',_0x396c('0x76')],'include':_0x2325f0}];_0x25a907[_0x396c('0x2f')]({'model':db[_0x396c('0xc7')],'as':_0x396c('0xc8'),'attributes':['id',_0x396c('0x28')]});_0x25a907['push']({'model':db['User'],'as':_0x396c('0xc9'),'attributes':['id',_0x396c('0x2b')]});return db[_0x396c('0x91')]['find']({'where':{'id':_0x10b3f4['params']['id']},'include':_0x25a907})[_0x396c('0x25')](handleEntityNotFound(_0x11b66c,null))[_0x396c('0x25')](function(_0x4367f3){if(_0x4367f3){var _0x10c032=_0x4367f3['get']({'plain':!![]});fs[_0x396c('0xca')](_0x4f94ff);var _0x1daba2={'format':'A4','border':_0x396c('0xcb'),'header':{'height':'40px','contents':{'first':_0x396c('0xcc')}},'footer':{'height':'30px','contents':{'default':util[_0x396c('0xb4')]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util[_0x396c('0xb4')](_0x396c('0xcd'),_0x396c('0xce'),_0x10c032['id']),moment()[_0x396c('0xb4')](_0x396c('0xcf'))['toString']())}}};var _0x2e1fb6={'channel':_0x396c('0xce'),'account':_0x10c032['Account']['name'],'agent':_0x10c032[_0x396c('0xc9')]?_0x10c032[_0x396c('0xc9')]['fullname']:_0x396c('0xd0'),'createdAt':moment(_0x10c032[_0x396c('0x6f')])[_0x396c('0xb4')](_0x396c('0xb5'))[_0x396c('0x8e')](),'closedAt':_0x10c032[_0x396c('0xd1')]?moment(_0x10c032['closedAt'])[_0x396c('0xb4')](_0x396c('0xb5'))[_0x396c('0x8e')]():'','disposition':_0x10c032['disposition'],'visibility':_0x10c032[_0x396c('0xd2')]?_0x396c('0xd3'):_0x396c('0xd4'),'messages':_(_0x10c032[_0x396c('0xd5')])['filter']({'secret':![]})[_0x396c('0x2a')](function(_0x16c216){if(_0x16c216['Attachment']){var _0xa35601=path['join'](_0x3745cd,_0x16c216[_0x396c('0xc5')][_0x396c('0xd6')]);if(fs[_0x396c('0xd7')](_0xa35601)){fs[_0x396c('0xd8')](_0xa35601)['pipe'](fs[_0x396c('0xd9')](path['join'](_0x4f94ff,_0x16c216[_0x396c('0xc5')]['basename'])));}}return{'date':moment(_0x16c216[_0x396c('0x6f')])[_0x396c('0xb4')](_0x396c('0xb5'))[_0x396c('0x8e')](),'sender':_0x16c216['direction']===_0x396c('0xda')?_0x16c216[_0x396c('0x67')]?_0x16c216['User'][_0x396c('0x2b')]:'System':_0x16c216['Contact'][_0x396c('0xdb')]+(_0x16c216[_0x396c('0x5b')][_0x396c('0xc4')]?'\x20'+_0x16c216['Contact'][_0x396c('0xc4')]:''),'body':_0x16c216[_0x396c('0xc5')]?_0x16c216[_0x396c('0xc5')][_0x396c('0xd6')]:_0x16c216[_0x396c('0x6a')],'direction':_0x16c216[_0x396c('0xc6')]===_0x396c('0xda')?'A':'C','secret':_0x16c216[_0x396c('0xdc')],'read':_0x16c216[_0x396c('0x76')],'attachment':_0x16c216[_0x396c('0xc5')]};})[_0x396c('0x57')]()};return ejs[_0x396c('0xdd')](path[_0x396c('0xbd')](config['root'],_0x396c('0xbf'),_0x396c('0xde'),_0x396c('0xdf')),{'interaction':_0x2e1fb6})[_0x396c('0x25')](function(_0x1a80d2){return new BPromise(function(_0x3d708d,_0x14638f){pdf[_0x396c('0xab')](_0x1a80d2,_0x1daba2)[_0x396c('0xe0')](path[_0x396c('0xbd')](_0x4f94ff,_0x396c('0xe1')+_0x10c032['id']+'-'+_0x536910+_0x396c('0xe2')),function(_0x59fb40,_0x414671){if(_0x59fb40)return _0x14638f(_0x59fb40);_0x3d708d(_0x414671);});});})[_0x396c('0x25')](function(){return new BPromise(function(_0x4d8d32,_0x59359c){zipdir(_0x4f94ff,{'saveTo':_0x47bfb5},function(_0x561d2b,_0x40dc05){if(_0x561d2b)return _0x59359c(_0x561d2b);return _0x4d8d32(_0x40dc05);});})[_0x396c('0x25')](function(){return new BPromise(function(_0x29acbb,_0x4123b2){rimraf(_0x4f94ff,function(_0x23a865){if(_0x23a865)_0x4123b2(_0x23a865);return _0x29acbb();});});})[_0x396c('0x25')](function(){return _0x11b66c[_0x396c('0xbc')](_0x47bfb5,_0x4a14c2,function(_0xc130e3){if(_0xc130e3){console[_0x396c('0xe3')]('err',_0xc130e3);}else{fs['unlinkSync'](_0x47bfb5);}});});});}else{return _0x11b66c[_0x396c('0x1c')](0xc8);}})[_0x396c('0x30')](handleError(_0x11b66c,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 85593c5..83ade80 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 _0x01d5=['setDataValue','map','findAll','unreadMessages','emit','hook','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x01d5,0x14a));var _0x501d=function(_0x127ddb,_0x5bf93c){_0x127ddb=_0x127ddb-0x0;var _0x41e2ec=_0x01d5[_0x127ddb];return _0x41e2ec;};'use strict';var EventEmitter=require(_0x501d('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x501d('0x1')];var OpenchannelMessage=require(_0x501d('0x2'))['db'][_0x501d('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x501d('0x4')](0x0);var events={'afterCreate':_0x501d('0x5'),'afterUpdate':_0x501d('0x6'),'afterDestroy':_0x501d('0x7')};function emitEvent(_0x84c83b){return function(_0x254682,_0x2ed160,_0x263ff9){_0x254682[_0x501d('0x8')]({'attributes':['id'],'raw':!![]})[_0x501d('0x9')](function(_0x41e211){_0x254682[_0x501d('0xa')]('Users',_0x41e211[_0x501d('0xb')](function(_0x5280e4){return{'id':_0x5280e4['id']};}));return OpenchannelMessage[_0x501d('0xc')]({'where':{'OpenchannelInteractionId':_0x254682['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x18ded5){_0x254682['setDataValue'](_0x501d('0xd'),_0x18ded5['length']);OpenchannelInteractionEvents[_0x501d('0xe')](_0x84c83b+':'+_0x254682['id'],_0x254682);OpenchannelInteractionEvents[_0x501d('0xe')](_0x84c83b,_0x254682);_0x263ff9(null);})['catch'](_0x263ff9(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x501d('0xf')](e,emitEvent(event));}}module[_0x501d('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x8547=['remove','getUsers','Users','map','findAll','then','unreadMessages','emit','hook','exports','events','../../mysqldb','save','update'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8547,0xa4));var _0x7854=function(_0x2766b7,_0x406429){_0x2766b7=_0x2766b7-0x0;var _0x39f4dd=_0x8547[_0x2766b7];return _0x39f4dd;};'use strict';var EventEmitter=require(_0x7854('0x0'));var OpenchannelInteraction=require(_0x7854('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x7854('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7854('0x2'),'afterUpdate':_0x7854('0x3'),'afterDestroy':_0x7854('0x4')};function emitEvent(_0x2b915d){return function(_0x39ace7,_0x4fffa6,_0x22bc4d){_0x39ace7[_0x7854('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3cbc80){_0x39ace7['setDataValue'](_0x7854('0x6'),_0x3cbc80[_0x7854('0x7')](function(_0x1d1d5c){return{'id':_0x1d1d5c['id']};}));return OpenchannelMessage[_0x7854('0x8')]({'where':{'OpenchannelInteractionId':_0x39ace7['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7854('0x9')](function(_0x28fab4){_0x39ace7['setDataValue'](_0x7854('0xa'),_0x28fab4['length']);OpenchannelInteractionEvents[_0x7854('0xb')](_0x2b915d+':'+_0x39ace7['id'],_0x39ace7);OpenchannelInteractionEvents[_0x7854('0xb')](_0x2b915d,_0x39ace7);_0x22bc4d(null);})['catch'](_0x22bc4d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x7854('0xc')](e,emitEvent(event));}}module[_0x7854('0xd')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 14208f3..b45613e 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 _0x0fda=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4b62e5,_0x1a65a5){var _0x4ba736=function(_0x348d45){while(--_0x348d45){_0x4b62e5['push'](_0x4b62e5['shift']());}};_0x4ba736(++_0x1a65a5);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x467d59,_0x5c1bd5){_0x467d59=_0x467d59-0x0;var _0x10fc2a=_0x0fda[_0x467d59];return _0x10fc2a;};'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('./openchannelInteraction.attributes');module[_0xa0fd('0x8')]=function(_0x4aec58,_0x49b3c1){return _0x4aec58[_0xa0fd('0x9')](_0xa0fd('0xa'),attributes,{'tableName':_0xa0fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x248cca,_0x5d996b,_0x29da4c){if(_0x248cca[_0xa0fd('0xc')](_0xa0fd('0xd'))){_0x248cca[_0xa0fd('0xe')]=moment()['format'](_0xa0fd('0xf'));}_0x29da4c(null,_0x248cca);}}});}; \ No newline at end of file +var _0xf69d=['request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x340a11,_0x72d301){var _0x4ad9fb=function(_0x3b47f6){while(--_0x3b47f6){_0x340a11['push'](_0x340a11['shift']());}};_0x4ad9fb(++_0x72d301);}(_0xf69d,0xd3));var _0xdf69=function(_0x19f0e9,_0x551022){_0x19f0e9=_0x19f0e9-0x0;var _0x3cb193=_0xf69d[_0x19f0e9];return _0x3cb193;};'use strict';var _=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var logger=require(_0xdf69('0x2'))(_0xdf69('0x3'));var moment=require(_0xdf69('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf69('0x5'));var fs=require('fs');var path=require(_0xdf69('0x6'));var rimraf=require(_0xdf69('0x7'));var config=require(_0xdf69('0x8'));var attributes=require(_0xdf69('0x9'));module[_0xdf69('0xa')]=function(_0x2d456f,_0x465b1b){return _0x2d456f[_0xdf69('0xb')](_0xdf69('0xc'),attributes,{'tableName':_0xdf69('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc1b77e,_0x38909e,_0x466c26){if(_0xc1b77e[_0xdf69('0xe')](_0xdf69('0xf'))){_0xc1b77e[_0xdf69('0x10')]=moment()['format'](_0xdf69('0x11'));}_0x466c26(null,_0xc1b77e);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index b288277..2c35195 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 _0x2afc=['update','body','options','raw','where','attributes','limit','stringify','AddTagsToOpenchannelInteraction','find','ids','omit','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction'];(function(_0x5c1833,_0x331b4c){var _0x57d38e=function(_0x4e7824){while(--_0x4e7824){_0x5c1833['push'](_0x5c1833['shift']());}};_0x57d38e(++_0x331b4c);}(_0x2afc,0x190));var _0xc2af=function(_0x356127,_0x4873ac){_0x356127=_0x356127-0x0;var _0x5d4c75=_0x2afc[_0x356127];return _0x5d4c75;};'use strict';var _=require(_0xc2af('0x0'));var util=require(_0xc2af('0x1'));var moment=require(_0xc2af('0x2'));var BPromise=require(_0xc2af('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2af('0x4'))['db'];var utils=require(_0xc2af('0x5'));var logger=require('../../config/logger')(_0xc2af('0x6'));var config=require(_0xc2af('0x7'));var jayson=require(_0xc2af('0x8'));var client=jayson[_0xc2af('0x9')][_0xc2af('0xa')]({'port':0x232a});config['redis']=_[_0xc2af('0xb')](config['redis'],{'host':_0xc2af('0xc'),'port':0x18eb});var socket=require(_0xc2af('0xd'))(new Redis(config[_0xc2af('0xe')]));require(_0xc2af('0xf'))[_0xc2af('0x10')](socket);function respondWithRpcPromise(_0x4fcb57,_0x49e4cb,_0x84d4cd){return new BPromise(function(_0x2819aa,_0xaf4007){return client[_0xc2af('0x11')](_0x4fcb57,_0x84d4cd)[_0xc2af('0x12')](function(_0xca4bb4){logger[_0xc2af('0x13')](_0xc2af('0x14'),_0x49e4cb,_0xc2af('0x15'));logger[_0xc2af('0x16')](_0xc2af('0x17'),_0x49e4cb,_0xc2af('0x15'),JSON['stringify'](_0xca4bb4));if(_0xca4bb4['error']){if(_0xca4bb4[_0xc2af('0x18')][_0xc2af('0x19')]===0x1f4){logger[_0xc2af('0x18')](_0xc2af('0x14'),_0x49e4cb,_0xca4bb4['error']['message']);return _0xaf4007(_0xca4bb4[_0xc2af('0x18')][_0xc2af('0x1a')]);}logger['error'](_0xc2af('0x14'),_0x49e4cb,_0xca4bb4[_0xc2af('0x18')][_0xc2af('0x1a')]);return _0x2819aa(_0xca4bb4[_0xc2af('0x18')][_0xc2af('0x1a')]);}else{logger[_0xc2af('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x49e4cb,_0xc2af('0x15'));_0x2819aa(_0xca4bb4['result'][_0xc2af('0x1a')]);}})[_0xc2af('0x1b')](function(_0x3daaa6){logger[_0xc2af('0x18')](_0xc2af('0x14'),_0x49e4cb,_0x3daaa6);_0xaf4007(_0x3daaa6);});});}exports[_0xc2af('0x1c')]=function(_0x3c048c){var _0x515d1f=this;return new Promise(function(_0x204ad9,_0x13f435){return db[_0xc2af('0x1d')][_0xc2af('0x1e')](_0x3c048c[_0xc2af('0x1f')],{'raw':_0x3c048c[_0xc2af('0x20')]?_0x3c048c[_0xc2af('0x20')][_0xc2af('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c048c[_0xc2af('0x20')]?_0x3c048c[_0xc2af('0x20')][_0xc2af('0x22')]||null:null,'attributes':_0x3c048c[_0xc2af('0x20')]?_0x3c048c[_0xc2af('0x20')][_0xc2af('0x23')]||null:null,'limit':_0x3c048c['options']?_0x3c048c[_0xc2af('0x20')][_0xc2af('0x24')]||null:null})[_0xc2af('0x12')](function(_0xeb7e78){logger['info'](_0xc2af('0x1c'),_0x3c048c);logger['debug'](_0xc2af('0x1c'),_0x3c048c,JSON[_0xc2af('0x25')](_0xeb7e78));_0x204ad9(_0xeb7e78);})[_0xc2af('0x1b')](function(_0x4633ae){logger[_0xc2af('0x18')](_0xc2af('0x1c'),_0x4633ae[_0xc2af('0x1a')],_0x3c048c);_0x13f435(_0x515d1f[_0xc2af('0x18')](0x1f4,_0x4633ae[_0xc2af('0x1a')]));});});};exports[_0xc2af('0x26')]=function(_0x3cc150){return new Promise(function(_0x369408,_0x5cc644){return db[_0xc2af('0x1d')][_0xc2af('0x27')]({'where':_0x3cc150['options']?_0x3cc150['options'][_0xc2af('0x22')]||null:null})[_0xc2af('0x12')](function(_0x5e59a4){if(_0x5e59a4){return _0x5e59a4['addTags'](_0x3cc150['body'][_0xc2af('0x28')],_[_0xc2af('0x29')](_0x3cc150['body'],[_0xc2af('0x28'),'id'])||{});}})['spread'](function(_0x251944){logger[_0xc2af('0x13')](_0xc2af('0x2a'),_0x3cc150);logger['debug'](_0xc2af('0x2a'),_0x3cc150,JSON[_0xc2af('0x25')](_0x251944));_0x369408(_0x251944);})['catch'](function(_0x5846bc){logger[_0xc2af('0x18')](_0xc2af('0x2a'),_0x5846bc['message'],_0x3cc150);_0x5cc644(_this[_0xc2af('0x18')](0x1f4,_0x5846bc[_0xc2af('0x1a')]));});});}; \ No newline at end of file +var _0x6309=['spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','message','result','OpenchannelInteraction','update','options','where','limit','UpdateOpenchannelInteraction','stringify','catch','AddTagsToOpenchannelInteraction','addTags','body','ids'];(function(_0x115850,_0x4bb634){var _0xbad084=function(_0xa14074){while(--_0xa14074){_0x115850['push'](_0x115850['shift']());}};_0xbad084(++_0x4bb634);}(_0x6309,0xc5));var _0x9630=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x6309[_0x166d93];return _0xba708;};'use strict';var _=require(_0x9630('0x0'));var util=require(_0x9630('0x1'));var moment=require(_0x9630('0x2'));var BPromise=require(_0x9630('0x3'));var rs=require(_0x9630('0x4'));var fs=require('fs');var Redis=require(_0x9630('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9630('0x6'));var logger=require(_0x9630('0x7'))(_0x9630('0x8'));var config=require(_0x9630('0x9'));var jayson=require(_0x9630('0xa'));var client=jayson['client'][_0x9630('0xb')]({'port':0x232a});config[_0x9630('0xc')]=_[_0x9630('0xd')](config[_0x9630('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9630('0xe'))(new Redis(config[_0x9630('0xc')]));require(_0x9630('0xf'))['register'](socket);function respondWithRpcPromise(_0x2c74da,_0x2742f3,_0x1235f6){return new BPromise(function(_0x301c82,_0xd8b9bc){return client['request'](_0x2c74da,_0x1235f6)[_0x9630('0x10')](function(_0x269982){logger[_0x9630('0x11')](_0x9630('0x12'),_0x2742f3,_0x9630('0x13'));logger[_0x9630('0x14')](_0x9630('0x15'),_0x2742f3,'request\x20sent',JSON['stringify'](_0x269982));if(_0x269982[_0x9630('0x16')]){if(_0x269982[_0x9630('0x16')]['code']===0x1f4){logger[_0x9630('0x16')](_0x9630('0x12'),_0x2742f3,_0x269982[_0x9630('0x16')]['message']);return _0xd8b9bc(_0x269982[_0x9630('0x16')][_0x9630('0x17')]);}logger[_0x9630('0x16')](_0x9630('0x12'),_0x2742f3,_0x269982[_0x9630('0x16')]['message']);return _0x301c82(_0x269982['error'][_0x9630('0x17')]);}else{logger[_0x9630('0x11')](_0x9630('0x12'),_0x2742f3,_0x9630('0x13'));_0x301c82(_0x269982[_0x9630('0x18')][_0x9630('0x17')]);}})['catch'](function(_0x53e381){logger[_0x9630('0x16')](_0x9630('0x12'),_0x2742f3,_0x53e381);_0xd8b9bc(_0x53e381);});});}exports['UpdateOpenchannelInteraction']=function(_0x2f1d9e){var _0x52af3b=this;return new Promise(function(_0x299b5c,_0x38f9ef){return db[_0x9630('0x19')][_0x9630('0x1a')](_0x2f1d9e['body'],{'raw':_0x2f1d9e[_0x9630('0x1b')]?_0x2f1d9e[_0x9630('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f1d9e[_0x9630('0x1b')]?_0x2f1d9e['options'][_0x9630('0x1c')]||null:null,'attributes':_0x2f1d9e[_0x9630('0x1b')]?_0x2f1d9e['options']['attributes']||null:null,'limit':_0x2f1d9e[_0x9630('0x1b')]?_0x2f1d9e[_0x9630('0x1b')][_0x9630('0x1d')]||null:null})['then'](function(_0x51b652){logger[_0x9630('0x11')](_0x9630('0x1e'),_0x2f1d9e);logger[_0x9630('0x14')](_0x9630('0x1e'),_0x2f1d9e,JSON[_0x9630('0x1f')](_0x51b652));_0x299b5c(_0x51b652);})[_0x9630('0x20')](function(_0x3e79a6){logger['error'](_0x9630('0x1e'),_0x3e79a6[_0x9630('0x17')],_0x2f1d9e);_0x38f9ef(_0x52af3b[_0x9630('0x16')](0x1f4,_0x3e79a6['message']));});});};exports[_0x9630('0x21')]=function(_0x6dddb9){return new Promise(function(_0x3a103e,_0x39c148){return db[_0x9630('0x19')]['find']({'where':_0x6dddb9[_0x9630('0x1b')]?_0x6dddb9[_0x9630('0x1b')]['where']||null:null})[_0x9630('0x10')](function(_0x584951){if(_0x584951){return _0x584951[_0x9630('0x22')](_0x6dddb9[_0x9630('0x23')][_0x9630('0x24')],_['omit'](_0x6dddb9[_0x9630('0x23')],[_0x9630('0x24'),'id'])||{});}})[_0x9630('0x25')](function(_0x5b605c){logger[_0x9630('0x11')](_0x9630('0x26'),_0x6dddb9);logger[_0x9630('0x14')](_0x9630('0x26'),_0x6dddb9,JSON[_0x9630('0x1f')](_0x5b605c));_0x3a103e(_0x5b605c);})[_0x9630('0x20')](function(_0x4ce716){logger[_0x9630('0x16')]('AddTags',_0x4ce716['message'],_0x6dddb9);_0x39c148(_this[_0x9630('0x16')](0x1f4,_0x4ce716['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 43eb366..1b240fe 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 _0x4b21=['save','update','removeListener','register','length','./openchannelInteraction.events'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0x4b21,0x8f));var _0x14b2=function(_0x45b5e3,_0x5cb489){_0x45b5e3=_0x45b5e3-0x0;var _0x1dba41=_0x4b21[_0x45b5e3];return _0x1dba41;};'use strict';var OpenchannelInteractionEvents=require(_0x14b2('0x0'));var events=[_0x14b2('0x1'),'remove',_0x14b2('0x2')];function createListener(_0x263fbb,_0x10680d){return function(_0x1c27f3){_0x10680d['emit'](_0x263fbb,_0x1c27f3);};}function removeListener(_0x3f775f,_0x4173ce){return function(){OpenchannelInteractionEvents[_0x14b2('0x3')](_0x3f775f,_0x4173ce);};}exports[_0x14b2('0x4')]=function(_0x17fba0){for(var _0x18d314=0x0,_0x75f4a1=events[_0x14b2('0x5')];_0x18d314<_0x75f4a1;_0x18d314++){var _0x154e88=events[_0x18d314];var _0x57b19b=createListener('openchannelInteraction:'+_0x154e88,_0x17fba0);OpenchannelInteractionEvents['on'](_0x154e88,_0x57b19b);}}; \ No newline at end of file +var _0x72aa=['remove','update','emit','register','length','./openchannelInteraction.events'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0x72aa,0x101));var _0xa72a=function(_0x233bbb,_0x36dcf4){_0x233bbb=_0x233bbb-0x0;var _0x49fa4c=_0x72aa[_0x233bbb];return _0x49fa4c;};'use strict';var OpenchannelInteractionEvents=require(_0xa72a('0x0'));var events=['save',_0xa72a('0x1'),_0xa72a('0x2')];function createListener(_0x5df8a7,_0x1f525a){return function(_0x3122a5){_0x1f525a[_0xa72a('0x3')](_0x5df8a7,_0x3122a5);};}function removeListener(_0x48c340,_0x5f102b){return function(){OpenchannelInteractionEvents['removeListener'](_0x48c340,_0x5f102b);};}exports[_0xa72a('0x4')]=function(_0x4b4d25){for(var _0x4e5ad8=0x0,_0x3f40f=events[_0xa72a('0x5')];_0x4e5ad8<_0x3f40f;_0x4e5ad8++){var _0x36537b=events[_0x4e5ad8];var _0x4ec92d=createListener('openchannelInteraction:'+_0x36537b,_0x4b4d25);OpenchannelInteractionEvents['on'](_0x36537b,_0x4ec92d);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index a42e1dd..f278693 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 _0x1077=['connect-timeout','express','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','describe','/:id','show','post','openchannelmessage:create','create','put','update','/:id/accept','accept','delete','destroy','exports','multer','util','path'];(function(_0x51bb38,_0x4e57a0){var _0x51c09b=function(_0x3321e2){while(--_0x3321e2){_0x51bb38['push'](_0x51bb38['shift']());}};_0x51c09b(++_0x4e57a0);}(_0x1077,0x105));var _0x7107=function(_0x2db607,_0x4ff2e1){_0x2db607=_0x2db607-0x0;var _0x4c8d24=_0x1077[_0x2db607];return _0x4c8d24;};'use strict';var multer=require(_0x7107('0x0'));var util=require(_0x7107('0x1'));var path=require(_0x7107('0x2'));var timeout=require(_0x7107('0x3'));var express=require(_0x7107('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7107('0x5'));var controller=require(_0x7107('0x6'));router[_0x7107('0x7')]('/',auth[_0x7107('0x8')](),controller['index']);router['get']('/describe',auth[_0x7107('0x8')](),controller[_0x7107('0x9')]);router['get'](_0x7107('0xa'),auth[_0x7107('0x8')](),controller[_0x7107('0xb')]);router[_0x7107('0xc')]('/',auth[_0x7107('0x8')](),interaction['tracked']('openchannel',_0x7107('0xd')),controller[_0x7107('0xe')]);router[_0x7107('0xf')](_0x7107('0xa'),auth[_0x7107('0x8')](),controller[_0x7107('0x10')]);router['put'](_0x7107('0x11'),auth['isAuthenticated'](),controller[_0x7107('0x12')]);router[_0x7107('0xf')]('/:id/reject',auth[_0x7107('0x8')](),controller['reject']);router[_0x7107('0x13')](_0x7107('0xa'),auth[_0x7107('0x8')](),controller[_0x7107('0x14')]);module[_0x7107('0x15')]=router; \ No newline at end of file +var _0x99cb=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports'];(function(_0x211719,_0x18ff9b){var _0x4c2de5=function(_0xd44d8d){while(--_0xd44d8d){_0x211719['push'](_0x211719['shift']());}};_0x4c2de5(++_0x18ff9b);}(_0x99cb,0x68));var _0xb99c=function(_0x22fd41,_0x11c241){_0x22fd41=_0x22fd41-0x0;var _0x1088c6=_0x99cb[_0x22fd41];return _0x1088c6;};'use strict';var multer=require(_0xb99c('0x0'));var util=require(_0xb99c('0x1'));var path=require(_0xb99c('0x2'));var timeout=require(_0xb99c('0x3'));var express=require(_0xb99c('0x4'));var router=express[_0xb99c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb99c('0x6'));var config=require(_0xb99c('0x7'));var controller=require(_0xb99c('0x8'));router[_0xb99c('0x9')]('/',auth['isAuthenticated'](),controller[_0xb99c('0xa')]);router[_0xb99c('0x9')](_0xb99c('0xb'),auth[_0xb99c('0xc')](),controller[_0xb99c('0xd')]);router[_0xb99c('0x9')](_0xb99c('0xe'),auth[_0xb99c('0xc')](),controller[_0xb99c('0xf')]);router[_0xb99c('0x10')]('/',auth[_0xb99c('0xc')](),interaction[_0xb99c('0x11')]('openchannel',_0xb99c('0x12')),controller['create']);router[_0xb99c('0x13')](_0xb99c('0xe'),auth[_0xb99c('0xc')](),controller[_0xb99c('0x14')]);router[_0xb99c('0x13')]('/:id/accept',auth[_0xb99c('0xc')](),controller[_0xb99c('0x15')]);router[_0xb99c('0x13')](_0xb99c('0x16'),auth[_0xb99c('0xc')](),controller['reject']);router[_0xb99c('0x17')](_0xb99c('0xe'),auth[_0xb99c('0xc')](),controller[_0xb99c('0x18')]);module[_0xb99c('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index d0d2fdf..a4b40bd 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 _0x462d=['TEXT','BOOLEAN','out','DATE','sequelize','exports'];(function(_0x4939f8,_0x22180b){var _0x4fb45c=function(_0x72a693){while(--_0x72a693){_0x4939f8['push'](_0x4939f8['shift']());}};_0x4fb45c(++_0x22180b);}(_0x462d,0x76));var _0xd462=function(_0x414277,_0x468702){_0x414277=_0x414277-0x0;var _0x13ff32=_0x462d[_0x414277];return _0x13ff32;};'use strict';var Sequelize=require(_0xd462('0x0'));module[_0xd462('0x1')]={'body':{'type':Sequelize[_0xd462('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd462('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd462('0x4')),'defaultValue':_0xd462('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd462('0x5')]}}; \ No newline at end of file +var _0x36ec=['exports','medium','BOOLEAN','out','DATE','sequelize'];(function(_0x162fc7,_0xbc6136){var _0x56a398=function(_0x3e2308){while(--_0x3e2308){_0x162fc7['push'](_0x162fc7['shift']());}};_0x56a398(++_0xbc6136);}(_0x36ec,0xcb));var _0xc36e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36ec[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc36e('0x0'));module[_0xc36e('0x1')]={'body':{'type':Sequelize['TEXT'](_0xc36e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc36e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc36e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc36e('0x4')),'defaultValue':_0xc36e('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc36e('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 7e192c9..c35d30a 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 _0xb638=['manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','UserId','agent','stringify','null','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','name','index','OpenchannelMessage','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','keys','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','acceptMessage'];(function(_0xc694f7,_0x3c2fea){var _0x44428b=function(_0x19a0d1){while(--_0x19a0d1){_0xc694f7['push'](_0xc694f7['shift']());}};_0x44428b(++_0x3c2fea);}(_0xb638,0x89));var _0x8b63=function(_0x4fd555,_0x36294b){_0x4fd555=_0x4fd555-0x0;var _0xbebac=_0xb638[_0x4fd555];return _0xbebac;};'use strict';var pdf=require(_0x8b63('0x0'));var emlformat=require(_0x8b63('0x1'));var rimraf=require(_0x8b63('0x2'));var zipdir=require(_0x8b63('0x3'));var jsonpatch=require(_0x8b63('0x4'));var rp=require(_0x8b63('0x5'));var moment=require(_0x8b63('0x6'));var BPromise=require(_0x8b63('0x7'));var Mustache=require('mustache');var util=require(_0x8b63('0x8'));var path=require(_0x8b63('0x9'));var sox=require(_0x8b63('0xa'));var csv=require(_0x8b63('0xb'));var ejs=require(_0x8b63('0xc'));var fs=require('fs');var _=require(_0x8b63('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8b63('0xe'));var deskjs=require(_0x8b63('0xf'));var toCsv=require(_0x8b63('0xb'));var querystring=require(_0x8b63('0x10'));var Papa=require(_0x8b63('0x11'));var Redis=require('ioredis');var authService=require(_0x8b63('0x12'));var qs=require(_0x8b63('0x13'));var as=require(_0x8b63('0x14'));var hardwareService=require(_0x8b63('0x15'));var logger=require(_0x8b63('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8b63('0x17'))['db'];config[_0x8b63('0x18')]=_[_0x8b63('0x19')](config[_0x8b63('0x18')],{'host':_0x8b63('0x1a'),'port':0x18eb});var socket=require(_0x8b63('0x1b'))(new Redis(config[_0x8b63('0x18')]));require(_0x8b63('0x1c'))[_0x8b63('0x1d')](socket);var jayson=require(_0x8b63('0x1e'));var client=jayson['client'][_0x8b63('0x1f')]({'port':0x232c});var client9002=jayson[_0x8b63('0x20')][_0x8b63('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x757827,_0x4ca3af,_0x716a48){if(_0x716a48){var _0x577ac4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x577ac4['test'](_0x4ca3af)){return _0x757827;}else{throw new db['Sequelize']['ValidationError'](_0x8b63('0x21'));}}else{return _0x757827;}}function respondWithRpcPromise(_0xb9fe2d,_0x567849,_0x36e74a,_0x47deef){return new BPromise(function(_0xffd7a,_0x547fd7){var _0x48eabf=_0x47deef||client;return _0x48eabf['request'](_0xb9fe2d,_0x36e74a)[_0x8b63('0x22')](function(_0x8d1de9){logger[_0x8b63('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x567849,_0x8b63('0x24'));logger[_0x8b63('0x25')](_0x8b63('0x26'),_0x567849,_0x8b63('0x24'),JSON['stringify'](_0x8d1de9));if(_0x8d1de9['error']){if(_0x8d1de9[_0x8b63('0x27')][_0x8b63('0x28')]===0x1f4){logger['error'](_0x8b63('0x29'),_0x567849,_0x8d1de9[_0x8b63('0x27')][_0x8b63('0x2a')]);return _0x547fd7(_0x8d1de9['error'][_0x8b63('0x2a')]);}logger[_0x8b63('0x27')](_0x8b63('0x29'),_0x567849,_0x8d1de9[_0x8b63('0x27')][_0x8b63('0x2a')]);return _0xffd7a(_0x8d1de9[_0x8b63('0x27')][_0x8b63('0x2a')]);}else{logger['info'](_0x8b63('0x29'),_0x567849,_0x8b63('0x24'));_0xffd7a(_0x8d1de9[_0x8b63('0x2b')][_0x8b63('0x2a')]);}})[_0x8b63('0x2c')](function(_0x23e339){logger[_0x8b63('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x567849,_0x23e339);_0x547fd7(_0x23e339);});});}function respondWithStatusCode(_0x2c224f,_0x51fc70){_0x51fc70=_0x51fc70||0xcc;return function(_0x2a4439){if(_0x2a4439){return _0x2c224f[_0x8b63('0x2d')](_0x51fc70);}return _0x2c224f[_0x8b63('0x2e')](_0x51fc70)[_0x8b63('0x2f')]();};}function respondWithResult(_0x5962d8,_0x299acc){_0x299acc=_0x299acc||0xc8;return function(_0x5244be){if(_0x5244be){return _0x5962d8['status'](_0x299acc)[_0x8b63('0x30')](_0x5244be);}};}function respondWithFilteredResult(_0x308922,_0x2539c2){return function(_0x2e185a){if(_0x2e185a){var _0x1a254c=_0x2e185a[_0x8b63('0x31')],_0x15712e=_0x2539c2[_0x8b63('0x32')],_0x4b5f9f=_0x2539c2[_0x8b63('0x32')]+_0x2539c2[_0x8b63('0x33')],_0x4138e5;if(_0x4b5f9f>=_0x1a254c){_0x4b5f9f=_0x1a254c;_0x4138e5=0xc8;}else{_0x4138e5=0xce;}_0x308922['status'](_0x4138e5);return _0x308922[_0x8b63('0x34')](_0x8b63('0x35'),_0x15712e+'-'+_0x4b5f9f+'/'+_0x1a254c)[_0x8b63('0x30')](_0x2e185a);}return null;};}function patchUpdates(_0x572356){return function(_0x291c7e){try{jsonpatch[_0x8b63('0x36')](_0x291c7e,_0x572356,!![]);}catch(_0x2152be){return BPromise[_0x8b63('0x37')](_0x2152be);}return _0x291c7e['save']();};}function saveUpdates(_0x840ff1,_0x364a89){return function(_0x12044b){if(_0x12044b){return _0x12044b[_0x8b63('0x38')](_0x840ff1)[_0x8b63('0x22')](function(_0x49c967){return _0x49c967;});}return null;};}function removeEntity(_0x39c4af,_0xefe664){return function(_0x46cf99){if(_0x46cf99){return _0x46cf99[_0x8b63('0x39')]()[_0x8b63('0x22')](function(){_0x39c4af[_0x8b63('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d1335,_0x2cc33c){return function(_0x8df566){if(!_0x8df566){_0x3d1335['sendStatus'](0x194);}return _0x8df566;};}function handleError(_0x542f1e,_0xb7e33){_0xb7e33=_0xb7e33||0x1f4;return function(_0x152f51){logger[_0x8b63('0x27')](_0x152f51['stack']);if(_0x152f51[_0x8b63('0x3a')]){delete _0x152f51['name'];}_0x542f1e['status'](_0xb7e33)['send'](_0x152f51);};}exports[_0x8b63('0x3b')]=function(_0x12908f,_0x181a19){var _0x3fe735={},_0x3ed46a={},_0x118f84={'count':0x0,'rows':[]};var _0x1d92a1=_['map'](db[_0x8b63('0x3c')]['rawAttributes'],function(_0x2e4709){return{'name':_0x2e4709[_0x8b63('0x3d')],'type':_0x2e4709[_0x8b63('0x3e')][_0x8b63('0x3f')]};});_0x3ed46a[_0x8b63('0x40')]=_['map'](_0x1d92a1,_0x8b63('0x3a'));_0x3ed46a[_0x8b63('0x41')]=_['keys'](_0x12908f[_0x8b63('0x41')]);_0x3ed46a[_0x8b63('0x42')]=_[_0x8b63('0x43')](_0x3ed46a[_0x8b63('0x40')],_0x3ed46a[_0x8b63('0x41')]);_0x3fe735['attributes']=_[_0x8b63('0x43')](_0x3ed46a[_0x8b63('0x40')],qs[_0x8b63('0x44')](_0x12908f[_0x8b63('0x41')][_0x8b63('0x44')]));_0x3fe735[_0x8b63('0x45')]=_0x3fe735['attributes'][_0x8b63('0x46')]?_0x3fe735[_0x8b63('0x45')]:_0x3ed46a[_0x8b63('0x40')];if(!_0x12908f[_0x8b63('0x41')][_0x8b63('0x47')](_0x8b63('0x48'))){_0x3fe735[_0x8b63('0x33')]=qs[_0x8b63('0x33')](_0x12908f[_0x8b63('0x41')][_0x8b63('0x33')]);_0x3fe735['offset']=qs[_0x8b63('0x32')](_0x12908f[_0x8b63('0x41')][_0x8b63('0x32')]);}_0x3fe735['order']=qs[_0x8b63('0x49')](_0x12908f[_0x8b63('0x41')][_0x8b63('0x49')]);_0x3fe735[_0x8b63('0x4a')]=qs[_0x8b63('0x42')](_[_0x8b63('0x4b')](_0x12908f[_0x8b63('0x41')],_0x3ed46a[_0x8b63('0x42')]));if(_0x12908f[_0x8b63('0x41')]['filter']){_0x3fe735[_0x8b63('0x4a')]=_[_0x8b63('0x4c')](_0x3fe735[_0x8b63('0x4a')],{'$or':_['map'](_0x1d92a1,function(_0x35d8c7){if(_0x35d8c7[_0x8b63('0x3e')]!==_0x8b63('0x4d')){var _0x228910={};_0x228910[_0x35d8c7[_0x8b63('0x3a')]]={'$like':'%'+_0x12908f['query'][_0x8b63('0x4e')]+'%'};return _0x228910;}})});}_0x3fe735=_[_0x8b63('0x4c')]({},_0x3fe735,_0x12908f[_0x8b63('0x4f')]);var _0x414c4e={'where':_0x3fe735[_0x8b63('0x4a')]};return db[_0x8b63('0x3c')][_0x8b63('0x31')](_0x414c4e)[_0x8b63('0x22')](function(_0x4c0737){_0x118f84['count']=_0x4c0737;if(_0x12908f[_0x8b63('0x41')][_0x8b63('0x50')]){_0x3fe735[_0x8b63('0x51')]=[{'all':!![]}];}return db[_0x8b63('0x3c')]['findAll'](_0x3fe735);})[_0x8b63('0x22')](function(_0x4661aa){_0x118f84[_0x8b63('0x52')]=_0x4661aa;return _0x118f84;})[_0x8b63('0x22')](respondWithFilteredResult(_0x181a19,_0x3fe735))['catch'](handleError(_0x181a19,null));};exports[_0x8b63('0x53')]=function(_0x4966d8,_0x212557){var _0x33d464={'raw':!![],'where':{'id':_0x4966d8[_0x8b63('0x54')]['id']}},_0x3af4a0={};_0x3af4a0[_0x8b63('0x40')]=_[_0x8b63('0x55')](db[_0x8b63('0x3c')]['rawAttributes']);_0x3af4a0[_0x8b63('0x41')]=_[_0x8b63('0x55')](_0x4966d8[_0x8b63('0x41')]);_0x3af4a0[_0x8b63('0x42')]=_[_0x8b63('0x43')](_0x3af4a0['model'],_0x3af4a0[_0x8b63('0x41')]);_0x33d464['attributes']=_[_0x8b63('0x43')](_0x3af4a0[_0x8b63('0x40')],qs[_0x8b63('0x44')](_0x4966d8[_0x8b63('0x41')][_0x8b63('0x44')]));_0x33d464[_0x8b63('0x45')]=_0x33d464[_0x8b63('0x45')][_0x8b63('0x46')]?_0x33d464[_0x8b63('0x45')]:_0x3af4a0[_0x8b63('0x40')];if(_0x4966d8[_0x8b63('0x41')][_0x8b63('0x50')]){_0x33d464[_0x8b63('0x51')]=[{'all':!![]}];}_0x33d464=_['merge']({},_0x33d464,_0x4966d8[_0x8b63('0x4f')]);return db[_0x8b63('0x3c')][_0x8b63('0x56')](_0x33d464)[_0x8b63('0x22')](handleEntityNotFound(_0x212557,null))[_0x8b63('0x22')](respondWithResult(_0x212557,null))[_0x8b63('0x2c')](handleError(_0x212557,null));};exports[_0x8b63('0x57')]=function(_0x4dfd42,_0x42d4d0){return db[_0x8b63('0x3c')]['create'](_0x4dfd42['body'],{})['then'](respondWithResult(_0x42d4d0,0xc9))['catch'](handleError(_0x42d4d0,null));};exports[_0x8b63('0x38')]=function(_0x59ad7b,_0x59880f){if(_0x59ad7b[_0x8b63('0x58')]['id']){delete _0x59ad7b[_0x8b63('0x58')]['id'];}return db[_0x8b63('0x3c')][_0x8b63('0x56')]({'where':{'id':_0x59ad7b['params']['id']}})['then'](handleEntityNotFound(_0x59880f,null))[_0x8b63('0x22')](saveUpdates(_0x59ad7b[_0x8b63('0x58')],null))['then'](respondWithResult(_0x59880f,null))[_0x8b63('0x2c')](handleError(_0x59880f,null));};exports[_0x8b63('0x39')]=function(_0x4e08ef,_0x7fd85e){return db[_0x8b63('0x3c')]['find']({'where':{'id':_0x4e08ef[_0x8b63('0x54')]['id']}})['then'](handleEntityNotFound(_0x7fd85e,null))[_0x8b63('0x22')](removeEntity(_0x7fd85e,null))['catch'](handleError(_0x7fd85e,null));};exports[_0x8b63('0x59')]=function(_0x14b36f,_0x194cb3){return db[_0x8b63('0x3c')][_0x8b63('0x59')]()[_0x8b63('0x22')](respondWithResult(_0x194cb3,null))[_0x8b63('0x2c')](handleError(_0x194cb3,null));};var interaction_log=require('../../config/logger')(_0x8b63('0x5a'));exports[_0x8b63('0x5b')]=function(_0x5314e0,_0x3e0119,_0x5b22ca){var _0x4ab37f={'channel':_0x8b63('0x5c')};if(_0x5314e0[_0x8b63('0x58')]['id']){delete _0x5314e0[_0x8b63('0x58')]['id'];}_0x5314e0[_0x8b63('0x58')][_0x8b63('0x5d')]=!![];_0x5314e0[_0x8b63('0x58')][_0x8b63('0x5e')]=moment()[_0x8b63('0x5f')](_0x8b63('0x60'));_0x5314e0[_0x8b63('0x58')]['UserId']=_0x5314e0['body']['UserId']||_0x5314e0['user']['id'];return db[_0x8b63('0x3c')][_0x8b63('0x56')]({'where':{'id':_0x5314e0[_0x8b63('0x54')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x8b63('0x61')}]})[_0x8b63('0x22')](handleEntityNotFound(_0x3e0119,null))[_0x8b63('0x22')](saveUpdates(_0x5314e0[_0x8b63('0x58')],null))[_0x8b63('0x22')](function(_0x3a3e10){if(_0x3a3e10){_0x4ab37f['message']=_0x3a3e10[_0x8b63('0x62')]({'plain':!![]});return db[_0x8b63('0x63')][_0x8b63('0x56')]({'where':{'id':_0x3a3e10[_0x8b63('0x64')]}});}return null;})[_0x8b63('0x22')](handleEntityNotFound(_0x3e0119,null))[_0x8b63('0x22')](function(_0x54d1c7){if(_0x54d1c7){return _0x54d1c7[_0x8b63('0x38')]({'UserId':_0x5314e0[_0x8b63('0x58')]['UserId'],'read1stAt':_[_0x8b63('0x65')](_0x54d1c7[_0x8b63('0x66')])?moment()[_0x8b63('0x5f')](_0x8b63('0x60')):undefined});}return null;})[_0x8b63('0x22')](function(_0x15b2bd){if(_0x15b2bd){_0x4ab37f['interaction']=_0x15b2bd['get']({'plain':!![]});interaction_log[_0x8b63('0x23')](_0x8b63('0x67'),_0x5314e0[_0x8b63('0x68')]['id'],_0x5314e0[_0x8b63('0x68')][_0x8b63('0x3a')],_0x5314e0['user'][_0x8b63('0x69')],_0x4ab37f[_0x8b63('0x6a')]['id'],_0x5314e0[_0x8b63('0x58')]?JSON['stringify'](_0x5314e0[_0x8b63('0x58')]):'null');return respondWithRpcPromise(_0x8b63('0x6b'),_0x8b63('0x6c'),_0x4ab37f);}return null;})[_0x8b63('0x22')](function(_0x579d22){if(_0x579d22){if(_0x5314e0[_0x8b63('0x58')][_0x8b63('0x6d')]){_0x4ab37f[_0x8b63('0x2a')][_0x8b63('0x6e')]=util['format'](_0x8b63('0x6f'),_0x5314e0[_0x8b63('0x68')][_0x8b63('0x3a')]);_0x4ab37f[_0x8b63('0x2a')][_0x8b63('0x70')]=_0x4ab37f['channel'];_0x4ab37f[_0x8b63('0x2a')][_0x8b63('0x71')]=_0x8b63('0x5b');return respondWithRpcPromise(_0x8b63('0x72'),_0x8b63('0x72'),{'event':_0x8b63('0x73'),'message':_0x4ab37f[_0x8b63('0x2a')]},client9002)['then'](function(){return _0x4ab37f;});}return _0x4ab37f;}return null;})['then'](respondWithResult(_0x3e0119,null))['catch'](handleError(_0x3e0119,null));};var interaction_log=require(_0x8b63('0x16'))(_0x8b63('0x5a'));exports[_0x8b63('0x37')]=function(_0x56bb1f,_0x3c057b,_0x3a7441){var _0x309b48={'agent':{},'channel':_0x8b63('0x5c')};if(_0x56bb1f['body']['id']){delete _0x56bb1f[_0x8b63('0x58')]['id'];}_0x56bb1f[_0x8b63('0x58')][_0x8b63('0x74')]=_0x56bb1f['body'][_0x8b63('0x74')]||_0x56bb1f[_0x8b63('0x68')]['id'];_0x309b48[_0x8b63('0x75')]['id']=_0x56bb1f[_0x8b63('0x58')][_0x8b63('0x74')];return db['OpenchannelMessage'][_0x8b63('0x56')]({'where':{'id':_0x56bb1f['params']['id'],'UserId':null}})[_0x8b63('0x22')](handleEntityNotFound(_0x3c057b,null))[_0x8b63('0x22')](function(_0xd6d877){if(_0xd6d877){_0x309b48[_0x8b63('0x2a')]=_0xd6d877[_0x8b63('0x62')]({'plain':!![]});return db[_0x8b63('0x63')]['find']({'where':{'id':_0xd6d877[_0x8b63('0x64')]}});}return null;})[_0x8b63('0x22')](handleEntityNotFound(_0x3c057b,null))[_0x8b63('0x22')](function(_0x3e2634){if(_0x3e2634){_0x309b48[_0x8b63('0x6a')]=_0x3e2634[_0x8b63('0x62')]({'plain':!![]});interaction_log[_0x8b63('0x23')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x56bb1f[_0x8b63('0x68')]['id'],_0x56bb1f[_0x8b63('0x68')][_0x8b63('0x3a')],_0x56bb1f[_0x8b63('0x68')][_0x8b63('0x69')],_0x309b48['interaction']['id'],_0x56bb1f[_0x8b63('0x58')]?JSON[_0x8b63('0x76')](_0x56bb1f[_0x8b63('0x58')]):_0x8b63('0x77'));return respondWithRpcPromise(_0x8b63('0x78'),_0x8b63('0x79'),_0x309b48);}return null;})[_0x8b63('0x22')](function(_0x5ae87a){if(_0x5ae87a){_0x5ae87a[_0x8b63('0x2a')][_0x8b63('0x6e')]=util['format'](_0x8b63('0x6f'),_0x56bb1f['user']['name']);_0x5ae87a[_0x8b63('0x2a')]['channel']=_0x309b48[_0x8b63('0x70')];_0x5ae87a['message'][_0x8b63('0x71')]='reject';respondWithRpcPromise(_0x8b63('0x72'),_0x8b63('0x72'),{'event':_0x8b63('0x7a'),'message':_0x5ae87a[_0x8b63('0x2a')]},client9002);return _0x309b48;}return null;})[_0x8b63('0x22')](respondWithResult(_0x3c057b,null))[_0x8b63('0x2c')](handleError(_0x3c057b,null));}; \ No newline at end of file +var _0x6697=['type','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','OpenchannelMessage','count','includeAll','include','rows','show','intersection','find','create','body','params','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','SIP/%s','channel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','interface','rejectmessage','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','test','Sequelize','ValidationError','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','offset','limit','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x6697,0xb3));var _0x7669=function(_0x3b5587,_0x22a6f4){_0x3b5587=_0x3b5587-0x0;var _0x3fbb62=_0x6697[_0x3b5587];return _0x3fbb62;};'use strict';var pdf=require(_0x7669('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7669('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7669('0x2'));var moment=require(_0x7669('0x3'));var BPromise=require(_0x7669('0x4'));var Mustache=require(_0x7669('0x5'));var util=require(_0x7669('0x6'));var path=require(_0x7669('0x7'));var sox=require(_0x7669('0x8'));var csv=require(_0x7669('0x9'));var ejs=require(_0x7669('0xa'));var fs=require('fs');var _=require(_0x7669('0xb'));var squel=require(_0x7669('0xc'));var crypto=require(_0x7669('0xd'));var jsforce=require(_0x7669('0xe'));var deskjs=require(_0x7669('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7669('0x10'));var Redis=require(_0x7669('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7669('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7669('0x13'))(_0x7669('0x14'));var utils=require(_0x7669('0x15'));var config=require(_0x7669('0x16'));var db=require(_0x7669('0x17'))['db'];config[_0x7669('0x18')]=_[_0x7669('0x19')](config['redis'],{'host':_0x7669('0x1a'),'port':0x18eb});var socket=require(_0x7669('0x1b'))(new Redis(config[_0x7669('0x18')]));require('./openchannelMessage.socket')[_0x7669('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7669('0x1d')][_0x7669('0x1e')]({'port':0x232c});var client9002=jayson[_0x7669('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x3e72ea,_0xb38d7,_0x34743a){if(_0x34743a){var _0x1cda7c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1cda7c[_0x7669('0x1f')](_0xb38d7)){return _0x3e72ea;}else{throw new db[(_0x7669('0x20'))][(_0x7669('0x21'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3e72ea;}}function respondWithRpcPromise(_0x4b9489,_0x269249,_0x3f2cb7,_0x418cf3){return new BPromise(function(_0x4f917d,_0x5e4fb6){var _0x20a5ac=_0x418cf3||client;return _0x20a5ac['request'](_0x4b9489,_0x3f2cb7)[_0x7669('0x22')](function(_0x34fc60){logger[_0x7669('0x23')](_0x7669('0x24'),_0x269249,_0x7669('0x25'));logger[_0x7669('0x26')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x269249,_0x7669('0x25'),JSON[_0x7669('0x27')](_0x34fc60));if(_0x34fc60['error']){if(_0x34fc60[_0x7669('0x28')][_0x7669('0x29')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x269249,_0x34fc60['error'][_0x7669('0x2a')]);return _0x5e4fb6(_0x34fc60[_0x7669('0x28')][_0x7669('0x2a')]);}logger[_0x7669('0x28')](_0x7669('0x24'),_0x269249,_0x34fc60[_0x7669('0x28')][_0x7669('0x2a')]);return _0x4f917d(_0x34fc60['error']['message']);}else{logger[_0x7669('0x23')](_0x7669('0x24'),_0x269249,_0x7669('0x25'));_0x4f917d(_0x34fc60[_0x7669('0x2b')]['message']);}})[_0x7669('0x2c')](function(_0x1279b6){logger[_0x7669('0x28')](_0x7669('0x24'),_0x269249,_0x1279b6);_0x5e4fb6(_0x1279b6);});});}function respondWithStatusCode(_0x5ddbb3,_0x2d5e88){_0x2d5e88=_0x2d5e88||0xcc;return function(_0x1f4211){if(_0x1f4211){return _0x5ddbb3['sendStatus'](_0x2d5e88);}return _0x5ddbb3[_0x7669('0x2d')](_0x2d5e88)[_0x7669('0x2e')]();};}function respondWithResult(_0xbaa653,_0x1efefc){_0x1efefc=_0x1efefc||0xc8;return function(_0x58ee4e){if(_0x58ee4e){return _0xbaa653[_0x7669('0x2d')](_0x1efefc)[_0x7669('0x2f')](_0x58ee4e);}};}function respondWithFilteredResult(_0x2d63ea,_0xe998c3){return function(_0xa8eded){if(_0xa8eded){var _0x51859f=_0xa8eded['count'],_0xc03dde=_0xe998c3[_0x7669('0x30')],_0x5cff54=_0xe998c3[_0x7669('0x30')]+_0xe998c3[_0x7669('0x31')],_0x38b42c;if(_0x5cff54>=_0x51859f){_0x5cff54=_0x51859f;_0x38b42c=0xc8;}else{_0x38b42c=0xce;}_0x2d63ea[_0x7669('0x2d')](_0x38b42c);return _0x2d63ea['set'](_0x7669('0x32'),_0xc03dde+'-'+_0x5cff54+'/'+_0x51859f)[_0x7669('0x2f')](_0xa8eded);}return null;};}function patchUpdates(_0x336f76){return function(_0x5f1151){try{jsonpatch[_0x7669('0x33')](_0x5f1151,_0x336f76,!![]);}catch(_0x479203){return BPromise[_0x7669('0x34')](_0x479203);}return _0x5f1151['save']();};}function saveUpdates(_0x3ee608,_0x349b2b){return function(_0x2a2f6d){if(_0x2a2f6d){return _0x2a2f6d[_0x7669('0x35')](_0x3ee608)[_0x7669('0x22')](function(_0x397956){return _0x397956;});}return null;};}function removeEntity(_0x346e9e,_0x1d6d4f){return function(_0x9a6320){if(_0x9a6320){return _0x9a6320[_0x7669('0x36')]()[_0x7669('0x22')](function(){_0x346e9e['status'](0xcc)[_0x7669('0x2e')]();});}};}function handleEntityNotFound(_0x58f938,_0x43daaf){return function(_0x42b4d0){if(!_0x42b4d0){_0x58f938[_0x7669('0x37')](0x194);}return _0x42b4d0;};}function handleError(_0x4afc8f,_0x1c3964){_0x1c3964=_0x1c3964||0x1f4;return function(_0x3d7286){logger['error'](_0x3d7286[_0x7669('0x38')]);if(_0x3d7286[_0x7669('0x39')]){delete _0x3d7286['name'];}_0x4afc8f[_0x7669('0x2d')](_0x1c3964)[_0x7669('0x3a')](_0x3d7286);};}exports[_0x7669('0x3b')]=function(_0x3b2df6,_0x310cf5){var _0x434908={},_0x2d17f2={},_0x2e160d={'count':0x0,'rows':[]};var _0x57d058=_[_0x7669('0x3c')](db['OpenchannelMessage'][_0x7669('0x3d')],function(_0xcf0dba){return{'name':_0xcf0dba[_0x7669('0x3e')],'type':_0xcf0dba[_0x7669('0x3f')]['key']};});_0x2d17f2[_0x7669('0x40')]=_['map'](_0x57d058,_0x7669('0x39'));_0x2d17f2['query']=_[_0x7669('0x41')](_0x3b2df6[_0x7669('0x42')]);_0x2d17f2[_0x7669('0x43')]=_['intersection'](_0x2d17f2[_0x7669('0x40')],_0x2d17f2[_0x7669('0x42')]);_0x434908[_0x7669('0x44')]=_['intersection'](_0x2d17f2['model'],qs[_0x7669('0x45')](_0x3b2df6[_0x7669('0x42')][_0x7669('0x45')]));_0x434908[_0x7669('0x44')]=_0x434908[_0x7669('0x44')][_0x7669('0x46')]?_0x434908['attributes']:_0x2d17f2[_0x7669('0x40')];if(!_0x3b2df6['query'][_0x7669('0x47')](_0x7669('0x48'))){_0x434908[_0x7669('0x31')]=qs['limit'](_0x3b2df6[_0x7669('0x42')]['limit']);_0x434908[_0x7669('0x30')]=qs[_0x7669('0x30')](_0x3b2df6['query'][_0x7669('0x30')]);}_0x434908['order']=qs[_0x7669('0x49')](_0x3b2df6[_0x7669('0x42')][_0x7669('0x49')]);_0x434908[_0x7669('0x4a')]=qs[_0x7669('0x43')](_['pick'](_0x3b2df6[_0x7669('0x42')],_0x2d17f2[_0x7669('0x43')]));if(_0x3b2df6[_0x7669('0x42')][_0x7669('0x4b')]){_0x434908['where']=_[_0x7669('0x4c')](_0x434908[_0x7669('0x4a')],{'$or':_['map'](_0x57d058,function(_0x21a712){if(_0x21a712[_0x7669('0x3f')]!=='VIRTUAL'){var _0x4bea60={};_0x4bea60[_0x21a712['name']]={'$like':'%'+_0x3b2df6['query'][_0x7669('0x4b')]+'%'};return _0x4bea60;}})});}_0x434908=_[_0x7669('0x4c')]({},_0x434908,_0x3b2df6[_0x7669('0x4d')]);var _0x3d05a7={'where':_0x434908[_0x7669('0x4a')]};return db[_0x7669('0x4e')][_0x7669('0x4f')](_0x3d05a7)[_0x7669('0x22')](function(_0x3a9c15){_0x2e160d[_0x7669('0x4f')]=_0x3a9c15;if(_0x3b2df6[_0x7669('0x42')][_0x7669('0x50')]){_0x434908[_0x7669('0x51')]=[{'all':!![]}];}return db[_0x7669('0x4e')]['findAll'](_0x434908);})[_0x7669('0x22')](function(_0x225e53){_0x2e160d[_0x7669('0x52')]=_0x225e53;return _0x2e160d;})[_0x7669('0x22')](respondWithFilteredResult(_0x310cf5,_0x434908))[_0x7669('0x2c')](handleError(_0x310cf5,null));};exports[_0x7669('0x53')]=function(_0x42e7d0,_0x4b8642){var _0x4ac53f={'raw':!![],'where':{'id':_0x42e7d0['params']['id']}},_0x570bad={};_0x570bad[_0x7669('0x40')]=_['keys'](db[_0x7669('0x4e')]['rawAttributes']);_0x570bad[_0x7669('0x42')]=_[_0x7669('0x41')](_0x42e7d0['query']);_0x570bad[_0x7669('0x43')]=_[_0x7669('0x54')](_0x570bad[_0x7669('0x40')],_0x570bad[_0x7669('0x42')]);_0x4ac53f[_0x7669('0x44')]=_[_0x7669('0x54')](_0x570bad[_0x7669('0x40')],qs[_0x7669('0x45')](_0x42e7d0[_0x7669('0x42')][_0x7669('0x45')]));_0x4ac53f[_0x7669('0x44')]=_0x4ac53f[_0x7669('0x44')]['length']?_0x4ac53f[_0x7669('0x44')]:_0x570bad[_0x7669('0x40')];if(_0x42e7d0[_0x7669('0x42')][_0x7669('0x50')]){_0x4ac53f[_0x7669('0x51')]=[{'all':!![]}];}_0x4ac53f=_[_0x7669('0x4c')]({},_0x4ac53f,_0x42e7d0[_0x7669('0x4d')]);return db['OpenchannelMessage'][_0x7669('0x55')](_0x4ac53f)[_0x7669('0x22')](handleEntityNotFound(_0x4b8642,null))[_0x7669('0x22')](respondWithResult(_0x4b8642,null))['catch'](handleError(_0x4b8642,null));};exports[_0x7669('0x56')]=function(_0x4576b0,_0x3dc24f){return db[_0x7669('0x4e')][_0x7669('0x56')](_0x4576b0[_0x7669('0x57')],{})['then'](respondWithResult(_0x3dc24f,0xc9))[_0x7669('0x2c')](handleError(_0x3dc24f,null));};exports[_0x7669('0x35')]=function(_0x12dd8f,_0x5e7ba9){if(_0x12dd8f['body']['id']){delete _0x12dd8f['body']['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x12dd8f[_0x7669('0x58')]['id']}})[_0x7669('0x22')](handleEntityNotFound(_0x5e7ba9,null))[_0x7669('0x22')](saveUpdates(_0x12dd8f[_0x7669('0x57')],null))[_0x7669('0x22')](respondWithResult(_0x5e7ba9,null))[_0x7669('0x2c')](handleError(_0x5e7ba9,null));};exports[_0x7669('0x36')]=function(_0x5f1926,_0x4cefa2){return db[_0x7669('0x4e')][_0x7669('0x55')]({'where':{'id':_0x5f1926[_0x7669('0x58')]['id']}})[_0x7669('0x22')](handleEntityNotFound(_0x4cefa2,null))[_0x7669('0x22')](removeEntity(_0x4cefa2,null))[_0x7669('0x2c')](handleError(_0x4cefa2,null));};exports[_0x7669('0x59')]=function(_0x5d5676,_0x1f28f9){return db['OpenchannelMessage']['describe']()[_0x7669('0x22')](respondWithResult(_0x1f28f9,null))[_0x7669('0x2c')](handleError(_0x1f28f9,null));};var interaction_log=require('../../config/logger')(_0x7669('0x5a'));exports[_0x7669('0x5b')]=function(_0x195fbb,_0xb2eba8,_0x51e566){var _0x3e7d09={'channel':_0x7669('0x5c')};if(_0x195fbb[_0x7669('0x57')]['id']){delete _0x195fbb['body']['id'];}_0x195fbb['body'][_0x7669('0x5d')]=!![];_0x195fbb[_0x7669('0x57')][_0x7669('0x5e')]=moment()[_0x7669('0x5f')](_0x7669('0x60'));_0x195fbb['body']['UserId']=_0x195fbb['body'][_0x7669('0x61')]||_0x195fbb[_0x7669('0x62')]['id'];return db[_0x7669('0x4e')][_0x7669('0x55')]({'where':{'id':_0x195fbb[_0x7669('0x58')]['id'],'UserId':null},'include':[{'model':db[_0x7669('0x63')],'as':_0x7669('0x64')}]})[_0x7669('0x22')](handleEntityNotFound(_0xb2eba8,null))[_0x7669('0x22')](saveUpdates(_0x195fbb[_0x7669('0x57')],null))['then'](function(_0x3a3459){if(_0x3a3459){_0x3e7d09[_0x7669('0x2a')]=_0x3a3459[_0x7669('0x65')]({'plain':!![]});return db[_0x7669('0x66')]['find']({'where':{'id':_0x3a3459[_0x7669('0x67')]}});}return null;})[_0x7669('0x22')](handleEntityNotFound(_0xb2eba8,null))[_0x7669('0x22')](function(_0x43d941){if(_0x43d941){return _0x43d941[_0x7669('0x35')]({'UserId':_0x195fbb[_0x7669('0x57')]['UserId'],'read1stAt':_[_0x7669('0x68')](_0x43d941[_0x7669('0x69')])?moment()[_0x7669('0x5f')](_0x7669('0x60')):undefined});}return null;})[_0x7669('0x22')](function(_0x48b6f3){if(_0x48b6f3){_0x3e7d09[_0x7669('0x6a')]=_0x48b6f3[_0x7669('0x65')]({'plain':!![]});interaction_log[_0x7669('0x23')](_0x7669('0x6b'),_0x195fbb[_0x7669('0x62')]['id'],_0x195fbb[_0x7669('0x62')][_0x7669('0x39')],_0x195fbb['user'][_0x7669('0x6c')],_0x3e7d09[_0x7669('0x6a')]['id'],_0x195fbb[_0x7669('0x57')]?JSON['stringify'](_0x195fbb[_0x7669('0x57')]):_0x7669('0x6d'));return respondWithRpcPromise(_0x7669('0x6e'),'acceptMessage',_0x3e7d09);}return null;})[_0x7669('0x22')](function(_0x4577c2){if(_0x4577c2){if(_0x195fbb['body'][_0x7669('0x6f')]){_0x3e7d09['message']['interface']=util[_0x7669('0x5f')](_0x7669('0x70'),_0x195fbb[_0x7669('0x62')]['name']);_0x3e7d09[_0x7669('0x2a')][_0x7669('0x71')]=_0x3e7d09[_0x7669('0x71')];_0x3e7d09[_0x7669('0x2a')][_0x7669('0x72')]=_0x7669('0x5b');return respondWithRpcPromise(_0x7669('0x73'),_0x7669('0x73'),{'event':_0x7669('0x74'),'message':_0x3e7d09[_0x7669('0x2a')]},client9002)[_0x7669('0x22')](function(){return _0x3e7d09;});}return _0x3e7d09;}return null;})[_0x7669('0x22')](respondWithResult(_0xb2eba8,null))[_0x7669('0x2c')](handleError(_0xb2eba8,null));};var interaction_log=require(_0x7669('0x13'))('openchannel-interactions');exports[_0x7669('0x34')]=function(_0x59b99d,_0x237a05,_0x3cfed2){var _0x55ddd5={'agent':{},'channel':'openchannel'};if(_0x59b99d[_0x7669('0x57')]['id']){delete _0x59b99d[_0x7669('0x57')]['id'];}_0x59b99d[_0x7669('0x57')][_0x7669('0x61')]=_0x59b99d['body'][_0x7669('0x61')]||_0x59b99d['user']['id'];_0x55ddd5['agent']['id']=_0x59b99d['body'][_0x7669('0x61')];return db['OpenchannelMessage'][_0x7669('0x55')]({'where':{'id':_0x59b99d[_0x7669('0x58')]['id'],'UserId':null}})[_0x7669('0x22')](handleEntityNotFound(_0x237a05,null))[_0x7669('0x22')](function(_0xd49045){if(_0xd49045){_0x55ddd5[_0x7669('0x2a')]=_0xd49045[_0x7669('0x65')]({'plain':!![]});return db[_0x7669('0x66')][_0x7669('0x55')]({'where':{'id':_0xd49045[_0x7669('0x67')]}});}return null;})[_0x7669('0x22')](handleEntityNotFound(_0x237a05,null))[_0x7669('0x22')](function(_0x2aac30){if(_0x2aac30){_0x55ddd5[_0x7669('0x6a')]=_0x2aac30[_0x7669('0x65')]({'plain':!![]});interaction_log[_0x7669('0x23')](_0x7669('0x75'),_0x59b99d['user']['id'],_0x59b99d[_0x7669('0x62')][_0x7669('0x39')],_0x59b99d[_0x7669('0x62')][_0x7669('0x6c')],_0x55ddd5[_0x7669('0x6a')]['id'],_0x59b99d[_0x7669('0x57')]?JSON[_0x7669('0x27')](_0x59b99d[_0x7669('0x57')]):_0x7669('0x6d'));return respondWithRpcPromise(_0x7669('0x76'),'rejectMessage',_0x55ddd5);}return null;})['then'](function(_0x3d7485){if(_0x3d7485){_0x3d7485['message'][_0x7669('0x77')]=util['format']('SIP/%s',_0x59b99d[_0x7669('0x62')][_0x7669('0x39')]);_0x3d7485[_0x7669('0x2a')][_0x7669('0x71')]=_0x55ddd5[_0x7669('0x71')];_0x3d7485[_0x7669('0x2a')][_0x7669('0x72')]=_0x7669('0x34');respondWithRpcPromise(_0x7669('0x73'),_0x7669('0x73'),{'event':_0x7669('0x78'),'message':_0x3d7485[_0x7669('0x2a')]},client9002);return _0x55ddd5;}return null;})[_0x7669('0x22')](respondWithResult(_0x237a05,null))[_0x7669('0x2c')](handleError(_0x237a05,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 9faf553..623fb4c 100644 --- a/server/api/openchannelMessage/openchannelMessage.events.js +++ b/server/api/openchannelMessage/openchannelMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x665e=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x665e,0x14a));var _0xe665=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0x665e[_0x3bf925];return _0x2128a1;};'use strict';var EventEmitter=require(_0xe665('0x0'));var OpenchannelMessage=require(_0xe665('0x1'))['db'][_0xe665('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xe665('0x3')](0x0);var events={'afterCreate':_0xe665('0x4'),'afterUpdate':_0xe665('0x5'),'afterDestroy':_0xe665('0x6')};function emitEvent(_0x127498){return function(_0x16884f,_0x2c6854,_0x3576c5){OpenchannelMessageEvents[_0xe665('0x7')](_0x127498+':'+_0x16884f['id'],_0x16884f);OpenchannelMessageEvents[_0xe665('0x7')](_0x127498,_0x16884f);_0x3576c5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xe665('0x8')](e,emitEvent(event));}}module[_0xe665('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x5ccf=['save','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage'];(function(_0x49d454,_0x5cc0a3){var _0x4aba44=function(_0xd7fb67){while(--_0xd7fb67){_0x49d454['push'](_0x49d454['shift']());}};_0x4aba44(++_0x5cc0a3);}(_0x5ccf,0x10c));var _0xf5cc=function(_0x3d0038,_0x5ee711){_0x3d0038=_0x3d0038-0x0;var _0x574935=_0x5ccf[_0x3d0038];return _0x574935;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xf5cc('0x0'))['db'][_0xf5cc('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf5cc('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x229890){return function(_0x3db2ed,_0x489b72,_0x4d35cf){OpenchannelMessageEvents['emit'](_0x229890+':'+_0x3db2ed['id'],_0x3db2ed);OpenchannelMessageEvents['emit'](_0x229890,_0x3db2ed);_0x4d35cf(null);};}for(var e in events){if(events[_0xf5cc('0x3')](e)){var event=events[e];OpenchannelMessage[_0xf5cc('0x4')](e,emitEvent(event));}}module[_0xf5cc('0x5')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 1cd53de..d1ee17e 100644 --- a/server/api/openchannelMessage/openchannelMessage.model.js +++ b/server/api/openchannelMessage/openchannelMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36ef=['method','GET','body','afterCreate','threadId','Interaction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','toLowerCase','direction','out','secret','isNil','UserId','OpenchannelInteraction','then','update','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','Contact','POST'];(function(_0x476768,_0x70af63){var _0x5cd65d=function(_0x59d7ec){while(--_0x59d7ec){_0x476768['push'](_0x476768['shift']());}};_0x5cd65d(++_0x70af63);}(_0x36ef,0x1ba));var _0xf36e=function(_0x53d8c9,_0x1cae2e){_0x53d8c9=_0x53d8c9-0x0;var _0x51a939=_0x36ef[_0x53d8c9];return _0x51a939;};'use strict';var _=require(_0xf36e('0x0'));var util=require(_0xf36e('0x1'));var logger=require(_0xf36e('0x2'))(_0xf36e('0x3'));var moment=require(_0xf36e('0x4'));var BPromise=require(_0xf36e('0x5'));var rp=require(_0xf36e('0x6'));var fs=require('fs');var path=require(_0xf36e('0x7'));var rimraf=require(_0xf36e('0x8'));var config=require(_0xf36e('0x9'));var attributes=require('./openchannelMessage.attributes');module[_0xf36e('0xa')]=function(_0x1874ca,_0x1abb7b){return _0x1874ca[_0xf36e('0xb')](_0xf36e('0xc'),attributes,{'tableName':_0xf36e('0xd'),'paranoid':![],'indexes':[{'name':_0xf36e('0xe'),'fields':['body'],'type':_0xf36e('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x17a882,_0x1896d5,_0x75a33e){var _0x20c6bf=_0x1874ca[_0xf36e('0x10')];var _0x29280e=_0x17a882['get']({'plain':!![]});if(_0x29280e['direction'][_0xf36e('0x11')]()==='in'||_0x29280e[_0xf36e('0x12')]['toLowerCase']()===_0xf36e('0x13')&&!_0x29280e[_0xf36e('0x14')]&&!_[_0xf36e('0x15')](_0x29280e[_0xf36e('0x16')])){_0x20c6bf[_0xf36e('0x17')]['findOne']({'where':{'id':_0x29280e['OpenchannelInteractionId']}})[_0xf36e('0x18')](function(_0x4fa94b){if(_0x4fa94b){_0x4fa94b[_0xf36e('0x19')]({'lastMsgAt':_0x29280e['createdAt'],'lastMsgDirection':_0x29280e[_0xf36e('0x12')][_0xf36e('0x11')]()});}})[_0xf36e('0x1a')](function(_0x57e411){console[_0xf36e('0x1b')](_0x57e411);});}if(_0x29280e[_0xf36e('0x12')]==='out'&&!_0x29280e[_0xf36e('0x14')]){var _0x2e45c8;_0x20c6bf[_0xf36e('0x1c')][_0xf36e('0x1d')]()[_0xf36e('0x18')](function(_0x4d452d){return _0x20c6bf[_0xf36e('0x1e')][_0xf36e('0x1f')]({'where':{'id':_0x29280e[_0xf36e('0x20')]},'include':[{'model':_0x20c6bf[_0xf36e('0x17')],'as':_0xf36e('0x21'),'where':{'id':_0x29280e[_0xf36e('0x22')]},'limit':0x1,'include':[{'model':_0x20c6bf[_0xf36e('0x1c')],'as':'Contact','attributes':_['keys'](_0x4d452d)}]}]});})[_0xf36e('0x18')](function(_0x8b76c2){_0x2e45c8=_0x8b76c2['get']({'plain':!![]});if(_0x2e45c8&&_0x2e45c8[_0xf36e('0x23')]){logger[_0xf36e('0x24')](_0xf36e('0x25'),'afterCreate',util[_0xf36e('0x26')](_0xf36e('0x27'),_0x29280e['id'],_0x2e45c8['replyUri']));if(_0x2e45c8[_0xf36e('0x21')]&&_0x2e45c8[_0xf36e('0x21')][_0xf36e('0x28')]){_0x29280e['Interaction']=_[_0xf36e('0x29')](_0x2e45c8[_0xf36e('0x21')][0x0],'Contact');_0x29280e[_0xf36e('0x2a')]=_0x2e45c8[_0xf36e('0x21')][0x0]['Contact'];}var _0x1896d5={'method':_0xf36e('0x2b'),'uri':encodeURI(_0x2e45c8[_0xf36e('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1896d5[_0xf36e('0x2c')]){case _0xf36e('0x2d'):_0x1896d5['qs']=_0x29280e;break;case _0xf36e('0x2b'):_0x1896d5[_0xf36e('0x2e')]=_0x29280e;break;}return rp(_0x1896d5)[_0xf36e('0x18')](function(_0x30d7a3){logger['info'](_0xf36e('0x25'),_0xf36e('0x2f'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x29280e['id'],_0x2e45c8[_0xf36e('0x23')]));if(_0x30d7a3[_0xf36e('0x2e')]['threadId']&&_0x30d7a3[_0xf36e('0x2e')][_0xf36e('0x30')]!=_0x29280e['Interaction']['threadId']){return _0x20c6bf[_0xf36e('0x17')]['update']({'threadId':_0x30d7a3['body'][_0xf36e('0x30')]},{'logging':!![],'where':{'id':_0x29280e[_0xf36e('0x31')]['id']}});}else{return;}})[_0xf36e('0x18')](function(){return _0x17a882[_0xf36e('0x19')]({'read':!![]});})[_0xf36e('0x1a')](function(_0x16a473){logger[_0xf36e('0x1b')]('OpenchannelMessage,\x20%s,\x20%s',_0xf36e('0x2f'),util[_0xf36e('0x32')](_0x16a473,{'showHidden':![],'depth':null}));_0x75a33e();});}else{_0x75a33e();}})[_0xf36e('0x33')](function(){_0x75a33e();});}else{_0x75a33e();}}},'charset':_0xf36e('0x34'),'collate':_0xf36e('0x35')});}; \ No newline at end of file +var _0x78b7=['moment','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','secret','UserId','then','createdAt','describe','OpenchannelAccount','OpenchannelAccountId','OpenchannelInteraction','Interactions','CmContact','Contact','info','afterCreate','format','replyUri','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','catch','error','OpenchannelMessage,\x20%s,\x20%s','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x4f0bdf,_0x5987f3){var _0x5dddac=function(_0x36913d){while(--_0x36913d){_0x4f0bdf['push'](_0x4f0bdf['shift']());}};_0x5dddac(++_0x5987f3);}(_0x78b7,0x1dc));var _0x778b=function(_0x357588,_0x4cb7a5){_0x357588=_0x357588-0x0;var _0x118264=_0x78b7[_0x357588];return _0x118264;};'use strict';var _=require(_0x778b('0x0'));var util=require(_0x778b('0x1'));var logger=require(_0x778b('0x2'))(_0x778b('0x3'));var moment=require(_0x778b('0x4'));var BPromise=require('bluebird');var rp=require(_0x778b('0x5'));var fs=require('fs');var path=require(_0x778b('0x6'));var rimraf=require(_0x778b('0x7'));var config=require(_0x778b('0x8'));var attributes=require('./openchannelMessage.attributes');module[_0x778b('0x9')]=function(_0x3fb367,_0x42cd40){return _0x3fb367[_0x778b('0xa')](_0x778b('0xb'),attributes,{'tableName':_0x778b('0xc'),'paranoid':![],'indexes':[{'name':_0x778b('0xd'),'fields':[_0x778b('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36dbdf,_0x4983cf,_0x509154){var _0x3a4788=_0x3fb367[_0x778b('0xf')];var _0x79065b=_0x36dbdf[_0x778b('0x10')]({'plain':!![]});if(_0x79065b[_0x778b('0x11')][_0x778b('0x12')]()==='in'||_0x79065b[_0x778b('0x11')]['toLowerCase']()===_0x778b('0x13')&&!_0x79065b[_0x778b('0x14')]&&!_['isNil'](_0x79065b[_0x778b('0x15')])){_0x3a4788['OpenchannelInteraction']['findOne']({'where':{'id':_0x79065b['OpenchannelInteractionId']}})[_0x778b('0x16')](function(_0x3f2f6c){if(_0x3f2f6c){_0x3f2f6c['update']({'lastMsgAt':_0x79065b[_0x778b('0x17')],'lastMsgDirection':_0x79065b[_0x778b('0x11')][_0x778b('0x12')]()});}})['catch'](function(_0x29e0de){console['error'](_0x29e0de);});}if(_0x79065b[_0x778b('0x11')]===_0x778b('0x13')&&!_0x79065b['secret']){var _0x3e8af4;_0x3a4788['CmContact'][_0x778b('0x18')]()['then'](function(_0xf75cb7){return _0x3a4788[_0x778b('0x19')]['find']({'where':{'id':_0x79065b[_0x778b('0x1a')]},'include':[{'model':_0x3a4788[_0x778b('0x1b')],'as':_0x778b('0x1c'),'where':{'id':_0x79065b['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x3a4788[_0x778b('0x1d')],'as':_0x778b('0x1e'),'attributes':_['keys'](_0xf75cb7)}]}]});})['then'](function(_0x364fd5){_0x3e8af4=_0x364fd5[_0x778b('0x10')]({'plain':!![]});if(_0x3e8af4&&_0x3e8af4['replyUri']){logger[_0x778b('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x778b('0x20'),util[_0x778b('0x21')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x79065b['id'],_0x3e8af4[_0x778b('0x22')]));if(_0x3e8af4[_0x778b('0x1c')]&&_0x3e8af4['Interactions'][_0x778b('0x23')]){_0x79065b[_0x778b('0x24')]=_[_0x778b('0x25')](_0x3e8af4[_0x778b('0x1c')][0x0],_0x778b('0x1e'));_0x79065b['Contact']=_0x3e8af4[_0x778b('0x1c')][0x0][_0x778b('0x1e')];}var _0x4983cf={'method':_0x778b('0x26'),'uri':encodeURI(_0x3e8af4[_0x778b('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4983cf[_0x778b('0x27')]){case _0x778b('0x28'):_0x4983cf['qs']=_0x79065b;break;case _0x778b('0x26'):_0x4983cf[_0x778b('0xe')]=_0x79065b;break;}return rp(_0x4983cf)[_0x778b('0x16')](function(_0x4e3d3d){logger[_0x778b('0x1f')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0x778b('0x29'),_0x79065b['id'],_0x3e8af4[_0x778b('0x22')]));if(_0x4e3d3d[_0x778b('0xe')][_0x778b('0x2a')]&&_0x4e3d3d[_0x778b('0xe')][_0x778b('0x2a')]!=_0x79065b[_0x778b('0x24')][_0x778b('0x2a')]){return _0x3a4788[_0x778b('0x1b')][_0x778b('0x2b')]({'threadId':_0x4e3d3d['body'][_0x778b('0x2a')]},{'logging':!![],'where':{'id':_0x79065b[_0x778b('0x24')]['id']}});}else{return;}})[_0x778b('0x16')](function(){return _0x36dbdf[_0x778b('0x2b')]({'read':!![]});})[_0x778b('0x2c')](function(_0x480e25){logger[_0x778b('0x2d')](_0x778b('0x2e'),_0x778b('0x20'),util['inspect'](_0x480e25,{'showHidden':![],'depth':null}));_0x509154();});}else{_0x509154();}})['finally'](function(){_0x509154();});}else{_0x509154();}}},'charset':_0x778b('0x2f'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 73d19d0..4e945b3 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1fa9=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create','options','stringify'];(function(_0x1ff575,_0xdba21f){var _0x48fc9e=function(_0x51cf97){while(--_0x51cf97){_0x1ff575['push'](_0x1ff575['shift']());}};_0x48fc9e(++_0xdba21f);}(_0x1fa9,0x136));var _0x91fa=function(_0x31d582,_0x21d107){_0x31d582=_0x31d582-0x0;var _0x242338=_0x1fa9[_0x31d582];return _0x242338;};'use strict';var _=require(_0x91fa('0x0'));var util=require('util');var moment=require(_0x91fa('0x1'));var BPromise=require('bluebird');var rs=require(_0x91fa('0x2'));var fs=require('fs');var Redis=require(_0x91fa('0x3'));var db=require(_0x91fa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x91fa('0x5'))(_0x91fa('0x6'));var config=require(_0x91fa('0x7'));var jayson=require(_0x91fa('0x8'));var client=jayson[_0x91fa('0x9')]['http']({'port':0x232a});config[_0x91fa('0xa')]=_[_0x91fa('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x91fa('0xc'))(new Redis(config[_0x91fa('0xa')]));require(_0x91fa('0xd'))[_0x91fa('0xe')](socket);function respondWithRpcPromise(_0x1f246b,_0x886fc1,_0x132eb2){return new BPromise(function(_0x595295,_0x544f1c){return client[_0x91fa('0xf')](_0x1f246b,_0x132eb2)[_0x91fa('0x10')](function(_0x17fc65){logger[_0x91fa('0x11')](_0x91fa('0x12'),_0x886fc1,_0x91fa('0x13'));logger[_0x91fa('0x14')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x886fc1,'request\x20sent',JSON['stringify'](_0x17fc65));if(_0x17fc65[_0x91fa('0x15')]){if(_0x17fc65['error'][_0x91fa('0x16')]===0x1f4){logger[_0x91fa('0x15')](_0x91fa('0x12'),_0x886fc1,_0x17fc65[_0x91fa('0x15')]['message']);return _0x544f1c(_0x17fc65[_0x91fa('0x15')][_0x91fa('0x17')]);}logger[_0x91fa('0x15')](_0x91fa('0x12'),_0x886fc1,_0x17fc65[_0x91fa('0x15')][_0x91fa('0x17')]);return _0x595295(_0x17fc65['error'][_0x91fa('0x17')]);}else{logger[_0x91fa('0x11')](_0x91fa('0x12'),_0x886fc1,_0x91fa('0x13'));_0x595295(_0x17fc65[_0x91fa('0x18')]['message']);}})[_0x91fa('0x19')](function(_0x433cf5){logger[_0x91fa('0x15')](_0x91fa('0x12'),_0x886fc1,_0x433cf5);_0x544f1c(_0x433cf5);});});}exports[_0x91fa('0x1a')]=function(_0x19b3a1){var _0xb5109c=this;return new Promise(function(_0x209129,_0xba1e97){return db[_0x91fa('0x1b')][_0x91fa('0x1c')](_0x19b3a1['body'],{'raw':_0x19b3a1[_0x91fa('0x1d')]?_0x19b3a1[_0x91fa('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x91fa('0x10')](function(_0x50596c){logger[_0x91fa('0x11')]('CreateOpenchannelMessage',_0x19b3a1);logger['debug']('CreateOpenchannelMessage',_0x19b3a1,JSON[_0x91fa('0x1e')](_0x50596c));_0x209129(_0x50596c);})[_0x91fa('0x19')](function(_0x3dd307){logger[_0x91fa('0x15')](_0x91fa('0x1a'),_0x3dd307['message'],_0x19b3a1);_0xba1e97(_0xb5109c[_0x91fa('0x15')](0x1f4,_0x3dd307[_0x91fa('0x17')]));});});}; \ No newline at end of file +var _0x13c5=['stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','request\x20sent','result','CreateOpenchannelMessage','OpenchannelMessage','create','options','raw','then','catch','lodash','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','info','OpenchannelMessage,\x20%s,\x20%s,\x20%s'];(function(_0x344b2e,_0x393a39){var _0x1c9f36=function(_0x4d6066){while(--_0x4d6066){_0x344b2e['push'](_0x344b2e['shift']());}};_0x1c9f36(++_0x393a39);}(_0x13c5,0x7a));var _0x513c=function(_0x5790e6,_0x549c10){_0x5790e6=_0x5790e6-0x0;var _0x19f598=_0x13c5[_0x5790e6];return _0x19f598;};'use strict';var _=require(_0x513c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x513c('0x1'));var logger=require('../../config/logger')('rpc');var config=require(_0x513c('0x2'));var jayson=require(_0x513c('0x3'));var client=jayson[_0x513c('0x4')][_0x513c('0x5')]({'port':0x232a});config['redis']=_['defaults'](config[_0x513c('0x6')],{'host':_0x513c('0x7'),'port':0x18eb});var socket=require(_0x513c('0x8'))(new Redis(config[_0x513c('0x6')]));require(_0x513c('0x9'))[_0x513c('0xa')](socket);function respondWithRpcPromise(_0x222c25,_0x18471d,_0x4adc04){return new BPromise(function(_0xd70448,_0x224eb2){return client['request'](_0x222c25,_0x4adc04)['then'](function(_0x798eed){logger[_0x513c('0xb')]('OpenchannelMessage,\x20%s,\x20%s',_0x18471d,'request\x20sent');logger['debug'](_0x513c('0xc'),_0x18471d,'request\x20sent',JSON[_0x513c('0xd')](_0x798eed));if(_0x798eed[_0x513c('0xe')]){if(_0x798eed['error'][_0x513c('0xf')]===0x1f4){logger[_0x513c('0xe')](_0x513c('0x10'),_0x18471d,_0x798eed[_0x513c('0xe')][_0x513c('0x11')]);return _0x224eb2(_0x798eed['error'][_0x513c('0x11')]);}logger['error'](_0x513c('0x10'),_0x18471d,_0x798eed[_0x513c('0xe')][_0x513c('0x11')]);return _0xd70448(_0x798eed[_0x513c('0xe')]['message']);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x18471d,_0x513c('0x12'));_0xd70448(_0x798eed[_0x513c('0x13')]['message']);}})['catch'](function(_0x217e7a){logger[_0x513c('0xe')](_0x513c('0x10'),_0x18471d,_0x217e7a);_0x224eb2(_0x217e7a);});});}exports[_0x513c('0x14')]=function(_0x4e5a78){var _0x2039be=this;return new Promise(function(_0xddf5d9,_0x24a9c7){return db[_0x513c('0x15')][_0x513c('0x16')](_0x4e5a78['body'],{'raw':_0x4e5a78[_0x513c('0x17')]?_0x4e5a78['options'][_0x513c('0x18')]===undefined?!![]:![]:!![]})[_0x513c('0x19')](function(_0x9dc7ba){logger[_0x513c('0xb')](_0x513c('0x14'),_0x4e5a78);logger['debug']('CreateOpenchannelMessage',_0x4e5a78,JSON[_0x513c('0xd')](_0x9dc7ba));_0xddf5d9(_0x9dc7ba);})[_0x513c('0x1a')](function(_0x58dea0){logger[_0x513c('0xe')](_0x513c('0x14'),_0x58dea0['message'],_0x4e5a78);_0x24a9c7(_0x2039be[_0x513c('0xe')](0x1f4,_0x58dea0[_0x513c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 2746a3a..905ff2a 100644 --- a/server/api/openchannelMessage/openchannelMessage.socket.js +++ b/server/api/openchannelMessage/openchannelMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['remove','emit','removeListener','length','./openchannelMessage.events','save'];(function(_0x2a82b3,_0x469c16){var _0x1ee38e=function(_0x331304){while(--_0x331304){_0x2a82b3['push'](_0x2a82b3['shift']());}};_0x1ee38e(++_0x469c16);}(_0x54ef,0x112));var _0xf54e=function(_0x42482e,_0xe8cbea){_0x42482e=_0x42482e-0x0;var _0x41fcbb=_0x54ef[_0x42482e];return _0x41fcbb;};'use strict';var OpenchannelMessageEvents=require(_0xf54e('0x0'));var events=[_0xf54e('0x1'),_0xf54e('0x2'),'update'];function createListener(_0xd936f7,_0x18b7d6){return function(_0x18b1cf){_0x18b7d6[_0xf54e('0x3')](_0xd936f7,_0x18b1cf);};}function removeListener(_0x8b6bb6,_0x431e36){return function(){OpenchannelMessageEvents[_0xf54e('0x4')](_0x8b6bb6,_0x431e36);};}exports['register']=function(_0x55e611){for(var _0x18e84e=0x0,_0x99cf9=events[_0xf54e('0x5')];_0x18e84e<_0x99cf9;_0x18e84e++){var _0x561870=events[_0x18e84e];var _0x27e69b=createListener('openchannelMessage:'+_0x561870,_0x55e611);OpenchannelMessageEvents['on'](_0x561870,_0x27e69b);}}; \ No newline at end of file +var _0xe706=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit','removeListener'];(function(_0x1707eb,_0x520e7e){var _0x31172f=function(_0x5297a6){while(--_0x5297a6){_0x1707eb['push'](_0x1707eb['shift']());}};_0x31172f(++_0x520e7e);}(_0xe706,0xa3));var _0x6e70=function(_0x5a461e,_0xe83e49){_0x5a461e=_0x5a461e-0x0;var _0x1fac23=_0xe706[_0x5a461e];return _0x1fac23;};'use strict';var OpenchannelMessageEvents=require(_0x6e70('0x0'));var events=[_0x6e70('0x1'),_0x6e70('0x2'),'update'];function createListener(_0x2cae77,_0x315629){return function(_0x2ca810){_0x315629[_0x6e70('0x3')](_0x2cae77,_0x2ca810);};}function removeListener(_0x142c27,_0x2164a4){return function(){OpenchannelMessageEvents[_0x6e70('0x4')](_0x142c27,_0x2164a4);};}exports[_0x6e70('0x5')]=function(_0x1b0389){for(var _0x4381d1=0x0,_0x36357b=events[_0x6e70('0x6')];_0x4381d1<_0x36357b;_0x4381d1++){var _0x45a2d4=events[_0x4381d1];var _0x188ed3=createListener(_0x6e70('0x7')+_0x45a2d4,_0x1b0389);OpenchannelMessageEvents['on'](_0x45a2d4,_0x188ed3);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 722974f..16e49aa 100644 --- a/server/api/openchannelQueue/index.js +++ b/server/api/openchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fd6=['../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','/describe','isAuthenticated','describe','get','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','Router'];(function(_0x3e00cf,_0x10af60){var _0x2c31e2=function(_0x4dd01d){while(--_0x4dd01d){_0x3e00cf['push'](_0x3e00cf['shift']());}};_0x2c31e2(++_0x10af60);}(_0x7fd6,0x157));var _0x67fd=function(_0x5574fc,_0x4b9324){_0x5574fc=_0x5574fc-0x0;var _0x581838=_0x7fd6[_0x5574fc];return _0x581838;};'use strict';var multer=require(_0x67fd('0x0'));var util=require('util');var path=require(_0x67fd('0x1'));var timeout=require(_0x67fd('0x2'));var express=require(_0x67fd('0x3'));var router=express[_0x67fd('0x4')]();var auth=require(_0x67fd('0x5'));var interaction=require(_0x67fd('0x6'));var config=require('../../config/environment');var controller=require(_0x67fd('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x67fd('0x8'),auth[_0x67fd('0x9')](),controller[_0x67fd('0xa')]);router[_0x67fd('0xb')](_0x67fd('0xc'),auth[_0x67fd('0x9')](),controller[_0x67fd('0xd')]);router[_0x67fd('0xb')]('/:id/members',auth[_0x67fd('0x9')](),controller[_0x67fd('0xe')]);router[_0x67fd('0xb')](_0x67fd('0xf'),auth[_0x67fd('0x9')](),controller[_0x67fd('0x10')]);router['get'](_0x67fd('0x11'),auth[_0x67fd('0x9')](),controller[_0x67fd('0x12')]);router[_0x67fd('0x13')]('/',auth[_0x67fd('0x9')](),controller[_0x67fd('0x14')]);router[_0x67fd('0x13')](_0x67fd('0xf'),auth[_0x67fd('0x9')](),controller[_0x67fd('0x15')]);router[_0x67fd('0x13')]('/:id/users',auth[_0x67fd('0x9')](),controller[_0x67fd('0x16')]);router[_0x67fd('0x17')](_0x67fd('0xc'),auth['isAuthenticated'](),controller[_0x67fd('0x18')]);router[_0x67fd('0x19')]('/:id',auth[_0x67fd('0x9')](),controller[_0x67fd('0x1a')]);router[_0x67fd('0x19')](_0x67fd('0xf'),auth[_0x67fd('0x9')](),controller[_0x67fd('0x1b')]);router[_0x67fd('0x19')](_0x67fd('0x11'),auth['isAuthenticated'](),controller[_0x67fd('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x9120=['destroy','removeTeams','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update'];(function(_0x18a1c6,_0x209699){var _0x317ca8=function(_0x4fcd12){while(--_0x4fcd12){_0x18a1c6['push'](_0x18a1c6['shift']());}};_0x317ca8(++_0x209699);}(_0x9120,0x1b3));var _0x0912=function(_0x32ae5f,_0x5129eb){_0x32ae5f=_0x32ae5f-0x0;var _0x25a4b9=_0x9120[_0x32ae5f];return _0x25a4b9;};'use strict';var multer=require(_0x0912('0x0'));var util=require(_0x0912('0x1'));var path=require(_0x0912('0x2'));var timeout=require(_0x0912('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x0912('0x4'));var interaction=require(_0x0912('0x5'));var config=require(_0x0912('0x6'));var controller=require(_0x0912('0x7'));router[_0x0912('0x8')]('/',auth[_0x0912('0x9')](),controller['index']);router[_0x0912('0x8')](_0x0912('0xa'),auth[_0x0912('0x9')](),controller['describe']);router[_0x0912('0x8')](_0x0912('0xb'),auth[_0x0912('0x9')](),controller[_0x0912('0xc')]);router[_0x0912('0x8')]('/:id/members',auth[_0x0912('0x9')](),controller[_0x0912('0xd')]);router[_0x0912('0x8')](_0x0912('0xe'),auth['isAuthenticated'](),controller[_0x0912('0xf')]);router['get'](_0x0912('0x10'),auth[_0x0912('0x9')](),controller[_0x0912('0x11')]);router[_0x0912('0x12')]('/',auth[_0x0912('0x9')](),controller[_0x0912('0x13')]);router[_0x0912('0x12')](_0x0912('0xe'),auth[_0x0912('0x9')](),controller[_0x0912('0x14')]);router[_0x0912('0x12')](_0x0912('0x10'),auth[_0x0912('0x9')](),controller[_0x0912('0x15')]);router[_0x0912('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x0912('0x17')]);router['delete'](_0x0912('0xb'),auth['isAuthenticated'](),controller[_0x0912('0x18')]);router['delete'](_0x0912('0xe'),auth['isAuthenticated'](),controller[_0x0912('0x19')]);router['delete'](_0x0912('0x10'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x0912('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index f8fb77d..29c4914 100644 --- a/server/api/openchannelQueue/openchannelQueue.attributes.js +++ b/server/api/openchannelQueue/openchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad07=['rrmemory','beepall','roundrobin','sequelize','exports','name','STRING'];(function(_0x390143,_0x2b54ac){var _0x11361b=function(_0x3666c3){while(--_0x3666c3){_0x390143['push'](_0x390143['shift']());}};_0x11361b(++_0x2b54ac);}(_0xad07,0xe3));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7ad0('0x0'));module[_0x7ad0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7ad0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7ad0('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7ad0('0x4'),_0x7ad0('0x5'),_0x7ad0('0x6'))}}; \ No newline at end of file +var _0x8d41=['beepall','roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory'];(function(_0x1dbdb6,_0x4d06ee){var _0x4f0746=function(_0x2ba6ec){while(--_0x2ba6ec){_0x1dbdb6['push'](_0x1dbdb6['shift']());}};_0x4f0746(++_0x4d06ee);}(_0x8d41,0x1aa));var _0x18d4=function(_0x40b48b,_0x5c29e7){_0x40b48b=_0x40b48b-0x0;var _0x5cbd32=_0x8d41[_0x40b48b];return _0x5cbd32;};'use strict';var Sequelize=require(_0x18d4('0x0'));module[_0x18d4('0x1')]={'name':{'type':Sequelize[_0x18d4('0x2')],'unique':_0x18d4('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x18d4('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x18d4('0x4')](_0x18d4('0x5'),_0x18d4('0x6'),_0x18d4('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 7f3bbbe..40452fa 100644 --- a/server/api/openchannelQueue/openchannelQueue.controller.js +++ b/server/api/openchannelQueue/openchannelQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22d0=['path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','redis','defaults','socket.io-emitter','./openchannelQueue.socket','status','end','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','send','index','OpenchannelQueue','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','type','options','count','includeAll','include','findAll','rows','catch','show','params','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','userProfileId','autoAssociation','create','body','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','merge','findAndCountAll','UserId','agent','format','%s/%s','SIP','openchannelPause','createdAt','updatedAt','Team','addTeams','ids','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams','from','join','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x45de7d,_0x476e39){var _0x463dea=function(_0x42526e){while(--_0x42526e){_0x45de7d['push'](_0x45de7d['shift']());}};_0x463dea(++_0x476e39);}(_0x22d0,0x106));var _0x022d=function(_0x202b05,_0x5a246c){_0x202b05=_0x202b05-0x0;var _0x22a0a7=_0x22d0[_0x202b05];return _0x22a0a7;};'use strict';var pdf=require(_0x022d('0x0'));var emlformat=require(_0x022d('0x1'));var rimraf=require(_0x022d('0x2'));var zipdir=require(_0x022d('0x3'));var jsonpatch=require(_0x022d('0x4'));var rp=require(_0x022d('0x5'));var moment=require(_0x022d('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x022d('0x7'));var util=require('util');var path=require(_0x022d('0x8'));var sox=require(_0x022d('0x9'));var csv=require(_0x022d('0xa'));var ejs=require(_0x022d('0xb'));var fs=require('fs');var _=require(_0x022d('0xc'));var squel=require('squel');var crypto=require(_0x022d('0xd'));var jsforce=require(_0x022d('0xe'));var deskjs=require(_0x022d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x022d('0x10'));var Papa=require(_0x022d('0x11'));var Redis=require(_0x022d('0x12'));var authService=require(_0x022d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x022d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x022d('0x15'))('api');var utils=require(_0x022d('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x022d('0x17')]=_[_0x022d('0x18')](config[_0x022d('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x022d('0x19'))(new Redis(config[_0x022d('0x17')]));require(_0x022d('0x1a'))['register'](socket);function respondWithStatusCode(_0x2e2c2d,_0x50a1be){_0x50a1be=_0x50a1be||0xcc;return function(_0x1068cc){if(_0x1068cc){return _0x2e2c2d['sendStatus'](_0x50a1be);}return _0x2e2c2d[_0x022d('0x1b')](_0x50a1be)[_0x022d('0x1c')]();};}function respondWithResult(_0x5d95e4,_0x20a2ea){_0x20a2ea=_0x20a2ea||0xc8;return function(_0x5e8c7f){if(_0x5e8c7f){return _0x5d95e4[_0x022d('0x1b')](_0x20a2ea)['json'](_0x5e8c7f);}};}function respondWithFilteredResult(_0x76c774,_0x4a78ca){return function(_0x31ae8d){if(_0x31ae8d){var _0x2b2720=_0x31ae8d['count'],_0xd0a4c9=_0x4a78ca['offset'],_0x4df1a4=_0x4a78ca[_0x022d('0x1d')]+_0x4a78ca[_0x022d('0x1e')],_0x5d4cc2;if(_0x4df1a4>=_0x2b2720){_0x4df1a4=_0x2b2720;_0x5d4cc2=0xc8;}else{_0x5d4cc2=0xce;}_0x76c774[_0x022d('0x1b')](_0x5d4cc2);return _0x76c774[_0x022d('0x1f')](_0x022d('0x20'),_0xd0a4c9+'-'+_0x4df1a4+'/'+_0x2b2720)[_0x022d('0x21')](_0x31ae8d);}return null;};}function patchUpdates(_0x1fe5d7){return function(_0x90bfb3){try{jsonpatch[_0x022d('0x22')](_0x90bfb3,_0x1fe5d7,!![]);}catch(_0x257609){return BPromise[_0x022d('0x23')](_0x257609);}return _0x90bfb3['save']();};}function saveUpdates(_0x5c8160,_0x16a1ec){return function(_0x32c89d){if(_0x32c89d){return _0x32c89d[_0x022d('0x24')](_0x5c8160)[_0x022d('0x25')](function(_0x5a7dc1){return _0x5a7dc1;});}return null;};}function removeEntity(_0x54f7ce,_0x35f340){return function(_0x16a53a){if(_0x16a53a){return _0x16a53a[_0x022d('0x26')]()[_0x022d('0x25')](function(){var _0x106297=_0x16a53a[_0x022d('0x27')]({'plain':!![]});var _0x3c1a16='OpenchannelQueues';return db[_0x022d('0x28')][_0x022d('0x26')]({'where':{'type':_0x3c1a16,'resourceId':_0x106297['id']}})[_0x022d('0x25')](function(){return _0x16a53a;});})[_0x022d('0x25')](function(){_0x54f7ce[_0x022d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2acee2,_0xf90e62){return function(_0x1da7ab){if(!_0x1da7ab){_0x2acee2[_0x022d('0x29')](0x194);}return _0x1da7ab;};}function handleError(_0x300bdd,_0xcf823e){_0xcf823e=_0xcf823e||0x1f4;return function(_0xd624c6){logger[_0x022d('0x2a')](_0xd624c6[_0x022d('0x2b')]);if(_0xd624c6['name']){delete _0xd624c6['name'];}_0x300bdd[_0x022d('0x1b')](_0xcf823e)[_0x022d('0x2c')](_0xd624c6);};}exports[_0x022d('0x2d')]=function(_0x8b7865,_0x110a2d){var _0x2526dc={},_0x196903={},_0x833c1a={'count':0x0,'rows':[]};var _0x3482d4=_['map'](db[_0x022d('0x2e')][_0x022d('0x2f')],function(_0x3ec5bd){return{'name':_0x3ec5bd['fieldName'],'type':_0x3ec5bd['type'][_0x022d('0x30')]};});_0x196903[_0x022d('0x31')]=_[_0x022d('0x32')](_0x3482d4,_0x022d('0x33'));_0x196903[_0x022d('0x34')]=_[_0x022d('0x35')](_0x8b7865[_0x022d('0x34')]);_0x196903[_0x022d('0x36')]=_[_0x022d('0x37')](_0x196903[_0x022d('0x31')],_0x196903[_0x022d('0x34')]);_0x2526dc[_0x022d('0x38')]=_[_0x022d('0x37')](_0x196903[_0x022d('0x31')],qs[_0x022d('0x39')](_0x8b7865[_0x022d('0x34')][_0x022d('0x39')]));_0x2526dc['attributes']=_0x2526dc[_0x022d('0x38')][_0x022d('0x3a')]?_0x2526dc[_0x022d('0x38')]:_0x196903[_0x022d('0x31')];if(!_0x8b7865[_0x022d('0x34')]['hasOwnProperty'](_0x022d('0x3b'))){_0x2526dc[_0x022d('0x1e')]=qs[_0x022d('0x1e')](_0x8b7865[_0x022d('0x34')][_0x022d('0x1e')]);_0x2526dc[_0x022d('0x1d')]=qs[_0x022d('0x1d')](_0x8b7865[_0x022d('0x34')][_0x022d('0x1d')]);}_0x2526dc[_0x022d('0x3c')]=qs[_0x022d('0x3d')](_0x8b7865[_0x022d('0x34')]['sort']);_0x2526dc['where']=qs[_0x022d('0x36')](_[_0x022d('0x3e')](_0x8b7865[_0x022d('0x34')],_0x196903['filters']));if(_0x8b7865[_0x022d('0x34')][_0x022d('0x3f')]){_0x2526dc[_0x022d('0x40')]=_['merge'](_0x2526dc[_0x022d('0x40')],{'$or':_[_0x022d('0x32')](_0x3482d4,function(_0x55825e){if(_0x55825e[_0x022d('0x41')]!=='VIRTUAL'){var _0x10877c={};_0x10877c[_0x55825e[_0x022d('0x33')]]={'$like':'%'+_0x8b7865[_0x022d('0x34')][_0x022d('0x3f')]+'%'};return _0x10877c;}})});}_0x2526dc=_['merge']({},_0x2526dc,_0x8b7865[_0x022d('0x42')]);var _0x38a261={'where':_0x2526dc[_0x022d('0x40')]};return db[_0x022d('0x2e')]['count'](_0x38a261)[_0x022d('0x25')](function(_0x25b554){_0x833c1a[_0x022d('0x43')]=_0x25b554;if(_0x8b7865[_0x022d('0x34')][_0x022d('0x44')]){_0x2526dc[_0x022d('0x45')]=[{'all':!![]}];}return db[_0x022d('0x2e')][_0x022d('0x46')](_0x2526dc);})[_0x022d('0x25')](function(_0x28a5c4){_0x833c1a[_0x022d('0x47')]=_0x28a5c4;return _0x833c1a;})['then'](respondWithFilteredResult(_0x110a2d,_0x2526dc))[_0x022d('0x48')](handleError(_0x110a2d,null));};exports[_0x022d('0x49')]=function(_0x2da3b6,_0x4c5d61){var _0x1db316={'raw':!![],'where':{'id':_0x2da3b6[_0x022d('0x4a')]['id']}},_0x199066={};_0x199066[_0x022d('0x31')]=_[_0x022d('0x35')](db[_0x022d('0x2e')]['rawAttributes']);_0x199066[_0x022d('0x34')]=_[_0x022d('0x35')](_0x2da3b6[_0x022d('0x34')]);_0x199066[_0x022d('0x36')]=_[_0x022d('0x37')](_0x199066['model'],_0x199066[_0x022d('0x34')]);_0x1db316[_0x022d('0x38')]=_[_0x022d('0x37')](_0x199066[_0x022d('0x31')],qs[_0x022d('0x39')](_0x2da3b6['query']['fields']));_0x1db316[_0x022d('0x38')]=_0x1db316[_0x022d('0x38')][_0x022d('0x3a')]?_0x1db316[_0x022d('0x38')]:_0x199066[_0x022d('0x31')];if(_0x2da3b6[_0x022d('0x34')][_0x022d('0x44')]){_0x1db316['include']=[{'all':!![]}];}_0x1db316=_['merge']({},_0x1db316,_0x2da3b6['options']);return db['OpenchannelQueue'][_0x022d('0x4b')](_0x1db316)['then'](handleEntityNotFound(_0x4c5d61,null))[_0x022d('0x25')](respondWithResult(_0x4c5d61,null))[_0x022d('0x48')](handleError(_0x4c5d61,null));};exports['create']=function(_0x5e093e,_0xea583){return db[_0x022d('0x2e')]['create'](_0x5e093e['body'],{})['then'](function(_0x10eb34){var _0x8b7069=_0x5e093e['user']['get']({'plain':!![]});if(!_0x8b7069)throw new Error(_0x022d('0x4c'));if(_0x8b7069[_0x022d('0x4d')]==='user'){var _0xe4f7ff=_0x10eb34['get']({'plain':!![]});var _0x434d97=_0x022d('0x4e');return db['UserProfileSection'][_0x022d('0x4b')]({'where':{'name':_0x434d97,'userProfileId':_0x8b7069[_0x022d('0x4f')]},'raw':!![]})[_0x022d('0x25')](function(_0x573f32){if(_0x573f32&&_0x573f32[_0x022d('0x50')]===0x0){return db['UserProfileResource'][_0x022d('0x51')]({'name':_0xe4f7ff['name'],'resourceId':_0xe4f7ff['id'],'type':_0x573f32[_0x022d('0x33')],'sectionId':_0x573f32['id']},{})[_0x022d('0x25')](function(){return _0x10eb34;});}else{return _0x10eb34;}})[_0x022d('0x48')](function(_0x156f7e){logger[_0x022d('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x156f7e);throw _0x156f7e;});}return _0x10eb34;})[_0x022d('0x25')](respondWithResult(_0xea583,0xc9))[_0x022d('0x48')](handleError(_0xea583,null));};exports[_0x022d('0x24')]=function(_0x5b18a5,_0x171534){if(_0x5b18a5[_0x022d('0x52')]['id']){delete _0x5b18a5[_0x022d('0x52')]['id'];}return db[_0x022d('0x2e')]['find']({'where':{'id':_0x5b18a5[_0x022d('0x4a')]['id']}})[_0x022d('0x25')](handleEntityNotFound(_0x171534,null))[_0x022d('0x25')](saveUpdates(_0x5b18a5[_0x022d('0x52')],null))['then'](respondWithResult(_0x171534,null))[_0x022d('0x48')](handleError(_0x171534,null));};exports[_0x022d('0x26')]=function(_0x14fe6d,_0x130869){return db[_0x022d('0x2e')][_0x022d('0x4b')]({'where':{'id':_0x14fe6d[_0x022d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x130869,null))[_0x022d('0x25')](removeEntity(_0x130869,null))[_0x022d('0x48')](handleError(_0x130869,null));};exports[_0x022d('0x53')]=function(_0x267393,_0x1d7662){return db[_0x022d('0x2e')][_0x022d('0x53')]()['then'](respondWithResult(_0x1d7662,null))[_0x022d('0x48')](handleError(_0x1d7662,null));};exports[_0x022d('0x54')]=function(_0x1abca3,_0x5c3053,_0x37a2df){var _0x3e008a={'raw':!![],'where':{}},_0x4b8e86={},_0x3b7a36;return db[_0x022d('0x2e')][_0x022d('0x55')]({'where':{'id':_0x1abca3[_0x022d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c3053,null))['then'](function(_0x2e8ad5){if(_0x2e8ad5){_0x3b7a36=_0x2e8ad5[_0x022d('0x27')]({'plain':!![]});_0x4b8e86[_0x022d('0x31')]=_['keys'](db[_0x022d('0x56')][_0x022d('0x2f')]);_0x4b8e86[_0x022d('0x34')]=_['keys'](_0x1abca3[_0x022d('0x34')]);_0x4b8e86[_0x022d('0x36')]=_[_0x022d('0x37')](_0x4b8e86[_0x022d('0x31')],_0x4b8e86[_0x022d('0x34')]);_0x3e008a['attributes']=_[_0x022d('0x37')](_0x4b8e86[_0x022d('0x31')],qs['fields'](_0x1abca3[_0x022d('0x34')]['fields']));_0x3e008a['attributes']=_0x3e008a['attributes'][_0x022d('0x3a')]?_0x3e008a[_0x022d('0x38')]:_0x4b8e86[_0x022d('0x31')];if(!_0x1abca3[_0x022d('0x34')][_0x022d('0x57')](_0x022d('0x3b'))){_0x3e008a[_0x022d('0x1e')]=qs[_0x022d('0x1e')](_0x1abca3[_0x022d('0x34')][_0x022d('0x1e')]);_0x3e008a[_0x022d('0x1d')]=qs['offset'](_0x1abca3[_0x022d('0x34')]['offset']);}_0x3e008a['order']=qs['sort'](_0x1abca3['query'][_0x022d('0x3d')]);_0x3e008a['where']=qs[_0x022d('0x36')](_[_0x022d('0x3e')](_0x1abca3['query'],_0x4b8e86[_0x022d('0x36')]));_0x3e008a['where']['OpenchannelQueueId']=_0x2e8ad5['id'];if(_0x1abca3[_0x022d('0x34')][_0x022d('0x3f')]){_0x3e008a[_0x022d('0x40')]=_['merge'](_0x3e008a[_0x022d('0x40')],{'$or':_[_0x022d('0x32')](_0x3e008a[_0x022d('0x38')],function(_0x302574){var _0x45d301={};_0x45d301[_0x302574]={'$like':'%'+_0x1abca3[_0x022d('0x34')][_0x022d('0x3f')]+'%'};return _0x45d301;})});}_0x3e008a=_[_0x022d('0x58')]({},_0x3e008a,_0x1abca3['options']);return db[_0x022d('0x56')][_0x022d('0x46')](_0x3e008a);}})[_0x022d('0x25')](function(_0x2302d2){if(_0x2302d2){return db['User'][_0x022d('0x59')]({'where':{'id':_[_0x022d('0x32')](_0x2302d2,_0x022d('0x5a')),'role':_0x022d('0x5b')},'attributes':['id',_0x022d('0x33'),'openchannelPause','updatedAt','createdAt']});}})[_0x022d('0x25')](function(_0x386da9){if(_0x386da9){return{'count':_0x386da9['count'],'rows':_[_0x022d('0x32')](_0x386da9[_0x022d('0x47')],function(_0x101d99){return{'membername':_0x101d99['name'],'UserId':_0x101d99['id'],'queue_name':_0x3b7a36[_0x022d('0x33')],'OpenchannelQueueId':_0x3b7a36['id'],'interface':util[_0x022d('0x5c')](_0x022d('0x5d'),_0x022d('0x5e'),_0x101d99['name']),'penalty':0x0,'paused':_0x101d99[_0x022d('0x5f')],'createdAt':_0x101d99[_0x022d('0x60')],'updatedAt':_0x101d99[_0x022d('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x022d('0x25')](respondWithFilteredResult(_0x5c3053,_0x3e008a))[_0x022d('0x48')](handleError(_0x5c3053,null));};exports['getTeams']=function(_0x51fa6b,_0x2ca61c,_0x24f756){var _0x4c103b={};var _0x466528={};var _0x504bd0;var _0x506d46;return db['OpenchannelQueue'][_0x022d('0x55')]({'where':{'id':_0x51fa6b['params']['id']}})['then'](handleEntityNotFound(_0x2ca61c,null))['then'](function(_0x56653d){if(_0x56653d){_0x504bd0=_0x56653d;_0x466528[_0x022d('0x31')]=_[_0x022d('0x35')](db[_0x022d('0x62')][_0x022d('0x2f')]);_0x466528['query']=_['keys'](_0x51fa6b[_0x022d('0x34')]);_0x466528[_0x022d('0x36')]=_['intersection'](_0x466528[_0x022d('0x31')],_0x466528[_0x022d('0x34')]);_0x4c103b[_0x022d('0x38')]=_['intersection'](_0x466528[_0x022d('0x31')],qs[_0x022d('0x39')](_0x51fa6b[_0x022d('0x34')][_0x022d('0x39')]));_0x4c103b[_0x022d('0x38')]=_0x4c103b[_0x022d('0x38')][_0x022d('0x3a')]?_0x4c103b[_0x022d('0x38')]:_0x466528[_0x022d('0x31')];_0x4c103b[_0x022d('0x3c')]=qs[_0x022d('0x3d')](_0x51fa6b[_0x022d('0x34')][_0x022d('0x3d')]);_0x4c103b[_0x022d('0x40')]=qs[_0x022d('0x36')](_['pick'](_0x51fa6b[_0x022d('0x34')],_0x466528[_0x022d('0x36')]));if(_0x51fa6b[_0x022d('0x34')][_0x022d('0x3f')]){_0x4c103b[_0x022d('0x40')]=_[_0x022d('0x58')](_0x4c103b[_0x022d('0x40')],{'$or':_[_0x022d('0x32')](_0x4c103b[_0x022d('0x38')],function(_0x350352){var _0x1d709c={};_0x1d709c[_0x350352]={'$like':'%'+_0x51fa6b[_0x022d('0x34')][_0x022d('0x3f')]+'%'};return _0x1d709c;})});}_0x4c103b=_[_0x022d('0x58')]({},_0x4c103b,_0x51fa6b[_0x022d('0x42')]);return _0x504bd0['getTeams'](_0x4c103b);}})[_0x022d('0x25')](function(_0x483646){if(_0x483646){_0x506d46=_0x483646[_0x022d('0x3a')];if(!_0x51fa6b['query'][_0x022d('0x57')](_0x022d('0x3b'))){_0x4c103b['limit']=qs['limit'](_0x51fa6b[_0x022d('0x34')][_0x022d('0x1e')]);_0x4c103b[_0x022d('0x1d')]=qs[_0x022d('0x1d')](_0x51fa6b[_0x022d('0x34')]['offset']);}return _0x504bd0['getTeams'](_0x4c103b);}})['then'](function(_0x570f16){if(_0x570f16){return _0x570f16?{'count':_0x506d46,'rows':_0x570f16}:null;}})[_0x022d('0x25')](respondWithResult(_0x2ca61c,null))['catch'](handleError(_0x2ca61c,null));};exports[_0x022d('0x63')]=function(_0x531c04,_0x8f6bb8,_0x472027){var _0x314331=_0x531c04[_0x022d('0x52')][_0x022d('0x64')];return db[_0x022d('0x62')][_0x022d('0x46')]({'where':{'id':_0x314331},'attributes':['id'],'include':[{'model':db[_0x022d('0x65')],'as':_0x022d('0x66'),'attributes':['id','name',_0x022d('0x67'),_0x022d('0x68'),'interface'],'raw':!![]}]})[_0x022d('0x25')](function(_0x25048f){if(_0x25048f){var _0x23ae54=_[_0x022d('0x69')](_0x25048f,function(_0x9a0cad){var _0x369b13=_0x9a0cad[_0x022d('0x27')]({'plain':!![]});return _0x369b13[_0x022d('0x66')];});return db[_0x022d('0x2e')]['find']({'where':{'id':_0x531c04[_0x022d('0x4a')]['id']}})[_0x022d('0x25')](function(_0x25f7b5){return db[_0x022d('0x6a')][_0x022d('0x6b')](function(_0x2ee309){return _0x25f7b5[_0x022d('0x63')](_0x314331,{'transaction':_0x2ee309})[_0x022d('0x25')](function(){return BPromise[_0x022d('0x6c')](_0x23ae54,function(_0x43ee86){return db[_0x022d('0x56')]['findOrCreate']({'where':{'UserId':_0x43ee86['id'],'OpenchannelQueueId':_0x531c04[_0x022d('0x4a')]['id']},'transaction':_0x2ee309});});})['then'](function(){_0x23ae54[_0x022d('0x6d')](function(_0x2c9b4f){socket[_0x022d('0x6e')](_0x022d('0x6f'),{'UserId':_0x2c9b4f['id'],'OpenchannelQueueId':_0x25f7b5['id']});});});});});}})[_0x022d('0x25')](respondWithStatusCode(_0x8f6bb8,null))[_0x022d('0x48')](handleError(_0x8f6bb8,null));};exports[_0x022d('0x70')]=function(_0x15f8a5,_0x3b7868,_0xcdce46){return db[_0x022d('0x62')]['findAll']({'where':{'id':_0x15f8a5[_0x022d('0x34')][_0x022d('0x64')]},'attributes':['id'],'include':[{'model':db[_0x022d('0x65')],'as':_0x022d('0x66'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3b7868,null))[_0x022d('0x25')](function(_0x23cc77){var _0x4534b6=_['map'](_0x23cc77,'id');var _0x1a603c=[];var _0x386197=[];var _0x43303c=squel['select']();_0x43303c['field']('tq.TeamId')[_0x022d('0x71')]('team_has_openchannel_queues','tq')[_0x022d('0x72')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x022d('0x40')]('OpenchannelQueueId\x20=\x20?',_0x15f8a5['params']['id']);for(var _0xcba340=0x0;_0xcba340<_0x23cc77[_0x022d('0x3a')];_0xcba340+=0x1){let _0x4bdac1=_0x23cc77[_0xcba340];for(var _0x4cc611=0x0;_0x4cc611<_0x4bdac1[_0x022d('0x66')][_0x022d('0x3a')];_0x4cc611+=0x1){let _0x5158a1=_0x4bdac1[_0x022d('0x66')][_0x4cc611];var _0x4a88f9=_0x43303c[_0x022d('0x73')]();_0x4a88f9['where'](_0x022d('0x74'),_0x5158a1['id']);_0x386197[_0x022d('0x75')](db['sequelize'][_0x022d('0x34')](_0x4a88f9[_0x022d('0x76')](),{'type':db['sequelize'][_0x022d('0x77')][_0x022d('0x78')]})[_0x022d('0x25')](function(_0x490a9f){if(_0x490a9f[_0x022d('0x3a')]===0x1){return _0x5158a1['id'];}else{var _0x22650e=_[_0x022d('0x79')](_[_0x022d('0x32')](_0x490a9f,_0x022d('0x7a')),function(_0x18c34d){return _[_0x022d('0x7b')](_0x4534b6,_0x18c34d);});if(_0x22650e){return _0x5158a1['id'];}}}));}}return BPromise[_0x022d('0x7c')](_0x386197)['then'](function(_0x9f0157){_0x1a603c=_(_0x1a603c)[_0x022d('0x7d')](_0x9f0157)[_0x022d('0x7e')]()[_0x022d('0x7f')]();return db[_0x022d('0x2e')]['find']({'where':{'id':_0x15f8a5['params']['id']}})[_0x022d('0x25')](function(_0xf78025){return db[_0x022d('0x6a')][_0x022d('0x6b')](function(_0x1376e2){return _0xf78025[_0x022d('0x70')](_0x15f8a5['query'][_0x022d('0x64')],{'transaction':_0x1376e2})[_0x022d('0x25')](function(){if(!_[_0x022d('0x80')](_0x1a603c)){return _0xf78025[_0x022d('0x81')](_0x1a603c,{'transaction':_0x1376e2});}})['then'](function(){_0x1a603c[_0x022d('0x6d')](function(_0xc54f27){socket[_0x022d('0x6e')](_0x022d('0x82'),{'UserId':_0xc54f27,'OpenchannelQueueId':_0xf78025['id']});});});});});});})['then'](respondWithStatusCode(_0x3b7868,null))['catch'](handleError(_0x3b7868,null));};exports[_0x022d('0x83')]=function(_0x1afa67,_0x2de7b1,_0x1fb8c3){return db[_0x022d('0x2e')][_0x022d('0x4b')]({'where':{'id':_0x1afa67[_0x022d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2de7b1,null))['then'](function(_0x263e01){if(_0x263e01){return _0x263e01[_0x022d('0x83')](_0x1afa67[_0x022d('0x52')][_0x022d('0x64')],_[_0x022d('0x84')](_0x1afa67['body'],[_0x022d('0x64'),'id'])||{})[_0x022d('0x85')](function(_0x20afe1){for(var _0xa32f43=0x0;_0xa32f43<_0x1afa67['body']['ids'][_0x022d('0x3a')];_0xa32f43+=0x1){socket[_0x022d('0x6e')](_0x022d('0x6f'),{'UserId':_0x1afa67[_0x022d('0x52')][_0x022d('0x64')][_0xa32f43],'OpenchannelQueueId':_0x1afa67[_0x022d('0x4a')]['id']});}return _0x20afe1;});}})[_0x022d('0x25')](respondWithResult(_0x2de7b1,null))[_0x022d('0x48')](handleError(_0x2de7b1,null));};exports[_0x022d('0x81')]=function(_0x1f41f6,_0x28891f,_0x2d0d9b){return db['OpenchannelQueue']['find']({'where':{'id':_0x1f41f6[_0x022d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x28891f,null))['then'](function(_0x5f5d8b){if(_0x5f5d8b){return _0x5f5d8b[_0x022d('0x81')](_0x1f41f6[_0x022d('0x34')]['ids'])['then'](function(){if(_['isArray'](_0x1f41f6['query']['ids'])){for(var _0x3c320a=0x0;_0x3c320a<_0x1f41f6['query'][_0x022d('0x64')][_0x022d('0x3a')];_0x3c320a+=0x1){socket[_0x022d('0x6e')]('userOpenchannelQueue:remove',{'UserId':Number(_0x1f41f6[_0x022d('0x34')][_0x022d('0x64')][_0x3c320a]),'OpenchannelQueueId':Number(_0x1f41f6['params']['id'])});}}else{socket[_0x022d('0x6e')](_0x022d('0x82'),{'UserId':Number(_0x1f41f6['query'][_0x022d('0x64')]),'OpenchannelQueueId':Number(_0x1f41f6[_0x022d('0x4a')]['id'])});}});}})[_0x022d('0x25')](respondWithStatusCode(_0x28891f,null))[_0x022d('0x48')](handleError(_0x28891f,null));};exports['getAgents']=function(_0xf47c46,_0x51473f,_0x20b767){var _0x310cd8={};var _0x382bc7={};var _0x541911;var _0x50d160;return db[_0x022d('0x2e')][_0x022d('0x55')]({'where':{'id':_0xf47c46['params']['id']}})[_0x022d('0x25')](handleEntityNotFound(_0x51473f,null))[_0x022d('0x25')](function(_0xc6352c){if(_0xc6352c){_0x541911=_0xc6352c;_0x382bc7['model']=_[_0x022d('0x35')](db[_0x022d('0x65')][_0x022d('0x2f')]);_0x382bc7['query']=_[_0x022d('0x35')](_0xf47c46[_0x022d('0x34')]);_0x382bc7['filters']=_[_0x022d('0x37')](_0x382bc7[_0x022d('0x31')],_0x382bc7[_0x022d('0x34')]);_0x310cd8[_0x022d('0x38')]=_[_0x022d('0x37')](_0x382bc7['model'],qs[_0x022d('0x39')](_0xf47c46['query']['fields']));_0x310cd8[_0x022d('0x38')]=_0x310cd8[_0x022d('0x38')]['length']?_0x310cd8[_0x022d('0x38')]:_0x382bc7['model'];_0x310cd8[_0x022d('0x3c')]=qs[_0x022d('0x3d')](_0xf47c46[_0x022d('0x34')][_0x022d('0x3d')]);_0x310cd8[_0x022d('0x40')]=qs[_0x022d('0x36')](_['pick'](_0xf47c46['query'],_0x382bc7[_0x022d('0x36')]));if(_0xf47c46[_0x022d('0x34')][_0x022d('0x3f')]){_0x310cd8['where']=_[_0x022d('0x58')](_0x310cd8[_0x022d('0x40')],{'$or':_[_0x022d('0x32')](_0x310cd8[_0x022d('0x38')],function(_0x463eba){var _0x43259b={};_0x43259b[_0x463eba]={'$like':'%'+_0xf47c46[_0x022d('0x34')]['filter']+'%'};return _0x43259b;})});}_0x310cd8=_[_0x022d('0x58')]({},_0x310cd8,_0xf47c46[_0x022d('0x42')]);return _0x541911[_0x022d('0x86')](_0x310cd8);}})[_0x022d('0x25')](function(_0x4aa723){if(_0x4aa723){_0x50d160=_0x4aa723[_0x022d('0x3a')];if(!_0xf47c46[_0x022d('0x34')][_0x022d('0x57')](_0x022d('0x3b'))){_0x310cd8[_0x022d('0x1e')]=qs[_0x022d('0x1e')](_0xf47c46[_0x022d('0x34')][_0x022d('0x1e')]);_0x310cd8[_0x022d('0x1d')]=qs[_0x022d('0x1d')](_0xf47c46[_0x022d('0x34')][_0x022d('0x1d')]);}return _0x541911[_0x022d('0x86')](_0x310cd8);}})[_0x022d('0x25')](function(_0x3fdb06){if(_0x3fdb06){return _0x3fdb06?{'count':_0x50d160,'rows':_0x3fdb06}:null;}})[_0x022d('0x25')](respondWithResult(_0x51473f,null))[_0x022d('0x48')](handleError(_0x51473f,null));}; \ No newline at end of file +var _0x868a=['params','keys','length','options','find','catch','create','body','user','get','role','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','Agents','clone','QueryTypes','every','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','userOpenchannelQueue:save','userOpenchannelQueue:remove','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','stack','name','send','index','OpenchannelQueue','rawAttributes','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show'];(function(_0x463408,_0x2de9dd){var _0x4a9ba7=function(_0x290197){while(--_0x290197){_0x463408['push'](_0x463408['shift']());}};_0x4a9ba7(++_0x2de9dd);}(_0x868a,0x14f));var _0xa868=function(_0x4001dc,_0x1632f0){_0x4001dc=_0x4001dc-0x0;var _0xf22e0e=_0x868a[_0x4001dc];return _0xf22e0e;};'use strict';var pdf=require(_0xa868('0x0'));var emlformat=require(_0xa868('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa868('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa868('0x3'));var moment=require(_0xa868('0x4'));var BPromise=require(_0xa868('0x5'));var Mustache=require('mustache');var util=require(_0xa868('0x6'));var path=require(_0xa868('0x7'));var sox=require('sox');var csv=require(_0xa868('0x8'));var ejs=require(_0xa868('0x9'));var fs=require('fs');var _=require(_0xa868('0xa'));var squel=require('squel');var crypto=require(_0xa868('0xb'));var jsforce=require(_0xa868('0xc'));var deskjs=require(_0xa868('0xd'));var toCsv=require(_0xa868('0x8'));var querystring=require(_0xa868('0xe'));var Papa=require(_0xa868('0xf'));var Redis=require(_0xa868('0x10'));var authService=require(_0xa868('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa868('0x12'));var logger=require(_0xa868('0x13'))(_0xa868('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa868('0x15'))['db'];config[_0xa868('0x16')]=_[_0xa868('0x17')](config[_0xa868('0x16')],{'host':_0xa868('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa868('0x16')]));require(_0xa868('0x19'))['register'](socket);function respondWithStatusCode(_0x5d0170,_0x1a23a0){_0x1a23a0=_0x1a23a0||0xcc;return function(_0x52b6ac){if(_0x52b6ac){return _0x5d0170[_0xa868('0x1a')](_0x1a23a0);}return _0x5d0170[_0xa868('0x1b')](_0x1a23a0)[_0xa868('0x1c')]();};}function respondWithResult(_0x1065e0,_0x10faa7){_0x10faa7=_0x10faa7||0xc8;return function(_0x90b699){if(_0x90b699){return _0x1065e0[_0xa868('0x1b')](_0x10faa7)[_0xa868('0x1d')](_0x90b699);}};}function respondWithFilteredResult(_0x41b947,_0x4347a0){return function(_0x5cc4d3){if(_0x5cc4d3){var _0x3310c8=_0x5cc4d3[_0xa868('0x1e')],_0x1fba52=_0x4347a0[_0xa868('0x1f')],_0x4485a4=_0x4347a0[_0xa868('0x1f')]+_0x4347a0[_0xa868('0x20')],_0x35362f;if(_0x4485a4>=_0x3310c8){_0x4485a4=_0x3310c8;_0x35362f=0xc8;}else{_0x35362f=0xce;}_0x41b947[_0xa868('0x1b')](_0x35362f);return _0x41b947[_0xa868('0x21')](_0xa868('0x22'),_0x1fba52+'-'+_0x4485a4+'/'+_0x3310c8)['json'](_0x5cc4d3);}return null;};}function patchUpdates(_0x13e551){return function(_0x6d4439){try{jsonpatch['apply'](_0x6d4439,_0x13e551,!![]);}catch(_0x372576){return BPromise['reject'](_0x372576);}return _0x6d4439[_0xa868('0x23')]();};}function saveUpdates(_0x52a2f3,_0x52638f){return function(_0x5ddd08){if(_0x5ddd08){return _0x5ddd08[_0xa868('0x24')](_0x52a2f3)[_0xa868('0x25')](function(_0xf66fa5){return _0xf66fa5;});}return null;};}function removeEntity(_0x3e3c86,_0x5b89bd){return function(_0x4d424a){if(_0x4d424a){return _0x4d424a[_0xa868('0x26')]()[_0xa868('0x25')](function(){var _0x4de751=_0x4d424a['get']({'plain':!![]});var _0x269e09='OpenchannelQueues';return db['UserProfileResource'][_0xa868('0x26')]({'where':{'type':_0x269e09,'resourceId':_0x4de751['id']}})[_0xa868('0x25')](function(){return _0x4d424a;});})[_0xa868('0x25')](function(){_0x3e3c86[_0xa868('0x1b')](0xcc)[_0xa868('0x1c')]();});}};}function handleEntityNotFound(_0x2cba58,_0x3f69b8){return function(_0x56f1a7){if(!_0x56f1a7){_0x2cba58[_0xa868('0x1a')](0x194);}return _0x56f1a7;};}function handleError(_0x22f47f,_0x274b31){_0x274b31=_0x274b31||0x1f4;return function(_0x5c0dd2){logger['error'](_0x5c0dd2[_0xa868('0x27')]);if(_0x5c0dd2[_0xa868('0x28')]){delete _0x5c0dd2[_0xa868('0x28')];}_0x22f47f['status'](_0x274b31)[_0xa868('0x29')](_0x5c0dd2);};}exports[_0xa868('0x2a')]=function(_0x22d42d,_0x58894b){var _0x533ac2={},_0x25b348={},_0x4a28c2={'count':0x0,'rows':[]};var _0x354a0e=_['map'](db[_0xa868('0x2b')][_0xa868('0x2c')],function(_0x32bbac){return{'name':_0x32bbac['fieldName'],'type':_0x32bbac['type']['key']};});_0x25b348[_0xa868('0x2d')]=_[_0xa868('0x2e')](_0x354a0e,_0xa868('0x28'));_0x25b348[_0xa868('0x2f')]=_['keys'](_0x22d42d[_0xa868('0x2f')]);_0x25b348[_0xa868('0x30')]=_[_0xa868('0x31')](_0x25b348[_0xa868('0x2d')],_0x25b348[_0xa868('0x2f')]);_0x533ac2[_0xa868('0x32')]=_['intersection'](_0x25b348['model'],qs['fields'](_0x22d42d[_0xa868('0x2f')][_0xa868('0x33')]));_0x533ac2[_0xa868('0x32')]=_0x533ac2['attributes']['length']?_0x533ac2[_0xa868('0x32')]:_0x25b348[_0xa868('0x2d')];if(!_0x22d42d[_0xa868('0x2f')][_0xa868('0x34')](_0xa868('0x35'))){_0x533ac2[_0xa868('0x20')]=qs[_0xa868('0x20')](_0x22d42d[_0xa868('0x2f')][_0xa868('0x20')]);_0x533ac2[_0xa868('0x1f')]=qs['offset'](_0x22d42d[_0xa868('0x2f')][_0xa868('0x1f')]);}_0x533ac2[_0xa868('0x36')]=qs[_0xa868('0x37')](_0x22d42d[_0xa868('0x2f')]['sort']);_0x533ac2[_0xa868('0x38')]=qs[_0xa868('0x30')](_[_0xa868('0x39')](_0x22d42d[_0xa868('0x2f')],_0x25b348[_0xa868('0x30')]));if(_0x22d42d[_0xa868('0x2f')][_0xa868('0x3a')]){_0x533ac2[_0xa868('0x38')]=_[_0xa868('0x3b')](_0x533ac2[_0xa868('0x38')],{'$or':_[_0xa868('0x2e')](_0x354a0e,function(_0x42805a){if(_0x42805a[_0xa868('0x3c')]!==_0xa868('0x3d')){var _0x27ed45={};_0x27ed45[_0x42805a[_0xa868('0x28')]]={'$like':'%'+_0x22d42d[_0xa868('0x2f')][_0xa868('0x3a')]+'%'};return _0x27ed45;}})});}_0x533ac2=_[_0xa868('0x3b')]({},_0x533ac2,_0x22d42d['options']);var _0x8ea7d={'where':_0x533ac2['where']};return db[_0xa868('0x2b')][_0xa868('0x1e')](_0x8ea7d)['then'](function(_0x2e4fdf){_0x4a28c2[_0xa868('0x1e')]=_0x2e4fdf;if(_0x22d42d[_0xa868('0x2f')][_0xa868('0x3e')]){_0x533ac2[_0xa868('0x3f')]=[{'all':!![]}];}return db[_0xa868('0x2b')][_0xa868('0x40')](_0x533ac2);})['then'](function(_0x1d5316){_0x4a28c2[_0xa868('0x41')]=_0x1d5316;return _0x4a28c2;})[_0xa868('0x25')](respondWithFilteredResult(_0x58894b,_0x533ac2))['catch'](handleError(_0x58894b,null));};exports[_0xa868('0x42')]=function(_0x132cd0,_0x372d57){var _0x4ad5b3={'raw':!![],'where':{'id':_0x132cd0[_0xa868('0x43')]['id']}},_0x87cede={};_0x87cede[_0xa868('0x2d')]=_[_0xa868('0x44')](db[_0xa868('0x2b')][_0xa868('0x2c')]);_0x87cede[_0xa868('0x2f')]=_[_0xa868('0x44')](_0x132cd0[_0xa868('0x2f')]);_0x87cede[_0xa868('0x30')]=_['intersection'](_0x87cede[_0xa868('0x2d')],_0x87cede[_0xa868('0x2f')]);_0x4ad5b3['attributes']=_['intersection'](_0x87cede[_0xa868('0x2d')],qs[_0xa868('0x33')](_0x132cd0[_0xa868('0x2f')][_0xa868('0x33')]));_0x4ad5b3[_0xa868('0x32')]=_0x4ad5b3[_0xa868('0x32')][_0xa868('0x45')]?_0x4ad5b3[_0xa868('0x32')]:_0x87cede[_0xa868('0x2d')];if(_0x132cd0[_0xa868('0x2f')][_0xa868('0x3e')]){_0x4ad5b3[_0xa868('0x3f')]=[{'all':!![]}];}_0x4ad5b3=_[_0xa868('0x3b')]({},_0x4ad5b3,_0x132cd0[_0xa868('0x46')]);return db['OpenchannelQueue'][_0xa868('0x47')](_0x4ad5b3)[_0xa868('0x25')](handleEntityNotFound(_0x372d57,null))[_0xa868('0x25')](respondWithResult(_0x372d57,null))[_0xa868('0x48')](handleError(_0x372d57,null));};exports[_0xa868('0x49')]=function(_0x43cceb,_0x356d42){return db[_0xa868('0x2b')][_0xa868('0x49')](_0x43cceb[_0xa868('0x4a')],{})[_0xa868('0x25')](function(_0x38e676){var _0x3d8f73=_0x43cceb[_0xa868('0x4b')][_0xa868('0x4c')]({'plain':!![]});if(!_0x3d8f73)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d8f73[_0xa868('0x4d')]===_0xa868('0x4b')){var _0x40146b=_0x38e676[_0xa868('0x4c')]({'plain':!![]});var _0x569676=_0xa868('0x4e');return db[_0xa868('0x4f')]['find']({'where':{'name':_0x569676,'userProfileId':_0x3d8f73[_0xa868('0x50')]},'raw':!![]})['then'](function(_0x153f41){if(_0x153f41&&_0x153f41[_0xa868('0x51')]===0x0){return db['UserProfileResource'][_0xa868('0x49')]({'name':_0x40146b[_0xa868('0x28')],'resourceId':_0x40146b['id'],'type':_0x153f41['name'],'sectionId':_0x153f41['id']},{})[_0xa868('0x25')](function(){return _0x38e676;});}else{return _0x38e676;}})['catch'](function(_0x2f223c){logger[_0xa868('0x52')](_0xa868('0x53'),_0x2f223c);throw _0x2f223c;});}return _0x38e676;})[_0xa868('0x25')](respondWithResult(_0x356d42,0xc9))[_0xa868('0x48')](handleError(_0x356d42,null));};exports[_0xa868('0x24')]=function(_0xb86915,_0x531c70){if(_0xb86915['body']['id']){delete _0xb86915['body']['id'];}return db['OpenchannelQueue'][_0xa868('0x47')]({'where':{'id':_0xb86915[_0xa868('0x43')]['id']}})[_0xa868('0x25')](handleEntityNotFound(_0x531c70,null))[_0xa868('0x25')](saveUpdates(_0xb86915[_0xa868('0x4a')],null))[_0xa868('0x25')](respondWithResult(_0x531c70,null))[_0xa868('0x48')](handleError(_0x531c70,null));};exports[_0xa868('0x26')]=function(_0x5e1758,_0x4b7f28){return db[_0xa868('0x2b')][_0xa868('0x47')]({'where':{'id':_0x5e1758[_0xa868('0x43')]['id']}})['then'](handleEntityNotFound(_0x4b7f28,null))[_0xa868('0x25')](removeEntity(_0x4b7f28,null))[_0xa868('0x48')](handleError(_0x4b7f28,null));};exports['describe']=function(_0x445613,_0x93deec){return db[_0xa868('0x2b')]['describe']()[_0xa868('0x25')](respondWithResult(_0x93deec,null))['catch'](handleError(_0x93deec,null));};exports[_0xa868('0x54')]=function(_0x25bfe4,_0x338473,_0x4374cd){var _0x52a1f5={'raw':!![],'where':{}},_0x2b661b={},_0x41a80e;return db[_0xa868('0x2b')]['findOne']({'where':{'id':_0x25bfe4[_0xa868('0x43')]['id']}})[_0xa868('0x25')](handleEntityNotFound(_0x338473,null))['then'](function(_0x10cb51){if(_0x10cb51){_0x41a80e=_0x10cb51[_0xa868('0x4c')]({'plain':!![]});_0x2b661b[_0xa868('0x2d')]=_[_0xa868('0x44')](db[_0xa868('0x55')]['rawAttributes']);_0x2b661b[_0xa868('0x2f')]=_[_0xa868('0x44')](_0x25bfe4['query']);_0x2b661b[_0xa868('0x30')]=_['intersection'](_0x2b661b[_0xa868('0x2d')],_0x2b661b[_0xa868('0x2f')]);_0x52a1f5['attributes']=_[_0xa868('0x31')](_0x2b661b[_0xa868('0x2d')],qs[_0xa868('0x33')](_0x25bfe4['query']['fields']));_0x52a1f5[_0xa868('0x32')]=_0x52a1f5[_0xa868('0x32')][_0xa868('0x45')]?_0x52a1f5[_0xa868('0x32')]:_0x2b661b['model'];if(!_0x25bfe4[_0xa868('0x2f')][_0xa868('0x34')]('nolimit')){_0x52a1f5[_0xa868('0x20')]=qs[_0xa868('0x20')](_0x25bfe4[_0xa868('0x2f')]['limit']);_0x52a1f5[_0xa868('0x1f')]=qs[_0xa868('0x1f')](_0x25bfe4[_0xa868('0x2f')][_0xa868('0x1f')]);}_0x52a1f5[_0xa868('0x36')]=qs['sort'](_0x25bfe4[_0xa868('0x2f')][_0xa868('0x37')]);_0x52a1f5[_0xa868('0x38')]=qs[_0xa868('0x30')](_[_0xa868('0x39')](_0x25bfe4[_0xa868('0x2f')],_0x2b661b[_0xa868('0x30')]));_0x52a1f5['where'][_0xa868('0x56')]=_0x10cb51['id'];if(_0x25bfe4[_0xa868('0x2f')]['filter']){_0x52a1f5[_0xa868('0x38')]=_[_0xa868('0x3b')](_0x52a1f5[_0xa868('0x38')],{'$or':_[_0xa868('0x2e')](_0x52a1f5[_0xa868('0x32')],function(_0x2531cc){var _0x1bcfd4={};_0x1bcfd4[_0x2531cc]={'$like':'%'+_0x25bfe4[_0xa868('0x2f')][_0xa868('0x3a')]+'%'};return _0x1bcfd4;})});}_0x52a1f5=_[_0xa868('0x3b')]({},_0x52a1f5,_0x25bfe4[_0xa868('0x46')]);return db['UserOpenchannelQueue'][_0xa868('0x40')](_0x52a1f5);}})[_0xa868('0x25')](function(_0x21b4db){if(_0x21b4db){return db[_0xa868('0x57')][_0xa868('0x58')]({'where':{'id':_['map'](_0x21b4db,_0xa868('0x59')),'role':'agent'},'attributes':['id',_0xa868('0x28'),_0xa868('0x5a'),_0xa868('0x5b'),_0xa868('0x5c')]});}})[_0xa868('0x25')](function(_0x36f154){if(_0x36f154){return{'count':_0x36f154[_0xa868('0x1e')],'rows':_[_0xa868('0x2e')](_0x36f154[_0xa868('0x41')],function(_0x12b05a){return{'membername':_0x12b05a['name'],'UserId':_0x12b05a['id'],'queue_name':_0x41a80e[_0xa868('0x28')],'OpenchannelQueueId':_0x41a80e['id'],'interface':util[_0xa868('0x5d')](_0xa868('0x5e'),_0xa868('0x5f'),_0x12b05a['name']),'penalty':0x0,'paused':_0x12b05a[_0xa868('0x5a')],'createdAt':_0x12b05a['createdAt'],'updatedAt':_0x12b05a[_0xa868('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa868('0x25')](respondWithFilteredResult(_0x338473,_0x52a1f5))[_0xa868('0x48')](handleError(_0x338473,null));};exports[_0xa868('0x60')]=function(_0x28d3d8,_0x468f20,_0x268829){var _0x3abd37={};var _0x38bd33={};var _0x737e5c;var _0x5a2bec;return db[_0xa868('0x2b')][_0xa868('0x61')]({'where':{'id':_0x28d3d8[_0xa868('0x43')]['id']}})[_0xa868('0x25')](handleEntityNotFound(_0x468f20,null))[_0xa868('0x25')](function(_0x24105c){if(_0x24105c){_0x737e5c=_0x24105c;_0x38bd33['model']=_[_0xa868('0x44')](db[_0xa868('0x62')][_0xa868('0x2c')]);_0x38bd33[_0xa868('0x2f')]=_[_0xa868('0x44')](_0x28d3d8['query']);_0x38bd33[_0xa868('0x30')]=_['intersection'](_0x38bd33[_0xa868('0x2d')],_0x38bd33['query']);_0x3abd37[_0xa868('0x32')]=_['intersection'](_0x38bd33[_0xa868('0x2d')],qs['fields'](_0x28d3d8[_0xa868('0x2f')]['fields']));_0x3abd37[_0xa868('0x32')]=_0x3abd37[_0xa868('0x32')][_0xa868('0x45')]?_0x3abd37['attributes']:_0x38bd33['model'];_0x3abd37[_0xa868('0x36')]=qs[_0xa868('0x37')](_0x28d3d8[_0xa868('0x2f')][_0xa868('0x37')]);_0x3abd37[_0xa868('0x38')]=qs['filters'](_['pick'](_0x28d3d8[_0xa868('0x2f')],_0x38bd33[_0xa868('0x30')]));if(_0x28d3d8[_0xa868('0x2f')]['filter']){_0x3abd37['where']=_['merge'](_0x3abd37[_0xa868('0x38')],{'$or':_[_0xa868('0x2e')](_0x3abd37[_0xa868('0x32')],function(_0x303da5){var _0x30caa0={};_0x30caa0[_0x303da5]={'$like':'%'+_0x28d3d8['query'][_0xa868('0x3a')]+'%'};return _0x30caa0;})});}_0x3abd37=_[_0xa868('0x3b')]({},_0x3abd37,_0x28d3d8['options']);return _0x737e5c['getTeams'](_0x3abd37);}})['then'](function(_0x1f51ab){if(_0x1f51ab){_0x5a2bec=_0x1f51ab[_0xa868('0x45')];if(!_0x28d3d8[_0xa868('0x2f')][_0xa868('0x34')](_0xa868('0x35'))){_0x3abd37['limit']=qs[_0xa868('0x20')](_0x28d3d8[_0xa868('0x2f')][_0xa868('0x20')]);_0x3abd37[_0xa868('0x1f')]=qs['offset'](_0x28d3d8[_0xa868('0x2f')][_0xa868('0x1f')]);}return _0x737e5c[_0xa868('0x60')](_0x3abd37);}})['then'](function(_0x1d5b28){if(_0x1d5b28){return _0x1d5b28?{'count':_0x5a2bec,'rows':_0x1d5b28}:null;}})[_0xa868('0x25')](respondWithResult(_0x468f20,null))[_0xa868('0x48')](handleError(_0x468f20,null));};exports['addTeams']=function(_0x374ad4,_0x21c846,_0x267646){var _0x554577=_0x374ad4[_0xa868('0x4a')]['ids'];return db[_0xa868('0x62')][_0xa868('0x40')]({'where':{'id':_0x554577},'attributes':['id'],'include':[{'model':db[_0xa868('0x57')],'as':'Agents','attributes':['id',_0xa868('0x28'),'online',_0xa868('0x63'),_0xa868('0x64')],'raw':!![]}]})[_0xa868('0x25')](function(_0x606e6f){if(_0x606e6f){var _0x3e7723=_['flatMap'](_0x606e6f,function(_0x444ce7){var _0x318cc6=_0x444ce7[_0xa868('0x4c')]({'plain':!![]});return _0x318cc6['Agents'];});return db[_0xa868('0x2b')][_0xa868('0x47')]({'where':{'id':_0x374ad4['params']['id']}})[_0xa868('0x25')](function(_0x1a3390){return db[_0xa868('0x65')][_0xa868('0x66')](function(_0x2daa29){return _0x1a3390['addTeams'](_0x554577,{'transaction':_0x2daa29})[_0xa868('0x25')](function(){return BPromise[_0xa868('0x67')](_0x3e7723,function(_0x4a5854){return db['UserOpenchannelQueue'][_0xa868('0x68')]({'where':{'UserId':_0x4a5854['id'],'OpenchannelQueueId':_0x374ad4[_0xa868('0x43')]['id']},'transaction':_0x2daa29});});})[_0xa868('0x25')](function(){_0x3e7723[_0xa868('0x69')](function(_0x3ac8f4){socket[_0xa868('0x6a')]('userOpenchannelQueue:save',{'UserId':_0x3ac8f4['id'],'OpenchannelQueueId':_0x1a3390['id']});});});});});}})['then'](respondWithStatusCode(_0x21c846,null))[_0xa868('0x48')](handleError(_0x21c846,null));};exports[_0xa868('0x6b')]=function(_0x152d39,_0x427f4c,_0x4c64ab){return db[_0xa868('0x62')]['findAll']({'where':{'id':_0x152d39[_0xa868('0x2f')][_0xa868('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xa868('0x57')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa868('0x25')](handleEntityNotFound(_0x427f4c,null))['then'](function(_0x57a7de){var _0x445c89=_[_0xa868('0x2e')](_0x57a7de,'id');var _0x5bb63b=[];var _0x5ad4a2=[];var _0x41a2be=squel[_0xa868('0x6d')]();_0x41a2be[_0xa868('0x6e')](_0xa868('0x6f'))[_0xa868('0x70')](_0xa868('0x71'),'tq')[_0xa868('0x72')](_0xa868('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa868('0x38')](_0xa868('0x74'),_0x152d39[_0xa868('0x43')]['id']);for(var _0x5f2ba1=0x0;_0x5f2ba1<_0x57a7de[_0xa868('0x45')];_0x5f2ba1+=0x1){let _0x5330c6=_0x57a7de[_0x5f2ba1];for(var _0x5d51bd=0x0;_0x5d51bd<_0x5330c6['Agents'][_0xa868('0x45')];_0x5d51bd+=0x1){let _0x3f34af=_0x5330c6[_0xa868('0x75')][_0x5d51bd];var _0x199f52=_0x41a2be[_0xa868('0x76')]();_0x199f52[_0xa868('0x38')]('ut.UserId\x20=\x20?',_0x3f34af['id']);_0x5ad4a2['push'](db[_0xa868('0x65')]['query'](_0x199f52['toString'](),{'type':db['sequelize'][_0xa868('0x77')]['SELECT']})['then'](function(_0x30f1c7){if(_0x30f1c7[_0xa868('0x45')]===0x1){return _0x3f34af['id'];}else{var _0x4b0e05=_[_0xa868('0x78')](_[_0xa868('0x2e')](_0x30f1c7,'TeamId'),function(_0x467e6c){return _[_0xa868('0x79')](_0x445c89,_0x467e6c);});if(_0x4b0e05){return _0x3f34af['id'];}}}));}}return BPromise[_0xa868('0x7a')](_0x5ad4a2)[_0xa868('0x25')](function(_0xe5b469){_0x5bb63b=_(_0x5bb63b)[_0xa868('0x7b')](_0xe5b469)[_0xa868('0x7c')]()[_0xa868('0x7d')]();return db[_0xa868('0x2b')][_0xa868('0x47')]({'where':{'id':_0x152d39['params']['id']}})[_0xa868('0x25')](function(_0x44ada5){return db[_0xa868('0x65')][_0xa868('0x66')](function(_0x325fee){return _0x44ada5[_0xa868('0x6b')](_0x152d39[_0xa868('0x2f')][_0xa868('0x6c')],{'transaction':_0x325fee})['then'](function(){if(!_[_0xa868('0x7e')](_0x5bb63b)){return _0x44ada5[_0xa868('0x7f')](_0x5bb63b,{'transaction':_0x325fee});}})['then'](function(){_0x5bb63b['forEach'](function(_0x359acd){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x359acd,'OpenchannelQueueId':_0x44ada5['id']});});});});});});})[_0xa868('0x25')](respondWithStatusCode(_0x427f4c,null))['catch'](handleError(_0x427f4c,null));};exports['addAgents']=function(_0x39e81a,_0x34d89b,_0x2e0a09){return db[_0xa868('0x2b')][_0xa868('0x47')]({'where':{'id':_0x39e81a[_0xa868('0x43')]['id']}})['then'](handleEntityNotFound(_0x34d89b,null))[_0xa868('0x25')](function(_0x4472d1){if(_0x4472d1){return _0x4472d1[_0xa868('0x80')](_0x39e81a['body'][_0xa868('0x6c')],_[_0xa868('0x81')](_0x39e81a[_0xa868('0x4a')],[_0xa868('0x6c'),'id'])||{})[_0xa868('0x82')](function(_0x35279a){for(var _0x2c5f2f=0x0;_0x2c5f2f<_0x39e81a[_0xa868('0x4a')]['ids'][_0xa868('0x45')];_0x2c5f2f+=0x1){socket[_0xa868('0x6a')](_0xa868('0x83'),{'UserId':_0x39e81a['body'][_0xa868('0x6c')][_0x2c5f2f],'OpenchannelQueueId':_0x39e81a['params']['id']});}return _0x35279a;});}})[_0xa868('0x25')](respondWithResult(_0x34d89b,null))[_0xa868('0x48')](handleError(_0x34d89b,null));};exports[_0xa868('0x7f')]=function(_0x3bf472,_0x54be14,_0x257835){return db[_0xa868('0x2b')][_0xa868('0x47')]({'where':{'id':_0x3bf472[_0xa868('0x43')]['id']}})['then'](handleEntityNotFound(_0x54be14,null))[_0xa868('0x25')](function(_0x4d0114){if(_0x4d0114){return _0x4d0114['removeAgents'](_0x3bf472[_0xa868('0x2f')][_0xa868('0x6c')])[_0xa868('0x25')](function(){if(_['isArray'](_0x3bf472[_0xa868('0x2f')][_0xa868('0x6c')])){for(var _0x2fb4a9=0x0;_0x2fb4a9<_0x3bf472['query']['ids'][_0xa868('0x45')];_0x2fb4a9+=0x1){socket[_0xa868('0x6a')](_0xa868('0x84'),{'UserId':Number(_0x3bf472[_0xa868('0x2f')]['ids'][_0x2fb4a9]),'OpenchannelQueueId':Number(_0x3bf472[_0xa868('0x43')]['id'])});}}else{socket[_0xa868('0x6a')](_0xa868('0x84'),{'UserId':Number(_0x3bf472[_0xa868('0x2f')][_0xa868('0x6c')]),'OpenchannelQueueId':Number(_0x3bf472['params']['id'])});}});}})[_0xa868('0x25')](respondWithStatusCode(_0x54be14,null))[_0xa868('0x48')](handleError(_0x54be14,null));};exports[_0xa868('0x85')]=function(_0x2f5125,_0x2d0c3f,_0x7f6ea){var _0x3cd47f={};var _0x54be4f={};var _0x394f27;var _0x29d6e1;return db[_0xa868('0x2b')]['findOne']({'where':{'id':_0x2f5125[_0xa868('0x43')]['id']}})[_0xa868('0x25')](handleEntityNotFound(_0x2d0c3f,null))[_0xa868('0x25')](function(_0x3ff349){if(_0x3ff349){_0x394f27=_0x3ff349;_0x54be4f['model']=_[_0xa868('0x44')](db['User'][_0xa868('0x2c')]);_0x54be4f[_0xa868('0x2f')]=_['keys'](_0x2f5125[_0xa868('0x2f')]);_0x54be4f[_0xa868('0x30')]=_[_0xa868('0x31')](_0x54be4f[_0xa868('0x2d')],_0x54be4f[_0xa868('0x2f')]);_0x3cd47f[_0xa868('0x32')]=_[_0xa868('0x31')](_0x54be4f['model'],qs[_0xa868('0x33')](_0x2f5125[_0xa868('0x2f')][_0xa868('0x33')]));_0x3cd47f[_0xa868('0x32')]=_0x3cd47f['attributes'][_0xa868('0x45')]?_0x3cd47f[_0xa868('0x32')]:_0x54be4f['model'];_0x3cd47f[_0xa868('0x36')]=qs[_0xa868('0x37')](_0x2f5125['query']['sort']);_0x3cd47f[_0xa868('0x38')]=qs[_0xa868('0x30')](_[_0xa868('0x39')](_0x2f5125[_0xa868('0x2f')],_0x54be4f[_0xa868('0x30')]));if(_0x2f5125[_0xa868('0x2f')][_0xa868('0x3a')]){_0x3cd47f['where']=_[_0xa868('0x3b')](_0x3cd47f[_0xa868('0x38')],{'$or':_[_0xa868('0x2e')](_0x3cd47f[_0xa868('0x32')],function(_0x1a1b33){var _0x22a22b={};_0x22a22b[_0x1a1b33]={'$like':'%'+_0x2f5125['query'][_0xa868('0x3a')]+'%'};return _0x22a22b;})});}_0x3cd47f=_[_0xa868('0x3b')]({},_0x3cd47f,_0x2f5125[_0xa868('0x46')]);return _0x394f27[_0xa868('0x85')](_0x3cd47f);}})['then'](function(_0x51b1e7){if(_0x51b1e7){_0x29d6e1=_0x51b1e7[_0xa868('0x45')];if(!_0x2f5125[_0xa868('0x2f')]['hasOwnProperty'](_0xa868('0x35'))){_0x3cd47f['limit']=qs[_0xa868('0x20')](_0x2f5125[_0xa868('0x2f')][_0xa868('0x20')]);_0x3cd47f['offset']=qs['offset'](_0x2f5125['query'][_0xa868('0x1f')]);}return _0x394f27[_0xa868('0x85')](_0x3cd47f);}})[_0xa868('0x25')](function(_0x508e56){if(_0x508e56){return _0x508e56?{'count':_0x29d6e1,'rows':_0x508e56}:null;}})[_0xa868('0x25')](respondWithResult(_0x2d0c3f,null))[_0xa868('0x48')](handleError(_0x2d0c3f,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 5ed0090..be18a97 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 _0xae4a=['../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x21d36e,_0x5dc096){var _0x4cc307=function(_0x4ae995){while(--_0x4ae995){_0x21d36e['push'](_0x21d36e['shift']());}};_0x4cc307(++_0x5dc096);}(_0xae4a,0x83));var _0xaae4=function(_0x4d12b1,_0x45ba80){_0x4d12b1=_0x4d12b1-0x0;var _0x1f20f3=_0xae4a[_0x4d12b1];return _0x1f20f3;};'use strict';var EventEmitter=require(_0xaae4('0x0'));var OpenchannelQueue=require(_0xaae4('0x1'))['db'][_0xaae4('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xaae4('0x3')](0x0);var events={'afterCreate':_0xaae4('0x4'),'afterUpdate':_0xaae4('0x5'),'afterDestroy':_0xaae4('0x6')};function emitEvent(_0x1bfb36){return function(_0x104e20,_0x1215a7,_0x5ac6ad){OpenchannelQueueEvents[_0xaae4('0x7')](_0x1bfb36+':'+_0x104e20['id'],_0x104e20);OpenchannelQueueEvents[_0xaae4('0x7')](_0x1bfb36,_0x104e20);_0x5ac6ad(null);};}for(var e in events){if(events[_0xaae4('0x8')](e)){var event=events[e];OpenchannelQueue[_0xaae4('0x9')](e,emitEvent(event));}}module[_0xaae4('0xa')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x0e90=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x33b043,_0x48d4a9){var _0x2de116=function(_0x2f4077){while(--_0x2f4077){_0x33b043['push'](_0x33b043['shift']());}};_0x2de116(++_0x48d4a9);}(_0x0e90,0x1f4));var _0x00e9=function(_0x38654c,_0x54ee1d){_0x38654c=_0x38654c-0x0;var _0x4dabc0=_0x0e90[_0x38654c];return _0x4dabc0;};'use strict';var EventEmitter=require(_0x00e9('0x0'));var OpenchannelQueue=require(_0x00e9('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x00e9('0x2')](0x0);var events={'afterCreate':_0x00e9('0x3'),'afterUpdate':_0x00e9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2165d6){return function(_0x251221,_0x3401ad,_0x3bfe67){OpenchannelQueueEvents[_0x00e9('0x5')](_0x2165d6+':'+_0x251221['id'],_0x251221);OpenchannelQueueEvents[_0x00e9('0x5')](_0x2165d6,_0x251221);_0x3bfe67(null);};}for(var e in events){if(events[_0x00e9('0x6')](e)){var event=events[e];OpenchannelQueue[_0x00e9('0x7')](e,emitEvent(event));}}module[_0x00e9('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 5df080a..f808add 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 _0x45c8=['bluebird','./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','../../config/logger','api','moment'];(function(_0xa22a94,_0x298d75){var _0x444cef=function(_0x10cf83){while(--_0x10cf83){_0xa22a94['push'](_0xa22a94['shift']());}};_0x444cef(++_0x298d75);}(_0x45c8,0xef));var _0x845c=function(_0x3c3987,_0x1ecc48){_0x3c3987=_0x3c3987-0x0;var _0x200366=_0x45c8[_0x3c3987];return _0x200366;};'use strict';var _=require(_0x845c('0x0'));var util=require('util');var logger=require(_0x845c('0x1'))(_0x845c('0x2'));var moment=require(_0x845c('0x3'));var BPromise=require(_0x845c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x845c('0x5'));module[_0x845c('0x6')]=function(_0x1ff5c6,_0x4e0242){return _0x1ff5c6[_0x845c('0x7')]('OpenchannelQueue',attributes,{'tableName':_0x845c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0427=['api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','../../config/logger'];(function(_0xed01eb,_0x275edb){var _0x25b9de=function(_0x3c331c){while(--_0x3c331c){_0xed01eb['push'](_0xed01eb['shift']());}};_0x25b9de(++_0x275edb);}(_0x0427,0x137));var _0x7042=function(_0x479eb8,_0x4dac99){_0x479eb8=_0x479eb8-0x0;var _0x1dc675=_0x0427[_0x479eb8];return _0x1dc675;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7042('0x0'))(_0x7042('0x1'));var moment=require('moment');var BPromise=require(_0x7042('0x2'));var rp=require(_0x7042('0x3'));var fs=require('fs');var path=require(_0x7042('0x4'));var rimraf=require(_0x7042('0x5'));var config=require(_0x7042('0x6'));var attributes=require(_0x7042('0x7'));module[_0x7042('0x8')]=function(_0x53ab81,_0x37a35b){return _0x53ab81[_0x7042('0x9')](_0x7042('0xa'),attributes,{'tableName':_0x7042('0xb'),'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 6e5d4c1..dc4af90 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 _0x40f4=['raw','where','limit','map','include','model','attributes','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','OpenchannelQueue,\x20%s,\x20%s','catch','OpenchannelQueue','findAll','options'];(function(_0x49ec5f,_0x363c9b){var _0x315ef5=function(_0x380976){while(--_0x380976){_0x49ec5f['push'](_0x49ec5f['shift']());}};_0x315ef5(++_0x363c9b);}(_0x40f4,0x1a4));var _0x440f=function(_0x474e4d,_0x2e4bad){_0x474e4d=_0x474e4d-0x0;var _0x41e52b=_0x40f4[_0x474e4d];return _0x41e52b;};'use strict';var _=require(_0x440f('0x0'));var util=require(_0x440f('0x1'));var moment=require(_0x440f('0x2'));var BPromise=require(_0x440f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x440f('0x4'));var db=require(_0x440f('0x5'))['db'];var utils=require(_0x440f('0x6'));var logger=require('../../config/logger')(_0x440f('0x7'));var config=require(_0x440f('0x8'));var jayson=require(_0x440f('0x9'));var client=jayson[_0x440f('0xa')][_0x440f('0xb')]({'port':0x232a});config[_0x440f('0xc')]=_[_0x440f('0xd')](config[_0x440f('0xc')],{'host':_0x440f('0xe'),'port':0x18eb});var socket=require(_0x440f('0xf'))(new Redis(config['redis']));require(_0x440f('0x10'))[_0x440f('0x11')](socket);function respondWithRpcPromise(_0x60bbcc,_0x2d9f8b,_0x34968a){return new BPromise(function(_0x1630c7,_0xbc90ba){return client[_0x440f('0x12')](_0x60bbcc,_0x34968a)[_0x440f('0x13')](function(_0x24ef11){logger[_0x440f('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x2d9f8b,_0x440f('0x15'));logger[_0x440f('0x16')](_0x440f('0x17'),_0x2d9f8b,_0x440f('0x15'),JSON['stringify'](_0x24ef11));if(_0x24ef11['error']){if(_0x24ef11['error']['code']===0x1f4){logger[_0x440f('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x2d9f8b,_0x24ef11[_0x440f('0x18')][_0x440f('0x19')]);return _0xbc90ba(_0x24ef11['error'][_0x440f('0x19')]);}logger[_0x440f('0x18')](_0x440f('0x1a'),_0x2d9f8b,_0x24ef11[_0x440f('0x18')][_0x440f('0x19')]);return _0x1630c7(_0x24ef11[_0x440f('0x18')][_0x440f('0x19')]);}else{logger[_0x440f('0x14')](_0x440f('0x1a'),_0x2d9f8b,_0x440f('0x15'));_0x1630c7(_0x24ef11['result'][_0x440f('0x19')]);}})[_0x440f('0x1b')](function(_0x20bd50){logger['error'](_0x440f('0x1a'),_0x2d9f8b,_0x20bd50);_0xbc90ba(_0x20bd50);});});}exports['GetOpenchannelQueue']=function(_0x52ced4){var _0x15b8e2=this;return new Promise(function(_0x12627b,_0x595a2f){return db[_0x440f('0x1c')][_0x440f('0x1d')]({'raw':_0x52ced4[_0x440f('0x1e')]?_0x52ced4[_0x440f('0x1e')][_0x440f('0x1f')]===undefined?!![]:![]:!![],'where':_0x52ced4[_0x440f('0x1e')]?_0x52ced4[_0x440f('0x1e')][_0x440f('0x20')]||null:null,'attributes':_0x52ced4['options']?_0x52ced4[_0x440f('0x1e')]['attributes']||null:null,'limit':_0x52ced4['options']?_0x52ced4['options'][_0x440f('0x21')]||null:null,'include':_0x52ced4[_0x440f('0x1e')]?_0x52ced4[_0x440f('0x1e')]['include']?_[_0x440f('0x22')](_0x52ced4[_0x440f('0x1e')][_0x440f('0x23')],function(_0x2517d3){return{'model':db[_0x2517d3[_0x440f('0x24')]],'as':_0x2517d3['as'],'attributes':_0x2517d3[_0x440f('0x25')],'include':_0x2517d3[_0x440f('0x23')]?_[_0x440f('0x22')](_0x2517d3[_0x440f('0x23')],function(_0x34e1f3){return{'model':db[_0x34e1f3[_0x440f('0x24')]],'as':_0x34e1f3['as'],'attributes':_0x34e1f3[_0x440f('0x25')],'include':_0x34e1f3[_0x440f('0x23')]?_[_0x440f('0x22')](_0x34e1f3['include'],function(_0x34bd3d){return{'model':db[_0x34bd3d[_0x440f('0x24')]],'as':_0x34bd3d['as'],'attributes':_0x34bd3d[_0x440f('0x25')]};}):[]};}):[]};}):[]:[]})[_0x440f('0x13')](function(_0x30f817){logger['info'](_0x440f('0x26'),_0x52ced4);logger[_0x440f('0x16')](_0x440f('0x26'),_0x52ced4,JSON[_0x440f('0x27')](_0x30f817));_0x12627b(_0x30f817);})['catch'](function(_0x307e15){logger[_0x440f('0x18')](_0x440f('0x26'),_0x307e15['message'],_0x52ced4);_0x595a2f(_0x15b8e2['error'](0x1f4,_0x307e15['message']));});});};exports['ShowOpenchannelQueue']=function(_0x1b9544){var _0x3b7599=this;return new Promise(function(_0x4cc7f5,_0x4bee9a){return db['OpenchannelQueue']['find']({'raw':_0x1b9544[_0x440f('0x1e')]?_0x1b9544[_0x440f('0x1e')][_0x440f('0x1f')]===undefined?!![]:![]:!![],'where':_0x1b9544[_0x440f('0x1e')]?_0x1b9544[_0x440f('0x1e')][_0x440f('0x20')]||null:null,'attributes':_0x1b9544[_0x440f('0x1e')]?_0x1b9544[_0x440f('0x1e')][_0x440f('0x25')]||null:null,'include':_0x1b9544['options']?_0x1b9544[_0x440f('0x1e')][_0x440f('0x23')]?_[_0x440f('0x22')](_0x1b9544[_0x440f('0x1e')][_0x440f('0x23')],function(_0xfa8190){return{'model':db[_0xfa8190[_0x440f('0x24')]],'as':_0xfa8190['as'],'attributes':_0xfa8190[_0x440f('0x25')],'include':_0xfa8190[_0x440f('0x23')]?_[_0x440f('0x22')](_0xfa8190['include'],function(_0x5ab07a){return{'model':db[_0x5ab07a[_0x440f('0x24')]],'as':_0x5ab07a['as'],'attributes':_0x5ab07a[_0x440f('0x25')],'include':_0x5ab07a[_0x440f('0x23')]?_[_0x440f('0x22')](_0x5ab07a[_0x440f('0x23')],function(_0x26abec){return{'model':db[_0x26abec[_0x440f('0x24')]],'as':_0x26abec['as'],'attributes':_0x26abec['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ed3c7){logger[_0x440f('0x14')](_0x440f('0x28'),_0x1b9544);logger[_0x440f('0x16')]('ShowOpenchannelQueue',_0x1b9544,JSON[_0x440f('0x27')](_0x3ed3c7));_0x4cc7f5(_0x3ed3c7);})[_0x440f('0x1b')](function(_0x1cebe9){logger['error']('ShowOpenchannelQueue',_0x1cebe9[_0x440f('0x19')],_0x1b9544);_0x4bee9a(_0x3b7599[_0x440f('0x18')](0x1f4,_0x1cebe9[_0x440f('0x19')]));});});}; \ No newline at end of file +var _0x5e0b=['http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','info','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','OpenchannelQueue','findAll','options','where','attributes','limit','map','model','include','GetOpenchannelQueue','ShowOpenchannelQueue','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2b81f5,_0x4edaf7){var _0x3ad681=function(_0x2a255e){while(--_0x2a255e){_0x2b81f5['push'](_0x2b81f5['shift']());}};_0x3ad681(++_0x4edaf7);}(_0x5e0b,0x75));var _0xb5e0=function(_0x2650e9,_0xb91cc){_0x2650e9=_0x2650e9-0x0;var _0x3511c8=_0x5e0b[_0x2650e9];return _0x3511c8;};'use strict';var _=require(_0xb5e0('0x0'));var util=require(_0xb5e0('0x1'));var moment=require('moment');var BPromise=require(_0xb5e0('0x2'));var rs=require(_0xb5e0('0x3'));var fs=require('fs');var Redis=require(_0xb5e0('0x4'));var db=require(_0xb5e0('0x5'))['db'];var utils=require(_0xb5e0('0x6'));var logger=require(_0xb5e0('0x7'))(_0xb5e0('0x8'));var config=require(_0xb5e0('0x9'));var jayson=require(_0xb5e0('0xa'));var client=jayson[_0xb5e0('0xb')][_0xb5e0('0xc')]({'port':0x232a});config[_0xb5e0('0xd')]=_[_0xb5e0('0xe')](config[_0xb5e0('0xd')],{'host':_0xb5e0('0xf'),'port':0x18eb});var socket=require(_0xb5e0('0x10'))(new Redis(config[_0xb5e0('0xd')]));require(_0xb5e0('0x11'))['register'](socket);function respondWithRpcPromise(_0x2755f6,_0x41df13,_0x288e83){return new BPromise(function(_0x204930,_0x2a1f21){return client[_0xb5e0('0x12')](_0x2755f6,_0x288e83)[_0xb5e0('0x13')](function(_0x563a26){logger[_0xb5e0('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x41df13,'request\x20sent');logger[_0xb5e0('0x15')](_0xb5e0('0x16'),_0x41df13,_0xb5e0('0x17'),JSON[_0xb5e0('0x18')](_0x563a26));if(_0x563a26[_0xb5e0('0x19')]){if(_0x563a26[_0xb5e0('0x19')]['code']===0x1f4){logger[_0xb5e0('0x19')](_0xb5e0('0x1a'),_0x41df13,_0x563a26[_0xb5e0('0x19')][_0xb5e0('0x1b')]);return _0x2a1f21(_0x563a26['error'][_0xb5e0('0x1b')]);}logger[_0xb5e0('0x19')](_0xb5e0('0x1a'),_0x41df13,_0x563a26['error'][_0xb5e0('0x1b')]);return _0x204930(_0x563a26[_0xb5e0('0x19')]['message']);}else{logger[_0xb5e0('0x14')](_0xb5e0('0x1a'),_0x41df13,'request\x20sent');_0x204930(_0x563a26[_0xb5e0('0x1c')][_0xb5e0('0x1b')]);}})[_0xb5e0('0x1d')](function(_0x41b038){logger[_0xb5e0('0x19')](_0xb5e0('0x1a'),_0x41df13,_0x41b038);_0x2a1f21(_0x41b038);});});}exports['GetOpenchannelQueue']=function(_0xcf78a){var _0x536229=this;return new Promise(function(_0x6e9b99,_0x2af232){return db[_0xb5e0('0x1e')][_0xb5e0('0x1f')]({'raw':_0xcf78a[_0xb5e0('0x20')]?_0xcf78a[_0xb5e0('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0xcf78a[_0xb5e0('0x20')]?_0xcf78a[_0xb5e0('0x20')][_0xb5e0('0x21')]||null:null,'attributes':_0xcf78a['options']?_0xcf78a[_0xb5e0('0x20')][_0xb5e0('0x22')]||null:null,'limit':_0xcf78a[_0xb5e0('0x20')]?_0xcf78a[_0xb5e0('0x20')][_0xb5e0('0x23')]||null:null,'include':_0xcf78a[_0xb5e0('0x20')]?_0xcf78a[_0xb5e0('0x20')]['include']?_[_0xb5e0('0x24')](_0xcf78a[_0xb5e0('0x20')]['include'],function(_0x490c3a){return{'model':db[_0x490c3a[_0xb5e0('0x25')]],'as':_0x490c3a['as'],'attributes':_0x490c3a[_0xb5e0('0x22')],'include':_0x490c3a['include']?_[_0xb5e0('0x24')](_0x490c3a['include'],function(_0x4fdcc0){return{'model':db[_0x4fdcc0[_0xb5e0('0x25')]],'as':_0x4fdcc0['as'],'attributes':_0x4fdcc0[_0xb5e0('0x22')],'include':_0x4fdcc0[_0xb5e0('0x26')]?_['map'](_0x4fdcc0[_0xb5e0('0x26')],function(_0x49e8a4){return{'model':db[_0x49e8a4[_0xb5e0('0x25')]],'as':_0x49e8a4['as'],'attributes':_0x49e8a4[_0xb5e0('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb5e0('0x13')](function(_0x232042){logger[_0xb5e0('0x14')](_0xb5e0('0x27'),_0xcf78a);logger[_0xb5e0('0x15')](_0xb5e0('0x27'),_0xcf78a,JSON[_0xb5e0('0x18')](_0x232042));_0x6e9b99(_0x232042);})[_0xb5e0('0x1d')](function(_0x4baadd){logger[_0xb5e0('0x19')]('GetOpenchannelQueue',_0x4baadd[_0xb5e0('0x1b')],_0xcf78a);_0x2af232(_0x536229[_0xb5e0('0x19')](0x1f4,_0x4baadd[_0xb5e0('0x1b')]));});});};exports[_0xb5e0('0x28')]=function(_0x53a6d6){var _0x5e4122=this;return new Promise(function(_0x3d6e73,_0x52879f){return db[_0xb5e0('0x1e')][_0xb5e0('0x29')]({'raw':_0x53a6d6[_0xb5e0('0x20')]?_0x53a6d6['options'][_0xb5e0('0x2a')]===undefined?!![]:![]:!![],'where':_0x53a6d6[_0xb5e0('0x20')]?_0x53a6d6['options'][_0xb5e0('0x21')]||null:null,'attributes':_0x53a6d6[_0xb5e0('0x20')]?_0x53a6d6[_0xb5e0('0x20')]['attributes']||null:null,'include':_0x53a6d6[_0xb5e0('0x20')]?_0x53a6d6[_0xb5e0('0x20')][_0xb5e0('0x26')]?_[_0xb5e0('0x24')](_0x53a6d6[_0xb5e0('0x20')]['include'],function(_0x1758ed){return{'model':db[_0x1758ed[_0xb5e0('0x25')]],'as':_0x1758ed['as'],'attributes':_0x1758ed['attributes'],'include':_0x1758ed['include']?_[_0xb5e0('0x24')](_0x1758ed[_0xb5e0('0x26')],function(_0x19834f){return{'model':db[_0x19834f[_0xb5e0('0x25')]],'as':_0x19834f['as'],'attributes':_0x19834f[_0xb5e0('0x22')],'include':_0x19834f[_0xb5e0('0x26')]?_['map'](_0x19834f['include'],function(_0x32b781){return{'model':db[_0x32b781[_0xb5e0('0x25')]],'as':_0x32b781['as'],'attributes':_0x32b781[_0xb5e0('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb5e0('0x13')](function(_0xcf3901){logger[_0xb5e0('0x14')]('ShowOpenchannelQueue',_0x53a6d6);logger[_0xb5e0('0x15')]('ShowOpenchannelQueue',_0x53a6d6,JSON[_0xb5e0('0x18')](_0xcf3901));_0x3d6e73(_0xcf3901);})['catch'](function(_0x5671f0){logger[_0xb5e0('0x19')](_0xb5e0('0x28'),_0x5671f0[_0xb5e0('0x1b')],_0x53a6d6);_0x52879f(_0x5e4122[_0xb5e0('0x19')](0x1f4,_0x5671f0[_0xb5e0('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 9e96ea0..dea52cc 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 _0x4a62=['openchannelQueue:','save','remove','update','emit','removeListener','length'];(function(_0x4536a4,_0x55af7b){var _0x4fd1c1=function(_0x4c68cd){while(--_0x4c68cd){_0x4536a4['push'](_0x4536a4['shift']());}};_0x4fd1c1(++_0x55af7b);}(_0x4a62,0x174));var _0x24a6=function(_0x48e3ea,_0x377db3){_0x48e3ea=_0x48e3ea-0x0;var _0x293150=_0x4a62[_0x48e3ea];return _0x293150;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x24a6('0x0'),_0x24a6('0x1'),_0x24a6('0x2')];function createListener(_0x37433e,_0x2f16c1){return function(_0x5d24b5){_0x2f16c1[_0x24a6('0x3')](_0x37433e,_0x5d24b5);};}function removeListener(_0x5c0069,_0xd061e0){return function(){OpenchannelQueueEvents[_0x24a6('0x4')](_0x5c0069,_0xd061e0);};}exports['register']=function(_0x40a78a){for(var _0x132285=0x0,_0x5decac=events[_0x24a6('0x5')];_0x132285<_0x5decac;_0x132285++){var _0x256a3e=events[_0x132285];var _0x5f5771=createListener(_0x24a6('0x6')+_0x256a3e,_0x40a78a);OpenchannelQueueEvents['on'](_0x256a3e,_0x5f5771);}}; \ No newline at end of file +var _0xd06c=['update','removeListener','register','length','./openchannelQueue.events','save','remove'];(function(_0x515d85,_0x39650a){var _0x5645ed=function(_0x3cc938){while(--_0x3cc938){_0x515d85['push'](_0x515d85['shift']());}};_0x5645ed(++_0x39650a);}(_0xd06c,0xc8));var _0xcd06=function(_0x178ea4,_0x1248fe){_0x178ea4=_0x178ea4-0x0;var _0x4280b0=_0xd06c[_0x178ea4];return _0x4280b0;};'use strict';var OpenchannelQueueEvents=require(_0xcd06('0x0'));var events=[_0xcd06('0x1'),_0xcd06('0x2'),_0xcd06('0x3')];function createListener(_0x10df9f,_0x2f953f){return function(_0x342efd){_0x2f953f['emit'](_0x10df9f,_0x342efd);};}function removeListener(_0x41146b,_0xf38d95){return function(){OpenchannelQueueEvents[_0xcd06('0x4')](_0x41146b,_0xf38d95);};}exports[_0xcd06('0x5')]=function(_0x1c1e52){for(var _0x9f3480=0x0,_0x2f3028=events[_0xcd06('0x6')];_0x9f3480<_0x2f3028;_0x9f3480++){var _0x20e7e4=events[_0x9f3480];var _0x56d781=createListener('openchannelQueue:'+_0x20e7e4,_0x1c1e52);OpenchannelQueueEvents['on'](_0x20e7e4,_0x56d781);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 252e372..bc24b80 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 _0x672c=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x672c,0x181));var _0xc672=function(_0x43b36e,_0x34968e){_0x43b36e=_0x43b36e-0x0;var _0x4204e3=_0x672c[_0x43b36e];return _0x4204e3;};'use strict';var multer=require(_0xc672('0x0'));var util=require('util');var path=require(_0xc672('0x1'));var timeout=require(_0xc672('0x2'));var express=require(_0xc672('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xc672('0x4'));var config=require(_0xc672('0x5'));var controller=require('./openchannelQueueReport.controller');router[_0xc672('0x6')]('/',auth['isAuthenticated'](),controller[_0xc672('0x7')]);router['get'](_0xc672('0x8'),auth[_0xc672('0x9')](),controller[_0xc672('0xa')]);router['get'](_0xc672('0xb'),auth[_0xc672('0x9')](),controller[_0xc672('0xc')]);router[_0xc672('0xd')]('/',auth[_0xc672('0x9')](),controller[_0xc672('0xe')]);router[_0xc672('0xf')](_0xc672('0xb'),auth[_0xc672('0x9')](),controller[_0xc672('0x10')]);router[_0xc672('0x11')](_0xc672('0xb'),auth[_0xc672('0x9')](),controller[_0xc672('0x12')]);module[_0xc672('0x13')]=router; \ No newline at end of file +var _0x7edf=['destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0x5b10e3,_0x49a5d2){var _0x513a08=function(_0xaf1a60){while(--_0xaf1a60){_0x5b10e3['push'](_0x5b10e3['shift']());}};_0x513a08(++_0x49a5d2);}(_0x7edf,0x18e));var _0xf7ed=function(_0x24f326,_0x616a7){_0x24f326=_0x24f326-0x0;var _0x488e2d=_0x7edf[_0x24f326];return _0x488e2d;};'use strict';var multer=require(_0xf7ed('0x0'));var util=require('util');var path=require(_0xf7ed('0x1'));var timeout=require('connect-timeout');var express=require(_0xf7ed('0x2'));var router=express[_0xf7ed('0x3')]();var auth=require(_0xf7ed('0x4'));var interaction=require(_0xf7ed('0x5'));var config=require('../../config/environment');var controller=require(_0xf7ed('0x6'));router[_0xf7ed('0x7')]('/',auth[_0xf7ed('0x8')](),controller[_0xf7ed('0x9')]);router[_0xf7ed('0x7')]('/describe',auth[_0xf7ed('0x8')](),controller['describe']);router['get'](_0xf7ed('0xa'),auth['isAuthenticated'](),controller[_0xf7ed('0xb')]);router[_0xf7ed('0xc')]('/',auth[_0xf7ed('0x8')](),controller[_0xf7ed('0xd')]);router['put'](_0xf7ed('0xa'),auth[_0xf7ed('0x8')](),controller[_0xf7ed('0xe')]);router[_0xf7ed('0xf')](_0xf7ed('0xa'),auth[_0xf7ed('0x8')](),controller[_0xf7ed('0x10')]);module[_0xf7ed('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 5b0365f..64266b3 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 _0x0301=['sequelize','exports','STRING','DATE','moment'];(function(_0x11907c,_0x145aaa){var _0x13d7b7=function(_0x353726){while(--_0x353726){_0x11907c['push'](_0x11907c['shift']());}};_0x13d7b7(++_0x145aaa);}(_0x0301,0x126));var _0x1030=function(_0x47ff9c,_0x5e4c9e){_0x47ff9c=_0x47ff9c-0x0;var _0x482bde=_0x0301[_0x47ff9c];return _0x482bde;};'use strict';var moment=require(_0x1030('0x0'));var Sequelize=require(_0x1030('0x1'));module[_0x1030('0x2')]={'uniqueid':{'type':Sequelize[_0x1030('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1030('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1030('0x4')]},'exitAt':{'type':Sequelize[_0x1030('0x4')]},'reason':{'type':Sequelize[_0x1030('0x3')]}}; \ No newline at end of file +var _0x8a6c=['DATE','moment','STRING'];(function(_0x2aeb54,_0x3493b8){var _0x2f2538=function(_0x5c4819){while(--_0x5c4819){_0x2aeb54['push'](_0x2aeb54['shift']());}};_0x2f2538(++_0x3493b8);}(_0x8a6c,0x1c9));var _0xc8a6=function(_0x4b4b04,_0x14d717){_0x4b4b04=_0x4b4b04-0x0;var _0x30bb5b=_0x8a6c[_0x4b4b04];return _0x30bb5b;};'use strict';var moment=require(_0xc8a6('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xc8a6('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xc8a6('0x2')]},'acceptAt':{'type':Sequelize[_0xc8a6('0x2')]},'exitAt':{'type':Sequelize[_0xc8a6('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 9e7e1e0..1eed62d 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 _0x1a85=['fields','length','nolimit','sort','where','pick','filters','filter','merge','type','include','findAll','rows','catch','show','params','model','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','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','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','query','keys','intersection','attributes'];(function(_0x428a3f,_0x2cfa48){var _0xe6db0a=function(_0x48dd4e){while(--_0x48dd4e){_0x428a3f['push'](_0x428a3f['shift']());}};_0xe6db0a(++_0x2cfa48);}(_0x1a85,0x178));var _0x51a8=function(_0x34c26b,_0x5e279b){_0x34c26b=_0x34c26b-0x0;var _0x2f9f58=_0x1a85[_0x34c26b];return _0x2f9f58;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x51a8('0x0'));var zipdir=require(_0x51a8('0x1'));var jsonpatch=require(_0x51a8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x51a8('0x3'));var Mustache=require(_0x51a8('0x4'));var util=require(_0x51a8('0x5'));var path=require('path');var sox=require(_0x51a8('0x6'));var csv=require('to-csv');var ejs=require(_0x51a8('0x7'));var fs=require('fs');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 db=require(_0x51a8('0x15'))['db'];function respondWithStatusCode(_0xc46d7,_0x38a1d2){_0x38a1d2=_0x38a1d2||0xcc;return function(_0x1827e6){if(_0x1827e6){return _0xc46d7[_0x51a8('0x16')](_0x38a1d2);}return _0xc46d7[_0x51a8('0x17')](_0x38a1d2)[_0x51a8('0x18')]();};}function respondWithResult(_0x47b988,_0x461f5c){_0x461f5c=_0x461f5c||0xc8;return function(_0x7a4c36){if(_0x7a4c36){return _0x47b988[_0x51a8('0x17')](_0x461f5c)['json'](_0x7a4c36);}};}function respondWithFilteredResult(_0xf4eb6e,_0x547d40){return function(_0x10584b){if(_0x10584b){var _0x2b8d37=_0x10584b[_0x51a8('0x19')],_0x39cd45=_0x547d40[_0x51a8('0x1a')],_0x2b0521=_0x547d40['offset']+_0x547d40[_0x51a8('0x1b')],_0x3fbd02;if(_0x2b0521>=_0x2b8d37){_0x2b0521=_0x2b8d37;_0x3fbd02=0xc8;}else{_0x3fbd02=0xce;}_0xf4eb6e[_0x51a8('0x17')](_0x3fbd02);return _0xf4eb6e[_0x51a8('0x1c')](_0x51a8('0x1d'),_0x39cd45+'-'+_0x2b0521+'/'+_0x2b8d37)[_0x51a8('0x1e')](_0x10584b);}return null;};}function patchUpdates(_0x544886){return function(_0x5f3acf){try{jsonpatch[_0x51a8('0x1f')](_0x5f3acf,_0x544886,!![]);}catch(_0x3b7e7e){return BPromise[_0x51a8('0x20')](_0x3b7e7e);}return _0x5f3acf[_0x51a8('0x21')]();};}function saveUpdates(_0x2a4c4c,_0x3bc044){return function(_0x28aea0){if(_0x28aea0){return _0x28aea0[_0x51a8('0x22')](_0x2a4c4c)['then'](function(_0xf80fa9){return _0xf80fa9;});}return null;};}function removeEntity(_0x53438c,_0xfe0ddb){return function(_0x12c029){if(_0x12c029){return _0x12c029[_0x51a8('0x23')]()[_0x51a8('0x24')](function(){_0x53438c['status'](0xcc)[_0x51a8('0x18')]();});}};}function handleEntityNotFound(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(!_0x23d26a){_0x4b9cdd['sendStatus'](0x194);}return _0x23d26a;};}function handleError(_0x384d25,_0x78d3d6){_0x78d3d6=_0x78d3d6||0x1f4;return function(_0x20ef8b){logger[_0x51a8('0x25')](_0x20ef8b[_0x51a8('0x26')]);if(_0x20ef8b[_0x51a8('0x27')]){delete _0x20ef8b[_0x51a8('0x27')];}_0x384d25[_0x51a8('0x17')](_0x78d3d6)['send'](_0x20ef8b);};}exports[_0x51a8('0x28')]=function(_0x1b7577,_0xca5746){var _0x3da187={},_0x1c150d={},_0x11aefc={'count':0x0,'rows':[]};var _0x1a886f=_[_0x51a8('0x29')](db[_0x51a8('0x2a')][_0x51a8('0x2b')],function(_0x20c6b5){return{'name':_0x20c6b5[_0x51a8('0x2c')],'type':_0x20c6b5['type'][_0x51a8('0x2d')]};});_0x1c150d['model']=_[_0x51a8('0x29')](_0x1a886f,_0x51a8('0x27'));_0x1c150d[_0x51a8('0x2e')]=_[_0x51a8('0x2f')](_0x1b7577[_0x51a8('0x2e')]);_0x1c150d['filters']=_[_0x51a8('0x30')](_0x1c150d['model'],_0x1c150d[_0x51a8('0x2e')]);_0x3da187[_0x51a8('0x31')]=_[_0x51a8('0x30')](_0x1c150d['model'],qs[_0x51a8('0x32')](_0x1b7577['query'][_0x51a8('0x32')]));_0x3da187[_0x51a8('0x31')]=_0x3da187[_0x51a8('0x31')][_0x51a8('0x33')]?_0x3da187[_0x51a8('0x31')]:_0x1c150d['model'];if(!_0x1b7577[_0x51a8('0x2e')]['hasOwnProperty'](_0x51a8('0x34'))){_0x3da187[_0x51a8('0x1b')]=qs[_0x51a8('0x1b')](_0x1b7577['query'][_0x51a8('0x1b')]);_0x3da187[_0x51a8('0x1a')]=qs[_0x51a8('0x1a')](_0x1b7577[_0x51a8('0x2e')][_0x51a8('0x1a')]);}_0x3da187['order']=qs['sort'](_0x1b7577['query'][_0x51a8('0x35')]);_0x3da187[_0x51a8('0x36')]=qs['filters'](_[_0x51a8('0x37')](_0x1b7577['query'],_0x1c150d[_0x51a8('0x38')]));if(_0x1b7577[_0x51a8('0x2e')][_0x51a8('0x39')]){_0x3da187[_0x51a8('0x36')]=_[_0x51a8('0x3a')](_0x3da187[_0x51a8('0x36')],{'$or':_['map'](_0x1a886f,function(_0x4e5566){if(_0x4e5566[_0x51a8('0x3b')]!=='VIRTUAL'){var _0x5d7214={};_0x5d7214[_0x4e5566['name']]={'$like':'%'+_0x1b7577[_0x51a8('0x2e')][_0x51a8('0x39')]+'%'};return _0x5d7214;}})});}_0x3da187=_[_0x51a8('0x3a')]({},_0x3da187,_0x1b7577['options']);var _0x728638={'where':_0x3da187[_0x51a8('0x36')]};return db[_0x51a8('0x2a')][_0x51a8('0x19')](_0x728638)['then'](function(_0x19fa98){_0x11aefc[_0x51a8('0x19')]=_0x19fa98;if(_0x1b7577[_0x51a8('0x2e')]['includeAll']){_0x3da187[_0x51a8('0x3c')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x51a8('0x3d')](_0x3da187);})[_0x51a8('0x24')](function(_0x2a98bd){_0x11aefc[_0x51a8('0x3e')]=_0x2a98bd;return _0x11aefc;})['then'](respondWithFilteredResult(_0xca5746,_0x3da187))[_0x51a8('0x3f')](handleError(_0xca5746,null));};exports[_0x51a8('0x40')]=function(_0x2d672c,_0x38849d){var _0xa33fc={'raw':!![],'where':{'id':_0x2d672c[_0x51a8('0x41')]['id']}},_0x35c1c9={};_0x35c1c9[_0x51a8('0x42')]=_[_0x51a8('0x2f')](db['OpenchannelQueueReport'][_0x51a8('0x2b')]);_0x35c1c9[_0x51a8('0x2e')]=_['keys'](_0x2d672c['query']);_0x35c1c9[_0x51a8('0x38')]=_[_0x51a8('0x30')](_0x35c1c9[_0x51a8('0x42')],_0x35c1c9[_0x51a8('0x2e')]);_0xa33fc[_0x51a8('0x31')]=_[_0x51a8('0x30')](_0x35c1c9[_0x51a8('0x42')],qs[_0x51a8('0x32')](_0x2d672c[_0x51a8('0x2e')][_0x51a8('0x32')]));_0xa33fc['attributes']=_0xa33fc[_0x51a8('0x31')][_0x51a8('0x33')]?_0xa33fc[_0x51a8('0x31')]:_0x35c1c9[_0x51a8('0x42')];if(_0x2d672c[_0x51a8('0x2e')][_0x51a8('0x43')]){_0xa33fc['include']=[{'all':!![]}];}_0xa33fc=_[_0x51a8('0x3a')]({},_0xa33fc,_0x2d672c['options']);return db[_0x51a8('0x2a')][_0x51a8('0x44')](_0xa33fc)[_0x51a8('0x24')](handleEntityNotFound(_0x38849d,null))[_0x51a8('0x24')](respondWithResult(_0x38849d,null))[_0x51a8('0x3f')](handleError(_0x38849d,null));};exports['create']=function(_0x513586,_0x4653e3){return db[_0x51a8('0x2a')][_0x51a8('0x45')](_0x513586[_0x51a8('0x46')],{})[_0x51a8('0x24')](respondWithResult(_0x4653e3,0xc9))['catch'](handleError(_0x4653e3,null));};exports['update']=function(_0xcbd998,_0x108131){if(_0xcbd998[_0x51a8('0x46')]['id']){delete _0xcbd998[_0x51a8('0x46')]['id'];}return db[_0x51a8('0x2a')][_0x51a8('0x44')]({'where':{'id':_0xcbd998[_0x51a8('0x41')]['id']}})[_0x51a8('0x24')](handleEntityNotFound(_0x108131,null))[_0x51a8('0x24')](saveUpdates(_0xcbd998['body'],null))['then'](respondWithResult(_0x108131,null))['catch'](handleError(_0x108131,null));};exports[_0x51a8('0x23')]=function(_0x279cb1,_0x103897){return db['OpenchannelQueueReport'][_0x51a8('0x44')]({'where':{'id':_0x279cb1[_0x51a8('0x41')]['id']}})['then'](handleEntityNotFound(_0x103897,null))[_0x51a8('0x24')](removeEntity(_0x103897,null))['catch'](handleError(_0x103897,null));};exports['describe']=function(_0xbf828b,_0x4393c9){return db[_0x51a8('0x2a')]['describe']()['then'](respondWithResult(_0x4393c9,null))[_0x51a8('0x3f')](handleError(_0x4393c9,null));}; \ No newline at end of file +var _0x7fea=['index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x596659,_0x398349){var _0x286f85=function(_0x21dff4){while(--_0x21dff4){_0x596659['push'](_0x596659['shift']());}};_0x286f85(++_0x398349);}(_0x7fea,0x149));var _0xa7fe=function(_0x2a1b0c,_0xa17978){_0x2a1b0c=_0x2a1b0c-0x0;var _0x2cb95f=_0x7fea[_0x2a1b0c];return _0x2cb95f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa7fe('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa7fe('0x1'));var rp=require(_0xa7fe('0x2'));var moment=require(_0xa7fe('0x3'));var BPromise=require(_0xa7fe('0x4'));var Mustache=require(_0xa7fe('0x5'));var util=require(_0xa7fe('0x6'));var path=require('path');var sox=require(_0xa7fe('0x7'));var csv=require(_0xa7fe('0x8'));var ejs=require(_0xa7fe('0x9'));var fs=require('fs');var _=require(_0xa7fe('0xa'));var squel=require(_0xa7fe('0xb'));var crypto=require(_0xa7fe('0xc'));var jsforce=require(_0xa7fe('0xd'));var deskjs=require(_0xa7fe('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa7fe('0xf'));var Redis=require(_0xa7fe('0x10'));var authService=require(_0xa7fe('0x11'));var qs=require(_0xa7fe('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7fe('0x13'));var logger=require(_0xa7fe('0x14'))('api');var utils=require(_0xa7fe('0x15'));var config=require('../../config/environment');var db=require(_0xa7fe('0x16'))['db'];function respondWithStatusCode(_0x5956e1,_0x50a806){_0x50a806=_0x50a806||0xcc;return function(_0x3005d3){if(_0x3005d3){return _0x5956e1[_0xa7fe('0x17')](_0x50a806);}return _0x5956e1[_0xa7fe('0x18')](_0x50a806)[_0xa7fe('0x19')]();};}function respondWithResult(_0x47766e,_0x5a4975){_0x5a4975=_0x5a4975||0xc8;return function(_0x49e7cb){if(_0x49e7cb){return _0x47766e[_0xa7fe('0x18')](_0x5a4975)[_0xa7fe('0x1a')](_0x49e7cb);}};}function respondWithFilteredResult(_0x400886,_0x43ae73){return function(_0x34490e){if(_0x34490e){var _0x5df0e3=_0x34490e[_0xa7fe('0x1b')],_0x137dc9=_0x43ae73[_0xa7fe('0x1c')],_0x292ad1=_0x43ae73['offset']+_0x43ae73[_0xa7fe('0x1d')],_0x132586;if(_0x292ad1>=_0x5df0e3){_0x292ad1=_0x5df0e3;_0x132586=0xc8;}else{_0x132586=0xce;}_0x400886[_0xa7fe('0x18')](_0x132586);return _0x400886[_0xa7fe('0x1e')](_0xa7fe('0x1f'),_0x137dc9+'-'+_0x292ad1+'/'+_0x5df0e3)[_0xa7fe('0x1a')](_0x34490e);}return null;};}function patchUpdates(_0x18261c){return function(_0x4f1951){try{jsonpatch['apply'](_0x4f1951,_0x18261c,!![]);}catch(_0x5409fe){return BPromise[_0xa7fe('0x20')](_0x5409fe);}return _0x4f1951[_0xa7fe('0x21')]();};}function saveUpdates(_0x473612,_0x529990){return function(_0x1d33d2){if(_0x1d33d2){return _0x1d33d2[_0xa7fe('0x22')](_0x473612)[_0xa7fe('0x23')](function(_0x5381c8){return _0x5381c8;});}return null;};}function removeEntity(_0x29649c,_0x19b408){return function(_0x1619c1){if(_0x1619c1){return _0x1619c1[_0xa7fe('0x24')]()[_0xa7fe('0x23')](function(){_0x29649c[_0xa7fe('0x18')](0xcc)[_0xa7fe('0x19')]();});}};}function handleEntityNotFound(_0x1043bf,_0x4ac7e0){return function(_0x3415b8){if(!_0x3415b8){_0x1043bf['sendStatus'](0x194);}return _0x3415b8;};}function handleError(_0x4ce2e7,_0x37c8fa){_0x37c8fa=_0x37c8fa||0x1f4;return function(_0xf06c82){logger[_0xa7fe('0x25')](_0xf06c82[_0xa7fe('0x26')]);if(_0xf06c82[_0xa7fe('0x27')]){delete _0xf06c82['name'];}_0x4ce2e7[_0xa7fe('0x18')](_0x37c8fa)[_0xa7fe('0x28')](_0xf06c82);};}exports[_0xa7fe('0x29')]=function(_0x3e9b74,_0x26e5a4){var _0x146a74={},_0x11aff3={},_0x4038c6={'count':0x0,'rows':[]};var _0x9d5272=_[_0xa7fe('0x2a')](db[_0xa7fe('0x2b')][_0xa7fe('0x2c')],function(_0x1ada44){return{'name':_0x1ada44[_0xa7fe('0x2d')],'type':_0x1ada44[_0xa7fe('0x2e')][_0xa7fe('0x2f')]};});_0x11aff3[_0xa7fe('0x30')]=_[_0xa7fe('0x2a')](_0x9d5272,_0xa7fe('0x27'));_0x11aff3[_0xa7fe('0x31')]=_['keys'](_0x3e9b74[_0xa7fe('0x31')]);_0x11aff3[_0xa7fe('0x32')]=_['intersection'](_0x11aff3['model'],_0x11aff3['query']);_0x146a74[_0xa7fe('0x33')]=_[_0xa7fe('0x34')](_0x11aff3['model'],qs[_0xa7fe('0x35')](_0x3e9b74[_0xa7fe('0x31')][_0xa7fe('0x35')]));_0x146a74[_0xa7fe('0x33')]=_0x146a74[_0xa7fe('0x33')][_0xa7fe('0x36')]?_0x146a74[_0xa7fe('0x33')]:_0x11aff3[_0xa7fe('0x30')];if(!_0x3e9b74[_0xa7fe('0x31')]['hasOwnProperty'](_0xa7fe('0x37'))){_0x146a74['limit']=qs[_0xa7fe('0x1d')](_0x3e9b74[_0xa7fe('0x31')][_0xa7fe('0x1d')]);_0x146a74['offset']=qs[_0xa7fe('0x1c')](_0x3e9b74[_0xa7fe('0x31')][_0xa7fe('0x1c')]);}_0x146a74[_0xa7fe('0x38')]=qs['sort'](_0x3e9b74[_0xa7fe('0x31')][_0xa7fe('0x39')]);_0x146a74['where']=qs[_0xa7fe('0x32')](_[_0xa7fe('0x3a')](_0x3e9b74[_0xa7fe('0x31')],_0x11aff3[_0xa7fe('0x32')]));if(_0x3e9b74[_0xa7fe('0x31')][_0xa7fe('0x3b')]){_0x146a74[_0xa7fe('0x3c')]=_[_0xa7fe('0x3d')](_0x146a74[_0xa7fe('0x3c')],{'$or':_[_0xa7fe('0x2a')](_0x9d5272,function(_0x42d5d6){if(_0x42d5d6[_0xa7fe('0x2e')]!==_0xa7fe('0x3e')){var _0xdb8885={};_0xdb8885[_0x42d5d6[_0xa7fe('0x27')]]={'$like':'%'+_0x3e9b74[_0xa7fe('0x31')]['filter']+'%'};return _0xdb8885;}})});}_0x146a74=_['merge']({},_0x146a74,_0x3e9b74[_0xa7fe('0x3f')]);var _0x4e5116={'where':_0x146a74['where']};return db[_0xa7fe('0x2b')][_0xa7fe('0x1b')](_0x4e5116)['then'](function(_0x25a5b2){_0x4038c6[_0xa7fe('0x1b')]=_0x25a5b2;if(_0x3e9b74[_0xa7fe('0x31')][_0xa7fe('0x40')]){_0x146a74[_0xa7fe('0x41')]=[{'all':!![]}];}return db[_0xa7fe('0x2b')][_0xa7fe('0x42')](_0x146a74);})['then'](function(_0x279e79){_0x4038c6[_0xa7fe('0x43')]=_0x279e79;return _0x4038c6;})[_0xa7fe('0x23')](respondWithFilteredResult(_0x26e5a4,_0x146a74))[_0xa7fe('0x44')](handleError(_0x26e5a4,null));};exports['show']=function(_0x207e1d,_0x2ae075){var _0x66671={'raw':!![],'where':{'id':_0x207e1d[_0xa7fe('0x45')]['id']}},_0x309404={};_0x309404[_0xa7fe('0x30')]=_[_0xa7fe('0x46')](db[_0xa7fe('0x2b')][_0xa7fe('0x2c')]);_0x309404[_0xa7fe('0x31')]=_[_0xa7fe('0x46')](_0x207e1d[_0xa7fe('0x31')]);_0x309404[_0xa7fe('0x32')]=_[_0xa7fe('0x34')](_0x309404['model'],_0x309404['query']);_0x66671['attributes']=_['intersection'](_0x309404[_0xa7fe('0x30')],qs[_0xa7fe('0x35')](_0x207e1d[_0xa7fe('0x31')][_0xa7fe('0x35')]));_0x66671[_0xa7fe('0x33')]=_0x66671[_0xa7fe('0x33')][_0xa7fe('0x36')]?_0x66671[_0xa7fe('0x33')]:_0x309404['model'];if(_0x207e1d[_0xa7fe('0x31')][_0xa7fe('0x40')]){_0x66671[_0xa7fe('0x41')]=[{'all':!![]}];}_0x66671=_['merge']({},_0x66671,_0x207e1d[_0xa7fe('0x3f')]);return db[_0xa7fe('0x2b')]['find'](_0x66671)[_0xa7fe('0x23')](handleEntityNotFound(_0x2ae075,null))[_0xa7fe('0x23')](respondWithResult(_0x2ae075,null))[_0xa7fe('0x44')](handleError(_0x2ae075,null));};exports[_0xa7fe('0x47')]=function(_0x5f272a,_0x4508e5){return db[_0xa7fe('0x2b')]['create'](_0x5f272a[_0xa7fe('0x48')],{})['then'](respondWithResult(_0x4508e5,0xc9))[_0xa7fe('0x44')](handleError(_0x4508e5,null));};exports[_0xa7fe('0x22')]=function(_0x45e237,_0x5f2a0e){if(_0x45e237[_0xa7fe('0x48')]['id']){delete _0x45e237[_0xa7fe('0x48')]['id'];}return db['OpenchannelQueueReport'][_0xa7fe('0x49')]({'where':{'id':_0x45e237['params']['id']}})[_0xa7fe('0x23')](handleEntityNotFound(_0x5f2a0e,null))['then'](saveUpdates(_0x45e237[_0xa7fe('0x48')],null))[_0xa7fe('0x23')](respondWithResult(_0x5f2a0e,null))[_0xa7fe('0x44')](handleError(_0x5f2a0e,null));};exports[_0xa7fe('0x24')]=function(_0x41124a,_0x5ecc9a){return db['OpenchannelQueueReport'][_0xa7fe('0x49')]({'where':{'id':_0x41124a[_0xa7fe('0x45')]['id']}})[_0xa7fe('0x23')](handleEntityNotFound(_0x5ecc9a,null))[_0xa7fe('0x23')](removeEntity(_0x5ecc9a,null))[_0xa7fe('0x44')](handleError(_0x5ecc9a,null));};exports['describe']=function(_0x4e2918,_0xa46f64){return db[_0xa7fe('0x2b')]['describe']()[_0xa7fe('0x23')](respondWithResult(_0xa46f64,null))['catch'](handleError(_0xa46f64,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 2af5707..866a7fc 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 _0x562d=['../../config/environment','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x41b6a3,_0x58d1b1){var _0x524f0f=function(_0x1d1369){while(--_0x1d1369){_0x41b6a3['push'](_0x41b6a3['shift']());}};_0x524f0f(++_0x58d1b1);}(_0x562d,0xe1));var _0xd562=function(_0x46b295,_0x554b00){_0x46b295=_0x46b295-0x0;var _0x1c4c10=_0x562d[_0x46b295];return _0x1c4c10;};'use strict';var _=require(_0xd562('0x0'));var util=require(_0xd562('0x1'));var logger=require(_0xd562('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd562('0x3'));var rp=require(_0xd562('0x4'));var fs=require('fs');var path=require(_0xd562('0x5'));var rimraf=require('rimraf');var config=require(_0xd562('0x6'));var attributes=require('./openchannelQueueReport.attributes');module['exports']=function(_0x1d05e9,_0x46bf9b){return _0x1d05e9[_0xd562('0x7')](_0xd562('0x8'),attributes,{'tableName':_0xd562('0x9'),'paranoid':![],'indexes':[{'name':_0xd562('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x370d=['uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport'];(function(_0x43190d,_0x375400){var _0x109c98=function(_0x12c214){while(--_0x12c214){_0x43190d['push'](_0x43190d['shift']());}};_0x109c98(++_0x375400);}(_0x370d,0x194));var _0xd370=function(_0x377bde,_0x41cb1b){_0x377bde=_0x377bde-0x0;var _0x20ce97=_0x370d[_0x377bde];return _0x20ce97;};'use strict';var _=require(_0xd370('0x0'));var util=require('util');var logger=require(_0xd370('0x1'))('api');var moment=require(_0xd370('0x2'));var BPromise=require(_0xd370('0x3'));var rp=require(_0xd370('0x4'));var fs=require('fs');var path=require(_0xd370('0x5'));var rimraf=require(_0xd370('0x6'));var config=require(_0xd370('0x7'));var attributes=require(_0xd370('0x8'));module[_0xd370('0x9')]=function(_0xe2940d,_0x516e57){return _0xe2940d[_0xd370('0xa')](_0xd370('0xb'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xd370('0xc'),'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 3e499c2..9e0d4f4 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 _0x6132=['catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','stringify','UpdateOpenchannelQueueReport','update','limit','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6132,0xf3));var _0x2613=function(_0x1ddc41,_0x5cda36){_0x1ddc41=_0x1ddc41-0x0;var _0x5ea386=_0x6132[_0x1ddc41];return _0x5ea386;};'use strict';var _=require('lodash');var util=require(_0x2613('0x0'));var moment=require('moment');var BPromise=require(_0x2613('0x1'));var rs=require(_0x2613('0x2'));var fs=require('fs');var Redis=require(_0x2613('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2613('0x4'))('rpc');var config=require(_0x2613('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2613('0x6')][_0x2613('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1083a6,_0x546fd4,_0x43c9d4){return new BPromise(function(_0x43c876,_0x51f79d){return client['request'](_0x1083a6,_0x43c9d4)[_0x2613('0x8')](function(_0x47dfc5){logger[_0x2613('0x9')](_0x2613('0xa'),_0x546fd4,_0x2613('0xb'));logger[_0x2613('0xc')](_0x2613('0xd'),_0x546fd4,_0x2613('0xb'),JSON['stringify'](_0x47dfc5));if(_0x47dfc5[_0x2613('0xe')]){if(_0x47dfc5[_0x2613('0xe')][_0x2613('0xf')]===0x1f4){logger[_0x2613('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x546fd4,_0x47dfc5[_0x2613('0xe')][_0x2613('0x10')]);return _0x51f79d(_0x47dfc5[_0x2613('0xe')][_0x2613('0x10')]);}logger[_0x2613('0xe')](_0x2613('0xa'),_0x546fd4,_0x47dfc5[_0x2613('0xe')][_0x2613('0x10')]);return _0x43c876(_0x47dfc5[_0x2613('0xe')][_0x2613('0x10')]);}else{logger[_0x2613('0x9')](_0x2613('0xa'),_0x546fd4,_0x2613('0xb'));_0x43c876(_0x47dfc5[_0x2613('0x11')][_0x2613('0x10')]);}})[_0x2613('0x12')](function(_0xb99fd7){logger[_0x2613('0xe')](_0x2613('0xa'),_0x546fd4,_0xb99fd7);_0x51f79d(_0xb99fd7);});});}exports[_0x2613('0x13')]=function(_0x32e426){var _0x35279f=this;return new Promise(function(_0x5072e5,_0x8adf43){return db[_0x2613('0x14')][_0x2613('0x15')](_0x32e426[_0x2613('0x16')],{'raw':_0x32e426[_0x2613('0x17')]?_0x32e426[_0x2613('0x17')][_0x2613('0x18')]===undefined?!![]:![]:!![]})[_0x2613('0x8')](function(_0x41f86d){logger[_0x2613('0x9')](_0x2613('0x13'),_0x32e426);logger['debug'](_0x2613('0x13'),_0x32e426,JSON[_0x2613('0x19')](_0x41f86d));_0x5072e5(_0x41f86d);})[_0x2613('0x12')](function(_0x55d5c2){logger[_0x2613('0xe')]('CreateOpenchannelQueueReport',_0x55d5c2[_0x2613('0x10')],_0x32e426);_0x8adf43(_0x35279f[_0x2613('0xe')](0x1f4,_0x55d5c2[_0x2613('0x10')]));});});};exports[_0x2613('0x1a')]=function(_0x1e7e26){var _0x2cf4b7=this;return new Promise(function(_0x128aa0,_0x279fcc){return db[_0x2613('0x14')][_0x2613('0x1b')](_0x1e7e26[_0x2613('0x16')],{'raw':_0x1e7e26['options']?_0x1e7e26[_0x2613('0x17')][_0x2613('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e7e26['options']?_0x1e7e26[_0x2613('0x17')]['where']||null:null,'attributes':_0x1e7e26[_0x2613('0x17')]?_0x1e7e26[_0x2613('0x17')]['attributes']||null:null,'limit':_0x1e7e26[_0x2613('0x17')]?_0x1e7e26[_0x2613('0x17')][_0x2613('0x1c')]||null:null})['then'](function(_0x55b95d){logger[_0x2613('0x9')]('UpdateOpenchannelQueueReport',_0x1e7e26);logger[_0x2613('0xc')](_0x2613('0x1a'),_0x1e7e26,JSON[_0x2613('0x19')](_0x55b95d));_0x128aa0(_0x55b95d);})[_0x2613('0x12')](function(_0x4a6008){logger[_0x2613('0xe')](_0x2613('0x1a'),_0x4a6008[_0x2613('0x10')],_0x1e7e26);_0x279fcc(_0x2cf4b7['error'](0x1f4,_0x4a6008[_0x2613('0x10')]));});});}; \ No newline at end of file +var _0x0f97=['OpenchannelQueueReport','create','body','options','UpdateOpenchannelQueueReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport'];(function(_0x5ecfc0,_0x2b1d77){var _0x2f0385=function(_0x1f5593){while(--_0x1f5593){_0x5ecfc0['push'](_0x5ecfc0['shift']());}};_0x2f0385(++_0x2b1d77);}(_0x0f97,0x196));var _0x70f9=function(_0x384fc4,_0x1740d6){_0x384fc4=_0x384fc4-0x0;var _0x292817=_0x0f97[_0x384fc4];return _0x292817;};'use strict';var _=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var moment=require(_0x70f9('0x2'));var BPromise=require(_0x70f9('0x3'));var rs=require(_0x70f9('0x4'));var fs=require('fs');var Redis=require(_0x70f9('0x5'));var db=require(_0x70f9('0x6'))['db'];var utils=require(_0x70f9('0x7'));var logger=require(_0x70f9('0x8'))(_0x70f9('0x9'));var config=require(_0x70f9('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x70f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17531e,_0x2e1ac7,_0x2fdeb5){return new BPromise(function(_0x59933c,_0x523d32){return client[_0x70f9('0xc')](_0x17531e,_0x2fdeb5)[_0x70f9('0xd')](function(_0x2265a8){logger[_0x70f9('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2e1ac7,'request\x20sent');logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x2e1ac7,_0x70f9('0xf'),JSON[_0x70f9('0x10')](_0x2265a8));if(_0x2265a8[_0x70f9('0x11')]){if(_0x2265a8[_0x70f9('0x11')]['code']===0x1f4){logger[_0x70f9('0x11')](_0x70f9('0x12'),_0x2e1ac7,_0x2265a8[_0x70f9('0x11')][_0x70f9('0x13')]);return _0x523d32(_0x2265a8[_0x70f9('0x11')]['message']);}logger[_0x70f9('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2e1ac7,_0x2265a8['error']['message']);return _0x59933c(_0x2265a8['error'][_0x70f9('0x13')]);}else{logger['info'](_0x70f9('0x12'),_0x2e1ac7,_0x70f9('0xf'));_0x59933c(_0x2265a8[_0x70f9('0x14')][_0x70f9('0x13')]);}})[_0x70f9('0x15')](function(_0x2d2226){logger[_0x70f9('0x11')](_0x70f9('0x12'),_0x2e1ac7,_0x2d2226);_0x523d32(_0x2d2226);});});}exports[_0x70f9('0x16')]=function(_0x4b6e93){var _0x59d036=this;return new Promise(function(_0x459ce9,_0x5817b5){return db[_0x70f9('0x17')][_0x70f9('0x18')](_0x4b6e93[_0x70f9('0x19')],{'raw':_0x4b6e93[_0x70f9('0x1a')]?_0x4b6e93['options']['raw']===undefined?!![]:![]:!![]})[_0x70f9('0xd')](function(_0x24a7f1){logger[_0x70f9('0xe')](_0x70f9('0x16'),_0x4b6e93);logger['debug'](_0x70f9('0x16'),_0x4b6e93,JSON['stringify'](_0x24a7f1));_0x459ce9(_0x24a7f1);})[_0x70f9('0x15')](function(_0x309afd){logger[_0x70f9('0x11')](_0x70f9('0x16'),_0x309afd[_0x70f9('0x13')],_0x4b6e93);_0x5817b5(_0x59d036['error'](0x1f4,_0x309afd[_0x70f9('0x13')]));});});};exports[_0x70f9('0x1b')]=function(_0x388f13){var _0x5d5372=this;return new Promise(function(_0x47057b,_0x474474){return db[_0x70f9('0x17')][_0x70f9('0x1c')](_0x388f13[_0x70f9('0x19')],{'raw':_0x388f13['options']?_0x388f13[_0x70f9('0x1a')][_0x70f9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x388f13[_0x70f9('0x1a')]?_0x388f13[_0x70f9('0x1a')][_0x70f9('0x1e')]||null:null,'attributes':_0x388f13[_0x70f9('0x1a')]?_0x388f13['options'][_0x70f9('0x1f')]||null:null,'limit':_0x388f13[_0x70f9('0x1a')]?_0x388f13[_0x70f9('0x1a')][_0x70f9('0x20')]||null:null})[_0x70f9('0xd')](function(_0x701ff2){logger[_0x70f9('0xe')](_0x70f9('0x1b'),_0x388f13);logger['debug']('UpdateOpenchannelQueueReport',_0x388f13,JSON[_0x70f9('0x10')](_0x701ff2));_0x47057b(_0x701ff2);})[_0x70f9('0x15')](function(_0x2f805a){logger['error']('UpdateOpenchannelQueueReport',_0x2f805a[_0x70f9('0x13')],_0x388f13);_0x474474(_0x5d5372[_0x70f9('0x11')](0x1f4,_0x2f805a['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 5047bc3..fa994bb 100644 --- a/server/api/openchannelTransferReport/index.js +++ b/server/api/openchannelTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 6de960e..9121cc6 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 _0x9862=['DATE','NOW','moment','exports','STRING','agent','queue'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x9862,0x121));var _0x2986=function(_0x159195,_0x371cc8){_0x159195=_0x159195-0x0;var _0x40f274=_0x9862[_0x159195];return _0x40f274;};'use strict';var moment=require(_0x2986('0x0'));var Sequelize=require('sequelize');module[_0x2986('0x1')]={'uniqueid':{'type':Sequelize[_0x2986('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x2986('0x3'),_0x2986('0x4')),'allowNull':![],'defaultValue':_0x2986('0x4')},'transferredAt':{'type':Sequelize[_0x2986('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x2986('0x6')]}}; \ No newline at end of file +var _0x544a=['account','agent','queue','moment','sequelize','exports','STRING','ENUM'];(function(_0x532af3,_0x4236d3){var _0x5c8be0=function(_0x4dcaec){while(--_0x4dcaec){_0x532af3['push'](_0x532af3['shift']());}};_0x5c8be0(++_0x4236d3);}(_0x544a,0x133));var _0xa544=function(_0x56b1ac,_0x392f25){_0x56b1ac=_0x56b1ac-0x0;var _0x3bbcad=_0x544a[_0x56b1ac];return _0x3bbcad;};'use strict';var moment=require(_0xa544('0x0'));var Sequelize=require(_0xa544('0x1'));module[_0xa544('0x2')]={'uniqueid':{'type':Sequelize[_0xa544('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xa544('0x4')](_0xa544('0x5'),_0xa544('0x6'),_0xa544('0x7')),'allowNull':![],'defaultValue':_0xa544('0x7')},'transferredAt':{'type':Sequelize['DATE'],'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 d30d680..78ac275 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 _0x9986=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','error','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge','filter','options','then','includeAll','include','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x351665,_0x570a57){var _0x55d23d=function(_0x14b063){while(--_0x14b063){_0x351665['push'](_0x351665['shift']());}};_0x55d23d(++_0x570a57);}(_0x9986,0x158));var _0x6998=function(_0x4be3a2,_0x2b1008){_0x4be3a2=_0x4be3a2-0x0;var _0x41dc99=_0x9986[_0x4be3a2];return _0x41dc99;};'use strict';var pdf=require(_0x6998('0x0'));var emlformat=require(_0x6998('0x1'));var rimraf=require(_0x6998('0x2'));var zipdir=require(_0x6998('0x3'));var jsonpatch=require(_0x6998('0x4'));var rp=require('request-promise');var moment=require(_0x6998('0x5'));var BPromise=require(_0x6998('0x6'));var Mustache=require('mustache');var util=require(_0x6998('0x7'));var path=require(_0x6998('0x8'));var sox=require(_0x6998('0x9'));var csv=require(_0x6998('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6998('0xb'));var squel=require('squel');var crypto=require(_0x6998('0xc'));var jsforce=require(_0x6998('0xd'));var deskjs=require(_0x6998('0xe'));var toCsv=require(_0x6998('0xa'));var querystring=require(_0x6998('0xf'));var Papa=require(_0x6998('0x10'));var Redis=require(_0x6998('0x11'));var authService=require(_0x6998('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6998('0x13'));var logger=require('../../config/logger')(_0x6998('0x14'));var utils=require(_0x6998('0x15'));var config=require(_0x6998('0x16'));var db=require(_0x6998('0x17'))['db'];function respondWithStatusCode(_0x262a63,_0x440664){_0x440664=_0x440664||0xcc;return function(_0xf914fd){if(_0xf914fd){return _0x262a63[_0x6998('0x18')](_0x440664);}return _0x262a63[_0x6998('0x19')](_0x440664)[_0x6998('0x1a')]();};}function respondWithResult(_0x2c4310,_0x113c61){_0x113c61=_0x113c61||0xc8;return function(_0x2b2002){if(_0x2b2002){return _0x2c4310[_0x6998('0x19')](_0x113c61)[_0x6998('0x1b')](_0x2b2002);}};}function respondWithFilteredResult(_0xbe7407,_0x222c54){return function(_0xc377c4){if(_0xc377c4){var _0x44e20d=_0xc377c4[_0x6998('0x1c')],_0x3d6213=_0x222c54['offset'],_0x42e8d0=_0x222c54[_0x6998('0x1d')]+_0x222c54[_0x6998('0x1e')],_0xb0ed87;if(_0x42e8d0>=_0x44e20d){_0x42e8d0=_0x44e20d;_0xb0ed87=0xc8;}else{_0xb0ed87=0xce;}_0xbe7407[_0x6998('0x19')](_0xb0ed87);return _0xbe7407[_0x6998('0x1f')](_0x6998('0x20'),_0x3d6213+'-'+_0x42e8d0+'/'+_0x44e20d)[_0x6998('0x1b')](_0xc377c4);}return null;};}function patchUpdates(_0x3f90cc){return function(_0x55e792){try{jsonpatch['apply'](_0x55e792,_0x3f90cc,!![]);}catch(_0x1aad58){return BPromise[_0x6998('0x21')](_0x1aad58);}return _0x55e792[_0x6998('0x22')]();};}function saveUpdates(_0x414437,_0x8cfa59){return function(_0xa055cf){if(_0xa055cf){return _0xa055cf[_0x6998('0x23')](_0x414437)['then'](function(_0xed6ba4){return _0xed6ba4;});}return null;};}function removeEntity(_0x38dcbf,_0x49e6bd){return function(_0x4d0a02){if(_0x4d0a02){return _0x4d0a02[_0x6998('0x24')]()['then'](function(){_0x38dcbf[_0x6998('0x19')](0xcc)[_0x6998('0x1a')]();});}};}function handleEntityNotFound(_0x2a087b,_0x3ceed2){return function(_0x406d98){if(!_0x406d98){_0x2a087b[_0x6998('0x18')](0x194);}return _0x406d98;};}function handleError(_0x4b88e9,_0x180ff3){_0x180ff3=_0x180ff3||0x1f4;return function(_0x25c39d){logger[_0x6998('0x25')](_0x25c39d['stack']);if(_0x25c39d[_0x6998('0x26')]){delete _0x25c39d['name'];}_0x4b88e9[_0x6998('0x19')](_0x180ff3)[_0x6998('0x27')](_0x25c39d);};}exports[_0x6998('0x28')]=function(_0x4f5b4f,_0xd327ba){var _0x31e59d={},_0x323ba1={},_0x6f2be9={'count':0x0,'rows':[]};var _0x34a953=_[_0x6998('0x29')](db[_0x6998('0x2a')][_0x6998('0x2b')],function(_0x125ec8){return{'name':_0x125ec8['fieldName'],'type':_0x125ec8[_0x6998('0x2c')][_0x6998('0x2d')]};});_0x323ba1[_0x6998('0x2e')]=_[_0x6998('0x29')](_0x34a953,_0x6998('0x26'));_0x323ba1[_0x6998('0x2f')]=_[_0x6998('0x30')](_0x4f5b4f[_0x6998('0x2f')]);_0x323ba1['filters']=_[_0x6998('0x31')](_0x323ba1[_0x6998('0x2e')],_0x323ba1[_0x6998('0x2f')]);_0x31e59d[_0x6998('0x32')]=_[_0x6998('0x31')](_0x323ba1['model'],qs[_0x6998('0x33')](_0x4f5b4f[_0x6998('0x2f')]['fields']));_0x31e59d['attributes']=_0x31e59d['attributes']['length']?_0x31e59d[_0x6998('0x32')]:_0x323ba1['model'];if(!_0x4f5b4f[_0x6998('0x2f')][_0x6998('0x34')]('nolimit')){_0x31e59d[_0x6998('0x1e')]=qs[_0x6998('0x1e')](_0x4f5b4f[_0x6998('0x2f')][_0x6998('0x1e')]);_0x31e59d[_0x6998('0x1d')]=qs[_0x6998('0x1d')](_0x4f5b4f[_0x6998('0x2f')][_0x6998('0x1d')]);}_0x31e59d[_0x6998('0x35')]=qs[_0x6998('0x36')](_0x4f5b4f[_0x6998('0x2f')][_0x6998('0x36')]);_0x31e59d[_0x6998('0x37')]=qs[_0x6998('0x38')](_[_0x6998('0x39')](_0x4f5b4f[_0x6998('0x2f')],_0x323ba1['filters']));if(_0x4f5b4f[_0x6998('0x2f')]['filter']){_0x31e59d[_0x6998('0x37')]=_[_0x6998('0x3a')](_0x31e59d['where'],{'$or':_[_0x6998('0x29')](_0x34a953,function(_0x3cdd6e){if(_0x3cdd6e[_0x6998('0x2c')]!=='VIRTUAL'){var _0x331ce3={};_0x331ce3[_0x3cdd6e[_0x6998('0x26')]]={'$like':'%'+_0x4f5b4f[_0x6998('0x2f')][_0x6998('0x3b')]+'%'};return _0x331ce3;}})});}_0x31e59d=_['merge']({},_0x31e59d,_0x4f5b4f[_0x6998('0x3c')]);var _0x4f078a={'where':_0x31e59d[_0x6998('0x37')]};return db['OpenchannelTransferReport'][_0x6998('0x1c')](_0x4f078a)[_0x6998('0x3d')](function(_0x592233){_0x6f2be9[_0x6998('0x1c')]=_0x592233;if(_0x4f5b4f['query'][_0x6998('0x3e')]){_0x31e59d[_0x6998('0x3f')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x31e59d);})[_0x6998('0x3d')](function(_0x23f937){_0x6f2be9[_0x6998('0x40')]=_0x23f937;return _0x6f2be9;})['then'](respondWithFilteredResult(_0xd327ba,_0x31e59d))[_0x6998('0x41')](handleError(_0xd327ba,null));};exports[_0x6998('0x42')]=function(_0x5385eb,_0x21868e){var _0x52b3a8={'raw':!![],'where':{'id':_0x5385eb[_0x6998('0x43')]['id']}},_0x38e2f4={};_0x38e2f4['model']=_['keys'](db[_0x6998('0x2a')][_0x6998('0x2b')]);_0x38e2f4['query']=_[_0x6998('0x30')](_0x5385eb[_0x6998('0x2f')]);_0x38e2f4['filters']=_['intersection'](_0x38e2f4[_0x6998('0x2e')],_0x38e2f4[_0x6998('0x2f')]);_0x52b3a8[_0x6998('0x32')]=_[_0x6998('0x31')](_0x38e2f4[_0x6998('0x2e')],qs[_0x6998('0x33')](_0x5385eb[_0x6998('0x2f')][_0x6998('0x33')]));_0x52b3a8[_0x6998('0x32')]=_0x52b3a8['attributes']['length']?_0x52b3a8[_0x6998('0x32')]:_0x38e2f4[_0x6998('0x2e')];if(_0x5385eb[_0x6998('0x2f')][_0x6998('0x3e')]){_0x52b3a8[_0x6998('0x3f')]=[{'all':!![]}];}_0x52b3a8=_[_0x6998('0x3a')]({},_0x52b3a8,_0x5385eb['options']);return db[_0x6998('0x2a')][_0x6998('0x44')](_0x52b3a8)[_0x6998('0x3d')](handleEntityNotFound(_0x21868e,null))[_0x6998('0x3d')](respondWithResult(_0x21868e,null))[_0x6998('0x41')](handleError(_0x21868e,null));};exports[_0x6998('0x45')]=function(_0x563d75,_0x54c027){return db[_0x6998('0x2a')][_0x6998('0x45')](_0x563d75[_0x6998('0x46')],{})['then'](respondWithResult(_0x54c027,0xc9))['catch'](handleError(_0x54c027,null));};exports[_0x6998('0x23')]=function(_0x500222,_0x48eabe){if(_0x500222[_0x6998('0x46')]['id']){delete _0x500222[_0x6998('0x46')]['id'];}return db[_0x6998('0x2a')][_0x6998('0x44')]({'where':{'id':_0x500222['params']['id']}})['then'](handleEntityNotFound(_0x48eabe,null))[_0x6998('0x3d')](saveUpdates(_0x500222[_0x6998('0x46')],null))['then'](respondWithResult(_0x48eabe,null))[_0x6998('0x41')](handleError(_0x48eabe,null));};exports['destroy']=function(_0x397e59,_0x2e8fdf){return db['OpenchannelTransferReport'][_0x6998('0x44')]({'where':{'id':_0x397e59[_0x6998('0x43')]['id']}})[_0x6998('0x3d')](handleEntityNotFound(_0x2e8fdf,null))[_0x6998('0x3d')](removeEntity(_0x2e8fdf,null))[_0x6998('0x41')](handleError(_0x2e8fdf,null));};exports[_0x6998('0x47')]=function(_0x4c84cb,_0x416e52){return db[_0x6998('0x2a')][_0x6998('0x47')]()[_0x6998('0x3d')](respondWithResult(_0x416e52,null))[_0x6998('0x41')](handleError(_0x416e52,null));}; \ No newline at end of file +var _0x5d91=['../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','OpenchannelTransferReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x5d91,0xc8));var _0x15d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d91[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x15d9('0x0'));var emlformat=require(_0x15d9('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x15d9('0x2'));var jsonpatch=require(_0x15d9('0x3'));var rp=require(_0x15d9('0x4'));var moment=require(_0x15d9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x15d9('0x6'));var util=require(_0x15d9('0x7'));var path=require(_0x15d9('0x8'));var sox=require(_0x15d9('0x9'));var csv=require(_0x15d9('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x15d9('0xb'));var squel=require(_0x15d9('0xc'));var crypto=require(_0x15d9('0xd'));var jsforce=require(_0x15d9('0xe'));var deskjs=require(_0x15d9('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x15d9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x15d9('0x11'));var hardwareService=require(_0x15d9('0x12'));var logger=require(_0x15d9('0x13'))(_0x15d9('0x14'));var utils=require(_0x15d9('0x15'));var config=require(_0x15d9('0x16'));var db=require(_0x15d9('0x17'))['db'];function respondWithStatusCode(_0x263f3a,_0x5996d8){_0x5996d8=_0x5996d8||0xcc;return function(_0x7f8487){if(_0x7f8487){return _0x263f3a[_0x15d9('0x18')](_0x5996d8);}return _0x263f3a[_0x15d9('0x19')](_0x5996d8)[_0x15d9('0x1a')]();};}function respondWithResult(_0x187994,_0x498061){_0x498061=_0x498061||0xc8;return function(_0x39d58b){if(_0x39d58b){return _0x187994[_0x15d9('0x19')](_0x498061)[_0x15d9('0x1b')](_0x39d58b);}};}function respondWithFilteredResult(_0x57a6d8,_0x3e9a6c){return function(_0x363bdc){if(_0x363bdc){var _0x1a4582=_0x363bdc[_0x15d9('0x1c')],_0x3c23b1=_0x3e9a6c['offset'],_0x193d53=_0x3e9a6c['offset']+_0x3e9a6c[_0x15d9('0x1d')],_0xad4e55;if(_0x193d53>=_0x1a4582){_0x193d53=_0x1a4582;_0xad4e55=0xc8;}else{_0xad4e55=0xce;}_0x57a6d8[_0x15d9('0x19')](_0xad4e55);return _0x57a6d8['set'](_0x15d9('0x1e'),_0x3c23b1+'-'+_0x193d53+'/'+_0x1a4582)[_0x15d9('0x1b')](_0x363bdc);}return null;};}function patchUpdates(_0x3ac46c){return function(_0x583d4e){try{jsonpatch[_0x15d9('0x1f')](_0x583d4e,_0x3ac46c,!![]);}catch(_0x227e9f){return BPromise[_0x15d9('0x20')](_0x227e9f);}return _0x583d4e[_0x15d9('0x21')]();};}function saveUpdates(_0x4028bd,_0x265c65){return function(_0x2e5dbf){if(_0x2e5dbf){return _0x2e5dbf[_0x15d9('0x22')](_0x4028bd)[_0x15d9('0x23')](function(_0x17d810){return _0x17d810;});}return null;};}function removeEntity(_0x526fed,_0x1b7b49){return function(_0x2d3cff){if(_0x2d3cff){return _0x2d3cff[_0x15d9('0x24')]()[_0x15d9('0x23')](function(){_0x526fed[_0x15d9('0x19')](0xcc)[_0x15d9('0x1a')]();});}};}function handleEntityNotFound(_0x5e6aa1,_0x1fc4df){return function(_0x7f1a0b){if(!_0x7f1a0b){_0x5e6aa1[_0x15d9('0x18')](0x194);}return _0x7f1a0b;};}function handleError(_0x160a6e,_0x167425){_0x167425=_0x167425||0x1f4;return function(_0x1ded59){logger[_0x15d9('0x25')](_0x1ded59[_0x15d9('0x26')]);if(_0x1ded59[_0x15d9('0x27')]){delete _0x1ded59[_0x15d9('0x27')];}_0x160a6e[_0x15d9('0x19')](_0x167425)['send'](_0x1ded59);};}exports[_0x15d9('0x28')]=function(_0x30a521,_0x2dbba7){var _0x387fd9={},_0x33ff12={},_0x5e2f03={'count':0x0,'rows':[]};var _0x2b3f3d=_[_0x15d9('0x29')](db[_0x15d9('0x2a')][_0x15d9('0x2b')],function(_0x523bcc){return{'name':_0x523bcc['fieldName'],'type':_0x523bcc['type'][_0x15d9('0x2c')]};});_0x33ff12[_0x15d9('0x2d')]=_[_0x15d9('0x29')](_0x2b3f3d,_0x15d9('0x27'));_0x33ff12[_0x15d9('0x2e')]=_[_0x15d9('0x2f')](_0x30a521['query']);_0x33ff12[_0x15d9('0x30')]=_[_0x15d9('0x31')](_0x33ff12[_0x15d9('0x2d')],_0x33ff12['query']);_0x387fd9[_0x15d9('0x32')]=_[_0x15d9('0x31')](_0x33ff12[_0x15d9('0x2d')],qs['fields'](_0x30a521[_0x15d9('0x2e')][_0x15d9('0x33')]));_0x387fd9[_0x15d9('0x32')]=_0x387fd9[_0x15d9('0x32')][_0x15d9('0x34')]?_0x387fd9['attributes']:_0x33ff12[_0x15d9('0x2d')];if(!_0x30a521[_0x15d9('0x2e')]['hasOwnProperty'](_0x15d9('0x35'))){_0x387fd9[_0x15d9('0x1d')]=qs[_0x15d9('0x1d')](_0x30a521[_0x15d9('0x2e')][_0x15d9('0x1d')]);_0x387fd9['offset']=qs[_0x15d9('0x36')](_0x30a521['query'][_0x15d9('0x36')]);}_0x387fd9['order']=qs[_0x15d9('0x37')](_0x30a521[_0x15d9('0x2e')][_0x15d9('0x37')]);_0x387fd9[_0x15d9('0x38')]=qs[_0x15d9('0x30')](_[_0x15d9('0x39')](_0x30a521[_0x15d9('0x2e')],_0x33ff12[_0x15d9('0x30')]));if(_0x30a521[_0x15d9('0x2e')][_0x15d9('0x3a')]){_0x387fd9['where']=_[_0x15d9('0x3b')](_0x387fd9['where'],{'$or':_['map'](_0x2b3f3d,function(_0x161f99){if(_0x161f99[_0x15d9('0x3c')]!==_0x15d9('0x3d')){var _0x228b0a={};_0x228b0a[_0x161f99[_0x15d9('0x27')]]={'$like':'%'+_0x30a521[_0x15d9('0x2e')]['filter']+'%'};return _0x228b0a;}})});}_0x387fd9=_[_0x15d9('0x3b')]({},_0x387fd9,_0x30a521[_0x15d9('0x3e')]);var _0x4ffd95={'where':_0x387fd9[_0x15d9('0x38')]};return db[_0x15d9('0x2a')][_0x15d9('0x1c')](_0x4ffd95)[_0x15d9('0x23')](function(_0x4ffc6b){_0x5e2f03['count']=_0x4ffc6b;if(_0x30a521[_0x15d9('0x2e')]['includeAll']){_0x387fd9[_0x15d9('0x3f')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x15d9('0x40')](_0x387fd9);})[_0x15d9('0x23')](function(_0x55490d){_0x5e2f03[_0x15d9('0x41')]=_0x55490d;return _0x5e2f03;})['then'](respondWithFilteredResult(_0x2dbba7,_0x387fd9))[_0x15d9('0x42')](handleError(_0x2dbba7,null));};exports[_0x15d9('0x43')]=function(_0x42cd80,_0x2a6270){var _0x497a39={'raw':!![],'where':{'id':_0x42cd80[_0x15d9('0x44')]['id']}},_0x446ef8={};_0x446ef8['model']=_[_0x15d9('0x2f')](db['OpenchannelTransferReport'][_0x15d9('0x2b')]);_0x446ef8[_0x15d9('0x2e')]=_[_0x15d9('0x2f')](_0x42cd80['query']);_0x446ef8[_0x15d9('0x30')]=_[_0x15d9('0x31')](_0x446ef8[_0x15d9('0x2d')],_0x446ef8[_0x15d9('0x2e')]);_0x497a39[_0x15d9('0x32')]=_[_0x15d9('0x31')](_0x446ef8[_0x15d9('0x2d')],qs[_0x15d9('0x33')](_0x42cd80['query']['fields']));_0x497a39['attributes']=_0x497a39[_0x15d9('0x32')][_0x15d9('0x34')]?_0x497a39[_0x15d9('0x32')]:_0x446ef8[_0x15d9('0x2d')];if(_0x42cd80[_0x15d9('0x2e')][_0x15d9('0x45')]){_0x497a39[_0x15d9('0x3f')]=[{'all':!![]}];}_0x497a39=_[_0x15d9('0x3b')]({},_0x497a39,_0x42cd80[_0x15d9('0x3e')]);return db['OpenchannelTransferReport'][_0x15d9('0x46')](_0x497a39)['then'](handleEntityNotFound(_0x2a6270,null))[_0x15d9('0x23')](respondWithResult(_0x2a6270,null))[_0x15d9('0x42')](handleError(_0x2a6270,null));};exports[_0x15d9('0x47')]=function(_0x23cf1b,_0x40e42e){return db['OpenchannelTransferReport'][_0x15d9('0x47')](_0x23cf1b['body'],{})['then'](respondWithResult(_0x40e42e,0xc9))['catch'](handleError(_0x40e42e,null));};exports[_0x15d9('0x22')]=function(_0x12cbc5,_0x162d9f){if(_0x12cbc5[_0x15d9('0x48')]['id']){delete _0x12cbc5[_0x15d9('0x48')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x12cbc5[_0x15d9('0x44')]['id']}})[_0x15d9('0x23')](handleEntityNotFound(_0x162d9f,null))['then'](saveUpdates(_0x12cbc5['body'],null))[_0x15d9('0x23')](respondWithResult(_0x162d9f,null))['catch'](handleError(_0x162d9f,null));};exports[_0x15d9('0x24')]=function(_0x1b164b,_0x5335ff){return db[_0x15d9('0x2a')]['find']({'where':{'id':_0x1b164b[_0x15d9('0x44')]['id']}})[_0x15d9('0x23')](handleEntityNotFound(_0x5335ff,null))[_0x15d9('0x23')](removeEntity(_0x5335ff,null))[_0x15d9('0x42')](handleError(_0x5335ff,null));};exports[_0x15d9('0x49')]=function(_0x3ce98a,_0x3a118e){return db[_0x15d9('0x2a')][_0x15d9('0x49')]()[_0x15d9('0x23')](respondWithResult(_0x3a118e,null))[_0x15d9('0x42')](handleError(_0x3a118e,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 16f71b7..5955c28 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 _0x3d54=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer'];(function(_0x20ae3b,_0x23a21c){var _0x391475=function(_0x590776){while(--_0x590776){_0x20ae3b['push'](_0x20ae3b['shift']());}};_0x391475(++_0x23a21c);}(_0x3d54,0x18d));var _0x43d5=function(_0x270774,_0x3863f2){_0x270774=_0x270774-0x0;var _0x21583c=_0x3d54[_0x270774];return _0x21583c;};'use strict';var _=require(_0x43d5('0x0'));var util=require(_0x43d5('0x1'));var logger=require(_0x43d5('0x2'))('api');var moment=require(_0x43d5('0x3'));var BPromise=require(_0x43d5('0x4'));var rp=require(_0x43d5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x43d5('0x6'));var attributes=require(_0x43d5('0x7'));module[_0x43d5('0x8')]=function(_0x126ec1,_0x2a7309){return _0x126ec1[_0x43d5('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0x43d5('0xa'),'paranoid':![],'indexes':[{'name':_0x43d5('0xb'),'fields':[_0x43d5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7223=['request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','api','bluebird'];(function(_0xddd175,_0x5cfa9b){var _0x3bf8d8=function(_0x4958a8){while(--_0x4958a8){_0xddd175['push'](_0xddd175['shift']());}};_0x3bf8d8(++_0x5cfa9b);}(_0x7223,0x1f4));var _0x3722=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x7223[_0x2dadb9];return _0x2f0097;};'use strict';var _=require('lodash');var util=require(_0x3722('0x0'));var logger=require(_0x3722('0x1'))(_0x3722('0x2'));var moment=require('moment');var BPromise=require(_0x3722('0x3'));var rp=require(_0x3722('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3722('0x5'));var config=require(_0x3722('0x6'));var attributes=require(_0x3722('0x7'));module[_0x3722('0x8')]=function(_0x2f9259,_0x5f06aa){return _0x2f9259['define'](_0x3722('0x9'),attributes,{'tableName':_0x3722('0xa'),'paranoid':![],'indexes':[{'name':_0x3722('0xb'),'fields':[_0x3722('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 649af2b..72b6004 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 _0x1cfd=['jayson/promise','client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2e0dad,_0x30e121){var _0x5058fa=function(_0x279da4){while(--_0x279da4){_0x2e0dad['push'](_0x2e0dad['shift']());}};_0x5058fa(++_0x30e121);}(_0x1cfd,0x1db));var _0xd1cf=function(_0x14f7e5,_0x39527b){_0x14f7e5=_0x14f7e5-0x0;var _0xc2cdb9=_0x1cfd[_0x14f7e5];return _0xc2cdb9;};'use strict';var _=require(_0xd1cf('0x0'));var util=require(_0xd1cf('0x1'));var moment=require(_0xd1cf('0x2'));var BPromise=require(_0xd1cf('0x3'));var rs=require(_0xd1cf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1cf('0x5'))['db'];var utils=require(_0xd1cf('0x6'));var logger=require(_0xd1cf('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd1cf('0x8'));var client=jayson[_0xd1cf('0x9')][_0xd1cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a4879,_0x1bf822,_0x123b1d){return new BPromise(function(_0x36e860,_0x2f74dd){return client['request'](_0x4a4879,_0x123b1d)[_0xd1cf('0xb')](function(_0x69e911){logger[_0xd1cf('0xc')](_0xd1cf('0xd'),_0x1bf822,_0xd1cf('0xe'));logger[_0xd1cf('0xf')](_0xd1cf('0x10'),_0x1bf822,'request\x20sent',JSON[_0xd1cf('0x11')](_0x69e911));if(_0x69e911[_0xd1cf('0x12')]){if(_0x69e911[_0xd1cf('0x12')][_0xd1cf('0x13')]===0x1f4){logger[_0xd1cf('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1bf822,_0x69e911[_0xd1cf('0x12')][_0xd1cf('0x14')]);return _0x2f74dd(_0x69e911[_0xd1cf('0x12')][_0xd1cf('0x14')]);}logger[_0xd1cf('0x12')](_0xd1cf('0xd'),_0x1bf822,_0x69e911['error'][_0xd1cf('0x14')]);return _0x36e860(_0x69e911[_0xd1cf('0x12')]['message']);}else{logger[_0xd1cf('0xc')](_0xd1cf('0xd'),_0x1bf822,_0xd1cf('0xe'));_0x36e860(_0x69e911[_0xd1cf('0x15')][_0xd1cf('0x14')]);}})[_0xd1cf('0x16')](function(_0x3180bd){logger[_0xd1cf('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1bf822,_0x3180bd);_0x2f74dd(_0x3180bd);});});} \ No newline at end of file +var _0x5c4e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x33121c,_0x395903){var _0x123193=function(_0x41f650){while(--_0x41f650){_0x33121c['push'](_0x33121c['shift']());}};_0x123193(++_0x395903);}(_0x5c4e,0xea));var _0xe5c4=function(_0x534693,_0x307783){_0x534693=_0x534693-0x0;var _0x5b0292=_0x5c4e[_0x534693];return _0x5b0292;};'use strict';var _=require(_0xe5c4('0x0'));var util=require(_0xe5c4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe5c4('0x2'));var fs=require('fs');var Redis=require(_0xe5c4('0x3'));var db=require(_0xe5c4('0x4'))['db'];var utils=require(_0xe5c4('0x5'));var logger=require(_0xe5c4('0x6'))(_0xe5c4('0x7'));var config=require(_0xe5c4('0x8'));var jayson=require(_0xe5c4('0x9'));var client=jayson[_0xe5c4('0xa')][_0xe5c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x176e11,_0x3c9085,_0x702d2){return new BPromise(function(_0x472f2e,_0x421966){return client[_0xe5c4('0xc')](_0x176e11,_0x702d2)[_0xe5c4('0xd')](function(_0x35295c){logger['info'](_0xe5c4('0xe'),_0x3c9085,_0xe5c4('0xf'));logger[_0xe5c4('0x10')](_0xe5c4('0x11'),_0x3c9085,_0xe5c4('0xf'),JSON[_0xe5c4('0x12')](_0x35295c));if(_0x35295c['error']){if(_0x35295c[_0xe5c4('0x13')]['code']===0x1f4){logger[_0xe5c4('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3c9085,_0x35295c[_0xe5c4('0x13')][_0xe5c4('0x14')]);return _0x421966(_0x35295c[_0xe5c4('0x13')][_0xe5c4('0x14')]);}logger[_0xe5c4('0x13')](_0xe5c4('0xe'),_0x3c9085,_0x35295c[_0xe5c4('0x13')]['message']);return _0x472f2e(_0x35295c[_0xe5c4('0x13')][_0xe5c4('0x14')]);}else{logger[_0xe5c4('0x15')](_0xe5c4('0xe'),_0x3c9085,_0xe5c4('0xf'));_0x472f2e(_0x35295c[_0xe5c4('0x16')][_0xe5c4('0x14')]);}})[_0xe5c4('0x17')](function(_0x157616){logger[_0xe5c4('0x13')](_0xe5c4('0xe'),_0x3c9085,_0x157616);_0x421966(_0x157616);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 9a06e59..bdb8dcf 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 _0x1e65=['./pause.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1e65,0x14e));var _0x51e6=function(_0x41e3da,_0x1de5fa){_0x41e3da=_0x41e3da-0x0;var _0x4774af=_0x1e65[_0x41e3da];return _0x4774af;};'use strict';var multer=require(_0x51e6('0x0'));var util=require(_0x51e6('0x1'));var path=require(_0x51e6('0x2'));var timeout=require(_0x51e6('0x3'));var express=require(_0x51e6('0x4'));var router=express[_0x51e6('0x5')]();var auth=require(_0x51e6('0x6'));var interaction=require(_0x51e6('0x7'));var config=require('../../config/environment');var controller=require(_0x51e6('0x8'));router[_0x51e6('0x9')]('/',auth[_0x51e6('0xa')](),controller['index']);router[_0x51e6('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x51e6('0xb')]);router[_0x51e6('0xc')]('/',auth[_0x51e6('0xa')](),controller[_0x51e6('0xd')]);router[_0x51e6('0xe')](_0x51e6('0xf'),auth[_0x51e6('0xa')](),controller[_0x51e6('0x10')]);router[_0x51e6('0x11')]('/:id',auth[_0x51e6('0xa')](),controller[_0x51e6('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9d59=['put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./pause.controller','index','get','/:id','isAuthenticated','show','post','create'];(function(_0x1ee611,_0x377a3a){var _0x3bce0a=function(_0x5357c6){while(--_0x5357c6){_0x1ee611['push'](_0x1ee611['shift']());}};_0x3bce0a(++_0x377a3a);}(_0x9d59,0x1cc));var _0x99d5=function(_0x1b7702,_0x46e743){_0x1b7702=_0x1b7702-0x0;var _0x640f0b=_0x9d59[_0x1b7702];return _0x640f0b;};'use strict';var multer=require('multer');var util=require(_0x99d5('0x0'));var path=require(_0x99d5('0x1'));var timeout=require(_0x99d5('0x2'));var express=require(_0x99d5('0x3'));var router=express[_0x99d5('0x4')]();var auth=require(_0x99d5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x99d5('0x6'));var controller=require(_0x99d5('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x99d5('0x8')]);router[_0x99d5('0x9')](_0x99d5('0xa'),auth[_0x99d5('0xb')](),controller[_0x99d5('0xc')]);router[_0x99d5('0xd')]('/',auth['isAuthenticated'](),controller[_0x99d5('0xe')]);router[_0x99d5('0xf')](_0x99d5('0xa'),auth[_0x99d5('0xb')](),controller[_0x99d5('0x10')]);router[_0x99d5('0x11')](_0x99d5('0xa'),auth[_0x99d5('0xb')](),controller[_0x99d5('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 10a8dcd..9f8afec 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 _0x5247=['name','sequelize','exports','STRING'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x5247,0x169));var _0x7524=function(_0x3ebb9a,_0x1f5e15){_0x3ebb9a=_0x3ebb9a-0x0;var _0x504b7c=_0x5247[_0x3ebb9a];return _0x504b7c;};'use strict';var Sequelize=require(_0x7524('0x0'));module[_0x7524('0x1')]={'name':{'type':Sequelize[_0x7524('0x2')],'unique':_0x7524('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x7524('0x2')]}}; \ No newline at end of file +var _0xcdad=['name','exports','STRING'];(function(_0x2197c1,_0x5d09a5){var _0x438d1e=function(_0x184bcd){while(--_0x184bcd){_0x2197c1['push'](_0x2197c1['shift']());}};_0x438d1e(++_0x5d09a5);}(_0xcdad,0xd9));var _0xdcda=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0xcdad[_0xa60623];return _0x4a6487;};'use strict';var Sequelize=require('sequelize');module[_0xdcda('0x0')]={'name':{'type':Sequelize[_0xdcda('0x1')],'unique':_0xdcda('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xdcda('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index a06940a..d606820 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 _0xf6f7=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','update','then','get','Pauses','UserProfileResource','destroy','end','error','stack','name','map','rawAttributes','fieldName','type','key','query','keys','attributes','model','fields','length','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','Pause','catch','show','params','intersection','find','create','body','user'];(function(_0x410f0a,_0x6ee2d){var _0x4af27d=function(_0x2c7131){while(--_0x2c7131){_0x410f0a['push'](_0x410f0a['shift']());}};_0x4af27d(++_0x6ee2d);}(_0xf6f7,0x195));var _0x7f6f=function(_0x1f7996,_0x299a14){_0x1f7996=_0x1f7996-0x0;var _0x584609=_0xf6f7[_0x1f7996];return _0x584609;};'use strict';var pdf=require(_0x7f6f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7f6f('0x1'));var zipdir=require(_0x7f6f('0x2'));var jsonpatch=require(_0x7f6f('0x3'));var rp=require(_0x7f6f('0x4'));var moment=require(_0x7f6f('0x5'));var BPromise=require(_0x7f6f('0x6'));var Mustache=require(_0x7f6f('0x7'));var util=require(_0x7f6f('0x8'));var path=require('path');var sox=require(_0x7f6f('0x9'));var csv=require(_0x7f6f('0xa'));var ejs=require(_0x7f6f('0xb'));var fs=require('fs');var _=require(_0x7f6f('0xc'));var squel=require(_0x7f6f('0xd'));var crypto=require(_0x7f6f('0xe'));var jsforce=require(_0x7f6f('0xf'));var deskjs=require(_0x7f6f('0x10'));var toCsv=require(_0x7f6f('0xa'));var querystring=require(_0x7f6f('0x11'));var Papa=require(_0x7f6f('0x12'));var Redis=require('ioredis');var authService=require(_0x7f6f('0x13'));var qs=require(_0x7f6f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f6f('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7f6f('0x16'));var config=require(_0x7f6f('0x17'));var db=require(_0x7f6f('0x18'))['db'];function respondWithStatusCode(_0x12a3f3,_0x4f41eb){_0x4f41eb=_0x4f41eb||0xcc;return function(_0x3cb6e1){if(_0x3cb6e1){return _0x12a3f3[_0x7f6f('0x19')](_0x4f41eb);}return _0x12a3f3['status'](_0x4f41eb)['end']();};}function respondWithResult(_0x26d679,_0x260f87){_0x260f87=_0x260f87||0xc8;return function(_0x5d7f07){if(_0x5d7f07){return _0x26d679[_0x7f6f('0x1a')](_0x260f87)[_0x7f6f('0x1b')](_0x5d7f07);}};}function respondWithFilteredResult(_0xd0c084,_0x34b687){return function(_0x16e2df){if(_0x16e2df){var _0x125a17=_0x16e2df[_0x7f6f('0x1c')],_0x1fcde9=_0x34b687['offset'],_0x5ee9ea=_0x34b687[_0x7f6f('0x1d')]+_0x34b687['limit'],_0x45551a;if(_0x5ee9ea>=_0x125a17){_0x5ee9ea=_0x125a17;_0x45551a=0xc8;}else{_0x45551a=0xce;}_0xd0c084[_0x7f6f('0x1a')](_0x45551a);return _0xd0c084[_0x7f6f('0x1e')]('Content-Range',_0x1fcde9+'-'+_0x5ee9ea+'/'+_0x125a17)['json'](_0x16e2df);}return null;};}function patchUpdates(_0x512fed){return function(_0x378784){try{jsonpatch[_0x7f6f('0x1f')](_0x378784,_0x512fed,!![]);}catch(_0x12a463){return BPromise[_0x7f6f('0x20')](_0x12a463);}return _0x378784['save']();};}function saveUpdates(_0x52f1a8,_0x5415c5){return function(_0x367ca9){if(_0x367ca9){return _0x367ca9[_0x7f6f('0x21')](_0x52f1a8)[_0x7f6f('0x22')](function(_0x24f05f){return _0x24f05f;});}return null;};}function removeEntity(_0x5b96aa,_0x5a0ee0){return function(_0x3e7770){if(_0x3e7770){return _0x3e7770['destroy']()[_0x7f6f('0x22')](function(){var _0x509bdc=_0x3e7770[_0x7f6f('0x23')]({'plain':!![]});var _0x685232=_0x7f6f('0x24');return db[_0x7f6f('0x25')][_0x7f6f('0x26')]({'where':{'type':_0x685232,'resourceId':_0x509bdc['id']}})[_0x7f6f('0x22')](function(){return _0x3e7770;});})['then'](function(){_0x5b96aa['status'](0xcc)[_0x7f6f('0x27')]();});}};}function handleEntityNotFound(_0x15b688,_0x802e7a){return function(_0x29d777){if(!_0x29d777){_0x15b688['sendStatus'](0x194);}return _0x29d777;};}function handleError(_0x478049,_0xf7c234){_0xf7c234=_0xf7c234||0x1f4;return function(_0x12ebd8){logger[_0x7f6f('0x28')](_0x12ebd8[_0x7f6f('0x29')]);if(_0x12ebd8['name']){delete _0x12ebd8[_0x7f6f('0x2a')];}_0x478049[_0x7f6f('0x1a')](_0xf7c234)['send'](_0x12ebd8);};}exports['index']=function(_0x4d19f8,_0x154329){var _0x17e71a={},_0x553030={},_0x2636bf={'count':0x0,'rows':[]};var _0x41d419=_[_0x7f6f('0x2b')](db['Pause'][_0x7f6f('0x2c')],function(_0x193a4c){return{'name':_0x193a4c[_0x7f6f('0x2d')],'type':_0x193a4c[_0x7f6f('0x2e')][_0x7f6f('0x2f')]};});_0x553030['model']=_['map'](_0x41d419,'name');_0x553030[_0x7f6f('0x30')]=_[_0x7f6f('0x31')](_0x4d19f8['query']);_0x553030['filters']=_['intersection'](_0x553030['model'],_0x553030[_0x7f6f('0x30')]);_0x17e71a[_0x7f6f('0x32')]=_['intersection'](_0x553030[_0x7f6f('0x33')],qs[_0x7f6f('0x34')](_0x4d19f8['query']['fields']));_0x17e71a[_0x7f6f('0x32')]=_0x17e71a[_0x7f6f('0x32')][_0x7f6f('0x35')]?_0x17e71a[_0x7f6f('0x32')]:_0x553030[_0x7f6f('0x33')];if(!_0x4d19f8[_0x7f6f('0x30')]['hasOwnProperty'](_0x7f6f('0x36'))){_0x17e71a['limit']=qs[_0x7f6f('0x37')](_0x4d19f8[_0x7f6f('0x30')][_0x7f6f('0x37')]);_0x17e71a[_0x7f6f('0x1d')]=qs[_0x7f6f('0x1d')](_0x4d19f8['query'][_0x7f6f('0x1d')]);}_0x17e71a['order']=qs[_0x7f6f('0x38')](_0x4d19f8[_0x7f6f('0x30')][_0x7f6f('0x38')]);_0x17e71a[_0x7f6f('0x39')]=qs[_0x7f6f('0x3a')](_[_0x7f6f('0x3b')](_0x4d19f8[_0x7f6f('0x30')],_0x553030['filters']));if(_0x4d19f8[_0x7f6f('0x30')][_0x7f6f('0x3c')]){_0x17e71a[_0x7f6f('0x39')]=_[_0x7f6f('0x3d')](_0x17e71a[_0x7f6f('0x39')],{'$or':_[_0x7f6f('0x2b')](_0x41d419,function(_0x204c20){if(_0x204c20[_0x7f6f('0x2e')]!==_0x7f6f('0x3e')){var _0x34f5e3={};_0x34f5e3[_0x204c20['name']]={'$like':'%'+_0x4d19f8[_0x7f6f('0x30')][_0x7f6f('0x3c')]+'%'};return _0x34f5e3;}})});}_0x17e71a=_[_0x7f6f('0x3d')]({},_0x17e71a,_0x4d19f8[_0x7f6f('0x3f')]);var _0x5acbb2={'where':_0x17e71a[_0x7f6f('0x39')]};return db['Pause']['count'](_0x5acbb2)[_0x7f6f('0x22')](function(_0x11f44d){_0x2636bf[_0x7f6f('0x1c')]=_0x11f44d;if(_0x4d19f8['query'][_0x7f6f('0x40')]){_0x17e71a[_0x7f6f('0x41')]=[{'all':!![]}];}return db[_0x7f6f('0x42')]['findAll'](_0x17e71a);})[_0x7f6f('0x22')](function(_0x125abe){_0x2636bf['rows']=_0x125abe;return _0x2636bf;})['then'](respondWithFilteredResult(_0x154329,_0x17e71a))[_0x7f6f('0x43')](handleError(_0x154329,null));};exports[_0x7f6f('0x44')]=function(_0x3c04d7,_0x48455c){var _0xa5578d={'raw':!![],'where':{'id':_0x3c04d7[_0x7f6f('0x45')]['id']}},_0x14b614={};_0x14b614[_0x7f6f('0x33')]=_['keys'](db['Pause'][_0x7f6f('0x2c')]);_0x14b614[_0x7f6f('0x30')]=_[_0x7f6f('0x31')](_0x3c04d7[_0x7f6f('0x30')]);_0x14b614[_0x7f6f('0x3a')]=_[_0x7f6f('0x46')](_0x14b614['model'],_0x14b614[_0x7f6f('0x30')]);_0xa5578d[_0x7f6f('0x32')]=_[_0x7f6f('0x46')](_0x14b614[_0x7f6f('0x33')],qs[_0x7f6f('0x34')](_0x3c04d7[_0x7f6f('0x30')][_0x7f6f('0x34')]));_0xa5578d['attributes']=_0xa5578d['attributes'][_0x7f6f('0x35')]?_0xa5578d[_0x7f6f('0x32')]:_0x14b614[_0x7f6f('0x33')];if(_0x3c04d7[_0x7f6f('0x30')][_0x7f6f('0x40')]){_0xa5578d['include']=[{'all':!![]}];}_0xa5578d=_[_0x7f6f('0x3d')]({},_0xa5578d,_0x3c04d7[_0x7f6f('0x3f')]);return db['Pause'][_0x7f6f('0x47')](_0xa5578d)[_0x7f6f('0x22')](handleEntityNotFound(_0x48455c,null))[_0x7f6f('0x22')](respondWithResult(_0x48455c,null))[_0x7f6f('0x43')](handleError(_0x48455c,null));};exports[_0x7f6f('0x48')]=function(_0x1c626d,_0x4affc8){return db[_0x7f6f('0x42')][_0x7f6f('0x48')](_0x1c626d[_0x7f6f('0x49')],{})[_0x7f6f('0x22')](function(_0x89374c){var _0x92a98b=_0x1c626d[_0x7f6f('0x4a')]['get']({'plain':!![]});if(!_0x92a98b)throw new Error(_0x7f6f('0x4b'));if(_0x92a98b[_0x7f6f('0x4c')]===_0x7f6f('0x4a')){var _0x3e015b=_0x89374c[_0x7f6f('0x23')]({'plain':!![]});var _0x2f49eb=_0x7f6f('0x24');return db[_0x7f6f('0x4d')][_0x7f6f('0x47')]({'where':{'name':_0x2f49eb,'userProfileId':_0x92a98b[_0x7f6f('0x4e')]},'raw':!![]})['then'](function(_0xd74d78){if(_0xd74d78&&_0xd74d78['autoAssociation']===0x0){return db[_0x7f6f('0x25')][_0x7f6f('0x48')]({'name':_0x3e015b[_0x7f6f('0x2a')],'resourceId':_0x3e015b['id'],'type':_0xd74d78['name'],'sectionId':_0xd74d78['id']},{})[_0x7f6f('0x22')](function(){return _0x89374c;});}else{return _0x89374c;}})[_0x7f6f('0x43')](function(_0xc58edc){logger[_0x7f6f('0x28')](_0x7f6f('0x4f'),_0xc58edc);throw _0xc58edc;});}return _0x89374c;})[_0x7f6f('0x22')](respondWithResult(_0x4affc8,0xc9))['catch'](handleError(_0x4affc8,null));};exports[_0x7f6f('0x21')]=function(_0x82840e,_0x23507a){if(_0x82840e[_0x7f6f('0x49')]['id']){delete _0x82840e[_0x7f6f('0x49')]['id'];}return db[_0x7f6f('0x42')][_0x7f6f('0x47')]({'where':{'id':_0x82840e[_0x7f6f('0x45')]['id']}})[_0x7f6f('0x22')](handleEntityNotFound(_0x23507a,null))[_0x7f6f('0x22')](saveUpdates(_0x82840e['body'],null))['then'](respondWithResult(_0x23507a,null))['catch'](handleError(_0x23507a,null));};exports[_0x7f6f('0x26')]=function(_0x1e3559,_0x3209bc){return db[_0x7f6f('0x42')][_0x7f6f('0x47')]({'where':{'id':_0x1e3559[_0x7f6f('0x45')]['id']}})['then'](handleEntityNotFound(_0x3209bc,null))[_0x7f6f('0x22')](removeEntity(_0x3209bc,null))[_0x7f6f('0x43')](handleError(_0x3209bc,null));}; \ No newline at end of file +var _0xf070=['../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then','get','end','error','send','Pause','fieldName','map','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x1fbe05,_0x780c12){var _0x19ae69=function(_0x12a86c){while(--_0x12a86c){_0x1fbe05['push'](_0x1fbe05['shift']());}};_0x19ae69(++_0x780c12);}(_0xf070,0x172));var _0x0f07=function(_0x481da7,_0x3a90b6){_0x481da7=_0x481da7-0x0;var _0x1addf1=_0xf070[_0x481da7];return _0x1addf1;};'use strict';var pdf=require(_0x0f07('0x0'));var emlformat=require(_0x0f07('0x1'));var rimraf=require(_0x0f07('0x2'));var zipdir=require(_0x0f07('0x3'));var jsonpatch=require(_0x0f07('0x4'));var rp=require(_0x0f07('0x5'));var moment=require(_0x0f07('0x6'));var BPromise=require(_0x0f07('0x7'));var Mustache=require(_0x0f07('0x8'));var util=require('util');var path=require('path');var sox=require(_0x0f07('0x9'));var csv=require('to-csv');var ejs=require(_0x0f07('0xa'));var fs=require('fs');var _=require(_0x0f07('0xb'));var squel=require(_0x0f07('0xc'));var crypto=require(_0x0f07('0xd'));var jsforce=require(_0x0f07('0xe'));var deskjs=require(_0x0f07('0xf'));var toCsv=require(_0x0f07('0x10'));var querystring=require(_0x0f07('0x11'));var Papa=require(_0x0f07('0x12'));var Redis=require(_0x0f07('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0f07('0x14'));var as=require(_0x0f07('0x15'));var hardwareService=require(_0x0f07('0x16'));var logger=require('../../config/logger')(_0x0f07('0x17'));var utils=require(_0x0f07('0x18'));var config=require(_0x0f07('0x19'));var db=require(_0x0f07('0x1a'))['db'];function respondWithStatusCode(_0x252fa1,_0x5156eb){_0x5156eb=_0x5156eb||0xcc;return function(_0x4d9474){if(_0x4d9474){return _0x252fa1[_0x0f07('0x1b')](_0x5156eb);}return _0x252fa1['status'](_0x5156eb)['end']();};}function respondWithResult(_0x3574b4,_0x2e12e9){_0x2e12e9=_0x2e12e9||0xc8;return function(_0x2340fd){if(_0x2340fd){return _0x3574b4[_0x0f07('0x1c')](_0x2e12e9)['json'](_0x2340fd);}};}function respondWithFilteredResult(_0x28cb78,_0x9b027a){return function(_0x14bf77){if(_0x14bf77){var _0x4b035d=_0x14bf77[_0x0f07('0x1d')],_0x159c0b=_0x9b027a['offset'],_0x2ab5ca=_0x9b027a[_0x0f07('0x1e')]+_0x9b027a[_0x0f07('0x1f')],_0x7cf90;if(_0x2ab5ca>=_0x4b035d){_0x2ab5ca=_0x4b035d;_0x7cf90=0xc8;}else{_0x7cf90=0xce;}_0x28cb78['status'](_0x7cf90);return _0x28cb78[_0x0f07('0x20')](_0x0f07('0x21'),_0x159c0b+'-'+_0x2ab5ca+'/'+_0x4b035d)[_0x0f07('0x22')](_0x14bf77);}return null;};}function patchUpdates(_0x2d6a7c){return function(_0x317108){try{jsonpatch[_0x0f07('0x23')](_0x317108,_0x2d6a7c,!![]);}catch(_0xa0c97c){return BPromise[_0x0f07('0x24')](_0xa0c97c);}return _0x317108['save']();};}function saveUpdates(_0x4e6544,_0x18da0c){return function(_0x15dfc7){if(_0x15dfc7){return _0x15dfc7[_0x0f07('0x25')](_0x4e6544)['then'](function(_0x28a6dd){return _0x28a6dd;});}return null;};}function removeEntity(_0x295307,_0x3244de){return function(_0x1f29b8){if(_0x1f29b8){return _0x1f29b8[_0x0f07('0x26')]()[_0x0f07('0x27')](function(){var _0x311cf6=_0x1f29b8[_0x0f07('0x28')]({'plain':!![]});var _0xda7afc='Pauses';return db['UserProfileResource']['destroy']({'where':{'type':_0xda7afc,'resourceId':_0x311cf6['id']}})['then'](function(){return _0x1f29b8;});})[_0x0f07('0x27')](function(){_0x295307[_0x0f07('0x1c')](0xcc)[_0x0f07('0x29')]();});}};}function handleEntityNotFound(_0x28a5c6,_0x3f845f){return function(_0x17da82){if(!_0x17da82){_0x28a5c6[_0x0f07('0x1b')](0x194);}return _0x17da82;};}function handleError(_0x9e6a02,_0x38a527){_0x38a527=_0x38a527||0x1f4;return function(_0x3d3a59){logger[_0x0f07('0x2a')](_0x3d3a59['stack']);if(_0x3d3a59['name']){delete _0x3d3a59['name'];}_0x9e6a02[_0x0f07('0x1c')](_0x38a527)[_0x0f07('0x2b')](_0x3d3a59);};}exports['index']=function(_0x2d400d,_0x262acb){var _0x11b170={},_0x3aa207={},_0x5a3796={'count':0x0,'rows':[]};var _0x324cac=_['map'](db[_0x0f07('0x2c')]['rawAttributes'],function(_0x2f745d){return{'name':_0x2f745d[_0x0f07('0x2d')],'type':_0x2f745d['type']['key']};});_0x3aa207['model']=_[_0x0f07('0x2e')](_0x324cac,_0x0f07('0x2f'));_0x3aa207[_0x0f07('0x30')]=_[_0x0f07('0x31')](_0x2d400d[_0x0f07('0x30')]);_0x3aa207[_0x0f07('0x32')]=_[_0x0f07('0x33')](_0x3aa207[_0x0f07('0x34')],_0x3aa207[_0x0f07('0x30')]);_0x11b170[_0x0f07('0x35')]=_[_0x0f07('0x33')](_0x3aa207[_0x0f07('0x34')],qs[_0x0f07('0x36')](_0x2d400d[_0x0f07('0x30')][_0x0f07('0x36')]));_0x11b170[_0x0f07('0x35')]=_0x11b170[_0x0f07('0x35')][_0x0f07('0x37')]?_0x11b170[_0x0f07('0x35')]:_0x3aa207[_0x0f07('0x34')];if(!_0x2d400d[_0x0f07('0x30')][_0x0f07('0x38')]('nolimit')){_0x11b170[_0x0f07('0x1f')]=qs['limit'](_0x2d400d['query'][_0x0f07('0x1f')]);_0x11b170[_0x0f07('0x1e')]=qs[_0x0f07('0x1e')](_0x2d400d[_0x0f07('0x30')][_0x0f07('0x1e')]);}_0x11b170[_0x0f07('0x39')]=qs[_0x0f07('0x3a')](_0x2d400d['query'][_0x0f07('0x3a')]);_0x11b170['where']=qs[_0x0f07('0x32')](_[_0x0f07('0x3b')](_0x2d400d['query'],_0x3aa207[_0x0f07('0x32')]));if(_0x2d400d[_0x0f07('0x30')][_0x0f07('0x3c')]){_0x11b170[_0x0f07('0x3d')]=_[_0x0f07('0x3e')](_0x11b170[_0x0f07('0x3d')],{'$or':_['map'](_0x324cac,function(_0x207021){if(_0x207021[_0x0f07('0x3f')]!=='VIRTUAL'){var _0x338564={};_0x338564[_0x207021[_0x0f07('0x2f')]]={'$like':'%'+_0x2d400d[_0x0f07('0x30')][_0x0f07('0x3c')]+'%'};return _0x338564;}})});}_0x11b170=_[_0x0f07('0x3e')]({},_0x11b170,_0x2d400d[_0x0f07('0x40')]);var _0x22bfff={'where':_0x11b170[_0x0f07('0x3d')]};return db['Pause'][_0x0f07('0x1d')](_0x22bfff)['then'](function(_0x4bd54e){_0x5a3796[_0x0f07('0x1d')]=_0x4bd54e;if(_0x2d400d[_0x0f07('0x30')][_0x0f07('0x41')]){_0x11b170[_0x0f07('0x42')]=[{'all':!![]}];}return db['Pause'][_0x0f07('0x43')](_0x11b170);})['then'](function(_0x43ff5e){_0x5a3796['rows']=_0x43ff5e;return _0x5a3796;})[_0x0f07('0x27')](respondWithFilteredResult(_0x262acb,_0x11b170))[_0x0f07('0x44')](handleError(_0x262acb,null));};exports[_0x0f07('0x45')]=function(_0x315a8a,_0xe33416){var _0x480ff6={'raw':!![],'where':{'id':_0x315a8a[_0x0f07('0x46')]['id']}},_0x543f08={};_0x543f08[_0x0f07('0x34')]=_['keys'](db[_0x0f07('0x2c')][_0x0f07('0x47')]);_0x543f08['query']=_[_0x0f07('0x31')](_0x315a8a['query']);_0x543f08[_0x0f07('0x32')]=_['intersection'](_0x543f08[_0x0f07('0x34')],_0x543f08[_0x0f07('0x30')]);_0x480ff6[_0x0f07('0x35')]=_[_0x0f07('0x33')](_0x543f08[_0x0f07('0x34')],qs[_0x0f07('0x36')](_0x315a8a[_0x0f07('0x30')][_0x0f07('0x36')]));_0x480ff6['attributes']=_0x480ff6['attributes']['length']?_0x480ff6[_0x0f07('0x35')]:_0x543f08[_0x0f07('0x34')];if(_0x315a8a[_0x0f07('0x30')]['includeAll']){_0x480ff6[_0x0f07('0x42')]=[{'all':!![]}];}_0x480ff6=_[_0x0f07('0x3e')]({},_0x480ff6,_0x315a8a['options']);return db[_0x0f07('0x2c')][_0x0f07('0x48')](_0x480ff6)[_0x0f07('0x27')](handleEntityNotFound(_0xe33416,null))['then'](respondWithResult(_0xe33416,null))[_0x0f07('0x44')](handleError(_0xe33416,null));};exports[_0x0f07('0x49')]=function(_0x3a98bd,_0x27ceec){return db[_0x0f07('0x2c')][_0x0f07('0x49')](_0x3a98bd[_0x0f07('0x4a')],{})['then'](function(_0xcf1f38){var _0x2eb0f7=_0x3a98bd[_0x0f07('0x4b')]['get']({'plain':!![]});if(!_0x2eb0f7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2eb0f7[_0x0f07('0x4c')]==='user'){var _0xabd54c=_0xcf1f38[_0x0f07('0x28')]({'plain':!![]});var _0x36a24d='Pauses';return db['UserProfileSection'][_0x0f07('0x48')]({'where':{'name':_0x36a24d,'userProfileId':_0x2eb0f7['userProfileId']},'raw':!![]})[_0x0f07('0x27')](function(_0x8d5400){if(_0x8d5400&&_0x8d5400[_0x0f07('0x4d')]===0x0){return db['UserProfileResource'][_0x0f07('0x49')]({'name':_0xabd54c['name'],'resourceId':_0xabd54c['id'],'type':_0x8d5400[_0x0f07('0x2f')],'sectionId':_0x8d5400['id']},{})[_0x0f07('0x27')](function(){return _0xcf1f38;});}else{return _0xcf1f38;}})[_0x0f07('0x44')](function(_0x15e90a){logger[_0x0f07('0x2a')](_0x0f07('0x4e'),_0x15e90a);throw _0x15e90a;});}return _0xcf1f38;})['then'](respondWithResult(_0x27ceec,0xc9))[_0x0f07('0x44')](handleError(_0x27ceec,null));};exports['update']=function(_0x37401e,_0x1e5d8f){if(_0x37401e[_0x0f07('0x4a')]['id']){delete _0x37401e[_0x0f07('0x4a')]['id'];}return db['Pause'][_0x0f07('0x48')]({'where':{'id':_0x37401e[_0x0f07('0x46')]['id']}})[_0x0f07('0x27')](handleEntityNotFound(_0x1e5d8f,null))[_0x0f07('0x27')](saveUpdates(_0x37401e['body'],null))[_0x0f07('0x27')](respondWithResult(_0x1e5d8f,null))['catch'](handleError(_0x1e5d8f,null));};exports[_0x0f07('0x26')]=function(_0x36ba4d,_0x56e0b0){return db['Pause'][_0x0f07('0x48')]({'where':{'id':_0x36ba4d[_0x0f07('0x46')]['id']}})['then'](handleEntityNotFound(_0x56e0b0,null))['then'](removeEntity(_0x56e0b0,null))[_0x0f07('0x44')](handleError(_0x56e0b0,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 9f80d7e..f88ba8d 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 _0xbecf=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses'];(function(_0xc590ea,_0x2adbce){var _0x440516=function(_0x23e6ff){while(--_0x23e6ff){_0xc590ea['push'](_0xc590ea['shift']());}};_0x440516(++_0x2adbce);}(_0xbecf,0x15c));var _0xfbec=function(_0x482b28,_0x2a89c5){_0x482b28=_0x482b28-0x0;var _0x386f63=_0xbecf[_0x482b28];return _0x386f63;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfbec('0x0'))(_0xfbec('0x1'));var moment=require(_0xfbec('0x2'));var BPromise=require(_0xfbec('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfbec('0x4'));var rimraf=require(_0xfbec('0x5'));var config=require(_0xfbec('0x6'));var attributes=require(_0xfbec('0x7'));module[_0xfbec('0x8')]=function(_0x5bd6f1,_0x297f85){return _0x5bd6f1[_0xfbec('0x9')](_0xfbec('0xa'),attributes,{'tableName':_0xfbec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d11=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','moment','request-promise','path','./pause.attributes'];(function(_0x247fa8,_0x217e65){var _0x2e269a=function(_0x136ffe){while(--_0x136ffe){_0x247fa8['push'](_0x247fa8['shift']());}};_0x2e269a(++_0x217e65);}(_0x6d11,0xbf));var _0x16d1=function(_0x5ddfb9,_0x56ed2d){_0x5ddfb9=_0x5ddfb9-0x0;var _0xfc4b2f=_0x6d11[_0x5ddfb9];return _0xfc4b2f;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var logger=require(_0x16d1('0x2'))('api');var moment=require(_0x16d1('0x3'));var BPromise=require('bluebird');var rp=require(_0x16d1('0x4'));var fs=require('fs');var path=require(_0x16d1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x16d1('0x6'));module[_0x16d1('0x7')]=function(_0x3eb9e2,_0x38626d){return _0x3eb9e2[_0x16d1('0x8')](_0x16d1('0x9'),attributes,{'tableName':_0x16d1('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 63a162d..bbeb77f 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 _0xa9e0=['then','stringify','ShowPause','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','Pause','find','options','raw','where','attributes','include','model','map'];(function(_0x217ff6,_0x36f75d){var _0x417c93=function(_0x4787d2){while(--_0x4787d2){_0x217ff6['push'](_0x217ff6['shift']());}};_0x417c93(++_0x36f75d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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['ShowPause']=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,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['include']?_['map'](_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')],function(_0x38e7c4){return{'model':db[_0x38e7c4[_0x0a9e('0x1b')]],'as':_0x38e7c4['as'],'attributes':_0x38e7c4['attributes'],'include':_0x38e7c4[_0x0a9e('0x1a')]?_[_0x0a9e('0x1c')](_0x38e7c4[_0x0a9e('0x1a')],function(_0x4d00e6){return{'model':db[_0x4d00e6[_0x0a9e('0x1b')]],'as':_0x4d00e6['as'],'attributes':_0x4d00e6[_0x0a9e('0x19')],'include':_0x4d00e6[_0x0a9e('0x1a')]?_['map'](_0x4d00e6['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x1b')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x1d')](function(_0x526cf3){logger[_0x0a9e('0xa')]('ShowPause',_0x459eb1);logger[_0x0a9e('0xd')]('ShowPause',_0x459eb1,JSON[_0x0a9e('0x1e')](_0x526cf3));_0x106033(_0x526cf3);})[_0x0a9e('0x13')](function(_0x25fba9){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x25fba9[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x25fba9[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa0e5=['error','code','message','result','catch','Pause','find','options','raw','where','attributes','include','map','model','ShowPause','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0xa0e5,0x6f));var _0x5a0e=function(_0x54668e,_0x45d939){_0x54668e=_0x54668e-0x0;var _0x30494e=_0xa0e5[_0x54668e];return _0x30494e;};'use strict';var _=require(_0x5a0e('0x0'));var util=require('util');var moment=require(_0x5a0e('0x1'));var BPromise=require(_0x5a0e('0x2'));var rs=require(_0x5a0e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a0e('0x4'))['db'];var utils=require(_0x5a0e('0x5'));var logger=require('../../config/logger')(_0x5a0e('0x6'));var config=require(_0x5a0e('0x7'));var jayson=require(_0x5a0e('0x8'));var client=jayson[_0x5a0e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45b189,_0x1e4b34,_0x2ba5a0){return new BPromise(function(_0x383df6,_0xe4662a){return client[_0x5a0e('0xa')](_0x45b189,_0x2ba5a0)['then'](function(_0x3b6baa){logger[_0x5a0e('0xb')](_0x5a0e('0xc'),_0x1e4b34,_0x5a0e('0xd'));logger[_0x5a0e('0xe')](_0x5a0e('0xf'),_0x1e4b34,_0x5a0e('0xd'),JSON[_0x5a0e('0x10')](_0x3b6baa));if(_0x3b6baa[_0x5a0e('0x11')]){if(_0x3b6baa[_0x5a0e('0x11')][_0x5a0e('0x12')]===0x1f4){logger['error']('Pause,\x20%s,\x20%s',_0x1e4b34,_0x3b6baa[_0x5a0e('0x11')][_0x5a0e('0x13')]);return _0xe4662a(_0x3b6baa[_0x5a0e('0x11')]['message']);}logger['error'](_0x5a0e('0xc'),_0x1e4b34,_0x3b6baa[_0x5a0e('0x11')]['message']);return _0x383df6(_0x3b6baa['error'][_0x5a0e('0x13')]);}else{logger[_0x5a0e('0xb')](_0x5a0e('0xc'),_0x1e4b34,'request\x20sent');_0x383df6(_0x3b6baa[_0x5a0e('0x14')][_0x5a0e('0x13')]);}})[_0x5a0e('0x15')](function(_0x42e069){logger[_0x5a0e('0x11')](_0x5a0e('0xc'),_0x1e4b34,_0x42e069);_0xe4662a(_0x42e069);});});}exports['ShowPause']=function(_0x8a44b6){var _0x472377=this;return new Promise(function(_0xcdc4a9,_0x246a70){return db[_0x5a0e('0x16')][_0x5a0e('0x17')]({'raw':_0x8a44b6[_0x5a0e('0x18')]?_0x8a44b6[_0x5a0e('0x18')][_0x5a0e('0x19')]===undefined?!![]:![]:!![],'where':_0x8a44b6['options']?_0x8a44b6[_0x5a0e('0x18')][_0x5a0e('0x1a')]||null:null,'attributes':_0x8a44b6['options']?_0x8a44b6[_0x5a0e('0x18')][_0x5a0e('0x1b')]||null:null,'include':_0x8a44b6[_0x5a0e('0x18')]?_0x8a44b6[_0x5a0e('0x18')][_0x5a0e('0x1c')]?_[_0x5a0e('0x1d')](_0x8a44b6[_0x5a0e('0x18')][_0x5a0e('0x1c')],function(_0x37415c){return{'model':db[_0x37415c[_0x5a0e('0x1e')]],'as':_0x37415c['as'],'attributes':_0x37415c[_0x5a0e('0x1b')],'include':_0x37415c['include']?_[_0x5a0e('0x1d')](_0x37415c[_0x5a0e('0x1c')],function(_0x1396b1){return{'model':db[_0x1396b1[_0x5a0e('0x1e')]],'as':_0x1396b1['as'],'attributes':_0x1396b1[_0x5a0e('0x1b')],'include':_0x1396b1[_0x5a0e('0x1c')]?_[_0x5a0e('0x1d')](_0x1396b1['include'],function(_0x381dda){return{'model':db[_0x381dda[_0x5a0e('0x1e')]],'as':_0x381dda['as'],'attributes':_0x381dda['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e5703){logger[_0x5a0e('0xb')](_0x5a0e('0x1f'),_0x8a44b6);logger['debug'](_0x5a0e('0x1f'),_0x8a44b6,JSON[_0x5a0e('0x10')](_0x1e5703));_0xcdc4a9(_0x1e5703);})['catch'](function(_0x5ca1e0){logger['error'](_0x5a0e('0x1f'),_0x5ca1e0['message'],_0x8a44b6);_0x246a70(_0x472377[_0x5a0e('0x11')](0x1f4,_0x5ca1e0['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 49d250e..d598078 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 _0x320c=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','single','upload','put','update','delete','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x320c,0xe0));var _0xc320=function(_0x4b1d48,_0x562383){_0x4b1d48=_0x4b1d48-0x0;var _0x495f6e=_0x320c[_0x4b1d48];return _0x495f6e;};'use strict';var multer=require(_0xc320('0x0'));var util=require(_0xc320('0x1'));var path=require('path');var timeout=require(_0xc320('0x2'));var express=require(_0xc320('0x3'));var router=express[_0xc320('0x4')]();var auth=require(_0xc320('0x5'));var interaction=require(_0xc320('0x6'));var config=require(_0xc320('0x7'));var controller=require(_0xc320('0x8'));router[_0xc320('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc320('0xa'),controller[_0xc320('0xb')]);router['get'](_0xc320('0xc'),auth[_0xc320('0xd')](),controller[_0xc320('0xe')]);router['get'](_0xc320('0xf'),auth[_0xc320('0xd')](),controller[_0xc320('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x282604,_0x380bdf,_0x1d630){_0x1d630(null,path['join'](config[_0xc320('0x11')],_0xc320('0x12')));},'filename':function(_0x3a1344,_0x334498,_0x289404){_0x334498['originalname']=_0x334498[_0xc320('0x13')][_0xc320('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x289404(null,util[_0xc320('0x15')](_0xc320('0x16'),path['basename'](_0x334498[_0xc320('0x13')],path[_0xc320('0x17')](_0x334498[_0xc320('0x13')])),Date[_0xc320('0x18')](),path[_0xc320('0x17')](_0x334498[_0xc320('0x13')])));}})});router[_0xc320('0x19')]('/',upload[_0xc320('0x1a')]('file'),controller[_0xc320('0x1b')]);router[_0xc320('0x19')](_0xc320('0xa'),controller['webhookPost']);router[_0xc320('0x1c')](_0xc320('0xc'),auth[_0xc320('0xd')](),controller[_0xc320('0x1d')]);router[_0xc320('0x1e')]('/:id',auth[_0xc320('0xd')](),controller['delete']);module[_0xc320('0x1f')]=router; \ No newline at end of file +var _0x106a=['format','extname','now','post','file','upload','webhookPost','/:id','update','delete','exports','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','/webhook','webhookGet','isAuthenticated','/:id/download','download','diskStorage','server/files/plugins','originalname'];(function(_0xca8608,_0xe7e2a4){var _0x18f4e7=function(_0x5d1691){while(--_0x5d1691){_0xca8608['push'](_0xca8608['shift']());}};_0x18f4e7(++_0xe7e2a4);}(_0x106a,0xf5));var _0xa106=function(_0x52c071,_0x3731a4){_0x52c071=_0x52c071-0x0;var _0x2246aa=_0x106a[_0x52c071];return _0x2246aa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa106('0x0'));var timeout=require('connect-timeout');var express=require(_0xa106('0x1'));var router=express['Router']();var auth=require(_0xa106('0x2'));var interaction=require(_0xa106('0x3'));var config=require(_0xa106('0x4'));var controller=require(_0xa106('0x5'));router[_0xa106('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa106('0x7'),controller[_0xa106('0x8')]);router['get']('/:id',auth[_0xa106('0x9')](),controller['show']);router[_0xa106('0x6')](_0xa106('0xa'),auth['isAuthenticated'](),controller[_0xa106('0xb')]);var upload=multer({'storage':multer[_0xa106('0xc')]({'destination':function(_0x2e2e67,_0x2722a4,_0x593e6a){_0x593e6a(null,path['join'](config['root'],_0xa106('0xd')));},'filename':function(_0x3bbf1b,_0x107ac6,_0x3452fe){_0x107ac6[_0xa106('0xe')]=_0x107ac6[_0xa106('0xe')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3452fe(null,util[_0xa106('0xf')]('%s-%s%s',path['basename'](_0x107ac6[_0xa106('0xe')],path[_0xa106('0x10')](_0x107ac6[_0xa106('0xe')])),Date[_0xa106('0x11')](),path[_0xa106('0x10')](_0x107ac6['originalname'])));}})});router[_0xa106('0x12')]('/',upload['single'](_0xa106('0x13')),controller[_0xa106('0x14')]);router[_0xa106('0x12')](_0xa106('0x7'),controller[_0xa106('0x15')]);router['put'](_0xa106('0x16'),auth[_0xa106('0x9')](),controller[_0xa106('0x17')]);router[_0xa106('0x18')](_0xa106('0x16'),auth['isAuthenticated'](),controller['delete']);module[_0xa106('0x19')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 3d0fb0a..3e848e8 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 _0x936b=['agentOnly','always','sequelize','exports','STRING','ENUM','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly'];(function(_0x1d9672,_0x4c1eda){var _0x52f100=function(_0x69cdc8){while(--_0x69cdc8){_0x1d9672['push'](_0x1d9672['shift']());}};_0x52f100(++_0x4c1eda);}(_0x936b,0x178));var _0xb936=function(_0x3ba02f,_0x255705){_0x3ba02f=_0x3ba02f-0x0;var _0x5f3101=_0x936b[_0x3ba02f];return _0x5f3101;};'use strict';var Sequelize=require(_0xb936('0x0'));module[_0xb936('0x1')]={'name':{'type':Sequelize[_0xb936('0x2')]},'type':{'type':Sequelize[_0xb936('0x3')]('html','script')},'description':{'type':Sequelize[_0xb936('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xb936('0x2')],'comment':_0xb936('0x5')},'active':{'type':Sequelize[_0xb936('0x6')],'defaultValue':0x0,'comment':_0xb936('0x7')},'sidebar':{'type':Sequelize[_0xb936('0x3')](_0xb936('0x8'),_0xb936('0x9'),_0xb936('0xa'),'never'),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xb936('0x2')]},'adminUrl':{'type':Sequelize[_0xb936('0x2')]},'agentUrl':{'type':Sequelize[_0xb936('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xb936('0x2')]}}; \ No newline at end of file +var _0x05a8=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','TEXT'];(function(_0x5baf29,_0x521e50){var _0x2d6553=function(_0x4340c5){while(--_0x4340c5){_0x5baf29['push'](_0x5baf29['shift']());}};_0x2d6553(++_0x521e50);}(_0x05a8,0xf9));var _0x805a=function(_0x5a637d,_0x4a8db3){_0x5a637d=_0x5a637d-0x0;var _0x21e99a=_0x05a8[_0x5a637d];return _0x21e99a;};'use strict';var Sequelize=require('sequelize');module[_0x805a('0x0')]={'name':{'type':Sequelize[_0x805a('0x1')]},'type':{'type':Sequelize[_0x805a('0x2')]('html','script')},'description':{'type':Sequelize[_0x805a('0x3')]},'version':{'type':Sequelize[_0x805a('0x3')]},'path':{'type':Sequelize['STRING'],'comment':_0x805a('0x4')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x805a('0x5')},'sidebar':{'type':Sequelize['ENUM'](_0x805a('0x6'),_0x805a('0x7'),'always',_0x805a('0x8')),'defaultValue':_0x805a('0x9'),'comment':_0x805a('0xa')},'icon':{'type':Sequelize[_0x805a('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 33f348f..98f441f 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 _0x979f=['\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','method','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','end','status','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Plugins','UserProfileResource','sendStatus','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','VIRTUAL','merge','where','includeAll','include','catch','show','params','options','server/files/plugins','%s.zip','basename','createWriteStream','zip','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','join','root','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','format','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','some','Plugin\x20manifest\x20missing','manifest.json','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','Extracted\x20folder\x20removed','body','delete','dirname','webhookGet'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x979f,0x15d));var _0xf979=function(_0x11d153,_0xe9684e){_0x11d153=_0x11d153-0x0;var _0x5cd743=_0x979f[_0x11d153];return _0x5cd743;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf979('0x0'));var rimraf=require(_0xf979('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf979('0x2'));var rp=require(_0xf979('0x3'));var moment=require(_0xf979('0x4'));var BPromise=require(_0xf979('0x5'));var Mustache=require(_0xf979('0x6'));var util=require(_0xf979('0x7'));var path=require(_0xf979('0x8'));var sox=require(_0xf979('0x9'));var csv=require(_0xf979('0xa'));var ejs=require(_0xf979('0xb'));var fs=require('fs');var _=require(_0xf979('0xc'));var squel=require(_0xf979('0xd'));var crypto=require(_0xf979('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf979('0xf'));var toCsv=require(_0xf979('0xa'));var querystring=require('querystring');var Papa=require(_0xf979('0x10'));var extract=require(_0xf979('0x11'));var rimraf=require('rimraf');var archiver=require(_0xf979('0x12'));var Redis=require(_0xf979('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf979('0x14'));var as=require(_0xf979('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf979('0x16'));var utils=require(_0xf979('0x17'));var config=require('../../config/environment');var db=require(_0xf979('0x18'))['db'];config['redis']=_['defaults'](config[_0xf979('0x19')],{'host':_0xf979('0x1a'),'port':0x18eb});var socket=require(_0xf979('0x1b'))(new Redis(config[_0xf979('0x19')]));require(_0xf979('0x1c'))[_0xf979('0x1d')](socket);function respondWithStatusCode(_0x571161,_0x2f62a8){_0x2f62a8=_0x2f62a8||0xcc;return function(_0xd9daf0){if(_0xd9daf0){return _0x571161['sendStatus'](_0x2f62a8);}return _0x571161['status'](_0x2f62a8)[_0xf979('0x1e')]();};}function respondWithResult(_0x5073cc,_0x59a590){_0x59a590=_0x59a590||0xc8;return function(_0x2fdfa2){if(_0x2fdfa2){return _0x5073cc[_0xf979('0x1f')](_0x59a590)[_0xf979('0x20')](_0x2fdfa2);}};}function respondWithFilteredResult(_0x3c2593,_0x25d8bf){return function(_0xa7d2d6){if(_0xa7d2d6){var _0x1c03cf=_0xa7d2d6[_0xf979('0x21')],_0x121450=_0x25d8bf[_0xf979('0x22')],_0x4df2e7=_0x25d8bf[_0xf979('0x22')]+_0x25d8bf['limit'],_0x2b3bb1;if(_0x4df2e7>=_0x1c03cf){_0x4df2e7=_0x1c03cf;_0x2b3bb1=0xc8;}else{_0x2b3bb1=0xce;}_0x3c2593[_0xf979('0x1f')](_0x2b3bb1);return _0x3c2593[_0xf979('0x23')](_0xf979('0x24'),_0x121450+'-'+_0x4df2e7+'/'+_0x1c03cf)[_0xf979('0x20')](_0xa7d2d6);}return null;};}function patchUpdates(_0x2a6db1){return function(_0x410bf0){try{jsonpatch[_0xf979('0x25')](_0x410bf0,_0x2a6db1,!![]);}catch(_0x1ac0b2){return BPromise[_0xf979('0x26')](_0x1ac0b2);}return _0x410bf0['save']();};}function saveUpdates(_0x4dd784,_0x195291){return function(_0x1b548d){if(_0x1b548d){return _0x1b548d[_0xf979('0x27')](_0x4dd784)[_0xf979('0x28')](function(_0x593ba6){return _0x593ba6;});}return null;};}function removeEntity(_0xfd3b7c,_0x3e4948){return function(_0x15111e){if(_0x15111e){return _0x15111e[_0xf979('0x29')]()['then'](function(){var _0x33c243=_0x15111e[_0xf979('0x2a')]({'plain':!![]});var _0x4ef47d=_0xf979('0x2b');return db[_0xf979('0x2c')][_0xf979('0x29')]({'where':{'type':_0x4ef47d,'resourceId':_0x33c243['id']}})[_0xf979('0x28')](function(){return _0x15111e;});})[_0xf979('0x28')](function(){_0xfd3b7c['status'](0xcc)[_0xf979('0x1e')]();});}};}function handleEntityNotFound(_0x16eade,_0x1520b2){return function(_0x358e9c){if(!_0x358e9c){_0x16eade[_0xf979('0x2d')](0x194);}return _0x358e9c;};}function handleError(_0x138f9b,_0x28d388){_0x28d388=_0x28d388||0x1f4;return function(_0x2c1eba){logger[_0xf979('0x2e')](_0x2c1eba[_0xf979('0x2f')]);if(_0x2c1eba['name']){delete _0x2c1eba[_0xf979('0x30')];}_0x138f9b[_0xf979('0x1f')](_0x28d388)[_0xf979('0x31')](_0x2c1eba);};}exports[_0xf979('0x32')]=function(_0x35b13e,_0x6fdf4e){var _0x4a6b65={},_0x56f47f={},_0x19602c={'count':0x0,'rows':[]};var _0x5770b0=_[_0xf979('0x33')](db[_0xf979('0x34')][_0xf979('0x35')],function(_0x2602f7){return{'name':_0x2602f7[_0xf979('0x36')],'type':_0x2602f7[_0xf979('0x37')][_0xf979('0x38')]};});_0x56f47f[_0xf979('0x39')]=_[_0xf979('0x33')](_0x5770b0,_0xf979('0x30'));_0x56f47f[_0xf979('0x3a')]=_[_0xf979('0x3b')](_0x35b13e['query']);_0x56f47f['filters']=_[_0xf979('0x3c')](_0x56f47f['model'],_0x56f47f[_0xf979('0x3a')]);_0x4a6b65[_0xf979('0x3d')]=_[_0xf979('0x3c')](_0x56f47f[_0xf979('0x39')],qs[_0xf979('0x3e')](_0x35b13e[_0xf979('0x3a')]['fields']));_0x4a6b65['attributes']=_0x4a6b65[_0xf979('0x3d')][_0xf979('0x3f')]?_0x4a6b65['attributes']:_0x56f47f['model'];if(!_0x35b13e[_0xf979('0x3a')][_0xf979('0x40')](_0xf979('0x41'))){_0x4a6b65[_0xf979('0x42')]=qs[_0xf979('0x42')](_0x35b13e['query']['limit']);_0x4a6b65[_0xf979('0x22')]=qs[_0xf979('0x22')](_0x35b13e[_0xf979('0x3a')][_0xf979('0x22')]);}_0x4a6b65[_0xf979('0x43')]=qs[_0xf979('0x44')](_0x35b13e[_0xf979('0x3a')]['sort']);_0x4a6b65['where']=qs[_0xf979('0x45')](_[_0xf979('0x46')](_0x35b13e[_0xf979('0x3a')],_0x56f47f[_0xf979('0x45')]));if(_0x35b13e[_0xf979('0x3a')][_0xf979('0x47')]){_0x4a6b65['where']=_['merge'](_0x4a6b65['where'],{'$or':_[_0xf979('0x33')](_0x5770b0,function(_0x190edf){if(_0x190edf[_0xf979('0x37')]!==_0xf979('0x48')){var _0x385d68={};_0x385d68[_0x190edf[_0xf979('0x30')]]={'$like':'%'+_0x35b13e['query']['filter']+'%'};return _0x385d68;}})});}_0x4a6b65=_[_0xf979('0x49')]({},_0x4a6b65,_0x35b13e['options']);var _0x4e78c6={'where':_0x4a6b65[_0xf979('0x4a')]};return db['Plugin'][_0xf979('0x21')](_0x4e78c6)[_0xf979('0x28')](function(_0x463b8c){_0x19602c[_0xf979('0x21')]=_0x463b8c;if(_0x35b13e[_0xf979('0x3a')][_0xf979('0x4b')]){_0x4a6b65[_0xf979('0x4c')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0x4a6b65);})[_0xf979('0x28')](function(_0x3c1ee4){_0x19602c['rows']=_0x3c1ee4;return _0x19602c;})['then'](respondWithFilteredResult(_0x6fdf4e,_0x4a6b65))[_0xf979('0x4d')](handleError(_0x6fdf4e,null));};exports[_0xf979('0x4e')]=function(_0x34eed2,_0x4c0234){var _0x34117a={'raw':!![],'where':{'id':_0x34eed2[_0xf979('0x4f')]['id']}},_0x2492f6={};_0x2492f6[_0xf979('0x39')]=_['keys'](db[_0xf979('0x34')][_0xf979('0x35')]);_0x2492f6[_0xf979('0x3a')]=_[_0xf979('0x3b')](_0x34eed2[_0xf979('0x3a')]);_0x2492f6[_0xf979('0x45')]=_[_0xf979('0x3c')](_0x2492f6['model'],_0x2492f6[_0xf979('0x3a')]);_0x34117a['attributes']=_['intersection'](_0x2492f6[_0xf979('0x39')],qs[_0xf979('0x3e')](_0x34eed2['query'][_0xf979('0x3e')]));_0x34117a[_0xf979('0x3d')]=_0x34117a['attributes'][_0xf979('0x3f')]?_0x34117a[_0xf979('0x3d')]:_0x2492f6['model'];if(_0x34eed2[_0xf979('0x3a')][_0xf979('0x4b')]){_0x34117a[_0xf979('0x4c')]=[{'all':!![]}];}_0x34117a=_['merge']({},_0x34117a,_0x34eed2[_0xf979('0x50')]);return db[_0xf979('0x34')]['find'](_0x34117a)['then'](handleEntityNotFound(_0x4c0234,null))[_0xf979('0x28')](respondWithResult(_0x4c0234,null))['catch'](handleError(_0x4c0234,null));};exports['download']=function(_0x5e89a7,_0x3362de,_0x212f1e){return db['Plugin']['find']({'where':{'id':_0x5e89a7['params']['id']},'attributes':['name',_0xf979('0x8')],'raw':!![]})[_0xf979('0x28')](handleEntityNotFound(_0x3362de,null))[_0xf979('0x28')](function(_0x5eccf7){if(_0x5eccf7){var _0x18b72b=path['join'](config['root'],_0xf979('0x51'),util['format'](_0xf979('0x52'),path[_0xf979('0x53')](_0x5eccf7[_0xf979('0x8')])));var _0x205dce=fs[_0xf979('0x54')](_0x18b72b);var _0x3db7d9=archiver(_0xf979('0x55'),{'zlib':{'level':0x9}});_0x3db7d9['on']('warning',function(_0x4a9e0b){if(_0x4a9e0b[_0xf979('0x56')]==='ENOENT'){logger[_0xf979('0x2e')](_0x4a9e0b);}else{throw new db[(_0xf979('0x57'))][(_0xf979('0x58'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x3db7d9['on'](_0xf979('0x2e'),function(_0x41dbde){throw new db[(_0xf979('0x57'))]['Error'](_0xf979('0x59'));});_0x3db7d9['pipe'](_0x205dce);_0x3db7d9[_0xf979('0x5a')]('**/*',{'cwd':path[_0xf979('0x5b')](config[_0xf979('0x5c')],'server/files/plugins',path['dirname'](_0x5eccf7[_0xf979('0x8')])),'ignore':[path[_0xf979('0x5b')](path[_0xf979('0x53')](_0x5eccf7[_0xf979('0x8')]),'node_modules/**/*'),path[_0xf979('0x5b')](path[_0xf979('0x53')](_0x5eccf7[_0xf979('0x8')]),_0xf979('0x5d'))],'nodir':!![]})[_0xf979('0x5e')]();_0x205dce['on'](_0xf979('0x5f'),function(){if(!fs[_0xf979('0x60')](_0x18b72b)){throw new db[(_0xf979('0x57'))]['Error'](_0xf979('0x61'));}return _0x3362de['download'](_0x18b72b,util[_0xf979('0x62')](_0xf979('0x52'),path[_0xf979('0x53')](_0x5eccf7[_0xf979('0x8')])),function(_0x235e55){if(_0x235e55){throw new db[(_0xf979('0x57'))][(_0xf979('0x58'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xf979('0x63')](_0x18b72b);logger[_0xf979('0x64')]('Download\x20completed');logger[_0xf979('0x64')](_0xf979('0x65'));});});}return null;})[_0xf979('0x4d')](handleError(_0x3362de,null));};exports[_0xf979('0x66')]=function(_0x3322d8,_0x53d159,_0x4fb868){var _0x3bd1c8=path[_0xf979('0x53')](_0x3322d8[_0xf979('0x67')][_0xf979('0x68')],path['extname'](_0x3322d8[_0xf979('0x67')]['filename']));var _0xfe6033=path[_0xf979('0x5b')](config[_0xf979('0x5c')],_0xf979('0x51'),_0x3322d8[_0xf979('0x67')][_0xf979('0x68')]);var _0x5c27c4=path['join'](config['root'],_0xf979('0x51'),_0x3bd1c8);logger[_0xf979('0x64')](_0xf979('0x69'),_0xfe6033);logger['info'](_0xf979('0x6a'),_0x5c27c4);try{fs[_0xf979('0x6b')](_0xfe6033,parseInt('0777',0x8));extract(_0xfe6033,{'dir':_0x5c27c4},function(_0x142589){if(_0x142589){logger[_0xf979('0x2e')](_0x142589);handleError(_0x142589,!![]);};var _0x571556=fs[_0xf979('0x6c')](_0x5c27c4);if(_0x571556[_0xf979('0x3f')]>0x1){removeReferences(_0xfe6033,_0x5c27c4);logger[_0xf979('0x2e')](_0xf979('0x6d'));return _0x4fb868(new Error('Invalid\x20plugin\x20structure'));}var _0x2f2511=fs[_0xf979('0x6e')](path[_0xf979('0x5b')](_0x5c27c4,_0x571556[0x0]));if(_0x2f2511['isFile']()){removeReferences(_0xfe6033,_0x5c27c4);logger['error'](_0xf979('0x6d'));return _0x4fb868(new Error(_0xf979('0x6d')));}if(_0x2f2511['isDirectory']()){var _0x1e0aa7=fs['readdirSync'](path[_0xf979('0x5b')](_0x5c27c4,_0x571556[0x0]));if(_0x1e0aa7[_0xf979('0x3f')]===0x0){removeReferences(_0xfe6033,_0x5c27c4);logger['error'](_0xf979('0x6d'));return _0x4fb868(new Error('Invalid\x20plugin\x20structure'));}var _0xcb6425=_0x1e0aa7[_0xf979('0x6f')](function(_0x3649ce){return _0x3649ce==='manifest.json';});if(!_0xcb6425){return _0x4fb868(new Error(_0xf979('0x70')));}var _0x312542=fs['readFileSync'](path[_0xf979('0x5b')](_0x5c27c4,_0x571556[0x0],_0xf979('0x71')));var _0x1ba182=JSON[_0xf979('0x72')](_0x312542);if(_0xf979('0x73')==typeof _0x1ba182[_0xf979('0x30')]){return _0x4fb868(new Error(_0xf979('0x74')));}if(_0xf979('0x73')==typeof _0x1ba182[_0xf979('0x37')]){return _0x4fb868(new Error(_0xf979('0x75')));}if(_0xf979('0x73')==typeof _0x1ba182[_0xf979('0x76')]){return _0x4fb868(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xf979('0x73')==typeof _0x1ba182[_0xf979('0x77')]){return _0x4fb868(new Error(_0xf979('0x78')));}if(_0x1ba182['type']==='html'){if(_0xf979('0x73')==typeof _0x1ba182[_0xf979('0x77')][_0xf979('0x79')]){return _0x4fb868(new Error(_0xf979('0x7a')));}if('undefined'==typeof _0x1ba182[_0xf979('0x77')][_0xf979('0x79')][_0xf979('0x7b')]&&_0xf979('0x73')==typeof _0x1ba182['parameters'][_0xf979('0x79')][_0xf979('0x7c')]){return _0x4fb868(new Error(_0xf979('0x7d')));}}else if(_0x1ba182['type']===_0xf979('0x7e')){if('undefined'==typeof _0x1ba182[_0xf979('0x77')][_0xf979('0x7f')]){return _0x4fb868(new Error(_0xf979('0x80')));}if(_0xf979('0x73')==typeof _0x1ba182[_0xf979('0x77')][_0xf979('0x81')]){return _0x4fb868(new Error(_0xf979('0x82')));}}else{return _0x4fb868(new Error(_0xf979('0x83')));}var _0xbdfb32=_0x1ba182[_0xf979('0x30')];var _0x69ec3a=_0x1ba182['description'];var _0x51fe7c=_0x1ba182[_0xf979('0x37')];var _0x3684bb=_0x1ba182[_0xf979('0x84')]?_0x1ba182[_0xf979('0x84')]:_0xf979('0x85');var _0x23c417=_0x1ba182[_0xf979('0x86')]?_0x1ba182['icon']:_0xf979('0x87');var _0x2988aa='';var _0x52f3ba='';var _0x46eb89='';var _0x53418f='';var _0x35ef4b=_0x1ba182[_0xf979('0x76')];if(_0x51fe7c===_0xf979('0x88')){if('undefined'!=typeof _0x1ba182[_0xf979('0x77')][_0xf979('0x79')][_0xf979('0x7b')]){var _0x1e716f=_0x1ba182['parameters']['views'][_0xf979('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xf979('0x89')](_0x1e716f)){_0x2988aa=path[_0xf979('0x5b')](_0xf979('0x8a'),_0x3bd1c8,_0x571556[0x0],_0x1e716f);}else{_0x2988aa=_0x1e716f;}}else{logger[_0xf979('0x64')](_0xf979('0x8b'));}if(_0xf979('0x73')!=typeof _0x1ba182[_0xf979('0x77')]['views'][_0xf979('0x7c')]){var _0x84e5eb=_0x1ba182[_0xf979('0x77')][_0xf979('0x79')][_0xf979('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x84e5eb)){_0x52f3ba=path[_0xf979('0x5b')](_0xf979('0x8a'),_0x3bd1c8,_0x571556[0x0],_0x84e5eb);}else{_0x52f3ba=_0x84e5eb;}}else{logger[_0xf979('0x64')](_0xf979('0x8c'));}}else if(_0x51fe7c===_0xf979('0x7e')){_0x46eb89=_0x1ba182[_0xf979('0x77')][_0xf979('0x7f')];_0x53418f=_0x1ba182[_0xf979('0x77')][_0xf979('0x81')];if(_0xf979('0x73')!=typeof _0x1ba182[_0xf979('0x77')][_0xf979('0x79')]){if(_0xf979('0x73')!=typeof _0x1ba182[_0xf979('0x77')][_0xf979('0x79')]['admin']){var _0x1e716f=_0x1ba182[_0xf979('0x77')]['views'][_0xf979('0x7b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1e716f)){_0x2988aa=path['join'](_0xf979('0x8a'),_0x3bd1c8,_0x571556[0x0],_0x1e716f);}else{_0x2988aa=_0x1e716f;}}if(_0xf979('0x73')!=typeof _0x1ba182[_0xf979('0x77')]['views'][_0xf979('0x7c')]){var _0x84e5eb=_0x1ba182[_0xf979('0x77')][_0xf979('0x79')][_0xf979('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0xf979('0x89')](_0x84e5eb)){_0x52f3ba=path[_0xf979('0x5b')](_0xf979('0x8a'),_0x3bd1c8,_0x571556[0x0],_0x84e5eb);}else{_0x52f3ba=_0x84e5eb;}}}}var _0x20a102={'name':_0xbdfb32,'description':_0x69ec3a,'path':path[_0xf979('0x5b')](_0x3bd1c8,_0x571556[0x0]),'type':_0x51fe7c,'sidebar':_0x3684bb,'icon':_0x23c417,'adminUrl':_0x2988aa,'agentUrl':_0x52f3ba,'scriptName':_0x46eb89,'scriptPath':_0x53418f,'version':_0x35ef4b};removeReferences(_0xfe6033,null);return db[_0xf979('0x34')][_0xf979('0x8d')](_0x20a102)[_0xf979('0x28')](function(_0xd3f024){var _0x1a5ceb={'role':_0x3322d8['body'][_0xf979('0x8e')],'userProfileId':_0x3322d8['body']['userProfileId']};if(!_0x1a5ceb)throw new Error(_0xf979('0x8f'));if(_0x1a5ceb[_0xf979('0x8e')]===_0xf979('0x90')){var _0x25e255=_0xd3f024['get']({'plain':!![]});return db[_0xf979('0x91')][_0xf979('0x92')]({'where':{'name':_0xf979('0x2b'),'userProfileId':_0x1a5ceb['userProfileId']},'raw':!![]})[_0xf979('0x28')](function(_0x31bc79){if(_0x31bc79&&_0x31bc79['autoAssociation']===0x0){return db[_0xf979('0x2c')][_0xf979('0x8d')]({'name':_0x25e255[_0xf979('0x30')],'resourceId':_0x25e255['id'],'type':_0x31bc79['name'],'sectionId':_0x31bc79['id']},{})[_0xf979('0x28')](function(){return _0xd3f024;});}else{return _0xd3f024;}})[_0xf979('0x4d')](function(_0x39c732){logger[_0xf979('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39c732);throw _0x39c732;});}return _0xd3f024;})[_0xf979('0x28')](respondWithResult(_0x53d159,null))['catch'](handleError(_0x53d159,null));}});}catch(_0x392af6){_0x53d159['status'](0x1f4)[_0xf979('0x31')](_0x392af6);}};function removeReferences(_0x2e8aa7,_0x26fa7d){try{if(_0x2e8aa7){fs[_0xf979('0x63')](_0x2e8aa7);logger[_0xf979('0x64')]('Zip\x20archive\x20removed');}if(_0x26fa7d){rimraf(_0x26fa7d,function(){});logger['info'](_0xf979('0x93'));}}catch(_0x368629){logger[_0xf979('0x2e')](_0x368629);}}exports[_0xf979('0x27')]=function(_0x2ce53b,_0x20500d,_0x2a84bb){return db[_0xf979('0x34')][_0xf979('0x92')]({'where':{'id':_0x2ce53b[_0xf979('0x4f')]['id']}})[_0xf979('0x28')](handleEntityNotFound(_0x20500d,null))['then'](saveUpdates(_0x2ce53b[_0xf979('0x94')],null))['then'](respondWithResult(_0x20500d,null))[_0xf979('0x4d')](handleError(_0x20500d,null));};exports[_0xf979('0x95')]=function(_0x419bf3,_0x47da6a,_0x422852){return db[_0xf979('0x34')][_0xf979('0x92')]({'where':{'id':_0x419bf3['params']['id']}})[_0xf979('0x28')](function(_0x24631e){if(_0x24631e){return _0x24631e[_0xf979('0x29')]();}})[_0xf979('0x28')](function(_0x1b4766){rimraf(path[_0xf979('0x5b')](config[_0xf979('0x5c')],_0xf979('0x51'),path[_0xf979('0x96')](_0x1b4766['path'])),function(){});return _0x1b4766;})['then'](handleEntityNotFound(_0x47da6a,null))[_0xf979('0x28')](respondWithStatusCode(_0x47da6a,null))[_0xf979('0x4d')](handleError(_0x47da6a,null));};exports[_0xf979('0x97')]=function(_0x436b5b,_0x2a8a1d,_0x1fa842){return BPromise['resolve']()[_0xf979('0x28')](function(){if(!_0x436b5b[_0xf979('0x3a')][_0xf979('0x8')]){throw new Error(_0xf979('0x98'));}if(!_0x436b5b[_0xf979('0x3a')][_0xf979('0x99')]){throw new Error(_0xf979('0x9a'));}var _0x523aee=_0x436b5b[_0xf979('0x3a')][_0xf979('0x9b')]?_0x436b5b[_0xf979('0x3a')][_0xf979('0x9b')]+':'+_0x436b5b[_0xf979('0x3a')]['port']:_0xf979('0x9c')+_0x436b5b[_0xf979('0x3a')]['port'];var _0x573c42=_0x436b5b['query'][_0xf979('0x20')]?_0x436b5b[_0xf979('0x3a')][_0xf979('0x20')]:!![];var _0x1c1818=_0x436b5b[_0xf979('0x3a')]['encoding']?_0x436b5b[_0xf979('0x3a')][_0xf979('0x9d')]:null;var _0x339e0b={'method':_0x436b5b['method'],'uri':util[_0xf979('0x62')](_0xf979('0x9e'),_0x523aee,_0x436b5b[_0xf979('0x3a')][_0xf979('0x8')]),'json':_0x573c42,'resolveWithFullResponse':!![],'encoding':_0x1c1818,'qs':_0x436b5b[_0xf979('0x3a')]};if(_0x436b5b[_0xf979('0x9f')]){_0x339e0b[_0xf979('0x9f')]=_0x436b5b[_0xf979('0x9f')];if(_0x339e0b['headers'][_0xf979('0xa0')]){delete _0x339e0b[_0xf979('0x9f')][_0xf979('0xa0')];}}if(_0x339e0b['headers'][_0xf979('0xa1')]){delete _0x339e0b[_0xf979('0x9f')]['content-type'];}return rp(_0x339e0b);})[_0xf979('0x28')](function(_0x4a7ff2){if(_0x4a7ff2){_0x2a8a1d['set'](_0x4a7ff2[_0xf979('0x9f')]);logger['info'](_0x4a7ff2[_0xf979('0x94')]);if(_[_0xf979('0xa2')](_0x436b5b['query']['path'],'download')&&_0x4a7ff2[_0xf979('0xa3')]==0x1f4){return _0x2a8a1d[_0xf979('0x2d')](_0x4a7ff2[_0xf979('0xa3')]);}else{return _0x2a8a1d['status'](_0x4a7ff2[_0xf979('0xa3')])['send'](_0x4a7ff2[_0xf979('0x94')]);}}else{return _0x2a8a1d['sendStatus'](0xc8);}})[_0xf979('0x4d')](handleError(_0x2a8a1d,null));};exports[_0xf979('0xa4')]=function(_0x3c2071,_0xc9f796,_0x25d5e0){return BPromise[_0xf979('0xa5')]()[_0xf979('0x28')](function(){if(!_0x3c2071[_0xf979('0x3a')][_0xf979('0x8')]){throw new Error(_0xf979('0x98'));}if(!_0x3c2071['query'][_0xf979('0x99')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x57782=_0x3c2071[_0xf979('0x3a')]['hostname']?_0x3c2071[_0xf979('0x3a')]['hostname']+':'+_0x3c2071[_0xf979('0x3a')][_0xf979('0x99')]:_0xf979('0x9c')+_0x3c2071['query'][_0xf979('0x99')];var _0x2ec4f8=_0x3c2071['query'][_0xf979('0x20')]?_0x3c2071[_0xf979('0x3a')]['json']:!![];var _0x5a221b=_0x3c2071[_0xf979('0x3a')][_0xf979('0x9d')]?_0x3c2071[_0xf979('0x3a')][_0xf979('0x9d')]:null;var _0x110d43={'method':_0x3c2071[_0xf979('0xa6')],'uri':util['format']('%s%s',_0x57782,_0x3c2071[_0xf979('0x3a')][_0xf979('0x8')]),'json':_0x2ec4f8,'resolveWithFullResponse':!![],'encoding':_0x5a221b,'body':_0x3c2071[_0xf979('0x94')]};if(_0x3c2071['headers']){_0x110d43[_0xf979('0x9f')]=_0x3c2071[_0xf979('0x9f')];if(_0x110d43[_0xf979('0x9f')][_0xf979('0xa0')]){delete _0x110d43[_0xf979('0x9f')][_0xf979('0xa0')];}}if(_0x110d43[_0xf979('0x9f')]['content-type']){delete _0x110d43[_0xf979('0x9f')][_0xf979('0xa1')];}return rp(_0x110d43);})[_0xf979('0x28')](function(_0x151ba5){if(_0x151ba5){_0xc9f796[_0xf979('0x23')](_0x151ba5['headers']);logger[_0xf979('0x64')](_0x151ba5['body']);return _0xc9f796[_0xf979('0x1f')](_0x151ba5[_0xf979('0xa3')])['send'](_0x151ba5['body']);}else{return _0xc9f796[_0xf979('0x2d')](0xc8);}})[_0xf979('0x4d')](handleError(_0xc9f796,null));}; \ No newline at end of file +var _0x6640=['server/files/plugins','format','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','download','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','length','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','undefined','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','script','scriptPath','plugins','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','create','send','Extracted\x20folder\x20removed','update','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','%s%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','redis','./plugin.socket','register','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','Plugins','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','Plugin','includeAll','include','rows','catch','show','params','keys','find','join','root'];(function(_0x13ad08,_0x437ca7){var _0x47d25d=function(_0x27e7c2){while(--_0x27e7c2){_0x13ad08['push'](_0x13ad08['shift']());}};_0x47d25d(++_0x437ca7);}(_0x6640,0x1bb));var _0x0664=function(_0x27638d,_0x4094db){_0x27638d=_0x27638d-0x0;var _0x35da35=_0x6640[_0x27638d];return _0x35da35;};'use strict';var pdf=require(_0x0664('0x0'));var emlformat=require(_0x0664('0x1'));var rimraf=require(_0x0664('0x2'));var zipdir=require(_0x0664('0x3'));var jsonpatch=require(_0x0664('0x4'));var rp=require(_0x0664('0x5'));var moment=require(_0x0664('0x6'));var BPromise=require(_0x0664('0x7'));var Mustache=require(_0x0664('0x8'));var util=require(_0x0664('0x9'));var path=require(_0x0664('0xa'));var sox=require(_0x0664('0xb'));var csv=require(_0x0664('0xc'));var ejs=require(_0x0664('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0664('0xe'));var crypto=require(_0x0664('0xf'));var jsforce=require(_0x0664('0x10'));var deskjs=require(_0x0664('0x11'));var toCsv=require('to-csv');var querystring=require(_0x0664('0x12'));var Papa=require(_0x0664('0x13'));var extract=require(_0x0664('0x14'));var rimraf=require(_0x0664('0x2'));var archiver=require('archiver');var Redis=require(_0x0664('0x15'));var authService=require(_0x0664('0x16'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0664('0x17'));var logger=require(_0x0664('0x18'))(_0x0664('0x19'));var utils=require(_0x0664('0x1a'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x0664('0x1b')](config[_0x0664('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0664('0x1c')]));require(_0x0664('0x1d'))[_0x0664('0x1e')](socket);function respondWithStatusCode(_0x18e1d1,_0x34d319){_0x34d319=_0x34d319||0xcc;return function(_0x4cff2a){if(_0x4cff2a){return _0x18e1d1[_0x0664('0x1f')](_0x34d319);}return _0x18e1d1['status'](_0x34d319)[_0x0664('0x20')]();};}function respondWithResult(_0x5582e3,_0x234bf6){_0x234bf6=_0x234bf6||0xc8;return function(_0x1558c9){if(_0x1558c9){return _0x5582e3[_0x0664('0x21')](_0x234bf6)['json'](_0x1558c9);}};}function respondWithFilteredResult(_0x316b98,_0x417181){return function(_0x20d8f5){if(_0x20d8f5){var _0x19a7e9=_0x20d8f5[_0x0664('0x22')],_0x21eca2=_0x417181[_0x0664('0x23')],_0x46613b=_0x417181[_0x0664('0x23')]+_0x417181[_0x0664('0x24')],_0x2869b1;if(_0x46613b>=_0x19a7e9){_0x46613b=_0x19a7e9;_0x2869b1=0xc8;}else{_0x2869b1=0xce;}_0x316b98[_0x0664('0x21')](_0x2869b1);return _0x316b98[_0x0664('0x25')](_0x0664('0x26'),_0x21eca2+'-'+_0x46613b+'/'+_0x19a7e9)[_0x0664('0x27')](_0x20d8f5);}return null;};}function patchUpdates(_0xcb776f){return function(_0x10ae30){try{jsonpatch[_0x0664('0x28')](_0x10ae30,_0xcb776f,!![]);}catch(_0x1cf874){return BPromise[_0x0664('0x29')](_0x1cf874);}return _0x10ae30[_0x0664('0x2a')]();};}function saveUpdates(_0x1ec28c,_0x47755b){return function(_0x3a243b){if(_0x3a243b){return _0x3a243b['update'](_0x1ec28c)[_0x0664('0x2b')](function(_0x5c502c){return _0x5c502c;});}return null;};}function removeEntity(_0x3cbd49,_0x7b8321){return function(_0x390692){if(_0x390692){return _0x390692[_0x0664('0x2c')]()[_0x0664('0x2b')](function(){var _0x1fe621=_0x390692['get']({'plain':!![]});var _0x53637c=_0x0664('0x2d');return db[_0x0664('0x2e')][_0x0664('0x2c')]({'where':{'type':_0x53637c,'resourceId':_0x1fe621['id']}})[_0x0664('0x2b')](function(){return _0x390692;});})[_0x0664('0x2b')](function(){_0x3cbd49[_0x0664('0x21')](0xcc)[_0x0664('0x20')]();});}};}function handleEntityNotFound(_0x1b0f63,_0xc8fd62){return function(_0x3b3de9){if(!_0x3b3de9){_0x1b0f63[_0x0664('0x1f')](0x194);}return _0x3b3de9;};}function handleError(_0x3f5599,_0x2f173b){_0x2f173b=_0x2f173b||0x1f4;return function(_0x208059){logger[_0x0664('0x2f')](_0x208059[_0x0664('0x30')]);if(_0x208059[_0x0664('0x31')]){delete _0x208059[_0x0664('0x31')];}_0x3f5599[_0x0664('0x21')](_0x2f173b)['send'](_0x208059);};}exports[_0x0664('0x32')]=function(_0x146a50,_0x466fa3){var _0x4ca201={},_0x32901b={},_0x1f08f6={'count':0x0,'rows':[]};var _0x1836fe=_[_0x0664('0x33')](db['Plugin'][_0x0664('0x34')],function(_0x401116){return{'name':_0x401116[_0x0664('0x35')],'type':_0x401116[_0x0664('0x36')][_0x0664('0x37')]};});_0x32901b[_0x0664('0x38')]=_[_0x0664('0x33')](_0x1836fe,_0x0664('0x31'));_0x32901b['query']=_['keys'](_0x146a50[_0x0664('0x39')]);_0x32901b[_0x0664('0x3a')]=_[_0x0664('0x3b')](_0x32901b[_0x0664('0x38')],_0x32901b['query']);_0x4ca201[_0x0664('0x3c')]=_['intersection'](_0x32901b[_0x0664('0x38')],qs[_0x0664('0x3d')](_0x146a50[_0x0664('0x39')][_0x0664('0x3d')]));_0x4ca201[_0x0664('0x3c')]=_0x4ca201[_0x0664('0x3c')]['length']?_0x4ca201[_0x0664('0x3c')]:_0x32901b[_0x0664('0x38')];if(!_0x146a50[_0x0664('0x39')][_0x0664('0x3e')](_0x0664('0x3f'))){_0x4ca201[_0x0664('0x24')]=qs[_0x0664('0x24')](_0x146a50[_0x0664('0x39')][_0x0664('0x24')]);_0x4ca201[_0x0664('0x23')]=qs['offset'](_0x146a50[_0x0664('0x39')][_0x0664('0x23')]);}_0x4ca201['order']=qs['sort'](_0x146a50['query'][_0x0664('0x40')]);_0x4ca201['where']=qs[_0x0664('0x3a')](_[_0x0664('0x41')](_0x146a50['query'],_0x32901b[_0x0664('0x3a')]));if(_0x146a50[_0x0664('0x39')][_0x0664('0x42')]){_0x4ca201['where']=_['merge'](_0x4ca201[_0x0664('0x43')],{'$or':_['map'](_0x1836fe,function(_0x3db447){if(_0x3db447['type']!==_0x0664('0x44')){var _0x5f25d0={};_0x5f25d0[_0x3db447['name']]={'$like':'%'+_0x146a50[_0x0664('0x39')]['filter']+'%'};return _0x5f25d0;}})});}_0x4ca201=_[_0x0664('0x45')]({},_0x4ca201,_0x146a50[_0x0664('0x46')]);var _0xb02b87={'where':_0x4ca201['where']};return db[_0x0664('0x47')]['count'](_0xb02b87)[_0x0664('0x2b')](function(_0x3d919c){_0x1f08f6[_0x0664('0x22')]=_0x3d919c;if(_0x146a50[_0x0664('0x39')][_0x0664('0x48')]){_0x4ca201[_0x0664('0x49')]=[{'all':!![]}];}return db[_0x0664('0x47')]['findAll'](_0x4ca201);})[_0x0664('0x2b')](function(_0xc7a347){_0x1f08f6[_0x0664('0x4a')]=_0xc7a347;return _0x1f08f6;})[_0x0664('0x2b')](respondWithFilteredResult(_0x466fa3,_0x4ca201))[_0x0664('0x4b')](handleError(_0x466fa3,null));};exports[_0x0664('0x4c')]=function(_0x3ca549,_0x328aa6){var _0x351ccc={'raw':!![],'where':{'id':_0x3ca549[_0x0664('0x4d')]['id']}},_0x4763b2={};_0x4763b2[_0x0664('0x38')]=_[_0x0664('0x4e')](db['Plugin'][_0x0664('0x34')]);_0x4763b2[_0x0664('0x39')]=_[_0x0664('0x4e')](_0x3ca549[_0x0664('0x39')]);_0x4763b2[_0x0664('0x3a')]=_[_0x0664('0x3b')](_0x4763b2[_0x0664('0x38')],_0x4763b2['query']);_0x351ccc[_0x0664('0x3c')]=_[_0x0664('0x3b')](_0x4763b2[_0x0664('0x38')],qs[_0x0664('0x3d')](_0x3ca549[_0x0664('0x39')][_0x0664('0x3d')]));_0x351ccc[_0x0664('0x3c')]=_0x351ccc['attributes']['length']?_0x351ccc[_0x0664('0x3c')]:_0x4763b2[_0x0664('0x38')];if(_0x3ca549[_0x0664('0x39')][_0x0664('0x48')]){_0x351ccc['include']=[{'all':!![]}];}_0x351ccc=_[_0x0664('0x45')]({},_0x351ccc,_0x3ca549[_0x0664('0x46')]);return db['Plugin'][_0x0664('0x4f')](_0x351ccc)[_0x0664('0x2b')](handleEntityNotFound(_0x328aa6,null))[_0x0664('0x2b')](respondWithResult(_0x328aa6,null))[_0x0664('0x4b')](handleError(_0x328aa6,null));};exports['download']=function(_0x22e93d,_0x244c33,_0x3491b0){return db[_0x0664('0x47')][_0x0664('0x4f')]({'where':{'id':_0x22e93d['params']['id']},'attributes':[_0x0664('0x31'),'path'],'raw':!![]})[_0x0664('0x2b')](handleEntityNotFound(_0x244c33,null))['then'](function(_0x54871e){if(_0x54871e){var _0x54f6ec=path[_0x0664('0x50')](config[_0x0664('0x51')],_0x0664('0x52'),util[_0x0664('0x53')]('%s.zip',path[_0x0664('0x54')](_0x54871e['path'])));var _0x43cc32=fs[_0x0664('0x55')](_0x54f6ec);var _0x51faa5=archiver(_0x0664('0x56'),{'zlib':{'level':0x9}});_0x51faa5['on'](_0x0664('0x57'),function(_0xe7e13f){if(_0xe7e13f[_0x0664('0x58')]===_0x0664('0x59')){logger['error'](_0xe7e13f);}else{throw new db[(_0x0664('0x5a'))]['Error'](_0x0664('0x5b'));}});_0x51faa5['on'](_0x0664('0x2f'),function(_0x4243fb){throw new db[(_0x0664('0x5a'))][(_0x0664('0x5c'))](_0x0664('0x5b'));});_0x51faa5[_0x0664('0x5d')](_0x43cc32);_0x51faa5[_0x0664('0x5e')](_0x0664('0x5f'),{'cwd':path[_0x0664('0x50')](config[_0x0664('0x51')],_0x0664('0x52'),path[_0x0664('0x60')](_0x54871e['path'])),'ignore':[path['join'](path[_0x0664('0x54')](_0x54871e['path']),_0x0664('0x61')),path[_0x0664('0x50')](path[_0x0664('0x54')](_0x54871e[_0x0664('0xa')]),_0x0664('0x62'))],'nodir':!![]})[_0x0664('0x63')]();_0x43cc32['on'](_0x0664('0x64'),function(){if(!fs[_0x0664('0x65')](_0x54f6ec)){throw new db[(_0x0664('0x5a'))][(_0x0664('0x5c'))]('Plugin\x20not\x20found');}return _0x244c33[_0x0664('0x66')](_0x54f6ec,util[_0x0664('0x53')](_0x0664('0x67'),path['basename'](_0x54871e['path'])),function(_0x20a06f){if(_0x20a06f){throw new db[(_0x0664('0x5a'))][(_0x0664('0x5c'))](_0x0664('0x68'));}fs[_0x0664('0x69')](_0x54f6ec);logger['info']('Download\x20completed');logger[_0x0664('0x6a')]('Temporary\x20file\x20removed');});});}return null;})[_0x0664('0x4b')](handleError(_0x244c33,null));};exports[_0x0664('0x6b')]=function(_0x3b37d1,_0x4b4f76,_0x40a82b){var _0x3dc5ac=path['basename'](_0x3b37d1[_0x0664('0x6c')][_0x0664('0x6d')],path['extname'](_0x3b37d1['file'][_0x0664('0x6d')]));var _0x157470=path[_0x0664('0x50')](config[_0x0664('0x51')],'server/files/plugins',_0x3b37d1['file'][_0x0664('0x6d')]);var _0x26b303=path[_0x0664('0x50')](config[_0x0664('0x51')],_0x0664('0x52'),_0x3dc5ac);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x157470);logger[_0x0664('0x6a')](_0x0664('0x6e'),_0x26b303);try{fs[_0x0664('0x6f')](_0x157470,parseInt(_0x0664('0x70'),0x8));extract(_0x157470,{'dir':_0x26b303},function(_0x260ca4){if(_0x260ca4){logger['error'](_0x260ca4);handleError(_0x260ca4,!![]);};var _0x2a3d63=fs[_0x0664('0x71')](_0x26b303);if(_0x2a3d63['length']>0x1){removeReferences(_0x157470,_0x26b303);logger[_0x0664('0x2f')](_0x0664('0x72'));return _0x40a82b(new Error('Invalid\x20plugin\x20structure'));}var _0x2addb7=fs[_0x0664('0x73')](path[_0x0664('0x50')](_0x26b303,_0x2a3d63[0x0]));if(_0x2addb7[_0x0664('0x74')]()){removeReferences(_0x157470,_0x26b303);logger[_0x0664('0x2f')](_0x0664('0x72'));return _0x40a82b(new Error('Invalid\x20plugin\x20structure'));}if(_0x2addb7['isDirectory']()){var _0x51ef38=fs['readdirSync'](path['join'](_0x26b303,_0x2a3d63[0x0]));if(_0x51ef38[_0x0664('0x75')]===0x0){removeReferences(_0x157470,_0x26b303);logger['error']('Invalid\x20plugin\x20structure');return _0x40a82b(new Error('Invalid\x20plugin\x20structure'));}var _0x236a6b=_0x51ef38[_0x0664('0x76')](function(_0x234def){return _0x234def===_0x0664('0x77');});if(!_0x236a6b){return _0x40a82b(new Error(_0x0664('0x78')));}var _0xdb7951=fs[_0x0664('0x79')](path[_0x0664('0x50')](_0x26b303,_0x2a3d63[0x0],_0x0664('0x77')));var _0x350c6a=JSON[_0x0664('0x7a')](_0xdb7951);if('undefined'==typeof _0x350c6a[_0x0664('0x31')]){return _0x40a82b(new Error(_0x0664('0x7b')));}if(_0x0664('0x7c')==typeof _0x350c6a['type']){return _0x40a82b(new Error(_0x0664('0x7d')));}if('undefined'==typeof _0x350c6a['version']){return _0x40a82b(new Error(_0x0664('0x7e')));}if(_0x0664('0x7c')==typeof _0x350c6a['parameters']){return _0x40a82b(new Error(_0x0664('0x7f')));}if(_0x350c6a['type']===_0x0664('0x80')){if(_0x0664('0x7c')==typeof _0x350c6a[_0x0664('0x81')][_0x0664('0x82')]){return _0x40a82b(new Error(_0x0664('0x83')));}if(_0x0664('0x7c')==typeof _0x350c6a[_0x0664('0x81')][_0x0664('0x82')][_0x0664('0x84')]&&_0x0664('0x7c')==typeof _0x350c6a[_0x0664('0x81')][_0x0664('0x82')][_0x0664('0x85')]){return _0x40a82b(new Error(_0x0664('0x86')));}}else if(_0x350c6a[_0x0664('0x36')]==='script'){if(_0x0664('0x7c')==typeof _0x350c6a[_0x0664('0x81')][_0x0664('0x87')]){return _0x40a82b(new Error(_0x0664('0x88')));}if('undefined'==typeof _0x350c6a['parameters']['scriptPath']){return _0x40a82b(new Error(_0x0664('0x89')));}}else{return _0x40a82b(new Error(_0x0664('0x8a')));}var _0x11fb7d=_0x350c6a[_0x0664('0x31')];var _0x46a8a8=_0x350c6a[_0x0664('0x8b')];var _0x165218=_0x350c6a['type'];var _0x61bba8=_0x350c6a['sidebar']?_0x350c6a[_0x0664('0x8c')]:_0x0664('0x8d');var _0x6659c0=_0x350c6a[_0x0664('0x8e')]?_0x350c6a[_0x0664('0x8e')]:'icon-apps';var _0x169eb6='';var _0x473b6e='';var _0x7b9dfc='';var _0x343eea='';var _0x11f932=_0x350c6a['version'];if(_0x165218===_0x0664('0x80')){if(_0x0664('0x7c')!=typeof _0x350c6a['parameters'][_0x0664('0x82')][_0x0664('0x84')]){var _0xa0394f=_0x350c6a[_0x0664('0x81')]['views'][_0x0664('0x84')];if(!/^(f|ht)tps?:\/\//i['test'](_0xa0394f)){_0x169eb6=path['join']('plugins',_0x3dc5ac,_0x2a3d63[0x0],_0xa0394f);}else{_0x169eb6=_0xa0394f;}}else{logger[_0x0664('0x6a')](_0x0664('0x8f'));}if('undefined'!=typeof _0x350c6a[_0x0664('0x81')]['views'][_0x0664('0x85')]){var _0x3cc565=_0x350c6a[_0x0664('0x81')]['views'][_0x0664('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x0664('0x90')](_0x3cc565)){_0x473b6e=path[_0x0664('0x50')]('plugins',_0x3dc5ac,_0x2a3d63[0x0],_0x3cc565);}else{_0x473b6e=_0x3cc565;}}else{logger['info'](_0x0664('0x91'));}}else if(_0x165218===_0x0664('0x92')){_0x7b9dfc=_0x350c6a['parameters']['scriptName'];_0x343eea=_0x350c6a[_0x0664('0x81')][_0x0664('0x93')];if(_0x0664('0x7c')!=typeof _0x350c6a[_0x0664('0x81')]['views']){if(_0x0664('0x7c')!=typeof _0x350c6a['parameters'][_0x0664('0x82')][_0x0664('0x84')]){var _0xa0394f=_0x350c6a[_0x0664('0x81')][_0x0664('0x82')][_0x0664('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x0664('0x90')](_0xa0394f)){_0x169eb6=path[_0x0664('0x50')](_0x0664('0x94'),_0x3dc5ac,_0x2a3d63[0x0],_0xa0394f);}else{_0x169eb6=_0xa0394f;}}if(_0x0664('0x7c')!=typeof _0x350c6a[_0x0664('0x81')][_0x0664('0x82')][_0x0664('0x85')]){var _0x3cc565=_0x350c6a[_0x0664('0x81')][_0x0664('0x82')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x0664('0x90')](_0x3cc565)){_0x473b6e=path[_0x0664('0x50')](_0x0664('0x94'),_0x3dc5ac,_0x2a3d63[0x0],_0x3cc565);}else{_0x473b6e=_0x3cc565;}}}}var _0x43b4ac={'name':_0x11fb7d,'description':_0x46a8a8,'path':path[_0x0664('0x50')](_0x3dc5ac,_0x2a3d63[0x0]),'type':_0x165218,'sidebar':_0x61bba8,'icon':_0x6659c0,'adminUrl':_0x169eb6,'agentUrl':_0x473b6e,'scriptName':_0x7b9dfc,'scriptPath':_0x343eea,'version':_0x11f932};removeReferences(_0x157470,null);return db['Plugin']['create'](_0x43b4ac)[_0x0664('0x2b')](function(_0xe9a052){var _0x3a9914={'role':_0x3b37d1['body'][_0x0664('0x95')],'userProfileId':_0x3b37d1[_0x0664('0x96')][_0x0664('0x97')]};if(!_0x3a9914)throw new Error(_0x0664('0x98'));if(_0x3a9914[_0x0664('0x95')]==='user'){var _0x55f8b9=_0xe9a052[_0x0664('0x99')]({'plain':!![]});return db[_0x0664('0x9a')][_0x0664('0x4f')]({'where':{'name':'Plugins','userProfileId':_0x3a9914[_0x0664('0x97')]},'raw':!![]})[_0x0664('0x2b')](function(_0x34077e){if(_0x34077e&&_0x34077e[_0x0664('0x9b')]===0x0){return db[_0x0664('0x2e')][_0x0664('0x9c')]({'name':_0x55f8b9['name'],'resourceId':_0x55f8b9['id'],'type':_0x34077e[_0x0664('0x31')],'sectionId':_0x34077e['id']},{})[_0x0664('0x2b')](function(){return _0xe9a052;});}else{return _0xe9a052;}})[_0x0664('0x4b')](function(_0x486088){logger[_0x0664('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x486088);throw _0x486088;});}return _0xe9a052;})[_0x0664('0x2b')](respondWithResult(_0x4b4f76,null))[_0x0664('0x4b')](handleError(_0x4b4f76,null));}});}catch(_0x2950f0){_0x4b4f76[_0x0664('0x21')](0x1f4)[_0x0664('0x9d')](_0x2950f0);}};function removeReferences(_0x1a6a58,_0xe56c81){try{if(_0x1a6a58){fs[_0x0664('0x69')](_0x1a6a58);logger[_0x0664('0x6a')]('Zip\x20archive\x20removed');}if(_0xe56c81){rimraf(_0xe56c81,function(){});logger[_0x0664('0x6a')](_0x0664('0x9e'));}}catch(_0x5638fb){logger[_0x0664('0x2f')](_0x5638fb);}}exports[_0x0664('0x9f')]=function(_0x3764a2,_0xaa31e5,_0x22e005){return db[_0x0664('0x47')]['find']({'where':{'id':_0x3764a2[_0x0664('0x4d')]['id']}})['then'](handleEntityNotFound(_0xaa31e5,null))['then'](saveUpdates(_0x3764a2['body'],null))[_0x0664('0x2b')](respondWithResult(_0xaa31e5,null))[_0x0664('0x4b')](handleError(_0xaa31e5,null));};exports['delete']=function(_0x39f111,_0x174b95,_0x547eaf){return db[_0x0664('0x47')]['find']({'where':{'id':_0x39f111[_0x0664('0x4d')]['id']}})['then'](function(_0x283018){if(_0x283018){return _0x283018['destroy']();}})[_0x0664('0x2b')](function(_0x4cbfbb){rimraf(path['join'](config[_0x0664('0x51')],_0x0664('0x52'),path[_0x0664('0x60')](_0x4cbfbb[_0x0664('0xa')])),function(){});return _0x4cbfbb;})[_0x0664('0x2b')](handleEntityNotFound(_0x174b95,null))[_0x0664('0x2b')](respondWithStatusCode(_0x174b95,null))['catch'](handleError(_0x174b95,null));};exports['webhookGet']=function(_0x1ef47a,_0x438ab9,_0x1c63df){return BPromise['resolve']()[_0x0664('0x2b')](function(){if(!_0x1ef47a[_0x0664('0x39')][_0x0664('0xa')]){throw new Error(_0x0664('0xa0'));}if(!_0x1ef47a['query'][_0x0664('0xa1')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3f443a=_0x1ef47a[_0x0664('0x39')]['hostname']?_0x1ef47a[_0x0664('0x39')][_0x0664('0xa2')]+':'+_0x1ef47a[_0x0664('0x39')]['port']:_0x0664('0xa3')+_0x1ef47a[_0x0664('0x39')][_0x0664('0xa1')];var _0x36c94c=_0x1ef47a[_0x0664('0x39')][_0x0664('0x27')]?_0x1ef47a[_0x0664('0x39')][_0x0664('0x27')]:!![];var _0x5aa06e=_0x1ef47a['query'][_0x0664('0xa4')]?_0x1ef47a[_0x0664('0x39')][_0x0664('0xa4')]:null;var _0x48d1c0={'method':_0x1ef47a[_0x0664('0xa5')],'uri':util['format']('%s%s',_0x3f443a,_0x1ef47a['query'][_0x0664('0xa')]),'json':_0x36c94c,'resolveWithFullResponse':!![],'encoding':_0x5aa06e,'qs':_0x1ef47a[_0x0664('0x39')]};if(_0x1ef47a['headers']){_0x48d1c0[_0x0664('0xa6')]=_0x1ef47a[_0x0664('0xa6')];if(_0x48d1c0[_0x0664('0xa6')][_0x0664('0xa7')]){delete _0x48d1c0[_0x0664('0xa6')][_0x0664('0xa7')];}}if(_0x48d1c0[_0x0664('0xa6')][_0x0664('0xa8')]){delete _0x48d1c0[_0x0664('0xa6')][_0x0664('0xa8')];}return rp(_0x48d1c0);})['then'](function(_0x595d76){if(_0x595d76){_0x438ab9[_0x0664('0x25')](_0x595d76[_0x0664('0xa6')]);logger[_0x0664('0x6a')](_0x595d76[_0x0664('0x96')]);if(_[_0x0664('0xa9')](_0x1ef47a[_0x0664('0x39')]['path'],_0x0664('0x66'))&&_0x595d76[_0x0664('0xaa')]==0x1f4){return _0x438ab9[_0x0664('0x1f')](_0x595d76[_0x0664('0xaa')]);}else{return _0x438ab9[_0x0664('0x21')](_0x595d76['statusCode'])['send'](_0x595d76[_0x0664('0x96')]);}}else{return _0x438ab9[_0x0664('0x1f')](0xc8);}})[_0x0664('0x4b')](handleError(_0x438ab9,null));};exports[_0x0664('0xab')]=function(_0x2cfe27,_0x502546,_0x552915){return BPromise[_0x0664('0xac')]()['then'](function(){if(!_0x2cfe27[_0x0664('0x39')][_0x0664('0xa')]){throw new Error(_0x0664('0xa0'));}if(!_0x2cfe27[_0x0664('0x39')][_0x0664('0xa1')]){throw new Error(_0x0664('0xad'));}var _0x244bdb=_0x2cfe27['query']['hostname']?_0x2cfe27[_0x0664('0x39')]['hostname']+':'+_0x2cfe27[_0x0664('0x39')]['port']:'http://localhost:'+_0x2cfe27[_0x0664('0x39')]['port'];var _0x41ca5a=_0x2cfe27['query']['json']?_0x2cfe27[_0x0664('0x39')][_0x0664('0x27')]:!![];var _0x356031=_0x2cfe27[_0x0664('0x39')]['encoding']?_0x2cfe27[_0x0664('0x39')][_0x0664('0xa4')]:null;var _0x39c3ed={'method':_0x2cfe27[_0x0664('0xa5')],'uri':util['format'](_0x0664('0xae'),_0x244bdb,_0x2cfe27[_0x0664('0x39')][_0x0664('0xa')]),'json':_0x41ca5a,'resolveWithFullResponse':!![],'encoding':_0x356031,'body':_0x2cfe27[_0x0664('0x96')]};if(_0x2cfe27[_0x0664('0xa6')]){_0x39c3ed['headers']=_0x2cfe27[_0x0664('0xa6')];if(_0x39c3ed[_0x0664('0xa6')][_0x0664('0xa7')]){delete _0x39c3ed[_0x0664('0xa6')][_0x0664('0xa7')];}}if(_0x39c3ed[_0x0664('0xa6')]['content-type']){delete _0x39c3ed[_0x0664('0xa6')][_0x0664('0xa8')];}return rp(_0x39c3ed);})[_0x0664('0x2b')](function(_0x46078a){if(_0x46078a){_0x502546['set'](_0x46078a[_0x0664('0xa6')]);logger['info'](_0x46078a['body']);return _0x502546[_0x0664('0x21')](_0x46078a[_0x0664('0xaa')])[_0x0664('0x9d')](_0x46078a[_0x0664('0x96')]);}else{return _0x502546[_0x0664('0x1f')](0xc8);}})[_0x0664('0x4b')](handleError(_0x502546,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 44cc585..983a8c7 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 _0x2032=['exports','../../mysqldb','Plugin','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x2032,0xd9));var _0x2203=function(_0xf155ad,_0x1eeb78){_0xf155ad=_0xf155ad-0x0;var _0x16f1e2=_0x2032[_0xf155ad];return _0x16f1e2;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x2203('0x0'))['db'][_0x2203('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x2203('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2203('0x3'),'afterDestroy':_0x2203('0x4')};function emitEvent(_0x4b4c7f){return function(_0x46c49a,_0x880dcd,_0x44ccfd){PluginEvents[_0x2203('0x5')](_0x4b4c7f+':'+_0x46c49a['id'],_0x46c49a);PluginEvents[_0x2203('0x5')](_0x4b4c7f,_0x46c49a);_0x44ccfd(null);};}for(var e in events){if(events[_0x2203('0x6')](e)){var event=events[e];Plugin[_0x2203('0x7')](e,emitEvent(event));}}module[_0x2203('0x8')]=PluginEvents; \ No newline at end of file +var _0x524e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','Plugin'];(function(_0x467f97,_0x226c09){var _0x51366f=function(_0x98a572){while(--_0x98a572){_0x467f97['push'](_0x467f97['shift']());}};_0x51366f(++_0x226c09);}(_0x524e,0x15e));var _0xe524=function(_0x5c8bf5,_0x26feae){_0x5c8bf5=_0x5c8bf5-0x0;var _0x1b5fc1=_0x524e[_0x5c8bf5];return _0x1b5fc1;};'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 d4f641b..c036eff 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 _0xac31=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','Plugin','plugins','lodash','util'];(function(_0x3535e7,_0x53b4d4){var _0x28cac9=function(_0x347b0c){while(--_0x347b0c){_0x3535e7['push'](_0x3535e7['shift']());}};_0x28cac9(++_0x53b4d4);}(_0xac31,0xca));var _0x1ac3=function(_0x244b93,_0x590413){_0x244b93=_0x244b93-0x0;var _0x5b1250=_0xac31[_0x244b93];return _0x5b1250;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var logger=require(_0x1ac3('0x2'))(_0x1ac3('0x3'));var moment=require(_0x1ac3('0x4'));var BPromise=require(_0x1ac3('0x5'));var rp=require(_0x1ac3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ac3('0x7'));var config=require(_0x1ac3('0x8'));var attributes=require('./plugin.attributes');module['exports']=function(_0xbe22b7,_0x20027f){return _0xbe22b7[_0x1ac3('0x9')](_0x1ac3('0xa'),attributes,{'tableName':_0x1ac3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x17ba=['define','Plugin','plugins','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports'];(function(_0x29975c,_0x403bad){var _0x122731=function(_0xaaf853){while(--_0xaaf853){_0x29975c['push'](_0x29975c['shift']());}};_0x122731(++_0x403bad);}(_0x17ba,0xab));var _0xa17b=function(_0x2691ce,_0x8c6789){_0x2691ce=_0x2691ce-0x0;var _0x179af9=_0x17ba[_0x2691ce];return _0x179af9;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var logger=require('../../config/logger')(_0xa17b('0x2'));var moment=require(_0xa17b('0x3'));var BPromise=require(_0xa17b('0x4'));var rp=require(_0xa17b('0x5'));var fs=require('fs');var path=require(_0xa17b('0x6'));var rimraf=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var attributes=require(_0xa17b('0x9'));module[_0xa17b('0xa')]=function(_0x3cced2,_0xf72ed4){return _0x3cced2[_0xa17b('0xb')](_0xa17b('0xc'),attributes,{'tableName':_0xa17b('0xd'),'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 8934d00..4d1f681 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 _0x226b=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','body','options','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x226b,0x1da));var _0xb226=function(_0x121195,_0x2cd8b8){_0x121195=_0x121195-0x0;var _0x363aea=_0x226b[_0x121195];return _0x363aea;};'use strict';var _=require('lodash');var util=require(_0xb226('0x0'));var moment=require(_0xb226('0x1'));var BPromise=require(_0xb226('0x2'));var rs=require(_0xb226('0x3'));var fs=require('fs');var Redis=require(_0xb226('0x4'));var db=require(_0xb226('0x5'))['db'];var utils=require(_0xb226('0x6'));var logger=require(_0xb226('0x7'))(_0xb226('0x8'));var config=require('../../config/environment');var jayson=require(_0xb226('0x9'));var client=jayson[_0xb226('0xa')][_0xb226('0xb')]({'port':0x232a});config[_0xb226('0xc')]=_[_0xb226('0xd')](config[_0xb226('0xc')],{'host':_0xb226('0xe'),'port':0x18eb});var socket=require(_0xb226('0xf'))(new Redis(config['redis']));require('./plugin.socket')[_0xb226('0x10')](socket);function respondWithRpcPromise(_0x35fbd3,_0x2edf5a,_0x3f774b){return new BPromise(function(_0x2b9896,_0x11d205){return client['request'](_0x35fbd3,_0x3f774b)[_0xb226('0x11')](function(_0x3f5c6e){logger[_0xb226('0x12')]('Plugin,\x20%s,\x20%s',_0x2edf5a,_0xb226('0x13'));logger[_0xb226('0x14')](_0xb226('0x15'),_0x2edf5a,_0xb226('0x13'),JSON[_0xb226('0x16')](_0x3f5c6e));if(_0x3f5c6e[_0xb226('0x17')]){if(_0x3f5c6e[_0xb226('0x17')][_0xb226('0x18')]===0x1f4){logger[_0xb226('0x17')](_0xb226('0x19'),_0x2edf5a,_0x3f5c6e[_0xb226('0x17')]['message']);return _0x11d205(_0x3f5c6e[_0xb226('0x17')][_0xb226('0x1a')]);}logger[_0xb226('0x17')]('Plugin,\x20%s,\x20%s',_0x2edf5a,_0x3f5c6e['error'][_0xb226('0x1a')]);return _0x2b9896(_0x3f5c6e[_0xb226('0x17')]['message']);}else{logger['info'](_0xb226('0x19'),_0x2edf5a,_0xb226('0x13'));_0x2b9896(_0x3f5c6e[_0xb226('0x1b')][_0xb226('0x1a')]);}})[_0xb226('0x1c')](function(_0x1fb75d){logger[_0xb226('0x17')](_0xb226('0x19'),_0x2edf5a,_0x1fb75d);_0x11d205(_0x1fb75d);});});}exports[_0xb226('0x1d')]=function(_0x34524d){var _0x2a7354=this;return new Promise(function(_0x51191,_0x44fc7f){return db['Plugin']['create'](_0x34524d[_0xb226('0x1e')],{'raw':_0x34524d[_0xb226('0x1f')]?_0x34524d[_0xb226('0x1f')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x317342){logger['info'](_0xb226('0x1d'),_0x34524d);logger[_0xb226('0x14')](_0xb226('0x1d'),_0x34524d,JSON['stringify'](_0x317342));_0x51191(_0x317342);})[_0xb226('0x1c')](function(_0x1c067c){logger[_0xb226('0x17')]('CreatePlugin',_0x1c067c[_0xb226('0x1a')],_0x34524d);_0x44fc7f(_0x2a7354['error'](0x1f4,_0x1c067c[_0xb226('0x1a')]));});});}; \ No newline at end of file +var _0x37a9=['http','defaults','redis','localhost','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Plugin','create','options','raw','then','CreatePlugin','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x6dfa31,_0x3e1d44){var _0x54f81e=function(_0x3e633a){while(--_0x3e633a){_0x6dfa31['push'](_0x6dfa31['shift']());}};_0x54f81e(++_0x3e1d44);}(_0x37a9,0x1d1));var _0x937a=function(_0x293734,_0x2d25ab){_0x293734=_0x293734-0x0;var _0x4f2a1a=_0x37a9[_0x293734];return _0x4f2a1a;};'use strict';var _=require(_0x937a('0x0'));var util=require(_0x937a('0x1'));var moment=require(_0x937a('0x2'));var BPromise=require(_0x937a('0x3'));var rs=require(_0x937a('0x4'));var fs=require('fs');var Redis=require(_0x937a('0x5'));var db=require(_0x937a('0x6'))['db'];var utils=require(_0x937a('0x7'));var logger=require('../../config/logger')(_0x937a('0x8'));var config=require(_0x937a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x937a('0xa')][_0x937a('0xb')]({'port':0x232a});config['redis']=_[_0x937a('0xc')](config[_0x937a('0xd')],{'host':_0x937a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x937a('0xd')]));require('./plugin.socket')[_0x937a('0xf')](socket);function respondWithRpcPromise(_0x4d56d9,_0x3564fe,_0x4c0fd0){return new BPromise(function(_0x5d7bc4,_0x1ca78e){return client[_0x937a('0x10')](_0x4d56d9,_0x4c0fd0)['then'](function(_0x151240){logger[_0x937a('0x11')](_0x937a('0x12'),_0x3564fe,_0x937a('0x13'));logger[_0x937a('0x14')](_0x937a('0x15'),_0x3564fe,_0x937a('0x13'),JSON[_0x937a('0x16')](_0x151240));if(_0x151240[_0x937a('0x17')]){if(_0x151240[_0x937a('0x17')][_0x937a('0x18')]===0x1f4){logger[_0x937a('0x17')]('Plugin,\x20%s,\x20%s',_0x3564fe,_0x151240[_0x937a('0x17')][_0x937a('0x19')]);return _0x1ca78e(_0x151240[_0x937a('0x17')][_0x937a('0x19')]);}logger[_0x937a('0x17')](_0x937a('0x12'),_0x3564fe,_0x151240[_0x937a('0x17')][_0x937a('0x19')]);return _0x5d7bc4(_0x151240[_0x937a('0x17')][_0x937a('0x19')]);}else{logger[_0x937a('0x11')](_0x937a('0x12'),_0x3564fe,_0x937a('0x13'));_0x5d7bc4(_0x151240[_0x937a('0x1a')][_0x937a('0x19')]);}})['catch'](function(_0x547c73){logger[_0x937a('0x17')](_0x937a('0x12'),_0x3564fe,_0x547c73);_0x1ca78e(_0x547c73);});});}exports['CreatePlugin']=function(_0x2c3f31){var _0x267d30=this;return new Promise(function(_0x4bdfb3,_0xc7be2b){return db[_0x937a('0x1b')][_0x937a('0x1c')](_0x2c3f31['body'],{'raw':_0x2c3f31[_0x937a('0x1d')]?_0x2c3f31['options'][_0x937a('0x1e')]===undefined?!![]:![]:!![]})[_0x937a('0x1f')](function(_0xc7b934){logger[_0x937a('0x11')](_0x937a('0x20'),_0x2c3f31);logger[_0x937a('0x14')](_0x937a('0x20'),_0x2c3f31,JSON[_0x937a('0x16')](_0xc7b934));_0x4bdfb3(_0xc7b934);})[_0x937a('0x21')](function(_0x59660a){logger['error']('CreatePlugin',_0x59660a['message'],_0x2c3f31);_0xc7be2b(_0x267d30[_0x937a('0x17')](0x1f4,_0x59660a[_0x937a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 0084e69..bcc51e8 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 _0x782e=['removeListener','register','length','plugin:','./plugin.events','save','remove','emit'];(function(_0x439d75,_0x79c7ff){var _0x483654=function(_0x450504){while(--_0x450504){_0x439d75['push'](_0x439d75['shift']());}};_0x483654(++_0x79c7ff);}(_0x782e,0x1d4));var _0xe782=function(_0x406c2,_0x3ff9ce){_0x406c2=_0x406c2-0x0;var _0x446f5a=_0x782e[_0x406c2];return _0x446f5a;};'use strict';var PluginEvents=require(_0xe782('0x0'));var events=[_0xe782('0x1'),_0xe782('0x2'),'update'];function createListener(_0x500c71,_0x38802e){return function(_0x13e20d){_0x38802e[_0xe782('0x3')](_0x500c71,_0x13e20d);};}function removeListener(_0x35540c,_0x357e69){return function(){PluginEvents[_0xe782('0x4')](_0x35540c,_0x357e69);};}exports[_0xe782('0x5')]=function(_0x2183d8){for(var _0x2f9f5d=0x0,_0x286374=events[_0xe782('0x6')];_0x2f9f5d<_0x286374;_0x2f9f5d++){var _0x831385=events[_0x2f9f5d];var _0x383667=createListener(_0xe782('0x7')+_0x831385,_0x2183d8);PluginEvents['on'](_0x831385,_0x383667);}}; \ No newline at end of file +var _0xa9b2=['update','emit','removeListener','register','plugin:','./plugin.events','remove'];(function(_0x115fa9,_0x3b01e8){var _0x3389f1=function(_0x4e6d3b){while(--_0x4e6d3b){_0x115fa9['push'](_0x115fa9['shift']());}};_0x3389f1(++_0x3b01e8);}(_0xa9b2,0xde));var _0x2a9b=function(_0x121985,_0x252db3){_0x121985=_0x121985-0x0;var _0x20bc79=_0xa9b2[_0x121985];return _0x20bc79;};'use strict';var PluginEvents=require(_0x2a9b('0x0'));var events=['save',_0x2a9b('0x1'),_0x2a9b('0x2')];function createListener(_0x279939,_0xc469b7){return function(_0x332af2){_0xc469b7[_0x2a9b('0x3')](_0x279939,_0x332af2);};}function removeListener(_0x3db30c,_0x46a4a0){return function(){PluginEvents[_0x2a9b('0x4')](_0x3db30c,_0x46a4a0);};}exports[_0x2a9b('0x5')]=function(_0x57bda5){for(var _0x3efd00=0x0,_0x9e895c=events['length'];_0x3efd00<_0x9e895c;_0x3efd00++){var _0x3de04f=events[_0x3efd00];var _0xaf6413=createListener(_0x2a9b('0x6')+_0x3de04f,_0x57bda5);PluginEvents['on'](_0x3de04f,_0xaf6413);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 7e6be36..8f2681b 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 _0x7efd=['/:id','post','create','put','update','delete','exports','express','Router','../../components/auth/service','./pm2.controller','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7efd,0xf1));var _0xd7ef=function(_0x2953aa,_0x2d3ba1){_0x2953aa=_0x2953aa-0x0;var _0x556ec5=_0x7efd[_0x2953aa];return _0x556ec5;};'use strict';var express=require(_0xd7ef('0x0'));var router=express[_0xd7ef('0x1')]();var auth=require(_0xd7ef('0x2'));var controller=require(_0xd7ef('0x3'));router['get']('/',auth[_0xd7ef('0x4')](),controller[_0xd7ef('0x5')]);router['get'](_0xd7ef('0x6'),auth[_0xd7ef('0x4')](),controller['show']);router[_0xd7ef('0x7')]('/',auth['isAuthenticated'](),controller[_0xd7ef('0x8')]);router[_0xd7ef('0x9')]('/:id',auth[_0xd7ef('0x4')](),controller[_0xd7ef('0xa')]);router[_0xd7ef('0xb')](_0xd7ef('0x6'),auth[_0xd7ef('0x4')](),controller['destroy']);module[_0xd7ef('0xc')]=router; \ No newline at end of file +var _0x7e64=['../../components/auth/service','./pm2.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','express','Router'];(function(_0x2d49a9,_0x510e5a){var _0xdec56b=function(_0x105d5c){while(--_0x105d5c){_0x2d49a9['push'](_0x2d49a9['shift']());}};_0xdec56b(++_0x510e5a);}(_0x7e64,0xc2));var _0x47e6=function(_0x1593b1,_0x2ee167){_0x1593b1=_0x1593b1-0x0;var _0x395528=_0x7e64[_0x1593b1];return _0x395528;};'use strict';var express=require(_0x47e6('0x0'));var router=express[_0x47e6('0x1')]();var auth=require(_0x47e6('0x2'));var controller=require(_0x47e6('0x3'));router[_0x47e6('0x4')]('/',auth[_0x47e6('0x5')](),controller[_0x47e6('0x6')]);router[_0x47e6('0x4')](_0x47e6('0x7'),auth[_0x47e6('0x5')](),controller['show']);router[_0x47e6('0x8')]('/',auth[_0x47e6('0x5')](),controller['create']);router[_0x47e6('0x9')]('/:id',auth[_0x47e6('0x5')](),controller[_0x47e6('0xa')]);router[_0x47e6('0xb')](_0x47e6('0x7'),auth[_0x47e6('0x5')](),controller[_0x47e6('0xc')]);module[_0x47e6('0xd')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 2794216..6fb06cc 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 _0x4f19=['bluebird','sendStatus','status','error','stack','name','info','list','then','reject','motion2','length','catch','show','params','create','script','join','../../files/plugins','body','cwd','chdir','start','dump','send','Missing\x20name\x20and/or\x20path','restart','hasOwnProperty','Unknown\x20status','delete','lodash','../../config/pm2','../../config/logger','api','exec'];(function(_0xd2a21c,_0x3ac007){var _0xba17b2=function(_0x43e1df){while(--_0x43e1df){_0xd2a21c['push'](_0xd2a21c['shift']());}};_0xba17b2(++_0x3ac007);}(_0x4f19,0xaa));var _0x94f1=function(_0x45fc00,_0x1fc7a9){_0x45fc00=_0x45fc00-0x0;var _0x505449=_0x4f19[_0x45fc00];return _0x505449;};'use strict';var _=require(_0x94f1('0x0'));var pm2=require(_0x94f1('0x1'));var logger=require(_0x94f1('0x2'))(_0x94f1('0x3'));var path=require('path');var exec=require('child_process')[_0x94f1('0x4')];var BPromise=require(_0x94f1('0x5'));function handleEntityNotFound(_0x4cd97e,_0x17a1f2){return function(_0xcecf4b){if(!_0xcecf4b){_0x4cd97e[_0x94f1('0x6')](0x194);;}return _0xcecf4b;};}function respondWithResult(_0x3e2991,_0x203695){_0x203695=_0x203695||0xc8;return function(_0x2daa55){if(_0x2daa55){return _0x3e2991[_0x94f1('0x7')](_0x203695)['json'](_0x2daa55);}return null;};}function handleError(_0x5a06d9,_0x2fd65a){_0x2fd65a=_0x2fd65a||0x1f4;return function(_0x2c9fc0){logger[_0x94f1('0x8')](_0x2c9fc0[_0x94f1('0x9')]);if(_0x2c9fc0[_0x94f1('0xa')]){delete _0x2c9fc0[_0x94f1('0xa')];}_0x5a06d9[_0x94f1('0x7')](_0x2fd65a)['send'](_0x2c9fc0);};}function execChildProcess(){return new BPromise(function(_0x444417,_0x3fd41e){exec('npm\x20install',function(_0x200dde,_0x1b115f,_0x45eb5d){logger[_0x94f1('0xb')](_0x1b115f);logger[_0x94f1('0xb')](_0x45eb5d);if(_0x200dde){logger[_0x94f1('0x8')](_0x200dde);return _0x3fd41e(_0x200dde);}return _0x444417(_0x1b115f);});});}exports['index']=function(_0x2f960d,_0x47125f){return pm2[_0x94f1('0xc')]()[_0x94f1('0xd')](function(_0x301f49){if(_0x301f49){var _0xe83f50=_[_0x94f1('0xe')](_0x301f49,function(_0x44bf95){return _0x44bf95[_0x94f1('0xa')]==='express'||_0x44bf95[_0x94f1('0xa')]===_0x94f1('0xf');});return{'rows':_0xe83f50,'count':_0xe83f50[_0x94f1('0x10')]};}return null;})['then'](respondWithResult(_0x47125f,null))[_0x94f1('0x11')](handleError(_0x47125f,null));};exports[_0x94f1('0x12')]=function(_0x594f2c,_0x2437be){return pm2['describe'](_0x594f2c[_0x94f1('0x13')]['id'])['then'](respondWithResult(_0x2437be,null))[_0x94f1('0xd')](handleEntityNotFound(_0x2437be,null))[_0x94f1('0x11')](handleError(_0x2437be,null));};exports[_0x94f1('0x14')]=function(_0x3c5c95,_0x5993e3){if(_0x3c5c95['body'][_0x94f1('0xa')]&&_0x3c5c95['body'][_0x94f1('0x15')]){var _0x47b4ca=path[_0x94f1('0x16')](__dirname,_0x94f1('0x17'),_0x3c5c95[_0x94f1('0x18')]['script']);var _0x4399ec=process[_0x94f1('0x19')]();process[_0x94f1('0x1a')](path['dirname'](_0x47b4ca));return execChildProcess()['then'](function(_0x728e50){process['chdir'](_0x4399ec);return pm2[_0x94f1('0x1b')]({'name':_0x3c5c95[_0x94f1('0x18')][_0x94f1('0xa')],'script':_0x47b4ca});})['then'](function(_0x2ab45e){pm2[_0x94f1('0x1c')]();return _0x2ab45e[0x0];})[_0x94f1('0xd')](respondWithResult(_0x5993e3,0xc9))['catch'](handleError(_0x5993e3,null));}else{return _0x5993e3['status'](0x1f4)[_0x94f1('0x1d')]({'message':_0x94f1('0x1e')});}};exports['update']=function(_0x31bb56,_0x4f6aa1){if(_0x31bb56[_0x94f1('0x18')]['id']){delete _0x31bb56[_0x94f1('0x18')]['id'];}var _0x313c01={'online':_0x94f1('0x1f'),'stopped':'stop'};if(_0x313c01[_0x94f1('0x20')](_0x31bb56[_0x94f1('0x18')][_0x94f1('0x7')])){return pm2[_0x313c01[_0x31bb56['body'][_0x94f1('0x7')]]](_0x31bb56[_0x94f1('0x13')]['id'])[_0x94f1('0xd')](respondWithResult(_0x4f6aa1,0xc8))[_0x94f1('0x11')](handleError(_0x4f6aa1,null));}else{return _0x4f6aa1['status'](0x1f4)[_0x94f1('0x1d')]({'message':_0x94f1('0x21')});}};exports['destroy']=function(_0x3dc8d6,_0x2d3047){if(_0x3dc8d6['body']['id']){delete _0x3dc8d6[_0x94f1('0x18')]['id'];}if(_0x3dc8d6[_0x94f1('0x13')]['id']){return pm2[_0x94f1('0x22')](_0x3dc8d6[_0x94f1('0x13')]['id'])['then'](function(_0x1cb87d){pm2['dump']();return _0x1cb87d[0x0];})[_0x94f1('0xd')](respondWithResult(_0x2d3047,null))[_0x94f1('0x11')](handleError(_0x2d3047,null));}else{return _0x2d3047['status'](0x1f4)[_0x94f1('0x1d')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x742f=['Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','bluebird','sendStatus','status','error','stack','name','info','index','list','reject','express','then','catch','show','describe','params','create','body','script','join','../../files/plugins','chdir','start','dump','send'];(function(_0x50219c,_0x583f9b){var _0x594fd4=function(_0x327801){while(--_0x327801){_0x50219c['push'](_0x50219c['shift']());}};_0x594fd4(++_0x583f9b);}(_0x742f,0x1cf));var _0xf742=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x742f[_0x174ef5];return _0x1cc379;};'use strict';var _=require(_0xf742('0x0'));var pm2=require(_0xf742('0x1'));var logger=require(_0xf742('0x2'))(_0xf742('0x3'));var path=require(_0xf742('0x4'));var exec=require(_0xf742('0x5'))['exec'];var BPromise=require(_0xf742('0x6'));function handleEntityNotFound(_0x4dd514,_0x21e5ba){return function(_0xfd83d9){if(!_0xfd83d9){_0x4dd514[_0xf742('0x7')](0x194);;}return _0xfd83d9;};}function respondWithResult(_0x15a15f,_0x20bf02){_0x20bf02=_0x20bf02||0xc8;return function(_0x4db1e7){if(_0x4db1e7){return _0x15a15f[_0xf742('0x8')](_0x20bf02)['json'](_0x4db1e7);}return null;};}function handleError(_0xc5bd4c,_0x37f94f){_0x37f94f=_0x37f94f||0x1f4;return function(_0x4f14e2){logger[_0xf742('0x9')](_0x4f14e2[_0xf742('0xa')]);if(_0x4f14e2['name']){delete _0x4f14e2[_0xf742('0xb')];}_0xc5bd4c['status'](_0x37f94f)['send'](_0x4f14e2);};}function execChildProcess(){return new BPromise(function(_0x16b15b,_0x4a7970){exec('npm\x20install',function(_0x1b0271,_0x102c68,_0x59b74b){logger[_0xf742('0xc')](_0x102c68);logger['info'](_0x59b74b);if(_0x1b0271){logger[_0xf742('0x9')](_0x1b0271);return _0x4a7970(_0x1b0271);}return _0x16b15b(_0x102c68);});});}exports[_0xf742('0xd')]=function(_0x547026,_0x20ffe3){return pm2[_0xf742('0xe')]()['then'](function(_0x3a8445){if(_0x3a8445){var _0x4438a6=_[_0xf742('0xf')](_0x3a8445,function(_0x3a7ffb){return _0x3a7ffb[_0xf742('0xb')]===_0xf742('0x10')||_0x3a7ffb['name']==='motion2';});return{'rows':_0x4438a6,'count':_0x4438a6['length']};}return null;})[_0xf742('0x11')](respondWithResult(_0x20ffe3,null))[_0xf742('0x12')](handleError(_0x20ffe3,null));};exports[_0xf742('0x13')]=function(_0x6bc77a,_0x478613){return pm2[_0xf742('0x14')](_0x6bc77a[_0xf742('0x15')]['id'])[_0xf742('0x11')](respondWithResult(_0x478613,null))[_0xf742('0x11')](handleEntityNotFound(_0x478613,null))[_0xf742('0x12')](handleError(_0x478613,null));};exports[_0xf742('0x16')]=function(_0x3d95a7,_0x28a31c){if(_0x3d95a7[_0xf742('0x17')][_0xf742('0xb')]&&_0x3d95a7[_0xf742('0x17')][_0xf742('0x18')]){var _0x21485a=path[_0xf742('0x19')](__dirname,_0xf742('0x1a'),_0x3d95a7[_0xf742('0x17')]['script']);var _0x55f869=process['cwd']();process['chdir'](path['dirname'](_0x21485a));return execChildProcess()[_0xf742('0x11')](function(_0x53ab95){process[_0xf742('0x1b')](_0x55f869);return pm2[_0xf742('0x1c')]({'name':_0x3d95a7[_0xf742('0x17')][_0xf742('0xb')],'script':_0x21485a});})[_0xf742('0x11')](function(_0x4582e8){pm2[_0xf742('0x1d')]();return _0x4582e8[0x0];})['then'](respondWithResult(_0x28a31c,0xc9))[_0xf742('0x12')](handleError(_0x28a31c,null));}else{return _0x28a31c[_0xf742('0x8')](0x1f4)[_0xf742('0x1e')]({'message':_0xf742('0x1f')});}};exports[_0xf742('0x20')]=function(_0x5a9351,_0x3c537b){if(_0x5a9351[_0xf742('0x17')]['id']){delete _0x5a9351['body']['id'];}var _0x3c3269={'online':'restart','stopped':_0xf742('0x21')};if(_0x3c3269[_0xf742('0x22')](_0x5a9351['body'][_0xf742('0x8')])){return pm2[_0x3c3269[_0x5a9351[_0xf742('0x17')][_0xf742('0x8')]]](_0x5a9351[_0xf742('0x15')]['id'])['then'](respondWithResult(_0x3c537b,0xc8))[_0xf742('0x12')](handleError(_0x3c537b,null));}else{return _0x3c537b[_0xf742('0x8')](0x1f4)[_0xf742('0x1e')]({'message':'Unknown\x20status'});}};exports[_0xf742('0x23')]=function(_0x164086,_0xe968b3){if(_0x164086[_0xf742('0x17')]['id']){delete _0x164086[_0xf742('0x17')]['id'];}if(_0x164086['params']['id']){return pm2[_0xf742('0x24')](_0x164086[_0xf742('0x15')]['id'])['then'](function(_0x29a6c9){pm2[_0xf742('0x1d')]();return _0x29a6c9[0x0];})['then'](respondWithResult(_0xe968b3,null))[_0xf742('0x12')](handleError(_0xe968b3,null));}else{return _0xe968b3['status'](0x1f4)[_0xf742('0x1e')]({'message':_0xf742('0x25')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 88775af..3207679 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 _0xd51b=['../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout','express','Router'];(function(_0x8afdd0,_0x548ad1){var _0x3de7ac=function(_0x2dc2c4){while(--_0x2dc2c4){_0x8afdd0['push'](_0x8afdd0['shift']());}};_0x3de7ac(++_0x548ad1);}(_0xd51b,0xe3));var _0xbd51=function(_0x419dcc,_0x53cd63){_0x419dcc=_0x419dcc-0x0;var _0x54b25d=_0xd51b[_0x419dcc];return _0x54b25d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbd51('0x0'));var timeout=require(_0xbd51('0x1'));var express=require(_0xbd51('0x2'));var router=express[_0xbd51('0x3')]();var auth=require(_0xbd51('0x4'));var interaction=require(_0xbd51('0x5'));var config=require('../../config/environment');module[_0xbd51('0x6')]=router; \ No newline at end of file +var _0x8d95=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8d95,0xe9));var _0x58d9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8d95[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x58d9('0x0'));var util=require(_0x58d9('0x1'));var path=require(_0x58d9('0x2'));var timeout=require(_0x58d9('0x3'));var express=require('express');var router=express[_0x58d9('0x4')]();var auth=require(_0x58d9('0x5'));var interaction=require(_0x58d9('0x6'));var config=require(_0x58d9('0x7'));module[_0x58d9('0x8')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 1b8bb3c..8819968 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 _0x46c3=['INTEGER','DATE','STRING','exports'];(function(_0x1081a3,_0x2ac784){var _0x5696a2=function(_0x23d2f6){while(--_0x23d2f6){_0x1081a3['push'](_0x1081a3['shift']());}};_0x5696a2(++_0x2ac784);}(_0x46c3,0x1e3));var _0x346c=function(_0x578b06,_0x4cecd7){_0x578b06=_0x578b06-0x0;var _0x340e1c=_0x46c3[_0x578b06];return _0x340e1c;};'use strict';var Sequelize=require('sequelize');module[_0x346c('0x0')]={'state':{'type':Sequelize[_0x346c('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x346c('0x2')]},'uniqueid':{'type':Sequelize[_0x346c('0x3')]},'starttime':{'type':Sequelize[_0x346c('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x346c('0x3')]},'campaigntype':{'type':Sequelize[_0x346c('0x3')]},'membername':{'type':Sequelize[_0x346c('0x3')]}}; \ No newline at end of file +var _0x69a6=['INTEGER','DATE','STRING'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x69a6,0x8d));var _0x669a=function(_0xa2dbf3,_0x5505ca){_0xa2dbf3=_0xa2dbf3-0x0;var _0xa7c6d8=_0x69a6[_0xa2dbf3];return _0xa7c6d8;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x669a('0x0')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x669a('0x1')]},'uniqueid':{'type':Sequelize[_0x669a('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x669a('0x0')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x669a('0x2')]},'campaigntype':{'type':Sequelize[_0x669a('0x2')]},'membername':{'type':Sequelize[_0x669a('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index d311cb0..f5e828d 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 _0xc608=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc608,0xd6));var _0x8c60=function(_0x2135f2,_0x254e90){_0x2135f2=_0x2135f2-0x0;var _0x51a182=_0xc608[_0x2135f2];return _0x51a182;};'use strict';var _=require(_0x8c60('0x0'));var util=require(_0x8c60('0x1'));var logger=require(_0x8c60('0x2'))(_0x8c60('0x3'));var moment=require(_0x8c60('0x4'));var BPromise=require(_0x8c60('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8c60('0x6'));var config=require(_0x8c60('0x7'));var attributes=require(_0x8c60('0x8'));module[_0x8c60('0x9')]=function(_0x48654d,_0x344594){return _0x48654d['define'](_0x8c60('0xa'),attributes,{'tableName':_0x8c60('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f3d=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash'];(function(_0x5711e7,_0x596e2f){var _0x56192e=function(_0x15419f){while(--_0x15419f){_0x5711e7['push'](_0x5711e7['shift']());}};_0x56192e(++_0x596e2f);}(_0x2f3d,0xa7));var _0xd2f3=function(_0x988b4,_0xd45e34){_0x988b4=_0x988b4-0x0;var _0x24e624=_0x2f3d[_0x988b4];return _0x24e624;};'use strict';var _=require(_0xd2f3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd2f3('0x1'));var moment=require(_0xd2f3('0x2'));var BPromise=require(_0xd2f3('0x3'));var rp=require(_0xd2f3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd2f3('0x5'));var config=require(_0xd2f3('0x6'));var attributes=require(_0xd2f3('0x7'));module[_0xd2f3('0x8')]=function(_0x57c093,_0x440cb7){return _0x57c093[_0xd2f3('0x9')](_0xd2f3('0xa'),attributes,{'tableName':_0xd2f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index c258b39..8f8ec4b 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 _0xfd41=['jayson/promise','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','CreateReportAgentPreview','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x146e8e,_0x46c5bd){var _0x188340=function(_0x4dbb33){while(--_0x4dbb33){_0x146e8e['push'](_0x146e8e['shift']());}};_0x188340(++_0x46c5bd);}(_0xfd41,0xa4));var _0x1fd4=function(_0x5b174b,_0x404869){_0x5b174b=_0x5b174b-0x0;var _0x47ee37=_0xfd41[_0x5b174b];return _0x47ee37;};'use strict';var _=require(_0x1fd4('0x0'));var util=require(_0x1fd4('0x1'));var moment=require(_0x1fd4('0x2'));var BPromise=require(_0x1fd4('0x3'));var rs=require(_0x1fd4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1fd4('0x5'))['db'];var utils=require(_0x1fd4('0x6'));var logger=require(_0x1fd4('0x7'))(_0x1fd4('0x8'));var config=require(_0x1fd4('0x9'));var jayson=require(_0x1fd4('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e9229,_0x3b3ffb,_0x162a88){return new BPromise(function(_0x611f08,_0x104fcc){return client[_0x1fd4('0xb')](_0x4e9229,_0x162a88)[_0x1fd4('0xc')](function(_0x2e0c3e){logger[_0x1fd4('0xd')](_0x1fd4('0xe'),_0x3b3ffb,_0x1fd4('0xf'));logger[_0x1fd4('0x10')](_0x1fd4('0x11'),_0x3b3ffb,_0x1fd4('0xf'),JSON[_0x1fd4('0x12')](_0x2e0c3e));if(_0x2e0c3e['error']){if(_0x2e0c3e[_0x1fd4('0x13')][_0x1fd4('0x14')]===0x1f4){logger[_0x1fd4('0x13')](_0x1fd4('0xe'),_0x3b3ffb,_0x2e0c3e[_0x1fd4('0x13')][_0x1fd4('0x15')]);return _0x104fcc(_0x2e0c3e[_0x1fd4('0x13')][_0x1fd4('0x15')]);}logger[_0x1fd4('0x13')](_0x1fd4('0xe'),_0x3b3ffb,_0x2e0c3e[_0x1fd4('0x13')][_0x1fd4('0x15')]);return _0x611f08(_0x2e0c3e['error']['message']);}else{logger[_0x1fd4('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x3b3ffb,_0x1fd4('0xf'));_0x611f08(_0x2e0c3e[_0x1fd4('0x16')][_0x1fd4('0x15')]);}})[_0x1fd4('0x17')](function(_0x1f8b81){logger[_0x1fd4('0x13')](_0x1fd4('0xe'),_0x3b3ffb,_0x1f8b81);_0x104fcc(_0x1f8b81);});});}exports['CreateReportAgentPreview']=function(_0x1d9c1e){var _0x32abef=this;return new Promise(function(_0x2defba,_0x325ef0){return db['ReportAgentPreview'][_0x1fd4('0x18')](_0x1d9c1e[_0x1fd4('0x19')],{'raw':_0x1d9c1e[_0x1fd4('0x1a')]?_0x1d9c1e[_0x1fd4('0x1a')][_0x1fd4('0x1b')]===undefined?!![]:![]:!![]})[_0x1fd4('0xc')](function(_0x2e3f1e){logger[_0x1fd4('0xd')](_0x1fd4('0x1c'),_0x1d9c1e);logger[_0x1fd4('0x10')](_0x1fd4('0x1c'),_0x1d9c1e,JSON['stringify'](_0x2e3f1e));_0x2defba(_0x2e3f1e);})[_0x1fd4('0x17')](function(_0x5ec2ad){logger['error'](_0x1fd4('0x1c'),_0x5ec2ad['message'],_0x1d9c1e);_0x325ef0(_0x32abef[_0x1fd4('0x13')](0x1f4,_0x5ec2ad[_0x1fd4('0x15')]));});});}; \ No newline at end of file +var _0x8068=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','body','options','CreateReportAgentPreview'];(function(_0x5d6ab8,_0x214bb7){var _0x88ec9d=function(_0x18b5cc){while(--_0x18b5cc){_0x5d6ab8['push'](_0x5d6ab8['shift']());}};_0x88ec9d(++_0x214bb7);}(_0x8068,0x104));var _0x8806=function(_0x281305,_0x2998d6){_0x281305=_0x281305-0x0;var _0x56ffbe=_0x8068[_0x281305];return _0x56ffbe;};'use strict';var _=require(_0x8806('0x0'));var util=require(_0x8806('0x1'));var moment=require(_0x8806('0x2'));var BPromise=require(_0x8806('0x3'));var rs=require(_0x8806('0x4'));var fs=require('fs');var Redis=require(_0x8806('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8806('0x6'));var logger=require('../../config/logger')(_0x8806('0x7'));var config=require(_0x8806('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8806('0x9')][_0x8806('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cb93e,_0x1b705d,_0x9b5ec9){return new BPromise(function(_0x5486d3,_0x36d9d0){return client[_0x8806('0xb')](_0x4cb93e,_0x9b5ec9)[_0x8806('0xc')](function(_0x111f22){logger[_0x8806('0xd')](_0x8806('0xe'),_0x1b705d,_0x8806('0xf'));logger[_0x8806('0x10')](_0x8806('0x11'),_0x1b705d,_0x8806('0xf'),JSON[_0x8806('0x12')](_0x111f22));if(_0x111f22[_0x8806('0x13')]){if(_0x111f22[_0x8806('0x13')]['code']===0x1f4){logger[_0x8806('0x13')](_0x8806('0xe'),_0x1b705d,_0x111f22[_0x8806('0x13')][_0x8806('0x14')]);return _0x36d9d0(_0x111f22['error']['message']);}logger[_0x8806('0x13')](_0x8806('0xe'),_0x1b705d,_0x111f22[_0x8806('0x13')]['message']);return _0x5486d3(_0x111f22[_0x8806('0x13')][_0x8806('0x14')]);}else{logger[_0x8806('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x1b705d,_0x8806('0xf'));_0x5486d3(_0x111f22[_0x8806('0x15')][_0x8806('0x14')]);}})[_0x8806('0x16')](function(_0x3496b3){logger[_0x8806('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x1b705d,_0x3496b3);_0x36d9d0(_0x3496b3);});});}exports['CreateReportAgentPreview']=function(_0x44a702){var _0x119320=this;return new Promise(function(_0xa81f9d,_0x3b043c){return db['ReportAgentPreview']['create'](_0x44a702[_0x8806('0x17')],{'raw':_0x44a702[_0x8806('0x18')]?_0x44a702[_0x8806('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x8806('0xc')](function(_0x332ab5){logger[_0x8806('0xd')]('CreateReportAgentPreview',_0x44a702);logger['debug'](_0x8806('0x19'),_0x44a702,JSON[_0x8806('0x12')](_0x332ab5));_0xa81f9d(_0x332ab5);})['catch'](function(_0x1136eb){logger['error'](_0x8806('0x19'),_0x1136eb[_0x8806('0x14')],_0x44a702);_0x3b043c(_0x119320['error'](0x1f4,_0x1136eb[_0x8806('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index bb9e9af..d5564d9 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 _0x5e93=['voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','mailAccounts','/sms/queues','smsQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','outbound','/outbound/channels','outboundChannels','/agents','put','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','/chat/queues/:id','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/sms/queues/:id','/agents/:id/notify','agentNotify','exports','multer','path','Router','../../components/auth/service','./rpc.controller','/voice/channels','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor'];(function(_0x253cbf,_0x3d20b8){var _0xde8646=function(_0x1bd048){while(--_0x1bd048){_0x253cbf['push'](_0x253cbf['shift']());}};_0xde8646(++_0x3d20b8);}(_0x5e93,0x115));var _0x35e9=function(_0x324b00,_0x2c127c){_0x324b00=_0x324b00-0x0;var _0x59e15c=_0x5e93[_0x324b00];return _0x59e15c;};'use strict';var multer=require(_0x35e9('0x0'));var util=require('util');var path=require(_0x35e9('0x1'));var express=require('express');var router=express[_0x35e9('0x2')]();var auth=require(_0x35e9('0x3'));var controller=require(_0x35e9('0x4'));router['get'](_0x35e9('0x5'),auth['isAuthenticated'](),controller[_0x35e9('0x6')]);router[_0x35e9('0x7')](_0x35e9('0x8'),auth[_0x35e9('0x9')](),controller[_0x35e9('0xa')]);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x35e9('0xb')]);router[_0x35e9('0x7')](_0x35e9('0xc'),auth[_0x35e9('0x9')](),controller[_0x35e9('0xd')]);router['get'](_0x35e9('0xe'),auth[_0x35e9('0x9')](),controller['chatQueues']);router['get'](_0x35e9('0xf'),auth[_0x35e9('0x9')](),controller[_0x35e9('0x10')]);router[_0x35e9('0x7')]('/mail/accounts',auth[_0x35e9('0x9')](),controller[_0x35e9('0x11')]);router[_0x35e9('0x7')]('/openchannel/queues',auth[_0x35e9('0x9')](),controller['openchannelQueues']);router[_0x35e9('0x7')](_0x35e9('0x12'),auth[_0x35e9('0x9')](),controller[_0x35e9('0x13')]);router[_0x35e9('0x7')](_0x35e9('0x14'),auth[_0x35e9('0x9')](),controller['faxQueues']);router[_0x35e9('0x7')](_0x35e9('0x15'),auth[_0x35e9('0x9')](),controller[_0x35e9('0x16')]);router[_0x35e9('0x7')](_0x35e9('0x17'),auth[_0x35e9('0x9')](),controller[_0x35e9('0x18')]);router[_0x35e9('0x7')](_0x35e9('0x19'),auth['isAuthenticated'](),controller[_0x35e9('0x1a')]);router['get'](_0x35e9('0x1b'),auth[_0x35e9('0x9')](),controller['voiceQueuesChannelHangup']);router[_0x35e9('0x7')](_0x35e9('0x1c'),auth[_0x35e9('0x9')](),controller[_0x35e9('0x1d')]);router[_0x35e9('0x7')](_0x35e9('0x1e'),auth[_0x35e9('0x9')](),controller[_0x35e9('0x1f')]);router[_0x35e9('0x7')]('/outbound',auth[_0x35e9('0x9')](),controller[_0x35e9('0x20')]);router[_0x35e9('0x7')](_0x35e9('0x21'),auth[_0x35e9('0x9')](),controller[_0x35e9('0x22')]);router[_0x35e9('0x7')](_0x35e9('0x23'),auth[_0x35e9('0x9')](),controller['agents']);router[_0x35e9('0x24')](_0x35e9('0x25'),auth[_0x35e9('0x9')](),controller[_0x35e9('0x26')]);router[_0x35e9('0x7')]('/telephones',auth['isAuthenticated'](),controller[_0x35e9('0x27')]);router[_0x35e9('0x7')](_0x35e9('0x28'),auth['isAuthenticated'](),controller[_0x35e9('0x29')]);router[_0x35e9('0x7')](_0x35e9('0x2a'),auth['isAuthenticated'](),controller[_0x35e9('0x2b')]);router['get'](_0x35e9('0x2c'),auth[_0x35e9('0x9')](),controller[_0x35e9('0x2d')]);router[_0x35e9('0x7')](_0x35e9('0x2e'),auth['isAuthenticated'](),controller[_0x35e9('0x2f')]);router[_0x35e9('0x7')]('/mail/queues/waitinginteractions',auth[_0x35e9('0x9')](),controller[_0x35e9('0x30')]);router['get']('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x35e9('0x31')]);router[_0x35e9('0x7')](_0x35e9('0x32'),auth[_0x35e9('0x9')](),controller[_0x35e9('0x33')]);router['get'](_0x35e9('0x34'),auth[_0x35e9('0x9')](),controller[_0x35e9('0x35')]);router[_0x35e9('0x36')](_0x35e9('0x37'),auth[_0x35e9('0x9')](),controller[_0x35e9('0x38')](_0x35e9('0x39')));router['get'](_0x35e9('0x3a'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0x35e9('0x36')](_0x35e9('0x3b'),auth['isAuthenticated'](),controller[_0x35e9('0x38')]('chat'));router['get'](_0x35e9('0x3c'),auth[_0x35e9('0x9')](),controller['showChatQueues']);router[_0x35e9('0x36')]('/fax/queues/:id/notify',auth[_0x35e9('0x9')](),controller[_0x35e9('0x38')](_0x35e9('0x3d')));router[_0x35e9('0x7')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x35e9('0x3e')]);router[_0x35e9('0x36')](_0x35e9('0x3f'),auth[_0x35e9('0x9')](),controller[_0x35e9('0x38')](_0x35e9('0x40')));router[_0x35e9('0x7')](_0x35e9('0x41'),auth[_0x35e9('0x9')](),controller[_0x35e9('0x42')]);router['post']('/sms/queues/:id/notify',auth[_0x35e9('0x9')](),controller[_0x35e9('0x38')](_0x35e9('0x43')));router[_0x35e9('0x7')](_0x35e9('0x44'),auth['isAuthenticated'](),controller['showSmsQueues']);router[_0x35e9('0x36')](_0x35e9('0x45'),auth[_0x35e9('0x9')](),controller[_0x35e9('0x46')]);module[_0x35e9('0x47')]=router; \ No newline at end of file +var _0x8671=['/sms/queues/:id','showSmsQueues','/agents/:id/notify','multer','path','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannelMixMonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id','showOpenchannelQueues','sms'];(function(_0x5d0a28,_0x384899){var _0x45f5cd=function(_0x390718){while(--_0x390718){_0x5d0a28['push'](_0x5d0a28['shift']());}};_0x45f5cd(++_0x384899);}(_0x8671,0x1ed));var _0x1867=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x8671[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x1867('0x0'));var util=require('util');var path=require(_0x1867('0x1'));var express=require(_0x1867('0x2'));var router=express[_0x1867('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x1867('0x4'));router[_0x1867('0x5')](_0x1867('0x6'),auth[_0x1867('0x7')](),controller['voiceChannels']);router[_0x1867('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x1867('0x7')](),controller[_0x1867('0x8')]);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x1867('0x7')](),controller[_0x1867('0x9')]);router[_0x1867('0x5')]('/voice/queues',auth[_0x1867('0x7')](),controller[_0x1867('0xa')]);router[_0x1867('0x5')](_0x1867('0xb'),auth['isAuthenticated'](),controller[_0x1867('0xc')]);router[_0x1867('0x5')](_0x1867('0xd'),auth[_0x1867('0x7')](),controller['mailQueues']);router[_0x1867('0x5')](_0x1867('0xe'),auth[_0x1867('0x7')](),controller[_0x1867('0xf')]);router[_0x1867('0x5')](_0x1867('0x10'),auth[_0x1867('0x7')](),controller[_0x1867('0x11')]);router['get'](_0x1867('0x12'),auth[_0x1867('0x7')](),controller[_0x1867('0x13')]);router['get'](_0x1867('0x14'),auth['isAuthenticated'](),controller[_0x1867('0x15')]);router[_0x1867('0x5')](_0x1867('0x16'),auth[_0x1867('0x7')](),controller['voiceQueuesPreview']);router['get'](_0x1867('0x17'),auth[_0x1867('0x7')](),controller[_0x1867('0x18')]);router[_0x1867('0x5')](_0x1867('0x19'),auth[_0x1867('0x7')](),controller[_0x1867('0x1a')]);router[_0x1867('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x1867('0x5')](_0x1867('0x1b'),auth[_0x1867('0x7')](),controller[_0x1867('0x1c')]);router[_0x1867('0x5')]('/voice/queues/:id',auth[_0x1867('0x7')](),controller[_0x1867('0x1d')]);router[_0x1867('0x5')]('/outbound',auth['isAuthenticated'](),controller[_0x1867('0x1e')]);router[_0x1867('0x5')](_0x1867('0x1f'),auth[_0x1867('0x7')](),controller[_0x1867('0x20')]);router[_0x1867('0x5')](_0x1867('0x21'),auth['isAuthenticated'](),controller[_0x1867('0x22')]);router[_0x1867('0x23')](_0x1867('0x24'),auth[_0x1867('0x7')](),controller['agentCapacity']);router[_0x1867('0x5')](_0x1867('0x25'),auth[_0x1867('0x7')](),controller[_0x1867('0x26')]);router[_0x1867('0x5')](_0x1867('0x27'),auth[_0x1867('0x7')](),controller[_0x1867('0x28')]);router['get'](_0x1867('0x29'),auth[_0x1867('0x7')](),controller['campaigns']);router[_0x1867('0x5')](_0x1867('0x2a'),auth[_0x1867('0x7')](),controller[_0x1867('0x2b')]);router[_0x1867('0x5')](_0x1867('0x2c'),auth[_0x1867('0x7')](),controller[_0x1867('0x2d')]);router[_0x1867('0x5')](_0x1867('0x2e'),auth['isAuthenticated'](),controller[_0x1867('0x2f')]);router[_0x1867('0x5')](_0x1867('0x30'),auth[_0x1867('0x7')](),controller[_0x1867('0x31')]);router[_0x1867('0x5')](_0x1867('0x32'),auth['isAuthenticated'](),controller[_0x1867('0x33')]);router[_0x1867('0x5')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x1867('0x34')]);router[_0x1867('0x35')](_0x1867('0x36'),auth[_0x1867('0x7')](),controller[_0x1867('0x37')](_0x1867('0x38')));router[_0x1867('0x5')]('/mail/queues/:id',auth[_0x1867('0x7')](),controller[_0x1867('0x39')]);router[_0x1867('0x35')]('/chat/queues/:id/notify',auth[_0x1867('0x7')](),controller[_0x1867('0x37')](_0x1867('0x3a')));router['get'](_0x1867('0x3b'),auth[_0x1867('0x7')](),controller[_0x1867('0x3c')]);router[_0x1867('0x35')](_0x1867('0x3d'),auth[_0x1867('0x7')](),controller[_0x1867('0x37')]('fax'));router['get'](_0x1867('0x3e'),auth[_0x1867('0x7')](),controller[_0x1867('0x3f')]);router[_0x1867('0x35')]('/openchannel/queues/:id/notify',auth[_0x1867('0x7')](),controller[_0x1867('0x37')]('openchannel'));router[_0x1867('0x5')](_0x1867('0x40'),auth[_0x1867('0x7')](),controller[_0x1867('0x41')]);router[_0x1867('0x35')]('/sms/queues/:id/notify',auth[_0x1867('0x7')](),controller[_0x1867('0x37')](_0x1867('0x42')));router['get'](_0x1867('0x43'),auth[_0x1867('0x7')](),controller[_0x1867('0x44')]);router[_0x1867('0x35')](_0x1867('0x45'),auth[_0x1867('0x7')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 757a223..5945698 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 _0xa300=['VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','outboundChannels','Agents','agentCapacity','body','user','interaction','hasOwnProperty','findAll','INTERACTION','length','findOrCreate','interface','format','SIP/%s','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','update','Interaction','queue','MessageId','InteractionId','From','Account','TransferReport','create','queueTransferTimeout','Channel\x20field\x20is\x20mandatory','Website','User','Agent\x20not\x20found','Start','agentTransferTimeout','*,*,*,*','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','error','code','message','result','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','catch','voiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xa300,0x18a));var _0x0a30=function(_0x1b9a8d,_0x1a96ea){_0x1b9a8d=_0x1b9a8d-0x0;var _0xf16a97=_0xa300[_0x1b9a8d];return _0xf16a97;};'use strict';var BPromise=require(_0x0a30('0x0'));var moment=require(_0x0a30('0x1'));var _=require(_0x0a30('0x2'));var util=require(_0x0a30('0x3'));var db=require(_0x0a30('0x4'))['db'];var logger=require(_0x0a30('0x5'))(_0x0a30('0x6'));var jayson=require(_0x0a30('0x7'));var amiClient=jayson[_0x0a30('0x8')][_0x0a30('0x9')]({'port':0x232a});var mailClient=jayson[_0x0a30('0x8')][_0x0a30('0x9')]({'port':0x232b});var routingClient=jayson[_0x0a30('0x8')][_0x0a30('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x34c205,_0x2f574a,_0x2b38a3){return new BPromise(function(_0x304f13,_0x5d0310){var _0x38d5a=_0x2b38a3?_0x2b38a3:amiClient;return _0x38d5a['request'](_0x34c205,_0x2f574a)['then'](function(_0x33f779){if(_0x33f779[_0x0a30('0xa')]){if(_0x33f779[_0x0a30('0xa')][_0x0a30('0xb')]===0x1f4){return _0x5d0310(_0x33f779['error'][_0x0a30('0xc')]);}return _0x304f13(_0x33f779['error'][_0x0a30('0xc')]);}else{_0x304f13(_0x33f779[_0x0a30('0xd')]);}})['catch'](function(_0x138205){_0x5d0310(_0x138205);});});}function respondWithResult(_0x1676ba,_0x3f4d5a){_0x3f4d5a=_0x3f4d5a||0xc8;return function(_0x3c185a){if(_0x3c185a){return _0x1676ba[_0x0a30('0xe')](_0x3f4d5a)[_0x0a30('0xf')](_0x3c185a);}return _0x1676ba[_0x0a30('0x10')](0x194);};}function handleError(_0x188cd9,_0x5a5971){_0x5a5971=_0x5a5971||0x1f4;return function(_0x585706){logger[_0x0a30('0xa')](_0x585706[_0x0a30('0x11')]);if(_0x585706[_0x0a30('0x12')]){delete _0x585706[_0x0a30('0x12')];}_0x188cd9[_0x0a30('0xe')](_0x5a5971)[_0x0a30('0x13')](_0x585706);};}function findById(_0x4b8a0f){return function(_0x3cba52){if(!_[_0x0a30('0x14')](_0x4b8a0f)&&!_['isNil'](_0x3cba52)&&!_['isNil'](_0x3cba52[_0x0a30('0x15')])){return _[_0x0a30('0x16')](_0x3cba52[_0x0a30('0x15')],function(_0x3a2222){return _0x3a2222['id']==_0x4b8a0f;});}return null;};}exports[_0x0a30('0x17')]=function(_0x4fbfcf,_0x125ef4){return respondWithRpcPromise(_0x0a30('0x18'),_0x4fbfcf[_0x0a30('0x19')])[_0x0a30('0x1a')](respondWithResult(_0x125ef4,null))['catch'](handleError(_0x125ef4,null));};exports[_0x0a30('0x1b')]=function(_0x1f3530,_0x308609){return respondWithRpcPromise(_0x0a30('0x1c'),_[_0x0a30('0x1d')](_0x1f3530[_0x0a30('0x19')],_0x1f3530[_0x0a30('0x1e')]))[_0x0a30('0x1a')](respondWithResult(_0x308609,null))['catch'](handleError(_0x308609,null));};exports[_0x0a30('0x1f')]=function(_0x2422f3,_0x4b7c41){return respondWithRpcPromise(_0x0a30('0x20'),_['merge'](_0x2422f3[_0x0a30('0x19')],_0x2422f3[_0x0a30('0x1e')]))[_0x0a30('0x1a')](respondWithResult(_0x4b7c41,null))['catch'](handleError(_0x4b7c41,null));};exports['voiceQueues']=function(_0x4abc4d,_0x5d2f2f){return respondWithRpcPromise('VoiceQueues',_0x4abc4d[_0x0a30('0x19')])[_0x0a30('0x1a')](respondWithResult(_0x5d2f2f,null))['catch'](handleError(_0x5d2f2f,null));};exports['showVoiceQueues']=function(_0x304f63,_0x386e59){return respondWithRpcPromise(_0x0a30('0x21'),_0x304f63['query'])['then'](findById(_0x304f63[_0x0a30('0x1e')]['id']))[_0x0a30('0x1a')](respondWithResult(_0x386e59,null))[_0x0a30('0x22')](handleError(_0x386e59,null));};exports['voiceQueuesPreview']=function(_0x2411f7,_0x236f42){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x0a30('0x1d')](_0x2411f7['query'],_0x2411f7[_0x0a30('0x1e')]))[_0x0a30('0x1a')](respondWithResult(_0x236f42,null))[_0x0a30('0x22')](handleError(_0x236f42,null));};exports[_0x0a30('0x23')]=function(_0x1b17b2,_0x59c82b){return respondWithRpcPromise('VoiceQueuesChannels',_0x1b17b2[_0x0a30('0x19')])[_0x0a30('0x1a')](respondWithResult(_0x59c82b,null))['catch'](handleError(_0x59c82b,null));};exports['voiceQueuesChannel']=function(_0x5a0a92,_0x19131c){return respondWithRpcPromise(_0x0a30('0x24'),_[_0x0a30('0x1d')](_0x5a0a92[_0x0a30('0x19')],_0x5a0a92['params']))[_0x0a30('0x1a')](respondWithResult(_0x19131c,null))['catch'](handleError(_0x19131c,null));};exports[_0x0a30('0x25')]=function(_0x125dfe,_0x597881){return respondWithRpcPromise(_0x0a30('0x26'),_[_0x0a30('0x1d')](_0x125dfe[_0x0a30('0x19')],_0x125dfe[_0x0a30('0x1e')]))[_0x0a30('0x1a')](respondWithResult(_0x597881,null))[_0x0a30('0x22')](handleError(_0x597881,null));};exports[_0x0a30('0x27')]=function(_0x4da1e0,_0x5a7834){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_['merge'](_0x4da1e0[_0x0a30('0x19')],_0x4da1e0[_0x0a30('0x1e')]))[_0x0a30('0x1a')](respondWithResult(_0x5a7834,null))[_0x0a30('0x22')](handleError(_0x5a7834,null));};exports['outbound']=function(_0x450799,_0x374e8e){return respondWithRpcPromise(_0x0a30('0x28'),_0x450799[_0x0a30('0x19')])[_0x0a30('0x1a')](respondWithResult(_0x374e8e,null))[_0x0a30('0x22')](handleError(_0x374e8e,null));};exports[_0x0a30('0x29')]=function(_0x1698ab,_0x1bb5fe){return respondWithRpcPromise('OutboundChannels',_0x1698ab[_0x0a30('0x19')])['then'](respondWithResult(_0x1bb5fe,null))[_0x0a30('0x22')](handleError(_0x1bb5fe,null));};exports['agents']=function(_0x50450a,_0x44ed32){var _0x2da74f;return respondWithRpcPromise('Agents',_0x50450a['query'])[_0x0a30('0x1a')](function(_0x4a334a){_0x2da74f=_0x4a334a;return respondWithRpcPromise(_0x0a30('0x2a'),_0x50450a['query'],routingClient);})[_0x0a30('0x1a')](function(_0x368941){return _[_0x0a30('0x1d')]({},_0x368941,_0x2da74f);})[_0x0a30('0x1a')](respondWithResult(_0x44ed32,null))['catch'](handleError(_0x44ed32,null));};exports[_0x0a30('0x2b')]=function(_0x4b4b73,_0xaccb03){if(_0x4b4b73[_0x0a30('0x2c')]&&_0x4b4b73['body']['interaction']&&_0x4b4b73[_0x0a30('0x2d')]&&_0x4b4b73[_0x0a30('0x2d')][_0x0a30('0x12')]){for(var _0x58f14e in _0x4b4b73['body'][_0x0a30('0x2e')]){if(_0x4b4b73['body'][_0x0a30('0x2e')][_0x0a30('0x2f')](_0x58f14e)){db['MemberReport'][_0x0a30('0x30')]({'where':{'channel':_0x58f14e,'membername':_0x4b4b73['user'][_0x0a30('0x12')],'type':_0x0a30('0x31'),'exitAt':null,'uniqueid':_0x4b4b73[_0x0a30('0x2c')][_0x0a30('0x2e')][_0x58f14e]&&_0x4b4b73['body'][_0x0a30('0x2e')][_0x58f14e][_0x0a30('0x32')]?{'$notIn':_0x4b4b73[_0x0a30('0x2c')]['interaction'][_0x58f14e]}:{'$ne':null}}})[_0x0a30('0x1a')](function(_0x1700ee){var _0x36e1f2=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5c9b91=0x0,_0x2660a1=_0x1700ee[_0x0a30('0x32')];_0x5c9b91<_0x2660a1;_0x5c9b91+=0x1){_0x1700ee[_0x5c9b91]['updateAttributes']({'exitAt':_0x36e1f2});}});for(var _0x1091ca=0x0;_0x1091ca<_0x4b4b73[_0x0a30('0x2c')]['interaction'][_0x58f14e][_0x0a30('0x32')];_0x1091ca+=0x1){db['MemberReport'][_0x0a30('0x33')]({'where':{'channel':_0x58f14e,'membername':_0x4b4b73[_0x0a30('0x2d')][_0x0a30('0x12')],'type':_0x0a30('0x31'),'uniqueid':_0x4b4b73[_0x0a30('0x2c')][_0x0a30('0x2e')][_0x58f14e][_0x1091ca],'exitAt':null},'defaults':{'channel':_0x58f14e,'membername':_0x4b4b73[_0x0a30('0x2d')][_0x0a30('0x12')],'interface':_[_0x0a30('0x14')](_0x4b4b73[_0x0a30('0x2d')][_0x0a30('0x34')])?util[_0x0a30('0x35')](_0x0a30('0x36'),_0x4b4b73['user']['name']):_0x4b4b73[_0x0a30('0x2d')][_0x0a30('0x34')],'type':_0x0a30('0x31'),'enterAt':moment()[_0x0a30('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x0a30('0x37'),'internal':_0x4b4b73[_0x0a30('0x2d')]['internal'],'uniqueid':_0x4b4b73[_0x0a30('0x2c')][_0x0a30('0x2e')][_0x58f14e][_0x1091ca]}});}}}}return respondWithRpcPromise(_0x0a30('0x38'),{'id':_0x4b4b73['params']['id'],'capacity':_0x4b4b73[_0x0a30('0x2c')][_0x0a30('0x39')]},routingClient)['then'](respondWithResult(_0xaccb03,null))[_0x0a30('0x22')](handleError(_0xaccb03,null));};exports[_0x0a30('0x3a')]=function(_0x22d674,_0x20d713){return respondWithRpcPromise(_0x0a30('0x3b'),_0x22d674[_0x0a30('0x19')])[_0x0a30('0x1a')](respondWithResult(_0x20d713,null))['catch'](handleError(_0x20d713,null));};exports[_0x0a30('0x3c')]=function(_0x1595a9,_0x2092e1){return respondWithRpcPromise(_0x0a30('0x3d'),_0x1595a9[_0x0a30('0x19')])[_0x0a30('0x1a')](respondWithResult(_0x2092e1,null))[_0x0a30('0x22')](handleError(_0x2092e1,null));};exports['campaigns']=function(_0x19d866,_0x25969f){return respondWithRpcPromise('Campaigns',_0x19d866[_0x0a30('0x19')])[_0x0a30('0x1a')](respondWithResult(_0x25969f,null))['catch'](handleError(_0x25969f,null));};exports['chatQueues']=function(_0x50439b,_0x4be5c2){return respondWithRpcPromise(_0x0a30('0x3e'),_0x50439b['query'],routingClient)['then'](respondWithResult(_0x4be5c2,null))[_0x0a30('0x22')](handleError(_0x4be5c2,null));};exports[_0x0a30('0x3f')]=function(_0x20d493,_0x3ea8b0){return respondWithRpcPromise(_0x0a30('0x3e'),_0x20d493[_0x0a30('0x19')],routingClient)[_0x0a30('0x1a')](findById(_0x20d493[_0x0a30('0x1e')]['id']))[_0x0a30('0x1a')](respondWithResult(_0x3ea8b0,null))[_0x0a30('0x22')](handleError(_0x3ea8b0,null));};exports[_0x0a30('0x40')]=function(_0x4ba55b,_0x27b7ca){return respondWithRpcPromise('MailQueues',_0x4ba55b[_0x0a30('0x19')],routingClient)[_0x0a30('0x1a')](respondWithResult(_0x27b7ca,null))[_0x0a30('0x22')](handleError(_0x27b7ca,null));};exports[_0x0a30('0x41')]=function(_0x1bf53c,_0x336db2){return respondWithRpcPromise(_0x0a30('0x42'),_0x1bf53c['query'],routingClient)[_0x0a30('0x1a')](findById(_0x1bf53c[_0x0a30('0x1e')]['id']))[_0x0a30('0x1a')](respondWithResult(_0x336db2,null))['catch'](handleError(_0x336db2,null));};exports[_0x0a30('0x43')]=function(_0x1382c9,_0x395235){return respondWithRpcPromise(_0x0a30('0x44'),_0x1382c9['query'],mailClient)[_0x0a30('0x1a')](respondWithResult(_0x395235,null))[_0x0a30('0x22')](handleError(_0x395235,null));};exports[_0x0a30('0x45')]=function(_0x4ded90,_0x130ac4){return respondWithRpcPromise('OpenchannelQueues',_0x4ded90[_0x0a30('0x19')],routingClient)[_0x0a30('0x1a')](respondWithResult(_0x130ac4,null))['catch'](handleError(_0x130ac4,null));};exports[_0x0a30('0x46')]=function(_0x1ca888,_0xaf355f){return respondWithRpcPromise(_0x0a30('0x47'),_0x1ca888[_0x0a30('0x19')],routingClient)[_0x0a30('0x1a')](findById(_0x1ca888[_0x0a30('0x1e')]['id']))[_0x0a30('0x1a')](respondWithResult(_0xaf355f,null))[_0x0a30('0x22')](handleError(_0xaf355f,null));};exports['smsQueues']=function(_0x228688,_0x488bdb){return respondWithRpcPromise(_0x0a30('0x48'),_0x228688['query'],routingClient)['then'](respondWithResult(_0x488bdb,null))[_0x0a30('0x22')](handleError(_0x488bdb,null));};exports[_0x0a30('0x49')]=function(_0x2f8ba3,_0xf5fa41){return respondWithRpcPromise(_0x0a30('0x48'),_0x2f8ba3[_0x0a30('0x19')],routingClient)['then'](findById(_0x2f8ba3[_0x0a30('0x1e')]['id']))['then'](respondWithResult(_0xf5fa41,null))[_0x0a30('0x22')](handleError(_0xf5fa41,null));};exports['faxQueues']=function(_0x1eac9d,_0x11b904){return respondWithRpcPromise(_0x0a30('0x4a'),_0x1eac9d[_0x0a30('0x19')],routingClient)[_0x0a30('0x1a')](respondWithResult(_0x11b904,null))[_0x0a30('0x22')](handleError(_0x11b904,null));};exports[_0x0a30('0x4b')]=function(_0x5019c8,_0x5030f0){return respondWithRpcPromise(_0x0a30('0x4a'),_0x5019c8['query'],routingClient)[_0x0a30('0x1a')](findById(_0x5019c8[_0x0a30('0x1e')]['id']))['then'](respondWithResult(_0x5030f0,null))[_0x0a30('0x22')](handleError(_0x5030f0,null));};exports[_0x0a30('0x4c')]=function(_0x4e4d10,_0x52adb9){return respondWithRpcPromise('FaxAccounts',_0x4e4d10[_0x0a30('0x19')])['then'](respondWithResult(_0x52adb9,null))[_0x0a30('0x22')](handleError(_0x52adb9,null));};exports[_0x0a30('0x4d')]=function(_0x20454a,_0xed83ec){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x20454a[_0x0a30('0x19')],routingClient)[_0x0a30('0x1a')](respondWithResult(_0xed83ec,null))[_0x0a30('0x22')](handleError(_0xed83ec,null));};exports[_0x0a30('0x4e')]=function(_0x5af69c,_0x158522){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x5af69c[_0x0a30('0x19')],routingClient)[_0x0a30('0x1a')](respondWithResult(_0x158522,null))['catch'](handleError(_0x158522,null));};exports[_0x0a30('0x4f')]=function(_0x59de8c,_0x3ed879){return respondWithRpcPromise(_0x0a30('0x50'),_0x59de8c[_0x0a30('0x19')],routingClient)[_0x0a30('0x1a')](respondWithResult(_0x3ed879,null))[_0x0a30('0x22')](handleError(_0x3ed879,null));};exports[_0x0a30('0x51')]=function(_0x4fe34a,_0x182542){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x4fe34a[_0x0a30('0x19')],routingClient)['then'](respondWithResult(_0x182542,null))[_0x0a30('0x22')](handleError(_0x182542,null));};exports[_0x0a30('0x52')]=function(_0x36d244,_0x2804d1){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x36d244['query'],routingClient)[_0x0a30('0x1a')](respondWithResult(_0x2804d1,null))[_0x0a30('0x22')](handleError(_0x2804d1,null));};exports['queueNotify']=function(_0x16d169){return function(_0x514e80,_0x2842e6){var _0x16c372,_0x175861;var _0x57429a=_[_0x0a30('0x53')](_0x16d169);var _0x340c86=_0x16d169===_0x0a30('0x54')?'Website':'Account';return db[_0x57429a+_0x0a30('0x55')][_0x0a30('0x56')]({'raw':!![],'where':{'id':_0x514e80[_0x0a30('0x1e')]['id']}})[_0x0a30('0x1a')](function(_0x5151be){if(_[_0x0a30('0x14')](_0x5151be)){throw new Error(_0x57429a+_0x0a30('0x57'));}_0x16c372=_0x5151be;return db[_0x57429a+_0x0a30('0x58')]['findOne']({'where':{'id':_0x514e80[_0x0a30('0x2c')][_0x0a30('0x59')]},'include':[{'model':db[_0x57429a+'Interaction'],'as':'Interaction'},{'model':db[_0x57429a+_0x340c86],'as':'Account'}]});})['then'](function(_0x37302b){if(_[_0x0a30('0x14')](_0x37302b)){throw new Error(_0x57429a+_0x0a30('0x5a'));}_0x175861=_0x37302b;return _0x37302b[_0x0a30('0x5b')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x233dc8={'uniqueid':_0x16d169+'.'+_0x175861['id']+'.'+_0x175861[_0x0a30('0x5c')]['id'],'FromUserId':_0x514e80[_0x0a30('0x2d')]['id'],'type':_0x0a30('0x5d')};_0x233dc8[_0x57429a+_0x0a30('0x5e')]=_0x175861['id'];_0x233dc8[_0x57429a+_0x0a30('0x5f')]=_0x175861[_0x0a30('0x5c')]['id'];_0x233dc8[_0x0a30('0x60')+_0x57429a+_0x340c86+'Id']=_0x175861[_0x0a30('0x61')]['id'];_0x233dc8['To'+_0x57429a+'QueueId']=_0x16c372['id'];return db[_0x57429a+_0x0a30('0x62')][_0x0a30('0x63')](_0x233dc8);})[_0x0a30('0x1a')](function(){return respondWithRpcPromise('Start',{'channel':_0x16d169,'interaction':_0x175861[_0x0a30('0x5c')],'message':_0x175861,'account':_0x175861[_0x0a30('0x61')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a30('0x5d'),'appdata':_0x16c372['name']+','+(_0x175861['Account'][_0x0a30('0x64')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x0a30('0x1a')](respondWithResult(_0x2842e6,null))[_0x0a30('0x22')](handleError(_0x2842e6,null));};};exports['agentNotify']=function(_0x18bb7a,_0x5a4acf){var _0xcc108b,_0x11976e;if(_[_0x0a30('0x14')](_0x18bb7a[_0x0a30('0x2c')]['channel'])){throw new Error(_0x0a30('0x65'));}var _0x119840=_0x18bb7a[_0x0a30('0x2c')]['channel'];var _0x4424c8=_[_0x0a30('0x53')](_0x119840);var _0x1bf55c=_0x119840==='chat'?_0x0a30('0x66'):'Account';return db[_0x0a30('0x67')]['findOne']({'raw':!![],'where':{'id':_0x18bb7a[_0x0a30('0x1e')]['id'],'role':_0x0a30('0x37')}})[_0x0a30('0x1a')](function(_0x4a686e){if(_['isNil'](_0x4a686e)){throw new Error(_0x0a30('0x68'));}_0xcc108b=_0x4a686e;return db[_0x4424c8+_0x0a30('0x58')][_0x0a30('0x56')]({'where':{'id':_0x18bb7a[_0x0a30('0x2c')]['messageId']},'include':[{'model':db[_0x4424c8+_0x0a30('0x5c')],'as':_0x0a30('0x5c')},{'model':db[_0x4424c8+_0x1bf55c],'as':'Account'}]});})[_0x0a30('0x1a')](function(_0xf45032){if(_[_0x0a30('0x14')](_0xf45032)){throw new Error(_0x4424c8+_0x0a30('0x5a'));}_0x11976e=_0xf45032;return _0xf45032[_0x0a30('0x5b')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0a30('0x1a')](function(){var _0x80ba09={'uniqueid':_0x119840+'.'+_0x11976e['id']+'.'+_0x11976e[_0x0a30('0x5c')]['id'],'FromUserId':_0x18bb7a[_0x0a30('0x2d')]['id'],'type':'queue','ToUserId':_0xcc108b['id']};_0x80ba09[_0x4424c8+_0x0a30('0x5e')]=_0x11976e['id'];_0x80ba09[_0x4424c8+_0x0a30('0x5f')]=_0x11976e['Interaction']['id'];_0x80ba09[_0x0a30('0x60')+_0x4424c8+_0x1bf55c+'Id']=_0x11976e[_0x0a30('0x61')]['id'];return db[_0x4424c8+_0x0a30('0x62')][_0x0a30('0x63')](_0x80ba09);})[_0x0a30('0x1a')](function(){return respondWithRpcPromise(_0x0a30('0x69'),{'channel':_0x119840,'interaction':_0x11976e[_0x0a30('0x5c')],'message':_0x11976e,'account':_0x11976e['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a30('0x37'),'appdata':_0xcc108b[_0x0a30('0x12')]+','+(_0x11976e[_0x0a30('0x61')][_0x0a30('0x6a')]||0x12c),'interval':_0x0a30('0x6b')}]},routingClient);})[_0x0a30('0x1a')](respondWithResult(_0x5a4acf,null))[_0x0a30('0x22')](handleError(_0x5a4acf,null));}; \ No newline at end of file +var _0xdc7d=['chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','QueueId','create','Start','queueTransferTimeout','*,*,*,*','Channel\x20field\x20is\x20mandatory','channel','User','agent','Agent\x20not\x20found','Message','MessageId','From','TransferReport','agentTransferTimeout','lodash','util','../../mysqldb','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','stack','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','agents','Agents','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','internal','AgentCapacity','capacity','telephones','trunks','Trunks','campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','smsQueues','SmsQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts'];(function(_0x7564d,_0x40270f){var _0x1e520d=function(_0x5ed10f){while(--_0x5ed10f){_0x7564d['push'](_0x7564d['shift']());}};_0x1e520d(++_0x40270f);}(_0xdc7d,0x106));var _0xddc7=function(_0xf2e5a5,_0x5ea1ec){_0xf2e5a5=_0xf2e5a5-0x0;var _0x17e409=_0xdc7d[_0xf2e5a5];return _0x17e409;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xddc7('0x0'));var util=require(_0xddc7('0x1'));var db=require(_0xddc7('0x2'))['db'];var logger=require('../../config/logger')('api');var jayson=require(_0xddc7('0x3'));var amiClient=jayson[_0xddc7('0x4')][_0xddc7('0x5')]({'port':0x232a});var mailClient=jayson[_0xddc7('0x4')][_0xddc7('0x5')]({'port':0x232b});var routingClient=jayson[_0xddc7('0x4')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1bbd41,_0x2cc2ad,_0x2341b6){return new BPromise(function(_0xb9d7f2,_0x3c6f78){var _0x549ade=_0x2341b6?_0x2341b6:amiClient;return _0x549ade[_0xddc7('0x6')](_0x1bbd41,_0x2cc2ad)[_0xddc7('0x7')](function(_0x26eaca){if(_0x26eaca[_0xddc7('0x8')]){if(_0x26eaca[_0xddc7('0x8')][_0xddc7('0x9')]===0x1f4){return _0x3c6f78(_0x26eaca[_0xddc7('0x8')][_0xddc7('0xa')]);}return _0xb9d7f2(_0x26eaca[_0xddc7('0x8')][_0xddc7('0xa')]);}else{_0xb9d7f2(_0x26eaca[_0xddc7('0xb')]);}})[_0xddc7('0xc')](function(_0x21794f){_0x3c6f78(_0x21794f);});});}function respondWithResult(_0x4fa8dd,_0x254db8){_0x254db8=_0x254db8||0xc8;return function(_0x16f420){if(_0x16f420){return _0x4fa8dd[_0xddc7('0xd')](_0x254db8)[_0xddc7('0xe')](_0x16f420);}return _0x4fa8dd['sendStatus'](0x194);};}function handleError(_0x3b9c40,_0x2dc3a9){_0x2dc3a9=_0x2dc3a9||0x1f4;return function(_0x4e68c3){logger[_0xddc7('0x8')](_0x4e68c3[_0xddc7('0xf')]);if(_0x4e68c3[_0xddc7('0x10')]){delete _0x4e68c3[_0xddc7('0x10')];}_0x3b9c40[_0xddc7('0xd')](_0x2dc3a9)[_0xddc7('0x11')](_0x4e68c3);};}function findById(_0x4085e7){return function(_0x4377b1){if(!_[_0xddc7('0x12')](_0x4085e7)&&!_[_0xddc7('0x12')](_0x4377b1)&&!_[_0xddc7('0x12')](_0x4377b1[_0xddc7('0x13')])){return _['find'](_0x4377b1['rows'],function(_0x253ea8){return _0x253ea8['id']==_0x4085e7;});}return null;};}exports['voiceChannels']=function(_0x1a676b,_0x596406){return respondWithRpcPromise(_0xddc7('0x14'),_0x1a676b[_0xddc7('0x15')])['then'](respondWithResult(_0x596406,null))[_0xddc7('0xc')](handleError(_0x596406,null));};exports[_0xddc7('0x16')]=function(_0x174e40,_0x41cdb7){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xddc7('0x17')](_0x174e40['query'],_0x174e40[_0xddc7('0x18')]))[_0xddc7('0x7')](respondWithResult(_0x41cdb7,null))[_0xddc7('0xc')](handleError(_0x41cdb7,null));};exports[_0xddc7('0x19')]=function(_0xf57849,_0x161acf){return respondWithRpcPromise(_0xddc7('0x1a'),_[_0xddc7('0x17')](_0xf57849[_0xddc7('0x15')],_0xf57849['params']))[_0xddc7('0x7')](respondWithResult(_0x161acf,null))['catch'](handleError(_0x161acf,null));};exports[_0xddc7('0x1b')]=function(_0x2d3753,_0x5b4abc){return respondWithRpcPromise(_0xddc7('0x1c'),_0x2d3753[_0xddc7('0x15')])[_0xddc7('0x7')](respondWithResult(_0x5b4abc,null))[_0xddc7('0xc')](handleError(_0x5b4abc,null));};exports[_0xddc7('0x1d')]=function(_0x5ac711,_0x4c7061){return respondWithRpcPromise('VoiceQueues',_0x5ac711['query'])[_0xddc7('0x7')](findById(_0x5ac711[_0xddc7('0x18')]['id']))['then'](respondWithResult(_0x4c7061,null))[_0xddc7('0xc')](handleError(_0x4c7061,null));};exports['voiceQueuesPreview']=function(_0x4376ec,_0x12b0d2){return respondWithRpcPromise(_0xddc7('0x1e'),_['merge'](_0x4376ec[_0xddc7('0x15')],_0x4376ec[_0xddc7('0x18')]))['then'](respondWithResult(_0x12b0d2,null))[_0xddc7('0xc')](handleError(_0x12b0d2,null));};exports[_0xddc7('0x1f')]=function(_0x4c3e93,_0x43172a){return respondWithRpcPromise(_0xddc7('0x20'),_0x4c3e93[_0xddc7('0x15')])['then'](respondWithResult(_0x43172a,null))[_0xddc7('0xc')](handleError(_0x43172a,null));};exports['voiceQueuesChannel']=function(_0x24dc35,_0x223523){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x24dc35[_0xddc7('0x15')],_0x24dc35[_0xddc7('0x18')]))[_0xddc7('0x7')](respondWithResult(_0x223523,null))[_0xddc7('0xc')](handleError(_0x223523,null));};exports[_0xddc7('0x21')]=function(_0x57bb34,_0xd44471){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x57bb34[_0xddc7('0x15')],_0x57bb34[_0xddc7('0x18')]))[_0xddc7('0x7')](respondWithResult(_0xd44471,null))[_0xddc7('0xc')](handleError(_0xd44471,null));};exports[_0xddc7('0x22')]=function(_0x10fbef,_0x12ea90){return respondWithRpcPromise(_0xddc7('0x23'),_[_0xddc7('0x17')](_0x10fbef['query'],_0x10fbef[_0xddc7('0x18')]))['then'](respondWithResult(_0x12ea90,null))[_0xddc7('0xc')](handleError(_0x12ea90,null));};exports[_0xddc7('0x24')]=function(_0x4265fc,_0xd59555){return respondWithRpcPromise(_0xddc7('0x25'),_0x4265fc['query'])[_0xddc7('0x7')](respondWithResult(_0xd59555,null))[_0xddc7('0xc')](handleError(_0xd59555,null));};exports['outboundChannels']=function(_0x355c71,_0x1bed9b){return respondWithRpcPromise('OutboundChannels',_0x355c71[_0xddc7('0x15')])[_0xddc7('0x7')](respondWithResult(_0x1bed9b,null))['catch'](handleError(_0x1bed9b,null));};exports[_0xddc7('0x26')]=function(_0xfe85b8,_0x544d87){var _0x13025e;return respondWithRpcPromise(_0xddc7('0x27'),_0xfe85b8['query'])['then'](function(_0x1b6a41){_0x13025e=_0x1b6a41;return respondWithRpcPromise(_0xddc7('0x27'),_0xfe85b8[_0xddc7('0x15')],routingClient);})[_0xddc7('0x7')](function(_0x8b953e){return _['merge']({},_0x8b953e,_0x13025e);})[_0xddc7('0x7')](respondWithResult(_0x544d87,null))['catch'](handleError(_0x544d87,null));};exports['agentCapacity']=function(_0x5edecb,_0x5aac84){if(_0x5edecb['body']&&_0x5edecb[_0xddc7('0x28')][_0xddc7('0x29')]&&_0x5edecb[_0xddc7('0x2a')]&&_0x5edecb[_0xddc7('0x2a')][_0xddc7('0x10')]){for(var _0x47c96f in _0x5edecb[_0xddc7('0x28')][_0xddc7('0x29')]){if(_0x5edecb[_0xddc7('0x28')]['interaction'][_0xddc7('0x2b')](_0x47c96f)){db[_0xddc7('0x2c')][_0xddc7('0x2d')]({'where':{'channel':_0x47c96f,'membername':_0x5edecb[_0xddc7('0x2a')][_0xddc7('0x10')],'type':_0xddc7('0x2e'),'exitAt':null,'uniqueid':_0x5edecb[_0xddc7('0x28')][_0xddc7('0x29')][_0x47c96f]&&_0x5edecb[_0xddc7('0x28')][_0xddc7('0x29')][_0x47c96f][_0xddc7('0x2f')]?{'$notIn':_0x5edecb[_0xddc7('0x28')][_0xddc7('0x29')][_0x47c96f]}:{'$ne':null}}})[_0xddc7('0x7')](function(_0xcfad36){var _0x589762=moment()[_0xddc7('0x30')](_0xddc7('0x31'));for(var _0x175112=0x0,_0x254a7e=_0xcfad36[_0xddc7('0x2f')];_0x175112<_0x254a7e;_0x175112+=0x1){_0xcfad36[_0x175112][_0xddc7('0x32')]({'exitAt':_0x589762});}});for(var _0x106b2b=0x0;_0x106b2b<_0x5edecb['body']['interaction'][_0x47c96f][_0xddc7('0x2f')];_0x106b2b+=0x1){db['MemberReport'][_0xddc7('0x33')]({'where':{'channel':_0x47c96f,'membername':_0x5edecb[_0xddc7('0x2a')]['name'],'type':_0xddc7('0x2e'),'uniqueid':_0x5edecb[_0xddc7('0x28')][_0xddc7('0x29')][_0x47c96f][_0x106b2b],'exitAt':null},'defaults':{'channel':_0x47c96f,'membername':_0x5edecb[_0xddc7('0x2a')][_0xddc7('0x10')],'interface':_['isNil'](_0x5edecb[_0xddc7('0x2a')][_0xddc7('0x34')])?util[_0xddc7('0x30')]('SIP/%s',_0x5edecb[_0xddc7('0x2a')][_0xddc7('0x10')]):_0x5edecb[_0xddc7('0x2a')][_0xddc7('0x34')],'type':'INTERACTION','enterAt':moment()['format'](_0xddc7('0x31')),'role':'agent','internal':_0x5edecb['user'][_0xddc7('0x35')],'uniqueid':_0x5edecb['body'][_0xddc7('0x29')][_0x47c96f][_0x106b2b]}});}}}}return respondWithRpcPromise(_0xddc7('0x36'),{'id':_0x5edecb[_0xddc7('0x18')]['id'],'capacity':_0x5edecb[_0xddc7('0x28')][_0xddc7('0x37')]},routingClient)[_0xddc7('0x7')](respondWithResult(_0x5aac84,null))[_0xddc7('0xc')](handleError(_0x5aac84,null));};exports[_0xddc7('0x38')]=function(_0x145391,_0x1342d1){return respondWithRpcPromise('Telephones',_0x145391[_0xddc7('0x15')])[_0xddc7('0x7')](respondWithResult(_0x1342d1,null))[_0xddc7('0xc')](handleError(_0x1342d1,null));};exports[_0xddc7('0x39')]=function(_0x166e6e,_0x1f92fd){return respondWithRpcPromise(_0xddc7('0x3a'),_0x166e6e[_0xddc7('0x15')])[_0xddc7('0x7')](respondWithResult(_0x1f92fd,null))[_0xddc7('0xc')](handleError(_0x1f92fd,null));};exports[_0xddc7('0x3b')]=function(_0x35a353,_0x1bed22){return respondWithRpcPromise('Campaigns',_0x35a353[_0xddc7('0x15')])['then'](respondWithResult(_0x1bed22,null))[_0xddc7('0xc')](handleError(_0x1bed22,null));};exports[_0xddc7('0x3c')]=function(_0x40a8cd,_0xcd9f13){return respondWithRpcPromise(_0xddc7('0x3d'),_0x40a8cd[_0xddc7('0x15')],routingClient)['then'](respondWithResult(_0xcd9f13,null))[_0xddc7('0xc')](handleError(_0xcd9f13,null));};exports['showChatQueues']=function(_0x4f787b,_0x26cc20){return respondWithRpcPromise(_0xddc7('0x3d'),_0x4f787b[_0xddc7('0x15')],routingClient)['then'](findById(_0x4f787b[_0xddc7('0x18')]['id']))['then'](respondWithResult(_0x26cc20,null))[_0xddc7('0xc')](handleError(_0x26cc20,null));};exports[_0xddc7('0x3e')]=function(_0x143c93,_0x4713e5){return respondWithRpcPromise(_0xddc7('0x3f'),_0x143c93[_0xddc7('0x15')],routingClient)[_0xddc7('0x7')](respondWithResult(_0x4713e5,null))[_0xddc7('0xc')](handleError(_0x4713e5,null));};exports[_0xddc7('0x40')]=function(_0x1c970d,_0x42f9c7){return respondWithRpcPromise(_0xddc7('0x3f'),_0x1c970d['query'],routingClient)['then'](findById(_0x1c970d[_0xddc7('0x18')]['id']))['then'](respondWithResult(_0x42f9c7,null))[_0xddc7('0xc')](handleError(_0x42f9c7,null));};exports[_0xddc7('0x41')]=function(_0x56e0bd,_0x1cdbb6){return respondWithRpcPromise(_0xddc7('0x42'),_0x56e0bd[_0xddc7('0x15')],mailClient)[_0xddc7('0x7')](respondWithResult(_0x1cdbb6,null))[_0xddc7('0xc')](handleError(_0x1cdbb6,null));};exports[_0xddc7('0x43')]=function(_0x576db8,_0x1821f8){return respondWithRpcPromise('OpenchannelQueues',_0x576db8[_0xddc7('0x15')],routingClient)[_0xddc7('0x7')](respondWithResult(_0x1821f8,null))[_0xddc7('0xc')](handleError(_0x1821f8,null));};exports['showOpenchannelQueues']=function(_0x12f16d,_0x3dba94){return respondWithRpcPromise('OpenchannelQueues',_0x12f16d[_0xddc7('0x15')],routingClient)['then'](findById(_0x12f16d[_0xddc7('0x18')]['id']))['then'](respondWithResult(_0x3dba94,null))[_0xddc7('0xc')](handleError(_0x3dba94,null));};exports[_0xddc7('0x44')]=function(_0x5079f7,_0x29e515){return respondWithRpcPromise(_0xddc7('0x45'),_0x5079f7[_0xddc7('0x15')],routingClient)['then'](respondWithResult(_0x29e515,null))[_0xddc7('0xc')](handleError(_0x29e515,null));};exports['showSmsQueues']=function(_0x5e6c1a,_0x169686){return respondWithRpcPromise('SmsQueues',_0x5e6c1a[_0xddc7('0x15')],routingClient)[_0xddc7('0x7')](findById(_0x5e6c1a[_0xddc7('0x18')]['id']))[_0xddc7('0x7')](respondWithResult(_0x169686,null))[_0xddc7('0xc')](handleError(_0x169686,null));};exports[_0xddc7('0x46')]=function(_0x288603,_0x4d7244){return respondWithRpcPromise('FaxQueues',_0x288603[_0xddc7('0x15')],routingClient)['then'](respondWithResult(_0x4d7244,null))['catch'](handleError(_0x4d7244,null));};exports[_0xddc7('0x47')]=function(_0x52e015,_0x2d44c0){return respondWithRpcPromise(_0xddc7('0x48'),_0x52e015[_0xddc7('0x15')],routingClient)[_0xddc7('0x7')](findById(_0x52e015[_0xddc7('0x18')]['id']))[_0xddc7('0x7')](respondWithResult(_0x2d44c0,null))['catch'](handleError(_0x2d44c0,null));};exports[_0xddc7('0x49')]=function(_0x4f7b60,_0x66b9d2){return respondWithRpcPromise('FaxAccounts',_0x4f7b60['query'])['then'](respondWithResult(_0x66b9d2,null))['catch'](handleError(_0x66b9d2,null));};exports[_0xddc7('0x4a')]=function(_0x2d7b81,_0x5146ff){return respondWithRpcPromise(_0xddc7('0x4b'),_0x2d7b81[_0xddc7('0x15')],routingClient)[_0xddc7('0x7')](respondWithResult(_0x5146ff,null))[_0xddc7('0xc')](handleError(_0x5146ff,null));};exports[_0xddc7('0x4c')]=function(_0x9109df,_0x30373f){return respondWithRpcPromise(_0xddc7('0x4d'),_0x9109df[_0xddc7('0x15')],routingClient)[_0xddc7('0x7')](respondWithResult(_0x30373f,null))[_0xddc7('0xc')](handleError(_0x30373f,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x335d54,_0x40e464){return respondWithRpcPromise(_0xddc7('0x4e'),_0x335d54[_0xddc7('0x15')],routingClient)[_0xddc7('0x7')](respondWithResult(_0x40e464,null))[_0xddc7('0xc')](handleError(_0x40e464,null));};exports[_0xddc7('0x4f')]=function(_0x30e929,_0x340b20){return respondWithRpcPromise(_0xddc7('0x50'),_0x30e929[_0xddc7('0x15')],routingClient)[_0xddc7('0x7')](respondWithResult(_0x340b20,null))['catch'](handleError(_0x340b20,null));};exports[_0xddc7('0x51')]=function(_0x20074f,_0x12f411){return respondWithRpcPromise(_0xddc7('0x52'),_0x20074f[_0xddc7('0x15')],routingClient)[_0xddc7('0x7')](respondWithResult(_0x12f411,null))[_0xddc7('0xc')](handleError(_0x12f411,null));};exports[_0xddc7('0x53')]=function(_0x387675){return function(_0x1dbf57,_0x275761){var _0x38a415,_0x157bbb;var _0xefba44=_[_0xddc7('0x54')](_0x387675);var _0x71b666=_0x387675===_0xddc7('0x55')?_0xddc7('0x56'):_0xddc7('0x57');return db[_0xefba44+_0xddc7('0x58')][_0xddc7('0x59')]({'raw':!![],'where':{'id':_0x1dbf57[_0xddc7('0x18')]['id']}})['then'](function(_0x4e9190){if(_[_0xddc7('0x12')](_0x4e9190)){throw new Error(_0xefba44+_0xddc7('0x5a'));}_0x38a415=_0x4e9190;return db[_0xefba44+'Message']['findOne']({'where':{'id':_0x1dbf57[_0xddc7('0x28')][_0xddc7('0x5b')]},'include':[{'model':db[_0xefba44+_0xddc7('0x5c')],'as':'Interaction'},{'model':db[_0xefba44+_0x71b666],'as':'Account'}]});})[_0xddc7('0x7')](function(_0x516a78){if(_[_0xddc7('0x12')](_0x516a78)){throw new Error(_0xefba44+_0xddc7('0x5d'));}_0x157bbb=_0x516a78;return _0x516a78[_0xddc7('0x5e')]({'read':0x0,'readAt':null,'UserId':null});})[_0xddc7('0x7')](function(){var _0x1ccdb3={'uniqueid':_0x387675+'.'+_0x157bbb['id']+'.'+_0x157bbb[_0xddc7('0x5c')]['id'],'FromUserId':_0x1dbf57[_0xddc7('0x2a')]['id'],'type':_0xddc7('0x5f')};_0x1ccdb3[_0xefba44+'MessageId']=_0x157bbb['id'];_0x1ccdb3[_0xefba44+_0xddc7('0x60')]=_0x157bbb[_0xddc7('0x5c')]['id'];_0x1ccdb3['From'+_0xefba44+_0x71b666+'Id']=_0x157bbb[_0xddc7('0x57')]['id'];_0x1ccdb3['To'+_0xefba44+_0xddc7('0x61')]=_0x38a415['id'];return db[_0xefba44+'TransferReport'][_0xddc7('0x62')](_0x1ccdb3);})[_0xddc7('0x7')](function(){return respondWithRpcPromise(_0xddc7('0x63'),{'channel':_0x387675,'interaction':_0x157bbb[_0xddc7('0x5c')],'message':_0x157bbb,'account':_0x157bbb[_0xddc7('0x57')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x38a415[_0xddc7('0x10')]+','+(_0x157bbb[_0xddc7('0x57')][_0xddc7('0x64')]||0x12c),'interval':_0xddc7('0x65')}]},routingClient);})['then'](respondWithResult(_0x275761,null))[_0xddc7('0xc')](handleError(_0x275761,null));};};exports['agentNotify']=function(_0x4fccfd,_0x4a9d7f){var _0xbaa743,_0x19c190;if(_[_0xddc7('0x12')](_0x4fccfd[_0xddc7('0x28')]['channel'])){throw new Error(_0xddc7('0x66'));}var _0x231797=_0x4fccfd[_0xddc7('0x28')][_0xddc7('0x67')];var _0x19d43e=_[_0xddc7('0x54')](_0x231797);var _0x2267b6=_0x231797===_0xddc7('0x55')?_0xddc7('0x56'):_0xddc7('0x57');return db[_0xddc7('0x68')][_0xddc7('0x59')]({'raw':!![],'where':{'id':_0x4fccfd[_0xddc7('0x18')]['id'],'role':_0xddc7('0x69')}})[_0xddc7('0x7')](function(_0x2e39db){if(_[_0xddc7('0x12')](_0x2e39db)){throw new Error(_0xddc7('0x6a'));}_0xbaa743=_0x2e39db;return db[_0x19d43e+_0xddc7('0x6b')][_0xddc7('0x59')]({'where':{'id':_0x4fccfd[_0xddc7('0x28')]['messageId']},'include':[{'model':db[_0x19d43e+_0xddc7('0x5c')],'as':_0xddc7('0x5c')},{'model':db[_0x19d43e+_0x2267b6],'as':_0xddc7('0x57')}]});})[_0xddc7('0x7')](function(_0xe42dc){if(_['isNil'](_0xe42dc)){throw new Error(_0x19d43e+'\x20Message\x20not\x20found');}_0x19c190=_0xe42dc;return _0xe42dc['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xddc7('0x7')](function(){var _0x3efe76={'uniqueid':_0x231797+'.'+_0x19c190['id']+'.'+_0x19c190[_0xddc7('0x5c')]['id'],'FromUserId':_0x4fccfd['user']['id'],'type':'queue','ToUserId':_0xbaa743['id']};_0x3efe76[_0x19d43e+_0xddc7('0x6c')]=_0x19c190['id'];_0x3efe76[_0x19d43e+_0xddc7('0x60')]=_0x19c190[_0xddc7('0x5c')]['id'];_0x3efe76[_0xddc7('0x6d')+_0x19d43e+_0x2267b6+'Id']=_0x19c190[_0xddc7('0x57')]['id'];return db[_0x19d43e+_0xddc7('0x6e')][_0xddc7('0x62')](_0x3efe76);})[_0xddc7('0x7')](function(){return respondWithRpcPromise('Start',{'channel':_0x231797,'interaction':_0x19c190[_0xddc7('0x5c')],'message':_0x19c190,'account':_0x19c190['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xddc7('0x69'),'appdata':_0xbaa743[_0xddc7('0x10')]+','+(_0x19c190[_0xddc7('0x57')][_0xddc7('0x6f')]||0x12c),'interval':_0xddc7('0x65')}]},routingClient);})[_0xddc7('0x7')](respondWithResult(_0x4a9d7f,null))[_0xddc7('0xc')](handleError(_0x4a9d7f,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 66d62dd..d42bf2d 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 _0x6d5a=['/:id','isAuthenticated','show','/:id/run','run','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','index'];(function(_0x151e42,_0x49b4bf){var _0x4cc5c5=function(_0x3521f7){while(--_0x3521f7){_0x151e42['push'](_0x151e42['shift']());}};_0x4cc5c5(++_0x49b4bf);}(_0x6d5a,0x173));var _0xa6d5=function(_0x293e2b,_0x13f94c){_0x293e2b=_0x293e2b-0x0;var _0xc5ec2f=_0x6d5a[_0x293e2b];return _0xc5ec2f;};'use strict';var multer=require('multer');var util=require(_0xa6d5('0x0'));var path=require(_0xa6d5('0x1'));var timeout=require(_0xa6d5('0x2'));var express=require('express');var router=express[_0xa6d5('0x3')]();var auth=require(_0xa6d5('0x4'));var interaction=require(_0xa6d5('0x5'));var config=require('../../config/environment');var controller=require(_0xa6d5('0x6'));router[_0xa6d5('0x7')]('/',auth['isAuthenticated'](),controller[_0xa6d5('0x8')]);router[_0xa6d5('0x7')](_0xa6d5('0x9'),auth[_0xa6d5('0xa')](),controller[_0xa6d5('0xb')]);router[_0xa6d5('0x7')](_0xa6d5('0xc'),auth[_0xa6d5('0xa')](),controller[_0xa6d5('0xd')]);router['post']('/',auth[_0xa6d5('0xa')](),controller[_0xa6d5('0xe')]);router[_0xa6d5('0xf')](_0xa6d5('0x9'),auth[_0xa6d5('0xa')](),controller[_0xa6d5('0x10')]);router[_0xa6d5('0x11')](_0xa6d5('0x9'),auth[_0xa6d5('0xa')](),controller[_0xa6d5('0x12')]);module[_0xa6d5('0x13')]=router; \ No newline at end of file +var _0x2ce5=['../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0x2ce5,0xc1));var _0x52ce=function(_0x614fc1,_0x382aab){_0x614fc1=_0x614fc1-0x0;var _0x201550=_0x2ce5[_0x614fc1];return _0x201550;};'use strict';var multer=require('multer');var util=require(_0x52ce('0x0'));var path=require(_0x52ce('0x1'));var timeout=require(_0x52ce('0x2'));var express=require(_0x52ce('0x3'));var router=express['Router']();var auth=require(_0x52ce('0x4'));var interaction=require(_0x52ce('0x5'));var config=require(_0x52ce('0x6'));var controller=require(_0x52ce('0x7'));router[_0x52ce('0x8')]('/',auth[_0x52ce('0x9')](),controller[_0x52ce('0xa')]);router[_0x52ce('0x8')](_0x52ce('0xb'),auth[_0x52ce('0x9')](),controller['show']);router[_0x52ce('0x8')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0x52ce('0xc')]('/',auth[_0x52ce('0x9')](),controller[_0x52ce('0xd')]);router['put'](_0x52ce('0xb'),auth[_0x52ce('0x9')](),controller[_0x52ce('0xe')]);router[_0x52ce('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x52ce('0x10')]);module[_0x52ce('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index c15f275..7499507 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 _0xeff8=['sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','ENUM','quarters','months','weeks','days','minutes','csv','custom','TEXT'];(function(_0x265003,_0xf0f023){var _0x33c743=function(_0x326a5d){while(--_0x326a5d){_0x265003['push'](_0x265003['shift']());}};_0x33c743(++_0xf0f023);}(_0xeff8,0x186));var _0x8eff=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0xeff8[_0x291f8b];return _0x275171;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'active':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x8eff('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x8eff('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x8eff('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x8eff('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x8eff('0x6')]('years',_0x8eff('0x7'),_0x8eff('0x8'),_0x8eff('0x9'),_0x8eff('0xa'),'hours',_0x8eff('0xb')),'allowNull':![],'defaultValue':_0x8eff('0xa')},'output':{'type':Sequelize[_0x8eff('0x6')](_0x8eff('0xc'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x8eff('0xc')},'type':{'type':Sequelize[_0x8eff('0x6')](_0x8eff('0xd'),'default'),'allowNull':![],'defaultValue':_0x8eff('0xd')},'sendMail':{'type':Sequelize[_0x8eff('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x8eff('0xe')]},'bcc':{'type':Sequelize[_0x8eff('0xe')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xc492=['months','weeks','hours','minutes','days','ENUM','csv','xlsx','custom','TEXT','BOOLEAN','sequelize','exports','STRING','DATE','INTEGER','years'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xc492,0xd7));var _0x2c49=function(_0x319b02,_0x14c034){_0x319b02=_0x319b02-0x0;var _0xeb695c=_0xc492[_0x319b02];return _0xeb695c;};'use strict';var Sequelize=require(_0x2c49('0x0'));module[_0x2c49('0x1')]={'name':{'type':Sequelize[_0x2c49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x2c49('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x2c49('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x2c49('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x2c49('0x5'),'quarters',_0x2c49('0x6'),_0x2c49('0x7'),'days',_0x2c49('0x8'),_0x2c49('0x9')),'allowNull':![],'defaultValue':_0x2c49('0xa')},'output':{'type':Sequelize[_0x2c49('0xb')](_0x2c49('0xc'),'pdf',_0x2c49('0xd')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM']('custom','default'),'allowNull':![],'defaultValue':_0x2c49('0xe')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x2c49('0x2')]},'cc':{'type':Sequelize[_0x2c49('0xf')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x2c49('0x10')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 723b8ad..b8e981a 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 _0x1be5=['eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','set','Content-Range','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','end','error','stack','name','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','options','Schedule','includeAll','include','rows','catch','show','params','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','../../config/schedule','run'];(function(_0x11109d,_0xd23ca1){var _0xbaac9=function(_0x11208c){while(--_0x11208c){_0x11109d['push'](_0x11109d['shift']());}};_0xbaac9(++_0xd23ca1);}(_0x1be5,0xe1));var _0x51be=function(_0x4b278a,_0x25934f){_0x4b278a=_0x4b278a-0x0;var _0x5e6f76=_0x1be5[_0x4b278a];return _0x5e6f76;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x51be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x51be('0x1'));var jsonpatch=require(_0x51be('0x2'));var rp=require('request-promise');var moment=require(_0x51be('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x51be('0x4'));var util=require(_0x51be('0x5'));var path=require(_0x51be('0x6'));var sox=require('sox');var csv=require(_0x51be('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x51be('0x8'));var crypto=require('crypto');var jsforce=require(_0x51be('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51be('0xa'));var Redis=require(_0x51be('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x51be('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x51be('0xd'))(_0x51be('0xe'));var utils=require(_0x51be('0xf'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x533864,_0x4add49){_0x4add49=_0x4add49||0xcc;return function(_0x33f610){if(_0x33f610){return _0x533864[_0x51be('0x10')](_0x4add49);}return _0x533864[_0x51be('0x11')](_0x4add49)['end']();};}function respondWithResult(_0xe9c811,_0xc253e9){_0xc253e9=_0xc253e9||0xc8;return function(_0x290cb0){if(_0x290cb0){return _0xe9c811[_0x51be('0x11')](_0xc253e9)[_0x51be('0x12')](_0x290cb0);}};}function respondWithFilteredResult(_0xb9b944,_0x1e859c){return function(_0x4ba996){if(_0x4ba996){var _0x391d25=_0x4ba996['count'],_0x2ac83b=_0x1e859c[_0x51be('0x13')],_0x4cab37=_0x1e859c[_0x51be('0x13')]+_0x1e859c['limit'],_0x1e83a6;if(_0x4cab37>=_0x391d25){_0x4cab37=_0x391d25;_0x1e83a6=0xc8;}else{_0x1e83a6=0xce;}_0xb9b944[_0x51be('0x11')](_0x1e83a6);return _0xb9b944[_0x51be('0x14')](_0x51be('0x15'),_0x2ac83b+'-'+_0x4cab37+'/'+_0x391d25)[_0x51be('0x12')](_0x4ba996);}return null;};}function patchUpdates(_0x4c9ff6){return function(_0x5d8c71){try{jsonpatch['apply'](_0x5d8c71,_0x4c9ff6,!![]);}catch(_0xb2cb6d){return BPromise[_0x51be('0x16')](_0xb2cb6d);}return _0x5d8c71[_0x51be('0x17')]();};}function saveUpdates(_0x1a0595,_0x3dc639){return function(_0xd2c0a5){if(_0xd2c0a5){return _0xd2c0a5[_0x51be('0x18')](_0x1a0595)[_0x51be('0x19')](function(_0x251786){return _0x251786;});}return null;};}function removeEntity(_0x3104ba,_0x10ba00){return function(_0x3ab37d){if(_0x3ab37d){return _0x3ab37d[_0x51be('0x1a')]()[_0x51be('0x19')](function(){var _0x3f94ab=_0x3ab37d[_0x51be('0x1b')]({'plain':!![]});var _0x28b606=_0x51be('0x1c');return db[_0x51be('0x1d')][_0x51be('0x1a')]({'where':{'type':_0x28b606,'resourceId':_0x3f94ab['id']}})['then'](function(){return _0x3ab37d;});})[_0x51be('0x19')](function(){_0x3104ba[_0x51be('0x11')](0xcc)[_0x51be('0x1e')]();});}};}function handleEntityNotFound(_0xa9ef10,_0xce6623){return function(_0x3a2af2){if(!_0x3a2af2){_0xa9ef10['sendStatus'](0x194);}return _0x3a2af2;};}function handleError(_0xc37e41,_0x2480ed){_0x2480ed=_0x2480ed||0x1f4;return function(_0x2d0fed){logger[_0x51be('0x1f')](_0x2d0fed[_0x51be('0x20')]);if(_0x2d0fed[_0x51be('0x21')]){delete _0x2d0fed[_0x51be('0x21')];}_0xc37e41[_0x51be('0x11')](_0x2480ed)['send'](_0x2d0fed);};}exports['index']=function(_0x2b262b,_0x31bfcd){var _0x1845a3={},_0x372282={},_0x4497e7={'count':0x0,'rows':[]};var _0x3b96a2=_['map'](db['Schedule'][_0x51be('0x22')],function(_0x38b09a){return{'name':_0x38b09a[_0x51be('0x23')],'type':_0x38b09a[_0x51be('0x24')]['key']};});_0x372282[_0x51be('0x25')]=_[_0x51be('0x26')](_0x3b96a2,_0x51be('0x21'));_0x372282[_0x51be('0x27')]=_[_0x51be('0x28')](_0x2b262b[_0x51be('0x27')]);_0x372282[_0x51be('0x29')]=_[_0x51be('0x2a')](_0x372282[_0x51be('0x25')],_0x372282['query']);_0x1845a3['attributes']=_[_0x51be('0x2a')](_0x372282['model'],qs[_0x51be('0x2b')](_0x2b262b[_0x51be('0x27')][_0x51be('0x2b')]));_0x1845a3[_0x51be('0x2c')]=_0x1845a3[_0x51be('0x2c')][_0x51be('0x2d')]?_0x1845a3[_0x51be('0x2c')]:_0x372282['model'];if(!_0x2b262b['query'][_0x51be('0x2e')](_0x51be('0x2f'))){_0x1845a3[_0x51be('0x30')]=qs[_0x51be('0x30')](_0x2b262b[_0x51be('0x27')][_0x51be('0x30')]);_0x1845a3[_0x51be('0x13')]=qs[_0x51be('0x13')](_0x2b262b[_0x51be('0x27')]['offset']);}_0x1845a3['order']=qs['sort'](_0x2b262b['query'][_0x51be('0x31')]);_0x1845a3['where']=qs['filters'](_[_0x51be('0x32')](_0x2b262b['query'],_0x372282[_0x51be('0x29')]));if(_0x2b262b[_0x51be('0x27')][_0x51be('0x33')]){_0x1845a3[_0x51be('0x34')]=_[_0x51be('0x35')](_0x1845a3[_0x51be('0x34')],{'$or':_[_0x51be('0x26')](_0x3b96a2,function(_0x3a749e){if(_0x3a749e[_0x51be('0x24')]!==_0x51be('0x36')){var _0x4e7f01={};_0x4e7f01[_0x3a749e[_0x51be('0x21')]]={'$like':'%'+_0x2b262b[_0x51be('0x27')][_0x51be('0x33')]+'%'};return _0x4e7f01;}})});}_0x1845a3=_[_0x51be('0x35')]({},_0x1845a3,_0x2b262b[_0x51be('0x37')]);var _0x70cf54={'where':_0x1845a3[_0x51be('0x34')]};return db[_0x51be('0x38')]['count'](_0x70cf54)[_0x51be('0x19')](function(_0x4d4a20){_0x4497e7['count']=_0x4d4a20;if(_0x2b262b[_0x51be('0x27')][_0x51be('0x39')]){_0x1845a3[_0x51be('0x3a')]=[{'all':!![]}];}return db[_0x51be('0x38')]['findAll'](_0x1845a3);})[_0x51be('0x19')](function(_0x1f788e){_0x4497e7[_0x51be('0x3b')]=_0x1f788e;return _0x4497e7;})[_0x51be('0x19')](respondWithFilteredResult(_0x31bfcd,_0x1845a3))[_0x51be('0x3c')](handleError(_0x31bfcd,null));};exports[_0x51be('0x3d')]=function(_0x559d39,_0x386f7b){var _0x1bd052={'raw':![],'where':{'id':_0x559d39[_0x51be('0x3e')]['id']}},_0x42e841={};_0x42e841[_0x51be('0x25')]=_[_0x51be('0x28')](db['Schedule'][_0x51be('0x22')]);_0x42e841[_0x51be('0x27')]=_[_0x51be('0x28')](_0x559d39[_0x51be('0x27')]);_0x42e841[_0x51be('0x29')]=_[_0x51be('0x2a')](_0x42e841[_0x51be('0x25')],_0x42e841[_0x51be('0x27')]);_0x1bd052[_0x51be('0x2c')]=_[_0x51be('0x2a')](_0x42e841[_0x51be('0x25')],qs[_0x51be('0x2b')](_0x559d39[_0x51be('0x27')][_0x51be('0x2b')]));_0x1bd052['attributes']=_0x1bd052[_0x51be('0x2c')][_0x51be('0x2d')]?_0x1bd052[_0x51be('0x2c')]:_0x42e841[_0x51be('0x25')];if(_0x559d39[_0x51be('0x27')]['includeAll']){_0x1bd052['include']=[{'all':!![]}];}_0x1bd052=_[_0x51be('0x35')]({},_0x1bd052,_0x559d39['options']);return db[_0x51be('0x38')][_0x51be('0x3f')](_0x1bd052)[_0x51be('0x19')](handleEntityNotFound(_0x386f7b,null))[_0x51be('0x19')](respondWithResult(_0x386f7b,null))[_0x51be('0x3c')](handleError(_0x386f7b,null));};exports[_0x51be('0x40')]=function(_0x3807df,_0xd409d8){return db['Schedule'][_0x51be('0x40')](_0x3807df['body'],{})['then'](function(_0x13a36f){var _0x48de86=_0x3807df[_0x51be('0x41')][_0x51be('0x1b')]({'plain':!![]});if(!_0x48de86)throw new Error(_0x51be('0x42'));if(_0x48de86[_0x51be('0x43')]===_0x51be('0x41')){var _0x3a5096=_0x13a36f[_0x51be('0x1b')]({'plain':!![]});var _0x35a4cf=_0x51be('0x1c');return db[_0x51be('0x44')][_0x51be('0x3f')]({'where':{'name':_0x35a4cf,'userProfileId':_0x48de86[_0x51be('0x45')]},'raw':!![]})[_0x51be('0x19')](function(_0x13f03f){if(_0x13f03f&&_0x13f03f[_0x51be('0x46')]===0x0){return db['UserProfileResource'][_0x51be('0x40')]({'name':_0x3a5096[_0x51be('0x21')],'resourceId':_0x3a5096['id'],'type':_0x13f03f[_0x51be('0x21')],'sectionId':_0x13f03f['id']},{})[_0x51be('0x19')](function(){return _0x13a36f;});}else{return _0x13a36f;}})[_0x51be('0x3c')](function(_0x23f4d5){logger[_0x51be('0x1f')](_0x51be('0x47'),_0x23f4d5);throw _0x23f4d5;});}return _0x13a36f;})[_0x51be('0x19')](respondWithResult(_0xd409d8,0xc9))[_0x51be('0x3c')](handleError(_0xd409d8,null));};exports['update']=function(_0x5c796c,_0x1c5803){if(_0x5c796c[_0x51be('0x48')]['id']){delete _0x5c796c[_0x51be('0x48')]['id'];}return db[_0x51be('0x38')][_0x51be('0x3f')]({'where':{'id':_0x5c796c['params']['id']}})['then'](handleEntityNotFound(_0x1c5803,null))[_0x51be('0x19')](saveUpdates(_0x5c796c[_0x51be('0x48')],null))[_0x51be('0x19')](respondWithResult(_0x1c5803,null))[_0x51be('0x3c')](handleError(_0x1c5803,null));};exports['destroy']=function(_0x526e54,_0x2de928){return db['Schedule'][_0x51be('0x3f')]({'where':{'id':_0x526e54[_0x51be('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2de928,null))[_0x51be('0x19')](removeEntity(_0x2de928,null))['catch'](handleError(_0x2de928,null));};exports['run']=function(_0x44ca35,_0x129eba,_0x46c72d){var _0x5c1f61=require(_0x51be('0x49'));return db['Schedule'][_0x51be('0x3f')]({'where':{'id':_0x44ca35[_0x51be('0x3e')]['id']},'raw':!![]})[_0x51be('0x19')](handleEntityNotFound(_0x129eba,null))[_0x51be('0x19')](function(){_0x5c1f61[_0x51be('0x4a')](_0x44ca35[_0x51be('0x3e')]['id']);})[_0x51be('0x19')](respondWithStatusCode(_0x129eba,null))['catch'](handleError(_0x129eba,null));}; \ No newline at end of file +var _0x15b1=['merge','map','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','Schedule','fields','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x5f5058,_0x27dde1){var _0x5ecc5b=function(_0x566594){while(--_0x566594){_0x5f5058['push'](_0x5f5058['shift']());}};_0x5ecc5b(++_0x27dde1);}(_0x15b1,0x6a));var _0x115b=function(_0x24b31e,_0x57f7c3){_0x24b31e=_0x24b31e-0x0;var _0x4724b9=_0x15b1[_0x24b31e];return _0x4724b9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x115b('0x0'));var rimraf=require(_0x115b('0x1'));var zipdir=require(_0x115b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x115b('0x3'));var BPromise=require(_0x115b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x115b('0x5'));var sox=require(_0x115b('0x6'));var csv=require(_0x115b('0x7'));var ejs=require(_0x115b('0x8'));var fs=require('fs');var _=require(_0x115b('0x9'));var squel=require('squel');var crypto=require(_0x115b('0xa'));var jsforce=require(_0x115b('0xb'));var deskjs=require(_0x115b('0xc'));var toCsv=require(_0x115b('0x7'));var querystring=require(_0x115b('0xd'));var Papa=require(_0x115b('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x115b('0xf'));var as=require(_0x115b('0x10'));var hardwareService=require(_0x115b('0x11'));var logger=require(_0x115b('0x12'))(_0x115b('0x13'));var utils=require(_0x115b('0x14'));var config=require(_0x115b('0x15'));var db=require(_0x115b('0x16'))['db'];function respondWithStatusCode(_0x5bfaab,_0x36130c){_0x36130c=_0x36130c||0xcc;return function(_0x105b29){if(_0x105b29){return _0x5bfaab['sendStatus'](_0x36130c);}return _0x5bfaab['status'](_0x36130c)[_0x115b('0x17')]();};}function respondWithResult(_0x63aaa3,_0x30054a){_0x30054a=_0x30054a||0xc8;return function(_0x5b9087){if(_0x5b9087){return _0x63aaa3[_0x115b('0x18')](_0x30054a)[_0x115b('0x19')](_0x5b9087);}};}function respondWithFilteredResult(_0x339d13,_0x5f253d){return function(_0x159f97){if(_0x159f97){var _0x4f0d1b=_0x159f97[_0x115b('0x1a')],_0x435c88=_0x5f253d['offset'],_0x53f182=_0x5f253d[_0x115b('0x1b')]+_0x5f253d[_0x115b('0x1c')],_0x1e59de;if(_0x53f182>=_0x4f0d1b){_0x53f182=_0x4f0d1b;_0x1e59de=0xc8;}else{_0x1e59de=0xce;}_0x339d13[_0x115b('0x18')](_0x1e59de);return _0x339d13['set']('Content-Range',_0x435c88+'-'+_0x53f182+'/'+_0x4f0d1b)['json'](_0x159f97);}return null;};}function patchUpdates(_0x560862){return function(_0x52740d){try{jsonpatch[_0x115b('0x1d')](_0x52740d,_0x560862,!![]);}catch(_0x2b2ae3){return BPromise[_0x115b('0x1e')](_0x2b2ae3);}return _0x52740d[_0x115b('0x1f')]();};}function saveUpdates(_0x289f44,_0xc94cd3){return function(_0x519b8b){if(_0x519b8b){return _0x519b8b[_0x115b('0x20')](_0x289f44)[_0x115b('0x21')](function(_0x255362){return _0x255362;});}return null;};}function removeEntity(_0x53038e,_0x58b639){return function(_0x12d5b6){if(_0x12d5b6){return _0x12d5b6[_0x115b('0x22')]()['then'](function(){var _0x4c814a=_0x12d5b6[_0x115b('0x23')]({'plain':!![]});var _0x4cd2ca=_0x115b('0x24');return db[_0x115b('0x25')][_0x115b('0x22')]({'where':{'type':_0x4cd2ca,'resourceId':_0x4c814a['id']}})[_0x115b('0x21')](function(){return _0x12d5b6;});})[_0x115b('0x21')](function(){_0x53038e[_0x115b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c415f,_0x46aaf4){return function(_0xd620f){if(!_0xd620f){_0x3c415f[_0x115b('0x26')](0x194);}return _0xd620f;};}function handleError(_0x362d5d,_0x15d98f){_0x15d98f=_0x15d98f||0x1f4;return function(_0xa09f6e){logger[_0x115b('0x27')](_0xa09f6e[_0x115b('0x28')]);if(_0xa09f6e[_0x115b('0x29')]){delete _0xa09f6e['name'];}_0x362d5d[_0x115b('0x18')](_0x15d98f)[_0x115b('0x2a')](_0xa09f6e);};}exports[_0x115b('0x2b')]=function(_0x1d0286,_0x1ebabf){var _0x1f323b={},_0x2b1683={},_0x38388e={'count':0x0,'rows':[]};var _0x26488e=_['map'](db['Schedule'][_0x115b('0x2c')],function(_0x111946){return{'name':_0x111946['fieldName'],'type':_0x111946[_0x115b('0x2d')][_0x115b('0x2e')]};});_0x2b1683[_0x115b('0x2f')]=_['map'](_0x26488e,_0x115b('0x29'));_0x2b1683[_0x115b('0x30')]=_[_0x115b('0x31')](_0x1d0286['query']);_0x2b1683['filters']=_[_0x115b('0x32')](_0x2b1683['model'],_0x2b1683[_0x115b('0x30')]);_0x1f323b[_0x115b('0x33')]=_['intersection'](_0x2b1683[_0x115b('0x2f')],qs['fields'](_0x1d0286[_0x115b('0x30')]['fields']));_0x1f323b[_0x115b('0x33')]=_0x1f323b[_0x115b('0x33')][_0x115b('0x34')]?_0x1f323b[_0x115b('0x33')]:_0x2b1683[_0x115b('0x2f')];if(!_0x1d0286[_0x115b('0x30')][_0x115b('0x35')](_0x115b('0x36'))){_0x1f323b[_0x115b('0x1c')]=qs[_0x115b('0x1c')](_0x1d0286[_0x115b('0x30')][_0x115b('0x1c')]);_0x1f323b[_0x115b('0x1b')]=qs['offset'](_0x1d0286['query'][_0x115b('0x1b')]);}_0x1f323b[_0x115b('0x37')]=qs[_0x115b('0x38')](_0x1d0286[_0x115b('0x30')][_0x115b('0x38')]);_0x1f323b[_0x115b('0x39')]=qs[_0x115b('0x3a')](_[_0x115b('0x3b')](_0x1d0286[_0x115b('0x30')],_0x2b1683[_0x115b('0x3a')]));if(_0x1d0286[_0x115b('0x30')]['filter']){_0x1f323b[_0x115b('0x39')]=_[_0x115b('0x3c')](_0x1f323b[_0x115b('0x39')],{'$or':_[_0x115b('0x3d')](_0x26488e,function(_0x1198ea){if(_0x1198ea['type']!==_0x115b('0x3e')){var _0x3281e2={};_0x3281e2[_0x1198ea[_0x115b('0x29')]]={'$like':'%'+_0x1d0286['query'][_0x115b('0x3f')]+'%'};return _0x3281e2;}})});}_0x1f323b=_[_0x115b('0x3c')]({},_0x1f323b,_0x1d0286[_0x115b('0x40')]);var _0x1228d0={'where':_0x1f323b[_0x115b('0x39')]};return db['Schedule'][_0x115b('0x1a')](_0x1228d0)[_0x115b('0x21')](function(_0x2d5c3a){_0x38388e[_0x115b('0x1a')]=_0x2d5c3a;if(_0x1d0286[_0x115b('0x30')][_0x115b('0x41')]){_0x1f323b[_0x115b('0x42')]=[{'all':!![]}];}return db['Schedule'][_0x115b('0x43')](_0x1f323b);})[_0x115b('0x21')](function(_0x4d0eb5){_0x38388e['rows']=_0x4d0eb5;return _0x38388e;})['then'](respondWithFilteredResult(_0x1ebabf,_0x1f323b))[_0x115b('0x44')](handleError(_0x1ebabf,null));};exports[_0x115b('0x45')]=function(_0x225e2f,_0xe9308e){var _0x408aab={'raw':![],'where':{'id':_0x225e2f[_0x115b('0x46')]['id']}},_0x2db2e1={};_0x2db2e1['model']=_[_0x115b('0x31')](db[_0x115b('0x47')]['rawAttributes']);_0x2db2e1[_0x115b('0x30')]=_[_0x115b('0x31')](_0x225e2f[_0x115b('0x30')]);_0x2db2e1['filters']=_[_0x115b('0x32')](_0x2db2e1['model'],_0x2db2e1['query']);_0x408aab[_0x115b('0x33')]=_[_0x115b('0x32')](_0x2db2e1[_0x115b('0x2f')],qs[_0x115b('0x48')](_0x225e2f[_0x115b('0x30')][_0x115b('0x48')]));_0x408aab['attributes']=_0x408aab['attributes'][_0x115b('0x34')]?_0x408aab['attributes']:_0x2db2e1['model'];if(_0x225e2f[_0x115b('0x30')][_0x115b('0x41')]){_0x408aab[_0x115b('0x42')]=[{'all':!![]}];}_0x408aab=_[_0x115b('0x3c')]({},_0x408aab,_0x225e2f[_0x115b('0x40')]);return db['Schedule'][_0x115b('0x49')](_0x408aab)['then'](handleEntityNotFound(_0xe9308e,null))[_0x115b('0x21')](respondWithResult(_0xe9308e,null))[_0x115b('0x44')](handleError(_0xe9308e,null));};exports['create']=function(_0x9e6749,_0x1e48cc){return db[_0x115b('0x47')][_0x115b('0x4a')](_0x9e6749[_0x115b('0x4b')],{})[_0x115b('0x21')](function(_0x2088a9){var _0xcaa116=_0x9e6749[_0x115b('0x4c')][_0x115b('0x23')]({'plain':!![]});if(!_0xcaa116)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcaa116[_0x115b('0x4d')]==='user'){var _0x2402f2=_0x2088a9[_0x115b('0x23')]({'plain':!![]});var _0x41b8db=_0x115b('0x24');return db['UserProfileSection'][_0x115b('0x49')]({'where':{'name':_0x41b8db,'userProfileId':_0xcaa116[_0x115b('0x4e')]},'raw':!![]})[_0x115b('0x21')](function(_0x49db9f){if(_0x49db9f&&_0x49db9f[_0x115b('0x4f')]===0x0){return db[_0x115b('0x25')]['create']({'name':_0x2402f2['name'],'resourceId':_0x2402f2['id'],'type':_0x49db9f[_0x115b('0x29')],'sectionId':_0x49db9f['id']},{})[_0x115b('0x21')](function(){return _0x2088a9;});}else{return _0x2088a9;}})[_0x115b('0x44')](function(_0x424b14){logger[_0x115b('0x27')](_0x115b('0x50'),_0x424b14);throw _0x424b14;});}return _0x2088a9;})['then'](respondWithResult(_0x1e48cc,0xc9))[_0x115b('0x44')](handleError(_0x1e48cc,null));};exports[_0x115b('0x20')]=function(_0x4336d6,_0x5621b9){if(_0x4336d6['body']['id']){delete _0x4336d6[_0x115b('0x4b')]['id'];}return db[_0x115b('0x47')][_0x115b('0x49')]({'where':{'id':_0x4336d6['params']['id']}})[_0x115b('0x21')](handleEntityNotFound(_0x5621b9,null))[_0x115b('0x21')](saveUpdates(_0x4336d6['body'],null))['then'](respondWithResult(_0x5621b9,null))[_0x115b('0x44')](handleError(_0x5621b9,null));};exports['destroy']=function(_0x525627,_0x25a21a){return db['Schedule']['find']({'where':{'id':_0x525627[_0x115b('0x46')]['id']}})['then'](handleEntityNotFound(_0x25a21a,null))[_0x115b('0x21')](removeEntity(_0x25a21a,null))[_0x115b('0x44')](handleError(_0x25a21a,null));};exports[_0x115b('0x51')]=function(_0x1689df,_0x3fd932,_0x589a56){var _0x4a8ad1=require(_0x115b('0x52'));return db['Schedule']['find']({'where':{'id':_0x1689df[_0x115b('0x46')]['id']},'raw':!![]})[_0x115b('0x21')](handleEntityNotFound(_0x3fd932,null))[_0x115b('0x21')](function(){_0x4a8ad1[_0x115b('0x51')](_0x1689df['params']['id']);})[_0x115b('0x21')](respondWithStatusCode(_0x3fd932,null))[_0x115b('0x44')](handleError(_0x3fd932,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 07a5901..11a1cd9 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 _0x03c7=['exports','define','tools_schedules','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xcef62f,_0xc42208){var _0x4db441=function(_0x4f11f7){while(--_0x4f11f7){_0xcef62f['push'](_0xcef62f['shift']());}};_0x4db441(++_0xc42208);}(_0x03c7,0x1c6));var _0x703c=function(_0x38e913,_0x34ac45){_0x38e913=_0x38e913-0x0;var _0x196bff=_0x03c7[_0x38e913];return _0x196bff;};'use strict';var _=require('lodash');var util=require(_0x703c('0x0'));var logger=require(_0x703c('0x1'))('api');var moment=require(_0x703c('0x2'));var BPromise=require(_0x703c('0x3'));var rp=require(_0x703c('0x4'));var fs=require('fs');var path=require(_0x703c('0x5'));var rimraf=require(_0x703c('0x6'));var config=require(_0x703c('0x7'));var attributes=require('./schedule.attributes');module[_0x703c('0x8')]=function(_0x1bfc16,_0x55231a){return _0x1bfc16[_0x703c('0x9')]('Schedule',attributes,{'tableName':_0x703c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fb1=['tools_schedules','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define'];(function(_0x2b37ee,_0x48fa7b){var _0x430f6b=function(_0x4a2e1f){while(--_0x4a2e1f){_0x2b37ee['push'](_0x2b37ee['shift']());}};_0x430f6b(++_0x48fa7b);}(_0x4fb1,0x7a));var _0x14fb=function(_0x1385be,_0x3be0ea){_0x1385be=_0x1385be-0x0;var _0x1328e5=_0x4fb1[_0x1385be];return _0x1328e5;};'use strict';var _=require(_0x14fb('0x0'));var util=require(_0x14fb('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x14fb('0x2'));var rp=require(_0x14fb('0x3'));var fs=require('fs');var path=require(_0x14fb('0x4'));var rimraf=require(_0x14fb('0x5'));var config=require(_0x14fb('0x6'));var attributes=require(_0x14fb('0x7'));module[_0x14fb('0x8')]=function(_0x34f2bc,_0x4ce5bd){return _0x34f2bc[_0x14fb('0x9')]('Schedule',attributes,{'tableName':_0x14fb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index bbabd7e..0630d5f 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 _0x18b8=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0xce698d,_0x829cad){var _0x1701d5=function(_0x2c48b8){while(--_0x2c48b8){_0xce698d['push'](_0xce698d['shift']());}};_0x1701d5(++_0x829cad);}(_0x18b8,0x9b));var _0x818b=function(_0x3bd307,_0x41784e){_0x3bd307=_0x3bd307-0x0;var _0x70449a=_0x18b8[_0x3bd307];return _0x70449a;};'use strict';var _=require(_0x818b('0x0'));var util=require(_0x818b('0x1'));var moment=require(_0x818b('0x2'));var BPromise=require(_0x818b('0x3'));var rs=require(_0x818b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x818b('0x5'))['db'];var utils=require(_0x818b('0x6'));var logger=require(_0x818b('0x7'))(_0x818b('0x8'));var config=require('../../config/environment');var jayson=require(_0x818b('0x9'));var client=jayson[_0x818b('0xa')][_0x818b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31c031,_0x5cf5b8,_0x37fca0){return new BPromise(function(_0x25d01b,_0x56a473){return client[_0x818b('0xc')](_0x31c031,_0x37fca0)[_0x818b('0xd')](function(_0x3854a1){logger[_0x818b('0xe')](_0x818b('0xf'),_0x5cf5b8,'request\x20sent');logger[_0x818b('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0x5cf5b8,_0x818b('0x11'),JSON[_0x818b('0x12')](_0x3854a1));if(_0x3854a1[_0x818b('0x13')]){if(_0x3854a1[_0x818b('0x13')][_0x818b('0x14')]===0x1f4){logger[_0x818b('0x13')](_0x818b('0xf'),_0x5cf5b8,_0x3854a1[_0x818b('0x13')]['message']);return _0x56a473(_0x3854a1[_0x818b('0x13')][_0x818b('0x15')]);}logger[_0x818b('0x13')](_0x818b('0xf'),_0x5cf5b8,_0x3854a1['error'][_0x818b('0x15')]);return _0x25d01b(_0x3854a1['error'][_0x818b('0x15')]);}else{logger[_0x818b('0xe')](_0x818b('0xf'),_0x5cf5b8,_0x818b('0x11'));_0x25d01b(_0x3854a1['result'][_0x818b('0x15')]);}})[_0x818b('0x16')](function(_0x3bc4c8){logger[_0x818b('0x13')]('Schedule,\x20%s,\x20%s',_0x5cf5b8,_0x3bc4c8);_0x56a473(_0x3bc4c8);});});} \ No newline at end of file +var _0xf90a=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring'];(function(_0x299c63,_0x80fade){var _0x53904d=function(_0x4914e3){while(--_0x4914e3){_0x299c63['push'](_0x299c63['shift']());}};_0x53904d(++_0x80fade);}(_0xf90a,0x8e));var _0xaf90=function(_0x4eda03,_0x47a200){_0x4eda03=_0x4eda03-0x0;var _0x19a37c=_0xf90a[_0x4eda03];return _0x19a37c;};'use strict';var _=require(_0xaf90('0x0'));var util=require(_0xaf90('0x1'));var moment=require(_0xaf90('0x2'));var BPromise=require(_0xaf90('0x3'));var rs=require(_0xaf90('0x4'));var fs=require('fs');var Redis=require(_0xaf90('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf90('0x6'));var logger=require(_0xaf90('0x7'))('rpc');var config=require(_0xaf90('0x8'));var jayson=require(_0xaf90('0x9'));var client=jayson[_0xaf90('0xa')][_0xaf90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37296e,_0x179345,_0x2c831f){return new BPromise(function(_0x2772f4,_0x187f38){return client['request'](_0x37296e,_0x2c831f)['then'](function(_0x4651a7){logger[_0xaf90('0xc')](_0xaf90('0xd'),_0x179345,_0xaf90('0xe'));logger[_0xaf90('0xf')](_0xaf90('0x10'),_0x179345,_0xaf90('0xe'),JSON[_0xaf90('0x11')](_0x4651a7));if(_0x4651a7[_0xaf90('0x12')]){if(_0x4651a7['error'][_0xaf90('0x13')]===0x1f4){logger[_0xaf90('0x12')](_0xaf90('0xd'),_0x179345,_0x4651a7[_0xaf90('0x12')]['message']);return _0x187f38(_0x4651a7['error'][_0xaf90('0x14')]);}logger[_0xaf90('0x12')](_0xaf90('0xd'),_0x179345,_0x4651a7[_0xaf90('0x12')][_0xaf90('0x14')]);return _0x2772f4(_0x4651a7[_0xaf90('0x12')][_0xaf90('0x14')]);}else{logger[_0xaf90('0xc')]('Schedule,\x20%s,\x20%s',_0x179345,_0xaf90('0xe'));_0x2772f4(_0x4651a7['result'][_0xaf90('0x14')]);}})['catch'](function(_0x3f940f){logger['error'](_0xaf90('0xd'),_0x179345,_0x3f940f);_0x187f38(_0x3f940f);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index c91d5c7..a47c568 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 _0x5794=['/:id','show','download','post','create','update','delete','destroy','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5794,0x1b8));var _0x4579=function(_0x29772e,_0x45759f){_0x29772e=_0x29772e-0x0;var _0x106833=_0x5794[_0x29772e];return _0x106833;};'use strict';var multer=require('multer');var util=require(_0x4579('0x0'));var path=require(_0x4579('0x1'));var timeout=require(_0x4579('0x2'));var express=require(_0x4579('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4579('0x4'));var config=require(_0x4579('0x5'));var controller=require('./screenRecording.controller');router[_0x4579('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4579('0x7'),auth[_0x4579('0x8')](),controller[_0x4579('0x9')]);router[_0x4579('0x6')](_0x4579('0xa'),auth[_0x4579('0x8')](),controller[_0x4579('0xb')]);router[_0x4579('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x4579('0xc')]);router[_0x4579('0xd')]('/',auth[_0x4579('0x8')](),controller[_0x4579('0xe')]);router['put'](_0x4579('0xa'),auth[_0x4579('0x8')](),controller[_0x4579('0xf')]);router[_0x4579('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x4579('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5d33=['download','post','create','delete','destroy','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5d33,0x122));var _0x35d3=function(_0x374dfb,_0x1b7bdd){_0x374dfb=_0x374dfb-0x0;var _0xb196d6=_0x5d33[_0x374dfb];return _0xb196d6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x35d3('0x0'));var express=require('express');var router=express[_0x35d3('0x1')]();var auth=require(_0x35d3('0x2'));var interaction=require(_0x35d3('0x3'));var config=require(_0x35d3('0x4'));var controller=require(_0x35d3('0x5'));router[_0x35d3('0x6')]('/',auth[_0x35d3('0x7')](),controller[_0x35d3('0x8')]);router[_0x35d3('0x6')](_0x35d3('0x9'),auth[_0x35d3('0x7')](),controller[_0x35d3('0xa')]);router[_0x35d3('0x6')](_0x35d3('0xb'),auth['isAuthenticated'](),controller[_0x35d3('0xc')]);router['get'](_0x35d3('0xd'),auth[_0x35d3('0x7')](),controller[_0x35d3('0xe')]);router[_0x35d3('0xf')]('/',auth[_0x35d3('0x7')](),controller[_0x35d3('0x10')]);router['put']('/:id',auth[_0x35d3('0x7')](),controller['update']);router[_0x35d3('0x11')](_0x35d3('0xb'),auth['isAuthenticated'](),controller[_0x35d3('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 83c9be2..0577498 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 _0x9f62=['exports','VIRTUAL','extname','getDataValue','value','STRING','replace','setDataValue','startedAt','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','moment','../../config/environment'];(function(_0x176862,_0x210708){var _0x3508d9=function(_0x146f44){while(--_0x146f44){_0x176862['push'](_0x176862['shift']());}};_0x3508d9(++_0x210708);}(_0x9f62,0x154));var _0x29f6=function(_0x47126a,_0x557272){_0x47126a=_0x47126a-0x0;var _0xd93a80=_0x9f62[_0x47126a];return _0xd93a80;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x29f6('0x0'));var path=require('path');var config=require(_0x29f6('0x1'));module[_0x29f6('0x2')]={'format':{'type':Sequelize[_0x29f6('0x3')],'get':function(){return this['getDataValue']('value')?path[_0x29f6('0x4')](this[_0x29f6('0x5')](_0x29f6('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x29f6('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x29f6('0x7')],'set':function(_0x272876){var _0x9a43fe=_0x272876[_0x29f6('0x8')](/\\/g,'/');this[_0x29f6('0x9')]('value',_0x9a43fe);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x549f64){this[_0x29f6('0x9')](_0x29f6('0xa'),moment()['subtract'](_0x549f64,'ms'));this['setDataValue'](_0x29f6('0xb'),moment());this[_0x29f6('0x9')]('duration',_0x549f64);}},'startedAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')]('startedAt'))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')](_0x29f6('0xb')))[_0x29f6('0xd')](_0x29f6('0xe'))[_0x29f6('0xf')]();}},'createdAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')](_0x29f6('0x10')))[_0x29f6('0xd')](_0x29f6('0xe'))[_0x29f6('0xf')]();}},'updatedAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')](_0x29f6('0x11')))[_0x29f6('0xd')](_0x29f6('0xe'))['toString']();}}}; \ No newline at end of file +var _0x9f62=['exports','VIRTUAL','extname','getDataValue','value','STRING','replace','setDataValue','startedAt','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','moment','../../config/environment'];(function(_0x118f2d,_0x2be08f){var _0x32454f=function(_0x2bc6cf){while(--_0x2bc6cf){_0x118f2d['push'](_0x118f2d['shift']());}};_0x32454f(++_0x2be08f);}(_0x9f62,0x154));var _0x29f6=function(_0x4ea661,_0x5a8064){_0x4ea661=_0x4ea661-0x0;var _0x39d8f7=_0x9f62[_0x4ea661];return _0x39d8f7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x29f6('0x0'));var path=require('path');var config=require(_0x29f6('0x1'));module[_0x29f6('0x2')]={'format':{'type':Sequelize[_0x29f6('0x3')],'get':function(){return this['getDataValue']('value')?path[_0x29f6('0x4')](this[_0x29f6('0x5')](_0x29f6('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x29f6('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x29f6('0x7')],'set':function(_0x272876){var _0x9a43fe=_0x272876[_0x29f6('0x8')](/\\/g,'/');this[_0x29f6('0x9')]('value',_0x9a43fe);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x549f64){this[_0x29f6('0x9')](_0x29f6('0xa'),moment()['subtract'](_0x549f64,'ms'));this['setDataValue'](_0x29f6('0xb'),moment());this[_0x29f6('0x9')]('duration',_0x549f64);}},'startedAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')]('startedAt'))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')](_0x29f6('0xb')))[_0x29f6('0xd')](_0x29f6('0xe'))[_0x29f6('0xf')]();}},'createdAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')](_0x29f6('0x10')))[_0x29f6('0xd')](_0x29f6('0xe'))[_0x29f6('0xf')]();}},'updatedAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')](_0x29f6('0x11')))[_0x29f6('0xd')](_0x29f6('0xe'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index c4c0254..d789ccd 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 _0x4ded=['hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','ScreenRecording','then','includeAll','findAll','rows','show','params','keys','intersection','catch','create','body','createdAt','value','find','describe','download','type','uniqueid','root','%s.cypher','decryptFile','join','server/files/screen_recordings','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','error','name','send','map','rawAttributes','fieldName','key','model','differenceBy','format','query','attributes','fields','length'];(function(_0x1157ba,_0x11f61e){var _0x2221eb=function(_0x1735c1){while(--_0x1735c1){_0x1157ba['push'](_0x1157ba['shift']());}};_0x2221eb(++_0x11f61e);}(_0x4ded,0xf8));var _0xd4de=function(_0x2e3bd1,_0x24df30){_0x2e3bd1=_0x2e3bd1-0x0;var _0x40dbd3=_0x4ded[_0x2e3bd1];return _0x40dbd3;};'use strict';var pdf=require(_0xd4de('0x0'));var emlformat=require(_0xd4de('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd4de('0x2'));var rp=require(_0xd4de('0x3'));var moment=require(_0xd4de('0x4'));var BPromise=require(_0xd4de('0x5'));var Mustache=require(_0xd4de('0x6'));var util=require(_0xd4de('0x7'));var path=require(_0xd4de('0x8'));var sox=require(_0xd4de('0x9'));var csv=require(_0xd4de('0xa'));var ejs=require(_0xd4de('0xb'));var fs=require('fs');var _=require(_0xd4de('0xc'));var squel=require(_0xd4de('0xd'));var crypto=require('crypto');var jsforce=require(_0xd4de('0xe'));var deskjs=require(_0xd4de('0xf'));var toCsv=require(_0xd4de('0xa'));var querystring=require(_0xd4de('0x10'));var Papa=require('papaparse');var Redis=require(_0xd4de('0x11'));var authService=require(_0xd4de('0x12'));var qs=require(_0xd4de('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4de('0x14'));var logger=require(_0xd4de('0x15'))('api');var utils=require(_0xd4de('0x16'));var config=require(_0xd4de('0x17'));var db=require(_0xd4de('0x18'))['db'];function respondWithStatusCode(_0x49c4c1,_0x346808){_0x346808=_0x346808||0xcc;return function(_0x465d1c){if(_0x465d1c){return _0x49c4c1['sendStatus'](_0x346808);}return _0x49c4c1[_0xd4de('0x19')](_0x346808)[_0xd4de('0x1a')]();};}function respondWithResult(_0x3ccef4,_0x1bdb84){_0x1bdb84=_0x1bdb84||0xc8;return function(_0x56896e){if(_0x56896e){return _0x3ccef4[_0xd4de('0x19')](_0x1bdb84)['json'](_0x56896e);}};}function respondWithFilteredResult(_0x4464f9,_0x4ae364){return function(_0x3aa4f2){if(_0x3aa4f2){var _0x5e5ce7=_0x3aa4f2[_0xd4de('0x1b')],_0x2720b7=_0x4ae364[_0xd4de('0x1c')],_0x5091e4=_0x4ae364[_0xd4de('0x1c')]+_0x4ae364[_0xd4de('0x1d')],_0x2180bf;if(_0x5091e4>=_0x5e5ce7){_0x5091e4=_0x5e5ce7;_0x2180bf=0xc8;}else{_0x2180bf=0xce;}_0x4464f9[_0xd4de('0x19')](_0x2180bf);return _0x4464f9[_0xd4de('0x1e')](_0xd4de('0x1f'),_0x2720b7+'-'+_0x5091e4+'/'+_0x5e5ce7)[_0xd4de('0x20')](_0x3aa4f2);}return null;};}function patchUpdates(_0x226ecd){return function(_0x425e1c){try{jsonpatch[_0xd4de('0x21')](_0x425e1c,_0x226ecd,!![]);}catch(_0x41984d){return BPromise[_0xd4de('0x22')](_0x41984d);}return _0x425e1c[_0xd4de('0x23')]();};}function saveUpdates(_0x100b68,_0x25f044){return function(_0x198584){if(_0x198584){return _0x198584[_0xd4de('0x24')](_0x100b68)['then'](function(_0x45adc4){return _0x45adc4;});}return null;};}function removeEntity(_0x1066be,_0x77d72f){return function(_0xe02907){if(_0xe02907){return _0xe02907[_0xd4de('0x25')]()['then'](function(){_0x1066be[_0xd4de('0x19')](0xcc)[_0xd4de('0x1a')]();});}};}function handleEntityNotFound(_0x1f5538,_0x52359c){return function(_0x51afd5){if(!_0x51afd5){_0x1f5538['sendStatus'](0x194);}return _0x51afd5;};}function handleError(_0x21433f,_0x4ba5d8){_0x4ba5d8=_0x4ba5d8||0x1f4;return function(_0x322c2a){logger[_0xd4de('0x26')](_0x322c2a['stack']);if(_0x322c2a[_0xd4de('0x27')]){delete _0x322c2a[_0xd4de('0x27')];}_0x21433f[_0xd4de('0x19')](_0x4ba5d8)[_0xd4de('0x28')](_0x322c2a);};}exports['index']=function(_0x3ce2f4,_0x44dcda){var _0x304572={},_0x3b51eb={},_0x3e9b65={'count':0x0,'rows':[]};var _0x480525=_[_0xd4de('0x29')](db['ScreenRecording'][_0xd4de('0x2a')],function(_0x2a248a){return{'name':_0x2a248a[_0xd4de('0x2b')],'type':_0x2a248a['type'][_0xd4de('0x2c')]};});_0x3b51eb[_0xd4de('0x2d')]=_[_0xd4de('0x2e')](_[_0xd4de('0x29')](_0x480525,_0xd4de('0x27')),[_0xd4de('0x2f')]);_0x3b51eb[_0xd4de('0x30')]=_['keys'](_0x3ce2f4[_0xd4de('0x30')]);_0x3b51eb['filters']=_['intersection'](_0x3b51eb[_0xd4de('0x2d')],_0x3b51eb['query']);_0x304572[_0xd4de('0x31')]=_['intersection'](_0x3b51eb['model'],qs[_0xd4de('0x32')](_0x3ce2f4['query']['fields']));_0x304572[_0xd4de('0x31')]=_0x304572[_0xd4de('0x31')][_0xd4de('0x33')]?_0x304572[_0xd4de('0x31')]:_0x3b51eb[_0xd4de('0x2d')];if(!_0x3ce2f4['query'][_0xd4de('0x34')]('nolimit')){_0x304572[_0xd4de('0x1d')]=qs['limit'](_0x3ce2f4[_0xd4de('0x30')][_0xd4de('0x1d')]);_0x304572[_0xd4de('0x1c')]=qs[_0xd4de('0x1c')](_0x3ce2f4[_0xd4de('0x30')]['offset']);}_0x304572[_0xd4de('0x35')]=qs[_0xd4de('0x36')](_0x3ce2f4['query']['sort']);_0x304572[_0xd4de('0x37')]=qs[_0xd4de('0x38')](_[_0xd4de('0x39')](_0x3ce2f4[_0xd4de('0x30')],_0x3b51eb[_0xd4de('0x38')]));if(_0x3ce2f4[_0xd4de('0x30')][_0xd4de('0x3a')]){_0x304572[_0xd4de('0x37')]=_[_0xd4de('0x3b')](_0x304572['where'],{'$or':_[_0xd4de('0x29')](_0x480525,function(_0x570769){if(_0x570769['type']!=='VIRTUAL'){var _0x367936={};_0x367936[_0x570769[_0xd4de('0x27')]]={'$like':'%'+_0x3ce2f4[_0xd4de('0x30')][_0xd4de('0x3a')]+'%'};return _0x367936;}})});}_0x304572=_[_0xd4de('0x3b')]({},_0x304572,_0x3ce2f4[_0xd4de('0x3c')]);var _0x33d903={'where':_0x304572[_0xd4de('0x37')]};return db[_0xd4de('0x3d')]['count'](_0x33d903)[_0xd4de('0x3e')](function(_0x21f3e9){_0x3e9b65[_0xd4de('0x1b')]=_0x21f3e9;if(_0x3ce2f4[_0xd4de('0x30')][_0xd4de('0x3f')]){_0x304572['include']=[{'all':!![]}];}return db[_0xd4de('0x3d')][_0xd4de('0x40')](_0x304572);})[_0xd4de('0x3e')](function(_0x4b9147){_0x3e9b65[_0xd4de('0x41')]=_0x4b9147;return _0x3e9b65;})[_0xd4de('0x3e')](respondWithFilteredResult(_0x44dcda,_0x304572))['catch'](handleError(_0x44dcda,null));};exports[_0xd4de('0x42')]=function(_0xac1976,_0x1ee827){var _0x4775e6={'raw':![],'where':{'id':_0xac1976[_0xd4de('0x43')]['id']}},_0x12aea5={};_0x12aea5[_0xd4de('0x2d')]=_[_0xd4de('0x44')](db[_0xd4de('0x3d')][_0xd4de('0x2a')]);_0x12aea5[_0xd4de('0x30')]=_[_0xd4de('0x44')](_0xac1976['query']);_0x12aea5[_0xd4de('0x38')]=_['intersection'](_0x12aea5[_0xd4de('0x2d')],_0x12aea5[_0xd4de('0x30')]);_0x4775e6[_0xd4de('0x31')]=_[_0xd4de('0x45')](_0x12aea5['model'],qs['fields'](_0xac1976[_0xd4de('0x30')][_0xd4de('0x32')]));_0x4775e6[_0xd4de('0x31')]=_0x4775e6['attributes'][_0xd4de('0x33')]?_0x4775e6[_0xd4de('0x31')]:_0x12aea5[_0xd4de('0x2d')];if(_0xac1976[_0xd4de('0x30')]['includeAll']){_0x4775e6['include']=[{'all':!![]}];}_0x4775e6=_[_0xd4de('0x3b')]({},_0x4775e6,_0xac1976['options']);return db[_0xd4de('0x3d')]['find'](_0x4775e6)[_0xd4de('0x3e')](handleEntityNotFound(_0x1ee827,null))[_0xd4de('0x3e')](respondWithResult(_0x1ee827,null))[_0xd4de('0x46')](handleError(_0x1ee827,null));};exports[_0xd4de('0x47')]=function(_0x254c7e,_0x42a029){return db[_0xd4de('0x3d')][_0xd4de('0x47')](_0x254c7e['body'],{})[_0xd4de('0x3e')](respondWithResult(_0x42a029,0xc9))[_0xd4de('0x46')](handleError(_0x42a029,null));};exports[_0xd4de('0x24')]=function(_0x3d7710,_0x42a812){if(_0x3d7710['body']['id']){delete _0x3d7710[_0xd4de('0x48')]['id'];}delete _0x3d7710[_0xd4de('0x48')]['duration'];delete _0x3d7710[_0xd4de('0x48')][_0xd4de('0x49')];delete _0x3d7710[_0xd4de('0x48')]['closedAt'];delete _0x3d7710[_0xd4de('0x48')][_0xd4de('0x4a')];return db[_0xd4de('0x3d')][_0xd4de('0x4b')]({'where':{'id':_0x3d7710[_0xd4de('0x43')]['id']}})[_0xd4de('0x3e')](handleEntityNotFound(_0x42a812,null))[_0xd4de('0x3e')](saveUpdates(_0x3d7710['body'],null))['then'](respondWithResult(_0x42a812,null))[_0xd4de('0x46')](handleError(_0x42a812,null));};exports[_0xd4de('0x4c')]=function(_0x2c23d4,_0x15f3b5){return db['ScreenRecording']['describe']()[_0xd4de('0x3e')](respondWithResult(_0x15f3b5,null))[_0xd4de('0x46')](handleError(_0x15f3b5,null));};exports[_0xd4de('0x4d')]=function(_0x18d859,_0x2d30fe,_0x19f621){var _0x42d0c7=require('../../components/encryptor');var _0x511610=![];var _0x137cda={};if(_0x18d859[_0xd4de('0x30')]['type']&&_0x18d859[_0xd4de('0x30')][_0xd4de('0x4e')]==='uniqueid'){_0x137cda[_0xd4de('0x4f')]=_0x18d859['params']['id'];}else{_0x137cda['id']=_0x18d859[_0xd4de('0x43')]['id'];}return db[_0xd4de('0x3d')][_0xd4de('0x4b')]({'where':_0x137cda,'attributes':['id',_0xd4de('0x4a')],'raw':!![]})[_0xd4de('0x3e')](handleEntityNotFound(_0x2d30fe,null))[_0xd4de('0x3e')](function(_0x381b81){if(_0x381b81){var _0x60336=path['join'](config[_0xd4de('0x50')],'server/files/screen_recordings',_0x381b81[_0xd4de('0x4a')]);var _0x4ca990=util['format'](_0xd4de('0x51'),_0x60336);if(fs['existsSync'](_0x4ca990)){_0x511610=!![];return _0x42d0c7[_0xd4de('0x52')](_0x4ca990,_0x60336,config['secrets']['recording'])[_0xd4de('0x3e')](function(){return _0x381b81;});}return _0x381b81;}})['then'](function(_0x57c58c){if(_0x57c58c){var _0x2f0339=path[_0xd4de('0x53')](config[_0xd4de('0x50')],_0xd4de('0x54'),_0x57c58c[_0xd4de('0x4a')]);if(!fs[_0xd4de('0x55')](_0x2f0339)){throw new db[(_0xd4de('0x56'))][(_0xd4de('0x57'))](_0xd4de('0x58'));}if(_0x57c58c['filename']){return _0x2d30fe[_0xd4de('0x4d')](_0x2f0339,_0x57c58c[_0xd4de('0x59')]+path['extname'](_0x2f0339),function(){if(_0x511610){fs['unlink'](_0x2f0339);}});}else{return _0x2d30fe[_0xd4de('0x4d')](_0x2f0339,function(_0x48a942){if(_0x511610){fs[_0xd4de('0x5a')](_0x2f0339);}});}}})[_0xd4de('0x46')](function(_0x3e9ee9){if(_0x3e9ee9[_0xd4de('0x5b')]===_0xd4de('0x58')){_0x2d30fe[_0xd4de('0x19')](0x194)[_0xd4de('0x28')](_0xd4de('0x5c'));}else{return handleError(_0x2d30fe,null);}});};exports[_0xd4de('0x25')]=function(_0x5d953c,_0x2acb64){return db[_0xd4de('0x3d')][_0xd4de('0x4b')]({'where':{'id':_0x5d953c[_0xd4de('0x43')]['id']}})['then'](function(_0x4317a4){if(!_0x4317a4)throw new ReferenceError(_0xd4de('0x5d'));return _0x4317a4;})[_0xd4de('0x3e')](function(_0x19f68d){var _0x9f3ae6=path[_0xd4de('0x53')](config[_0xd4de('0x50')],_0xd4de('0x54'),_0x19f68d[_0xd4de('0x4a')]);logger[_0xd4de('0x5e')](_0xd4de('0x5f'),_0x9f3ae6);if(!_[_0xd4de('0x60')](_0x19f68d[_0xd4de('0x4a')])&&fs[_0xd4de('0x55')](_0x9f3ae6)){logger[_0xd4de('0x5e')]('File:\x20\x22'+_0x9f3ae6+_0xd4de('0x61'));fs[_0xd4de('0x62')](_0x9f3ae6);}_0x9f3ae6=_0x9f3ae6+'.cypher';if(!_['isNil'](_0x19f68d[_0xd4de('0x4a')])&&fs[_0xd4de('0x55')](_0x9f3ae6)){logger[_0xd4de('0x5e')](_0xd4de('0x63')+_0x9f3ae6+_0xd4de('0x61'));fs['unlinkSync'](_0x9f3ae6);}return _0x19f68d;})['then'](function(_0x221def){if(!_0x221def)throw new InternalError();return _0x221def[_0xd4de('0x25')]();})[_0xd4de('0x3e')](function(){_0x2acb64[_0xd4de('0x19')](0xcc)[_0xd4de('0x1a')]();})[_0xd4de('0x46')](handleError(_0x2acb64,null));}; \ No newline at end of file +var _0xd0d4=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','format','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','keys','include','create','body','duration','createdAt','closedAt','find','params','describe','download','../../components/encryptor','uniqueid','value','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','root','ValidationError','ScreenRecording\x20not\x20found','filename','message','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x16db18,_0x43fd3f){var _0x48cc3a=function(_0x4711a9){while(--_0x4711a9){_0x16db18['push'](_0x16db18['shift']());}};_0x48cc3a(++_0x43fd3f);}(_0xd0d4,0xc1));var _0x4d0d=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xd0d4[_0x8c43de];return _0xa6591b;};'use strict';var pdf=require(_0x4d0d('0x0'));var emlformat=require(_0x4d0d('0x1'));var rimraf=require(_0x4d0d('0x2'));var zipdir=require(_0x4d0d('0x3'));var jsonpatch=require(_0x4d0d('0x4'));var rp=require(_0x4d0d('0x5'));var moment=require(_0x4d0d('0x6'));var BPromise=require(_0x4d0d('0x7'));var Mustache=require(_0x4d0d('0x8'));var util=require(_0x4d0d('0x9'));var path=require('path');var sox=require(_0x4d0d('0xa'));var csv=require('to-csv');var ejs=require(_0x4d0d('0xb'));var fs=require('fs');var _=require(_0x4d0d('0xc'));var squel=require(_0x4d0d('0xd'));var crypto=require('crypto');var jsforce=require(_0x4d0d('0xe'));var deskjs=require(_0x4d0d('0xf'));var toCsv=require(_0x4d0d('0x10'));var querystring=require(_0x4d0d('0x11'));var Papa=require(_0x4d0d('0x12'));var Redis=require(_0x4d0d('0x13'));var authService=require(_0x4d0d('0x14'));var qs=require(_0x4d0d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d0d('0x16'));var logger=require(_0x4d0d('0x17'))('api');var utils=require(_0x4d0d('0x18'));var config=require(_0x4d0d('0x19'));var db=require(_0x4d0d('0x1a'))['db'];function respondWithStatusCode(_0x134b0c,_0x5d652a){_0x5d652a=_0x5d652a||0xcc;return function(_0x52ed03){if(_0x52ed03){return _0x134b0c['sendStatus'](_0x5d652a);}return _0x134b0c[_0x4d0d('0x1b')](_0x5d652a)['end']();};}function respondWithResult(_0x450ae8,_0x138385){_0x138385=_0x138385||0xc8;return function(_0x1c2bb6){if(_0x1c2bb6){return _0x450ae8[_0x4d0d('0x1b')](_0x138385)[_0x4d0d('0x1c')](_0x1c2bb6);}};}function respondWithFilteredResult(_0x5be758,_0x43f4d1){return function(_0x5b5549){if(_0x5b5549){var _0x313db0=_0x5b5549[_0x4d0d('0x1d')],_0x5518fe=_0x43f4d1[_0x4d0d('0x1e')],_0x233010=_0x43f4d1[_0x4d0d('0x1e')]+_0x43f4d1[_0x4d0d('0x1f')],_0x3f7992;if(_0x233010>=_0x313db0){_0x233010=_0x313db0;_0x3f7992=0xc8;}else{_0x3f7992=0xce;}_0x5be758[_0x4d0d('0x1b')](_0x3f7992);return _0x5be758[_0x4d0d('0x20')](_0x4d0d('0x21'),_0x5518fe+'-'+_0x233010+'/'+_0x313db0)['json'](_0x5b5549);}return null;};}function patchUpdates(_0x5381b2){return function(_0x546825){try{jsonpatch[_0x4d0d('0x22')](_0x546825,_0x5381b2,!![]);}catch(_0x2c8568){return BPromise[_0x4d0d('0x23')](_0x2c8568);}return _0x546825[_0x4d0d('0x24')]();};}function saveUpdates(_0x118a9a,_0x56cb78){return function(_0x45ddd1){if(_0x45ddd1){return _0x45ddd1[_0x4d0d('0x25')](_0x118a9a)['then'](function(_0x471e88){return _0x471e88;});}return null;};}function removeEntity(_0x4834c6,_0xedc541){return function(_0xb0a3ca){if(_0xb0a3ca){return _0xb0a3ca[_0x4d0d('0x26')]()['then'](function(){_0x4834c6[_0x4d0d('0x1b')](0xcc)[_0x4d0d('0x27')]();});}};}function handleEntityNotFound(_0x5aebfd,_0x3cade7){return function(_0x4b00d8){if(!_0x4b00d8){_0x5aebfd[_0x4d0d('0x28')](0x194);}return _0x4b00d8;};}function handleError(_0x58ce6e,_0x5b7995){_0x5b7995=_0x5b7995||0x1f4;return function(_0x4014fe){logger[_0x4d0d('0x29')](_0x4014fe[_0x4d0d('0x2a')]);if(_0x4014fe[_0x4d0d('0x2b')]){delete _0x4014fe[_0x4d0d('0x2b')];}_0x58ce6e[_0x4d0d('0x1b')](_0x5b7995)[_0x4d0d('0x2c')](_0x4014fe);};}exports[_0x4d0d('0x2d')]=function(_0x548b7f,_0x2f19ad){var _0x5d6e2a={},_0x348848={},_0x48f866={'count':0x0,'rows':[]};var _0x545681=_[_0x4d0d('0x2e')](db[_0x4d0d('0x2f')][_0x4d0d('0x30')],function(_0x2cce9a){return{'name':_0x2cce9a[_0x4d0d('0x31')],'type':_0x2cce9a[_0x4d0d('0x32')][_0x4d0d('0x33')]};});_0x348848[_0x4d0d('0x34')]=_['differenceBy'](_[_0x4d0d('0x2e')](_0x545681,_0x4d0d('0x2b')),[_0x4d0d('0x35')]);_0x348848['query']=_['keys'](_0x548b7f[_0x4d0d('0x36')]);_0x348848['filters']=_[_0x4d0d('0x37')](_0x348848['model'],_0x348848[_0x4d0d('0x36')]);_0x5d6e2a['attributes']=_[_0x4d0d('0x37')](_0x348848[_0x4d0d('0x34')],qs['fields'](_0x548b7f[_0x4d0d('0x36')][_0x4d0d('0x38')]));_0x5d6e2a['attributes']=_0x5d6e2a[_0x4d0d('0x39')][_0x4d0d('0x3a')]?_0x5d6e2a[_0x4d0d('0x39')]:_0x348848[_0x4d0d('0x34')];if(!_0x548b7f[_0x4d0d('0x36')][_0x4d0d('0x3b')](_0x4d0d('0x3c'))){_0x5d6e2a['limit']=qs[_0x4d0d('0x1f')](_0x548b7f[_0x4d0d('0x36')][_0x4d0d('0x1f')]);_0x5d6e2a[_0x4d0d('0x1e')]=qs[_0x4d0d('0x1e')](_0x548b7f[_0x4d0d('0x36')][_0x4d0d('0x1e')]);}_0x5d6e2a[_0x4d0d('0x3d')]=qs['sort'](_0x548b7f[_0x4d0d('0x36')][_0x4d0d('0x3e')]);_0x5d6e2a[_0x4d0d('0x3f')]=qs[_0x4d0d('0x40')](_[_0x4d0d('0x41')](_0x548b7f['query'],_0x348848[_0x4d0d('0x40')]));if(_0x548b7f[_0x4d0d('0x36')]['filter']){_0x5d6e2a[_0x4d0d('0x3f')]=_[_0x4d0d('0x42')](_0x5d6e2a[_0x4d0d('0x3f')],{'$or':_['map'](_0x545681,function(_0x574c8f){if(_0x574c8f[_0x4d0d('0x32')]!==_0x4d0d('0x43')){var _0x2748b4={};_0x2748b4[_0x574c8f['name']]={'$like':'%'+_0x548b7f[_0x4d0d('0x36')]['filter']+'%'};return _0x2748b4;}})});}_0x5d6e2a=_[_0x4d0d('0x42')]({},_0x5d6e2a,_0x548b7f[_0x4d0d('0x44')]);var _0x56ab5a={'where':_0x5d6e2a[_0x4d0d('0x3f')]};return db[_0x4d0d('0x2f')][_0x4d0d('0x1d')](_0x56ab5a)[_0x4d0d('0x45')](function(_0x41e6d1){_0x48f866['count']=_0x41e6d1;if(_0x548b7f['query'][_0x4d0d('0x46')]){_0x5d6e2a['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x4d0d('0x47')](_0x5d6e2a);})[_0x4d0d('0x45')](function(_0x354209){_0x48f866[_0x4d0d('0x48')]=_0x354209;return _0x48f866;})[_0x4d0d('0x45')](respondWithFilteredResult(_0x2f19ad,_0x5d6e2a))[_0x4d0d('0x49')](handleError(_0x2f19ad,null));};exports[_0x4d0d('0x4a')]=function(_0x341863,_0x31fb4e){var _0x3c0871={'raw':![],'where':{'id':_0x341863['params']['id']}},_0x5bae49={};_0x5bae49['model']=_[_0x4d0d('0x4b')](db[_0x4d0d('0x2f')][_0x4d0d('0x30')]);_0x5bae49[_0x4d0d('0x36')]=_['keys'](_0x341863[_0x4d0d('0x36')]);_0x5bae49[_0x4d0d('0x40')]=_[_0x4d0d('0x37')](_0x5bae49[_0x4d0d('0x34')],_0x5bae49[_0x4d0d('0x36')]);_0x3c0871['attributes']=_[_0x4d0d('0x37')](_0x5bae49['model'],qs[_0x4d0d('0x38')](_0x341863[_0x4d0d('0x36')]['fields']));_0x3c0871[_0x4d0d('0x39')]=_0x3c0871[_0x4d0d('0x39')]['length']?_0x3c0871[_0x4d0d('0x39')]:_0x5bae49[_0x4d0d('0x34')];if(_0x341863[_0x4d0d('0x36')][_0x4d0d('0x46')]){_0x3c0871[_0x4d0d('0x4c')]=[{'all':!![]}];}_0x3c0871=_[_0x4d0d('0x42')]({},_0x3c0871,_0x341863[_0x4d0d('0x44')]);return db[_0x4d0d('0x2f')]['find'](_0x3c0871)[_0x4d0d('0x45')](handleEntityNotFound(_0x31fb4e,null))[_0x4d0d('0x45')](respondWithResult(_0x31fb4e,null))['catch'](handleError(_0x31fb4e,null));};exports[_0x4d0d('0x4d')]=function(_0x1c81ad,_0x3703e0){return db[_0x4d0d('0x2f')][_0x4d0d('0x4d')](_0x1c81ad['body'],{})[_0x4d0d('0x45')](respondWithResult(_0x3703e0,0xc9))['catch'](handleError(_0x3703e0,null));};exports[_0x4d0d('0x25')]=function(_0x3b7f86,_0xc72820){if(_0x3b7f86[_0x4d0d('0x4e')]['id']){delete _0x3b7f86[_0x4d0d('0x4e')]['id'];}delete _0x3b7f86[_0x4d0d('0x4e')][_0x4d0d('0x4f')];delete _0x3b7f86[_0x4d0d('0x4e')][_0x4d0d('0x50')];delete _0x3b7f86['body'][_0x4d0d('0x51')];delete _0x3b7f86[_0x4d0d('0x4e')]['value'];return db['ScreenRecording'][_0x4d0d('0x52')]({'where':{'id':_0x3b7f86[_0x4d0d('0x53')]['id']}})[_0x4d0d('0x45')](handleEntityNotFound(_0xc72820,null))['then'](saveUpdates(_0x3b7f86['body'],null))[_0x4d0d('0x45')](respondWithResult(_0xc72820,null))[_0x4d0d('0x49')](handleError(_0xc72820,null));};exports[_0x4d0d('0x54')]=function(_0x36439c,_0x110448){return db[_0x4d0d('0x2f')][_0x4d0d('0x54')]()['then'](respondWithResult(_0x110448,null))['catch'](handleError(_0x110448,null));};exports[_0x4d0d('0x55')]=function(_0x27c5dc,_0x354e77,_0x2508aa){var _0xf0066a=require(_0x4d0d('0x56'));var _0x48ce77=![];var _0x12c557={};if(_0x27c5dc[_0x4d0d('0x36')][_0x4d0d('0x32')]&&_0x27c5dc['query']['type']===_0x4d0d('0x57')){_0x12c557[_0x4d0d('0x57')]=_0x27c5dc[_0x4d0d('0x53')]['id'];}else{_0x12c557['id']=_0x27c5dc[_0x4d0d('0x53')]['id'];}return db[_0x4d0d('0x2f')]['find']({'where':_0x12c557,'attributes':['id',_0x4d0d('0x58')],'raw':!![]})[_0x4d0d('0x45')](handleEntityNotFound(_0x354e77,null))['then'](function(_0x51396f){if(_0x51396f){var _0x193022=path[_0x4d0d('0x59')](config['root'],_0x4d0d('0x5a'),_0x51396f[_0x4d0d('0x58')]);var _0x5111c0=util[_0x4d0d('0x35')](_0x4d0d('0x5b'),_0x193022);if(fs[_0x4d0d('0x5c')](_0x5111c0)){_0x48ce77=!![];return _0xf0066a[_0x4d0d('0x5d')](_0x5111c0,_0x193022,config['secrets']['recording'])[_0x4d0d('0x45')](function(){return _0x51396f;});}return _0x51396f;}})[_0x4d0d('0x45')](function(_0x2d4f5c){if(_0x2d4f5c){var _0x41aae8=path[_0x4d0d('0x59')](config[_0x4d0d('0x5e')],_0x4d0d('0x5a'),_0x2d4f5c[_0x4d0d('0x58')]);if(!fs[_0x4d0d('0x5c')](_0x41aae8)){throw new db['Sequelize'][(_0x4d0d('0x5f'))](_0x4d0d('0x60'));}if(_0x2d4f5c[_0x4d0d('0x61')]){return _0x354e77['download'](_0x41aae8,_0x2d4f5c[_0x4d0d('0x61')]+path['extname'](_0x41aae8),function(){if(_0x48ce77){fs['unlink'](_0x41aae8);}});}else{return _0x354e77[_0x4d0d('0x55')](_0x41aae8,function(_0x3074ec){if(_0x48ce77){fs['unlink'](_0x41aae8);}});}}})[_0x4d0d('0x49')](function(_0x1a5d9f){if(_0x1a5d9f[_0x4d0d('0x62')]===_0x4d0d('0x60')){_0x354e77[_0x4d0d('0x1b')](0x194)[_0x4d0d('0x2c')]('Not\x20found');}else{return handleError(_0x354e77,null);}});};exports[_0x4d0d('0x26')]=function(_0x16f622,_0x55d655){return db[_0x4d0d('0x2f')][_0x4d0d('0x52')]({'where':{'id':_0x16f622[_0x4d0d('0x53')]['id']}})['then'](function(_0x3d55e6){if(!_0x3d55e6)throw new ReferenceError(_0x4d0d('0x63'));return _0x3d55e6;})[_0x4d0d('0x45')](function(_0x290d37){var _0x2f0599=path['join'](config['root'],_0x4d0d('0x5a'),_0x290d37[_0x4d0d('0x58')]);logger[_0x4d0d('0x64')](_0x4d0d('0x65'),_0x2f0599);if(!_['isNil'](_0x290d37['value'])&&fs['existsSync'](_0x2f0599)){logger['info'](_0x4d0d('0x66')+_0x2f0599+_0x4d0d('0x67'));fs[_0x4d0d('0x68')](_0x2f0599);}_0x2f0599=_0x2f0599+_0x4d0d('0x69');if(!_[_0x4d0d('0x6a')](_0x290d37[_0x4d0d('0x58')])&&fs[_0x4d0d('0x5c')](_0x2f0599)){logger[_0x4d0d('0x64')](_0x4d0d('0x66')+_0x2f0599+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x4d0d('0x68')](_0x2f0599);}return _0x290d37;})[_0x4d0d('0x45')](function(_0x23706a){if(!_0x23706a)throw new InternalError();return _0x23706a['destroy']();})['then'](function(){_0x55d655['status'](0xcc)['end']();})['catch'](handleError(_0x55d655,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index fc38572..0246eaf 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 _0x3314=['path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x111cd1,_0x22d5c2){var _0x5b7fe0=function(_0x9aaa05){while(--_0x9aaa05){_0x111cd1['push'](_0x111cd1['shift']());}};_0x5b7fe0(++_0x22d5c2);}(_0x3314,0x117));var _0x4331=function(_0x16adb1,_0x12ab49){_0x16adb1=_0x16adb1-0x0;var _0x4e6dec=_0x3314[_0x16adb1];return _0x4e6dec;};'use strict';var _=require(_0x4331('0x0'));var util=require(_0x4331('0x1'));var logger=require(_0x4331('0x2'))(_0x4331('0x3'));var moment=require('moment');var BPromise=require(_0x4331('0x4'));var rp=require(_0x4331('0x5'));var fs=require('fs');var path=require(_0x4331('0x6'));var rimraf=require(_0x4331('0x7'));var config=require(_0x4331('0x8'));var attributes=require(_0x4331('0x9'));module[_0x4331('0xa')]=function(_0x19aa41,_0x4b77fc){return _0x19aa41[_0x4331('0xb')](_0x4331('0xc'),attributes,{'tableName':_0x4331('0xd'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x4331('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4692=['request-promise','path','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','moment'];(function(_0x4794b5,_0x34efd1){var _0x1ff218=function(_0x1dd96f){while(--_0x1dd96f){_0x4794b5['push'](_0x4794b5['shift']());}};_0x1ff218(++_0x34efd1);}(_0x4692,0x127));var _0x2469=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4692[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2469('0x0'));var util=require(_0x2469('0x1'));var logger=require(_0x2469('0x2'))('api');var moment=require(_0x2469('0x3'));var BPromise=require('bluebird');var rp=require(_0x2469('0x4'));var fs=require('fs');var path=require(_0x2469('0x5'));var rimraf=require('rimraf');var config=require(_0x2469('0x6'));var attributes=require(_0x2469('0x7'));module[_0x2469('0x8')]=function(_0x136b2e,_0x4acad9){return _0x136b2e[_0x2469('0x9')](_0x2469('0xa'),attributes,{'tableName':_0x2469('0xb'),'paranoid':![],'indexes':[{'name':_0x2469('0xc'),'fields':[_0x2469('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 7e216a0..6cb8a66 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(_0x46a836,_0x1ffde8){var _0x5bdd13=function(_0x2f2da9){while(--_0x2f2da9){_0x46a836['push'](_0x46a836['shift']());}};_0x5bdd13(++_0x1ffde8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x3ec216,_0x323b28){var _0x356863=function(_0x2602e0){while(--_0x2602e0){_0x3ec216['push'](_0x3ec216['shift']());}};_0x356863(++_0x323b28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 e030562..8a0dbaf 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 _0x58fe=['post','single','file','addLogoLogin','addPreferred','favicon','addFavicon','/:id','isAuthenticated','update','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','index','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getFavicon','diskStorage','join','root','format','%s%s','logo','extname','originalname','/:id/logo','server/files/images/logos/','logologin'];(function(_0x455d82,_0x1953c){var _0x19c5b2=function(_0x2ce3e2){while(--_0x2ce3e2){_0x455d82['push'](_0x455d82['shift']());}};_0x19c5b2(++_0x1953c);}(_0x58fe,0x145));var _0xe58f=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0x58fe[_0x3dc538];return _0x72c2fd;};'use strict';var multer=require(_0xe58f('0x0'));var util=require(_0xe58f('0x1'));var path=require(_0xe58f('0x2'));var timeout=require(_0xe58f('0x3'));var express=require(_0xe58f('0x4'));var router=express['Router']();var auth=require(_0xe58f('0x5'));var interaction=require(_0xe58f('0x6'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0xe58f('0x7')]('/',auth['isAuthenticated'](),controller[_0xe58f('0x8')]);router['get']('/:id',controller['show']);router[_0xe58f('0x7')]('/:id/logo',controller['getLogo']);router[_0xe58f('0x7')](_0xe58f('0x9'),controller[_0xe58f('0xa')]);router[_0xe58f('0x7')]('/:id/gdpr',controller[_0xe58f('0xb')]);router['get'](_0xe58f('0xc'),controller['getPreferred']);router[_0xe58f('0x7')]('/:id/favicon',controller[_0xe58f('0xd')]);var upload=multer({'storage':multer[_0xe58f('0xe')]({'destination':function(_0x392e22,_0x1ae84d,_0x45d6de){_0x45d6de(null,path[_0xe58f('0xf')](config[_0xe58f('0x10')],'server/files/images/logos/'));},'filename':function(_0x1c3feb,_0x29625f,_0x35879b){_0x35879b(null,util[_0xe58f('0x11')](_0xe58f('0x12'),_0xe58f('0x13'),path[_0xe58f('0x14')](_0x29625f[_0xe58f('0x15')])));}})});router['post'](_0xe58f('0x16'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xe58f('0xe')]({'destination':function(_0x612bfc,_0xe350f7,_0x18df69){_0x18df69(null,path[_0xe58f('0xf')](config[_0xe58f('0x10')],_0xe58f('0x17')));},'filename':function(_0x162080,_0x576728,_0x3ea330){_0x3ea330(null,util['format'](_0xe58f('0x12'),_0xe58f('0x18'),path[_0xe58f('0x14')](_0x576728[_0xe58f('0x15')])));}})});router[_0xe58f('0x19')]('/:id/logo_login',upload[_0xe58f('0x1a')](_0xe58f('0x1b')),controller[_0xe58f('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc97d18,_0x1dc85e,_0x5ea298){_0x5ea298(null,path[_0xe58f('0xf')](config[_0xe58f('0x10')],_0xe58f('0x17')));},'filename':function(_0x3eb6ce,_0x519c2b,_0x1906ec){_0x1906ec(null,util[_0xe58f('0x11')](_0xe58f('0x12'),'preferred',path[_0xe58f('0x14')](_0x519c2b[_0xe58f('0x15')])));}})});router[_0xe58f('0x19')]('/:id/preferred',upload[_0xe58f('0x1a')](_0xe58f('0x1b')),controller[_0xe58f('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xad30f4,_0x6e6177,_0x5e9b72){_0x5e9b72(null,path['join'](config[_0xe58f('0x10')],_0xe58f('0x17')));},'filename':function(_0x460eea,_0x2c430e,_0x1aaf1d){_0x1aaf1d(null,util['format'](_0xe58f('0x12'),_0xe58f('0x1e'),path[_0xe58f('0x14')](_0x2c430e[_0xe58f('0x15')])));}})});router[_0xe58f('0x19')]('/:id/favicon',upload['single'](_0xe58f('0x1b')),controller[_0xe58f('0x1f')]);router['put'](_0xe58f('0x20'),auth[_0xe58f('0x21')](),controller[_0xe58f('0x22')]);module['exports']=router; \ No newline at end of file +var _0x2223=['../../components/interaction/service','./setting.controller','isAuthenticated','get','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','logo','extname','originalname','post','single','file','addLogo','join','%s%s','logologin','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','addFavicon','put','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xef49e,_0x297a45){var _0x1d753f=function(_0x3e9e37){while(--_0x3e9e37){_0xef49e['push'](_0xef49e['shift']());}};_0x1d753f(++_0x297a45);}(_0x2223,0x120));var _0x3222=function(_0xd0ebc9,_0x27f887){_0xd0ebc9=_0xd0ebc9-0x0;var _0x3d57c3=_0x2223[_0xd0ebc9];return _0x3d57c3;};'use strict';var multer=require('multer');var util=require(_0x3222('0x0'));var path=require(_0x3222('0x1'));var timeout=require(_0x3222('0x2'));var express=require(_0x3222('0x3'));var router=express[_0x3222('0x4')]();var auth=require(_0x3222('0x5'));var interaction=require(_0x3222('0x6'));var config=require('../../config/environment');var controller=require(_0x3222('0x7'));router['get']('/',auth[_0x3222('0x8')](),controller['index']);router[_0x3222('0x9')](_0x3222('0xa'),controller[_0x3222('0xb')]);router[_0x3222('0x9')](_0x3222('0xc'),controller[_0x3222('0xd')]);router[_0x3222('0x9')](_0x3222('0xe'),controller[_0x3222('0xf')]);router[_0x3222('0x9')]('/:id/gdpr',controller[_0x3222('0x10')]);router[_0x3222('0x9')]('/:id/preferred',controller['getPreferred']);router['get'](_0x3222('0x11'),controller[_0x3222('0x12')]);var upload=multer({'storage':multer[_0x3222('0x13')]({'destination':function(_0x3e6839,_0x525b2c,_0x14bf0e){_0x14bf0e(null,path['join'](config[_0x3222('0x14')],_0x3222('0x15')));},'filename':function(_0x1798e0,_0x371a70,_0x486993){_0x486993(null,util[_0x3222('0x16')]('%s%s',_0x3222('0x17'),path[_0x3222('0x18')](_0x371a70[_0x3222('0x19')])));}})});router[_0x3222('0x1a')](_0x3222('0xc'),upload[_0x3222('0x1b')](_0x3222('0x1c')),controller[_0x3222('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb63ccf,_0x3da91e,_0x2dc9f5){_0x2dc9f5(null,path[_0x3222('0x1e')](config[_0x3222('0x14')],_0x3222('0x15')));},'filename':function(_0x3f2b24,_0xf6a28,_0x423885){_0x423885(null,util[_0x3222('0x16')](_0x3222('0x1f'),_0x3222('0x20'),path[_0x3222('0x18')](_0xf6a28['originalname'])));}})});router[_0x3222('0x1a')](_0x3222('0xe'),upload[_0x3222('0x1b')](_0x3222('0x1c')),controller[_0x3222('0x21')]);var upload=multer({'storage':multer[_0x3222('0x13')]({'destination':function(_0x382280,_0x46d1e5,_0x121deb){_0x121deb(null,path['join'](config[_0x3222('0x14')],_0x3222('0x15')));},'filename':function(_0x58a0d9,_0x292ad9,_0x593943){_0x593943(null,util['format'](_0x3222('0x1f'),_0x3222('0x22'),path['extname'](_0x292ad9[_0x3222('0x19')])));}})});router[_0x3222('0x1a')](_0x3222('0x23'),upload[_0x3222('0x1b')](_0x3222('0x1c')),controller[_0x3222('0x24')]);var upload=multer({'storage':multer[_0x3222('0x13')]({'destination':function(_0x25de06,_0x5ea538,_0x649687){_0x649687(null,path[_0x3222('0x1e')](config[_0x3222('0x14')],_0x3222('0x15')));},'filename':function(_0x56a3c3,_0xc41b03,_0x162cc9){_0x162cc9(null,util['format'](_0x3222('0x1f'),_0x3222('0x25'),path[_0x3222('0x18')](_0xc41b03[_0x3222('0x19')])));}})});router[_0x3222('0x1a')](_0x3222('0x11'),upload[_0x3222('0x1b')]('file'),controller[_0x3222('0x26')]);router[_0x3222('0x27')](_0x3222('0xa'),auth[_0x3222('0x8')](),controller[_0x3222('0x28')]);module[_0x3222('0x29')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 0d3bc65..b77b108 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 _0xbdec=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x1c4b3d,_0xa7428b){var _0x3f19b4=function(_0xc638a5){while(--_0xc638a5){_0x1c4b3d['push'](_0x1c4b3d['shift']());}};_0x3f19b4(++_0xa7428b);}(_0xbdec,0x16a));var _0xcbde=function(_0x3565e3,_0x6f3849){_0x3565e3=_0x3565e3-0x0;var _0x1fc4e3=_0xbdec[_0x3565e3];return _0x1fc4e3;};'use strict';var Sequelize=require(_0xcbde('0x0'));module[_0xcbde('0x1')]={'min_internal':{'type':Sequelize[_0xcbde('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0xcbde('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xcbde('0x4')],'defaultValue':_0xcbde('0x5')},'logo':{'type':Sequelize[_0xcbde('0x4')]},'defaultLogo':{'type':Sequelize[_0xcbde('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xcbde('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0xcbde('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xcbde('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xcbde('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xcbde('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0xcbde('0x4')]},'turnpassword':{'type':Sequelize[_0xcbde('0x4')]},'pageTitle':{'type':Sequelize[_0xcbde('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xcbde('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xcbde('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xcbde('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xcbde('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xcbde('0x4')],'defaultValue':_0xcbde('0x7')},'enableEmailPreview':{'type':Sequelize[_0xcbde('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xcbde('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xcbde('0x4')],'defaultValue':_0xcbde('0x8')},'chatTimeout':{'type':Sequelize[_0xcbde('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xcbde('0x4')]},'defaultPreferred':{'type':Sequelize[_0xcbde('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xcbde('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xcbde('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0xcbde('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xcbde('0x4')]},'defaultFavicon':{'type':Sequelize[_0xcbde('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xcbde('0x2')],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file +var _0x1d16=['INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','sequelize','exports'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x1d16,0x96));var _0x61d1=function(_0x2e7025,_0x187270){_0x2e7025=_0x2e7025-0x0;var _0x5373ed=_0x1d16[_0x2e7025];return _0x5373ed;};'use strict';var Sequelize=require(_0x61d1('0x0'));module[_0x61d1('0x1')]={'min_internal':{'type':Sequelize[_0x61d1('0x2')](0xb),'unique':_0x61d1('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x61d1('0x2')](0xb),'unique':_0x61d1('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x61d1('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x61d1('0x5')],'defaultValue':_0x61d1('0x6')},'logo':{'type':Sequelize[_0x61d1('0x5')]},'defaultLogo':{'type':Sequelize[_0x61d1('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x61d1('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x61d1('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x61d1('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x61d1('0x5')]},'turnaddr':{'type':Sequelize[_0x61d1('0x5')]},'turnusername':{'type':Sequelize[_0x61d1('0x5')]},'turnpassword':{'type':Sequelize[_0x61d1('0x5')]},'pageTitle':{'type':Sequelize[_0x61d1('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x61d1('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x61d1('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x61d1('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x61d1('0x5')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x61d1('0x7')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x61d1('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x61d1('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x61d1('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x61d1('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x61d1('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x61d1('0x5')]},'defaultPreferred':{'type':Sequelize[_0x61d1('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x61d1('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x61d1('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x61d1('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x61d1('0x5')]},'defaultFavicon':{'type':Sequelize[_0x61d1('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x61d1('0x2')],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 29fe65c..567be9c 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 _0xf424=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','save','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','limit','order','sort','where','count','include','findAll','rows','show','params','keys','length','includeAll','options','find','update','body','get','readFileSync','root','server/files/templates/stun.ejs','render','join','server/files/templates/turn.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','logo','filename','loginLogo','../../config/license/util','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower','default_logo.png','default','upperFirst','custom','\x20not\x20found','download','getLogoLogin','server/files/images/logos','default_loginLogo.png','gdpr','getPreferred','favicon','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','lodash','squel','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x108c5f,_0x505e54){var _0x108ed9=function(_0x30d1ae){while(--_0x30d1ae){_0x108c5f['push'](_0x108c5f['shift']());}};_0x108ed9(++_0x505e54);}(_0xf424,0x15d));var _0x4f42=function(_0x2d4340,_0x14bd7f){_0x2d4340=_0x2d4340-0x0;var _0x5a2e9e=_0xf424[_0x2d4340];return _0x5a2e9e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4f42('0x0'));var rimraf=require(_0x4f42('0x1'));var zipdir=require(_0x4f42('0x2'));var jsonpatch=require(_0x4f42('0x3'));var rp=require('request-promise');var moment=require(_0x4f42('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4f42('0x5'));var util=require('util');var path=require(_0x4f42('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4f42('0x7'));var squel=require(_0x4f42('0x8'));var crypto=require('crypto');var jsforce=require(_0x4f42('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x4f42('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4f42('0xb'));var authService=require(_0x4f42('0xc'));var qs=require(_0x4f42('0xd'));var as=require(_0x4f42('0xe'));var hardwareService=require(_0x4f42('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x4f42('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x4f42('0x11'));var client=jayson[_0x4f42('0x12')]['http']({'port':0x232a});function checkPasswordPattern(_0x103c65,_0x16d07a,_0xbb2b70){if(_0xbb2b70){var _0x96bd08=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x96bd08['test'](_0x16d07a)){return _0x103c65;}else{throw new db[(_0x4f42('0x13'))][(_0x4f42('0x14'))](_0x4f42('0x15'));}}else{return _0x103c65;}}function respondWithRpcPromise(_0x4c5596,_0x53cf38,_0x337884,_0x1afa15){return new BPromise(function(_0x3a0c81,_0x4ce2d4){var _0x51cf10=_0x1afa15||client;return _0x51cf10[_0x4f42('0x16')](_0x4c5596,_0x337884)[_0x4f42('0x17')](function(_0x2c5696){logger[_0x4f42('0x18')]('Setting,\x20%s,\x20%s',_0x53cf38,_0x4f42('0x19'));logger[_0x4f42('0x1a')]('Setting,\x20%s,\x20%s,\x20%s',_0x53cf38,_0x4f42('0x19'),JSON[_0x4f42('0x1b')](_0x2c5696));if(_0x2c5696[_0x4f42('0x1c')]){if(_0x2c5696[_0x4f42('0x1c')][_0x4f42('0x1d')]===0x1f4){logger['error'](_0x4f42('0x1e'),_0x53cf38,_0x2c5696['error']['message']);return _0x4ce2d4(_0x2c5696[_0x4f42('0x1c')][_0x4f42('0x1f')]);}logger[_0x4f42('0x1c')]('Setting,\x20%s,\x20%s',_0x53cf38,_0x2c5696['error']['message']);return _0x3a0c81(_0x2c5696['error'][_0x4f42('0x1f')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x53cf38,_0x4f42('0x19'));_0x3a0c81(_0x2c5696[_0x4f42('0x20')][_0x4f42('0x1f')]);}})[_0x4f42('0x21')](function(_0x523ae1){logger[_0x4f42('0x1c')](_0x4f42('0x1e'),_0x53cf38,_0x523ae1);_0x4ce2d4(_0x523ae1);});});}function respondWithStatusCode(_0x536392,_0x5d1b1d){_0x5d1b1d=_0x5d1b1d||0xcc;return function(_0x1d2d89){if(_0x1d2d89){return _0x536392[_0x4f42('0x22')](_0x5d1b1d);}return _0x536392[_0x4f42('0x23')](_0x5d1b1d)[_0x4f42('0x24')]();};}function respondWithResult(_0x756ff5,_0x31af0b){_0x31af0b=_0x31af0b||0xc8;return function(_0xd4daf0){if(_0xd4daf0){return _0x756ff5['status'](_0x31af0b)[_0x4f42('0x25')](_0xd4daf0);}};}function respondWithFilteredResult(_0x5b556d,_0x1ef797){return function(_0x18de8f){if(_0x18de8f){var _0x483d01=_0x18de8f['count'],_0x50dc1d=_0x1ef797[_0x4f42('0x26')],_0x2a75ab=_0x1ef797[_0x4f42('0x26')]+_0x1ef797['limit'],_0x5f22c6;if(_0x2a75ab>=_0x483d01){_0x2a75ab=_0x483d01;_0x5f22c6=0xc8;}else{_0x5f22c6=0xce;}_0x5b556d[_0x4f42('0x23')](_0x5f22c6);return _0x5b556d[_0x4f42('0x27')](_0x4f42('0x28'),_0x50dc1d+'-'+_0x2a75ab+'/'+_0x483d01)[_0x4f42('0x25')](_0x18de8f);}return null;};}function patchUpdates(_0xdb3c01){return function(_0x14b5d3){try{jsonpatch['apply'](_0x14b5d3,_0xdb3c01,!![]);}catch(_0x2d832d){return BPromise['reject'](_0x2d832d);}return _0x14b5d3[_0x4f42('0x29')]();};}function saveUpdates(_0x173847,_0x2fd896){return function(_0x23c463){if(_0x23c463){return _0x23c463['update'](_0x173847)[_0x4f42('0x17')](function(_0x2f849a){return _0x2f849a;});}return null;};}function removeEntity(_0x77edb7,_0x50cf0a){return function(_0x1356b4){if(_0x1356b4){return _0x1356b4[_0x4f42('0x2a')]()[_0x4f42('0x17')](function(){_0x77edb7['status'](0xcc)[_0x4f42('0x24')]();});}};}function handleEntityNotFound(_0x284d55,_0x4e0884){return function(_0x5ca6a0){if(!_0x5ca6a0){_0x284d55[_0x4f42('0x22')](0x194);}return _0x5ca6a0;};}function handleError(_0x51dd20,_0x54c545){_0x54c545=_0x54c545||0x1f4;return function(_0x3fbeca){logger[_0x4f42('0x1c')](_0x3fbeca[_0x4f42('0x2b')]);if(_0x3fbeca[_0x4f42('0x2c')]){delete _0x3fbeca[_0x4f42('0x2c')];}_0x51dd20[_0x4f42('0x23')](_0x54c545)[_0x4f42('0x2d')](_0x3fbeca);};}exports[_0x4f42('0x2e')]=function(_0x4a51a0,_0x2c9f2f){var _0x22cca4={},_0x542198={},_0x115ffa={'count':0x0,'rows':[]};var _0x4f2464=_[_0x4f42('0x2f')](db[_0x4f42('0x30')][_0x4f42('0x31')],function(_0x51059e){return{'name':_0x51059e[_0x4f42('0x32')],'type':_0x51059e[_0x4f42('0x33')][_0x4f42('0x34')]};});_0x542198['model']=_[_0x4f42('0x2f')](_0x4f2464,_0x4f42('0x2c'));_0x542198['query']=_['keys'](_0x4a51a0[_0x4f42('0x35')]);_0x542198[_0x4f42('0x36')]=_[_0x4f42('0x37')](_0x542198['model'],_0x542198[_0x4f42('0x35')]);_0x22cca4['attributes']=_[_0x4f42('0x37')](_0x542198[_0x4f42('0x38')],qs[_0x4f42('0x39')](_0x4a51a0[_0x4f42('0x35')]['fields']));_0x22cca4[_0x4f42('0x3a')]=_0x22cca4[_0x4f42('0x3a')]['length']?_0x22cca4[_0x4f42('0x3a')]:_0x542198[_0x4f42('0x38')];if(!_0x4a51a0[_0x4f42('0x35')][_0x4f42('0x3b')]('nolimit')){_0x22cca4['limit']=qs[_0x4f42('0x3c')](_0x4a51a0[_0x4f42('0x35')][_0x4f42('0x3c')]);_0x22cca4['offset']=qs['offset'](_0x4a51a0['query'][_0x4f42('0x26')]);}_0x22cca4[_0x4f42('0x3d')]=qs[_0x4f42('0x3e')](_0x4a51a0[_0x4f42('0x35')][_0x4f42('0x3e')]);_0x22cca4[_0x4f42('0x3f')]=qs['filters'](_['pick'](_0x4a51a0['query'],_0x542198[_0x4f42('0x36')]));if(_0x4a51a0[_0x4f42('0x35')]['filter']){_0x22cca4[_0x4f42('0x3f')]=_['merge'](_0x22cca4[_0x4f42('0x3f')],{'$or':_[_0x4f42('0x2f')](_0x4f2464,function(_0x2d5d51){if(_0x2d5d51[_0x4f42('0x33')]!=='VIRTUAL'){var _0x5a0ce7={};_0x5a0ce7[_0x2d5d51['name']]={'$like':'%'+_0x4a51a0[_0x4f42('0x35')]['filter']+'%'};return _0x5a0ce7;}})});}_0x22cca4=_['merge']({},_0x22cca4,_0x4a51a0['options']);var _0x4e5f75={'where':_0x22cca4['where']};return db[_0x4f42('0x30')][_0x4f42('0x40')](_0x4e5f75)['then'](function(_0x161b12){_0x115ffa[_0x4f42('0x40')]=_0x161b12;if(_0x4a51a0[_0x4f42('0x35')]['includeAll']){_0x22cca4[_0x4f42('0x41')]=[{'all':!![]}];}return db[_0x4f42('0x30')][_0x4f42('0x42')](_0x22cca4);})[_0x4f42('0x17')](function(_0x48c708){_0x115ffa[_0x4f42('0x43')]=_0x48c708;return _0x115ffa;})[_0x4f42('0x17')](respondWithFilteredResult(_0x2c9f2f,_0x22cca4))[_0x4f42('0x21')](handleError(_0x2c9f2f,null));};exports[_0x4f42('0x44')]=function(_0x2cd8be,_0x46ce68){var _0x541532={'raw':![],'where':{'id':_0x2cd8be[_0x4f42('0x45')]['id']}},_0x3553d0={};_0x3553d0[_0x4f42('0x38')]=_[_0x4f42('0x46')](db['Setting'][_0x4f42('0x31')]);_0x3553d0[_0x4f42('0x35')]=_[_0x4f42('0x46')](_0x2cd8be[_0x4f42('0x35')]);_0x3553d0[_0x4f42('0x36')]=_[_0x4f42('0x37')](_0x3553d0[_0x4f42('0x38')],_0x3553d0[_0x4f42('0x35')]);_0x541532[_0x4f42('0x3a')]=_[_0x4f42('0x37')](_0x3553d0['model'],qs[_0x4f42('0x39')](_0x2cd8be[_0x4f42('0x35')]['fields']));_0x541532[_0x4f42('0x3a')]=_0x541532[_0x4f42('0x3a')][_0x4f42('0x47')]?_0x541532['attributes']:_0x3553d0['model'];if(_0x2cd8be['query'][_0x4f42('0x48')]){_0x541532[_0x4f42('0x41')]=[{'all':!![]}];}_0x541532=_['merge']({},_0x541532,_0x2cd8be[_0x4f42('0x49')]);return db[_0x4f42('0x30')][_0x4f42('0x4a')](_0x541532)[_0x4f42('0x17')](handleEntityNotFound(_0x46ce68,null))[_0x4f42('0x17')](respondWithResult(_0x46ce68,null))[_0x4f42('0x21')](handleError(_0x46ce68,null));};exports[_0x4f42('0x4b')]=function(_0x715117,_0xfb8520,_0x4af7e5){var _0x5c5a2e;return db[_0x4f42('0x30')]['find']({'where':{'id':_0x715117[_0x4f42('0x45')]['id']}})[_0x4f42('0x17')](handleEntityNotFound(_0xfb8520,null))['then'](saveUpdates(_0x715117[_0x4f42('0x4c')],null))[_0x4f42('0x17')](function(_0x274820){if(_0x274820){_0x5c5a2e=_0x274820[_0x4f42('0x4d')]({'plain':!![]});var _0x5f2133=fs[_0x4f42('0x4e')](path['join'](config[_0x4f42('0x4f')],_0x4f42('0x50')),'utf8');var _0x57309b=ejs[_0x4f42('0x51')](_0x5f2133,_0x5c5a2e);var _0x1a4927=fs[_0x4f42('0x4e')](path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x4f42('0x53')),_0x4f42('0x54'));var _0x5e787e=ejs[_0x4f42('0x51')](_0x1a4927,_0x5c5a2e);fs[_0x4f42('0x55')](_0x4f42('0x56'),_0x57309b);fs[_0x4f42('0x55')](_0x4f42('0x57'),_0x5e787e);return respondWithRpcPromise(_0x4f42('0x58'),_0x4f42('0x4b'),{'module':_0x4f42('0x59')});}})[_0x4f42('0x17')](function(){return respondWithRpcPromise(_0x4f42('0x58'),'update',{'module':_0x4f42('0x5a')});})['then'](function(){return _0x5c5a2e||null;})[_0x4f42('0x17')](respondWithResult(_0xfb8520,null))[_0x4f42('0x21')](handleError(_0xfb8520,null));};exports[_0x4f42('0x5b')]=function(_0x573979,_0x498bfb,_0x4207c0){if(_0x573979[_0x4f42('0x5c')]&&_0x573979[_0x4f42('0x5c')]['filename']){_0x573979[_0x4f42('0x4c')][_0x4f42('0x5d')]=_0x573979[_0x4f42('0x5c')][_0x4f42('0x5e')];}return db['Setting'][_0x4f42('0x4a')]({'where':{'id':_0x573979[_0x4f42('0x45')]['id']}})[_0x4f42('0x17')](handleEntityNotFound(_0x498bfb,null))[_0x4f42('0x17')](saveUpdates(_0x573979[_0x4f42('0x4c')],null))[_0x4f42('0x17')](respondWithResult(_0x498bfb,null))['catch'](handleError(_0x498bfb,null));};exports['addLogoLogin']=function(_0xd46172,_0x32b414,_0x4fbb7c){if(_0xd46172[_0x4f42('0x5c')]&&_0xd46172[_0x4f42('0x5c')][_0x4f42('0x5e')]){_0xd46172[_0x4f42('0x4c')][_0x4f42('0x5f')]=_0xd46172[_0x4f42('0x5c')][_0x4f42('0x5e')];}return db[_0x4f42('0x30')][_0x4f42('0x4a')]({'where':{'id':_0xd46172['params']['id']}})[_0x4f42('0x17')](handleEntityNotFound(_0x32b414,null))['then'](saveUpdates(_0xd46172[_0x4f42('0x4c')],null))[_0x4f42('0x17')](respondWithResult(_0x32b414,null))[_0x4f42('0x21')](handleError(_0x32b414,null));};var utilLicense=require(_0x4f42('0x60'));exports['getLogo']=function(_0x4584f6,_0x5bc08b,_0x255293){var _0x2795c4='server/files/images/logos';var _0x329988={'custom':![]};return utilLicense[_0x4f42('0x61')]()[_0x4f42('0x17')](function(_0x35db60){if(_0x35db60){_0x329988=_0x35db60;}return db[_0x4f42('0x30')]['find']({'where':{'id':_0x4584f6[_0x4f42('0x45')]['id']},'attributes':['logo','loginLogo',_0x4f42('0x62'),'favicon',_0x4f42('0x63'),_0x4f42('0x64'),_0x4f42('0x65'),_0x4f42('0x66')],'raw':!![]});})[_0x4f42('0x17')](handleEntityNotFound(_0x5bc08b,null))['then'](function(_0x1fa3e8){if(_0x1fa3e8){var _0x5e1858=_0x1fa3e8['logo']&&fs[_0x4f42('0x67')](path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x2795c4,_['toLower'](_0x1fa3e8['logo'])))?path[_0x4f42('0x52')](config['root'],_0x2795c4,_[_0x4f42('0x68')](_0x1fa3e8[_0x4f42('0x5d')])):path['join'](config['root'],_0x2795c4,_[_0x4f42('0x68')](_0x4f42('0x69')));var _0x46f5fa=_0x4f42('0x6a')+_[_0x4f42('0x6b')](_0x4f42('0x5d'));if(_0x1fa3e8[_0x46f5fa]||!_0x329988[_0x4f42('0x6c')]){_0x5e1858=path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x2795c4,_[_0x4f42('0x68')]('default_logo.png'));}if(!fs[_0x4f42('0x67')](_0x5e1858)){throw new db[(_0x4f42('0x13'))][(_0x4f42('0x14'))](_[_0x4f42('0x6b')]('logo')+_0x4f42('0x6d'));}return _0x5bc08b[_0x4f42('0x6e')](_0x5e1858);}})[_0x4f42('0x21')](handleError(_0x5bc08b,null));};var utilLicense=require(_0x4f42('0x60'));exports[_0x4f42('0x6f')]=function(_0x559cbd,_0x58562a,_0x5b1712){var _0x29b2f7=_0x4f42('0x70');var _0x472198={'custom':![]};return utilLicense[_0x4f42('0x61')]()[_0x4f42('0x17')](function(_0x58a0a7){if(_0x58a0a7){_0x472198=_0x58a0a7;}return db[_0x4f42('0x30')][_0x4f42('0x4a')]({'where':{'id':_0x559cbd[_0x4f42('0x45')]['id']},'attributes':[_0x4f42('0x5d'),'loginLogo',_0x4f42('0x62'),'favicon','defaultLogo',_0x4f42('0x64'),_0x4f42('0x65'),'defaultFavicon'],'raw':!![]});})[_0x4f42('0x17')](handleEntityNotFound(_0x58562a,null))[_0x4f42('0x17')](function(_0x447b58){if(_0x447b58){var _0x4ce19a=_0x447b58['loginLogo']&&fs[_0x4f42('0x67')](path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x29b2f7,_[_0x4f42('0x68')](_0x447b58[_0x4f42('0x5f')])))?path['join'](config[_0x4f42('0x4f')],_0x29b2f7,_['toLower'](_0x447b58['loginLogo'])):path['join'](config['root'],_0x29b2f7,_[_0x4f42('0x68')](_0x4f42('0x71')));var _0x5d2432=_0x4f42('0x6a')+_['upperFirst'](_0x4f42('0x5f'));if(_0x447b58[_0x5d2432]||!_0x472198['custom']){_0x4ce19a=path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x29b2f7,_['toLower'](_0x4f42('0x71')));}if(!fs[_0x4f42('0x67')](_0x4ce19a)){throw new db[(_0x4f42('0x13'))]['ValidationError'](_['upperFirst'](_0x4f42('0x5f'))+_0x4f42('0x6d'));}return _0x58562a['download'](_0x4ce19a);}})['catch'](handleError(_0x58562a,null));};exports[_0x4f42('0x72')]=function(_0x3b55a5,_0x1e6a94){return db[_0x4f42('0x30')]['find']({'where':{'id':_0x3b55a5[_0x4f42('0x45')]['id']},'attributes':['securePassword']})[_0x4f42('0x17')](respondWithResult(_0x1e6a94,null))[_0x4f42('0x21')](handleError(_0x1e6a94,null));};exports['addPreferred']=function(_0x24ef5f,_0xfa42f5,_0x204792){if(_0x24ef5f[_0x4f42('0x5c')]&&_0x24ef5f['file']['filename']){_0x24ef5f['body'][_0x4f42('0x62')]=_0x24ef5f[_0x4f42('0x5c')][_0x4f42('0x5e')];}return db[_0x4f42('0x30')][_0x4f42('0x4a')]({'where':{'id':_0x24ef5f[_0x4f42('0x45')]['id']}})[_0x4f42('0x17')](handleEntityNotFound(_0xfa42f5,null))['then'](saveUpdates(_0x24ef5f[_0x4f42('0x4c')],null))[_0x4f42('0x17')](respondWithResult(_0xfa42f5,null))[_0x4f42('0x21')](handleError(_0xfa42f5,null));};var utilLicense=require(_0x4f42('0x60'));exports[_0x4f42('0x73')]=function(_0x5b5fbc,_0x357944,_0xae8bf4){var _0x28f49d=_0x4f42('0x70');var _0x3fcc27={'custom':![]};return utilLicense[_0x4f42('0x61')]()[_0x4f42('0x17')](function(_0xacf312){if(_0xacf312){_0x3fcc27=_0xacf312;}return db['Setting'][_0x4f42('0x4a')]({'where':{'id':_0x5b5fbc['params']['id']},'attributes':[_0x4f42('0x5d'),_0x4f42('0x5f'),_0x4f42('0x62'),_0x4f42('0x74'),'defaultLogo',_0x4f42('0x64'),_0x4f42('0x65'),_0x4f42('0x66')],'raw':!![]});})['then'](handleEntityNotFound(_0x357944,null))[_0x4f42('0x17')](function(_0x4f6cf8){if(_0x4f6cf8){var _0x37c147=_0x4f6cf8[_0x4f42('0x62')]&&fs[_0x4f42('0x67')](path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x28f49d,_['toLower'](_0x4f6cf8[_0x4f42('0x62')])))?path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0x28f49d,_[_0x4f42('0x68')](_0x4f6cf8[_0x4f42('0x62')])):path['join'](config['root'],_0x28f49d,_[_0x4f42('0x68')](_0x4f42('0x75')));var _0x4570f2=_0x4f42('0x6a')+_[_0x4f42('0x6b')](_0x4f42('0x62'));if(_0x4f6cf8[_0x4570f2]||!_0x3fcc27['custom']||!_0x3fcc27[_0x4f42('0x62')]){_0x37c147=path['join'](config[_0x4f42('0x4f')],_0x28f49d,_[_0x4f42('0x68')]('default_preferred.png'));}if(!fs[_0x4f42('0x67')](_0x37c147)){throw new db['Sequelize'][(_0x4f42('0x14'))](_[_0x4f42('0x6b')]('preferred')+_0x4f42('0x6d'));}return _0x357944['download'](_0x37c147);}})[_0x4f42('0x21')](handleError(_0x357944,null));};exports[_0x4f42('0x76')]=function(_0x1e0022,_0x295a82,_0x4dbb36){if(_0x1e0022['file']&&_0x1e0022['file'][_0x4f42('0x5e')]){_0x1e0022[_0x4f42('0x4c')][_0x4f42('0x74')]=_0x1e0022['file'][_0x4f42('0x5e')];}return db[_0x4f42('0x30')][_0x4f42('0x4a')]({'where':{'id':_0x1e0022['params']['id']}})['then'](handleEntityNotFound(_0x295a82,null))[_0x4f42('0x17')](saveUpdates(_0x1e0022[_0x4f42('0x4c')],null))[_0x4f42('0x17')](respondWithResult(_0x295a82,null))['catch'](handleError(_0x295a82,null));};var utilLicense=require('../../config/license/util');exports[_0x4f42('0x77')]=function(_0x571afe,_0x3805ed,_0x24fa3c){var _0xc5dec9=_0x4f42('0x70');var _0x26ba59={'custom':![]};return utilLicense[_0x4f42('0x61')]()[_0x4f42('0x17')](function(_0x3c1d2e){if(_0x3c1d2e){_0x26ba59=_0x3c1d2e;}return db[_0x4f42('0x30')][_0x4f42('0x4a')]({'where':{'id':_0x571afe['params']['id']},'attributes':[_0x4f42('0x5d'),_0x4f42('0x5f'),_0x4f42('0x62'),_0x4f42('0x74'),_0x4f42('0x63'),'defaultLoginLogo',_0x4f42('0x65'),'defaultFavicon'],'raw':!![]});})[_0x4f42('0x17')](handleEntityNotFound(_0x3805ed,null))[_0x4f42('0x17')](function(_0x519b8d){if(_0x519b8d){var _0x22f40a=_0x519b8d[_0x4f42('0x74')]&&fs[_0x4f42('0x67')](path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0xc5dec9,_[_0x4f42('0x68')](_0x519b8d[_0x4f42('0x74')])))?path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0xc5dec9,_[_0x4f42('0x68')](_0x519b8d[_0x4f42('0x74')])):path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0xc5dec9,_[_0x4f42('0x68')](_0x4f42('0x78')));var _0x4b05bf=_0x4f42('0x6a')+_[_0x4f42('0x6b')]('favicon');if(_0x519b8d[_0x4b05bf]||!_0x26ba59[_0x4f42('0x6c')]){_0x22f40a=path[_0x4f42('0x52')](config[_0x4f42('0x4f')],_0xc5dec9,_['toLower']('default_favicon.ico'));}if(!fs['existsSync'](_0x22f40a)){throw new db[(_0x4f42('0x13'))][(_0x4f42('0x14'))](_[_0x4f42('0x6b')](_0x4f42('0x74'))+_0x4f42('0x6d'));}return _0x3805ed[_0x4f42('0x6e')](_0x22f40a);}})[_0x4f42('0x21')](handleError(_0x3805ed,null));}; \ No newline at end of file +var _0x9dd7=['loginLogo','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','toLower','default_logo.png','upperFirst','download','../../config/license/util','getLogoLogin','preferred','default_loginLogo.png','default','custom','\x20not\x20found','securePassword','addPreferred','getPreferred','defaultLoginLogo','addFavicon','getFavicon','default_favicon.ico','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','test','Sequelize','ValidationError','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','end','status','count','offset','limit','Content-Range','json','reject','save','destroy','sendStatus','name','send','index','Setting','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','rows','show','params','includeAll','update','body','readFileSync','join','root','utf8','render','/etc/asterisk/stun_xcally.conf','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','file','filename','logo','find','addLogoLogin','getLogo','server/files/images/logos','getLicense'];(function(_0x88f8ca,_0x1e419a){var _0x46f4b1=function(_0x5a21a1){while(--_0x5a21a1){_0x88f8ca['push'](_0x88f8ca['shift']());}};_0x46f4b1(++_0x1e419a);}(_0x9dd7,0x195));var _0x79dd=function(_0x429f6f,_0x2b312a){_0x429f6f=_0x429f6f-0x0;var _0x357f69=_0x9dd7[_0x429f6f];return _0x357f69;};'use strict';var pdf=require(_0x79dd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x79dd('0x1'));var zipdir=require(_0x79dd('0x2'));var jsonpatch=require(_0x79dd('0x3'));var rp=require(_0x79dd('0x4'));var moment=require(_0x79dd('0x5'));var BPromise=require(_0x79dd('0x6'));var Mustache=require(_0x79dd('0x7'));var util=require(_0x79dd('0x8'));var path=require(_0x79dd('0x9'));var sox=require(_0x79dd('0xa'));var csv=require(_0x79dd('0xb'));var ejs=require(_0x79dd('0xc'));var fs=require('fs');var _=require(_0x79dd('0xd'));var squel=require(_0x79dd('0xe'));var crypto=require(_0x79dd('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x79dd('0x10'));var toCsv=require(_0x79dd('0xb'));var querystring=require('querystring');var Papa=require(_0x79dd('0x11'));var Redis=require(_0x79dd('0x12'));var authService=require(_0x79dd('0x13'));var qs=require(_0x79dd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79dd('0x15'));var logger=require(_0x79dd('0x16'))(_0x79dd('0x17'));var utils=require(_0x79dd('0x18'));var config=require(_0x79dd('0x19'));var db=require(_0x79dd('0x1a'))['db'];var jayson=require(_0x79dd('0x1b'));var client=jayson[_0x79dd('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x32eeb0,_0x4f11e8,_0x32172b){if(_0x32172b){var _0x2bf1d0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2bf1d0[_0x79dd('0x1d')](_0x4f11e8)){return _0x32eeb0;}else{throw new db[(_0x79dd('0x1e'))][(_0x79dd('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x32eeb0;}}function respondWithRpcPromise(_0x56f35f,_0x913d03,_0x5b671e,_0x5c1c09){return new BPromise(function(_0x4a6e23,_0x554981){var _0x2726da=_0x5c1c09||client;return _0x2726da[_0x79dd('0x20')](_0x56f35f,_0x5b671e)[_0x79dd('0x21')](function(_0x5732ec){logger[_0x79dd('0x22')](_0x79dd('0x23'),_0x913d03,_0x79dd('0x24'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x913d03,_0x79dd('0x24'),JSON[_0x79dd('0x25')](_0x5732ec));if(_0x5732ec['error']){if(_0x5732ec['error'][_0x79dd('0x26')]===0x1f4){logger[_0x79dd('0x27')](_0x79dd('0x23'),_0x913d03,_0x5732ec[_0x79dd('0x27')][_0x79dd('0x28')]);return _0x554981(_0x5732ec[_0x79dd('0x27')][_0x79dd('0x28')]);}logger['error'](_0x79dd('0x23'),_0x913d03,_0x5732ec[_0x79dd('0x27')][_0x79dd('0x28')]);return _0x4a6e23(_0x5732ec[_0x79dd('0x27')][_0x79dd('0x28')]);}else{logger[_0x79dd('0x22')](_0x79dd('0x23'),_0x913d03,'request\x20sent');_0x4a6e23(_0x5732ec['result'][_0x79dd('0x28')]);}})[_0x79dd('0x29')](function(_0x72ea05){logger[_0x79dd('0x27')](_0x79dd('0x23'),_0x913d03,_0x72ea05);_0x554981(_0x72ea05);});});}function respondWithStatusCode(_0x42640f,_0x3643cf){_0x3643cf=_0x3643cf||0xcc;return function(_0x36a0dd){if(_0x36a0dd){return _0x42640f['sendStatus'](_0x3643cf);}return _0x42640f['status'](_0x3643cf)[_0x79dd('0x2a')]();};}function respondWithResult(_0x3d4264,_0x215369){_0x215369=_0x215369||0xc8;return function(_0x1f26fb){if(_0x1f26fb){return _0x3d4264[_0x79dd('0x2b')](_0x215369)['json'](_0x1f26fb);}};}function respondWithFilteredResult(_0x3f47fe,_0x1d37b8){return function(_0x79cab9){if(_0x79cab9){var _0x4e4dc4=_0x79cab9[_0x79dd('0x2c')],_0x1bbd81=_0x1d37b8[_0x79dd('0x2d')],_0x4ec2a5=_0x1d37b8[_0x79dd('0x2d')]+_0x1d37b8[_0x79dd('0x2e')],_0x135715;if(_0x4ec2a5>=_0x4e4dc4){_0x4ec2a5=_0x4e4dc4;_0x135715=0xc8;}else{_0x135715=0xce;}_0x3f47fe[_0x79dd('0x2b')](_0x135715);return _0x3f47fe['set'](_0x79dd('0x2f'),_0x1bbd81+'-'+_0x4ec2a5+'/'+_0x4e4dc4)[_0x79dd('0x30')](_0x79cab9);}return null;};}function patchUpdates(_0x4a2223){return function(_0x2f4ceb){try{jsonpatch['apply'](_0x2f4ceb,_0x4a2223,!![]);}catch(_0x22a282){return BPromise[_0x79dd('0x31')](_0x22a282);}return _0x2f4ceb[_0x79dd('0x32')]();};}function saveUpdates(_0x27c38e,_0x1e873b){return function(_0x4c3a9c){if(_0x4c3a9c){return _0x4c3a9c['update'](_0x27c38e)[_0x79dd('0x21')](function(_0x2eef8d){return _0x2eef8d;});}return null;};}function removeEntity(_0x13d54b,_0x2743ba){return function(_0x364e0f){if(_0x364e0f){return _0x364e0f[_0x79dd('0x33')]()['then'](function(){_0x13d54b[_0x79dd('0x2b')](0xcc)[_0x79dd('0x2a')]();});}};}function handleEntityNotFound(_0x1e40fa,_0x150eb0){return function(_0x416df5){if(!_0x416df5){_0x1e40fa[_0x79dd('0x34')](0x194);}return _0x416df5;};}function handleError(_0x9350e0,_0x5051fd){_0x5051fd=_0x5051fd||0x1f4;return function(_0x2cce2b){logger[_0x79dd('0x27')](_0x2cce2b['stack']);if(_0x2cce2b[_0x79dd('0x35')]){delete _0x2cce2b[_0x79dd('0x35')];}_0x9350e0[_0x79dd('0x2b')](_0x5051fd)[_0x79dd('0x36')](_0x2cce2b);};}exports[_0x79dd('0x37')]=function(_0x4a3b35,_0x4ac27b){var _0x492a20={},_0x213aea={},_0x4bffe5={'count':0x0,'rows':[]};var _0x122817=_['map'](db[_0x79dd('0x38')][_0x79dd('0x39')],function(_0x223c88){return{'name':_0x223c88[_0x79dd('0x3a')],'type':_0x223c88[_0x79dd('0x3b')][_0x79dd('0x3c')]};});_0x213aea[_0x79dd('0x3d')]=_[_0x79dd('0x3e')](_0x122817,_0x79dd('0x35'));_0x213aea[_0x79dd('0x3f')]=_[_0x79dd('0x40')](_0x4a3b35[_0x79dd('0x3f')]);_0x213aea[_0x79dd('0x41')]=_[_0x79dd('0x42')](_0x213aea['model'],_0x213aea['query']);_0x492a20[_0x79dd('0x43')]=_[_0x79dd('0x42')](_0x213aea[_0x79dd('0x3d')],qs[_0x79dd('0x44')](_0x4a3b35[_0x79dd('0x3f')]['fields']));_0x492a20[_0x79dd('0x43')]=_0x492a20['attributes'][_0x79dd('0x45')]?_0x492a20[_0x79dd('0x43')]:_0x213aea[_0x79dd('0x3d')];if(!_0x4a3b35[_0x79dd('0x3f')][_0x79dd('0x46')](_0x79dd('0x47'))){_0x492a20['limit']=qs[_0x79dd('0x2e')](_0x4a3b35[_0x79dd('0x3f')][_0x79dd('0x2e')]);_0x492a20['offset']=qs['offset'](_0x4a3b35[_0x79dd('0x3f')][_0x79dd('0x2d')]);}_0x492a20[_0x79dd('0x48')]=qs[_0x79dd('0x49')](_0x4a3b35['query'][_0x79dd('0x49')]);_0x492a20[_0x79dd('0x4a')]=qs[_0x79dd('0x41')](_[_0x79dd('0x4b')](_0x4a3b35[_0x79dd('0x3f')],_0x213aea[_0x79dd('0x41')]));if(_0x4a3b35['query'][_0x79dd('0x4c')]){_0x492a20['where']=_['merge'](_0x492a20[_0x79dd('0x4a')],{'$or':_[_0x79dd('0x3e')](_0x122817,function(_0x5051c3){if(_0x5051c3['type']!==_0x79dd('0x4d')){var _0x3d27f1={};_0x3d27f1[_0x5051c3[_0x79dd('0x35')]]={'$like':'%'+_0x4a3b35[_0x79dd('0x3f')][_0x79dd('0x4c')]+'%'};return _0x3d27f1;}})});}_0x492a20=_['merge']({},_0x492a20,_0x4a3b35[_0x79dd('0x4e')]);var _0x229b2e={'where':_0x492a20[_0x79dd('0x4a')]};return db[_0x79dd('0x38')]['count'](_0x229b2e)[_0x79dd('0x21')](function(_0x146132){_0x4bffe5[_0x79dd('0x2c')]=_0x146132;if(_0x4a3b35[_0x79dd('0x3f')]['includeAll']){_0x492a20[_0x79dd('0x4f')]=[{'all':!![]}];}return db[_0x79dd('0x38')]['findAll'](_0x492a20);})[_0x79dd('0x21')](function(_0xc9abc2){_0x4bffe5[_0x79dd('0x50')]=_0xc9abc2;return _0x4bffe5;})[_0x79dd('0x21')](respondWithFilteredResult(_0x4ac27b,_0x492a20))[_0x79dd('0x29')](handleError(_0x4ac27b,null));};exports[_0x79dd('0x51')]=function(_0x22532e,_0xff0177){var _0x11f812={'raw':![],'where':{'id':_0x22532e[_0x79dd('0x52')]['id']}},_0x691607={};_0x691607[_0x79dd('0x3d')]=_[_0x79dd('0x40')](db[_0x79dd('0x38')][_0x79dd('0x39')]);_0x691607[_0x79dd('0x3f')]=_[_0x79dd('0x40')](_0x22532e[_0x79dd('0x3f')]);_0x691607['filters']=_[_0x79dd('0x42')](_0x691607[_0x79dd('0x3d')],_0x691607[_0x79dd('0x3f')]);_0x11f812[_0x79dd('0x43')]=_[_0x79dd('0x42')](_0x691607[_0x79dd('0x3d')],qs['fields'](_0x22532e[_0x79dd('0x3f')][_0x79dd('0x44')]));_0x11f812[_0x79dd('0x43')]=_0x11f812[_0x79dd('0x43')][_0x79dd('0x45')]?_0x11f812['attributes']:_0x691607[_0x79dd('0x3d')];if(_0x22532e[_0x79dd('0x3f')][_0x79dd('0x53')]){_0x11f812['include']=[{'all':!![]}];}_0x11f812=_['merge']({},_0x11f812,_0x22532e[_0x79dd('0x4e')]);return db[_0x79dd('0x38')]['find'](_0x11f812)[_0x79dd('0x21')](handleEntityNotFound(_0xff0177,null))['then'](respondWithResult(_0xff0177,null))[_0x79dd('0x29')](handleError(_0xff0177,null));};exports[_0x79dd('0x54')]=function(_0x1d2320,_0x3f02f5,_0x50c55e){var _0xb464f;return db['Setting']['find']({'where':{'id':_0x1d2320[_0x79dd('0x52')]['id']}})[_0x79dd('0x21')](handleEntityNotFound(_0x3f02f5,null))[_0x79dd('0x21')](saveUpdates(_0x1d2320[_0x79dd('0x55')],null))['then'](function(_0x377e9f){if(_0x377e9f){_0xb464f=_0x377e9f['get']({'plain':!![]});var _0x19daf4=fs[_0x79dd('0x56')](path[_0x79dd('0x57')](config[_0x79dd('0x58')],'server/files/templates/stun.ejs'),'utf8');var _0x14c1ce=ejs['render'](_0x19daf4,_0xb464f);var _0x4783f4=fs[_0x79dd('0x56')](path[_0x79dd('0x57')](config[_0x79dd('0x58')],'server/files/templates/turn.ejs'),_0x79dd('0x59'));var _0x3aa8e6=ejs[_0x79dd('0x5a')](_0x4783f4,_0xb464f);fs['writeFileSync'](_0x79dd('0x5b'),_0x14c1ce);fs[_0x79dd('0x5c')](_0x79dd('0x5d'),_0x3aa8e6);return respondWithRpcPromise(_0x79dd('0x5e'),_0x79dd('0x54'),{'module':'res_stun_monitor.so'});}})[_0x79dd('0x21')](function(){return respondWithRpcPromise(_0x79dd('0x5e'),'update',{'module':'res_rtp_asterisk.so'});})[_0x79dd('0x21')](function(){return _0xb464f||null;})[_0x79dd('0x21')](respondWithResult(_0x3f02f5,null))[_0x79dd('0x29')](handleError(_0x3f02f5,null));};exports['addLogo']=function(_0x38f605,_0x527e99,_0x27a5bf){if(_0x38f605[_0x79dd('0x5f')]&&_0x38f605[_0x79dd('0x5f')][_0x79dd('0x60')]){_0x38f605[_0x79dd('0x55')][_0x79dd('0x61')]=_0x38f605[_0x79dd('0x5f')][_0x79dd('0x60')];}return db['Setting'][_0x79dd('0x62')]({'where':{'id':_0x38f605[_0x79dd('0x52')]['id']}})['then'](handleEntityNotFound(_0x527e99,null))[_0x79dd('0x21')](saveUpdates(_0x38f605[_0x79dd('0x55')],null))['then'](respondWithResult(_0x527e99,null))[_0x79dd('0x29')](handleError(_0x527e99,null));};exports[_0x79dd('0x63')]=function(_0x3b7386,_0x120766,_0x3fffff){if(_0x3b7386[_0x79dd('0x5f')]&&_0x3b7386[_0x79dd('0x5f')][_0x79dd('0x60')]){_0x3b7386[_0x79dd('0x55')]['loginLogo']=_0x3b7386[_0x79dd('0x5f')]['filename'];}return db[_0x79dd('0x38')][_0x79dd('0x62')]({'where':{'id':_0x3b7386[_0x79dd('0x52')]['id']}})['then'](handleEntityNotFound(_0x120766,null))[_0x79dd('0x21')](saveUpdates(_0x3b7386[_0x79dd('0x55')],null))[_0x79dd('0x21')](respondWithResult(_0x120766,null))['catch'](handleError(_0x120766,null));};var utilLicense=require('../../config/license/util');exports[_0x79dd('0x64')]=function(_0x5b8be8,_0x3c30b0,_0x3340ec){var _0x124ac5=_0x79dd('0x65');var _0x2c46bf={'custom':![]};return utilLicense[_0x79dd('0x66')]()[_0x79dd('0x21')](function(_0x378a1c){if(_0x378a1c){_0x2c46bf=_0x378a1c;}return db[_0x79dd('0x38')][_0x79dd('0x62')]({'where':{'id':_0x5b8be8[_0x79dd('0x52')]['id']},'attributes':[_0x79dd('0x61'),_0x79dd('0x67'),'preferred',_0x79dd('0x68'),_0x79dd('0x69'),'defaultLoginLogo',_0x79dd('0x6a'),_0x79dd('0x6b')],'raw':!![]});})['then'](handleEntityNotFound(_0x3c30b0,null))[_0x79dd('0x21')](function(_0x2123a4){if(_0x2123a4){var _0x207f84=_0x2123a4[_0x79dd('0x61')]&&fs[_0x79dd('0x6c')](path[_0x79dd('0x57')](config[_0x79dd('0x58')],_0x124ac5,_[_0x79dd('0x6d')](_0x2123a4['logo'])))?path['join'](config[_0x79dd('0x58')],_0x124ac5,_[_0x79dd('0x6d')](_0x2123a4['logo'])):path[_0x79dd('0x57')](config[_0x79dd('0x58')],_0x124ac5,_[_0x79dd('0x6d')](_0x79dd('0x6e')));var _0x2e49db='default'+_[_0x79dd('0x6f')](_0x79dd('0x61'));if(_0x2123a4[_0x2e49db]||!_0x2c46bf['custom']){_0x207f84=path[_0x79dd('0x57')](config[_0x79dd('0x58')],_0x124ac5,_[_0x79dd('0x6d')]('default_logo.png'));}if(!fs[_0x79dd('0x6c')](_0x207f84)){throw new db[(_0x79dd('0x1e'))][(_0x79dd('0x1f'))](_[_0x79dd('0x6f')]('logo')+'\x20not\x20found');}return _0x3c30b0[_0x79dd('0x70')](_0x207f84);}})[_0x79dd('0x29')](handleError(_0x3c30b0,null));};var utilLicense=require(_0x79dd('0x71'));exports[_0x79dd('0x72')]=function(_0x1c3928,_0x1ae775,_0x6c7f9a){var _0x261efb=_0x79dd('0x65');var _0x101fd9={'custom':![]};return utilLicense[_0x79dd('0x66')]()[_0x79dd('0x21')](function(_0x454b30){if(_0x454b30){_0x101fd9=_0x454b30;}return db[_0x79dd('0x38')][_0x79dd('0x62')]({'where':{'id':_0x1c3928[_0x79dd('0x52')]['id']},'attributes':['logo',_0x79dd('0x67'),_0x79dd('0x73'),_0x79dd('0x68'),'defaultLogo','defaultLoginLogo','defaultPreferred',_0x79dd('0x6b')],'raw':!![]});})[_0x79dd('0x21')](handleEntityNotFound(_0x1ae775,null))[_0x79dd('0x21')](function(_0x3e9245){if(_0x3e9245){var _0x29b08c=_0x3e9245[_0x79dd('0x67')]&&fs['existsSync'](path[_0x79dd('0x57')](config[_0x79dd('0x58')],_0x261efb,_['toLower'](_0x3e9245[_0x79dd('0x67')])))?path[_0x79dd('0x57')](config[_0x79dd('0x58')],_0x261efb,_[_0x79dd('0x6d')](_0x3e9245['loginLogo'])):path[_0x79dd('0x57')](config['root'],_0x261efb,_[_0x79dd('0x6d')](_0x79dd('0x74')));var _0x4a329c=_0x79dd('0x75')+_[_0x79dd('0x6f')]('loginLogo');if(_0x3e9245[_0x4a329c]||!_0x101fd9[_0x79dd('0x76')]){_0x29b08c=path[_0x79dd('0x57')](config[_0x79dd('0x58')],_0x261efb,_[_0x79dd('0x6d')](_0x79dd('0x74')));}if(!fs[_0x79dd('0x6c')](_0x29b08c)){throw new db[(_0x79dd('0x1e'))][(_0x79dd('0x1f'))](_[_0x79dd('0x6f')](_0x79dd('0x67'))+_0x79dd('0x77'));}return _0x1ae775['download'](_0x29b08c);}})['catch'](handleError(_0x1ae775,null));};exports['gdpr']=function(_0x28bac5,_0x40a9c7){return db[_0x79dd('0x38')][_0x79dd('0x62')]({'where':{'id':_0x28bac5[_0x79dd('0x52')]['id']},'attributes':[_0x79dd('0x78')]})[_0x79dd('0x21')](respondWithResult(_0x40a9c7,null))[_0x79dd('0x29')](handleError(_0x40a9c7,null));};exports[_0x79dd('0x79')]=function(_0x216830,_0x5a60dc,_0x3bcecd){if(_0x216830['file']&&_0x216830[_0x79dd('0x5f')]['filename']){_0x216830[_0x79dd('0x55')][_0x79dd('0x73')]=_0x216830[_0x79dd('0x5f')][_0x79dd('0x60')];}return db[_0x79dd('0x38')]['find']({'where':{'id':_0x216830[_0x79dd('0x52')]['id']}})[_0x79dd('0x21')](handleEntityNotFound(_0x5a60dc,null))['then'](saveUpdates(_0x216830[_0x79dd('0x55')],null))[_0x79dd('0x21')](respondWithResult(_0x5a60dc,null))[_0x79dd('0x29')](handleError(_0x5a60dc,null));};var utilLicense=require(_0x79dd('0x71'));exports[_0x79dd('0x7a')]=function(_0x5533d5,_0x38ecc5,_0x46b867){var _0x17bc6f=_0x79dd('0x65');var _0x79cc2c={'custom':![]};return utilLicense[_0x79dd('0x66')]()[_0x79dd('0x21')](function(_0x4cc4ba){if(_0x4cc4ba){_0x79cc2c=_0x4cc4ba;}return db[_0x79dd('0x38')]['find']({'where':{'id':_0x5533d5[_0x79dd('0x52')]['id']},'attributes':['logo',_0x79dd('0x67'),_0x79dd('0x73'),_0x79dd('0x68'),_0x79dd('0x69'),_0x79dd('0x7b'),_0x79dd('0x6a'),_0x79dd('0x6b')],'raw':!![]});})[_0x79dd('0x21')](handleEntityNotFound(_0x38ecc5,null))['then'](function(_0xa628d0){if(_0xa628d0){var _0x22ac35=_0xa628d0[_0x79dd('0x73')]&&fs['existsSync'](path['join'](config['root'],_0x17bc6f,_[_0x79dd('0x6d')](_0xa628d0['preferred'])))?path['join'](config['root'],_0x17bc6f,_[_0x79dd('0x6d')](_0xa628d0[_0x79dd('0x73')])):path[_0x79dd('0x57')](config['root'],_0x17bc6f,_[_0x79dd('0x6d')]('default_preferred.png'));var _0x2935b9='default'+_[_0x79dd('0x6f')](_0x79dd('0x73'));if(_0xa628d0[_0x2935b9]||!_0x79cc2c[_0x79dd('0x76')]||!_0x79cc2c['preferred']){_0x22ac35=path[_0x79dd('0x57')](config[_0x79dd('0x58')],_0x17bc6f,_['toLower']('default_preferred.png'));}if(!fs['existsSync'](_0x22ac35)){throw new db['Sequelize'][(_0x79dd('0x1f'))](_['upperFirst']('preferred')+_0x79dd('0x77'));}return _0x38ecc5[_0x79dd('0x70')](_0x22ac35);}})[_0x79dd('0x29')](handleError(_0x38ecc5,null));};exports[_0x79dd('0x7c')]=function(_0x50661d,_0x242c8d,_0x413240){if(_0x50661d['file']&&_0x50661d[_0x79dd('0x5f')]['filename']){_0x50661d[_0x79dd('0x55')]['favicon']=_0x50661d[_0x79dd('0x5f')][_0x79dd('0x60')];}return db[_0x79dd('0x38')][_0x79dd('0x62')]({'where':{'id':_0x50661d[_0x79dd('0x52')]['id']}})[_0x79dd('0x21')](handleEntityNotFound(_0x242c8d,null))[_0x79dd('0x21')](saveUpdates(_0x50661d[_0x79dd('0x55')],null))[_0x79dd('0x21')](respondWithResult(_0x242c8d,null))[_0x79dd('0x29')](handleError(_0x242c8d,null));};var utilLicense=require(_0x79dd('0x71'));exports[_0x79dd('0x7d')]=function(_0x50a373,_0x2c014d,_0x5b5b82){var _0xf06b26='server/files/images/logos';var _0x4dabb7={'custom':![]};return utilLicense[_0x79dd('0x66')]()[_0x79dd('0x21')](function(_0x345247){if(_0x345247){_0x4dabb7=_0x345247;}return db[_0x79dd('0x38')][_0x79dd('0x62')]({'where':{'id':_0x50a373[_0x79dd('0x52')]['id']},'attributes':[_0x79dd('0x61'),_0x79dd('0x67'),'preferred','favicon',_0x79dd('0x69'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x79dd('0x21')](handleEntityNotFound(_0x2c014d,null))[_0x79dd('0x21')](function(_0x15cff5){if(_0x15cff5){var _0x3a67ae=_0x15cff5[_0x79dd('0x68')]&&fs[_0x79dd('0x6c')](path[_0x79dd('0x57')](config[_0x79dd('0x58')],_0xf06b26,_[_0x79dd('0x6d')](_0x15cff5['favicon'])))?path[_0x79dd('0x57')](config[_0x79dd('0x58')],_0xf06b26,_[_0x79dd('0x6d')](_0x15cff5[_0x79dd('0x68')])):path['join'](config['root'],_0xf06b26,_['toLower'](_0x79dd('0x7e')));var _0x59da3d=_0x79dd('0x75')+_[_0x79dd('0x6f')](_0x79dd('0x68'));if(_0x15cff5[_0x59da3d]||!_0x4dabb7[_0x79dd('0x76')]){_0x3a67ae=path[_0x79dd('0x57')](config['root'],_0xf06b26,_[_0x79dd('0x6d')]('default_favicon.ico'));}if(!fs[_0x79dd('0x6c')](_0x3a67ae)){throw new db[(_0x79dd('0x1e'))][(_0x79dd('0x1f'))](_['upperFirst'](_0x79dd('0x68'))+'\x20not\x20found');}return _0x2c014d[_0x79dd('0x70')](_0x3a67ae);}})[_0x79dd('0x29')](handleError(_0x2c014d,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 44c85fc..8dc7981 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 _0xd9e3=['define','settings','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./setting.attributes','exports'];(function(_0x2799f5,_0x1b8bb7){var _0x5313c8=function(_0x1f0fc4){while(--_0x1f0fc4){_0x2799f5['push'](_0x2799f5['shift']());}};_0x5313c8(++_0x1b8bb7);}(_0xd9e3,0x92));var _0x3d9e=function(_0x622f38,_0xf29fae){_0x622f38=_0x622f38-0x0;var _0x57a5ee=_0xd9e3[_0x622f38];return _0x57a5ee;};'use strict';var _=require(_0x3d9e('0x0'));var util=require('util');var logger=require(_0x3d9e('0x1'))(_0x3d9e('0x2'));var moment=require(_0x3d9e('0x3'));var BPromise=require(_0x3d9e('0x4'));var rp=require(_0x3d9e('0x5'));var fs=require('fs');var path=require(_0x3d9e('0x6'));var rimraf=require('rimraf');var config=require(_0x3d9e('0x7'));var attributes=require(_0x3d9e('0x8'));module[_0x3d9e('0x9')]=function(_0x2b09f7,_0x57000c){return _0x2b09f7[_0x3d9e('0xa')]('Setting',attributes,{'tableName':_0x3d9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b8b=['path','rimraf','../../config/environment','./setting.attributes','define','Setting','api','bluebird','request-promise'];(function(_0x29c31c,_0x3a4bfb){var _0x4f55b1=function(_0xa4d648){while(--_0xa4d648){_0x29c31c['push'](_0x29c31c['shift']());}};_0x4f55b1(++_0x3a4bfb);}(_0x7b8b,0x1da));var _0xb7b8=function(_0x1f9f5f,_0x509fb7){_0x1f9f5f=_0x1f9f5f-0x0;var _0x51d649=_0x7b8b[_0x1f9f5f];return _0x51d649;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb7b8('0x0'));var moment=require('moment');var BPromise=require(_0xb7b8('0x1'));var rp=require(_0xb7b8('0x2'));var fs=require('fs');var path=require(_0xb7b8('0x3'));var rimraf=require(_0xb7b8('0x4'));var config=require(_0xb7b8('0x5'));var attributes=require(_0xb7b8('0x6'));module['exports']=function(_0x1edc6d,_0x5be5b6){return _0x1edc6d[_0xb7b8('0x7')](_0xb7b8('0x8'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 27cd947..331e04e 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 _0x58c0=['Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','ioredis','rpc','../../config/environment','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4d83e7,_0x4d3f1c){var _0x1fd0d7=function(_0x32d05c){while(--_0x32d05c){_0x4d83e7['push'](_0x4d83e7['shift']());}};_0x1fd0d7(++_0x4d3f1c);}(_0x58c0,0x16f));var _0x058c=function(_0x287a47,_0x2f731c){_0x287a47=_0x287a47-0x0;var _0x3fb726=_0x58c0[_0x287a47];return _0x3fb726;};'use strict';var _=require('lodash');var util=require(_0x058c('0x0'));var moment=require('moment');var BPromise=require(_0x058c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x058c('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x058c('0x3'));var config=require(_0x058c('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x058c('0x5')][_0x058c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x40b574,_0x36b2e9,_0xdf6e19){return new BPromise(function(_0x1ff6b2,_0x4c26bb){return client[_0x058c('0x7')](_0x40b574,_0xdf6e19)[_0x058c('0x8')](function(_0x578a5f){logger[_0x058c('0x9')](_0x058c('0xa'),_0x36b2e9,_0x058c('0xb'));logger[_0x058c('0xc')](_0x058c('0xd'),_0x36b2e9,_0x058c('0xb'),JSON[_0x058c('0xe')](_0x578a5f));if(_0x578a5f['error']){if(_0x578a5f[_0x058c('0xf')][_0x058c('0x10')]===0x1f4){logger[_0x058c('0xf')]('Setting,\x20%s,\x20%s',_0x36b2e9,_0x578a5f[_0x058c('0xf')][_0x058c('0x11')]);return _0x4c26bb(_0x578a5f[_0x058c('0xf')][_0x058c('0x11')]);}logger[_0x058c('0xf')](_0x058c('0xa'),_0x36b2e9,_0x578a5f[_0x058c('0xf')]['message']);return _0x1ff6b2(_0x578a5f[_0x058c('0xf')][_0x058c('0x11')]);}else{logger[_0x058c('0x9')](_0x058c('0xa'),_0x36b2e9,_0x058c('0xb'));_0x1ff6b2(_0x578a5f[_0x058c('0x12')]['message']);}})[_0x058c('0x13')](function(_0x16edf5){logger['error']('Setting,\x20%s,\x20%s',_0x36b2e9,_0x16edf5);_0x4c26bb(_0x16edf5);});});} \ No newline at end of file +var _0x41f8=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','lodash','util','moment'];(function(_0x13e453,_0x4ab30c){var _0x26aad2=function(_0x3387a1){while(--_0x3387a1){_0x13e453['push'](_0x13e453['shift']());}};_0x26aad2(++_0x4ab30c);}(_0x41f8,0x1e0));var _0x841f=function(_0x28366d,_0x2a9a26){_0x28366d=_0x28366d-0x0;var _0x3b95ec=_0x41f8[_0x28366d];return _0x3b95ec;};'use strict';var _=require(_0x841f('0x0'));var util=require(_0x841f('0x1'));var moment=require(_0x841f('0x2'));var BPromise=require(_0x841f('0x3'));var rs=require(_0x841f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x841f('0x5'))['db'];var utils=require(_0x841f('0x6'));var logger=require(_0x841f('0x7'))('rpc');var config=require(_0x841f('0x8'));var jayson=require(_0x841f('0x9'));var client=jayson[_0x841f('0xa')][_0x841f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x586209,_0x496cdc,_0x40667f){return new BPromise(function(_0x50c5a4,_0x466742){return client[_0x841f('0xc')](_0x586209,_0x40667f)[_0x841f('0xd')](function(_0x490cd9){logger[_0x841f('0xe')](_0x841f('0xf'),_0x496cdc,'request\x20sent');logger[_0x841f('0x10')](_0x841f('0x11'),_0x496cdc,'request\x20sent',JSON['stringify'](_0x490cd9));if(_0x490cd9[_0x841f('0x12')]){if(_0x490cd9['error'][_0x841f('0x13')]===0x1f4){logger['error'](_0x841f('0xf'),_0x496cdc,_0x490cd9[_0x841f('0x12')][_0x841f('0x14')]);return _0x466742(_0x490cd9['error'][_0x841f('0x14')]);}logger[_0x841f('0x12')](_0x841f('0xf'),_0x496cdc,_0x490cd9['error'][_0x841f('0x14')]);return _0x50c5a4(_0x490cd9['error'][_0x841f('0x14')]);}else{logger['info'](_0x841f('0xf'),_0x496cdc,_0x841f('0x15'));_0x50c5a4(_0x490cd9[_0x841f('0x16')]['message']);}})['catch'](function(_0xd909e7){logger['error'](_0x841f('0xf'),_0x496cdc,_0xd909e7);_0x466742(_0xd909e7);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index e2db8f9..62ab9cd 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 _0xde0f=['removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','create','post','addDisposition','/:id/notify','notify','addApplications','/:id/send','send','status','addAgents','update','delete','destroy','/:id/canned_answers'];(function(_0x260458,_0x6dc18e){var _0x2b9cdc=function(_0x291ed9){while(--_0x291ed9){_0x260458['push'](_0x260458['shift']());}};_0x2b9cdc(++_0x6dc18e);}(_0xde0f,0xa2));var _0xfde0=function(_0x150277,_0x159962){_0x150277=_0x150277-0x0;var _0x14c3c6=_0xde0f[_0x150277];return _0x14c3c6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfde0('0x0'));var timeout=require(_0xfde0('0x1'));var express=require(_0xfde0('0x2'));var router=express[_0xfde0('0x3')]();var auth=require(_0xfde0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfde0('0x5'));var controller=require(_0xfde0('0x6'));router[_0xfde0('0x7')]('/',auth[_0xfde0('0x8')](),controller[_0xfde0('0x9')]);router[_0xfde0('0x7')](_0xfde0('0xa'),auth[_0xfde0('0x8')](),controller[_0xfde0('0xb')]);router[_0xfde0('0x7')](_0xfde0('0xc'),auth[_0xfde0('0x8')](),controller[_0xfde0('0xd')]);router['get'](_0xfde0('0xe'),auth[_0xfde0('0x8')](),controller[_0xfde0('0xf')]);router[_0xfde0('0x7')]('/:id/canned_answers',auth[_0xfde0('0x8')](),controller[_0xfde0('0x10')]);router[_0xfde0('0x7')](_0xfde0('0x11'),auth[_0xfde0('0x8')](),controller[_0xfde0('0x12')]);router[_0xfde0('0x7')](_0xfde0('0x13'),auth['isAuthenticated'](),controller[_0xfde0('0x14')]);router[_0xfde0('0x7')](_0xfde0('0x15'),controller['statusGet']);router[_0xfde0('0x7')](_0xfde0('0x16'),auth['isAuthenticated'](),controller[_0xfde0('0x17')]);router['post']('/',auth[_0xfde0('0x8')](),controller[_0xfde0('0x18')]);router[_0xfde0('0x19')](_0xfde0('0xe'),auth[_0xfde0('0x8')](),controller[_0xfde0('0x1a')]);router['post']('/:id/canned_answers',auth[_0xfde0('0x8')](),controller['addAnswer']);router[_0xfde0('0x19')](_0xfde0('0x1b'),controller[_0xfde0('0x1c')]);router[_0xfde0('0x19')]('/:id/applications',auth[_0xfde0('0x8')](),controller[_0xfde0('0x1d')]);router['post'](_0xfde0('0x1e'),auth[_0xfde0('0x8')](),controller[_0xfde0('0x1f')]);router[_0xfde0('0x19')]('/:id/status',controller[_0xfde0('0x20')]);router['post'](_0xfde0('0x16'),auth[_0xfde0('0x8')](),controller[_0xfde0('0x21')]);router['put'](_0xfde0('0xc'),auth['isAuthenticated'](),controller[_0xfde0('0x22')]);router[_0xfde0('0x23')](_0xfde0('0xc'),auth[_0xfde0('0x8')](),controller[_0xfde0('0x24')]);router[_0xfde0('0x23')]('/:id/dispositions',auth[_0xfde0('0x8')](),controller['removeDispositions']);router[_0xfde0('0x23')](_0xfde0('0x25'),auth[_0xfde0('0x8')](),controller['removeAnswers']);router['delete'](_0xfde0('0x16'),auth['isAuthenticated'](),controller[_0xfde0('0x26')]);module[_0xfde0('0x27')]=router; \ No newline at end of file +var _0x48ab=['./smsAccount.controller','get','index','/describe','describe','/:id','isAuthenticated','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','addApplications','/:id/send','send','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5e8e0e,_0x1b21cf){var _0x18e025=function(_0x482065){while(--_0x482065){_0x5e8e0e['push'](_0x5e8e0e['shift']());}};_0x18e025(++_0x1b21cf);}(_0x48ab,0x6b));var _0xb48a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x48ab[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0xb48a('0x0'));var path=require(_0xb48a('0x1'));var timeout=require(_0xb48a('0x2'));var express=require('express');var router=express[_0xb48a('0x3')]();var auth=require(_0xb48a('0x4'));var interaction=require(_0xb48a('0x5'));var config=require(_0xb48a('0x6'));var controller=require(_0xb48a('0x7'));router[_0xb48a('0x8')]('/',auth['isAuthenticated'](),controller[_0xb48a('0x9')]);router['get'](_0xb48a('0xa'),auth['isAuthenticated'](),controller[_0xb48a('0xb')]);router[_0xb48a('0x8')](_0xb48a('0xc'),auth[_0xb48a('0xd')](),controller['show']);router[_0xb48a('0x8')](_0xb48a('0xe'),auth[_0xb48a('0xd')](),controller[_0xb48a('0xf')]);router[_0xb48a('0x8')](_0xb48a('0x10'),auth[_0xb48a('0xd')](),controller[_0xb48a('0x11')]);router[_0xb48a('0x8')](_0xb48a('0x12'),auth[_0xb48a('0xd')](),controller['getApplications']);router[_0xb48a('0x8')](_0xb48a('0x13'),auth[_0xb48a('0xd')](),controller[_0xb48a('0x14')]);router['get'](_0xb48a('0x15'),controller[_0xb48a('0x16')]);router[_0xb48a('0x8')](_0xb48a('0x17'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xb48a('0xd')](),controller[_0xb48a('0x18')]);router[_0xb48a('0x19')](_0xb48a('0xe'),auth[_0xb48a('0xd')](),controller['addDisposition']);router['post'](_0xb48a('0x10'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xb48a('0x19')](_0xb48a('0x1a'),controller['notify']);router['post'](_0xb48a('0x12'),auth['isAuthenticated'](),controller[_0xb48a('0x1b')]);router[_0xb48a('0x19')](_0xb48a('0x1c'),auth[_0xb48a('0xd')](),controller[_0xb48a('0x1d')]);router[_0xb48a('0x19')](_0xb48a('0x15'),controller['status']);router[_0xb48a('0x19')](_0xb48a('0x17'),auth[_0xb48a('0xd')](),controller[_0xb48a('0x1e')]);router[_0xb48a('0x1f')](_0xb48a('0xc'),auth['isAuthenticated'](),controller[_0xb48a('0x20')]);router[_0xb48a('0x21')](_0xb48a('0xc'),auth[_0xb48a('0xd')](),controller[_0xb48a('0x22')]);router[_0xb48a('0x21')](_0xb48a('0xe'),auth[_0xb48a('0xd')](),controller['removeDispositions']);router[_0xb48a('0x21')](_0xb48a('0x10'),auth['isAuthenticated'](),controller[_0xb48a('0x23')]);router[_0xb48a('0x21')](_0xb48a('0x17'),auth[_0xb48a('0xd')](),controller[_0xb48a('0x24')]);module[_0xb48a('0x25')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 7d4280b..4d8ca19 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 _0x98bd=['csc','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','exports','name','STRING','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x98bd,0x1c2));var _0xd98b=function(_0x448ba9,_0x526356){_0x448ba9=_0x448ba9-0x0;var _0x43d66c=_0x98bd[_0x448ba9];return _0x43d66c;};'use strict';var Sequelize=require(_0xd98b('0x0'));var rs=require(_0xd98b('0x1'));module[_0xd98b('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xd98b('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xd98b('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xd98b('0x4')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd98b('0x5')](_0xd98b('0x6'),_0xd98b('0x7'),_0xd98b('0x8'),_0xd98b('0x9'),_0xd98b('0xa'),_0xd98b('0xb'),_0xd98b('0xc'),_0xd98b('0xd'),_0xd98b('0xe'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xd98b('0x4')]},'authToken':{'type':Sequelize[_0xd98b('0x4')]},'smsMethod':{'type':Sequelize[_0xd98b('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xd98b('0x4')]},'password':{'type':Sequelize[_0xd98b('0x4')]},'apiKey':{'type':Sequelize[_0xd98b('0x4')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xd98b('0x4')]},'notificationTemplate':{'type':Sequelize[_0xd98b('0xf')],'defaultValue':function(){return _0xd98b('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd98b('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd98b('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd98b('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd98b('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd98b('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xd98b('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd98b('0x12')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x14e3de){if(!_0x14e3de)this['setDataValue'](_0xd98b('0x13'),null);this[_0xd98b('0x14')]('mandatoryDisposition',_0x14e3de);}}}; \ No newline at end of file +var _0xa308=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','ENUM','skebby','connectel','clicksend','csc','infobip','intelepeer','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'];(function(_0x1e71a5,_0xd1a113){var _0x32c46e=function(_0x116d3b){while(--_0x116d3b){_0x1e71a5['push'](_0x1e71a5['shift']());}};_0x32c46e(++_0xd1a113);}(_0xa308,0x191));var _0x8a30=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa308[_0xf71120];return _0xbe2fd3;};'use strict';var Sequelize=require(_0x8a30('0x0'));var rs=require('randomstring');module[_0x8a30('0x1')]={'name':{'type':Sequelize[_0x8a30('0x2')],'unique':_0x8a30('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x8a30('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x8a30('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8a30('0x4')]();}},'phone':{'type':Sequelize[_0x8a30('0x2')]},'type':{'type':Sequelize[_0x8a30('0x5')]('twilio',_0x8a30('0x6'),_0x8a30('0x7'),_0x8a30('0x8'),'plivo','clickatell',_0x8a30('0x9'),_0x8a30('0xa'),_0x8a30('0xb'))},'accountSid':{'type':Sequelize[_0x8a30('0x2')]},'authId':{'type':Sequelize[_0x8a30('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x8a30('0x2')]},'password':{'type':Sequelize[_0x8a30('0x2')]},'apiKey':{'type':Sequelize[_0x8a30('0x2')]},'senderString':{'type':Sequelize[_0x8a30('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x8a30('0x2')]},'notificationTemplate':{'type':Sequelize[_0x8a30('0xc')],'defaultValue':function(){return _0x8a30('0xd');}},'notificationSound':{'type':Sequelize[_0x8a30('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8a30('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8a30('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8a30('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8a30('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8a30('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x8a30('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8a30('0xf')],'comment':_0x8a30('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x8a30('0xe')],'defaultValue':![],'comment':_0x8a30('0x11'),'set':function(_0x3a3cc0){if(!_0x3a3cc0)this[_0x8a30('0x12')](_0x8a30('0x13'),null);this[_0x8a30('0x12')](_0x8a30('0x14'),_0x3a3cc0);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 22c6b7c..bdda271 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 _0x8952=['mandatoryDispositionPause','map','SmsAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','Pause','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','update','body','describe','addDisposition','SmsAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','asc','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','type','twilio','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','clickatell','fromNumber','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','SmsInteraction','spread','interaction','created','autoclose','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','addApplications','sequelize','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','List','out','Messages','dataValues','push','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','error_code','inspect','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','csc','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','info','result','catch','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','destroy','get','SmsAccounts','stack','name','send','index'];(function(_0x4f7963,_0x3a8ee9){var _0x1fc0eb=function(_0x10d6dd){while(--_0x10d6dd){_0x4f7963['push'](_0x4f7963['shift']());}};_0x1fc0eb(++_0x3a8ee9);}(_0x8952,0x17e));var _0x2895=function(_0x3858f0,_0x3ba3cb){_0x3858f0=_0x3858f0-0x0;var _0xa1b46d=_0x8952[_0x3858f0];return _0xa1b46d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2895('0x0'));var rimraf=require(_0x2895('0x1'));var zipdir=require(_0x2895('0x2'));var jsonpatch=require(_0x2895('0x3'));var rp=require(_0x2895('0x4'));var moment=require('moment');var BPromise=require(_0x2895('0x5'));var Mustache=require(_0x2895('0x6'));var util=require(_0x2895('0x7'));var path=require('path');var sox=require(_0x2895('0x8'));var csv=require(_0x2895('0x9'));var ejs=require(_0x2895('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2895('0xb'));var jsforce=require(_0x2895('0xc'));var deskjs=require(_0x2895('0xd'));var toCsv=require(_0x2895('0x9'));var querystring=require(_0x2895('0xe'));var Papa=require('papaparse');var Redis=require(_0x2895('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2895('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2895('0x11'));var utils=require(_0x2895('0x12'));var config=require(_0x2895('0x13'));var db=require('../../mysqldb')['db'];config[_0x2895('0x14')]=_[_0x2895('0x15')](config['redis'],{'host':_0x2895('0x16'),'port':0x18eb});var socket=require(_0x2895('0x17'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x2895('0x18')](socket);var jayson=require(_0x2895('0x19'));var client=jayson['client'][_0x2895('0x1a')]({'port':0x232c});function checkPasswordPattern(_0xd8192e,_0x27b50e,_0x1ae013){if(_0x1ae013){var _0x1d3659=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d3659[_0x2895('0x1b')](_0x27b50e)){return _0xd8192e;}else{throw new db[(_0x2895('0x1c'))][(_0x2895('0x1d'))](_0x2895('0x1e'));}}else{return _0xd8192e;}}function respondWithRpcPromise(_0x407b86,_0x10a1bf,_0x183b05,_0xbf8b63){return new BPromise(function(_0x2cb505,_0x155124){var _0x184d11=_0xbf8b63||client;return _0x184d11[_0x2895('0x1f')](_0x407b86,_0x183b05)[_0x2895('0x20')](function(_0x5a8eab){logger['info']('SmsAccount,\x20%s,\x20%s',_0x10a1bf,_0x2895('0x21'));logger[_0x2895('0x22')](_0x2895('0x23'),_0x10a1bf,'request\x20sent',JSON[_0x2895('0x24')](_0x5a8eab));if(_0x5a8eab[_0x2895('0x25')]){if(_0x5a8eab[_0x2895('0x25')][_0x2895('0x26')]===0x1f4){logger[_0x2895('0x25')]('SmsAccount,\x20%s,\x20%s',_0x10a1bf,_0x5a8eab[_0x2895('0x25')][_0x2895('0x27')]);return _0x155124(_0x5a8eab['error'][_0x2895('0x27')]);}logger[_0x2895('0x25')](_0x2895('0x28'),_0x10a1bf,_0x5a8eab['error']['message']);return _0x2cb505(_0x5a8eab[_0x2895('0x25')][_0x2895('0x27')]);}else{logger[_0x2895('0x29')]('SmsAccount,\x20%s,\x20%s',_0x10a1bf,_0x2895('0x21'));_0x2cb505(_0x5a8eab[_0x2895('0x2a')]['message']);}})[_0x2895('0x2b')](function(_0x127540){logger[_0x2895('0x25')]('SmsAccount,\x20%s,\x20%s',_0x10a1bf,_0x127540);_0x155124(_0x127540);});});}function respondWithStatusCode(_0x320661,_0x30f491){_0x30f491=_0x30f491||0xcc;return function(_0x5eedfc){if(_0x5eedfc){return _0x320661[_0x2895('0x2c')](_0x30f491);}return _0x320661['status'](_0x30f491)['end']();};}function respondWithResult(_0x18a935,_0x4ee2cc){_0x4ee2cc=_0x4ee2cc||0xc8;return function(_0xfa4f85){if(_0xfa4f85){return _0x18a935[_0x2895('0x2d')](_0x4ee2cc)['json'](_0xfa4f85);}};}function respondWithFilteredResult(_0x5574bf,_0x32db49){return function(_0x30dc2f){if(_0x30dc2f){var _0x190e07=_0x30dc2f[_0x2895('0x2e')],_0x14e343=_0x32db49['offset'],_0x14d150=_0x32db49[_0x2895('0x2f')]+_0x32db49[_0x2895('0x30')],_0xa61689;if(_0x14d150>=_0x190e07){_0x14d150=_0x190e07;_0xa61689=0xc8;}else{_0xa61689=0xce;}_0x5574bf[_0x2895('0x2d')](_0xa61689);return _0x5574bf['set'](_0x2895('0x31'),_0x14e343+'-'+_0x14d150+'/'+_0x190e07)[_0x2895('0x32')](_0x30dc2f);}return null;};}function patchUpdates(_0x31ab90){return function(_0x35a2e8){try{jsonpatch['apply'](_0x35a2e8,_0x31ab90,!![]);}catch(_0xf9bd97){return BPromise[_0x2895('0x33')](_0xf9bd97);}return _0x35a2e8[_0x2895('0x34')]();};}function saveUpdates(_0x35091a,_0x98df92){return function(_0x56010d){if(_0x56010d){return _0x56010d['update'](_0x35091a)[_0x2895('0x20')](function(_0xf3c8f7){return _0xf3c8f7;});}return null;};}function removeEntity(_0x5bbf16,_0x3abb80){return function(_0x5d3c9b){if(_0x5d3c9b){return _0x5d3c9b[_0x2895('0x35')]()[_0x2895('0x20')](function(){var _0x586c4a=_0x5d3c9b[_0x2895('0x36')]({'plain':!![]});var _0x55dd90=_0x2895('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x55dd90,'resourceId':_0x586c4a['id']}})[_0x2895('0x20')](function(){return _0x5d3c9b;});})[_0x2895('0x20')](function(){_0x5bbf16[_0x2895('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e4348,_0x15772b){return function(_0x38f954){if(!_0x38f954){_0x1e4348[_0x2895('0x2c')](0x194);}return _0x38f954;};}function handleError(_0x3a4081,_0x3a29ac){_0x3a29ac=_0x3a29ac||0x1f4;return function(_0xf44bda){logger[_0x2895('0x25')](_0xf44bda[_0x2895('0x38')]);if(_0xf44bda[_0x2895('0x39')]){delete _0xf44bda['name'];}_0x3a4081[_0x2895('0x2d')](_0x3a29ac)[_0x2895('0x3a')](_0xf44bda);};}exports[_0x2895('0x3b')]=function(_0x1e5788,_0x41a66b){var _0x12d7d8={'include':[{'model':db['Pause'],'as':_0x2895('0x3c')}]},_0x1c1d8e={},_0x54033c={'count':0x0,'rows':[]};var _0x29dc63=_[_0x2895('0x3d')](db[_0x2895('0x3e')][_0x2895('0x3f')],function(_0x18464f){return{'name':_0x18464f['fieldName'],'type':_0x18464f['type'][_0x2895('0x40')]};});_0x1c1d8e[_0x2895('0x41')]=_['map'](_0x29dc63,'name');_0x1c1d8e[_0x2895('0x42')]=_[_0x2895('0x43')](_0x1e5788[_0x2895('0x42')]);_0x1c1d8e[_0x2895('0x44')]=_[_0x2895('0x45')](_0x1c1d8e[_0x2895('0x41')],_0x1c1d8e['query']);_0x12d7d8[_0x2895('0x46')]=_[_0x2895('0x45')](_0x1c1d8e[_0x2895('0x41')],qs[_0x2895('0x47')](_0x1e5788['query'][_0x2895('0x47')]));_0x12d7d8[_0x2895('0x46')]=_0x12d7d8[_0x2895('0x46')][_0x2895('0x48')]?_0x12d7d8['attributes']:_0x1c1d8e['model'];if(!_0x1e5788[_0x2895('0x42')][_0x2895('0x49')](_0x2895('0x4a'))){_0x12d7d8[_0x2895('0x30')]=qs[_0x2895('0x30')](_0x1e5788['query']['limit']);_0x12d7d8[_0x2895('0x2f')]=qs[_0x2895('0x2f')](_0x1e5788[_0x2895('0x42')][_0x2895('0x2f')]);}_0x12d7d8[_0x2895('0x4b')]=qs[_0x2895('0x4c')](_0x1e5788[_0x2895('0x42')]['sort']);_0x12d7d8[_0x2895('0x4d')]=qs[_0x2895('0x44')](_[_0x2895('0x4e')](_0x1e5788[_0x2895('0x42')],_0x1c1d8e[_0x2895('0x44')]));if(_0x1e5788[_0x2895('0x42')][_0x2895('0x4f')]){_0x12d7d8[_0x2895('0x4d')]=_['merge'](_0x12d7d8[_0x2895('0x4d')],{'$or':_[_0x2895('0x3d')](_0x29dc63,function(_0x3ab7ae){if(_0x3ab7ae['type']!==_0x2895('0x50')){var _0x5307a9={};_0x5307a9[_0x3ab7ae['name']]={'$like':'%'+_0x1e5788[_0x2895('0x42')][_0x2895('0x4f')]+'%'};return _0x5307a9;}})});}_0x12d7d8=_[_0x2895('0x51')]({},_0x12d7d8,_0x1e5788[_0x2895('0x52')]);var _0x8acfb8={'where':_0x12d7d8[_0x2895('0x4d')]};return db[_0x2895('0x3e')]['count'](_0x8acfb8)[_0x2895('0x20')](function(_0x44e26a){_0x54033c['count']=_0x44e26a;if(_0x1e5788['query']['includeAll']){_0x12d7d8[_0x2895('0x53')]=[{'all':!![]}];}return db[_0x2895('0x3e')][_0x2895('0x54')](_0x12d7d8);})[_0x2895('0x20')](function(_0x35a03c){_0x54033c[_0x2895('0x55')]=_0x35a03c;return _0x54033c;})[_0x2895('0x20')](respondWithFilteredResult(_0x41a66b,_0x12d7d8))[_0x2895('0x2b')](handleError(_0x41a66b,null));};exports[_0x2895('0x56')]=function(_0x3d043c,_0x45302c){var _0x25e6cd={'raw':![],'where':{'id':_0x3d043c[_0x2895('0x57')]['id']},'include':[{'model':db[_0x2895('0x58')],'as':_0x2895('0x3c')}]},_0x11eadc={};_0x11eadc[_0x2895('0x41')]=_[_0x2895('0x43')](db[_0x2895('0x3e')][_0x2895('0x3f')]);_0x11eadc[_0x2895('0x42')]=_[_0x2895('0x43')](_0x3d043c[_0x2895('0x42')]);_0x11eadc[_0x2895('0x44')]=_[_0x2895('0x45')](_0x11eadc[_0x2895('0x41')],_0x11eadc[_0x2895('0x42')]);_0x25e6cd[_0x2895('0x46')]=_[_0x2895('0x45')](_0x11eadc[_0x2895('0x41')],qs[_0x2895('0x47')](_0x3d043c['query'][_0x2895('0x47')]));_0x25e6cd[_0x2895('0x46')]=_0x25e6cd[_0x2895('0x46')][_0x2895('0x48')]?_0x25e6cd[_0x2895('0x46')]:_0x11eadc[_0x2895('0x41')];if(_0x3d043c['query'][_0x2895('0x59')]){_0x25e6cd['include']=[{'all':!![]}];}_0x25e6cd=_[_0x2895('0x51')]({},_0x25e6cd,_0x3d043c[_0x2895('0x52')]);return db[_0x2895('0x3e')][_0x2895('0x5a')](_0x25e6cd)[_0x2895('0x20')](handleEntityNotFound(_0x45302c,null))['then'](respondWithResult(_0x45302c,null))['catch'](handleError(_0x45302c,null));};exports[_0x2895('0x5b')]=function(_0x11d336,_0x197503){return db['SmsAccount'][_0x2895('0x5b')](_0x11d336['body'],{})[_0x2895('0x20')](function(_0x4b09ce){var _0x511b77=_0x11d336['user']['get']({'plain':!![]});if(!_0x511b77)throw new Error(_0x2895('0x5c'));if(_0x511b77[_0x2895('0x5d')]===_0x2895('0x5e')){var _0x4336c=_0x4b09ce[_0x2895('0x36')]({'plain':!![]});var _0x422a61=_0x2895('0x37');return db['UserProfileSection'][_0x2895('0x5a')]({'where':{'name':_0x422a61,'userProfileId':_0x511b77[_0x2895('0x5f')]},'raw':!![]})['then'](function(_0xab87c2){if(_0xab87c2&&_0xab87c2['autoAssociation']===0x0){return db['UserProfileResource'][_0x2895('0x5b')]({'name':_0x4336c[_0x2895('0x39')],'resourceId':_0x4336c['id'],'type':_0xab87c2['name'],'sectionId':_0xab87c2['id']},{})[_0x2895('0x20')](function(){return _0x4b09ce;});}else{return _0x4b09ce;}})[_0x2895('0x2b')](function(_0x35d979){logger[_0x2895('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35d979);throw _0x35d979;});}return _0x4b09ce;})[_0x2895('0x20')](respondWithResult(_0x197503,0xc9))['catch'](handleError(_0x197503,null));};exports[_0x2895('0x60')]=function(_0x5b6770,_0x5eb8b7){if(_0x5b6770[_0x2895('0x61')]['id']){delete _0x5b6770['body']['id'];}return db[_0x2895('0x3e')][_0x2895('0x5a')]({'where':{'id':_0x5b6770[_0x2895('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x2895('0x3c')}]})[_0x2895('0x20')](handleEntityNotFound(_0x5eb8b7,null))['then'](saveUpdates(_0x5b6770['body'],null))[_0x2895('0x20')](respondWithResult(_0x5eb8b7,null))[_0x2895('0x2b')](handleError(_0x5eb8b7,null));};exports['destroy']=function(_0x31505c,_0x53f9d8){return db['SmsAccount'][_0x2895('0x5a')]({'where':{'id':_0x31505c[_0x2895('0x57')]['id']}})[_0x2895('0x20')](handleEntityNotFound(_0x53f9d8,null))['then'](removeEntity(_0x53f9d8,null))[_0x2895('0x2b')](handleError(_0x53f9d8,null));};exports[_0x2895('0x62')]=function(_0x1374bc,_0x1fe575){return db[_0x2895('0x3e')][_0x2895('0x62')]()[_0x2895('0x20')](respondWithResult(_0x1fe575,null))['catch'](handleError(_0x1fe575,null));};exports[_0x2895('0x63')]=function(_0x2543a7,_0x40eb11,_0x115e04){if(_0x2543a7[_0x2895('0x61')]['id']){delete _0x2543a7[_0x2895('0x61')]['id'];}return db[_0x2895('0x3e')][_0x2895('0x5a')]({'where':{'id':_0x2543a7['params']['id']}})[_0x2895('0x20')](handleEntityNotFound(_0x40eb11,null))[_0x2895('0x20')](function(_0x16f369){if(_0x16f369){_0x2543a7[_0x2895('0x61')][_0x2895('0x64')]=_0x16f369['id'];return db[_0x2895('0x65')][_0x2895('0x5b')](_0x2543a7[_0x2895('0x61')]);}})[_0x2895('0x20')](respondWithResult(_0x40eb11,null))[_0x2895('0x2b')](handleError(_0x40eb11,null));};exports['getDispositions']=function(_0x477385,_0x1a2045,_0xd90e52){var _0x29f677={'raw':![],'where':{}};var _0x365087={};var _0x44a516={'count':0x0,'rows':[]};return db[_0x2895('0x3e')][_0x2895('0x66')]({'where':{'id':_0x477385[_0x2895('0x57')]['id']}})[_0x2895('0x20')](handleEntityNotFound(_0x1a2045,null))['then'](function(_0x37824b){if(_0x37824b){_0x365087[_0x2895('0x41')]=_[_0x2895('0x43')](db[_0x2895('0x65')][_0x2895('0x3f')]);_0x365087['query']=_[_0x2895('0x43')](_0x477385[_0x2895('0x42')]);_0x365087['filters']=_['intersection'](_0x365087['model'],_0x365087[_0x2895('0x42')]);_0x29f677[_0x2895('0x46')]=_[_0x2895('0x45')](_0x365087[_0x2895('0x41')],qs[_0x2895('0x47')](_0x477385['query']['fields']));_0x29f677[_0x2895('0x46')]=_0x29f677['attributes'][_0x2895('0x48')]?_0x29f677['attributes']:_0x365087[_0x2895('0x41')];if(!_0x477385[_0x2895('0x42')]['hasOwnProperty'](_0x2895('0x4a'))){_0x29f677[_0x2895('0x30')]=qs[_0x2895('0x30')](_0x477385[_0x2895('0x42')]['limit']);_0x29f677['offset']=qs[_0x2895('0x2f')](_0x477385['query']['offset']);}_0x29f677[_0x2895('0x4b')]=qs[_0x2895('0x4c')](_0x477385[_0x2895('0x42')][_0x2895('0x4c')]);_0x29f677['where']=qs[_0x2895('0x44')](_[_0x2895('0x4e')](_0x477385[_0x2895('0x42')],_0x365087[_0x2895('0x44')]));_0x29f677[_0x2895('0x4d')][_0x2895('0x64')]=_0x37824b['id'];if(_0x477385[_0x2895('0x42')][_0x2895('0x4f')]){_0x29f677[_0x2895('0x4d')]=_[_0x2895('0x51')](_0x29f677[_0x2895('0x4d')],{'$or':_[_0x2895('0x3d')](_0x29f677['attributes'],function(_0x1a9c84){var _0x11127b={};_0x11127b[_0x1a9c84]={'$like':'%'+_0x477385[_0x2895('0x42')]['filter']+'%'};return _0x11127b;})});}_0x29f677=_[_0x2895('0x51')]({},_0x29f677,_0x477385[_0x2895('0x52')]);return db['Disposition'][_0x2895('0x2e')]({'where':_0x29f677[_0x2895('0x4d')]})[_0x2895('0x20')](function(_0x5c7fbb){_0x44a516[_0x2895('0x2e')]=_0x5c7fbb;if(_0x477385[_0x2895('0x42')][_0x2895('0x59')]){_0x29f677[_0x2895('0x53')]=[{'all':!![]}];}return db['Disposition'][_0x2895('0x54')](_0x29f677);})[_0x2895('0x20')](function(_0x465c50){_0x44a516['rows']=_0x465c50;return _0x44a516;});}})[_0x2895('0x20')](respondWithFilteredResult(_0x1a2045,_0x29f677))['catch'](handleError(_0x1a2045,null));};exports[_0x2895('0x67')]=function(_0x136321,_0x38c93e,_0x253e07){return db['SmsAccount'][_0x2895('0x5a')]({'where':{'id':_0x136321[_0x2895('0x57')]['id']}})[_0x2895('0x20')](handleEntityNotFound(_0x38c93e,null))['then'](function(_0x34898e){if(_0x34898e){return _0x34898e['removeDispositions'](_0x136321[_0x2895('0x42')][_0x2895('0x68')]);}})['then'](respondWithStatusCode(_0x38c93e,null))['catch'](handleError(_0x38c93e,null));};exports[_0x2895('0x69')]=function(_0x2953ab,_0x5ad9ce,_0x17b607){if(_0x2953ab[_0x2895('0x61')]['id']){delete _0x2953ab['body']['id'];}return db[_0x2895('0x3e')][_0x2895('0x5a')]({'where':{'id':_0x2953ab[_0x2895('0x57')]['id']}})[_0x2895('0x20')](handleEntityNotFound(_0x5ad9ce,null))[_0x2895('0x20')](function(_0x52afe6){if(_0x52afe6){_0x2953ab[_0x2895('0x61')][_0x2895('0x64')]=_0x52afe6['id'];return db[_0x2895('0x6a')][_0x2895('0x5b')](_0x2953ab[_0x2895('0x61')]);}})['then'](respondWithResult(_0x5ad9ce,null))[_0x2895('0x2b')](handleError(_0x5ad9ce,null));};exports[_0x2895('0x6b')]=function(_0x1b5a28,_0x1cc5f6,_0x5d5048){var _0xd2fa85={'raw':![],'where':{}};var _0x1d61ee={};var _0x198c58={'count':0x0,'rows':[]};return db[_0x2895('0x3e')]['findOne']({'where':{'id':_0x1b5a28[_0x2895('0x57')]['id']}})[_0x2895('0x20')](handleEntityNotFound(_0x1cc5f6,null))[_0x2895('0x20')](function(_0x12cc7b){if(_0x12cc7b){_0x1d61ee[_0x2895('0x41')]=_[_0x2895('0x43')](db['CannedAnswer'][_0x2895('0x3f')]);_0x1d61ee[_0x2895('0x42')]=_[_0x2895('0x43')](_0x1b5a28['query']);_0x1d61ee['filters']=_[_0x2895('0x45')](_0x1d61ee[_0x2895('0x41')],_0x1d61ee[_0x2895('0x42')]);_0xd2fa85[_0x2895('0x46')]=_[_0x2895('0x45')](_0x1d61ee['model'],qs[_0x2895('0x47')](_0x1b5a28[_0x2895('0x42')][_0x2895('0x47')]));_0xd2fa85['attributes']=_0xd2fa85['attributes'][_0x2895('0x48')]?_0xd2fa85[_0x2895('0x46')]:_0x1d61ee[_0x2895('0x41')];if(!_0x1b5a28['query'][_0x2895('0x49')](_0x2895('0x4a'))){_0xd2fa85[_0x2895('0x30')]=qs[_0x2895('0x30')](_0x1b5a28['query'][_0x2895('0x30')]);_0xd2fa85[_0x2895('0x2f')]=qs[_0x2895('0x2f')](_0x1b5a28[_0x2895('0x42')][_0x2895('0x2f')]);}_0xd2fa85[_0x2895('0x4b')]=qs[_0x2895('0x4c')](_0x1b5a28[_0x2895('0x42')][_0x2895('0x4c')]);_0xd2fa85[_0x2895('0x4d')]=qs[_0x2895('0x44')](_[_0x2895('0x4e')](_0x1b5a28[_0x2895('0x42')],_0x1d61ee[_0x2895('0x44')]));_0xd2fa85['where']['SmsAccountId']=_0x12cc7b['id'];if(_0x1b5a28['query']['filter']){_0xd2fa85[_0x2895('0x4d')]=_[_0x2895('0x51')](_0xd2fa85[_0x2895('0x4d')],{'$or':_[_0x2895('0x3d')](_0xd2fa85[_0x2895('0x46')],function(_0x309b79){var _0x8278ab={};_0x8278ab[_0x309b79]={'$like':'%'+_0x1b5a28[_0x2895('0x42')][_0x2895('0x4f')]+'%'};return _0x8278ab;})});}_0xd2fa85=_[_0x2895('0x51')]({},_0xd2fa85,_0x1b5a28[_0x2895('0x52')]);return db[_0x2895('0x6a')][_0x2895('0x2e')]({'where':_0xd2fa85[_0x2895('0x4d')]})['then'](function(_0x378743){_0x198c58[_0x2895('0x2e')]=_0x378743;if(_0x1b5a28[_0x2895('0x42')]['includeAll']){_0xd2fa85['include']=[{'all':!![]}];}return db[_0x2895('0x6a')][_0x2895('0x54')](_0xd2fa85);})['then'](function(_0x2348be){_0x198c58['rows']=_0x2348be;return _0x198c58;});}})[_0x2895('0x20')](respondWithFilteredResult(_0x1cc5f6,_0xd2fa85))[_0x2895('0x2b')](handleError(_0x1cc5f6,null));};exports[_0x2895('0x6c')]=function(_0xe06543,_0x32f6ac,_0x44d95d){return db[_0x2895('0x3e')]['find']({'where':{'id':_0xe06543[_0x2895('0x57')]['id']}})[_0x2895('0x20')](handleEntityNotFound(_0x32f6ac,null))['then'](function(_0x2bb3d1){if(_0x2bb3d1){return _0x2bb3d1[_0x2895('0x6c')](_0xe06543['query'][_0x2895('0x68')]);}})[_0x2895('0x20')](respondWithStatusCode(_0x32f6ac,null))[_0x2895('0x2b')](handleError(_0x32f6ac,null));};exports[_0x2895('0x6d')]=function(_0x272318,_0x3cda01,_0x3cc020){var _0x8de9e6={'channel':_0x2895('0x6e')};var _0x305511=[];var _0x1bada9=[];var _0x3d3e82={};return db[_0x2895('0x3e')][_0x2895('0x5a')]({'where':{'id':_0x272318['params']['id']},'include':[{'model':db[_0x2895('0x6f')],'as':_0x2895('0x70')}]})[_0x2895('0x20')](handleEntityNotFound(_0x3cda01,null))[_0x2895('0x20')](function(_0x3ea24c){_0x8de9e6[_0x2895('0x71')]=_0x3ea24c;_0x8de9e6[_0x2895('0x72')]=_['orderBy'](_0x3ea24c[_0x2895('0x70')],['priority'],[_0x2895('0x73')]);if(_0x8de9e6['account'][_0x2895('0x70')]){delete _0x8de9e6[_0x2895('0x71')][_0x2895('0x70')];}return db[_0x2895('0x74')][_0x2895('0x62')]();})['then'](function(_0x3f024f){if(!_0x3f024f){throw new db[(_0x2895('0x1c'))][(_0x2895('0x1d'))](_0x2895('0x75'));}_0x305511=_[_0x2895('0x76')](_[_0x2895('0x43')](_0x3f024f),[_0x2895('0x77'),'updatedAt']);_0x1bada9=_[_0x2895('0x76')](_[_0x2895('0x43')](_0x3f024f),[_0x2895('0x77'),_0x2895('0x78'),'CompanyId',_0x2895('0x79')]);_0x8de9e6[_0x2895('0x61')]={'mapKey':_0x2895('0x7a')};if(_0x8de9e6['account'][_0x2895('0x7b')]){switch(_0x8de9e6[_0x2895('0x71')][_0x2895('0x7b')]){case _0x2895('0x7c'):_0x8de9e6[_0x2895('0x61')][_0x2895('0x7d')]=_0x272318[_0x2895('0x61')][_0x2895('0x7e')];_0x8de9e6[_0x2895('0x61')][_0x2895('0x61')]=_0x272318[_0x2895('0x61')][_0x2895('0x7f')];_0x8de9e6[_0x2895('0x61')][_0x2895('0x80')]=_0x272318[_0x2895('0x61')][_0x2895('0x81')];break;case _0x2895('0x82'):_0x8de9e6[_0x2895('0x61')][_0x2895('0x7d')]='+'+_0x272318['body']['sender'];_0x8de9e6[_0x2895('0x61')][_0x2895('0x61')]=_0x272318[_0x2895('0x61')][_0x2895('0x83')];break;case _0x2895('0x84'):_0x8de9e6[_0x2895('0x61')]['from']=_0x272318['body']['from'];_0x8de9e6[_0x2895('0x61')]['body']=_0x272318[_0x2895('0x61')][_0x2895('0x27')];break;case _0x2895('0x85'):_0x8de9e6['body'][_0x2895('0x7d')]=_0x272318[_0x2895('0x61')][_0x2895('0x7d')];_0x8de9e6['body'][_0x2895('0x61')]=_0x272318[_0x2895('0x61')][_0x2895('0x61')];_0x8de9e6[_0x2895('0x61')][_0x2895('0x80')]=_0x272318[_0x2895('0x61')][_0x2895('0x86')];break;case _0x2895('0x87'):_0x8de9e6['body'][_0x2895('0x7d')]=_0x272318[_0x2895('0x61')][_0x2895('0x7e')];_0x8de9e6[_0x2895('0x61')]['body']=_0x272318['body'][_0x2895('0x88')];_0x8de9e6[_0x2895('0x61')][_0x2895('0x80')]=_0x272318[_0x2895('0x61')][_0x2895('0x89')];break;case _0x2895('0x8a'):_0x8de9e6['body'][_0x2895('0x7d')]='+'+_0x272318[_0x2895('0x61')][_0x2895('0x8b')][0x0][_0x2895('0x7d')];_0x8de9e6['body'][_0x2895('0x61')]=_0x272318['body']['results'][0x0]['text'];_0x8de9e6[_0x2895('0x61')]['messageId']=_0x272318['body']['results'][0x0]['messageId'];break;case'csc':_0x8de9e6[_0x2895('0x61')][_0x2895('0x7d')]=_0x272318[_0x2895('0x61')][_0x2895('0x8c')];_0x8de9e6['body']['body']=_0x272318['body'][_0x2895('0x8d')][_0x2895('0x27')];break;case _0x2895('0x8e'):_0x8de9e6[_0x2895('0x61')][_0x2895('0x7d')]=_0x272318[_0x2895('0x61')][_0x2895('0x8f')];_0x8de9e6[_0x2895('0x61')]['body']=_0x272318[_0x2895('0x61')][_0x2895('0x83')];_0x8de9e6[_0x2895('0x61')]['messageId']=_0x272318[_0x2895('0x61')]['replyMessageId'];break;case _0x2895('0x90'):_0x8de9e6[_0x2895('0x61')][_0x2895('0x7d')]=_0x272318[_0x2895('0x61')]['from'];_0x8de9e6[_0x2895('0x61')][_0x2895('0x61')]=_0x272318[_0x2895('0x61')][_0x2895('0x27')];_0x8de9e6[_0x2895('0x61')]['messageId']=_0x272318[_0x2895('0x61')][_0x2895('0x91')];break;}}if(_0x8de9e6[_0x2895('0x61')]['id']){delete _0x8de9e6[_0x2895('0x61')]['id'];}if(_[_0x2895('0x92')](_0x8de9e6[_0x2895('0x61')]['from'])){throw new db['Sequelize']['ValidationError'](_0x2895('0x93'));}if(_[_0x2895('0x92')](_0x8de9e6[_0x2895('0x61')][_0x2895('0x61')])||_0x8de9e6[_0x2895('0x61')][_0x2895('0x61')]===''){throw new db[(_0x2895('0x1c'))][(_0x2895('0x1d'))](_0x2895('0x94'));}if(_[_0x2895('0x92')](_0x8de9e6[_0x2895('0x61')]['mapKey'])){throw new db[(_0x2895('0x1c'))]['ValidationError'](_0x2895('0x95')+_0x1bada9);}if(!_['includes'](_0x1bada9,_0x8de9e6[_0x2895('0x61')][_0x2895('0x96')])){throw new db['Sequelize']['ValidationError'](_0x2895('0x97')+_0x1bada9);}_0x3d3e82[_0x8de9e6[_0x2895('0x61')][_0x2895('0x96')]]=_0x8de9e6[_0x2895('0x61')][_0x2895('0x7d')];return db[_0x2895('0x98')][_0x2895('0x5a')]({'where':{'id':_0x8de9e6[_0x2895('0x71')][_0x2895('0x79')]},'include':[{'model':db[_0x2895('0x74')],'as':_0x2895('0x99'),'where':_0x3d3e82,'limit':0x1,'order':[[_0x2895('0x78'),_0x2895('0x9a')]]}]});})[_0x2895('0x20')](handleEntityNotFound(_0x3cda01,null))['then'](function(_0x5f1c3e){if(_0x5f1c3e){_0x8de9e6[_0x2895('0x9b')]=_['omit'](_0x5f1c3e,[_0x2895('0x99')]);if(_0x5f1c3e[_0x2895('0x99')][_0x2895('0x48')]){return _0x5f1c3e[_0x2895('0x99')][0x0];}var _0x38f137=_[_0x2895('0x15')](_0x8de9e6[_0x2895('0x61')],{'firstName':_0x8de9e6[_0x2895('0x61')][_0x2895('0x7d')],'ListId':_0x5f1c3e['id']});_0x38f137[_0x8de9e6[_0x2895('0x61')]['mapKey']]=_0x8de9e6[_0x2895('0x61')][_0x2895('0x7d')];return db[_0x2895('0x74')]['create'](_0x38f137,{'fields':_0x305511,'raw':!![]});}})[_0x2895('0x20')](handleEntityNotFound(_0x3cda01,null))[_0x2895('0x20')](function(_0x3608e3){if(_0x3608e3){_0x8de9e6[_0x2895('0x9c')]=_0x3608e3;var _0x4e46ff={'ContactId':_0x3608e3['id'],'phone':_0x8de9e6['body']['from'],'SmsAccountId':_0x272318[_0x2895('0x57')]['id']};var _0x32edce={'ContactId':_0x3608e3['id'],'SmsAccountId':_0x272318[_0x2895('0x57')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x32edce})[_0x2895('0x20')](function(_0x551809){if(_0x551809){return[_0x551809,![]];}return db[_0x2895('0x9d')][_0x2895('0x5b')](_0x4e46ff)['then'](function(_0x2e935c){return[_0x2e935c,!![]];});});}})[_0x2895('0x9e')](function(_0x1631dd,_0x5aac13){_0x8de9e6[_0x2895('0x9f')]=_0x1631dd[_0x2895('0x36')]({'plain':!![]});_0x8de9e6[_0x2895('0x9f')][_0x2895('0xa0')]=![];if(_0x5aac13){if(_0x8de9e6[_0x2895('0x71')][_0x2895('0xa1')]){_0x8de9e6[_0x2895('0x72')]['push']({'id':0x0,'priority':_0x8de9e6[_0x2895('0x72')][_0x2895('0x48')]+0x1,'app':'close','appdata':_0x2895('0xa2'),'interval':_0x2895('0xa3')});}_0x8de9e6['interaction'][_0x2895('0xa0')]=!![];}return db[_0x2895('0xa4')][_0x2895('0x5b')]({'phone':_0x8de9e6[_0x2895('0x61')][_0x2895('0x7d')],'messageId':_0x8de9e6['body'][_0x2895('0x80')],'body':_0x8de9e6['body'][_0x2895('0x61')],'SmsAccountId':_0x272318[_0x2895('0x57')]['id'],'SmsInteractionId':_0x1631dd['id'],'direction':'in','ContactId':_0x1631dd['ContactId'],'AttachmentId':_0x8de9e6['body'][_0x2895('0xa5')]});})[_0x2895('0x20')](function(_0xb51846){_0x8de9e6['message']=_0xb51846;if(_0x8de9e6['interaction'][_0x2895('0xa6')]){return db[_0x2895('0xa7')][_0x2895('0x5a')]({'attributes':['id',_0x2895('0x39')],'where':{'id':_0x8de9e6[_0x2895('0x9f')][_0x2895('0xa6')]}})[_0x2895('0x20')](function(_0xd91631){if(_0xd91631){_0x8de9e6['applications'][_0x2895('0xa8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xd91631['name']+','+(_0x8de9e6['account'][_0x2895('0xa9')]||0xa),'interval':_0x2895('0xa3')});}return respondWithRpcPromise(_0x2895('0xaa'),'startRouting',_0x8de9e6);});}return respondWithRpcPromise(_0x2895('0xaa'),_0x2895('0xab'),_0x8de9e6);})[_0x2895('0x20')](function(_0x1ceb55){if(_0x1ceb55){var _0x30b1e5=0xc8;var _0x5b5c18=_0x2895('0xac');logger[_0x2895('0x29')](_0x2895('0x23'),_0x5b5c18,_0x30b1e5,'entity\x20found');logger[_0x2895('0x22')](_0x2895('0xad'),_0x5b5c18,_0x30b1e5,'entity\x20found',JSON[_0x2895('0x24')](_0x1ceb55));if(_0x8de9e6[_0x2895('0x71')][_0x2895('0x7b')]==='twilio'){return _0x3cda01[_0x2895('0x2d')](_0x30b1e5)[_0x2895('0xae')](_0x2895('0xaf'),_0x2895('0xb0'))[_0x2895('0x3a')](_0x2895('0xb1'));}else{return _0x3cda01[_0x2895('0x2d')](_0x30b1e5)['json'](_0x1ceb55);}}})[_0x2895('0x2b')](handleError(_0x3cda01,null));};exports[_0x2895('0xb2')]=function(_0x1a45c6,_0x49e536,_0x117746){return db['SmsAccount']['findOne']({'where':{'id':_0x1a45c6[_0x2895('0x57')]['id']}})['then'](handleEntityNotFound(_0x49e536,null))[_0x2895('0x20')](function(_0x155370){if(_0x155370){return db[_0x2895('0xb3')]['transaction'](function(_0x4f9640){return db[_0x2895('0x6f')]['destroy']({'where':{'SmsAccountId':_0x1a45c6[_0x2895('0x57')]['id']},'transaction':_0x4f9640})[_0x2895('0x20')](function(_0x36af1b){var _0x2fa188=_['map'](_0x1a45c6[_0x2895('0x61')],function(_0xdeee40){_0xdeee40['SmsAccountId']=_0x1a45c6[_0x2895('0x57')]['id'];return _0xdeee40;});return db[_0x2895('0x6f')][_0x2895('0xb4')](_0x2fa188,{'transaction':_0x4f9640});});})[_0x2895('0x20')](function(){return db[_0x2895('0x6f')][_0x2895('0xb5')]({'where':{'SmsAccountId':_0x1a45c6[_0x2895('0x57')]['id']},'order':_0x2895('0xb6')});});}})['then'](respondWithResult(_0x49e536,null))[_0x2895('0x2b')](handleError(_0x49e536,null));};exports['getApplications']=function(_0x582300,_0x129fac,_0x4d17ca){var _0x35c7a2={};var _0x28e8a0={};var _0x490ca2;var _0x499655;return db[_0x2895('0x3e')][_0x2895('0x66')]({'where':{'id':_0x582300[_0x2895('0x57')]['id']}})['then'](handleEntityNotFound(_0x129fac,null))[_0x2895('0x20')](function(_0x5ef0dc){if(_0x5ef0dc){_0x490ca2=_0x5ef0dc;_0x28e8a0[_0x2895('0x41')]=_[_0x2895('0x43')](db[_0x2895('0x6f')][_0x2895('0x3f')]);_0x28e8a0['query']=_['keys'](_0x582300['query']);_0x28e8a0['filters']=_[_0x2895('0x45')](_0x28e8a0['model'],_0x28e8a0[_0x2895('0x42')]);_0x35c7a2[_0x2895('0x46')]=_[_0x2895('0x45')](_0x28e8a0[_0x2895('0x41')],qs[_0x2895('0x47')](_0x582300[_0x2895('0x42')][_0x2895('0x47')]));_0x35c7a2[_0x2895('0x46')]=_0x35c7a2['attributes']['length']?_0x35c7a2['attributes']:_0x28e8a0[_0x2895('0x41')];_0x35c7a2['order']=qs[_0x2895('0x4c')](_0x582300[_0x2895('0x42')][_0x2895('0x4c')]);_0x35c7a2[_0x2895('0x4d')]=qs['filters'](_['pick'](_0x582300[_0x2895('0x42')],_0x28e8a0['filters']));if(_0x582300['query']['filter']){_0x35c7a2[_0x2895('0x4d')]=_[_0x2895('0x51')](_0x35c7a2[_0x2895('0x4d')],{'$or':_[_0x2895('0x3d')](_0x35c7a2[_0x2895('0x46')],function(_0x7d98dc){var _0x2dd720={};_0x2dd720[_0x7d98dc]={'$like':'%'+_0x582300[_0x2895('0x42')][_0x2895('0x4f')]+'%'};return _0x2dd720;})});}_0x35c7a2=_[_0x2895('0x51')]({},_0x35c7a2,_0x582300[_0x2895('0x52')]);return _0x490ca2['getApplications'](_0x35c7a2);}})[_0x2895('0x20')](function(_0x3fc863){if(_0x3fc863){_0x499655=_0x3fc863[_0x2895('0x48')];if(!_0x582300[_0x2895('0x42')]['hasOwnProperty'](_0x2895('0x4a'))){_0x35c7a2[_0x2895('0x30')]=qs[_0x2895('0x30')](_0x582300[_0x2895('0x42')][_0x2895('0x30')]);_0x35c7a2[_0x2895('0x2f')]=qs[_0x2895('0x2f')](_0x582300['query']['offset']);}return _0x490ca2[_0x2895('0xb7')](_0x35c7a2);}})[_0x2895('0x20')](function(_0x4649ba){if(_0x4649ba){return _0x4649ba?{'count':_0x499655,'rows':_0x4649ba}:null;}})[_0x2895('0x20')](respondWithResult(_0x129fac,null))[_0x2895('0x2b')](handleError(_0x129fac,null));};exports[_0x2895('0xb8')]=function(_0x9b9a61,_0x4544bc,_0x204153){var _0x351069={'raw':![],'where':{}};var _0x46312b={};var _0x3689c2={'count':0x0,'rows':[]};return db[_0x2895('0x3e')]['findOne']({'where':{'id':_0x9b9a61[_0x2895('0x57')]['id']}})[_0x2895('0x20')](handleEntityNotFound(_0x4544bc,null))[_0x2895('0x20')](function(_0x45e376){if(_0x45e376){_0x46312b[_0x2895('0x41')]=_[_0x2895('0x43')](db[_0x2895('0x9d')]['rawAttributes']);_0x46312b['query']=_[_0x2895('0x43')](_0x9b9a61[_0x2895('0x42')]);_0x46312b[_0x2895('0x44')]=_[_0x2895('0x45')](_0x46312b[_0x2895('0x41')],_0x46312b[_0x2895('0x42')]);_0x351069[_0x2895('0x46')]=_[_0x2895('0x45')](_0x46312b['model'],qs[_0x2895('0x47')](_0x9b9a61[_0x2895('0x42')][_0x2895('0x47')]));_0x351069['attributes']=_0x351069[_0x2895('0x46')][_0x2895('0x48')]?_0x351069['attributes']:_0x46312b[_0x2895('0x41')];if(!_0x9b9a61['query'][_0x2895('0x49')](_0x2895('0x4a'))){_0x351069['limit']=qs['limit'](_0x9b9a61[_0x2895('0x42')][_0x2895('0x30')]);_0x351069[_0x2895('0x2f')]=qs[_0x2895('0x2f')](_0x9b9a61[_0x2895('0x42')][_0x2895('0x2f')]);}_0x351069[_0x2895('0x4b')]=qs[_0x2895('0x4c')](_0x9b9a61[_0x2895('0x42')][_0x2895('0x4c')]);_0x351069[_0x2895('0x4d')]=qs[_0x2895('0x44')](_[_0x2895('0x4e')](_0x9b9a61[_0x2895('0x42')],_0x46312b[_0x2895('0x44')]));_0x351069[_0x2895('0x4d')]['SmsAccountId']=_0x45e376['id'];if(_0x9b9a61[_0x2895('0x42')][_0x2895('0x4f')]){_0x351069[_0x2895('0x4d')]=_[_0x2895('0x51')](_0x351069[_0x2895('0x4d')],{'$or':_['map'](_0x351069[_0x2895('0x46')],function(_0x253e3a){var _0x5f66de={};_0x5f66de[_0x253e3a]={'$like':'%'+_0x9b9a61['query'][_0x2895('0x4f')]+'%'};return _0x5f66de;})});}_0x351069=_['merge']({},_0x351069,_0x9b9a61[_0x2895('0x52')]);return db[_0x2895('0x9d')]['count']({'where':_0x351069[_0x2895('0x4d')]})[_0x2895('0x20')](function(_0x93c023){_0x3689c2[_0x2895('0x2e')]=_0x93c023;if(_0x9b9a61[_0x2895('0x42')][_0x2895('0x59')]){_0x351069['include']=[{'model':db['CmContact'],'as':_0x2895('0xb9'),'required':![]},{'model':db[_0x2895('0xa7')],'as':_0x2895('0xba'),'attributes':[_0x2895('0x39'),_0x2895('0xbb'),_0x2895('0xbc')],'required':![]},{'model':db['Tag'],'as':_0x2895('0xbd'),'attributes':['id',_0x2895('0x39'),_0x2895('0xbe')],'where':_0x9b9a61[_0x2895('0x42')]['tag']?{'id':_0x9b9a61['query'][_0x2895('0xbf')]}:undefined,'required':_0x9b9a61[_0x2895('0x42')][_0x2895('0xbf')]?!![]:![]}];}return db[_0x2895('0x9d')][_0x2895('0x54')](_0x351069);})['then'](function(_0x22410f){_0x3689c2[_0x2895('0x55')]=_0x22410f;return _0x3689c2;});}})[_0x2895('0x20')](respondWithFilteredResult(_0x4544bc,_0x351069))[_0x2895('0x2b')](handleError(_0x4544bc,null));};exports['send']=function(_0x1f3bc5,_0x3cc295,_0x30dfd2){var _0x1e6561,_0x4fbd0d,_0x327048;if(_['isNil'](_0x1f3bc5['body'][_0x2895('0x61')])||_0x1f3bc5[_0x2895('0x61')]['body']===''){throw new db[(_0x2895('0x1c'))][(_0x2895('0x1d'))](_0x2895('0x94'));}if(_[_0x2895('0x92')](_0x1f3bc5[_0x2895('0x61')]['to'])){throw new db[(_0x2895('0x1c'))][(_0x2895('0x1d'))]('to\x20is\x20mandatory');}_0x1e6561=_0x1f3bc5[_0x2895('0x61')]['to'];return db[_0x2895('0x3e')][_0x2895('0x5a')]({'where':{'id':_0x1f3bc5[_0x2895('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0x2895('0xc0'),'include':[{'model':db[_0x2895('0x74')],'as':_0x2895('0x99'),'where':{'mobile':_0x1e6561},'limit':0x1,'order':[[_0x2895('0x78'),_0x2895('0x9a')]]}]}]})[_0x2895('0x20')](handleEntityNotFound(_0x3cc295,null))[_0x2895('0x20')](function(_0x3a5527){if(_0x3a5527&&_0x3a5527[_0x2895('0xc0')]){_0x4fbd0d=_0x3a5527[_0x2895('0x36')]({'plain':!![]});if(_0x4fbd0d[_0x2895('0xc0')]&&_0x4fbd0d[_0x2895('0xc0')][_0x2895('0x99')][_0x2895('0x48')]){return _0x4fbd0d['List'][_0x2895('0x99')][0x0];}return db[_0x2895('0x74')][_0x2895('0x5b')](_[_0x2895('0x15')](_0x1f3bc5[_0x2895('0x61')],{'firstName':_0x1e6561,'mobile':_0x1e6561,'phone':_0x1e6561,'ListId':_0x4fbd0d[_0x2895('0x79')]}));}})[_0x2895('0x20')](handleEntityNotFound(_0x3cc295,null))[_0x2895('0x20')](function(_0x241dd9){if(_0x241dd9){_0x327048=_0x241dd9;return db['SmsInteraction'][_0x2895('0x5a')]({'where':{'ContactId':_0x327048['id'],'closed':![],'SmsAccountId':_0x4fbd0d['id']}})['then'](function(_0x4d413b){if(_0x4d413b){return[_0x4d413b,![]];}return db[_0x2895('0x9d')][_0x2895('0x5b')]({'UserId':_0x1f3bc5[_0x2895('0x5e')]['id'],'ContactId':_0x327048['id'],'SmsAccountId':_0x4fbd0d['id'],'phone':_0x1e6561,'firstMsgDirection':_0x2895('0xc1'),'Messages':[_['merge'](_0x1f3bc5['body'],{'read':![],'body':_0x1f3bc5[_0x2895('0x61')][_0x2895('0x61')],'phone':_0x1e6561,'SmsAccountId':_0x4fbd0d['id'],'UserId':_0x1f3bc5[_0x2895('0x5e')]['id'],'ContactId':_0x327048['id']})]},{'include':[{'model':db[_0x2895('0xa4')],'as':_0x2895('0xc2')}]})[_0x2895('0x20')](function(_0x47de7a){return[_0x47de7a,!![]];});});}})[_0x2895('0x9e')](function(_0x7959b3,_0xd16e4){if(_0xd16e4){return _0x7959b3;}return db[_0x2895('0xa4')][_0x2895('0x5b')](_['merge'](_0x1f3bc5[_0x2895('0x61')],{'read':![],'body':_0x1f3bc5[_0x2895('0x61')][_0x2895('0x61')],'phone':_0x1e6561,'SmsAccountId':_0x4fbd0d['id'],'SmsInteractionId':_0x7959b3['id'],'UserId':_0x1f3bc5[_0x2895('0x5e')]['id'],'ContactId':_0x327048['id']}))[_0x2895('0x20')](function(_0x4673e0){_0x7959b3[_0x2895('0xc3')][_0x2895('0xc2')]=[];_0x7959b3[_0x2895('0xc3')][_0x2895('0xc2')][_0x2895('0xc4')](_0x4673e0[_0x2895('0xc3')]);return _0x7959b3;});})[_0x2895('0x20')](respondWithResult(_0x3cc295,null))[_0x2895('0x2b')](handleError(_0x3cc295,null));};exports[_0x2895('0x2d')]=function(_0x5dab82,_0x314d7c,_0x17df52){if(_0x5dab82[_0x2895('0x61')]['id']){delete _0x5dab82['body']['id'];}console[_0x2895('0xc5')](_0x2895('0xc6'),_0x5dab82[_0x2895('0x61')]);var _0x274519,_0x4c4ab4,_0x216037;return db[_0x2895('0x3e')][_0x2895('0x5a')]({'where':{'id':_0x5dab82['params']['id']}})[_0x2895('0x20')](handleEntityNotFound(_0x314d7c,null))['then'](function(_0x459d7a){if(_0x459d7a){_0x216037=_0x459d7a;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2895('0x2d'),_0x2895('0xc7'),_0x459d7a[_0x2895('0x7b')],util['inspect'](_0x5dab82[_0x2895('0x61')],{'showHidden':![],'depth':null}));switch(_0x459d7a['type']){case _0x2895('0x82'):if(_0x5dab82[_0x2895('0x61')][_0x2895('0xc8')]&&_0x5dab82[_0x2895('0x61')][_0x2895('0x2d')]){_0x4c4ab4=_0x5dab82['body'][_0x2895('0x2d')];return db['SmsMessage'][_0x2895('0x5a')]({'where':{'messageId':_0x5dab82[_0x2895('0x61')]['skebby_dispatch_id']}});}break;case _0x2895('0x84'):if(_0x5dab82['body'][_0x2895('0xc9')]&&_0x5dab82[_0x2895('0x61')][_0x2895('0xca')]){_0x4c4ab4=_0x5dab82[_0x2895('0x61')][_0x2895('0xca')];return db[_0x2895('0xa4')]['find']({'where':{'messageId':_0x5dab82[_0x2895('0x61')][_0x2895('0xc9')]}});}break;case'clicksend':if(_0x5dab82[_0x2895('0x61')][_0x2895('0x86')]&&_0x5dab82[_0x2895('0x61')][_0x2895('0xcb')]){_0x4c4ab4=_0x5dab82[_0x2895('0x61')]['status_code'];return db[_0x2895('0xa4')]['find']({'where':{'messageId':_0x5dab82['body']['message_id']}});}break;case _0x2895('0x8a'):var _0x350cf8=_0x5dab82[_0x2895('0x61')]['results'][0x0];if(_0x350cf8[_0x2895('0x80')]&&_0x350cf8[_0x2895('0x2d')][_0x2895('0xcc')]===_0x2895('0xcd')){_0x4c4ab4=_0x350cf8[_0x2895('0x2d')][_0x2895('0xcc')];return db[_0x2895('0xa4')]['find']({'where':{'messageId':_0x350cf8['messageId']}});}break;case _0x2895('0x8e'):if(_0x5dab82[_0x2895('0x61')]['messageId']&&_0x5dab82[_0x2895('0x61')][_0x2895('0x2d')]){_0x4c4ab4=_0x5dab82['body'][_0x2895('0x2d')];return db[_0x2895('0xa4')][_0x2895('0x5a')]({'where':{'messageId':_0x5dab82[_0x2895('0x61')][_0x2895('0x80')]}});}break;case'intelepeer':if(_0x5dab82[_0x2895('0x61')][_0x2895('0xce')]&&_0x5dab82['body'][_0x2895('0x2d')]){_0x4c4ab4=_0x5dab82['body'][_0x2895('0x2d')];return db[_0x2895('0xa4')][_0x2895('0x5a')]({'where':{'messageId':_0x5dab82[_0x2895('0x61')][_0x2895('0xce')]}});}break;}}})[_0x2895('0x20')](handleEntityNotFound(_0x314d7c,null))[_0x2895('0x20')](function(_0xc30695){if(_0xc30695){_0x274519=_0xc30695;switch(_0x216037['type']){case _0x2895('0x82'):if(_0x4c4ab4===_0x2895('0xcd')){return _0x274519[_0x2895('0x60')]({'read':!![]});}else{logger['error'](_0x2895('0x23'),_0x2895('0x2d'),_0x2895('0x82'),util['inspect'](_0x5dab82[_0x2895('0x61')],{'showHidden':![],'depth':null}));}break;case _0x2895('0x84'):if(_0x4c4ab4==='1'){return _0x274519[_0x2895('0x60')]({'read':!![]});}else{logger['error'](_0x2895('0x23'),_0x2895('0x2d'),_0x2895('0x82'),util['inspect'](_0x5dab82[_0x2895('0x61')],{'showHidden':![],'depth':null}));}break;case _0x2895('0x85'):if(!_0x5dab82['body'][_0x2895('0xcf')]&&_0x4c4ab4>=0xc8&&_0x4c4ab4<=0xce){return _0x274519['update']({'read':!![]});}else{logger[_0x2895('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2895('0x2d'),_0x2895('0x85'),util['inspect'](_0x5dab82[_0x2895('0x61')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x13f8a1=_0x5dab82['body'][_0x2895('0x8b')][0x0];if(_0x13f8a1['status'][_0x2895('0xcc')]===_0x2895('0xcd')){return _0x274519['update']({'read':!![]});}else{logger[_0x2895('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2895('0x2d'),_0x2895('0x8a'),util[_0x2895('0xd0')](_0x5dab82[_0x2895('0x61')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4c4ab4=='DELIVERED_TO_GATEWAY'||_0x4c4ab4==_0x2895('0xd1')){return _0x274519[_0x2895('0x60')]({'read':!![]});}else{logger['error'](_0x2895('0x23'),_0x2895('0x2d'),_0x2895('0x8e'),util['inspect'](_0x5dab82[_0x2895('0x61')],{'showHidden':![],'depth':null}));}break;case _0x2895('0x90'):if(_0x4c4ab4===_0x2895('0xd2')||_0x4c4ab4===_0x2895('0xd3')){return _0x274519[_0x2895('0x60')]({'read':!![]});}else{logger[_0x2895('0x25')](_0x2895('0x23'),_0x2895('0x2d'),'intelepeer',util[_0x2895('0xd0')](_0x5dab82[_0x2895('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x274519;}})[_0x2895('0x20')](respondWithResult(_0x314d7c,null))[_0x2895('0x2b')](handleError(_0x314d7c,null));};exports['statusGet']=function(_0x56a129,_0xaaa07c,_0x2e377d){var _0xc99900,_0x142d6f,_0x49c443;return db[_0x2895('0x3e')]['find']({'where':{'id':_0x56a129[_0x2895('0x57')]['id']}})[_0x2895('0x20')](handleEntityNotFound(_0xaaa07c,null))[_0x2895('0x20')](function(_0x37301c){if(_0x37301c){_0x49c443=_0x37301c;logger[_0x2895('0x22')](_0x2895('0x23'),_0x2895('0x2d'),_0x2895('0xc7'),_0x37301c[_0x2895('0x7b')],util[_0x2895('0xd0')](_0x56a129[_0x2895('0x42')],{'showHidden':![],'depth':null}));switch(_0x37301c[_0x2895('0x7b')]){case _0x2895('0xd4'):if(_0x56a129[_0x2895('0x42')][_0x2895('0xd5')]&&_0x56a129[_0x2895('0x42')]['state']){_0x142d6f=_0x56a129[_0x2895('0x42')][_0x2895('0xd6')];return db['SmsMessage'][_0x2895('0x5a')]({'where':{'messageId':_0x56a129['query'][_0x2895('0xd5')]}});}break;}}})[_0x2895('0x20')](handleEntityNotFound(_0xaaa07c,null))[_0x2895('0x20')](function(_0x131119){if(_0x131119){_0xc99900=_0x131119;switch(_0x49c443[_0x2895('0x7b')]){case'csc':if(_0x142d6f==='2'||_0x142d6f==='6'){return _0xc99900[_0x2895('0x60')]({'read':!![]});}else{logger[_0x2895('0x25')](_0x2895('0x23'),'status',_0x2895('0xd4'),util[_0x2895('0xd0')](_0x56a129['query'],{'showHidden':![],'depth':null}));};break;}return _0xc99900;}})[_0x2895('0x20')](respondWithResult(_0xaaa07c,null))[_0x2895('0x2b')](handleError(_0xaaa07c,null));};exports[_0x2895('0xd7')]=function(_0x19be2c,_0x1b20ff,_0x51d6df){return db[_0x2895('0x3e')][_0x2895('0x5a')]({'where':{'id':_0x19be2c[_0x2895('0x57')]['id']}})[_0x2895('0x20')](handleEntityNotFound(_0x1b20ff,null))[_0x2895('0x20')](function(_0x4ab9ec){if(_0x4ab9ec){return _0x4ab9ec[_0x2895('0xd7')](_0x19be2c[_0x2895('0x61')][_0x2895('0x68')],_[_0x2895('0xd8')](_0x19be2c[_0x2895('0x61')],[_0x2895('0x68'),'id'])||{})[_0x2895('0x9e')](function(_0x17068d){for(var _0x50c07d=0x0;_0x50c07d<_0x19be2c[_0x2895('0x61')]['ids']['length'];_0x50c07d+=0x1){socket[_0x2895('0xd9')](_0x2895('0xda'),{'UserId':_0x19be2c['body'][_0x2895('0x68')][_0x50c07d],'SmsAccountId':_0x19be2c[_0x2895('0x57')]['id']});}return _0x17068d;});}})[_0x2895('0x20')](respondWithResult(_0x1b20ff,null))[_0x2895('0x2b')](handleError(_0x1b20ff,null));};exports[_0x2895('0xdb')]=function(_0x32c980,_0x1f4354,_0x1ea896){return db[_0x2895('0x3e')]['find']({'where':{'id':_0x32c980['params']['id']}})[_0x2895('0x20')](handleEntityNotFound(_0x1f4354,null))[_0x2895('0x20')](function(_0x4c1770){if(_0x4c1770){return _0x4c1770[_0x2895('0xdb')](_0x32c980[_0x2895('0x42')][_0x2895('0x68')])[_0x2895('0x20')](function(){if(_['isArray'](_0x32c980[_0x2895('0x42')][_0x2895('0x68')])){for(var _0x18d5d0=0x0;_0x18d5d0<_0x32c980['query'][_0x2895('0x68')][_0x2895('0x48')];_0x18d5d0+=0x1){socket[_0x2895('0xd9')]('userSmsAccount:remove',{'UserId':Number(_0x32c980[_0x2895('0x42')][_0x2895('0x68')][_0x18d5d0]),'SmsAccountId':Number(_0x32c980[_0x2895('0x57')]['id'])});}}else{socket[_0x2895('0xd9')]('userSmsAccount:remove',{'UserId':Number(_0x32c980[_0x2895('0x42')][_0x2895('0x68')]),'SmsAccountId':Number(_0x32c980[_0x2895('0x57')]['id'])});}});}})[_0x2895('0x20')](respondWithStatusCode(_0x1f4354,null))[_0x2895('0x2b')](handleError(_0x1f4354,null));};exports[_0x2895('0xdc')]=function(_0x5ce1b7,_0x54ed5d,_0x39e2ad){var _0x5751be={};var _0xe7a8={};var _0x122720;var _0x1ae354;return db[_0x2895('0x3e')][_0x2895('0x66')]({'where':{'id':_0x5ce1b7[_0x2895('0x57')]['id']}})['then'](handleEntityNotFound(_0x54ed5d,null))[_0x2895('0x20')](function(_0x43744d){if(_0x43744d){_0x122720=_0x43744d;_0xe7a8[_0x2895('0x41')]=_[_0x2895('0x43')](db[_0x2895('0xa7')][_0x2895('0x3f')]);_0xe7a8[_0x2895('0x42')]=_['keys'](_0x5ce1b7[_0x2895('0x42')]);_0xe7a8['filters']=_[_0x2895('0x45')](_0xe7a8['model'],_0xe7a8[_0x2895('0x42')]);_0x5751be[_0x2895('0x46')]=_[_0x2895('0x45')](_0xe7a8[_0x2895('0x41')],qs['fields'](_0x5ce1b7[_0x2895('0x42')]['fields']));_0x5751be[_0x2895('0x46')]=_0x5751be['attributes']['length']?_0x5751be[_0x2895('0x46')]:_0xe7a8[_0x2895('0x41')];_0x5751be[_0x2895('0x4b')]=qs['sort'](_0x5ce1b7[_0x2895('0x42')][_0x2895('0x4c')]);_0x5751be[_0x2895('0x4d')]=qs[_0x2895('0x44')](_[_0x2895('0x4e')](_0x5ce1b7['query'],_0xe7a8[_0x2895('0x44')]));if(_0x5ce1b7[_0x2895('0x42')]['filter']){_0x5751be['where']=_['merge'](_0x5751be['where'],{'$or':_[_0x2895('0x3d')](_0x5751be[_0x2895('0x46')],function(_0x5994e7){var _0x259b3b={};_0x259b3b[_0x5994e7]={'$like':'%'+_0x5ce1b7['query']['filter']+'%'};return _0x259b3b;})});}_0x5751be=_['merge']({},_0x5751be,_0x5ce1b7['options']);return _0x122720[_0x2895('0xdc')](_0x5751be);}})[_0x2895('0x20')](function(_0x366986){if(_0x366986){_0x1ae354=_0x366986[_0x2895('0x48')];if(!_0x5ce1b7['query'][_0x2895('0x49')](_0x2895('0x4a'))){_0x5751be[_0x2895('0x30')]=qs[_0x2895('0x30')](_0x5ce1b7['query'][_0x2895('0x30')]);_0x5751be[_0x2895('0x2f')]=qs[_0x2895('0x2f')](_0x5ce1b7[_0x2895('0x42')][_0x2895('0x2f')]);}return _0x122720[_0x2895('0xdc')](_0x5751be);}})[_0x2895('0x20')](function(_0x4a1a12){if(_0x4a1a12){return _0x4a1a12?{'count':_0x1ae354,'rows':_0x4a1a12}:null;}})['then'](respondWithResult(_0x54ed5d,null))[_0x2895('0x2b')](handleError(_0x54ed5d,null));}; \ No newline at end of file +var _0xc7da=['statusInt','requestid','clicksend','status_code','DELIVERED','groupName','clickatell','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','statusGet','csc','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','sendStatus','name','send','Pause','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','merge','type','options','SmsAccount','findAll','rows','catch','show','mandatoryDispositionPause','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','SmsAccountId','Disposition','findOne','pick','includeAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','applications','priority','asc','account','difference','updatedAt','mobile','twilio','from','Body','messageId','skebby','sender','text','message_id','From','MessageUUID','infobip','results','originatingAddress','fromNumber','intelepeer','refid','isNil','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','CmContact','Contacts','list','omit','defaults','contact','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','SmsMessage','ContactId','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','addApplications','sequelize','transaction','bulkCreate','getApplications','getInteractions','Contact','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','spread','dataValues','Messages','log','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel'];(function(_0x5bf2c6,_0x5c399d){var _0x543e6d=function(_0xd29436){while(--_0xd29436){_0x5bf2c6['push'](_0x5bf2c6['shift']());}};_0x543e6d(++_0x5c399d);}(_0xc7da,0xf2));var _0xac7d=function(_0x2cfe2d,_0x1067c8){_0x2cfe2d=_0x2cfe2d-0x0;var _0x12cc2b=_0xc7da[_0x2cfe2d];return _0x12cc2b;};'use strict';var pdf=require(_0xac7d('0x0'));var emlformat=require(_0xac7d('0x1'));var rimraf=require(_0xac7d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac7d('0x3'));var rp=require(_0xac7d('0x4'));var moment=require('moment');var BPromise=require(_0xac7d('0x5'));var Mustache=require(_0xac7d('0x6'));var util=require('util');var path=require(_0xac7d('0x7'));var sox=require(_0xac7d('0x8'));var csv=require(_0xac7d('0x9'));var ejs=require(_0xac7d('0xa'));var fs=require('fs');var _=require(_0xac7d('0xb'));var squel=require(_0xac7d('0xc'));var crypto=require('crypto');var jsforce=require(_0xac7d('0xd'));var deskjs=require(_0xac7d('0xe'));var toCsv=require(_0xac7d('0x9'));var querystring=require(_0xac7d('0xf'));var Papa=require(_0xac7d('0x10'));var Redis=require(_0xac7d('0x11'));var authService=require(_0xac7d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xac7d('0x13'));var hardwareService=require(_0xac7d('0x14'));var logger=require(_0xac7d('0x15'))('api');var utils=require(_0xac7d('0x16'));var config=require(_0xac7d('0x17'));var db=require(_0xac7d('0x18'))['db'];config[_0xac7d('0x19')]=_['defaults'](config[_0xac7d('0x19')],{'host':_0xac7d('0x1a'),'port':0x18eb});var socket=require(_0xac7d('0x1b'))(new Redis(config[_0xac7d('0x19')]));require(_0xac7d('0x1c'))['register'](socket);var jayson=require(_0xac7d('0x1d'));var client=jayson['client'][_0xac7d('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x425235,_0x34980f,_0x355209){if(_0x355209){var _0x533bac=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x533bac[_0xac7d('0x1f')](_0x34980f)){return _0x425235;}else{throw new db[(_0xac7d('0x20'))][(_0xac7d('0x21'))](_0xac7d('0x22'));}}else{return _0x425235;}}function respondWithRpcPromise(_0x35ea95,_0x48ac86,_0x7df8e0,_0x3cb12d){return new BPromise(function(_0x563634,_0x2e4790){var _0x2d2494=_0x3cb12d||client;return _0x2d2494[_0xac7d('0x23')](_0x35ea95,_0x7df8e0)[_0xac7d('0x24')](function(_0x4a5325){logger[_0xac7d('0x25')](_0xac7d('0x26'),_0x48ac86,_0xac7d('0x27'));logger['debug'](_0xac7d('0x28'),_0x48ac86,'request\x20sent',JSON[_0xac7d('0x29')](_0x4a5325));if(_0x4a5325[_0xac7d('0x2a')]){if(_0x4a5325[_0xac7d('0x2a')][_0xac7d('0x2b')]===0x1f4){logger[_0xac7d('0x2a')](_0xac7d('0x26'),_0x48ac86,_0x4a5325['error']['message']);return _0x2e4790(_0x4a5325[_0xac7d('0x2a')][_0xac7d('0x2c')]);}logger['error'](_0xac7d('0x26'),_0x48ac86,_0x4a5325[_0xac7d('0x2a')][_0xac7d('0x2c')]);return _0x563634(_0x4a5325[_0xac7d('0x2a')][_0xac7d('0x2c')]);}else{logger[_0xac7d('0x25')](_0xac7d('0x26'),_0x48ac86,_0xac7d('0x27'));_0x563634(_0x4a5325[_0xac7d('0x2d')][_0xac7d('0x2c')]);}})['catch'](function(_0x229ecd){logger[_0xac7d('0x2a')](_0xac7d('0x26'),_0x48ac86,_0x229ecd);_0x2e4790(_0x229ecd);});});}function respondWithStatusCode(_0x1bcfd5,_0x4cc590){_0x4cc590=_0x4cc590||0xcc;return function(_0x579b99){if(_0x579b99){return _0x1bcfd5['sendStatus'](_0x4cc590);}return _0x1bcfd5[_0xac7d('0x2e')](_0x4cc590)[_0xac7d('0x2f')]();};}function respondWithResult(_0xac3f87,_0x5bd39b){_0x5bd39b=_0x5bd39b||0xc8;return function(_0x51df23){if(_0x51df23){return _0xac3f87['status'](_0x5bd39b)['json'](_0x51df23);}};}function respondWithFilteredResult(_0x5e5f12,_0x4a70c8){return function(_0x57ef95){if(_0x57ef95){var _0x104186=_0x57ef95[_0xac7d('0x30')],_0x1109b1=_0x4a70c8['offset'],_0x35be2f=_0x4a70c8['offset']+_0x4a70c8[_0xac7d('0x31')],_0x31a082;if(_0x35be2f>=_0x104186){_0x35be2f=_0x104186;_0x31a082=0xc8;}else{_0x31a082=0xce;}_0x5e5f12[_0xac7d('0x2e')](_0x31a082);return _0x5e5f12[_0xac7d('0x32')](_0xac7d('0x33'),_0x1109b1+'-'+_0x35be2f+'/'+_0x104186)[_0xac7d('0x34')](_0x57ef95);}return null;};}function patchUpdates(_0x500161){return function(_0x3ba58d){try{jsonpatch[_0xac7d('0x35')](_0x3ba58d,_0x500161,!![]);}catch(_0x3ad214){return BPromise[_0xac7d('0x36')](_0x3ad214);}return _0x3ba58d[_0xac7d('0x37')]();};}function saveUpdates(_0x2e10f7,_0x29163c){return function(_0x121f23){if(_0x121f23){return _0x121f23[_0xac7d('0x38')](_0x2e10f7)[_0xac7d('0x24')](function(_0x4ee968){return _0x4ee968;});}return null;};}function removeEntity(_0x2237be,_0x1835d2){return function(_0x64724b){if(_0x64724b){return _0x64724b[_0xac7d('0x39')]()[_0xac7d('0x24')](function(){var _0x5690e4=_0x64724b[_0xac7d('0x3a')]({'plain':!![]});var _0x5c09a4='SmsAccounts';return db[_0xac7d('0x3b')][_0xac7d('0x39')]({'where':{'type':_0x5c09a4,'resourceId':_0x5690e4['id']}})[_0xac7d('0x24')](function(){return _0x64724b;});})[_0xac7d('0x24')](function(){_0x2237be[_0xac7d('0x2e')](0xcc)[_0xac7d('0x2f')]();});}};}function handleEntityNotFound(_0x330fb0,_0x1e48df){return function(_0x105bac){if(!_0x105bac){_0x330fb0[_0xac7d('0x3c')](0x194);}return _0x105bac;};}function handleError(_0x1c5df3,_0x54dc7d){_0x54dc7d=_0x54dc7d||0x1f4;return function(_0x4b1fc0){logger[_0xac7d('0x2a')](_0x4b1fc0['stack']);if(_0x4b1fc0[_0xac7d('0x3d')]){delete _0x4b1fc0[_0xac7d('0x3d')];}_0x1c5df3[_0xac7d('0x2e')](_0x54dc7d)[_0xac7d('0x3e')](_0x4b1fc0);};}exports['index']=function(_0x5aed68,_0xa7e739){var _0x38bcfa={'include':[{'model':db[_0xac7d('0x3f')],'as':'mandatoryDispositionPause'}]},_0x3e87e5={},_0xa01c3b={'count':0x0,'rows':[]};var _0x5415f1=_[_0xac7d('0x40')](db['SmsAccount'][_0xac7d('0x41')],function(_0x461209){return{'name':_0x461209[_0xac7d('0x42')],'type':_0x461209['type'][_0xac7d('0x43')]};});_0x3e87e5[_0xac7d('0x44')]=_[_0xac7d('0x40')](_0x5415f1,_0xac7d('0x3d'));_0x3e87e5[_0xac7d('0x45')]=_[_0xac7d('0x46')](_0x5aed68['query']);_0x3e87e5['filters']=_[_0xac7d('0x47')](_0x3e87e5[_0xac7d('0x44')],_0x3e87e5['query']);_0x38bcfa[_0xac7d('0x48')]=_[_0xac7d('0x47')](_0x3e87e5[_0xac7d('0x44')],qs['fields'](_0x5aed68['query'][_0xac7d('0x49')]));_0x38bcfa['attributes']=_0x38bcfa[_0xac7d('0x48')][_0xac7d('0x4a')]?_0x38bcfa[_0xac7d('0x48')]:_0x3e87e5[_0xac7d('0x44')];if(!_0x5aed68[_0xac7d('0x45')][_0xac7d('0x4b')](_0xac7d('0x4c'))){_0x38bcfa[_0xac7d('0x31')]=qs[_0xac7d('0x31')](_0x5aed68[_0xac7d('0x45')]['limit']);_0x38bcfa[_0xac7d('0x4d')]=qs[_0xac7d('0x4d')](_0x5aed68[_0xac7d('0x45')][_0xac7d('0x4d')]);}_0x38bcfa[_0xac7d('0x4e')]=qs[_0xac7d('0x4f')](_0x5aed68[_0xac7d('0x45')]['sort']);_0x38bcfa[_0xac7d('0x50')]=qs[_0xac7d('0x51')](_['pick'](_0x5aed68[_0xac7d('0x45')],_0x3e87e5[_0xac7d('0x51')]));if(_0x5aed68[_0xac7d('0x45')][_0xac7d('0x52')]){_0x38bcfa[_0xac7d('0x50')]=_[_0xac7d('0x53')](_0x38bcfa[_0xac7d('0x50')],{'$or':_['map'](_0x5415f1,function(_0x41e82a){if(_0x41e82a[_0xac7d('0x54')]!=='VIRTUAL'){var _0x2231dd={};_0x2231dd[_0x41e82a[_0xac7d('0x3d')]]={'$like':'%'+_0x5aed68[_0xac7d('0x45')]['filter']+'%'};return _0x2231dd;}})});}_0x38bcfa=_[_0xac7d('0x53')]({},_0x38bcfa,_0x5aed68[_0xac7d('0x55')]);var _0xfa8ab={'where':_0x38bcfa[_0xac7d('0x50')]};return db['SmsAccount'][_0xac7d('0x30')](_0xfa8ab)[_0xac7d('0x24')](function(_0x1a8283){_0xa01c3b[_0xac7d('0x30')]=_0x1a8283;if(_0x5aed68[_0xac7d('0x45')]['includeAll']){_0x38bcfa['include']=[{'all':!![]}];}return db[_0xac7d('0x56')][_0xac7d('0x57')](_0x38bcfa);})[_0xac7d('0x24')](function(_0x4a24a5){_0xa01c3b[_0xac7d('0x58')]=_0x4a24a5;return _0xa01c3b;})['then'](respondWithFilteredResult(_0xa7e739,_0x38bcfa))[_0xac7d('0x59')](handleError(_0xa7e739,null));};exports[_0xac7d('0x5a')]=function(_0x2a1ffe,_0xfba54d){var _0x32ca80={'raw':![],'where':{'id':_0x2a1ffe['params']['id']},'include':[{'model':db[_0xac7d('0x3f')],'as':_0xac7d('0x5b')}]},_0x295c86={};_0x295c86[_0xac7d('0x44')]=_[_0xac7d('0x46')](db[_0xac7d('0x56')][_0xac7d('0x41')]);_0x295c86[_0xac7d('0x45')]=_[_0xac7d('0x46')](_0x2a1ffe[_0xac7d('0x45')]);_0x295c86[_0xac7d('0x51')]=_[_0xac7d('0x47')](_0x295c86[_0xac7d('0x44')],_0x295c86[_0xac7d('0x45')]);_0x32ca80[_0xac7d('0x48')]=_[_0xac7d('0x47')](_0x295c86[_0xac7d('0x44')],qs[_0xac7d('0x49')](_0x2a1ffe[_0xac7d('0x45')][_0xac7d('0x49')]));_0x32ca80[_0xac7d('0x48')]=_0x32ca80[_0xac7d('0x48')][_0xac7d('0x4a')]?_0x32ca80[_0xac7d('0x48')]:_0x295c86[_0xac7d('0x44')];if(_0x2a1ffe['query']['includeAll']){_0x32ca80[_0xac7d('0x5c')]=[{'all':!![]}];}_0x32ca80=_[_0xac7d('0x53')]({},_0x32ca80,_0x2a1ffe[_0xac7d('0x55')]);return db[_0xac7d('0x56')]['find'](_0x32ca80)[_0xac7d('0x24')](handleEntityNotFound(_0xfba54d,null))[_0xac7d('0x24')](respondWithResult(_0xfba54d,null))[_0xac7d('0x59')](handleError(_0xfba54d,null));};exports[_0xac7d('0x5d')]=function(_0x2a139f,_0x4f3633){return db[_0xac7d('0x56')][_0xac7d('0x5d')](_0x2a139f[_0xac7d('0x5e')],{})[_0xac7d('0x24')](function(_0x5b953f){var _0x4d911e=_0x2a139f[_0xac7d('0x5f')][_0xac7d('0x3a')]({'plain':!![]});if(!_0x4d911e)throw new Error(_0xac7d('0x60'));if(_0x4d911e[_0xac7d('0x61')]===_0xac7d('0x5f')){var _0x294a7c=_0x5b953f[_0xac7d('0x3a')]({'plain':!![]});var _0x407ace=_0xac7d('0x62');return db['UserProfileSection'][_0xac7d('0x63')]({'where':{'name':_0x407ace,'userProfileId':_0x4d911e[_0xac7d('0x64')]},'raw':!![]})[_0xac7d('0x24')](function(_0x2ea5ea){if(_0x2ea5ea&&_0x2ea5ea['autoAssociation']===0x0){return db[_0xac7d('0x3b')][_0xac7d('0x5d')]({'name':_0x294a7c[_0xac7d('0x3d')],'resourceId':_0x294a7c['id'],'type':_0x2ea5ea[_0xac7d('0x3d')],'sectionId':_0x2ea5ea['id']},{})[_0xac7d('0x24')](function(){return _0x5b953f;});}else{return _0x5b953f;}})['catch'](function(_0x3daf00){logger[_0xac7d('0x2a')](_0xac7d('0x65'),_0x3daf00);throw _0x3daf00;});}return _0x5b953f;})[_0xac7d('0x24')](respondWithResult(_0x4f3633,0xc9))[_0xac7d('0x59')](handleError(_0x4f3633,null));};exports[_0xac7d('0x38')]=function(_0x1caa0a,_0x4909a7){if(_0x1caa0a[_0xac7d('0x5e')]['id']){delete _0x1caa0a[_0xac7d('0x5e')]['id'];}return db[_0xac7d('0x56')][_0xac7d('0x63')]({'where':{'id':_0x1caa0a[_0xac7d('0x66')]['id']},'include':[{'model':db[_0xac7d('0x3f')],'as':_0xac7d('0x5b')}]})[_0xac7d('0x24')](handleEntityNotFound(_0x4909a7,null))[_0xac7d('0x24')](saveUpdates(_0x1caa0a[_0xac7d('0x5e')],null))[_0xac7d('0x24')](respondWithResult(_0x4909a7,null))[_0xac7d('0x59')](handleError(_0x4909a7,null));};exports[_0xac7d('0x39')]=function(_0x5b8458,_0x2a6904){return db[_0xac7d('0x56')][_0xac7d('0x63')]({'where':{'id':_0x5b8458['params']['id']}})[_0xac7d('0x24')](handleEntityNotFound(_0x2a6904,null))['then'](removeEntity(_0x2a6904,null))['catch'](handleError(_0x2a6904,null));};exports[_0xac7d('0x67')]=function(_0x12c35f,_0x888d5f){return db[_0xac7d('0x56')][_0xac7d('0x67')]()['then'](respondWithResult(_0x888d5f,null))[_0xac7d('0x59')](handleError(_0x888d5f,null));};exports['addDisposition']=function(_0x1bd6c4,_0x54d81c,_0x18fd8d){if(_0x1bd6c4[_0xac7d('0x5e')]['id']){delete _0x1bd6c4[_0xac7d('0x5e')]['id'];}return db['SmsAccount'][_0xac7d('0x63')]({'where':{'id':_0x1bd6c4[_0xac7d('0x66')]['id']}})[_0xac7d('0x24')](handleEntityNotFound(_0x54d81c,null))[_0xac7d('0x24')](function(_0x5c9038){if(_0x5c9038){_0x1bd6c4[_0xac7d('0x5e')][_0xac7d('0x68')]=_0x5c9038['id'];return db[_0xac7d('0x69')]['create'](_0x1bd6c4['body']);}})[_0xac7d('0x24')](respondWithResult(_0x54d81c,null))[_0xac7d('0x59')](handleError(_0x54d81c,null));};exports['getDispositions']=function(_0x4b429a,_0x3789e0,_0x4d1321){var _0x36ff2d={'raw':![],'where':{}};var _0x1f5ba6={};var _0x482693={'count':0x0,'rows':[]};return db[_0xac7d('0x56')][_0xac7d('0x6a')]({'where':{'id':_0x4b429a['params']['id']}})[_0xac7d('0x24')](handleEntityNotFound(_0x3789e0,null))[_0xac7d('0x24')](function(_0x58960c){if(_0x58960c){_0x1f5ba6[_0xac7d('0x44')]=_[_0xac7d('0x46')](db[_0xac7d('0x69')]['rawAttributes']);_0x1f5ba6[_0xac7d('0x45')]=_[_0xac7d('0x46')](_0x4b429a[_0xac7d('0x45')]);_0x1f5ba6[_0xac7d('0x51')]=_[_0xac7d('0x47')](_0x1f5ba6[_0xac7d('0x44')],_0x1f5ba6['query']);_0x36ff2d['attributes']=_[_0xac7d('0x47')](_0x1f5ba6[_0xac7d('0x44')],qs[_0xac7d('0x49')](_0x4b429a['query'][_0xac7d('0x49')]));_0x36ff2d[_0xac7d('0x48')]=_0x36ff2d[_0xac7d('0x48')][_0xac7d('0x4a')]?_0x36ff2d[_0xac7d('0x48')]:_0x1f5ba6[_0xac7d('0x44')];if(!_0x4b429a[_0xac7d('0x45')][_0xac7d('0x4b')](_0xac7d('0x4c'))){_0x36ff2d['limit']=qs['limit'](_0x4b429a['query'][_0xac7d('0x31')]);_0x36ff2d['offset']=qs[_0xac7d('0x4d')](_0x4b429a[_0xac7d('0x45')][_0xac7d('0x4d')]);}_0x36ff2d[_0xac7d('0x4e')]=qs[_0xac7d('0x4f')](_0x4b429a[_0xac7d('0x45')][_0xac7d('0x4f')]);_0x36ff2d[_0xac7d('0x50')]=qs['filters'](_[_0xac7d('0x6b')](_0x4b429a[_0xac7d('0x45')],_0x1f5ba6['filters']));_0x36ff2d[_0xac7d('0x50')]['SmsAccountId']=_0x58960c['id'];if(_0x4b429a[_0xac7d('0x45')][_0xac7d('0x52')]){_0x36ff2d[_0xac7d('0x50')]=_[_0xac7d('0x53')](_0x36ff2d[_0xac7d('0x50')],{'$or':_[_0xac7d('0x40')](_0x36ff2d['attributes'],function(_0x437c8e){var _0x941aa6={};_0x941aa6[_0x437c8e]={'$like':'%'+_0x4b429a[_0xac7d('0x45')][_0xac7d('0x52')]+'%'};return _0x941aa6;})});}_0x36ff2d=_['merge']({},_0x36ff2d,_0x4b429a['options']);return db['Disposition'][_0xac7d('0x30')]({'where':_0x36ff2d['where']})[_0xac7d('0x24')](function(_0x8cf7f6){_0x482693['count']=_0x8cf7f6;if(_0x4b429a[_0xac7d('0x45')][_0xac7d('0x6c')]){_0x36ff2d[_0xac7d('0x5c')]=[{'all':!![]}];}return db[_0xac7d('0x69')][_0xac7d('0x57')](_0x36ff2d);})[_0xac7d('0x24')](function(_0x1a2b21){_0x482693[_0xac7d('0x58')]=_0x1a2b21;return _0x482693;});}})[_0xac7d('0x24')](respondWithFilteredResult(_0x3789e0,_0x36ff2d))[_0xac7d('0x59')](handleError(_0x3789e0,null));};exports[_0xac7d('0x6d')]=function(_0x21fb83,_0x38ee53,_0x363bdf){return db[_0xac7d('0x56')][_0xac7d('0x63')]({'where':{'id':_0x21fb83[_0xac7d('0x66')]['id']}})[_0xac7d('0x24')](handleEntityNotFound(_0x38ee53,null))[_0xac7d('0x24')](function(_0x542aa7){if(_0x542aa7){return _0x542aa7['removeDispositions'](_0x21fb83[_0xac7d('0x45')][_0xac7d('0x6e')]);}})[_0xac7d('0x24')](respondWithStatusCode(_0x38ee53,null))[_0xac7d('0x59')](handleError(_0x38ee53,null));};exports['addAnswer']=function(_0x7d535a,_0x238e07,_0x33180e){if(_0x7d535a['body']['id']){delete _0x7d535a[_0xac7d('0x5e')]['id'];}return db[_0xac7d('0x56')][_0xac7d('0x63')]({'where':{'id':_0x7d535a[_0xac7d('0x66')]['id']}})['then'](handleEntityNotFound(_0x238e07,null))[_0xac7d('0x24')](function(_0x27fca8){if(_0x27fca8){_0x7d535a[_0xac7d('0x5e')]['SmsAccountId']=_0x27fca8['id'];return db[_0xac7d('0x6f')]['create'](_0x7d535a[_0xac7d('0x5e')]);}})[_0xac7d('0x24')](respondWithResult(_0x238e07,null))[_0xac7d('0x59')](handleError(_0x238e07,null));};exports[_0xac7d('0x70')]=function(_0x5345a9,_0x425cd0,_0x35f9b1){var _0x4f53e7={'raw':![],'where':{}};var _0x18e145={};var _0x7e84a5={'count':0x0,'rows':[]};return db['SmsAccount'][_0xac7d('0x6a')]({'where':{'id':_0x5345a9[_0xac7d('0x66')]['id']}})['then'](handleEntityNotFound(_0x425cd0,null))['then'](function(_0xc82384){if(_0xc82384){_0x18e145[_0xac7d('0x44')]=_['keys'](db[_0xac7d('0x6f')][_0xac7d('0x41')]);_0x18e145[_0xac7d('0x45')]=_[_0xac7d('0x46')](_0x5345a9['query']);_0x18e145[_0xac7d('0x51')]=_['intersection'](_0x18e145['model'],_0x18e145[_0xac7d('0x45')]);_0x4f53e7[_0xac7d('0x48')]=_['intersection'](_0x18e145[_0xac7d('0x44')],qs[_0xac7d('0x49')](_0x5345a9[_0xac7d('0x45')][_0xac7d('0x49')]));_0x4f53e7[_0xac7d('0x48')]=_0x4f53e7[_0xac7d('0x48')][_0xac7d('0x4a')]?_0x4f53e7[_0xac7d('0x48')]:_0x18e145[_0xac7d('0x44')];if(!_0x5345a9[_0xac7d('0x45')][_0xac7d('0x4b')](_0xac7d('0x4c'))){_0x4f53e7[_0xac7d('0x31')]=qs[_0xac7d('0x31')](_0x5345a9[_0xac7d('0x45')][_0xac7d('0x31')]);_0x4f53e7[_0xac7d('0x4d')]=qs[_0xac7d('0x4d')](_0x5345a9[_0xac7d('0x45')]['offset']);}_0x4f53e7[_0xac7d('0x4e')]=qs[_0xac7d('0x4f')](_0x5345a9[_0xac7d('0x45')][_0xac7d('0x4f')]);_0x4f53e7['where']=qs[_0xac7d('0x51')](_[_0xac7d('0x6b')](_0x5345a9[_0xac7d('0x45')],_0x18e145[_0xac7d('0x51')]));_0x4f53e7[_0xac7d('0x50')][_0xac7d('0x68')]=_0xc82384['id'];if(_0x5345a9[_0xac7d('0x45')][_0xac7d('0x52')]){_0x4f53e7[_0xac7d('0x50')]=_[_0xac7d('0x53')](_0x4f53e7[_0xac7d('0x50')],{'$or':_['map'](_0x4f53e7[_0xac7d('0x48')],function(_0x5a71ab){var _0x56f069={};_0x56f069[_0x5a71ab]={'$like':'%'+_0x5345a9[_0xac7d('0x45')][_0xac7d('0x52')]+'%'};return _0x56f069;})});}_0x4f53e7=_[_0xac7d('0x53')]({},_0x4f53e7,_0x5345a9[_0xac7d('0x55')]);return db[_0xac7d('0x6f')][_0xac7d('0x30')]({'where':_0x4f53e7[_0xac7d('0x50')]})[_0xac7d('0x24')](function(_0x29456f){_0x7e84a5['count']=_0x29456f;if(_0x5345a9[_0xac7d('0x45')][_0xac7d('0x6c')]){_0x4f53e7[_0xac7d('0x5c')]=[{'all':!![]}];}return db[_0xac7d('0x6f')][_0xac7d('0x57')](_0x4f53e7);})[_0xac7d('0x24')](function(_0x1b736c){_0x7e84a5[_0xac7d('0x58')]=_0x1b736c;return _0x7e84a5;});}})[_0xac7d('0x24')](respondWithFilteredResult(_0x425cd0,_0x4f53e7))['catch'](handleError(_0x425cd0,null));};exports['removeAnswers']=function(_0x221a5d,_0x44e377,_0x51d8d6){return db[_0xac7d('0x56')][_0xac7d('0x63')]({'where':{'id':_0x221a5d[_0xac7d('0x66')]['id']}})[_0xac7d('0x24')](handleEntityNotFound(_0x44e377,null))['then'](function(_0x38bd54){if(_0x38bd54){return _0x38bd54[_0xac7d('0x71')](_0x221a5d[_0xac7d('0x45')][_0xac7d('0x6e')]);}})[_0xac7d('0x24')](respondWithStatusCode(_0x44e377,null))['catch'](handleError(_0x44e377,null));};exports[_0xac7d('0x72')]=function(_0x9ec7c2,_0x15fd56,_0x51db1f){var _0x1f507a={'channel':_0xac7d('0x73')};var _0x393623=[];var _0x4cd453=[];var _0x323e5d={};return db[_0xac7d('0x56')]['find']({'where':{'id':_0x9ec7c2['params']['id']},'include':[{'model':db[_0xac7d('0x74')],'as':_0xac7d('0x75')}]})[_0xac7d('0x24')](handleEntityNotFound(_0x15fd56,null))[_0xac7d('0x24')](function(_0x29102e){_0x1f507a['account']=_0x29102e;_0x1f507a[_0xac7d('0x76')]=_['orderBy'](_0x29102e['Applications'],[_0xac7d('0x77')],[_0xac7d('0x78')]);if(_0x1f507a[_0xac7d('0x79')][_0xac7d('0x75')]){delete _0x1f507a['account'][_0xac7d('0x75')];}return db['CmContact']['describe']();})[_0xac7d('0x24')](function(_0x2f84c0){if(!_0x2f84c0){throw new db[(_0xac7d('0x20'))]['ValidationError']('no\x20available\x20attributes');}_0x393623=_[_0xac7d('0x7a')](_[_0xac7d('0x46')](_0x2f84c0),['createdAt','updatedAt']);_0x4cd453=_[_0xac7d('0x7a')](_[_0xac7d('0x46')](_0x2f84c0),['createdAt',_0xac7d('0x7b'),'CompanyId','ListId']);_0x1f507a[_0xac7d('0x5e')]={'mapKey':_0xac7d('0x7c')};if(_0x1f507a[_0xac7d('0x79')][_0xac7d('0x54')]){switch(_0x1f507a[_0xac7d('0x79')][_0xac7d('0x54')]){case _0xac7d('0x7d'):_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x7e')]=_0x9ec7c2[_0xac7d('0x5e')]['From'];_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x5e')]=_0x9ec7c2[_0xac7d('0x5e')][_0xac7d('0x7f')];_0x1f507a['body'][_0xac7d('0x80')]=_0x9ec7c2['body']['MessageSid'];break;case _0xac7d('0x81'):_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x7e')]='+'+_0x9ec7c2[_0xac7d('0x5e')][_0xac7d('0x82')];_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x5e')]=_0x9ec7c2[_0xac7d('0x5e')][_0xac7d('0x83')];break;case'connectel':_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x7e')]=_0x9ec7c2[_0xac7d('0x5e')][_0xac7d('0x7e')];_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x5e')]=_0x9ec7c2[_0xac7d('0x5e')][_0xac7d('0x2c')];break;case'clicksend':_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x7e')]=_0x9ec7c2['body']['from'];_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x5e')]=_0x9ec7c2[_0xac7d('0x5e')][_0xac7d('0x5e')];_0x1f507a[_0xac7d('0x5e')]['messageId']=_0x9ec7c2[_0xac7d('0x5e')][_0xac7d('0x84')];break;case'plivo':_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x7e')]=_0x9ec7c2['body'][_0xac7d('0x85')];_0x1f507a['body']['body']=_0x9ec7c2[_0xac7d('0x5e')]['Text'];_0x1f507a['body'][_0xac7d('0x80')]=_0x9ec7c2[_0xac7d('0x5e')][_0xac7d('0x86')];break;case _0xac7d('0x87'):_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x7e')]='+'+_0x9ec7c2[_0xac7d('0x5e')]['results'][0x0][_0xac7d('0x7e')];_0x1f507a['body'][_0xac7d('0x5e')]=_0x9ec7c2[_0xac7d('0x5e')][_0xac7d('0x88')][0x0][_0xac7d('0x83')];_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x80')]=_0x9ec7c2[_0xac7d('0x5e')]['results'][0x0]['messageId'];break;case'csc':_0x1f507a[_0xac7d('0x5e')]['from']=_0x9ec7c2[_0xac7d('0x5e')][_0xac7d('0x89')];_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x5e')]=_0x9ec7c2[_0xac7d('0x5e')]['segmentedMessage'][_0xac7d('0x2c')];break;case'clickatell':_0x1f507a['body'][_0xac7d('0x7e')]=_0x9ec7c2['body'][_0xac7d('0x8a')];_0x1f507a[_0xac7d('0x5e')]['body']=_0x9ec7c2['body'][_0xac7d('0x83')];_0x1f507a['body'][_0xac7d('0x80')]=_0x9ec7c2[_0xac7d('0x5e')]['replyMessageId'];break;case _0xac7d('0x8b'):_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x7e')]=_0x9ec7c2[_0xac7d('0x5e')][_0xac7d('0x7e')];_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x5e')]=_0x9ec7c2[_0xac7d('0x5e')]['message'];_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x80')]=_0x9ec7c2[_0xac7d('0x5e')][_0xac7d('0x8c')];break;}}if(_0x1f507a['body']['id']){delete _0x1f507a['body']['id'];}if(_[_0xac7d('0x8d')](_0x1f507a['body'][_0xac7d('0x7e')])){throw new db[(_0xac7d('0x20'))]['ValidationError'](_0xac7d('0x8e'));}if(_[_0xac7d('0x8d')](_0x1f507a[_0xac7d('0x5e')]['body'])||_0x1f507a['body']['body']===''){throw new db[(_0xac7d('0x20'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xac7d('0x8d')](_0x1f507a['body'][_0xac7d('0x8f')])){throw new db[(_0xac7d('0x20'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4cd453);}if(!_[_0xac7d('0x90')](_0x4cd453,_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x8f')])){throw new db[(_0xac7d('0x20'))][(_0xac7d('0x21'))](_0xac7d('0x91')+_0x4cd453);}_0x323e5d[_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x8f')]]=_0x1f507a['body']['from'];return db[_0xac7d('0x92')][_0xac7d('0x63')]({'where':{'id':_0x1f507a[_0xac7d('0x79')][_0xac7d('0x93')]},'include':[{'model':db[_0xac7d('0x94')],'as':_0xac7d('0x95'),'where':_0x323e5d,'limit':0x1,'order':[[_0xac7d('0x7b'),'DESC']]}]});})[_0xac7d('0x24')](handleEntityNotFound(_0x15fd56,null))[_0xac7d('0x24')](function(_0x4b31c1){if(_0x4b31c1){_0x1f507a[_0xac7d('0x96')]=_[_0xac7d('0x97')](_0x4b31c1,[_0xac7d('0x95')]);if(_0x4b31c1[_0xac7d('0x95')][_0xac7d('0x4a')]){return _0x4b31c1[_0xac7d('0x95')][0x0];}var _0x234a58=_[_0xac7d('0x98')](_0x1f507a[_0xac7d('0x5e')],{'firstName':_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x7e')],'ListId':_0x4b31c1['id']});_0x234a58[_0x1f507a[_0xac7d('0x5e')][_0xac7d('0x8f')]]=_0x1f507a[_0xac7d('0x5e')]['from'];return db[_0xac7d('0x94')][_0xac7d('0x5d')](_0x234a58,{'fields':_0x393623,'raw':!![]});}})[_0xac7d('0x24')](handleEntityNotFound(_0x15fd56,null))['then'](function(_0x3ebcc5){if(_0x3ebcc5){_0x1f507a[_0xac7d('0x99')]=_0x3ebcc5;var _0x5d9cea={'ContactId':_0x3ebcc5['id'],'phone':_0x1f507a['body'][_0xac7d('0x7e')],'SmsAccountId':_0x9ec7c2['params']['id']};var _0x261afa={'ContactId':_0x3ebcc5['id'],'SmsAccountId':_0x9ec7c2[_0xac7d('0x66')]['id'],'closed':![]};return db[_0xac7d('0x9a')]['find']({'where':_0x261afa})[_0xac7d('0x24')](function(_0xe43ed8){if(_0xe43ed8){return[_0xe43ed8,![]];}return db[_0xac7d('0x9a')][_0xac7d('0x5d')](_0x5d9cea)[_0xac7d('0x24')](function(_0x425280){return[_0x425280,!![]];});});}})['spread'](function(_0x299be2,_0x234604){_0x1f507a[_0xac7d('0x9b')]=_0x299be2[_0xac7d('0x3a')]({'plain':!![]});_0x1f507a[_0xac7d('0x9b')][_0xac7d('0x9c')]=![];if(_0x234604){if(_0x1f507a[_0xac7d('0x79')][_0xac7d('0x9d')]){_0x1f507a[_0xac7d('0x76')][_0xac7d('0x9e')]({'id':0x0,'priority':_0x1f507a[_0xac7d('0x76')][_0xac7d('0x4a')]+0x1,'app':_0xac7d('0x9f'),'appdata':_0xac7d('0xa0'),'interval':'*,*,*,*'});}_0x1f507a['interaction'][_0xac7d('0x9c')]=!![];}return db[_0xac7d('0xa1')][_0xac7d('0x5d')]({'phone':_0x1f507a[_0xac7d('0x5e')]['from'],'messageId':_0x1f507a['body']['messageId'],'body':_0x1f507a[_0xac7d('0x5e')]['body'],'SmsAccountId':_0x9ec7c2[_0xac7d('0x66')]['id'],'SmsInteractionId':_0x299be2['id'],'direction':'in','ContactId':_0x299be2[_0xac7d('0xa2')],'AttachmentId':_0x1f507a['body'][_0xac7d('0xa3')]});})[_0xac7d('0x24')](function(_0x4d9bcf){_0x1f507a[_0xac7d('0x2c')]=_0x4d9bcf;if(_0x1f507a[_0xac7d('0x9b')][_0xac7d('0xa4')]){return db[_0xac7d('0xa5')]['find']({'attributes':['id',_0xac7d('0x3d')],'where':{'id':_0x1f507a[_0xac7d('0x9b')][_0xac7d('0xa4')]}})[_0xac7d('0x24')](function(_0x358bcc){if(_0x358bcc){_0x1f507a['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xac7d('0xa6'),'appdata':_0x358bcc[_0xac7d('0x3d')]+','+(_0x1f507a['account'][_0xac7d('0xa7')]||0xa),'interval':_0xac7d('0xa8')});}return respondWithRpcPromise(_0xac7d('0xa9'),_0xac7d('0xaa'),_0x1f507a);});}return respondWithRpcPromise(_0xac7d('0xa9'),'startRouting',_0x1f507a);})[_0xac7d('0x24')](function(_0x474de1){if(_0x474de1){var _0x103e27=0xc8;var _0x55027a='receiveMessage';logger[_0xac7d('0x25')](_0xac7d('0x28'),_0x55027a,_0x103e27,_0xac7d('0xab'));logger[_0xac7d('0xac')](_0xac7d('0xad'),_0x55027a,_0x103e27,_0xac7d('0xab'),JSON['stringify'](_0x474de1));if(_0x1f507a['account'][_0xac7d('0x54')]===_0xac7d('0x7d')){return _0x15fd56['status'](_0x103e27)[_0xac7d('0x32')](_0xac7d('0xae'),'text/xml')[_0xac7d('0x3e')]('\x0a');}else{return _0x15fd56[_0xac7d('0x2e')](_0x103e27)[_0xac7d('0x34')](_0x474de1);}}})['catch'](handleError(_0x15fd56,null));};exports[_0xac7d('0xaf')]=function(_0x3e211f,_0x111f19,_0x1aac1c){return db[_0xac7d('0x56')][_0xac7d('0x6a')]({'where':{'id':_0x3e211f[_0xac7d('0x66')]['id']}})[_0xac7d('0x24')](handleEntityNotFound(_0x111f19,null))['then'](function(_0x5415b6){if(_0x5415b6){return db[_0xac7d('0xb0')][_0xac7d('0xb1')](function(_0x9dab9f){return db[_0xac7d('0x74')][_0xac7d('0x39')]({'where':{'SmsAccountId':_0x3e211f[_0xac7d('0x66')]['id']},'transaction':_0x9dab9f})[_0xac7d('0x24')](function(_0x23abbe){var _0x10f755=_[_0xac7d('0x40')](_0x3e211f[_0xac7d('0x5e')],function(_0xf5cc0d){_0xf5cc0d[_0xac7d('0x68')]=_0x3e211f[_0xac7d('0x66')]['id'];return _0xf5cc0d;});return db[_0xac7d('0x74')][_0xac7d('0xb2')](_0x10f755,{'transaction':_0x9dab9f});});})['then'](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x3e211f[_0xac7d('0x66')]['id']},'order':_0xac7d('0x77')});});}})[_0xac7d('0x24')](respondWithResult(_0x111f19,null))['catch'](handleError(_0x111f19,null));};exports['getApplications']=function(_0x41f698,_0x1f51c4,_0x2fad8a){var _0x29423d={};var _0x47e24d={};var _0x15cf73;var _0x1e6408;return db[_0xac7d('0x56')]['findOne']({'where':{'id':_0x41f698[_0xac7d('0x66')]['id']}})[_0xac7d('0x24')](handleEntityNotFound(_0x1f51c4,null))[_0xac7d('0x24')](function(_0x3d6071){if(_0x3d6071){_0x15cf73=_0x3d6071;_0x47e24d[_0xac7d('0x44')]=_['keys'](db['SmsApplication']['rawAttributes']);_0x47e24d[_0xac7d('0x45')]=_[_0xac7d('0x46')](_0x41f698['query']);_0x47e24d[_0xac7d('0x51')]=_[_0xac7d('0x47')](_0x47e24d['model'],_0x47e24d[_0xac7d('0x45')]);_0x29423d[_0xac7d('0x48')]=_[_0xac7d('0x47')](_0x47e24d[_0xac7d('0x44')],qs[_0xac7d('0x49')](_0x41f698[_0xac7d('0x45')][_0xac7d('0x49')]));_0x29423d[_0xac7d('0x48')]=_0x29423d[_0xac7d('0x48')]['length']?_0x29423d['attributes']:_0x47e24d[_0xac7d('0x44')];_0x29423d[_0xac7d('0x4e')]=qs[_0xac7d('0x4f')](_0x41f698[_0xac7d('0x45')][_0xac7d('0x4f')]);_0x29423d['where']=qs[_0xac7d('0x51')](_[_0xac7d('0x6b')](_0x41f698[_0xac7d('0x45')],_0x47e24d['filters']));if(_0x41f698[_0xac7d('0x45')][_0xac7d('0x52')]){_0x29423d[_0xac7d('0x50')]=_[_0xac7d('0x53')](_0x29423d['where'],{'$or':_['map'](_0x29423d[_0xac7d('0x48')],function(_0x1b69c7){var _0x341398={};_0x341398[_0x1b69c7]={'$like':'%'+_0x41f698['query']['filter']+'%'};return _0x341398;})});}_0x29423d=_[_0xac7d('0x53')]({},_0x29423d,_0x41f698[_0xac7d('0x55')]);return _0x15cf73['getApplications'](_0x29423d);}})[_0xac7d('0x24')](function(_0x2181a3){if(_0x2181a3){_0x1e6408=_0x2181a3[_0xac7d('0x4a')];if(!_0x41f698[_0xac7d('0x45')][_0xac7d('0x4b')](_0xac7d('0x4c'))){_0x29423d[_0xac7d('0x31')]=qs[_0xac7d('0x31')](_0x41f698[_0xac7d('0x45')][_0xac7d('0x31')]);_0x29423d['offset']=qs[_0xac7d('0x4d')](_0x41f698[_0xac7d('0x45')][_0xac7d('0x4d')]);}return _0x15cf73[_0xac7d('0xb3')](_0x29423d);}})[_0xac7d('0x24')](function(_0x27ad6b){if(_0x27ad6b){return _0x27ad6b?{'count':_0x1e6408,'rows':_0x27ad6b}:null;}})['then'](respondWithResult(_0x1f51c4,null))[_0xac7d('0x59')](handleError(_0x1f51c4,null));};exports[_0xac7d('0xb4')]=function(_0x5b706b,_0x42c359,_0x15dc52){var _0x583775={'raw':![],'where':{}};var _0x4c6843={};var _0x5a18ff={'count':0x0,'rows':[]};return db[_0xac7d('0x56')]['findOne']({'where':{'id':_0x5b706b[_0xac7d('0x66')]['id']}})[_0xac7d('0x24')](handleEntityNotFound(_0x42c359,null))['then'](function(_0x1d83bd){if(_0x1d83bd){_0x4c6843[_0xac7d('0x44')]=_['keys'](db['SmsInteraction'][_0xac7d('0x41')]);_0x4c6843[_0xac7d('0x45')]=_['keys'](_0x5b706b['query']);_0x4c6843['filters']=_['intersection'](_0x4c6843[_0xac7d('0x44')],_0x4c6843[_0xac7d('0x45')]);_0x583775['attributes']=_[_0xac7d('0x47')](_0x4c6843[_0xac7d('0x44')],qs[_0xac7d('0x49')](_0x5b706b['query'][_0xac7d('0x49')]));_0x583775[_0xac7d('0x48')]=_0x583775['attributes'][_0xac7d('0x4a')]?_0x583775[_0xac7d('0x48')]:_0x4c6843[_0xac7d('0x44')];if(!_0x5b706b[_0xac7d('0x45')]['hasOwnProperty'](_0xac7d('0x4c'))){_0x583775[_0xac7d('0x31')]=qs[_0xac7d('0x31')](_0x5b706b[_0xac7d('0x45')][_0xac7d('0x31')]);_0x583775[_0xac7d('0x4d')]=qs['offset'](_0x5b706b[_0xac7d('0x45')][_0xac7d('0x4d')]);}_0x583775[_0xac7d('0x4e')]=qs['sort'](_0x5b706b['query'][_0xac7d('0x4f')]);_0x583775[_0xac7d('0x50')]=qs[_0xac7d('0x51')](_[_0xac7d('0x6b')](_0x5b706b[_0xac7d('0x45')],_0x4c6843[_0xac7d('0x51')]));_0x583775['where']['SmsAccountId']=_0x1d83bd['id'];if(_0x5b706b[_0xac7d('0x45')][_0xac7d('0x52')]){_0x583775[_0xac7d('0x50')]=_['merge'](_0x583775[_0xac7d('0x50')],{'$or':_[_0xac7d('0x40')](_0x583775[_0xac7d('0x48')],function(_0x4ddbfc){var _0x14b28c={};_0x14b28c[_0x4ddbfc]={'$like':'%'+_0x5b706b[_0xac7d('0x45')][_0xac7d('0x52')]+'%'};return _0x14b28c;})});}_0x583775=_[_0xac7d('0x53')]({},_0x583775,_0x5b706b[_0xac7d('0x55')]);return db[_0xac7d('0x9a')]['count']({'where':_0x583775[_0xac7d('0x50')]})[_0xac7d('0x24')](function(_0x1ecd91){_0x5a18ff['count']=_0x1ecd91;if(_0x5b706b[_0xac7d('0x45')][_0xac7d('0x6c')]){_0x583775[_0xac7d('0x5c')]=[{'model':db[_0xac7d('0x94')],'as':_0xac7d('0xb5'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xac7d('0x3d'),'fullname',_0xac7d('0xb6')],'required':![]},{'model':db[_0xac7d('0xb7')],'as':_0xac7d('0xb8'),'attributes':['id',_0xac7d('0x3d'),_0xac7d('0xb9')],'where':_0x5b706b[_0xac7d('0x45')][_0xac7d('0xba')]?{'id':_0x5b706b[_0xac7d('0x45')][_0xac7d('0xba')]}:undefined,'required':_0x5b706b[_0xac7d('0x45')]['tag']?!![]:![]}];}return db[_0xac7d('0x9a')]['findAll'](_0x583775);})[_0xac7d('0x24')](function(_0x42839d){_0x5a18ff['rows']=_0x42839d;return _0x5a18ff;});}})[_0xac7d('0x24')](respondWithFilteredResult(_0x42c359,_0x583775))['catch'](handleError(_0x42c359,null));};exports[_0xac7d('0x3e')]=function(_0x387695,_0x1771fe,_0x23f7d4){var _0x99c176,_0x46c0ac,_0x2fb671;if(_[_0xac7d('0x8d')](_0x387695[_0xac7d('0x5e')]['body'])||_0x387695['body']['body']===''){throw new db['Sequelize'][(_0xac7d('0x21'))](_0xac7d('0xbb'));}if(_[_0xac7d('0x8d')](_0x387695[_0xac7d('0x5e')]['to'])){throw new db[(_0xac7d('0x20'))]['ValidationError'](_0xac7d('0xbc'));}_0x99c176=_0x387695[_0xac7d('0x5e')]['to'];return db['SmsAccount'][_0xac7d('0x63')]({'where':{'id':_0x387695[_0xac7d('0x66')]['id']},'include':[{'model':db['CmList'],'as':_0xac7d('0xbd'),'include':[{'model':db[_0xac7d('0x94')],'as':_0xac7d('0x95'),'where':{'mobile':_0x99c176},'limit':0x1,'order':[[_0xac7d('0x7b'),'DESC']]}]}]})[_0xac7d('0x24')](handleEntityNotFound(_0x1771fe,null))['then'](function(_0x394b80){if(_0x394b80&&_0x394b80[_0xac7d('0xbd')]){_0x46c0ac=_0x394b80[_0xac7d('0x3a')]({'plain':!![]});if(_0x46c0ac[_0xac7d('0xbd')]&&_0x46c0ac[_0xac7d('0xbd')][_0xac7d('0x95')][_0xac7d('0x4a')]){return _0x46c0ac['List'][_0xac7d('0x95')][0x0];}return db[_0xac7d('0x94')][_0xac7d('0x5d')](_[_0xac7d('0x98')](_0x387695[_0xac7d('0x5e')],{'firstName':_0x99c176,'mobile':_0x99c176,'phone':_0x99c176,'ListId':_0x46c0ac[_0xac7d('0x93')]}));}})['then'](handleEntityNotFound(_0x1771fe,null))[_0xac7d('0x24')](function(_0x577f15){if(_0x577f15){_0x2fb671=_0x577f15;return db['SmsInteraction'][_0xac7d('0x63')]({'where':{'ContactId':_0x2fb671['id'],'closed':![],'SmsAccountId':_0x46c0ac['id']}})[_0xac7d('0x24')](function(_0x4d34ac){if(_0x4d34ac){return[_0x4d34ac,![]];}return db[_0xac7d('0x9a')][_0xac7d('0x5d')]({'UserId':_0x387695[_0xac7d('0x5f')]['id'],'ContactId':_0x2fb671['id'],'SmsAccountId':_0x46c0ac['id'],'phone':_0x99c176,'firstMsgDirection':'out','Messages':[_[_0xac7d('0x53')](_0x387695[_0xac7d('0x5e')],{'read':![],'body':_0x387695[_0xac7d('0x5e')][_0xac7d('0x5e')],'phone':_0x99c176,'SmsAccountId':_0x46c0ac['id'],'UserId':_0x387695[_0xac7d('0x5f')]['id'],'ContactId':_0x2fb671['id']})]},{'include':[{'model':db[_0xac7d('0xa1')],'as':'Messages'}]})[_0xac7d('0x24')](function(_0x3059f0){return[_0x3059f0,!![]];});});}})[_0xac7d('0xbe')](function(_0x3d817f,_0x4b621f){if(_0x4b621f){return _0x3d817f;}return db['SmsMessage'][_0xac7d('0x5d')](_[_0xac7d('0x53')](_0x387695[_0xac7d('0x5e')],{'read':![],'body':_0x387695[_0xac7d('0x5e')]['body'],'phone':_0x99c176,'SmsAccountId':_0x46c0ac['id'],'SmsInteractionId':_0x3d817f['id'],'UserId':_0x387695[_0xac7d('0x5f')]['id'],'ContactId':_0x2fb671['id']}))['then'](function(_0xc985a6){_0x3d817f[_0xac7d('0xbf')][_0xac7d('0xc0')]=[];_0x3d817f[_0xac7d('0xbf')][_0xac7d('0xc0')]['push'](_0xc985a6['dataValues']);return _0x3d817f;});})[_0xac7d('0x24')](respondWithResult(_0x1771fe,null))[_0xac7d('0x59')](handleError(_0x1771fe,null));};exports['status']=function(_0x3ae83a,_0x3085e2,_0x5e20a4){if(_0x3ae83a[_0xac7d('0x5e')]['id']){delete _0x3ae83a[_0xac7d('0x5e')]['id'];}console[_0xac7d('0xc1')]('endpoint\x20/status\x20POST\x20/',_0x3ae83a['body']);var _0x4e2f87,_0x4f7efb,_0x9c0c03;return db[_0xac7d('0x56')][_0xac7d('0x63')]({'where':{'id':_0x3ae83a[_0xac7d('0x66')]['id']}})[_0xac7d('0x24')](handleEntityNotFound(_0x3085e2,null))[_0xac7d('0x24')](function(_0x42b44b){if(_0x42b44b){_0x9c0c03=_0x42b44b;logger[_0xac7d('0xac')](_0xac7d('0x28'),_0xac7d('0x2e'),_0xac7d('0xc2'),_0x42b44b[_0xac7d('0x54')],util[_0xac7d('0xc3')](_0x3ae83a['body'],{'showHidden':![],'depth':null}));switch(_0x42b44b[_0xac7d('0x54')]){case _0xac7d('0x81'):if(_0x3ae83a['body'][_0xac7d('0xc4')]&&_0x3ae83a[_0xac7d('0x5e')][_0xac7d('0x2e')]){_0x4f7efb=_0x3ae83a[_0xac7d('0x5e')][_0xac7d('0x2e')];return db['SmsMessage'][_0xac7d('0x63')]({'where':{'messageId':_0x3ae83a[_0xac7d('0x5e')][_0xac7d('0xc4')]}});}break;case _0xac7d('0xc5'):if(_0x3ae83a['body']['requestid']&&_0x3ae83a['body']['statusInt']){_0x4f7efb=_0x3ae83a[_0xac7d('0x5e')][_0xac7d('0xc6')];return db[_0xac7d('0xa1')][_0xac7d('0x63')]({'where':{'messageId':_0x3ae83a[_0xac7d('0x5e')][_0xac7d('0xc7')]}});}break;case _0xac7d('0xc8'):if(_0x3ae83a[_0xac7d('0x5e')][_0xac7d('0x84')]&&_0x3ae83a[_0xac7d('0x5e')][_0xac7d('0xc9')]){_0x4f7efb=_0x3ae83a[_0xac7d('0x5e')][_0xac7d('0xc9')];return db[_0xac7d('0xa1')][_0xac7d('0x63')]({'where':{'messageId':_0x3ae83a[_0xac7d('0x5e')][_0xac7d('0x84')]}});}break;case _0xac7d('0x87'):var _0x15c61f=_0x3ae83a[_0xac7d('0x5e')][_0xac7d('0x88')][0x0];if(_0x15c61f[_0xac7d('0x80')]&&_0x15c61f[_0xac7d('0x2e')]['groupName']===_0xac7d('0xca')){_0x4f7efb=_0x15c61f['status'][_0xac7d('0xcb')];return db[_0xac7d('0xa1')][_0xac7d('0x63')]({'where':{'messageId':_0x15c61f[_0xac7d('0x80')]}});}break;case _0xac7d('0xcc'):if(_0x3ae83a['body'][_0xac7d('0x80')]&&_0x3ae83a['body'][_0xac7d('0x2e')]){_0x4f7efb=_0x3ae83a[_0xac7d('0x5e')][_0xac7d('0x2e')];return db[_0xac7d('0xa1')][_0xac7d('0x63')]({'where':{'messageId':_0x3ae83a[_0xac7d('0x5e')][_0xac7d('0x80')]}});}break;case _0xac7d('0x8b'):if(_0x3ae83a['body'][_0xac7d('0xcd')]&&_0x3ae83a[_0xac7d('0x5e')]['status']){_0x4f7efb=_0x3ae83a[_0xac7d('0x5e')][_0xac7d('0x2e')];return db[_0xac7d('0xa1')][_0xac7d('0x63')]({'where':{'messageId':_0x3ae83a[_0xac7d('0x5e')]['redif']}});}break;}}})[_0xac7d('0x24')](handleEntityNotFound(_0x3085e2,null))[_0xac7d('0x24')](function(_0x7d639b){if(_0x7d639b){_0x4e2f87=_0x7d639b;switch(_0x9c0c03[_0xac7d('0x54')]){case _0xac7d('0x81'):if(_0x4f7efb===_0xac7d('0xca')){return _0x4e2f87[_0xac7d('0x38')]({'read':!![]});}else{logger[_0xac7d('0x2a')](_0xac7d('0x28'),_0xac7d('0x2e'),_0xac7d('0x81'),util[_0xac7d('0xc3')](_0x3ae83a[_0xac7d('0x5e')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x4f7efb==='1'){return _0x4e2f87[_0xac7d('0x38')]({'read':!![]});}else{logger['error'](_0xac7d('0x28'),_0xac7d('0x2e'),_0xac7d('0x81'),util['inspect'](_0x3ae83a[_0xac7d('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xac7d('0xc8'):if(!_0x3ae83a['body'][_0xac7d('0xce')]&&_0x4f7efb>=0xc8&&_0x4f7efb<=0xce){return _0x4e2f87[_0xac7d('0x38')]({'read':!![]});}else{logger[_0xac7d('0x2a')](_0xac7d('0x28'),'status',_0xac7d('0xc8'),util[_0xac7d('0xc3')](_0x3ae83a['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x67c45=_0x3ae83a[_0xac7d('0x5e')]['results'][0x0];if(_0x67c45[_0xac7d('0x2e')][_0xac7d('0xcb')]===_0xac7d('0xca')){return _0x4e2f87[_0xac7d('0x38')]({'read':!![]});}else{logger[_0xac7d('0x2a')](_0xac7d('0x28'),_0xac7d('0x2e'),_0xac7d('0x87'),util[_0xac7d('0xc3')](_0x3ae83a[_0xac7d('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xac7d('0xcc'):if(_0x4f7efb==_0xac7d('0xcf')||_0x4f7efb==_0xac7d('0xd0')){return _0x4e2f87[_0xac7d('0x38')]({'read':!![]});}else{logger[_0xac7d('0x2a')](_0xac7d('0x28'),_0xac7d('0x2e'),_0xac7d('0xcc'),util['inspect'](_0x3ae83a[_0xac7d('0x5e')],{'showHidden':![],'depth':null}));}break;case _0xac7d('0x8b'):if(_0x4f7efb==='DELIVRD'||_0x4f7efb==='ACCEPTD'){return _0x4e2f87['update']({'read':!![]});}else{logger['error'](_0xac7d('0x28'),_0xac7d('0x2e'),_0xac7d('0x8b'),util[_0xac7d('0xc3')](_0x3ae83a[_0xac7d('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x4e2f87;}})[_0xac7d('0x24')](respondWithResult(_0x3085e2,null))[_0xac7d('0x59')](handleError(_0x3085e2,null));};exports[_0xac7d('0xd1')]=function(_0x49c859,_0x4d1188,_0x427e9d){var _0x1e73d3,_0x123647,_0x3df8a2;return db[_0xac7d('0x56')][_0xac7d('0x63')]({'where':{'id':_0x49c859[_0xac7d('0x66')]['id']}})[_0xac7d('0x24')](handleEntityNotFound(_0x4d1188,null))['then'](function(_0x2b7d38){if(_0x2b7d38){_0x3df8a2=_0x2b7d38;logger[_0xac7d('0xac')](_0xac7d('0x28'),_0xac7d('0x2e'),'received\x20delivery\x20report\x20from',_0x2b7d38[_0xac7d('0x54')],util[_0xac7d('0xc3')](_0x49c859[_0xac7d('0x45')],{'showHidden':![],'depth':null}));switch(_0x2b7d38[_0xac7d('0x54')]){case _0xac7d('0xd2'):if(_0x49c859[_0xac7d('0x45')][_0xac7d('0xd3')]&&_0x49c859[_0xac7d('0x45')][_0xac7d('0xd4')]){_0x123647=_0x49c859[_0xac7d('0x45')][_0xac7d('0xd4')];return db[_0xac7d('0xa1')]['find']({'where':{'messageId':_0x49c859[_0xac7d('0x45')]['message-id']}});}break;}}})[_0xac7d('0x24')](handleEntityNotFound(_0x4d1188,null))[_0xac7d('0x24')](function(_0xef0cd3){if(_0xef0cd3){_0x1e73d3=_0xef0cd3;switch(_0x3df8a2[_0xac7d('0x54')]){case'csc':if(_0x123647==='2'||_0x123647==='6'){return _0x1e73d3[_0xac7d('0x38')]({'read':!![]});}else{logger[_0xac7d('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xac7d('0x2e'),_0xac7d('0xd2'),util['inspect'](_0x49c859[_0xac7d('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x1e73d3;}})[_0xac7d('0x24')](respondWithResult(_0x4d1188,null))[_0xac7d('0x59')](handleError(_0x4d1188,null));};exports[_0xac7d('0xd5')]=function(_0x2881b7,_0x3109b2,_0x39bfdc){return db[_0xac7d('0x56')][_0xac7d('0x63')]({'where':{'id':_0x2881b7[_0xac7d('0x66')]['id']}})[_0xac7d('0x24')](handleEntityNotFound(_0x3109b2,null))[_0xac7d('0x24')](function(_0x429e1b){if(_0x429e1b){return _0x429e1b[_0xac7d('0xd5')](_0x2881b7[_0xac7d('0x5e')][_0xac7d('0x6e')],_[_0xac7d('0x97')](_0x2881b7['body'],['ids','id'])||{})[_0xac7d('0xbe')](function(_0x34e78c){for(var _0x51c542=0x0;_0x51c542<_0x2881b7[_0xac7d('0x5e')]['ids'][_0xac7d('0x4a')];_0x51c542+=0x1){socket[_0xac7d('0xd6')](_0xac7d('0xd7'),{'UserId':_0x2881b7['body']['ids'][_0x51c542],'SmsAccountId':_0x2881b7['params']['id']});}return _0x34e78c;});}})[_0xac7d('0x24')](respondWithResult(_0x3109b2,null))['catch'](handleError(_0x3109b2,null));};exports[_0xac7d('0xd8')]=function(_0x273692,_0x491e11,_0x28b1aa){return db['SmsAccount']['find']({'where':{'id':_0x273692[_0xac7d('0x66')]['id']}})[_0xac7d('0x24')](handleEntityNotFound(_0x491e11,null))[_0xac7d('0x24')](function(_0x42d5be){if(_0x42d5be){return _0x42d5be[_0xac7d('0xd8')](_0x273692[_0xac7d('0x45')][_0xac7d('0x6e')])[_0xac7d('0x24')](function(){if(_[_0xac7d('0xd9')](_0x273692[_0xac7d('0x45')][_0xac7d('0x6e')])){for(var _0x12ad89=0x0;_0x12ad89<_0x273692[_0xac7d('0x45')][_0xac7d('0x6e')][_0xac7d('0x4a')];_0x12ad89+=0x1){socket[_0xac7d('0xd6')](_0xac7d('0xda'),{'UserId':Number(_0x273692[_0xac7d('0x45')][_0xac7d('0x6e')][_0x12ad89]),'SmsAccountId':Number(_0x273692[_0xac7d('0x66')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x273692[_0xac7d('0x45')][_0xac7d('0x6e')]),'SmsAccountId':Number(_0x273692['params']['id'])});}});}})[_0xac7d('0x24')](respondWithStatusCode(_0x491e11,null))['catch'](handleError(_0x491e11,null));};exports[_0xac7d('0xdb')]=function(_0x15a3f0,_0x185209,_0x8b43b7){var _0x29cac4={};var _0x543d79={};var _0x15a2a0;var _0x5091ef;return db[_0xac7d('0x56')][_0xac7d('0x6a')]({'where':{'id':_0x15a3f0[_0xac7d('0x66')]['id']}})[_0xac7d('0x24')](handleEntityNotFound(_0x185209,null))[_0xac7d('0x24')](function(_0x10ddab){if(_0x10ddab){_0x15a2a0=_0x10ddab;_0x543d79['model']=_['keys'](db[_0xac7d('0xa5')][_0xac7d('0x41')]);_0x543d79[_0xac7d('0x45')]=_['keys'](_0x15a3f0[_0xac7d('0x45')]);_0x543d79['filters']=_['intersection'](_0x543d79['model'],_0x543d79[_0xac7d('0x45')]);_0x29cac4['attributes']=_[_0xac7d('0x47')](_0x543d79[_0xac7d('0x44')],qs['fields'](_0x15a3f0[_0xac7d('0x45')]['fields']));_0x29cac4[_0xac7d('0x48')]=_0x29cac4['attributes'][_0xac7d('0x4a')]?_0x29cac4['attributes']:_0x543d79[_0xac7d('0x44')];_0x29cac4[_0xac7d('0x4e')]=qs[_0xac7d('0x4f')](_0x15a3f0['query'][_0xac7d('0x4f')]);_0x29cac4[_0xac7d('0x50')]=qs[_0xac7d('0x51')](_[_0xac7d('0x6b')](_0x15a3f0[_0xac7d('0x45')],_0x543d79[_0xac7d('0x51')]));if(_0x15a3f0[_0xac7d('0x45')][_0xac7d('0x52')]){_0x29cac4[_0xac7d('0x50')]=_[_0xac7d('0x53')](_0x29cac4[_0xac7d('0x50')],{'$or':_[_0xac7d('0x40')](_0x29cac4[_0xac7d('0x48')],function(_0x3f7570){var _0x11ad9e={};_0x11ad9e[_0x3f7570]={'$like':'%'+_0x15a3f0[_0xac7d('0x45')][_0xac7d('0x52')]+'%'};return _0x11ad9e;})});}_0x29cac4=_['merge']({},_0x29cac4,_0x15a3f0['options']);return _0x15a2a0[_0xac7d('0xdb')](_0x29cac4);}})[_0xac7d('0x24')](function(_0x1ecc08){if(_0x1ecc08){_0x5091ef=_0x1ecc08['length'];if(!_0x15a3f0[_0xac7d('0x45')]['hasOwnProperty'](_0xac7d('0x4c'))){_0x29cac4[_0xac7d('0x31')]=qs[_0xac7d('0x31')](_0x15a3f0[_0xac7d('0x45')]['limit']);_0x29cac4[_0xac7d('0x4d')]=qs['offset'](_0x15a3f0['query'][_0xac7d('0x4d')]);}return _0x15a2a0[_0xac7d('0xdb')](_0x29cac4);}})[_0xac7d('0x24')](function(_0x17d821){if(_0x17d821){return _0x17d821?{'count':_0x5091ef,'rows':_0x17d821}:null;}})[_0xac7d('0x24')](respondWithResult(_0x185209,null))[_0xac7d('0x59')](handleError(_0x185209,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 932bd99..0413dce 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 _0x7d84=['hasOwnProperty','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit'];(function(_0x3f4315,_0xd6ec89){var _0x5842e3=function(_0x4b12f5){while(--_0x4b12f5){_0x3f4315['push'](_0x3f4315['shift']());}};_0x5842e3(++_0xd6ec89);}(_0x7d84,0x157));var _0x47d8=function(_0x473463,_0x21da73){_0x473463=_0x473463-0x0;var _0x42f406=_0x7d84[_0x473463];return _0x42f406;};'use strict';var EventEmitter=require(_0x47d8('0x0'));var SmsAccount=require(_0x47d8('0x1'))['db'][_0x47d8('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x47d8('0x3')](0x0);var events={'afterCreate':_0x47d8('0x4'),'afterUpdate':_0x47d8('0x5'),'afterDestroy':_0x47d8('0x6')};function emitEvent(_0x39357c){return function(_0x35c7b8,_0x497d48,_0x21d260){SmsAccountEvents[_0x47d8('0x7')](_0x39357c+':'+_0x35c7b8['id'],_0x35c7b8);SmsAccountEvents[_0x47d8('0x7')](_0x39357c,_0x35c7b8);_0x21d260(null);};}for(var e in events){if(events[_0x47d8('0x8')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x29f3=['save','remove','emit','hook','../../mysqldb','SmsAccount'];(function(_0x58b6cc,_0x559b8b){var _0x148892=function(_0x2a0176){while(--_0x2a0176){_0x58b6cc['push'](_0x58b6cc['shift']());}};_0x148892(++_0x559b8b);}(_0x29f3,0x124));var _0x329f=function(_0x574052,_0x2c8f25){_0x574052=_0x574052-0x0;var _0xdf2704=_0x29f3[_0x574052];return _0xdf2704;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x329f('0x0'))['db'][_0x329f('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x329f('0x2'),'afterUpdate':'update','afterDestroy':_0x329f('0x3')};function emitEvent(_0x10aed0){return function(_0x2e1012,_0x46094f,_0x20ad16){SmsAccountEvents[_0x329f('0x4')](_0x10aed0+':'+_0x2e1012['id'],_0x2e1012);SmsAccountEvents[_0x329f('0x4')](_0x10aed0,_0x2e1012);_0x20ad16(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x329f('0x5')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 855abb1..cd52854 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 _0x0371=['util','api','moment','bluebird','request-promise','path','rimraf','./smsAccount.attributes','define','SmsAccount','lodash'];(function(_0x199763,_0x3a00c8){var _0x12062b=function(_0x426ab2){while(--_0x426ab2){_0x199763['push'](_0x199763['shift']());}};_0x12062b(++_0x3a00c8);}(_0x0371,0xc5));var _0x1037=function(_0x1a595a,_0x263824){_0x1a595a=_0x1a595a-0x0;var _0x33f008=_0x0371[_0x1a595a];return _0x33f008;};'use strict';var _=require(_0x1037('0x0'));var util=require(_0x1037('0x1'));var logger=require('../../config/logger')(_0x1037('0x2'));var moment=require(_0x1037('0x3'));var BPromise=require(_0x1037('0x4'));var rp=require(_0x1037('0x5'));var fs=require('fs');var path=require(_0x1037('0x6'));var rimraf=require(_0x1037('0x7'));var config=require('../../config/environment');var attributes=require(_0x1037('0x8'));module['exports']=function(_0x5b0033,_0x50d037){return _0x5b0033[_0x1037('0x9')](_0x1037('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ec9=['moment','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','util','api'];(function(_0x583121,_0x5c5831){var _0x4a2bf2=function(_0x2ac9c6){while(--_0x2ac9c6){_0x583121['push'](_0x583121['shift']());}};_0x4a2bf2(++_0x5c5831);}(_0x1ec9,0x127));var _0x91ec=function(_0x1e6a00,_0x4e9318){_0x1e6a00=_0x1e6a00-0x0;var _0x42e1af=_0x1ec9[_0x1e6a00];return _0x42e1af;};'use strict';var _=require('lodash');var util=require(_0x91ec('0x0'));var logger=require('../../config/logger')(_0x91ec('0x1'));var moment=require(_0x91ec('0x2'));var BPromise=require('bluebird');var rp=require(_0x91ec('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x91ec('0x4'));var config=require(_0x91ec('0x5'));var attributes=require(_0x91ec('0x6'));module[_0x91ec('0x7')]=function(_0x273da1,_0x3d896a){return _0x273da1[_0x91ec('0x8')](_0x91ec('0x9'),attributes,{'tableName':_0x91ec('0xa'),'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 454e2d1..fd1eea7 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 _0xcfac=['info','SmsAccount,\x20%s,\x20%s','debug','error','code','message','result','catch','SmsAccount','find','options','raw','attributes','map','include','model','ShowSmsAccount','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then'];(function(_0x4bbb31,_0x183f56){var _0x5f4b64=function(_0x7df6fa){while(--_0x7df6fa){_0x4bbb31['push'](_0x4bbb31['shift']());}};_0x5f4b64(++_0x183f56);}(_0xcfac,0xb2));var _0xccfa=function(_0x43c892,_0x1e866f){_0x43c892=_0x43c892-0x0;var _0x25d880=_0xcfac[_0x43c892];return _0x25d880;};'use strict';var _=require(_0xccfa('0x0'));var util=require(_0xccfa('0x1'));var moment=require(_0xccfa('0x2'));var BPromise=require(_0xccfa('0x3'));var rs=require(_0xccfa('0x4'));var fs=require('fs');var Redis=require(_0xccfa('0x5'));var db=require(_0xccfa('0x6'))['db'];var utils=require(_0xccfa('0x7'));var logger=require(_0xccfa('0x8'))(_0xccfa('0x9'));var config=require(_0xccfa('0xa'));var jayson=require(_0xccfa('0xb'));var client=jayson[_0xccfa('0xc')][_0xccfa('0xd')]({'port':0x232a});config[_0xccfa('0xe')]=_[_0xccfa('0xf')](config[_0xccfa('0xe')],{'host':_0xccfa('0x10'),'port':0x18eb});var socket=require(_0xccfa('0x11'))(new Redis(config[_0xccfa('0xe')]));require(_0xccfa('0x12'))[_0xccfa('0x13')](socket);function respondWithRpcPromise(_0x483455,_0x20dd66,_0x2c456c){return new BPromise(function(_0x22f128,_0xc53e69){return client[_0xccfa('0x14')](_0x483455,_0x2c456c)[_0xccfa('0x15')](function(_0x2dd0c2){logger[_0xccfa('0x16')](_0xccfa('0x17'),_0x20dd66,'request\x20sent');logger[_0xccfa('0x18')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x20dd66,'request\x20sent',JSON['stringify'](_0x2dd0c2));if(_0x2dd0c2[_0xccfa('0x19')]){if(_0x2dd0c2[_0xccfa('0x19')][_0xccfa('0x1a')]===0x1f4){logger[_0xccfa('0x19')](_0xccfa('0x17'),_0x20dd66,_0x2dd0c2[_0xccfa('0x19')][_0xccfa('0x1b')]);return _0xc53e69(_0x2dd0c2['error'][_0xccfa('0x1b')]);}logger[_0xccfa('0x19')](_0xccfa('0x17'),_0x20dd66,_0x2dd0c2[_0xccfa('0x19')]['message']);return _0x22f128(_0x2dd0c2[_0xccfa('0x19')][_0xccfa('0x1b')]);}else{logger['info'](_0xccfa('0x17'),_0x20dd66,'request\x20sent');_0x22f128(_0x2dd0c2[_0xccfa('0x1c')]['message']);}})[_0xccfa('0x1d')](function(_0x41aeb0){logger[_0xccfa('0x19')]('SmsAccount,\x20%s,\x20%s',_0x20dd66,_0x41aeb0);_0xc53e69(_0x41aeb0);});});}exports['ShowSmsAccount']=function(_0x2a6e4a){var _0xf794=this;return new Promise(function(_0x35c8bc,_0xd39712){return db[_0xccfa('0x1e')][_0xccfa('0x1f')]({'raw':_0x2a6e4a[_0xccfa('0x20')]?_0x2a6e4a[_0xccfa('0x20')][_0xccfa('0x21')]===undefined?!![]:![]:!![],'where':_0x2a6e4a[_0xccfa('0x20')]?_0x2a6e4a[_0xccfa('0x20')]['where']||null:null,'attributes':_0x2a6e4a[_0xccfa('0x20')]?_0x2a6e4a[_0xccfa('0x20')][_0xccfa('0x22')]||null:null,'include':_0x2a6e4a['options']?_0x2a6e4a[_0xccfa('0x20')]['include']?_[_0xccfa('0x23')](_0x2a6e4a[_0xccfa('0x20')][_0xccfa('0x24')],function(_0x590b9c){return{'model':db[_0x590b9c[_0xccfa('0x25')]],'as':_0x590b9c['as'],'attributes':_0x590b9c[_0xccfa('0x22')],'include':_0x590b9c[_0xccfa('0x24')]?_[_0xccfa('0x23')](_0x590b9c[_0xccfa('0x24')],function(_0x48a3fd){return{'model':db[_0x48a3fd[_0xccfa('0x25')]],'as':_0x48a3fd['as'],'attributes':_0x48a3fd[_0xccfa('0x22')],'include':_0x48a3fd[_0xccfa('0x24')]?_['map'](_0x48a3fd[_0xccfa('0x24')],function(_0x35478e){return{'model':db[_0x35478e['model']],'as':_0x35478e['as'],'attributes':_0x35478e[_0xccfa('0x22')]};}):[]};}):[]};}):[]:[]})[_0xccfa('0x15')](function(_0x1e9b5a){logger['info'](_0xccfa('0x26'),_0x2a6e4a);logger['debug'](_0xccfa('0x26'),_0x2a6e4a,JSON[_0xccfa('0x27')](_0x1e9b5a));_0x35c8bc(_0x1e9b5a);})[_0xccfa('0x1d')](function(_0x1491b8){logger[_0xccfa('0x19')](_0xccfa('0x26'),_0x1491b8[_0xccfa('0x1b')],_0x2a6e4a);_0xd39712(_0xf794[_0xccfa('0x19')](0x1f4,_0x1491b8[_0xccfa('0x1b')]));});});}; \ No newline at end of file +var _0x58dc=['rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','find','options','raw','where','attributes','include','model','map','ShowSmsAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x15bdaf,_0x5b761e){var _0x2b031d=function(_0x98130e){while(--_0x98130e){_0x15bdaf['push'](_0x15bdaf['shift']());}};_0x2b031d(++_0x5b761e);}(_0x58dc,0xb2));var _0xc58d=function(_0x3ced06,_0x22247b){_0x3ced06=_0x3ced06-0x0;var _0x279186=_0x58dc[_0x3ced06];return _0x279186;};'use strict';var _=require('lodash');var util=require(_0xc58d('0x0'));var moment=require(_0xc58d('0x1'));var BPromise=require(_0xc58d('0x2'));var rs=require(_0xc58d('0x3'));var fs=require('fs');var Redis=require(_0xc58d('0x4'));var db=require(_0xc58d('0x5'))['db'];var utils=require(_0xc58d('0x6'));var logger=require('../../config/logger')(_0xc58d('0x7'));var config=require(_0xc58d('0x8'));var jayson=require(_0xc58d('0x9'));var client=jayson[_0xc58d('0xa')]['http']({'port':0x232a});config[_0xc58d('0xb')]=_[_0xc58d('0xc')](config[_0xc58d('0xb')],{'host':_0xc58d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc58d('0xe'))[_0xc58d('0xf')](socket);function respondWithRpcPromise(_0x303858,_0x73eaf0,_0x3e5ca6){return new BPromise(function(_0x6218e8,_0x495767){return client[_0xc58d('0x10')](_0x303858,_0x3e5ca6)['then'](function(_0x588c13){logger[_0xc58d('0x11')](_0xc58d('0x12'),_0x73eaf0,_0xc58d('0x13'));logger[_0xc58d('0x14')](_0xc58d('0x15'),_0x73eaf0,_0xc58d('0x13'),JSON[_0xc58d('0x16')](_0x588c13));if(_0x588c13[_0xc58d('0x17')]){if(_0x588c13[_0xc58d('0x17')][_0xc58d('0x18')]===0x1f4){logger['error'](_0xc58d('0x12'),_0x73eaf0,_0x588c13[_0xc58d('0x17')]['message']);return _0x495767(_0x588c13[_0xc58d('0x17')][_0xc58d('0x19')]);}logger[_0xc58d('0x17')](_0xc58d('0x12'),_0x73eaf0,_0x588c13[_0xc58d('0x17')]['message']);return _0x6218e8(_0x588c13[_0xc58d('0x17')][_0xc58d('0x19')]);}else{logger['info'](_0xc58d('0x12'),_0x73eaf0,_0xc58d('0x13'));_0x6218e8(_0x588c13[_0xc58d('0x1a')]['message']);}})[_0xc58d('0x1b')](function(_0x571ecc){logger['error'](_0xc58d('0x12'),_0x73eaf0,_0x571ecc);_0x495767(_0x571ecc);});});}exports['ShowSmsAccount']=function(_0x3d4585){var _0x2285a9=this;return new Promise(function(_0x37380c,_0x2a173e){return db['SmsAccount'][_0xc58d('0x1c')]({'raw':_0x3d4585['options']?_0x3d4585[_0xc58d('0x1d')][_0xc58d('0x1e')]===undefined?!![]:![]:!![],'where':_0x3d4585['options']?_0x3d4585[_0xc58d('0x1d')][_0xc58d('0x1f')]||null:null,'attributes':_0x3d4585[_0xc58d('0x1d')]?_0x3d4585['options'][_0xc58d('0x20')]||null:null,'include':_0x3d4585[_0xc58d('0x1d')]?_0x3d4585[_0xc58d('0x1d')][_0xc58d('0x21')]?_['map'](_0x3d4585[_0xc58d('0x1d')][_0xc58d('0x21')],function(_0x2ddee6){return{'model':db[_0x2ddee6[_0xc58d('0x22')]],'as':_0x2ddee6['as'],'attributes':_0x2ddee6[_0xc58d('0x20')],'include':_0x2ddee6[_0xc58d('0x21')]?_[_0xc58d('0x23')](_0x2ddee6['include'],function(_0x448c74){return{'model':db[_0x448c74[_0xc58d('0x22')]],'as':_0x448c74['as'],'attributes':_0x448c74[_0xc58d('0x20')],'include':_0x448c74['include']?_['map'](_0x448c74[_0xc58d('0x21')],function(_0x4796aa){return{'model':db[_0x4796aa[_0xc58d('0x22')]],'as':_0x4796aa['as'],'attributes':_0x4796aa[_0xc58d('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34f3fb){logger[_0xc58d('0x11')](_0xc58d('0x24'),_0x3d4585);logger[_0xc58d('0x14')](_0xc58d('0x24'),_0x3d4585,JSON[_0xc58d('0x16')](_0x34f3fb));_0x37380c(_0x34f3fb);})['catch'](function(_0x4c07fd){logger[_0xc58d('0x17')](_0xc58d('0x24'),_0x4c07fd['message'],_0x3d4585);_0x2a173e(_0x2285a9[_0xc58d('0x17')](0x1f4,_0x4c07fd[_0xc58d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index f845da5..37b2065 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 _0xea21=['emit','removeListener','register','smsAccount:','./smsAccount.events','save','remove','update'];(function(_0x274b40,_0x8006fd){var _0x498c4c=function(_0x5dede0){while(--_0x5dede0){_0x274b40['push'](_0x274b40['shift']());}};_0x498c4c(++_0x8006fd);}(_0xea21,0xf4));var _0x1ea2=function(_0x3f8f21,_0x28d395){_0x3f8f21=_0x3f8f21-0x0;var _0x5ded93=_0xea21[_0x3f8f21];return _0x5ded93;};'use strict';var SmsAccountEvents=require(_0x1ea2('0x0'));var events=[_0x1ea2('0x1'),_0x1ea2('0x2'),_0x1ea2('0x3')];function createListener(_0x129d3d,_0x1783be){return function(_0x48fa30){_0x1783be[_0x1ea2('0x4')](_0x129d3d,_0x48fa30);};}function removeListener(_0x4e9772,_0x47f2d2){return function(){SmsAccountEvents[_0x1ea2('0x5')](_0x4e9772,_0x47f2d2);};}exports[_0x1ea2('0x6')]=function(_0x167545){for(var _0x42c2f0=0x0,_0x12b3a6=events['length'];_0x42c2f0<_0x12b3a6;_0x42c2f0++){var _0x490f4b=events[_0x42c2f0];var _0x3c804f=createListener(_0x1ea2('0x7')+_0x490f4b,_0x167545);SmsAccountEvents['on'](_0x490f4b,_0x3c804f);}}; \ No newline at end of file +var _0x88f8=['register','smsAccount:','save','update','emit','removeListener'];(function(_0x237071,_0x47ea76){var _0x213e5d=function(_0x4d30b5){while(--_0x4d30b5){_0x237071['push'](_0x237071['shift']());}};_0x213e5d(++_0x47ea76);}(_0x88f8,0xd4));var _0x888f=function(_0x1e397c,_0x3dc914){_0x1e397c=_0x1e397c-0x0;var _0x32fe7c=_0x88f8[_0x1e397c];return _0x32fe7c;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0x888f('0x0'),'remove',_0x888f('0x1')];function createListener(_0x419455,_0x558009){return function(_0x3eae92){_0x558009[_0x888f('0x2')](_0x419455,_0x3eae92);};}function removeListener(_0x167318,_0xc670be){return function(){SmsAccountEvents[_0x888f('0x3')](_0x167318,_0xc670be);};}exports[_0x888f('0x4')]=function(_0x228a2f){for(var _0x25e7fe=0x0,_0x40f059=events['length'];_0x25e7fe<_0x40f059;_0x25e7fe++){var _0x3c4d5e=events[_0x25e7fe];var _0x3f8a10=createListener(_0x888f('0x5')+_0x3c4d5e,_0x228a2f);SmsAccountEvents['on'](_0x3c4d5e,_0x3f8a10);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 782fb96..1ce9c66 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 _0x4dc0=['isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get'];(function(_0xb6e43,_0x1568fc){var _0x47c40f=function(_0x107786){while(--_0x107786){_0xb6e43['push'](_0xb6e43['shift']());}};_0x47c40f(++_0x1568fc);}(_0x4dc0,0xe6));var _0x04dc=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x4dc0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x04dc('0x0'));var path=require(_0x04dc('0x1'));var timeout=require(_0x04dc('0x2'));var express=require(_0x04dc('0x3'));var router=express['Router']();var auth=require(_0x04dc('0x4'));var interaction=require(_0x04dc('0x5'));var config=require('../../config/environment');var controller=require(_0x04dc('0x6'));router[_0x04dc('0x7')]('/',auth[_0x04dc('0x8')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x04dc('0x9')]);router['post']('/',auth[_0x04dc('0x8')](),controller[_0x04dc('0xa')]);router[_0x04dc('0xb')](_0x04dc('0xc'),auth[_0x04dc('0x8')](),controller[_0x04dc('0xd')]);router[_0x04dc('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x04dc('0xf')]);module[_0x04dc('0x10')]=router; \ No newline at end of file +var _0xeeb4=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsApplication.controller','isAuthenticated','index','get','show','post','create','put','/:id','delete','destroy','exports'];(function(_0x34bb60,_0x4e4799){var _0x200cf5=function(_0x2bfe17){while(--_0x2bfe17){_0x34bb60['push'](_0x34bb60['shift']());}};_0x200cf5(++_0x4e4799);}(_0xeeb4,0xab));var _0x4eeb=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0xeeb4[_0x154940];return _0x401409;};'use strict';var multer=require(_0x4eeb('0x0'));var util=require('util');var path=require(_0x4eeb('0x1'));var timeout=require(_0x4eeb('0x2'));var express=require(_0x4eeb('0x3'));var router=express[_0x4eeb('0x4')]();var auth=require(_0x4eeb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4eeb('0x6'));var controller=require(_0x4eeb('0x7'));router['get']('/',auth[_0x4eeb('0x8')](),controller[_0x4eeb('0x9')]);router[_0x4eeb('0xa')]('/:id',auth[_0x4eeb('0x8')](),controller[_0x4eeb('0xb')]);router[_0x4eeb('0xc')]('/',auth[_0x4eeb('0x8')](),controller[_0x4eeb('0xd')]);router[_0x4eeb('0xe')](_0x4eeb('0xf'),auth[_0x4eeb('0x8')](),controller['update']);router[_0x4eeb('0x10')](_0x4eeb('0xf'),auth[_0x4eeb('0x8')](),controller[_0x4eeb('0x11')]);module[_0x4eeb('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 58a099d..ac9a757 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 _0x9a81=['exports','INTEGER','noop','STRING','*,*,*,*','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9a81,0xef));var _0x19a8=function(_0x2510f8,_0x4a7425){_0x2510f8=_0x2510f8-0x0;var _0x4dcc57=_0x9a81[_0x2510f8];return _0x4dcc57;};'use strict';var Sequelize=require(_0x19a8('0x0'));module[_0x19a8('0x1')]={'priority':{'type':Sequelize[_0x19a8('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x19a8('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x19a8('0x4')]},'interval':{'type':Sequelize[_0x19a8('0x4')],'defaultValue':_0x19a8('0x5')}}; \ No newline at end of file +var _0x7d1e=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x7d1e,0x86));var _0xe7d1=function(_0xe56a81,_0x211068){_0xe56a81=_0xe56a81-0x0;var _0xde5222=_0x7d1e[_0xe56a81];return _0xde5222;};'use strict';var Sequelize=require('sequelize');module[_0xe7d1('0x0')]={'priority':{'type':Sequelize[_0xe7d1('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe7d1('0x2')],'allowNull':![],'defaultValue':_0xe7d1('0x3')},'appdata':{'type':Sequelize[_0xe7d1('0x4')]()},'description':{'type':Sequelize[_0xe7d1('0x2')]},'interval':{'type':Sequelize[_0xe7d1('0x2')],'defaultValue':_0xe7d1('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 7cc43fe..fdc62a1 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 _0x1513=['status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','send','index','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','SmsApplication','rows','catch','show','params','include','options','find','create','body','destroy','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x20f234,_0xad0dea){var _0x57a88f=function(_0x27a42f){while(--_0x27a42f){_0x20f234['push'](_0x20f234['shift']());}};_0x57a88f(++_0xad0dea);}(_0x1513,0x1e8));var _0x3151=function(_0x1eddf5,_0x49a178){_0x1eddf5=_0x1eddf5-0x0;var _0x47ce11=_0x1513[_0x1eddf5];return _0x47ce11;};'use strict';var pdf=require(_0x3151('0x0'));var emlformat=require(_0x3151('0x1'));var rimraf=require(_0x3151('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3151('0x3'));var moment=require(_0x3151('0x4'));var BPromise=require(_0x3151('0x5'));var Mustache=require(_0x3151('0x6'));var util=require('util');var path=require(_0x3151('0x7'));var sox=require(_0x3151('0x8'));var csv=require(_0x3151('0x9'));var ejs=require(_0x3151('0xa'));var fs=require('fs');var _=require(_0x3151('0xb'));var squel=require(_0x3151('0xc'));var crypto=require(_0x3151('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3151('0xe'));var Redis=require(_0x3151('0xf'));var authService=require(_0x3151('0x10'));var qs=require(_0x3151('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3151('0x12'));var utils=require(_0x3151('0x13'));var config=require(_0x3151('0x14'));var db=require(_0x3151('0x15'))['db'];function respondWithStatusCode(_0x5072c7,_0x3dd554){_0x3dd554=_0x3dd554||0xcc;return function(_0x54f4fb){if(_0x54f4fb){return _0x5072c7[_0x3151('0x16')](_0x3dd554);}return _0x5072c7['status'](_0x3dd554)['end']();};}function respondWithResult(_0x53ed82,_0x57bbf9){_0x57bbf9=_0x57bbf9||0xc8;return function(_0x5ed314){if(_0x5ed314){return _0x53ed82[_0x3151('0x17')](_0x57bbf9)[_0x3151('0x18')](_0x5ed314);}};}function respondWithFilteredResult(_0x5b471b,_0x3a2a5d){return function(_0x3a07f7){if(_0x3a07f7){var _0x42afc1=_0x3a07f7[_0x3151('0x19')],_0x8f3384=_0x3a2a5d[_0x3151('0x1a')],_0x175bce=_0x3a2a5d['offset']+_0x3a2a5d[_0x3151('0x1b')],_0x313351;if(_0x175bce>=_0x42afc1){_0x175bce=_0x42afc1;_0x313351=0xc8;}else{_0x313351=0xce;}_0x5b471b[_0x3151('0x17')](_0x313351);return _0x5b471b[_0x3151('0x1c')](_0x3151('0x1d'),_0x8f3384+'-'+_0x175bce+'/'+_0x42afc1)[_0x3151('0x18')](_0x3a07f7);}return null;};}function patchUpdates(_0x1a9a92){return function(_0x5b2546){try{jsonpatch[_0x3151('0x1e')](_0x5b2546,_0x1a9a92,!![]);}catch(_0x4b7f5b){return BPromise[_0x3151('0x1f')](_0x4b7f5b);}return _0x5b2546[_0x3151('0x20')]();};}function saveUpdates(_0x5f0bb8,_0x38f5b1){return function(_0xf85b36){if(_0xf85b36){return _0xf85b36[_0x3151('0x21')](_0x5f0bb8)[_0x3151('0x22')](function(_0x2e4ac3){return _0x2e4ac3;});}return null;};}function removeEntity(_0x280cdc,_0x439d41){return function(_0x3902ad){if(_0x3902ad){return _0x3902ad['destroy']()[_0x3151('0x22')](function(){_0x280cdc[_0x3151('0x17')](0xcc)[_0x3151('0x23')]();});}};}function handleEntityNotFound(_0x556733,_0x45194e){return function(_0x46d3fb){if(!_0x46d3fb){_0x556733['sendStatus'](0x194);}return _0x46d3fb;};}function handleError(_0x5e9df1,_0x41e325){_0x41e325=_0x41e325||0x1f4;return function(_0xcfbb80){logger[_0x3151('0x24')](_0xcfbb80[_0x3151('0x25')]);if(_0xcfbb80['name']){delete _0xcfbb80['name'];}_0x5e9df1[_0x3151('0x17')](_0x41e325)[_0x3151('0x26')](_0xcfbb80);};}exports[_0x3151('0x27')]=function(_0x141da4,_0x5058cb){var _0x4ef6cd={},_0x3a4e03={},_0x5e92fa={'count':0x0,'rows':[]};var _0x2fdcb3=_['map'](db['SmsApplication'][_0x3151('0x28')],function(_0x4cd038){return{'name':_0x4cd038['fieldName'],'type':_0x4cd038[_0x3151('0x29')][_0x3151('0x2a')]};});_0x3a4e03[_0x3151('0x2b')]=_[_0x3151('0x2c')](_0x2fdcb3,_0x3151('0x2d'));_0x3a4e03[_0x3151('0x2e')]=_[_0x3151('0x2f')](_0x141da4[_0x3151('0x2e')]);_0x3a4e03[_0x3151('0x30')]=_[_0x3151('0x31')](_0x3a4e03[_0x3151('0x2b')],_0x3a4e03[_0x3151('0x2e')]);_0x4ef6cd['attributes']=_[_0x3151('0x31')](_0x3a4e03['model'],qs[_0x3151('0x32')](_0x141da4['query']['fields']));_0x4ef6cd[_0x3151('0x33')]=_0x4ef6cd[_0x3151('0x33')][_0x3151('0x34')]?_0x4ef6cd[_0x3151('0x33')]:_0x3a4e03[_0x3151('0x2b')];if(!_0x141da4['query'][_0x3151('0x35')](_0x3151('0x36'))){_0x4ef6cd[_0x3151('0x1b')]=qs['limit'](_0x141da4['query'][_0x3151('0x1b')]);_0x4ef6cd[_0x3151('0x1a')]=qs[_0x3151('0x1a')](_0x141da4[_0x3151('0x2e')][_0x3151('0x1a')]);}_0x4ef6cd[_0x3151('0x37')]=qs[_0x3151('0x38')](_0x141da4[_0x3151('0x2e')][_0x3151('0x38')]);_0x4ef6cd[_0x3151('0x39')]=qs[_0x3151('0x30')](_[_0x3151('0x3a')](_0x141da4[_0x3151('0x2e')],_0x3a4e03['filters']));if(_0x141da4[_0x3151('0x2e')][_0x3151('0x3b')]){_0x4ef6cd[_0x3151('0x39')]=_[_0x3151('0x3c')](_0x4ef6cd[_0x3151('0x39')],{'$or':_[_0x3151('0x2c')](_0x2fdcb3,function(_0x429027){if(_0x429027['type']!==_0x3151('0x3d')){var _0x404525={};_0x404525[_0x429027['name']]={'$like':'%'+_0x141da4[_0x3151('0x2e')][_0x3151('0x3b')]+'%'};return _0x404525;}})});}_0x4ef6cd=_[_0x3151('0x3c')]({},_0x4ef6cd,_0x141da4['options']);var _0x592a3f={'where':_0x4ef6cd[_0x3151('0x39')]};return db[_0x3151('0x3e')][_0x3151('0x19')](_0x592a3f)[_0x3151('0x22')](function(_0x265894){_0x5e92fa['count']=_0x265894;if(_0x141da4['query']['includeAll']){_0x4ef6cd['include']=[{'all':!![]}];}return db[_0x3151('0x3e')]['findAll'](_0x4ef6cd);})[_0x3151('0x22')](function(_0x5f0220){_0x5e92fa[_0x3151('0x3f')]=_0x5f0220;return _0x5e92fa;})[_0x3151('0x22')](respondWithFilteredResult(_0x5058cb,_0x4ef6cd))[_0x3151('0x40')](handleError(_0x5058cb,null));};exports[_0x3151('0x41')]=function(_0x2f1e05,_0x62deca){var _0x144c08={'raw':!![],'where':{'id':_0x2f1e05[_0x3151('0x42')]['id']}},_0x132d2a={};_0x132d2a[_0x3151('0x2b')]=_[_0x3151('0x2f')](db[_0x3151('0x3e')][_0x3151('0x28')]);_0x132d2a[_0x3151('0x2e')]=_[_0x3151('0x2f')](_0x2f1e05[_0x3151('0x2e')]);_0x132d2a['filters']=_[_0x3151('0x31')](_0x132d2a[_0x3151('0x2b')],_0x132d2a[_0x3151('0x2e')]);_0x144c08[_0x3151('0x33')]=_['intersection'](_0x132d2a[_0x3151('0x2b')],qs[_0x3151('0x32')](_0x2f1e05['query'][_0x3151('0x32')]));_0x144c08[_0x3151('0x33')]=_0x144c08['attributes'][_0x3151('0x34')]?_0x144c08[_0x3151('0x33')]:_0x132d2a[_0x3151('0x2b')];if(_0x2f1e05[_0x3151('0x2e')]['includeAll']){_0x144c08[_0x3151('0x43')]=[{'all':!![]}];}_0x144c08=_[_0x3151('0x3c')]({},_0x144c08,_0x2f1e05[_0x3151('0x44')]);return db['SmsApplication'][_0x3151('0x45')](_0x144c08)[_0x3151('0x22')](handleEntityNotFound(_0x62deca,null))['then'](respondWithResult(_0x62deca,null))[_0x3151('0x40')](handleError(_0x62deca,null));};exports[_0x3151('0x46')]=function(_0x360f03,_0x55dc37){return db[_0x3151('0x3e')][_0x3151('0x46')](_0x360f03[_0x3151('0x47')],{})['then'](respondWithResult(_0x55dc37,0xc9))[_0x3151('0x40')](handleError(_0x55dc37,null));};exports[_0x3151('0x21')]=function(_0x4b710b,_0x55fb5a){if(_0x4b710b[_0x3151('0x47')]['id']){delete _0x4b710b[_0x3151('0x47')]['id'];}return db[_0x3151('0x3e')][_0x3151('0x45')]({'where':{'id':_0x4b710b[_0x3151('0x42')]['id']}})[_0x3151('0x22')](handleEntityNotFound(_0x55fb5a,null))['then'](saveUpdates(_0x4b710b['body'],null))[_0x3151('0x22')](respondWithResult(_0x55fb5a,null))['catch'](handleError(_0x55fb5a,null));};exports[_0x3151('0x48')]=function(_0x492851,_0x2257a9){return db[_0x3151('0x3e')][_0x3151('0x45')]({'where':{'id':_0x492851[_0x3151('0x42')]['id']}})[_0x3151('0x22')](handleEntityNotFound(_0x2257a9,null))[_0x3151('0x22')](removeEntity(_0x2257a9,null))[_0x3151('0x40')](handleError(_0x2257a9,null));}; \ No newline at end of file +var _0x8396=['Content-Range','apply','reject','save','update','destroy','then','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','SmsApplication','includeAll','include','findAll','catch','show','params','create','body','find','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set'];(function(_0x1199bd,_0x4f77db){var _0x1371f0=function(_0x57dbfa){while(--_0x57dbfa){_0x1199bd['push'](_0x1199bd['shift']());}};_0x1371f0(++_0x4f77db);}(_0x8396,0xf6));var _0x6839=function(_0x3ca9e2,_0x2454fd){_0x3ca9e2=_0x3ca9e2-0x0;var _0x3e54c1=_0x8396[_0x3ca9e2];return _0x3e54c1;};'use strict';var pdf=require(_0x6839('0x0'));var emlformat=require(_0x6839('0x1'));var rimraf=require(_0x6839('0x2'));var zipdir=require(_0x6839('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6839('0x4'));var Mustache=require(_0x6839('0x5'));var util=require(_0x6839('0x6'));var path=require(_0x6839('0x7'));var sox=require('sox');var csv=require(_0x6839('0x8'));var ejs=require(_0x6839('0x9'));var fs=require('fs');var _=require(_0x6839('0xa'));var squel=require(_0x6839('0xb'));var crypto=require(_0x6839('0xc'));var jsforce=require(_0x6839('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6839('0x8'));var querystring=require('querystring');var Papa=require(_0x6839('0xe'));var Redis=require(_0x6839('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6839('0x10'));var as=require(_0x6839('0x11'));var hardwareService=require(_0x6839('0x12'));var logger=require(_0x6839('0x13'))(_0x6839('0x14'));var utils=require('../../config/utils');var config=require(_0x6839('0x15'));var db=require(_0x6839('0x16'))['db'];function respondWithStatusCode(_0x512e53,_0x5ac72a){_0x5ac72a=_0x5ac72a||0xcc;return function(_0x188de4){if(_0x188de4){return _0x512e53['sendStatus'](_0x5ac72a);}return _0x512e53[_0x6839('0x17')](_0x5ac72a)[_0x6839('0x18')]();};}function respondWithResult(_0x5b751e,_0x4218c9){_0x4218c9=_0x4218c9||0xc8;return function(_0x2b4a33){if(_0x2b4a33){return _0x5b751e[_0x6839('0x17')](_0x4218c9)[_0x6839('0x19')](_0x2b4a33);}};}function respondWithFilteredResult(_0x2fe99d,_0xf06afd){return function(_0x22cbbd){if(_0x22cbbd){var _0x1ed3af=_0x22cbbd[_0x6839('0x1a')],_0x1fdb01=_0xf06afd['offset'],_0x552e93=_0xf06afd[_0x6839('0x1b')]+_0xf06afd[_0x6839('0x1c')],_0x2d2797;if(_0x552e93>=_0x1ed3af){_0x552e93=_0x1ed3af;_0x2d2797=0xc8;}else{_0x2d2797=0xce;}_0x2fe99d['status'](_0x2d2797);return _0x2fe99d[_0x6839('0x1d')](_0x6839('0x1e'),_0x1fdb01+'-'+_0x552e93+'/'+_0x1ed3af)[_0x6839('0x19')](_0x22cbbd);}return null;};}function patchUpdates(_0x1435ec){return function(_0x117098){try{jsonpatch[_0x6839('0x1f')](_0x117098,_0x1435ec,!![]);}catch(_0x37079a){return BPromise[_0x6839('0x20')](_0x37079a);}return _0x117098[_0x6839('0x21')]();};}function saveUpdates(_0x2dd135,_0xf9bb45){return function(_0x46ac2a){if(_0x46ac2a){return _0x46ac2a[_0x6839('0x22')](_0x2dd135)['then'](function(_0x47fc6a){return _0x47fc6a;});}return null;};}function removeEntity(_0x4c204e,_0x13d2b8){return function(_0x17b3c8){if(_0x17b3c8){return _0x17b3c8[_0x6839('0x23')]()[_0x6839('0x24')](function(){_0x4c204e[_0x6839('0x17')](0xcc)[_0x6839('0x18')]();});}};}function handleEntityNotFound(_0x2d201f,_0x5c0bb7){return function(_0xab1b90){if(!_0xab1b90){_0x2d201f['sendStatus'](0x194);}return _0xab1b90;};}function handleError(_0x40d881,_0x160c6d){_0x160c6d=_0x160c6d||0x1f4;return function(_0x3ede31){logger['error'](_0x3ede31['stack']);if(_0x3ede31[_0x6839('0x25')]){delete _0x3ede31[_0x6839('0x25')];}_0x40d881[_0x6839('0x17')](_0x160c6d)['send'](_0x3ede31);};}exports[_0x6839('0x26')]=function(_0x4da159,_0x13b407){var _0x4ae1d4={},_0x1f0856={},_0x4604ab={'count':0x0,'rows':[]};var _0x348f0d=_[_0x6839('0x27')](db['SmsApplication'][_0x6839('0x28')],function(_0x4e1fe1){return{'name':_0x4e1fe1[_0x6839('0x29')],'type':_0x4e1fe1[_0x6839('0x2a')]['key']};});_0x1f0856[_0x6839('0x2b')]=_['map'](_0x348f0d,_0x6839('0x25'));_0x1f0856[_0x6839('0x2c')]=_[_0x6839('0x2d')](_0x4da159[_0x6839('0x2c')]);_0x1f0856[_0x6839('0x2e')]=_[_0x6839('0x2f')](_0x1f0856[_0x6839('0x2b')],_0x1f0856[_0x6839('0x2c')]);_0x4ae1d4[_0x6839('0x30')]=_[_0x6839('0x2f')](_0x1f0856[_0x6839('0x2b')],qs[_0x6839('0x31')](_0x4da159[_0x6839('0x2c')][_0x6839('0x31')]));_0x4ae1d4[_0x6839('0x30')]=_0x4ae1d4[_0x6839('0x30')][_0x6839('0x32')]?_0x4ae1d4[_0x6839('0x30')]:_0x1f0856['model'];if(!_0x4da159[_0x6839('0x2c')][_0x6839('0x33')](_0x6839('0x34'))){_0x4ae1d4[_0x6839('0x1c')]=qs[_0x6839('0x1c')](_0x4da159[_0x6839('0x2c')][_0x6839('0x1c')]);_0x4ae1d4[_0x6839('0x1b')]=qs[_0x6839('0x1b')](_0x4da159['query'][_0x6839('0x1b')]);}_0x4ae1d4[_0x6839('0x35')]=qs[_0x6839('0x36')](_0x4da159['query'][_0x6839('0x36')]);_0x4ae1d4[_0x6839('0x37')]=qs['filters'](_['pick'](_0x4da159[_0x6839('0x2c')],_0x1f0856[_0x6839('0x2e')]));if(_0x4da159['query'][_0x6839('0x38')]){_0x4ae1d4[_0x6839('0x37')]=_[_0x6839('0x39')](_0x4ae1d4[_0x6839('0x37')],{'$or':_['map'](_0x348f0d,function(_0x36821c){if(_0x36821c[_0x6839('0x2a')]!==_0x6839('0x3a')){var _0x389d8a={};_0x389d8a[_0x36821c['name']]={'$like':'%'+_0x4da159['query'][_0x6839('0x38')]+'%'};return _0x389d8a;}})});}_0x4ae1d4=_['merge']({},_0x4ae1d4,_0x4da159['options']);var _0x853c30={'where':_0x4ae1d4[_0x6839('0x37')]};return db[_0x6839('0x3b')][_0x6839('0x1a')](_0x853c30)[_0x6839('0x24')](function(_0x320684){_0x4604ab[_0x6839('0x1a')]=_0x320684;if(_0x4da159[_0x6839('0x2c')][_0x6839('0x3c')]){_0x4ae1d4[_0x6839('0x3d')]=[{'all':!![]}];}return db['SmsApplication'][_0x6839('0x3e')](_0x4ae1d4);})[_0x6839('0x24')](function(_0x13ee35){_0x4604ab['rows']=_0x13ee35;return _0x4604ab;})[_0x6839('0x24')](respondWithFilteredResult(_0x13b407,_0x4ae1d4))[_0x6839('0x3f')](handleError(_0x13b407,null));};exports[_0x6839('0x40')]=function(_0x44cbaa,_0x430838){var _0x1a6aef={'raw':!![],'where':{'id':_0x44cbaa[_0x6839('0x41')]['id']}},_0x3bdf3e={};_0x3bdf3e[_0x6839('0x2b')]=_[_0x6839('0x2d')](db['SmsApplication']['rawAttributes']);_0x3bdf3e[_0x6839('0x2c')]=_[_0x6839('0x2d')](_0x44cbaa[_0x6839('0x2c')]);_0x3bdf3e['filters']=_[_0x6839('0x2f')](_0x3bdf3e['model'],_0x3bdf3e[_0x6839('0x2c')]);_0x1a6aef[_0x6839('0x30')]=_[_0x6839('0x2f')](_0x3bdf3e[_0x6839('0x2b')],qs[_0x6839('0x31')](_0x44cbaa[_0x6839('0x2c')][_0x6839('0x31')]));_0x1a6aef['attributes']=_0x1a6aef[_0x6839('0x30')][_0x6839('0x32')]?_0x1a6aef[_0x6839('0x30')]:_0x3bdf3e['model'];if(_0x44cbaa['query'][_0x6839('0x3c')]){_0x1a6aef['include']=[{'all':!![]}];}_0x1a6aef=_['merge']({},_0x1a6aef,_0x44cbaa['options']);return db[_0x6839('0x3b')]['find'](_0x1a6aef)[_0x6839('0x24')](handleEntityNotFound(_0x430838,null))[_0x6839('0x24')](respondWithResult(_0x430838,null))['catch'](handleError(_0x430838,null));};exports[_0x6839('0x42')]=function(_0x19998d,_0x26e924){return db[_0x6839('0x3b')][_0x6839('0x42')](_0x19998d[_0x6839('0x43')],{})[_0x6839('0x24')](respondWithResult(_0x26e924,0xc9))[_0x6839('0x3f')](handleError(_0x26e924,null));};exports[_0x6839('0x22')]=function(_0x1c4593,_0x308e85){if(_0x1c4593[_0x6839('0x43')]['id']){delete _0x1c4593[_0x6839('0x43')]['id'];}return db[_0x6839('0x3b')]['find']({'where':{'id':_0x1c4593['params']['id']}})[_0x6839('0x24')](handleEntityNotFound(_0x308e85,null))['then'](saveUpdates(_0x1c4593['body'],null))['then'](respondWithResult(_0x308e85,null))[_0x6839('0x3f')](handleError(_0x308e85,null));};exports[_0x6839('0x23')]=function(_0x389419,_0x25264f){return db[_0x6839('0x3b')][_0x6839('0x44')]({'where':{'id':_0x389419[_0x6839('0x41')]['id']}})['then'](handleEntityNotFound(_0x25264f,null))[_0x6839('0x24')](removeEntity(_0x25264f,null))[_0x6839('0x3f')](handleError(_0x25264f,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 2d6eb27..26291d8 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 _0x37f2=['SmsApplication','sms_applications','utf8mb4','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsApplication.attributes','exports'];(function(_0x44b536,_0x2681dc){var _0x4377a5=function(_0xb3b6f){while(--_0xb3b6f){_0x44b536['push'](_0x44b536['shift']());}};_0x4377a5(++_0x2681dc);}(_0x37f2,0xab));var _0x237f=function(_0x374cb5,_0x40f6c7){_0x374cb5=_0x374cb5-0x0;var _0x1531d6=_0x37f2[_0x374cb5];return _0x1531d6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x237f('0x0'))(_0x237f('0x1'));var moment=require(_0x237f('0x2'));var BPromise=require(_0x237f('0x3'));var rp=require(_0x237f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x237f('0x5'));var config=require(_0x237f('0x6'));var attributes=require(_0x237f('0x7'));module[_0x237f('0x8')]=function(_0x43775b,_0x4aca29){return _0x43775b['define'](_0x237f('0x9'),attributes,{'tableName':_0x237f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x237f('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9898=['../../config/environment','exports','SmsApplication','sms_applications','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x59627f,_0x4ad388){var _0x17a984=function(_0x55b85b){while(--_0x55b85b){_0x59627f['push'](_0x59627f['shift']());}};_0x17a984(++_0x4ad388);}(_0x9898,0x15a));var _0x8989=function(_0x1fc84d,_0x3f469d){_0x1fc84d=_0x1fc84d-0x0;var _0x2658fa=_0x9898[_0x1fc84d];return _0x2658fa;};'use strict';var _=require(_0x8989('0x0'));var util=require('util');var logger=require(_0x8989('0x1'))(_0x8989('0x2'));var moment=require(_0x8989('0x3'));var BPromise=require(_0x8989('0x4'));var rp=require(_0x8989('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8989('0x6'));var attributes=require('./smsApplication.attributes');module[_0x8989('0x7')]=function(_0x1f88e2,_0x1f6269){return _0x1f88e2['define'](_0x8989('0x8'),attributes,{'tableName':_0x8989('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8989('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 0729db7..1b71af8 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 _0x9b2a=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0x9b2a,0x127));var _0xa9b2=function(_0x1f4ec0,_0x5daf53){_0x1f4ec0=_0x1f4ec0-0x0;var _0x2156bb=_0x9b2a[_0x1f4ec0];return _0x2156bb;};'use strict';var _=require(_0xa9b2('0x0'));var util=require('util');var moment=require(_0xa9b2('0x1'));var BPromise=require(_0xa9b2('0x2'));var rs=require(_0xa9b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9b2('0x4'))['db'];var utils=require(_0xa9b2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa9b2('0x6'));var jayson=require(_0xa9b2('0x7'));var client=jayson[_0xa9b2('0x8')][_0xa9b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x558267,_0x29afe0,_0xce1b20){return new BPromise(function(_0x2d2560,_0x597c97){return client[_0xa9b2('0xa')](_0x558267,_0xce1b20)[_0xa9b2('0xb')](function(_0x146ebd){logger[_0xa9b2('0xc')](_0xa9b2('0xd'),_0x29afe0,_0xa9b2('0xe'));logger['debug'](_0xa9b2('0xf'),_0x29afe0,'request\x20sent',JSON['stringify'](_0x146ebd));if(_0x146ebd['error']){if(_0x146ebd[_0xa9b2('0x10')][_0xa9b2('0x11')]===0x1f4){logger[_0xa9b2('0x10')]('SmsApplication,\x20%s,\x20%s',_0x29afe0,_0x146ebd['error'][_0xa9b2('0x12')]);return _0x597c97(_0x146ebd['error'][_0xa9b2('0x12')]);}logger[_0xa9b2('0x10')](_0xa9b2('0xd'),_0x29afe0,_0x146ebd['error'][_0xa9b2('0x12')]);return _0x2d2560(_0x146ebd['error']['message']);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x29afe0,_0xa9b2('0xe'));_0x2d2560(_0x146ebd[_0xa9b2('0x13')]['message']);}})[_0xa9b2('0x14')](function(_0x57c82c){logger[_0xa9b2('0x10')](_0xa9b2('0xd'),_0x29afe0,_0x57c82c);_0x597c97(_0x57c82c);});});} \ No newline at end of file +var _0x1782=['http','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsApplication,\x20%s,\x20%s','result','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x519abb,_0x4d3f5b){var _0x48d4d6=function(_0x5bc0cf){while(--_0x5bc0cf){_0x519abb['push'](_0x519abb['shift']());}};_0x48d4d6(++_0x4d3f5b);}(_0x1782,0x188));var _0x2178=function(_0xc7959a,_0x3d551f){_0xc7959a=_0xc7959a-0x0;var _0x557040=_0x1782[_0xc7959a];return _0x557040;};'use strict';var _=require('lodash');var util=require(_0x2178('0x0'));var moment=require(_0x2178('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2178('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2178('0x3'));var logger=require(_0x2178('0x4'))('rpc');var config=require(_0x2178('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2178('0x6')][_0x2178('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x374bf8,_0x58aa47,_0x483397){return new BPromise(function(_0x35c8a8,_0x249977){return client[_0x2178('0x8')](_0x374bf8,_0x483397)[_0x2178('0x9')](function(_0x15ba49){logger[_0x2178('0xa')]('SmsApplication,\x20%s,\x20%s',_0x58aa47,_0x2178('0xb'));logger[_0x2178('0xc')](_0x2178('0xd'),_0x58aa47,'request\x20sent',JSON[_0x2178('0xe')](_0x15ba49));if(_0x15ba49[_0x2178('0xf')]){if(_0x15ba49[_0x2178('0xf')]['code']===0x1f4){logger[_0x2178('0xf')]('SmsApplication,\x20%s,\x20%s',_0x58aa47,_0x15ba49[_0x2178('0xf')][_0x2178('0x10')]);return _0x249977(_0x15ba49[_0x2178('0xf')][_0x2178('0x10')]);}logger[_0x2178('0xf')](_0x2178('0x11'),_0x58aa47,_0x15ba49[_0x2178('0xf')]['message']);return _0x35c8a8(_0x15ba49[_0x2178('0xf')][_0x2178('0x10')]);}else{logger[_0x2178('0xa')](_0x2178('0x11'),_0x58aa47,_0x2178('0xb'));_0x35c8a8(_0x15ba49[_0x2178('0x12')][_0x2178('0x10')]);}})['catch'](function(_0xc75c80){logger['error']('SmsApplication,\x20%s,\x20%s',_0x58aa47,_0xc75c80);_0x249977(_0xc75c80);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 13867ab..5c3a7c6 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 _0x53e6=['index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','sms','smsinteraction:addtags','addTags','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','get','isAuthenticated'];(function(_0x251e8c,_0x277c33){var _0x1e0c1d=function(_0x20b89c){while(--_0x20b89c){_0x251e8c['push'](_0x251e8c['shift']());}};_0x1e0c1d(++_0x277c33);}(_0x53e6,0x178));var _0x653e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x53e6[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x653e('0x0'));var util=require(_0x653e('0x1'));var path=require(_0x653e('0x2'));var timeout=require(_0x653e('0x3'));var express=require(_0x653e('0x4'));var router=express['Router']();var auth=require(_0x653e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsInteraction.controller');router[_0x653e('0x6')]('/',auth[_0x653e('0x7')](),controller[_0x653e('0x8')]);router[_0x653e('0x6')](_0x653e('0x9'),auth['isAuthenticated'](),controller[_0x653e('0xa')]);router[_0x653e('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x653e('0xb')]);router[_0x653e('0x6')](_0x653e('0xc'),auth[_0x653e('0x7')](),controller[_0x653e('0xd')]);router[_0x653e('0x6')](_0x653e('0xe'),auth['isAuthenticated'](),controller[_0x653e('0xf')]);router[_0x653e('0x10')]('/',auth[_0x653e('0x7')](),controller[_0x653e('0x11')]);router[_0x653e('0x10')](_0x653e('0xc'),auth['isAuthenticated'](),controller[_0x653e('0x12')]);router[_0x653e('0x10')]('/:id/tags',auth[_0x653e('0x7')](),interaction[_0x653e('0x13')](_0x653e('0x14'),_0x653e('0x15')),controller[_0x653e('0x16')]);router['put'](_0x653e('0x17'),auth[_0x653e('0x7')](),interaction['tracked']('sms',_0x653e('0x18')),controller[_0x653e('0x19')]);router[_0x653e('0x1a')](_0x653e('0x17'),auth[_0x653e('0x7')](),interaction[_0x653e('0x13')]('sms',_0x653e('0x1b')),controller[_0x653e('0x1c')]);router[_0x653e('0x1a')](_0x653e('0x1d'),auth[_0x653e('0x7')](),controller[_0x653e('0x1e')]);module[_0x653e('0x1f')]=router; \ No newline at end of file +var _0x3c85=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','download','post','create','addMessage','tracked','smsinteraction:addtags','addTags','put','/:id','sms','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout'];(function(_0x9b5bb2,_0x5db315){var _0x2e1e92=function(_0x5621c9){while(--_0x5621c9){_0x9b5bb2['push'](_0x9b5bb2['shift']());}};_0x2e1e92(++_0x5db315);}(_0x3c85,0x1a0));var _0x53c8=function(_0x4c9c40,_0x5b8812){_0x4c9c40=_0x4c9c40-0x0;var _0x4c1519=_0x3c85[_0x4c9c40];return _0x4c1519;};'use strict';var multer=require(_0x53c8('0x0'));var util=require(_0x53c8('0x1'));var path=require(_0x53c8('0x2'));var timeout=require(_0x53c8('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x53c8('0x4'));var interaction=require(_0x53c8('0x5'));var config=require(_0x53c8('0x6'));var controller=require('./smsInteraction.controller');router[_0x53c8('0x7')]('/',auth[_0x53c8('0x8')](),controller[_0x53c8('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x53c8('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x53c8('0xa')]);router[_0x53c8('0x7')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x53c8('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x53c8('0xb')]);router[_0x53c8('0xc')]('/',auth[_0x53c8('0x8')](),controller[_0x53c8('0xd')]);router[_0x53c8('0xc')]('/:id/messages',auth[_0x53c8('0x8')](),controller[_0x53c8('0xe')]);router[_0x53c8('0xc')]('/:id/tags',auth[_0x53c8('0x8')](),interaction[_0x53c8('0xf')]('sms',_0x53c8('0x10')),controller[_0x53c8('0x11')]);router[_0x53c8('0x12')](_0x53c8('0x13'),auth[_0x53c8('0x8')](),interaction[_0x53c8('0xf')](_0x53c8('0x14'),_0x53c8('0x15')),controller[_0x53c8('0x16')]);router[_0x53c8('0x17')](_0x53c8('0x13'),auth[_0x53c8('0x8')](),interaction[_0x53c8('0xf')](_0x53c8('0x14'),_0x53c8('0x18')),controller[_0x53c8('0x19')]);router['delete']('/:id/tags',auth[_0x53c8('0x8')](),controller[_0x53c8('0x1a')]);module[_0x53c8('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 449d31a..a13a6c0 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 _0xbaf0=['DATE','STRING','ENUM','out','moment','exports','BOOLEAN'];(function(_0x36b4d0,_0x4ad2bc){var _0x1d3fe8=function(_0x16e2d8){while(--_0x16e2d8){_0x36b4d0['push'](_0x36b4d0['shift']());}};_0x1d3fe8(++_0x4ad2bc);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'closed':{'type':Sequelize[_0x0baf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0baf('0x3')]},'disposition':{'type':Sequelize[_0x0baf('0x4')]},'note':{'type':Sequelize[_0x0baf('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0baf('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0baf('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb10b=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x4899bf,_0x3c66a8){var _0x581b68=function(_0xfa7d69){while(--_0xfa7d69){_0x4899bf['push'](_0x4899bf['shift']());}};_0x581b68(++_0x3c66a8);}(_0xb10b,0x12a));var _0xbb10=function(_0x21d0d7,_0x4c55a3){_0x21d0d7=_0x21d0d7-0x0;var _0x5e725b=_0xb10b[_0x21d0d7];return _0x5e725b;};'use strict';var Sequelize=require(_0xbb10('0x0'));var moment=require('moment');module[_0xbb10('0x1')]={'closed':{'type':Sequelize[_0xbb10('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbb10('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbb10('0x4')]},'phone':{'type':Sequelize[_0xbb10('0x4')]},'read1stAt':{'type':Sequelize[_0xbb10('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbb10('0x5')]('in',_0xbb10('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbb10('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbb10('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 60ad0b6..8a6d7e1 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 _0xdb28=['CmContact','firstName','lastName','secret','Account','Owner','get','mkdirSync','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','YYYY-MM-DD','N.A.','closed','closedAt','disposition','Messages','direction','out','System','renderFile','views','downloadInteraction.html','toFile','transcript-','log','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./smsInteraction.socket','register','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','Users','map','fullname','Tags','split','forEach','TagIds','catch','index','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','select','field','color','tools_tags','ui.SmsInteractionId','from','users','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','\x27\x27\x27\x27','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','SmsInteraction','a.key','Account.key','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','push','all','rows','includeAll','include','create','params','destroy','addMessage','SmsMessage','ids','omit','getMessages','SmsInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','options','addTags','spread','findAll','emit','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip'];(function(_0x188084,_0x409c86){var _0x3591cf=function(_0x43e292){while(--_0x43e292){_0x188084['push'](_0x188084['shift']());}};_0x3591cf(++_0x409c86);}(_0xdb28,0x106));var _0x8db2=function(_0x475053,_0x3ee6b8){_0x475053=_0x475053-0x0;var _0x3c2dca=_0xdb28[_0x475053];return _0x3c2dca;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var db=require(_0x8db2('0x17'))['db'];config[_0x8db2('0x18')]=_[_0x8db2('0x19')](config[_0x8db2('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8db2('0x18')]));require(_0x8db2('0x1a'))[_0x8db2('0x1b')](socket);function respondWithStatusCode(_0x1d6a15,_0x227355){_0x227355=_0x227355||0xcc;return function(_0xfa285b){if(_0xfa285b){return _0x1d6a15[_0x8db2('0x1c')](_0x227355);}return _0x1d6a15[_0x8db2('0x1d')](_0x227355)[_0x8db2('0x1e')]();};}function respondWithResult(_0x16c8c2,_0x5489a9){_0x5489a9=_0x5489a9||0xc8;return function(_0x13b0f5){if(_0x13b0f5){return _0x16c8c2[_0x8db2('0x1d')](_0x5489a9)['json'](_0x13b0f5);}};}function respondWithFilteredResult(_0x2b3f73,_0x44957d){return function(_0x21db8c){if(_0x21db8c){var _0x3fddc2=_0x21db8c['count'],_0x2efd06=_0x44957d[_0x8db2('0x1f')],_0x46ce14=_0x44957d[_0x8db2('0x1f')]+_0x44957d[_0x8db2('0x20')],_0x51d60d;if(_0x46ce14>=_0x3fddc2){_0x46ce14=_0x3fddc2;_0x51d60d=0xc8;}else{_0x51d60d=0xce;}_0x2b3f73[_0x8db2('0x1d')](_0x51d60d);return _0x2b3f73['set'](_0x8db2('0x21'),_0x2efd06+'-'+_0x46ce14+'/'+_0x3fddc2)[_0x8db2('0x22')](_0x21db8c);}return null;};}function patchUpdates(_0x260940){return function(_0x297ba3){try{jsonpatch[_0x8db2('0x23')](_0x297ba3,_0x260940,!![]);}catch(_0x597260){return BPromise[_0x8db2('0x24')](_0x597260);}return _0x297ba3[_0x8db2('0x25')]();};}function saveUpdates(_0x18f69c,_0x125be2){return function(_0x2260d8){if(_0x2260d8){return _0x2260d8[_0x8db2('0x26')](_0x18f69c)[_0x8db2('0x27')](function(_0x5c6614){return _0x5c6614;});}return null;};}function removeEntity(_0x256202,_0x4f6516){return function(_0x5725f0){if(_0x5725f0){return _0x5725f0['destroy']()['then'](function(){_0x256202[_0x8db2('0x1d')](0xcc)[_0x8db2('0x1e')]();});}};}function handleEntityNotFound(_0x3be281,_0x2baed0){return function(_0x145328){if(!_0x145328){_0x3be281[_0x8db2('0x1c')](0x194);}return _0x145328;};}function handleError(_0x58cd9d,_0x3544ba){_0x3544ba=_0x3544ba||0x1f4;return function(_0x372311){logger[_0x8db2('0x28')](_0x372311[_0x8db2('0x29')]);if(_0x372311['name']){delete _0x372311[_0x8db2('0x2a')];}_0x58cd9d[_0x8db2('0x1d')](_0x3544ba)[_0x8db2('0x2b')](_0x372311);};}function getInteractionUsers(_0x1687ed,_0xbe5ece){return new BPromise(function(_0x21bae5,_0xa54ea3){try{if(_0xbe5ece[_0x1687ed['id']]){_0x1687ed[_0x8db2('0x2c')]=_[_0x8db2('0x2d')](_0xbe5ece[_0x1687ed['id']],function(_0x493cab){return{'id':_0x493cab['id'],'fullname':_0x493cab[_0x8db2('0x2e')]};});}}catch(_0x50b28d){_0xa54ea3(_0x50b28d);}_0x21bae5(_0x1687ed);});}function getInteractionTags(_0x59cb77,_0x302188){return new BPromise(function(_0x25ed2c,_0xcc8a66){try{if(_0x59cb77['TagIds']){_0x59cb77[_0x8db2('0x2f')]=[];_0x59cb77['TagIds'][_0x8db2('0x30')](',')[_0x8db2('0x31')](function(_0x14bd12){_0x59cb77['Tags']['push'](_0x302188[_0x14bd12]);});}delete _0x59cb77[_0x8db2('0x32')];}catch(_0x1a460b){_0xcc8a66(_0x1a460b);}_0x25ed2c(_0x59cb77);});}function updateSmsInteraction(_0x4df530,_0x516dcb,_0x173989){return new BPromise(function(_0x5178f3,_0xc884a){return getInteractionUsers(_0x4df530,_0x173989)[_0x8db2('0x27')](function(_0x17ad44){return getInteractionTags(_0x17ad44,_0x516dcb);})[_0x8db2('0x27')](function(_0x101711){_0x5178f3(_0x101711);})[_0x8db2('0x33')](function(_0x46e0c8){_0xc884a(_0x46e0c8);});});}exports[_0x8db2('0x34')]=function(_0x502a02,_0x1ab5eb){var _0x304a72={},_0x5d2a5b={},_0x41594c={'count':0x0,'rows':[]};var _0x3ca80b=_['map'](db['SmsInteraction'][_0x8db2('0x35')],function(_0x4a45dd){return{'name':_0x4a45dd[_0x8db2('0x36')],'type':_0x4a45dd[_0x8db2('0x37')][_0x8db2('0x38')]};});_0x5d2a5b[_0x8db2('0x39')]=_['map'](_0x3ca80b,_0x8db2('0x2a'));_0x5d2a5b['query']=_[_0x8db2('0x3a')](_0x502a02[_0x8db2('0x3b')]);_0x5d2a5b[_0x8db2('0x3c')]=_[_0x8db2('0x3d')](_0x5d2a5b['model'],_0x5d2a5b['query']);_0x304a72[_0x8db2('0x3e')]=_[_0x8db2('0x3d')](_0x5d2a5b['model'],qs[_0x8db2('0x3f')](_0x502a02[_0x8db2('0x3b')][_0x8db2('0x3f')]));_0x304a72['attributes']=_0x304a72[_0x8db2('0x3e')][_0x8db2('0x40')]?_0x304a72[_0x8db2('0x3e')]:_0x5d2a5b[_0x8db2('0x39')];if(!_0x502a02[_0x8db2('0x3b')][_0x8db2('0x41')](_0x8db2('0x42'))){_0x304a72[_0x8db2('0x20')]=qs[_0x8db2('0x20')](_0x502a02[_0x8db2('0x3b')][_0x8db2('0x20')]);_0x304a72[_0x8db2('0x1f')]=qs[_0x8db2('0x1f')](_0x502a02['query'][_0x8db2('0x1f')]);}_0x304a72[_0x8db2('0x43')]=qs['sort'](_0x502a02['query'][_0x8db2('0x44')]);_0x304a72['where']=qs[_0x8db2('0x3c')](_[_0x8db2('0x45')](_0x502a02[_0x8db2('0x3b')],_0x5d2a5b[_0x8db2('0x3c')]));var _0xb4fe2c=[];var _0x30d606=squel[_0x8db2('0x46')]()['field']('id')[_0x8db2('0x47')](_0x8db2('0x2a'))[_0x8db2('0x47')](_0x8db2('0x48'))['from'](_0x8db2('0x49'));var _0x1f4a82=squel[_0x8db2('0x46')]()[_0x8db2('0x47')]('u.id')[_0x8db2('0x47')]('u.fullname')[_0x8db2('0x47')](_0x8db2('0x4a'))[_0x8db2('0x4b')]('user_has_sms_interactions','ui')['left_join'](_0x8db2('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x173cc7=squel[_0x8db2('0x46')]()[_0x8db2('0x4b')](_0x8db2('0x4d'),'i')[_0x8db2('0x4e')](_0x8db2('0x4f'),'c',_0x8db2('0x50'))[_0x8db2('0x4e')](_0x8db2('0x4c'),'o',_0x8db2('0x51'))[_0x8db2('0x4e')](_0x8db2('0x52'),'a','a.id\x20=\x20i.SmsAccountId')[_0x8db2('0x4e')](_0x8db2('0x53'),'me',_0x8db2('0x54'))[_0x8db2('0x4e')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')[_0x8db2('0x4e')](_0x8db2('0x49'),'t',_0x8db2('0x55'));var _0x4c66e5=squel['expr']();var _0x494d6e=[];var _0x44ac56=squel[_0x8db2('0x56')]();var _0x55c7dd;if(_0x502a02[_0x8db2('0x3b')][_0x8db2('0x57')]){_0x55c7dd=as[_0x8db2('0x58')](_0x502a02[_0x8db2('0x3b')]['search']);var _0x5329e6=_0x55c7dd[_0x8db2('0x59')];for(var _0x18c6ef=0x0;_0x18c6ef<_0x55c7dd[_0x8db2('0x5a')][_0x8db2('0x40')];_0x18c6ef++){var _0x3daed6=_0x55c7dd[_0x8db2('0x5a')][_0x18c6ef];var _0x1f0f7c='i';var _0x3ca2a7=_[_0x8db2('0x5b')](_0x3ca80b,[_0x8db2('0x2a'),_0x3daed6[_0x8db2('0x47')]]);if(!_0x3ca2a7){switch(_0x3daed6[_0x8db2('0x47')]){case _0x8db2('0x5c'):if(_0x3daed6[_0x8db2('0x5d')]==0x1){_0x173cc7[_0x8db2('0x5e')]('`'+_0x3daed6['field']+_0x8db2('0x5f'));}else{_0x173cc7[_0x8db2('0x5e')]('`'+_0x3daed6['field']+_0x8db2('0x60'));}break;case _0x8db2('0x61'):if(_0x3daed6[_0x8db2('0x62')]==='$substring'){if(_0x3daed6[_0x8db2('0x5d')][_0x8db2('0x30')]('\x20')[_0x8db2('0x40')]>0x1){_0x4c66e5[_0x5329e6](_0x8db2('0x63'),qs[_0x8db2('0x64')](_0x3daed6['value']),null);}else{var _0x467505='%'+_0x3daed6[_0x8db2('0x5d')]+'%';_0x4c66e5[_0x5329e6](_0x8db2('0x65'),_0x467505,_0x467505,_0x467505);}}else{_0x3ca2a7=_['find'](_0x3ca80b,[_0x8db2('0x2a'),_0x8db2('0x66')]);_0x3daed6[_0x8db2('0x47')]=_0x8db2('0x66');_0x24cfe9=as[_0x8db2('0x67')](_0x1f0f7c,_0x3ca2a7[_0x8db2('0x37')],_0x3daed6);_0x4c66e5[_0x5329e6](_0x24cfe9[_0x8db2('0x68')],_0x24cfe9['value'][_0x8db2('0x69')],_0x24cfe9[_0x8db2('0x5d')]['end']);}break;case _0x8db2('0x6a'):var _0x1683b8=_0x3daed6['value'][_0x8db2('0x30')](',')[_0x8db2('0x2d')](function(_0x63e8f7){return Number(_0x63e8f7);});_0x1683b8[_0x8db2('0x31')](function(_0x42b941){_0x44ac56['or'](_0x8db2('0x6b'),'%,'+_0x42b941+',%');});_0x494d6e=_[_0x8db2('0x6c')](_0x494d6e,_0x1683b8);break;case _0x8db2('0x6d'):if(_0x3daed6[_0x8db2('0x62')]===_0x8db2('0x6e')){_0x4c66e5[_0x5329e6](_0x8db2('0x6f'),'%'+_0x3daed6[_0x8db2('0x5d')]+'%',null);}else{_0x3ca2a7=_[_0x8db2('0x5b')](_0x3ca80b,[_0x8db2('0x2a'),_0x8db2('0x70')]);_0x3daed6[_0x8db2('0x47')]='UserId';_0x24cfe9=as[_0x8db2('0x67')](_0x1f0f7c,_0x3ca2a7[_0x8db2('0x37')],_0x3daed6);_0x4c66e5[_0x5329e6](_0x24cfe9[_0x8db2('0x68')],_0x24cfe9[_0x8db2('0x5d')][_0x8db2('0x69')],_0x24cfe9['value'][_0x8db2('0x1e')]);}break;case _0x8db2('0x71'):_0x24cfe9=as[_0x8db2('0x67')]('me',null,_0x3daed6);_0x4c66e5[_0x5329e6](_0x24cfe9[_0x8db2('0x68')],_0x24cfe9[_0x8db2('0x5d')][_0x8db2('0x69')],_0x24cfe9[_0x8db2('0x5d')][_0x8db2('0x1e')]);break;}}else{var _0x24cfe9=as[_0x8db2('0x67')](_0x1f0f7c,_0x3ca2a7[_0x8db2('0x37')],_0x3daed6);_0x4c66e5[_0x5329e6](_0x24cfe9[_0x8db2('0x68')],_0x24cfe9[_0x8db2('0x5d')][_0x8db2('0x69')],_0x24cfe9[_0x8db2('0x5d')][_0x8db2('0x1e')]);}}}else{var _0x1d7862=_(_0x502a02[_0x8db2('0x3b')])['keys']()[_0x8db2('0x2d')](function(_0x536ac1){return _[_0x8db2('0x72')](_0x3ca80b,['name',_0x536ac1])?_0x536ac1:undefined;})[_0x8db2('0x73')]()[_0x8db2('0x5d')]();if(!_[_0x8db2('0x74')](_0x1d7862)){_0x1d7862[_0x8db2('0x31')](function(_0x1e812e){if(_0x1e812e==='SmsAccountId'){_0x173cc7['where'](_0x8db2('0x75'),[][_0x8db2('0x76')](_0x502a02[_0x8db2('0x3b')][_0x1e812e]));}else if(_0x1e812e===_0x8db2('0x77')){var _0x20b49c=JSON[_0x8db2('0x78')](_0x502a02[_0x8db2('0x3b')][_0x1e812e])[_0x8db2('0x79')];var _0x504039=JSON[_0x8db2('0x78')](_0x502a02[_0x8db2('0x3b')][_0x1e812e])[_0x8db2('0x7a')];_0x173cc7[_0x8db2('0x7b')](_0x8db2('0x7c'),_0x20b49c,_0x504039);}else{if(_0x502a02[_0x8db2('0x3b')][_0x1e812e]===_0x8db2('0x7d')){_0x173cc7[_0x8db2('0x7b')]('i.'+_0x1e812e+'\x20IS\x20NULL');}else{_0x173cc7['where']('i.'+_0x1e812e+_0x8db2('0x7e'),_0x502a02[_0x8db2('0x3b')][_0x1e812e]);}}});}if(_0x502a02[_0x8db2('0x3b')][_0x8db2('0x7f')]){if(_0x502a02[_0x8db2('0x3b')]['read']==0x1){_0x173cc7['having'](_0x8db2('0x80'));}else{_0x173cc7[_0x8db2('0x5e')]('`unreadMessages`\x20>\x200');}}if(_0x502a02[_0x8db2('0x3b')][_0x8db2('0x81')]){_0x494d6e=_[_0x8db2('0x82')](_0x502a02['query'][_0x8db2('0x81')])?_0x502a02[_0x8db2('0x3b')][_0x8db2('0x81')]:new Array(_0x502a02['query'][_0x8db2('0x81')]);_0x494d6e[_0x8db2('0x31')](function(_0x2a520b){_0x44ac56['or'](_0x8db2('0x6b'),'%,'+_0x2a520b+',%');});}if(_0x502a02[_0x8db2('0x3b')]['filter']){var _0x3c9af4=_0x502a02[_0x8db2('0x3b')][_0x8db2('0x83')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x8db2('0x84'));if(qs[_0x8db2('0x85')](_0x3c9af4)){_0x4c66e5['or']('i.id\x20LIKE\x20?',_0x3c9af4+'%')['or'](_0x8db2('0x86'),_0x3c9af4+'%');}else{_0x4c66e5['or'](_0x8db2('0x87'),qs[_0x8db2('0x64')](_0x3c9af4))['or'](_0x8db2('0x88'),_0x3c9af4+'%');}}}_0x173cc7[_0x8db2('0x7b')](_0x4c66e5);_0x173cc7[_0x8db2('0x89')](_0x8db2('0x8a'));var _0x3349f1={'type':db[_0x8db2('0x8b')][_0x8db2('0x8c')][_0x8db2('0x8d')],'raw':!![]};var _0x3e1478=_0x173cc7[_0x8db2('0x8e')]();_0x3e1478['field'](_0x8db2('0x8a'));_0x3e1478['field'](_0x8db2('0x8f'),_0x8db2('0x5c'));if(_0x304a72['order']){_0x304a72[_0x8db2('0x43')][_0x8db2('0x31')](function(_0x5cdf53){_0x173cc7[_0x8db2('0x43')]('i.'+_0x5cdf53[0x0],_0x5cdf53[0x1]===_0x8db2('0x90')?![]:!![]);});}if(!_[_0x8db2('0x74')](_0x494d6e)){_0x173cc7[_0x8db2('0x5e')](_0x44ac56);_0x3e1478[_0x8db2('0x7b')](_0x8db2('0x91'),_0x494d6e);}BPromise[_0x8db2('0x92')]()[_0x8db2('0x27')](function(){if(!_0x55c7dd){if(_0x502a02[_0x8db2('0x3b')]['SmsAccountId']||_0x502a02['query'][_0x8db2('0x93')])return;_0x3e1478['where'](_0x8db2('0x94'));_0x173cc7[_0x8db2('0x7b')](_0x8db2('0x94'));return;}return _0x502a02['user'][_0x8db2('0x95')]({'attributes':['id'],'raw':!![]})[_0x8db2('0x27')](function(_0x3e37e7){if(_['isEmpty'](_0x3e37e7)){_0x3e1478[_0x8db2('0x7b')](_0x8db2('0x96'));_0x173cc7[_0x8db2('0x7b')](_0x8db2('0x96'));}else{_0x3e1478['where'](_0x8db2('0x75'),_[_0x8db2('0x2d')](_0x3e37e7,'id'));_0x173cc7[_0x8db2('0x7b')](_0x8db2('0x75'),_[_0x8db2('0x2d')](_0x3e37e7,'id'));}});})[_0x8db2('0x27')](function(){db[_0x8db2('0x97')][_0x8db2('0x3b')](_0x3e1478[_0x8db2('0x98')](),_0x3349f1)[_0x8db2('0x27')](function(_0x3ad3c7){_0x41594c['count']=_0x3ad3c7[_0x8db2('0x40')];if(_0x41594c[_0x8db2('0x99')]===0x0)return[];return db[_0x8db2('0x97')]['query'](_0x30d606['toString'](),_0x3349f1)['then'](function(_0xa09b1d){_0xb4fe2c=_[_0x8db2('0x9a')](_0xa09b1d,'id');_0x3349f1=_[_0x8db2('0x9b')](_0x3349f1,{'model':db[_0x8db2('0x9c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x502a02[_0x8db2('0x3b')][_0x8db2('0x3f')]){_0x304a72[_0x8db2('0x3e')][_0x8db2('0x31')](function(_0x3b1929){_0x173cc7[_0x8db2('0x47')]('i.'+_0x3b1929);});}else{_0x173cc7[_0x8db2('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8db2('0x5c'));_0x173cc7[_0x8db2('0x47')](_0x8db2('0x9d'),_0x8db2('0x9e'));_0x173cc7['field']('a.mandatoryDisposition',_0x8db2('0x9f'));_0x173cc7[_0x8db2('0x47')]('i.*');_0x173cc7[_0x8db2('0x47')](_0x8db2('0xa0'),_0x8db2('0xa1'));_0x173cc7['field']('c.lastName','Contact.lastName');_0x173cc7[_0x8db2('0x47')](_0x8db2('0xa2'),_0x8db2('0xa3'));_0x173cc7[_0x8db2('0x47')](_0x8db2('0xa4'),'Contact.phone');_0x173cc7[_0x8db2('0x47')]('c.mobile',_0x8db2('0xa5'));_0x173cc7[_0x8db2('0x47')](_0x8db2('0xa6'),_0x8db2('0xa7'));_0x173cc7[_0x8db2('0x47')]('o.fullname','Owner.fullname');_0x173cc7[_0x8db2('0x47')]('o.internal',_0x8db2('0xa8'));_0x173cc7[_0x8db2('0x47')](_0x8db2('0xa9'),_0x8db2('0x32'));}_0x173cc7[_0x8db2('0x20')](_0x304a72[_0x8db2('0x20')]);_0x173cc7['offset'](_0x304a72[_0x8db2('0x1f')]);return db[_0x8db2('0x97')][_0x8db2('0x3b')](_0x173cc7['toString'](),_0x3349f1);})[_0x8db2('0x27')](function(_0x34804e){_0x1f4a82['where'](_0x8db2('0xaa'),_[_0x8db2('0x2d')](_0x34804e,'id'));return db[_0x8db2('0x97')][_0x8db2('0x3b')](_0x1f4a82[_0x8db2('0x98')](),_0x3349f1)[_0x8db2('0x27')](function(_0x31931d){var _0x19e25b=_[_0x8db2('0xab')](_0x31931d,'SmsInteractionId');var _0x44c0cc=[];_0x34804e[_0x8db2('0x31')](function(_0x1c37b7){_0x44c0cc[_0x8db2('0xac')](updateSmsInteraction(_0x1c37b7,_0xb4fe2c,_0x19e25b));});return BPromise[_0x8db2('0xad')](_0x44c0cc);});});})[_0x8db2('0x27')](function(_0x16d1c5){_0x41594c[_0x8db2('0xae')]=_0x16d1c5;return _0x41594c;})[_0x8db2('0x27')](respondWithFilteredResult(_0x1ab5eb,_0x304a72));})[_0x8db2('0x33')](handleError(_0x1ab5eb,null));};exports['show']=function(_0x3e79cc,_0x7e4bf){var _0x339ffe={'raw':![],'where':{'id':_0x3e79cc['params']['id']}},_0x1587e8={};_0x1587e8[_0x8db2('0x39')]=_[_0x8db2('0x3a')](db[_0x8db2('0x9c')]['rawAttributes']);_0x1587e8['query']=_[_0x8db2('0x3a')](_0x3e79cc[_0x8db2('0x3b')]);_0x1587e8[_0x8db2('0x3c')]=_[_0x8db2('0x3d')](_0x1587e8['model'],_0x1587e8[_0x8db2('0x3b')]);_0x339ffe[_0x8db2('0x3e')]=_[_0x8db2('0x3d')](_0x1587e8[_0x8db2('0x39')],qs['fields'](_0x3e79cc[_0x8db2('0x3b')][_0x8db2('0x3f')]));_0x339ffe[_0x8db2('0x3e')]=_0x339ffe['attributes']['length']?_0x339ffe['attributes']:_0x1587e8[_0x8db2('0x39')];if(_0x3e79cc[_0x8db2('0x3b')][_0x8db2('0xaf')]){_0x339ffe[_0x8db2('0xb0')]=[{'all':!![]}];}_0x339ffe=_['merge']({},_0x339ffe,_0x3e79cc['options']);return db[_0x8db2('0x9c')][_0x8db2('0x5b')](_0x339ffe)[_0x8db2('0x27')](handleEntityNotFound(_0x7e4bf,null))[_0x8db2('0x27')](respondWithResult(_0x7e4bf,null))[_0x8db2('0x33')](handleError(_0x7e4bf,null));};exports[_0x8db2('0xb1')]=function(_0x57c265,_0x2942eb){return db['SmsInteraction'][_0x8db2('0xb1')](_0x57c265[_0x8db2('0x71')],{})[_0x8db2('0x27')](respondWithResult(_0x2942eb,0xc9))[_0x8db2('0x33')](handleError(_0x2942eb,null));};exports[_0x8db2('0x26')]=function(_0x5c33be,_0x18c418){if(_0x5c33be[_0x8db2('0x71')]['id']){delete _0x5c33be['body']['id'];}return db[_0x8db2('0x9c')][_0x8db2('0x5b')]({'where':{'id':_0x5c33be[_0x8db2('0xb2')]['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x18c418,null))['then'](saveUpdates(_0x5c33be[_0x8db2('0x71')],null))['then'](respondWithResult(_0x18c418,null))['catch'](handleError(_0x18c418,null));};exports[_0x8db2('0xb3')]=function(_0x2026d2,_0x9b563c){return db[_0x8db2('0x9c')][_0x8db2('0x5b')]({'where':{'id':_0x2026d2[_0x8db2('0xb2')]['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x9b563c,null))['then'](removeEntity(_0x9b563c,null))[_0x8db2('0x33')](handleError(_0x9b563c,null));};exports['describe']=function(_0x4bbf03,_0x2f473e){return db['SmsInteraction']['describe']()[_0x8db2('0x27')](respondWithResult(_0x2f473e,null))[_0x8db2('0x33')](handleError(_0x2f473e,null));};exports[_0x8db2('0xb4')]=function(_0x49c298,_0x211460,_0xb2ab8e){return db[_0x8db2('0xb5')]['find']({'where':{'id':_0x49c298[_0x8db2('0xb2')]['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x211460,null))[_0x8db2('0x27')](function(_0x7ff636){if(_0x7ff636){return _0x7ff636[_0x8db2('0xb4')](_0x49c298[_0x8db2('0x71')][_0x8db2('0xb6')],_[_0x8db2('0xb7')](_0x49c298['body'],[_0x8db2('0xb6'),'id'])||{});}})[_0x8db2('0x27')](respondWithResult(_0x211460,null))[_0x8db2('0x33')](handleError(_0x211460,null));};exports[_0x8db2('0xb8')]=function(_0x20d69b,_0x36199d,_0x41985a){var _0x2910c8={'raw':![],'where':{}};var _0x3a53e2={};var _0xe2c308={'count':0x0,'rows':[]};return db[_0x8db2('0x9c')]['findOne']({'where':{'id':_0x20d69b[_0x8db2('0xb2')]['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x36199d,null))[_0x8db2('0x27')](function(_0x58063b){if(_0x58063b){_0x3a53e2[_0x8db2('0x39')]=_[_0x8db2('0x3a')](db[_0x8db2('0xb5')]['rawAttributes']);_0x3a53e2['query']=_[_0x8db2('0x3a')](_0x20d69b[_0x8db2('0x3b')]);_0x3a53e2[_0x8db2('0x3c')]=_[_0x8db2('0x3d')](_0x3a53e2[_0x8db2('0x39')],_0x3a53e2[_0x8db2('0x3b')]);_0x2910c8[_0x8db2('0x3e')]=_[_0x8db2('0x3d')](_0x3a53e2[_0x8db2('0x39')],qs[_0x8db2('0x3f')](_0x20d69b['query'][_0x8db2('0x3f')]));_0x2910c8[_0x8db2('0x3e')]=_0x2910c8['attributes'][_0x8db2('0x40')]?_0x2910c8[_0x8db2('0x3e')]:_0x3a53e2[_0x8db2('0x39')];if(!_0x20d69b[_0x8db2('0x3b')][_0x8db2('0x41')](_0x8db2('0x42'))){_0x2910c8[_0x8db2('0x20')]=qs[_0x8db2('0x20')](_0x20d69b[_0x8db2('0x3b')][_0x8db2('0x20')]);_0x2910c8[_0x8db2('0x1f')]=qs['offset'](_0x20d69b[_0x8db2('0x3b')][_0x8db2('0x1f')]);}_0x2910c8[_0x8db2('0x43')]=qs[_0x8db2('0x44')](_0x20d69b[_0x8db2('0x3b')][_0x8db2('0x44')]);_0x2910c8['where']=qs[_0x8db2('0x3c')](_[_0x8db2('0x45')](_0x20d69b[_0x8db2('0x3b')],_0x3a53e2[_0x8db2('0x3c')]));_0x2910c8[_0x8db2('0x7b')][_0x8db2('0xb9')]=_0x58063b['id'];if(_0x20d69b[_0x8db2('0x3b')][_0x8db2('0x83')]){_0x2910c8[_0x8db2('0x7b')]=_[_0x8db2('0x9b')](_0x2910c8[_0x8db2('0x7b')],{'$or':_['map'](_0x2910c8['attributes'],function(_0x3d3523){var _0x56f59b={};_0x56f59b[_0x3d3523]={'$like':'%'+_0x20d69b[_0x8db2('0x3b')][_0x8db2('0x83')]+'%'};return _0x56f59b;})});}if(_0x20d69b[_0x8db2('0x3b')]['$gte']){var _0x10ba5f=_0x20d69b[_0x8db2('0x3b')][_0x8db2('0x79')][_0x8db2('0x30')](',');var _0x54a021={};_0x54a021[_0x10ba5f[0x0]]={'$gte':moment(_0x10ba5f[0x1])[_0x8db2('0xba')](_0x8db2('0xbb'))};_0x2910c8[_0x8db2('0x7b')]=_['merge'](_0x2910c8[_0x8db2('0x7b')],_0x54a021);}_0x2910c8=_[_0x8db2('0x9b')]({},_0x2910c8,_0x20d69b[_0x8db2('0xbc')]);return db['SmsMessage'][_0x8db2('0x99')]({'where':_0x2910c8[_0x8db2('0x7b')]})[_0x8db2('0x27')](function(_0x5095e9){_0xe2c308[_0x8db2('0x99')]=_0x5095e9;if(_0x20d69b[_0x8db2('0x3b')]['includeAll']){_0x2910c8[_0x8db2('0xb0')]=[{'all':!![]}];}return db[_0x8db2('0xb5')]['findAll'](_0x2910c8);})[_0x8db2('0x27')](function(_0x1d23ae){_0xe2c308[_0x8db2('0xae')]=_0x1d23ae;return _0xe2c308;});}})['then'](respondWithFilteredResult(_0x36199d,_0x2910c8))['catch'](handleError(_0x36199d,null));};exports[_0x8db2('0xbd')]=function(_0x538a7c,_0x48cae6,_0x44b0fc){return db[_0x8db2('0x9c')][_0x8db2('0x5b')]({'where':{'id':_0x538a7c[_0x8db2('0xb2')]['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x48cae6,null))[_0x8db2('0x27')](function(_0x54d389){if(_0x54d389){return _0x54d389['setTags'](_0x538a7c[_0x8db2('0x71')][_0x8db2('0xb6')],_[_0x8db2('0xb7')](_0x538a7c[_0x8db2('0x71')],['ids','id'])||{})[_0x8db2('0xbe')](function(){return db['Tag'][_0x8db2('0xbf')]({'attributes':['id','name',_0x8db2('0x48')],'where':{'id':_0x538a7c[_0x8db2('0x71')][_0x8db2('0xb6')]}});})[_0x8db2('0x27')](function(_0x5bf2a7){socket[_0x8db2('0xc0')]('smsInteractionTags:save',{'id':Number(_0x538a7c['params']['id']),'tags':_0x5bf2a7||[]});return{'id':Number(_0x538a7c[_0x8db2('0xb2')]['id']),'tags':_0x5bf2a7||[]};});}})[_0x8db2('0x27')](respondWithResult(_0x48cae6,null))[_0x8db2('0x33')](handleError(_0x48cae6,null));};exports['removeTags']=function(_0x4eb531,_0x175eae,_0x464630){return db[_0x8db2('0x9c')]['find']({'where':{'id':_0x4eb531['params']['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x175eae,null))[_0x8db2('0x27')](function(_0x5e7912){if(_0x5e7912){return _0x5e7912[_0x8db2('0xc1')](_0x4eb531[_0x8db2('0x3b')][_0x8db2('0xb6')]);}})[_0x8db2('0x27')](respondWithStatusCode(_0x175eae,null))[_0x8db2('0x33')](handleError(_0x175eae,null));};exports[_0x8db2('0xc2')]=function(_0x32b206,_0x3bffd9){var _0x6a2d5=moment()['unix']()['toString']();var _0x49d856=path[_0x8db2('0xc3')](config[_0x8db2('0xc4')],_0x8db2('0xc5'),_0x8db2('0xc6'),_0x8db2('0xc7'));var _0x51007f=path[_0x8db2('0xc3')](config['root'],_0x8db2('0xc5'),_0x8db2('0xc6'),_0x8db2('0xc8'));var _0x361a48=path['join'](_0x49d856,_0x6a2d5);var _0x44da4b=util['format'](_0x8db2('0xc9'),_0x32b206[_0x8db2('0xb2')]['id'],_0x6a2d5);var _0x4ad5c5=path['join'](_0x49d856,_0x44da4b);var _0x4e0c9b=[];_0x4e0c9b[_0x8db2('0xac')]({'model':db[_0x8db2('0x6d')],'as':_0x8db2('0x6d'),'attributes':['id',_0x8db2('0x2e')],'raw':!![]});_0x4e0c9b['push']({'model':db[_0x8db2('0xca')],'as':_0x8db2('0x61'),'attributes':['id',_0x8db2('0xcb'),_0x8db2('0xcc')],'raw':!![]});var _0x3e32b3=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0x8db2('0x71'),_0x8db2('0x77'),'direction',_0x8db2('0xcd'),_0x8db2('0x7f')],'include':_0x4e0c9b}];_0x3e32b3[_0x8db2('0xac')]({'model':db['SmsAccount'],'as':_0x8db2('0xce'),'attributes':['id',_0x8db2('0x2a')]});_0x3e32b3[_0x8db2('0xac')]({'model':db[_0x8db2('0x6d')],'as':_0x8db2('0xcf'),'attributes':['id',_0x8db2('0x2e')]});return db[_0x8db2('0x9c')][_0x8db2('0x5b')]({'where':{'id':_0x32b206[_0x8db2('0xb2')]['id']},'include':_0x3e32b3})[_0x8db2('0x27')](handleEntityNotFound(_0x3bffd9,null))[_0x8db2('0x27')](function(_0x34c0bb){if(_0x34c0bb){var _0x52b869=_0x34c0bb[_0x8db2('0xd0')]({'plain':!![]});fs[_0x8db2('0xd1')](_0x361a48);var _0x50fe87={'format':'A4','border':_0x8db2('0xd2'),'header':{'height':_0x8db2('0xd3'),'contents':{'first':_0x8db2('0xd4')}},'footer':{'height':_0x8db2('0xd5'),'contents':{'default':util[_0x8db2('0xba')](_0x8db2('0xd6'),util[_0x8db2('0xba')](_0x8db2('0xd7'),_0x8db2('0xd8'),_0x52b869['id']),moment()[_0x8db2('0xba')](_0x8db2('0xd9'))[_0x8db2('0x98')]())}}};var _0x5c1870={'channel':'Sms','account':_0x52b869[_0x8db2('0xce')][_0x8db2('0x2a')],'agent':_0x52b869['Owner']?_0x52b869[_0x8db2('0xcf')]['fullname']:_0x8db2('0xda'),'createdAt':moment(_0x52b869[_0x8db2('0x77')])[_0x8db2('0xba')](_0x8db2('0xbb'))[_0x8db2('0x98')](),'closedAt':_0x52b869[_0x8db2('0xdb')]?moment(_0x52b869[_0x8db2('0xdc')])[_0x8db2('0xba')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8db2('0x98')]():'','disposition':_0x52b869[_0x8db2('0xdd')],'messages':_(_0x52b869[_0x8db2('0xde')])[_0x8db2('0x83')]({'secret':![]})['map'](function(_0x3500c0){return{'date':moment(_0x3500c0['createdAt'])[_0x8db2('0xba')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8db2('0x98')](),'sender':_0x3500c0[_0x8db2('0xdf')]===_0x8db2('0xe0')?_0x3500c0[_0x8db2('0x6d')]?_0x3500c0['User'][_0x8db2('0x2e')]:_0x8db2('0xe1'):_0x3500c0[_0x8db2('0x61')][_0x8db2('0xcb')]+(_0x3500c0[_0x8db2('0x61')][_0x8db2('0xcc')]?'\x20'+_0x3500c0[_0x8db2('0x61')][_0x8db2('0xcc')]:''),'body':_0x3500c0[_0x8db2('0x71')],'direction':_0x3500c0[_0x8db2('0xdf')]==='out'?'A':'C','secret':_0x3500c0['secret'],'read':_0x3500c0['read']};})[_0x8db2('0x5d')]()};return ejs[_0x8db2('0xe2')](path[_0x8db2('0xc3')](config[_0x8db2('0xc4')],_0x8db2('0xc5'),_0x8db2('0xe3'),_0x8db2('0xe4')),{'interaction':_0x5c1870})[_0x8db2('0x27')](function(_0x4bb49c){return new BPromise(function(_0x257e31,_0x7c2479){pdf[_0x8db2('0xb1')](_0x4bb49c,_0x50fe87)[_0x8db2('0xe5')](path[_0x8db2('0xc3')](_0x361a48,_0x8db2('0xe6')+_0x52b869['id']+'-'+_0x6a2d5+'.pdf'),function(_0x233692,_0x348c7c){if(_0x233692)return _0x7c2479(_0x233692);_0x257e31(_0x348c7c);});});})['then'](function(){return new BPromise(function(_0x1d2479,_0x458f18){zipdir(_0x361a48,{'saveTo':_0x4ad5c5},function(_0x51a5d2,_0x1ce6ca){if(_0x51a5d2)return _0x458f18(_0x51a5d2);return _0x1d2479(_0x1ce6ca);});})['then'](function(){return new BPromise(function(_0x247bf6,_0x380bcb){rimraf(_0x361a48,function(_0x201d01){if(_0x201d01)_0x380bcb(_0x201d01);return _0x247bf6();});});})[_0x8db2('0x27')](function(){return _0x3bffd9[_0x8db2('0xc2')](_0x4ad5c5,_0x44da4b,function(_0x335cec){if(_0x335cec){console[_0x8db2('0xe7')]('err',_0x335cec);}else{fs['unlinkSync'](_0x4ad5c5);}});});});}else{return _0x3bffd9[_0x8db2('0x1c')](0xc8);}})['catch'](handleError(_0x3bffd9,null));}; \ No newline at end of file +var _0xdb28=['CmContact','firstName','lastName','secret','Account','Owner','get','mkdirSync','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','YYYY-MM-DD','N.A.','closed','closedAt','disposition','Messages','direction','out','System','renderFile','views','downloadInteraction.html','toFile','transcript-','log','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./smsInteraction.socket','register','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','Users','map','fullname','Tags','split','forEach','TagIds','catch','index','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','select','field','color','tools_tags','ui.SmsInteractionId','from','users','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','\x27\x27\x27\x27','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','SmsInteraction','a.key','Account.key','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','push','all','rows','includeAll','include','create','params','destroy','addMessage','SmsMessage','ids','omit','getMessages','SmsInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','options','addTags','spread','findAll','emit','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip'];(function(_0x4abc51,_0x2e4962){var _0x379465=function(_0x5772a9){while(--_0x5772a9){_0x4abc51['push'](_0x4abc51['shift']());}};_0x379465(++_0x2e4962);}(_0xdb28,0x106));var _0x8db2=function(_0x645df0,_0x2e11d8){_0x645df0=_0x645df0-0x0;var _0x366b36=_0xdb28[_0x645df0];return _0x366b36;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var db=require(_0x8db2('0x17'))['db'];config[_0x8db2('0x18')]=_[_0x8db2('0x19')](config[_0x8db2('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8db2('0x18')]));require(_0x8db2('0x1a'))[_0x8db2('0x1b')](socket);function respondWithStatusCode(_0x1d6a15,_0x227355){_0x227355=_0x227355||0xcc;return function(_0xfa285b){if(_0xfa285b){return _0x1d6a15[_0x8db2('0x1c')](_0x227355);}return _0x1d6a15[_0x8db2('0x1d')](_0x227355)[_0x8db2('0x1e')]();};}function respondWithResult(_0x16c8c2,_0x5489a9){_0x5489a9=_0x5489a9||0xc8;return function(_0x13b0f5){if(_0x13b0f5){return _0x16c8c2[_0x8db2('0x1d')](_0x5489a9)['json'](_0x13b0f5);}};}function respondWithFilteredResult(_0x2b3f73,_0x44957d){return function(_0x21db8c){if(_0x21db8c){var _0x3fddc2=_0x21db8c['count'],_0x2efd06=_0x44957d[_0x8db2('0x1f')],_0x46ce14=_0x44957d[_0x8db2('0x1f')]+_0x44957d[_0x8db2('0x20')],_0x51d60d;if(_0x46ce14>=_0x3fddc2){_0x46ce14=_0x3fddc2;_0x51d60d=0xc8;}else{_0x51d60d=0xce;}_0x2b3f73[_0x8db2('0x1d')](_0x51d60d);return _0x2b3f73['set'](_0x8db2('0x21'),_0x2efd06+'-'+_0x46ce14+'/'+_0x3fddc2)[_0x8db2('0x22')](_0x21db8c);}return null;};}function patchUpdates(_0x260940){return function(_0x297ba3){try{jsonpatch[_0x8db2('0x23')](_0x297ba3,_0x260940,!![]);}catch(_0x597260){return BPromise[_0x8db2('0x24')](_0x597260);}return _0x297ba3[_0x8db2('0x25')]();};}function saveUpdates(_0x18f69c,_0x125be2){return function(_0x2260d8){if(_0x2260d8){return _0x2260d8[_0x8db2('0x26')](_0x18f69c)[_0x8db2('0x27')](function(_0x5c6614){return _0x5c6614;});}return null;};}function removeEntity(_0x256202,_0x4f6516){return function(_0x5725f0){if(_0x5725f0){return _0x5725f0['destroy']()['then'](function(){_0x256202[_0x8db2('0x1d')](0xcc)[_0x8db2('0x1e')]();});}};}function handleEntityNotFound(_0x3be281,_0x2baed0){return function(_0x145328){if(!_0x145328){_0x3be281[_0x8db2('0x1c')](0x194);}return _0x145328;};}function handleError(_0x58cd9d,_0x3544ba){_0x3544ba=_0x3544ba||0x1f4;return function(_0x372311){logger[_0x8db2('0x28')](_0x372311[_0x8db2('0x29')]);if(_0x372311['name']){delete _0x372311[_0x8db2('0x2a')];}_0x58cd9d[_0x8db2('0x1d')](_0x3544ba)[_0x8db2('0x2b')](_0x372311);};}function getInteractionUsers(_0x1687ed,_0xbe5ece){return new BPromise(function(_0x21bae5,_0xa54ea3){try{if(_0xbe5ece[_0x1687ed['id']]){_0x1687ed[_0x8db2('0x2c')]=_[_0x8db2('0x2d')](_0xbe5ece[_0x1687ed['id']],function(_0x493cab){return{'id':_0x493cab['id'],'fullname':_0x493cab[_0x8db2('0x2e')]};});}}catch(_0x50b28d){_0xa54ea3(_0x50b28d);}_0x21bae5(_0x1687ed);});}function getInteractionTags(_0x59cb77,_0x302188){return new BPromise(function(_0x25ed2c,_0xcc8a66){try{if(_0x59cb77['TagIds']){_0x59cb77[_0x8db2('0x2f')]=[];_0x59cb77['TagIds'][_0x8db2('0x30')](',')[_0x8db2('0x31')](function(_0x14bd12){_0x59cb77['Tags']['push'](_0x302188[_0x14bd12]);});}delete _0x59cb77[_0x8db2('0x32')];}catch(_0x1a460b){_0xcc8a66(_0x1a460b);}_0x25ed2c(_0x59cb77);});}function updateSmsInteraction(_0x4df530,_0x516dcb,_0x173989){return new BPromise(function(_0x5178f3,_0xc884a){return getInteractionUsers(_0x4df530,_0x173989)[_0x8db2('0x27')](function(_0x17ad44){return getInteractionTags(_0x17ad44,_0x516dcb);})[_0x8db2('0x27')](function(_0x101711){_0x5178f3(_0x101711);})[_0x8db2('0x33')](function(_0x46e0c8){_0xc884a(_0x46e0c8);});});}exports[_0x8db2('0x34')]=function(_0x502a02,_0x1ab5eb){var _0x304a72={},_0x5d2a5b={},_0x41594c={'count':0x0,'rows':[]};var _0x3ca80b=_['map'](db['SmsInteraction'][_0x8db2('0x35')],function(_0x4a45dd){return{'name':_0x4a45dd[_0x8db2('0x36')],'type':_0x4a45dd[_0x8db2('0x37')][_0x8db2('0x38')]};});_0x5d2a5b[_0x8db2('0x39')]=_['map'](_0x3ca80b,_0x8db2('0x2a'));_0x5d2a5b['query']=_[_0x8db2('0x3a')](_0x502a02[_0x8db2('0x3b')]);_0x5d2a5b[_0x8db2('0x3c')]=_[_0x8db2('0x3d')](_0x5d2a5b['model'],_0x5d2a5b['query']);_0x304a72[_0x8db2('0x3e')]=_[_0x8db2('0x3d')](_0x5d2a5b['model'],qs[_0x8db2('0x3f')](_0x502a02[_0x8db2('0x3b')][_0x8db2('0x3f')]));_0x304a72['attributes']=_0x304a72[_0x8db2('0x3e')][_0x8db2('0x40')]?_0x304a72[_0x8db2('0x3e')]:_0x5d2a5b[_0x8db2('0x39')];if(!_0x502a02[_0x8db2('0x3b')][_0x8db2('0x41')](_0x8db2('0x42'))){_0x304a72[_0x8db2('0x20')]=qs[_0x8db2('0x20')](_0x502a02[_0x8db2('0x3b')][_0x8db2('0x20')]);_0x304a72[_0x8db2('0x1f')]=qs[_0x8db2('0x1f')](_0x502a02['query'][_0x8db2('0x1f')]);}_0x304a72[_0x8db2('0x43')]=qs['sort'](_0x502a02['query'][_0x8db2('0x44')]);_0x304a72['where']=qs[_0x8db2('0x3c')](_[_0x8db2('0x45')](_0x502a02[_0x8db2('0x3b')],_0x5d2a5b[_0x8db2('0x3c')]));var _0xb4fe2c=[];var _0x30d606=squel[_0x8db2('0x46')]()['field']('id')[_0x8db2('0x47')](_0x8db2('0x2a'))[_0x8db2('0x47')](_0x8db2('0x48'))['from'](_0x8db2('0x49'));var _0x1f4a82=squel[_0x8db2('0x46')]()[_0x8db2('0x47')]('u.id')[_0x8db2('0x47')]('u.fullname')[_0x8db2('0x47')](_0x8db2('0x4a'))[_0x8db2('0x4b')]('user_has_sms_interactions','ui')['left_join'](_0x8db2('0x4c'),'u','u.id\x20=\x20ui.UserId');var _0x173cc7=squel[_0x8db2('0x46')]()[_0x8db2('0x4b')](_0x8db2('0x4d'),'i')[_0x8db2('0x4e')](_0x8db2('0x4f'),'c',_0x8db2('0x50'))[_0x8db2('0x4e')](_0x8db2('0x4c'),'o',_0x8db2('0x51'))[_0x8db2('0x4e')](_0x8db2('0x52'),'a','a.id\x20=\x20i.SmsAccountId')[_0x8db2('0x4e')](_0x8db2('0x53'),'me',_0x8db2('0x54'))[_0x8db2('0x4e')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')[_0x8db2('0x4e')](_0x8db2('0x49'),'t',_0x8db2('0x55'));var _0x4c66e5=squel['expr']();var _0x494d6e=[];var _0x44ac56=squel[_0x8db2('0x56')]();var _0x55c7dd;if(_0x502a02[_0x8db2('0x3b')][_0x8db2('0x57')]){_0x55c7dd=as[_0x8db2('0x58')](_0x502a02[_0x8db2('0x3b')]['search']);var _0x5329e6=_0x55c7dd[_0x8db2('0x59')];for(var _0x18c6ef=0x0;_0x18c6ef<_0x55c7dd[_0x8db2('0x5a')][_0x8db2('0x40')];_0x18c6ef++){var _0x3daed6=_0x55c7dd[_0x8db2('0x5a')][_0x18c6ef];var _0x1f0f7c='i';var _0x3ca2a7=_[_0x8db2('0x5b')](_0x3ca80b,[_0x8db2('0x2a'),_0x3daed6[_0x8db2('0x47')]]);if(!_0x3ca2a7){switch(_0x3daed6[_0x8db2('0x47')]){case _0x8db2('0x5c'):if(_0x3daed6[_0x8db2('0x5d')]==0x1){_0x173cc7[_0x8db2('0x5e')]('`'+_0x3daed6['field']+_0x8db2('0x5f'));}else{_0x173cc7[_0x8db2('0x5e')]('`'+_0x3daed6['field']+_0x8db2('0x60'));}break;case _0x8db2('0x61'):if(_0x3daed6[_0x8db2('0x62')]==='$substring'){if(_0x3daed6[_0x8db2('0x5d')][_0x8db2('0x30')]('\x20')[_0x8db2('0x40')]>0x1){_0x4c66e5[_0x5329e6](_0x8db2('0x63'),qs[_0x8db2('0x64')](_0x3daed6['value']),null);}else{var _0x467505='%'+_0x3daed6[_0x8db2('0x5d')]+'%';_0x4c66e5[_0x5329e6](_0x8db2('0x65'),_0x467505,_0x467505,_0x467505);}}else{_0x3ca2a7=_['find'](_0x3ca80b,[_0x8db2('0x2a'),_0x8db2('0x66')]);_0x3daed6[_0x8db2('0x47')]=_0x8db2('0x66');_0x24cfe9=as[_0x8db2('0x67')](_0x1f0f7c,_0x3ca2a7[_0x8db2('0x37')],_0x3daed6);_0x4c66e5[_0x5329e6](_0x24cfe9[_0x8db2('0x68')],_0x24cfe9['value'][_0x8db2('0x69')],_0x24cfe9[_0x8db2('0x5d')]['end']);}break;case _0x8db2('0x6a'):var _0x1683b8=_0x3daed6['value'][_0x8db2('0x30')](',')[_0x8db2('0x2d')](function(_0x63e8f7){return Number(_0x63e8f7);});_0x1683b8[_0x8db2('0x31')](function(_0x42b941){_0x44ac56['or'](_0x8db2('0x6b'),'%,'+_0x42b941+',%');});_0x494d6e=_[_0x8db2('0x6c')](_0x494d6e,_0x1683b8);break;case _0x8db2('0x6d'):if(_0x3daed6[_0x8db2('0x62')]===_0x8db2('0x6e')){_0x4c66e5[_0x5329e6](_0x8db2('0x6f'),'%'+_0x3daed6[_0x8db2('0x5d')]+'%',null);}else{_0x3ca2a7=_[_0x8db2('0x5b')](_0x3ca80b,[_0x8db2('0x2a'),_0x8db2('0x70')]);_0x3daed6[_0x8db2('0x47')]='UserId';_0x24cfe9=as[_0x8db2('0x67')](_0x1f0f7c,_0x3ca2a7[_0x8db2('0x37')],_0x3daed6);_0x4c66e5[_0x5329e6](_0x24cfe9[_0x8db2('0x68')],_0x24cfe9[_0x8db2('0x5d')][_0x8db2('0x69')],_0x24cfe9['value'][_0x8db2('0x1e')]);}break;case _0x8db2('0x71'):_0x24cfe9=as[_0x8db2('0x67')]('me',null,_0x3daed6);_0x4c66e5[_0x5329e6](_0x24cfe9[_0x8db2('0x68')],_0x24cfe9[_0x8db2('0x5d')][_0x8db2('0x69')],_0x24cfe9[_0x8db2('0x5d')][_0x8db2('0x1e')]);break;}}else{var _0x24cfe9=as[_0x8db2('0x67')](_0x1f0f7c,_0x3ca2a7[_0x8db2('0x37')],_0x3daed6);_0x4c66e5[_0x5329e6](_0x24cfe9[_0x8db2('0x68')],_0x24cfe9[_0x8db2('0x5d')][_0x8db2('0x69')],_0x24cfe9[_0x8db2('0x5d')][_0x8db2('0x1e')]);}}}else{var _0x1d7862=_(_0x502a02[_0x8db2('0x3b')])['keys']()[_0x8db2('0x2d')](function(_0x536ac1){return _[_0x8db2('0x72')](_0x3ca80b,['name',_0x536ac1])?_0x536ac1:undefined;})[_0x8db2('0x73')]()[_0x8db2('0x5d')]();if(!_[_0x8db2('0x74')](_0x1d7862)){_0x1d7862[_0x8db2('0x31')](function(_0x1e812e){if(_0x1e812e==='SmsAccountId'){_0x173cc7['where'](_0x8db2('0x75'),[][_0x8db2('0x76')](_0x502a02[_0x8db2('0x3b')][_0x1e812e]));}else if(_0x1e812e===_0x8db2('0x77')){var _0x20b49c=JSON[_0x8db2('0x78')](_0x502a02[_0x8db2('0x3b')][_0x1e812e])[_0x8db2('0x79')];var _0x504039=JSON[_0x8db2('0x78')](_0x502a02[_0x8db2('0x3b')][_0x1e812e])[_0x8db2('0x7a')];_0x173cc7[_0x8db2('0x7b')](_0x8db2('0x7c'),_0x20b49c,_0x504039);}else{if(_0x502a02[_0x8db2('0x3b')][_0x1e812e]===_0x8db2('0x7d')){_0x173cc7[_0x8db2('0x7b')]('i.'+_0x1e812e+'\x20IS\x20NULL');}else{_0x173cc7['where']('i.'+_0x1e812e+_0x8db2('0x7e'),_0x502a02[_0x8db2('0x3b')][_0x1e812e]);}}});}if(_0x502a02[_0x8db2('0x3b')][_0x8db2('0x7f')]){if(_0x502a02[_0x8db2('0x3b')]['read']==0x1){_0x173cc7['having'](_0x8db2('0x80'));}else{_0x173cc7[_0x8db2('0x5e')]('`unreadMessages`\x20>\x200');}}if(_0x502a02[_0x8db2('0x3b')][_0x8db2('0x81')]){_0x494d6e=_[_0x8db2('0x82')](_0x502a02['query'][_0x8db2('0x81')])?_0x502a02[_0x8db2('0x3b')][_0x8db2('0x81')]:new Array(_0x502a02['query'][_0x8db2('0x81')]);_0x494d6e[_0x8db2('0x31')](function(_0x2a520b){_0x44ac56['or'](_0x8db2('0x6b'),'%,'+_0x2a520b+',%');});}if(_0x502a02[_0x8db2('0x3b')]['filter']){var _0x3c9af4=_0x502a02[_0x8db2('0x3b')][_0x8db2('0x83')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x8db2('0x84'));if(qs[_0x8db2('0x85')](_0x3c9af4)){_0x4c66e5['or']('i.id\x20LIKE\x20?',_0x3c9af4+'%')['or'](_0x8db2('0x86'),_0x3c9af4+'%');}else{_0x4c66e5['or'](_0x8db2('0x87'),qs[_0x8db2('0x64')](_0x3c9af4))['or'](_0x8db2('0x88'),_0x3c9af4+'%');}}}_0x173cc7[_0x8db2('0x7b')](_0x4c66e5);_0x173cc7[_0x8db2('0x89')](_0x8db2('0x8a'));var _0x3349f1={'type':db[_0x8db2('0x8b')][_0x8db2('0x8c')][_0x8db2('0x8d')],'raw':!![]};var _0x3e1478=_0x173cc7[_0x8db2('0x8e')]();_0x3e1478['field'](_0x8db2('0x8a'));_0x3e1478['field'](_0x8db2('0x8f'),_0x8db2('0x5c'));if(_0x304a72['order']){_0x304a72[_0x8db2('0x43')][_0x8db2('0x31')](function(_0x5cdf53){_0x173cc7[_0x8db2('0x43')]('i.'+_0x5cdf53[0x0],_0x5cdf53[0x1]===_0x8db2('0x90')?![]:!![]);});}if(!_[_0x8db2('0x74')](_0x494d6e)){_0x173cc7[_0x8db2('0x5e')](_0x44ac56);_0x3e1478[_0x8db2('0x7b')](_0x8db2('0x91'),_0x494d6e);}BPromise[_0x8db2('0x92')]()[_0x8db2('0x27')](function(){if(!_0x55c7dd){if(_0x502a02[_0x8db2('0x3b')]['SmsAccountId']||_0x502a02['query'][_0x8db2('0x93')])return;_0x3e1478['where'](_0x8db2('0x94'));_0x173cc7[_0x8db2('0x7b')](_0x8db2('0x94'));return;}return _0x502a02['user'][_0x8db2('0x95')]({'attributes':['id'],'raw':!![]})[_0x8db2('0x27')](function(_0x3e37e7){if(_['isEmpty'](_0x3e37e7)){_0x3e1478[_0x8db2('0x7b')](_0x8db2('0x96'));_0x173cc7[_0x8db2('0x7b')](_0x8db2('0x96'));}else{_0x3e1478['where'](_0x8db2('0x75'),_[_0x8db2('0x2d')](_0x3e37e7,'id'));_0x173cc7[_0x8db2('0x7b')](_0x8db2('0x75'),_[_0x8db2('0x2d')](_0x3e37e7,'id'));}});})[_0x8db2('0x27')](function(){db[_0x8db2('0x97')][_0x8db2('0x3b')](_0x3e1478[_0x8db2('0x98')](),_0x3349f1)[_0x8db2('0x27')](function(_0x3ad3c7){_0x41594c['count']=_0x3ad3c7[_0x8db2('0x40')];if(_0x41594c[_0x8db2('0x99')]===0x0)return[];return db[_0x8db2('0x97')]['query'](_0x30d606['toString'](),_0x3349f1)['then'](function(_0xa09b1d){_0xb4fe2c=_[_0x8db2('0x9a')](_0xa09b1d,'id');_0x3349f1=_[_0x8db2('0x9b')](_0x3349f1,{'model':db[_0x8db2('0x9c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x502a02[_0x8db2('0x3b')][_0x8db2('0x3f')]){_0x304a72[_0x8db2('0x3e')][_0x8db2('0x31')](function(_0x3b1929){_0x173cc7[_0x8db2('0x47')]('i.'+_0x3b1929);});}else{_0x173cc7[_0x8db2('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8db2('0x5c'));_0x173cc7[_0x8db2('0x47')](_0x8db2('0x9d'),_0x8db2('0x9e'));_0x173cc7['field']('a.mandatoryDisposition',_0x8db2('0x9f'));_0x173cc7[_0x8db2('0x47')]('i.*');_0x173cc7[_0x8db2('0x47')](_0x8db2('0xa0'),_0x8db2('0xa1'));_0x173cc7['field']('c.lastName','Contact.lastName');_0x173cc7[_0x8db2('0x47')](_0x8db2('0xa2'),_0x8db2('0xa3'));_0x173cc7[_0x8db2('0x47')](_0x8db2('0xa4'),'Contact.phone');_0x173cc7[_0x8db2('0x47')]('c.mobile',_0x8db2('0xa5'));_0x173cc7[_0x8db2('0x47')](_0x8db2('0xa6'),_0x8db2('0xa7'));_0x173cc7[_0x8db2('0x47')]('o.fullname','Owner.fullname');_0x173cc7[_0x8db2('0x47')]('o.internal',_0x8db2('0xa8'));_0x173cc7[_0x8db2('0x47')](_0x8db2('0xa9'),_0x8db2('0x32'));}_0x173cc7[_0x8db2('0x20')](_0x304a72[_0x8db2('0x20')]);_0x173cc7['offset'](_0x304a72[_0x8db2('0x1f')]);return db[_0x8db2('0x97')][_0x8db2('0x3b')](_0x173cc7['toString'](),_0x3349f1);})[_0x8db2('0x27')](function(_0x34804e){_0x1f4a82['where'](_0x8db2('0xaa'),_[_0x8db2('0x2d')](_0x34804e,'id'));return db[_0x8db2('0x97')][_0x8db2('0x3b')](_0x1f4a82[_0x8db2('0x98')](),_0x3349f1)[_0x8db2('0x27')](function(_0x31931d){var _0x19e25b=_[_0x8db2('0xab')](_0x31931d,'SmsInteractionId');var _0x44c0cc=[];_0x34804e[_0x8db2('0x31')](function(_0x1c37b7){_0x44c0cc[_0x8db2('0xac')](updateSmsInteraction(_0x1c37b7,_0xb4fe2c,_0x19e25b));});return BPromise[_0x8db2('0xad')](_0x44c0cc);});});})[_0x8db2('0x27')](function(_0x16d1c5){_0x41594c[_0x8db2('0xae')]=_0x16d1c5;return _0x41594c;})[_0x8db2('0x27')](respondWithFilteredResult(_0x1ab5eb,_0x304a72));})[_0x8db2('0x33')](handleError(_0x1ab5eb,null));};exports['show']=function(_0x3e79cc,_0x7e4bf){var _0x339ffe={'raw':![],'where':{'id':_0x3e79cc['params']['id']}},_0x1587e8={};_0x1587e8[_0x8db2('0x39')]=_[_0x8db2('0x3a')](db[_0x8db2('0x9c')]['rawAttributes']);_0x1587e8['query']=_[_0x8db2('0x3a')](_0x3e79cc[_0x8db2('0x3b')]);_0x1587e8[_0x8db2('0x3c')]=_[_0x8db2('0x3d')](_0x1587e8['model'],_0x1587e8[_0x8db2('0x3b')]);_0x339ffe[_0x8db2('0x3e')]=_[_0x8db2('0x3d')](_0x1587e8[_0x8db2('0x39')],qs['fields'](_0x3e79cc[_0x8db2('0x3b')][_0x8db2('0x3f')]));_0x339ffe[_0x8db2('0x3e')]=_0x339ffe['attributes']['length']?_0x339ffe['attributes']:_0x1587e8[_0x8db2('0x39')];if(_0x3e79cc[_0x8db2('0x3b')][_0x8db2('0xaf')]){_0x339ffe[_0x8db2('0xb0')]=[{'all':!![]}];}_0x339ffe=_['merge']({},_0x339ffe,_0x3e79cc['options']);return db[_0x8db2('0x9c')][_0x8db2('0x5b')](_0x339ffe)[_0x8db2('0x27')](handleEntityNotFound(_0x7e4bf,null))[_0x8db2('0x27')](respondWithResult(_0x7e4bf,null))[_0x8db2('0x33')](handleError(_0x7e4bf,null));};exports[_0x8db2('0xb1')]=function(_0x57c265,_0x2942eb){return db['SmsInteraction'][_0x8db2('0xb1')](_0x57c265[_0x8db2('0x71')],{})[_0x8db2('0x27')](respondWithResult(_0x2942eb,0xc9))[_0x8db2('0x33')](handleError(_0x2942eb,null));};exports[_0x8db2('0x26')]=function(_0x5c33be,_0x18c418){if(_0x5c33be[_0x8db2('0x71')]['id']){delete _0x5c33be['body']['id'];}return db[_0x8db2('0x9c')][_0x8db2('0x5b')]({'where':{'id':_0x5c33be[_0x8db2('0xb2')]['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x18c418,null))['then'](saveUpdates(_0x5c33be[_0x8db2('0x71')],null))['then'](respondWithResult(_0x18c418,null))['catch'](handleError(_0x18c418,null));};exports[_0x8db2('0xb3')]=function(_0x2026d2,_0x9b563c){return db[_0x8db2('0x9c')][_0x8db2('0x5b')]({'where':{'id':_0x2026d2[_0x8db2('0xb2')]['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x9b563c,null))['then'](removeEntity(_0x9b563c,null))[_0x8db2('0x33')](handleError(_0x9b563c,null));};exports['describe']=function(_0x4bbf03,_0x2f473e){return db['SmsInteraction']['describe']()[_0x8db2('0x27')](respondWithResult(_0x2f473e,null))[_0x8db2('0x33')](handleError(_0x2f473e,null));};exports[_0x8db2('0xb4')]=function(_0x49c298,_0x211460,_0xb2ab8e){return db[_0x8db2('0xb5')]['find']({'where':{'id':_0x49c298[_0x8db2('0xb2')]['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x211460,null))[_0x8db2('0x27')](function(_0x7ff636){if(_0x7ff636){return _0x7ff636[_0x8db2('0xb4')](_0x49c298[_0x8db2('0x71')][_0x8db2('0xb6')],_[_0x8db2('0xb7')](_0x49c298['body'],[_0x8db2('0xb6'),'id'])||{});}})[_0x8db2('0x27')](respondWithResult(_0x211460,null))[_0x8db2('0x33')](handleError(_0x211460,null));};exports[_0x8db2('0xb8')]=function(_0x20d69b,_0x36199d,_0x41985a){var _0x2910c8={'raw':![],'where':{}};var _0x3a53e2={};var _0xe2c308={'count':0x0,'rows':[]};return db[_0x8db2('0x9c')]['findOne']({'where':{'id':_0x20d69b[_0x8db2('0xb2')]['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x36199d,null))[_0x8db2('0x27')](function(_0x58063b){if(_0x58063b){_0x3a53e2[_0x8db2('0x39')]=_[_0x8db2('0x3a')](db[_0x8db2('0xb5')]['rawAttributes']);_0x3a53e2['query']=_[_0x8db2('0x3a')](_0x20d69b[_0x8db2('0x3b')]);_0x3a53e2[_0x8db2('0x3c')]=_[_0x8db2('0x3d')](_0x3a53e2[_0x8db2('0x39')],_0x3a53e2[_0x8db2('0x3b')]);_0x2910c8[_0x8db2('0x3e')]=_[_0x8db2('0x3d')](_0x3a53e2[_0x8db2('0x39')],qs[_0x8db2('0x3f')](_0x20d69b['query'][_0x8db2('0x3f')]));_0x2910c8[_0x8db2('0x3e')]=_0x2910c8['attributes'][_0x8db2('0x40')]?_0x2910c8[_0x8db2('0x3e')]:_0x3a53e2[_0x8db2('0x39')];if(!_0x20d69b[_0x8db2('0x3b')][_0x8db2('0x41')](_0x8db2('0x42'))){_0x2910c8[_0x8db2('0x20')]=qs[_0x8db2('0x20')](_0x20d69b[_0x8db2('0x3b')][_0x8db2('0x20')]);_0x2910c8[_0x8db2('0x1f')]=qs['offset'](_0x20d69b[_0x8db2('0x3b')][_0x8db2('0x1f')]);}_0x2910c8[_0x8db2('0x43')]=qs[_0x8db2('0x44')](_0x20d69b[_0x8db2('0x3b')][_0x8db2('0x44')]);_0x2910c8['where']=qs[_0x8db2('0x3c')](_[_0x8db2('0x45')](_0x20d69b[_0x8db2('0x3b')],_0x3a53e2[_0x8db2('0x3c')]));_0x2910c8[_0x8db2('0x7b')][_0x8db2('0xb9')]=_0x58063b['id'];if(_0x20d69b[_0x8db2('0x3b')][_0x8db2('0x83')]){_0x2910c8[_0x8db2('0x7b')]=_[_0x8db2('0x9b')](_0x2910c8[_0x8db2('0x7b')],{'$or':_['map'](_0x2910c8['attributes'],function(_0x3d3523){var _0x56f59b={};_0x56f59b[_0x3d3523]={'$like':'%'+_0x20d69b[_0x8db2('0x3b')][_0x8db2('0x83')]+'%'};return _0x56f59b;})});}if(_0x20d69b[_0x8db2('0x3b')]['$gte']){var _0x10ba5f=_0x20d69b[_0x8db2('0x3b')][_0x8db2('0x79')][_0x8db2('0x30')](',');var _0x54a021={};_0x54a021[_0x10ba5f[0x0]]={'$gte':moment(_0x10ba5f[0x1])[_0x8db2('0xba')](_0x8db2('0xbb'))};_0x2910c8[_0x8db2('0x7b')]=_['merge'](_0x2910c8[_0x8db2('0x7b')],_0x54a021);}_0x2910c8=_[_0x8db2('0x9b')]({},_0x2910c8,_0x20d69b[_0x8db2('0xbc')]);return db['SmsMessage'][_0x8db2('0x99')]({'where':_0x2910c8[_0x8db2('0x7b')]})[_0x8db2('0x27')](function(_0x5095e9){_0xe2c308[_0x8db2('0x99')]=_0x5095e9;if(_0x20d69b[_0x8db2('0x3b')]['includeAll']){_0x2910c8[_0x8db2('0xb0')]=[{'all':!![]}];}return db[_0x8db2('0xb5')]['findAll'](_0x2910c8);})[_0x8db2('0x27')](function(_0x1d23ae){_0xe2c308[_0x8db2('0xae')]=_0x1d23ae;return _0xe2c308;});}})['then'](respondWithFilteredResult(_0x36199d,_0x2910c8))['catch'](handleError(_0x36199d,null));};exports[_0x8db2('0xbd')]=function(_0x538a7c,_0x48cae6,_0x44b0fc){return db[_0x8db2('0x9c')][_0x8db2('0x5b')]({'where':{'id':_0x538a7c[_0x8db2('0xb2')]['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x48cae6,null))[_0x8db2('0x27')](function(_0x54d389){if(_0x54d389){return _0x54d389['setTags'](_0x538a7c[_0x8db2('0x71')][_0x8db2('0xb6')],_[_0x8db2('0xb7')](_0x538a7c[_0x8db2('0x71')],['ids','id'])||{})[_0x8db2('0xbe')](function(){return db['Tag'][_0x8db2('0xbf')]({'attributes':['id','name',_0x8db2('0x48')],'where':{'id':_0x538a7c[_0x8db2('0x71')][_0x8db2('0xb6')]}});})[_0x8db2('0x27')](function(_0x5bf2a7){socket[_0x8db2('0xc0')]('smsInteractionTags:save',{'id':Number(_0x538a7c['params']['id']),'tags':_0x5bf2a7||[]});return{'id':Number(_0x538a7c[_0x8db2('0xb2')]['id']),'tags':_0x5bf2a7||[]};});}})[_0x8db2('0x27')](respondWithResult(_0x48cae6,null))[_0x8db2('0x33')](handleError(_0x48cae6,null));};exports['removeTags']=function(_0x4eb531,_0x175eae,_0x464630){return db[_0x8db2('0x9c')]['find']({'where':{'id':_0x4eb531['params']['id']}})[_0x8db2('0x27')](handleEntityNotFound(_0x175eae,null))[_0x8db2('0x27')](function(_0x5e7912){if(_0x5e7912){return _0x5e7912[_0x8db2('0xc1')](_0x4eb531[_0x8db2('0x3b')][_0x8db2('0xb6')]);}})[_0x8db2('0x27')](respondWithStatusCode(_0x175eae,null))[_0x8db2('0x33')](handleError(_0x175eae,null));};exports[_0x8db2('0xc2')]=function(_0x32b206,_0x3bffd9){var _0x6a2d5=moment()['unix']()['toString']();var _0x49d856=path[_0x8db2('0xc3')](config[_0x8db2('0xc4')],_0x8db2('0xc5'),_0x8db2('0xc6'),_0x8db2('0xc7'));var _0x51007f=path[_0x8db2('0xc3')](config['root'],_0x8db2('0xc5'),_0x8db2('0xc6'),_0x8db2('0xc8'));var _0x361a48=path['join'](_0x49d856,_0x6a2d5);var _0x44da4b=util['format'](_0x8db2('0xc9'),_0x32b206[_0x8db2('0xb2')]['id'],_0x6a2d5);var _0x4ad5c5=path['join'](_0x49d856,_0x44da4b);var _0x4e0c9b=[];_0x4e0c9b[_0x8db2('0xac')]({'model':db[_0x8db2('0x6d')],'as':_0x8db2('0x6d'),'attributes':['id',_0x8db2('0x2e')],'raw':!![]});_0x4e0c9b['push']({'model':db[_0x8db2('0xca')],'as':_0x8db2('0x61'),'attributes':['id',_0x8db2('0xcb'),_0x8db2('0xcc')],'raw':!![]});var _0x3e32b3=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0x8db2('0x71'),_0x8db2('0x77'),'direction',_0x8db2('0xcd'),_0x8db2('0x7f')],'include':_0x4e0c9b}];_0x3e32b3[_0x8db2('0xac')]({'model':db['SmsAccount'],'as':_0x8db2('0xce'),'attributes':['id',_0x8db2('0x2a')]});_0x3e32b3[_0x8db2('0xac')]({'model':db[_0x8db2('0x6d')],'as':_0x8db2('0xcf'),'attributes':['id',_0x8db2('0x2e')]});return db[_0x8db2('0x9c')][_0x8db2('0x5b')]({'where':{'id':_0x32b206[_0x8db2('0xb2')]['id']},'include':_0x3e32b3})[_0x8db2('0x27')](handleEntityNotFound(_0x3bffd9,null))[_0x8db2('0x27')](function(_0x34c0bb){if(_0x34c0bb){var _0x52b869=_0x34c0bb[_0x8db2('0xd0')]({'plain':!![]});fs[_0x8db2('0xd1')](_0x361a48);var _0x50fe87={'format':'A4','border':_0x8db2('0xd2'),'header':{'height':_0x8db2('0xd3'),'contents':{'first':_0x8db2('0xd4')}},'footer':{'height':_0x8db2('0xd5'),'contents':{'default':util[_0x8db2('0xba')](_0x8db2('0xd6'),util[_0x8db2('0xba')](_0x8db2('0xd7'),_0x8db2('0xd8'),_0x52b869['id']),moment()[_0x8db2('0xba')](_0x8db2('0xd9'))[_0x8db2('0x98')]())}}};var _0x5c1870={'channel':'Sms','account':_0x52b869[_0x8db2('0xce')][_0x8db2('0x2a')],'agent':_0x52b869['Owner']?_0x52b869[_0x8db2('0xcf')]['fullname']:_0x8db2('0xda'),'createdAt':moment(_0x52b869[_0x8db2('0x77')])[_0x8db2('0xba')](_0x8db2('0xbb'))[_0x8db2('0x98')](),'closedAt':_0x52b869[_0x8db2('0xdb')]?moment(_0x52b869[_0x8db2('0xdc')])[_0x8db2('0xba')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8db2('0x98')]():'','disposition':_0x52b869[_0x8db2('0xdd')],'messages':_(_0x52b869[_0x8db2('0xde')])[_0x8db2('0x83')]({'secret':![]})['map'](function(_0x3500c0){return{'date':moment(_0x3500c0['createdAt'])[_0x8db2('0xba')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8db2('0x98')](),'sender':_0x3500c0[_0x8db2('0xdf')]===_0x8db2('0xe0')?_0x3500c0[_0x8db2('0x6d')]?_0x3500c0['User'][_0x8db2('0x2e')]:_0x8db2('0xe1'):_0x3500c0[_0x8db2('0x61')][_0x8db2('0xcb')]+(_0x3500c0[_0x8db2('0x61')][_0x8db2('0xcc')]?'\x20'+_0x3500c0[_0x8db2('0x61')][_0x8db2('0xcc')]:''),'body':_0x3500c0[_0x8db2('0x71')],'direction':_0x3500c0[_0x8db2('0xdf')]==='out'?'A':'C','secret':_0x3500c0['secret'],'read':_0x3500c0['read']};})[_0x8db2('0x5d')]()};return ejs[_0x8db2('0xe2')](path[_0x8db2('0xc3')](config[_0x8db2('0xc4')],_0x8db2('0xc5'),_0x8db2('0xe3'),_0x8db2('0xe4')),{'interaction':_0x5c1870})[_0x8db2('0x27')](function(_0x4bb49c){return new BPromise(function(_0x257e31,_0x7c2479){pdf[_0x8db2('0xb1')](_0x4bb49c,_0x50fe87)[_0x8db2('0xe5')](path[_0x8db2('0xc3')](_0x361a48,_0x8db2('0xe6')+_0x52b869['id']+'-'+_0x6a2d5+'.pdf'),function(_0x233692,_0x348c7c){if(_0x233692)return _0x7c2479(_0x233692);_0x257e31(_0x348c7c);});});})['then'](function(){return new BPromise(function(_0x1d2479,_0x458f18){zipdir(_0x361a48,{'saveTo':_0x4ad5c5},function(_0x51a5d2,_0x1ce6ca){if(_0x51a5d2)return _0x458f18(_0x51a5d2);return _0x1d2479(_0x1ce6ca);});})['then'](function(){return new BPromise(function(_0x247bf6,_0x380bcb){rimraf(_0x361a48,function(_0x201d01){if(_0x201d01)_0x380bcb(_0x201d01);return _0x247bf6();});});})[_0x8db2('0x27')](function(){return _0x3bffd9[_0x8db2('0xc2')](_0x4ad5c5,_0x44da4b,function(_0x335cec){if(_0x335cec){console[_0x8db2('0xe7')]('err',_0x335cec);}else{fs['unlinkSync'](_0x4ad5c5);}});});});}else{return _0x3bffd9[_0x8db2('0x1c')](0xc8);}})['catch'](handleError(_0x3bffd9,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 8c3b63c..74bf004 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 _0x7f42=['hook','events','SmsInteraction','../../mysqldb','setMaxListeners','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x4799e,_0x1a8e02){var _0x562a32=function(_0x4c02ad){while(--_0x4c02ad){_0x4799e['push'](_0x4799e['shift']());}};_0x562a32(++_0x1a8e02);}(_0x7f42,0x1dd));var _0x27f4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7f42[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x27f4('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x27f4('0x1')];var SmsMessage=require(_0x27f4('0x2'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x27f4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x27f4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2ca4b0){return function(_0x55ed40,_0xe8eabe,_0x5c9286){_0x55ed40[_0x27f4('0x5')]({'attributes':['id'],'raw':!![]})[_0x27f4('0x6')](function(_0xd283e2){_0x55ed40[_0x27f4('0x7')](_0x27f4('0x8'),_0xd283e2[_0x27f4('0x9')](function(_0x458687){return{'id':_0x458687['id']};}));return SmsMessage[_0x27f4('0xa')]({'where':{'SmsInteractionId':_0x55ed40['id'],'direction':'in','read':![]},'raw':!![]});})[_0x27f4('0x6')](function(_0x453565){_0x55ed40[_0x27f4('0x7')](_0x27f4('0xb'),_0x453565[_0x27f4('0xc')]);SmsInteractionEvents[_0x27f4('0xd')](_0x2ca4b0+':'+_0x55ed40['id'],_0x55ed40);SmsInteractionEvents[_0x27f4('0xd')](_0x2ca4b0,_0x55ed40);_0x5c9286(null);})[_0x27f4('0xe')](_0x5c9286(null));};}for(var e in events){if(events[_0x27f4('0xf')](e)){var event=events[e];SmsInteraction[_0x27f4('0x10')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xee14=['Users','map','unreadMessages','length','emit','hasOwnProperty','hook','exports','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','then','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee14,0x13a));var _0x4ee1=function(_0x1c4be5,_0x28d332){_0x1c4be5=_0x1c4be5-0x0;var _0x70b8e8=_0xee14[_0x1c4be5];return _0x70b8e8;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0x4ee1('0x0')];var SmsMessage=require(_0x4ee1('0x1'))['db'][_0x4ee1('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4ee1('0x3')](0x0);var events={'afterCreate':_0x4ee1('0x4'),'afterUpdate':_0x4ee1('0x5'),'afterDestroy':_0x4ee1('0x6')};function emitEvent(_0x1e5fb6){return function(_0x3ccbc6,_0x4bc729,_0xba6d36){_0x3ccbc6['getUsers']({'attributes':['id'],'raw':!![]})[_0x4ee1('0x7')](function(_0x3a45a3){_0x3ccbc6[_0x4ee1('0x8')](_0x4ee1('0x9'),_0x3a45a3[_0x4ee1('0xa')](function(_0x1fd8c8){return{'id':_0x1fd8c8['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x3ccbc6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4ee1('0x7')](function(_0x38be25){_0x3ccbc6['setDataValue'](_0x4ee1('0xb'),_0x38be25[_0x4ee1('0xc')]);SmsInteractionEvents[_0x4ee1('0xd')](_0x1e5fb6+':'+_0x3ccbc6['id'],_0x3ccbc6);SmsInteractionEvents[_0x4ee1('0xd')](_0x1e5fb6,_0x3ccbc6);_0xba6d36(null);})['catch'](_0xba6d36(null));};}for(var e in events){if(events[_0x4ee1('0xe')](e)){var event=events[e];SmsInteraction[_0x4ee1('0xf')](e,emitEvent(event));}}module[_0x4ee1('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 8b11942..be946a0 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 _0xaa32=['closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./smsInteraction.attributes','define','sms_interactions','changed','closed'];(function(_0x4ae02f,_0x3d0288){var _0x924d5d=function(_0x6f047e){while(--_0x6f047e){_0x4ae02f['push'](_0x4ae02f['shift']());}};_0x924d5d(++_0x3d0288);}(_0xaa32,0x12e));var _0x2aa3=function(_0x61fd3a,_0x15a094){_0x61fd3a=_0x61fd3a-0x0;var _0x546d6b=_0xaa32[_0x61fd3a];return _0x546d6b;};'use strict';var _=require(_0x2aa3('0x0'));var util=require(_0x2aa3('0x1'));var logger=require(_0x2aa3('0x2'))(_0x2aa3('0x3'));var moment=require(_0x2aa3('0x4'));var BPromise=require(_0x2aa3('0x5'));var rp=require(_0x2aa3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2aa3('0x7'));var attributes=require(_0x2aa3('0x8'));module['exports']=function(_0xc2d879,_0x4a3534){return _0xc2d879[_0x2aa3('0x9')]('SmsInteraction',attributes,{'tableName':_0x2aa3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1d79b9,_0x2b1d33,_0x517109){if(_0x1d79b9[_0x2aa3('0xb')](_0x2aa3('0xc'))){_0x1d79b9[_0x2aa3('0xd')]=moment()[_0x2aa3('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x517109(null,_0x1d79b9);}}});}; \ No newline at end of file +var _0x6df1=['../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed','closedAt','format','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x3fd165,_0x5e2e2f){var _0x50f970=function(_0x3bc1f7){while(--_0x3bc1f7){_0x3fd165['push'](_0x3fd165['shift']());}};_0x50f970(++_0x5e2e2f);}(_0x6df1,0x90));var _0x16df=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x6df1[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');var util=require(_0x16df('0x0'));var logger=require('../../config/logger')(_0x16df('0x1'));var moment=require(_0x16df('0x2'));var BPromise=require(_0x16df('0x3'));var rp=require(_0x16df('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16df('0x5'));var config=require(_0x16df('0x6'));var attributes=require(_0x16df('0x7'));module[_0x16df('0x8')]=function(_0x295b28,_0x72f658){return _0x295b28[_0x16df('0x9')](_0x16df('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1df6b8,_0x48c41b,_0x4ba349){if(_0x1df6b8[_0x16df('0xb')](_0x16df('0xc'))){_0x1df6b8[_0x16df('0xd')]=moment()[_0x16df('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4ba349(null,_0x1df6b8);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 31b7f6c..769462e 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 _0x860a=['SmsInteraction','options','attributes','limit','AddTagsToSmsInteraction','where','addTags','body','ids','debug','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','localhost','socket.io-emitter','redis','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateSmsInteraction'];(function(_0x261e4f,_0x38f3a9){var _0xd9aba1=function(_0x4fd1f7){while(--_0x4fd1f7){_0x261e4f['push'](_0x261e4f['shift']());}};_0xd9aba1(++_0x38f3a9);}(_0x860a,0x133));var _0xa860=function(_0x987bc6,_0x54c62d){_0x987bc6=_0x987bc6-0x0;var _0x242e7c=_0x860a[_0x987bc6];return _0x242e7c;};'use strict';var _=require(_0xa860('0x0'));var util=require(_0xa860('0x1'));var moment=require(_0xa860('0x2'));var BPromise=require(_0xa860('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa860('0x4'));var db=require(_0xa860('0x5'))['db'];var utils=require(_0xa860('0x6'));var logger=require(_0xa860('0x7'))(_0xa860('0x8'));var config=require(_0xa860('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa860('0xa')][_0xa860('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xa860('0xc'),'port':0x18eb});var socket=require(_0xa860('0xd'))(new Redis(config[_0xa860('0xe')]));require('./smsInteraction.socket')[_0xa860('0xf')](socket);function respondWithRpcPromise(_0x30c578,_0x306a93,_0x2af3b8){return new BPromise(function(_0xd0c502,_0x5e8465){return client['request'](_0x30c578,_0x2af3b8)[_0xa860('0x10')](function(_0x44cb5d){logger[_0xa860('0x11')](_0xa860('0x12'),_0x306a93,_0xa860('0x13'));logger['debug'](_0xa860('0x14'),_0x306a93,_0xa860('0x13'),JSON[_0xa860('0x15')](_0x44cb5d));if(_0x44cb5d[_0xa860('0x16')]){if(_0x44cb5d[_0xa860('0x16')]['code']===0x1f4){logger[_0xa860('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x306a93,_0x44cb5d[_0xa860('0x16')]['message']);return _0x5e8465(_0x44cb5d[_0xa860('0x16')]['message']);}logger[_0xa860('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x306a93,_0x44cb5d['error'][_0xa860('0x17')]);return _0xd0c502(_0x44cb5d[_0xa860('0x16')][_0xa860('0x17')]);}else{logger[_0xa860('0x11')](_0xa860('0x12'),_0x306a93,_0xa860('0x13'));_0xd0c502(_0x44cb5d[_0xa860('0x18')][_0xa860('0x17')]);}})['catch'](function(_0x2c0fe8){logger[_0xa860('0x16')](_0xa860('0x12'),_0x306a93,_0x2c0fe8);_0x5e8465(_0x2c0fe8);});});}exports[_0xa860('0x19')]=function(_0x13008a){var _0x3b8123=this;return new Promise(function(_0x336b0b,_0x42ae72){return db[_0xa860('0x1a')]['update'](_0x13008a['body'],{'raw':_0x13008a['options']?_0x13008a['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13008a[_0xa860('0x1b')]?_0x13008a['options']['where']||null:null,'attributes':_0x13008a[_0xa860('0x1b')]?_0x13008a[_0xa860('0x1b')][_0xa860('0x1c')]||null:null,'limit':_0x13008a['options']?_0x13008a['options'][_0xa860('0x1d')]||null:null})['then'](function(_0xf41f90){logger['info'](_0xa860('0x19'),_0x13008a);logger['debug']('UpdateSmsInteraction',_0x13008a,JSON[_0xa860('0x15')](_0xf41f90));_0x336b0b(_0xf41f90);})['catch'](function(_0x383af2){logger['error'](_0xa860('0x19'),_0x383af2['message'],_0x13008a);_0x42ae72(_0x3b8123[_0xa860('0x16')](0x1f4,_0x383af2[_0xa860('0x17')]));});});};exports[_0xa860('0x1e')]=function(_0x1f3260){return new Promise(function(_0x5a3b9e,_0x48d005){return db[_0xa860('0x1a')]['find']({'where':_0x1f3260['options']?_0x1f3260[_0xa860('0x1b')][_0xa860('0x1f')]||null:null})[_0xa860('0x10')](function(_0x5cdab5){if(_0x5cdab5){return _0x5cdab5[_0xa860('0x20')](_0x1f3260[_0xa860('0x21')][_0xa860('0x22')],_['omit'](_0x1f3260[_0xa860('0x21')],[_0xa860('0x22'),'id'])||{});}})['spread'](function(_0x4c2148){logger[_0xa860('0x11')]('AddTags',_0x1f3260);logger[_0xa860('0x23')](_0xa860('0x24'),_0x1f3260,JSON[_0xa860('0x15')](_0x4c2148));_0x5a3b9e(_0x4c2148);})['catch'](function(_0x52ced3){logger['error'](_0xa860('0x24'),_0x52ced3[_0xa860('0x17')],_0x1f3260);_0x48d005(_this['error'](0x1f4,_0x52ced3['message']));});});}; \ No newline at end of file +var _0x6ab1=['result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','attributes','limit','stringify','find','addTags','body','ids','omit','spread','AddTags','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x6ab1,0x16a));var _0x16ab=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0x6ab1[_0x6e1239];return _0x418150;};'use strict';var _=require(_0x16ab('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x16ab('0x1'));var rs=require(_0x16ab('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x16ab('0x3'));var logger=require(_0x16ab('0x4'))(_0x16ab('0x5'));var config=require(_0x16ab('0x6'));var jayson=require(_0x16ab('0x7'));var client=jayson[_0x16ab('0x8')]['http']({'port':0x232a});config[_0x16ab('0x9')]=_[_0x16ab('0xa')](config[_0x16ab('0x9')],{'host':_0x16ab('0xb'),'port':0x18eb});var socket=require(_0x16ab('0xc'))(new Redis(config[_0x16ab('0x9')]));require(_0x16ab('0xd'))[_0x16ab('0xe')](socket);function respondWithRpcPromise(_0x2729af,_0x35edf2,_0x58a887){return new BPromise(function(_0x85de7c,_0x49b824){return client[_0x16ab('0xf')](_0x2729af,_0x58a887)[_0x16ab('0x10')](function(_0x4c9b29){logger[_0x16ab('0x11')](_0x16ab('0x12'),_0x35edf2,_0x16ab('0x13'));logger[_0x16ab('0x14')](_0x16ab('0x15'),_0x35edf2,_0x16ab('0x13'),JSON['stringify'](_0x4c9b29));if(_0x4c9b29[_0x16ab('0x16')]){if(_0x4c9b29[_0x16ab('0x16')][_0x16ab('0x17')]===0x1f4){logger[_0x16ab('0x16')](_0x16ab('0x12'),_0x35edf2,_0x4c9b29[_0x16ab('0x16')][_0x16ab('0x18')]);return _0x49b824(_0x4c9b29[_0x16ab('0x16')][_0x16ab('0x18')]);}logger[_0x16ab('0x16')](_0x16ab('0x12'),_0x35edf2,_0x4c9b29[_0x16ab('0x16')][_0x16ab('0x18')]);return _0x85de7c(_0x4c9b29['error'][_0x16ab('0x18')]);}else{logger[_0x16ab('0x11')](_0x16ab('0x12'),_0x35edf2,_0x16ab('0x13'));_0x85de7c(_0x4c9b29[_0x16ab('0x19')][_0x16ab('0x18')]);}})[_0x16ab('0x1a')](function(_0x220aa4){logger['error'](_0x16ab('0x12'),_0x35edf2,_0x220aa4);_0x49b824(_0x220aa4);});});}exports[_0x16ab('0x1b')]=function(_0x419dcd){var _0x30b111=this;return new Promise(function(_0x3eb7a9,_0x492f56){return db[_0x16ab('0x1c')][_0x16ab('0x1d')](_0x419dcd['body'],{'raw':_0x419dcd[_0x16ab('0x1e')]?_0x419dcd[_0x16ab('0x1e')][_0x16ab('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x419dcd[_0x16ab('0x1e')]?_0x419dcd['options'][_0x16ab('0x20')]||null:null,'attributes':_0x419dcd[_0x16ab('0x1e')]?_0x419dcd['options'][_0x16ab('0x21')]||null:null,'limit':_0x419dcd[_0x16ab('0x1e')]?_0x419dcd[_0x16ab('0x1e')][_0x16ab('0x22')]||null:null})[_0x16ab('0x10')](function(_0x151d07){logger[_0x16ab('0x11')](_0x16ab('0x1b'),_0x419dcd);logger[_0x16ab('0x14')](_0x16ab('0x1b'),_0x419dcd,JSON[_0x16ab('0x23')](_0x151d07));_0x3eb7a9(_0x151d07);})[_0x16ab('0x1a')](function(_0x419786){logger[_0x16ab('0x16')](_0x16ab('0x1b'),_0x419786['message'],_0x419dcd);_0x492f56(_0x30b111['error'](0x1f4,_0x419786[_0x16ab('0x18')]));});});};exports['AddTagsToSmsInteraction']=function(_0x547c29){return new Promise(function(_0x16bca5,_0xf8dc3c){return db[_0x16ab('0x1c')][_0x16ab('0x24')]({'where':_0x547c29[_0x16ab('0x1e')]?_0x547c29[_0x16ab('0x1e')]['where']||null:null})[_0x16ab('0x10')](function(_0x2914e3){if(_0x2914e3){return _0x2914e3[_0x16ab('0x25')](_0x547c29[_0x16ab('0x26')][_0x16ab('0x27')],_[_0x16ab('0x28')](_0x547c29[_0x16ab('0x26')],[_0x16ab('0x27'),'id'])||{});}})[_0x16ab('0x29')](function(_0x4c490f){logger['info']('AddTags',_0x547c29);logger['debug'](_0x16ab('0x2a'),_0x547c29,JSON[_0x16ab('0x23')](_0x4c490f));_0x16bca5(_0x4c490f);})[_0x16ab('0x1a')](function(_0x5a4440){logger[_0x16ab('0x16')]('AddTags',_0x5a4440[_0x16ab('0x18')],_0x547c29);_0xf8dc3c(_this[_0x16ab('0x16')](0x1f4,_0x5a4440[_0x16ab('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index de414ae..7e7bc39 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 _0x5f66=['length','smsInteraction:','save','update','emit','register'];(function(_0x1942e9,_0x23ce7b){var _0x134f06=function(_0xc8f0ef){while(--_0xc8f0ef){_0x1942e9['push'](_0x1942e9['shift']());}};_0x134f06(++_0x23ce7b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'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 +var _0xb10b=['emit','removeListener','register','smsInteraction:','./smsInteraction.events','remove','update'];(function(_0x493985,_0xabbee5){var _0x532b94=function(_0x150fbc){while(--_0x150fbc){_0x493985['push'](_0x493985['shift']());}};_0x532b94(++_0xabbee5);}(_0xb10b,0x12a));var _0xbb10=function(_0x36fc1f,_0x27c1c8){_0x36fc1f=_0x36fc1f-0x0;var _0x371281=_0xb10b[_0x36fc1f];return _0x371281;};'use strict';var SmsInteractionEvents=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(){SmsInteractionEvents[_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);SmsInteractionEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index a45dfaf..3391baf 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 _0x11a6=['/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','show','sms','smsmessage:create','create','post','/:id','put','accept'];(function(_0x4c5ba5,_0x513b37){var _0xaa8afe=function(_0x14260f){while(--_0x14260f){_0x4c5ba5['push'](_0x4c5ba5['shift']());}};_0xaa8afe(++_0x513b37);}(_0x11a6,0x1c7));var _0x611a=function(_0x2f684a,_0x122a29){_0x2f684a=_0x2f684a-0x0;var _0x5b1afe=_0x11a6[_0x2f684a];return _0x5b1afe;};'use strict';var multer=require(_0x611a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x611a('0x1'));var express=require(_0x611a('0x2'));var router=express[_0x611a('0x3')]();var auth=require(_0x611a('0x4'));var interaction=require(_0x611a('0x5'));var config=require(_0x611a('0x6'));var controller=require(_0x611a('0x7'));router[_0x611a('0x8')]('/',auth['isAuthenticated'](),controller[_0x611a('0x9')]);router[_0x611a('0x8')](_0x611a('0xa'),auth[_0x611a('0xb')](),controller['describe']);router[_0x611a('0x8')]('/:id',auth[_0x611a('0xb')](),controller[_0x611a('0xc')]);router['post']('/',auth[_0x611a('0xb')](),interaction['tracked'](_0x611a('0xd'),_0x611a('0xe')),controller[_0x611a('0xf')]);router[_0x611a('0x10')]('/:id/status',controller['status']);router['put'](_0x611a('0x11'),auth[_0x611a('0xb')](),controller['update']);router[_0x611a('0x12')]('/:id/accept',auth[_0x611a('0xb')](),controller[_0x611a('0x13')]);router[_0x611a('0x12')](_0x611a('0x14'),auth['isAuthenticated'](),controller[_0x611a('0x15')]);router[_0x611a('0x16')](_0x611a('0x11'),auth['isAuthenticated'](),controller[_0x611a('0x17')]);module[_0x611a('0x18')]=router; \ No newline at end of file +var _0x85a6=['exports','multer','path','express','../../components/auth/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','create','status','update','put','/:id/reject','delete','destroy'];(function(_0x4a7e98,_0x250137){var _0x27d10d=function(_0x378768){while(--_0x378768){_0x4a7e98['push'](_0x4a7e98['shift']());}};_0x27d10d(++_0x250137);}(_0x85a6,0x169));var _0x685a=function(_0x5710a1,_0x1b114b){_0x5710a1=_0x5710a1-0x0;var _0x1557f8=_0x85a6[_0x5710a1];return _0x1557f8;};'use strict';var multer=require(_0x685a('0x0'));var util=require('util');var path=require(_0x685a('0x1'));var timeout=require('connect-timeout');var express=require(_0x685a('0x2'));var router=express['Router']();var auth=require(_0x685a('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x685a('0x4'));router[_0x685a('0x5')]('/',auth[_0x685a('0x6')](),controller[_0x685a('0x7')]);router['get'](_0x685a('0x8'),auth[_0x685a('0x6')](),controller[_0x685a('0x9')]);router[_0x685a('0x5')](_0x685a('0xa'),auth[_0x685a('0x6')](),controller[_0x685a('0xb')]);router[_0x685a('0xc')]('/',auth[_0x685a('0x6')](),interaction[_0x685a('0xd')](_0x685a('0xe'),_0x685a('0xf')),controller[_0x685a('0x10')]);router[_0x685a('0xc')]('/:id/status',controller[_0x685a('0x11')]);router['put']('/:id',auth[_0x685a('0x6')](),controller[_0x685a('0x12')]);router[_0x685a('0x13')]('/:id/accept',auth[_0x685a('0x6')](),controller['accept']);router[_0x685a('0x13')](_0x685a('0x14'),auth['isAuthenticated'](),controller['reject']);router[_0x685a('0x15')](_0x685a('0xa'),auth[_0x685a('0x6')](),controller[_0x685a('0x16')]);module[_0x685a('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index e917d4f..86a6448 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 _0x86a8=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x86a8,0x1ae));var _0x886a=function(_0x4a0ef0,_0x2a9d86){_0x4a0ef0=_0x4a0ef0-0x0;var _0x2fae14=_0x86a8[_0x4a0ef0];return _0x2fae14;};'use strict';var Sequelize=require(_0x886a('0x0'));module[_0x886a('0x1')]={'body':{'type':Sequelize[_0x886a('0x2')](_0x886a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x886a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x886a('0x5')]('in','out'),'defaultValue':_0x886a('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x886a('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x886a('0x8')]},'secret':{'type':Sequelize[_0x886a('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xe334=['ENUM','out','STRING','sequelize','TEXT','medium','BOOLEAN'];(function(_0x14789c,_0x312af4){var _0x138d3b=function(_0x27dcb2){while(--_0x27dcb2){_0x14789c['push'](_0x14789c['shift']());}};_0x138d3b(++_0x312af4);}(_0xe334,0x199));var _0x4e33=function(_0x344f03,_0xdb2349){_0x344f03=_0x344f03-0x0;var _0x2c89e9=_0xe334[_0x344f03];return _0x2c89e9;};'use strict';var Sequelize=require(_0x4e33('0x0'));module['exports']={'body':{'type':Sequelize[_0x4e33('0x1')](_0x4e33('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4e33('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4e33('0x4')]('in',_0x4e33('0x5')),'defaultValue':_0x4e33('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4e33('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x4e33('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 2c1d54f..7c86001 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 _0x96d4=['api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','sendStatus','status','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','merge','type','filter','includeAll','include','findAll','rows','catch','show','length','options','find','create','body','params','describe','sms-interactions','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteractionId','isNil','interaction','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','../../config/logger','agent','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','rejectmessage','SmsAccount','SmsAccountId','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','messageId','sent','Status','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0x96d4,0x18d));var _0x496d=function(_0x347588,_0x2144ea){_0x347588=_0x347588-0x0;var _0x3c81ed=_0x96d4[_0x347588];return _0x3c81ed;};'use strict';var pdf=require(_0x496d('0x0'));var emlformat=require(_0x496d('0x1'));var rimraf=require(_0x496d('0x2'));var zipdir=require(_0x496d('0x3'));var jsonpatch=require(_0x496d('0x4'));var rp=require('request-promise');var moment=require(_0x496d('0x5'));var BPromise=require(_0x496d('0x6'));var Mustache=require(_0x496d('0x7'));var util=require(_0x496d('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x496d('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x496d('0xa'));var squel=require(_0x496d('0xb'));var crypto=require(_0x496d('0xc'));var jsforce=require(_0x496d('0xd'));var deskjs=require(_0x496d('0xe'));var toCsv=require(_0x496d('0x9'));var querystring=require(_0x496d('0xf'));var Papa=require(_0x496d('0x10'));var Redis=require(_0x496d('0x11'));var authService=require(_0x496d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x496d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x496d('0x14'));var utils=require('../../config/utils');var config=require(_0x496d('0x15'));var db=require(_0x496d('0x16'))['db'];config[_0x496d('0x17')]=_[_0x496d('0x18')](config[_0x496d('0x17')],{'host':_0x496d('0x19'),'port':0x18eb});var socket=require(_0x496d('0x1a'))(new Redis(config[_0x496d('0x17')]));require(_0x496d('0x1b'))['register'](socket);var jayson=require(_0x496d('0x1c'));var client=jayson[_0x496d('0x1d')][_0x496d('0x1e')]({'port':0x232c});var client9002=jayson[_0x496d('0x1d')][_0x496d('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x5bb223,_0x212c51,_0x257dc9){if(_0x257dc9){var _0x26a588=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x26a588[_0x496d('0x1f')](_0x212c51)){return _0x5bb223;}else{throw new db[(_0x496d('0x20'))][(_0x496d('0x21'))](_0x496d('0x22'));}}else{return _0x5bb223;}}function respondWithRpcPromise(_0x2220d7,_0x65fa87,_0x42d963,_0x58660a){return new BPromise(function(_0x15a985,_0x3e92c0){var _0x57687a=_0x58660a||client;return _0x57687a['request'](_0x2220d7,_0x42d963)[_0x496d('0x23')](function(_0x44786f){logger[_0x496d('0x24')]('SmsMessage,\x20%s,\x20%s',_0x65fa87,_0x496d('0x25'));logger[_0x496d('0x26')](_0x496d('0x27'),_0x65fa87,_0x496d('0x25'),JSON[_0x496d('0x28')](_0x44786f));if(_0x44786f[_0x496d('0x29')]){if(_0x44786f[_0x496d('0x29')][_0x496d('0x2a')]===0x1f4){logger[_0x496d('0x29')](_0x496d('0x2b'),_0x65fa87,_0x44786f[_0x496d('0x29')][_0x496d('0x2c')]);return _0x3e92c0(_0x44786f[_0x496d('0x29')][_0x496d('0x2c')]);}logger[_0x496d('0x29')](_0x496d('0x2b'),_0x65fa87,_0x44786f['error'][_0x496d('0x2c')]);return _0x15a985(_0x44786f['error'][_0x496d('0x2c')]);}else{logger['info'](_0x496d('0x2b'),_0x65fa87,_0x496d('0x25'));_0x15a985(_0x44786f[_0x496d('0x2d')][_0x496d('0x2c')]);}})['catch'](function(_0x2d65e4){logger[_0x496d('0x29')](_0x496d('0x2b'),_0x65fa87,_0x2d65e4);_0x3e92c0(_0x2d65e4);});});}function respondWithStatusCode(_0x1ef443,_0x2770f){_0x2770f=_0x2770f||0xcc;return function(_0xc8792d){if(_0xc8792d){return _0x1ef443[_0x496d('0x2e')](_0x2770f);}return _0x1ef443[_0x496d('0x2f')](_0x2770f)['end']();};}function respondWithResult(_0x1205f9,_0x293933){_0x293933=_0x293933||0xc8;return function(_0x11bf54){if(_0x11bf54){return _0x1205f9[_0x496d('0x2f')](_0x293933)['json'](_0x11bf54);}};}function respondWithFilteredResult(_0x1c20e3,_0x54c37c){return function(_0x32cde6){if(_0x32cde6){var _0x3c4bee=_0x32cde6[_0x496d('0x30')],_0x131491=_0x54c37c['offset'],_0x702c15=_0x54c37c[_0x496d('0x31')]+_0x54c37c[_0x496d('0x32')],_0x830e0d;if(_0x702c15>=_0x3c4bee){_0x702c15=_0x3c4bee;_0x830e0d=0xc8;}else{_0x830e0d=0xce;}_0x1c20e3[_0x496d('0x2f')](_0x830e0d);return _0x1c20e3['set'](_0x496d('0x33'),_0x131491+'-'+_0x702c15+'/'+_0x3c4bee)[_0x496d('0x34')](_0x32cde6);}return null;};}function patchUpdates(_0x5060bb){return function(_0x287cdf){try{jsonpatch[_0x496d('0x35')](_0x287cdf,_0x5060bb,!![]);}catch(_0x585988){return BPromise[_0x496d('0x36')](_0x585988);}return _0x287cdf[_0x496d('0x37')]();};}function saveUpdates(_0x5d8857,_0x4744d2){return function(_0x27323b){if(_0x27323b){return _0x27323b[_0x496d('0x38')](_0x5d8857)[_0x496d('0x23')](function(_0x5798c1){return _0x5798c1;});}return null;};}function removeEntity(_0x5ead27,_0x28ed00){return function(_0x56b21f){if(_0x56b21f){return _0x56b21f[_0x496d('0x39')]()[_0x496d('0x23')](function(){_0x5ead27[_0x496d('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3595fe,_0x4ccd78){return function(_0x3d9ad7){if(!_0x3d9ad7){_0x3595fe['sendStatus'](0x194);}return _0x3d9ad7;};}function handleError(_0x4b8b5e,_0x122253){_0x122253=_0x122253||0x1f4;return function(_0x82d746){logger[_0x496d('0x29')](_0x82d746[_0x496d('0x3a')]);if(_0x82d746[_0x496d('0x3b')]){delete _0x82d746['name'];}_0x4b8b5e[_0x496d('0x2f')](_0x122253)[_0x496d('0x3c')](_0x82d746);};}exports[_0x496d('0x3d')]=function(_0xa0757b,_0x33c235){var _0x5b9eb1={},_0x3ed969={},_0x11336c={'count':0x0,'rows':[]};var _0xbf32fd=_[_0x496d('0x3e')](db[_0x496d('0x3f')][_0x496d('0x40')],function(_0x3d370b){return{'name':_0x3d370b[_0x496d('0x41')],'type':_0x3d370b['type'][_0x496d('0x42')]};});_0x3ed969[_0x496d('0x43')]=_[_0x496d('0x3e')](_0xbf32fd,_0x496d('0x3b'));_0x3ed969['query']=_[_0x496d('0x44')](_0xa0757b[_0x496d('0x45')]);_0x3ed969[_0x496d('0x46')]=_[_0x496d('0x47')](_0x3ed969['model'],_0x3ed969[_0x496d('0x45')]);_0x5b9eb1[_0x496d('0x48')]=_[_0x496d('0x47')](_0x3ed969[_0x496d('0x43')],qs['fields'](_0xa0757b['query'][_0x496d('0x49')]));_0x5b9eb1[_0x496d('0x48')]=_0x5b9eb1[_0x496d('0x48')]['length']?_0x5b9eb1[_0x496d('0x48')]:_0x3ed969[_0x496d('0x43')];if(!_0xa0757b['query'][_0x496d('0x4a')]('nolimit')){_0x5b9eb1[_0x496d('0x32')]=qs['limit'](_0xa0757b['query'][_0x496d('0x32')]);_0x5b9eb1[_0x496d('0x31')]=qs[_0x496d('0x31')](_0xa0757b[_0x496d('0x45')]['offset']);}_0x5b9eb1['order']=qs[_0x496d('0x4b')](_0xa0757b[_0x496d('0x45')][_0x496d('0x4b')]);_0x5b9eb1['where']=qs['filters'](_['pick'](_0xa0757b['query'],_0x3ed969[_0x496d('0x46')]));if(_0xa0757b[_0x496d('0x45')]['filter']){_0x5b9eb1[_0x496d('0x4c')]=_[_0x496d('0x4d')](_0x5b9eb1['where'],{'$or':_[_0x496d('0x3e')](_0xbf32fd,function(_0x420eb5){if(_0x420eb5[_0x496d('0x4e')]!=='VIRTUAL'){var _0x51fdfb={};_0x51fdfb[_0x420eb5[_0x496d('0x3b')]]={'$like':'%'+_0xa0757b[_0x496d('0x45')][_0x496d('0x4f')]+'%'};return _0x51fdfb;}})});}_0x5b9eb1=_['merge']({},_0x5b9eb1,_0xa0757b['options']);var _0x1de519={'where':_0x5b9eb1[_0x496d('0x4c')]};return db[_0x496d('0x3f')][_0x496d('0x30')](_0x1de519)[_0x496d('0x23')](function(_0x2b2b09){_0x11336c[_0x496d('0x30')]=_0x2b2b09;if(_0xa0757b[_0x496d('0x45')][_0x496d('0x50')]){_0x5b9eb1[_0x496d('0x51')]=[{'all':!![]}];}return db[_0x496d('0x3f')][_0x496d('0x52')](_0x5b9eb1);})['then'](function(_0x5d806f){_0x11336c[_0x496d('0x53')]=_0x5d806f;return _0x11336c;})[_0x496d('0x23')](respondWithFilteredResult(_0x33c235,_0x5b9eb1))[_0x496d('0x54')](handleError(_0x33c235,null));};exports[_0x496d('0x55')]=function(_0x2116b1,_0x5da180){var _0xdb3b8d={'raw':!![],'where':{'id':_0x2116b1['params']['id']}},_0x1b9db8={};_0x1b9db8[_0x496d('0x43')]=_[_0x496d('0x44')](db[_0x496d('0x3f')]['rawAttributes']);_0x1b9db8['query']=_[_0x496d('0x44')](_0x2116b1[_0x496d('0x45')]);_0x1b9db8['filters']=_[_0x496d('0x47')](_0x1b9db8[_0x496d('0x43')],_0x1b9db8[_0x496d('0x45')]);_0xdb3b8d[_0x496d('0x48')]=_[_0x496d('0x47')](_0x1b9db8[_0x496d('0x43')],qs['fields'](_0x2116b1[_0x496d('0x45')][_0x496d('0x49')]));_0xdb3b8d['attributes']=_0xdb3b8d[_0x496d('0x48')][_0x496d('0x56')]?_0xdb3b8d['attributes']:_0x1b9db8[_0x496d('0x43')];if(_0x2116b1[_0x496d('0x45')][_0x496d('0x50')]){_0xdb3b8d[_0x496d('0x51')]=[{'all':!![]}];}_0xdb3b8d=_[_0x496d('0x4d')]({},_0xdb3b8d,_0x2116b1[_0x496d('0x57')]);return db['SmsMessage'][_0x496d('0x58')](_0xdb3b8d)[_0x496d('0x23')](handleEntityNotFound(_0x5da180,null))['then'](respondWithResult(_0x5da180,null))[_0x496d('0x54')](handleError(_0x5da180,null));};exports[_0x496d('0x59')]=function(_0x170799,_0x32bcb8){return db[_0x496d('0x3f')][_0x496d('0x59')](_0x170799[_0x496d('0x5a')],{})[_0x496d('0x23')](respondWithResult(_0x32bcb8,0xc9))[_0x496d('0x54')](handleError(_0x32bcb8,null));};exports[_0x496d('0x38')]=function(_0x1cad4e,_0x3725b3){if(_0x1cad4e[_0x496d('0x5a')]['id']){delete _0x1cad4e[_0x496d('0x5a')]['id'];}return db[_0x496d('0x3f')][_0x496d('0x58')]({'where':{'id':_0x1cad4e[_0x496d('0x5b')]['id']}})[_0x496d('0x23')](handleEntityNotFound(_0x3725b3,null))[_0x496d('0x23')](saveUpdates(_0x1cad4e[_0x496d('0x5a')],null))['then'](respondWithResult(_0x3725b3,null))[_0x496d('0x54')](handleError(_0x3725b3,null));};exports['destroy']=function(_0x33c270,_0x265918){return db[_0x496d('0x3f')][_0x496d('0x58')]({'where':{'id':_0x33c270[_0x496d('0x5b')]['id']}})[_0x496d('0x23')](handleEntityNotFound(_0x265918,null))['then'](removeEntity(_0x265918,null))[_0x496d('0x54')](handleError(_0x265918,null));};exports[_0x496d('0x5c')]=function(_0x1d0803,_0x55f455){return db[_0x496d('0x3f')][_0x496d('0x5c')]()['then'](respondWithResult(_0x55f455,null))[_0x496d('0x54')](handleError(_0x55f455,null));};var interaction_log=require('../../config/logger')(_0x496d('0x5d'));exports['accept']=function(_0x363262,_0x242c11,_0x50fb1a){var _0x1ef9d9={'channel':'sms'};if(_0x363262[_0x496d('0x5a')]['id']){delete _0x363262[_0x496d('0x5a')]['id'];}_0x363262[_0x496d('0x5a')][_0x496d('0x5e')]=!![];_0x363262[_0x496d('0x5a')]['readAt']=moment()[_0x496d('0x5f')](_0x496d('0x60'));_0x363262['body'][_0x496d('0x61')]=_0x363262[_0x496d('0x5a')][_0x496d('0x61')]||_0x363262[_0x496d('0x62')]['id'];return db[_0x496d('0x3f')]['find']({'where':{'id':_0x363262[_0x496d('0x5b')]['id'],'UserId':null},'include':[{'model':db[_0x496d('0x63')],'as':_0x496d('0x64')}]})['then'](handleEntityNotFound(_0x242c11,null))[_0x496d('0x23')](saveUpdates(_0x363262[_0x496d('0x5a')],null))[_0x496d('0x23')](function(_0x4ceb69){if(_0x4ceb69){_0x1ef9d9[_0x496d('0x2c')]=_0x4ceb69[_0x496d('0x65')]({'plain':!![]});return db['SmsInteraction'][_0x496d('0x58')]({'where':{'id':_0x4ceb69[_0x496d('0x66')]}});}return null;})[_0x496d('0x23')](handleEntityNotFound(_0x242c11,null))[_0x496d('0x23')](function(_0x33419e){if(_0x33419e){return _0x33419e['update']({'UserId':_0x363262[_0x496d('0x5a')]['UserId'],'read1stAt':_[_0x496d('0x67')](_0x33419e['read1stAt'])?moment()[_0x496d('0x5f')](_0x496d('0x60')):undefined});}return null;})[_0x496d('0x23')](function(_0x545f2e){if(_0x545f2e){_0x1ef9d9[_0x496d('0x68')]=_0x545f2e[_0x496d('0x65')]({'plain':!![]});interaction_log[_0x496d('0x24')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x363262[_0x496d('0x62')]['id'],_0x363262['user'][_0x496d('0x3b')],_0x363262[_0x496d('0x62')][_0x496d('0x69')],_0x1ef9d9[_0x496d('0x68')]['id'],_0x363262['body']?JSON[_0x496d('0x28')](_0x363262['body']):'null');return respondWithRpcPromise(_0x496d('0x6a'),_0x496d('0x6b'),_0x1ef9d9);}return null;})[_0x496d('0x23')](function(_0x1b42fd){if(_0x1b42fd){if(_0x363262[_0x496d('0x5a')][_0x496d('0x6c')]){_0x1ef9d9[_0x496d('0x2c')][_0x496d('0x6d')]=util['format'](_0x496d('0x6e'),_0x363262[_0x496d('0x62')][_0x496d('0x3b')]);_0x1ef9d9[_0x496d('0x2c')][_0x496d('0x6f')]=_0x1ef9d9[_0x496d('0x6f')];_0x1ef9d9[_0x496d('0x2c')][_0x496d('0x70')]=_0x496d('0x71');return respondWithRpcPromise(_0x496d('0x72'),_0x496d('0x72'),{'event':'acceptmessage','message':_0x1ef9d9['message']},client9002)[_0x496d('0x23')](function(){return _0x1ef9d9;});}return _0x1ef9d9;}return null;})[_0x496d('0x23')](respondWithResult(_0x242c11,null))['catch'](handleError(_0x242c11,null));};var interaction_log=require(_0x496d('0x73'))('sms-interactions');exports[_0x496d('0x36')]=function(_0x310a60,_0x33e614,_0x504846){var _0x2de738={'agent':{},'channel':'sms'};if(_0x310a60[_0x496d('0x5a')]['id']){delete _0x310a60[_0x496d('0x5a')]['id'];}_0x310a60['body'][_0x496d('0x61')]=_0x310a60[_0x496d('0x5a')][_0x496d('0x61')]||_0x310a60['user']['id'];_0x2de738[_0x496d('0x74')]['id']=_0x310a60[_0x496d('0x5a')][_0x496d('0x61')];return db[_0x496d('0x3f')]['find']({'where':{'id':_0x310a60['params']['id'],'UserId':null}})[_0x496d('0x23')](handleEntityNotFound(_0x33e614,null))[_0x496d('0x23')](function(_0x15f148){if(_0x15f148){_0x2de738[_0x496d('0x2c')]=_0x15f148[_0x496d('0x65')]({'plain':!![]});return db[_0x496d('0x75')]['find']({'where':{'id':_0x15f148['SmsInteractionId']}});}return null;})[_0x496d('0x23')](handleEntityNotFound(_0x33e614,null))[_0x496d('0x23')](function(_0x1c7ced){if(_0x1c7ced){_0x2de738[_0x496d('0x68')]=_0x1c7ced['get']({'plain':!![]});interaction_log[_0x496d('0x24')](_0x496d('0x76'),_0x310a60[_0x496d('0x62')]['id'],_0x310a60[_0x496d('0x62')]['name'],_0x310a60[_0x496d('0x62')][_0x496d('0x69')],_0x2de738['interaction']['id'],_0x310a60[_0x496d('0x5a')]?JSON[_0x496d('0x28')](_0x310a60[_0x496d('0x5a')]):_0x496d('0x77'));return respondWithRpcPromise(_0x496d('0x78'),_0x496d('0x79'),_0x2de738);}return null;})['then'](function(_0x1cdf96){if(_0x1cdf96){_0x1cdf96[_0x496d('0x2c')][_0x496d('0x6d')]=util[_0x496d('0x5f')](_0x496d('0x6e'),_0x310a60[_0x496d('0x62')]['name']);_0x1cdf96[_0x496d('0x2c')][_0x496d('0x6f')]=_0x2de738['channel'];_0x1cdf96[_0x496d('0x2c')][_0x496d('0x70')]=_0x496d('0x36');respondWithRpcPromise(_0x496d('0x72'),_0x496d('0x72'),{'event':_0x496d('0x7a'),'message':_0x1cdf96[_0x496d('0x2c')]},client9002);return _0x2de738;}return null;})[_0x496d('0x23')](respondWithResult(_0x33e614,null))[_0x496d('0x54')](handleError(_0x33e614,null));};exports[_0x496d('0x2f')]=function(_0x4b461b,_0x50538a,_0x49e18c){if(_0x4b461b[_0x496d('0x5a')]['id']){delete _0x4b461b[_0x496d('0x5a')]['id'];}var _0x53cd34;return db[_0x496d('0x3f')]['find']({'where':{'id':_0x4b461b['params']['id']}})[_0x496d('0x23')](handleEntityNotFound(_0x50538a,null))['then'](function(_0x1195bc){if(_0x1195bc){_0x53cd34=_0x1195bc;return db[_0x496d('0x7b')][_0x496d('0x58')]({'where':{'id':_0x1195bc[_0x496d('0x7c')]}});}})[_0x496d('0x23')](handleEntityNotFound(_0x50538a,null))['then'](function(_0x874268){if(_0x874268){logger[_0x496d('0x26')](_0x496d('0x27'),_0x496d('0x2f'),'received\x20delivery\x20report\x20from',_0x874268[_0x496d('0x4e')],util['inspect'](_0x4b461b['body'],{'showHidden':![],'depth':null}));switch(_0x874268[_0x496d('0x4e')]){case _0x496d('0x7d'):if(_0x4b461b[_0x496d('0x5a')][_0x496d('0x7e')]&&_0x4b461b[_0x496d('0x5a')][_0x496d('0x7e')]===_0x53cd34['messageId']){return _0x53cd34[_0x496d('0x38')]({'read':!![]});}else{logger[_0x496d('0x29')](_0x496d('0x7f'),_0x496d('0x2f'),_0x496d('0x7d'),util[_0x496d('0x80')](_0x4b461b[_0x496d('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x496d('0x81'):if(_0x4b461b[_0x496d('0x5a')][_0x496d('0x82')]&&_0x4b461b[_0x496d('0x5a')][_0x496d('0x82')]===_0x53cd34[_0x496d('0x83')]&&_['indexOf']([_0x496d('0x84'),'delivered'],_0x4b461b['body'][_0x496d('0x85')])>=0x0){return _0x53cd34[_0x496d('0x38')]({'read':!![]});}else{logger[_0x496d('0x29')](_0x496d('0x7f'),_0x496d('0x2f'),_0x496d('0x86'),util[_0x496d('0x80')](_0x4b461b[_0x496d('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x496d('0x87'):var _0x5941ee=_0x4b461b[_0x496d('0x5a')][_0x496d('0x88')][0x0];if(_0x5941ee[_0x496d('0x2f')][_0x496d('0x89')]===_0x496d('0x8a')){return _0x53cd34['update']({'read':!![]});}else{logger['error'](_0x496d('0x7f'),_0x496d('0x2f'),'infobip',util[_0x496d('0x80')](_0x4b461b[_0x496d('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x53cd34;}})[_0x496d('0x23')](respondWithResult(_0x50538a,null))['catch'](handleError(_0x50538a,null));}; \ No newline at end of file +var _0x8830=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','save','update','destroy','sendStatus','name','send','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','type','VIRTUAL','SmsMessage','includeAll','findAll','show','params','keys','options','create','body','find','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','SmsInteractionId','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','reject','agent','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','RejectMessage','rejectmessage','SmsAccount','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','delivered','plivio','infobip','results','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','crypto'];(function(_0x58e4f4,_0x4d5b21){var _0x11b532=function(_0x100104){while(--_0x100104){_0x58e4f4['push'](_0x58e4f4['shift']());}};_0x11b532(++_0x4d5b21);}(_0x8830,0x78));var _0x0883=function(_0x233dc0,_0x2866ad){_0x233dc0=_0x233dc0-0x0;var _0x1fc160=_0x8830[_0x233dc0];return _0x1fc160;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0883('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0883('0x1'));var jsonpatch=require(_0x0883('0x2'));var rp=require(_0x0883('0x3'));var moment=require(_0x0883('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0883('0x5'));var util=require('util');var path=require(_0x0883('0x6'));var sox=require(_0x0883('0x7'));var csv=require(_0x0883('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0883('0x9'));var squel=require(_0x0883('0xa'));var crypto=require(_0x0883('0xb'));var jsforce=require(_0x0883('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0883('0x8'));var querystring=require(_0x0883('0xd'));var Papa=require(_0x0883('0xe'));var Redis=require(_0x0883('0xf'));var authService=require(_0x0883('0x10'));var qs=require(_0x0883('0x11'));var as=require(_0x0883('0x12'));var hardwareService=require(_0x0883('0x13'));var logger=require(_0x0883('0x14'))(_0x0883('0x15'));var utils=require(_0x0883('0x16'));var config=require(_0x0883('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0883('0x18')](config[_0x0883('0x19')],{'host':_0x0883('0x1a'),'port':0x18eb});var socket=require(_0x0883('0x1b'))(new Redis(config['redis']));require(_0x0883('0x1c'))['register'](socket);var jayson=require(_0x0883('0x1d'));var client=jayson[_0x0883('0x1e')][_0x0883('0x1f')]({'port':0x232c});var client9002=jayson[_0x0883('0x1e')][_0x0883('0x1f')]({'port':0x232a});function checkPasswordPattern(_0xa5237e,_0x59bafb,_0x28e700){if(_0x28e700){var _0x54e39a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x54e39a[_0x0883('0x20')](_0x59bafb)){return _0xa5237e;}else{throw new db[(_0x0883('0x21'))][(_0x0883('0x22'))](_0x0883('0x23'));}}else{return _0xa5237e;}}function respondWithRpcPromise(_0x29ad85,_0xa6cf0f,_0x540233,_0x494888){return new BPromise(function(_0x5f1b8d,_0x367459){var _0x361307=_0x494888||client;return _0x361307[_0x0883('0x24')](_0x29ad85,_0x540233)[_0x0883('0x25')](function(_0x110987){logger[_0x0883('0x26')](_0x0883('0x27'),_0xa6cf0f,_0x0883('0x28'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa6cf0f,_0x0883('0x28'),JSON['stringify'](_0x110987));if(_0x110987[_0x0883('0x29')]){if(_0x110987[_0x0883('0x29')][_0x0883('0x2a')]===0x1f4){logger[_0x0883('0x29')](_0x0883('0x27'),_0xa6cf0f,_0x110987[_0x0883('0x29')][_0x0883('0x2b')]);return _0x367459(_0x110987[_0x0883('0x29')][_0x0883('0x2b')]);}logger[_0x0883('0x29')]('SmsMessage,\x20%s,\x20%s',_0xa6cf0f,_0x110987['error'][_0x0883('0x2b')]);return _0x5f1b8d(_0x110987['error'][_0x0883('0x2b')]);}else{logger[_0x0883('0x26')](_0x0883('0x27'),_0xa6cf0f,_0x0883('0x28'));_0x5f1b8d(_0x110987[_0x0883('0x2c')][_0x0883('0x2b')]);}})[_0x0883('0x2d')](function(_0x1e6268){logger['error'](_0x0883('0x27'),_0xa6cf0f,_0x1e6268);_0x367459(_0x1e6268);});});}function respondWithStatusCode(_0x4c614a,_0x2576cf){_0x2576cf=_0x2576cf||0xcc;return function(_0x459835){if(_0x459835){return _0x4c614a['sendStatus'](_0x2576cf);}return _0x4c614a[_0x0883('0x2e')](_0x2576cf)[_0x0883('0x2f')]();};}function respondWithResult(_0x2ab431,_0x477b62){_0x477b62=_0x477b62||0xc8;return function(_0x374e89){if(_0x374e89){return _0x2ab431[_0x0883('0x2e')](_0x477b62)[_0x0883('0x30')](_0x374e89);}};}function respondWithFilteredResult(_0x1342c3,_0x391be3){return function(_0x379990){if(_0x379990){var _0x20c175=_0x379990[_0x0883('0x31')],_0x24a834=_0x391be3['offset'],_0x25835e=_0x391be3[_0x0883('0x32')]+_0x391be3[_0x0883('0x33')],_0x14ccc8;if(_0x25835e>=_0x20c175){_0x25835e=_0x20c175;_0x14ccc8=0xc8;}else{_0x14ccc8=0xce;}_0x1342c3[_0x0883('0x2e')](_0x14ccc8);return _0x1342c3[_0x0883('0x34')](_0x0883('0x35'),_0x24a834+'-'+_0x25835e+'/'+_0x20c175)[_0x0883('0x30')](_0x379990);}return null;};}function patchUpdates(_0x3a4f23){return function(_0x3b314c){try{jsonpatch['apply'](_0x3b314c,_0x3a4f23,!![]);}catch(_0x5342e8){return BPromise['reject'](_0x5342e8);}return _0x3b314c[_0x0883('0x36')]();};}function saveUpdates(_0x14dd6c,_0x1ed218){return function(_0x1f70b5){if(_0x1f70b5){return _0x1f70b5[_0x0883('0x37')](_0x14dd6c)['then'](function(_0xae66e2){return _0xae66e2;});}return null;};}function removeEntity(_0x52959b,_0x9e98d0){return function(_0x2d0f3a){if(_0x2d0f3a){return _0x2d0f3a[_0x0883('0x38')]()[_0x0883('0x25')](function(){_0x52959b[_0x0883('0x2e')](0xcc)[_0x0883('0x2f')]();});}};}function handleEntityNotFound(_0x35794b,_0xeec604){return function(_0x55cee7){if(!_0x55cee7){_0x35794b[_0x0883('0x39')](0x194);}return _0x55cee7;};}function handleError(_0x4efedc,_0x3f65dd){_0x3f65dd=_0x3f65dd||0x1f4;return function(_0x403c22){logger[_0x0883('0x29')](_0x403c22['stack']);if(_0x403c22[_0x0883('0x3a')]){delete _0x403c22[_0x0883('0x3a')];}_0x4efedc[_0x0883('0x2e')](_0x3f65dd)[_0x0883('0x3b')](_0x403c22);};}exports['index']=function(_0x2f0e07,_0x40061e){var _0x48538c={},_0x3b8c86={},_0x563aa2={'count':0x0,'rows':[]};var _0x375ff7=_[_0x0883('0x3c')](db['SmsMessage']['rawAttributes'],function(_0x3639fa){return{'name':_0x3639fa[_0x0883('0x3d')],'type':_0x3639fa['type'][_0x0883('0x3e')]};});_0x3b8c86[_0x0883('0x3f')]=_[_0x0883('0x3c')](_0x375ff7,'name');_0x3b8c86[_0x0883('0x40')]=_['keys'](_0x2f0e07[_0x0883('0x40')]);_0x3b8c86[_0x0883('0x41')]=_[_0x0883('0x42')](_0x3b8c86[_0x0883('0x3f')],_0x3b8c86['query']);_0x48538c[_0x0883('0x43')]=_['intersection'](_0x3b8c86[_0x0883('0x3f')],qs['fields'](_0x2f0e07[_0x0883('0x40')][_0x0883('0x44')]));_0x48538c['attributes']=_0x48538c[_0x0883('0x43')][_0x0883('0x45')]?_0x48538c['attributes']:_0x3b8c86['model'];if(!_0x2f0e07[_0x0883('0x40')]['hasOwnProperty']('nolimit')){_0x48538c[_0x0883('0x33')]=qs['limit'](_0x2f0e07[_0x0883('0x40')]['limit']);_0x48538c['offset']=qs[_0x0883('0x32')](_0x2f0e07[_0x0883('0x40')][_0x0883('0x32')]);}_0x48538c['order']=qs[_0x0883('0x46')](_0x2f0e07[_0x0883('0x40')][_0x0883('0x46')]);_0x48538c[_0x0883('0x47')]=qs[_0x0883('0x41')](_[_0x0883('0x48')](_0x2f0e07[_0x0883('0x40')],_0x3b8c86[_0x0883('0x41')]));if(_0x2f0e07[_0x0883('0x40')][_0x0883('0x49')]){_0x48538c['where']=_['merge'](_0x48538c[_0x0883('0x47')],{'$or':_[_0x0883('0x3c')](_0x375ff7,function(_0x3e41fc){if(_0x3e41fc[_0x0883('0x4a')]!==_0x0883('0x4b')){var _0x3b6da2={};_0x3b6da2[_0x3e41fc[_0x0883('0x3a')]]={'$like':'%'+_0x2f0e07[_0x0883('0x40')]['filter']+'%'};return _0x3b6da2;}})});}_0x48538c=_['merge']({},_0x48538c,_0x2f0e07['options']);var _0x249acd={'where':_0x48538c[_0x0883('0x47')]};return db[_0x0883('0x4c')]['count'](_0x249acd)[_0x0883('0x25')](function(_0x366f29){_0x563aa2[_0x0883('0x31')]=_0x366f29;if(_0x2f0e07[_0x0883('0x40')][_0x0883('0x4d')]){_0x48538c['include']=[{'all':!![]}];}return db[_0x0883('0x4c')][_0x0883('0x4e')](_0x48538c);})[_0x0883('0x25')](function(_0x441478){_0x563aa2['rows']=_0x441478;return _0x563aa2;})[_0x0883('0x25')](respondWithFilteredResult(_0x40061e,_0x48538c))['catch'](handleError(_0x40061e,null));};exports[_0x0883('0x4f')]=function(_0x5e92d0,_0x378eb3){var _0x474156={'raw':!![],'where':{'id':_0x5e92d0[_0x0883('0x50')]['id']}},_0x1dbe6e={};_0x1dbe6e['model']=_[_0x0883('0x51')](db['SmsMessage']['rawAttributes']);_0x1dbe6e[_0x0883('0x40')]=_[_0x0883('0x51')](_0x5e92d0[_0x0883('0x40')]);_0x1dbe6e['filters']=_[_0x0883('0x42')](_0x1dbe6e['model'],_0x1dbe6e['query']);_0x474156[_0x0883('0x43')]=_[_0x0883('0x42')](_0x1dbe6e[_0x0883('0x3f')],qs[_0x0883('0x44')](_0x5e92d0[_0x0883('0x40')][_0x0883('0x44')]));_0x474156[_0x0883('0x43')]=_0x474156[_0x0883('0x43')][_0x0883('0x45')]?_0x474156[_0x0883('0x43')]:_0x1dbe6e[_0x0883('0x3f')];if(_0x5e92d0[_0x0883('0x40')][_0x0883('0x4d')]){_0x474156['include']=[{'all':!![]}];}_0x474156=_['merge']({},_0x474156,_0x5e92d0[_0x0883('0x52')]);return db['SmsMessage']['find'](_0x474156)['then'](handleEntityNotFound(_0x378eb3,null))[_0x0883('0x25')](respondWithResult(_0x378eb3,null))['catch'](handleError(_0x378eb3,null));};exports[_0x0883('0x53')]=function(_0x152540,_0x497738){return db[_0x0883('0x4c')][_0x0883('0x53')](_0x152540[_0x0883('0x54')],{})['then'](respondWithResult(_0x497738,0xc9))[_0x0883('0x2d')](handleError(_0x497738,null));};exports['update']=function(_0x1c5c2e,_0x5c7d88){if(_0x1c5c2e['body']['id']){delete _0x1c5c2e[_0x0883('0x54')]['id'];}return db[_0x0883('0x4c')]['find']({'where':{'id':_0x1c5c2e[_0x0883('0x50')]['id']}})['then'](handleEntityNotFound(_0x5c7d88,null))['then'](saveUpdates(_0x1c5c2e[_0x0883('0x54')],null))[_0x0883('0x25')](respondWithResult(_0x5c7d88,null))['catch'](handleError(_0x5c7d88,null));};exports[_0x0883('0x38')]=function(_0x10809c,_0xee47a6){return db[_0x0883('0x4c')][_0x0883('0x55')]({'where':{'id':_0x10809c[_0x0883('0x50')]['id']}})['then'](handleEntityNotFound(_0xee47a6,null))[_0x0883('0x25')](removeEntity(_0xee47a6,null))['catch'](handleError(_0xee47a6,null));};exports[_0x0883('0x56')]=function(_0x52fc79,_0x4a1ddb){return db['SmsMessage']['describe']()[_0x0883('0x25')](respondWithResult(_0x4a1ddb,null))[_0x0883('0x2d')](handleError(_0x4a1ddb,null));};var interaction_log=require('../../config/logger')(_0x0883('0x57'));exports[_0x0883('0x58')]=function(_0x2ffce3,_0x192dc1,_0x4e528b){var _0x45cb7e={'channel':_0x0883('0x59')};if(_0x2ffce3[_0x0883('0x54')]['id']){delete _0x2ffce3[_0x0883('0x54')]['id'];}_0x2ffce3[_0x0883('0x54')][_0x0883('0x5a')]=!![];_0x2ffce3['body'][_0x0883('0x5b')]=moment()[_0x0883('0x5c')](_0x0883('0x5d'));_0x2ffce3[_0x0883('0x54')][_0x0883('0x5e')]=_0x2ffce3[_0x0883('0x54')]['UserId']||_0x2ffce3['user']['id'];return db[_0x0883('0x4c')][_0x0883('0x55')]({'where':{'id':_0x2ffce3[_0x0883('0x50')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x0883('0x5f')}]})[_0x0883('0x25')](handleEntityNotFound(_0x192dc1,null))[_0x0883('0x25')](saveUpdates(_0x2ffce3['body'],null))[_0x0883('0x25')](function(_0x586bab){if(_0x586bab){_0x45cb7e['message']=_0x586bab[_0x0883('0x60')]({'plain':!![]});return db['SmsInteraction'][_0x0883('0x55')]({'where':{'id':_0x586bab[_0x0883('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x192dc1,null))[_0x0883('0x25')](function(_0x1b1de4){if(_0x1b1de4){return _0x1b1de4['update']({'UserId':_0x2ffce3[_0x0883('0x54')][_0x0883('0x5e')],'read1stAt':_[_0x0883('0x62')](_0x1b1de4['read1stAt'])?moment()['format'](_0x0883('0x5d')):undefined});}return null;})[_0x0883('0x25')](function(_0xcebde2){if(_0xcebde2){_0x45cb7e[_0x0883('0x63')]=_0xcebde2[_0x0883('0x60')]({'plain':!![]});interaction_log[_0x0883('0x26')](_0x0883('0x64'),_0x2ffce3[_0x0883('0x65')]['id'],_0x2ffce3[_0x0883('0x65')][_0x0883('0x3a')],_0x2ffce3[_0x0883('0x65')][_0x0883('0x66')],_0x45cb7e[_0x0883('0x63')]['id'],_0x2ffce3[_0x0883('0x54')]?JSON['stringify'](_0x2ffce3['body']):'null');return respondWithRpcPromise(_0x0883('0x67'),_0x0883('0x68'),_0x45cb7e);}return null;})[_0x0883('0x25')](function(_0x38bbff){if(_0x38bbff){if(_0x2ffce3[_0x0883('0x54')]['manual']){_0x45cb7e[_0x0883('0x2b')][_0x0883('0x69')]=util[_0x0883('0x5c')](_0x0883('0x6a'),_0x2ffce3[_0x0883('0x65')]['name']);_0x45cb7e[_0x0883('0x2b')]['channel']=_0x45cb7e[_0x0883('0x6b')];_0x45cb7e[_0x0883('0x2b')][_0x0883('0x6c')]=_0x0883('0x58');return respondWithRpcPromise(_0x0883('0x6d'),_0x0883('0x6d'),{'event':'acceptmessage','message':_0x45cb7e['message']},client9002)[_0x0883('0x25')](function(){return _0x45cb7e;});}return _0x45cb7e;}return null;})[_0x0883('0x25')](respondWithResult(_0x192dc1,null))[_0x0883('0x2d')](handleError(_0x192dc1,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x0883('0x6e')]=function(_0x1ddd6c,_0x39f8f9,_0x2f41e6){var _0x3b55ac={'agent':{},'channel':_0x0883('0x59')};if(_0x1ddd6c[_0x0883('0x54')]['id']){delete _0x1ddd6c[_0x0883('0x54')]['id'];}_0x1ddd6c[_0x0883('0x54')]['UserId']=_0x1ddd6c['body'][_0x0883('0x5e')]||_0x1ddd6c['user']['id'];_0x3b55ac[_0x0883('0x6f')]['id']=_0x1ddd6c['body'][_0x0883('0x5e')];return db['SmsMessage'][_0x0883('0x55')]({'where':{'id':_0x1ddd6c[_0x0883('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x39f8f9,null))['then'](function(_0x3ebcaa){if(_0x3ebcaa){_0x3b55ac[_0x0883('0x2b')]=_0x3ebcaa[_0x0883('0x60')]({'plain':!![]});return db[_0x0883('0x70')][_0x0883('0x55')]({'where':{'id':_0x3ebcaa['SmsInteractionId']}});}return null;})[_0x0883('0x25')](handleEntityNotFound(_0x39f8f9,null))[_0x0883('0x25')](function(_0x2474cb){if(_0x2474cb){_0x3b55ac[_0x0883('0x63')]=_0x2474cb['get']({'plain':!![]});interaction_log[_0x0883('0x26')](_0x0883('0x71'),_0x1ddd6c[_0x0883('0x65')]['id'],_0x1ddd6c['user'][_0x0883('0x3a')],_0x1ddd6c['user'][_0x0883('0x66')],_0x3b55ac[_0x0883('0x63')]['id'],_0x1ddd6c[_0x0883('0x54')]?JSON[_0x0883('0x72')](_0x1ddd6c[_0x0883('0x54')]):_0x0883('0x73'));return respondWithRpcPromise(_0x0883('0x74'),'rejectMessage',_0x3b55ac);}return null;})[_0x0883('0x25')](function(_0xaef49a){if(_0xaef49a){_0xaef49a[_0x0883('0x2b')][_0x0883('0x69')]=util[_0x0883('0x5c')](_0x0883('0x6a'),_0x1ddd6c[_0x0883('0x65')]['name']);_0xaef49a['message'][_0x0883('0x6b')]=_0x3b55ac[_0x0883('0x6b')];_0xaef49a[_0x0883('0x2b')][_0x0883('0x6c')]=_0x0883('0x6e');respondWithRpcPromise(_0x0883('0x6d'),_0x0883('0x6d'),{'event':_0x0883('0x75'),'message':_0xaef49a['message']},client9002);return _0x3b55ac;}return null;})[_0x0883('0x25')](respondWithResult(_0x39f8f9,null))['catch'](handleError(_0x39f8f9,null));};exports[_0x0883('0x2e')]=function(_0x6d8e51,_0x2a6b5e,_0x34671c){if(_0x6d8e51['body']['id']){delete _0x6d8e51['body']['id'];}var _0x1855d6;return db[_0x0883('0x4c')]['find']({'where':{'id':_0x6d8e51[_0x0883('0x50')]['id']}})[_0x0883('0x25')](handleEntityNotFound(_0x2a6b5e,null))['then'](function(_0x415e78){if(_0x415e78){_0x1855d6=_0x415e78;return db[_0x0883('0x76')][_0x0883('0x55')]({'where':{'id':_0x415e78['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x2a6b5e,null))[_0x0883('0x25')](function(_0x27a944){if(_0x27a944){logger[_0x0883('0x77')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0883('0x2e'),_0x0883('0x78'),_0x27a944['type'],util[_0x0883('0x79')](_0x6d8e51['body'],{'showHidden':![],'depth':null}));switch(_0x27a944[_0x0883('0x4a')]){case _0x0883('0x7a'):if(_0x6d8e51[_0x0883('0x54')][_0x0883('0x7b')]&&_0x6d8e51[_0x0883('0x54')][_0x0883('0x7b')]===_0x1855d6[_0x0883('0x7c')]){return _0x1855d6[_0x0883('0x37')]({'read':!![]});}else{logger[_0x0883('0x29')](_0x0883('0x7d'),_0x0883('0x2e'),'twilio',util['inspect'](_0x6d8e51[_0x0883('0x54')],{'showHidden':![],'depth':null}));}break;case _0x0883('0x7e'):if(_0x6d8e51['body'][_0x0883('0x7f')]&&_0x6d8e51[_0x0883('0x54')]['MessageUUID']===_0x1855d6['messageId']&&_['indexOf'](['sent',_0x0883('0x80')],_0x6d8e51[_0x0883('0x54')]['Status'])>=0x0){return _0x1855d6[_0x0883('0x37')]({'read':!![]});}else{logger[_0x0883('0x29')](_0x0883('0x7d'),_0x0883('0x2e'),_0x0883('0x81'),util[_0x0883('0x79')](_0x6d8e51[_0x0883('0x54')],{'showHidden':![],'depth':null}));}break;case _0x0883('0x82'):var _0x257e9d=_0x6d8e51[_0x0883('0x54')][_0x0883('0x83')][0x0];if(_0x257e9d['status']['groupName']==='DELIVERED'){return _0x1855d6[_0x0883('0x37')]({'read':!![]});}else{logger[_0x0883('0x29')](_0x0883('0x7d'),_0x0883('0x2e'),_0x0883('0x82'),util[_0x0883('0x79')](_0x6d8e51[_0x0883('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x1855d6;}})[_0x0883('0x25')](respondWithResult(_0x2a6b5e,null))[_0x0883('0x2d')](handleError(_0x2a6b5e,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 0ec810b..43619b4 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 _0x7b30=['SmsMessage','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x55437e,_0x3a340a){var _0x33ab41=function(_0x24b7ec){while(--_0x24b7ec){_0x55437e['push'](_0x55437e['shift']());}};_0x33ab41(++_0x3a340a);}(_0x7b30,0x94));var _0x07b3=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x7b30[_0xd09668];return _0x68726;};'use strict';var EventEmitter=require(_0x07b3('0x0'));var SmsMessage=require(_0x07b3('0x1'))['db'][_0x07b3('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x07b3('0x3'),'afterUpdate':_0x07b3('0x4'),'afterDestroy':_0x07b3('0x5')};function emitEvent(_0x2ffae8){return function(_0x36c0a9,_0x3bb578,_0x52d834){SmsMessageEvents['emit'](_0x2ffae8+':'+_0x36c0a9['id'],_0x36c0a9);SmsMessageEvents[_0x07b3('0x6')](_0x2ffae8,_0x36c0a9);_0x52d834(null);};}for(var e in events){if(events[_0x07b3('0x7')](e)){var event=events[e];SmsMessage[_0x07b3('0x8')](e,emitEvent(event));}}module[_0x07b3('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xf011=['remove','emit','hook','exports','../../mysqldb','SmsMessage','setMaxListeners','save'];(function(_0x160a93,_0x3da120){var _0x59c7cc=function(_0x5107dd){while(--_0x5107dd){_0x160a93['push'](_0x160a93['shift']());}};_0x59c7cc(++_0x3da120);}(_0xf011,0x1a4));var _0x1f01=function(_0x411812,_0x4f7759){_0x411812=_0x411812-0x0;var _0x24abe3=_0xf011[_0x411812];return _0x24abe3;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x1f01('0x0'))['db'][_0x1f01('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x1f01('0x2')](0x0);var events={'afterCreate':_0x1f01('0x3'),'afterUpdate':'update','afterDestroy':_0x1f01('0x4')};function emitEvent(_0x5dda49){return function(_0x2d5871,_0x6b5670,_0x448511){SmsMessageEvents[_0x1f01('0x5')](_0x5dda49+':'+_0x2d5871['id'],_0x2d5871);SmsMessageEvents[_0x1f01('0x5')](_0x5dda49,_0x2d5871);_0x448511(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x1f01('0x6')](e,emitEvent(event));}}module[_0x1f01('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 ba5b0e4..d73752a 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 _0x6d35=['messages','create','remote','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','sms','POST','user_key','session_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','/api/sms/messages/','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','text','timestamp','sort','length','createHash','md5','hex','/external/get/send.php?','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','clickatell','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','status','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','../../config/environment','define','sms_messages','messageId','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','update','createdAt','catch','error','secret','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone'];(function(_0x3afe25,_0x556507){var _0x43c9d7=function(_0x36eb0b){while(--_0x36eb0b){_0x3afe25['push'](_0x3afe25['shift']());}};_0x43c9d7(++_0x556507);}(_0x6d35,0x134));var _0x56d3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6d35[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x56d3('0x0'));var util=require(_0x56d3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x56d3('0x2'));var BPromise=require('bluebird');var rp=require(_0x56d3('0x3'));var fs=require('fs');var path=require(_0x56d3('0x4'));var rimraf=require('rimraf');var config=require(_0x56d3('0x5'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x349f1f,_0x590df8){return _0x349f1f[_0x56d3('0x6')]('SmsMessage',attributes,{'tableName':_0x56d3('0x7'),'paranoid':![],'indexes':[{'name':_0x56d3('0x8'),'fields':[_0x56d3('0x8')]},{'name':'fti_sms_messages','fields':[_0x56d3('0x9')],'type':_0x56d3('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ebd5c,_0x44a888,_0x5c2a65){var _0x147604=_0x349f1f[_0x56d3('0xb')];var _0x30a16b=_0x2ebd5c['get']({'plain':!![]});if(_0x30a16b[_0x56d3('0xc')][_0x56d3('0xd')]()==='in'||_0x30a16b[_0x56d3('0xc')]['toLowerCase']()===_0x56d3('0xe')&&!_0x30a16b['secret']&&!_[_0x56d3('0xf')](_0x30a16b[_0x56d3('0x10')])){_0x147604[_0x56d3('0x11')][_0x56d3('0x12')]({'where':{'id':_0x30a16b[_0x56d3('0x13')]}})['then'](function(_0x507059){if(_0x507059){_0x507059[_0x56d3('0x14')]({'lastMsgAt':_0x30a16b[_0x56d3('0x15')],'lastMsgDirection':_0x30a16b[_0x56d3('0xc')][_0x56d3('0xd')]()});}})[_0x56d3('0x16')](function(_0x1a8715){console[_0x56d3('0x17')](_0x1a8715);});}if(_0x30a16b[_0x56d3('0xc')]==='out'&&!_0x30a16b[_0x56d3('0x18')]){var _0x34ee62;_0x147604[_0x56d3('0x19')][_0x56d3('0x1a')]({'where':{'id':_0x30a16b[_0x56d3('0x1b')]},'raw':!![]})[_0x56d3('0x1c')](function(_0x5e6183){_0x34ee62=_0x5e6183;if(_0x34ee62&&_0x34ee62[_0x56d3('0x1d')]){switch(_0x34ee62[_0x56d3('0x1d')]){case _0x56d3('0x1e'):var _0x5c2bc5=require(_0x56d3('0x1e'));if(_0x34ee62[_0x56d3('0x1f')]&&_0x34ee62[_0x56d3('0x20')]&&_0x34ee62[_0x56d3('0x21')]){var _0x5a5dea=new _0x5c2bc5(_0x34ee62[_0x56d3('0x1f')],_0x34ee62[_0x56d3('0x20')]);_0x5a5dea[_0x56d3('0x22')][_0x56d3('0x23')]({'body':_0x30a16b[_0x56d3('0x9')],'to':_0x30a16b['phone'],'from':_0x34ee62['phone'],'statusCallback':_0x34ee62[_0x56d3('0x24')]+'/api/sms/messages/'+_0x30a16b['id']+_0x56d3('0x25')+_0x34ee62[_0x56d3('0x26')]})[_0x56d3('0x1c')](function(_0x153291){if(_0x153291[_0x56d3('0x27')]){return _0x2ebd5c[_0x56d3('0x14')]({'messageId':_0x153291[_0x56d3('0x27')]});}})[_0x56d3('0x16')](function(_0x5f4721){logger['error'](_0x56d3('0x28'),_0x56d3('0x29'),_0x56d3('0x1e'),util[_0x56d3('0x2a')](_0x5f4721,{'showHidden':![],'depth':null}));});}else{logger[_0x56d3('0x17')](_0x56d3('0x28'),_0x56d3('0x29'),_0x56d3('0x1e'),_0x56d3('0x2b'));}break;case _0x56d3('0x2c'):var _0x7b66e4=_0x56d3('0x2d');if(_0x34ee62[_0x56d3('0x2e')]&&_0x34ee62[_0x56d3('0x2f')]){var _0x763226={'recipient':[_0x30a16b[_0x56d3('0x21')]],'message':_0x30a16b['body'],'message_type':_0x34ee62[_0x56d3('0x30')]};if(_0x34ee62['smsMethod']&&_0x34ee62[_0x56d3('0x30')]!=='SI'){_0x763226['sender']=_0x34ee62[_0x56d3('0x21')];}var _0x2e962b={'url':_0x7b66e4+_0x56d3('0x31')+_0x34ee62[_0x56d3('0x2e')]+_0x56d3('0x32')+_0x34ee62[_0x56d3('0x2f')],'method':_0x56d3('0x33')};rp(_0x2e962b)['then'](function(_0x555215){var _0x4654d6=_0x555215['split'](';');var _0x284dd4={'user_key':_0x4654d6[0x0],'session_key':_0x4654d6[0x1]};_0x2e962b={'url':_0x7b66e4+_0x56d3('0x34'),'method':_0x56d3('0x35'),'headers':{'user_key':_0x284dd4[_0x56d3('0x36')],'Session_key':_0x284dd4[_0x56d3('0x37')]},'json':!![],'body':_0x763226};return rp(_0x2e962b);})[_0x56d3('0x1c')](function(_0x3122aa){if(_0x3122aa[_0x56d3('0x38')]>=0x1){var _0x29c978={'messageId':_0x3122aa['internal_order_id']};if(_0x34ee62['smsMethod']!=='GP'||!_0x34ee62[_0x56d3('0x39')]){_0x29c978[_0x56d3('0x3a')]=!![];}return _0x2ebd5c['update'](_0x29c978);}else{return logger[_0x56d3('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x56d3('0x2c'),util[_0x56d3('0x2a')](_0x3122aa,{'showHidden':![],'depth':null}));}})[_0x56d3('0x16')](function(_0x1b30d0){return logger['error'](_0x56d3('0x28'),'afterCreate',_0x56d3('0x2c'),util[_0x56d3('0x2a')](_0x1b30d0,{'showHidden':![],'depth':null}));});}else{logger[_0x56d3('0x17')](_0x56d3('0x28'),_0x56d3('0x29'),_0x56d3('0x2c'),_0x56d3('0x3b'));}break;case _0x56d3('0x3c'):if(_0x34ee62[_0x56d3('0x20')]){var _0x2927e8={'recipient':_0x30a16b[_0x56d3('0x21')],'message':_0x30a16b[_0x56d3('0x9')],'sender':_0x34ee62[_0x56d3('0x3d')]||_0x34ee62[_0x56d3('0x21')],'authorization':_0x34ee62['authToken']};var _0x44a888={'method':'POST','uri':_0x56d3('0x3e'),'body':_0x2927e8,'json':!![]};rp(_0x44a888)[_0x56d3('0x1c')](function(_0x45c798){var _0x4c4590={'messageId':_0x45c798['requestid']};if(!_0x34ee62[_0x56d3('0x39')]){_0x4c4590[_0x56d3('0x3a')]=!![];}return _0x2ebd5c['update'](_0x4c4590);})[_0x56d3('0x16')](function(_0x38df5b){logger['error'](_0x56d3('0x28'),_0x56d3('0x29'),'connectel',util[_0x56d3('0x2a')](_0x38df5b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x56d3('0x28'),_0x56d3('0x29'),_0x56d3('0x3c'),_0x56d3('0x3f'));}break;case _0x56d3('0x40'):if(_0x34ee62[_0x56d3('0x2e')]&&_0x34ee62[_0x56d3('0x2f')]){var _0x2927e8={'messages':[{'source':_0x56d3('0x41'),'to':_0x30a16b[_0x56d3('0x21')],'body':_0x30a16b[_0x56d3('0x9')],'from':_0x34ee62['senderString']||_0x34ee62[_0x56d3('0x21')]}]};var _0x2ffea5=util[_0x56d3('0x42')](_0x56d3('0x43'),_0x34ee62[_0x56d3('0x2e')],_0x34ee62[_0x56d3('0x2f')]);var _0x44a888={'method':_0x56d3('0x35'),'uri':_0x56d3('0x44'),'body':_0x2927e8,'headers':{'Authorization':util[_0x56d3('0x42')]('Basic\x20%s',new Buffer(_0x2ffea5)[_0x56d3('0x45')](_0x56d3('0x46')))},'json':!![]};rp(_0x44a888)['then'](function(_0x4eb3af){if(_0x4eb3af[_0x56d3('0x47')]>=0xc8&&_0x4eb3af['http_code']<=0xce){if(_0x4eb3af[_0x56d3('0x48')]&&_0x4eb3af['data'][_0x56d3('0x49')]>0x0){var _0x2f7d24=_['head'](_0x4eb3af[_0x56d3('0x48')][_0x56d3('0x22')]);var _0x45e485={'messageId':_0x2f7d24[_0x56d3('0x4a')]};if(!_0x34ee62[_0x56d3('0x39')]){_0x45e485[_0x56d3('0x3a')]=!![];}return _0x2ebd5c[_0x56d3('0x14')](_0x45e485);}else{logger['error'](_0x56d3('0x28'),_0x56d3('0x29'),_0x56d3('0x4b'),util['inspect'](_0x4eb3af,{'showHidden':![],'depth':null}));}}else{logger[_0x56d3('0x17')](_0x56d3('0x28'),'afterCreate',_0x56d3('0x4b'),util[_0x56d3('0x2a')](_0x4eb3af,{'showHidden':![],'depth':null}));}})[_0x56d3('0x16')](function(_0x3b101f){logger[_0x56d3('0x17')](_0x56d3('0x28'),_0x56d3('0x29'),_0x56d3('0x4b'),util['inspect'](_0x3b101f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x56d3('0x28'),_0x56d3('0x29'),'clickSend',_0x56d3('0x3b'));}break;case _0x56d3('0x4c'):if(_0x34ee62[_0x56d3('0x4d')]&&_0x34ee62['authToken']){var _0x2927e8={'dst':_0x30a16b['phone'],'text':_0x30a16b['body'],'src':_0x34ee62['senderString']||_0x34ee62[_0x56d3('0x21')],'url':_0x34ee62[_0x56d3('0x24')]+_0x56d3('0x4e')+_0x30a16b['id']+_0x56d3('0x25')+_0x34ee62[_0x56d3('0x26')]};var _0x2ffea5=util[_0x56d3('0x42')]('%s:%s',_0x34ee62[_0x56d3('0x4d')],_0x34ee62[_0x56d3('0x20')]);var _0x44a888={'method':_0x56d3('0x35'),'uri':util[_0x56d3('0x42')]('https://api.plivo.com/v1/Account/%s/Message/',_0x34ee62[_0x56d3('0x4d')]),'body':_0x2927e8,'headers':{'Authorization':util[_0x56d3('0x42')]('Basic\x20%s',new Buffer(_0x2ffea5)[_0x56d3('0x45')](_0x56d3('0x46')))},'json':!![]};rp(_0x44a888)['then'](function(_0x4f6d31){var _0x1b618a={'messageId':_0x4f6d31['message_uuid'][0x0]};return _0x2ebd5c[_0x56d3('0x14')](_0x1b618a);})['catch'](function(_0x209758){logger['error'](_0x56d3('0x28'),_0x56d3('0x29'),_0x56d3('0x4c'),util['inspect'](_0x209758,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x56d3('0x28'),_0x56d3('0x29'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x56d3('0x4f'):if(_0x34ee62[_0x56d3('0x2e')]&&_0x34ee62['password']){if(_0x34ee62[_0x56d3('0x50')]){var _0x259a99={'method':'POST','uri':_0x34ee62[_0x56d3('0x50')]+_0x56d3('0x51'),'body':{'username':_0x34ee62[_0x56d3('0x2e')],'password':_0x34ee62[_0x56d3('0x2f')]},'json':!![]};return rp(_0x259a99)[_0x56d3('0x1c')](function(_0x4bbc63){var _0x1ea7ea={'method':_0x56d3('0x35'),'uri':_0x34ee62[_0x56d3('0x50')]+_0x56d3('0x52'),'body':{'messages':[{'from':_0x34ee62[_0x56d3('0x21')],'destinations':[{'to':_0x30a16b[_0x56d3('0x21')]}],'text':_0x30a16b['body'],'notifyUrl':_0x34ee62[_0x56d3('0x24')]+_0x56d3('0x4e')+_0x30a16b['id']+_0x56d3('0x25')+_0x34ee62[_0x56d3('0x26')],'notifyContentType':_0x56d3('0x53'),'callbackData':_0x34ee62[_0x56d3('0x21')]+';'+_0x30a16b['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x4bbc63[_0x56d3('0x26')]},'json':!![]};return rp(_0x1ea7ea)['then'](function(_0x5df620){if(_0x5df620['messages']){var _0x3e4eaf={'messageId':_0x5df620[_0x56d3('0x22')][0x0][_0x56d3('0x8')]};if(!_0x34ee62['deliveryReport']){_0x3e4eaf['read']=!![];}return _0x2ebd5c['update'](_0x3e4eaf);}else{return logger[_0x56d3('0x17')](_0x56d3('0x28'),_0x56d3('0x29'),'infobip',util[_0x56d3('0x2a')](_0x5df620,{'showHidden':![],'depth':null}));}});})[_0x56d3('0x16')](function(_0x57a025){return logger[_0x56d3('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x56d3('0x4f'),util[_0x56d3('0x2a')](_0x57a025,{'showHidden':![],'depth':null}));});}else{logger[_0x56d3('0x17')](_0x56d3('0x28'),_0x56d3('0x29'),'infobip',_0x56d3('0x54'));}}else{logger[_0x56d3('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x56d3('0x29'),'infobip',_0x56d3('0x3b'));}break;case _0x56d3('0x55'):var _0x3ad684=require(_0x56d3('0x56'));if(_0x34ee62[_0x56d3('0x57')]){var _0x50e3ea={};_0x50e3ea[_0x56d3('0x58')]=_0x34ee62[_0x56d3('0x2e')];_0x50e3ea[_0x56d3('0x21')]=_0x30a16b[_0x56d3('0x21')];_0x50e3ea[_0x56d3('0x59')]=_0x34ee62[_0x56d3('0x21')];_0x50e3ea[_0x56d3('0x5a')]=_0x30a16b[_0x56d3('0x9')];_0x50e3ea[_0x56d3('0x5b')]=+new Date();var _0x1e4545='';var _0x2d2fcc='';var _0x4a375a=Object['keys'](_0x50e3ea);_0x4a375a[_0x56d3('0x5c')]();for(var _0x146692=0x0;_0x146692<_0x4a375a[_0x56d3('0x5d')];_0x146692++){if(_0x1e4545!=''){_0x1e4545+='&';}_0x1e4545+=_0x4a375a[_0x146692]+'='+encodeURIComponent(_0x50e3ea[_0x4a375a[_0x146692]]);_0x2d2fcc+=_0x50e3ea[_0x4a375a[_0x146692]];}_0x2d2fcc+=_0x34ee62[_0x56d3('0x57')];_0x2d2fcc=_0x3ad684[_0x56d3('0x5e')](_0x56d3('0x5f'))[_0x56d3('0x14')](_0x2d2fcc)['digest'](_0x56d3('0x60'));if(_0x1e4545!==''){_0x1e4545+='&';}_0x1e4545+='signature='+_0x2d2fcc;var _0x2e962b={'method':_0x56d3('0x33'),'uri':_0x34ee62[_0x56d3('0x50')]+_0x56d3('0x61')+_0x1e4545,'json':!![]};return rp(_0x2e962b)['then'](function(_0x1f958b){var _0x2c6bf0=Object['keys'](_0x1f958b);if(_0x1f958b[_0x2c6bf0[0x0]][_0x56d3('0x17')]&&parseInt(_0x1f958b[_0x2c6bf0[0x0]][_0x56d3('0x17')])===0x0){var _0x14fad9={'messageId':_0x1f958b[_0x2c6bf0[0x0]]['id_sms']};if(!_0x34ee62['deliveryReport']){_0x14fad9[_0x56d3('0x3a')]=!![];}return _0x2ebd5c[_0x56d3('0x14')](_0x14fad9);}else{return logger[_0x56d3('0x17')](_0x56d3('0x28'),_0x56d3('0x29'),_0x56d3('0x55'),util[_0x56d3('0x2a')](_0x1f958b['error'],{'showHidden':![],'depth':null}));}})[_0x56d3('0x16')](function(_0x4d9865){return logger[_0x56d3('0x17')](_0x56d3('0x28'),_0x56d3('0x29'),_0x56d3('0x55'),util[_0x56d3('0x2a')](_0x4d9865,{'showHidden':![],'depth':null}));});}else{logger[_0x56d3('0x17')](_0x56d3('0x28'),_0x56d3('0x29'),'csc',_0x56d3('0x62'));}break;case'clickatell':if(_0x34ee62['apiKey']){var _0xc87f28={'method':_0x56d3('0x35'),'uri':_0x56d3('0x63'),'headers':{'Authorization':_0x34ee62['apiKey']},'body':{'content':_0x30a16b[_0x56d3('0x9')],'to':[_0x30a16b['phone']],'from':_0x34ee62[_0x56d3('0x21')],'binary':![],'clientMessageId':_0x56d3('0x64'),'charset':_0x56d3('0x65')},'json':!![]};rp(_0xc87f28)[_0x56d3('0x1c')](function(_0x2b9186){if(!_0x2b9186[_0x56d3('0x17')]){var _0x967c22={'messageId':_0x2b9186[_0x56d3('0x22')][0x0]['apiMessageId']};if(!_0x34ee62[_0x56d3('0x39')]){_0x967c22[_0x56d3('0x3a')]=!![];}return _0x2ebd5c[_0x56d3('0x14')](_0x967c22);}else{return logger[_0x56d3('0x17')](_0x56d3('0x28'),_0x56d3('0x29'),_0x56d3('0x66'),util[_0x56d3('0x2a')](_0x2b9186[_0x56d3('0x17')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x33c0e4){return logger[_0x56d3('0x17')](_0x56d3('0x28'),_0x56d3('0x29'),'clickatell',util[_0x56d3('0x2a')](_0x33c0e4,{'showHidden':![],'depth':null}));});}else{logger[_0x56d3('0x17')](_0x56d3('0x28'),_0x56d3('0x29'),_0x56d3('0x66'),_0x56d3('0x62'));}break;case'intelepeer':if(_0x34ee62[_0x56d3('0x57')]){var _0x2adfce={};var _0x2e962b={'method':_0x56d3('0x35'),'uri':_0x56d3('0x67'),'headers':{'Authorization':_0x56d3('0x68')+_0x34ee62[_0x56d3('0x57')],'Content-Type':_0x56d3('0x53')},'body':{'from':_0x34ee62[_0x56d3('0x21')],'to':_0x30a16b[_0x56d3('0x21')],'text':_0x30a16b[_0x56d3('0x9')]},'json':!![]};return rp(_0x2e962b)[_0x56d3('0x1c')](function(_0x369f53){if(_0x369f53['code']==0xca){_0x2adfce['message']=_0x369f53;var _0x210597={'method':_0x56d3('0x35'),'uri':_0x56d3('0x69'),'headers':{'Authorization':_0x56d3('0x68')+_0x34ee62[_0x56d3('0x57')],'Content-Type':_0x56d3('0x53')},'body':{'refid':_0x2adfce[_0x56d3('0x6a')]['refid']},'json':!![]};return rp(_0x210597)[_0x56d3('0x1c')](function(_0x2891df){_0x2adfce[_0x56d3('0x6b')]=_0x2891df;var _0x5ea281={'messageId':_0x2adfce[_0x56d3('0x6a')][_0x56d3('0x6c')],'read':!![]};return _0x2ebd5c['update'](_0x5ea281);});}else{return logger[_0x56d3('0x17')](_0x56d3('0x28'),'afterCreate',_0x56d3('0x6d'),util[_0x56d3('0x2a')](_0x369f53,{'showHidden':![],'depth':null}));}})[_0x56d3('0x16')](function(_0x210604){return logger[_0x56d3('0x17')](_0x56d3('0x28'),_0x56d3('0x29'),_0x56d3('0x6d'),util[_0x56d3('0x2a')](_0x210604,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x56d3('0x28'),_0x56d3('0x29'),_0x56d3('0x6d'),_0x56d3('0x6e'));}break;}}})[_0x56d3('0x6f')](function(){_0x5c2a65();});}else{_0x5c2a65();}}},'charset':_0x56d3('0x70'),'collate':_0x56d3('0x71')});}; \ No newline at end of file +var _0xcc58=['&password=','split','sms','POST','user_key','session_key','total_sent','internal_order_id','connectel','https://smsapi.connectel.se/api/send/','requestid','deliveryReport','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','token','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','sender','sort','length','createHash','md5','hex','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','status','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./smsMessage.attributes','exports','define','sms_messages','messageId','body','FULLTEXT','get','direction','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','toLowerCase','catch','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username='];(function(_0x36866d,_0x52d9bc){var _0x4dff34=function(_0x443ab2){while(--_0x443ab2){_0x36866d['push'](_0x36866d['shift']());}};_0x4dff34(++_0x52d9bc);}(_0xcc58,0x12d));var _0x8cc5=function(_0x56821e,_0x5b7693){_0x56821e=_0x56821e-0x0;var _0x205101=_0xcc58[_0x56821e];return _0x205101;};'use strict';var _=require(_0x8cc5('0x0'));var util=require(_0x8cc5('0x1'));var logger=require(_0x8cc5('0x2'))(_0x8cc5('0x3'));var moment=require(_0x8cc5('0x4'));var BPromise=require(_0x8cc5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8cc5('0x6'));var config=require('../../config/environment');var attributes=require(_0x8cc5('0x7'));module[_0x8cc5('0x8')]=function(_0xcb8301,_0x146867){return _0xcb8301[_0x8cc5('0x9')]('SmsMessage',attributes,{'tableName':_0x8cc5('0xa'),'paranoid':![],'indexes':[{'name':_0x8cc5('0xb'),'fields':[_0x8cc5('0xb')]},{'name':'fti_sms_messages','fields':[_0x8cc5('0xc')],'type':_0x8cc5('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6043c4,_0x366726,_0x2e5694){var _0x11d3c0=_0xcb8301['models'];var _0x13a706=_0x6043c4[_0x8cc5('0xe')]({'plain':!![]});if(_0x13a706[_0x8cc5('0xf')]['toLowerCase']()==='in'||_0x13a706[_0x8cc5('0xf')]['toLowerCase']()===_0x8cc5('0x10')&&!_0x13a706[_0x8cc5('0x11')]&&!_[_0x8cc5('0x12')](_0x13a706[_0x8cc5('0x13')])){_0x11d3c0[_0x8cc5('0x14')][_0x8cc5('0x15')]({'where':{'id':_0x13a706[_0x8cc5('0x16')]}})[_0x8cc5('0x17')](function(_0x3d9b01){if(_0x3d9b01){_0x3d9b01[_0x8cc5('0x18')]({'lastMsgAt':_0x13a706['createdAt'],'lastMsgDirection':_0x13a706[_0x8cc5('0xf')][_0x8cc5('0x19')]()});}})[_0x8cc5('0x1a')](function(_0x564ec0){console['error'](_0x564ec0);});}if(_0x13a706['direction']===_0x8cc5('0x10')&&!_0x13a706[_0x8cc5('0x11')]){var _0x11c09e;_0x11d3c0['SmsAccount'][_0x8cc5('0x1b')]({'where':{'id':_0x13a706[_0x8cc5('0x1c')]},'raw':!![]})[_0x8cc5('0x17')](function(_0x56a91b){_0x11c09e=_0x56a91b;if(_0x11c09e&&_0x11c09e[_0x8cc5('0x1d')]){switch(_0x11c09e['type']){case _0x8cc5('0x1e'):var _0xe0ecdc=require(_0x8cc5('0x1e'));if(_0x11c09e[_0x8cc5('0x1f')]&&_0x11c09e[_0x8cc5('0x20')]&&_0x11c09e[_0x8cc5('0x21')]){var _0x4fa8a9=new _0xe0ecdc(_0x11c09e[_0x8cc5('0x1f')],_0x11c09e['authToken']);_0x4fa8a9[_0x8cc5('0x22')]['create']({'body':_0x13a706[_0x8cc5('0xc')],'to':_0x13a706[_0x8cc5('0x21')],'from':_0x11c09e[_0x8cc5('0x21')],'statusCallback':_0x11c09e[_0x8cc5('0x23')]+_0x8cc5('0x24')+_0x13a706['id']+_0x8cc5('0x25')+_0x11c09e['token']})[_0x8cc5('0x17')](function(_0x1466b3){if(_0x1466b3[_0x8cc5('0x26')]){return _0x6043c4[_0x8cc5('0x18')]({'messageId':_0x1466b3['sid']});}})['catch'](function(_0x338564){logger[_0x8cc5('0x27')](_0x8cc5('0x28'),_0x8cc5('0x29'),_0x8cc5('0x1e'),util[_0x8cc5('0x2a')](_0x338564,{'showHidden':![],'depth':null}));});}else{logger[_0x8cc5('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cc5('0x29'),'twilio',_0x8cc5('0x2b'));}break;case _0x8cc5('0x2c'):var _0xc96ba6=_0x8cc5('0x2d');if(_0x11c09e[_0x8cc5('0x2e')]&&_0x11c09e[_0x8cc5('0x2f')]){var _0x4ef96b={'recipient':[_0x13a706[_0x8cc5('0x21')]],'message':_0x13a706[_0x8cc5('0xc')],'message_type':_0x11c09e[_0x8cc5('0x30')]};if(_0x11c09e['smsMethod']&&_0x11c09e[_0x8cc5('0x30')]!=='SI'){_0x4ef96b['sender']=_0x11c09e['phone'];}var _0x3e401f={'url':_0xc96ba6+_0x8cc5('0x31')+_0x11c09e[_0x8cc5('0x2e')]+_0x8cc5('0x32')+_0x11c09e[_0x8cc5('0x2f')],'method':'GET'};rp(_0x3e401f)[_0x8cc5('0x17')](function(_0x3e159b){var _0x5c10a6=_0x3e159b[_0x8cc5('0x33')](';');var _0x272216={'user_key':_0x5c10a6[0x0],'session_key':_0x5c10a6[0x1]};_0x3e401f={'url':_0xc96ba6+_0x8cc5('0x34'),'method':_0x8cc5('0x35'),'headers':{'user_key':_0x272216[_0x8cc5('0x36')],'Session_key':_0x272216[_0x8cc5('0x37')]},'json':!![],'body':_0x4ef96b};return rp(_0x3e401f);})[_0x8cc5('0x17')](function(_0x32a301){if(_0x32a301[_0x8cc5('0x38')]>=0x1){var _0x355e22={'messageId':_0x32a301[_0x8cc5('0x39')]};if(_0x11c09e[_0x8cc5('0x30')]!=='GP'||!_0x11c09e['deliveryReport']){_0x355e22['read']=!![];}return _0x6043c4['update'](_0x355e22);}else{return logger[_0x8cc5('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cc5('0x29'),_0x8cc5('0x2c'),util[_0x8cc5('0x2a')](_0x32a301,{'showHidden':![],'depth':null}));}})[_0x8cc5('0x1a')](function(_0x340ce3){return logger[_0x8cc5('0x27')](_0x8cc5('0x28'),'afterCreate',_0x8cc5('0x2c'),util['inspect'](_0x340ce3,{'showHidden':![],'depth':null}));});}else{logger[_0x8cc5('0x27')](_0x8cc5('0x28'),_0x8cc5('0x29'),_0x8cc5('0x2c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x8cc5('0x3a'):if(_0x11c09e[_0x8cc5('0x20')]){var _0xc29cf0={'recipient':_0x13a706[_0x8cc5('0x21')],'message':_0x13a706['body'],'sender':_0x11c09e['senderString']||_0x11c09e[_0x8cc5('0x21')],'authorization':_0x11c09e[_0x8cc5('0x20')]};var _0x366726={'method':_0x8cc5('0x35'),'uri':_0x8cc5('0x3b'),'body':_0xc29cf0,'json':!![]};rp(_0x366726)['then'](function(_0x50f791){var _0x36f8ed={'messageId':_0x50f791[_0x8cc5('0x3c')]};if(!_0x11c09e[_0x8cc5('0x3d')]){_0x36f8ed[_0x8cc5('0x3e')]=!![];}return _0x6043c4[_0x8cc5('0x18')](_0x36f8ed);})[_0x8cc5('0x1a')](function(_0x18e365){logger[_0x8cc5('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cc5('0x29'),_0x8cc5('0x3a'),util['inspect'](_0x18e365,{'showHidden':![],'depth':null}));});}else{logger[_0x8cc5('0x27')](_0x8cc5('0x28'),'afterCreate',_0x8cc5('0x3a'),_0x8cc5('0x3f'));}break;case _0x8cc5('0x40'):if(_0x11c09e[_0x8cc5('0x2e')]&&_0x11c09e[_0x8cc5('0x2f')]){var _0xc29cf0={'messages':[{'source':_0x8cc5('0x41'),'to':_0x13a706[_0x8cc5('0x21')],'body':_0x13a706[_0x8cc5('0xc')],'from':_0x11c09e[_0x8cc5('0x42')]||_0x11c09e['phone']}]};var _0x485623=util[_0x8cc5('0x43')](_0x8cc5('0x44'),_0x11c09e[_0x8cc5('0x2e')],_0x11c09e[_0x8cc5('0x2f')]);var _0x366726={'method':'POST','uri':_0x8cc5('0x45'),'body':_0xc29cf0,'headers':{'Authorization':util[_0x8cc5('0x43')](_0x8cc5('0x46'),new Buffer(_0x485623)['toString'](_0x8cc5('0x47')))},'json':!![]};rp(_0x366726)[_0x8cc5('0x17')](function(_0x3f7ca9){if(_0x3f7ca9[_0x8cc5('0x48')]>=0xc8&&_0x3f7ca9[_0x8cc5('0x48')]<=0xce){if(_0x3f7ca9[_0x8cc5('0x49')]&&_0x3f7ca9['data'][_0x8cc5('0x4a')]>0x0){var _0x469907=_[_0x8cc5('0x4b')](_0x3f7ca9[_0x8cc5('0x49')][_0x8cc5('0x22')]);var _0x32a13e={'messageId':_0x469907[_0x8cc5('0x4c')]};if(!_0x11c09e[_0x8cc5('0x3d')]){_0x32a13e[_0x8cc5('0x3e')]=!![];}return _0x6043c4[_0x8cc5('0x18')](_0x32a13e);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cc5('0x29'),_0x8cc5('0x4d'),util[_0x8cc5('0x2a')](_0x3f7ca9,{'showHidden':![],'depth':null}));}}else{logger[_0x8cc5('0x27')](_0x8cc5('0x28'),'afterCreate',_0x8cc5('0x4d'),util[_0x8cc5('0x2a')](_0x3f7ca9,{'showHidden':![],'depth':null}));}})['catch'](function(_0x393fab){logger[_0x8cc5('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cc5('0x29'),_0x8cc5('0x4d'),util[_0x8cc5('0x2a')](_0x393fab,{'showHidden':![],'depth':null}));});}else{logger[_0x8cc5('0x27')](_0x8cc5('0x28'),_0x8cc5('0x29'),'clickSend',_0x8cc5('0x4e'));}break;case _0x8cc5('0x4f'):if(_0x11c09e[_0x8cc5('0x50')]&&_0x11c09e[_0x8cc5('0x20')]){var _0xc29cf0={'dst':_0x13a706[_0x8cc5('0x21')],'text':_0x13a706['body'],'src':_0x11c09e[_0x8cc5('0x42')]||_0x11c09e[_0x8cc5('0x21')],'url':_0x11c09e[_0x8cc5('0x23')]+_0x8cc5('0x24')+_0x13a706['id']+_0x8cc5('0x25')+_0x11c09e[_0x8cc5('0x51')]};var _0x485623=util[_0x8cc5('0x43')](_0x8cc5('0x44'),_0x11c09e[_0x8cc5('0x50')],_0x11c09e[_0x8cc5('0x20')]);var _0x366726={'method':_0x8cc5('0x35'),'uri':util[_0x8cc5('0x43')]('https://api.plivo.com/v1/Account/%s/Message/',_0x11c09e[_0x8cc5('0x50')]),'body':_0xc29cf0,'headers':{'Authorization':util[_0x8cc5('0x43')](_0x8cc5('0x46'),new Buffer(_0x485623)[_0x8cc5('0x52')](_0x8cc5('0x47')))},'json':!![]};rp(_0x366726)[_0x8cc5('0x17')](function(_0x3af44d){var _0x45e4d1={'messageId':_0x3af44d[_0x8cc5('0x53')][0x0]};return _0x6043c4[_0x8cc5('0x18')](_0x45e4d1);})[_0x8cc5('0x1a')](function(_0x22da3f){logger[_0x8cc5('0x27')](_0x8cc5('0x28'),_0x8cc5('0x29'),_0x8cc5('0x4f'),util[_0x8cc5('0x2a')](_0x22da3f,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cc5('0x29'),'plivo',_0x8cc5('0x54'));}break;case _0x8cc5('0x55'):if(_0x11c09e[_0x8cc5('0x2e')]&&_0x11c09e[_0x8cc5('0x2f')]){if(_0x11c09e[_0x8cc5('0x56')]){var _0x2197a3={'method':_0x8cc5('0x35'),'uri':_0x11c09e[_0x8cc5('0x56')]+'/auth/1/session','body':{'username':_0x11c09e[_0x8cc5('0x2e')],'password':_0x11c09e['password']},'json':!![]};return rp(_0x2197a3)[_0x8cc5('0x17')](function(_0xdc4740){var _0x1e771e={'method':_0x8cc5('0x35'),'uri':_0x11c09e[_0x8cc5('0x56')]+_0x8cc5('0x57'),'body':{'messages':[{'from':_0x11c09e[_0x8cc5('0x21')],'destinations':[{'to':_0x13a706['phone']}],'text':_0x13a706[_0x8cc5('0xc')],'notifyUrl':_0x11c09e[_0x8cc5('0x23')]+'/api/sms/messages/'+_0x13a706['id']+_0x8cc5('0x25')+_0x11c09e[_0x8cc5('0x51')],'notifyContentType':_0x8cc5('0x58'),'callbackData':_0x11c09e[_0x8cc5('0x21')]+';'+_0x13a706['body']}]},'headers':{'Authorization':_0x8cc5('0x59')+_0xdc4740[_0x8cc5('0x51')]},'json':!![]};return rp(_0x1e771e)[_0x8cc5('0x17')](function(_0x28b8ce){if(_0x28b8ce[_0x8cc5('0x22')]){var _0x197a8b={'messageId':_0x28b8ce[_0x8cc5('0x22')][0x0][_0x8cc5('0xb')]};if(!_0x11c09e['deliveryReport']){_0x197a8b[_0x8cc5('0x3e')]=!![];}return _0x6043c4[_0x8cc5('0x18')](_0x197a8b);}else{return logger['error'](_0x8cc5('0x28'),_0x8cc5('0x29'),_0x8cc5('0x55'),util['inspect'](_0x28b8ce,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x3a14fb){return logger[_0x8cc5('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cc5('0x29'),_0x8cc5('0x55'),util[_0x8cc5('0x2a')](_0x3a14fb,{'showHidden':![],'depth':null}));});}else{logger[_0x8cc5('0x27')](_0x8cc5('0x28'),_0x8cc5('0x29'),'infobip',_0x8cc5('0x5a'));}}else{logger[_0x8cc5('0x27')](_0x8cc5('0x28'),_0x8cc5('0x29'),'infobip',_0x8cc5('0x4e'));}break;case _0x8cc5('0x5b'):var _0x531327=require(_0x8cc5('0x5c'));if(_0x11c09e[_0x8cc5('0x5d')]){var _0x44881d={};_0x44881d['login']=_0x11c09e[_0x8cc5('0x2e')];_0x44881d[_0x8cc5('0x21')]=_0x13a706[_0x8cc5('0x21')];_0x44881d[_0x8cc5('0x5e')]=_0x11c09e['phone'];_0x44881d['text']=_0x13a706[_0x8cc5('0xc')];_0x44881d['timestamp']=+new Date();var _0x4a6d7d='';var _0x4baee4='';var _0x4233a1=Object['keys'](_0x44881d);_0x4233a1[_0x8cc5('0x5f')]();for(var _0x22449c=0x0;_0x22449c<_0x4233a1[_0x8cc5('0x60')];_0x22449c++){if(_0x4a6d7d!=''){_0x4a6d7d+='&';}_0x4a6d7d+=_0x4233a1[_0x22449c]+'='+encodeURIComponent(_0x44881d[_0x4233a1[_0x22449c]]);_0x4baee4+=_0x44881d[_0x4233a1[_0x22449c]];}_0x4baee4+=_0x11c09e['apiKey'];_0x4baee4=_0x531327[_0x8cc5('0x61')](_0x8cc5('0x62'))[_0x8cc5('0x18')](_0x4baee4)['digest'](_0x8cc5('0x63'));if(_0x4a6d7d!==''){_0x4a6d7d+='&';}_0x4a6d7d+=_0x8cc5('0x64')+_0x4baee4;var _0x3e401f={'method':'GET','uri':_0x11c09e[_0x8cc5('0x56')]+'/external/get/send.php?'+_0x4a6d7d,'json':!![]};return rp(_0x3e401f)[_0x8cc5('0x17')](function(_0x31db09){var _0x1794d7=Object['keys'](_0x31db09);if(_0x31db09[_0x1794d7[0x0]]['error']&&parseInt(_0x31db09[_0x1794d7[0x0]][_0x8cc5('0x27')])===0x0){var _0x5d23b5={'messageId':_0x31db09[_0x1794d7[0x0]][_0x8cc5('0x65')]};if(!_0x11c09e[_0x8cc5('0x3d')]){_0x5d23b5[_0x8cc5('0x3e')]=!![];}return _0x6043c4[_0x8cc5('0x18')](_0x5d23b5);}else{return logger['error'](_0x8cc5('0x28'),_0x8cc5('0x29'),'csc',util[_0x8cc5('0x2a')](_0x31db09[_0x8cc5('0x27')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x584887){return logger['error'](_0x8cc5('0x28'),_0x8cc5('0x29'),_0x8cc5('0x5b'),util[_0x8cc5('0x2a')](_0x584887,{'showHidden':![],'depth':null}));});}else{logger[_0x8cc5('0x27')](_0x8cc5('0x28'),_0x8cc5('0x29'),'csc',_0x8cc5('0x66'));}break;case _0x8cc5('0x67'):if(_0x11c09e[_0x8cc5('0x5d')]){var _0x599895={'method':_0x8cc5('0x35'),'uri':_0x8cc5('0x68'),'headers':{'Authorization':_0x11c09e[_0x8cc5('0x5d')]},'body':{'content':_0x13a706[_0x8cc5('0xc')],'to':[_0x13a706[_0x8cc5('0x21')]],'from':_0x11c09e[_0x8cc5('0x21')],'binary':![],'clientMessageId':'uuid','charset':_0x8cc5('0x69')},'json':!![]};rp(_0x599895)[_0x8cc5('0x17')](function(_0x38d818){if(!_0x38d818['error']){var _0x3841b9={'messageId':_0x38d818[_0x8cc5('0x22')][0x0][_0x8cc5('0x6a')]};if(!_0x11c09e[_0x8cc5('0x3d')]){_0x3841b9[_0x8cc5('0x3e')]=!![];}return _0x6043c4['update'](_0x3841b9);}else{return logger[_0x8cc5('0x27')](_0x8cc5('0x28'),'afterCreate',_0x8cc5('0x67'),util[_0x8cc5('0x2a')](_0x38d818[_0x8cc5('0x27')],{'showHidden':![],'depth':null}));}})[_0x8cc5('0x1a')](function(_0x1d75c8){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cc5('0x29'),_0x8cc5('0x67'),util[_0x8cc5('0x2a')](_0x1d75c8,{'showHidden':![],'depth':null}));});}else{logger[_0x8cc5('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cc5('0x29'),'clickatell',_0x8cc5('0x66'));}break;case'intelepeer':if(_0x11c09e[_0x8cc5('0x5d')]){var _0x173200={};var _0x3e401f={'method':_0x8cc5('0x35'),'uri':_0x8cc5('0x6b'),'headers':{'Authorization':_0x8cc5('0x6c')+_0x11c09e[_0x8cc5('0x5d')],'Content-Type':_0x8cc5('0x58')},'body':{'from':_0x11c09e['phone'],'to':_0x13a706['phone'],'text':_0x13a706[_0x8cc5('0xc')]},'json':!![]};return rp(_0x3e401f)[_0x8cc5('0x17')](function(_0xf5810){if(_0xf5810['code']==0xca){_0x173200[_0x8cc5('0x6d')]=_0xf5810;var _0x36a439={'method':_0x8cc5('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x11c09e[_0x8cc5('0x5d')],'Content-Type':_0x8cc5('0x58')},'body':{'refid':_0x173200[_0x8cc5('0x6d')]['refid']},'json':!![]};return rp(_0x36a439)[_0x8cc5('0x17')](function(_0x3c5feb){_0x173200[_0x8cc5('0x6e')]=_0x3c5feb;var _0x4cef77={'messageId':_0x173200[_0x8cc5('0x6d')][_0x8cc5('0x6f')],'read':!![]};return _0x6043c4[_0x8cc5('0x18')](_0x4cef77);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8cc5('0x29'),'intelepeer',util[_0x8cc5('0x2a')](_0xf5810,{'showHidden':![],'depth':null}));}})[_0x8cc5('0x1a')](function(_0x22a6e4){return logger[_0x8cc5('0x27')](_0x8cc5('0x28'),_0x8cc5('0x29'),_0x8cc5('0x70'),util[_0x8cc5('0x2a')](_0x22a6e4,{'showHidden':![],'depth':null}));});}else{return logger[_0x8cc5('0x27')](_0x8cc5('0x28'),'afterCreate','intelepeer',_0x8cc5('0x71'));}break;}}})[_0x8cc5('0x72')](function(){_0x2e5694();});}else{_0x2e5694();}}},'charset':_0x8cc5('0x73'),'collate':_0x8cc5('0x74')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 7341c00..f2e827f 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 _0x757a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsMessage.socket','request','then','SmsMessage,\x20%s,\x20%s,\x20%s','error','SmsMessage,\x20%s,\x20%s','message','info','catch','CreateSmsMessage','SmsMessage','create','body','raw','debug','stringify','util','moment'];(function(_0x446d7b,_0x3de650){var _0x23a654=function(_0x422706){while(--_0x422706){_0x446d7b['push'](_0x446d7b['shift']());}};_0x23a654(++_0x3de650);}(_0x757a,0xde));var _0xa757=function(_0x3dd1cf,_0xbb5b6b){_0x3dd1cf=_0x3dd1cf-0x0;var _0x4eb2cf=_0x757a[_0x3dd1cf];return _0x4eb2cf;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});config[_0xa757('0x9')]=_['defaults'](config[_0xa757('0x9')],{'host':_0xa757('0xa'),'port':0x18eb});var socket=require(_0xa757('0xb'))(new Redis(config[_0xa757('0x9')]));require(_0xa757('0xc'))['register'](socket);function respondWithRpcPromise(_0x89c630,_0x2ca96f,_0x32f0ec){return new BPromise(function(_0x3e2c9a,_0xb7610b){return client[_0xa757('0xd')](_0x89c630,_0x32f0ec)[_0xa757('0xe')](function(_0x483d77){logger['info']('SmsMessage,\x20%s,\x20%s',_0x2ca96f,'request\x20sent');logger['debug'](_0xa757('0xf'),_0x2ca96f,'request\x20sent',JSON['stringify'](_0x483d77));if(_0x483d77[_0xa757('0x10')]){if(_0x483d77['error']['code']===0x1f4){logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);return _0xb7610b(_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);}logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);return _0x3e2c9a(_0x483d77['error'][_0xa757('0x12')]);}else{logger[_0xa757('0x13')](_0xa757('0x11'),_0x2ca96f,'request\x20sent');_0x3e2c9a(_0x483d77['result'][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x1bd14c){logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x1bd14c);_0xb7610b(_0x1bd14c);});});}exports[_0xa757('0x15')]=function(_0x4bd137){var _0x58954=this;return new Promise(function(_0x4fec52,_0x32c2a1){return db[_0xa757('0x16')][_0xa757('0x17')](_0x4bd137[_0xa757('0x18')],{'raw':_0x4bd137['options']?_0x4bd137['options'][_0xa757('0x19')]===undefined?!![]:![]:!![]})[_0xa757('0xe')](function(_0x2ba923){logger[_0xa757('0x13')](_0xa757('0x15'),_0x4bd137);logger[_0xa757('0x1a')](_0xa757('0x15'),_0x4bd137,JSON[_0xa757('0x1b')](_0x2ba923));_0x4fec52(_0x2ba923);})[_0xa757('0x14')](function(_0x59fae6){logger[_0xa757('0x10')]('CreateSmsMessage',_0x59fae6[_0xa757('0x12')],_0x4bd137);_0x32c2a1(_0x58954['error'](0x1f4,_0x59fae6[_0xa757('0x12')]));});});}; \ No newline at end of file +var _0x757a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsMessage.socket','request','then','SmsMessage,\x20%s,\x20%s,\x20%s','error','SmsMessage,\x20%s,\x20%s','message','info','catch','CreateSmsMessage','SmsMessage','create','body','raw','debug','stringify','util','moment'];(function(_0x4812e7,_0x41379c){var _0x4faf01=function(_0x255eb9){while(--_0x255eb9){_0x4812e7['push'](_0x4812e7['shift']());}};_0x4faf01(++_0x41379c);}(_0x757a,0xde));var _0xa757=function(_0x6ed1b,_0x3c7d22){_0x6ed1b=_0x6ed1b-0x0;var _0x2ad822=_0x757a[_0x6ed1b];return _0x2ad822;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});config[_0xa757('0x9')]=_['defaults'](config[_0xa757('0x9')],{'host':_0xa757('0xa'),'port':0x18eb});var socket=require(_0xa757('0xb'))(new Redis(config[_0xa757('0x9')]));require(_0xa757('0xc'))['register'](socket);function respondWithRpcPromise(_0x89c630,_0x2ca96f,_0x32f0ec){return new BPromise(function(_0x3e2c9a,_0xb7610b){return client[_0xa757('0xd')](_0x89c630,_0x32f0ec)[_0xa757('0xe')](function(_0x483d77){logger['info']('SmsMessage,\x20%s,\x20%s',_0x2ca96f,'request\x20sent');logger['debug'](_0xa757('0xf'),_0x2ca96f,'request\x20sent',JSON['stringify'](_0x483d77));if(_0x483d77[_0xa757('0x10')]){if(_0x483d77['error']['code']===0x1f4){logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);return _0xb7610b(_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);}logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);return _0x3e2c9a(_0x483d77['error'][_0xa757('0x12')]);}else{logger[_0xa757('0x13')](_0xa757('0x11'),_0x2ca96f,'request\x20sent');_0x3e2c9a(_0x483d77['result'][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x1bd14c){logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x1bd14c);_0xb7610b(_0x1bd14c);});});}exports[_0xa757('0x15')]=function(_0x4bd137){var _0x58954=this;return new Promise(function(_0x4fec52,_0x32c2a1){return db[_0xa757('0x16')][_0xa757('0x17')](_0x4bd137[_0xa757('0x18')],{'raw':_0x4bd137['options']?_0x4bd137['options'][_0xa757('0x19')]===undefined?!![]:![]:!![]})[_0xa757('0xe')](function(_0x2ba923){logger[_0xa757('0x13')](_0xa757('0x15'),_0x4bd137);logger[_0xa757('0x1a')](_0xa757('0x15'),_0x4bd137,JSON[_0xa757('0x1b')](_0x2ba923));_0x4fec52(_0x2ba923);})[_0xa757('0x14')](function(_0x59fae6){logger[_0xa757('0x10')]('CreateSmsMessage',_0x59fae6[_0xa757('0x12')],_0x4bd137);_0x32c2a1(_0x58954['error'](0x1f4,_0x59fae6[_0xa757('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 6d92101..1cf2dd3 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 _0xb9ea=['save','remove','update','emit','removeListener','register','smsMessage:'];(function(_0xd1f854,_0x532346){var _0x548294=function(_0x4be823){while(--_0x4be823){_0xd1f854['push'](_0xd1f854['shift']());}};_0x548294(++_0x532346);}(_0xb9ea,0x126));var _0xab9e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb9ea[_0x3dd15e];return _0x231fd0;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xab9e('0x0'),_0xab9e('0x1'),_0xab9e('0x2')];function createListener(_0x4c5ebe,_0x28c89e){return function(_0x575db1){_0x28c89e[_0xab9e('0x3')](_0x4c5ebe,_0x575db1);};}function removeListener(_0xe34469,_0x2c7c84){return function(){SmsMessageEvents[_0xab9e('0x4')](_0xe34469,_0x2c7c84);};}exports[_0xab9e('0x5')]=function(_0x1aaf7d){for(var _0x4a8272=0x0,_0x1d7274=events['length'];_0x4a8272<_0x1d7274;_0x4a8272++){var _0x31e9ba=events[_0x4a8272];var _0x902726=createListener(_0xab9e('0x6')+_0x31e9ba,_0x1aaf7d);SmsMessageEvents['on'](_0x31e9ba,_0x902726);}}; \ No newline at end of file +var _0x2715=['save','remove','update','length','smsMessage:','./smsMessage.events'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x2715,0x7d));var _0x5271=function(_0x3ff135,_0x1009f2){_0x3ff135=_0x3ff135-0x0;var _0x1acd6d=_0x2715[_0x3ff135];return _0x1acd6d;};'use strict';var SmsMessageEvents=require(_0x5271('0x0'));var events=[_0x5271('0x1'),_0x5271('0x2'),_0x5271('0x3')];function createListener(_0x5540b6,_0x305a1e){return function(_0x5de1ea){_0x305a1e['emit'](_0x5540b6,_0x5de1ea);};}function removeListener(_0x40c201,_0x158c61){return function(){SmsMessageEvents['removeListener'](_0x40c201,_0x158c61);};}exports['register']=function(_0x113d36){for(var _0x428ba8=0x0,_0x2480e0=events[_0x5271('0x4')];_0x428ba8<_0x2480e0;_0x428ba8++){var _0x118945=events[_0x428ba8];var _0x58d2ed=createListener(_0x5271('0x5')+_0x118945,_0x113d36);SmsMessageEvents['on'](_0x118945,_0x58d2ed);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index c89dccd..39e1df8 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 _0xacc6=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put'];(function(_0x3478ed,_0x1e20c0){var _0x4b963c=function(_0x4433a2){while(--_0x4433a2){_0x3478ed['push'](_0x3478ed['shift']());}};_0x4b963c(++_0x1e20c0);}(_0xacc6,0x150));var _0x6acc=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0xacc6[_0x4de586];return _0x46baf5;};'use strict';var multer=require(_0x6acc('0x0'));var util=require(_0x6acc('0x1'));var path=require(_0x6acc('0x2'));var timeout=require(_0x6acc('0x3'));var express=require(_0x6acc('0x4'));var router=express['Router']();var auth=require(_0x6acc('0x5'));var interaction=require(_0x6acc('0x6'));var config=require(_0x6acc('0x7'));var controller=require('./smsQueue.controller');router[_0x6acc('0x8')]('/',auth['isAuthenticated'](),controller[_0x6acc('0x9')]);router[_0x6acc('0x8')]('/describe',auth[_0x6acc('0xa')](),controller['describe']);router[_0x6acc('0x8')](_0x6acc('0xb'),auth[_0x6acc('0xa')](),controller[_0x6acc('0xc')]);router['get'](_0x6acc('0xd'),auth['isAuthenticated'](),controller[_0x6acc('0xe')]);router[_0x6acc('0x8')](_0x6acc('0xf'),auth[_0x6acc('0xa')](),controller[_0x6acc('0x10')]);router[_0x6acc('0x8')]('/:id/users',auth[_0x6acc('0xa')](),controller[_0x6acc('0x11')]);router[_0x6acc('0x12')]('/',auth[_0x6acc('0xa')](),controller[_0x6acc('0x13')]);router['post']('/:id/teams',auth[_0x6acc('0xa')](),controller[_0x6acc('0x14')]);router[_0x6acc('0x12')](_0x6acc('0x15'),auth[_0x6acc('0xa')](),controller[_0x6acc('0x16')]);router[_0x6acc('0x17')](_0x6acc('0xb'),auth[_0x6acc('0xa')](),controller[_0x6acc('0x18')]);router[_0x6acc('0x19')](_0x6acc('0xb'),auth[_0x6acc('0xa')](),controller[_0x6acc('0x1a')]);router[_0x6acc('0x19')](_0x6acc('0xf'),auth[_0x6acc('0xa')](),controller[_0x6acc('0x1b')]);router['delete'](_0x6acc('0x15'),auth[_0x6acc('0xa')](),controller[_0x6acc('0x1c')]);module[_0x6acc('0x1d')]=router; \ No newline at end of file +var _0x6333=['getMembers','/:id/teams','/:id/users','post','create','addTeams','/:id','update','delete','removeAgents','exports','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id/members'];(function(_0x22985,_0x1150af){var _0x4a0a3d=function(_0x132933){while(--_0x132933){_0x22985['push'](_0x22985['shift']());}};_0x4a0a3d(++_0x1150af);}(_0x6333,0x83));var _0x3633=function(_0x3f7516,_0x342f8f){_0x3f7516=_0x3f7516-0x0;var _0x3fbb14=_0x6333[_0x3f7516];return _0x3fbb14;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3633('0x0'));var express=require('express');var router=express[_0x3633('0x1')]();var auth=require(_0x3633('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x3633('0x3'));var controller=require('./smsQueue.controller');router[_0x3633('0x4')]('/',auth[_0x3633('0x5')](),controller['index']);router['get'](_0x3633('0x6'),auth[_0x3633('0x5')](),controller[_0x3633('0x7')]);router['get']('/:id',auth[_0x3633('0x5')](),controller['show']);router['get'](_0x3633('0x8'),auth[_0x3633('0x5')](),controller[_0x3633('0x9')]);router['get'](_0x3633('0xa'),auth[_0x3633('0x5')](),controller['getTeams']);router['get'](_0x3633('0xb'),auth['isAuthenticated'](),controller['getAgents']);router[_0x3633('0xc')]('/',auth[_0x3633('0x5')](),controller[_0x3633('0xd')]);router[_0x3633('0xc')](_0x3633('0xa'),auth['isAuthenticated'](),controller[_0x3633('0xe')]);router[_0x3633('0xc')](_0x3633('0xb'),auth[_0x3633('0x5')](),controller['addAgents']);router['put'](_0x3633('0xf'),auth[_0x3633('0x5')](),controller[_0x3633('0x10')]);router[_0x3633('0x11')](_0x3633('0xf'),auth[_0x3633('0x5')](),controller['destroy']);router[_0x3633('0x11')](_0x3633('0xa'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x3633('0x11')]('/:id/users',auth['isAuthenticated'](),controller[_0x3633('0x12')]);module[_0x3633('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 73bd9f7..671d876 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 _0xec17=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x37ffc6,_0x4ed1f5){var _0x51ceca=function(_0x269b32){while(--_0x269b32){_0x37ffc6['push'](_0x37ffc6['shift']());}};_0x51ceca(++_0x4ed1f5);}(_0xec17,0xa9));var _0x7ec1=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xec17[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x7ec1('0x0'));module[_0x7ec1('0x1')]={'name':{'type':Sequelize[_0x7ec1('0x2')],'unique':_0x7ec1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7ec1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7ec1('0x5')](_0x7ec1('0x6'),_0x7ec1('0x7'),_0x7ec1('0x8'))}}; \ No newline at end of file +var _0x8c93=['beepall','roundrobin','sequelize','exports','STRING','name','rrmemory'];(function(_0x21f871,_0x1dd40f){var _0x184d72=function(_0x3bf614){while(--_0x3bf614){_0x21f871['push'](_0x21f871['shift']());}};_0x184d72(++_0x1dd40f);}(_0x8c93,0xd4));var _0x38c9=function(_0x3073ed,_0x55e7be){_0x3073ed=_0x3073ed-0x0;var _0x2b9dff=_0x8c93[_0x3073ed];return _0x2b9dff;};'use strict';var Sequelize=require(_0x38c9('0x0'));module[_0x38c9('0x1')]={'name':{'type':Sequelize[_0x38c9('0x2')],'unique':_0x38c9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x38c9('0x4'),_0x38c9('0x5'),_0x38c9('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 939bc57..6d03907 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 _0x1967=['localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','json','count','offset','reject','save','update','then','destroy','get','SmsQueues','error','name','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','filters','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','params','describe','getMembers','findOne','keys','UserSmsQueue','hasOwnProperty','SmsQueueId','User','agent','smsPause','updatedAt','rows','format','SIP','createdAt','getTeams','Team','addTeams','Agents','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','ids','select','team_has_sms_queues','join','user_has_teams','clone','toString','QueryTypes','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults'];(function(_0x2e231a,_0x31ff80){var _0x440a4a=function(_0x2aeed7){while(--_0x2aeed7){_0x2e231a['push'](_0x2e231a['shift']());}};_0x440a4a(++_0x31ff80);}(_0x1967,0x173));var _0x7196=function(_0x357589,_0x31a54e){_0x357589=_0x357589-0x0;var _0x355639=_0x1967[_0x357589];return _0x355639;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7196('0x0'));var rimraf=require(_0x7196('0x1'));var zipdir=require(_0x7196('0x2'));var jsonpatch=require(_0x7196('0x3'));var rp=require(_0x7196('0x4'));var moment=require(_0x7196('0x5'));var BPromise=require(_0x7196('0x6'));var Mustache=require(_0x7196('0x7'));var util=require(_0x7196('0x8'));var path=require(_0x7196('0x9'));var sox=require('sox');var csv=require(_0x7196('0xa'));var ejs=require(_0x7196('0xb'));var fs=require('fs');var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0xa'));var querystring=require(_0x7196('0x10'));var Papa=require(_0x7196('0x11'));var Redis=require(_0x7196('0x12'));var authService=require(_0x7196('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x14'));var logger=require(_0x7196('0x15'))(_0x7196('0x16'));var utils=require(_0x7196('0x17'));var config=require(_0x7196('0x18'));var db=require(_0x7196('0x19'))['db'];config[_0x7196('0x1a')]=_[_0x7196('0x1b')](config[_0x7196('0x1a')],{'host':_0x7196('0x1c'),'port':0x18eb});var socket=require(_0x7196('0x1d'))(new Redis(config['redis']));require(_0x7196('0x1e'))[_0x7196('0x1f')](socket);function respondWithStatusCode(_0x3545aa,_0xf098c1){_0xf098c1=_0xf098c1||0xcc;return function(_0x511aa1){if(_0x511aa1){return _0x3545aa[_0x7196('0x20')](_0xf098c1);}return _0x3545aa['status'](_0xf098c1)[_0x7196('0x21')]();};}function respondWithResult(_0x2590a6,_0xf7e97){_0xf7e97=_0xf7e97||0xc8;return function(_0x3ed1ad){if(_0x3ed1ad){return _0x2590a6[_0x7196('0x22')](_0xf7e97)[_0x7196('0x23')](_0x3ed1ad);}};}function respondWithFilteredResult(_0x22bd62,_0x1ed296){return function(_0x3e4e69){if(_0x3e4e69){var _0x32fe2b=_0x3e4e69[_0x7196('0x24')],_0x385f2d=_0x1ed296[_0x7196('0x25')],_0x5b716a=_0x1ed296[_0x7196('0x25')]+_0x1ed296['limit'],_0x4c4f91;if(_0x5b716a>=_0x32fe2b){_0x5b716a=_0x32fe2b;_0x4c4f91=0xc8;}else{_0x4c4f91=0xce;}_0x22bd62[_0x7196('0x22')](_0x4c4f91);return _0x22bd62['set']('Content-Range',_0x385f2d+'-'+_0x5b716a+'/'+_0x32fe2b)[_0x7196('0x23')](_0x3e4e69);}return null;};}function patchUpdates(_0x627223){return function(_0x8dee9d){try{jsonpatch['apply'](_0x8dee9d,_0x627223,!![]);}catch(_0x57c390){return BPromise[_0x7196('0x26')](_0x57c390);}return _0x8dee9d[_0x7196('0x27')]();};}function saveUpdates(_0x598a26,_0x18649b){return function(_0x27ff84){if(_0x27ff84){return _0x27ff84[_0x7196('0x28')](_0x598a26)[_0x7196('0x29')](function(_0x38b3d6){return _0x38b3d6;});}return null;};}function removeEntity(_0x549f34,_0x3f8178){return function(_0x520d01){if(_0x520d01){return _0x520d01[_0x7196('0x2a')]()[_0x7196('0x29')](function(){var _0x2e15c7=_0x520d01[_0x7196('0x2b')]({'plain':!![]});var _0x70aa65=_0x7196('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x70aa65,'resourceId':_0x2e15c7['id']}})[_0x7196('0x29')](function(){return _0x520d01;});})[_0x7196('0x29')](function(){_0x549f34[_0x7196('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aa538,_0x41cfd2){return function(_0x162cfc){if(!_0x162cfc){_0x5aa538[_0x7196('0x20')](0x194);}return _0x162cfc;};}function handleError(_0x4c6006,_0x35eef9){_0x35eef9=_0x35eef9||0x1f4;return function(_0x4ecea1){logger[_0x7196('0x2d')](_0x4ecea1['stack']);if(_0x4ecea1[_0x7196('0x2e')]){delete _0x4ecea1[_0x7196('0x2e')];}_0x4c6006[_0x7196('0x22')](_0x35eef9)['send'](_0x4ecea1);};}exports[_0x7196('0x2f')]=function(_0x45d567,_0x2f9583){var _0xf999e9={},_0x50c386={},_0x39710d={'count':0x0,'rows':[]};var _0x429160=_[_0x7196('0x30')](db[_0x7196('0x31')][_0x7196('0x32')],function(_0x2786f3){return{'name':_0x2786f3[_0x7196('0x33')],'type':_0x2786f3[_0x7196('0x34')][_0x7196('0x35')]};});_0x50c386[_0x7196('0x36')]=_[_0x7196('0x30')](_0x429160,'name');_0x50c386[_0x7196('0x37')]=_['keys'](_0x45d567[_0x7196('0x37')]);_0x50c386['filters']=_[_0x7196('0x38')](_0x50c386[_0x7196('0x36')],_0x50c386['query']);_0xf999e9[_0x7196('0x39')]=_[_0x7196('0x38')](_0x50c386[_0x7196('0x36')],qs[_0x7196('0x3a')](_0x45d567[_0x7196('0x37')]['fields']));_0xf999e9[_0x7196('0x39')]=_0xf999e9[_0x7196('0x39')][_0x7196('0x3b')]?_0xf999e9[_0x7196('0x39')]:_0x50c386[_0x7196('0x36')];if(!_0x45d567[_0x7196('0x37')]['hasOwnProperty'](_0x7196('0x3c'))){_0xf999e9[_0x7196('0x3d')]=qs[_0x7196('0x3d')](_0x45d567['query'][_0x7196('0x3d')]);_0xf999e9[_0x7196('0x25')]=qs[_0x7196('0x25')](_0x45d567[_0x7196('0x37')][_0x7196('0x25')]);}_0xf999e9[_0x7196('0x3e')]=qs[_0x7196('0x3f')](_0x45d567[_0x7196('0x37')][_0x7196('0x3f')]);_0xf999e9[_0x7196('0x40')]=qs['filters'](_[_0x7196('0x41')](_0x45d567[_0x7196('0x37')],_0x50c386['filters']));if(_0x45d567[_0x7196('0x37')]['filter']){_0xf999e9['where']=_[_0x7196('0x42')](_0xf999e9[_0x7196('0x40')],{'$or':_['map'](_0x429160,function(_0x587f6f){if(_0x587f6f[_0x7196('0x34')]!==_0x7196('0x43')){var _0xed32cd={};_0xed32cd[_0x587f6f['name']]={'$like':'%'+_0x45d567[_0x7196('0x37')][_0x7196('0x44')]+'%'};return _0xed32cd;}})});}_0xf999e9=_[_0x7196('0x42')]({},_0xf999e9,_0x45d567[_0x7196('0x45')]);var _0x16da09={'where':_0xf999e9[_0x7196('0x40')]};return db[_0x7196('0x31')][_0x7196('0x24')](_0x16da09)['then'](function(_0x89c8ea){_0x39710d[_0x7196('0x24')]=_0x89c8ea;if(_0x45d567['query'][_0x7196('0x46')]){_0xf999e9[_0x7196('0x47')]=[{'all':!![]}];}return db['SmsQueue'][_0x7196('0x48')](_0xf999e9);})[_0x7196('0x29')](function(_0x3b78c8){_0x39710d['rows']=_0x3b78c8;return _0x39710d;})[_0x7196('0x29')](respondWithFilteredResult(_0x2f9583,_0xf999e9))[_0x7196('0x49')](handleError(_0x2f9583,null));};exports['show']=function(_0xcd287c,_0x1a7052){var _0x4f0c6c={'raw':!![],'where':{'id':_0xcd287c['params']['id']}},_0x335e6f={};_0x335e6f['model']=_['keys'](db['SmsQueue']['rawAttributes']);_0x335e6f[_0x7196('0x37')]=_['keys'](_0xcd287c[_0x7196('0x37')]);_0x335e6f[_0x7196('0x4a')]=_[_0x7196('0x38')](_0x335e6f[_0x7196('0x36')],_0x335e6f['query']);_0x4f0c6c[_0x7196('0x39')]=_['intersection'](_0x335e6f[_0x7196('0x36')],qs[_0x7196('0x3a')](_0xcd287c[_0x7196('0x37')]['fields']));_0x4f0c6c[_0x7196('0x39')]=_0x4f0c6c[_0x7196('0x39')][_0x7196('0x3b')]?_0x4f0c6c['attributes']:_0x335e6f['model'];if(_0xcd287c[_0x7196('0x37')]['includeAll']){_0x4f0c6c[_0x7196('0x47')]=[{'all':!![]}];}_0x4f0c6c=_['merge']({},_0x4f0c6c,_0xcd287c['options']);return db[_0x7196('0x31')]['find'](_0x4f0c6c)['then'](handleEntityNotFound(_0x1a7052,null))['then'](respondWithResult(_0x1a7052,null))[_0x7196('0x49')](handleError(_0x1a7052,null));};exports['create']=function(_0x48e3b5,_0x28591e){return db[_0x7196('0x31')][_0x7196('0x4b')](_0x48e3b5[_0x7196('0x4c')],{})['then'](function(_0x50cc66){var _0x564688=_0x48e3b5[_0x7196('0x4d')][_0x7196('0x2b')]({'plain':!![]});if(!_0x564688)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x564688[_0x7196('0x4e')]===_0x7196('0x4d')){var _0x3fe092=_0x50cc66['get']({'plain':!![]});var _0x317ab6='SmsQueues';return db[_0x7196('0x4f')][_0x7196('0x50')]({'where':{'name':_0x317ab6,'userProfileId':_0x564688[_0x7196('0x51')]},'raw':!![]})[_0x7196('0x29')](function(_0x41a9aa){if(_0x41a9aa&&_0x41a9aa[_0x7196('0x52')]===0x0){return db[_0x7196('0x53')][_0x7196('0x4b')]({'name':_0x3fe092['name'],'resourceId':_0x3fe092['id'],'type':_0x41a9aa['name'],'sectionId':_0x41a9aa['id']},{})[_0x7196('0x29')](function(){return _0x50cc66;});}else{return _0x50cc66;}})[_0x7196('0x49')](function(_0x40f820){logger[_0x7196('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40f820);throw _0x40f820;});}return _0x50cc66;})[_0x7196('0x29')](respondWithResult(_0x28591e,0xc9))[_0x7196('0x49')](handleError(_0x28591e,null));};exports[_0x7196('0x28')]=function(_0x11dc10,_0x9fcfd4){if(_0x11dc10[_0x7196('0x4c')]['id']){delete _0x11dc10[_0x7196('0x4c')]['id'];}return db[_0x7196('0x31')][_0x7196('0x50')]({'where':{'id':_0x11dc10[_0x7196('0x54')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x9fcfd4,null))['then'](saveUpdates(_0x11dc10[_0x7196('0x4c')],null))[_0x7196('0x29')](respondWithResult(_0x9fcfd4,null))[_0x7196('0x49')](handleError(_0x9fcfd4,null));};exports['destroy']=function(_0x1f098c,_0x5ca1ca){return db[_0x7196('0x31')][_0x7196('0x50')]({'where':{'id':_0x1f098c[_0x7196('0x54')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x5ca1ca,null))[_0x7196('0x29')](removeEntity(_0x5ca1ca,null))['catch'](handleError(_0x5ca1ca,null));};exports[_0x7196('0x55')]=function(_0x5b77fc,_0x4be36d){return db['SmsQueue'][_0x7196('0x55')]()[_0x7196('0x29')](respondWithResult(_0x4be36d,null))[_0x7196('0x49')](handleError(_0x4be36d,null));};exports[_0x7196('0x56')]=function(_0x105a3f,_0x41fa94,_0x2d8b3d){var _0x560ddb={'raw':!![],'where':{}},_0x293467={},_0x14dc43;return db[_0x7196('0x31')][_0x7196('0x57')]({'where':{'id':_0x105a3f[_0x7196('0x54')]['id']}})['then'](handleEntityNotFound(_0x41fa94,null))['then'](function(_0xa7ecfb){if(_0xa7ecfb){_0x14dc43=_0xa7ecfb[_0x7196('0x2b')]({'plain':!![]});_0x293467[_0x7196('0x36')]=_[_0x7196('0x58')](db[_0x7196('0x59')][_0x7196('0x32')]);_0x293467[_0x7196('0x37')]=_[_0x7196('0x58')](_0x105a3f[_0x7196('0x37')]);_0x293467[_0x7196('0x4a')]=_[_0x7196('0x38')](_0x293467['model'],_0x293467[_0x7196('0x37')]);_0x560ddb[_0x7196('0x39')]=_[_0x7196('0x38')](_0x293467[_0x7196('0x36')],qs['fields'](_0x105a3f[_0x7196('0x37')][_0x7196('0x3a')]));_0x560ddb[_0x7196('0x39')]=_0x560ddb[_0x7196('0x39')][_0x7196('0x3b')]?_0x560ddb[_0x7196('0x39')]:_0x293467[_0x7196('0x36')];if(!_0x105a3f['query'][_0x7196('0x5a')](_0x7196('0x3c'))){_0x560ddb[_0x7196('0x3d')]=qs[_0x7196('0x3d')](_0x105a3f['query'][_0x7196('0x3d')]);_0x560ddb[_0x7196('0x25')]=qs[_0x7196('0x25')](_0x105a3f[_0x7196('0x37')][_0x7196('0x25')]);}_0x560ddb[_0x7196('0x3e')]=qs[_0x7196('0x3f')](_0x105a3f['query']['sort']);_0x560ddb['where']=qs[_0x7196('0x4a')](_['pick'](_0x105a3f[_0x7196('0x37')],_0x293467[_0x7196('0x4a')]));_0x560ddb[_0x7196('0x40')][_0x7196('0x5b')]=_0xa7ecfb['id'];if(_0x105a3f[_0x7196('0x37')][_0x7196('0x44')]){_0x560ddb[_0x7196('0x40')]=_[_0x7196('0x42')](_0x560ddb[_0x7196('0x40')],{'$or':_['map'](_0x560ddb['attributes'],function(_0x4542c1){var _0x3f939a={};_0x3f939a[_0x4542c1]={'$like':'%'+_0x105a3f[_0x7196('0x37')][_0x7196('0x44')]+'%'};return _0x3f939a;})});}_0x560ddb=_[_0x7196('0x42')]({},_0x560ddb,_0x105a3f[_0x7196('0x45')]);return db[_0x7196('0x59')][_0x7196('0x48')](_0x560ddb);}})['then'](function(_0x4cb99d){if(_0x4cb99d){return db[_0x7196('0x5c')]['findAndCountAll']({'where':{'id':_[_0x7196('0x30')](_0x4cb99d,'UserId'),'role':_0x7196('0x5d')},'attributes':['id',_0x7196('0x2e'),_0x7196('0x5e'),_0x7196('0x5f'),'createdAt']});}})['then'](function(_0x33d301){if(_0x33d301){return{'count':_0x33d301['count'],'rows':_[_0x7196('0x30')](_0x33d301[_0x7196('0x60')],function(_0x4526e8){return{'membername':_0x4526e8[_0x7196('0x2e')],'UserId':_0x4526e8['id'],'queue_name':_0x14dc43[_0x7196('0x2e')],'SmsQueueId':_0x14dc43['id'],'interface':util[_0x7196('0x61')]('%s/%s',_0x7196('0x62'),_0x4526e8[_0x7196('0x2e')]),'penalty':0x0,'paused':_0x4526e8[_0x7196('0x5e')],'createdAt':_0x4526e8[_0x7196('0x63')],'updatedAt':_0x4526e8[_0x7196('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7196('0x29')](respondWithFilteredResult(_0x41fa94,_0x560ddb))[_0x7196('0x49')](handleError(_0x41fa94,null));};exports[_0x7196('0x64')]=function(_0x13cbe2,_0xa20de8,_0x3d3768){var _0x2181f5={};var _0x53a6fa={};var _0x431415;var _0x13f802;return db['SmsQueue']['findOne']({'where':{'id':_0x13cbe2[_0x7196('0x54')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0xa20de8,null))[_0x7196('0x29')](function(_0x5b2c33){if(_0x5b2c33){_0x431415=_0x5b2c33;_0x53a6fa[_0x7196('0x36')]=_['keys'](db[_0x7196('0x65')][_0x7196('0x32')]);_0x53a6fa['query']=_[_0x7196('0x58')](_0x13cbe2['query']);_0x53a6fa['filters']=_[_0x7196('0x38')](_0x53a6fa[_0x7196('0x36')],_0x53a6fa[_0x7196('0x37')]);_0x2181f5['attributes']=_[_0x7196('0x38')](_0x53a6fa['model'],qs[_0x7196('0x3a')](_0x13cbe2[_0x7196('0x37')][_0x7196('0x3a')]));_0x2181f5[_0x7196('0x39')]=_0x2181f5[_0x7196('0x39')]['length']?_0x2181f5[_0x7196('0x39')]:_0x53a6fa[_0x7196('0x36')];_0x2181f5[_0x7196('0x3e')]=qs[_0x7196('0x3f')](_0x13cbe2[_0x7196('0x37')][_0x7196('0x3f')]);_0x2181f5[_0x7196('0x40')]=qs[_0x7196('0x4a')](_['pick'](_0x13cbe2[_0x7196('0x37')],_0x53a6fa[_0x7196('0x4a')]));if(_0x13cbe2[_0x7196('0x37')][_0x7196('0x44')]){_0x2181f5['where']=_[_0x7196('0x42')](_0x2181f5[_0x7196('0x40')],{'$or':_['map'](_0x2181f5[_0x7196('0x39')],function(_0x53d470){var _0xd6d8cf={};_0xd6d8cf[_0x53d470]={'$like':'%'+_0x13cbe2['query'][_0x7196('0x44')]+'%'};return _0xd6d8cf;})});}_0x2181f5=_[_0x7196('0x42')]({},_0x2181f5,_0x13cbe2['options']);return _0x431415[_0x7196('0x64')](_0x2181f5);}})[_0x7196('0x29')](function(_0x2c2c53){if(_0x2c2c53){_0x13f802=_0x2c2c53['length'];if(!_0x13cbe2['query'][_0x7196('0x5a')]('nolimit')){_0x2181f5['limit']=qs[_0x7196('0x3d')](_0x13cbe2[_0x7196('0x37')][_0x7196('0x3d')]);_0x2181f5['offset']=qs[_0x7196('0x25')](_0x13cbe2[_0x7196('0x37')][_0x7196('0x25')]);}return _0x431415[_0x7196('0x64')](_0x2181f5);}})[_0x7196('0x29')](function(_0x26048c){if(_0x26048c){return _0x26048c?{'count':_0x13f802,'rows':_0x26048c}:null;}})[_0x7196('0x29')](respondWithResult(_0xa20de8,null))[_0x7196('0x49')](handleError(_0xa20de8,null));};exports[_0x7196('0x66')]=function(_0x446f28,_0x173fe5,_0x5eb2b5){var _0x5acff1=_0x446f28[_0x7196('0x4c')]['ids'];return db['Team'][_0x7196('0x48')]({'where':{'id':_0x5acff1},'attributes':['id'],'include':[{'model':db[_0x7196('0x5c')],'as':_0x7196('0x67'),'attributes':['id',_0x7196('0x2e'),'online','voicePause',_0x7196('0x68')],'raw':!![]}]})[_0x7196('0x29')](function(_0x1eea71){if(_0x1eea71){var _0x247b15=_['flatMap'](_0x1eea71,function(_0x4d8b8e){var _0x4afbee=_0x4d8b8e['get']({'plain':!![]});return _0x4afbee[_0x7196('0x67')];});return db[_0x7196('0x31')][_0x7196('0x50')]({'where':{'id':_0x446f28['params']['id']}})[_0x7196('0x29')](function(_0x40d4c3){return db[_0x7196('0x69')][_0x7196('0x6a')](function(_0x10712f){return _0x40d4c3[_0x7196('0x66')](_0x5acff1,{'transaction':_0x10712f})[_0x7196('0x29')](function(){return BPromise[_0x7196('0x6b')](_0x247b15,function(_0x5de550){return db[_0x7196('0x59')][_0x7196('0x6c')]({'where':{'UserId':_0x5de550['id'],'SmsQueueId':_0x446f28[_0x7196('0x54')]['id']},'transaction':_0x10712f});});})[_0x7196('0x29')](function(){_0x247b15[_0x7196('0x6d')](function(_0x4faf7b){socket[_0x7196('0x6e')](_0x7196('0x6f'),{'UserId':_0x4faf7b['id'],'SmsQueueId':_0x40d4c3['id']});});});});});}})[_0x7196('0x29')](respondWithStatusCode(_0x173fe5,null))['catch'](handleError(_0x173fe5,null));};exports[_0x7196('0x70')]=function(_0x4b98de,_0x53ae84,_0x1dcf93){return db[_0x7196('0x65')]['findAll']({'where':{'id':_0x4b98de[_0x7196('0x37')][_0x7196('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7196('0x67'),'attributes':['id'],'raw':!![]}]})[_0x7196('0x29')](handleEntityNotFound(_0x53ae84,null))[_0x7196('0x29')](function(_0x28d665){var _0x441ca1=_[_0x7196('0x30')](_0x28d665,'id');var _0x5d5d1f=[];var _0x3639be=[];var _0x460e51=squel[_0x7196('0x72')]();_0x460e51['field']('tq.TeamId')['from'](_0x7196('0x73'),'tq')[_0x7196('0x74')](_0x7196('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7196('0x40')]('SmsQueueId\x20=\x20?',_0x4b98de[_0x7196('0x54')]['id']);for(var _0x4e22df=0x0;_0x4e22df<_0x28d665[_0x7196('0x3b')];_0x4e22df+=0x1){let _0x18bafa=_0x28d665[_0x4e22df];for(var _0x33d5bf=0x0;_0x33d5bf<_0x18bafa[_0x7196('0x67')][_0x7196('0x3b')];_0x33d5bf+=0x1){let _0x10b628=_0x18bafa[_0x7196('0x67')][_0x33d5bf];var _0x48608b=_0x460e51[_0x7196('0x76')]();_0x48608b['where']('ut.UserId\x20=\x20?',_0x10b628['id']);_0x3639be['push'](db['sequelize']['query'](_0x48608b[_0x7196('0x77')](),{'type':db[_0x7196('0x69')][_0x7196('0x78')]['SELECT']})[_0x7196('0x29')](function(_0x49bf7e){if(_0x49bf7e['length']===0x1){return _0x10b628['id'];}else{var _0x4f7717=_[_0x7196('0x79')](_['map'](_0x49bf7e,_0x7196('0x7a')),function(_0x2fe382){return _[_0x7196('0x7b')](_0x441ca1,_0x2fe382);});if(_0x4f7717){return _0x10b628['id'];}}}));}}return BPromise[_0x7196('0x7c')](_0x3639be)[_0x7196('0x29')](function(_0x36893a){_0x5d5d1f=_(_0x5d5d1f)[_0x7196('0x7d')](_0x36893a)[_0x7196('0x7e')]()['value']();return db[_0x7196('0x31')][_0x7196('0x50')]({'where':{'id':_0x4b98de[_0x7196('0x54')]['id']}})['then'](function(_0x3a241a){return db[_0x7196('0x69')][_0x7196('0x6a')](function(_0x4fa1b5){return _0x3a241a[_0x7196('0x70')](_0x4b98de[_0x7196('0x37')][_0x7196('0x71')],{'transaction':_0x4fa1b5})['then'](function(){if(!_[_0x7196('0x7f')](_0x5d5d1f)){return _0x3a241a[_0x7196('0x80')](_0x5d5d1f,{'transaction':_0x4fa1b5});}})['then'](function(){_0x5d5d1f[_0x7196('0x6d')](function(_0x5db5f1){socket[_0x7196('0x6e')](_0x7196('0x81'),{'UserId':_0x5db5f1,'SmsQueueId':_0x3a241a['id']});});});});});});})['then'](respondWithStatusCode(_0x53ae84,null))[_0x7196('0x49')](handleError(_0x53ae84,null));};exports['addAgents']=function(_0x5d24ff,_0x2cae94,_0x4738c2){return db['SmsQueue'][_0x7196('0x50')]({'where':{'id':_0x5d24ff[_0x7196('0x54')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x2cae94,null))[_0x7196('0x29')](function(_0x5b91e5){if(_0x5b91e5){return _0x5b91e5[_0x7196('0x82')](_0x5d24ff[_0x7196('0x4c')][_0x7196('0x71')],_['omit'](_0x5d24ff['body'],[_0x7196('0x71'),'id'])||{})[_0x7196('0x83')](function(_0x87184a){for(var _0x2af201=0x0;_0x2af201<_0x5d24ff['body'][_0x7196('0x71')]['length'];_0x2af201+=0x1){socket[_0x7196('0x6e')]('userSmsQueue:save',{'UserId':_0x5d24ff[_0x7196('0x4c')][_0x7196('0x71')][_0x2af201],'SmsQueueId':_0x5d24ff[_0x7196('0x54')]['id']});}return _0x87184a;});}})[_0x7196('0x29')](respondWithResult(_0x2cae94,null))[_0x7196('0x49')](handleError(_0x2cae94,null));};exports[_0x7196('0x80')]=function(_0x342fb1,_0x4c9c35,_0x1ae8bc){return db[_0x7196('0x31')][_0x7196('0x50')]({'where':{'id':_0x342fb1[_0x7196('0x54')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x4c9c35,null))[_0x7196('0x29')](function(_0x186731){if(_0x186731){return _0x186731[_0x7196('0x80')](_0x342fb1['query'][_0x7196('0x71')])[_0x7196('0x29')](function(){if(_['isArray'](_0x342fb1[_0x7196('0x37')][_0x7196('0x71')])){for(var _0x4fa57e=0x0;_0x4fa57e<_0x342fb1[_0x7196('0x37')][_0x7196('0x71')][_0x7196('0x3b')];_0x4fa57e+=0x1){socket[_0x7196('0x6e')]('userSmsQueue:remove',{'UserId':Number(_0x342fb1['query'][_0x7196('0x71')][_0x4fa57e]),'SmsQueueId':Number(_0x342fb1['params']['id'])});}}else{socket[_0x7196('0x6e')](_0x7196('0x81'),{'UserId':Number(_0x342fb1[_0x7196('0x37')][_0x7196('0x71')]),'SmsQueueId':Number(_0x342fb1[_0x7196('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x4c9c35,null))[_0x7196('0x49')](handleError(_0x4c9c35,null));};exports[_0x7196('0x84')]=function(_0x163857,_0x1948b8,_0x1bd2dc){var _0x2b954c={};var _0x446a99={};var _0x149144;var _0x11fb5b;return db['SmsQueue']['findOne']({'where':{'id':_0x163857['params']['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x1948b8,null))[_0x7196('0x29')](function(_0x92179b){if(_0x92179b){_0x149144=_0x92179b;_0x446a99[_0x7196('0x36')]=_[_0x7196('0x58')](db[_0x7196('0x5c')][_0x7196('0x32')]);_0x446a99[_0x7196('0x37')]=_['keys'](_0x163857['query']);_0x446a99['filters']=_['intersection'](_0x446a99[_0x7196('0x36')],_0x446a99[_0x7196('0x37')]);_0x2b954c[_0x7196('0x39')]=_[_0x7196('0x38')](_0x446a99[_0x7196('0x36')],qs[_0x7196('0x3a')](_0x163857['query'][_0x7196('0x3a')]));_0x2b954c['attributes']=_0x2b954c['attributes'][_0x7196('0x3b')]?_0x2b954c['attributes']:_0x446a99['model'];_0x2b954c[_0x7196('0x3e')]=qs['sort'](_0x163857[_0x7196('0x37')][_0x7196('0x3f')]);_0x2b954c[_0x7196('0x40')]=qs[_0x7196('0x4a')](_[_0x7196('0x41')](_0x163857[_0x7196('0x37')],_0x446a99['filters']));if(_0x163857[_0x7196('0x37')][_0x7196('0x44')]){_0x2b954c[_0x7196('0x40')]=_['merge'](_0x2b954c[_0x7196('0x40')],{'$or':_[_0x7196('0x30')](_0x2b954c[_0x7196('0x39')],function(_0x48262c){var _0x571fa5={};_0x571fa5[_0x48262c]={'$like':'%'+_0x163857[_0x7196('0x37')][_0x7196('0x44')]+'%'};return _0x571fa5;})});}_0x2b954c=_[_0x7196('0x42')]({},_0x2b954c,_0x163857[_0x7196('0x45')]);return _0x149144[_0x7196('0x84')](_0x2b954c);}})[_0x7196('0x29')](function(_0x1a8a5a){if(_0x1a8a5a){_0x11fb5b=_0x1a8a5a[_0x7196('0x3b')];if(!_0x163857[_0x7196('0x37')][_0x7196('0x5a')]('nolimit')){_0x2b954c[_0x7196('0x3d')]=qs[_0x7196('0x3d')](_0x163857['query'][_0x7196('0x3d')]);_0x2b954c[_0x7196('0x25')]=qs['offset'](_0x163857[_0x7196('0x37')][_0x7196('0x25')]);}return _0x149144[_0x7196('0x84')](_0x2b954c);}})[_0x7196('0x29')](function(_0x1e7a64){if(_0x1e7a64){return _0x1e7a64?{'count':_0x11fb5b,'rows':_0x1e7a64}:null;}})[_0x7196('0x29')](respondWithResult(_0x1948b8,null))['catch'](handleError(_0x1948b8,null));}; \ No newline at end of file +var _0x57ca=['userSmsQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','count','offset','json','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','filter','merge','VIRTUAL','options','SmsQueue','rows','params','keys','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','catch','describe','findOne','UserSmsQueue','sort','pick','SmsQueueId','findAll','findAndCountAll','UserId','smsPause','updatedAt','format','%s/%s','getTeams','Team','addTeams','ids','User','online','Agents','sequelize','each','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','compact','value','transaction','isEmpty','forEach','addAgents','omit','spread','removeAgents','isArray'];(function(_0x520e16,_0x545cb6){var _0x4771b5=function(_0x5e3a50){while(--_0x5e3a50){_0x520e16['push'](_0x520e16['shift']());}};_0x4771b5(++_0x545cb6);}(_0x57ca,0x108));var _0xa57c=function(_0x3fb481,_0x3af085){_0x3fb481=_0x3fb481-0x0;var _0x49278d=_0x57ca[_0x3fb481];return _0x49278d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa57c('0x0'));var rimraf=require(_0xa57c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa57c('0x2'));var rp=require(_0xa57c('0x3'));var moment=require(_0xa57c('0x4'));var BPromise=require(_0xa57c('0x5'));var Mustache=require(_0xa57c('0x6'));var util=require('util');var path=require(_0xa57c('0x7'));var sox=require(_0xa57c('0x8'));var csv=require(_0xa57c('0x9'));var ejs=require(_0xa57c('0xa'));var fs=require('fs');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('0x9'));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 db=require(_0xa57c('0x15'))['db'];config[_0xa57c('0x16')]=_[_0xa57c('0x17')](config[_0xa57c('0x16')],{'host':_0xa57c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa57c('0x16')]));require('./smsQueue.socket')[_0xa57c('0x19')](socket);function respondWithStatusCode(_0x3d5995,_0x30940d){_0x30940d=_0x30940d||0xcc;return function(_0x3821d2){if(_0x3821d2){return _0x3d5995[_0xa57c('0x1a')](_0x30940d);}return _0x3d5995[_0xa57c('0x1b')](_0x30940d)[_0xa57c('0x1c')]();};}function respondWithResult(_0x4b4bdb,_0x26607a){_0x26607a=_0x26607a||0xc8;return function(_0xdf7ff6){if(_0xdf7ff6){return _0x4b4bdb[_0xa57c('0x1b')](_0x26607a)['json'](_0xdf7ff6);}};}function respondWithFilteredResult(_0x2746a0,_0x5f33f1){return function(_0x3e7afa){if(_0x3e7afa){var _0x3d781d=_0x3e7afa[_0xa57c('0x1d')],_0x93462c=_0x5f33f1[_0xa57c('0x1e')],_0xe3d505=_0x5f33f1[_0xa57c('0x1e')]+_0x5f33f1['limit'],_0x1fd0d8;if(_0xe3d505>=_0x3d781d){_0xe3d505=_0x3d781d;_0x1fd0d8=0xc8;}else{_0x1fd0d8=0xce;}_0x2746a0[_0xa57c('0x1b')](_0x1fd0d8);return _0x2746a0['set']('Content-Range',_0x93462c+'-'+_0xe3d505+'/'+_0x3d781d)[_0xa57c('0x1f')](_0x3e7afa);}return null;};}function patchUpdates(_0xa5b314){return function(_0x3eee75){try{jsonpatch[_0xa57c('0x20')](_0x3eee75,_0xa5b314,!![]);}catch(_0x49242c){return BPromise[_0xa57c('0x21')](_0x49242c);}return _0x3eee75[_0xa57c('0x22')]();};}function saveUpdates(_0x34d1bc,_0x2213b2){return function(_0x3bb969){if(_0x3bb969){return _0x3bb969[_0xa57c('0x23')](_0x34d1bc)[_0xa57c('0x24')](function(_0x42038e){return _0x42038e;});}return null;};}function removeEntity(_0x2e99ed,_0xdf65dd){return function(_0x382a26){if(_0x382a26){return _0x382a26[_0xa57c('0x25')]()[_0xa57c('0x24')](function(){var _0x10a33d=_0x382a26[_0xa57c('0x26')]({'plain':!![]});var _0x511a26=_0xa57c('0x27');return db[_0xa57c('0x28')][_0xa57c('0x25')]({'where':{'type':_0x511a26,'resourceId':_0x10a33d['id']}})[_0xa57c('0x24')](function(){return _0x382a26;});})[_0xa57c('0x24')](function(){_0x2e99ed[_0xa57c('0x1b')](0xcc)[_0xa57c('0x1c')]();});}};}function handleEntityNotFound(_0xe50fb8,_0x337f97){return function(_0x1d59c2){if(!_0x1d59c2){_0xe50fb8['sendStatus'](0x194);}return _0x1d59c2;};}function handleError(_0x3b7364,_0x4c1478){_0x4c1478=_0x4c1478||0x1f4;return function(_0x54a18b){logger[_0xa57c('0x29')](_0x54a18b[_0xa57c('0x2a')]);if(_0x54a18b['name']){delete _0x54a18b[_0xa57c('0x2b')];}_0x3b7364[_0xa57c('0x1b')](_0x4c1478)[_0xa57c('0x2c')](_0x54a18b);};}exports['index']=function(_0xd779f1,_0x58d46f){var _0xf5f70c={},_0x5464f2={},_0x2a3bbe={'count':0x0,'rows':[]};var _0x51ad09=_[_0xa57c('0x2d')](db['SmsQueue'][_0xa57c('0x2e')],function(_0x1d82d9){return{'name':_0x1d82d9[_0xa57c('0x2f')],'type':_0x1d82d9[_0xa57c('0x30')][_0xa57c('0x31')]};});_0x5464f2[_0xa57c('0x32')]=_[_0xa57c('0x2d')](_0x51ad09,'name');_0x5464f2[_0xa57c('0x33')]=_['keys'](_0xd779f1[_0xa57c('0x33')]);_0x5464f2[_0xa57c('0x34')]=_[_0xa57c('0x35')](_0x5464f2['model'],_0x5464f2[_0xa57c('0x33')]);_0xf5f70c['attributes']=_[_0xa57c('0x35')](_0x5464f2['model'],qs[_0xa57c('0x36')](_0xd779f1['query'][_0xa57c('0x36')]));_0xf5f70c[_0xa57c('0x37')]=_0xf5f70c['attributes'][_0xa57c('0x38')]?_0xf5f70c['attributes']:_0x5464f2[_0xa57c('0x32')];if(!_0xd779f1['query'][_0xa57c('0x39')](_0xa57c('0x3a'))){_0xf5f70c[_0xa57c('0x3b')]=qs[_0xa57c('0x3b')](_0xd779f1[_0xa57c('0x33')][_0xa57c('0x3b')]);_0xf5f70c['offset']=qs['offset'](_0xd779f1[_0xa57c('0x33')][_0xa57c('0x1e')]);}_0xf5f70c[_0xa57c('0x3c')]=qs['sort'](_0xd779f1[_0xa57c('0x33')]['sort']);_0xf5f70c[_0xa57c('0x3d')]=qs[_0xa57c('0x34')](_['pick'](_0xd779f1['query'],_0x5464f2['filters']));if(_0xd779f1[_0xa57c('0x33')][_0xa57c('0x3e')]){_0xf5f70c[_0xa57c('0x3d')]=_[_0xa57c('0x3f')](_0xf5f70c[_0xa57c('0x3d')],{'$or':_[_0xa57c('0x2d')](_0x51ad09,function(_0x5a444a){if(_0x5a444a[_0xa57c('0x30')]!==_0xa57c('0x40')){var _0x5a5490={};_0x5a5490[_0x5a444a['name']]={'$like':'%'+_0xd779f1[_0xa57c('0x33')][_0xa57c('0x3e')]+'%'};return _0x5a5490;}})});}_0xf5f70c=_['merge']({},_0xf5f70c,_0xd779f1[_0xa57c('0x41')]);var _0x5603cf={'where':_0xf5f70c[_0xa57c('0x3d')]};return db[_0xa57c('0x42')][_0xa57c('0x1d')](_0x5603cf)[_0xa57c('0x24')](function(_0x5d210b){_0x2a3bbe[_0xa57c('0x1d')]=_0x5d210b;if(_0xd779f1['query']['includeAll']){_0xf5f70c['include']=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0xf5f70c);})[_0xa57c('0x24')](function(_0x32ed25){_0x2a3bbe[_0xa57c('0x43')]=_0x32ed25;return _0x2a3bbe;})['then'](respondWithFilteredResult(_0x58d46f,_0xf5f70c))['catch'](handleError(_0x58d46f,null));};exports['show']=function(_0x44f1e8,_0x2755bc){var _0x44e38f={'raw':!![],'where':{'id':_0x44f1e8[_0xa57c('0x44')]['id']}},_0x40715e={};_0x40715e[_0xa57c('0x32')]=_['keys'](db[_0xa57c('0x42')][_0xa57c('0x2e')]);_0x40715e[_0xa57c('0x33')]=_[_0xa57c('0x45')](_0x44f1e8[_0xa57c('0x33')]);_0x40715e[_0xa57c('0x34')]=_['intersection'](_0x40715e[_0xa57c('0x32')],_0x40715e[_0xa57c('0x33')]);_0x44e38f[_0xa57c('0x37')]=_[_0xa57c('0x35')](_0x40715e[_0xa57c('0x32')],qs['fields'](_0x44f1e8[_0xa57c('0x33')][_0xa57c('0x36')]));_0x44e38f[_0xa57c('0x37')]=_0x44e38f[_0xa57c('0x37')][_0xa57c('0x38')]?_0x44e38f[_0xa57c('0x37')]:_0x40715e['model'];if(_0x44f1e8[_0xa57c('0x33')][_0xa57c('0x46')]){_0x44e38f[_0xa57c('0x47')]=[{'all':!![]}];}_0x44e38f=_[_0xa57c('0x3f')]({},_0x44e38f,_0x44f1e8[_0xa57c('0x41')]);return db[_0xa57c('0x42')]['find'](_0x44e38f)['then'](handleEntityNotFound(_0x2755bc,null))['then'](respondWithResult(_0x2755bc,null))['catch'](handleError(_0x2755bc,null));};exports[_0xa57c('0x48')]=function(_0x49492f,_0x273a17){return db[_0xa57c('0x42')]['create'](_0x49492f[_0xa57c('0x49')],{})[_0xa57c('0x24')](function(_0x368e87){var _0x128ea2=_0x49492f[_0xa57c('0x4a')]['get']({'plain':!![]});if(!_0x128ea2)throw new Error(_0xa57c('0x4b'));if(_0x128ea2[_0xa57c('0x4c')]===_0xa57c('0x4a')){var _0xd57bac=_0x368e87[_0xa57c('0x26')]({'plain':!![]});var _0x5ace6d=_0xa57c('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x5ace6d,'userProfileId':_0x128ea2[_0xa57c('0x4d')]},'raw':!![]})[_0xa57c('0x24')](function(_0x5ded49){if(_0x5ded49&&_0x5ded49['autoAssociation']===0x0){return db['UserProfileResource'][_0xa57c('0x48')]({'name':_0xd57bac[_0xa57c('0x2b')],'resourceId':_0xd57bac['id'],'type':_0x5ded49[_0xa57c('0x2b')],'sectionId':_0x5ded49['id']},{})[_0xa57c('0x24')](function(){return _0x368e87;});}else{return _0x368e87;}})['catch'](function(_0x3c450f){logger[_0xa57c('0x29')](_0xa57c('0x4e'),_0x3c450f);throw _0x3c450f;});}return _0x368e87;})['then'](respondWithResult(_0x273a17,0xc9))['catch'](handleError(_0x273a17,null));};exports[_0xa57c('0x23')]=function(_0x25fc6b,_0x4d5d46){if(_0x25fc6b[_0xa57c('0x49')]['id']){delete _0x25fc6b[_0xa57c('0x49')]['id'];}return db[_0xa57c('0x42')][_0xa57c('0x4f')]({'where':{'id':_0x25fc6b[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x4d5d46,null))[_0xa57c('0x24')](saveUpdates(_0x25fc6b['body'],null))['then'](respondWithResult(_0x4d5d46,null))[_0xa57c('0x50')](handleError(_0x4d5d46,null));};exports[_0xa57c('0x25')]=function(_0x2fd759,_0x2a6538){return db[_0xa57c('0x42')][_0xa57c('0x4f')]({'where':{'id':_0x2fd759[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x2a6538,null))['then'](removeEntity(_0x2a6538,null))['catch'](handleError(_0x2a6538,null));};exports[_0xa57c('0x51')]=function(_0x4e18ad,_0x1880e6){return db[_0xa57c('0x42')][_0xa57c('0x51')]()['then'](respondWithResult(_0x1880e6,null))[_0xa57c('0x50')](handleError(_0x1880e6,null));};exports['getMembers']=function(_0x21b00a,_0x4b3416,_0x39484d){var _0x170187={'raw':!![],'where':{}},_0x398743={},_0x26a8e1;return db['SmsQueue'][_0xa57c('0x52')]({'where':{'id':_0x21b00a[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x4b3416,null))[_0xa57c('0x24')](function(_0x3345d5){if(_0x3345d5){_0x26a8e1=_0x3345d5['get']({'plain':!![]});_0x398743[_0xa57c('0x32')]=_[_0xa57c('0x45')](db[_0xa57c('0x53')][_0xa57c('0x2e')]);_0x398743[_0xa57c('0x33')]=_[_0xa57c('0x45')](_0x21b00a[_0xa57c('0x33')]);_0x398743[_0xa57c('0x34')]=_[_0xa57c('0x35')](_0x398743[_0xa57c('0x32')],_0x398743['query']);_0x170187[_0xa57c('0x37')]=_[_0xa57c('0x35')](_0x398743[_0xa57c('0x32')],qs[_0xa57c('0x36')](_0x21b00a[_0xa57c('0x33')][_0xa57c('0x36')]));_0x170187['attributes']=_0x170187[_0xa57c('0x37')][_0xa57c('0x38')]?_0x170187['attributes']:_0x398743[_0xa57c('0x32')];if(!_0x21b00a[_0xa57c('0x33')][_0xa57c('0x39')](_0xa57c('0x3a'))){_0x170187[_0xa57c('0x3b')]=qs[_0xa57c('0x3b')](_0x21b00a[_0xa57c('0x33')]['limit']);_0x170187[_0xa57c('0x1e')]=qs['offset'](_0x21b00a[_0xa57c('0x33')]['offset']);}_0x170187[_0xa57c('0x3c')]=qs['sort'](_0x21b00a[_0xa57c('0x33')][_0xa57c('0x54')]);_0x170187['where']=qs[_0xa57c('0x34')](_[_0xa57c('0x55')](_0x21b00a[_0xa57c('0x33')],_0x398743[_0xa57c('0x34')]));_0x170187['where'][_0xa57c('0x56')]=_0x3345d5['id'];if(_0x21b00a[_0xa57c('0x33')][_0xa57c('0x3e')]){_0x170187[_0xa57c('0x3d')]=_[_0xa57c('0x3f')](_0x170187[_0xa57c('0x3d')],{'$or':_[_0xa57c('0x2d')](_0x170187[_0xa57c('0x37')],function(_0x11c13e){var _0x428ac0={};_0x428ac0[_0x11c13e]={'$like':'%'+_0x21b00a[_0xa57c('0x33')][_0xa57c('0x3e')]+'%'};return _0x428ac0;})});}_0x170187=_[_0xa57c('0x3f')]({},_0x170187,_0x21b00a[_0xa57c('0x41')]);return db[_0xa57c('0x53')][_0xa57c('0x57')](_0x170187);}})['then'](function(_0x393119){if(_0x393119){return db['User'][_0xa57c('0x58')]({'where':{'id':_[_0xa57c('0x2d')](_0x393119,_0xa57c('0x59')),'role':'agent'},'attributes':['id',_0xa57c('0x2b'),_0xa57c('0x5a'),_0xa57c('0x5b'),'createdAt']});}})['then'](function(_0x20ff5f){if(_0x20ff5f){return{'count':_0x20ff5f[_0xa57c('0x1d')],'rows':_[_0xa57c('0x2d')](_0x20ff5f[_0xa57c('0x43')],function(_0x3fd9aa){return{'membername':_0x3fd9aa[_0xa57c('0x2b')],'UserId':_0x3fd9aa['id'],'queue_name':_0x26a8e1[_0xa57c('0x2b')],'SmsQueueId':_0x26a8e1['id'],'interface':util[_0xa57c('0x5c')](_0xa57c('0x5d'),'SIP',_0x3fd9aa[_0xa57c('0x2b')]),'penalty':0x0,'paused':_0x3fd9aa[_0xa57c('0x5a')],'createdAt':_0x3fd9aa['createdAt'],'updatedAt':_0x3fd9aa[_0xa57c('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa57c('0x24')](respondWithFilteredResult(_0x4b3416,_0x170187))[_0xa57c('0x50')](handleError(_0x4b3416,null));};exports[_0xa57c('0x5e')]=function(_0x1bb561,_0x28ec46,_0x42763b){var _0x10616e={};var _0x5a457d={};var _0x2960fd;var _0x29bf7f;return db['SmsQueue'][_0xa57c('0x52')]({'where':{'id':_0x1bb561[_0xa57c('0x44')]['id']}})['then'](handleEntityNotFound(_0x28ec46,null))['then'](function(_0x30dac7){if(_0x30dac7){_0x2960fd=_0x30dac7;_0x5a457d[_0xa57c('0x32')]=_[_0xa57c('0x45')](db[_0xa57c('0x5f')][_0xa57c('0x2e')]);_0x5a457d['query']=_[_0xa57c('0x45')](_0x1bb561[_0xa57c('0x33')]);_0x5a457d[_0xa57c('0x34')]=_['intersection'](_0x5a457d[_0xa57c('0x32')],_0x5a457d['query']);_0x10616e[_0xa57c('0x37')]=_[_0xa57c('0x35')](_0x5a457d[_0xa57c('0x32')],qs[_0xa57c('0x36')](_0x1bb561['query'][_0xa57c('0x36')]));_0x10616e[_0xa57c('0x37')]=_0x10616e[_0xa57c('0x37')][_0xa57c('0x38')]?_0x10616e['attributes']:_0x5a457d[_0xa57c('0x32')];_0x10616e[_0xa57c('0x3c')]=qs[_0xa57c('0x54')](_0x1bb561['query'][_0xa57c('0x54')]);_0x10616e[_0xa57c('0x3d')]=qs[_0xa57c('0x34')](_['pick'](_0x1bb561[_0xa57c('0x33')],_0x5a457d[_0xa57c('0x34')]));if(_0x1bb561[_0xa57c('0x33')][_0xa57c('0x3e')]){_0x10616e['where']=_[_0xa57c('0x3f')](_0x10616e[_0xa57c('0x3d')],{'$or':_['map'](_0x10616e[_0xa57c('0x37')],function(_0x1157ea){var _0x59d2a2={};_0x59d2a2[_0x1157ea]={'$like':'%'+_0x1bb561[_0xa57c('0x33')]['filter']+'%'};return _0x59d2a2;})});}_0x10616e=_[_0xa57c('0x3f')]({},_0x10616e,_0x1bb561[_0xa57c('0x41')]);return _0x2960fd[_0xa57c('0x5e')](_0x10616e);}})[_0xa57c('0x24')](function(_0x599408){if(_0x599408){_0x29bf7f=_0x599408[_0xa57c('0x38')];if(!_0x1bb561[_0xa57c('0x33')][_0xa57c('0x39')](_0xa57c('0x3a'))){_0x10616e[_0xa57c('0x3b')]=qs[_0xa57c('0x3b')](_0x1bb561[_0xa57c('0x33')][_0xa57c('0x3b')]);_0x10616e[_0xa57c('0x1e')]=qs[_0xa57c('0x1e')](_0x1bb561[_0xa57c('0x33')]['offset']);}return _0x2960fd['getTeams'](_0x10616e);}})['then'](function(_0x29b491){if(_0x29b491){return _0x29b491?{'count':_0x29bf7f,'rows':_0x29b491}:null;}})['then'](respondWithResult(_0x28ec46,null))[_0xa57c('0x50')](handleError(_0x28ec46,null));};exports[_0xa57c('0x60')]=function(_0x193705,_0x4c543a,_0x21c428){var _0x3e7946=_0x193705[_0xa57c('0x49')][_0xa57c('0x61')];return db[_0xa57c('0x5f')][_0xa57c('0x57')]({'where':{'id':_0x3e7946},'attributes':['id'],'include':[{'model':db[_0xa57c('0x62')],'as':'Agents','attributes':['id',_0xa57c('0x2b'),_0xa57c('0x63'),'voicePause','interface'],'raw':!![]}]})[_0xa57c('0x24')](function(_0x201983){if(_0x201983){var _0x4fc97e=_['flatMap'](_0x201983,function(_0xc5f17e){var _0x4962ae=_0xc5f17e[_0xa57c('0x26')]({'plain':!![]});return _0x4962ae[_0xa57c('0x64')];});return db['SmsQueue'][_0xa57c('0x4f')]({'where':{'id':_0x193705[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](function(_0x3df8f5){return db[_0xa57c('0x65')]['transaction'](function(_0x17fc78){return _0x3df8f5['addTeams'](_0x3e7946,{'transaction':_0x17fc78})[_0xa57c('0x24')](function(){return BPromise[_0xa57c('0x66')](_0x4fc97e,function(_0x4a2b64){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x4a2b64['id'],'SmsQueueId':_0x193705[_0xa57c('0x44')]['id']},'transaction':_0x17fc78});});})['then'](function(){_0x4fc97e['forEach'](function(_0x175253){socket[_0xa57c('0x67')](_0xa57c('0x68'),{'UserId':_0x175253['id'],'SmsQueueId':_0x3df8f5['id']});});});});});}})['then'](respondWithStatusCode(_0x4c543a,null))[_0xa57c('0x50')](handleError(_0x4c543a,null));};exports[_0xa57c('0x69')]=function(_0x11e592,_0x5bbb59,_0x4b8228){return db[_0xa57c('0x5f')]['findAll']({'where':{'id':_0x11e592[_0xa57c('0x33')][_0xa57c('0x61')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa57c('0x64'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5bbb59,null))['then'](function(_0x5db013){var _0x6825df=_['map'](_0x5db013,'id');var _0x5143c0=[];var _0x542194=[];var _0x3e12e5=squel[_0xa57c('0x6a')]();_0x3e12e5['field'](_0xa57c('0x6b'))[_0xa57c('0x6c')](_0xa57c('0x6d'),'tq')['join'](_0xa57c('0x6e'),'ut',_0xa57c('0x6f'))[_0xa57c('0x3d')](_0xa57c('0x70'),_0x11e592['params']['id']);for(var _0x5e0db8=0x0;_0x5e0db8<_0x5db013[_0xa57c('0x38')];_0x5e0db8+=0x1){let _0x512e3d=_0x5db013[_0x5e0db8];for(var _0x121343=0x0;_0x121343<_0x512e3d[_0xa57c('0x64')][_0xa57c('0x38')];_0x121343+=0x1){let _0x4dc6ac=_0x512e3d[_0xa57c('0x64')][_0x121343];var _0x513f24=_0x3e12e5['clone']();_0x513f24[_0xa57c('0x3d')]('ut.UserId\x20=\x20?',_0x4dc6ac['id']);_0x542194[_0xa57c('0x71')](db[_0xa57c('0x65')]['query'](_0x513f24['toString'](),{'type':db[_0xa57c('0x65')][_0xa57c('0x72')]['SELECT']})['then'](function(_0x2550bc){if(_0x2550bc[_0xa57c('0x38')]===0x1){return _0x4dc6ac['id'];}else{var _0xa09ff=_['every'](_[_0xa57c('0x2d')](_0x2550bc,_0xa57c('0x73')),function(_0xb51336){return _[_0xa57c('0x74')](_0x6825df,_0xb51336);});if(_0xa09ff){return _0x4dc6ac['id'];}}}));}}return BPromise[_0xa57c('0x75')](_0x542194)[_0xa57c('0x24')](function(_0x10f1b5){_0x5143c0=_(_0x5143c0)[_0xa57c('0x76')](_0x10f1b5)[_0xa57c('0x77')]()[_0xa57c('0x78')]();return db[_0xa57c('0x42')][_0xa57c('0x4f')]({'where':{'id':_0x11e592[_0xa57c('0x44')]['id']}})['then'](function(_0x89be65){return db[_0xa57c('0x65')][_0xa57c('0x79')](function(_0x107ebd){return _0x89be65[_0xa57c('0x69')](_0x11e592[_0xa57c('0x33')]['ids'],{'transaction':_0x107ebd})['then'](function(){if(!_[_0xa57c('0x7a')](_0x5143c0)){return _0x89be65['removeAgents'](_0x5143c0,{'transaction':_0x107ebd});}})['then'](function(){_0x5143c0[_0xa57c('0x7b')](function(_0x138edd){socket[_0xa57c('0x67')]('userSmsQueue:remove',{'UserId':_0x138edd,'SmsQueueId':_0x89be65['id']});});});});});});})[_0xa57c('0x24')](respondWithStatusCode(_0x5bbb59,null))[_0xa57c('0x50')](handleError(_0x5bbb59,null));};exports[_0xa57c('0x7c')]=function(_0x2c0db4,_0x3eb06d,_0x4cabef){return db['SmsQueue'][_0xa57c('0x4f')]({'where':{'id':_0x2c0db4[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x3eb06d,null))['then'](function(_0x3f2152){if(_0x3f2152){return _0x3f2152['addAgents'](_0x2c0db4[_0xa57c('0x49')][_0xa57c('0x61')],_[_0xa57c('0x7d')](_0x2c0db4[_0xa57c('0x49')],[_0xa57c('0x61'),'id'])||{})[_0xa57c('0x7e')](function(_0xda3db4){for(var _0x5c76b0=0x0;_0x5c76b0<_0x2c0db4['body'][_0xa57c('0x61')][_0xa57c('0x38')];_0x5c76b0+=0x1){socket[_0xa57c('0x67')]('userSmsQueue:save',{'UserId':_0x2c0db4['body'][_0xa57c('0x61')][_0x5c76b0],'SmsQueueId':_0x2c0db4[_0xa57c('0x44')]['id']});}return _0xda3db4;});}})[_0xa57c('0x24')](respondWithResult(_0x3eb06d,null))[_0xa57c('0x50')](handleError(_0x3eb06d,null));};exports[_0xa57c('0x7f')]=function(_0x58a3c9,_0x41ffe3,_0x28dc85){return db[_0xa57c('0x42')]['find']({'where':{'id':_0x58a3c9[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x41ffe3,null))['then'](function(_0x1883b8){if(_0x1883b8){return _0x1883b8[_0xa57c('0x7f')](_0x58a3c9[_0xa57c('0x33')][_0xa57c('0x61')])[_0xa57c('0x24')](function(){if(_[_0xa57c('0x80')](_0x58a3c9[_0xa57c('0x33')][_0xa57c('0x61')])){for(var _0x16e745=0x0;_0x16e745<_0x58a3c9['query'][_0xa57c('0x61')][_0xa57c('0x38')];_0x16e745+=0x1){socket[_0xa57c('0x67')](_0xa57c('0x81'),{'UserId':Number(_0x58a3c9['query']['ids'][_0x16e745]),'SmsQueueId':Number(_0x58a3c9[_0xa57c('0x44')]['id'])});}}else{socket['emit'](_0xa57c('0x81'),{'UserId':Number(_0x58a3c9['query'][_0xa57c('0x61')]),'SmsQueueId':Number(_0x58a3c9['params']['id'])});}});}})['then'](respondWithStatusCode(_0x41ffe3,null))[_0xa57c('0x50')](handleError(_0x41ffe3,null));};exports['getAgents']=function(_0x3facda,_0x5a4843,_0x1ecfa9){var _0x3698aa={};var _0x129a89={};var _0x422849;var _0x5abf60;return db['SmsQueue'][_0xa57c('0x52')]({'where':{'id':_0x3facda[_0xa57c('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a4843,null))[_0xa57c('0x24')](function(_0xeb14ed){if(_0xeb14ed){_0x422849=_0xeb14ed;_0x129a89[_0xa57c('0x32')]=_[_0xa57c('0x45')](db[_0xa57c('0x62')][_0xa57c('0x2e')]);_0x129a89[_0xa57c('0x33')]=_[_0xa57c('0x45')](_0x3facda[_0xa57c('0x33')]);_0x129a89[_0xa57c('0x34')]=_['intersection'](_0x129a89['model'],_0x129a89[_0xa57c('0x33')]);_0x3698aa['attributes']=_[_0xa57c('0x35')](_0x129a89[_0xa57c('0x32')],qs[_0xa57c('0x36')](_0x3facda['query'][_0xa57c('0x36')]));_0x3698aa['attributes']=_0x3698aa['attributes'][_0xa57c('0x38')]?_0x3698aa[_0xa57c('0x37')]:_0x129a89[_0xa57c('0x32')];_0x3698aa[_0xa57c('0x3c')]=qs['sort'](_0x3facda[_0xa57c('0x33')]['sort']);_0x3698aa['where']=qs['filters'](_[_0xa57c('0x55')](_0x3facda[_0xa57c('0x33')],_0x129a89[_0xa57c('0x34')]));if(_0x3facda[_0xa57c('0x33')]['filter']){_0x3698aa[_0xa57c('0x3d')]=_['merge'](_0x3698aa[_0xa57c('0x3d')],{'$or':_[_0xa57c('0x2d')](_0x3698aa['attributes'],function(_0x2ca1af){var _0x287b5c={};_0x287b5c[_0x2ca1af]={'$like':'%'+_0x3facda[_0xa57c('0x33')][_0xa57c('0x3e')]+'%'};return _0x287b5c;})});}_0x3698aa=_[_0xa57c('0x3f')]({},_0x3698aa,_0x3facda['options']);return _0x422849[_0xa57c('0x82')](_0x3698aa);}})['then'](function(_0x185ee5){if(_0x185ee5){_0x5abf60=_0x185ee5[_0xa57c('0x38')];if(!_0x3facda[_0xa57c('0x33')][_0xa57c('0x39')](_0xa57c('0x3a'))){_0x3698aa[_0xa57c('0x3b')]=qs[_0xa57c('0x3b')](_0x3facda[_0xa57c('0x33')][_0xa57c('0x3b')]);_0x3698aa[_0xa57c('0x1e')]=qs['offset'](_0x3facda[_0xa57c('0x33')][_0xa57c('0x1e')]);}return _0x422849['getAgents'](_0x3698aa);}})['then'](function(_0x525865){if(_0x525865){return _0x525865?{'count':_0x5abf60,'rows':_0x525865}:null;}})[_0xa57c('0x24')](respondWithResult(_0x5a4843,null))[_0xa57c('0x50')](handleError(_0x5a4843,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 4943bc9..e703a25 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 _0x65bd=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x65bd,0xb3));var _0xd65b=function(_0x4625dd,_0x58fc04){_0x4625dd=_0x4625dd-0x0;var _0x7a045e=_0x65bd[_0x4625dd];return _0x7a045e;};'use strict';var EventEmitter=require(_0xd65b('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd65b('0x1')](0x0);var events={'afterCreate':_0xd65b('0x2'),'afterUpdate':_0xd65b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3b8687){return function(_0x46412e,_0xd60aac,_0x4dbb47){SmsQueueEvents[_0xd65b('0x4')](_0x3b8687+':'+_0x46412e['id'],_0x46412e);SmsQueueEvents[_0xd65b('0x4')](_0x3b8687,_0x46412e);_0x4dbb47(null);};}for(var e in events){if(events[_0xd65b('0x5')](e)){var event=events[e];SmsQueue[_0xd65b('0x6')](e,emitEvent(event));}}module[_0xd65b('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0xf5d1=['../../mysqldb','SmsQueue','setMaxListeners','save','remove','emit','hook'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf5d1,0x8c));var _0x1f5d=function(_0x38c632,_0x14e8e6){_0x38c632=_0x38c632-0x0;var _0x12737e=_0xf5d1[_0x38c632];return _0x12737e;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x1f5d('0x0'))['db'][_0x1f5d('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1f5d('0x2')](0x0);var events={'afterCreate':_0x1f5d('0x3'),'afterUpdate':'update','afterDestroy':_0x1f5d('0x4')};function emitEvent(_0x82e787){return function(_0x14a0a4,_0x1cf37d,_0x39b127){SmsQueueEvents[_0x1f5d('0x5')](_0x82e787+':'+_0x14a0a4['id'],_0x14a0a4);SmsQueueEvents[_0x1f5d('0x5')](_0x82e787,_0x14a0a4);_0x39b127(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x1f5d('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 24e44fc..695bf7e 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 _0xc77d=['exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./smsQueue.attributes'];(function(_0x17954e,_0x44ab51){var _0x1fbb79=function(_0x340c41){while(--_0x340c41){_0x17954e['push'](_0x17954e['shift']());}};_0x1fbb79(++_0x44ab51);}(_0xc77d,0x156));var _0xdc77=function(_0x5aefb7,_0x5b771e){_0x5aefb7=_0x5aefb7-0x0;var _0x1f2ad=_0xc77d[_0x5aefb7];return _0x1f2ad;};'use strict';var _=require(_0xdc77('0x0'));var util=require(_0xdc77('0x1'));var logger=require(_0xdc77('0x2'))(_0xdc77('0x3'));var moment=require(_0xdc77('0x4'));var BPromise=require('bluebird');var rp=require(_0xdc77('0x5'));var fs=require('fs');var path=require(_0xdc77('0x6'));var rimraf=require(_0xdc77('0x7'));var config=require('../../config/environment');var attributes=require(_0xdc77('0x8'));module[_0xdc77('0x9')]=function(_0x22fdb7,_0xcfeec7){return _0x22fdb7[_0xdc77('0xa')](_0xdc77('0xb'),attributes,{'tableName':_0xdc77('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92a3=['path','rimraf','../../config/environment','exports','define','SmsQueue','lodash','util','api','moment','bluebird'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0x92a3,0x1ea));var _0x392a=function(_0x4269ea,_0x56b0de){_0x4269ea=_0x4269ea-0x0;var _0x332e41=_0x92a3[_0x4269ea];return _0x332e41;};'use strict';var _=require(_0x392a('0x0'));var util=require(_0x392a('0x1'));var logger=require('../../config/logger')(_0x392a('0x2'));var moment=require(_0x392a('0x3'));var BPromise=require(_0x392a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x392a('0x5'));var rimraf=require(_0x392a('0x6'));var config=require(_0x392a('0x7'));var attributes=require('./smsQueue.attributes');module[_0x392a('0x8')]=function(_0x516893,_0x542e3b){return _0x516893[_0x392a('0x9')](_0x392a('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 04ec7ac..e148af1 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 _0x70d5=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request','then','info','SmsQueue,\x20%s,\x20%s','SmsQueue,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','GetSmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','SmsQueue','ShowSmsQueue','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4bd205,_0x164aa6){var _0x673a4=function(_0x1463a7){while(--_0x1463a7){_0x4bd205['push'](_0x4bd205['shift']());}};_0x673a4(++_0x164aa6);}(_0x70d5,0x10b));var _0x570d=function(_0x59f148,_0x20c351){_0x59f148=_0x59f148-0x0;var _0x33cde9=_0x70d5[_0x59f148];return _0x33cde9;};'use strict';var _=require(_0x570d('0x0'));var util=require(_0x570d('0x1'));var moment=require('moment');var BPromise=require(_0x570d('0x2'));var rs=require(_0x570d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x570d('0x4'))['db'];var utils=require(_0x570d('0x5'));var logger=require(_0x570d('0x6'))(_0x570d('0x7'));var config=require(_0x570d('0x8'));var jayson=require(_0x570d('0x9'));var client=jayson['client'][_0x570d('0xa')]({'port':0x232a});config[_0x570d('0xb')]=_[_0x570d('0xc')](config[_0x570d('0xb')],{'host':_0x570d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsQueue.socket')[_0x570d('0xe')](socket);function respondWithRpcPromise(_0x3edcf8,_0x5af7db,_0x4d531d){return new BPromise(function(_0x269e27,_0x4c04ed){return client[_0x570d('0xf')](_0x3edcf8,_0x4d531d)[_0x570d('0x10')](function(_0x321ee0){logger[_0x570d('0x11')](_0x570d('0x12'),_0x5af7db,'request\x20sent');logger['debug'](_0x570d('0x13'),_0x5af7db,'request\x20sent',JSON['stringify'](_0x321ee0));if(_0x321ee0[_0x570d('0x14')]){if(_0x321ee0[_0x570d('0x14')]['code']===0x1f4){logger['error'](_0x570d('0x12'),_0x5af7db,_0x321ee0[_0x570d('0x14')]['message']);return _0x4c04ed(_0x321ee0[_0x570d('0x14')][_0x570d('0x15')]);}logger[_0x570d('0x14')]('SmsQueue,\x20%s,\x20%s',_0x5af7db,_0x321ee0[_0x570d('0x14')]['message']);return _0x269e27(_0x321ee0[_0x570d('0x14')][_0x570d('0x15')]);}else{logger[_0x570d('0x11')](_0x570d('0x12'),_0x5af7db,_0x570d('0x16'));_0x269e27(_0x321ee0[_0x570d('0x17')][_0x570d('0x15')]);}})[_0x570d('0x18')](function(_0x1ea848){logger[_0x570d('0x14')](_0x570d('0x12'),_0x5af7db,_0x1ea848);_0x4c04ed(_0x1ea848);});});}exports[_0x570d('0x19')]=function(_0x2233c3){var _0x4e92a5=this;return new Promise(function(_0xf257bc,_0x5018f5){return db['SmsQueue'][_0x570d('0x1a')]({'raw':_0x2233c3[_0x570d('0x1b')]?_0x2233c3[_0x570d('0x1b')][_0x570d('0x1c')]===undefined?!![]:![]:!![],'where':_0x2233c3[_0x570d('0x1b')]?_0x2233c3[_0x570d('0x1b')][_0x570d('0x1d')]||null:null,'attributes':_0x2233c3['options']?_0x2233c3['options'][_0x570d('0x1e')]||null:null,'limit':_0x2233c3[_0x570d('0x1b')]?_0x2233c3['options'][_0x570d('0x1f')]||null:null,'include':_0x2233c3[_0x570d('0x1b')]?_0x2233c3[_0x570d('0x1b')][_0x570d('0x20')]?_[_0x570d('0x21')](_0x2233c3[_0x570d('0x1b')][_0x570d('0x20')],function(_0x3ceac9){return{'model':db[_0x3ceac9[_0x570d('0x22')]],'as':_0x3ceac9['as'],'attributes':_0x3ceac9['attributes'],'include':_0x3ceac9[_0x570d('0x20')]?_['map'](_0x3ceac9['include'],function(_0x580d30){return{'model':db[_0x580d30['model']],'as':_0x580d30['as'],'attributes':_0x580d30[_0x570d('0x1e')],'include':_0x580d30[_0x570d('0x20')]?_[_0x570d('0x21')](_0x580d30['include'],function(_0x1b2608){return{'model':db[_0x1b2608[_0x570d('0x22')]],'as':_0x1b2608['as'],'attributes':_0x1b2608[_0x570d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b7675){logger[_0x570d('0x11')](_0x570d('0x19'),_0x2233c3);logger[_0x570d('0x23')](_0x570d('0x19'),_0x2233c3,JSON[_0x570d('0x24')](_0x3b7675));_0xf257bc(_0x3b7675);})[_0x570d('0x18')](function(_0x5c7668){logger['error'](_0x570d('0x19'),_0x5c7668['message'],_0x2233c3);_0x5018f5(_0x4e92a5[_0x570d('0x14')](0x1f4,_0x5c7668[_0x570d('0x15')]));});});};exports['ShowSmsQueue']=function(_0x16dbe9){var _0x473c98=this;return new Promise(function(_0x3ab696,_0x538f78){return db[_0x570d('0x25')]['find']({'raw':_0x16dbe9[_0x570d('0x1b')]?_0x16dbe9['options'][_0x570d('0x1c')]===undefined?!![]:![]:!![],'where':_0x16dbe9['options']?_0x16dbe9['options']['where']||null:null,'attributes':_0x16dbe9[_0x570d('0x1b')]?_0x16dbe9[_0x570d('0x1b')][_0x570d('0x1e')]||null:null,'include':_0x16dbe9[_0x570d('0x1b')]?_0x16dbe9[_0x570d('0x1b')][_0x570d('0x20')]?_[_0x570d('0x21')](_0x16dbe9['options']['include'],function(_0x2618c0){return{'model':db[_0x2618c0['model']],'as':_0x2618c0['as'],'attributes':_0x2618c0[_0x570d('0x1e')],'include':_0x2618c0[_0x570d('0x20')]?_[_0x570d('0x21')](_0x2618c0[_0x570d('0x20')],function(_0x3818fd){return{'model':db[_0x3818fd[_0x570d('0x22')]],'as':_0x3818fd['as'],'attributes':_0x3818fd['attributes'],'include':_0x3818fd[_0x570d('0x20')]?_['map'](_0x3818fd[_0x570d('0x20')],function(_0x171e00){return{'model':db[_0x171e00[_0x570d('0x22')]],'as':_0x171e00['as'],'attributes':_0x171e00['attributes']};}):[]};}):[]};}):[]:[]})[_0x570d('0x10')](function(_0x421690){logger['info'](_0x570d('0x26'),_0x16dbe9);logger[_0x570d('0x23')](_0x570d('0x26'),_0x16dbe9,JSON[_0x570d('0x24')](_0x421690));_0x3ab696(_0x421690);})[_0x570d('0x18')](function(_0x4ab8fe){logger['error'](_0x570d('0x26'),_0x4ab8fe['message'],_0x16dbe9);_0x538f78(_0x473c98['error'](0x1f4,_0x4ab8fe[_0x570d('0x15')]));});});}; \ No newline at end of file +var _0xe9c9=['rpc','../../config/environment','http','redis','./smsQueue.socket','request','then','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','catch','SmsQueue','findAll','options','attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x65c0bb,_0x82e7b8){var _0x320bd5=function(_0x6e1675){while(--_0x6e1675){_0x65c0bb['push'](_0x65c0bb['shift']());}};_0x320bd5(++_0x82e7b8);}(_0xe9c9,0xd6));var _0x9e9c=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xe9c9[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x9e9c('0x0'));var util=require(_0x9e9c('0x1'));var moment=require(_0x9e9c('0x2'));var BPromise=require(_0x9e9c('0x3'));var rs=require(_0x9e9c('0x4'));var fs=require('fs');var Redis=require(_0x9e9c('0x5'));var db=require(_0x9e9c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e9c('0x7'))(_0x9e9c('0x8'));var config=require(_0x9e9c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9e9c('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9e9c('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9e9c('0xb')]));require(_0x9e9c('0xc'))['register'](socket);function respondWithRpcPromise(_0x2a22ec,_0x14932d,_0x96914b){return new BPromise(function(_0x3d4e60,_0x2bccf5){return client[_0x9e9c('0xd')](_0x2a22ec,_0x96914b)[_0x9e9c('0xe')](function(_0x33ee56){logger[_0x9e9c('0xf')]('SmsQueue,\x20%s,\x20%s',_0x14932d,_0x9e9c('0x10'));logger[_0x9e9c('0x11')](_0x9e9c('0x12'),_0x14932d,_0x9e9c('0x10'),JSON[_0x9e9c('0x13')](_0x33ee56));if(_0x33ee56['error']){if(_0x33ee56[_0x9e9c('0x14')][_0x9e9c('0x15')]===0x1f4){logger[_0x9e9c('0x14')](_0x9e9c('0x16'),_0x14932d,_0x33ee56[_0x9e9c('0x14')][_0x9e9c('0x17')]);return _0x2bccf5(_0x33ee56[_0x9e9c('0x14')][_0x9e9c('0x17')]);}logger[_0x9e9c('0x14')](_0x9e9c('0x16'),_0x14932d,_0x33ee56[_0x9e9c('0x14')][_0x9e9c('0x17')]);return _0x3d4e60(_0x33ee56[_0x9e9c('0x14')][_0x9e9c('0x17')]);}else{logger[_0x9e9c('0xf')](_0x9e9c('0x16'),_0x14932d,_0x9e9c('0x10'));_0x3d4e60(_0x33ee56['result'][_0x9e9c('0x17')]);}})[_0x9e9c('0x18')](function(_0x266381){logger[_0x9e9c('0x14')](_0x9e9c('0x16'),_0x14932d,_0x266381);_0x2bccf5(_0x266381);});});}exports['GetSmsQueue']=function(_0x199206){var _0x20bcfa=this;return new Promise(function(_0x1e7212,_0x2e612e){return db[_0x9e9c('0x19')][_0x9e9c('0x1a')]({'raw':_0x199206['options']?_0x199206[_0x9e9c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x199206[_0x9e9c('0x1b')]?_0x199206[_0x9e9c('0x1b')]['where']||null:null,'attributes':_0x199206['options']?_0x199206['options'][_0x9e9c('0x1c')]||null:null,'limit':_0x199206[_0x9e9c('0x1b')]?_0x199206['options'][_0x9e9c('0x1d')]||null:null,'include':_0x199206[_0x9e9c('0x1b')]?_0x199206[_0x9e9c('0x1b')][_0x9e9c('0x1e')]?_[_0x9e9c('0x1f')](_0x199206[_0x9e9c('0x1b')][_0x9e9c('0x1e')],function(_0x4ae3e9){return{'model':db[_0x4ae3e9[_0x9e9c('0x20')]],'as':_0x4ae3e9['as'],'attributes':_0x4ae3e9[_0x9e9c('0x1c')],'include':_0x4ae3e9[_0x9e9c('0x1e')]?_[_0x9e9c('0x1f')](_0x4ae3e9[_0x9e9c('0x1e')],function(_0x4632ec){return{'model':db[_0x4632ec[_0x9e9c('0x20')]],'as':_0x4632ec['as'],'attributes':_0x4632ec[_0x9e9c('0x1c')],'include':_0x4632ec[_0x9e9c('0x1e')]?_[_0x9e9c('0x1f')](_0x4632ec[_0x9e9c('0x1e')],function(_0x2a4676){return{'model':db[_0x2a4676[_0x9e9c('0x20')]],'as':_0x2a4676['as'],'attributes':_0x2a4676[_0x9e9c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9e9c('0xe')](function(_0x3d9b89){logger[_0x9e9c('0xf')](_0x9e9c('0x21'),_0x199206);logger['debug']('GetSmsQueue',_0x199206,JSON[_0x9e9c('0x13')](_0x3d9b89));_0x1e7212(_0x3d9b89);})[_0x9e9c('0x18')](function(_0x9a1c8d){logger[_0x9e9c('0x14')]('GetSmsQueue',_0x9a1c8d[_0x9e9c('0x17')],_0x199206);_0x2e612e(_0x20bcfa[_0x9e9c('0x14')](0x1f4,_0x9a1c8d[_0x9e9c('0x17')]));});});};exports[_0x9e9c('0x22')]=function(_0x5266fd){var _0x4bbf58=this;return new Promise(function(_0x5be652,_0x4a82b1){return db['SmsQueue'][_0x9e9c('0x23')]({'raw':_0x5266fd['options']?_0x5266fd[_0x9e9c('0x1b')][_0x9e9c('0x24')]===undefined?!![]:![]:!![],'where':_0x5266fd['options']?_0x5266fd[_0x9e9c('0x1b')]['where']||null:null,'attributes':_0x5266fd['options']?_0x5266fd[_0x9e9c('0x1b')][_0x9e9c('0x1c')]||null:null,'include':_0x5266fd['options']?_0x5266fd[_0x9e9c('0x1b')][_0x9e9c('0x1e')]?_[_0x9e9c('0x1f')](_0x5266fd[_0x9e9c('0x1b')][_0x9e9c('0x1e')],function(_0x2516bd){return{'model':db[_0x2516bd[_0x9e9c('0x20')]],'as':_0x2516bd['as'],'attributes':_0x2516bd['attributes'],'include':_0x2516bd[_0x9e9c('0x1e')]?_[_0x9e9c('0x1f')](_0x2516bd[_0x9e9c('0x1e')],function(_0x46bf6c){return{'model':db[_0x46bf6c[_0x9e9c('0x20')]],'as':_0x46bf6c['as'],'attributes':_0x46bf6c['attributes'],'include':_0x46bf6c[_0x9e9c('0x1e')]?_[_0x9e9c('0x1f')](_0x46bf6c[_0x9e9c('0x1e')],function(_0x1f228b){return{'model':db[_0x1f228b[_0x9e9c('0x20')]],'as':_0x1f228b['as'],'attributes':_0x1f228b[_0x9e9c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9e9c('0xe')](function(_0x4a7a05){logger['info']('ShowSmsQueue',_0x5266fd);logger[_0x9e9c('0x11')](_0x9e9c('0x22'),_0x5266fd,JSON[_0x9e9c('0x13')](_0x4a7a05));_0x5be652(_0x4a7a05);})[_0x9e9c('0x18')](function(_0x2938b8){logger[_0x9e9c('0x14')](_0x9e9c('0x22'),_0x2938b8[_0x9e9c('0x17')],_0x5266fd);_0x4a82b1(_0x4bbf58[_0x9e9c('0x14')](0x1f4,_0x2938b8['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index d638716..681abc9 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 _0xda3d=['smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x1c4006,_0x2524d4){var _0x19586e=function(_0x75a04b){while(--_0x75a04b){_0x1c4006['push'](_0x1c4006['shift']());}};_0x19586e(++_0x2524d4);}(_0xda3d,0xa9));var _0xdda3=function(_0x16c39b,_0x298dd0){_0x16c39b=_0x16c39b-0x0;var _0x249788=_0xda3d[_0x16c39b];return _0x249788;};'use strict';var SmsQueueEvents=require(_0xdda3('0x0'));var events=[_0xdda3('0x1'),_0xdda3('0x2'),_0xdda3('0x3')];function createListener(_0x4a3d5b,_0x374f4f){return function(_0x24c016){_0x374f4f[_0xdda3('0x4')](_0x4a3d5b,_0x24c016);};}function removeListener(_0x4a3403,_0x52321d){return function(){SmsQueueEvents[_0xdda3('0x5')](_0x4a3403,_0x52321d);};}exports[_0xdda3('0x6')]=function(_0x275d9e){for(var _0x21e2cd=0x0,_0x2b9db1=events['length'];_0x21e2cd<_0x2b9db1;_0x21e2cd++){var _0x538773=events[_0x21e2cd];var _0x635d8f=createListener(_0xdda3('0x7')+_0x538773,_0x275d9e);SmsQueueEvents['on'](_0x538773,_0x635d8f);}}; \ No newline at end of file +var _0xda64=['removeListener','register','length','./smsQueue.events','save','remove','update'];(function(_0xd2d54,_0x5329f7){var _0x78b113=function(_0x7d2b29){while(--_0x7d2b29){_0xd2d54['push'](_0xd2d54['shift']());}};_0x78b113(++_0x5329f7);}(_0xda64,0x1a0));var _0x4da6=function(_0x3ff04a,_0x484590){_0x3ff04a=_0x3ff04a-0x0;var _0x309744=_0xda64[_0x3ff04a];return _0x309744;};'use strict';var SmsQueueEvents=require(_0x4da6('0x0'));var events=[_0x4da6('0x1'),_0x4da6('0x2'),_0x4da6('0x3')];function createListener(_0x1c0a01,_0xf8c05d){return function(_0x3901bb){_0xf8c05d['emit'](_0x1c0a01,_0x3901bb);};}function removeListener(_0x2ef187,_0x505c4c){return function(){SmsQueueEvents[_0x4da6('0x4')](_0x2ef187,_0x505c4c);};}exports[_0x4da6('0x5')]=function(_0x338a4a){for(var _0x1f6779=0x0,_0x306fac=events[_0x4da6('0x6')];_0x1f6779<_0x306fac;_0x1f6779++){var _0x1ad570=events[_0x1f6779];var _0x5ccb59=createListener('smsQueue:'+_0x1ad570,_0x338a4a);SmsQueueEvents['on'](_0x1ad570,_0x5ccb59);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index f3b38c3..d10541f 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 _0x9121=['/:id','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','create','put','update','delete'];(function(_0x19b1d4,_0x593c61){var _0x54fd86=function(_0x210c16){while(--_0x210c16){_0x19b1d4['push'](_0x19b1d4['shift']());}};_0x54fd86(++_0x593c61);}(_0x9121,0x134));var _0x1912=function(_0xd553ab,_0x788918){_0xd553ab=_0xd553ab-0x0;var _0x215442=_0x9121[_0xd553ab];return _0x215442;};'use strict';var multer=require(_0x1912('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1912('0x1'));var express=require('express');var router=express[_0x1912('0x2')]();var auth=require(_0x1912('0x3'));var interaction=require(_0x1912('0x4'));var config=require(_0x1912('0x5'));var controller=require('./smsQueueReport.controller');router[_0x1912('0x6')]('/',auth[_0x1912('0x7')](),controller[_0x1912('0x8')]);router['get'](_0x1912('0x9'),auth[_0x1912('0x7')](),controller[_0x1912('0xa')]);router[_0x1912('0x6')]('/:id',auth[_0x1912('0x7')](),controller['show']);router['post']('/',auth[_0x1912('0x7')](),controller[_0x1912('0xb')]);router[_0x1912('0xc')]('/:id',auth[_0x1912('0x7')](),controller[_0x1912('0xd')]);router[_0x1912('0xe')](_0x1912('0xf'),auth[_0x1912('0x7')](),controller['destroy']);module[_0x1912('0x10')]=router; \ No newline at end of file +var _0x5bab=['post','create','put','/:id','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','show'];(function(_0x28c07a,_0x4519f4){var _0x8d419f=function(_0x3b493f){while(--_0x3b493f){_0x28c07a['push'](_0x28c07a['shift']());}};_0x8d419f(++_0x4519f4);}(_0x5bab,0x15a));var _0xb5ba=function(_0x5780b3,_0x2ebd88){_0x5780b3=_0x5780b3-0x0;var _0x3cad5e=_0x5bab[_0x5780b3];return _0x3cad5e;};'use strict';var multer=require(_0xb5ba('0x0'));var util=require('util');var path=require(_0xb5ba('0x1'));var timeout=require(_0xb5ba('0x2'));var express=require(_0xb5ba('0x3'));var router=express[_0xb5ba('0x4')]();var auth=require(_0xb5ba('0x5'));var interaction=require(_0xb5ba('0x6'));var config=require(_0xb5ba('0x7'));var controller=require(_0xb5ba('0x8'));router[_0xb5ba('0x9')]('/',auth[_0xb5ba('0xa')](),controller[_0xb5ba('0xb')]);router['get']('/describe',auth[_0xb5ba('0xa')](),controller[_0xb5ba('0xc')]);router[_0xb5ba('0x9')]('/:id',auth[_0xb5ba('0xa')](),controller[_0xb5ba('0xd')]);router[_0xb5ba('0xe')]('/',auth['isAuthenticated'](),controller[_0xb5ba('0xf')]);router[_0xb5ba('0x10')](_0xb5ba('0x11'),auth[_0xb5ba('0xa')](),controller[_0xb5ba('0x12')]);router[_0xb5ba('0x13')](_0xb5ba('0x11'),auth[_0xb5ba('0xa')](),controller['destroy']);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 0ce5582..fa370b3 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 _0x63c6=['sequelize','exports','STRING','DATE','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63c6,0xae));var _0x663c=function(_0x2c3b30,_0x476fb9){_0x2c3b30=_0x2c3b30-0x0;var _0x3a99e3=_0x63c6[_0x2c3b30];return _0x3a99e3;};'use strict';var moment=require(_0x663c('0x0'));var Sequelize=require(_0x663c('0x1'));module[_0x663c('0x2')]={'uniqueid':{'type':Sequelize[_0x663c('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x663c('0x4')]},'leaveAt':{'type':Sequelize[_0x663c('0x4')]},'acceptAt':{'type':Sequelize[_0x663c('0x4')]},'exitAt':{'type':Sequelize[_0x663c('0x4')]},'reason':{'type':Sequelize[_0x663c('0x3')]}}; \ No newline at end of file +var _0x031e=['STRING','DATE','moment','sequelize','exports'];(function(_0x4f4d19,_0x574245){var _0x27a258=function(_0x38da3e){while(--_0x38da3e){_0x4f4d19['push'](_0x4f4d19['shift']());}};_0x27a258(++_0x574245);}(_0x031e,0x7f));var _0xe031=function(_0x3a07c1,_0x34d57f){_0x3a07c1=_0x3a07c1-0x0;var _0x2bbe15=_0x031e[_0x3a07c1];return _0x2bbe15;};'use strict';var moment=require(_0xe031('0x0'));var Sequelize=require(_0xe031('0x1'));module[_0xe031('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe031('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe031('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xe031('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index f1b1ab2..2e52f6f 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 _0xe146=['body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsQueueReport','fieldName','type','key','keys','model','query','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create'];(function(_0x3850de,_0x2acfca){var _0x3c405f=function(_0x1e0b0d){while(--_0x1e0b0d){_0x3850de['push'](_0x3850de['shift']());}};_0x3c405f(++_0x2acfca);}(_0xe146,0x1ec));var _0x6e14=function(_0x4f6f84,_0x31e197){_0x4f6f84=_0x4f6f84-0x0;var _0x20d989=_0xe146[_0x4f6f84];return _0x20d989;};'use strict';var pdf=require(_0x6e14('0x0'));var emlformat=require(_0x6e14('0x1'));var rimraf=require(_0x6e14('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e14('0x3'));var rp=require(_0x6e14('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6e14('0x5'));var util=require('util');var path=require(_0x6e14('0x6'));var sox=require('sox');var csv=require(_0x6e14('0x7'));var ejs=require(_0x6e14('0x8'));var fs=require('fs');var _=require(_0x6e14('0x9'));var squel=require(_0x6e14('0xa'));var crypto=require(_0x6e14('0xb'));var jsforce=require(_0x6e14('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6e14('0x7'));var querystring=require(_0x6e14('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6e14('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e14('0xf'));var logger=require('../../config/logger')(_0x6e14('0x10'));var utils=require(_0x6e14('0x11'));var config=require('../../config/environment');var db=require(_0x6e14('0x12'))['db'];function respondWithStatusCode(_0xe05174,_0x3dedad){_0x3dedad=_0x3dedad||0xcc;return function(_0x2ec2cb){if(_0x2ec2cb){return _0xe05174[_0x6e14('0x13')](_0x3dedad);}return _0xe05174['status'](_0x3dedad)[_0x6e14('0x14')]();};}function respondWithResult(_0x5c38a2,_0x48edf7){_0x48edf7=_0x48edf7||0xc8;return function(_0x35b234){if(_0x35b234){return _0x5c38a2[_0x6e14('0x15')](_0x48edf7)[_0x6e14('0x16')](_0x35b234);}};}function respondWithFilteredResult(_0x5f4973,_0x24d652){return function(_0x289221){if(_0x289221){var _0x1ebb5b=_0x289221[_0x6e14('0x17')],_0x1135d4=_0x24d652[_0x6e14('0x18')],_0xdb965b=_0x24d652[_0x6e14('0x18')]+_0x24d652['limit'],_0x3e0567;if(_0xdb965b>=_0x1ebb5b){_0xdb965b=_0x1ebb5b;_0x3e0567=0xc8;}else{_0x3e0567=0xce;}_0x5f4973[_0x6e14('0x15')](_0x3e0567);return _0x5f4973[_0x6e14('0x19')]('Content-Range',_0x1135d4+'-'+_0xdb965b+'/'+_0x1ebb5b)[_0x6e14('0x16')](_0x289221);}return null;};}function patchUpdates(_0x4da393){return function(_0x1cde3b){try{jsonpatch[_0x6e14('0x1a')](_0x1cde3b,_0x4da393,!![]);}catch(_0x1aedf6){return BPromise[_0x6e14('0x1b')](_0x1aedf6);}return _0x1cde3b[_0x6e14('0x1c')]();};}function saveUpdates(_0x289c4d,_0x19f342){return function(_0x2d95dd){if(_0x2d95dd){return _0x2d95dd[_0x6e14('0x1d')](_0x289c4d)[_0x6e14('0x1e')](function(_0x5db89e){return _0x5db89e;});}return null;};}function removeEntity(_0x1df37f,_0x606610){return function(_0x2ed5c7){if(_0x2ed5c7){return _0x2ed5c7[_0x6e14('0x1f')]()['then'](function(){_0x1df37f[_0x6e14('0x15')](0xcc)[_0x6e14('0x14')]();});}};}function handleEntityNotFound(_0x266a9c,_0x4b6015){return function(_0x5db750){if(!_0x5db750){_0x266a9c[_0x6e14('0x13')](0x194);}return _0x5db750;};}function handleError(_0x306c64,_0x3e68de){_0x3e68de=_0x3e68de||0x1f4;return function(_0xad373b){logger[_0x6e14('0x20')](_0xad373b[_0x6e14('0x21')]);if(_0xad373b[_0x6e14('0x22')]){delete _0xad373b['name'];}_0x306c64[_0x6e14('0x15')](_0x3e68de)[_0x6e14('0x23')](_0xad373b);};}exports[_0x6e14('0x24')]=function(_0x23124b,_0x3ba902){var _0x40ba7c={},_0x4c0105={},_0x14deda={'count':0x0,'rows':[]};var _0xb03b85=_[_0x6e14('0x25')](db[_0x6e14('0x26')]['rawAttributes'],function(_0x2015ad){return{'name':_0x2015ad[_0x6e14('0x27')],'type':_0x2015ad[_0x6e14('0x28')][_0x6e14('0x29')]};});_0x4c0105['model']=_[_0x6e14('0x25')](_0xb03b85,_0x6e14('0x22'));_0x4c0105['query']=_[_0x6e14('0x2a')](_0x23124b['query']);_0x4c0105['filters']=_['intersection'](_0x4c0105[_0x6e14('0x2b')],_0x4c0105[_0x6e14('0x2c')]);_0x40ba7c[_0x6e14('0x2d')]=_[_0x6e14('0x2e')](_0x4c0105[_0x6e14('0x2b')],qs[_0x6e14('0x2f')](_0x23124b[_0x6e14('0x2c')][_0x6e14('0x2f')]));_0x40ba7c['attributes']=_0x40ba7c['attributes'][_0x6e14('0x30')]?_0x40ba7c['attributes']:_0x4c0105[_0x6e14('0x2b')];if(!_0x23124b[_0x6e14('0x2c')]['hasOwnProperty'](_0x6e14('0x31'))){_0x40ba7c['limit']=qs['limit'](_0x23124b[_0x6e14('0x2c')][_0x6e14('0x32')]);_0x40ba7c['offset']=qs[_0x6e14('0x18')](_0x23124b[_0x6e14('0x2c')]['offset']);}_0x40ba7c[_0x6e14('0x33')]=qs[_0x6e14('0x34')](_0x23124b[_0x6e14('0x2c')]['sort']);_0x40ba7c[_0x6e14('0x35')]=qs[_0x6e14('0x36')](_[_0x6e14('0x37')](_0x23124b[_0x6e14('0x2c')],_0x4c0105['filters']));if(_0x23124b[_0x6e14('0x2c')][_0x6e14('0x38')]){_0x40ba7c[_0x6e14('0x35')]=_['merge'](_0x40ba7c['where'],{'$or':_[_0x6e14('0x25')](_0xb03b85,function(_0x58872e){if(_0x58872e[_0x6e14('0x28')]!==_0x6e14('0x39')){var _0x4765a5={};_0x4765a5[_0x58872e[_0x6e14('0x22')]]={'$like':'%'+_0x23124b[_0x6e14('0x2c')][_0x6e14('0x38')]+'%'};return _0x4765a5;}})});}_0x40ba7c=_['merge']({},_0x40ba7c,_0x23124b[_0x6e14('0x3a')]);var _0x29a8e9={'where':_0x40ba7c[_0x6e14('0x35')]};return db[_0x6e14('0x26')][_0x6e14('0x17')](_0x29a8e9)[_0x6e14('0x1e')](function(_0x2924ad){_0x14deda[_0x6e14('0x17')]=_0x2924ad;if(_0x23124b['query'][_0x6e14('0x3b')]){_0x40ba7c['include']=[{'all':!![]}];}return db[_0x6e14('0x26')][_0x6e14('0x3c')](_0x40ba7c);})[_0x6e14('0x1e')](function(_0x30d577){_0x14deda[_0x6e14('0x3d')]=_0x30d577;return _0x14deda;})['then'](respondWithFilteredResult(_0x3ba902,_0x40ba7c))[_0x6e14('0x3e')](handleError(_0x3ba902,null));};exports[_0x6e14('0x3f')]=function(_0xf5b37e,_0x4f18ef){var _0x74dcbd={'raw':!![],'where':{'id':_0xf5b37e[_0x6e14('0x40')]['id']}},_0x109904={};_0x109904['model']=_[_0x6e14('0x2a')](db[_0x6e14('0x26')]['rawAttributes']);_0x109904[_0x6e14('0x2c')]=_[_0x6e14('0x2a')](_0xf5b37e[_0x6e14('0x2c')]);_0x109904[_0x6e14('0x36')]=_['intersection'](_0x109904[_0x6e14('0x2b')],_0x109904[_0x6e14('0x2c')]);_0x74dcbd['attributes']=_[_0x6e14('0x2e')](_0x109904[_0x6e14('0x2b')],qs[_0x6e14('0x2f')](_0xf5b37e['query'][_0x6e14('0x2f')]));_0x74dcbd[_0x6e14('0x2d')]=_0x74dcbd[_0x6e14('0x2d')]['length']?_0x74dcbd[_0x6e14('0x2d')]:_0x109904[_0x6e14('0x2b')];if(_0xf5b37e['query'][_0x6e14('0x3b')]){_0x74dcbd[_0x6e14('0x41')]=[{'all':!![]}];}_0x74dcbd=_['merge']({},_0x74dcbd,_0xf5b37e[_0x6e14('0x3a')]);return db[_0x6e14('0x26')][_0x6e14('0x42')](_0x74dcbd)[_0x6e14('0x1e')](handleEntityNotFound(_0x4f18ef,null))[_0x6e14('0x1e')](respondWithResult(_0x4f18ef,null))['catch'](handleError(_0x4f18ef,null));};exports['create']=function(_0x4dc54c,_0x4aa772){return db['SmsQueueReport'][_0x6e14('0x43')](_0x4dc54c['body'],{})[_0x6e14('0x1e')](respondWithResult(_0x4aa772,0xc9))['catch'](handleError(_0x4aa772,null));};exports[_0x6e14('0x1d')]=function(_0x1a9809,_0x2fa4bc){if(_0x1a9809[_0x6e14('0x44')]['id']){delete _0x1a9809[_0x6e14('0x44')]['id'];}return db[_0x6e14('0x26')][_0x6e14('0x42')]({'where':{'id':_0x1a9809[_0x6e14('0x40')]['id']}})[_0x6e14('0x1e')](handleEntityNotFound(_0x2fa4bc,null))[_0x6e14('0x1e')](saveUpdates(_0x1a9809['body'],null))['then'](respondWithResult(_0x2fa4bc,null))[_0x6e14('0x3e')](handleError(_0x2fa4bc,null));};exports[_0x6e14('0x1f')]=function(_0x2c9334,_0x6e3c64){return db[_0x6e14('0x26')][_0x6e14('0x42')]({'where':{'id':_0x2c9334[_0x6e14('0x40')]['id']}})['then'](handleEntityNotFound(_0x6e3c64,null))['then'](removeEntity(_0x6e3c64,null))['catch'](handleError(_0x6e3c64,null));};exports[_0x6e14('0x45')]=function(_0x4b97f5,_0x18e509){return db['SmsQueueReport'][_0x6e14('0x45')]()['then'](respondWithResult(_0x18e509,null))[_0x6e14('0x3e')](handleError(_0x18e509,null));}; \ No newline at end of file +var _0xc4b8=['reject','save','then','destroy','error','stack','name','send','map','SmsQueueReport','rawAttributes','type','key','model','query','keys','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','find','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','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/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply'];(function(_0x3e7df3,_0x1f1ec7){var _0x3e7e79=function(_0x3f99a0){while(--_0x3f99a0){_0x3e7df3['push'](_0x3e7df3['shift']());}};_0x3e7e79(++_0x1f1ec7);}(_0xc4b8,0x78));var _0x8c4b=function(_0x1e991b,_0x3e014e){_0x1e991b=_0x1e991b-0x0;var _0x308d54=_0xc4b8[_0x1e991b];return _0x308d54;};'use strict';var pdf=require(_0x8c4b('0x0'));var emlformat=require(_0x8c4b('0x1'));var rimraf=require(_0x8c4b('0x2'));var zipdir=require(_0x8c4b('0x3'));var jsonpatch=require(_0x8c4b('0x4'));var rp=require('request-promise');var moment=require(_0x8c4b('0x5'));var BPromise=require(_0x8c4b('0x6'));var Mustache=require('mustache');var util=require(_0x8c4b('0x7'));var path=require('path');var sox=require(_0x8c4b('0x8'));var csv=require(_0x8c4b('0x9'));var ejs=require(_0x8c4b('0xa'));var fs=require('fs');var _=require(_0x8c4b('0xb'));var squel=require(_0x8c4b('0xc'));var crypto=require(_0x8c4b('0xd'));var jsforce=require(_0x8c4b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8c4b('0x9'));var querystring=require('querystring');var Papa=require(_0x8c4b('0xf'));var Redis=require(_0x8c4b('0x10'));var authService=require(_0x8c4b('0x11'));var qs=require(_0x8c4b('0x12'));var as=require(_0x8c4b('0x13'));var hardwareService=require(_0x8c4b('0x14'));var logger=require(_0x8c4b('0x15'))(_0x8c4b('0x16'));var utils=require('../../config/utils');var config=require(_0x8c4b('0x17'));var db=require(_0x8c4b('0x18'))['db'];function respondWithStatusCode(_0x16435b,_0x2fbd2b){_0x2fbd2b=_0x2fbd2b||0xcc;return function(_0x538c2a){if(_0x538c2a){return _0x16435b[_0x8c4b('0x19')](_0x2fbd2b);}return _0x16435b[_0x8c4b('0x1a')](_0x2fbd2b)[_0x8c4b('0x1b')]();};}function respondWithResult(_0x42c219,_0x57f099){_0x57f099=_0x57f099||0xc8;return function(_0x2d1a66){if(_0x2d1a66){return _0x42c219[_0x8c4b('0x1a')](_0x57f099)[_0x8c4b('0x1c')](_0x2d1a66);}};}function respondWithFilteredResult(_0x55d73d,_0x3c5cea){return function(_0x1aa929){if(_0x1aa929){var _0x34abc6=_0x1aa929[_0x8c4b('0x1d')],_0x283a6e=_0x3c5cea[_0x8c4b('0x1e')],_0x3d9e89=_0x3c5cea[_0x8c4b('0x1e')]+_0x3c5cea['limit'],_0x9d9a3d;if(_0x3d9e89>=_0x34abc6){_0x3d9e89=_0x34abc6;_0x9d9a3d=0xc8;}else{_0x9d9a3d=0xce;}_0x55d73d['status'](_0x9d9a3d);return _0x55d73d[_0x8c4b('0x1f')](_0x8c4b('0x20'),_0x283a6e+'-'+_0x3d9e89+'/'+_0x34abc6)[_0x8c4b('0x1c')](_0x1aa929);}return null;};}function patchUpdates(_0xdf39a2){return function(_0xaa2ca7){try{jsonpatch[_0x8c4b('0x21')](_0xaa2ca7,_0xdf39a2,!![]);}catch(_0x41f349){return BPromise[_0x8c4b('0x22')](_0x41f349);}return _0xaa2ca7[_0x8c4b('0x23')]();};}function saveUpdates(_0x2c8b2b,_0x78fedc){return function(_0x43bf2f){if(_0x43bf2f){return _0x43bf2f['update'](_0x2c8b2b)[_0x8c4b('0x24')](function(_0x4e9ebb){return _0x4e9ebb;});}return null;};}function removeEntity(_0x302be8,_0x531811){return function(_0x4d6979){if(_0x4d6979){return _0x4d6979[_0x8c4b('0x25')]()[_0x8c4b('0x24')](function(){_0x302be8[_0x8c4b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x218a17,_0x2746ca){return function(_0x1bd148){if(!_0x1bd148){_0x218a17[_0x8c4b('0x19')](0x194);}return _0x1bd148;};}function handleError(_0x420001,_0x52ba14){_0x52ba14=_0x52ba14||0x1f4;return function(_0x20e614){logger[_0x8c4b('0x26')](_0x20e614[_0x8c4b('0x27')]);if(_0x20e614[_0x8c4b('0x28')]){delete _0x20e614[_0x8c4b('0x28')];}_0x420001[_0x8c4b('0x1a')](_0x52ba14)[_0x8c4b('0x29')](_0x20e614);};}exports['index']=function(_0x1e93c2,_0x4a58e6){var _0x1be6c1={},_0x289e68={},_0xe7a198={'count':0x0,'rows':[]};var _0x2290da=_[_0x8c4b('0x2a')](db[_0x8c4b('0x2b')][_0x8c4b('0x2c')],function(_0x3cfe0b){return{'name':_0x3cfe0b['fieldName'],'type':_0x3cfe0b[_0x8c4b('0x2d')][_0x8c4b('0x2e')]};});_0x289e68[_0x8c4b('0x2f')]=_['map'](_0x2290da,_0x8c4b('0x28'));_0x289e68[_0x8c4b('0x30')]=_[_0x8c4b('0x31')](_0x1e93c2['query']);_0x289e68['filters']=_['intersection'](_0x289e68['model'],_0x289e68[_0x8c4b('0x30')]);_0x1be6c1[_0x8c4b('0x32')]=_['intersection'](_0x289e68[_0x8c4b('0x2f')],qs[_0x8c4b('0x33')](_0x1e93c2[_0x8c4b('0x30')][_0x8c4b('0x33')]));_0x1be6c1[_0x8c4b('0x32')]=_0x1be6c1[_0x8c4b('0x32')]['length']?_0x1be6c1[_0x8c4b('0x32')]:_0x289e68['model'];if(!_0x1e93c2['query'][_0x8c4b('0x34')](_0x8c4b('0x35'))){_0x1be6c1[_0x8c4b('0x36')]=qs[_0x8c4b('0x36')](_0x1e93c2[_0x8c4b('0x30')][_0x8c4b('0x36')]);_0x1be6c1[_0x8c4b('0x1e')]=qs[_0x8c4b('0x1e')](_0x1e93c2[_0x8c4b('0x30')][_0x8c4b('0x1e')]);}_0x1be6c1[_0x8c4b('0x37')]=qs[_0x8c4b('0x38')](_0x1e93c2[_0x8c4b('0x30')]['sort']);_0x1be6c1[_0x8c4b('0x39')]=qs[_0x8c4b('0x3a')](_[_0x8c4b('0x3b')](_0x1e93c2[_0x8c4b('0x30')],_0x289e68[_0x8c4b('0x3a')]));if(_0x1e93c2[_0x8c4b('0x30')][_0x8c4b('0x3c')]){_0x1be6c1[_0x8c4b('0x39')]=_['merge'](_0x1be6c1[_0x8c4b('0x39')],{'$or':_['map'](_0x2290da,function(_0x14db11){if(_0x14db11[_0x8c4b('0x2d')]!==_0x8c4b('0x3d')){var _0x4e5892={};_0x4e5892[_0x14db11['name']]={'$like':'%'+_0x1e93c2[_0x8c4b('0x30')][_0x8c4b('0x3c')]+'%'};return _0x4e5892;}})});}_0x1be6c1=_[_0x8c4b('0x3e')]({},_0x1be6c1,_0x1e93c2[_0x8c4b('0x3f')]);var _0x9a5ec6={'where':_0x1be6c1[_0x8c4b('0x39')]};return db[_0x8c4b('0x2b')]['count'](_0x9a5ec6)[_0x8c4b('0x24')](function(_0x33e336){_0xe7a198[_0x8c4b('0x1d')]=_0x33e336;if(_0x1e93c2[_0x8c4b('0x30')][_0x8c4b('0x40')]){_0x1be6c1[_0x8c4b('0x41')]=[{'all':!![]}];}return db[_0x8c4b('0x2b')][_0x8c4b('0x42')](_0x1be6c1);})[_0x8c4b('0x24')](function(_0x134caa){_0xe7a198[_0x8c4b('0x43')]=_0x134caa;return _0xe7a198;})[_0x8c4b('0x24')](respondWithFilteredResult(_0x4a58e6,_0x1be6c1))[_0x8c4b('0x44')](handleError(_0x4a58e6,null));};exports[_0x8c4b('0x45')]=function(_0x3ea86d,_0x80326d){var _0x249dac={'raw':!![],'where':{'id':_0x3ea86d[_0x8c4b('0x46')]['id']}},_0x546e77={};_0x546e77[_0x8c4b('0x2f')]=_[_0x8c4b('0x31')](db[_0x8c4b('0x2b')][_0x8c4b('0x2c')]);_0x546e77[_0x8c4b('0x30')]=_[_0x8c4b('0x31')](_0x3ea86d['query']);_0x546e77['filters']=_[_0x8c4b('0x47')](_0x546e77[_0x8c4b('0x2f')],_0x546e77[_0x8c4b('0x30')]);_0x249dac['attributes']=_[_0x8c4b('0x47')](_0x546e77[_0x8c4b('0x2f')],qs[_0x8c4b('0x33')](_0x3ea86d['query']['fields']));_0x249dac[_0x8c4b('0x32')]=_0x249dac[_0x8c4b('0x32')][_0x8c4b('0x48')]?_0x249dac['attributes']:_0x546e77[_0x8c4b('0x2f')];if(_0x3ea86d[_0x8c4b('0x30')][_0x8c4b('0x40')]){_0x249dac[_0x8c4b('0x41')]=[{'all':!![]}];}_0x249dac=_[_0x8c4b('0x3e')]({},_0x249dac,_0x3ea86d[_0x8c4b('0x3f')]);return db[_0x8c4b('0x2b')][_0x8c4b('0x49')](_0x249dac)[_0x8c4b('0x24')](handleEntityNotFound(_0x80326d,null))[_0x8c4b('0x24')](respondWithResult(_0x80326d,null))['catch'](handleError(_0x80326d,null));};exports['create']=function(_0x35adf6,_0xb27cf5){return db[_0x8c4b('0x2b')]['create'](_0x35adf6[_0x8c4b('0x4a')],{})[_0x8c4b('0x24')](respondWithResult(_0xb27cf5,0xc9))[_0x8c4b('0x44')](handleError(_0xb27cf5,null));};exports[_0x8c4b('0x4b')]=function(_0x2ee5e0,_0x54beae){if(_0x2ee5e0[_0x8c4b('0x4a')]['id']){delete _0x2ee5e0['body']['id'];}return db[_0x8c4b('0x2b')]['find']({'where':{'id':_0x2ee5e0[_0x8c4b('0x46')]['id']}})[_0x8c4b('0x24')](handleEntityNotFound(_0x54beae,null))['then'](saveUpdates(_0x2ee5e0[_0x8c4b('0x4a')],null))[_0x8c4b('0x24')](respondWithResult(_0x54beae,null))['catch'](handleError(_0x54beae,null));};exports[_0x8c4b('0x25')]=function(_0xdb2406,_0x5e100d){return db['SmsQueueReport']['find']({'where':{'id':_0xdb2406['params']['id']}})[_0x8c4b('0x24')](handleEntityNotFound(_0x5e100d,null))['then'](removeEntity(_0x5e100d,null))['catch'](handleError(_0x5e100d,null));};exports[_0x8c4b('0x4c')]=function(_0x313993,_0x49d9b2){return db[_0x8c4b('0x2b')][_0x8c4b('0x4c')]()['then'](respondWithResult(_0x49d9b2,null))[_0x8c4b('0x44')](handleError(_0x49d9b2,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 61f4ac1..d581793 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 _0xa44c=['path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','api','moment','bluebird','request-promise'];(function(_0x4fd285,_0x2d5ca5){var _0x4ee5e0=function(_0x1c0281){while(--_0x1c0281){_0x4fd285['push'](_0x4fd285['shift']());}};_0x4ee5e0(++_0x2d5ca5);}(_0xa44c,0x1a9));var _0xca44=function(_0x48b333,_0x5381b4){_0x48b333=_0x48b333-0x0;var _0x56d4f2=_0xa44c[_0x48b333];return _0x56d4f2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xca44('0x0'));var moment=require(_0xca44('0x1'));var BPromise=require(_0xca44('0x2'));var rp=require(_0xca44('0x3'));var fs=require('fs');var path=require(_0xca44('0x4'));var rimraf=require(_0xca44('0x5'));var config=require(_0xca44('0x6'));var attributes=require(_0xca44('0x7'));module[_0xca44('0x8')]=function(_0x46737f,_0x32d987){return _0x46737f[_0xca44('0x9')](_0xca44('0xa'),attributes,{'tableName':_0xca44('0xb'),'paranoid':![],'indexes':[{'name':_0xca44('0xc'),'fields':[_0xca44('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde71=['path','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','report_sms_queue','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5dfd94,_0x28ebfa){var _0x5693e1=function(_0x4ca05a){while(--_0x4ca05a){_0x5dfd94['push'](_0x5dfd94['shift']());}};_0x5693e1(++_0x28ebfa);}(_0xde71,0x1c1));var _0x1de7=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0xde71[_0x3e69ae];return _0x3d7f42;};'use strict';var _=require(_0x1de7('0x0'));var util=require(_0x1de7('0x1'));var logger=require(_0x1de7('0x2'))(_0x1de7('0x3'));var moment=require('moment');var BPromise=require(_0x1de7('0x4'));var rp=require(_0x1de7('0x5'));var fs=require('fs');var path=require(_0x1de7('0x6'));var rimraf=require(_0x1de7('0x7'));var config=require(_0x1de7('0x8'));var attributes=require(_0x1de7('0x9'));module['exports']=function(_0x34d17a,_0xd38b7f){return _0x34d17a[_0x1de7('0xa')](_0x1de7('0xb'),attributes,{'tableName':_0x1de7('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index c68b93a..c91949e 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 _0xbfd5=['message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1f1cc7,_0x26f365){var _0x5f49e9=function(_0x45c75a){while(--_0x45c75a){_0x1f1cc7['push'](_0x1f1cc7['shift']());}};_0x5f49e9(++_0x26f365);}(_0xbfd5,0x155));var _0x5bfd=function(_0x329273,_0x62402f){_0x329273=_0x329273-0x0;var _0x338d5e=_0xbfd5[_0x329273];return _0x338d5e;};'use strict';var _=require(_0x5bfd('0x0'));var util=require(_0x5bfd('0x1'));var moment=require(_0x5bfd('0x2'));var BPromise=require(_0x5bfd('0x3'));var rs=require(_0x5bfd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5bfd('0x5'))['db'];var utils=require(_0x5bfd('0x6'));var logger=require(_0x5bfd('0x7'))(_0x5bfd('0x8'));var config=require(_0x5bfd('0x9'));var jayson=require(_0x5bfd('0xa'));var client=jayson[_0x5bfd('0xb')][_0x5bfd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x540a69,_0x379316,_0x3fca93){return new BPromise(function(_0x21730e,_0x348b44){return client[_0x5bfd('0xd')](_0x540a69,_0x3fca93)[_0x5bfd('0xe')](function(_0x27853a){logger[_0x5bfd('0xf')](_0x5bfd('0x10'),_0x379316,'request\x20sent');logger[_0x5bfd('0x11')](_0x5bfd('0x12'),_0x379316,_0x5bfd('0x13'),JSON[_0x5bfd('0x14')](_0x27853a));if(_0x27853a[_0x5bfd('0x15')]){if(_0x27853a[_0x5bfd('0x15')]['code']===0x1f4){logger['error'](_0x5bfd('0x10'),_0x379316,_0x27853a[_0x5bfd('0x15')]['message']);return _0x348b44(_0x27853a['error'][_0x5bfd('0x16')]);}logger[_0x5bfd('0x15')](_0x5bfd('0x10'),_0x379316,_0x27853a['error'][_0x5bfd('0x16')]);return _0x21730e(_0x27853a[_0x5bfd('0x15')][_0x5bfd('0x16')]);}else{logger[_0x5bfd('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x379316,_0x5bfd('0x13'));_0x21730e(_0x27853a[_0x5bfd('0x17')][_0x5bfd('0x16')]);}})[_0x5bfd('0x18')](function(_0x1b8c5f){logger[_0x5bfd('0x15')](_0x5bfd('0x10'),_0x379316,_0x1b8c5f);_0x348b44(_0x1b8c5f);});});}exports[_0x5bfd('0x19')]=function(_0x410527){var _0x52468c=this;return new Promise(function(_0x3311b9,_0x5b317c){return db[_0x5bfd('0x1a')][_0x5bfd('0x1b')](_0x410527[_0x5bfd('0x1c')],{'raw':_0x410527[_0x5bfd('0x1d')]?_0x410527['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x47e4cb){logger[_0x5bfd('0xf')](_0x5bfd('0x19'),_0x410527);logger[_0x5bfd('0x11')](_0x5bfd('0x19'),_0x410527,JSON[_0x5bfd('0x14')](_0x47e4cb));_0x3311b9(_0x47e4cb);})[_0x5bfd('0x18')](function(_0x41cc13){logger[_0x5bfd('0x15')]('CreateSmsQueueReport',_0x41cc13[_0x5bfd('0x16')],_0x410527);_0x5b317c(_0x52468c[_0x5bfd('0x15')](0x1f4,_0x41cc13[_0x5bfd('0x16')]));});});};exports['UpdateSmsQueueReport']=function(_0x120841){var _0x3a0ade=this;return new Promise(function(_0x21ff00,_0x3e1575){return db['SmsQueueReport']['update'](_0x120841[_0x5bfd('0x1c')],{'raw':_0x120841['options']?_0x120841[_0x5bfd('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x120841[_0x5bfd('0x1d')]?_0x120841[_0x5bfd('0x1d')]['where']||null:null,'attributes':_0x120841[_0x5bfd('0x1d')]?_0x120841[_0x5bfd('0x1d')][_0x5bfd('0x1e')]||null:null,'limit':_0x120841['options']?_0x120841[_0x5bfd('0x1d')][_0x5bfd('0x1f')]||null:null})['then'](function(_0x1ae832){logger[_0x5bfd('0xf')](_0x5bfd('0x20'),_0x120841);logger[_0x5bfd('0x11')](_0x5bfd('0x20'),_0x120841,JSON['stringify'](_0x1ae832));_0x21ff00(_0x1ae832);})[_0x5bfd('0x18')](function(_0x5b9a53){logger[_0x5bfd('0x15')](_0x5bfd('0x20'),_0x5b9a53[_0x5bfd('0x16')],_0x120841);_0x3e1575(_0x3a0ade[_0x5bfd('0x15')](0x1f4,_0x5b9a53[_0x5bfd('0x16')]));});});}; \ No newline at end of file +var _0xc46c=['http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','update','where','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0xfbca2e,_0x2d0cb0){var _0x2a14cc=function(_0x28eef1){while(--_0x28eef1){_0xfbca2e['push'](_0xfbca2e['shift']());}};_0x2a14cc(++_0x2d0cb0);}(_0xc46c,0xfe));var _0xcc46=function(_0x431ff8,_0x4085dd){_0x431ff8=_0x431ff8-0x0;var _0x84ccd4=_0xc46c[_0x431ff8];return _0x84ccd4;};'use strict';var _=require(_0xcc46('0x0'));var util=require(_0xcc46('0x1'));var moment=require(_0xcc46('0x2'));var BPromise=require(_0xcc46('0x3'));var rs=require(_0xcc46('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcc46('0x5'));var logger=require(_0xcc46('0x6'))(_0xcc46('0x7'));var config=require('../../config/environment');var jayson=require(_0xcc46('0x8'));var client=jayson[_0xcc46('0x9')][_0xcc46('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10d143,_0x249118,_0x298956){return new BPromise(function(_0xc36f56,_0x236cd6){return client[_0xcc46('0xb')](_0x10d143,_0x298956)[_0xcc46('0xc')](function(_0x22d8b3){logger[_0xcc46('0xd')](_0xcc46('0xe'),_0x249118,_0xcc46('0xf'));logger[_0xcc46('0x10')](_0xcc46('0x11'),_0x249118,'request\x20sent',JSON[_0xcc46('0x12')](_0x22d8b3));if(_0x22d8b3[_0xcc46('0x13')]){if(_0x22d8b3[_0xcc46('0x13')][_0xcc46('0x14')]===0x1f4){logger[_0xcc46('0x13')](_0xcc46('0xe'),_0x249118,_0x22d8b3[_0xcc46('0x13')]['message']);return _0x236cd6(_0x22d8b3['error'][_0xcc46('0x15')]);}logger['error'](_0xcc46('0xe'),_0x249118,_0x22d8b3[_0xcc46('0x13')][_0xcc46('0x15')]);return _0xc36f56(_0x22d8b3[_0xcc46('0x13')][_0xcc46('0x15')]);}else{logger[_0xcc46('0xd')](_0xcc46('0xe'),_0x249118,_0xcc46('0xf'));_0xc36f56(_0x22d8b3['result']['message']);}})[_0xcc46('0x16')](function(_0x32a30c){logger[_0xcc46('0x13')](_0xcc46('0xe'),_0x249118,_0x32a30c);_0x236cd6(_0x32a30c);});});}exports[_0xcc46('0x17')]=function(_0x2114a4){var _0x37b13f=this;return new Promise(function(_0x37396e,_0x544d3d){return db[_0xcc46('0x18')][_0xcc46('0x19')](_0x2114a4[_0xcc46('0x1a')],{'raw':_0x2114a4[_0xcc46('0x1b')]?_0x2114a4['options'][_0xcc46('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x26c10d){logger['info']('CreateSmsQueueReport',_0x2114a4);logger[_0xcc46('0x10')](_0xcc46('0x17'),_0x2114a4,JSON[_0xcc46('0x12')](_0x26c10d));_0x37396e(_0x26c10d);})[_0xcc46('0x16')](function(_0xfdad55){logger[_0xcc46('0x13')]('CreateSmsQueueReport',_0xfdad55[_0xcc46('0x15')],_0x2114a4);_0x544d3d(_0x37b13f[_0xcc46('0x13')](0x1f4,_0xfdad55[_0xcc46('0x15')]));});});};exports['UpdateSmsQueueReport']=function(_0x55ae07){var _0xe3786c=this;return new Promise(function(_0x58378d,_0x267c14){return db[_0xcc46('0x18')][_0xcc46('0x1d')](_0x55ae07[_0xcc46('0x1a')],{'raw':_0x55ae07[_0xcc46('0x1b')]?_0x55ae07[_0xcc46('0x1b')][_0xcc46('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55ae07[_0xcc46('0x1b')]?_0x55ae07[_0xcc46('0x1b')][_0xcc46('0x1e')]||null:null,'attributes':_0x55ae07[_0xcc46('0x1b')]?_0x55ae07['options']['attributes']||null:null,'limit':_0x55ae07[_0xcc46('0x1b')]?_0x55ae07['options'][_0xcc46('0x1f')]||null:null})[_0xcc46('0xc')](function(_0x5e3ab4){logger[_0xcc46('0xd')](_0xcc46('0x20'),_0x55ae07);logger[_0xcc46('0x10')](_0xcc46('0x20'),_0x55ae07,JSON[_0xcc46('0x12')](_0x5e3ab4));_0x58378d(_0x5e3ab4);})['catch'](function(_0x2629cd){logger[_0xcc46('0x13')]('UpdateSmsQueueReport',_0x2629cd[_0xcc46('0x15')],_0x55ae07);_0x267c14(_0xe3786c['error'](0x1f4,_0x2629cd[_0xcc46('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index db3ecb0..17c3f9f 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 _0x0972=['put','update','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x1beb00,_0x457b2f){var _0x572036=function(_0x2dfbc9){while(--_0x2dfbc9){_0x1beb00['push'](_0x1beb00['shift']());}};_0x572036(++_0x457b2f);}(_0x0972,0x64));var _0x2097=function(_0x4edb56,_0x5ed882){_0x4edb56=_0x4edb56-0x0;var _0x4b8662=_0x0972[_0x4edb56];return _0x4b8662;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var auth=require(_0x2097('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2097('0x4'));var controller=require(_0x2097('0x5'));router[_0x2097('0x6')]('/',auth[_0x2097('0x7')](),controller[_0x2097('0x8')]);router[_0x2097('0x6')](_0x2097('0x9'),auth['isAuthenticated'](),controller[_0x2097('0xa')]);router[_0x2097('0x6')](_0x2097('0xb'),auth[_0x2097('0x7')](),controller[_0x2097('0xc')]);router['post']('/',auth[_0x2097('0x7')](),controller[_0x2097('0xd')]);router[_0x2097('0xe')](_0x2097('0xb'),auth[_0x2097('0x7')](),controller[_0x2097('0xf')]);router[_0x2097('0x10')](_0x2097('0xb'),auth[_0x2097('0x7')](),controller[_0x2097('0x11')]);module[_0x2097('0x12')]=router; \ No newline at end of file +var _0x3c81=['put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','./smsTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3c81,0x102));var _0x13c8=function(_0x313c5c,_0x4228e9){_0x313c5c=_0x313c5c-0x0;var _0xada8e2=_0x3c81[_0x313c5c];return _0xada8e2;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x13c8('0x4'));router[_0x13c8('0x5')]('/',auth[_0x13c8('0x6')](),controller[_0x13c8('0x7')]);router[_0x13c8('0x5')](_0x13c8('0x8'),auth[_0x13c8('0x6')](),controller['describe']);router[_0x13c8('0x5')]('/:id',auth[_0x13c8('0x6')](),controller[_0x13c8('0x9')]);router[_0x13c8('0xa')]('/',auth[_0x13c8('0x6')](),controller[_0x13c8('0xb')]);router[_0x13c8('0xc')](_0x13c8('0xd'),auth[_0x13c8('0x6')](),controller[_0x13c8('0xe')]);router[_0x13c8('0xf')](_0x13c8('0xd'),auth[_0x13c8('0x6')](),controller[_0x13c8('0x10')]);module[_0x13c8('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 2e019b5..46c0dfb 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 _0x9f95=['STRING','ENUM','account','queue','DATE','NOW','sequelize'];(function(_0x4a7e98,_0x250137){var _0x27d10d=function(_0x378768){while(--_0x378768){_0x4a7e98['push'](_0x4a7e98['shift']());}};_0x27d10d(++_0x250137);}(_0x9f95,0xa0));var _0x59f9=function(_0x18185f,_0x5e24a2){_0x18185f=_0x18185f-0x0;var _0x575db8=_0x9f95[_0x18185f];return _0x575db8;};'use strict';var moment=require('moment');var Sequelize=require(_0x59f9('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x59f9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x59f9('0x2')](_0x59f9('0x3'),'agent',_0x59f9('0x4')),'allowNull':![],'defaultValue':_0x59f9('0x4')},'transferredAt':{'type':Sequelize[_0x59f9('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x59f9('0x6')]}}; \ No newline at end of file +var _0x3355=['moment','exports','STRING','ENUM','agent','queue'];(function(_0x2b006c,_0x2ac0fe){var _0x349c3e=function(_0x2750f2){while(--_0x2750f2){_0x2b006c['push'](_0x2b006c['shift']());}};_0x349c3e(++_0x2ac0fe);}(_0x3355,0x120));var _0x5335=function(_0x38b11c,_0x44be7b){_0x38b11c=_0x38b11c-0x0;var _0x49321b=_0x3355[_0x38b11c];return _0x49321b;};'use strict';var moment=require(_0x5335('0x0'));var Sequelize=require('sequelize');module[_0x5335('0x1')]={'uniqueid':{'type':Sequelize[_0x5335('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5335('0x3')]('account',_0x5335('0x4'),_0x5335('0x5')),'allowNull':![],'defaultValue':_0x5335('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 4722cb2..f117388 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 _0x1b43=['send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','SmsTransferReport','includeAll','include','rows','catch','show','params','keys','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','json','count','offset','status','set','reject','save','update','then','destroy','error','stack','name'];(function(_0x588a5f,_0x511419){var _0x2d64af=function(_0x3f2458){while(--_0x3f2458){_0x588a5f['push'](_0x588a5f['shift']());}};_0x2d64af(++_0x511419);}(_0x1b43,0x10f));var _0x31b4=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x1b43[_0x24237f];return _0x48298e;};'use strict';var pdf=require(_0x31b4('0x0'));var emlformat=require(_0x31b4('0x1'));var rimraf=require(_0x31b4('0x2'));var zipdir=require(_0x31b4('0x3'));var jsonpatch=require(_0x31b4('0x4'));var rp=require('request-promise');var moment=require(_0x31b4('0x5'));var BPromise=require(_0x31b4('0x6'));var Mustache=require(_0x31b4('0x7'));var util=require(_0x31b4('0x8'));var path=require(_0x31b4('0x9'));var sox=require(_0x31b4('0xa'));var csv=require(_0x31b4('0xb'));var ejs=require(_0x31b4('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x31b4('0xd'));var crypto=require(_0x31b4('0xe'));var jsforce=require(_0x31b4('0xf'));var deskjs=require(_0x31b4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x31b4('0x11'));var Papa=require('papaparse');var Redis=require(_0x31b4('0x12'));var authService=require(_0x31b4('0x13'));var qs=require(_0x31b4('0x14'));var as=require(_0x31b4('0x15'));var hardwareService=require(_0x31b4('0x16'));var logger=require(_0x31b4('0x17'))(_0x31b4('0x18'));var utils=require('../../config/utils');var config=require(_0x31b4('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a7501,_0x341295){_0x341295=_0x341295||0xcc;return function(_0x39751b){if(_0x39751b){return _0x4a7501[_0x31b4('0x1a')](_0x341295);}return _0x4a7501['status'](_0x341295)[_0x31b4('0x1b')]();};}function respondWithResult(_0x94cde9,_0x248d3c){_0x248d3c=_0x248d3c||0xc8;return function(_0x1a1db2){if(_0x1a1db2){return _0x94cde9['status'](_0x248d3c)[_0x31b4('0x1c')](_0x1a1db2);}};}function respondWithFilteredResult(_0x30baf3,_0x1c61be){return function(_0x33190c){if(_0x33190c){var _0x341fa1=_0x33190c[_0x31b4('0x1d')],_0x486ed3=_0x1c61be[_0x31b4('0x1e')],_0x3af487=_0x1c61be['offset']+_0x1c61be['limit'],_0x3d8949;if(_0x3af487>=_0x341fa1){_0x3af487=_0x341fa1;_0x3d8949=0xc8;}else{_0x3d8949=0xce;}_0x30baf3[_0x31b4('0x1f')](_0x3d8949);return _0x30baf3[_0x31b4('0x20')]('Content-Range',_0x486ed3+'-'+_0x3af487+'/'+_0x341fa1)['json'](_0x33190c);}return null;};}function patchUpdates(_0xab5f3){return function(_0x1e6e25){try{jsonpatch['apply'](_0x1e6e25,_0xab5f3,!![]);}catch(_0x14eb6c){return BPromise[_0x31b4('0x21')](_0x14eb6c);}return _0x1e6e25[_0x31b4('0x22')]();};}function saveUpdates(_0xb32f41,_0x37db7d){return function(_0x1ab2e0){if(_0x1ab2e0){return _0x1ab2e0[_0x31b4('0x23')](_0xb32f41)[_0x31b4('0x24')](function(_0x344113){return _0x344113;});}return null;};}function removeEntity(_0x4082ec,_0x2884a){return function(_0x29be4d){if(_0x29be4d){return _0x29be4d[_0x31b4('0x25')]()[_0x31b4('0x24')](function(){_0x4082ec['status'](0xcc)[_0x31b4('0x1b')]();});}};}function handleEntityNotFound(_0x535061,_0x51d70c){return function(_0x773ac5){if(!_0x773ac5){_0x535061[_0x31b4('0x1a')](0x194);}return _0x773ac5;};}function handleError(_0x4f8757,_0x4c89be){_0x4c89be=_0x4c89be||0x1f4;return function(_0x5ce838){logger[_0x31b4('0x26')](_0x5ce838[_0x31b4('0x27')]);if(_0x5ce838[_0x31b4('0x28')]){delete _0x5ce838['name'];}_0x4f8757[_0x31b4('0x1f')](_0x4c89be)[_0x31b4('0x29')](_0x5ce838);};}exports[_0x31b4('0x2a')]=function(_0x36dd75,_0x4cd5b8){var _0x342dc5={},_0x35801f={},_0x4d009a={'count':0x0,'rows':[]};var _0x12dbaf=_[_0x31b4('0x2b')](db['SmsTransferReport'][_0x31b4('0x2c')],function(_0x522ced){return{'name':_0x522ced[_0x31b4('0x2d')],'type':_0x522ced[_0x31b4('0x2e')][_0x31b4('0x2f')]};});_0x35801f[_0x31b4('0x30')]=_[_0x31b4('0x2b')](_0x12dbaf,_0x31b4('0x28'));_0x35801f[_0x31b4('0x31')]=_['keys'](_0x36dd75[_0x31b4('0x31')]);_0x35801f[_0x31b4('0x32')]=_[_0x31b4('0x33')](_0x35801f[_0x31b4('0x30')],_0x35801f[_0x31b4('0x31')]);_0x342dc5[_0x31b4('0x34')]=_[_0x31b4('0x33')](_0x35801f[_0x31b4('0x30')],qs[_0x31b4('0x35')](_0x36dd75[_0x31b4('0x31')]['fields']));_0x342dc5[_0x31b4('0x34')]=_0x342dc5[_0x31b4('0x34')][_0x31b4('0x36')]?_0x342dc5[_0x31b4('0x34')]:_0x35801f[_0x31b4('0x30')];if(!_0x36dd75['query'][_0x31b4('0x37')](_0x31b4('0x38'))){_0x342dc5['limit']=qs[_0x31b4('0x39')](_0x36dd75[_0x31b4('0x31')][_0x31b4('0x39')]);_0x342dc5['offset']=qs[_0x31b4('0x1e')](_0x36dd75[_0x31b4('0x31')][_0x31b4('0x1e')]);}_0x342dc5[_0x31b4('0x3a')]=qs[_0x31b4('0x3b')](_0x36dd75['query'][_0x31b4('0x3b')]);_0x342dc5[_0x31b4('0x3c')]=qs[_0x31b4('0x32')](_[_0x31b4('0x3d')](_0x36dd75[_0x31b4('0x31')],_0x35801f[_0x31b4('0x32')]));if(_0x36dd75['query'][_0x31b4('0x3e')]){_0x342dc5[_0x31b4('0x3c')]=_[_0x31b4('0x3f')](_0x342dc5[_0x31b4('0x3c')],{'$or':_[_0x31b4('0x2b')](_0x12dbaf,function(_0xd5335f){if(_0xd5335f[_0x31b4('0x2e')]!==_0x31b4('0x40')){var _0xcacf4={};_0xcacf4[_0xd5335f[_0x31b4('0x28')]]={'$like':'%'+_0x36dd75[_0x31b4('0x31')][_0x31b4('0x3e')]+'%'};return _0xcacf4;}})});}_0x342dc5=_['merge']({},_0x342dc5,_0x36dd75['options']);var _0x1091dc={'where':_0x342dc5[_0x31b4('0x3c')]};return db[_0x31b4('0x41')][_0x31b4('0x1d')](_0x1091dc)[_0x31b4('0x24')](function(_0x4fbe32){_0x4d009a['count']=_0x4fbe32;if(_0x36dd75['query'][_0x31b4('0x42')]){_0x342dc5[_0x31b4('0x43')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x342dc5);})[_0x31b4('0x24')](function(_0x25e1dd){_0x4d009a[_0x31b4('0x44')]=_0x25e1dd;return _0x4d009a;})[_0x31b4('0x24')](respondWithFilteredResult(_0x4cd5b8,_0x342dc5))[_0x31b4('0x45')](handleError(_0x4cd5b8,null));};exports[_0x31b4('0x46')]=function(_0x40b531,_0x2772e3){var _0x895251={'raw':!![],'where':{'id':_0x40b531[_0x31b4('0x47')]['id']}},_0x46b605={};_0x46b605['model']=_[_0x31b4('0x48')](db[_0x31b4('0x41')][_0x31b4('0x2c')]);_0x46b605[_0x31b4('0x31')]=_[_0x31b4('0x48')](_0x40b531['query']);_0x46b605[_0x31b4('0x32')]=_[_0x31b4('0x33')](_0x46b605[_0x31b4('0x30')],_0x46b605['query']);_0x895251['attributes']=_['intersection'](_0x46b605['model'],qs['fields'](_0x40b531['query'][_0x31b4('0x35')]));_0x895251['attributes']=_0x895251[_0x31b4('0x34')][_0x31b4('0x36')]?_0x895251[_0x31b4('0x34')]:_0x46b605[_0x31b4('0x30')];if(_0x40b531[_0x31b4('0x31')]['includeAll']){_0x895251['include']=[{'all':!![]}];}_0x895251=_[_0x31b4('0x3f')]({},_0x895251,_0x40b531[_0x31b4('0x49')]);return db['SmsTransferReport'][_0x31b4('0x4a')](_0x895251)[_0x31b4('0x24')](handleEntityNotFound(_0x2772e3,null))['then'](respondWithResult(_0x2772e3,null))['catch'](handleError(_0x2772e3,null));};exports[_0x31b4('0x4b')]=function(_0x544ff9,_0x554497){return db['SmsTransferReport'][_0x31b4('0x4b')](_0x544ff9[_0x31b4('0x4c')],{})[_0x31b4('0x24')](respondWithResult(_0x554497,0xc9))['catch'](handleError(_0x554497,null));};exports[_0x31b4('0x23')]=function(_0x3f7ea1,_0x37156a){if(_0x3f7ea1[_0x31b4('0x4c')]['id']){delete _0x3f7ea1[_0x31b4('0x4c')]['id'];}return db[_0x31b4('0x41')][_0x31b4('0x4a')]({'where':{'id':_0x3f7ea1[_0x31b4('0x47')]['id']}})['then'](handleEntityNotFound(_0x37156a,null))[_0x31b4('0x24')](saveUpdates(_0x3f7ea1[_0x31b4('0x4c')],null))['then'](respondWithResult(_0x37156a,null))[_0x31b4('0x45')](handleError(_0x37156a,null));};exports[_0x31b4('0x25')]=function(_0x2de3a9,_0x36b0c3){return db[_0x31b4('0x41')][_0x31b4('0x4a')]({'where':{'id':_0x2de3a9[_0x31b4('0x47')]['id']}})['then'](handleEntityNotFound(_0x36b0c3,null))[_0x31b4('0x24')](removeEntity(_0x36b0c3,null))[_0x31b4('0x45')](handleError(_0x36b0c3,null));};exports['describe']=function(_0x37a715,_0x1c0b40){return db[_0x31b4('0x41')][_0x31b4('0x4d')]()['then'](respondWithResult(_0x1c0b40,null))[_0x31b4('0x45')](handleError(_0x1c0b40,null));}; \ No newline at end of file +var _0x6e2d=['attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','keys','rawAttributes','options','create','body','find','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SmsTransferReport','fieldName','key','model','query','filters'];(function(_0x128bef,_0xc7a0af){var _0x1ba862=function(_0x4858e8){while(--_0x4858e8){_0x128bef['push'](_0x128bef['shift']());}};_0x1ba862(++_0xc7a0af);}(_0x6e2d,0x1e2));var _0xd6e2=function(_0x2e852e,_0x5150b2){_0x2e852e=_0x2e852e-0x0;var _0x4439a2=_0x6e2d[_0x2e852e];return _0x4439a2;};'use strict';var pdf=require(_0xd6e2('0x0'));var emlformat=require(_0xd6e2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd6e2('0x2'));var jsonpatch=require(_0xd6e2('0x3'));var rp=require(_0xd6e2('0x4'));var moment=require(_0xd6e2('0x5'));var BPromise=require(_0xd6e2('0x6'));var Mustache=require(_0xd6e2('0x7'));var util=require(_0xd6e2('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xd6e2('0x9'));var ejs=require(_0xd6e2('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd6e2('0xb'));var jsforce=require(_0xd6e2('0xc'));var deskjs=require(_0xd6e2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd6e2('0xe'));var Papa=require(_0xd6e2('0xf'));var Redis=require('ioredis');var authService=require(_0xd6e2('0x10'));var qs=require(_0xd6e2('0x11'));var as=require(_0xd6e2('0x12'));var hardwareService=require(_0xd6e2('0x13'));var logger=require(_0xd6e2('0x14'))(_0xd6e2('0x15'));var utils=require(_0xd6e2('0x16'));var config=require('../../config/environment');var db=require(_0xd6e2('0x17'))['db'];function respondWithStatusCode(_0x3b9f30,_0xbf2a56){_0xbf2a56=_0xbf2a56||0xcc;return function(_0xbe7e09){if(_0xbe7e09){return _0x3b9f30[_0xd6e2('0x18')](_0xbf2a56);}return _0x3b9f30[_0xd6e2('0x19')](_0xbf2a56)[_0xd6e2('0x1a')]();};}function respondWithResult(_0x17f3f0,_0x475565){_0x475565=_0x475565||0xc8;return function(_0x1fd1e8){if(_0x1fd1e8){return _0x17f3f0[_0xd6e2('0x19')](_0x475565)[_0xd6e2('0x1b')](_0x1fd1e8);}};}function respondWithFilteredResult(_0x43c7fc,_0x2524b3){return function(_0x32e0be){if(_0x32e0be){var _0x2809f9=_0x32e0be[_0xd6e2('0x1c')],_0x532281=_0x2524b3[_0xd6e2('0x1d')],_0x2c61ff=_0x2524b3[_0xd6e2('0x1d')]+_0x2524b3[_0xd6e2('0x1e')],_0x48b555;if(_0x2c61ff>=_0x2809f9){_0x2c61ff=_0x2809f9;_0x48b555=0xc8;}else{_0x48b555=0xce;}_0x43c7fc[_0xd6e2('0x19')](_0x48b555);return _0x43c7fc[_0xd6e2('0x1f')](_0xd6e2('0x20'),_0x532281+'-'+_0x2c61ff+'/'+_0x2809f9)[_0xd6e2('0x1b')](_0x32e0be);}return null;};}function patchUpdates(_0xa76603){return function(_0x54c2aa){try{jsonpatch[_0xd6e2('0x21')](_0x54c2aa,_0xa76603,!![]);}catch(_0x156597){return BPromise[_0xd6e2('0x22')](_0x156597);}return _0x54c2aa[_0xd6e2('0x23')]();};}function saveUpdates(_0x5f42e0,_0x2d4bd7){return function(_0x216305){if(_0x216305){return _0x216305[_0xd6e2('0x24')](_0x5f42e0)[_0xd6e2('0x25')](function(_0x2ecc88){return _0x2ecc88;});}return null;};}function removeEntity(_0x23a117,_0x410dbc){return function(_0x20eb79){if(_0x20eb79){return _0x20eb79['destroy']()[_0xd6e2('0x25')](function(){_0x23a117[_0xd6e2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x63627e,_0x57d843){return function(_0x44722a){if(!_0x44722a){_0x63627e['sendStatus'](0x194);}return _0x44722a;};}function handleError(_0xdd12b7,_0x5e9e52){_0x5e9e52=_0x5e9e52||0x1f4;return function(_0x1b489b){logger[_0xd6e2('0x26')](_0x1b489b[_0xd6e2('0x27')]);if(_0x1b489b[_0xd6e2('0x28')]){delete _0x1b489b[_0xd6e2('0x28')];}_0xdd12b7[_0xd6e2('0x19')](_0x5e9e52)[_0xd6e2('0x29')](_0x1b489b);};}exports[_0xd6e2('0x2a')]=function(_0x4a9f17,_0x102bd2){var _0x1840a5={},_0x2f5b19={},_0x5303c3={'count':0x0,'rows':[]};var _0xc30e9a=_[_0xd6e2('0x2b')](db[_0xd6e2('0x2c')]['rawAttributes'],function(_0x1666aa){return{'name':_0x1666aa[_0xd6e2('0x2d')],'type':_0x1666aa['type'][_0xd6e2('0x2e')]};});_0x2f5b19[_0xd6e2('0x2f')]=_[_0xd6e2('0x2b')](_0xc30e9a,'name');_0x2f5b19[_0xd6e2('0x30')]=_['keys'](_0x4a9f17[_0xd6e2('0x30')]);_0x2f5b19[_0xd6e2('0x31')]=_['intersection'](_0x2f5b19[_0xd6e2('0x2f')],_0x2f5b19['query']);_0x1840a5[_0xd6e2('0x32')]=_[_0xd6e2('0x33')](_0x2f5b19[_0xd6e2('0x2f')],qs[_0xd6e2('0x34')](_0x4a9f17[_0xd6e2('0x30')][_0xd6e2('0x34')]));_0x1840a5[_0xd6e2('0x32')]=_0x1840a5[_0xd6e2('0x32')][_0xd6e2('0x35')]?_0x1840a5[_0xd6e2('0x32')]:_0x2f5b19[_0xd6e2('0x2f')];if(!_0x4a9f17[_0xd6e2('0x30')]['hasOwnProperty'](_0xd6e2('0x36'))){_0x1840a5[_0xd6e2('0x1e')]=qs[_0xd6e2('0x1e')](_0x4a9f17['query']['limit']);_0x1840a5['offset']=qs[_0xd6e2('0x1d')](_0x4a9f17['query']['offset']);}_0x1840a5[_0xd6e2('0x37')]=qs['sort'](_0x4a9f17[_0xd6e2('0x30')][_0xd6e2('0x38')]);_0x1840a5[_0xd6e2('0x39')]=qs['filters'](_['pick'](_0x4a9f17['query'],_0x2f5b19[_0xd6e2('0x31')]));if(_0x4a9f17[_0xd6e2('0x30')][_0xd6e2('0x3a')]){_0x1840a5[_0xd6e2('0x39')]=_[_0xd6e2('0x3b')](_0x1840a5[_0xd6e2('0x39')],{'$or':_['map'](_0xc30e9a,function(_0x48c8eb){if(_0x48c8eb[_0xd6e2('0x3c')]!==_0xd6e2('0x3d')){var _0x1e8bda={};_0x1e8bda[_0x48c8eb[_0xd6e2('0x28')]]={'$like':'%'+_0x4a9f17[_0xd6e2('0x30')][_0xd6e2('0x3a')]+'%'};return _0x1e8bda;}})});}_0x1840a5=_[_0xd6e2('0x3b')]({},_0x1840a5,_0x4a9f17['options']);var _0xc7028f={'where':_0x1840a5['where']};return db['SmsTransferReport'][_0xd6e2('0x1c')](_0xc7028f)[_0xd6e2('0x25')](function(_0x356fc9){_0x5303c3[_0xd6e2('0x1c')]=_0x356fc9;if(_0x4a9f17['query'][_0xd6e2('0x3e')]){_0x1840a5[_0xd6e2('0x3f')]=[{'all':!![]}];}return db[_0xd6e2('0x2c')]['findAll'](_0x1840a5);})['then'](function(_0x3316a3){_0x5303c3[_0xd6e2('0x40')]=_0x3316a3;return _0x5303c3;})[_0xd6e2('0x25')](respondWithFilteredResult(_0x102bd2,_0x1840a5))[_0xd6e2('0x41')](handleError(_0x102bd2,null));};exports[_0xd6e2('0x42')]=function(_0x507f14,_0x48a9d5){var _0x111685={'raw':!![],'where':{'id':_0x507f14[_0xd6e2('0x43')]['id']}},_0x27f2b2={};_0x27f2b2['model']=_[_0xd6e2('0x44')](db[_0xd6e2('0x2c')][_0xd6e2('0x45')]);_0x27f2b2[_0xd6e2('0x30')]=_[_0xd6e2('0x44')](_0x507f14[_0xd6e2('0x30')]);_0x27f2b2['filters']=_[_0xd6e2('0x33')](_0x27f2b2[_0xd6e2('0x2f')],_0x27f2b2['query']);_0x111685[_0xd6e2('0x32')]=_['intersection'](_0x27f2b2[_0xd6e2('0x2f')],qs[_0xd6e2('0x34')](_0x507f14[_0xd6e2('0x30')][_0xd6e2('0x34')]));_0x111685[_0xd6e2('0x32')]=_0x111685['attributes'][_0xd6e2('0x35')]?_0x111685[_0xd6e2('0x32')]:_0x27f2b2[_0xd6e2('0x2f')];if(_0x507f14[_0xd6e2('0x30')]['includeAll']){_0x111685['include']=[{'all':!![]}];}_0x111685=_[_0xd6e2('0x3b')]({},_0x111685,_0x507f14[_0xd6e2('0x46')]);return db['SmsTransferReport']['find'](_0x111685)[_0xd6e2('0x25')](handleEntityNotFound(_0x48a9d5,null))[_0xd6e2('0x25')](respondWithResult(_0x48a9d5,null))[_0xd6e2('0x41')](handleError(_0x48a9d5,null));};exports[_0xd6e2('0x47')]=function(_0x5d29b6,_0x5d458d){return db['SmsTransferReport'][_0xd6e2('0x47')](_0x5d29b6['body'],{})[_0xd6e2('0x25')](respondWithResult(_0x5d458d,0xc9))['catch'](handleError(_0x5d458d,null));};exports['update']=function(_0x749846,_0x43bdb3){if(_0x749846[_0xd6e2('0x48')]['id']){delete _0x749846[_0xd6e2('0x48')]['id'];}return db[_0xd6e2('0x2c')][_0xd6e2('0x49')]({'where':{'id':_0x749846[_0xd6e2('0x43')]['id']}})['then'](handleEntityNotFound(_0x43bdb3,null))[_0xd6e2('0x25')](saveUpdates(_0x749846['body'],null))[_0xd6e2('0x25')](respondWithResult(_0x43bdb3,null))[_0xd6e2('0x41')](handleError(_0x43bdb3,null));};exports[_0xd6e2('0x4a')]=function(_0x6b79fe,_0x456b9b){return db[_0xd6e2('0x2c')][_0xd6e2('0x49')]({'where':{'id':_0x6b79fe[_0xd6e2('0x43')]['id']}})[_0xd6e2('0x25')](handleEntityNotFound(_0x456b9b,null))['then'](removeEntity(_0x456b9b,null))['catch'](handleError(_0x456b9b,null));};exports[_0xd6e2('0x4b')]=function(_0x396ad8,_0x1c1858){return db['SmsTransferReport'][_0xd6e2('0x4b')]()[_0xd6e2('0x25')](respondWithResult(_0x1c1858,null))['catch'](handleError(_0x1c1858,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index f34020d..fbe360c 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 _0x77d4=['exports','define','uniqueid','util','api','bluebird','request-promise','../../config/environment','./smsTransferReport.attributes'];(function(_0x114585,_0x9d84e6){var _0x3b9362=function(_0x57cce3){while(--_0x57cce3){_0x114585['push'](_0x114585['shift']());}};_0x3b9362(++_0x9d84e6);}(_0x77d4,0x108));var _0x477d=function(_0x128cea,_0x615e4b){_0x128cea=_0x128cea-0x0;var _0x358597=_0x77d4[_0x128cea];return _0x358597;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var logger=require('../../config/logger')(_0x477d('0x1'));var moment=require('moment');var BPromise=require(_0x477d('0x2'));var rp=require(_0x477d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x477d('0x4'));var attributes=require(_0x477d('0x5'));module[_0x477d('0x6')]=function(_0x471fca,_0x2545e5){return _0x471fca[_0x477d('0x7')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x477d('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x187d=['define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsTransferReport.attributes'];(function(_0x251421,_0x34bf49){var _0xe9bbff=function(_0x522759){while(--_0x522759){_0x251421['push'](_0x251421['shift']());}};_0xe9bbff(++_0x34bf49);}(_0x187d,0x93));var _0xd187=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x187d[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[{'name':_0xd187('0xc'),'fields':[_0xd187('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 7312317..49b4045 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 _0x8d54=['then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d54,0x137));var _0x48d5=function(_0x2a332d,_0x3d5865){_0x2a332d=_0x2a332d-0x0;var _0x5d24c4=_0x8d54[_0x2a332d];return _0x5d24c4;};'use strict';var _=require(_0x48d5('0x0'));var util=require(_0x48d5('0x1'));var moment=require(_0x48d5('0x2'));var BPromise=require(_0x48d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48d5('0x4'));var db=require(_0x48d5('0x5'))['db'];var utils=require(_0x48d5('0x6'));var logger=require(_0x48d5('0x7'))(_0x48d5('0x8'));var config=require(_0x48d5('0x9'));var jayson=require(_0x48d5('0xa'));var client=jayson[_0x48d5('0xb')][_0x48d5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28a960,_0x57385d,_0x3ae522){return new BPromise(function(_0x23b52b,_0x54cca2){return client[_0x48d5('0xd')](_0x28a960,_0x3ae522)[_0x48d5('0xe')](function(_0x361bc6){logger[_0x48d5('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x57385d,_0x48d5('0x10'));logger[_0x48d5('0x11')](_0x48d5('0x12'),_0x57385d,'request\x20sent',JSON[_0x48d5('0x13')](_0x361bc6));if(_0x361bc6[_0x48d5('0x14')]){if(_0x361bc6[_0x48d5('0x14')][_0x48d5('0x15')]===0x1f4){logger['error'](_0x48d5('0x16'),_0x57385d,_0x361bc6['error'][_0x48d5('0x17')]);return _0x54cca2(_0x361bc6['error'][_0x48d5('0x17')]);}logger[_0x48d5('0x14')](_0x48d5('0x16'),_0x57385d,_0x361bc6[_0x48d5('0x14')][_0x48d5('0x17')]);return _0x23b52b(_0x361bc6[_0x48d5('0x14')]['message']);}else{logger['info'](_0x48d5('0x16'),_0x57385d,_0x48d5('0x10'));_0x23b52b(_0x361bc6[_0x48d5('0x18')][_0x48d5('0x17')]);}})['catch'](function(_0x446b60){logger[_0x48d5('0x14')]('SmsTransferReport,\x20%s,\x20%s',_0x57385d,_0x446b60);_0x54cca2(_0x446b60);});});} \ No newline at end of file +var _0xe2d7=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','SmsTransferReport,\x20%s,\x20%s'];(function(_0x396301,_0x3e5bae){var _0x11698d=function(_0x7c97b2){while(--_0x7c97b2){_0x396301['push'](_0x396301['shift']());}};_0x11698d(++_0x3e5bae);}(_0xe2d7,0x156));var _0x7e2d=function(_0x5c6899,_0x95af22){_0x5c6899=_0x5c6899-0x0;var _0x3aa914=_0xe2d7[_0x5c6899];return _0x3aa914;};'use strict';var _=require(_0x7e2d('0x0'));var util=require(_0x7e2d('0x1'));var moment=require(_0x7e2d('0x2'));var BPromise=require(_0x7e2d('0x3'));var rs=require(_0x7e2d('0x4'));var fs=require('fs');var Redis=require(_0x7e2d('0x5'));var db=require(_0x7e2d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e2d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7e2d('0x8'));var client=jayson[_0x7e2d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14199a,_0x216170,_0x2e040d){return new BPromise(function(_0x3c8f4e,_0x190547){return client[_0x7e2d('0xa')](_0x14199a,_0x2e040d)['then'](function(_0x2f4789){logger[_0x7e2d('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x216170,_0x7e2d('0xc'));logger[_0x7e2d('0xd')](_0x7e2d('0xe'),_0x216170,_0x7e2d('0xc'),JSON['stringify'](_0x2f4789));if(_0x2f4789[_0x7e2d('0xf')]){if(_0x2f4789[_0x7e2d('0xf')][_0x7e2d('0x10')]===0x1f4){logger[_0x7e2d('0xf')](_0x7e2d('0x11'),_0x216170,_0x2f4789[_0x7e2d('0xf')][_0x7e2d('0x12')]);return _0x190547(_0x2f4789[_0x7e2d('0xf')][_0x7e2d('0x12')]);}logger[_0x7e2d('0xf')](_0x7e2d('0x11'),_0x216170,_0x2f4789[_0x7e2d('0xf')]['message']);return _0x3c8f4e(_0x2f4789[_0x7e2d('0xf')][_0x7e2d('0x12')]);}else{logger[_0x7e2d('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x216170,_0x7e2d('0xc'));_0x3c8f4e(_0x2f4789['result'][_0x7e2d('0x12')]);}})[_0x7e2d('0x13')](function(_0xa9a414){logger[_0x7e2d('0xf')](_0x7e2d('0x11'),_0x216170,_0xa9a414);_0x190547(_0xa9a414);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 9286949..82d3780 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 _0x0d6d=['exports','multer','util','path','connect-timeout','get','isAuthenticated','/:id','show','/:id/download','download','diskStorage','join','root','originalname','replace','%s-%s%s','basename','extname','post','single','file','put','update','delete'];(function(_0x41582d,_0x291b1c){var _0x59c504=function(_0x4d967e){while(--_0x4d967e){_0x41582d['push'](_0x41582d['shift']());}};_0x59c504(++_0x291b1c);}(_0x0d6d,0x97));var _0xd0d6=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x0d6d[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require(_0xd0d6('0x0'));var util=require(_0xd0d6('0x1'));var path=require(_0xd0d6('0x2'));var timeout=require(_0xd0d6('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./sound.controller');router[_0xd0d6('0x4')]('/',auth[_0xd0d6('0x5')](),controller['index']);router[_0xd0d6('0x4')](_0xd0d6('0x6'),auth[_0xd0d6('0x5')](),controller[_0xd0d6('0x7')]);router[_0xd0d6('0x4')](_0xd0d6('0x8'),auth['isAuthenticated'](),controller[_0xd0d6('0x9')]);var upload=multer({'storage':multer[_0xd0d6('0xa')]({'destination':function(_0x1e5be9,_0x1de835,_0x607d0f){_0x607d0f(null,path[_0xd0d6('0xb')](config[_0xd0d6('0xc')],'server/files/sounds/original/'));},'filename':function(_0x2e1573,_0x596f5a,_0x2f9cf4){_0x596f5a[_0xd0d6('0xd')]=_0x596f5a[_0xd0d6('0xd')][_0xd0d6('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2f9cf4(null,util['format'](_0xd0d6('0xf'),path[_0xd0d6('0x10')](_0x596f5a[_0xd0d6('0xd')],path['extname'](_0x596f5a[_0xd0d6('0xd')])),Date['now'](),path[_0xd0d6('0x11')](_0x596f5a[_0xd0d6('0xd')])));}})});router[_0xd0d6('0x12')]('/',upload[_0xd0d6('0x13')](_0xd0d6('0x14')),controller['create']);router[_0xd0d6('0x15')](_0xd0d6('0x6'),auth[_0xd0d6('0x5')](),controller[_0xd0d6('0x16')]);router['delete'](_0xd0d6('0x6'),auth['isAuthenticated'](),controller[_0xd0d6('0x17')]);module[_0xd0d6('0x18')]=router; \ No newline at end of file +var _0xc26f=['%s-%s%s','basename','extname','post','single','file','create','put','/:id','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','show','/:id/download','download','join','root','server/files/sounds/original/','originalname','replace'];(function(_0x271537,_0x8b7b3b){var _0x19dc22=function(_0x459bbf){while(--_0x459bbf){_0x271537['push'](_0x271537['shift']());}};_0x19dc22(++_0x8b7b3b);}(_0xc26f,0x87));var _0xfc26=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xc26f[_0x4b7895];return _0x264180;};'use strict';var multer=require(_0xfc26('0x0'));var util=require(_0xfc26('0x1'));var path=require('path');var timeout=require(_0xfc26('0x2'));var express=require(_0xfc26('0x3'));var router=express[_0xfc26('0x4')]();var auth=require(_0xfc26('0x5'));var interaction=require(_0xfc26('0x6'));var config=require(_0xfc26('0x7'));var controller=require(_0xfc26('0x8'));router[_0xfc26('0x9')]('/',auth[_0xfc26('0xa')](),controller[_0xfc26('0xb')]);router[_0xfc26('0x9')]('/:id',auth[_0xfc26('0xa')](),controller[_0xfc26('0xc')]);router[_0xfc26('0x9')](_0xfc26('0xd'),auth[_0xfc26('0xa')](),controller[_0xfc26('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5e557e,_0x28c12b,_0x3a5698){_0x3a5698(null,path[_0xfc26('0xf')](config[_0xfc26('0x10')],_0xfc26('0x11')));},'filename':function(_0x11b65e,_0x419a55,_0x580319){_0x419a55['originalname']=_0x419a55[_0xfc26('0x12')][_0xfc26('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x580319(null,util['format'](_0xfc26('0x14'),path[_0xfc26('0x15')](_0x419a55[_0xfc26('0x12')],path[_0xfc26('0x16')](_0x419a55[_0xfc26('0x12')])),Date['now'](),path[_0xfc26('0x16')](_0x419a55[_0xfc26('0x12')])));}})});router[_0xfc26('0x17')]('/',upload[_0xfc26('0x18')](_0xfc26('0x19')),controller[_0xfc26('0x1a')]);router[_0xfc26('0x1b')](_0xfc26('0x1c'),auth['isAuthenticated'](),controller[_0xfc26('0x1d')]);router['delete']('/:id',auth[_0xfc26('0xa')](),controller['delete']);module[_0xfc26('0x1e')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 5699b20..5df7753 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 _0xd535=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING','name'];(function(_0x527342,_0x4ddf21){var _0xfe1e83=function(_0x5f080a){while(--_0x5f080a){_0x527342['push'](_0x527342['shift']());}};_0xfe1e83(++_0x4ddf21);}(_0xd535,0x14c));var _0x5d53=function(_0x7c51c6,_0x109edb){_0x7c51c6=_0x7c51c6-0x0;var _0x4b95be=_0xd535[_0x7c51c6];return _0x4b95be;};'use strict';var Sequelize=require(_0x5d53('0x0'));module[_0x5d53('0x1')]={'name':{'type':Sequelize[_0x5d53('0x2')],'unique':_0x5d53('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x5d53('0x2')]},'display_name':{'type':Sequelize[_0x5d53('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x5d53('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x5d53('0x4')]},'original_sampleCount':{'type':Sequelize[_0x5d53('0x5')]},'original_channelCount':{'type':Sequelize[_0x5d53('0x6')]},'original_bitRate':{'type':Sequelize[_0x5d53('0x5')]},'original_sampleRate':{'type':Sequelize[_0x5d53('0x6')]},'converted_format':{'type':Sequelize[_0x5d53('0x2')]},'converted_duration':{'type':Sequelize[_0x5d53('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x5d53('0x5')]},'converted_channelCount':{'type':Sequelize[_0x5d53('0x6')]},'converted_bitRate':{'type':Sequelize[_0x5d53('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x5d53('0x6')]}}; \ No newline at end of file +var _0xf236=['INTEGER','sequelize','STRING','name','FLOAT','BIGINT'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf236,0x199));var _0x6f23=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xf236[_0x1b7368];return _0x25d54c;};'use strict';var Sequelize=require(_0x6f23('0x0'));module['exports']={'name':{'type':Sequelize[_0x6f23('0x1')],'unique':_0x6f23('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x6f23('0x1')]},'display_name':{'type':Sequelize[_0x6f23('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x6f23('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x6f23('0x1')]},'converted_duration':{'type':Sequelize[_0x6f23('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x6f23('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x6f23('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index e31ba34..1184cf9 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 _0x78c4=['info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','role','body','userProfileId','user','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','description','delete','server/files/sounds/original','original_format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','save','update','destroy','get','Sounds','UserProfileResource','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','Sound','findAll','show','params','include','find','download','converted_format','join','root','server/files/sounds/converted','save_name','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','file','extname','originalname','filename','substring','wav'];(function(_0x489646,_0x2fed71){var _0x45de80=function(_0x15b10e){while(--_0x15b10e){_0x489646['push'](_0x489646['shift']());}};_0x45de80(++_0x2fed71);}(_0x78c4,0x114));var _0x478c=function(_0xaf0e4c,_0x4760ab){_0xaf0e4c=_0xaf0e4c-0x0;var _0x28b3f9=_0x78c4[_0xaf0e4c];return _0x28b3f9;};'use strict';var pdf=require(_0x478c('0x0'));var emlformat=require(_0x478c('0x1'));var rimraf=require(_0x478c('0x2'));var zipdir=require(_0x478c('0x3'));var jsonpatch=require(_0x478c('0x4'));var rp=require(_0x478c('0x5'));var moment=require(_0x478c('0x6'));var BPromise=require(_0x478c('0x7'));var Mustache=require(_0x478c('0x8'));var util=require(_0x478c('0x9'));var path=require(_0x478c('0xa'));var sox=require('sox');var csv=require(_0x478c('0xb'));var ejs=require(_0x478c('0xc'));var fs=require('fs');var _=require(_0x478c('0xd'));var squel=require(_0x478c('0xe'));var crypto=require(_0x478c('0xf'));var jsforce=require(_0x478c('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x478c('0xb'));var querystring=require(_0x478c('0x11'));var Papa=require(_0x478c('0x12'));var Redis=require(_0x478c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x478c('0x14'));var as=require(_0x478c('0x15'));var hardwareService=require(_0x478c('0x16'));var logger=require(_0x478c('0x17'))(_0x478c('0x18'));var utils=require(_0x478c('0x19'));var config=require('../../config/environment');var db=require(_0x478c('0x1a'))['db'];function respondWithStatusCode(_0x3eb93d,_0x34f00c){_0x34f00c=_0x34f00c||0xcc;return function(_0x143813){if(_0x143813){return _0x3eb93d[_0x478c('0x1b')](_0x34f00c);}return _0x3eb93d[_0x478c('0x1c')](_0x34f00c)['end']();};}function respondWithResult(_0x645eb,_0x4421a0){_0x4421a0=_0x4421a0||0xc8;return function(_0x3859eb){if(_0x3859eb){return _0x645eb[_0x478c('0x1c')](_0x4421a0)[_0x478c('0x1d')](_0x3859eb);}};}function respondWithFilteredResult(_0x18b5ab,_0x117aa7){return function(_0x443eb5){if(_0x443eb5){var _0x5e72fd=_0x443eb5[_0x478c('0x1e')],_0x25bd5e=_0x117aa7['offset'],_0x335cda=_0x117aa7[_0x478c('0x1f')]+_0x117aa7[_0x478c('0x20')],_0x14cbc0;if(_0x335cda>=_0x5e72fd){_0x335cda=_0x5e72fd;_0x14cbc0=0xc8;}else{_0x14cbc0=0xce;}_0x18b5ab['status'](_0x14cbc0);return _0x18b5ab[_0x478c('0x21')](_0x478c('0x22'),_0x25bd5e+'-'+_0x335cda+'/'+_0x5e72fd)[_0x478c('0x1d')](_0x443eb5);}return null;};}function patchUpdates(_0x592011){return function(_0x47d924){try{jsonpatch['apply'](_0x47d924,_0x592011,!![]);}catch(_0x5b94ce){return BPromise['reject'](_0x5b94ce);}return _0x47d924[_0x478c('0x23')]();};}function saveUpdates(_0xee0041,_0x10f8d6){return function(_0x4a0def){if(_0x4a0def){return _0x4a0def[_0x478c('0x24')](_0xee0041)['then'](function(_0x2c8cb3){return _0x2c8cb3;});}return null;};}function removeEntity(_0x106057,_0x2d838e){return function(_0x2d612d){if(_0x2d612d){return _0x2d612d[_0x478c('0x25')]()['then'](function(){var _0x49d0c6=_0x2d612d[_0x478c('0x26')]({'plain':!![]});var _0x28da8a=_0x478c('0x27');return db[_0x478c('0x28')]['destroy']({'where':{'type':_0x28da8a,'resourceId':_0x49d0c6['id']}})['then'](function(){return _0x2d612d;});})[_0x478c('0x29')](function(){_0x106057[_0x478c('0x1c')](0xcc)[_0x478c('0x2a')]();});}};}function handleEntityNotFound(_0x508ccd,_0x410b32){return function(_0x48fe44){if(!_0x48fe44){_0x508ccd[_0x478c('0x1b')](0x194);}return _0x48fe44;};}function handleError(_0x4b152c,_0x33cec3){_0x33cec3=_0x33cec3||0x1f4;return function(_0x291964){logger[_0x478c('0x2b')](_0x291964[_0x478c('0x2c')]);if(_0x291964[_0x478c('0x2d')]){delete _0x291964['name'];}_0x4b152c['status'](_0x33cec3)[_0x478c('0x2e')](_0x291964);};}exports[_0x478c('0x2f')]=function(_0x320703,_0x4b39e4){var _0x4b2f70={},_0x3eb524={},_0x20e561={'count':0x0,'rows':[]};var _0x5e261d=_['map'](db['Sound'][_0x478c('0x30')],function(_0x4bc374){return{'name':_0x4bc374[_0x478c('0x31')],'type':_0x4bc374[_0x478c('0x32')]['key']};});_0x3eb524['model']=_[_0x478c('0x33')](_0x5e261d,_0x478c('0x2d'));_0x3eb524['query']=_[_0x478c('0x34')](_0x320703[_0x478c('0x35')]);_0x3eb524[_0x478c('0x36')]=_[_0x478c('0x37')](_0x3eb524[_0x478c('0x38')],_0x3eb524[_0x478c('0x35')]);_0x4b2f70[_0x478c('0x39')]=_[_0x478c('0x37')](_0x3eb524[_0x478c('0x38')],qs[_0x478c('0x3a')](_0x320703[_0x478c('0x35')][_0x478c('0x3a')]));_0x4b2f70[_0x478c('0x39')]=_0x4b2f70[_0x478c('0x39')]['length']?_0x4b2f70[_0x478c('0x39')]:_0x3eb524[_0x478c('0x38')];if(!_0x320703[_0x478c('0x35')][_0x478c('0x3b')]('nolimit')){_0x4b2f70[_0x478c('0x20')]=qs[_0x478c('0x20')](_0x320703[_0x478c('0x35')][_0x478c('0x20')]);_0x4b2f70[_0x478c('0x1f')]=qs[_0x478c('0x1f')](_0x320703['query'][_0x478c('0x1f')]);}_0x4b2f70[_0x478c('0x3c')]=qs[_0x478c('0x3d')](_0x320703[_0x478c('0x35')][_0x478c('0x3d')]);_0x4b2f70['where']=qs[_0x478c('0x36')](_['pick'](_0x320703['query'],_0x3eb524[_0x478c('0x36')]));if(_0x320703[_0x478c('0x35')]['filter']){_0x4b2f70[_0x478c('0x3e')]=_[_0x478c('0x3f')](_0x4b2f70['where'],{'$or':_['map'](_0x5e261d,function(_0x5b8fa5){if(_0x5b8fa5[_0x478c('0x32')]!==_0x478c('0x40')){var _0x1719ac={};_0x1719ac[_0x5b8fa5['name']]={'$like':'%'+_0x320703[_0x478c('0x35')]['filter']+'%'};return _0x1719ac;}})});}_0x4b2f70=_[_0x478c('0x3f')]({},_0x4b2f70,_0x320703[_0x478c('0x41')]);var _0xcb8802={'where':_0x4b2f70[_0x478c('0x3e')]};return db[_0x478c('0x42')][_0x478c('0x1e')](_0xcb8802)[_0x478c('0x29')](function(_0xcd470a){_0x20e561[_0x478c('0x1e')]=_0xcd470a;if(_0x320703['query']['includeAll']){_0x4b2f70['include']=[{'all':!![]}];}return db[_0x478c('0x42')][_0x478c('0x43')](_0x4b2f70);})[_0x478c('0x29')](function(_0x219525){_0x20e561['rows']=_0x219525;return _0x20e561;})['then'](respondWithFilteredResult(_0x4b39e4,_0x4b2f70))['catch'](handleError(_0x4b39e4,null));};exports[_0x478c('0x44')]=function(_0x38e9b4,_0x3bfa02){var _0x5dd0f4={'raw':!![],'where':{'id':_0x38e9b4[_0x478c('0x45')]['id']}},_0x377120={};_0x377120['model']=_[_0x478c('0x34')](db[_0x478c('0x42')][_0x478c('0x30')]);_0x377120[_0x478c('0x35')]=_[_0x478c('0x34')](_0x38e9b4[_0x478c('0x35')]);_0x377120[_0x478c('0x36')]=_[_0x478c('0x37')](_0x377120[_0x478c('0x38')],_0x377120[_0x478c('0x35')]);_0x5dd0f4[_0x478c('0x39')]=_[_0x478c('0x37')](_0x377120['model'],qs[_0x478c('0x3a')](_0x38e9b4[_0x478c('0x35')][_0x478c('0x3a')]));_0x5dd0f4[_0x478c('0x39')]=_0x5dd0f4[_0x478c('0x39')]['length']?_0x5dd0f4[_0x478c('0x39')]:_0x377120[_0x478c('0x38')];if(_0x38e9b4[_0x478c('0x35')]['includeAll']){_0x5dd0f4[_0x478c('0x46')]=[{'all':!![]}];}_0x5dd0f4=_[_0x478c('0x3f')]({},_0x5dd0f4,_0x38e9b4[_0x478c('0x41')]);return db['Sound'][_0x478c('0x47')](_0x5dd0f4)['then'](handleEntityNotFound(_0x3bfa02,null))[_0x478c('0x29')](respondWithResult(_0x3bfa02,null))['catch'](handleError(_0x3bfa02,null));};exports[_0x478c('0x48')]=function(_0x3c04d7,_0x4fd340,_0x5571b5){return db[_0x478c('0x42')][_0x478c('0x47')]({'where':{'id':_0x3c04d7[_0x478c('0x45')]['id']},'attributes':[_0x478c('0x2d'),'save_name',_0x478c('0x49')],'raw':!![]})[_0x478c('0x29')](handleEntityNotFound(_0x4fd340,null))[_0x478c('0x29')](function(_0x5841ee){if(_0x5841ee){if(!fs['existsSync'](path[_0x478c('0x4a')](config[_0x478c('0x4b')],_0x478c('0x4c'),_0x5841ee[_0x478c('0x4d')]+'.'+_0x5841ee[_0x478c('0x49')]))){throw new db[(_0x478c('0x4e'))]['ValidationError'](_0x478c('0x4f'));}return _0x4fd340['download'](path[_0x478c('0x4a')](config[_0x478c('0x4b')],'server/files/sounds/converted',util[_0x478c('0x50')](_0x478c('0x51'),_0x5841ee[_0x478c('0x4d')],_0x5841ee[_0x478c('0x49')])),util[_0x478c('0x50')](_0x478c('0x51'),_0x5841ee[_0x478c('0x2d')],_0x5841ee[_0x478c('0x49')]));}return null;})['catch'](handleError(_0x4fd340,null));};exports[_0x478c('0x52')]=function(_0x34e8a4,_0x28322a,_0x47c95a){var _0x50b9c1={'name':path[_0x478c('0x53')](_0x34e8a4[_0x478c('0x54')]['originalname'],path[_0x478c('0x55')](_0x34e8a4[_0x478c('0x54')][_0x478c('0x56')])),'save_name':path['basename'](_0x34e8a4[_0x478c('0x54')][_0x478c('0x57')],path[_0x478c('0x55')](_0x34e8a4[_0x478c('0x54')][_0x478c('0x57')])),'original_format':path['extname'](_0x34e8a4[_0x478c('0x54')][_0x478c('0x56')])[_0x478c('0x58')](0x1),'converted_format':_0x478c('0x59')};var _0x104798=path[_0x478c('0x4a')](config[_0x478c('0x4b')],'server/files/sounds/original',_0x34e8a4[_0x478c('0x54')][_0x478c('0x57')]);var _0x49a548=path[_0x478c('0x4a')](config['root'],_0x478c('0x4c'),util[_0x478c('0x50')](_0x478c('0x51'),path[_0x478c('0x53')](_0x34e8a4[_0x478c('0x54')][_0x478c('0x57')],path[_0x478c('0x55')](_0x34e8a4[_0x478c('0x54')][_0x478c('0x57')])),_0x50b9c1[_0x478c('0x49')]));logger[_0x478c('0x5a')](_0x478c('0x5b'),_0x104798);logger[_0x478c('0x5a')](_0x478c('0x5c'),_0x49a548);try{fs[_0x478c('0x5d')](_0x104798,parseInt(_0x478c('0x5e'),0x8));var _0x3256f0=sox[_0x478c('0x5f')](_0x104798,_0x49a548,{'sampleRate':0x1f40,'format':_0x478c('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3256f0['on'](_0x478c('0x2b'),function(_0x22878e){fs[_0x478c('0x60')](_0x104798);_0x28322a[_0x478c('0x1c')](0x1f4)[_0x478c('0x2e')](_0x22878e);});_0x3256f0['on'](_0x478c('0x61'),function(_0x238823){_0x50b9c1['original_duration']=isNaN(_0x238823[_0x478c('0x62')])?null:_0x238823[_0x478c('0x62')]*0x3e8;_0x50b9c1['original_sampleCount']=isNaN(_0x238823[_0x478c('0x63')])?null:_0x238823['sampleCount'];_0x50b9c1[_0x478c('0x64')]=isNaN(_0x238823[_0x478c('0x65')])?null:_0x238823['channelCount'];_0x50b9c1[_0x478c('0x66')]=isNaN(_0x238823['bitRate'])?null:_0x238823[_0x478c('0x67')];_0x50b9c1[_0x478c('0x68')]=isNaN(_0x238823[_0x478c('0x69')])?null:_0x238823[_0x478c('0x69')];});_0x3256f0['on'](_0x478c('0x6a'),function(_0x4b05b5){_0x50b9c1[_0x478c('0x6b')]=isNaN(_0x4b05b5[_0x478c('0x62')])?null:_0x4b05b5[_0x478c('0x62')]*0x3e8;_0x50b9c1[_0x478c('0x6c')]=isNaN(_0x4b05b5['sampleCount'])?null:_0x4b05b5[_0x478c('0x63')];_0x50b9c1[_0x478c('0x6d')]=isNaN(_0x4b05b5[_0x478c('0x65')])?null:_0x4b05b5['channelCount'];_0x50b9c1['converted_bitRate']=isNaN(_0x4b05b5[_0x478c('0x67')])?null:_0x4b05b5[_0x478c('0x67')];_0x50b9c1[_0x478c('0x6e')]=isNaN(_0x4b05b5[_0x478c('0x69')])?null:_0x4b05b5[_0x478c('0x69')];});_0x3256f0['on'](_0x478c('0x2a'),function(){fs['chmodSync'](_0x49a548,parseInt(_0x478c('0x5e'),0x8));return db['Sound'][_0x478c('0x52')](_0x50b9c1)[_0x478c('0x29')](function(_0x25fdf2){var _0x22628b={'role':_0x34e8a4['body'][_0x478c('0x6f')],'userProfileId':_0x34e8a4[_0x478c('0x70')][_0x478c('0x71')]};if(!_0x22628b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22628b[_0x478c('0x6f')]===_0x478c('0x72')){var _0x59737d=_0x25fdf2[_0x478c('0x26')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x478c('0x27'),'userProfileId':_0x22628b[_0x478c('0x71')]},'raw':!![]})[_0x478c('0x29')](function(_0xdd623d){if(_0xdd623d&&_0xdd623d['autoAssociation']===0x0){return db[_0x478c('0x28')]['create']({'name':_0x59737d[_0x478c('0x2d')],'resourceId':_0x59737d['id'],'type':_0xdd623d[_0x478c('0x2d')],'sectionId':_0xdd623d['id']},{})[_0x478c('0x29')](function(){return _0x25fdf2;});}else{return _0x25fdf2;}})[_0x478c('0x73')](function(_0x4e12ef){logger[_0x478c('0x2b')](_0x478c('0x74'),_0x4e12ef);throw _0x4e12ef;});}return _0x25fdf2;})[_0x478c('0x29')](respondWithResult(_0x28322a,null))[_0x478c('0x73')](handleError(_0x28322a,null));});_0x3256f0['start']();}catch(_0x51489b){_0x28322a['status'](0x1f4)[_0x478c('0x2e')](_0x51489b);}};exports['update']=function(_0x73fc59,_0x46b1e6,_0x2f8b93){return db[_0x478c('0x42')]['find']({'where':{'id':_0x73fc59[_0x478c('0x45')]['id']}})['then'](handleEntityNotFound(_0x46b1e6,null))[_0x478c('0x29')](saveUpdates(_[_0x478c('0x75')](_0x73fc59[_0x478c('0x70')],[_0x478c('0x2d'),_0x478c('0x76')]),null))[_0x478c('0x29')](respondWithResult(_0x46b1e6,null))[_0x478c('0x73')](handleError(_0x46b1e6,null));};exports[_0x478c('0x77')]=function(_0x1e15c1,_0x71f80c,_0x2636df){return db[_0x478c('0x42')]['find']({'where':{'id':_0x1e15c1[_0x478c('0x45')]['id']}})[_0x478c('0x29')](function(_0x5e7ee6){if(_0x5e7ee6){return _0x5e7ee6[_0x478c('0x25')]();}})[_0x478c('0x29')](function(_0x4da25b){var _0x1914fd=path[_0x478c('0x4a')](config['root'],_0x478c('0x78'),util['format']('%s.%s',_0x4da25b[_0x478c('0x4d')],_0x4da25b[_0x478c('0x79')]));var _0x5c80=path['join'](config['root'],'server/files/sounds/converted',util[_0x478c('0x50')](_0x478c('0x51'),_0x4da25b['save_name'],_0x4da25b[_0x478c('0x49')]));fs[_0x478c('0x60')](_0x1914fd);fs[_0x478c('0x60')](_0x5c80);return _0x4da25b;})['then'](function(_0x4d943f){if(_0x4d943f){return _0x71f80c[_0x478c('0x1c')](0xcc)[_0x478c('0x2a')]();}})[_0x478c('0x29')](handleEntityNotFound(_0x71f80c,null))[_0x478c('0x73')](handleError(_0x71f80c,null));}; \ No newline at end of file +var _0x482e=['html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','save','update','destroy','then','get','Sounds','UserProfileResource','end','error','stack','name','index','map','Sound','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','catch','params','include','options','find','download','save_name','converted_format','join','root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','format','%s.%s','basename','originalname','file','extname','filename','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','send','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete'];(function(_0x2479dd,_0x252c1b){var _0x367601=function(_0x1ad36c){while(--_0x1ad36c){_0x2479dd['push'](_0x2479dd['shift']());}};_0x367601(++_0x252c1b);}(_0x482e,0x1f4));var _0xe482=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x482e[_0x2b9b7f];return _0x4ed19a;};'use strict';var pdf=require(_0xe482('0x0'));var emlformat=require(_0xe482('0x1'));var rimraf=require(_0xe482('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe482('0x3'));var rp=require('request-promise');var moment=require(_0xe482('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe482('0x5'));var util=require(_0xe482('0x6'));var path=require(_0xe482('0x7'));var sox=require(_0xe482('0x8'));var csv=require('to-csv');var ejs=require(_0xe482('0x9'));var fs=require('fs');var _=require(_0xe482('0xa'));var squel=require(_0xe482('0xb'));var crypto=require(_0xe482('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe482('0xd'));var querystring=require(_0xe482('0xe'));var Papa=require(_0xe482('0xf'));var Redis=require(_0xe482('0x10'));var authService=require(_0xe482('0x11'));var qs=require(_0xe482('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe482('0x13'));var logger=require(_0xe482('0x14'))(_0xe482('0x15'));var utils=require(_0xe482('0x16'));var config=require(_0xe482('0x17'));var db=require(_0xe482('0x18'))['db'];function respondWithStatusCode(_0x3c9fee,_0x33b18a){_0x33b18a=_0x33b18a||0xcc;return function(_0xd948c9){if(_0xd948c9){return _0x3c9fee[_0xe482('0x19')](_0x33b18a);}return _0x3c9fee[_0xe482('0x1a')](_0x33b18a)['end']();};}function respondWithResult(_0xf7856d,_0x61f5e3){_0x61f5e3=_0x61f5e3||0xc8;return function(_0x32f11a){if(_0x32f11a){return _0xf7856d[_0xe482('0x1a')](_0x61f5e3)[_0xe482('0x1b')](_0x32f11a);}};}function respondWithFilteredResult(_0x2487a7,_0xcc9bff){return function(_0x22d0f7){if(_0x22d0f7){var _0x13d705=_0x22d0f7['count'],_0x58d0c2=_0xcc9bff[_0xe482('0x1c')],_0x3f0a16=_0xcc9bff[_0xe482('0x1c')]+_0xcc9bff[_0xe482('0x1d')],_0x43e6be;if(_0x3f0a16>=_0x13d705){_0x3f0a16=_0x13d705;_0x43e6be=0xc8;}else{_0x43e6be=0xce;}_0x2487a7[_0xe482('0x1a')](_0x43e6be);return _0x2487a7[_0xe482('0x1e')](_0xe482('0x1f'),_0x58d0c2+'-'+_0x3f0a16+'/'+_0x13d705)['json'](_0x22d0f7);}return null;};}function patchUpdates(_0x3b76f0){return function(_0x10aa79){try{jsonpatch['apply'](_0x10aa79,_0x3b76f0,!![]);}catch(_0xed63e){return BPromise['reject'](_0xed63e);}return _0x10aa79[_0xe482('0x20')]();};}function saveUpdates(_0x41347d,_0x5f4629){return function(_0x57536a){if(_0x57536a){return _0x57536a[_0xe482('0x21')](_0x41347d)['then'](function(_0x1504d6){return _0x1504d6;});}return null;};}function removeEntity(_0x299f59,_0x4a7b03){return function(_0x4a4e36){if(_0x4a4e36){return _0x4a4e36[_0xe482('0x22')]()[_0xe482('0x23')](function(){var _0x4e74f0=_0x4a4e36[_0xe482('0x24')]({'plain':!![]});var _0x3b706b=_0xe482('0x25');return db[_0xe482('0x26')][_0xe482('0x22')]({'where':{'type':_0x3b706b,'resourceId':_0x4e74f0['id']}})[_0xe482('0x23')](function(){return _0x4a4e36;});})[_0xe482('0x23')](function(){_0x299f59[_0xe482('0x1a')](0xcc)[_0xe482('0x27')]();});}};}function handleEntityNotFound(_0x316763,_0x300508){return function(_0x5f4042){if(!_0x5f4042){_0x316763['sendStatus'](0x194);}return _0x5f4042;};}function handleError(_0x46bd7d,_0x50d296){_0x50d296=_0x50d296||0x1f4;return function(_0x36f37d){logger[_0xe482('0x28')](_0x36f37d[_0xe482('0x29')]);if(_0x36f37d['name']){delete _0x36f37d[_0xe482('0x2a')];}_0x46bd7d[_0xe482('0x1a')](_0x50d296)['send'](_0x36f37d);};}exports[_0xe482('0x2b')]=function(_0x11b0c6,_0x11e87c){var _0x542350={},_0x576cc6={},_0x3c2b83={'count':0x0,'rows':[]};var _0x1049dc=_[_0xe482('0x2c')](db[_0xe482('0x2d')][_0xe482('0x2e')],function(_0xf1889d){return{'name':_0xf1889d[_0xe482('0x2f')],'type':_0xf1889d[_0xe482('0x30')]['key']};});_0x576cc6[_0xe482('0x31')]=_[_0xe482('0x2c')](_0x1049dc,_0xe482('0x2a'));_0x576cc6[_0xe482('0x32')]=_[_0xe482('0x33')](_0x11b0c6[_0xe482('0x32')]);_0x576cc6['filters']=_[_0xe482('0x34')](_0x576cc6['model'],_0x576cc6['query']);_0x542350[_0xe482('0x35')]=_[_0xe482('0x34')](_0x576cc6[_0xe482('0x31')],qs[_0xe482('0x36')](_0x11b0c6[_0xe482('0x32')][_0xe482('0x36')]));_0x542350[_0xe482('0x35')]=_0x542350[_0xe482('0x35')][_0xe482('0x37')]?_0x542350[_0xe482('0x35')]:_0x576cc6[_0xe482('0x31')];if(!_0x11b0c6[_0xe482('0x32')][_0xe482('0x38')]('nolimit')){_0x542350[_0xe482('0x1d')]=qs[_0xe482('0x1d')](_0x11b0c6[_0xe482('0x32')][_0xe482('0x1d')]);_0x542350[_0xe482('0x1c')]=qs[_0xe482('0x1c')](_0x11b0c6[_0xe482('0x32')][_0xe482('0x1c')]);}_0x542350[_0xe482('0x39')]=qs[_0xe482('0x3a')](_0x11b0c6['query']['sort']);_0x542350[_0xe482('0x3b')]=qs[_0xe482('0x3c')](_[_0xe482('0x3d')](_0x11b0c6[_0xe482('0x32')],_0x576cc6[_0xe482('0x3c')]));if(_0x11b0c6[_0xe482('0x32')][_0xe482('0x3e')]){_0x542350[_0xe482('0x3b')]=_[_0xe482('0x3f')](_0x542350[_0xe482('0x3b')],{'$or':_['map'](_0x1049dc,function(_0x4f8a58){if(_0x4f8a58[_0xe482('0x30')]!==_0xe482('0x40')){var _0x9ad8c1={};_0x9ad8c1[_0x4f8a58['name']]={'$like':'%'+_0x11b0c6['query'][_0xe482('0x3e')]+'%'};return _0x9ad8c1;}})});}_0x542350=_[_0xe482('0x3f')]({},_0x542350,_0x11b0c6['options']);var _0x109aba={'where':_0x542350[_0xe482('0x3b')]};return db[_0xe482('0x2d')][_0xe482('0x41')](_0x109aba)[_0xe482('0x23')](function(_0x1cb6be){_0x3c2b83[_0xe482('0x41')]=_0x1cb6be;if(_0x11b0c6['query'][_0xe482('0x42')]){_0x542350['include']=[{'all':!![]}];}return db['Sound'][_0xe482('0x43')](_0x542350);})[_0xe482('0x23')](function(_0x4536ac){_0x3c2b83[_0xe482('0x44')]=_0x4536ac;return _0x3c2b83;})[_0xe482('0x23')](respondWithFilteredResult(_0x11e87c,_0x542350))[_0xe482('0x45')](handleError(_0x11e87c,null));};exports['show']=function(_0x20032c,_0x5b176b){var _0x1b5a50={'raw':!![],'where':{'id':_0x20032c[_0xe482('0x46')]['id']}},_0x4bb595={};_0x4bb595[_0xe482('0x31')]=_[_0xe482('0x33')](db[_0xe482('0x2d')][_0xe482('0x2e')]);_0x4bb595[_0xe482('0x32')]=_[_0xe482('0x33')](_0x20032c['query']);_0x4bb595['filters']=_[_0xe482('0x34')](_0x4bb595[_0xe482('0x31')],_0x4bb595[_0xe482('0x32')]);_0x1b5a50[_0xe482('0x35')]=_['intersection'](_0x4bb595[_0xe482('0x31')],qs[_0xe482('0x36')](_0x20032c[_0xe482('0x32')][_0xe482('0x36')]));_0x1b5a50[_0xe482('0x35')]=_0x1b5a50[_0xe482('0x35')][_0xe482('0x37')]?_0x1b5a50[_0xe482('0x35')]:_0x4bb595[_0xe482('0x31')];if(_0x20032c[_0xe482('0x32')]['includeAll']){_0x1b5a50[_0xe482('0x47')]=[{'all':!![]}];}_0x1b5a50=_[_0xe482('0x3f')]({},_0x1b5a50,_0x20032c[_0xe482('0x48')]);return db['Sound'][_0xe482('0x49')](_0x1b5a50)[_0xe482('0x23')](handleEntityNotFound(_0x5b176b,null))[_0xe482('0x23')](respondWithResult(_0x5b176b,null))[_0xe482('0x45')](handleError(_0x5b176b,null));};exports[_0xe482('0x4a')]=function(_0x511f5f,_0x4f5ee0,_0x22e751){return db[_0xe482('0x2d')][_0xe482('0x49')]({'where':{'id':_0x511f5f['params']['id']},'attributes':[_0xe482('0x2a'),_0xe482('0x4b'),_0xe482('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x4f5ee0,null))[_0xe482('0x23')](function(_0x4319cf){if(_0x4319cf){if(!fs['existsSync'](path[_0xe482('0x4d')](config[_0xe482('0x4e')],_0xe482('0x4f'),_0x4319cf[_0xe482('0x4b')]+'.'+_0x4319cf[_0xe482('0x4c')]))){throw new db['Sequelize'][(_0xe482('0x50'))](_0xe482('0x51'));}return _0x4f5ee0[_0xe482('0x4a')](path[_0xe482('0x4d')](config[_0xe482('0x4e')],'server/files/sounds/converted',util[_0xe482('0x52')](_0xe482('0x53'),_0x4319cf[_0xe482('0x4b')],_0x4319cf[_0xe482('0x4c')])),util[_0xe482('0x52')](_0xe482('0x53'),_0x4319cf[_0xe482('0x2a')],_0x4319cf['converted_format']));}return null;})['catch'](handleError(_0x4f5ee0,null));};exports['create']=function(_0x57bc06,_0x2f903d,_0x2a64de){var _0x1a2de5={'name':path[_0xe482('0x54')](_0x57bc06['file'][_0xe482('0x55')],path['extname'](_0x57bc06['file'][_0xe482('0x55')])),'save_name':path[_0xe482('0x54')](_0x57bc06[_0xe482('0x56')]['filename'],path[_0xe482('0x57')](_0x57bc06[_0xe482('0x56')][_0xe482('0x58')])),'original_format':path[_0xe482('0x57')](_0x57bc06['file'][_0xe482('0x55')])[_0xe482('0x59')](0x1),'converted_format':_0xe482('0x5a')};var _0x38d1ee=path[_0xe482('0x4d')](config[_0xe482('0x4e')],_0xe482('0x5b'),_0x57bc06[_0xe482('0x56')][_0xe482('0x58')]);var _0xc02952=path[_0xe482('0x4d')](config['root'],'server/files/sounds/converted',util[_0xe482('0x52')](_0xe482('0x53'),path[_0xe482('0x54')](_0x57bc06[_0xe482('0x56')][_0xe482('0x58')],path['extname'](_0x57bc06[_0xe482('0x56')]['filename'])),_0x1a2de5[_0xe482('0x4c')]));logger['info'](_0xe482('0x5c'),_0x38d1ee);logger['info'](_0xe482('0x5d'),_0xc02952);try{fs[_0xe482('0x5e')](_0x38d1ee,parseInt(_0xe482('0x5f'),0x8));var _0x516a44=sox[_0xe482('0x60')](_0x38d1ee,_0xc02952,{'sampleRate':0x1f40,'format':_0xe482('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x516a44['on'](_0xe482('0x28'),function(_0x31abb0){fs[_0xe482('0x61')](_0x38d1ee);_0x2f903d[_0xe482('0x1a')](0x1f4)[_0xe482('0x62')](_0x31abb0);});_0x516a44['on'](_0xe482('0x63'),function(_0x32b9d4){_0x1a2de5['original_duration']=isNaN(_0x32b9d4[_0xe482('0x64')])?null:_0x32b9d4['duration']*0x3e8;_0x1a2de5[_0xe482('0x65')]=isNaN(_0x32b9d4[_0xe482('0x66')])?null:_0x32b9d4[_0xe482('0x66')];_0x1a2de5[_0xe482('0x67')]=isNaN(_0x32b9d4[_0xe482('0x68')])?null:_0x32b9d4['channelCount'];_0x1a2de5[_0xe482('0x69')]=isNaN(_0x32b9d4[_0xe482('0x6a')])?null:_0x32b9d4[_0xe482('0x6a')];_0x1a2de5[_0xe482('0x6b')]=isNaN(_0x32b9d4[_0xe482('0x6c')])?null:_0x32b9d4[_0xe482('0x6c')];});_0x516a44['on'](_0xe482('0x6d'),function(_0x13f585){_0x1a2de5[_0xe482('0x6e')]=isNaN(_0x13f585['duration'])?null:_0x13f585[_0xe482('0x64')]*0x3e8;_0x1a2de5[_0xe482('0x6f')]=isNaN(_0x13f585[_0xe482('0x66')])?null:_0x13f585[_0xe482('0x66')];_0x1a2de5['converted_channelCount']=isNaN(_0x13f585[_0xe482('0x68')])?null:_0x13f585[_0xe482('0x68')];_0x1a2de5[_0xe482('0x70')]=isNaN(_0x13f585[_0xe482('0x6a')])?null:_0x13f585['bitRate'];_0x1a2de5[_0xe482('0x71')]=isNaN(_0x13f585[_0xe482('0x6c')])?null:_0x13f585[_0xe482('0x6c')];});_0x516a44['on'](_0xe482('0x27'),function(){fs[_0xe482('0x5e')](_0xc02952,parseInt(_0xe482('0x5f'),0x8));return db['Sound']['create'](_0x1a2de5)['then'](function(_0xe08c36){var _0x413f21={'role':_0x57bc06['body'][_0xe482('0x72')],'userProfileId':_0x57bc06[_0xe482('0x73')][_0xe482('0x74')]};if(!_0x413f21)throw new Error(_0xe482('0x75'));if(_0x413f21[_0xe482('0x72')]===_0xe482('0x76')){var _0x558b9f=_0xe08c36[_0xe482('0x24')]({'plain':!![]});return db[_0xe482('0x77')]['find']({'where':{'name':_0xe482('0x25'),'userProfileId':_0x413f21['userProfileId']},'raw':!![]})[_0xe482('0x23')](function(_0xb7a572){if(_0xb7a572&&_0xb7a572[_0xe482('0x78')]===0x0){return db[_0xe482('0x26')][_0xe482('0x79')]({'name':_0x558b9f['name'],'resourceId':_0x558b9f['id'],'type':_0xb7a572['name'],'sectionId':_0xb7a572['id']},{})[_0xe482('0x23')](function(){return _0xe08c36;});}else{return _0xe08c36;}})[_0xe482('0x45')](function(_0x1e7104){logger['error'](_0xe482('0x7a'),_0x1e7104);throw _0x1e7104;});}return _0xe08c36;})[_0xe482('0x23')](respondWithResult(_0x2f903d,null))['catch'](handleError(_0x2f903d,null));});_0x516a44[_0xe482('0x7b')]();}catch(_0x135583){_0x2f903d[_0xe482('0x1a')](0x1f4)[_0xe482('0x62')](_0x135583);}};exports[_0xe482('0x21')]=function(_0x251d19,_0x304513,_0x2afc9d){return db[_0xe482('0x2d')][_0xe482('0x49')]({'where':{'id':_0x251d19[_0xe482('0x46')]['id']}})[_0xe482('0x23')](handleEntityNotFound(_0x304513,null))[_0xe482('0x23')](saveUpdates(_['pick'](_0x251d19[_0xe482('0x73')],[_0xe482('0x2a'),'description']),null))[_0xe482('0x23')](respondWithResult(_0x304513,null))[_0xe482('0x45')](handleError(_0x304513,null));};exports[_0xe482('0x7c')]=function(_0x2dc27c,_0x4f3e90,_0x4b4eb4){return db[_0xe482('0x2d')][_0xe482('0x49')]({'where':{'id':_0x2dc27c[_0xe482('0x46')]['id']}})[_0xe482('0x23')](function(_0x3e473a){if(_0x3e473a){return _0x3e473a[_0xe482('0x22')]();}})[_0xe482('0x23')](function(_0x17c009){var _0x1ee091=path[_0xe482('0x4d')](config['root'],'server/files/sounds/original',util[_0xe482('0x52')](_0xe482('0x53'),_0x17c009[_0xe482('0x4b')],_0x17c009['original_format']));var _0x4b4252=path['join'](config[_0xe482('0x4e')],'server/files/sounds/converted',util[_0xe482('0x52')](_0xe482('0x53'),_0x17c009[_0xe482('0x4b')],_0x17c009['converted_format']));fs[_0xe482('0x61')](_0x1ee091);fs[_0xe482('0x61')](_0x4b4252);return _0x17c009;})[_0xe482('0x23')](function(_0x2159c6){if(_0x2159c6){return _0x4f3e90['status'](0xcc)[_0xe482('0x27')]();}})[_0xe482('0x23')](handleEntityNotFound(_0x4f3e90,null))[_0xe482('0x45')](handleError(_0x4f3e90,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index d3d0bbf..12330f7 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 _0x7f93=['tools_sounds','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Sound'];(function(_0x3b4724,_0x54a601){var _0x4a0c68=function(_0x2d7433){while(--_0x2d7433){_0x3b4724['push'](_0x3b4724['shift']());}};_0x4a0c68(++_0x54a601);}(_0x7f93,0x1d5));var _0x37f9=function(_0x35ad3c,_0x1f0a4b){_0x35ad3c=_0x35ad3c-0x0;var _0x37eabd=_0x7f93[_0x35ad3c];return _0x37eabd;};'use strict';var _=require(_0x37f9('0x0'));var util=require(_0x37f9('0x1'));var logger=require('../../config/logger')(_0x37f9('0x2'));var moment=require(_0x37f9('0x3'));var BPromise=require(_0x37f9('0x4'));var rp=require(_0x37f9('0x5'));var fs=require('fs');var path=require(_0x37f9('0x6'));var rimraf=require(_0x37f9('0x7'));var config=require(_0x37f9('0x8'));var attributes=require('./sound.attributes');module[_0x37f9('0x9')]=function(_0x5b3e19,_0x2c6621){return _0x5b3e19['define'](_0x37f9('0xa'),attributes,{'tableName':_0x37f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3569=['request-promise','rimraf','./sound.attributes','exports','Sound','lodash','util','api','moment','bluebird'];(function(_0x4cbca3,_0x347f9d){var _0x49e9b5=function(_0x314fa7){while(--_0x314fa7){_0x4cbca3['push'](_0x4cbca3['shift']());}};_0x49e9b5(++_0x347f9d);}(_0x3569,0x1b3));var _0x9356=function(_0x25df80,_0xa2aec5){_0x25df80=_0x25df80-0x0;var _0x17b6d0=_0x3569[_0x25df80];return _0x17b6d0;};'use strict';var _=require(_0x9356('0x0'));var util=require(_0x9356('0x1'));var logger=require('../../config/logger')(_0x9356('0x2'));var moment=require(_0x9356('0x3'));var BPromise=require(_0x9356('0x4'));var rp=require(_0x9356('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9356('0x6'));var config=require('../../config/environment');var attributes=require(_0x9356('0x7'));module[_0x9356('0x8')]=function(_0x125dfd,_0x428865){return _0x125dfd['define'](_0x9356('0x9'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 0804707..8393420 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 _0x68c8=['jayson/promise','client','http','then','info','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','code','Sound,\x20%s,\x20%s','message','catch','ShowSound','Sound','find','options','attributes','map','include','model','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x7fe3b4,_0x1271bf){var _0x1b450e=function(_0x545714){while(--_0x545714){_0x7fe3b4['push'](_0x7fe3b4['shift']());}};_0x1b450e(++_0x1271bf);}(_0x68c8,0xd6));var _0x868c=function(_0x3d4b56,_0x12499b){_0x3d4b56=_0x3d4b56-0x0;var _0x1c01af=_0x68c8[_0x3d4b56];return _0x1c01af;};'use strict';var _=require(_0x868c('0x0'));var util=require(_0x868c('0x1'));var moment=require(_0x868c('0x2'));var BPromise=require(_0x868c('0x3'));var rs=require(_0x868c('0x4'));var fs=require('fs');var Redis=require(_0x868c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x868c('0x6'));var logger=require(_0x868c('0x7'))(_0x868c('0x8'));var config=require(_0x868c('0x9'));var jayson=require(_0x868c('0xa'));var client=jayson[_0x868c('0xb')][_0x868c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x408408,_0x99e720,_0x2501f6){return new BPromise(function(_0x5d726d,_0x5a37b2){return client['request'](_0x408408,_0x2501f6)[_0x868c('0xd')](function(_0x48fda2){logger[_0x868c('0xe')]('Sound,\x20%s,\x20%s',_0x99e720,_0x868c('0xf'));logger['debug'](_0x868c('0x10'),_0x99e720,'request\x20sent',JSON['stringify'](_0x48fda2));if(_0x48fda2[_0x868c('0x11')]){if(_0x48fda2[_0x868c('0x11')][_0x868c('0x12')]===0x1f4){logger[_0x868c('0x11')](_0x868c('0x13'),_0x99e720,_0x48fda2[_0x868c('0x11')][_0x868c('0x14')]);return _0x5a37b2(_0x48fda2[_0x868c('0x11')][_0x868c('0x14')]);}logger[_0x868c('0x11')]('Sound,\x20%s,\x20%s',_0x99e720,_0x48fda2[_0x868c('0x11')][_0x868c('0x14')]);return _0x5d726d(_0x48fda2['error'][_0x868c('0x14')]);}else{logger[_0x868c('0xe')](_0x868c('0x13'),_0x99e720,'request\x20sent');_0x5d726d(_0x48fda2['result']['message']);}})[_0x868c('0x15')](function(_0x3fc22c){logger['error'](_0x868c('0x13'),_0x99e720,_0x3fc22c);_0x5a37b2(_0x3fc22c);});});}exports[_0x868c('0x16')]=function(_0x363807){var _0x432371=this;return new Promise(function(_0x475411,_0x19571b){return db[_0x868c('0x17')][_0x868c('0x18')]({'raw':_0x363807['options']?_0x363807[_0x868c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x363807[_0x868c('0x19')]?_0x363807[_0x868c('0x19')]['where']||null:null,'attributes':_0x363807[_0x868c('0x19')]?_0x363807[_0x868c('0x19')][_0x868c('0x1a')]||null:null,'include':_0x363807['options']?_0x363807[_0x868c('0x19')]['include']?_[_0x868c('0x1b')](_0x363807[_0x868c('0x19')][_0x868c('0x1c')],function(_0x5dfea5){return{'model':db[_0x5dfea5[_0x868c('0x1d')]],'as':_0x5dfea5['as'],'attributes':_0x5dfea5[_0x868c('0x1a')],'include':_0x5dfea5[_0x868c('0x1c')]?_[_0x868c('0x1b')](_0x5dfea5[_0x868c('0x1c')],function(_0x3a91af){return{'model':db[_0x3a91af['model']],'as':_0x3a91af['as'],'attributes':_0x3a91af[_0x868c('0x1a')],'include':_0x3a91af[_0x868c('0x1c')]?_[_0x868c('0x1b')](_0x3a91af[_0x868c('0x1c')],function(_0x3dd168){return{'model':db[_0x3dd168[_0x868c('0x1d')]],'as':_0x3dd168['as'],'attributes':_0x3dd168[_0x868c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50ba45){logger[_0x868c('0xe')](_0x868c('0x16'),_0x363807);logger[_0x868c('0x1e')]('ShowSound',_0x363807,JSON[_0x868c('0x1f')](_0x50ba45));_0x475411(_0x50ba45);})['catch'](function(_0xa60222){logger[_0x868c('0x11')](_0x868c('0x16'),_0xa60222[_0x868c('0x14')],_0x363807);_0x19571b(_0x432371[_0x868c('0x11')](0x1f4,_0xa60222[_0x868c('0x14')]));});});}; \ No newline at end of file +var _0x9150=['request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSound','options','where','attributes','include','map','model','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3c1493,_0x56643e){var _0x2ca08c=function(_0x1c886e){while(--_0x1c886e){_0x3c1493['push'](_0x3c1493['shift']());}};_0x2ca08c(++_0x56643e);}(_0x9150,0x18b));var _0x0915=function(_0x495391,_0x19c224){_0x495391=_0x495391-0x0;var _0x53f97a=_0x9150[_0x495391];return _0x53f97a;};'use strict';var _=require(_0x0915('0x0'));var util=require(_0x0915('0x1'));var moment=require(_0x0915('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0915('0x3'));var db=require(_0x0915('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0915('0x5'))(_0x0915('0x6'));var config=require(_0x0915('0x7'));var jayson=require(_0x0915('0x8'));var client=jayson[_0x0915('0x9')][_0x0915('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x268084,_0x263799,_0x49836b){return new BPromise(function(_0x4a7e95,_0x3b59c1){return client[_0x0915('0xb')](_0x268084,_0x49836b)[_0x0915('0xc')](function(_0x261642){logger[_0x0915('0xd')](_0x0915('0xe'),_0x263799,_0x0915('0xf'));logger[_0x0915('0x10')](_0x0915('0x11'),_0x263799,_0x0915('0xf'),JSON[_0x0915('0x12')](_0x261642));if(_0x261642[_0x0915('0x13')]){if(_0x261642[_0x0915('0x13')]['code']===0x1f4){logger[_0x0915('0x13')]('Sound,\x20%s,\x20%s',_0x263799,_0x261642[_0x0915('0x13')][_0x0915('0x14')]);return _0x3b59c1(_0x261642[_0x0915('0x13')][_0x0915('0x14')]);}logger[_0x0915('0x13')](_0x0915('0xe'),_0x263799,_0x261642[_0x0915('0x13')]['message']);return _0x4a7e95(_0x261642[_0x0915('0x13')]['message']);}else{logger[_0x0915('0xd')](_0x0915('0xe'),_0x263799,_0x0915('0xf'));_0x4a7e95(_0x261642['result']['message']);}})[_0x0915('0x15')](function(_0x2dfd71){logger[_0x0915('0x13')](_0x0915('0xe'),_0x263799,_0x2dfd71);_0x3b59c1(_0x2dfd71);});});}exports[_0x0915('0x16')]=function(_0x38ac44){var _0x354890=this;return new Promise(function(_0x4bca9a,_0x3494b4){return db['Sound']['find']({'raw':_0x38ac44[_0x0915('0x17')]?_0x38ac44[_0x0915('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x38ac44[_0x0915('0x17')]?_0x38ac44[_0x0915('0x17')][_0x0915('0x18')]||null:null,'attributes':_0x38ac44['options']?_0x38ac44[_0x0915('0x17')][_0x0915('0x19')]||null:null,'include':_0x38ac44['options']?_0x38ac44[_0x0915('0x17')][_0x0915('0x1a')]?_[_0x0915('0x1b')](_0x38ac44[_0x0915('0x17')]['include'],function(_0x4568ac){return{'model':db[_0x4568ac[_0x0915('0x1c')]],'as':_0x4568ac['as'],'attributes':_0x4568ac['attributes'],'include':_0x4568ac[_0x0915('0x1a')]?_[_0x0915('0x1b')](_0x4568ac['include'],function(_0x3d9ef9){return{'model':db[_0x3d9ef9[_0x0915('0x1c')]],'as':_0x3d9ef9['as'],'attributes':_0x3d9ef9[_0x0915('0x19')],'include':_0x3d9ef9[_0x0915('0x1a')]?_['map'](_0x3d9ef9[_0x0915('0x1a')],function(_0x262b04){return{'model':db[_0x262b04[_0x0915('0x1c')]],'as':_0x262b04['as'],'attributes':_0x262b04[_0x0915('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0915('0xc')](function(_0x29343c){logger['info'](_0x0915('0x16'),_0x38ac44);logger[_0x0915('0x10')](_0x0915('0x16'),_0x38ac44,JSON['stringify'](_0x29343c));_0x4bca9a(_0x29343c);})[_0x0915('0x15')](function(_0x3b9a61){logger[_0x0915('0x13')]('ShowSound',_0x3b9a61[_0x0915('0x14')],_0x38ac44);_0x3494b4(_0x354890[_0x0915('0x13')](0x1f4,_0x3b9a61[_0x0915('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index c9fda68..7f0a967 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 _0x8bf4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x2b0912,_0xe81d8c){var _0x19da5c=function(_0x2b8c6b){while(--_0x2b8c6b){_0x2b0912['push'](_0x2b0912['shift']());}};_0x19da5c(++_0xe81d8c);}(_0x8bf4,0x13f));var _0x48bf=function(_0x2221f2,_0x4acdaa){_0x2221f2=_0x2221f2-0x0;var _0x4ba58a=_0x8bf4[_0x2221f2];return _0x4ba58a;};'use strict';var multer=require(_0x48bf('0x0'));var util=require(_0x48bf('0x1'));var path=require(_0x48bf('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x48bf('0x3')]();var auth=require(_0x48bf('0x4'));var interaction=require(_0x48bf('0x5'));var config=require(_0x48bf('0x6'));var controller=require(_0x48bf('0x7'));router[_0x48bf('0x8')]('/',auth[_0x48bf('0x9')](),controller[_0x48bf('0xa')]);router[_0x48bf('0x8')](_0x48bf('0xb'),auth[_0x48bf('0x9')](),controller[_0x48bf('0xc')]);router[_0x48bf('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x48bf('0xe')](_0x48bf('0xb'),auth['isAuthenticated'](),controller[_0x48bf('0xf')]);router[_0x48bf('0x10')](_0x48bf('0xb'),auth[_0x48bf('0x9')](),controller[_0x48bf('0x11')]);module[_0x48bf('0x12')]=router; \ No newline at end of file +var _0x3f14=['../../config/environment','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f14,0xf9));var _0x43f1=function(_0x4e668b,_0x35b443){_0x4e668b=_0x4e668b-0x0;var _0xba75aa=_0x3f14[_0x4e668b];return _0xba75aa;};'use strict';var multer=require(_0x43f1('0x0'));var util=require(_0x43f1('0x1'));var path=require(_0x43f1('0x2'));var timeout=require(_0x43f1('0x3'));var express=require('express');var router=express[_0x43f1('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x43f1('0x5'));var config=require(_0x43f1('0x6'));var controller=require('./squareMessage.controller');router[_0x43f1('0x7')]('/',auth[_0x43f1('0x8')](),controller[_0x43f1('0x9')]);router[_0x43f1('0x7')](_0x43f1('0xa'),auth[_0x43f1('0x8')](),controller[_0x43f1('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x43f1('0xc')]);router[_0x43f1('0xd')](_0x43f1('0xa'),auth[_0x43f1('0x8')](),controller['update']);router[_0x43f1('0xe')](_0x43f1('0xa'),auth[_0x43f1('0x8')](),controller[_0x43f1('0xf')]);module[_0x43f1('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 c64a066..3f50b1b 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 _0x03ca=['medium','ENUM','out','exports'];(function(_0x35c2fc,_0xabea37){var _0x4727fd=function(_0x4eccfe){while(--_0x4eccfe){_0x35c2fc['push'](_0x35c2fc['shift']());}};_0x4727fd(++_0xabea37);}(_0x03ca,0x1db));var _0xa03c=function(_0x719d74,_0x10235a){_0x719d74=_0x719d74-0x0;var _0x107948=_0x03ca[_0x719d74];return _0x107948;};'use strict';var Sequelize=require('sequelize');module[_0xa03c('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0xa03c('0x1')),'allowNull':![]},'direction':{'type':Sequelize[_0xa03c('0x2')]('in',_0xa03c('0x3')),'defaultValue':_0xa03c('0x3'),'allowNull':![]}}; \ No newline at end of file +var _0xd275=['exports','STRING','medium','ENUM','out'];(function(_0xce0a5a,_0x447b9c){var _0xe9a57=function(_0x29476c){while(--_0x29476c){_0xce0a5a['push'](_0xce0a5a['shift']());}};_0xe9a57(++_0x447b9c);}(_0xd275,0x8c));var _0x5d27=function(_0x5c55bd,_0x53bf0d){_0x5c55bd=_0x5c55bd-0x0;var _0x3a29be=_0xd275[_0x5c55bd];return _0x3a29be;};'use strict';var Sequelize=require('sequelize');module[_0x5d27('0x0')]={'uniqueid':{'type':Sequelize[_0x5d27('0x1')]},'body':{'type':Sequelize['TEXT'](_0x5d27('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x5d27('0x3')]('in',_0x5d27('0x4')),'defaultValue':_0x5d27('0x4'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 28e80b9..5b643f2 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 _0x1f84=['keys','create','body','find','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareMessage','includeAll','include','findAll','rows','catch','show','params'];(function(_0x5d6a1d,_0x4d8ef7){var _0x35d834=function(_0x2cd66e){while(--_0x2cd66e){_0x5d6a1d['push'](_0x5d6a1d['shift']());}};_0x35d834(++_0x4d8ef7);}(_0x1f84,0x98));var _0x41f8=function(_0x520cb2,_0xdab1aa){_0x520cb2=_0x520cb2-0x0;var _0x307bd9=_0x1f84[_0x520cb2];return _0x307bd9;};'use strict';var pdf=require(_0x41f8('0x0'));var emlformat=require(_0x41f8('0x1'));var rimraf=require(_0x41f8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x41f8('0x3'));var moment=require(_0x41f8('0x4'));var BPromise=require(_0x41f8('0x5'));var Mustache=require(_0x41f8('0x6'));var util=require('util');var path=require(_0x41f8('0x7'));var sox=require(_0x41f8('0x8'));var csv=require(_0x41f8('0x9'));var ejs=require(_0x41f8('0xa'));var fs=require('fs');var _=require(_0x41f8('0xb'));var squel=require(_0x41f8('0xc'));var crypto=require(_0x41f8('0xd'));var jsforce=require(_0x41f8('0xe'));var deskjs=require(_0x41f8('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x41f8('0x10'));var qs=require(_0x41f8('0x11'));var as=require(_0x41f8('0x12'));var hardwareService=require(_0x41f8('0x13'));var logger=require(_0x41f8('0x14'))(_0x41f8('0x15'));var utils=require(_0x41f8('0x16'));var config=require(_0x41f8('0x17'));var db=require(_0x41f8('0x18'))['db'];function respondWithStatusCode(_0x3ab453,_0x5e2359){_0x5e2359=_0x5e2359||0xcc;return function(_0x167d06){if(_0x167d06){return _0x3ab453[_0x41f8('0x19')](_0x5e2359);}return _0x3ab453[_0x41f8('0x1a')](_0x5e2359)['end']();};}function respondWithResult(_0x1ffcbc,_0x3f3620){_0x3f3620=_0x3f3620||0xc8;return function(_0xf23d5c){if(_0xf23d5c){return _0x1ffcbc[_0x41f8('0x1a')](_0x3f3620)[_0x41f8('0x1b')](_0xf23d5c);}};}function respondWithFilteredResult(_0x4e6ff3,_0x14ed56){return function(_0x2784a9){if(_0x2784a9){var _0x45b5b3=_0x2784a9[_0x41f8('0x1c')],_0x15ae81=_0x14ed56[_0x41f8('0x1d')],_0x49ba00=_0x14ed56[_0x41f8('0x1d')]+_0x14ed56['limit'],_0x5e0fc4;if(_0x49ba00>=_0x45b5b3){_0x49ba00=_0x45b5b3;_0x5e0fc4=0xc8;}else{_0x5e0fc4=0xce;}_0x4e6ff3['status'](_0x5e0fc4);return _0x4e6ff3['set'](_0x41f8('0x1e'),_0x15ae81+'-'+_0x49ba00+'/'+_0x45b5b3)[_0x41f8('0x1b')](_0x2784a9);}return null;};}function patchUpdates(_0xbc9ff1){return function(_0x2f52d6){try{jsonpatch[_0x41f8('0x1f')](_0x2f52d6,_0xbc9ff1,!![]);}catch(_0xae1657){return BPromise['reject'](_0xae1657);}return _0x2f52d6['save']();};}function saveUpdates(_0x4cd339,_0x26a314){return function(_0x4fcdb6){if(_0x4fcdb6){return _0x4fcdb6[_0x41f8('0x20')](_0x4cd339)[_0x41f8('0x21')](function(_0x103fe1){return _0x103fe1;});}return null;};}function removeEntity(_0x897ba5,_0x171d36){return function(_0x217b75){if(_0x217b75){return _0x217b75[_0x41f8('0x22')]()['then'](function(){_0x897ba5[_0x41f8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bc49,_0x1622f7){return function(_0x4a6169){if(!_0x4a6169){_0xe8bc49[_0x41f8('0x19')](0x194);}return _0x4a6169;};}function handleError(_0x400869,_0x583599){_0x583599=_0x583599||0x1f4;return function(_0x4e1aa1){logger[_0x41f8('0x23')](_0x4e1aa1[_0x41f8('0x24')]);if(_0x4e1aa1[_0x41f8('0x25')]){delete _0x4e1aa1[_0x41f8('0x25')];}_0x400869['status'](_0x583599)[_0x41f8('0x26')](_0x4e1aa1);};}exports['index']=function(_0xe62d87,_0x3e06bd){var _0x4a4224={},_0x17f629={},_0x3f7cb3={'count':0x0,'rows':[]};var _0xa8acfc=_[_0x41f8('0x27')](db['SquareMessage'][_0x41f8('0x28')],function(_0x56b147){return{'name':_0x56b147[_0x41f8('0x29')],'type':_0x56b147[_0x41f8('0x2a')][_0x41f8('0x2b')]};});_0x17f629[_0x41f8('0x2c')]=_[_0x41f8('0x27')](_0xa8acfc,_0x41f8('0x25'));_0x17f629[_0x41f8('0x2d')]=_['keys'](_0xe62d87[_0x41f8('0x2d')]);_0x17f629[_0x41f8('0x2e')]=_[_0x41f8('0x2f')](_0x17f629['model'],_0x17f629[_0x41f8('0x2d')]);_0x4a4224[_0x41f8('0x30')]=_['intersection'](_0x17f629['model'],qs[_0x41f8('0x31')](_0xe62d87[_0x41f8('0x2d')][_0x41f8('0x31')]));_0x4a4224['attributes']=_0x4a4224[_0x41f8('0x30')][_0x41f8('0x32')]?_0x4a4224[_0x41f8('0x30')]:_0x17f629[_0x41f8('0x2c')];if(!_0xe62d87[_0x41f8('0x2d')][_0x41f8('0x33')](_0x41f8('0x34'))){_0x4a4224[_0x41f8('0x35')]=qs[_0x41f8('0x35')](_0xe62d87['query'][_0x41f8('0x35')]);_0x4a4224[_0x41f8('0x1d')]=qs['offset'](_0xe62d87[_0x41f8('0x2d')][_0x41f8('0x1d')]);}_0x4a4224[_0x41f8('0x36')]=qs['sort'](_0xe62d87[_0x41f8('0x2d')][_0x41f8('0x37')]);_0x4a4224[_0x41f8('0x38')]=qs[_0x41f8('0x2e')](_[_0x41f8('0x39')](_0xe62d87[_0x41f8('0x2d')],_0x17f629[_0x41f8('0x2e')]));if(_0xe62d87[_0x41f8('0x2d')][_0x41f8('0x3a')]){_0x4a4224[_0x41f8('0x38')]=_[_0x41f8('0x3b')](_0x4a4224['where'],{'$or':_[_0x41f8('0x27')](_0xa8acfc,function(_0x37c248){if(_0x37c248['type']!==_0x41f8('0x3c')){var _0xa1152e={};_0xa1152e[_0x37c248['name']]={'$like':'%'+_0xe62d87['query'][_0x41f8('0x3a')]+'%'};return _0xa1152e;}})});}_0x4a4224=_['merge']({},_0x4a4224,_0xe62d87[_0x41f8('0x3d')]);var _0x353ed4={'where':_0x4a4224['where']};return db[_0x41f8('0x3e')][_0x41f8('0x1c')](_0x353ed4)[_0x41f8('0x21')](function(_0x122254){_0x3f7cb3['count']=_0x122254;if(_0xe62d87[_0x41f8('0x2d')][_0x41f8('0x3f')]){_0x4a4224[_0x41f8('0x40')]=[{'all':!![]}];}return db[_0x41f8('0x3e')][_0x41f8('0x41')](_0x4a4224);})['then'](function(_0x38736e){_0x3f7cb3[_0x41f8('0x42')]=_0x38736e;return _0x3f7cb3;})[_0x41f8('0x21')](respondWithFilteredResult(_0x3e06bd,_0x4a4224))[_0x41f8('0x43')](handleError(_0x3e06bd,null));};exports[_0x41f8('0x44')]=function(_0x5a5c34,_0x36db35){var _0x5a94da={'raw':!![],'where':{'id':_0x5a5c34[_0x41f8('0x45')]['id']}},_0x1e0009={};_0x1e0009[_0x41f8('0x2c')]=_[_0x41f8('0x46')](db['SquareMessage']['rawAttributes']);_0x1e0009[_0x41f8('0x2d')]=_['keys'](_0x5a5c34[_0x41f8('0x2d')]);_0x1e0009['filters']=_[_0x41f8('0x2f')](_0x1e0009[_0x41f8('0x2c')],_0x1e0009[_0x41f8('0x2d')]);_0x5a94da[_0x41f8('0x30')]=_[_0x41f8('0x2f')](_0x1e0009[_0x41f8('0x2c')],qs[_0x41f8('0x31')](_0x5a5c34[_0x41f8('0x2d')]['fields']));_0x5a94da[_0x41f8('0x30')]=_0x5a94da[_0x41f8('0x30')][_0x41f8('0x32')]?_0x5a94da['attributes']:_0x1e0009[_0x41f8('0x2c')];if(_0x5a5c34[_0x41f8('0x2d')][_0x41f8('0x3f')]){_0x5a94da[_0x41f8('0x40')]=[{'all':!![]}];}_0x5a94da=_[_0x41f8('0x3b')]({},_0x5a94da,_0x5a5c34[_0x41f8('0x3d')]);return db['SquareMessage']['find'](_0x5a94da)[_0x41f8('0x21')](handleEntityNotFound(_0x36db35,null))['then'](respondWithResult(_0x36db35,null))['catch'](handleError(_0x36db35,null));};exports[_0x41f8('0x47')]=function(_0x5bc7f8,_0x43a327){return db[_0x41f8('0x3e')][_0x41f8('0x47')](_0x5bc7f8['body'],{})[_0x41f8('0x21')](respondWithResult(_0x43a327,0xc9))['catch'](handleError(_0x43a327,null));};exports[_0x41f8('0x20')]=function(_0x22627,_0x3fbf63){if(_0x22627[_0x41f8('0x48')]['id']){delete _0x22627['body']['id'];}return db[_0x41f8('0x3e')][_0x41f8('0x49')]({'where':{'id':_0x22627[_0x41f8('0x45')]['id']}})['then'](handleEntityNotFound(_0x3fbf63,null))[_0x41f8('0x21')](saveUpdates(_0x22627[_0x41f8('0x48')],null))[_0x41f8('0x21')](respondWithResult(_0x3fbf63,null))[_0x41f8('0x43')](handleError(_0x3fbf63,null));};exports['destroy']=function(_0x409d3b,_0x1dfdcf){return db[_0x41f8('0x3e')][_0x41f8('0x49')]({'where':{'id':_0x409d3b[_0x41f8('0x45')]['id']}})['then'](handleEntityNotFound(_0x1dfdcf,null))[_0x41f8('0x21')](removeEntity(_0x1dfdcf,null))[_0x41f8('0x43')](handleError(_0x1dfdcf,null));}; \ No newline at end of file +var _0x2160=['intersection','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','rows','show','params','fields','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','json','reject','update','then','destroy','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','keys','query','filters'];(function(_0x4c184d,_0x4278ab){var _0x23d997=function(_0x22d068){while(--_0x22d068){_0x4c184d['push'](_0x4c184d['shift']());}};_0x23d997(++_0x4278ab);}(_0x2160,0x132));var _0x0216=function(_0x7a4fee,_0x78ad1b){_0x7a4fee=_0x7a4fee-0x0;var _0x66958a=_0x2160[_0x7a4fee];return _0x66958a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0216('0x0'));var rimraf=require(_0x0216('0x1'));var zipdir=require(_0x0216('0x2'));var jsonpatch=require(_0x0216('0x3'));var rp=require(_0x0216('0x4'));var moment=require(_0x0216('0x5'));var BPromise=require(_0x0216('0x6'));var Mustache=require(_0x0216('0x7'));var util=require(_0x0216('0x8'));var path=require(_0x0216('0x9'));var sox=require(_0x0216('0xa'));var csv=require(_0x0216('0xb'));var ejs=require(_0x0216('0xc'));var fs=require('fs');var _=require(_0x0216('0xd'));var squel=require('squel');var crypto=require(_0x0216('0xe'));var jsforce=require(_0x0216('0xf'));var deskjs=require(_0x0216('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0216('0x11'));var Papa=require(_0x0216('0x12'));var Redis=require(_0x0216('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0216('0x14'));var as=require(_0x0216('0x15'));var hardwareService=require(_0x0216('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x0216('0x17'));var config=require(_0x0216('0x18'));var db=require(_0x0216('0x19'))['db'];function respondWithStatusCode(_0x5815aa,_0x55b393){_0x55b393=_0x55b393||0xcc;return function(_0x39d8de){if(_0x39d8de){return _0x5815aa[_0x0216('0x1a')](_0x55b393);}return _0x5815aa[_0x0216('0x1b')](_0x55b393)[_0x0216('0x1c')]();};}function respondWithResult(_0x395ab8,_0x22a0d2){_0x22a0d2=_0x22a0d2||0xc8;return function(_0x213273){if(_0x213273){return _0x395ab8['status'](_0x22a0d2)['json'](_0x213273);}};}function respondWithFilteredResult(_0xc17bb7,_0xd28139){return function(_0x11be29){if(_0x11be29){var _0x2835ff=_0x11be29['count'],_0x4942b7=_0xd28139[_0x0216('0x1d')],_0x89bb91=_0xd28139[_0x0216('0x1d')]+_0xd28139[_0x0216('0x1e')],_0x26c3c9;if(_0x89bb91>=_0x2835ff){_0x89bb91=_0x2835ff;_0x26c3c9=0xc8;}else{_0x26c3c9=0xce;}_0xc17bb7['status'](_0x26c3c9);return _0xc17bb7['set']('Content-Range',_0x4942b7+'-'+_0x89bb91+'/'+_0x2835ff)[_0x0216('0x1f')](_0x11be29);}return null;};}function patchUpdates(_0x5dd8e7){return function(_0x1d2bd6){try{jsonpatch['apply'](_0x1d2bd6,_0x5dd8e7,!![]);}catch(_0xcac398){return BPromise[_0x0216('0x20')](_0xcac398);}return _0x1d2bd6['save']();};}function saveUpdates(_0x2722ec,_0x1df24b){return function(_0x101c1f){if(_0x101c1f){return _0x101c1f[_0x0216('0x21')](_0x2722ec)[_0x0216('0x22')](function(_0x33748c){return _0x33748c;});}return null;};}function removeEntity(_0x32cf11,_0x14ab91){return function(_0x140f9e){if(_0x140f9e){return _0x140f9e[_0x0216('0x23')]()[_0x0216('0x22')](function(){_0x32cf11[_0x0216('0x1b')](0xcc)[_0x0216('0x1c')]();});}};}function handleEntityNotFound(_0x59ae0f,_0x2165d4){return function(_0x322318){if(!_0x322318){_0x59ae0f[_0x0216('0x1a')](0x194);}return _0x322318;};}function handleError(_0x36de58,_0x30dd4d){_0x30dd4d=_0x30dd4d||0x1f4;return function(_0x3dc921){logger['error'](_0x3dc921['stack']);if(_0x3dc921[_0x0216('0x24')]){delete _0x3dc921['name'];}_0x36de58[_0x0216('0x1b')](_0x30dd4d)[_0x0216('0x25')](_0x3dc921);};}exports[_0x0216('0x26')]=function(_0x23c29e,_0x3112a7){var _0x38cb1a={},_0x2758b3={},_0x26ea10={'count':0x0,'rows':[]};var _0x258275=_[_0x0216('0x27')](db[_0x0216('0x28')][_0x0216('0x29')],function(_0x342fce){return{'name':_0x342fce[_0x0216('0x2a')],'type':_0x342fce[_0x0216('0x2b')][_0x0216('0x2c')]};});_0x2758b3[_0x0216('0x2d')]=_[_0x0216('0x27')](_0x258275,_0x0216('0x24'));_0x2758b3['query']=_[_0x0216('0x2e')](_0x23c29e[_0x0216('0x2f')]);_0x2758b3[_0x0216('0x30')]=_[_0x0216('0x31')](_0x2758b3[_0x0216('0x2d')],_0x2758b3[_0x0216('0x2f')]);_0x38cb1a['attributes']=_[_0x0216('0x31')](_0x2758b3[_0x0216('0x2d')],qs['fields'](_0x23c29e[_0x0216('0x2f')]['fields']));_0x38cb1a[_0x0216('0x32')]=_0x38cb1a[_0x0216('0x32')]['length']?_0x38cb1a['attributes']:_0x2758b3[_0x0216('0x2d')];if(!_0x23c29e['query'][_0x0216('0x33')]('nolimit')){_0x38cb1a[_0x0216('0x1e')]=qs[_0x0216('0x1e')](_0x23c29e[_0x0216('0x2f')]['limit']);_0x38cb1a[_0x0216('0x1d')]=qs[_0x0216('0x1d')](_0x23c29e[_0x0216('0x2f')][_0x0216('0x1d')]);}_0x38cb1a[_0x0216('0x34')]=qs[_0x0216('0x35')](_0x23c29e[_0x0216('0x2f')][_0x0216('0x35')]);_0x38cb1a[_0x0216('0x36')]=qs[_0x0216('0x30')](_[_0x0216('0x37')](_0x23c29e[_0x0216('0x2f')],_0x2758b3['filters']));if(_0x23c29e[_0x0216('0x2f')]['filter']){_0x38cb1a[_0x0216('0x36')]=_[_0x0216('0x38')](_0x38cb1a['where'],{'$or':_[_0x0216('0x27')](_0x258275,function(_0x47a923){if(_0x47a923['type']!==_0x0216('0x39')){var _0x3bc24f={};_0x3bc24f[_0x47a923['name']]={'$like':'%'+_0x23c29e[_0x0216('0x2f')][_0x0216('0x3a')]+'%'};return _0x3bc24f;}})});}_0x38cb1a=_['merge']({},_0x38cb1a,_0x23c29e[_0x0216('0x3b')]);var _0xed8268={'where':_0x38cb1a[_0x0216('0x36')]};return db['SquareMessage']['count'](_0xed8268)['then'](function(_0x22ffb3){_0x26ea10[_0x0216('0x3c')]=_0x22ffb3;if(_0x23c29e[_0x0216('0x2f')][_0x0216('0x3d')]){_0x38cb1a[_0x0216('0x3e')]=[{'all':!![]}];}return db[_0x0216('0x28')]['findAll'](_0x38cb1a);})['then'](function(_0x575433){_0x26ea10[_0x0216('0x3f')]=_0x575433;return _0x26ea10;})[_0x0216('0x22')](respondWithFilteredResult(_0x3112a7,_0x38cb1a))['catch'](handleError(_0x3112a7,null));};exports[_0x0216('0x40')]=function(_0x56d8aa,_0x36772a){var _0x18c1e8={'raw':!![],'where':{'id':_0x56d8aa[_0x0216('0x41')]['id']}},_0x48b954={};_0x48b954[_0x0216('0x2d')]=_[_0x0216('0x2e')](db[_0x0216('0x28')]['rawAttributes']);_0x48b954[_0x0216('0x2f')]=_['keys'](_0x56d8aa['query']);_0x48b954[_0x0216('0x30')]=_[_0x0216('0x31')](_0x48b954[_0x0216('0x2d')],_0x48b954['query']);_0x18c1e8['attributes']=_[_0x0216('0x31')](_0x48b954[_0x0216('0x2d')],qs[_0x0216('0x42')](_0x56d8aa['query']['fields']));_0x18c1e8[_0x0216('0x32')]=_0x18c1e8[_0x0216('0x32')]['length']?_0x18c1e8[_0x0216('0x32')]:_0x48b954[_0x0216('0x2d')];if(_0x56d8aa[_0x0216('0x2f')][_0x0216('0x3d')]){_0x18c1e8['include']=[{'all':!![]}];}_0x18c1e8=_[_0x0216('0x38')]({},_0x18c1e8,_0x56d8aa['options']);return db['SquareMessage'][_0x0216('0x43')](_0x18c1e8)[_0x0216('0x22')](handleEntityNotFound(_0x36772a,null))[_0x0216('0x22')](respondWithResult(_0x36772a,null))[_0x0216('0x44')](handleError(_0x36772a,null));};exports[_0x0216('0x45')]=function(_0x4e9e57,_0x10a9e3){return db['SquareMessage'][_0x0216('0x45')](_0x4e9e57['body'],{})[_0x0216('0x22')](respondWithResult(_0x10a9e3,0xc9))['catch'](handleError(_0x10a9e3,null));};exports[_0x0216('0x21')]=function(_0x1a0f36,_0x4443c2){if(_0x1a0f36[_0x0216('0x46')]['id']){delete _0x1a0f36['body']['id'];}return db[_0x0216('0x28')][_0x0216('0x43')]({'where':{'id':_0x1a0f36[_0x0216('0x41')]['id']}})[_0x0216('0x22')](handleEntityNotFound(_0x4443c2,null))[_0x0216('0x22')](saveUpdates(_0x1a0f36[_0x0216('0x46')],null))[_0x0216('0x22')](respondWithResult(_0x4443c2,null))['catch'](handleError(_0x4443c2,null));};exports['destroy']=function(_0x36a700,_0x1ad2eb){return db[_0x0216('0x28')][_0x0216('0x43')]({'where':{'id':_0x36a700[_0x0216('0x41')]['id']}})['then'](handleEntityNotFound(_0x1ad2eb,null))[_0x0216('0x22')](removeEntity(_0x1ad2eb,null))[_0x0216('0x44')](handleError(_0x1ad2eb,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 10b0ee5..986df38 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 _0x49bc=['square_messages','util','../../config/logger','api','request-promise','../../config/environment','./squareMessage.attributes','exports','SquareMessage'];(function(_0x301be2,_0x5c87cf){var _0x45b4aa=function(_0x1b2ab7){while(--_0x1b2ab7){_0x301be2['push'](_0x301be2['shift']());}};_0x45b4aa(++_0x5c87cf);}(_0x49bc,0x1b1));var _0xc49b=function(_0x51970a,_0x5ab3b7){_0x51970a=_0x51970a-0x0;var _0x3e7380=_0x49bc[_0x51970a];return _0x3e7380;};'use strict';var _=require('lodash');var util=require(_0xc49b('0x0'));var logger=require(_0xc49b('0x1'))(_0xc49b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc49b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc49b('0x4'));var attributes=require(_0xc49b('0x5'));module[_0xc49b('0x6')]=function(_0x534827,_0x21b0b6){return _0x534827['define'](_0xc49b('0x7'),attributes,{'tableName':_0xc49b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae0e=['api','bluebird','request-promise','rimraf','../../config/environment','define','SquareMessage','square_messages','util','../../config/logger'];(function(_0x50ffbb,_0x21a925){var _0x576a1c=function(_0x8e27e6){while(--_0x8e27e6){_0x50ffbb['push'](_0x50ffbb['shift']());}};_0x576a1c(++_0x21a925);}(_0xae0e,0x166));var _0xeae0=function(_0x9e7abe,_0x3b4181){_0x9e7abe=_0x9e7abe-0x0;var _0x47982b=_0xae0e[_0x9e7abe];return _0x47982b;};'use strict';var _=require('lodash');var util=require(_0xeae0('0x0'));var logger=require(_0xeae0('0x1'))(_0xeae0('0x2'));var moment=require('moment');var BPromise=require(_0xeae0('0x3'));var rp=require(_0xeae0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeae0('0x5'));var config=require(_0xeae0('0x6'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x41810c,_0x18cd47){return _0x41810c[_0xeae0('0x7')](_0xeae0('0x8'),attributes,{'tableName':_0xeae0('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 178a147..7bd5865 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 _0xbd0a=['message','catch','SquareMessage','create','body','options','raw','CreateSquareMessage','stringify','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','result'];(function(_0x2a6a22,_0x1fc1de){var _0x26747b=function(_0x4f100f){while(--_0x4f100f){_0x2a6a22['push'](_0x2a6a22['shift']());}};_0x26747b(++_0x1fc1de);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x506e40,_0x2b8498){_0x506e40=_0x506e40-0x0;var _0xda31ef=_0xbd0a[_0x506e40];return _0xda31ef;};'use strict';var _=require(_0xabd0('0x0'));var util=require('util');var moment=require(_0xabd0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabd0('0x2'))['db'];var utils=require(_0xabd0('0x3'));var logger=require(_0xabd0('0x4'))(_0xabd0('0x5'));var config=require(_0xabd0('0x6'));var jayson=require(_0xabd0('0x7'));var client=jayson[_0xabd0('0x8')][_0xabd0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe18a18,_0x4ac4ad,_0xf44097){return new BPromise(function(_0xb60e77,_0x2b50c1){return client['request'](_0xe18a18,_0xf44097)[_0xabd0('0xa')](function(_0x4830c4){logger[_0xabd0('0xb')](_0xabd0('0xc'),_0x4ac4ad,_0xabd0('0xd'));logger[_0xabd0('0xe')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x4ac4ad,_0xabd0('0xd'),JSON['stringify'](_0x4830c4));if(_0x4830c4[_0xabd0('0xf')]){if(_0x4830c4[_0xabd0('0xf')][_0xabd0('0x10')]===0x1f4){logger[_0xabd0('0xf')](_0xabd0('0xc'),_0x4ac4ad,_0x4830c4[_0xabd0('0xf')]['message']);return _0x2b50c1(_0x4830c4[_0xabd0('0xf')]['message']);}logger[_0xabd0('0xf')](_0xabd0('0xc'),_0x4ac4ad,_0x4830c4['error']['message']);return _0xb60e77(_0x4830c4['error']['message']);}else{logger[_0xabd0('0xb')](_0xabd0('0xc'),_0x4ac4ad,_0xabd0('0xd'));_0xb60e77(_0x4830c4[_0xabd0('0x11')][_0xabd0('0x12')]);}})[_0xabd0('0x13')](function(_0x389e1e){logger[_0xabd0('0xf')](_0xabd0('0xc'),_0x4ac4ad,_0x389e1e);_0x2b50c1(_0x389e1e);});});}exports['CreateSquareMessage']=function(_0x3a0ace){var _0x5de1df=this;return new Promise(function(_0x579dcd,_0x2bbc18){return db[_0xabd0('0x14')][_0xabd0('0x15')](_0x3a0ace[_0xabd0('0x16')],{'raw':_0x3a0ace['options']?_0x3a0ace[_0xabd0('0x17')][_0xabd0('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x56c2f5){logger[_0xabd0('0xb')](_0xabd0('0x19'),_0x3a0ace);logger['debug'](_0xabd0('0x19'),_0x3a0ace,JSON[_0xabd0('0x1a')](_0x56c2f5));_0x579dcd(_0x56c2f5);})[_0xabd0('0x13')](function(_0x1e077e){logger['error'](_0xabd0('0x19'),_0x1e077e[_0xabd0('0x12')],_0x3a0ace);_0x2bbc18(_0x5de1df[_0xabd0('0xf')](0x1f4,_0x1e077e[_0xabd0('0x12')]));});});}; \ No newline at end of file +var _0x14b2=['code','message','info','result','CreateSquareMessage','SquareMessage','create','body','options','raw','then','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','SquareMessage,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x44c9a6,_0x59bf95){var _0x5599be=function(_0x27388a){while(--_0x27388a){_0x44c9a6['push'](_0x44c9a6['shift']());}};_0x5599be(++_0x59bf95);}(_0x14b2,0x1a1));var _0x214b=function(_0x2c7cd3,_0x369d68){_0x2c7cd3=_0x2c7cd3-0x0;var _0x36d395=_0x14b2[_0x2c7cd3];return _0x36d395;};'use strict';var _=require(_0x214b('0x0'));var util=require(_0x214b('0x1'));var moment=require('moment');var BPromise=require(_0x214b('0x2'));var rs=require(_0x214b('0x3'));var fs=require('fs');var Redis=require(_0x214b('0x4'));var db=require(_0x214b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x214b('0x6'))(_0x214b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x214b('0x8')][_0x214b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30867e,_0x3003ab,_0x188bab){return new BPromise(function(_0x117ddd,_0x4cd18e){return client[_0x214b('0xa')](_0x30867e,_0x188bab)['then'](function(_0x232e01){logger['info'](_0x214b('0xb'),_0x3003ab,'request\x20sent');logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x3003ab,_0x214b('0xc'),JSON[_0x214b('0xd')](_0x232e01));if(_0x232e01['error']){if(_0x232e01[_0x214b('0xe')][_0x214b('0xf')]===0x1f4){logger[_0x214b('0xe')]('SquareMessage,\x20%s,\x20%s',_0x3003ab,_0x232e01[_0x214b('0xe')]['message']);return _0x4cd18e(_0x232e01['error'][_0x214b('0x10')]);}logger[_0x214b('0xe')](_0x214b('0xb'),_0x3003ab,_0x232e01[_0x214b('0xe')][_0x214b('0x10')]);return _0x117ddd(_0x232e01[_0x214b('0xe')]['message']);}else{logger[_0x214b('0x11')]('SquareMessage,\x20%s,\x20%s',_0x3003ab,_0x214b('0xc'));_0x117ddd(_0x232e01[_0x214b('0x12')][_0x214b('0x10')]);}})['catch'](function(_0x4d2557){logger[_0x214b('0xe')]('SquareMessage,\x20%s,\x20%s',_0x3003ab,_0x4d2557);_0x4cd18e(_0x4d2557);});});}exports[_0x214b('0x13')]=function(_0xbe4932){var _0x4d42e6=this;return new Promise(function(_0x25e18a,_0x4cc219){return db[_0x214b('0x14')][_0x214b('0x15')](_0xbe4932[_0x214b('0x16')],{'raw':_0xbe4932['options']?_0xbe4932[_0x214b('0x17')][_0x214b('0x18')]===undefined?!![]:![]:!![]})[_0x214b('0x19')](function(_0x3dc351){logger[_0x214b('0x11')]('CreateSquareMessage',_0xbe4932);logger['debug'](_0x214b('0x13'),_0xbe4932,JSON[_0x214b('0xd')](_0x3dc351));_0x25e18a(_0x3dc351);})[_0x214b('0x1a')](function(_0x2ddfe4){logger['error'](_0x214b('0x13'),_0x2ddfe4[_0x214b('0x10')],_0xbe4932);_0x4cc219(_0x4d42e6[_0x214b('0xe')](0x1f4,_0x2ddfe4[_0x214b('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 9754f65..dab778e 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 _0x5d4d=['show','/:id/test','15s','test','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x5d4d,0xb4));var _0xd5d4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d4d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd5d4('0x0'));var util=require(_0xd5d4('0x1'));var path=require(_0xd5d4('0x2'));var timeout=require(_0xd5d4('0x3'));var express=require(_0xd5d4('0x4'));var router=express[_0xd5d4('0x5')]();var auth=require(_0xd5d4('0x6'));var interaction=require(_0xd5d4('0x7'));var config=require(_0xd5d4('0x8'));var controller=require('./squareOdbc.controller');router['get']('/',auth[_0xd5d4('0x9')](),controller[_0xd5d4('0xa')]);router[_0xd5d4('0xb')]('/:id',auth[_0xd5d4('0x9')](),controller[_0xd5d4('0xc')]);router[_0xd5d4('0xb')](_0xd5d4('0xd'),auth[_0xd5d4('0x9')](),timeout(_0xd5d4('0xe')),controller[_0xd5d4('0xf')]);router[_0xd5d4('0x10')]('/',auth['isAuthenticated'](),controller[_0xd5d4('0x11')]);router[_0xd5d4('0x12')](_0xd5d4('0x13'),auth['isAuthenticated'](),controller[_0xd5d4('0x14')]);router[_0xd5d4('0x15')](_0xd5d4('0x13'),auth[_0xd5d4('0x9')](),controller[_0xd5d4('0x16')]);module[_0xd5d4('0x17')]=router; \ No newline at end of file +var _0x8868=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','/:id','show','/:id/test','isAuthenticated','15s','test','post','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5afeab,_0x536dcd){var _0x419cd3=function(_0x20edb8){while(--_0x20edb8){_0x5afeab['push'](_0x5afeab['shift']());}};_0x419cd3(++_0x536dcd);}(_0x8868,0x1ca));var _0x8886=function(_0x5d5dc6,_0x40297c){_0x5d5dc6=_0x5d5dc6-0x0;var _0x4ebb3a=_0x8868[_0x5d5dc6];return _0x4ebb3a;};'use strict';var multer=require(_0x8886('0x0'));var util=require(_0x8886('0x1'));var path=require(_0x8886('0x2'));var timeout=require(_0x8886('0x3'));var express=require(_0x8886('0x4'));var router=express[_0x8886('0x5')]();var auth=require(_0x8886('0x6'));var interaction=require(_0x8886('0x7'));var config=require(_0x8886('0x8'));var controller=require(_0x8886('0x9'));router[_0x8886('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8886('0xa')](_0x8886('0xb'),auth['isAuthenticated'](),controller[_0x8886('0xc')]);router['get'](_0x8886('0xd'),auth[_0x8886('0xe')](),timeout(_0x8886('0xf')),controller[_0x8886('0x10')]);router[_0x8886('0x11')]('/',auth[_0x8886('0xe')](),controller['create']);router[_0x8886('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8886('0x13')]);router['delete'](_0x8886('0xb'),auth[_0x8886('0xe')](),controller[_0x8886('0x14')]);module[_0x8886('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 2e1d29f..d9b676f 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 _0xa762=['name','exports','STRING'];(function(_0x22076a,_0x41823a){var _0x5174d2=function(_0x396595){while(--_0x396595){_0x22076a['push'](_0x22076a['shift']());}};_0x5174d2(++_0x41823a);}(_0xa762,0x1e4));var _0x2a76=function(_0x59390d,_0x4ed365){_0x59390d=_0x59390d-0x0;var _0x14a7bc=_0xa762[_0x59390d];return _0x14a7bc;};'use strict';var Sequelize=require('sequelize');module[_0x2a76('0x0')]={'name':{'type':Sequelize[_0x2a76('0x1')],'unique':_0x2a76('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2a76('0x1')]}}; \ No newline at end of file +var _0xe295=['STRING','sequelize','exports','name'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xe295,0xad));var _0x5e29=function(_0x4ccde3,_0x38ca57){_0x4ccde3=_0x4ccde3-0x0;var _0x3348ac=_0xe295[_0x4ccde3];return _0x3348ac;};'use strict';var Sequelize=require(_0x5e29('0x0'));module[_0x5e29('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5e29('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x5e29('0x3')]},'description':{'type':Sequelize[_0x5e29('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 36b85b8..ac91b54 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 _0x7128=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save','then','get','ODBC','UserProfileResource','destroy','error','name','send','index','SquareOdbc','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','rows','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','test','dsn','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xe87d7b,_0x361ac8){var _0x1324ad=function(_0x155224){while(--_0x155224){_0xe87d7b['push'](_0xe87d7b['shift']());}};_0x1324ad(++_0x361ac8);}(_0x7128,0x1c0));var _0x8712=function(_0x305c31,_0x466b17){_0x305c31=_0x305c31-0x0;var _0x17f39f=_0x7128[_0x305c31];return _0x17f39f;};'use strict';var pdf=require(_0x8712('0x0'));var emlformat=require(_0x8712('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8712('0x2'));var jsonpatch=require(_0x8712('0x3'));var rp=require(_0x8712('0x4'));var moment=require(_0x8712('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8712('0x6'));var util=require(_0x8712('0x7'));var path=require(_0x8712('0x8'));var sox=require(_0x8712('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8712('0xa'));var squel=require('squel');var crypto=require(_0x8712('0xb'));var jsforce=require(_0x8712('0xc'));var deskjs=require(_0x8712('0xd'));var toCsv=require(_0x8712('0xe'));var querystring=require(_0x8712('0xf'));var Papa=require(_0x8712('0x10'));var Redis=require('ioredis');var authService=require(_0x8712('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8712('0x12'));var hardwareService=require(_0x8712('0x13'));var logger=require(_0x8712('0x14'))('api');var utils=require(_0x8712('0x15'));var config=require(_0x8712('0x16'));var db=require(_0x8712('0x17'))['db'];function respondWithStatusCode(_0x5bc2bc,_0x5729fd){_0x5729fd=_0x5729fd||0xcc;return function(_0x4437d9){if(_0x4437d9){return _0x5bc2bc[_0x8712('0x18')](_0x5729fd);}return _0x5bc2bc[_0x8712('0x19')](_0x5729fd)[_0x8712('0x1a')]();};}function respondWithResult(_0x44f9fa,_0x121543){_0x121543=_0x121543||0xc8;return function(_0x12f9c5){if(_0x12f9c5){return _0x44f9fa[_0x8712('0x19')](_0x121543)['json'](_0x12f9c5);}};}function respondWithFilteredResult(_0x1e8054,_0x27dab9){return function(_0x294ff0){if(_0x294ff0){var _0x5d137f=_0x294ff0[_0x8712('0x1b')],_0x2b59e3=_0x27dab9[_0x8712('0x1c')],_0x3e24d7=_0x27dab9[_0x8712('0x1c')]+_0x27dab9[_0x8712('0x1d')],_0x35450b;if(_0x3e24d7>=_0x5d137f){_0x3e24d7=_0x5d137f;_0x35450b=0xc8;}else{_0x35450b=0xce;}_0x1e8054[_0x8712('0x19')](_0x35450b);return _0x1e8054[_0x8712('0x1e')](_0x8712('0x1f'),_0x2b59e3+'-'+_0x3e24d7+'/'+_0x5d137f)[_0x8712('0x20')](_0x294ff0);}return null;};}function patchUpdates(_0x476ff2){return function(_0x57f3b0){try{jsonpatch['apply'](_0x57f3b0,_0x476ff2,!![]);}catch(_0x4fe0c1){return BPromise['reject'](_0x4fe0c1);}return _0x57f3b0[_0x8712('0x21')]();};}function saveUpdates(_0x3434de,_0x6bd950){return function(_0x4934f6){if(_0x4934f6){return _0x4934f6['update'](_0x3434de)['then'](function(_0x34d3e1){return _0x34d3e1;});}return null;};}function removeEntity(_0x123a5f,_0x5c94ca){return function(_0x4cab69){if(_0x4cab69){return _0x4cab69['destroy']()[_0x8712('0x22')](function(){var _0xe2353e=_0x4cab69[_0x8712('0x23')]({'plain':!![]});var _0x2aa510=_0x8712('0x24');return db[_0x8712('0x25')][_0x8712('0x26')]({'where':{'type':_0x2aa510,'resourceId':_0xe2353e['id']}})[_0x8712('0x22')](function(){return _0x4cab69;});})[_0x8712('0x22')](function(){_0x123a5f['status'](0xcc)[_0x8712('0x1a')]();});}};}function handleEntityNotFound(_0x312fb0,_0x4e239f){return function(_0x2ef181){if(!_0x2ef181){_0x312fb0[_0x8712('0x18')](0x194);}return _0x2ef181;};}function handleError(_0x5030b5,_0x4070d1){_0x4070d1=_0x4070d1||0x1f4;return function(_0x1a3b8e){logger[_0x8712('0x27')](_0x1a3b8e['stack']);if(_0x1a3b8e[_0x8712('0x28')]){delete _0x1a3b8e[_0x8712('0x28')];}_0x5030b5[_0x8712('0x19')](_0x4070d1)[_0x8712('0x29')](_0x1a3b8e);};}exports[_0x8712('0x2a')]=function(_0x133137,_0xdfaf1){var _0x2172cc={},_0x5dad1c={},_0x1f2961={'count':0x0,'rows':[]};var _0x592960=_['map'](db[_0x8712('0x2b')][_0x8712('0x2c')],function(_0x1ca09a){return{'name':_0x1ca09a['fieldName'],'type':_0x1ca09a[_0x8712('0x2d')][_0x8712('0x2e')]};});_0x5dad1c['model']=_[_0x8712('0x2f')](_0x592960,'name');_0x5dad1c[_0x8712('0x30')]=_[_0x8712('0x31')](_0x133137[_0x8712('0x30')]);_0x5dad1c[_0x8712('0x32')]=_[_0x8712('0x33')](_0x5dad1c[_0x8712('0x34')],_0x5dad1c['query']);_0x2172cc[_0x8712('0x35')]=_['intersection'](_0x5dad1c[_0x8712('0x34')],qs[_0x8712('0x36')](_0x133137[_0x8712('0x30')][_0x8712('0x36')]));_0x2172cc[_0x8712('0x35')]=_0x2172cc[_0x8712('0x35')]['length']?_0x2172cc[_0x8712('0x35')]:_0x5dad1c[_0x8712('0x34')];if(!_0x133137[_0x8712('0x30')]['hasOwnProperty'](_0x8712('0x37'))){_0x2172cc[_0x8712('0x1d')]=qs[_0x8712('0x1d')](_0x133137['query'][_0x8712('0x1d')]);_0x2172cc[_0x8712('0x1c')]=qs[_0x8712('0x1c')](_0x133137[_0x8712('0x30')][_0x8712('0x1c')]);}_0x2172cc[_0x8712('0x38')]=qs['sort'](_0x133137['query'][_0x8712('0x39')]);_0x2172cc[_0x8712('0x3a')]=qs[_0x8712('0x32')](_['pick'](_0x133137[_0x8712('0x30')],_0x5dad1c[_0x8712('0x32')]));if(_0x133137['query']['filter']){_0x2172cc['where']=_[_0x8712('0x3b')](_0x2172cc[_0x8712('0x3a')],{'$or':_['map'](_0x592960,function(_0x1f731a){if(_0x1f731a[_0x8712('0x2d')]!==_0x8712('0x3c')){var _0x2c5740={};_0x2c5740[_0x1f731a[_0x8712('0x28')]]={'$like':'%'+_0x133137[_0x8712('0x30')][_0x8712('0x3d')]+'%'};return _0x2c5740;}})});}_0x2172cc=_[_0x8712('0x3b')]({},_0x2172cc,_0x133137[_0x8712('0x3e')]);var _0x285def={'where':_0x2172cc[_0x8712('0x3a')]};return db[_0x8712('0x2b')][_0x8712('0x1b')](_0x285def)[_0x8712('0x22')](function(_0x545659){_0x1f2961[_0x8712('0x1b')]=_0x545659;if(_0x133137['query']['includeAll']){_0x2172cc[_0x8712('0x3f')]=[{'all':!![]}];}return db[_0x8712('0x2b')]['findAll'](_0x2172cc);})[_0x8712('0x22')](function(_0x49b44b){_0x1f2961[_0x8712('0x40')]=_0x49b44b;return _0x1f2961;})[_0x8712('0x22')](respondWithFilteredResult(_0xdfaf1,_0x2172cc))[_0x8712('0x41')](handleError(_0xdfaf1,null));};exports[_0x8712('0x42')]=function(_0x56db50,_0x14ea06){var _0x3ddc47={'raw':!![],'where':{'id':_0x56db50[_0x8712('0x43')]['id']}},_0x13214f={};_0x13214f[_0x8712('0x34')]=_[_0x8712('0x31')](db[_0x8712('0x2b')][_0x8712('0x2c')]);_0x13214f[_0x8712('0x30')]=_[_0x8712('0x31')](_0x56db50[_0x8712('0x30')]);_0x13214f[_0x8712('0x32')]=_[_0x8712('0x33')](_0x13214f['model'],_0x13214f[_0x8712('0x30')]);_0x3ddc47[_0x8712('0x35')]=_['intersection'](_0x13214f[_0x8712('0x34')],qs[_0x8712('0x36')](_0x56db50['query'][_0x8712('0x36')]));_0x3ddc47[_0x8712('0x35')]=_0x3ddc47[_0x8712('0x35')][_0x8712('0x44')]?_0x3ddc47[_0x8712('0x35')]:_0x13214f['model'];if(_0x56db50[_0x8712('0x30')][_0x8712('0x45')]){_0x3ddc47[_0x8712('0x3f')]=[{'all':!![]}];}_0x3ddc47=_['merge']({},_0x3ddc47,_0x56db50[_0x8712('0x3e')]);return db[_0x8712('0x2b')][_0x8712('0x46')](_0x3ddc47)['then'](handleEntityNotFound(_0x14ea06,null))[_0x8712('0x22')](respondWithResult(_0x14ea06,null))[_0x8712('0x41')](handleError(_0x14ea06,null));};exports[_0x8712('0x47')]=function(_0x568e2c,_0x34b832){return db[_0x8712('0x2b')][_0x8712('0x47')](_0x568e2c[_0x8712('0x48')],{})[_0x8712('0x22')](function(_0x5a5ee9){var _0x20d515=_0x568e2c[_0x8712('0x49')][_0x8712('0x23')]({'plain':!![]});if(!_0x20d515)throw new Error(_0x8712('0x4a'));if(_0x20d515['role']===_0x8712('0x49')){var _0x368173=_0x5a5ee9[_0x8712('0x23')]({'plain':!![]});var _0x520961='ODBC';return db[_0x8712('0x4b')][_0x8712('0x46')]({'where':{'name':_0x520961,'userProfileId':_0x20d515['userProfileId']},'raw':!![]})[_0x8712('0x22')](function(_0x4007a7){if(_0x4007a7&&_0x4007a7['autoAssociation']===0x0){return db[_0x8712('0x25')][_0x8712('0x47')]({'name':_0x368173[_0x8712('0x28')],'resourceId':_0x368173['id'],'type':_0x4007a7[_0x8712('0x28')],'sectionId':_0x4007a7['id']},{})[_0x8712('0x22')](function(){return _0x5a5ee9;});}else{return _0x5a5ee9;}})[_0x8712('0x41')](function(_0x55f8ca){logger[_0x8712('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55f8ca);throw _0x55f8ca;});}return _0x5a5ee9;})[_0x8712('0x22')](respondWithResult(_0x34b832,0xc9))['catch'](handleError(_0x34b832,null));};exports['update']=function(_0x335225,_0x194494){if(_0x335225['body']['id']){delete _0x335225[_0x8712('0x48')]['id'];}return db['SquareOdbc'][_0x8712('0x46')]({'where':{'id':_0x335225['params']['id']}})[_0x8712('0x22')](handleEntityNotFound(_0x194494,null))[_0x8712('0x22')](saveUpdates(_0x335225[_0x8712('0x48')],null))[_0x8712('0x22')](respondWithResult(_0x194494,null))['catch'](handleError(_0x194494,null));};exports[_0x8712('0x26')]=function(_0xcd0698,_0x5d4670){return db[_0x8712('0x2b')][_0x8712('0x46')]({'where':{'id':_0xcd0698[_0x8712('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d4670,null))[_0x8712('0x22')](removeEntity(_0x5d4670,null))[_0x8712('0x41')](handleError(_0x5d4670,null));};exports[_0x8712('0x4c')]=function(_0x537a57,_0x3bcd2f,_0x3d89de){var _0x361617;return db[_0x8712('0x2b')][_0x8712('0x46')]({'where':{'id':_0x537a57[_0x8712('0x43')]['id']},'attributes':['id',_0x8712('0x4d')]})['then'](handleEntityNotFound(_0x3bcd2f,null))[_0x8712('0x22')](function(_0x14785b){if(_0x14785b){var _0x27db13=require('odbc')();_0x27db13['openSync'](_0x14785b[_0x8712('0x4d')]);_0x27db13['closeSync']();return _0x14785b;}})[_0x8712('0x22')](respondWithResult(_0x3bcd2f,null))[_0x8712('0x41')](handleError(_0x3bcd2f,null));}; \ No newline at end of file +var _0x0fe1=['role','ODBC','autoAssociation','dsn','odbc','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','save','update','destroy','then','get','UserProfileResource','end','error','stack','name','send','index','map','SquareOdbc','fieldName','type','key','query','keys','filters','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x20cb5d,_0x5b6ec7){var _0x33dd23=function(_0x5918a9){while(--_0x5918a9){_0x20cb5d['push'](_0x20cb5d['shift']());}};_0x33dd23(++_0x5b6ec7);}(_0x0fe1,0x19f));var _0x10fe=function(_0x3c3a4d,_0x309438){_0x3c3a4d=_0x3c3a4d-0x0;var _0x251598=_0x0fe1[_0x3c3a4d];return _0x251598;};'use strict';var pdf=require(_0x10fe('0x0'));var emlformat=require(_0x10fe('0x1'));var rimraf=require(_0x10fe('0x2'));var zipdir=require(_0x10fe('0x3'));var jsonpatch=require(_0x10fe('0x4'));var rp=require(_0x10fe('0x5'));var moment=require(_0x10fe('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x10fe('0x7'));var util=require(_0x10fe('0x8'));var path=require('path');var sox=require(_0x10fe('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x10fe('0xa'));var squel=require(_0x10fe('0xb'));var crypto=require(_0x10fe('0xc'));var jsforce=require(_0x10fe('0xd'));var deskjs=require(_0x10fe('0xe'));var toCsv=require(_0x10fe('0xf'));var querystring=require(_0x10fe('0x10'));var Papa=require(_0x10fe('0x11'));var Redis=require('ioredis');var authService=require(_0x10fe('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x10fe('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x10fe('0x14'))('api');var utils=require(_0x10fe('0x15'));var config=require(_0x10fe('0x16'));var db=require(_0x10fe('0x17'))['db'];function respondWithStatusCode(_0x2ec859,_0x5b05d1){_0x5b05d1=_0x5b05d1||0xcc;return function(_0x55b068){if(_0x55b068){return _0x2ec859[_0x10fe('0x18')](_0x5b05d1);}return _0x2ec859[_0x10fe('0x19')](_0x5b05d1)['end']();};}function respondWithResult(_0x2ee526,_0x564542){_0x564542=_0x564542||0xc8;return function(_0x132edb){if(_0x132edb){return _0x2ee526[_0x10fe('0x19')](_0x564542)[_0x10fe('0x1a')](_0x132edb);}};}function respondWithFilteredResult(_0xd49542,_0x592a17){return function(_0x58fd25){if(_0x58fd25){var _0x221d1f=_0x58fd25[_0x10fe('0x1b')],_0x4959c8=_0x592a17[_0x10fe('0x1c')],_0x434677=_0x592a17[_0x10fe('0x1c')]+_0x592a17[_0x10fe('0x1d')],_0x4bf788;if(_0x434677>=_0x221d1f){_0x434677=_0x221d1f;_0x4bf788=0xc8;}else{_0x4bf788=0xce;}_0xd49542[_0x10fe('0x19')](_0x4bf788);return _0xd49542[_0x10fe('0x1e')]('Content-Range',_0x4959c8+'-'+_0x434677+'/'+_0x221d1f)['json'](_0x58fd25);}return null;};}function patchUpdates(_0x3759e3){return function(_0x2fba34){try{jsonpatch[_0x10fe('0x1f')](_0x2fba34,_0x3759e3,!![]);}catch(_0x49b597){return BPromise['reject'](_0x49b597);}return _0x2fba34[_0x10fe('0x20')]();};}function saveUpdates(_0x43e855,_0x5a28ee){return function(_0x213184){if(_0x213184){return _0x213184[_0x10fe('0x21')](_0x43e855)['then'](function(_0x1856da){return _0x1856da;});}return null;};}function removeEntity(_0x49ceed,_0x3ecf20){return function(_0x30eb3d){if(_0x30eb3d){return _0x30eb3d[_0x10fe('0x22')]()[_0x10fe('0x23')](function(){var _0x2e1993=_0x30eb3d[_0x10fe('0x24')]({'plain':!![]});var _0x2eb4c2='ODBC';return db[_0x10fe('0x25')]['destroy']({'where':{'type':_0x2eb4c2,'resourceId':_0x2e1993['id']}})[_0x10fe('0x23')](function(){return _0x30eb3d;});})[_0x10fe('0x23')](function(){_0x49ceed[_0x10fe('0x19')](0xcc)[_0x10fe('0x26')]();});}};}function handleEntityNotFound(_0x279eb1,_0xdae5b0){return function(_0x2ccc61){if(!_0x2ccc61){_0x279eb1[_0x10fe('0x18')](0x194);}return _0x2ccc61;};}function handleError(_0x17bcdb,_0x41b61c){_0x41b61c=_0x41b61c||0x1f4;return function(_0x292fbb){logger[_0x10fe('0x27')](_0x292fbb[_0x10fe('0x28')]);if(_0x292fbb['name']){delete _0x292fbb[_0x10fe('0x29')];}_0x17bcdb[_0x10fe('0x19')](_0x41b61c)[_0x10fe('0x2a')](_0x292fbb);};}exports[_0x10fe('0x2b')]=function(_0x16fd7d,_0x19b1da){var _0x4705c0={},_0x33c82f={},_0xbbbdf0={'count':0x0,'rows':[]};var _0x60da64=_[_0x10fe('0x2c')](db[_0x10fe('0x2d')]['rawAttributes'],function(_0x3b85e8){return{'name':_0x3b85e8[_0x10fe('0x2e')],'type':_0x3b85e8[_0x10fe('0x2f')][_0x10fe('0x30')]};});_0x33c82f['model']=_['map'](_0x60da64,_0x10fe('0x29'));_0x33c82f[_0x10fe('0x31')]=_[_0x10fe('0x32')](_0x16fd7d[_0x10fe('0x31')]);_0x33c82f[_0x10fe('0x33')]=_['intersection'](_0x33c82f['model'],_0x33c82f[_0x10fe('0x31')]);_0x4705c0[_0x10fe('0x34')]=_['intersection'](_0x33c82f[_0x10fe('0x35')],qs[_0x10fe('0x36')](_0x16fd7d[_0x10fe('0x31')][_0x10fe('0x36')]));_0x4705c0[_0x10fe('0x34')]=_0x4705c0['attributes'][_0x10fe('0x37')]?_0x4705c0['attributes']:_0x33c82f[_0x10fe('0x35')];if(!_0x16fd7d[_0x10fe('0x31')][_0x10fe('0x38')](_0x10fe('0x39'))){_0x4705c0[_0x10fe('0x1d')]=qs[_0x10fe('0x1d')](_0x16fd7d[_0x10fe('0x31')][_0x10fe('0x1d')]);_0x4705c0[_0x10fe('0x1c')]=qs[_0x10fe('0x1c')](_0x16fd7d[_0x10fe('0x31')][_0x10fe('0x1c')]);}_0x4705c0['order']=qs[_0x10fe('0x3a')](_0x16fd7d['query'][_0x10fe('0x3a')]);_0x4705c0[_0x10fe('0x3b')]=qs[_0x10fe('0x33')](_[_0x10fe('0x3c')](_0x16fd7d[_0x10fe('0x31')],_0x33c82f['filters']));if(_0x16fd7d['query']['filter']){_0x4705c0[_0x10fe('0x3b')]=_[_0x10fe('0x3d')](_0x4705c0[_0x10fe('0x3b')],{'$or':_['map'](_0x60da64,function(_0x4e9f34){if(_0x4e9f34[_0x10fe('0x2f')]!=='VIRTUAL'){var _0x551be5={};_0x551be5[_0x4e9f34[_0x10fe('0x29')]]={'$like':'%'+_0x16fd7d[_0x10fe('0x31')][_0x10fe('0x3e')]+'%'};return _0x551be5;}})});}_0x4705c0=_[_0x10fe('0x3d')]({},_0x4705c0,_0x16fd7d[_0x10fe('0x3f')]);var _0x54c116={'where':_0x4705c0['where']};return db[_0x10fe('0x2d')][_0x10fe('0x1b')](_0x54c116)['then'](function(_0x11fc08){_0xbbbdf0[_0x10fe('0x1b')]=_0x11fc08;if(_0x16fd7d[_0x10fe('0x31')][_0x10fe('0x40')]){_0x4705c0[_0x10fe('0x41')]=[{'all':!![]}];}return db[_0x10fe('0x2d')][_0x10fe('0x42')](_0x4705c0);})[_0x10fe('0x23')](function(_0x47b363){_0xbbbdf0['rows']=_0x47b363;return _0xbbbdf0;})[_0x10fe('0x23')](respondWithFilteredResult(_0x19b1da,_0x4705c0))[_0x10fe('0x43')](handleError(_0x19b1da,null));};exports[_0x10fe('0x44')]=function(_0x8d9f71,_0x98c6d1){var _0x30a2d9={'raw':!![],'where':{'id':_0x8d9f71[_0x10fe('0x45')]['id']}},_0x8ef0e9={};_0x8ef0e9[_0x10fe('0x35')]=_[_0x10fe('0x32')](db[_0x10fe('0x2d')][_0x10fe('0x46')]);_0x8ef0e9[_0x10fe('0x31')]=_[_0x10fe('0x32')](_0x8d9f71['query']);_0x8ef0e9[_0x10fe('0x33')]=_[_0x10fe('0x47')](_0x8ef0e9[_0x10fe('0x35')],_0x8ef0e9[_0x10fe('0x31')]);_0x30a2d9['attributes']=_[_0x10fe('0x47')](_0x8ef0e9['model'],qs[_0x10fe('0x36')](_0x8d9f71[_0x10fe('0x31')]['fields']));_0x30a2d9[_0x10fe('0x34')]=_0x30a2d9[_0x10fe('0x34')][_0x10fe('0x37')]?_0x30a2d9[_0x10fe('0x34')]:_0x8ef0e9[_0x10fe('0x35')];if(_0x8d9f71['query'][_0x10fe('0x40')]){_0x30a2d9[_0x10fe('0x41')]=[{'all':!![]}];}_0x30a2d9=_['merge']({},_0x30a2d9,_0x8d9f71[_0x10fe('0x3f')]);return db['SquareOdbc'][_0x10fe('0x48')](_0x30a2d9)[_0x10fe('0x23')](handleEntityNotFound(_0x98c6d1,null))[_0x10fe('0x23')](respondWithResult(_0x98c6d1,null))['catch'](handleError(_0x98c6d1,null));};exports[_0x10fe('0x49')]=function(_0x6b44ad,_0x4807e5){return db[_0x10fe('0x2d')][_0x10fe('0x49')](_0x6b44ad[_0x10fe('0x4a')],{})[_0x10fe('0x23')](function(_0x19f1d1){var _0x3ca2dd=_0x6b44ad[_0x10fe('0x4b')]['get']({'plain':!![]});if(!_0x3ca2dd)throw new Error(_0x10fe('0x4c'));if(_0x3ca2dd[_0x10fe('0x4d')]===_0x10fe('0x4b')){var _0x1da034=_0x19f1d1[_0x10fe('0x24')]({'plain':!![]});var _0x2866d6=_0x10fe('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x2866d6,'userProfileId':_0x3ca2dd['userProfileId']},'raw':!![]})[_0x10fe('0x23')](function(_0x45353c){if(_0x45353c&&_0x45353c[_0x10fe('0x4f')]===0x0){return db['UserProfileResource'][_0x10fe('0x49')]({'name':_0x1da034[_0x10fe('0x29')],'resourceId':_0x1da034['id'],'type':_0x45353c[_0x10fe('0x29')],'sectionId':_0x45353c['id']},{})[_0x10fe('0x23')](function(){return _0x19f1d1;});}else{return _0x19f1d1;}})[_0x10fe('0x43')](function(_0x38b140){logger[_0x10fe('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38b140);throw _0x38b140;});}return _0x19f1d1;})[_0x10fe('0x23')](respondWithResult(_0x4807e5,0xc9))[_0x10fe('0x43')](handleError(_0x4807e5,null));};exports[_0x10fe('0x21')]=function(_0x3d7640,_0x4ba22c){if(_0x3d7640[_0x10fe('0x4a')]['id']){delete _0x3d7640[_0x10fe('0x4a')]['id'];}return db['SquareOdbc'][_0x10fe('0x48')]({'where':{'id':_0x3d7640[_0x10fe('0x45')]['id']}})[_0x10fe('0x23')](handleEntityNotFound(_0x4ba22c,null))['then'](saveUpdates(_0x3d7640['body'],null))[_0x10fe('0x23')](respondWithResult(_0x4ba22c,null))['catch'](handleError(_0x4ba22c,null));};exports[_0x10fe('0x22')]=function(_0x449f61,_0xed42){return db[_0x10fe('0x2d')][_0x10fe('0x48')]({'where':{'id':_0x449f61[_0x10fe('0x45')]['id']}})['then'](handleEntityNotFound(_0xed42,null))[_0x10fe('0x23')](removeEntity(_0xed42,null))['catch'](handleError(_0xed42,null));};exports['test']=function(_0x4c060e,_0x4d33d7,_0x1c84f9){var _0x335f59;return db['SquareOdbc'][_0x10fe('0x48')]({'where':{'id':_0x4c060e[_0x10fe('0x45')]['id']},'attributes':['id',_0x10fe('0x50')]})[_0x10fe('0x23')](handleEntityNotFound(_0x4d33d7,null))['then'](function(_0x365a23){if(_0x365a23){var _0x26e612=require(_0x10fe('0x51'))();_0x26e612['openSync'](_0x365a23['dsn']);_0x26e612['closeSync']();return _0x365a23;}})[_0x10fe('0x23')](respondWithResult(_0x4d33d7,null))[_0x10fe('0x43')](handleError(_0x4d33d7,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 3ef2d0a..4c110c8 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 _0x84ce=['SquareOdbc','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define'];(function(_0x3c2d87,_0x623ad){var _0x142d3c=function(_0x3fa5a5){while(--_0x3fa5a5){_0x3c2d87['push'](_0x3c2d87['shift']());}};_0x142d3c(++_0x623ad);}(_0x84ce,0x6d));var _0xe84c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x84ce[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe84c('0x0'));var util=require(_0xe84c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe84c('0x2'));var BPromise=require(_0xe84c('0x3'));var rp=require(_0xe84c('0x4'));var fs=require('fs');var path=require(_0xe84c('0x5'));var rimraf=require(_0xe84c('0x6'));var config=require(_0xe84c('0x7'));var attributes=require(_0xe84c('0x8'));module[_0xe84c('0x9')]=function(_0x545f08,_0x5c9b50){return _0x545f08[_0xe84c('0xa')](_0xe84c('0xb'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1f2=['SquareOdbc','square_odbc','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x13e793,_0x535caf){var _0x4c19ed=function(_0x287137){while(--_0x287137){_0x13e793['push'](_0x13e793['shift']());}};_0x4c19ed(++_0x535caf);}(_0xf1f2,0x192));var _0x2f1f=function(_0xd9f102,_0x5a0d28){_0xd9f102=_0xd9f102-0x0;var _0x2652e4=_0xf1f2[_0xd9f102];return _0x2652e4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2f1f('0x0'))(_0x2f1f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2f1f('0x2'));var fs=require('fs');var path=require(_0x2f1f('0x3'));var rimraf=require(_0x2f1f('0x4'));var config=require(_0x2f1f('0x5'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x3888cc,_0x20f42b){return _0x3888cc['define'](_0x2f1f('0x6'),attributes,{'tableName':_0x2f1f('0x7'),'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 38c47f4..7fe8295 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 _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','catch','ShowSquareOdbc','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x45321d,_0x58eb4f){var _0x1a999a=function(_0x3195c1){while(--_0x3195c1){_0x45321d['push'](_0x45321d['shift']());}};_0x1a999a(++_0x58eb4f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x5fc3[_0x213518];return _0x1baf75;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['SquareOdbc'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ No newline at end of file +var _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','catch','ShowSquareOdbc','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x240c9a,_0x100d6d){var _0xb239e9=function(_0x313bbc){while(--_0x313bbc){_0x240c9a['push'](_0x240c9a['shift']());}};_0xb239e9(++_0x100d6d);}(_0x5fc3,0xa8));var _0x35fc=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x5fc3[_0x11ce46];return _0x368a1e;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['SquareOdbc'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index ad59248..a7a80e9 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 _0x9c00=['express','Router','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','show','/:id/users','getUsers','post','create','addUsers','put','update','delete','destroy','removeUsers','exports','multer','util'];(function(_0x121b1a,_0x42fdb7){var _0x2d89a6=function(_0x1b6027){while(--_0x1b6027){_0x121b1a['push'](_0x121b1a['shift']());}};_0x2d89a6(++_0x42fdb7);}(_0x9c00,0x1a0));var _0x09c0=function(_0x36bbbb,_0x3f6709){_0x36bbbb=_0x36bbbb-0x0;var _0x3ca0eb=_0x9c00[_0x36bbbb];return _0x3ca0eb;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x09c0('0x4'));var config=require(_0x09c0('0x5'));var controller=require(_0x09c0('0x6'));router[_0x09c0('0x7')]('/',auth[_0x09c0('0x8')](),controller['index']);router['get'](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xa')]);router[_0x09c0('0x7')](_0x09c0('0xb'),auth['isAuthenticated'](),controller[_0x09c0('0xc')]);router[_0x09c0('0xd')]('/',auth[_0x09c0('0x8')](),controller[_0x09c0('0xe')]);router[_0x09c0('0xd')](_0x09c0('0xb'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xf')]);router[_0x09c0('0x10')](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0x11')]);router[_0x09c0('0x12')](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0x13')]);router[_0x09c0('0x12')](_0x09c0('0xb'),auth[_0x09c0('0x8')](),controller[_0x09c0('0x14')]);module[_0x09c0('0x15')]=router; \ No newline at end of file +var _0x9c00=['express','Router','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','show','/:id/users','getUsers','post','create','addUsers','put','update','delete','destroy','removeUsers','exports','multer','util'];(function(_0x11309c,_0xe18a74){var _0x3fea9c=function(_0xeb11c3){while(--_0xeb11c3){_0x11309c['push'](_0x11309c['shift']());}};_0x3fea9c(++_0xe18a74);}(_0x9c00,0x1a0));var _0x09c0=function(_0x5890ed,_0x5eec7c){_0x5890ed=_0x5890ed-0x0;var _0x49ef9b=_0x9c00[_0x5890ed];return _0x49ef9b;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x09c0('0x4'));var config=require(_0x09c0('0x5'));var controller=require(_0x09c0('0x6'));router[_0x09c0('0x7')]('/',auth[_0x09c0('0x8')](),controller['index']);router['get'](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xa')]);router[_0x09c0('0x7')](_0x09c0('0xb'),auth['isAuthenticated'](),controller[_0x09c0('0xc')]);router[_0x09c0('0xd')]('/',auth[_0x09c0('0x8')](),controller[_0x09c0('0xe')]);router[_0x09c0('0xd')](_0x09c0('0xb'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xf')]);router[_0x09c0('0x10')](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0x11')]);router[_0x09c0('0x12')](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0x13')]);router[_0x09c0('0x12')](_0x09c0('0xb'),auth[_0x09c0('0x8')](),controller[_0x09c0('0x14')]);module[_0x09c0('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 78c7d5a..19a51fa 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 _0x9c12=['exports','STRING','name','BLOB','long','getDataValue','preproduction','toString','utf8','production','sequelize'];(function(_0x1e2f7a,_0x34579d){var _0x49ad3d=function(_0x3489b1){while(--_0x3489b1){_0x1e2f7a['push'](_0x1e2f7a['shift']());}};_0x49ad3d(++_0x34579d);}(_0x9c12,0x107));var _0x29c1=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x9c12[_0x580647];return _0x5f0792;};'use strict';var Sequelize=require(_0x29c1('0x0'));module[_0x29c1('0x1')]={'name':{'type':Sequelize[_0x29c1('0x2')],'unique':_0x29c1('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x29c1('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x29c1('0x4')](_0x29c1('0x5')),'get':function(){if(this[_0x29c1('0x6')](_0x29c1('0x7'))){return this[_0x29c1('0x6')](_0x29c1('0x7'))[_0x29c1('0x8')](_0x29c1('0x9'));}}},'production':{'type':Sequelize[_0x29c1('0x4')](_0x29c1('0x5')),'get':function(){if(this[_0x29c1('0x6')](_0x29c1('0xa'))){return this[_0x29c1('0x6')](_0x29c1('0xa'))[_0x29c1('0x8')](_0x29c1('0x9'));}}}}; \ No newline at end of file +var _0x25ad=['sequelize','exports','STRING','TEXT','BLOB','long','preproduction','getDataValue','toString','production','utf8'];(function(_0x409335,_0x201165){var _0x47d3b6=function(_0x42b1b2){while(--_0x42b1b2){_0x409335['push'](_0x409335['shift']());}};_0x47d3b6(++_0x201165);}(_0x25ad,0x84));var _0xd25a=function(_0x5adb18,_0x222326){_0x5adb18=_0x5adb18-0x0;var _0x420c98=_0x25ad[_0x5adb18];return _0x420c98;};'use strict';var Sequelize=require(_0xd25a('0x0'));module[_0xd25a('0x1')]={'name':{'type':Sequelize[_0xd25a('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xd25a('0x2')]},'notes':{'type':Sequelize[_0xd25a('0x3')]},'preproduction':{'type':Sequelize[_0xd25a('0x4')](_0xd25a('0x5')),'get':function(){if(this['getDataValue'](_0xd25a('0x6'))){return this[_0xd25a('0x7')](_0xd25a('0x6'))[_0xd25a('0x8')]('utf8');}}},'production':{'type':Sequelize[_0xd25a('0x4')](_0xd25a('0x5')),'get':function(){if(this[_0xd25a('0x7')](_0xd25a('0x9'))){return this[_0xd25a('0x7')](_0xd25a('0x9'))[_0xd25a('0x8')](_0xd25a('0xa'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 7c69b8e..a882be2 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 _0x1cc7=['ioredis','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','redis','./squareProject.socket','register','sendStatus','status','end','count','offset','set','Content-Range','json','apply','save','update','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareProject','includeAll','include','findAll','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','html-pdf','eml-format','rimraf','moment','bluebird','mustache','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2453d0,_0x1b2017){var _0x521fc8=function(_0xfc824f){while(--_0xfc824f){_0x2453d0['push'](_0x2453d0['shift']());}};_0x521fc8(++_0x1b2017);}(_0x1cc7,0x15a));var _0x71cc=function(_0x183b84,_0x955498){_0x183b84=_0x183b84-0x0;var _0x1cb02b=_0x1cc7[_0x183b84];return _0x1cb02b;};'use strict';var pdf=require(_0x71cc('0x0'));var emlformat=require(_0x71cc('0x1'));var rimraf=require(_0x71cc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x71cc('0x3'));var BPromise=require(_0x71cc('0x4'));var Mustache=require(_0x71cc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x71cc('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x71cc('0x7'));var squel=require(_0x71cc('0x8'));var crypto=require(_0x71cc('0x9'));var jsforce=require(_0x71cc('0xa'));var deskjs=require(_0x71cc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x71cc('0xc'));var Papa=require(_0x71cc('0xd'));var Redis=require(_0x71cc('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x71cc('0xf'))(_0x71cc('0x10'));var utils=require(_0x71cc('0x11'));var config=require('../../config/environment');var db=require(_0x71cc('0x12'))['db'];config['redis']=_[_0x71cc('0x13')](config['redis'],{'host':_0x71cc('0x14'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x71cc('0x15')]));require(_0x71cc('0x16'))[_0x71cc('0x17')](socket);function respondWithStatusCode(_0xd16032,_0x33070e){_0x33070e=_0x33070e||0xcc;return function(_0x540200){if(_0x540200){return _0xd16032[_0x71cc('0x18')](_0x33070e);}return _0xd16032[_0x71cc('0x19')](_0x33070e)[_0x71cc('0x1a')]();};}function respondWithResult(_0x14d5ab,_0x3875b8){_0x3875b8=_0x3875b8||0xc8;return function(_0x14087c){if(_0x14087c){return _0x14d5ab[_0x71cc('0x19')](_0x3875b8)['json'](_0x14087c);}};}function respondWithFilteredResult(_0xf3c790,_0x14788d){return function(_0x1a7d71){if(_0x1a7d71){var _0x1d1da8=_0x1a7d71[_0x71cc('0x1b')],_0x1067be=_0x14788d[_0x71cc('0x1c')],_0x10da0a=_0x14788d['offset']+_0x14788d['limit'],_0x4c5c6d;if(_0x10da0a>=_0x1d1da8){_0x10da0a=_0x1d1da8;_0x4c5c6d=0xc8;}else{_0x4c5c6d=0xce;}_0xf3c790[_0x71cc('0x19')](_0x4c5c6d);return _0xf3c790[_0x71cc('0x1d')](_0x71cc('0x1e'),_0x1067be+'-'+_0x10da0a+'/'+_0x1d1da8)[_0x71cc('0x1f')](_0x1a7d71);}return null;};}function patchUpdates(_0x258d30){return function(_0xccbfb){try{jsonpatch[_0x71cc('0x20')](_0xccbfb,_0x258d30,!![]);}catch(_0x18683d){return BPromise['reject'](_0x18683d);}return _0xccbfb[_0x71cc('0x21')]();};}function saveUpdates(_0x109239,_0x587a0b){return function(_0x2bee90){if(_0x2bee90){return _0x2bee90[_0x71cc('0x22')](_0x109239)[_0x71cc('0x23')](function(_0x1a9b4f){return _0x1a9b4f;});}return null;};}function removeEntity(_0x1bc67c,_0x887399){return function(_0x4a0abc){if(_0x4a0abc){return _0x4a0abc[_0x71cc('0x24')]()[_0x71cc('0x23')](function(){var _0x446580=_0x4a0abc[_0x71cc('0x25')]({'plain':!![]});var _0x36367b=_0x71cc('0x26');return db[_0x71cc('0x27')][_0x71cc('0x24')]({'where':{'type':_0x36367b,'resourceId':_0x446580['id']}})[_0x71cc('0x23')](function(){return _0x4a0abc;});})['then'](function(){_0x1bc67c[_0x71cc('0x19')](0xcc)[_0x71cc('0x1a')]();});}};}function handleEntityNotFound(_0x28e095,_0x26becf){return function(_0x20b093){if(!_0x20b093){_0x28e095[_0x71cc('0x18')](0x194);}return _0x20b093;};}function handleError(_0x16fc33,_0x9a7ca3){_0x9a7ca3=_0x9a7ca3||0x1f4;return function(_0x3cc813){logger[_0x71cc('0x28')](_0x3cc813[_0x71cc('0x29')]);if(_0x3cc813[_0x71cc('0x2a')]){delete _0x3cc813[_0x71cc('0x2a')];}_0x16fc33[_0x71cc('0x19')](_0x9a7ca3)[_0x71cc('0x2b')](_0x3cc813);};}exports[_0x71cc('0x2c')]=function(_0x4fa63e,_0x3054ff){var _0x3b7451={},_0x34c6bc={},_0x184a51={'count':0x0,'rows':[]};var _0x11d0bc=_[_0x71cc('0x2d')](db['SquareProject'][_0x71cc('0x2e')],function(_0x11bd4e){return{'name':_0x11bd4e[_0x71cc('0x2f')],'type':_0x11bd4e[_0x71cc('0x30')][_0x71cc('0x31')]};});_0x34c6bc[_0x71cc('0x32')]=_[_0x71cc('0x2d')](_0x11d0bc,'name');_0x34c6bc[_0x71cc('0x33')]=_['keys'](_0x4fa63e['query']);_0x34c6bc[_0x71cc('0x34')]=_['intersection'](_0x34c6bc['model'],_0x34c6bc[_0x71cc('0x33')]);_0x3b7451['attributes']=_[_0x71cc('0x35')](_0x34c6bc['model'],qs[_0x71cc('0x36')](_0x4fa63e[_0x71cc('0x33')]['fields']));_0x3b7451[_0x71cc('0x37')]=_0x3b7451[_0x71cc('0x37')][_0x71cc('0x38')]?_0x3b7451[_0x71cc('0x37')]:_0x34c6bc[_0x71cc('0x32')];if(!_0x4fa63e[_0x71cc('0x33')][_0x71cc('0x39')](_0x71cc('0x3a'))){_0x3b7451[_0x71cc('0x3b')]=qs[_0x71cc('0x3b')](_0x4fa63e['query'][_0x71cc('0x3b')]);_0x3b7451['offset']=qs[_0x71cc('0x1c')](_0x4fa63e[_0x71cc('0x33')][_0x71cc('0x1c')]);}_0x3b7451[_0x71cc('0x3c')]=qs[_0x71cc('0x3d')](_0x4fa63e[_0x71cc('0x33')]['sort']);_0x3b7451[_0x71cc('0x3e')]=qs['filters'](_[_0x71cc('0x3f')](_0x4fa63e[_0x71cc('0x33')],_0x34c6bc[_0x71cc('0x34')]));if(_0x4fa63e['query'][_0x71cc('0x40')]){_0x3b7451['where']=_[_0x71cc('0x41')](_0x3b7451[_0x71cc('0x3e')],{'$or':_[_0x71cc('0x2d')](_0x11d0bc,function(_0x92389){if(_0x92389[_0x71cc('0x30')]!==_0x71cc('0x42')){var _0x104aee={};_0x104aee[_0x92389[_0x71cc('0x2a')]]={'$like':'%'+_0x4fa63e[_0x71cc('0x33')][_0x71cc('0x40')]+'%'};return _0x104aee;}})});}_0x3b7451=_[_0x71cc('0x41')]({},_0x3b7451,_0x4fa63e[_0x71cc('0x43')]);var _0x4f0bb0={'where':_0x3b7451[_0x71cc('0x3e')]};return db[_0x71cc('0x44')]['count'](_0x4f0bb0)['then'](function(_0x463cdd){_0x184a51[_0x71cc('0x1b')]=_0x463cdd;if(_0x4fa63e['query'][_0x71cc('0x45')]){_0x3b7451[_0x71cc('0x46')]=[{'all':!![]}];}return db[_0x71cc('0x44')][_0x71cc('0x47')](_0x3b7451);})[_0x71cc('0x23')](function(_0x5b3a38){_0x184a51['rows']=_0x5b3a38;return _0x184a51;})['then'](respondWithFilteredResult(_0x3054ff,_0x3b7451))[_0x71cc('0x48')](handleError(_0x3054ff,null));};exports['show']=function(_0x3bd7d0,_0x38ef60){var _0x70cd0e={'raw':![],'where':{'id':_0x3bd7d0[_0x71cc('0x49')]['id']}},_0x218558={};_0x218558[_0x71cc('0x32')]=_[_0x71cc('0x4a')](db[_0x71cc('0x44')][_0x71cc('0x2e')]);_0x218558[_0x71cc('0x33')]=_[_0x71cc('0x4a')](_0x3bd7d0[_0x71cc('0x33')]);_0x218558[_0x71cc('0x34')]=_['intersection'](_0x218558[_0x71cc('0x32')],_0x218558[_0x71cc('0x33')]);_0x70cd0e[_0x71cc('0x37')]=_['intersection'](_0x218558[_0x71cc('0x32')],qs[_0x71cc('0x36')](_0x3bd7d0[_0x71cc('0x33')][_0x71cc('0x36')]));_0x70cd0e[_0x71cc('0x37')]=_0x70cd0e[_0x71cc('0x37')][_0x71cc('0x38')]?_0x70cd0e[_0x71cc('0x37')]:_0x218558[_0x71cc('0x32')];if(_0x3bd7d0[_0x71cc('0x33')][_0x71cc('0x45')]){_0x70cd0e[_0x71cc('0x46')]=[{'all':!![]}];}_0x70cd0e=_['merge']({},_0x70cd0e,_0x3bd7d0[_0x71cc('0x43')]);return db[_0x71cc('0x44')][_0x71cc('0x4b')](_0x70cd0e)[_0x71cc('0x23')](handleEntityNotFound(_0x38ef60,null))[_0x71cc('0x23')](respondWithResult(_0x38ef60,null))[_0x71cc('0x48')](handleError(_0x38ef60,null));};exports[_0x71cc('0x4c')]=function(_0x51cd49,_0x108e3f){return db[_0x71cc('0x44')]['create'](_0x51cd49[_0x71cc('0x4d')],{})[_0x71cc('0x23')](function(_0x1bda7f){var _0xe6b3db=_0x51cd49[_0x71cc('0x4e')][_0x71cc('0x25')]({'plain':!![]});if(!_0xe6b3db)throw new Error(_0x71cc('0x4f'));if(_0xe6b3db[_0x71cc('0x50')]===_0x71cc('0x4e')){var _0x1647ce=_0x1bda7f[_0x71cc('0x25')]({'plain':!![]});var _0x580c21=_0x71cc('0x26');return db['UserProfileSection'][_0x71cc('0x4b')]({'where':{'name':_0x580c21,'userProfileId':_0xe6b3db['userProfileId']},'raw':!![]})[_0x71cc('0x23')](function(_0x36c71e){if(_0x36c71e&&_0x36c71e['autoAssociation']===0x0){return db[_0x71cc('0x27')][_0x71cc('0x4c')]({'name':_0x1647ce['name'],'resourceId':_0x1647ce['id'],'type':_0x36c71e[_0x71cc('0x2a')],'sectionId':_0x36c71e['id']},{})[_0x71cc('0x23')](function(){return _0x1bda7f;});}else{return _0x1bda7f;}})[_0x71cc('0x48')](function(_0x1f0673){logger[_0x71cc('0x28')](_0x71cc('0x51'),_0x1f0673);throw _0x1f0673;});}return _0x1bda7f;})[_0x71cc('0x23')](respondWithResult(_0x108e3f,0xc9))['catch'](handleError(_0x108e3f,null));};exports[_0x71cc('0x22')]=function(_0xdc11f2,_0x570f87){if(_0xdc11f2['body']['id']){delete _0xdc11f2[_0x71cc('0x4d')]['id'];}return db[_0x71cc('0x44')]['find']({'where':{'id':_0xdc11f2[_0x71cc('0x49')]['id']}})[_0x71cc('0x23')](handleEntityNotFound(_0x570f87,null))[_0x71cc('0x23')](saveUpdates(_0xdc11f2[_0x71cc('0x4d')],null))[_0x71cc('0x23')](respondWithResult(_0x570f87,null))[_0x71cc('0x48')](handleError(_0x570f87,null));};exports['destroy']=function(_0x49cd24,_0x211dbf){return db['SquareProject']['find']({'where':{'id':_0x49cd24[_0x71cc('0x49')]['id']}})['then'](handleEntityNotFound(_0x211dbf,null))['then'](removeEntity(_0x211dbf,null))['catch'](handleError(_0x211dbf,null));};exports['addUsers']=function(_0x572c62,_0x32999d,_0x4b5587){return db['SquareProject'][_0x71cc('0x4b')]({'where':{'id':_0x572c62[_0x71cc('0x49')]['id']}})[_0x71cc('0x23')](handleEntityNotFound(_0x32999d,null))[_0x71cc('0x23')](function(_0x2b108e){if(_0x2b108e){return _0x2b108e[_0x71cc('0x52')](_0x572c62['body']['ids'],_['omit'](_0x572c62[_0x71cc('0x4d')],[_0x71cc('0x53'),'id'])||{});}})[_0x71cc('0x23')](respondWithResult(_0x32999d,null))[_0x71cc('0x48')](handleError(_0x32999d,null));};exports[_0x71cc('0x54')]=function(_0x5b1560,_0xcd78b5,_0xca3919){return db['SquareProject']['find']({'where':{'id':_0x5b1560[_0x71cc('0x49')]['id']}})[_0x71cc('0x23')](handleEntityNotFound(_0xcd78b5,null))['then'](function(_0x5484c9){if(_0x5484c9){return _0x5484c9[_0x71cc('0x54')](_0x5b1560['query']['ids'])[_0x71cc('0x23')](function(){if(_[_0x71cc('0x55')](_0x5b1560[_0x71cc('0x33')]['ids'])){for(var _0x35e963=0x0;_0x35e963<_0x5b1560[_0x71cc('0x33')][_0x71cc('0x53')]['length'];_0x35e963+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x5b1560[_0x71cc('0x33')][_0x71cc('0x53')][_0x35e963]),'SquareProjectId':Number(_0x5b1560[_0x71cc('0x49')]['id'])});}}else{socket[_0x71cc('0x56')](_0x71cc('0x57'),{'UserId':Number(_0x5b1560[_0x71cc('0x33')]['ids']),'SquareProjectId':Number(_0x5b1560['params']['id'])});}});}})[_0x71cc('0x23')](respondWithStatusCode(_0xcd78b5,null))[_0x71cc('0x48')](handleError(_0xcd78b5,null));};exports[_0x71cc('0x58')]=function(_0x1c60f0,_0x355f28,_0x22b8ac){var _0x1f8649={};var _0x220b8f={};var _0x471cb7;var _0x17ecd1;return db['SquareProject']['findOne']({'where':{'id':_0x1c60f0[_0x71cc('0x49')]['id']}})[_0x71cc('0x23')](handleEntityNotFound(_0x355f28,null))[_0x71cc('0x23')](function(_0x2d05b5){if(_0x2d05b5){_0x471cb7=_0x2d05b5;_0x220b8f[_0x71cc('0x32')]=_[_0x71cc('0x4a')](db[_0x71cc('0x59')][_0x71cc('0x2e')]);_0x220b8f[_0x71cc('0x33')]=_['keys'](_0x1c60f0[_0x71cc('0x33')]);_0x220b8f[_0x71cc('0x34')]=_[_0x71cc('0x35')](_0x220b8f[_0x71cc('0x32')],_0x220b8f['query']);_0x1f8649['attributes']=_[_0x71cc('0x35')](_0x220b8f[_0x71cc('0x32')],qs[_0x71cc('0x36')](_0x1c60f0[_0x71cc('0x33')][_0x71cc('0x36')]));_0x1f8649['attributes']=_0x1f8649['attributes'][_0x71cc('0x38')]?_0x1f8649[_0x71cc('0x37')]:_0x220b8f['model'];_0x1f8649[_0x71cc('0x3c')]=qs[_0x71cc('0x3d')](_0x1c60f0[_0x71cc('0x33')][_0x71cc('0x3d')]);_0x1f8649['where']=qs['filters'](_['pick'](_0x1c60f0[_0x71cc('0x33')],_0x220b8f[_0x71cc('0x34')]));if(_0x1c60f0[_0x71cc('0x33')][_0x71cc('0x40')]){_0x1f8649[_0x71cc('0x3e')]=_[_0x71cc('0x41')](_0x1f8649[_0x71cc('0x3e')],{'$or':_[_0x71cc('0x2d')](_0x1f8649[_0x71cc('0x37')],function(_0x2248d5){var _0x53bf3c={};_0x53bf3c[_0x2248d5]={'$like':'%'+_0x1c60f0[_0x71cc('0x33')][_0x71cc('0x40')]+'%'};return _0x53bf3c;})});}_0x1f8649=_[_0x71cc('0x41')]({},_0x1f8649,_0x1c60f0[_0x71cc('0x43')]);return _0x471cb7['getUsers'](_0x1f8649);}})['then'](function(_0x434475){if(_0x434475){_0x17ecd1=_0x434475[_0x71cc('0x38')];if(!_0x1c60f0[_0x71cc('0x33')][_0x71cc('0x39')](_0x71cc('0x3a'))){_0x1f8649[_0x71cc('0x3b')]=qs['limit'](_0x1c60f0[_0x71cc('0x33')][_0x71cc('0x3b')]);_0x1f8649['offset']=qs['offset'](_0x1c60f0[_0x71cc('0x33')][_0x71cc('0x1c')]);}return _0x471cb7[_0x71cc('0x58')](_0x1f8649);}})[_0x71cc('0x23')](function(_0x48d807){if(_0x48d807){return _0x48d807?{'count':_0x17ecd1,'rows':_0x48d807}:null;}})['then'](respondWithResult(_0x355f28,null))['catch'](handleError(_0x355f28,null));}; \ No newline at end of file +var _0x6324=['sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','SquareProject','findAll','rows','catch','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','emit','getUsers','findOne','order','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./squareProject.socket','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','end','error','stack','name','index','map','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3a6e4b,_0x118cd9){var _0x36572d=function(_0x2a53cf){while(--_0x2a53cf){_0x3a6e4b['push'](_0x3a6e4b['shift']());}};_0x36572d(++_0x118cd9);}(_0x6324,0x142));var _0x4632=function(_0x24529e,_0x20b864){_0x24529e=_0x24529e-0x0;var _0x4f37ba=_0x6324[_0x24529e];return _0x4f37ba;};'use strict';var pdf=require(_0x4632('0x0'));var emlformat=require(_0x4632('0x1'));var rimraf=require(_0x4632('0x2'));var zipdir=require(_0x4632('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4632('0x4'));var moment=require('moment');var BPromise=require(_0x4632('0x5'));var Mustache=require('mustache');var util=require(_0x4632('0x6'));var path=require('path');var sox=require(_0x4632('0x7'));var csv=require(_0x4632('0x8'));var ejs=require(_0x4632('0x9'));var fs=require('fs');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 db=require(_0x4632('0x17'))['db'];config['redis']=_[_0x4632('0x18')](config['redis'],{'host':_0x4632('0x19'),'port':0x18eb});var socket=require(_0x4632('0x1a'))(new Redis(config[_0x4632('0x1b')]));require(_0x4632('0x1c'))['register'](socket);function respondWithStatusCode(_0x3ba361,_0x255882){_0x255882=_0x255882||0xcc;return function(_0x3b9901){if(_0x3b9901){return _0x3ba361[_0x4632('0x1d')](_0x255882);}return _0x3ba361[_0x4632('0x1e')](_0x255882)['end']();};}function respondWithResult(_0x47b349,_0x2fd7ae){_0x2fd7ae=_0x2fd7ae||0xc8;return function(_0x38bedd){if(_0x38bedd){return _0x47b349[_0x4632('0x1e')](_0x2fd7ae)[_0x4632('0x1f')](_0x38bedd);}};}function respondWithFilteredResult(_0x48fbb1,_0x158831){return function(_0x113872){if(_0x113872){var _0x1a94c0=_0x113872['count'],_0x5b28b7=_0x158831['offset'],_0x3cddfa=_0x158831[_0x4632('0x20')]+_0x158831[_0x4632('0x21')],_0x1894bb;if(_0x3cddfa>=_0x1a94c0){_0x3cddfa=_0x1a94c0;_0x1894bb=0xc8;}else{_0x1894bb=0xce;}_0x48fbb1[_0x4632('0x1e')](_0x1894bb);return _0x48fbb1[_0x4632('0x22')](_0x4632('0x23'),_0x5b28b7+'-'+_0x3cddfa+'/'+_0x1a94c0)[_0x4632('0x1f')](_0x113872);}return null;};}function patchUpdates(_0x9ab826){return function(_0x468ccb){try{jsonpatch[_0x4632('0x24')](_0x468ccb,_0x9ab826,!![]);}catch(_0x3ea0d1){return BPromise[_0x4632('0x25')](_0x3ea0d1);}return _0x468ccb[_0x4632('0x26')]();};}function saveUpdates(_0x2ca6a5,_0x263907){return function(_0x4cfebc){if(_0x4cfebc){return _0x4cfebc[_0x4632('0x27')](_0x2ca6a5)[_0x4632('0x28')](function(_0x3537ed){return _0x3537ed;});}return null;};}function removeEntity(_0x380a9f,_0x1e1b86){return function(_0x38cbbc){if(_0x38cbbc){return _0x38cbbc[_0x4632('0x29')]()[_0x4632('0x28')](function(){var _0x259c75=_0x38cbbc[_0x4632('0x2a')]({'plain':!![]});var _0x1b8de0=_0x4632('0x2b');return db[_0x4632('0x2c')][_0x4632('0x29')]({'where':{'type':_0x1b8de0,'resourceId':_0x259c75['id']}})[_0x4632('0x28')](function(){return _0x38cbbc;});})[_0x4632('0x28')](function(){_0x380a9f[_0x4632('0x1e')](0xcc)[_0x4632('0x2d')]();});}};}function handleEntityNotFound(_0x4d9098,_0x57798a){return function(_0x466126){if(!_0x466126){_0x4d9098[_0x4632('0x1d')](0x194);}return _0x466126;};}function handleError(_0x2f6656,_0x35a533){_0x35a533=_0x35a533||0x1f4;return function(_0x34079f){logger[_0x4632('0x2e')](_0x34079f[_0x4632('0x2f')]);if(_0x34079f['name']){delete _0x34079f[_0x4632('0x30')];}_0x2f6656[_0x4632('0x1e')](_0x35a533)['send'](_0x34079f);};}exports[_0x4632('0x31')]=function(_0x5316f7,_0x6599ad){var _0x4cb661={},_0x4fda35={},_0x1973eb={'count':0x0,'rows':[]};var _0x1cd26a=_[_0x4632('0x32')](db['SquareProject']['rawAttributes'],function(_0x395f4e){return{'name':_0x395f4e[_0x4632('0x33')],'type':_0x395f4e['type']['key']};});_0x4fda35[_0x4632('0x34')]=_[_0x4632('0x32')](_0x1cd26a,'name');_0x4fda35[_0x4632('0x35')]=_[_0x4632('0x36')](_0x5316f7[_0x4632('0x35')]);_0x4fda35[_0x4632('0x37')]=_[_0x4632('0x38')](_0x4fda35['model'],_0x4fda35[_0x4632('0x35')]);_0x4cb661[_0x4632('0x39')]=_['intersection'](_0x4fda35['model'],qs[_0x4632('0x3a')](_0x5316f7['query']['fields']));_0x4cb661[_0x4632('0x39')]=_0x4cb661['attributes'][_0x4632('0x3b')]?_0x4cb661[_0x4632('0x39')]:_0x4fda35[_0x4632('0x34')];if(!_0x5316f7['query'][_0x4632('0x3c')](_0x4632('0x3d'))){_0x4cb661[_0x4632('0x21')]=qs[_0x4632('0x21')](_0x5316f7[_0x4632('0x35')]['limit']);_0x4cb661['offset']=qs[_0x4632('0x20')](_0x5316f7[_0x4632('0x35')][_0x4632('0x20')]);}_0x4cb661['order']=qs['sort'](_0x5316f7['query'][_0x4632('0x3e')]);_0x4cb661[_0x4632('0x3f')]=qs['filters'](_[_0x4632('0x40')](_0x5316f7[_0x4632('0x35')],_0x4fda35[_0x4632('0x37')]));if(_0x5316f7[_0x4632('0x35')][_0x4632('0x41')]){_0x4cb661[_0x4632('0x3f')]=_[_0x4632('0x42')](_0x4cb661[_0x4632('0x3f')],{'$or':_[_0x4632('0x32')](_0x1cd26a,function(_0x2c04a8){if(_0x2c04a8[_0x4632('0x43')]!==_0x4632('0x44')){var _0x47f206={};_0x47f206[_0x2c04a8[_0x4632('0x30')]]={'$like':'%'+_0x5316f7[_0x4632('0x35')]['filter']+'%'};return _0x47f206;}})});}_0x4cb661=_[_0x4632('0x42')]({},_0x4cb661,_0x5316f7[_0x4632('0x45')]);var _0x596d55={'where':_0x4cb661[_0x4632('0x3f')]};return db['SquareProject'][_0x4632('0x46')](_0x596d55)[_0x4632('0x28')](function(_0x1bfb36){_0x1973eb[_0x4632('0x46')]=_0x1bfb36;if(_0x5316f7['query'][_0x4632('0x47')]){_0x4cb661[_0x4632('0x48')]=[{'all':!![]}];}return db[_0x4632('0x49')][_0x4632('0x4a')](_0x4cb661);})['then'](function(_0x5b3fa9){_0x1973eb[_0x4632('0x4b')]=_0x5b3fa9;return _0x1973eb;})[_0x4632('0x28')](respondWithFilteredResult(_0x6599ad,_0x4cb661))[_0x4632('0x4c')](handleError(_0x6599ad,null));};exports['show']=function(_0x330f21,_0x1467c8){var _0x66598d={'raw':![],'where':{'id':_0x330f21[_0x4632('0x4d')]['id']}},_0xf4acf3={};_0xf4acf3[_0x4632('0x34')]=_[_0x4632('0x36')](db['SquareProject'][_0x4632('0x4e')]);_0xf4acf3[_0x4632('0x35')]=_[_0x4632('0x36')](_0x330f21[_0x4632('0x35')]);_0xf4acf3[_0x4632('0x37')]=_['intersection'](_0xf4acf3['model'],_0xf4acf3[_0x4632('0x35')]);_0x66598d[_0x4632('0x39')]=_[_0x4632('0x38')](_0xf4acf3[_0x4632('0x34')],qs['fields'](_0x330f21[_0x4632('0x35')][_0x4632('0x3a')]));_0x66598d[_0x4632('0x39')]=_0x66598d[_0x4632('0x39')][_0x4632('0x3b')]?_0x66598d['attributes']:_0xf4acf3[_0x4632('0x34')];if(_0x330f21[_0x4632('0x35')][_0x4632('0x47')]){_0x66598d[_0x4632('0x48')]=[{'all':!![]}];}_0x66598d=_[_0x4632('0x42')]({},_0x66598d,_0x330f21[_0x4632('0x45')]);return db[_0x4632('0x49')][_0x4632('0x4f')](_0x66598d)[_0x4632('0x28')](handleEntityNotFound(_0x1467c8,null))[_0x4632('0x28')](respondWithResult(_0x1467c8,null))[_0x4632('0x4c')](handleError(_0x1467c8,null));};exports['create']=function(_0xc3ffd0,_0x1ccadb){return db[_0x4632('0x49')]['create'](_0xc3ffd0[_0x4632('0x50')],{})[_0x4632('0x28')](function(_0x1309aa){var _0x2db3c8=_0xc3ffd0[_0x4632('0x51')][_0x4632('0x2a')]({'plain':!![]});if(!_0x2db3c8)throw new Error(_0x4632('0x52'));if(_0x2db3c8[_0x4632('0x53')]===_0x4632('0x51')){var _0x1aa831=_0x1309aa['get']({'plain':!![]});var _0x35afe5=_0x4632('0x2b');return db['UserProfileSection'][_0x4632('0x4f')]({'where':{'name':_0x35afe5,'userProfileId':_0x2db3c8[_0x4632('0x54')]},'raw':!![]})[_0x4632('0x28')](function(_0x28e7fb){if(_0x28e7fb&&_0x28e7fb[_0x4632('0x55')]===0x0){return db[_0x4632('0x2c')][_0x4632('0x56')]({'name':_0x1aa831[_0x4632('0x30')],'resourceId':_0x1aa831['id'],'type':_0x28e7fb[_0x4632('0x30')],'sectionId':_0x28e7fb['id']},{})[_0x4632('0x28')](function(){return _0x1309aa;});}else{return _0x1309aa;}})[_0x4632('0x4c')](function(_0x2a50f7){logger[_0x4632('0x2e')](_0x4632('0x57'),_0x2a50f7);throw _0x2a50f7;});}return _0x1309aa;})[_0x4632('0x28')](respondWithResult(_0x1ccadb,0xc9))[_0x4632('0x4c')](handleError(_0x1ccadb,null));};exports[_0x4632('0x27')]=function(_0x6c2864,_0xb1456b){if(_0x6c2864[_0x4632('0x50')]['id']){delete _0x6c2864['body']['id'];}return db[_0x4632('0x49')][_0x4632('0x4f')]({'where':{'id':_0x6c2864[_0x4632('0x4d')]['id']}})[_0x4632('0x28')](handleEntityNotFound(_0xb1456b,null))[_0x4632('0x28')](saveUpdates(_0x6c2864[_0x4632('0x50')],null))['then'](respondWithResult(_0xb1456b,null))[_0x4632('0x4c')](handleError(_0xb1456b,null));};exports[_0x4632('0x29')]=function(_0x41409d,_0x5877b9){return db[_0x4632('0x49')][_0x4632('0x4f')]({'where':{'id':_0x41409d['params']['id']}})[_0x4632('0x28')](handleEntityNotFound(_0x5877b9,null))[_0x4632('0x28')](removeEntity(_0x5877b9,null))[_0x4632('0x4c')](handleError(_0x5877b9,null));};exports['addUsers']=function(_0x3aeefd,_0x334a8e,_0x2551ca){return db[_0x4632('0x49')][_0x4632('0x4f')]({'where':{'id':_0x3aeefd[_0x4632('0x4d')]['id']}})[_0x4632('0x28')](handleEntityNotFound(_0x334a8e,null))[_0x4632('0x28')](function(_0x2965df){if(_0x2965df){return _0x2965df[_0x4632('0x58')](_0x3aeefd['body'][_0x4632('0x59')],_[_0x4632('0x5a')](_0x3aeefd['body'],[_0x4632('0x59'),'id'])||{});}})['then'](respondWithResult(_0x334a8e,null))['catch'](handleError(_0x334a8e,null));};exports[_0x4632('0x5b')]=function(_0x1b9540,_0x2451ba,_0xd89124){return db[_0x4632('0x49')][_0x4632('0x4f')]({'where':{'id':_0x1b9540[_0x4632('0x4d')]['id']}})[_0x4632('0x28')](handleEntityNotFound(_0x2451ba,null))[_0x4632('0x28')](function(_0x2eacee){if(_0x2eacee){return _0x2eacee[_0x4632('0x5b')](_0x1b9540[_0x4632('0x35')][_0x4632('0x59')])[_0x4632('0x28')](function(){if(_['isArray'](_0x1b9540['query'][_0x4632('0x59')])){for(var _0x313dcd=0x0;_0x313dcd<_0x1b9540[_0x4632('0x35')][_0x4632('0x59')][_0x4632('0x3b')];_0x313dcd+=0x1){socket[_0x4632('0x5c')]('userSquareProject:remove',{'UserId':Number(_0x1b9540[_0x4632('0x35')][_0x4632('0x59')][_0x313dcd]),'SquareProjectId':Number(_0x1b9540[_0x4632('0x4d')]['id'])});}}else{socket[_0x4632('0x5c')]('userSquareProject:remove',{'UserId':Number(_0x1b9540['query'][_0x4632('0x59')]),'SquareProjectId':Number(_0x1b9540['params']['id'])});}});}})[_0x4632('0x28')](respondWithStatusCode(_0x2451ba,null))[_0x4632('0x4c')](handleError(_0x2451ba,null));};exports[_0x4632('0x5d')]=function(_0x35143e,_0xc5515f,_0x5e5669){var _0x61aa92={};var _0x1cd108={};var _0x57670c;var _0x57bca2;return db[_0x4632('0x49')][_0x4632('0x5e')]({'where':{'id':_0x35143e[_0x4632('0x4d')]['id']}})[_0x4632('0x28')](handleEntityNotFound(_0xc5515f,null))['then'](function(_0x5a2cc1){if(_0x5a2cc1){_0x57670c=_0x5a2cc1;_0x1cd108['model']=_[_0x4632('0x36')](db['User'][_0x4632('0x4e')]);_0x1cd108[_0x4632('0x35')]=_[_0x4632('0x36')](_0x35143e[_0x4632('0x35')]);_0x1cd108[_0x4632('0x37')]=_[_0x4632('0x38')](_0x1cd108[_0x4632('0x34')],_0x1cd108[_0x4632('0x35')]);_0x61aa92[_0x4632('0x39')]=_[_0x4632('0x38')](_0x1cd108[_0x4632('0x34')],qs[_0x4632('0x3a')](_0x35143e[_0x4632('0x35')][_0x4632('0x3a')]));_0x61aa92[_0x4632('0x39')]=_0x61aa92[_0x4632('0x39')]['length']?_0x61aa92[_0x4632('0x39')]:_0x1cd108[_0x4632('0x34')];_0x61aa92[_0x4632('0x5f')]=qs[_0x4632('0x3e')](_0x35143e[_0x4632('0x35')][_0x4632('0x3e')]);_0x61aa92[_0x4632('0x3f')]=qs[_0x4632('0x37')](_[_0x4632('0x40')](_0x35143e[_0x4632('0x35')],_0x1cd108[_0x4632('0x37')]));if(_0x35143e[_0x4632('0x35')][_0x4632('0x41')]){_0x61aa92['where']=_[_0x4632('0x42')](_0x61aa92[_0x4632('0x3f')],{'$or':_[_0x4632('0x32')](_0x61aa92[_0x4632('0x39')],function(_0x3ddaab){var _0x335e9d={};_0x335e9d[_0x3ddaab]={'$like':'%'+_0x35143e['query'][_0x4632('0x41')]+'%'};return _0x335e9d;})});}_0x61aa92=_[_0x4632('0x42')]({},_0x61aa92,_0x35143e['options']);return _0x57670c[_0x4632('0x5d')](_0x61aa92);}})[_0x4632('0x28')](function(_0x879c8){if(_0x879c8){_0x57bca2=_0x879c8[_0x4632('0x3b')];if(!_0x35143e[_0x4632('0x35')]['hasOwnProperty'](_0x4632('0x3d'))){_0x61aa92[_0x4632('0x21')]=qs[_0x4632('0x21')](_0x35143e['query'][_0x4632('0x21')]);_0x61aa92[_0x4632('0x20')]=qs[_0x4632('0x20')](_0x35143e[_0x4632('0x35')][_0x4632('0x20')]);}return _0x57670c[_0x4632('0x5d')](_0x61aa92);}})[_0x4632('0x28')](function(_0x295b86){if(_0x295b86){return _0x295b86?{'count':_0x57bca2,'rows':_0x295b86}:null;}})['then'](respondWithResult(_0xc5515f,null))[_0x4632('0x4c')](handleError(_0xc5515f,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index acd8adb..a8be83a 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 _0xfd7f=['../../mysqldb','SquareProject','emit','hasOwnProperty','hook','exports'];(function(_0x5af709,_0x1481ca){var _0x190c50=function(_0x2bb2fb){while(--_0x2bb2fb){_0x5af709['push'](_0x5af709['shift']());}};_0x190c50(++_0x1481ca);}(_0xfd7f,0xba));var _0xffd7=function(_0x3cd975,_0x23f21f){_0x3cd975=_0x3cd975-0x0;var _0x579111=_0xfd7f[_0x3cd975];return _0x579111;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xffd7('0x0'))['db'][_0xffd7('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1c1c19){return function(_0x25ace8,_0x250571,_0x172f17){SquareProjectEvents[_0xffd7('0x2')](_0x1c1c19+':'+_0x25ace8['id'],_0x25ace8);SquareProjectEvents[_0xffd7('0x2')](_0x1c1c19,_0x25ace8);_0x172f17(null);};}for(var e in events){if(events[_0xffd7('0x3')](e)){var event=events[e];SquareProject[_0xffd7('0x4')](e,emitEvent(event));}}module[_0xffd7('0x5')]=SquareProjectEvents; \ No newline at end of file +var _0x37f5=['emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x2dd849,_0x3bd1bf){var _0x38ba4e=function(_0xd89ddc){while(--_0xd89ddc){_0x2dd849['push'](_0x2dd849['shift']());}};_0x38ba4e(++_0x3bd1bf);}(_0x37f5,0x7b));var _0x537f=function(_0x39d0ff,_0x1f59e3){_0x39d0ff=_0x39d0ff-0x0;var _0x29d57c=_0x37f5[_0x39d0ff];return _0x29d57c;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x537f('0x0'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x537f('0x1')](0x0);var events={'afterCreate':_0x537f('0x2'),'afterUpdate':_0x537f('0x3'),'afterDestroy':_0x537f('0x4')};function emitEvent(_0x762044){return function(_0x4f2430,_0x576cb0,_0x2c8778){SquareProjectEvents[_0x537f('0x5')](_0x762044+':'+_0x4f2430['id'],_0x4f2430);SquareProjectEvents[_0x537f('0x5')](_0x762044,_0x4f2430);_0x2c8778(null);};}for(var e in events){if(events[_0x537f('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x537f('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index d4e6290..bfab681 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 _0x2f52=['SquareProject','square_projects','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','define'];(function(_0x4e8a59,_0x32bc84){var _0x22ba3e=function(_0x187e2f){while(--_0x187e2f){_0x4e8a59['push'](_0x4e8a59['shift']());}};_0x22ba3e(++_0x32bc84);}(_0x2f52,0x1a6));var _0x22f5=function(_0x5837a4,_0x15c0f7){_0x5837a4=_0x5837a4-0x0;var _0x1feb62=_0x2f52[_0x5837a4];return _0x1feb62;};'use strict';var _=require(_0x22f5('0x0'));var util=require(_0x22f5('0x1'));var logger=require('../../config/logger')(_0x22f5('0x2'));var moment=require('moment');var BPromise=require(_0x22f5('0x3'));var rp=require(_0x22f5('0x4'));var fs=require('fs');var path=require(_0x22f5('0x5'));var rimraf=require(_0x22f5('0x6'));var config=require(_0x22f5('0x7'));var attributes=require(_0x22f5('0x8'));module['exports']=function(_0xc4a3ef,_0x50924c){return _0xc4a3ef[_0x22f5('0x9')](_0x22f5('0xa'),attributes,{'tableName':_0x22f5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee69=['request-promise','path','../../config/environment','./squareProject.attributes','define','square_projects','lodash','util','../../config/logger','moment'];(function(_0x15d19a,_0x4d6dfe){var _0x1bb9d5=function(_0x5a3a3c){while(--_0x5a3a3c){_0x15d19a['push'](_0x15d19a['shift']());}};_0x1bb9d5(++_0x4d6dfe);}(_0xee69,0x1f0));var _0x9ee6=function(_0x32db46,_0x329a3b){_0x32db46=_0x32db46-0x0;var _0x194438=_0xee69[_0x32db46];return _0x194438;};'use strict';var _=require(_0x9ee6('0x0'));var util=require(_0x9ee6('0x1'));var logger=require(_0x9ee6('0x2'))('api');var moment=require(_0x9ee6('0x3'));var BPromise=require('bluebird');var rp=require(_0x9ee6('0x4'));var fs=require('fs');var path=require(_0x9ee6('0x5'));var rimraf=require('rimraf');var config=require(_0x9ee6('0x6'));var attributes=require(_0x9ee6('0x7'));module['exports']=function(_0x5898a2,_0x317c87){return _0x5898a2[_0x9ee6('0x8')]('SquareProject',attributes,{'tableName':_0x9ee6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index d1780a5..8e40c22 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 _0xf2e5=['request\x20sent','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','include','map','model','attributes','debug','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf2e5,0x184));var _0x5f2e=function(_0x1f1feb,_0x5782e1){_0x1f1feb=_0x1f1feb-0x0;var _0x43ca65=_0xf2e5[_0x1f1feb];return _0x43ca65;};'use strict';var _=require('lodash');var util=require(_0x5f2e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5f2e('0x1'));var fs=require('fs');var Redis=require(_0x5f2e('0x2'));var db=require(_0x5f2e('0x3'))['db'];var utils=require(_0x5f2e('0x4'));var logger=require('../../config/logger')(_0x5f2e('0x5'));var config=require(_0x5f2e('0x6'));var jayson=require(_0x5f2e('0x7'));var client=jayson[_0x5f2e('0x8')][_0x5f2e('0x9')]({'port':0x232a});config[_0x5f2e('0xa')]=_[_0x5f2e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5f2e('0xc'))(new Redis(config['redis']));require(_0x5f2e('0xd'))[_0x5f2e('0xe')](socket);function respondWithRpcPromise(_0x4df9f3,_0x4cb6fa,_0x5a5272){return new BPromise(function(_0x29378d,_0x1c666d){return client[_0x5f2e('0xf')](_0x4df9f3,_0x5a5272)[_0x5f2e('0x10')](function(_0x5cb575){logger[_0x5f2e('0x11')](_0x5f2e('0x12'),_0x4cb6fa,_0x5f2e('0x13'));logger['debug']('SquareProject,\x20%s,\x20%s,\x20%s',_0x4cb6fa,_0x5f2e('0x13'),JSON[_0x5f2e('0x14')](_0x5cb575));if(_0x5cb575[_0x5f2e('0x15')]){if(_0x5cb575[_0x5f2e('0x15')][_0x5f2e('0x16')]===0x1f4){logger[_0x5f2e('0x15')](_0x5f2e('0x12'),_0x4cb6fa,_0x5cb575[_0x5f2e('0x15')][_0x5f2e('0x17')]);return _0x1c666d(_0x5cb575['error'][_0x5f2e('0x17')]);}logger[_0x5f2e('0x15')]('SquareProject,\x20%s,\x20%s',_0x4cb6fa,_0x5cb575[_0x5f2e('0x15')]['message']);return _0x29378d(_0x5cb575['error']['message']);}else{logger[_0x5f2e('0x11')](_0x5f2e('0x12'),_0x4cb6fa,'request\x20sent');_0x29378d(_0x5cb575[_0x5f2e('0x18')][_0x5f2e('0x17')]);}})[_0x5f2e('0x19')](function(_0x38ce5f){logger[_0x5f2e('0x15')](_0x5f2e('0x12'),_0x4cb6fa,_0x38ce5f);_0x1c666d(_0x38ce5f);});});}exports[_0x5f2e('0x1a')]=function(_0x49a7e6){var _0x10a804=this;return new Promise(function(_0x67908b,_0x162597){return db[_0x5f2e('0x1b')][_0x5f2e('0x1c')]({'raw':_0x49a7e6['options']?_0x49a7e6[_0x5f2e('0x1d')][_0x5f2e('0x1e')]===undefined?!![]:![]:!![],'where':_0x49a7e6[_0x5f2e('0x1d')]?_0x49a7e6[_0x5f2e('0x1d')][_0x5f2e('0x1f')]||null:null,'attributes':_0x49a7e6[_0x5f2e('0x1d')]?_0x49a7e6[_0x5f2e('0x1d')]['attributes']||null:null,'include':_0x49a7e6[_0x5f2e('0x1d')]?_0x49a7e6[_0x5f2e('0x1d')][_0x5f2e('0x20')]?_[_0x5f2e('0x21')](_0x49a7e6[_0x5f2e('0x1d')][_0x5f2e('0x20')],function(_0x262c62){return{'model':db[_0x262c62[_0x5f2e('0x22')]],'as':_0x262c62['as'],'attributes':_0x262c62['attributes'],'include':_0x262c62[_0x5f2e('0x20')]?_[_0x5f2e('0x21')](_0x262c62[_0x5f2e('0x20')],function(_0x403312){return{'model':db[_0x403312[_0x5f2e('0x22')]],'as':_0x403312['as'],'attributes':_0x403312[_0x5f2e('0x23')],'include':_0x403312[_0x5f2e('0x20')]?_[_0x5f2e('0x21')](_0x403312[_0x5f2e('0x20')],function(_0x3c0544){return{'model':db[_0x3c0544[_0x5f2e('0x22')]],'as':_0x3c0544['as'],'attributes':_0x3c0544[_0x5f2e('0x23')]};}):[]};}):[]};}):[]:[]})[_0x5f2e('0x10')](function(_0x113be1){logger[_0x5f2e('0x11')](_0x5f2e('0x1a'),_0x49a7e6);logger[_0x5f2e('0x24')]('ShowSquareProject',_0x49a7e6,JSON['stringify'](_0x113be1));_0x67908b(_0x113be1);})['catch'](function(_0x1c26d7){logger[_0x5f2e('0x15')](_0x5f2e('0x1a'),_0x1c26d7[_0x5f2e('0x17')],_0x49a7e6);_0x162597(_0x10a804['error'](0x1f4,_0x1c26d7[_0x5f2e('0x17')]));});});}; \ No newline at end of file +var _0x8070=['where','attributes','include','map','model','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSquareProject','SquareProject','find','options','raw'];(function(_0x5549c4,_0x2a7249){var _0xd8d7b1=function(_0x395c1c){while(--_0x395c1c){_0x5549c4['push'](_0x5549c4['shift']());}};_0xd8d7b1(++_0x2a7249);}(_0x8070,0x178));var _0x0807=function(_0x1e2223,_0x1e9e41){_0x1e2223=_0x1e2223-0x0;var _0x6fa1bb=_0x8070[_0x1e2223];return _0x6fa1bb;};'use strict';var _=require(_0x0807('0x0'));var util=require(_0x0807('0x1'));var moment=require('moment');var BPromise=require(_0x0807('0x2'));var rs=require(_0x0807('0x3'));var fs=require('fs');var Redis=require(_0x0807('0x4'));var db=require(_0x0807('0x5'))['db'];var utils=require(_0x0807('0x6'));var logger=require(_0x0807('0x7'))(_0x0807('0x8'));var config=require('../../config/environment');var jayson=require(_0x0807('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x0807('0xa')]=_[_0x0807('0xb')](config[_0x0807('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0807('0xa')]));require(_0x0807('0xc'))[_0x0807('0xd')](socket);function respondWithRpcPromise(_0xd5fde4,_0x534dab,_0x134dee){return new BPromise(function(_0x57202f,_0x2f1fbd){return client[_0x0807('0xe')](_0xd5fde4,_0x134dee)[_0x0807('0xf')](function(_0x1ee7a0){logger[_0x0807('0x10')](_0x0807('0x11'),_0x534dab,_0x0807('0x12'));logger[_0x0807('0x13')](_0x0807('0x14'),_0x534dab,_0x0807('0x12'),JSON[_0x0807('0x15')](_0x1ee7a0));if(_0x1ee7a0['error']){if(_0x1ee7a0[_0x0807('0x16')][_0x0807('0x17')]===0x1f4){logger['error'](_0x0807('0x11'),_0x534dab,_0x1ee7a0[_0x0807('0x16')][_0x0807('0x18')]);return _0x2f1fbd(_0x1ee7a0['error'][_0x0807('0x18')]);}logger[_0x0807('0x16')](_0x0807('0x11'),_0x534dab,_0x1ee7a0[_0x0807('0x16')]['message']);return _0x57202f(_0x1ee7a0[_0x0807('0x16')][_0x0807('0x18')]);}else{logger[_0x0807('0x10')](_0x0807('0x11'),_0x534dab,_0x0807('0x12'));_0x57202f(_0x1ee7a0[_0x0807('0x19')][_0x0807('0x18')]);}})['catch'](function(_0x26c1d1){logger[_0x0807('0x16')](_0x0807('0x11'),_0x534dab,_0x26c1d1);_0x2f1fbd(_0x26c1d1);});});}exports[_0x0807('0x1a')]=function(_0x31d284){var _0x465947=this;return new Promise(function(_0x1ac750,_0x4f6451){return db[_0x0807('0x1b')][_0x0807('0x1c')]({'raw':_0x31d284[_0x0807('0x1d')]?_0x31d284[_0x0807('0x1d')][_0x0807('0x1e')]===undefined?!![]:![]:!![],'where':_0x31d284[_0x0807('0x1d')]?_0x31d284[_0x0807('0x1d')][_0x0807('0x1f')]||null:null,'attributes':_0x31d284[_0x0807('0x1d')]?_0x31d284[_0x0807('0x1d')][_0x0807('0x20')]||null:null,'include':_0x31d284[_0x0807('0x1d')]?_0x31d284[_0x0807('0x1d')][_0x0807('0x21')]?_[_0x0807('0x22')](_0x31d284[_0x0807('0x1d')]['include'],function(_0x227fed){return{'model':db[_0x227fed['model']],'as':_0x227fed['as'],'attributes':_0x227fed[_0x0807('0x20')],'include':_0x227fed[_0x0807('0x21')]?_[_0x0807('0x22')](_0x227fed['include'],function(_0x48a26e){return{'model':db[_0x48a26e[_0x0807('0x23')]],'as':_0x48a26e['as'],'attributes':_0x48a26e[_0x0807('0x20')],'include':_0x48a26e[_0x0807('0x21')]?_[_0x0807('0x22')](_0x48a26e['include'],function(_0x4f4d5a){return{'model':db[_0x4f4d5a[_0x0807('0x23')]],'as':_0x4f4d5a['as'],'attributes':_0x4f4d5a['attributes']};}):[]};}):[]};}):[]:[]})[_0x0807('0xf')](function(_0x5e47cd){logger[_0x0807('0x10')](_0x0807('0x1a'),_0x31d284);logger[_0x0807('0x13')](_0x0807('0x1a'),_0x31d284,JSON[_0x0807('0x15')](_0x5e47cd));_0x1ac750(_0x5e47cd);})[_0x0807('0x24')](function(_0x4025b1){logger[_0x0807('0x16')](_0x0807('0x1a'),_0x4025b1['message'],_0x31d284);_0x4f6451(_0x465947[_0x0807('0x16')](0x1f4,_0x4025b1[_0x0807('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 4fa323d..76dead9 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 _0x1261=['save','remove','update','emit','removeListener','squareProject:'];(function(_0x2b9b25,_0x34ef02){var _0xb3715a=function(_0x10ba9a){while(--_0x10ba9a){_0x2b9b25['push'](_0x2b9b25['shift']());}};_0xb3715a(++_0x34ef02);}(_0x1261,0x144));var _0x1126=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x1261[_0x1b6c6d];return _0x290d9d;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){SquareProjectEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);SquareProjectEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file +var _0x187d=['./squareProject.events','remove','update','emit','removeListener','length','squareProject:'];(function(_0xd6a479,_0x1817cc){var _0x2a86d9=function(_0x617468){while(--_0x617468){_0xd6a479['push'](_0xd6a479['shift']());}};_0x2a86d9(++_0x1817cc);}(_0x187d,0x93));var _0xd187=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x187d[_0xf0bcac];return _0x4e4c65;};'use strict';var SquareProjectEvents=require(_0xd187('0x0'));var events=['save',_0xd187('0x1'),_0xd187('0x2')];function createListener(_0x44d5f6,_0x1cb41f){return function(_0x18498b){_0x1cb41f[_0xd187('0x3')](_0x44d5f6,_0x18498b);};}function removeListener(_0x58622a,_0x28fa0b){return function(){SquareProjectEvents[_0xd187('0x4')](_0x58622a,_0x28fa0b);};}exports['register']=function(_0x1d2533){for(var _0x58ee7=0x0,_0x444a60=events[_0xd187('0x5')];_0x58ee7<_0x444a60;_0x58ee7++){var _0x28ce2f=events[_0x58ee7];var _0x2d6992=createListener(_0xd187('0x6')+_0x28ce2f,_0x1d2533);SquareProjectEvents['on'](_0x28ce2f,_0x2d6992);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 66ddcbb..d5372c4 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 _0xb10b=['../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x52991d,_0x429d72){var _0x5b9004=function(_0x4bfe0d){while(--_0x4bfe0d){_0x52991d['push'](_0x52991d['shift']());}};_0x5b9004(++_0x429d72);}(_0xb10b,0x12a));var _0xbb10=function(_0x45b190,_0x6297da){_0x45b190=_0x45b190-0x0;var _0x46234d=_0xb10b[_0x45b190];return _0x46234d;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['put']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router[_0xbb10('0x11')]('/:id/delete',auth[_0xbb10('0x9')](),controller['destroy']);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0x5f66=['delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','isAuthenticated','index','show','get','/:id/download','download','create','put','/:id'];(function(_0x4eafed,_0x26e2bc){var _0x159c85=function(_0x6f129f){while(--_0x6f129f){_0x4eafed['push'](_0x4eafed['shift']());}};_0x159c85(++_0x26e2bc);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/:id',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xf'),auth[_0x65f6('0x7')](),controller['update']);router[_0x65f6('0x10')]('/:id/delete',auth['isAuthenticated'](),controller[_0x65f6('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 9966eb5..dcb422e 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 _0xfa0d=['sequelize','exports','STRING'];(function(_0x5e211f,_0x20bd5e){var _0x177bd4=function(_0x5b6e6e){while(--_0x5b6e6e){_0x5e211f['push'](_0x5e211f['shift']());}};_0x177bd4(++_0x20bd5e);}(_0xfa0d,0x147));var _0xdfa0=function(_0x3b52b0,_0x1a5396){_0x3b52b0=_0x3b52b0-0x0;var _0x394b57=_0xfa0d[_0x3b52b0];return _0x394b57;};'use strict';var Sequelize=require(_0xdfa0('0x0'));module[_0xdfa0('0x1')]={'uniqueid':{'type':Sequelize[_0xdfa0('0x2')]},'callerid':{'type':Sequelize[_0xdfa0('0x2')]},'calleridname':{'type':Sequelize[_0xdfa0('0x2')]},'context':{'type':Sequelize[_0xdfa0('0x2')]},'extension':{'type':Sequelize[_0xdfa0('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xdfa0('0x2')]},'saveName':{'type':Sequelize[_0xdfa0('0x2')]},'filename':{'type':Sequelize[_0xdfa0('0x2')]},'savePath':{'type':Sequelize[_0xdfa0('0x2')]}}; \ No newline at end of file +var _0x8833=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8833,0x150));var _0x3883=function(_0x5f805d,_0x117347){_0x5f805d=_0x5f805d-0x0;var _0x1e0b41=_0x8833[_0x5f805d];return _0x1e0b41;};'use strict';var Sequelize=require(_0x3883('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3883('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x3883('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3883('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x3883('0x1')]},'saveName':{'type':Sequelize[_0x3883('0x1')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x3883('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 94392e3..3f39a81 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 _0x5895=['rows','params','includeAll','merge','catch','create','body','find','download','uniqueid','savePath','filename','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','extname','unlink','message','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','offset','status','set','json','apply','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','options','SquareRecording','count','include','findAll'];(function(_0x45de10,_0x59f7f9){var _0x3c4712=function(_0x2ae990){while(--_0x2ae990){_0x45de10['push'](_0x45de10['shift']());}};_0x3c4712(++_0x59f7f9);}(_0x5895,0x1a7));var _0x5589=function(_0x1888fb,_0x5bed73){_0x1888fb=_0x1888fb-0x0;var _0x1fa159=_0x5895[_0x1888fb];return _0x1fa159;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5589('0x0'));var rimraf=require(_0x5589('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5589('0x2'));var moment=require(_0x5589('0x3'));var BPromise=require(_0x5589('0x4'));var Mustache=require(_0x5589('0x5'));var util=require(_0x5589('0x6'));var path=require(_0x5589('0x7'));var sox=require(_0x5589('0x8'));var csv=require(_0x5589('0x9'));var ejs=require(_0x5589('0xa'));var fs=require('fs');var _=require(_0x5589('0xb'));var squel=require(_0x5589('0xc'));var crypto=require(_0x5589('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5589('0xe'));var toCsv=require(_0x5589('0x9'));var querystring=require('querystring');var Papa=require(_0x5589('0xf'));var Redis=require(_0x5589('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5589('0x11'));var as=require(_0x5589('0x12'));var hardwareService=require(_0x5589('0x13'));var logger=require(_0x5589('0x14'))(_0x5589('0x15'));var utils=require(_0x5589('0x16'));var config=require('../../config/environment');var db=require(_0x5589('0x17'))['db'];function respondWithStatusCode(_0xab5dc1,_0x24955e){_0x24955e=_0x24955e||0xcc;return function(_0x515044){if(_0x515044){return _0xab5dc1[_0x5589('0x18')](_0x24955e);}return _0xab5dc1['status'](_0x24955e)[_0x5589('0x19')]();};}function respondWithResult(_0x3f58b3,_0x541b9f){_0x541b9f=_0x541b9f||0xc8;return function(_0x1e0dc2){if(_0x1e0dc2){return _0x3f58b3['status'](_0x541b9f)['json'](_0x1e0dc2);}};}function respondWithFilteredResult(_0x114042,_0x217701){return function(_0x17cb63){if(_0x17cb63){var _0x41e430=_0x17cb63['count'],_0x31bd42=_0x217701['offset'],_0x208d85=_0x217701[_0x5589('0x1a')]+_0x217701['limit'],_0x39144e;if(_0x208d85>=_0x41e430){_0x208d85=_0x41e430;_0x39144e=0xc8;}else{_0x39144e=0xce;}_0x114042[_0x5589('0x1b')](_0x39144e);return _0x114042[_0x5589('0x1c')]('Content-Range',_0x31bd42+'-'+_0x208d85+'/'+_0x41e430)[_0x5589('0x1d')](_0x17cb63);}return null;};}function patchUpdates(_0x1b4dbc){return function(_0x5cf481){try{jsonpatch[_0x5589('0x1e')](_0x5cf481,_0x1b4dbc,!![]);}catch(_0x16972c){return BPromise['reject'](_0x16972c);}return _0x5cf481[_0x5589('0x1f')]();};}function saveUpdates(_0x2d0043,_0x5e4a8e){return function(_0x4c2ea1){if(_0x4c2ea1){return _0x4c2ea1[_0x5589('0x20')](_0x2d0043)['then'](function(_0x56a61a){return _0x56a61a;});}return null;};}function removeEntity(_0x6ae227,_0x1767ea){return function(_0x53cc63){if(_0x53cc63){return _0x53cc63[_0x5589('0x21')]()[_0x5589('0x22')](function(){_0x6ae227['status'](0xcc)[_0x5589('0x19')]();});}};}function handleEntityNotFound(_0x12e37a,_0x514967){return function(_0x4ddc3e){if(!_0x4ddc3e){_0x12e37a[_0x5589('0x18')](0x194);}return _0x4ddc3e;};}function handleError(_0x33218c,_0x3953b8){_0x3953b8=_0x3953b8||0x1f4;return function(_0x2d96e9){logger[_0x5589('0x23')](_0x2d96e9[_0x5589('0x24')]);if(_0x2d96e9[_0x5589('0x25')]){delete _0x2d96e9['name'];}_0x33218c[_0x5589('0x1b')](_0x3953b8)[_0x5589('0x26')](_0x2d96e9);};}exports[_0x5589('0x27')]=function(_0x1918f0,_0x3b33ce){var _0x4dc3ab={},_0x5a288d={},_0x73f354={'count':0x0,'rows':[]};var _0x45cb01=_['map'](db['SquareRecording'][_0x5589('0x28')],function(_0x4c10ec){return{'name':_0x4c10ec[_0x5589('0x29')],'type':_0x4c10ec[_0x5589('0x2a')][_0x5589('0x2b')]};});_0x5a288d[_0x5589('0x2c')]=_[_0x5589('0x2d')](_0x45cb01,_0x5589('0x25'));_0x5a288d[_0x5589('0x2e')]=_[_0x5589('0x2f')](_0x1918f0[_0x5589('0x2e')]);_0x5a288d[_0x5589('0x30')]=_[_0x5589('0x31')](_0x5a288d[_0x5589('0x2c')],_0x5a288d[_0x5589('0x2e')]);_0x4dc3ab[_0x5589('0x32')]=_[_0x5589('0x31')](_0x5a288d[_0x5589('0x2c')],qs[_0x5589('0x33')](_0x1918f0[_0x5589('0x2e')]['fields']));_0x4dc3ab[_0x5589('0x32')]=_0x4dc3ab[_0x5589('0x32')][_0x5589('0x34')]?_0x4dc3ab[_0x5589('0x32')]:_0x5a288d[_0x5589('0x2c')];if(!_0x1918f0[_0x5589('0x2e')][_0x5589('0x35')](_0x5589('0x36'))){_0x4dc3ab[_0x5589('0x37')]=qs[_0x5589('0x37')](_0x1918f0[_0x5589('0x2e')][_0x5589('0x37')]);_0x4dc3ab[_0x5589('0x1a')]=qs[_0x5589('0x1a')](_0x1918f0['query'][_0x5589('0x1a')]);}_0x4dc3ab[_0x5589('0x38')]=qs[_0x5589('0x39')](_0x1918f0['query'][_0x5589('0x39')]);_0x4dc3ab[_0x5589('0x3a')]=qs['filters'](_[_0x5589('0x3b')](_0x1918f0[_0x5589('0x2e')],_0x5a288d[_0x5589('0x30')]));if(_0x1918f0[_0x5589('0x2e')]['filter']){_0x4dc3ab[_0x5589('0x3a')]=_['merge'](_0x4dc3ab[_0x5589('0x3a')],{'$or':_[_0x5589('0x2d')](_0x45cb01,function(_0x18d292){if(_0x18d292[_0x5589('0x2a')]!==_0x5589('0x3c')){var _0x5a66cd={};_0x5a66cd[_0x18d292[_0x5589('0x25')]]={'$like':'%'+_0x1918f0[_0x5589('0x2e')][_0x5589('0x3d')]+'%'};return _0x5a66cd;}})});}_0x4dc3ab=_['merge']({},_0x4dc3ab,_0x1918f0[_0x5589('0x3e')]);var _0x1208dc={'where':_0x4dc3ab[_0x5589('0x3a')]};return db[_0x5589('0x3f')][_0x5589('0x40')](_0x1208dc)[_0x5589('0x22')](function(_0x4bb721){_0x73f354[_0x5589('0x40')]=_0x4bb721;if(_0x1918f0[_0x5589('0x2e')]['includeAll']){_0x4dc3ab[_0x5589('0x41')]=[{'all':!![]}];}return db['SquareRecording'][_0x5589('0x42')](_0x4dc3ab);})[_0x5589('0x22')](function(_0x4dd4e4){_0x73f354[_0x5589('0x43')]=_0x4dd4e4;return _0x73f354;})[_0x5589('0x22')](respondWithFilteredResult(_0x3b33ce,_0x4dc3ab))['catch'](handleError(_0x3b33ce,null));};exports['show']=function(_0x430f71,_0x4a4652){var _0x1d91fc={'raw':!![],'where':{'id':_0x430f71[_0x5589('0x44')]['id']}},_0x3a383d={};_0x3a383d['model']=_[_0x5589('0x2f')](db[_0x5589('0x3f')][_0x5589('0x28')]);_0x3a383d['query']=_[_0x5589('0x2f')](_0x430f71['query']);_0x3a383d[_0x5589('0x30')]=_[_0x5589('0x31')](_0x3a383d['model'],_0x3a383d['query']);_0x1d91fc[_0x5589('0x32')]=_[_0x5589('0x31')](_0x3a383d[_0x5589('0x2c')],qs[_0x5589('0x33')](_0x430f71[_0x5589('0x2e')]['fields']));_0x1d91fc[_0x5589('0x32')]=_0x1d91fc[_0x5589('0x32')][_0x5589('0x34')]?_0x1d91fc['attributes']:_0x3a383d[_0x5589('0x2c')];if(_0x430f71['query'][_0x5589('0x45')]){_0x1d91fc[_0x5589('0x41')]=[{'all':!![]}];}_0x1d91fc=_[_0x5589('0x46')]({},_0x1d91fc,_0x430f71[_0x5589('0x3e')]);return db[_0x5589('0x3f')]['find'](_0x1d91fc)[_0x5589('0x22')](handleEntityNotFound(_0x4a4652,null))[_0x5589('0x22')](respondWithResult(_0x4a4652,null))[_0x5589('0x47')](handleError(_0x4a4652,null));};exports[_0x5589('0x48')]=function(_0x55be85,_0x39b517){return db[_0x5589('0x3f')][_0x5589('0x48')](_0x55be85[_0x5589('0x49')],{})[_0x5589('0x22')](respondWithResult(_0x39b517,0xc9))[_0x5589('0x47')](handleError(_0x39b517,null));};exports[_0x5589('0x20')]=function(_0x169c23,_0x3cafc1){if(_0x169c23[_0x5589('0x49')]['id']){delete _0x169c23['body']['id'];}return db[_0x5589('0x3f')][_0x5589('0x4a')]({'where':{'id':_0x169c23['params']['id']}})[_0x5589('0x22')](handleEntityNotFound(_0x3cafc1,null))[_0x5589('0x22')](saveUpdates(_0x169c23[_0x5589('0x49')],null))['then'](respondWithResult(_0x3cafc1,null))[_0x5589('0x47')](handleError(_0x3cafc1,null));};exports[_0x5589('0x4b')]=function(_0x40ceb1,_0xc45f59,_0x4168d8){var _0x1be8ba=require('../../components/encryptor');var _0xa97b7c=![];var _0x1680e4={};if(_0x40ceb1['query'][_0x5589('0x2a')]&&_0x40ceb1[_0x5589('0x2e')][_0x5589('0x2a')]===_0x5589('0x4c')){_0x1680e4[_0x5589('0x4c')]=_0x40ceb1['params']['id'];}else{_0x1680e4['id']=_0x40ceb1[_0x5589('0x44')]['id'];}return db[_0x5589('0x3f')][_0x5589('0x4a')]({'where':_0x1680e4,'attributes':['id',_0x5589('0x4d'),_0x5589('0x4e')],'raw':!![]})[_0x5589('0x22')](handleEntityNotFound(_0xc45f59,null))[_0x5589('0x22')](function(_0x34b42e){if(_0x34b42e){var _0x595508=_0x34b42e['savePath'];var _0x128f90=util['format'](_0x5589('0x4f'),_0x595508);if(fs[_0x5589('0x50')](_0x128f90)){_0xa97b7c=!![];return _0x1be8ba[_0x5589('0x51')](_0x128f90,_0x595508,config[_0x5589('0x52')][_0x5589('0x53')])['then'](function(){return _0x34b42e;});}return _0x34b42e;}})[_0x5589('0x22')](function(_0x2a5251){if(_0x2a5251){var _0x10f997=_0x2a5251[_0x5589('0x4d')];if(!fs[_0x5589('0x50')](_0x10f997)){throw new db[(_0x5589('0x54'))][(_0x5589('0x55'))]('SquareRecording\x20not\x20found');}if(_0x2a5251['filename']){return _0xc45f59['download'](_0x10f997,_0x2a5251[_0x5589('0x4e')]+path[_0x5589('0x56')](_0x10f997),function(){if(_0xa97b7c){fs[_0x5589('0x57')](_0x10f997);}});}else{return _0xc45f59[_0x5589('0x4b')](_0x10f997,function(_0x468854){if(_0xa97b7c){fs[_0x5589('0x57')](_0x10f997);}});}}})[_0x5589('0x47')](function(_0x141ce){if(_0x141ce[_0x5589('0x58')]==='SquareRecording\x20not\x20found'){_0xc45f59[_0x5589('0x1b')](0x194)[_0x5589('0x26')](_0x5589('0x59'));}else{return handleError(_0xc45f59,null);}});};exports[_0x5589('0x21')]=function(_0x394119,_0x4e03f3){return db[_0x5589('0x3f')][_0x5589('0x4a')]({'where':{'id':_0x394119[_0x5589('0x44')]['id']}})[_0x5589('0x22')](function(_0x7b3f12){if(!_0x7b3f12)throw new ReferenceError(_0x5589('0x5a'));return _0x7b3f12;})[_0x5589('0x22')](function(_0x65d4aa){var _0x50b905=_0x65d4aa[_0x5589('0x4d')];logger['info'](_0x5589('0x5b'),_0x50b905);if(!_[_0x5589('0x5c')](_0x65d4aa[_0x5589('0x4d')])&&fs[_0x5589('0x50')](_0x50b905)){logger[_0x5589('0x5d')](_0x5589('0x5e')+_0x50b905+_0x5589('0x5f'));fs[_0x5589('0x60')](_0x50b905);}_0x50b905=_0x50b905+_0x5589('0x61');if(!_[_0x5589('0x5c')](_0x65d4aa['savePath'])&&fs[_0x5589('0x50')](_0x50b905)){logger[_0x5589('0x5d')](_0x5589('0x5e')+_0x50b905+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x5589('0x60')](_0x50b905);}return _0x65d4aa;})['then'](function(_0x29ee48){if(!_0x29ee48)throw new InternalError();return _0x29ee48[_0x5589('0x21')]();})[_0x5589('0x22')](function(){_0x4e03f3[_0x5589('0x1b')](0xcc)[_0x5589('0x19')]();})['catch'](handleError(_0x4e03f3,null));}; \ No newline at end of file +var _0xb3d2=['params','keys','include','find','create','body','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','filename','unlink','message','SquareRecording\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','SquareRecording','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','filter','merge','map','VIRTUAL','options','count','includeAll','rows','catch','show'];(function(_0x1a961b,_0x500296){var _0x189044=function(_0x5ccdb8){while(--_0x5ccdb8){_0x1a961b['push'](_0x1a961b['shift']());}};_0x189044(++_0x500296);}(_0xb3d2,0x79));var _0x2b3d=function(_0x16ad48,_0x38b249){_0x16ad48=_0x16ad48-0x0;var _0x32dc05=_0xb3d2[_0x16ad48];return _0x32dc05;};'use strict';var pdf=require(_0x2b3d('0x0'));var emlformat=require(_0x2b3d('0x1'));var rimraf=require(_0x2b3d('0x2'));var zipdir=require(_0x2b3d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2b3d('0x4'));var moment=require(_0x2b3d('0x5'));var BPromise=require(_0x2b3d('0x6'));var Mustache=require('mustache');var util=require(_0x2b3d('0x7'));var path=require('path');var sox=require(_0x2b3d('0x8'));var csv=require(_0x2b3d('0x9'));var ejs=require(_0x2b3d('0xa'));var fs=require('fs');var _=require(_0x2b3d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2b3d('0xc'));var deskjs=require(_0x2b3d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2b3d('0xe'));var Papa=require(_0x2b3d('0xf'));var Redis=require(_0x2b3d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2b3d('0x11'));var as=require(_0x2b3d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b3d('0x13'))(_0x2b3d('0x14'));var utils=require(_0x2b3d('0x15'));var config=require(_0x2b3d('0x16'));var db=require(_0x2b3d('0x17'))['db'];function respondWithStatusCode(_0x1513ed,_0x26bafd){_0x26bafd=_0x26bafd||0xcc;return function(_0x5f0ba4){if(_0x5f0ba4){return _0x1513ed[_0x2b3d('0x18')](_0x26bafd);}return _0x1513ed[_0x2b3d('0x19')](_0x26bafd)[_0x2b3d('0x1a')]();};}function respondWithResult(_0x2e8326,_0x4e24e8){_0x4e24e8=_0x4e24e8||0xc8;return function(_0x514fe8){if(_0x514fe8){return _0x2e8326[_0x2b3d('0x19')](_0x4e24e8)[_0x2b3d('0x1b')](_0x514fe8);}};}function respondWithFilteredResult(_0x278d12,_0x301ed4){return function(_0x580308){if(_0x580308){var _0x4b0c30=_0x580308['count'],_0x1432e7=_0x301ed4[_0x2b3d('0x1c')],_0x10d71e=_0x301ed4[_0x2b3d('0x1c')]+_0x301ed4[_0x2b3d('0x1d')],_0xf27185;if(_0x10d71e>=_0x4b0c30){_0x10d71e=_0x4b0c30;_0xf27185=0xc8;}else{_0xf27185=0xce;}_0x278d12[_0x2b3d('0x19')](_0xf27185);return _0x278d12[_0x2b3d('0x1e')](_0x2b3d('0x1f'),_0x1432e7+'-'+_0x10d71e+'/'+_0x4b0c30)[_0x2b3d('0x1b')](_0x580308);}return null;};}function patchUpdates(_0xcd6b5d){return function(_0x1ef280){try{jsonpatch['apply'](_0x1ef280,_0xcd6b5d,!![]);}catch(_0x1da31d){return BPromise['reject'](_0x1da31d);}return _0x1ef280[_0x2b3d('0x20')]();};}function saveUpdates(_0x2c650e,_0x3c2a83){return function(_0x2150e4){if(_0x2150e4){return _0x2150e4[_0x2b3d('0x21')](_0x2c650e)[_0x2b3d('0x22')](function(_0x1e4472){return _0x1e4472;});}return null;};}function removeEntity(_0x242a3c,_0xc32978){return function(_0x3ed04b){if(_0x3ed04b){return _0x3ed04b[_0x2b3d('0x23')]()[_0x2b3d('0x22')](function(){_0x242a3c[_0x2b3d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b64c9,_0x1e1eaa){return function(_0x4024ad){if(!_0x4024ad){_0x5b64c9[_0x2b3d('0x18')](0x194);}return _0x4024ad;};}function handleError(_0x3c7951,_0x45102c){_0x45102c=_0x45102c||0x1f4;return function(_0x3c2f97){logger[_0x2b3d('0x24')](_0x3c2f97[_0x2b3d('0x25')]);if(_0x3c2f97['name']){delete _0x3c2f97[_0x2b3d('0x26')];}_0x3c7951['status'](_0x45102c)[_0x2b3d('0x27')](_0x3c2f97);};}exports[_0x2b3d('0x28')]=function(_0x52ca01,_0x42f059){var _0x195ba5={},_0x59175e={},_0x1c7947={'count':0x0,'rows':[]};var _0x648c47=_['map'](db[_0x2b3d('0x29')][_0x2b3d('0x2a')],function(_0x43cf46){return{'name':_0x43cf46[_0x2b3d('0x2b')],'type':_0x43cf46[_0x2b3d('0x2c')]['key']};});_0x59175e['model']=_['map'](_0x648c47,_0x2b3d('0x26'));_0x59175e['query']=_['keys'](_0x52ca01[_0x2b3d('0x2d')]);_0x59175e[_0x2b3d('0x2e')]=_[_0x2b3d('0x2f')](_0x59175e[_0x2b3d('0x30')],_0x59175e[_0x2b3d('0x2d')]);_0x195ba5[_0x2b3d('0x31')]=_[_0x2b3d('0x2f')](_0x59175e['model'],qs[_0x2b3d('0x32')](_0x52ca01[_0x2b3d('0x2d')][_0x2b3d('0x32')]));_0x195ba5[_0x2b3d('0x31')]=_0x195ba5[_0x2b3d('0x31')][_0x2b3d('0x33')]?_0x195ba5[_0x2b3d('0x31')]:_0x59175e[_0x2b3d('0x30')];if(!_0x52ca01[_0x2b3d('0x2d')]['hasOwnProperty'](_0x2b3d('0x34'))){_0x195ba5['limit']=qs['limit'](_0x52ca01[_0x2b3d('0x2d')][_0x2b3d('0x1d')]);_0x195ba5[_0x2b3d('0x1c')]=qs[_0x2b3d('0x1c')](_0x52ca01[_0x2b3d('0x2d')][_0x2b3d('0x1c')]);}_0x195ba5['order']=qs[_0x2b3d('0x35')](_0x52ca01[_0x2b3d('0x2d')]['sort']);_0x195ba5[_0x2b3d('0x36')]=qs[_0x2b3d('0x2e')](_['pick'](_0x52ca01['query'],_0x59175e[_0x2b3d('0x2e')]));if(_0x52ca01[_0x2b3d('0x2d')][_0x2b3d('0x37')]){_0x195ba5[_0x2b3d('0x36')]=_[_0x2b3d('0x38')](_0x195ba5[_0x2b3d('0x36')],{'$or':_[_0x2b3d('0x39')](_0x648c47,function(_0x1bda87){if(_0x1bda87['type']!==_0x2b3d('0x3a')){var _0x48c16b={};_0x48c16b[_0x1bda87[_0x2b3d('0x26')]]={'$like':'%'+_0x52ca01[_0x2b3d('0x2d')]['filter']+'%'};return _0x48c16b;}})});}_0x195ba5=_[_0x2b3d('0x38')]({},_0x195ba5,_0x52ca01[_0x2b3d('0x3b')]);var _0xfd02ec={'where':_0x195ba5['where']};return db[_0x2b3d('0x29')][_0x2b3d('0x3c')](_0xfd02ec)[_0x2b3d('0x22')](function(_0x43f890){_0x1c7947[_0x2b3d('0x3c')]=_0x43f890;if(_0x52ca01['query'][_0x2b3d('0x3d')]){_0x195ba5['include']=[{'all':!![]}];}return db[_0x2b3d('0x29')]['findAll'](_0x195ba5);})[_0x2b3d('0x22')](function(_0x5f424a){_0x1c7947[_0x2b3d('0x3e')]=_0x5f424a;return _0x1c7947;})[_0x2b3d('0x22')](respondWithFilteredResult(_0x42f059,_0x195ba5))[_0x2b3d('0x3f')](handleError(_0x42f059,null));};exports[_0x2b3d('0x40')]=function(_0x370074,_0x55dcbb){var _0x3af9c8={'raw':!![],'where':{'id':_0x370074[_0x2b3d('0x41')]['id']}},_0x580ab4={};_0x580ab4[_0x2b3d('0x30')]=_['keys'](db[_0x2b3d('0x29')]['rawAttributes']);_0x580ab4[_0x2b3d('0x2d')]=_[_0x2b3d('0x42')](_0x370074[_0x2b3d('0x2d')]);_0x580ab4['filters']=_[_0x2b3d('0x2f')](_0x580ab4[_0x2b3d('0x30')],_0x580ab4['query']);_0x3af9c8[_0x2b3d('0x31')]=_['intersection'](_0x580ab4['model'],qs['fields'](_0x370074[_0x2b3d('0x2d')][_0x2b3d('0x32')]));_0x3af9c8[_0x2b3d('0x31')]=_0x3af9c8[_0x2b3d('0x31')]['length']?_0x3af9c8['attributes']:_0x580ab4['model'];if(_0x370074[_0x2b3d('0x2d')]['includeAll']){_0x3af9c8[_0x2b3d('0x43')]=[{'all':!![]}];}_0x3af9c8=_[_0x2b3d('0x38')]({},_0x3af9c8,_0x370074[_0x2b3d('0x3b')]);return db[_0x2b3d('0x29')][_0x2b3d('0x44')](_0x3af9c8)[_0x2b3d('0x22')](handleEntityNotFound(_0x55dcbb,null))[_0x2b3d('0x22')](respondWithResult(_0x55dcbb,null))[_0x2b3d('0x3f')](handleError(_0x55dcbb,null));};exports['create']=function(_0x3095c5,_0x598875){return db[_0x2b3d('0x29')][_0x2b3d('0x45')](_0x3095c5['body'],{})[_0x2b3d('0x22')](respondWithResult(_0x598875,0xc9))[_0x2b3d('0x3f')](handleError(_0x598875,null));};exports[_0x2b3d('0x21')]=function(_0x5273d8,_0x5e9b6f){if(_0x5273d8[_0x2b3d('0x46')]['id']){delete _0x5273d8['body']['id'];}return db[_0x2b3d('0x29')][_0x2b3d('0x44')]({'where':{'id':_0x5273d8['params']['id']}})[_0x2b3d('0x22')](handleEntityNotFound(_0x5e9b6f,null))['then'](saveUpdates(_0x5273d8[_0x2b3d('0x46')],null))[_0x2b3d('0x22')](respondWithResult(_0x5e9b6f,null))['catch'](handleError(_0x5e9b6f,null));};exports[_0x2b3d('0x47')]=function(_0x27bd47,_0x6c3f3,_0x1a904a){var _0x43d345=require(_0x2b3d('0x48'));var _0x2dce61=![];var _0x4907ba={};if(_0x27bd47[_0x2b3d('0x2d')][_0x2b3d('0x2c')]&&_0x27bd47['query'][_0x2b3d('0x2c')]==='uniqueid'){_0x4907ba[_0x2b3d('0x49')]=_0x27bd47[_0x2b3d('0x41')]['id'];}else{_0x4907ba['id']=_0x27bd47['params']['id'];}return db[_0x2b3d('0x29')]['find']({'where':_0x4907ba,'attributes':['id',_0x2b3d('0x4a'),'filename'],'raw':!![]})[_0x2b3d('0x22')](handleEntityNotFound(_0x6c3f3,null))['then'](function(_0x47b23c){if(_0x47b23c){var _0x539d1c=_0x47b23c[_0x2b3d('0x4a')];var _0x40daad=util[_0x2b3d('0x4b')](_0x2b3d('0x4c'),_0x539d1c);if(fs[_0x2b3d('0x4d')](_0x40daad)){_0x2dce61=!![];return _0x43d345[_0x2b3d('0x4e')](_0x40daad,_0x539d1c,config[_0x2b3d('0x4f')][_0x2b3d('0x50')])['then'](function(){return _0x47b23c;});}return _0x47b23c;}})[_0x2b3d('0x22')](function(_0x3b307d){if(_0x3b307d){var _0x5242f5=_0x3b307d['savePath'];if(!fs['existsSync'](_0x5242f5)){throw new db[(_0x2b3d('0x51'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x3b307d[_0x2b3d('0x52')]){return _0x6c3f3[_0x2b3d('0x47')](_0x5242f5,_0x3b307d[_0x2b3d('0x52')]+path['extname'](_0x5242f5),function(){if(_0x2dce61){fs[_0x2b3d('0x53')](_0x5242f5);}});}else{return _0x6c3f3[_0x2b3d('0x47')](_0x5242f5,function(_0x53cf25){if(_0x2dce61){fs['unlink'](_0x5242f5);}});}}})[_0x2b3d('0x3f')](function(_0x48faa0){if(_0x48faa0[_0x2b3d('0x54')]===_0x2b3d('0x55')){_0x6c3f3[_0x2b3d('0x19')](0x194)['send']('Not\x20found');}else{return handleError(_0x6c3f3,null);}});};exports[_0x2b3d('0x23')]=function(_0xf2e0e8,_0x3bc834){return db[_0x2b3d('0x29')][_0x2b3d('0x44')]({'where':{'id':_0xf2e0e8[_0x2b3d('0x41')]['id']}})[_0x2b3d('0x22')](function(_0x36fb4b){if(!_0x36fb4b)throw new ReferenceError('Entity\x20not\x20found');return _0x36fb4b;})['then'](function(_0x5ac55c){var _0x278a99=_0x5ac55c[_0x2b3d('0x4a')];logger[_0x2b3d('0x56')](_0x2b3d('0x57'),_0x278a99);if(!_['isNil'](_0x5ac55c[_0x2b3d('0x4a')])&&fs[_0x2b3d('0x4d')](_0x278a99)){logger[_0x2b3d('0x56')](_0x2b3d('0x58')+_0x278a99+_0x2b3d('0x59'));fs[_0x2b3d('0x5a')](_0x278a99);}_0x278a99=_0x278a99+_0x2b3d('0x5b');if(!_[_0x2b3d('0x5c')](_0x5ac55c[_0x2b3d('0x4a')])&&fs[_0x2b3d('0x4d')](_0x278a99)){logger['info'](_0x2b3d('0x58')+_0x278a99+_0x2b3d('0x59'));fs[_0x2b3d('0x5a')](_0x278a99);}return _0x5ac55c;})[_0x2b3d('0x22')](function(_0x2d5e1e){if(!_0x2d5e1e)throw new InternalError();return _0x2d5e1e['destroy']();})[_0x2b3d('0x22')](function(){_0x3bc834[_0x2b3d('0x19')](0xcc)['end']();})[_0x2b3d('0x3f')](handleError(_0x3bc834,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 0a9a3ad..790dd24 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 _0x80cd=['SquareRecording','square_recordings','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareRecording.attributes','exports'];(function(_0xa10411,_0x45ca6c){var _0x2310e5=function(_0x25039d){while(--_0x25039d){_0xa10411['push'](_0xa10411['shift']());}};_0x2310e5(++_0x45ca6c);}(_0x80cd,0x146));var _0xd80c=function(_0x35e92e,_0x21581b){_0x35e92e=_0x35e92e-0x0;var _0x1205a8=_0x80cd[_0x35e92e];return _0x1205a8;};'use strict';var _=require('lodash');var util=require(_0xd80c('0x0'));var logger=require(_0xd80c('0x1'))(_0xd80c('0x2'));var moment=require(_0xd80c('0x3'));var BPromise=require(_0xd80c('0x4'));var rp=require(_0xd80c('0x5'));var fs=require('fs');var path=require(_0xd80c('0x6'));var rimraf=require(_0xd80c('0x7'));var config=require('../../config/environment');var attributes=require(_0xd80c('0x8'));module[_0xd80c('0x9')]=function(_0x21149c,_0x46dfa0){return _0x21149c['define'](_0xd80c('0xa'),attributes,{'tableName':_0xd80c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d5b=['exports','SquareRecording','square_recordings','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./squareRecording.attributes'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x9d5b,0x14d));var _0xb9d5=function(_0x14ac2a,_0x580523){_0x14ac2a=_0x14ac2a-0x0;var _0x5b0aff=_0x9d5b[_0x14ac2a];return _0x5b0aff;};'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/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 6d3acd6..824da66 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 _0x62f2=['SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareRecording','SquareRecording','create','body','options','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x5d17d3,_0x5b664e){var _0x3456df=function(_0x337eaf){while(--_0x337eaf){_0x5d17d3['push'](_0x5d17d3['shift']());}};_0x3456df(++_0x5b664e);}(_0x62f2,0xcc));var _0x262f=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x62f2[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x262f('0x0'));var util=require(_0x262f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x262f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x262f('0x3'))['db'];var utils=require(_0x262f('0x4'));var logger=require(_0x262f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x262f('0x6'));var client=jayson[_0x262f('0x7')][_0x262f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x76d0a5,_0x5805a8,_0x1260f2){return new BPromise(function(_0x14ee0c,_0x57375c){return client[_0x262f('0x9')](_0x76d0a5,_0x1260f2)[_0x262f('0xa')](function(_0x3b416c){logger[_0x262f('0xb')](_0x262f('0xc'),_0x5805a8,_0x262f('0xd'));logger[_0x262f('0xe')](_0x262f('0xf'),_0x5805a8,'request\x20sent',JSON[_0x262f('0x10')](_0x3b416c));if(_0x3b416c[_0x262f('0x11')]){if(_0x3b416c[_0x262f('0x11')][_0x262f('0x12')]===0x1f4){logger[_0x262f('0x11')]('SquareRecording,\x20%s,\x20%s',_0x5805a8,_0x3b416c[_0x262f('0x11')][_0x262f('0x13')]);return _0x57375c(_0x3b416c['error'][_0x262f('0x13')]);}logger['error'](_0x262f('0xc'),_0x5805a8,_0x3b416c[_0x262f('0x11')][_0x262f('0x13')]);return _0x14ee0c(_0x3b416c['error'][_0x262f('0x13')]);}else{logger['info'](_0x262f('0xc'),_0x5805a8,_0x262f('0xd'));_0x14ee0c(_0x3b416c[_0x262f('0x14')][_0x262f('0x13')]);}})['catch'](function(_0x91ac39){logger[_0x262f('0x11')](_0x262f('0xc'),_0x5805a8,_0x91ac39);_0x57375c(_0x91ac39);});});}exports[_0x262f('0x15')]=function(_0x6cc2bf){var _0x494713=this;return new Promise(function(_0xa645f1,_0x4476e9){return db[_0x262f('0x16')][_0x262f('0x17')](_0x6cc2bf[_0x262f('0x18')],{'raw':_0x6cc2bf[_0x262f('0x19')]?_0x6cc2bf['options']['raw']===undefined?!![]:![]:!![]})[_0x262f('0xa')](function(_0x214131){logger[_0x262f('0xb')](_0x262f('0x15'),_0x6cc2bf);logger['debug'](_0x262f('0x15'),_0x6cc2bf,JSON[_0x262f('0x10')](_0x214131));_0xa645f1(_0x214131);})[_0x262f('0x1a')](function(_0x1e11ac){logger[_0x262f('0x11')](_0x262f('0x15'),_0x1e11ac[_0x262f('0x13')],_0x6cc2bf);_0x4476e9(_0x494713[_0x262f('0x11')](0x1f4,_0x1e11ac[_0x262f('0x13')]));});});}; \ No newline at end of file +var _0x47fe=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','SquareRecording,\x20%s,\x20%s','debug','request\x20sent','error','message','result','SquareRecording','create','body','options','raw','then','CreateSquareRecording','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x47fe,0x1c7));var _0xe47f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x47fe[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe47f('0x0'));var util=require('util');var moment=require(_0xe47f('0x1'));var BPromise=require(_0xe47f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe47f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe47f('0x4'));var logger=require(_0xe47f('0x5'))(_0xe47f('0x6'));var config=require(_0xe47f('0x7'));var jayson=require(_0xe47f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39d911,_0x5abe60,_0x54734f){return new BPromise(function(_0x1d8d60,_0x3ab40f){return client['request'](_0x39d911,_0x54734f)['then'](function(_0x4d244e){logger[_0xe47f('0x9')](_0xe47f('0xa'),_0x5abe60,'request\x20sent');logger[_0xe47f('0xb')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x5abe60,_0xe47f('0xc'),JSON['stringify'](_0x4d244e));if(_0x4d244e[_0xe47f('0xd')]){if(_0x4d244e['error']['code']===0x1f4){logger[_0xe47f('0xd')](_0xe47f('0xa'),_0x5abe60,_0x4d244e[_0xe47f('0xd')][_0xe47f('0xe')]);return _0x3ab40f(_0x4d244e[_0xe47f('0xd')][_0xe47f('0xe')]);}logger[_0xe47f('0xd')](_0xe47f('0xa'),_0x5abe60,_0x4d244e[_0xe47f('0xd')][_0xe47f('0xe')]);return _0x1d8d60(_0x4d244e['error']['message']);}else{logger['info'](_0xe47f('0xa'),_0x5abe60,'request\x20sent');_0x1d8d60(_0x4d244e[_0xe47f('0xf')]['message']);}})['catch'](function(_0x6da8dd){logger[_0xe47f('0xd')]('SquareRecording,\x20%s,\x20%s',_0x5abe60,_0x6da8dd);_0x3ab40f(_0x6da8dd);});});}exports['CreateSquareRecording']=function(_0x3a3efb){var _0x166752=this;return new Promise(function(_0x557cff,_0x477871){return db[_0xe47f('0x10')][_0xe47f('0x11')](_0x3a3efb[_0xe47f('0x12')],{'raw':_0x3a3efb[_0xe47f('0x13')]?_0x3a3efb[_0xe47f('0x13')][_0xe47f('0x14')]===undefined?!![]:![]:!![]})[_0xe47f('0x15')](function(_0x244101){logger['info'](_0xe47f('0x16'),_0x3a3efb);logger[_0xe47f('0xb')]('CreateSquareRecording',_0x3a3efb,JSON['stringify'](_0x244101));_0x557cff(_0x244101);})[_0xe47f('0x17')](function(_0x1c5e4a){logger['error'](_0xe47f('0x16'),_0x1c5e4a[_0xe47f('0xe')],_0x3a3efb);_0x477871(_0x166752[_0xe47f('0xd')](0x1f4,_0x1c5e4a[_0xe47f('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 6ca8c96..50dad43 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 _0x2ab2=['index','get','describe','isAuthenticated','show','create','/:id','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2ab2,0x1d9));var _0x22ab=function(_0x49ddeb,_0x574fa3){_0x49ddeb=_0x49ddeb-0x0;var _0x406462=_0x2ab2[_0x49ddeb];return _0x406462;};'use strict';var multer=require('multer');var util=require(_0x22ab('0x0'));var path=require('path');var timeout=require(_0x22ab('0x1'));var express=require(_0x22ab('0x2'));var router=express[_0x22ab('0x3')]();var auth=require(_0x22ab('0x4'));var interaction=require(_0x22ab('0x5'));var config=require(_0x22ab('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x22ab('0x7')]);router[_0x22ab('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x22ab('0x9')]);router[_0x22ab('0x8')]('/:id',auth[_0x22ab('0xa')](),controller[_0x22ab('0xb')]);router['post']('/',auth[_0x22ab('0xa')](),controller[_0x22ab('0xc')]);router['put'](_0x22ab('0xd'),auth[_0x22ab('0xa')](),controller['update']);router['delete'](_0x22ab('0xd'),auth['isAuthenticated'](),controller[_0x22ab('0xe')]);module['exports']=router; \ No newline at end of file +var _0x88a1=['describe','/:id','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe'];(function(_0x2447ab,_0x4f5108){var _0x28395d=function(_0x52a9d3){while(--_0x52a9d3){_0x2447ab['push'](_0x2447ab['shift']());}};_0x28395d(++_0x4f5108);}(_0x88a1,0x71));var _0x188a=function(_0x2265da,_0xfbbd2e){_0x2265da=_0x2265da-0x0;var _0x430c2b=_0x88a1[_0x2265da];return _0x430c2b;};'use strict';var multer=require(_0x188a('0x0'));var util=require('util');var path=require(_0x188a('0x1'));var timeout=require(_0x188a('0x2'));var express=require(_0x188a('0x3'));var router=express[_0x188a('0x4')]();var auth=require(_0x188a('0x5'));var interaction=require(_0x188a('0x6'));var config=require(_0x188a('0x7'));var controller=require(_0x188a('0x8'));router[_0x188a('0x9')]('/',auth[_0x188a('0xa')](),controller[_0x188a('0xb')]);router[_0x188a('0x9')](_0x188a('0xc'),auth[_0x188a('0xa')](),controller[_0x188a('0xd')]);router[_0x188a('0x9')](_0x188a('0xe'),auth[_0x188a('0xa')](),controller['show']);router[_0x188a('0xf')]('/',auth['isAuthenticated'](),controller[_0x188a('0x10')]);router[_0x188a('0x11')](_0x188a('0xe'),auth[_0x188a('0xa')](),controller['update']);router[_0x188a('0x12')](_0x188a('0xe'),auth[_0x188a('0xa')](),controller[_0x188a('0x13')]);module[_0x188a('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 15c32bd..397f5be 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 _0xfa47=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x475d82,_0x3eeb90){var _0x2ff7d2=function(_0x9dafc5){while(--_0x9dafc5){_0x475d82['push'](_0x475d82['shift']());}};_0x2ff7d2(++_0x3eeb90);}(_0xfa47,0xd7));var _0x7fa4=function(_0x4f4c53,_0x58ba7b){_0x4f4c53=_0x4f4c53-0x0;var _0x568ff1=_0xfa47[_0x4f4c53];return _0x568ff1;};'use strict';var Sequelize=require(_0x7fa4('0x0'));module[_0x7fa4('0x1')]={'network':{'type':Sequelize[_0x7fa4('0x2')]},'network_script':{'type':Sequelize[_0x7fa4('0x2')]},'request':{'type':Sequelize[_0x7fa4('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7fa4('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x7fa4('0x2')]},'callerid':{'type':Sequelize[_0x7fa4('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x7fa4('0x2')]},'callingani2':{'type':Sequelize[_0x7fa4('0x2')]},'callington':{'type':Sequelize[_0x7fa4('0x2')]},'callingtns':{'type':Sequelize[_0x7fa4('0x2')]},'dnid':{'type':Sequelize[_0x7fa4('0x2')]},'rdnis':{'type':Sequelize[_0x7fa4('0x2')]},'context':{'type':Sequelize[_0x7fa4('0x2')]},'extension':{'type':Sequelize[_0x7fa4('0x2')]},'priority':{'type':Sequelize[_0x7fa4('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x7fa4('0x2')]},'project_name':{'type':Sequelize[_0x7fa4('0x2')]},'joinAt':{'type':Sequelize[_0x7fa4('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x7fa4('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x36ba=['exports','STRING','DATE','BOOLEAN'];(function(_0x2e7931,_0x46e3cd){var _0x7db7fb=function(_0x1091a1){while(--_0x1091a1){_0x2e7931['push'](_0x2e7931['shift']());}};_0x7db7fb(++_0x46e3cd);}(_0x36ba,0x188));var _0xa36b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x36ba[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xa36b('0x0')]={'network':{'type':Sequelize[_0xa36b('0x1')]},'network_script':{'type':Sequelize[_0xa36b('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa36b('0x1')]},'language':{'type':Sequelize[_0xa36b('0x1')]},'type':{'type':Sequelize[_0xa36b('0x1')]},'uniqueid':{'type':Sequelize[_0xa36b('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa36b('0x1')]},'calleridname':{'type':Sequelize[_0xa36b('0x1')]},'callingpres':{'type':Sequelize[_0xa36b('0x1')]},'callingani2':{'type':Sequelize[_0xa36b('0x1')]},'callington':{'type':Sequelize[_0xa36b('0x1')]},'callingtns':{'type':Sequelize[_0xa36b('0x1')]},'dnid':{'type':Sequelize[_0xa36b('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa36b('0x1')]},'extension':{'type':Sequelize[_0xa36b('0x1')]},'priority':{'type':Sequelize[_0xa36b('0x1')]},'enhanced':{'type':Sequelize[_0xa36b('0x1')]},'accountcode':{'type':Sequelize[_0xa36b('0x1')]},'threadid':{'type':Sequelize[_0xa36b('0x1')]},'project_name':{'type':Sequelize[_0xa36b('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa36b('0x2')]},'bot':{'type':Sequelize[_0xa36b('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 278d5a3..8d6105b 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 _0x7fbe=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','SquareReport','includeAll','findAll','rows','show','params','include','options','catch','create','body','destroy','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys'];(function(_0x51347c,_0x39fbf2){var _0x2d86e7=function(_0x571197){while(--_0x571197){_0x51347c['push'](_0x51347c['shift']());}};_0x2d86e7(++_0x39fbf2);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1773f7,_0x54318f){_0x1773f7=_0x1773f7-0x0;var _0x1983fb=_0x7fbe[_0x1773f7];return _0x1983fb;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe7fb('0x0'));var zipdir=require(_0xe7fb('0x1'));var jsonpatch=require(_0xe7fb('0x2'));var rp=require(_0xe7fb('0x3'));var moment=require(_0xe7fb('0x4'));var BPromise=require(_0xe7fb('0x5'));var Mustache=require(_0xe7fb('0x6'));var util=require(_0xe7fb('0x7'));var path=require(_0xe7fb('0x8'));var sox=require(_0xe7fb('0x9'));var csv=require(_0xe7fb('0xa'));var ejs=require(_0xe7fb('0xb'));var fs=require('fs');var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0xa'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var db=require(_0xe7fb('0x19'))['db'];function respondWithStatusCode(_0x2fe8ab,_0x2437d4){_0x2437d4=_0x2437d4||0xcc;return function(_0x188e1d){if(_0x188e1d){return _0x2fe8ab[_0xe7fb('0x1a')](_0x2437d4);}return _0x2fe8ab[_0xe7fb('0x1b')](_0x2437d4)[_0xe7fb('0x1c')]();};}function respondWithResult(_0x598729,_0x278b75){_0x278b75=_0x278b75||0xc8;return function(_0x2225e5){if(_0x2225e5){return _0x598729['status'](_0x278b75)[_0xe7fb('0x1d')](_0x2225e5);}};}function respondWithFilteredResult(_0x37eb9f,_0x482f7d){return function(_0xa76acf){if(_0xa76acf){var _0x559129=_0xa76acf[_0xe7fb('0x1e')],_0x12fff6=_0x482f7d['offset'],_0x18d23c=_0x482f7d[_0xe7fb('0x1f')]+_0x482f7d['limit'],_0x12603d;if(_0x18d23c>=_0x559129){_0x18d23c=_0x559129;_0x12603d=0xc8;}else{_0x12603d=0xce;}_0x37eb9f[_0xe7fb('0x1b')](_0x12603d);return _0x37eb9f['set'](_0xe7fb('0x20'),_0x12fff6+'-'+_0x18d23c+'/'+_0x559129)[_0xe7fb('0x1d')](_0xa76acf);}return null;};}function patchUpdates(_0x3f96a7){return function(_0x182269){try{jsonpatch['apply'](_0x182269,_0x3f96a7,!![]);}catch(_0x44466e){return BPromise['reject'](_0x44466e);}return _0x182269[_0xe7fb('0x21')]();};}function saveUpdates(_0x51f01f,_0x15f7a4){return function(_0x4ea664){if(_0x4ea664){return _0x4ea664[_0xe7fb('0x22')](_0x51f01f)[_0xe7fb('0x23')](function(_0x4a9994){return _0x4a9994;});}return null;};}function removeEntity(_0x143eb6,_0x4742bd){return function(_0x3ae8f1){if(_0x3ae8f1){return _0x3ae8f1['destroy']()[_0xe7fb('0x23')](function(){_0x143eb6[_0xe7fb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(!_0x35e4db){_0x5bea27['sendStatus'](0x194);}return _0x35e4db;};}function handleError(_0x49b219,_0x4026b1){_0x4026b1=_0x4026b1||0x1f4;return function(_0x32e8b2){logger[_0xe7fb('0x24')](_0x32e8b2['stack']);if(_0x32e8b2[_0xe7fb('0x25')]){delete _0x32e8b2[_0xe7fb('0x25')];}_0x49b219[_0xe7fb('0x1b')](_0x4026b1)[_0xe7fb('0x26')](_0x32e8b2);};}exports[_0xe7fb('0x27')]=function(_0x16237a,_0x380130){var _0x59e015={},_0x5df9f2={},_0x1086e6={'count':0x0,'rows':[]};var _0x3bdee9=_[_0xe7fb('0x28')](db['SquareReport'][_0xe7fb('0x29')],function(_0x251807){return{'name':_0x251807[_0xe7fb('0x2a')],'type':_0x251807[_0xe7fb('0x2b')][_0xe7fb('0x2c')]};});_0x5df9f2[_0xe7fb('0x2d')]=_[_0xe7fb('0x28')](_0x3bdee9,_0xe7fb('0x25'));_0x5df9f2['query']=_[_0xe7fb('0x2e')](_0x16237a[_0xe7fb('0x2f')]);_0x5df9f2[_0xe7fb('0x30')]=_['intersection'](_0x5df9f2['model'],_0x5df9f2[_0xe7fb('0x2f')]);_0x59e015['attributes']=_[_0xe7fb('0x31')](_0x5df9f2[_0xe7fb('0x2d')],qs[_0xe7fb('0x32')](_0x16237a[_0xe7fb('0x2f')]['fields']));_0x59e015[_0xe7fb('0x33')]=_0x59e015[_0xe7fb('0x33')][_0xe7fb('0x34')]?_0x59e015[_0xe7fb('0x33')]:_0x5df9f2[_0xe7fb('0x2d')];if(!_0x16237a['query'][_0xe7fb('0x35')](_0xe7fb('0x36'))){_0x59e015[_0xe7fb('0x37')]=qs[_0xe7fb('0x37')](_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x37')]);_0x59e015[_0xe7fb('0x1f')]=qs[_0xe7fb('0x1f')](_0x16237a[_0xe7fb('0x2f')]['offset']);}_0x59e015[_0xe7fb('0x38')]=qs[_0xe7fb('0x39')](_0x16237a[_0xe7fb('0x2f')]['sort']);_0x59e015[_0xe7fb('0x3a')]=qs[_0xe7fb('0x30')](_[_0xe7fb('0x3b')](_0x16237a[_0xe7fb('0x2f')],_0x5df9f2[_0xe7fb('0x30')]));if(_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x3c')]){_0x59e015[_0xe7fb('0x3a')]=_[_0xe7fb('0x3d')](_0x59e015[_0xe7fb('0x3a')],{'$or':_[_0xe7fb('0x28')](_0x3bdee9,function(_0x3c4f4b){if(_0x3c4f4b[_0xe7fb('0x2b')]!==_0xe7fb('0x3e')){var _0xeb7c29={};_0xeb7c29[_0x3c4f4b[_0xe7fb('0x25')]]={'$like':'%'+_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x3c')]+'%'};return _0xeb7c29;}})});}_0x59e015=_[_0xe7fb('0x3d')]({},_0x59e015,_0x16237a['options']);var _0x261ec5={'where':_0x59e015[_0xe7fb('0x3a')]};return db[_0xe7fb('0x3f')][_0xe7fb('0x1e')](_0x261ec5)['then'](function(_0x3426a9){_0x1086e6[_0xe7fb('0x1e')]=_0x3426a9;if(_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x40')]){_0x59e015['include']=[{'all':!![]}];}return db[_0xe7fb('0x3f')][_0xe7fb('0x41')](_0x59e015);})[_0xe7fb('0x23')](function(_0x62a8a1){_0x1086e6[_0xe7fb('0x42')]=_0x62a8a1;return _0x1086e6;})[_0xe7fb('0x23')](respondWithFilteredResult(_0x380130,_0x59e015))['catch'](handleError(_0x380130,null));};exports[_0xe7fb('0x43')]=function(_0x35139f,_0x3a96cd){var _0x4b263d={'raw':!![],'where':{'id':_0x35139f[_0xe7fb('0x44')]['id']}},_0x36a341={};_0x36a341['model']=_['keys'](db['SquareReport']['rawAttributes']);_0x36a341['query']=_[_0xe7fb('0x2e')](_0x35139f[_0xe7fb('0x2f')]);_0x36a341[_0xe7fb('0x30')]=_['intersection'](_0x36a341[_0xe7fb('0x2d')],_0x36a341['query']);_0x4b263d[_0xe7fb('0x33')]=_[_0xe7fb('0x31')](_0x36a341['model'],qs[_0xe7fb('0x32')](_0x35139f[_0xe7fb('0x2f')][_0xe7fb('0x32')]));_0x4b263d[_0xe7fb('0x33')]=_0x4b263d['attributes'][_0xe7fb('0x34')]?_0x4b263d[_0xe7fb('0x33')]:_0x36a341[_0xe7fb('0x2d')];if(_0x35139f['query'][_0xe7fb('0x40')]){_0x4b263d[_0xe7fb('0x45')]=[{'all':!![]}];}_0x4b263d=_[_0xe7fb('0x3d')]({},_0x4b263d,_0x35139f[_0xe7fb('0x46')]);return db[_0xe7fb('0x3f')]['find'](_0x4b263d)[_0xe7fb('0x23')](handleEntityNotFound(_0x3a96cd,null))['then'](respondWithResult(_0x3a96cd,null))[_0xe7fb('0x47')](handleError(_0x3a96cd,null));};exports[_0xe7fb('0x48')]=function(_0x3520e3,_0x1ecbfd){return db[_0xe7fb('0x3f')]['create'](_0x3520e3[_0xe7fb('0x49')],{})['then'](respondWithResult(_0x1ecbfd,0xc9))['catch'](handleError(_0x1ecbfd,null));};exports[_0xe7fb('0x22')]=function(_0x3d740f,_0x16327f){if(_0x3d740f['body']['id']){delete _0x3d740f[_0xe7fb('0x49')]['id'];}return db[_0xe7fb('0x3f')]['find']({'where':{'id':_0x3d740f['params']['id']}})[_0xe7fb('0x23')](handleEntityNotFound(_0x16327f,null))[_0xe7fb('0x23')](saveUpdates(_0x3d740f[_0xe7fb('0x49')],null))[_0xe7fb('0x23')](respondWithResult(_0x16327f,null))[_0xe7fb('0x47')](handleError(_0x16327f,null));};exports[_0xe7fb('0x4a')]=function(_0x18a590,_0x347177){return db['SquareReport'][_0xe7fb('0x4b')]({'where':{'id':_0x18a590['params']['id']}})[_0xe7fb('0x23')](handleEntityNotFound(_0x347177,null))[_0xe7fb('0x23')](removeEntity(_0x347177,null))['catch'](handleError(_0x347177,null));};exports[_0xe7fb('0x4c')]=function(_0x5efd24,_0x239c56){return db['SquareReport'][_0xe7fb('0x4c')]()['then'](respondWithResult(_0x239c56,null))[_0xe7fb('0x47')](handleError(_0x239c56,null));}; \ No newline at end of file +var _0xabce=['Content-Range','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','keys','options','SquareReport','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set'];(function(_0x507e23,_0x2406d5){var _0x14017a=function(_0x4f238e){while(--_0x4f238e){_0x507e23['push'](_0x507e23['shift']());}};_0x14017a(++_0x2406d5);}(_0xabce,0x103));var _0xeabc=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xabce[_0x30ae5e];return _0x1f2e93;};'use strict';var pdf=require(_0xeabc('0x0'));var emlformat=require(_0xeabc('0x1'));var rimraf=require(_0xeabc('0x2'));var zipdir=require(_0xeabc('0x3'));var jsonpatch=require(_0xeabc('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeabc('0x5'));var Mustache=require(_0xeabc('0x6'));var util=require(_0xeabc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xeabc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var db=require(_0xeabc('0x18'))['db'];function respondWithStatusCode(_0x435ea7,_0x3fd0b5){_0x3fd0b5=_0x3fd0b5||0xcc;return function(_0x36a92e){if(_0x36a92e){return _0x435ea7[_0xeabc('0x19')](_0x3fd0b5);}return _0x435ea7['status'](_0x3fd0b5)[_0xeabc('0x1a')]();};}function respondWithResult(_0x1319f3,_0x3251c6){_0x3251c6=_0x3251c6||0xc8;return function(_0x55f0de){if(_0x55f0de){return _0x1319f3['status'](_0x3251c6)[_0xeabc('0x1b')](_0x55f0de);}};}function respondWithFilteredResult(_0x3ae954,_0x326bac){return function(_0x53d5cb){if(_0x53d5cb){var _0xf913d7=_0x53d5cb[_0xeabc('0x1c')],_0x638976=_0x326bac['offset'],_0x49f2d8=_0x326bac[_0xeabc('0x1d')]+_0x326bac[_0xeabc('0x1e')],_0x53fe28;if(_0x49f2d8>=_0xf913d7){_0x49f2d8=_0xf913d7;_0x53fe28=0xc8;}else{_0x53fe28=0xce;}_0x3ae954[_0xeabc('0x1f')](_0x53fe28);return _0x3ae954[_0xeabc('0x20')](_0xeabc('0x21'),_0x638976+'-'+_0x49f2d8+'/'+_0xf913d7)[_0xeabc('0x1b')](_0x53d5cb);}return null;};}function patchUpdates(_0x384be5){return function(_0x5e30ee){try{jsonpatch['apply'](_0x5e30ee,_0x384be5,!![]);}catch(_0x1253e4){return BPromise['reject'](_0x1253e4);}return _0x5e30ee[_0xeabc('0x22')]();};}function saveUpdates(_0x16530c,_0x502947){return function(_0x28063a){if(_0x28063a){return _0x28063a[_0xeabc('0x23')](_0x16530c)[_0xeabc('0x24')](function(_0x184e60){return _0x184e60;});}return null;};}function removeEntity(_0x3c9611,_0x4e99a4){return function(_0xecdbf){if(_0xecdbf){return _0xecdbf[_0xeabc('0x25')]()[_0xeabc('0x24')](function(){_0x3c9611['status'](0xcc)[_0xeabc('0x1a')]();});}};}function handleEntityNotFound(_0x3854d2,_0x214953){return function(_0x319119){if(!_0x319119){_0x3854d2['sendStatus'](0x194);}return _0x319119;};}function handleError(_0x109e1d,_0x480440){_0x480440=_0x480440||0x1f4;return function(_0x27dbaf){logger['error'](_0x27dbaf[_0xeabc('0x26')]);if(_0x27dbaf[_0xeabc('0x27')]){delete _0x27dbaf[_0xeabc('0x27')];}_0x109e1d[_0xeabc('0x1f')](_0x480440)[_0xeabc('0x28')](_0x27dbaf);};}exports[_0xeabc('0x29')]=function(_0x131722,_0x4c2693){var _0x5b2934={},_0x459c8a={},_0x5bf8f2={'count':0x0,'rows':[]};var _0x3c1b5b=_[_0xeabc('0x2a')](db['SquareReport'][_0xeabc('0x2b')],function(_0x38572d){return{'name':_0x38572d[_0xeabc('0x2c')],'type':_0x38572d[_0xeabc('0x2d')][_0xeabc('0x2e')]};});_0x459c8a[_0xeabc('0x2f')]=_[_0xeabc('0x2a')](_0x3c1b5b,_0xeabc('0x27'));_0x459c8a[_0xeabc('0x30')]=_['keys'](_0x131722[_0xeabc('0x30')]);_0x459c8a['filters']=_[_0xeabc('0x31')](_0x459c8a[_0xeabc('0x2f')],_0x459c8a[_0xeabc('0x30')]);_0x5b2934[_0xeabc('0x32')]=_[_0xeabc('0x31')](_0x459c8a[_0xeabc('0x2f')],qs[_0xeabc('0x33')](_0x131722['query'][_0xeabc('0x33')]));_0x5b2934[_0xeabc('0x32')]=_0x5b2934[_0xeabc('0x32')]['length']?_0x5b2934[_0xeabc('0x32')]:_0x459c8a[_0xeabc('0x2f')];if(!_0x131722[_0xeabc('0x30')]['hasOwnProperty'](_0xeabc('0x34'))){_0x5b2934[_0xeabc('0x1e')]=qs[_0xeabc('0x1e')](_0x131722['query'][_0xeabc('0x1e')]);_0x5b2934[_0xeabc('0x1d')]=qs['offset'](_0x131722['query'][_0xeabc('0x1d')]);}_0x5b2934[_0xeabc('0x35')]=qs['sort'](_0x131722[_0xeabc('0x30')][_0xeabc('0x36')]);_0x5b2934[_0xeabc('0x37')]=qs[_0xeabc('0x38')](_[_0xeabc('0x39')](_0x131722['query'],_0x459c8a[_0xeabc('0x38')]));if(_0x131722['query'][_0xeabc('0x3a')]){_0x5b2934[_0xeabc('0x37')]=_[_0xeabc('0x3b')](_0x5b2934['where'],{'$or':_['map'](_0x3c1b5b,function(_0x452580){if(_0x452580['type']!==_0xeabc('0x3c')){var _0x4ebd64={};_0x4ebd64[_0x452580['name']]={'$like':'%'+_0x131722['query']['filter']+'%'};return _0x4ebd64;}})});}_0x5b2934=_[_0xeabc('0x3b')]({},_0x5b2934,_0x131722['options']);var _0x257fe8={'where':_0x5b2934[_0xeabc('0x37')]};return db['SquareReport'][_0xeabc('0x1c')](_0x257fe8)['then'](function(_0x3d48f4){_0x5bf8f2['count']=_0x3d48f4;if(_0x131722[_0xeabc('0x30')][_0xeabc('0x3d')]){_0x5b2934[_0xeabc('0x3e')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x5b2934);})['then'](function(_0x46056c){_0x5bf8f2[_0xeabc('0x3f')]=_0x46056c;return _0x5bf8f2;})[_0xeabc('0x24')](respondWithFilteredResult(_0x4c2693,_0x5b2934))['catch'](handleError(_0x4c2693,null));};exports['show']=function(_0x5cd62e,_0x1680e8){var _0x5e9cb3={'raw':!![],'where':{'id':_0x5cd62e['params']['id']}},_0xc6af4d={};_0xc6af4d[_0xeabc('0x2f')]=_['keys'](db['SquareReport']['rawAttributes']);_0xc6af4d[_0xeabc('0x30')]=_[_0xeabc('0x40')](_0x5cd62e[_0xeabc('0x30')]);_0xc6af4d[_0xeabc('0x38')]=_['intersection'](_0xc6af4d[_0xeabc('0x2f')],_0xc6af4d['query']);_0x5e9cb3[_0xeabc('0x32')]=_[_0xeabc('0x31')](_0xc6af4d[_0xeabc('0x2f')],qs[_0xeabc('0x33')](_0x5cd62e[_0xeabc('0x30')]['fields']));_0x5e9cb3['attributes']=_0x5e9cb3[_0xeabc('0x32')]['length']?_0x5e9cb3[_0xeabc('0x32')]:_0xc6af4d[_0xeabc('0x2f')];if(_0x5cd62e['query'][_0xeabc('0x3d')]){_0x5e9cb3[_0xeabc('0x3e')]=[{'all':!![]}];}_0x5e9cb3=_[_0xeabc('0x3b')]({},_0x5e9cb3,_0x5cd62e[_0xeabc('0x41')]);return db[_0xeabc('0x42')][_0xeabc('0x43')](_0x5e9cb3)[_0xeabc('0x24')](handleEntityNotFound(_0x1680e8,null))['then'](respondWithResult(_0x1680e8,null))[_0xeabc('0x44')](handleError(_0x1680e8,null));};exports[_0xeabc('0x45')]=function(_0x2e7a5e,_0x1b41c8){return db[_0xeabc('0x42')][_0xeabc('0x45')](_0x2e7a5e[_0xeabc('0x46')],{})[_0xeabc('0x24')](respondWithResult(_0x1b41c8,0xc9))[_0xeabc('0x44')](handleError(_0x1b41c8,null));};exports[_0xeabc('0x23')]=function(_0x5689fc,_0x38356c){if(_0x5689fc[_0xeabc('0x46')]['id']){delete _0x5689fc[_0xeabc('0x46')]['id'];}return db[_0xeabc('0x42')][_0xeabc('0x43')]({'where':{'id':_0x5689fc[_0xeabc('0x47')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x38356c,null))['then'](saveUpdates(_0x5689fc[_0xeabc('0x46')],null))[_0xeabc('0x24')](respondWithResult(_0x38356c,null))[_0xeabc('0x44')](handleError(_0x38356c,null));};exports[_0xeabc('0x25')]=function(_0x47440e,_0x58e2c1){return db[_0xeabc('0x42')][_0xeabc('0x43')]({'where':{'id':_0x47440e[_0xeabc('0x47')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x58e2c1,null))['then'](removeEntity(_0x58e2c1,null))[_0xeabc('0x44')](handleError(_0x58e2c1,null));};exports[_0xeabc('0x48')]=function(_0x568847,_0x43e596){return db['SquareReport'][_0xeabc('0x48')]()['then'](respondWithResult(_0x43e596,null))[_0xeabc('0x44')](handleError(_0x43e596,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index ad57f55..a372d9c 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 _0xa663=['leaveAt','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uid_pname','uniqueid','project_name'];(function(_0x5b8bc4,_0x3f3f94){var _0x598c5d=function(_0x24f008){while(--_0x24f008){_0x5b8bc4['push'](_0x5b8bc4['shift']());}};_0x598c5d(++_0x3f3f94);}(_0xa663,0x189));var _0x3a66=function(_0x456fc1,_0x5e289d){_0x456fc1=_0x456fc1-0x0;var _0x35587a=_0xa663[_0x456fc1];return _0x35587a;};'use strict';var _=require(_0x3a66('0x0'));var util=require('util');var logger=require(_0x3a66('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3a66('0x2'));var fs=require('fs');var path=require(_0x3a66('0x3'));var rimraf=require(_0x3a66('0x4'));var config=require(_0x3a66('0x5'));var attributes=require(_0x3a66('0x6'));module['exports']=function(_0x34cb17,_0x2a681e){return _0x34cb17[_0x3a66('0x7')](_0x3a66('0x8'),attributes,{'tableName':_0x3a66('0x9'),'paranoid':![],'indexes':[{'name':_0x3a66('0xa'),'fields':[_0x3a66('0xb'),_0x3a66('0xc')]},{'name':'leaveAt','fields':[_0x3a66('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xed24=['uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./squareReport.attributes','exports','report_square'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0xed24,0x8b));var _0x4ed2=function(_0x546177,_0xfbb53){_0x546177=_0x546177-0x0;var _0x5c3720=_0xed24[_0x546177];return _0x5c3720;};'use strict';var _=require(_0x4ed2('0x0'));var util=require(_0x4ed2('0x1'));var logger=require(_0x4ed2('0x2'))(_0x4ed2('0x3'));var moment=require(_0x4ed2('0x4'));var BPromise=require(_0x4ed2('0x5'));var rp=require(_0x4ed2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4ed2('0x7'));var attributes=require(_0x4ed2('0x8'));module[_0x4ed2('0x9')]=function(_0x2b85ec,_0x412888){return _0x2b85ec['define']('SquareReport',attributes,{'tableName':_0x4ed2('0xa'),'paranoid':![],'indexes':[{'name':_0x4ed2('0xb'),'fields':[_0x4ed2('0xc'),_0x4ed2('0xd')]},{'name':'leaveAt','fields':[_0x4ed2('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index edf3ae8..8e96ccc 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 _0xe5c2=['info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareReport','SquareReport','options','raw','debug','UpdateSquareReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x136aae,_0x35aad0){var _0x35aba9=function(_0x48cbed){while(--_0x48cbed){_0x136aae['push'](_0x136aae['shift']());}};_0x35aba9(++_0x35aad0);}(_0xe5c2,0x167));var _0x2e5c=function(_0x1c6786,_0x2e4a25){_0x1c6786=_0x1c6786-0x0;var _0x2623bf=_0xe5c2[_0x1c6786];return _0x2623bf;};'use strict';var _=require(_0x2e5c('0x0'));var util=require(_0x2e5c('0x1'));var moment=require(_0x2e5c('0x2'));var BPromise=require(_0x2e5c('0x3'));var rs=require(_0x2e5c('0x4'));var fs=require('fs');var Redis=require(_0x2e5c('0x5'));var db=require(_0x2e5c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e5c('0x7'))(_0x2e5c('0x8'));var config=require('../../config/environment');var jayson=require(_0x2e5c('0x9'));var client=jayson[_0x2e5c('0xa')][_0x2e5c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18b8c0,_0x38670e,_0x290bb4){return new BPromise(function(_0x308c0b,_0x32313c){return client['request'](_0x18b8c0,_0x290bb4)[_0x2e5c('0xc')](function(_0x5a0466){logger[_0x2e5c('0xd')](_0x2e5c('0xe'),_0x38670e,'request\x20sent');logger['debug'](_0x2e5c('0xf'),_0x38670e,_0x2e5c('0x10'),JSON[_0x2e5c('0x11')](_0x5a0466));if(_0x5a0466[_0x2e5c('0x12')]){if(_0x5a0466['error']['code']===0x1f4){logger[_0x2e5c('0x12')]('SquareReport,\x20%s,\x20%s',_0x38670e,_0x5a0466['error'][_0x2e5c('0x13')]);return _0x32313c(_0x5a0466[_0x2e5c('0x12')][_0x2e5c('0x13')]);}logger['error'](_0x2e5c('0xe'),_0x38670e,_0x5a0466['error'][_0x2e5c('0x13')]);return _0x308c0b(_0x5a0466['error']['message']);}else{logger[_0x2e5c('0xd')](_0x2e5c('0xe'),_0x38670e,_0x2e5c('0x10'));_0x308c0b(_0x5a0466[_0x2e5c('0x14')]['message']);}})[_0x2e5c('0x15')](function(_0x247dd5){logger['error']('SquareReport,\x20%s,\x20%s',_0x38670e,_0x247dd5);_0x32313c(_0x247dd5);});});}exports[_0x2e5c('0x16')]=function(_0x4324c0){var _0x137f18=this;return new Promise(function(_0xabf9ac,_0x3ea026){return db[_0x2e5c('0x17')]['create'](_0x4324c0['body'],{'raw':_0x4324c0[_0x2e5c('0x18')]?_0x4324c0[_0x2e5c('0x18')][_0x2e5c('0x19')]===undefined?!![]:![]:!![]})[_0x2e5c('0xc')](function(_0x4fe483){logger[_0x2e5c('0xd')](_0x2e5c('0x16'),_0x4324c0);logger[_0x2e5c('0x1a')](_0x2e5c('0x16'),_0x4324c0,JSON['stringify'](_0x4fe483));_0xabf9ac(_0x4fe483);})[_0x2e5c('0x15')](function(_0x4022de){logger[_0x2e5c('0x12')](_0x2e5c('0x16'),_0x4022de[_0x2e5c('0x13')],_0x4324c0);_0x3ea026(_0x137f18[_0x2e5c('0x12')](0x1f4,_0x4022de[_0x2e5c('0x13')]));});});};exports[_0x2e5c('0x1b')]=function(_0x2ee388){var _0x3333a6=this;return new Promise(function(_0x40951c,_0x4e2083){return db[_0x2e5c('0x17')][_0x2e5c('0x1c')](_0x2ee388['body'],{'raw':_0x2ee388[_0x2e5c('0x18')]?_0x2ee388[_0x2e5c('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ee388[_0x2e5c('0x18')]?_0x2ee388[_0x2e5c('0x18')][_0x2e5c('0x1d')]||null:null,'attributes':_0x2ee388[_0x2e5c('0x18')]?_0x2ee388['options'][_0x2e5c('0x1e')]||null:null,'limit':_0x2ee388[_0x2e5c('0x18')]?_0x2ee388['options']['limit']||null:null})[_0x2e5c('0xc')](function(_0x29e36d){logger[_0x2e5c('0xd')]('UpdateSquareReport',_0x2ee388);logger[_0x2e5c('0x1a')](_0x2e5c('0x1b'),_0x2ee388,JSON[_0x2e5c('0x11')](_0x29e36d));_0x40951c(_0x29e36d);})[_0x2e5c('0x15')](function(_0x3d0975){logger['error'](_0x2e5c('0x1b'),_0x3d0975['message'],_0x2ee388);_0x4e2083(_0x3333a6[_0x2e5c('0x12')](0x1f4,_0x3d0975[_0x2e5c('0x13')]));});});}; \ No newline at end of file +var _0x9a59=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','then','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareReport,\x20%s,\x20%s','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','attributes','limit'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9a59,0x1b2));var _0x99a5=function(_0x279f66,_0x338c82){_0x279f66=_0x279f66-0x0;var _0x4497e4=_0x9a59[_0x279f66];return _0x4497e4;};'use strict';var _=require(_0x99a5('0x0'));var util=require(_0x99a5('0x1'));var moment=require(_0x99a5('0x2'));var BPromise=require(_0x99a5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99a5('0x4'));var db=require(_0x99a5('0x5'))['db'];var utils=require(_0x99a5('0x6'));var logger=require('../../config/logger')(_0x99a5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x99a5('0x8')][_0x99a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ee505,_0x2b7e4e,_0x320f49){return new BPromise(function(_0x5c303c,_0x2182b1){return client['request'](_0x3ee505,_0x320f49)[_0x99a5('0xa')](function(_0x2fc2b0){logger[_0x99a5('0xb')]('SquareReport,\x20%s,\x20%s',_0x2b7e4e,_0x99a5('0xc'));logger[_0x99a5('0xd')](_0x99a5('0xe'),_0x2b7e4e,_0x99a5('0xc'),JSON[_0x99a5('0xf')](_0x2fc2b0));if(_0x2fc2b0[_0x99a5('0x10')]){if(_0x2fc2b0[_0x99a5('0x10')][_0x99a5('0x11')]===0x1f4){logger[_0x99a5('0x10')]('SquareReport,\x20%s,\x20%s',_0x2b7e4e,_0x2fc2b0['error']['message']);return _0x2182b1(_0x2fc2b0[_0x99a5('0x10')][_0x99a5('0x12')]);}logger['error'](_0x99a5('0x13'),_0x2b7e4e,_0x2fc2b0[_0x99a5('0x10')]['message']);return _0x5c303c(_0x2fc2b0[_0x99a5('0x10')][_0x99a5('0x12')]);}else{logger[_0x99a5('0xb')]('SquareReport,\x20%s,\x20%s',_0x2b7e4e,'request\x20sent');_0x5c303c(_0x2fc2b0[_0x99a5('0x14')]['message']);}})[_0x99a5('0x15')](function(_0xbf070f){logger['error'](_0x99a5('0x13'),_0x2b7e4e,_0xbf070f);_0x2182b1(_0xbf070f);});});}exports[_0x99a5('0x16')]=function(_0x4f6b77){var _0x50f5dc=this;return new Promise(function(_0x33c4da,_0x3ca796){return db[_0x99a5('0x17')][_0x99a5('0x18')](_0x4f6b77[_0x99a5('0x19')],{'raw':_0x4f6b77[_0x99a5('0x1a')]?_0x4f6b77[_0x99a5('0x1a')][_0x99a5('0x1b')]===undefined?!![]:![]:!![]})[_0x99a5('0xa')](function(_0x5237f1){logger[_0x99a5('0xb')](_0x99a5('0x16'),_0x4f6b77);logger[_0x99a5('0xd')](_0x99a5('0x16'),_0x4f6b77,JSON[_0x99a5('0xf')](_0x5237f1));_0x33c4da(_0x5237f1);})[_0x99a5('0x15')](function(_0x1115d8){logger[_0x99a5('0x10')](_0x99a5('0x16'),_0x1115d8[_0x99a5('0x12')],_0x4f6b77);_0x3ca796(_0x50f5dc[_0x99a5('0x10')](0x1f4,_0x1115d8['message']));});});};exports[_0x99a5('0x1c')]=function(_0x483f04){var _0x314421=this;return new Promise(function(_0x2b9de5,_0x995176){return db[_0x99a5('0x17')]['update'](_0x483f04[_0x99a5('0x19')],{'raw':_0x483f04[_0x99a5('0x1a')]?_0x483f04[_0x99a5('0x1a')][_0x99a5('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x483f04[_0x99a5('0x1a')]?_0x483f04['options']['where']||null:null,'attributes':_0x483f04['options']?_0x483f04['options'][_0x99a5('0x1d')]||null:null,'limit':_0x483f04[_0x99a5('0x1a')]?_0x483f04[_0x99a5('0x1a')][_0x99a5('0x1e')]||null:null})[_0x99a5('0xa')](function(_0x5a2d04){logger[_0x99a5('0xb')]('UpdateSquareReport',_0x483f04);logger[_0x99a5('0xd')](_0x99a5('0x1c'),_0x483f04,JSON['stringify'](_0x5a2d04));_0x2b9de5(_0x5a2d04);})[_0x99a5('0x15')](function(_0x5028e2){logger[_0x99a5('0x10')](_0x99a5('0x1c'),_0x5028e2[_0x99a5('0x12')],_0x483f04);_0x995176(_0x314421[_0x99a5('0x10')](0x1f4,_0x5028e2['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 14f32e7..07c9288 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 _0x814b=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x814b,0x1a2));var _0xb814=function(_0x327cbf,_0x114362){_0x327cbf=_0x327cbf-0x0;var _0x409cb8=_0x814b[_0x327cbf];return _0x409cb8;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['describe']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['delete'](_0xb814('0xd'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router; \ No newline at end of file +var _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x44f4d1,_0x5eb78d){var _0x2fccee=function(_0x3d0ad3){while(--_0x3d0ad3){_0x44f4d1['push'](_0x44f4d1['shift']());}};_0x2fccee(++_0x5eb78d);}(_0x7a54,0x106));var _0x47a5=function(_0x4783a2,_0xe7a765){_0x4783a2=_0x4783a2-0x0;var _0x526527=_0x7a54[_0x4783a2];return _0x526527;};'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 auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 0676674..1f761c5 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 _0x5078=['TEXT','sequelize','exports','STRING'];(function(_0x30ab18,_0x1fe09e){var _0x479821=function(_0xc1a2a){while(--_0xc1a2a){_0x30ab18['push'](_0x30ab18['shift']());}};_0x479821(++_0x1fe09e);}(_0x5078,0x1e1));var _0x8507=function(_0x44de50,_0x31e308){_0x44de50=_0x44de50-0x0;var _0x43cbb5=_0x5078[_0x44de50];return _0x43cbb5;};'use strict';var Sequelize=require(_0x8507('0x0'));module[_0x8507('0x1')]={'uniqueid':{'type':Sequelize[_0x8507('0x2')]},'node':{'type':Sequelize[_0x8507('0x2')]},'application':{'type':Sequelize[_0x8507('0x2')]},'data':{'type':Sequelize[_0x8507('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8507('0x2')]}}; \ No newline at end of file +var _0xc1ef=['sequelize','STRING','TEXT'];(function(_0xac0de1,_0x12d3d9){var _0x1c1995=function(_0x3f96e8){while(--_0x3f96e8){_0xac0de1['push'](_0xac0de1['shift']());}};_0x1c1995(++_0x12d3d9);}(_0xc1ef,0xbd));var _0xfc1e=function(_0xfa0bb3,_0x27f119){_0xfa0bb3=_0xfa0bb3-0x0;var _0x4e1ce6=_0xc1ef[_0xfa0bb3];return _0x4e1ce6;};'use strict';var Sequelize=require(_0xfc1e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xfc1e('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xfc1e('0x1')]},'data':{'type':Sequelize[_0xfc1e('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xfc1e('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 2777f5e..a311d26 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 _0x2b6d=['pick','filter','merge','VIRTUAL','options','SquareDetailsReport','includeAll','include','rows','show','length','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','count','offset','limit','status','set','json','apply','reject','update','then','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0x2b6d,0xa8));var _0xd2b6=function(_0xb27575,_0x3f1835){_0xb27575=_0xb27575-0x0;var _0x30e859=_0x2b6d[_0xb27575];return _0x30e859;};'use strict';var pdf=require(_0xd2b6('0x0'));var emlformat=require(_0xd2b6('0x1'));var rimraf=require(_0xd2b6('0x2'));var zipdir=require(_0xd2b6('0x3'));var jsonpatch=require(_0xd2b6('0x4'));var rp=require(_0xd2b6('0x5'));var moment=require(_0xd2b6('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd2b6('0x7'));var path=require(_0xd2b6('0x8'));var sox=require(_0xd2b6('0x9'));var csv=require(_0xd2b6('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd2b6('0xb'));var squel=require(_0xd2b6('0xc'));var crypto=require(_0xd2b6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd2b6('0xe'));var toCsv=require(_0xd2b6('0xa'));var querystring=require(_0xd2b6('0xf'));var Papa=require(_0xd2b6('0x10'));var Redis=require(_0xd2b6('0x11'));var authService=require(_0xd2b6('0x12'));var qs=require(_0xd2b6('0x13'));var as=require(_0xd2b6('0x14'));var hardwareService=require(_0xd2b6('0x15'));var logger=require(_0xd2b6('0x16'))(_0xd2b6('0x17'));var utils=require(_0xd2b6('0x18'));var config=require(_0xd2b6('0x19'));var db=require(_0xd2b6('0x1a'))['db'];function respondWithStatusCode(_0x1c0692,_0x3ba33c){_0x3ba33c=_0x3ba33c||0xcc;return function(_0x1647f5){if(_0x1647f5){return _0x1c0692['sendStatus'](_0x3ba33c);}return _0x1c0692['status'](_0x3ba33c)[_0xd2b6('0x1b')]();};}function respondWithResult(_0x41a8cc,_0x2734f6){_0x2734f6=_0x2734f6||0xc8;return function(_0x55350f){if(_0x55350f){return _0x41a8cc['status'](_0x2734f6)['json'](_0x55350f);}};}function respondWithFilteredResult(_0x56f1da,_0x4be053){return function(_0x368e08){if(_0x368e08){var _0x2e6b16=_0x368e08[_0xd2b6('0x1c')],_0x185f0d=_0x4be053[_0xd2b6('0x1d')],_0x4b4753=_0x4be053[_0xd2b6('0x1d')]+_0x4be053[_0xd2b6('0x1e')],_0x5f138e;if(_0x4b4753>=_0x2e6b16){_0x4b4753=_0x2e6b16;_0x5f138e=0xc8;}else{_0x5f138e=0xce;}_0x56f1da[_0xd2b6('0x1f')](_0x5f138e);return _0x56f1da[_0xd2b6('0x20')]('Content-Range',_0x185f0d+'-'+_0x4b4753+'/'+_0x2e6b16)[_0xd2b6('0x21')](_0x368e08);}return null;};}function patchUpdates(_0x2ddf56){return function(_0x150be6){try{jsonpatch[_0xd2b6('0x22')](_0x150be6,_0x2ddf56,!![]);}catch(_0x3a1f7d){return BPromise[_0xd2b6('0x23')](_0x3a1f7d);}return _0x150be6['save']();};}function saveUpdates(_0x21ec6a,_0x5e554b){return function(_0x481c6c){if(_0x481c6c){return _0x481c6c[_0xd2b6('0x24')](_0x21ec6a)[_0xd2b6('0x25')](function(_0x168324){return _0x168324;});}return null;};}function removeEntity(_0x1c0524,_0x2a9df7){return function(_0x325e12){if(_0x325e12){return _0x325e12[_0xd2b6('0x26')]()[_0xd2b6('0x25')](function(){_0x1c0524[_0xd2b6('0x1f')](0xcc)[_0xd2b6('0x1b')]();});}};}function handleEntityNotFound(_0x45a56f,_0x4355b9){return function(_0x3b9c25){if(!_0x3b9c25){_0x45a56f[_0xd2b6('0x27')](0x194);}return _0x3b9c25;};}function handleError(_0x173da2,_0x34d113){_0x34d113=_0x34d113||0x1f4;return function(_0x5d589a){logger['error'](_0x5d589a['stack']);if(_0x5d589a[_0xd2b6('0x28')]){delete _0x5d589a[_0xd2b6('0x28')];}_0x173da2[_0xd2b6('0x1f')](_0x34d113)[_0xd2b6('0x29')](_0x5d589a);};}exports[_0xd2b6('0x2a')]=function(_0x2d98ca,_0x31808e){var _0x4d23ae={},_0x250299={},_0x5df9b3={'count':0x0,'rows':[]};var _0x16fd9a=_[_0xd2b6('0x2b')](db['SquareDetailsReport'][_0xd2b6('0x2c')],function(_0x1f9788){return{'name':_0x1f9788[_0xd2b6('0x2d')],'type':_0x1f9788[_0xd2b6('0x2e')][_0xd2b6('0x2f')]};});_0x250299['model']=_[_0xd2b6('0x2b')](_0x16fd9a,_0xd2b6('0x28'));_0x250299[_0xd2b6('0x30')]=_[_0xd2b6('0x31')](_0x2d98ca[_0xd2b6('0x30')]);_0x250299['filters']=_[_0xd2b6('0x32')](_0x250299['model'],_0x250299['query']);_0x4d23ae['attributes']=_[_0xd2b6('0x32')](_0x250299['model'],qs[_0xd2b6('0x33')](_0x2d98ca[_0xd2b6('0x30')][_0xd2b6('0x33')]));_0x4d23ae[_0xd2b6('0x34')]=_0x4d23ae[_0xd2b6('0x34')]['length']?_0x4d23ae[_0xd2b6('0x34')]:_0x250299[_0xd2b6('0x35')];if(!_0x2d98ca[_0xd2b6('0x30')][_0xd2b6('0x36')](_0xd2b6('0x37'))){_0x4d23ae['limit']=qs[_0xd2b6('0x1e')](_0x2d98ca[_0xd2b6('0x30')][_0xd2b6('0x1e')]);_0x4d23ae[_0xd2b6('0x1d')]=qs['offset'](_0x2d98ca[_0xd2b6('0x30')]['offset']);}_0x4d23ae[_0xd2b6('0x38')]=qs[_0xd2b6('0x39')](_0x2d98ca[_0xd2b6('0x30')][_0xd2b6('0x39')]);_0x4d23ae[_0xd2b6('0x3a')]=qs[_0xd2b6('0x3b')](_[_0xd2b6('0x3c')](_0x2d98ca[_0xd2b6('0x30')],_0x250299[_0xd2b6('0x3b')]));if(_0x2d98ca[_0xd2b6('0x30')][_0xd2b6('0x3d')]){_0x4d23ae[_0xd2b6('0x3a')]=_[_0xd2b6('0x3e')](_0x4d23ae[_0xd2b6('0x3a')],{'$or':_['map'](_0x16fd9a,function(_0x594747){if(_0x594747[_0xd2b6('0x2e')]!==_0xd2b6('0x3f')){var _0x5ada2e={};_0x5ada2e[_0x594747[_0xd2b6('0x28')]]={'$like':'%'+_0x2d98ca['query'][_0xd2b6('0x3d')]+'%'};return _0x5ada2e;}})});}_0x4d23ae=_['merge']({},_0x4d23ae,_0x2d98ca[_0xd2b6('0x40')]);var _0x4afe9b={'where':_0x4d23ae[_0xd2b6('0x3a')]};return db[_0xd2b6('0x41')]['count'](_0x4afe9b)[_0xd2b6('0x25')](function(_0x11b165){_0x5df9b3[_0xd2b6('0x1c')]=_0x11b165;if(_0x2d98ca[_0xd2b6('0x30')][_0xd2b6('0x42')]){_0x4d23ae[_0xd2b6('0x43')]=[{'all':!![]}];}return db[_0xd2b6('0x41')]['findAll'](_0x4d23ae);})[_0xd2b6('0x25')](function(_0xf99448){_0x5df9b3[_0xd2b6('0x44')]=_0xf99448;return _0x5df9b3;})[_0xd2b6('0x25')](respondWithFilteredResult(_0x31808e,_0x4d23ae))['catch'](handleError(_0x31808e,null));};exports[_0xd2b6('0x45')]=function(_0xf1cf33,_0x1abd78){var _0x3c3383={'raw':!![],'where':{'id':_0xf1cf33['params']['id']}},_0x1f4e02={};_0x1f4e02[_0xd2b6('0x35')]=_[_0xd2b6('0x31')](db[_0xd2b6('0x41')]['rawAttributes']);_0x1f4e02[_0xd2b6('0x30')]=_['keys'](_0xf1cf33[_0xd2b6('0x30')]);_0x1f4e02[_0xd2b6('0x3b')]=_[_0xd2b6('0x32')](_0x1f4e02[_0xd2b6('0x35')],_0x1f4e02[_0xd2b6('0x30')]);_0x3c3383[_0xd2b6('0x34')]=_[_0xd2b6('0x32')](_0x1f4e02[_0xd2b6('0x35')],qs[_0xd2b6('0x33')](_0xf1cf33[_0xd2b6('0x30')]['fields']));_0x3c3383['attributes']=_0x3c3383[_0xd2b6('0x34')][_0xd2b6('0x46')]?_0x3c3383['attributes']:_0x1f4e02[_0xd2b6('0x35')];if(_0xf1cf33[_0xd2b6('0x30')]['includeAll']){_0x3c3383[_0xd2b6('0x43')]=[{'all':!![]}];}_0x3c3383=_['merge']({},_0x3c3383,_0xf1cf33[_0xd2b6('0x40')]);return db[_0xd2b6('0x41')][_0xd2b6('0x47')](_0x3c3383)[_0xd2b6('0x25')](handleEntityNotFound(_0x1abd78,null))['then'](respondWithResult(_0x1abd78,null))[_0xd2b6('0x48')](handleError(_0x1abd78,null));};exports['create']=function(_0x1f8b19,_0x4a3c5b){return db[_0xd2b6('0x41')][_0xd2b6('0x49')](_0x1f8b19['body'],{})[_0xd2b6('0x25')](respondWithResult(_0x4a3c5b,0xc9))[_0xd2b6('0x48')](handleError(_0x4a3c5b,null));};exports[_0xd2b6('0x24')]=function(_0xea9a30,_0x2bb48f){if(_0xea9a30[_0xd2b6('0x4a')]['id']){delete _0xea9a30[_0xd2b6('0x4a')]['id'];}return db[_0xd2b6('0x41')][_0xd2b6('0x47')]({'where':{'id':_0xea9a30[_0xd2b6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2bb48f,null))[_0xd2b6('0x25')](saveUpdates(_0xea9a30['body'],null))['then'](respondWithResult(_0x2bb48f,null))[_0xd2b6('0x48')](handleError(_0x2bb48f,null));};exports[_0xd2b6('0x26')]=function(_0xb15c97,_0x5e65c8){return db[_0xd2b6('0x41')][_0xd2b6('0x47')]({'where':{'id':_0xb15c97[_0xd2b6('0x4b')]['id']}})[_0xd2b6('0x25')](handleEntityNotFound(_0x5e65c8,null))[_0xd2b6('0x25')](removeEntity(_0x5e65c8,null))[_0xd2b6('0x48')](handleError(_0x5e65c8,null));};exports['describe']=function(_0x35e33a,_0x48663e){return db[_0xd2b6('0x41')]['describe']()['then'](respondWithResult(_0x48663e,null))['catch'](handleError(_0x48663e,null));}; \ No newline at end of file +var _0x477e=['query','keys','intersection','model','attributes','fields','length','sort','where','filters','pick','merge','options','SquareDetailsReport','includeAll','include','rows','catch','params','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','map','rawAttributes','type','key'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x477e,0xd1));var _0xe477=function(_0x2d6197,_0x82ebfb){_0x2d6197=_0x2d6197-0x0;var _0x4d0e75=_0x477e[_0x2d6197];return _0x4d0e75;};'use strict';var pdf=require(_0xe477('0x0'));var emlformat=require(_0xe477('0x1'));var rimraf=require(_0xe477('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe477('0x3'));var rp=require(_0xe477('0x4'));var moment=require(_0xe477('0x5'));var BPromise=require(_0xe477('0x6'));var Mustache=require('mustache');var util=require(_0xe477('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe477('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe477('0x9'));var jsforce=require(_0xe477('0xa'));var deskjs=require(_0xe477('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe477('0xc'));var Papa=require(_0xe477('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe477('0xe'));var as=require(_0xe477('0xf'));var hardwareService=require(_0xe477('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe477('0x11'));var db=require(_0xe477('0x12'))['db'];function respondWithStatusCode(_0x1d0213,_0x4b6733){_0x4b6733=_0x4b6733||0xcc;return function(_0x3a5d55){if(_0x3a5d55){return _0x1d0213[_0xe477('0x13')](_0x4b6733);}return _0x1d0213[_0xe477('0x14')](_0x4b6733)['end']();};}function respondWithResult(_0x3ab774,_0x1f7006){_0x1f7006=_0x1f7006||0xc8;return function(_0x184d5e){if(_0x184d5e){return _0x3ab774[_0xe477('0x14')](_0x1f7006)[_0xe477('0x15')](_0x184d5e);}};}function respondWithFilteredResult(_0x3414be,_0x2862){return function(_0x3a475c){if(_0x3a475c){var _0x13915e=_0x3a475c[_0xe477('0x16')],_0x451e05=_0x2862[_0xe477('0x17')],_0x28ee24=_0x2862['offset']+_0x2862[_0xe477('0x18')],_0x3f573f;if(_0x28ee24>=_0x13915e){_0x28ee24=_0x13915e;_0x3f573f=0xc8;}else{_0x3f573f=0xce;}_0x3414be[_0xe477('0x14')](_0x3f573f);return _0x3414be['set'](_0xe477('0x19'),_0x451e05+'-'+_0x28ee24+'/'+_0x13915e)['json'](_0x3a475c);}return null;};}function patchUpdates(_0x592b30){return function(_0x3b46b4){try{jsonpatch[_0xe477('0x1a')](_0x3b46b4,_0x592b30,!![]);}catch(_0x56e1dd){return BPromise[_0xe477('0x1b')](_0x56e1dd);}return _0x3b46b4['save']();};}function saveUpdates(_0x4fdaa9,_0x49af40){return function(_0x50e412){if(_0x50e412){return _0x50e412[_0xe477('0x1c')](_0x4fdaa9)['then'](function(_0x277b47){return _0x277b47;});}return null;};}function removeEntity(_0x2cb09b,_0x3f5ba3){return function(_0x183dcb){if(_0x183dcb){return _0x183dcb[_0xe477('0x1d')]()[_0xe477('0x1e')](function(){_0x2cb09b[_0xe477('0x14')](0xcc)[_0xe477('0x1f')]();});}};}function handleEntityNotFound(_0x348ce8,_0x4de665){return function(_0x5ec44a){if(!_0x5ec44a){_0x348ce8[_0xe477('0x13')](0x194);}return _0x5ec44a;};}function handleError(_0x4d280a,_0x53bb5d){_0x53bb5d=_0x53bb5d||0x1f4;return function(_0x201e74){logger[_0xe477('0x20')](_0x201e74[_0xe477('0x21')]);if(_0x201e74['name']){delete _0x201e74[_0xe477('0x22')];}_0x4d280a[_0xe477('0x14')](_0x53bb5d)['send'](_0x201e74);};}exports['index']=function(_0x290784,_0x26eb2d){var _0x294991={},_0x5161f0={},_0x107d01={'count':0x0,'rows':[]};var _0x29d8e6=_[_0xe477('0x23')](db['SquareDetailsReport'][_0xe477('0x24')],function(_0x3721de){return{'name':_0x3721de['fieldName'],'type':_0x3721de[_0xe477('0x25')][_0xe477('0x26')]};});_0x5161f0['model']=_[_0xe477('0x23')](_0x29d8e6,_0xe477('0x22'));_0x5161f0[_0xe477('0x27')]=_[_0xe477('0x28')](_0x290784['query']);_0x5161f0['filters']=_[_0xe477('0x29')](_0x5161f0[_0xe477('0x2a')],_0x5161f0[_0xe477('0x27')]);_0x294991[_0xe477('0x2b')]=_[_0xe477('0x29')](_0x5161f0[_0xe477('0x2a')],qs['fields'](_0x290784[_0xe477('0x27')][_0xe477('0x2c')]));_0x294991[_0xe477('0x2b')]=_0x294991[_0xe477('0x2b')][_0xe477('0x2d')]?_0x294991[_0xe477('0x2b')]:_0x5161f0[_0xe477('0x2a')];if(!_0x290784[_0xe477('0x27')]['hasOwnProperty']('nolimit')){_0x294991['limit']=qs[_0xe477('0x18')](_0x290784[_0xe477('0x27')]['limit']);_0x294991[_0xe477('0x17')]=qs[_0xe477('0x17')](_0x290784[_0xe477('0x27')][_0xe477('0x17')]);}_0x294991['order']=qs[_0xe477('0x2e')](_0x290784['query'][_0xe477('0x2e')]);_0x294991[_0xe477('0x2f')]=qs[_0xe477('0x30')](_[_0xe477('0x31')](_0x290784[_0xe477('0x27')],_0x5161f0['filters']));if(_0x290784[_0xe477('0x27')]['filter']){_0x294991[_0xe477('0x2f')]=_[_0xe477('0x32')](_0x294991[_0xe477('0x2f')],{'$or':_[_0xe477('0x23')](_0x29d8e6,function(_0x1c27ae){if(_0x1c27ae[_0xe477('0x25')]!=='VIRTUAL'){var _0xdb8788={};_0xdb8788[_0x1c27ae['name']]={'$like':'%'+_0x290784[_0xe477('0x27')]['filter']+'%'};return _0xdb8788;}})});}_0x294991=_['merge']({},_0x294991,_0x290784[_0xe477('0x33')]);var _0x575603={'where':_0x294991[_0xe477('0x2f')]};return db[_0xe477('0x34')][_0xe477('0x16')](_0x575603)[_0xe477('0x1e')](function(_0x29307c){_0x107d01[_0xe477('0x16')]=_0x29307c;if(_0x290784['query'][_0xe477('0x35')]){_0x294991[_0xe477('0x36')]=[{'all':!![]}];}return db[_0xe477('0x34')]['findAll'](_0x294991);})[_0xe477('0x1e')](function(_0x4bb5ea){_0x107d01[_0xe477('0x37')]=_0x4bb5ea;return _0x107d01;})[_0xe477('0x1e')](respondWithFilteredResult(_0x26eb2d,_0x294991))[_0xe477('0x38')](handleError(_0x26eb2d,null));};exports['show']=function(_0x9a1740,_0x44744e){var _0x46287={'raw':!![],'where':{'id':_0x9a1740[_0xe477('0x39')]['id']}},_0x394f3c={};_0x394f3c[_0xe477('0x2a')]=_[_0xe477('0x28')](db[_0xe477('0x34')][_0xe477('0x24')]);_0x394f3c[_0xe477('0x27')]=_[_0xe477('0x28')](_0x9a1740[_0xe477('0x27')]);_0x394f3c['filters']=_['intersection'](_0x394f3c[_0xe477('0x2a')],_0x394f3c[_0xe477('0x27')]);_0x46287[_0xe477('0x2b')]=_[_0xe477('0x29')](_0x394f3c[_0xe477('0x2a')],qs[_0xe477('0x2c')](_0x9a1740[_0xe477('0x27')][_0xe477('0x2c')]));_0x46287[_0xe477('0x2b')]=_0x46287[_0xe477('0x2b')][_0xe477('0x2d')]?_0x46287[_0xe477('0x2b')]:_0x394f3c['model'];if(_0x9a1740['query'][_0xe477('0x35')]){_0x46287[_0xe477('0x36')]=[{'all':!![]}];}_0x46287=_[_0xe477('0x32')]({},_0x46287,_0x9a1740[_0xe477('0x33')]);return db['SquareDetailsReport']['find'](_0x46287)[_0xe477('0x1e')](handleEntityNotFound(_0x44744e,null))[_0xe477('0x1e')](respondWithResult(_0x44744e,null))[_0xe477('0x38')](handleError(_0x44744e,null));};exports[_0xe477('0x3a')]=function(_0x738d01,_0x323c71){return db[_0xe477('0x34')]['create'](_0x738d01[_0xe477('0x3b')],{})['then'](respondWithResult(_0x323c71,0xc9))[_0xe477('0x38')](handleError(_0x323c71,null));};exports[_0xe477('0x1c')]=function(_0x2ea385,_0x3372a1){if(_0x2ea385[_0xe477('0x3b')]['id']){delete _0x2ea385[_0xe477('0x3b')]['id'];}return db['SquareDetailsReport'][_0xe477('0x3c')]({'where':{'id':_0x2ea385['params']['id']}})[_0xe477('0x1e')](handleEntityNotFound(_0x3372a1,null))[_0xe477('0x1e')](saveUpdates(_0x2ea385[_0xe477('0x3b')],null))[_0xe477('0x1e')](respondWithResult(_0x3372a1,null))[_0xe477('0x38')](handleError(_0x3372a1,null));};exports[_0xe477('0x1d')]=function(_0x563cef,_0x1c90bd){return db[_0xe477('0x34')]['find']({'where':{'id':_0x563cef[_0xe477('0x39')]['id']}})['then'](handleEntityNotFound(_0x1c90bd,null))[_0xe477('0x1e')](removeEntity(_0x1c90bd,null))[_0xe477('0x38')](handleError(_0x1c90bd,null));};exports[_0xe477('0x3d')]=function(_0x5e698a,_0x11fbb7){return db[_0xe477('0x34')]['describe']()[_0xe477('0x1e')](respondWithResult(_0x11fbb7,null))[_0xe477('0x38')](handleError(_0x11fbb7,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index c3f45c1..8e8ec57 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 _0xcaef=['api','moment','request-promise','rimraf','../../config/environment','exports','define','util','../../config/logger'];(function(_0x45df82,_0x8d487e){var _0x19fe9c=function(_0x251fac){while(--_0x251fac){_0x45df82['push'](_0x45df82['shift']());}};_0x19fe9c(++_0x8d487e);}(_0xcaef,0x1c9));var _0xfcae=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xcaef[_0x474bc0];return _0x4b24cf;};'use strict';var _=require('lodash');var util=require(_0xfcae('0x0'));var logger=require(_0xfcae('0x1'))(_0xfcae('0x2'));var moment=require(_0xfcae('0x3'));var BPromise=require('bluebird');var rp=require(_0xfcae('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfcae('0x5'));var config=require(_0xfcae('0x6'));var attributes=require('./squareReportDetail.attributes');module[_0xfcae('0x7')]=function(_0x19dd62,_0x4e8311){return _0x19dd62[_0xfcae('0x8')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a2e=['api','bluebird','request-promise','path','rimraf','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger'];(function(_0x299590,_0x378c8f){var _0x3a085e=function(_0x405ee8){while(--_0x405ee8){_0x299590['push'](_0x299590['shift']());}};_0x3a085e(++_0x378c8f);}(_0x0a2e,0xe1));var _0xe0a2=function(_0x47e309,_0x1e771a){_0x47e309=_0x47e309-0x0;var _0x2e1900=_0x0a2e[_0x47e309];return _0x2e1900;};'use strict';var _=require(_0xe0a2('0x0'));var util=require(_0xe0a2('0x1'));var logger=require(_0xe0a2('0x2'))(_0xe0a2('0x3'));var moment=require('moment');var BPromise=require(_0xe0a2('0x4'));var rp=require(_0xe0a2('0x5'));var fs=require('fs');var path=require(_0xe0a2('0x6'));var rimraf=require(_0xe0a2('0x7'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0xe0a2('0x8')]=function(_0x3b41ed,_0x29bf09){return _0x3b41ed[_0xe0a2('0x9')](_0xe0a2('0xa'),attributes,{'tableName':_0xe0a2('0xb'),'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 654899f..bbd8d61 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 _0x8d4c=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareDetailsReport','create','body','options','debug','lodash','bluebird','randomstring'];(function(_0x403112,_0x2c1dc3){var _0x91f216=function(_0x57da53){while(--_0x57da53){_0x403112['push'](_0x403112['shift']());}};_0x91f216(++_0x2c1dc3);}(_0x8d4c,0x105));var _0xc8d4=function(_0x21b762,_0xc8ef11){_0x21b762=_0x21b762-0x0;var _0x2ea6d4=_0x8d4c[_0x21b762];return _0x2ea6d4;};'use strict';var _=require(_0xc8d4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc8d4('0x1'));var rs=require(_0xc8d4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc8d4('0x3'))['db'];var utils=require(_0xc8d4('0x4'));var logger=require(_0xc8d4('0x5'))(_0xc8d4('0x6'));var config=require('../../config/environment');var jayson=require(_0xc8d4('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e3f62,_0x3e5e8b,_0x290b73){return new BPromise(function(_0x1492b4,_0x5cc4d){return client[_0xc8d4('0x8')](_0x5e3f62,_0x290b73)[_0xc8d4('0x9')](function(_0x2b7be9){logger[_0xc8d4('0xa')](_0xc8d4('0xb'),_0x3e5e8b,_0xc8d4('0xc'));logger['debug'](_0xc8d4('0xd'),_0x3e5e8b,'request\x20sent',JSON['stringify'](_0x2b7be9));if(_0x2b7be9[_0xc8d4('0xe')]){if(_0x2b7be9[_0xc8d4('0xe')][_0xc8d4('0xf')]===0x1f4){logger['error'](_0xc8d4('0xb'),_0x3e5e8b,_0x2b7be9[_0xc8d4('0xe')][_0xc8d4('0x10')]);return _0x5cc4d(_0x2b7be9[_0xc8d4('0xe')][_0xc8d4('0x10')]);}logger[_0xc8d4('0xe')](_0xc8d4('0xb'),_0x3e5e8b,_0x2b7be9[_0xc8d4('0xe')][_0xc8d4('0x10')]);return _0x1492b4(_0x2b7be9[_0xc8d4('0xe')][_0xc8d4('0x10')]);}else{logger[_0xc8d4('0xa')](_0xc8d4('0xb'),_0x3e5e8b,'request\x20sent');_0x1492b4(_0x2b7be9[_0xc8d4('0x11')][_0xc8d4('0x10')]);}})[_0xc8d4('0x12')](function(_0x2d65b8){logger['error'](_0xc8d4('0xb'),_0x3e5e8b,_0x2d65b8);_0x5cc4d(_0x2d65b8);});});}exports[_0xc8d4('0x13')]=function(_0x1e84c5){var _0x192c44=this;return new Promise(function(_0x19786e,_0x384c13){return db['SquareDetailsReport'][_0xc8d4('0x14')](_0x1e84c5[_0xc8d4('0x15')],{'raw':_0x1e84c5[_0xc8d4('0x16')]?_0x1e84c5[_0xc8d4('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xc8d4('0x9')](function(_0x534c99){logger[_0xc8d4('0xa')](_0xc8d4('0x13'),_0x1e84c5);logger[_0xc8d4('0x17')](_0xc8d4('0x13'),_0x1e84c5,JSON['stringify'](_0x534c99));_0x19786e(_0x534c99);})[_0xc8d4('0x12')](function(_0x326a0d){logger[_0xc8d4('0xe')](_0xc8d4('0x13'),_0x326a0d[_0xc8d4('0x10')],_0x1e84c5);_0x384c13(_0x192c44[_0xc8d4('0xe')](0x1f4,_0x326a0d[_0xc8d4('0x10')]));});});}; \ No newline at end of file +var _0xc8fe=['SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','result','SquareDetailsReport','create','body','options','CreateSquareDetailsReport','stringify','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x210e17,_0x39cbb4){var _0x196d84=function(_0x3a95fa){while(--_0x3a95fa){_0x210e17['push'](_0x210e17['shift']());}};_0x196d84(++_0x39cbb4);}(_0xc8fe,0x105));var _0xec8f=function(_0x4d8d75,_0x8f308f){_0x4d8d75=_0x4d8d75-0x0;var _0x56d3c0=_0xc8fe[_0x4d8d75];return _0x56d3c0;};'use strict';var _=require('lodash');var util=require(_0xec8f('0x0'));var moment=require(_0xec8f('0x1'));var BPromise=require(_0xec8f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec8f('0x3'));var db=require(_0xec8f('0x4'))['db'];var utils=require(_0xec8f('0x5'));var logger=require(_0xec8f('0x6'))('rpc');var config=require(_0xec8f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec8f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xccbce5,_0x4cbf94,_0x3a4ce4){return new BPromise(function(_0x140062,_0x52353b){return client['request'](_0xccbce5,_0x3a4ce4)[_0xec8f('0x9')](function(_0x287d2d){logger[_0xec8f('0xa')](_0xec8f('0xb'),_0x4cbf94,_0xec8f('0xc'));logger[_0xec8f('0xd')](_0xec8f('0xe'),_0x4cbf94,'request\x20sent',JSON['stringify'](_0x287d2d));if(_0x287d2d[_0xec8f('0xf')]){if(_0x287d2d['error']['code']===0x1f4){logger[_0xec8f('0xf')](_0xec8f('0xb'),_0x4cbf94,_0x287d2d[_0xec8f('0xf')][_0xec8f('0x10')]);return _0x52353b(_0x287d2d[_0xec8f('0xf')]['message']);}logger[_0xec8f('0xf')](_0xec8f('0xb'),_0x4cbf94,_0x287d2d[_0xec8f('0xf')][_0xec8f('0x10')]);return _0x140062(_0x287d2d['error'][_0xec8f('0x10')]);}else{logger[_0xec8f('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x4cbf94,_0xec8f('0xc'));_0x140062(_0x287d2d[_0xec8f('0x11')][_0xec8f('0x10')]);}})['catch'](function(_0x5cfe36){logger[_0xec8f('0xf')](_0xec8f('0xb'),_0x4cbf94,_0x5cfe36);_0x52353b(_0x5cfe36);});});}exports['CreateSquareDetailsReport']=function(_0x5da380){var _0x53c03d=this;return new Promise(function(_0x2b5b91,_0x104464){return db[_0xec8f('0x12')][_0xec8f('0x13')](_0x5da380[_0xec8f('0x14')],{'raw':_0x5da380['options']?_0x5da380[_0xec8f('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xec8f('0x9')](function(_0x3f8603){logger[_0xec8f('0xa')](_0xec8f('0x16'),_0x5da380);logger[_0xec8f('0xd')](_0xec8f('0x16'),_0x5da380,JSON[_0xec8f('0x17')](_0x3f8603));_0x2b5b91(_0x3f8603);})[_0xec8f('0x18')](function(_0x33b01a){logger[_0xec8f('0xf')]('CreateSquareDetailsReport',_0x33b01a[_0xec8f('0x10')],_0x5da380);_0x104464(_0x53c03d['error'](0x1f4,_0x33b01a['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 9c3b75b..60d764d 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 _0x3169=['killProcess','exports','express','Router','../../components/auth/service','get','isAuthenticated','index','/process/:pid/kill'];(function(_0x2a4623,_0x4296a1){var _0x4919d1=function(_0xc3fb17){while(--_0xc3fb17){_0x2a4623['push'](_0x2a4623['shift']());}};_0x4919d1(++_0x4296a1);}(_0x3169,0x14f));var _0x9316=function(_0x2f653f,_0x1cef4e){_0x2f653f=_0x2f653f-0x0;var _0x479836=_0x3169[_0x2f653f];return _0x479836;};'use strict';var express=require(_0x9316('0x0'));var router=express[_0x9316('0x1')]();var auth=require(_0x9316('0x2'));var controller=require('./system.controller');router[_0x9316('0x3')]('/',auth[_0x9316('0x4')](),controller[_0x9316('0x5')]);router[_0x9316('0x3')](_0x9316('0x6'),auth['isAuthenticated'](),controller[_0x9316('0x7')]);module[_0x9316('0x8')]=router; \ No newline at end of file +var _0xfe85=['isAuthenticated','index','get','/process/:pid/kill','exports','Router','../../components/auth/service','./system.controller'];(function(_0x247d54,_0x382b9d){var _0x2a1f95=function(_0x1c4cdd){while(--_0x1c4cdd){_0x247d54['push'](_0x247d54['shift']());}};_0x2a1f95(++_0x382b9d);}(_0xfe85,0x75));var _0x5fe8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe85[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0x5fe8('0x0')]();var auth=require(_0x5fe8('0x1'));var controller=require(_0x5fe8('0x2'));router['get']('/',auth[_0x5fe8('0x3')](),controller[_0x5fe8('0x4')]);router[_0x5fe8('0x5')](_0x5fe8('0x6'),auth[_0x5fe8('0x3')](),controller['killProcess']);module[_0x5fe8('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 3e891ad..8ea61d0 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 _0xf032=['pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','killProcess','systeminformation','exec','api','util','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','send','index','getAllData','then','status','json','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf'];(function(_0x401fba,_0x307795){var _0x5d1882=function(_0x1d6ef9){while(--_0x1d6ef9){_0x401fba['push'](_0x401fba['shift']());}};_0x5d1882(++_0x307795);}(_0xf032,0x131));var _0x2f03=function(_0x517e05,_0x322ae3){_0x517e05=_0x517e05-0x0;var _0x1e37a7=_0xf032[_0x517e05];return _0x1e37a7;};'use strict';var info=require(_0x2f03('0x0'));var exec=require('child_process')[_0x2f03('0x1')];var logger=require('../../config/logger')(_0x2f03('0x2'));var util=require(_0x2f03('0x3'));var BPromise=require(_0x2f03('0x4'));var _=require(_0x2f03('0x5'));function handleError(_0x43f5d1,_0x165c78,_0x2977a5){_0x165c78=_0x165c78||0x1f4;return function(_0x52f224){logger['error'](_0x2f03('0x6'),_0x2977a5,_0x165c78,util[_0x2f03('0x7')](_0x52f224,{'showHidden':![],'depth':null}));delete _0x52f224['name'];_0x43f5d1['status'](_0x165c78)[_0x2f03('0x8')](_0x52f224);};}exports[_0x2f03('0x9')]=function(_0x3d24a2,_0x14bd31){return info[_0x2f03('0xa')]()[_0x2f03('0xb')](function(_0x2b9531){return _0x14bd31[_0x2f03('0xc')](0xc8)['json'](_0x2b9531);})['catch'](function(_0xc6f781){return _0x14bd31[_0x2f03('0xc')](0x1f4)[_0x2f03('0xd')](_0xc6f781);});};exports['killProcess']=function(_0x59c53e,_0x45ffe4){var _0xa93dad=['components/import/cm'];return new BPromise(function(_0xa6ffa,_0x43b750){return exec(util[_0x2f03('0xe')](_0x2f03('0xf'),_0x59c53e[_0x2f03('0x10')]['pid']),function(_0x181b02,_0x96e10a,_0x57899c){if(_0x181b02){return _0x43b750(_0x181b02);}return _0xa6ffa(_0x96e10a);});})[_0x2f03('0xb')](function(_0x64a38f){var _0x33f998=![];var _0x52472d=_0x64a38f[_0x2f03('0x11')](/\n/);for(var _0x58f9f5=0x0,_0x30e136=_0xa93dad[_0x2f03('0x12')];_0x58f9f5<_0x30e136,_0x33f998===![];_0x58f9f5+=0x1){if(_0x64a38f[_0x2f03('0x13')](_0xa93dad[_0x58f9f5])>=0x0){_0x33f998=!![];}}if(!_0x33f998){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x59c53e['params'][_0x2f03('0x14')]));}process['kill'](_0x59c53e['params'][_0x2f03('0x14')],_0x2f03('0x15'));return _0x45ffe4[_0x2f03('0xc')](0xc8)[_0x2f03('0xd')]({'message':util[_0x2f03('0xe')](_0x2f03('0x16'),_0x59c53e['params'][_0x2f03('0x14')])});})[_0x2f03('0x17')](handleError(_0x45ffe4,null,_0x2f03('0x18')));}; \ No newline at end of file +var _0x0ff9=['Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','child_process','../../config/logger','api','util','lodash','error','name','status','index','getAllData','json','catch','components/import/cm','format','params','pid','then','split','length'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x0ff9,0x7d));var _0x90ff=function(_0x46e8b6,_0x3aa6b5){_0x46e8b6=_0x46e8b6-0x0;var _0xe90104=_0x0ff9[_0x46e8b6];return _0xe90104;};'use strict';var info=require('systeminformation');var exec=require(_0x90ff('0x0'))['exec'];var logger=require(_0x90ff('0x1'))(_0x90ff('0x2'));var util=require(_0x90ff('0x3'));var BPromise=require('bluebird');var _=require(_0x90ff('0x4'));function handleError(_0x297c92,_0x199411,_0x37ab07){_0x199411=_0x199411||0x1f4;return function(_0x40ae3b){logger[_0x90ff('0x5')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x37ab07,_0x199411,util['inspect'](_0x40ae3b,{'showHidden':![],'depth':null}));delete _0x40ae3b[_0x90ff('0x6')];_0x297c92[_0x90ff('0x7')](_0x199411)['send'](_0x40ae3b);};}exports[_0x90ff('0x8')]=function(_0x3cbbf0,_0x2f5d02){return info[_0x90ff('0x9')]()['then'](function(_0x119297){return _0x2f5d02[_0x90ff('0x7')](0xc8)[_0x90ff('0xa')](_0x119297);})[_0x90ff('0xb')](function(_0x38df44){return _0x2f5d02[_0x90ff('0x7')](0x1f4)[_0x90ff('0xa')](_0x38df44);});};exports['killProcess']=function(_0x239e5d,_0x11981c){var _0x702e74=[_0x90ff('0xc')];return new BPromise(function(_0x3214d5,_0x372286){return exec(util[_0x90ff('0xd')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x239e5d[_0x90ff('0xe')][_0x90ff('0xf')]),function(_0x1f4c4a,_0x41909e,_0x5c0187){if(_0x1f4c4a){return _0x372286(_0x1f4c4a);}return _0x3214d5(_0x41909e);});})[_0x90ff('0x10')](function(_0x584f6a){var _0x17f9ee=![];var _0x1e87e7=_0x584f6a[_0x90ff('0x11')](/\n/);for(var _0x394852=0x0,_0x5a039e=_0x702e74[_0x90ff('0x12')];_0x394852<_0x5a039e,_0x17f9ee===![];_0x394852+=0x1){if(_0x584f6a['indexOf'](_0x702e74[_0x394852])>=0x0){_0x17f9ee=!![];}}if(!_0x17f9ee){throw new Error(util['format'](_0x90ff('0x13'),_0x239e5d[_0x90ff('0xe')][_0x90ff('0xf')]));}process[_0x90ff('0x14')](_0x239e5d[_0x90ff('0xe')][_0x90ff('0xf')],_0x90ff('0x15'));return _0x11981c['status'](0xc8)[_0x90ff('0xa')]({'message':util[_0x90ff('0xd')](_0x90ff('0x16'),_0x239e5d[_0x90ff('0xe')]['pid'])});})['catch'](handleError(_0x11981c,null,_0x90ff('0x17')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index f875035..2ebed9d 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 _0x702d=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','get','/:id','post','create','put'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x702d,0x147));var _0xd702=function(_0x204c3a,_0x47e354){_0x204c3a=_0x204c3a-0x0;var _0x513d25=_0x702d[_0x204c3a];return _0x513d25;};'use strict';var multer=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var path=require(_0xd702('0x2'));var timeout=require(_0xd702('0x3'));var express=require(_0xd702('0x4'));var router=express['Router']();var auth=require(_0xd702('0x5'));var interaction=require(_0xd702('0x6'));var config=require(_0xd702('0x7'));var controller=require(_0xd702('0x8'));router['get']('/',auth[_0xd702('0x9')](),controller['index']);router[_0xd702('0xa')](_0xd702('0xb'),auth[_0xd702('0x9')](),controller['show']);router[_0xd702('0xc')]('/',auth['isAuthenticated'](),controller[_0xd702('0xd')]);router[_0xd702('0xe')](_0xd702('0xb'),auth[_0xd702('0x9')](),controller[_0xd702('0xf')]);router[_0xd702('0x10')](_0xd702('0xb'),auth[_0xd702('0x9')](),controller[_0xd702('0x11')]);module[_0xd702('0x12')]=router; \ No newline at end of file +var _0xec56=['put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x5a58ca,_0x434177){var _0x688745=function(_0x270fe6){while(--_0x270fe6){_0x5a58ca['push'](_0x5a58ca['shift']());}};_0x688745(++_0x434177);}(_0xec56,0x1bd));var _0x6ec5=function(_0x1b5c29,_0xab79c3){_0x1b5c29=_0x1b5c29-0x0;var _0x44bbf7=_0xec56[_0x1b5c29];return _0x44bbf7;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var auth=require(_0x6ec5('0x4'));var interaction=require(_0x6ec5('0x5'));var config=require(_0x6ec5('0x6'));var controller=require(_0x6ec5('0x7'));router[_0x6ec5('0x8')]('/',auth[_0x6ec5('0x9')](),controller[_0x6ec5('0xa')]);router[_0x6ec5('0x8')](_0x6ec5('0xb'),auth[_0x6ec5('0x9')](),controller[_0x6ec5('0xc')]);router[_0x6ec5('0xd')]('/',auth[_0x6ec5('0x9')](),controller[_0x6ec5('0xe')]);router[_0x6ec5('0xf')](_0x6ec5('0xb'),auth['isAuthenticated'](),controller[_0x6ec5('0x10')]);router[_0x6ec5('0x11')](_0x6ec5('0xb'),auth[_0x6ec5('0x9')](),controller[_0x6ec5('0x12')]);module[_0x6ec5('0x13')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 7e1af0d..fe07d10 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 _0x4024=['STRING','sequelize','exports','name'];(function(_0x497ed8,_0x28dd3a){var _0x5e1bd4=function(_0x55c19a){while(--_0x55c19a){_0x497ed8['push'](_0x497ed8['shift']());}};_0x5e1bd4(++_0x28dd3a);}(_0x4024,0x89));var _0x4402=function(_0x394271,_0x1cc0f9){_0x394271=_0x394271-0x0;var _0x595920=_0x4024[_0x394271];return _0x595920;};'use strict';var Sequelize=require(_0x4402('0x0'));module[_0x4402('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4402('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x4402('0x3')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x4402('0x3')]}}; \ No newline at end of file +var _0xe5b5=['exports','STRING','name','#0091EA','sequelize'];(function(_0x15b5d2,_0x2f76a7){var _0x3ca950=function(_0x5c8514){while(--_0x5c8514){_0x15b5d2['push'](_0x15b5d2['shift']());}};_0x3ca950(++_0x2f76a7);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0xe5b5[_0x2d8d69];return _0x39ae22;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'name':{'type':Sequelize[_0x5e5b('0x2')],'unique':_0x5e5b('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x5e5b('0x2')],'defaultValue':_0x5e5b('0x4')},'description':{'type':Sequelize[_0x5e5b('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 9a539f0..588838d 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 _0x95b3=['length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','update','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','then','destroy','get','Tags','error','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','filter','where','merge','VIRTUAL','options','Tag','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x55dfa5,_0x9ebcdd){var _0x5ecbbb=function(_0x17795e){while(--_0x17795e){_0x55dfa5['push'](_0x55dfa5['shift']());}};_0x5ecbbb(++_0x9ebcdd);}(_0x95b3,0x13a));var _0x395b=function(_0x5cf085,_0x340c5c){_0x5cf085=_0x5cf085-0x0;var _0x31bb55=_0x95b3[_0x5cf085];return _0x31bb55;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x395b('0x0'));var rimraf=require(_0x395b('0x1'));var zipdir=require(_0x395b('0x2'));var jsonpatch=require(_0x395b('0x3'));var rp=require(_0x395b('0x4'));var moment=require(_0x395b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x395b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x395b('0x7'));var squel=require(_0x395b('0x8'));var crypto=require(_0x395b('0x9'));var jsforce=require(_0x395b('0xa'));var deskjs=require(_0x395b('0xb'));var toCsv=require('to-csv');var querystring=require(_0x395b('0xc'));var Papa=require('papaparse');var Redis=require(_0x395b('0xd'));var authService=require(_0x395b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x395b('0xf'));var hardwareService=require(_0x395b('0x10'));var logger=require(_0x395b('0x11'))('api');var utils=require(_0x395b('0x12'));var config=require(_0x395b('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x367aad,_0x48dc29){_0x48dc29=_0x48dc29||0xcc;return function(_0x356219){if(_0x356219){return _0x367aad[_0x395b('0x14')](_0x48dc29);}return _0x367aad[_0x395b('0x15')](_0x48dc29)[_0x395b('0x16')]();};}function respondWithResult(_0x1d1fad,_0x1ef3cf){_0x1ef3cf=_0x1ef3cf||0xc8;return function(_0x25424a){if(_0x25424a){return _0x1d1fad[_0x395b('0x15')](_0x1ef3cf)[_0x395b('0x17')](_0x25424a);}};}function respondWithFilteredResult(_0x71bb5a,_0xb5220d){return function(_0x2f192c){if(_0x2f192c){var _0x3093da=_0x2f192c['count'],_0x18ffce=_0xb5220d[_0x395b('0x18')],_0x1d47e2=_0xb5220d[_0x395b('0x18')]+_0xb5220d[_0x395b('0x19')],_0x1822cb;if(_0x1d47e2>=_0x3093da){_0x1d47e2=_0x3093da;_0x1822cb=0xc8;}else{_0x1822cb=0xce;}_0x71bb5a[_0x395b('0x15')](_0x1822cb);return _0x71bb5a['set'](_0x395b('0x1a'),_0x18ffce+'-'+_0x1d47e2+'/'+_0x3093da)[_0x395b('0x17')](_0x2f192c);}return null;};}function patchUpdates(_0xf232e2){return function(_0x2705a8){try{jsonpatch[_0x395b('0x1b')](_0x2705a8,_0xf232e2,!![]);}catch(_0x1ff744){return BPromise['reject'](_0x1ff744);}return _0x2705a8[_0x395b('0x1c')]();};}function saveUpdates(_0x17f8e6,_0x336e77){return function(_0x2368ca){if(_0x2368ca){return _0x2368ca['update'](_0x17f8e6)[_0x395b('0x1d')](function(_0x203f59){return _0x203f59;});}return null;};}function removeEntity(_0x2bb330,_0x2b2040){return function(_0x40eda1){if(_0x40eda1){return _0x40eda1[_0x395b('0x1e')]()[_0x395b('0x1d')](function(){var _0x4a3b82=_0x40eda1[_0x395b('0x1f')]({'plain':!![]});var _0x188fc2=_0x395b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x188fc2,'resourceId':_0x4a3b82['id']}})[_0x395b('0x1d')](function(){return _0x40eda1;});})[_0x395b('0x1d')](function(){_0x2bb330['status'](0xcc)[_0x395b('0x16')]();});}};}function handleEntityNotFound(_0xd6307d,_0x5050a9){return function(_0x508f8b){if(!_0x508f8b){_0xd6307d[_0x395b('0x14')](0x194);}return _0x508f8b;};}function handleError(_0x235547,_0x15d3e1){_0x15d3e1=_0x15d3e1||0x1f4;return function(_0x342919){logger[_0x395b('0x21')](_0x342919[_0x395b('0x22')]);if(_0x342919[_0x395b('0x23')]){delete _0x342919[_0x395b('0x23')];}_0x235547['status'](_0x15d3e1)[_0x395b('0x24')](_0x342919);};}exports[_0x395b('0x25')]=function(_0x1405ae,_0x26f883){var _0x32e6be={},_0x4ab2d8={},_0x53ee7d={'count':0x0,'rows':[]};var _0x3bebaf=_[_0x395b('0x26')](db['Tag']['rawAttributes'],function(_0x80ea9b){return{'name':_0x80ea9b['fieldName'],'type':_0x80ea9b[_0x395b('0x27')][_0x395b('0x28')]};});_0x4ab2d8[_0x395b('0x29')]=_[_0x395b('0x26')](_0x3bebaf,'name');_0x4ab2d8[_0x395b('0x2a')]=_[_0x395b('0x2b')](_0x1405ae[_0x395b('0x2a')]);_0x4ab2d8[_0x395b('0x2c')]=_[_0x395b('0x2d')](_0x4ab2d8[_0x395b('0x29')],_0x4ab2d8['query']);_0x32e6be['attributes']=_['intersection'](_0x4ab2d8[_0x395b('0x29')],qs['fields'](_0x1405ae['query'][_0x395b('0x2e')]));_0x32e6be['attributes']=_0x32e6be[_0x395b('0x2f')]['length']?_0x32e6be[_0x395b('0x2f')]:_0x4ab2d8[_0x395b('0x29')];if(!_0x1405ae[_0x395b('0x2a')][_0x395b('0x30')](_0x395b('0x31'))){_0x32e6be[_0x395b('0x19')]=qs[_0x395b('0x19')](_0x1405ae[_0x395b('0x2a')]['limit']);_0x32e6be['offset']=qs['offset'](_0x1405ae[_0x395b('0x2a')][_0x395b('0x18')]);}_0x32e6be[_0x395b('0x32')]=qs['sort'](_0x1405ae['query']['sort']);_0x32e6be['where']=qs[_0x395b('0x2c')](_['pick'](_0x1405ae[_0x395b('0x2a')],_0x4ab2d8[_0x395b('0x2c')]));if(_0x1405ae[_0x395b('0x2a')][_0x395b('0x33')]){_0x32e6be[_0x395b('0x34')]=_[_0x395b('0x35')](_0x32e6be[_0x395b('0x34')],{'$or':_['map'](_0x3bebaf,function(_0x42438f){if(_0x42438f[_0x395b('0x27')]!==_0x395b('0x36')){var _0x23ae50={};_0x23ae50[_0x42438f[_0x395b('0x23')]]={'$like':'%'+_0x1405ae[_0x395b('0x2a')]['filter']+'%'};return _0x23ae50;}})});}_0x32e6be=_[_0x395b('0x35')]({},_0x32e6be,_0x1405ae[_0x395b('0x37')]);var _0x4a0d0e={'where':_0x32e6be[_0x395b('0x34')]};return db[_0x395b('0x38')]['count'](_0x4a0d0e)['then'](function(_0x696c05){_0x53ee7d[_0x395b('0x39')]=_0x696c05;if(_0x1405ae['query'][_0x395b('0x3a')]){_0x32e6be[_0x395b('0x3b')]=[{'all':!![]}];}return db[_0x395b('0x38')][_0x395b('0x3c')](_0x32e6be);})[_0x395b('0x1d')](function(_0x3836ad){_0x53ee7d[_0x395b('0x3d')]=_0x3836ad;return _0x53ee7d;})[_0x395b('0x1d')](respondWithFilteredResult(_0x26f883,_0x32e6be))[_0x395b('0x3e')](handleError(_0x26f883,null));};exports[_0x395b('0x3f')]=function(_0x1527e9,_0x3e090f){var _0xa661bb={'raw':!![],'where':{'id':_0x1527e9[_0x395b('0x40')]['id']}},_0x545ac4={};_0x545ac4[_0x395b('0x29')]=_[_0x395b('0x2b')](db[_0x395b('0x38')][_0x395b('0x41')]);_0x545ac4[_0x395b('0x2a')]=_[_0x395b('0x2b')](_0x1527e9['query']);_0x545ac4[_0x395b('0x2c')]=_[_0x395b('0x2d')](_0x545ac4[_0x395b('0x29')],_0x545ac4['query']);_0xa661bb['attributes']=_[_0x395b('0x2d')](_0x545ac4['model'],qs[_0x395b('0x2e')](_0x1527e9['query']['fields']));_0xa661bb[_0x395b('0x2f')]=_0xa661bb[_0x395b('0x2f')][_0x395b('0x42')]?_0xa661bb[_0x395b('0x2f')]:_0x545ac4[_0x395b('0x29')];if(_0x1527e9[_0x395b('0x2a')][_0x395b('0x3a')]){_0xa661bb[_0x395b('0x3b')]=[{'all':!![]}];}_0xa661bb=_[_0x395b('0x35')]({},_0xa661bb,_0x1527e9[_0x395b('0x37')]);return db[_0x395b('0x38')]['find'](_0xa661bb)['then'](handleEntityNotFound(_0x3e090f,null))['then'](respondWithResult(_0x3e090f,null))[_0x395b('0x3e')](handleError(_0x3e090f,null));};exports[_0x395b('0x43')]=function(_0x35d135,_0x5d550b){return db['Tag']['create'](_0x35d135['body'],{})['then'](function(_0x53c567){var _0x4de848=_0x35d135[_0x395b('0x44')][_0x395b('0x1f')]({'plain':!![]});if(!_0x4de848)throw new Error(_0x395b('0x45'));if(_0x4de848[_0x395b('0x46')]===_0x395b('0x44')){var _0xf405f5=_0x53c567['get']({'plain':!![]});var _0x340bf9=_0x395b('0x20');return db['UserProfileSection']['find']({'where':{'name':_0x340bf9,'userProfileId':_0x4de848[_0x395b('0x47')]},'raw':!![]})[_0x395b('0x1d')](function(_0x350b99){if(_0x350b99&&_0x350b99['autoAssociation']===0x0){return db[_0x395b('0x48')][_0x395b('0x43')]({'name':_0xf405f5[_0x395b('0x23')],'resourceId':_0xf405f5['id'],'type':_0x350b99[_0x395b('0x23')],'sectionId':_0x350b99['id']},{})[_0x395b('0x1d')](function(){return _0x53c567;});}else{return _0x53c567;}})[_0x395b('0x3e')](function(_0xfc1512){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xfc1512);throw _0xfc1512;});}return _0x53c567;})['then'](respondWithResult(_0x5d550b,0xc9))[_0x395b('0x3e')](handleError(_0x5d550b,null));};exports[_0x395b('0x49')]=function(_0x17cfc9,_0x357781){if(_0x17cfc9[_0x395b('0x4a')]['id']){delete _0x17cfc9['body']['id'];}return db[_0x395b('0x38')][_0x395b('0x4b')]({'where':{'id':_0x17cfc9[_0x395b('0x40')]['id']}})[_0x395b('0x1d')](handleEntityNotFound(_0x357781,null))[_0x395b('0x1d')](saveUpdates(_0x17cfc9[_0x395b('0x4a')],null))['then'](respondWithResult(_0x357781,null))['catch'](handleError(_0x357781,null));};exports[_0x395b('0x1e')]=function(_0x55619c,_0x481006){return db[_0x395b('0x38')][_0x395b('0x4b')]({'where':{'id':_0x55619c[_0x395b('0x40')]['id']}})[_0x395b('0x1d')](handleEntityNotFound(_0x481006,null))['then'](removeEntity(_0x481006,null))[_0x395b('0x3e')](handleError(_0x481006,null));}; \ No newline at end of file +var _0x1503=['model','query','filters','intersection','fields','attributes','length','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','keys','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','limit','Content-Range','json','apply','save','then','destroy','get','Tags','UserProfileResource','error','name','map','Tag','type'];(function(_0x3f0aea,_0x40ea8c){var _0x382714=function(_0x5284b9){while(--_0x5284b9){_0x3f0aea['push'](_0x3f0aea['shift']());}};_0x382714(++_0x40ea8c);}(_0x1503,0xfb));var _0x3150=function(_0x149856,_0x2360a2){_0x149856=_0x149856-0x0;var _0x11ff4e=_0x1503[_0x149856];return _0x11ff4e;};'use strict';var pdf=require(_0x3150('0x0'));var emlformat=require(_0x3150('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3150('0x2'));var jsonpatch=require(_0x3150('0x3'));var rp=require(_0x3150('0x4'));var moment=require('moment');var BPromise=require(_0x3150('0x5'));var Mustache=require(_0x3150('0x6'));var util=require(_0x3150('0x7'));var path=require('path');var sox=require(_0x3150('0x8'));var csv=require(_0x3150('0x9'));var ejs=require(_0x3150('0xa'));var fs=require('fs');var _=require(_0x3150('0xb'));var squel=require(_0x3150('0xc'));var crypto=require(_0x3150('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3150('0xe'));var toCsv=require(_0x3150('0x9'));var querystring=require(_0x3150('0xf'));var Papa=require(_0x3150('0x10'));var Redis=require(_0x3150('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3150('0x12'))(_0x3150('0x13'));var utils=require(_0x3150('0x14'));var config=require(_0x3150('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf468a4,_0x62aa58){_0x62aa58=_0x62aa58||0xcc;return function(_0x5dd681){if(_0x5dd681){return _0xf468a4[_0x3150('0x16')](_0x62aa58);}return _0xf468a4[_0x3150('0x17')](_0x62aa58)['end']();};}function respondWithResult(_0x50337e,_0x52446a){_0x52446a=_0x52446a||0xc8;return function(_0x42c139){if(_0x42c139){return _0x50337e['status'](_0x52446a)['json'](_0x42c139);}};}function respondWithFilteredResult(_0x30c9c5,_0x23c7ad){return function(_0x3b3b3a){if(_0x3b3b3a){var _0x2ff085=_0x3b3b3a[_0x3150('0x18')],_0x39a670=_0x23c7ad['offset'],_0x349a2c=_0x23c7ad[_0x3150('0x19')]+_0x23c7ad[_0x3150('0x1a')],_0x384725;if(_0x349a2c>=_0x2ff085){_0x349a2c=_0x2ff085;_0x384725=0xc8;}else{_0x384725=0xce;}_0x30c9c5['status'](_0x384725);return _0x30c9c5['set'](_0x3150('0x1b'),_0x39a670+'-'+_0x349a2c+'/'+_0x2ff085)[_0x3150('0x1c')](_0x3b3b3a);}return null;};}function patchUpdates(_0x28d78c){return function(_0x5f5dac){try{jsonpatch[_0x3150('0x1d')](_0x5f5dac,_0x28d78c,!![]);}catch(_0x6d093d){return BPromise['reject'](_0x6d093d);}return _0x5f5dac[_0x3150('0x1e')]();};}function saveUpdates(_0xec4d0,_0x11b060){return function(_0x414840){if(_0x414840){return _0x414840['update'](_0xec4d0)[_0x3150('0x1f')](function(_0x30e584){return _0x30e584;});}return null;};}function removeEntity(_0x20119b,_0x2441b1){return function(_0x1575e4){if(_0x1575e4){return _0x1575e4[_0x3150('0x20')]()[_0x3150('0x1f')](function(){var _0x29c153=_0x1575e4[_0x3150('0x21')]({'plain':!![]});var _0x4acfe6=_0x3150('0x22');return db[_0x3150('0x23')][_0x3150('0x20')]({'where':{'type':_0x4acfe6,'resourceId':_0x29c153['id']}})[_0x3150('0x1f')](function(){return _0x1575e4;});})['then'](function(){_0x20119b[_0x3150('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c407e,_0x43a867){return function(_0x28749c){if(!_0x28749c){_0x1c407e['sendStatus'](0x194);}return _0x28749c;};}function handleError(_0x2cdc1c,_0x309109){_0x309109=_0x309109||0x1f4;return function(_0x5d5a07){logger[_0x3150('0x24')](_0x5d5a07['stack']);if(_0x5d5a07[_0x3150('0x25')]){delete _0x5d5a07[_0x3150('0x25')];}_0x2cdc1c[_0x3150('0x17')](_0x309109)['send'](_0x5d5a07);};}exports['index']=function(_0xb3c28b,_0x13faae){var _0x46e8ad={},_0x565b24={},_0x275ca1={'count':0x0,'rows':[]};var _0x8d2e6c=_[_0x3150('0x26')](db[_0x3150('0x27')]['rawAttributes'],function(_0x4e7927){return{'name':_0x4e7927['fieldName'],'type':_0x4e7927[_0x3150('0x28')]['key']};});_0x565b24[_0x3150('0x29')]=_['map'](_0x8d2e6c,_0x3150('0x25'));_0x565b24['query']=_['keys'](_0xb3c28b[_0x3150('0x2a')]);_0x565b24[_0x3150('0x2b')]=_[_0x3150('0x2c')](_0x565b24[_0x3150('0x29')],_0x565b24[_0x3150('0x2a')]);_0x46e8ad['attributes']=_[_0x3150('0x2c')](_0x565b24[_0x3150('0x29')],qs[_0x3150('0x2d')](_0xb3c28b[_0x3150('0x2a')][_0x3150('0x2d')]));_0x46e8ad[_0x3150('0x2e')]=_0x46e8ad['attributes'][_0x3150('0x2f')]?_0x46e8ad[_0x3150('0x2e')]:_0x565b24[_0x3150('0x29')];if(!_0xb3c28b[_0x3150('0x2a')]['hasOwnProperty']('nolimit')){_0x46e8ad[_0x3150('0x1a')]=qs[_0x3150('0x1a')](_0xb3c28b[_0x3150('0x2a')][_0x3150('0x1a')]);_0x46e8ad[_0x3150('0x19')]=qs[_0x3150('0x19')](_0xb3c28b[_0x3150('0x2a')][_0x3150('0x19')]);}_0x46e8ad['order']=qs[_0x3150('0x30')](_0xb3c28b['query']['sort']);_0x46e8ad[_0x3150('0x31')]=qs['filters'](_['pick'](_0xb3c28b[_0x3150('0x2a')],_0x565b24[_0x3150('0x2b')]));if(_0xb3c28b['query'][_0x3150('0x32')]){_0x46e8ad['where']=_[_0x3150('0x33')](_0x46e8ad['where'],{'$or':_[_0x3150('0x26')](_0x8d2e6c,function(_0x1d81b5){if(_0x1d81b5[_0x3150('0x28')]!==_0x3150('0x34')){var _0x4f739e={};_0x4f739e[_0x1d81b5[_0x3150('0x25')]]={'$like':'%'+_0xb3c28b[_0x3150('0x2a')][_0x3150('0x32')]+'%'};return _0x4f739e;}})});}_0x46e8ad=_['merge']({},_0x46e8ad,_0xb3c28b[_0x3150('0x35')]);var _0x55f6b8={'where':_0x46e8ad[_0x3150('0x31')]};return db[_0x3150('0x27')][_0x3150('0x18')](_0x55f6b8)[_0x3150('0x1f')](function(_0x328761){_0x275ca1[_0x3150('0x18')]=_0x328761;if(_0xb3c28b[_0x3150('0x2a')][_0x3150('0x36')]){_0x46e8ad[_0x3150('0x37')]=[{'all':!![]}];}return db[_0x3150('0x27')][_0x3150('0x38')](_0x46e8ad);})[_0x3150('0x1f')](function(_0x34f239){_0x275ca1[_0x3150('0x39')]=_0x34f239;return _0x275ca1;})[_0x3150('0x1f')](respondWithFilteredResult(_0x13faae,_0x46e8ad))['catch'](handleError(_0x13faae,null));};exports[_0x3150('0x3a')]=function(_0xd008bd,_0x94cc21){var _0x436a24={'raw':!![],'where':{'id':_0xd008bd['params']['id']}},_0x412365={};_0x412365[_0x3150('0x29')]=_['keys'](db[_0x3150('0x27')][_0x3150('0x3b')]);_0x412365[_0x3150('0x2a')]=_[_0x3150('0x3c')](_0xd008bd[_0x3150('0x2a')]);_0x412365[_0x3150('0x2b')]=_[_0x3150('0x2c')](_0x412365['model'],_0x412365[_0x3150('0x2a')]);_0x436a24[_0x3150('0x2e')]=_[_0x3150('0x2c')](_0x412365[_0x3150('0x29')],qs[_0x3150('0x2d')](_0xd008bd[_0x3150('0x2a')]['fields']));_0x436a24[_0x3150('0x2e')]=_0x436a24[_0x3150('0x2e')][_0x3150('0x2f')]?_0x436a24['attributes']:_0x412365[_0x3150('0x29')];if(_0xd008bd[_0x3150('0x2a')][_0x3150('0x36')]){_0x436a24[_0x3150('0x37')]=[{'all':!![]}];}_0x436a24=_[_0x3150('0x33')]({},_0x436a24,_0xd008bd[_0x3150('0x35')]);return db['Tag']['find'](_0x436a24)[_0x3150('0x1f')](handleEntityNotFound(_0x94cc21,null))[_0x3150('0x1f')](respondWithResult(_0x94cc21,null))[_0x3150('0x3d')](handleError(_0x94cc21,null));};exports[_0x3150('0x3e')]=function(_0x31e6b3,_0x27300f){return db[_0x3150('0x27')]['create'](_0x31e6b3[_0x3150('0x3f')],{})[_0x3150('0x1f')](function(_0x64ea88){var _0x47bfe5=_0x31e6b3[_0x3150('0x40')][_0x3150('0x21')]({'plain':!![]});if(!_0x47bfe5)throw new Error(_0x3150('0x41'));if(_0x47bfe5['role']===_0x3150('0x40')){var _0x55fac7=_0x64ea88[_0x3150('0x21')]({'plain':!![]});var _0x474c94=_0x3150('0x22');return db[_0x3150('0x42')][_0x3150('0x43')]({'where':{'name':_0x474c94,'userProfileId':_0x47bfe5[_0x3150('0x44')]},'raw':!![]})[_0x3150('0x1f')](function(_0x18fca4){if(_0x18fca4&&_0x18fca4[_0x3150('0x45')]===0x0){return db[_0x3150('0x23')][_0x3150('0x3e')]({'name':_0x55fac7['name'],'resourceId':_0x55fac7['id'],'type':_0x18fca4[_0x3150('0x25')],'sectionId':_0x18fca4['id']},{})[_0x3150('0x1f')](function(){return _0x64ea88;});}else{return _0x64ea88;}})[_0x3150('0x3d')](function(_0x256382){logger[_0x3150('0x24')](_0x3150('0x46'),_0x256382);throw _0x256382;});}return _0x64ea88;})['then'](respondWithResult(_0x27300f,0xc9))[_0x3150('0x3d')](handleError(_0x27300f,null));};exports[_0x3150('0x47')]=function(_0x37e0b0,_0x26fc57){if(_0x37e0b0[_0x3150('0x3f')]['id']){delete _0x37e0b0['body']['id'];}return db['Tag'][_0x3150('0x43')]({'where':{'id':_0x37e0b0[_0x3150('0x48')]['id']}})[_0x3150('0x1f')](handleEntityNotFound(_0x26fc57,null))[_0x3150('0x1f')](saveUpdates(_0x37e0b0['body'],null))['then'](respondWithResult(_0x26fc57,null))['catch'](handleError(_0x26fc57,null));};exports[_0x3150('0x20')]=function(_0x17ff5e,_0x4bbd17){return db[_0x3150('0x27')][_0x3150('0x43')]({'where':{'id':_0x17ff5e[_0x3150('0x48')]['id']}})[_0x3150('0x1f')](handleEntityNotFound(_0x4bbd17,null))[_0x3150('0x1f')](removeEntity(_0x4bbd17,null))[_0x3150('0x3d')](handleError(_0x4bbd17,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 161d3db..a1a3c91 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 _0xcac2=['Tag','tools_tags','lodash','util','../../config/logger','api','moment','request-promise','path','./tag.attributes'];(function(_0x2d61ac,_0x18ff36){var _0x3f7d3c=function(_0x2ba7e5){while(--_0x2ba7e5){_0x2d61ac['push'](_0x2d61ac['shift']());}};_0x3f7d3c(++_0x18ff36);}(_0xcac2,0x8e));var _0x2cac=function(_0x274614,_0xe36695){_0x274614=_0x274614-0x0;var _0x15312e=_0xcac2[_0x274614];return _0x15312e;};'use strict';var _=require(_0x2cac('0x0'));var util=require(_0x2cac('0x1'));var logger=require(_0x2cac('0x2'))(_0x2cac('0x3'));var moment=require(_0x2cac('0x4'));var BPromise=require('bluebird');var rp=require(_0x2cac('0x5'));var fs=require('fs');var path=require(_0x2cac('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2cac('0x7'));module['exports']=function(_0x306ecd,_0x35808c){return _0x306ecd['define'](_0x2cac('0x8'),attributes,{'tableName':_0x2cac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6599=['Tag','tools_tags','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define'];(function(_0x1e29a9,_0x3b695a){var _0x48786a=function(_0x24e9ab){while(--_0x24e9ab){_0x1e29a9['push'](_0x1e29a9['shift']());}};_0x48786a(++_0x3b695a);}(_0x6599,0x16e));var _0x9659=function(_0x1c6ef2,_0x8d926a){_0x1c6ef2=_0x1c6ef2-0x0;var _0x404b8c=_0x6599[_0x1c6ef2];return _0x404b8c;};'use strict';var _=require(_0x9659('0x0'));var util=require(_0x9659('0x1'));var logger=require(_0x9659('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9659('0x3'));var rp=require(_0x9659('0x4'));var fs=require('fs');var path=require(_0x9659('0x5'));var rimraf=require(_0x9659('0x6'));var config=require(_0x9659('0x7'));var attributes=require(_0x9659('0x8'));module[_0x9659('0x9')]=function(_0x4f4840,_0x48faf5){return _0x4f4840[_0x9659('0xa')](_0x9659('0xb'),attributes,{'tableName':_0x9659('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index c4ca609..3d47323 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 _0x6f7a=['http','request','then','info','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3ced90,_0xf1aad1){var _0x5b9d75=function(_0x287333){while(--_0x287333){_0x3ced90['push'](_0x3ced90['shift']());}};_0x5b9d75(++_0xf1aad1);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x1c5a35,_0x414699){_0x1c5a35=_0x1c5a35-0x0;var _0x421347=_0x6f7a[_0x1c5a35];return _0x421347;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var moment=require(_0xa6f7('0x2'));var BPromise=require(_0xa6f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require(_0xa6f7('0x5'))['db'];var utils=require(_0xa6f7('0x6'));var logger=require(_0xa6f7('0x7'))(_0xa6f7('0x8'));var config=require(_0xa6f7('0x9'));var jayson=require(_0xa6f7('0xa'));var client=jayson[_0xa6f7('0xb')][_0xa6f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x335aaa,_0x1a06d1,_0x481a8c){return new BPromise(function(_0x4b4f9e,_0x30f2a7){return client[_0xa6f7('0xd')](_0x335aaa,_0x481a8c)[_0xa6f7('0xe')](function(_0x362404){logger[_0xa6f7('0xf')]('Tag,\x20%s,\x20%s',_0x1a06d1,'request\x20sent');logger[_0xa6f7('0x10')](_0xa6f7('0x11'),_0x1a06d1,'request\x20sent',JSON[_0xa6f7('0x12')](_0x362404));if(_0x362404['error']){if(_0x362404[_0xa6f7('0x13')][_0xa6f7('0x14')]===0x1f4){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x30f2a7(_0x362404['error'][_0xa6f7('0x16')]);}logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x4b4f9e(_0x362404['error'][_0xa6f7('0x16')]);}else{logger['info'](_0xa6f7('0x15'),_0x1a06d1,_0xa6f7('0x17'));_0x4b4f9e(_0x362404[_0xa6f7('0x18')]['message']);}})[_0xa6f7('0x19')](function(_0x22635e){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x22635e);_0x30f2a7(_0x22635e);});});} \ No newline at end of file +var _0x91a7=['message','Tag,\x20%s,\x20%s','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x4857ea,_0x3aaca4){var _0x47f18f=function(_0x9a3464){while(--_0x9a3464){_0x4857ea['push'](_0x4857ea['shift']());}};_0x47f18f(++_0x3aaca4);}(_0x91a7,0xe7));var _0x791a=function(_0x5636e0,_0x274670){_0x5636e0=_0x5636e0-0x0;var _0x106770=_0x91a7[_0x5636e0];return _0x106770;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var moment=require(_0x791a('0x1'));var BPromise=require(_0x791a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x791a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x791a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x791a('0x5'));var jayson=require(_0x791a('0x6'));var client=jayson['client'][_0x791a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5db6db,_0x33baac,_0x159e24){return new BPromise(function(_0x5aa10a,_0x1a32b4){return client[_0x791a('0x8')](_0x5db6db,_0x159e24)[_0x791a('0x9')](function(_0x80ff65){logger[_0x791a('0xa')]('Tag,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));logger[_0x791a('0xc')]('Tag,\x20%s,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'),JSON[_0x791a('0xd')](_0x80ff65));if(_0x80ff65[_0x791a('0xe')]){if(_0x80ff65[_0x791a('0xe')][_0x791a('0xf')]===0x1f4){logger[_0x791a('0xe')]('Tag,\x20%s,\x20%s',_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x1a32b4(_0x80ff65[_0x791a('0xe')]['message']);}logger[_0x791a('0xe')](_0x791a('0x11'),_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x5aa10a(_0x80ff65[_0x791a('0xe')][_0x791a('0x10')]);}else{logger[_0x791a('0xa')]('Tag,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));_0x5aa10a(_0x80ff65['result'][_0x791a('0x10')]);}})[_0x791a('0x12')](function(_0x49ae3e){logger[_0x791a('0xe')]('Tag,\x20%s,\x20%s',_0x33baac,_0x49ae3e);_0x1a32b4(_0x49ae3e);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 9c567a0..3096fff 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 _0xdcaf=['update','delete','destroy','removeAgents','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./team.controller','get','isAuthenticated','index','show','/:id/queues','getQueues','/:id/users','getAgents','post','create','addQueues','put','/:id'];(function(_0x2142fa,_0x1e9945){var _0x350983=function(_0x125657){while(--_0x125657){_0x2142fa['push'](_0x2142fa['shift']());}};_0x350983(++_0x1e9945);}(_0xdcaf,0x1e0));var _0xfdca=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xdcaf[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xfdca('0x0'));var util=require(_0xfdca('0x1'));var path=require(_0xfdca('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfdca('0x3')]();var auth=require(_0xfdca('0x4'));var interaction=require(_0xfdca('0x5'));var config=require('../../config/environment');var controller=require(_0xfdca('0x6'));router[_0xfdca('0x7')]('/',auth[_0xfdca('0x8')](),controller[_0xfdca('0x9')]);router[_0xfdca('0x7')]('/:id',auth[_0xfdca('0x8')](),controller[_0xfdca('0xa')]);router[_0xfdca('0x7')](_0xfdca('0xb'),auth[_0xfdca('0x8')](),controller[_0xfdca('0xc')]);router[_0xfdca('0x7')](_0xfdca('0xd'),auth[_0xfdca('0x8')](),controller[_0xfdca('0xe')]);router[_0xfdca('0xf')]('/',auth['isAuthenticated'](),controller[_0xfdca('0x10')]);router[_0xfdca('0xf')](_0xfdca('0xb'),auth[_0xfdca('0x8')](),controller[_0xfdca('0x11')]);router[_0xfdca('0xf')](_0xfdca('0xd'),auth[_0xfdca('0x8')](),controller['addAgents']);router[_0xfdca('0x12')](_0xfdca('0x13'),auth[_0xfdca('0x8')](),controller[_0xfdca('0x14')]);router[_0xfdca('0x15')](_0xfdca('0x13'),auth[_0xfdca('0x8')](),controller[_0xfdca('0x16')]);router['delete'](_0xfdca('0xb'),auth[_0xfdca('0x8')](),controller['removeQueues']);router[_0xfdca('0x15')]('/:id/users',auth[_0xfdca('0x8')](),controller[_0xfdca('0x17')]);module[_0xfdca('0x18')]=router; \ No newline at end of file +var _0x9680=['delete','destroy','removeQueues','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','isAuthenticated','show','get','/:id/queues','getQueues','/:id/users','post','create','addQueues','addAgents','put','/:id','update'];(function(_0x220689,_0x58ca87){var _0xc3dabf=function(_0x130052){while(--_0x130052){_0x220689['push'](_0x220689['shift']());}};_0xc3dabf(++_0x58ca87);}(_0x9680,0x12e));var _0x0968=function(_0x2d9922,_0x59fd51){_0x2d9922=_0x2d9922-0x0;var _0xaecfe=_0x9680[_0x2d9922];return _0xaecfe;};'use strict';var multer=require(_0x0968('0x0'));var util=require(_0x0968('0x1'));var path=require(_0x0968('0x2'));var timeout=require('connect-timeout');var express=require(_0x0968('0x3'));var router=express[_0x0968('0x4')]();var auth=require(_0x0968('0x5'));var interaction=require(_0x0968('0x6'));var config=require(_0x0968('0x7'));var controller=require(_0x0968('0x8'));router['get']('/',auth[_0x0968('0x9')](),controller['index']);router['get']('/:id',auth[_0x0968('0x9')](),controller[_0x0968('0xa')]);router[_0x0968('0xb')](_0x0968('0xc'),auth[_0x0968('0x9')](),controller[_0x0968('0xd')]);router[_0x0968('0xb')](_0x0968('0xe'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0968('0xf')]('/',auth[_0x0968('0x9')](),controller[_0x0968('0x10')]);router[_0x0968('0xf')](_0x0968('0xc'),auth['isAuthenticated'](),controller[_0x0968('0x11')]);router[_0x0968('0xf')](_0x0968('0xe'),auth[_0x0968('0x9')](),controller[_0x0968('0x12')]);router[_0x0968('0x13')](_0x0968('0x14'),auth[_0x0968('0x9')](),controller[_0x0968('0x15')]);router[_0x0968('0x16')](_0x0968('0x14'),auth[_0x0968('0x9')](),controller[_0x0968('0x17')]);router[_0x0968('0x16')](_0x0968('0xc'),auth[_0x0968('0x9')](),controller[_0x0968('0x18')]);router['delete'](_0x0968('0xe'),auth[_0x0968('0x9')](),controller[_0x0968('0x19')]);module[_0x0968('0x1a')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index e32e9ea..a7a0c2b 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 _0xbb2b=['name','exports','STRING'];(function(_0x59882d,_0x11c4f6){var _0x3e78f4=function(_0x276a94){while(--_0x276a94){_0x59882d['push'](_0x59882d['shift']());}};_0x3e78f4(++_0x11c4f6);}(_0xbb2b,0x169));var _0xbbb2=function(_0x1fa405,_0x41d3a7){_0x1fa405=_0x1fa405-0x0;var _0x3537f3=_0xbb2b[_0x1fa405];return _0x3537f3;};'use strict';var Sequelize=require('sequelize');module[_0xbbb2('0x0')]={'name':{'type':Sequelize[_0xbbb2('0x1')],'allowNull':![],'unique':_0xbbb2('0x2')},'description':{'type':Sequelize[_0xbbb2('0x1')]}}; \ No newline at end of file +var _0x62d4=['STRING','name','sequelize','exports'];(function(_0x277041,_0x3c0be9){var _0x2031be=function(_0x410745){while(--_0x410745){_0x277041['push'](_0x277041['shift']());}};_0x2031be(++_0x3c0be9);}(_0x62d4,0x102));var _0x462d=function(_0x4ab38a,_0x2a1ca5){_0x4ab38a=_0x4ab38a-0x0;var _0x1a4fc1=_0x62d4[_0x4ab38a];return _0x1a4fc1;};'use strict';var Sequelize=require(_0x462d('0x0'));module[_0x462d('0x1')]={'name':{'type':Sequelize[_0x462d('0x2')],'allowNull':![],'unique':_0x462d('0x3')},'description':{'type':Sequelize[_0x462d('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index d9ac722..e95c4c0 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 _0xa5dd=['request-promise','moment','bluebird','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Teams','UserProfileResource','end','error','stack','name','send','index','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','map','options','Team','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','isValidChannel','Sequelize','Unknown\x20channel','capitalize','toLowerCase','Queue','order','merge','ValidationError','add','Queues','ids','removeQueues','remove','Voice','Chat','Mail','Sms','Fax','Openchannel','each','online','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','addAgents','omit','spread','emit','userTeam:save','chat','mail','sms','openchannel','userTeam:remove','getAgents','User','html-pdf','zip-dir','fast-json-patch'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa5dd,0x101));var _0xda5d=function(_0x386109,_0x5806b2){_0x386109=_0x386109-0x0;var _0x567dbb=_0xa5dd[_0x386109];return _0x567dbb;};'use strict';var pdf=require(_0xda5d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xda5d('0x1'));var jsonpatch=require(_0xda5d('0x2'));var rp=require(_0xda5d('0x3'));var moment=require(_0xda5d('0x4'));var BPromise=require(_0xda5d('0x5'));var Mustache=require('mustache');var util=require(_0xda5d('0x6'));var path=require(_0xda5d('0x7'));var sox=require(_0xda5d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xda5d('0x9'));var squel=require(_0xda5d('0xa'));var crypto=require(_0xda5d('0xb'));var jsforce=require(_0xda5d('0xc'));var deskjs=require(_0xda5d('0xd'));var toCsv=require(_0xda5d('0xe'));var querystring=require(_0xda5d('0xf'));var Papa=require(_0xda5d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xda5d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xda5d('0x12'))(_0xda5d('0x13'));var utils=require('../../config/utils');var config=require(_0xda5d('0x14'));var db=require(_0xda5d('0x15'))['db'];config[_0xda5d('0x16')]=_['defaults'](config['redis'],{'host':_0xda5d('0x17'),'port':0x18eb});var socket=require(_0xda5d('0x18'))(new Redis(config[_0xda5d('0x16')]));require(_0xda5d('0x19'))[_0xda5d('0x1a')](socket);function respondWithStatusCode(_0x267e0b,_0x2092f8){_0x2092f8=_0x2092f8||0xcc;return function(_0x53a7ad){if(_0x53a7ad){return _0x267e0b['sendStatus'](_0x2092f8);}return _0x267e0b['status'](_0x2092f8)['end']();};}function respondWithResult(_0x54ffb1,_0x42be77){_0x42be77=_0x42be77||0xc8;return function(_0x257973){if(_0x257973){return _0x54ffb1[_0xda5d('0x1b')](_0x42be77)[_0xda5d('0x1c')](_0x257973);}};}function respondWithFilteredResult(_0x38af9e,_0x169b53){return function(_0x3ebe68){if(_0x3ebe68){var _0x3667da=_0x3ebe68[_0xda5d('0x1d')],_0x3a7e86=_0x169b53['offset'],_0x4d5179=_0x169b53[_0xda5d('0x1e')]+_0x169b53[_0xda5d('0x1f')],_0x3f5cc9;if(_0x4d5179>=_0x3667da){_0x4d5179=_0x3667da;_0x3f5cc9=0xc8;}else{_0x3f5cc9=0xce;}_0x38af9e[_0xda5d('0x1b')](_0x3f5cc9);return _0x38af9e[_0xda5d('0x20')](_0xda5d('0x21'),_0x3a7e86+'-'+_0x4d5179+'/'+_0x3667da)[_0xda5d('0x1c')](_0x3ebe68);}return null;};}function patchUpdates(_0xf07e3a){return function(_0x5c09c1){try{jsonpatch[_0xda5d('0x22')](_0x5c09c1,_0xf07e3a,!![]);}catch(_0x594993){return BPromise[_0xda5d('0x23')](_0x594993);}return _0x5c09c1[_0xda5d('0x24')]();};}function saveUpdates(_0x4a47ef,_0x3e846c){return function(_0x521d07){if(_0x521d07){return _0x521d07[_0xda5d('0x25')](_0x4a47ef)[_0xda5d('0x26')](function(_0x1e1e56){return _0x1e1e56;});}return null;};}function removeEntity(_0x761ef0,_0x4038d7){return function(_0x114a45){if(_0x114a45){return _0x114a45[_0xda5d('0x27')]()[_0xda5d('0x26')](function(){var _0x2b0396=_0x114a45[_0xda5d('0x28')]({'plain':!![]});var _0x133285=_0xda5d('0x29');return db[_0xda5d('0x2a')][_0xda5d('0x27')]({'where':{'type':_0x133285,'resourceId':_0x2b0396['id']}})[_0xda5d('0x26')](function(){return _0x114a45;});})[_0xda5d('0x26')](function(){_0x761ef0[_0xda5d('0x1b')](0xcc)[_0xda5d('0x2b')]();});}};}function handleEntityNotFound(_0x16cf1a,_0x777bf3){return function(_0x2bded9){if(!_0x2bded9){_0x16cf1a['sendStatus'](0x194);}return _0x2bded9;};}function handleError(_0x3f4f0c,_0x34fda4){_0x34fda4=_0x34fda4||0x1f4;return function(_0x435572){logger[_0xda5d('0x2c')](_0x435572[_0xda5d('0x2d')]);if(_0x435572['name']){delete _0x435572[_0xda5d('0x2e')];}_0x3f4f0c[_0xda5d('0x1b')](_0x34fda4)[_0xda5d('0x2f')](_0x435572);};}exports[_0xda5d('0x30')]=function(_0x5bd14,_0x5b5835){var _0x4a5ca1={},_0xef5b21={},_0xff93f7={'count':0x0,'rows':[]};var _0x3f94c1=_['map'](db['Team']['rawAttributes'],function(_0x342ac6){return{'name':_0x342ac6[_0xda5d('0x31')],'type':_0x342ac6[_0xda5d('0x32')][_0xda5d('0x33')]};});_0xef5b21[_0xda5d('0x34')]=_['map'](_0x3f94c1,_0xda5d('0x2e'));_0xef5b21['query']=_[_0xda5d('0x35')](_0x5bd14[_0xda5d('0x36')]);_0xef5b21[_0xda5d('0x37')]=_['intersection'](_0xef5b21[_0xda5d('0x34')],_0xef5b21['query']);_0x4a5ca1[_0xda5d('0x38')]=_[_0xda5d('0x39')](_0xef5b21[_0xda5d('0x34')],qs[_0xda5d('0x3a')](_0x5bd14[_0xda5d('0x36')]['fields']));_0x4a5ca1[_0xda5d('0x38')]=_0x4a5ca1[_0xda5d('0x38')]['length']?_0x4a5ca1[_0xda5d('0x38')]:_0xef5b21[_0xda5d('0x34')];if(!_0x5bd14[_0xda5d('0x36')][_0xda5d('0x3b')](_0xda5d('0x3c'))){_0x4a5ca1[_0xda5d('0x1f')]=qs['limit'](_0x5bd14[_0xda5d('0x36')][_0xda5d('0x1f')]);_0x4a5ca1[_0xda5d('0x1e')]=qs['offset'](_0x5bd14['query']['offset']);}_0x4a5ca1['order']=qs[_0xda5d('0x3d')](_0x5bd14[_0xda5d('0x36')]['sort']);_0x4a5ca1['where']=qs[_0xda5d('0x37')](_[_0xda5d('0x3e')](_0x5bd14['query'],_0xef5b21[_0xda5d('0x37')]));if(_0x5bd14[_0xda5d('0x36')][_0xda5d('0x3f')]){_0x4a5ca1[_0xda5d('0x40')]=_['merge'](_0x4a5ca1[_0xda5d('0x40')],{'$or':_[_0xda5d('0x41')](_0x3f94c1,function(_0x41bd66){if(_0x41bd66[_0xda5d('0x32')]!=='VIRTUAL'){var _0x107929={};_0x107929[_0x41bd66[_0xda5d('0x2e')]]={'$like':'%'+_0x5bd14[_0xda5d('0x36')]['filter']+'%'};return _0x107929;}})});}_0x4a5ca1=_['merge']({},_0x4a5ca1,_0x5bd14[_0xda5d('0x42')]);var _0x20ae2b={'where':_0x4a5ca1[_0xda5d('0x40')]};return db[_0xda5d('0x43')][_0xda5d('0x1d')](_0x20ae2b)[_0xda5d('0x26')](function(_0x2603f1){_0xff93f7['count']=_0x2603f1;if(_0x5bd14['query'][_0xda5d('0x44')]){_0x4a5ca1[_0xda5d('0x45')]=[{'all':!![]}];}return db['Team'][_0xda5d('0x46')](_0x4a5ca1);})[_0xda5d('0x26')](function(_0x51002a){_0xff93f7[_0xda5d('0x47')]=_0x51002a;return _0xff93f7;})[_0xda5d('0x26')](respondWithFilteredResult(_0x5b5835,_0x4a5ca1))[_0xda5d('0x48')](handleError(_0x5b5835,null));};exports[_0xda5d('0x49')]=function(_0x14e1b0,_0x317992){var _0x59933a={'raw':![],'where':{'id':_0x14e1b0[_0xda5d('0x4a')]['id']}},_0x411ae0={};_0x411ae0[_0xda5d('0x34')]=_[_0xda5d('0x35')](db[_0xda5d('0x43')][_0xda5d('0x4b')]);_0x411ae0[_0xda5d('0x36')]=_[_0xda5d('0x35')](_0x14e1b0[_0xda5d('0x36')]);_0x411ae0[_0xda5d('0x37')]=_['intersection'](_0x411ae0['model'],_0x411ae0[_0xda5d('0x36')]);_0x59933a[_0xda5d('0x38')]=_[_0xda5d('0x39')](_0x411ae0[_0xda5d('0x34')],qs[_0xda5d('0x3a')](_0x14e1b0[_0xda5d('0x36')][_0xda5d('0x3a')]));_0x59933a[_0xda5d('0x38')]=_0x59933a['attributes'][_0xda5d('0x4c')]?_0x59933a['attributes']:_0x411ae0[_0xda5d('0x34')];if(_0x14e1b0[_0xda5d('0x36')][_0xda5d('0x44')]){_0x59933a[_0xda5d('0x45')]=[{'all':!![]}];}_0x59933a=_['merge']({},_0x59933a,_0x14e1b0[_0xda5d('0x42')]);return db[_0xda5d('0x43')][_0xda5d('0x4d')](_0x59933a)['then'](handleEntityNotFound(_0x317992,null))['then'](respondWithResult(_0x317992,null))[_0xda5d('0x48')](handleError(_0x317992,null));};exports['create']=function(_0x44d866,_0x50e739){return db[_0xda5d('0x43')][_0xda5d('0x4e')](_0x44d866[_0xda5d('0x4f')],{})[_0xda5d('0x26')](function(_0x28572d){var _0x2dc6d9=_0x44d866['user']['get']({'plain':!![]});if(!_0x2dc6d9)throw new Error(_0xda5d('0x50'));if(_0x2dc6d9['role']===_0xda5d('0x51')){var _0x1f7655=_0x28572d[_0xda5d('0x28')]({'plain':!![]});var _0x423641='Teams';return db[_0xda5d('0x52')][_0xda5d('0x4d')]({'where':{'name':_0x423641,'userProfileId':_0x2dc6d9[_0xda5d('0x53')]},'raw':!![]})[_0xda5d('0x26')](function(_0x335c9b){if(_0x335c9b&&_0x335c9b[_0xda5d('0x54')]===0x0){return db[_0xda5d('0x2a')][_0xda5d('0x4e')]({'name':_0x1f7655[_0xda5d('0x2e')],'resourceId':_0x1f7655['id'],'type':_0x335c9b[_0xda5d('0x2e')],'sectionId':_0x335c9b['id']},{})[_0xda5d('0x26')](function(){return _0x28572d;});}else{return _0x28572d;}})[_0xda5d('0x48')](function(_0x11dded){logger[_0xda5d('0x2c')](_0xda5d('0x55'),_0x11dded);throw _0x11dded;});}return _0x28572d;})[_0xda5d('0x26')](respondWithResult(_0x50e739,0xc9))[_0xda5d('0x48')](handleError(_0x50e739,null));};exports[_0xda5d('0x25')]=function(_0x522a31,_0x548007){if(_0x522a31[_0xda5d('0x4f')]['id']){delete _0x522a31[_0xda5d('0x4f')]['id'];}return db[_0xda5d('0x43')][_0xda5d('0x4d')]({'where':{'id':_0x522a31[_0xda5d('0x4a')]['id']}})[_0xda5d('0x26')](handleEntityNotFound(_0x548007,null))[_0xda5d('0x26')](saveUpdates(_0x522a31['body'],null))['then'](respondWithResult(_0x548007,null))[_0xda5d('0x48')](handleError(_0x548007,null));};exports[_0xda5d('0x27')]=function(_0x4bcc51,_0x529607){return db[_0xda5d('0x43')][_0xda5d('0x4d')]({'where':{'id':_0x4bcc51[_0xda5d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x529607,null))['then'](removeEntity(_0x529607,null))['catch'](handleError(_0x529607,null));};exports[_0xda5d('0x56')]=function(_0x459e93,_0x68e19c,_0x1b27bb){return db[_0xda5d('0x43')][_0xda5d('0x57')]({'where':{'id':_0x459e93['params']['id']}})[_0xda5d('0x26')](handleEntityNotFound(_0x68e19c,null))[_0xda5d('0x26')](function(_0x2623bb){if(!_0x459e93[_0xda5d('0x36')][_0xda5d('0x58')]||!utils[_0xda5d('0x59')](_0x459e93[_0xda5d('0x36')][_0xda5d('0x58')])){throw new db[(_0xda5d('0x5a'))]['ValidationError'](_0xda5d('0x5b'));}var _0x478fa6={};var _0x786297={};_0x786297[_0xda5d('0x34')]=_[_0xda5d('0x35')](db[_[_0xda5d('0x5c')](_0x459e93[_0xda5d('0x36')][_0xda5d('0x58')][_0xda5d('0x5d')]())+_0xda5d('0x5e')][_0xda5d('0x4b')]);_0x786297[_0xda5d('0x36')]=_['keys'](_0x459e93[_0xda5d('0x36')]);_0x786297[_0xda5d('0x37')]=_[_0xda5d('0x39')](_0x786297[_0xda5d('0x34')],_0x786297['query']);_0x478fa6[_0xda5d('0x38')]=_[_0xda5d('0x39')](_0x786297[_0xda5d('0x34')],qs[_0xda5d('0x3a')](_0x459e93[_0xda5d('0x36')][_0xda5d('0x3a')]));_0x478fa6[_0xda5d('0x38')]=_0x478fa6[_0xda5d('0x38')][_0xda5d('0x4c')]?_0x478fa6[_0xda5d('0x38')]:_0x786297[_0xda5d('0x34')];_0x478fa6[_0xda5d('0x1f')]=qs[_0xda5d('0x1f')](_0x459e93['query'][_0xda5d('0x1f')]);_0x478fa6[_0xda5d('0x1e')]=qs[_0xda5d('0x1e')](_0x459e93['query'][_0xda5d('0x1e')]);_0x478fa6[_0xda5d('0x5f')]=qs[_0xda5d('0x3d')](_0x459e93['query']['sort']);_0x478fa6[_0xda5d('0x40')]=qs[_0xda5d('0x37')](_[_0xda5d('0x3e')](_0x459e93[_0xda5d('0x36')],_0x786297[_0xda5d('0x37')]));_0x478fa6=_[_0xda5d('0x60')]({},_0x478fa6,_0x459e93['options']);return _0x2623bb[_0xda5d('0x28')+_[_0xda5d('0x5c')](_0x459e93[_0xda5d('0x36')][_0xda5d('0x58')][_0xda5d('0x5d')]())+'Queues'](_0x478fa6);})['then'](respondWithResult(_0x68e19c,null))[_0xda5d('0x48')](handleError(_0x68e19c,null));};exports['addQueues']=function(_0x259aed,_0x285449,_0xa598d4){return db[_0xda5d('0x43')][_0xda5d('0x57')]({'where':{'id':_0x259aed[_0xda5d('0x4a')]['id']}})[_0xda5d('0x26')](function(_0x4d6216){if(_0x4d6216){if(!_0x259aed[_0xda5d('0x4f')][_0xda5d('0x58')]||!utils[_0xda5d('0x59')](_0x259aed[_0xda5d('0x4f')]['channel'])){throw new db[(_0xda5d('0x5a'))][(_0xda5d('0x61'))](_0xda5d('0x5b'));}return _0x4d6216[_0xda5d('0x62')+_['capitalize'](_0x259aed['body'][_0xda5d('0x58')]['toLowerCase']())+_0xda5d('0x63')](_0x259aed[_0xda5d('0x4f')][_0xda5d('0x64')]);}return null;})[_0xda5d('0x26')](handleEntityNotFound(_0x285449,null))[_0xda5d('0x26')](respondWithStatusCode(_0x285449,null))['catch'](handleError(_0x285449,null));};exports[_0xda5d('0x65')]=function(_0x4d49c9,_0x444678,_0x368c9d){return db[_0xda5d('0x43')][_0xda5d('0x57')]({'where':{'id':_0x4d49c9[_0xda5d('0x4a')]['id']}})['then'](function(_0xca9b71){if(_0xca9b71){if(!_0x4d49c9[_0xda5d('0x36')][_0xda5d('0x58')]||!utils[_0xda5d('0x59')](_0x4d49c9[_0xda5d('0x36')][_0xda5d('0x58')])){throw new db[(_0xda5d('0x5a'))][(_0xda5d('0x61'))](_0xda5d('0x5b'));}return _0xca9b71[_0xda5d('0x66')+_[_0xda5d('0x5c')](_0x4d49c9[_0xda5d('0x36')][_0xda5d('0x58')]['toLowerCase']())+_0xda5d('0x63')](_0x4d49c9[_0xda5d('0x36')]['ids']);}return null;})[_0xda5d('0x26')](handleEntityNotFound(_0x444678,null))[_0xda5d('0x26')](respondWithStatusCode(_0x444678,null))[_0xda5d('0x48')](handleError(_0x444678,null));};exports['addAgents']=function(_0x5b5d1,_0x25dab9,_0x1b8855){return db['Team']['find']({'where':{'id':_0x5b5d1[_0xda5d('0x4a')]['id']}})[_0xda5d('0x26')](handleEntityNotFound(_0x25dab9,null))[_0xda5d('0x26')](function(_0x351e2c){if(_0x351e2c){var _0x1d3921=[_0xda5d('0x67'),_0xda5d('0x68'),_0xda5d('0x69'),_0xda5d('0x6a'),_0xda5d('0x6b'),_0xda5d('0x6c')];return BPromise[_0xda5d('0x6d')](_0x1d3921,function(_0x234f51){return _0x351e2c['get'+_0x234f51+_0xda5d('0x63')]({'attributes':['id','name']})[_0xda5d('0x26')](function(_0x3b33c3){return BPromise[_0xda5d('0x6d')](_0x3b33c3,function(_0x28647e){return _0x28647e['addAgents'](_0x5b5d1[_0xda5d('0x4f')]['ids'])[_0xda5d('0x26')](function(){if(_0x234f51===_0xda5d('0x67')){return db['User'][_0xda5d('0x46')]({'where':{'id':_0x5b5d1[_0xda5d('0x4f')][_0xda5d('0x64')]},'attributes':['id',_0xda5d('0x2e'),_0xda5d('0x6e'),'voicePause',_0xda5d('0x6f')],'raw':!![]})[_0xda5d('0x26')](function(_0x3801e6){return BPromise[_0xda5d('0x6d')](_['filter'](_0x3801e6,{'online':0x1}),function(_0x176aac){return db[_0xda5d('0x70')][_0xda5d('0x71')]({'membername':_0x176aac['name'],'UserId':_0x176aac['id'],'queue_name':_0x28647e[_0xda5d('0x2e')],'VoiceQueueId':_0x28647e['id'],'interface':_[_0xda5d('0x72')](_0x176aac[_0xda5d('0x6f')])?util[_0xda5d('0x73')](_0xda5d('0x74'),_0x176aac[_0xda5d('0x2e')]):_0x176aac[_0xda5d('0x6f')],'paused':_0x176aac[_0xda5d('0x75')]||![],'penalty':0x0});});});}});});})[_0xda5d('0x26')](function(){return _0x351e2c;});})[_0xda5d('0x26')](function(){return _0x351e2c;});}})[_0xda5d('0x26')](function(_0x2780a4){if(_0x2780a4){return _0x2780a4[_0xda5d('0x76')](_0x5b5d1[_0xda5d('0x4f')][_0xda5d('0x64')],_[_0xda5d('0x77')](_0x5b5d1[_0xda5d('0x4f')],[_0xda5d('0x64'),'id'])||{})[_0xda5d('0x78')](function(_0x1efbab){for(var _0x3ec6e5=0x0;_0x3ec6e5<_0x5b5d1[_0xda5d('0x4f')][_0xda5d('0x64')][_0xda5d('0x4c')];_0x3ec6e5+=0x1){socket[_0xda5d('0x79')](_0xda5d('0x7a'),{'UserId':_0x5b5d1[_0xda5d('0x4f')]['ids'][_0x3ec6e5],'TeamId':_0x5b5d1['params']['id']});}return _0x1efbab;});}})[_0xda5d('0x26')](respondWithResult(_0x25dab9,null))['catch'](handleError(_0x25dab9,null));};exports['removeAgents']=function(_0x100a86,_0x18ea99,_0x520c71){return db['Team'][_0xda5d('0x4d')]({'where':{'id':_0x100a86[_0xda5d('0x4a')]['id']}})[_0xda5d('0x26')](handleEntityNotFound(_0x18ea99,null))[_0xda5d('0x26')](function(_0x50937c){if(_0x50937c){return BPromise[_0xda5d('0x6d')](['voice',_0xda5d('0x7b'),_0xda5d('0x7c'),_0xda5d('0x7d'),'fax',_0xda5d('0x7e')],function(_0x3fee03){return _0x50937c[_0xda5d('0x28')+_[_0xda5d('0x5c')](_0x3fee03)+_0xda5d('0x63')]({'attributes':['id','name']})[_0xda5d('0x26')](function(_0xe50ee1){return BPromise[_0xda5d('0x6d')](_0xe50ee1,function(_0xeb8b89){return _0xeb8b89['removeAgents'](_0x100a86[_0xda5d('0x36')]['ids'])[_0xda5d('0x26')](function(){if(_0x3fee03==='voice'){return db[_0xda5d('0x70')][_0xda5d('0x27')]({'where':{'VoiceQueueId':_0xeb8b89['id'],'UserId':_0x100a86[_0xda5d('0x36')][_0xda5d('0x64')]}});}});});})[_0xda5d('0x26')](function(){return _0x50937c;});})[_0xda5d('0x26')](function(){return _0x50937c;});}})[_0xda5d('0x26')](function(_0x13f8f4){if(_0x13f8f4){return _0x13f8f4['removeAgents'](_0x100a86['query'][_0xda5d('0x64')])['then'](function(){if(_['isArray'](_0x100a86['query'][_0xda5d('0x64')])){for(var _0x602008=0x0;_0x602008<_0x100a86[_0xda5d('0x36')][_0xda5d('0x64')][_0xda5d('0x4c')];_0x602008+=0x1){socket[_0xda5d('0x79')](_0xda5d('0x7f'),{'UserId':Number(_0x100a86[_0xda5d('0x36')][_0xda5d('0x64')][_0x602008]),'TeamId':Number(_0x100a86[_0xda5d('0x4a')]['id'])});}}else{socket[_0xda5d('0x79')](_0xda5d('0x7f'),{'UserId':Number(_0x100a86[_0xda5d('0x36')][_0xda5d('0x64')]),'TeamId':Number(_0x100a86[_0xda5d('0x4a')]['id'])});}});}})[_0xda5d('0x26')](respondWithStatusCode(_0x18ea99,null))[_0xda5d('0x48')](handleError(_0x18ea99,null));};exports[_0xda5d('0x80')]=function(_0x32164d,_0x3698a0,_0x53979e){var _0x208097={};var _0x381744={};var _0x102b85;var _0x4e2046;return db[_0xda5d('0x43')][_0xda5d('0x57')]({'where':{'id':_0x32164d['params']['id']}})[_0xda5d('0x26')](handleEntityNotFound(_0x3698a0,null))[_0xda5d('0x26')](function(_0xd991ef){if(_0xd991ef){_0x102b85=_0xd991ef;_0x381744[_0xda5d('0x34')]=_[_0xda5d('0x35')](db[_0xda5d('0x81')]['rawAttributes']);_0x381744[_0xda5d('0x36')]=_['keys'](_0x32164d['query']);_0x381744['filters']=_[_0xda5d('0x39')](_0x381744['model'],_0x381744[_0xda5d('0x36')]);_0x208097[_0xda5d('0x38')]=_[_0xda5d('0x39')](_0x381744[_0xda5d('0x34')],qs[_0xda5d('0x3a')](_0x32164d[_0xda5d('0x36')][_0xda5d('0x3a')]));_0x208097['attributes']=_0x208097[_0xda5d('0x38')][_0xda5d('0x4c')]?_0x208097[_0xda5d('0x38')]:_0x381744[_0xda5d('0x34')];_0x208097['order']=qs[_0xda5d('0x3d')](_0x32164d[_0xda5d('0x36')]['sort']);_0x208097[_0xda5d('0x40')]=qs[_0xda5d('0x37')](_[_0xda5d('0x3e')](_0x32164d['query'],_0x381744[_0xda5d('0x37')]));if(_0x32164d[_0xda5d('0x36')][_0xda5d('0x3f')]){_0x208097[_0xda5d('0x40')]=_[_0xda5d('0x60')](_0x208097[_0xda5d('0x40')],{'$or':_[_0xda5d('0x41')](_0x208097['attributes'],function(_0x517935){var _0x4ea05d={};_0x4ea05d[_0x517935]={'$like':'%'+_0x32164d[_0xda5d('0x36')][_0xda5d('0x3f')]+'%'};return _0x4ea05d;})});}_0x208097=_[_0xda5d('0x60')]({},_0x208097,_0x32164d['options']);return _0x102b85['getAgents'](_0x208097);}})['then'](function(_0x500b7d){if(_0x500b7d){_0x4e2046=_0x500b7d[_0xda5d('0x4c')];if(!_0x32164d[_0xda5d('0x36')]['hasOwnProperty'](_0xda5d('0x3c'))){_0x208097['limit']=qs[_0xda5d('0x1f')](_0x32164d[_0xda5d('0x36')]['limit']);_0x208097[_0xda5d('0x1e')]=qs[_0xda5d('0x1e')](_0x32164d['query'][_0xda5d('0x1e')]);}return _0x102b85[_0xda5d('0x80')](_0x208097);}})[_0xda5d('0x26')](function(_0x14e617){if(_0x14e617){return _0x14e617?{'count':_0x4e2046,'rows':_0x14e617}:null;}})['then'](respondWithResult(_0x3698a0,null))['catch'](handleError(_0x3698a0,null));}; \ No newline at end of file +var _0x0c3a=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./team.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','Teams','UserProfileResource','error','stack','name','send','index','map','Team','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','toLowerCase','sort','capitalize','Queues','addQueues','Unknown\x20channel','ids','removeQueues','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','each','User','online','voicePause','interface','upsert','isNil','SIP/%s','omit','emit','userTeam:save','removeAgents','voice','chat','fax','openchannel','isArray','length','userTeam:remove','getAgents','html-pdf','eml-format','rimraf'];(function(_0x553226,_0x549aba){var _0x139117=function(_0x53c6c5){while(--_0x53c6c5){_0x553226['push'](_0x553226['shift']());}};_0x139117(++_0x549aba);}(_0x0c3a,0x171));var _0xa0c3=function(_0x22a1f3,_0x2f94ef){_0x22a1f3=_0x22a1f3-0x0;var _0x2524e7=_0x0c3a[_0x22a1f3];return _0x2524e7;};'use strict';var pdf=require(_0xa0c3('0x0'));var emlformat=require(_0xa0c3('0x1'));var rimraf=require(_0xa0c3('0x2'));var zipdir=require(_0xa0c3('0x3'));var jsonpatch=require(_0xa0c3('0x4'));var rp=require(_0xa0c3('0x5'));var moment=require(_0xa0c3('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xa0c3('0x7'));var util=require(_0xa0c3('0x8'));var path=require('path');var sox=require(_0xa0c3('0x9'));var csv=require(_0xa0c3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa0c3('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa0c3('0xc'));var deskjs=require(_0xa0c3('0xd'));var toCsv=require(_0xa0c3('0xa'));var querystring=require(_0xa0c3('0xe'));var Papa=require('papaparse');var Redis=require(_0xa0c3('0xf'));var authService=require(_0xa0c3('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0c3('0x11'));var logger=require(_0xa0c3('0x12'))('api');var utils=require(_0xa0c3('0x13'));var config=require(_0xa0c3('0x14'));var db=require(_0xa0c3('0x15'))['db'];config['redis']=_[_0xa0c3('0x16')](config[_0xa0c3('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa0c3('0x17')]));require(_0xa0c3('0x18'))[_0xa0c3('0x19')](socket);function respondWithStatusCode(_0x2b0e25,_0x334049){_0x334049=_0x334049||0xcc;return function(_0x4bbfcf){if(_0x4bbfcf){return _0x2b0e25[_0xa0c3('0x1a')](_0x334049);}return _0x2b0e25['status'](_0x334049)[_0xa0c3('0x1b')]();};}function respondWithResult(_0x5195c3,_0x49983c){_0x49983c=_0x49983c||0xc8;return function(_0x4d5c8a){if(_0x4d5c8a){return _0x5195c3[_0xa0c3('0x1c')](_0x49983c)[_0xa0c3('0x1d')](_0x4d5c8a);}};}function respondWithFilteredResult(_0x4f19c5,_0x4c6b92){return function(_0x95dd1a){if(_0x95dd1a){var _0xbadd6f=_0x95dd1a[_0xa0c3('0x1e')],_0x351919=_0x4c6b92[_0xa0c3('0x1f')],_0x35b716=_0x4c6b92['offset']+_0x4c6b92[_0xa0c3('0x20')],_0x3ca725;if(_0x35b716>=_0xbadd6f){_0x35b716=_0xbadd6f;_0x3ca725=0xc8;}else{_0x3ca725=0xce;}_0x4f19c5['status'](_0x3ca725);return _0x4f19c5[_0xa0c3('0x21')](_0xa0c3('0x22'),_0x351919+'-'+_0x35b716+'/'+_0xbadd6f)[_0xa0c3('0x1d')](_0x95dd1a);}return null;};}function patchUpdates(_0x2475ff){return function(_0x53111d){try{jsonpatch[_0xa0c3('0x23')](_0x53111d,_0x2475ff,!![]);}catch(_0x2be9eb){return BPromise[_0xa0c3('0x24')](_0x2be9eb);}return _0x53111d[_0xa0c3('0x25')]();};}function saveUpdates(_0x124907,_0xdb5807){return function(_0x2926b5){if(_0x2926b5){return _0x2926b5['update'](_0x124907)[_0xa0c3('0x26')](function(_0xbc0388){return _0xbc0388;});}return null;};}function removeEntity(_0x216dc7,_0x4a70bc){return function(_0x47b303){if(_0x47b303){return _0x47b303[_0xa0c3('0x27')]()[_0xa0c3('0x26')](function(){var _0x16daf8=_0x47b303[_0xa0c3('0x28')]({'plain':!![]});var _0xf43037=_0xa0c3('0x29');return db[_0xa0c3('0x2a')][_0xa0c3('0x27')]({'where':{'type':_0xf43037,'resourceId':_0x16daf8['id']}})['then'](function(){return _0x47b303;});})[_0xa0c3('0x26')](function(){_0x216dc7[_0xa0c3('0x1c')](0xcc)[_0xa0c3('0x1b')]();});}};}function handleEntityNotFound(_0x38b5f8,_0x39ec3d){return function(_0x54cf9e){if(!_0x54cf9e){_0x38b5f8[_0xa0c3('0x1a')](0x194);}return _0x54cf9e;};}function handleError(_0x51ea75,_0x24c677){_0x24c677=_0x24c677||0x1f4;return function(_0xd1bfff){logger[_0xa0c3('0x2b')](_0xd1bfff[_0xa0c3('0x2c')]);if(_0xd1bfff[_0xa0c3('0x2d')]){delete _0xd1bfff[_0xa0c3('0x2d')];}_0x51ea75['status'](_0x24c677)[_0xa0c3('0x2e')](_0xd1bfff);};}exports[_0xa0c3('0x2f')]=function(_0xa06c67,_0xc48146){var _0x217edb={},_0x5ab556={},_0x275f2={'count':0x0,'rows':[]};var _0x789084=_[_0xa0c3('0x30')](db[_0xa0c3('0x31')]['rawAttributes'],function(_0x1a24c5){return{'name':_0x1a24c5['fieldName'],'type':_0x1a24c5[_0xa0c3('0x32')][_0xa0c3('0x33')]};});_0x5ab556[_0xa0c3('0x34')]=_['map'](_0x789084,_0xa0c3('0x2d'));_0x5ab556[_0xa0c3('0x35')]=_[_0xa0c3('0x36')](_0xa06c67[_0xa0c3('0x35')]);_0x5ab556[_0xa0c3('0x37')]=_[_0xa0c3('0x38')](_0x5ab556['model'],_0x5ab556[_0xa0c3('0x35')]);_0x217edb[_0xa0c3('0x39')]=_[_0xa0c3('0x38')](_0x5ab556[_0xa0c3('0x34')],qs[_0xa0c3('0x3a')](_0xa06c67[_0xa0c3('0x35')][_0xa0c3('0x3a')]));_0x217edb['attributes']=_0x217edb['attributes']['length']?_0x217edb[_0xa0c3('0x39')]:_0x5ab556[_0xa0c3('0x34')];if(!_0xa06c67[_0xa0c3('0x35')][_0xa0c3('0x3b')](_0xa0c3('0x3c'))){_0x217edb[_0xa0c3('0x20')]=qs[_0xa0c3('0x20')](_0xa06c67[_0xa0c3('0x35')][_0xa0c3('0x20')]);_0x217edb[_0xa0c3('0x1f')]=qs[_0xa0c3('0x1f')](_0xa06c67[_0xa0c3('0x35')]['offset']);}_0x217edb[_0xa0c3('0x3d')]=qs['sort'](_0xa06c67[_0xa0c3('0x35')]['sort']);_0x217edb[_0xa0c3('0x3e')]=qs[_0xa0c3('0x37')](_[_0xa0c3('0x3f')](_0xa06c67[_0xa0c3('0x35')],_0x5ab556[_0xa0c3('0x37')]));if(_0xa06c67[_0xa0c3('0x35')][_0xa0c3('0x40')]){_0x217edb[_0xa0c3('0x3e')]=_[_0xa0c3('0x41')](_0x217edb['where'],{'$or':_['map'](_0x789084,function(_0x4dc209){if(_0x4dc209['type']!==_0xa0c3('0x42')){var _0x5361ac={};_0x5361ac[_0x4dc209[_0xa0c3('0x2d')]]={'$like':'%'+_0xa06c67[_0xa0c3('0x35')][_0xa0c3('0x40')]+'%'};return _0x5361ac;}})});}_0x217edb=_[_0xa0c3('0x41')]({},_0x217edb,_0xa06c67[_0xa0c3('0x43')]);var _0x56e76d={'where':_0x217edb[_0xa0c3('0x3e')]};return db[_0xa0c3('0x31')][_0xa0c3('0x1e')](_0x56e76d)[_0xa0c3('0x26')](function(_0x24b1db){_0x275f2[_0xa0c3('0x1e')]=_0x24b1db;if(_0xa06c67[_0xa0c3('0x35')][_0xa0c3('0x44')]){_0x217edb['include']=[{'all':!![]}];}return db[_0xa0c3('0x31')][_0xa0c3('0x45')](_0x217edb);})[_0xa0c3('0x26')](function(_0x43f80c){_0x275f2[_0xa0c3('0x46')]=_0x43f80c;return _0x275f2;})[_0xa0c3('0x26')](respondWithFilteredResult(_0xc48146,_0x217edb))[_0xa0c3('0x47')](handleError(_0xc48146,null));};exports[_0xa0c3('0x48')]=function(_0x3130b7,_0x3db5e5){var _0x5ba4f2={'raw':![],'where':{'id':_0x3130b7[_0xa0c3('0x49')]['id']}},_0x1fb9fc={};_0x1fb9fc[_0xa0c3('0x34')]=_[_0xa0c3('0x36')](db['Team'][_0xa0c3('0x4a')]);_0x1fb9fc[_0xa0c3('0x35')]=_[_0xa0c3('0x36')](_0x3130b7[_0xa0c3('0x35')]);_0x1fb9fc[_0xa0c3('0x37')]=_['intersection'](_0x1fb9fc['model'],_0x1fb9fc['query']);_0x5ba4f2[_0xa0c3('0x39')]=_['intersection'](_0x1fb9fc[_0xa0c3('0x34')],qs[_0xa0c3('0x3a')](_0x3130b7[_0xa0c3('0x35')]['fields']));_0x5ba4f2[_0xa0c3('0x39')]=_0x5ba4f2['attributes']['length']?_0x5ba4f2[_0xa0c3('0x39')]:_0x1fb9fc[_0xa0c3('0x34')];if(_0x3130b7[_0xa0c3('0x35')][_0xa0c3('0x44')]){_0x5ba4f2[_0xa0c3('0x4b')]=[{'all':!![]}];}_0x5ba4f2=_[_0xa0c3('0x41')]({},_0x5ba4f2,_0x3130b7[_0xa0c3('0x43')]);return db[_0xa0c3('0x31')][_0xa0c3('0x4c')](_0x5ba4f2)[_0xa0c3('0x26')](handleEntityNotFound(_0x3db5e5,null))['then'](respondWithResult(_0x3db5e5,null))['catch'](handleError(_0x3db5e5,null));};exports[_0xa0c3('0x4d')]=function(_0x50df44,_0x5bbb2f){return db['Team'][_0xa0c3('0x4d')](_0x50df44['body'],{})['then'](function(_0x354935){var _0x460552=_0x50df44[_0xa0c3('0x4e')][_0xa0c3('0x28')]({'plain':!![]});if(!_0x460552)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x460552['role']===_0xa0c3('0x4e')){var _0x376b87=_0x354935[_0xa0c3('0x28')]({'plain':!![]});var _0x342755=_0xa0c3('0x29');return db[_0xa0c3('0x4f')][_0xa0c3('0x4c')]({'where':{'name':_0x342755,'userProfileId':_0x460552['userProfileId']},'raw':!![]})[_0xa0c3('0x26')](function(_0x169cd9){if(_0x169cd9&&_0x169cd9[_0xa0c3('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x376b87['name'],'resourceId':_0x376b87['id'],'type':_0x169cd9[_0xa0c3('0x2d')],'sectionId':_0x169cd9['id']},{})[_0xa0c3('0x26')](function(){return _0x354935;});}else{return _0x354935;}})['catch'](function(_0x1fd6df){logger['error'](_0xa0c3('0x51'),_0x1fd6df);throw _0x1fd6df;});}return _0x354935;})[_0xa0c3('0x26')](respondWithResult(_0x5bbb2f,0xc9))[_0xa0c3('0x47')](handleError(_0x5bbb2f,null));};exports['update']=function(_0x33a436,_0x728afc){if(_0x33a436[_0xa0c3('0x52')]['id']){delete _0x33a436['body']['id'];}return db[_0xa0c3('0x31')]['find']({'where':{'id':_0x33a436[_0xa0c3('0x49')]['id']}})[_0xa0c3('0x26')](handleEntityNotFound(_0x728afc,null))['then'](saveUpdates(_0x33a436['body'],null))[_0xa0c3('0x26')](respondWithResult(_0x728afc,null))['catch'](handleError(_0x728afc,null));};exports[_0xa0c3('0x27')]=function(_0x4dde68,_0x42c9da){return db[_0xa0c3('0x31')]['find']({'where':{'id':_0x4dde68['params']['id']}})[_0xa0c3('0x26')](handleEntityNotFound(_0x42c9da,null))['then'](removeEntity(_0x42c9da,null))['catch'](handleError(_0x42c9da,null));};exports[_0xa0c3('0x53')]=function(_0x1bfebd,_0x24a0f9,_0xff147c){return db[_0xa0c3('0x31')][_0xa0c3('0x54')]({'where':{'id':_0x1bfebd[_0xa0c3('0x49')]['id']}})[_0xa0c3('0x26')](handleEntityNotFound(_0x24a0f9,null))[_0xa0c3('0x26')](function(_0x4a9104){if(!_0x1bfebd['query'][_0xa0c3('0x55')]||!utils[_0xa0c3('0x56')](_0x1bfebd[_0xa0c3('0x35')][_0xa0c3('0x55')])){throw new db[(_0xa0c3('0x57'))][(_0xa0c3('0x58'))]('Unknown\x20channel');}var _0x13419f={};var _0x2d75ac={};_0x2d75ac['model']=_['keys'](db[_['capitalize'](_0x1bfebd[_0xa0c3('0x35')][_0xa0c3('0x55')][_0xa0c3('0x59')]())+'Queue']['rawAttributes']);_0x2d75ac[_0xa0c3('0x35')]=_[_0xa0c3('0x36')](_0x1bfebd[_0xa0c3('0x35')]);_0x2d75ac[_0xa0c3('0x37')]=_[_0xa0c3('0x38')](_0x2d75ac[_0xa0c3('0x34')],_0x2d75ac[_0xa0c3('0x35')]);_0x13419f[_0xa0c3('0x39')]=_['intersection'](_0x2d75ac[_0xa0c3('0x34')],qs['fields'](_0x1bfebd[_0xa0c3('0x35')][_0xa0c3('0x3a')]));_0x13419f[_0xa0c3('0x39')]=_0x13419f[_0xa0c3('0x39')]['length']?_0x13419f[_0xa0c3('0x39')]:_0x2d75ac['model'];_0x13419f['limit']=qs['limit'](_0x1bfebd[_0xa0c3('0x35')][_0xa0c3('0x20')]);_0x13419f[_0xa0c3('0x1f')]=qs['offset'](_0x1bfebd['query'][_0xa0c3('0x1f')]);_0x13419f[_0xa0c3('0x3d')]=qs[_0xa0c3('0x5a')](_0x1bfebd[_0xa0c3('0x35')][_0xa0c3('0x5a')]);_0x13419f[_0xa0c3('0x3e')]=qs[_0xa0c3('0x37')](_[_0xa0c3('0x3f')](_0x1bfebd[_0xa0c3('0x35')],_0x2d75ac[_0xa0c3('0x37')]));_0x13419f=_[_0xa0c3('0x41')]({},_0x13419f,_0x1bfebd[_0xa0c3('0x43')]);return _0x4a9104[_0xa0c3('0x28')+_[_0xa0c3('0x5b')](_0x1bfebd[_0xa0c3('0x35')]['channel']['toLowerCase']())+_0xa0c3('0x5c')](_0x13419f);})[_0xa0c3('0x26')](respondWithResult(_0x24a0f9,null))['catch'](handleError(_0x24a0f9,null));};exports[_0xa0c3('0x5d')]=function(_0x2ea99a,_0x1cf91f,_0x56306b){return db[_0xa0c3('0x31')][_0xa0c3('0x54')]({'where':{'id':_0x2ea99a[_0xa0c3('0x49')]['id']}})['then'](function(_0x341aae){if(_0x341aae){if(!_0x2ea99a[_0xa0c3('0x52')][_0xa0c3('0x55')]||!utils[_0xa0c3('0x56')](_0x2ea99a[_0xa0c3('0x52')][_0xa0c3('0x55')])){throw new db[(_0xa0c3('0x57'))]['ValidationError'](_0xa0c3('0x5e'));}return _0x341aae['add'+_[_0xa0c3('0x5b')](_0x2ea99a[_0xa0c3('0x52')][_0xa0c3('0x55')][_0xa0c3('0x59')]())+_0xa0c3('0x5c')](_0x2ea99a[_0xa0c3('0x52')][_0xa0c3('0x5f')]);}return null;})[_0xa0c3('0x26')](handleEntityNotFound(_0x1cf91f,null))[_0xa0c3('0x26')](respondWithStatusCode(_0x1cf91f,null))['catch'](handleError(_0x1cf91f,null));};exports[_0xa0c3('0x60')]=function(_0x41193f,_0xd9512e,_0x3ad1c3){return db[_0xa0c3('0x31')][_0xa0c3('0x54')]({'where':{'id':_0x41193f[_0xa0c3('0x49')]['id']}})[_0xa0c3('0x26')](function(_0x43de86){if(_0x43de86){if(!_0x41193f[_0xa0c3('0x35')][_0xa0c3('0x55')]||!utils[_0xa0c3('0x56')](_0x41193f['query'][_0xa0c3('0x55')])){throw new db[(_0xa0c3('0x57'))][(_0xa0c3('0x58'))](_0xa0c3('0x5e'));}return _0x43de86['remove'+_['capitalize'](_0x41193f[_0xa0c3('0x35')][_0xa0c3('0x55')][_0xa0c3('0x59')]())+'Queues'](_0x41193f[_0xa0c3('0x35')][_0xa0c3('0x5f')]);}return null;})[_0xa0c3('0x26')](handleEntityNotFound(_0xd9512e,null))[_0xa0c3('0x26')](respondWithStatusCode(_0xd9512e,null))[_0xa0c3('0x47')](handleError(_0xd9512e,null));};exports[_0xa0c3('0x61')]=function(_0x330815,_0x426a56,_0x3f96b0){return db[_0xa0c3('0x31')][_0xa0c3('0x4c')]({'where':{'id':_0x330815[_0xa0c3('0x49')]['id']}})[_0xa0c3('0x26')](handleEntityNotFound(_0x426a56,null))['then'](function(_0x27403b){if(_0x27403b){var _0x279ae2=[_0xa0c3('0x62'),_0xa0c3('0x63'),_0xa0c3('0x64'),_0xa0c3('0x65'),_0xa0c3('0x66'),_0xa0c3('0x67')];return BPromise['each'](_0x279ae2,function(_0xcfec35){return _0x27403b[_0xa0c3('0x28')+_0xcfec35+_0xa0c3('0x5c')]({'attributes':['id','name']})['then'](function(_0x98f3d6){return BPromise[_0xa0c3('0x68')](_0x98f3d6,function(_0x470eb2){return _0x470eb2[_0xa0c3('0x61')](_0x330815[_0xa0c3('0x52')]['ids'])[_0xa0c3('0x26')](function(){if(_0xcfec35===_0xa0c3('0x62')){return db[_0xa0c3('0x69')][_0xa0c3('0x45')]({'where':{'id':_0x330815[_0xa0c3('0x52')][_0xa0c3('0x5f')]},'attributes':['id','name',_0xa0c3('0x6a'),_0xa0c3('0x6b'),_0xa0c3('0x6c')],'raw':!![]})['then'](function(_0x4bdccb){return BPromise[_0xa0c3('0x68')](_[_0xa0c3('0x40')](_0x4bdccb,{'online':0x1}),function(_0x19f352){return db['UserVoiceQueueRt'][_0xa0c3('0x6d')]({'membername':_0x19f352['name'],'UserId':_0x19f352['id'],'queue_name':_0x470eb2['name'],'VoiceQueueId':_0x470eb2['id'],'interface':_[_0xa0c3('0x6e')](_0x19f352[_0xa0c3('0x6c')])?util['format'](_0xa0c3('0x6f'),_0x19f352[_0xa0c3('0x2d')]):_0x19f352[_0xa0c3('0x6c')],'paused':_0x19f352[_0xa0c3('0x6b')]||![],'penalty':0x0});});});}});});})[_0xa0c3('0x26')](function(){return _0x27403b;});})[_0xa0c3('0x26')](function(){return _0x27403b;});}})[_0xa0c3('0x26')](function(_0x4afef9){if(_0x4afef9){return _0x4afef9[_0xa0c3('0x61')](_0x330815[_0xa0c3('0x52')]['ids'],_[_0xa0c3('0x70')](_0x330815[_0xa0c3('0x52')],[_0xa0c3('0x5f'),'id'])||{})['spread'](function(_0x3f5dd9){for(var _0x3488ab=0x0;_0x3488ab<_0x330815[_0xa0c3('0x52')][_0xa0c3('0x5f')]['length'];_0x3488ab+=0x1){socket[_0xa0c3('0x71')](_0xa0c3('0x72'),{'UserId':_0x330815['body'][_0xa0c3('0x5f')][_0x3488ab],'TeamId':_0x330815['params']['id']});}return _0x3f5dd9;});}})['then'](respondWithResult(_0x426a56,null))[_0xa0c3('0x47')](handleError(_0x426a56,null));};exports[_0xa0c3('0x73')]=function(_0x2a5b09,_0x561b19,_0x371469){return db['Team'][_0xa0c3('0x4c')]({'where':{'id':_0x2a5b09[_0xa0c3('0x49')]['id']}})[_0xa0c3('0x26')](handleEntityNotFound(_0x561b19,null))[_0xa0c3('0x26')](function(_0x6e1efc){if(_0x6e1efc){return BPromise[_0xa0c3('0x68')]([_0xa0c3('0x74'),_0xa0c3('0x75'),'mail','sms',_0xa0c3('0x76'),_0xa0c3('0x77')],function(_0x26a03b){return _0x6e1efc['get'+_[_0xa0c3('0x5b')](_0x26a03b)+_0xa0c3('0x5c')]({'attributes':['id',_0xa0c3('0x2d')]})[_0xa0c3('0x26')](function(_0x4e5a42){return BPromise[_0xa0c3('0x68')](_0x4e5a42,function(_0x34302a){return _0x34302a[_0xa0c3('0x73')](_0x2a5b09[_0xa0c3('0x35')][_0xa0c3('0x5f')])[_0xa0c3('0x26')](function(){if(_0x26a03b==='voice'){return db['UserVoiceQueueRt'][_0xa0c3('0x27')]({'where':{'VoiceQueueId':_0x34302a['id'],'UserId':_0x2a5b09['query'][_0xa0c3('0x5f')]}});}});});})[_0xa0c3('0x26')](function(){return _0x6e1efc;});})[_0xa0c3('0x26')](function(){return _0x6e1efc;});}})[_0xa0c3('0x26')](function(_0x58228e){if(_0x58228e){return _0x58228e[_0xa0c3('0x73')](_0x2a5b09[_0xa0c3('0x35')][_0xa0c3('0x5f')])['then'](function(){if(_[_0xa0c3('0x78')](_0x2a5b09[_0xa0c3('0x35')][_0xa0c3('0x5f')])){for(var _0x3c2cd9=0x0;_0x3c2cd9<_0x2a5b09['query'][_0xa0c3('0x5f')][_0xa0c3('0x79')];_0x3c2cd9+=0x1){socket[_0xa0c3('0x71')](_0xa0c3('0x7a'),{'UserId':Number(_0x2a5b09['query'][_0xa0c3('0x5f')][_0x3c2cd9]),'TeamId':Number(_0x2a5b09['params']['id'])});}}else{socket[_0xa0c3('0x71')](_0xa0c3('0x7a'),{'UserId':Number(_0x2a5b09[_0xa0c3('0x35')][_0xa0c3('0x5f')]),'TeamId':Number(_0x2a5b09[_0xa0c3('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x561b19,null))['catch'](handleError(_0x561b19,null));};exports[_0xa0c3('0x7b')]=function(_0x4958da,_0x7bff12,_0x42e134){var _0x1dcbd2={};var _0x1fbe2b={};var _0xcfaf50;var _0xb42d79;return db[_0xa0c3('0x31')][_0xa0c3('0x54')]({'where':{'id':_0x4958da[_0xa0c3('0x49')]['id']}})['then'](handleEntityNotFound(_0x7bff12,null))[_0xa0c3('0x26')](function(_0x33d8ce){if(_0x33d8ce){_0xcfaf50=_0x33d8ce;_0x1fbe2b[_0xa0c3('0x34')]=_[_0xa0c3('0x36')](db[_0xa0c3('0x69')][_0xa0c3('0x4a')]);_0x1fbe2b['query']=_[_0xa0c3('0x36')](_0x4958da['query']);_0x1fbe2b[_0xa0c3('0x37')]=_[_0xa0c3('0x38')](_0x1fbe2b[_0xa0c3('0x34')],_0x1fbe2b[_0xa0c3('0x35')]);_0x1dcbd2[_0xa0c3('0x39')]=_[_0xa0c3('0x38')](_0x1fbe2b[_0xa0c3('0x34')],qs[_0xa0c3('0x3a')](_0x4958da[_0xa0c3('0x35')]['fields']));_0x1dcbd2[_0xa0c3('0x39')]=_0x1dcbd2[_0xa0c3('0x39')][_0xa0c3('0x79')]?_0x1dcbd2[_0xa0c3('0x39')]:_0x1fbe2b[_0xa0c3('0x34')];_0x1dcbd2['order']=qs[_0xa0c3('0x5a')](_0x4958da[_0xa0c3('0x35')]['sort']);_0x1dcbd2[_0xa0c3('0x3e')]=qs[_0xa0c3('0x37')](_['pick'](_0x4958da[_0xa0c3('0x35')],_0x1fbe2b[_0xa0c3('0x37')]));if(_0x4958da['query'][_0xa0c3('0x40')]){_0x1dcbd2[_0xa0c3('0x3e')]=_[_0xa0c3('0x41')](_0x1dcbd2['where'],{'$or':_[_0xa0c3('0x30')](_0x1dcbd2['attributes'],function(_0x278813){var _0x5c2e4e={};_0x5c2e4e[_0x278813]={'$like':'%'+_0x4958da[_0xa0c3('0x35')][_0xa0c3('0x40')]+'%'};return _0x5c2e4e;})});}_0x1dcbd2=_[_0xa0c3('0x41')]({},_0x1dcbd2,_0x4958da['options']);return _0xcfaf50['getAgents'](_0x1dcbd2);}})[_0xa0c3('0x26')](function(_0x134472){if(_0x134472){_0xb42d79=_0x134472[_0xa0c3('0x79')];if(!_0x4958da[_0xa0c3('0x35')]['hasOwnProperty'](_0xa0c3('0x3c'))){_0x1dcbd2['limit']=qs['limit'](_0x4958da[_0xa0c3('0x35')]['limit']);_0x1dcbd2[_0xa0c3('0x1f')]=qs[_0xa0c3('0x1f')](_0x4958da[_0xa0c3('0x35')][_0xa0c3('0x1f')]);}return _0xcfaf50['getAgents'](_0x1dcbd2);}})['then'](function(_0x24736b){if(_0x24736b){return _0x24736b?{'count':_0xb42d79,'rows':_0x24736b}:null;}})['then'](respondWithResult(_0x7bff12,null))[_0xa0c3('0x47')](handleError(_0x7bff12,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 8714e17..5385fd2 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 _0x8ce0=['remove','emit','exports','events','Team','update'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x8ce0,0x147));var _0x08ce=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x8ce0[_0x2112d4];return _0x434972;};'use strict';var EventEmitter=require(_0x08ce('0x0'));var Team=require('../../mysqldb')['db'][_0x08ce('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x08ce('0x2'),'afterDestroy':_0x08ce('0x3')};function emitEvent(_0x2db44d){return function(_0x2de9fa,_0x5425b4,_0xc1e9f){TeamEvents[_0x08ce('0x4')](_0x2db44d+':'+_0x2de9fa['id'],_0x2de9fa);TeamEvents['emit'](_0x2db44d,_0x2de9fa);_0xc1e9f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x08ce('0x5')]=TeamEvents; \ No newline at end of file +var _0xbe16=['hook','exports','events','Team','update','hasOwnProperty'];(function(_0x4cfdf0,_0x5dac23){var _0x1a3753=function(_0x18ff17){while(--_0x18ff17){_0x4cfdf0['push'](_0x4cfdf0['shift']());}};_0x1a3753(++_0x5dac23);}(_0xbe16,0x1be));var _0x6be1=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xbe16[_0x2080a3];return _0x8d7d17;};'use strict';var EventEmitter=require(_0x6be1('0x0'));var Team=require('../../mysqldb')['db'][_0x6be1('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6be1('0x2'),'afterDestroy':'remove'};function emitEvent(_0x369369){return function(_0x13c09b,_0x2bc002,_0x4421ed){TeamEvents['emit'](_0x369369+':'+_0x13c09b['id'],_0x13c09b);TeamEvents['emit'](_0x369369,_0x13c09b);_0x4421ed(null);};}for(var e in events){if(events[_0x6be1('0x3')](e)){var event=events[e];Team[_0x6be1('0x4')](e,emitEvent(event));}}module[_0x6be1('0x5')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 267380d..dd16ce6 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 _0x5d30=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./team.attributes','define','Team','lodash'];(function(_0x5bf2b5,_0x432da8){var _0x4db38c=function(_0x32ed4b){while(--_0x32ed4b){_0x5bf2b5['push'](_0x5bf2b5['shift']());}};_0x4db38c(++_0x432da8);}(_0x5d30,0x1b7));var _0x05d3=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x5d30[_0x28669c];return _0x4a3af6;};'use strict';var _=require(_0x05d3('0x0'));var util=require('util');var logger=require(_0x05d3('0x1'))(_0x05d3('0x2'));var moment=require(_0x05d3('0x3'));var BPromise=require(_0x05d3('0x4'));var rp=require(_0x05d3('0x5'));var fs=require('fs');var path=require(_0x05d3('0x6'));var rimraf=require('rimraf');var config=require(_0x05d3('0x7'));var attributes=require(_0x05d3('0x8'));module['exports']=function(_0x1561d4,_0x319bbf){return _0x1561d4[_0x05d3('0x9')](_0x05d3('0xa'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6043=['exports','define','Team','teams','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./team.attributes'];(function(_0xd38133,_0xdae649){var _0x5e586e=function(_0x22f95e){while(--_0x22f95e){_0xd38133['push'](_0xd38133['shift']());}};_0x5e586e(++_0xdae649);}(_0x6043,0x115));var _0x3604=function(_0x25b854,_0x2e19ff){_0x25b854=_0x25b854-0x0;var _0x35bcd8=_0x6043[_0x25b854];return _0x35bcd8;};'use strict';var _=require('lodash');var util=require(_0x3604('0x0'));var logger=require(_0x3604('0x1'))(_0x3604('0x2'));var moment=require(_0x3604('0x3'));var BPromise=require(_0x3604('0x4'));var rp=require(_0x3604('0x5'));var fs=require('fs');var path=require(_0x3604('0x6'));var rimraf=require(_0x3604('0x7'));var config=require('../../config/environment');var attributes=require(_0x3604('0x8'));module[_0x3604('0x9')]=function(_0x5a5849,_0x176eb4){return _0x5a5849[_0x3604('0xa')](_0x3604('0xb'),attributes,{'tableName':_0x3604('0xc'),'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 74220b7..2e99502 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 _0x39e9=['redis','defaults','localhost','socket.io-emitter','./team.socket','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x32674b,_0x50cba5){var _0x38d463=function(_0x298ff4){while(--_0x298ff4){_0x32674b['push'](_0x32674b['shift']());}};_0x38d463(++_0x50cba5);}(_0x39e9,0x1d0));var _0x939e=function(_0x5d4f12,_0x11e67c){_0x5d4f12=_0x5d4f12-0x0;var _0x4eb577=_0x39e9[_0x5d4f12];return _0x4eb577;};'use strict';var _=require(_0x939e('0x0'));var util=require(_0x939e('0x1'));var moment=require(_0x939e('0x2'));var BPromise=require(_0x939e('0x3'));var rs=require(_0x939e('0x4'));var fs=require('fs');var Redis=require(_0x939e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x939e('0x6'));var logger=require(_0x939e('0x7'))(_0x939e('0x8'));var config=require(_0x939e('0x9'));var jayson=require(_0x939e('0xa'));var client=jayson['client'][_0x939e('0xb')]({'port':0x232a});config[_0x939e('0xc')]=_[_0x939e('0xd')](config['redis'],{'host':_0x939e('0xe'),'port':0x18eb});var socket=require(_0x939e('0xf'))(new Redis(config[_0x939e('0xc')]));require(_0x939e('0x10'))['register'](socket);function respondWithRpcPromise(_0x4554eb,_0x54708c,_0x2331c7){return new BPromise(function(_0x49c3fd,_0xe37f32){return client[_0x939e('0x11')](_0x4554eb,_0x2331c7)[_0x939e('0x12')](function(_0x21383d){logger[_0x939e('0x13')](_0x939e('0x14'),_0x54708c,'request\x20sent');logger[_0x939e('0x15')](_0x939e('0x16'),_0x54708c,'request\x20sent',JSON[_0x939e('0x17')](_0x21383d));if(_0x21383d[_0x939e('0x18')]){if(_0x21383d[_0x939e('0x18')][_0x939e('0x19')]===0x1f4){logger[_0x939e('0x18')]('Team,\x20%s,\x20%s',_0x54708c,_0x21383d[_0x939e('0x18')][_0x939e('0x1a')]);return _0xe37f32(_0x21383d[_0x939e('0x18')][_0x939e('0x1a')]);}logger[_0x939e('0x18')](_0x939e('0x14'),_0x54708c,_0x21383d[_0x939e('0x18')][_0x939e('0x1a')]);return _0x49c3fd(_0x21383d[_0x939e('0x18')][_0x939e('0x1a')]);}else{logger[_0x939e('0x13')](_0x939e('0x14'),_0x54708c,_0x939e('0x1b'));_0x49c3fd(_0x21383d['result'][_0x939e('0x1a')]);}})['catch'](function(_0x43d239){logger[_0x939e('0x18')](_0x939e('0x14'),_0x54708c,_0x43d239);_0xe37f32(_0x43d239);});});} \ No newline at end of file +var _0xf297=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x47fc07,_0x2901b0){var _0x595a4b=function(_0x4a2fdb){while(--_0x4a2fdb){_0x47fc07['push'](_0x47fc07['shift']());}};_0x595a4b(++_0x2901b0);}(_0xf297,0x172));var _0x7f29=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xf297[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var util=require(_0x7f29('0x0'));var moment=require(_0x7f29('0x1'));var BPromise=require(_0x7f29('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f29('0x3'));var db=require(_0x7f29('0x4'))['db'];var utils=require(_0x7f29('0x5'));var logger=require(_0x7f29('0x6'))(_0x7f29('0x7'));var config=require(_0x7f29('0x8'));var jayson=require(_0x7f29('0x9'));var client=jayson[_0x7f29('0xa')][_0x7f29('0xb')]({'port':0x232a});config[_0x7f29('0xc')]=_['defaults'](config[_0x7f29('0xc')],{'host':_0x7f29('0xd'),'port':0x18eb});var socket=require(_0x7f29('0xe'))(new Redis(config[_0x7f29('0xc')]));require(_0x7f29('0xf'))[_0x7f29('0x10')](socket);function respondWithRpcPromise(_0x3e106c,_0x378642,_0xcbc7ef){return new BPromise(function(_0x276803,_0x1d4bd2){return client[_0x7f29('0x11')](_0x3e106c,_0xcbc7ef)[_0x7f29('0x12')](function(_0x58d7ea){logger[_0x7f29('0x13')]('Team,\x20%s,\x20%s',_0x378642,_0x7f29('0x14'));logger[_0x7f29('0x15')](_0x7f29('0x16'),_0x378642,_0x7f29('0x14'),JSON[_0x7f29('0x17')](_0x58d7ea));if(_0x58d7ea[_0x7f29('0x18')]){if(_0x58d7ea[_0x7f29('0x18')][_0x7f29('0x19')]===0x1f4){logger[_0x7f29('0x18')](_0x7f29('0x1a'),_0x378642,_0x58d7ea[_0x7f29('0x18')]['message']);return _0x1d4bd2(_0x58d7ea[_0x7f29('0x18')][_0x7f29('0x1b')]);}logger[_0x7f29('0x18')](_0x7f29('0x1a'),_0x378642,_0x58d7ea[_0x7f29('0x18')]['message']);return _0x276803(_0x58d7ea[_0x7f29('0x18')][_0x7f29('0x1b')]);}else{logger['info'](_0x7f29('0x1a'),_0x378642,_0x7f29('0x14'));_0x276803(_0x58d7ea['result'][_0x7f29('0x1b')]);}})[_0x7f29('0x1c')](function(_0xe1bd90){logger[_0x7f29('0x18')](_0x7f29('0x1a'),_0x378642,_0xe1bd90);_0x1d4bd2(_0xe1bd90);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 242e538..cfdb7aa 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 _0xb4d9=['removeListener','register','length','./team.events','save','update','emit'];(function(_0x1ff590,_0x42cdde){var _0x3f9e2d=function(_0x4c67b9){while(--_0x4c67b9){_0x1ff590['push'](_0x1ff590['shift']());}};_0x3f9e2d(++_0x42cdde);}(_0xb4d9,0xce));var _0x9b4d=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xb4d9[_0x164eca];return _0x2ce562;};'use strict';var TeamEvents=require(_0x9b4d('0x0'));var events=[_0x9b4d('0x1'),'remove',_0x9b4d('0x2')];function createListener(_0xccc4bc,_0x62bfd7){return function(_0x549878){_0x62bfd7[_0x9b4d('0x3')](_0xccc4bc,_0x549878);};}function removeListener(_0x27adf9,_0x19b7aa){return function(){TeamEvents[_0x9b4d('0x4')](_0x27adf9,_0x19b7aa);};}exports[_0x9b4d('0x5')]=function(_0x125f8e){for(var _0x16c6dd=0x0,_0x429cc5=events[_0x9b4d('0x6')];_0x16c6dd<_0x429cc5;_0x16c6dd++){var _0x14cb0b=events[_0x16c6dd];var _0x156c68=createListener('team:'+_0x14cb0b,_0x125f8e);TeamEvents['on'](_0x14cb0b,_0x156c68);}}; \ No newline at end of file +var _0x8a9a=['update','emit','removeListener','register','team:','save','remove'];(function(_0x1c7511,_0x98bee3){var _0x275314=function(_0x41e3d5){while(--_0x41e3d5){_0x1c7511['push'](_0x1c7511['shift']());}};_0x275314(++_0x98bee3);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x8a9a[_0x15bc81];return _0x59440e;};'use strict';var TeamEvents=require('./team.events');var events=[_0xa8a9('0x0'),_0xa8a9('0x1'),_0xa8a9('0x2')];function createListener(_0x1b7425,_0x3e6b18){return function(_0x16c7af){_0x3e6b18[_0xa8a9('0x3')](_0x1b7425,_0x16c7af);};}function removeListener(_0x9570dc,_0x3fcb8c){return function(){TeamEvents[_0xa8a9('0x4')](_0x9570dc,_0x3fcb8c);};}exports[_0xa8a9('0x5')]=function(_0x1de1c6){for(var _0x4ac303=0x0,_0x24a2bc=events['length'];_0x4ac303<_0x24a2bc;_0x4ac303++){var _0x1b4873=events[_0x4ac303];var _0x129e9f=createListener(_0xa8a9('0x6')+_0x1b4873,_0x1de1c6);TeamEvents['on'](_0x1b4873,_0x129e9f);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index a32e92a..dd9ac58 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 _0x2a88=['../../config/environment','./template.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x49eb34,_0x1ae5f8){var _0x2220af=function(_0xd5fab6){while(--_0xd5fab6){_0x49eb34['push'](_0x49eb34['shift']());}};_0x2220af(++_0x1ae5f8);}(_0x2a88,0x189));var _0x82a8=function(_0x5ebbc8,_0x4f565b){_0x5ebbc8=_0x5ebbc8-0x0;var _0x407dab=_0x2a88[_0x5ebbc8];return _0x407dab;};'use strict';var multer=require('multer');var util=require(_0x82a8('0x0'));var path=require(_0x82a8('0x1'));var timeout=require(_0x82a8('0x2'));var express=require(_0x82a8('0x3'));var router=express[_0x82a8('0x4')]();var auth=require(_0x82a8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x82a8('0x6'));var controller=require(_0x82a8('0x7'));router[_0x82a8('0x8')]('/',auth['isAuthenticated'](),controller[_0x82a8('0x9')]);router['get'](_0x82a8('0xa'),auth[_0x82a8('0xb')](),controller[_0x82a8('0xc')]);router[_0x82a8('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x82a8('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x82a8('0xf')]);router[_0x82a8('0x10')](_0x82a8('0xa'),auth['isAuthenticated'](),controller[_0x82a8('0x11')]);module[_0x82a8('0x12')]=router; \ No newline at end of file +var _0xcb62=['index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x420746,_0x26dd66){var _0x1c6de2=function(_0x1162d7){while(--_0x1162d7){_0x420746['push'](_0x420746['shift']());}};_0x1c6de2(++_0x26dd66);}(_0xcb62,0x160));var _0x2cb6=function(_0x5889f6,_0x4a4b50){_0x5889f6=_0x5889f6-0x0;var _0x3bbf5d=_0xcb62[_0x5889f6];return _0x3bbf5d;};'use strict';var multer=require(_0x2cb6('0x0'));var util=require(_0x2cb6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2cb6('0x2'));var router=express[_0x2cb6('0x3')]();var auth=require(_0x2cb6('0x4'));var interaction=require(_0x2cb6('0x5'));var config=require('../../config/environment');var controller=require('./template.controller');router[_0x2cb6('0x6')]('/',auth[_0x2cb6('0x7')](),controller[_0x2cb6('0x8')]);router[_0x2cb6('0x6')](_0x2cb6('0x9'),auth[_0x2cb6('0x7')](),controller[_0x2cb6('0xa')]);router[_0x2cb6('0xb')]('/',auth[_0x2cb6('0x7')](),controller[_0x2cb6('0xc')]);router[_0x2cb6('0xd')](_0x2cb6('0x9'),auth[_0x2cb6('0x7')](),controller[_0x2cb6('0xe')]);router[_0x2cb6('0xf')]('/:id',auth[_0x2cb6('0x7')](),controller[_0x2cb6('0x10')]);module[_0x2cb6('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index dca13b2..43d7063 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 _0x29ef=['STRING','sequelize'];(function(_0x4ba672,_0x192cad){var _0x1eadd8=function(_0x2c0947){while(--_0x2c0947){_0x4ba672['push'](_0x4ba672['shift']());}};_0x1eadd8(++_0x192cad);}(_0x29ef,0xaf));var _0xf29e=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x29ef[_0x45b034];return _0x509cb0;};'use strict';var Sequelize=require(_0xf29e('0x0'));module['exports']={'name':{'type':Sequelize[_0xf29e('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x8948=['TEXT','exports','STRING'];(function(_0x6470a2,_0x3b5f44){var _0x24ac61=function(_0x5cc7d7){while(--_0x5cc7d7){_0x6470a2['push'](_0x6470a2['shift']());}};_0x24ac61(++_0x3b5f44);}(_0x8948,0xa6));var _0x8894=function(_0x28d582,_0x3ed2fa){_0x28d582=_0x28d582-0x0;var _0x311ca5=_0x8948[_0x28d582];return _0x311ca5;};'use strict';var Sequelize=require('sequelize');module[_0x8894('0x0')]={'name':{'type':Sequelize[_0x8894('0x1')]},'description':{'type':Sequelize[_0x8894('0x1')]},'html':{'type':Sequelize[_0x8894('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 279dbd5..2d00f1b 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 _0xef1b=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','Templates','UserProfileResource','end','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','Template','includeAll','findAll','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','html-pdf','eml-format','rimraf'];(function(_0x52118d,_0x3e1aae){var _0x2f3ece=function(_0x4a3631){while(--_0x4a3631){_0x52118d['push'](_0x52118d['shift']());}};_0x2f3ece(++_0x3e1aae);}(_0xef1b,0x102));var _0xbef1=function(_0x36eec6,_0x281738){_0x36eec6=_0x36eec6-0x0;var _0x59b716=_0xef1b[_0x36eec6];return _0x59b716;};'use strict';var pdf=require(_0xbef1('0x0'));var emlformat=require(_0xbef1('0x1'));var rimraf=require(_0xbef1('0x2'));var zipdir=require(_0xbef1('0x3'));var jsonpatch=require(_0xbef1('0x4'));var rp=require(_0xbef1('0x5'));var moment=require(_0xbef1('0x6'));var BPromise=require(_0xbef1('0x7'));var Mustache=require(_0xbef1('0x8'));var util=require(_0xbef1('0x9'));var path=require('path');var sox=require(_0xbef1('0xa'));var csv=require('to-csv');var ejs=require(_0xbef1('0xb'));var fs=require('fs');var _=require(_0xbef1('0xc'));var squel=require(_0xbef1('0xd'));var crypto=require(_0xbef1('0xe'));var jsforce=require(_0xbef1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbef1('0x10'));var querystring=require(_0xbef1('0x11'));var Papa=require(_0xbef1('0x12'));var Redis=require(_0xbef1('0x13'));var authService=require(_0xbef1('0x14'));var qs=require(_0xbef1('0x15'));var as=require(_0xbef1('0x16'));var hardwareService=require(_0xbef1('0x17'));var logger=require(_0xbef1('0x18'))('api');var utils=require(_0xbef1('0x19'));var config=require('../../config/environment');var db=require(_0xbef1('0x1a'))['db'];function respondWithStatusCode(_0x30afba,_0x2d5875){_0x2d5875=_0x2d5875||0xcc;return function(_0x59387b){if(_0x59387b){return _0x30afba[_0xbef1('0x1b')](_0x2d5875);}return _0x30afba[_0xbef1('0x1c')](_0x2d5875)['end']();};}function respondWithResult(_0x2f66d7,_0x21e681){_0x21e681=_0x21e681||0xc8;return function(_0x5c90e2){if(_0x5c90e2){return _0x2f66d7['status'](_0x21e681)['json'](_0x5c90e2);}};}function respondWithFilteredResult(_0x4a38e5,_0x258808){return function(_0x5b2e4f){if(_0x5b2e4f){var _0x1b567b=_0x5b2e4f[_0xbef1('0x1d')],_0x268358=_0x258808[_0xbef1('0x1e')],_0x30bf47=_0x258808[_0xbef1('0x1e')]+_0x258808[_0xbef1('0x1f')],_0x3fbbb2;if(_0x30bf47>=_0x1b567b){_0x30bf47=_0x1b567b;_0x3fbbb2=0xc8;}else{_0x3fbbb2=0xce;}_0x4a38e5[_0xbef1('0x1c')](_0x3fbbb2);return _0x4a38e5[_0xbef1('0x20')](_0xbef1('0x21'),_0x268358+'-'+_0x30bf47+'/'+_0x1b567b)[_0xbef1('0x22')](_0x5b2e4f);}return null;};}function patchUpdates(_0x58db25){return function(_0x10700a){try{jsonpatch[_0xbef1('0x23')](_0x10700a,_0x58db25,!![]);}catch(_0x404a65){return BPromise[_0xbef1('0x24')](_0x404a65);}return _0x10700a[_0xbef1('0x25')]();};}function saveUpdates(_0x55e479,_0x3bdc3e){return function(_0x1540aa){if(_0x1540aa){return _0x1540aa['update'](_0x55e479)[_0xbef1('0x26')](function(_0x5d46b6){return _0x5d46b6;});}return null;};}function removeEntity(_0xb5886d,_0x57e8ee){return function(_0x3a52aa){if(_0x3a52aa){return _0x3a52aa[_0xbef1('0x27')]()[_0xbef1('0x26')](function(){var _0x4124f2=_0x3a52aa[_0xbef1('0x28')]({'plain':!![]});var _0x4132ff=_0xbef1('0x29');return db[_0xbef1('0x2a')][_0xbef1('0x27')]({'where':{'type':_0x4132ff,'resourceId':_0x4124f2['id']}})[_0xbef1('0x26')](function(){return _0x3a52aa;});})[_0xbef1('0x26')](function(){_0xb5886d[_0xbef1('0x1c')](0xcc)[_0xbef1('0x2b')]();});}};}function handleEntityNotFound(_0x28d8a8,_0x5843d7){return function(_0x51e15a){if(!_0x51e15a){_0x28d8a8['sendStatus'](0x194);}return _0x51e15a;};}function handleError(_0x43e147,_0x4825be){_0x4825be=_0x4825be||0x1f4;return function(_0x30174b){logger[_0xbef1('0x2c')](_0x30174b[_0xbef1('0x2d')]);if(_0x30174b[_0xbef1('0x2e')]){delete _0x30174b[_0xbef1('0x2e')];}_0x43e147['status'](_0x4825be)[_0xbef1('0x2f')](_0x30174b);};}exports[_0xbef1('0x30')]=function(_0x34ff66,_0x31cca8){var _0x39253b={},_0x323b50={},_0x4c93f4={'count':0x0,'rows':[]};var _0x4e044a=_[_0xbef1('0x31')](db['Template']['rawAttributes'],function(_0xb14820){return{'name':_0xb14820[_0xbef1('0x32')],'type':_0xb14820['type'][_0xbef1('0x33')]};});_0x323b50[_0xbef1('0x34')]=_[_0xbef1('0x31')](_0x4e044a,_0xbef1('0x2e'));_0x323b50[_0xbef1('0x35')]=_[_0xbef1('0x36')](_0x34ff66[_0xbef1('0x35')]);_0x323b50[_0xbef1('0x37')]=_[_0xbef1('0x38')](_0x323b50[_0xbef1('0x34')],_0x323b50[_0xbef1('0x35')]);_0x39253b[_0xbef1('0x39')]=_['intersection'](_0x323b50[_0xbef1('0x34')],qs['fields'](_0x34ff66['query'][_0xbef1('0x3a')]));_0x39253b[_0xbef1('0x39')]=_0x39253b[_0xbef1('0x39')][_0xbef1('0x3b')]?_0x39253b[_0xbef1('0x39')]:_0x323b50[_0xbef1('0x34')];if(!_0x34ff66[_0xbef1('0x35')][_0xbef1('0x3c')](_0xbef1('0x3d'))){_0x39253b[_0xbef1('0x1f')]=qs[_0xbef1('0x1f')](_0x34ff66['query'][_0xbef1('0x1f')]);_0x39253b[_0xbef1('0x1e')]=qs[_0xbef1('0x1e')](_0x34ff66[_0xbef1('0x35')][_0xbef1('0x1e')]);}_0x39253b[_0xbef1('0x3e')]=qs[_0xbef1('0x3f')](_0x34ff66[_0xbef1('0x35')][_0xbef1('0x3f')]);_0x39253b[_0xbef1('0x40')]=qs[_0xbef1('0x37')](_['pick'](_0x34ff66['query'],_0x323b50[_0xbef1('0x37')]));if(_0x34ff66[_0xbef1('0x35')][_0xbef1('0x41')]){_0x39253b[_0xbef1('0x40')]=_[_0xbef1('0x42')](_0x39253b['where'],{'$or':_['map'](_0x4e044a,function(_0x4ec0e7){if(_0x4ec0e7[_0xbef1('0x43')]!==_0xbef1('0x44')){var _0x570530={};_0x570530[_0x4ec0e7['name']]={'$like':'%'+_0x34ff66[_0xbef1('0x35')]['filter']+'%'};return _0x570530;}})});}_0x39253b=_['merge']({},_0x39253b,_0x34ff66[_0xbef1('0x45')]);var _0x40c193={'where':_0x39253b['where']};return db[_0xbef1('0x46')]['count'](_0x40c193)[_0xbef1('0x26')](function(_0x566bb3){_0x4c93f4['count']=_0x566bb3;if(_0x34ff66[_0xbef1('0x35')][_0xbef1('0x47')]){_0x39253b['include']=[{'all':!![]}];}return db['Template'][_0xbef1('0x48')](_0x39253b);})[_0xbef1('0x26')](function(_0x2cc276){_0x4c93f4['rows']=_0x2cc276;return _0x4c93f4;})['then'](respondWithFilteredResult(_0x31cca8,_0x39253b))[_0xbef1('0x49')](handleError(_0x31cca8,null));};exports[_0xbef1('0x4a')]=function(_0x498c81,_0xb17934){var _0x2229c0={'raw':!![],'where':{'id':_0x498c81[_0xbef1('0x4b')]['id']}},_0x50de7b={};_0x50de7b[_0xbef1('0x34')]=_[_0xbef1('0x36')](db[_0xbef1('0x46')]['rawAttributes']);_0x50de7b['query']=_[_0xbef1('0x36')](_0x498c81[_0xbef1('0x35')]);_0x50de7b[_0xbef1('0x37')]=_[_0xbef1('0x38')](_0x50de7b[_0xbef1('0x34')],_0x50de7b['query']);_0x2229c0[_0xbef1('0x39')]=_[_0xbef1('0x38')](_0x50de7b[_0xbef1('0x34')],qs[_0xbef1('0x3a')](_0x498c81[_0xbef1('0x35')][_0xbef1('0x3a')]));_0x2229c0[_0xbef1('0x39')]=_0x2229c0[_0xbef1('0x39')]['length']?_0x2229c0[_0xbef1('0x39')]:_0x50de7b[_0xbef1('0x34')];if(_0x498c81[_0xbef1('0x35')][_0xbef1('0x47')]){_0x2229c0[_0xbef1('0x4c')]=[{'all':!![]}];}_0x2229c0=_[_0xbef1('0x42')]({},_0x2229c0,_0x498c81[_0xbef1('0x45')]);return db[_0xbef1('0x46')][_0xbef1('0x4d')](_0x2229c0)[_0xbef1('0x26')](handleEntityNotFound(_0xb17934,null))[_0xbef1('0x26')](respondWithResult(_0xb17934,null))[_0xbef1('0x49')](handleError(_0xb17934,null));};exports['create']=function(_0x3162b1,_0x5e70dc){return db['Template'][_0xbef1('0x4e')](_0x3162b1[_0xbef1('0x4f')],{})['then'](function(_0x552587){var _0x47cb1b=_0x3162b1['user']['get']({'plain':!![]});if(!_0x47cb1b)throw new Error(_0xbef1('0x50'));if(_0x47cb1b[_0xbef1('0x51')]===_0xbef1('0x52')){var _0x4030dc=_0x552587[_0xbef1('0x28')]({'plain':!![]});var _0x59f0d1=_0xbef1('0x29');return db[_0xbef1('0x53')]['find']({'where':{'name':_0x59f0d1,'userProfileId':_0x47cb1b[_0xbef1('0x54')]},'raw':!![]})[_0xbef1('0x26')](function(_0x4a7527){if(_0x4a7527&&_0x4a7527[_0xbef1('0x55')]===0x0){return db[_0xbef1('0x2a')][_0xbef1('0x4e')]({'name':_0x4030dc['name'],'resourceId':_0x4030dc['id'],'type':_0x4a7527[_0xbef1('0x2e')],'sectionId':_0x4a7527['id']},{})[_0xbef1('0x26')](function(){return _0x552587;});}else{return _0x552587;}})['catch'](function(_0x206b8f){logger[_0xbef1('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x206b8f);throw _0x206b8f;});}return _0x552587;})[_0xbef1('0x26')](respondWithResult(_0x5e70dc,0xc9))[_0xbef1('0x49')](handleError(_0x5e70dc,null));};exports[_0xbef1('0x56')]=function(_0x37584a,_0x5bced1){if(_0x37584a['body']['id']){delete _0x37584a[_0xbef1('0x4f')]['id'];}return db[_0xbef1('0x46')][_0xbef1('0x4d')]({'where':{'id':_0x37584a[_0xbef1('0x4b')]['id']}})[_0xbef1('0x26')](handleEntityNotFound(_0x5bced1,null))[_0xbef1('0x26')](saveUpdates(_0x37584a[_0xbef1('0x4f')],null))[_0xbef1('0x26')](respondWithResult(_0x5bced1,null))[_0xbef1('0x49')](handleError(_0x5bced1,null));};exports[_0xbef1('0x27')]=function(_0x5340e7,_0x11dea5){return db[_0xbef1('0x46')][_0xbef1('0x4d')]({'where':{'id':_0x5340e7[_0xbef1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x11dea5,null))['then'](removeEntity(_0x11dea5,null))['catch'](handleError(_0x11dea5,null));}; \ No newline at end of file +var _0xdbd7=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','apply','save','update','destroy','then','get','Templates','error','stack','name','send','index','map','Template','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','pick','where','merge','VIRTUAL','filter','options','count','include','findAll','rows','catch','params','create','user','role','UserProfileSection','find','autoAssociation','body'];(function(_0x1db6ed,_0x2bc4d7){var _0x5b76cf=function(_0x18dbfe){while(--_0x18dbfe){_0x1db6ed['push'](_0x1db6ed['shift']());}};_0x5b76cf(++_0x2bc4d7);}(_0xdbd7,0xe4));var _0x7dbd=function(_0xb4f3f4,_0x3ceab6){_0xb4f3f4=_0xb4f3f4-0x0;var _0xa951a9=_0xdbd7[_0xb4f3f4];return _0xa951a9;};'use strict';var pdf=require(_0x7dbd('0x0'));var emlformat=require(_0x7dbd('0x1'));var rimraf=require(_0x7dbd('0x2'));var zipdir=require(_0x7dbd('0x3'));var jsonpatch=require(_0x7dbd('0x4'));var rp=require(_0x7dbd('0x5'));var moment=require('moment');var BPromise=require(_0x7dbd('0x6'));var Mustache=require(_0x7dbd('0x7'));var util=require(_0x7dbd('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7dbd('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7dbd('0xa'));var crypto=require(_0x7dbd('0xb'));var jsforce=require(_0x7dbd('0xc'));var deskjs=require(_0x7dbd('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7dbd('0xe'));var Redis=require(_0x7dbd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7dbd('0x10'));var as=require(_0x7dbd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7dbd('0x12'))(_0x7dbd('0x13'));var utils=require(_0x7dbd('0x14'));var config=require(_0x7dbd('0x15'));var db=require(_0x7dbd('0x16'))['db'];function respondWithStatusCode(_0x3e9460,_0x5a28f3){_0x5a28f3=_0x5a28f3||0xcc;return function(_0x5dbb86){if(_0x5dbb86){return _0x3e9460[_0x7dbd('0x17')](_0x5a28f3);}return _0x3e9460['status'](_0x5a28f3)[_0x7dbd('0x18')]();};}function respondWithResult(_0x5b6356,_0x533a35){_0x533a35=_0x533a35||0xc8;return function(_0x478ba7){if(_0x478ba7){return _0x5b6356[_0x7dbd('0x19')](_0x533a35)[_0x7dbd('0x1a')](_0x478ba7);}};}function respondWithFilteredResult(_0x684969,_0x9a9f8){return function(_0x499628){if(_0x499628){var _0x55238a=_0x499628['count'],_0x2de3f4=_0x9a9f8[_0x7dbd('0x1b')],_0x54e887=_0x9a9f8['offset']+_0x9a9f8['limit'],_0x35566b;if(_0x54e887>=_0x55238a){_0x54e887=_0x55238a;_0x35566b=0xc8;}else{_0x35566b=0xce;}_0x684969[_0x7dbd('0x19')](_0x35566b);return _0x684969[_0x7dbd('0x1c')]('Content-Range',_0x2de3f4+'-'+_0x54e887+'/'+_0x55238a)[_0x7dbd('0x1a')](_0x499628);}return null;};}function patchUpdates(_0x58755f){return function(_0x2c795a){try{jsonpatch[_0x7dbd('0x1d')](_0x2c795a,_0x58755f,!![]);}catch(_0x2b5482){return BPromise['reject'](_0x2b5482);}return _0x2c795a[_0x7dbd('0x1e')]();};}function saveUpdates(_0x17f645,_0x44f12f){return function(_0x3a0c7a){if(_0x3a0c7a){return _0x3a0c7a[_0x7dbd('0x1f')](_0x17f645)['then'](function(_0x124608){return _0x124608;});}return null;};}function removeEntity(_0x4e9205,_0x5114d7){return function(_0xf76e42){if(_0xf76e42){return _0xf76e42[_0x7dbd('0x20')]()[_0x7dbd('0x21')](function(){var _0x104161=_0xf76e42[_0x7dbd('0x22')]({'plain':!![]});var _0x43721b=_0x7dbd('0x23');return db['UserProfileResource'][_0x7dbd('0x20')]({'where':{'type':_0x43721b,'resourceId':_0x104161['id']}})[_0x7dbd('0x21')](function(){return _0xf76e42;});})[_0x7dbd('0x21')](function(){_0x4e9205[_0x7dbd('0x19')](0xcc)[_0x7dbd('0x18')]();});}};}function handleEntityNotFound(_0x4bc62b,_0x59a062){return function(_0x39a90f){if(!_0x39a90f){_0x4bc62b[_0x7dbd('0x17')](0x194);}return _0x39a90f;};}function handleError(_0x293469,_0x44d9f8){_0x44d9f8=_0x44d9f8||0x1f4;return function(_0x14e854){logger[_0x7dbd('0x24')](_0x14e854[_0x7dbd('0x25')]);if(_0x14e854[_0x7dbd('0x26')]){delete _0x14e854['name'];}_0x293469[_0x7dbd('0x19')](_0x44d9f8)[_0x7dbd('0x27')](_0x14e854);};}exports[_0x7dbd('0x28')]=function(_0x2d1baf,_0x4d9e4f){var _0x40af5d={},_0x5e5804={},_0x7712f6={'count':0x0,'rows':[]};var _0x2a10df=_[_0x7dbd('0x29')](db[_0x7dbd('0x2a')][_0x7dbd('0x2b')],function(_0x27752e){return{'name':_0x27752e['fieldName'],'type':_0x27752e[_0x7dbd('0x2c')][_0x7dbd('0x2d')]};});_0x5e5804[_0x7dbd('0x2e')]=_[_0x7dbd('0x29')](_0x2a10df,'name');_0x5e5804['query']=_[_0x7dbd('0x2f')](_0x2d1baf[_0x7dbd('0x30')]);_0x5e5804[_0x7dbd('0x31')]=_[_0x7dbd('0x32')](_0x5e5804[_0x7dbd('0x2e')],_0x5e5804['query']);_0x40af5d[_0x7dbd('0x33')]=_['intersection'](_0x5e5804['model'],qs[_0x7dbd('0x34')](_0x2d1baf[_0x7dbd('0x30')]['fields']));_0x40af5d[_0x7dbd('0x33')]=_0x40af5d[_0x7dbd('0x33')][_0x7dbd('0x35')]?_0x40af5d[_0x7dbd('0x33')]:_0x5e5804[_0x7dbd('0x2e')];if(!_0x2d1baf[_0x7dbd('0x30')][_0x7dbd('0x36')](_0x7dbd('0x37'))){_0x40af5d[_0x7dbd('0x38')]=qs[_0x7dbd('0x38')](_0x2d1baf[_0x7dbd('0x30')][_0x7dbd('0x38')]);_0x40af5d[_0x7dbd('0x1b')]=qs[_0x7dbd('0x1b')](_0x2d1baf[_0x7dbd('0x30')][_0x7dbd('0x1b')]);}_0x40af5d['order']=qs['sort'](_0x2d1baf[_0x7dbd('0x30')]['sort']);_0x40af5d['where']=qs[_0x7dbd('0x31')](_[_0x7dbd('0x39')](_0x2d1baf[_0x7dbd('0x30')],_0x5e5804[_0x7dbd('0x31')]));if(_0x2d1baf[_0x7dbd('0x30')]['filter']){_0x40af5d[_0x7dbd('0x3a')]=_[_0x7dbd('0x3b')](_0x40af5d[_0x7dbd('0x3a')],{'$or':_[_0x7dbd('0x29')](_0x2a10df,function(_0x23c2cc){if(_0x23c2cc['type']!==_0x7dbd('0x3c')){var _0x179200={};_0x179200[_0x23c2cc['name']]={'$like':'%'+_0x2d1baf['query'][_0x7dbd('0x3d')]+'%'};return _0x179200;}})});}_0x40af5d=_[_0x7dbd('0x3b')]({},_0x40af5d,_0x2d1baf[_0x7dbd('0x3e')]);var _0x359b04={'where':_0x40af5d[_0x7dbd('0x3a')]};return db[_0x7dbd('0x2a')][_0x7dbd('0x3f')](_0x359b04)[_0x7dbd('0x21')](function(_0x1cf31c){_0x7712f6[_0x7dbd('0x3f')]=_0x1cf31c;if(_0x2d1baf['query']['includeAll']){_0x40af5d[_0x7dbd('0x40')]=[{'all':!![]}];}return db[_0x7dbd('0x2a')][_0x7dbd('0x41')](_0x40af5d);})[_0x7dbd('0x21')](function(_0x387fbb){_0x7712f6[_0x7dbd('0x42')]=_0x387fbb;return _0x7712f6;})[_0x7dbd('0x21')](respondWithFilteredResult(_0x4d9e4f,_0x40af5d))[_0x7dbd('0x43')](handleError(_0x4d9e4f,null));};exports['show']=function(_0x47fe4a,_0x544372){var _0x210342={'raw':!![],'where':{'id':_0x47fe4a[_0x7dbd('0x44')]['id']}},_0x2f67b9={};_0x2f67b9[_0x7dbd('0x2e')]=_[_0x7dbd('0x2f')](db[_0x7dbd('0x2a')][_0x7dbd('0x2b')]);_0x2f67b9[_0x7dbd('0x30')]=_['keys'](_0x47fe4a['query']);_0x2f67b9['filters']=_[_0x7dbd('0x32')](_0x2f67b9[_0x7dbd('0x2e')],_0x2f67b9[_0x7dbd('0x30')]);_0x210342[_0x7dbd('0x33')]=_[_0x7dbd('0x32')](_0x2f67b9['model'],qs[_0x7dbd('0x34')](_0x47fe4a['query'][_0x7dbd('0x34')]));_0x210342['attributes']=_0x210342['attributes'][_0x7dbd('0x35')]?_0x210342[_0x7dbd('0x33')]:_0x2f67b9[_0x7dbd('0x2e')];if(_0x47fe4a['query']['includeAll']){_0x210342[_0x7dbd('0x40')]=[{'all':!![]}];}_0x210342=_[_0x7dbd('0x3b')]({},_0x210342,_0x47fe4a[_0x7dbd('0x3e')]);return db[_0x7dbd('0x2a')]['find'](_0x210342)[_0x7dbd('0x21')](handleEntityNotFound(_0x544372,null))[_0x7dbd('0x21')](respondWithResult(_0x544372,null))[_0x7dbd('0x43')](handleError(_0x544372,null));};exports[_0x7dbd('0x45')]=function(_0x8f0921,_0x32ae6e){return db[_0x7dbd('0x2a')]['create'](_0x8f0921['body'],{})['then'](function(_0x7c51ee){var _0x2c63d9=_0x8f0921[_0x7dbd('0x46')][_0x7dbd('0x22')]({'plain':!![]});if(!_0x2c63d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c63d9[_0x7dbd('0x47')]===_0x7dbd('0x46')){var _0x37751f=_0x7c51ee[_0x7dbd('0x22')]({'plain':!![]});var _0x243279=_0x7dbd('0x23');return db[_0x7dbd('0x48')][_0x7dbd('0x49')]({'where':{'name':_0x243279,'userProfileId':_0x2c63d9['userProfileId']},'raw':!![]})[_0x7dbd('0x21')](function(_0x5bcd8c){if(_0x5bcd8c&&_0x5bcd8c[_0x7dbd('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x37751f[_0x7dbd('0x26')],'resourceId':_0x37751f['id'],'type':_0x5bcd8c['name'],'sectionId':_0x5bcd8c['id']},{})[_0x7dbd('0x21')](function(){return _0x7c51ee;});}else{return _0x7c51ee;}})[_0x7dbd('0x43')](function(_0x3d3d56){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d3d56);throw _0x3d3d56;});}return _0x7c51ee;})[_0x7dbd('0x21')](respondWithResult(_0x32ae6e,0xc9))['catch'](handleError(_0x32ae6e,null));};exports[_0x7dbd('0x1f')]=function(_0x100a3d,_0x1874f5){if(_0x100a3d[_0x7dbd('0x4b')]['id']){delete _0x100a3d[_0x7dbd('0x4b')]['id'];}return db[_0x7dbd('0x2a')][_0x7dbd('0x49')]({'where':{'id':_0x100a3d[_0x7dbd('0x44')]['id']}})[_0x7dbd('0x21')](handleEntityNotFound(_0x1874f5,null))[_0x7dbd('0x21')](saveUpdates(_0x100a3d['body'],null))['then'](respondWithResult(_0x1874f5,null))[_0x7dbd('0x43')](handleError(_0x1874f5,null));};exports[_0x7dbd('0x20')]=function(_0x5a7fa6,_0x4cbbc3){return db[_0x7dbd('0x2a')][_0x7dbd('0x49')]({'where':{'id':_0x5a7fa6[_0x7dbd('0x44')]['id']}})[_0x7dbd('0x21')](handleEntityNotFound(_0x4cbbc3,null))['then'](removeEntity(_0x4cbbc3,null))[_0x7dbd('0x43')](handleError(_0x4cbbc3,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 09c523b..ad25d60 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 _0xafe2=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Template','tools_templates','util','../../config/logger'];(function(_0x26bbf5,_0x102992){var _0x107f4=function(_0x523ef6){while(--_0x523ef6){_0x26bbf5['push'](_0x26bbf5['shift']());}};_0x107f4(++_0x102992);}(_0xafe2,0x195));var _0x2afe=function(_0x3c20ba,_0x313f90){_0x3c20ba=_0x3c20ba-0x0;var _0x523e50=_0xafe2[_0x3c20ba];return _0x523e50;};'use strict';var _=require('lodash');var util=require(_0x2afe('0x0'));var logger=require(_0x2afe('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2afe('0x2'));var rp=require(_0x2afe('0x3'));var fs=require('fs');var path=require(_0x2afe('0x4'));var rimraf=require(_0x2afe('0x5'));var config=require(_0x2afe('0x6'));var attributes=require('./template.attributes');module[_0x2afe('0x7')]=function(_0x438f03,_0x46d364){return _0x438f03[_0x2afe('0x8')](_0x2afe('0x9'),attributes,{'tableName':_0x2afe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f72=['./template.attributes','exports','define','Template','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x57d895,_0x22c3ee){var _0x118f20=function(_0x26281b){while(--_0x26281b){_0x57d895['push'](_0x57d895['shift']());}};_0x118f20(++_0x22c3ee);}(_0x5f72,0xe1));var _0x25f7=function(_0x336376,_0xe4b28d){_0x336376=_0x336376-0x0;var _0x1d2a8e=_0x5f72[_0x336376];return _0x1d2a8e;};'use strict';var _=require(_0x25f7('0x0'));var util=require(_0x25f7('0x1'));var logger=require(_0x25f7('0x2'))(_0x25f7('0x3'));var moment=require(_0x25f7('0x4'));var BPromise=require('bluebird');var rp=require(_0x25f7('0x5'));var fs=require('fs');var path=require(_0x25f7('0x6'));var rimraf=require(_0x25f7('0x7'));var config=require(_0x25f7('0x8'));var attributes=require(_0x25f7('0x9'));module[_0x25f7('0xa')]=function(_0x2b2d3c,_0x1ceb7e){return _0x2b2d3c[_0x25f7('0xb')](_0x25f7('0xc'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 8d90c57..bf1021e 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 _0x40c2=['debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','Template,\x20%s,\x20%s','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','model','map','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent'];(function(_0x26dd63,_0x2303fc){var _0x2d343b=function(_0x26d375){while(--_0x26d375){_0x26dd63['push'](_0x26dd63['shift']());}};_0x2d343b(++_0x2303fc);}(_0x40c2,0x1db));var _0x240c=function(_0x538eab,_0x196107){_0x538eab=_0x538eab-0x0;var _0x3ec7b9=_0x40c2[_0x538eab];return _0x3ec7b9;};'use strict';var _=require(_0x240c('0x0'));var util=require(_0x240c('0x1'));var moment=require('moment');var BPromise=require(_0x240c('0x2'));var rs=require(_0x240c('0x3'));var fs=require('fs');var Redis=require(_0x240c('0x4'));var db=require(_0x240c('0x5'))['db'];var utils=require(_0x240c('0x6'));var logger=require(_0x240c('0x7'))(_0x240c('0x8'));var config=require(_0x240c('0x9'));var jayson=require(_0x240c('0xa'));var client=jayson[_0x240c('0xb')][_0x240c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3dde16,_0x8a169e,_0x5d660d){return new BPromise(function(_0x154536,_0x4d28f9){return client['request'](_0x3dde16,_0x5d660d)['then'](function(_0x50a520){logger[_0x240c('0xd')]('Template,\x20%s,\x20%s',_0x8a169e,_0x240c('0xe'));logger[_0x240c('0xf')](_0x240c('0x10'),_0x8a169e,_0x240c('0xe'),JSON['stringify'](_0x50a520));if(_0x50a520[_0x240c('0x11')]){if(_0x50a520[_0x240c('0x11')][_0x240c('0x12')]===0x1f4){logger[_0x240c('0x11')]('Template,\x20%s,\x20%s',_0x8a169e,_0x50a520[_0x240c('0x11')][_0x240c('0x13')]);return _0x4d28f9(_0x50a520[_0x240c('0x11')][_0x240c('0x13')]);}logger['error']('Template,\x20%s,\x20%s',_0x8a169e,_0x50a520['error'][_0x240c('0x13')]);return _0x154536(_0x50a520['error'][_0x240c('0x13')]);}else{logger[_0x240c('0xd')](_0x240c('0x14'),_0x8a169e,_0x240c('0xe'));_0x154536(_0x50a520[_0x240c('0x15')][_0x240c('0x13')]);}})[_0x240c('0x16')](function(_0x2fb371){logger[_0x240c('0x11')](_0x240c('0x14'),_0x8a169e,_0x2fb371);_0x4d28f9(_0x2fb371);});});}exports[_0x240c('0x17')]=function(_0x428be5){var _0x5d1a60=this;return new Promise(function(_0x45725a,_0x5e00ec){return db[_0x240c('0x18')][_0x240c('0x19')]({'raw':_0x428be5[_0x240c('0x1a')]?_0x428be5[_0x240c('0x1a')][_0x240c('0x1b')]===undefined?!![]:![]:!![],'where':_0x428be5['options']?_0x428be5[_0x240c('0x1a')][_0x240c('0x1c')]||null:null,'attributes':_0x428be5[_0x240c('0x1a')]?_0x428be5[_0x240c('0x1a')][_0x240c('0x1d')]||null:null,'limit':_0x428be5[_0x240c('0x1a')]?_0x428be5['options'][_0x240c('0x1e')]||null:null,'include':_0x428be5['options']?_0x428be5[_0x240c('0x1a')]['include']?_['map'](_0x428be5['options'][_0x240c('0x1f')],function(_0x192bc6){return{'model':db[_0x192bc6[_0x240c('0x20')]],'as':_0x192bc6['as'],'attributes':_0x192bc6[_0x240c('0x1d')],'include':_0x192bc6[_0x240c('0x1f')]?_[_0x240c('0x21')](_0x192bc6[_0x240c('0x1f')],function(_0x59333e){return{'model':db[_0x59333e[_0x240c('0x20')]],'as':_0x59333e['as'],'attributes':_0x59333e[_0x240c('0x1d')],'include':_0x59333e['include']?_[_0x240c('0x21')](_0x59333e[_0x240c('0x1f')],function(_0x30f3e3){return{'model':db[_0x30f3e3[_0x240c('0x20')]],'as':_0x30f3e3['as'],'attributes':_0x30f3e3[_0x240c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a1809){logger['info'](_0x240c('0x17'),_0x428be5);logger[_0x240c('0xf')](_0x240c('0x17'),_0x428be5,JSON[_0x240c('0x22')](_0x5a1809));_0x45725a(_0x5a1809);})[_0x240c('0x16')](function(_0x1fa85d){logger['error'](_0x240c('0x17'),_0x1fa85d[_0x240c('0x13')],_0x428be5);_0x5e00ec(_0x5d1a60[_0x240c('0x11')](0x1f4,_0x1fa85d[_0x240c('0x13')]));});});}; \ No newline at end of file +var _0x0f92=['stringify','error','code','Template,\x20%s,\x20%s','message','result','catch','findAll','options','where','attributes','limit','include','model','map','GetTemplate','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','Template,\x20%s,\x20%s,\x20%s'];(function(_0x40ef08,_0x6d88f1){var _0x451bb6=function(_0x596c26){while(--_0x596c26){_0x40ef08['push'](_0x40ef08['shift']());}};_0x451bb6(++_0x6d88f1);}(_0x0f92,0x1c3));var _0x20f9=function(_0x5f27fb,_0x250dc4){_0x5f27fb=_0x5f27fb-0x0;var _0x26cf50=_0x0f92[_0x5f27fb];return _0x26cf50;};'use strict';var _=require('lodash');var util=require(_0x20f9('0x0'));var moment=require(_0x20f9('0x1'));var BPromise=require(_0x20f9('0x2'));var rs=require(_0x20f9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x20f9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x20f9('0x5'))(_0x20f9('0x6'));var config=require(_0x20f9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x20f9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26229d,_0x96d6a3,_0x18fad9){return new BPromise(function(_0x3eee1e,_0x22ef54){return client[_0x20f9('0x9')](_0x26229d,_0x18fad9)[_0x20f9('0xa')](function(_0x1ed2f9){logger[_0x20f9('0xb')]('Template,\x20%s,\x20%s',_0x96d6a3,_0x20f9('0xc'));logger['debug'](_0x20f9('0xd'),_0x96d6a3,_0x20f9('0xc'),JSON[_0x20f9('0xe')](_0x1ed2f9));if(_0x1ed2f9[_0x20f9('0xf')]){if(_0x1ed2f9[_0x20f9('0xf')][_0x20f9('0x10')]===0x1f4){logger[_0x20f9('0xf')](_0x20f9('0x11'),_0x96d6a3,_0x1ed2f9['error'][_0x20f9('0x12')]);return _0x22ef54(_0x1ed2f9[_0x20f9('0xf')][_0x20f9('0x12')]);}logger[_0x20f9('0xf')]('Template,\x20%s,\x20%s',_0x96d6a3,_0x1ed2f9[_0x20f9('0xf')][_0x20f9('0x12')]);return _0x3eee1e(_0x1ed2f9['error']['message']);}else{logger['info'](_0x20f9('0x11'),_0x96d6a3,_0x20f9('0xc'));_0x3eee1e(_0x1ed2f9[_0x20f9('0x13')][_0x20f9('0x12')]);}})[_0x20f9('0x14')](function(_0x56ffbd){logger[_0x20f9('0xf')](_0x20f9('0x11'),_0x96d6a3,_0x56ffbd);_0x22ef54(_0x56ffbd);});});}exports['GetTemplate']=function(_0x45e320){var _0xadee79=this;return new Promise(function(_0x282771,_0x2520c4){return db['Template'][_0x20f9('0x15')]({'raw':_0x45e320[_0x20f9('0x16')]?_0x45e320[_0x20f9('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x45e320['options']?_0x45e320[_0x20f9('0x16')][_0x20f9('0x17')]||null:null,'attributes':_0x45e320[_0x20f9('0x16')]?_0x45e320[_0x20f9('0x16')][_0x20f9('0x18')]||null:null,'limit':_0x45e320['options']?_0x45e320[_0x20f9('0x16')][_0x20f9('0x19')]||null:null,'include':_0x45e320['options']?_0x45e320[_0x20f9('0x16')][_0x20f9('0x1a')]?_['map'](_0x45e320['options'][_0x20f9('0x1a')],function(_0x276c80){return{'model':db[_0x276c80[_0x20f9('0x1b')]],'as':_0x276c80['as'],'attributes':_0x276c80[_0x20f9('0x18')],'include':_0x276c80[_0x20f9('0x1a')]?_['map'](_0x276c80['include'],function(_0x40090c){return{'model':db[_0x40090c[_0x20f9('0x1b')]],'as':_0x40090c['as'],'attributes':_0x40090c['attributes'],'include':_0x40090c[_0x20f9('0x1a')]?_[_0x20f9('0x1c')](_0x40090c[_0x20f9('0x1a')],function(_0x91171){return{'model':db[_0x91171[_0x20f9('0x1b')]],'as':_0x91171['as'],'attributes':_0x91171['attributes']};}):[]};}):[]};}):[]:[]})[_0x20f9('0xa')](function(_0x3b3f1f){logger[_0x20f9('0xb')](_0x20f9('0x1d'),_0x45e320);logger[_0x20f9('0x1e')]('GetTemplate',_0x45e320,JSON['stringify'](_0x3b3f1f));_0x282771(_0x3b3f1f);})[_0x20f9('0x14')](function(_0x53782e){logger[_0x20f9('0xf')](_0x20f9('0x1d'),_0x53782e[_0x20f9('0x12')],_0x45e320);_0x2520c4(_0xadee79['error'](0x1f4,_0x53782e[_0x20f9('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 9a49e76..a2a5cb2 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 _0xeace=['getAllConditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','update','/:id','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','show','/:id/all_conditions'];(function(_0xd2eaba,_0x3f3231){var _0x337605=function(_0x507112){while(--_0x507112){_0xd2eaba['push'](_0xd2eaba['shift']());}};_0x337605(++_0x3f3231);}(_0xeace,0x112));var _0xeeac=function(_0x3654fa,_0x1844f8){_0x3654fa=_0x3654fa-0x0;var _0x75e013=_0xeace[_0x3654fa];return _0x75e013;};'use strict';var multer=require('multer');var util=require(_0xeeac('0x0'));var path=require(_0xeeac('0x1'));var timeout=require(_0xeeac('0x2'));var express=require('express');var router=express[_0xeeac('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xeeac('0x4'));var config=require(_0xeeac('0x5'));var controller=require(_0xeeac('0x6'));router[_0xeeac('0x7')]('/',auth[_0xeeac('0x8')](),controller[_0xeeac('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xeeac('0xa')]);router['get'](_0xeeac('0xb'),auth['isAuthenticated'](),controller[_0xeeac('0xc')]);router[_0xeeac('0x7')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0xeeac('0xd')]);router[_0xeeac('0x7')](_0xeeac('0xe'),auth[_0xeeac('0x8')](),controller[_0xeeac('0xf')]);router[_0xeeac('0x10')]('/',auth[_0xeeac('0x8')](),controller['create']);router[_0xeeac('0x10')](_0xeeac('0xb'),auth[_0xeeac('0x8')](),controller[_0xeeac('0x11')]);router[_0xeeac('0x10')](_0xeeac('0x12'),auth[_0xeeac('0x8')](),controller[_0xeeac('0x13')]);router[_0xeeac('0x10')](_0xeeac('0xe'),auth['isAuthenticated'](),controller[_0xeeac('0x14')]);router[_0xeeac('0x15')]('/:id',auth[_0xeeac('0x8')](),controller[_0xeeac('0x16')]);router['delete'](_0xeeac('0x17'),auth[_0xeeac('0x8')](),controller[_0xeeac('0x18')]);module[_0xeeac('0x19')]=router; \ No newline at end of file +var _0xa05e=['update','delete','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAllCondition','addAnyCondition','addAction','put','/:id'];(function(_0x23ce0a,_0x15de07){var _0x4dacfb=function(_0x4abc31){while(--_0x4abc31){_0x23ce0a['push'](_0x23ce0a['shift']());}};_0x4dacfb(++_0x15de07);}(_0xa05e,0x154));var _0xea05=function(_0x2a2bbb,_0x46ed17){_0x2a2bbb=_0x2a2bbb-0x0;var _0x5ae9eb=_0xa05e[_0x2a2bbb];return _0x5ae9eb;};'use strict';var multer=require(_0xea05('0x0'));var util=require(_0xea05('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xea05('0x2'));var router=express[_0xea05('0x3')]();var auth=require(_0xea05('0x4'));var interaction=require(_0xea05('0x5'));var config=require(_0xea05('0x6'));var controller=require('./trigger.controller');router[_0xea05('0x7')]('/',auth[_0xea05('0x8')](),controller[_0xea05('0x9')]);router[_0xea05('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xea05('0xa')]);router[_0xea05('0x7')](_0xea05('0xb'),auth['isAuthenticated'](),controller[_0xea05('0xc')]);router[_0xea05('0x7')](_0xea05('0xd'),auth['isAuthenticated'](),controller[_0xea05('0xe')]);router[_0xea05('0x7')](_0xea05('0xf'),auth[_0xea05('0x8')](),controller[_0xea05('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xea05('0x11')]);router[_0xea05('0x12')](_0xea05('0xb'),auth[_0xea05('0x8')](),controller[_0xea05('0x13')]);router[_0xea05('0x12')](_0xea05('0xd'),auth['isAuthenticated'](),controller[_0xea05('0x14')]);router[_0xea05('0x12')](_0xea05('0xf'),auth[_0xea05('0x8')](),controller[_0xea05('0x15')]);router[_0xea05('0x16')](_0xea05('0x17'),auth[_0xea05('0x8')](),controller[_0xea05('0x18')]);router[_0xea05('0x19')]('/:id',auth[_0xea05('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index b27662a..bad3c2b 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 _0x1b77=['sequelize','STRING'];(function(_0x3021ec,_0x1668c1){var _0x12f210=function(_0x4152ff){while(--_0x4152ff){_0x3021ec['push'](_0x3021ec['shift']());}};_0x12f210(++_0x1668c1);}(_0x1b77,0xc0));var _0x71b7=function(_0x305409,_0x311e51){_0x305409=_0x305409-0x0;var _0x562fc7=_0x1b77[_0x305409];return _0x562fc7;};'use strict';var Sequelize=require(_0x71b7('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x71b7('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xae7e=['exports','STRING','BOOLEAN','sequelize'];(function(_0x297715,_0x1ece2b){var _0x26a1e6=function(_0x1f0fb5){while(--_0x1f0fb5){_0x297715['push'](_0x297715['shift']());}};_0x26a1e6(++_0x1ece2b);}(_0xae7e,0x8f));var _0xeae7=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xae7e[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xeae7('0x0'));module[_0xeae7('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xeae7('0x2')]},'description':{'type':Sequelize[_0xeae7('0x2')]},'status':{'type':Sequelize[_0xeae7('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 64ea468..ecb511c 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 _0x2e41=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','offset','set','Content-Range','save','update','then','get','Triggers','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','Trigger','rows','params','attributes','find','catch','create','body','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x26bceb,_0x179677){var _0x41abc2=function(_0x4a6de0){while(--_0x4a6de0){_0x26bceb['push'](_0x26bceb['shift']());}};_0x41abc2(++_0x179677);}(_0x2e41,0x15e));var _0x12e4=function(_0x2067c1,_0x4ad413){_0x2067c1=_0x2067c1-0x0;var _0x4c2968=_0x2e41[_0x2067c1];return _0x4c2968;};'use strict';var pdf=require(_0x12e4('0x0'));var emlformat=require(_0x12e4('0x1'));var rimraf=require(_0x12e4('0x2'));var zipdir=require(_0x12e4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x12e4('0x4'));var moment=require(_0x12e4('0x5'));var BPromise=require(_0x12e4('0x6'));var Mustache=require(_0x12e4('0x7'));var util=require(_0x12e4('0x8'));var path=require(_0x12e4('0x9'));var sox=require(_0x12e4('0xa'));var csv=require(_0x12e4('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x12e4('0xc'));var squel=require(_0x12e4('0xd'));var crypto=require(_0x12e4('0xe'));var jsforce=require(_0x12e4('0xf'));var deskjs=require(_0x12e4('0x10'));var toCsv=require(_0x12e4('0xb'));var querystring=require(_0x12e4('0x11'));var Papa=require(_0x12e4('0x12'));var Redis=require('ioredis');var authService=require(_0x12e4('0x13'));var qs=require(_0x12e4('0x14'));var as=require(_0x12e4('0x15'));var hardwareService=require(_0x12e4('0x16'));var logger=require(_0x12e4('0x17'))(_0x12e4('0x18'));var utils=require(_0x12e4('0x19'));var config=require(_0x12e4('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29e914,_0x28eb7e){_0x28eb7e=_0x28eb7e||0xcc;return function(_0x51b94e){if(_0x51b94e){return _0x29e914['sendStatus'](_0x28eb7e);}return _0x29e914['status'](_0x28eb7e)['end']();};}function respondWithResult(_0x4d04c5,_0x1b88cc){_0x1b88cc=_0x1b88cc||0xc8;return function(_0x34a6ef){if(_0x34a6ef){return _0x4d04c5[_0x12e4('0x1b')](_0x1b88cc)[_0x12e4('0x1c')](_0x34a6ef);}};}function respondWithFilteredResult(_0x132f6c,_0x3202ee){return function(_0x1ac9db){if(_0x1ac9db){var _0x4a0be4=_0x1ac9db[_0x12e4('0x1d')],_0x5cbdb7=_0x3202ee[_0x12e4('0x1e')],_0x3b5da3=_0x3202ee['offset']+_0x3202ee['limit'],_0x46f0ef;if(_0x3b5da3>=_0x4a0be4){_0x3b5da3=_0x4a0be4;_0x46f0ef=0xc8;}else{_0x46f0ef=0xce;}_0x132f6c[_0x12e4('0x1b')](_0x46f0ef);return _0x132f6c[_0x12e4('0x1f')](_0x12e4('0x20'),_0x5cbdb7+'-'+_0x3b5da3+'/'+_0x4a0be4)['json'](_0x1ac9db);}return null;};}function patchUpdates(_0x1af77f){return function(_0x2e3ce1){try{jsonpatch['apply'](_0x2e3ce1,_0x1af77f,!![]);}catch(_0x1fdf5e){return BPromise['reject'](_0x1fdf5e);}return _0x2e3ce1[_0x12e4('0x21')]();};}function saveUpdates(_0x18f5ec,_0xb513d7){return function(_0x9b7237){if(_0x9b7237){return _0x9b7237[_0x12e4('0x22')](_0x18f5ec)[_0x12e4('0x23')](function(_0xfb1f4){return _0xfb1f4;});}return null;};}function removeEntity(_0x4e59d5,_0x1dbc17){return function(_0x3a608f){if(_0x3a608f){return _0x3a608f['destroy']()[_0x12e4('0x23')](function(){var _0x44817d=_0x3a608f[_0x12e4('0x24')]({'plain':!![]});var _0x516f81=_0x12e4('0x25');return db[_0x12e4('0x26')][_0x12e4('0x27')]({'where':{'type':_0x516f81,'resourceId':_0x44817d['id']}})[_0x12e4('0x23')](function(){return _0x3a608f;});})[_0x12e4('0x23')](function(){_0x4e59d5['status'](0xcc)[_0x12e4('0x28')]();});}};}function handleEntityNotFound(_0x5e211c,_0x3db6f9){return function(_0x74a05e){if(!_0x74a05e){_0x5e211c[_0x12e4('0x29')](0x194);}return _0x74a05e;};}function handleError(_0x44c1e4,_0x4a3b35){_0x4a3b35=_0x4a3b35||0x1f4;return function(_0x177194){logger[_0x12e4('0x2a')](_0x177194[_0x12e4('0x2b')]);if(_0x177194[_0x12e4('0x2c')]){delete _0x177194['name'];}_0x44c1e4[_0x12e4('0x1b')](_0x4a3b35)[_0x12e4('0x2d')](_0x177194);};}exports[_0x12e4('0x2e')]=function(_0x409a2d,_0x56fbed){var _0x2c9bfd={},_0x487a88={},_0x3adc67={'count':0x0,'rows':[]};var _0x76d5bf=_[_0x12e4('0x2f')](db['Trigger'][_0x12e4('0x30')],function(_0x1cd1c8){return{'name':_0x1cd1c8[_0x12e4('0x31')],'type':_0x1cd1c8[_0x12e4('0x32')]['key']};});_0x487a88[_0x12e4('0x33')]=_[_0x12e4('0x2f')](_0x76d5bf,'name');_0x487a88[_0x12e4('0x34')]=_[_0x12e4('0x35')](_0x409a2d[_0x12e4('0x34')]);_0x487a88['filters']=_[_0x12e4('0x36')](_0x487a88[_0x12e4('0x33')],_0x487a88[_0x12e4('0x34')]);_0x2c9bfd['attributes']=_[_0x12e4('0x36')](_0x487a88[_0x12e4('0x33')],qs[_0x12e4('0x37')](_0x409a2d[_0x12e4('0x34')][_0x12e4('0x37')]));_0x2c9bfd['attributes']=_0x2c9bfd['attributes'][_0x12e4('0x38')]?_0x2c9bfd['attributes']:_0x487a88[_0x12e4('0x33')];if(!_0x409a2d[_0x12e4('0x34')][_0x12e4('0x39')](_0x12e4('0x3a'))){_0x2c9bfd[_0x12e4('0x3b')]=qs[_0x12e4('0x3b')](_0x409a2d[_0x12e4('0x34')]['limit']);_0x2c9bfd['offset']=qs['offset'](_0x409a2d['query'][_0x12e4('0x1e')]);}_0x2c9bfd[_0x12e4('0x3c')]=qs[_0x12e4('0x3d')](_0x409a2d[_0x12e4('0x34')][_0x12e4('0x3d')]);_0x2c9bfd[_0x12e4('0x3e')]=qs[_0x12e4('0x3f')](_[_0x12e4('0x40')](_0x409a2d['query'],_0x487a88[_0x12e4('0x3f')]));if(_0x409a2d[_0x12e4('0x34')][_0x12e4('0x41')]){_0x2c9bfd['where']=_[_0x12e4('0x42')](_0x2c9bfd[_0x12e4('0x3e')],{'$or':_[_0x12e4('0x2f')](_0x76d5bf,function(_0x2000e4){if(_0x2000e4['type']!==_0x12e4('0x43')){var _0x5c9ce3={};_0x5c9ce3[_0x2000e4[_0x12e4('0x2c')]]={'$like':'%'+_0x409a2d[_0x12e4('0x34')][_0x12e4('0x41')]+'%'};return _0x5c9ce3;}})});}_0x2c9bfd=_['merge']({},_0x2c9bfd,_0x409a2d[_0x12e4('0x44')]);var _0x3456f6={'where':_0x2c9bfd[_0x12e4('0x3e')]};return db['Trigger'][_0x12e4('0x1d')](_0x3456f6)[_0x12e4('0x23')](function(_0x57a3cb){_0x3adc67[_0x12e4('0x1d')]=_0x57a3cb;if(_0x409a2d[_0x12e4('0x34')][_0x12e4('0x45')]){_0x2c9bfd['include']=[{'all':!![]}];}return db[_0x12e4('0x46')]['findAll'](_0x2c9bfd);})['then'](function(_0x43011e){_0x3adc67[_0x12e4('0x47')]=_0x43011e;return _0x3adc67;})['then'](respondWithFilteredResult(_0x56fbed,_0x2c9bfd))['catch'](handleError(_0x56fbed,null));};exports['show']=function(_0x3f5aeb,_0x3efe6b){var _0x321066={'raw':![],'where':{'id':_0x3f5aeb[_0x12e4('0x48')]['id']}},_0x1d766a={};_0x1d766a[_0x12e4('0x33')]=_[_0x12e4('0x35')](db[_0x12e4('0x46')][_0x12e4('0x30')]);_0x1d766a[_0x12e4('0x34')]=_[_0x12e4('0x35')](_0x3f5aeb[_0x12e4('0x34')]);_0x1d766a['filters']=_[_0x12e4('0x36')](_0x1d766a['model'],_0x1d766a['query']);_0x321066['attributes']=_[_0x12e4('0x36')](_0x1d766a[_0x12e4('0x33')],qs[_0x12e4('0x37')](_0x3f5aeb[_0x12e4('0x34')][_0x12e4('0x37')]));_0x321066[_0x12e4('0x49')]=_0x321066[_0x12e4('0x49')]['length']?_0x321066[_0x12e4('0x49')]:_0x1d766a['model'];if(_0x3f5aeb[_0x12e4('0x34')]['includeAll']){_0x321066['include']=[{'all':!![]}];}_0x321066=_[_0x12e4('0x42')]({},_0x321066,_0x3f5aeb[_0x12e4('0x44')]);return db['Trigger'][_0x12e4('0x4a')](_0x321066)[_0x12e4('0x23')](handleEntityNotFound(_0x3efe6b,null))['then'](respondWithResult(_0x3efe6b,null))[_0x12e4('0x4b')](handleError(_0x3efe6b,null));};exports[_0x12e4('0x4c')]=function(_0x528b30,_0x2ecc30){return db[_0x12e4('0x46')][_0x12e4('0x4c')](_0x528b30[_0x12e4('0x4d')],{})[_0x12e4('0x23')](function(_0x16dc93){var _0xda5897=_0x528b30['user'][_0x12e4('0x24')]({'plain':!![]});if(!_0xda5897)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xda5897[_0x12e4('0x4e')]===_0x12e4('0x4f')){var _0x36d4e1=_0x16dc93[_0x12e4('0x24')]({'plain':!![]});var _0x23cab4=_0x12e4('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x23cab4,'userProfileId':_0xda5897['userProfileId']},'raw':!![]})[_0x12e4('0x23')](function(_0x1755cc){if(_0x1755cc&&_0x1755cc[_0x12e4('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x36d4e1[_0x12e4('0x2c')],'resourceId':_0x36d4e1['id'],'type':_0x1755cc[_0x12e4('0x2c')],'sectionId':_0x1755cc['id']},{})[_0x12e4('0x23')](function(){return _0x16dc93;});}else{return _0x16dc93;}})['catch'](function(_0x4a8e8a){logger['error'](_0x12e4('0x51'),_0x4a8e8a);throw _0x4a8e8a;});}return _0x16dc93;})['then'](respondWithResult(_0x2ecc30,0xc9))[_0x12e4('0x4b')](handleError(_0x2ecc30,null));};exports[_0x12e4('0x22')]=function(_0x2d923d,_0x18e8c7){if(_0x2d923d[_0x12e4('0x4d')]['id']){delete _0x2d923d[_0x12e4('0x4d')]['id'];}return db[_0x12e4('0x46')][_0x12e4('0x4a')]({'where':{'id':_0x2d923d[_0x12e4('0x48')]['id']}})['then'](handleEntityNotFound(_0x18e8c7,null))['then'](saveUpdates(_0x2d923d[_0x12e4('0x4d')],null))['then'](respondWithResult(_0x18e8c7,null))['catch'](handleError(_0x18e8c7,null));};exports[_0x12e4('0x27')]=function(_0x5cee4a,_0x54cc49){return db['Trigger']['find']({'where':{'id':_0x5cee4a['params']['id']}})[_0x12e4('0x23')](handleEntityNotFound(_0x54cc49,null))[_0x12e4('0x23')](removeEntity(_0x54cc49,null))[_0x12e4('0x4b')](handleError(_0x54cc49,null));};exports[_0x12e4('0x52')]=function(_0x2a297d,_0x356e67,_0x1f102c){if(_0x2a297d[_0x12e4('0x4d')]['id']){delete _0x2a297d['body']['id'];}return db[_0x12e4('0x46')][_0x12e4('0x4a')]({'where':{'id':_0x2a297d[_0x12e4('0x48')]['id']}})[_0x12e4('0x23')](handleEntityNotFound(_0x356e67,null))[_0x12e4('0x23')](function(_0x82794){if(_0x82794){_0x2a297d['body'][_0x12e4('0x53')]=_0x82794['id'];return db[_0x12e4('0x54')][_0x12e4('0x4c')](_0x2a297d[_0x12e4('0x4d')]);}})[_0x12e4('0x23')](respondWithResult(_0x356e67,null))[_0x12e4('0x4b')](handleError(_0x356e67,null));};exports[_0x12e4('0x55')]=function(_0x443d80,_0x18147a,_0x3db184){if(_0x443d80[_0x12e4('0x4d')]['id']){delete _0x443d80[_0x12e4('0x4d')]['id'];}return db[_0x12e4('0x46')][_0x12e4('0x4a')]({'where':{'id':_0x443d80[_0x12e4('0x48')]['id']}})['then'](handleEntityNotFound(_0x18147a,null))[_0x12e4('0x23')](function(_0x54a673){if(_0x54a673){_0x443d80[_0x12e4('0x4d')][_0x12e4('0x56')]=_0x54a673['id'];return db['Condition'][_0x12e4('0x4c')](_0x443d80[_0x12e4('0x4d')]);}})[_0x12e4('0x23')](respondWithResult(_0x18147a,null))['catch'](handleError(_0x18147a,null));};exports[_0x12e4('0x57')]=function(_0x31a2a5,_0x1d8d00,_0x480c10){var _0x110d12={};var _0x40fb67={};var _0xa46878;var _0x172498;return db[_0x12e4('0x46')][_0x12e4('0x58')]({'where':{'id':_0x31a2a5[_0x12e4('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d8d00,null))[_0x12e4('0x23')](function(_0x2b62fc){if(_0x2b62fc){_0xa46878=_0x2b62fc;_0x40fb67[_0x12e4('0x33')]=_[_0x12e4('0x35')](db[_0x12e4('0x54')][_0x12e4('0x30')]);_0x40fb67[_0x12e4('0x34')]=_[_0x12e4('0x35')](_0x31a2a5['query']);_0x40fb67['filters']=_[_0x12e4('0x36')](_0x40fb67['model'],_0x40fb67[_0x12e4('0x34')]);_0x110d12['attributes']=_[_0x12e4('0x36')](_0x40fb67['model'],qs[_0x12e4('0x37')](_0x31a2a5['query'][_0x12e4('0x37')]));_0x110d12[_0x12e4('0x49')]=_0x110d12[_0x12e4('0x49')][_0x12e4('0x38')]?_0x110d12[_0x12e4('0x49')]:_0x40fb67[_0x12e4('0x33')];_0x110d12['order']=qs['sort'](_0x31a2a5[_0x12e4('0x34')][_0x12e4('0x3d')]);_0x110d12[_0x12e4('0x3e')]=qs['filters'](_[_0x12e4('0x40')](_0x31a2a5[_0x12e4('0x34')],_0x40fb67[_0x12e4('0x3f')]));if(_0x31a2a5[_0x12e4('0x34')][_0x12e4('0x41')]){_0x110d12[_0x12e4('0x3e')]=_[_0x12e4('0x42')](_0x110d12[_0x12e4('0x3e')],{'$or':_[_0x12e4('0x2f')](_0x110d12[_0x12e4('0x49')],function(_0xd19024){var _0x22e7d4={};_0x22e7d4[_0xd19024]={'$like':'%'+_0x31a2a5['query'][_0x12e4('0x41')]+'%'};return _0x22e7d4;})});}_0x110d12=_[_0x12e4('0x42')]({},_0x110d12,_0x31a2a5[_0x12e4('0x44')]);return _0xa46878[_0x12e4('0x57')](_0x110d12);}})[_0x12e4('0x23')](function(_0x50a4d7){if(_0x50a4d7){_0x172498=_0x50a4d7[_0x12e4('0x38')];if(!_0x31a2a5['query']['hasOwnProperty'](_0x12e4('0x3a'))){_0x110d12[_0x12e4('0x3b')]=qs[_0x12e4('0x3b')](_0x31a2a5[_0x12e4('0x34')][_0x12e4('0x3b')]);_0x110d12[_0x12e4('0x1e')]=qs[_0x12e4('0x1e')](_0x31a2a5[_0x12e4('0x34')][_0x12e4('0x1e')]);}return _0xa46878['getAllConditions'](_0x110d12);}})[_0x12e4('0x23')](function(_0x58bd77){if(_0x58bd77){return _0x58bd77?{'count':_0x172498,'rows':_0x58bd77}:null;}})[_0x12e4('0x23')](respondWithResult(_0x1d8d00,null))['catch'](handleError(_0x1d8d00,null));};exports[_0x12e4('0x59')]=function(_0xac5b14,_0x114649,_0x3d7fe7){var _0x2ce952={};var _0x2fc197={};var _0xacf85e;var _0x1d5911;return db['Trigger'][_0x12e4('0x58')]({'where':{'id':_0xac5b14['params']['id']}})[_0x12e4('0x23')](handleEntityNotFound(_0x114649,null))['then'](function(_0x382341){if(_0x382341){_0xacf85e=_0x382341;_0x2fc197['model']=_[_0x12e4('0x35')](db[_0x12e4('0x54')][_0x12e4('0x30')]);_0x2fc197[_0x12e4('0x34')]=_[_0x12e4('0x35')](_0xac5b14[_0x12e4('0x34')]);_0x2fc197[_0x12e4('0x3f')]=_[_0x12e4('0x36')](_0x2fc197[_0x12e4('0x33')],_0x2fc197[_0x12e4('0x34')]);_0x2ce952['attributes']=_[_0x12e4('0x36')](_0x2fc197[_0x12e4('0x33')],qs[_0x12e4('0x37')](_0xac5b14['query'][_0x12e4('0x37')]));_0x2ce952['attributes']=_0x2ce952['attributes']['length']?_0x2ce952[_0x12e4('0x49')]:_0x2fc197[_0x12e4('0x33')];_0x2ce952[_0x12e4('0x3c')]=qs[_0x12e4('0x3d')](_0xac5b14[_0x12e4('0x34')][_0x12e4('0x3d')]);_0x2ce952[_0x12e4('0x3e')]=qs[_0x12e4('0x3f')](_[_0x12e4('0x40')](_0xac5b14[_0x12e4('0x34')],_0x2fc197[_0x12e4('0x3f')]));if(_0xac5b14[_0x12e4('0x34')]['filter']){_0x2ce952[_0x12e4('0x3e')]=_[_0x12e4('0x42')](_0x2ce952[_0x12e4('0x3e')],{'$or':_[_0x12e4('0x2f')](_0x2ce952[_0x12e4('0x49')],function(_0x4a013f){var _0x1ff80c={};_0x1ff80c[_0x4a013f]={'$like':'%'+_0xac5b14[_0x12e4('0x34')][_0x12e4('0x41')]+'%'};return _0x1ff80c;})});}_0x2ce952=_[_0x12e4('0x42')]({},_0x2ce952,_0xac5b14[_0x12e4('0x44')]);return _0xacf85e[_0x12e4('0x59')](_0x2ce952);}})[_0x12e4('0x23')](function(_0x47563c){if(_0x47563c){_0x1d5911=_0x47563c[_0x12e4('0x38')];if(!_0xac5b14[_0x12e4('0x34')][_0x12e4('0x39')](_0x12e4('0x3a'))){_0x2ce952[_0x12e4('0x3b')]=qs['limit'](_0xac5b14[_0x12e4('0x34')]['limit']);_0x2ce952[_0x12e4('0x1e')]=qs[_0x12e4('0x1e')](_0xac5b14[_0x12e4('0x34')][_0x12e4('0x1e')]);}return _0xacf85e['getAnyConditions'](_0x2ce952);}})[_0x12e4('0x23')](function(_0xb32c6a){if(_0xb32c6a){return _0xb32c6a?{'count':_0x1d5911,'rows':_0xb32c6a}:null;}})['then'](respondWithResult(_0x114649,null))[_0x12e4('0x4b')](handleError(_0x114649,null));};exports[_0x12e4('0x5a')]=function(_0x54b7f1,_0x421c47,_0x118777){if(_0x54b7f1[_0x12e4('0x4d')]['id']){delete _0x54b7f1['body']['id'];}return db['Trigger'][_0x12e4('0x4a')]({'where':{'id':_0x54b7f1['params']['id']}})[_0x12e4('0x23')](handleEntityNotFound(_0x421c47,null))[_0x12e4('0x23')](function(_0x31d499){if(_0x31d499){_0x54b7f1[_0x12e4('0x4d')]['TriggerId']=_0x31d499['id'];return db[_0x12e4('0x5b')][_0x12e4('0x4c')](_0x54b7f1[_0x12e4('0x4d')]);}})[_0x12e4('0x23')](respondWithResult(_0x421c47,null))[_0x12e4('0x4b')](handleError(_0x421c47,null));};exports['getActions']=function(_0x2184df,_0x366aae,_0x35e819){var _0x1d96e2={};var _0x447eff={};var _0x311407;var _0x39c884;return db['Trigger'][_0x12e4('0x58')]({'where':{'id':_0x2184df[_0x12e4('0x48')]['id']}})[_0x12e4('0x23')](handleEntityNotFound(_0x366aae,null))[_0x12e4('0x23')](function(_0x62e915){if(_0x62e915){_0x311407=_0x62e915;_0x447eff[_0x12e4('0x33')]=_[_0x12e4('0x35')](db[_0x12e4('0x5b')]['rawAttributes']);_0x447eff[_0x12e4('0x34')]=_[_0x12e4('0x35')](_0x2184df[_0x12e4('0x34')]);_0x447eff['filters']=_[_0x12e4('0x36')](_0x447eff[_0x12e4('0x33')],_0x447eff[_0x12e4('0x34')]);_0x1d96e2[_0x12e4('0x49')]=_[_0x12e4('0x36')](_0x447eff[_0x12e4('0x33')],qs[_0x12e4('0x37')](_0x2184df['query']['fields']));_0x1d96e2[_0x12e4('0x49')]=_0x1d96e2[_0x12e4('0x49')][_0x12e4('0x38')]?_0x1d96e2['attributes']:_0x447eff[_0x12e4('0x33')];_0x1d96e2[_0x12e4('0x3c')]=qs['sort'](_0x2184df[_0x12e4('0x34')]['sort']);_0x1d96e2[_0x12e4('0x3e')]=qs[_0x12e4('0x3f')](_[_0x12e4('0x40')](_0x2184df[_0x12e4('0x34')],_0x447eff[_0x12e4('0x3f')]));if(_0x2184df['query'][_0x12e4('0x41')]){_0x1d96e2[_0x12e4('0x3e')]=_['merge'](_0x1d96e2[_0x12e4('0x3e')],{'$or':_[_0x12e4('0x2f')](_0x1d96e2[_0x12e4('0x49')],function(_0x19cdfb){var _0x48bed8={};_0x48bed8[_0x19cdfb]={'$like':'%'+_0x2184df['query'][_0x12e4('0x41')]+'%'};return _0x48bed8;})});}_0x1d96e2=_[_0x12e4('0x42')]({},_0x1d96e2,_0x2184df[_0x12e4('0x44')]);return _0x311407[_0x12e4('0x5c')](_0x1d96e2);}})[_0x12e4('0x23')](function(_0x4114b1){if(_0x4114b1){_0x39c884=_0x4114b1[_0x12e4('0x38')];if(!_0x2184df[_0x12e4('0x34')]['hasOwnProperty'](_0x12e4('0x3a'))){_0x1d96e2[_0x12e4('0x3b')]=qs[_0x12e4('0x3b')](_0x2184df[_0x12e4('0x34')]['limit']);_0x1d96e2[_0x12e4('0x1e')]=qs[_0x12e4('0x1e')](_0x2184df['query'][_0x12e4('0x1e')]);}return _0x311407['getActions'](_0x1d96e2);}})[_0x12e4('0x23')](function(_0x481888){if(_0x481888){return _0x481888?{'count':_0x39c884,'rows':_0x481888}:null;}})[_0x12e4('0x23')](respondWithResult(_0x366aae,null))[_0x12e4('0x4b')](handleError(_0x366aae,null));}; \ No newline at end of file +var _0x422b=['key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','filters','pick','filter','merge','where','VIRTUAL','options','Trigger','count','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','hasOwnProperty','getAnyConditions','sort','addAction','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','then','destroy','Triggers','UserProfileResource','error','stack','name','send','map','rawAttributes','type'];(function(_0x2c3649,_0x5a901a){var _0x31e6b4=function(_0x1d359d){while(--_0x1d359d){_0x2c3649['push'](_0x2c3649['shift']());}};_0x31e6b4(++_0x5a901a);}(_0x422b,0x92));var _0xb422=function(_0x1a7ad,_0x4d9ca1){_0x1a7ad=_0x1a7ad-0x0;var _0x2192bc=_0x422b[_0x1a7ad];return _0x2192bc;};'use strict';var pdf=require(_0xb422('0x0'));var emlformat=require(_0xb422('0x1'));var rimraf=require(_0xb422('0x2'));var zipdir=require(_0xb422('0x3'));var jsonpatch=require(_0xb422('0x4'));var rp=require('request-promise');var moment=require(_0xb422('0x5'));var BPromise=require(_0xb422('0x6'));var Mustache=require(_0xb422('0x7'));var util=require(_0xb422('0x8'));var path=require(_0xb422('0x9'));var sox=require(_0xb422('0xa'));var csv=require(_0xb422('0xb'));var ejs=require(_0xb422('0xc'));var fs=require('fs');var _=require(_0xb422('0xd'));var squel=require(_0xb422('0xe'));var crypto=require(_0xb422('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xb422('0x10'));var toCsv=require(_0xb422('0xb'));var querystring=require(_0xb422('0x11'));var Papa=require(_0xb422('0x12'));var Redis=require(_0xb422('0x13'));var authService=require(_0xb422('0x14'));var qs=require(_0xb422('0x15'));var as=require(_0xb422('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb422('0x17'))(_0xb422('0x18'));var utils=require(_0xb422('0x19'));var config=require(_0xb422('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46359f,_0x2c1c90){_0x2c1c90=_0x2c1c90||0xcc;return function(_0x517aca){if(_0x517aca){return _0x46359f[_0xb422('0x1b')](_0x2c1c90);}return _0x46359f[_0xb422('0x1c')](_0x2c1c90)[_0xb422('0x1d')]();};}function respondWithResult(_0x55a969,_0x3b89be){_0x3b89be=_0x3b89be||0xc8;return function(_0x43b883){if(_0x43b883){return _0x55a969[_0xb422('0x1c')](_0x3b89be)[_0xb422('0x1e')](_0x43b883);}};}function respondWithFilteredResult(_0x3bc0aa,_0x411e86){return function(_0x535ec5){if(_0x535ec5){var _0xac0562=_0x535ec5['count'],_0x2dd725=_0x411e86[_0xb422('0x1f')],_0x17cef5=_0x411e86[_0xb422('0x1f')]+_0x411e86['limit'],_0x2db102;if(_0x17cef5>=_0xac0562){_0x17cef5=_0xac0562;_0x2db102=0xc8;}else{_0x2db102=0xce;}_0x3bc0aa[_0xb422('0x1c')](_0x2db102);return _0x3bc0aa[_0xb422('0x20')](_0xb422('0x21'),_0x2dd725+'-'+_0x17cef5+'/'+_0xac0562)['json'](_0x535ec5);}return null;};}function patchUpdates(_0x20b97b){return function(_0x4a82cb){try{jsonpatch['apply'](_0x4a82cb,_0x20b97b,!![]);}catch(_0x4bd73d){return BPromise[_0xb422('0x22')](_0x4bd73d);}return _0x4a82cb[_0xb422('0x23')]();};}function saveUpdates(_0xa8ff7,_0x53ea1e){return function(_0x3e065c){if(_0x3e065c){return _0x3e065c[_0xb422('0x24')](_0xa8ff7)[_0xb422('0x25')](function(_0x15214f){return _0x15214f;});}return null;};}function removeEntity(_0xba8aa6,_0x172a22){return function(_0x29fbc5){if(_0x29fbc5){return _0x29fbc5[_0xb422('0x26')]()[_0xb422('0x25')](function(){var _0x420a69=_0x29fbc5['get']({'plain':!![]});var _0x1d3099=_0xb422('0x27');return db[_0xb422('0x28')][_0xb422('0x26')]({'where':{'type':_0x1d3099,'resourceId':_0x420a69['id']}})['then'](function(){return _0x29fbc5;});})['then'](function(){_0xba8aa6['status'](0xcc)[_0xb422('0x1d')]();});}};}function handleEntityNotFound(_0x42bee2,_0x36fee2){return function(_0x25cc6e){if(!_0x25cc6e){_0x42bee2[_0xb422('0x1b')](0x194);}return _0x25cc6e;};}function handleError(_0x160827,_0x2cdda8){_0x2cdda8=_0x2cdda8||0x1f4;return function(_0x15d62b){logger[_0xb422('0x29')](_0x15d62b[_0xb422('0x2a')]);if(_0x15d62b[_0xb422('0x2b')]){delete _0x15d62b['name'];}_0x160827[_0xb422('0x1c')](_0x2cdda8)[_0xb422('0x2c')](_0x15d62b);};}exports['index']=function(_0x138ad4,_0x14f121){var _0x3b07d4={},_0x2bda44={},_0x351ceb={'count':0x0,'rows':[]};var _0x1ce8b3=_[_0xb422('0x2d')](db['Trigger'][_0xb422('0x2e')],function(_0x47dce0){return{'name':_0x47dce0['fieldName'],'type':_0x47dce0[_0xb422('0x2f')][_0xb422('0x30')]};});_0x2bda44[_0xb422('0x31')]=_[_0xb422('0x2d')](_0x1ce8b3,'name');_0x2bda44[_0xb422('0x32')]=_[_0xb422('0x33')](_0x138ad4['query']);_0x2bda44['filters']=_[_0xb422('0x34')](_0x2bda44[_0xb422('0x31')],_0x2bda44[_0xb422('0x32')]);_0x3b07d4[_0xb422('0x35')]=_[_0xb422('0x34')](_0x2bda44[_0xb422('0x31')],qs[_0xb422('0x36')](_0x138ad4[_0xb422('0x32')][_0xb422('0x36')]));_0x3b07d4[_0xb422('0x35')]=_0x3b07d4['attributes']['length']?_0x3b07d4[_0xb422('0x35')]:_0x2bda44[_0xb422('0x31')];if(!_0x138ad4[_0xb422('0x32')]['hasOwnProperty'](_0xb422('0x37'))){_0x3b07d4['limit']=qs[_0xb422('0x38')](_0x138ad4[_0xb422('0x32')][_0xb422('0x38')]);_0x3b07d4[_0xb422('0x1f')]=qs['offset'](_0x138ad4['query'][_0xb422('0x1f')]);}_0x3b07d4[_0xb422('0x39')]=qs['sort'](_0x138ad4[_0xb422('0x32')]['sort']);_0x3b07d4['where']=qs[_0xb422('0x3a')](_[_0xb422('0x3b')](_0x138ad4['query'],_0x2bda44[_0xb422('0x3a')]));if(_0x138ad4['query'][_0xb422('0x3c')]){_0x3b07d4['where']=_[_0xb422('0x3d')](_0x3b07d4[_0xb422('0x3e')],{'$or':_['map'](_0x1ce8b3,function(_0x13f697){if(_0x13f697[_0xb422('0x2f')]!==_0xb422('0x3f')){var _0x241dc0={};_0x241dc0[_0x13f697[_0xb422('0x2b')]]={'$like':'%'+_0x138ad4[_0xb422('0x32')]['filter']+'%'};return _0x241dc0;}})});}_0x3b07d4=_['merge']({},_0x3b07d4,_0x138ad4[_0xb422('0x40')]);var _0xb4c77d={'where':_0x3b07d4[_0xb422('0x3e')]};return db[_0xb422('0x41')]['count'](_0xb4c77d)[_0xb422('0x25')](function(_0x5f106f){_0x351ceb[_0xb422('0x42')]=_0x5f106f;if(_0x138ad4['query'][_0xb422('0x43')]){_0x3b07d4['include']=[{'all':!![]}];}return db[_0xb422('0x41')][_0xb422('0x44')](_0x3b07d4);})[_0xb422('0x25')](function(_0x5444c4){_0x351ceb[_0xb422('0x45')]=_0x5444c4;return _0x351ceb;})[_0xb422('0x25')](respondWithFilteredResult(_0x14f121,_0x3b07d4))[_0xb422('0x46')](handleError(_0x14f121,null));};exports[_0xb422('0x47')]=function(_0x319094,_0x55a07f){var _0x4693c0={'raw':![],'where':{'id':_0x319094[_0xb422('0x48')]['id']}},_0xdf9ce={};_0xdf9ce['model']=_[_0xb422('0x33')](db[_0xb422('0x41')][_0xb422('0x2e')]);_0xdf9ce[_0xb422('0x32')]=_['keys'](_0x319094[_0xb422('0x32')]);_0xdf9ce[_0xb422('0x3a')]=_['intersection'](_0xdf9ce['model'],_0xdf9ce[_0xb422('0x32')]);_0x4693c0[_0xb422('0x35')]=_[_0xb422('0x34')](_0xdf9ce[_0xb422('0x31')],qs['fields'](_0x319094['query'][_0xb422('0x36')]));_0x4693c0['attributes']=_0x4693c0[_0xb422('0x35')][_0xb422('0x49')]?_0x4693c0[_0xb422('0x35')]:_0xdf9ce['model'];if(_0x319094[_0xb422('0x32')][_0xb422('0x43')]){_0x4693c0[_0xb422('0x4a')]=[{'all':!![]}];}_0x4693c0=_[_0xb422('0x3d')]({},_0x4693c0,_0x319094[_0xb422('0x40')]);return db[_0xb422('0x41')][_0xb422('0x4b')](_0x4693c0)[_0xb422('0x25')](handleEntityNotFound(_0x55a07f,null))[_0xb422('0x25')](respondWithResult(_0x55a07f,null))['catch'](handleError(_0x55a07f,null));};exports[_0xb422('0x4c')]=function(_0x147d16,_0x5ebe52){return db['Trigger']['create'](_0x147d16[_0xb422('0x4d')],{})[_0xb422('0x25')](function(_0x2526f8){var _0xd13d93=_0x147d16[_0xb422('0x4e')]['get']({'plain':!![]});if(!_0xd13d93)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd13d93['role']==='user'){var _0x24e45a=_0x2526f8[_0xb422('0x4f')]({'plain':!![]});var _0x321322='Triggers';return db['UserProfileSection'][_0xb422('0x4b')]({'where':{'name':_0x321322,'userProfileId':_0xd13d93[_0xb422('0x50')]},'raw':!![]})[_0xb422('0x25')](function(_0x1385d4){if(_0x1385d4&&_0x1385d4[_0xb422('0x51')]===0x0){return db['UserProfileResource'][_0xb422('0x4c')]({'name':_0x24e45a[_0xb422('0x2b')],'resourceId':_0x24e45a['id'],'type':_0x1385d4[_0xb422('0x2b')],'sectionId':_0x1385d4['id']},{})[_0xb422('0x25')](function(){return _0x2526f8;});}else{return _0x2526f8;}})[_0xb422('0x46')](function(_0x59e434){logger['error'](_0xb422('0x52'),_0x59e434);throw _0x59e434;});}return _0x2526f8;})[_0xb422('0x25')](respondWithResult(_0x5ebe52,0xc9))['catch'](handleError(_0x5ebe52,null));};exports[_0xb422('0x24')]=function(_0x404b73,_0x48d387){if(_0x404b73[_0xb422('0x4d')]['id']){delete _0x404b73[_0xb422('0x4d')]['id'];}return db[_0xb422('0x41')]['find']({'where':{'id':_0x404b73[_0xb422('0x48')]['id']}})[_0xb422('0x25')](handleEntityNotFound(_0x48d387,null))['then'](saveUpdates(_0x404b73[_0xb422('0x4d')],null))['then'](respondWithResult(_0x48d387,null))[_0xb422('0x46')](handleError(_0x48d387,null));};exports['destroy']=function(_0x561873,_0x59770f){return db[_0xb422('0x41')][_0xb422('0x4b')]({'where':{'id':_0x561873['params']['id']}})['then'](handleEntityNotFound(_0x59770f,null))[_0xb422('0x25')](removeEntity(_0x59770f,null))[_0xb422('0x46')](handleError(_0x59770f,null));};exports[_0xb422('0x53')]=function(_0x193eda,_0x471431,_0x6ad7b2){if(_0x193eda[_0xb422('0x4d')]['id']){delete _0x193eda['body']['id'];}return db[_0xb422('0x41')]['find']({'where':{'id':_0x193eda[_0xb422('0x48')]['id']}})[_0xb422('0x25')](handleEntityNotFound(_0x471431,null))[_0xb422('0x25')](function(_0x5e8b4c){if(_0x5e8b4c){_0x193eda[_0xb422('0x4d')][_0xb422('0x54')]=_0x5e8b4c['id'];return db[_0xb422('0x55')][_0xb422('0x4c')](_0x193eda[_0xb422('0x4d')]);}})[_0xb422('0x25')](respondWithResult(_0x471431,null))[_0xb422('0x46')](handleError(_0x471431,null));};exports[_0xb422('0x56')]=function(_0x1dc1d3,_0x4da09d,_0x57ca16){if(_0x1dc1d3[_0xb422('0x4d')]['id']){delete _0x1dc1d3['body']['id'];}return db[_0xb422('0x41')][_0xb422('0x4b')]({'where':{'id':_0x1dc1d3[_0xb422('0x48')]['id']}})[_0xb422('0x25')](handleEntityNotFound(_0x4da09d,null))['then'](function(_0xbe30bc){if(_0xbe30bc){_0x1dc1d3[_0xb422('0x4d')][_0xb422('0x57')]=_0xbe30bc['id'];return db[_0xb422('0x55')]['create'](_0x1dc1d3[_0xb422('0x4d')]);}})[_0xb422('0x25')](respondWithResult(_0x4da09d,null))[_0xb422('0x46')](handleError(_0x4da09d,null));};exports[_0xb422('0x58')]=function(_0x1401f0,_0x5b4a82,_0x37e98e){var _0x5db633={};var _0x5ef1b1={};var _0x433516;var _0x71da1e;return db[_0xb422('0x41')][_0xb422('0x59')]({'where':{'id':_0x1401f0[_0xb422('0x48')]['id']}})['then'](handleEntityNotFound(_0x5b4a82,null))[_0xb422('0x25')](function(_0x3aa78b){if(_0x3aa78b){_0x433516=_0x3aa78b;_0x5ef1b1['model']=_[_0xb422('0x33')](db[_0xb422('0x55')][_0xb422('0x2e')]);_0x5ef1b1[_0xb422('0x32')]=_[_0xb422('0x33')](_0x1401f0[_0xb422('0x32')]);_0x5ef1b1[_0xb422('0x3a')]=_[_0xb422('0x34')](_0x5ef1b1[_0xb422('0x31')],_0x5ef1b1[_0xb422('0x32')]);_0x5db633[_0xb422('0x35')]=_[_0xb422('0x34')](_0x5ef1b1[_0xb422('0x31')],qs[_0xb422('0x36')](_0x1401f0[_0xb422('0x32')]['fields']));_0x5db633[_0xb422('0x35')]=_0x5db633[_0xb422('0x35')][_0xb422('0x49')]?_0x5db633[_0xb422('0x35')]:_0x5ef1b1[_0xb422('0x31')];_0x5db633[_0xb422('0x39')]=qs['sort'](_0x1401f0['query']['sort']);_0x5db633['where']=qs[_0xb422('0x3a')](_['pick'](_0x1401f0['query'],_0x5ef1b1['filters']));if(_0x1401f0[_0xb422('0x32')][_0xb422('0x3c')]){_0x5db633[_0xb422('0x3e')]=_['merge'](_0x5db633['where'],{'$or':_[_0xb422('0x2d')](_0x5db633[_0xb422('0x35')],function(_0x2cb26a){var _0x2227bf={};_0x2227bf[_0x2cb26a]={'$like':'%'+_0x1401f0[_0xb422('0x32')][_0xb422('0x3c')]+'%'};return _0x2227bf;})});}_0x5db633=_[_0xb422('0x3d')]({},_0x5db633,_0x1401f0[_0xb422('0x40')]);return _0x433516[_0xb422('0x58')](_0x5db633);}})[_0xb422('0x25')](function(_0xc5f7bf){if(_0xc5f7bf){_0x71da1e=_0xc5f7bf['length'];if(!_0x1401f0[_0xb422('0x32')][_0xb422('0x5a')](_0xb422('0x37'))){_0x5db633[_0xb422('0x38')]=qs[_0xb422('0x38')](_0x1401f0[_0xb422('0x32')][_0xb422('0x38')]);_0x5db633['offset']=qs['offset'](_0x1401f0[_0xb422('0x32')][_0xb422('0x1f')]);}return _0x433516[_0xb422('0x58')](_0x5db633);}})[_0xb422('0x25')](function(_0xd2e24f){if(_0xd2e24f){return _0xd2e24f?{'count':_0x71da1e,'rows':_0xd2e24f}:null;}})[_0xb422('0x25')](respondWithResult(_0x5b4a82,null))['catch'](handleError(_0x5b4a82,null));};exports[_0xb422('0x5b')]=function(_0x2fea25,_0x3e0179,_0x5e7210){var _0x24f2a1={};var _0x5c5d90={};var _0x270ce4;var _0x341c26;return db[_0xb422('0x41')]['findOne']({'where':{'id':_0x2fea25[_0xb422('0x48')]['id']}})[_0xb422('0x25')](handleEntityNotFound(_0x3e0179,null))[_0xb422('0x25')](function(_0x7b0402){if(_0x7b0402){_0x270ce4=_0x7b0402;_0x5c5d90['model']=_[_0xb422('0x33')](db['Condition'][_0xb422('0x2e')]);_0x5c5d90[_0xb422('0x32')]=_[_0xb422('0x33')](_0x2fea25[_0xb422('0x32')]);_0x5c5d90[_0xb422('0x3a')]=_[_0xb422('0x34')](_0x5c5d90[_0xb422('0x31')],_0x5c5d90[_0xb422('0x32')]);_0x24f2a1[_0xb422('0x35')]=_[_0xb422('0x34')](_0x5c5d90[_0xb422('0x31')],qs['fields'](_0x2fea25[_0xb422('0x32')][_0xb422('0x36')]));_0x24f2a1[_0xb422('0x35')]=_0x24f2a1[_0xb422('0x35')][_0xb422('0x49')]?_0x24f2a1[_0xb422('0x35')]:_0x5c5d90[_0xb422('0x31')];_0x24f2a1[_0xb422('0x39')]=qs[_0xb422('0x5c')](_0x2fea25[_0xb422('0x32')][_0xb422('0x5c')]);_0x24f2a1['where']=qs['filters'](_[_0xb422('0x3b')](_0x2fea25[_0xb422('0x32')],_0x5c5d90[_0xb422('0x3a')]));if(_0x2fea25[_0xb422('0x32')]['filter']){_0x24f2a1[_0xb422('0x3e')]=_[_0xb422('0x3d')](_0x24f2a1['where'],{'$or':_[_0xb422('0x2d')](_0x24f2a1[_0xb422('0x35')],function(_0x5fe40f){var _0x1e2b13={};_0x1e2b13[_0x5fe40f]={'$like':'%'+_0x2fea25[_0xb422('0x32')][_0xb422('0x3c')]+'%'};return _0x1e2b13;})});}_0x24f2a1=_[_0xb422('0x3d')]({},_0x24f2a1,_0x2fea25[_0xb422('0x40')]);return _0x270ce4[_0xb422('0x5b')](_0x24f2a1);}})[_0xb422('0x25')](function(_0x3a3f50){if(_0x3a3f50){_0x341c26=_0x3a3f50[_0xb422('0x49')];if(!_0x2fea25[_0xb422('0x32')]['hasOwnProperty'](_0xb422('0x37'))){_0x24f2a1[_0xb422('0x38')]=qs['limit'](_0x2fea25[_0xb422('0x32')][_0xb422('0x38')]);_0x24f2a1[_0xb422('0x1f')]=qs[_0xb422('0x1f')](_0x2fea25['query'][_0xb422('0x1f')]);}return _0x270ce4['getAnyConditions'](_0x24f2a1);}})['then'](function(_0x5768b4){if(_0x5768b4){return _0x5768b4?{'count':_0x341c26,'rows':_0x5768b4}:null;}})[_0xb422('0x25')](respondWithResult(_0x3e0179,null))[_0xb422('0x46')](handleError(_0x3e0179,null));};exports[_0xb422('0x5d')]=function(_0x33fa03,_0x264065,_0x921f1){if(_0x33fa03[_0xb422('0x4d')]['id']){delete _0x33fa03['body']['id'];}return db[_0xb422('0x41')]['find']({'where':{'id':_0x33fa03[_0xb422('0x48')]['id']}})[_0xb422('0x25')](handleEntityNotFound(_0x264065,null))[_0xb422('0x25')](function(_0x4f7e4d){if(_0x4f7e4d){_0x33fa03['body'][_0xb422('0x5e')]=_0x4f7e4d['id'];return db[_0xb422('0x5f')][_0xb422('0x4c')](_0x33fa03[_0xb422('0x4d')]);}})[_0xb422('0x25')](respondWithResult(_0x264065,null))[_0xb422('0x46')](handleError(_0x264065,null));};exports['getActions']=function(_0x4555de,_0x56c1de,_0x434f39){var _0x6ec901={};var _0x33103d={};var _0x2562bd;var _0x2a7f60;return db[_0xb422('0x41')][_0xb422('0x59')]({'where':{'id':_0x4555de['params']['id']}})['then'](handleEntityNotFound(_0x56c1de,null))[_0xb422('0x25')](function(_0x287682){if(_0x287682){_0x2562bd=_0x287682;_0x33103d['model']=_['keys'](db[_0xb422('0x5f')][_0xb422('0x2e')]);_0x33103d[_0xb422('0x32')]=_[_0xb422('0x33')](_0x4555de['query']);_0x33103d[_0xb422('0x3a')]=_['intersection'](_0x33103d['model'],_0x33103d[_0xb422('0x32')]);_0x6ec901['attributes']=_['intersection'](_0x33103d[_0xb422('0x31')],qs['fields'](_0x4555de[_0xb422('0x32')][_0xb422('0x36')]));_0x6ec901[_0xb422('0x35')]=_0x6ec901[_0xb422('0x35')][_0xb422('0x49')]?_0x6ec901['attributes']:_0x33103d[_0xb422('0x31')];_0x6ec901[_0xb422('0x39')]=qs[_0xb422('0x5c')](_0x4555de['query'][_0xb422('0x5c')]);_0x6ec901[_0xb422('0x3e')]=qs['filters'](_[_0xb422('0x3b')](_0x4555de['query'],_0x33103d[_0xb422('0x3a')]));if(_0x4555de[_0xb422('0x32')][_0xb422('0x3c')]){_0x6ec901['where']=_[_0xb422('0x3d')](_0x6ec901[_0xb422('0x3e')],{'$or':_[_0xb422('0x2d')](_0x6ec901['attributes'],function(_0x45e37f){var _0x21a1d2={};_0x21a1d2[_0x45e37f]={'$like':'%'+_0x4555de[_0xb422('0x32')][_0xb422('0x3c')]+'%'};return _0x21a1d2;})});}_0x6ec901=_['merge']({},_0x6ec901,_0x4555de[_0xb422('0x40')]);return _0x2562bd[_0xb422('0x60')](_0x6ec901);}})[_0xb422('0x25')](function(_0x8b4509){if(_0x8b4509){_0x2a7f60=_0x8b4509[_0xb422('0x49')];if(!_0x4555de[_0xb422('0x32')][_0xb422('0x5a')](_0xb422('0x37'))){_0x6ec901[_0xb422('0x38')]=qs[_0xb422('0x38')](_0x4555de[_0xb422('0x32')]['limit']);_0x6ec901[_0xb422('0x1f')]=qs[_0xb422('0x1f')](_0x4555de[_0xb422('0x32')][_0xb422('0x1f')]);}return _0x2562bd['getActions'](_0x6ec901);}})['then'](function(_0x1098e6){if(_0x1098e6){return _0x1098e6?{'count':_0x2a7f60,'rows':_0x1098e6}:null;}})['then'](respondWithResult(_0x56c1de,null))[_0xb422('0x46')](handleError(_0x56c1de,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index af774ac..12e7091 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 _0xabb5=['exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xabb5,0xe1));var _0x5abb=function(_0x485c81,_0x3d7e77){_0x485c81=_0x485c81-0x0;var _0x47fda3=_0xabb5[_0x485c81];return _0x47fda3;};'use strict';var _=require(_0x5abb('0x0'));var util=require(_0x5abb('0x1'));var logger=require(_0x5abb('0x2'))(_0x5abb('0x3'));var moment=require(_0x5abb('0x4'));var BPromise=require(_0x5abb('0x5'));var rp=require(_0x5abb('0x6'));var fs=require('fs');var path=require(_0x5abb('0x7'));var rimraf=require(_0x5abb('0x8'));var config=require('../../config/environment');var attributes=require('./trigger.attributes');module[_0x5abb('0x9')]=function(_0x3137ad,_0x3b00a3){return _0x3137ad[_0x5abb('0xa')](_0x5abb('0xb'),attributes,{'tableName':_0x5abb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb3e=['path','../../config/environment','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x190b86,_0x3fb190){var _0xeda48=function(_0x40a10e){while(--_0x40a10e){_0x190b86['push'](_0x190b86['shift']());}};_0xeda48(++_0x3fb190);}(_0xfb3e,0x7b));var _0xefb3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xfb3e[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xefb3('0x0'));var util=require(_0xefb3('0x1'));var logger=require(_0xefb3('0x2'))(_0xefb3('0x3'));var moment=require(_0xefb3('0x4'));var BPromise=require(_0xefb3('0x5'));var rp=require(_0xefb3('0x6'));var fs=require('fs');var path=require(_0xefb3('0x7'));var rimraf=require('rimraf');var config=require(_0xefb3('0x8'));var attributes=require('./trigger.attributes');module[_0xefb3('0x9')]=function(_0x277b0e,_0x34372d){return _0x277b0e[_0xefb3('0xa')](_0xefb3('0xb'),attributes,{'tableName':_0xefb3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 7b77857..ae50c29 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 _0x7072=['model','then','ShowTrigger','Trigger','find','map','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','options','raw','where','attributes','limit','include'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0x7072,0x138));var _0x2707=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x7072[_0x58dc25];return _0x21b0a7;};'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);});});}exports[_0x2707('0x15')]=function(_0x4a8b7f){var _0x119ac4=this;return new Promise(function(_0x449a61,_0x4009f3){return db['Trigger']['findAll']({'raw':_0x4a8b7f['options']?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x17')]===undefined?!![]:![]:!![],'where':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x18')]||null:null,'attributes':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x19')]||null:null,'limit':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x1a')]||null:null,'include':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x1b')]?_['map'](_0x4a8b7f[_0x2707('0x16')][_0x2707('0x1b')],function(_0x46259e){return{'model':db[_0x46259e[_0x2707('0x1c')]],'as':_0x46259e['as'],'attributes':_0x46259e[_0x2707('0x19')],'include':_0x46259e[_0x2707('0x1b')]?_['map'](_0x46259e[_0x2707('0x1b')],function(_0x3f6976){return{'model':db[_0x3f6976[_0x2707('0x1c')]],'as':_0x3f6976['as'],'attributes':_0x3f6976[_0x2707('0x19')],'include':_0x3f6976[_0x2707('0x1b')]?_['map'](_0x3f6976[_0x2707('0x1b')],function(_0x4ca05d){return{'model':db[_0x4ca05d[_0x2707('0x1c')]],'as':_0x4ca05d['as'],'attributes':_0x4ca05d[_0x2707('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2707('0x1d')](function(_0x57da26){logger[_0x2707('0xb')](_0x2707('0x15'),_0x4a8b7f);logger[_0x2707('0xe')]('GetTrigger',_0x4a8b7f,JSON[_0x2707('0x10')](_0x57da26));_0x449a61(_0x57da26);})[_0x2707('0x14')](function(_0x4a99ce){logger[_0x2707('0x11')]('GetTrigger',_0x4a99ce['message'],_0x4a8b7f);_0x4009f3(_0x119ac4[_0x2707('0x11')](0x1f4,_0x4a99ce['message']));});});};exports[_0x2707('0x1e')]=function(_0x3f153d){var _0x417a97=this;return new Promise(function(_0x36b2e9,_0x48832b){return db[_0x2707('0x1f')][_0x2707('0x20')]({'raw':_0x3f153d[_0x2707('0x16')]?_0x3f153d[_0x2707('0x16')][_0x2707('0x17')]===undefined?!![]:![]:!![],'where':_0x3f153d[_0x2707('0x16')]?_0x3f153d[_0x2707('0x16')][_0x2707('0x18')]||null:null,'attributes':_0x3f153d[_0x2707('0x16')]?_0x3f153d['options'][_0x2707('0x19')]||null:null,'include':_0x3f153d[_0x2707('0x16')]?_0x3f153d['options']['include']?_['map'](_0x3f153d['options']['include'],function(_0x137e04){return{'model':db[_0x137e04['model']],'as':_0x137e04['as'],'attributes':_0x137e04['attributes'],'include':_0x137e04[_0x2707('0x1b')]?_[_0x2707('0x21')](_0x137e04['include'],function(_0x473954){return{'model':db[_0x473954[_0x2707('0x1c')]],'as':_0x473954['as'],'attributes':_0x473954['attributes'],'include':_0x473954['include']?_[_0x2707('0x21')](_0x473954[_0x2707('0x1b')],function(_0x521edb){return{'model':db[_0x521edb['model']],'as':_0x521edb['as'],'attributes':_0x521edb[_0x2707('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2707('0x1d')](function(_0x5a18b0){logger[_0x2707('0xb')](_0x2707('0x1e'),_0x3f153d);logger[_0x2707('0xe')](_0x2707('0x1e'),_0x3f153d,JSON[_0x2707('0x10')](_0x5a18b0));_0x36b2e9(_0x5a18b0);})[_0x2707('0x14')](function(_0x5bd2e5){logger[_0x2707('0x11')](_0x2707('0x1e'),_0x5bd2e5[_0x2707('0x13')],_0x3f153d);_0x48832b(_0x417a97[_0x2707('0x11')](0x1f4,_0x5bd2e5[_0x2707('0x13')]));});});}; \ No newline at end of file +var _0xe1e3=['result','GetTrigger','options','raw','where','attributes','limit','include','model','map','debug','catch','find','ShowTrigger','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','info'];(function(_0x3f8e3a,_0x12121a){var _0x2f71bb=function(_0x3a48df){while(--_0x3a48df){_0x3f8e3a['push'](_0x3f8e3a['shift']());}};_0x2f71bb(++_0x12121a);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x2588e4,_0x6c935f){_0x2588e4=_0x2588e4-0x0;var _0x4070b0=_0xe1e3[_0x2588e4];return _0x4070b0;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var moment=require('moment');var BPromise=require(_0x3e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var config=require(_0x3e1e('0x6'));var jayson=require(_0x3e1e('0x7'));var client=jayson[_0x3e1e('0x8')][_0x3e1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55cfba,_0x1574e5,_0x13926d){return new BPromise(function(_0x2f0e12,_0xa67e35){return client[_0x3e1e('0xa')](_0x55cfba,_0x13926d)[_0x3e1e('0xb')](function(_0x5e7d1f){logger['info']('Trigger,\x20%s,\x20%s',_0x1574e5,_0x3e1e('0xc'));logger['debug'](_0x3e1e('0xd'),_0x1574e5,_0x3e1e('0xc'),JSON[_0x3e1e('0xe')](_0x5e7d1f));if(_0x5e7d1f['error']){if(_0x5e7d1f[_0x3e1e('0xf')]['code']===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x1574e5,_0x5e7d1f['error']['message']);return _0xa67e35(_0x5e7d1f[_0x3e1e('0xf')]['message']);}logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x5e7d1f[_0x3e1e('0xf')][_0x3e1e('0x11')]);return _0x2f0e12(_0x5e7d1f['error']['message']);}else{logger[_0x3e1e('0x12')](_0x3e1e('0x10'),_0x1574e5,'request\x20sent');_0x2f0e12(_0x5e7d1f[_0x3e1e('0x13')][_0x3e1e('0x11')]);}})['catch'](function(_0x11c07f){logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x11c07f);_0xa67e35(_0x11c07f);});});}exports[_0x3e1e('0x14')]=function(_0x1d786c){var _0x39eaa7=this;return new Promise(function(_0x791ed8,_0x1c181b){return db['Trigger']['findAll']({'raw':_0x1d786c['options']?_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x16')]===undefined?!![]:![]:!![],'where':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c['options'][_0x3e1e('0x17')]||null:null,'attributes':_0x1d786c['options']?_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x18')]||null:null,'limit':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c['options'][_0x3e1e('0x19')]||null:null,'include':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c[_0x3e1e('0x15')]['include']?_['map'](_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x1a')],function(_0x488f9f){return{'model':db[_0x488f9f[_0x3e1e('0x1b')]],'as':_0x488f9f['as'],'attributes':_0x488f9f[_0x3e1e('0x18')],'include':_0x488f9f[_0x3e1e('0x1a')]?_[_0x3e1e('0x1c')](_0x488f9f[_0x3e1e('0x1a')],function(_0x159212){return{'model':db[_0x159212[_0x3e1e('0x1b')]],'as':_0x159212['as'],'attributes':_0x159212[_0x3e1e('0x18')],'include':_0x159212['include']?_['map'](_0x159212[_0x3e1e('0x1a')],function(_0x541ef1){return{'model':db[_0x541ef1['model']],'as':_0x541ef1['as'],'attributes':_0x541ef1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a33bb){logger[_0x3e1e('0x12')]('GetTrigger',_0x1d786c);logger[_0x3e1e('0x1d')]('GetTrigger',_0x1d786c,JSON[_0x3e1e('0xe')](_0x1a33bb));_0x791ed8(_0x1a33bb);})[_0x3e1e('0x1e')](function(_0x53a6ff){logger[_0x3e1e('0xf')](_0x3e1e('0x14'),_0x53a6ff[_0x3e1e('0x11')],_0x1d786c);_0x1c181b(_0x39eaa7['error'](0x1f4,_0x53a6ff[_0x3e1e('0x11')]));});});};exports['ShowTrigger']=function(_0x591c36){var _0x494c75=this;return new Promise(function(_0x39da8d,_0x5b8f95){return db['Trigger'][_0x3e1e('0x1f')]({'raw':_0x591c36[_0x3e1e('0x15')]?_0x591c36[_0x3e1e('0x15')][_0x3e1e('0x16')]===undefined?!![]:![]:!![],'where':_0x591c36[_0x3e1e('0x15')]?_0x591c36['options']['where']||null:null,'attributes':_0x591c36['options']?_0x591c36['options'][_0x3e1e('0x18')]||null:null,'include':_0x591c36[_0x3e1e('0x15')]?_0x591c36[_0x3e1e('0x15')][_0x3e1e('0x1a')]?_[_0x3e1e('0x1c')](_0x591c36[_0x3e1e('0x15')][_0x3e1e('0x1a')],function(_0x431bd5){return{'model':db[_0x431bd5['model']],'as':_0x431bd5['as'],'attributes':_0x431bd5[_0x3e1e('0x18')],'include':_0x431bd5[_0x3e1e('0x1a')]?_['map'](_0x431bd5[_0x3e1e('0x1a')],function(_0x3f4ef3){return{'model':db[_0x3f4ef3[_0x3e1e('0x1b')]],'as':_0x3f4ef3['as'],'attributes':_0x3f4ef3[_0x3e1e('0x18')],'include':_0x3f4ef3['include']?_['map'](_0x3f4ef3[_0x3e1e('0x1a')],function(_0x332f1e){return{'model':db[_0x332f1e['model']],'as':_0x332f1e['as'],'attributes':_0x332f1e[_0x3e1e('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3e1e('0xb')](function(_0x4e9acd){logger[_0x3e1e('0x12')](_0x3e1e('0x20'),_0x591c36);logger[_0x3e1e('0x1d')](_0x3e1e('0x20'),_0x591c36,JSON[_0x3e1e('0xe')](_0x4e9acd));_0x39da8d(_0x4e9acd);})['catch'](function(_0x1da527){logger[_0x3e1e('0xf')](_0x3e1e('0x20'),_0x1da527[_0x3e1e('0x11')],_0x591c36);_0x5b8f95(_0x494c75['error'](0x1f4,_0x1da527[_0x3e1e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 474f17a..22b6f51 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 _0x4c4e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','/:id/clone','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x4c4e,0x152));var _0xe4c4=function(_0x1cc76c,_0x7a2e86){_0x1cc76c=_0x1cc76c-0x0;var _0x5141d6=_0x4c4e[_0x1cc76c];return _0x5141d6;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var auth=require(_0xe4c4('0x4'));var interaction=require(_0xe4c4('0x5'));var config=require(_0xe4c4('0x6'));var controller=require('./trunk.controller');router[_0xe4c4('0x7')]('/',auth['isAuthenticated'](),controller[_0xe4c4('0x8')]);router[_0xe4c4('0x7')](_0xe4c4('0x9'),auth[_0xe4c4('0xa')](),controller[_0xe4c4('0xb')]);router[_0xe4c4('0xc')](_0xe4c4('0xd'),auth[_0xe4c4('0xa')](),controller['clone']);router['post']('/',auth[_0xe4c4('0xa')](),controller[_0xe4c4('0xe')]);router[_0xe4c4('0xf')](_0xe4c4('0x9'),auth[_0xe4c4('0xa')](),controller[_0xe4c4('0x10')]);router['delete'](_0xe4c4('0x9'),auth[_0xe4c4('0xa')](),controller[_0xe4c4('0x11')]);module[_0xe4c4('0x12')]=router; \ No newline at end of file +var _0xa8a8=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone'];(function(_0x34988b,_0x25f421){var _0x5ebdc7=function(_0x21471c){while(--_0x21471c){_0x34988b['push'](_0x34988b['shift']());}};_0x5ebdc7(++_0x25f421);}(_0xa8a8,0xec));var _0x8a8a=function(_0x378964,_0x4b73db){_0x378964=_0x378964-0x0;var _0x10ba94=_0xa8a8[_0x378964];return _0x10ba94;};'use strict';var multer=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var timeout=require(_0x8a8a('0x3'));var express=require('express');var router=express[_0x8a8a('0x4')]();var auth=require(_0x8a8a('0x5'));var interaction=require(_0x8a8a('0x6'));var config=require(_0x8a8a('0x7'));var controller=require(_0x8a8a('0x8'));router[_0x8a8a('0x9')]('/',auth[_0x8a8a('0xa')](),controller[_0x8a8a('0xb')]);router[_0x8a8a('0x9')](_0x8a8a('0xc'),auth[_0x8a8a('0xa')](),controller[_0x8a8a('0xd')]);router[_0x8a8a('0xe')](_0x8a8a('0xf'),auth[_0x8a8a('0xa')](),controller['clone']);router['post']('/',auth[_0x8a8a('0xa')](),controller['create']);router[_0x8a8a('0x10')](_0x8a8a('0xc'),auth['isAuthenticated'](),controller[_0x8a8a('0x11')]);router[_0x8a8a('0x12')](_0x8a8a('0xc'),auth['isAuthenticated'](),controller[_0x8a8a('0x13')]);module[_0x8a8a('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index de2ea60..b61cc30 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 _0x9fff=['transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','join','getDataValue','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\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','refuse','originate','uac','uas','pai','fingerprint','certificate','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','user','peer','friend','from-voip-provider','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue'];(function(_0xfd864a,_0x2cb201){var _0x26765a=function(_0x3a4278){while(--_0x3a4278){_0xfd864a['push'](_0xfd864a['shift']());}};_0x26765a(++_0x2cb201);}(_0x9fff,0x90));var _0xf9ff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9fff[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf9ff('0x0'));module[_0xf9ff('0x1')]={'name':{'type':Sequelize[_0xf9ff('0x2')],'allowNull':![],'unique':_0xf9ff('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0xf9ff('0x4'),_0xf9ff('0x5')),'allowNull':![],'defaultValue':_0xf9ff('0x6')},'context':{'type':Sequelize[_0xf9ff('0x2')],'allowNull':![],'defaultValue':_0xf9ff('0x7')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0xf9ff('0x8'),'ALLOWED',_0xf9ff('0x9'),_0xf9ff('0xa'),_0xf9ff('0xb'),_0xf9ff('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xf9ff('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xf9ff('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xf9ff('0x2')],'defaultValue':_0xf9ff('0xd'),'set':function(_0x13d76c){this[_0xf9ff('0xe')](_0xf9ff('0xf'),_0x13d76c?_0x13d76c['join'](','):null);},'get':function(){return this['getDataValue']('transport')?this['getDataValue'](_0xf9ff('0xf'))['split'](','):null;},'comment':_0xf9ff('0x10')},'dtmfmode':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x12'),_0xf9ff('0x13'),'shortinfo',_0xf9ff('0x14'),_0xf9ff('0x15')),'defaultValue':_0xf9ff('0x12')},'directmedia':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no',_0xf9ff('0x17'),_0xf9ff('0x18'),_0xf9ff('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf9ff('0x2')]},'directmediadeny':{'type':Sequelize[_0xf9ff('0x2')]},'nat':{'type':Sequelize[_0xf9ff('0x2')],'defaultValue':_0xf9ff('0x1a'),'set':function(_0x45391d){this[_0xf9ff('0xe')](_0xf9ff('0x1b'),_0x45391d?_0x45391d[_0xf9ff('0x1c')](','):null);},'get':function(){return this[_0xf9ff('0x1d')](_0xf9ff('0x1b'))?this[_0xf9ff('0x1d')](_0xf9ff('0x1b'))[_0xf9ff('0x1e')](','):null;},'comment':_0xf9ff('0x1f')},'callgroup':{'type':Sequelize[_0xf9ff('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xf9ff('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xf9ff('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xf9ff('0x2')],'defaultValue':_0xf9ff('0x20')},'allow':{'type':Sequelize[_0xf9ff('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x513e07){this[_0xf9ff('0xe')]('allow',_0x513e07?_0x513e07[_0xf9ff('0x1c')](';'):_0xf9ff('0x21'));},'get':function(){return this[_0xf9ff('0x1d')](_0xf9ff('0x22'))?this[_0xf9ff('0x1d')](_0xf9ff('0x22'))['split'](';'):null;},'comment':_0xf9ff('0x23')},'autoframing':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xf9ff('0x24'),'set':function(_0x163837){this[_0xf9ff('0xe')](_0xf9ff('0x25'),_0x163837?_0x163837[_0xf9ff('0x1c')](','):null);},'get':function(){return this[_0xf9ff('0x1d')](_0xf9ff('0x25'))?this['getDataValue'](_0xf9ff('0x25'))[_0xf9ff('0x1e')](','):null;},'comment':_0xf9ff('0x26')},'trustrpid':{'type':Sequelize['ENUM'](_0xf9ff('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no',_0xf9ff('0x27'))},'promiscredir':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xf9ff('0x16'),'no')},'accountcode':{'type':Sequelize[_0xf9ff('0x28')](0xb)},'setvar':{'type':Sequelize[_0xf9ff('0x2')]},'callerid':{'type':Sequelize[_0xf9ff('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no'),'defaultValue':_0xf9ff('0x16')},'busylevel':{'type':Sequelize[_0xf9ff('0x28')](0xb)},'allowoverlap':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xf9ff('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xf9ff('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0xf9ff('0x2')]},'template':{'type':Sequelize[_0xf9ff('0x2')]},'videosupport':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no',_0xf9ff('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no')},'mailbox':{'type':Sequelize[_0xf9ff('0x2')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xf9ff('0x2a'),_0xf9ff('0x2b'))},'session_expires':{'type':Sequelize[_0xf9ff('0x28')](0xb)},'session_minse':{'type':Sequelize[_0xf9ff('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x2c'),_0xf9ff('0x2d')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xf9ff('0x2')]},'regexten':{'type':Sequelize[_0xf9ff('0x2')]},'fromdomain':{'type':Sequelize[_0xf9ff('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf9ff('0x28')](0x5)},'qualify':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no'),'defaultValue':_0xf9ff('0x16')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xf9ff('0x2')]},'defaultuser':{'type':Sequelize[_0xf9ff('0x2')]},'rtptimeout':{'type':Sequelize[_0xf9ff('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xf9ff('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xf9ff('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no',_0xf9ff('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf9ff('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xf9ff('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xf9ff('0x2')]},'contactdeny':{'type':Sequelize[_0xf9ff('0x2')]},'contactacl':{'type':Sequelize[_0xf9ff('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xf9ff('0x2')]},'use_q850_reason':{'type':Sequelize[_0xf9ff('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf9ff('0x11')]('yes','no')},'force_avp':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no')},'icesupport':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xf9ff('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no',_0xf9ff('0x2f'),_0xf9ff('0x30'))},'dtlsrekey':{'type':Sequelize[_0xf9ff('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0xf9ff('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xf9ff('0x2')]},'dtlscipher':{'type':Sequelize[_0xf9ff('0x2')]},'dtlscafile':{'type':Sequelize[_0xf9ff('0x2')]},'dtlscapath':{'type':Sequelize[_0xf9ff('0x2')]},'dtlssetup':{'type':Sequelize[_0xf9ff('0x11')]('active','passive',_0xf9ff('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf9ff('0x2')]},'usereqphone':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xf9ff('0x2')]},'call_limit':{'type':Sequelize[_0xf9ff('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0xf9ff('0x11')]('yes','no')},'vmexten':{'type':Sequelize[_0xf9ff('0x2')]},'mohinterpret':{'type':Sequelize[_0xf9ff('0x2')]},'mohsuggest':{'type':Sequelize[_0xf9ff('0x2')]},'parkinglot':{'type':Sequelize[_0xf9ff('0x2')]},'description':{'type':Sequelize[_0xf9ff('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xf9ff('0x32')},'canreinvite':{'type':Sequelize[_0xf9ff('0x11')](_0xf9ff('0x16'),'no',_0xf9ff('0x17'),'update',_0xf9ff('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xf9ff('0x2')]},'otherFields':{'type':Sequelize[_0xf9ff('0x2')]},'active':{'type':Sequelize[_0xf9ff('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x115f=['nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','name','ENUM','friend','user','peer','STRING','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','yes','nonat','update','force_rport,comedia'];(function(_0x1e6179,_0x2777a9){var _0x135ee3=function(_0x594b61){while(--_0x594b61){_0x1e6179['push'](_0x1e6179['shift']());}};_0x135ee3(++_0x2777a9);}(_0x115f,0x175));var _0xf115=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x115f[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0xf115('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf115('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x3'),_0xf115('0x4'),_0xf115('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xf115('0x6')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x7'),_0xf115('0x8'),'ALLOWED_FAILED_SCREEN',_0xf115('0x9'),'PROHIB_NOT_SCREENED',_0xf115('0xa'),_0xf115('0xb'),_0xf115('0xc'))},'deny':{'type':Sequelize[_0xf115('0x6')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xf115('0x6')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xf115('0x6')],'defaultValue':_0xf115('0xd'),'set':function(_0x2b4007){this[_0xf115('0xe')](_0xf115('0xf'),_0x2b4007?_0x2b4007[_0xf115('0x10')](','):null);},'get':function(){return this[_0xf115('0x11')](_0xf115('0xf'))?this['getDataValue'](_0xf115('0xf'))[_0xf115('0x12')](','):null;},'comment':_0xf115('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0xf115('0x14'),_0xf115('0x15'),_0xf115('0x16'),'inband','auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0xf115('0x17'),'no',_0xf115('0x18'),_0xf115('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf115('0x6')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0xf115('0x1a'),'set':function(_0xaab9b7){this[_0xf115('0xe')](_0xf115('0x1b'),_0xaab9b7?_0xaab9b7[_0xf115('0x10')](','):null);},'get':function(){return this[_0xf115('0x11')](_0xf115('0x1b'))?this[_0xf115('0x11')](_0xf115('0x1b'))[_0xf115('0x12')](','):null;},'comment':_0xf115('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xf115('0x6')]},'pickupgroup':{'type':Sequelize[_0xf115('0x6')]},'namedpickupgroup':{'type':Sequelize[_0xf115('0x6')]},'language':{'type':Sequelize[_0xf115('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf115('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0xf115('0x6')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x566752){this['setDataValue'](_0xf115('0x1d'),_0x566752?_0x566752[_0xf115('0x10')](';'):_0xf115('0x1e'));},'get':function(){return this['getDataValue'](_0xf115('0x1d'))?this['getDataValue'](_0xf115('0x1d'))[_0xf115('0x12')](';'):null;},'comment':_0xf115('0x1f')},'autoframing':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no')},'insecure':{'type':Sequelize[_0xf115('0x6')],'defaultValue':'port,invite','set':function(_0x1d652e){this[_0xf115('0xe')](_0xf115('0x20'),_0x1d652e?_0x1d652e[_0xf115('0x10')](','):null);},'get':function(){return this[_0xf115('0x11')]('insecure')?this['getDataValue'](_0xf115('0x20'))['split'](','):null;},'comment':_0xf115('0x21')},'trustrpid':{'type':Sequelize[_0xf115('0x2')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xf115('0x17'),'no','never')},'promiscredir':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no')},'useclientcode':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no')},'accountcode':{'type':Sequelize[_0xf115('0x22')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xf115('0x23')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xf115('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0xf115('0x2')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0xf115('0x6')]},'videosupport':{'type':Sequelize[_0xf115('0x2')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf115('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xf115('0x2')]('yes','no')},'mailbox':{'type':Sequelize[_0xf115('0x6')]},'session_timers':{'type':Sequelize['ENUM'](_0xf115('0x24'),_0xf115('0x25'),_0xf115('0x26'))},'session_expires':{'type':Sequelize[_0xf115('0x22')](0xb)},'session_minse':{'type':Sequelize[_0xf115('0x22')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xf115('0x27'),_0xf115('0x28')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xf115('0x6')]},'fromdomain':{'type':Sequelize[_0xf115('0x6')]},'fromuser':{'type':Sequelize[_0xf115('0x6')]},'port':{'type':Sequelize[_0xf115('0x22')](0x5)},'qualify':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no'),'defaultValue':_0xf115('0x17')},'keepalive':{'type':Sequelize[_0xf115('0x22')](0xb)},'defaultip':{'type':Sequelize[_0xf115('0x6')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xf115('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xf115('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no',_0xf115('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf115('0x6')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xf115('0x22')](0xb)},'timerb':{'type':Sequelize[_0xf115('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0xf115('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0xf115('0x6')]},'contactdeny':{'type':Sequelize[_0xf115('0x6')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xf115('0x22')](0xb)},'encryption':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no')},'force_avp':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xf115('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0xf115('0x2')]('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xf115('0x17'),'no',_0xf115('0x2a'),_0xf115('0x2b'))},'dtlsrekey':{'type':Sequelize[_0xf115('0x22')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xf115('0x6')]},'dtlscipher':{'type':Sequelize[_0xf115('0x6')]},'dtlscafile':{'type':Sequelize[_0xf115('0x6')]},'dtlscapath':{'type':Sequelize[_0xf115('0x6')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xf115('0x2c'),_0xf115('0x2d'),_0xf115('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf115('0x6')]},'usereqphone':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xf115('0x6')]},'recordofffeature':{'type':Sequelize[_0xf115('0x6')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xf115('0x17'),'no')},'vmexten':{'type':Sequelize[_0xf115('0x6')]},'mohinterpret':{'type':Sequelize[_0xf115('0x6')]},'mohsuggest':{'type':Sequelize[_0xf115('0x6')]},'parkinglot':{'type':Sequelize[_0xf115('0x6')]},'description':{'type':Sequelize[_0xf115('0x6')]},'host':{'type':Sequelize[_0xf115('0x6')],'defaultValue':_0xf115('0x2f')},'canreinvite':{'type':Sequelize[_0xf115('0x2')](_0xf115('0x17'),'no',_0xf115('0x18'),_0xf115('0x19'),_0xf115('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xf115('0x6')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xf115('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index bfa1281..7d8c599 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 _0x30a0=['limit','status','Content-Range','apply','reject','update','destroy','Trunks','UserProfileResource','name','send','map','Trunk','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','catch','show','keys','intersection','includeAll','merge','clone','params','find','get','omit','updatedAt','body','createdAt','create','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','join','server/files/templates/trunk.ejs','Reload','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','sendStatus','end','json','count','offset'];(function(_0x3a0fec,_0x3a4380){var _0x214f18=function(_0x5f292e){while(--_0x5f292e){_0x3a0fec['push'](_0x3a0fec['shift']());}};_0x214f18(++_0x3a4380);}(_0x30a0,0x19b));var _0x030a=function(_0x27d1e7,_0x2b450f){_0x27d1e7=_0x27d1e7-0x0;var _0x185341=_0x30a0[_0x27d1e7];return _0x185341;};'use strict';var pdf=require(_0x030a('0x0'));var emlformat=require(_0x030a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x030a('0x2'));var jsonpatch=require(_0x030a('0x3'));var rp=require(_0x030a('0x4'));var moment=require(_0x030a('0x5'));var BPromise=require(_0x030a('0x6'));var Mustache=require(_0x030a('0x7'));var util=require('util');var path=require(_0x030a('0x8'));var sox=require(_0x030a('0x9'));var csv=require(_0x030a('0xa'));var ejs=require(_0x030a('0xb'));var fs=require('fs');var _=require(_0x030a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x030a('0xd'));var deskjs=require(_0x030a('0xe'));var toCsv=require(_0x030a('0xa'));var querystring=require(_0x030a('0xf'));var Papa=require('papaparse');var Redis=require(_0x030a('0x10'));var authService=require(_0x030a('0x11'));var qs=require(_0x030a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x030a('0x13'));var logger=require('../../config/logger')(_0x030a('0x14'));var utils=require('../../config/utils');var config=require(_0x030a('0x15'));var db=require(_0x030a('0x16'))['db'];var jayson=require(_0x030a('0x17'));var client=jayson[_0x030a('0x18')][_0x030a('0x19')]({'port':0x232a});function checkPasswordPattern(_0x162561,_0x131694,_0x2452cc){if(_0x2452cc){var _0x29f225=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x29f225[_0x030a('0x1a')](_0x131694)){return _0x162561;}else{throw new db[(_0x030a('0x1b'))][(_0x030a('0x1c'))](_0x030a('0x1d'));}}else{return _0x162561;}}function respondWithRpcPromise(_0x1b23de,_0x35db9b,_0x2365c1,_0xd4b125){return new BPromise(function(_0xd05e67,_0x305407){var _0x213a53=_0xd4b125||client;return _0x213a53[_0x030a('0x1e')](_0x1b23de,_0x2365c1)[_0x030a('0x1f')](function(_0x3698d2){logger['info'](_0x030a('0x20'),_0x35db9b,_0x030a('0x21'));logger[_0x030a('0x22')](_0x030a('0x23'),_0x35db9b,'request\x20sent',JSON[_0x030a('0x24')](_0x3698d2));if(_0x3698d2[_0x030a('0x25')]){if(_0x3698d2['error']['code']===0x1f4){logger['error'](_0x030a('0x20'),_0x35db9b,_0x3698d2['error']['message']);return _0x305407(_0x3698d2[_0x030a('0x25')][_0x030a('0x26')]);}logger[_0x030a('0x25')](_0x030a('0x20'),_0x35db9b,_0x3698d2[_0x030a('0x25')]['message']);return _0xd05e67(_0x3698d2['error'][_0x030a('0x26')]);}else{logger[_0x030a('0x27')](_0x030a('0x20'),_0x35db9b,_0x030a('0x21'));_0xd05e67(_0x3698d2['result'][_0x030a('0x26')]);}})['catch'](function(_0xcdd2ac){logger[_0x030a('0x25')]('Trunk,\x20%s,\x20%s',_0x35db9b,_0xcdd2ac);_0x305407(_0xcdd2ac);});});}function respondWithStatusCode(_0x469fe5,_0xb559f8){_0xb559f8=_0xb559f8||0xcc;return function(_0x195390){if(_0x195390){return _0x469fe5[_0x030a('0x28')](_0xb559f8);}return _0x469fe5['status'](_0xb559f8)[_0x030a('0x29')]();};}function respondWithResult(_0x179169,_0x19cdb3){_0x19cdb3=_0x19cdb3||0xc8;return function(_0x228beb){if(_0x228beb){return _0x179169['status'](_0x19cdb3)[_0x030a('0x2a')](_0x228beb);}};}function respondWithFilteredResult(_0x4b2f80,_0x13c408){return function(_0x1c7075){if(_0x1c7075){var _0x4da8b6=_0x1c7075[_0x030a('0x2b')],_0x1c0eda=_0x13c408[_0x030a('0x2c')],_0x201089=_0x13c408[_0x030a('0x2c')]+_0x13c408[_0x030a('0x2d')],_0x4e3020;if(_0x201089>=_0x4da8b6){_0x201089=_0x4da8b6;_0x4e3020=0xc8;}else{_0x4e3020=0xce;}_0x4b2f80[_0x030a('0x2e')](_0x4e3020);return _0x4b2f80['set'](_0x030a('0x2f'),_0x1c0eda+'-'+_0x201089+'/'+_0x4da8b6)[_0x030a('0x2a')](_0x1c7075);}return null;};}function patchUpdates(_0xef9f21){return function(_0x561966){try{jsonpatch[_0x030a('0x30')](_0x561966,_0xef9f21,!![]);}catch(_0x22df6b){return BPromise[_0x030a('0x31')](_0x22df6b);}return _0x561966['save']();};}function saveUpdates(_0x339f82,_0xfb782f){return function(_0x497e3d){if(_0x497e3d){return _0x497e3d[_0x030a('0x32')](_0x339f82)[_0x030a('0x1f')](function(_0x529629){return _0x529629;});}return null;};}function removeEntity(_0x5afbe6,_0x334367){return function(_0x51172e){if(_0x51172e){return _0x51172e[_0x030a('0x33')]()[_0x030a('0x1f')](function(){var _0x440b45=_0x51172e['get']({'plain':!![]});var _0x477be2=_0x030a('0x34');return db[_0x030a('0x35')][_0x030a('0x33')]({'where':{'type':_0x477be2,'resourceId':_0x440b45['id']}})[_0x030a('0x1f')](function(){return _0x51172e;});})['then'](function(){_0x5afbe6['status'](0xcc)[_0x030a('0x29')]();});}};}function handleEntityNotFound(_0x464b12,_0x142cc5){return function(_0x255c3a){if(!_0x255c3a){_0x464b12[_0x030a('0x28')](0x194);}return _0x255c3a;};}function handleError(_0x2dee74,_0x8d9366){_0x8d9366=_0x8d9366||0x1f4;return function(_0x366037){logger[_0x030a('0x25')](_0x366037['stack']);if(_0x366037[_0x030a('0x36')]){delete _0x366037[_0x030a('0x36')];}_0x2dee74[_0x030a('0x2e')](_0x8d9366)[_0x030a('0x37')](_0x366037);};}exports['index']=function(_0x1d91cb,_0x2031a8){var _0x5a8617={},_0x28af38={},_0x3ddc40={'count':0x0,'rows':[]};var _0x669f10=_[_0x030a('0x38')](db[_0x030a('0x39')][_0x030a('0x3a')],function(_0x42a19b){return{'name':_0x42a19b[_0x030a('0x3b')],'type':_0x42a19b[_0x030a('0x3c')][_0x030a('0x3d')]};});_0x28af38[_0x030a('0x3e')]=_[_0x030a('0x38')](_0x669f10,_0x030a('0x36'));_0x28af38[_0x030a('0x3f')]=_['keys'](_0x1d91cb[_0x030a('0x3f')]);_0x28af38[_0x030a('0x40')]=_['intersection'](_0x28af38[_0x030a('0x3e')],_0x28af38['query']);_0x5a8617[_0x030a('0x41')]=_['intersection'](_0x28af38[_0x030a('0x3e')],qs[_0x030a('0x42')](_0x1d91cb[_0x030a('0x3f')][_0x030a('0x42')]));_0x5a8617[_0x030a('0x41')]=_0x5a8617[_0x030a('0x41')][_0x030a('0x43')]?_0x5a8617[_0x030a('0x41')]:_0x28af38[_0x030a('0x3e')];if(!_0x1d91cb[_0x030a('0x3f')][_0x030a('0x44')](_0x030a('0x45'))){_0x5a8617[_0x030a('0x2d')]=qs[_0x030a('0x2d')](_0x1d91cb[_0x030a('0x3f')][_0x030a('0x2d')]);_0x5a8617[_0x030a('0x2c')]=qs[_0x030a('0x2c')](_0x1d91cb['query'][_0x030a('0x2c')]);}_0x5a8617[_0x030a('0x46')]=qs[_0x030a('0x47')](_0x1d91cb[_0x030a('0x3f')][_0x030a('0x47')]);_0x5a8617[_0x030a('0x48')]=qs[_0x030a('0x40')](_[_0x030a('0x49')](_0x1d91cb[_0x030a('0x3f')],_0x28af38[_0x030a('0x40')]));if(_0x1d91cb[_0x030a('0x3f')][_0x030a('0x4a')]){_0x5a8617[_0x030a('0x48')]=_['merge'](_0x5a8617[_0x030a('0x48')],{'$or':_[_0x030a('0x38')](_0x669f10,function(_0x373973){if(_0x373973[_0x030a('0x3c')]!==_0x030a('0x4b')){var _0x48fc55={};_0x48fc55[_0x373973[_0x030a('0x36')]]={'$like':'%'+_0x1d91cb['query'][_0x030a('0x4a')]+'%'};return _0x48fc55;}})});}_0x5a8617=_['merge']({},_0x5a8617,_0x1d91cb[_0x030a('0x4c')]);var _0x1e9985={'where':_0x5a8617[_0x030a('0x48')]};return db[_0x030a('0x39')][_0x030a('0x2b')](_0x1e9985)[_0x030a('0x1f')](function(_0xe9b627){_0x3ddc40[_0x030a('0x2b')]=_0xe9b627;if(_0x1d91cb[_0x030a('0x3f')]['includeAll']){_0x5a8617[_0x030a('0x4d')]=[{'all':!![]}];}return db[_0x030a('0x39')][_0x030a('0x4e')](_0x5a8617);})[_0x030a('0x1f')](function(_0x59c0c0){_0x3ddc40['rows']=_0x59c0c0;return _0x3ddc40;})[_0x030a('0x1f')](respondWithFilteredResult(_0x2031a8,_0x5a8617))[_0x030a('0x4f')](handleError(_0x2031a8,null));};exports[_0x030a('0x50')]=function(_0x3877aa,_0x27b4e1){var _0x5615d8={'raw':![],'where':{'id':_0x3877aa['params']['id']}},_0x2099a0={};_0x2099a0[_0x030a('0x3e')]=_[_0x030a('0x51')](db[_0x030a('0x39')][_0x030a('0x3a')]);_0x2099a0[_0x030a('0x3f')]=_[_0x030a('0x51')](_0x3877aa[_0x030a('0x3f')]);_0x2099a0[_0x030a('0x40')]=_[_0x030a('0x52')](_0x2099a0[_0x030a('0x3e')],_0x2099a0['query']);_0x5615d8[_0x030a('0x41')]=_[_0x030a('0x52')](_0x2099a0[_0x030a('0x3e')],qs[_0x030a('0x42')](_0x3877aa['query'][_0x030a('0x42')]));_0x5615d8[_0x030a('0x41')]=_0x5615d8[_0x030a('0x41')][_0x030a('0x43')]?_0x5615d8[_0x030a('0x41')]:_0x2099a0[_0x030a('0x3e')];if(_0x3877aa[_0x030a('0x3f')][_0x030a('0x53')]){_0x5615d8[_0x030a('0x4d')]=[{'all':!![]}];}_0x5615d8=_[_0x030a('0x54')]({},_0x5615d8,_0x3877aa[_0x030a('0x4c')]);return db[_0x030a('0x39')]['find'](_0x5615d8)[_0x030a('0x1f')](handleEntityNotFound(_0x27b4e1,null))[_0x030a('0x1f')](respondWithResult(_0x27b4e1,null))['catch'](handleError(_0x27b4e1,null));};exports[_0x030a('0x55')]=function(_0x5bff57,_0x4bad70){var _0x34dca8={'where':{'id':_0x5bff57[_0x030a('0x56')]['id']}},_0x2170b3={};_0x2170b3['model']=_[_0x030a('0x51')](db[_0x030a('0x39')][_0x030a('0x3a')]);_0x34dca8[_0x030a('0x41')]=_[_0x030a('0x52')](_0x2170b3['model'],qs['fields'](_0x5bff57[_0x030a('0x3f')]['fields']));_0x34dca8[_0x030a('0x41')]=_0x34dca8['attributes'][_0x030a('0x43')]?_0x34dca8[_0x030a('0x41')]:_0x2170b3[_0x030a('0x3e')];if(_0x5bff57[_0x030a('0x3f')][_0x030a('0x53')]){_0x34dca8['include']=[{'all':!![]}];}_0x34dca8=_[_0x030a('0x54')]({},_0x34dca8,_0x5bff57['options']);return db[_0x030a('0x39')][_0x030a('0x57')](_0x34dca8)[_0x030a('0x1f')](handleEntityNotFound(_0x4bad70,null))[_0x030a('0x1f')](function(_0x2a0644){if(_0x2a0644){var _0x717226=_0x2a0644[_0x030a('0x58')]({'plain':!![]});_0x717226=qs[_0x030a('0x59')](_0x717226,['id','createdAt',_0x030a('0x5a')]);_0x5bff57[_0x030a('0x5b')]=_['omit'](_0x5bff57[_0x030a('0x5b')],['id',_0x030a('0x5c'),_0x030a('0x5a')]);return db['Trunk'][_0x030a('0x5d')](_[_0x030a('0x54')](_0x717226,_0x5bff57[_0x030a('0x5b')]),{'include':_0x5bff57[_0x030a('0x3f')][_0x030a('0x53')]?[{'all':!![]}]:undefined})[_0x030a('0x1f')](function(_0x40b7c2){var _0x26c095=_0x5bff57[_0x030a('0x5e')][_0x030a('0x58')]({'plain':!![]});if(!_0x26c095)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26c095['role']===_0x030a('0x5e')){var _0x52f57f=_0x40b7c2[_0x030a('0x58')]({'plain':!![]});var _0x6e6d1e=_0x030a('0x34');return db['UserProfileSection'][_0x030a('0x57')]({'where':{'name':_0x6e6d1e,'userProfileId':_0x26c095['userProfileId']},'raw':!![]})[_0x030a('0x1f')](function(_0x310a7d){if(_0x310a7d&&_0x310a7d[_0x030a('0x5f')]===0x0){return db[_0x030a('0x35')]['create']({'name':_0x52f57f['name'],'resourceId':_0x52f57f['id'],'type':_0x310a7d[_0x030a('0x36')],'sectionId':_0x310a7d['id']},{})[_0x030a('0x1f')](function(){return _0x40b7c2;});}else{return _0x40b7c2;}})['catch'](function(_0x1c3f72){logger['error'](_0x030a('0x60'),_0x1c3f72);throw _0x1c3f72;});}return _0x40b7c2;});}})[_0x030a('0x1f')](respondWithResult(_0x4bad70,0xc9))[_0x030a('0x4f')](handleError(_0x4bad70,null));};exports[_0x030a('0x5d')]=function(_0x5db328,_0x4be77c,_0x49f099){var _0x127f24;return db[_0x030a('0x39')]['create'](_0x5db328['body'],{'raw':!![]})[_0x030a('0x1f')](function(_0xa05e11){_0x127f24=_0xa05e11;return db[_0x030a('0x39')]['findAll']({'raw':!![]});})[_0x030a('0x1f')](function(_0x4036c4){var _0x20aee5=fs[_0x030a('0x61')](path['join'](config[_0x030a('0x62')],'server/files/templates/trunk.ejs'),_0x030a('0x63'));var _0x3a1f7e=fs[_0x030a('0x61')](path['join'](config[_0x030a('0x62')],'server/files/templates/registry.ejs'),_0x030a('0x63'));var _0x1bfb0a=ejs[_0x030a('0x64')](_0x20aee5,{'trunks':_0x4036c4||[]});fs[_0x030a('0x65')](_0x030a('0x66'),_0x1bfb0a);if(_0x127f24[_0x030a('0x67')]){var _0x186b78=ejs[_0x030a('0x64')](_0x3a1f7e,{'trunks':_0x4036c4||[]});fs[_0x030a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x186b78);}})[_0x030a('0x1f')](function(){return respondWithRpcPromise('Reload',_0x030a('0x5d'),{'module':_0x030a('0x68')});})['then'](function(){var _0x10d1e8=_0x5db328[_0x030a('0x5e')][_0x030a('0x58')]({'plain':!![]});if(!_0x10d1e8)throw new Error(_0x030a('0x69'));if(_0x10d1e8[_0x030a('0x6a')]===_0x030a('0x5e')){var _0x479c0b=_0x127f24['get']({'plain':!![]});return db[_0x030a('0x6b')][_0x030a('0x57')]({'where':{'name':_0x030a('0x34'),'userProfileId':_0x10d1e8[_0x030a('0x6c')]},'raw':!![]})['then'](function(_0x21c08f){if(_0x21c08f&&_0x21c08f[_0x030a('0x5f')]===0x0){return db['UserProfileResource']['create']({'name':_0x479c0b['name'],'resourceId':_0x479c0b['id'],'type':_0x21c08f['name'],'sectionId':_0x21c08f['id']},{})[_0x030a('0x1f')](function(){return _0x127f24;});}else{return _0x127f24;}})['catch'](function(_0x4530bc){logger['error'](_0x030a('0x60'),_0x4530bc);throw _0x4530bc;});}return _0x127f24;})['then'](respondWithResult(_0x4be77c,0xc9))[_0x030a('0x4f')](handleError(_0x4be77c,null));};exports['update']=function(_0x4ef34a,_0x494e74,_0xcf6b0b){var _0x36f928;return db[_0x030a('0x39')][_0x030a('0x57')]({'where':{'id':_0x4ef34a[_0x030a('0x56')]['id']}})[_0x030a('0x1f')](handleEntityNotFound(_0x494e74,null))[_0x030a('0x1f')](saveUpdates(_0x4ef34a[_0x030a('0x5b')],null))[_0x030a('0x1f')](function(_0x4648f0){if(_0x4648f0){_0x36f928=_0x4648f0;return db[_0x030a('0x39')][_0x030a('0x4e')]({'raw':!![]});}})[_0x030a('0x1f')](function(_0x4f1d2e){if(_0x4f1d2e){var _0xdb192e=fs[_0x030a('0x61')](path[_0x030a('0x6d')](config[_0x030a('0x62')],_0x030a('0x6e')),_0x030a('0x63'));var _0x53e139=fs[_0x030a('0x61')](path[_0x030a('0x6d')](config[_0x030a('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x5743a3=ejs[_0x030a('0x64')](_0xdb192e,{'trunks':_0x4f1d2e||[]});fs[_0x030a('0x65')](_0x030a('0x66'),_0x5743a3);var _0x548f23=ejs[_0x030a('0x64')](_0x53e139,{'trunks':_0x4f1d2e||[]});fs[_0x030a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x548f23);return respondWithRpcPromise(_0x030a('0x6f'),_0x030a('0x32'),{'module':_0x030a('0x68')});}return null;})[_0x030a('0x1f')](function(_0x441f80){if(_0x441f80){return _0x36f928;}})['then'](respondWithResult(_0x494e74,null))[_0x030a('0x4f')](handleError(_0x494e74,null));};exports[_0x030a('0x33')]=function(_0x1d849f,_0x280401,_0x594ead){var _0x4260a1;return db[_0x030a('0x39')][_0x030a('0x57')]({'where':{'id':_0x1d849f[_0x030a('0x56')]['id']}})[_0x030a('0x1f')](handleEntityNotFound(_0x280401,null))[_0x030a('0x1f')](removeEntity(_0x280401,null))[_0x030a('0x1f')](function(){return db['Trunk'][_0x030a('0x4e')]({'raw':!![]});})[_0x030a('0x1f')](function(_0x16ab1a){var _0x162698=fs[_0x030a('0x61')](path[_0x030a('0x6d')](config[_0x030a('0x62')],_0x030a('0x6e')),_0x030a('0x63'));var _0x512855=fs['readFileSync'](path[_0x030a('0x6d')](config[_0x030a('0x62')],_0x030a('0x70')),_0x030a('0x63'));var _0xf39b9e=ejs[_0x030a('0x64')](_0x162698,{'trunks':_0x16ab1a});var _0x12e796=ejs[_0x030a('0x64')](_0x512855,{'trunks':_0x16ab1a});fs[_0x030a('0x65')](_0x030a('0x66'),_0xf39b9e);fs[_0x030a('0x65')](_0x030a('0x71'),_0x12e796);return respondWithRpcPromise('Reload','destroy',{'module':'chan_sip.so'});})[_0x030a('0x4f')](handleError(_0x280401,null));}; \ No newline at end of file +var _0x2a29=['/etc/asterisk/sip_xcally_trunks.conf','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reload','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save','update','destroy','get','Trunks','UserProfileResource','stack','name','rawAttributes','type','key','model','map','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','Trunk','count','includeAll','findAll','rows','show','params','include','find','clone','omit','createdAt','updatedAt','body','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync'];(function(_0x1515d9,_0x341bb0){var _0x5d46e6=function(_0x4c1298){while(--_0x4c1298){_0x1515d9['push'](_0x1515d9['shift']());}};_0x5d46e6(++_0x341bb0);}(_0x2a29,0x15b));var _0x92a2=function(_0x59accd,_0x2cc5d3){_0x59accd=_0x59accd-0x0;var _0x267a16=_0x2a29[_0x59accd];return _0x267a16;};'use strict';var pdf=require(_0x92a2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x92a2('0x1'));var zipdir=require(_0x92a2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x92a2('0x3'));var moment=require('moment');var BPromise=require(_0x92a2('0x4'));var Mustache=require(_0x92a2('0x5'));var util=require(_0x92a2('0x6'));var path=require(_0x92a2('0x7'));var sox=require(_0x92a2('0x8'));var csv=require('to-csv');var ejs=require(_0x92a2('0x9'));var fs=require('fs');var _=require(_0x92a2('0xa'));var squel=require('squel');var crypto=require(_0x92a2('0xb'));var jsforce=require(_0x92a2('0xc'));var deskjs=require(_0x92a2('0xd'));var toCsv=require(_0x92a2('0xe'));var querystring=require(_0x92a2('0xf'));var Papa=require(_0x92a2('0x10'));var Redis=require(_0x92a2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x92a2('0x12'));var as=require(_0x92a2('0x13'));var hardwareService=require(_0x92a2('0x14'));var logger=require(_0x92a2('0x15'))(_0x92a2('0x16'));var utils=require(_0x92a2('0x17'));var config=require('../../config/environment');var db=require(_0x92a2('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x92a2('0x19')][_0x92a2('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x552d8e,_0x11d779,_0x7a979d){if(_0x7a979d){var _0x3a9230=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a9230[_0x92a2('0x1b')](_0x11d779)){return _0x552d8e;}else{throw new db['Sequelize']['ValidationError'](_0x92a2('0x1c'));}}else{return _0x552d8e;}}function respondWithRpcPromise(_0xf42855,_0x372c48,_0x4022ef,_0x486d9a){return new BPromise(function(_0x1c79b5,_0x3c2ba2){var _0x2806cf=_0x486d9a||client;return _0x2806cf[_0x92a2('0x1d')](_0xf42855,_0x4022ef)[_0x92a2('0x1e')](function(_0x13ec0a){logger[_0x92a2('0x1f')](_0x92a2('0x20'),_0x372c48,_0x92a2('0x21'));logger[_0x92a2('0x22')](_0x92a2('0x23'),_0x372c48,_0x92a2('0x21'),JSON[_0x92a2('0x24')](_0x13ec0a));if(_0x13ec0a[_0x92a2('0x25')]){if(_0x13ec0a['error'][_0x92a2('0x26')]===0x1f4){logger[_0x92a2('0x25')]('Trunk,\x20%s,\x20%s',_0x372c48,_0x13ec0a[_0x92a2('0x25')][_0x92a2('0x27')]);return _0x3c2ba2(_0x13ec0a['error'][_0x92a2('0x27')]);}logger[_0x92a2('0x25')](_0x92a2('0x20'),_0x372c48,_0x13ec0a['error']['message']);return _0x1c79b5(_0x13ec0a['error'][_0x92a2('0x27')]);}else{logger[_0x92a2('0x1f')](_0x92a2('0x20'),_0x372c48,_0x92a2('0x21'));_0x1c79b5(_0x13ec0a[_0x92a2('0x28')][_0x92a2('0x27')]);}})[_0x92a2('0x29')](function(_0x3e9c41){logger['error'](_0x92a2('0x20'),_0x372c48,_0x3e9c41);_0x3c2ba2(_0x3e9c41);});});}function respondWithStatusCode(_0x4b2859,_0x58d048){_0x58d048=_0x58d048||0xcc;return function(_0x3826a7){if(_0x3826a7){return _0x4b2859[_0x92a2('0x2a')](_0x58d048);}return _0x4b2859[_0x92a2('0x2b')](_0x58d048)[_0x92a2('0x2c')]();};}function respondWithResult(_0x413501,_0x3e2f96){_0x3e2f96=_0x3e2f96||0xc8;return function(_0x133bf4){if(_0x133bf4){return _0x413501['status'](_0x3e2f96)['json'](_0x133bf4);}};}function respondWithFilteredResult(_0xbe4f9f,_0x583be1){return function(_0x1f91dc){if(_0x1f91dc){var _0x38fffc=_0x1f91dc['count'],_0x2720ff=_0x583be1[_0x92a2('0x2d')],_0x4161ce=_0x583be1[_0x92a2('0x2d')]+_0x583be1[_0x92a2('0x2e')],_0x583c50;if(_0x4161ce>=_0x38fffc){_0x4161ce=_0x38fffc;_0x583c50=0xc8;}else{_0x583c50=0xce;}_0xbe4f9f[_0x92a2('0x2b')](_0x583c50);return _0xbe4f9f[_0x92a2('0x2f')](_0x92a2('0x30'),_0x2720ff+'-'+_0x4161ce+'/'+_0x38fffc)[_0x92a2('0x31')](_0x1f91dc);}return null;};}function patchUpdates(_0x3f7c5a){return function(_0x3c6a91){try{jsonpatch['apply'](_0x3c6a91,_0x3f7c5a,!![]);}catch(_0x790844){return BPromise[_0x92a2('0x32')](_0x790844);}return _0x3c6a91[_0x92a2('0x33')]();};}function saveUpdates(_0x571538,_0x16e470){return function(_0x3795e0){if(_0x3795e0){return _0x3795e0[_0x92a2('0x34')](_0x571538)[_0x92a2('0x1e')](function(_0x2f1dc5){return _0x2f1dc5;});}return null;};}function removeEntity(_0x545f23,_0xbd1f78){return function(_0x29ada2){if(_0x29ada2){return _0x29ada2[_0x92a2('0x35')]()[_0x92a2('0x1e')](function(){var _0x2ceec5=_0x29ada2[_0x92a2('0x36')]({'plain':!![]});var _0x420aef=_0x92a2('0x37');return db[_0x92a2('0x38')][_0x92a2('0x35')]({'where':{'type':_0x420aef,'resourceId':_0x2ceec5['id']}})[_0x92a2('0x1e')](function(){return _0x29ada2;});})['then'](function(){_0x545f23[_0x92a2('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14880d,_0x315384){return function(_0x14c41f){if(!_0x14c41f){_0x14880d[_0x92a2('0x2a')](0x194);}return _0x14c41f;};}function handleError(_0x5a43df,_0x3c6211){_0x3c6211=_0x3c6211||0x1f4;return function(_0x1af8b6){logger['error'](_0x1af8b6[_0x92a2('0x39')]);if(_0x1af8b6['name']){delete _0x1af8b6[_0x92a2('0x3a')];}_0x5a43df[_0x92a2('0x2b')](_0x3c6211)['send'](_0x1af8b6);};}exports['index']=function(_0x3be97c,_0x1e85e0){var _0x5220af={},_0x55fafe={},_0x150d92={'count':0x0,'rows':[]};var _0x47ebc4=_['map'](db['Trunk'][_0x92a2('0x3b')],function(_0x5be630){return{'name':_0x5be630['fieldName'],'type':_0x5be630[_0x92a2('0x3c')][_0x92a2('0x3d')]};});_0x55fafe[_0x92a2('0x3e')]=_[_0x92a2('0x3f')](_0x47ebc4,'name');_0x55fafe['query']=_[_0x92a2('0x40')](_0x3be97c[_0x92a2('0x41')]);_0x55fafe['filters']=_[_0x92a2('0x42')](_0x55fafe[_0x92a2('0x3e')],_0x55fafe[_0x92a2('0x41')]);_0x5220af[_0x92a2('0x43')]=_[_0x92a2('0x42')](_0x55fafe['model'],qs[_0x92a2('0x44')](_0x3be97c['query'][_0x92a2('0x44')]));_0x5220af[_0x92a2('0x43')]=_0x5220af[_0x92a2('0x43')][_0x92a2('0x45')]?_0x5220af[_0x92a2('0x43')]:_0x55fafe[_0x92a2('0x3e')];if(!_0x3be97c[_0x92a2('0x41')]['hasOwnProperty'](_0x92a2('0x46'))){_0x5220af[_0x92a2('0x2e')]=qs[_0x92a2('0x2e')](_0x3be97c['query'][_0x92a2('0x2e')]);_0x5220af[_0x92a2('0x2d')]=qs['offset'](_0x3be97c[_0x92a2('0x41')][_0x92a2('0x2d')]);}_0x5220af[_0x92a2('0x47')]=qs[_0x92a2('0x48')](_0x3be97c[_0x92a2('0x41')][_0x92a2('0x48')]);_0x5220af[_0x92a2('0x49')]=qs[_0x92a2('0x4a')](_[_0x92a2('0x4b')](_0x3be97c['query'],_0x55fafe[_0x92a2('0x4a')]));if(_0x3be97c[_0x92a2('0x41')][_0x92a2('0x4c')]){_0x5220af[_0x92a2('0x49')]=_['merge'](_0x5220af[_0x92a2('0x49')],{'$or':_[_0x92a2('0x3f')](_0x47ebc4,function(_0x3f545d){if(_0x3f545d[_0x92a2('0x3c')]!==_0x92a2('0x4d')){var _0x1b12c5={};_0x1b12c5[_0x3f545d[_0x92a2('0x3a')]]={'$like':'%'+_0x3be97c[_0x92a2('0x41')][_0x92a2('0x4c')]+'%'};return _0x1b12c5;}})});}_0x5220af=_[_0x92a2('0x4e')]({},_0x5220af,_0x3be97c[_0x92a2('0x4f')]);var _0x1bb2ff={'where':_0x5220af[_0x92a2('0x49')]};return db[_0x92a2('0x50')][_0x92a2('0x51')](_0x1bb2ff)['then'](function(_0x185bc9){_0x150d92[_0x92a2('0x51')]=_0x185bc9;if(_0x3be97c['query'][_0x92a2('0x52')]){_0x5220af['include']=[{'all':!![]}];}return db[_0x92a2('0x50')][_0x92a2('0x53')](_0x5220af);})[_0x92a2('0x1e')](function(_0x2f0876){_0x150d92[_0x92a2('0x54')]=_0x2f0876;return _0x150d92;})[_0x92a2('0x1e')](respondWithFilteredResult(_0x1e85e0,_0x5220af))['catch'](handleError(_0x1e85e0,null));};exports[_0x92a2('0x55')]=function(_0x1a139a,_0x2e553a){var _0x484351={'raw':![],'where':{'id':_0x1a139a[_0x92a2('0x56')]['id']}},_0x2bf632={};_0x2bf632['model']=_[_0x92a2('0x40')](db[_0x92a2('0x50')][_0x92a2('0x3b')]);_0x2bf632[_0x92a2('0x41')]=_[_0x92a2('0x40')](_0x1a139a[_0x92a2('0x41')]);_0x2bf632['filters']=_['intersection'](_0x2bf632['model'],_0x2bf632['query']);_0x484351[_0x92a2('0x43')]=_[_0x92a2('0x42')](_0x2bf632['model'],qs[_0x92a2('0x44')](_0x1a139a['query'][_0x92a2('0x44')]));_0x484351[_0x92a2('0x43')]=_0x484351[_0x92a2('0x43')]['length']?_0x484351[_0x92a2('0x43')]:_0x2bf632[_0x92a2('0x3e')];if(_0x1a139a[_0x92a2('0x41')][_0x92a2('0x52')]){_0x484351[_0x92a2('0x57')]=[{'all':!![]}];}_0x484351=_[_0x92a2('0x4e')]({},_0x484351,_0x1a139a[_0x92a2('0x4f')]);return db[_0x92a2('0x50')][_0x92a2('0x58')](_0x484351)[_0x92a2('0x1e')](handleEntityNotFound(_0x2e553a,null))[_0x92a2('0x1e')](respondWithResult(_0x2e553a,null))[_0x92a2('0x29')](handleError(_0x2e553a,null));};exports[_0x92a2('0x59')]=function(_0x224fbb,_0x33bca1){var _0x5b88b2={'where':{'id':_0x224fbb[_0x92a2('0x56')]['id']}},_0x4eb483={};_0x4eb483['model']=_['keys'](db[_0x92a2('0x50')]['rawAttributes']);_0x5b88b2[_0x92a2('0x43')]=_[_0x92a2('0x42')](_0x4eb483['model'],qs[_0x92a2('0x44')](_0x224fbb[_0x92a2('0x41')][_0x92a2('0x44')]));_0x5b88b2[_0x92a2('0x43')]=_0x5b88b2[_0x92a2('0x43')][_0x92a2('0x45')]?_0x5b88b2[_0x92a2('0x43')]:_0x4eb483['model'];if(_0x224fbb[_0x92a2('0x41')]['includeAll']){_0x5b88b2[_0x92a2('0x57')]=[{'all':!![]}];}_0x5b88b2=_[_0x92a2('0x4e')]({},_0x5b88b2,_0x224fbb['options']);return db['Trunk'][_0x92a2('0x58')](_0x5b88b2)[_0x92a2('0x1e')](handleEntityNotFound(_0x33bca1,null))[_0x92a2('0x1e')](function(_0x447743){if(_0x447743){var _0x45c8db=_0x447743[_0x92a2('0x36')]({'plain':!![]});_0x45c8db=qs[_0x92a2('0x5a')](_0x45c8db,['id',_0x92a2('0x5b'),_0x92a2('0x5c')]);_0x224fbb['body']=_[_0x92a2('0x5a')](_0x224fbb[_0x92a2('0x5d')],['id',_0x92a2('0x5b'),_0x92a2('0x5c')]);return db[_0x92a2('0x50')][_0x92a2('0x5e')](_[_0x92a2('0x4e')](_0x45c8db,_0x224fbb[_0x92a2('0x5d')]),{'include':_0x224fbb['query']['includeAll']?[{'all':!![]}]:undefined})[_0x92a2('0x1e')](function(_0x22c167){var _0x38fb29=_0x224fbb[_0x92a2('0x5f')][_0x92a2('0x36')]({'plain':!![]});if(!_0x38fb29)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38fb29[_0x92a2('0x60')]===_0x92a2('0x5f')){var _0x45ffaf=_0x22c167[_0x92a2('0x36')]({'plain':!![]});var _0x4ff870=_0x92a2('0x37');return db[_0x92a2('0x61')]['find']({'where':{'name':_0x4ff870,'userProfileId':_0x38fb29[_0x92a2('0x62')]},'raw':!![]})['then'](function(_0x5394cd){if(_0x5394cd&&_0x5394cd[_0x92a2('0x63')]===0x0){return db[_0x92a2('0x38')][_0x92a2('0x5e')]({'name':_0x45ffaf[_0x92a2('0x3a')],'resourceId':_0x45ffaf['id'],'type':_0x5394cd[_0x92a2('0x3a')],'sectionId':_0x5394cd['id']},{})[_0x92a2('0x1e')](function(){return _0x22c167;});}else{return _0x22c167;}})['catch'](function(_0x151506){logger[_0x92a2('0x25')](_0x92a2('0x64'),_0x151506);throw _0x151506;});}return _0x22c167;});}})[_0x92a2('0x1e')](respondWithResult(_0x33bca1,0xc9))[_0x92a2('0x29')](handleError(_0x33bca1,null));};exports[_0x92a2('0x5e')]=function(_0x1b7f59,_0x36a4fa,_0x3f3305){var _0x4361b6;return db[_0x92a2('0x50')]['create'](_0x1b7f59['body'],{'raw':!![]})['then'](function(_0x37999e){_0x4361b6=_0x37999e;return db[_0x92a2('0x50')]['findAll']({'raw':!![]});})[_0x92a2('0x1e')](function(_0x1eef06){var _0x1e4941=fs[_0x92a2('0x65')](path[_0x92a2('0x66')](config[_0x92a2('0x67')],_0x92a2('0x68')),_0x92a2('0x69'));var _0x569c75=fs[_0x92a2('0x65')](path[_0x92a2('0x66')](config['root'],_0x92a2('0x6a')),_0x92a2('0x69'));var _0x183688=ejs[_0x92a2('0x6b')](_0x1e4941,{'trunks':_0x1eef06||[]});fs[_0x92a2('0x6c')](_0x92a2('0x6d'),_0x183688);if(_0x4361b6['registry']){var _0xfe3fa7=ejs[_0x92a2('0x6b')](_0x569c75,{'trunks':_0x1eef06||[]});fs['writeFileSync'](_0x92a2('0x6e'),_0xfe3fa7);}})[_0x92a2('0x1e')](function(){return respondWithRpcPromise('Reload',_0x92a2('0x5e'),{'module':_0x92a2('0x6f')});})[_0x92a2('0x1e')](function(){var _0x5c7591=_0x1b7f59[_0x92a2('0x5f')][_0x92a2('0x36')]({'plain':!![]});if(!_0x5c7591)throw new Error(_0x92a2('0x70'));if(_0x5c7591[_0x92a2('0x60')]===_0x92a2('0x5f')){var _0x5ac694=_0x4361b6[_0x92a2('0x36')]({'plain':!![]});return db[_0x92a2('0x61')][_0x92a2('0x58')]({'where':{'name':_0x92a2('0x37'),'userProfileId':_0x5c7591[_0x92a2('0x62')]},'raw':!![]})[_0x92a2('0x1e')](function(_0x9e5d4e){if(_0x9e5d4e&&_0x9e5d4e[_0x92a2('0x63')]===0x0){return db[_0x92a2('0x38')][_0x92a2('0x5e')]({'name':_0x5ac694[_0x92a2('0x3a')],'resourceId':_0x5ac694['id'],'type':_0x9e5d4e[_0x92a2('0x3a')],'sectionId':_0x9e5d4e['id']},{})[_0x92a2('0x1e')](function(){return _0x4361b6;});}else{return _0x4361b6;}})['catch'](function(_0x3d84a6){logger[_0x92a2('0x25')](_0x92a2('0x64'),_0x3d84a6);throw _0x3d84a6;});}return _0x4361b6;})['then'](respondWithResult(_0x36a4fa,0xc9))['catch'](handleError(_0x36a4fa,null));};exports[_0x92a2('0x34')]=function(_0x6d0abb,_0x288ebb,_0x20695b){var _0x200451;return db[_0x92a2('0x50')][_0x92a2('0x58')]({'where':{'id':_0x6d0abb['params']['id']}})[_0x92a2('0x1e')](handleEntityNotFound(_0x288ebb,null))['then'](saveUpdates(_0x6d0abb[_0x92a2('0x5d')],null))[_0x92a2('0x1e')](function(_0x124076){if(_0x124076){_0x200451=_0x124076;return db['Trunk'][_0x92a2('0x53')]({'raw':!![]});}})[_0x92a2('0x1e')](function(_0x445bde){if(_0x445bde){var _0x7ebc5b=fs[_0x92a2('0x65')](path[_0x92a2('0x66')](config[_0x92a2('0x67')],'server/files/templates/trunk.ejs'),_0x92a2('0x69'));var _0x351eae=fs['readFileSync'](path['join'](config[_0x92a2('0x67')],_0x92a2('0x6a')),_0x92a2('0x69'));var _0x3ac7ca=ejs[_0x92a2('0x6b')](_0x7ebc5b,{'trunks':_0x445bde||[]});fs['writeFileSync'](_0x92a2('0x6d'),_0x3ac7ca);var _0x3a83f5=ejs[_0x92a2('0x6b')](_0x351eae,{'trunks':_0x445bde||[]});fs[_0x92a2('0x6c')](_0x92a2('0x6e'),_0x3a83f5);return respondWithRpcPromise(_0x92a2('0x71'),_0x92a2('0x34'),{'module':'chan_sip.so'});}return null;})[_0x92a2('0x1e')](function(_0x523740){if(_0x523740){return _0x200451;}})[_0x92a2('0x1e')](respondWithResult(_0x288ebb,null))[_0x92a2('0x29')](handleError(_0x288ebb,null));};exports[_0x92a2('0x35')]=function(_0x51da7c,_0x43ebaa,_0x1442de){var _0x10288a;return db[_0x92a2('0x50')][_0x92a2('0x58')]({'where':{'id':_0x51da7c[_0x92a2('0x56')]['id']}})['then'](handleEntityNotFound(_0x43ebaa,null))[_0x92a2('0x1e')](removeEntity(_0x43ebaa,null))[_0x92a2('0x1e')](function(){return db[_0x92a2('0x50')]['findAll']({'raw':!![]});})[_0x92a2('0x1e')](function(_0x4254e0){var _0x26e645=fs[_0x92a2('0x65')](path[_0x92a2('0x66')](config[_0x92a2('0x67')],_0x92a2('0x68')),'utf8');var _0x251186=fs[_0x92a2('0x65')](path['join'](config[_0x92a2('0x67')],_0x92a2('0x6a')),_0x92a2('0x69'));var _0x4c097a=ejs[_0x92a2('0x6b')](_0x26e645,{'trunks':_0x4254e0});var _0x4eadc2=ejs['render'](_0x251186,{'trunks':_0x4254e0});fs[_0x92a2('0x6c')](_0x92a2('0x6d'),_0x4c097a);fs[_0x92a2('0x6c')](_0x92a2('0x6e'),_0x4eadc2);return respondWithRpcPromise(_0x92a2('0x71'),'destroy',{'module':_0x92a2('0x6f')});})[_0x92a2('0x29')](handleError(_0x43ebaa,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index f4cb5d8..4bca50d 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 _0x8175=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','define','Trunk'];(function(_0x2564d2,_0x4ddeaa){var _0x537ab8=function(_0x507d22){while(--_0x507d22){_0x2564d2['push'](_0x2564d2['shift']());}};_0x537ab8(++_0x4ddeaa);}(_0x8175,0x174));var _0x5817=function(_0xac56ce,_0xb73e4){_0xac56ce=_0xac56ce-0x0;var _0x5105e1=_0x8175[_0xac56ce];return _0x5105e1;};'use strict';var _=require(_0x5817('0x0'));var util=require(_0x5817('0x1'));var logger=require('../../config/logger')(_0x5817('0x2'));var moment=require(_0x5817('0x3'));var BPromise=require(_0x5817('0x4'));var rp=require(_0x5817('0x5'));var fs=require('fs');var path=require(_0x5817('0x6'));var rimraf=require(_0x5817('0x7'));var config=require(_0x5817('0x8'));var attributes=require(_0x5817('0x9'));module['exports']=function(_0xcf7964,_0x572340){return _0xcf7964[_0x5817('0xa')](_0x5817('0xb'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f5d=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','tools_trunks'];(function(_0x912e61,_0x2b0dd1){var _0x423d61=function(_0x3e241c){while(--_0x3e241c){_0x912e61['push'](_0x912e61['shift']());}};_0x423d61(++_0x2b0dd1);}(_0x5f5d,0x190));var _0xd5f5=function(_0x120e02,_0x1fe30e){_0x120e02=_0x120e02-0x0;var _0x1fd88f=_0x5f5d[_0x120e02];return _0x1fd88f;};'use strict';var _=require(_0xd5f5('0x0'));var util=require(_0xd5f5('0x1'));var logger=require(_0xd5f5('0x2'))(_0xd5f5('0x3'));var moment=require(_0xd5f5('0x4'));var BPromise=require(_0xd5f5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd5f5('0x6'));var config=require(_0xd5f5('0x7'));var attributes=require('./trunk.attributes');module[_0xd5f5('0x8')]=function(_0x182169,_0x2ed210){return _0x182169['define']('Trunk',attributes,{'tableName':_0xd5f5('0x9'),'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 b1dccf6..873db87 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 _0x0b0e=['model','GetTrunk','Trunk','find','where','include','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','findAll','raw','options','attributes','map'];(function(_0x1b6204,_0x42e211){var _0x45e55f=function(_0x4f1acc){while(--_0x4f1acc){_0x1b6204['push'](_0x1b6204['shift']());}};_0x45e55f(++_0x42e211);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1ed010,_0x734e0b){_0x1ed010=_0x1ed010-0x0;var _0x6e22bf=_0x0b0e[_0x1ed010];return _0x6e22bf;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Trunk,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});}exports['GetTrunk']=function(_0x54a3eb){var _0x46bb44=this;return new Promise(function(_0x50a441,_0x4df8da){return db['Trunk'][_0xe0b0('0x18')]({'raw':_0x54a3eb['options']?_0x54a3eb['options'][_0xe0b0('0x19')]===undefined?!![]:![]:!![],'where':_0x54a3eb['options']?_0x54a3eb[_0xe0b0('0x1a')]['where']||null:null,'attributes':_0x54a3eb[_0xe0b0('0x1a')]?_0x54a3eb[_0xe0b0('0x1a')][_0xe0b0('0x1b')]||null:null,'limit':_0x54a3eb[_0xe0b0('0x1a')]?_0x54a3eb[_0xe0b0('0x1a')]['limit']||null:null,'include':_0x54a3eb['options']?_0x54a3eb[_0xe0b0('0x1a')]['include']?_[_0xe0b0('0x1c')](_0x54a3eb[_0xe0b0('0x1a')]['include'],function(_0x170ad8){return{'model':db[_0x170ad8['model']],'as':_0x170ad8['as'],'attributes':_0x170ad8[_0xe0b0('0x1b')],'include':_0x170ad8['include']?_[_0xe0b0('0x1c')](_0x170ad8['include'],function(_0x3e5c88){return{'model':db[_0x3e5c88['model']],'as':_0x3e5c88['as'],'attributes':_0x3e5c88[_0xe0b0('0x1b')],'include':_0x3e5c88['include']?_[_0xe0b0('0x1c')](_0x3e5c88['include'],function(_0x362aba){return{'model':db[_0x362aba[_0xe0b0('0x1d')]],'as':_0x362aba['as'],'attributes':_0x362aba[_0xe0b0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe0b0('0xd')](function(_0x3ec2){logger[_0xe0b0('0xe')]('GetTrunk',_0x54a3eb);logger[_0xe0b0('0x10')](_0xe0b0('0x1e'),_0x54a3eb,JSON['stringify'](_0x3ec2));_0x50a441(_0x3ec2);})[_0xe0b0('0x17')](function(_0x419b1f){logger[_0xe0b0('0x13')](_0xe0b0('0x1e'),_0x419b1f[_0xe0b0('0x14')],_0x54a3eb);_0x4df8da(_0x46bb44[_0xe0b0('0x13')](0x1f4,_0x419b1f[_0xe0b0('0x14')]));});});};exports['ShowTrunk']=function(_0x1854b8){var _0x3c0109=this;return new Promise(function(_0x48a9b5,_0x4fe400){return db[_0xe0b0('0x1f')][_0xe0b0('0x20')]({'raw':_0x1854b8[_0xe0b0('0x1a')]?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x19')]===undefined?!![]:![]:!![],'where':_0x1854b8['options']?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x21')]||null:null,'attributes':_0x1854b8[_0xe0b0('0x1a')]?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x1b')]||null:null,'include':_0x1854b8['options']?_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x22')]?_[_0xe0b0('0x1c')](_0x1854b8[_0xe0b0('0x1a')][_0xe0b0('0x22')],function(_0x12eeb8){return{'model':db[_0x12eeb8[_0xe0b0('0x1d')]],'as':_0x12eeb8['as'],'attributes':_0x12eeb8[_0xe0b0('0x1b')],'include':_0x12eeb8[_0xe0b0('0x22')]?_[_0xe0b0('0x1c')](_0x12eeb8[_0xe0b0('0x22')],function(_0x1a0c90){return{'model':db[_0x1a0c90[_0xe0b0('0x1d')]],'as':_0x1a0c90['as'],'attributes':_0x1a0c90[_0xe0b0('0x1b')],'include':_0x1a0c90[_0xe0b0('0x22')]?_['map'](_0x1a0c90[_0xe0b0('0x22')],function(_0x135be5){return{'model':db[_0x135be5[_0xe0b0('0x1d')]],'as':_0x135be5['as'],'attributes':_0x135be5[_0xe0b0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe0b0('0xd')](function(_0x2c6e60){logger[_0xe0b0('0xe')]('ShowTrunk',_0x1854b8);logger['debug']('ShowTrunk',_0x1854b8,JSON['stringify'](_0x2c6e60));_0x48a9b5(_0x2c6e60);})[_0xe0b0('0x17')](function(_0xc3d967){logger[_0xe0b0('0x13')]('ShowTrunk',_0xc3d967[_0xe0b0('0x14')],_0x1854b8);_0x4fe400(_0x3c0109[_0xe0b0('0x13')](0x1f4,_0xc3d967[_0xe0b0('0x14')]));});});}; \ No newline at end of file +var _0x8603=['result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowTrunk','debug','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x51b597,_0x40a19e){var _0x9b4d32=function(_0x1d3701){while(--_0x1d3701){_0x51b597['push'](_0x51b597['shift']());}};_0x9b4d32(++_0x40a19e);}(_0x8603,0x190));var _0x3860=function(_0x27e4cc,_0x29dba2){_0x27e4cc=_0x27e4cc-0x0;var _0x331c4c=_0x8603[_0x27e4cc];return _0x331c4c;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eca44,_0xd3ce26,_0x472bf2){return new BPromise(function(_0x4aba10,_0x5c7350){return client['request'](_0x1eca44,_0x472bf2)[_0x3860('0x9')](function(_0x441dc4){logger['info'](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));logger['debug'](_0x3860('0xc'),_0xd3ce26,_0x3860('0xb'),JSON['stringify'](_0x441dc4));if(_0x441dc4[_0x3860('0xd')]){if(_0x441dc4[_0x3860('0xd')]['code']===0x1f4){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x5c7350(_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);}logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x4aba10(_0x441dc4['error'][_0x3860('0xe')]);}else{logger[_0x3860('0xf')](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));_0x4aba10(_0x441dc4[_0x3860('0x10')][_0x3860('0xe')]);}})[_0x3860('0x11')](function(_0x378305){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x378305);_0x5c7350(_0x378305);});});}exports[_0x3860('0x12')]=function(_0x45b799){var _0x4b6b15=this;return new Promise(function(_0x4863bd,_0x373b06){return db[_0x3860('0x13')][_0x3860('0x14')]({'raw':_0x45b799['options']?_0x45b799[_0x3860('0x15')][_0x3860('0x16')]===undefined?!![]:![]:!![],'where':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x17')]||null:null,'attributes':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x18')]||null:null,'limit':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x19')]||null:null,'include':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x1a')]?_[_0x3860('0x1b')](_0x45b799['options'][_0x3860('0x1a')],function(_0x133093){return{'model':db[_0x133093[_0x3860('0x1c')]],'as':_0x133093['as'],'attributes':_0x133093[_0x3860('0x18')],'include':_0x133093[_0x3860('0x1a')]?_['map'](_0x133093[_0x3860('0x1a')],function(_0x568515){return{'model':db[_0x568515['model']],'as':_0x568515['as'],'attributes':_0x568515[_0x3860('0x18')],'include':_0x568515[_0x3860('0x1a')]?_['map'](_0x568515['include'],function(_0x5f42d5){return{'model':db[_0x5f42d5[_0x3860('0x1c')]],'as':_0x5f42d5['as'],'attributes':_0x5f42d5[_0x3860('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3860('0x9')](function(_0x371f3a){logger[_0x3860('0xf')](_0x3860('0x12'),_0x45b799);logger['debug']('GetTrunk',_0x45b799,JSON[_0x3860('0x1d')](_0x371f3a));_0x4863bd(_0x371f3a);})[_0x3860('0x11')](function(_0x5a9af2){logger[_0x3860('0xd')](_0x3860('0x12'),_0x5a9af2[_0x3860('0xe')],_0x45b799);_0x373b06(_0x4b6b15[_0x3860('0xd')](0x1f4,_0x5a9af2[_0x3860('0xe')]));});});};exports['ShowTrunk']=function(_0x36ae2b){var _0xf624ba=this;return new Promise(function(_0x367b14,_0x4bd90c){return db[_0x3860('0x13')]['find']({'raw':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b['options'][_0x3860('0x16')]===undefined?!![]:![]:!![],'where':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b[_0x3860('0x15')]['where']||null:null,'attributes':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b[_0x3860('0x15')]['attributes']||null:null,'include':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b['options'][_0x3860('0x1a')]?_[_0x3860('0x1b')](_0x36ae2b[_0x3860('0x15')][_0x3860('0x1a')],function(_0x30dc2a){return{'model':db[_0x30dc2a[_0x3860('0x1c')]],'as':_0x30dc2a['as'],'attributes':_0x30dc2a[_0x3860('0x18')],'include':_0x30dc2a['include']?_[_0x3860('0x1b')](_0x30dc2a[_0x3860('0x1a')],function(_0x4d62e9){return{'model':db[_0x4d62e9[_0x3860('0x1c')]],'as':_0x4d62e9['as'],'attributes':_0x4d62e9[_0x3860('0x18')],'include':_0x4d62e9[_0x3860('0x1a')]?_['map'](_0x4d62e9['include'],function(_0x285b1b){return{'model':db[_0x285b1b[_0x3860('0x1c')]],'as':_0x285b1b['as'],'attributes':_0x285b1b[_0x3860('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3860('0x9')](function(_0x59271f){logger['info'](_0x3860('0x1e'),_0x36ae2b);logger[_0x3860('0x1f')](_0x3860('0x1e'),_0x36ae2b,JSON[_0x3860('0x1d')](_0x59271f));_0x367b14(_0x59271f);})[_0x3860('0x11')](function(_0x4df2a9){logger[_0x3860('0xd')](_0x3860('0x1e'),_0x4df2a9['message'],_0x36ae2b);_0x4bd90c(_0xf624ba['error'](0x1f4,_0x4df2a9[_0x3860('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index b391216..28a4e67 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 _0xadb5=['/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','post','/create_many','bulkCreate','addContacts','addQueues','diskStorage','join','root','server/files/images/','format','now','single','addAvatar','/:id/logout','/:id/pause','pause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','put','update','removeQueues','delete','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','/:id/openchannel_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeApiKey','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/whoami','whoami','/:id','show','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions'];(function(_0x5b0fd5,_0x2d742f){var _0x27651f=function(_0x564514){while(--_0x564514){_0x5b0fd5['push'](_0x5b0fd5['shift']());}};_0x27651f(++_0x2d742f);}(_0xadb5,0xad));var _0x5adb=function(_0x3ee74f,_0x8f822a){_0x3ee74f=_0x3ee74f-0x0;var _0x36dd29=_0xadb5[_0x3ee74f];return _0x36dd29;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var controller=require(_0x5adb('0x6'));router['get']('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x9')](_0x5adb('0xc'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x9')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xf')]);router['get']('/:id/avatar',controller[_0x5adb('0x10')]);router[_0x5adb('0x9')](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x12')]);router['get'](_0x5adb('0x13'),auth['isAuthenticated'](),controller[_0x5adb('0x14')]);router[_0x5adb('0x9')](_0x5adb('0x15'),auth['isAuthenticated'](),controller[_0x5adb('0x16')]);router[_0x5adb('0x9')](_0x5adb('0x17'),auth['isAuthenticated'](),controller[_0x5adb('0x18')]);router['get'](_0x5adb('0x19'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x1a')]);router[_0x5adb('0x9')](_0x5adb('0x1b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x1c')]);router[_0x5adb('0x9')](_0x5adb('0x1d'),auth['isAuthenticated'](),controller[_0x5adb('0x1e')]);router['get'](_0x5adb('0x1f'),auth['isAuthenticated'](),controller[_0x5adb('0x20')]);router['get']('/:id/mail/interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x21')]);router[_0x5adb('0x9')](_0x5adb('0x22'),auth[_0x5adb('0x7')](),controller['getSmsInteractions']);router[_0x5adb('0x9')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0x5adb('0x23')]);router[_0x5adb('0x9')](_0x5adb('0x24'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x25')]);router[_0x5adb('0x9')](_0x5adb('0x26'),auth['isAuthenticated'](),controller[_0x5adb('0x27')]);router[_0x5adb('0x9')](_0x5adb('0x28'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x29')]);router['get'](_0x5adb('0x2a'),auth[_0x5adb('0x7')](),controller['getVoicePrefixes']);router[_0x5adb('0x9')](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller['getFaxAccounts']);router[_0x5adb('0x9')](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x2d')]);router[_0x5adb('0x9')](_0x5adb('0x2e'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router['get'](_0x5adb('0x2f'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x30')]);router[_0x5adb('0x9')](_0x5adb('0x31'),auth['isAuthenticated'](),controller[_0x5adb('0x32')]);router[_0x5adb('0x9')](_0x5adb('0x33'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x34')]);router[_0x5adb('0x9')](_0x5adb('0x35'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x36')]);router[_0x5adb('0x9')]('/:id/api_key',auth[_0x5adb('0x7')](),controller['getApiKey']);router[_0x5adb('0x37')](_0x5adb('0x38'),auth['isAuthenticated'](),controller[_0x5adb('0x39')]);router[_0x5adb('0x37')](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x3a')]);router[_0x5adb('0x37')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5adb('0x37')]('/:id/queues',auth[_0x5adb('0x7')](),controller[_0x5adb('0x3b')]);var upload=multer({'storage':multer[_0x5adb('0x3c')]({'destination':function(_0x2da912,_0x9bdece,_0x5ece39){_0x5ece39(null,path[_0x5adb('0x3d')](config[_0x5adb('0x3e')],_0x5adb('0x3f')));},'filename':function(_0x54851b,_0x4c8870,_0x32eb69){_0x32eb69(null,util[_0x5adb('0x40')]('%s-%s',Date[_0x5adb('0x41')](),_0x4c8870['originalname']));}})});router[_0x5adb('0x37')]('/:id/avatar',upload[_0x5adb('0x42')]('file'),controller[_0x5adb('0x43')]);router[_0x5adb('0x37')]('/:id/login',auth[_0x5adb('0x7')](),controller['login']);router[_0x5adb('0x37')](_0x5adb('0x44'),auth[_0x5adb('0x7')](),controller['logout']);router[_0x5adb('0x37')](_0x5adb('0x45'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x46')]);router[_0x5adb('0x37')]('/:id/unpause',auth['isAuthenticated'](),controller['unpause']);router['post'](_0x5adb('0x24'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x47')]);router[_0x5adb('0x37')](_0x5adb('0x48'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x49')]);router[_0x5adb('0x37')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x5adb('0x4a')]);router['post'](_0x5adb('0x4b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x4c')]);router[_0x5adb('0x37')](_0x5adb('0x4d'),auth['isAuthenticated'](),controller[_0x5adb('0x4e')]);router[_0x5adb('0x37')]('/:id/openchannel_interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x4f')]);router['post'](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x50')]);router[_0x5adb('0x37')](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x51')]);router['post']('/:id/openchannel_accounts',auth[_0x5adb('0x7')](),controller[_0x5adb('0x52')]);router[_0x5adb('0x37')](_0x5adb('0x2f'),auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0x5adb('0x37')](_0x5adb('0x31'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x53')]);router[_0x5adb('0x37')]('/:id/square_projects',auth[_0x5adb('0x7')](),controller[_0x5adb('0x54')]);router['post'](_0x5adb('0x55'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x56')]);router[_0x5adb('0x57')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x58')]);router[_0x5adb('0x57')]('/:id/password',auth[_0x5adb('0x7')](),controller['changePassword']);router['delete']('/:id/queues',auth[_0x5adb('0x7')](),controller[_0x5adb('0x59')]);router[_0x5adb('0x5a')]('/:id/teams',auth[_0x5adb('0x7')](),controller['removeTeams']);router[_0x5adb('0x5a')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller['destroy']);router[_0x5adb('0x5a')]('/:id/chat_interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x5b')]);router['delete'](_0x5adb('0x5c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x5d')]);router[_0x5adb('0x5a')](_0x5adb('0x4b'),auth['isAuthenticated'](),controller[_0x5adb('0x5e')]);router[_0x5adb('0x5a')](_0x5adb('0x4d'),auth[_0x5adb('0x7')](),controller['removeSmsInteractions']);router[_0x5adb('0x5a')](_0x5adb('0x5f'),auth[_0x5adb('0x7')](),controller['removeOpenchannelInteractions']);router[_0x5adb('0x5a')](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x60')]);router['delete'](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x61')]);router[_0x5adb('0x5a')](_0x5adb('0x2e'),auth['isAuthenticated'](),controller[_0x5adb('0x62')]);router['delete'](_0x5adb('0x2f'),auth['isAuthenticated'](),controller[_0x5adb('0x63')]);router[_0x5adb('0x5a')](_0x5adb('0x31'),auth[_0x5adb('0x7')](),controller['removeChatWebsites']);router[_0x5adb('0x5a')](_0x5adb('0x33'),auth[_0x5adb('0x7')](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth[_0x5adb('0x7')](),controller[_0x5adb('0x64')]);module[_0x5adb('0x65')]=router; \ No newline at end of file +var _0x7a54=['getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','/create_many','post','addContacts','create','addQueues','join','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','single','addAvatar','login','logout','/:id/pause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','createApiKey','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','describe','/whoami','/:id','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings'];(function(_0x5d6c5a,_0x5c7ca8){var _0x4dddbb=function(_0x1608c7){while(--_0x1608c7){_0x5d6c5a['push'](_0x5d6c5a['shift']());}};_0x4dddbb(++_0x5c7ca8);}(_0x7a54,0x106));var _0x47a5=function(_0x17fab0,_0x32f269){_0x17fab0=_0x17fab0-0x0;var _0x49e888=_0x7a54[_0x17fab0];return _0x49e888;};'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 auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['whoami']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0x8')]('/:id/avatar',controller['getAvatar']);router[_0x47a5('0x8')](_0x47a5('0xd'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);router[_0x47a5('0x8')](_0x47a5('0xf'),auth[_0x47a5('0x9')](),controller['getQueues']);router[_0x47a5('0x8')](_0x47a5('0x10'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x8')](_0x47a5('0x12'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x13')]);router['get'](_0x47a5('0x14'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x15')]);router[_0x47a5('0x8')](_0x47a5('0x16'),auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0x47a5('0x8')]('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0x47a5('0x17')]);router[_0x47a5('0x8')](_0x47a5('0x18'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x19')]);router[_0x47a5('0x8')](_0x47a5('0x1a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x1b')]);router['get'](_0x47a5('0x1c'),auth[_0x47a5('0x9')](),controller['getSmsInteractions']);router[_0x47a5('0x8')](_0x47a5('0x1d'),auth[_0x47a5('0x9')](),controller['getFaxInteractions']);router[_0x47a5('0x8')](_0x47a5('0x1e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x1f')]);router['get'](_0x47a5('0x20'),auth[_0x47a5('0x9')](),controller['getLists']);router[_0x47a5('0x8')](_0x47a5('0x21'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x22')]);router[_0x47a5('0x8')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x47a5('0x23')]);router['get'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router[_0x47a5('0x8')](_0x47a5('0x26'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x27')]);router[_0x47a5('0x8')](_0x47a5('0x28'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x29')]);router[_0x47a5('0x8')](_0x47a5('0x2a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x2b')]);router['get'](_0x47a5('0x2c'),auth['isAuthenticated'](),controller[_0x47a5('0x2d')]);router[_0x47a5('0x8')](_0x47a5('0x2e'),auth['isAuthenticated'](),controller[_0x47a5('0x2f')]);router[_0x47a5('0x8')](_0x47a5('0x30'),auth[_0x47a5('0x9')](),controller['getScheduledCalls']);router['get'](_0x47a5('0x31'),auth[_0x47a5('0x9')](),controller['getApiKey']);router['post'](_0x47a5('0x32'),auth[_0x47a5('0x9')](),controller['bulkCreate']);router[_0x47a5('0x33')]('/:id/contacts',auth[_0x47a5('0x9')](),controller[_0x47a5('0x34')]);router['post']('/',auth['isAuthenticated'](),controller[_0x47a5('0x35')]);router['post'](_0x47a5('0xf'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x18f7e9,_0x50c086,_0x53c754){_0x53c754(null,path[_0x47a5('0x37')](config['root'],_0x47a5('0x38')));},'filename':function(_0x5ef577,_0x21ad34,_0x3534cb){_0x3534cb(null,util[_0x47a5('0x39')](_0x47a5('0x3a'),Date[_0x47a5('0x3b')](),_0x21ad34[_0x47a5('0x3c')]));}})});router[_0x47a5('0x33')](_0x47a5('0x3d'),upload[_0x47a5('0x3e')]('file'),controller[_0x47a5('0x3f')]);router[_0x47a5('0x33')]('/:id/login',auth[_0x47a5('0x9')](),controller[_0x47a5('0x40')]);router[_0x47a5('0x33')]('/:id/logout',auth[_0x47a5('0x9')](),controller[_0x47a5('0x41')]);router['post'](_0x47a5('0x42'),auth[_0x47a5('0x9')](),controller['pause']);router['post']('/:id/unpause',auth[_0x47a5('0x9')](),controller['unpause']);router[_0x47a5('0x33')](_0x47a5('0x1e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x43')]);router[_0x47a5('0x33')](_0x47a5('0x44'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x45')]);router[_0x47a5('0x33')](_0x47a5('0x46'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x47')]);router[_0x47a5('0x33')]('/:id/fax_interactions',auth[_0x47a5('0x9')](),controller[_0x47a5('0x48')]);router[_0x47a5('0x33')](_0x47a5('0x49'),auth['isAuthenticated'](),controller[_0x47a5('0x4a')]);router['post']('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x47a5('0x33')]('/:id/fax_accounts',auth[_0x47a5('0x9')](),controller[_0x47a5('0x4b')]);router[_0x47a5('0x33')]('/:id/mail_accounts',auth[_0x47a5('0x9')](),controller[_0x47a5('0x4c')]);router['post']('/:id/openchannel_accounts',auth[_0x47a5('0x9')](),controller['addOpenchannelAccounts']);router[_0x47a5('0x33')](_0x47a5('0x2a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x4d')]);router[_0x47a5('0x33')](_0x47a5('0x2c'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x4e')]);router[_0x47a5('0x33')](_0x47a5('0x2e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x4f')]);router[_0x47a5('0x33')](_0x47a5('0x31'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x50')]);router['put'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router['put'](_0x47a5('0x51'),auth['isAuthenticated'](),controller[_0x47a5('0x52')]);router[_0x47a5('0x53')]('/:id/queues',auth['isAuthenticated'](),controller[_0x47a5('0x54')]);router['delete'](_0x47a5('0x1e'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x55')]);router[_0x47a5('0x53')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x56')]);router['delete']('/:id/chat_interactions',auth[_0x47a5('0x9')](),controller[_0x47a5('0x57')]);router[_0x47a5('0x53')](_0x47a5('0x46'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x58')]);router[_0x47a5('0x53')]('/:id/fax_interactions',auth[_0x47a5('0x9')](),controller[_0x47a5('0x59')]);router[_0x47a5('0x53')]('/:id/sms_interactions',auth[_0x47a5('0x9')](),controller['removeSmsInteractions']);router[_0x47a5('0x53')](_0x47a5('0x5a'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5b')]);router['delete'](_0x47a5('0x24'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5c')]);router[_0x47a5('0x53')](_0x47a5('0x26'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5d')]);router['delete'](_0x47a5('0x28'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x5e')]);router[_0x47a5('0x53')](_0x47a5('0x2a'),auth[_0x47a5('0x9')](),controller['removeSmsAccounts']);router[_0x47a5('0x53')](_0x47a5('0x2c'),auth[_0x47a5('0x9')](),controller['removeChatWebsites']);router[_0x47a5('0x53')](_0x47a5('0x2e'),auth[_0x47a5('0x9')](),controller['removeSquareProjects']);router['delete'](_0x47a5('0x31'),auth[_0x47a5('0x9')](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 7f9ba4f..5287139 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x52a70f,_0x32f1ac){var _0x281ca3=function(_0x2666f5){while(--_0x2666f5){_0x52a70f['push'](_0x52a70f['shift']());}};_0x281ca3(++_0x32f1ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x44fec1,_0x35b29a){var _0x1d8243=function(_0xf06c5d){while(--_0xf06c5d){_0x44fec1['push'](_0x44fec1['shift']());}};_0x1d8243(++_0x35b29a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 411bcc9..f21ffdd 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 _0x3cd0=['user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','each','MemberReport','all','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','forEach','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','lastPauseAt','QueuePause','manual','chat','fax','sms','%s%s','Pause','Team','getTeams','addTeams','setDataValue','Voice','getChatQueues','Chat','getSmsQueues','Sms','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','Queue:save','removeTeams','getMailQueues','Mail','removeAgent','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','VoicePrefix','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','concat','$and','$or','$gte','$lt','$lte','$not','$between','$notBetween','$in','$notLike','$iLike','$notILike','$like','$contains','$contained','$any','firstName','lastName','CmContact','dialActive','VoiceQueue','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','./user.socket','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','User,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','update','destroy','get','Users','user','Agents','Telephones','telephone','ignore','map','value','includes','role','UserProfileResource','end','name','send','index','User','rawAttributes','fieldName','key','model','differenceBy','password','salt','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','type','VIRTUAL','sequelize','lower','col','merge','options','include','findAll','rows','show','params','keys','includeAll','bulkCreate','body','describe','addContacts','find','ids','omit','agent\x20role','admin','../../config/license/util','telephones','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','internal','findById','securePassword','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','mailbox','VoiceMail','email','agent','101','102','103','110','105','107','109','100','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','findOne','oldPassword','newPassword','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','online','loginInPause','voicePause','isValidChannel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','voice','push','interface','SIP/%s','upsert','removeQueues','channel','Unknown\x20channel','remove','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','download','existsSync','root','server/files/images/','getContacts','hasOwnProperty','CmList','Tags','color','tag','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','order','getGroups','getRecordings','VoiceRecording','getScreenRecordings','UserId','ScreenRecording','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','phone','mobile','LOCAL/%s@from-sip/n','intrf'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x3cd0,0x8a));var _0x03cd=function(_0x553a87,_0x1d621f){_0x553a87=_0x553a87-0x0;var _0x12d1e6=_0x3cd0[_0x553a87];return _0x12d1e6;};'use strict';var pdf=require(_0x03cd('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x03cd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03cd('0x2'));var moment=require(_0x03cd('0x3'));var BPromise=require(_0x03cd('0x4'));var Mustache=require(_0x03cd('0x5'));var util=require(_0x03cd('0x6'));var path=require('path');var sox=require(_0x03cd('0x7'));var csv=require(_0x03cd('0x8'));var ejs=require(_0x03cd('0x9'));var fs=require('fs');var _=require(_0x03cd('0xa'));var squel=require(_0x03cd('0xb'));var crypto=require('crypto');var jsforce=require(_0x03cd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x03cd('0x8'));var querystring=require(_0x03cd('0xd'));var Papa=require(_0x03cd('0xe'));var Redis=require(_0x03cd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x03cd('0x10'));var as=require(_0x03cd('0x11'));var hardwareService=require(_0x03cd('0x12'));var logger=require(_0x03cd('0x13'))(_0x03cd('0x14'));var utils=require(_0x03cd('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x03cd('0x16')]=_[_0x03cd('0x17')](config[_0x03cd('0x16')],{'host':_0x03cd('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03cd('0x16')]));require(_0x03cd('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x03cd('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x169b25,_0x17961d,_0x77b1bf){if(_0x77b1bf){var _0x526102=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x526102[_0x03cd('0x1b')](_0x17961d)){return _0x169b25;}else{throw new db[(_0x03cd('0x1c'))][(_0x03cd('0x1d'))](_0x03cd('0x1e'));}}else{return _0x169b25;}}function respondWithRpcPromise(_0x1b6fa5,_0x5ac997,_0x39733a,_0x27de4f){return new BPromise(function(_0x44e477,_0x12b3ea){var _0x21049d=_0x27de4f||client;return _0x21049d['request'](_0x1b6fa5,_0x39733a)[_0x03cd('0x1f')](function(_0xa1122b){logger[_0x03cd('0x20')](_0x03cd('0x21'),_0x5ac997,'request\x20sent');logger[_0x03cd('0x22')]('User,\x20%s,\x20%s,\x20%s',_0x5ac997,_0x03cd('0x23'),JSON[_0x03cd('0x24')](_0xa1122b));if(_0xa1122b[_0x03cd('0x25')]){if(_0xa1122b['error']['code']===0x1f4){logger[_0x03cd('0x25')](_0x03cd('0x21'),_0x5ac997,_0xa1122b['error'][_0x03cd('0x26')]);return _0x12b3ea(_0xa1122b[_0x03cd('0x25')]['message']);}logger[_0x03cd('0x25')]('User,\x20%s,\x20%s',_0x5ac997,_0xa1122b['error'][_0x03cd('0x26')]);return _0x44e477(_0xa1122b[_0x03cd('0x25')][_0x03cd('0x26')]);}else{logger[_0x03cd('0x20')](_0x03cd('0x21'),_0x5ac997,_0x03cd('0x23'));_0x44e477(_0xa1122b['result']['message']);}})[_0x03cd('0x27')](function(_0x491b16){logger[_0x03cd('0x25')]('User,\x20%s,\x20%s',_0x5ac997,_0x491b16);_0x12b3ea(_0x491b16);});});}function respondWithStatusCode(_0x4f8b00,_0x709473){_0x709473=_0x709473||0xcc;return function(_0x4f7fb5){if(_0x4f7fb5){return _0x4f8b00[_0x03cd('0x28')](_0x709473);}return _0x4f8b00[_0x03cd('0x29')](_0x709473)['end']();};}function respondWithResult(_0x13242a,_0x38117e){_0x38117e=_0x38117e||0xc8;return function(_0xb5eb0){if(_0xb5eb0){return _0x13242a[_0x03cd('0x29')](_0x38117e)[_0x03cd('0x2a')](_0xb5eb0);}};}function respondWithFilteredResult(_0x49693c,_0x1443ed){return function(_0x37b419){if(_0x37b419){var _0x3bc711=_0x37b419[_0x03cd('0x2b')],_0x1e8827=_0x1443ed[_0x03cd('0x2c')],_0x4e43c2=_0x1443ed[_0x03cd('0x2c')]+_0x1443ed[_0x03cd('0x2d')],_0x1a3b3e;if(_0x4e43c2>=_0x3bc711){_0x4e43c2=_0x3bc711;_0x1a3b3e=0xc8;}else{_0x1a3b3e=0xce;}_0x49693c[_0x03cd('0x29')](_0x1a3b3e);return _0x49693c[_0x03cd('0x2e')](_0x03cd('0x2f'),_0x1e8827+'-'+_0x4e43c2+'/'+_0x3bc711)[_0x03cd('0x2a')](_0x37b419);}return null;};}function patchUpdates(_0x1dea01){return function(_0x145583){try{jsonpatch[_0x03cd('0x30')](_0x145583,_0x1dea01,!![]);}catch(_0x43af16){return BPromise['reject'](_0x43af16);}return _0x145583['save']();};}function saveUpdates(_0x2429a3,_0x5637d1){return function(_0x26fde6){if(_0x26fde6){return _0x26fde6[_0x03cd('0x31')](_0x2429a3)['then'](function(_0x4e5d63){return _0x4e5d63;});}return null;};}function removeEntity(_0x5212cd,_0x1548d8){return function(_0x2c0471){if(_0x2c0471){return _0x2c0471[_0x03cd('0x32')]()['then'](function(){var _0x3ad6f1=_0x2c0471[_0x03cd('0x33')]({'plain':!![]});var _0x1f391d=[{'name':_0x03cd('0x34'),'value':_0x03cd('0x35'),'ignore':!![]},{'name':_0x03cd('0x36'),'value':'agent','ignore':![]},{'name':_0x03cd('0x37'),'value':_0x03cd('0x38'),'ignore':![]}];var _0x27ca30=_(_0x1f391d)['filter'](_0x03cd('0x39'))[_0x03cd('0x3a')](_0x03cd('0x3b'))[_0x03cd('0x3b')]();if(_[_0x03cd('0x3c')](_0x27ca30,_0x3ad6f1[_0x03cd('0x3d')])){return;}var _0x3396d0=_['find'](_0x1f391d,[_0x03cd('0x3b'),_0x3ad6f1[_0x03cd('0x3d')]])['name'];return db[_0x03cd('0x3e')][_0x03cd('0x32')]({'where':{'type':_0x3396d0,'resourceId':_0x3ad6f1['id']}})[_0x03cd('0x1f')](function(){return _0x2c0471;});})[_0x03cd('0x1f')](function(){_0x5212cd['status'](0xcc)[_0x03cd('0x3f')]();});}};}function handleEntityNotFound(_0x23ae57,_0x28098e){return function(_0x45d723){if(!_0x45d723){_0x23ae57[_0x03cd('0x28')](0x194);}return _0x45d723;};}function handleError(_0x3be9c2,_0x227a1c){_0x227a1c=_0x227a1c||0x1f4;return function(_0x161d43){logger['error'](_0x161d43['stack']);if(_0x161d43[_0x03cd('0x40')]){delete _0x161d43[_0x03cd('0x40')];}_0x3be9c2[_0x03cd('0x29')](_0x227a1c)[_0x03cd('0x41')](_0x161d43);};}exports[_0x03cd('0x42')]=function(_0x5345d3,_0x408da3){var _0x3fb42e={},_0x473e2f={},_0x49f5e9={'count':0x0,'rows':[]};var _0x25e367=_[_0x03cd('0x3a')](db[_0x03cd('0x43')][_0x03cd('0x44')],function(_0x36eb53){return{'name':_0x36eb53[_0x03cd('0x45')],'type':_0x36eb53['type'][_0x03cd('0x46')]};});_0x473e2f[_0x03cd('0x47')]=_[_0x03cd('0x48')](_[_0x03cd('0x3a')](_0x25e367,_0x03cd('0x40')),[_0x03cd('0x49'),_0x03cd('0x4a')]);_0x473e2f['query']=_['keys'](_0x5345d3[_0x03cd('0x4b')]);_0x473e2f[_0x03cd('0x4c')]=_[_0x03cd('0x4d')](_0x473e2f[_0x03cd('0x47')],_0x473e2f[_0x03cd('0x4b')]);_0x3fb42e[_0x03cd('0x4e')]=_[_0x03cd('0x4d')](_0x473e2f['model'],qs[_0x03cd('0x4f')](_0x5345d3[_0x03cd('0x4b')][_0x03cd('0x4f')]));_0x3fb42e[_0x03cd('0x4e')]=_0x3fb42e[_0x03cd('0x4e')][_0x03cd('0x50')]?_0x3fb42e['attributes']:_0x473e2f['model'];if(!_0x5345d3['query']['hasOwnProperty'](_0x03cd('0x51'))){_0x3fb42e[_0x03cd('0x2d')]=qs[_0x03cd('0x2d')](_0x5345d3[_0x03cd('0x4b')][_0x03cd('0x2d')]);_0x3fb42e[_0x03cd('0x2c')]=qs[_0x03cd('0x2c')](_0x5345d3[_0x03cd('0x4b')]['offset']);}_0x3fb42e['order']=qs[_0x03cd('0x52')](_0x5345d3[_0x03cd('0x4b')]['sort']);_0x3fb42e['where']=qs['filters'](_[_0x03cd('0x53')](_0x5345d3[_0x03cd('0x4b')],_0x473e2f['filters']));if(_0x5345d3[_0x03cd('0x4b')][_0x03cd('0x54')]){_0x3fb42e[_0x03cd('0x55')]=_['merge'](_0x3fb42e[_0x03cd('0x55')],{'$or':_[_0x03cd('0x3a')](_0x25e367,function(_0xa98f84){if(_0xa98f84[_0x03cd('0x56')]!==_0x03cd('0x57')){return db['sequelize'][_0x03cd('0x55')](db[_0x03cd('0x58')]['fn'](_0x03cd('0x59'),db[_0x03cd('0x58')][_0x03cd('0x5a')](_0xa98f84[_0x03cd('0x40')])),{'$like':db[_0x03cd('0x58')]['fn']('lower','%'+_0x5345d3[_0x03cd('0x4b')][_0x03cd('0x54')]+'%')});}})});}_0x3fb42e=_[_0x03cd('0x5b')]({},_0x3fb42e,_0x5345d3[_0x03cd('0x5c')]);var _0x265788={'where':_0x3fb42e[_0x03cd('0x55')]};return db[_0x03cd('0x43')]['count'](_0x265788)[_0x03cd('0x1f')](function(_0x13fffb){_0x49f5e9[_0x03cd('0x2b')]=_0x13fffb;if(_0x5345d3[_0x03cd('0x4b')]['includeAll']){_0x3fb42e[_0x03cd('0x5d')]=[{'all':!![]}];}return db[_0x03cd('0x43')][_0x03cd('0x5e')](_0x3fb42e);})[_0x03cd('0x1f')](function(_0x40a22c){_0x49f5e9[_0x03cd('0x5f')]=_0x40a22c;return _0x49f5e9;})[_0x03cd('0x1f')](respondWithFilteredResult(_0x408da3,_0x3fb42e))[_0x03cd('0x27')](handleError(_0x408da3,null));};exports[_0x03cd('0x60')]=function(_0x5b0502,_0xca371a){var _0x340b86={'raw':![],'where':{'id':_0x5b0502[_0x03cd('0x61')]['id']}},_0x562261={};_0x562261['model']=_['differenceBy'](_['keys'](db[_0x03cd('0x43')][_0x03cd('0x44')]),[_0x03cd('0x49'),_0x03cd('0x4a')]);_0x562261['query']=_[_0x03cd('0x62')](_0x5b0502[_0x03cd('0x4b')]);_0x562261[_0x03cd('0x4c')]=_[_0x03cd('0x4d')](_0x562261[_0x03cd('0x47')],_0x562261[_0x03cd('0x4b')]);_0x340b86['attributes']=_['intersection'](_0x562261['model'],qs[_0x03cd('0x4f')](_0x5b0502[_0x03cd('0x4b')][_0x03cd('0x4f')]));_0x340b86[_0x03cd('0x4e')]=_0x340b86[_0x03cd('0x4e')][_0x03cd('0x50')]?_0x340b86[_0x03cd('0x4e')]:_0x562261[_0x03cd('0x47')];if(_0x5b0502['query'][_0x03cd('0x63')]){_0x340b86[_0x03cd('0x5d')]=[{'all':!![]}];}_0x340b86=_[_0x03cd('0x5b')]({},_0x340b86,_0x5b0502[_0x03cd('0x5c')]);return db[_0x03cd('0x43')]['find'](_0x340b86)[_0x03cd('0x1f')](handleEntityNotFound(_0xca371a,null))[_0x03cd('0x1f')](respondWithResult(_0xca371a,null))[_0x03cd('0x27')](handleError(_0xca371a,null));};exports[_0x03cd('0x64')]=function(_0x4b44fc,_0xbdc67c){return db[_0x03cd('0x43')][_0x03cd('0x64')](_0x4b44fc[_0x03cd('0x65')],{'raw':![],'individualHooks':!![]})[_0x03cd('0x1f')](respondWithResult(_0xbdc67c,0xc9))[_0x03cd('0x27')](handleError(_0xbdc67c,null));};exports[_0x03cd('0x31')]=function(_0x1e5f00,_0xc00247){if(_0x1e5f00['body']['id']){delete _0x1e5f00['body']['id'];}delete _0x1e5f00[_0x03cd('0x65')][_0x03cd('0x3d')];return db[_0x03cd('0x43')]['find']({'where':{'id':_0x1e5f00['params']['id']}})[_0x03cd('0x1f')](handleEntityNotFound(_0xc00247,null))[_0x03cd('0x1f')](saveUpdates(_0x1e5f00['body'],null))[_0x03cd('0x1f')](respondWithResult(_0xc00247,null))[_0x03cd('0x27')](handleError(_0xc00247,null));};exports[_0x03cd('0x66')]=function(_0x1c64e2,_0x475ddb){return db[_0x03cd('0x43')][_0x03cd('0x66')]()[_0x03cd('0x1f')](respondWithResult(_0x475ddb,null))[_0x03cd('0x27')](handleError(_0x475ddb,null));};exports[_0x03cd('0x67')]=function(_0x41c266,_0x351b03,_0x541543){return db['User'][_0x03cd('0x68')]({'where':{'id':_0x41c266[_0x03cd('0x61')]['id']}})[_0x03cd('0x1f')](handleEntityNotFound(_0x351b03,null))[_0x03cd('0x1f')](function(_0x2c8324){if(_0x2c8324){return _0x2c8324[_0x03cd('0x67')](_0x41c266['body'][_0x03cd('0x69')],_[_0x03cd('0x6a')](_0x41c266[_0x03cd('0x65')],['ids','id'])||{});}})[_0x03cd('0x1f')](respondWithResult(_0x351b03,null))[_0x03cd('0x27')](handleError(_0x351b03,null));};var getLicense=function(_0x1e331b){return new BPromise(function(_0x406d90,_0x2bcfff){var _0x5563b5=0x0;_0x1e331b[_0x03cd('0x65')]['role']==='agent'&&_0x406d90(_0x03cd('0x6b'));return db[_0x03cd('0x43')]['count']({'where':{'$or':[{'role':_0x1e331b[_0x03cd('0x65')][_0x03cd('0x3d')]==='telephone'?_0x03cd('0x38'):[_0x03cd('0x6c'),_0x03cd('0x35')]}]}})[_0x03cd('0x1f')](function(_0x25440f){_0x5563b5=_0x25440f;return require(_0x03cd('0x6d'))['getLicense']();})[_0x03cd('0x1f')](function(_0x4cdb16){var _0x29adf1=_0x1e331b[_0x03cd('0x65')]['role']===_0x03cd('0x38')?_0x03cd('0x6e'):'users';if(!_[_0x03cd('0x6f')](_0x4cdb16[_0x29adf1])&&_0x5563b5>=_0x4cdb16[_0x29adf1]){return _0x2bcfff({'message':_0x03cd('0x70')});}return _0x406d90(util[_0x03cd('0x71')](_0x03cd('0x72'),_0x29adf1,_0x5563b5));})['catch'](function(_0x51581b){return _0x2bcfff(_0x51581b);});});};exports[_0x03cd('0x73')]=function(_0x4fbed5,_0x4a6365){return getLicense(_0x4fbed5)[_0x03cd('0x1f')](function(_0x178043){if(!_0x4fbed5[_0x03cd('0x65')][_0x03cd('0x74')]){var _0xb56e0;return db['Setting'][_0x03cd('0x75')](0x1)[_0x03cd('0x1f')](function(_0x2296d9){return checkPasswordPattern(_0x2296d9,_0x4fbed5[_0x03cd('0x65')][_0x03cd('0x49')],_0x2296d9[_0x03cd('0x76')]);})['then'](function(_0x13a453){_0xb56e0=_0x13a453['min_internal'];return db[_0x03cd('0x43')]['max']('internal');})['then'](function(_0x4b7eb3){if(_[_0x03cd('0x6f')](_0x4b7eb3)){if(_0xb56e0){_0x4fbed5[_0x03cd('0x65')][_0x03cd('0x74')]=_0xb56e0;}else{_0x4fbed5[_0x03cd('0x65')][_0x03cd('0x74')]=0x1;}}else{if(_[_0x03cd('0x6f')](_0xb56e0)||_0xb56e0==_0x4b7eb3){_0x4fbed5[_0x03cd('0x65')]['internal']=_0x4b7eb3+0x1;}else if(_0xb56e0>_0x4b7eb3){_0x4fbed5['body']['internal']=_0xb56e0;}else{return db['sequelize'][_0x03cd('0x4b')](_0x03cd('0x77'),{'type':db['sequelize'][_0x03cd('0x78')][_0x03cd('0x79')]})[_0x03cd('0x1f')](function(_0x57a6df){if(_0x57a6df&&_0x57a6df[_0x03cd('0x50')]){for(var _0x29c5a8=0x0,_0x1727b4=_0x57a6df['length'];_0x29c5a8<_0x1727b4&&_[_0x03cd('0x6f')](_0x4fbed5['body'][_0x03cd('0x74')]);_0x29c5a8++){if(_0xb56e0<=_0x57a6df[_0x29c5a8]['from']){_0x4fbed5['body']['internal']=_0x57a6df[_0x29c5a8]['from'];}else if(_0xb56e0>_0x57a6df[_0x29c5a8][_0x03cd('0x7a')]&&_0xb56e0<=_0x57a6df[_0x29c5a8]['to']){_0x4fbed5['body'][_0x03cd('0x74')]=_0xb56e0;}}}if(_[_0x03cd('0x6f')](_0x4fbed5[_0x03cd('0x65')][_0x03cd('0x74')])){_0x4fbed5[_0x03cd('0x65')][_0x03cd('0x74')]=_0x4b7eb3+0x1;}});}}});}})[_0x03cd('0x1f')](function(){if(_0x4fbed5[_0x03cd('0x65')]['voicemail']){_0x4fbed5[_0x03cd('0x65')][_0x03cd('0x7b')]=_0x4fbed5['body']['internal'];_0x4fbed5[_0x03cd('0x65')][_0x03cd('0x7c')]={'mailbox':_0x4fbed5[_0x03cd('0x65')][_0x03cd('0x74')],'password':_0x4fbed5[_0x03cd('0x65')]['password'],'fullname':_0x4fbed5[_0x03cd('0x65')]['fullname'],'email':_0x4fbed5[_0x03cd('0x65')][_0x03cd('0x7d')]};}if(_0x4fbed5[_0x03cd('0x65')]&&_0x4fbed5['body'][_0x03cd('0x3d')]===_0x03cd('0x7e')){_0x4fbed5[_0x03cd('0x65')]['permissions']=[_0x03cd('0x7f'),_0x03cd('0x80'),_0x03cd('0x81'),_0x03cd('0x82'),'104',_0x03cd('0x83'),'106',_0x03cd('0x84'),'108',_0x03cd('0x85'),_0x03cd('0x86'),'111'];}return db[_0x03cd('0x43')][_0x03cd('0x73')](_0x4fbed5[_0x03cd('0x65')],{'include':[{'model':db[_0x03cd('0x7c')],'as':'VoiceMail'}]});})['then'](function(_0x19ea31){if(_0x4fbed5[_0x03cd('0x65')][_0x03cd('0x3d')]===_0x03cd('0x35'))return _0x19ea31;var _0x40bf05=_0x4fbed5['user'][_0x03cd('0x33')]({'plain':!![]});if(!_0x40bf05)throw new Error(_0x03cd('0x87'));if(_0x40bf05['role']===_0x03cd('0x35')){var _0x348574=_0x19ea31[_0x03cd('0x33')]({'plain':!![]});var _0x3d247a=[{'name':_0x03cd('0x36'),'value':_0x03cd('0x7e')},{'name':'Telephones','value':_0x03cd('0x38')}];var _0x1c170e=_['find'](_0x3d247a,[_0x03cd('0x3b'),_0x348574[_0x03cd('0x3d')]])[_0x03cd('0x40')];return db[_0x03cd('0x88')][_0x03cd('0x68')]({'where':{'name':_0x1c170e,'userProfileId':_0x40bf05[_0x03cd('0x89')]},'raw':!![]})[_0x03cd('0x1f')](function(_0x290b03){if(_0x290b03&&_0x290b03[_0x03cd('0x8a')]===0x0){return db['UserProfileResource'][_0x03cd('0x73')]({'name':_0x348574[_0x03cd('0x40')],'resourceId':_0x348574['id'],'type':_0x290b03[_0x03cd('0x40')],'sectionId':_0x290b03['id']},{})['then'](function(){return _0x19ea31;});}else{return _0x19ea31;}})[_0x03cd('0x27')](function(_0x4991d7){logger['error'](_0x03cd('0x8b'),_0x4991d7);throw _0x4991d7;});}return _0x19ea31;})['then'](respondWithResult(_0x4a6365,0xc9))[_0x03cd('0x27')](handleError(_0x4a6365,null));};exports[_0x03cd('0x8c')]=function(_0x52a21c,_0x543c9b,_0x307b0f){var _0x172de5=![];if(_0x52a21c[_0x03cd('0x65')]['id']){delete _0x52a21c[_0x03cd('0x65')]['id'];}return db['Setting'][_0x03cd('0x8d')]({'attributes':['id',_0x03cd('0x76')]})[_0x03cd('0x1f')](function(_0x405f90){_0x172de5=_0x405f90[_0x03cd('0x76')];return db['User']['find']({'where':{'id':_0x52a21c['params']['id']}});})['then'](function(_0x3265a9){if(_0x3265a9){if(_0x3265a9['id']==_0x52a21c['user']['id']){if(!_0x52a21c['body'][_0x03cd('0x8e')]||!_0x52a21c[_0x03cd('0x65')][_0x03cd('0x8f')]){throw new db[(_0x03cd('0x1c'))][(_0x03cd('0x1d'))](_0x03cd('0x90'));}if(!_0x3265a9[_0x03cd('0x91')](_0x52a21c[_0x03cd('0x65')][_0x03cd('0x8e')])){throw new db[(_0x03cd('0x1c'))]['ValidationError'](_0x03cd('0x92'));}if(_0x52a21c[_0x03cd('0x65')][_0x03cd('0x8e')]==_0x52a21c[_0x03cd('0x65')][_0x03cd('0x8f')]){throw new db['Sequelize'][(_0x03cd('0x1d'))](_0x03cd('0x93'));}return _0x3265a9;}else if(_0x52a21c[_0x03cd('0x35')][_0x03cd('0x3d')]==_0x03cd('0x6c')){if(!_0x52a21c['body'][_0x03cd('0x8f')]){throw new db['Sequelize'][(_0x03cd('0x1d'))](_0x03cd('0x94'));}return _0x3265a9;}else if(_0x52a21c[_0x03cd('0x35')][_0x03cd('0x3d')]==_0x03cd('0x35')){if(!_0x52a21c[_0x03cd('0x65')][_0x03cd('0x8f')]){throw new db['Sequelize'][(_0x03cd('0x1d'))](_0x03cd('0x94'));}if(_0x3265a9[_0x03cd('0x3d')]!=_0x03cd('0x7e')){throw new db[(_0x03cd('0x1c'))]['ValidationError'](_0x03cd('0x95'));}return _0x3265a9;}else{throw new db[(_0x03cd('0x1c'))][(_0x03cd('0x1d'))](_0x03cd('0x95'));}}return null;})['then'](handleEntityNotFound(_0x543c9b,null))[_0x03cd('0x1f')](function(_0x177e76){return checkPasswordPattern(_0x177e76,_0x52a21c[_0x03cd('0x65')][_0x03cd('0x8f')],_0x172de5);})[_0x03cd('0x1f')](saveUpdates({'password':_0x52a21c['body'][_0x03cd('0x8f')],'passwordResetAt':_0x52a21c['user']['id']==_0x52a21c[_0x03cd('0x61')]['id']?moment():null},null))[_0x03cd('0x1f')](respondWithResult(_0x543c9b,null))[_0x03cd('0x27')](handleError(_0x543c9b,null));};exports[_0x03cd('0x96')]=function(_0x34106c,_0x296563,_0x21e722){var _0xa487b3=_0x34106c[_0x03cd('0x65')]['channel'];return db[_0x03cd('0x43')][_0x03cd('0x68')]({'where':{'id':_0x34106c['params']['id']},'attributes':['id','name',_0x03cd('0x3d'),_0x03cd('0x97'),_0x03cd('0x98'),_0x03cd('0x99'),'interface']})[_0x03cd('0x1f')](handleEntityNotFound(_0x296563,null))[_0x03cd('0x1f')](function(_0x24dd87){if(_0x24dd87){if(!utils[_0x03cd('0x9a')](_0xa487b3)){throw new db[(_0x03cd('0x1c'))][(_0x03cd('0x1d'))]('Unknown\x20channel');}return _0x24dd87[_0x03cd('0x9b')+_[_0x03cd('0x9c')](_0xa487b3[_0x03cd('0x9d')]())+_0x03cd('0x9e')](_0x34106c[_0x03cd('0x65')][_0x03cd('0x69')],{'penalty':_0x34106c[_0x03cd('0x65')][_0x03cd('0x9f')]||0x0})[_0x03cd('0xa0')](function(_0x1151f5){for(var _0x5d6fac=0x0;_0x5d6fac<_0x34106c[_0x03cd('0x65')][_0x03cd('0x69')][_0x03cd('0x50')];_0x5d6fac+=0x1){var _0x2f5f5e={'UserId':_0x34106c['params']['id']};_0x2f5f5e[_[_0x03cd('0x9c')](_0xa487b3[_0x03cd('0x9d')]())+_0x03cd('0xa1')]=_0x34106c[_0x03cd('0x65')][_0x03cd('0x69')][_0x5d6fac];socket[_0x03cd('0xa2')](_0x03cd('0x35')+_[_0x03cd('0x9c')](_0xa487b3['toLowerCase']())+'Queue:save',_0x2f5f5e);}return _0x1151f5;})[_0x03cd('0x1f')](function(){if(_0xa487b3===_0x03cd('0xa3')){return db['VoiceQueue'][_0x03cd('0x5e')]({'where':{'id':_0x34106c[_0x03cd('0x65')][_0x03cd('0x69')]||[]},'raw':!![],'attributes':['id',_0x03cd('0x40')]});}})['then'](function(_0x2c2532){var _0x5a6e94=_0x24dd87['get']({'plain':!![]});var _0x29bcb1=[];if(_0xa487b3===_0x03cd('0xa3')&&_0x5a6e94[_0x03cd('0x3d')]===_0x03cd('0x7e')&&_0x5a6e94['online']){for(var _0x340f68=0x0;_0x340f68<_0x2c2532[_0x03cd('0x50')];_0x340f68+=0x1){_0x29bcb1[_0x03cd('0xa4')]({'membername':_0x5a6e94[_0x03cd('0x40')],'UserId':_0x5a6e94['id'],'queue_name':_0x2c2532[_0x340f68][_0x03cd('0x40')],'VoiceQueueId':_0x2c2532[_0x340f68]['id'],'interface':_['isNil'](_0x5a6e94[_0x03cd('0xa5')])?util[_0x03cd('0x71')](_0x03cd('0xa6'),_0x5a6e94[_0x03cd('0x40')]):_0x5a6e94[_0x03cd('0xa5')],'paused':_0x5a6e94[_0x03cd('0x99')]||![],'penalty':_0x34106c[_0x03cd('0x65')]['penalty']||0x0});}return BPromise['each'](_0x29bcb1,function(_0x226440){return db['UserVoiceQueueRt'][_0x03cd('0xa7')](_0x226440);});}return _0x24dd87;});}})[_0x03cd('0x1f')](respondWithStatusCode(_0x296563,null))[_0x03cd('0x27')](handleError(_0x296563,null));};exports[_0x03cd('0xa8')]=function(_0x50a5ce,_0x2dc702,_0x1f1243){var _0x25e159;return db[_0x03cd('0x43')][_0x03cd('0x68')]({'where':{'id':_0x50a5ce[_0x03cd('0x61')]['id']},'attributes':['id',_0x03cd('0x40'),_0x03cd('0x3d')]})[_0x03cd('0x1f')](handleEntityNotFound(_0x2dc702,null))[_0x03cd('0x1f')](function(_0x3b42bf){if(_0x3b42bf){_0x25e159=_0x3b42bf;if(!_0x50a5ce[_0x03cd('0x4b')][_0x03cd('0xa9')]||!utils[_0x03cd('0x9a')](_0x50a5ce[_0x03cd('0x4b')][_0x03cd('0xa9')])){throw new db[(_0x03cd('0x1c'))][(_0x03cd('0x1d'))](_0x03cd('0xaa'));}return _0x3b42bf[_0x03cd('0xab')+_['capitalize'](_0x50a5ce['query']['channel'][_0x03cd('0x9d')]())+'Queues'](_0x50a5ce[_0x03cd('0x4b')][_0x03cd('0x69')]);}})['then'](function(_0x44789b){for(var _0x2bef5f=0x0;_0x2bef5f<_0x50a5ce[_0x03cd('0x4b')]['ids'][_0x03cd('0x50')];_0x2bef5f+=0x1){var _0x45245f={'UserId':_0x50a5ce[_0x03cd('0x61')]['id']};_0x45245f[_['capitalize'](_0x50a5ce[_0x03cd('0x4b')][_0x03cd('0xa9')][_0x03cd('0x9d')]())+_0x03cd('0xa1')]=_0x50a5ce['query'][_0x03cd('0x69')][_0x2bef5f];socket[_0x03cd('0xa2')]('user'+_[_0x03cd('0x9c')](_0x50a5ce[_0x03cd('0x4b')]['channel'][_0x03cd('0x9d')]())+_0x03cd('0xac'),_0x45245f);}return _0x44789b;})[_0x03cd('0x1f')](function(){if(_0x50a5ce[_0x03cd('0x4b')]['channel']===_0x03cd('0xa3')){return db[_0x03cd('0xad')][_0x03cd('0x32')]({'where':{'UserId':_0x50a5ce['params']['id'],'VoiceQueueId':_0x50a5ce['query'][_0x03cd('0x69')]},'individualHooks':!![]})[_0x03cd('0x1f')](function(){return _0x25e159;});}return _0x25e159;})[_0x03cd('0x1f')](respondWithStatusCode(_0x2dc702,null))[_0x03cd('0x27')](handleError(_0x2dc702,null));};exports[_0x03cd('0xae')]=function(_0x5928f6,_0x175466,_0x104a55){_0x5928f6[_0x03cd('0x65')][_0x03cd('0xaf')]=_0x5928f6[_0x03cd('0xb0')][_0x03cd('0xb1')];return db[_0x03cd('0x43')]['find']({'where':{'id':_0x5928f6[_0x03cd('0x61')]['id']}})[_0x03cd('0x1f')](handleEntityNotFound(_0x175466,null))[_0x03cd('0x1f')](saveUpdates(_0x5928f6[_0x03cd('0x65')],null))['then'](respondWithResult(_0x175466,null))[_0x03cd('0x27')](handleError(_0x175466,null));};exports[_0x03cd('0xb2')]=function(_0x4acb9a,_0x1a3ebb,_0x493087){var _0x1ee6f0=path[_0x03cd('0xb3')](config['root'],_0x03cd('0xb4'));return db['User'][_0x03cd('0x68')]({'where':{'id':_0x4acb9a[_0x03cd('0x61')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x03cd('0x1f')](handleEntityNotFound(_0x1a3ebb,null))[_0x03cd('0x1f')](function(_0x279b93){if(_0x279b93){if(_[_0x03cd('0x6f')](_0x279b93[_0x03cd('0xaf')])){return _0x1a3ebb[_0x03cd('0xb5')](_0x1ee6f0);}else{if(!fs[_0x03cd('0xb6')](path[_0x03cd('0xb3')](config[_0x03cd('0xb7')],_0x03cd('0xb8'),_0x279b93[_0x03cd('0xaf')]))){return _0x1a3ebb[_0x03cd('0xb5')](_0x1ee6f0);}return _0x1a3ebb[_0x03cd('0xb5')](path['join'](config[_0x03cd('0xb7')],_0x03cd('0xb8'),_0x279b93[_0x03cd('0xaf')]));}}})[_0x03cd('0x27')](handleError(_0x1a3ebb,null));};exports['getContacts']=function(_0x5af3e4,_0xd8302b,_0x975ebf){var _0x18c87f={};var _0xd0042c={};var _0x1f46d2;var _0x3e15d6;return db[_0x03cd('0x43')]['findOne']({'where':{'id':_0x5af3e4[_0x03cd('0x61')]['id']}})['then'](handleEntityNotFound(_0xd8302b,null))[_0x03cd('0x1f')](function(_0x399cce){if(_0x399cce){_0x1f46d2=_0x399cce;_0xd0042c['model']=_[_0x03cd('0x62')](db['CmContact'][_0x03cd('0x44')]);_0xd0042c[_0x03cd('0x4b')]=_['keys'](_0x5af3e4[_0x03cd('0x4b')]);_0xd0042c['filters']=_[_0x03cd('0x4d')](_0xd0042c[_0x03cd('0x47')],_0xd0042c['query']);_0x18c87f['attributes']=_['intersection'](_0xd0042c[_0x03cd('0x47')],qs['fields'](_0x5af3e4[_0x03cd('0x4b')][_0x03cd('0x4f')]));_0x18c87f['attributes']=_0x18c87f['attributes'][_0x03cd('0x50')]?_0x18c87f['attributes']:_0xd0042c[_0x03cd('0x47')];_0x18c87f['order']=qs['sort'](_0x5af3e4[_0x03cd('0x4b')][_0x03cd('0x52')]);_0x18c87f[_0x03cd('0x55')]=qs[_0x03cd('0x4c')](_[_0x03cd('0x53')](_0x5af3e4[_0x03cd('0x4b')],_0xd0042c['filters']));if(_0x5af3e4[_0x03cd('0x4b')][_0x03cd('0x54')]){_0x18c87f[_0x03cd('0x55')]=_[_0x03cd('0x5b')](_0x18c87f[_0x03cd('0x55')],{'$or':_[_0x03cd('0x3a')](_0x18c87f[_0x03cd('0x4e')],function(_0x54480b){var _0x1527fb={};_0x1527fb[_0x54480b]={'$like':'%'+_0x5af3e4['query'][_0x03cd('0x54')]+'%'};return _0x1527fb;})});}_0x18c87f=_[_0x03cd('0x5b')]({},_0x18c87f,_0x5af3e4[_0x03cd('0x5c')]);return _0x1f46d2[_0x03cd('0xb9')](_0x18c87f);}})[_0x03cd('0x1f')](function(_0x429775){if(_0x429775){_0x3e15d6=_0x429775[_0x03cd('0x50')];if(_0x5af3e4[_0x03cd('0x4b')][_0x03cd('0xba')](_0x03cd('0x63'))){_0x18c87f[_0x03cd('0x5d')]=[{'model':db[_0x03cd('0xbb')],'as':'List','required':![]},{'model':db['Tag'],'as':_0x03cd('0xbc'),'attributes':['id',_0x03cd('0x40'),_0x03cd('0xbd')],'where':_0x5af3e4[_0x03cd('0x4b')][_0x03cd('0xbe')]?{'id':_0x5af3e4['query']['tag']}:undefined,'required':_0x5af3e4[_0x03cd('0x4b')][_0x03cd('0xbe')]?!![]:![]}];}if(!_0x5af3e4[_0x03cd('0x4b')][_0x03cd('0xba')](_0x03cd('0x51'))){_0x18c87f[_0x03cd('0x2d')]=qs[_0x03cd('0x2d')](_0x5af3e4[_0x03cd('0x4b')][_0x03cd('0x2d')]);_0x18c87f[_0x03cd('0x2c')]=qs[_0x03cd('0x2c')](_0x5af3e4[_0x03cd('0x4b')][_0x03cd('0x2c')]);}return _0x1f46d2[_0x03cd('0xb9')](_0x18c87f);}})[_0x03cd('0x1f')](function(_0x22359d){if(_0x22359d){return _0x22359d?{'count':_0x3e15d6,'rows':_0x22359d}:null;}})[_0x03cd('0x1f')](respondWithResult(_0xd8302b,null))['catch'](handleError(_0xd8302b,null));};exports[_0x03cd('0xbf')]=function(_0x143290,_0x5e810f,_0x58e4db){var _0x3c94e0;var _0x392c51;var _0x25e2a4={};var _0x438717;return db[_0x03cd('0x43')][_0x03cd('0x8d')]({'where':{'id':_0x143290['params']['id']},'attributes':['id',_0x03cd('0x40'),'role']})[_0x03cd('0x1f')](handleEntityNotFound(_0x5e810f,null))['then'](function(_0x1c3fd1){if(!utils[_0x03cd('0x9a')](_0x143290[_0x03cd('0x4b')][_0x03cd('0xa9')])){throw new db[(_0x03cd('0x1c'))][(_0x03cd('0x1d'))]('Unknown\x20channel');}_0x3c94e0=_0x1c3fd1;var _0x4a3b9d={};_0x4a3b9d['model']=_[_0x03cd('0x62')](db[_[_0x03cd('0x9c')](_0x143290['query'][_0x03cd('0xa9')])+_0x03cd('0xc0')][_0x03cd('0x44')]);_0x4a3b9d[_0x03cd('0x4b')]=_[_0x03cd('0x62')](_0x143290['query']);_0x4a3b9d[_0x03cd('0x4c')]=_[_0x03cd('0x4d')](_0x4a3b9d[_0x03cd('0x47')],_0x4a3b9d['query']);_0x25e2a4[_0x03cd('0x4e')]=_[_0x03cd('0x4d')](_0x4a3b9d[_0x03cd('0x47')],qs['fields'](_0x143290[_0x03cd('0x4b')]['fields']));_0x25e2a4[_0x03cd('0x4e')]=_0x25e2a4[_0x03cd('0x4e')][_0x03cd('0x50')]?_0x25e2a4[_0x03cd('0x4e')]:_0x4a3b9d[_0x03cd('0x47')];_0x25e2a4['order']=qs[_0x03cd('0x52')](_0x143290[_0x03cd('0x4b')][_0x03cd('0x52')]);_0x25e2a4[_0x03cd('0x55')]=qs['filters'](_[_0x03cd('0x53')](_0x143290[_0x03cd('0x4b')],_0x4a3b9d[_0x03cd('0x4c')]));if(_0x143290[_0x03cd('0x4b')]['filter']){_0x25e2a4[_0x03cd('0x55')]=_[_0x03cd('0x5b')](_0x25e2a4[_0x03cd('0x55')],{'$or':_[_0x03cd('0x3a')](_0x25e2a4[_0x03cd('0x4e')],function(_0x1bc402){var _0x233296={};_0x233296[_0x1bc402]={'$like':'%'+_0x143290[_0x03cd('0x4b')][_0x03cd('0x54')]+'%'};return _0x233296;})});}_0x25e2a4=_[_0x03cd('0x5b')]({},_0x25e2a4,_0x143290['options']);switch(_0x3c94e0['role']){case _0x03cd('0x6c'):return db[_['capitalize'](_0x143290[_0x03cd('0x4b')][_0x03cd('0xa9')])+_0x03cd('0xc0')][_0x03cd('0x5e')](_0x25e2a4);case'user':case _0x03cd('0x7e'):return _0x3c94e0['get'+_[_0x03cd('0x9c')](_0x143290['query'][_0x03cd('0xa9')])+_0x03cd('0x9e')](_0x25e2a4);default:throw new db[(_0x03cd('0x1c'))][(_0x03cd('0x1d'))](_0x03cd('0xc1'));}})['then'](function(_0x1cd120){_0x438717=_0x1cd120[_0x03cd('0x50')];if(!_0x143290[_0x03cd('0x4b')][_0x03cd('0xba')](_0x03cd('0x51'))){_0x25e2a4[_0x03cd('0x2d')]=qs[_0x03cd('0x2d')](_0x143290[_0x03cd('0x4b')][_0x03cd('0x2d')]);_0x25e2a4[_0x03cd('0x2c')]=qs['offset'](_0x143290[_0x03cd('0x4b')]['offset']);}switch(_0x3c94e0[_0x03cd('0x3d')]){case'admin':return db[_[_0x03cd('0x9c')](_0x143290['query']['channel'])+'Queue'][_0x03cd('0x5e')](_0x25e2a4);case'user':case _0x03cd('0x7e'):return _0x3c94e0['get'+_['capitalize'](_0x143290['query'][_0x03cd('0xa9')])+_0x03cd('0x9e')](_0x25e2a4);}})[_0x03cd('0x1f')](function(_0x1c0af5){return{'count':_0x438717,'rows':_0x1c0af5};})[_0x03cd('0x1f')](respondWithResult(_0x5e810f,null))[_0x03cd('0x27')](handleError(_0x5e810f,null));};exports[_0x03cd('0xc2')]=function(_0x543433,_0x29730f,_0x2df01b){var _0x273a5e={};var _0x565ad6={};var _0x4d9c3a;var _0x9c7ad1;return db['User'][_0x03cd('0x8d')]({'where':{'id':_0x543433['params']['id']}})[_0x03cd('0x1f')](handleEntityNotFound(_0x29730f,null))[_0x03cd('0x1f')](function(_0x2aa9bc){if(_0x2aa9bc){_0x4d9c3a=_0x2aa9bc;_0x565ad6[_0x03cd('0x47')]=_[_0x03cd('0x62')](db['UserVoiceQueueRt'][_0x03cd('0x44')]);_0x565ad6[_0x03cd('0x4b')]=_[_0x03cd('0x62')](_0x543433['query']);_0x565ad6[_0x03cd('0x4c')]=_[_0x03cd('0x4d')](_0x565ad6['model'],_0x565ad6['query']);_0x273a5e['attributes']=_['intersection'](_0x565ad6['model'],qs[_0x03cd('0x4f')](_0x543433['query'][_0x03cd('0x4f')]));_0x273a5e[_0x03cd('0x4e')]=_0x273a5e[_0x03cd('0x4e')][_0x03cd('0x50')]?_0x273a5e[_0x03cd('0x4e')]:_0x565ad6[_0x03cd('0x47')];_0x273a5e[_0x03cd('0xc3')]=qs[_0x03cd('0x52')](_0x543433[_0x03cd('0x4b')][_0x03cd('0x52')]);_0x273a5e['where']=qs[_0x03cd('0x4c')](_[_0x03cd('0x53')](_0x543433[_0x03cd('0x4b')],_0x565ad6['filters']));if(_0x543433['query']['filter']){_0x273a5e[_0x03cd('0x55')]=_['merge'](_0x273a5e[_0x03cd('0x55')],{'$or':_[_0x03cd('0x3a')](_0x273a5e['attributes'],function(_0x2f681c){var _0x1663ec={};_0x1663ec[_0x2f681c]={'$like':'%'+_0x543433[_0x03cd('0x4b')][_0x03cd('0x54')]+'%'};return _0x1663ec;})});}_0x273a5e=_[_0x03cd('0x5b')]({},_0x273a5e,_0x543433[_0x03cd('0x5c')]);return _0x4d9c3a[_0x03cd('0xc2')](_0x273a5e);}})[_0x03cd('0x1f')](function(_0x387b0b){if(_0x387b0b){_0x9c7ad1=_0x387b0b[_0x03cd('0x50')];if(!_0x543433[_0x03cd('0x4b')]['hasOwnProperty'](_0x03cd('0x51'))){_0x273a5e[_0x03cd('0x2d')]=qs[_0x03cd('0x2d')](_0x543433['query'][_0x03cd('0x2d')]);_0x273a5e[_0x03cd('0x2c')]=qs[_0x03cd('0x2c')](_0x543433['query'][_0x03cd('0x2c')]);}return _0x4d9c3a['getVoiceQueuesRt'](_0x273a5e);}})[_0x03cd('0x1f')](function(_0x57bc23){if(_0x57bc23){return _0x57bc23?{'count':_0x9c7ad1,'rows':_0x57bc23}:null;}})[_0x03cd('0x1f')](respondWithResult(_0x29730f,null))['catch'](handleError(_0x29730f,null));};exports[_0x03cd('0xc4')]=function(_0x3f353d,_0x4f63f7,_0xc5c93b){var _0x4ac4d7={};var _0x13cbe2={};var _0x2db7a4;var _0xc2685c;return db[_0x03cd('0x43')]['findOne']({'where':{'id':_0x3f353d[_0x03cd('0x61')]['id']}})[_0x03cd('0x1f')](handleEntityNotFound(_0x4f63f7,null))['then'](function(_0x191577){if(_0x191577){_0x2db7a4=_0x191577;_0x13cbe2['model']=_[_0x03cd('0x62')](db['ChatGroup'][_0x03cd('0x44')]);_0x13cbe2[_0x03cd('0x4b')]=_[_0x03cd('0x62')](_0x3f353d['query']);_0x13cbe2[_0x03cd('0x4c')]=_['intersection'](_0x13cbe2['model'],_0x13cbe2[_0x03cd('0x4b')]);_0x4ac4d7[_0x03cd('0x4e')]=_[_0x03cd('0x4d')](_0x13cbe2['model'],qs['fields'](_0x3f353d['query']['fields']));_0x4ac4d7[_0x03cd('0x4e')]=_0x4ac4d7[_0x03cd('0x4e')][_0x03cd('0x50')]?_0x4ac4d7['attributes']:_0x13cbe2[_0x03cd('0x47')];_0x4ac4d7[_0x03cd('0xc3')]=qs[_0x03cd('0x52')](_0x3f353d[_0x03cd('0x4b')]['sort']);_0x4ac4d7['where']=qs[_0x03cd('0x4c')](_['pick'](_0x3f353d[_0x03cd('0x4b')],_0x13cbe2[_0x03cd('0x4c')]));if(_0x3f353d[_0x03cd('0x4b')][_0x03cd('0x54')]){_0x4ac4d7[_0x03cd('0x55')]=_[_0x03cd('0x5b')](_0x4ac4d7['where'],{'$or':_[_0x03cd('0x3a')](_0x4ac4d7[_0x03cd('0x4e')],function(_0xd69c02){var _0x5d6c6d={};_0x5d6c6d[_0xd69c02]={'$like':'%'+_0x3f353d['query'][_0x03cd('0x54')]+'%'};return _0x5d6c6d;})});}_0x4ac4d7=_[_0x03cd('0x5b')]({},_0x4ac4d7,_0x3f353d['options']);return _0x2db7a4[_0x03cd('0xc4')](_0x4ac4d7);}})['then'](function(_0x215b03){if(_0x215b03){_0xc2685c=_0x215b03[_0x03cd('0x50')];if(!_0x3f353d[_0x03cd('0x4b')][_0x03cd('0xba')]('nolimit')){_0x4ac4d7['limit']=qs['limit'](_0x3f353d[_0x03cd('0x4b')]['limit']);_0x4ac4d7[_0x03cd('0x2c')]=qs[_0x03cd('0x2c')](_0x3f353d[_0x03cd('0x4b')][_0x03cd('0x2c')]);}return _0x2db7a4['getGroups'](_0x4ac4d7);}})[_0x03cd('0x1f')](function(_0x6d230b){if(_0x6d230b){return _0x6d230b?{'count':_0xc2685c,'rows':_0x6d230b}:null;}})[_0x03cd('0x1f')](respondWithResult(_0x4f63f7,null))[_0x03cd('0x27')](handleError(_0x4f63f7,null));};exports[_0x03cd('0xc5')]=function(_0x3bdb96,_0x527da7,_0x278dbf){var _0x5e8c72={'raw':!![],'where':{}};var _0x39d5a3={};var _0x52f627={'count':0x0,'rows':[]};return db[_0x03cd('0x43')][_0x03cd('0x8d')]({'where':{'id':_0x3bdb96[_0x03cd('0x61')]['id']}})[_0x03cd('0x1f')](handleEntityNotFound(_0x527da7,null))['then'](function(_0x30551e){if(_0x30551e){_0x39d5a3[_0x03cd('0x47')]=_[_0x03cd('0x62')](db[_0x03cd('0xc6')][_0x03cd('0x44')]);_0x39d5a3[_0x03cd('0x4b')]=_[_0x03cd('0x62')](_0x3bdb96[_0x03cd('0x4b')]);_0x39d5a3[_0x03cd('0x4c')]=_[_0x03cd('0x4d')](_0x39d5a3[_0x03cd('0x47')],_0x39d5a3[_0x03cd('0x4b')]);_0x5e8c72[_0x03cd('0x4e')]=_[_0x03cd('0x4d')](_0x39d5a3[_0x03cd('0x47')],qs[_0x03cd('0x4f')](_0x3bdb96[_0x03cd('0x4b')][_0x03cd('0x4f')]));_0x5e8c72['attributes']=_0x5e8c72['attributes'][_0x03cd('0x50')]?_0x5e8c72[_0x03cd('0x4e')]:_0x39d5a3['model'];if(!_0x3bdb96[_0x03cd('0x4b')][_0x03cd('0xba')]('nolimit')){_0x5e8c72[_0x03cd('0x2d')]=qs['limit'](_0x3bdb96['query'][_0x03cd('0x2d')]);_0x5e8c72[_0x03cd('0x2c')]=qs[_0x03cd('0x2c')](_0x3bdb96[_0x03cd('0x4b')]['offset']);}_0x5e8c72['order']=qs['sort'](_0x3bdb96['query'][_0x03cd('0x52')]);_0x5e8c72[_0x03cd('0x55')]=qs[_0x03cd('0x4c')](_[_0x03cd('0x53')](_0x3bdb96['query'],_0x39d5a3[_0x03cd('0x4c')]));_0x5e8c72['where']['UserId']=_0x30551e['id'];if(_0x3bdb96[_0x03cd('0x4b')][_0x03cd('0x54')]){_0x5e8c72[_0x03cd('0x55')]=_[_0x03cd('0x5b')](_0x5e8c72['where'],{'$or':_[_0x03cd('0x3a')](_0x5e8c72[_0x03cd('0x4e')],function(_0x4a75a9){var _0x4b689c={};_0x4b689c[_0x4a75a9]={'$like':'%'+_0x3bdb96[_0x03cd('0x4b')][_0x03cd('0x54')]+'%'};return _0x4b689c;})});}_0x5e8c72=_[_0x03cd('0x5b')]({},_0x5e8c72,_0x3bdb96[_0x03cd('0x5c')]);return db[_0x03cd('0xc6')][_0x03cd('0x2b')]({'where':_0x5e8c72[_0x03cd('0x55')]})[_0x03cd('0x1f')](function(_0x475c45){_0x52f627[_0x03cd('0x2b')]=_0x475c45;if(_0x3bdb96[_0x03cd('0x4b')]['includeAll']){_0x5e8c72[_0x03cd('0x5d')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x5e8c72);})['then'](function(_0x35da94){_0x52f627[_0x03cd('0x5f')]=_0x35da94;return _0x52f627;});}})[_0x03cd('0x1f')](respondWithFilteredResult(_0x527da7,_0x5e8c72))[_0x03cd('0x27')](handleError(_0x527da7,null));};exports[_0x03cd('0xc7')]=function(_0x5baaf5,_0x577665,_0x1798c7){var _0x544486={'raw':!![],'where':{}};var _0x1cb2c1={};var _0x309920={'count':0x0,'rows':[]};return db[_0x03cd('0x43')][_0x03cd('0x8d')]({'where':{'id':_0x5baaf5['params']['id']}})[_0x03cd('0x1f')](handleEntityNotFound(_0x577665,null))[_0x03cd('0x1f')](function(_0x1c9ca2){if(_0x1c9ca2){_0x1cb2c1[_0x03cd('0x47')]=_[_0x03cd('0x62')](db['ScreenRecording'][_0x03cd('0x44')]);_0x1cb2c1[_0x03cd('0x4b')]=_[_0x03cd('0x62')](_0x5baaf5['query']);_0x1cb2c1[_0x03cd('0x4c')]=_[_0x03cd('0x4d')](_0x1cb2c1[_0x03cd('0x47')],_0x1cb2c1[_0x03cd('0x4b')]);_0x544486[_0x03cd('0x4e')]=_[_0x03cd('0x4d')](_0x1cb2c1[_0x03cd('0x47')],qs[_0x03cd('0x4f')](_0x5baaf5[_0x03cd('0x4b')]['fields']));_0x544486[_0x03cd('0x4e')]=_0x544486[_0x03cd('0x4e')][_0x03cd('0x50')]?_0x544486[_0x03cd('0x4e')]:_0x1cb2c1[_0x03cd('0x47')];if(!_0x5baaf5[_0x03cd('0x4b')][_0x03cd('0xba')](_0x03cd('0x51'))){_0x544486[_0x03cd('0x2d')]=qs[_0x03cd('0x2d')](_0x5baaf5['query'][_0x03cd('0x2d')]);_0x544486['offset']=qs[_0x03cd('0x2c')](_0x5baaf5[_0x03cd('0x4b')][_0x03cd('0x2c')]);}_0x544486[_0x03cd('0xc3')]=qs[_0x03cd('0x52')](_0x5baaf5[_0x03cd('0x4b')][_0x03cd('0x52')]);_0x544486[_0x03cd('0x55')]=qs[_0x03cd('0x4c')](_[_0x03cd('0x53')](_0x5baaf5[_0x03cd('0x4b')],_0x1cb2c1[_0x03cd('0x4c')]));_0x544486['where'][_0x03cd('0xc8')]=_0x1c9ca2['id'];if(_0x5baaf5[_0x03cd('0x4b')][_0x03cd('0x54')]){_0x544486[_0x03cd('0x55')]=_['merge'](_0x544486[_0x03cd('0x55')],{'$or':_[_0x03cd('0x3a')](_0x544486[_0x03cd('0x4e')],function(_0x3bdaa5){var _0x12ffb1={};_0x12ffb1[_0x3bdaa5]={'$like':'%'+_0x5baaf5[_0x03cd('0x4b')][_0x03cd('0x54')]+'%'};return _0x12ffb1;})});}_0x544486=_[_0x03cd('0x5b')]({},_0x544486,_0x5baaf5['options']);return db['ScreenRecording'][_0x03cd('0x2b')]({'where':_0x544486[_0x03cd('0x55')]})[_0x03cd('0x1f')](function(_0x34a540){_0x309920[_0x03cd('0x2b')]=_0x34a540;if(_0x5baaf5[_0x03cd('0x4b')][_0x03cd('0x63')]){_0x544486[_0x03cd('0x5d')]=[{'all':!![]}];}return db[_0x03cd('0xc9')]['findAll'](_0x544486);})['then'](function(_0x21bd0c){_0x309920['rows']=_0x21bd0c;return _0x309920;});}})[_0x03cd('0x1f')](respondWithFilteredResult(_0x577665,_0x544486))[_0x03cd('0x27')](handleError(_0x577665,null));};exports[_0x03cd('0xca')]=function(_0x356ba0,_0x2c25df,_0x17eab3){var _0x3a4e07={};var _0x57a814={};var _0x24ce51;var _0x392166;return db[_0x03cd('0x43')][_0x03cd('0x8d')]({'where':{'id':_0x356ba0[_0x03cd('0x61')]['id']}})['then'](handleEntityNotFound(_0x2c25df,null))['then'](function(_0x3da690){if(_0x3da690){_0x24ce51=_0x3da690;_0x57a814[_0x03cd('0x47')]=_[_0x03cd('0x62')](db['ChatInteraction']['rawAttributes']);_0x57a814['query']=_[_0x03cd('0x62')](_0x356ba0['query']);_0x57a814[_0x03cd('0x4c')]=_[_0x03cd('0x4d')](_0x57a814[_0x03cd('0x47')],_0x57a814[_0x03cd('0x4b')]);_0x3a4e07[_0x03cd('0x4e')]=_['intersection'](_0x57a814['model'],qs['fields'](_0x356ba0[_0x03cd('0x4b')]['fields']));_0x3a4e07['attributes']=_0x3a4e07[_0x03cd('0x4e')][_0x03cd('0x50')]?_0x3a4e07[_0x03cd('0x4e')]:_0x57a814['model'];_0x3a4e07[_0x03cd('0xc3')]=qs['sort'](_0x356ba0[_0x03cd('0x4b')]['sort']);_0x3a4e07['where']=qs[_0x03cd('0x4c')](_['pick'](_0x356ba0['query'],_0x57a814[_0x03cd('0x4c')]));if(_0x356ba0[_0x03cd('0x4b')][_0x03cd('0x54')]){_0x3a4e07[_0x03cd('0x55')]=_[_0x03cd('0x5b')](_0x3a4e07[_0x03cd('0x55')],{'$or':_[_0x03cd('0x3a')](_0x3a4e07['attributes'],function(_0xa550c9){var _0x4fa298={};_0x4fa298[_0xa550c9]={'$like':'%'+_0x356ba0[_0x03cd('0x4b')][_0x03cd('0x54')]+'%'};return _0x4fa298;})});}_0x3a4e07=_[_0x03cd('0x5b')]({},_0x3a4e07,_0x356ba0[_0x03cd('0x5c')]);return _0x24ce51[_0x03cd('0xca')](_0x3a4e07);}})[_0x03cd('0x1f')](function(_0x4a7ff8){if(_0x4a7ff8){_0x392166=_0x4a7ff8['length'];if(!_0x356ba0[_0x03cd('0x4b')][_0x03cd('0xba')]('nolimit')){_0x3a4e07[_0x03cd('0x2d')]=qs['limit'](_0x356ba0[_0x03cd('0x4b')]['limit']);_0x3a4e07[_0x03cd('0x2c')]=qs['offset'](_0x356ba0[_0x03cd('0x4b')][_0x03cd('0x2c')]);}return _0x24ce51[_0x03cd('0xca')](_0x3a4e07);}})[_0x03cd('0x1f')](function(_0xd0fb7e){if(_0xd0fb7e){return _0xd0fb7e?{'count':_0x392166,'rows':_0xd0fb7e}:null;}})['then'](respondWithResult(_0x2c25df,null))['catch'](handleError(_0x2c25df,null));};exports['getOpenchannelInteractions']=function(_0x5c7ade,_0x5a2f17,_0xa442ed){var _0x32cc4b={};var _0x5c0329={};var _0x411c33;var _0x40dd5d;return db[_0x03cd('0x43')][_0x03cd('0x8d')]({'where':{'id':_0x5c7ade['params']['id']}})[_0x03cd('0x1f')](handleEntityNotFound(_0x5a2f17,null))[_0x03cd('0x1f')](function(_0xfca8c6){if(_0xfca8c6){_0x411c33=_0xfca8c6;_0x5c0329[_0x03cd('0x47')]=_[_0x03cd('0x62')](db[_0x03cd('0xcb')][_0x03cd('0x44')]);_0x5c0329[_0x03cd('0x4b')]=_['keys'](_0x5c7ade[_0x03cd('0x4b')]);_0x5c0329['filters']=_[_0x03cd('0x4d')](_0x5c0329[_0x03cd('0x47')],_0x5c0329['query']);_0x32cc4b[_0x03cd('0x4e')]=_['intersection'](_0x5c0329['model'],qs[_0x03cd('0x4f')](_0x5c7ade['query'][_0x03cd('0x4f')]));_0x32cc4b[_0x03cd('0x4e')]=_0x32cc4b['attributes']['length']?_0x32cc4b[_0x03cd('0x4e')]:_0x5c0329[_0x03cd('0x47')];_0x32cc4b[_0x03cd('0xc3')]=qs['sort'](_0x5c7ade['query']['sort']);_0x32cc4b['where']=qs[_0x03cd('0x4c')](_[_0x03cd('0x53')](_0x5c7ade[_0x03cd('0x4b')],_0x5c0329[_0x03cd('0x4c')]));if(_0x5c7ade[_0x03cd('0x4b')][_0x03cd('0x54')]){_0x32cc4b[_0x03cd('0x55')]=_[_0x03cd('0x5b')](_0x32cc4b[_0x03cd('0x55')],{'$or':_[_0x03cd('0x3a')](_0x32cc4b[_0x03cd('0x4e')],function(_0x4d6c17){var _0xb730ab={};_0xb730ab[_0x4d6c17]={'$like':'%'+_0x5c7ade[_0x03cd('0x4b')]['filter']+'%'};return _0xb730ab;})});}_0x32cc4b=_[_0x03cd('0x5b')]({},_0x32cc4b,_0x5c7ade['options']);return _0x411c33[_0x03cd('0xcc')](_0x32cc4b);}})['then'](function(_0x31c508){if(_0x31c508){_0x40dd5d=_0x31c508[_0x03cd('0x50')];if(!_0x5c7ade[_0x03cd('0x4b')][_0x03cd('0xba')](_0x03cd('0x51'))){_0x32cc4b[_0x03cd('0x2d')]=qs[_0x03cd('0x2d')](_0x5c7ade[_0x03cd('0x4b')]['limit']);_0x32cc4b[_0x03cd('0x2c')]=qs[_0x03cd('0x2c')](_0x5c7ade['query'][_0x03cd('0x2c')]);}return _0x411c33[_0x03cd('0xcc')](_0x32cc4b);}})[_0x03cd('0x1f')](function(_0x820003){if(_0x820003){return _0x820003?{'count':_0x40dd5d,'rows':_0x820003}:null;}})[_0x03cd('0x1f')](respondWithResult(_0x5a2f17,null))[_0x03cd('0x27')](handleError(_0x5a2f17,null));};exports[_0x03cd('0xcd')]=function(_0x3f5153,_0x2d6212,_0x25f008){var _0x453a17={'raw':!![],'where':{}};var _0x1d1a80={};var _0x3b4269={'count':0x0,'rows':[]};return db[_0x03cd('0x43')]['findOne']({'where':{'id':_0x3f5153['params']['id']}})[_0x03cd('0x1f')](handleEntityNotFound(_0x2d6212,null))[_0x03cd('0x1f')](function(_0x5c9a87){if(_0x5c9a87){_0x1d1a80['model']=_[_0x03cd('0x62')](db[_0x03cd('0xce')]['rawAttributes']);_0x1d1a80[_0x03cd('0x4b')]=_[_0x03cd('0x62')](_0x3f5153['query']);_0x1d1a80[_0x03cd('0x4c')]=_[_0x03cd('0x4d')](_0x1d1a80[_0x03cd('0x47')],_0x1d1a80[_0x03cd('0x4b')]);_0x453a17[_0x03cd('0x4e')]=_[_0x03cd('0x4d')](_0x1d1a80['model'],qs[_0x03cd('0x4f')](_0x3f5153[_0x03cd('0x4b')][_0x03cd('0x4f')]));_0x453a17[_0x03cd('0x4e')]=_0x453a17[_0x03cd('0x4e')]['length']?_0x453a17['attributes']:_0x1d1a80[_0x03cd('0x47')];if(!_0x3f5153[_0x03cd('0x4b')][_0x03cd('0xba')](_0x03cd('0x51'))){_0x453a17[_0x03cd('0x2d')]=qs[_0x03cd('0x2d')](_0x3f5153[_0x03cd('0x4b')][_0x03cd('0x2d')]);_0x453a17[_0x03cd('0x2c')]=qs[_0x03cd('0x2c')](_0x3f5153['query'][_0x03cd('0x2c')]);}_0x453a17[_0x03cd('0xc3')]=qs['sort'](_0x3f5153['query'][_0x03cd('0x52')]);_0x453a17[_0x03cd('0x55')]=qs[_0x03cd('0x4c')](_[_0x03cd('0x53')](_0x3f5153['query'],_0x1d1a80[_0x03cd('0x4c')]));_0x453a17['where']['UserId']=_0x5c9a87['id'];if(_0x3f5153[_0x03cd('0x4b')][_0x03cd('0x54')]){_0x453a17[_0x03cd('0x55')]=_[_0x03cd('0x5b')](_0x453a17['where'],{'$or':_[_0x03cd('0x3a')](_0x453a17[_0x03cd('0x4e')],function(_0x2eb6c3){var _0x4a178e={};_0x4a178e[_0x2eb6c3]={'$like':'%'+_0x3f5153[_0x03cd('0x4b')][_0x03cd('0x54')]+'%'};return _0x4a178e;})});}_0x453a17=_['merge']({},_0x453a17,_0x3f5153[_0x03cd('0x5c')]);return db[_0x03cd('0xce')][_0x03cd('0x2b')]({'where':_0x453a17[_0x03cd('0x55')]})['then'](function(_0x14ccc0){_0x3b4269[_0x03cd('0x2b')]=_0x14ccc0;if(_0x3f5153['query']['includeAll']){_0x453a17['include']=[{'all':!![]}];}return db['MailInteraction'][_0x03cd('0x5e')](_0x453a17);})[_0x03cd('0x1f')](function(_0x311fc7){_0x3b4269[_0x03cd('0x5f')]=_0x311fc7;return _0x3b4269;});}})[_0x03cd('0x1f')](respondWithFilteredResult(_0x2d6212,_0x453a17))[_0x03cd('0x27')](handleError(_0x2d6212,null));};exports[_0x03cd('0xcf')]=function(_0x2cdf7a,_0x1931e3,_0xdee973){var _0x308fb0={};var _0x5a98ad={};var _0xe88a2d;var _0x42c614;return db[_0x03cd('0x43')][_0x03cd('0x8d')]({'where':{'id':_0x2cdf7a[_0x03cd('0x61')]['id']}})[_0x03cd('0x1f')](handleEntityNotFound(_0x1931e3,null))[_0x03cd('0x1f')](function(_0x192c17){if(_0x192c17){_0xe88a2d=_0x192c17;_0x5a98ad[_0x03cd('0x47')]=_[_0x03cd('0x62')](db[_0x03cd('0xd0')][_0x03cd('0x44')]);_0x5a98ad[_0x03cd('0x4b')]=_[_0x03cd('0x62')](_0x2cdf7a[_0x03cd('0x4b')]);_0x5a98ad[_0x03cd('0x4c')]=_[_0x03cd('0x4d')](_0x5a98ad[_0x03cd('0x47')],_0x5a98ad[_0x03cd('0x4b')]);_0x308fb0[_0x03cd('0x4e')]=_[_0x03cd('0x4d')](_0x5a98ad[_0x03cd('0x47')],qs[_0x03cd('0x4f')](_0x2cdf7a['query']['fields']));_0x308fb0[_0x03cd('0x4e')]=_0x308fb0[_0x03cd('0x4e')][_0x03cd('0x50')]?_0x308fb0[_0x03cd('0x4e')]:_0x5a98ad[_0x03cd('0x47')];_0x308fb0[_0x03cd('0xc3')]=qs[_0x03cd('0x52')](_0x2cdf7a[_0x03cd('0x4b')][_0x03cd('0x52')]);_0x308fb0[_0x03cd('0x55')]=qs[_0x03cd('0x4c')](_['pick'](_0x2cdf7a[_0x03cd('0x4b')],_0x5a98ad[_0x03cd('0x4c')]));if(_0x2cdf7a['query']['filter']){_0x308fb0[_0x03cd('0x55')]=_[_0x03cd('0x5b')](_0x308fb0[_0x03cd('0x55')],{'$or':_[_0x03cd('0x3a')](_0x308fb0[_0x03cd('0x4e')],function(_0x1fa323){var _0x23153e={};_0x23153e[_0x1fa323]={'$like':'%'+_0x2cdf7a[_0x03cd('0x4b')][_0x03cd('0x54')]+'%'};return _0x23153e;})});}_0x308fb0=_[_0x03cd('0x5b')]({},_0x308fb0,_0x2cdf7a['options']);return _0xe88a2d['getSmsInteractions'](_0x308fb0);}})[_0x03cd('0x1f')](function(_0x2ddc5f){if(_0x2ddc5f){_0x42c614=_0x2ddc5f[_0x03cd('0x50')];if(!_0x2cdf7a[_0x03cd('0x4b')][_0x03cd('0xba')](_0x03cd('0x51'))){_0x308fb0[_0x03cd('0x2d')]=qs['limit'](_0x2cdf7a['query']['limit']);_0x308fb0[_0x03cd('0x2c')]=qs['offset'](_0x2cdf7a[_0x03cd('0x4b')]['offset']);}return _0xe88a2d[_0x03cd('0xcf')](_0x308fb0);}})[_0x03cd('0x1f')](function(_0x2d9f9d){if(_0x2d9f9d){return _0x2d9f9d?{'count':_0x42c614,'rows':_0x2d9f9d}:null;}})[_0x03cd('0x1f')](respondWithResult(_0x1931e3,null))['catch'](handleError(_0x1931e3,null));};exports['getFaxInteractions']=function(_0x6451fb,_0x42186f,_0x3c31c8){var _0x177f79={};var _0x1ca3f7={};var _0x71db8c;var _0x21832e;return db[_0x03cd('0x43')][_0x03cd('0x8d')]({'where':{'id':_0x6451fb[_0x03cd('0x61')]['id']}})[_0x03cd('0x1f')](handleEntityNotFound(_0x42186f,null))[_0x03cd('0x1f')](function(_0x14ae63){if(_0x14ae63){_0x71db8c=_0x14ae63;_0x1ca3f7['model']=_[_0x03cd('0x62')](db[_0x03cd('0xd1')][_0x03cd('0x44')]);_0x1ca3f7[_0x03cd('0x4b')]=_['keys'](_0x6451fb['query']);_0x1ca3f7[_0x03cd('0x4c')]=_[_0x03cd('0x4d')](_0x1ca3f7[_0x03cd('0x47')],_0x1ca3f7[_0x03cd('0x4b')]);_0x177f79[_0x03cd('0x4e')]=_[_0x03cd('0x4d')](_0x1ca3f7['model'],qs['fields'](_0x6451fb['query'][_0x03cd('0x4f')]));_0x177f79['attributes']=_0x177f79[_0x03cd('0x4e')][_0x03cd('0x50')]?_0x177f79[_0x03cd('0x4e')]:_0x1ca3f7[_0x03cd('0x47')];_0x177f79['order']=qs['sort'](_0x6451fb[_0x03cd('0x4b')][_0x03cd('0x52')]);_0x177f79['where']=qs['filters'](_[_0x03cd('0x53')](_0x6451fb[_0x03cd('0x4b')],_0x1ca3f7[_0x03cd('0x4c')]));if(_0x6451fb[_0x03cd('0x4b')][_0x03cd('0x54')]){_0x177f79[_0x03cd('0x55')]=_[_0x03cd('0x5b')](_0x177f79[_0x03cd('0x55')],{'$or':_['map'](_0x177f79['attributes'],function(_0x759010){var _0x51a009={};_0x51a009[_0x759010]={'$like':'%'+_0x6451fb[_0x03cd('0x4b')][_0x03cd('0x54')]+'%'};return _0x51a009;})});}_0x177f79=_['merge']({},_0x177f79,_0x6451fb[_0x03cd('0x5c')]);return _0x71db8c[_0x03cd('0xd2')](_0x177f79);}})[_0x03cd('0x1f')](function(_0x414900){if(_0x414900){_0x21832e=_0x414900['length'];if(!_0x6451fb[_0x03cd('0x4b')][_0x03cd('0xba')](_0x03cd('0x51'))){_0x177f79[_0x03cd('0x2d')]=qs['limit'](_0x6451fb[_0x03cd('0x4b')][_0x03cd('0x2d')]);_0x177f79[_0x03cd('0x2c')]=qs[_0x03cd('0x2c')](_0x6451fb['query'][_0x03cd('0x2c')]);}return _0x71db8c[_0x03cd('0xd2')](_0x177f79);}})[_0x03cd('0x1f')](function(_0x336c4b){if(_0x336c4b){return _0x336c4b?{'count':_0x21832e,'rows':_0x336c4b}:null;}})[_0x03cd('0x1f')](respondWithResult(_0x42186f,null))[_0x03cd('0x27')](handleError(_0x42186f,null));};exports['login']=function(_0x3c50b8,_0x98bb5,_0xdab125){var _0x134982;var _0x9cccbc;var _0x241fc6;var _0x47923e=!_[_0x03cd('0x6f')](_0x3c50b8[_0x03cd('0x61')]['id'])?_0x3c50b8[_0x03cd('0x61')]['id']:!_[_0x03cd('0x6f')](_0x3c50b8['user']['id'])?_0x3c50b8[_0x03cd('0x35')]['id']:null;return db[_0x03cd('0x43')][_0x03cd('0x68')]({'where':{'id':_0x47923e,'role':{'$or':[_0x03cd('0x6c'),_0x03cd('0x35'),_0x03cd('0x7e')]}},'attributes':['id','name',_0x03cd('0xd3'),_0x03cd('0xd4'),'role',_0x03cd('0x74'),'loginInPause']})[_0x03cd('0x1f')](function(_0x167453){if(_0x167453){if(_0x167453[_0x03cd('0x3d')]===_0x03cd('0x7e')){_0x134982=_0x167453;if(_0x3c50b8[_0x03cd('0x65')][_0x03cd('0xa5')]){_0x241fc6=util[_0x03cd('0x71')](_0x03cd('0xd5'),_0x134982[_0x3c50b8[_0x03cd('0x65')]['interface']]);}else if(_0x3c50b8['body']['intrf']){_0x241fc6=util[_0x03cd('0x71')](_0x03cd('0xa6'),_0x3c50b8[_0x03cd('0x65')][_0x03cd('0xd6')]);}else{_0x241fc6=util[_0x03cd('0x71')](_0x03cd('0xa6'),_0x134982[_0x03cd('0x40')]);}socket['to'](util[_0x03cd('0x71')]('user:%s',_0x134982[_0x03cd('0x40')]))[_0x03cd('0xa2')](_0x03cd('0xd7'),{'ip':_0x3c50b8[_0x03cd('0xd8')][_0x03cd('0xd9')]||_0x3c50b8[_0x03cd('0xda')][_0x03cd('0xdb')]||_0x3c50b8[_0x03cd('0xdc')][_0x03cd('0xdb')]||_0x3c50b8[_0x03cd('0xda')]['socket'][_0x03cd('0xdb')]});return db[_0x03cd('0xad')]['destroy']({'where':{'membername':_0x134982[_0x03cd('0x40')]},'individualHooks':!![]});}}else{throw new db[(_0x03cd('0x1c'))][(_0x03cd('0x1d'))](_0x03cd('0xdd'));}})[_0x03cd('0x1f')](function(){if(_0x134982){return _0x134982[_0x03cd('0xde')]({'raw':!![]});}})[_0x03cd('0x1f')](function(_0x1b3156){if(_0x134982){var _0x45b8dc=[];if(_0x1b3156){_0x9cccbc=_0x1b3156;if(_0x9cccbc['length']){for(var _0x284d61=0x0;_0x284d61<_0x9cccbc[_0x03cd('0x50')];_0x284d61++){_0x45b8dc[_0x03cd('0xa4')]({'membername':_0x134982[_0x03cd('0x40')],'UserId':_0x134982['id'],'queue_name':_0x9cccbc[_0x284d61][_0x03cd('0x40')],'VoiceQueueId':_0x9cccbc[_0x284d61]['id'],'interface':_0x241fc6,'paused':_0x134982[_0x03cd('0x98')]||![],'penalty':_0x9cccbc[_0x284d61][_0x03cd('0xdf')]||0x0});}return BPromise[_0x03cd('0xe0')](_0x45b8dc,function(_0x1ba728){return db[_0x03cd('0xad')][_0x03cd('0xa7')](_0x1ba728);});}}}})[_0x03cd('0x1f')](function(){if(_0x134982){return db[_0x03cd('0xe1')][_0x03cd('0x5e')]({'where':{'membername':_0x134982[_0x03cd('0x40')],'exitAt':null}});}})[_0x03cd('0x1f')](function(_0x2e6c98){if(_0x134982){var _0x44b1aa=[];_0x2e6c98['forEach'](function(_0x288489){_0x44b1aa[_0x03cd('0xa4')](_0x288489['update']({'exitAt':moment()[_0x03cd('0x71')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x03cd('0xe2')](_0x44b1aa);}})['then'](function(){if(_0x134982){var _0x523a6a=[];var _0x45aa26=[];var _0x2ef21d=utils[_0x03cd('0xe3')]();var _0x548139={'membername':_0x134982[_0x03cd('0x40')],'interface':_0x241fc6,'enterAt':moment()[_0x03cd('0x71')](_0x03cd('0xe4')),'role':_0x134982[_0x03cd('0x3d')],'internal':_0x134982[_0x03cd('0x74')]};_0x2ef21d['forEach'](function(_0x3be651){_0x523a6a[_0x03cd('0xa4')](_[_0x03cd('0x5b')]({'channel':_0x3be651,'type':_0x03cd('0xe5'),'data1':_0x3c50b8[_0x03cd('0x65')][_0x03cd('0xe6')],'data2':_0x241fc6},_0x548139));if(_0x134982[_0x03cd('0x98')]){_0x45aa26[_0x03cd('0xa4')](_['merge']({'channel':_0x3be651,'type':_0x03cd('0xe7'),'data1':_0x03cd('0xe8')},_0x548139));}});return db[_0x03cd('0xe1')][_0x03cd('0x64')](_0x523a6a['concat'](_0x45aa26),{'individualHooks':!![]});}})[_0x03cd('0x1f')](function(){if(_0x134982){return _0x134982[_0x03cd('0x31')]({'online':!![],'lastLoginAt':moment()[_0x03cd('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x134982['loginInPause']||![],'mailPause':_0x134982['loginInPause']||![],'chatPause':_0x134982[_0x03cd('0x98')]||![],'faxPause':_0x134982[_0x03cd('0x98')]||![],'smsPause':_0x134982['loginInPause']||![],'openchannelPause':_0x134982[_0x03cd('0x98')]||![],'pauseType':_0x134982[_0x03cd('0x98')]?_0x03cd('0xe8'):null,'interface':_0x241fc6,'lastPauseAt':moment()[_0x03cd('0x71')](_0x03cd('0xe4'))});}})['then'](function(_0x2c223f){if(_0x3c50b8[_0x03cd('0xe9')]){return _0xdab125();}else{return BPromise[_0x03cd('0xea')](_0x2c223f)[_0x03cd('0x1f')](respondWithResult(_0x98bb5,null));}})[_0x03cd('0x27')](handleError(_0x98bb5,null));};exports[_0x03cd('0xeb')]=function(_0x2a699e,_0x38b15d,_0x40c802){var _0xa6726c;return db[_0x03cd('0x43')][_0x03cd('0x68')]({'where':{'id':_0x2a699e[_0x03cd('0x61')]['id'],'role':_0x03cd('0x7e')},'attributes':['id',_0x03cd('0x40'),_0x03cd('0x3d')]})[_0x03cd('0x1f')](handleEntityNotFound(_0x38b15d,null))[_0x03cd('0x1f')](function(_0x2a478a){if(_0x2a478a){_0xa6726c=_0x2a478a;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0xa6726c[_0x03cd('0x40')]},'individualHooks':!![]});}})[_0x03cd('0x1f')](function(){return db[_0x03cd('0xe1')][_0x03cd('0x5e')]({'where':{'membername':_0xa6726c[_0x03cd('0x40')],'exitAt':null}});})[_0x03cd('0x1f')](function(_0x1e75c4){var _0x328c1a=[];_0x1e75c4[_0x03cd('0xec')](function(_0x59ac68){_0x328c1a[_0x03cd('0xa4')](_0x59ac68['update']({'exitAt':moment()[_0x03cd('0x71')](_0x03cd('0xe4'))}));});return BPromise[_0x03cd('0xe2')](_0x328c1a);})[_0x03cd('0x1f')](function(){return _0xa6726c[_0x03cd('0x31')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0x38b15d,null))[_0x03cd('0x27')](handleError(_0x38b15d,null));};exports[_0x03cd('0xed')]=function(_0x3f7cd7,_0x4e7c6f,_0x530334){var _0x277598;return db[_0x03cd('0xad')][_0x03cd('0x31')]({'paused':0x1},{'where':{'UserId':_0x3f7cd7['params']['id']},'individualHooks':!![]})['then'](function(){return db[_0x03cd('0x43')][_0x03cd('0x68')]({'where':{'id':_0x3f7cd7[_0x03cd('0x61')]['id'],'role':'agent'},'attributes':['id','name',_0x03cd('0x3d'),_0x03cd('0x74'),_0x03cd('0xa5')]});})['then'](handleEntityNotFound(_0x4e7c6f,null))[_0x03cd('0x1f')](function(_0x27dced){if(_0x27dced){_0x277598=_0x27dced;return respondWithRpcPromise('QueuePause',_0x03cd('0xed'),{'id':_0x277598['id'],'name':_0x277598[_0x03cd('0x40')],'pause':!![]});}})[_0x03cd('0x1f')](function(){if(_0x277598){return db['MemberReport'][_0x03cd('0x5e')]({'where':{'membername':_0x277598[_0x03cd('0x40')],'type':_0x03cd('0xe7'),'exitAt':null}});}})[_0x03cd('0x1f')](function(_0x5d59d4){if(_0x5d59d4['length']){var _0x46aaf0=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x7dca78=0x0,_0x1dff74=_0x5d59d4[_0x03cd('0x50')];_0x7dca78<_0x1dff74;_0x7dca78++){_0x5d59d4[_0x7dca78][_0x03cd('0xee')]({'exitAt':_0x46aaf0});}}})[_0x03cd('0x1f')](function(){var _0x38af64=[];var _0x3daed0=utils[_0x03cd('0xe3')]();_0x3daed0[_0x03cd('0xec')](function(_0x276625){_0x38af64[_0x03cd('0xa4')]({'channel':_0x276625,'membername':_0x277598['name'],'interface':_[_0x03cd('0x6f')](_0x277598[_0x03cd('0xa5')])?util[_0x03cd('0x71')](_0x03cd('0xa6'),_0x277598[_0x03cd('0x40')]):_0x277598[_0x03cd('0xa5')],'type':_0x03cd('0xe7'),'enterAt':moment()[_0x03cd('0x71')](_0x03cd('0xe4')),'data1':_0x3f7cd7[_0x03cd('0x65')][_0x03cd('0x56')]||_0x03cd('0xef'),'role':_0x277598[_0x03cd('0x3d')],'internal':_0x277598[_0x03cd('0x74')]});});return db[_0x03cd('0xe1')]['bulkCreate'](_0x38af64,{'individualHooks':!![]});})[_0x03cd('0x1f')](function(){return _0x277598[_0x03cd('0x31')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x3f7cd7[_0x03cd('0x65')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0x03cd('0xe4'))});})[_0x03cd('0x1f')](respondWithResult(_0x4e7c6f,null))['catch'](handleError(_0x4e7c6f,null));};exports[_0x03cd('0xf0')]=function(_0x39326d,_0x80322e,_0x2af220){var _0x31539d;return db[_0x03cd('0x43')][_0x03cd('0x68')]({'where':{'id':_0x39326d['params']['id']},'attributes':['id',_0x03cd('0x40'),_0x03cd('0x3d'),_0x03cd('0x99'),_0x03cd('0xf1'),'chatPause',_0x03cd('0xf2'),_0x03cd('0xf3'),'smsPause','pauseType',_0x03cd('0xf4')]})[_0x03cd('0x1f')](handleEntityNotFound(_0x80322e,null))[_0x03cd('0x1f')](function(_0x2d6e33){if(_0x2d6e33){_0x31539d=_0x2d6e33;if(_0x39326d[_0x03cd('0x65')][_0x03cd('0xa9')]&&!utils['isValidChannel'](_0x39326d['body'][_0x03cd('0xa9')])){throw new db[(_0x03cd('0x1c'))]['ValidationError'](_0x03cd('0xaa'));}switch(_0x39326d[_0x03cd('0x65')]['channel']){case _0x03cd('0xa3'):return respondWithRpcPromise(_0x03cd('0xf5'),_0x03cd('0xf0'),{'id':_0x31539d['id'],'name':_0x31539d[_0x03cd('0x40')],'pause':![]})[_0x03cd('0x1f')](function(){return db[_0x03cd('0xad')][_0x03cd('0x31')]({'paused':0x0},{'where':{'UserId':_0x31539d['id']},'individualHooks':!![]});})['then'](function(){return db[_0x03cd('0xe1')][_0x03cd('0x68')]({'where':{'channel':_0x39326d['body'][_0x03cd('0xa9')],'membername':_0x31539d[_0x03cd('0x40')],'type':_0x03cd('0xe7'),'exitAt':null}});})[_0x03cd('0x1f')](function(_0x2e1e1f){if(_0x2e1e1f){return _0x2e1e1f[_0x03cd('0x31')]({'exitAt':moment()['format'](_0x03cd('0xe4')),'data2':_0x03cd('0xf6')},{'individualHooks':!![]});}return null;})[_0x03cd('0x1f')](function(){return _0x31539d[_0x03cd('0x31')]({'voicePause':![]});});case'mail':case _0x03cd('0xf7'):case _0x03cd('0xf8'):case _0x03cd('0xf9'):case'openchannel':return db[_0x03cd('0xe1')][_0x03cd('0x68')]({'where':{'channel':_0x39326d[_0x03cd('0x65')][_0x03cd('0xa9')],'membername':_0x31539d[_0x03cd('0x40')],'type':_0x03cd('0xe7'),'exitAt':null}})[_0x03cd('0x1f')](function(_0x2de6a0){if(_0x2de6a0){return _0x2de6a0['update']({'exitAt':moment()[_0x03cd('0x71')](_0x03cd('0xe4')),'data2':_0x03cd('0xf6')},{'individualHooks':!![]});}return null;})[_0x03cd('0x1f')](function(){var _0x4b5433={};_[_0x03cd('0x2e')](_0x4b5433,util['format'](_0x03cd('0xfa'),_0x39326d['body'][_0x03cd('0xa9')],_0x03cd('0xfb')),![]);return _0x31539d['update'](_0x4b5433);});default:return respondWithRpcPromise(_0x03cd('0xf5'),_0x03cd('0xf0'),{'id':_0x31539d['id'],'name':_0x31539d[_0x03cd('0x40')],'pause':![]})[_0x03cd('0x1f')](function(){return db['UserVoiceQueueRt'][_0x03cd('0x31')]({'paused':0x0},{'where':{'UserId':_0x31539d['id']}});})[_0x03cd('0x1f')](function(){return db[_0x03cd('0xe1')][_0x03cd('0x5e')]({'where':{'membername':_0x31539d[_0x03cd('0x40')],'type':_0x03cd('0xe7'),'exitAt':null}});})[_0x03cd('0x1f')](function(_0x4fc875){var _0x1ecbde=[];_0x4fc875[_0x03cd('0xec')](function(_0xc8824e){_0x1ecbde[_0x03cd('0xa4')](_0xc8824e[_0x03cd('0x31')]({'exitAt':moment()[_0x03cd('0x71')](_0x03cd('0xe4')),'data2':'manual'}));});return BPromise['all'](_0x1ecbde);})['then'](function(){return _0x31539d[_0x03cd('0x31')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x03cd('0x1f')](respondWithResult(_0x80322e,null))[_0x03cd('0x27')](handleError(_0x80322e,null));};exports['getTeams']=function(_0x9add49,_0x3aa0e3,_0x32d169){var _0xdbb6a2={};var _0x436269={};var _0x4a29cb;var _0x52aa8b;return db[_0x03cd('0x43')][_0x03cd('0x8d')]({'where':{'id':_0x9add49[_0x03cd('0x61')]['id']}})[_0x03cd('0x1f')](handleEntityNotFound(_0x3aa0e3,null))[_0x03cd('0x1f')](function(_0x329a48){if(_0x329a48){_0x4a29cb=_0x329a48;_0x436269[_0x03cd('0x47')]=_['keys'](db[_0x03cd('0xfc')]['rawAttributes']);_0x436269['query']=_[_0x03cd('0x62')](_0x9add49['query']);_0x436269[_0x03cd('0x4c')]=_['intersection'](_0x436269[_0x03cd('0x47')],_0x436269[_0x03cd('0x4b')]);_0xdbb6a2[_0x03cd('0x4e')]=_[_0x03cd('0x4d')](_0x436269[_0x03cd('0x47')],qs['fields'](_0x9add49[_0x03cd('0x4b')][_0x03cd('0x4f')]));_0xdbb6a2['attributes']=_0xdbb6a2[_0x03cd('0x4e')]['length']?_0xdbb6a2[_0x03cd('0x4e')]:_0x436269[_0x03cd('0x47')];_0xdbb6a2[_0x03cd('0xc3')]=qs[_0x03cd('0x52')](_0x9add49['query']['sort']);_0xdbb6a2[_0x03cd('0x55')]=qs[_0x03cd('0x4c')](_[_0x03cd('0x53')](_0x9add49[_0x03cd('0x4b')],_0x436269[_0x03cd('0x4c')]));if(_0x9add49['query'][_0x03cd('0x54')]){_0xdbb6a2[_0x03cd('0x55')]=_[_0x03cd('0x5b')](_0xdbb6a2['where'],{'$or':_[_0x03cd('0x3a')](_0xdbb6a2['attributes'],function(_0x2bb78e){var _0x25d818={};_0x25d818[_0x2bb78e]={'$like':'%'+_0x9add49['query'][_0x03cd('0x54')]+'%'};return _0x25d818;})});}_0xdbb6a2=_['merge']({},_0xdbb6a2,_0x9add49[_0x03cd('0x5c')]);return _0x4a29cb[_0x03cd('0xfd')](_0xdbb6a2);}})[_0x03cd('0x1f')](function(_0x6ee059){if(_0x6ee059){_0x52aa8b=_0x6ee059[_0x03cd('0x50')];if(!_0x9add49['query'][_0x03cd('0xba')](_0x03cd('0x51'))){_0xdbb6a2[_0x03cd('0x2d')]=qs['limit'](_0x9add49['query'][_0x03cd('0x2d')]);_0xdbb6a2[_0x03cd('0x2c')]=qs[_0x03cd('0x2c')](_0x9add49[_0x03cd('0x4b')][_0x03cd('0x2c')]);}return _0x4a29cb[_0x03cd('0xfd')](_0xdbb6a2);}})[_0x03cd('0x1f')](function(_0x41f8dc){if(_0x41f8dc){return _0x41f8dc?{'count':_0x52aa8b,'rows':_0x41f8dc}:null;}})[_0x03cd('0x1f')](respondWithResult(_0x3aa0e3,null))[_0x03cd('0x27')](handleError(_0x3aa0e3,null));};exports[_0x03cd('0xfe')]=function(_0x9d6490,_0x567e46){return db['User']['find']({'where':{'id':_0x9d6490[_0x03cd('0x61')]['id']}})['then'](handleEntityNotFound(_0x567e46,null))[_0x03cd('0x1f')](function(_0x27f4b5){if(_0x27f4b5){var _0xf0d830=_0x27f4b5[_0x03cd('0x33')]({'plain':!![]});return _0x27f4b5[_0x03cd('0xfe')](_0x9d6490[_0x03cd('0x65')][_0x03cd('0x69')],_[_0x03cd('0x6a')](_0x9d6490['body'],[_0x03cd('0x69'),'id'])||{})[_0x03cd('0x1f')](function(){for(var _0x5ded60=0x0;_0x5ded60<_0x9d6490[_0x03cd('0x65')]['ids'][_0x03cd('0x50')];_0x5ded60++){var _0x4b9a0c=[];db[_0x03cd('0xfc')][_0x03cd('0x8d')]({'where':{'id':_0x9d6490[_0x03cd('0x65')][_0x03cd('0x69')][_0x5ded60]}})[_0x03cd('0x1f')](function(_0xb4477e){_0x4b9a0c[_0x03cd('0xa4')](_0xb4477e[_0x03cd('0xde')]()[_0x03cd('0x1f')](function(_0x224652){for(var _0xef1c3c=0x0;_0xef1c3c<_0x224652['length'];_0xef1c3c++){_0x224652[_0xef1c3c][_0x03cd('0xff')](_0x03cd('0xa9'),_0x03cd('0x100'));}return _0x224652;}));_0x4b9a0c['push'](_0xb4477e[_0x03cd('0x101')]()[_0x03cd('0x1f')](function(_0x383186){for(var _0x38bf66=0x0;_0x38bf66<_0x383186[_0x03cd('0x50')];_0x38bf66++){_0x383186[_0x38bf66][_0x03cd('0xff')](_0x03cd('0xa9'),_0x03cd('0x102'));}return _0x383186;}));_0x4b9a0c[_0x03cd('0xa4')](_0xb4477e['getMailQueues']()['then'](function(_0xf76f6b){for(var _0x13a1d4=0x0;_0x13a1d4<_0xf76f6b[_0x03cd('0x50')];_0x13a1d4++){_0xf76f6b[_0x13a1d4][_0x03cd('0xff')](_0x03cd('0xa9'),'Mail');}return _0xf76f6b;}));_0x4b9a0c[_0x03cd('0xa4')](_0xb4477e[_0x03cd('0x103')]()['then'](function(_0x818b3e){for(var _0x48a7d6=0x0;_0x48a7d6<_0x818b3e[_0x03cd('0x50')];_0x48a7d6++){_0x818b3e[_0x48a7d6][_0x03cd('0xff')]('channel',_0x03cd('0x104'));}return _0x818b3e;}));_0x4b9a0c['push'](_0xb4477e['getFaxQueues']()[_0x03cd('0x1f')](function(_0x377764){for(var _0x35cfaa=0x0;_0x35cfaa<_0x377764['length'];_0x35cfaa++){_0x377764[_0x35cfaa][_0x03cd('0xff')](_0x03cd('0xa9'),_0x03cd('0x105'));}return _0x377764;}));_0x4b9a0c[_0x03cd('0xa4')](_0xb4477e[_0x03cd('0x106')]()['then'](function(_0x120d4c){for(var _0x3119af=0x0;_0x3119af<_0x120d4c[_0x03cd('0x50')];_0x3119af++){_0x120d4c[_0x3119af][_0x03cd('0xff')](_0x03cd('0xa9'),_0x03cd('0x107'));}return _0x120d4c;}));return BPromise[_0x03cd('0xe2')](_0x4b9a0c);})[_0x03cd('0x1f')](function(_0x7e8401){var _0x2ce370=_[_0x03cd('0x108')](_0x7e8401);_0x4b9a0c=[];return db['sequelize'][_0x03cd('0x109')](function(_0x52d787){for(var _0x1c4718=0x0;_0x1c4718<_0x2ce370[_0x03cd('0x50')];_0x1c4718++){_0x4b9a0c[_0x03cd('0xa4')](_0x2ce370[_0x1c4718][_0x03cd('0x10a')](_0xf0d830['id']),{'transaction':_0x52d787});}return BPromise[_0x03cd('0xe2')](_0x4b9a0c)[_0x03cd('0x1f')](function(){if(_0xf0d830['online']){return BPromise[_0x03cd('0xe0')](_[_0x03cd('0x54')](_0x2ce370,function(_0x5c4aa1){return _0x5c4aa1[_0x03cd('0x10b')](_0x03cd('0xa9'))===_0x03cd('0x100');}),function(_0x54c27d){return db['UserVoiceQueueRt'][_0x03cd('0xa7')]({'membername':_0xf0d830['name'],'UserId':_0xf0d830['id'],'queue_name':_0x54c27d[_0x03cd('0x40')],'VoiceQueueId':_0x54c27d['id'],'interface':_[_0x03cd('0x6f')](_0xf0d830['interface'])?util[_0x03cd('0x71')](_0x03cd('0xa6'),_0xf0d830[_0x03cd('0x40')]):_0xf0d830['interface'],'paused':_0xf0d830['voicePause']||![],'penalty':_0xf0d830[_0x03cd('0x9f')]},{'transaction':_0x52d787});});}else{return;}})[_0x03cd('0x1f')](function(){for(var _0x180330=0x0;_0x180330<_0x2ce370['length'];_0x180330++){var _0x4ff6a2=_0x2ce370[_0x180330][_0x03cd('0x10b')](_0x03cd('0xa9'));var _0x51ca01=_0x4ff6a2+_0x03cd('0xa1');socket['emit'](_0x03cd('0x35')+_0x4ff6a2+_0x03cd('0x10c'),{'UserId':_0xf0d830['id'],['queueField']:_0x2ce370[_0x180330]['id']});}});});});}});}})[_0x03cd('0x1f')](respondWithStatusCode(_0x567e46,null))[_0x03cd('0x27')](handleError(_0x567e46,null));};exports[_0x03cd('0x10d')]=function(_0x8b259d,_0x102ea7){return db[_0x03cd('0x43')][_0x03cd('0x8d')]({'where':{'id':_0x8b259d[_0x03cd('0x61')]['id']}})[_0x03cd('0x1f')](handleEntityNotFound(_0x102ea7,null))[_0x03cd('0x1f')](function(_0x15e074){if(_0x15e074){var _0x5a161c=_0x15e074[_0x03cd('0x33')]({'plain':!![]});var _0x20d475=_0x8b259d[_0x03cd('0x4b')][_0x03cd('0x69')];return _0x15e074['removeTeams'](_0x20d475)[_0x03cd('0x1f')](function(){for(var _0x257a0c=0x0;_0x257a0c<_0x20d475[_0x03cd('0x50')];_0x257a0c++){var _0x148c3d=[];db[_0x03cd('0xfc')][_0x03cd('0x8d')]({'where':{'id':_0x20d475[_0x257a0c]}})[_0x03cd('0x1f')](function(_0x2b1e3e){_0x148c3d[_0x03cd('0xa4')](_0x2b1e3e[_0x03cd('0xde')]()[_0x03cd('0x1f')](function(_0x30e0e7){for(var _0x354e92=0x0;_0x354e92<_0x30e0e7[_0x03cd('0x50')];_0x354e92++){_0x30e0e7[_0x354e92][_0x03cd('0xff')](_0x03cd('0xa9'),_0x03cd('0x100'));}return _0x30e0e7;}));_0x148c3d[_0x03cd('0xa4')](_0x2b1e3e[_0x03cd('0x101')]()[_0x03cd('0x1f')](function(_0x44dc5e){for(var _0x4879ce=0x0;_0x4879ce<_0x44dc5e[_0x03cd('0x50')];_0x4879ce++){_0x44dc5e[_0x4879ce][_0x03cd('0xff')]('channel',_0x03cd('0x102'));}return _0x44dc5e;}));_0x148c3d[_0x03cd('0xa4')](_0x2b1e3e[_0x03cd('0x10e')]()[_0x03cd('0x1f')](function(_0x3c8e85){for(var _0x467ccd=0x0;_0x467ccd<_0x3c8e85[_0x03cd('0x50')];_0x467ccd++){_0x3c8e85[_0x467ccd][_0x03cd('0xff')](_0x03cd('0xa9'),_0x03cd('0x10f'));}return _0x3c8e85;}));_0x148c3d[_0x03cd('0xa4')](_0x2b1e3e[_0x03cd('0x103')]()[_0x03cd('0x1f')](function(_0x3234d4){for(var _0x567833=0x0;_0x567833<_0x3234d4[_0x03cd('0x50')];_0x567833++){_0x3234d4[_0x567833][_0x03cd('0xff')](_0x03cd('0xa9'),_0x03cd('0x104'));}return _0x3234d4;}));_0x148c3d[_0x03cd('0xa4')](_0x2b1e3e['getFaxQueues']()[_0x03cd('0x1f')](function(_0x6e995a){for(var _0x536f61=0x0;_0x536f61<_0x6e995a[_0x03cd('0x50')];_0x536f61++){_0x6e995a[_0x536f61]['setDataValue'](_0x03cd('0xa9'),_0x03cd('0x105'));}return _0x6e995a;}));_0x148c3d['push'](_0x2b1e3e[_0x03cd('0x106')]()[_0x03cd('0x1f')](function(_0x5afefb){for(var _0x452a9f=0x0;_0x452a9f<_0x5afefb[_0x03cd('0x50')];_0x452a9f++){_0x5afefb[_0x452a9f][_0x03cd('0xff')](_0x03cd('0xa9'),_0x03cd('0x107'));}return _0x5afefb;}));return BPromise[_0x03cd('0xe2')](_0x148c3d);})['then'](function(_0x45d34f){var _0x56cfa0=_[_0x03cd('0x108')](_0x45d34f);_0x148c3d=[];return db[_0x03cd('0x58')][_0x03cd('0x109')](function(_0x159f76){for(var _0x56f00c=0x0;_0x56f00c<_0x56cfa0[_0x03cd('0x50')];_0x56f00c++){_0x148c3d[_0x03cd('0xa4')](_0x56cfa0[_0x56f00c][_0x03cd('0x110')](_0x5a161c['id']),{'transaction':_0x159f76});}return BPromise[_0x03cd('0xe2')](_0x148c3d)[_0x03cd('0x1f')](function(){if(_0x5a161c[_0x03cd('0x97')]){return BPromise[_0x03cd('0xe0')](_['filter'](_0x56cfa0,function(_0x5831f9){return _0x5831f9[_0x03cd('0x10b')](_0x03cd('0xa9'))==='Voice';}),function(_0x23bad4){return db[_0x03cd('0xad')][_0x03cd('0x32')]({'where':{'VoiceQueueId':_0x23bad4['id'],'UserId':_0x5a161c['id']},'transaction':_0x159f76});});}else{return;}})[_0x03cd('0x1f')](function(){for(var _0x437428=0x0;_0x437428<_0x56cfa0['length'];_0x437428++){var _0x5e0c05=_0x56cfa0[_0x437428][_0x03cd('0x10b')]('channel');var _0x49af7e=_0x5e0c05+_0x03cd('0xa1');socket['emit'](_0x03cd('0x35')+_0x5e0c05+_0x03cd('0xac'),{'UserId':_0x5a161c['id'],['queueField']:_0x56cfa0[_0x437428]['id']});}});});});}});}})[_0x03cd('0x1f')](respondWithStatusCode(_0x102ea7,null))['catch'](handleError(_0x102ea7,null));};exports[_0x03cd('0x111')]=function(_0xe7d2b8,_0x40a207,_0x50bad2){var _0x191ec4={};var _0x589f40={};var _0x56dfb5;var _0x3d5170;return db[_0x03cd('0x43')][_0x03cd('0x8d')]({'where':{'id':_0xe7d2b8[_0x03cd('0x61')]['id']}})[_0x03cd('0x1f')](handleEntityNotFound(_0x40a207,null))[_0x03cd('0x1f')](function(_0x433fb7){if(_0x433fb7){_0x56dfb5=_0x433fb7;_0x589f40[_0x03cd('0x47')]=_[_0x03cd('0x62')](db[_0x03cd('0xbb')]['rawAttributes']);_0x589f40[_0x03cd('0x4b')]=_['keys'](_0xe7d2b8['query']);_0x589f40[_0x03cd('0x4c')]=_[_0x03cd('0x4d')](_0x589f40[_0x03cd('0x47')],_0x589f40[_0x03cd('0x4b')]);_0x191ec4[_0x03cd('0x4e')]=_[_0x03cd('0x4d')](_0x589f40[_0x03cd('0x47')],qs[_0x03cd('0x4f')](_0xe7d2b8[_0x03cd('0x4b')][_0x03cd('0x4f')]));_0x191ec4[_0x03cd('0x4e')]=_0x191ec4[_0x03cd('0x4e')]['length']?_0x191ec4[_0x03cd('0x4e')]:_0x589f40[_0x03cd('0x47')];_0x191ec4[_0x03cd('0xc3')]=qs[_0x03cd('0x52')](_0xe7d2b8[_0x03cd('0x4b')][_0x03cd('0x52')]);_0x191ec4[_0x03cd('0x55')]=qs['filters'](_[_0x03cd('0x53')](_0xe7d2b8[_0x03cd('0x4b')],_0x589f40[_0x03cd('0x4c')]));if(_0xe7d2b8[_0x03cd('0x4b')][_0x03cd('0x54')]){_0x191ec4[_0x03cd('0x55')]=_[_0x03cd('0x5b')](_0x191ec4[_0x03cd('0x55')],{'$or':_[_0x03cd('0x3a')](_0x191ec4[_0x03cd('0x4e')],function(_0x443081){var _0x5a9c62={};_0x5a9c62[_0x443081]={'$like':'%'+_0xe7d2b8['query'][_0x03cd('0x54')]+'%'};return _0x5a9c62;})});}_0x191ec4=_[_0x03cd('0x5b')]({},_0x191ec4,_0xe7d2b8[_0x03cd('0x5c')]);return _0x56dfb5[_0x03cd('0x111')](_0x191ec4);}})[_0x03cd('0x1f')](function(_0x2180be){if(_0x2180be){_0x3d5170=_0x2180be[_0x03cd('0x50')];if(!_0xe7d2b8[_0x03cd('0x4b')][_0x03cd('0xba')](_0x03cd('0x51'))){_0x191ec4['limit']=qs[_0x03cd('0x2d')](_0xe7d2b8['query'][_0x03cd('0x2d')]);_0x191ec4[_0x03cd('0x2c')]=qs['offset'](_0xe7d2b8['query'][_0x03cd('0x2c')]);}return _0x56dfb5['getLists'](_0x191ec4);}})[_0x03cd('0x1f')](function(_0x1b56a3){if(_0x1b56a3){return _0x1b56a3?{'count':_0x3d5170,'rows':_0x1b56a3}:null;}})[_0x03cd('0x1f')](respondWithResult(_0x40a207,null))[_0x03cd('0x27')](handleError(_0x40a207,null));};exports['getAgents']=function(_0x277632,_0xbe80fe,_0x133fda){var _0x308d85={};var _0x47ac79={};var _0x348922;var _0x1df12d;return db[_0x03cd('0x43')][_0x03cd('0x8d')]({'where':{'id':_0x277632['params']['id']}})[_0x03cd('0x1f')](handleEntityNotFound(_0xbe80fe,null))[_0x03cd('0x1f')](function(_0x42eccd){if(_0x42eccd){_0x348922=_0x42eccd;_0x47ac79['model']=_[_0x03cd('0x62')](db[_0x03cd('0x43')][_0x03cd('0x44')]);_0x47ac79[_0x03cd('0x4b')]=_['keys'](_0x277632['query']);_0x47ac79['filters']=_[_0x03cd('0x4d')](_0x47ac79[_0x03cd('0x47')],_0x47ac79['query']);_0x308d85[_0x03cd('0x4e')]=_[_0x03cd('0x4d')](_0x47ac79[_0x03cd('0x47')],qs[_0x03cd('0x4f')](_0x277632[_0x03cd('0x4b')][_0x03cd('0x4f')]));_0x308d85[_0x03cd('0x4e')]=_0x308d85[_0x03cd('0x4e')][_0x03cd('0x50')]?_0x308d85[_0x03cd('0x4e')]:_0x47ac79[_0x03cd('0x47')];_0x308d85[_0x03cd('0xc3')]=qs[_0x03cd('0x52')](_0x277632['query'][_0x03cd('0x52')]);_0x308d85[_0x03cd('0x55')]=qs[_0x03cd('0x4c')](_[_0x03cd('0x53')](_0x277632['query'],_0x47ac79[_0x03cd('0x4c')]));if(_0x277632['query'][_0x03cd('0x54')]){_0x308d85[_0x03cd('0x55')]=_[_0x03cd('0x5b')](_0x308d85[_0x03cd('0x55')],{'$or':_[_0x03cd('0x3a')](_0x308d85[_0x03cd('0x4e')],function(_0x1803bf){var _0x1688ff={};_0x1688ff[_0x1803bf]={'$like':'%'+_0x277632[_0x03cd('0x4b')][_0x03cd('0x54')]+'%'};return _0x1688ff;})});}_0x308d85[_0x03cd('0x47')]=db[_0x03cd('0x43')];_0x308d85['as']=_0x03cd('0x36');_0x308d85=_[_0x03cd('0x5b')]({},_0x308d85,_0x277632['options']);return _0x348922[_0x03cd('0xde')]({'include':[_0x308d85]});}})['then'](function(_0x30e9b4){if(_0x30e9b4){var _0x455019={},_0x135602=[],_0x120a9b=0x0;for(var _0xf93d8=0x0;_0xf93d8<_0x30e9b4[_0x03cd('0x50')];_0xf93d8+=0x1){for(var _0xff75cd=0x0,_0x1aff9f;_0xff75cd<_0x30e9b4[_0xf93d8][_0x03cd('0x36')][_0x03cd('0x50')];_0xff75cd+=0x1){_0x1aff9f=_0x30e9b4[_0xf93d8][_0x03cd('0x36')][_0xff75cd][_0x03cd('0x33')]({'plain':!![]});_0x455019[_0x1aff9f['id']]=_0x1aff9f;}}_0x455019=_[_0x03cd('0x112')](_0x455019);for(var _0x117f7a=qs[_0x03cd('0x2c')](_0x277632['query'][_0x03cd('0x2c')]);_0x117f7a<_0x455019[_0x03cd('0x50')]&&_0x135602['length']=_0x180171){_0x39995b=_0x180171;_0x5b59ea=0xc8;}else{_0x5b59ea=0xce;}_0x388513[_0x1499('0x2c')](_0x5b59ea);return _0x388513['set'](_0x1499('0x31'),_0x1a2c99+'-'+_0x39995b+'/'+_0x180171)[_0x1499('0x2d')](_0x5d3ec5);}return null;};}function patchUpdates(_0x15cc57){return function(_0x39f74f){try{jsonpatch[_0x1499('0x32')](_0x39f74f,_0x15cc57,!![]);}catch(_0x339052){return BPromise[_0x1499('0x33')](_0x339052);}return _0x39f74f[_0x1499('0x34')]();};}function saveUpdates(_0x11767f,_0x441d43){return function(_0x461c93){if(_0x461c93){return _0x461c93[_0x1499('0x35')](_0x11767f)[_0x1499('0x21')](function(_0x3f4c1a){return _0x3f4c1a;});}return null;};}function removeEntity(_0x2764ba,_0x197afc){return function(_0x417dd1){if(_0x417dd1){return _0x417dd1[_0x1499('0x36')]()[_0x1499('0x21')](function(){var _0x29e89e=_0x417dd1['get']({'plain':!![]});var _0x3348bc=[{'name':_0x1499('0x37'),'value':_0x1499('0x38'),'ignore':!![]},{'name':_0x1499('0x39'),'value':_0x1499('0x3a'),'ignore':![]},{'name':_0x1499('0x3b'),'value':_0x1499('0x3c'),'ignore':![]}];var _0x278991=_(_0x3348bc)[_0x1499('0x3d')](_0x1499('0x3e'))[_0x1499('0x3f')]('value')['value']();if(_[_0x1499('0x40')](_0x278991,_0x29e89e['role'])){return;}var _0x29bb8f=_['find'](_0x3348bc,[_0x1499('0x41'),_0x29e89e[_0x1499('0x42')]])[_0x1499('0x43')];return db[_0x1499('0x44')]['destroy']({'where':{'type':_0x29bb8f,'resourceId':_0x29e89e['id']}})[_0x1499('0x21')](function(){return _0x417dd1;});})['then'](function(){_0x2764ba[_0x1499('0x2c')](0xcc)[_0x1499('0x45')]();});}};}function handleEntityNotFound(_0x2e2eaf,_0x199caf){return function(_0x4e6a35){if(!_0x4e6a35){_0x2e2eaf[_0x1499('0x46')](0x194);}return _0x4e6a35;};}function handleError(_0x815a99,_0x1a589a){_0x1a589a=_0x1a589a||0x1f4;return function(_0x3b67a7){logger['error'](_0x3b67a7[_0x1499('0x47')]);if(_0x3b67a7['name']){delete _0x3b67a7[_0x1499('0x43')];}_0x815a99[_0x1499('0x2c')](_0x1a589a)[_0x1499('0x48')](_0x3b67a7);};}exports[_0x1499('0x49')]=function(_0x3ed978,_0x374e11){var _0x281e3b={},_0xcb85eb={},_0x410210={'count':0x0,'rows':[]};var _0x1c1a02=_['map'](db[_0x1499('0x4a')]['rawAttributes'],function(_0x2cfdaf){return{'name':_0x2cfdaf[_0x1499('0x4b')],'type':_0x2cfdaf['type'][_0x1499('0x4c')]};});_0xcb85eb[_0x1499('0x4d')]=_[_0x1499('0x4e')](_[_0x1499('0x3f')](_0x1c1a02,_0x1499('0x43')),['password','salt']);_0xcb85eb[_0x1499('0x4f')]=_[_0x1499('0x50')](_0x3ed978['query']);_0xcb85eb[_0x1499('0x51')]=_[_0x1499('0x52')](_0xcb85eb['model'],_0xcb85eb['query']);_0x281e3b[_0x1499('0x53')]=_[_0x1499('0x52')](_0xcb85eb[_0x1499('0x4d')],qs['fields'](_0x3ed978[_0x1499('0x4f')][_0x1499('0x54')]));_0x281e3b[_0x1499('0x53')]=_0x281e3b[_0x1499('0x53')]['length']?_0x281e3b[_0x1499('0x53')]:_0xcb85eb[_0x1499('0x4d')];if(!_0x3ed978[_0x1499('0x4f')][_0x1499('0x55')]('nolimit')){_0x281e3b[_0x1499('0x30')]=qs[_0x1499('0x30')](_0x3ed978[_0x1499('0x4f')]['limit']);_0x281e3b['offset']=qs[_0x1499('0x2f')](_0x3ed978['query'][_0x1499('0x2f')]);}_0x281e3b[_0x1499('0x56')]=qs[_0x1499('0x57')](_0x3ed978[_0x1499('0x4f')][_0x1499('0x57')]);_0x281e3b[_0x1499('0x58')]=qs[_0x1499('0x51')](_['pick'](_0x3ed978[_0x1499('0x4f')],_0xcb85eb['filters']));if(_0x3ed978[_0x1499('0x4f')][_0x1499('0x3d')]){_0x281e3b['where']=_[_0x1499('0x59')](_0x281e3b[_0x1499('0x58')],{'$or':_[_0x1499('0x3f')](_0x1c1a02,function(_0x4d1d24){if(_0x4d1d24[_0x1499('0x5a')]!==_0x1499('0x5b')){return db[_0x1499('0x5c')][_0x1499('0x58')](db[_0x1499('0x5c')]['fn'](_0x1499('0x5d'),db[_0x1499('0x5c')][_0x1499('0x5e')](_0x4d1d24[_0x1499('0x43')])),{'$like':db[_0x1499('0x5c')]['fn']('lower','%'+_0x3ed978[_0x1499('0x4f')][_0x1499('0x3d')]+'%')});}})});}_0x281e3b=_[_0x1499('0x59')]({},_0x281e3b,_0x3ed978['options']);var _0x339471={'where':_0x281e3b[_0x1499('0x58')]};return db['User'][_0x1499('0x2e')](_0x339471)[_0x1499('0x21')](function(_0x54134d){_0x410210[_0x1499('0x2e')]=_0x54134d;if(_0x3ed978[_0x1499('0x4f')][_0x1499('0x5f')]){_0x281e3b[_0x1499('0x60')]=[{'all':!![]}];}return db[_0x1499('0x4a')][_0x1499('0x61')](_0x281e3b);})[_0x1499('0x21')](function(_0x4aa74e){_0x410210[_0x1499('0x62')]=_0x4aa74e;return _0x410210;})[_0x1499('0x21')](respondWithFilteredResult(_0x374e11,_0x281e3b))[_0x1499('0x2b')](handleError(_0x374e11,null));};exports[_0x1499('0x63')]=function(_0x52f4ae,_0x5050fb){var _0x17a113={'raw':![],'where':{'id':_0x52f4ae['params']['id']}},_0x37e851={};_0x37e851[_0x1499('0x4d')]=_[_0x1499('0x4e')](_[_0x1499('0x50')](db['User']['rawAttributes']),['password',_0x1499('0x64')]);_0x37e851[_0x1499('0x4f')]=_[_0x1499('0x50')](_0x52f4ae['query']);_0x37e851[_0x1499('0x51')]=_['intersection'](_0x37e851[_0x1499('0x4d')],_0x37e851[_0x1499('0x4f')]);_0x17a113[_0x1499('0x53')]=_[_0x1499('0x52')](_0x37e851['model'],qs['fields'](_0x52f4ae['query'][_0x1499('0x54')]));_0x17a113[_0x1499('0x53')]=_0x17a113[_0x1499('0x53')][_0x1499('0x65')]?_0x17a113['attributes']:_0x37e851[_0x1499('0x4d')];if(_0x52f4ae[_0x1499('0x4f')]['includeAll']){_0x17a113[_0x1499('0x60')]=[{'all':!![]}];}_0x17a113=_['merge']({},_0x17a113,_0x52f4ae[_0x1499('0x66')]);return db[_0x1499('0x4a')][_0x1499('0x67')](_0x17a113)['then'](handleEntityNotFound(_0x5050fb,null))[_0x1499('0x21')](respondWithResult(_0x5050fb,null))[_0x1499('0x2b')](handleError(_0x5050fb,null));};exports[_0x1499('0x68')]=function(_0x5b2dab,_0x761610){return db[_0x1499('0x4a')][_0x1499('0x68')](_0x5b2dab['body'],{'raw':![],'individualHooks':!![]})[_0x1499('0x21')](respondWithResult(_0x761610,0xc9))[_0x1499('0x2b')](handleError(_0x761610,null));};exports[_0x1499('0x35')]=function(_0x29d629,_0x10610e){if(_0x29d629[_0x1499('0x69')]['id']){delete _0x29d629['body']['id'];}delete _0x29d629[_0x1499('0x69')][_0x1499('0x42')];return db['User'][_0x1499('0x67')]({'where':{'id':_0x29d629[_0x1499('0x6a')]['id']}})[_0x1499('0x21')](handleEntityNotFound(_0x10610e,null))[_0x1499('0x21')](saveUpdates(_0x29d629[_0x1499('0x69')],null))[_0x1499('0x21')](respondWithResult(_0x10610e,null))['catch'](handleError(_0x10610e,null));};exports[_0x1499('0x6b')]=function(_0x3bd8c9,_0x4eec83){return db['User'][_0x1499('0x6b')]()[_0x1499('0x21')](respondWithResult(_0x4eec83,null))['catch'](handleError(_0x4eec83,null));};exports[_0x1499('0x6c')]=function(_0xa2a3e7,_0x302dee,_0x57a574){return db[_0x1499('0x4a')]['find']({'where':{'id':_0xa2a3e7['params']['id']}})[_0x1499('0x21')](handleEntityNotFound(_0x302dee,null))['then'](function(_0x5aa0ec){if(_0x5aa0ec){return _0x5aa0ec[_0x1499('0x6c')](_0xa2a3e7[_0x1499('0x69')]['ids'],_[_0x1499('0x6d')](_0xa2a3e7[_0x1499('0x69')],[_0x1499('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x302dee,null))['catch'](handleError(_0x302dee,null));};var getLicense=function(_0x1cc8d1){return new BPromise(function(_0x2f3a3a,_0x256893){var _0x392f6f=0x0;_0x1cc8d1[_0x1499('0x69')]['role']===_0x1499('0x3a')&&_0x2f3a3a(_0x1499('0x6f'));return db['User'][_0x1499('0x2e')]({'where':{'$or':[{'role':_0x1cc8d1[_0x1499('0x69')][_0x1499('0x42')]==='telephone'?_0x1499('0x3c'):[_0x1499('0x70'),_0x1499('0x38')]}]}})[_0x1499('0x21')](function(_0x5461a2){_0x392f6f=_0x5461a2;return require(_0x1499('0x71'))[_0x1499('0x72')]();})[_0x1499('0x21')](function(_0x507654){var _0x377ba4=_0x1cc8d1[_0x1499('0x69')][_0x1499('0x42')]===_0x1499('0x3c')?_0x1499('0x73'):_0x1499('0x74');if(!_['isNil'](_0x507654[_0x377ba4])&&_0x392f6f>=_0x507654[_0x377ba4]){return _0x256893({'message':_0x1499('0x75')});}return _0x2f3a3a(util['format']('count\x20%s:\x20%s',_0x377ba4,_0x392f6f));})[_0x1499('0x2b')](function(_0x488e55){return _0x256893(_0x488e55);});});};exports[_0x1499('0x76')]=function(_0x4c6ce8,_0x4c7c2c){return getLicense(_0x4c6ce8)[_0x1499('0x21')](function(_0xb4a84b){if(!_0x4c6ce8['body'][_0x1499('0x77')]){var _0x254fc7;return db[_0x1499('0x78')][_0x1499('0x79')](0x1)[_0x1499('0x21')](function(_0x3f6f36){return checkPasswordPattern(_0x3f6f36,_0x4c6ce8[_0x1499('0x69')]['password'],_0x3f6f36[_0x1499('0x7a')]);})[_0x1499('0x21')](function(_0x4f6674){_0x254fc7=_0x4f6674[_0x1499('0x7b')];return db['User'][_0x1499('0x7c')](_0x1499('0x77'));})[_0x1499('0x21')](function(_0x33c30e){if(_['isNil'](_0x33c30e)){if(_0x254fc7){_0x4c6ce8[_0x1499('0x69')]['internal']=_0x254fc7;}else{_0x4c6ce8[_0x1499('0x69')]['internal']=0x1;}}else{if(_[_0x1499('0x7d')](_0x254fc7)||_0x254fc7==_0x33c30e){_0x4c6ce8[_0x1499('0x69')][_0x1499('0x77')]=_0x33c30e+0x1;}else if(_0x254fc7>_0x33c30e){_0x4c6ce8['body'][_0x1499('0x77')]=_0x254fc7;}else{return db[_0x1499('0x5c')]['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x1499('0x5c')]['QueryTypes'][_0x1499('0x7e')]})['then'](function(_0x917508){if(_0x917508&&_0x917508['length']){for(var _0x35405c=0x0,_0x1ffcb8=_0x917508[_0x1499('0x65')];_0x35405c<_0x1ffcb8&&_[_0x1499('0x7d')](_0x4c6ce8[_0x1499('0x69')][_0x1499('0x77')]);_0x35405c++){if(_0x254fc7<=_0x917508[_0x35405c][_0x1499('0x7f')]){_0x4c6ce8[_0x1499('0x69')]['internal']=_0x917508[_0x35405c][_0x1499('0x7f')];}else if(_0x254fc7>_0x917508[_0x35405c][_0x1499('0x7f')]&&_0x254fc7<=_0x917508[_0x35405c]['to']){_0x4c6ce8[_0x1499('0x69')]['internal']=_0x254fc7;}}}if(_[_0x1499('0x7d')](_0x4c6ce8[_0x1499('0x69')]['internal'])){_0x4c6ce8[_0x1499('0x69')][_0x1499('0x77')]=_0x33c30e+0x1;}});}}});}})[_0x1499('0x21')](function(){if(_0x4c6ce8[_0x1499('0x69')][_0x1499('0x80')]){_0x4c6ce8['body'][_0x1499('0x81')]=_0x4c6ce8['body']['internal'];_0x4c6ce8[_0x1499('0x69')][_0x1499('0x82')]={'mailbox':_0x4c6ce8[_0x1499('0x69')][_0x1499('0x77')],'password':_0x4c6ce8[_0x1499('0x69')][_0x1499('0x83')],'fullname':_0x4c6ce8[_0x1499('0x69')]['fullname'],'email':_0x4c6ce8['body'][_0x1499('0x84')]};}if(_0x4c6ce8[_0x1499('0x69')]&&_0x4c6ce8['body'][_0x1499('0x42')]==='agent'){_0x4c6ce8[_0x1499('0x69')]['permissions']=[_0x1499('0x85'),'102',_0x1499('0x86'),'110',_0x1499('0x87'),_0x1499('0x88'),'106',_0x1499('0x89'),_0x1499('0x8a'),'109',_0x1499('0x8b'),_0x1499('0x8c')];}return db[_0x1499('0x4a')][_0x1499('0x76')](_0x4c6ce8[_0x1499('0x69')],{'include':[{'model':db[_0x1499('0x82')],'as':_0x1499('0x82')}]});})['then'](function(_0x25c8b9){if(_0x4c6ce8[_0x1499('0x69')]['role']===_0x1499('0x38'))return _0x25c8b9;var _0x1b1bda=_0x4c6ce8['user'][_0x1499('0x8d')]({'plain':!![]});if(!_0x1b1bda)throw new Error(_0x1499('0x8e'));if(_0x1b1bda['role']===_0x1499('0x38')){var _0x36ffa9=_0x25c8b9[_0x1499('0x8d')]({'plain':!![]});var _0x34b1a4=[{'name':_0x1499('0x39'),'value':_0x1499('0x3a')},{'name':_0x1499('0x3b'),'value':_0x1499('0x3c')}];var _0x4dbb8e=_[_0x1499('0x67')](_0x34b1a4,[_0x1499('0x41'),_0x36ffa9[_0x1499('0x42')]])[_0x1499('0x43')];return db[_0x1499('0x8f')][_0x1499('0x67')]({'where':{'name':_0x4dbb8e,'userProfileId':_0x1b1bda['userProfileId']},'raw':!![]})['then'](function(_0x4e98f1){if(_0x4e98f1&&_0x4e98f1[_0x1499('0x90')]===0x0){return db[_0x1499('0x44')][_0x1499('0x76')]({'name':_0x36ffa9[_0x1499('0x43')],'resourceId':_0x36ffa9['id'],'type':_0x4e98f1[_0x1499('0x43')],'sectionId':_0x4e98f1['id']},{})[_0x1499('0x21')](function(){return _0x25c8b9;});}else{return _0x25c8b9;}})[_0x1499('0x2b')](function(_0x101d82){logger['error'](_0x1499('0x91'),_0x101d82);throw _0x101d82;});}return _0x25c8b9;})[_0x1499('0x21')](respondWithResult(_0x4c7c2c,0xc9))['catch'](handleError(_0x4c7c2c,null));};exports['changePassword']=function(_0x1b2107,_0x4b0328,_0x52282e){var _0x5666f5=![];if(_0x1b2107[_0x1499('0x69')]['id']){delete _0x1b2107[_0x1499('0x69')]['id'];}return db[_0x1499('0x78')][_0x1499('0x92')]({'attributes':['id',_0x1499('0x7a')]})['then'](function(_0x484634){_0x5666f5=_0x484634[_0x1499('0x7a')];return db[_0x1499('0x4a')][_0x1499('0x67')]({'where':{'id':_0x1b2107['params']['id']}});})[_0x1499('0x21')](function(_0x4b9db4){if(_0x4b9db4){if(_0x4b9db4['id']==_0x1b2107['user']['id']){if(!_0x1b2107[_0x1499('0x69')]['oldPassword']||!_0x1b2107[_0x1499('0x69')]['newPassword']){throw new db[(_0x1499('0x1f'))]['ValidationError'](_0x1499('0x93'));}if(!_0x4b9db4[_0x1499('0x94')](_0x1b2107['body'][_0x1499('0x95')])){throw new db['Sequelize'][(_0x1499('0x96'))](_0x1499('0x97'));}if(_0x1b2107[_0x1499('0x69')][_0x1499('0x95')]==_0x1b2107[_0x1499('0x69')][_0x1499('0x98')]){throw new db[(_0x1499('0x1f'))][(_0x1499('0x96'))](_0x1499('0x99'));}return _0x4b9db4;}else if(_0x1b2107[_0x1499('0x38')][_0x1499('0x42')]==_0x1499('0x70')){if(!_0x1b2107[_0x1499('0x69')]['newPassword']){throw new db[(_0x1499('0x1f'))][(_0x1499('0x96'))](_0x1499('0x9a'));}return _0x4b9db4;}else if(_0x1b2107[_0x1499('0x38')]['role']==_0x1499('0x38')){if(!_0x1b2107[_0x1499('0x69')]['newPassword']){throw new db['Sequelize'][(_0x1499('0x96'))](_0x1499('0x9a'));}if(_0x4b9db4[_0x1499('0x42')]!=_0x1499('0x3a')){throw new db[(_0x1499('0x1f'))][(_0x1499('0x96'))](_0x1499('0x9b'));}return _0x4b9db4;}else{throw new db[(_0x1499('0x1f'))][(_0x1499('0x96'))](_0x1499('0x9b'));}}return null;})['then'](handleEntityNotFound(_0x4b0328,null))['then'](function(_0x4a8e01){return checkPasswordPattern(_0x4a8e01,_0x1b2107[_0x1499('0x69')][_0x1499('0x98')],_0x5666f5);})[_0x1499('0x21')](saveUpdates({'password':_0x1b2107[_0x1499('0x69')][_0x1499('0x98')],'passwordResetAt':_0x1b2107[_0x1499('0x38')]['id']==_0x1b2107['params']['id']?moment():null},null))[_0x1499('0x21')](respondWithResult(_0x4b0328,null))[_0x1499('0x2b')](handleError(_0x4b0328,null));};exports[_0x1499('0x9c')]=function(_0x503afa,_0x4a11e4,_0x254fa0){var _0x411e11=_0x503afa['body']['channel'];return db['User'][_0x1499('0x67')]({'where':{'id':_0x503afa[_0x1499('0x6a')]['id']},'attributes':['id','name',_0x1499('0x42'),_0x1499('0x9d'),_0x1499('0x9e'),_0x1499('0x9f'),_0x1499('0xa0')]})['then'](handleEntityNotFound(_0x4a11e4,null))['then'](function(_0x5825f4){if(_0x5825f4){if(!utils['isValidChannel'](_0x411e11)){throw new db[(_0x1499('0x1f'))][(_0x1499('0x96'))](_0x1499('0xa1'));}return _0x5825f4['add'+_['capitalize'](_0x411e11['toLowerCase']())+_0x1499('0xa2')](_0x503afa[_0x1499('0x69')][_0x1499('0x6e')],{'penalty':_0x503afa[_0x1499('0x69')][_0x1499('0xa3')]||0x0})[_0x1499('0xa4')](function(_0xedf47e){for(var _0x420576=0x0;_0x420576<_0x503afa[_0x1499('0x69')]['ids'][_0x1499('0x65')];_0x420576+=0x1){var _0x4d896d={'UserId':_0x503afa[_0x1499('0x6a')]['id']};_0x4d896d[_[_0x1499('0xa5')](_0x411e11[_0x1499('0xa6')]())+_0x1499('0xa7')]=_0x503afa[_0x1499('0x69')][_0x1499('0x6e')][_0x420576];socket[_0x1499('0xa8')]('user'+_['capitalize'](_0x411e11[_0x1499('0xa6')]())+_0x1499('0xa9'),_0x4d896d);}return _0xedf47e;})['then'](function(){if(_0x411e11===_0x1499('0xaa')){return db[_0x1499('0xab')][_0x1499('0x61')]({'where':{'id':_0x503afa['body']['ids']||[]},'raw':!![],'attributes':['id',_0x1499('0x43')]});}})['then'](function(_0x18788d){var _0x3f366a=_0x5825f4[_0x1499('0x8d')]({'plain':!![]});var _0x548faf=[];if(_0x411e11==='voice'&&_0x3f366a['role']===_0x1499('0x3a')&&_0x3f366a[_0x1499('0x9d')]){for(var _0x59653b=0x0;_0x59653b<_0x18788d[_0x1499('0x65')];_0x59653b+=0x1){_0x548faf['push']({'membername':_0x3f366a['name'],'UserId':_0x3f366a['id'],'queue_name':_0x18788d[_0x59653b][_0x1499('0x43')],'VoiceQueueId':_0x18788d[_0x59653b]['id'],'interface':_['isNil'](_0x3f366a['interface'])?util['format'](_0x1499('0xac'),_0x3f366a['name']):_0x3f366a[_0x1499('0xa0')],'paused':_0x3f366a[_0x1499('0x9f')]||![],'penalty':_0x503afa[_0x1499('0x69')][_0x1499('0xa3')]||0x0});}return BPromise[_0x1499('0xad')](_0x548faf,function(_0x4eb373){return db[_0x1499('0xae')][_0x1499('0xaf')](_0x4eb373);});}return _0x5825f4;});}})[_0x1499('0x21')](respondWithStatusCode(_0x4a11e4,null))['catch'](handleError(_0x4a11e4,null));};exports[_0x1499('0xb0')]=function(_0x772b0c,_0x33923f,_0x27135a){var _0x1e9c28;return db[_0x1499('0x4a')][_0x1499('0x67')]({'where':{'id':_0x772b0c[_0x1499('0x6a')]['id']},'attributes':['id','name',_0x1499('0x42')]})[_0x1499('0x21')](handleEntityNotFound(_0x33923f,null))[_0x1499('0x21')](function(_0x5ef732){if(_0x5ef732){_0x1e9c28=_0x5ef732;if(!_0x772b0c[_0x1499('0x4f')][_0x1499('0xb1')]||!utils[_0x1499('0xb2')](_0x772b0c[_0x1499('0x4f')][_0x1499('0xb1')])){throw new db[(_0x1499('0x1f'))]['ValidationError'](_0x1499('0xa1'));}return _0x5ef732[_0x1499('0xb3')+_['capitalize'](_0x772b0c[_0x1499('0x4f')][_0x1499('0xb1')][_0x1499('0xa6')]())+'Queues'](_0x772b0c['query'][_0x1499('0x6e')]);}})[_0x1499('0x21')](function(_0xc6923f){for(var _0x6478eb=0x0;_0x6478eb<_0x772b0c[_0x1499('0x4f')][_0x1499('0x6e')][_0x1499('0x65')];_0x6478eb+=0x1){var _0x1553bf={'UserId':_0x772b0c['params']['id']};_0x1553bf[_['capitalize'](_0x772b0c['query'][_0x1499('0xb1')][_0x1499('0xa6')]())+'QueueId']=_0x772b0c[_0x1499('0x4f')]['ids'][_0x6478eb];socket[_0x1499('0xa8')](_0x1499('0x38')+_['capitalize'](_0x772b0c[_0x1499('0x4f')][_0x1499('0xb1')][_0x1499('0xa6')]())+'Queue:remove',_0x1553bf);}return _0xc6923f;})[_0x1499('0x21')](function(){if(_0x772b0c[_0x1499('0x4f')][_0x1499('0xb1')]===_0x1499('0xaa')){return db[_0x1499('0xae')][_0x1499('0x36')]({'where':{'UserId':_0x772b0c[_0x1499('0x6a')]['id'],'VoiceQueueId':_0x772b0c[_0x1499('0x4f')][_0x1499('0x6e')]},'individualHooks':!![]})[_0x1499('0x21')](function(){return _0x1e9c28;});}return _0x1e9c28;})[_0x1499('0x21')](respondWithStatusCode(_0x33923f,null))[_0x1499('0x2b')](handleError(_0x33923f,null));};exports[_0x1499('0xb4')]=function(_0x140e80,_0x41fec0,_0x4114cb){_0x140e80['body'][_0x1499('0xb5')]=_0x140e80[_0x1499('0xb6')][_0x1499('0xb7')];return db[_0x1499('0x4a')][_0x1499('0x67')]({'where':{'id':_0x140e80[_0x1499('0x6a')]['id']}})[_0x1499('0x21')](handleEntityNotFound(_0x41fec0,null))[_0x1499('0x21')](saveUpdates(_0x140e80[_0x1499('0x69')],null))[_0x1499('0x21')](respondWithResult(_0x41fec0,null))[_0x1499('0x2b')](handleError(_0x41fec0,null));};exports[_0x1499('0xb8')]=function(_0x15a3dd,_0x5f4d80,_0x3d9a07){var _0x339d18=path[_0x1499('0xb9')](config['root'],_0x1499('0xba'));return db[_0x1499('0x4a')][_0x1499('0x67')]({'where':{'id':_0x15a3dd[_0x1499('0x6a')]['id']},'attributes':['id',_0x1499('0xb5')],'raw':!![]})[_0x1499('0x21')](handleEntityNotFound(_0x5f4d80,null))[_0x1499('0x21')](function(_0x281ff2){if(_0x281ff2){if(_['isNil'](_0x281ff2[_0x1499('0xb5')])){return _0x5f4d80['download'](_0x339d18);}else{if(!fs[_0x1499('0xbb')](path[_0x1499('0xb9')](config[_0x1499('0xbc')],_0x1499('0xbd'),_0x281ff2['userpic']))){return _0x5f4d80[_0x1499('0xbe')](_0x339d18);}return _0x5f4d80[_0x1499('0xbe')](path['join'](config[_0x1499('0xbc')],'server/files/images/',_0x281ff2[_0x1499('0xb5')]));}}})[_0x1499('0x2b')](handleError(_0x5f4d80,null));};exports[_0x1499('0xbf')]=function(_0x456181,_0xe86c0a,_0x524602){var _0x1ca4bf={};var _0x1426fd={};var _0x2e00ae;var _0x821029;return db[_0x1499('0x4a')][_0x1499('0x92')]({'where':{'id':_0x456181[_0x1499('0x6a')]['id']}})[_0x1499('0x21')](handleEntityNotFound(_0xe86c0a,null))['then'](function(_0x37422a){if(_0x37422a){_0x2e00ae=_0x37422a;_0x1426fd[_0x1499('0x4d')]=_['keys'](db['CmContact'][_0x1499('0xc0')]);_0x1426fd[_0x1499('0x4f')]=_[_0x1499('0x50')](_0x456181[_0x1499('0x4f')]);_0x1426fd[_0x1499('0x51')]=_[_0x1499('0x52')](_0x1426fd[_0x1499('0x4d')],_0x1426fd[_0x1499('0x4f')]);_0x1ca4bf[_0x1499('0x53')]=_[_0x1499('0x52')](_0x1426fd[_0x1499('0x4d')],qs[_0x1499('0x54')](_0x456181[_0x1499('0x4f')][_0x1499('0x54')]));_0x1ca4bf[_0x1499('0x53')]=_0x1ca4bf['attributes'][_0x1499('0x65')]?_0x1ca4bf[_0x1499('0x53')]:_0x1426fd[_0x1499('0x4d')];_0x1ca4bf[_0x1499('0x56')]=qs['sort'](_0x456181['query'][_0x1499('0x57')]);_0x1ca4bf['where']=qs[_0x1499('0x51')](_[_0x1499('0xc1')](_0x456181[_0x1499('0x4f')],_0x1426fd[_0x1499('0x51')]));if(_0x456181[_0x1499('0x4f')]['filter']){_0x1ca4bf[_0x1499('0x58')]=_['merge'](_0x1ca4bf[_0x1499('0x58')],{'$or':_[_0x1499('0x3f')](_0x1ca4bf['attributes'],function(_0x29d5d7){var _0x1b88e9={};_0x1b88e9[_0x29d5d7]={'$like':'%'+_0x456181[_0x1499('0x4f')]['filter']+'%'};return _0x1b88e9;})});}_0x1ca4bf=_[_0x1499('0x59')]({},_0x1ca4bf,_0x456181[_0x1499('0x66')]);return _0x2e00ae['getContacts'](_0x1ca4bf);}})[_0x1499('0x21')](function(_0x439172){if(_0x439172){_0x821029=_0x439172[_0x1499('0x65')];if(_0x456181['query'][_0x1499('0x55')]('includeAll')){_0x1ca4bf['include']=[{'model':db['CmList'],'as':_0x1499('0xc2'),'required':![]},{'model':db[_0x1499('0xc3')],'as':_0x1499('0xc4'),'attributes':['id',_0x1499('0x43'),_0x1499('0xc5')],'where':_0x456181['query'][_0x1499('0xc6')]?{'id':_0x456181[_0x1499('0x4f')][_0x1499('0xc6')]}:undefined,'required':_0x456181['query'][_0x1499('0xc6')]?!![]:![]}];}if(!_0x456181['query'][_0x1499('0x55')](_0x1499('0xc7'))){_0x1ca4bf['limit']=qs[_0x1499('0x30')](_0x456181['query'][_0x1499('0x30')]);_0x1ca4bf[_0x1499('0x2f')]=qs[_0x1499('0x2f')](_0x456181['query']['offset']);}return _0x2e00ae[_0x1499('0xbf')](_0x1ca4bf);}})['then'](function(_0x22ba21){if(_0x22ba21){return _0x22ba21?{'count':_0x821029,'rows':_0x22ba21}:null;}})[_0x1499('0x21')](respondWithResult(_0xe86c0a,null))['catch'](handleError(_0xe86c0a,null));};exports[_0x1499('0xc8')]=function(_0x2e995a,_0x405e0f,_0x1130f2){var _0x4c4433;var _0xc01a11;var _0xc1123={};var _0x2830cd;return db[_0x1499('0x4a')][_0x1499('0x92')]({'where':{'id':_0x2e995a[_0x1499('0x6a')]['id']},'attributes':['id',_0x1499('0x43'),_0x1499('0x42')]})['then'](handleEntityNotFound(_0x405e0f,null))[_0x1499('0x21')](function(_0x1575f8){if(!utils[_0x1499('0xb2')](_0x2e995a['query'][_0x1499('0xb1')])){throw new db[(_0x1499('0x1f'))][(_0x1499('0x96'))](_0x1499('0xa1'));}_0x4c4433=_0x1575f8;var _0x367284={};_0x367284['model']=_['keys'](db[_[_0x1499('0xa5')](_0x2e995a[_0x1499('0x4f')]['channel'])+'Queue'][_0x1499('0xc0')]);_0x367284['query']=_[_0x1499('0x50')](_0x2e995a[_0x1499('0x4f')]);_0x367284[_0x1499('0x51')]=_[_0x1499('0x52')](_0x367284[_0x1499('0x4d')],_0x367284['query']);_0xc1123[_0x1499('0x53')]=_['intersection'](_0x367284[_0x1499('0x4d')],qs[_0x1499('0x54')](_0x2e995a[_0x1499('0x4f')]['fields']));_0xc1123[_0x1499('0x53')]=_0xc1123[_0x1499('0x53')]['length']?_0xc1123[_0x1499('0x53')]:_0x367284['model'];_0xc1123[_0x1499('0x56')]=qs[_0x1499('0x57')](_0x2e995a[_0x1499('0x4f')][_0x1499('0x57')]);_0xc1123['where']=qs[_0x1499('0x51')](_[_0x1499('0xc1')](_0x2e995a['query'],_0x367284[_0x1499('0x51')]));if(_0x2e995a[_0x1499('0x4f')]['filter']){_0xc1123['where']=_[_0x1499('0x59')](_0xc1123['where'],{'$or':_[_0x1499('0x3f')](_0xc1123['attributes'],function(_0xffc748){var _0x19fd50={};_0x19fd50[_0xffc748]={'$like':'%'+_0x2e995a[_0x1499('0x4f')][_0x1499('0x3d')]+'%'};return _0x19fd50;})});}_0xc1123=_[_0x1499('0x59')]({},_0xc1123,_0x2e995a[_0x1499('0x66')]);switch(_0x4c4433[_0x1499('0x42')]){case _0x1499('0x70'):return db[_[_0x1499('0xa5')](_0x2e995a[_0x1499('0x4f')]['channel'])+_0x1499('0xc9')]['findAll'](_0xc1123);case _0x1499('0x38'):case _0x1499('0x3a'):return _0x4c4433[_0x1499('0x8d')+_[_0x1499('0xa5')](_0x2e995a[_0x1499('0x4f')]['channel'])+_0x1499('0xa2')](_0xc1123);default:throw new db[(_0x1499('0x1f'))][(_0x1499('0x96'))](_0x1499('0xca'));}})[_0x1499('0x21')](function(_0x1183f9){_0x2830cd=_0x1183f9['length'];if(!_0x2e995a[_0x1499('0x4f')][_0x1499('0x55')]('nolimit')){_0xc1123['limit']=qs['limit'](_0x2e995a['query'][_0x1499('0x30')]);_0xc1123['offset']=qs[_0x1499('0x2f')](_0x2e995a[_0x1499('0x4f')][_0x1499('0x2f')]);}switch(_0x4c4433[_0x1499('0x42')]){case _0x1499('0x70'):return db[_[_0x1499('0xa5')](_0x2e995a[_0x1499('0x4f')]['channel'])+'Queue'][_0x1499('0x61')](_0xc1123);case _0x1499('0x38'):case _0x1499('0x3a'):return _0x4c4433[_0x1499('0x8d')+_[_0x1499('0xa5')](_0x2e995a[_0x1499('0x4f')][_0x1499('0xb1')])+'Queues'](_0xc1123);}})['then'](function(_0x43886d){return{'count':_0x2830cd,'rows':_0x43886d};})[_0x1499('0x21')](respondWithResult(_0x405e0f,null))[_0x1499('0x2b')](handleError(_0x405e0f,null));};exports['getVoiceQueuesRt']=function(_0x59022c,_0x5c5ae8,_0x47773f){var _0x26ee8c={};var _0x4d67e3={};var _0x557432;var _0x4df811;return db[_0x1499('0x4a')][_0x1499('0x92')]({'where':{'id':_0x59022c[_0x1499('0x6a')]['id']}})['then'](handleEntityNotFound(_0x5c5ae8,null))[_0x1499('0x21')](function(_0x23d569){if(_0x23d569){_0x557432=_0x23d569;_0x4d67e3[_0x1499('0x4d')]=_[_0x1499('0x50')](db['UserVoiceQueueRt'][_0x1499('0xc0')]);_0x4d67e3[_0x1499('0x4f')]=_[_0x1499('0x50')](_0x59022c['query']);_0x4d67e3[_0x1499('0x51')]=_['intersection'](_0x4d67e3[_0x1499('0x4d')],_0x4d67e3[_0x1499('0x4f')]);_0x26ee8c[_0x1499('0x53')]=_[_0x1499('0x52')](_0x4d67e3[_0x1499('0x4d')],qs[_0x1499('0x54')](_0x59022c[_0x1499('0x4f')][_0x1499('0x54')]));_0x26ee8c[_0x1499('0x53')]=_0x26ee8c[_0x1499('0x53')][_0x1499('0x65')]?_0x26ee8c[_0x1499('0x53')]:_0x4d67e3[_0x1499('0x4d')];_0x26ee8c[_0x1499('0x56')]=qs[_0x1499('0x57')](_0x59022c[_0x1499('0x4f')]['sort']);_0x26ee8c[_0x1499('0x58')]=qs['filters'](_[_0x1499('0xc1')](_0x59022c[_0x1499('0x4f')],_0x4d67e3[_0x1499('0x51')]));if(_0x59022c['query']['filter']){_0x26ee8c[_0x1499('0x58')]=_['merge'](_0x26ee8c[_0x1499('0x58')],{'$or':_[_0x1499('0x3f')](_0x26ee8c[_0x1499('0x53')],function(_0xbed269){var _0xc45937={};_0xc45937[_0xbed269]={'$like':'%'+_0x59022c[_0x1499('0x4f')][_0x1499('0x3d')]+'%'};return _0xc45937;})});}_0x26ee8c=_[_0x1499('0x59')]({},_0x26ee8c,_0x59022c[_0x1499('0x66')]);return _0x557432[_0x1499('0xcb')](_0x26ee8c);}})[_0x1499('0x21')](function(_0x21b2f2){if(_0x21b2f2){_0x4df811=_0x21b2f2[_0x1499('0x65')];if(!_0x59022c['query'][_0x1499('0x55')](_0x1499('0xc7'))){_0x26ee8c[_0x1499('0x30')]=qs[_0x1499('0x30')](_0x59022c[_0x1499('0x4f')]['limit']);_0x26ee8c['offset']=qs[_0x1499('0x2f')](_0x59022c[_0x1499('0x4f')][_0x1499('0x2f')]);}return _0x557432['getVoiceQueuesRt'](_0x26ee8c);}})[_0x1499('0x21')](function(_0xe9243f){if(_0xe9243f){return _0xe9243f?{'count':_0x4df811,'rows':_0xe9243f}:null;}})[_0x1499('0x21')](respondWithResult(_0x5c5ae8,null))[_0x1499('0x2b')](handleError(_0x5c5ae8,null));};exports[_0x1499('0xcc')]=function(_0x12d947,_0x3563b6,_0x91ac13){var _0x443c15={};var _0x2beaf1={};var _0x1b1c99;var _0x4d7163;return db[_0x1499('0x4a')]['findOne']({'where':{'id':_0x12d947[_0x1499('0x6a')]['id']}})[_0x1499('0x21')](handleEntityNotFound(_0x3563b6,null))[_0x1499('0x21')](function(_0x3f5d70){if(_0x3f5d70){_0x1b1c99=_0x3f5d70;_0x2beaf1[_0x1499('0x4d')]=_[_0x1499('0x50')](db['ChatGroup'][_0x1499('0xc0')]);_0x2beaf1[_0x1499('0x4f')]=_[_0x1499('0x50')](_0x12d947[_0x1499('0x4f')]);_0x2beaf1['filters']=_['intersection'](_0x2beaf1[_0x1499('0x4d')],_0x2beaf1[_0x1499('0x4f')]);_0x443c15[_0x1499('0x53')]=_[_0x1499('0x52')](_0x2beaf1[_0x1499('0x4d')],qs[_0x1499('0x54')](_0x12d947[_0x1499('0x4f')]['fields']));_0x443c15['attributes']=_0x443c15[_0x1499('0x53')]['length']?_0x443c15['attributes']:_0x2beaf1[_0x1499('0x4d')];_0x443c15[_0x1499('0x56')]=qs['sort'](_0x12d947[_0x1499('0x4f')][_0x1499('0x57')]);_0x443c15[_0x1499('0x58')]=qs['filters'](_[_0x1499('0xc1')](_0x12d947['query'],_0x2beaf1[_0x1499('0x51')]));if(_0x12d947['query']['filter']){_0x443c15[_0x1499('0x58')]=_[_0x1499('0x59')](_0x443c15[_0x1499('0x58')],{'$or':_[_0x1499('0x3f')](_0x443c15[_0x1499('0x53')],function(_0x2740d1){var _0x92495d={};_0x92495d[_0x2740d1]={'$like':'%'+_0x12d947[_0x1499('0x4f')][_0x1499('0x3d')]+'%'};return _0x92495d;})});}_0x443c15=_['merge']({},_0x443c15,_0x12d947[_0x1499('0x66')]);return _0x1b1c99['getGroups'](_0x443c15);}})[_0x1499('0x21')](function(_0x4df687){if(_0x4df687){_0x4d7163=_0x4df687['length'];if(!_0x12d947['query'][_0x1499('0x55')](_0x1499('0xc7'))){_0x443c15['limit']=qs[_0x1499('0x30')](_0x12d947[_0x1499('0x4f')][_0x1499('0x30')]);_0x443c15['offset']=qs[_0x1499('0x2f')](_0x12d947['query'][_0x1499('0x2f')]);}return _0x1b1c99['getGroups'](_0x443c15);}})[_0x1499('0x21')](function(_0x111cf5){if(_0x111cf5){return _0x111cf5?{'count':_0x4d7163,'rows':_0x111cf5}:null;}})['then'](respondWithResult(_0x3563b6,null))[_0x1499('0x2b')](handleError(_0x3563b6,null));};exports[_0x1499('0xcd')]=function(_0x429b7f,_0x48073b,_0x2eb36b){var _0x3f3214={'raw':!![],'where':{}};var _0xd42c16={};var _0x4a6ea8={'count':0x0,'rows':[]};return db[_0x1499('0x4a')][_0x1499('0x92')]({'where':{'id':_0x429b7f[_0x1499('0x6a')]['id']}})[_0x1499('0x21')](handleEntityNotFound(_0x48073b,null))[_0x1499('0x21')](function(_0x139ca6){if(_0x139ca6){_0xd42c16[_0x1499('0x4d')]=_['keys'](db[_0x1499('0xce')]['rawAttributes']);_0xd42c16['query']=_[_0x1499('0x50')](_0x429b7f['query']);_0xd42c16[_0x1499('0x51')]=_['intersection'](_0xd42c16[_0x1499('0x4d')],_0xd42c16[_0x1499('0x4f')]);_0x3f3214[_0x1499('0x53')]=_[_0x1499('0x52')](_0xd42c16['model'],qs[_0x1499('0x54')](_0x429b7f[_0x1499('0x4f')][_0x1499('0x54')]));_0x3f3214['attributes']=_0x3f3214[_0x1499('0x53')]['length']?_0x3f3214[_0x1499('0x53')]:_0xd42c16[_0x1499('0x4d')];if(!_0x429b7f[_0x1499('0x4f')][_0x1499('0x55')](_0x1499('0xc7'))){_0x3f3214[_0x1499('0x30')]=qs['limit'](_0x429b7f['query'][_0x1499('0x30')]);_0x3f3214[_0x1499('0x2f')]=qs['offset'](_0x429b7f[_0x1499('0x4f')]['offset']);}_0x3f3214[_0x1499('0x56')]=qs['sort'](_0x429b7f[_0x1499('0x4f')][_0x1499('0x57')]);_0x3f3214[_0x1499('0x58')]=qs['filters'](_[_0x1499('0xc1')](_0x429b7f[_0x1499('0x4f')],_0xd42c16[_0x1499('0x51')]));_0x3f3214['where'][_0x1499('0xcf')]=_0x139ca6['id'];if(_0x429b7f[_0x1499('0x4f')][_0x1499('0x3d')]){_0x3f3214['where']=_['merge'](_0x3f3214[_0x1499('0x58')],{'$or':_[_0x1499('0x3f')](_0x3f3214[_0x1499('0x53')],function(_0x2ea26e){var _0x5e298a={};_0x5e298a[_0x2ea26e]={'$like':'%'+_0x429b7f[_0x1499('0x4f')]['filter']+'%'};return _0x5e298a;})});}_0x3f3214=_['merge']({},_0x3f3214,_0x429b7f[_0x1499('0x66')]);return db[_0x1499('0xce')]['count']({'where':_0x3f3214[_0x1499('0x58')]})[_0x1499('0x21')](function(_0x4f99ed){_0x4a6ea8[_0x1499('0x2e')]=_0x4f99ed;if(_0x429b7f['query'][_0x1499('0x5f')]){_0x3f3214['include']=[{'all':!![]}];}return db[_0x1499('0xce')][_0x1499('0x61')](_0x3f3214);})[_0x1499('0x21')](function(_0x384abf){_0x4a6ea8['rows']=_0x384abf;return _0x4a6ea8;});}})['then'](respondWithFilteredResult(_0x48073b,_0x3f3214))['catch'](handleError(_0x48073b,null));};exports['getScreenRecordings']=function(_0x56c209,_0x16ad56,_0x20215d){var _0x4618af={'raw':!![],'where':{}};var _0x155d5a={};var _0x39aab9={'count':0x0,'rows':[]};return db[_0x1499('0x4a')][_0x1499('0x92')]({'where':{'id':_0x56c209[_0x1499('0x6a')]['id']}})[_0x1499('0x21')](handleEntityNotFound(_0x16ad56,null))[_0x1499('0x21')](function(_0x12623b){if(_0x12623b){_0x155d5a[_0x1499('0x4d')]=_['keys'](db[_0x1499('0xd0')]['rawAttributes']);_0x155d5a['query']=_[_0x1499('0x50')](_0x56c209[_0x1499('0x4f')]);_0x155d5a[_0x1499('0x51')]=_['intersection'](_0x155d5a['model'],_0x155d5a[_0x1499('0x4f')]);_0x4618af[_0x1499('0x53')]=_['intersection'](_0x155d5a['model'],qs[_0x1499('0x54')](_0x56c209[_0x1499('0x4f')]['fields']));_0x4618af[_0x1499('0x53')]=_0x4618af['attributes'][_0x1499('0x65')]?_0x4618af['attributes']:_0x155d5a[_0x1499('0x4d')];if(!_0x56c209[_0x1499('0x4f')][_0x1499('0x55')](_0x1499('0xc7'))){_0x4618af[_0x1499('0x30')]=qs[_0x1499('0x30')](_0x56c209[_0x1499('0x4f')]['limit']);_0x4618af[_0x1499('0x2f')]=qs[_0x1499('0x2f')](_0x56c209[_0x1499('0x4f')][_0x1499('0x2f')]);}_0x4618af[_0x1499('0x56')]=qs[_0x1499('0x57')](_0x56c209[_0x1499('0x4f')]['sort']);_0x4618af['where']=qs[_0x1499('0x51')](_[_0x1499('0xc1')](_0x56c209[_0x1499('0x4f')],_0x155d5a[_0x1499('0x51')]));_0x4618af['where'][_0x1499('0xcf')]=_0x12623b['id'];if(_0x56c209[_0x1499('0x4f')][_0x1499('0x3d')]){_0x4618af['where']=_[_0x1499('0x59')](_0x4618af[_0x1499('0x58')],{'$or':_[_0x1499('0x3f')](_0x4618af[_0x1499('0x53')],function(_0x1be7b5){var _0x2948cd={};_0x2948cd[_0x1be7b5]={'$like':'%'+_0x56c209[_0x1499('0x4f')][_0x1499('0x3d')]+'%'};return _0x2948cd;})});}_0x4618af=_[_0x1499('0x59')]({},_0x4618af,_0x56c209['options']);return db['ScreenRecording'][_0x1499('0x2e')]({'where':_0x4618af[_0x1499('0x58')]})[_0x1499('0x21')](function(_0x5b14fa){_0x39aab9['count']=_0x5b14fa;if(_0x56c209[_0x1499('0x4f')][_0x1499('0x5f')]){_0x4618af['include']=[{'all':!![]}];}return db[_0x1499('0xd0')][_0x1499('0x61')](_0x4618af);})['then'](function(_0x502c40){_0x39aab9[_0x1499('0x62')]=_0x502c40;return _0x39aab9;});}})[_0x1499('0x21')](respondWithFilteredResult(_0x16ad56,_0x4618af))[_0x1499('0x2b')](handleError(_0x16ad56,null));};exports[_0x1499('0xd1')]=function(_0x4c45a5,_0x2c9f89,_0x4c3df2){var _0x320371={};var _0x2602a5={};var _0x51aa3b;var _0x2f5cbd;return db[_0x1499('0x4a')]['findOne']({'where':{'id':_0x4c45a5['params']['id']}})['then'](handleEntityNotFound(_0x2c9f89,null))[_0x1499('0x21')](function(_0x1909a8){if(_0x1909a8){_0x51aa3b=_0x1909a8;_0x2602a5['model']=_[_0x1499('0x50')](db[_0x1499('0xd2')][_0x1499('0xc0')]);_0x2602a5['query']=_['keys'](_0x4c45a5[_0x1499('0x4f')]);_0x2602a5['filters']=_[_0x1499('0x52')](_0x2602a5[_0x1499('0x4d')],_0x2602a5['query']);_0x320371[_0x1499('0x53')]=_[_0x1499('0x52')](_0x2602a5['model'],qs[_0x1499('0x54')](_0x4c45a5[_0x1499('0x4f')][_0x1499('0x54')]));_0x320371[_0x1499('0x53')]=_0x320371['attributes'][_0x1499('0x65')]?_0x320371[_0x1499('0x53')]:_0x2602a5[_0x1499('0x4d')];_0x320371[_0x1499('0x56')]=qs[_0x1499('0x57')](_0x4c45a5['query'][_0x1499('0x57')]);_0x320371[_0x1499('0x58')]=qs['filters'](_[_0x1499('0xc1')](_0x4c45a5[_0x1499('0x4f')],_0x2602a5[_0x1499('0x51')]));if(_0x4c45a5[_0x1499('0x4f')]['filter']){_0x320371[_0x1499('0x58')]=_['merge'](_0x320371['where'],{'$or':_['map'](_0x320371[_0x1499('0x53')],function(_0x968483){var _0x13b5d7={};_0x13b5d7[_0x968483]={'$like':'%'+_0x4c45a5[_0x1499('0x4f')][_0x1499('0x3d')]+'%'};return _0x13b5d7;})});}_0x320371=_[_0x1499('0x59')]({},_0x320371,_0x4c45a5[_0x1499('0x66')]);return _0x51aa3b[_0x1499('0xd1')](_0x320371);}})['then'](function(_0x1ac9e4){if(_0x1ac9e4){_0x2f5cbd=_0x1ac9e4[_0x1499('0x65')];if(!_0x4c45a5[_0x1499('0x4f')][_0x1499('0x55')]('nolimit')){_0x320371['limit']=qs[_0x1499('0x30')](_0x4c45a5['query'][_0x1499('0x30')]);_0x320371['offset']=qs['offset'](_0x4c45a5[_0x1499('0x4f')][_0x1499('0x2f')]);}return _0x51aa3b[_0x1499('0xd1')](_0x320371);}})[_0x1499('0x21')](function(_0x24faa3){if(_0x24faa3){return _0x24faa3?{'count':_0x2f5cbd,'rows':_0x24faa3}:null;}})[_0x1499('0x21')](respondWithResult(_0x2c9f89,null))[_0x1499('0x2b')](handleError(_0x2c9f89,null));};exports[_0x1499('0xd3')]=function(_0x2460a7,_0xf2e7fd,_0x35e0c4){var _0x3510ff={};var _0x28c946={};var _0x57e545;var _0x50b66b;return db[_0x1499('0x4a')][_0x1499('0x92')]({'where':{'id':_0x2460a7[_0x1499('0x6a')]['id']}})[_0x1499('0x21')](handleEntityNotFound(_0xf2e7fd,null))[_0x1499('0x21')](function(_0x2f738e){if(_0x2f738e){_0x57e545=_0x2f738e;_0x28c946[_0x1499('0x4d')]=_['keys'](db[_0x1499('0xd4')]['rawAttributes']);_0x28c946[_0x1499('0x4f')]=_['keys'](_0x2460a7[_0x1499('0x4f')]);_0x28c946[_0x1499('0x51')]=_['intersection'](_0x28c946[_0x1499('0x4d')],_0x28c946[_0x1499('0x4f')]);_0x3510ff['attributes']=_[_0x1499('0x52')](_0x28c946[_0x1499('0x4d')],qs['fields'](_0x2460a7[_0x1499('0x4f')][_0x1499('0x54')]));_0x3510ff[_0x1499('0x53')]=_0x3510ff[_0x1499('0x53')][_0x1499('0x65')]?_0x3510ff['attributes']:_0x28c946[_0x1499('0x4d')];_0x3510ff[_0x1499('0x56')]=qs[_0x1499('0x57')](_0x2460a7['query']['sort']);_0x3510ff[_0x1499('0x58')]=qs[_0x1499('0x51')](_[_0x1499('0xc1')](_0x2460a7[_0x1499('0x4f')],_0x28c946[_0x1499('0x51')]));if(_0x2460a7[_0x1499('0x4f')][_0x1499('0x3d')]){_0x3510ff[_0x1499('0x58')]=_[_0x1499('0x59')](_0x3510ff[_0x1499('0x58')],{'$or':_[_0x1499('0x3f')](_0x3510ff[_0x1499('0x53')],function(_0x32a9c9){var _0x2b010a={};_0x2b010a[_0x32a9c9]={'$like':'%'+_0x2460a7[_0x1499('0x4f')]['filter']+'%'};return _0x2b010a;})});}_0x3510ff=_[_0x1499('0x59')]({},_0x3510ff,_0x2460a7['options']);return _0x57e545['getOpenchannelInteractions'](_0x3510ff);}})[_0x1499('0x21')](function(_0x40f339){if(_0x40f339){_0x50b66b=_0x40f339[_0x1499('0x65')];if(!_0x2460a7[_0x1499('0x4f')][_0x1499('0x55')](_0x1499('0xc7'))){_0x3510ff['limit']=qs[_0x1499('0x30')](_0x2460a7[_0x1499('0x4f')][_0x1499('0x30')]);_0x3510ff[_0x1499('0x2f')]=qs['offset'](_0x2460a7[_0x1499('0x4f')][_0x1499('0x2f')]);}return _0x57e545[_0x1499('0xd3')](_0x3510ff);}})[_0x1499('0x21')](function(_0x50a29b){if(_0x50a29b){return _0x50a29b?{'count':_0x50b66b,'rows':_0x50a29b}:null;}})['then'](respondWithResult(_0xf2e7fd,null))[_0x1499('0x2b')](handleError(_0xf2e7fd,null));};exports[_0x1499('0xd5')]=function(_0x37a329,_0x2417fc,_0x4e5dd1){var _0x14206f={'raw':!![],'where':{}};var _0x5a51ac={};var _0x5b7eca={'count':0x0,'rows':[]};return db[_0x1499('0x4a')][_0x1499('0x92')]({'where':{'id':_0x37a329[_0x1499('0x6a')]['id']}})[_0x1499('0x21')](handleEntityNotFound(_0x2417fc,null))['then'](function(_0x2c9ed9){if(_0x2c9ed9){_0x5a51ac['model']=_[_0x1499('0x50')](db[_0x1499('0xd6')][_0x1499('0xc0')]);_0x5a51ac[_0x1499('0x4f')]=_['keys'](_0x37a329[_0x1499('0x4f')]);_0x5a51ac['filters']=_['intersection'](_0x5a51ac[_0x1499('0x4d')],_0x5a51ac[_0x1499('0x4f')]);_0x14206f[_0x1499('0x53')]=_['intersection'](_0x5a51ac[_0x1499('0x4d')],qs[_0x1499('0x54')](_0x37a329['query'][_0x1499('0x54')]));_0x14206f[_0x1499('0x53')]=_0x14206f[_0x1499('0x53')][_0x1499('0x65')]?_0x14206f[_0x1499('0x53')]:_0x5a51ac[_0x1499('0x4d')];if(!_0x37a329[_0x1499('0x4f')][_0x1499('0x55')](_0x1499('0xc7'))){_0x14206f['limit']=qs[_0x1499('0x30')](_0x37a329[_0x1499('0x4f')]['limit']);_0x14206f[_0x1499('0x2f')]=qs[_0x1499('0x2f')](_0x37a329[_0x1499('0x4f')][_0x1499('0x2f')]);}_0x14206f[_0x1499('0x56')]=qs[_0x1499('0x57')](_0x37a329['query']['sort']);_0x14206f[_0x1499('0x58')]=qs[_0x1499('0x51')](_[_0x1499('0xc1')](_0x37a329[_0x1499('0x4f')],_0x5a51ac[_0x1499('0x51')]));_0x14206f[_0x1499('0x58')][_0x1499('0xcf')]=_0x2c9ed9['id'];if(_0x37a329[_0x1499('0x4f')][_0x1499('0x3d')]){_0x14206f[_0x1499('0x58')]=_['merge'](_0x14206f['where'],{'$or':_[_0x1499('0x3f')](_0x14206f[_0x1499('0x53')],function(_0x56d164){var _0x426a07={};_0x426a07[_0x56d164]={'$like':'%'+_0x37a329[_0x1499('0x4f')][_0x1499('0x3d')]+'%'};return _0x426a07;})});}_0x14206f=_['merge']({},_0x14206f,_0x37a329[_0x1499('0x66')]);return db[_0x1499('0xd6')][_0x1499('0x2e')]({'where':_0x14206f[_0x1499('0x58')]})[_0x1499('0x21')](function(_0x31c121){_0x5b7eca[_0x1499('0x2e')]=_0x31c121;if(_0x37a329[_0x1499('0x4f')][_0x1499('0x5f')]){_0x14206f['include']=[{'all':!![]}];}return db[_0x1499('0xd6')][_0x1499('0x61')](_0x14206f);})[_0x1499('0x21')](function(_0x8450d6){_0x5b7eca[_0x1499('0x62')]=_0x8450d6;return _0x5b7eca;});}})[_0x1499('0x21')](respondWithFilteredResult(_0x2417fc,_0x14206f))[_0x1499('0x2b')](handleError(_0x2417fc,null));};exports[_0x1499('0xd7')]=function(_0x3b6551,_0x5b81fa,_0x25ea08){var _0x5181e8={};var _0x4d3828={};var _0x53d665;var _0x48971c;return db[_0x1499('0x4a')][_0x1499('0x92')]({'where':{'id':_0x3b6551[_0x1499('0x6a')]['id']}})['then'](handleEntityNotFound(_0x5b81fa,null))[_0x1499('0x21')](function(_0x439783){if(_0x439783){_0x53d665=_0x439783;_0x4d3828[_0x1499('0x4d')]=_[_0x1499('0x50')](db['SmsInteraction']['rawAttributes']);_0x4d3828[_0x1499('0x4f')]=_[_0x1499('0x50')](_0x3b6551['query']);_0x4d3828['filters']=_[_0x1499('0x52')](_0x4d3828['model'],_0x4d3828[_0x1499('0x4f')]);_0x5181e8[_0x1499('0x53')]=_['intersection'](_0x4d3828[_0x1499('0x4d')],qs[_0x1499('0x54')](_0x3b6551['query'][_0x1499('0x54')]));_0x5181e8[_0x1499('0x53')]=_0x5181e8[_0x1499('0x53')][_0x1499('0x65')]?_0x5181e8['attributes']:_0x4d3828[_0x1499('0x4d')];_0x5181e8[_0x1499('0x56')]=qs['sort'](_0x3b6551[_0x1499('0x4f')][_0x1499('0x57')]);_0x5181e8[_0x1499('0x58')]=qs[_0x1499('0x51')](_[_0x1499('0xc1')](_0x3b6551[_0x1499('0x4f')],_0x4d3828[_0x1499('0x51')]));if(_0x3b6551[_0x1499('0x4f')]['filter']){_0x5181e8['where']=_['merge'](_0x5181e8[_0x1499('0x58')],{'$or':_[_0x1499('0x3f')](_0x5181e8[_0x1499('0x53')],function(_0x356663){var _0x2de0bb={};_0x2de0bb[_0x356663]={'$like':'%'+_0x3b6551[_0x1499('0x4f')][_0x1499('0x3d')]+'%'};return _0x2de0bb;})});}_0x5181e8=_[_0x1499('0x59')]({},_0x5181e8,_0x3b6551[_0x1499('0x66')]);return _0x53d665[_0x1499('0xd7')](_0x5181e8);}})[_0x1499('0x21')](function(_0x170b0e){if(_0x170b0e){_0x48971c=_0x170b0e['length'];if(!_0x3b6551[_0x1499('0x4f')][_0x1499('0x55')](_0x1499('0xc7'))){_0x5181e8[_0x1499('0x30')]=qs['limit'](_0x3b6551['query'][_0x1499('0x30')]);_0x5181e8[_0x1499('0x2f')]=qs[_0x1499('0x2f')](_0x3b6551[_0x1499('0x4f')]['offset']);}return _0x53d665[_0x1499('0xd7')](_0x5181e8);}})[_0x1499('0x21')](function(_0x4e2ddd){if(_0x4e2ddd){return _0x4e2ddd?{'count':_0x48971c,'rows':_0x4e2ddd}:null;}})[_0x1499('0x21')](respondWithResult(_0x5b81fa,null))[_0x1499('0x2b')](handleError(_0x5b81fa,null));};exports['getFaxInteractions']=function(_0x32f4cd,_0x533784,_0x521424){var _0x4dd304={};var _0x5e8f30={};var _0x2d5383;var _0x25d9bb;return db[_0x1499('0x4a')][_0x1499('0x92')]({'where':{'id':_0x32f4cd['params']['id']}})[_0x1499('0x21')](handleEntityNotFound(_0x533784,null))[_0x1499('0x21')](function(_0x356fa4){if(_0x356fa4){_0x2d5383=_0x356fa4;_0x5e8f30[_0x1499('0x4d')]=_[_0x1499('0x50')](db[_0x1499('0xd8')][_0x1499('0xc0')]);_0x5e8f30['query']=_['keys'](_0x32f4cd['query']);_0x5e8f30[_0x1499('0x51')]=_[_0x1499('0x52')](_0x5e8f30['model'],_0x5e8f30[_0x1499('0x4f')]);_0x4dd304['attributes']=_[_0x1499('0x52')](_0x5e8f30[_0x1499('0x4d')],qs[_0x1499('0x54')](_0x32f4cd[_0x1499('0x4f')][_0x1499('0x54')]));_0x4dd304[_0x1499('0x53')]=_0x4dd304[_0x1499('0x53')][_0x1499('0x65')]?_0x4dd304['attributes']:_0x5e8f30[_0x1499('0x4d')];_0x4dd304['order']=qs[_0x1499('0x57')](_0x32f4cd[_0x1499('0x4f')][_0x1499('0x57')]);_0x4dd304[_0x1499('0x58')]=qs['filters'](_[_0x1499('0xc1')](_0x32f4cd[_0x1499('0x4f')],_0x5e8f30[_0x1499('0x51')]));if(_0x32f4cd[_0x1499('0x4f')][_0x1499('0x3d')]){_0x4dd304['where']=_[_0x1499('0x59')](_0x4dd304[_0x1499('0x58')],{'$or':_[_0x1499('0x3f')](_0x4dd304[_0x1499('0x53')],function(_0x3accce){var _0x4af7d0={};_0x4af7d0[_0x3accce]={'$like':'%'+_0x32f4cd['query'][_0x1499('0x3d')]+'%'};return _0x4af7d0;})});}_0x4dd304=_[_0x1499('0x59')]({},_0x4dd304,_0x32f4cd[_0x1499('0x66')]);return _0x2d5383[_0x1499('0xd9')](_0x4dd304);}})[_0x1499('0x21')](function(_0x2fc866){if(_0x2fc866){_0x25d9bb=_0x2fc866[_0x1499('0x65')];if(!_0x32f4cd[_0x1499('0x4f')][_0x1499('0x55')]('nolimit')){_0x4dd304[_0x1499('0x30')]=qs[_0x1499('0x30')](_0x32f4cd['query'][_0x1499('0x30')]);_0x4dd304[_0x1499('0x2f')]=qs[_0x1499('0x2f')](_0x32f4cd[_0x1499('0x4f')][_0x1499('0x2f')]);}return _0x2d5383['getFaxInteractions'](_0x4dd304);}})[_0x1499('0x21')](function(_0x23176b){if(_0x23176b){return _0x23176b?{'count':_0x25d9bb,'rows':_0x23176b}:null;}})[_0x1499('0x21')](respondWithResult(_0x533784,null))[_0x1499('0x2b')](handleError(_0x533784,null));};exports['login']=function(_0x387f37,_0x406e84,_0xeffe6){var _0x29c33c;var _0x3e33a6;var _0x2d02a5;var _0x1c4a5d=!_['isNil'](_0x387f37[_0x1499('0x6a')]['id'])?_0x387f37['params']['id']:!_[_0x1499('0x7d')](_0x387f37[_0x1499('0x38')]['id'])?_0x387f37[_0x1499('0x38')]['id']:null;return db['User']['find']({'where':{'id':_0x1c4a5d,'role':{'$or':[_0x1499('0x70'),_0x1499('0x38'),_0x1499('0x3a')]}},'attributes':['id','name',_0x1499('0xda'),_0x1499('0xdb'),_0x1499('0x42'),_0x1499('0x77'),'loginInPause']})[_0x1499('0x21')](function(_0x34cfc5){if(_0x34cfc5){if(_0x34cfc5[_0x1499('0x42')]==='agent'){_0x29c33c=_0x34cfc5;if(_0x387f37[_0x1499('0x69')][_0x1499('0xa0')]){_0x2d02a5=util[_0x1499('0xdc')](_0x1499('0xdd'),_0x29c33c[_0x387f37[_0x1499('0x69')][_0x1499('0xa0')]]);}else if(_0x387f37['body'][_0x1499('0xde')]){_0x2d02a5=util['format'](_0x1499('0xac'),_0x387f37['body'][_0x1499('0xde')]);}else{_0x2d02a5=util[_0x1499('0xdc')](_0x1499('0xac'),_0x29c33c[_0x1499('0x43')]);}socket['to'](util[_0x1499('0xdc')](_0x1499('0xdf'),_0x29c33c[_0x1499('0x43')]))[_0x1499('0xa8')](_0x1499('0xe0'),{'ip':_0x387f37[_0x1499('0xe1')][_0x1499('0xe2')]||_0x387f37[_0x1499('0xe3')][_0x1499('0xe4')]||_0x387f37[_0x1499('0xe5')][_0x1499('0xe4')]||_0x387f37[_0x1499('0xe3')]['socket']['remoteAddress']});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x29c33c[_0x1499('0x43')]},'individualHooks':!![]});}}else{throw new db[(_0x1499('0x1f'))]['ValidationError'](_0x1499('0xe6'));}})['then'](function(){if(_0x29c33c){return _0x29c33c[_0x1499('0xe7')]({'raw':!![]});}})[_0x1499('0x21')](function(_0xa04390){if(_0x29c33c){var _0x5a8c02=[];if(_0xa04390){_0x3e33a6=_0xa04390;if(_0x3e33a6[_0x1499('0x65')]){for(var _0x475f03=0x0;_0x475f03<_0x3e33a6['length'];_0x475f03++){_0x5a8c02[_0x1499('0xe8')]({'membername':_0x29c33c['name'],'UserId':_0x29c33c['id'],'queue_name':_0x3e33a6[_0x475f03][_0x1499('0x43')],'VoiceQueueId':_0x3e33a6[_0x475f03]['id'],'interface':_0x2d02a5,'paused':_0x29c33c[_0x1499('0x9e')]||![],'penalty':_0x3e33a6[_0x475f03][_0x1499('0xe9')]||0x0});}return BPromise['each'](_0x5a8c02,function(_0x479405){return db[_0x1499('0xae')][_0x1499('0xaf')](_0x479405);});}}}})['then'](function(){if(_0x29c33c){return db[_0x1499('0xea')][_0x1499('0x61')]({'where':{'membername':_0x29c33c[_0x1499('0x43')],'exitAt':null}});}})[_0x1499('0x21')](function(_0x180794){if(_0x29c33c){var _0x2d6072=[];_0x180794[_0x1499('0xeb')](function(_0x151624){_0x2d6072[_0x1499('0xe8')](_0x151624[_0x1499('0x35')]({'exitAt':moment()[_0x1499('0xdc')](_0x1499('0xec'))}));});return BPromise[_0x1499('0xed')](_0x2d6072);}})[_0x1499('0x21')](function(){if(_0x29c33c){var _0x424e65=[];var _0x200898=[];var _0xca70f7=utils[_0x1499('0xee')]();var _0x43d207={'membername':_0x29c33c['name'],'interface':_0x2d02a5,'enterAt':moment()['format'](_0x1499('0xec')),'role':_0x29c33c[_0x1499('0x42')],'internal':_0x29c33c[_0x1499('0x77')]};_0xca70f7[_0x1499('0xeb')](function(_0x3b3bbf){_0x424e65[_0x1499('0xe8')](_[_0x1499('0x59')]({'channel':_0x3b3bbf,'type':_0x1499('0xef'),'data1':_0x387f37[_0x1499('0x69')]['device'],'data2':_0x2d02a5},_0x43d207));if(_0x29c33c['loginInPause']){_0x200898[_0x1499('0xe8')](_[_0x1499('0x59')]({'channel':_0x3b3bbf,'type':_0x1499('0xf0'),'data1':_0x1499('0xf1')},_0x43d207));}});return db[_0x1499('0xea')][_0x1499('0x68')](_0x424e65['concat'](_0x200898),{'individualHooks':!![]});}})[_0x1499('0x21')](function(){if(_0x29c33c){return _0x29c33c[_0x1499('0x35')]({'online':!![],'lastLoginAt':moment()[_0x1499('0xdc')](_0x1499('0xec')),'voicePause':_0x29c33c[_0x1499('0x9e')]||![],'mailPause':_0x29c33c[_0x1499('0x9e')]||![],'chatPause':_0x29c33c[_0x1499('0x9e')]||![],'faxPause':_0x29c33c[_0x1499('0x9e')]||![],'smsPause':_0x29c33c[_0x1499('0x9e')]||![],'openchannelPause':_0x29c33c[_0x1499('0x9e')]||![],'pauseType':_0x29c33c['loginInPause']?_0x1499('0xf1'):null,'interface':_0x2d02a5,'lastPauseAt':moment()[_0x1499('0xdc')](_0x1499('0xec'))});}})['then'](function(_0xc9f64a){if(_0x387f37['isMiddleware']){return _0xeffe6();}else{return BPromise[_0x1499('0xf2')](_0xc9f64a)[_0x1499('0x21')](respondWithResult(_0x406e84,null));}})['catch'](handleError(_0x406e84,null));};exports[_0x1499('0xf3')]=function(_0xa37e3c,_0x5d1ace,_0x56c157){var _0x350f1a;return db[_0x1499('0x4a')][_0x1499('0x67')]({'where':{'id':_0xa37e3c[_0x1499('0x6a')]['id'],'role':_0x1499('0x3a')},'attributes':['id',_0x1499('0x43'),_0x1499('0x42')]})[_0x1499('0x21')](handleEntityNotFound(_0x5d1ace,null))[_0x1499('0x21')](function(_0x58fcee){if(_0x58fcee){_0x350f1a=_0x58fcee;return db[_0x1499('0xae')][_0x1499('0x36')]({'where':{'membername':_0x350f1a[_0x1499('0x43')]},'individualHooks':!![]});}})['then'](function(){return db[_0x1499('0xea')]['findAll']({'where':{'membername':_0x350f1a[_0x1499('0x43')],'exitAt':null}});})[_0x1499('0x21')](function(_0x591196){var _0x21018e=[];_0x591196[_0x1499('0xeb')](function(_0x561114){_0x21018e[_0x1499('0xe8')](_0x561114[_0x1499('0x35')]({'exitAt':moment()[_0x1499('0xdc')](_0x1499('0xec'))}));});return BPromise[_0x1499('0xed')](_0x21018e);})[_0x1499('0x21')](function(){return _0x350f1a[_0x1499('0x35')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x1499('0x21')](respondWithResult(_0x5d1ace,null))[_0x1499('0x2b')](handleError(_0x5d1ace,null));};exports[_0x1499('0xf4')]=function(_0x276f5f,_0x2c1531,_0x32467c){var _0x136cda;return db[_0x1499('0xae')][_0x1499('0x35')]({'paused':0x1},{'where':{'UserId':_0x276f5f[_0x1499('0x6a')]['id']},'individualHooks':!![]})[_0x1499('0x21')](function(){return db[_0x1499('0x4a')][_0x1499('0x67')]({'where':{'id':_0x276f5f[_0x1499('0x6a')]['id'],'role':_0x1499('0x3a')},'attributes':['id',_0x1499('0x43'),_0x1499('0x42'),_0x1499('0x77'),_0x1499('0xa0')]});})[_0x1499('0x21')](handleEntityNotFound(_0x2c1531,null))[_0x1499('0x21')](function(_0x5c0e24){if(_0x5c0e24){_0x136cda=_0x5c0e24;return respondWithRpcPromise('QueuePause',_0x1499('0xf4'),{'id':_0x136cda['id'],'name':_0x136cda[_0x1499('0x43')],'pause':!![]});}})[_0x1499('0x21')](function(){if(_0x136cda){return db['MemberReport'][_0x1499('0x61')]({'where':{'membername':_0x136cda[_0x1499('0x43')],'type':_0x1499('0xf0'),'exitAt':null}});}})[_0x1499('0x21')](function(_0x1fae54){if(_0x1fae54[_0x1499('0x65')]){var _0x20fa18=moment()[_0x1499('0xdc')](_0x1499('0xec'));for(var _0x1c716b=0x0,_0x122d10=_0x1fae54[_0x1499('0x65')];_0x1c716b<_0x122d10;_0x1c716b++){_0x1fae54[_0x1c716b]['updateAttributes']({'exitAt':_0x20fa18});}}})[_0x1499('0x21')](function(){var _0x57bf72=[];var _0x261b18=utils[_0x1499('0xee')]();_0x261b18[_0x1499('0xeb')](function(_0x23ec6d){_0x57bf72[_0x1499('0xe8')]({'channel':_0x23ec6d,'membername':_0x136cda['name'],'interface':_['isNil'](_0x136cda[_0x1499('0xa0')])?util[_0x1499('0xdc')](_0x1499('0xac'),_0x136cda[_0x1499('0x43')]):_0x136cda['interface'],'type':'PAUSE','enterAt':moment()[_0x1499('0xdc')](_0x1499('0xec')),'data1':_0x276f5f[_0x1499('0x69')][_0x1499('0x5a')]||_0x1499('0xf5'),'role':_0x136cda[_0x1499('0x42')],'internal':_0x136cda[_0x1499('0x77')]});});return db[_0x1499('0xea')][_0x1499('0x68')](_0x57bf72,{'individualHooks':!![]});})[_0x1499('0x21')](function(){return _0x136cda[_0x1499('0x35')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x276f5f[_0x1499('0x69')][_0x1499('0x5a')]||_0x1499('0xf5'),'lastPauseAt':moment()[_0x1499('0xdc')](_0x1499('0xec'))});})['then'](respondWithResult(_0x2c1531,null))[_0x1499('0x2b')](handleError(_0x2c1531,null));};exports[_0x1499('0xf6')]=function(_0x3f4e18,_0x4abc56,_0x15951){var _0x4e5af7;return db[_0x1499('0x4a')][_0x1499('0x67')]({'where':{'id':_0x3f4e18[_0x1499('0x6a')]['id']},'attributes':['id',_0x1499('0x43'),_0x1499('0x42'),_0x1499('0x9f'),_0x1499('0xf7'),'chatPause','faxPause',_0x1499('0xf8'),_0x1499('0xf9'),'pauseType','lastPauseAt']})[_0x1499('0x21')](handleEntityNotFound(_0x4abc56,null))[_0x1499('0x21')](function(_0x1944a1){if(_0x1944a1){_0x4e5af7=_0x1944a1;if(_0x3f4e18[_0x1499('0x69')][_0x1499('0xb1')]&&!utils[_0x1499('0xb2')](_0x3f4e18['body']['channel'])){throw new db[(_0x1499('0x1f'))][(_0x1499('0x96'))](_0x1499('0xa1'));}switch(_0x3f4e18[_0x1499('0x69')][_0x1499('0xb1')]){case _0x1499('0xaa'):return respondWithRpcPromise('QueuePause',_0x1499('0xf6'),{'id':_0x4e5af7['id'],'name':_0x4e5af7[_0x1499('0x43')],'pause':![]})['then'](function(){return db[_0x1499('0xae')][_0x1499('0x35')]({'paused':0x0},{'where':{'UserId':_0x4e5af7['id']},'individualHooks':!![]});})['then'](function(){return db[_0x1499('0xea')][_0x1499('0x67')]({'where':{'channel':_0x3f4e18[_0x1499('0x69')][_0x1499('0xb1')],'membername':_0x4e5af7[_0x1499('0x43')],'type':_0x1499('0xf0'),'exitAt':null}});})['then'](function(_0x8a2df4){if(_0x8a2df4){return _0x8a2df4[_0x1499('0x35')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x1499('0x21')](function(){return _0x4e5af7[_0x1499('0x35')]({'voicePause':![]});});case _0x1499('0xfa'):case _0x1499('0xfb'):case'fax':case _0x1499('0xfc'):case _0x1499('0xfd'):return db[_0x1499('0xea')][_0x1499('0x67')]({'where':{'channel':_0x3f4e18[_0x1499('0x69')][_0x1499('0xb1')],'membername':_0x4e5af7[_0x1499('0x43')],'type':_0x1499('0xf0'),'exitAt':null}})[_0x1499('0x21')](function(_0x37ffd7){if(_0x37ffd7){return _0x37ffd7['update']({'exitAt':moment()[_0x1499('0xdc')](_0x1499('0xec')),'data2':_0x1499('0xfe')},{'individualHooks':!![]});}return null;})[_0x1499('0x21')](function(){var _0xe170c6={};_[_0x1499('0xff')](_0xe170c6,util[_0x1499('0xdc')](_0x1499('0x100'),_0x3f4e18[_0x1499('0x69')]['channel'],_0x1499('0x101')),![]);return _0x4e5af7[_0x1499('0x35')](_0xe170c6);});default:return respondWithRpcPromise('QueuePause',_0x1499('0xf6'),{'id':_0x4e5af7['id'],'name':_0x4e5af7[_0x1499('0x43')],'pause':![]})[_0x1499('0x21')](function(){return db[_0x1499('0xae')][_0x1499('0x35')]({'paused':0x0},{'where':{'UserId':_0x4e5af7['id']}});})[_0x1499('0x21')](function(){return db['MemberReport'][_0x1499('0x61')]({'where':{'membername':_0x4e5af7['name'],'type':_0x1499('0xf0'),'exitAt':null}});})[_0x1499('0x21')](function(_0x20cc01){var _0x15b8a9=[];_0x20cc01[_0x1499('0xeb')](function(_0x51d11f){_0x15b8a9[_0x1499('0xe8')](_0x51d11f[_0x1499('0x35')]({'exitAt':moment()[_0x1499('0xdc')](_0x1499('0xec')),'data2':_0x1499('0xfe')}));});return BPromise[_0x1499('0xed')](_0x15b8a9);})[_0x1499('0x21')](function(){return _0x4e5af7[_0x1499('0x35')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x4abc56,null))[_0x1499('0x2b')](handleError(_0x4abc56,null));};exports[_0x1499('0x102')]=function(_0x1f781a,_0x3c46c8,_0x164ac9){var _0x47fe2a={};var _0x3ff57d={};var _0x41c02c;var _0x13e58b;return db['User'][_0x1499('0x92')]({'where':{'id':_0x1f781a[_0x1499('0x6a')]['id']}})[_0x1499('0x21')](handleEntityNotFound(_0x3c46c8,null))[_0x1499('0x21')](function(_0x58049d){if(_0x58049d){_0x41c02c=_0x58049d;_0x3ff57d[_0x1499('0x4d')]=_['keys'](db[_0x1499('0x103')]['rawAttributes']);_0x3ff57d[_0x1499('0x4f')]=_['keys'](_0x1f781a[_0x1499('0x4f')]);_0x3ff57d['filters']=_[_0x1499('0x52')](_0x3ff57d[_0x1499('0x4d')],_0x3ff57d['query']);_0x47fe2a[_0x1499('0x53')]=_[_0x1499('0x52')](_0x3ff57d['model'],qs['fields'](_0x1f781a[_0x1499('0x4f')][_0x1499('0x54')]));_0x47fe2a[_0x1499('0x53')]=_0x47fe2a['attributes'][_0x1499('0x65')]?_0x47fe2a[_0x1499('0x53')]:_0x3ff57d[_0x1499('0x4d')];_0x47fe2a[_0x1499('0x56')]=qs[_0x1499('0x57')](_0x1f781a['query']['sort']);_0x47fe2a[_0x1499('0x58')]=qs[_0x1499('0x51')](_[_0x1499('0xc1')](_0x1f781a[_0x1499('0x4f')],_0x3ff57d['filters']));if(_0x1f781a[_0x1499('0x4f')][_0x1499('0x3d')]){_0x47fe2a[_0x1499('0x58')]=_['merge'](_0x47fe2a[_0x1499('0x58')],{'$or':_[_0x1499('0x3f')](_0x47fe2a['attributes'],function(_0x6e5da2){var _0x50cd4e={};_0x50cd4e[_0x6e5da2]={'$like':'%'+_0x1f781a[_0x1499('0x4f')]['filter']+'%'};return _0x50cd4e;})});}_0x47fe2a=_[_0x1499('0x59')]({},_0x47fe2a,_0x1f781a[_0x1499('0x66')]);return _0x41c02c['getTeams'](_0x47fe2a);}})[_0x1499('0x21')](function(_0x4acd43){if(_0x4acd43){_0x13e58b=_0x4acd43[_0x1499('0x65')];if(!_0x1f781a[_0x1499('0x4f')][_0x1499('0x55')]('nolimit')){_0x47fe2a['limit']=qs[_0x1499('0x30')](_0x1f781a[_0x1499('0x4f')][_0x1499('0x30')]);_0x47fe2a[_0x1499('0x2f')]=qs['offset'](_0x1f781a[_0x1499('0x4f')][_0x1499('0x2f')]);}return _0x41c02c[_0x1499('0x102')](_0x47fe2a);}})[_0x1499('0x21')](function(_0x50a359){if(_0x50a359){return _0x50a359?{'count':_0x13e58b,'rows':_0x50a359}:null;}})['then'](respondWithResult(_0x3c46c8,null))[_0x1499('0x2b')](handleError(_0x3c46c8,null));};exports[_0x1499('0x104')]=function(_0x20e91b,_0x14c65b){return db[_0x1499('0x4a')][_0x1499('0x67')]({'where':{'id':_0x20e91b[_0x1499('0x6a')]['id']}})[_0x1499('0x21')](handleEntityNotFound(_0x14c65b,null))[_0x1499('0x21')](function(_0x50d2dc){if(_0x50d2dc){var _0x42c58d=_0x50d2dc[_0x1499('0x8d')]({'plain':!![]});return _0x50d2dc[_0x1499('0x104')](_0x20e91b[_0x1499('0x69')][_0x1499('0x6e')],_[_0x1499('0x6d')](_0x20e91b[_0x1499('0x69')],[_0x1499('0x6e'),'id'])||{})['then'](function(){for(var _0x1cfaae=0x0;_0x1cfaae<_0x20e91b[_0x1499('0x69')][_0x1499('0x6e')][_0x1499('0x65')];_0x1cfaae++){var _0x4d3ed3=[];db['Team'][_0x1499('0x92')]({'where':{'id':_0x20e91b['body'][_0x1499('0x6e')][_0x1cfaae]}})[_0x1499('0x21')](function(_0x258130){_0x4d3ed3[_0x1499('0xe8')](_0x258130[_0x1499('0xe7')]()[_0x1499('0x21')](function(_0x2af2d2){for(var _0x4d988f=0x0;_0x4d988f<_0x2af2d2[_0x1499('0x65')];_0x4d988f++){_0x2af2d2[_0x4d988f][_0x1499('0x105')](_0x1499('0xb1'),_0x1499('0x106'));}return _0x2af2d2;}));_0x4d3ed3[_0x1499('0xe8')](_0x258130[_0x1499('0x107')]()[_0x1499('0x21')](function(_0x1984f4){for(var _0x21c4b3=0x0;_0x21c4b3<_0x1984f4[_0x1499('0x65')];_0x21c4b3++){_0x1984f4[_0x21c4b3][_0x1499('0x105')](_0x1499('0xb1'),_0x1499('0x108'));}return _0x1984f4;}));_0x4d3ed3[_0x1499('0xe8')](_0x258130[_0x1499('0x109')]()[_0x1499('0x21')](function(_0x2b4d9c){for(var _0xf62a17=0x0;_0xf62a17<_0x2b4d9c['length'];_0xf62a17++){_0x2b4d9c[_0xf62a17]['setDataValue'](_0x1499('0xb1'),_0x1499('0x10a'));}return _0x2b4d9c;}));_0x4d3ed3[_0x1499('0xe8')](_0x258130[_0x1499('0x10b')]()[_0x1499('0x21')](function(_0x38a40c){for(var _0x43379f=0x0;_0x43379f<_0x38a40c['length'];_0x43379f++){_0x38a40c[_0x43379f][_0x1499('0x105')](_0x1499('0xb1'),'Sms');}return _0x38a40c;}));_0x4d3ed3[_0x1499('0xe8')](_0x258130[_0x1499('0x10c')]()[_0x1499('0x21')](function(_0x54a725){for(var _0x313537=0x0;_0x313537<_0x54a725[_0x1499('0x65')];_0x313537++){_0x54a725[_0x313537][_0x1499('0x105')](_0x1499('0xb1'),_0x1499('0x10d'));}return _0x54a725;}));_0x4d3ed3['push'](_0x258130['getOpenchannelQueues']()[_0x1499('0x21')](function(_0x56043c){for(var _0x55a4fc=0x0;_0x55a4fc<_0x56043c[_0x1499('0x65')];_0x55a4fc++){_0x56043c[_0x55a4fc][_0x1499('0x105')](_0x1499('0xb1'),_0x1499('0x10e'));}return _0x56043c;}));return BPromise[_0x1499('0xed')](_0x4d3ed3);})[_0x1499('0x21')](function(_0x332dcb){var _0x4a4bbd=_[_0x1499('0x10f')](_0x332dcb);_0x4d3ed3=[];return db['sequelize'][_0x1499('0x110')](function(_0x19f680){for(var _0x38eb21=0x0;_0x38eb21<_0x4a4bbd[_0x1499('0x65')];_0x38eb21++){_0x4d3ed3[_0x1499('0xe8')](_0x4a4bbd[_0x38eb21][_0x1499('0x111')](_0x42c58d['id']),{'transaction':_0x19f680});}return BPromise[_0x1499('0xed')](_0x4d3ed3)[_0x1499('0x21')](function(){if(_0x42c58d[_0x1499('0x9d')]){return BPromise[_0x1499('0xad')](_[_0x1499('0x3d')](_0x4a4bbd,function(_0x231206){return _0x231206['getDataValue'](_0x1499('0xb1'))===_0x1499('0x106');}),function(_0x512ef7){return db[_0x1499('0xae')][_0x1499('0xaf')]({'membername':_0x42c58d[_0x1499('0x43')],'UserId':_0x42c58d['id'],'queue_name':_0x512ef7['name'],'VoiceQueueId':_0x512ef7['id'],'interface':_[_0x1499('0x7d')](_0x42c58d[_0x1499('0xa0')])?util[_0x1499('0xdc')](_0x1499('0xac'),_0x42c58d['name']):_0x42c58d[_0x1499('0xa0')],'paused':_0x42c58d[_0x1499('0x9f')]||![],'penalty':_0x42c58d[_0x1499('0xa3')]},{'transaction':_0x19f680});});}else{return;}})[_0x1499('0x21')](function(){for(var _0x10a9ed=0x0;_0x10a9ed<_0x4a4bbd[_0x1499('0x65')];_0x10a9ed++){var _0x371567=_0x4a4bbd[_0x10a9ed][_0x1499('0x112')](_0x1499('0xb1'));var _0x28ba53=_0x371567+'QueueId';socket[_0x1499('0xa8')](_0x1499('0x38')+_0x371567+_0x1499('0xa9'),{'UserId':_0x42c58d['id'],['queueField']:_0x4a4bbd[_0x10a9ed]['id']});}});});});}});}})[_0x1499('0x21')](respondWithStatusCode(_0x14c65b,null))['catch'](handleError(_0x14c65b,null));};exports['removeTeams']=function(_0xaa0521,_0x4ca79a){return db[_0x1499('0x4a')][_0x1499('0x92')]({'where':{'id':_0xaa0521[_0x1499('0x6a')]['id']}})[_0x1499('0x21')](handleEntityNotFound(_0x4ca79a,null))[_0x1499('0x21')](function(_0x568479){if(_0x568479){var _0x3c117f=_0x568479[_0x1499('0x8d')]({'plain':!![]});var _0x793346=_0xaa0521[_0x1499('0x4f')][_0x1499('0x6e')];return _0x568479[_0x1499('0x113')](_0x793346)[_0x1499('0x21')](function(){for(var _0x2f6597=0x0;_0x2f6597<_0x793346[_0x1499('0x65')];_0x2f6597++){var _0x28dbfc=[];db[_0x1499('0x103')]['findOne']({'where':{'id':_0x793346[_0x2f6597]}})[_0x1499('0x21')](function(_0x41ab28){_0x28dbfc['push'](_0x41ab28[_0x1499('0xe7')]()[_0x1499('0x21')](function(_0x297c42){for(var _0x23ed88=0x0;_0x23ed88<_0x297c42[_0x1499('0x65')];_0x23ed88++){_0x297c42[_0x23ed88]['setDataValue'](_0x1499('0xb1'),_0x1499('0x106'));}return _0x297c42;}));_0x28dbfc['push'](_0x41ab28['getChatQueues']()[_0x1499('0x21')](function(_0x444fbb){for(var _0x41efdf=0x0;_0x41efdf<_0x444fbb[_0x1499('0x65')];_0x41efdf++){_0x444fbb[_0x41efdf]['setDataValue']('channel',_0x1499('0x108'));}return _0x444fbb;}));_0x28dbfc[_0x1499('0xe8')](_0x41ab28[_0x1499('0x109')]()[_0x1499('0x21')](function(_0x3e689d){for(var _0x5e2a06=0x0;_0x5e2a06<_0x3e689d['length'];_0x5e2a06++){_0x3e689d[_0x5e2a06][_0x1499('0x105')]('channel',_0x1499('0x10a'));}return _0x3e689d;}));_0x28dbfc[_0x1499('0xe8')](_0x41ab28['getSmsQueues']()[_0x1499('0x21')](function(_0x263196){for(var _0x59980c=0x0;_0x59980c<_0x263196[_0x1499('0x65')];_0x59980c++){_0x263196[_0x59980c][_0x1499('0x105')](_0x1499('0xb1'),_0x1499('0x114'));}return _0x263196;}));_0x28dbfc[_0x1499('0xe8')](_0x41ab28[_0x1499('0x10c')]()[_0x1499('0x21')](function(_0x2cd4e1){for(var _0x24552b=0x0;_0x24552b<_0x2cd4e1[_0x1499('0x65')];_0x24552b++){_0x2cd4e1[_0x24552b][_0x1499('0x105')]('channel','Fax');}return _0x2cd4e1;}));_0x28dbfc[_0x1499('0xe8')](_0x41ab28['getOpenchannelQueues']()['then'](function(_0x45b5c7){for(var _0x196934=0x0;_0x196934<_0x45b5c7[_0x1499('0x65')];_0x196934++){_0x45b5c7[_0x196934][_0x1499('0x105')]('channel','Openchannel');}return _0x45b5c7;}));return BPromise['all'](_0x28dbfc);})[_0x1499('0x21')](function(_0x1904fd){var _0x5c9576=_[_0x1499('0x10f')](_0x1904fd);_0x28dbfc=[];return db['sequelize'][_0x1499('0x110')](function(_0x49e2ce){for(var _0x5eb174=0x0;_0x5eb174<_0x5c9576['length'];_0x5eb174++){_0x28dbfc[_0x1499('0xe8')](_0x5c9576[_0x5eb174][_0x1499('0x115')](_0x3c117f['id']),{'transaction':_0x49e2ce});}return BPromise[_0x1499('0xed')](_0x28dbfc)[_0x1499('0x21')](function(){if(_0x3c117f['online']){return BPromise[_0x1499('0xad')](_[_0x1499('0x3d')](_0x5c9576,function(_0x237743){return _0x237743[_0x1499('0x112')]('channel')===_0x1499('0x106');}),function(_0x3259a6){return db[_0x1499('0xae')][_0x1499('0x36')]({'where':{'VoiceQueueId':_0x3259a6['id'],'UserId':_0x3c117f['id']},'transaction':_0x49e2ce});});}else{return;}})[_0x1499('0x21')](function(){for(var _0x555cff=0x0;_0x555cff<_0x5c9576[_0x1499('0x65')];_0x555cff++){var _0x54d1ca=_0x5c9576[_0x555cff]['getDataValue'](_0x1499('0xb1'));var _0xe74593=_0x54d1ca+_0x1499('0xa7');socket[_0x1499('0xa8')](_0x1499('0x38')+_0x54d1ca+_0x1499('0x116'),{'UserId':_0x3c117f['id'],['queueField']:_0x5c9576[_0x555cff]['id']});}});});});}});}})[_0x1499('0x21')](respondWithStatusCode(_0x4ca79a,null))[_0x1499('0x2b')](handleError(_0x4ca79a,null));};exports[_0x1499('0x117')]=function(_0x1f137c,_0x590810,_0x1d14ad){var _0x8ba157={};var _0x27a9b7={};var _0x1ba29e;var _0x1faaed;return db[_0x1499('0x4a')][_0x1499('0x92')]({'where':{'id':_0x1f137c[_0x1499('0x6a')]['id']}})['then'](handleEntityNotFound(_0x590810,null))[_0x1499('0x21')](function(_0x15e277){if(_0x15e277){_0x1ba29e=_0x15e277;_0x27a9b7[_0x1499('0x4d')]=_[_0x1499('0x50')](db['CmList'][_0x1499('0xc0')]);_0x27a9b7[_0x1499('0x4f')]=_['keys'](_0x1f137c['query']);_0x27a9b7['filters']=_[_0x1499('0x52')](_0x27a9b7[_0x1499('0x4d')],_0x27a9b7[_0x1499('0x4f')]);_0x8ba157[_0x1499('0x53')]=_[_0x1499('0x52')](_0x27a9b7[_0x1499('0x4d')],qs[_0x1499('0x54')](_0x1f137c['query']['fields']));_0x8ba157[_0x1499('0x53')]=_0x8ba157[_0x1499('0x53')]['length']?_0x8ba157[_0x1499('0x53')]:_0x27a9b7['model'];_0x8ba157[_0x1499('0x56')]=qs[_0x1499('0x57')](_0x1f137c[_0x1499('0x4f')][_0x1499('0x57')]);_0x8ba157[_0x1499('0x58')]=qs[_0x1499('0x51')](_['pick'](_0x1f137c[_0x1499('0x4f')],_0x27a9b7[_0x1499('0x51')]));if(_0x1f137c['query'][_0x1499('0x3d')]){_0x8ba157['where']=_['merge'](_0x8ba157[_0x1499('0x58')],{'$or':_[_0x1499('0x3f')](_0x8ba157[_0x1499('0x53')],function(_0x1a6e4c){var _0x57f344={};_0x57f344[_0x1a6e4c]={'$like':'%'+_0x1f137c[_0x1499('0x4f')]['filter']+'%'};return _0x57f344;})});}_0x8ba157=_[_0x1499('0x59')]({},_0x8ba157,_0x1f137c['options']);return _0x1ba29e[_0x1499('0x117')](_0x8ba157);}})[_0x1499('0x21')](function(_0x4875b9){if(_0x4875b9){_0x1faaed=_0x4875b9['length'];if(!_0x1f137c[_0x1499('0x4f')]['hasOwnProperty'](_0x1499('0xc7'))){_0x8ba157[_0x1499('0x30')]=qs[_0x1499('0x30')](_0x1f137c[_0x1499('0x4f')][_0x1499('0x30')]);_0x8ba157[_0x1499('0x2f')]=qs[_0x1499('0x2f')](_0x1f137c['query'][_0x1499('0x2f')]);}return _0x1ba29e[_0x1499('0x117')](_0x8ba157);}})[_0x1499('0x21')](function(_0x287276){if(_0x287276){return _0x287276?{'count':_0x1faaed,'rows':_0x287276}:null;}})[_0x1499('0x21')](respondWithResult(_0x590810,null))[_0x1499('0x2b')](handleError(_0x590810,null));};exports['getAgents']=function(_0x1f2910,_0x13d88e,_0x2eab66){var _0x189b1e={};var _0x325f5a={};var _0x58ac68;var _0x433246;return db[_0x1499('0x4a')]['findOne']({'where':{'id':_0x1f2910[_0x1499('0x6a')]['id']}})[_0x1499('0x21')](handleEntityNotFound(_0x13d88e,null))[_0x1499('0x21')](function(_0x4e6485){if(_0x4e6485){_0x58ac68=_0x4e6485;_0x325f5a[_0x1499('0x4d')]=_[_0x1499('0x50')](db['User'][_0x1499('0xc0')]);_0x325f5a[_0x1499('0x4f')]=_[_0x1499('0x50')](_0x1f2910[_0x1499('0x4f')]);_0x325f5a['filters']=_[_0x1499('0x52')](_0x325f5a['model'],_0x325f5a[_0x1499('0x4f')]);_0x189b1e[_0x1499('0x53')]=_[_0x1499('0x52')](_0x325f5a['model'],qs['fields'](_0x1f2910[_0x1499('0x4f')]['fields']));_0x189b1e[_0x1499('0x53')]=_0x189b1e[_0x1499('0x53')][_0x1499('0x65')]?_0x189b1e[_0x1499('0x53')]:_0x325f5a[_0x1499('0x4d')];_0x189b1e[_0x1499('0x56')]=qs[_0x1499('0x57')](_0x1f2910['query'][_0x1499('0x57')]);_0x189b1e[_0x1499('0x58')]=qs[_0x1499('0x51')](_[_0x1499('0xc1')](_0x1f2910[_0x1499('0x4f')],_0x325f5a['filters']));if(_0x1f2910[_0x1499('0x4f')][_0x1499('0x3d')]){_0x189b1e[_0x1499('0x58')]=_[_0x1499('0x59')](_0x189b1e[_0x1499('0x58')],{'$or':_['map'](_0x189b1e['attributes'],function(_0x3defeb){var _0x147fbc={};_0x147fbc[_0x3defeb]={'$like':'%'+_0x1f2910[_0x1499('0x4f')][_0x1499('0x3d')]+'%'};return _0x147fbc;})});}_0x189b1e[_0x1499('0x4d')]=db['User'];_0x189b1e['as']=_0x1499('0x39');_0x189b1e=_[_0x1499('0x59')]({},_0x189b1e,_0x1f2910['options']);return _0x58ac68[_0x1499('0xe7')]({'include':[_0x189b1e]});}})[_0x1499('0x21')](function(_0x1da993){if(_0x1da993){var _0x55c974={},_0x3c3b23=[],_0x5aa6cd=0x0;for(var _0x6bb92e=0x0;_0x6bb92e<_0x1da993[_0x1499('0x65')];_0x6bb92e+=0x1){for(var _0x2ba478=0x0,_0x197cdf;_0x2ba478<_0x1da993[_0x6bb92e][_0x1499('0x39')][_0x1499('0x65')];_0x2ba478+=0x1){_0x197cdf=_0x1da993[_0x6bb92e]['Agents'][_0x2ba478]['get']({'plain':!![]});_0x55c974[_0x197cdf['id']]=_0x197cdf;}}_0x55c974=_['values'](_0x55c974);for(var _0x30e097=qs['offset'](_0x1f2910[_0x1499('0x4f')]['offset']);_0x30e097<_0x55c974[_0x1499('0x65')]&&_0x3c3b23[_0x1499('0x65')]=_0x3b9d85[_0x9d0c('0x4d')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x498230){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x498230[_0x9d0c('0x26')]},'individualHooks':!![]});}})[_0x9d0c('0xd')](function(){if(_0x498230){return _0x498230[_0x9d0c('0x4e')]({'raw':!![]});}})[_0x9d0c('0xd')](function(_0x799eb7){if(_0x498230){if(_0x799eb7){var _0x715dc=[];_0x4320ee=_0x799eb7;if(_0x4320ee[_0x9d0c('0x2e')]){for(var _0x5606e2=0x0;_0x5606e2<_0x4320ee[_0x9d0c('0x2e')];_0x5606e2++){_0x715dc[_0x9d0c('0x45')](db[_0x9d0c('0x2a')][_0x9d0c('0x4f')]({'membername':_0x498230[_0x9d0c('0x26')],'UserId':_0x498230['id'],'queue_name':_0x4320ee[_0x5606e2]['name'],'VoiceQueueId':_0x4320ee[_0x5606e2]['id'],'interface':_0x5decd8,'paused':_0x498230[_0x9d0c('0x48')]||![],'penalty':_0x4320ee[_0x5606e2][_0x9d0c('0x50')]||0x0}));}return BPromise[_0x9d0c('0x43')](_0x715dc);}}}})['then'](function(){if(_0x498230){return db[_0x9d0c('0x2c')][_0x9d0c('0x19')]({'where':{'membername':_0x498230['name'],'exitAt':null}});}})[_0x9d0c('0xd')](function(_0x3ca9ca){if(_0x498230){if(_0x3ca9ca&&_0x3ca9ca[_0x9d0c('0x2e')]){var _0x4b0849=[];_0x3ca9ca['forEach'](function(_0x13a554){_0x4b0849[_0x9d0c('0x45')](_0x13a554['update']({'exitAt':moment()[_0x9d0c('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x9d0c('0x43')](_0x4b0849);}}})['then'](function(_0x1a3d1f){if(_0x498230){var _0x5c8451=[];var _0x19bbec=[];var _0x30f950=utils[_0x9d0c('0x32')]();var _0x229cf5={'membername':_0x498230[_0x9d0c('0x26')],'interface':_0x5decd8,'enterAt':moment()[_0x9d0c('0x2f')](_0x9d0c('0x30')),'role':_0x498230[_0x9d0c('0x27')],'internal':_0x498230[_0x9d0c('0x28')]};_0x30f950[_0x9d0c('0x33')](function(_0x1532f8){_0x5c8451['push'](_[_0x9d0c('0x51')]({'channel':_0x1532f8,'type':_0x9d0c('0x52'),'data1':_0x9d0c('0x53'),'data2':_0x5decd8},_0x229cf5));if(_0x498230[_0x9d0c('0x48')]){_0x19bbec[_0x9d0c('0x45')](_['merge']({'channel':_0x1532f8,'type':_0x9d0c('0x2d'),'data1':'LOGININPAUSE'},_0x229cf5));}});return db[_0x9d0c('0x2c')][_0x9d0c('0x54')](_0x5c8451['concat'](_0x19bbec),{'individualHooks':!![]});}})[_0x9d0c('0xd')](function(){if(_0x498230){return _0x498230[_0x9d0c('0x2b')]({'online':!![],'lastLoginAt':moment()['format'](_0x9d0c('0x30')),'voicePause':_0x498230['loginInPause']||![],'mailPause':_0x498230[_0x9d0c('0x48')]||![],'chatPause':_0x498230[_0x9d0c('0x48')]||![],'faxPause':_0x498230[_0x9d0c('0x48')]||![],'smsPause':_0x498230[_0x9d0c('0x48')]||![],'openchannelPause':_0x498230[_0x9d0c('0x48')]||![],'pauseType':_0x498230[_0x9d0c('0x48')]?_0x9d0c('0x55'):null,'lastPauseAt':moment()['format'](_0x9d0c('0x30')),'interface':_0x5decd8});}})[_0x9d0c('0xd')](function(_0x34a5fd){_0x459f78(_0x34a5fd);})[_0x9d0c('0x16')](function(_0x310ab1){_0x49c9ee(_0x279e43['error'](0x1f4,_0x310ab1['message']));});});}; \ No newline at end of file +var _0x2aee=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','User,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetUser','findAll','options','raw','include','map','model','attributes','debug','User','find','where','ShowUser','role','internal','interface','update','MemberReport','name','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','isNil','format','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','channel','isValidChannel','voice','UserVoiceQueueRt','system','mail','fax','sms','openchannel','set','%s%s','all','LogoutUser','push','LoginUser','findOne','phone','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x33ce3d,_0x1e1f13){var _0x35c454=function(_0x370d3){while(--_0x370d3){_0x33ce3d['push'](_0x33ce3d['shift']());}};_0x35c454(++_0x1e1f13);}(_0x2aee,0x164));var _0xe2ae=function(_0x51d129,_0x175d7d){_0x51d129=_0x51d129-0x0;var _0x44c377=_0x2aee[_0x51d129];return _0x44c377;};'use strict';var _=require(_0xe2ae('0x0'));var util=require(_0xe2ae('0x1'));var moment=require(_0xe2ae('0x2'));var BPromise=require(_0xe2ae('0x3'));var rs=require(_0xe2ae('0x4'));var fs=require('fs');var Redis=require(_0xe2ae('0x5'));var db=require(_0xe2ae('0x6'))['db'];var utils=require(_0xe2ae('0x7'));var logger=require(_0xe2ae('0x8'))('rpc');var config=require(_0xe2ae('0x9'));var jayson=require(_0xe2ae('0xa'));var client=jayson[_0xe2ae('0xb')][_0xe2ae('0xc')]({'port':0x232a});config[_0xe2ae('0xd')]=_[_0xe2ae('0xe')](config[_0xe2ae('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xe2ae('0xf'))(new Redis(config['redis']));require('./user.socket')[_0xe2ae('0x10')](socket);function respondWithRpcPromise(_0x416b7c,_0x12a135,_0x2f7c59){return new BPromise(function(_0x8e91d2,_0x390aa4){return client[_0xe2ae('0x11')](_0x416b7c,_0x2f7c59)[_0xe2ae('0x12')](function(_0xb7eaac){logger['info'](_0xe2ae('0x13'),_0x12a135,_0xe2ae('0x14'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x12a135,_0xe2ae('0x14'),JSON[_0xe2ae('0x15')](_0xb7eaac));if(_0xb7eaac['error']){if(_0xb7eaac[_0xe2ae('0x16')][_0xe2ae('0x17')]===0x1f4){logger[_0xe2ae('0x16')](_0xe2ae('0x13'),_0x12a135,_0xb7eaac[_0xe2ae('0x16')][_0xe2ae('0x18')]);return _0x390aa4(_0xb7eaac[_0xe2ae('0x16')][_0xe2ae('0x18')]);}logger['error']('User,\x20%s,\x20%s',_0x12a135,_0xb7eaac[_0xe2ae('0x16')][_0xe2ae('0x18')]);return _0x8e91d2(_0xb7eaac[_0xe2ae('0x16')][_0xe2ae('0x18')]);}else{logger[_0xe2ae('0x19')](_0xe2ae('0x13'),_0x12a135,'request\x20sent');_0x8e91d2(_0xb7eaac[_0xe2ae('0x1a')][_0xe2ae('0x18')]);}})[_0xe2ae('0x1b')](function(_0xe700bd){logger[_0xe2ae('0x16')](_0xe2ae('0x13'),_0x12a135,_0xe700bd);_0x390aa4(_0xe700bd);});});}exports[_0xe2ae('0x1c')]=function(_0x1e127d){var _0x1ea906=this;return new Promise(function(_0x4619be,_0x56d65a){return db['User'][_0xe2ae('0x1d')]({'raw':_0x1e127d[_0xe2ae('0x1e')]?_0x1e127d[_0xe2ae('0x1e')][_0xe2ae('0x1f')]===undefined?!![]:![]:!![],'where':_0x1e127d[_0xe2ae('0x1e')]?_0x1e127d['options']['where']||null:null,'attributes':_0x1e127d['options']?_0x1e127d[_0xe2ae('0x1e')]['attributes']||null:null,'limit':_0x1e127d[_0xe2ae('0x1e')]?_0x1e127d['options']['limit']||null:null,'include':_0x1e127d[_0xe2ae('0x1e')]?_0x1e127d[_0xe2ae('0x1e')][_0xe2ae('0x20')]?_[_0xe2ae('0x21')](_0x1e127d[_0xe2ae('0x1e')][_0xe2ae('0x20')],function(_0x4a63e6){return{'model':db[_0x4a63e6[_0xe2ae('0x22')]],'as':_0x4a63e6['as'],'attributes':_0x4a63e6[_0xe2ae('0x23')],'include':_0x4a63e6[_0xe2ae('0x20')]?_['map'](_0x4a63e6['include'],function(_0x8ecfd7){return{'model':db[_0x8ecfd7[_0xe2ae('0x22')]],'as':_0x8ecfd7['as'],'attributes':_0x8ecfd7[_0xe2ae('0x23')],'include':_0x8ecfd7[_0xe2ae('0x20')]?_[_0xe2ae('0x21')](_0x8ecfd7[_0xe2ae('0x20')],function(_0x525343){return{'model':db[_0x525343[_0xe2ae('0x22')]],'as':_0x525343['as'],'attributes':_0x525343[_0xe2ae('0x23')]};}):[]};}):[]};}):[]:[]})[_0xe2ae('0x12')](function(_0x536c51){logger[_0xe2ae('0x19')]('GetUser',_0x1e127d);logger[_0xe2ae('0x24')](_0xe2ae('0x1c'),_0x1e127d,JSON['stringify'](_0x536c51));_0x4619be(_0x536c51);})[_0xe2ae('0x1b')](function(_0x14504a){logger[_0xe2ae('0x16')](_0xe2ae('0x1c'),_0x14504a['message'],_0x1e127d);_0x56d65a(_0x1ea906[_0xe2ae('0x16')](0x1f4,_0x14504a['message']));});});};exports['ShowUser']=function(_0x13e46f){var _0x3cfbaa=this;return new Promise(function(_0x28315a,_0x13ca5e){return db[_0xe2ae('0x25')][_0xe2ae('0x26')]({'raw':_0x13e46f[_0xe2ae('0x1e')]?_0x13e46f['options'][_0xe2ae('0x1f')]===undefined?!![]:![]:!![],'where':_0x13e46f['options']?_0x13e46f['options'][_0xe2ae('0x27')]||null:null,'attributes':_0x13e46f[_0xe2ae('0x1e')]?_0x13e46f['options'][_0xe2ae('0x23')]||null:null,'include':_0x13e46f['options']?_0x13e46f['options'][_0xe2ae('0x20')]?_[_0xe2ae('0x21')](_0x13e46f[_0xe2ae('0x1e')][_0xe2ae('0x20')],function(_0x4a72a1){return{'model':db[_0x4a72a1[_0xe2ae('0x22')]],'as':_0x4a72a1['as'],'attributes':_0x4a72a1[_0xe2ae('0x23')],'include':_0x4a72a1[_0xe2ae('0x20')]?_[_0xe2ae('0x21')](_0x4a72a1['include'],function(_0x1bb2a2){return{'model':db[_0x1bb2a2[_0xe2ae('0x22')]],'as':_0x1bb2a2['as'],'attributes':_0x1bb2a2['attributes'],'include':_0x1bb2a2['include']?_[_0xe2ae('0x21')](_0x1bb2a2[_0xe2ae('0x20')],function(_0x565d9a){return{'model':db[_0x565d9a['model']],'as':_0x565d9a['as'],'attributes':_0x565d9a['attributes']};}):[]};}):[]};}):[]:[]})[_0xe2ae('0x12')](function(_0x4a4ff4){logger['info'](_0xe2ae('0x28'),_0x13e46f);logger[_0xe2ae('0x24')](_0xe2ae('0x28'),_0x13e46f,JSON[_0xe2ae('0x15')](_0x4a4ff4));_0x28315a(_0x4a4ff4);})[_0xe2ae('0x1b')](function(_0x311ba8){logger['error'](_0xe2ae('0x28'),_0x311ba8[_0xe2ae('0x18')],_0x13e46f);_0x13ca5e(_0x3cfbaa[_0xe2ae('0x16')](0x1f4,_0x311ba8[_0xe2ae('0x18')]));});});};exports['PauseUser']=function(_0x3b4bd5){var _0x2c3ab4=this;return new Promise(function(_0x364052,_0x383a4c){var _0x4b9e11;return db[_0xe2ae('0x25')]['find']({'where':_0x3b4bd5['options']['where']||{},'attributes':['id','name',_0xe2ae('0x29'),_0xe2ae('0x2a'),_0xe2ae('0x2b')]})['then'](function(_0x1be616){if(_0x1be616){_0x4b9e11=_0x1be616;return db['UserVoiceQueueRt'][_0xe2ae('0x2c')]({'paused':0x1},{'where':{'UserId':_0x4b9e11['id']},'individualHooks':!![]});}})['then'](function(){if(_0x4b9e11){return db[_0xe2ae('0x2d')]['findAll']({'where':{'membername':_0x4b9e11[_0xe2ae('0x2e')],'type':_0xe2ae('0x2f'),'exitAt':null}});}})[_0xe2ae('0x12')](function(_0x5cf162){if(_0x4b9e11){if(_0x5cf162&&_0x5cf162[_0xe2ae('0x30')]){var _0x1a3f52=moment()['format'](_0xe2ae('0x31'));for(var _0x4fdeb2=0x0,_0x130a26=_0x5cf162['length'];_0x4fdeb2<_0x130a26;_0x4fdeb2++){_0x5cf162[_0x4fdeb2][_0xe2ae('0x32')]({'exitAt':_0x1a3f52});}}}})[_0xe2ae('0x12')](function(){if(_0x4b9e11){var _0x4a7ad1=[];var _0x3b0dfd=utils['getChannels']();_0x3b0dfd[_0xe2ae('0x33')](function(_0x371cb7){_0x4a7ad1['push']({'channel':_0x371cb7,'membername':_0x4b9e11[_0xe2ae('0x2e')],'interface':_[_0xe2ae('0x34')](_0x4b9e11[_0xe2ae('0x2b')])?util[_0xe2ae('0x35')](_0xe2ae('0x36'),_0x4b9e11[_0xe2ae('0x2e')]):_0x4b9e11[_0xe2ae('0x2b')],'type':_0xe2ae('0x2f'),'enterAt':moment()[_0xe2ae('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x3b4bd5[_0xe2ae('0x37')][_0xe2ae('0x38')]||_0xe2ae('0x39'),'role':_0x4b9e11['role'],'internal':_0x4b9e11[_0xe2ae('0x2a')],'uniqueid':_0x3b4bd5['body'][_0xe2ae('0x3a')]||null});});return db[_0xe2ae('0x2d')][_0xe2ae('0x3b')](_0x4a7ad1,{'individualHooks':!![]});}})[_0xe2ae('0x12')](function(){if(_0x4b9e11){return _0x4b9e11[_0xe2ae('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x3b4bd5[_0xe2ae('0x37')][_0xe2ae('0x38')]||_0xe2ae('0x39'),'lastPauseAt':moment()['format'](_0xe2ae('0x31'))});}})[_0xe2ae('0x12')](function(_0x27a0dd){_0x364052(_0x27a0dd);})[_0xe2ae('0x1b')](function(_0x136cb9){_0x383a4c(_0x2c3ab4['error'](0x1f4,_0x136cb9['message']));});});};exports[_0xe2ae('0x3c')]=function(_0x27f565){var _0x5cccfc=this;return new Promise(function(_0xd4c96e,_0x2ea266){var _0x5e190a;return db['User']['findOne']({'where':_0x27f565['options'][_0xe2ae('0x27')]||{},'attributes':['id','name']})[_0xe2ae('0x12')](function(_0x595862){if(_0x595862){_0x5e190a=_0x595862;if(_0x27f565[_0xe2ae('0x37')][_0xe2ae('0x3d')]&&!utils[_0xe2ae('0x3e')](_0x27f565[_0xe2ae('0x37')][_0xe2ae('0x3d')])){throw new Error('Unknown\x20channel');}switch(_0x27f565[_0xe2ae('0x37')][_0xe2ae('0x3d')]){case _0xe2ae('0x3f'):return db[_0xe2ae('0x40')][_0xe2ae('0x2c')]({'paused':0x0},{'where':{'UserId':_0x5e190a['id']}})[_0xe2ae('0x12')](function(){return db['MemberReport'][_0xe2ae('0x26')]({'where':{'channel':_0x27f565['body'][_0xe2ae('0x3d')],'membername':_0x5e190a[_0xe2ae('0x2e')],'type':_0xe2ae('0x2f'),'exitAt':null}});})[_0xe2ae('0x12')](function(_0x1e2730){if(_0x1e2730){return _0x1e2730[_0xe2ae('0x2c')]({'exitAt':moment()['format'](_0xe2ae('0x31')),'data2':_0xe2ae('0x41')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x5e190a['update']({'voicePause':![]});});case _0xe2ae('0x42'):case'chat':case _0xe2ae('0x43'):case _0xe2ae('0x44'):case _0xe2ae('0x45'):return db[_0xe2ae('0x2d')][_0xe2ae('0x26')]({'where':{'channel':_0x27f565[_0xe2ae('0x37')][_0xe2ae('0x3d')],'membername':_0x5e190a[_0xe2ae('0x2e')],'type':_0xe2ae('0x2f'),'exitAt':null}})[_0xe2ae('0x12')](function(_0x17a1dc){return _0x17a1dc[_0xe2ae('0x2c')]({'exitAt':moment()[_0xe2ae('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xe2ae('0x41')},{'individualHooks':!![]});})[_0xe2ae('0x12')](function(){var _0xb0bf4b={};_[_0xe2ae('0x46')](_0xb0bf4b,util[_0xe2ae('0x35')](_0xe2ae('0x47'),_0x27f565[_0xe2ae('0x37')][_0xe2ae('0x3d')],'Pause'),![]);return _0x5e190a[_0xe2ae('0x2c')](_0xb0bf4b);});default:return db[_0xe2ae('0x40')]['update']({'paused':0x0},{'where':{'UserId':_0x5e190a['id']}})[_0xe2ae('0x12')](function(){return db[_0xe2ae('0x2d')][_0xe2ae('0x1d')]({'where':{'membername':_0x5e190a['name'],'type':'PAUSE','exitAt':null}});})['then'](function(_0x3b1fa8){var _0x226c45=[];_0x3b1fa8[_0xe2ae('0x33')](function(_0x2ba72e){_0x226c45['push'](_0x2ba72e['update']({'exitAt':moment()[_0xe2ae('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xe2ae('0x41')}));});return BPromise[_0xe2ae('0x48')](_0x226c45);})[_0xe2ae('0x12')](function(){return _0x5e190a['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xe2ae('0x12')](function(_0x5cfb6b){_0xd4c96e(_0x5cfb6b);})[_0xe2ae('0x1b')](function(_0x41dbff){_0x2ea266(_0x5cccfc['error'](0x1f4,_0x41dbff[_0xe2ae('0x18')]));});});};exports[_0xe2ae('0x49')]=function(_0x4f9fd1){var _0x5530c9=this;return new Promise(function(_0x49ba39,_0x1c3ef2){var _0x370753;return db['User']['findOne']({'where':_0x4f9fd1['options'][_0xe2ae('0x27')]||{},'attributes':['id',_0xe2ae('0x2e')]})[_0xe2ae('0x12')](function(_0x51f4f8){if(_0x51f4f8){_0x370753=_0x51f4f8;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x370753['name']},'individualHooks':!![]});}})['then'](function(){if(_0x370753){return db['MemberReport'][_0xe2ae('0x1d')]({'where':{'membername':_0x370753[_0xe2ae('0x2e')],'exitAt':null}});}})[_0xe2ae('0x12')](function(_0x93dc18){if(_0x370753){if(_0x93dc18&&_0x93dc18[_0xe2ae('0x30')]){var _0x162bba=[];_0x93dc18[_0xe2ae('0x33')](function(_0x162d22){_0x162bba[_0xe2ae('0x4a')](_0x162d22[_0xe2ae('0x2c')]({'exitAt':moment()[_0xe2ae('0x35')](_0xe2ae('0x31'))}));});return BPromise[_0xe2ae('0x48')](_0x162bba);}}})[_0xe2ae('0x12')](function(){if(_0x370753){return _0x370753['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xe2ae('0x12')](function(_0x5defd3){_0x49ba39(_0x5defd3);})[_0xe2ae('0x1b')](function(_0x14b05e){_0x1c3ef2(_0x5530c9[_0xe2ae('0x16')](0x1f4,_0x14b05e[_0xe2ae('0x18')]));});});};exports[_0xe2ae('0x4b')]=function(_0x13bed3){var _0x205fcf=this;return new Promise(function(_0x453938,_0x48da92){var _0xd09ac4;var _0x2fee34;var _0x2ae8b9;var _0x1303c1;return db['User'][_0xe2ae('0x4c')]({'where':_0x13bed3['options']['where']||{},'attributes':['id',_0xe2ae('0x2e'),'role','mobile',_0xe2ae('0x4d'),_0xe2ae('0x2a'),_0xe2ae('0x4e'),_0xe2ae('0x2b')]})[_0xe2ae('0x12')](function(_0x13f437){if(_0x13f437){_0xd09ac4=_0x13f437;_0x1303c1=_0x13bed3[_0xe2ae('0x37')][_0xe2ae('0x2b')]?_0x13bed3[_0xe2ae('0x37')][_0xe2ae('0x2b')]:util[_0xe2ae('0x35')]('SIP/%s',_0xd09ac4[_0xe2ae('0x2e')]);return db[_0xe2ae('0x25')][_0xe2ae('0x4f')]({'where':{'role':_0xe2ae('0x50'),'online':!![],'id':{'$ne':_0xd09ac4['id']}}});}})[_0xe2ae('0x12')](function(_0x125e5b){if(_0x125e5b){_0x2ae8b9=_0x125e5b;return require(_0xe2ae('0x51'))['getLicense']();}})[_0xe2ae('0x12')](function(_0x4fd609){if(_0x4fd609&&_0x4fd609[_0xe2ae('0x52')]&&_0x2ae8b9>=_0x4fd609[_0xe2ae('0x52')]){throw new Error(_0xe2ae('0x53'));}})['then'](function(){if(_0xd09ac4){return db[_0xe2ae('0x40')][_0xe2ae('0x54')]({'where':{'membername':_0xd09ac4['name']},'individualHooks':!![]});}})['then'](function(){if(_0xd09ac4){return _0xd09ac4[_0xe2ae('0x55')]({'raw':!![]});}})[_0xe2ae('0x12')](function(_0x28b988){if(_0xd09ac4){if(_0x28b988){var _0x3e057a=[];_0x2fee34=_0x28b988;if(_0x2fee34[_0xe2ae('0x30')]){for(var _0x4f9342=0x0;_0x4f9342<_0x2fee34[_0xe2ae('0x30')];_0x4f9342++){_0x3e057a['push'](db[_0xe2ae('0x40')]['upsert']({'membername':_0xd09ac4[_0xe2ae('0x2e')],'UserId':_0xd09ac4['id'],'queue_name':_0x2fee34[_0x4f9342][_0xe2ae('0x2e')],'VoiceQueueId':_0x2fee34[_0x4f9342]['id'],'interface':_0x1303c1,'paused':_0xd09ac4[_0xe2ae('0x4e')]||![],'penalty':_0x2fee34[_0x4f9342]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x3e057a);}}}})[_0xe2ae('0x12')](function(){if(_0xd09ac4){return db[_0xe2ae('0x2d')]['findAll']({'where':{'membername':_0xd09ac4[_0xe2ae('0x2e')],'exitAt':null}});}})[_0xe2ae('0x12')](function(_0x1c580e){if(_0xd09ac4){if(_0x1c580e&&_0x1c580e[_0xe2ae('0x30')]){var _0x35bef1=[];_0x1c580e['forEach'](function(_0x1e8eb7){_0x35bef1[_0xe2ae('0x4a')](_0x1e8eb7[_0xe2ae('0x2c')]({'exitAt':moment()[_0xe2ae('0x35')](_0xe2ae('0x31'))}));});return BPromise['all'](_0x35bef1);}}})[_0xe2ae('0x12')](function(_0x19898f){if(_0xd09ac4){var _0xd4a04e=[];var _0x2af41f=[];var _0x3fcebb=utils['getChannels']();var _0x297981={'membername':_0xd09ac4[_0xe2ae('0x2e')],'interface':_0x1303c1,'enterAt':moment()[_0xe2ae('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xd09ac4[_0xe2ae('0x29')],'internal':_0xd09ac4[_0xe2ae('0x2a')]};_0x3fcebb[_0xe2ae('0x33')](function(_0x8aad49){_0xd4a04e[_0xe2ae('0x4a')](_[_0xe2ae('0x56')]({'channel':_0x8aad49,'type':_0xe2ae('0x57'),'data1':_0xe2ae('0x58'),'data2':_0x1303c1},_0x297981));if(_0xd09ac4['loginInPause']){_0x2af41f[_0xe2ae('0x4a')](_['merge']({'channel':_0x8aad49,'type':_0xe2ae('0x2f'),'data1':_0xe2ae('0x59')},_0x297981));}});return db[_0xe2ae('0x2d')][_0xe2ae('0x3b')](_0xd4a04e[_0xe2ae('0x5a')](_0x2af41f),{'individualHooks':!![]});}})[_0xe2ae('0x12')](function(){if(_0xd09ac4){return _0xd09ac4[_0xe2ae('0x2c')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0xd09ac4['loginInPause']||![],'mailPause':_0xd09ac4[_0xe2ae('0x4e')]||![],'chatPause':_0xd09ac4[_0xe2ae('0x4e')]||![],'faxPause':_0xd09ac4['loginInPause']||![],'smsPause':_0xd09ac4['loginInPause']||![],'openchannelPause':_0xd09ac4[_0xe2ae('0x4e')]||![],'pauseType':_0xd09ac4[_0xe2ae('0x4e')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xe2ae('0x35')](_0xe2ae('0x31')),'interface':_0x1303c1});}})[_0xe2ae('0x12')](function(_0x18b8f6){_0x453938(_0x18b8f6);})['catch'](function(_0x134ec4){_0x48da92(_0x205fcf[_0xe2ae('0x16')](0x1f4,_0x134ec4[_0xe2ae('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 10363be..f41d395 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 _0x360d=['./user.events','remove','emit','length'];(function(_0x4de846,_0x3fb58d){var _0x40b215=function(_0x4fa15b){while(--_0x4fa15b){_0x4de846['push'](_0x4de846['shift']());}};_0x40b215(++_0x3fb58d);}(_0x360d,0x6c));var _0xd360=function(_0x262ee7,_0x52ee92){_0x262ee7=_0x262ee7-0x0;var _0x1dc842=_0x360d[_0x262ee7];return _0x1dc842;};'use strict';var UserEvents=require(_0xd360('0x0'));var events=['save',_0xd360('0x1'),'update'];function createListener(_0x287a1d,_0x11b28e){return function(_0x1c695f){_0x11b28e[_0xd360('0x2')](_0x287a1d,_0x1c695f);};}function removeListener(_0x14bdc4,_0x9e32ab){return function(){UserEvents['removeListener'](_0x14bdc4,_0x9e32ab);};}exports['register']=function(_0x4b585b){for(var _0x4f6f25=0x0,_0x3700bf=events[_0xd360('0x3')];_0x4f6f25<_0x3700bf;_0x4f6f25++){var _0x14fc14=events[_0x4f6f25];var _0x22ad82=createListener('user:'+_0x14fc14,_0x4b585b);UserEvents['on'](_0x14fc14,_0x22ad82);}}; \ No newline at end of file +var _0xbdc1=['register','length','./user.events','save','remove','update','removeListener'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xbdc1,0x14b));var _0x1bdc=function(_0x365a9d,_0x3a1abf){_0x365a9d=_0x365a9d-0x0;var _0x55b87c=_0xbdc1[_0x365a9d];return _0x55b87c;};'use strict';var UserEvents=require(_0x1bdc('0x0'));var events=[_0x1bdc('0x1'),_0x1bdc('0x2'),_0x1bdc('0x3')];function createListener(_0x19f0e6,_0x23381c){return function(_0x2c7074){_0x23381c['emit'](_0x19f0e6,_0x2c7074);};}function removeListener(_0x3eb544,_0x1e802d){return function(){UserEvents[_0x1bdc('0x4')](_0x3eb544,_0x1e802d);};}exports[_0x1bdc('0x5')]=function(_0x2aaff8){for(var _0x93f69f=0x0,_0x2effde=events[_0x1bdc('0x6')];_0x93f69f<_0x2effde;_0x93f69f++){var _0x2ea1be=events[_0x93f69f];var _0x3c8637=createListener('user:'+_0x2ea1be,_0x2aaff8);UserEvents['on'](_0x2ea1be,_0x3c8637);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 372df01..8c0b81f 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 _0xac29=['../../config/environment','exports','util','../../components/auth/service'];(function(_0x2ccb06,_0x1ac909){var _0x152258=function(_0x3e846a){while(--_0x3e846a){_0x2ccb06['push'](_0x2ccb06['shift']());}};_0x152258(++_0x1ac909);}(_0xac29,0x18a));var _0x9ac2=function(_0x46fbda,_0xb9a8d2){_0x46fbda=_0x46fbda-0x0;var _0x5d9aac=_0xac29[_0x46fbda];return _0x5d9aac;};'use strict';var multer=require('multer');var util=require(_0x9ac2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x9ac2('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x9ac2('0x2'));module[_0x9ac2('0x3')]=router; \ No newline at end of file +var _0x4993=['express','../../components/auth/service','../../config/environment','exports','multer','connect-timeout'];(function(_0x5a636f,_0x3fec2b){var _0x6a8cfb=function(_0x20e6ca){while(--_0x20e6ca){_0x5a636f['push'](_0x5a636f['shift']());}};_0x6a8cfb(++_0x3fec2b);}(_0x4993,0xf4));var _0x3499=function(_0x26fa08,_0x2bfb58){_0x26fa08=_0x26fa08-0x0;var _0x40c774=_0x4993[_0x26fa08];return _0x40c774;};'use strict';var multer=require(_0x3499('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3499('0x1'));var express=require(_0x3499('0x2'));var router=express['Router']();var auth=require(_0x3499('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3499('0x4'));module[_0x3499('0x5')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index f9aa7ea..c15841e 100644 --- a/server/api/userChatQueue/userChatQueue.attributes.js +++ b/server/api/userChatQueue/userChatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['INTEGER','sequelize','exports'];(function(_0x2482c8,_0x4b0824){var _0x2678c0=function(_0x240088){while(--_0x240088){_0x2482c8['push'](_0x2482c8['shift']());}};_0x2678c0(++_0x4b0824);}(_0xe706,0xa3));var _0x6e70=function(_0x24b852,_0x2bad67){_0x24b852=_0x24b852-0x0;var _0x180ad2=_0xe706[_0x24b852];return _0x180ad2;};'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(_0x26dc96,_0x10c6f5){var _0x30b7be=function(_0x47de22){while(--_0x47de22){_0x26dc96['push'](_0x26dc96['shift']());}};_0x30b7be(++_0x10c6f5);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'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 557772c..c611ce0 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 _0x74a7=['rimraf','./userChatQueue.attributes','exports','define','UserChatQueue','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5ca5bc,_0x5b8a9d){var _0x26ca86=function(_0x1ad9a6){while(--_0x1ad9a6){_0x5ca5bc['push'](_0x5ca5bc['shift']());}};_0x26ca86(++_0x5b8a9d);}(_0x74a7,0x91));var _0x774a=function(_0x4f27f4,_0x197f2c){_0x4f27f4=_0x4f27f4-0x0;var _0x5dd4cb=_0x74a7[_0x4f27f4];return _0x5dd4cb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x774a('0x0'))(_0x774a('0x1'));var moment=require('moment');var BPromise=require(_0x774a('0x2'));var rp=require(_0x774a('0x3'));var fs=require('fs');var path=require(_0x774a('0x4'));var rimraf=require(_0x774a('0x5'));var config=require('../../config/environment');var attributes=require(_0x774a('0x6'));module[_0x774a('0x7')]=function(_0x1bf418,_0x2d4867){return _0x1bf418[_0x774a('0x8')](_0x774a('0x9'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb28=['define','UserChatQueue','user_has_chat_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./userChatQueue.attributes'];(function(_0x527aff,_0x40e316){var _0x2a33aa=function(_0x29d304){while(--_0x29d304){_0x527aff['push'](_0x527aff['shift']());}};_0x2a33aa(++_0x40e316);}(_0xdb28,0x19b));var _0x8db2=function(_0x1fbd0d,_0x5ab2c6){_0x1fbd0d=_0x1fbd0d-0x0;var _0x20d3ea=_0xdb28[_0x1fbd0d];return _0x20d3ea;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require('../../config/logger')(_0x8db2('0x2'));var moment=require(_0x8db2('0x3'));var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require('../../config/environment');var attributes=require(_0x8db2('0x8'));module['exports']=function(_0x5b2724,_0x29b55a){return _0x5b2724[_0x8db2('0x9')](_0x8db2('0xa'),attributes,{'tableName':_0x8db2('0xb'),'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 c5af482..db44886 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 _0x95e4=['stringify','error','code','message','UserChatQueue,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3f41a7,_0x3565a5){var _0x252da9=function(_0x29b344){while(--_0x29b344){_0x3f41a7['push'](_0x3f41a7['shift']());}};_0x252da9(++_0x3565a5);}(_0x95e4,0x10b));var _0x495e=function(_0xa8e59b,_0x2aee66){_0xa8e59b=_0xa8e59b-0x0;var _0x5740bc=_0x95e4[_0xa8e59b];return _0x5740bc;};'use strict';var _=require('lodash');var util=require(_0x495e('0x0'));var moment=require(_0x495e('0x1'));var BPromise=require(_0x495e('0x2'));var rs=require(_0x495e('0x3'));var fs=require('fs');var Redis=require(_0x495e('0x4'));var db=require(_0x495e('0x5'))['db'];var utils=require(_0x495e('0x6'));var logger=require(_0x495e('0x7'))(_0x495e('0x8'));var config=require(_0x495e('0x9'));var jayson=require(_0x495e('0xa'));var client=jayson[_0x495e('0xb')][_0x495e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d5bea,_0x4152ee,_0x3b6259){return new BPromise(function(_0x13e782,_0x4f3121){return client[_0x495e('0xd')](_0x1d5bea,_0x3b6259)[_0x495e('0xe')](function(_0x37f3e0){logger[_0x495e('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x4152ee,'request\x20sent');logger[_0x495e('0x10')](_0x495e('0x11'),_0x4152ee,_0x495e('0x12'),JSON[_0x495e('0x13')](_0x37f3e0));if(_0x37f3e0[_0x495e('0x14')]){if(_0x37f3e0[_0x495e('0x14')][_0x495e('0x15')]===0x1f4){logger[_0x495e('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x4152ee,_0x37f3e0[_0x495e('0x14')][_0x495e('0x16')]);return _0x4f3121(_0x37f3e0[_0x495e('0x14')][_0x495e('0x16')]);}logger[_0x495e('0x14')](_0x495e('0x17'),_0x4152ee,_0x37f3e0[_0x495e('0x14')][_0x495e('0x16')]);return _0x13e782(_0x37f3e0[_0x495e('0x14')][_0x495e('0x16')]);}else{logger['info'](_0x495e('0x17'),_0x4152ee,'request\x20sent');_0x13e782(_0x37f3e0[_0x495e('0x18')]['message']);}})[_0x495e('0x19')](function(_0xb2a6a6){logger[_0x495e('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x4152ee,_0xb2a6a6);_0x4f3121(_0xb2a6a6);});});} \ No newline at end of file +var _0x835e=['../../config/environment','jayson/promise','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x259fdf,_0x4f0314){var _0x181ba1=function(_0x484872){while(--_0x484872){_0x259fdf['push'](_0x259fdf['shift']());}};_0x181ba1(++_0x4f0314);}(_0x835e,0x1b2));var _0xe835=function(_0x899ff6,_0x39b79c){_0x899ff6=_0x899ff6-0x0;var _0x219cbc=_0x835e[_0x899ff6];return _0x219cbc;};'use strict';var _=require(_0xe835('0x0'));var util=require(_0xe835('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe835('0x2'));var fs=require('fs');var Redis=require(_0xe835('0x3'));var db=require(_0xe835('0x4'))['db'];var utils=require(_0xe835('0x5'));var logger=require('../../config/logger')(_0xe835('0x6'));var config=require(_0xe835('0x7'));var jayson=require(_0xe835('0x8'));var client=jayson['client'][_0xe835('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32f5f5,_0xd227c7,_0xbf7143){return new BPromise(function(_0x57baf3,_0x4d4fdd){return client['request'](_0x32f5f5,_0xbf7143)[_0xe835('0xa')](function(_0x2f491e){logger[_0xe835('0xb')](_0xe835('0xc'),_0xd227c7,_0xe835('0xd'));logger['debug'](_0xe835('0xe'),_0xd227c7,_0xe835('0xd'),JSON[_0xe835('0xf')](_0x2f491e));if(_0x2f491e[_0xe835('0x10')]){if(_0x2f491e[_0xe835('0x10')][_0xe835('0x11')]===0x1f4){logger[_0xe835('0x10')](_0xe835('0xc'),_0xd227c7,_0x2f491e[_0xe835('0x10')][_0xe835('0x12')]);return _0x4d4fdd(_0x2f491e[_0xe835('0x10')][_0xe835('0x12')]);}logger[_0xe835('0x10')](_0xe835('0xc'),_0xd227c7,_0x2f491e[_0xe835('0x10')]['message']);return _0x57baf3(_0x2f491e[_0xe835('0x10')]['message']);}else{logger[_0xe835('0xb')](_0xe835('0xc'),_0xd227c7,_0xe835('0xd'));_0x57baf3(_0x2f491e[_0xe835('0x13')][_0xe835('0x12')]);}})[_0xe835('0x14')](function(_0x464743){logger[_0xe835('0x10')](_0xe835('0xc'),_0xd227c7,_0x464743);_0x4d4fdd(_0x464743);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index fd472fd..5bacf9d 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 _0x38db=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0xe0c034,_0xb88b62){var _0x499603=function(_0x34a02a){while(--_0x34a02a){_0xe0c034['push'](_0xe0c034['shift']());}};_0x499603(++_0xb88b62);}(_0x38db,0x18a));var _0xb38d=function(_0x2c67fd,_0x1f653b){_0x2c67fd=_0x2c67fd-0x0;var _0x2ff9b8=_0x38db[_0x2c67fd];return _0x2ff9b8;};'use strict';var multer=require(_0xb38d('0x0'));var util=require(_0xb38d('0x1'));var path=require(_0xb38d('0x2'));var timeout=require(_0xb38d('0x3'));var express=require(_0xb38d('0x4'));var router=express[_0xb38d('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb38d('0x6'));var config=require(_0xb38d('0x7'));module[_0xb38d('0x8')]=router; \ No newline at end of file +var _0xbeec=['multer','util','express','Router','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2b0bfb,_0x119c4f){var _0x4bd3c6=function(_0x42adb6){while(--_0x42adb6){_0x2b0bfb['push'](_0x2b0bfb['shift']());}};_0x4bd3c6(++_0x119c4f);}(_0xbeec,0x15e));var _0xcbee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbeec[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xcbee('0x0'));var util=require(_0xcbee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcbee('0x2'));var router=express[_0xcbee('0x3')]();var auth=require(_0xcbee('0x4'));var interaction=require(_0xcbee('0x5'));var config=require('../../config/environment');module[_0xcbee('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index c50ae2f..a05dd66 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 _0x34b7=['INTEGER','STRING'];(function(_0x312575,_0x34026e){var _0x54a39e=function(_0x3bf921){while(--_0x3bf921){_0x312575['push'](_0x312575['shift']());}};_0x54a39e(++_0x34026e);}(_0x34b7,0x196));var _0x734b=function(_0x1e4c37,_0xdf253e){_0x1e4c37=_0x1e4c37-0x0;var _0xec3469=_0x34b7[_0x1e4c37];return _0xec3469;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x734b('0x0')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x734b('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x734b('0x1')]}}; \ No newline at end of file +var _0xb688=['exports','INTEGER','STRING'];(function(_0x337488,_0x13b148){var _0x5f384a=function(_0x56d2b1){while(--_0x56d2b1){_0x337488['push'](_0x337488['shift']());}};_0x5f384a(++_0x13b148);}(_0xb688,0xcf));var _0x8b68=function(_0x458128,_0x4c9a38){_0x458128=_0x458128-0x0;var _0x2a8bd8=_0xb688[_0x458128];return _0x2a8bd8;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'penalty':{'type':Sequelize[_0x8b68('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8b68('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8b68('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 994a000..00ee32f 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 _0xbbe3=['../../config/environment','./userFaxQueue.attributes','exports','define','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x804304,_0x3b18a0){var _0x1153a5=function(_0x553456){while(--_0x553456){_0x804304['push'](_0x804304['shift']());}};_0x1153a5(++_0x3b18a0);}(_0xbbe3,0x19c));var _0x3bbe=function(_0x54cf54,_0x7511b5){_0x54cf54=_0x54cf54-0x0;var _0x774fc8=_0xbbe3[_0x54cf54];return _0x774fc8;};'use strict';var _=require('lodash');var util=require(_0x3bbe('0x0'));var logger=require(_0x3bbe('0x1'))(_0x3bbe('0x2'));var moment=require(_0x3bbe('0x3'));var BPromise=require(_0x3bbe('0x4'));var rp=require(_0x3bbe('0x5'));var fs=require('fs');var path=require(_0x3bbe('0x6'));var rimraf=require(_0x3bbe('0x7'));var config=require(_0x3bbe('0x8'));var attributes=require(_0x3bbe('0x9'));module[_0x3bbe('0xa')]=function(_0x363376,_0x6fa358){return _0x363376[_0x3bbe('0xb')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb9d=['path','rimraf','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api','moment','request-promise'];(function(_0x51ec61,_0xf9d1e3){var _0x223200=function(_0x3bd510){while(--_0x3bd510){_0x51ec61['push'](_0x51ec61['shift']());}};_0x223200(++_0xf9d1e3);}(_0xeb9d,0x7f));var _0xdeb9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb9d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdeb9('0x0'));var util=require('util');var logger=require(_0xdeb9('0x1'))(_0xdeb9('0x2'));var moment=require(_0xdeb9('0x3'));var BPromise=require('bluebird');var rp=require(_0xdeb9('0x4'));var fs=require('fs');var path=require(_0xdeb9('0x5'));var rimraf=require(_0xdeb9('0x6'));var config=require(_0xdeb9('0x7'));var attributes=require(_0xdeb9('0x8'));module['exports']=function(_0x14b08e,_0x4941b9){return _0x14b08e[_0xdeb9('0x9')](_0xdeb9('0xa'),attributes,{'tableName':_0xdeb9('0xb'),'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 e7e6d21..d25a04b 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 _0xfd53=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x874c50,_0x48e037){var _0x720fdc=function(_0x2693b8){while(--_0x2693b8){_0x874c50['push'](_0x874c50['shift']());}};_0x720fdc(++_0x48e037);}(_0xfd53,0x93));var _0x3fd5=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xfd53[_0x166d93];return _0xba708;};'use strict';var _=require(_0x3fd5('0x0'));var util=require(_0x3fd5('0x1'));var moment=require(_0x3fd5('0x2'));var BPromise=require(_0x3fd5('0x3'));var rs=require(_0x3fd5('0x4'));var fs=require('fs');var Redis=require(_0x3fd5('0x5'));var db=require(_0x3fd5('0x6'))['db'];var utils=require(_0x3fd5('0x7'));var logger=require(_0x3fd5('0x8'))(_0x3fd5('0x9'));var config=require(_0x3fd5('0xa'));var jayson=require(_0x3fd5('0xb'));var client=jayson[_0x3fd5('0xc')][_0x3fd5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3de320,_0x37d4f6,_0x2085ca){return new BPromise(function(_0x28a73c,_0x3939f7){return client['request'](_0x3de320,_0x2085ca)[_0x3fd5('0xe')](function(_0x5cf893){logger[_0x3fd5('0xf')](_0x3fd5('0x10'),_0x37d4f6,_0x3fd5('0x11'));logger[_0x3fd5('0x12')](_0x3fd5('0x13'),_0x37d4f6,_0x3fd5('0x11'),JSON[_0x3fd5('0x14')](_0x5cf893));if(_0x5cf893[_0x3fd5('0x15')]){if(_0x5cf893[_0x3fd5('0x15')][_0x3fd5('0x16')]===0x1f4){logger[_0x3fd5('0x15')](_0x3fd5('0x10'),_0x37d4f6,_0x5cf893[_0x3fd5('0x15')][_0x3fd5('0x17')]);return _0x3939f7(_0x5cf893['error'][_0x3fd5('0x17')]);}logger[_0x3fd5('0x15')](_0x3fd5('0x10'),_0x37d4f6,_0x5cf893[_0x3fd5('0x15')]['message']);return _0x28a73c(_0x5cf893[_0x3fd5('0x15')][_0x3fd5('0x17')]);}else{logger[_0x3fd5('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x37d4f6,'request\x20sent');_0x28a73c(_0x5cf893[_0x3fd5('0x18')][_0x3fd5('0x17')]);}})['catch'](function(_0x42d954){logger[_0x3fd5('0x15')](_0x3fd5('0x10'),_0x37d4f6,_0x42d954);_0x3939f7(_0x42d954);});});} \ No newline at end of file +var _0xaf30=['catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xaf30,0xd0));var _0x0af3=function(_0x5ad0d7,_0x2645f8){_0x5ad0d7=_0x5ad0d7-0x0;var _0xd83bd=_0xaf30[_0x5ad0d7];return _0xd83bd;};'use strict';var _=require('lodash');var util=require(_0x0af3('0x0'));var moment=require('moment');var BPromise=require(_0x0af3('0x1'));var rs=require(_0x0af3('0x2'));var fs=require('fs');var Redis=require(_0x0af3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0af3('0x4'));var logger=require(_0x0af3('0x5'))(_0x0af3('0x6'));var config=require(_0x0af3('0x7'));var jayson=require(_0x0af3('0x8'));var client=jayson[_0x0af3('0x9')][_0x0af3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x191b25,_0x76a8fe,_0x17e062){return new BPromise(function(_0x3cb01a,_0x2c6e50){return client[_0x0af3('0xb')](_0x191b25,_0x17e062)[_0x0af3('0xc')](function(_0x1fcd0f){logger[_0x0af3('0xd')](_0x0af3('0xe'),_0x76a8fe,_0x0af3('0xf'));logger[_0x0af3('0x10')](_0x0af3('0x11'),_0x76a8fe,'request\x20sent',JSON['stringify'](_0x1fcd0f));if(_0x1fcd0f['error']){if(_0x1fcd0f[_0x0af3('0x12')][_0x0af3('0x13')]===0x1f4){logger[_0x0af3('0x12')](_0x0af3('0xe'),_0x76a8fe,_0x1fcd0f[_0x0af3('0x12')]['message']);return _0x2c6e50(_0x1fcd0f[_0x0af3('0x12')][_0x0af3('0x14')]);}logger[_0x0af3('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x76a8fe,_0x1fcd0f['error'][_0x0af3('0x14')]);return _0x3cb01a(_0x1fcd0f[_0x0af3('0x12')][_0x0af3('0x14')]);}else{logger['info'](_0x0af3('0xe'),_0x76a8fe,_0x0af3('0xf'));_0x3cb01a(_0x1fcd0f[_0x0af3('0x15')][_0x0af3('0x14')]);}})[_0x0af3('0x16')](function(_0x2043c3){logger[_0x0af3('0x12')](_0x0af3('0xe'),_0x76a8fe,_0x2043c3);_0x2c6e50(_0x2043c3);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 942bc8b..8dd064d 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 _0x64c0=['util','path','express','../../components/auth/service','../../components/interaction/service','exports','multer'];(function(_0x1bf0fd,_0x40b3af){var _0x12b784=function(_0x10f50b){while(--_0x10f50b){_0x1bf0fd['push'](_0x1bf0fd['shift']());}};_0x12b784(++_0x40b3af);}(_0x64c0,0x99));var _0x064c=function(_0x4a492a,_0x31a9d3){_0x4a492a=_0x4a492a-0x0;var _0x32f2b3=_0x64c0[_0x4a492a];return _0x32f2b3;};'use strict';var multer=require(_0x064c('0x0'));var util=require(_0x064c('0x1'));var path=require(_0x064c('0x2'));var timeout=require('connect-timeout');var express=require(_0x064c('0x3'));var router=express['Router']();var auth=require(_0x064c('0x4'));var interaction=require(_0x064c('0x5'));var config=require('../../config/environment');module[_0x064c('0x6')]=router; \ No newline at end of file +var _0x5f8a=['../../components/auth/service','../../components/interaction/service','multer','util','connect-timeout','express'];(function(_0x47de89,_0x556a00){var _0x241bef=function(_0x232f6a){while(--_0x232f6a){_0x47de89['push'](_0x47de89['shift']());}};_0x241bef(++_0x556a00);}(_0x5f8a,0x1e2));var _0xa5f8=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0x5f8a[_0x324012];return _0x435cf2;};'use strict';var multer=require(_0xa5f8('0x0'));var util=require(_0xa5f8('0x1'));var path=require('path');var timeout=require(_0xa5f8('0x2'));var express=require(_0xa5f8('0x3'));var router=express['Router']();var auth=require(_0xa5f8('0x4'));var interaction=require(_0xa5f8('0x5'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index cdaee1c..d9dd64e 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(_0x407735,_0x1910ab){var _0x5b0950=function(_0x2847a4){while(--_0x2847a4){_0x407735['push'](_0x407735['shift']());}};_0x5b0950(++_0x1910ab);}(_0xe706,0xa3));var _0x6e70=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0xe706[_0x22e47a];return _0x15a12a;};'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(_0x2f242d,_0x4492be){var _0xf969f8=function(_0x2a8dc3){while(--_0x2a8dc3){_0x2f242d['push'](_0x2f242d['shift']());}};_0xf969f8(++_0x4492be);}(_0xe706,0xa3));var _0x6e70=function(_0xd3da2a,_0x22241c){_0xd3da2a=_0xd3da2a-0x0;var _0x10ab61=_0xe706[_0xd3da2a];return _0x10ab61;};'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 02757a3..4ef010b 100644 --- a/server/api/userMailQueue/userMailQueue.model.js +++ b/server/api/userMailQueue/userMailQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','user_has_mail_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x37bd0c,_0xfa7625){var _0x4917b5=function(_0x46c0a2){while(--_0x46c0a2){_0x37bd0c['push'](_0x37bd0c['shift']());}};_0x4917b5(++_0xfa7625);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('UserMailQueue',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','../../config/logger'];(function(_0x5c4178,_0x11471c){var _0x384e71=function(_0x4ff0db){while(--_0x4ff0db){_0x5c4178['push'](_0x5c4178['shift']());}};_0x384e71(++_0x11471c);}(_0xb10b,0x12a));var _0xbb10=function(_0x1ac33a,_0x52f6f8){_0x1ac33a=_0x1ac33a-0x0;var _0x3b6b87=_0xb10b[_0x1ac33a];return _0x3b6b87;};'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 diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 3417bab..7823ce3 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 _0xac0a=['UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x1bf597,_0x174f15){var _0x31b79c=function(_0x1636ad){while(--_0x1636ad){_0x1bf597['push'](_0x1bf597['shift']());}};_0x31b79c(++_0x174f15);}(_0xac0a,0x11e));var _0xaac0=function(_0x51b265,_0xcb70e6){_0x51b265=_0x51b265-0x0;var _0x3de368=_0xac0a[_0x51b265];return _0x3de368;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaac0('0x0'));var BPromise=require(_0xaac0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaac0('0x2'));var db=require(_0xaac0('0x3'))['db'];var utils=require(_0xaac0('0x4'));var logger=require(_0xaac0('0x5'))(_0xaac0('0x6'));var config=require(_0xaac0('0x7'));var jayson=require(_0xaac0('0x8'));var client=jayson[_0xaac0('0x9')][_0xaac0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc3366d,_0x2d5629,_0x1b9348){return new BPromise(function(_0x5d27ab,_0x91b8f4){return client[_0xaac0('0xb')](_0xc3366d,_0x1b9348)['then'](function(_0x1bdda5){logger[_0xaac0('0xc')](_0xaac0('0xd'),_0x2d5629,_0xaac0('0xe'));logger[_0xaac0('0xf')](_0xaac0('0x10'),_0x2d5629,_0xaac0('0xe'),JSON[_0xaac0('0x11')](_0x1bdda5));if(_0x1bdda5[_0xaac0('0x12')]){if(_0x1bdda5[_0xaac0('0x12')][_0xaac0('0x13')]===0x1f4){logger[_0xaac0('0x12')](_0xaac0('0xd'),_0x2d5629,_0x1bdda5[_0xaac0('0x12')][_0xaac0('0x14')]);return _0x91b8f4(_0x1bdda5[_0xaac0('0x12')][_0xaac0('0x14')]);}logger[_0xaac0('0x12')](_0xaac0('0xd'),_0x2d5629,_0x1bdda5[_0xaac0('0x12')][_0xaac0('0x14')]);return _0x5d27ab(_0x1bdda5[_0xaac0('0x12')][_0xaac0('0x14')]);}else{logger[_0xaac0('0xc')](_0xaac0('0xd'),_0x2d5629,_0xaac0('0xe'));_0x5d27ab(_0x1bdda5[_0xaac0('0x15')]['message']);}})[_0xaac0('0x16')](function(_0x542132){logger['error'](_0xaac0('0xd'),_0x2d5629,_0x542132);_0x91b8f4(_0x542132);});});} \ No newline at end of file +var _0xbdb9=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','jayson/promise','http'];(function(_0x226e70,_0x529df0){var _0x342b95=function(_0x29f425){while(--_0x29f425){_0x226e70['push'](_0x226e70['shift']());}};_0x342b95(++_0x529df0);}(_0xbdb9,0xac));var _0x9bdb=function(_0x318f3b,_0x304b19){_0x318f3b=_0x318f3b-0x0;var _0x28a951=_0xbdb9[_0x318f3b];return _0x28a951;};'use strict';var _=require(_0x9bdb('0x0'));var util=require(_0x9bdb('0x1'));var moment=require(_0x9bdb('0x2'));var BPromise=require(_0x9bdb('0x3'));var rs=require(_0x9bdb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bdb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9bdb('0x6'));var client=jayson['client'][_0x9bdb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e9c54,_0x369e4a,_0x27cdd8){return new BPromise(function(_0x27c6b8,_0x4bbae9){return client[_0x9bdb('0x8')](_0x4e9c54,_0x27cdd8)[_0x9bdb('0x9')](function(_0x152c08){logger['info'](_0x9bdb('0xa'),_0x369e4a,_0x9bdb('0xb'));logger[_0x9bdb('0xc')](_0x9bdb('0xd'),_0x369e4a,_0x9bdb('0xb'),JSON['stringify'](_0x152c08));if(_0x152c08['error']){if(_0x152c08[_0x9bdb('0xe')][_0x9bdb('0xf')]===0x1f4){logger[_0x9bdb('0xe')](_0x9bdb('0xa'),_0x369e4a,_0x152c08[_0x9bdb('0xe')][_0x9bdb('0x10')]);return _0x4bbae9(_0x152c08['error'][_0x9bdb('0x10')]);}logger[_0x9bdb('0xe')](_0x9bdb('0xa'),_0x369e4a,_0x152c08[_0x9bdb('0xe')][_0x9bdb('0x10')]);return _0x27c6b8(_0x152c08['error'][_0x9bdb('0x10')]);}else{logger[_0x9bdb('0x11')](_0x9bdb('0xa'),_0x369e4a,'request\x20sent');_0x27c6b8(_0x152c08[_0x9bdb('0x12')][_0x9bdb('0x10')]);}})[_0x9bdb('0x13')](function(_0x1f575e){logger[_0x9bdb('0xe')](_0x9bdb('0xa'),_0x369e4a,_0x1f575e);_0x4bbae9(_0x1f575e);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index b231e6a..0bef2f6 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 _0xb63e=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0xb63e,0x129));var _0xeb63=function(_0x32cbf8,_0x2db6fb){_0x32cbf8=_0x32cbf8-0x0;var _0x5b3fdd=_0xb63e[_0x32cbf8];return _0x5b3fdd;};'use strict';var multer=require(_0xeb63('0x0'));var util=require(_0xeb63('0x1'));var path=require(_0xeb63('0x2'));var timeout=require(_0xeb63('0x3'));var express=require(_0xeb63('0x4'));var router=express['Router']();var auth=require(_0xeb63('0x5'));var interaction=require(_0xeb63('0x6'));var config=require('../../config/environment');module[_0xeb63('0x7')]=router; \ No newline at end of file +var _0xb167=['path','connect-timeout','Router','../../components/auth/service','multer','util'];(function(_0x33c8da,_0xe34b99){var _0x1ec224=function(_0x3991bc){while(--_0x3991bc){_0x33c8da['push'](_0x33c8da['shift']());}};_0x1ec224(++_0xe34b99);}(_0xb167,0x172));var _0x7b16=function(_0x313ff2,_0x5d7c97){_0x313ff2=_0x313ff2-0x0;var _0x200a0c=_0xb167[_0x313ff2];return _0x200a0c;};'use strict';var multer=require(_0x7b16('0x0'));var util=require(_0x7b16('0x1'));var path=require(_0x7b16('0x2'));var timeout=require(_0x7b16('0x3'));var express=require('express');var router=express[_0x7b16('0x4')]();var auth=require(_0x7b16('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 51015d3..ddb23ec 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 _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x19b8ac,_0x5556f3){var _0x2f8031=function(_0x3f868a){while(--_0x3f868a){_0x19b8ac['push'](_0x19b8ac['shift']());}};_0x2f8031(++_0x5556f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x5e28c2,_0x1e48ab){var _0x1a8cc6=function(_0x1218bf){while(--_0x1218bf){_0x5e28c2['push'](_0x5e28c2['shift']());}};_0x1a8cc6(++_0x1e48ab);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'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 7581d6a..fde2570 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 _0x3bef=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger'];(function(_0xc51730,_0x4bbbb6){var _0x3115e1=function(_0x2b7f98){while(--_0x2b7f98){_0xc51730['push'](_0xc51730['shift']());}};_0x3115e1(++_0x4bbbb6);}(_0x3bef,0x1de));var _0xf3be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3bef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf3be('0x0'));var util=require(_0xf3be('0x1'));var logger=require(_0xf3be('0x2'))(_0xf3be('0x3'));var moment=require(_0xf3be('0x4'));var BPromise=require('bluebird');var rp=require(_0xf3be('0x5'));var fs=require('fs');var path=require(_0xf3be('0x6'));var rimraf=require(_0xf3be('0x7'));var config=require(_0xf3be('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xf3be('0x9')]=function(_0x52d947,_0x1581a6){return _0x52d947[_0xf3be('0xa')](_0xf3be('0xb'),attributes,{'tableName':_0xf3be('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d1a=['moment','bluebird','request-promise','path','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api'];(function(_0x3dd8dd,_0x369f8e){var _0x33e300=function(_0xf1a7db){while(--_0xf1a7db){_0x3dd8dd['push'](_0x3dd8dd['shift']());}};_0x33e300(++_0x369f8e);}(_0x6d1a,0xf9));var _0xa6d1=function(_0x438731,_0x2788bd){_0x438731=_0x438731-0x0;var _0x25dddc=_0x6d1a[_0x438731];return _0x25dddc;};'use strict';var _=require(_0xa6d1('0x0'));var util=require('util');var logger=require(_0xa6d1('0x1'))(_0xa6d1('0x2'));var moment=require(_0xa6d1('0x3'));var BPromise=require(_0xa6d1('0x4'));var rp=require(_0xa6d1('0x5'));var fs=require('fs');var path=require(_0xa6d1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa6d1('0x7'));module[_0xa6d1('0x8')]=function(_0x4da9f0,_0x6bcf35){return _0x4da9f0[_0xa6d1('0x9')](_0xa6d1('0xa'),attributes,{'tableName':_0xa6d1('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 90d0408..27630c8 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 _0x2618=['jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x2618,0x151));var _0x8261=function(_0x2d4516,_0x258709){_0x2d4516=_0x2d4516-0x0;var _0x2ad727=_0x2618[_0x2d4516];return _0x2ad727;};'use strict';var _=require(_0x8261('0x0'));var util=require(_0x8261('0x1'));var moment=require(_0x8261('0x2'));var BPromise=require(_0x8261('0x3'));var rs=require(_0x8261('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8261('0x5'))(_0x8261('0x6'));var config=require(_0x8261('0x7'));var jayson=require(_0x8261('0x8'));var client=jayson[_0x8261('0x9')][_0x8261('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54539a,_0x44cf6c,_0x45f53c){return new BPromise(function(_0x382fb6,_0x5f42da){return client[_0x8261('0xb')](_0x54539a,_0x45f53c)[_0x8261('0xc')](function(_0x2560d5){logger[_0x8261('0xd')](_0x8261('0xe'),_0x44cf6c,_0x8261('0xf'));logger[_0x8261('0x10')](_0x8261('0x11'),_0x44cf6c,_0x8261('0xf'),JSON[_0x8261('0x12')](_0x2560d5));if(_0x2560d5[_0x8261('0x13')]){if(_0x2560d5[_0x8261('0x13')][_0x8261('0x14')]===0x1f4){logger['error'](_0x8261('0xe'),_0x44cf6c,_0x2560d5[_0x8261('0x13')][_0x8261('0x15')]);return _0x5f42da(_0x2560d5[_0x8261('0x13')][_0x8261('0x15')]);}logger[_0x8261('0x13')](_0x8261('0xe'),_0x44cf6c,_0x2560d5['error'][_0x8261('0x15')]);return _0x382fb6(_0x2560d5[_0x8261('0x13')]['message']);}else{logger[_0x8261('0xd')](_0x8261('0xe'),_0x44cf6c,_0x8261('0xf'));_0x382fb6(_0x2560d5[_0x8261('0x16')][_0x8261('0x15')]);}})['catch'](function(_0x11abe8){logger[_0x8261('0x13')](_0x8261('0xe'),_0x44cf6c,_0x11abe8);_0x5f42da(_0x11abe8);});});} \ No newline at end of file +var _0xc723=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','bluebird'];(function(_0x2f45fc,_0x4a97c8){var _0x502719=function(_0x5b1322){while(--_0x5b1322){_0x2f45fc['push'](_0x2f45fc['shift']());}};_0x502719(++_0x4a97c8);}(_0xc723,0xe6));var _0x3c72=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0xc723[_0x26bf51];return _0x503415;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3c72('0x0'));var rs=require(_0x3c72('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c72('0x2'))['db'];var utils=require(_0x3c72('0x3'));var logger=require(_0x3c72('0x4'))(_0x3c72('0x5'));var config=require(_0x3c72('0x6'));var jayson=require(_0x3c72('0x7'));var client=jayson[_0x3c72('0x8')][_0x3c72('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd611a4,_0x15c9a0,_0x3881cd){return new BPromise(function(_0x3c6418,_0x4fede6){return client['request'](_0xd611a4,_0x3881cd)[_0x3c72('0xa')](function(_0x420922){logger[_0x3c72('0xb')](_0x3c72('0xc'),_0x15c9a0,_0x3c72('0xd'));logger[_0x3c72('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x15c9a0,_0x3c72('0xd'),JSON[_0x3c72('0xf')](_0x420922));if(_0x420922['error']){if(_0x420922[_0x3c72('0x10')][_0x3c72('0x11')]===0x1f4){logger[_0x3c72('0x10')](_0x3c72('0xc'),_0x15c9a0,_0x420922[_0x3c72('0x10')][_0x3c72('0x12')]);return _0x4fede6(_0x420922[_0x3c72('0x10')][_0x3c72('0x12')]);}logger[_0x3c72('0x10')](_0x3c72('0xc'),_0x15c9a0,_0x420922[_0x3c72('0x10')][_0x3c72('0x12')]);return _0x3c6418(_0x420922[_0x3c72('0x10')][_0x3c72('0x12')]);}else{logger[_0x3c72('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x15c9a0,_0x3c72('0xd'));_0x3c6418(_0x420922[_0x3c72('0x13')]['message']);}})[_0x3c72('0x14')](function(_0x515faf){logger['error'](_0x3c72('0xc'),_0x15c9a0,_0x515faf);_0x4fede6(_0x515faf);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index c0e4e11..0cc5e54 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 _0xa3e8=['delete','destroy','removeSections','removeResources','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','index','/describe','isAuthenticated','/:id','getSections','/:id/resources','getResources','post','/:id/clone','/:id/sections','addSections','addResources','put','update'];(function(_0x3b25ef,_0x4a116a){var _0x22c489=function(_0x585d9d){while(--_0x585d9d){_0x3b25ef['push'](_0x3b25ef['shift']());}};_0x22c489(++_0x4a116a);}(_0xa3e8,0x100));var _0x8a3e=function(_0x311785,_0x17a3c6){_0x311785=_0x311785-0x0;var _0x50af72=_0xa3e8[_0x311785];return _0x50af72;};'use strict';var multer=require(_0x8a3e('0x0'));var util=require(_0x8a3e('0x1'));var path=require(_0x8a3e('0x2'));var timeout=require(_0x8a3e('0x3'));var express=require(_0x8a3e('0x4'));var router=express[_0x8a3e('0x5')]();var auth=require(_0x8a3e('0x6'));var interaction=require(_0x8a3e('0x7'));var config=require('../../config/environment');var controller=require(_0x8a3e('0x8'));router[_0x8a3e('0x9')]('/',auth['isAuthenticated'](),controller[_0x8a3e('0xa')]);router[_0x8a3e('0x9')](_0x8a3e('0xb'),auth[_0x8a3e('0xc')](),controller['describe']);router[_0x8a3e('0x9')](_0x8a3e('0xd'),auth[_0x8a3e('0xc')](),controller['show']);router['get']('/:id/sections',auth[_0x8a3e('0xc')](),controller[_0x8a3e('0xe')]);router[_0x8a3e('0x9')](_0x8a3e('0xf'),auth[_0x8a3e('0xc')](),controller[_0x8a3e('0x10')]);router[_0x8a3e('0x11')]('/',auth[_0x8a3e('0xc')](),controller['create']);router[_0x8a3e('0x11')](_0x8a3e('0x12'),auth[_0x8a3e('0xc')](),controller['clone']);router['post'](_0x8a3e('0x13'),auth['isAuthenticated'](),controller[_0x8a3e('0x14')]);router['post'](_0x8a3e('0xf'),auth[_0x8a3e('0xc')](),controller[_0x8a3e('0x15')]);router[_0x8a3e('0x16')](_0x8a3e('0xd'),auth[_0x8a3e('0xc')](),controller[_0x8a3e('0x17')]);router[_0x8a3e('0x18')](_0x8a3e('0xd'),auth[_0x8a3e('0xc')](),controller[_0x8a3e('0x19')]);router['delete']('/:id/sections',auth[_0x8a3e('0xc')](),controller[_0x8a3e('0x1a')]);router[_0x8a3e('0x18')]('/:id/resources',auth[_0x8a3e('0xc')](),controller[_0x8a3e('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x3c72=['isAuthenticated','index','/describe','describe','get','/:id','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addResources','put','update','delete','destroy','removeResources','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller'];(function(_0x39249e,_0x28c639){var _0x37ced7=function(_0x49f1cf){while(--_0x49f1cf){_0x39249e['push'](_0x39249e['shift']());}};_0x37ced7(++_0x28c639);}(_0x3c72,0x189));var _0x23c7=function(_0x1c12b9,_0x2e14ed){_0x1c12b9=_0x1c12b9-0x0;var _0x2784ec=_0x3c72[_0x1c12b9];return _0x2784ec;};'use strict';var multer=require(_0x23c7('0x0'));var util=require(_0x23c7('0x1'));var path=require(_0x23c7('0x2'));var timeout=require(_0x23c7('0x3'));var express=require(_0x23c7('0x4'));var router=express[_0x23c7('0x5')]();var auth=require(_0x23c7('0x6'));var interaction=require(_0x23c7('0x7'));var config=require(_0x23c7('0x8'));var controller=require(_0x23c7('0x9'));router['get']('/',auth[_0x23c7('0xa')](),controller[_0x23c7('0xb')]);router['get'](_0x23c7('0xc'),auth[_0x23c7('0xa')](),controller[_0x23c7('0xd')]);router[_0x23c7('0xe')](_0x23c7('0xf'),auth[_0x23c7('0xa')](),controller['show']);router[_0x23c7('0xe')](_0x23c7('0x10'),auth[_0x23c7('0xa')](),controller[_0x23c7('0x11')]);router['get'](_0x23c7('0x12'),auth[_0x23c7('0xa')](),controller[_0x23c7('0x13')]);router[_0x23c7('0x14')]('/',auth[_0x23c7('0xa')](),controller[_0x23c7('0x15')]);router[_0x23c7('0x14')](_0x23c7('0x16'),auth[_0x23c7('0xa')](),controller[_0x23c7('0x17')]);router[_0x23c7('0x14')]('/:id/sections',auth[_0x23c7('0xa')](),controller['addSections']);router[_0x23c7('0x14')](_0x23c7('0x12'),auth['isAuthenticated'](),controller[_0x23c7('0x18')]);router[_0x23c7('0x19')]('/:id',auth[_0x23c7('0xa')](),controller[_0x23c7('0x1a')]);router[_0x23c7('0x1b')](_0x23c7('0xf'),auth['isAuthenticated'](),controller[_0x23c7('0x1c')]);router[_0x23c7('0x1b')](_0x23c7('0x10'),auth[_0x23c7('0xa')](),controller['removeSections']);router[_0x23c7('0x1b')](_0x23c7('0x12'),auth[_0x23c7('0xa')](),controller[_0x23c7('0x1d')]);module[_0x23c7('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 652ee9e..629a6bb 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 _0x6afd=['name','setDataValue','join','crudPermissions','split','sequelize','STRING'];(function(_0x17e006,_0x36b1e4){var _0xbf3698=function(_0x5f4d4d){while(--_0x5f4d4d){_0x17e006['push'](_0x17e006['shift']());}};_0xbf3698(++_0x36b1e4);}(_0x6afd,0x67));var _0xd6af=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x6afd[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0xd6af('0x0'));module['exports']={'name':{'type':Sequelize[_0xd6af('0x1')],'allowNull':![],'unique':_0xd6af('0x2')},'crudPermissions':{'type':Sequelize[_0xd6af('0x1')],'set':function(_0x56be3f){this[_0xd6af('0x3')]('crudPermissions',_0x56be3f?_0x56be3f[_0xd6af('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0xd6af('0x5'))?this['getDataValue'](_0xd6af('0x5'))[_0xd6af('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd6af('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x8df0=['STRING','name','setDataValue','crudPermissions','join','getDataValue','split','exports'];(function(_0x4e5db3,_0x516e94){var _0x1f3f31=function(_0x98a7a2){while(--_0x98a7a2){_0x4e5db3['push'](_0x4e5db3['shift']());}};_0x1f3f31(++_0x516e94);}(_0x8df0,0x127));var _0x08df=function(_0x534dfd,_0x175626){_0x534dfd=_0x534dfd-0x0;var _0xfe1a40=_0x8df0[_0x534dfd];return _0xfe1a40;};'use strict';var Sequelize=require('sequelize');module[_0x08df('0x0')]={'name':{'type':Sequelize[_0x08df('0x1')],'allowNull':![],'unique':_0x08df('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x5d0ab5){this[_0x08df('0x3')](_0x08df('0x4'),_0x5d0ab5?_0x5d0ab5[_0x08df('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x08df('0x4'))?this[_0x08df('0x6')]('crudPermissions')[_0x08df('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x08df('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index de9a4fa..e21d717 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 _0xd261=['SquareRecording','SquareProjects','projects','contacts','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','ChatWebsite','faxqueues','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','VoiceQueue','QueueCampaigns','musiconholds','VoiceMusicOnHold','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','teams','Team','voicequeues','queuecampaigns','users','agents','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','Disposition','customdashboards','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','tags','templates','Template','Trigger','Trunk','variables','Variable','extractedreports','Reports','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./userProfile.socket','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','UserProfile','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','userProfileId','Resources','UserProfileResource','describe','addSections','sectionId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','forEach','Plugin','resourceId','bulkCreate','removeResources','getResources','undefined','ValidationError','Unknown\x20section','mergeResources','childModel','Sequelize','Invalid\x20section\x20\x27','parentSections','all','union','ignore','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','reportId','DefaultReports','custom','CmContact','Tags','color','Tag','ThroughTags','tag','value','toLowerCase','SquareProject','SquareOdbc','squarerecordings'];(function(_0x13f601,_0x4dc50f){var _0xad44c0=function(_0x5c19fe){while(--_0x5c19fe){_0x13f601['push'](_0x13f601['shift']());}};_0xad44c0(++_0x4dc50f);}(_0xd261,0x143));var _0x1d26=function(_0x354422,_0x383c8f){_0x354422=_0x354422-0x0;var _0x411173=_0xd261[_0x354422];return _0x411173;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1d26('0x0'));var zipdir=require(_0x1d26('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1d26('0x2'));var Mustache=require('mustache');var util=require(_0x1d26('0x3'));var path=require(_0x1d26('0x4'));var sox=require(_0x1d26('0x5'));var csv=require(_0x1d26('0x6'));var ejs=require(_0x1d26('0x7'));var fs=require('fs');var _=require(_0x1d26('0x8'));var squel=require(_0x1d26('0x9'));var crypto=require(_0x1d26('0xa'));var jsforce=require(_0x1d26('0xb'));var deskjs=require(_0x1d26('0xc'));var toCsv=require(_0x1d26('0x6'));var querystring=require(_0x1d26('0xd'));var Papa=require(_0x1d26('0xe'));var Redis=require(_0x1d26('0xf'));var authService=require(_0x1d26('0x10'));var qs=require(_0x1d26('0x11'));var as=require(_0x1d26('0x12'));var hardwareService=require(_0x1d26('0x13'));var logger=require(_0x1d26('0x14'))(_0x1d26('0x15'));var utils=require(_0x1d26('0x16'));var config=require(_0x1d26('0x17'));var db=require(_0x1d26('0x18'))['db'];config[_0x1d26('0x19')]=_['defaults'](config['redis'],{'host':_0x1d26('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1d26('0x19')]));require(_0x1d26('0x1b'))['register'](socket);function respondWithStatusCode(_0x39f9ad,_0xfc9f8){_0xfc9f8=_0xfc9f8||0xcc;return function(_0x2244c6){if(_0x2244c6){return _0x39f9ad[_0x1d26('0x1c')](_0xfc9f8);}return _0x39f9ad['status'](_0xfc9f8)['end']();};}function respondWithResult(_0xe9c886,_0x16e427){_0x16e427=_0x16e427||0xc8;return function(_0x21bd6b){if(_0x21bd6b){return _0xe9c886[_0x1d26('0x1d')](_0x16e427)[_0x1d26('0x1e')](_0x21bd6b);}};}function respondWithFilteredResult(_0x1265e9,_0x5a8f23){return function(_0x369115){if(_0x369115){var _0x9da322=_0x369115[_0x1d26('0x1f')],_0x25a0fe=_0x5a8f23['offset'],_0x464407=_0x5a8f23[_0x1d26('0x20')]+_0x5a8f23['limit'],_0x5eb71a;if(_0x464407>=_0x9da322){_0x464407=_0x9da322;_0x5eb71a=0xc8;}else{_0x5eb71a=0xce;}_0x1265e9[_0x1d26('0x1d')](_0x5eb71a);return _0x1265e9[_0x1d26('0x21')](_0x1d26('0x22'),_0x25a0fe+'-'+_0x464407+'/'+_0x9da322)['json'](_0x369115);}return null;};}function patchUpdates(_0x5fd395){return function(_0x294141){try{jsonpatch[_0x1d26('0x23')](_0x294141,_0x5fd395,!![]);}catch(_0x30374a){return BPromise[_0x1d26('0x24')](_0x30374a);}return _0x294141[_0x1d26('0x25')]();};}function saveUpdates(_0xc07cf9,_0x14ebad){return function(_0x44c451){if(_0x44c451){return _0x44c451[_0x1d26('0x26')](_0xc07cf9)[_0x1d26('0x27')](function(_0x451a3f){return _0x451a3f;});}return null;};}function removeEntity(_0x5f07d1,_0xfd8e4b){return function(_0x38db4a){if(_0x38db4a){return _0x38db4a[_0x1d26('0x28')]()[_0x1d26('0x27')](function(){_0x5f07d1[_0x1d26('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfd8314,_0xbde635){return function(_0x4e33a7){if(!_0x4e33a7){_0xfd8314[_0x1d26('0x1c')](0x194);}return _0x4e33a7;};}function handleError(_0x4d9105,_0x1be10b){_0x1be10b=_0x1be10b||0x1f4;return function(_0xa611dd){logger['error'](_0xa611dd[_0x1d26('0x29')]);if(_0xa611dd[_0x1d26('0x2a')]){delete _0xa611dd['name'];}_0x4d9105[_0x1d26('0x1d')](_0x1be10b)[_0x1d26('0x2b')](_0xa611dd);};}exports['index']=function(_0x59f600,_0x279a9a){var _0x163fed={},_0x39e468={},_0x57653f={'count':0x0,'rows':[]};var _0x44c5d6=_[_0x1d26('0x2c')](db['UserProfile']['rawAttributes'],function(_0x3272a1){return{'name':_0x3272a1[_0x1d26('0x2d')],'type':_0x3272a1['type'][_0x1d26('0x2e')]};});_0x39e468['model']=_['map'](_0x44c5d6,'name');_0x39e468[_0x1d26('0x2f')]=_[_0x1d26('0x30')](_0x59f600['query']);_0x39e468[_0x1d26('0x31')]=_[_0x1d26('0x32')](_0x39e468[_0x1d26('0x33')],_0x39e468[_0x1d26('0x2f')]);_0x163fed[_0x1d26('0x34')]=_[_0x1d26('0x32')](_0x39e468[_0x1d26('0x33')],qs[_0x1d26('0x35')](_0x59f600[_0x1d26('0x2f')][_0x1d26('0x35')]));_0x163fed['attributes']=_0x163fed['attributes']['length']?_0x163fed['attributes']:_0x39e468[_0x1d26('0x33')];if(!_0x59f600[_0x1d26('0x2f')][_0x1d26('0x36')](_0x1d26('0x37'))){_0x163fed['limit']=qs[_0x1d26('0x38')](_0x59f600['query']['limit']);_0x163fed[_0x1d26('0x20')]=qs[_0x1d26('0x20')](_0x59f600[_0x1d26('0x2f')][_0x1d26('0x20')]);}_0x163fed[_0x1d26('0x39')]=qs[_0x1d26('0x3a')](_0x59f600[_0x1d26('0x2f')][_0x1d26('0x3a')]);_0x163fed[_0x1d26('0x3b')]=qs[_0x1d26('0x31')](_[_0x1d26('0x3c')](_0x59f600[_0x1d26('0x2f')],_0x39e468[_0x1d26('0x31')]));if(_0x59f600['query'][_0x1d26('0x3d')]){_0x163fed['where']=_['merge'](_0x163fed['where'],{'$or':_[_0x1d26('0x2c')](_0x44c5d6,function(_0x2e6754){if(_0x2e6754[_0x1d26('0x3e')]!==_0x1d26('0x3f')){var _0x243cfe={};_0x243cfe[_0x2e6754['name']]={'$like':'%'+_0x59f600['query'][_0x1d26('0x3d')]+'%'};return _0x243cfe;}})});}_0x163fed=_[_0x1d26('0x40')]({},_0x163fed,_0x59f600[_0x1d26('0x41')]);var _0x27f0e8={'where':_0x163fed['where']};return db['UserProfile'][_0x1d26('0x1f')](_0x27f0e8)['then'](function(_0x30bb98){_0x57653f[_0x1d26('0x1f')]=_0x30bb98;if(_0x59f600[_0x1d26('0x2f')][_0x1d26('0x42')]){_0x163fed[_0x1d26('0x43')]=[{'all':!![]}];}return db[_0x1d26('0x44')][_0x1d26('0x45')](_0x163fed);})[_0x1d26('0x27')](function(_0x399758){_0x57653f[_0x1d26('0x46')]=_0x399758;return _0x57653f;})[_0x1d26('0x27')](respondWithFilteredResult(_0x279a9a,_0x163fed))[_0x1d26('0x47')](handleError(_0x279a9a,null));};exports[_0x1d26('0x48')]=function(_0x287bfb,_0x59e89a){var _0x293297={'raw':![],'where':{'id':_0x287bfb[_0x1d26('0x49')]['id']}},_0x46e4a8={};_0x46e4a8['model']=_['keys'](db[_0x1d26('0x44')][_0x1d26('0x4a')]);_0x46e4a8[_0x1d26('0x2f')]=_[_0x1d26('0x30')](_0x287bfb[_0x1d26('0x2f')]);_0x46e4a8[_0x1d26('0x31')]=_['intersection'](_0x46e4a8[_0x1d26('0x33')],_0x46e4a8[_0x1d26('0x2f')]);_0x293297['attributes']=_['intersection'](_0x46e4a8[_0x1d26('0x33')],qs[_0x1d26('0x35')](_0x287bfb[_0x1d26('0x2f')][_0x1d26('0x35')]));_0x293297[_0x1d26('0x34')]=_0x293297[_0x1d26('0x34')][_0x1d26('0x4b')]?_0x293297['attributes']:_0x46e4a8['model'];if(_0x287bfb[_0x1d26('0x2f')][_0x1d26('0x42')]){_0x293297['include']=[{'all':!![]}];}_0x293297=_[_0x1d26('0x40')]({},_0x293297,_0x287bfb['options']);return db['UserProfile'][_0x1d26('0x4c')](_0x293297)[_0x1d26('0x27')](handleEntityNotFound(_0x59e89a,null))[_0x1d26('0x27')](respondWithResult(_0x59e89a,null))[_0x1d26('0x47')](handleError(_0x59e89a,null));};exports[_0x1d26('0x4d')]=function(_0x240044,_0x323ff6){return db[_0x1d26('0x44')][_0x1d26('0x4d')](_0x240044[_0x1d26('0x4e')],{})[_0x1d26('0x27')](respondWithResult(_0x323ff6,0xc9))[_0x1d26('0x47')](handleError(_0x323ff6,null));};exports['clone']=function(_0x450fd9,_0x152ab0){var _0x4d99d7={'where':{'id':_0x450fd9[_0x1d26('0x49')]['id']}},_0x53214e={};_0x53214e[_0x1d26('0x33')]=_[_0x1d26('0x30')](db[_0x1d26('0x44')]['rawAttributes']);_0x4d99d7[_0x1d26('0x34')]=_['intersection'](_0x53214e[_0x1d26('0x33')],qs[_0x1d26('0x35')](_0x450fd9['query'][_0x1d26('0x35')]));_0x4d99d7[_0x1d26('0x34')]=_0x4d99d7[_0x1d26('0x34')][_0x1d26('0x4b')]?_0x4d99d7['attributes']:_0x53214e['model'];if(_0x450fd9[_0x1d26('0x2f')]['includeAll']){_0x4d99d7[_0x1d26('0x43')]=[{'all':!![]}];}_0x4d99d7=_[_0x1d26('0x40')]({},_0x4d99d7,_0x450fd9[_0x1d26('0x41')]);return db[_0x1d26('0x44')][_0x1d26('0x4c')](_0x4d99d7)[_0x1d26('0x27')](handleEntityNotFound(_0x152ab0,null))[_0x1d26('0x27')](function(_0x3cf031){if(_0x3cf031){var _0xcba937=_0x3cf031[_0x1d26('0x4f')]({'plain':!![]});_0xcba937=qs[_0x1d26('0x50')](_0xcba937,['id',_0x1d26('0x51'),_0x1d26('0x52'),_0x1d26('0x53')]);_0x450fd9[_0x1d26('0x4e')]=_[_0x1d26('0x50')](_0x450fd9['body'],['id','createdAt',_0x1d26('0x52')]);return db[_0x1d26('0x54')][_0x1d26('0x55')](function(_0x426ab2){return db[_0x1d26('0x44')]['create'](_['merge'](_0xcba937,_0x450fd9['body']),{'include':_0x450fd9[_0x1d26('0x2f')][_0x1d26('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x426ab2})[_0x1d26('0x27')](function(_0x5d1a5d){var _0x11daff=_0x5d1a5d[_0x1d26('0x4f')]({'plain':!![]});return db[_0x1d26('0x56')][_0x1d26('0x45')]({'where':{'userProfileId':_0x450fd9[_0x1d26('0x49')]['id']},'raw':!![]})['then'](function(_0x3b150c){if(_0x3b150c){return BPromise[_0x1d26('0x57')](_0x3b150c,function(_0x39ed49){return new BPromise(function(_0x269059,_0x2b265f){if(_0x39ed49[_0x1d26('0x58')]===null||_0x39ed49['autoAssociation']===0x1)_0x269059(null);return db['UserProfileResource'][_0x1d26('0x45')]({'where':{'sectionId':_0x39ed49['id']},'raw':!![]})[_0x1d26('0x27')](function(_0x11d1d8){var _0x57df3d=_[_0x1d26('0x2c')](_0x11d1d8,function(_0x912ad8){return qs[_0x1d26('0x50')](_0x912ad8,['id','createdAt',_0x1d26('0x52'),'sectionId']);});_0x269059(_0x57df3d);})[_0x1d26('0x47')](function(_0x8cd40a){_0x2b265f(_0x8cd40a);});})['then'](function(_0x27529c){var _0x1a514f=qs[_0x1d26('0x50')](_0x39ed49,['id','createdAt','updatedAt']);_0x1a514f[_0x1d26('0x59')]=_0x11daff['id'];if(_0x27529c)_0x1a514f[_0x1d26('0x5a')]=_0x27529c;return _0x1a514f;})[_0x1d26('0x27')](function(_0x1a0727){return db[_0x1d26('0x56')][_0x1d26('0x4d')](_0x1a0727,{'include':[{'model':db[_0x1d26('0x5b')],'as':_0x1d26('0x5a')}],'raw':!![],'transaction':_0x426ab2});});})[_0x1d26('0x27')](function(){return _0x11daff;});}});});});}})['then'](respondWithResult(_0x152ab0,0xc9))[_0x1d26('0x47')](handleError(_0x152ab0,null));};exports[_0x1d26('0x26')]=function(_0x53f86f,_0x2a1d98){if(_0x53f86f[_0x1d26('0x4e')]['id']){delete _0x53f86f[_0x1d26('0x4e')]['id'];}return db[_0x1d26('0x44')][_0x1d26('0x4c')]({'where':{'id':_0x53f86f[_0x1d26('0x49')]['id']}})['then'](handleEntityNotFound(_0x2a1d98,null))[_0x1d26('0x27')](saveUpdates(_0x53f86f[_0x1d26('0x4e')],null))['then'](respondWithResult(_0x2a1d98,null))[_0x1d26('0x47')](handleError(_0x2a1d98,null));};exports['destroy']=function(_0x4cbc65,_0x29c83d){return db[_0x1d26('0x44')][_0x1d26('0x4c')]({'where':{'id':_0x4cbc65[_0x1d26('0x49')]['id']}})[_0x1d26('0x27')](handleEntityNotFound(_0x29c83d,null))[_0x1d26('0x27')](removeEntity(_0x29c83d,null))[_0x1d26('0x47')](handleError(_0x29c83d,null));};exports[_0x1d26('0x5c')]=function(_0x518302,_0x434dd5){return db['UserProfile']['describe']()[_0x1d26('0x27')](respondWithResult(_0x434dd5,null))['catch'](handleError(_0x434dd5,null));};exports[_0x1d26('0x5d')]=function(_0x3ee77c,_0x5820d7){var _0x359971=_0x3ee77c[_0x1d26('0x4e')];return db['UserProfile'][_0x1d26('0x4c')]({'where':{'id':_0x3ee77c[_0x1d26('0x49')]['id']}})[_0x1d26('0x27')](handleEntityNotFound(_0x5820d7,null))[_0x1d26('0x27')](function(_0x27e5ae){if(_0x27e5ae){return db[_0x1d26('0x54')][_0x1d26('0x55')](function(_0x183ee5){return db[_0x1d26('0x56')][_0x1d26('0x28')]({'where':{'userProfileId':_0x3ee77c[_0x1d26('0x49')]['id'],'sectionId':_[_0x1d26('0x2c')](_0x359971,function(_0x1b7125){return _0x1b7125[_0x1d26('0x5e')];})},'transaction':_0x183ee5})[_0x1d26('0x27')](function(){var _0x1b8f4e=_[_0x1d26('0x2c')](_0x359971,function(_0x31f163){_0x31f163[_0x1d26('0x59')]=_0x3ee77c[_0x1d26('0x49')]['id'];return _0x31f163;});var _0x1e811a=[];return BPromise[_0x1d26('0x57')](_0x1b8f4e,function(_0x2210db){return db[_0x1d26('0x56')][_0x1d26('0x4d')](_0x2210db,{'include':[{'model':db[_0x1d26('0x5b')],'as':_0x1d26('0x5a')}],'raw':!![],'transaction':_0x183ee5})[_0x1d26('0x27')](function(_0x1fae3e){_0x1e811a[_0x1d26('0x5f')](_0x1fae3e[_0x1d26('0x4f')]({'plain':!![]}));});})['then'](function(){return _0x1e811a;});});});}})['then'](function(_0x4015fc){return _0x4015fc;})[_0x1d26('0x27')](respondWithResult(_0x5820d7,null))[_0x1d26('0x47')](handleError(_0x5820d7,null));};exports[_0x1d26('0x60')]=function(_0x132938,_0x56a322){var _0x53da32;return db[_0x1d26('0x44')][_0x1d26('0x4c')]({'where':{'id':_0x132938['params']['id']},'attributes':['id','name']})[_0x1d26('0x27')](handleEntityNotFound(_0x56a322,null))[_0x1d26('0x27')](function(_0x26db5f){if(_0x26db5f){_0x53da32=_0x26db5f;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x132938[_0x1d26('0x49')]['id'],'sectionId':_0x132938[_0x1d26('0x2f')][_0x1d26('0x61')]}});}})[_0x1d26('0x27')](function(){return _0x53da32;})[_0x1d26('0x27')](respondWithStatusCode(_0x56a322,null))[_0x1d26('0x47')](handleError(_0x56a322,null));};exports[_0x1d26('0x62')]=function(_0x7cc115,_0x6e6380){var _0x103be2=[];var _0x42c18f=[];return db['UserProfileSection'][_0x1d26('0x45')]({'where':{'userProfileId':_0x7cc115[_0x1d26('0x49')]['id']},'raw':!![]})[_0x1d26('0x27')](function(_0x31368f){_0x103be2=_[_0x1d26('0x3d')](_0x31368f,function(_0x18b213){return _0x18b213[_0x1d26('0x63')]===0x1||_[_0x1d26('0x64')]([0x3eb,0x709],_0x18b213[_0x1d26('0x5e')]);});if(!_[_0x1d26('0x65')](_0x103be2)){return _[_0x1d26('0x2c')](_0x103be2,function(_0x1dbd1e){return _0x1dbd1e[_0x1d26('0x5e')];});}else{return;}})[_0x1d26('0x27')](function(_0x4b31f7){if(_0x4b31f7)_0x42c18f=_0x4b31f7;if(_[_0x1d26('0x64')](_0x42c18f,0x64)){var _0x1938fd=_['find'](_0x103be2,{'sectionId':0x64});return hasDefaultDashboard(_0x1938fd)[_0x1d26('0x27')](function(_0x1d3c56){return _[_0x1d26('0x2c')](_0x103be2,function(_0x1d46e2){if(_0x1d46e2['sectionId']===0x64){_0x1d46e2[_0x1d26('0x66')]=_0x1d3c56;}return _0x1d46e2;});});}else{return;}})[_0x1d26('0x27')](function(_0x30edb4){if(_0x30edb4)_0x103be2=_0x30edb4;if(_[_0x1d26('0x64')](_0x42c18f,0x3eb)){var _0x1557b5=_[_0x1d26('0x4c')](_0x103be2,{'sectionId':0x3eb});return getCustomDashboards(_0x1557b5)[_0x1d26('0x27')](function(_0x5deec0){return _['map'](_0x103be2,function(_0x1a56fa){if(_0x1557b5[_0x1d26('0x63')]){if(_0x1a56fa[_0x1d26('0x5e')]===0x3eb){_0x1a56fa[_0x1d26('0x66')]=_0x5deec0;}}else{if(_0x1a56fa[_0x1d26('0x5e')]===0x64){_0x1a56fa[_0x1d26('0x66')]=_0x5deec0;}}return _0x1a56fa;});});}else{return;}})[_0x1d26('0x27')](function(_0x354284){if(_0x354284)_0x103be2=_0x354284;if(_[_0x1d26('0x64')](_0x42c18f,0x709)){var _0x1f15c1=_[_0x1d26('0x4c')](_0x103be2,{'sectionId':0x709});return getPlugins(_0x1f15c1)[_0x1d26('0x27')](function(_0x2f2c73){if(_0x1f15c1[_0x1d26('0x63')]){return _[_0x1d26('0x2c')](_0x103be2,function(_0x29f257){if(_0x29f257[_0x1d26('0x5e')]===0x709){_0x29f257[_0x1d26('0x66')]=_0x2f2c73;}return _0x29f257;});}else{var _0x2eaba0={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2f2c73};var _0xca61f2=_[_0x1d26('0x2c')](_0x103be2);_0xca61f2[_0x1d26('0x5f')](_0x2eaba0);return _0xca61f2;}});}else{return;}})[_0x1d26('0x27')](function(_0x14fd57){if(_0x14fd57)_0x103be2=_0x14fd57;return _[_0x1d26('0x3d')](_0x103be2,[_0x1d26('0x63'),0x1]);})[_0x1d26('0x27')](respondWithResult(_0x6e6380,null))['catch'](handleError(_0x6e6380,null));};function hasDefaultDashboard(_0xea164d){var _0x1e13e2=[0x65];return new BPromise(function(_0x13f707,_0x1c49bf){try{if(_0xea164d[_0x1d26('0x58')]){_0x13f707(_0x1e13e2);}else{return db[_0x1d26('0x5b')][_0x1d26('0x67')]({'where':{'sectionId':_0xea164d['id']},'raw':!![]})['then'](function(_0x4bb054){_0x4bb054?_0x13f707(_0x1e13e2):_0x13f707();});}}catch(_0x46554e){_0x1c49bf(_0x46554e);}});}function getCustomDashboards(_0x50ed17){var _0x5e7bf5=[];return new BPromise(function(_0x1dbafb,_0x5f2669){try{if(_0x50ed17[_0x1d26('0x58')]){return db['Dashboard']['findAll']({'raw':!![]})[_0x1d26('0x27')](function(_0x8629e3){_0x8629e3['forEach'](function(_0x4ecf1c){_0x5e7bf5[_0x1d26('0x5f')](_0x4ecf1c['id']+0x1869f);});_0x1dbafb(_0x5e7bf5);});}else{return db[_0x1d26('0x5b')]['findAll']({'where':{'sectionId':_0x50ed17['id']},'raw':!![]})[_0x1d26('0x27')](function(_0x369929){_0x369929[_0x1d26('0x68')](function(_0x275a5f){_0x5e7bf5[_0x1d26('0x5f')](_0x275a5f['resourceId']+0x1869f);});_0x1dbafb(_0x5e7bf5);});}}catch(_0x352ea0){_0x5f2669(_0x352ea0);}});}function getPlugins(_0x425464){var _0x42870c=[];return new BPromise(function(_0x2c435b,_0x4349a9){try{if(_0x425464[_0x1d26('0x58')]){return db[_0x1d26('0x69')]['findAll']({'raw':!![]})[_0x1d26('0x27')](function(_0x488027){_0x488027['forEach'](function(_0x4707b2){_0x42870c[_0x1d26('0x5f')](_0x4707b2['id']+0x15b38);});_0x2c435b(_0x42870c);});}else{return db['UserProfileResource'][_0x1d26('0x45')]({'where':{'sectionId':_0x425464['id']},'raw':!![]})[_0x1d26('0x27')](function(_0xd76850){_0xd76850['forEach'](function(_0x438384){_0x42870c[_0x1d26('0x5f')](_0x438384[_0x1d26('0x6a')]+0x15b38);});_0x2c435b(_0x42870c);});}}catch(_0x142328){_0x4349a9(_0x142328);}});}exports['addResources']=function(_0x13d534,_0x4ba4a4){return db[_0x1d26('0x44')][_0x1d26('0x4c')]({'where':{'id':_0x13d534['params']['id']}})['then'](handleEntityNotFound(_0x4ba4a4,null))[_0x1d26('0x27')](function(_0x4816fe){if(_0x4816fe){return db[_0x1d26('0x54')][_0x1d26('0x55')](function(_0x485d9d){return db['UserProfileSection'][_0x1d26('0x45')]({'where':{'userProfileId':_0x13d534[_0x1d26('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x1d26('0x27')](function(_0x5b851f){if(_0x5b851f){return db[_0x1d26('0x56')][_0x1d26('0x28')]({'where':{'userProfileId':_0x13d534[_0x1d26('0x49')]['id'],'id':_[_0x1d26('0x2c')](_0x5b851f,function(_0x17ec5c){return _0x17ec5c['id'];})},'transaction':_0x485d9d});}})['then'](function(_0x8a87ca){var _0x26cd09=_['map'](_0x13d534['body'],function(_0x5e8850){_0x5e8850[_0x1d26('0x59')]=_0x13d534[_0x1d26('0x49')]['id'];return _0x5e8850;});return db[_0x1d26('0x56')][_0x1d26('0x6b')](_0x26cd09,{'raw':!![],'transaction':_0x485d9d});})[_0x1d26('0x27')](function(_0x49b609){var _0x3b7bf2=_['filter'](_['map'](_0x49b609,function(_0x32ecef){return _0x32ecef[_0x1d26('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x3b7bf2){return db[_0x1d26('0x56')][_0x1d26('0x45')]({'where':{'userProfileId':_0x13d534[_0x1d26('0x49')]['id'],'sectionId':_[_0x1d26('0x2c')](_0x3b7bf2,function(_0x2d8542){return _0x2d8542[_0x1d26('0x5e')];})},'attributes':['id',_0x1d26('0x5e')],'raw':!![]})['then'](function(_0x150317){var _0x48d992=_[_0x1d26('0x2c')](_0x13d534[_0x1d26('0x4e')],function(_0x18272d){_0x18272d[_0x1d26('0x59')]=_0x13d534['params']['id'];return _0x18272d;});return db[_0x1d26('0x5b')][_0x1d26('0x6b')](_0x48d992,{'raw':!![],'transaction':_0x485d9d});});}})['catch'](handleError(_0x4ba4a4,null));});}})[_0x1d26('0x27')](function(_0x206bf7){var _0x14543c=_['map'](_0x206bf7,function(_0x4af8dd){return _0x4af8dd[_0x1d26('0x4f')]({'plain':!![]});});})[_0x1d26('0x27')](respondWithResult(_0x4ba4a4,null))[_0x1d26('0x47')](handleError(_0x4ba4a4,null));};exports[_0x1d26('0x6c')]=function(_0x5a0bb5,_0x4df161,_0x2590e5){return db['UserProfile'][_0x1d26('0x4c')]({'where':{'id':_0x5a0bb5[_0x1d26('0x49')]['id']}})[_0x1d26('0x27')](handleEntityNotFound(_0x4df161,null))[_0x1d26('0x27')](function(_0x3afeeb){if(_0x3afeeb){return _0x3afeeb['removeResources'](_0x5a0bb5[_0x1d26('0x2f')][_0x1d26('0x61')]);}})['then'](respondWithStatusCode(_0x4df161,null))[_0x1d26('0x47')](handleError(_0x4df161,null));};exports[_0x1d26('0x6d')]=function(_0x292268,_0x1eaa9d){var _0x275c30={'raw':![],'where':{}};var _0x5639d4={};var _0x2c791e={'count':0x0,'rows':[]};var _0x4b48f2=_0x292268[_0x1d26('0x2f')]['section'];if(typeof _0x4b48f2===_0x1d26('0x6e')){throw new db['Sequelize'][(_0x1d26('0x6f'))](_0x1d26('0x70'));}var _0x4ec4cc=_0x292268['query'][_0x1d26('0x71')]||![];var _0x421ddb=getQueryModels(_0x4b48f2,_0x4ec4cc);if(typeof _0x421ddb[_0x1d26('0x72')]===_0x1d26('0x6e')){throw new db[(_0x1d26('0x73'))]['ValidationError'](_0x1d26('0x74')+_0x4b48f2+'\x27');}var _0x690546=[];if(!_[_0x1d26('0x65')](_0x421ddb[_0x1d26('0x75')])){_0x690546=_0x421ddb[_0x1d26('0x75')];}else{_0x690546=[{'name':_0x4b48f2}];}return db[_0x1d26('0x44')][_0x1d26('0x67')]({'where':{'id':_0x292268[_0x1d26('0x49')]['id']}})[_0x1d26('0x27')](handleEntityNotFound(_0x1eaa9d,null))[_0x1d26('0x27')](function(_0x316447){if(_0x316447){var _0x2d8039=[];for(var _0xf725eb=0x0;_0xf725eb<_0x690546[_0x1d26('0x4b')];_0xf725eb++){_0x2d8039[_0x1d26('0x5f')](db['UserProfileSection']['findOne']({'where':{'userProfileId':_0x316447['id'],'name':_0x690546[_0xf725eb]['name']},'raw':!![]}));}return BPromise[_0x1d26('0x76')](_0x2d8039);}})[_0x1d26('0x27')](function(_0x5ed3e2){var _0x8450d0=_[_0x1d26('0x3d')](_0x5ed3e2,function(_0x4f4135){return _0x4f4135?_0x4f4135:undefined;});var _0xc8a28c=_[_0x1d26('0x3d')](_0x690546,['ignore',!![]]);var _0x1de759=_[_0x1d26('0x65')](_0x8450d0)&&_[_0x1d26('0x65')](_0xc8a28c)?null:_[_0x1d26('0x77')](_0xc8a28c,_0x8450d0);if(_0x1de759){var _0x427326=[];for(var _0x5e23f7=0x0;_0x5e23f7<_0x1de759['length'];_0x5e23f7++){var _0x31ddff=_[_0x1d26('0x4c')](_0x690546,function(_0x3d2e16){return _0x1de759[_0x5e23f7]?_0x3d2e16[_0x1d26('0x2a')]===_0x1de759[_0x5e23f7][_0x1d26('0x2a')]:null;});if(_0x31ddff){if(_0x1de759[_0x5e23f7][_0x1d26('0x78')]){_0x427326['push'](getAllResources(_0x421ddb[_0x1d26('0x72')],_0x1de759[_0x5e23f7]));}else{if(!_0x1de759[_0x5e23f7]['autoAssociation']){_0x427326[_0x1d26('0x5f')](getAllowedResources(_0x31ddff,_0x1de759[_0x5e23f7],_0x421ddb[_0x1d26('0x72')]));}else{if(_0x31ddff['model']){_0x427326[_0x1d26('0x5f')](getAllFilteredResources(_0x31ddff,_0x1de759[_0x5e23f7]));}}}}}return BPromise[_0x1d26('0x76')](_0x427326);}else{return null;}})[_0x1d26('0x27')](function(_0x3be6ec){var _0x4d06eb=_0x3be6ec;var _0x36ae58=null;if(_0x4d06eb){_0x36ae58=_0x4d06eb['length']===0x1?_0x4d06eb[0x0]:null;}if(_0x36ae58||_0x4d06eb){var _0xc7a4ea=db[_0x421ddb[_0x1d26('0x72')]][_0x1d26('0x4a')];_0x5639d4[_0x1d26('0x33')]=_['keys'](_0xc7a4ea);_0x5639d4[_0x1d26('0x2f')]=_['keys'](_0x292268[_0x1d26('0x2f')]);_0x5639d4[_0x1d26('0x31')]=_[_0x1d26('0x32')](_0x5639d4[_0x1d26('0x33')],_0x5639d4[_0x1d26('0x2f')]);_0x275c30[_0x1d26('0x34')]=_[_0x1d26('0x32')](_0x5639d4[_0x1d26('0x33')],qs[_0x1d26('0x35')](_0x292268[_0x1d26('0x2f')]['fields']));_0x275c30[_0x1d26('0x34')]=_0x275c30[_0x1d26('0x34')]['length']?_0x275c30[_0x1d26('0x34')]:_0x5639d4[_0x1d26('0x33')];if(!_0x292268[_0x1d26('0x2f')]['hasOwnProperty'](_0x1d26('0x37'))){_0x275c30[_0x1d26('0x38')]=qs[_0x1d26('0x38')](_0x292268['query'][_0x1d26('0x38')]);_0x275c30[_0x1d26('0x20')]=qs[_0x1d26('0x20')](_0x292268[_0x1d26('0x2f')]['offset']);}_0x275c30['order']=qs['sort'](_0x292268[_0x1d26('0x2f')][_0x1d26('0x3a')]);_0x275c30[_0x1d26('0x3b')]=qs[_0x1d26('0x31')](_[_0x1d26('0x3c')](_0x292268['query'],_0x5639d4['filters']));if(_0x292268[_0x1d26('0x2f')][_0x1d26('0x3d')]){_0x275c30[_0x1d26('0x3b')]=_[_0x1d26('0x40')](_0x275c30[_0x1d26('0x3b')],{'$or':_['map'](_0xc7a4ea,function(_0x53baee){if(_0x53baee['type'][_0x1d26('0x2e')]!==_0x1d26('0x3f')){var _0x46eab6={};_0x46eab6[_0x53baee[_0x1d26('0x79')]]={'$like':'%'+_0x292268[_0x1d26('0x2f')]['filter']+'%'};return _0x46eab6;}})});}var _0x260130=[];if(_0x36ae58){var _0x7e2f0f=_['find'](_0x690546,[_0x1d26('0x2a'),_0x36ae58[_0x1d26('0x2a')]]);if(_0x7e2f0f[_0x1d26('0x79')]){var _0x311f32={};if(_0x421ddb[_0x1d26('0x72')]===_0x1d26('0x7a')){_0x311f32[_0x7e2f0f[_0x1d26('0x7b')]]=_[_0x1d26('0x2c')](_0x36ae58[_0x1d26('0x7c')],'id');}else{_0x311f32[_0x7e2f0f[_0x1d26('0x7b')]]=_0x36ae58[_0x1d26('0x7c')];}_0x260130[_0x1d26('0x5f')](_0x311f32);}else{_0x275c30['where']['id']=_0x36ae58[_0x1d26('0x7c')];}}else{for(var _0x1c942b=0x0;_0x1c942b<_0x4d06eb['length'];_0x1c942b++){var _0x7e2f0f=_[_0x1d26('0x4c')](_0x690546,['name',_0x4d06eb[_0x1c942b][_0x1d26('0x2a')]]);if(_0x7e2f0f[_0x1d26('0x79')]){var _0x311f32={};_0x311f32[_0x7e2f0f[_0x1d26('0x7b')]]=_0x4d06eb[_0x1c942b][_0x1d26('0x7c')];_0x260130['push'](_0x311f32);}else{if(!_0x275c30[_0x1d26('0x3b')]['id'])_0x275c30[_0x1d26('0x3b')]['id']=[];_0x4d06eb[_0x1c942b][_0x1d26('0x7c')][_0x1d26('0x68')](function(_0x4b14ed){_0x275c30[_0x1d26('0x3b')]['id'][_0x1d26('0x5f')](_0x4b14ed);});}}}if(!_[_0x1d26('0x65')](_0x260130)){_0x275c30['where']=_[_0x1d26('0x40')](_0x275c30['where'],{'$and':{'$or':_0x260130}});}_0x275c30=_[_0x1d26('0x40')]({},_0x275c30,_0x292268[_0x1d26('0x41')]);if(_0x36ae58&&!_0x36ae58['autoAssociation']&&_0x421ddb['childModel']===_0x1d26('0x7a')){if(_0x292268[_0x1d26('0x2f')][_0x1d26('0x42')]){_0x275c30[_0x1d26('0x43')]=[{'all':!![]}];}return db[_0x421ddb[_0x1d26('0x72')]][_0x1d26('0x45')](_0x275c30)['then'](function(_0x520821){var _0x11fbf2=[];_0x520821['forEach'](function(_0x27d6b8){var _0x41a60c;switch(_0x27d6b8[_0x1d26('0x7d')]){case _0x1d26('0x7e'):_0x41a60c=_[_0x1d26('0x4c')](_0x36ae58[_0x1d26('0x7c')],function(_0x49b4bf){return _0x49b4bf['id']===_0x27d6b8[_0x1d26('0x7f')]&&_0x49b4bf['type']===_0x1d26('0x80');});break;case _0x1d26('0x81'):_0x41a60c=_[_0x1d26('0x4c')](_0x36ae58['associatedResources'],function(_0x5ec6b0){return _0x5ec6b0['id']===_0x27d6b8[_0x1d26('0x7f')]&&_0x5ec6b0[_0x1d26('0x3e')]==='CustomReports';});break;}if(_0x41a60c)_0x11fbf2['push'](_0x27d6b8);});_0x2c791e[_0x1d26('0x1f')]=_0x11fbf2['length'];_0x2c791e['rows']=_0x11fbf2;return _0x2c791e;});}else{return db[_0x421ddb[_0x1d26('0x72')]][_0x1d26('0x1f')]({'where':_0x275c30[_0x1d26('0x3b')]})[_0x1d26('0x27')](function(_0x13cb91){_0x2c791e[_0x1d26('0x1f')]=_0x13cb91;if(_0x292268[_0x1d26('0x2f')][_0x1d26('0x42')]){if(_0x421ddb[_0x1d26('0x72')]===_0x1d26('0x82')){_0x275c30[_0x1d26('0x43')]=[{'model':db['Tag'],'as':_0x1d26('0x83'),'attributes':['id','name',_0x1d26('0x84')],'required':_0x292268[_0x1d26('0x2f')]['tag']?!![]:![]},{'model':db[_0x1d26('0x85')],'as':_0x1d26('0x86'),'attributes':['id',_0x1d26('0x2a'),_0x1d26('0x84')],'through':_0x292268[_0x1d26('0x2f')][_0x1d26('0x87')]?{'attributes':[],'where':{'TagId':_0x292268['query'][_0x1d26('0x87')]||undefined}}:{},'required':_0x292268[_0x1d26('0x2f')][_0x1d26('0x87')]?!![]:![]}];}else{_0x275c30[_0x1d26('0x43')]=[{'all':!![]}];}}return db[_0x421ddb[_0x1d26('0x72')]][_0x1d26('0x45')](_0x275c30);})[_0x1d26('0x27')](function(_0x41d17b){_0x2c791e[_0x1d26('0x46')]=_0x41d17b;return _0x2c791e;});}}else{return _0x2c791e;}})[_0x1d26('0x27')](respondWithFilteredResult(_0x1eaa9d,_0x275c30))[_0x1d26('0x47')](handleError(_0x1eaa9d,null));};function getAllResources(_0x1730ad,_0x1bc425){return new BPromise(function(_0x51cb7a,_0x54d2bf){if(_0x1bc425){var _0x39b29b=_0x1bc425[_0x1d26('0x3d')]?{[_0x1bc425[_0x1d26('0x3d')]['field']]:_0x1bc425[_0x1d26('0x3d')][_0x1d26('0x88')]}:undefined;return db[_0x1730ad]['findAll']({'where':_0x39b29b,'raw':!![]})['then'](function(_0x61d4ba){_0x1bc425[_0x1d26('0x7c')]=_[_0x1d26('0x2c')](_0x61d4ba,'id');_0x51cb7a(_0x1bc425);})[_0x1d26('0x47')](function(_0x13c46c){_0x54d2bf(_0x13c46c);});}else{_0x51cb7a(null);}});}function getAllFilteredResources(_0x16cd1b,_0x22d00e){return new BPromise(function(_0x56e951,_0x49b315){var _0x2d4977=_0x16cd1b[_0x1d26('0x3d')]?{[_0x16cd1b[_0x1d26('0x3d')][_0x1d26('0x79')]]:_0x16cd1b[_0x1d26('0x3d')][_0x1d26('0x88')]}:undefined;return db[_0x16cd1b[_0x1d26('0x33')]]['findAll']({'where':_0x2d4977,'raw':!![]})['then'](function(_0x374816){_0x22d00e[_0x1d26('0x7c')]=_[_0x1d26('0x2c')](_0x374816,function(_0x129461){return _0x129461['name'];});_0x56e951(_0x22d00e);})[_0x1d26('0x47')](function(_0x5b0f24){_0x49b315(_0x5b0f24);});});}function getAllowedResources(_0x460db7,_0x52d34e,_0x21374c){return new BPromise(function(_0x58def2,_0x54ffa9){if(_0x52d34e){return db['UserProfileResource'][_0x1d26('0x45')]({'where':{'sectionId':_0x52d34e['id']},'raw':!![]})[_0x1d26('0x27')](function(_0x5a6e1c){if(_0x460db7[_0x1d26('0x79')]&&_0x460db7[_0x1d26('0x79')]!=='id'){_0x52d34e[_0x1d26('0x7c')]=_['map'](_0x5a6e1c,function(_0x59d90b){return _0x59d90b[_0x460db7[_0x1d26('0x79')]];});}else{if(_0x21374c===_0x1d26('0x7a')){_0x52d34e[_0x1d26('0x7c')]=_[_0x1d26('0x2c')](_0x5a6e1c,function(_0x3a3ff5){return{'id':_0x3a3ff5[_0x1d26('0x6a')],'type':_0x3a3ff5[_0x1d26('0x3e')]};});}else{_0x52d34e[_0x1d26('0x7c')]=_['map'](_0x5a6e1c,function(_0x2dcf5a){return _0x2dcf5a[_0x1d26('0x6a')];});}}_0x58def2(_0x52d34e);})[_0x1d26('0x47')](function(_0x5ee6c0){_0x54ffa9(_0x5ee6c0);});}else{_0x58def2(null);}});}function getQueryModels(_0x56c639,_0x37864d){var _0x3a94af=_0x56c639[_0x1d26('0x89')]();var _0x3043e4={'childModel':undefined,'parentSections':[]};switch(_0x3a94af){case'squareprojects':_0x3043e4[_0x1d26('0x72')]=_0x1d26('0x8a');break;case'odbc':_0x3043e4[_0x1d26('0x72')]=_0x1d26('0x8b');break;case _0x1d26('0x8c'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0x8d');_0x3043e4[_0x1d26('0x75')]=[{'name':_0x1d26('0x8e'),'field':_0x1d26('0x2a'),'foreignKey':'projectName'}];break;case _0x1d26('0x8f'):_0x3043e4[_0x1d26('0x72')]='JscriptyProject';break;case _0x1d26('0x90'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0x82');_0x3043e4[_0x1d26('0x75')]=[{'name':_0x1d26('0x91'),'field':'id','foreignKey':_0x1d26('0x92')}];break;case'lists':_0x3043e4['childModel']=_0x1d26('0x93');break;case _0x1d26('0x94'):_0x3043e4['childModel']=_0x1d26('0x95');break;case _0x1d26('0x96'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0x97');break;case'chatqueues':_0x3043e4[_0x1d26('0x72')]=_0x1d26('0x98');break;case'chatwebsites':_0x3043e4[_0x1d26('0x72')]=_0x1d26('0x99');break;case _0x1d26('0x9a'):_0x3043e4[_0x1d26('0x72')]='FaxQueue';break;case'faxaccounts':_0x3043e4[_0x1d26('0x72')]=_0x1d26('0x9b');break;case _0x1d26('0x9c'):case _0x1d26('0x9d'):case _0x1d26('0x9e'):_0x3043e4['childModel']=_0x1d26('0x9f');break;case _0x1d26('0xa0'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xa1');break;case _0x1d26('0xa2'):_0x3043e4['childModel']=_0x1d26('0xa3');break;case'voicerecordings':_0x3043e4['childModel']=_0x1d26('0xa4');_0x3043e4['parentSections']=[{'name':_0x1d26('0xa5'),'field':_0x1d26('0x2a'),'foreignKey':_0x1d26('0xa6'),'model':_0x1d26('0xa7'),'filter':{'field':'role','value':[_0x1d26('0xa8')]}},{'name':_0x1d26('0xa9'),'field':'name','foreignKey':_0x1d26('0xa6'),'model':_0x1d26('0xa7'),'filter':{'field':_0x1d26('0xaa'),'value':[_0x1d26('0xab')]}},{'name':_0x1d26('0xac'),'field':_0x1d26('0x2a'),'foreignKey':'queue','model':_0x1d26('0xad'),'filter':{'field':'type','value':['inbound']}},{'name':_0x1d26('0xae'),'field':'name','foreignKey':'queue','model':_0x1d26('0xad'),'filter':{'field':_0x1d26('0x3e'),'value':['outbound']}}];break;case _0x1d26('0xaf'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xb0');break;case'chanspies':_0x3043e4['childModel']=_0x1d26('0xb1');break;case'voiceprefixes':_0x3043e4['childModel']='VoicePrefix';break;case _0x1d26('0xb2'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xb3');break;case _0x1d26('0xb4'):_0x3043e4['childModel']='MailQueue';break;case _0x1d26('0xb5'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xb6');break;case _0x1d26('0xb7'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xb8');break;case _0x1d26('0xb9'):_0x3043e4['childModel']=_0x1d26('0xba');break;case'openchannelaccounts':_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xbb');break;case _0x1d26('0xbc'):_0x3043e4[_0x1d26('0x72')]='SmsQueue';break;case _0x1d26('0xbd'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xbe');break;case _0x1d26('0xbf'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xc0');break;case _0x1d26('0xc1'):case _0x1d26('0xc2'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xad');if(_0x37864d){_0x3043e4['parentSections']=[{'name':_0x1d26('0xac')},{'name':_0x1d26('0xae')}];}break;case _0x1d26('0xc3'):case _0x1d26('0xc4'):case'telephones':_0x3043e4['childModel']='User';if(_0x37864d){_0x3043e4['parentSections']=[{'name':_0x1d26('0xc5'),'filter':{'field':'role','value':[_0x1d26('0xc6'),_0x1d26('0xc7')]},'ignore':!![]},{'name':_0x1d26('0xa5')},{'name':_0x1d26('0xa9')}];}break;case _0x1d26('0xc8'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xc9');break;case _0x1d26('0xca'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xcb');break;case _0x1d26('0xcc'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xcd');break;case _0x1d26('0xce'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xcf');break;case _0x1d26('0xd0'):_0x3043e4['childModel']=_0x1d26('0xd1');break;case _0x1d26('0xd2'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xd3');break;case'vtigeraccounts':_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xa7');break;case _0x1d26('0xd4'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xd5');break;case'dispositions':_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xd6');break;case _0x1d26('0xd7'):_0x3043e4[_0x1d26('0x72')]='Dashboard';break;case _0x1d26('0xd8'):_0x3043e4['childModel']=_0x1d26('0xd9');break;case _0x1d26('0xda'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xdb');break;case _0x1d26('0xdc'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xdd');break;case _0x1d26('0xde'):_0x3043e4[_0x1d26('0x72')]='Sound';break;case _0x1d26('0xdf'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0x85');break;case _0x1d26('0xe0'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xe1');break;case'triggers':_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xe2');break;case'trunks':_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xe3');break;case _0x1d26('0xe4'):_0x3043e4[_0x1d26('0x72')]=_0x1d26('0xe5');break;case'plugins':_0x3043e4[_0x1d26('0x72')]=_0x1d26('0x69');break;case _0x1d26('0xe6'):_0x3043e4[_0x1d26('0x72')]='AnalyticExtractedReport';_0x3043e4[_0x1d26('0x75')]=[{'name':_0x1d26('0xe7'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x3043e4['childModel']='AnalyticMetric';break;default:return _0x3043e4;}return _0x3043e4;} \ No newline at end of file +var _0x4afd=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./userProfile.socket','sendStatus','status','end','count','offset','limit','set','json','save','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','clone','omit','createdAt','updatedAt','crudPermissions','body','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','sequelize','push','get','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Sequelize','ValidationError','mergeResources','childModel','undefined','Invalid\x20section\x20\x27','parentSections','findOne','all','union','ignore','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','reportId','DefaultReports','custom','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareProjects','projectName','projects','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxaccounts','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','telephone','VoiceQueues','queue','VoiceQueue','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','mailqueues','MailQueue','mailaccounts','MailAccount','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','users','telephones','User','Users','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','intervals','Interval','pauses','Pause','scheduler','Schedule','Sound','tags','templates','triggers','Trigger','variables','plugins','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','rimraf'];(function(_0x4ad7fb,_0x438d26){var _0x3cbb8b=function(_0x341c3d){while(--_0x341c3d){_0x4ad7fb['push'](_0x4ad7fb['shift']());}};_0x3cbb8b(++_0x438d26);}(_0x4afd,0xe7));var _0xd4af=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x4afd[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0xd4af('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd4af('0x1'));var zipdir=require(_0xd4af('0x2'));var jsonpatch=require(_0xd4af('0x3'));var rp=require(_0xd4af('0x4'));var moment=require(_0xd4af('0x5'));var BPromise=require(_0xd4af('0x6'));var Mustache=require('mustache');var util=require(_0xd4af('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd4af('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd4af('0x9'));var crypto=require(_0xd4af('0xa'));var jsforce=require(_0xd4af('0xb'));var deskjs=require(_0xd4af('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd4af('0xd'));var Papa=require(_0xd4af('0xe'));var Redis=require(_0xd4af('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd4af('0x10'));var as=require(_0xd4af('0x11'));var hardwareService=require(_0xd4af('0x12'));var logger=require(_0xd4af('0x13'))(_0xd4af('0x14'));var utils=require(_0xd4af('0x15'));var config=require(_0xd4af('0x16'));var db=require(_0xd4af('0x17'))['db'];config['redis']=_[_0xd4af('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd4af('0x19')]));require(_0xd4af('0x1a'))['register'](socket);function respondWithStatusCode(_0x361723,_0x387785){_0x387785=_0x387785||0xcc;return function(_0x9962c9){if(_0x9962c9){return _0x361723[_0xd4af('0x1b')](_0x387785);}return _0x361723[_0xd4af('0x1c')](_0x387785)[_0xd4af('0x1d')]();};}function respondWithResult(_0x4499bd,_0x3dc601){_0x3dc601=_0x3dc601||0xc8;return function(_0x5c9b7b){if(_0x5c9b7b){return _0x4499bd[_0xd4af('0x1c')](_0x3dc601)['json'](_0x5c9b7b);}};}function respondWithFilteredResult(_0x20b5ee,_0x3a4d10){return function(_0x4288e4){if(_0x4288e4){var _0x3ee842=_0x4288e4[_0xd4af('0x1e')],_0x1ba6b6=_0x3a4d10['offset'],_0x28fb17=_0x3a4d10[_0xd4af('0x1f')]+_0x3a4d10[_0xd4af('0x20')],_0x5f5b2b;if(_0x28fb17>=_0x3ee842){_0x28fb17=_0x3ee842;_0x5f5b2b=0xc8;}else{_0x5f5b2b=0xce;}_0x20b5ee[_0xd4af('0x1c')](_0x5f5b2b);return _0x20b5ee[_0xd4af('0x21')]('Content-Range',_0x1ba6b6+'-'+_0x28fb17+'/'+_0x3ee842)[_0xd4af('0x22')](_0x4288e4);}return null;};}function patchUpdates(_0x3ffab9){return function(_0x2ecaee){try{jsonpatch['apply'](_0x2ecaee,_0x3ffab9,!![]);}catch(_0x28c8a8){return BPromise['reject'](_0x28c8a8);}return _0x2ecaee[_0xd4af('0x23')]();};}function saveUpdates(_0x5490a2,_0x53b5f1){return function(_0x1e7d41){if(_0x1e7d41){return _0x1e7d41['update'](_0x5490a2)[_0xd4af('0x24')](function(_0x25540b){return _0x25540b;});}return null;};}function removeEntity(_0x1ef564,_0x2cf91c){return function(_0x258bb3){if(_0x258bb3){return _0x258bb3[_0xd4af('0x25')]()['then'](function(){_0x1ef564[_0xd4af('0x1c')](0xcc)[_0xd4af('0x1d')]();});}};}function handleEntityNotFound(_0x2af222,_0x278c1c){return function(_0x4f18db){if(!_0x4f18db){_0x2af222['sendStatus'](0x194);}return _0x4f18db;};}function handleError(_0x4e58d4,_0x303449){_0x303449=_0x303449||0x1f4;return function(_0x6801b5){logger[_0xd4af('0x26')](_0x6801b5[_0xd4af('0x27')]);if(_0x6801b5[_0xd4af('0x28')]){delete _0x6801b5[_0xd4af('0x28')];}_0x4e58d4[_0xd4af('0x1c')](_0x303449)[_0xd4af('0x29')](_0x6801b5);};}exports[_0xd4af('0x2a')]=function(_0x4455a8,_0x16f564){var _0x416824={},_0x1e875f={},_0x552927={'count':0x0,'rows':[]};var _0x5da6d8=_[_0xd4af('0x2b')](db[_0xd4af('0x2c')][_0xd4af('0x2d')],function(_0x1f4655){return{'name':_0x1f4655[_0xd4af('0x2e')],'type':_0x1f4655[_0xd4af('0x2f')][_0xd4af('0x30')]};});_0x1e875f[_0xd4af('0x31')]=_[_0xd4af('0x2b')](_0x5da6d8,_0xd4af('0x28'));_0x1e875f['query']=_['keys'](_0x4455a8[_0xd4af('0x32')]);_0x1e875f[_0xd4af('0x33')]=_[_0xd4af('0x34')](_0x1e875f['model'],_0x1e875f['query']);_0x416824['attributes']=_[_0xd4af('0x34')](_0x1e875f['model'],qs[_0xd4af('0x35')](_0x4455a8['query'][_0xd4af('0x35')]));_0x416824[_0xd4af('0x36')]=_0x416824[_0xd4af('0x36')][_0xd4af('0x37')]?_0x416824['attributes']:_0x1e875f[_0xd4af('0x31')];if(!_0x4455a8[_0xd4af('0x32')][_0xd4af('0x38')](_0xd4af('0x39'))){_0x416824['limit']=qs['limit'](_0x4455a8[_0xd4af('0x32')]['limit']);_0x416824[_0xd4af('0x1f')]=qs[_0xd4af('0x1f')](_0x4455a8[_0xd4af('0x32')][_0xd4af('0x1f')]);}_0x416824['order']=qs[_0xd4af('0x3a')](_0x4455a8[_0xd4af('0x32')]['sort']);_0x416824[_0xd4af('0x3b')]=qs[_0xd4af('0x33')](_[_0xd4af('0x3c')](_0x4455a8[_0xd4af('0x32')],_0x1e875f[_0xd4af('0x33')]));if(_0x4455a8[_0xd4af('0x32')]['filter']){_0x416824[_0xd4af('0x3b')]=_[_0xd4af('0x3d')](_0x416824[_0xd4af('0x3b')],{'$or':_[_0xd4af('0x2b')](_0x5da6d8,function(_0x52dce9){if(_0x52dce9[_0xd4af('0x2f')]!==_0xd4af('0x3e')){var _0x206b59={};_0x206b59[_0x52dce9[_0xd4af('0x28')]]={'$like':'%'+_0x4455a8['query'][_0xd4af('0x3f')]+'%'};return _0x206b59;}})});}_0x416824=_['merge']({},_0x416824,_0x4455a8[_0xd4af('0x40')]);var _0x3d4838={'where':_0x416824[_0xd4af('0x3b')]};return db[_0xd4af('0x2c')][_0xd4af('0x1e')](_0x3d4838)[_0xd4af('0x24')](function(_0x595bea){_0x552927['count']=_0x595bea;if(_0x4455a8['query'][_0xd4af('0x41')]){_0x416824[_0xd4af('0x42')]=[{'all':!![]}];}return db['UserProfile'][_0xd4af('0x43')](_0x416824);})['then'](function(_0x5990ef){_0x552927[_0xd4af('0x44')]=_0x5990ef;return _0x552927;})['then'](respondWithFilteredResult(_0x16f564,_0x416824))[_0xd4af('0x45')](handleError(_0x16f564,null));};exports[_0xd4af('0x46')]=function(_0x2f0007,_0x25282d){var _0x4d92b4={'raw':![],'where':{'id':_0x2f0007[_0xd4af('0x47')]['id']}},_0x4d9d1c={};_0x4d9d1c['model']=_[_0xd4af('0x48')](db['UserProfile']['rawAttributes']);_0x4d9d1c[_0xd4af('0x32')]=_['keys'](_0x2f0007[_0xd4af('0x32')]);_0x4d9d1c[_0xd4af('0x33')]=_['intersection'](_0x4d9d1c['model'],_0x4d9d1c[_0xd4af('0x32')]);_0x4d92b4[_0xd4af('0x36')]=_['intersection'](_0x4d9d1c[_0xd4af('0x31')],qs[_0xd4af('0x35')](_0x2f0007['query'][_0xd4af('0x35')]));_0x4d92b4[_0xd4af('0x36')]=_0x4d92b4['attributes']['length']?_0x4d92b4[_0xd4af('0x36')]:_0x4d9d1c[_0xd4af('0x31')];if(_0x2f0007['query'][_0xd4af('0x41')]){_0x4d92b4[_0xd4af('0x42')]=[{'all':!![]}];}_0x4d92b4=_[_0xd4af('0x3d')]({},_0x4d92b4,_0x2f0007[_0xd4af('0x40')]);return db[_0xd4af('0x2c')][_0xd4af('0x49')](_0x4d92b4)['then'](handleEntityNotFound(_0x25282d,null))['then'](respondWithResult(_0x25282d,null))[_0xd4af('0x45')](handleError(_0x25282d,null));};exports[_0xd4af('0x4a')]=function(_0x3d7a48,_0x4aaf24){return db[_0xd4af('0x2c')][_0xd4af('0x4a')](_0x3d7a48['body'],{})[_0xd4af('0x24')](respondWithResult(_0x4aaf24,0xc9))[_0xd4af('0x45')](handleError(_0x4aaf24,null));};exports[_0xd4af('0x4b')]=function(_0x45d3e8,_0x332389){var _0x295d10={'where':{'id':_0x45d3e8[_0xd4af('0x47')]['id']}},_0x911f22={};_0x911f22['model']=_[_0xd4af('0x48')](db[_0xd4af('0x2c')]['rawAttributes']);_0x295d10[_0xd4af('0x36')]=_['intersection'](_0x911f22['model'],qs[_0xd4af('0x35')](_0x45d3e8[_0xd4af('0x32')][_0xd4af('0x35')]));_0x295d10[_0xd4af('0x36')]=_0x295d10[_0xd4af('0x36')]['length']?_0x295d10[_0xd4af('0x36')]:_0x911f22['model'];if(_0x45d3e8[_0xd4af('0x32')]['includeAll']){_0x295d10[_0xd4af('0x42')]=[{'all':!![]}];}_0x295d10=_[_0xd4af('0x3d')]({},_0x295d10,_0x45d3e8[_0xd4af('0x40')]);return db['UserProfile'][_0xd4af('0x49')](_0x295d10)[_0xd4af('0x24')](handleEntityNotFound(_0x332389,null))[_0xd4af('0x24')](function(_0x5f0099){if(_0x5f0099){var _0x4ab816=_0x5f0099['get']({'plain':!![]});_0x4ab816=qs[_0xd4af('0x4c')](_0x4ab816,['id',_0xd4af('0x4d'),_0xd4af('0x4e'),_0xd4af('0x4f')]);_0x45d3e8['body']=_[_0xd4af('0x4c')](_0x45d3e8[_0xd4af('0x50')],['id','createdAt',_0xd4af('0x4e')]);return db['sequelize'][_0xd4af('0x51')](function(_0xde2a74){return db['UserProfile'][_0xd4af('0x4a')](_[_0xd4af('0x3d')](_0x4ab816,_0x45d3e8[_0xd4af('0x50')]),{'include':_0x45d3e8['query'][_0xd4af('0x41')]?[{'all':!![]}]:undefined,'transaction':_0xde2a74})[_0xd4af('0x24')](function(_0x4c6da7){var _0x23f2e7=_0x4c6da7['get']({'plain':!![]});return db[_0xd4af('0x52')][_0xd4af('0x43')]({'where':{'userProfileId':_0x45d3e8[_0xd4af('0x47')]['id']},'raw':!![]})['then'](function(_0x3a2d13){if(_0x3a2d13){return BPromise[_0xd4af('0x53')](_0x3a2d13,function(_0x7f1177){return new BPromise(function(_0x24ade2,_0x55c320){if(_0x7f1177['autoAssociation']===null||_0x7f1177[_0xd4af('0x54')]===0x1)_0x24ade2(null);return db[_0xd4af('0x55')][_0xd4af('0x43')]({'where':{'sectionId':_0x7f1177['id']},'raw':!![]})[_0xd4af('0x24')](function(_0xd5096b){var _0x35bdcf=_[_0xd4af('0x2b')](_0xd5096b,function(_0xcd0e7d){return qs[_0xd4af('0x4c')](_0xcd0e7d,['id',_0xd4af('0x4d'),_0xd4af('0x4e'),_0xd4af('0x56')]);});_0x24ade2(_0x35bdcf);})[_0xd4af('0x45')](function(_0x380f3a){_0x55c320(_0x380f3a);});})[_0xd4af('0x24')](function(_0x253ddb){var _0x5a6fb7=qs[_0xd4af('0x4c')](_0x7f1177,['id','createdAt',_0xd4af('0x4e')]);_0x5a6fb7[_0xd4af('0x57')]=_0x23f2e7['id'];if(_0x253ddb)_0x5a6fb7[_0xd4af('0x58')]=_0x253ddb;return _0x5a6fb7;})[_0xd4af('0x24')](function(_0x9001cc){return db[_0xd4af('0x52')]['create'](_0x9001cc,{'include':[{'model':db[_0xd4af('0x55')],'as':_0xd4af('0x58')}],'raw':!![],'transaction':_0xde2a74});});})[_0xd4af('0x24')](function(){return _0x23f2e7;});}});});});}})[_0xd4af('0x24')](respondWithResult(_0x332389,0xc9))[_0xd4af('0x45')](handleError(_0x332389,null));};exports['update']=function(_0x429c9e,_0x3a2aee){if(_0x429c9e[_0xd4af('0x50')]['id']){delete _0x429c9e['body']['id'];}return db[_0xd4af('0x2c')]['find']({'where':{'id':_0x429c9e[_0xd4af('0x47')]['id']}})[_0xd4af('0x24')](handleEntityNotFound(_0x3a2aee,null))[_0xd4af('0x24')](saveUpdates(_0x429c9e[_0xd4af('0x50')],null))[_0xd4af('0x24')](respondWithResult(_0x3a2aee,null))['catch'](handleError(_0x3a2aee,null));};exports[_0xd4af('0x25')]=function(_0x1d71ce,_0x13be7b){return db[_0xd4af('0x2c')][_0xd4af('0x49')]({'where':{'id':_0x1d71ce[_0xd4af('0x47')]['id']}})[_0xd4af('0x24')](handleEntityNotFound(_0x13be7b,null))[_0xd4af('0x24')](removeEntity(_0x13be7b,null))['catch'](handleError(_0x13be7b,null));};exports[_0xd4af('0x59')]=function(_0x5adbed,_0x270977){return db[_0xd4af('0x2c')][_0xd4af('0x59')]()[_0xd4af('0x24')](respondWithResult(_0x270977,null))[_0xd4af('0x45')](handleError(_0x270977,null));};exports[_0xd4af('0x5a')]=function(_0x1afaf2,_0x4d36ab){var _0x25c2c6=_0x1afaf2[_0xd4af('0x50')];return db[_0xd4af('0x2c')][_0xd4af('0x49')]({'where':{'id':_0x1afaf2[_0xd4af('0x47')]['id']}})['then'](handleEntityNotFound(_0x4d36ab,null))[_0xd4af('0x24')](function(_0x53ba7a){if(_0x53ba7a){return db[_0xd4af('0x5b')][_0xd4af('0x51')](function(_0x468c6c){return db[_0xd4af('0x52')]['destroy']({'where':{'userProfileId':_0x1afaf2[_0xd4af('0x47')]['id'],'sectionId':_[_0xd4af('0x2b')](_0x25c2c6,function(_0x16d31e){return _0x16d31e[_0xd4af('0x56')];})},'transaction':_0x468c6c})[_0xd4af('0x24')](function(){var _0x3bf040=_[_0xd4af('0x2b')](_0x25c2c6,function(_0x3bf1f2){_0x3bf1f2[_0xd4af('0x57')]=_0x1afaf2[_0xd4af('0x47')]['id'];return _0x3bf1f2;});var _0x3983a9=[];return BPromise[_0xd4af('0x53')](_0x3bf040,function(_0x25e360){return db[_0xd4af('0x52')][_0xd4af('0x4a')](_0x25e360,{'include':[{'model':db[_0xd4af('0x55')],'as':_0xd4af('0x58')}],'raw':!![],'transaction':_0x468c6c})[_0xd4af('0x24')](function(_0x1aacdc){_0x3983a9[_0xd4af('0x5c')](_0x1aacdc[_0xd4af('0x5d')]({'plain':!![]}));});})[_0xd4af('0x24')](function(){return _0x3983a9;});});});}})['then'](function(_0x139a34){return _0x139a34;})[_0xd4af('0x24')](respondWithResult(_0x4d36ab,null))['catch'](handleError(_0x4d36ab,null));};exports[_0xd4af('0x5e')]=function(_0x374e73,_0xb6abf0){var _0x12e3bb;return db[_0xd4af('0x2c')]['find']({'where':{'id':_0x374e73[_0xd4af('0x47')]['id']},'attributes':['id',_0xd4af('0x28')]})[_0xd4af('0x24')](handleEntityNotFound(_0xb6abf0,null))[_0xd4af('0x24')](function(_0x13e1c3){if(_0x13e1c3){_0x12e3bb=_0x13e1c3;return db['UserProfileSection'][_0xd4af('0x25')]({'where':{'userProfileId':_0x374e73[_0xd4af('0x47')]['id'],'sectionId':_0x374e73['query'][_0xd4af('0x5f')]}});}})[_0xd4af('0x24')](function(){return _0x12e3bb;})[_0xd4af('0x24')](respondWithStatusCode(_0xb6abf0,null))[_0xd4af('0x45')](handleError(_0xb6abf0,null));};exports[_0xd4af('0x60')]=function(_0x481d19,_0xe993f4){var _0x427b54=[];var _0xadf615=[];return db[_0xd4af('0x52')][_0xd4af('0x43')]({'where':{'userProfileId':_0x481d19[_0xd4af('0x47')]['id']},'raw':!![]})[_0xd4af('0x24')](function(_0x5802a9){_0x427b54=_[_0xd4af('0x3f')](_0x5802a9,function(_0x246745){return _0x246745[_0xd4af('0x61')]===0x1||_[_0xd4af('0x62')]([0x3eb,0x709],_0x246745['sectionId']);});if(!_[_0xd4af('0x63')](_0x427b54)){return _['map'](_0x427b54,function(_0x2631e6){return _0x2631e6[_0xd4af('0x56')];});}else{return;}})[_0xd4af('0x24')](function(_0x2e785d){if(_0x2e785d)_0xadf615=_0x2e785d;if(_[_0xd4af('0x62')](_0xadf615,0x64)){var _0x28454a=_[_0xd4af('0x49')](_0x427b54,{'sectionId':0x64});return hasDefaultDashboard(_0x28454a)[_0xd4af('0x24')](function(_0x210b70){return _[_0xd4af('0x2b')](_0x427b54,function(_0x4448b1){if(_0x4448b1[_0xd4af('0x56')]===0x64){_0x4448b1[_0xd4af('0x64')]=_0x210b70;}return _0x4448b1;});});}else{return;}})[_0xd4af('0x24')](function(_0x5f0993){if(_0x5f0993)_0x427b54=_0x5f0993;if(_[_0xd4af('0x62')](_0xadf615,0x3eb)){var _0x17df10=_[_0xd4af('0x49')](_0x427b54,{'sectionId':0x3eb});return getCustomDashboards(_0x17df10)[_0xd4af('0x24')](function(_0x59981a){return _['map'](_0x427b54,function(_0x40a942){if(_0x17df10[_0xd4af('0x61')]){if(_0x40a942[_0xd4af('0x56')]===0x3eb){_0x40a942[_0xd4af('0x64')]=_0x59981a;}}else{if(_0x40a942[_0xd4af('0x56')]===0x64){_0x40a942['subsections']=_0x59981a;}}return _0x40a942;});});}else{return;}})[_0xd4af('0x24')](function(_0x559a75){if(_0x559a75)_0x427b54=_0x559a75;if(_[_0xd4af('0x62')](_0xadf615,0x709)){var _0x4e5e48=_['find'](_0x427b54,{'sectionId':0x709});return getPlugins(_0x4e5e48)['then'](function(_0x2c9bcb){if(_0x4e5e48[_0xd4af('0x61')]){return _[_0xd4af('0x2b')](_0x427b54,function(_0x42247){if(_0x42247[_0xd4af('0x56')]===0x709){_0x42247[_0xd4af('0x64')]=_0x2c9bcb;}return _0x42247;});}else{var _0x58fc6c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2c9bcb};var _0x3c0663=_[_0xd4af('0x2b')](_0x427b54);_0x3c0663['push'](_0x58fc6c);return _0x3c0663;}});}else{return;}})[_0xd4af('0x24')](function(_0x4a77c6){if(_0x4a77c6)_0x427b54=_0x4a77c6;return _[_0xd4af('0x3f')](_0x427b54,['enabled',0x1]);})[_0xd4af('0x24')](respondWithResult(_0xe993f4,null))[_0xd4af('0x45')](handleError(_0xe993f4,null));};function hasDefaultDashboard(_0x198bba){var _0x2e9f21=[0x65];return new BPromise(function(_0x2eba0b,_0x1009fc){try{if(_0x198bba[_0xd4af('0x54')]){_0x2eba0b(_0x2e9f21);}else{return db[_0xd4af('0x55')]['findOne']({'where':{'sectionId':_0x198bba['id']},'raw':!![]})['then'](function(_0x5754d6){_0x5754d6?_0x2eba0b(_0x2e9f21):_0x2eba0b();});}}catch(_0x5573c4){_0x1009fc(_0x5573c4);}});}function getCustomDashboards(_0x18138f){var _0x1cd421=[];return new BPromise(function(_0x1c3f23,_0x1d2e53){try{if(_0x18138f[_0xd4af('0x54')]){return db[_0xd4af('0x65')][_0xd4af('0x43')]({'raw':!![]})[_0xd4af('0x24')](function(_0x5537c5){_0x5537c5['forEach'](function(_0x4c6f01){_0x1cd421[_0xd4af('0x5c')](_0x4c6f01['id']+0x1869f);});_0x1c3f23(_0x1cd421);});}else{return db['UserProfileResource'][_0xd4af('0x43')]({'where':{'sectionId':_0x18138f['id']},'raw':!![]})[_0xd4af('0x24')](function(_0x319793){_0x319793[_0xd4af('0x66')](function(_0x458c24){_0x1cd421[_0xd4af('0x5c')](_0x458c24[_0xd4af('0x67')]+0x1869f);});_0x1c3f23(_0x1cd421);});}}catch(_0x1b189){_0x1d2e53(_0x1b189);}});}function getPlugins(_0x3485e1){var _0x155210=[];return new BPromise(function(_0x422442,_0x561b6d){try{if(_0x3485e1[_0xd4af('0x54')]){return db[_0xd4af('0x68')]['findAll']({'raw':!![]})['then'](function(_0x4e6a14){_0x4e6a14[_0xd4af('0x66')](function(_0x475aed){_0x155210[_0xd4af('0x5c')](_0x475aed['id']+0x15b38);});_0x422442(_0x155210);});}else{return db[_0xd4af('0x55')][_0xd4af('0x43')]({'where':{'sectionId':_0x3485e1['id']},'raw':!![]})[_0xd4af('0x24')](function(_0x2fb067){_0x2fb067[_0xd4af('0x66')](function(_0x5aee93){_0x155210['push'](_0x5aee93[_0xd4af('0x67')]+0x15b38);});_0x422442(_0x155210);});}}catch(_0xe84b74){_0x561b6d(_0xe84b74);}});}exports[_0xd4af('0x69')]=function(_0x388896,_0x3059b4){return db['UserProfile'][_0xd4af('0x49')]({'where':{'id':_0x388896[_0xd4af('0x47')]['id']}})[_0xd4af('0x24')](handleEntityNotFound(_0x3059b4,null))['then'](function(_0x13cd3a){if(_0x13cd3a){return db[_0xd4af('0x5b')]['transaction'](function(_0x22c5f0){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x388896[_0xd4af('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0xd4af('0x24')](function(_0x22a1c1){if(_0x22a1c1){return db[_0xd4af('0x52')][_0xd4af('0x25')]({'where':{'userProfileId':_0x388896['params']['id'],'id':_['map'](_0x22a1c1,function(_0x12d09e){return _0x12d09e['id'];})},'transaction':_0x22c5f0});}})[_0xd4af('0x24')](function(_0x31486a){var _0x520e57=_[_0xd4af('0x2b')](_0x388896[_0xd4af('0x50')],function(_0x2cf65d){_0x2cf65d[_0xd4af('0x57')]=_0x388896[_0xd4af('0x47')]['id'];return _0x2cf65d;});return db[_0xd4af('0x52')][_0xd4af('0x6a')](_0x520e57,{'raw':!![],'transaction':_0x22c5f0});})['then'](function(_0x455677){var _0x5e5018=_[_0xd4af('0x3f')](_['map'](_0x455677,function(_0x2fc32d){return _0x2fc32d['get']({'plain':!![]});}),{'includeAll':![]});if(_0x5e5018){return db[_0xd4af('0x52')]['findAll']({'where':{'userProfileId':_0x388896[_0xd4af('0x47')]['id'],'sectionId':_[_0xd4af('0x2b')](_0x5e5018,function(_0x14dc20){return _0x14dc20[_0xd4af('0x56')];})},'attributes':['id',_0xd4af('0x56')],'raw':!![]})['then'](function(_0x5a89c4){var _0x3df7a1=_[_0xd4af('0x2b')](_0x388896[_0xd4af('0x50')],function(_0x52fe96){_0x52fe96[_0xd4af('0x57')]=_0x388896[_0xd4af('0x47')]['id'];return _0x52fe96;});return db[_0xd4af('0x55')]['bulkCreate'](_0x3df7a1,{'raw':!![],'transaction':_0x22c5f0});});}})[_0xd4af('0x45')](handleError(_0x3059b4,null));});}})[_0xd4af('0x24')](function(_0xdbcf2){var _0x25c576=_[_0xd4af('0x2b')](_0xdbcf2,function(_0x2a56dd){return _0x2a56dd[_0xd4af('0x5d')]({'plain':!![]});});})['then'](respondWithResult(_0x3059b4,null))[_0xd4af('0x45')](handleError(_0x3059b4,null));};exports[_0xd4af('0x6b')]=function(_0x50b770,_0x3907e0,_0x27524b){return db[_0xd4af('0x2c')][_0xd4af('0x49')]({'where':{'id':_0x50b770['params']['id']}})[_0xd4af('0x24')](handleEntityNotFound(_0x3907e0,null))[_0xd4af('0x24')](function(_0x53f68c){if(_0x53f68c){return _0x53f68c[_0xd4af('0x6b')](_0x50b770[_0xd4af('0x32')][_0xd4af('0x5f')]);}})[_0xd4af('0x24')](respondWithStatusCode(_0x3907e0,null))[_0xd4af('0x45')](handleError(_0x3907e0,null));};exports[_0xd4af('0x6c')]=function(_0x1b7494,_0x4343de){var _0x438143={'raw':![],'where':{}};var _0x5b8915={};var _0x37176a={'count':0x0,'rows':[]};var _0x27db41=_0x1b7494[_0xd4af('0x32')][_0xd4af('0x6d')];if(typeof _0x27db41==='undefined'){throw new db[(_0xd4af('0x6e'))][(_0xd4af('0x6f'))]('Unknown\x20section');}var _0x2d7272=_0x1b7494['query'][_0xd4af('0x70')]||![];var _0x2c4c05=getQueryModels(_0x27db41,_0x2d7272);if(typeof _0x2c4c05[_0xd4af('0x71')]===_0xd4af('0x72')){throw new db[(_0xd4af('0x6e'))]['ValidationError'](_0xd4af('0x73')+_0x27db41+'\x27');}var _0x6aeb80=[];if(!_[_0xd4af('0x63')](_0x2c4c05[_0xd4af('0x74')])){_0x6aeb80=_0x2c4c05[_0xd4af('0x74')];}else{_0x6aeb80=[{'name':_0x27db41}];}return db['UserProfile'][_0xd4af('0x75')]({'where':{'id':_0x1b7494[_0xd4af('0x47')]['id']}})[_0xd4af('0x24')](handleEntityNotFound(_0x4343de,null))[_0xd4af('0x24')](function(_0xc93fd5){if(_0xc93fd5){var _0x472cfc=[];for(var _0x58f596=0x0;_0x58f596<_0x6aeb80[_0xd4af('0x37')];_0x58f596++){_0x472cfc[_0xd4af('0x5c')](db[_0xd4af('0x52')][_0xd4af('0x75')]({'where':{'userProfileId':_0xc93fd5['id'],'name':_0x6aeb80[_0x58f596][_0xd4af('0x28')]},'raw':!![]}));}return BPromise[_0xd4af('0x76')](_0x472cfc);}})[_0xd4af('0x24')](function(_0xebadc2){var _0x5cb700=_[_0xd4af('0x3f')](_0xebadc2,function(_0x33a54a){return _0x33a54a?_0x33a54a:undefined;});var _0x50fb00=_[_0xd4af('0x3f')](_0x6aeb80,['ignore',!![]]);var _0x54c1de=_[_0xd4af('0x63')](_0x5cb700)&&_[_0xd4af('0x63')](_0x50fb00)?null:_[_0xd4af('0x77')](_0x50fb00,_0x5cb700);if(_0x54c1de){var _0x18d3dc=[];for(var _0x38cacb=0x0;_0x38cacb<_0x54c1de[_0xd4af('0x37')];_0x38cacb++){var _0xf0a3ef=_[_0xd4af('0x49')](_0x6aeb80,function(_0x35411d){return _0x54c1de[_0x38cacb]?_0x35411d[_0xd4af('0x28')]===_0x54c1de[_0x38cacb]['name']:null;});if(_0xf0a3ef){if(_0x54c1de[_0x38cacb][_0xd4af('0x78')]){_0x18d3dc['push'](getAllResources(_0x2c4c05['childModel'],_0x54c1de[_0x38cacb]));}else{if(!_0x54c1de[_0x38cacb]['autoAssociation']){_0x18d3dc[_0xd4af('0x5c')](getAllowedResources(_0xf0a3ef,_0x54c1de[_0x38cacb],_0x2c4c05[_0xd4af('0x71')]));}else{if(_0xf0a3ef[_0xd4af('0x31')]){_0x18d3dc['push'](getAllFilteredResources(_0xf0a3ef,_0x54c1de[_0x38cacb]));}}}}}return BPromise[_0xd4af('0x76')](_0x18d3dc);}else{return null;}})[_0xd4af('0x24')](function(_0xfd7871){var _0xcaac1b=_0xfd7871;var _0x146ab1=null;if(_0xcaac1b){_0x146ab1=_0xcaac1b[_0xd4af('0x37')]===0x1?_0xcaac1b[0x0]:null;}if(_0x146ab1||_0xcaac1b){var _0x1f661e=db[_0x2c4c05[_0xd4af('0x71')]]['rawAttributes'];_0x5b8915['model']=_[_0xd4af('0x48')](_0x1f661e);_0x5b8915[_0xd4af('0x32')]=_[_0xd4af('0x48')](_0x1b7494['query']);_0x5b8915[_0xd4af('0x33')]=_[_0xd4af('0x34')](_0x5b8915['model'],_0x5b8915[_0xd4af('0x32')]);_0x438143['attributes']=_[_0xd4af('0x34')](_0x5b8915[_0xd4af('0x31')],qs[_0xd4af('0x35')](_0x1b7494[_0xd4af('0x32')][_0xd4af('0x35')]));_0x438143[_0xd4af('0x36')]=_0x438143[_0xd4af('0x36')][_0xd4af('0x37')]?_0x438143[_0xd4af('0x36')]:_0x5b8915[_0xd4af('0x31')];if(!_0x1b7494[_0xd4af('0x32')][_0xd4af('0x38')](_0xd4af('0x39'))){_0x438143[_0xd4af('0x20')]=qs[_0xd4af('0x20')](_0x1b7494[_0xd4af('0x32')]['limit']);_0x438143[_0xd4af('0x1f')]=qs['offset'](_0x1b7494[_0xd4af('0x32')]['offset']);}_0x438143['order']=qs[_0xd4af('0x3a')](_0x1b7494[_0xd4af('0x32')]['sort']);_0x438143['where']=qs[_0xd4af('0x33')](_[_0xd4af('0x3c')](_0x1b7494[_0xd4af('0x32')],_0x5b8915[_0xd4af('0x33')]));if(_0x1b7494[_0xd4af('0x32')][_0xd4af('0x3f')]){_0x438143['where']=_[_0xd4af('0x3d')](_0x438143[_0xd4af('0x3b')],{'$or':_[_0xd4af('0x2b')](_0x1f661e,function(_0x53a412){if(_0x53a412['type'][_0xd4af('0x30')]!=='VIRTUAL'){var _0x4cc947={};_0x4cc947[_0x53a412[_0xd4af('0x79')]]={'$like':'%'+_0x1b7494[_0xd4af('0x32')][_0xd4af('0x3f')]+'%'};return _0x4cc947;}})});}var _0x15f76f=[];if(_0x146ab1){var _0xddea78=_[_0xd4af('0x49')](_0x6aeb80,[_0xd4af('0x28'),_0x146ab1[_0xd4af('0x28')]]);if(_0xddea78[_0xd4af('0x79')]){var _0x4f7b1c={};if(_0x2c4c05['childModel']===_0xd4af('0x7a')){_0x4f7b1c[_0xddea78['foreignKey']]=_[_0xd4af('0x2b')](_0x146ab1['associatedResources'],'id');}else{_0x4f7b1c[_0xddea78[_0xd4af('0x7b')]]=_0x146ab1[_0xd4af('0x7c')];}_0x15f76f[_0xd4af('0x5c')](_0x4f7b1c);}else{_0x438143[_0xd4af('0x3b')]['id']=_0x146ab1[_0xd4af('0x7c')];}}else{for(var _0x2c67ff=0x0;_0x2c67ff<_0xcaac1b[_0xd4af('0x37')];_0x2c67ff++){var _0xddea78=_['find'](_0x6aeb80,[_0xd4af('0x28'),_0xcaac1b[_0x2c67ff][_0xd4af('0x28')]]);if(_0xddea78[_0xd4af('0x79')]){var _0x4f7b1c={};_0x4f7b1c[_0xddea78['foreignKey']]=_0xcaac1b[_0x2c67ff]['associatedResources'];_0x15f76f[_0xd4af('0x5c')](_0x4f7b1c);}else{if(!_0x438143[_0xd4af('0x3b')]['id'])_0x438143[_0xd4af('0x3b')]['id']=[];_0xcaac1b[_0x2c67ff][_0xd4af('0x7c')][_0xd4af('0x66')](function(_0x2b560f){_0x438143[_0xd4af('0x3b')]['id']['push'](_0x2b560f);});}}}if(!_[_0xd4af('0x63')](_0x15f76f)){_0x438143[_0xd4af('0x3b')]=_[_0xd4af('0x3d')](_0x438143[_0xd4af('0x3b')],{'$and':{'$or':_0x15f76f}});}_0x438143=_[_0xd4af('0x3d')]({},_0x438143,_0x1b7494[_0xd4af('0x40')]);if(_0x146ab1&&!_0x146ab1[_0xd4af('0x54')]&&_0x2c4c05[_0xd4af('0x71')]==='AnalyticExtractedReport'){if(_0x1b7494[_0xd4af('0x32')][_0xd4af('0x41')]){_0x438143[_0xd4af('0x42')]=[{'all':!![]}];}return db[_0x2c4c05['childModel']][_0xd4af('0x43')](_0x438143)[_0xd4af('0x24')](function(_0x21c434){var _0xb3f49e=[];_0x21c434[_0xd4af('0x66')](function(_0x3f7779){var _0x3d4707;switch(_0x3f7779[_0xd4af('0x7d')]){case'default':_0x3d4707=_[_0xd4af('0x49')](_0x146ab1[_0xd4af('0x7c')],function(_0x5da616){return _0x5da616['id']===_0x3f7779[_0xd4af('0x7e')]&&_0x5da616[_0xd4af('0x2f')]===_0xd4af('0x7f');});break;case _0xd4af('0x80'):_0x3d4707=_[_0xd4af('0x49')](_0x146ab1['associatedResources'],function(_0x430399){return _0x430399['id']===_0x3f7779[_0xd4af('0x7e')]&&_0x430399[_0xd4af('0x2f')]===_0xd4af('0x81');});break;}if(_0x3d4707)_0xb3f49e[_0xd4af('0x5c')](_0x3f7779);});_0x37176a[_0xd4af('0x1e')]=_0xb3f49e[_0xd4af('0x37')];_0x37176a['rows']=_0xb3f49e;return _0x37176a;});}else{return db[_0x2c4c05[_0xd4af('0x71')]][_0xd4af('0x1e')]({'where':_0x438143[_0xd4af('0x3b')]})[_0xd4af('0x24')](function(_0x5ca806){_0x37176a['count']=_0x5ca806;if(_0x1b7494['query']['includeAll']){if(_0x2c4c05[_0xd4af('0x71')]===_0xd4af('0x82')){_0x438143[_0xd4af('0x42')]=[{'model':db[_0xd4af('0x83')],'as':_0xd4af('0x84'),'attributes':['id',_0xd4af('0x28'),_0xd4af('0x85')],'required':_0x1b7494[_0xd4af('0x32')][_0xd4af('0x86')]?!![]:![]},{'model':db[_0xd4af('0x83')],'as':_0xd4af('0x87'),'attributes':['id','name',_0xd4af('0x85')],'through':_0x1b7494[_0xd4af('0x32')][_0xd4af('0x86')]?{'attributes':[],'where':{'TagId':_0x1b7494[_0xd4af('0x32')]['tag']||undefined}}:{},'required':_0x1b7494[_0xd4af('0x32')]['tag']?!![]:![]}];}else{_0x438143[_0xd4af('0x42')]=[{'all':!![]}];}}return db[_0x2c4c05[_0xd4af('0x71')]][_0xd4af('0x43')](_0x438143);})[_0xd4af('0x24')](function(_0x9be405){_0x37176a[_0xd4af('0x44')]=_0x9be405;return _0x37176a;});}}else{return _0x37176a;}})[_0xd4af('0x24')](respondWithFilteredResult(_0x4343de,_0x438143))[_0xd4af('0x45')](handleError(_0x4343de,null));};function getAllResources(_0x37d767,_0x298fc6){return new BPromise(function(_0x181597,_0x506a1f){if(_0x298fc6){var _0x375ec3=_0x298fc6['filter']?{[_0x298fc6[_0xd4af('0x3f')][_0xd4af('0x79')]]:_0x298fc6[_0xd4af('0x3f')][_0xd4af('0x88')]}:undefined;return db[_0x37d767][_0xd4af('0x43')]({'where':_0x375ec3,'raw':!![]})[_0xd4af('0x24')](function(_0x3670db){_0x298fc6[_0xd4af('0x7c')]=_['map'](_0x3670db,'id');_0x181597(_0x298fc6);})[_0xd4af('0x45')](function(_0x4f4fbd){_0x506a1f(_0x4f4fbd);});}else{_0x181597(null);}});}function getAllFilteredResources(_0x4ad303,_0xd4dec4){return new BPromise(function(_0x2b13fe,_0x11260c){var _0x501e7b=_0x4ad303[_0xd4af('0x3f')]?{[_0x4ad303[_0xd4af('0x3f')][_0xd4af('0x79')]]:_0x4ad303[_0xd4af('0x3f')]['value']}:undefined;return db[_0x4ad303[_0xd4af('0x31')]][_0xd4af('0x43')]({'where':_0x501e7b,'raw':!![]})[_0xd4af('0x24')](function(_0x57532c){_0xd4dec4[_0xd4af('0x7c')]=_[_0xd4af('0x2b')](_0x57532c,function(_0xa73c8c){return _0xa73c8c['name'];});_0x2b13fe(_0xd4dec4);})[_0xd4af('0x45')](function(_0x265bde){_0x11260c(_0x265bde);});});}function getAllowedResources(_0x26e158,_0x3ee579,_0x44604a){return new BPromise(function(_0x3e0e17,_0x5b8cfc){if(_0x3ee579){return db[_0xd4af('0x55')][_0xd4af('0x43')]({'where':{'sectionId':_0x3ee579['id']},'raw':!![]})[_0xd4af('0x24')](function(_0x4e5407){if(_0x26e158[_0xd4af('0x79')]&&_0x26e158['field']!=='id'){_0x3ee579[_0xd4af('0x7c')]=_[_0xd4af('0x2b')](_0x4e5407,function(_0x253758){return _0x253758[_0x26e158[_0xd4af('0x79')]];});}else{if(_0x44604a===_0xd4af('0x7a')){_0x3ee579[_0xd4af('0x7c')]=_[_0xd4af('0x2b')](_0x4e5407,function(_0x59b319){return{'id':_0x59b319[_0xd4af('0x67')],'type':_0x59b319[_0xd4af('0x2f')]};});}else{_0x3ee579[_0xd4af('0x7c')]=_[_0xd4af('0x2b')](_0x4e5407,function(_0x27aa61){return _0x27aa61['resourceId'];});}}_0x3e0e17(_0x3ee579);})[_0xd4af('0x45')](function(_0x2c4a6b){_0x5b8cfc(_0x2c4a6b);});}else{_0x3e0e17(null);}});}function getQueryModels(_0x569f30,_0x468ae8){var _0x11891f=_0x569f30[_0xd4af('0x89')]();var _0x2970ec={'childModel':undefined,'parentSections':[]};switch(_0x11891f){case _0xd4af('0x8a'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0x8b');break;case _0xd4af('0x8c'):_0x2970ec['childModel']=_0xd4af('0x8d');break;case _0xd4af('0x8e'):_0x2970ec[_0xd4af('0x71')]='SquareRecording';_0x2970ec[_0xd4af('0x74')]=[{'name':_0xd4af('0x8f'),'field':_0xd4af('0x28'),'foreignKey':_0xd4af('0x90')}];break;case _0xd4af('0x91'):_0x2970ec[_0xd4af('0x71')]='JscriptyProject';break;case'contacts':_0x2970ec[_0xd4af('0x71')]=_0xd4af('0x82');_0x2970ec[_0xd4af('0x74')]=[{'name':_0xd4af('0x92'),'field':'id','foreignKey':_0xd4af('0x93')}];break;case _0xd4af('0x94'):_0x2970ec['childModel']=_0xd4af('0x95');break;case _0xd4af('0x96'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0x97');break;case _0xd4af('0x98'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0x99');break;case _0xd4af('0x9a'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0x9b');break;case _0xd4af('0x9c'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0x9d');break;case'faxqueues':_0x2970ec['childModel']='FaxQueue';break;case _0xd4af('0x9e'):_0x2970ec['childModel']='FaxAccount';break;case _0xd4af('0x9f'):case _0xd4af('0xa0'):case'outboundroutes':_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xa1');break;case _0xd4af('0xa2'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xa3');break;case _0xd4af('0xa4'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xa5');break;case _0xd4af('0xa6'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xa7');_0x2970ec[_0xd4af('0x74')]=[{'name':_0xd4af('0xa8'),'field':_0xd4af('0x28'),'foreignKey':_0xd4af('0xa9'),'model':'User','filter':{'field':_0xd4af('0xaa'),'value':[_0xd4af('0xab')]}},{'name':'Telephones','field':_0xd4af('0x28'),'foreignKey':'membername','model':'User','filter':{'field':_0xd4af('0xaa'),'value':[_0xd4af('0xac')]}},{'name':_0xd4af('0xad'),'field':'name','foreignKey':_0xd4af('0xae'),'model':_0xd4af('0xaf'),'filter':{'field':_0xd4af('0x2f'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0xd4af('0x28'),'foreignKey':_0xd4af('0xae'),'model':'VoiceQueue','filter':{'field':_0xd4af('0x2f'),'value':[_0xd4af('0xb0')]}}];break;case'musiconholds':_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xb1');break;case _0xd4af('0xb2'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xb3');break;case _0xd4af('0xb4'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xb5');break;case'ivrcampaigns':_0x2970ec['childModel']='Campaign';break;case _0xd4af('0xb6'):_0x2970ec['childModel']=_0xd4af('0xb7');break;case _0xd4af('0xb8'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xb9');break;case'mailsubstatuses':_0x2970ec[_0xd4af('0x71')]='MailSubstatus';break;case'openchannelqueues':_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xba');break;case _0xd4af('0xbb'):_0x2970ec['childModel']=_0xd4af('0xbc');break;case _0xd4af('0xbd'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xbe');break;case _0xd4af('0xbf'):_0x2970ec[_0xd4af('0x71')]='SmsAccount';break;case _0xd4af('0xc0'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xc1');break;case _0xd4af('0xc2'):case _0xd4af('0xc3'):_0x2970ec['childModel']=_0xd4af('0xaf');if(_0x468ae8){_0x2970ec[_0xd4af('0x74')]=[{'name':_0xd4af('0xad')},{'name':_0xd4af('0xc4')}];}break;case _0xd4af('0xc5'):case'agents':case _0xd4af('0xc6'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xc7');if(_0x468ae8){_0x2970ec[_0xd4af('0x74')]=[{'name':_0xd4af('0xc8'),'filter':{'field':_0xd4af('0xaa'),'value':['admin',_0xd4af('0xc9')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0xd4af('0xca'):_0x2970ec['childModel']=_0xd4af('0xcb');break;case _0xd4af('0xcc'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xcd');break;case _0xd4af('0xce'):_0x2970ec[_0xd4af('0x71')]='FreshdeskAccount';break;case _0xd4af('0xcf'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xd0');break;case'deskaccounts':_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xd1');break;case _0xd4af('0xd2'):_0x2970ec['childModel']='ZohoAccount';break;case _0xd4af('0xd3'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xc7');break;case _0xd4af('0xd4'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xd5');break;case _0xd4af('0xd6'):_0x2970ec['childModel']=_0xd4af('0xd7');break;case'customdashboards':_0x2970ec[_0xd4af('0x71')]=_0xd4af('0x65');break;case _0xd4af('0xd8'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xd9');break;case _0xd4af('0xda'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xdb');break;case _0xd4af('0xdc'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xdd');break;case'sounds':_0x2970ec[_0xd4af('0x71')]=_0xd4af('0xde');break;case _0xd4af('0xdf'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0x83');break;case _0xd4af('0xe0'):_0x2970ec['childModel']='Template';break;case _0xd4af('0xe1'):_0x2970ec['childModel']=_0xd4af('0xe2');break;case'trunks':_0x2970ec['childModel']='Trunk';break;case _0xd4af('0xe3'):_0x2970ec[_0xd4af('0x71')]='Variable';break;case _0xd4af('0xe4'):_0x2970ec['childModel']=_0xd4af('0x68');break;case _0xd4af('0xe5'):_0x2970ec[_0xd4af('0x71')]=_0xd4af('0x7a');_0x2970ec[_0xd4af('0x74')]=[{'name':_0xd4af('0xe6'),'field':'id','foreignKey':_0xd4af('0x7e')}];break;case _0xd4af('0xe7'):_0x2970ec['childModel']=_0xd4af('0xe8');break;default:return _0x2970ec;}return _0x2970ec;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 9a8ae69..b75993e 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 _0x8c2f=['hook','events','../../mysqldb','UserProfile','setMaxListeners','update','remove','emit'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8c2f,0x1c9));var _0xf8c2=function(_0x39665a,_0xc729df){_0x39665a=_0x39665a-0x0;var _0x173185=_0x8c2f[_0x39665a];return _0x173185;};'use strict';var EventEmitter=require(_0xf8c2('0x0'));var UserProfile=require(_0xf8c2('0x1'))['db'][_0xf8c2('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xf8c2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf8c2('0x4'),'afterDestroy':_0xf8c2('0x5')};function emitEvent(_0x8e6ca3){return function(_0x60f247,_0x5e7439,_0x2d9ac1){UserProfileEvents[_0xf8c2('0x6')](_0x8e6ca3+':'+_0x60f247['id'],_0x60f247);UserProfileEvents[_0xf8c2('0x6')](_0x8e6ca3,_0x60f247);_0x2d9ac1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xf8c2('0x7')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x9f36=['emit','exports','events','setMaxListeners','save','update','remove'];(function(_0x329d61,_0x561c85){var _0x1b3cf1=function(_0x1ce057){while(--_0x1ce057){_0x329d61['push'](_0x329d61['shift']());}};_0x1b3cf1(++_0x561c85);}(_0x9f36,0x198));var _0x69f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9f36[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x69f3('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x69f3('0x1')](0x0);var events={'afterCreate':_0x69f3('0x2'),'afterUpdate':_0x69f3('0x3'),'afterDestroy':_0x69f3('0x4')};function emitEvent(_0x3d149f){return function(_0x448ece,_0x59812a,_0x188596){UserProfileEvents['emit'](_0x3d149f+':'+_0x448ece['id'],_0x448ece);UserProfileEvents[_0x69f3('0x5')](_0x3d149f,_0x448ece);_0x188596(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x69f3('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 6cd486a..53aae84 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 _0x31b4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','user_profiles','lodash','util','../../config/logger','api'];(function(_0x36c6c1,_0x3a6359){var _0xced794=function(_0x67d97f){while(--_0x67d97f){_0x36c6c1['push'](_0x36c6c1['shift']());}};_0xced794(++_0x3a6359);}(_0x31b4,0x1dd));var _0x431b=function(_0x17ae0e,_0x59902f){_0x17ae0e=_0x17ae0e-0x0;var _0x117989=_0x31b4[_0x17ae0e];return _0x117989;};'use strict';var _=require(_0x431b('0x0'));var util=require(_0x431b('0x1'));var logger=require(_0x431b('0x2'))(_0x431b('0x3'));var moment=require(_0x431b('0x4'));var BPromise=require(_0x431b('0x5'));var rp=require(_0x431b('0x6'));var fs=require('fs');var path=require(_0x431b('0x7'));var rimraf=require(_0x431b('0x8'));var config=require(_0x431b('0x9'));var attributes=require('./userProfile.attributes');module[_0x431b('0xa')]=function(_0x5f5beb,_0x3908b1){return _0x5f5beb[_0x431b('0xb')]('UserProfile',attributes,{'tableName':_0x431b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdfbe=['rimraf','../../config/environment','./userProfile.attributes','exports','UserProfile','user_profiles','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x549222,_0x1919ff){var _0xae203=function(_0x46b0ca){while(--_0x46b0ca){_0x549222['push'](_0x549222['shift']());}};_0xae203(++_0x1919ff);}(_0xdfbe,0xca));var _0xedfb=function(_0x133dc8,_0xbf13e1){_0x133dc8=_0x133dc8-0x0;var _0x21de3e=_0xdfbe[_0x133dc8];return _0x21de3e;};'use strict';var _=require(_0xedfb('0x0'));var util=require(_0xedfb('0x1'));var logger=require(_0xedfb('0x2'))(_0xedfb('0x3'));var moment=require(_0xedfb('0x4'));var BPromise=require(_0xedfb('0x5'));var rp=require(_0xedfb('0x6'));var fs=require('fs');var path=require(_0xedfb('0x7'));var rimraf=require(_0xedfb('0x8'));var config=require(_0xedfb('0x9'));var attributes=require(_0xedfb('0xa'));module[_0xedfb('0xb')]=function(_0x46b54d,_0x31160b){return _0x46b54d['define'](_0xedfb('0xc'),attributes,{'tableName':_0xedfb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 259fae2..bab46d6 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 _0xeff8=['./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x2c0e01,_0x1be650){var _0x4f0de7=function(_0x1d4885){while(--_0x1d4885){_0x2c0e01['push'](_0x2c0e01['shift']());}};_0x4f0de7(++_0x1be650);}(_0xeff8,0x186));var _0x8eff=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xeff8[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var moment=require('moment');var BPromise=require(_0x8eff('0x2'));var rs=require(_0x8eff('0x3'));var fs=require('fs');var Redis=require(_0x8eff('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eff('0x5'));var logger=require(_0x8eff('0x6'))(_0x8eff('0x7'));var config=require(_0x8eff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8eff('0x9')][_0x8eff('0xa')]({'port':0x232a});config[_0x8eff('0xb')]=_[_0x8eff('0xc')](config['redis'],{'host':_0x8eff('0xd'),'port':0x18eb});var socket=require(_0x8eff('0xe'))(new Redis(config[_0x8eff('0xb')]));require(_0x8eff('0xf'))['register'](socket);function respondWithRpcPromise(_0x56f120,_0x359d62,_0x430b45){return new BPromise(function(_0xb2117e,_0x52d250){return client[_0x8eff('0x10')](_0x56f120,_0x430b45)[_0x8eff('0x11')](function(_0x5172a5){logger[_0x8eff('0x12')](_0x8eff('0x13'),_0x359d62,'request\x20sent');logger['debug'](_0x8eff('0x14'),_0x359d62,_0x8eff('0x15'),JSON[_0x8eff('0x16')](_0x5172a5));if(_0x5172a5[_0x8eff('0x17')]){if(_0x5172a5[_0x8eff('0x17')]['code']===0x1f4){logger[_0x8eff('0x17')](_0x8eff('0x13'),_0x359d62,_0x5172a5[_0x8eff('0x17')][_0x8eff('0x18')]);return _0x52d250(_0x5172a5[_0x8eff('0x17')][_0x8eff('0x18')]);}logger[_0x8eff('0x17')](_0x8eff('0x13'),_0x359d62,_0x5172a5[_0x8eff('0x17')][_0x8eff('0x18')]);return _0xb2117e(_0x5172a5[_0x8eff('0x17')]['message']);}else{logger[_0x8eff('0x12')](_0x8eff('0x13'),_0x359d62,_0x8eff('0x15'));_0xb2117e(_0x5172a5[_0x8eff('0x19')][_0x8eff('0x18')]);}})[_0x8eff('0x1a')](function(_0x38f5ee){logger[_0x8eff('0x17')](_0x8eff('0x13'),_0x359d62,_0x38f5ee);_0x52d250(_0x38f5ee);});});} \ No newline at end of file +var _0x5d58=['localhost','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d58,0x187));var _0x85d5=function(_0x1cab6f,_0x22ffc7){_0x1cab6f=_0x1cab6f-0x0;var _0x18e45b=_0x5d58[_0x1cab6f];return _0x18e45b;};'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(_0x85d5('0x0'));var db=require(_0x85d5('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x85d5('0x2'))(_0x85d5('0x3'));var config=require('../../config/environment');var jayson=require(_0x85d5('0x4'));var client=jayson[_0x85d5('0x5')][_0x85d5('0x6')]({'port':0x232a});config[_0x85d5('0x7')]=_['defaults'](config[_0x85d5('0x7')],{'host':_0x85d5('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85d5('0x7')]));require('./userProfile.socket')[_0x85d5('0x9')](socket);function respondWithRpcPromise(_0x2ce6b9,_0x258f0c,_0x488dcb){return new BPromise(function(_0x499b36,_0x4e147a){return client[_0x85d5('0xa')](_0x2ce6b9,_0x488dcb)[_0x85d5('0xb')](function(_0xde1063){logger[_0x85d5('0xc')](_0x85d5('0xd'),_0x258f0c,_0x85d5('0xe'));logger[_0x85d5('0xf')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x258f0c,'request\x20sent',JSON['stringify'](_0xde1063));if(_0xde1063[_0x85d5('0x10')]){if(_0xde1063[_0x85d5('0x10')][_0x85d5('0x11')]===0x1f4){logger[_0x85d5('0x10')](_0x85d5('0xd'),_0x258f0c,_0xde1063[_0x85d5('0x10')][_0x85d5('0x12')]);return _0x4e147a(_0xde1063['error'][_0x85d5('0x12')]);}logger[_0x85d5('0x10')](_0x85d5('0xd'),_0x258f0c,_0xde1063[_0x85d5('0x10')][_0x85d5('0x12')]);return _0x499b36(_0xde1063[_0x85d5('0x10')][_0x85d5('0x12')]);}else{logger[_0x85d5('0xc')](_0x85d5('0xd'),_0x258f0c,_0x85d5('0xe'));_0x499b36(_0xde1063[_0x85d5('0x13')][_0x85d5('0x12')]);}})[_0x85d5('0x14')](function(_0x3df634){logger[_0x85d5('0x10')](_0x85d5('0xd'),_0x258f0c,_0x3df634);_0x4e147a(_0x3df634);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 4ef94c7..d2d15d9 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 _0x2cf5=['userProfile:','./userProfile.events','save','remove','update','length'];(function(_0x237c28,_0x3ab7ca){var _0x25b613=function(_0x52a6ae){while(--_0x52a6ae){_0x237c28['push'](_0x237c28['shift']());}};_0x25b613(++_0x3ab7ca);}(_0x2cf5,0xbb));var _0x52cf=function(_0x1fbc01,_0x3dabf1){_0x1fbc01=_0x1fbc01-0x0;var _0x5e3e56=_0x2cf5[_0x1fbc01];return _0x5e3e56;};'use strict';var UserProfileEvents=require(_0x52cf('0x0'));var events=[_0x52cf('0x1'),_0x52cf('0x2'),_0x52cf('0x3')];function createListener(_0x736abe,_0x575722){return function(_0x7262b9){_0x575722['emit'](_0x736abe,_0x7262b9);};}function removeListener(_0x211bd5,_0xbde382){return function(){UserProfileEvents['removeListener'](_0x211bd5,_0xbde382);};}exports['register']=function(_0x527e97){for(var _0x41ac4e=0x0,_0x491c22=events[_0x52cf('0x4')];_0x41ac4e<_0x491c22;_0x41ac4e++){var _0x2b829d=events[_0x41ac4e];var _0x27fa20=createListener(_0x52cf('0x5')+_0x2b829d,_0x527e97);UserProfileEvents['on'](_0x2b829d,_0x27fa20);}}; \ No newline at end of file +var _0xf5c7=['emit','removeListener','length','./userProfile.events','save','update'];(function(_0x26bb3a,_0x31d1b1){var _0x22f776=function(_0x2f5afa){while(--_0x2f5afa){_0x26bb3a['push'](_0x26bb3a['shift']());}};_0x22f776(++_0x31d1b1);}(_0xf5c7,0x1e9));var _0x7f5c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xf5c7[_0x42cae2];return _0x5f256f;};'use strict';var UserProfileEvents=require(_0x7f5c('0x0'));var events=[_0x7f5c('0x1'),'remove',_0x7f5c('0x2')];function createListener(_0x57ec0d,_0xd75dcc){return function(_0x3e4a97){_0xd75dcc[_0x7f5c('0x3')](_0x57ec0d,_0x3e4a97);};}function removeListener(_0x256867,_0x566c9d){return function(){UserProfileEvents[_0x7f5c('0x4')](_0x256867,_0x566c9d);};}exports['register']=function(_0x31f02c){for(var _0x264527=0x0,_0x2d47c4=events[_0x7f5c('0x5')];_0x264527<_0x2d47c4;_0x264527++){var _0x1489d1=events[_0x264527];var _0x3af021=createListener('userProfile:'+_0x1489d1,_0x31f02c);UserProfileEvents['on'](_0x1489d1,_0x3af021);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 71b36d5..69143d7 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 _0x2dca=['path','express','Router','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','/describe','describe','post','create','/:id','update','destroy','multer','util'];(function(_0x457d69,_0x2bfa35){var _0x489d9f=function(_0x2570b6){while(--_0x2570b6){_0x457d69['push'](_0x457d69['shift']());}};_0x489d9f(++_0x2bfa35);}(_0x2dca,0xdb));var _0xa2dc=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0x2dca[_0x2df724];return _0x1b2504;};'use strict';var multer=require(_0xa2dc('0x0'));var util=require(_0xa2dc('0x1'));var path=require(_0xa2dc('0x2'));var timeout=require('connect-timeout');var express=require(_0xa2dc('0x3'));var router=express[_0xa2dc('0x4')]();var auth=require(_0xa2dc('0x5'));var interaction=require(_0xa2dc('0x6'));var config=require('../../config/environment');var controller=require(_0xa2dc('0x7'));router[_0xa2dc('0x8')]('/',auth[_0xa2dc('0x9')](),controller['index']);router[_0xa2dc('0x8')](_0xa2dc('0xa'),auth[_0xa2dc('0x9')](),controller[_0xa2dc('0xb')]);router[_0xa2dc('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa2dc('0xc')]('/',auth[_0xa2dc('0x9')](),controller[_0xa2dc('0xd')]);router['put'](_0xa2dc('0xe'),auth[_0xa2dc('0x9')](),controller[_0xa2dc('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa2dc('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf69c=['Router','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','exports','multer','util','path','connect-timeout'];(function(_0x1a0760,_0x4d79a6){var _0x1bfe78=function(_0x174f2a){while(--_0x174f2a){_0x1a0760['push'](_0x1a0760['shift']());}};_0x1bfe78(++_0x4d79a6);}(_0xf69c,0x1e2));var _0xcf69=function(_0x4fb122,_0x38df6a){_0x4fb122=_0x4fb122-0x0;var _0x78527=_0xf69c[_0x4fb122];return _0x78527;};'use strict';var multer=require(_0xcf69('0x0'));var util=require(_0xcf69('0x1'));var path=require(_0xcf69('0x2'));var timeout=require(_0xcf69('0x3'));var express=require('express');var router=express[_0xcf69('0x4')]();var auth=require(_0xcf69('0x5'));var interaction=require(_0xcf69('0x6'));var config=require('../../config/environment');var controller=require(_0xcf69('0x7'));router[_0xcf69('0x8')]('/',auth[_0xcf69('0x9')](),controller[_0xcf69('0xa')]);router[_0xcf69('0x8')](_0xcf69('0xb'),auth[_0xcf69('0x9')](),controller['describe']);router[_0xcf69('0x8')](_0xcf69('0xc'),auth['isAuthenticated'](),controller[_0xcf69('0xd')]);router[_0xcf69('0xe')]('/',auth[_0xcf69('0x9')](),controller[_0xcf69('0xf')]);router['put'](_0xcf69('0xc'),auth[_0xcf69('0x9')](),controller[_0xcf69('0x10')]);router['delete'](_0xcf69('0xc'),auth[_0xcf69('0x9')](),controller['destroy']);module[_0xcf69('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index d823392..1057ca9 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 _0xca5e=['INTEGER','STRING','sequelize','exports'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xca5e,0x15a));var _0xeca5=function(_0x49fd10,_0x454f79){_0x49fd10=_0x49fd10-0x0;var _0x5ecce6=_0xca5e[_0x49fd10];return _0x5ecce6;};'use strict';var Sequelize=require(_0xeca5('0x0'));module[_0xeca5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xeca5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xeca5('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0xfbb1=['INTEGER','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfbb1,0x69));var _0x1fbb=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0xfbb1[_0x33bc64];return _0x3fdd34;};'use strict';var Sequelize=require(_0x1fbb('0x0'));module[_0x1fbb('0x1')]={'name':{'type':Sequelize[_0x1fbb('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x1fbb('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 3183aa4..ec8a040 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 _0x2d6b=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','intersection','length','create','find','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x461c9e,_0x9a67cd){var _0x144e35=function(_0x17d055){while(--_0x17d055){_0x461c9e['push'](_0x461c9e['shift']());}};_0x144e35(++_0x9a67cd);}(_0x2d6b,0x1eb));var _0xb2d6=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x2d6b[_0x35da42];return _0x370035;};'use strict';var pdf=require(_0xb2d6('0x0'));var emlformat=require(_0xb2d6('0x1'));var rimraf=require(_0xb2d6('0x2'));var zipdir=require(_0xb2d6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb2d6('0x4'));var moment=require(_0xb2d6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb2d6('0x6'));var util=require('util');var path=require(_0xb2d6('0x7'));var sox=require('sox');var csv=require(_0xb2d6('0x8'));var ejs=require(_0xb2d6('0x9'));var fs=require('fs');var _=require(_0xb2d6('0xa'));var squel=require(_0xb2d6('0xb'));var crypto=require(_0xb2d6('0xc'));var jsforce=require(_0xb2d6('0xd'));var deskjs=require(_0xb2d6('0xe'));var toCsv=require(_0xb2d6('0x8'));var querystring=require(_0xb2d6('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb2d6('0x10'));var qs=require(_0xb2d6('0x11'));var as=require(_0xb2d6('0x12'));var hardwareService=require(_0xb2d6('0x13'));var logger=require(_0xb2d6('0x14'))(_0xb2d6('0x15'));var utils=require(_0xb2d6('0x16'));var config=require(_0xb2d6('0x17'));var db=require(_0xb2d6('0x18'))['db'];function respondWithStatusCode(_0x45a702,_0x5b9c09){_0x5b9c09=_0x5b9c09||0xcc;return function(_0x31fe2c){if(_0x31fe2c){return _0x45a702[_0xb2d6('0x19')](_0x5b9c09);}return _0x45a702[_0xb2d6('0x1a')](_0x5b9c09)[_0xb2d6('0x1b')]();};}function respondWithResult(_0x27689a,_0x5bee4f){_0x5bee4f=_0x5bee4f||0xc8;return function(_0x2b28bf){if(_0x2b28bf){return _0x27689a[_0xb2d6('0x1a')](_0x5bee4f)[_0xb2d6('0x1c')](_0x2b28bf);}};}function respondWithFilteredResult(_0x35e7b6,_0x37a13b){return function(_0x34bcde){if(_0x34bcde){var _0x102dd4=_0x34bcde[_0xb2d6('0x1d')],_0x43280b=_0x37a13b[_0xb2d6('0x1e')],_0x1a1aaa=_0x37a13b['offset']+_0x37a13b[_0xb2d6('0x1f')],_0x4ca414;if(_0x1a1aaa>=_0x102dd4){_0x1a1aaa=_0x102dd4;_0x4ca414=0xc8;}else{_0x4ca414=0xce;}_0x35e7b6[_0xb2d6('0x1a')](_0x4ca414);return _0x35e7b6[_0xb2d6('0x20')](_0xb2d6('0x21'),_0x43280b+'-'+_0x1a1aaa+'/'+_0x102dd4)[_0xb2d6('0x1c')](_0x34bcde);}return null;};}function patchUpdates(_0xd212c0){return function(_0xb64a2c){try{jsonpatch['apply'](_0xb64a2c,_0xd212c0,!![]);}catch(_0x1af02b){return BPromise[_0xb2d6('0x22')](_0x1af02b);}return _0xb64a2c[_0xb2d6('0x23')]();};}function saveUpdates(_0x46653e,_0xdebd1c){return function(_0x86c2ac){if(_0x86c2ac){return _0x86c2ac[_0xb2d6('0x24')](_0x46653e)['then'](function(_0x3e39b9){return _0x3e39b9;});}return null;};}function removeEntity(_0x176f95,_0x41cc3c){return function(_0x3b6103){if(_0x3b6103){return _0x3b6103[_0xb2d6('0x25')]()[_0xb2d6('0x26')](function(){_0x176f95['status'](0xcc)[_0xb2d6('0x1b')]();});}};}function handleEntityNotFound(_0xb9c9e5,_0x266177){return function(_0x321eed){if(!_0x321eed){_0xb9c9e5[_0xb2d6('0x19')](0x194);}return _0x321eed;};}function handleError(_0x4aced5,_0x1f644f){_0x1f644f=_0x1f644f||0x1f4;return function(_0x5f1301){logger[_0xb2d6('0x27')](_0x5f1301[_0xb2d6('0x28')]);if(_0x5f1301[_0xb2d6('0x29')]){delete _0x5f1301[_0xb2d6('0x29')];}_0x4aced5[_0xb2d6('0x1a')](_0x1f644f)[_0xb2d6('0x2a')](_0x5f1301);};}exports[_0xb2d6('0x2b')]=function(_0x2defe6,_0x41c805){var _0x6a657b={},_0x305e87={},_0x215a33={'count':0x0,'rows':[]};var _0x1b9245=_[_0xb2d6('0x2c')](db[_0xb2d6('0x2d')][_0xb2d6('0x2e')],function(_0x7cd78b){return{'name':_0x7cd78b[_0xb2d6('0x2f')],'type':_0x7cd78b[_0xb2d6('0x30')]['key']};});_0x305e87[_0xb2d6('0x31')]=_['map'](_0x1b9245,_0xb2d6('0x29'));_0x305e87[_0xb2d6('0x32')]=_[_0xb2d6('0x33')](_0x2defe6[_0xb2d6('0x32')]);_0x305e87[_0xb2d6('0x34')]=_['intersection'](_0x305e87[_0xb2d6('0x31')],_0x305e87[_0xb2d6('0x32')]);_0x6a657b[_0xb2d6('0x35')]=_['intersection'](_0x305e87[_0xb2d6('0x31')],qs[_0xb2d6('0x36')](_0x2defe6[_0xb2d6('0x32')][_0xb2d6('0x36')]));_0x6a657b[_0xb2d6('0x35')]=_0x6a657b[_0xb2d6('0x35')]['length']?_0x6a657b[_0xb2d6('0x35')]:_0x305e87[_0xb2d6('0x31')];if(!_0x2defe6[_0xb2d6('0x32')]['hasOwnProperty']('nolimit')){_0x6a657b[_0xb2d6('0x1f')]=qs[_0xb2d6('0x1f')](_0x2defe6[_0xb2d6('0x32')][_0xb2d6('0x1f')]);_0x6a657b[_0xb2d6('0x1e')]=qs[_0xb2d6('0x1e')](_0x2defe6[_0xb2d6('0x32')][_0xb2d6('0x1e')]);}_0x6a657b[_0xb2d6('0x37')]=qs[_0xb2d6('0x38')](_0x2defe6[_0xb2d6('0x32')]['sort']);_0x6a657b[_0xb2d6('0x39')]=qs[_0xb2d6('0x34')](_['pick'](_0x2defe6[_0xb2d6('0x32')],_0x305e87[_0xb2d6('0x34')]));if(_0x2defe6[_0xb2d6('0x32')][_0xb2d6('0x3a')]){_0x6a657b[_0xb2d6('0x39')]=_['merge'](_0x6a657b[_0xb2d6('0x39')],{'$or':_[_0xb2d6('0x2c')](_0x1b9245,function(_0x5c3464){if(_0x5c3464[_0xb2d6('0x30')]!==_0xb2d6('0x3b')){var _0x12ceca={};_0x12ceca[_0x5c3464[_0xb2d6('0x29')]]={'$like':'%'+_0x2defe6[_0xb2d6('0x32')][_0xb2d6('0x3a')]+'%'};return _0x12ceca;}})});}_0x6a657b=_[_0xb2d6('0x3c')]({},_0x6a657b,_0x2defe6[_0xb2d6('0x3d')]);var _0x5ec3c1={'where':_0x6a657b['where']};return db[_0xb2d6('0x2d')][_0xb2d6('0x1d')](_0x5ec3c1)['then'](function(_0x21b831){_0x215a33['count']=_0x21b831;if(_0x2defe6[_0xb2d6('0x32')][_0xb2d6('0x3e')]){_0x6a657b['include']=[{'all':!![]}];}return db[_0xb2d6('0x2d')][_0xb2d6('0x3f')](_0x6a657b);})['then'](function(_0x37dee0){_0x215a33['rows']=_0x37dee0;return _0x215a33;})[_0xb2d6('0x26')](respondWithFilteredResult(_0x41c805,_0x6a657b))[_0xb2d6('0x40')](handleError(_0x41c805,null));};exports[_0xb2d6('0x41')]=function(_0x182a8a,_0x2a9752){var _0x1b60a7={'raw':![],'where':{'id':_0x182a8a[_0xb2d6('0x42')]['id']}},_0x98032e={};_0x98032e[_0xb2d6('0x31')]=_[_0xb2d6('0x33')](db[_0xb2d6('0x2d')][_0xb2d6('0x2e')]);_0x98032e[_0xb2d6('0x32')]=_['keys'](_0x182a8a['query']);_0x98032e['filters']=_[_0xb2d6('0x43')](_0x98032e[_0xb2d6('0x31')],_0x98032e[_0xb2d6('0x32')]);_0x1b60a7[_0xb2d6('0x35')]=_[_0xb2d6('0x43')](_0x98032e['model'],qs[_0xb2d6('0x36')](_0x182a8a[_0xb2d6('0x32')]['fields']));_0x1b60a7[_0xb2d6('0x35')]=_0x1b60a7[_0xb2d6('0x35')][_0xb2d6('0x44')]?_0x1b60a7[_0xb2d6('0x35')]:_0x98032e[_0xb2d6('0x31')];if(_0x182a8a['query'][_0xb2d6('0x3e')]){_0x1b60a7['include']=[{'all':!![]}];}_0x1b60a7=_[_0xb2d6('0x3c')]({},_0x1b60a7,_0x182a8a[_0xb2d6('0x3d')]);return db['UserProfileResource']['find'](_0x1b60a7)[_0xb2d6('0x26')](handleEntityNotFound(_0x2a9752,null))['then'](respondWithResult(_0x2a9752,null))['catch'](handleError(_0x2a9752,null));};exports['create']=function(_0x7ba30a,_0x38ff6e){return db[_0xb2d6('0x2d')][_0xb2d6('0x45')](_0x7ba30a['body'],{})[_0xb2d6('0x26')](respondWithResult(_0x38ff6e,0xc9))[_0xb2d6('0x40')](handleError(_0x38ff6e,null));};exports[_0xb2d6('0x24')]=function(_0x5c969b,_0x33a52f){if(_0x5c969b['body']['id']){delete _0x5c969b['body']['id'];}return db['UserProfileResource'][_0xb2d6('0x46')]({'where':{'id':_0x5c969b['params']['id']}})[_0xb2d6('0x26')](handleEntityNotFound(_0x33a52f,null))['then'](saveUpdates(_0x5c969b[_0xb2d6('0x47')],null))[_0xb2d6('0x26')](respondWithResult(_0x33a52f,null))[_0xb2d6('0x40')](handleError(_0x33a52f,null));};exports['destroy']=function(_0x3ae0d2,_0x498669){return db[_0xb2d6('0x2d')][_0xb2d6('0x46')]({'where':{'id':_0x3ae0d2[_0xb2d6('0x42')]['id']}})[_0xb2d6('0x26')](handleEntityNotFound(_0x498669,null))[_0xb2d6('0x26')](removeEntity(_0x498669,null))['catch'](handleError(_0x498669,null));};exports[_0xb2d6('0x48')]=function(_0x32680b,_0x4ac998){return db['UserProfileResource'][_0xb2d6('0x48')]()[_0xb2d6('0x26')](respondWithResult(_0x4ac998,null))[_0xb2d6('0x40')](handleError(_0x4ac998,null));}; \ No newline at end of file +var _0xf11f=['sendStatus','error','name','UserProfileResource','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','create','body','find','params','describe','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xf11f,0xb2));var _0xff11=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0xf11f[_0x264b9b];return _0x4c7a0e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xff11('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff11('0x1'));var rp=require('request-promise');var moment=require(_0xff11('0x2'));var BPromise=require(_0xff11('0x3'));var Mustache=require('mustache');var util=require(_0xff11('0x4'));var path=require(_0xff11('0x5'));var sox=require(_0xff11('0x6'));var csv=require(_0xff11('0x7'));var ejs=require(_0xff11('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xff11('0x9'));var crypto=require(_0xff11('0xa'));var jsforce=require(_0xff11('0xb'));var deskjs=require(_0xff11('0xc'));var toCsv=require(_0xff11('0x7'));var querystring=require(_0xff11('0xd'));var Papa=require(_0xff11('0xe'));var Redis=require(_0xff11('0xf'));var authService=require(_0xff11('0x10'));var qs=require(_0xff11('0x11'));var as=require(_0xff11('0x12'));var hardwareService=require(_0xff11('0x13'));var logger=require(_0xff11('0x14'))(_0xff11('0x15'));var utils=require(_0xff11('0x16'));var config=require('../../config/environment');var db=require(_0xff11('0x17'))['db'];function respondWithStatusCode(_0x4f6499,_0x35fcac){_0x35fcac=_0x35fcac||0xcc;return function(_0x1c88f6){if(_0x1c88f6){return _0x4f6499['sendStatus'](_0x35fcac);}return _0x4f6499[_0xff11('0x18')](_0x35fcac)[_0xff11('0x19')]();};}function respondWithResult(_0x40f097,_0xc0f6a3){_0xc0f6a3=_0xc0f6a3||0xc8;return function(_0x38b80a){if(_0x38b80a){return _0x40f097[_0xff11('0x18')](_0xc0f6a3)['json'](_0x38b80a);}};}function respondWithFilteredResult(_0x335aeb,_0x3f779c){return function(_0x5322f7){if(_0x5322f7){var _0x94903a=_0x5322f7[_0xff11('0x1a')],_0x4c1d85=_0x3f779c[_0xff11('0x1b')],_0x3710c9=_0x3f779c[_0xff11('0x1b')]+_0x3f779c[_0xff11('0x1c')],_0x2c56c2;if(_0x3710c9>=_0x94903a){_0x3710c9=_0x94903a;_0x2c56c2=0xc8;}else{_0x2c56c2=0xce;}_0x335aeb['status'](_0x2c56c2);return _0x335aeb[_0xff11('0x1d')](_0xff11('0x1e'),_0x4c1d85+'-'+_0x3710c9+'/'+_0x94903a)[_0xff11('0x1f')](_0x5322f7);}return null;};}function patchUpdates(_0x3d4c4b){return function(_0x400c40){try{jsonpatch[_0xff11('0x20')](_0x400c40,_0x3d4c4b,!![]);}catch(_0x41b86d){return BPromise[_0xff11('0x21')](_0x41b86d);}return _0x400c40[_0xff11('0x22')]();};}function saveUpdates(_0x105dbc,_0x2d0d81){return function(_0xea7803){if(_0xea7803){return _0xea7803[_0xff11('0x23')](_0x105dbc)[_0xff11('0x24')](function(_0x2325c0){return _0x2325c0;});}return null;};}function removeEntity(_0x3a6a93,_0x58aa5e){return function(_0x330361){if(_0x330361){return _0x330361[_0xff11('0x25')]()[_0xff11('0x24')](function(){_0x3a6a93[_0xff11('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5771f3,_0x4a9e11){return function(_0x299fd2){if(!_0x299fd2){_0x5771f3[_0xff11('0x26')](0x194);}return _0x299fd2;};}function handleError(_0x1ffccd,_0x3b77a0){_0x3b77a0=_0x3b77a0||0x1f4;return function(_0x4d272d){logger[_0xff11('0x27')](_0x4d272d['stack']);if(_0x4d272d['name']){delete _0x4d272d[_0xff11('0x28')];}_0x1ffccd[_0xff11('0x18')](_0x3b77a0)['send'](_0x4d272d);};}exports['index']=function(_0x561bb8,_0x501b50){var _0x151e73={},_0x3b841a={},_0x2027ad={'count':0x0,'rows':[]};var _0x4e80b2=_['map'](db[_0xff11('0x29')][_0xff11('0x2a')],function(_0x1d6911){return{'name':_0x1d6911['fieldName'],'type':_0x1d6911[_0xff11('0x2b')][_0xff11('0x2c')]};});_0x3b841a[_0xff11('0x2d')]=_[_0xff11('0x2e')](_0x4e80b2,'name');_0x3b841a[_0xff11('0x2f')]=_[_0xff11('0x30')](_0x561bb8['query']);_0x3b841a[_0xff11('0x31')]=_[_0xff11('0x32')](_0x3b841a[_0xff11('0x2d')],_0x3b841a[_0xff11('0x2f')]);_0x151e73['attributes']=_['intersection'](_0x3b841a['model'],qs['fields'](_0x561bb8[_0xff11('0x2f')][_0xff11('0x33')]));_0x151e73[_0xff11('0x34')]=_0x151e73['attributes'][_0xff11('0x35')]?_0x151e73[_0xff11('0x34')]:_0x3b841a['model'];if(!_0x561bb8['query']['hasOwnProperty']('nolimit')){_0x151e73[_0xff11('0x1c')]=qs[_0xff11('0x1c')](_0x561bb8['query']['limit']);_0x151e73['offset']=qs[_0xff11('0x1b')](_0x561bb8['query']['offset']);}_0x151e73[_0xff11('0x36')]=qs[_0xff11('0x37')](_0x561bb8['query'][_0xff11('0x37')]);_0x151e73['where']=qs['filters'](_[_0xff11('0x38')](_0x561bb8['query'],_0x3b841a['filters']));if(_0x561bb8[_0xff11('0x2f')][_0xff11('0x39')]){_0x151e73[_0xff11('0x3a')]=_[_0xff11('0x3b')](_0x151e73[_0xff11('0x3a')],{'$or':_[_0xff11('0x2e')](_0x4e80b2,function(_0x330bab){if(_0x330bab[_0xff11('0x2b')]!==_0xff11('0x3c')){var _0x5932cf={};_0x5932cf[_0x330bab[_0xff11('0x28')]]={'$like':'%'+_0x561bb8[_0xff11('0x2f')][_0xff11('0x39')]+'%'};return _0x5932cf;}})});}_0x151e73=_[_0xff11('0x3b')]({},_0x151e73,_0x561bb8[_0xff11('0x3d')]);var _0x2c3ab7={'where':_0x151e73[_0xff11('0x3a')]};return db[_0xff11('0x29')][_0xff11('0x1a')](_0x2c3ab7)[_0xff11('0x24')](function(_0x22dcab){_0x2027ad[_0xff11('0x1a')]=_0x22dcab;if(_0x561bb8[_0xff11('0x2f')][_0xff11('0x3e')]){_0x151e73[_0xff11('0x3f')]=[{'all':!![]}];}return db['UserProfileResource'][_0xff11('0x40')](_0x151e73);})[_0xff11('0x24')](function(_0x528cd9){_0x2027ad['rows']=_0x528cd9;return _0x2027ad;})[_0xff11('0x24')](respondWithFilteredResult(_0x501b50,_0x151e73))[_0xff11('0x41')](handleError(_0x501b50,null));};exports[_0xff11('0x42')]=function(_0x404066,_0x16f8d4){var _0x339257={'raw':![],'where':{'id':_0x404066['params']['id']}},_0xdf28f5={};_0xdf28f5[_0xff11('0x2d')]=_[_0xff11('0x30')](db[_0xff11('0x29')][_0xff11('0x2a')]);_0xdf28f5[_0xff11('0x2f')]=_[_0xff11('0x30')](_0x404066[_0xff11('0x2f')]);_0xdf28f5[_0xff11('0x31')]=_[_0xff11('0x32')](_0xdf28f5[_0xff11('0x2d')],_0xdf28f5[_0xff11('0x2f')]);_0x339257[_0xff11('0x34')]=_['intersection'](_0xdf28f5[_0xff11('0x2d')],qs[_0xff11('0x33')](_0x404066['query']['fields']));_0x339257[_0xff11('0x34')]=_0x339257[_0xff11('0x34')][_0xff11('0x35')]?_0x339257[_0xff11('0x34')]:_0xdf28f5['model'];if(_0x404066[_0xff11('0x2f')][_0xff11('0x3e')]){_0x339257[_0xff11('0x3f')]=[{'all':!![]}];}_0x339257=_[_0xff11('0x3b')]({},_0x339257,_0x404066['options']);return db['UserProfileResource']['find'](_0x339257)['then'](handleEntityNotFound(_0x16f8d4,null))[_0xff11('0x24')](respondWithResult(_0x16f8d4,null))[_0xff11('0x41')](handleError(_0x16f8d4,null));};exports[_0xff11('0x43')]=function(_0x4affb1,_0x43811b){return db[_0xff11('0x29')][_0xff11('0x43')](_0x4affb1[_0xff11('0x44')],{})[_0xff11('0x24')](respondWithResult(_0x43811b,0xc9))[_0xff11('0x41')](handleError(_0x43811b,null));};exports[_0xff11('0x23')]=function(_0x379747,_0x34b6bc){if(_0x379747['body']['id']){delete _0x379747['body']['id'];}return db['UserProfileResource'][_0xff11('0x45')]({'where':{'id':_0x379747[_0xff11('0x46')]['id']}})['then'](handleEntityNotFound(_0x34b6bc,null))[_0xff11('0x24')](saveUpdates(_0x379747['body'],null))[_0xff11('0x24')](respondWithResult(_0x34b6bc,null))[_0xff11('0x41')](handleError(_0x34b6bc,null));};exports[_0xff11('0x25')]=function(_0xd239fa,_0xa494bd){return db['UserProfileResource'][_0xff11('0x45')]({'where':{'id':_0xd239fa[_0xff11('0x46')]['id']}})[_0xff11('0x24')](handleEntityNotFound(_0xa494bd,null))[_0xff11('0x24')](removeEntity(_0xa494bd,null))[_0xff11('0x41')](handleError(_0xa494bd,null));};exports[_0xff11('0x47')]=function(_0x1f1a99,_0x5b6cc6){return db[_0xff11('0x29')]['describe']()['then'](respondWithResult(_0x5b6cc6,null))[_0xff11('0x41')](handleError(_0x5b6cc6,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 7c1d615..6b6cd29 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 _0x6c17=['UserProfileResource','user_profile_has_resources','resourceId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0xae0818,_0x3b1640){var _0x31e1d9=function(_0x15a1f6){while(--_0x15a1f6){_0xae0818['push'](_0xae0818['shift']());}};_0x31e1d9(++_0x3b1640);}(_0x6c17,0x9f));var _0x76c1=function(_0x40ba7c,_0x599ce4){_0x40ba7c=_0x40ba7c-0x0;var _0x280d02=_0x6c17[_0x40ba7c];return _0x280d02;};'use strict';var _=require(_0x76c1('0x0'));var util=require(_0x76c1('0x1'));var logger=require('../../config/logger')(_0x76c1('0x2'));var moment=require(_0x76c1('0x3'));var BPromise=require(_0x76c1('0x4'));var rp=require(_0x76c1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76c1('0x6'));var config=require(_0x76c1('0x7'));var attributes=require(_0x76c1('0x8'));module['exports']=function(_0x48bfac,_0x107241){return _0x48bfac['define'](_0x76c1('0x9'),attributes,{'tableName':_0x76c1('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x76c1('0xb'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0bcf=['request-promise','path','rimraf','./userProfileResource.attributes','define','resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x275730,_0x33ad7d){var _0x4ed0e8=function(_0x33b2d2){while(--_0x33b2d2){_0x275730['push'](_0x275730['shift']());}};_0x4ed0e8(++_0x33ad7d);}(_0x0bcf,0x10b));var _0xf0bc=function(_0x53490b,_0x1882fc){_0x53490b=_0x53490b-0x0;var _0x45ec86=_0x0bcf[_0x53490b];return _0x45ec86;};'use strict';var _=require(_0xf0bc('0x0'));var util=require(_0xf0bc('0x1'));var logger=require(_0xf0bc('0x2'))(_0xf0bc('0x3'));var moment=require(_0xf0bc('0x4'));var BPromise=require(_0xf0bc('0x5'));var rp=require(_0xf0bc('0x6'));var fs=require('fs');var path=require(_0xf0bc('0x7'));var rimraf=require(_0xf0bc('0x8'));var config=require('../../config/environment');var attributes=require(_0xf0bc('0x9'));module['exports']=function(_0x4025a6,_0x4e721d){return _0x4025a6[_0xf0bc('0xa')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xf0bc('0xb'),_0xf0bc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index b066cc2..3771f8f 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 _0xd6a1=['../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x125113,_0xea6adb){var _0x500076=function(_0x2df46b){while(--_0x2df46b){_0x125113['push'](_0x125113['shift']());}};_0x500076(++_0xea6adb);}(_0xd6a1,0x117));var _0x1d6a=function(_0x5c9240,_0x20fd90){_0x5c9240=_0x5c9240-0x0;var _0x2a8ae6=_0xd6a1[_0x5c9240];return _0x2a8ae6;};'use strict';var _=require(_0x1d6a('0x0'));var util=require('util');var moment=require(_0x1d6a('0x1'));var BPromise=require(_0x1d6a('0x2'));var rs=require(_0x1d6a('0x3'));var fs=require('fs');var Redis=require(_0x1d6a('0x4'));var db=require(_0x1d6a('0x5'))['db'];var utils=require(_0x1d6a('0x6'));var logger=require(_0x1d6a('0x7'))(_0x1d6a('0x8'));var config=require(_0x1d6a('0x9'));var jayson=require(_0x1d6a('0xa'));var client=jayson[_0x1d6a('0xb')][_0x1d6a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e4f1c,_0x313b7e,_0x1df88f){return new BPromise(function(_0x2a51e3,_0x18e0a4){return client[_0x1d6a('0xd')](_0x2e4f1c,_0x1df88f)[_0x1d6a('0xe')](function(_0x11d771){logger[_0x1d6a('0xf')](_0x1d6a('0x10'),_0x313b7e,_0x1d6a('0x11'));logger[_0x1d6a('0x12')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x313b7e,_0x1d6a('0x11'),JSON[_0x1d6a('0x13')](_0x11d771));if(_0x11d771['error']){if(_0x11d771[_0x1d6a('0x14')][_0x1d6a('0x15')]===0x1f4){logger[_0x1d6a('0x14')](_0x1d6a('0x10'),_0x313b7e,_0x11d771[_0x1d6a('0x14')][_0x1d6a('0x16')]);return _0x18e0a4(_0x11d771['error']['message']);}logger['error'](_0x1d6a('0x10'),_0x313b7e,_0x11d771[_0x1d6a('0x14')][_0x1d6a('0x16')]);return _0x2a51e3(_0x11d771[_0x1d6a('0x14')][_0x1d6a('0x16')]);}else{logger[_0x1d6a('0xf')](_0x1d6a('0x10'),_0x313b7e,_0x1d6a('0x11'));_0x2a51e3(_0x11d771['result'][_0x1d6a('0x16')]);}})[_0x1d6a('0x17')](function(_0x1cfac9){logger[_0x1d6a('0x14')](_0x1d6a('0x10'),_0x313b7e,_0x1cfac9);_0x18e0a4(_0x1cfac9);});});} \ No newline at end of file +var _0xae98=['rpc','../../config/environment','jayson/promise','client','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x2b5ee5,_0x3741bf){var _0x1c480b=function(_0x437a18){while(--_0x437a18){_0x2b5ee5['push'](_0x2b5ee5['shift']());}};_0x1c480b(++_0x3741bf);}(_0xae98,0x197));var _0x8ae9=function(_0x382bdb,_0x540f21){_0x382bdb=_0x382bdb-0x0;var _0x284225=_0xae98[_0x382bdb];return _0x284225;};'use strict';var _=require(_0x8ae9('0x0'));var util=require(_0x8ae9('0x1'));var moment=require('moment');var BPromise=require(_0x8ae9('0x2'));var rs=require(_0x8ae9('0x3'));var fs=require('fs');var Redis=require(_0x8ae9('0x4'));var db=require(_0x8ae9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ae9('0x6'))(_0x8ae9('0x7'));var config=require(_0x8ae9('0x8'));var jayson=require(_0x8ae9('0x9'));var client=jayson[_0x8ae9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37f1e6,_0x5cb04f,_0x5c213c){return new BPromise(function(_0x1bb3cc,_0x3f939e){return client[_0x8ae9('0xb')](_0x37f1e6,_0x5c213c)[_0x8ae9('0xc')](function(_0x29a336){logger['info'](_0x8ae9('0xd'),_0x5cb04f,_0x8ae9('0xe'));logger[_0x8ae9('0xf')](_0x8ae9('0x10'),_0x5cb04f,_0x8ae9('0xe'),JSON[_0x8ae9('0x11')](_0x29a336));if(_0x29a336[_0x8ae9('0x12')]){if(_0x29a336['error'][_0x8ae9('0x13')]===0x1f4){logger[_0x8ae9('0x12')](_0x8ae9('0xd'),_0x5cb04f,_0x29a336[_0x8ae9('0x12')]['message']);return _0x3f939e(_0x29a336[_0x8ae9('0x12')][_0x8ae9('0x14')]);}logger[_0x8ae9('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x5cb04f,_0x29a336['error']['message']);return _0x1bb3cc(_0x29a336[_0x8ae9('0x12')][_0x8ae9('0x14')]);}else{logger[_0x8ae9('0x15')](_0x8ae9('0xd'),_0x5cb04f,_0x8ae9('0xe'));_0x1bb3cc(_0x29a336[_0x8ae9('0x16')]['message']);}})['catch'](function(_0x7bab70){logger[_0x8ae9('0x12')](_0x8ae9('0xd'),_0x5cb04f,_0x7bab70);_0x3f939e(_0x7bab70);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 3991da5..0fa1e5d 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 _0x0e28=['../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','create','/:id','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0e28,0x12d));var _0x80e2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0e28[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0x80e2('0x0'));var path=require(_0x80e2('0x1'));var timeout=require(_0x80e2('0x2'));var express=require('express');var router=express[_0x80e2('0x3')]();var auth=require(_0x80e2('0x4'));var interaction=require(_0x80e2('0x5'));var config=require(_0x80e2('0x6'));var controller=require(_0x80e2('0x7'));router[_0x80e2('0x8')]('/',auth[_0x80e2('0x9')](),controller[_0x80e2('0xa')]);router[_0x80e2('0x8')](_0x80e2('0xb'),auth['isAuthenticated'](),controller[_0x80e2('0xc')]);router[_0x80e2('0x8')]('/:id',auth[_0x80e2('0x9')](),controller['show']);router['post']('/',auth[_0x80e2('0x9')](),controller[_0x80e2('0xd')]);router['put'](_0x80e2('0xe'),auth[_0x80e2('0x9')](),controller[_0x80e2('0xf')]);router['delete'](_0x80e2('0xe'),auth[_0x80e2('0x9')](),controller[_0x80e2('0x10')]);module[_0x80e2('0x11')]=router; \ No newline at end of file +var _0xb31c=['./userProfileSection.controller','get','isAuthenticated','/describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3a8a39,_0x4268f5){var _0x27b639=function(_0x3e2b82){while(--_0x3e2b82){_0x3a8a39['push'](_0x3a8a39['shift']());}};_0x27b639(++_0x4268f5);}(_0xb31c,0x108));var _0xcb31=function(_0x3af619,_0x53662){_0x3af619=_0x3af619-0x0;var _0x5d3375=_0xb31c[_0x3af619];return _0x5d3375;};'use strict';var multer=require(_0xcb31('0x0'));var util=require(_0xcb31('0x1'));var path=require(_0xcb31('0x2'));var timeout=require(_0xcb31('0x3'));var express=require(_0xcb31('0x4'));var router=express[_0xcb31('0x5')]();var auth=require(_0xcb31('0x6'));var interaction=require(_0xcb31('0x7'));var config=require(_0xcb31('0x8'));var controller=require(_0xcb31('0x9'));router[_0xcb31('0xa')]('/',auth[_0xcb31('0xb')](),controller['index']);router[_0xcb31('0xa')](_0xcb31('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xcb31('0xa')](_0xcb31('0xd'),auth[_0xcb31('0xb')](),controller['show']);router[_0xcb31('0xe')]('/',auth[_0xcb31('0xb')](),controller[_0xcb31('0xf')]);router[_0xcb31('0x10')]('/:id',auth[_0xcb31('0xb')](),controller[_0xcb31('0x11')]);router[_0xcb31('0x12')](_0xcb31('0xd'),auth[_0xcb31('0xb')](),controller[_0xcb31('0x13')]);module[_0xcb31('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 2c33da2..3946429 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 _0x6343=['crudPermissions','join','split','exports','STRING','BOOLEAN'];(function(_0x149b0d,_0x5727ee){var _0x2972cc=function(_0x420fd0){while(--_0x420fd0){_0x149b0d['push'](_0x149b0d['shift']());}};_0x2972cc(++_0x5727ee);}(_0x6343,0x1e9));var _0x3634=function(_0x236dd8,_0x446ac8){_0x236dd8=_0x236dd8-0x0;var _0x3f6f6a=_0x6343[_0x236dd8];return _0x3f6f6a;};'use strict';var Sequelize=require('sequelize');module[_0x3634('0x0')]={'name':{'type':Sequelize[_0x3634('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x3634('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3634('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x3634('0x1')],'set':function(_0x45748d){this['setDataValue'](_0x3634('0x3'),_0x45748d?_0x45748d[_0x3634('0x4')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this['getDataValue'](_0x3634('0x3'))[_0x3634('0x5')](''):[];}}}; \ No newline at end of file +var _0x2a8d=['STRING','INTEGER','BOOLEAN','crudPermissions','join','getDataValue','split','sequelize','exports'];(function(_0xe7d655,_0x184955){var _0x3e4804=function(_0x5cebfb){while(--_0x5cebfb){_0xe7d655['push'](_0xe7d655['shift']());}};_0x3e4804(++_0x184955);}(_0x2a8d,0x11e));var _0xd2a8=function(_0x40f991,_0x576819){_0x40f991=_0x40f991-0x0;var _0x38eca2=_0x2a8d[_0x40f991];return _0x38eca2;};'use strict';var Sequelize=require(_0xd2a8('0x0'));module[_0xd2a8('0x1')]={'name':{'type':Sequelize[_0xd2a8('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xd2a8('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd2a8('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xd2a8('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xd2a8('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xd2a8('0x2')],'set':function(_0x5919ea){this['setDataValue'](_0xd2a8('0x5'),_0x5919ea?_0x5919ea[_0xd2a8('0x6')](''):[]);},'get':function(){return this[_0xd2a8('0x7')](_0xd2a8('0x5'))?this[_0xd2a8('0x7')](_0xd2a8('0x5'))[_0xd2a8('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index a3fbd02..80cfcce 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 _0xce6e=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','UserProfileSection','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','params','keys','rawAttributes','include','options','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xce6e,0xcb));var _0xece6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce6e[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xece6('0x0'));var emlformat=require(_0xece6('0x1'));var rimraf=require(_0xece6('0x2'));var zipdir=require(_0xece6('0x3'));var jsonpatch=require(_0xece6('0x4'));var rp=require(_0xece6('0x5'));var moment=require(_0xece6('0x6'));var BPromise=require(_0xece6('0x7'));var Mustache=require(_0xece6('0x8'));var util=require(_0xece6('0x9'));var path=require(_0xece6('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xece6('0xb'));var fs=require('fs');var _=require(_0xece6('0xc'));var squel=require(_0xece6('0xd'));var crypto=require('crypto');var jsforce=require(_0xece6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xece6('0xf'));var querystring=require('querystring');var Papa=require(_0xece6('0x10'));var Redis=require('ioredis');var authService=require(_0xece6('0x11'));var qs=require(_0xece6('0x12'));var as=require(_0xece6('0x13'));var hardwareService=require(_0xece6('0x14'));var logger=require('../../config/logger')(_0xece6('0x15'));var utils=require(_0xece6('0x16'));var config=require(_0xece6('0x17'));var db=require(_0xece6('0x18'))['db'];function respondWithStatusCode(_0x4da0f0,_0x3cdd22){_0x3cdd22=_0x3cdd22||0xcc;return function(_0x452bf7){if(_0x452bf7){return _0x4da0f0['sendStatus'](_0x3cdd22);}return _0x4da0f0['status'](_0x3cdd22)['end']();};}function respondWithResult(_0x3194df,_0x4052c0){_0x4052c0=_0x4052c0||0xc8;return function(_0x4786c5){if(_0x4786c5){return _0x3194df[_0xece6('0x19')](_0x4052c0)[_0xece6('0x1a')](_0x4786c5);}};}function respondWithFilteredResult(_0x182034,_0x317835){return function(_0x35761d){if(_0x35761d){var _0x389a55=_0x35761d[_0xece6('0x1b')],_0x28f732=_0x317835[_0xece6('0x1c')],_0x5a5c06=_0x317835[_0xece6('0x1c')]+_0x317835[_0xece6('0x1d')],_0x1ff433;if(_0x5a5c06>=_0x389a55){_0x5a5c06=_0x389a55;_0x1ff433=0xc8;}else{_0x1ff433=0xce;}_0x182034[_0xece6('0x19')](_0x1ff433);return _0x182034[_0xece6('0x1e')](_0xece6('0x1f'),_0x28f732+'-'+_0x5a5c06+'/'+_0x389a55)[_0xece6('0x1a')](_0x35761d);}return null;};}function patchUpdates(_0x847b94){return function(_0x2157d6){try{jsonpatch[_0xece6('0x20')](_0x2157d6,_0x847b94,!![]);}catch(_0x399915){return BPromise['reject'](_0x399915);}return _0x2157d6[_0xece6('0x21')]();};}function saveUpdates(_0x180dd7,_0x577072){return function(_0x304b06){if(_0x304b06){return _0x304b06['update'](_0x180dd7)[_0xece6('0x22')](function(_0x447fe0){return _0x447fe0;});}return null;};}function removeEntity(_0x1f007d,_0x377363){return function(_0x144b84){if(_0x144b84){return _0x144b84[_0xece6('0x23')]()[_0xece6('0x22')](function(){_0x1f007d[_0xece6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52ca7c,_0x2df8ac){return function(_0x105457){if(!_0x105457){_0x52ca7c['sendStatus'](0x194);}return _0x105457;};}function handleError(_0x6fc82f,_0x10aa4d){_0x10aa4d=_0x10aa4d||0x1f4;return function(_0x3239ef){logger[_0xece6('0x24')](_0x3239ef[_0xece6('0x25')]);if(_0x3239ef[_0xece6('0x26')]){delete _0x3239ef[_0xece6('0x26')];}_0x6fc82f[_0xece6('0x19')](_0x10aa4d)[_0xece6('0x27')](_0x3239ef);};}exports[_0xece6('0x28')]=function(_0x5518d4,_0x47eae6){var _0x442a6c={},_0x1fb8c8={},_0x3ab060={'count':0x0,'rows':[]};var _0x1b6ec9=_[_0xece6('0x29')](db[_0xece6('0x2a')]['rawAttributes'],function(_0x47498e){return{'name':_0x47498e[_0xece6('0x2b')],'type':_0x47498e[_0xece6('0x2c')][_0xece6('0x2d')]};});_0x1fb8c8['model']=_['map'](_0x1b6ec9,_0xece6('0x26'));_0x1fb8c8['query']=_['keys'](_0x5518d4[_0xece6('0x2e')]);_0x1fb8c8[_0xece6('0x2f')]=_[_0xece6('0x30')](_0x1fb8c8['model'],_0x1fb8c8[_0xece6('0x2e')]);_0x442a6c[_0xece6('0x31')]=_[_0xece6('0x30')](_0x1fb8c8[_0xece6('0x32')],qs['fields'](_0x5518d4['query'][_0xece6('0x33')]));_0x442a6c['attributes']=_0x442a6c[_0xece6('0x31')][_0xece6('0x34')]?_0x442a6c[_0xece6('0x31')]:_0x1fb8c8[_0xece6('0x32')];if(!_0x5518d4[_0xece6('0x2e')][_0xece6('0x35')](_0xece6('0x36'))){_0x442a6c[_0xece6('0x1d')]=qs[_0xece6('0x1d')](_0x5518d4[_0xece6('0x2e')][_0xece6('0x1d')]);_0x442a6c[_0xece6('0x1c')]=qs[_0xece6('0x1c')](_0x5518d4[_0xece6('0x2e')][_0xece6('0x1c')]);}_0x442a6c[_0xece6('0x37')]=qs[_0xece6('0x38')](_0x5518d4['query'][_0xece6('0x38')]);_0x442a6c[_0xece6('0x39')]=qs[_0xece6('0x2f')](_[_0xece6('0x3a')](_0x5518d4[_0xece6('0x2e')],_0x1fb8c8['filters']));if(_0x5518d4['query'][_0xece6('0x3b')]){_0x442a6c[_0xece6('0x39')]=_[_0xece6('0x3c')](_0x442a6c[_0xece6('0x39')],{'$or':_[_0xece6('0x29')](_0x1b6ec9,function(_0x522943){if(_0x522943[_0xece6('0x2c')]!==_0xece6('0x3d')){var _0x37ada7={};_0x37ada7[_0x522943[_0xece6('0x26')]]={'$like':'%'+_0x5518d4[_0xece6('0x2e')]['filter']+'%'};return _0x37ada7;}})});}_0x442a6c=_[_0xece6('0x3c')]({},_0x442a6c,_0x5518d4['options']);var _0x3dcbbd={'where':_0x442a6c[_0xece6('0x39')]};return db['UserProfileSection'][_0xece6('0x1b')](_0x3dcbbd)['then'](function(_0x1f2289){_0x3ab060['count']=_0x1f2289;if(_0x5518d4[_0xece6('0x2e')][_0xece6('0x3e')]){_0x442a6c['include']=[{'all':!![]}];}return db[_0xece6('0x2a')]['findAll'](_0x442a6c);})[_0xece6('0x22')](function(_0x3e2085){_0x3ab060[_0xece6('0x3f')]=_0x3e2085;return _0x3ab060;})[_0xece6('0x22')](respondWithFilteredResult(_0x47eae6,_0x442a6c))['catch'](handleError(_0x47eae6,null));};exports['show']=function(_0x5150de,_0x383c20){var _0x3020e1={'raw':![],'where':{'id':_0x5150de[_0xece6('0x40')]['id']}},_0x14bac6={};_0x14bac6[_0xece6('0x32')]=_[_0xece6('0x41')](db[_0xece6('0x2a')][_0xece6('0x42')]);_0x14bac6[_0xece6('0x2e')]=_['keys'](_0x5150de[_0xece6('0x2e')]);_0x14bac6[_0xece6('0x2f')]=_['intersection'](_0x14bac6[_0xece6('0x32')],_0x14bac6[_0xece6('0x2e')]);_0x3020e1[_0xece6('0x31')]=_[_0xece6('0x30')](_0x14bac6['model'],qs[_0xece6('0x33')](_0x5150de[_0xece6('0x2e')][_0xece6('0x33')]));_0x3020e1[_0xece6('0x31')]=_0x3020e1[_0xece6('0x31')][_0xece6('0x34')]?_0x3020e1[_0xece6('0x31')]:_0x14bac6[_0xece6('0x32')];if(_0x5150de['query'][_0xece6('0x3e')]){_0x3020e1[_0xece6('0x43')]=[{'all':!![]}];}_0x3020e1=_[_0xece6('0x3c')]({},_0x3020e1,_0x5150de[_0xece6('0x44')]);return db[_0xece6('0x2a')][_0xece6('0x45')](_0x3020e1)[_0xece6('0x22')](handleEntityNotFound(_0x383c20,null))[_0xece6('0x22')](respondWithResult(_0x383c20,null))[_0xece6('0x46')](handleError(_0x383c20,null));};exports['create']=function(_0x40d097,_0x1fd1c6){return db[_0xece6('0x2a')][_0xece6('0x47')](_0x40d097[_0xece6('0x48')],{})[_0xece6('0x22')](respondWithResult(_0x1fd1c6,0xc9))[_0xece6('0x46')](handleError(_0x1fd1c6,null));};exports['update']=function(_0x506669,_0x16a899){if(_0x506669[_0xece6('0x48')]['id']){delete _0x506669[_0xece6('0x48')]['id'];}return db[_0xece6('0x2a')][_0xece6('0x45')]({'where':{'id':_0x506669[_0xece6('0x40')]['id']}})['then'](handleEntityNotFound(_0x16a899,null))[_0xece6('0x22')](saveUpdates(_0x506669['body'],null))[_0xece6('0x22')](respondWithResult(_0x16a899,null))[_0xece6('0x46')](handleError(_0x16a899,null));};exports[_0xece6('0x23')]=function(_0x420ae7,_0x35e241){return db[_0xece6('0x2a')]['find']({'where':{'id':_0x420ae7['params']['id']}})[_0xece6('0x22')](handleEntityNotFound(_0x35e241,null))['then'](removeEntity(_0x35e241,null))[_0xece6('0x46')](handleError(_0x35e241,null));};exports[_0xece6('0x49')]=function(_0x167f3f,_0x3f4b1b){return db[_0xece6('0x2a')]['describe']()[_0xece6('0x22')](respondWithResult(_0x3f4b1b,null))[_0xece6('0x46')](handleError(_0x3f4b1b,null));}; \ No newline at end of file +var _0xded6=['then','destroy','sendStatus','error','stack','name','send','index','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','map','VIRTUAL','filter','merge','UserProfileSection','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update'];(function(_0x2a2da5,_0x2d46fd){var _0x3e70a1=function(_0x401dca){while(--_0x401dca){_0x2a2da5['push'](_0x2a2da5['shift']());}};_0x3e70a1(++_0x2d46fd);}(_0xded6,0xcb));var _0x6ded=function(_0x199f44,_0x189855){_0x199f44=_0x199f44-0x0;var _0x239077=_0xded6[_0x199f44];return _0x239077;};'use strict';var pdf=require(_0x6ded('0x0'));var emlformat=require(_0x6ded('0x1'));var rimraf=require(_0x6ded('0x2'));var zipdir=require(_0x6ded('0x3'));var jsonpatch=require(_0x6ded('0x4'));var rp=require(_0x6ded('0x5'));var moment=require(_0x6ded('0x6'));var BPromise=require(_0x6ded('0x7'));var Mustache=require(_0x6ded('0x8'));var util=require(_0x6ded('0x9'));var path=require(_0x6ded('0xa'));var sox=require(_0x6ded('0xb'));var csv=require(_0x6ded('0xc'));var ejs=require(_0x6ded('0xd'));var fs=require('fs');var _=require(_0x6ded('0xe'));var squel=require(_0x6ded('0xf'));var crypto=require(_0x6ded('0x10'));var jsforce=require(_0x6ded('0x11'));var deskjs=require(_0x6ded('0x12'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6ded('0x13'));var Redis=require(_0x6ded('0x14'));var authService=require(_0x6ded('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x6ded('0x16'));var hardwareService=require(_0x6ded('0x17'));var logger=require(_0x6ded('0x18'))(_0x6ded('0x19'));var utils=require(_0x6ded('0x1a'));var config=require(_0x6ded('0x1b'));var db=require(_0x6ded('0x1c'))['db'];function respondWithStatusCode(_0x53dcc2,_0x7e5216){_0x7e5216=_0x7e5216||0xcc;return function(_0x35eda2){if(_0x35eda2){return _0x53dcc2['sendStatus'](_0x7e5216);}return _0x53dcc2[_0x6ded('0x1d')](_0x7e5216)[_0x6ded('0x1e')]();};}function respondWithResult(_0x1e9239,_0x10105a){_0x10105a=_0x10105a||0xc8;return function(_0x5adae0){if(_0x5adae0){return _0x1e9239['status'](_0x10105a)[_0x6ded('0x1f')](_0x5adae0);}};}function respondWithFilteredResult(_0x56021f,_0x57e2a0){return function(_0xa660ae){if(_0xa660ae){var _0x49a575=_0xa660ae[_0x6ded('0x20')],_0x533348=_0x57e2a0[_0x6ded('0x21')],_0x2cbd59=_0x57e2a0[_0x6ded('0x21')]+_0x57e2a0[_0x6ded('0x22')],_0x5f4ae9;if(_0x2cbd59>=_0x49a575){_0x2cbd59=_0x49a575;_0x5f4ae9=0xc8;}else{_0x5f4ae9=0xce;}_0x56021f[_0x6ded('0x1d')](_0x5f4ae9);return _0x56021f[_0x6ded('0x23')](_0x6ded('0x24'),_0x533348+'-'+_0x2cbd59+'/'+_0x49a575)[_0x6ded('0x1f')](_0xa660ae);}return null;};}function patchUpdates(_0x337ec3){return function(_0x5e903f){try{jsonpatch['apply'](_0x5e903f,_0x337ec3,!![]);}catch(_0x2be5b3){return BPromise[_0x6ded('0x25')](_0x2be5b3);}return _0x5e903f[_0x6ded('0x26')]();};}function saveUpdates(_0xb6d72c,_0x1c5210){return function(_0x194732){if(_0x194732){return _0x194732[_0x6ded('0x27')](_0xb6d72c)[_0x6ded('0x28')](function(_0x3a21e8){return _0x3a21e8;});}return null;};}function removeEntity(_0x14d281,_0x58c6d5){return function(_0x1a0300){if(_0x1a0300){return _0x1a0300[_0x6ded('0x29')]()[_0x6ded('0x28')](function(){_0x14d281[_0x6ded('0x1d')](0xcc)[_0x6ded('0x1e')]();});}};}function handleEntityNotFound(_0x282dca,_0x1615c7){return function(_0x95e185){if(!_0x95e185){_0x282dca[_0x6ded('0x2a')](0x194);}return _0x95e185;};}function handleError(_0x5b535d,_0x3d33fc){_0x3d33fc=_0x3d33fc||0x1f4;return function(_0x542ca8){logger[_0x6ded('0x2b')](_0x542ca8[_0x6ded('0x2c')]);if(_0x542ca8[_0x6ded('0x2d')]){delete _0x542ca8[_0x6ded('0x2d')];}_0x5b535d[_0x6ded('0x1d')](_0x3d33fc)[_0x6ded('0x2e')](_0x542ca8);};}exports[_0x6ded('0x2f')]=function(_0x490992,_0x237a7e){var _0x3cedd8={},_0xea40b7={},_0x440d82={'count':0x0,'rows':[]};var _0x5a321e=_['map'](db['UserProfileSection']['rawAttributes'],function(_0x133c37){return{'name':_0x133c37[_0x6ded('0x30')],'type':_0x133c37[_0x6ded('0x31')]['key']};});_0xea40b7[_0x6ded('0x32')]=_['map'](_0x5a321e,_0x6ded('0x2d'));_0xea40b7[_0x6ded('0x33')]=_[_0x6ded('0x34')](_0x490992[_0x6ded('0x33')]);_0xea40b7[_0x6ded('0x35')]=_[_0x6ded('0x36')](_0xea40b7[_0x6ded('0x32')],_0xea40b7['query']);_0x3cedd8[_0x6ded('0x37')]=_[_0x6ded('0x36')](_0xea40b7[_0x6ded('0x32')],qs[_0x6ded('0x38')](_0x490992[_0x6ded('0x33')][_0x6ded('0x38')]));_0x3cedd8[_0x6ded('0x37')]=_0x3cedd8[_0x6ded('0x37')][_0x6ded('0x39')]?_0x3cedd8[_0x6ded('0x37')]:_0xea40b7[_0x6ded('0x32')];if(!_0x490992[_0x6ded('0x33')]['hasOwnProperty'](_0x6ded('0x3a'))){_0x3cedd8[_0x6ded('0x22')]=qs['limit'](_0x490992[_0x6ded('0x33')]['limit']);_0x3cedd8['offset']=qs[_0x6ded('0x21')](_0x490992[_0x6ded('0x33')][_0x6ded('0x21')]);}_0x3cedd8[_0x6ded('0x3b')]=qs[_0x6ded('0x3c')](_0x490992[_0x6ded('0x33')][_0x6ded('0x3c')]);_0x3cedd8['where']=qs['filters'](_[_0x6ded('0x3d')](_0x490992[_0x6ded('0x33')],_0xea40b7['filters']));if(_0x490992[_0x6ded('0x33')]['filter']){_0x3cedd8[_0x6ded('0x3e')]=_['merge'](_0x3cedd8[_0x6ded('0x3e')],{'$or':_[_0x6ded('0x3f')](_0x5a321e,function(_0x273990){if(_0x273990[_0x6ded('0x31')]!==_0x6ded('0x40')){var _0x2d2489={};_0x2d2489[_0x273990[_0x6ded('0x2d')]]={'$like':'%'+_0x490992[_0x6ded('0x33')][_0x6ded('0x41')]+'%'};return _0x2d2489;}})});}_0x3cedd8=_[_0x6ded('0x42')]({},_0x3cedd8,_0x490992['options']);var _0x232114={'where':_0x3cedd8[_0x6ded('0x3e')]};return db[_0x6ded('0x43')][_0x6ded('0x20')](_0x232114)[_0x6ded('0x28')](function(_0x2dd8c2){_0x440d82[_0x6ded('0x20')]=_0x2dd8c2;if(_0x490992[_0x6ded('0x33')][_0x6ded('0x44')]){_0x3cedd8[_0x6ded('0x45')]=[{'all':!![]}];}return db[_0x6ded('0x43')][_0x6ded('0x46')](_0x3cedd8);})[_0x6ded('0x28')](function(_0x1933d7){_0x440d82[_0x6ded('0x47')]=_0x1933d7;return _0x440d82;})[_0x6ded('0x28')](respondWithFilteredResult(_0x237a7e,_0x3cedd8))[_0x6ded('0x48')](handleError(_0x237a7e,null));};exports[_0x6ded('0x49')]=function(_0x2ce9ca,_0x34c79a){var _0x578927={'raw':![],'where':{'id':_0x2ce9ca[_0x6ded('0x4a')]['id']}},_0x1826da={};_0x1826da[_0x6ded('0x32')]=_[_0x6ded('0x34')](db[_0x6ded('0x43')][_0x6ded('0x4b')]);_0x1826da[_0x6ded('0x33')]=_[_0x6ded('0x34')](_0x2ce9ca[_0x6ded('0x33')]);_0x1826da[_0x6ded('0x35')]=_[_0x6ded('0x36')](_0x1826da[_0x6ded('0x32')],_0x1826da[_0x6ded('0x33')]);_0x578927[_0x6ded('0x37')]=_[_0x6ded('0x36')](_0x1826da['model'],qs['fields'](_0x2ce9ca['query']['fields']));_0x578927[_0x6ded('0x37')]=_0x578927['attributes'][_0x6ded('0x39')]?_0x578927[_0x6ded('0x37')]:_0x1826da['model'];if(_0x2ce9ca[_0x6ded('0x33')][_0x6ded('0x44')]){_0x578927['include']=[{'all':!![]}];}_0x578927=_[_0x6ded('0x42')]({},_0x578927,_0x2ce9ca[_0x6ded('0x4c')]);return db[_0x6ded('0x43')][_0x6ded('0x4d')](_0x578927)[_0x6ded('0x28')](handleEntityNotFound(_0x34c79a,null))['then'](respondWithResult(_0x34c79a,null))[_0x6ded('0x48')](handleError(_0x34c79a,null));};exports[_0x6ded('0x4e')]=function(_0x265196,_0x5bc409){return db[_0x6ded('0x43')]['create'](_0x265196[_0x6ded('0x4f')],{})['then'](respondWithResult(_0x5bc409,0xc9))[_0x6ded('0x48')](handleError(_0x5bc409,null));};exports[_0x6ded('0x27')]=function(_0xb603f6,_0x50a014){if(_0xb603f6['body']['id']){delete _0xb603f6['body']['id'];}return db['UserProfileSection']['find']({'where':{'id':_0xb603f6[_0x6ded('0x4a')]['id']}})[_0x6ded('0x28')](handleEntityNotFound(_0x50a014,null))[_0x6ded('0x28')](saveUpdates(_0xb603f6[_0x6ded('0x4f')],null))[_0x6ded('0x28')](respondWithResult(_0x50a014,null))['catch'](handleError(_0x50a014,null));};exports['destroy']=function(_0x157d4a,_0xab87da){return db[_0x6ded('0x43')][_0x6ded('0x4d')]({'where':{'id':_0x157d4a['params']['id']}})['then'](handleEntityNotFound(_0xab87da,null))[_0x6ded('0x28')](removeEntity(_0xab87da,null))[_0x6ded('0x48')](handleError(_0xab87da,null));};exports[_0x6ded('0x50')]=function(_0x1780f2,_0x79fc30){return db[_0x6ded('0x43')][_0x6ded('0x50')]()['then'](respondWithResult(_0x79fc30,null))['catch'](handleError(_0x79fc30,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 89fbf18..55ef6ab 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 _0x85da=['request-promise','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x443b20,_0x515e6b){var _0x5c008d=function(_0x2c4c49){while(--_0x2c4c49){_0x443b20['push'](_0x443b20['shift']());}};_0x5c008d(++_0x515e6b);}(_0x85da,0x1bc));var _0xa85d=function(_0x8854f2,_0x79542c){_0x8854f2=_0x8854f2-0x0;var _0x38505d=_0x85da[_0x8854f2];return _0x38505d;};'use strict';var _=require(_0xa85d('0x0'));var util=require(_0xa85d('0x1'));var logger=require(_0xa85d('0x2'))(_0xa85d('0x3'));var moment=require(_0xa85d('0x4'));var BPromise=require(_0xa85d('0x5'));var rp=require(_0xa85d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa85d('0x7'));var config=require('../../config/environment');var attributes=require(_0xa85d('0x8'));module[_0xa85d('0x9')]=function(_0x28860c,_0x75c0e6){return _0x28860c[_0xa85d('0xa')](_0xa85d('0xb'),attributes,{'tableName':_0xa85d('0xc'),'paranoid':![],'indexes':[{'name':_0xa85d('0xd'),'fields':['sectionId',_0xa85d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbca8=['path','rimraf','exports','define','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x2c0643,_0x49ccb4){var _0x1a1af9=function(_0x4b724c){while(--_0x4b724c){_0x2c0643['push'](_0x2c0643['shift']());}};_0x1a1af9(++_0x49ccb4);}(_0xbca8,0xcc));var _0x8bca=function(_0x4a359f,_0x47b0a2){_0x4a359f=_0x4a359f-0x0;var _0x3d682e=_0xbca8[_0x4a359f];return _0x3d682e;};'use strict';var _=require(_0x8bca('0x0'));var util=require(_0x8bca('0x1'));var logger=require(_0x8bca('0x2'))(_0x8bca('0x3'));var moment=require(_0x8bca('0x4'));var BPromise=require('bluebird');var rp=require(_0x8bca('0x5'));var fs=require('fs');var path=require(_0x8bca('0x6'));var rimraf=require(_0x8bca('0x7'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0x8bca('0x8')]=function(_0x2ecf60,_0x318474){return _0x2ecf60[_0x8bca('0x9')]('UserProfileSection',attributes,{'tableName':_0x8bca('0xa'),'paranoid':![],'indexes':[{'name':_0x8bca('0xb'),'fields':[_0x8bca('0xc'),_0x8bca('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 4265c4a..377a220 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 _0xb36e=['request','then','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','UserProfileSection,\x20%s,\x20%s','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb36e,0x9e));var _0xeb36=function(_0x346178,_0x369c3b){_0x346178=_0x346178-0x0;var _0x39808f=_0xb36e[_0x346178];return _0x39808f;};'use strict';var _=require(_0xeb36('0x0'));var util=require('util');var moment=require(_0xeb36('0x1'));var BPromise=require(_0xeb36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb36('0x3'));var db=require(_0xeb36('0x4'))['db'];var utils=require(_0xeb36('0x5'));var logger=require(_0xeb36('0x6'))(_0xeb36('0x7'));var config=require(_0xeb36('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xeb36('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bf1d4,_0x45c53a,_0x595d7f){return new BPromise(function(_0x42aedf,_0x297a78){return client[_0xeb36('0xa')](_0x2bf1d4,_0x595d7f)[_0xeb36('0xb')](function(_0xaa4795){logger[_0xeb36('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x45c53a,_0xeb36('0xd'));logger[_0xeb36('0xe')](_0xeb36('0xf'),_0x45c53a,_0xeb36('0xd'),JSON['stringify'](_0xaa4795));if(_0xaa4795[_0xeb36('0x10')]){if(_0xaa4795['error'][_0xeb36('0x11')]===0x1f4){logger[_0xeb36('0x10')](_0xeb36('0x12'),_0x45c53a,_0xaa4795[_0xeb36('0x10')][_0xeb36('0x13')]);return _0x297a78(_0xaa4795[_0xeb36('0x10')][_0xeb36('0x13')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x45c53a,_0xaa4795[_0xeb36('0x10')][_0xeb36('0x13')]);return _0x42aedf(_0xaa4795['error'][_0xeb36('0x13')]);}else{logger['info'](_0xeb36('0x12'),_0x45c53a,_0xeb36('0xd'));_0x42aedf(_0xaa4795[_0xeb36('0x14')][_0xeb36('0x13')]);}})['catch'](function(_0x5f5b1e){logger['error'](_0xeb36('0x12'),_0x45c53a,_0x5f5b1e);_0x297a78(_0x5f5b1e);});});} \ No newline at end of file +var _0x5cfb=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5cfb,0x1b5));var _0xb5cf=function(_0x39887a,_0x5835ca){_0x39887a=_0x39887a-0x0;var _0x1f8468=_0x5cfb[_0x39887a];return _0x1f8468;};'use strict';var _=require(_0xb5cf('0x0'));var util=require('util');var moment=require(_0xb5cf('0x1'));var BPromise=require(_0xb5cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5cf('0x3'));var db=require(_0xb5cf('0x4'))['db'];var utils=require(_0xb5cf('0x5'));var logger=require(_0xb5cf('0x6'))(_0xb5cf('0x7'));var config=require(_0xb5cf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb5cf('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34339a,_0x498fba,_0x3becef){return new BPromise(function(_0x26b40e,_0x5a8885){return client[_0xb5cf('0xa')](_0x34339a,_0x3becef)[_0xb5cf('0xb')](function(_0xe8e888){logger['info'](_0xb5cf('0xc'),_0x498fba,_0xb5cf('0xd'));logger[_0xb5cf('0xe')](_0xb5cf('0xf'),_0x498fba,_0xb5cf('0xd'),JSON[_0xb5cf('0x10')](_0xe8e888));if(_0xe8e888[_0xb5cf('0x11')]){if(_0xe8e888[_0xb5cf('0x11')][_0xb5cf('0x12')]===0x1f4){logger[_0xb5cf('0x11')](_0xb5cf('0xc'),_0x498fba,_0xe8e888['error'][_0xb5cf('0x13')]);return _0x5a8885(_0xe8e888[_0xb5cf('0x11')]['message']);}logger[_0xb5cf('0x11')](_0xb5cf('0xc'),_0x498fba,_0xe8e888[_0xb5cf('0x11')][_0xb5cf('0x13')]);return _0x26b40e(_0xe8e888[_0xb5cf('0x11')][_0xb5cf('0x13')]);}else{logger['info'](_0xb5cf('0xc'),_0x498fba,_0xb5cf('0xd'));_0x26b40e(_0xe8e888[_0xb5cf('0x14')][_0xb5cf('0x13')]);}})[_0xb5cf('0x15')](function(_0x2dcbb7){logger[_0xb5cf('0x11')](_0xb5cf('0xc'),_0x498fba,_0x2dcbb7);_0x5a8885(_0x2dcbb7);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index b7040fc..19cea6f 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 _0x9af2=['../../config/environment','exports','multer','util','connect-timeout','express','Router'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9af2,0x1d0));var _0x29af=function(_0x2a467b,_0x2613f0){_0x2a467b=_0x2a467b-0x0;var _0x5d6ccc=_0x9af2[_0x2a467b];return _0x5d6ccc;};'use strict';var multer=require(_0x29af('0x0'));var util=require(_0x29af('0x1'));var path=require('path');var timeout=require(_0x29af('0x2'));var express=require(_0x29af('0x3'));var router=express[_0x29af('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29af('0x5'));module[_0x29af('0x6')]=router; \ No newline at end of file +var _0x9ff9=['../../components/interaction/service','../../config/environment','exports','util','connect-timeout','express','../../components/auth/service'];(function(_0x598b56,_0x30e6ca){var _0x450f87=function(_0x510547){while(--_0x510547){_0x598b56['push'](_0x598b56['shift']());}};_0x450f87(++_0x30e6ca);}(_0x9ff9,0x1c3));var _0x99ff=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9ff9[_0x1ac595];return _0x455fff;};'use strict';var multer=require('multer');var util=require(_0x99ff('0x0'));var path=require('path');var timeout=require(_0x99ff('0x1'));var express=require(_0x99ff('0x2'));var router=express['Router']();var auth=require(_0x99ff('0x3'));var interaction=require(_0x99ff('0x4'));var config=require(_0x99ff('0x5'));module[_0x99ff('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 2f223a0..266815f 100644 --- a/server/api/userSmsQueue/userSmsQueue.attributes.js +++ b/server/api/userSmsQueue/userSmsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x3564d3,_0x40ae13){var _0x326e65=function(_0x1af50a){while(--_0x1af50a){_0x3564d3['push'](_0x3564d3['shift']());}};_0x326e65(++_0x40ae13);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb10b=['sequelize','INTEGER'];(function(_0x486243,_0xfb918b){var _0x4c4b02=function(_0xd7859b){while(--_0xd7859b){_0x486243['push'](_0x486243['shift']());}};_0x4c4b02(++_0xfb918b);}(_0xb10b,0x12a));var _0xbb10=function(_0x517724,_0x51e5c0){_0x517724=_0x517724-0x0;var _0x4c73a5=_0xb10b[_0x517724];return _0x4c73a5;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index d353bbd..c57f793 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 _0x5663=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger'];(function(_0x283acd,_0x135261){var _0x5099ad=function(_0x518310){while(--_0x518310){_0x283acd['push'](_0x283acd['shift']());}};_0x5099ad(++_0x135261);}(_0x5663,0x15c));var _0x3566=function(_0x4dd479,_0x26d87a){_0x4dd479=_0x4dd479-0x0;var _0x1b6807=_0x5663[_0x4dd479];return _0x1b6807;};'use strict';var _=require(_0x3566('0x0'));var util=require(_0x3566('0x1'));var logger=require(_0x3566('0x2'))(_0x3566('0x3'));var moment=require(_0x3566('0x4'));var BPromise=require(_0x3566('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3566('0x6'));var rimraf=require(_0x3566('0x7'));var config=require(_0x3566('0x8'));var attributes=require('./userSmsQueue.attributes');module[_0x3566('0x9')]=function(_0x5f0520,_0x1a0e5f){return _0x5f0520[_0x3566('0xa')](_0x3566('0xb'),attributes,{'tableName':_0x3566('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddf5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash','util'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xddf5,0xa6));var _0x5ddf=function(_0x3db2db,_0x2ee13b){_0x3db2db=_0x3db2db-0x0;var _0x2f18d3=_0xddf5[_0x3db2db];return _0x2f18d3;};'use strict';var _=require(_0x5ddf('0x0'));var util=require(_0x5ddf('0x1'));var logger=require(_0x5ddf('0x2'))(_0x5ddf('0x3'));var moment=require(_0x5ddf('0x4'));var BPromise=require(_0x5ddf('0x5'));var rp=require(_0x5ddf('0x6'));var fs=require('fs');var path=require(_0x5ddf('0x7'));var rimraf=require(_0x5ddf('0x8'));var config=require(_0x5ddf('0x9'));var attributes=require(_0x5ddf('0xa'));module[_0x5ddf('0xb')]=function(_0x2fc7fa,_0x5d7710){return _0x2fc7fa['define'](_0x5ddf('0xc'),attributes,{'tableName':_0x5ddf('0xd'),'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 f1484fb..5eb409c 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 _0x8097=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x8097,0x15c));var _0x7809=function(_0x203a61,_0xd5bf72){_0x203a61=_0x203a61-0x0;var _0xa15c39=_0x8097[_0x203a61];return _0xa15c39;};'use strict';var _=require('lodash');var util=require(_0x7809('0x0'));var moment=require(_0x7809('0x1'));var BPromise=require(_0x7809('0x2'));var rs=require(_0x7809('0x3'));var fs=require('fs');var Redis=require(_0x7809('0x4'));var db=require(_0x7809('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7809('0x6'))(_0x7809('0x7'));var config=require(_0x7809('0x8'));var jayson=require(_0x7809('0x9'));var client=jayson[_0x7809('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31e3ec,_0x5ab325,_0x5e4134){return new BPromise(function(_0x25f1b1,_0x5a03ea){return client[_0x7809('0xb')](_0x31e3ec,_0x5e4134)[_0x7809('0xc')](function(_0x20e441){logger['info'](_0x7809('0xd'),_0x5ab325,_0x7809('0xe'));logger[_0x7809('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x5ab325,_0x7809('0xe'),JSON[_0x7809('0x10')](_0x20e441));if(_0x20e441['error']){if(_0x20e441[_0x7809('0x11')][_0x7809('0x12')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x5ab325,_0x20e441[_0x7809('0x11')][_0x7809('0x13')]);return _0x5a03ea(_0x20e441[_0x7809('0x11')][_0x7809('0x13')]);}logger[_0x7809('0x11')](_0x7809('0xd'),_0x5ab325,_0x20e441[_0x7809('0x11')][_0x7809('0x13')]);return _0x25f1b1(_0x20e441['error'][_0x7809('0x13')]);}else{logger['info'](_0x7809('0xd'),_0x5ab325,_0x7809('0xe'));_0x25f1b1(_0x20e441[_0x7809('0x14')][_0x7809('0x13')]);}})[_0x7809('0x15')](function(_0x5d4808){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x5ab325,_0x5d4808);_0x5a03ea(_0x5d4808);});});} \ No newline at end of file +var _0x2715=['debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x54ce4a,_0x502cba){var _0x279dce=function(_0x217ed8){while(--_0x217ed8){_0x54ce4a['push'](_0x54ce4a['shift']());}};_0x279dce(++_0x502cba);}(_0x2715,0x135));var _0x5271=function(_0x503679,_0x1d99bf){_0x503679=_0x503679-0x0;var _0x2c6c2b=_0x2715[_0x503679];return _0x2c6c2b;};'use strict';var _=require(_0x5271('0x0'));var util=require('util');var moment=require(_0x5271('0x1'));var BPromise=require('bluebird');var rs=require(_0x5271('0x2'));var fs=require('fs');var Redis=require(_0x5271('0x3'));var db=require(_0x5271('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5271('0x5'))('rpc');var config=require(_0x5271('0x6'));var jayson=require(_0x5271('0x7'));var client=jayson[_0x5271('0x8')][_0x5271('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdbf9f7,_0x2f2dbd,_0x5653dd){return new BPromise(function(_0xd7209,_0x3cec10){return client[_0x5271('0xa')](_0xdbf9f7,_0x5653dd)[_0x5271('0xb')](function(_0x16af27){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x2f2dbd,_0x5271('0xc'));logger[_0x5271('0xd')](_0x5271('0xe'),_0x2f2dbd,'request\x20sent',JSON[_0x5271('0xf')](_0x16af27));if(_0x16af27['error']){if(_0x16af27[_0x5271('0x10')][_0x5271('0x11')]===0x1f4){logger[_0x5271('0x10')](_0x5271('0x12'),_0x2f2dbd,_0x16af27[_0x5271('0x10')][_0x5271('0x13')]);return _0x3cec10(_0x16af27[_0x5271('0x10')][_0x5271('0x13')]);}logger[_0x5271('0x10')](_0x5271('0x12'),_0x2f2dbd,_0x16af27[_0x5271('0x10')][_0x5271('0x13')]);return _0xd7209(_0x16af27[_0x5271('0x10')]['message']);}else{logger[_0x5271('0x14')](_0x5271('0x12'),_0x2f2dbd,_0x5271('0xc'));_0xd7209(_0x16af27[_0x5271('0x15')][_0x5271('0x13')]);}})[_0x5271('0x16')](function(_0x11407b){logger[_0x5271('0x10')](_0x5271('0x12'),_0x2f2dbd,_0x11407b);_0x3cec10(_0x11407b);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 0eae378..6b8c24f 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 _0xca19=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x4d03dc,_0x844f66){var _0x120af6=function(_0x2c9497){while(--_0x2c9497){_0x4d03dc['push'](_0x4d03dc['shift']());}};_0x120af6(++_0x844f66);}(_0xca19,0xf6));var _0x9ca1=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xca19[_0x576170];return _0x397c70;};'use strict';var multer=require(_0x9ca1('0x0'));var util=require(_0x9ca1('0x1'));var path=require(_0x9ca1('0x2'));var timeout=require(_0x9ca1('0x3'));var express=require(_0x9ca1('0x4'));var router=express[_0x9ca1('0x5')]();var auth=require(_0x9ca1('0x6'));var interaction=require(_0x9ca1('0x7'));var config=require(_0x9ca1('0x8'));module[_0x9ca1('0x9')]=router; \ No newline at end of file +var _0x3098=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x466247,_0x5d69e3){var _0x4b352e=function(_0x58c71b){while(--_0x58c71b){_0x466247['push'](_0x466247['shift']());}};_0x4b352e(++_0x5d69e3);}(_0x3098,0xb1));var _0x8309=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0x3098[_0x48326a];return _0x466709;};'use strict';var multer=require(_0x8309('0x0'));var util=require(_0x8309('0x1'));var path=require(_0x8309('0x2'));var timeout=require(_0x8309('0x3'));var express=require(_0x8309('0x4'));var router=express[_0x8309('0x5')]();var auth=require(_0x8309('0x6'));var interaction=require(_0x8309('0x7'));var config=require(_0x8309('0x8'));module[_0x8309('0x9')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 0339220..9a38cf0 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(_0x119fef,_0x4a8e7d){var _0x58bc5d=function(_0x2fbe20){while(--_0x2fbe20){_0x119fef['push'](_0x119fef['shift']());}};_0x58bc5d(++_0x4a8e7d);}(_0xe706,0xa3));var _0x6e70=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xe706[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x3cd4df,_0x756389){var _0x54a719=function(_0x23e451){while(--_0x23e451){_0x3cd4df['push'](_0x3cd4df['shift']());}};_0x54a719(++_0x756389);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 424337e..9052366 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 _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','util'];(function(_0x949766,_0x20516f){var _0x56f088=function(_0x27f5da){while(--_0x27f5da){_0x949766['push'](_0x949766['shift']());}};_0x56f088(++_0x20516f);}(_0x9f62,0x154));var _0x29f6=function(_0x39d909,_0x100306){_0x39d909=_0x39d909-0x0;var _0x15800f=_0x9f62[_0x39d909];return _0x15800f;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['user_has_voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue'];(function(_0x1491f8,_0x591f45){var _0x494cd3=function(_0x2a154e){while(--_0x2a154e){_0x1491f8['push'](_0x1491f8['shift']());}};_0x494cd3(++_0x591f45);}(_0x34e8,0x12c));var _0x834e=function(_0xe2652e,_0x293a23){_0xe2652e=_0xe2652e-0x0;var _0x19077b=_0x34e8[_0xe2652e];return _0x19077b;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 3ee7931..de9c755 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 _0xba5d=['stringify','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xba5d,0x12a));var _0xdba5=function(_0x23c028,_0x22c810){_0x23c028=_0x23c028-0x0;var _0x310f0d=_0xba5d[_0x23c028];return _0x310f0d;};'use strict';var _=require(_0xdba5('0x0'));var util=require('util');var moment=require(_0xdba5('0x1'));var BPromise=require(_0xdba5('0x2'));var rs=require(_0xdba5('0x3'));var fs=require('fs');var Redis=require(_0xdba5('0x4'));var db=require(_0xdba5('0x5'))['db'];var utils=require(_0xdba5('0x6'));var logger=require(_0xdba5('0x7'))(_0xdba5('0x8'));var config=require(_0xdba5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdba5('0xa')][_0xdba5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x506fdd,_0x320659,_0x561d38){return new BPromise(function(_0x2ee233,_0x3f7465){return client['request'](_0x506fdd,_0x561d38)[_0xdba5('0xc')](function(_0x546ccd){logger[_0xdba5('0xd')](_0xdba5('0xe'),_0x320659,_0xdba5('0xf'));logger['debug'](_0xdba5('0x10'),_0x320659,_0xdba5('0xf'),JSON[_0xdba5('0x11')](_0x546ccd));if(_0x546ccd['error']){if(_0x546ccd[_0xdba5('0x12')][_0xdba5('0x13')]===0x1f4){logger[_0xdba5('0x12')](_0xdba5('0xe'),_0x320659,_0x546ccd[_0xdba5('0x12')][_0xdba5('0x14')]);return _0x3f7465(_0x546ccd[_0xdba5('0x12')][_0xdba5('0x14')]);}logger[_0xdba5('0x12')](_0xdba5('0xe'),_0x320659,_0x546ccd[_0xdba5('0x12')][_0xdba5('0x14')]);return _0x2ee233(_0x546ccd['error'][_0xdba5('0x14')]);}else{logger[_0xdba5('0xd')](_0xdba5('0xe'),_0x320659,_0xdba5('0xf'));_0x2ee233(_0x546ccd['result']['message']);}})['catch'](function(_0x20cff2){logger[_0xdba5('0x12')](_0xdba5('0xe'),_0x320659,_0x20cff2);_0x3f7465(_0x20cff2);});});} \ No newline at end of file +var _0x834d=['UserVoiceQueue,\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','jayson/promise','http','then','info','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x285824,_0x3da647){var _0x311d7e=function(_0x2f3de0){while(--_0x2f3de0){_0x285824['push'](_0x285824['shift']());}};_0x311d7e(++_0x3da647);}(_0x834d,0xee));var _0xd834=function(_0x1f51ab,_0x25803d){_0x1f51ab=_0x1f51ab-0x0;var _0xb033ab=_0x834d[_0x1f51ab];return _0xb033ab;};'use strict';var _=require('lodash');var util=require(_0xd834('0x0'));var moment=require(_0xd834('0x1'));var BPromise=require(_0xd834('0x2'));var rs=require(_0xd834('0x3'));var fs=require('fs');var Redis=require(_0xd834('0x4'));var db=require(_0xd834('0x5'))['db'];var utils=require(_0xd834('0x6'));var logger=require(_0xd834('0x7'))(_0xd834('0x8'));var config=require(_0xd834('0x9'));var jayson=require(_0xd834('0xa'));var client=jayson['client'][_0xd834('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2844f6,_0x7a4930,_0x377a74){return new BPromise(function(_0x1ef6ba,_0x57c6dc){return client['request'](_0x2844f6,_0x377a74)[_0xd834('0xc')](function(_0x1af4d2){logger[_0xd834('0xd')](_0xd834('0xe'),_0x7a4930,'request\x20sent');logger['debug'](_0xd834('0xf'),_0x7a4930,_0xd834('0x10'),JSON[_0xd834('0x11')](_0x1af4d2));if(_0x1af4d2['error']){if(_0x1af4d2[_0xd834('0x12')][_0xd834('0x13')]===0x1f4){logger[_0xd834('0x12')](_0xd834('0xe'),_0x7a4930,_0x1af4d2[_0xd834('0x12')]['message']);return _0x57c6dc(_0x1af4d2['error']['message']);}logger[_0xd834('0x12')](_0xd834('0xe'),_0x7a4930,_0x1af4d2[_0xd834('0x12')][_0xd834('0x14')]);return _0x1ef6ba(_0x1af4d2[_0xd834('0x12')]['message']);}else{logger['info'](_0xd834('0xe'),_0x7a4930,_0xd834('0x10'));_0x1ef6ba(_0x1af4d2[_0xd834('0x15')][_0xd834('0x14')]);}})[_0xd834('0x16')](function(_0x23c8ea){logger[_0xd834('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x7a4930,_0x23c8ea);_0x57c6dc(_0x23c8ea);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 7ff91ee..c6ebff9 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 _0x8688=['express','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x2b51f4,_0x423095){var _0x50e887=function(_0x5bb107){while(--_0x5bb107){_0x2b51f4['push'](_0x2b51f4['shift']());}};_0x50e887(++_0x423095);}(_0x8688,0x169));var _0x8868=function(_0x3a81c6,_0x2f119b){_0x3a81c6=_0x3a81c6-0x0;var _0x447192=_0x8688[_0x3a81c6];return _0x447192;};'use strict';var multer=require(_0x8868('0x0'));var util=require(_0x8868('0x1'));var path=require(_0x8868('0x2'));var timeout=require('connect-timeout');var express=require(_0x8868('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8868('0x4'));var config=require(_0x8868('0x5'));module[_0x8868('0x6')]=router; \ No newline at end of file +var _0xcfcc=['../../components/interaction/service','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1f172b,_0x2d8029){var _0x569c17=function(_0x12dda5){while(--_0x12dda5){_0x1f172b['push'](_0x1f172b['shift']());}};_0x569c17(++_0x2d8029);}(_0xcfcc,0x1cd));var _0xccfc=function(_0x4a8197,_0x5a2be8){_0x4a8197=_0x4a8197-0x0;var _0x4971d0=_0xcfcc[_0x4a8197];return _0x4971d0;};'use strict';var multer=require(_0xccfc('0x0'));var util=require(_0xccfc('0x1'));var path=require(_0xccfc('0x2'));var timeout=require(_0xccfc('0x3'));var express=require(_0xccfc('0x4'));var router=express[_0xccfc('0x5')]();var auth=require(_0xccfc('0x6'));var interaction=require(_0xccfc('0x7'));var config=require('../../config/environment');module[_0xccfc('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index e260c50..4977c76 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 _0x1a00=['exports','INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface'];(function(_0x46eff9,_0x36b8a2){var _0x5c84f9=function(_0x19e5a9){while(--_0x19e5a9){_0x46eff9['push'](_0x46eff9['shift']());}};_0x5c84f9(++_0x36b8a2);}(_0x1a00,0x1e5));var _0x01a0=function(_0xefd5a0,_0x3023a5){_0xefd5a0=_0xefd5a0-0x0;var _0xbcbb09=_0x1a00[_0xefd5a0];return _0xbcbb09;};'use strict';var Sequelize=require('sequelize');module[_0x01a0('0x0')]={'uniqueid':{'type':Sequelize[_0x01a0('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x01a0('0x2')],'allowNull':![],'comment':_0x01a0('0x3')},'UserId':{'type':Sequelize[_0x01a0('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x01a0('0x2')],'allowNull':![],'unique':_0x01a0('0x4'),'comment':_0x01a0('0x3')},'VoiceQueueId':{'type':Sequelize[_0x01a0('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x01a0('0x2')],'allowNull':![],'unique':_0x01a0('0x4'),'comment':_0x01a0('0x3')},'penalty':{'type':Sequelize[_0x01a0('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x01a0('0x1')](0xb),'defaultValue':0x0,'comment':_0x01a0('0x3')}}; \ No newline at end of file +var _0xa4df=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x2ca23d,_0x3c80c1){var _0x4562ce=function(_0x3285d7){while(--_0x3285d7){_0x2ca23d['push'](_0x2ca23d['shift']());}};_0x4562ce(++_0x3c80c1);}(_0xa4df,0x169));var _0xfa4d=function(_0x51ca98,_0x3bfc6d){_0x51ca98=_0x51ca98-0x0;var _0xf175a8=_0xa4df[_0x51ca98];return _0xf175a8;};'use strict';var Sequelize=require(_0xfa4d('0x0'));module[_0xfa4d('0x1')]={'uniqueid':{'type':Sequelize[_0xfa4d('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xfa4d('0x3')},'UserId':{'type':Sequelize[_0xfa4d('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xfa4d('0x4')],'allowNull':![],'unique':_0xfa4d('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xfa4d('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xfa4d('0x4')],'allowNull':![],'unique':_0xfa4d('0x5'),'comment':_0xfa4d('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xfa4d('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index ff75361..31e63fe 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 _0x9d47=['exports','events','../../mysqldb','UserVoiceQueueRt','save','remove','emit','hasOwnProperty','hook'];(function(_0x2ac9a1,_0xb0fe08){var _0x347dc4=function(_0x1e4fca){while(--_0x1e4fca){_0x2ac9a1['push'](_0x2ac9a1['shift']());}};_0x347dc4(++_0xb0fe08);}(_0x9d47,0xa3));var _0x79d4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9d47[_0x565c49];return _0x20ca34;};'use strict';var EventEmitter=require(_0x79d4('0x0'));var UserVoiceQueueRt=require(_0x79d4('0x1'))['db'][_0x79d4('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x79d4('0x3'),'afterUpdate':'update','afterDestroy':_0x79d4('0x4')};function emitEvent(_0xa3c3ce){return function(_0x292656,_0x5ef503,_0x2be43f){UserVoiceQueueRtEvents[_0x79d4('0x5')](_0xa3c3ce+':'+_0x292656['id'],_0x292656);UserVoiceQueueRtEvents[_0x79d4('0x5')](_0xa3c3ce,_0x292656);_0x2be43f(null);};}for(var e in events){if(events[_0x79d4('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x79d4('0x7')](e,emitEvent(event));}}module[_0x79d4('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x2d76=['setMaxListeners','save','update','remove','hook','exports','events','../../mysqldb'];(function(_0x4c736e,_0x23d336){var _0x534359=function(_0x490fd1){while(--_0x490fd1){_0x4c736e['push'](_0x4c736e['shift']());}};_0x534359(++_0x23d336);}(_0x2d76,0x176));var _0x62d7=function(_0x3862e6,_0x168099){_0x3862e6=_0x3862e6-0x0;var _0x50b550=_0x2d76[_0x3862e6];return _0x50b550;};'use strict';var EventEmitter=require(_0x62d7('0x0'));var UserVoiceQueueRt=require(_0x62d7('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x62d7('0x2')](0x0);var events={'afterCreate':_0x62d7('0x3'),'afterUpdate':_0x62d7('0x4'),'afterDestroy':_0x62d7('0x5')};function emitEvent(_0x4e8bf9){return function(_0xc9c144,_0x4ed563,_0x2f9164){UserVoiceQueueRtEvents['emit'](_0x4e8bf9+':'+_0xc9c144['id'],_0xc9c144);UserVoiceQueueRtEvents['emit'](_0x4e8bf9,_0xc9c144);_0x2f9164(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x62d7('0x6')](e,emitEvent(event));}}module[_0x62d7('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index a361fa6..4fd7b20 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 _0x60bf=['moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','api'];(function(_0x4bb926,_0x4f1991){var _0x827773=function(_0x724ebd){while(--_0x724ebd){_0x4bb926['push'](_0x4bb926['shift']());}};_0x827773(++_0x4f1991);}(_0x60bf,0xad));var _0xf60b=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x60bf[_0x34843e];return _0x598f7f;};'use strict';var _=require('lodash');var util=require(_0xf60b('0x0'));var logger=require(_0xf60b('0x1'))(_0xf60b('0x2'));var moment=require(_0xf60b('0x3'));var BPromise=require(_0xf60b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf60b('0x5'));var rimraf=require(_0xf60b('0x6'));var config=require(_0xf60b('0x7'));var attributes=require(_0xf60b('0x8'));module['exports']=function(_0x1db8b7,_0x171fef){return _0x1db8b7['define'](_0xf60b('0x9'),attributes,{'tableName':_0xf60b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x972d=['UserVoiceQueueRt','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports'];(function(_0x15bab3,_0x28208b){var _0x56fbf8=function(_0x486317){while(--_0x486317){_0x15bab3['push'](_0x15bab3['shift']());}};_0x56fbf8(++_0x28208b);}(_0x972d,0xdd));var _0xd972=function(_0x3d7221,_0x306cbf){_0x3d7221=_0x3d7221-0x0;var _0xfee22=_0x972d[_0x3d7221];return _0xfee22;};'use strict';var _=require(_0xd972('0x0'));var util=require(_0xd972('0x1'));var logger=require(_0xd972('0x2'))('api');var moment=require(_0xd972('0x3'));var BPromise=require(_0xd972('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd972('0x5'));var rimraf=require(_0xd972('0x6'));var config=require(_0xd972('0x7'));var attributes=require(_0xd972('0x8'));module[_0xd972('0x9')]=function(_0xb684e4,_0x105367){return _0xb684e4['define'](_0xd972('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index d5cf102..96f2a73 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 _0x8b1d=['jayson/promise','client','defaults','redis','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','COUNT','sequelize','stringify','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5f1ee6,_0x1ca95a){var _0x123509=function(_0x2823f6){while(--_0x2823f6){_0x5f1ee6['push'](_0x5f1ee6['shift']());}};_0x123509(++_0x1ca95a);}(_0x8b1d,0xe6));var _0xd8b1=function(_0x2bfe50,_0x4a8a57){_0x2bfe50=_0x2bfe50-0x0;var _0x4d12c0=_0x8b1d[_0x2bfe50];return _0x4d12c0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd8b1('0x0'));var BPromise=require(_0xd8b1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8b1('0x2'));var db=require(_0xd8b1('0x3'))['db'];var utils=require(_0xd8b1('0x4'));var logger=require(_0xd8b1('0x5'))(_0xd8b1('0x6'));var config=require(_0xd8b1('0x7'));var jayson=require(_0xd8b1('0x8'));var client=jayson[_0xd8b1('0x9')]['http']({'port':0x232a});config['redis']=_[_0xd8b1('0xa')](config[_0xd8b1('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd8b1('0xc'))(new Redis(config[_0xd8b1('0xb')]));require(_0xd8b1('0xd'))[_0xd8b1('0xe')](socket);function respondWithRpcPromise(_0x5aa6d8,_0x9f09f8,_0x50a133){return new BPromise(function(_0x4292c6,_0x12f33b){return client['request'](_0x5aa6d8,_0x50a133)[_0xd8b1('0xf')](function(_0x9256ab){logger[_0xd8b1('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x9f09f8,_0xd8b1('0x11'));logger[_0xd8b1('0x12')](_0xd8b1('0x13'),_0x9f09f8,_0xd8b1('0x11'),JSON['stringify'](_0x9256ab));if(_0x9256ab[_0xd8b1('0x14')]){if(_0x9256ab[_0xd8b1('0x14')][_0xd8b1('0x15')]===0x1f4){logger[_0xd8b1('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x9f09f8,_0x9256ab[_0xd8b1('0x14')][_0xd8b1('0x16')]);return _0x12f33b(_0x9256ab[_0xd8b1('0x14')][_0xd8b1('0x16')]);}logger['error'](_0xd8b1('0x17'),_0x9f09f8,_0x9256ab[_0xd8b1('0x14')][_0xd8b1('0x16')]);return _0x4292c6(_0x9256ab['error'][_0xd8b1('0x16')]);}else{logger[_0xd8b1('0x10')](_0xd8b1('0x17'),_0x9f09f8,_0xd8b1('0x11'));_0x4292c6(_0x9256ab[_0xd8b1('0x18')][_0xd8b1('0x16')]);}})['catch'](function(_0x2349d9){logger[_0xd8b1('0x14')](_0xd8b1('0x17'),_0x9f09f8,_0x2349d9);_0x12f33b(_0x2349d9);});});}exports[_0xd8b1('0x19')]=function(_0x7d3737){var _0x108814=this;return new Promise(function(_0x1647b9,_0x4f542b){return db[_0xd8b1('0x1a')][_0xd8b1('0x1b')]({'raw':_0x7d3737[_0xd8b1('0x1c')]?_0x7d3737[_0xd8b1('0x1c')][_0xd8b1('0x1d')]===undefined?!![]:![]:!![],'where':_0x7d3737['options']?_0x7d3737['options']['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xd8b1('0x1e'),db[_0xd8b1('0x1f')]['fn']('IF',db[_0xd8b1('0x1f')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0xd8b1('0xf')](function(_0x24a23a){logger[_0xd8b1('0x10')](_0xd8b1('0x19'),_0x7d3737);logger[_0xd8b1('0x12')]('GetVoiceQueueRtPauses',_0x7d3737,JSON[_0xd8b1('0x20')](_0x24a23a));_0x1647b9(_0x24a23a);})[_0xd8b1('0x21')](function(_0x533abb){logger[_0xd8b1('0x14')](_0xd8b1('0x19'),_0x533abb[_0xd8b1('0x16')],_0x7d3737);_0x4f542b(_0x108814[_0xd8b1('0x14')](0x1f4,_0x533abb['message']));});});}; \ No newline at end of file +var _0x5c96=['result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2888fa,_0x550547){var _0x363223=function(_0x295355){while(--_0x295355){_0x2888fa['push'](_0x2888fa['shift']());}};_0x363223(++_0x550547);}(_0x5c96,0x123));var _0x65c9=function(_0x5d9150,_0x184c51){_0x5d9150=_0x5d9150-0x0;var _0x351432=_0x5c96[_0x5d9150];return _0x351432;};'use strict';var _=require(_0x65c9('0x0'));var util=require('util');var moment=require(_0x65c9('0x1'));var BPromise=require('bluebird');var rs=require(_0x65c9('0x2'));var fs=require('fs');var Redis=require(_0x65c9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x65c9('0x4'));var logger=require(_0x65c9('0x5'))(_0x65c9('0x6'));var config=require('../../config/environment');var jayson=require(_0x65c9('0x7'));var client=jayson['client'][_0x65c9('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x65c9('0x9')],{'host':_0x65c9('0xa'),'port':0x18eb});var socket=require(_0x65c9('0xb'))(new Redis(config[_0x65c9('0x9')]));require(_0x65c9('0xc'))[_0x65c9('0xd')](socket);function respondWithRpcPromise(_0x3ba323,_0x46bd85,_0x57b3bc){return new BPromise(function(_0x5bb0be,_0x4d14a9){return client[_0x65c9('0xe')](_0x3ba323,_0x57b3bc)[_0x65c9('0xf')](function(_0x70c0f2){logger[_0x65c9('0x10')](_0x65c9('0x11'),_0x46bd85,_0x65c9('0x12'));logger[_0x65c9('0x13')](_0x65c9('0x14'),_0x46bd85,_0x65c9('0x12'),JSON['stringify'](_0x70c0f2));if(_0x70c0f2[_0x65c9('0x15')]){if(_0x70c0f2[_0x65c9('0x15')][_0x65c9('0x16')]===0x1f4){logger[_0x65c9('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x46bd85,_0x70c0f2['error'][_0x65c9('0x17')]);return _0x4d14a9(_0x70c0f2[_0x65c9('0x15')]['message']);}logger[_0x65c9('0x15')](_0x65c9('0x11'),_0x46bd85,_0x70c0f2[_0x65c9('0x15')][_0x65c9('0x17')]);return _0x5bb0be(_0x70c0f2[_0x65c9('0x15')][_0x65c9('0x17')]);}else{logger[_0x65c9('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x46bd85,_0x65c9('0x12'));_0x5bb0be(_0x70c0f2[_0x65c9('0x18')]['message']);}})[_0x65c9('0x19')](function(_0x306205){logger['error'](_0x65c9('0x11'),_0x46bd85,_0x306205);_0x4d14a9(_0x306205);});});}exports[_0x65c9('0x1a')]=function(_0x574ece){var _0x27e8a9=this;return new Promise(function(_0x140f5e,_0x21ed6f){return db[_0x65c9('0x1b')][_0x65c9('0x1c')]({'raw':_0x574ece[_0x65c9('0x1d')]?_0x574ece[_0x65c9('0x1d')][_0x65c9('0x1e')]===undefined?!![]:![]:!![],'where':_0x574ece[_0x65c9('0x1d')]?_0x574ece[_0x65c9('0x1d')][_0x65c9('0x1f')]||null:null,'attributes':[[db[_0x65c9('0x20')]['fn'](_0x65c9('0x21'),db[_0x65c9('0x20')]['fn']('IF',db[_0x65c9('0x20')][_0x65c9('0x22')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0x65c9('0xf')](function(_0x47e7c7){logger['info']('GetVoiceQueueRtPauses',_0x574ece);logger[_0x65c9('0x13')]('GetVoiceQueueRtPauses',_0x574ece,JSON['stringify'](_0x47e7c7));_0x140f5e(_0x47e7c7);})[_0x65c9('0x19')](function(_0x783d04){logger[_0x65c9('0x15')](_0x65c9('0x1a'),_0x783d04[_0x65c9('0x17')],_0x574ece);_0x21ed6f(_0x27e8a9[_0x65c9('0x15')](0x1f4,_0x783d04[_0x65c9('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 0bd764f..2a2f9a9 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 _0xf452=['register','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit','removeListener'];(function(_0x38c3f5,_0x4786cd){var _0x2d4717=function(_0x18852a){while(--_0x18852a){_0x38c3f5['push'](_0x38c3f5['shift']());}};_0x2d4717(++_0x4786cd);}(_0xf452,0x162));var _0x2f45=function(_0x58336e,_0x38280a){_0x58336e=_0x58336e-0x0;var _0x158eea=_0xf452[_0x58336e];return _0x158eea;};'use strict';var UserVoiceQueueRtEvents=require(_0x2f45('0x0'));var events=[_0x2f45('0x1'),_0x2f45('0x2'),_0x2f45('0x3')];function createListener(_0x2157ef,_0x421d0a){return function(_0x57aaa0){_0x421d0a[_0x2f45('0x4')](_0x2157ef,_0x57aaa0);};}function removeListener(_0x4e60ce,_0x5a2af4){return function(){UserVoiceQueueRtEvents[_0x2f45('0x5')](_0x4e60ce,_0x5a2af4);};}exports[_0x2f45('0x6')]=function(_0x5467b2){for(var _0x71e9c1=0x0,_0x2ea975=events['length'];_0x71e9c1<_0x2ea975;_0x71e9c1++){var _0x3a8815=events[_0x71e9c1];var _0x386057=createListener(_0x2f45('0x7')+_0x3a8815,_0x5467b2);UserVoiceQueueRtEvents['on'](_0x3a8815,_0x386057);}}; \ No newline at end of file +var _0xbb37=['register','length','userVoiceQueueRt:','remove','update','emit','removeListener'];(function(_0x3ba8dd,_0x4eaaf3){var _0x4a82fe=function(_0x9f806a){while(--_0x9f806a){_0x3ba8dd['push'](_0x3ba8dd['shift']());}};_0x4a82fe(++_0x4eaaf3);}(_0xbb37,0x1b5));var _0x7bb3=function(_0x1ffc7e,_0x237138){_0x1ffc7e=_0x1ffc7e-0x0;var _0x3fcf02=_0xbb37[_0x1ffc7e];return _0x3fcf02;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save',_0x7bb3('0x0'),_0x7bb3('0x1')];function createListener(_0x32a6ec,_0xb959cb){return function(_0x3db178){_0xb959cb[_0x7bb3('0x2')](_0x32a6ec,_0x3db178);};}function removeListener(_0x4977ac,_0x43a015){return function(){UserVoiceQueueRtEvents[_0x7bb3('0x3')](_0x4977ac,_0x43a015);};}exports[_0x7bb3('0x4')]=function(_0x1d9001){for(var _0x52a71e=0x0,_0x3aa990=events[_0x7bb3('0x5')];_0x52a71e<_0x3aa990;_0x52a71e++){var _0x43da59=events[_0x52a71e];var _0x1aa443=createListener(_0x7bb3('0x6')+_0x43da59,_0x1d9001);UserVoiceQueueRtEvents['on'](_0x43da59,_0x1aa443);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index d7403aa..4c60f34 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 _0x206e=['get','isAuthenticated','show','post','create','put','/:id','update','exports','path','Router','./variable.controller'];(function(_0x38c741,_0xcb0874){var _0x583c63=function(_0x418171){while(--_0x418171){_0x38c741['push'](_0x38c741['shift']());}};_0x583c63(++_0xcb0874);}(_0x206e,0x1d1));var _0xe206=function(_0x533ef3,_0x42fc7c){_0x533ef3=_0x533ef3-0x0;var _0x25ceac=_0x206e[_0x533ef3];return _0x25ceac;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe206('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe206('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe206('0x2'));router[_0xe206('0x3')]('/',auth[_0xe206('0x4')](),controller['index']);router[_0xe206('0x3')]('/:id',auth[_0xe206('0x4')](),controller[_0xe206('0x5')]);router[_0xe206('0x6')]('/',auth[_0xe206('0x4')](),controller[_0xe206('0x7')]);router[_0xe206('0x8')](_0xe206('0x9'),auth[_0xe206('0x4')](),controller[_0xe206('0xa')]);router['delete'](_0xe206('0x9'),auth[_0xe206('0x4')](),controller['destroy']);module[_0xe206('0xb')]=router; \ No newline at end of file +var _0x733f=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3fda60,_0x2211f4){var _0x29e41d=function(_0x2d85d4){while(--_0x2d85d4){_0x3fda60['push'](_0x3fda60['shift']());}};_0x29e41d(++_0x2211f4);}(_0x733f,0xe3));var _0xf733=function(_0x264e7f,_0x4b8f91){_0x264e7f=_0x264e7f-0x0;var _0x173e6e=_0x733f[_0x264e7f];return _0x173e6e;};'use strict';var multer=require(_0xf733('0x0'));var util=require(_0xf733('0x1'));var path=require('path');var timeout=require(_0xf733('0x2'));var express=require('express');var router=express[_0xf733('0x3')]();var auth=require(_0xf733('0x4'));var interaction=require(_0xf733('0x5'));var config=require(_0xf733('0x6'));var controller=require('./variable.controller');router[_0xf733('0x7')]('/',auth[_0xf733('0x8')](),controller[_0xf733('0x9')]);router[_0xf733('0x7')](_0xf733('0xa'),auth[_0xf733('0x8')](),controller[_0xf733('0xb')]);router[_0xf733('0xc')]('/',auth[_0xf733('0x8')](),controller[_0xf733('0xd')]);router[_0xf733('0xe')](_0xf733('0xa'),auth[_0xf733('0x8')](),controller[_0xf733('0xf')]);router[_0xf733('0x10')](_0xf733('0xa'),auth['isAuthenticated'](),controller[_0xf733('0x11')]);module[_0xf733('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 2617c24..423dad7 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 _0x02f4=['exports','name','STRING','sequelize'];(function(_0x205eba,_0x396fc3){var _0x3485a9=function(_0x5e0c5f){while(--_0x5e0c5f){_0x205eba['push'](_0x205eba['shift']());}};_0x3485a9(++_0x396fc3);}(_0x02f4,0x1db));var _0x402f=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x02f4[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x402f('0x0'));module[_0x402f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x402f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x402f('0x3')]}}; \ No newline at end of file +var _0xcd1c=['exports','STRING','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcd1c,0x170));var _0xccd1=function(_0x46f815,_0x30d862){_0x46f815=_0x46f815-0x0;var _0x5b45de=_0xcd1c[_0x46f815];return _0x5b45de;};'use strict';var Sequelize=require(_0xccd1('0x0'));module[_0xccd1('0x1')]={'name':{'type':Sequelize[_0xccd1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xccd1('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 1020d3f..63a6616 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 _0xb7e9=['where','merge','VIRTUAL','options','rows','show','params','intersection','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','then','Variables','destroy','end','stack','name','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0x4009a7,_0x466f75){var _0x327ec4=function(_0x4fa745){while(--_0x4fa745){_0x4009a7['push'](_0x4009a7['shift']());}};_0x327ec4(++_0x466f75);}(_0xb7e9,0x67));var _0x9b7e=function(_0x226212,_0x3471a3){_0x226212=_0x226212-0x0;var _0x37e7bf=_0xb7e9[_0x226212];return _0x37e7bf;};'use strict';var pdf=require(_0x9b7e('0x0'));var emlformat=require(_0x9b7e('0x1'));var rimraf=require(_0x9b7e('0x2'));var zipdir=require(_0x9b7e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9b7e('0x4'));var moment=require(_0x9b7e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9b7e('0x6'));var path=require('path');var sox=require(_0x9b7e('0x7'));var csv=require(_0x9b7e('0x8'));var ejs=require(_0x9b7e('0x9'));var fs=require('fs');var _=require(_0x9b7e('0xa'));var squel=require('squel');var crypto=require(_0x9b7e('0xb'));var jsforce=require(_0x9b7e('0xc'));var deskjs=require(_0x9b7e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9b7e('0xe'));var Papa=require(_0x9b7e('0xf'));var Redis=require(_0x9b7e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9b7e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b7e('0x12'))(_0x9b7e('0x13'));var utils=require('../../config/utils');var config=require(_0x9b7e('0x14'));var db=require(_0x9b7e('0x15'))['db'];function respondWithStatusCode(_0x4ac72f,_0x1663fd){_0x1663fd=_0x1663fd||0xcc;return function(_0x58c66f){if(_0x58c66f){return _0x4ac72f[_0x9b7e('0x16')](_0x1663fd);}return _0x4ac72f[_0x9b7e('0x17')](_0x1663fd)['end']();};}function respondWithResult(_0x17da18,_0x434a5a){_0x434a5a=_0x434a5a||0xc8;return function(_0x112072){if(_0x112072){return _0x17da18[_0x9b7e('0x17')](_0x434a5a)[_0x9b7e('0x18')](_0x112072);}};}function respondWithFilteredResult(_0x15ff29,_0x5f4a31){return function(_0x305888){if(_0x305888){var _0x1d3d17=_0x305888[_0x9b7e('0x19')],_0x13df51=_0x5f4a31[_0x9b7e('0x1a')],_0x4e020c=_0x5f4a31[_0x9b7e('0x1a')]+_0x5f4a31[_0x9b7e('0x1b')],_0x2eefac;if(_0x4e020c>=_0x1d3d17){_0x4e020c=_0x1d3d17;_0x2eefac=0xc8;}else{_0x2eefac=0xce;}_0x15ff29[_0x9b7e('0x17')](_0x2eefac);return _0x15ff29[_0x9b7e('0x1c')]('Content-Range',_0x13df51+'-'+_0x4e020c+'/'+_0x1d3d17)[_0x9b7e('0x18')](_0x305888);}return null;};}function patchUpdates(_0x3eeb15){return function(_0x101028){try{jsonpatch[_0x9b7e('0x1d')](_0x101028,_0x3eeb15,!![]);}catch(_0x4cfe99){return BPromise[_0x9b7e('0x1e')](_0x4cfe99);}return _0x101028['save']();};}function saveUpdates(_0x1d09ca,_0x34563c){return function(_0x378578){if(_0x378578){return _0x378578['update'](_0x1d09ca)['then'](function(_0x16d178){return _0x16d178;});}return null;};}function removeEntity(_0xf3366d,_0xe7febe){return function(_0x2dd325){if(_0x2dd325){return _0x2dd325['destroy']()[_0x9b7e('0x1f')](function(){var _0x1f3e39=_0x2dd325['get']({'plain':!![]});var _0x19a6f3=_0x9b7e('0x20');return db['UserProfileResource'][_0x9b7e('0x21')]({'where':{'type':_0x19a6f3,'resourceId':_0x1f3e39['id']}})[_0x9b7e('0x1f')](function(){return _0x2dd325;});})[_0x9b7e('0x1f')](function(){_0xf3366d['status'](0xcc)[_0x9b7e('0x22')]();});}};}function handleEntityNotFound(_0x422603,_0x2a8974){return function(_0x5d551b){if(!_0x5d551b){_0x422603['sendStatus'](0x194);}return _0x5d551b;};}function handleError(_0x419644,_0x31413c){_0x31413c=_0x31413c||0x1f4;return function(_0x1db7d4){logger['error'](_0x1db7d4[_0x9b7e('0x23')]);if(_0x1db7d4['name']){delete _0x1db7d4[_0x9b7e('0x24')];}_0x419644[_0x9b7e('0x17')](_0x31413c)['send'](_0x1db7d4);};}exports[_0x9b7e('0x25')]=function(_0x410b67,_0x5eb409){var _0x17c1c3={},_0x54364d={},_0x1ed5a4={'count':0x0,'rows':[]};var _0x3eb7c9=_[_0x9b7e('0x26')](db[_0x9b7e('0x27')][_0x9b7e('0x28')],function(_0x106727){return{'name':_0x106727[_0x9b7e('0x29')],'type':_0x106727[_0x9b7e('0x2a')][_0x9b7e('0x2b')]};});_0x54364d[_0x9b7e('0x2c')]=_['map'](_0x3eb7c9,_0x9b7e('0x24'));_0x54364d[_0x9b7e('0x2d')]=_[_0x9b7e('0x2e')](_0x410b67[_0x9b7e('0x2d')]);_0x54364d[_0x9b7e('0x2f')]=_['intersection'](_0x54364d[_0x9b7e('0x2c')],_0x54364d[_0x9b7e('0x2d')]);_0x17c1c3['attributes']=_['intersection'](_0x54364d[_0x9b7e('0x2c')],qs[_0x9b7e('0x30')](_0x410b67[_0x9b7e('0x2d')][_0x9b7e('0x30')]));_0x17c1c3['attributes']=_0x17c1c3[_0x9b7e('0x31')][_0x9b7e('0x32')]?_0x17c1c3[_0x9b7e('0x31')]:_0x54364d[_0x9b7e('0x2c')];if(!_0x410b67[_0x9b7e('0x2d')][_0x9b7e('0x33')](_0x9b7e('0x34'))){_0x17c1c3[_0x9b7e('0x1b')]=qs[_0x9b7e('0x1b')](_0x410b67['query']['limit']);_0x17c1c3[_0x9b7e('0x1a')]=qs[_0x9b7e('0x1a')](_0x410b67['query'][_0x9b7e('0x1a')]);}_0x17c1c3[_0x9b7e('0x35')]=qs[_0x9b7e('0x36')](_0x410b67[_0x9b7e('0x2d')][_0x9b7e('0x36')]);_0x17c1c3['where']=qs[_0x9b7e('0x2f')](_[_0x9b7e('0x37')](_0x410b67['query'],_0x54364d[_0x9b7e('0x2f')]));if(_0x410b67[_0x9b7e('0x2d')][_0x9b7e('0x38')]){_0x17c1c3[_0x9b7e('0x39')]=_[_0x9b7e('0x3a')](_0x17c1c3[_0x9b7e('0x39')],{'$or':_[_0x9b7e('0x26')](_0x3eb7c9,function(_0x223b77){if(_0x223b77[_0x9b7e('0x2a')]!==_0x9b7e('0x3b')){var _0x4a7a39={};_0x4a7a39[_0x223b77[_0x9b7e('0x24')]]={'$like':'%'+_0x410b67[_0x9b7e('0x2d')][_0x9b7e('0x38')]+'%'};return _0x4a7a39;}})});}_0x17c1c3=_['merge']({},_0x17c1c3,_0x410b67[_0x9b7e('0x3c')]);var _0x514bca={'where':_0x17c1c3[_0x9b7e('0x39')]};return db[_0x9b7e('0x27')][_0x9b7e('0x19')](_0x514bca)[_0x9b7e('0x1f')](function(_0x30136c){_0x1ed5a4['count']=_0x30136c;if(_0x410b67[_0x9b7e('0x2d')]['includeAll']){_0x17c1c3['include']=[{'all':!![]}];}return db['Variable']['findAll'](_0x17c1c3);})[_0x9b7e('0x1f')](function(_0x58c085){_0x1ed5a4[_0x9b7e('0x3d')]=_0x58c085;return _0x1ed5a4;})[_0x9b7e('0x1f')](respondWithFilteredResult(_0x5eb409,_0x17c1c3))['catch'](handleError(_0x5eb409,null));};exports[_0x9b7e('0x3e')]=function(_0xf37e4c,_0x15b4c1){var _0x3b1a23={'raw':!![],'where':{'id':_0xf37e4c[_0x9b7e('0x3f')]['id']}},_0x2a24f6={};_0x2a24f6[_0x9b7e('0x2c')]=_[_0x9b7e('0x2e')](db[_0x9b7e('0x27')][_0x9b7e('0x28')]);_0x2a24f6['query']=_[_0x9b7e('0x2e')](_0xf37e4c[_0x9b7e('0x2d')]);_0x2a24f6[_0x9b7e('0x2f')]=_[_0x9b7e('0x40')](_0x2a24f6['model'],_0x2a24f6['query']);_0x3b1a23[_0x9b7e('0x31')]=_['intersection'](_0x2a24f6[_0x9b7e('0x2c')],qs[_0x9b7e('0x30')](_0xf37e4c[_0x9b7e('0x2d')]['fields']));_0x3b1a23[_0x9b7e('0x31')]=_0x3b1a23['attributes'][_0x9b7e('0x32')]?_0x3b1a23[_0x9b7e('0x31')]:_0x2a24f6[_0x9b7e('0x2c')];if(_0xf37e4c[_0x9b7e('0x2d')][_0x9b7e('0x41')]){_0x3b1a23[_0x9b7e('0x42')]=[{'all':!![]}];}_0x3b1a23=_[_0x9b7e('0x3a')]({},_0x3b1a23,_0xf37e4c['options']);return db['Variable'][_0x9b7e('0x43')](_0x3b1a23)[_0x9b7e('0x1f')](handleEntityNotFound(_0x15b4c1,null))[_0x9b7e('0x1f')](respondWithResult(_0x15b4c1,null))['catch'](handleError(_0x15b4c1,null));};exports['create']=function(_0x2f000c,_0x13bb93){return db['Variable'][_0x9b7e('0x44')](_0x2f000c[_0x9b7e('0x45')],{})[_0x9b7e('0x1f')](function(_0x5983e8){var _0x57991d=_0x2f000c[_0x9b7e('0x46')][_0x9b7e('0x47')]({'plain':!![]});if(!_0x57991d)throw new Error(_0x9b7e('0x48'));if(_0x57991d[_0x9b7e('0x49')]==='user'){var _0x38727f=_0x5983e8['get']({'plain':!![]});var _0x2a9655=_0x9b7e('0x20');return db[_0x9b7e('0x4a')][_0x9b7e('0x43')]({'where':{'name':_0x2a9655,'userProfileId':_0x57991d['userProfileId']},'raw':!![]})['then'](function(_0x8f06d9){if(_0x8f06d9&&_0x8f06d9[_0x9b7e('0x4b')]===0x0){return db[_0x9b7e('0x4c')][_0x9b7e('0x44')]({'name':_0x38727f[_0x9b7e('0x24')],'resourceId':_0x38727f['id'],'type':_0x8f06d9[_0x9b7e('0x24')],'sectionId':_0x8f06d9['id']},{})[_0x9b7e('0x1f')](function(){return _0x5983e8;});}else{return _0x5983e8;}})[_0x9b7e('0x4d')](function(_0x472321){logger[_0x9b7e('0x4e')](_0x9b7e('0x4f'),_0x472321);throw _0x472321;});}return _0x5983e8;})[_0x9b7e('0x1f')](respondWithResult(_0x13bb93,0xc9))[_0x9b7e('0x4d')](handleError(_0x13bb93,null));};exports['update']=function(_0x4a2a08,_0x9cc156){if(_0x4a2a08['body']['id']){delete _0x4a2a08[_0x9b7e('0x45')]['id'];}return db['Variable']['find']({'where':{'id':_0x4a2a08[_0x9b7e('0x3f')]['id']}})[_0x9b7e('0x1f')](handleEntityNotFound(_0x9cc156,null))[_0x9b7e('0x1f')](saveUpdates(_0x4a2a08[_0x9b7e('0x45')],null))[_0x9b7e('0x1f')](respondWithResult(_0x9cc156,null))[_0x9b7e('0x4d')](handleError(_0x9cc156,null));};exports[_0x9b7e('0x21')]=function(_0x88e634,_0x260d9c){return db[_0x9b7e('0x27')][_0x9b7e('0x43')]({'where':{'id':_0x88e634[_0x9b7e('0x3f')]['id']}})[_0x9b7e('0x1f')](handleEntityNotFound(_0x260d9c,null))[_0x9b7e('0x1f')](removeEntity(_0x260d9c,null))[_0x9b7e('0x4d')](handleError(_0x260d9c,null));}; \ No newline at end of file +var _0x46db=['query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','stack','name','index','Variable','rawAttributes','fieldName','type','key','model','map'];(function(_0x391df4,_0x864312){var _0x4876ad=function(_0x3de794){while(--_0x3de794){_0x391df4['push'](_0x391df4['shift']());}};_0x4876ad(++_0x864312);}(_0x46db,0x1c7));var _0xb46d=function(_0x28d540,_0x22edfd){_0x28d540=_0x28d540-0x0;var _0x193fc2=_0x46db[_0x28d540];return _0x193fc2;};'use strict';var pdf=require(_0xb46d('0x0'));var emlformat=require(_0xb46d('0x1'));var rimraf=require(_0xb46d('0x2'));var zipdir=require(_0xb46d('0x3'));var jsonpatch=require(_0xb46d('0x4'));var rp=require(_0xb46d('0x5'));var moment=require(_0xb46d('0x6'));var BPromise=require(_0xb46d('0x7'));var Mustache=require(_0xb46d('0x8'));var util=require('util');var path=require(_0xb46d('0x9'));var sox=require(_0xb46d('0xa'));var csv=require(_0xb46d('0xb'));var ejs=require(_0xb46d('0xc'));var fs=require('fs');var _=require(_0xb46d('0xd'));var squel=require(_0xb46d('0xe'));var crypto=require(_0xb46d('0xf'));var jsforce=require(_0xb46d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb46d('0xb'));var querystring=require(_0xb46d('0x11'));var Papa=require(_0xb46d('0x12'));var Redis=require(_0xb46d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb46d('0x14'));var as=require(_0xb46d('0x15'));var hardwareService=require(_0xb46d('0x16'));var logger=require(_0xb46d('0x17'))(_0xb46d('0x18'));var utils=require(_0xb46d('0x19'));var config=require(_0xb46d('0x1a'));var db=require(_0xb46d('0x1b'))['db'];function respondWithStatusCode(_0x5c71ce,_0x39e69b){_0x39e69b=_0x39e69b||0xcc;return function(_0x4e4d72){if(_0x4e4d72){return _0x5c71ce['sendStatus'](_0x39e69b);}return _0x5c71ce['status'](_0x39e69b)['end']();};}function respondWithResult(_0x45ed9e,_0x73e256){_0x73e256=_0x73e256||0xc8;return function(_0x44a28f){if(_0x44a28f){return _0x45ed9e[_0xb46d('0x1c')](_0x73e256)[_0xb46d('0x1d')](_0x44a28f);}};}function respondWithFilteredResult(_0x56ea57,_0x392a36){return function(_0x812b5f){if(_0x812b5f){var _0x52fe9a=_0x812b5f[_0xb46d('0x1e')],_0x3516d8=_0x392a36[_0xb46d('0x1f')],_0x4254c7=_0x392a36[_0xb46d('0x1f')]+_0x392a36[_0xb46d('0x20')],_0x196997;if(_0x4254c7>=_0x52fe9a){_0x4254c7=_0x52fe9a;_0x196997=0xc8;}else{_0x196997=0xce;}_0x56ea57[_0xb46d('0x1c')](_0x196997);return _0x56ea57[_0xb46d('0x21')](_0xb46d('0x22'),_0x3516d8+'-'+_0x4254c7+'/'+_0x52fe9a)[_0xb46d('0x1d')](_0x812b5f);}return null;};}function patchUpdates(_0x1a7674){return function(_0x7233f0){try{jsonpatch[_0xb46d('0x23')](_0x7233f0,_0x1a7674,!![]);}catch(_0x1f4187){return BPromise['reject'](_0x1f4187);}return _0x7233f0[_0xb46d('0x24')]();};}function saveUpdates(_0x5a3c02,_0x5e29dd){return function(_0x2c9354){if(_0x2c9354){return _0x2c9354[_0xb46d('0x25')](_0x5a3c02)[_0xb46d('0x26')](function(_0x321ce3){return _0x321ce3;});}return null;};}function removeEntity(_0x1c9910,_0xb716a6){return function(_0x1771cd){if(_0x1771cd){return _0x1771cd[_0xb46d('0x27')]()[_0xb46d('0x26')](function(){var _0x2c586c=_0x1771cd[_0xb46d('0x28')]({'plain':!![]});var _0x49394a='Variables';return db[_0xb46d('0x29')][_0xb46d('0x27')]({'where':{'type':_0x49394a,'resourceId':_0x2c586c['id']}})['then'](function(){return _0x1771cd;});})[_0xb46d('0x26')](function(){_0x1c9910[_0xb46d('0x1c')](0xcc)[_0xb46d('0x2a')]();});}};}function handleEntityNotFound(_0x39aeb0,_0x9990e7){return function(_0x3484cc){if(!_0x3484cc){_0x39aeb0[_0xb46d('0x2b')](0x194);}return _0x3484cc;};}function handleError(_0xd7c14b,_0x326433){_0x326433=_0x326433||0x1f4;return function(_0x2574aa){logger[_0xb46d('0x2c')](_0x2574aa[_0xb46d('0x2d')]);if(_0x2574aa[_0xb46d('0x2e')]){delete _0x2574aa[_0xb46d('0x2e')];}_0xd7c14b[_0xb46d('0x1c')](_0x326433)['send'](_0x2574aa);};}exports[_0xb46d('0x2f')]=function(_0x5f2c71,_0x6b5269){var _0x307f87={},_0x1f6fe5={},_0x338443={'count':0x0,'rows':[]};var _0x498d4b=_['map'](db[_0xb46d('0x30')][_0xb46d('0x31')],function(_0x6c8f7e){return{'name':_0x6c8f7e[_0xb46d('0x32')],'type':_0x6c8f7e[_0xb46d('0x33')][_0xb46d('0x34')]};});_0x1f6fe5[_0xb46d('0x35')]=_[_0xb46d('0x36')](_0x498d4b,_0xb46d('0x2e'));_0x1f6fe5[_0xb46d('0x37')]=_['keys'](_0x5f2c71[_0xb46d('0x37')]);_0x1f6fe5[_0xb46d('0x38')]=_[_0xb46d('0x39')](_0x1f6fe5['model'],_0x1f6fe5[_0xb46d('0x37')]);_0x307f87[_0xb46d('0x3a')]=_[_0xb46d('0x39')](_0x1f6fe5[_0xb46d('0x35')],qs[_0xb46d('0x3b')](_0x5f2c71['query'][_0xb46d('0x3b')]));_0x307f87[_0xb46d('0x3a')]=_0x307f87['attributes'][_0xb46d('0x3c')]?_0x307f87[_0xb46d('0x3a')]:_0x1f6fe5[_0xb46d('0x35')];if(!_0x5f2c71[_0xb46d('0x37')]['hasOwnProperty']('nolimit')){_0x307f87[_0xb46d('0x20')]=qs[_0xb46d('0x20')](_0x5f2c71[_0xb46d('0x37')]['limit']);_0x307f87['offset']=qs[_0xb46d('0x1f')](_0x5f2c71[_0xb46d('0x37')]['offset']);}_0x307f87['order']=qs[_0xb46d('0x3d')](_0x5f2c71[_0xb46d('0x37')][_0xb46d('0x3d')]);_0x307f87[_0xb46d('0x3e')]=qs[_0xb46d('0x38')](_[_0xb46d('0x3f')](_0x5f2c71[_0xb46d('0x37')],_0x1f6fe5['filters']));if(_0x5f2c71['query'][_0xb46d('0x40')]){_0x307f87['where']=_[_0xb46d('0x41')](_0x307f87[_0xb46d('0x3e')],{'$or':_[_0xb46d('0x36')](_0x498d4b,function(_0x1a95be){if(_0x1a95be['type']!==_0xb46d('0x42')){var _0x5b2c4d={};_0x5b2c4d[_0x1a95be['name']]={'$like':'%'+_0x5f2c71['query'][_0xb46d('0x40')]+'%'};return _0x5b2c4d;}})});}_0x307f87=_[_0xb46d('0x41')]({},_0x307f87,_0x5f2c71[_0xb46d('0x43')]);var _0x17594e={'where':_0x307f87[_0xb46d('0x3e')]};return db[_0xb46d('0x30')][_0xb46d('0x1e')](_0x17594e)[_0xb46d('0x26')](function(_0x54492f){_0x338443[_0xb46d('0x1e')]=_0x54492f;if(_0x5f2c71[_0xb46d('0x37')][_0xb46d('0x44')]){_0x307f87[_0xb46d('0x45')]=[{'all':!![]}];}return db[_0xb46d('0x30')]['findAll'](_0x307f87);})[_0xb46d('0x26')](function(_0x5d6782){_0x338443[_0xb46d('0x46')]=_0x5d6782;return _0x338443;})[_0xb46d('0x26')](respondWithFilteredResult(_0x6b5269,_0x307f87))[_0xb46d('0x47')](handleError(_0x6b5269,null));};exports[_0xb46d('0x48')]=function(_0x21b406,_0x50f8bb){var _0x37329e={'raw':!![],'where':{'id':_0x21b406['params']['id']}},_0x215abf={};_0x215abf[_0xb46d('0x35')]=_[_0xb46d('0x49')](db[_0xb46d('0x30')][_0xb46d('0x31')]);_0x215abf[_0xb46d('0x37')]=_[_0xb46d('0x49')](_0x21b406[_0xb46d('0x37')]);_0x215abf[_0xb46d('0x38')]=_[_0xb46d('0x39')](_0x215abf[_0xb46d('0x35')],_0x215abf[_0xb46d('0x37')]);_0x37329e['attributes']=_['intersection'](_0x215abf[_0xb46d('0x35')],qs['fields'](_0x21b406[_0xb46d('0x37')][_0xb46d('0x3b')]));_0x37329e['attributes']=_0x37329e[_0xb46d('0x3a')][_0xb46d('0x3c')]?_0x37329e[_0xb46d('0x3a')]:_0x215abf[_0xb46d('0x35')];if(_0x21b406[_0xb46d('0x37')][_0xb46d('0x44')]){_0x37329e[_0xb46d('0x45')]=[{'all':!![]}];}_0x37329e=_[_0xb46d('0x41')]({},_0x37329e,_0x21b406[_0xb46d('0x43')]);return db[_0xb46d('0x30')][_0xb46d('0x4a')](_0x37329e)[_0xb46d('0x26')](handleEntityNotFound(_0x50f8bb,null))[_0xb46d('0x26')](respondWithResult(_0x50f8bb,null))[_0xb46d('0x47')](handleError(_0x50f8bb,null));};exports['create']=function(_0xfc1017,_0x4b8210){return db[_0xb46d('0x30')][_0xb46d('0x4b')](_0xfc1017[_0xb46d('0x4c')],{})[_0xb46d('0x26')](function(_0x59d523){var _0x237595=_0xfc1017[_0xb46d('0x4d')][_0xb46d('0x28')]({'plain':!![]});if(!_0x237595)throw new Error(_0xb46d('0x4e'));if(_0x237595[_0xb46d('0x4f')]===_0xb46d('0x4d')){var _0xe6324a=_0x59d523['get']({'plain':!![]});var _0x175a99=_0xb46d('0x50');return db[_0xb46d('0x51')][_0xb46d('0x4a')]({'where':{'name':_0x175a99,'userProfileId':_0x237595[_0xb46d('0x52')]},'raw':!![]})[_0xb46d('0x26')](function(_0x3e32b1){if(_0x3e32b1&&_0x3e32b1['autoAssociation']===0x0){return db[_0xb46d('0x29')][_0xb46d('0x4b')]({'name':_0xe6324a[_0xb46d('0x2e')],'resourceId':_0xe6324a['id'],'type':_0x3e32b1[_0xb46d('0x2e')],'sectionId':_0x3e32b1['id']},{})['then'](function(){return _0x59d523;});}else{return _0x59d523;}})[_0xb46d('0x47')](function(_0x151f3f){logger[_0xb46d('0x2c')](_0xb46d('0x53'),_0x151f3f);throw _0x151f3f;});}return _0x59d523;})[_0xb46d('0x26')](respondWithResult(_0x4b8210,0xc9))['catch'](handleError(_0x4b8210,null));};exports[_0xb46d('0x25')]=function(_0x368fc6,_0x37580b){if(_0x368fc6['body']['id']){delete _0x368fc6[_0xb46d('0x4c')]['id'];}return db['Variable'][_0xb46d('0x4a')]({'where':{'id':_0x368fc6['params']['id']}})[_0xb46d('0x26')](handleEntityNotFound(_0x37580b,null))[_0xb46d('0x26')](saveUpdates(_0x368fc6[_0xb46d('0x4c')],null))[_0xb46d('0x26')](respondWithResult(_0x37580b,null))[_0xb46d('0x47')](handleError(_0x37580b,null));};exports[_0xb46d('0x27')]=function(_0x5d0b19,_0x38bebb){return db['Variable']['find']({'where':{'id':_0x5d0b19[_0xb46d('0x54')]['id']}})[_0xb46d('0x26')](handleEntityNotFound(_0x38bebb,null))[_0xb46d('0x26')](removeEntity(_0x38bebb,null))['catch'](handleError(_0x38bebb,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index fbb8a04..8217c02 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 _0xa03f=['rimraf','../../config/environment','./variable.attributes','exports','define','tools_variables','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x49a5cc,_0x696bfe){var _0x263c62=function(_0x3af7e5){while(--_0x3af7e5){_0x49a5cc['push'](_0x49a5cc['shift']());}};_0x263c62(++_0x696bfe);}(_0xa03f,0x1ce));var _0xfa03=function(_0x4ef823,_0x258047){_0x4ef823=_0x4ef823-0x0;var _0x3f9837=_0xa03f[_0x4ef823];return _0x3f9837;};'use strict';var _=require(_0xfa03('0x0'));var util=require(_0xfa03('0x1'));var logger=require(_0xfa03('0x2'))(_0xfa03('0x3'));var moment=require('moment');var BPromise=require(_0xfa03('0x4'));var rp=require(_0xfa03('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa03('0x6'));var config=require(_0xfa03('0x7'));var attributes=require(_0xfa03('0x8'));module[_0xfa03('0x9')]=function(_0x35b494,_0x391eed){return _0x35b494[_0xfa03('0xa')]('Variable',attributes,{'tableName':_0xfa03('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3645=['./variable.attributes','exports','Variable','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3645,0x157));var _0x5364=function(_0x2e3107,_0x25f970){_0x2e3107=_0x2e3107-0x0;var _0x833d69=_0x3645[_0x2e3107];return _0x833d69;};'use strict';var _=require(_0x5364('0x0'));var util=require('util');var logger=require(_0x5364('0x1'))('api');var moment=require(_0x5364('0x2'));var BPromise=require(_0x5364('0x3'));var rp=require(_0x5364('0x4'));var fs=require('fs');var path=require(_0x5364('0x5'));var rimraf=require('rimraf');var config=require(_0x5364('0x6'));var attributes=require(_0x5364('0x7'));module[_0x5364('0x8')]=function(_0x2b54b4,_0x31b538){return _0x2b54b4['define'](_0x5364('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 1994fc9..8cb60e5 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 _0xbbcd=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','catch','lodash'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xbbcd,0xcb));var _0xdbbc=function(_0x5793c4,_0x10a758){_0x5793c4=_0x5793c4-0x0;var _0x43a73c=_0xbbcd[_0x5793c4];return _0x43a73c;};'use strict';var _=require(_0xdbbc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdbbc('0x1'));var rs=require(_0xdbbc('0x2'));var fs=require('fs');var Redis=require(_0xdbbc('0x3'));var db=require(_0xdbbc('0x4'))['db'];var utils=require(_0xdbbc('0x5'));var logger=require(_0xdbbc('0x6'))(_0xdbbc('0x7'));var config=require('../../config/environment');var jayson=require(_0xdbbc('0x8'));var client=jayson[_0xdbbc('0x9')][_0xdbbc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4dacd1,_0x375f87,_0x443b65){return new BPromise(function(_0x42f0c3,_0x9fc269){return client[_0xdbbc('0xb')](_0x4dacd1,_0x443b65)['then'](function(_0x51828c){logger[_0xdbbc('0xc')](_0xdbbc('0xd'),_0x375f87,_0xdbbc('0xe'));logger[_0xdbbc('0xf')](_0xdbbc('0x10'),_0x375f87,'request\x20sent',JSON['stringify'](_0x51828c));if(_0x51828c[_0xdbbc('0x11')]){if(_0x51828c[_0xdbbc('0x11')][_0xdbbc('0x12')]===0x1f4){logger[_0xdbbc('0x11')](_0xdbbc('0xd'),_0x375f87,_0x51828c['error'][_0xdbbc('0x13')]);return _0x9fc269(_0x51828c[_0xdbbc('0x11')][_0xdbbc('0x13')]);}logger['error'](_0xdbbc('0xd'),_0x375f87,_0x51828c[_0xdbbc('0x11')]['message']);return _0x42f0c3(_0x51828c['error'][_0xdbbc('0x13')]);}else{logger[_0xdbbc('0xc')]('Variable,\x20%s,\x20%s',_0x375f87,'request\x20sent');_0x42f0c3(_0x51828c[_0xdbbc('0x14')][_0xdbbc('0x13')]);}})['catch'](function(_0x56d396){logger[_0xdbbc('0x11')](_0xdbbc('0xd'),_0x375f87,_0x56d396);_0x9fc269(_0x56d396);});});}exports['ShowVariable']=function(_0x6f4bec){var _0x2f7c44=this;return new Promise(function(_0x40ed33,_0x2c4194){return db[_0xdbbc('0x15')][_0xdbbc('0x16')]({'raw':_0x6f4bec[_0xdbbc('0x17')]?_0x6f4bec[_0xdbbc('0x17')][_0xdbbc('0x18')]===undefined?!![]:![]:!![],'where':_0x6f4bec[_0xdbbc('0x17')]?_0x6f4bec[_0xdbbc('0x17')][_0xdbbc('0x19')]||null:null,'attributes':_0x6f4bec[_0xdbbc('0x17')]?_0x6f4bec[_0xdbbc('0x17')][_0xdbbc('0x1a')]||null:null,'include':_0x6f4bec[_0xdbbc('0x17')]?_0x6f4bec[_0xdbbc('0x17')][_0xdbbc('0x1b')]?_[_0xdbbc('0x1c')](_0x6f4bec['options']['include'],function(_0x573921){return{'model':db[_0x573921['model']],'as':_0x573921['as'],'attributes':_0x573921[_0xdbbc('0x1a')],'include':_0x573921['include']?_['map'](_0x573921['include'],function(_0x2f7a5f){return{'model':db[_0x2f7a5f[_0xdbbc('0x1d')]],'as':_0x2f7a5f['as'],'attributes':_0x2f7a5f[_0xdbbc('0x1a')],'include':_0x2f7a5f[_0xdbbc('0x1b')]?_['map'](_0x2f7a5f[_0xdbbc('0x1b')],function(_0x46a3b2){return{'model':db[_0x46a3b2[_0xdbbc('0x1d')]],'as':_0x46a3b2['as'],'attributes':_0x46a3b2[_0xdbbc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xdbbc('0x1e')](function(_0x5a28cb){logger[_0xdbbc('0xc')](_0xdbbc('0x1f'),_0x6f4bec);logger[_0xdbbc('0xf')](_0xdbbc('0x1f'),_0x6f4bec,JSON[_0xdbbc('0x20')](_0x5a28cb));_0x40ed33(_0x5a28cb);})[_0xdbbc('0x21')](function(_0x579422){logger[_0xdbbc('0x11')](_0xdbbc('0x1f'),_0x579422[_0xdbbc('0x13')],_0x6f4bec);_0x2c4194(_0x2f7c44[_0xdbbc('0x11')](0x1f4,_0x579422[_0xdbbc('0x13')]));});});}; \ No newline at end of file +var _0x9af8=['then','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','Variable','find','raw','options','where','attributes','map','include','model'];(function(_0x331d4b,_0x4d9962){var _0x55879e=function(_0x4fb888){while(--_0x4fb888){_0x331d4b['push'](_0x331d4b['shift']());}};_0x55879e(++_0x4d9962);}(_0x9af8,0x65));var _0x89af=function(_0x38d56e,_0x3f45d6){_0x38d56e=_0x38d56e-0x0;var _0x5e064b=_0x9af8[_0x38d56e];return _0x5e064b;};'use strict';var _=require(_0x89af('0x0'));var util=require(_0x89af('0x1'));var moment=require('moment');var BPromise=require(_0x89af('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89af('0x3'));var db=require(_0x89af('0x4'))['db'];var utils=require(_0x89af('0x5'));var logger=require(_0x89af('0x6'))(_0x89af('0x7'));var config=require(_0x89af('0x8'));var jayson=require(_0x89af('0x9'));var client=jayson[_0x89af('0xa')][_0x89af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d7f33,_0x3b8cbe,_0x284bb6){return new BPromise(function(_0x465606,_0x41f5da){return client['request'](_0x3d7f33,_0x284bb6)['then'](function(_0x57e22b){logger[_0x89af('0xc')](_0x89af('0xd'),_0x3b8cbe,_0x89af('0xe'));logger[_0x89af('0xf')](_0x89af('0x10'),_0x3b8cbe,_0x89af('0xe'),JSON['stringify'](_0x57e22b));if(_0x57e22b[_0x89af('0x11')]){if(_0x57e22b['error']['code']===0x1f4){logger[_0x89af('0x11')](_0x89af('0xd'),_0x3b8cbe,_0x57e22b['error'][_0x89af('0x12')]);return _0x41f5da(_0x57e22b[_0x89af('0x11')][_0x89af('0x12')]);}logger[_0x89af('0x11')](_0x89af('0xd'),_0x3b8cbe,_0x57e22b[_0x89af('0x11')]['message']);return _0x465606(_0x57e22b[_0x89af('0x11')][_0x89af('0x12')]);}else{logger[_0x89af('0xc')](_0x89af('0xd'),_0x3b8cbe,_0x89af('0xe'));_0x465606(_0x57e22b[_0x89af('0x13')][_0x89af('0x12')]);}})[_0x89af('0x14')](function(_0x2e99dd){logger[_0x89af('0x11')](_0x89af('0xd'),_0x3b8cbe,_0x2e99dd);_0x41f5da(_0x2e99dd);});});}exports[_0x89af('0x15')]=function(_0x9fe704){var _0x2505d7=this;return new Promise(function(_0x43fa30,_0xbd3500){return db[_0x89af('0x16')][_0x89af('0x17')]({'raw':_0x9fe704['options']?_0x9fe704['options'][_0x89af('0x18')]===undefined?!![]:![]:!![],'where':_0x9fe704[_0x89af('0x19')]?_0x9fe704['options'][_0x89af('0x1a')]||null:null,'attributes':_0x9fe704[_0x89af('0x19')]?_0x9fe704['options'][_0x89af('0x1b')]||null:null,'include':_0x9fe704[_0x89af('0x19')]?_0x9fe704[_0x89af('0x19')]['include']?_[_0x89af('0x1c')](_0x9fe704[_0x89af('0x19')][_0x89af('0x1d')],function(_0x295817){return{'model':db[_0x295817[_0x89af('0x1e')]],'as':_0x295817['as'],'attributes':_0x295817[_0x89af('0x1b')],'include':_0x295817['include']?_['map'](_0x295817['include'],function(_0x36e967){return{'model':db[_0x36e967[_0x89af('0x1e')]],'as':_0x36e967['as'],'attributes':_0x36e967[_0x89af('0x1b')],'include':_0x36e967['include']?_[_0x89af('0x1c')](_0x36e967[_0x89af('0x1d')],function(_0xc7ad04){return{'model':db[_0xc7ad04[_0x89af('0x1e')]],'as':_0xc7ad04['as'],'attributes':_0xc7ad04[_0x89af('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x89af('0x1f')](function(_0x481677){logger['info'](_0x89af('0x15'),_0x9fe704);logger[_0x89af('0xf')](_0x89af('0x15'),_0x9fe704,JSON[_0x89af('0x20')](_0x481677));_0x43fa30(_0x481677);})['catch'](function(_0x5c84dd){logger[_0x89af('0x11')]('ShowVariable',_0x5c84dd[_0x89af('0x12')],_0x9fe704);_0xbd3500(_0x2505d7[_0x89af('0x11')](0x1f4,_0x5c84dd['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index b41fb02..2d56bc9 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 _0xcbdd=['/fetch','isAuthenticated','fetch','/reset','canUpdate','reset','/pull','/restart','restart','/migrations','migrations','exports','express','../../components/auth/service','./version.controller','get'];(function(_0x493894,_0x3d30a5){var _0x53dae4=function(_0x5747fe){while(--_0x5747fe){_0x493894['push'](_0x493894['shift']());}};_0x53dae4(++_0x3d30a5);}(_0xcbdd,0xec));var _0xdcbd=function(_0x26b8b9,_0x3b9b32){_0x26b8b9=_0x26b8b9-0x0;var _0x43c1c7=_0xcbdd[_0x26b8b9];return _0x43c1c7;};'use strict';var express=require(_0xdcbd('0x0'));var router=express['Router']();var auth=require(_0xdcbd('0x1'));var controller=require(_0xdcbd('0x2'));router[_0xdcbd('0x3')]('/',controller['index']);router[_0xdcbd('0x3')](_0xdcbd('0x4'),auth[_0xdcbd('0x5')](),auth['canUpdate'](),controller[_0xdcbd('0x6')]);router['get'](_0xdcbd('0x7'),auth[_0xdcbd('0x5')](),auth[_0xdcbd('0x8')](),controller[_0xdcbd('0x9')]);router[_0xdcbd('0x3')](_0xdcbd('0xa'),auth[_0xdcbd('0x5')](),auth[_0xdcbd('0x8')](),controller['pull']);router['get'](_0xdcbd('0xb'),auth[_0xdcbd('0x5')](),controller[_0xdcbd('0xc')]);router[_0xdcbd('0x3')](_0xdcbd('0xd'),controller[_0xdcbd('0xe')]);module[_0xdcbd('0xf')]=router; \ No newline at end of file +var _0x5693=['exports','express','Router','../../components/auth/service','get','index','isAuthenticated','canUpdate','/reset','reset','/pull','pull','/restart','restart','/migrations'];(function(_0x14f02b,_0x3a279f){var _0x61f42e=function(_0x155f11){while(--_0x155f11){_0x14f02b['push'](_0x14f02b['shift']());}};_0x61f42e(++_0x3a279f);}(_0x5693,0x1d2));var _0x3569=function(_0x5f06c0,_0x2637c4){_0x5f06c0=_0x5f06c0-0x0;var _0x323312=_0x5693[_0x5f06c0];return _0x323312;};'use strict';var express=require(_0x3569('0x0'));var router=express[_0x3569('0x1')]();var auth=require(_0x3569('0x2'));var controller=require('./version.controller');router[_0x3569('0x3')]('/',controller[_0x3569('0x4')]);router[_0x3569('0x3')]('/fetch',auth[_0x3569('0x5')](),auth[_0x3569('0x6')](),controller['fetch']);router[_0x3569('0x3')](_0x3569('0x7'),auth['isAuthenticated'](),auth[_0x3569('0x6')](),controller[_0x3569('0x8')]);router[_0x3569('0x3')](_0x3569('0x9'),auth[_0x3569('0x5')](),auth[_0x3569('0x6')](),controller[_0x3569('0xa')]);router[_0x3569('0x3')](_0x3569('0xb'),auth[_0x3569('0x5')](),controller[_0x3569('0xc')]);router[_0x3569('0x3')](_0x3569('0xd'),controller['migrations']);module[_0x3569('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 3c7478b..7cbe907 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 _0x26c2=['sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','\x20to\x20','catch','Database\x20already\x20up-to-date','path','lodash','pkginfo','version','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','exports','query','latest','fetch','tags','2.0.0','status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','readdirSync','join','server','migrations','length','.js','push'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x26c2,0x1d6));var _0x226c=function(_0x25cbad,_0x492451){_0x25cbad=_0x25cbad-0x0;var _0x4b11da=_0x26c2[_0x25cbad];return _0x4b11da;};'use strict';var Umzug=require('umzug');var path=require(_0x226c('0x0'));var fs=require('fs');var _=require(_0x226c('0x1'));var pkginfo=require(_0x226c('0x2'))(module,_0x226c('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x226c('0x4'))['exec'];var db=require(_0x226c('0x5'))['db'];var config=require(_0x226c('0x6'));var pm2=require(_0x226c('0x7'));var logger=require(_0x226c('0x8'))(_0x226c('0x9'));var git=require(_0x226c('0xa'))(config[_0x226c('0xb')]);exports['index']=function(_0x58ebd8,_0x53fc4f){var _0x10cae2={'current':module[_0x226c('0xc')]['version'],'phonebar':0x2};if(_0x58ebd8[_0x226c('0xd')]&&_0x58ebd8[_0x226c('0xd')][_0x226c('0xe')]){return git[_0x226c('0xf')]()[_0x226c('0x10')](function(_0x1001f9,_0x25dfc6){_0x10cae2['latest']=(_0x1001f9?module['exports'][_0x226c('0x3')]:_0x25dfc6[_0x226c('0xe')])||_0x226c('0x11');return _0x53fc4f[_0x226c('0x12')](0xc8)['json'](_0x10cae2);});}else{return _0x53fc4f['status'](0xc8)[_0x226c('0x13')](_0x10cae2);}};exports[_0x226c('0xf')]=function(_0x333247,_0x1650e8){return git[_0x226c('0xf')](['origin',_0x226c('0x14')],function(_0x28abf8){if(_0x28abf8){logger[_0x226c('0x15')](_0x28abf8);return _0x1650e8['status'](0x1f4)[_0x226c('0x13')](_0x28abf8);}logger[_0x226c('0x16')](_0x226c('0x17'));return _0x1650e8[_0x226c('0x12')](0xc8)[_0x226c('0x13')]({'output':_0x226c('0x18')});});};exports[_0x226c('0x19')]=function(_0x1168b9,_0x17e360){return git[_0x226c('0x19')]([_0x226c('0x1a'),_0x226c('0x1b')],function(_0x1ecb10){if(_0x1ecb10){logger['error'](_0x1ecb10);return _0x17e360[_0x226c('0x12')](0x1f4)[_0x226c('0x13')](_0x1ecb10);}logger[_0x226c('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x17e360[_0x226c('0x12')](0xc8)[_0x226c('0x13')]({'output':'git\x20reset\x20--hard'});});};exports[_0x226c('0x1c')]=function(_0x29c441,_0x10354d){exec(_0x226c('0x1d'),function(_0x290542,_0x242a67,_0x49e476){logger[_0x226c('0x16')](_0x242a67);logger[_0x226c('0x16')](_0x49e476);if(_0x290542){logger[_0x226c('0x15')](_0x290542);return _0x10354d[_0x226c('0x12')](0x1f4)[_0x226c('0x13')](_0x290542);}return _0x10354d[_0x226c('0x12')](0xc8)['json']({'output':_0x242a67});});};exports[_0x226c('0x1e')]=function(_0x1d9d7c,_0x418d7e){return pm2['restart'](_0x226c('0x1f'))['then'](function(_0x2a1967){logger[_0x226c('0x16')](_0x226c('0x20'),_0x2a1967);return _0x418d7e[_0x226c('0x12')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x57e4a5){logger['error'](_0x57e4a5);return _0x418d7e[_0x226c('0x12')](0x1f4)[_0x226c('0x13')](_0x57e4a5);});};exports['migrations']=function(_0x8c67bc,_0x92415b){var _0x1bec1a=fs[_0x226c('0x21')](path[_0x226c('0x22')](config['root'],_0x226c('0x23'),_0x226c('0x24')));var _0x4e4d0c=[];for(var _0x260bb5=0x0;_0x260bb5<_0x1bec1a[_0x226c('0x25')];_0x260bb5++){var _0x3632ae=_0x1bec1a[_0x260bb5]['replace'](_0x226c('0x26'),'');if(compareVersions(module[_0x226c('0xc')][_0x226c('0x3')],_0x3632ae)===-0x1){_0x4e4d0c[_0x226c('0x27')](_0x3632ae);}}if(_0x4e4d0c[_0x226c('0x25')]){var _0x8756b7=_0x4e4d0c[_0x226c('0x28')](compareVersions);var _0x5d7c95=new Umzug({'storage':_0x226c('0x29'),'storageOptions':{'model':db[_0x226c('0x2a')],'modelName':_0x226c('0x2a'),'columnName':'version'},'migrations':{'params':[db[_0x226c('0x29')][_0x226c('0x2b')](),db[_0x226c('0x29')][_0x226c('0x2c')],function(){throw new Error(_0x226c('0x2d'));}],'path':path[_0x226c('0x22')](config[_0x226c('0xb')],_0x226c('0x23'),'migrations'),'pattern':/\.js$/}});_0x5d7c95['up']({'migrations':_[_0x226c('0x2e')](_0x8756b7,function(_0x1cf018){return _0x1cf018+_0x226c('0x26');})})[_0x226c('0x2f')](function(){return _0x92415b[_0x226c('0x12')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x226c('0xc')][_0x226c('0x3')]+_0x226c('0x30')+_['last'](_0x8756b7),'migrations':_['join'](_0x8756b7)});})[_0x226c('0x31')](function(_0xd14aff){if(_0xd14aff instanceof db[_0x226c('0x29')]['UniqueConstraintError']){return _0x92415b[_0x226c('0x12')](0xc8)['json']({'output':_0x226c('0x32')});}else{return _0x92415b['status'](0x1f4)[_0x226c('0x13')](_0xd14aff);}});}else{return _0x92415b[_0x226c('0x12')](0xc8)[_0x226c('0x13')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x5ed9=['path','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','update','root','index','exports','query','latest','tags','json','status','fetch','origin','error','info','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','push','length','sort','sequelize','Migration','constructor','.js','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug'];(function(_0x2ad053,_0xa8bece){var _0x2dd7e0=function(_0x30c823){while(--_0x30c823){_0x2ad053['push'](_0x2ad053['shift']());}};_0x2dd7e0(++_0xa8bece);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x5ed9[_0x138adb];return _0x1b27f2;};'use strict';var Umzug=require(_0x95ed('0x0'));var path=require(_0x95ed('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x95ed('0x2'))(module,_0x95ed('0x3'));var compareVersions=require(_0x95ed('0x4'));var exec=require(_0x95ed('0x5'))['exec'];var db=require(_0x95ed('0x6'))['db'];var config=require(_0x95ed('0x7'));var pm2=require(_0x95ed('0x8'));var logger=require('../../config/logger')(_0x95ed('0x9'));var git=require('simple-git')(config[_0x95ed('0xa')]);exports[_0x95ed('0xb')]=function(_0x3753b5,_0x1df51f){var _0x46ed43={'current':module[_0x95ed('0xc')]['version'],'phonebar':0x2};if(_0x3753b5[_0x95ed('0xd')]&&_0x3753b5[_0x95ed('0xd')][_0x95ed('0xe')]){return git['fetch']()[_0x95ed('0xf')](function(_0x478a34,_0x3a4333){_0x46ed43[_0x95ed('0xe')]=(_0x478a34?module[_0x95ed('0xc')][_0x95ed('0x3')]:_0x3a4333[_0x95ed('0xe')])||'2.0.0';return _0x1df51f['status'](0xc8)[_0x95ed('0x10')](_0x46ed43);});}else{return _0x1df51f[_0x95ed('0x11')](0xc8)['json'](_0x46ed43);}};exports['fetch']=function(_0x2782a5,_0x11671d){return git[_0x95ed('0x12')]([_0x95ed('0x13'),'master'],function(_0x213355){if(_0x213355){logger[_0x95ed('0x14')](_0x213355);return _0x11671d[_0x95ed('0x11')](0x1f4)[_0x95ed('0x10')](_0x213355);}logger[_0x95ed('0x15')]('git\x20fetch');return _0x11671d[_0x95ed('0x11')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x1ffa55,_0x58fb9e){return git[_0x95ed('0x16')]([_0x95ed('0x17'),'FETCH_HEAD'],function(_0xa5a91){if(_0xa5a91){logger[_0x95ed('0x14')](_0xa5a91);return _0x58fb9e[_0x95ed('0x11')](0x1f4)[_0x95ed('0x10')](_0xa5a91);}logger[_0x95ed('0x15')](_0x95ed('0x18'));return _0x58fb9e[_0x95ed('0x11')](0xc8)[_0x95ed('0x10')]({'output':_0x95ed('0x19')});});};exports[_0x95ed('0x1a')]=function(_0x5887e3,_0xd798ec){exec(_0x95ed('0x1b'),function(_0x4e8a5d,_0x5d5afe,_0x54c5ae){logger[_0x95ed('0x15')](_0x5d5afe);logger[_0x95ed('0x15')](_0x54c5ae);if(_0x4e8a5d){logger[_0x95ed('0x14')](_0x4e8a5d);return _0xd798ec[_0x95ed('0x11')](0x1f4)[_0x95ed('0x10')](_0x4e8a5d);}return _0xd798ec[_0x95ed('0x11')](0xc8)[_0x95ed('0x10')]({'output':_0x5d5afe});});};exports[_0x95ed('0x1c')]=function(_0x146f74,_0x3bcb6d){return pm2[_0x95ed('0x1c')](_0x95ed('0x1d'))[_0x95ed('0x1e')](function(_0x25b1fc){logger['info'](_0x95ed('0x1f'),_0x25b1fc);return _0x3bcb6d['status'](0xc8)['json']({'output':_0x95ed('0x20')});})[_0x95ed('0x21')](function(_0x45e403){logger[_0x95ed('0x14')](_0x45e403);return _0x3bcb6d[_0x95ed('0x11')](0x1f4)[_0x95ed('0x10')](_0x45e403);});};exports[_0x95ed('0x22')]=function(_0x190620,_0x39330d){var _0x3f3ed9=fs[_0x95ed('0x23')](path[_0x95ed('0x24')](config['root'],_0x95ed('0x25'),_0x95ed('0x22')));var _0x53b1f4=[];for(var _0x28c738=0x0;_0x28c738<_0x3f3ed9['length'];_0x28c738++){var _0x5365ae=_0x3f3ed9[_0x28c738]['replace']('.js','');if(compareVersions(module['exports'][_0x95ed('0x3')],_0x5365ae)===-0x1){_0x53b1f4[_0x95ed('0x26')](_0x5365ae);}}if(_0x53b1f4[_0x95ed('0x27')]){var _0x20f565=_0x53b1f4[_0x95ed('0x28')](compareVersions);var _0x2f9d90=new Umzug({'storage':_0x95ed('0x29'),'storageOptions':{'model':db['Migration'],'modelName':_0x95ed('0x2a'),'columnName':_0x95ed('0x3')},'migrations':{'params':[db[_0x95ed('0x29')]['getQueryInterface'](),db['sequelize'][_0x95ed('0x2b')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path['join'](config['root'],'server',_0x95ed('0x22')),'pattern':/\.js$/}});_0x2f9d90['up']({'migrations':_['map'](_0x20f565,function(_0x15c1b5){return _0x15c1b5+_0x95ed('0x2c');})})['then'](function(){return _0x39330d['status'](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0x95ed('0x3')]+_0x95ed('0x2d')+_[_0x95ed('0x2e')](_0x20f565),'migrations':_[_0x95ed('0x24')](_0x20f565)});})[_0x95ed('0x21')](function(_0x431690){if(_0x431690 instanceof db['sequelize'][_0x95ed('0x2f')]){return _0x39330d[_0x95ed('0x11')](0xc8)[_0x95ed('0x10')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x39330d[_0x95ed('0x11')](0x1f4)[_0x95ed('0x10')](_0x431690);}});}else{return _0x39330d[_0x95ed('0x11')](0xc8)[_0x95ed('0x10')]({'output':_0x95ed('0x30')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 00a43cc..8a1f1d6 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 _0xe2db=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update'];(function(_0x32b206,_0xbc37){var _0x2d336e=function(_0x322d5d){while(--_0x322d5d){_0x32b206['push'](_0x32b206['shift']());}};_0x2d336e(++_0xbc37);}(_0xe2db,0x163));var _0xbe2d=function(_0x3d8200,_0x7047f0){_0x3d8200=_0x3d8200-0x0;var _0x514836=_0xe2db[_0x3d8200];return _0x514836;};'use strict';var multer=require(_0xbe2d('0x0'));var util=require(_0xbe2d('0x1'));var path=require(_0xbe2d('0x2'));var timeout=require(_0xbe2d('0x3'));var express=require(_0xbe2d('0x4'));var router=express[_0xbe2d('0x5')]();var auth=require(_0xbe2d('0x6'));var interaction=require(_0xbe2d('0x7'));var config=require(_0xbe2d('0x8'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0xbe2d('0x9')](),controller[_0xbe2d('0xa')]);router[_0xbe2d('0xb')](_0xbe2d('0xc'),auth['isAuthenticated'](),controller[_0xbe2d('0xd')]);router[_0xbe2d('0xb')](_0xbe2d('0xe'),auth['isAuthenticated'](),controller[_0xbe2d('0xf')]);router['post']('/',auth[_0xbe2d('0x9')](),controller[_0xbe2d('0x10')]);router[_0xbe2d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbe2d('0x12')]);router[_0xbe2d('0x13')](_0xbe2d('0xe'),auth['isAuthenticated'](),controller[_0xbe2d('0x14')]);module[_0xbe2d('0x15')]=router; \ No newline at end of file +var _0x4901=['./voiceAgentReport.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','util','path','Router','../../components/interaction/service','../../config/environment'];(function(_0x2cefc5,_0x108d4e){var _0x5f39ce=function(_0x3cc655){while(--_0x3cc655){_0x2cefc5['push'](_0x2cefc5['shift']());}};_0x5f39ce(++_0x108d4e);}(_0x4901,0x1cb));var _0x1490=function(_0x2cda8c,_0x316e04){_0x2cda8c=_0x2cda8c-0x0;var _0x8f7b4f=_0x4901[_0x2cda8c];return _0x8f7b4f;};'use strict';var multer=require('multer');var util=require(_0x1490('0x0'));var path=require(_0x1490('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1490('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x1490('0x3'));var config=require(_0x1490('0x4'));var controller=require(_0x1490('0x5'));router[_0x1490('0x6')]('/',auth[_0x1490('0x7')](),controller[_0x1490('0x8')]);router[_0x1490('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x1490('0x9'),auth[_0x1490('0x7')](),controller[_0x1490('0xa')]);router['post']('/',auth[_0x1490('0x7')](),controller[_0x1490('0xb')]);router['put'](_0x1490('0x9'),auth[_0x1490('0x7')](),controller[_0x1490('0xc')]);router[_0x1490('0xd')](_0x1490('0x9'),auth[_0x1490('0x7')](),controller[_0x1490('0xe')]);module[_0x1490('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 60b2324..924f07b 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 _0x46ed=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x46ed,0x168));var _0xd46e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x46ed[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd46e('0x2')]},'calleridnum':{'type':Sequelize[_0xd46e('0x2')]},'calleridname':{'type':Sequelize[_0xd46e('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xd46e('0x2')]},'membername':{'type':Sequelize[_0xd46e('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xd46e('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xd46e('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xd46e('0x3')]},'agentdumpAt':{'type':Sequelize[_0xd46e('0x3')]},'holdtime':{'type':Sequelize[_0xd46e('0x4')]},'agentcomplete':{'type':Sequelize[_0xd46e('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xd46e('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xd46e('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd46e('0x4')]},'agentacw':{'type':Sequelize[_0xd46e('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd46e('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xd46e('0x2')]},'channel':{'type':Sequelize[_0xd46e('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xd46e('0x2')]},'connectedlinenum':{'type':Sequelize[_0xd46e('0x2')]},'connectedlinename':{'type':Sequelize[_0xd46e('0x2')]},'language':{'type':Sequelize[_0xd46e('0x2')]},'accountcode':{'type':Sequelize[_0xd46e('0x2')]},'context':{'type':Sequelize[_0xd46e('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd46e('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd46e('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd46e('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xd46e('0x2')]},'destlanguage':{'type':Sequelize[_0xd46e('0x2')]},'destaccountcode':{'type':Sequelize[_0xd46e('0x2')]},'destcontext':{'type':Sequelize[_0xd46e('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xd46e('0x2')]},'destuniqueid':{'type':Sequelize[_0xd46e('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd46e('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xd46e('0x2')]},'transfer':{'type':Sequelize[_0xd46e('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xd46e('0x6')},'transferexten':{'type':Sequelize[_0xd46e('0x2')]},'transferuniqueid':{'type':Sequelize[_0xd46e('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf2ca=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x12f42c,_0x415b84){var _0xbcf616=function(_0x242128){while(--_0x242128){_0x12f42c['push'](_0x12f42c['shift']());}};_0xbcf616(++_0x415b84);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xf2ca[_0x4dc7b9];return _0x3ab114;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'type':{'type':Sequelize[_0xaf2c('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xaf2c('0x2')]},'calleridname':{'type':Sequelize[_0xaf2c('0x2')]},'queue':{'type':Sequelize[_0xaf2c('0x2')]},'interface':{'type':Sequelize[_0xaf2c('0x2')]},'membername':{'type':Sequelize[_0xaf2c('0x2')]},'agentcalledAt':{'type':Sequelize[_0xaf2c('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xaf2c('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xaf2c('0x3')]},'agentdumpAt':{'type':Sequelize[_0xaf2c('0x3')]},'holdtime':{'type':Sequelize[_0xaf2c('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xaf2c('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xaf2c('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xaf2c('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xaf2c('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaf2c('0x2')]},'channelstate':{'type':Sequelize[_0xaf2c('0x4')]},'channelstatedesc':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xaf2c('0x2')]},'context':{'type':Sequelize[_0xaf2c('0x2')]},'exten':{'type':Sequelize[_0xaf2c('0x2')]},'priority':{'type':Sequelize[_0xaf2c('0x2')]},'destchannel':{'type':Sequelize[_0xaf2c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xaf2c('0x2')]},'destcalleridname':{'type':Sequelize[_0xaf2c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaf2c('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaf2c('0x2')]},'destlanguage':{'type':Sequelize[_0xaf2c('0x2')]},'destaccountcode':{'type':Sequelize[_0xaf2c('0x2')]},'destcontext':{'type':Sequelize[_0xaf2c('0x2')]},'destexten':{'type':Sequelize[_0xaf2c('0x2')]},'destpriority':{'type':Sequelize[_0xaf2c('0x2')]},'destuniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xaf2c('0x2')]},'transfer':{'type':Sequelize[_0xaf2c('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xaf2c('0x2')],'comment':_0xaf2c('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index e59b622..476a6ff 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 _0xad74=['set','Content-Range','save','update','then','destroy','stack','name','send','index','map','VoiceAgentReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit'];(function(_0x1983d1,_0x557ff1){var _0x332365=function(_0x5726c6){while(--_0x5726c6){_0x1983d1['push'](_0x1983d1['shift']());}};_0x332365(++_0x557ff1);}(_0xad74,0x193));var _0x4ad7=function(_0x5aeb5c,_0x31d1d6){_0x5aeb5c=_0x5aeb5c-0x0;var _0x244996=_0xad74[_0x5aeb5c];return _0x244996;};'use strict';var pdf=require(_0x4ad7('0x0'));var emlformat=require(_0x4ad7('0x1'));var rimraf=require(_0x4ad7('0x2'));var zipdir=require(_0x4ad7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ad7('0x4'));var moment=require(_0x4ad7('0x5'));var BPromise=require(_0x4ad7('0x6'));var Mustache=require(_0x4ad7('0x7'));var util=require('util');var path=require(_0x4ad7('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4ad7('0x9'));var fs=require('fs');var _=require(_0x4ad7('0xa'));var squel=require(_0x4ad7('0xb'));var crypto=require(_0x4ad7('0xc'));var jsforce=require(_0x4ad7('0xd'));var deskjs=require(_0x4ad7('0xe'));var toCsv=require(_0x4ad7('0xf'));var querystring=require(_0x4ad7('0x10'));var Papa=require('papaparse');var Redis=require(_0x4ad7('0x11'));var authService=require(_0x4ad7('0x12'));var qs=require(_0x4ad7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ad7('0x14'));var logger=require(_0x4ad7('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x571b5a,_0x2a448e){_0x2a448e=_0x2a448e||0xcc;return function(_0x106254){if(_0x106254){return _0x571b5a[_0x4ad7('0x16')](_0x2a448e);}return _0x571b5a[_0x4ad7('0x17')](_0x2a448e)[_0x4ad7('0x18')]();};}function respondWithResult(_0x21c75f,_0x1d657c){_0x1d657c=_0x1d657c||0xc8;return function(_0xcd9b0f){if(_0xcd9b0f){return _0x21c75f[_0x4ad7('0x17')](_0x1d657c)[_0x4ad7('0x19')](_0xcd9b0f);}};}function respondWithFilteredResult(_0x32bb05,_0x53ab4b){return function(_0x4685bb){if(_0x4685bb){var _0x1e97c9=_0x4685bb[_0x4ad7('0x1a')],_0x12df37=_0x53ab4b[_0x4ad7('0x1b')],_0x9b2b1=_0x53ab4b[_0x4ad7('0x1b')]+_0x53ab4b[_0x4ad7('0x1c')],_0xc96036;if(_0x9b2b1>=_0x1e97c9){_0x9b2b1=_0x1e97c9;_0xc96036=0xc8;}else{_0xc96036=0xce;}_0x32bb05[_0x4ad7('0x17')](_0xc96036);return _0x32bb05[_0x4ad7('0x1d')](_0x4ad7('0x1e'),_0x12df37+'-'+_0x9b2b1+'/'+_0x1e97c9)[_0x4ad7('0x19')](_0x4685bb);}return null;};}function patchUpdates(_0x8232cc){return function(_0xc543c1){try{jsonpatch['apply'](_0xc543c1,_0x8232cc,!![]);}catch(_0x32b9f7){return BPromise['reject'](_0x32b9f7);}return _0xc543c1[_0x4ad7('0x1f')]();};}function saveUpdates(_0x41ff05,_0x52b7eb){return function(_0xe51f3c){if(_0xe51f3c){return _0xe51f3c[_0x4ad7('0x20')](_0x41ff05)[_0x4ad7('0x21')](function(_0x34ff8f){return _0x34ff8f;});}return null;};}function removeEntity(_0x11e849,_0x3a6027){return function(_0x421700){if(_0x421700){return _0x421700[_0x4ad7('0x22')]()['then'](function(){_0x11e849[_0x4ad7('0x17')](0xcc)[_0x4ad7('0x18')]();});}};}function handleEntityNotFound(_0x1e41b6,_0x2c254f){return function(_0x835766){if(!_0x835766){_0x1e41b6[_0x4ad7('0x16')](0x194);}return _0x835766;};}function handleError(_0x31c9be,_0x816d7f){_0x816d7f=_0x816d7f||0x1f4;return function(_0x3eefb3){logger['error'](_0x3eefb3[_0x4ad7('0x23')]);if(_0x3eefb3[_0x4ad7('0x24')]){delete _0x3eefb3[_0x4ad7('0x24')];}_0x31c9be[_0x4ad7('0x17')](_0x816d7f)[_0x4ad7('0x25')](_0x3eefb3);};}exports[_0x4ad7('0x26')]=function(_0x282102,_0x31a54d){var _0x4ddc17={},_0x451a54={},_0x1a996e={'count':0x0,'rows':[]};var _0x3c9002=_[_0x4ad7('0x27')](db[_0x4ad7('0x28')][_0x4ad7('0x29')],function(_0x646ebb){return{'name':_0x646ebb['fieldName'],'type':_0x646ebb['type'][_0x4ad7('0x2a')]};});_0x451a54[_0x4ad7('0x2b')]=_['map'](_0x3c9002,'name');_0x451a54[_0x4ad7('0x2c')]=_[_0x4ad7('0x2d')](_0x282102['query']);_0x451a54[_0x4ad7('0x2e')]=_['intersection'](_0x451a54[_0x4ad7('0x2b')],_0x451a54[_0x4ad7('0x2c')]);_0x4ddc17['attributes']=_[_0x4ad7('0x2f')](_0x451a54[_0x4ad7('0x2b')],qs[_0x4ad7('0x30')](_0x282102[_0x4ad7('0x2c')]['fields']));_0x4ddc17[_0x4ad7('0x31')]=_0x4ddc17[_0x4ad7('0x31')]['length']?_0x4ddc17[_0x4ad7('0x31')]:_0x451a54[_0x4ad7('0x2b')];if(!_0x282102['query'][_0x4ad7('0x32')](_0x4ad7('0x33'))){_0x4ddc17[_0x4ad7('0x1c')]=qs[_0x4ad7('0x1c')](_0x282102[_0x4ad7('0x2c')][_0x4ad7('0x1c')]);_0x4ddc17[_0x4ad7('0x1b')]=qs['offset'](_0x282102[_0x4ad7('0x2c')][_0x4ad7('0x1b')]);}_0x4ddc17[_0x4ad7('0x34')]=qs[_0x4ad7('0x35')](_0x282102[_0x4ad7('0x2c')]['sort']);_0x4ddc17[_0x4ad7('0x36')]=qs['filters'](_[_0x4ad7('0x37')](_0x282102[_0x4ad7('0x2c')],_0x451a54[_0x4ad7('0x2e')]));if(_0x282102['query'][_0x4ad7('0x38')]){_0x4ddc17['where']=_['merge'](_0x4ddc17['where'],{'$or':_[_0x4ad7('0x27')](_0x3c9002,function(_0x35d670){if(_0x35d670[_0x4ad7('0x39')]!==_0x4ad7('0x3a')){var _0x112892={};_0x112892[_0x35d670[_0x4ad7('0x24')]]={'$like':'%'+_0x282102[_0x4ad7('0x2c')][_0x4ad7('0x38')]+'%'};return _0x112892;}})});}_0x4ddc17=_[_0x4ad7('0x3b')]({},_0x4ddc17,_0x282102['options']);var _0x3ec969={'where':_0x4ddc17[_0x4ad7('0x36')]};return db[_0x4ad7('0x28')][_0x4ad7('0x1a')](_0x3ec969)[_0x4ad7('0x21')](function(_0x1857a7){_0x1a996e['count']=_0x1857a7;if(_0x282102[_0x4ad7('0x2c')][_0x4ad7('0x3c')]){_0x4ddc17[_0x4ad7('0x3d')]=[{'all':!![]}];}return db[_0x4ad7('0x28')][_0x4ad7('0x3e')](_0x4ddc17);})[_0x4ad7('0x21')](function(_0x5e47cb){_0x1a996e[_0x4ad7('0x3f')]=_0x5e47cb;return _0x1a996e;})[_0x4ad7('0x21')](respondWithFilteredResult(_0x31a54d,_0x4ddc17))[_0x4ad7('0x40')](handleError(_0x31a54d,null));};exports[_0x4ad7('0x41')]=function(_0x5919e1,_0x304dbd){var _0x39c634={'raw':![],'where':{'id':_0x5919e1[_0x4ad7('0x42')]['id']}},_0x330000={};_0x330000[_0x4ad7('0x2b')]=_[_0x4ad7('0x2d')](db[_0x4ad7('0x28')][_0x4ad7('0x29')]);_0x330000['query']=_[_0x4ad7('0x2d')](_0x5919e1[_0x4ad7('0x2c')]);_0x330000['filters']=_['intersection'](_0x330000['model'],_0x330000['query']);_0x39c634[_0x4ad7('0x31')]=_[_0x4ad7('0x2f')](_0x330000[_0x4ad7('0x2b')],qs[_0x4ad7('0x30')](_0x5919e1['query'][_0x4ad7('0x30')]));_0x39c634[_0x4ad7('0x31')]=_0x39c634['attributes']['length']?_0x39c634[_0x4ad7('0x31')]:_0x330000[_0x4ad7('0x2b')];if(_0x5919e1[_0x4ad7('0x2c')][_0x4ad7('0x3c')]){_0x39c634[_0x4ad7('0x3d')]=[{'all':!![]}];}_0x39c634=_[_0x4ad7('0x3b')]({},_0x39c634,_0x5919e1[_0x4ad7('0x43')]);return db[_0x4ad7('0x28')][_0x4ad7('0x44')](_0x39c634)[_0x4ad7('0x21')](handleEntityNotFound(_0x304dbd,null))[_0x4ad7('0x21')](respondWithResult(_0x304dbd,null))[_0x4ad7('0x40')](handleError(_0x304dbd,null));};exports[_0x4ad7('0x45')]=function(_0x1d2e3a,_0x1efd09){return db[_0x4ad7('0x28')]['create'](_0x1d2e3a[_0x4ad7('0x46')],{})[_0x4ad7('0x21')](respondWithResult(_0x1efd09,0xc9))[_0x4ad7('0x40')](handleError(_0x1efd09,null));};exports[_0x4ad7('0x20')]=function(_0x1e4d9c,_0x25229e){if(_0x1e4d9c[_0x4ad7('0x46')]['id']){delete _0x1e4d9c[_0x4ad7('0x46')]['id'];}return db['VoiceAgentReport'][_0x4ad7('0x44')]({'where':{'id':_0x1e4d9c[_0x4ad7('0x42')]['id']}})[_0x4ad7('0x21')](handleEntityNotFound(_0x25229e,null))[_0x4ad7('0x21')](saveUpdates(_0x1e4d9c['body'],null))['then'](respondWithResult(_0x25229e,null))[_0x4ad7('0x40')](handleError(_0x25229e,null));};exports[_0x4ad7('0x22')]=function(_0x4cd263,_0x25b32d){return db[_0x4ad7('0x28')][_0x4ad7('0x44')]({'where':{'id':_0x4cd263['params']['id']}})[_0x4ad7('0x21')](handleEntityNotFound(_0x25b32d,null))[_0x4ad7('0x21')](removeEntity(_0x25b32d,null))['catch'](handleError(_0x25b32d,null));};exports[_0x4ad7('0x47')]=function(_0x5ea063,_0xecdea9){return db['VoiceAgentReport'][_0x4ad7('0x47')]()[_0x4ad7('0x21')](respondWithResult(_0xecdea9,null))[_0x4ad7('0x40')](handleError(_0xecdea9,null));}; \ No newline at end of file +var _0x6256=['send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','VoiceAgentReport','includeAll','include','rows','catch','show','params','fields','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name'];(function(_0x514bd1,_0x25ea3e){var _0x58a281=function(_0x25567a){while(--_0x25567a){_0x514bd1['push'](_0x514bd1['shift']());}};_0x58a281(++_0x25ea3e);}(_0x6256,0x148));var _0x6625=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x6256[_0x5d6456];return _0x4d66c1;};'use strict';var pdf=require(_0x6625('0x0'));var emlformat=require(_0x6625('0x1'));var rimraf=require(_0x6625('0x2'));var zipdir=require(_0x6625('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6625('0x4'));var moment=require(_0x6625('0x5'));var BPromise=require(_0x6625('0x6'));var Mustache=require(_0x6625('0x7'));var util=require(_0x6625('0x8'));var path=require(_0x6625('0x9'));var sox=require(_0x6625('0xa'));var csv=require('to-csv');var ejs=require(_0x6625('0xb'));var fs=require('fs');var _=require(_0x6625('0xc'));var squel=require('squel');var crypto=require(_0x6625('0xd'));var jsforce=require(_0x6625('0xe'));var deskjs=require(_0x6625('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6625('0x10'));var Redis=require(_0x6625('0x11'));var authService=require(_0x6625('0x12'));var qs=require(_0x6625('0x13'));var as=require(_0x6625('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6625('0x15'))(_0x6625('0x16'));var utils=require(_0x6625('0x17'));var config=require(_0x6625('0x18'));var db=require(_0x6625('0x19'))['db'];function respondWithStatusCode(_0x208fea,_0x370f2f){_0x370f2f=_0x370f2f||0xcc;return function(_0x51eaf4){if(_0x51eaf4){return _0x208fea['sendStatus'](_0x370f2f);}return _0x208fea[_0x6625('0x1a')](_0x370f2f)[_0x6625('0x1b')]();};}function respondWithResult(_0x2a4b2b,_0x3b03b4){_0x3b03b4=_0x3b03b4||0xc8;return function(_0x21d384){if(_0x21d384){return _0x2a4b2b[_0x6625('0x1a')](_0x3b03b4)[_0x6625('0x1c')](_0x21d384);}};}function respondWithFilteredResult(_0x354e48,_0x5bce98){return function(_0x5d60b8){if(_0x5d60b8){var _0x951e7a=_0x5d60b8[_0x6625('0x1d')],_0x33f326=_0x5bce98['offset'],_0x205a1e=_0x5bce98[_0x6625('0x1e')]+_0x5bce98[_0x6625('0x1f')],_0x2eba5e;if(_0x205a1e>=_0x951e7a){_0x205a1e=_0x951e7a;_0x2eba5e=0xc8;}else{_0x2eba5e=0xce;}_0x354e48[_0x6625('0x1a')](_0x2eba5e);return _0x354e48[_0x6625('0x20')](_0x6625('0x21'),_0x33f326+'-'+_0x205a1e+'/'+_0x951e7a)['json'](_0x5d60b8);}return null;};}function patchUpdates(_0x15210b){return function(_0x2bdeb7){try{jsonpatch[_0x6625('0x22')](_0x2bdeb7,_0x15210b,!![]);}catch(_0x8dc6a8){return BPromise['reject'](_0x8dc6a8);}return _0x2bdeb7['save']();};}function saveUpdates(_0x336df9,_0x48483d){return function(_0x2e77fe){if(_0x2e77fe){return _0x2e77fe[_0x6625('0x23')](_0x336df9)[_0x6625('0x24')](function(_0x16e8fa){return _0x16e8fa;});}return null;};}function removeEntity(_0x2e684a,_0x217692){return function(_0x544b14){if(_0x544b14){return _0x544b14[_0x6625('0x25')]()[_0x6625('0x24')](function(){_0x2e684a[_0x6625('0x1a')](0xcc)[_0x6625('0x1b')]();});}};}function handleEntityNotFound(_0x2dba06,_0x397f47){return function(_0xde4392){if(!_0xde4392){_0x2dba06[_0x6625('0x26')](0x194);}return _0xde4392;};}function handleError(_0x20d13f,_0x116195){_0x116195=_0x116195||0x1f4;return function(_0x1ad876){logger[_0x6625('0x27')](_0x1ad876[_0x6625('0x28')]);if(_0x1ad876[_0x6625('0x29')]){delete _0x1ad876[_0x6625('0x29')];}_0x20d13f[_0x6625('0x1a')](_0x116195)[_0x6625('0x2a')](_0x1ad876);};}exports[_0x6625('0x2b')]=function(_0x4b09c4,_0xb017fb){var _0xc0f61e={},_0x5a9605={},_0x237cc0={'count':0x0,'rows':[]};var _0x2944df=_[_0x6625('0x2c')](db['VoiceAgentReport'][_0x6625('0x2d')],function(_0x5ce68b){return{'name':_0x5ce68b[_0x6625('0x2e')],'type':_0x5ce68b['type']['key']};});_0x5a9605['model']=_[_0x6625('0x2c')](_0x2944df,'name');_0x5a9605[_0x6625('0x2f')]=_[_0x6625('0x30')](_0x4b09c4['query']);_0x5a9605[_0x6625('0x31')]=_[_0x6625('0x32')](_0x5a9605[_0x6625('0x33')],_0x5a9605[_0x6625('0x2f')]);_0xc0f61e[_0x6625('0x34')]=_[_0x6625('0x32')](_0x5a9605['model'],qs['fields'](_0x4b09c4[_0x6625('0x2f')]['fields']));_0xc0f61e[_0x6625('0x34')]=_0xc0f61e[_0x6625('0x34')][_0x6625('0x35')]?_0xc0f61e[_0x6625('0x34')]:_0x5a9605['model'];if(!_0x4b09c4['query'][_0x6625('0x36')]('nolimit')){_0xc0f61e[_0x6625('0x1f')]=qs[_0x6625('0x1f')](_0x4b09c4[_0x6625('0x2f')][_0x6625('0x1f')]);_0xc0f61e[_0x6625('0x1e')]=qs[_0x6625('0x1e')](_0x4b09c4[_0x6625('0x2f')]['offset']);}_0xc0f61e[_0x6625('0x37')]=qs[_0x6625('0x38')](_0x4b09c4['query'][_0x6625('0x38')]);_0xc0f61e[_0x6625('0x39')]=qs[_0x6625('0x31')](_[_0x6625('0x3a')](_0x4b09c4[_0x6625('0x2f')],_0x5a9605['filters']));if(_0x4b09c4[_0x6625('0x2f')][_0x6625('0x3b')]){_0xc0f61e[_0x6625('0x39')]=_[_0x6625('0x3c')](_0xc0f61e['where'],{'$or':_[_0x6625('0x2c')](_0x2944df,function(_0x303eae){if(_0x303eae['type']!==_0x6625('0x3d')){var _0x212ace={};_0x212ace[_0x303eae[_0x6625('0x29')]]={'$like':'%'+_0x4b09c4[_0x6625('0x2f')][_0x6625('0x3b')]+'%'};return _0x212ace;}})});}_0xc0f61e=_[_0x6625('0x3c')]({},_0xc0f61e,_0x4b09c4['options']);var _0x50baaf={'where':_0xc0f61e[_0x6625('0x39')]};return db[_0x6625('0x3e')][_0x6625('0x1d')](_0x50baaf)[_0x6625('0x24')](function(_0x4a4a35){_0x237cc0[_0x6625('0x1d')]=_0x4a4a35;if(_0x4b09c4[_0x6625('0x2f')][_0x6625('0x3f')]){_0xc0f61e[_0x6625('0x40')]=[{'all':!![]}];}return db[_0x6625('0x3e')]['findAll'](_0xc0f61e);})[_0x6625('0x24')](function(_0x265fde){_0x237cc0[_0x6625('0x41')]=_0x265fde;return _0x237cc0;})[_0x6625('0x24')](respondWithFilteredResult(_0xb017fb,_0xc0f61e))[_0x6625('0x42')](handleError(_0xb017fb,null));};exports[_0x6625('0x43')]=function(_0x370b09,_0x265870){var _0x417022={'raw':![],'where':{'id':_0x370b09[_0x6625('0x44')]['id']}},_0x1e4eb0={};_0x1e4eb0[_0x6625('0x33')]=_[_0x6625('0x30')](db['VoiceAgentReport'][_0x6625('0x2d')]);_0x1e4eb0[_0x6625('0x2f')]=_[_0x6625('0x30')](_0x370b09['query']);_0x1e4eb0[_0x6625('0x31')]=_[_0x6625('0x32')](_0x1e4eb0[_0x6625('0x33')],_0x1e4eb0['query']);_0x417022[_0x6625('0x34')]=_[_0x6625('0x32')](_0x1e4eb0[_0x6625('0x33')],qs[_0x6625('0x45')](_0x370b09[_0x6625('0x2f')][_0x6625('0x45')]));_0x417022['attributes']=_0x417022[_0x6625('0x34')][_0x6625('0x35')]?_0x417022['attributes']:_0x1e4eb0['model'];if(_0x370b09[_0x6625('0x2f')]['includeAll']){_0x417022[_0x6625('0x40')]=[{'all':!![]}];}_0x417022=_[_0x6625('0x3c')]({},_0x417022,_0x370b09[_0x6625('0x46')]);return db['VoiceAgentReport'][_0x6625('0x47')](_0x417022)[_0x6625('0x24')](handleEntityNotFound(_0x265870,null))[_0x6625('0x24')](respondWithResult(_0x265870,null))[_0x6625('0x42')](handleError(_0x265870,null));};exports[_0x6625('0x48')]=function(_0x4aafe7,_0x266d06){return db[_0x6625('0x3e')]['create'](_0x4aafe7['body'],{})[_0x6625('0x24')](respondWithResult(_0x266d06,0xc9))['catch'](handleError(_0x266d06,null));};exports[_0x6625('0x23')]=function(_0x59cdb3,_0x4901b3){if(_0x59cdb3[_0x6625('0x49')]['id']){delete _0x59cdb3[_0x6625('0x49')]['id'];}return db['VoiceAgentReport'][_0x6625('0x47')]({'where':{'id':_0x59cdb3['params']['id']}})[_0x6625('0x24')](handleEntityNotFound(_0x4901b3,null))[_0x6625('0x24')](saveUpdates(_0x59cdb3['body'],null))[_0x6625('0x24')](respondWithResult(_0x4901b3,null))['catch'](handleError(_0x4901b3,null));};exports[_0x6625('0x25')]=function(_0x452301,_0x15da0f){return db[_0x6625('0x3e')]['find']({'where':{'id':_0x452301[_0x6625('0x44')]['id']}})[_0x6625('0x24')](handleEntityNotFound(_0x15da0f,null))[_0x6625('0x24')](removeEntity(_0x15da0f,null))[_0x6625('0x42')](handleError(_0x15da0f,null));};exports['describe']=function(_0x15ef36,_0x1ae2aa){return db[_0x6625('0x3e')]['describe']()[_0x6625('0x24')](respondWithResult(_0x1ae2aa,null))[_0x6625('0x42')](handleError(_0x1ae2aa,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index adb7446..50851af 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 _0x0024=['rimraf','../../config/environment','define','VoiceAgentReport','uniqueid','destuniqueid','util','api','bluebird'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x0024,0xa8));var _0x4002=function(_0x529902,_0x1c9253){_0x529902=_0x529902-0x0;var _0x6f4be6=_0x0024[_0x529902];return _0x6f4be6;};'use strict';var _=require('lodash');var util=require(_0x4002('0x0'));var logger=require('../../config/logger')(_0x4002('0x1'));var moment=require('moment');var BPromise=require(_0x4002('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4002('0x3'));var config=require(_0x4002('0x4'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x36c011,_0x144717){return _0x36c011[_0x4002('0x5')](_0x4002('0x6'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x4002('0x7'),_0x4002('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdbb3=['rimraf','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x39cd67,_0x1e1601){var _0x266cd7=function(_0x36a299){while(--_0x36a299){_0x39cd67['push'](_0x39cd67['shift']());}};_0x266cd7(++_0x1e1601);}(_0xdbb3,0x1a7));var _0x3dbb=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xdbb3[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x3dbb('0x0'));var util=require(_0x3dbb('0x1'));var logger=require(_0x3dbb('0x2'))(_0x3dbb('0x3'));var moment=require('moment');var BPromise=require(_0x3dbb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3dbb('0x5'));var rimraf=require(_0x3dbb('0x6'));var config=require('../../config/environment');var attributes=require(_0x3dbb('0x7'));module['exports']=function(_0x22adff,_0x18773e){return _0x22adff[_0x3dbb('0x8')](_0x3dbb('0x9'),attributes,{'tableName':_0x3dbb('0xa'),'paranoid':![],'indexes':[{'fields':[_0x3dbb('0xb'),_0x3dbb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index fbc94ce..51a944a 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 _0xdd12=['debug','request\x20sent','error','code','message','result','catch','CreateVoiceAgentReport','create','body','options','raw','stringify','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','moment','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s'];(function(_0x150557,_0x2c914d){var _0xe7bb8b=function(_0x54b1e9){while(--_0x54b1e9){_0x150557['push'](_0x150557['shift']());}};_0xe7bb8b(++_0x2c914d);}(_0xdd12,0x1a5));var _0x2dd1=function(_0x28928a,_0x13bee6){_0x28928a=_0x28928a-0x0;var _0x5502cd=_0xdd12[_0x28928a];return _0x5502cd;};'use strict';var _=require(_0x2dd1('0x0'));var util=require(_0x2dd1('0x1'));var moment=require(_0x2dd1('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(_0x2dd1('0x3'));var logger=require(_0x2dd1('0x4'))('rpc');var config=require(_0x2dd1('0x5'));var jayson=require(_0x2dd1('0x6'));var client=jayson[_0x2dd1('0x7')][_0x2dd1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c41a1,_0x14b3c4,_0x1d2b05){return new BPromise(function(_0x583ae6,_0x596a4d){return client[_0x2dd1('0x9')](_0x1c41a1,_0x1d2b05)[_0x2dd1('0xa')](function(_0x217d70){logger[_0x2dd1('0xb')](_0x2dd1('0xc'),_0x14b3c4,'request\x20sent');logger[_0x2dd1('0xd')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x14b3c4,_0x2dd1('0xe'),JSON['stringify'](_0x217d70));if(_0x217d70[_0x2dd1('0xf')]){if(_0x217d70[_0x2dd1('0xf')][_0x2dd1('0x10')]===0x1f4){logger[_0x2dd1('0xf')](_0x2dd1('0xc'),_0x14b3c4,_0x217d70[_0x2dd1('0xf')]['message']);return _0x596a4d(_0x217d70[_0x2dd1('0xf')][_0x2dd1('0x11')]);}logger['error'](_0x2dd1('0xc'),_0x14b3c4,_0x217d70[_0x2dd1('0xf')]['message']);return _0x583ae6(_0x217d70['error'][_0x2dd1('0x11')]);}else{logger[_0x2dd1('0xb')](_0x2dd1('0xc'),_0x14b3c4,_0x2dd1('0xe'));_0x583ae6(_0x217d70[_0x2dd1('0x12')][_0x2dd1('0x11')]);}})[_0x2dd1('0x13')](function(_0x4d43c4){logger[_0x2dd1('0xf')](_0x2dd1('0xc'),_0x14b3c4,_0x4d43c4);_0x596a4d(_0x4d43c4);});});}exports[_0x2dd1('0x14')]=function(_0x1af8d9){var _0x3880a8=this;return new Promise(function(_0x527c58,_0x3e7771){return db['VoiceAgentReport'][_0x2dd1('0x15')](_0x1af8d9[_0x2dd1('0x16')],{'raw':_0x1af8d9[_0x2dd1('0x17')]?_0x1af8d9['options'][_0x2dd1('0x18')]===undefined?!![]:![]:!![]})[_0x2dd1('0xa')](function(_0x2b7376){logger[_0x2dd1('0xb')](_0x2dd1('0x14'),_0x1af8d9);logger[_0x2dd1('0xd')](_0x2dd1('0x14'),_0x1af8d9,JSON[_0x2dd1('0x19')](_0x2b7376));_0x527c58(_0x2b7376);})[_0x2dd1('0x13')](function(_0x541bfd){logger[_0x2dd1('0xf')]('CreateVoiceAgentReport',_0x541bfd[_0x2dd1('0x11')],_0x1af8d9);_0x3e7771(_0x3880a8['error'](0x1f4,_0x541bfd['message']));});});};exports[_0x2dd1('0x1a')]=function(_0x5aedee){var _0x4a7b60=this;return new Promise(function(_0x4b58b0,_0x4fdbdf){return db['VoiceAgentReport'][_0x2dd1('0x1b')](_0x5aedee[_0x2dd1('0x16')],{'raw':_0x5aedee[_0x2dd1('0x17')]?_0x5aedee[_0x2dd1('0x17')][_0x2dd1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5aedee[_0x2dd1('0x17')]?_0x5aedee['options'][_0x2dd1('0x1c')]||null:null,'attributes':_0x5aedee[_0x2dd1('0x17')]?_0x5aedee[_0x2dd1('0x17')][_0x2dd1('0x1d')]||null:null,'limit':_0x5aedee['options']?_0x5aedee[_0x2dd1('0x17')][_0x2dd1('0x1e')]||null:null})[_0x2dd1('0xa')](function(_0x14ff5){logger[_0x2dd1('0xb')](_0x2dd1('0x1a'),_0x5aedee);logger[_0x2dd1('0xd')](_0x2dd1('0x1a'),_0x5aedee,JSON[_0x2dd1('0x19')](_0x14ff5));_0x4b58b0(_0x14ff5);})[_0x2dd1('0x13')](function(_0x31801d){logger['error'](_0x2dd1('0x1a'),_0x31801d[_0x2dd1('0x11')],_0x5aedee);_0x4fdbdf(_0x4a7b60[_0x2dd1('0xf')](0x1f4,_0x31801d['message']));});});}; \ No newline at end of file +var _0x6a19=['limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','options','raw','then','UpdateVoiceAgentReport','update','body'];(function(_0x43139f,_0x22cbfb){var _0x243f67=function(_0x27d06f){while(--_0x27d06f){_0x43139f['push'](_0x43139f['shift']());}};_0x243f67(++_0x22cbfb);}(_0x6a19,0xd3));var _0x96a1=function(_0x3446af,_0x3b2f92){_0x3446af=_0x3446af-0x0;var _0x252b14=_0x6a19[_0x3446af];return _0x252b14;};'use strict';var _=require(_0x96a1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x96a1('0x1'));var rs=require(_0x96a1('0x2'));var fs=require('fs');var Redis=require(_0x96a1('0x3'));var db=require(_0x96a1('0x4'))['db'];var utils=require(_0x96a1('0x5'));var logger=require(_0x96a1('0x6'))(_0x96a1('0x7'));var config=require(_0x96a1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x96a1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cc614,_0x4f097f,_0x32433b){return new BPromise(function(_0x5f56c6,_0x2effbe){return client['request'](_0x1cc614,_0x32433b)['then'](function(_0x362aa9){logger['info'](_0x96a1('0xa'),_0x4f097f,_0x96a1('0xb'));logger[_0x96a1('0xc')](_0x96a1('0xd'),_0x4f097f,'request\x20sent',JSON[_0x96a1('0xe')](_0x362aa9));if(_0x362aa9['error']){if(_0x362aa9[_0x96a1('0xf')][_0x96a1('0x10')]===0x1f4){logger[_0x96a1('0xf')](_0x96a1('0xa'),_0x4f097f,_0x362aa9[_0x96a1('0xf')][_0x96a1('0x11')]);return _0x2effbe(_0x362aa9[_0x96a1('0xf')][_0x96a1('0x11')]);}logger['error'](_0x96a1('0xa'),_0x4f097f,_0x362aa9['error'][_0x96a1('0x11')]);return _0x5f56c6(_0x362aa9[_0x96a1('0xf')]['message']);}else{logger[_0x96a1('0x12')](_0x96a1('0xa'),_0x4f097f,_0x96a1('0xb'));_0x5f56c6(_0x362aa9[_0x96a1('0x13')][_0x96a1('0x11')]);}})[_0x96a1('0x14')](function(_0x563a7b){logger[_0x96a1('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x4f097f,_0x563a7b);_0x2effbe(_0x563a7b);});});}exports[_0x96a1('0x15')]=function(_0x4312d5){var _0x3d5d8c=this;return new Promise(function(_0x561419,_0x3cce88){return db[_0x96a1('0x16')]['create'](_0x4312d5['body'],{'raw':_0x4312d5[_0x96a1('0x17')]?_0x4312d5['options'][_0x96a1('0x18')]===undefined?!![]:![]:!![]})[_0x96a1('0x19')](function(_0x3a01e4){logger['info'](_0x96a1('0x15'),_0x4312d5);logger[_0x96a1('0xc')](_0x96a1('0x15'),_0x4312d5,JSON[_0x96a1('0xe')](_0x3a01e4));_0x561419(_0x3a01e4);})[_0x96a1('0x14')](function(_0xc6922a){logger[_0x96a1('0xf')](_0x96a1('0x15'),_0xc6922a[_0x96a1('0x11')],_0x4312d5);_0x3cce88(_0x3d5d8c['error'](0x1f4,_0xc6922a[_0x96a1('0x11')]));});});};exports[_0x96a1('0x1a')]=function(_0x1d2c6b){var _0x197d54=this;return new Promise(function(_0x31cfa3,_0x4ac57a){return db['VoiceAgentReport'][_0x96a1('0x1b')](_0x1d2c6b[_0x96a1('0x1c')],{'raw':_0x1d2c6b[_0x96a1('0x17')]?_0x1d2c6b[_0x96a1('0x17')][_0x96a1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d2c6b['options']?_0x1d2c6b[_0x96a1('0x17')]['where']||null:null,'attributes':_0x1d2c6b[_0x96a1('0x17')]?_0x1d2c6b['options']['attributes']||null:null,'limit':_0x1d2c6b[_0x96a1('0x17')]?_0x1d2c6b[_0x96a1('0x17')][_0x96a1('0x1d')]||null:null})[_0x96a1('0x19')](function(_0x19d100){logger['info'](_0x96a1('0x1a'),_0x1d2c6b);logger[_0x96a1('0xc')](_0x96a1('0x1a'),_0x1d2c6b,JSON[_0x96a1('0xe')](_0x19d100));_0x31cfa3(_0x19d100);})['catch'](function(_0x4609e0){logger[_0x96a1('0xf')]('UpdateVoiceAgentReport',_0x4609e0['message'],_0x1d2c6b);_0x4ac57a(_0x197d54['error'](0x1f4,_0x4609e0[_0x96a1('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index c778cb6..041c613 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 _0xb8e6=['/:id','update','exports','multer','util','path','express','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','create'];(function(_0x2ac80c,_0x2cc1ac){var _0x36b362=function(_0x49e11f){while(--_0x49e11f){_0x2ac80c['push'](_0x2ac80c['shift']());}};_0x36b362(++_0x2cc1ac);}(_0xb8e6,0x1d3));var _0x6b8e=function(_0x44e4df,_0x20455c){_0x44e4df=_0x44e4df-0x0;var _0x39e218=_0xb8e6[_0x44e4df];return _0x39e218;};'use strict';var multer=require(_0x6b8e('0x0'));var util=require(_0x6b8e('0x1'));var path=require(_0x6b8e('0x2'));var timeout=require('connect-timeout');var express=require(_0x6b8e('0x3'));var router=express['Router']();var auth=require(_0x6b8e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6b8e('0x5'));var controller=require('./voiceCallReport.controller');router[_0x6b8e('0x6')]('/',auth['isAuthenticated'](),controller[_0x6b8e('0x7')]);router['get'](_0x6b8e('0x8'),auth[_0x6b8e('0x9')](),controller[_0x6b8e('0xa')]);router[_0x6b8e('0x6')]('/:id',auth[_0x6b8e('0x9')](),controller[_0x6b8e('0xb')]);router['post']('/',auth[_0x6b8e('0x9')](),controller[_0x6b8e('0xc')]);router['put'](_0x6b8e('0xd'),auth[_0x6b8e('0x9')](),controller[_0x6b8e('0xe')]);router['delete']('/:id',auth[_0x6b8e('0x9')](),controller['destroy']);module[_0x6b8e('0xf')]=router; \ No newline at end of file +var _0x0368=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','index','isAuthenticated','describe','/:id','show','create','update','destroy'];(function(_0x3fea00,_0x95c208){var _0x5c4dec=function(_0x342bc5){while(--_0x342bc5){_0x3fea00['push'](_0x3fea00['shift']());}};_0x5c4dec(++_0x95c208);}(_0x0368,0x1d1));var _0x8036=function(_0x54b458,_0x4da21b){_0x54b458=_0x54b458-0x0;var _0x18d704=_0x0368[_0x54b458];return _0x18d704;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8036('0x0'));var timeout=require(_0x8036('0x1'));var express=require('express');var router=express[_0x8036('0x2')]();var auth=require(_0x8036('0x3'));var interaction=require(_0x8036('0x4'));var config=require('../../config/environment');var controller=require(_0x8036('0x5'));router[_0x8036('0x6')]('/',auth['isAuthenticated'](),controller[_0x8036('0x7')]);router[_0x8036('0x6')]('/describe',auth[_0x8036('0x8')](),controller[_0x8036('0x9')]);router['get'](_0x8036('0xa'),auth['isAuthenticated'](),controller[_0x8036('0xb')]);router['post']('/',auth[_0x8036('0x8')](),controller[_0x8036('0xc')]);router['put'](_0x8036('0xa'),auth[_0x8036('0x8')](),controller[_0x8036('0xd')]);router['delete']('/:id',auth[_0x8036('0x8')](),controller[_0x8036('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index e08fc89..5de471a 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 _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0xf6ea70,_0x7c1c6e){var _0x24898a=function(_0x23b06d){while(--_0x23b06d){_0xf6ea70['push'](_0xf6ea70['shift']());}};_0x24898a(++_0x7c1c6e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file +var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x99df31,_0x146107){var _0x2756d7=function(_0x75ca9){while(--_0x75ca9){_0x99df31['push'](_0x99df31['shift']());}};_0x2756d7(++_0x146107);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index b30e90d..402113e 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 _0x0dd4=['find','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','error','stack','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','fullname','alias','User','findAll','rows','catch','show','params','body','destroy'];(function(_0x4a8390,_0x5d8b31){var _0x22a5b7=function(_0x378964){while(--_0x378964){_0x4a8390['push'](_0x4a8390['shift']());}};_0x22a5b7(++_0x5d8b31);}(_0x0dd4,0x9d));var _0x40dd=function(_0x33c00e,_0x433579){_0x33c00e=_0x33c00e-0x0;var _0x1f2868=_0x0dd4[_0x33c00e];return _0x1f2868;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x40dd('0x0'));var rimraf=require(_0x40dd('0x1'));var zipdir=require(_0x40dd('0x2'));var jsonpatch=require(_0x40dd('0x3'));var rp=require(_0x40dd('0x4'));var moment=require(_0x40dd('0x5'));var BPromise=require(_0x40dd('0x6'));var Mustache=require(_0x40dd('0x7'));var util=require(_0x40dd('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x40dd('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x40dd('0xa'));var squel=require(_0x40dd('0xb'));var crypto=require(_0x40dd('0xc'));var jsforce=require(_0x40dd('0xd'));var deskjs=require(_0x40dd('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x40dd('0xf'));var Redis=require(_0x40dd('0x10'));var authService=require(_0x40dd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x40dd('0x12'));var hardwareService=require(_0x40dd('0x13'));var logger=require(_0x40dd('0x14'))(_0x40dd('0x15'));var utils=require(_0x40dd('0x16'));var config=require(_0x40dd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7daf28,_0x1aa942){_0x1aa942=_0x1aa942||0xcc;return function(_0x58ae19){if(_0x58ae19){return _0x7daf28[_0x40dd('0x18')](_0x1aa942);}return _0x7daf28[_0x40dd('0x19')](_0x1aa942)[_0x40dd('0x1a')]();};}function respondWithResult(_0x2c7c8f,_0x13e4f7){_0x13e4f7=_0x13e4f7||0xc8;return function(_0x1bb1de){if(_0x1bb1de){return _0x2c7c8f['status'](_0x13e4f7)[_0x40dd('0x1b')](_0x1bb1de);}};}function respondWithFilteredResult(_0x28615e,_0x15c021){return function(_0x3dce43){if(_0x3dce43){var _0x189308=_0x3dce43[_0x40dd('0x1c')],_0x77c860=_0x15c021[_0x40dd('0x1d')],_0x339e51=_0x15c021[_0x40dd('0x1d')]+_0x15c021[_0x40dd('0x1e')],_0x154f2d;if(_0x339e51>=_0x189308){_0x339e51=_0x189308;_0x154f2d=0xc8;}else{_0x154f2d=0xce;}_0x28615e[_0x40dd('0x19')](_0x154f2d);return _0x28615e[_0x40dd('0x1f')]('Content-Range',_0x77c860+'-'+_0x339e51+'/'+_0x189308)[_0x40dd('0x1b')](_0x3dce43);}return null;};}function patchUpdates(_0x22829f){return function(_0x3e7c58){try{jsonpatch[_0x40dd('0x20')](_0x3e7c58,_0x22829f,!![]);}catch(_0x1bf993){return BPromise[_0x40dd('0x21')](_0x1bf993);}return _0x3e7c58['save']();};}function saveUpdates(_0xc292b,_0x332ffc){return function(_0x3ba452){if(_0x3ba452){return _0x3ba452[_0x40dd('0x22')](_0xc292b)[_0x40dd('0x23')](function(_0x46eaa1){return _0x46eaa1;});}return null;};}function removeEntity(_0x4b11c7,_0x26c65e){return function(_0xab21f3){if(_0xab21f3){return _0xab21f3['destroy']()[_0x40dd('0x23')](function(){_0x4b11c7[_0x40dd('0x19')](0xcc)[_0x40dd('0x1a')]();});}};}function handleEntityNotFound(_0x528cfb,_0x1c23f4){return function(_0x1b7a08){if(!_0x1b7a08){_0x528cfb[_0x40dd('0x18')](0x194);}return _0x1b7a08;};}function handleError(_0xe7cdcf,_0x541d21){_0x541d21=_0x541d21||0x1f4;return function(_0x4990d9){logger[_0x40dd('0x24')](_0x4990d9[_0x40dd('0x25')]);if(_0x4990d9[_0x40dd('0x26')]){delete _0x4990d9[_0x40dd('0x26')];}_0xe7cdcf['status'](_0x541d21)[_0x40dd('0x27')](_0x4990d9);};}exports[_0x40dd('0x28')]=function(_0x53617c,_0x24c359){var _0x3b1d86={},_0xc90826={},_0x4e19c6={'count':0x0,'rows':[]};var _0x361615=_[_0x40dd('0x29')](db[_0x40dd('0x2a')][_0x40dd('0x2b')],function(_0x57afba){return{'name':_0x57afba[_0x40dd('0x2c')],'type':_0x57afba['type']['key']};});_0xc90826[_0x40dd('0x2d')]=_['map'](_0x361615,_0x40dd('0x26'));_0xc90826[_0x40dd('0x2e')]=_[_0x40dd('0x2f')](_0x53617c['query']);_0xc90826[_0x40dd('0x30')]=_[_0x40dd('0x31')](_0xc90826[_0x40dd('0x2d')],_0xc90826[_0x40dd('0x2e')]);_0x3b1d86['attributes']=_[_0x40dd('0x31')](_0xc90826[_0x40dd('0x2d')],qs[_0x40dd('0x32')](_0x53617c['query'][_0x40dd('0x32')]));_0x3b1d86[_0x40dd('0x33')]=_0x3b1d86[_0x40dd('0x33')][_0x40dd('0x34')]?_0x3b1d86[_0x40dd('0x33')]:_0xc90826['model'];if(!_0x53617c[_0x40dd('0x2e')][_0x40dd('0x35')](_0x40dd('0x36'))){_0x3b1d86[_0x40dd('0x1e')]=qs[_0x40dd('0x1e')](_0x53617c[_0x40dd('0x2e')][_0x40dd('0x1e')]);_0x3b1d86[_0x40dd('0x1d')]=qs[_0x40dd('0x1d')](_0x53617c['query']['offset']);}_0x3b1d86['order']=qs[_0x40dd('0x37')](_0x53617c[_0x40dd('0x2e')]['sort']);_0x3b1d86['where']=qs[_0x40dd('0x30')](_[_0x40dd('0x38')](_0x53617c['query'],_0xc90826['filters']));if(_0x53617c[_0x40dd('0x2e')][_0x40dd('0x39')]){_0x3b1d86[_0x40dd('0x3a')]=_[_0x40dd('0x3b')](_0x3b1d86[_0x40dd('0x3a')],{'$or':_[_0x40dd('0x29')](_0x361615,function(_0x777d89){if(_0x777d89[_0x40dd('0x3c')]!==_0x40dd('0x3d')){var _0x51090={};_0x51090[_0x777d89[_0x40dd('0x26')]]={'$like':'%'+_0x53617c[_0x40dd('0x2e')][_0x40dd('0x39')]+'%'};return _0x51090;}})});}_0x3b1d86=_[_0x40dd('0x3b')]({},_0x3b1d86,_0x53617c[_0x40dd('0x3e')]);var _0x154ed6={'where':_0x3b1d86['where']};return db[_0x40dd('0x2a')]['count'](_0x154ed6)[_0x40dd('0x23')](function(_0x2a068d){_0x4e19c6[_0x40dd('0x1c')]=_0x2a068d;if(_0x53617c['query'][_0x40dd('0x3f')]){_0x3b1d86['include']=[{'attributes':['id',_0x40dd('0x26'),_0x40dd('0x40'),_0x40dd('0x41')],'model':db[_0x40dd('0x42')],'as':'User'}];}return db[_0x40dd('0x2a')][_0x40dd('0x43')](_0x3b1d86);})['then'](function(_0x2fea55){_0x4e19c6[_0x40dd('0x44')]=_0x2fea55;return _0x4e19c6;})['then'](respondWithFilteredResult(_0x24c359,_0x3b1d86))[_0x40dd('0x45')](handleError(_0x24c359,null));};exports[_0x40dd('0x46')]=function(_0x502b0a,_0x369278){var _0x496158={'raw':!![],'where':{'id':_0x502b0a[_0x40dd('0x47')]['id']}},_0x1cd0c4={};_0x1cd0c4[_0x40dd('0x2d')]=_['keys'](db['VoiceCallReport'][_0x40dd('0x2b')]);_0x1cd0c4[_0x40dd('0x2e')]=_['keys'](_0x502b0a[_0x40dd('0x2e')]);_0x1cd0c4['filters']=_[_0x40dd('0x31')](_0x1cd0c4['model'],_0x1cd0c4[_0x40dd('0x2e')]);_0x496158[_0x40dd('0x33')]=_['intersection'](_0x1cd0c4[_0x40dd('0x2d')],qs['fields'](_0x502b0a['query']['fields']));_0x496158[_0x40dd('0x33')]=_0x496158[_0x40dd('0x33')][_0x40dd('0x34')]?_0x496158[_0x40dd('0x33')]:_0x1cd0c4[_0x40dd('0x2d')];if(_0x502b0a[_0x40dd('0x2e')][_0x40dd('0x3f')]){_0x496158['include']=[{'all':!![]}];}_0x496158=_[_0x40dd('0x3b')]({},_0x496158,_0x502b0a[_0x40dd('0x3e')]);return db[_0x40dd('0x2a')]['find'](_0x496158)[_0x40dd('0x23')](handleEntityNotFound(_0x369278,null))['then'](respondWithResult(_0x369278,null))[_0x40dd('0x45')](handleError(_0x369278,null));};exports['create']=function(_0x425a38,_0x5acb27){return db[_0x40dd('0x2a')]['create'](_0x425a38[_0x40dd('0x48')],{})[_0x40dd('0x23')](respondWithResult(_0x5acb27,0xc9))[_0x40dd('0x45')](handleError(_0x5acb27,null));};exports[_0x40dd('0x49')]=function(_0xf93a2b,_0x299ca1){return db[_0x40dd('0x2a')][_0x40dd('0x4a')]({'where':{'id':_0xf93a2b[_0x40dd('0x47')]['id']}})[_0x40dd('0x23')](handleEntityNotFound(_0x299ca1,null))['then'](removeEntity(_0x299ca1,null))[_0x40dd('0x45')](handleError(_0x299ca1,null));};exports[_0x40dd('0x4b')]=function(_0x1d5cd2,_0x94d21f){return db[_0x40dd('0x2a')][_0x40dd('0x4b')]()['then'](respondWithResult(_0x94d21f,null))[_0x40dd('0x45')](handleError(_0x94d21f,null));};exports['update']=function(_0x15478b,_0x51a36a){if(_0x15478b[_0x40dd('0x48')][_0x40dd('0x4c')]){delete _0x15478b[_0x40dd('0x48')]['uniqueid'];}return db[_0x40dd('0x2a')][_0x40dd('0x4a')]({'where':{'uniqueid':_0x15478b[_0x40dd('0x47')]['id'],'UserId':{'$or':[null,_0x15478b['user']['id']]}}})[_0x40dd('0x23')](handleEntityNotFound(_0x51a36a,null))[_0x40dd('0x23')](saveUpdates(_0x15478b[_0x40dd('0x48')],null))[_0x40dd('0x23')](respondWithResult(_0x51a36a,null))['catch'](handleError(_0x51a36a,null));}; \ No newline at end of file +var _0xef81=['options','includeAll','fullname','alias','User','findAll','rows','catch','params','rawAttributes','include','create','body','find','describe','update','uniqueid','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','where','merge','filter'];(function(_0xae01dd,_0xbd8a3c){var _0x8c26df=function(_0x359827){while(--_0x359827){_0xae01dd['push'](_0xae01dd['shift']());}};_0x8c26df(++_0xbd8a3c);}(_0xef81,0xaf));var _0x1ef8=function(_0x2554d8,_0x511480){_0x2554d8=_0x2554d8-0x0;var _0x417447=_0xef81[_0x2554d8];return _0x417447;};'use strict';var pdf=require(_0x1ef8('0x0'));var emlformat=require(_0x1ef8('0x1'));var rimraf=require(_0x1ef8('0x2'));var zipdir=require(_0x1ef8('0x3'));var jsonpatch=require(_0x1ef8('0x4'));var rp=require('request-promise');var moment=require(_0x1ef8('0x5'));var BPromise=require(_0x1ef8('0x6'));var Mustache=require(_0x1ef8('0x7'));var util=require(_0x1ef8('0x8'));var path=require(_0x1ef8('0x9'));var sox=require(_0x1ef8('0xa'));var csv=require('to-csv');var ejs=require(_0x1ef8('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1ef8('0xc'));var crypto=require(_0x1ef8('0xd'));var jsforce=require(_0x1ef8('0xe'));var deskjs=require(_0x1ef8('0xf'));var toCsv=require(_0x1ef8('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1ef8('0x11'));var authService=require(_0x1ef8('0x12'));var qs=require(_0x1ef8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ef8('0x14'));var logger=require(_0x1ef8('0x15'))(_0x1ef8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1ef8('0x17'))['db'];function respondWithStatusCode(_0x10bbf1,_0x593251){_0x593251=_0x593251||0xcc;return function(_0x382150){if(_0x382150){return _0x10bbf1['sendStatus'](_0x593251);}return _0x10bbf1[_0x1ef8('0x18')](_0x593251)[_0x1ef8('0x19')]();};}function respondWithResult(_0x6a0f94,_0x143708){_0x143708=_0x143708||0xc8;return function(_0x59bcaa){if(_0x59bcaa){return _0x6a0f94[_0x1ef8('0x18')](_0x143708)[_0x1ef8('0x1a')](_0x59bcaa);}};}function respondWithFilteredResult(_0x685c33,_0x58785a){return function(_0x4e7127){if(_0x4e7127){var _0x2061a6=_0x4e7127[_0x1ef8('0x1b')],_0x152cc9=_0x58785a[_0x1ef8('0x1c')],_0x2d5d21=_0x58785a[_0x1ef8('0x1c')]+_0x58785a[_0x1ef8('0x1d')],_0x53043e;if(_0x2d5d21>=_0x2061a6){_0x2d5d21=_0x2061a6;_0x53043e=0xc8;}else{_0x53043e=0xce;}_0x685c33[_0x1ef8('0x18')](_0x53043e);return _0x685c33[_0x1ef8('0x1e')](_0x1ef8('0x1f'),_0x152cc9+'-'+_0x2d5d21+'/'+_0x2061a6)[_0x1ef8('0x1a')](_0x4e7127);}return null;};}function patchUpdates(_0x3fff96){return function(_0x2128d0){try{jsonpatch[_0x1ef8('0x20')](_0x2128d0,_0x3fff96,!![]);}catch(_0x1e6a4c){return BPromise[_0x1ef8('0x21')](_0x1e6a4c);}return _0x2128d0[_0x1ef8('0x22')]();};}function saveUpdates(_0x2f78d2,_0x1f86f4){return function(_0x51e999){if(_0x51e999){return _0x51e999['update'](_0x2f78d2)[_0x1ef8('0x23')](function(_0x538fa7){return _0x538fa7;});}return null;};}function removeEntity(_0x43b39c,_0x4ba0f0){return function(_0x5b119e){if(_0x5b119e){return _0x5b119e[_0x1ef8('0x24')]()[_0x1ef8('0x23')](function(){_0x43b39c[_0x1ef8('0x18')](0xcc)[_0x1ef8('0x19')]();});}};}function handleEntityNotFound(_0x1836bc,_0x385193){return function(_0x190656){if(!_0x190656){_0x1836bc[_0x1ef8('0x25')](0x194);}return _0x190656;};}function handleError(_0x2f0b7a,_0x5359fc){_0x5359fc=_0x5359fc||0x1f4;return function(_0x49bfa7){logger[_0x1ef8('0x26')](_0x49bfa7[_0x1ef8('0x27')]);if(_0x49bfa7['name']){delete _0x49bfa7[_0x1ef8('0x28')];}_0x2f0b7a[_0x1ef8('0x18')](_0x5359fc)[_0x1ef8('0x29')](_0x49bfa7);};}exports[_0x1ef8('0x2a')]=function(_0x19f127,_0x2284f8){var _0x548332={},_0x50192c={},_0x4d8cfc={'count':0x0,'rows':[]};var _0x147908=_[_0x1ef8('0x2b')](db[_0x1ef8('0x2c')]['rawAttributes'],function(_0x861daa){return{'name':_0x861daa[_0x1ef8('0x2d')],'type':_0x861daa[_0x1ef8('0x2e')][_0x1ef8('0x2f')]};});_0x50192c['model']=_[_0x1ef8('0x2b')](_0x147908,_0x1ef8('0x28'));_0x50192c['query']=_[_0x1ef8('0x30')](_0x19f127['query']);_0x50192c['filters']=_[_0x1ef8('0x31')](_0x50192c[_0x1ef8('0x32')],_0x50192c[_0x1ef8('0x33')]);_0x548332[_0x1ef8('0x34')]=_['intersection'](_0x50192c[_0x1ef8('0x32')],qs[_0x1ef8('0x35')](_0x19f127[_0x1ef8('0x33')][_0x1ef8('0x35')]));_0x548332[_0x1ef8('0x34')]=_0x548332[_0x1ef8('0x34')][_0x1ef8('0x36')]?_0x548332[_0x1ef8('0x34')]:_0x50192c[_0x1ef8('0x32')];if(!_0x19f127[_0x1ef8('0x33')][_0x1ef8('0x37')](_0x1ef8('0x38'))){_0x548332[_0x1ef8('0x1d')]=qs[_0x1ef8('0x1d')](_0x19f127[_0x1ef8('0x33')]['limit']);_0x548332[_0x1ef8('0x1c')]=qs[_0x1ef8('0x1c')](_0x19f127[_0x1ef8('0x33')][_0x1ef8('0x1c')]);}_0x548332['order']=qs[_0x1ef8('0x39')](_0x19f127[_0x1ef8('0x33')][_0x1ef8('0x39')]);_0x548332['where']=qs[_0x1ef8('0x3a')](_['pick'](_0x19f127[_0x1ef8('0x33')],_0x50192c[_0x1ef8('0x3a')]));if(_0x19f127[_0x1ef8('0x33')]['filter']){_0x548332[_0x1ef8('0x3b')]=_[_0x1ef8('0x3c')](_0x548332[_0x1ef8('0x3b')],{'$or':_['map'](_0x147908,function(_0x52a8d2){if(_0x52a8d2['type']!=='VIRTUAL'){var _0x3bc032={};_0x3bc032[_0x52a8d2['name']]={'$like':'%'+_0x19f127[_0x1ef8('0x33')][_0x1ef8('0x3d')]+'%'};return _0x3bc032;}})});}_0x548332=_[_0x1ef8('0x3c')]({},_0x548332,_0x19f127[_0x1ef8('0x3e')]);var _0x4e9cb4={'where':_0x548332[_0x1ef8('0x3b')]};return db[_0x1ef8('0x2c')]['count'](_0x4e9cb4)[_0x1ef8('0x23')](function(_0x25c5b0){_0x4d8cfc['count']=_0x25c5b0;if(_0x19f127['query'][_0x1ef8('0x3f')]){_0x548332['include']=[{'attributes':['id',_0x1ef8('0x28'),_0x1ef8('0x40'),_0x1ef8('0x41')],'model':db[_0x1ef8('0x42')],'as':_0x1ef8('0x42')}];}return db[_0x1ef8('0x2c')][_0x1ef8('0x43')](_0x548332);})[_0x1ef8('0x23')](function(_0x788edd){_0x4d8cfc[_0x1ef8('0x44')]=_0x788edd;return _0x4d8cfc;})[_0x1ef8('0x23')](respondWithFilteredResult(_0x2284f8,_0x548332))[_0x1ef8('0x45')](handleError(_0x2284f8,null));};exports['show']=function(_0x4c5b2f,_0xf2c9b3){var _0x43b820={'raw':!![],'where':{'id':_0x4c5b2f[_0x1ef8('0x46')]['id']}},_0x574bb7={};_0x574bb7[_0x1ef8('0x32')]=_['keys'](db[_0x1ef8('0x2c')][_0x1ef8('0x47')]);_0x574bb7[_0x1ef8('0x33')]=_['keys'](_0x4c5b2f[_0x1ef8('0x33')]);_0x574bb7[_0x1ef8('0x3a')]=_[_0x1ef8('0x31')](_0x574bb7['model'],_0x574bb7[_0x1ef8('0x33')]);_0x43b820[_0x1ef8('0x34')]=_[_0x1ef8('0x31')](_0x574bb7[_0x1ef8('0x32')],qs['fields'](_0x4c5b2f[_0x1ef8('0x33')]['fields']));_0x43b820['attributes']=_0x43b820[_0x1ef8('0x34')][_0x1ef8('0x36')]?_0x43b820[_0x1ef8('0x34')]:_0x574bb7[_0x1ef8('0x32')];if(_0x4c5b2f[_0x1ef8('0x33')][_0x1ef8('0x3f')]){_0x43b820[_0x1ef8('0x48')]=[{'all':!![]}];}_0x43b820=_[_0x1ef8('0x3c')]({},_0x43b820,_0x4c5b2f[_0x1ef8('0x3e')]);return db['VoiceCallReport']['find'](_0x43b820)[_0x1ef8('0x23')](handleEntityNotFound(_0xf2c9b3,null))[_0x1ef8('0x23')](respondWithResult(_0xf2c9b3,null))[_0x1ef8('0x45')](handleError(_0xf2c9b3,null));};exports[_0x1ef8('0x49')]=function(_0x53b57b,_0x3cdcd4){return db[_0x1ef8('0x2c')][_0x1ef8('0x49')](_0x53b57b[_0x1ef8('0x4a')],{})[_0x1ef8('0x23')](respondWithResult(_0x3cdcd4,0xc9))[_0x1ef8('0x45')](handleError(_0x3cdcd4,null));};exports[_0x1ef8('0x24')]=function(_0x2103bc,_0x5c80fa){return db[_0x1ef8('0x2c')][_0x1ef8('0x4b')]({'where':{'id':_0x2103bc[_0x1ef8('0x46')]['id']}})[_0x1ef8('0x23')](handleEntityNotFound(_0x5c80fa,null))[_0x1ef8('0x23')](removeEntity(_0x5c80fa,null))[_0x1ef8('0x45')](handleError(_0x5c80fa,null));};exports[_0x1ef8('0x4c')]=function(_0x25364d,_0x103a91){return db[_0x1ef8('0x2c')][_0x1ef8('0x4c')]()['then'](respondWithResult(_0x103a91,null))[_0x1ef8('0x45')](handleError(_0x103a91,null));};exports[_0x1ef8('0x4d')]=function(_0x2d728e,_0x2daed1){if(_0x2d728e['body']['uniqueid']){delete _0x2d728e[_0x1ef8('0x4a')][_0x1ef8('0x4e')];}return db[_0x1ef8('0x2c')][_0x1ef8('0x4b')]({'where':{'uniqueid':_0x2d728e[_0x1ef8('0x46')]['id'],'UserId':{'$or':[null,_0x2d728e['user']['id']]}}})[_0x1ef8('0x23')](handleEntityNotFound(_0x2daed1,null))[_0x1ef8('0x23')](saveUpdates(_0x2d728e[_0x1ef8('0x4a')],null))[_0x1ef8('0x23')](respondWithResult(_0x2daed1,null))[_0x1ef8('0x45')](handleError(_0x2daed1,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index be78038..8ab12f0 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 _0x34bc=['VoiceCallReport','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5c1e0b,_0x2275de){var _0x3b8d21=function(_0x3b78ed){while(--_0x3b78ed){_0x5c1e0b['push'](_0x5c1e0b['shift']());}};_0x3b8d21(++_0x2275de);}(_0x34bc,0xf2));var _0xc34b=function(_0xd91819,_0x55f238){_0xd91819=_0xd91819-0x0;var _0x4d97dd=_0x34bc[_0xd91819];return _0x4d97dd;};'use strict';var _=require(_0xc34b('0x0'));var util=require(_0xc34b('0x1'));var logger=require('../../config/logger')(_0xc34b('0x2'));var moment=require(_0xc34b('0x3'));var BPromise=require(_0xc34b('0x4'));var rp=require(_0xc34b('0x5'));var fs=require('fs');var path=require(_0xc34b('0x6'));var rimraf=require(_0xc34b('0x7'));var config=require(_0xc34b('0x8'));var attributes=require('./voiceCallReport.attributes');module[_0xc34b('0x9')]=function(_0x3327fe,_0x54ad1e){return _0x3327fe['define'](_0xc34b('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xc34b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8068=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger'];(function(_0x55c260,_0x4d0d2b){var _0x1fb051=function(_0x1c4401){while(--_0x1c4401){_0x55c260['push'](_0x55c260['shift']());}};_0x1fb051(++_0x4d0d2b);}(_0x8068,0xec));var _0x8806=function(_0x3713e2,_0x381fd6){_0x3713e2=_0x3713e2-0x0;var _0x4e81d8=_0x8068[_0x3713e2];return _0x4e81d8;};'use strict';var _=require(_0x8806('0x0'));var util=require('util');var logger=require(_0x8806('0x1'))(_0x8806('0x2'));var moment=require(_0x8806('0x3'));var BPromise=require(_0x8806('0x4'));var rp=require(_0x8806('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8806('0x6'));var config=require(_0x8806('0x7'));var attributes=require(_0x8806('0x8'));module[_0x8806('0x9')]=function(_0x2fe87e,_0xa58a44){return _0x2fe87e[_0x8806('0xa')](_0x8806('0xb'),attributes,{'tableName':_0x8806('0xc'),'paranoid':![],'indexes':[{'fields':[_0x8806('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 583eb53..e8da9d9 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 _0x46e8=['create','update','where','limit','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','include','map','model','attributes','CreateVoiceCallReport'];(function(_0x22a6cc,_0x2757f0){var _0x3cffd4=function(_0x5e2fb2){while(--_0x5e2fb2){_0x22a6cc['push'](_0x22a6cc['shift']());}};_0x3cffd4(++_0x2757f0);}(_0x46e8,0x1e6));var _0x846e=function(_0x388d87,_0x359e2c){_0x388d87=_0x388d87-0x0;var _0x3df601=_0x46e8[_0x388d87];return _0x3df601;};'use strict';var _=require(_0x846e('0x0'));var util=require(_0x846e('0x1'));var moment=require(_0x846e('0x2'));var BPromise=require(_0x846e('0x3'));var rs=require(_0x846e('0x4'));var fs=require('fs');var Redis=require(_0x846e('0x5'));var db=require(_0x846e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x846e('0x7'))('rpc');var config=require(_0x846e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x846e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a7ae5,_0x483600,_0x601555){return new BPromise(function(_0x4c0b78,_0x3f40a4){return client[_0x846e('0xa')](_0x3a7ae5,_0x601555)[_0x846e('0xb')](function(_0x4cdfaf){logger[_0x846e('0xc')](_0x846e('0xd'),_0x483600,_0x846e('0xe'));logger[_0x846e('0xf')](_0x846e('0x10'),_0x483600,_0x846e('0xe'),JSON[_0x846e('0x11')](_0x4cdfaf));if(_0x4cdfaf[_0x846e('0x12')]){if(_0x4cdfaf[_0x846e('0x12')][_0x846e('0x13')]===0x1f4){logger[_0x846e('0x12')](_0x846e('0xd'),_0x483600,_0x4cdfaf[_0x846e('0x12')][_0x846e('0x14')]);return _0x3f40a4(_0x4cdfaf[_0x846e('0x12')][_0x846e('0x14')]);}logger[_0x846e('0x12')](_0x846e('0xd'),_0x483600,_0x4cdfaf['error']['message']);return _0x4c0b78(_0x4cdfaf['error']['message']);}else{logger[_0x846e('0xc')](_0x846e('0xd'),_0x483600,_0x846e('0xe'));_0x4c0b78(_0x4cdfaf[_0x846e('0x15')]['message']);}})[_0x846e('0x16')](function(_0x29b770){logger[_0x846e('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x483600,_0x29b770);_0x3f40a4(_0x29b770);});});}exports[_0x846e('0x17')]=function(_0x26a71b){var _0x18a0dc=this;return new Promise(function(_0x210c52,_0x5bba2c){return db[_0x846e('0x18')]['findAll']({'raw':_0x26a71b[_0x846e('0x19')]?_0x26a71b[_0x846e('0x19')][_0x846e('0x1a')]===undefined?!![]:![]:!![],'where':_0x26a71b[_0x846e('0x19')]?_0x26a71b['options']['where']||null:null,'attributes':_0x26a71b[_0x846e('0x19')]?_0x26a71b['options']['attributes']||null:null,'limit':_0x26a71b[_0x846e('0x19')]?_0x26a71b[_0x846e('0x19')]['limit']||null:null,'include':_0x26a71b[_0x846e('0x19')]?_0x26a71b[_0x846e('0x19')][_0x846e('0x1b')]?_[_0x846e('0x1c')](_0x26a71b['options']['include'],function(_0x31145e){return{'model':db[_0x31145e[_0x846e('0x1d')]],'as':_0x31145e['as'],'attributes':_0x31145e['attributes'],'include':_0x31145e['include']?_['map'](_0x31145e['include'],function(_0x328ef5){return{'model':db[_0x328ef5[_0x846e('0x1d')]],'as':_0x328ef5['as'],'attributes':_0x328ef5[_0x846e('0x1e')],'include':_0x328ef5[_0x846e('0x1b')]?_[_0x846e('0x1c')](_0x328ef5[_0x846e('0x1b')],function(_0x1b6d00){return{'model':db[_0x1b6d00['model']],'as':_0x1b6d00['as'],'attributes':_0x1b6d00[_0x846e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x846e('0xb')](function(_0x24f5c3){logger[_0x846e('0xc')](_0x846e('0x17'),_0x26a71b);logger[_0x846e('0xf')](_0x846e('0x17'),_0x26a71b,JSON[_0x846e('0x11')](_0x24f5c3));_0x210c52(_0x24f5c3);})[_0x846e('0x16')](function(_0x1c682f){logger[_0x846e('0x12')]('GetVoiceCallReport',_0x1c682f['message'],_0x26a71b);_0x5bba2c(_0x18a0dc[_0x846e('0x12')](0x1f4,_0x1c682f[_0x846e('0x14')]));});});};exports[_0x846e('0x1f')]=function(_0x247eb8){var _0x51795e=this;return new Promise(function(_0x52a879,_0x4bc8c9){return db[_0x846e('0x18')][_0x846e('0x20')](_0x247eb8['body'],{'raw':_0x247eb8[_0x846e('0x19')]?_0x247eb8['options'][_0x846e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x2a0535){logger[_0x846e('0xc')](_0x846e('0x1f'),_0x247eb8);logger[_0x846e('0xf')](_0x846e('0x1f'),_0x247eb8,JSON[_0x846e('0x11')](_0x2a0535));_0x52a879(_0x2a0535);})['catch'](function(_0x354a0e){logger[_0x846e('0x12')](_0x846e('0x1f'),_0x354a0e[_0x846e('0x14')],_0x247eb8);_0x4bc8c9(_0x51795e['error'](0x1f4,_0x354a0e[_0x846e('0x14')]));});});};exports['UpdateVoiceCallReport']=function(_0x271016){var _0x441ad2=this;return new Promise(function(_0x349b3b,_0x310ceb){return db[_0x846e('0x18')][_0x846e('0x21')](_0x271016['body'],{'raw':_0x271016[_0x846e('0x19')]?_0x271016['options'][_0x846e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x271016[_0x846e('0x19')]?_0x271016[_0x846e('0x19')][_0x846e('0x22')]||null:null,'attributes':_0x271016[_0x846e('0x19')]?_0x271016[_0x846e('0x19')][_0x846e('0x1e')]||null:null,'limit':_0x271016[_0x846e('0x19')]?_0x271016[_0x846e('0x19')][_0x846e('0x23')]||null:null})['then'](function(_0x1fc604){logger[_0x846e('0xc')]('UpdateVoiceCallReport',_0x271016);logger[_0x846e('0xf')](_0x846e('0x24'),_0x271016,JSON[_0x846e('0x11')](_0x1fc604));_0x349b3b(_0x1fc604);})[_0x846e('0x16')](function(_0x53ab46){logger[_0x846e('0x12')](_0x846e('0x24'),_0x53ab46[_0x846e('0x14')],_0x271016);_0x310ceb(_0x441ad2['error'](0x1f4,_0x53ab46[_0x846e('0x14')]));});});}; \ No newline at end of file +var _0x710d=['VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','GetVoiceCallReport','VoiceCallReport','findAll','options','attributes','include','map','model','then','CreateVoiceCallReport','create','body','raw','catch','update','where','limit','UpdateVoiceCallReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x710d,0x192));var _0xd710=function(_0x3ec122,_0x55150a){_0x3ec122=_0x3ec122-0x0;var _0x4ecf41=_0x710d[_0x3ec122];return _0x4ecf41;};'use strict';var _=require(_0xd710('0x0'));var util=require(_0xd710('0x1'));var moment=require(_0xd710('0x2'));var BPromise=require('bluebird');var rs=require(_0xd710('0x3'));var fs=require('fs');var Redis=require(_0xd710('0x4'));var db=require(_0xd710('0x5'))['db'];var utils=require(_0xd710('0x6'));var logger=require(_0xd710('0x7'))(_0xd710('0x8'));var config=require('../../config/environment');var jayson=require(_0xd710('0x9'));var client=jayson['client'][_0xd710('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5854a2,_0x40b47e,_0x1149e6){return new BPromise(function(_0x210f65,_0x466206){return client[_0xd710('0xb')](_0x5854a2,_0x1149e6)['then'](function(_0x2bda9e){logger[_0xd710('0xc')](_0xd710('0xd'),_0x40b47e,_0xd710('0xe'));logger[_0xd710('0xf')](_0xd710('0x10'),_0x40b47e,_0xd710('0xe'),JSON[_0xd710('0x11')](_0x2bda9e));if(_0x2bda9e[_0xd710('0x12')]){if(_0x2bda9e[_0xd710('0x12')]['code']===0x1f4){logger[_0xd710('0x12')](_0xd710('0xd'),_0x40b47e,_0x2bda9e[_0xd710('0x12')][_0xd710('0x13')]);return _0x466206(_0x2bda9e[_0xd710('0x12')][_0xd710('0x13')]);}logger['error'](_0xd710('0xd'),_0x40b47e,_0x2bda9e[_0xd710('0x12')][_0xd710('0x13')]);return _0x210f65(_0x2bda9e['error']['message']);}else{logger[_0xd710('0xc')](_0xd710('0xd'),_0x40b47e,_0xd710('0xe'));_0x210f65(_0x2bda9e['result'][_0xd710('0x13')]);}})['catch'](function(_0x20d977){logger[_0xd710('0x12')](_0xd710('0xd'),_0x40b47e,_0x20d977);_0x466206(_0x20d977);});});}exports[_0xd710('0x14')]=function(_0x3a5c5f){var _0x4a1f39=this;return new Promise(function(_0x29ab5e,_0x2f6e02){return db[_0xd710('0x15')][_0xd710('0x16')]({'raw':_0x3a5c5f[_0xd710('0x17')]?_0x3a5c5f[_0xd710('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3a5c5f[_0xd710('0x17')]?_0x3a5c5f['options']['where']||null:null,'attributes':_0x3a5c5f[_0xd710('0x17')]?_0x3a5c5f['options'][_0xd710('0x18')]||null:null,'limit':_0x3a5c5f[_0xd710('0x17')]?_0x3a5c5f[_0xd710('0x17')]['limit']||null:null,'include':_0x3a5c5f['options']?_0x3a5c5f['options'][_0xd710('0x19')]?_[_0xd710('0x1a')](_0x3a5c5f[_0xd710('0x17')][_0xd710('0x19')],function(_0x5b7079){return{'model':db[_0x5b7079[_0xd710('0x1b')]],'as':_0x5b7079['as'],'attributes':_0x5b7079[_0xd710('0x18')],'include':_0x5b7079[_0xd710('0x19')]?_['map'](_0x5b7079['include'],function(_0x3b494d){return{'model':db[_0x3b494d[_0xd710('0x1b')]],'as':_0x3b494d['as'],'attributes':_0x3b494d['attributes'],'include':_0x3b494d[_0xd710('0x19')]?_[_0xd710('0x1a')](_0x3b494d['include'],function(_0x1d2672){return{'model':db[_0x1d2672['model']],'as':_0x1d2672['as'],'attributes':_0x1d2672[_0xd710('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd710('0x1c')](function(_0x1e7ff4){logger[_0xd710('0xc')]('GetVoiceCallReport',_0x3a5c5f);logger[_0xd710('0xf')](_0xd710('0x14'),_0x3a5c5f,JSON[_0xd710('0x11')](_0x1e7ff4));_0x29ab5e(_0x1e7ff4);})['catch'](function(_0x97e6f7){logger[_0xd710('0x12')]('GetVoiceCallReport',_0x97e6f7[_0xd710('0x13')],_0x3a5c5f);_0x2f6e02(_0x4a1f39[_0xd710('0x12')](0x1f4,_0x97e6f7[_0xd710('0x13')]));});});};exports[_0xd710('0x1d')]=function(_0x468181){var _0x5f4b94=this;return new Promise(function(_0x5127fa,_0x5723da){return db[_0xd710('0x15')][_0xd710('0x1e')](_0x468181[_0xd710('0x1f')],{'raw':_0x468181[_0xd710('0x17')]?_0x468181[_0xd710('0x17')][_0xd710('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2253ee){logger['info'](_0xd710('0x1d'),_0x468181);logger[_0xd710('0xf')]('CreateVoiceCallReport',_0x468181,JSON[_0xd710('0x11')](_0x2253ee));_0x5127fa(_0x2253ee);})[_0xd710('0x21')](function(_0x571522){logger[_0xd710('0x12')]('CreateVoiceCallReport',_0x571522[_0xd710('0x13')],_0x468181);_0x5723da(_0x5f4b94['error'](0x1f4,_0x571522[_0xd710('0x13')]));});});};exports['UpdateVoiceCallReport']=function(_0x20e747){var _0x3db3c1=this;return new Promise(function(_0x1a57b4,_0x295dd4){return db['VoiceCallReport'][_0xd710('0x22')](_0x20e747['body'],{'raw':_0x20e747[_0xd710('0x17')]?_0x20e747[_0xd710('0x17')][_0xd710('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20e747[_0xd710('0x17')]?_0x20e747[_0xd710('0x17')][_0xd710('0x23')]||null:null,'attributes':_0x20e747[_0xd710('0x17')]?_0x20e747[_0xd710('0x17')]['attributes']||null:null,'limit':_0x20e747['options']?_0x20e747['options'][_0xd710('0x24')]||null:null})[_0xd710('0x1c')](function(_0x263eab){logger[_0xd710('0xc')](_0xd710('0x25'),_0x20e747);logger[_0xd710('0xf')]('UpdateVoiceCallReport',_0x20e747,JSON[_0xd710('0x11')](_0x263eab));_0x1a57b4(_0x263eab);})[_0xd710('0x21')](function(_0xe11851){logger[_0xd710('0x12')]('UpdateVoiceCallReport',_0xe11851[_0xd710('0x13')],_0x20e747);_0x295dd4(_0x3db3c1[_0xd710('0x12')](0x1f4,_0xe11851[_0xd710('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 9489329..7b1d560 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 _0x7485=['delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','get','/:id','show','put','update'];(function(_0x13b755,_0x5c5422){var _0x1b156d=function(_0x254a70){while(--_0x254a70){_0x13b755['push'](_0x13b755['shift']());}};_0x1b156d(++_0x5c5422);}(_0x7485,0x135));var _0x5748=function(_0x595931,_0x207783){_0x595931=_0x595931-0x0;var _0x271823=_0x7485[_0x595931];return _0x271823;};'use strict';var multer=require(_0x5748('0x0'));var util=require(_0x5748('0x1'));var path=require('path');var timeout=require(_0x5748('0x2'));var express=require(_0x5748('0x3'));var router=express['Router']();var auth=require(_0x5748('0x4'));var interaction=require(_0x5748('0x5'));var config=require(_0x5748('0x6'));var controller=require(_0x5748('0x7'));router['get']('/',auth[_0x5748('0x8')](),controller[_0x5748('0x9')]);router[_0x5748('0xa')](_0x5748('0xb'),auth[_0x5748('0x8')](),controller[_0x5748('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5748('0xd')](_0x5748('0xb'),auth[_0x5748('0x8')](),controller[_0x5748('0xe')]);router[_0x5748('0xf')](_0x5748('0xb'),auth['isAuthenticated'](),controller[_0x5748('0x10')]);module[_0x5748('0x11')]=router; \ No newline at end of file +var _0x954a=['/:id','show','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','index'];(function(_0x3e21b8,_0x399323){var _0xf0aa0b=function(_0x166de0){while(--_0x166de0){_0x3e21b8['push'](_0x3e21b8['shift']());}};_0xf0aa0b(++_0x399323);}(_0x954a,0x66));var _0xa954=function(_0x23734c,_0x422b2b){_0x23734c=_0x23734c-0x0;var _0x16f2c9=_0x954a[_0x23734c];return _0x16f2c9;};'use strict';var multer=require(_0xa954('0x0'));var util=require('util');var path=require(_0xa954('0x1'));var timeout=require(_0xa954('0x2'));var express=require(_0xa954('0x3'));var router=express[_0xa954('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa954('0x5'));var config=require('../../config/environment');var controller=require(_0xa954('0x6'));router[_0xa954('0x7')]('/',auth[_0xa954('0x8')](),controller[_0xa954('0x9')]);router['get'](_0xa954('0xa'),auth['isAuthenticated'](),controller[_0xa954('0xb')]);router['post']('/',auth[_0xa954('0x8')](),controller[_0xa954('0xc')]);router['put']('/:id',auth[_0xa954('0x8')](),controller['update']);router[_0xa954('0xd')]('/:id',auth[_0xa954('0x8')](),controller[_0xa954('0xe')]);module[_0xa954('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index da863e2..2b599ce 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 _0x3a79=['sequelize','exports','STRING','name','setDataValue','options','getDataValue','split','BOOLEAN'];(function(_0x5c8718,_0x29f8ed){var _0x3c6053=function(_0x56b98b){while(--_0x56b98b){_0x5c8718['push'](_0x5c8718['shift']());}};_0x3c6053(++_0x29f8ed);}(_0x3a79,0x10e));var _0x93a7=function(_0x4f753d,_0x5be242){_0x4f753d=_0x4f753d-0x0;var _0x59028b=_0x3a79[_0x4f753d];return _0x59028b;};'use strict';var Sequelize=require(_0x93a7('0x0'));module[_0x93a7('0x1')]={'name':{'type':Sequelize[_0x93a7('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x93a7('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x93a7('0x2')],'set':function(_0x56c951){this[_0x93a7('0x4')](_0x93a7('0x5'),_0x56c951?_0x56c951['join'](''):[]);},'get':function(){return this['getDataValue'](_0x93a7('0x5'))?this[_0x93a7('0x6')](_0x93a7('0x5'))[_0x93a7('0x7')](''):[];}},'auth':{'type':Sequelize[_0x93a7('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x93a7('0x2')]},'record':{'type':Sequelize[_0x93a7('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x93a7('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf80b=['sequelize','exports','STRING','name','setDataValue','options','getDataValue','split','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf80b,0x1e6));var _0xbf80=function(_0xfaa352,_0x1317c7){_0xfaa352=_0xfaa352-0x0;var _0x3fdd61=_0xf80b[_0xfaa352];return _0x3fdd61;};'use strict';var Sequelize=require(_0xbf80('0x0'));module[_0xbf80('0x1')]={'name':{'type':Sequelize[_0xbf80('0x2')]},'prefix':{'type':Sequelize[_0xbf80('0x2')],'unique':_0xbf80('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xbf80('0x2')],'set':function(_0x485f5a){this[_0xbf80('0x4')](_0xbf80('0x5'),_0x485f5a?_0x485f5a['join'](''):[]);},'get':function(){return this[_0xbf80('0x6')](_0xbf80('0x5'))?this[_0xbf80('0x6')](_0xbf80('0x5'))[_0xbf80('0x7')](''):[];}},'auth':{'type':Sequelize[_0xbf80('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xbf80('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xbf80('0x2')]},'description':{'type':Sequelize[_0xbf80('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index e914dd4..7b2009d 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 _0xcd33=['intersection','model','fields','query','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','error','stack','send','index','VoiceChanSpy','rawAttributes','fieldName','key','map','name','filters'];(function(_0x25c5a4,_0x197e26){var _0x328184=function(_0x394c56){while(--_0x394c56){_0x25c5a4['push'](_0x25c5a4['shift']());}};_0x328184(++_0x197e26);}(_0xcd33,0x15e));var _0x3cd3=function(_0x1a77d7,_0x3e6907){_0x1a77d7=_0x1a77d7-0x0;var _0x223687=_0xcd33[_0x1a77d7];return _0x223687;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3cd3('0x0'));var rimraf=require(_0x3cd3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3cd3('0x2'));var rp=require(_0x3cd3('0x3'));var moment=require(_0x3cd3('0x4'));var BPromise=require(_0x3cd3('0x5'));var Mustache=require(_0x3cd3('0x6'));var util=require('util');var path=require(_0x3cd3('0x7'));var sox=require('sox');var csv=require(_0x3cd3('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3cd3('0x9'));var toCsv=require(_0x3cd3('0x8'));var querystring=require(_0x3cd3('0xa'));var Papa=require(_0x3cd3('0xb'));var Redis=require(_0x3cd3('0xc'));var authService=require(_0x3cd3('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3cd3('0xe'));var logger=require(_0x3cd3('0xf'))(_0x3cd3('0x10'));var utils=require(_0x3cd3('0x11'));var config=require('../../config/environment');var db=require(_0x3cd3('0x12'))['db'];function respondWithStatusCode(_0x25791c,_0x4b0870){_0x4b0870=_0x4b0870||0xcc;return function(_0x2a4845){if(_0x2a4845){return _0x25791c[_0x3cd3('0x13')](_0x4b0870);}return _0x25791c[_0x3cd3('0x14')](_0x4b0870)[_0x3cd3('0x15')]();};}function respondWithResult(_0x5af6bf,_0x48c5f8){_0x48c5f8=_0x48c5f8||0xc8;return function(_0x375c68){if(_0x375c68){return _0x5af6bf[_0x3cd3('0x14')](_0x48c5f8)[_0x3cd3('0x16')](_0x375c68);}};}function respondWithFilteredResult(_0x26e7fe,_0x20481a){return function(_0x47572b){if(_0x47572b){var _0x1496a1=_0x47572b[_0x3cd3('0x17')],_0x4fa735=_0x20481a[_0x3cd3('0x18')],_0xaecc31=_0x20481a[_0x3cd3('0x18')]+_0x20481a[_0x3cd3('0x19')],_0x21b7aa;if(_0xaecc31>=_0x1496a1){_0xaecc31=_0x1496a1;_0x21b7aa=0xc8;}else{_0x21b7aa=0xce;}_0x26e7fe[_0x3cd3('0x14')](_0x21b7aa);return _0x26e7fe[_0x3cd3('0x1a')](_0x3cd3('0x1b'),_0x4fa735+'-'+_0xaecc31+'/'+_0x1496a1)[_0x3cd3('0x16')](_0x47572b);}return null;};}function patchUpdates(_0xb35451){return function(_0x28b8d1){try{jsonpatch[_0x3cd3('0x1c')](_0x28b8d1,_0xb35451,!![]);}catch(_0x17ed19){return BPromise['reject'](_0x17ed19);}return _0x28b8d1[_0x3cd3('0x1d')]();};}function saveUpdates(_0x2c1d27,_0x5bb1f4){return function(_0x5f0409){if(_0x5f0409){return _0x5f0409[_0x3cd3('0x1e')](_0x2c1d27)[_0x3cd3('0x1f')](function(_0x1013f7){return _0x1013f7;});}return null;};}function removeEntity(_0x4846f8,_0x50187a){return function(_0x56d052){if(_0x56d052){return _0x56d052[_0x3cd3('0x20')]()[_0x3cd3('0x1f')](function(){var _0x260494=_0x56d052['get']({'plain':!![]});var _0x3a1b4c='ChanSpies';return db[_0x3cd3('0x21')][_0x3cd3('0x20')]({'where':{'type':_0x3a1b4c,'resourceId':_0x260494['id']}})[_0x3cd3('0x1f')](function(){return _0x56d052;});})[_0x3cd3('0x1f')](function(){_0x4846f8[_0x3cd3('0x14')](0xcc)[_0x3cd3('0x15')]();});}};}function handleEntityNotFound(_0x290d65,_0x406379){return function(_0x3e6855){if(!_0x3e6855){_0x290d65['sendStatus'](0x194);}return _0x3e6855;};}function handleError(_0x5d36b3,_0x328351){_0x328351=_0x328351||0x1f4;return function(_0x398026){logger[_0x3cd3('0x22')](_0x398026[_0x3cd3('0x23')]);if(_0x398026['name']){delete _0x398026['name'];}_0x5d36b3['status'](_0x328351)[_0x3cd3('0x24')](_0x398026);};}exports[_0x3cd3('0x25')]=function(_0x2453ed,_0x4dd940){var _0x43ffcc={},_0x30a7a7={},_0x3e789e={'count':0x0,'rows':[]};var _0x20d75e=_['map'](db[_0x3cd3('0x26')][_0x3cd3('0x27')],function(_0x465e29){return{'name':_0x465e29[_0x3cd3('0x28')],'type':_0x465e29['type'][_0x3cd3('0x29')]};});_0x30a7a7['model']=_[_0x3cd3('0x2a')](_0x20d75e,_0x3cd3('0x2b'));_0x30a7a7['query']=_['keys'](_0x2453ed['query']);_0x30a7a7[_0x3cd3('0x2c')]=_[_0x3cd3('0x2d')](_0x30a7a7[_0x3cd3('0x2e')],_0x30a7a7['query']);_0x43ffcc['attributes']=_[_0x3cd3('0x2d')](_0x30a7a7[_0x3cd3('0x2e')],qs[_0x3cd3('0x2f')](_0x2453ed[_0x3cd3('0x30')][_0x3cd3('0x2f')]));_0x43ffcc[_0x3cd3('0x31')]=_0x43ffcc[_0x3cd3('0x31')]['length']?_0x43ffcc[_0x3cd3('0x31')]:_0x30a7a7[_0x3cd3('0x2e')];if(!_0x2453ed[_0x3cd3('0x30')][_0x3cd3('0x32')](_0x3cd3('0x33'))){_0x43ffcc[_0x3cd3('0x19')]=qs[_0x3cd3('0x19')](_0x2453ed[_0x3cd3('0x30')][_0x3cd3('0x19')]);_0x43ffcc['offset']=qs[_0x3cd3('0x18')](_0x2453ed[_0x3cd3('0x30')][_0x3cd3('0x18')]);}_0x43ffcc[_0x3cd3('0x34')]=qs[_0x3cd3('0x35')](_0x2453ed['query'][_0x3cd3('0x35')]);_0x43ffcc[_0x3cd3('0x36')]=qs[_0x3cd3('0x2c')](_[_0x3cd3('0x37')](_0x2453ed[_0x3cd3('0x30')],_0x30a7a7[_0x3cd3('0x2c')]));if(_0x2453ed[_0x3cd3('0x30')]['filter']){_0x43ffcc[_0x3cd3('0x36')]=_[_0x3cd3('0x38')](_0x43ffcc[_0x3cd3('0x36')],{'$or':_['map'](_0x20d75e,function(_0x5c2556){if(_0x5c2556['type']!=='VIRTUAL'){var _0x304d23={};_0x304d23[_0x5c2556[_0x3cd3('0x2b')]]={'$like':'%'+_0x2453ed[_0x3cd3('0x30')][_0x3cd3('0x39')]+'%'};return _0x304d23;}})});}_0x43ffcc=_[_0x3cd3('0x38')]({},_0x43ffcc,_0x2453ed[_0x3cd3('0x3a')]);var _0x2ceba3={'where':_0x43ffcc['where']};return db[_0x3cd3('0x26')][_0x3cd3('0x17')](_0x2ceba3)[_0x3cd3('0x1f')](function(_0x1accbb){_0x3e789e['count']=_0x1accbb;if(_0x2453ed['query'][_0x3cd3('0x3b')]){_0x43ffcc[_0x3cd3('0x3c')]=[{'all':!![]}];}return db[_0x3cd3('0x26')][_0x3cd3('0x3d')](_0x43ffcc);})[_0x3cd3('0x1f')](function(_0x51fbf3){_0x3e789e[_0x3cd3('0x3e')]=_0x51fbf3;return _0x3e789e;})[_0x3cd3('0x1f')](respondWithFilteredResult(_0x4dd940,_0x43ffcc))[_0x3cd3('0x3f')](handleError(_0x4dd940,null));};exports[_0x3cd3('0x40')]=function(_0x191d31,_0x57f494){var _0x30685b={'raw':![],'where':{'id':_0x191d31[_0x3cd3('0x41')]['id']}},_0x46cad2={};_0x46cad2[_0x3cd3('0x2e')]=_['keys'](db[_0x3cd3('0x26')][_0x3cd3('0x27')]);_0x46cad2[_0x3cd3('0x30')]=_[_0x3cd3('0x42')](_0x191d31[_0x3cd3('0x30')]);_0x46cad2['filters']=_['intersection'](_0x46cad2[_0x3cd3('0x2e')],_0x46cad2[_0x3cd3('0x30')]);_0x30685b[_0x3cd3('0x31')]=_['intersection'](_0x46cad2['model'],qs['fields'](_0x191d31[_0x3cd3('0x30')][_0x3cd3('0x2f')]));_0x30685b[_0x3cd3('0x31')]=_0x30685b[_0x3cd3('0x31')][_0x3cd3('0x43')]?_0x30685b[_0x3cd3('0x31')]:_0x46cad2[_0x3cd3('0x2e')];if(_0x191d31['query'][_0x3cd3('0x3b')]){_0x30685b['include']=[{'all':!![]}];}_0x30685b=_['merge']({},_0x30685b,_0x191d31[_0x3cd3('0x3a')]);return db[_0x3cd3('0x26')][_0x3cd3('0x44')](_0x30685b)[_0x3cd3('0x1f')](handleEntityNotFound(_0x57f494,null))[_0x3cd3('0x1f')](respondWithResult(_0x57f494,null))[_0x3cd3('0x3f')](handleError(_0x57f494,null));};exports[_0x3cd3('0x45')]=function(_0x49e81c,_0x40f8fa){return db['VoiceChanSpy'][_0x3cd3('0x45')](_0x49e81c[_0x3cd3('0x46')],{})[_0x3cd3('0x1f')](function(_0xffffbe){var _0x15652e=_0x49e81c[_0x3cd3('0x47')][_0x3cd3('0x48')]({'plain':!![]});if(!_0x15652e)throw new Error(_0x3cd3('0x49'));if(_0x15652e['role']===_0x3cd3('0x47')){var _0x1af5d9=_0xffffbe[_0x3cd3('0x48')]({'plain':!![]});var _0xe0876d=_0x3cd3('0x4a');return db[_0x3cd3('0x4b')][_0x3cd3('0x44')]({'where':{'name':_0xe0876d,'userProfileId':_0x15652e[_0x3cd3('0x4c')]},'raw':!![]})[_0x3cd3('0x1f')](function(_0x104603){if(_0x104603&&_0x104603[_0x3cd3('0x4d')]===0x0){return db[_0x3cd3('0x21')][_0x3cd3('0x45')]({'name':_0x1af5d9[_0x3cd3('0x2b')],'resourceId':_0x1af5d9['id'],'type':_0x104603[_0x3cd3('0x2b')],'sectionId':_0x104603['id']},{})[_0x3cd3('0x1f')](function(){return _0xffffbe;});}else{return _0xffffbe;}})[_0x3cd3('0x3f')](function(_0x4710f9){logger[_0x3cd3('0x22')](_0x3cd3('0x4e'),_0x4710f9);throw _0x4710f9;});}return _0xffffbe;})[_0x3cd3('0x1f')](respondWithResult(_0x40f8fa,0xc9))[_0x3cd3('0x3f')](handleError(_0x40f8fa,null));};exports[_0x3cd3('0x1e')]=function(_0x2fce05,_0x1107c9){if(_0x2fce05[_0x3cd3('0x46')]['id']){delete _0x2fce05[_0x3cd3('0x46')]['id'];}return db[_0x3cd3('0x26')][_0x3cd3('0x44')]({'where':{'id':_0x2fce05[_0x3cd3('0x41')]['id']}})[_0x3cd3('0x1f')](handleEntityNotFound(_0x1107c9,null))['then'](saveUpdates(_0x2fce05[_0x3cd3('0x46')],null))[_0x3cd3('0x1f')](respondWithResult(_0x1107c9,null))[_0x3cd3('0x3f')](handleError(_0x1107c9,null));};exports['destroy']=function(_0x5c78a5,_0x7e3a03){return db[_0x3cd3('0x26')][_0x3cd3('0x44')]({'where':{'id':_0x5c78a5['params']['id']}})[_0x3cd3('0x1f')](handleEntityNotFound(_0x7e3a03,null))[_0x3cd3('0x1f')](removeEntity(_0x7e3a03,null))[_0x3cd3('0x3f')](handleError(_0x7e3a03,null));}; \ No newline at end of file +var _0xc463=['limit','set','json','apply','reject','update','then','destroy','ChanSpies','UserProfileResource','error','stack','send','VoiceChanSpy','rawAttributes','type','key','model','map','name','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset'];(function(_0x16ecad,_0x205047){var _0x313ff7=function(_0x58b16a){while(--_0x58b16a){_0x16ecad['push'](_0x16ecad['shift']());}};_0x313ff7(++_0x205047);}(_0xc463,0x129));var _0x3c46=function(_0x143ca0,_0x586bd3){_0x143ca0=_0x143ca0-0x0;var _0x11f1c5=_0xc463[_0x143ca0];return _0x11f1c5;};'use strict';var pdf=require(_0x3c46('0x0'));var emlformat=require(_0x3c46('0x1'));var rimraf=require(_0x3c46('0x2'));var zipdir=require(_0x3c46('0x3'));var jsonpatch=require(_0x3c46('0x4'));var rp=require(_0x3c46('0x5'));var moment=require(_0x3c46('0x6'));var BPromise=require(_0x3c46('0x7'));var Mustache=require('mustache');var util=require(_0x3c46('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3c46('0x9'));var fs=require('fs');var _=require(_0x3c46('0xa'));var squel=require(_0x3c46('0xb'));var crypto=require(_0x3c46('0xc'));var jsforce=require(_0x3c46('0xd'));var deskjs=require(_0x3c46('0xe'));var toCsv=require(_0x3c46('0xf'));var querystring=require(_0x3c46('0x10'));var Papa=require(_0x3c46('0x11'));var Redis=require(_0x3c46('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3c46('0x13'));var as=require(_0x3c46('0x14'));var hardwareService=require(_0x3c46('0x15'));var logger=require(_0x3c46('0x16'))(_0x3c46('0x17'));var utils=require('../../config/utils');var config=require(_0x3c46('0x18'));var db=require(_0x3c46('0x19'))['db'];function respondWithStatusCode(_0x57dec4,_0x3526f5){_0x3526f5=_0x3526f5||0xcc;return function(_0x5959d0){if(_0x5959d0){return _0x57dec4[_0x3c46('0x1a')](_0x3526f5);}return _0x57dec4[_0x3c46('0x1b')](_0x3526f5)[_0x3c46('0x1c')]();};}function respondWithResult(_0x195eba,_0x22c24e){_0x22c24e=_0x22c24e||0xc8;return function(_0x2965c7){if(_0x2965c7){return _0x195eba[_0x3c46('0x1b')](_0x22c24e)['json'](_0x2965c7);}};}function respondWithFilteredResult(_0x3d34f1,_0x2ec560){return function(_0x5be5f3){if(_0x5be5f3){var _0x331993=_0x5be5f3[_0x3c46('0x1d')],_0x823e9c=_0x2ec560[_0x3c46('0x1e')],_0x429077=_0x2ec560[_0x3c46('0x1e')]+_0x2ec560[_0x3c46('0x1f')],_0x560dd2;if(_0x429077>=_0x331993){_0x429077=_0x331993;_0x560dd2=0xc8;}else{_0x560dd2=0xce;}_0x3d34f1[_0x3c46('0x1b')](_0x560dd2);return _0x3d34f1[_0x3c46('0x20')]('Content-Range',_0x823e9c+'-'+_0x429077+'/'+_0x331993)[_0x3c46('0x21')](_0x5be5f3);}return null;};}function patchUpdates(_0x2412cf){return function(_0x1dcd48){try{jsonpatch[_0x3c46('0x22')](_0x1dcd48,_0x2412cf,!![]);}catch(_0x43ccaf){return BPromise[_0x3c46('0x23')](_0x43ccaf);}return _0x1dcd48['save']();};}function saveUpdates(_0x4459b,_0x27cd08){return function(_0x12413f){if(_0x12413f){return _0x12413f[_0x3c46('0x24')](_0x4459b)[_0x3c46('0x25')](function(_0x31f3ca){return _0x31f3ca;});}return null;};}function removeEntity(_0xbced8,_0x224705){return function(_0x5930e1){if(_0x5930e1){return _0x5930e1[_0x3c46('0x26')]()['then'](function(){var _0x299af2=_0x5930e1['get']({'plain':!![]});var _0x13e94e=_0x3c46('0x27');return db[_0x3c46('0x28')][_0x3c46('0x26')]({'where':{'type':_0x13e94e,'resourceId':_0x299af2['id']}})['then'](function(){return _0x5930e1;});})[_0x3c46('0x25')](function(){_0xbced8['status'](0xcc)[_0x3c46('0x1c')]();});}};}function handleEntityNotFound(_0x704b9a,_0x48cc45){return function(_0x35003d){if(!_0x35003d){_0x704b9a[_0x3c46('0x1a')](0x194);}return _0x35003d;};}function handleError(_0x59f115,_0x423ef7){_0x423ef7=_0x423ef7||0x1f4;return function(_0x4d7333){logger[_0x3c46('0x29')](_0x4d7333[_0x3c46('0x2a')]);if(_0x4d7333['name']){delete _0x4d7333['name'];}_0x59f115[_0x3c46('0x1b')](_0x423ef7)[_0x3c46('0x2b')](_0x4d7333);};}exports['index']=function(_0x350c09,_0x1207e0){var _0x380f2b={},_0x3a64fb={},_0x45b98e={'count':0x0,'rows':[]};var _0x53defb=_['map'](db[_0x3c46('0x2c')][_0x3c46('0x2d')],function(_0x1c262d){return{'name':_0x1c262d['fieldName'],'type':_0x1c262d[_0x3c46('0x2e')][_0x3c46('0x2f')]};});_0x3a64fb[_0x3c46('0x30')]=_[_0x3c46('0x31')](_0x53defb,_0x3c46('0x32'));_0x3a64fb['query']=_['keys'](_0x350c09[_0x3c46('0x33')]);_0x3a64fb[_0x3c46('0x34')]=_['intersection'](_0x3a64fb[_0x3c46('0x30')],_0x3a64fb['query']);_0x380f2b[_0x3c46('0x35')]=_[_0x3c46('0x36')](_0x3a64fb['model'],qs['fields'](_0x350c09[_0x3c46('0x33')][_0x3c46('0x37')]));_0x380f2b[_0x3c46('0x35')]=_0x380f2b['attributes'][_0x3c46('0x38')]?_0x380f2b[_0x3c46('0x35')]:_0x3a64fb['model'];if(!_0x350c09['query']['hasOwnProperty'](_0x3c46('0x39'))){_0x380f2b['limit']=qs['limit'](_0x350c09[_0x3c46('0x33')][_0x3c46('0x1f')]);_0x380f2b['offset']=qs[_0x3c46('0x1e')](_0x350c09[_0x3c46('0x33')][_0x3c46('0x1e')]);}_0x380f2b[_0x3c46('0x3a')]=qs[_0x3c46('0x3b')](_0x350c09[_0x3c46('0x33')][_0x3c46('0x3b')]);_0x380f2b[_0x3c46('0x3c')]=qs['filters'](_[_0x3c46('0x3d')](_0x350c09[_0x3c46('0x33')],_0x3a64fb[_0x3c46('0x34')]));if(_0x350c09[_0x3c46('0x33')][_0x3c46('0x3e')]){_0x380f2b[_0x3c46('0x3c')]=_[_0x3c46('0x3f')](_0x380f2b[_0x3c46('0x3c')],{'$or':_[_0x3c46('0x31')](_0x53defb,function(_0x331eed){if(_0x331eed[_0x3c46('0x2e')]!=='VIRTUAL'){var _0x42f9f6={};_0x42f9f6[_0x331eed['name']]={'$like':'%'+_0x350c09[_0x3c46('0x33')][_0x3c46('0x3e')]+'%'};return _0x42f9f6;}})});}_0x380f2b=_['merge']({},_0x380f2b,_0x350c09['options']);var _0x222521={'where':_0x380f2b['where']};return db['VoiceChanSpy'][_0x3c46('0x1d')](_0x222521)['then'](function(_0x41cffa){_0x45b98e[_0x3c46('0x1d')]=_0x41cffa;if(_0x350c09['query'][_0x3c46('0x40')]){_0x380f2b[_0x3c46('0x41')]=[{'all':!![]}];}return db[_0x3c46('0x2c')][_0x3c46('0x42')](_0x380f2b);})['then'](function(_0x488435){_0x45b98e[_0x3c46('0x43')]=_0x488435;return _0x45b98e;})[_0x3c46('0x25')](respondWithFilteredResult(_0x1207e0,_0x380f2b))[_0x3c46('0x44')](handleError(_0x1207e0,null));};exports[_0x3c46('0x45')]=function(_0x1631fd,_0x3f9ab3){var _0x39b198={'raw':![],'where':{'id':_0x1631fd[_0x3c46('0x46')]['id']}},_0x448e47={};_0x448e47[_0x3c46('0x30')]=_[_0x3c46('0x47')](db[_0x3c46('0x2c')][_0x3c46('0x2d')]);_0x448e47[_0x3c46('0x33')]=_['keys'](_0x1631fd[_0x3c46('0x33')]);_0x448e47[_0x3c46('0x34')]=_[_0x3c46('0x36')](_0x448e47[_0x3c46('0x30')],_0x448e47[_0x3c46('0x33')]);_0x39b198['attributes']=_['intersection'](_0x448e47['model'],qs[_0x3c46('0x37')](_0x1631fd[_0x3c46('0x33')][_0x3c46('0x37')]));_0x39b198[_0x3c46('0x35')]=_0x39b198[_0x3c46('0x35')]['length']?_0x39b198['attributes']:_0x448e47['model'];if(_0x1631fd['query'][_0x3c46('0x40')]){_0x39b198[_0x3c46('0x41')]=[{'all':!![]}];}_0x39b198=_[_0x3c46('0x3f')]({},_0x39b198,_0x1631fd['options']);return db[_0x3c46('0x2c')]['find'](_0x39b198)[_0x3c46('0x25')](handleEntityNotFound(_0x3f9ab3,null))[_0x3c46('0x25')](respondWithResult(_0x3f9ab3,null))[_0x3c46('0x44')](handleError(_0x3f9ab3,null));};exports['create']=function(_0x995824,_0x1556ec){return db[_0x3c46('0x2c')][_0x3c46('0x48')](_0x995824[_0x3c46('0x49')],{})[_0x3c46('0x25')](function(_0xffa311){var _0x5cdd2b=_0x995824['user']['get']({'plain':!![]});if(!_0x5cdd2b)throw new Error(_0x3c46('0x4a'));if(_0x5cdd2b[_0x3c46('0x4b')]==='user'){var _0x4e8879=_0xffa311[_0x3c46('0x4c')]({'plain':!![]});var _0x40a303=_0x3c46('0x27');return db[_0x3c46('0x4d')][_0x3c46('0x4e')]({'where':{'name':_0x40a303,'userProfileId':_0x5cdd2b[_0x3c46('0x4f')]},'raw':!![]})[_0x3c46('0x25')](function(_0x1122c9){if(_0x1122c9&&_0x1122c9[_0x3c46('0x50')]===0x0){return db[_0x3c46('0x28')][_0x3c46('0x48')]({'name':_0x4e8879[_0x3c46('0x32')],'resourceId':_0x4e8879['id'],'type':_0x1122c9['name'],'sectionId':_0x1122c9['id']},{})['then'](function(){return _0xffa311;});}else{return _0xffa311;}})[_0x3c46('0x44')](function(_0x29e586){logger[_0x3c46('0x29')](_0x3c46('0x51'),_0x29e586);throw _0x29e586;});}return _0xffa311;})['then'](respondWithResult(_0x1556ec,0xc9))[_0x3c46('0x44')](handleError(_0x1556ec,null));};exports[_0x3c46('0x24')]=function(_0xa4d482,_0x2e0cc1){if(_0xa4d482['body']['id']){delete _0xa4d482['body']['id'];}return db[_0x3c46('0x2c')][_0x3c46('0x4e')]({'where':{'id':_0xa4d482[_0x3c46('0x46')]['id']}})['then'](handleEntityNotFound(_0x2e0cc1,null))[_0x3c46('0x25')](saveUpdates(_0xa4d482[_0x3c46('0x49')],null))[_0x3c46('0x25')](respondWithResult(_0x2e0cc1,null))[_0x3c46('0x44')](handleError(_0x2e0cc1,null));};exports[_0x3c46('0x26')]=function(_0x1380c9,_0x266ee2){return db['VoiceChanSpy'][_0x3c46('0x4e')]({'where':{'id':_0x1380c9[_0x3c46('0x46')]['id']}})['then'](handleEntityNotFound(_0x266ee2,null))[_0x3c46('0x25')](removeEntity(_0x266ee2,null))[_0x3c46('0x44')](handleError(_0x266ee2,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 470fee3..51995b4 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 _0xec1d=['name','options','join','length','concat','internal','User','findAll','agent','then','catch','models','define','voice_chanspy','bulkCreate','destroy','VoiceExtension','lodash','context','%s%s','prefix','system','push','format','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','Authenticate','password','merge','SIP/%s,%s'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xec1d,0x17c));var _0xdec1=function(_0x3b0e0c,_0x5e4814){_0x3b0e0c=_0x3b0e0c-0x0;var _0x3efb86=_0xec1d[_0x3b0e0c];return _0x3efb86;};'use strict';var _=require(_0xdec1('0x0'));var util=require('util');var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x1809e4,_0x2b343d,_0x3fde9f){var _0x243488=0x1;var _0x321371=[];var _0x30a9bb={'context':_0x2b343d[_0xdec1('0x1')]||'from-sip','exten':util['format'](_0xdec1('0x2'),_0x1809e4[_0xdec1('0x3')],_0x3fde9f),'type':_0xdec1('0x4'),'isApp':![],'ChanSpyId':_0x1809e4['id'],'UserId':_0x2b343d['id']};_0x321371[_0xdec1('0x5')](_['merge']({'app':'Set','appdata':util[_0xdec1('0x6')]('CDR(type)=%s',_0xdec1('0x7')),'priority':_0x243488++},_0x30a9bb));if(_0x1809e4[_0xdec1('0x8')]){_0x321371[_0xdec1('0x5')](_['merge']({'app':_0xdec1('0x9'),'appdata':util[_0xdec1('0x6')](_0xdec1('0xa'),_0x1809e4[_0xdec1('0xb')]),'priority':_0x243488++},_0x30a9bb));}if(_0x1809e4['auth']){_0x321371[_0xdec1('0x5')](_['merge']({'app':_0xdec1('0xc'),'appdata':_0x1809e4[_0xdec1('0xd')],'priority':_0x243488++},_0x30a9bb));}_0x321371['push'](_[_0xdec1('0xe')]({'app':'ChanSpy','appdata':util[_0xdec1('0x6')](_0xdec1('0xf'),_0x2b343d[_0xdec1('0x10')],_0x1809e4[_0xdec1('0x11')]?_0x1809e4[_0xdec1('0x11')][_0xdec1('0x12')](''):''),'priority':_0x243488++},_0x30a9bb));if(_0x1809e4['record']){_0x321371[_0xdec1('0x5')](_['merge']({'app':'StopMixMonitor','priority':_0x243488++},_0x30a9bb));}return _0x321371;};var getChanSpyApplications=function(_0x4793e1,_0x484f83){var _0x951321=[];for(var _0x167c85=0x0,_0x53587b=0x1;_0x167c85<_0x484f83[_0xdec1('0x13')];_0x167c85++,_0x53587b=0x1){_0x951321=_0x951321[_0xdec1('0x14')](getUserApplications(_0x4793e1,_0x484f83[_0x167c85],_0x484f83[_0x167c85][_0xdec1('0x15')]));if(_0x484f83[_0x167c85][_0xdec1('0x15')]!=_0x484f83[_0x167c85]['name']){_0x951321=_0x951321[_0xdec1('0x14')](getUserApplications(_0x4793e1,_0x484f83[_0x167c85],_0x484f83[_0x167c85][_0xdec1('0x10')]));}}return _0x951321;};var getChanSpyPromise=function(_0x3f10c7,_0x451b24){return new BPromise(function(_0x5e37d2,_0x22fedf){return _0x3f10c7[_0xdec1('0x16')][_0xdec1('0x17')]({'attributes':['id','name','internal'],'where':{'role':_0xdec1('0x18'),'chanspy':!![]},'raw':!![]})[_0xdec1('0x19')](function(_0x44ba78){if(_0x44ba78){return _0x5e37d2(getChanSpyApplications(_0x451b24,_0x44ba78));}return _0x5e37d2([]);})[_0xdec1('0x1a')](function(_0x4ccdc8){_0x22fedf(_0x4ccdc8);});});};module['exports']=function(_0x26a892,_0x43fe46){var _0xcaeeb9=_0x26a892[_0xdec1('0x1b')];return _0x26a892[_0xdec1('0x1c')]('VoiceChanSpy',attributes,{'tableName':_0xdec1('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d8164,_0x40ddf9,_0xb00c8c){return getChanSpyPromise(_0xcaeeb9,_0x2d8164)[_0xdec1('0x19')](function(_0x4d14b7){if(_0x4d14b7&&_0x4d14b7[_0xdec1('0x13')]){return _0xcaeeb9['VoiceExtension'][_0xdec1('0x1e')](_0x4d14b7);}})['then'](function(){_0xb00c8c();})[_0xdec1('0x1a')](function(_0x450231){_0xb00c8c(_0x450231);});},'afterUpdate':function(_0x19f0a8,_0x2acf7d,_0x1ac70b){return _0xcaeeb9['VoiceExtension'][_0xdec1('0x1f')]({'where':{'ChanSpyId':_0x19f0a8['id']}})[_0xdec1('0x19')](function(){return getChanSpyPromise(_0xcaeeb9,_0x19f0a8);})[_0xdec1('0x19')](function(_0x1a1024){if(_0x1a1024&&_0x1a1024[_0xdec1('0x13')]){return _0xcaeeb9['VoiceExtension'][_0xdec1('0x1e')](_0x1a1024);}})['then'](function(){_0x1ac70b();})[_0xdec1('0x1a')](function(_0x5364d7){_0x1ac70b(_0x5364d7);});},'afterDestroy':function(_0x43b17c,_0x215399,_0x49c86c){return _0xcaeeb9[_0xdec1('0x20')][_0xdec1('0x1f')]({'where':{'ChanSpyId':_0x43b17c['id']}})[_0xdec1('0x19')](function(){_0x49c86c();})[_0xdec1('0x1a')](function(_0x5af248){_0x49c86c(_0x5af248);});}}});}; \ No newline at end of file +var _0x544e=['./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','push','merge','Set','CDR(type)=%s','MixMonitor','format','${UNIQUEID}.%s,ab','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','record','StopMixMonitor','length','concat','internal','User','agent','then','catch','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','util','bluebird'];(function(_0x2142f1,_0x1282bb){var _0xf320da=function(_0x18e3c7){while(--_0x18e3c7){_0x2142f1['push'](_0x2142f1['shift']());}};_0xf320da(++_0x1282bb);}(_0x544e,0x101));var _0xe544=function(_0x16ca3a,_0x1d7536){_0x16ca3a=_0x16ca3a-0x0;var _0x920714=_0x544e[_0x16ca3a];return _0x920714;};'use strict';var _=require('lodash');var util=require(_0xe544('0x0'));var BPromise=require(_0xe544('0x1'));var attributes=require(_0xe544('0x2'));var getUserApplications=function(_0x4b6fae,_0x78bff7,_0x198613){var _0x2bd9d8=0x1;var _0x5630b4=[];var _0x58dd3d={'context':_0x78bff7[_0xe544('0x3')]||_0xe544('0x4'),'exten':util['format'](_0xe544('0x5'),_0x4b6fae[_0xe544('0x6')],_0x198613),'type':'system','isApp':![],'ChanSpyId':_0x4b6fae['id'],'UserId':_0x78bff7['id']};_0x5630b4[_0xe544('0x7')](_[_0xe544('0x8')]({'app':_0xe544('0x9'),'appdata':util['format'](_0xe544('0xa'),'chanspy'),'priority':_0x2bd9d8++},_0x58dd3d));if(_0x4b6fae['record']){_0x5630b4[_0xe544('0x7')](_[_0xe544('0x8')]({'app':_0xe544('0xb'),'appdata':util[_0xe544('0xc')](_0xe544('0xd'),_0x4b6fae['recordingFormat']),'priority':_0x2bd9d8++},_0x58dd3d));}if(_0x4b6fae[_0xe544('0xe')]){_0x5630b4[_0xe544('0x7')](_[_0xe544('0x8')]({'app':_0xe544('0xf'),'appdata':_0x4b6fae[_0xe544('0x10')],'priority':_0x2bd9d8++},_0x58dd3d));}_0x5630b4[_0xe544('0x7')](_[_0xe544('0x8')]({'app':_0xe544('0x11'),'appdata':util[_0xe544('0xc')](_0xe544('0x12'),_0x78bff7[_0xe544('0x13')],_0x4b6fae[_0xe544('0x14')]?_0x4b6fae['options']['join'](''):''),'priority':_0x2bd9d8++},_0x58dd3d));if(_0x4b6fae[_0xe544('0x15')]){_0x5630b4[_0xe544('0x7')](_[_0xe544('0x8')]({'app':_0xe544('0x16'),'priority':_0x2bd9d8++},_0x58dd3d));}return _0x5630b4;};var getChanSpyApplications=function(_0x3b3137,_0x1709d7){var _0x50f516=[];for(var _0x5e5b29=0x0,_0x4f9b31=0x1;_0x5e5b29<_0x1709d7[_0xe544('0x17')];_0x5e5b29++,_0x4f9b31=0x1){_0x50f516=_0x50f516[_0xe544('0x18')](getUserApplications(_0x3b3137,_0x1709d7[_0x5e5b29],_0x1709d7[_0x5e5b29][_0xe544('0x19')]));if(_0x1709d7[_0x5e5b29]['internal']!=_0x1709d7[_0x5e5b29][_0xe544('0x13')]){_0x50f516=_0x50f516['concat'](getUserApplications(_0x3b3137,_0x1709d7[_0x5e5b29],_0x1709d7[_0x5e5b29]['name']));}}return _0x50f516;};var getChanSpyPromise=function(_0x4fb241,_0x46d744){return new BPromise(function(_0x17c7ff,_0x287726){return _0x4fb241[_0xe544('0x1a')]['findAll']({'attributes':['id',_0xe544('0x13'),_0xe544('0x19')],'where':{'role':_0xe544('0x1b'),'chanspy':!![]},'raw':!![]})[_0xe544('0x1c')](function(_0x4d662d){if(_0x4d662d){return _0x17c7ff(getChanSpyApplications(_0x46d744,_0x4d662d));}return _0x17c7ff([]);})[_0xe544('0x1d')](function(_0x5327fc){_0x287726(_0x5327fc);});});};module['exports']=function(_0x2df197,_0xa1d36f){var _0x33b1f6=_0x2df197[_0xe544('0x1e')];return _0x2df197[_0xe544('0x1f')](_0xe544('0x20'),attributes,{'tableName':_0xe544('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d0072,_0x1355d2,_0x3c3adc){return getChanSpyPromise(_0x33b1f6,_0x1d0072)[_0xe544('0x1c')](function(_0x526386){if(_0x526386&&_0x526386[_0xe544('0x17')]){return _0x33b1f6[_0xe544('0x22')][_0xe544('0x23')](_0x526386);}})['then'](function(){_0x3c3adc();})[_0xe544('0x1d')](function(_0x38018e){_0x3c3adc(_0x38018e);});},'afterUpdate':function(_0x2084e5,_0xebb95d,_0x190ace){return _0x33b1f6[_0xe544('0x22')][_0xe544('0x24')]({'where':{'ChanSpyId':_0x2084e5['id']}})['then'](function(){return getChanSpyPromise(_0x33b1f6,_0x2084e5);})[_0xe544('0x1c')](function(_0x23ca2a){if(_0x23ca2a&&_0x23ca2a['length']){return _0x33b1f6[_0xe544('0x22')]['bulkCreate'](_0x23ca2a);}})[_0xe544('0x1c')](function(){_0x190ace();})[_0xe544('0x1d')](function(_0x7af339){_0x190ace(_0x7af339);});},'afterDestroy':function(_0x3f7a1a,_0x34ade8,_0x362437){return _0x33b1f6[_0xe544('0x22')][_0xe544('0x24')]({'where':{'ChanSpyId':_0x3f7a1a['id']}})[_0xe544('0x1c')](function(){_0x362437();})['catch'](function(_0x17aaba){_0x362437(_0x17aaba);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index c6f0ab0..f6bfb7b 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 _0x5704=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','randomstring','ioredis'];(function(_0x2fb050,_0x340357){var _0x3e5513=function(_0x1eb98c){while(--_0x1eb98c){_0x2fb050['push'](_0x2fb050['shift']());}};_0x3e5513(++_0x340357);}(_0x5704,0x66));var _0x4570=function(_0x473b87,_0x3fb8d3){_0x473b87=_0x473b87-0x0;var _0x41e241=_0x5704[_0x473b87];return _0x41e241;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4570('0x0'));var rs=require(_0x4570('0x1'));var fs=require('fs');var Redis=require(_0x4570('0x2'));var db=require(_0x4570('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4570('0x4'))(_0x4570('0x5'));var config=require(_0x4570('0x6'));var jayson=require(_0x4570('0x7'));var client=jayson[_0x4570('0x8')][_0x4570('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x213921,_0x5a16fd,_0x40e4d8){return new BPromise(function(_0x49743a,_0x2423e7){return client[_0x4570('0xa')](_0x213921,_0x40e4d8)[_0x4570('0xb')](function(_0x4b1d51){logger[_0x4570('0xc')](_0x4570('0xd'),_0x5a16fd,'request\x20sent');logger[_0x4570('0xe')](_0x4570('0xf'),_0x5a16fd,'request\x20sent',JSON[_0x4570('0x10')](_0x4b1d51));if(_0x4b1d51[_0x4570('0x11')]){if(_0x4b1d51[_0x4570('0x11')][_0x4570('0x12')]===0x1f4){logger[_0x4570('0x11')](_0x4570('0xd'),_0x5a16fd,_0x4b1d51[_0x4570('0x11')]['message']);return _0x2423e7(_0x4b1d51[_0x4570('0x11')]['message']);}logger[_0x4570('0x11')](_0x4570('0xd'),_0x5a16fd,_0x4b1d51[_0x4570('0x11')][_0x4570('0x13')]);return _0x49743a(_0x4b1d51[_0x4570('0x11')][_0x4570('0x13')]);}else{logger['info'](_0x4570('0xd'),_0x5a16fd,'request\x20sent');_0x49743a(_0x4b1d51[_0x4570('0x14')]['message']);}})['catch'](function(_0x33499a){logger[_0x4570('0x11')](_0x4570('0xd'),_0x5a16fd,_0x33499a);_0x2423e7(_0x33499a);});});} \ No newline at end of file +var _0xe041=['message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code'];(function(_0xa2728,_0x328388){var _0x399198=function(_0x3850ee){while(--_0x3850ee){_0xa2728['push'](_0xa2728['shift']());}};_0x399198(++_0x328388);}(_0xe041,0xc0));var _0x1e04=function(_0xcd859e,_0x22066f){_0xcd859e=_0xcd859e-0x0;var _0xc35f64=_0xe041[_0xcd859e];return _0xc35f64;};'use strict';var _=require(_0x1e04('0x0'));var util=require(_0x1e04('0x1'));var moment=require(_0x1e04('0x2'));var BPromise=require('bluebird');var rs=require(_0x1e04('0x3'));var fs=require('fs');var Redis=require(_0x1e04('0x4'));var db=require(_0x1e04('0x5'))['db'];var utils=require(_0x1e04('0x6'));var logger=require(_0x1e04('0x7'))(_0x1e04('0x8'));var config=require(_0x1e04('0x9'));var jayson=require(_0x1e04('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f21d8,_0x53fe7e,_0x293a39){return new BPromise(function(_0x253b37,_0x18ad2b){return client[_0x1e04('0xb')](_0x1f21d8,_0x293a39)[_0x1e04('0xc')](function(_0x2e3a36){logger['info'](_0x1e04('0xd'),_0x53fe7e,_0x1e04('0xe'));logger['debug'](_0x1e04('0xf'),_0x53fe7e,_0x1e04('0xe'),JSON['stringify'](_0x2e3a36));if(_0x2e3a36['error']){if(_0x2e3a36[_0x1e04('0x10')][_0x1e04('0x11')]===0x1f4){logger[_0x1e04('0x10')](_0x1e04('0xd'),_0x53fe7e,_0x2e3a36[_0x1e04('0x10')][_0x1e04('0x12')]);return _0x18ad2b(_0x2e3a36['error']['message']);}logger[_0x1e04('0x10')](_0x1e04('0xd'),_0x53fe7e,_0x2e3a36[_0x1e04('0x10')]['message']);return _0x253b37(_0x2e3a36[_0x1e04('0x10')]['message']);}else{logger[_0x1e04('0x13')](_0x1e04('0xd'),_0x53fe7e,'request\x20sent');_0x253b37(_0x2e3a36[_0x1e04('0x14')]['message']);}})['catch'](function(_0x58cf03){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x53fe7e,_0x58cf03);_0x18ad2b(_0x58cf03);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 4a185b4..d281de1 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 _0xce51=['../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','show','post','/:id','delete','exports','util','connect-timeout','express','Router'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xce51,0x1ae));var _0x1ce5=function(_0x313df3,_0x4fca45){_0x313df3=_0x313df3-0x0;var _0x241d59=_0xce51[_0x313df3];return _0x241d59;};'use strict';var multer=require('multer');var util=require(_0x1ce5('0x0'));var path=require('path');var timeout=require(_0x1ce5('0x1'));var express=require(_0x1ce5('0x2'));var router=express[_0x1ce5('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1ce5('0x4'));var config=require('../../config/environment');var controller=require(_0x1ce5('0x5'));router[_0x1ce5('0x6')]('/',auth[_0x1ce5('0x7')](),controller[_0x1ce5('0x8')]);router[_0x1ce5('0x6')]('/:id',auth[_0x1ce5('0x7')](),controller[_0x1ce5('0x9')]);router[_0x1ce5('0xa')]('/',auth[_0x1ce5('0x7')](),controller['create']);router['put'](_0x1ce5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1ce5('0xc')](_0x1ce5('0xb'),auth[_0x1ce5('0x7')](),controller['destroy']);module[_0x1ce5('0xd')]=router; \ No newline at end of file +var _0x8002=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','get','/:id','show','post','create','put','delete','destroy','multer','util'];(function(_0x4ac515,_0x4e1320){var _0x4734dc=function(_0x3d005a){while(--_0x3d005a){_0x4ac515['push'](_0x4ac515['shift']());}};_0x4734dc(++_0x4e1320);}(_0x8002,0x167));var _0x2800=function(_0x13c189,_0xf17e99){_0x13c189=_0x13c189-0x0;var _0x5eda25=_0x8002[_0x13c189];return _0x5eda25;};'use strict';var multer=require(_0x2800('0x0'));var util=require(_0x2800('0x1'));var path=require(_0x2800('0x2'));var timeout=require(_0x2800('0x3'));var express=require(_0x2800('0x4'));var router=express[_0x2800('0x5')]();var auth=require(_0x2800('0x6'));var interaction=require(_0x2800('0x7'));var config=require(_0x2800('0x8'));var controller=require(_0x2800('0x9'));router['get']('/',auth[_0x2800('0xa')](),controller['index']);router[_0x2800('0xb')](_0x2800('0xc'),auth[_0x2800('0xa')](),controller[_0x2800('0xd')]);router[_0x2800('0xe')]('/',auth[_0x2800('0xa')](),controller[_0x2800('0xf')]);router[_0x2800('0x10')](_0x2800('0xc'),auth[_0x2800('0xa')](),controller['update']);router[_0x2800('0x11')](_0x2800('0xc'),auth[_0x2800('0xa')](),controller[_0x2800('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index a4342a7..cce35e3 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(_0x5adc91,_0x12a899){var _0x48c1d2=function(_0x440a5e){while(--_0x440a5e){_0x5adc91['push'](_0x5adc91['shift']());}};_0x48c1d2(++_0x12a899);}(_0xe14b,0x93));var _0xbe14=function(_0x486ecb,_0x263478){_0x486ecb=_0x486ecb-0x0;var _0x4f50ba=_0xe14b[_0x486ecb];return _0x4f50ba;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xbe14('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xbe14('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9957=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x56e5b5,_0x5484cb){var _0x4e1279=function(_0x3e3e5a){while(--_0x3e3e5a){_0x56e5b5['push'](_0x56e5b5['shift']());}};_0x4e1279(++_0x5484cb);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7995('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 8802e26..09cefd3 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 _0x7823=['find','create','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','readFileSync','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','VoiceContext','includeAll','include','findAll','show','filters','length'];(function(_0x537bab,_0x5f06b6){var _0x20c7df=function(_0x5b661f){while(--_0x5b661f){_0x537bab['push'](_0x537bab['shift']());}};_0x20c7df(++_0x5f06b6);}(_0x7823,0x7c));var _0x3782=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7823[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x3782('0x0'));var emlformat=require(_0x3782('0x1'));var rimraf=require(_0x3782('0x2'));var zipdir=require(_0x3782('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3782('0x4'));var BPromise=require(_0x3782('0x5'));var Mustache=require(_0x3782('0x6'));var util=require(_0x3782('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3782('0x8'));var ejs=require(_0x3782('0x9'));var fs=require('fs');var _=require(_0x3782('0xa'));var squel=require(_0x3782('0xb'));var crypto=require(_0x3782('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3782('0xd'));var toCsv=require(_0x3782('0x8'));var querystring=require(_0x3782('0xe'));var Papa=require('papaparse');var Redis=require(_0x3782('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3782('0x10'));var as=require(_0x3782('0x11'));var hardwareService=require(_0x3782('0x12'));var logger=require('../../config/logger')(_0x3782('0x13'));var utils=require(_0x3782('0x14'));var config=require(_0x3782('0x15'));var db=require(_0x3782('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x3782('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x35679b,_0x3cf2f8,_0x36006b){if(_0x36006b){var _0xb562d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb562d[_0x3782('0x18')](_0x3cf2f8)){return _0x35679b;}else{throw new db[(_0x3782('0x19'))][(_0x3782('0x1a'))](_0x3782('0x1b'));}}else{return _0x35679b;}}function respondWithRpcPromise(_0x33341e,_0x5c3a7e,_0x18066c,_0x2175dd){return new BPromise(function(_0x923e55,_0xc4419f){var _0x3a0a9b=_0x2175dd||client;return _0x3a0a9b[_0x3782('0x1c')](_0x33341e,_0x18066c)[_0x3782('0x1d')](function(_0x33c3e){logger['info'](_0x3782('0x1e'),_0x5c3a7e,_0x3782('0x1f'));logger[_0x3782('0x20')](_0x3782('0x21'),_0x5c3a7e,_0x3782('0x1f'),JSON['stringify'](_0x33c3e));if(_0x33c3e[_0x3782('0x22')]){if(_0x33c3e[_0x3782('0x22')]['code']===0x1f4){logger['error'](_0x3782('0x1e'),_0x5c3a7e,_0x33c3e[_0x3782('0x22')]['message']);return _0xc4419f(_0x33c3e[_0x3782('0x22')][_0x3782('0x23')]);}logger[_0x3782('0x22')](_0x3782('0x1e'),_0x5c3a7e,_0x33c3e[_0x3782('0x22')][_0x3782('0x23')]);return _0x923e55(_0x33c3e['error'][_0x3782('0x23')]);}else{logger['info'](_0x3782('0x1e'),_0x5c3a7e,_0x3782('0x1f'));_0x923e55(_0x33c3e[_0x3782('0x24')][_0x3782('0x23')]);}})[_0x3782('0x25')](function(_0x1ac3c1){logger['error'](_0x3782('0x1e'),_0x5c3a7e,_0x1ac3c1);_0xc4419f(_0x1ac3c1);});});}function respondWithStatusCode(_0x12aedb,_0x270a75){_0x270a75=_0x270a75||0xcc;return function(_0x1a1442){if(_0x1a1442){return _0x12aedb[_0x3782('0x26')](_0x270a75);}return _0x12aedb[_0x3782('0x27')](_0x270a75)[_0x3782('0x28')]();};}function respondWithResult(_0x3e61ab,_0x52cdbf){_0x52cdbf=_0x52cdbf||0xc8;return function(_0x3f1ff1){if(_0x3f1ff1){return _0x3e61ab[_0x3782('0x27')](_0x52cdbf)[_0x3782('0x29')](_0x3f1ff1);}};}function respondWithFilteredResult(_0x4beafd,_0x38e779){return function(_0x478034){if(_0x478034){var _0x507b8c=_0x478034[_0x3782('0x2a')],_0x46fe41=_0x38e779[_0x3782('0x2b')],_0x38692f=_0x38e779[_0x3782('0x2b')]+_0x38e779[_0x3782('0x2c')],_0xc12cf3;if(_0x38692f>=_0x507b8c){_0x38692f=_0x507b8c;_0xc12cf3=0xc8;}else{_0xc12cf3=0xce;}_0x4beafd['status'](_0xc12cf3);return _0x4beafd[_0x3782('0x2d')]('Content-Range',_0x46fe41+'-'+_0x38692f+'/'+_0x507b8c)[_0x3782('0x29')](_0x478034);}return null;};}function patchUpdates(_0x350810){return function(_0x52db25){try{jsonpatch[_0x3782('0x2e')](_0x52db25,_0x350810,!![]);}catch(_0x4101b3){return BPromise[_0x3782('0x2f')](_0x4101b3);}return _0x52db25[_0x3782('0x30')]();};}function saveUpdates(_0x39162d,_0x649cda){return function(_0x5c90dd){if(_0x5c90dd){return _0x5c90dd[_0x3782('0x31')](_0x39162d)['then'](function(_0x4c184a){return _0x4c184a;});}return null;};}function removeEntity(_0x4d64cf,_0x2f78f1){return function(_0x206b6d){if(_0x206b6d){return _0x206b6d[_0x3782('0x32')]()[_0x3782('0x1d')](function(){var _0x4e55a1=_0x206b6d[_0x3782('0x33')]({'plain':!![]});var _0x5a77be=_0x3782('0x34');return db[_0x3782('0x35')][_0x3782('0x32')]({'where':{'type':_0x5a77be,'resourceId':_0x4e55a1['id']}})[_0x3782('0x1d')](function(){return _0x206b6d;});})[_0x3782('0x1d')](function(){_0x4d64cf[_0x3782('0x27')](0xcc)[_0x3782('0x28')]();});}};}function handleEntityNotFound(_0x34b6bf,_0x504d16){return function(_0x594193){if(!_0x594193){_0x34b6bf[_0x3782('0x26')](0x194);}return _0x594193;};}function handleError(_0x73e4d9,_0x402fe9){_0x402fe9=_0x402fe9||0x1f4;return function(_0x1d0e1a){logger[_0x3782('0x22')](_0x1d0e1a[_0x3782('0x36')]);if(_0x1d0e1a[_0x3782('0x37')]){delete _0x1d0e1a[_0x3782('0x37')];}_0x73e4d9[_0x3782('0x27')](_0x402fe9)[_0x3782('0x38')](_0x1d0e1a);};}exports[_0x3782('0x39')]=function(_0x2066f4,_0x7140ae){var _0x1358aa={},_0x44047e={},_0x25a018={'count':0x0,'rows':[]};var _0x2d8c9f=_['map'](db['VoiceContext'][_0x3782('0x3a')],function(_0x3b376b){return{'name':_0x3b376b[_0x3782('0x3b')],'type':_0x3b376b['type'][_0x3782('0x3c')]};});_0x44047e[_0x3782('0x3d')]=_['map'](_0x2d8c9f,_0x3782('0x37'));_0x44047e[_0x3782('0x3e')]=_[_0x3782('0x3f')](_0x2066f4[_0x3782('0x3e')]);_0x44047e['filters']=_[_0x3782('0x40')](_0x44047e[_0x3782('0x3d')],_0x44047e[_0x3782('0x3e')]);_0x1358aa[_0x3782('0x41')]=_['intersection'](_0x44047e[_0x3782('0x3d')],qs[_0x3782('0x42')](_0x2066f4[_0x3782('0x3e')][_0x3782('0x42')]));_0x1358aa[_0x3782('0x41')]=_0x1358aa[_0x3782('0x41')]['length']?_0x1358aa[_0x3782('0x41')]:_0x44047e[_0x3782('0x3d')];if(!_0x2066f4['query'][_0x3782('0x43')](_0x3782('0x44'))){_0x1358aa[_0x3782('0x2c')]=qs[_0x3782('0x2c')](_0x2066f4[_0x3782('0x3e')][_0x3782('0x2c')]);_0x1358aa['offset']=qs[_0x3782('0x2b')](_0x2066f4[_0x3782('0x3e')][_0x3782('0x2b')]);}_0x1358aa[_0x3782('0x45')]=qs['sort'](_0x2066f4[_0x3782('0x3e')][_0x3782('0x46')]);_0x1358aa[_0x3782('0x47')]=qs['filters'](_['pick'](_0x2066f4[_0x3782('0x3e')],_0x44047e['filters']));if(_0x2066f4['query'][_0x3782('0x48')]){_0x1358aa[_0x3782('0x47')]=_[_0x3782('0x49')](_0x1358aa['where'],{'$or':_['map'](_0x2d8c9f,function(_0x23fa20){if(_0x23fa20[_0x3782('0x4a')]!==_0x3782('0x4b')){var _0x1537e0={};_0x1537e0[_0x23fa20['name']]={'$like':'%'+_0x2066f4['query'][_0x3782('0x48')]+'%'};return _0x1537e0;}})});}_0x1358aa=_[_0x3782('0x49')]({},_0x1358aa,_0x2066f4[_0x3782('0x4c')]);var _0x44dae7={'where':_0x1358aa[_0x3782('0x47')]};return db[_0x3782('0x4d')][_0x3782('0x2a')](_0x44dae7)[_0x3782('0x1d')](function(_0x567623){_0x25a018[_0x3782('0x2a')]=_0x567623;if(_0x2066f4[_0x3782('0x3e')][_0x3782('0x4e')]){_0x1358aa[_0x3782('0x4f')]=[{'all':!![]}];}return db[_0x3782('0x4d')][_0x3782('0x50')](_0x1358aa);})[_0x3782('0x1d')](function(_0x53f4ef){_0x25a018['rows']=_0x53f4ef;return _0x25a018;})[_0x3782('0x1d')](respondWithFilteredResult(_0x7140ae,_0x1358aa))[_0x3782('0x25')](handleError(_0x7140ae,null));};exports[_0x3782('0x51')]=function(_0xf7da6c,_0x170be6){var _0x298a40={'raw':![],'where':{'id':_0xf7da6c['params']['id']}},_0x53a2e5={};_0x53a2e5[_0x3782('0x3d')]=_[_0x3782('0x3f')](db[_0x3782('0x4d')]['rawAttributes']);_0x53a2e5[_0x3782('0x3e')]=_[_0x3782('0x3f')](_0xf7da6c[_0x3782('0x3e')]);_0x53a2e5[_0x3782('0x52')]=_['intersection'](_0x53a2e5[_0x3782('0x3d')],_0x53a2e5[_0x3782('0x3e')]);_0x298a40[_0x3782('0x41')]=_[_0x3782('0x40')](_0x53a2e5[_0x3782('0x3d')],qs[_0x3782('0x42')](_0xf7da6c[_0x3782('0x3e')][_0x3782('0x42')]));_0x298a40[_0x3782('0x41')]=_0x298a40[_0x3782('0x41')][_0x3782('0x53')]?_0x298a40['attributes']:_0x53a2e5[_0x3782('0x3d')];if(_0xf7da6c[_0x3782('0x3e')][_0x3782('0x4e')]){_0x298a40[_0x3782('0x4f')]=[{'all':!![]}];}_0x298a40=_['merge']({},_0x298a40,_0xf7da6c[_0x3782('0x4c')]);return db[_0x3782('0x4d')][_0x3782('0x54')](_0x298a40)['then'](handleEntityNotFound(_0x170be6,null))[_0x3782('0x1d')](respondWithResult(_0x170be6,null))['catch'](handleError(_0x170be6,null));};exports[_0x3782('0x55')]=function(_0x401d8a,_0x598b81,_0x543358){var _0x4adbab;return db[_0x3782('0x4d')]['create'](_0x401d8a['body'],{'raw':!![]})[_0x3782('0x1d')](function(_0x148d3f){_0x4adbab=_0x148d3f;return db['VoiceContext']['findAll']({'raw':!![]});})['then'](function(_0x2e0eb3){var _0x532b48=fs['readFileSync'](path[_0x3782('0x56')](config[_0x3782('0x57')],_0x3782('0x58')),_0x3782('0x59'));var _0x18d738=ejs[_0x3782('0x5a')](_0x532b48,{'contexts':_0x2e0eb3||[]});fs[_0x3782('0x5b')](_0x3782('0x5c'),_0x18d738);})[_0x3782('0x1d')](function(){return respondWithRpcPromise(_0x3782('0x5d'),_0x3782('0x55'),{'module':_0x3782('0x5e')});})[_0x3782('0x1d')](function(){var _0x386415=_0x401d8a['user'][_0x3782('0x33')]({'plain':!![]});if(!_0x386415)throw new Error(_0x3782('0x5f'));if(_0x386415[_0x3782('0x60')]===_0x3782('0x61')){var _0xf56e7f=_0x4adbab[_0x3782('0x33')]({'plain':!![]});return db[_0x3782('0x62')]['find']({'where':{'name':_0x3782('0x34'),'userProfileId':_0x386415[_0x3782('0x63')]},'raw':!![]})[_0x3782('0x1d')](function(_0x27edaf){if(_0x27edaf&&_0x27edaf[_0x3782('0x64')]===0x0){return db[_0x3782('0x35')][_0x3782('0x55')]({'name':_0xf56e7f[_0x3782('0x37')],'resourceId':_0xf56e7f['id'],'type':_0x27edaf[_0x3782('0x37')],'sectionId':_0x27edaf['id']},{})['then'](function(){return _0x4adbab;});}else{return _0x4adbab;}})[_0x3782('0x25')](function(_0x1059b2){logger[_0x3782('0x22')](_0x3782('0x65'),_0x1059b2);throw _0x1059b2;});}return _0x4adbab;})[_0x3782('0x1d')](respondWithResult(_0x598b81,0xc9))[_0x3782('0x25')](handleError(_0x598b81,null));};exports[_0x3782('0x31')]=function(_0x590db7,_0xfc8f3f,_0x59e68e){var _0x5c0557;return db[_0x3782('0x4d')][_0x3782('0x54')]({'where':{'id':_0x590db7['params']['id']}})['then'](handleEntityNotFound(_0xfc8f3f,null))[_0x3782('0x1d')](saveUpdates(_0x590db7['body'],null))['then'](function(_0xe580ef){if(_0xe580ef){_0x5c0557=_0xe580ef;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x3782('0x1d')](function(_0x258390){var _0x9341ed=fs['readFileSync'](path[_0x3782('0x56')](config[_0x3782('0x57')],'server/files/templates/context.ejs'),_0x3782('0x59'));var _0x410e91=ejs['render'](_0x9341ed,{'contexts':_0x258390||[]});fs[_0x3782('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x410e91);})[_0x3782('0x1d')](function(){return respondWithRpcPromise(_0x3782('0x5d'),_0x3782('0x31'),{'module':'chan_sip.so'});})[_0x3782('0x1d')](function(){return _0x5c0557;})[_0x3782('0x1d')](respondWithResult(_0xfc8f3f,null))['catch'](handleError(_0xfc8f3f,null));};exports['destroy']=function(_0x35298e,_0x22c484,_0x47dd5f){var _0x149150;return db[_0x3782('0x4d')][_0x3782('0x54')]({'where':{'id':_0x35298e[_0x3782('0x66')]['id']}})['then'](handleEntityNotFound(_0x22c484,null))[_0x3782('0x1d')](removeEntity(_0x22c484,null))['then'](function(){return db[_0x3782('0x4d')][_0x3782('0x50')]({'raw':!![]});})[_0x3782('0x1d')](function(_0xa76964){var _0x1aabbe=fs[_0x3782('0x67')](path['join'](config[_0x3782('0x57')],_0x3782('0x58')),_0x3782('0x59'));var _0x2ff248=ejs[_0x3782('0x5a')](_0x1aabbe,{'contexts':_0xa76964});fs[_0x3782('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2ff248);return respondWithRpcPromise('Reload',_0x3782('0x32'),{'module':'chan_sip.so'});})[_0x3782('0x25')](handleError(_0x22c484,null));}; \ No newline at end of file +var _0x33b0=['message','info','catch','sendStatus','status','end','json','count','offset','limit','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','keys','VoiceContext','length','find','create','body','findAll','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','readFileSync','writeFileSync','html-pdf','eml-format','rimraf','zip-dir','moment','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error'];(function(_0x1a1570,_0xe13e07){var _0x3e1b0a=function(_0x595f4a){while(--_0x595f4a){_0x1a1570['push'](_0x1a1570['shift']());}};_0x3e1b0a(++_0xe13e07);}(_0x33b0,0x10f));var _0x033b=function(_0x5c3d42,_0x10699a){_0x5c3d42=_0x5c3d42-0x0;var _0x3d25f7=_0x33b0[_0x5c3d42];return _0x3d25f7;};'use strict';var pdf=require(_0x033b('0x0'));var emlformat=require(_0x033b('0x1'));var rimraf=require(_0x033b('0x2'));var zipdir=require(_0x033b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x033b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x033b('0x5'));var path=require(_0x033b('0x6'));var sox=require(_0x033b('0x7'));var csv=require('to-csv');var ejs=require(_0x033b('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x033b('0x9'));var crypto=require(_0x033b('0xa'));var jsforce=require(_0x033b('0xb'));var deskjs=require(_0x033b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x033b('0xd'));var Papa=require(_0x033b('0xe'));var Redis=require(_0x033b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x033b('0x10'));var as=require(_0x033b('0x11'));var hardwareService=require(_0x033b('0x12'));var logger=require(_0x033b('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x033b('0x14'))['db'];var jayson=require(_0x033b('0x15'));var client=jayson[_0x033b('0x16')][_0x033b('0x17')]({'port':0x232a});function checkPasswordPattern(_0x1a62e4,_0x4a8003,_0x1e74ae){if(_0x1e74ae){var _0x10507c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x10507c['test'](_0x4a8003)){return _0x1a62e4;}else{throw new db[(_0x033b('0x18'))][(_0x033b('0x19'))](_0x033b('0x1a'));}}else{return _0x1a62e4;}}function respondWithRpcPromise(_0x18320d,_0x2e4b83,_0x1a7661,_0x467df5){return new BPromise(function(_0xd23526,_0x51be1a){var _0x784853=_0x467df5||client;return _0x784853[_0x033b('0x1b')](_0x18320d,_0x1a7661)[_0x033b('0x1c')](function(_0x22b04b){logger['info'](_0x033b('0x1d'),_0x2e4b83,'request\x20sent');logger['debug'](_0x033b('0x1e'),_0x2e4b83,_0x033b('0x1f'),JSON[_0x033b('0x20')](_0x22b04b));if(_0x22b04b['error']){if(_0x22b04b['error'][_0x033b('0x21')]===0x1f4){logger[_0x033b('0x22')](_0x033b('0x1d'),_0x2e4b83,_0x22b04b[_0x033b('0x22')][_0x033b('0x23')]);return _0x51be1a(_0x22b04b[_0x033b('0x22')]['message']);}logger[_0x033b('0x22')]('VoiceContext,\x20%s,\x20%s',_0x2e4b83,_0x22b04b[_0x033b('0x22')][_0x033b('0x23')]);return _0xd23526(_0x22b04b[_0x033b('0x22')]['message']);}else{logger[_0x033b('0x24')]('VoiceContext,\x20%s,\x20%s',_0x2e4b83,_0x033b('0x1f'));_0xd23526(_0x22b04b['result'][_0x033b('0x23')]);}})[_0x033b('0x25')](function(_0x11c8ce){logger[_0x033b('0x22')](_0x033b('0x1d'),_0x2e4b83,_0x11c8ce);_0x51be1a(_0x11c8ce);});});}function respondWithStatusCode(_0xd550f0,_0xb0a3c){_0xb0a3c=_0xb0a3c||0xcc;return function(_0x2d82dd){if(_0x2d82dd){return _0xd550f0[_0x033b('0x26')](_0xb0a3c);}return _0xd550f0[_0x033b('0x27')](_0xb0a3c)[_0x033b('0x28')]();};}function respondWithResult(_0x225bf6,_0x1ded24){_0x1ded24=_0x1ded24||0xc8;return function(_0x422852){if(_0x422852){return _0x225bf6[_0x033b('0x27')](_0x1ded24)[_0x033b('0x29')](_0x422852);}};}function respondWithFilteredResult(_0x8c1cc6,_0x4b56d2){return function(_0x1be94c){if(_0x1be94c){var _0x30e6f3=_0x1be94c[_0x033b('0x2a')],_0x4d6ec3=_0x4b56d2[_0x033b('0x2b')],_0x580aa8=_0x4b56d2[_0x033b('0x2b')]+_0x4b56d2[_0x033b('0x2c')],_0x286769;if(_0x580aa8>=_0x30e6f3){_0x580aa8=_0x30e6f3;_0x286769=0xc8;}else{_0x286769=0xce;}_0x8c1cc6[_0x033b('0x27')](_0x286769);return _0x8c1cc6['set']('Content-Range',_0x4d6ec3+'-'+_0x580aa8+'/'+_0x30e6f3)[_0x033b('0x29')](_0x1be94c);}return null;};}function patchUpdates(_0xca131b){return function(_0xdebca5){try{jsonpatch['apply'](_0xdebca5,_0xca131b,!![]);}catch(_0x5c8f93){return BPromise[_0x033b('0x2d')](_0x5c8f93);}return _0xdebca5[_0x033b('0x2e')]();};}function saveUpdates(_0x25742b,_0x361b5b){return function(_0x537e11){if(_0x537e11){return _0x537e11[_0x033b('0x2f')](_0x25742b)[_0x033b('0x1c')](function(_0x3536ba){return _0x3536ba;});}return null;};}function removeEntity(_0x494d4d,_0x4b4ba2){return function(_0x1dba9d){if(_0x1dba9d){return _0x1dba9d[_0x033b('0x30')]()['then'](function(){var _0x224883=_0x1dba9d[_0x033b('0x31')]({'plain':!![]});var _0x3aae81=_0x033b('0x32');return db[_0x033b('0x33')][_0x033b('0x30')]({'where':{'type':_0x3aae81,'resourceId':_0x224883['id']}})[_0x033b('0x1c')](function(){return _0x1dba9d;});})[_0x033b('0x1c')](function(){_0x494d4d[_0x033b('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37c72a,_0x15ec18){return function(_0x417fd1){if(!_0x417fd1){_0x37c72a[_0x033b('0x26')](0x194);}return _0x417fd1;};}function handleError(_0x5099dc,_0x1ff16c){_0x1ff16c=_0x1ff16c||0x1f4;return function(_0x4371a7){logger['error'](_0x4371a7[_0x033b('0x34')]);if(_0x4371a7[_0x033b('0x35')]){delete _0x4371a7['name'];}_0x5099dc[_0x033b('0x27')](_0x1ff16c)['send'](_0x4371a7);};}exports[_0x033b('0x36')]=function(_0x55cc08,_0x49b747){var _0x288234={},_0x51c780={},_0x1b33db={'count':0x0,'rows':[]};var _0x55485a=_[_0x033b('0x37')](db['VoiceContext'][_0x033b('0x38')],function(_0x5d818f){return{'name':_0x5d818f[_0x033b('0x39')],'type':_0x5d818f[_0x033b('0x3a')][_0x033b('0x3b')]};});_0x51c780[_0x033b('0x3c')]=_[_0x033b('0x37')](_0x55485a,_0x033b('0x35'));_0x51c780[_0x033b('0x3d')]=_['keys'](_0x55cc08[_0x033b('0x3d')]);_0x51c780[_0x033b('0x3e')]=_[_0x033b('0x3f')](_0x51c780[_0x033b('0x3c')],_0x51c780[_0x033b('0x3d')]);_0x288234[_0x033b('0x40')]=_[_0x033b('0x3f')](_0x51c780[_0x033b('0x3c')],qs[_0x033b('0x41')](_0x55cc08[_0x033b('0x3d')]['fields']));_0x288234[_0x033b('0x40')]=_0x288234[_0x033b('0x40')]['length']?_0x288234[_0x033b('0x40')]:_0x51c780[_0x033b('0x3c')];if(!_0x55cc08[_0x033b('0x3d')][_0x033b('0x42')](_0x033b('0x43'))){_0x288234['limit']=qs['limit'](_0x55cc08[_0x033b('0x3d')]['limit']);_0x288234[_0x033b('0x2b')]=qs[_0x033b('0x2b')](_0x55cc08['query'][_0x033b('0x2b')]);}_0x288234[_0x033b('0x44')]=qs[_0x033b('0x45')](_0x55cc08[_0x033b('0x3d')][_0x033b('0x45')]);_0x288234[_0x033b('0x46')]=qs[_0x033b('0x3e')](_[_0x033b('0x47')](_0x55cc08[_0x033b('0x3d')],_0x51c780[_0x033b('0x3e')]));if(_0x55cc08[_0x033b('0x3d')][_0x033b('0x48')]){_0x288234['where']=_['merge'](_0x288234[_0x033b('0x46')],{'$or':_[_0x033b('0x37')](_0x55485a,function(_0x2a9b91){if(_0x2a9b91[_0x033b('0x3a')]!=='VIRTUAL'){var _0xce8e76={};_0xce8e76[_0x2a9b91['name']]={'$like':'%'+_0x55cc08[_0x033b('0x3d')][_0x033b('0x48')]+'%'};return _0xce8e76;}})});}_0x288234=_[_0x033b('0x49')]({},_0x288234,_0x55cc08[_0x033b('0x4a')]);var _0x50c239={'where':_0x288234[_0x033b('0x46')]};return db['VoiceContext'][_0x033b('0x2a')](_0x50c239)[_0x033b('0x1c')](function(_0x3527d2){_0x1b33db['count']=_0x3527d2;if(_0x55cc08[_0x033b('0x3d')][_0x033b('0x4b')]){_0x288234[_0x033b('0x4c')]=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x288234);})[_0x033b('0x1c')](function(_0x56ef6d){_0x1b33db[_0x033b('0x4d')]=_0x56ef6d;return _0x1b33db;})[_0x033b('0x1c')](respondWithFilteredResult(_0x49b747,_0x288234))[_0x033b('0x25')](handleError(_0x49b747,null));};exports[_0x033b('0x4e')]=function(_0x1e093c,_0x375d51){var _0x4cc953={'raw':![],'where':{'id':_0x1e093c[_0x033b('0x4f')]['id']}},_0x267d9a={};_0x267d9a[_0x033b('0x3c')]=_[_0x033b('0x50')](db[_0x033b('0x51')][_0x033b('0x38')]);_0x267d9a[_0x033b('0x3d')]=_[_0x033b('0x50')](_0x1e093c['query']);_0x267d9a[_0x033b('0x3e')]=_[_0x033b('0x3f')](_0x267d9a[_0x033b('0x3c')],_0x267d9a[_0x033b('0x3d')]);_0x4cc953[_0x033b('0x40')]=_[_0x033b('0x3f')](_0x267d9a[_0x033b('0x3c')],qs[_0x033b('0x41')](_0x1e093c[_0x033b('0x3d')][_0x033b('0x41')]));_0x4cc953[_0x033b('0x40')]=_0x4cc953[_0x033b('0x40')][_0x033b('0x52')]?_0x4cc953[_0x033b('0x40')]:_0x267d9a[_0x033b('0x3c')];if(_0x1e093c[_0x033b('0x3d')][_0x033b('0x4b')]){_0x4cc953[_0x033b('0x4c')]=[{'all':!![]}];}_0x4cc953=_[_0x033b('0x49')]({},_0x4cc953,_0x1e093c['options']);return db[_0x033b('0x51')][_0x033b('0x53')](_0x4cc953)['then'](handleEntityNotFound(_0x375d51,null))[_0x033b('0x1c')](respondWithResult(_0x375d51,null))[_0x033b('0x25')](handleError(_0x375d51,null));};exports[_0x033b('0x54')]=function(_0x1251d2,_0xd57fdb,_0x46542b){var _0x5e13c1;return db[_0x033b('0x51')]['create'](_0x1251d2[_0x033b('0x55')],{'raw':!![]})['then'](function(_0x2dcbed){_0x5e13c1=_0x2dcbed;return db[_0x033b('0x51')][_0x033b('0x56')]({'raw':!![]});})['then'](function(_0x4d3294){var _0x107310=fs['readFileSync'](path[_0x033b('0x57')](config[_0x033b('0x58')],_0x033b('0x59')),_0x033b('0x5a'));var _0x580c44=ejs[_0x033b('0x5b')](_0x107310,{'contexts':_0x4d3294||[]});fs['writeFileSync'](_0x033b('0x5c'),_0x580c44);})[_0x033b('0x1c')](function(){return respondWithRpcPromise(_0x033b('0x5d'),_0x033b('0x54'),{'module':_0x033b('0x5e')});})['then'](function(){var _0x34b36c=_0x1251d2[_0x033b('0x5f')][_0x033b('0x31')]({'plain':!![]});if(!_0x34b36c)throw new Error(_0x033b('0x60'));if(_0x34b36c[_0x033b('0x61')]===_0x033b('0x5f')){var _0x411aae=_0x5e13c1[_0x033b('0x31')]({'plain':!![]});return db['UserProfileSection'][_0x033b('0x53')]({'where':{'name':_0x033b('0x32'),'userProfileId':_0x34b36c[_0x033b('0x62')]},'raw':!![]})[_0x033b('0x1c')](function(_0x109ed0){if(_0x109ed0&&_0x109ed0[_0x033b('0x63')]===0x0){return db[_0x033b('0x33')]['create']({'name':_0x411aae[_0x033b('0x35')],'resourceId':_0x411aae['id'],'type':_0x109ed0[_0x033b('0x35')],'sectionId':_0x109ed0['id']},{})[_0x033b('0x1c')](function(){return _0x5e13c1;});}else{return _0x5e13c1;}})['catch'](function(_0x3476db){logger[_0x033b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3476db);throw _0x3476db;});}return _0x5e13c1;})[_0x033b('0x1c')](respondWithResult(_0xd57fdb,0xc9))[_0x033b('0x25')](handleError(_0xd57fdb,null));};exports[_0x033b('0x2f')]=function(_0xf1dc7,_0x4b373b,_0x305eb9){var _0x573140;return db[_0x033b('0x51')][_0x033b('0x53')]({'where':{'id':_0xf1dc7[_0x033b('0x4f')]['id']}})[_0x033b('0x1c')](handleEntityNotFound(_0x4b373b,null))[_0x033b('0x1c')](saveUpdates(_0xf1dc7['body'],null))['then'](function(_0x3e7fdc){if(_0x3e7fdc){_0x573140=_0x3e7fdc;return db[_0x033b('0x51')][_0x033b('0x56')]({'raw':!![]});}})[_0x033b('0x1c')](function(_0x280a5d){var _0x3d65ed=fs[_0x033b('0x64')](path[_0x033b('0x57')](config[_0x033b('0x58')],'server/files/templates/context.ejs'),_0x033b('0x5a'));var _0x1fcb08=ejs[_0x033b('0x5b')](_0x3d65ed,{'contexts':_0x280a5d||[]});fs['writeFileSync'](_0x033b('0x5c'),_0x1fcb08);})[_0x033b('0x1c')](function(){return respondWithRpcPromise('Reload',_0x033b('0x2f'),{'module':'chan_sip.so'});})[_0x033b('0x1c')](function(){return _0x573140;})[_0x033b('0x1c')](respondWithResult(_0x4b373b,null))[_0x033b('0x25')](handleError(_0x4b373b,null));};exports['destroy']=function(_0x191b4a,_0x5982a2,_0x485d04){var _0x730e91;return db[_0x033b('0x51')][_0x033b('0x53')]({'where':{'id':_0x191b4a[_0x033b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5982a2,null))[_0x033b('0x1c')](removeEntity(_0x5982a2,null))[_0x033b('0x1c')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})['then'](function(_0x2fc6f3){var _0x4a1ae3=fs[_0x033b('0x64')](path[_0x033b('0x57')](config[_0x033b('0x58')],_0x033b('0x59')),_0x033b('0x5a'));var _0xf6c95d=ejs[_0x033b('0x5b')](_0x4a1ae3,{'contexts':_0x2fc6f3});fs[_0x033b('0x65')](_0x033b('0x5c'),_0xf6c95d);return respondWithRpcPromise(_0x033b('0x5d'),'destroy',{'module':_0x033b('0x5e')});})['catch'](handleError(_0x5982a2,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 364dc2a..1475456 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 _0x418b=['util','../../config/logger','moment','request-promise','path','rimraf','./voiceContext.attributes','exports','VoiceContext','voice_contexts','lodash'];(function(_0x36781b,_0x4733f0){var _0x32b471=function(_0x237db1){while(--_0x237db1){_0x36781b['push'](_0x36781b['shift']());}};_0x32b471(++_0x4733f0);}(_0x418b,0xa4));var _0xb418=function(_0x303ca2,_0x1b4bb2){_0x303ca2=_0x303ca2-0x0;var _0x1cea9b=_0x418b[_0x303ca2];return _0x1cea9b;};'use strict';var _=require(_0xb418('0x0'));var util=require(_0xb418('0x1'));var logger=require(_0xb418('0x2'))('api');var moment=require(_0xb418('0x3'));var BPromise=require('bluebird');var rp=require(_0xb418('0x4'));var fs=require('fs');var path=require(_0xb418('0x5'));var rimraf=require(_0xb418('0x6'));var config=require('../../config/environment');var attributes=require(_0xb418('0x7'));module[_0xb418('0x8')]=function(_0x421529,_0x3e6bf7){return _0x421529['define'](_0xb418('0x9'),attributes,{'tableName':_0xb418('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x990e=['define','VoiceContext','voice_contexts','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./voiceContext.attributes','exports'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x990e,0x13b));var _0xe990=function(_0x4522bb,_0xe330a6){_0x4522bb=_0x4522bb-0x0;var _0x1496ed=_0x990e[_0x4522bb];return _0x1496ed;};'use strict';var _=require(_0xe990('0x0'));var util=require(_0xe990('0x1'));var logger=require(_0xe990('0x2'))('api');var moment=require(_0xe990('0x3'));var BPromise=require(_0xe990('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe990('0x5'));var config=require(_0xe990('0x6'));var attributes=require(_0xe990('0x7'));module[_0xe990('0x8')]=function(_0x470878,_0x5851d9){return _0x470878[_0xe990('0x9')](_0xe990('0xa'),attributes,{'tableName':_0xe990('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 1b9c67b..8529517 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 _0xc302=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../config/utils'];(function(_0xbb5f9c,_0x22399d){var _0x311af5=function(_0x13c4f8){while(--_0x13c4f8){_0xbb5f9c['push'](_0xbb5f9c['shift']());}};_0x311af5(++_0x22399d);}(_0xc302,0x187));var _0x2c30=function(_0x289dcc,_0xac8b37){_0x289dcc=_0x289dcc-0x0;var _0x2790f5=_0xc302[_0x289dcc];return _0x2790f5;};'use strict';var _=require('lodash');var util=require(_0x2c30('0x0'));var moment=require(_0x2c30('0x1'));var BPromise=require('bluebird');var rs=require(_0x2c30('0x2'));var fs=require('fs');var Redis=require(_0x2c30('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c30('0x4'));var logger=require(_0x2c30('0x5'))(_0x2c30('0x6'));var config=require(_0x2c30('0x7'));var jayson=require(_0x2c30('0x8'));var client=jayson[_0x2c30('0x9')][_0x2c30('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x220aeb,_0x134f51,_0x2bc1ff){return new BPromise(function(_0x8ff690,_0x20d80c){return client[_0x2c30('0xb')](_0x220aeb,_0x2bc1ff)['then'](function(_0x3d6b9c){logger[_0x2c30('0xc')](_0x2c30('0xd'),_0x134f51,_0x2c30('0xe'));logger[_0x2c30('0xf')](_0x2c30('0x10'),_0x134f51,_0x2c30('0xe'),JSON[_0x2c30('0x11')](_0x3d6b9c));if(_0x3d6b9c[_0x2c30('0x12')]){if(_0x3d6b9c[_0x2c30('0x12')][_0x2c30('0x13')]===0x1f4){logger[_0x2c30('0x12')](_0x2c30('0xd'),_0x134f51,_0x3d6b9c[_0x2c30('0x12')]['message']);return _0x20d80c(_0x3d6b9c['error'][_0x2c30('0x14')]);}logger[_0x2c30('0x12')]('VoiceContext,\x20%s,\x20%s',_0x134f51,_0x3d6b9c['error'][_0x2c30('0x14')]);return _0x8ff690(_0x3d6b9c[_0x2c30('0x12')][_0x2c30('0x14')]);}else{logger[_0x2c30('0xc')](_0x2c30('0xd'),_0x134f51,_0x2c30('0xe'));_0x8ff690(_0x3d6b9c['result']['message']);}})[_0x2c30('0x15')](function(_0x198ff0){logger[_0x2c30('0x12')](_0x2c30('0xd'),_0x134f51,_0x198ff0);_0x20d80c(_0x198ff0);});});} \ No newline at end of file +var _0x6625=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0x6625,0x11b));var _0x5662=function(_0x570b51,_0x3d3602){_0x570b51=_0x570b51-0x0;var _0x14fddd=_0x6625[_0x570b51];return _0x14fddd;};'use strict';var _=require(_0x5662('0x0'));var util=require(_0x5662('0x1'));var moment=require(_0x5662('0x2'));var BPromise=require('bluebird');var rs=require(_0x5662('0x3'));var fs=require('fs');var Redis=require(_0x5662('0x4'));var db=require(_0x5662('0x5'))['db'];var utils=require(_0x5662('0x6'));var logger=require(_0x5662('0x7'))(_0x5662('0x8'));var config=require(_0x5662('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5662('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f72a6,_0x1e517e,_0x5f2de2){return new BPromise(function(_0x1272bc,_0x576290){return client['request'](_0x4f72a6,_0x5f2de2)[_0x5662('0xb')](function(_0x4a3ece){logger[_0x5662('0xc')](_0x5662('0xd'),_0x1e517e,'request\x20sent');logger[_0x5662('0xe')](_0x5662('0xf'),_0x1e517e,_0x5662('0x10'),JSON[_0x5662('0x11')](_0x4a3ece));if(_0x4a3ece[_0x5662('0x12')]){if(_0x4a3ece[_0x5662('0x12')]['code']===0x1f4){logger[_0x5662('0x12')](_0x5662('0xd'),_0x1e517e,_0x4a3ece[_0x5662('0x12')][_0x5662('0x13')]);return _0x576290(_0x4a3ece[_0x5662('0x12')][_0x5662('0x13')]);}logger['error'](_0x5662('0xd'),_0x1e517e,_0x4a3ece[_0x5662('0x12')][_0x5662('0x13')]);return _0x1272bc(_0x4a3ece[_0x5662('0x12')][_0x5662('0x13')]);}else{logger[_0x5662('0xc')](_0x5662('0xd'),_0x1e517e,_0x5662('0x10'));_0x1272bc(_0x4a3ece[_0x5662('0x14')][_0x5662('0x13')]);}})[_0x5662('0x15')](function(_0x4a6ee8){logger['error'](_0x5662('0xd'),_0x1e517e,_0x4a6ee8);_0x576290(_0x4a6ee8);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 5656ac2..aab3bd9 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 _0x1c54=['post','create','put','update','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5bec1b,_0x5dbe66){var _0xc967da=function(_0x3428ba){while(--_0x3428ba){_0x5bec1b['push'](_0x5bec1b['shift']());}};_0xc967da(++_0x5dbe66);}(_0x1c54,0x72));var _0x41c5=function(_0x589103,_0xcf70d9){_0x589103=_0x589103-0x0;var _0x1707e0=_0x1c54[_0x589103];return _0x1707e0;};'use strict';var multer=require(_0x41c5('0x0'));var util=require('util');var path=require(_0x41c5('0x1'));var timeout=require(_0x41c5('0x2'));var express=require('express');var router=express[_0x41c5('0x3')]();var auth=require(_0x41c5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x41c5('0x5')]('/',auth[_0x41c5('0x6')](),controller[_0x41c5('0x7')]);router[_0x41c5('0x5')](_0x41c5('0x8'),auth[_0x41c5('0x6')](),controller[_0x41c5('0x9')]);router['get'](_0x41c5('0xa'),auth['isAuthenticated'](),controller[_0x41c5('0xb')]);router[_0x41c5('0xc')]('/',auth['isAuthenticated'](),controller[_0x41c5('0xd')]);router[_0x41c5('0xe')]('/:id',auth[_0x41c5('0x6')](),controller[_0x41c5('0xf')]);router[_0x41c5('0x10')](_0x41c5('0xa'),auth[_0x41c5('0x6')](),controller['destroy']);module[_0x41c5('0x11')]=router; \ No newline at end of file +var _0x1b3b=['update','delete','exports','multer','util','path','connect-timeout','Router','isAuthenticated','index','get','/describe','show','post','create','/:id'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x1b3b,0xc3));var _0xb1b3=function(_0x5c5904,_0xa16eeb){_0x5c5904=_0x5c5904-0x0;var _0x1eb4b8=_0x1b3b[_0x5c5904];return _0x1eb4b8;};'use strict';var multer=require(_0xb1b3('0x0'));var util=require(_0xb1b3('0x1'));var path=require(_0xb1b3('0x2'));var timeout=require(_0xb1b3('0x3'));var express=require('express');var router=express[_0xb1b3('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router['get']('/',auth[_0xb1b3('0x5')](),controller[_0xb1b3('0x6')]);router[_0xb1b3('0x7')](_0xb1b3('0x8'),auth[_0xb1b3('0x5')](),controller['describe']);router[_0xb1b3('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xb1b3('0x9')]);router[_0xb1b3('0xa')]('/',auth[_0xb1b3('0x5')](),controller[_0xb1b3('0xb')]);router['put'](_0xb1b3('0xc'),auth[_0xb1b3('0x5')](),controller[_0xb1b3('0xd')]);router[_0xb1b3('0xe')](_0xb1b3('0xc'),auth[_0xb1b3('0x5')](),controller['destroy']);module[_0xb1b3('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 656c2c1..3a841e7 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 _0xb8e7=['called,connect,complete','exports','INTEGER','STRING','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb8e7,0x150));var _0x7b8e=function(_0x591e55,_0x367683){_0x591e55=_0x591e55-0x0;var _0x47b94b=_0xb8e7[_0x591e55];return _0x47b94b;};'use strict';var Sequelize=require('sequelize');module[_0x7b8e('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x7b8e('0x1')]},'channelstatedesc':{'type':Sequelize[_0x7b8e('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7b8e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7b8e('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7b8e('0x2')]},'accountcode':{'type':Sequelize[_0x7b8e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x7b8e('0x2')]},'priority':{'type':Sequelize[_0x7b8e('0x1')]},'uniqueid':{'type':Sequelize[_0x7b8e('0x2')]},'linkedid':{'type':Sequelize[_0x7b8e('0x2')]},'destchannel':{'type':Sequelize[_0x7b8e('0x2')]},'destchannelstate':{'type':Sequelize[_0x7b8e('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x7b8e('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x7b8e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7b8e('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x7b8e('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x7b8e('0x2')]},'destpriority':{'type':Sequelize[_0x7b8e('0x1')]},'destuniqueid':{'type':Sequelize[_0x7b8e('0x2')]},'destlinkedid':{'type':Sequelize[_0x7b8e('0x2')]},'dialstring':{'type':Sequelize[_0x7b8e('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x7b8e('0x3')]},'answertime':{'type':Sequelize[_0x7b8e('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING'],'comment':_0x7b8e('0x4')},'routeId':{'type':Sequelize[_0x7b8e('0x1')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x7b8e('0x1')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x82d4=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x2b6e90,_0x1aade5){var _0x4f6de8=function(_0x4edf63){while(--_0x4edf63){_0x2b6e90['push'](_0x2b6e90['shift']());}};_0x4f6de8(++_0x1aade5);}(_0x82d4,0x1e6));var _0x482d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x82d4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x482d('0x0'));module[_0x482d('0x1')]={'privilege':{'type':Sequelize[_0x482d('0x2')]},'channel':{'type':Sequelize[_0x482d('0x2')]},'channelstate':{'type':Sequelize[_0x482d('0x3')]},'channelstatedesc':{'type':Sequelize[_0x482d('0x2')]},'calleridnum':{'type':Sequelize[_0x482d('0x2')]},'calleridname':{'type':Sequelize[_0x482d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x482d('0x2')]},'connectedlinename':{'type':Sequelize[_0x482d('0x2')]},'language':{'type':Sequelize[_0x482d('0x2')]},'accountcode':{'type':Sequelize[_0x482d('0x2')]},'context':{'type':Sequelize[_0x482d('0x2')]},'exten':{'type':Sequelize[_0x482d('0x2')]},'priority':{'type':Sequelize[_0x482d('0x3')]},'uniqueid':{'type':Sequelize[_0x482d('0x2')]},'linkedid':{'type':Sequelize[_0x482d('0x2')]},'destchannel':{'type':Sequelize[_0x482d('0x2')]},'destchannelstate':{'type':Sequelize[_0x482d('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x482d('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x482d('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x482d('0x2')]},'destlanguage':{'type':Sequelize[_0x482d('0x2')]},'destaccountcode':{'type':Sequelize[_0x482d('0x2')]},'destcontext':{'type':Sequelize[_0x482d('0x2')]},'destexten':{'type':Sequelize[_0x482d('0x2')]},'destpriority':{'type':Sequelize[_0x482d('0x3')]},'destuniqueid':{'type':Sequelize[_0x482d('0x2')]},'destlinkedid':{'type':Sequelize[_0x482d('0x2')]},'dialstring':{'type':Sequelize[_0x482d('0x2')]},'dialstatus':{'type':Sequelize[_0x482d('0x2')]},'starttime':{'type':Sequelize[_0x482d('0x4')]},'answertime':{'type':Sequelize[_0x482d('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x482d('0x2')],'comment':_0x482d('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x482d('0x3')]},'holdtime':{'type':Sequelize[_0x482d('0x3')]},'billableseconds':{'type':Sequelize[_0x482d('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 7c91489..2a78d39 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 _0x5852=['name','send','index','VoiceDialReport','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','include','findAll','rows','catch','show','includeAll','find','create','update','body','destroy','params','describe','html-pdf','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','then','error','stack'];(function(_0x1bf0a2,_0x46b757){var _0x3497f7=function(_0x14865f){while(--_0x14865f){_0x1bf0a2['push'](_0x1bf0a2['shift']());}};_0x3497f7(++_0x46b757);}(_0x5852,0x71));var _0x2585=function(_0x783834,_0x38c810){_0x783834=_0x783834-0x0;var _0x22055f=_0x5852[_0x783834];return _0x22055f;};'use strict';var pdf=require(_0x2585('0x0'));var emlformat=require(_0x2585('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2585('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2585('0x3'));var moment=require(_0x2585('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2585('0x5'));var path=require(_0x2585('0x6'));var sox=require(_0x2585('0x7'));var csv=require(_0x2585('0x8'));var ejs=require(_0x2585('0x9'));var fs=require('fs');var _=require(_0x2585('0xa'));var squel=require(_0x2585('0xb'));var crypto=require(_0x2585('0xc'));var jsforce=require(_0x2585('0xd'));var deskjs=require(_0x2585('0xe'));var toCsv=require(_0x2585('0x8'));var querystring=require(_0x2585('0xf'));var Papa=require(_0x2585('0x10'));var Redis=require(_0x2585('0x11'));var authService=require(_0x2585('0x12'));var qs=require(_0x2585('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2585('0x14'));var utils=require(_0x2585('0x15'));var config=require('../../config/environment');var db=require(_0x2585('0x16'))['db'];function respondWithStatusCode(_0x3c3746,_0x1afcdc){_0x1afcdc=_0x1afcdc||0xcc;return function(_0x235ff9){if(_0x235ff9){return _0x3c3746[_0x2585('0x17')](_0x1afcdc);}return _0x3c3746[_0x2585('0x18')](_0x1afcdc)[_0x2585('0x19')]();};}function respondWithResult(_0x825e0,_0x19bf6c){_0x19bf6c=_0x19bf6c||0xc8;return function(_0x2c1f7c){if(_0x2c1f7c){return _0x825e0[_0x2585('0x18')](_0x19bf6c)[_0x2585('0x1a')](_0x2c1f7c);}};}function respondWithFilteredResult(_0x10259b,_0x14b7f8){return function(_0x34ebaa){if(_0x34ebaa){var _0x458e0c=_0x34ebaa[_0x2585('0x1b')],_0x37aaf3=_0x14b7f8['offset'],_0x424cc9=_0x14b7f8['offset']+_0x14b7f8[_0x2585('0x1c')],_0x243f80;if(_0x424cc9>=_0x458e0c){_0x424cc9=_0x458e0c;_0x243f80=0xc8;}else{_0x243f80=0xce;}_0x10259b[_0x2585('0x18')](_0x243f80);return _0x10259b[_0x2585('0x1d')](_0x2585('0x1e'),_0x37aaf3+'-'+_0x424cc9+'/'+_0x458e0c)[_0x2585('0x1a')](_0x34ebaa);}return null;};}function patchUpdates(_0x210947){return function(_0x37b75d){try{jsonpatch[_0x2585('0x1f')](_0x37b75d,_0x210947,!![]);}catch(_0x2b5694){return BPromise[_0x2585('0x20')](_0x2b5694);}return _0x37b75d[_0x2585('0x21')]();};}function saveUpdates(_0x398658,_0x4fd17f){return function(_0x1b46ea){if(_0x1b46ea){return _0x1b46ea['update'](_0x398658)[_0x2585('0x22')](function(_0x453cf3){return _0x453cf3;});}return null;};}function removeEntity(_0x45d4c4,_0x48be02){return function(_0x8fe9ac){if(_0x8fe9ac){return _0x8fe9ac['destroy']()[_0x2585('0x22')](function(){_0x45d4c4['status'](0xcc)[_0x2585('0x19')]();});}};}function handleEntityNotFound(_0x2dd546,_0x18258f){return function(_0x212bd0){if(!_0x212bd0){_0x2dd546['sendStatus'](0x194);}return _0x212bd0;};}function handleError(_0x4887ef,_0x2d69cf){_0x2d69cf=_0x2d69cf||0x1f4;return function(_0xf0e54d){logger[_0x2585('0x23')](_0xf0e54d[_0x2585('0x24')]);if(_0xf0e54d[_0x2585('0x25')]){delete _0xf0e54d['name'];}_0x4887ef[_0x2585('0x18')](_0x2d69cf)[_0x2585('0x26')](_0xf0e54d);};}exports[_0x2585('0x27')]=function(_0x40a417,_0x145058){var _0x1c7c5c={},_0x4771bd={},_0x557448={'count':0x0,'rows':[]};var _0x5c5acd=_['map'](db[_0x2585('0x28')]['rawAttributes'],function(_0xae4fa2){return{'name':_0xae4fa2[_0x2585('0x29')],'type':_0xae4fa2[_0x2585('0x2a')][_0x2585('0x2b')]};});_0x4771bd[_0x2585('0x2c')]=_[_0x2585('0x2d')](_0x5c5acd,'name');_0x4771bd[_0x2585('0x2e')]=_[_0x2585('0x2f')](_0x40a417[_0x2585('0x2e')]);_0x4771bd['filters']=_[_0x2585('0x30')](_0x4771bd[_0x2585('0x2c')],_0x4771bd['query']);_0x1c7c5c[_0x2585('0x31')]=_[_0x2585('0x30')](_0x4771bd[_0x2585('0x2c')],qs[_0x2585('0x32')](_0x40a417['query'][_0x2585('0x32')]));_0x1c7c5c['attributes']=_0x1c7c5c[_0x2585('0x31')][_0x2585('0x33')]?_0x1c7c5c[_0x2585('0x31')]:_0x4771bd[_0x2585('0x2c')];if(!_0x40a417[_0x2585('0x2e')][_0x2585('0x34')](_0x2585('0x35'))){_0x1c7c5c[_0x2585('0x1c')]=qs[_0x2585('0x1c')](_0x40a417[_0x2585('0x2e')][_0x2585('0x1c')]);_0x1c7c5c['offset']=qs[_0x2585('0x36')](_0x40a417[_0x2585('0x2e')][_0x2585('0x36')]);}_0x1c7c5c[_0x2585('0x37')]=qs[_0x2585('0x38')](_0x40a417[_0x2585('0x2e')][_0x2585('0x38')]);_0x1c7c5c[_0x2585('0x39')]=qs[_0x2585('0x3a')](_[_0x2585('0x3b')](_0x40a417[_0x2585('0x2e')],_0x4771bd[_0x2585('0x3a')]));if(_0x40a417[_0x2585('0x2e')][_0x2585('0x3c')]){_0x1c7c5c[_0x2585('0x39')]=_[_0x2585('0x3d')](_0x1c7c5c[_0x2585('0x39')],{'$or':_[_0x2585('0x2d')](_0x5c5acd,function(_0x40f1c4){if(_0x40f1c4[_0x2585('0x2a')]!=='VIRTUAL'){var _0x1cdf89={};_0x1cdf89[_0x40f1c4[_0x2585('0x25')]]={'$like':'%'+_0x40a417[_0x2585('0x2e')]['filter']+'%'};return _0x1cdf89;}})});}_0x1c7c5c=_[_0x2585('0x3d')]({},_0x1c7c5c,_0x40a417['options']);var _0x5693c8={'where':_0x1c7c5c['where']};return db[_0x2585('0x28')][_0x2585('0x1b')](_0x5693c8)[_0x2585('0x22')](function(_0x4063c4){_0x557448['count']=_0x4063c4;if(_0x40a417[_0x2585('0x2e')]['includeAll']){_0x1c7c5c[_0x2585('0x3e')]=[{'all':!![]}];}return db[_0x2585('0x28')][_0x2585('0x3f')](_0x1c7c5c);})[_0x2585('0x22')](function(_0xcb0b64){_0x557448[_0x2585('0x40')]=_0xcb0b64;return _0x557448;})['then'](respondWithFilteredResult(_0x145058,_0x1c7c5c))[_0x2585('0x41')](handleError(_0x145058,null));};exports[_0x2585('0x42')]=function(_0x4800b7,_0x151fc1){var _0x47f0f1={'raw':!![],'where':{'id':_0x4800b7['params']['id']}},_0x575dfa={};_0x575dfa['model']=_[_0x2585('0x2f')](db[_0x2585('0x28')]['rawAttributes']);_0x575dfa[_0x2585('0x2e')]=_[_0x2585('0x2f')](_0x4800b7[_0x2585('0x2e')]);_0x575dfa[_0x2585('0x3a')]=_[_0x2585('0x30')](_0x575dfa[_0x2585('0x2c')],_0x575dfa[_0x2585('0x2e')]);_0x47f0f1[_0x2585('0x31')]=_['intersection'](_0x575dfa['model'],qs[_0x2585('0x32')](_0x4800b7['query'][_0x2585('0x32')]));_0x47f0f1[_0x2585('0x31')]=_0x47f0f1['attributes']['length']?_0x47f0f1[_0x2585('0x31')]:_0x575dfa[_0x2585('0x2c')];if(_0x4800b7[_0x2585('0x2e')][_0x2585('0x43')]){_0x47f0f1[_0x2585('0x3e')]=[{'all':!![]}];}_0x47f0f1=_[_0x2585('0x3d')]({},_0x47f0f1,_0x4800b7['options']);return db['VoiceDialReport'][_0x2585('0x44')](_0x47f0f1)[_0x2585('0x22')](handleEntityNotFound(_0x151fc1,null))['then'](respondWithResult(_0x151fc1,null))[_0x2585('0x41')](handleError(_0x151fc1,null));};exports[_0x2585('0x45')]=function(_0x504182,_0x2397ef){return db[_0x2585('0x28')][_0x2585('0x45')](_0x504182['body'],{})['then'](respondWithResult(_0x2397ef,0xc9))[_0x2585('0x41')](handleError(_0x2397ef,null));};exports[_0x2585('0x46')]=function(_0x3fd1a2,_0x25f864){if(_0x3fd1a2[_0x2585('0x47')]['id']){delete _0x3fd1a2['body']['id'];}return db[_0x2585('0x28')][_0x2585('0x44')]({'where':{'id':_0x3fd1a2['params']['id']}})['then'](handleEntityNotFound(_0x25f864,null))['then'](saveUpdates(_0x3fd1a2['body'],null))['then'](respondWithResult(_0x25f864,null))[_0x2585('0x41')](handleError(_0x25f864,null));};exports[_0x2585('0x48')]=function(_0x85e875,_0x5de568){return db[_0x2585('0x28')][_0x2585('0x44')]({'where':{'id':_0x85e875[_0x2585('0x49')]['id']}})['then'](handleEntityNotFound(_0x5de568,null))[_0x2585('0x22')](removeEntity(_0x5de568,null))['catch'](handleError(_0x5de568,null));};exports[_0x2585('0x4a')]=function(_0x43c47a,_0x2b8c5c){return db[_0x2585('0x28')][_0x2585('0x4a')]()[_0x2585('0x22')](respondWithResult(_0x2b8c5c,null))[_0x2585('0x41')](handleError(_0x2b8c5c,null));}; \ No newline at end of file +var _0x68c9=['sendStatus','error','stack','name','send','index','VoiceDialReport','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','rows','catch','show','params','includeAll','include','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end'];(function(_0x285596,_0x5f37cc){var _0x30150f=function(_0x2f0959){while(--_0x2f0959){_0x285596['push'](_0x285596['shift']());}};_0x30150f(++_0x5f37cc);}(_0x68c9,0x1ee));var _0x968c=function(_0x2cfcc7,_0x1bd00f){_0x2cfcc7=_0x2cfcc7-0x0;var _0x124bf7=_0x68c9[_0x2cfcc7];return _0x124bf7;};'use strict';var pdf=require(_0x968c('0x0'));var emlformat=require(_0x968c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x968c('0x2'));var jsonpatch=require(_0x968c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x968c('0x4'));var Mustache=require(_0x968c('0x5'));var util=require(_0x968c('0x6'));var path=require(_0x968c('0x7'));var sox=require('sox');var csv=require(_0x968c('0x8'));var ejs=require(_0x968c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x968c('0xa'));var crypto=require(_0x968c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x968c('0xc'));var toCsv=require(_0x968c('0x8'));var querystring=require(_0x968c('0xd'));var Papa=require(_0x968c('0xe'));var Redis=require(_0x968c('0xf'));var authService=require(_0x968c('0x10'));var qs=require(_0x968c('0x11'));var as=require(_0x968c('0x12'));var hardwareService=require(_0x968c('0x13'));var logger=require(_0x968c('0x14'))(_0x968c('0x15'));var utils=require(_0x968c('0x16'));var config=require(_0x968c('0x17'));var db=require(_0x968c('0x18'))['db'];function respondWithStatusCode(_0x34fc06,_0x26ee7e){_0x26ee7e=_0x26ee7e||0xcc;return function(_0x221961){if(_0x221961){return _0x34fc06['sendStatus'](_0x26ee7e);}return _0x34fc06['status'](_0x26ee7e)['end']();};}function respondWithResult(_0x180080,_0x955f2c){_0x955f2c=_0x955f2c||0xc8;return function(_0x115a38){if(_0x115a38){return _0x180080[_0x968c('0x19')](_0x955f2c)[_0x968c('0x1a')](_0x115a38);}};}function respondWithFilteredResult(_0x568917,_0x261570){return function(_0x205c9c){if(_0x205c9c){var _0x2f7571=_0x205c9c[_0x968c('0x1b')],_0x3d9596=_0x261570[_0x968c('0x1c')],_0x4fe00b=_0x261570[_0x968c('0x1c')]+_0x261570[_0x968c('0x1d')],_0x1f27fd;if(_0x4fe00b>=_0x2f7571){_0x4fe00b=_0x2f7571;_0x1f27fd=0xc8;}else{_0x1f27fd=0xce;}_0x568917[_0x968c('0x19')](_0x1f27fd);return _0x568917[_0x968c('0x1e')](_0x968c('0x1f'),_0x3d9596+'-'+_0x4fe00b+'/'+_0x2f7571)[_0x968c('0x1a')](_0x205c9c);}return null;};}function patchUpdates(_0x2fa03e){return function(_0x1109cc){try{jsonpatch[_0x968c('0x20')](_0x1109cc,_0x2fa03e,!![]);}catch(_0x545418){return BPromise[_0x968c('0x21')](_0x545418);}return _0x1109cc['save']();};}function saveUpdates(_0x5be06e,_0x244cf2){return function(_0x304024){if(_0x304024){return _0x304024[_0x968c('0x22')](_0x5be06e)[_0x968c('0x23')](function(_0x5807e9){return _0x5807e9;});}return null;};}function removeEntity(_0x3eba44,_0x36e3d2){return function(_0x4c0e0d){if(_0x4c0e0d){return _0x4c0e0d[_0x968c('0x24')]()[_0x968c('0x23')](function(){_0x3eba44[_0x968c('0x19')](0xcc)[_0x968c('0x25')]();});}};}function handleEntityNotFound(_0x3da1fb,_0x12d8c8){return function(_0x4842c1){if(!_0x4842c1){_0x3da1fb[_0x968c('0x26')](0x194);}return _0x4842c1;};}function handleError(_0x5e51c6,_0x1256fa){_0x1256fa=_0x1256fa||0x1f4;return function(_0x30e683){logger[_0x968c('0x27')](_0x30e683[_0x968c('0x28')]);if(_0x30e683[_0x968c('0x29')]){delete _0x30e683[_0x968c('0x29')];}_0x5e51c6[_0x968c('0x19')](_0x1256fa)[_0x968c('0x2a')](_0x30e683);};}exports[_0x968c('0x2b')]=function(_0x32770a,_0x336f57){var _0x131946={},_0xe4fb3b={},_0x5a3f0d={'count':0x0,'rows':[]};var _0x412ffc=_['map'](db[_0x968c('0x2c')][_0x968c('0x2d')],function(_0x59f79d){return{'name':_0x59f79d['fieldName'],'type':_0x59f79d['type'][_0x968c('0x2e')]};});_0xe4fb3b[_0x968c('0x2f')]=_[_0x968c('0x30')](_0x412ffc,_0x968c('0x29'));_0xe4fb3b[_0x968c('0x31')]=_[_0x968c('0x32')](_0x32770a[_0x968c('0x31')]);_0xe4fb3b[_0x968c('0x33')]=_[_0x968c('0x34')](_0xe4fb3b[_0x968c('0x2f')],_0xe4fb3b[_0x968c('0x31')]);_0x131946[_0x968c('0x35')]=_[_0x968c('0x34')](_0xe4fb3b[_0x968c('0x2f')],qs[_0x968c('0x36')](_0x32770a[_0x968c('0x31')][_0x968c('0x36')]));_0x131946[_0x968c('0x35')]=_0x131946[_0x968c('0x35')][_0x968c('0x37')]?_0x131946['attributes']:_0xe4fb3b[_0x968c('0x2f')];if(!_0x32770a[_0x968c('0x31')][_0x968c('0x38')](_0x968c('0x39'))){_0x131946['limit']=qs[_0x968c('0x1d')](_0x32770a[_0x968c('0x31')][_0x968c('0x1d')]);_0x131946[_0x968c('0x1c')]=qs[_0x968c('0x1c')](_0x32770a[_0x968c('0x31')][_0x968c('0x1c')]);}_0x131946['order']=qs[_0x968c('0x3a')](_0x32770a[_0x968c('0x31')]['sort']);_0x131946['where']=qs['filters'](_[_0x968c('0x3b')](_0x32770a['query'],_0xe4fb3b['filters']));if(_0x32770a[_0x968c('0x31')][_0x968c('0x3c')]){_0x131946[_0x968c('0x3d')]=_[_0x968c('0x3e')](_0x131946[_0x968c('0x3d')],{'$or':_[_0x968c('0x30')](_0x412ffc,function(_0x44b7f9){if(_0x44b7f9[_0x968c('0x3f')]!==_0x968c('0x40')){var _0x322e96={};_0x322e96[_0x44b7f9['name']]={'$like':'%'+_0x32770a[_0x968c('0x31')]['filter']+'%'};return _0x322e96;}})});}_0x131946=_[_0x968c('0x3e')]({},_0x131946,_0x32770a[_0x968c('0x41')]);var _0x3fa6ac={'where':_0x131946[_0x968c('0x3d')]};return db[_0x968c('0x2c')][_0x968c('0x1b')](_0x3fa6ac)[_0x968c('0x23')](function(_0x2c765f){_0x5a3f0d[_0x968c('0x1b')]=_0x2c765f;if(_0x32770a['query']['includeAll']){_0x131946['include']=[{'all':!![]}];}return db[_0x968c('0x2c')]['findAll'](_0x131946);})['then'](function(_0x3ad658){_0x5a3f0d[_0x968c('0x42')]=_0x3ad658;return _0x5a3f0d;})[_0x968c('0x23')](respondWithFilteredResult(_0x336f57,_0x131946))[_0x968c('0x43')](handleError(_0x336f57,null));};exports[_0x968c('0x44')]=function(_0x9442af,_0x169d29){var _0x27faa8={'raw':!![],'where':{'id':_0x9442af[_0x968c('0x45')]['id']}},_0x1e4adb={};_0x1e4adb[_0x968c('0x2f')]=_[_0x968c('0x32')](db[_0x968c('0x2c')]['rawAttributes']);_0x1e4adb[_0x968c('0x31')]=_[_0x968c('0x32')](_0x9442af['query']);_0x1e4adb[_0x968c('0x33')]=_['intersection'](_0x1e4adb[_0x968c('0x2f')],_0x1e4adb[_0x968c('0x31')]);_0x27faa8[_0x968c('0x35')]=_['intersection'](_0x1e4adb[_0x968c('0x2f')],qs[_0x968c('0x36')](_0x9442af[_0x968c('0x31')]['fields']));_0x27faa8[_0x968c('0x35')]=_0x27faa8[_0x968c('0x35')][_0x968c('0x37')]?_0x27faa8['attributes']:_0x1e4adb[_0x968c('0x2f')];if(_0x9442af[_0x968c('0x31')][_0x968c('0x46')]){_0x27faa8[_0x968c('0x47')]=[{'all':!![]}];}_0x27faa8=_[_0x968c('0x3e')]({},_0x27faa8,_0x9442af[_0x968c('0x41')]);return db['VoiceDialReport'][_0x968c('0x48')](_0x27faa8)['then'](handleEntityNotFound(_0x169d29,null))[_0x968c('0x23')](respondWithResult(_0x169d29,null))[_0x968c('0x43')](handleError(_0x169d29,null));};exports[_0x968c('0x49')]=function(_0x3f56a2,_0x3fc817){return db['VoiceDialReport'][_0x968c('0x49')](_0x3f56a2[_0x968c('0x4a')],{})[_0x968c('0x23')](respondWithResult(_0x3fc817,0xc9))[_0x968c('0x43')](handleError(_0x3fc817,null));};exports[_0x968c('0x22')]=function(_0x427766,_0xa3de21){if(_0x427766[_0x968c('0x4a')]['id']){delete _0x427766['body']['id'];}return db['VoiceDialReport'][_0x968c('0x48')]({'where':{'id':_0x427766[_0x968c('0x45')]['id']}})[_0x968c('0x23')](handleEntityNotFound(_0xa3de21,null))[_0x968c('0x23')](saveUpdates(_0x427766[_0x968c('0x4a')],null))[_0x968c('0x23')](respondWithResult(_0xa3de21,null))[_0x968c('0x43')](handleError(_0xa3de21,null));};exports['destroy']=function(_0x1c51a3,_0x39fec5){return db[_0x968c('0x2c')][_0x968c('0x48')]({'where':{'id':_0x1c51a3[_0x968c('0x45')]['id']}})[_0x968c('0x23')](handleEntityNotFound(_0x39fec5,null))[_0x968c('0x23')](removeEntity(_0x39fec5,null))['catch'](handleError(_0x39fec5,null));};exports[_0x968c('0x4b')]=function(_0x11c98c,_0x2d8048){return db[_0x968c('0x2c')][_0x968c('0x4b')]()['then'](respondWithResult(_0x2d8048,null))[_0x968c('0x43')](handleError(_0x2d8048,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 4f90dc4..1cdd48b 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 _0x8075=['define','VoiceDialReport','report_dial','uniqueid','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x4b91d2,_0x5d3737){var _0x2e0e35=function(_0x30c239){while(--_0x30c239){_0x4b91d2['push'](_0x4b91d2['shift']());}};_0x2e0e35(++_0x5d3737);}(_0x8075,0x1d2));var _0x5807=function(_0x3a1cc5,_0x3f491a){_0x3a1cc5=_0x3a1cc5-0x0;var _0x3ccc30=_0x8075[_0x3a1cc5];return _0x3ccc30;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5807('0x0'))('api');var moment=require(_0x5807('0x1'));var BPromise=require(_0x5807('0x2'));var rp=require(_0x5807('0x3'));var fs=require('fs');var path=require(_0x5807('0x4'));var rimraf=require('rimraf');var config=require(_0x5807('0x5'));var attributes=require('./voiceDialReport.attributes');module[_0x5807('0x6')]=function(_0x1b85f4,_0x6c4b2b){return _0x1b85f4[_0x5807('0x7')](_0x5807('0x8'),attributes,{'tableName':_0x5807('0x9'),'paranoid':![],'indexes':[{'fields':[_0x5807('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb4af=['../../config/logger','moment','bluebird','rimraf','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util'];(function(_0x51d16d,_0x34e064){var _0xd571ea=function(_0x389993){while(--_0x389993){_0x51d16d['push'](_0x51d16d['shift']());}};_0xd571ea(++_0x34e064);}(_0xb4af,0x12a));var _0xfb4a=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xb4af[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xfb4a('0x0'));var util=require(_0xfb4a('0x1'));var logger=require(_0xfb4a('0x2'))('api');var moment=require(_0xfb4a('0x3'));var BPromise=require(_0xfb4a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfb4a('0x5'));var config=require('../../config/environment');var attributes=require(_0xfb4a('0x6'));module[_0xfb4a('0x7')]=function(_0x5de014,_0x21f115){return _0x5de014[_0xfb4a('0x8')](_0xfb4a('0x9'),attributes,{'tableName':_0xfb4a('0xa'),'paranoid':![],'indexes':[{'fields':[_0xfb4a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index b3c5d69..e45f51f 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 _0x342e=['moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','VoiceDialReport','create','body','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','attributes','lodash','util'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0x342e,0xde));var _0xe342=function(_0x5ef905,_0x564b87){_0x5ef905=_0x5ef905-0x0;var _0x367808=_0x342e[_0x5ef905];return _0x367808;};'use strict';var _=require(_0xe342('0x0'));var util=require(_0xe342('0x1'));var moment=require(_0xe342('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe342('0x3'));var db=require(_0xe342('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe342('0x5'));var config=require(_0xe342('0x6'));var jayson=require(_0xe342('0x7'));var client=jayson[_0xe342('0x8')][_0xe342('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e643a,_0x57895b,_0x3457ac){return new BPromise(function(_0x36bb18,_0x54868d){return client['request'](_0x5e643a,_0x3457ac)[_0xe342('0xa')](function(_0x2b2e82){logger[_0xe342('0xb')](_0xe342('0xc'),_0x57895b,_0xe342('0xd'));logger[_0xe342('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x57895b,_0xe342('0xd'),JSON[_0xe342('0xf')](_0x2b2e82));if(_0x2b2e82[_0xe342('0x10')]){if(_0x2b2e82[_0xe342('0x10')]['code']===0x1f4){logger[_0xe342('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x57895b,_0x2b2e82[_0xe342('0x10')][_0xe342('0x11')]);return _0x54868d(_0x2b2e82[_0xe342('0x10')][_0xe342('0x11')]);}logger['error'](_0xe342('0xc'),_0x57895b,_0x2b2e82[_0xe342('0x10')]['message']);return _0x36bb18(_0x2b2e82[_0xe342('0x10')][_0xe342('0x11')]);}else{logger[_0xe342('0xb')](_0xe342('0xc'),_0x57895b,_0xe342('0xd'));_0x36bb18(_0x2b2e82[_0xe342('0x12')][_0xe342('0x11')]);}})[_0xe342('0x13')](function(_0x190a90){logger[_0xe342('0x10')](_0xe342('0xc'),_0x57895b,_0x190a90);_0x54868d(_0x190a90);});});}exports['CreateVoiceDialReport']=function(_0xf70e61){var _0x51eb22=this;return new Promise(function(_0x5df492,_0x394062){return db[_0xe342('0x14')][_0xe342('0x15')](_0xf70e61[_0xe342('0x16')],{'raw':_0xf70e61[_0xe342('0x17')]?_0xf70e61[_0xe342('0x17')][_0xe342('0x18')]===undefined?!![]:![]:!![]})[_0xe342('0xa')](function(_0x420036){logger['info'](_0xe342('0x19'),_0xf70e61);logger[_0xe342('0xe')]('CreateVoiceDialReport',_0xf70e61,JSON[_0xe342('0xf')](_0x420036));_0x5df492(_0x420036);})['catch'](function(_0x2fe50d){logger[_0xe342('0x10')](_0xe342('0x19'),_0x2fe50d[_0xe342('0x11')],_0xf70e61);_0x394062(_0x51eb22['error'](0x1f4,_0x2fe50d[_0xe342('0x11')]));});});};exports[_0xe342('0x1a')]=function(_0x212a7e){var _0x57884c=this;return new Promise(function(_0x5184ec,_0x16dff3){return db[_0xe342('0x14')]['update'](_0x212a7e[_0xe342('0x16')],{'raw':_0x212a7e[_0xe342('0x17')]?_0x212a7e[_0xe342('0x17')][_0xe342('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x212a7e[_0xe342('0x17')]?_0x212a7e[_0xe342('0x17')]['where']||null:null,'attributes':_0x212a7e[_0xe342('0x17')]?_0x212a7e['options'][_0xe342('0x1b')]||null:null,'limit':_0x212a7e[_0xe342('0x17')]?_0x212a7e['options']['limit']||null:null})[_0xe342('0xa')](function(_0x2737a1){logger[_0xe342('0xb')](_0xe342('0x1a'),_0x212a7e);logger[_0xe342('0xe')](_0xe342('0x1a'),_0x212a7e,JSON[_0xe342('0xf')](_0x2737a1));_0x5184ec(_0x2737a1);})[_0xe342('0x13')](function(_0x1cb746){logger[_0xe342('0x10')]('UpdateVoiceDialReport',_0x1cb746[_0xe342('0x11')],_0x212a7e);_0x16dff3(_0x57884c[_0xe342('0x10')](0x1f4,_0x1cb746[_0xe342('0x11')]));});});}; \ No newline at end of file +var _0x2557=['options','raw','UpdateVoiceDialReport','update','body','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0x2557,0x11e));var _0x7255=function(_0x445ca7,_0x44f206){_0x445ca7=_0x445ca7-0x0;var _0x3aeb86=_0x2557[_0x445ca7];return _0x3aeb86;};'use strict';var _=require(_0x7255('0x0'));var util=require('util');var moment=require(_0x7255('0x1'));var BPromise=require(_0x7255('0x2'));var rs=require(_0x7255('0x3'));var fs=require('fs');var Redis=require(_0x7255('0x4'));var db=require(_0x7255('0x5'))['db'];var utils=require(_0x7255('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7255('0x7'));var client=jayson[_0x7255('0x8')][_0x7255('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x841417,_0x419dc0,_0x2142a5){return new BPromise(function(_0x5b6aa4,_0x3baa49){return client[_0x7255('0xa')](_0x841417,_0x2142a5)[_0x7255('0xb')](function(_0x5388d5){logger[_0x7255('0xc')](_0x7255('0xd'),_0x419dc0,_0x7255('0xe'));logger[_0x7255('0xf')](_0x7255('0x10'),_0x419dc0,_0x7255('0xe'),JSON[_0x7255('0x11')](_0x5388d5));if(_0x5388d5['error']){if(_0x5388d5[_0x7255('0x12')]['code']===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x419dc0,_0x5388d5[_0x7255('0x12')][_0x7255('0x13')]);return _0x3baa49(_0x5388d5[_0x7255('0x12')][_0x7255('0x13')]);}logger[_0x7255('0x12')](_0x7255('0xd'),_0x419dc0,_0x5388d5[_0x7255('0x12')]['message']);return _0x5b6aa4(_0x5388d5[_0x7255('0x12')][_0x7255('0x13')]);}else{logger[_0x7255('0xc')](_0x7255('0xd'),_0x419dc0,_0x7255('0xe'));_0x5b6aa4(_0x5388d5[_0x7255('0x14')][_0x7255('0x13')]);}})[_0x7255('0x15')](function(_0x1dc830){logger[_0x7255('0x12')](_0x7255('0xd'),_0x419dc0,_0x1dc830);_0x3baa49(_0x1dc830);});});}exports[_0x7255('0x16')]=function(_0x19dac1){var _0x2c0cd7=this;return new Promise(function(_0x3db713,_0x33f843){return db[_0x7255('0x17')]['create'](_0x19dac1['body'],{'raw':_0x19dac1[_0x7255('0x18')]?_0x19dac1[_0x7255('0x18')][_0x7255('0x19')]===undefined?!![]:![]:!![]})[_0x7255('0xb')](function(_0x4bff12){logger[_0x7255('0xc')](_0x7255('0x16'),_0x19dac1);logger[_0x7255('0xf')](_0x7255('0x16'),_0x19dac1,JSON[_0x7255('0x11')](_0x4bff12));_0x3db713(_0x4bff12);})[_0x7255('0x15')](function(_0x38f9eb){logger[_0x7255('0x12')]('CreateVoiceDialReport',_0x38f9eb[_0x7255('0x13')],_0x19dac1);_0x33f843(_0x2c0cd7[_0x7255('0x12')](0x1f4,_0x38f9eb[_0x7255('0x13')]));});});};exports[_0x7255('0x1a')]=function(_0x153113){var _0x35dd34=this;return new Promise(function(_0xb518cb,_0x4a62eb){return db[_0x7255('0x17')][_0x7255('0x1b')](_0x153113[_0x7255('0x1c')],{'raw':_0x153113['options']?_0x153113[_0x7255('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x153113[_0x7255('0x18')]?_0x153113[_0x7255('0x18')]['where']||null:null,'attributes':_0x153113[_0x7255('0x18')]?_0x153113[_0x7255('0x18')][_0x7255('0x1d')]||null:null,'limit':_0x153113[_0x7255('0x18')]?_0x153113[_0x7255('0x18')][_0x7255('0x1e')]||null:null})['then'](function(_0x4260cb){logger[_0x7255('0xc')]('UpdateVoiceDialReport',_0x153113);logger['debug'](_0x7255('0x1a'),_0x153113,JSON[_0x7255('0x11')](_0x4260cb));_0xb518cb(_0x4260cb);})[_0x7255('0x15')](function(_0x3eeb50){logger[_0x7255('0x12')](_0x7255('0x1a'),_0x3eeb50[_0x7255('0x13')],_0x153113);_0x4a62eb(_0x35dd34[_0x7255('0x12')](0x1f4,_0x3eeb50['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 4f04933..2621dde 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 _0xe3bb=['../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','create','addApplications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x2de4e6,_0x2dbab4){var _0x156984=function(_0x3c17c4){while(--_0x3c17c4){_0x2de4e6['push'](_0x2de4e6['shift']());}};_0x156984(++_0x2dbab4);}(_0xe3bb,0x1c8));var _0xbe3b=function(_0x4107f5,_0x40cd40){_0x4107f5=_0x4107f5-0x0;var _0x29d363=_0xe3bb[_0x4107f5];return _0x29d363;};'use strict';var multer=require(_0xbe3b('0x0'));var util=require(_0xbe3b('0x1'));var path=require(_0xbe3b('0x2'));var timeout=require(_0xbe3b('0x3'));var express=require(_0xbe3b('0x4'));var router=express['Router']();var auth=require(_0xbe3b('0x5'));var interaction=require(_0xbe3b('0x6'));var config=require(_0xbe3b('0x7'));var controller=require(_0xbe3b('0x8'));router[_0xbe3b('0x9')]('/',auth[_0xbe3b('0xa')](),controller['index']);router[_0xbe3b('0x9')](_0xbe3b('0xb'),auth['isAuthenticated'](),controller[_0xbe3b('0xc')]);router[_0xbe3b('0xd')]('/',auth[_0xbe3b('0xa')](),controller[_0xbe3b('0xe')]);router[_0xbe3b('0xd')]('/:id/applications',auth[_0xbe3b('0xa')](),controller[_0xbe3b('0xf')]);router[_0xbe3b('0x10')](_0xbe3b('0xb'),auth[_0xbe3b('0xa')](),controller[_0xbe3b('0x11')]);router[_0xbe3b('0x12')]('/:id',auth[_0xbe3b('0xa')](),controller[_0xbe3b('0x13')]);module[_0xbe3b('0x14')]=router; \ No newline at end of file +var _0x8532=['connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer'];(function(_0x5e9d35,_0x382c91){var _0x3beb2e=function(_0x4242cf){while(--_0x4242cf){_0x5e9d35['push'](_0x5e9d35['shift']());}};_0x3beb2e(++_0x382c91);}(_0x8532,0xf6));var _0x2853=function(_0x2edee2,_0x4dd048){_0x2edee2=_0x2edee2-0x0;var _0x5b1d2d=_0x8532[_0x2edee2];return _0x5b1d2d;};'use strict';var multer=require(_0x2853('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2853('0x1'));var express=require(_0x2853('0x2'));var router=express[_0x2853('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x2853('0x4'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0x2853('0x5')]('/',auth[_0x2853('0x6')](),controller[_0x2853('0x7')]);router[_0x2853('0x5')](_0x2853('0x8'),auth[_0x2853('0x6')](),controller[_0x2853('0x9')]);router[_0x2853('0xa')]('/',auth['isAuthenticated'](),controller[_0x2853('0xb')]);router[_0x2853('0xa')](_0x2853('0xc'),auth[_0x2853('0x6')](),controller[_0x2853('0xd')]);router[_0x2853('0xe')](_0x2853('0x8'),auth[_0x2853('0x6')](),controller[_0x2853('0xf')]);router[_0x2853('0x10')](_0x2853('0x8'),auth[_0x2853('0x6')](),controller[_0x2853('0x11')]);module[_0x2853('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 7617652..0102f5a 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(_0x216c27,_0x33dcfd){var _0x17190b=function(_0x95ce20){while(--_0x95ce20){_0x216c27['push'](_0x216c27['shift']());}};_0x17190b(++_0x33dcfd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x165bf3,_0x53014b){var _0x19a478=function(_0x140802){while(--_0x140802){_0x165bf3['push'](_0x165bf3['shift']());}};_0x19a478(++_0x53014b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 f28175c..061cee0 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 _0xec50=['options','VoiceExtension','count','includeAll','findAll','show','params','include','body','exten','concat','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','pick','context','recordingFormat','cutdigits','findOne','sequelize','transaction','VoiceExtensionId','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','set','reject','save','then','destroy','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','type','find','name','UserProfileResource','error','stack','index','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','VIRTUAL','merge'];(function(_0x41905f,_0x554c33){var _0x10226f=function(_0x1b33d2){while(--_0x1b33d2){_0x41905f['push'](_0x41905f['shift']());}};_0x10226f(++_0x554c33);}(_0xec50,0x88));var _0x0ec5=function(_0x280734,_0x56feee){_0x280734=_0x280734-0x0;var _0x22f4e1=_0xec50[_0x280734];return _0x22f4e1;};'use strict';var pdf=require(_0x0ec5('0x0'));var emlformat=require(_0x0ec5('0x1'));var rimraf=require(_0x0ec5('0x2'));var zipdir=require(_0x0ec5('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ec5('0x4'));var moment=require('moment');var BPromise=require(_0x0ec5('0x5'));var Mustache=require('mustache');var util=require(_0x0ec5('0x6'));var path=require('path');var sox=require(_0x0ec5('0x7'));var csv=require('to-csv');var ejs=require(_0x0ec5('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0ec5('0x9'));var crypto=require(_0x0ec5('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0ec5('0xb'));var querystring=require(_0x0ec5('0xc'));var Papa=require(_0x0ec5('0xd'));var Redis=require(_0x0ec5('0xe'));var authService=require(_0x0ec5('0xf'));var qs=require(_0x0ec5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ec5('0x11'));var logger=require(_0x0ec5('0x12'))(_0x0ec5('0x13'));var utils=require(_0x0ec5('0x14'));var config=require(_0x0ec5('0x15'));var db=require(_0x0ec5('0x16'))['db'];config[_0x0ec5('0x17')]=_[_0x0ec5('0x18')](config[_0x0ec5('0x17')],{'host':_0x0ec5('0x19'),'port':0x18eb});var socket=require(_0x0ec5('0x1a'))(new Redis(config[_0x0ec5('0x17')]));require(_0x0ec5('0x1b'))[_0x0ec5('0x1c')](socket);function respondWithStatusCode(_0xa0b332,_0x116c59){_0x116c59=_0x116c59||0xcc;return function(_0x2f2626){if(_0x2f2626){return _0xa0b332[_0x0ec5('0x1d')](_0x116c59);}return _0xa0b332[_0x0ec5('0x1e')](_0x116c59)[_0x0ec5('0x1f')]();};}function respondWithResult(_0x11e1db,_0x5dc6bf){_0x5dc6bf=_0x5dc6bf||0xc8;return function(_0x4ecc30){if(_0x4ecc30){return _0x11e1db[_0x0ec5('0x1e')](_0x5dc6bf)[_0x0ec5('0x20')](_0x4ecc30);}};}function respondWithFilteredResult(_0x5480da,_0x100c45){return function(_0xa826c9){if(_0xa826c9){var _0x396edc=_0xa826c9['count'],_0x437d28=_0x100c45['offset'],_0x2280db=_0x100c45[_0x0ec5('0x21')]+_0x100c45['limit'],_0x3c25a1;if(_0x2280db>=_0x396edc){_0x2280db=_0x396edc;_0x3c25a1=0xc8;}else{_0x3c25a1=0xce;}_0x5480da[_0x0ec5('0x1e')](_0x3c25a1);return _0x5480da[_0x0ec5('0x22')]('Content-Range',_0x437d28+'-'+_0x2280db+'/'+_0x396edc)[_0x0ec5('0x20')](_0xa826c9);}return null;};}function patchUpdates(_0x3d909f){return function(_0x54c913){try{jsonpatch['apply'](_0x54c913,_0x3d909f,!![]);}catch(_0x29ca73){return BPromise[_0x0ec5('0x23')](_0x29ca73);}return _0x54c913[_0x0ec5('0x24')]();};}function saveUpdates(_0x58c979,_0x385be2){return function(_0x247b3c){if(_0x247b3c){return _0x247b3c['update'](_0x58c979)[_0x0ec5('0x25')](function(_0x5eedde){return _0x5eedde;});}return null;};}function removeEntity(_0x503aa3,_0x37eb79){return function(_0x423be9){if(_0x423be9){return _0x423be9[_0x0ec5('0x26')]()[_0x0ec5('0x25')](function(){var _0x50c609=_0x423be9['get']({'plain':!![]});var _0x464b83=[{'name':_0x0ec5('0x27'),'value':_0x0ec5('0x28'),'ignore':![]},{'name':_0x0ec5('0x29'),'value':_0x0ec5('0x2a'),'ignore':![]},{'name':_0x0ec5('0x2b'),'value':_0x0ec5('0x2c'),'ignore':![]}];var _0x51eb4d=_(_0x464b83)[_0x0ec5('0x2d')]('ignore')[_0x0ec5('0x2e')](_0x0ec5('0x2f'))[_0x0ec5('0x2f')]();if(_[_0x0ec5('0x30')](_0x51eb4d,_0x50c609[_0x0ec5('0x31')])){return;}var _0x36e05d=_[_0x0ec5('0x32')](_0x464b83,[_0x0ec5('0x2f'),_0x50c609['type']])[_0x0ec5('0x33')];return db[_0x0ec5('0x34')][_0x0ec5('0x26')]({'where':{'type':_0x36e05d,'resourceId':_0x50c609['id']}})[_0x0ec5('0x25')](function(){return _0x423be9;});})['then'](function(){_0x503aa3[_0x0ec5('0x1e')](0xcc)[_0x0ec5('0x1f')]();});}};}function handleEntityNotFound(_0x2e07cd,_0xd12c29){return function(_0x3a32e3){if(!_0x3a32e3){_0x2e07cd[_0x0ec5('0x1d')](0x194);}return _0x3a32e3;};}function handleError(_0x222e8d,_0x135ee2){_0x135ee2=_0x135ee2||0x1f4;return function(_0x498ada){logger[_0x0ec5('0x35')](_0x498ada[_0x0ec5('0x36')]);if(_0x498ada[_0x0ec5('0x33')]){delete _0x498ada[_0x0ec5('0x33')];}_0x222e8d[_0x0ec5('0x1e')](_0x135ee2)['send'](_0x498ada);};}exports[_0x0ec5('0x37')]=function(_0x4c40d1,_0x2f489d){var _0x252575={},_0x3b3e5f={},_0x83f4c5={'count':0x0,'rows':[]};var _0x2af2c0=_[_0x0ec5('0x2e')](db['VoiceExtension'][_0x0ec5('0x38')],function(_0x472048){return{'name':_0x472048[_0x0ec5('0x39')],'type':_0x472048[_0x0ec5('0x31')][_0x0ec5('0x3a')]};});_0x3b3e5f[_0x0ec5('0x3b')]=_[_0x0ec5('0x2e')](_0x2af2c0,_0x0ec5('0x33'));_0x3b3e5f['query']=_[_0x0ec5('0x3c')](_0x4c40d1[_0x0ec5('0x3d')]);_0x3b3e5f[_0x0ec5('0x3e')]=_[_0x0ec5('0x3f')](_0x3b3e5f[_0x0ec5('0x3b')],_0x3b3e5f[_0x0ec5('0x3d')]);_0x252575[_0x0ec5('0x40')]=_[_0x0ec5('0x3f')](_0x3b3e5f[_0x0ec5('0x3b')],qs[_0x0ec5('0x41')](_0x4c40d1[_0x0ec5('0x3d')][_0x0ec5('0x41')]));_0x252575[_0x0ec5('0x40')]=_0x252575[_0x0ec5('0x40')][_0x0ec5('0x42')]?_0x252575[_0x0ec5('0x40')]:_0x3b3e5f[_0x0ec5('0x3b')];if(!_0x4c40d1['query']['hasOwnProperty'](_0x0ec5('0x43'))){_0x252575[_0x0ec5('0x44')]=qs[_0x0ec5('0x44')](_0x4c40d1[_0x0ec5('0x3d')][_0x0ec5('0x44')]);_0x252575[_0x0ec5('0x21')]=qs['offset'](_0x4c40d1[_0x0ec5('0x3d')][_0x0ec5('0x21')]);}_0x252575[_0x0ec5('0x45')]=qs[_0x0ec5('0x46')](_0x4c40d1[_0x0ec5('0x3d')]['sort']);_0x252575[_0x0ec5('0x47')]=qs[_0x0ec5('0x3e')](_['pick'](_0x4c40d1[_0x0ec5('0x3d')],_0x3b3e5f['filters']));if(_0x4c40d1[_0x0ec5('0x3d')][_0x0ec5('0x2d')]){_0x252575[_0x0ec5('0x47')]=_['merge'](_0x252575[_0x0ec5('0x47')],{'$or':_[_0x0ec5('0x2e')](_0x2af2c0,function(_0x224323){if(_0x224323[_0x0ec5('0x31')]!==_0x0ec5('0x48')){var _0x2be526={};_0x2be526[_0x224323[_0x0ec5('0x33')]]={'$like':'%'+_0x4c40d1[_0x0ec5('0x3d')][_0x0ec5('0x2d')]+'%'};return _0x2be526;}})});}_0x252575=_[_0x0ec5('0x49')]({},_0x252575,_0x4c40d1[_0x0ec5('0x4a')]);var _0x240279={'where':_0x252575[_0x0ec5('0x47')]};return db[_0x0ec5('0x4b')][_0x0ec5('0x4c')](_0x240279)[_0x0ec5('0x25')](function(_0xf3eced){_0x83f4c5['count']=_0xf3eced;if(_0x4c40d1[_0x0ec5('0x3d')][_0x0ec5('0x4d')]){_0x252575['include']=[{'all':!![]}];}return db[_0x0ec5('0x4b')][_0x0ec5('0x4e')](_0x252575);})[_0x0ec5('0x25')](function(_0x3d22f5){_0x83f4c5['rows']=_0x3d22f5;return _0x83f4c5;})[_0x0ec5('0x25')](respondWithFilteredResult(_0x2f489d,_0x252575))['catch'](handleError(_0x2f489d,null));};exports[_0x0ec5('0x4f')]=function(_0x41833c,_0x37194e){var _0x13ac4c={'raw':![],'where':{'id':_0x41833c[_0x0ec5('0x50')]['id']}},_0x8e4d04={};_0x8e4d04['model']=_[_0x0ec5('0x3c')](db[_0x0ec5('0x4b')][_0x0ec5('0x38')]);_0x8e4d04['query']=_[_0x0ec5('0x3c')](_0x41833c[_0x0ec5('0x3d')]);_0x8e4d04[_0x0ec5('0x3e')]=_[_0x0ec5('0x3f')](_0x8e4d04[_0x0ec5('0x3b')],_0x8e4d04['query']);_0x13ac4c[_0x0ec5('0x40')]=_['intersection'](_0x8e4d04['model'],qs[_0x0ec5('0x41')](_0x41833c[_0x0ec5('0x3d')][_0x0ec5('0x41')]));_0x13ac4c[_0x0ec5('0x40')]=_0x13ac4c[_0x0ec5('0x40')][_0x0ec5('0x42')]?_0x13ac4c[_0x0ec5('0x40')]:_0x8e4d04[_0x0ec5('0x3b')];if(_0x41833c[_0x0ec5('0x3d')][_0x0ec5('0x4d')]){_0x13ac4c[_0x0ec5('0x51')]=[{'all':!![]}];}_0x13ac4c=_[_0x0ec5('0x49')]({},_0x13ac4c,_0x41833c[_0x0ec5('0x4a')]);return db[_0x0ec5('0x4b')][_0x0ec5('0x32')](_0x13ac4c)[_0x0ec5('0x25')](handleEntityNotFound(_0x37194e,null))[_0x0ec5('0x25')](respondWithResult(_0x37194e,null))['catch'](handleError(_0x37194e,null));};exports['destroy']=function(_0x23deea,_0x145955){return db[_0x0ec5('0x4b')][_0x0ec5('0x32')]({'where':{'id':_0x23deea[_0x0ec5('0x50')]['id']}})[_0x0ec5('0x25')](handleEntityNotFound(_0x145955,null))['then'](removeEntity(_0x145955,null))['catch'](handleError(_0x145955,null));};exports['create']=function(_0x475d95,_0x3c839f){if(_0x475d95[_0x0ec5('0x52')]['type']==='outbound'&&!_['startsWith'](_0x475d95[_0x0ec5('0x52')][_0x0ec5('0x53')],'_')){_0x475d95[_0x0ec5('0x52')]['exten']='_'[_0x0ec5('0x54')](_0x475d95['body']['exten']);}return db[_0x0ec5('0x4b')][_0x0ec5('0x55')](_0x475d95[_0x0ec5('0x52')],{'raw':![]})[_0x0ec5('0x25')](function(_0x1e1c1c){var _0x47669a=_0x475d95[_0x0ec5('0x56')][_0x0ec5('0x57')]({'plain':!![]});if(!_0x47669a)throw new Error(_0x0ec5('0x58'));if(_0x47669a[_0x0ec5('0x59')]==='user'){var _0x19c2f0=_0x1e1c1c[_0x0ec5('0x57')]({'plain':!![]});var _0x36b8a2=[{'name':_0x0ec5('0x27'),'value':_0x0ec5('0x28')},{'name':_0x0ec5('0x29'),'value':_0x0ec5('0x2a')},{'name':'InternalRoutes','value':_0x0ec5('0x2c')}];var _0x2021c8=_['find'](_0x36b8a2,[_0x0ec5('0x2f'),_0x19c2f0['type']])[_0x0ec5('0x33')];return db[_0x0ec5('0x5a')][_0x0ec5('0x32')]({'where':{'name':_0x2021c8,'userProfileId':_0x47669a['userProfileId']},'raw':!![]})[_0x0ec5('0x25')](function(_0x2cdaf9){if(_0x2cdaf9&&_0x2cdaf9[_0x0ec5('0x5b')]===0x0){return db[_0x0ec5('0x34')][_0x0ec5('0x55')]({'name':_0x19c2f0[_0x0ec5('0x33')],'resourceId':_0x19c2f0['id'],'type':_0x2cdaf9['name'],'sectionId':_0x2cdaf9['id']},{})[_0x0ec5('0x25')](function(){return _0x1e1c1c;});}else{return _0x1e1c1c;}})['catch'](function(_0x11adcc){logger[_0x0ec5('0x35')](_0x0ec5('0x5c'),_0x11adcc);throw _0x11adcc;});}return _0x1e1c1c;})['then'](respondWithResult(_0x3c839f,0xc9))[_0x0ec5('0x5d')](handleError(_0x3c839f,null));};exports['update']=function(_0xcc0eb1,_0x880299){if(_0xcc0eb1[_0x0ec5('0x52')]['id']){delete _0xcc0eb1[_0x0ec5('0x52')]['id'];}return db[_0x0ec5('0x4b')]['find']({'where':{'id':_0xcc0eb1['params']['id']}})[_0x0ec5('0x25')](handleEntityNotFound(_0x880299,null))[_0x0ec5('0x25')](function(_0x12b875){if(_0x12b875){return db[_0x0ec5('0x4b')][_0x0ec5('0x5e')](_[_0x0ec5('0x5f')](_0xcc0eb1[_0x0ec5('0x52')],['exten',_0x0ec5('0x60'),'description',_0x0ec5('0x61'),_0x0ec5('0x62'),'mandatoryDisposition']),{'where':{'context':_0x12b875['context'],'exten':_0x12b875[_0x0ec5('0x53')]},'individualHooks':!![]})['then'](function(_0x2ef819){return _0x2ef819;});}return null;})['then'](respondWithStatusCode(_0x880299,null))['catch'](handleError(_0x880299,null));};exports['addApplications']=function(_0x45919a,_0x4d10ac,_0x334f7d){return db[_0x0ec5('0x4b')][_0x0ec5('0x63')]({'where':{'id':_0x45919a[_0x0ec5('0x50')]['id']}})['then'](handleEntityNotFound(_0x4d10ac,null))[_0x0ec5('0x25')](function(_0x3c40ad){if(_0x3c40ad){return db[_0x0ec5('0x64')][_0x0ec5('0x65')](function(_0x3fce3f){return db[_0x0ec5('0x4b')][_0x0ec5('0x26')]({'where':{'VoiceExtensionId':_0x45919a[_0x0ec5('0x50')]['id']},'transaction':_0x3fce3f})[_0x0ec5('0x25')](function(_0x1aa33b){var _0xa80af2=_['map'](_0x45919a[_0x0ec5('0x52')],function(_0x4230c5){_0x4230c5[_0x0ec5('0x66')]=_0x45919a[_0x0ec5('0x50')]['id'];return _0x4230c5;});return db[_0x0ec5('0x4b')]['bulkCreate'](_0xa80af2,{'transaction':_0x3fce3f});});})[_0x0ec5('0x25')](function(){return db[_0x0ec5('0x4b')][_0x0ec5('0x67')]({'where':{'isApp':!![],'VoiceExtensionId':_0x45919a['params']['id']},'order':_0x0ec5('0x68')});});}})['then'](respondWithResult(_0x4d10ac,null))['catch'](handleError(_0x4d10ac,null));}; \ No newline at end of file +var _0xaee6=['status','end','count','set','json','save','update','then','destroy','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','filter','map','value','includes','type','find','name','UserProfileResource','sendStatus','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','limit','offset','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','startsWith','exten','user','OutboundRoutes','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','mandatoryDisposition','findOne','sequelize','transaction','bulkCreate','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register'];(function(_0x1c4b31,_0x33f926){var _0x429be1=function(_0x6826a6){while(--_0x6826a6){_0x1c4b31['push'](_0x1c4b31['shift']());}};_0x429be1(++_0x33f926);}(_0xaee6,0xb0));var _0x6aee=function(_0x18c255,_0x52c66b){_0x18c255=_0x18c255-0x0;var _0x534451=_0xaee6[_0x18c255];return _0x534451;};'use strict';var pdf=require(_0x6aee('0x0'));var emlformat=require(_0x6aee('0x1'));var rimraf=require(_0x6aee('0x2'));var zipdir=require(_0x6aee('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6aee('0x4'));var BPromise=require(_0x6aee('0x5'));var Mustache=require(_0x6aee('0x6'));var util=require(_0x6aee('0x7'));var path=require(_0x6aee('0x8'));var sox=require(_0x6aee('0x9'));var csv=require('to-csv');var ejs=require(_0x6aee('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6aee('0xb'));var crypto=require(_0x6aee('0xc'));var jsforce=require(_0x6aee('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6aee('0xe'));var querystring=require(_0x6aee('0xf'));var Papa=require(_0x6aee('0x10'));var Redis=require(_0x6aee('0x11'));var authService=require(_0x6aee('0x12'));var qs=require(_0x6aee('0x13'));var as=require(_0x6aee('0x14'));var hardwareService=require(_0x6aee('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x6aee('0x16'));var config=require('../../config/environment');var db=require(_0x6aee('0x17'))['db'];config['redis']=_[_0x6aee('0x18')](config[_0x6aee('0x19')],{'host':_0x6aee('0x1a'),'port':0x18eb});var socket=require(_0x6aee('0x1b'))(new Redis(config['redis']));require(_0x6aee('0x1c'))[_0x6aee('0x1d')](socket);function respondWithStatusCode(_0x349a0c,_0x3c9604){_0x3c9604=_0x3c9604||0xcc;return function(_0x481615){if(_0x481615){return _0x349a0c['sendStatus'](_0x3c9604);}return _0x349a0c[_0x6aee('0x1e')](_0x3c9604)[_0x6aee('0x1f')]();};}function respondWithResult(_0x5b8f6d,_0x4bd2cf){_0x4bd2cf=_0x4bd2cf||0xc8;return function(_0x34935d){if(_0x34935d){return _0x5b8f6d[_0x6aee('0x1e')](_0x4bd2cf)['json'](_0x34935d);}};}function respondWithFilteredResult(_0x24263d,_0x3c370d){return function(_0xc9d7eb){if(_0xc9d7eb){var _0x1fd84e=_0xc9d7eb[_0x6aee('0x20')],_0x1c78c6=_0x3c370d['offset'],_0x3e9bad=_0x3c370d['offset']+_0x3c370d['limit'],_0xe9428a;if(_0x3e9bad>=_0x1fd84e){_0x3e9bad=_0x1fd84e;_0xe9428a=0xc8;}else{_0xe9428a=0xce;}_0x24263d['status'](_0xe9428a);return _0x24263d[_0x6aee('0x21')]('Content-Range',_0x1c78c6+'-'+_0x3e9bad+'/'+_0x1fd84e)[_0x6aee('0x22')](_0xc9d7eb);}return null;};}function patchUpdates(_0x360876){return function(_0x1b04d3){try{jsonpatch['apply'](_0x1b04d3,_0x360876,!![]);}catch(_0x2091ec){return BPromise['reject'](_0x2091ec);}return _0x1b04d3[_0x6aee('0x23')]();};}function saveUpdates(_0x541179,_0x512681){return function(_0x308888){if(_0x308888){return _0x308888[_0x6aee('0x24')](_0x541179)[_0x6aee('0x25')](function(_0x561780){return _0x561780;});}return null;};}function removeEntity(_0xa26cc3,_0x4e03a3){return function(_0x28cc27){if(_0x28cc27){return _0x28cc27[_0x6aee('0x26')]()[_0x6aee('0x25')](function(){var _0x706aad=_0x28cc27[_0x6aee('0x27')]({'plain':!![]});var _0x395e45=[{'name':_0x6aee('0x28'),'value':_0x6aee('0x29'),'ignore':![]},{'name':'OutboundRoutes','value':_0x6aee('0x2a'),'ignore':![]},{'name':_0x6aee('0x2b'),'value':_0x6aee('0x2c'),'ignore':![]}];var _0x2eff8b=_(_0x395e45)[_0x6aee('0x2d')]('ignore')[_0x6aee('0x2e')](_0x6aee('0x2f'))[_0x6aee('0x2f')]();if(_[_0x6aee('0x30')](_0x2eff8b,_0x706aad[_0x6aee('0x31')])){return;}var _0x3f832e=_[_0x6aee('0x32')](_0x395e45,['value',_0x706aad['type']])[_0x6aee('0x33')];return db[_0x6aee('0x34')][_0x6aee('0x26')]({'where':{'type':_0x3f832e,'resourceId':_0x706aad['id']}})[_0x6aee('0x25')](function(){return _0x28cc27;});})['then'](function(){_0xa26cc3[_0x6aee('0x1e')](0xcc)[_0x6aee('0x1f')]();});}};}function handleEntityNotFound(_0x1a8948,_0x2647c0){return function(_0x5dbddf){if(!_0x5dbddf){_0x1a8948[_0x6aee('0x35')](0x194);}return _0x5dbddf;};}function handleError(_0x245911,_0x35a66d){_0x35a66d=_0x35a66d||0x1f4;return function(_0x56d1a4){logger[_0x6aee('0x36')](_0x56d1a4[_0x6aee('0x37')]);if(_0x56d1a4[_0x6aee('0x33')]){delete _0x56d1a4[_0x6aee('0x33')];}_0x245911['status'](_0x35a66d)[_0x6aee('0x38')](_0x56d1a4);};}exports[_0x6aee('0x39')]=function(_0x571b53,_0x3ca4d1){var _0x2d145b={},_0x462788={},_0x944a51={'count':0x0,'rows':[]};var _0x3929e3=_[_0x6aee('0x2e')](db[_0x6aee('0x3a')][_0x6aee('0x3b')],function(_0x24b74f){return{'name':_0x24b74f[_0x6aee('0x3c')],'type':_0x24b74f['type'][_0x6aee('0x3d')]};});_0x462788['model']=_[_0x6aee('0x2e')](_0x3929e3,'name');_0x462788[_0x6aee('0x3e')]=_[_0x6aee('0x3f')](_0x571b53[_0x6aee('0x3e')]);_0x462788[_0x6aee('0x40')]=_[_0x6aee('0x41')](_0x462788[_0x6aee('0x42')],_0x462788[_0x6aee('0x3e')]);_0x2d145b['attributes']=_['intersection'](_0x462788[_0x6aee('0x42')],qs[_0x6aee('0x43')](_0x571b53[_0x6aee('0x3e')][_0x6aee('0x43')]));_0x2d145b[_0x6aee('0x44')]=_0x2d145b[_0x6aee('0x44')][_0x6aee('0x45')]?_0x2d145b[_0x6aee('0x44')]:_0x462788['model'];if(!_0x571b53[_0x6aee('0x3e')]['hasOwnProperty'](_0x6aee('0x46'))){_0x2d145b[_0x6aee('0x47')]=qs[_0x6aee('0x47')](_0x571b53[_0x6aee('0x3e')][_0x6aee('0x47')]);_0x2d145b['offset']=qs['offset'](_0x571b53[_0x6aee('0x3e')][_0x6aee('0x48')]);}_0x2d145b[_0x6aee('0x49')]=qs[_0x6aee('0x4a')](_0x571b53[_0x6aee('0x3e')][_0x6aee('0x4a')]);_0x2d145b['where']=qs[_0x6aee('0x40')](_[_0x6aee('0x4b')](_0x571b53[_0x6aee('0x3e')],_0x462788[_0x6aee('0x40')]));if(_0x571b53[_0x6aee('0x3e')][_0x6aee('0x2d')]){_0x2d145b[_0x6aee('0x4c')]=_[_0x6aee('0x4d')](_0x2d145b[_0x6aee('0x4c')],{'$or':_['map'](_0x3929e3,function(_0x32fbe6){if(_0x32fbe6['type']!==_0x6aee('0x4e')){var _0x2a01bc={};_0x2a01bc[_0x32fbe6[_0x6aee('0x33')]]={'$like':'%'+_0x571b53[_0x6aee('0x3e')][_0x6aee('0x2d')]+'%'};return _0x2a01bc;}})});}_0x2d145b=_['merge']({},_0x2d145b,_0x571b53[_0x6aee('0x4f')]);var _0x41beea={'where':_0x2d145b[_0x6aee('0x4c')]};return db[_0x6aee('0x3a')]['count'](_0x41beea)[_0x6aee('0x25')](function(_0xfbdfb8){_0x944a51[_0x6aee('0x20')]=_0xfbdfb8;if(_0x571b53[_0x6aee('0x3e')][_0x6aee('0x50')]){_0x2d145b[_0x6aee('0x51')]=[{'all':!![]}];}return db['VoiceExtension'][_0x6aee('0x52')](_0x2d145b);})[_0x6aee('0x25')](function(_0x54478e){_0x944a51[_0x6aee('0x53')]=_0x54478e;return _0x944a51;})[_0x6aee('0x25')](respondWithFilteredResult(_0x3ca4d1,_0x2d145b))[_0x6aee('0x54')](handleError(_0x3ca4d1,null));};exports[_0x6aee('0x55')]=function(_0x31b06c,_0x164242){var _0xca54cb={'raw':![],'where':{'id':_0x31b06c['params']['id']}},_0x186638={};_0x186638['model']=_[_0x6aee('0x3f')](db[_0x6aee('0x3a')][_0x6aee('0x3b')]);_0x186638[_0x6aee('0x3e')]=_[_0x6aee('0x3f')](_0x31b06c['query']);_0x186638[_0x6aee('0x40')]=_[_0x6aee('0x41')](_0x186638['model'],_0x186638[_0x6aee('0x3e')]);_0xca54cb[_0x6aee('0x44')]=_[_0x6aee('0x41')](_0x186638[_0x6aee('0x42')],qs['fields'](_0x31b06c['query'][_0x6aee('0x43')]));_0xca54cb[_0x6aee('0x44')]=_0xca54cb['attributes'][_0x6aee('0x45')]?_0xca54cb[_0x6aee('0x44')]:_0x186638[_0x6aee('0x42')];if(_0x31b06c[_0x6aee('0x3e')][_0x6aee('0x50')]){_0xca54cb[_0x6aee('0x51')]=[{'all':!![]}];}_0xca54cb=_['merge']({},_0xca54cb,_0x31b06c[_0x6aee('0x4f')]);return db[_0x6aee('0x3a')][_0x6aee('0x32')](_0xca54cb)[_0x6aee('0x25')](handleEntityNotFound(_0x164242,null))['then'](respondWithResult(_0x164242,null))[_0x6aee('0x54')](handleError(_0x164242,null));};exports[_0x6aee('0x26')]=function(_0x2593e6,_0x2d9d05){return db[_0x6aee('0x3a')][_0x6aee('0x32')]({'where':{'id':_0x2593e6[_0x6aee('0x56')]['id']}})[_0x6aee('0x25')](handleEntityNotFound(_0x2d9d05,null))['then'](removeEntity(_0x2d9d05,null))[_0x6aee('0x54')](handleError(_0x2d9d05,null));};exports[_0x6aee('0x57')]=function(_0x5b04cb,_0x2d6ed5){if(_0x5b04cb[_0x6aee('0x58')][_0x6aee('0x31')]===_0x6aee('0x2a')&&!_[_0x6aee('0x59')](_0x5b04cb[_0x6aee('0x58')][_0x6aee('0x5a')],'_')){_0x5b04cb['body'][_0x6aee('0x5a')]='_'['concat'](_0x5b04cb[_0x6aee('0x58')][_0x6aee('0x5a')]);}return db['VoiceExtension'][_0x6aee('0x57')](_0x5b04cb[_0x6aee('0x58')],{'raw':![]})['then'](function(_0x5e81b5){var _0x45c870=_0x5b04cb[_0x6aee('0x5b')]['get']({'plain':!![]});if(!_0x45c870)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45c870['role']==='user'){var _0x5e2a80=_0x5e81b5[_0x6aee('0x27')]({'plain':!![]});var _0x320486=[{'name':_0x6aee('0x28'),'value':_0x6aee('0x29')},{'name':_0x6aee('0x5c'),'value':_0x6aee('0x2a')},{'name':_0x6aee('0x2b'),'value':_0x6aee('0x2c')}];var _0x309e60=_[_0x6aee('0x32')](_0x320486,[_0x6aee('0x2f'),_0x5e2a80[_0x6aee('0x31')]])['name'];return db[_0x6aee('0x5d')][_0x6aee('0x32')]({'where':{'name':_0x309e60,'userProfileId':_0x45c870['userProfileId']},'raw':!![]})[_0x6aee('0x25')](function(_0xe8c4cf){if(_0xe8c4cf&&_0xe8c4cf['autoAssociation']===0x0){return db[_0x6aee('0x34')][_0x6aee('0x57')]({'name':_0x5e2a80['name'],'resourceId':_0x5e2a80['id'],'type':_0xe8c4cf['name'],'sectionId':_0xe8c4cf['id']},{})['then'](function(){return _0x5e81b5;});}else{return _0x5e81b5;}})[_0x6aee('0x54')](function(_0x5da807){logger[_0x6aee('0x36')](_0x6aee('0x5e'),_0x5da807);throw _0x5da807;});}return _0x5e81b5;})[_0x6aee('0x25')](respondWithResult(_0x2d6ed5,0xc9))[_0x6aee('0x54')](handleError(_0x2d6ed5,null));};exports[_0x6aee('0x24')]=function(_0xe3af4c,_0x20900c){if(_0xe3af4c['body']['id']){delete _0xe3af4c[_0x6aee('0x58')]['id'];}return db[_0x6aee('0x3a')][_0x6aee('0x32')]({'where':{'id':_0xe3af4c[_0x6aee('0x56')]['id']}})[_0x6aee('0x25')](handleEntityNotFound(_0x20900c,null))['then'](function(_0xb58906){if(_0xb58906){return db['VoiceExtension'][_0x6aee('0x24')](_[_0x6aee('0x4b')](_0xe3af4c[_0x6aee('0x58')],[_0x6aee('0x5a'),_0x6aee('0x5f'),_0x6aee('0x60'),'recordingFormat','cutdigits',_0x6aee('0x61')]),{'where':{'context':_0xb58906[_0x6aee('0x5f')],'exten':_0xb58906[_0x6aee('0x5a')]},'individualHooks':!![]})[_0x6aee('0x25')](function(_0x239e8e){return _0x239e8e;});}return null;})[_0x6aee('0x25')](respondWithStatusCode(_0x20900c,null))[_0x6aee('0x54')](handleError(_0x20900c,null));};exports['addApplications']=function(_0x4a2b21,_0x269b75,_0x28baf3){return db[_0x6aee('0x3a')][_0x6aee('0x62')]({'where':{'id':_0x4a2b21['params']['id']}})['then'](handleEntityNotFound(_0x269b75,null))[_0x6aee('0x25')](function(_0xfcb511){if(_0xfcb511){return db[_0x6aee('0x63')][_0x6aee('0x64')](function(_0x23491a){return db[_0x6aee('0x3a')][_0x6aee('0x26')]({'where':{'VoiceExtensionId':_0x4a2b21[_0x6aee('0x56')]['id']},'transaction':_0x23491a})[_0x6aee('0x25')](function(_0x45b4ca){var _0x16eb9e=_[_0x6aee('0x2e')](_0x4a2b21[_0x6aee('0x58')],function(_0x131c1b){_0x131c1b['VoiceExtensionId']=_0x4a2b21[_0x6aee('0x56')]['id'];return _0x131c1b;});return db['VoiceExtension'][_0x6aee('0x65')](_0x16eb9e,{'transaction':_0x23491a});});})['then'](function(){return db[_0x6aee('0x3a')][_0x6aee('0x66')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4a2b21['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x6aee('0x25')](respondWithResult(_0x269b75,null))[_0x6aee('0x54')](handleError(_0x269b75,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 0c3a131..d5b2f4b 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 _0xadd1=['hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','update','remove','emit'];(function(_0x1004a4,_0x3fcc17){var _0x27cbd0=function(_0x10dfbd){while(--_0x10dfbd){_0x1004a4['push'](_0x1004a4['shift']());}};_0x27cbd0(++_0x3fcc17);}(_0xadd1,0x198));var _0x1add=function(_0x58bec5,_0x301341){_0x58bec5=_0x58bec5-0x0;var _0xb9a75d=_0xadd1[_0x58bec5];return _0xb9a75d;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x1add('0x0'))['db'][_0x1add('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x1add('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1add('0x3'),'afterDestroy':_0x1add('0x4')};function emitEvent(_0x371193){return function(_0x29a662,_0x43dbe8,_0x526482){VoiceExtensionEvents[_0x1add('0x5')](_0x371193+':'+_0x29a662['id'],_0x29a662);VoiceExtensionEvents[_0x1add('0x5')](_0x371193,_0x29a662);_0x526482(null);};}for(var e in events){if(events[_0x1add('0x6')](e)){var event=events[e];VoiceExtension[_0x1add('0x7')](e,emitEvent(event));}}module[_0x1add('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x0056=['hook','exports','VoiceExtension','setMaxListeners','update','remove','emit'];(function(_0x440723,_0x411fec){var _0xb3cc53=function(_0xe41e8e){while(--_0xe41e8e){_0x440723['push'](_0x440723['shift']());}};_0xb3cc53(++_0x411fec);}(_0x0056,0xdb));var _0x6005=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0x0056[_0x3acee8];return _0x5046cc;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x6005('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6005('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6005('0x2'),'afterDestroy':_0x6005('0x3')};function emitEvent(_0x184e38){return function(_0x3e090,_0x56209f,_0x4fe505){VoiceExtensionEvents['emit'](_0x184e38+':'+_0x3e090['id'],_0x3e090);VoiceExtensionEvents[_0x6005('0x4')](_0x184e38,_0x3e090);_0x4fe505(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x6005('0x5')](e,emitEvent(event));}}module[_0x6005('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 284d9f6..214534b 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 _0xb2ba=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','VoiceExtension','voice_extensions','lodash'];(function(_0x163b13,_0x4ccd8a){var _0x388cde=function(_0x5f4218){while(--_0x5f4218){_0x163b13['push'](_0x163b13['shift']());}};_0x388cde(++_0x4ccd8a);}(_0xb2ba,0x11d));var _0xab2b=function(_0x1cba93,_0x2d40b6){_0x1cba93=_0x1cba93-0x0;var _0x10b035=_0xb2ba[_0x1cba93];return _0x10b035;};'use strict';var _=require(_0xab2b('0x0'));var util=require(_0xab2b('0x1'));var logger=require(_0xab2b('0x2'))(_0xab2b('0x3'));var moment=require(_0xab2b('0x4'));var BPromise=require(_0xab2b('0x5'));var rp=require(_0xab2b('0x6'));var fs=require('fs');var path=require(_0xab2b('0x7'));var rimraf=require(_0xab2b('0x8'));var config=require(_0xab2b('0x9'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x4d3008,_0x6e0ddd){return _0x4d3008[_0xab2b('0xa')](_0xab2b('0xb'),attributes,{'tableName':_0xab2b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6ae=['path','rimraf','./voiceExtension.attributes','exports','VoiceExtension','voice_extensions','lodash','util','api','moment','bluebird','request-promise'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xb6ae,0x1e6));var _0xeb6a=function(_0x9c3c56,_0x169b56){_0x9c3c56=_0x9c3c56-0x0;var _0x2dd782=_0xb6ae[_0x9c3c56];return _0x2dd782;};'use strict';var _=require(_0xeb6a('0x0'));var util=require(_0xeb6a('0x1'));var logger=require('../../config/logger')(_0xeb6a('0x2'));var moment=require(_0xeb6a('0x3'));var BPromise=require(_0xeb6a('0x4'));var rp=require(_0xeb6a('0x5'));var fs=require('fs');var path=require(_0xeb6a('0x6'));var rimraf=require(_0xeb6a('0x7'));var config=require('../../config/environment');var attributes=require(_0xeb6a('0x8'));module[_0xeb6a('0x9')]=function(_0xfc5f56,_0x3e53a2){return _0xfc5f56['define'](_0xeb6a('0xa'),attributes,{'tableName':_0xeb6a('0xb'),'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 9b0c62c..abe72fa 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 _0xaeb9=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','map','include','model','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x141b95,_0x49c966){var _0x34548f=function(_0x48bbdc){while(--_0x48bbdc){_0x141b95['push'](_0x141b95['shift']());}};_0x34548f(++_0x49c966);}(_0xaeb9,0x141));var _0x9aeb=function(_0x5b0796,_0x2ac786){_0x5b0796=_0x5b0796-0x0;var _0x3f764f=_0xaeb9[_0x5b0796];return _0x3f764f;};'use strict';var _=require(_0x9aeb('0x0'));var util=require(_0x9aeb('0x1'));var moment=require(_0x9aeb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9aeb('0x3'));var db=require(_0x9aeb('0x4'))['db'];var utils=require(_0x9aeb('0x5'));var logger=require(_0x9aeb('0x6'))(_0x9aeb('0x7'));var config=require(_0x9aeb('0x8'));var jayson=require(_0x9aeb('0x9'));var client=jayson[_0x9aeb('0xa')][_0x9aeb('0xb')]({'port':0x232a});config[_0x9aeb('0xc')]=_[_0x9aeb('0xd')](config['redis'],{'host':_0x9aeb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9aeb('0xc')]));require(_0x9aeb('0xf'))[_0x9aeb('0x10')](socket);function respondWithRpcPromise(_0x2a983f,_0x17788a,_0x53fad7){return new BPromise(function(_0x4cbe5a,_0xa4a88f){return client[_0x9aeb('0x11')](_0x2a983f,_0x53fad7)[_0x9aeb('0x12')](function(_0x372c13){logger[_0x9aeb('0x13')](_0x9aeb('0x14'),_0x17788a,'request\x20sent');logger[_0x9aeb('0x15')](_0x9aeb('0x16'),_0x17788a,_0x9aeb('0x17'),JSON[_0x9aeb('0x18')](_0x372c13));if(_0x372c13[_0x9aeb('0x19')]){if(_0x372c13[_0x9aeb('0x19')][_0x9aeb('0x1a')]===0x1f4){logger[_0x9aeb('0x19')]('VoiceExtension,\x20%s,\x20%s',_0x17788a,_0x372c13[_0x9aeb('0x19')][_0x9aeb('0x1b')]);return _0xa4a88f(_0x372c13[_0x9aeb('0x19')]['message']);}logger[_0x9aeb('0x19')](_0x9aeb('0x14'),_0x17788a,_0x372c13[_0x9aeb('0x19')][_0x9aeb('0x1b')]);return _0x4cbe5a(_0x372c13[_0x9aeb('0x19')]['message']);}else{logger[_0x9aeb('0x13')](_0x9aeb('0x14'),_0x17788a,_0x9aeb('0x17'));_0x4cbe5a(_0x372c13[_0x9aeb('0x1c')][_0x9aeb('0x1b')]);}})[_0x9aeb('0x1d')](function(_0x47477d){logger['error'](_0x9aeb('0x14'),_0x17788a,_0x47477d);_0xa4a88f(_0x47477d);});});}exports[_0x9aeb('0x1e')]=function(_0x2cf4c3){var _0x4048a8=this;return new Promise(function(_0x1d8c36,_0x347456){return db[_0x9aeb('0x1f')][_0x9aeb('0x20')]({'raw':_0x2cf4c3[_0x9aeb('0x21')]?_0x2cf4c3[_0x9aeb('0x21')][_0x9aeb('0x22')]===undefined?!![]:![]:!![],'where':_0x2cf4c3[_0x9aeb('0x21')]?_0x2cf4c3[_0x9aeb('0x21')][_0x9aeb('0x23')]||null:null,'attributes':_0x2cf4c3[_0x9aeb('0x21')]?_0x2cf4c3[_0x9aeb('0x21')][_0x9aeb('0x24')]||null:null,'limit':_0x2cf4c3[_0x9aeb('0x21')]?_0x2cf4c3[_0x9aeb('0x21')][_0x9aeb('0x25')]||null:null,'include':_0x2cf4c3[_0x9aeb('0x21')]?_0x2cf4c3[_0x9aeb('0x21')]['include']?_[_0x9aeb('0x26')](_0x2cf4c3[_0x9aeb('0x21')][_0x9aeb('0x27')],function(_0x5bfc64){return{'model':db[_0x5bfc64[_0x9aeb('0x28')]],'as':_0x5bfc64['as'],'attributes':_0x5bfc64[_0x9aeb('0x24')],'include':_0x5bfc64['include']?_[_0x9aeb('0x26')](_0x5bfc64[_0x9aeb('0x27')],function(_0x5b557f){return{'model':db[_0x5b557f['model']],'as':_0x5b557f['as'],'attributes':_0x5b557f[_0x9aeb('0x24')],'include':_0x5b557f[_0x9aeb('0x27')]?_['map'](_0x5b557f[_0x9aeb('0x27')],function(_0x341917){return{'model':db[_0x341917['model']],'as':_0x341917['as'],'attributes':_0x341917[_0x9aeb('0x24')]};}):[]};}):[]};}):[]:[]})[_0x9aeb('0x12')](function(_0x5c7a3a){logger[_0x9aeb('0x13')]('GetVoiceExtension',_0x2cf4c3);logger[_0x9aeb('0x15')](_0x9aeb('0x1e'),_0x2cf4c3,JSON[_0x9aeb('0x18')](_0x5c7a3a));_0x1d8c36(_0x5c7a3a);})[_0x9aeb('0x1d')](function(_0x3fb0a7){logger[_0x9aeb('0x19')](_0x9aeb('0x1e'),_0x3fb0a7[_0x9aeb('0x1b')],_0x2cf4c3);_0x347456(_0x4048a8[_0x9aeb('0x19')](0x1f4,_0x3fb0a7[_0x9aeb('0x1b')]));});});}; \ No newline at end of file +var _0xc462=['GetVoiceExtension','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./voiceExtension.socket','request','then','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x3bbfce,_0xf56a00){var _0x4bdbe4=function(_0x1ee8e1){while(--_0x1ee8e1){_0x3bbfce['push'](_0x3bbfce['shift']());}};_0x4bdbe4(++_0xf56a00);}(_0xc462,0x91));var _0x2c46=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc462[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x2c46('0x0'));var util=require(_0x2c46('0x1'));var moment=require('moment');var BPromise=require(_0x2c46('0x2'));var rs=require(_0x2c46('0x3'));var fs=require('fs');var Redis=require(_0x2c46('0x4'));var db=require(_0x2c46('0x5'))['db'];var utils=require(_0x2c46('0x6'));var logger=require('../../config/logger')(_0x2c46('0x7'));var config=require(_0x2c46('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2c46('0x9')]['http']({'port':0x232a});config[_0x2c46('0xa')]=_['defaults'](config[_0x2c46('0xa')],{'host':_0x2c46('0xb'),'port':0x18eb});var socket=require(_0x2c46('0xc'))(new Redis(config[_0x2c46('0xa')]));require(_0x2c46('0xd'))['register'](socket);function respondWithRpcPromise(_0x253a3d,_0x1734c5,_0xe78665){return new BPromise(function(_0x361bfa,_0x3233bf){return client[_0x2c46('0xe')](_0x253a3d,_0xe78665)[_0x2c46('0xf')](function(_0x143ffd){logger['info'](_0x2c46('0x10'),_0x1734c5,'request\x20sent');logger[_0x2c46('0x11')](_0x2c46('0x12'),_0x1734c5,_0x2c46('0x13'),JSON[_0x2c46('0x14')](_0x143ffd));if(_0x143ffd['error']){if(_0x143ffd['error']['code']===0x1f4){logger[_0x2c46('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x1734c5,_0x143ffd[_0x2c46('0x15')][_0x2c46('0x16')]);return _0x3233bf(_0x143ffd[_0x2c46('0x15')][_0x2c46('0x16')]);}logger[_0x2c46('0x15')](_0x2c46('0x10'),_0x1734c5,_0x143ffd['error'][_0x2c46('0x16')]);return _0x361bfa(_0x143ffd['error'][_0x2c46('0x16')]);}else{logger[_0x2c46('0x17')](_0x2c46('0x10'),_0x1734c5,'request\x20sent');_0x361bfa(_0x143ffd[_0x2c46('0x18')][_0x2c46('0x16')]);}})[_0x2c46('0x19')](function(_0x3eb885){logger[_0x2c46('0x15')](_0x2c46('0x10'),_0x1734c5,_0x3eb885);_0x3233bf(_0x3eb885);});});}exports['GetVoiceExtension']=function(_0x48becb){var _0x1a77b3=this;return new Promise(function(_0x2249ba,_0x21c25b){return db['VoiceExtension'][_0x2c46('0x1a')]({'raw':_0x48becb[_0x2c46('0x1b')]?_0x48becb[_0x2c46('0x1b')][_0x2c46('0x1c')]===undefined?!![]:![]:!![],'where':_0x48becb[_0x2c46('0x1b')]?_0x48becb[_0x2c46('0x1b')][_0x2c46('0x1d')]||null:null,'attributes':_0x48becb['options']?_0x48becb[_0x2c46('0x1b')][_0x2c46('0x1e')]||null:null,'limit':_0x48becb['options']?_0x48becb['options'][_0x2c46('0x1f')]||null:null,'include':_0x48becb[_0x2c46('0x1b')]?_0x48becb[_0x2c46('0x1b')][_0x2c46('0x20')]?_[_0x2c46('0x21')](_0x48becb[_0x2c46('0x1b')][_0x2c46('0x20')],function(_0x1e90c4){return{'model':db[_0x1e90c4['model']],'as':_0x1e90c4['as'],'attributes':_0x1e90c4[_0x2c46('0x1e')],'include':_0x1e90c4['include']?_[_0x2c46('0x21')](_0x1e90c4[_0x2c46('0x20')],function(_0x59f176){return{'model':db[_0x59f176['model']],'as':_0x59f176['as'],'attributes':_0x59f176[_0x2c46('0x1e')],'include':_0x59f176['include']?_[_0x2c46('0x21')](_0x59f176[_0x2c46('0x20')],function(_0x504ab0){return{'model':db[_0x504ab0[_0x2c46('0x22')]],'as':_0x504ab0['as'],'attributes':_0x504ab0[_0x2c46('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2c46('0xf')](function(_0x31de10){logger[_0x2c46('0x17')]('GetVoiceExtension',_0x48becb);logger['debug']('GetVoiceExtension',_0x48becb,JSON[_0x2c46('0x14')](_0x31de10));_0x2249ba(_0x31de10);})['catch'](function(_0x461cdb){logger[_0x2c46('0x15')](_0x2c46('0x23'),_0x461cdb[_0x2c46('0x16')],_0x48becb);_0x21c25b(_0x1a77b3[_0x2c46('0x15')](0x1f4,_0x461cdb[_0x2c46('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 24c0099..3a68201 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 _0x3e46=['voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener','length'];(function(_0x2dcd76,_0x121c9d){var _0x197efa=function(_0x17719f){while(--_0x17719f){_0x2dcd76['push'](_0x2dcd76['shift']());}};_0x197efa(++_0x121c9d);}(_0x3e46,0x151));var _0x63e4=function(_0x430294,_0x44a4fb){_0x430294=_0x430294-0x0;var _0x40c240=_0x3e46[_0x430294];return _0x40c240;};'use strict';var VoiceExtensionEvents=require(_0x63e4('0x0'));var events=[_0x63e4('0x1'),_0x63e4('0x2'),_0x63e4('0x3')];function createListener(_0x4dcc3a,_0x1cbda3){return function(_0x54477c){_0x1cbda3[_0x63e4('0x4')](_0x4dcc3a,_0x54477c);};}function removeListener(_0x977c72,_0x48e4cd){return function(){VoiceExtensionEvents[_0x63e4('0x5')](_0x977c72,_0x48e4cd);};}exports['register']=function(_0x313684){for(var _0x2cb258=0x0,_0x53ca80=events[_0x63e4('0x6')];_0x2cb258<_0x53ca80;_0x2cb258++){var _0x447730=events[_0x2cb258];var _0x4caab6=createListener(_0x63e4('0x7')+_0x447730,_0x313684);VoiceExtensionEvents['on'](_0x447730,_0x4caab6);}}; \ No newline at end of file +var _0x1477=['emit','removeListener','length','voiceExtension:','./voiceExtension.events','save','remove','update'];(function(_0x1bee8c,_0x41456d){var _0x35d809=function(_0x23876f){while(--_0x23876f){_0x1bee8c['push'](_0x1bee8c['shift']());}};_0x35d809(++_0x41456d);}(_0x1477,0x7c));var _0x7147=function(_0x5851c0,_0x2848bb){_0x5851c0=_0x5851c0-0x0;var _0x3f3a50=_0x1477[_0x5851c0];return _0x3f3a50;};'use strict';var VoiceExtensionEvents=require(_0x7147('0x0'));var events=[_0x7147('0x1'),_0x7147('0x2'),_0x7147('0x3')];function createListener(_0x3f65a9,_0x55adf7){return function(_0x24d397){_0x55adf7[_0x7147('0x4')](_0x3f65a9,_0x24d397);};}function removeListener(_0x310659,_0x4b9703){return function(){VoiceExtensionEvents[_0x7147('0x5')](_0x310659,_0x4b9703);};}exports['register']=function(_0x383d02){for(var _0x2abe9e=0x0,_0x4b99e3=events[_0x7147('0x6')];_0x2abe9e<_0x4b99e3;_0x2abe9e++){var _0x403785=events[_0x2abe9e];var _0x9423=createListener(_0x7147('0x7')+_0x403785,_0x383d02);VoiceExtensionEvents['on'](_0x403785,_0x9423);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index a5a27f9..182a4f3 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 _0x19c0=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','/:id','show','/:id/messages','getMessages','post','create','put'];(function(_0x5b740b,_0x381833){var _0x6f8f4e=function(_0x86d068){while(--_0x86d068){_0x5b740b['push'](_0x5b740b['shift']());}};_0x6f8f4e(++_0x381833);}(_0x19c0,0x1e6));var _0x019c=function(_0x3ebf99,_0x347f0b){_0x3ebf99=_0x3ebf99-0x0;var _0x472bcb=_0x19c0[_0x3ebf99];return _0x472bcb;};'use strict';var multer=require(_0x019c('0x0'));var util=require(_0x019c('0x1'));var path=require(_0x019c('0x2'));var timeout=require(_0x019c('0x3'));var express=require(_0x019c('0x4'));var router=express[_0x019c('0x5')]();var auth=require(_0x019c('0x6'));var interaction=require(_0x019c('0x7'));var config=require('../../config/environment');var controller=require(_0x019c('0x8'));router[_0x019c('0x9')]('/',auth[_0x019c('0xa')](),controller['index']);router[_0x019c('0x9')](_0x019c('0xb'),auth['isAuthenticated'](),controller[_0x019c('0xc')]);router[_0x019c('0x9')](_0x019c('0xd'),auth[_0x019c('0xa')](),controller[_0x019c('0xe')]);router[_0x019c('0xf')]('/',auth[_0x019c('0xa')](),controller[_0x019c('0x10')]);router[_0x019c('0x11')](_0x019c('0xb'),auth['isAuthenticated'](),controller[_0x019c('0x12')]);router[_0x019c('0x13')]('/:id',auth[_0x019c('0xa')](),controller[_0x019c('0x14')]);module['exports']=router; \ No newline at end of file +var _0x4962=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','isAuthenticated','show','create','/:id','delete','destroy','exports','multer'];(function(_0x41642e,_0x97f901){var _0x39ec15=function(_0x2056b9){while(--_0x2056b9){_0x41642e['push'](_0x41642e['shift']());}};_0x39ec15(++_0x97f901);}(_0x4962,0xfe));var _0x2496=function(_0x1aac1d,_0x1dca6c){_0x1aac1d=_0x1aac1d-0x0;var _0x140f0d=_0x4962[_0x1aac1d];return _0x140f0d;};'use strict';var multer=require(_0x2496('0x0'));var util=require('util');var path=require(_0x2496('0x1'));var timeout=require(_0x2496('0x2'));var express=require(_0x2496('0x3'));var router=express[_0x2496('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2496('0x5'));var config=require(_0x2496('0x6'));var controller=require(_0x2496('0x7'));router[_0x2496('0x8')]('/',auth['isAuthenticated'](),controller[_0x2496('0x9')]);router['get']('/:id',auth[_0x2496('0xa')](),controller[_0x2496('0xb')]);router[_0x2496('0x8')]('/:id/messages',auth[_0x2496('0xa')](),controller['getMessages']);router['post']('/',auth[_0x2496('0xa')](),controller[_0x2496('0xc')]);router['put'](_0x2496('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x2496('0xe')](_0x2496('0xd'),auth['isAuthenticated'](),controller[_0x2496('0xf')]);module[_0x2496('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 139aa0c..9154521 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 _0x757a=['email','string','trim','central','ENUM','yes','TIMESTAMP','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','contest_mailbox'];(function(_0x5959ca,_0x144649){var _0x5a10d3=function(_0x3300ce){while(--_0x3300ce){_0x5959ca['push'](_0x5959ca['shift']());}};_0x5a10d3(++_0x144649);}(_0x757a,0xde));var _0xa757=function(_0x102117,_0x3345b9){_0x102117=_0x102117-0x0;var _0xc56a03=_0x757a[_0x102117];return _0xc56a03;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'customer_id':{'type':Sequelize[_0xa757('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xa757('0x1')],'defaultValue':'','allowNull':![],'unique':_0xa757('0x2')},'password':{'type':Sequelize[_0xa757('0x1')]},'fullname':{'type':Sequelize[_0xa757('0x1')]},'email':{'type':Sequelize[_0xa757('0x1')],'validate':{'isEmail':!![]},'set':function(_0x3caeb0){this['setDataValue'](_0xa757('0x3'),typeof _0x3caeb0===_0xa757('0x4')&&_0x3caeb0['trim']()?_0x3caeb0[_0xa757('0x5')]():null);}},'pager':{'type':Sequelize[_0xa757('0x1')]},'tz':{'type':Sequelize[_0xa757('0x1')],'defaultValue':_0xa757('0x6')},'attach':{'type':Sequelize[_0xa757('0x7')]('yes','no'),'defaultValue':_0xa757('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xa757('0x7')](_0xa757('0x8'),'no'),'defaultValue':_0xa757('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xa757('0x1')]},'callback':{'type':Sequelize[_0xa757('0x1')]},'review':{'type':Sequelize[_0xa757('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xa757('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xa757('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xa757('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xa757('0x7')](_0xa757('0x8'),'no'),'defaultValue':_0xa757('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0xa757('0x7')](_0xa757('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xa757('0x7')](_0xa757('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xa757('0x7')](_0xa757('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xa757('0x9')},'emailsubject':{'type':Sequelize[_0xa757('0x1')]},'emailbody':{'type':Sequelize[_0xa757('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xa757('0xa')],'get':function(){return this[_0xa757('0xb')](_0xa757('0xc'))+_0xa757('0xd')+this[_0xa757('0xb')](_0xa757('0xe'));}}}; \ No newline at end of file +var _0x13f6=['getDataValue','fullname','\x20-\x20','sequelize','exports','from-voicemail','contest_mailbox','STRING','setDataValue','email','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x385fd3,_0x3680b6){var _0x27c543=function(_0x3610cc){while(--_0x3610cc){_0x385fd3['push'](_0x385fd3['shift']());}};_0x27c543(++_0x3680b6);}(_0x13f6,0x124));var _0x613f=function(_0x1298c6,_0x31ab9a){_0x1298c6=_0x1298c6-0x0;var _0xffe910=_0x13f6[_0x1298c6];return _0xffe910;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x613f('0x2'),'unique':_0x613f('0x3')},'mailbox':{'type':Sequelize[_0x613f('0x4')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x613f('0x4')]},'fullname':{'type':Sequelize[_0x613f('0x4')]},'email':{'type':Sequelize[_0x613f('0x4')],'validate':{'isEmail':!![]},'set':function(_0x5c9aa9){this[_0x613f('0x5')](_0x613f('0x6'),typeof _0x5c9aa9==='string'&&_0x5c9aa9['trim']()?_0x5c9aa9['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x613f('0x4')],'defaultValue':_0x613f('0x7')},'attach':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':_0x613f('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x613f('0x4')]},'review':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x613f('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x613f('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':_0x613f('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x613f('0x8')](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x613f('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x613f('0x9'),'allowNull':![]},'stamp':{'type':_0x613f('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x613f('0x4')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x613f('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x613f('0xd')],'get':function(){return this[_0x613f('0xe')](_0x613f('0xf'))+_0x613f('0x10')+this[_0x613f('0xe')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index a55b642..d8f3ba4 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 _0x77a4=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','pick','mailbox','VoiceMailMessage','html-pdf','eml-format','rimraf','request-promise','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','apply','reject','update','destroy','Voicemails','then','sendStatus','stack','name','send','map','VoiceMail','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','includeAll','findAll','catch','show','params','find','create','body','user'];(function(_0x368767,_0x344c2b){var _0x12912d=function(_0x17e64f){while(--_0x17e64f){_0x368767['push'](_0x368767['shift']());}};_0x12912d(++_0x344c2b);}(_0x77a4,0x155));var _0x477a=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0x77a4[_0x421263];return _0x34e4b5;};'use strict';var pdf=require(_0x477a('0x0'));var emlformat=require(_0x477a('0x1'));var rimraf=require(_0x477a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x477a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x477a('0x4'));var util=require(_0x477a('0x5'));var path=require('path');var sox=require(_0x477a('0x6'));var csv=require('to-csv');var ejs=require(_0x477a('0x7'));var fs=require('fs');var _=require(_0x477a('0x8'));var squel=require(_0x477a('0x9'));var crypto=require(_0x477a('0xa'));var jsforce=require(_0x477a('0xb'));var deskjs=require(_0x477a('0xc'));var toCsv=require(_0x477a('0xd'));var querystring=require(_0x477a('0xe'));var Papa=require('papaparse');var Redis=require(_0x477a('0xf'));var authService=require(_0x477a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x477a('0x11'));var hardwareService=require(_0x477a('0x12'));var logger=require(_0x477a('0x13'))(_0x477a('0x14'));var utils=require(_0x477a('0x15'));var config=require(_0x477a('0x16'));var db=require(_0x477a('0x17'))['db'];function respondWithStatusCode(_0x3290b5,_0x1d43da){_0x1d43da=_0x1d43da||0xcc;return function(_0x9f501c){if(_0x9f501c){return _0x3290b5['sendStatus'](_0x1d43da);}return _0x3290b5[_0x477a('0x18')](_0x1d43da)[_0x477a('0x19')]();};}function respondWithResult(_0x5b83e0,_0x55db6e){_0x55db6e=_0x55db6e||0xc8;return function(_0x2eac09){if(_0x2eac09){return _0x5b83e0[_0x477a('0x18')](_0x55db6e)[_0x477a('0x1a')](_0x2eac09);}};}function respondWithFilteredResult(_0x415dc6,_0xb713e6){return function(_0x203aa1){if(_0x203aa1){var _0x747289=_0x203aa1[_0x477a('0x1b')],_0x213f7f=_0xb713e6[_0x477a('0x1c')],_0x18e8b8=_0xb713e6[_0x477a('0x1c')]+_0xb713e6[_0x477a('0x1d')],_0x5317e1;if(_0x18e8b8>=_0x747289){_0x18e8b8=_0x747289;_0x5317e1=0xc8;}else{_0x5317e1=0xce;}_0x415dc6['status'](_0x5317e1);return _0x415dc6['set']('Content-Range',_0x213f7f+'-'+_0x18e8b8+'/'+_0x747289)[_0x477a('0x1a')](_0x203aa1);}return null;};}function patchUpdates(_0x1fede9){return function(_0x343398){try{jsonpatch[_0x477a('0x1e')](_0x343398,_0x1fede9,!![]);}catch(_0x35bdfe){return BPromise[_0x477a('0x1f')](_0x35bdfe);}return _0x343398['save']();};}function saveUpdates(_0x10e364,_0x29490c){return function(_0x152184){if(_0x152184){return _0x152184[_0x477a('0x20')](_0x10e364)['then'](function(_0x57cb8e){return _0x57cb8e;});}return null;};}function removeEntity(_0x26c593,_0x15c71c){return function(_0x489d6b){if(_0x489d6b){return _0x489d6b[_0x477a('0x21')]()['then'](function(){var _0x313f78=_0x489d6b['get']({'plain':!![]});var _0x8de66f=_0x477a('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x8de66f,'resourceId':_0x313f78['id']}})[_0x477a('0x23')](function(){return _0x489d6b;});})['then'](function(){_0x26c593[_0x477a('0x18')](0xcc)[_0x477a('0x19')]();});}};}function handleEntityNotFound(_0x17a8f8,_0x4176ba){return function(_0xad8347){if(!_0xad8347){_0x17a8f8[_0x477a('0x24')](0x194);}return _0xad8347;};}function handleError(_0x6e9655,_0x33e441){_0x33e441=_0x33e441||0x1f4;return function(_0x29355a){logger['error'](_0x29355a[_0x477a('0x25')]);if(_0x29355a[_0x477a('0x26')]){delete _0x29355a[_0x477a('0x26')];}_0x6e9655[_0x477a('0x18')](_0x33e441)[_0x477a('0x27')](_0x29355a);};}exports['index']=function(_0x4b192e,_0xd04f72){var _0x1ec3c1={},_0x2d2940={},_0x477c3c={'count':0x0,'rows':[]};var _0x54b6bb=_[_0x477a('0x28')](db[_0x477a('0x29')][_0x477a('0x2a')],function(_0x1e08dd){return{'name':_0x1e08dd['fieldName'],'type':_0x1e08dd[_0x477a('0x2b')][_0x477a('0x2c')]};});_0x2d2940[_0x477a('0x2d')]=_['map'](_0x54b6bb,_0x477a('0x26'));_0x2d2940[_0x477a('0x2e')]=_[_0x477a('0x2f')](_0x4b192e[_0x477a('0x2e')]);_0x2d2940[_0x477a('0x30')]=_[_0x477a('0x31')](_0x2d2940[_0x477a('0x2d')],_0x2d2940['query']);_0x1ec3c1[_0x477a('0x32')]=_[_0x477a('0x31')](_0x2d2940[_0x477a('0x2d')],qs[_0x477a('0x33')](_0x4b192e[_0x477a('0x2e')][_0x477a('0x33')]));_0x1ec3c1['attributes']=_0x1ec3c1[_0x477a('0x32')][_0x477a('0x34')]?_0x1ec3c1[_0x477a('0x32')]:_0x2d2940[_0x477a('0x2d')];if(!_0x4b192e[_0x477a('0x2e')][_0x477a('0x35')](_0x477a('0x36'))){_0x1ec3c1[_0x477a('0x1d')]=qs[_0x477a('0x1d')](_0x4b192e[_0x477a('0x2e')][_0x477a('0x1d')]);_0x1ec3c1[_0x477a('0x1c')]=qs[_0x477a('0x1c')](_0x4b192e['query'][_0x477a('0x1c')]);}_0x1ec3c1['order']=qs[_0x477a('0x37')](_0x4b192e[_0x477a('0x2e')][_0x477a('0x37')]);_0x1ec3c1['where']=qs['filters'](_['pick'](_0x4b192e[_0x477a('0x2e')],_0x2d2940[_0x477a('0x30')]));if(_0x4b192e[_0x477a('0x2e')][_0x477a('0x38')]){_0x1ec3c1[_0x477a('0x39')]=_[_0x477a('0x3a')](_0x1ec3c1[_0x477a('0x39')],{'$or':_[_0x477a('0x28')](_0x54b6bb,function(_0x5ed40c){if(_0x5ed40c[_0x477a('0x2b')]!=='VIRTUAL'){var _0x2f0bd7={};_0x2f0bd7[_0x5ed40c[_0x477a('0x26')]]={'$like':'%'+_0x4b192e['query']['filter']+'%'};return _0x2f0bd7;}})});}_0x1ec3c1=_[_0x477a('0x3a')]({},_0x1ec3c1,_0x4b192e[_0x477a('0x3b')]);var _0x38c8a3={'where':_0x1ec3c1['where']};return db[_0x477a('0x29')][_0x477a('0x1b')](_0x38c8a3)[_0x477a('0x23')](function(_0x3e7948){_0x477c3c['count']=_0x3e7948;if(_0x4b192e[_0x477a('0x2e')][_0x477a('0x3c')]){_0x1ec3c1['include']=[{'all':!![]}];}return db['VoiceMail'][_0x477a('0x3d')](_0x1ec3c1);})[_0x477a('0x23')](function(_0x3c8b0d){_0x477c3c['rows']=_0x3c8b0d;return _0x477c3c;})[_0x477a('0x23')](respondWithFilteredResult(_0xd04f72,_0x1ec3c1))[_0x477a('0x3e')](handleError(_0xd04f72,null));};exports[_0x477a('0x3f')]=function(_0x34b42c,_0x4247e3){var _0x4c67e4={'raw':!![],'where':{'id':_0x34b42c[_0x477a('0x40')]['id']}},_0x3a2258={};_0x3a2258[_0x477a('0x2d')]=_[_0x477a('0x2f')](db[_0x477a('0x29')]['rawAttributes']);_0x3a2258['query']=_[_0x477a('0x2f')](_0x34b42c[_0x477a('0x2e')]);_0x3a2258[_0x477a('0x30')]=_['intersection'](_0x3a2258[_0x477a('0x2d')],_0x3a2258[_0x477a('0x2e')]);_0x4c67e4[_0x477a('0x32')]=_['intersection'](_0x3a2258[_0x477a('0x2d')],qs[_0x477a('0x33')](_0x34b42c[_0x477a('0x2e')]['fields']));_0x4c67e4['attributes']=_0x4c67e4[_0x477a('0x32')][_0x477a('0x34')]?_0x4c67e4[_0x477a('0x32')]:_0x3a2258['model'];if(_0x34b42c['query']['includeAll']){_0x4c67e4['include']=[{'all':!![]}];}_0x4c67e4=_[_0x477a('0x3a')]({},_0x4c67e4,_0x34b42c['options']);return db[_0x477a('0x29')][_0x477a('0x41')](_0x4c67e4)[_0x477a('0x23')](handleEntityNotFound(_0x4247e3,null))[_0x477a('0x23')](respondWithResult(_0x4247e3,null))['catch'](handleError(_0x4247e3,null));};exports[_0x477a('0x42')]=function(_0x42c687,_0x20f0b2){return db[_0x477a('0x29')][_0x477a('0x42')](_0x42c687[_0x477a('0x43')],{})[_0x477a('0x23')](function(_0x21b9db){var _0x5aa721=_0x42c687[_0x477a('0x44')][_0x477a('0x45')]({'plain':!![]});if(!_0x5aa721)throw new Error(_0x477a('0x46'));if(_0x5aa721['role']===_0x477a('0x44')){var _0x2b0178=_0x21b9db[_0x477a('0x45')]({'plain':!![]});var _0x1f5891=_0x477a('0x22');return db[_0x477a('0x47')][_0x477a('0x41')]({'where':{'name':_0x1f5891,'userProfileId':_0x5aa721[_0x477a('0x48')]},'raw':!![]})[_0x477a('0x23')](function(_0x187da4){if(_0x187da4&&_0x187da4[_0x477a('0x49')]===0x0){return db[_0x477a('0x4a')][_0x477a('0x42')]({'name':_0x2b0178[_0x477a('0x26')],'resourceId':_0x2b0178['id'],'type':_0x187da4[_0x477a('0x26')],'sectionId':_0x187da4['id']},{})[_0x477a('0x23')](function(){return _0x21b9db;});}else{return _0x21b9db;}})[_0x477a('0x3e')](function(_0x1e0f8a){logger[_0x477a('0x4b')](_0x477a('0x4c'),_0x1e0f8a);throw _0x1e0f8a;});}return _0x21b9db;})[_0x477a('0x23')](respondWithResult(_0x20f0b2,0xc9))[_0x477a('0x3e')](handleError(_0x20f0b2,null));};exports[_0x477a('0x20')]=function(_0x3765e0,_0x571d42){if(_0x3765e0['body']['id']){delete _0x3765e0[_0x477a('0x43')]['id'];}return db['VoiceMail'][_0x477a('0x41')]({'where':{'id':_0x3765e0[_0x477a('0x40')]['id']}})[_0x477a('0x23')](handleEntityNotFound(_0x571d42,null))[_0x477a('0x23')](saveUpdates(_0x3765e0[_0x477a('0x43')],null))[_0x477a('0x23')](respondWithResult(_0x571d42,null))[_0x477a('0x3e')](handleError(_0x571d42,null));};exports[_0x477a('0x21')]=function(_0x225882,_0x2c01ef){return db[_0x477a('0x29')][_0x477a('0x41')]({'where':{'id':_0x225882['params']['id']}})[_0x477a('0x23')](handleEntityNotFound(_0x2c01ef,null))[_0x477a('0x23')](removeEntity(_0x2c01ef,null))['catch'](handleError(_0x2c01ef,null));};exports[_0x477a('0x4d')]=function(_0x4836f4,_0xe91bca,_0x52d85b){return db[_0x477a('0x29')][_0x477a('0x4e')]({'where':{'id':_0x4836f4[_0x477a('0x40')]['id']}})[_0x477a('0x23')](handleEntityNotFound(_0xe91bca,null))[_0x477a('0x23')](function(_0x5b524d){var _0x4e8e0a;var _0x199eec={},_0x47b641={};_0x47b641[_0x477a('0x2d')]=_[_0x477a('0x2f')](db['VoiceMailMessage'][_0x477a('0x2a')]);_0x47b641['query']=_[_0x477a('0x2f')](_0x4836f4[_0x477a('0x2e')]);_0x47b641[_0x477a('0x30')]=_['intersection'](_0x47b641[_0x477a('0x2d')],_0x47b641[_0x477a('0x2e')]);_0x199eec[_0x477a('0x32')]=_[_0x477a('0x31')](_0x47b641['model'],qs[_0x477a('0x33')](_0x4836f4[_0x477a('0x2e')][_0x477a('0x33')]));_0x199eec[_0x477a('0x32')]=_0x199eec[_0x477a('0x32')]['length']?_0x199eec[_0x477a('0x32')]:_0x47b641[_0x477a('0x2d')];if(!_0x4836f4['query'][_0x477a('0x35')]('nolimit')){_0x199eec[_0x477a('0x1d')]=qs[_0x477a('0x1d')](_0x4836f4[_0x477a('0x2e')][_0x477a('0x1d')]);_0x199eec[_0x477a('0x1c')]=qs[_0x477a('0x1c')](_0x4836f4['query'][_0x477a('0x1c')]);}_0x199eec['order']=qs[_0x477a('0x37')](_0x4836f4[_0x477a('0x2e')][_0x477a('0x37')]);_0x199eec[_0x477a('0x39')]=qs['filters'](_[_0x477a('0x4f')](_0x4836f4[_0x477a('0x2e')],_0x47b641[_0x477a('0x30')]));if(_0x4836f4[_0x477a('0x2e')][_0x477a('0x38')]){_0x199eec[_0x477a('0x39')]=_['merge'](_0x199eec[_0x477a('0x39')],{'$or':_[_0x477a('0x28')](_0x199eec[_0x477a('0x32')],function(_0x1a449c){var _0x5f1b51={};_0x5f1b51[_0x1a449c]={'$like':'%'+_0x4836f4[_0x477a('0x2e')][_0x477a('0x38')]+'%'};return _0x5f1b51;})});}_0x199eec[_0x477a('0x39')]=_['merge'](_0x199eec[_0x477a('0x39')],{'mailboxuser':_0x5b524d[_0x477a('0x50')]});_0x199eec=_[_0x477a('0x3a')]({},_0x199eec,_0x4836f4['options']);return db[_0x477a('0x51')]['findAndCountAll'](_0x199eec)['then'](respondWithFilteredResult(_0xe91bca,_0x199eec));})[_0x477a('0x3e')](handleError(_0xe91bca,null));}; \ No newline at end of file +var _0x676e=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../mysqldb','sendStatus','end','count','offset','limit','status','set','json','apply','reject','save','update','destroy','then','get','Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0x676e,0x9d));var _0xe676=function(_0x3c1b2d,_0x23b1b9){_0x3c1b2d=_0x3c1b2d-0x0;var _0x412475=_0x676e[_0x3c1b2d];return _0x412475;};'use strict';var pdf=require(_0xe676('0x0'));var emlformat=require(_0xe676('0x1'));var rimraf=require(_0xe676('0x2'));var zipdir=require(_0xe676('0x3'));var jsonpatch=require(_0xe676('0x4'));var rp=require(_0xe676('0x5'));var moment=require(_0xe676('0x6'));var BPromise=require(_0xe676('0x7'));var Mustache=require('mustache');var util=require(_0xe676('0x8'));var path=require(_0xe676('0x9'));var sox=require('sox');var csv=require(_0xe676('0xa'));var ejs=require(_0xe676('0xb'));var fs=require('fs');var _=require(_0xe676('0xc'));var squel=require(_0xe676('0xd'));var crypto=require(_0xe676('0xe'));var jsforce=require(_0xe676('0xf'));var deskjs=require(_0xe676('0x10'));var toCsv=require(_0xe676('0xa'));var querystring=require(_0xe676('0x11'));var Papa=require(_0xe676('0x12'));var Redis=require(_0xe676('0x13'));var authService=require(_0xe676('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe676('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe676('0x16'))['db'];function respondWithStatusCode(_0x229c7c,_0x53fbd6){_0x53fbd6=_0x53fbd6||0xcc;return function(_0x517c78){if(_0x517c78){return _0x229c7c[_0xe676('0x17')](_0x53fbd6);}return _0x229c7c['status'](_0x53fbd6)[_0xe676('0x18')]();};}function respondWithResult(_0x868a47,_0x3361e9){_0x3361e9=_0x3361e9||0xc8;return function(_0x260a57){if(_0x260a57){return _0x868a47['status'](_0x3361e9)['json'](_0x260a57);}};}function respondWithFilteredResult(_0x3995f6,_0x3505fe){return function(_0x26d425){if(_0x26d425){var _0x1331c8=_0x26d425[_0xe676('0x19')],_0x2beccc=_0x3505fe[_0xe676('0x1a')],_0x3137f8=_0x3505fe[_0xe676('0x1a')]+_0x3505fe[_0xe676('0x1b')],_0x3d7f03;if(_0x3137f8>=_0x1331c8){_0x3137f8=_0x1331c8;_0x3d7f03=0xc8;}else{_0x3d7f03=0xce;}_0x3995f6[_0xe676('0x1c')](_0x3d7f03);return _0x3995f6[_0xe676('0x1d')]('Content-Range',_0x2beccc+'-'+_0x3137f8+'/'+_0x1331c8)[_0xe676('0x1e')](_0x26d425);}return null;};}function patchUpdates(_0x4bcd5c){return function(_0x49161a){try{jsonpatch[_0xe676('0x1f')](_0x49161a,_0x4bcd5c,!![]);}catch(_0x10632e){return BPromise[_0xe676('0x20')](_0x10632e);}return _0x49161a[_0xe676('0x21')]();};}function saveUpdates(_0x28301a,_0x336f2d){return function(_0x11d0e1){if(_0x11d0e1){return _0x11d0e1[_0xe676('0x22')](_0x28301a)['then'](function(_0x24a212){return _0x24a212;});}return null;};}function removeEntity(_0x191ba4,_0x2ea490){return function(_0x2f419a){if(_0x2f419a){return _0x2f419a[_0xe676('0x23')]()[_0xe676('0x24')](function(){var _0x1d80f6=_0x2f419a[_0xe676('0x25')]({'plain':!![]});var _0x55006a=_0xe676('0x26');return db[_0xe676('0x27')]['destroy']({'where':{'type':_0x55006a,'resourceId':_0x1d80f6['id']}})['then'](function(){return _0x2f419a;});})[_0xe676('0x24')](function(){_0x191ba4[_0xe676('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50c4f7,_0x598ad6){return function(_0x24bef4){if(!_0x24bef4){_0x50c4f7[_0xe676('0x17')](0x194);}return _0x24bef4;};}function handleError(_0x4c5d3d,_0x1be9a1){_0x1be9a1=_0x1be9a1||0x1f4;return function(_0x30c6e5){logger[_0xe676('0x28')](_0x30c6e5['stack']);if(_0x30c6e5[_0xe676('0x29')]){delete _0x30c6e5[_0xe676('0x29')];}_0x4c5d3d['status'](_0x1be9a1)[_0xe676('0x2a')](_0x30c6e5);};}exports[_0xe676('0x2b')]=function(_0x4ba38e,_0x4bb463){var _0x30f134={},_0x16b103={},_0x20b7f4={'count':0x0,'rows':[]};var _0x15e710=_[_0xe676('0x2c')](db[_0xe676('0x2d')][_0xe676('0x2e')],function(_0x3caebb){return{'name':_0x3caebb[_0xe676('0x2f')],'type':_0x3caebb['type'][_0xe676('0x30')]};});_0x16b103['model']=_[_0xe676('0x2c')](_0x15e710,'name');_0x16b103[_0xe676('0x31')]=_[_0xe676('0x32')](_0x4ba38e[_0xe676('0x31')]);_0x16b103[_0xe676('0x33')]=_[_0xe676('0x34')](_0x16b103[_0xe676('0x35')],_0x16b103[_0xe676('0x31')]);_0x30f134['attributes']=_['intersection'](_0x16b103[_0xe676('0x35')],qs[_0xe676('0x36')](_0x4ba38e[_0xe676('0x31')][_0xe676('0x36')]));_0x30f134[_0xe676('0x37')]=_0x30f134[_0xe676('0x37')]['length']?_0x30f134[_0xe676('0x37')]:_0x16b103[_0xe676('0x35')];if(!_0x4ba38e[_0xe676('0x31')][_0xe676('0x38')](_0xe676('0x39'))){_0x30f134[_0xe676('0x1b')]=qs[_0xe676('0x1b')](_0x4ba38e[_0xe676('0x31')]['limit']);_0x30f134[_0xe676('0x1a')]=qs[_0xe676('0x1a')](_0x4ba38e['query'][_0xe676('0x1a')]);}_0x30f134[_0xe676('0x3a')]=qs[_0xe676('0x3b')](_0x4ba38e[_0xe676('0x31')][_0xe676('0x3b')]);_0x30f134['where']=qs[_0xe676('0x33')](_[_0xe676('0x3c')](_0x4ba38e[_0xe676('0x31')],_0x16b103[_0xe676('0x33')]));if(_0x4ba38e['query'][_0xe676('0x3d')]){_0x30f134[_0xe676('0x3e')]=_[_0xe676('0x3f')](_0x30f134[_0xe676('0x3e')],{'$or':_[_0xe676('0x2c')](_0x15e710,function(_0x1d9af2){if(_0x1d9af2[_0xe676('0x40')]!==_0xe676('0x41')){var _0x5c1c13={};_0x5c1c13[_0x1d9af2[_0xe676('0x29')]]={'$like':'%'+_0x4ba38e[_0xe676('0x31')][_0xe676('0x3d')]+'%'};return _0x5c1c13;}})});}_0x30f134=_['merge']({},_0x30f134,_0x4ba38e[_0xe676('0x42')]);var _0x217b1d={'where':_0x30f134[_0xe676('0x3e')]};return db[_0xe676('0x2d')]['count'](_0x217b1d)[_0xe676('0x24')](function(_0x12c7ba){_0x20b7f4['count']=_0x12c7ba;if(_0x4ba38e[_0xe676('0x31')][_0xe676('0x43')]){_0x30f134[_0xe676('0x44')]=[{'all':!![]}];}return db[_0xe676('0x2d')][_0xe676('0x45')](_0x30f134);})[_0xe676('0x24')](function(_0x5eb9c7){_0x20b7f4['rows']=_0x5eb9c7;return _0x20b7f4;})[_0xe676('0x24')](respondWithFilteredResult(_0x4bb463,_0x30f134))[_0xe676('0x46')](handleError(_0x4bb463,null));};exports[_0xe676('0x47')]=function(_0x32ca1d,_0x3156f0){var _0x21d1d8={'raw':!![],'where':{'id':_0x32ca1d[_0xe676('0x48')]['id']}},_0x1a24fc={};_0x1a24fc[_0xe676('0x35')]=_[_0xe676('0x32')](db[_0xe676('0x2d')][_0xe676('0x2e')]);_0x1a24fc['query']=_[_0xe676('0x32')](_0x32ca1d[_0xe676('0x31')]);_0x1a24fc[_0xe676('0x33')]=_['intersection'](_0x1a24fc[_0xe676('0x35')],_0x1a24fc[_0xe676('0x31')]);_0x21d1d8['attributes']=_[_0xe676('0x34')](_0x1a24fc[_0xe676('0x35')],qs[_0xe676('0x36')](_0x32ca1d[_0xe676('0x31')]['fields']));_0x21d1d8[_0xe676('0x37')]=_0x21d1d8['attributes'][_0xe676('0x49')]?_0x21d1d8['attributes']:_0x1a24fc['model'];if(_0x32ca1d[_0xe676('0x31')][_0xe676('0x43')]){_0x21d1d8[_0xe676('0x44')]=[{'all':!![]}];}_0x21d1d8=_['merge']({},_0x21d1d8,_0x32ca1d['options']);return db[_0xe676('0x2d')][_0xe676('0x4a')](_0x21d1d8)[_0xe676('0x24')](handleEntityNotFound(_0x3156f0,null))[_0xe676('0x24')](respondWithResult(_0x3156f0,null))[_0xe676('0x46')](handleError(_0x3156f0,null));};exports['create']=function(_0x59f86c,_0x2711de){return db[_0xe676('0x2d')][_0xe676('0x4b')](_0x59f86c['body'],{})[_0xe676('0x24')](function(_0x1ecacf){var _0x249130=_0x59f86c[_0xe676('0x4c')][_0xe676('0x25')]({'plain':!![]});if(!_0x249130)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x249130[_0xe676('0x4d')]===_0xe676('0x4c')){var _0x1c3a2c=_0x1ecacf[_0xe676('0x25')]({'plain':!![]});var _0x4d4f0a='Voicemails';return db[_0xe676('0x4e')][_0xe676('0x4a')]({'where':{'name':_0x4d4f0a,'userProfileId':_0x249130[_0xe676('0x4f')]},'raw':!![]})[_0xe676('0x24')](function(_0x3c26dc){if(_0x3c26dc&&_0x3c26dc['autoAssociation']===0x0){return db[_0xe676('0x27')]['create']({'name':_0x1c3a2c[_0xe676('0x29')],'resourceId':_0x1c3a2c['id'],'type':_0x3c26dc[_0xe676('0x29')],'sectionId':_0x3c26dc['id']},{})['then'](function(){return _0x1ecacf;});}else{return _0x1ecacf;}})[_0xe676('0x46')](function(_0xe2ede6){logger[_0xe676('0x28')](_0xe676('0x50'),_0xe2ede6);throw _0xe2ede6;});}return _0x1ecacf;})[_0xe676('0x24')](respondWithResult(_0x2711de,0xc9))[_0xe676('0x46')](handleError(_0x2711de,null));};exports[_0xe676('0x22')]=function(_0x4077f5,_0x3c3b06){if(_0x4077f5[_0xe676('0x51')]['id']){delete _0x4077f5[_0xe676('0x51')]['id'];}return db[_0xe676('0x2d')][_0xe676('0x4a')]({'where':{'id':_0x4077f5[_0xe676('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c3b06,null))[_0xe676('0x24')](saveUpdates(_0x4077f5[_0xe676('0x51')],null))['then'](respondWithResult(_0x3c3b06,null))[_0xe676('0x46')](handleError(_0x3c3b06,null));};exports[_0xe676('0x23')]=function(_0x9051aa,_0x2fd354){return db['VoiceMail'][_0xe676('0x4a')]({'where':{'id':_0x9051aa['params']['id']}})[_0xe676('0x24')](handleEntityNotFound(_0x2fd354,null))['then'](removeEntity(_0x2fd354,null))[_0xe676('0x46')](handleError(_0x2fd354,null));};exports[_0xe676('0x52')]=function(_0x1e0d1f,_0x1cf59f,_0x2398ec){return db['VoiceMail'][_0xe676('0x53')]({'where':{'id':_0x1e0d1f[_0xe676('0x48')]['id']}})[_0xe676('0x24')](handleEntityNotFound(_0x1cf59f,null))[_0xe676('0x24')](function(_0x5442c0){var _0x3f8fb1;var _0x15aa36={},_0x225164={};_0x225164[_0xe676('0x35')]=_[_0xe676('0x32')](db[_0xe676('0x54')][_0xe676('0x2e')]);_0x225164[_0xe676('0x31')]=_[_0xe676('0x32')](_0x1e0d1f[_0xe676('0x31')]);_0x225164['filters']=_['intersection'](_0x225164['model'],_0x225164[_0xe676('0x31')]);_0x15aa36[_0xe676('0x37')]=_[_0xe676('0x34')](_0x225164[_0xe676('0x35')],qs[_0xe676('0x36')](_0x1e0d1f[_0xe676('0x31')][_0xe676('0x36')]));_0x15aa36[_0xe676('0x37')]=_0x15aa36[_0xe676('0x37')]['length']?_0x15aa36[_0xe676('0x37')]:_0x225164[_0xe676('0x35')];if(!_0x1e0d1f[_0xe676('0x31')][_0xe676('0x38')]('nolimit')){_0x15aa36[_0xe676('0x1b')]=qs['limit'](_0x1e0d1f[_0xe676('0x31')]['limit']);_0x15aa36[_0xe676('0x1a')]=qs[_0xe676('0x1a')](_0x1e0d1f['query'][_0xe676('0x1a')]);}_0x15aa36[_0xe676('0x3a')]=qs[_0xe676('0x3b')](_0x1e0d1f[_0xe676('0x31')][_0xe676('0x3b')]);_0x15aa36['where']=qs[_0xe676('0x33')](_[_0xe676('0x3c')](_0x1e0d1f[_0xe676('0x31')],_0x225164[_0xe676('0x33')]));if(_0x1e0d1f['query'][_0xe676('0x3d')]){_0x15aa36[_0xe676('0x3e')]=_[_0xe676('0x3f')](_0x15aa36[_0xe676('0x3e')],{'$or':_[_0xe676('0x2c')](_0x15aa36[_0xe676('0x37')],function(_0x4e1c09){var _0x23d8a3={};_0x23d8a3[_0x4e1c09]={'$like':'%'+_0x1e0d1f[_0xe676('0x31')][_0xe676('0x3d')]+'%'};return _0x23d8a3;})});}_0x15aa36[_0xe676('0x3e')]=_[_0xe676('0x3f')](_0x15aa36[_0xe676('0x3e')],{'mailboxuser':_0x5442c0[_0xe676('0x55')]});_0x15aa36=_['merge']({},_0x15aa36,_0x1e0d1f[_0xe676('0x42')]);return db[_0xe676('0x54')][_0xe676('0x56')](_0x15aa36)[_0xe676('0x24')](respondWithFilteredResult(_0x1cf59f,_0x15aa36));})['catch'](handleError(_0x1cf59f,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index f84da82..72e00c8 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 _0x04f8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox','lodash','util','../../config/logger','api'];(function(_0xbeb808,_0x881ddf){var _0x5d6909=function(_0x37d652){while(--_0x37d652){_0xbeb808['push'](_0xbeb808['shift']());}};_0x5d6909(++_0x881ddf);}(_0x04f8,0x1be));var _0x804f=function(_0x277e0b,_0x3cf787){_0x277e0b=_0x277e0b-0x0;var _0x5dbb4c=_0x04f8[_0x277e0b];return _0x5dbb4c;};'use strict';var _=require(_0x804f('0x0'));var util=require(_0x804f('0x1'));var logger=require(_0x804f('0x2'))(_0x804f('0x3'));var moment=require(_0x804f('0x4'));var BPromise=require(_0x804f('0x5'));var rp=require(_0x804f('0x6'));var fs=require('fs');var path=require(_0x804f('0x7'));var rimraf=require(_0x804f('0x8'));var config=require(_0x804f('0x9'));var attributes=require(_0x804f('0xa'));module[_0x804f('0xb')]=function(_0x46ded1,_0x4cf62f){return _0x46ded1[_0x804f('0xc')]('VoiceMail',attributes,{'tableName':_0x804f('0xd'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x804f('0xe'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x20c9=['VoiceMail','voice_voicemail','mailbox','context','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x582d0b,_0x28f609){var _0x2e93e1=function(_0xb6a81c){while(--_0xb6a81c){_0x582d0b['push'](_0x582d0b['shift']());}};_0x2e93e1(++_0x28f609);}(_0x20c9,0x163));var _0x920c=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0x20c9[_0x593564];return _0x211a89;};'use strict';var _=require(_0x920c('0x0'));var util=require('util');var logger=require(_0x920c('0x1'))(_0x920c('0x2'));var moment=require('moment');var BPromise=require(_0x920c('0x3'));var rp=require(_0x920c('0x4'));var fs=require('fs');var path=require(_0x920c('0x5'));var rimraf=require(_0x920c('0x6'));var config=require(_0x920c('0x7'));var attributes=require(_0x920c('0x8'));module['exports']=function(_0x17edcd,_0x327891){return _0x17edcd['define'](_0x920c('0x9'),attributes,{'tableName':_0x920c('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x920c('0xb'),_0x920c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 5ad306d..01a37ab 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 _0xa0cc=['message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xeb0ad1,_0x3fce0b){var _0x170307=function(_0x3bf81f){while(--_0x3bf81f){_0xeb0ad1['push'](_0xeb0ad1['shift']());}};_0x170307(++_0x3fce0b);}(_0xa0cc,0x1de));var _0xca0c=function(_0xb39ab3,_0xfe42a6){_0xb39ab3=_0xb39ab3-0x0;var _0x2a68ed=_0xa0cc[_0xb39ab3];return _0x2a68ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xca0c('0x0'));var BPromise=require(_0xca0c('0x1'));var rs=require(_0xca0c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca0c('0x3'))['db'];var utils=require(_0xca0c('0x4'));var logger=require(_0xca0c('0x5'))(_0xca0c('0x6'));var config=require(_0xca0c('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x55fe48,_0x2b6601,_0x5cfb7d){return new BPromise(function(_0x1795db,_0x39f062){return client[_0xca0c('0x8')](_0x55fe48,_0x5cfb7d)['then'](function(_0xa07dbc){logger[_0xca0c('0x9')](_0xca0c('0xa'),_0x2b6601,_0xca0c('0xb'));logger[_0xca0c('0xc')](_0xca0c('0xd'),_0x2b6601,'request\x20sent',JSON[_0xca0c('0xe')](_0xa07dbc));if(_0xa07dbc['error']){if(_0xa07dbc[_0xca0c('0xf')]['code']===0x1f4){logger['error'](_0xca0c('0xa'),_0x2b6601,_0xa07dbc[_0xca0c('0xf')][_0xca0c('0x10')]);return _0x39f062(_0xa07dbc['error'][_0xca0c('0x10')]);}logger[_0xca0c('0xf')](_0xca0c('0xa'),_0x2b6601,_0xa07dbc[_0xca0c('0xf')][_0xca0c('0x10')]);return _0x1795db(_0xa07dbc[_0xca0c('0xf')][_0xca0c('0x10')]);}else{logger[_0xca0c('0x9')]('VoiceMail,\x20%s,\x20%s',_0x2b6601,_0xca0c('0xb'));_0x1795db(_0xa07dbc[_0xca0c('0x11')][_0xca0c('0x10')]);}})[_0xca0c('0x12')](function(_0x3ccc11){logger[_0xca0c('0xf')](_0xca0c('0xa'),_0x2b6601,_0x3ccc11);_0x39f062(_0x3ccc11);});});} \ No newline at end of file +var _0x7117=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x29ad3b,_0x18168e){var _0x1d4bab=function(_0x52bb33){while(--_0x52bb33){_0x29ad3b['push'](_0x29ad3b['shift']());}};_0x1d4bab(++_0x18168e);}(_0x7117,0x1de));var _0x7711=function(_0x3b06d6,_0x528b8e){_0x3b06d6=_0x3b06d6-0x0;var _0x100528=_0x7117[_0x3b06d6];return _0x100528;};'use strict';var _=require(_0x7711('0x0'));var util=require(_0x7711('0x1'));var moment=require(_0x7711('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7711('0x3'));var db=require(_0x7711('0x4'))['db'];var utils=require(_0x7711('0x5'));var logger=require('../../config/logger')(_0x7711('0x6'));var config=require(_0x7711('0x7'));var jayson=require(_0x7711('0x8'));var client=jayson[_0x7711('0x9')][_0x7711('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x108bef,_0xefb3d9,_0x30eb0e){return new BPromise(function(_0x2fedf3,_0x21e576){return client[_0x7711('0xb')](_0x108bef,_0x30eb0e)[_0x7711('0xc')](function(_0x22ad94){logger[_0x7711('0xd')](_0x7711('0xe'),_0xefb3d9,'request\x20sent');logger[_0x7711('0xf')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0xefb3d9,_0x7711('0x10'),JSON['stringify'](_0x22ad94));if(_0x22ad94['error']){if(_0x22ad94[_0x7711('0x11')]['code']===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0xefb3d9,_0x22ad94[_0x7711('0x11')]['message']);return _0x21e576(_0x22ad94[_0x7711('0x11')][_0x7711('0x12')]);}logger[_0x7711('0x11')](_0x7711('0xe'),_0xefb3d9,_0x22ad94[_0x7711('0x11')][_0x7711('0x12')]);return _0x2fedf3(_0x22ad94[_0x7711('0x11')][_0x7711('0x12')]);}else{logger[_0x7711('0xd')](_0x7711('0xe'),_0xefb3d9,_0x7711('0x10'));_0x2fedf3(_0x22ad94[_0x7711('0x13')][_0x7711('0x12')]);}})[_0x7711('0x14')](function(_0x6da33c){logger[_0x7711('0x11')]('VoiceMail,\x20%s,\x20%s',_0xefb3d9,_0x6da33c);_0x21e576(_0x6da33c);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 3fa9473..7fc9690 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 _0x5fab=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','download','post','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x2fbe40,_0xde4bdb){var _0x5b25f7=function(_0x3c8856){while(--_0x3c8856){_0x2fbe40['push'](_0x2fbe40['shift']());}};_0x5b25f7(++_0xde4bdb);}(_0x5fab,0x177));var _0xb5fa=function(_0x2dc70d,_0x26e805){_0x2dc70d=_0x2dc70d-0x0;var _0x3b9ecc=_0x5fab[_0x2dc70d];return _0x3b9ecc;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var auth=require(_0xb5fa('0x5'));var interaction=require(_0xb5fa('0x6'));var config=require(_0xb5fa('0x7'));var controller=require(_0xb5fa('0x8'));router[_0xb5fa('0x9')]('/',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xb')]);router['get']('/:id',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xc')]);router[_0xb5fa('0x9')]('/:id/download',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xd')]);router[_0xb5fa('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb5fa('0xf')](_0xb5fa('0x10'),auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x11')]);router[_0xb5fa('0x12')](_0xb5fa('0x10'),auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x13')]);module[_0xb5fa('0x14')]=router; \ No newline at end of file +var _0x814b=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','destroy','exports','multer','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x814b,0x1a2));var _0xb814=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x814b[_0x349148];return _0x2f2b0f;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['show']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['delete'](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index f3a0f91..3cb7f68 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 _0xe8d4=['exports','getDataValue','INTEGER','STRING','long','TIMESTAMP','sequelize'];(function(_0x11cb8c,_0x354426){var _0x7c274d=function(_0x1f6bcd){while(--_0x1f6bcd){_0x11cb8c['push'](_0x11cb8c['shift']());}};_0x7c274d(++_0x354426);}(_0xe8d4,0x148));var _0x4e8d=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xe8d4[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x4e8d('0x0'));module[_0x4e8d('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x47e087){return this[_0x4e8d('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x4e8d('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x4e8d('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x4e8d('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x4e8d('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x4e8d('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x4e8d('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x4e8d('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x4e8d('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x4e8d('0x4')],'defaultValue':''},'stamp':{'type':_0x4e8d('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0x0d2d=['long','TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB'];(function(_0x1e504a,_0x5d3e34){var _0x15ac53=function(_0x3439e3){while(--_0x3439e3){_0x1e504a['push'](_0x1e504a['shift']());}};_0x15ac53(++_0x5d3e34);}(_0x0d2d,0x18e));var _0xd0d2=function(_0x169a96,_0x262468){_0x169a96=_0x169a96-0x0;var _0x2e8b82=_0x0d2d[_0x169a96];return _0x2e8b82;};'use strict';var Sequelize=require(_0xd0d2('0x0'));module[_0xd0d2('0x1')]={'name':{'type':Sequelize[_0xd0d2('0x2')],'get':function(_0x34f871){return this[_0xd0d2('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xd0d2('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd0d2('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0xd0d2('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xd0d2('0x5')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xd0d2('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xd0d2('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd0d2('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd0d2('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xd0d2('0x6')](_0xd0d2('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0xd0d2('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd0d2('0x5')],'defaultValue':''},'stamp':{'type':_0xd0d2('0x8'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 9ede8f2..c30bef4 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 _0x56a4=['json','count','offset','status','set','Content-Range','save','then','sendStatus','stack','index','map','VoiceMailMessage','rawAttributes','key','model','name','query','keys','filters','intersection','attributes','fields','limit','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','catch','params','length','includeAll','find','create','update','body','destroy','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','send','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end'];(function(_0x234c3b,_0x57ac7b){var _0x1d4b25=function(_0x513f3d){while(--_0x513f3d){_0x234c3b['push'](_0x234c3b['shift']());}};_0x1d4b25(++_0x57ac7b);}(_0x56a4,0x11b));var _0x456a=function(_0x3c5272,_0x1ea873){_0x3c5272=_0x3c5272-0x0;var _0x31a12a=_0x56a4[_0x3c5272];return _0x31a12a;};'use strict';var pdf=require(_0x456a('0x0'));var emlformat=require(_0x456a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x456a('0x2'));var jsonpatch=require(_0x456a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x456a('0x4'));var Mustache=require(_0x456a('0x5'));var util=require(_0x456a('0x6'));var path=require(_0x456a('0x7'));var sox=require(_0x456a('0x8'));var csv=require('to-csv');var ejs=require(_0x456a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x456a('0xa'));var jsforce=require(_0x456a('0xb'));var deskjs=require(_0x456a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x456a('0xd'));var Papa=require('papaparse');var Redis=require(_0x456a('0xe'));var authService=require(_0x456a('0xf'));var qs=require(_0x456a('0x10'));var as=require(_0x456a('0x11'));var hardwareService=require(_0x456a('0x12'));var logger=require(_0x456a('0x13'))(_0x456a('0x14'));var utils=require(_0x456a('0x15'));var config=require(_0x456a('0x16'));var db=require(_0x456a('0x17'))['db'];function respondWithStatusCode(_0x274ee0,_0x479993){_0x479993=_0x479993||0xcc;return function(_0x2f4b75){if(_0x2f4b75){return _0x274ee0['sendStatus'](_0x479993);}return _0x274ee0['status'](_0x479993)[_0x456a('0x18')]();};}function respondWithResult(_0x2924b9,_0xa5b5d8){_0xa5b5d8=_0xa5b5d8||0xc8;return function(_0xc01cbb){if(_0xc01cbb){return _0x2924b9['status'](_0xa5b5d8)[_0x456a('0x19')](_0xc01cbb);}};}function respondWithFilteredResult(_0x2318f3,_0x57f10b){return function(_0x78c2ec){if(_0x78c2ec){var _0x1e91f3=_0x78c2ec[_0x456a('0x1a')],_0x108ead=_0x57f10b[_0x456a('0x1b')],_0x4d6fce=_0x57f10b[_0x456a('0x1b')]+_0x57f10b['limit'],_0x410df4;if(_0x4d6fce>=_0x1e91f3){_0x4d6fce=_0x1e91f3;_0x410df4=0xc8;}else{_0x410df4=0xce;}_0x2318f3[_0x456a('0x1c')](_0x410df4);return _0x2318f3[_0x456a('0x1d')](_0x456a('0x1e'),_0x108ead+'-'+_0x4d6fce+'/'+_0x1e91f3)['json'](_0x78c2ec);}return null;};}function patchUpdates(_0x3d06b4){return function(_0x520f2f){try{jsonpatch['apply'](_0x520f2f,_0x3d06b4,!![]);}catch(_0x33be50){return BPromise['reject'](_0x33be50);}return _0x520f2f[_0x456a('0x1f')]();};}function saveUpdates(_0x4b48bf,_0x962b6d){return function(_0x17d0ae){if(_0x17d0ae){return _0x17d0ae['update'](_0x4b48bf)['then'](function(_0x55fe9e){return _0x55fe9e;});}return null;};}function removeEntity(_0x2c2c19,_0x9d76bf){return function(_0xb8d35c){if(_0xb8d35c){return _0xb8d35c['destroy']()[_0x456a('0x20')](function(){_0x2c2c19['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59b47e,_0x47747a){return function(_0x301d4e){if(!_0x301d4e){_0x59b47e[_0x456a('0x21')](0x194);}return _0x301d4e;};}function handleError(_0x4fad66,_0x45ea0c){_0x45ea0c=_0x45ea0c||0x1f4;return function(_0x360b42){logger['error'](_0x360b42[_0x456a('0x22')]);if(_0x360b42['name']){delete _0x360b42['name'];}_0x4fad66[_0x456a('0x1c')](_0x45ea0c)['send'](_0x360b42);};}exports[_0x456a('0x23')]=function(_0x5e6de5,_0x1ee212){var _0x3f312f={},_0x45ee45={},_0x2e8005={'count':0x0,'rows':[]};var _0xe280fc=_[_0x456a('0x24')](db[_0x456a('0x25')][_0x456a('0x26')],function(_0x5912f6){return{'name':_0x5912f6['fieldName'],'type':_0x5912f6['type'][_0x456a('0x27')]};});_0x45ee45[_0x456a('0x28')]=_['differenceBy'](_[_0x456a('0x24')](_0xe280fc,_0x456a('0x29')),[_0x456a('0x29')]);_0x45ee45[_0x456a('0x2a')]=_[_0x456a('0x2b')](_0x5e6de5['query']);_0x45ee45[_0x456a('0x2c')]=_[_0x456a('0x2d')](_0x45ee45[_0x456a('0x28')],_0x45ee45['query']);_0x3f312f[_0x456a('0x2e')]=_[_0x456a('0x2d')](_0x45ee45['model'],qs[_0x456a('0x2f')](_0x5e6de5[_0x456a('0x2a')][_0x456a('0x2f')]));_0x3f312f[_0x456a('0x2e')]=_0x3f312f[_0x456a('0x2e')]['length']?_0x3f312f[_0x456a('0x2e')]:_0x45ee45[_0x456a('0x28')];if(!_0x5e6de5[_0x456a('0x2a')]['hasOwnProperty']('nolimit')){_0x3f312f[_0x456a('0x30')]=qs['limit'](_0x5e6de5['query']['limit']);_0x3f312f[_0x456a('0x1b')]=qs[_0x456a('0x1b')](_0x5e6de5[_0x456a('0x2a')][_0x456a('0x1b')]);}_0x3f312f['order']=qs[_0x456a('0x31')](_0x5e6de5[_0x456a('0x2a')]['sort']);_0x3f312f[_0x456a('0x32')]=qs[_0x456a('0x2c')](_[_0x456a('0x33')](_0x5e6de5[_0x456a('0x2a')],_0x45ee45[_0x456a('0x2c')]));if(_0x5e6de5['query'][_0x456a('0x34')]){_0x3f312f[_0x456a('0x32')]=_['merge'](_0x3f312f[_0x456a('0x32')],{'$or':_[_0x456a('0x24')](_0xe280fc,function(_0x239932){if(_0x239932[_0x456a('0x35')]!==_0x456a('0x36')){var _0x342423={};_0x342423[_0x239932[_0x456a('0x29')]]={'$like':'%'+_0x5e6de5[_0x456a('0x2a')]['filter']+'%'};return _0x342423;}})});}_0x3f312f=_[_0x456a('0x37')]({},_0x3f312f,_0x5e6de5[_0x456a('0x38')]);var _0x172bbe={'where':_0x3f312f[_0x456a('0x32')]};return db[_0x456a('0x25')]['count'](_0x172bbe)[_0x456a('0x20')](function(_0x587387){_0x2e8005[_0x456a('0x1a')]=_0x587387;if(_0x5e6de5[_0x456a('0x2a')]['includeAll']){_0x3f312f[_0x456a('0x39')]=[{'all':!![]}];}return db[_0x456a('0x25')][_0x456a('0x3a')](_0x3f312f);})['then'](function(_0xe098be){_0x2e8005['rows']=_0xe098be;return _0x2e8005;})['then'](respondWithFilteredResult(_0x1ee212,_0x3f312f))[_0x456a('0x3b')](handleError(_0x1ee212,null));};exports['show']=function(_0x13c52c,_0x291f23){var _0x5878f4={'raw':!![],'where':{'id':_0x13c52c[_0x456a('0x3c')]['id']}},_0x442da9={};_0x442da9[_0x456a('0x28')]=_[_0x456a('0x2b')](db[_0x456a('0x25')][_0x456a('0x26')]);_0x442da9['query']=_[_0x456a('0x2b')](_0x13c52c['query']);_0x442da9[_0x456a('0x2c')]=_[_0x456a('0x2d')](_0x442da9[_0x456a('0x28')],_0x442da9[_0x456a('0x2a')]);_0x5878f4[_0x456a('0x2e')]=_['intersection'](_0x442da9[_0x456a('0x28')],qs[_0x456a('0x2f')](_0x13c52c[_0x456a('0x2a')][_0x456a('0x2f')]));_0x5878f4[_0x456a('0x2e')]=_0x5878f4[_0x456a('0x2e')][_0x456a('0x3d')]?_0x5878f4['attributes']:_0x442da9[_0x456a('0x28')];if(_0x13c52c[_0x456a('0x2a')][_0x456a('0x3e')]){_0x5878f4[_0x456a('0x39')]=[{'all':!![]}];}_0x5878f4=_[_0x456a('0x37')]({},_0x5878f4,_0x13c52c['options']);return db[_0x456a('0x25')][_0x456a('0x3f')](_0x5878f4)['then'](handleEntityNotFound(_0x291f23,null))['then'](respondWithResult(_0x291f23,null))[_0x456a('0x3b')](handleError(_0x291f23,null));};exports['create']=function(_0x233849,_0x49fb5b){return db[_0x456a('0x25')][_0x456a('0x40')](_0x233849['body'],{})['then'](respondWithResult(_0x49fb5b,0xc9))['catch'](handleError(_0x49fb5b,null));};exports[_0x456a('0x41')]=function(_0x2bd03d,_0x528abe){if(_0x2bd03d['body']['id']){delete _0x2bd03d[_0x456a('0x42')]['id'];}return db['VoiceMailMessage'][_0x456a('0x3f')]({'where':{'id':_0x2bd03d[_0x456a('0x3c')]['id']}})[_0x456a('0x20')](handleEntityNotFound(_0x528abe,null))['then'](saveUpdates(_0x2bd03d['body'],null))['then'](respondWithResult(_0x528abe,null))[_0x456a('0x3b')](handleError(_0x528abe,null));};exports[_0x456a('0x43')]=function(_0x21aa0a,_0x5e9b8d){return db[_0x456a('0x25')][_0x456a('0x3f')]({'where':{'id':_0x21aa0a[_0x456a('0x3c')]['id']}})[_0x456a('0x20')](handleEntityNotFound(_0x5e9b8d,null))[_0x456a('0x20')](removeEntity(_0x5e9b8d,null))[_0x456a('0x3b')](handleError(_0x5e9b8d,null));};exports[_0x456a('0x44')]=function(_0x1a7ffe,_0x5c72e8,_0x3f539e){return db[_0x456a('0x25')]['find']({'where':{'id':_0x1a7ffe[_0x456a('0x3c')]['id']},'attributes':['id',_0x456a('0x45'),'msg_id']})[_0x456a('0x20')](handleEntityNotFound(_0x5c72e8,null))[_0x456a('0x20')](function(_0x54c33c){if(_0x54c33c){if(!_0x54c33c[_0x456a('0x45')]){throw new db[(_0x456a('0x46'))][(_0x456a('0x47'))](_0x456a('0x48'));}var _0x49e3ee={'Content-Type':'audio/wav','Content-Disposition':_0x456a('0x49')};if(_0x54c33c['msg_id']){_0x49e3ee[_0x456a('0x4a')]=_0x456a('0x4b')+_0x54c33c['msg_id']+'.wav\x22';}_0x5c72e8[_0x456a('0x1d')](_0x49e3ee);return _0x5c72e8[_0x456a('0x4c')](new Buffer(_0x54c33c['recording']));}})[_0x456a('0x3b')](handleError(_0x5c72e8,null));}; \ No newline at end of file +var _0x72b1=['offset','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','VoiceMailMessage','find','create','body','update','catch','download','recording','msg_id','Sequelize','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','limit','set','Content-Range','apply','reject','save','destroy','then','end','sendStatus','error','stack','name','index','map','rawAttributes','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x72b1,0x16e));var _0x172b=function(_0x1db819,_0x839933){_0x1db819=_0x1db819-0x0;var _0x2325f4=_0x72b1[_0x1db819];return _0x2325f4;};'use strict';var pdf=require(_0x172b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x172b('0x1'));var zipdir=require(_0x172b('0x2'));var jsonpatch=require(_0x172b('0x3'));var rp=require(_0x172b('0x4'));var moment=require(_0x172b('0x5'));var BPromise=require(_0x172b('0x6'));var Mustache=require(_0x172b('0x7'));var util=require('util');var path=require(_0x172b('0x8'));var sox=require(_0x172b('0x9'));var csv=require(_0x172b('0xa'));var ejs=require(_0x172b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x172b('0xc'));var crypto=require('crypto');var jsforce=require(_0x172b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x172b('0xa'));var querystring=require(_0x172b('0xe'));var Papa=require(_0x172b('0xf'));var Redis=require(_0x172b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x172b('0x11'));var as=require(_0x172b('0x12'));var hardwareService=require(_0x172b('0x13'));var logger=require(_0x172b('0x14'))(_0x172b('0x15'));var utils=require(_0x172b('0x16'));var config=require(_0x172b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13d285,_0x82727f){_0x82727f=_0x82727f||0xcc;return function(_0xdf832e){if(_0xdf832e){return _0x13d285['sendStatus'](_0x82727f);}return _0x13d285[_0x172b('0x18')](_0x82727f)['end']();};}function respondWithResult(_0x2611c2,_0x81e11e){_0x81e11e=_0x81e11e||0xc8;return function(_0x5239b9){if(_0x5239b9){return _0x2611c2[_0x172b('0x18')](_0x81e11e)[_0x172b('0x19')](_0x5239b9);}};}function respondWithFilteredResult(_0x2790ed,_0xa28463){return function(_0x5b0ab1){if(_0x5b0ab1){var _0x5293ef=_0x5b0ab1[_0x172b('0x1a')],_0x3625bb=_0xa28463['offset'],_0x34be39=_0xa28463['offset']+_0xa28463[_0x172b('0x1b')],_0x36af74;if(_0x34be39>=_0x5293ef){_0x34be39=_0x5293ef;_0x36af74=0xc8;}else{_0x36af74=0xce;}_0x2790ed[_0x172b('0x18')](_0x36af74);return _0x2790ed[_0x172b('0x1c')](_0x172b('0x1d'),_0x3625bb+'-'+_0x34be39+'/'+_0x5293ef)[_0x172b('0x19')](_0x5b0ab1);}return null;};}function patchUpdates(_0x4e7cb9){return function(_0x304b96){try{jsonpatch[_0x172b('0x1e')](_0x304b96,_0x4e7cb9,!![]);}catch(_0x2bedae){return BPromise[_0x172b('0x1f')](_0x2bedae);}return _0x304b96[_0x172b('0x20')]();};}function saveUpdates(_0x266b13,_0x296aa6){return function(_0x5c7e17){if(_0x5c7e17){return _0x5c7e17['update'](_0x266b13)['then'](function(_0x5abb78){return _0x5abb78;});}return null;};}function removeEntity(_0x13cfc7,_0x4c8090){return function(_0x721d07){if(_0x721d07){return _0x721d07[_0x172b('0x21')]()[_0x172b('0x22')](function(){_0x13cfc7[_0x172b('0x18')](0xcc)[_0x172b('0x23')]();});}};}function handleEntityNotFound(_0x24e4ff,_0x507b99){return function(_0x1cefd1){if(!_0x1cefd1){_0x24e4ff[_0x172b('0x24')](0x194);}return _0x1cefd1;};}function handleError(_0x5ea2b2,_0x3858fc){_0x3858fc=_0x3858fc||0x1f4;return function(_0x3ed885){logger[_0x172b('0x25')](_0x3ed885[_0x172b('0x26')]);if(_0x3ed885[_0x172b('0x27')]){delete _0x3ed885[_0x172b('0x27')];}_0x5ea2b2[_0x172b('0x18')](_0x3858fc)['send'](_0x3ed885);};}exports[_0x172b('0x28')]=function(_0x22827a,_0x5c8603){var _0x4263a1={},_0x320253={},_0x3909b1={'count':0x0,'rows':[]};var _0xa58782=_[_0x172b('0x29')](db['VoiceMailMessage'][_0x172b('0x2a')],function(_0x37acc5){return{'name':_0x37acc5['fieldName'],'type':_0x37acc5['type'][_0x172b('0x2b')]};});_0x320253[_0x172b('0x2c')]=_[_0x172b('0x2d')](_[_0x172b('0x29')](_0xa58782,_0x172b('0x27')),[_0x172b('0x27')]);_0x320253[_0x172b('0x2e')]=_[_0x172b('0x2f')](_0x22827a[_0x172b('0x2e')]);_0x320253[_0x172b('0x30')]=_[_0x172b('0x31')](_0x320253[_0x172b('0x2c')],_0x320253[_0x172b('0x2e')]);_0x4263a1[_0x172b('0x32')]=_[_0x172b('0x31')](_0x320253[_0x172b('0x2c')],qs[_0x172b('0x33')](_0x22827a[_0x172b('0x2e')][_0x172b('0x33')]));_0x4263a1[_0x172b('0x32')]=_0x4263a1[_0x172b('0x32')][_0x172b('0x34')]?_0x4263a1[_0x172b('0x32')]:_0x320253[_0x172b('0x2c')];if(!_0x22827a[_0x172b('0x2e')]['hasOwnProperty'](_0x172b('0x35'))){_0x4263a1[_0x172b('0x1b')]=qs[_0x172b('0x1b')](_0x22827a['query'][_0x172b('0x1b')]);_0x4263a1['offset']=qs['offset'](_0x22827a['query'][_0x172b('0x36')]);}_0x4263a1['order']=qs['sort'](_0x22827a[_0x172b('0x2e')][_0x172b('0x37')]);_0x4263a1[_0x172b('0x38')]=qs['filters'](_[_0x172b('0x39')](_0x22827a[_0x172b('0x2e')],_0x320253[_0x172b('0x30')]));if(_0x22827a[_0x172b('0x2e')][_0x172b('0x3a')]){_0x4263a1[_0x172b('0x38')]=_[_0x172b('0x3b')](_0x4263a1[_0x172b('0x38')],{'$or':_[_0x172b('0x29')](_0xa58782,function(_0xbf287b){if(_0xbf287b[_0x172b('0x3c')]!==_0x172b('0x3d')){var _0x2e45fe={};_0x2e45fe[_0xbf287b[_0x172b('0x27')]]={'$like':'%'+_0x22827a[_0x172b('0x2e')][_0x172b('0x3a')]+'%'};return _0x2e45fe;}})});}_0x4263a1=_[_0x172b('0x3b')]({},_0x4263a1,_0x22827a[_0x172b('0x3e')]);var _0x47821e={'where':_0x4263a1['where']};return db['VoiceMailMessage'][_0x172b('0x1a')](_0x47821e)['then'](function(_0x5e8ff6){_0x3909b1['count']=_0x5e8ff6;if(_0x22827a[_0x172b('0x2e')][_0x172b('0x3f')]){_0x4263a1[_0x172b('0x40')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x172b('0x41')](_0x4263a1);})[_0x172b('0x22')](function(_0xb5452f){_0x3909b1['rows']=_0xb5452f;return _0x3909b1;})[_0x172b('0x22')](respondWithFilteredResult(_0x5c8603,_0x4263a1))['catch'](handleError(_0x5c8603,null));};exports[_0x172b('0x42')]=function(_0x4a05da,_0x362f83){var _0xc45ecd={'raw':!![],'where':{'id':_0x4a05da[_0x172b('0x43')]['id']}},_0x59bfd1={};_0x59bfd1[_0x172b('0x2c')]=_['keys'](db[_0x172b('0x44')][_0x172b('0x2a')]);_0x59bfd1[_0x172b('0x2e')]=_[_0x172b('0x2f')](_0x4a05da[_0x172b('0x2e')]);_0x59bfd1[_0x172b('0x30')]=_['intersection'](_0x59bfd1['model'],_0x59bfd1[_0x172b('0x2e')]);_0xc45ecd['attributes']=_['intersection'](_0x59bfd1['model'],qs[_0x172b('0x33')](_0x4a05da[_0x172b('0x2e')][_0x172b('0x33')]));_0xc45ecd[_0x172b('0x32')]=_0xc45ecd['attributes'][_0x172b('0x34')]?_0xc45ecd[_0x172b('0x32')]:_0x59bfd1[_0x172b('0x2c')];if(_0x4a05da[_0x172b('0x2e')][_0x172b('0x3f')]){_0xc45ecd[_0x172b('0x40')]=[{'all':!![]}];}_0xc45ecd=_[_0x172b('0x3b')]({},_0xc45ecd,_0x4a05da[_0x172b('0x3e')]);return db[_0x172b('0x44')][_0x172b('0x45')](_0xc45ecd)[_0x172b('0x22')](handleEntityNotFound(_0x362f83,null))[_0x172b('0x22')](respondWithResult(_0x362f83,null))['catch'](handleError(_0x362f83,null));};exports[_0x172b('0x46')]=function(_0x350a8c,_0x56bc8a){return db['VoiceMailMessage'][_0x172b('0x46')](_0x350a8c[_0x172b('0x47')],{})[_0x172b('0x22')](respondWithResult(_0x56bc8a,0xc9))['catch'](handleError(_0x56bc8a,null));};exports[_0x172b('0x48')]=function(_0x5e8e08,_0x52c55c){if(_0x5e8e08[_0x172b('0x47')]['id']){delete _0x5e8e08[_0x172b('0x47')]['id'];}return db[_0x172b('0x44')][_0x172b('0x45')]({'where':{'id':_0x5e8e08[_0x172b('0x43')]['id']}})[_0x172b('0x22')](handleEntityNotFound(_0x52c55c,null))[_0x172b('0x22')](saveUpdates(_0x5e8e08[_0x172b('0x47')],null))[_0x172b('0x22')](respondWithResult(_0x52c55c,null))[_0x172b('0x49')](handleError(_0x52c55c,null));};exports['destroy']=function(_0x4c7470,_0x382075){return db[_0x172b('0x44')]['find']({'where':{'id':_0x4c7470['params']['id']}})[_0x172b('0x22')](handleEntityNotFound(_0x382075,null))[_0x172b('0x22')](removeEntity(_0x382075,null))[_0x172b('0x49')](handleError(_0x382075,null));};exports[_0x172b('0x4a')]=function(_0x3dedd2,_0x1e1793,_0x5c0526){return db[_0x172b('0x44')]['find']({'where':{'id':_0x3dedd2['params']['id']},'attributes':['id',_0x172b('0x4b'),_0x172b('0x4c')]})[_0x172b('0x22')](handleEntityNotFound(_0x1e1793,null))['then'](function(_0x3c2fbd){if(_0x3c2fbd){if(!_0x3c2fbd[_0x172b('0x4b')]){throw new db[(_0x172b('0x4d'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x2cd795={'Content-Type':_0x172b('0x4e'),'Content-Disposition':_0x172b('0x4f')};if(_0x3c2fbd[_0x172b('0x4c')]){_0x2cd795[_0x172b('0x50')]=_0x172b('0x51')+_0x3c2fbd[_0x172b('0x4c')]+_0x172b('0x52');}_0x1e1793['set'](_0x2cd795);return _0x1e1793[_0x172b('0x53')](new Buffer(_0x3c2fbd['recording']));}})['catch'](handleError(_0x1e1793,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index f65edbc..0a79a8a 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 _0x0374=['api','moment','bluebird','request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','lodash','util'];(function(_0x36cb77,_0x367555){var _0x696ef3=function(_0x32d094){while(--_0x32d094){_0x36cb77['push'](_0x36cb77['shift']());}};_0x696ef3(++_0x367555);}(_0x0374,0x191));var _0x4037=function(_0x48b09d,_0x423cb3){_0x48b09d=_0x48b09d-0x0;var _0x54b12e=_0x0374[_0x48b09d];return _0x54b12e;};'use strict';var _=require(_0x4037('0x0'));var util=require(_0x4037('0x1'));var logger=require('../../config/logger')(_0x4037('0x2'));var moment=require(_0x4037('0x3'));var BPromise=require(_0x4037('0x4'));var rp=require(_0x4037('0x5'));var fs=require('fs');var path=require(_0x4037('0x6'));var rimraf=require('rimraf');var config=require(_0x4037('0x7'));var attributes=require(_0x4037('0x8'));module[_0x4037('0x9')]=function(_0x133b5e,_0x1f07a8){return _0x133b5e[_0x4037('0xa')]('VoiceMailMessage',attributes,{'tableName':_0x4037('0xb'),'paranoid':![],'indexes':[{'name':_0x4037('0xc'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0xff13=['define','VoiceMailMessage','dir','lodash','util','api','moment','bluebird','../../config/environment','exports'];(function(_0x2ef6ec,_0x3ea823){var _0x4b9617=function(_0x2fa4e5){while(--_0x2fa4e5){_0x2ef6ec['push'](_0x2ef6ec['shift']());}};_0x4b9617(++_0x3ea823);}(_0xff13,0xfd));var _0x3ff1=function(_0xb4e9d7,_0x4dd75a){_0xb4e9d7=_0xb4e9d7-0x0;var _0x99e9c5=_0xff13[_0xb4e9d7];return _0x99e9c5;};'use strict';var _=require(_0x3ff1('0x0'));var util=require(_0x3ff1('0x1'));var logger=require('../../config/logger')(_0x3ff1('0x2'));var moment=require(_0x3ff1('0x3'));var BPromise=require(_0x3ff1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3ff1('0x5'));var attributes=require('./voiceMailMessage.attributes');module[_0x3ff1('0x6')]=function(_0x155566,_0x49ecf1){return _0x155566[_0x3ff1('0x7')](_0x3ff1('0x8'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x3ff1('0x9'),'fields':[_0x3ff1('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 35d06f2..cb0912d 100644 --- a/server/api/voiceMailMessage/voiceMailMessage.rpc.js +++ b/server/api/voiceMailMessage/voiceMailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x159641,_0x292389){var _0x41c53a=function(_0x21dd62){while(--_0x21dd62){_0x159641['push'](_0x159641['shift']());}};_0x41c53a(++_0x292389);}(_0xda2d,0x102));var _0xdda2=function(_0x598cdb,_0x141498){_0x598cdb=_0x598cdb-0x0;var _0x14b2ee=_0xda2d[_0x598cdb];return _0x14b2ee;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0xe9cc36,_0x3aef0a){var _0x3caca7=function(_0x3e0109){while(--_0x3e0109){_0xe9cc36['push'](_0xe9cc36['shift']());}};_0x3caca7(++_0x3aef0a);}(_0x2ef3,0xba));var _0x32ef=function(_0x331361,_0x13dcdd){_0x331361=_0x331361-0x0;var _0x2984fe=_0x2ef3[_0x331361];return _0x2984fe;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index ebe6141..889a711 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 _0x226c=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','post','create','addSound','put','update','destroy','delete','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x226c,0x19e));var _0xc226=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x226c[_0x1035c1];return _0x308d67;};'use strict';var multer=require('multer');var util=require(_0xc226('0x0'));var path=require(_0xc226('0x1'));var timeout=require(_0xc226('0x2'));var express=require(_0xc226('0x3'));var router=express[_0xc226('0x4')]();var auth=require(_0xc226('0x5'));var interaction=require(_0xc226('0x6'));var config=require(_0xc226('0x7'));var controller=require(_0xc226('0x8'));router[_0xc226('0x9')]('/',auth[_0xc226('0xa')](),controller[_0xc226('0xb')]);router[_0xc226('0x9')](_0xc226('0xc'),auth['isAuthenticated'](),controller[_0xc226('0xd')]);router[_0xc226('0x9')](_0xc226('0xe'),auth['isAuthenticated'](),controller['getSounds']);router[_0xc226('0xf')]('/',auth['isAuthenticated'](),controller[_0xc226('0x10')]);router['post'](_0xc226('0xe'),auth[_0xc226('0xa')](),controller[_0xc226('0x11')]);router[_0xc226('0x12')](_0xc226('0xc'),auth[_0xc226('0xa')](),controller[_0xc226('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc226('0x14')]);router[_0xc226('0x15')]('/:id/sounds/:id2',auth[_0xc226('0xa')](),controller['removeSound']);module[_0xc226('0x16')]=router; \ No newline at end of file +var _0x2369=['util','path','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id/sounds','getSounds','post','addSound','put','/:id','update','delete','destroy','removeSound'];(function(_0x34c084,_0x52e1c0){var _0x2d6b17=function(_0x2c8bc5){while(--_0x2c8bc5){_0x34c084['push'](_0x34c084['shift']());}};_0x2d6b17(++_0x52e1c0);}(_0x2369,0x1e6));var _0x9236=function(_0x132c8a,_0x40e69e){_0x132c8a=_0x132c8a-0x0;var _0x19e165=_0x2369[_0x132c8a];return _0x19e165;};'use strict';var multer=require('multer');var util=require(_0x9236('0x0'));var path=require(_0x9236('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9236('0x2'));var config=require(_0x9236('0x3'));var controller=require(_0x9236('0x4'));router[_0x9236('0x5')]('/',auth[_0x9236('0x6')](),controller[_0x9236('0x7')]);router['get']('/:id',auth[_0x9236('0x6')](),controller['show']);router[_0x9236('0x5')](_0x9236('0x8'),auth[_0x9236('0x6')](),controller[_0x9236('0x9')]);router[_0x9236('0xa')]('/',auth[_0x9236('0x6')](),controller['create']);router[_0x9236('0xa')]('/:id/sounds',auth[_0x9236('0x6')](),controller[_0x9236('0xb')]);router[_0x9236('0xc')](_0x9236('0xd'),auth[_0x9236('0x6')](),controller[_0x9236('0xe')]);router[_0x9236('0xf')]('/:id',auth[_0x9236('0x6')](),controller[_0x9236('0x10')]);router['delete']('/:id/sounds/:id2',auth[_0x9236('0x6')](),controller[_0x9236('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 931f682..785e49b 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 _0xd51d=['BOOLEAN','sequelize','exports','STRING','name','ENUM','files','mp3nb','quietmp3nb','quietmp3','alpha','TIMESTAMP'];(function(_0x33038f,_0x4f0d31){var _0x1e7689=function(_0x15f9cd){while(--_0x15f9cd){_0x33038f['push'](_0x33038f['shift']());}};_0x1e7689(++_0x4f0d31);}(_0xd51d,0xa9));var _0xdd51=function(_0x11a0c3,_0xa7a55){_0x11a0c3=_0x11a0c3-0x0;var _0x47fb88=_0xd51d[_0x11a0c3];return _0x47fb88;};'use strict';var Sequelize=require(_0xdd51('0x0'));module[_0xdd51('0x1')]={'name':{'type':Sequelize[_0xdd51('0x2')],'allowNull':![],'unique':_0xdd51('0x3')},'mode':{'type':Sequelize[_0xdd51('0x4')]('custom',_0xdd51('0x5'),_0xdd51('0x6'),_0xdd51('0x7'),_0xdd51('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0xdd51('0x5')},'directory':{'type':Sequelize[_0xdd51('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xdd51('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xdd51('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xdd51('0x2')],'allowNull':!![],'defaultValue':_0xdd51('0x9')},'format':{'type':Sequelize[_0xdd51('0x2')],'allowNull':!![]},'stamp':{'type':_0xdd51('0xa')},'defaultEntry':{'type':Sequelize[_0xdd51('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb3ea=['mp3nb','quietmp3nb','quietmp3','mp3','alpha','sequelize','STRING','name','ENUM','custom','files'];(function(_0x5cb8ca,_0x1019d9){var _0x2c8e39=function(_0x3351f9){while(--_0x3351f9){_0x5cb8ca['push'](_0x5cb8ca['shift']());}};_0x2c8e39(++_0x1019d9);}(_0xb3ea,0x12e));var _0xab3e=function(_0x7764ba,_0x380251){_0x7764ba=_0x7764ba-0x0;var _0x2c5927=_0xb3ea[_0x7764ba];return _0x2c5927;};'use strict';var Sequelize=require(_0xab3e('0x0'));module['exports']={'name':{'type':Sequelize[_0xab3e('0x1')],'allowNull':![],'unique':_0xab3e('0x2')},'mode':{'type':Sequelize[_0xab3e('0x3')](_0xab3e('0x4'),_0xab3e('0x5'),_0xab3e('0x6'),_0xab3e('0x7'),_0xab3e('0x8'),_0xab3e('0x9')),'allowNull':!![],'defaultValue':_0xab3e('0x5')},'directory':{'type':Sequelize[_0xab3e('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xab3e('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xab3e('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xab3e('0x1')],'allowNull':!![],'defaultValue':_0xab3e('0xa')},'format':{'type':Sequelize[_0xab3e('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 af9ce1c..4214e99 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 _0x4916=['converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','save_name','symlinkSync','message','removeSound','id2','getSounds','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','name','send','map','VoiceMusicOnHold','rawAttributes','type','key','query','keys','filters','intersection','attributes','length','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','options','include','findAll','rows','catch','show','fields','includeAll','merge','find','body','params','create','sequelize','transaction','mode','root','server/files/moh','files','mkdirSync','directory','0777','user','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','forEach','unlinkSync','join','rmdirSync','ValidationError','addSound','Sound','findOne'];(function(_0x46c5ec,_0x18ebba){var _0x483737=function(_0x259b3e){while(--_0x259b3e){_0x46c5ec['push'](_0x46c5ec['shift']());}};_0x483737(++_0x18ebba);}(_0x4916,0xe1));var _0x6491=function(_0x323e01,_0x28decb){_0x323e01=_0x323e01-0x0;var _0x3372bd=_0x4916[_0x323e01];return _0x3372bd;};'use strict';var pdf=require(_0x6491('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6491('0x1'));var zipdir=require(_0x6491('0x2'));var jsonpatch=require(_0x6491('0x3'));var rp=require('request-promise');var moment=require(_0x6491('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6491('0x5'));var util=require(_0x6491('0x6'));var path=require('path');var sox=require(_0x6491('0x7'));var csv=require(_0x6491('0x8'));var ejs=require(_0x6491('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6491('0xa'));var jsforce=require(_0x6491('0xb'));var deskjs=require(_0x6491('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6491('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6491('0xe'));var hardwareService=require(_0x6491('0xf'));var logger=require(_0x6491('0x10'))(_0x6491('0x11'));var utils=require(_0x6491('0x12'));var config=require(_0x6491('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf5f7a5,_0x4cc478){_0x4cc478=_0x4cc478||0xcc;return function(_0x3fd84a){if(_0x3fd84a){return _0xf5f7a5[_0x6491('0x14')](_0x4cc478);}return _0xf5f7a5[_0x6491('0x15')](_0x4cc478)[_0x6491('0x16')]();};}function respondWithResult(_0x52b6ca,_0x4d8587){_0x4d8587=_0x4d8587||0xc8;return function(_0x31e2d6){if(_0x31e2d6){return _0x52b6ca[_0x6491('0x15')](_0x4d8587)[_0x6491('0x17')](_0x31e2d6);}};}function respondWithFilteredResult(_0x425dbd,_0x39618e){return function(_0x43456b){if(_0x43456b){var _0x264834=_0x43456b[_0x6491('0x18')],_0x1c4516=_0x39618e[_0x6491('0x19')],_0x175c9d=_0x39618e['offset']+_0x39618e['limit'],_0x1f4a03;if(_0x175c9d>=_0x264834){_0x175c9d=_0x264834;_0x1f4a03=0xc8;}else{_0x1f4a03=0xce;}_0x425dbd[_0x6491('0x15')](_0x1f4a03);return _0x425dbd['set'](_0x6491('0x1a'),_0x1c4516+'-'+_0x175c9d+'/'+_0x264834)[_0x6491('0x17')](_0x43456b);}return null;};}function patchUpdates(_0x371a11){return function(_0x376d90){try{jsonpatch[_0x6491('0x1b')](_0x376d90,_0x371a11,!![]);}catch(_0x192169){return BPromise['reject'](_0x192169);}return _0x376d90[_0x6491('0x1c')]();};}function saveUpdates(_0x21fea7,_0x433807){return function(_0x29450a){if(_0x29450a){return _0x29450a[_0x6491('0x1d')](_0x21fea7)[_0x6491('0x1e')](function(_0x26ee4a){return _0x26ee4a;});}return null;};}function removeEntity(_0x598a3a,_0x62216c){return function(_0x512ba5){if(_0x512ba5){return _0x512ba5[_0x6491('0x1f')]()[_0x6491('0x1e')](function(){var _0x24d8d6=_0x512ba5[_0x6491('0x20')]({'plain':!![]});var _0x58e275='MusicOnHolds';return db[_0x6491('0x21')][_0x6491('0x1f')]({'where':{'type':_0x58e275,'resourceId':_0x24d8d6['id']}})['then'](function(){return _0x512ba5;});})['then'](function(){_0x598a3a[_0x6491('0x15')](0xcc)[_0x6491('0x16')]();});}};}function handleEntityNotFound(_0x2a6001,_0xc06090){return function(_0x479837){if(!_0x479837){_0x2a6001[_0x6491('0x14')](0x194);}return _0x479837;};}function handleError(_0x50f4d8,_0x2f77be){_0x2f77be=_0x2f77be||0x1f4;return function(_0x26caae){logger[_0x6491('0x22')](_0x26caae['stack']);if(_0x26caae[_0x6491('0x23')]){delete _0x26caae[_0x6491('0x23')];}_0x50f4d8[_0x6491('0x15')](_0x2f77be)[_0x6491('0x24')](_0x26caae);};}exports['index']=function(_0x417251,_0xf1aa3e){var _0x2c7cbf={},_0x533c03={},_0x461da8={'count':0x0,'rows':[]};var _0x22750e=_[_0x6491('0x25')](db[_0x6491('0x26')][_0x6491('0x27')],function(_0x26af50){return{'name':_0x26af50['fieldName'],'type':_0x26af50[_0x6491('0x28')][_0x6491('0x29')]};});_0x533c03['model']=_[_0x6491('0x25')](_0x22750e,_0x6491('0x23'));_0x533c03[_0x6491('0x2a')]=_[_0x6491('0x2b')](_0x417251[_0x6491('0x2a')]);_0x533c03[_0x6491('0x2c')]=_[_0x6491('0x2d')](_0x533c03['model'],_0x533c03['query']);_0x2c7cbf[_0x6491('0x2e')]=_[_0x6491('0x2d')](_0x533c03['model'],qs['fields'](_0x417251[_0x6491('0x2a')]['fields']));_0x2c7cbf['attributes']=_0x2c7cbf['attributes'][_0x6491('0x2f')]?_0x2c7cbf['attributes']:_0x533c03[_0x6491('0x30')];if(!_0x417251[_0x6491('0x2a')][_0x6491('0x31')](_0x6491('0x32'))){_0x2c7cbf[_0x6491('0x33')]=qs[_0x6491('0x33')](_0x417251[_0x6491('0x2a')]['limit']);_0x2c7cbf[_0x6491('0x19')]=qs['offset'](_0x417251[_0x6491('0x2a')]['offset']);}_0x2c7cbf[_0x6491('0x34')]=qs[_0x6491('0x35')](_0x417251[_0x6491('0x2a')][_0x6491('0x35')]);_0x2c7cbf[_0x6491('0x36')]=qs[_0x6491('0x2c')](_[_0x6491('0x37')](_0x417251['query'],_0x533c03['filters']));if(_0x417251['query']['filter']){_0x2c7cbf[_0x6491('0x36')]=_['merge'](_0x2c7cbf['where'],{'$or':_[_0x6491('0x25')](_0x22750e,function(_0x5aee77){if(_0x5aee77['type']!==_0x6491('0x38')){var _0x3e0d6d={};_0x3e0d6d[_0x5aee77['name']]={'$like':'%'+_0x417251[_0x6491('0x2a')][_0x6491('0x39')]+'%'};return _0x3e0d6d;}})});}_0x2c7cbf=_['merge']({},_0x2c7cbf,_0x417251[_0x6491('0x3a')]);var _0x3b7e9a={'where':_0x2c7cbf[_0x6491('0x36')]};return db[_0x6491('0x26')]['count'](_0x3b7e9a)['then'](function(_0x1f15bb){_0x461da8[_0x6491('0x18')]=_0x1f15bb;if(_0x417251[_0x6491('0x2a')]['includeAll']){_0x2c7cbf[_0x6491('0x3b')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x6491('0x3c')](_0x2c7cbf);})[_0x6491('0x1e')](function(_0x31d13f){_0x461da8[_0x6491('0x3d')]=_0x31d13f;return _0x461da8;})[_0x6491('0x1e')](respondWithFilteredResult(_0xf1aa3e,_0x2c7cbf))[_0x6491('0x3e')](handleError(_0xf1aa3e,null));};exports[_0x6491('0x3f')]=function(_0x16c817,_0x2adaa0){var _0x24352a={'raw':![],'where':{'id':_0x16c817['params']['id']}},_0x2ec553={};_0x2ec553['model']=_[_0x6491('0x2b')](db['VoiceMusicOnHold'][_0x6491('0x27')]);_0x2ec553[_0x6491('0x2a')]=_[_0x6491('0x2b')](_0x16c817['query']);_0x2ec553[_0x6491('0x2c')]=_[_0x6491('0x2d')](_0x2ec553[_0x6491('0x30')],_0x2ec553[_0x6491('0x2a')]);_0x24352a[_0x6491('0x2e')]=_['intersection'](_0x2ec553['model'],qs[_0x6491('0x40')](_0x16c817[_0x6491('0x2a')][_0x6491('0x40')]));_0x24352a[_0x6491('0x2e')]=_0x24352a['attributes'][_0x6491('0x2f')]?_0x24352a[_0x6491('0x2e')]:_0x2ec553[_0x6491('0x30')];if(_0x16c817[_0x6491('0x2a')][_0x6491('0x41')]){_0x24352a[_0x6491('0x3b')]=[{'all':!![]}];}_0x24352a=_[_0x6491('0x42')]({},_0x24352a,_0x16c817[_0x6491('0x3a')]);return db[_0x6491('0x26')][_0x6491('0x43')](_0x24352a)['then'](handleEntityNotFound(_0x2adaa0,null))[_0x6491('0x1e')](respondWithResult(_0x2adaa0,null))['catch'](handleError(_0x2adaa0,null));};exports['update']=function(_0x38c081,_0x576f16){if(_0x38c081[_0x6491('0x44')]['id']){delete _0x38c081[_0x6491('0x44')]['id'];}return db[_0x6491('0x26')][_0x6491('0x43')]({'where':{'id':_0x38c081[_0x6491('0x45')]['id']}})[_0x6491('0x1e')](handleEntityNotFound(_0x576f16,null))['then'](saveUpdates(_0x38c081['body'],null))[_0x6491('0x1e')](respondWithResult(_0x576f16,null))['catch'](handleError(_0x576f16,null));};exports[_0x6491('0x46')]=function(_0x441ada,_0x3ccd14,_0x487636){return db[_0x6491('0x47')][_0x6491('0x48')](function(_0x49f49c){if(_0x441ada[_0x6491('0x44')][_0x6491('0x49')]==='files'){_0x441ada[_0x6491('0x44')]['directory']=path['join'](config[_0x6491('0x4a')],_0x6491('0x4b'),_0x441ada[_0x6491('0x44')][_0x6491('0x23')]);}return db[_0x6491('0x26')]['create'](_0x441ada['body'],{'transaction':_0x49f49c})[_0x6491('0x1e')](function(_0x108cf5){if(_0x441ada[_0x6491('0x44')]['mode']===_0x6491('0x4c')){fs[_0x6491('0x4d')](_0x108cf5[_0x6491('0x4e')],parseInt(_0x6491('0x4f'),0x8));}var _0x60a413=_0x441ada[_0x6491('0x50')][_0x6491('0x20')]({'plain':!![]});if(!_0x60a413)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x60a413['role']===_0x6491('0x50')){var _0x198c0d=_0x108cf5['get']({'plain':!![]});return db[_0x6491('0x51')][_0x6491('0x43')]({'where':{'name':_0x6491('0x52'),'userProfileId':_0x60a413[_0x6491('0x53')]},'raw':!![]})[_0x6491('0x1e')](function(_0x495c9a){if(_0x495c9a&&_0x495c9a[_0x6491('0x54')]===0x0){return db[_0x6491('0x21')][_0x6491('0x46')]({'name':_0x198c0d['name'],'resourceId':_0x198c0d['id'],'type':_0x495c9a[_0x6491('0x23')],'sectionId':_0x495c9a['id']},{})[_0x6491('0x1e')](function(){return _0x108cf5;});}else{return _0x108cf5;}})[_0x6491('0x3e')](function(_0xb90ba4){logger[_0x6491('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb90ba4);});}return _0x108cf5;});})[_0x6491('0x1e')](respondWithResult(_0x3ccd14,0xc9))[_0x6491('0x3e')](handleError(_0x3ccd14,null));};exports[_0x6491('0x1f')]=function(_0x2e1c4c,_0x589eef,_0xf85c3f){var _0x2b5cb1;return db[_0x6491('0x26')][_0x6491('0x43')]({'where':{'id':_0x2e1c4c[_0x6491('0x45')]['id']}})[_0x6491('0x1e')](function(_0xf9cf7b){if(_0xf9cf7b){return db['sequelize'][_0x6491('0x48')](function(_0x2effe1){return _0xf9cf7b[_0x6491('0x1f')]({'transaction':_0x2effe1,'raw':!![]})['then'](function(_0x32bb69){if(_0x32bb69[_0x6491('0x4e')]){fs['readdirSync'](_0x32bb69[_0x6491('0x4e')])[_0x6491('0x55')](function(_0x21c33b){fs[_0x6491('0x56')](path[_0x6491('0x57')](_0x32bb69[_0x6491('0x4e')],_0x21c33b));});fs[_0x6491('0x58')](_0x32bb69[_0x6491('0x4e')]);}return _0x32bb69;});})[_0x6491('0x3e')](function(_0x42cad9){throw new db['Sequelize'][(_0x6491('0x59'))](_0x42cad9['message']);});}})[_0x6491('0x1e')](handleEntityNotFound(_0x589eef,null))[_0x6491('0x1e')](removeEntity(_0x589eef,null))[_0x6491('0x3e')](handleError(_0x589eef,null));};exports[_0x6491('0x5a')]=function(_0x4264cc,_0x5a5b45,_0x4583eb){return db[_0x6491('0x47')]['transaction'](function(_0x3a92d3){var _0x25274b;return db['VoiceMusicOnHold'][_0x6491('0x43')]({'where':{'id':_0x4264cc[_0x6491('0x45')]['id']}})[_0x6491('0x1e')](function(_0x1a4323){if(_0x1a4323){_0x25274b=_0x1a4323;return _0x1a4323[_0x6491('0x5a')](_0x4264cc['body']['id'],{'transaction':_0x3a92d3});}})[_0x6491('0x1e')](function(_0x51978a){if(_0x51978a){return db[_0x6491('0x5b')][_0x6491('0x5c')]({'where':{'id':_0x4264cc[_0x6491('0x44')]['id']},'attributes':['id',_0x6491('0x23'),'save_name',_0x6491('0x5d'),_0x6491('0x5e')],'raw':!![]});}})[_0x6491('0x1e')](function(_0x59aee4){if(_0x59aee4){var _0x548310=path[_0x6491('0x57')](config[_0x6491('0x4a')],_0x6491('0x5f'),util[_0x6491('0x60')](_0x6491('0x61'),path[_0x6491('0x62')](_0x59aee4['save_name'],path[_0x6491('0x63')](_0x59aee4[_0x6491('0x64')])),_0x59aee4['converted_format']));var _0x1f620e=path[_0x6491('0x57')](config['root'],_0x6491('0x4b'),_0x25274b[_0x6491('0x23')],util[_0x6491('0x60')]('%s.%s',_0x59aee4['name'],_0x59aee4[_0x6491('0x5d')]));fs[_0x6491('0x65')](_0x548310,_0x1f620e);return _0x59aee4;}})['catch'](function(_0x285891){throw new db['Sequelize'][(_0x6491('0x59'))](_0x285891[_0x6491('0x66')]);});})[_0x6491('0x1e')](handleEntityNotFound(_0x5a5b45,null))[_0x6491('0x1e')](respondWithResult(_0x5a5b45,0xc9))[_0x6491('0x3e')](handleError(_0x5a5b45,null));};exports[_0x6491('0x67')]=function(_0x1e42ff,_0x3a75ef,_0x440c1e){return db[_0x6491('0x47')]['transaction'](function(_0xd04c0){var _0x82c4c1;return db[_0x6491('0x26')][_0x6491('0x5c')]({'where':{'id':_0x1e42ff[_0x6491('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a75ef,null))[_0x6491('0x1e')](function(_0x32d84b){if(_0x32d84b){_0x82c4c1=_0x32d84b;return _0x32d84b[_0x6491('0x67')](_0x1e42ff['params'][_0x6491('0x68')]);}})['then'](function(_0x1d12fc){if(_0x1d12fc){return db['Sound'][_0x6491('0x5c')]({'where':{'id':_0x1e42ff['params']['id2']},'attributes':['id',_0x6491('0x23'),_0x6491('0x64'),_0x6491('0x5d'),_0x6491('0x5e')],'raw':!![]});}})[_0x6491('0x1e')](function(_0x3097b3){if(_0x3097b3){fs[_0x6491('0x56')](path[_0x6491('0x57')](_0x82c4c1[_0x6491('0x4e')],util[_0x6491('0x60')](_0x6491('0x61'),_0x3097b3[_0x6491('0x23')],_0x3097b3['converted_format'])));return _0x3097b3;}})[_0x6491('0x3e')](function(_0x4a8208){throw new db['Sequelize']['ValidationError'](_0x4a8208[_0x6491('0x66')]);});})[_0x6491('0x1e')](handleEntityNotFound(_0x3a75ef,null))['then'](respondWithStatusCode(_0x3a75ef,0xcc))['catch'](handleError(_0x3a75ef,null));};exports[_0x6491('0x69')]=function(_0x323867,_0x15cef6,_0x3a01a7){var _0x332168={};var _0x3a6abb={};var _0x4b89ce;var _0x3f49b0;return db['VoiceMusicOnHold'][_0x6491('0x5c')]({'where':{'id':_0x323867[_0x6491('0x45')]['id']}})[_0x6491('0x1e')](handleEntityNotFound(_0x15cef6,null))[_0x6491('0x1e')](function(_0x1c41d0){if(_0x1c41d0){_0x4b89ce=_0x1c41d0;_0x3a6abb[_0x6491('0x30')]=_['keys'](db[_0x6491('0x5b')][_0x6491('0x27')]);_0x3a6abb['query']=_['keys'](_0x323867[_0x6491('0x2a')]);_0x3a6abb[_0x6491('0x2c')]=_[_0x6491('0x2d')](_0x3a6abb['model'],_0x3a6abb['query']);_0x332168['attributes']=_[_0x6491('0x2d')](_0x3a6abb[_0x6491('0x30')],qs[_0x6491('0x40')](_0x323867[_0x6491('0x2a')][_0x6491('0x40')]));_0x332168[_0x6491('0x2e')]=_0x332168[_0x6491('0x2e')][_0x6491('0x2f')]?_0x332168[_0x6491('0x2e')]:_0x3a6abb[_0x6491('0x30')];_0x332168[_0x6491('0x34')]=qs['sort'](_0x323867[_0x6491('0x2a')]['sort']);_0x332168[_0x6491('0x36')]=qs[_0x6491('0x2c')](_[_0x6491('0x37')](_0x323867['query'],_0x3a6abb[_0x6491('0x2c')]));if(_0x323867[_0x6491('0x2a')][_0x6491('0x39')]){_0x332168['where']=_[_0x6491('0x42')](_0x332168[_0x6491('0x36')],{'$or':_['map'](_0x332168[_0x6491('0x2e')],function(_0x14558d){var _0x47642b={};_0x47642b[_0x14558d]={'$like':'%'+_0x323867['query']['filter']+'%'};return _0x47642b;})});}_0x332168=_[_0x6491('0x42')]({},_0x332168,_0x323867[_0x6491('0x3a')]);return _0x4b89ce['getSounds'](_0x332168);}})[_0x6491('0x1e')](function(_0x1f96ac){if(_0x1f96ac){_0x3f49b0=_0x1f96ac['length'];if(!_0x323867[_0x6491('0x2a')][_0x6491('0x31')](_0x6491('0x32'))){_0x332168[_0x6491('0x33')]=qs[_0x6491('0x33')](_0x323867[_0x6491('0x2a')]['limit']);_0x332168['offset']=qs[_0x6491('0x19')](_0x323867[_0x6491('0x2a')][_0x6491('0x19')]);}return _0x4b89ce[_0x6491('0x69')](_0x332168);}})[_0x6491('0x1e')](function(_0x1e9409){if(_0x1e9409){return _0x1e9409?{'count':_0x3f49b0,'rows':_0x1e9409}:null;}})['then'](respondWithResult(_0x15cef6,null))['catch'](handleError(_0x15cef6,null));}; \ No newline at end of file +var _0xde13=['reject','save','update','then','destroy','MusicOnHolds','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','VoiceMusicOnHold','find','body','sequelize','transaction','mode','files','root','server/files/moh','create','directory','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','join','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','symlinkSync','ValidationError','removeSound','id2','unlinkSync','Sequelize','getSounds','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json'];(function(_0xcc24e8,_0x230fe5){var _0x279917=function(_0x5838ad){while(--_0x5838ad){_0xcc24e8['push'](_0xcc24e8['shift']());}};_0x279917(++_0x230fe5);}(_0xde13,0x139));var _0x3de1=function(_0x3d758f,_0x4212d1){_0x3d758f=_0x3d758f-0x0;var _0xd47cf6=_0xde13[_0x3d758f];return _0xd47cf6;};'use strict';var pdf=require(_0x3de1('0x0'));var emlformat=require(_0x3de1('0x1'));var rimraf=require(_0x3de1('0x2'));var zipdir=require(_0x3de1('0x3'));var jsonpatch=require(_0x3de1('0x4'));var rp=require(_0x3de1('0x5'));var moment=require(_0x3de1('0x6'));var BPromise=require(_0x3de1('0x7'));var Mustache=require('mustache');var util=require(_0x3de1('0x8'));var path=require(_0x3de1('0x9'));var sox=require(_0x3de1('0xa'));var csv=require(_0x3de1('0xb'));var ejs=require(_0x3de1('0xc'));var fs=require('fs');var _=require(_0x3de1('0xd'));var squel=require('squel');var crypto=require(_0x3de1('0xe'));var jsforce=require(_0x3de1('0xf'));var deskjs=require(_0x3de1('0x10'));var toCsv=require(_0x3de1('0xb'));var querystring=require(_0x3de1('0x11'));var Papa=require(_0x3de1('0x12'));var Redis=require(_0x3de1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3de1('0x14'));var as=require(_0x3de1('0x15'));var hardwareService=require(_0x3de1('0x16'));var logger=require(_0x3de1('0x17'))(_0x3de1('0x18'));var utils=require('../../config/utils');var config=require(_0x3de1('0x19'));var db=require(_0x3de1('0x1a'))['db'];function respondWithStatusCode(_0x502510,_0x5cdc35){_0x5cdc35=_0x5cdc35||0xcc;return function(_0x1a54f8){if(_0x1a54f8){return _0x502510[_0x3de1('0x1b')](_0x5cdc35);}return _0x502510[_0x3de1('0x1c')](_0x5cdc35)[_0x3de1('0x1d')]();};}function respondWithResult(_0x2f3ab5,_0x3e80f8){_0x3e80f8=_0x3e80f8||0xc8;return function(_0x18a04d){if(_0x18a04d){return _0x2f3ab5['status'](_0x3e80f8)['json'](_0x18a04d);}};}function respondWithFilteredResult(_0x81b295,_0x32133f){return function(_0x3c7ef7){if(_0x3c7ef7){var _0x49b2cd=_0x3c7ef7[_0x3de1('0x1e')],_0x5888db=_0x32133f[_0x3de1('0x1f')],_0x2e73ae=_0x32133f['offset']+_0x32133f[_0x3de1('0x20')],_0x5c3ef0;if(_0x2e73ae>=_0x49b2cd){_0x2e73ae=_0x49b2cd;_0x5c3ef0=0xc8;}else{_0x5c3ef0=0xce;}_0x81b295[_0x3de1('0x1c')](_0x5c3ef0);return _0x81b295[_0x3de1('0x21')]('Content-Range',_0x5888db+'-'+_0x2e73ae+'/'+_0x49b2cd)[_0x3de1('0x22')](_0x3c7ef7);}return null;};}function patchUpdates(_0x320bee){return function(_0x5cec80){try{jsonpatch['apply'](_0x5cec80,_0x320bee,!![]);}catch(_0x7b90eb){return BPromise[_0x3de1('0x23')](_0x7b90eb);}return _0x5cec80[_0x3de1('0x24')]();};}function saveUpdates(_0x52b546,_0x172e4e){return function(_0x3155fa){if(_0x3155fa){return _0x3155fa[_0x3de1('0x25')](_0x52b546)[_0x3de1('0x26')](function(_0x178703){return _0x178703;});}return null;};}function removeEntity(_0x40d58a,_0x306c69){return function(_0x4c7ccc){if(_0x4c7ccc){return _0x4c7ccc[_0x3de1('0x27')]()[_0x3de1('0x26')](function(){var _0x1f78cb=_0x4c7ccc['get']({'plain':!![]});var _0x57d782=_0x3de1('0x28');return db[_0x3de1('0x29')][_0x3de1('0x27')]({'where':{'type':_0x57d782,'resourceId':_0x1f78cb['id']}})[_0x3de1('0x26')](function(){return _0x4c7ccc;});})[_0x3de1('0x26')](function(){_0x40d58a[_0x3de1('0x1c')](0xcc)[_0x3de1('0x1d')]();});}};}function handleEntityNotFound(_0x16b0f6,_0x5905f1){return function(_0x3131e0){if(!_0x3131e0){_0x16b0f6[_0x3de1('0x1b')](0x194);}return _0x3131e0;};}function handleError(_0x1d2f68,_0x3d28f9){_0x3d28f9=_0x3d28f9||0x1f4;return function(_0x4c7775){logger[_0x3de1('0x2a')](_0x4c7775[_0x3de1('0x2b')]);if(_0x4c7775[_0x3de1('0x2c')]){delete _0x4c7775[_0x3de1('0x2c')];}_0x1d2f68[_0x3de1('0x1c')](_0x3d28f9)[_0x3de1('0x2d')](_0x4c7775);};}exports[_0x3de1('0x2e')]=function(_0x3e7592,_0x2f2848){var _0x4d069f={},_0x2f3724={},_0x4ef9e2={'count':0x0,'rows':[]};var _0x5bc560=_[_0x3de1('0x2f')](db['VoiceMusicOnHold'][_0x3de1('0x30')],function(_0x503134){return{'name':_0x503134[_0x3de1('0x31')],'type':_0x503134[_0x3de1('0x32')][_0x3de1('0x33')]};});_0x2f3724['model']=_['map'](_0x5bc560,_0x3de1('0x2c'));_0x2f3724[_0x3de1('0x34')]=_[_0x3de1('0x35')](_0x3e7592[_0x3de1('0x34')]);_0x2f3724['filters']=_[_0x3de1('0x36')](_0x2f3724[_0x3de1('0x37')],_0x2f3724[_0x3de1('0x34')]);_0x4d069f[_0x3de1('0x38')]=_[_0x3de1('0x36')](_0x2f3724['model'],qs[_0x3de1('0x39')](_0x3e7592[_0x3de1('0x34')]['fields']));_0x4d069f[_0x3de1('0x38')]=_0x4d069f['attributes'][_0x3de1('0x3a')]?_0x4d069f[_0x3de1('0x38')]:_0x2f3724[_0x3de1('0x37')];if(!_0x3e7592['query']['hasOwnProperty'](_0x3de1('0x3b'))){_0x4d069f[_0x3de1('0x20')]=qs[_0x3de1('0x20')](_0x3e7592[_0x3de1('0x34')][_0x3de1('0x20')]);_0x4d069f[_0x3de1('0x1f')]=qs['offset'](_0x3e7592[_0x3de1('0x34')][_0x3de1('0x1f')]);}_0x4d069f[_0x3de1('0x3c')]=qs[_0x3de1('0x3d')](_0x3e7592[_0x3de1('0x34')][_0x3de1('0x3d')]);_0x4d069f['where']=qs['filters'](_[_0x3de1('0x3e')](_0x3e7592[_0x3de1('0x34')],_0x2f3724[_0x3de1('0x3f')]));if(_0x3e7592['query'][_0x3de1('0x40')]){_0x4d069f[_0x3de1('0x41')]=_[_0x3de1('0x42')](_0x4d069f[_0x3de1('0x41')],{'$or':_[_0x3de1('0x2f')](_0x5bc560,function(_0x2c7ee4){if(_0x2c7ee4[_0x3de1('0x32')]!==_0x3de1('0x43')){var _0x4a8426={};_0x4a8426[_0x2c7ee4[_0x3de1('0x2c')]]={'$like':'%'+_0x3e7592[_0x3de1('0x34')]['filter']+'%'};return _0x4a8426;}})});}_0x4d069f=_[_0x3de1('0x42')]({},_0x4d069f,_0x3e7592[_0x3de1('0x44')]);var _0x89b47d={'where':_0x4d069f[_0x3de1('0x41')]};return db['VoiceMusicOnHold']['count'](_0x89b47d)[_0x3de1('0x26')](function(_0x5c6c8a){_0x4ef9e2[_0x3de1('0x1e')]=_0x5c6c8a;if(_0x3e7592[_0x3de1('0x34')][_0x3de1('0x45')]){_0x4d069f[_0x3de1('0x46')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x3de1('0x47')](_0x4d069f);})['then'](function(_0x338b8a){_0x4ef9e2['rows']=_0x338b8a;return _0x4ef9e2;})['then'](respondWithFilteredResult(_0x2f2848,_0x4d069f))[_0x3de1('0x48')](handleError(_0x2f2848,null));};exports[_0x3de1('0x49')]=function(_0x59e744,_0x509a3d){var _0xb80295={'raw':![],'where':{'id':_0x59e744[_0x3de1('0x4a')]['id']}},_0x4f3fea={};_0x4f3fea[_0x3de1('0x37')]=_['keys'](db['VoiceMusicOnHold'][_0x3de1('0x30')]);_0x4f3fea[_0x3de1('0x34')]=_[_0x3de1('0x35')](_0x59e744[_0x3de1('0x34')]);_0x4f3fea[_0x3de1('0x3f')]=_[_0x3de1('0x36')](_0x4f3fea[_0x3de1('0x37')],_0x4f3fea[_0x3de1('0x34')]);_0xb80295['attributes']=_[_0x3de1('0x36')](_0x4f3fea[_0x3de1('0x37')],qs[_0x3de1('0x39')](_0x59e744[_0x3de1('0x34')][_0x3de1('0x39')]));_0xb80295[_0x3de1('0x38')]=_0xb80295[_0x3de1('0x38')][_0x3de1('0x3a')]?_0xb80295[_0x3de1('0x38')]:_0x4f3fea['model'];if(_0x59e744[_0x3de1('0x34')][_0x3de1('0x45')]){_0xb80295['include']=[{'all':!![]}];}_0xb80295=_['merge']({},_0xb80295,_0x59e744[_0x3de1('0x44')]);return db[_0x3de1('0x4b')][_0x3de1('0x4c')](_0xb80295)[_0x3de1('0x26')](handleEntityNotFound(_0x509a3d,null))['then'](respondWithResult(_0x509a3d,null))[_0x3de1('0x48')](handleError(_0x509a3d,null));};exports['update']=function(_0x333962,_0x420bed){if(_0x333962['body']['id']){delete _0x333962[_0x3de1('0x4d')]['id'];}return db[_0x3de1('0x4b')][_0x3de1('0x4c')]({'where':{'id':_0x333962[_0x3de1('0x4a')]['id']}})[_0x3de1('0x26')](handleEntityNotFound(_0x420bed,null))['then'](saveUpdates(_0x333962[_0x3de1('0x4d')],null))[_0x3de1('0x26')](respondWithResult(_0x420bed,null))[_0x3de1('0x48')](handleError(_0x420bed,null));};exports['create']=function(_0x4a8a5c,_0xfffece,_0x3769ac){return db[_0x3de1('0x4e')][_0x3de1('0x4f')](function(_0x4691bf){if(_0x4a8a5c[_0x3de1('0x4d')][_0x3de1('0x50')]===_0x3de1('0x51')){_0x4a8a5c[_0x3de1('0x4d')]['directory']=path['join'](config[_0x3de1('0x52')],_0x3de1('0x53'),_0x4a8a5c[_0x3de1('0x4d')][_0x3de1('0x2c')]);}return db[_0x3de1('0x4b')][_0x3de1('0x54')](_0x4a8a5c['body'],{'transaction':_0x4691bf})['then'](function(_0x15fc28){if(_0x4a8a5c['body'][_0x3de1('0x50')]===_0x3de1('0x51')){fs['mkdirSync'](_0x15fc28[_0x3de1('0x55')],parseInt(_0x3de1('0x56'),0x8));}var _0x4087f6=_0x4a8a5c[_0x3de1('0x57')][_0x3de1('0x58')]({'plain':!![]});if(!_0x4087f6)throw new Error(_0x3de1('0x59'));if(_0x4087f6[_0x3de1('0x5a')]===_0x3de1('0x57')){var _0x19f7c4=_0x15fc28[_0x3de1('0x58')]({'plain':!![]});return db[_0x3de1('0x5b')][_0x3de1('0x4c')]({'where':{'name':_0x3de1('0x28'),'userProfileId':_0x4087f6[_0x3de1('0x5c')]},'raw':!![]})['then'](function(_0x2d085b){if(_0x2d085b&&_0x2d085b['autoAssociation']===0x0){return db['UserProfileResource'][_0x3de1('0x54')]({'name':_0x19f7c4[_0x3de1('0x2c')],'resourceId':_0x19f7c4['id'],'type':_0x2d085b[_0x3de1('0x2c')],'sectionId':_0x2d085b['id']},{})['then'](function(){return _0x15fc28;});}else{return _0x15fc28;}})[_0x3de1('0x48')](function(_0x270f96){logger[_0x3de1('0x2a')](_0x3de1('0x5d'),_0x270f96);});}return _0x15fc28;});})[_0x3de1('0x26')](respondWithResult(_0xfffece,0xc9))['catch'](handleError(_0xfffece,null));};exports[_0x3de1('0x27')]=function(_0x5c2a75,_0x4a7112,_0x9d908c){var _0x132bd3;return db[_0x3de1('0x4b')][_0x3de1('0x4c')]({'where':{'id':_0x5c2a75[_0x3de1('0x4a')]['id']}})['then'](function(_0x38d8b4){if(_0x38d8b4){return db[_0x3de1('0x4e')]['transaction'](function(_0x2138e2){return _0x38d8b4['destroy']({'transaction':_0x2138e2,'raw':!![]})[_0x3de1('0x26')](function(_0x2f36d2){if(_0x2f36d2[_0x3de1('0x55')]){fs[_0x3de1('0x5e')](_0x2f36d2[_0x3de1('0x55')])[_0x3de1('0x5f')](function(_0x136475){fs['unlinkSync'](path[_0x3de1('0x60')](_0x2f36d2[_0x3de1('0x55')],_0x136475));});fs['rmdirSync'](_0x2f36d2[_0x3de1('0x55')]);}return _0x2f36d2;});})[_0x3de1('0x48')](function(_0x102282){throw new db['Sequelize']['ValidationError'](_0x102282[_0x3de1('0x61')]);});}})[_0x3de1('0x26')](handleEntityNotFound(_0x4a7112,null))[_0x3de1('0x26')](removeEntity(_0x4a7112,null))[_0x3de1('0x48')](handleError(_0x4a7112,null));};exports[_0x3de1('0x62')]=function(_0x28abd8,_0x1e17f5,_0x56b0e4){return db[_0x3de1('0x4e')][_0x3de1('0x4f')](function(_0xaf4907){var _0x2745da;return db[_0x3de1('0x4b')]['find']({'where':{'id':_0x28abd8[_0x3de1('0x4a')]['id']}})[_0x3de1('0x26')](function(_0x52b58c){if(_0x52b58c){_0x2745da=_0x52b58c;return _0x52b58c[_0x3de1('0x62')](_0x28abd8[_0x3de1('0x4d')]['id'],{'transaction':_0xaf4907});}})['then'](function(_0x2e17e2){if(_0x2e17e2){return db[_0x3de1('0x63')][_0x3de1('0x64')]({'where':{'id':_0x28abd8[_0x3de1('0x4d')]['id']},'attributes':['id',_0x3de1('0x2c'),_0x3de1('0x65'),_0x3de1('0x66'),_0x3de1('0x67')],'raw':!![]});}})[_0x3de1('0x26')](function(_0x31fabc){if(_0x31fabc){var _0x152c1d=path[_0x3de1('0x60')](config['root'],_0x3de1('0x68'),util[_0x3de1('0x69')](_0x3de1('0x6a'),path['basename'](_0x31fabc[_0x3de1('0x65')],path[_0x3de1('0x6b')](_0x31fabc[_0x3de1('0x65')])),_0x31fabc[_0x3de1('0x66')]));var _0x41156a=path[_0x3de1('0x60')](config[_0x3de1('0x52')],_0x3de1('0x53'),_0x2745da['name'],util[_0x3de1('0x69')](_0x3de1('0x6a'),_0x31fabc['name'],_0x31fabc['converted_format']));fs[_0x3de1('0x6c')](_0x152c1d,_0x41156a);return _0x31fabc;}})['catch'](function(_0x2eeb0b){throw new db['Sequelize'][(_0x3de1('0x6d'))](_0x2eeb0b['message']);});})['then'](handleEntityNotFound(_0x1e17f5,null))['then'](respondWithResult(_0x1e17f5,0xc9))['catch'](handleError(_0x1e17f5,null));};exports['removeSound']=function(_0x4a8299,_0x9c7c7f,_0x339adc){return db[_0x3de1('0x4e')][_0x3de1('0x4f')](function(_0x4e2734){var _0x540d0b;return db[_0x3de1('0x4b')]['findOne']({'where':{'id':_0x4a8299['params']['id']}})[_0x3de1('0x26')](handleEntityNotFound(_0x9c7c7f,null))[_0x3de1('0x26')](function(_0x2d5d81){if(_0x2d5d81){_0x540d0b=_0x2d5d81;return _0x2d5d81[_0x3de1('0x6e')](_0x4a8299['params'][_0x3de1('0x6f')]);}})[_0x3de1('0x26')](function(_0x74caa4){if(_0x74caa4){return db[_0x3de1('0x63')][_0x3de1('0x64')]({'where':{'id':_0x4a8299[_0x3de1('0x4a')][_0x3de1('0x6f')]},'attributes':['id','name',_0x3de1('0x65'),'converted_format',_0x3de1('0x67')],'raw':!![]});}})[_0x3de1('0x26')](function(_0x5774a8){if(_0x5774a8){fs[_0x3de1('0x70')](path[_0x3de1('0x60')](_0x540d0b[_0x3de1('0x55')],util['format'](_0x3de1('0x6a'),_0x5774a8[_0x3de1('0x2c')],_0x5774a8[_0x3de1('0x66')])));return _0x5774a8;}})[_0x3de1('0x48')](function(_0x4272b2){throw new db[(_0x3de1('0x71'))][(_0x3de1('0x6d'))](_0x4272b2[_0x3de1('0x61')]);});})['then'](handleEntityNotFound(_0x9c7c7f,null))[_0x3de1('0x26')](respondWithStatusCode(_0x9c7c7f,0xcc))[_0x3de1('0x48')](handleError(_0x9c7c7f,null));};exports[_0x3de1('0x72')]=function(_0x35eb86,_0x2fa1f0,_0x2aa78a){var _0x4b0b6f={};var _0x1ea740={};var _0x581ac5;var _0x4e2e08;return db[_0x3de1('0x4b')][_0x3de1('0x64')]({'where':{'id':_0x35eb86['params']['id']}})[_0x3de1('0x26')](handleEntityNotFound(_0x2fa1f0,null))[_0x3de1('0x26')](function(_0x202ebf){if(_0x202ebf){_0x581ac5=_0x202ebf;_0x1ea740['model']=_[_0x3de1('0x35')](db['Sound']['rawAttributes']);_0x1ea740[_0x3de1('0x34')]=_['keys'](_0x35eb86[_0x3de1('0x34')]);_0x1ea740['filters']=_['intersection'](_0x1ea740[_0x3de1('0x37')],_0x1ea740['query']);_0x4b0b6f[_0x3de1('0x38')]=_[_0x3de1('0x36')](_0x1ea740[_0x3de1('0x37')],qs[_0x3de1('0x39')](_0x35eb86[_0x3de1('0x34')][_0x3de1('0x39')]));_0x4b0b6f[_0x3de1('0x38')]=_0x4b0b6f[_0x3de1('0x38')][_0x3de1('0x3a')]?_0x4b0b6f[_0x3de1('0x38')]:_0x1ea740[_0x3de1('0x37')];_0x4b0b6f['order']=qs[_0x3de1('0x3d')](_0x35eb86[_0x3de1('0x34')][_0x3de1('0x3d')]);_0x4b0b6f[_0x3de1('0x41')]=qs[_0x3de1('0x3f')](_[_0x3de1('0x3e')](_0x35eb86['query'],_0x1ea740[_0x3de1('0x3f')]));if(_0x35eb86[_0x3de1('0x34')][_0x3de1('0x40')]){_0x4b0b6f['where']=_[_0x3de1('0x42')](_0x4b0b6f[_0x3de1('0x41')],{'$or':_['map'](_0x4b0b6f[_0x3de1('0x38')],function(_0x1dab2f){var _0x1345da={};_0x1345da[_0x1dab2f]={'$like':'%'+_0x35eb86[_0x3de1('0x34')][_0x3de1('0x40')]+'%'};return _0x1345da;})});}_0x4b0b6f=_[_0x3de1('0x42')]({},_0x4b0b6f,_0x35eb86[_0x3de1('0x44')]);return _0x581ac5[_0x3de1('0x72')](_0x4b0b6f);}})[_0x3de1('0x26')](function(_0x4982b1){if(_0x4982b1){_0x4e2e08=_0x4982b1[_0x3de1('0x3a')];if(!_0x35eb86['query'][_0x3de1('0x73')](_0x3de1('0x3b'))){_0x4b0b6f[_0x3de1('0x20')]=qs[_0x3de1('0x20')](_0x35eb86[_0x3de1('0x34')][_0x3de1('0x20')]);_0x4b0b6f[_0x3de1('0x1f')]=qs[_0x3de1('0x1f')](_0x35eb86['query']['offset']);}return _0x581ac5[_0x3de1('0x72')](_0x4b0b6f);}})[_0x3de1('0x26')](function(_0x4759ab){if(_0x4759ab){return _0x4759ab?{'count':_0x4e2e08,'rows':_0x4759ab}:null;}})[_0x3de1('0x26')](respondWithResult(_0x2fa1f0,null))['catch'](handleError(_0x2fa1f0,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index d2cf47e..9b711ec 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 _0x6d4f=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','moment','bluebird','request-promise'];(function(_0x4d45c1,_0x2beda1){var _0x244478=function(_0x11304c){while(--_0x11304c){_0x4d45c1['push'](_0x4d45c1['shift']());}};_0x244478(++_0x2beda1);}(_0x6d4f,0x1cf));var _0xf6d4=function(_0x51b52e,_0x3c2506){_0x51b52e=_0x51b52e-0x0;var _0x59a011=_0x6d4f[_0x51b52e];return _0x59a011;};'use strict';var _=require(_0xf6d4('0x0'));var util=require(_0xf6d4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf6d4('0x2'));var BPromise=require(_0xf6d4('0x3'));var rp=require(_0xf6d4('0x4'));var fs=require('fs');var path=require(_0xf6d4('0x5'));var rimraf=require(_0xf6d4('0x6'));var config=require(_0xf6d4('0x7'));var attributes=require(_0xf6d4('0x8'));module[_0xf6d4('0x9')]=function(_0x33e0ed,_0x46ae4b){return _0x33e0ed[_0xf6d4('0xa')](_0xf6d4('0xb'),attributes,{'tableName':_0xf6d4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e58=['path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5b7755,_0x44681c){var _0x1a9c39=function(_0x56ceec){while(--_0x56ceec){_0x5b7755['push'](_0x5b7755['shift']());}};_0x1a9c39(++_0x44681c);}(_0x4e58,0xa3));var _0x84e5=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0x4e58[_0x1a0daa];return _0x1dbe15;};'use strict';var _=require(_0x84e5('0x0'));var util=require(_0x84e5('0x1'));var logger=require(_0x84e5('0x2'))('api');var moment=require(_0x84e5('0x3'));var BPromise=require(_0x84e5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84e5('0x5'));var rimraf=require('rimraf');var config=require(_0x84e5('0x6'));var attributes=require(_0x84e5('0x7'));module[_0x84e5('0x8')]=function(_0x4f8145,_0x289b65){return _0x4f8145[_0x84e5('0x9')](_0x84e5('0xa'),attributes,{'tableName':_0x84e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 7eb9e32..2248ce8 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 _0x02fc=['lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x02fc,0xa0));var _0xc02f=function(_0x23a822,_0xebc746){_0x23a822=_0x23a822-0x0;var _0x3c1736=_0x02fc[_0x23a822];return _0x3c1736;};'use strict';var _=require(_0xc02f('0x0'));var util=require('util');var moment=require(_0xc02f('0x1'));var BPromise=require('bluebird');var rs=require(_0xc02f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc02f('0x3'))['db'];var utils=require(_0xc02f('0x4'));var logger=require(_0xc02f('0x5'))('rpc');var config=require(_0xc02f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc02f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x51945f,_0x4274a0,_0xc0acb2){return new BPromise(function(_0x288254,_0x35e119){return client[_0xc02f('0x8')](_0x51945f,_0xc0acb2)[_0xc02f('0x9')](function(_0x22b356){logger[_0xc02f('0xa')](_0xc02f('0xb'),_0x4274a0,_0xc02f('0xc'));logger[_0xc02f('0xd')](_0xc02f('0xe'),_0x4274a0,_0xc02f('0xc'),JSON['stringify'](_0x22b356));if(_0x22b356['error']){if(_0x22b356[_0xc02f('0xf')][_0xc02f('0x10')]===0x1f4){logger[_0xc02f('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4274a0,_0x22b356['error'][_0xc02f('0x11')]);return _0x35e119(_0x22b356[_0xc02f('0xf')][_0xc02f('0x11')]);}logger['error'](_0xc02f('0xb'),_0x4274a0,_0x22b356[_0xc02f('0xf')][_0xc02f('0x11')]);return _0x288254(_0x22b356['error'][_0xc02f('0x11')]);}else{logger[_0xc02f('0xa')](_0xc02f('0xb'),_0x4274a0,_0xc02f('0xc'));_0x288254(_0x22b356[_0xc02f('0x12')][_0xc02f('0x11')]);}})[_0xc02f('0x13')](function(_0x52a774){logger[_0xc02f('0xf')](_0xc02f('0xb'),_0x4274a0,_0x52a774);_0x35e119(_0x52a774);});});} \ No newline at end of file +var _0x17bf=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment'];(function(_0x5d5fd6,_0x22dbb8){var _0x2c93e7=function(_0x3f7b97){while(--_0x3f7b97){_0x5d5fd6['push'](_0x5d5fd6['shift']());}};_0x2c93e7(++_0x22dbb8);}(_0x17bf,0x189));var _0xf17b=function(_0x2d4e2d,_0xfd037b){_0x2d4e2d=_0x2d4e2d-0x0;var _0x4a6783=_0x17bf[_0x2d4e2d];return _0x4a6783;};'use strict';var _=require(_0xf17b('0x0'));var util=require(_0xf17b('0x1'));var moment=require(_0xf17b('0x2'));var BPromise=require('bluebird');var rs=require(_0xf17b('0x3'));var fs=require('fs');var Redis=require(_0xf17b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf17b('0x5'));var logger=require(_0xf17b('0x6'))(_0xf17b('0x7'));var config=require(_0xf17b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf17b('0x9')][_0xf17b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58119d,_0x2927cd,_0xca4a6f){return new BPromise(function(_0x197635,_0x69c82b){return client[_0xf17b('0xb')](_0x58119d,_0xca4a6f)[_0xf17b('0xc')](function(_0x30afa3){logger[_0xf17b('0xd')](_0xf17b('0xe'),_0x2927cd,_0xf17b('0xf'));logger[_0xf17b('0x10')](_0xf17b('0x11'),_0x2927cd,'request\x20sent',JSON['stringify'](_0x30afa3));if(_0x30afa3['error']){if(_0x30afa3[_0xf17b('0x12')][_0xf17b('0x13')]===0x1f4){logger['error'](_0xf17b('0xe'),_0x2927cd,_0x30afa3[_0xf17b('0x12')][_0xf17b('0x14')]);return _0x69c82b(_0x30afa3[_0xf17b('0x12')]['message']);}logger[_0xf17b('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2927cd,_0x30afa3['error'][_0xf17b('0x14')]);return _0x197635(_0x30afa3['error'][_0xf17b('0x14')]);}else{logger[_0xf17b('0xd')](_0xf17b('0xe'),_0x2927cd,_0xf17b('0xf'));_0x197635(_0x30afa3[_0xf17b('0x15')][_0xf17b('0x14')]);}})['catch'](function(_0x609ae9){logger[_0xf17b('0x12')](_0xf17b('0xe'),_0x2927cd,_0x609ae9);_0x69c82b(_0x609ae9);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index f4c18d1..6c16681 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 _0x1d65=['/:id/users','exports','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','addAgents','update','delete','destroy'];(function(_0x5b5c70,_0x5150ab){var _0x4319f1=function(_0x1e25b5){while(--_0x1e25b5){_0x5b5c70['push'](_0x5b5c70['shift']());}};_0x4319f1(++_0x5150ab);}(_0x1d65,0xad));var _0x51d6=function(_0x352e5c,_0x966ed0){_0x352e5c=_0x352e5c-0x0;var _0x4435a1=_0x1d65[_0x352e5c];return _0x4435a1;};'use strict';var multer=require('multer');var util=require(_0x51d6('0x0'));var path=require(_0x51d6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x51d6('0x2'));var interaction=require(_0x51d6('0x3'));var config=require(_0x51d6('0x4'));var controller=require('./voicePrefix.controller');router[_0x51d6('0x5')]('/',auth[_0x51d6('0x6')](),controller['index']);router[_0x51d6('0x5')](_0x51d6('0x7'),auth[_0x51d6('0x6')](),controller[_0x51d6('0x8')]);router[_0x51d6('0x5')](_0x51d6('0x9'),auth[_0x51d6('0x6')](),controller[_0x51d6('0xa')]);router[_0x51d6('0x5')]('/:id/users',auth[_0x51d6('0x6')](),controller['getAgents']);router[_0x51d6('0xb')]('/',auth['isAuthenticated'](),controller[_0x51d6('0xc')]);router['post']('/:id/users',auth[_0x51d6('0x6')](),controller[_0x51d6('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x51d6('0xe')]);router[_0x51d6('0xf')](_0x51d6('0x9'),auth[_0x51d6('0x6')](),controller[_0x51d6('0x10')]);router[_0x51d6('0xf')](_0x51d6('0x11'),auth[_0x51d6('0x6')](),controller['removeAgents']);module[_0x51d6('0x12')]=router; \ No newline at end of file +var _0xd613=['../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/users','getAgents','post','create','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x4c630b,_0x25f8ef){var _0x181259=function(_0x5d0e58){while(--_0x5d0e58){_0x4c630b['push'](_0x4c630b['shift']());}};_0x181259(++_0x25f8ef);}(_0xd613,0x1c1));var _0x3d61=function(_0x1f716e,_0x20cd0c){_0x1f716e=_0x1f716e-0x0;var _0x326eb8=_0xd613[_0x1f716e];return _0x326eb8;};'use strict';var multer=require(_0x3d61('0x0'));var util=require(_0x3d61('0x1'));var path=require(_0x3d61('0x2'));var timeout=require(_0x3d61('0x3'));var express=require(_0x3d61('0x4'));var router=express[_0x3d61('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x3d61('0x6'));var config=require(_0x3d61('0x7'));var controller=require('./voicePrefix.controller');router[_0x3d61('0x8')]('/',auth['isAuthenticated'](),controller[_0x3d61('0x9')]);router[_0x3d61('0x8')](_0x3d61('0xa'),auth['isAuthenticated'](),controller[_0x3d61('0xb')]);router['get'](_0x3d61('0xc'),auth[_0x3d61('0xd')](),controller[_0x3d61('0xe')]);router[_0x3d61('0x8')](_0x3d61('0xf'),auth[_0x3d61('0xd')](),controller[_0x3d61('0x10')]);router[_0x3d61('0x11')]('/',auth[_0x3d61('0xd')](),controller[_0x3d61('0x12')]);router[_0x3d61('0x11')](_0x3d61('0xf'),auth[_0x3d61('0xd')](),controller['addAgents']);router['put'](_0x3d61('0xc'),auth['isAuthenticated'](),controller[_0x3d61('0x13')]);router[_0x3d61('0x14')](_0x3d61('0xc'),auth[_0x3d61('0xd')](),controller[_0x3d61('0x15')]);router[_0x3d61('0x14')](_0x3d61('0xf'),auth[_0x3d61('0xd')](),controller[_0x3d61('0x16')]);module[_0x3d61('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 2856ab1..47ae2a1 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 _0x9343=['getDataValue','INTEGER','sequelize','STRING','name','VIRTUAL'];(function(_0x2dd026,_0x11c94c){var _0x32c931=function(_0x217238){while(--_0x217238){_0x2dd026['push'](_0x2dd026['shift']());}};_0x32c931(++_0x11c94c);}(_0x9343,0x1e8));var _0x3934=function(_0x5244c6,_0x38d2ce){_0x5244c6=_0x5244c6-0x0;var _0x2eb5c1=_0x9343[_0x5244c6];return _0x2eb5c1;};'use strict';var Sequelize=require(_0x3934('0x0'));module['exports']={'name':{'type':Sequelize[_0x3934('0x1')],'allowNull':![],'unique':_0x3934('0x2')},'prefix':{'type':Sequelize[_0x3934('0x3')],'get':function(_0x167499){return'system-'+this[_0x3934('0x4')](_0x3934('0x2'))+'-';}},'description':{'type':Sequelize[_0x3934('0x1')]},'callerIdAll':{'type':Sequelize[_0x3934('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x3934('0x5')]}}; \ No newline at end of file +var _0x7615=['STRING','INTEGER','sequelize','name','system-','getDataValue'];(function(_0x5f65aa,_0x27c5ba){var _0x165729=function(_0x3cc013){while(--_0x3cc013){_0x5f65aa['push'](_0x5f65aa['shift']());}};_0x165729(++_0x27c5ba);}(_0x7615,0xec));var _0x5761=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x7615[_0x12bcf7];return _0x2825a;};'use strict';var Sequelize=require(_0x5761('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5761('0x1')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0xa4479b){return _0x5761('0x2')+this[_0x5761('0x3')](_0x5761('0x1'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x5761('0x4')]},'VoiceExtensionId':{'type':Sequelize[_0x5761('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index c663af9..bbfbdda 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 _0x7fb8=['../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','map','keys','model','attributes','fields','query','length','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','count','include','rows','show','params','intersection','find','catch','describe','create','transaction','body','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','sequelize','findById','addAgents','ids','spread','userVoicePrefix:save','removeAgents','emit','userVoicePrefix:remove','getAgents','findOne','User','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x7fb8,0x1d9));var _0x87fb=function(_0x18e9b0,_0x1c964e){_0x18e9b0=_0x18e9b0-0x0;var _0x34b70e=_0x7fb8[_0x18e9b0];return _0x34b70e;};'use strict';var pdf=require(_0x87fb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x87fb('0x1'));var zipdir=require(_0x87fb('0x2'));var jsonpatch=require(_0x87fb('0x3'));var rp=require(_0x87fb('0x4'));var moment=require(_0x87fb('0x5'));var BPromise=require(_0x87fb('0x6'));var Mustache=require('mustache');var util=require(_0x87fb('0x7'));var path=require('path');var sox=require(_0x87fb('0x8'));var csv=require('to-csv');var ejs=require(_0x87fb('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x87fb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x87fb('0xb'));var toCsv=require(_0x87fb('0xc'));var querystring=require(_0x87fb('0xd'));var Papa=require(_0x87fb('0xe'));var Redis=require('ioredis');var authService=require(_0x87fb('0xf'));var qs=require(_0x87fb('0x10'));var as=require(_0x87fb('0x11'));var hardwareService=require(_0x87fb('0x12'));var logger=require(_0x87fb('0x13'))(_0x87fb('0x14'));var utils=require('../../config/utils');var config=require(_0x87fb('0x15'));var db=require(_0x87fb('0x16'))['db'];config[_0x87fb('0x17')]=_[_0x87fb('0x18')](config[_0x87fb('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x87fb('0x19'))(new Redis(config['redis']));require(_0x87fb('0x1a'))['register'](socket);function respondWithStatusCode(_0x2073e0,_0x1a598e){_0x1a598e=_0x1a598e||0xcc;return function(_0x401e0d){if(_0x401e0d){return _0x2073e0[_0x87fb('0x1b')](_0x1a598e);}return _0x2073e0[_0x87fb('0x1c')](_0x1a598e)[_0x87fb('0x1d')]();};}function respondWithResult(_0x189a5d,_0x447bb3){_0x447bb3=_0x447bb3||0xc8;return function(_0x3aedfc){if(_0x3aedfc){return _0x189a5d[_0x87fb('0x1c')](_0x447bb3)[_0x87fb('0x1e')](_0x3aedfc);}};}function respondWithFilteredResult(_0x31bd36,_0x3a1016){return function(_0x3d7282){if(_0x3d7282){var _0x3203b3=_0x3d7282['count'],_0x46d009=_0x3a1016[_0x87fb('0x1f')],_0x5b6385=_0x3a1016['offset']+_0x3a1016[_0x87fb('0x20')],_0x712797;if(_0x5b6385>=_0x3203b3){_0x5b6385=_0x3203b3;_0x712797=0xc8;}else{_0x712797=0xce;}_0x31bd36['status'](_0x712797);return _0x31bd36[_0x87fb('0x21')](_0x87fb('0x22'),_0x46d009+'-'+_0x5b6385+'/'+_0x3203b3)[_0x87fb('0x1e')](_0x3d7282);}return null;};}function patchUpdates(_0x30d9dd){return function(_0x3e46b3){try{jsonpatch[_0x87fb('0x23')](_0x3e46b3,_0x30d9dd,!![]);}catch(_0x476383){return BPromise['reject'](_0x476383);}return _0x3e46b3[_0x87fb('0x24')]();};}function saveUpdates(_0x1e03e8,_0x2c00f7){return function(_0x29e542){if(_0x29e542){return _0x29e542[_0x87fb('0x25')](_0x1e03e8)[_0x87fb('0x26')](function(_0x3f8976){return _0x3f8976;});}return null;};}function removeEntity(_0x29d4a0,_0x47d494){return function(_0x4df981){if(_0x4df981){return _0x4df981[_0x87fb('0x27')]()[_0x87fb('0x26')](function(){var _0x160d08=_0x4df981[_0x87fb('0x28')]({'plain':!![]});var _0x54c1cf='VoicePrefixes';return db[_0x87fb('0x29')][_0x87fb('0x27')]({'where':{'type':_0x54c1cf,'resourceId':_0x160d08['id']}})[_0x87fb('0x26')](function(){return _0x4df981;});})['then'](function(){_0x29d4a0[_0x87fb('0x1c')](0xcc)[_0x87fb('0x1d')]();});}};}function handleEntityNotFound(_0x4891b7,_0xcf9d55){return function(_0x2d7f99){if(!_0x2d7f99){_0x4891b7[_0x87fb('0x1b')](0x194);}return _0x2d7f99;};}function handleError(_0x5dd463,_0x5774cc){_0x5774cc=_0x5774cc||0x1f4;return function(_0x204b0c){logger[_0x87fb('0x2a')](_0x204b0c[_0x87fb('0x2b')]);if(_0x204b0c[_0x87fb('0x2c')]){delete _0x204b0c[_0x87fb('0x2c')];}_0x5dd463['status'](_0x5774cc)[_0x87fb('0x2d')](_0x204b0c);};}exports[_0x87fb('0x2e')]=function(_0x278348,_0x4c52ae){var _0x151677={},_0x51cbf1={},_0x54a3fa={'count':0x0,'rows':[]};var _0x5d1b0e=_['map'](db[_0x87fb('0x2f')][_0x87fb('0x30')],function(_0x1af687){return{'name':_0x1af687[_0x87fb('0x31')],'type':_0x1af687['type']['key']};});_0x51cbf1['model']=_[_0x87fb('0x32')](_0x5d1b0e,_0x87fb('0x2c'));_0x51cbf1['query']=_[_0x87fb('0x33')](_0x278348['query']);_0x51cbf1['filters']=_['intersection'](_0x51cbf1[_0x87fb('0x34')],_0x51cbf1['query']);_0x151677[_0x87fb('0x35')]=_['intersection'](_0x51cbf1[_0x87fb('0x34')],qs[_0x87fb('0x36')](_0x278348[_0x87fb('0x37')][_0x87fb('0x36')]));_0x151677[_0x87fb('0x35')]=_0x151677[_0x87fb('0x35')][_0x87fb('0x38')]?_0x151677['attributes']:_0x51cbf1[_0x87fb('0x34')];if(!_0x278348['query']['hasOwnProperty'](_0x87fb('0x39'))){_0x151677[_0x87fb('0x20')]=qs[_0x87fb('0x20')](_0x278348['query']['limit']);_0x151677[_0x87fb('0x1f')]=qs['offset'](_0x278348['query'][_0x87fb('0x1f')]);}_0x151677[_0x87fb('0x3a')]=qs[_0x87fb('0x3b')](_0x278348['query'][_0x87fb('0x3b')]);_0x151677['where']=qs[_0x87fb('0x3c')](_[_0x87fb('0x3d')](_0x278348[_0x87fb('0x37')],_0x51cbf1[_0x87fb('0x3c')]));if(_0x278348[_0x87fb('0x37')][_0x87fb('0x3e')]){_0x151677[_0x87fb('0x3f')]=_[_0x87fb('0x40')](_0x151677['where'],{'$or':_[_0x87fb('0x32')](_0x5d1b0e,function(_0x4dbd36){if(_0x4dbd36[_0x87fb('0x41')]!==_0x87fb('0x42')){var _0x30d66d={};_0x30d66d[_0x4dbd36[_0x87fb('0x2c')]]={'$like':'%'+_0x278348[_0x87fb('0x37')][_0x87fb('0x3e')]+'%'};return _0x30d66d;}})});}_0x151677=_[_0x87fb('0x40')]({},_0x151677,_0x278348[_0x87fb('0x43')]);var _0x3fc9ef={'where':_0x151677[_0x87fb('0x3f')]};return db[_0x87fb('0x2f')][_0x87fb('0x44')](_0x3fc9ef)[_0x87fb('0x26')](function(_0x22b871){_0x54a3fa['count']=_0x22b871;if(_0x278348[_0x87fb('0x37')]['includeAll']){_0x151677[_0x87fb('0x45')]=[{'all':!![]}];}return db[_0x87fb('0x2f')]['findAll'](_0x151677);})[_0x87fb('0x26')](function(_0x2b2f5d){_0x54a3fa[_0x87fb('0x46')]=_0x2b2f5d;return _0x54a3fa;})[_0x87fb('0x26')](respondWithFilteredResult(_0x4c52ae,_0x151677))['catch'](handleError(_0x4c52ae,null));};exports[_0x87fb('0x47')]=function(_0xce872a,_0x4683de){var _0x4cba9b={'raw':![],'where':{'id':_0xce872a[_0x87fb('0x48')]['id']}},_0x241356={};_0x241356[_0x87fb('0x34')]=_['keys'](db[_0x87fb('0x2f')][_0x87fb('0x30')]);_0x241356[_0x87fb('0x37')]=_['keys'](_0xce872a['query']);_0x241356[_0x87fb('0x3c')]=_[_0x87fb('0x49')](_0x241356[_0x87fb('0x34')],_0x241356[_0x87fb('0x37')]);_0x4cba9b[_0x87fb('0x35')]=_[_0x87fb('0x49')](_0x241356['model'],qs[_0x87fb('0x36')](_0xce872a[_0x87fb('0x37')][_0x87fb('0x36')]));_0x4cba9b[_0x87fb('0x35')]=_0x4cba9b[_0x87fb('0x35')][_0x87fb('0x38')]?_0x4cba9b[_0x87fb('0x35')]:_0x241356[_0x87fb('0x34')];if(_0xce872a[_0x87fb('0x37')]['includeAll']){_0x4cba9b[_0x87fb('0x45')]=[{'all':!![]}];}_0x4cba9b=_[_0x87fb('0x40')]({},_0x4cba9b,_0xce872a['options']);return db[_0x87fb('0x2f')][_0x87fb('0x4a')](_0x4cba9b)[_0x87fb('0x26')](handleEntityNotFound(_0x4683de,null))[_0x87fb('0x26')](respondWithResult(_0x4683de,null))[_0x87fb('0x4b')](handleError(_0x4683de,null));};exports[_0x87fb('0x27')]=function(_0x2ae840,_0x5b8d38){return db['VoicePrefix'][_0x87fb('0x4a')]({'where':{'id':_0x2ae840['params']['id']}})[_0x87fb('0x26')](handleEntityNotFound(_0x5b8d38,null))['then'](removeEntity(_0x5b8d38,null))[_0x87fb('0x4b')](handleError(_0x5b8d38,null));};exports[_0x87fb('0x4c')]=function(_0xb5fd21,_0x111bda){return db[_0x87fb('0x2f')][_0x87fb('0x4c')]()[_0x87fb('0x26')](respondWithResult(_0x111bda,null))[_0x87fb('0x4b')](handleError(_0x111bda,null));};exports[_0x87fb('0x4d')]=function(_0x228f12,_0x3346a3){var _0x3d06d1;return db['sequelize'][_0x87fb('0x4e')](function(_0x155303){return db[_0x87fb('0x2f')][_0x87fb('0x4d')](_0x228f12[_0x87fb('0x4f')],{'transaction':_0x155303})[_0x87fb('0x26')](function(_0x3cce7b){_0x3d06d1=_0x3cce7b[_0x87fb('0x28')]({'plain':!![]});return db[_0x87fb('0x50')][_0x87fb('0x4a')]({'where':{'id':_0x3d06d1['VoiceExtensionId']},'raw':!![]})[_0x87fb('0x26')](function(_0x738c5c){return createVoicePrefixExtensions(_0x3d06d1,_0x738c5c,_0x155303);});});})['then'](function(){var _0x41438e=_0x228f12[_0x87fb('0x51')][_0x87fb('0x28')]({'plain':!![]});if(!_0x41438e)throw new Error(_0x87fb('0x52'));if(_0x41438e['role']===_0x87fb('0x51')){var _0x252bb9=_0x3d06d1;return db['UserProfileSection']['find']({'where':{'name':_0x87fb('0x53'),'userProfileId':_0x41438e[_0x87fb('0x54')]},'raw':!![]})[_0x87fb('0x26')](function(_0xa5f9dc){if(_0xa5f9dc&&_0xa5f9dc[_0x87fb('0x55')]===0x0){return db[_0x87fb('0x29')][_0x87fb('0x4d')]({'name':_0x252bb9['name'],'resourceId':_0x252bb9['id'],'type':_0xa5f9dc[_0x87fb('0x2c')],'sectionId':_0xa5f9dc['id']},{})['then'](function(){return _0x3d06d1;});}else{return _0x3d06d1;}})['catch'](function(_0x534471){logger['error'](_0x87fb('0x56'),_0x534471);throw _0x534471;});}return _0x3d06d1;})[_0x87fb('0x26')](respondWithResult(_0x3346a3,null))[_0x87fb('0x4b')](handleError(_0x3346a3,null));};function Extension(_0x56f6f2,_0x4c7edb,_0x4b87e3,_0x463575){this[_0x87fb('0x57')]='from-sip';this[_0x87fb('0x58')]=_0x56f6f2;this[_0x87fb('0x59')]=_0x4b87e3;this['type']=_0x87fb('0x5a');this[_0x87fb('0x5b')]=_0x87fb('0x5c');this[_0x87fb('0x5d')]=_0x4c7edb;this['appdata']=_0x463575;}function createVoicePrefixExtensions(_0x388c93,_0x3f3429,_0x29cb73){return new BPromise(function(_0x51a12b,_0x3b6cfb){var _0x5d1002=new Extension(formatPrefixName(_0x388c93[_0x87fb('0x5e')]),0x1,_0x87fb('0x5f'),_0x87fb('0x60'));_0x5d1002[_0x87fb('0x61')]=_0x388c93['id'];return db[_0x87fb('0x50')][_0x87fb('0x4d')](_0x5d1002,{'transaction':_0x29cb73})[_0x87fb('0x26')](function(_0x5bd82f){var _0x16f2c6=_0x5bd82f[_0x87fb('0x28')]({'plain':!![]});var _0x38debb=_['map'](addVoicePrefixExtensions(_0x388c93,_0x3f3429),function(_0x34a643){_0x34a643[_0x87fb('0x62')]=_0x16f2c6['id'];_0x34a643['VoicePrefixId']=_0x388c93['id'];return _0x34a643;});return db[_0x87fb('0x50')][_0x87fb('0x63')](_0x38debb,{'transaction':_0x29cb73})[_0x87fb('0x26')](function(_0x9bb021){if(!_0x9bb021){return _0x3b6cfb(_0x87fb('0x64'));}else{return _0x51a12b(_0x9bb021);}})[_0x87fb('0x4b')](function(_0xa990b8){return _0x3b6cfb(_0xa990b8);});});;});};function addVoicePrefixExtensions(_0x511313,_0x5e3488){var _0x853095=[];var _0x3ce9aa=formatPrefixName(_0x511313['prefix']);_0x853095[_0x87fb('0x65')](new Extension(_0x3ce9aa,0x2,_0x87fb('0x66'),_0x87fb('0x67')+_0x511313[_0x87fb('0x2c')]));if(_0x511313[_0x87fb('0x68')]){_0x853095[_0x87fb('0x65')](new Extension(_0x3ce9aa,0x3,_0x87fb('0x66'),_0x87fb('0x69')+_0x511313[_0x87fb('0x68')]));}else{_0x853095[_0x87fb('0x65')](new Extension(_0x3ce9aa,0x3,_0x87fb('0x5f'),_0x87fb('0x6a')));}_0x853095[_0x87fb('0x65')](new Extension(_0x3ce9aa,0x4,_0x87fb('0x6b'),_0x5e3488[_0x87fb('0x57')]+','+_0x87fb('0x6c')+(0x8+_0x511313[_0x87fb('0x2c')][_0x87fb('0x38')])+'}'+','+0x1));return _0x853095;}function formatPrefixName(_0x4cb05e){var _0x485c79='_';for(var _0x16c938=0x0;_0x16c938<_0x4cb05e[_0x87fb('0x38')];_0x16c938++){if(_0x4cb05e[_0x87fb('0x6d')](_0x16c938)=='-'){_0x485c79+=_0x4cb05e[_0x87fb('0x6d')](_0x16c938);}else{_0x485c79+='['+_0x4cb05e[_0x87fb('0x6d')](_0x16c938)+']';}}_0x485c79+='.';return _0x485c79;}exports[_0x87fb('0x25')]=function(_0x4c49b8,_0x5bca49,_0x594710){var _0x568d7a=_0x4c49b8[_0x87fb('0x4f')];_0x568d7a[_0x87fb('0x5e')]=_0x87fb('0x6e')+_0x568d7a[_0x87fb('0x2c')]+'-';return db[_0x87fb('0x6f')][_0x87fb('0x4e')](function(_0x482198){return db[_0x87fb('0x2f')][_0x87fb('0x25')](_0x568d7a,{'where':{'id':_0x568d7a['id']},'transaction':_0x482198})[_0x87fb('0x26')](function(){return db['VoiceExtension'][_0x87fb('0x27')]({'where':{'VoicePrefixId':_0x568d7a['id']},'transaction':_0x482198})[_0x87fb('0x26')](function(){return db[_0x87fb('0x50')][_0x87fb('0x4a')]({'where':{'id':_0x568d7a[_0x87fb('0x62')]},'raw':!![]})['then'](function(_0x1ca54b){return createVoicePrefixExtensions(_0x568d7a,_0x1ca54b,_0x482198);});});});})['then'](function(){return db[_0x87fb('0x2f')][_0x87fb('0x70')](_0x568d7a['id']);})[_0x87fb('0x26')](respondWithResult(_0x5bca49,null))[_0x87fb('0x4b')](handleError(_0x5bca49,null));};exports[_0x87fb('0x71')]=function(_0x18d0f5,_0x187c6c,_0x2e8811){return db[_0x87fb('0x2f')]['find']({'where':{'id':_0x18d0f5[_0x87fb('0x48')]['id']}})[_0x87fb('0x26')](handleEntityNotFound(_0x187c6c,null))['then'](function(_0x7ac032){if(_0x7ac032){return _0x7ac032['addAgents'](_0x18d0f5[_0x87fb('0x4f')][_0x87fb('0x72')],_['omit'](_0x18d0f5[_0x87fb('0x4f')],[_0x87fb('0x72'),'id'])||{})[_0x87fb('0x73')](function(_0x130437){for(var _0x36bb45=0x0;_0x36bb45<_0x18d0f5[_0x87fb('0x4f')][_0x87fb('0x72')][_0x87fb('0x38')];_0x36bb45+=0x1){socket['emit'](_0x87fb('0x74'),{'UserId':_0x18d0f5[_0x87fb('0x4f')]['ids'][_0x36bb45],'VoicePrefixId':_0x18d0f5[_0x87fb('0x48')]['id']});}return _0x130437;});}})[_0x87fb('0x26')](respondWithResult(_0x187c6c,null))['catch'](handleError(_0x187c6c,null));};exports['removeAgents']=function(_0x41b056,_0x2a474d,_0x541d5a){return db['VoicePrefix']['find']({'where':{'id':_0x41b056[_0x87fb('0x48')]['id']}})[_0x87fb('0x26')](handleEntityNotFound(_0x2a474d,null))[_0x87fb('0x26')](function(_0x411c78){if(_0x411c78){return _0x411c78[_0x87fb('0x75')](_0x41b056[_0x87fb('0x37')][_0x87fb('0x72')])[_0x87fb('0x26')](function(){if(_['isArray'](_0x41b056[_0x87fb('0x37')]['ids'])){for(var _0x3fc4d9=0x0;_0x3fc4d9<_0x41b056[_0x87fb('0x37')][_0x87fb('0x72')][_0x87fb('0x38')];_0x3fc4d9+=0x1){socket[_0x87fb('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x41b056[_0x87fb('0x37')][_0x87fb('0x72')][_0x3fc4d9]),'VoicePrefixId':Number(_0x41b056[_0x87fb('0x48')]['id'])});}}else{socket[_0x87fb('0x76')](_0x87fb('0x77'),{'UserId':Number(_0x41b056[_0x87fb('0x37')]['ids']),'VoicePrefixId':Number(_0x41b056[_0x87fb('0x48')]['id'])});}});}})[_0x87fb('0x26')](respondWithStatusCode(_0x2a474d,null))[_0x87fb('0x4b')](handleError(_0x2a474d,null));};exports[_0x87fb('0x78')]=function(_0x209390,_0x207cf2,_0x28e764){var _0x175bb5={};var _0x20e434={};var _0x539944;var _0x203a18;return db[_0x87fb('0x2f')][_0x87fb('0x79')]({'where':{'id':_0x209390['params']['id']}})[_0x87fb('0x26')](handleEntityNotFound(_0x207cf2,null))[_0x87fb('0x26')](function(_0x3ba452){if(_0x3ba452){_0x539944=_0x3ba452;_0x20e434[_0x87fb('0x34')]=_['keys'](db[_0x87fb('0x7a')][_0x87fb('0x30')]);_0x20e434[_0x87fb('0x37')]=_['keys'](_0x209390[_0x87fb('0x37')]);_0x20e434[_0x87fb('0x3c')]=_['intersection'](_0x20e434['model'],_0x20e434['query']);_0x175bb5['attributes']=_[_0x87fb('0x49')](_0x20e434[_0x87fb('0x34')],qs[_0x87fb('0x36')](_0x209390['query'][_0x87fb('0x36')]));_0x175bb5[_0x87fb('0x35')]=_0x175bb5[_0x87fb('0x35')]['length']?_0x175bb5[_0x87fb('0x35')]:_0x20e434[_0x87fb('0x34')];_0x175bb5['order']=qs[_0x87fb('0x3b')](_0x209390[_0x87fb('0x37')][_0x87fb('0x3b')]);_0x175bb5[_0x87fb('0x3f')]=qs[_0x87fb('0x3c')](_[_0x87fb('0x3d')](_0x209390[_0x87fb('0x37')],_0x20e434[_0x87fb('0x3c')]));if(_0x209390[_0x87fb('0x37')]['filter']){_0x175bb5[_0x87fb('0x3f')]=_['merge'](_0x175bb5[_0x87fb('0x3f')],{'$or':_[_0x87fb('0x32')](_0x175bb5[_0x87fb('0x35')],function(_0x57cce6){var _0x36ddfa={};_0x36ddfa[_0x57cce6]={'$like':'%'+_0x209390['query']['filter']+'%'};return _0x36ddfa;})});}_0x175bb5=_[_0x87fb('0x40')]({},_0x175bb5,_0x209390['options']);return _0x539944[_0x87fb('0x78')](_0x175bb5);}})['then'](function(_0x49ef9e){if(_0x49ef9e){_0x203a18=_0x49ef9e[_0x87fb('0x38')];if(!_0x209390[_0x87fb('0x37')]['hasOwnProperty'](_0x87fb('0x39'))){_0x175bb5['limit']=qs[_0x87fb('0x20')](_0x209390['query'][_0x87fb('0x20')]);_0x175bb5[_0x87fb('0x1f')]=qs[_0x87fb('0x1f')](_0x209390['query'][_0x87fb('0x1f')]);}return _0x539944[_0x87fb('0x78')](_0x175bb5);}})[_0x87fb('0x26')](function(_0x569bbc){if(_0x569bbc){return _0x569bbc?{'count':_0x203a18,'rows':_0x569bbc}:null;}})['then'](respondWithResult(_0x207cf2,null))['catch'](handleError(_0x207cf2,null));}; \ No newline at end of file +var _0xad15=['include','findAll','rows','keys','includeAll','find','params','catch','describe','create','transaction','get','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','callerIdAll','Set','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','sequelize','addAgents','ids','spread','emit','isArray','userVoicePrefix:remove','findOne','order','getAgents','hasOwnProperty','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','end','json','count','offset','limit','status','set','Content-Range','reject','update','then','destroy','VoicePrefixes','UserProfileResource','sendStatus','error','name','send','index','map','VoicePrefix','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','type','filter','merge','options'];(function(_0xac9e9d,_0x768827){var _0x13a727=function(_0x21274c){while(--_0x21274c){_0xac9e9d['push'](_0xac9e9d['shift']());}};_0x13a727(++_0x768827);}(_0xad15,0xab));var _0x5ad1=function(_0x5e515c,_0x3319a7){_0x5e515c=_0x5e515c-0x0;var _0x4f3109=_0xad15[_0x5e515c];return _0x4f3109;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5ad1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5ad1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5ad1('0x2'));var moment=require(_0x5ad1('0x3'));var BPromise=require(_0x5ad1('0x4'));var Mustache=require(_0x5ad1('0x5'));var util=require(_0x5ad1('0x6'));var path=require('path');var sox=require(_0x5ad1('0x7'));var csv=require(_0x5ad1('0x8'));var ejs=require(_0x5ad1('0x9'));var fs=require('fs');var _=require(_0x5ad1('0xa'));var squel=require(_0x5ad1('0xb'));var crypto=require('crypto');var jsforce=require(_0x5ad1('0xc'));var deskjs=require(_0x5ad1('0xd'));var toCsv=require(_0x5ad1('0x8'));var querystring=require(_0x5ad1('0xe'));var Papa=require('papaparse');var Redis=require(_0x5ad1('0xf'));var authService=require(_0x5ad1('0x10'));var qs=require(_0x5ad1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ad1('0x12'));var logger=require(_0x5ad1('0x13'))('api');var utils=require(_0x5ad1('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x5ad1('0x15')]=_[_0x5ad1('0x16')](config[_0x5ad1('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ad1('0x17'))(new Redis(config[_0x5ad1('0x15')]));require(_0x5ad1('0x18'))[_0x5ad1('0x19')](socket);function respondWithStatusCode(_0x603702,_0x2be03e){_0x2be03e=_0x2be03e||0xcc;return function(_0x3e5da0){if(_0x3e5da0){return _0x603702['sendStatus'](_0x2be03e);}return _0x603702['status'](_0x2be03e)[_0x5ad1('0x1a')]();};}function respondWithResult(_0x729766,_0x54e790){_0x54e790=_0x54e790||0xc8;return function(_0x54b39e){if(_0x54b39e){return _0x729766['status'](_0x54e790)[_0x5ad1('0x1b')](_0x54b39e);}};}function respondWithFilteredResult(_0x90c16,_0x4f42f9){return function(_0x3b4751){if(_0x3b4751){var _0x14eadb=_0x3b4751[_0x5ad1('0x1c')],_0x56a2bd=_0x4f42f9[_0x5ad1('0x1d')],_0xc26a78=_0x4f42f9['offset']+_0x4f42f9[_0x5ad1('0x1e')],_0x10c8be;if(_0xc26a78>=_0x14eadb){_0xc26a78=_0x14eadb;_0x10c8be=0xc8;}else{_0x10c8be=0xce;}_0x90c16[_0x5ad1('0x1f')](_0x10c8be);return _0x90c16[_0x5ad1('0x20')](_0x5ad1('0x21'),_0x56a2bd+'-'+_0xc26a78+'/'+_0x14eadb)['json'](_0x3b4751);}return null;};}function patchUpdates(_0x81db09){return function(_0x3f8abc){try{jsonpatch['apply'](_0x3f8abc,_0x81db09,!![]);}catch(_0xe1d351){return BPromise[_0x5ad1('0x22')](_0xe1d351);}return _0x3f8abc['save']();};}function saveUpdates(_0x479f4e,_0x583c9a){return function(_0x5f4d5c){if(_0x5f4d5c){return _0x5f4d5c[_0x5ad1('0x23')](_0x479f4e)[_0x5ad1('0x24')](function(_0x54cef9){return _0x54cef9;});}return null;};}function removeEntity(_0x1d7b93,_0x3f883a){return function(_0x2c642c){if(_0x2c642c){return _0x2c642c[_0x5ad1('0x25')]()[_0x5ad1('0x24')](function(){var _0x3ba543=_0x2c642c['get']({'plain':!![]});var _0x524e74=_0x5ad1('0x26');return db[_0x5ad1('0x27')][_0x5ad1('0x25')]({'where':{'type':_0x524e74,'resourceId':_0x3ba543['id']}})['then'](function(){return _0x2c642c;});})[_0x5ad1('0x24')](function(){_0x1d7b93['status'](0xcc)[_0x5ad1('0x1a')]();});}};}function handleEntityNotFound(_0x4efe69,_0x567d44){return function(_0x1a67a4){if(!_0x1a67a4){_0x4efe69[_0x5ad1('0x28')](0x194);}return _0x1a67a4;};}function handleError(_0x1890d5,_0x23f022){_0x23f022=_0x23f022||0x1f4;return function(_0x28368a){logger[_0x5ad1('0x29')](_0x28368a['stack']);if(_0x28368a[_0x5ad1('0x2a')]){delete _0x28368a[_0x5ad1('0x2a')];}_0x1890d5[_0x5ad1('0x1f')](_0x23f022)[_0x5ad1('0x2b')](_0x28368a);};}exports[_0x5ad1('0x2c')]=function(_0x35233a,_0xc548b0){var _0x367758={},_0x1e2fce={},_0x562b89={'count':0x0,'rows':[]};var _0x309e9e=_[_0x5ad1('0x2d')](db[_0x5ad1('0x2e')][_0x5ad1('0x2f')],function(_0xb2f9d4){return{'name':_0xb2f9d4[_0x5ad1('0x30')],'type':_0xb2f9d4['type'][_0x5ad1('0x31')]};});_0x1e2fce[_0x5ad1('0x32')]=_[_0x5ad1('0x2d')](_0x309e9e,_0x5ad1('0x2a'));_0x1e2fce[_0x5ad1('0x33')]=_['keys'](_0x35233a[_0x5ad1('0x33')]);_0x1e2fce[_0x5ad1('0x34')]=_['intersection'](_0x1e2fce[_0x5ad1('0x32')],_0x1e2fce[_0x5ad1('0x33')]);_0x367758[_0x5ad1('0x35')]=_[_0x5ad1('0x36')](_0x1e2fce[_0x5ad1('0x32')],qs[_0x5ad1('0x37')](_0x35233a[_0x5ad1('0x33')][_0x5ad1('0x37')]));_0x367758['attributes']=_0x367758[_0x5ad1('0x35')][_0x5ad1('0x38')]?_0x367758['attributes']:_0x1e2fce[_0x5ad1('0x32')];if(!_0x35233a[_0x5ad1('0x33')]['hasOwnProperty'](_0x5ad1('0x39'))){_0x367758[_0x5ad1('0x1e')]=qs[_0x5ad1('0x1e')](_0x35233a[_0x5ad1('0x33')][_0x5ad1('0x1e')]);_0x367758['offset']=qs[_0x5ad1('0x1d')](_0x35233a[_0x5ad1('0x33')][_0x5ad1('0x1d')]);}_0x367758['order']=qs[_0x5ad1('0x3a')](_0x35233a[_0x5ad1('0x33')][_0x5ad1('0x3a')]);_0x367758[_0x5ad1('0x3b')]=qs[_0x5ad1('0x34')](_[_0x5ad1('0x3c')](_0x35233a[_0x5ad1('0x33')],_0x1e2fce['filters']));if(_0x35233a[_0x5ad1('0x33')]['filter']){_0x367758[_0x5ad1('0x3b')]=_['merge'](_0x367758['where'],{'$or':_[_0x5ad1('0x2d')](_0x309e9e,function(_0x361b9e){if(_0x361b9e[_0x5ad1('0x3d')]!=='VIRTUAL'){var _0x45fde8={};_0x45fde8[_0x361b9e[_0x5ad1('0x2a')]]={'$like':'%'+_0x35233a[_0x5ad1('0x33')][_0x5ad1('0x3e')]+'%'};return _0x45fde8;}})});}_0x367758=_[_0x5ad1('0x3f')]({},_0x367758,_0x35233a[_0x5ad1('0x40')]);var _0x589dee={'where':_0x367758[_0x5ad1('0x3b')]};return db[_0x5ad1('0x2e')][_0x5ad1('0x1c')](_0x589dee)[_0x5ad1('0x24')](function(_0x3c5f27){_0x562b89[_0x5ad1('0x1c')]=_0x3c5f27;if(_0x35233a['query']['includeAll']){_0x367758[_0x5ad1('0x41')]=[{'all':!![]}];}return db['VoicePrefix'][_0x5ad1('0x42')](_0x367758);})[_0x5ad1('0x24')](function(_0x50c24c){_0x562b89[_0x5ad1('0x43')]=_0x50c24c;return _0x562b89;})[_0x5ad1('0x24')](respondWithFilteredResult(_0xc548b0,_0x367758))['catch'](handleError(_0xc548b0,null));};exports['show']=function(_0x30ae02,_0x7ef9f9){var _0x5730a4={'raw':![],'where':{'id':_0x30ae02['params']['id']}},_0x164f28={};_0x164f28['model']=_['keys'](db[_0x5ad1('0x2e')][_0x5ad1('0x2f')]);_0x164f28[_0x5ad1('0x33')]=_[_0x5ad1('0x44')](_0x30ae02[_0x5ad1('0x33')]);_0x164f28[_0x5ad1('0x34')]=_[_0x5ad1('0x36')](_0x164f28[_0x5ad1('0x32')],_0x164f28[_0x5ad1('0x33')]);_0x5730a4[_0x5ad1('0x35')]=_[_0x5ad1('0x36')](_0x164f28[_0x5ad1('0x32')],qs[_0x5ad1('0x37')](_0x30ae02[_0x5ad1('0x33')][_0x5ad1('0x37')]));_0x5730a4[_0x5ad1('0x35')]=_0x5730a4[_0x5ad1('0x35')][_0x5ad1('0x38')]?_0x5730a4['attributes']:_0x164f28[_0x5ad1('0x32')];if(_0x30ae02[_0x5ad1('0x33')][_0x5ad1('0x45')]){_0x5730a4['include']=[{'all':!![]}];}_0x5730a4=_[_0x5ad1('0x3f')]({},_0x5730a4,_0x30ae02[_0x5ad1('0x40')]);return db[_0x5ad1('0x2e')][_0x5ad1('0x46')](_0x5730a4)[_0x5ad1('0x24')](handleEntityNotFound(_0x7ef9f9,null))['then'](respondWithResult(_0x7ef9f9,null))['catch'](handleError(_0x7ef9f9,null));};exports[_0x5ad1('0x25')]=function(_0x3676bd,_0x1c6777){return db[_0x5ad1('0x2e')][_0x5ad1('0x46')]({'where':{'id':_0x3676bd[_0x5ad1('0x47')]['id']}})[_0x5ad1('0x24')](handleEntityNotFound(_0x1c6777,null))['then'](removeEntity(_0x1c6777,null))[_0x5ad1('0x48')](handleError(_0x1c6777,null));};exports['describe']=function(_0x668ae2,_0x3b35d7){return db[_0x5ad1('0x2e')][_0x5ad1('0x49')]()[_0x5ad1('0x24')](respondWithResult(_0x3b35d7,null))[_0x5ad1('0x48')](handleError(_0x3b35d7,null));};exports[_0x5ad1('0x4a')]=function(_0x44f6c9,_0x1afdac){var _0x344ade;return db['sequelize'][_0x5ad1('0x4b')](function(_0x3df97e){return db[_0x5ad1('0x2e')][_0x5ad1('0x4a')](_0x44f6c9['body'],{'transaction':_0x3df97e})[_0x5ad1('0x24')](function(_0x57ffbe){_0x344ade=_0x57ffbe[_0x5ad1('0x4c')]({'plain':!![]});return db[_0x5ad1('0x4d')]['find']({'where':{'id':_0x344ade[_0x5ad1('0x4e')]},'raw':!![]})[_0x5ad1('0x24')](function(_0x17f9b1){return createVoicePrefixExtensions(_0x344ade,_0x17f9b1,_0x3df97e);});});})[_0x5ad1('0x24')](function(){var _0x5c65c0=_0x44f6c9['user'][_0x5ad1('0x4c')]({'plain':!![]});if(!_0x5c65c0)throw new Error(_0x5ad1('0x4f'));if(_0x5c65c0[_0x5ad1('0x50')]===_0x5ad1('0x51')){var _0x13dc89=_0x344ade;return db[_0x5ad1('0x52')]['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x5c65c0[_0x5ad1('0x53')]},'raw':!![]})['then'](function(_0x5ea3cc){if(_0x5ea3cc&&_0x5ea3cc[_0x5ad1('0x54')]===0x0){return db[_0x5ad1('0x27')]['create']({'name':_0x13dc89[_0x5ad1('0x2a')],'resourceId':_0x13dc89['id'],'type':_0x5ea3cc[_0x5ad1('0x2a')],'sectionId':_0x5ea3cc['id']},{})[_0x5ad1('0x24')](function(){return _0x344ade;});}else{return _0x344ade;}})['catch'](function(_0x3972fb){logger[_0x5ad1('0x29')](_0x5ad1('0x55'),_0x3972fb);throw _0x3972fb;});}return _0x344ade;})[_0x5ad1('0x24')](respondWithResult(_0x1afdac,null))[_0x5ad1('0x48')](handleError(_0x1afdac,null));};function Extension(_0x309d77,_0x42a2a5,_0x47e87f,_0x5d5ecb){this[_0x5ad1('0x56')]=_0x5ad1('0x57');this['exten']=_0x309d77;this[_0x5ad1('0x58')]=_0x47e87f;this[_0x5ad1('0x3d')]='system';this['description']=_0x5ad1('0x59');this['priority']=_0x42a2a5;this[_0x5ad1('0x5a')]=_0x5d5ecb;}function createVoicePrefixExtensions(_0x2d474b,_0xcc476d,_0x27a1f9){return new BPromise(function(_0x366d8a,_0x3b9352){var _0x275452=new Extension(formatPrefixName(_0x2d474b[_0x5ad1('0x5b')]),0x1,_0x5ad1('0x5c'),_0x5ad1('0x5d'));_0x275452[_0x5ad1('0x5e')]=_0x2d474b['id'];return db['VoiceExtension']['create'](_0x275452,{'transaction':_0x27a1f9})[_0x5ad1('0x24')](function(_0x3bbe13){var _0x31028b=_0x3bbe13[_0x5ad1('0x4c')]({'plain':!![]});var _0x37cebe=_['map'](addVoicePrefixExtensions(_0x2d474b,_0xcc476d),function(_0x57eda4){_0x57eda4[_0x5ad1('0x4e')]=_0x31028b['id'];_0x57eda4[_0x5ad1('0x5e')]=_0x2d474b['id'];return _0x57eda4;});return db[_0x5ad1('0x4d')][_0x5ad1('0x5f')](_0x37cebe,{'transaction':_0x27a1f9})[_0x5ad1('0x24')](function(_0x328df9){if(!_0x328df9){return _0x3b9352(_0x5ad1('0x60'));}else{return _0x366d8a(_0x328df9);}})[_0x5ad1('0x48')](function(_0x222e34){return _0x3b9352(_0x222e34);});});;});};function addVoicePrefixExtensions(_0x2dd135,_0x1aac71){var _0x417def=[];var _0x18e71e=formatPrefixName(_0x2dd135[_0x5ad1('0x5b')]);_0x417def[_0x5ad1('0x61')](new Extension(_0x18e71e,0x2,'Set','CDR(prefix)='+_0x2dd135[_0x5ad1('0x2a')]));if(_0x2dd135[_0x5ad1('0x62')]){_0x417def[_0x5ad1('0x61')](new Extension(_0x18e71e,0x3,_0x5ad1('0x63'),_0x5ad1('0x64')+_0x2dd135[_0x5ad1('0x62')]));}else{_0x417def['push'](new Extension(_0x18e71e,0x3,_0x5ad1('0x5c'),_0x5ad1('0x65')));}_0x417def['push'](new Extension(_0x18e71e,0x4,_0x5ad1('0x66'),_0x1aac71['context']+','+_0x5ad1('0x67')+(0x8+_0x2dd135['name']['length'])+'}'+','+0x1));return _0x417def;}function formatPrefixName(_0x3bd997){var _0x55eac9='_';for(var _0x36e221=0x0;_0x36e221<_0x3bd997['length'];_0x36e221++){if(_0x3bd997[_0x5ad1('0x68')](_0x36e221)=='-'){_0x55eac9+=_0x3bd997[_0x5ad1('0x68')](_0x36e221);}else{_0x55eac9+='['+_0x3bd997[_0x5ad1('0x68')](_0x36e221)+']';}}_0x55eac9+='.';return _0x55eac9;}exports[_0x5ad1('0x23')]=function(_0x7aa67b,_0x390b31,_0x15b883){var _0x163cc0=_0x7aa67b[_0x5ad1('0x69')];_0x163cc0[_0x5ad1('0x5b')]=_0x5ad1('0x6a')+_0x163cc0[_0x5ad1('0x2a')]+'-';return db[_0x5ad1('0x6b')][_0x5ad1('0x4b')](function(_0x2bb08a){return db[_0x5ad1('0x2e')][_0x5ad1('0x23')](_0x163cc0,{'where':{'id':_0x163cc0['id']},'transaction':_0x2bb08a})[_0x5ad1('0x24')](function(){return db['VoiceExtension'][_0x5ad1('0x25')]({'where':{'VoicePrefixId':_0x163cc0['id']},'transaction':_0x2bb08a})[_0x5ad1('0x24')](function(){return db[_0x5ad1('0x4d')]['find']({'where':{'id':_0x163cc0[_0x5ad1('0x4e')]},'raw':!![]})['then'](function(_0x4d5dc7){return createVoicePrefixExtensions(_0x163cc0,_0x4d5dc7,_0x2bb08a);});});});})[_0x5ad1('0x24')](function(){return db[_0x5ad1('0x2e')]['findById'](_0x163cc0['id']);})[_0x5ad1('0x24')](respondWithResult(_0x390b31,null))[_0x5ad1('0x48')](handleError(_0x390b31,null));};exports[_0x5ad1('0x6c')]=function(_0x17bdb2,_0x297c31,_0x4c8b08){return db[_0x5ad1('0x2e')][_0x5ad1('0x46')]({'where':{'id':_0x17bdb2['params']['id']}})[_0x5ad1('0x24')](handleEntityNotFound(_0x297c31,null))[_0x5ad1('0x24')](function(_0x5580de){if(_0x5580de){return _0x5580de['addAgents'](_0x17bdb2[_0x5ad1('0x69')]['ids'],_['omit'](_0x17bdb2[_0x5ad1('0x69')],[_0x5ad1('0x6d'),'id'])||{})[_0x5ad1('0x6e')](function(_0x5ae4c9){for(var _0x1827b5=0x0;_0x1827b5<_0x17bdb2[_0x5ad1('0x69')][_0x5ad1('0x6d')][_0x5ad1('0x38')];_0x1827b5+=0x1){socket[_0x5ad1('0x6f')]('userVoicePrefix:save',{'UserId':_0x17bdb2['body'][_0x5ad1('0x6d')][_0x1827b5],'VoicePrefixId':_0x17bdb2['params']['id']});}return _0x5ae4c9;});}})[_0x5ad1('0x24')](respondWithResult(_0x297c31,null))[_0x5ad1('0x48')](handleError(_0x297c31,null));};exports['removeAgents']=function(_0x1a44eb,_0x1e6454,_0x3399ac){return db[_0x5ad1('0x2e')][_0x5ad1('0x46')]({'where':{'id':_0x1a44eb['params']['id']}})[_0x5ad1('0x24')](handleEntityNotFound(_0x1e6454,null))[_0x5ad1('0x24')](function(_0x389788){if(_0x389788){return _0x389788['removeAgents'](_0x1a44eb['query']['ids'])[_0x5ad1('0x24')](function(){if(_[_0x5ad1('0x70')](_0x1a44eb[_0x5ad1('0x33')]['ids'])){for(var _0x46406c=0x0;_0x46406c<_0x1a44eb[_0x5ad1('0x33')]['ids']['length'];_0x46406c+=0x1){socket[_0x5ad1('0x6f')]('userVoicePrefix:remove',{'UserId':Number(_0x1a44eb['query']['ids'][_0x46406c]),'VoicePrefixId':Number(_0x1a44eb['params']['id'])});}}else{socket[_0x5ad1('0x6f')](_0x5ad1('0x71'),{'UserId':Number(_0x1a44eb[_0x5ad1('0x33')][_0x5ad1('0x6d')]),'VoicePrefixId':Number(_0x1a44eb[_0x5ad1('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x1e6454,null))[_0x5ad1('0x48')](handleError(_0x1e6454,null));};exports['getAgents']=function(_0x1c84b8,_0x536cf0,_0x23866f){var _0x3da6ff={};var _0xe304e1={};var _0x1f6d5b;var _0x531509;return db['VoicePrefix'][_0x5ad1('0x72')]({'where':{'id':_0x1c84b8['params']['id']}})[_0x5ad1('0x24')](handleEntityNotFound(_0x536cf0,null))[_0x5ad1('0x24')](function(_0x50bc50){if(_0x50bc50){_0x1f6d5b=_0x50bc50;_0xe304e1[_0x5ad1('0x32')]=_[_0x5ad1('0x44')](db['User'][_0x5ad1('0x2f')]);_0xe304e1[_0x5ad1('0x33')]=_[_0x5ad1('0x44')](_0x1c84b8[_0x5ad1('0x33')]);_0xe304e1[_0x5ad1('0x34')]=_[_0x5ad1('0x36')](_0xe304e1['model'],_0xe304e1['query']);_0x3da6ff['attributes']=_[_0x5ad1('0x36')](_0xe304e1['model'],qs['fields'](_0x1c84b8[_0x5ad1('0x33')][_0x5ad1('0x37')]));_0x3da6ff[_0x5ad1('0x35')]=_0x3da6ff[_0x5ad1('0x35')][_0x5ad1('0x38')]?_0x3da6ff[_0x5ad1('0x35')]:_0xe304e1[_0x5ad1('0x32')];_0x3da6ff[_0x5ad1('0x73')]=qs[_0x5ad1('0x3a')](_0x1c84b8['query']['sort']);_0x3da6ff[_0x5ad1('0x3b')]=qs[_0x5ad1('0x34')](_[_0x5ad1('0x3c')](_0x1c84b8[_0x5ad1('0x33')],_0xe304e1[_0x5ad1('0x34')]));if(_0x1c84b8[_0x5ad1('0x33')][_0x5ad1('0x3e')]){_0x3da6ff[_0x5ad1('0x3b')]=_[_0x5ad1('0x3f')](_0x3da6ff[_0x5ad1('0x3b')],{'$or':_[_0x5ad1('0x2d')](_0x3da6ff[_0x5ad1('0x35')],function(_0x2db5da){var _0x5cf283={};_0x5cf283[_0x2db5da]={'$like':'%'+_0x1c84b8[_0x5ad1('0x33')][_0x5ad1('0x3e')]+'%'};return _0x5cf283;})});}_0x3da6ff=_[_0x5ad1('0x3f')]({},_0x3da6ff,_0x1c84b8['options']);return _0x1f6d5b[_0x5ad1('0x74')](_0x3da6ff);}})[_0x5ad1('0x24')](function(_0x402e67){if(_0x402e67){_0x531509=_0x402e67[_0x5ad1('0x38')];if(!_0x1c84b8[_0x5ad1('0x33')][_0x5ad1('0x75')](_0x5ad1('0x39'))){_0x3da6ff['limit']=qs[_0x5ad1('0x1e')](_0x1c84b8['query']['limit']);_0x3da6ff[_0x5ad1('0x1d')]=qs[_0x5ad1('0x1d')](_0x1c84b8['query'][_0x5ad1('0x1d')]);}return _0x1f6d5b[_0x5ad1('0x74')](_0x3da6ff);}})[_0x5ad1('0x24')](function(_0x2617ac){if(_0x2617ac){return _0x2617ac?{'count':_0x531509,'rows':_0x2617ac}:null;}})[_0x5ad1('0x24')](respondWithResult(_0x536cf0,null))[_0x5ad1('0x48')](handleError(_0x536cf0,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 32e0e33..1bd5b0a 100644 --- a/server/api/voicePrefix/voicePrefix.events.js +++ b/server/api/voicePrefix/voicePrefix.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['save','update','remove','emit','hasOwnProperty','hook','exports','VoicePrefix','setMaxListeners'];(function(_0x219b5b,_0x1092c8){var _0x22f1b1=function(_0x115b49){while(--_0x115b49){_0x219b5b['push'](_0x219b5b['shift']());}};_0x22f1b1(++_0x1092c8);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x49c4('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x49c4('0x1')](0x0);var events={'afterCreate':_0x49c4('0x2'),'afterUpdate':_0x49c4('0x3'),'afterDestroy':_0x49c4('0x4')};function emitEvent(_0x2ad237){return function(_0x4e0313,_0x4941f1,_0x41a183){VoicePrefixEvents['emit'](_0x2ad237+':'+_0x4e0313['id'],_0x4e0313);VoicePrefixEvents[_0x49c4('0x5')](_0x2ad237,_0x4e0313);_0x41a183(null);};}for(var e in events){if(events[_0x49c4('0x6')](e)){var event=events[e];VoicePrefix[_0x49c4('0x7')](e,emitEvent(event));}}module[_0x49c4('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xcb91=['save','update','emit','hasOwnProperty','hook','VoicePrefix','setMaxListeners'];(function(_0x1b4e21,_0x2773ac){var _0x2fdced=function(_0x3783fb){while(--_0x3783fb){_0x1b4e21['push'](_0x1b4e21['shift']());}};_0x2fdced(++_0x2773ac);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0xcb91[_0x5a95fa];return _0x1a61b8;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x1cb9('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1cb9('0x1')](0x0);var events={'afterCreate':_0x1cb9('0x2'),'afterUpdate':_0x1cb9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x8c392f){return function(_0x2c17b8,_0x545a34,_0x13d5fd){VoicePrefixEvents[_0x1cb9('0x4')](_0x8c392f+':'+_0x2c17b8['id'],_0x2c17b8);VoicePrefixEvents['emit'](_0x8c392f,_0x2c17b8);_0x13d5fd(null);};}for(var e in events){if(events[_0x1cb9('0x5')](e)){var event=events[e];VoicePrefix[_0x1cb9('0x6')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index adfb64b..db34f2f 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 _0x486f=['path','rimraf','./voicePrefix.attributes','exports','define','VoicePrefix','lodash','../../config/logger','moment','bluebird'];(function(_0xdf5462,_0x66522a){var _0x12bcb0=function(_0x467132){while(--_0x467132){_0xdf5462['push'](_0xdf5462['shift']());}};_0x12bcb0(++_0x66522a);}(_0x486f,0x13c));var _0xf486=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x486f[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xf486('0x0'));var util=require('util');var logger=require(_0xf486('0x1'))('api');var moment=require(_0xf486('0x2'));var BPromise=require(_0xf486('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf486('0x4'));var rimraf=require(_0xf486('0x5'));var config=require('../../config/environment');var attributes=require(_0xf486('0x6'));module[_0xf486('0x7')]=function(_0x3db21b,_0x4d9bf0){return _0x3db21b[_0xf486('0x8')](_0xf486('0x9'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46c8=['api','moment','bluebird','request-promise','../../config/environment','./voicePrefix.attributes','define','lodash','../../config/logger'];(function(_0x2da287,_0x4ca1ed){var _0x2b130a=function(_0x347433){while(--_0x347433){_0x2da287['push'](_0x2da287['shift']());}};_0x2b130a(++_0x4ca1ed);}(_0x46c8,0x142));var _0x846c=function(_0x41991f,_0x719448){_0x41991f=_0x41991f-0x0;var _0xce02d8=_0x46c8[_0x41991f];return _0xce02d8;};'use strict';var _=require(_0x846c('0x0'));var util=require('util');var logger=require(_0x846c('0x1'))(_0x846c('0x2'));var moment=require(_0x846c('0x3'));var BPromise=require(_0x846c('0x4'));var rp=require(_0x846c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x846c('0x6'));var attributes=require(_0x846c('0x7'));module['exports']=function(_0x1612c5,_0x2d1408){return _0x1612c5[_0x846c('0x8')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index f01968d..cd1c18b 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 _0x397a=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3cb11b,_0xfd38f4){var _0x37b8fc=function(_0x19e084){while(--_0x19e084){_0x3cb11b['push'](_0x3cb11b['shift']());}};_0x37b8fc(++_0xfd38f4);}(_0x397a,0x130));var _0xa397=function(_0x18d87f,_0x8cafdf){_0x18d87f=_0x18d87f-0x0;var _0x33c8a1=_0x397a[_0x18d87f];return _0x33c8a1;};'use strict';var _=require(_0xa397('0x0'));var util=require(_0xa397('0x1'));var moment=require(_0xa397('0x2'));var BPromise=require(_0xa397('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa397('0x4'));var db=require(_0xa397('0x5'))['db'];var utils=require(_0xa397('0x6'));var logger=require(_0xa397('0x7'))(_0xa397('0x8'));var config=require(_0xa397('0x9'));var jayson=require(_0xa397('0xa'));var client=jayson[_0xa397('0xb')][_0xa397('0xc')]({'port':0x232a});config[_0xa397('0xd')]=_[_0xa397('0xe')](config[_0xa397('0xd')],{'host':_0xa397('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa397('0xd')]));require(_0xa397('0x10'))[_0xa397('0x11')](socket);function respondWithRpcPromise(_0x5c454c,_0x28d07e,_0x5ee2c3){return new BPromise(function(_0x5dcb31,_0x4caa69){return client[_0xa397('0x12')](_0x5c454c,_0x5ee2c3)[_0xa397('0x13')](function(_0x16cb94){logger[_0xa397('0x14')](_0xa397('0x15'),_0x28d07e,_0xa397('0x16'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x28d07e,'request\x20sent',JSON[_0xa397('0x17')](_0x16cb94));if(_0x16cb94['error']){if(_0x16cb94[_0xa397('0x18')]['code']===0x1f4){logger[_0xa397('0x18')](_0xa397('0x15'),_0x28d07e,_0x16cb94[_0xa397('0x18')][_0xa397('0x19')]);return _0x4caa69(_0x16cb94[_0xa397('0x18')][_0xa397('0x19')]);}logger[_0xa397('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x28d07e,_0x16cb94[_0xa397('0x18')][_0xa397('0x19')]);return _0x5dcb31(_0x16cb94['error'][_0xa397('0x19')]);}else{logger[_0xa397('0x14')](_0xa397('0x15'),_0x28d07e,_0xa397('0x16'));_0x5dcb31(_0x16cb94['result'][_0xa397('0x19')]);}})['catch'](function(_0x1ac85d){logger[_0xa397('0x18')](_0xa397('0x15'),_0x28d07e,_0x1ac85d);_0x4caa69(_0x1ac85d);});});} \ No newline at end of file +var _0x1fac=['client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x554a65,_0x1a8928){var _0x4407a8=function(_0x2e9a80){while(--_0x2e9a80){_0x554a65['push'](_0x554a65['shift']());}};_0x4407a8(++_0x1a8928);}(_0x1fac,0xe9));var _0xc1fa=function(_0x1d1f26,_0x32bb93){_0x1d1f26=_0x1d1f26-0x0;var _0x415937=_0x1fac[_0x1d1f26];return _0x415937;};'use strict';var _=require(_0xc1fa('0x0'));var util=require('util');var moment=require(_0xc1fa('0x1'));var BPromise=require('bluebird');var rs=require(_0xc1fa('0x2'));var fs=require('fs');var Redis=require(_0xc1fa('0x3'));var db=require(_0xc1fa('0x4'))['db'];var utils=require(_0xc1fa('0x5'));var logger=require(_0xc1fa('0x6'))(_0xc1fa('0x7'));var config=require(_0xc1fa('0x8'));var jayson=require(_0xc1fa('0x9'));var client=jayson[_0xc1fa('0xa')]['http']({'port':0x232a});config[_0xc1fa('0xb')]=_[_0xc1fa('0xc')](config[_0xc1fa('0xb')],{'host':_0xc1fa('0xd'),'port':0x18eb});var socket=require(_0xc1fa('0xe'))(new Redis(config['redis']));require(_0xc1fa('0xf'))[_0xc1fa('0x10')](socket);function respondWithRpcPromise(_0x43b4d9,_0x2179a3,_0x2989bf){return new BPromise(function(_0xfbe5ad,_0x4c8c49){return client[_0xc1fa('0x11')](_0x43b4d9,_0x2989bf)['then'](function(_0x264409){logger[_0xc1fa('0x12')](_0xc1fa('0x13'),_0x2179a3,_0xc1fa('0x14'));logger[_0xc1fa('0x15')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x2179a3,_0xc1fa('0x14'),JSON['stringify'](_0x264409));if(_0x264409[_0xc1fa('0x16')]){if(_0x264409[_0xc1fa('0x16')][_0xc1fa('0x17')]===0x1f4){logger['error'](_0xc1fa('0x13'),_0x2179a3,_0x264409[_0xc1fa('0x16')][_0xc1fa('0x18')]);return _0x4c8c49(_0x264409[_0xc1fa('0x16')][_0xc1fa('0x18')]);}logger[_0xc1fa('0x16')](_0xc1fa('0x13'),_0x2179a3,_0x264409[_0xc1fa('0x16')][_0xc1fa('0x18')]);return _0xfbe5ad(_0x264409[_0xc1fa('0x16')][_0xc1fa('0x18')]);}else{logger[_0xc1fa('0x12')](_0xc1fa('0x13'),_0x2179a3,_0xc1fa('0x14'));_0xfbe5ad(_0x264409[_0xc1fa('0x19')]['message']);}})[_0xc1fa('0x1a')](function(_0x5ef86e){logger[_0xc1fa('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x2179a3,_0x5ef86e);_0x4c8c49(_0x5ef86e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index b022c70..28dc4ba 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 _0x2e67=['./voicePrefix.events','save','update','emit','removeListener','register','length'];(function(_0x265341,_0x153c42){var _0x2267d8=function(_0x1ef5e4){while(--_0x1ef5e4){_0x265341['push'](_0x265341['shift']());}};_0x2267d8(++_0x153c42);}(_0x2e67,0xc4));var _0x72e6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2e67[_0x20a584];return _0x4b41a8;};'use strict';var VoicePrefixEvents=require(_0x72e6('0x0'));var events=[_0x72e6('0x1'),'remove',_0x72e6('0x2')];function createListener(_0x2b281a,_0x2dd980){return function(_0x2f5362){_0x2dd980[_0x72e6('0x3')](_0x2b281a,_0x2f5362);};}function removeListener(_0x1b42a3,_0x235263){return function(){VoicePrefixEvents[_0x72e6('0x4')](_0x1b42a3,_0x235263);};}exports[_0x72e6('0x5')]=function(_0x3ff448){for(var _0x5a07c5=0x0,_0x2f94f0=events[_0x72e6('0x6')];_0x5a07c5<_0x2f94f0;_0x5a07c5++){var _0xe079ba=events[_0x5a07c5];var _0x2e283b=createListener('voicePrefix:'+_0xe079ba,_0x3ff448);VoicePrefixEvents['on'](_0xe079ba,_0x2e283b);}}; \ No newline at end of file +var _0x3d71=['update','removeListener','length','voicePrefix:','./voicePrefix.events','remove'];(function(_0x2853dd,_0x36df3b){var _0x420394=function(_0x53dbe0){while(--_0x53dbe0){_0x2853dd['push'](_0x2853dd['shift']());}};_0x420394(++_0x36df3b);}(_0x3d71,0xca));var _0x13d7=function(_0x367138,_0x58c5fa){_0x367138=_0x367138-0x0;var _0x1cbf57=_0x3d71[_0x367138];return _0x1cbf57;};'use strict';var VoicePrefixEvents=require(_0x13d7('0x0'));var events=['save',_0x13d7('0x1'),_0x13d7('0x2')];function createListener(_0xafe53a,_0x1dda4b){return function(_0x22f531){_0x1dda4b['emit'](_0xafe53a,_0x22f531);};}function removeListener(_0x22709b,_0x1706df){return function(){VoicePrefixEvents[_0x13d7('0x3')](_0x22709b,_0x1706df);};}exports['register']=function(_0x19ec6c){for(var _0x4135ef=0x0,_0x1bac00=events[_0x13d7('0x4')];_0x4135ef<_0x1bac00;_0x4135ef++){var _0x1c67b5=events[_0x4135ef];var _0x7c3b99=createListener(_0x13d7('0x5')+_0x1c67b5,_0x19ec6c);VoicePrefixEvents['on'](_0x1c67b5,_0x7c3b99);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 253eb97..38e1b5c 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 _0x8151=['get','index','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getTeams','getAgents','/:id/members','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','addTeams','/:id/users','addAgents','addLists','addBlackLists','put','update','delete','destroy','/:id/teams','removeTeams','removeAgents','removeLists','removeBlackLists','multer','util','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x359681,_0x14b4e1){var _0x509eea=function(_0x2da226){while(--_0x2da226){_0x359681['push'](_0x359681['shift']());}};_0x509eea(++_0x14b4e1);}(_0x8151,0x142));var _0x1815=function(_0xdc5664,_0x4eef5a){_0xdc5664=_0xdc5664-0x0;var _0xd65a92=_0x8151[_0xdc5664];return _0xd65a92;};'use strict';var multer=require(_0x1815('0x0'));var util=require(_0x1815('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1815('0x2'));var router=express[_0x1815('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1815('0x4'));var config=require(_0x1815('0x5'));var controller=require('./voiceQueue.controller');router[_0x1815('0x6')]('/',auth['isAuthenticated'](),controller[_0x1815('0x7')]);router[_0x1815('0x6')](_0x1815('0x8'),auth[_0x1815('0x9')](),controller[_0x1815('0xa')]);router[_0x1815('0x6')](_0x1815('0xb'),auth[_0x1815('0x9')](),controller[_0x1815('0xc')]);router['get'](_0x1815('0xd'),auth[_0x1815('0x9')](),controller[_0x1815('0xe')]);router[_0x1815('0x6')]('/:id/hopper_finals',auth[_0x1815('0x9')](),controller[_0x1815('0xf')]);router[_0x1815('0x6')](_0x1815('0x10'),auth['isAuthenticated'](),controller[_0x1815('0x11')]);router[_0x1815('0x6')]('/:id/teams',auth[_0x1815('0x9')](),controller[_0x1815('0x12')]);router['get']('/:id/users',auth[_0x1815('0x9')](),controller[_0x1815('0x13')]);router[_0x1815('0x6')](_0x1815('0x14'),auth[_0x1815('0x9')](),controller['getMembers']);router[_0x1815('0x6')](_0x1815('0x15'),auth[_0x1815('0x9')](),controller[_0x1815('0x16')]);router[_0x1815('0x6')](_0x1815('0x17'),auth[_0x1815('0x9')](),controller[_0x1815('0x18')]);router[_0x1815('0x19')]('/',auth[_0x1815('0x9')](),controller[_0x1815('0x1a')]);router[_0x1815('0x19')]('/:id/clone',auth[_0x1815('0x9')](),controller['clone']);router[_0x1815('0x19')]('/:id/teams',auth[_0x1815('0x9')](),controller[_0x1815('0x1b')]);router[_0x1815('0x19')](_0x1815('0x1c'),auth[_0x1815('0x9')](),controller[_0x1815('0x1d')]);router[_0x1815('0x19')](_0x1815('0x15'),auth['isAuthenticated'](),controller[_0x1815('0x1e')]);router[_0x1815('0x19')]('/:id/blacklists',auth[_0x1815('0x9')](),controller[_0x1815('0x1f')]);router[_0x1815('0x20')](_0x1815('0x8'),auth[_0x1815('0x9')](),controller[_0x1815('0x21')]);router[_0x1815('0x22')](_0x1815('0x8'),auth['isAuthenticated'](),controller[_0x1815('0x23')]);router[_0x1815('0x22')](_0x1815('0x24'),auth[_0x1815('0x9')](),controller[_0x1815('0x25')]);router['delete'](_0x1815('0x1c'),auth['isAuthenticated'](),controller[_0x1815('0x26')]);router[_0x1815('0x22')](_0x1815('0x15'),auth['isAuthenticated'](),controller[_0x1815('0x27')]);router[_0x1815('0x22')](_0x1815('0x17'),auth['isAuthenticated'](),controller[_0x1815('0x28')]);module['exports']=router; \ No newline at end of file +var _0x6f2d=['removeTeams','removeAgents','removeLists','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueue.controller','get','index','/:id','isAuthenticated','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','addBlackLists','update','delete','destroy'];(function(_0x3d9413,_0x2d4f66){var _0x2427d8=function(_0x5666bd){while(--_0x5666bd){_0x3d9413['push'](_0x3d9413['shift']());}};_0x2427d8(++_0x2d4f66);}(_0x6f2d,0x144));var _0xd6f2=function(_0x366ade,_0x1013d6){_0x366ade=_0x366ade-0x0;var _0x5259d4=_0x6f2d[_0x366ade];return _0x5259d4;};'use strict';var multer=require('multer');var util=require(_0xd6f2('0x0'));var path=require(_0xd6f2('0x1'));var timeout=require(_0xd6f2('0x2'));var express=require(_0xd6f2('0x3'));var router=express[_0xd6f2('0x4')]();var auth=require(_0xd6f2('0x5'));var interaction=require(_0xd6f2('0x6'));var config=require('../../config/environment');var controller=require(_0xd6f2('0x7'));router[_0xd6f2('0x8')]('/',auth['isAuthenticated'](),controller[_0xd6f2('0x9')]);router[_0xd6f2('0x8')](_0xd6f2('0xa'),auth[_0xd6f2('0xb')](),controller['show']);router[_0xd6f2('0x8')]('/:id/hoppers',auth[_0xd6f2('0xb')](),controller[_0xd6f2('0xc')]);router[_0xd6f2('0x8')]('/:id/hopper_histories',auth[_0xd6f2('0xb')](),controller[_0xd6f2('0xd')]);router[_0xd6f2('0x8')](_0xd6f2('0xe'),auth['isAuthenticated'](),controller[_0xd6f2('0xf')]);router[_0xd6f2('0x8')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0xd6f2('0x10')]);router['get'](_0xd6f2('0x11'),auth['isAuthenticated'](),controller[_0xd6f2('0x12')]);router['get'](_0xd6f2('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0xd6f2('0x8')](_0xd6f2('0x14'),auth['isAuthenticated'](),controller[_0xd6f2('0x15')]);router[_0xd6f2('0x8')](_0xd6f2('0x16'),auth[_0xd6f2('0xb')](),controller[_0xd6f2('0x17')]);router[_0xd6f2('0x8')](_0xd6f2('0x18'),auth[_0xd6f2('0xb')](),controller[_0xd6f2('0x19')]);router[_0xd6f2('0x1a')]('/',auth[_0xd6f2('0xb')](),controller[_0xd6f2('0x1b')]);router[_0xd6f2('0x1a')](_0xd6f2('0x1c'),auth['isAuthenticated'](),controller[_0xd6f2('0x1d')]);router['post'](_0xd6f2('0x11'),auth['isAuthenticated'](),controller[_0xd6f2('0x1e')]);router[_0xd6f2('0x1a')](_0xd6f2('0x13'),auth[_0xd6f2('0xb')](),controller[_0xd6f2('0x1f')]);router[_0xd6f2('0x1a')](_0xd6f2('0x16'),auth[_0xd6f2('0xb')](),controller['addLists']);router[_0xd6f2('0x1a')](_0xd6f2('0x18'),auth['isAuthenticated'](),controller[_0xd6f2('0x20')]);router['put'](_0xd6f2('0xa'),auth[_0xd6f2('0xb')](),controller[_0xd6f2('0x21')]);router[_0xd6f2('0x22')](_0xd6f2('0xa'),auth[_0xd6f2('0xb')](),controller[_0xd6f2('0x23')]);router[_0xd6f2('0x22')](_0xd6f2('0x11'),auth[_0xd6f2('0xb')](),controller[_0xd6f2('0x24')]);router['delete'](_0xd6f2('0x13'),auth[_0xd6f2('0xb')](),controller[_0xd6f2('0x25')]);router[_0xd6f2('0x22')]('/:id/lists',auth['isAuthenticated'](),controller[_0xd6f2('0x26')]);router['delete']('/:id/blacklists',auth[_0xd6f2('0xb')](),controller['removeBlackLists']);module[_0xd6f2('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index e28531e..e432529 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 _0xb39b=['Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','inbound','outbound','default','ringall','fewestcalls','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','progressive','predictive','power','INTEGER','ENUM','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','Dial\x20Method.'];(function(_0x40be86,_0x68fe5d){var _0xda3c3b=function(_0x39deab){while(--_0x39deab){_0x40be86['push'](_0x40be86['shift']());}};_0xda3c3b(++_0x68fe5d);}(_0xb39b,0xad));var _0xbb39=function(_0xd311bb,_0x36efed){_0xd311bb=_0xd311bb-0x0;var _0x51e98a=_0xb39b[_0xd311bb];return _0x51e98a;};'use strict';var Sequelize=require(_0xbb39('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb39('0x1')],'allowNull':![],'unique':_0xbb39('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xbb39('0x3'),_0xbb39('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xbb39('0x1')],'defaultValue':_0xbb39('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xbb39('0x6'),'leastrecent',_0xbb39('0x7'),'random',_0xbb39('0x8'),_0xbb39('0x9'),_0xbb39('0xa'),_0xbb39('0xb')),'allowNull':![],'defaultValue':_0xbb39('0x6'),'set':function(_0x4f91e3){this[_0xbb39('0xc')](_0xbb39('0xd'),_0x4f91e3?_0x4f91e3:'rrmemory');},'get':function(){var _0x5f057d=this[_0xbb39('0xe')](_0xbb39('0xf'));var _0x154c44=this[_0xbb39('0xe')](_0xbb39('0x10'));var _0x5a10c9=this[_0xbb39('0xe')](_0xbb39('0xd'));if(_0x5f057d===_0xbb39('0x3')){return _0x5a10c9;}if(_0x154c44==='booked'&&_0x5a10c9===_0xbb39('0x8')||_0x154c44===_0xbb39('0x11')&&_0x5a10c9==='roundrobin'){return _0x5a10c9;}if(_0x154c44===_0xbb39('0x12')||_0x154c44===_0xbb39('0x13')||_0x154c44===_0xbb39('0x14')){return _0x5a10c9;}return null;}},'servicelevel':{'type':Sequelize[_0xbb39('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xbb39('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xbb39('0x15')](0xb)},'timeout':{'type':Sequelize[_0xbb39('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xbb39('0x1')]},'weight':{'type':Sequelize[_0xbb39('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xbb39('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xbb39('0x16')](_0xbb39('0x17'),'no'),'defaultValue':_0xbb39('0x17')},'autopause':{'type':Sequelize[_0xbb39('0x16')](_0xbb39('0x17'),'no',_0xbb39('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xbb39('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0xbb39('0x16')](_0xbb39('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xbb39('0x16')](_0xbb39('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xbb39('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xbb39('0x16')](_0xbb39('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xbb39('0x16')](_0xbb39('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xbb39('0x16')](_0xbb39('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xbb39('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xbb39('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xbb39('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xbb39('0x16')](_0xbb39('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xbb39('0x16')](_0xbb39('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xbb39('0x16')](_0xbb39('0x17'),'no',_0xbb39('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xbb39('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xbb39('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xbb39('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xbb39('0x1')]},'queue_youarenext':{'type':Sequelize[_0xbb39('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xbb39('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xbb39('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xbb39('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xbb39('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xbb39('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xbb39('0x1')]},'queue_quantity1':{'type':Sequelize[_0xbb39('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xbb39('0x1')]},'queue_less_than':{'type':Sequelize[_0xbb39('0x1')]},'periodic_announce':{'type':Sequelize[_0xbb39('0x1a')],'set':function(_0x34dafc){this['setDataValue'](_0xbb39('0x1b'),_0x34dafc?_0x34dafc[_0xbb39('0x1c')](','):[]);},'get':function(){return this['getDataValue'](_0xbb39('0x1b'))?this[_0xbb39('0xe')]('periodic_announce')[_0xbb39('0x1d')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xbb39('0x17'),'set':function(_0x15f48b){this[_0xbb39('0xc')]('joinempty',_0x15f48b?_0x15f48b[_0xbb39('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0xbb39('0x1e'))?this['getDataValue'](_0xbb39('0x1e'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xbb39('0x1')],'defaultValue':'no','set':function(_0x5a95e4){this[_0xbb39('0xc')](_0xbb39('0x1f'),_0x5a95e4?_0x5a95e4[_0xbb39('0x1c')](','):undefined);},'get':function(){return this[_0xbb39('0xe')](_0xbb39('0x1f'))?this[_0xbb39('0xe')](_0xbb39('0x1f'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xbb39('0x16')](_0xbb39('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xbb39('0x16')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xbb39('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xbb39('0x16')](_0xbb39('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xbb39('0x1')]},'description':{'type':Sequelize[_0xbb39('0x1')]},'acw':{'type':Sequelize[_0xbb39('0x20')],'defaultValue':0x0,'set':function(_0x1df6dd){this['setDataValue'](_0xbb39('0x21'),_0x1df6dd);if(_0x1df6dd){if(this['getDataValue']('wrapuptime')<0x2){this[_0xbb39('0xc')](_0xbb39('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xbb39('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xbb39('0x16')](_0xbb39('0x23'),_0xbb39('0x12'),_0xbb39('0x14'),_0xbb39('0x13'),_0xbb39('0x11')),'defaultValue':_0xbb39('0x12'),'comment':_0xbb39('0x24')},'dialLimitChannel':{'type':Sequelize[_0xbb39('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xbb39('0x25')},'dialLimitQueue':{'type':Sequelize[_0xbb39('0x15')](0x4)[_0xbb39('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xbb39('0x27')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xbb39('0x28'),_0xbb39('0x29')),'defaultValue':_0xbb39('0x29'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xbb39('0x2a')](0x2)[_0xbb39('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xbb39('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0xbb39('0x15')](0x3)[_0xbb39('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xbb39('0x15')](0x3)[_0xbb39('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xbb39('0x1')],'defaultValue':'tTxX','comment':_0xbb39('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0xbb39('0x15')](0x3)[_0xbb39('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb39('0x2d')},'dialQueueProject':{'type':Sequelize[_0xbb39('0x1')],'comment':_0xbb39('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0xbb39('0x15')](0x3)[_0xbb39('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbb39('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb39('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0xbb39('0x15')](0x3)[_0xbb39('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbb39('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0xbb39('0x15')](0x5)[_0xbb39('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbb39('0x15')](0x3)[_0xbb39('0x26')],'defaultValue':0x3,'comment':_0xbb39('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbb39('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbb39('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0xbb39('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xbb39('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xbb39('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xbb39('0x16')](_0xbb39('0x33'),_0xbb39('0x34'),_0xbb39('0x35')),'defaultValue':_0xbb39('0x33')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xbb39('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0xbb39('0x15')](0x9)[_0xbb39('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xbb39('0x37')},'dialAMDGreeting':{'type':Sequelize[_0xbb39('0x15')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xbb39('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbb39('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbb39('0x15')](0x9)[_0xbb39('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbb39('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0xbb39('0x15')](0x9)[_0xbb39('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbb39('0x15')](0x9)[_0xbb39('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xbb39('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xbb39('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbb39('0x15')](0x5)[_0xbb39('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xbb39('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbb39('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0xbb39('0x15')](0x5)[_0xbb39('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xbb39('0x3d')},'dialRecallInQueue':{'type':Sequelize[_0xbb39('0x20')],'defaultValue':0x0,'comment':_0xbb39('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize[_0xbb39('0x16')](_0xbb39('0x3f'),_0xbb39('0x40')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xbb39('0x1')],'comment':_0xbb39('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xbb39('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xbb39('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbb39('0x15')](0x3)[_0xbb39('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xbb39('0x15')](0x3)[_0xbb39('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbb39('0x41')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbb39('0x15')],'allowNull':!![],'comment':_0xbb39('0x42')},'mandatoryDisposition':{'type':Sequelize[_0xbb39('0x20')],'defaultValue':![],'comment':_0xbb39('0x43'),'set':function(_0x1de183){if(!_0x1de183)this[_0xbb39('0xc')](_0xbb39('0x44'),null);this[_0xbb39('0xc')](_0xbb39('0x45'),_0x1de183);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xbb39('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xbb39('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x01b0=['07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','inbound','outbound','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','INTEGER','yes','all','once','TEXT','join','periodic_announce','joinempty','split','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','power','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'];(function(_0x121cb6,_0x1500b7){var _0x5ea2db=function(_0x184239){while(--_0x184239){_0x121cb6['push'](_0x121cb6['shift']());}};_0x5ea2db(++_0x1500b7);}(_0x01b0,0xfb));var _0x001b=function(_0x4924b3,_0x4521cb){_0x4924b3=_0x4924b3-0x0;var _0x1ee472=_0x01b0[_0x4924b3];return _0x1ee472;};'use strict';var Sequelize=require(_0x001b('0x0'));module[_0x001b('0x1')]={'name':{'type':Sequelize[_0x001b('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x001b('0x3')](_0x001b('0x4'),_0x001b('0x5')),'allowNull':![],'defaultValue':_0x001b('0x4')},'musiconhold':{'type':Sequelize[_0x001b('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x001b('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x001b('0x3')]('rr',_0x001b('0x6'),_0x001b('0x7'),_0x001b('0x8'),_0x001b('0x9'),_0x001b('0xa'),_0x001b('0xb'),_0x001b('0xc'),_0x001b('0xd')),'allowNull':![],'defaultValue':_0x001b('0x6'),'set':function(_0x1f135d){this[_0x001b('0xe')](_0x001b('0xf'),_0x1f135d?_0x1f135d:_0x001b('0xa'));},'get':function(){var _0x3d59a3=this[_0x001b('0x10')]('type');var _0x37ed28=this[_0x001b('0x10')](_0x001b('0x11'));var _0x2c3750=this[_0x001b('0x10')](_0x001b('0xf'));if(_0x3d59a3===_0x001b('0x4')){return _0x2c3750;}if(_0x37ed28===_0x001b('0x12')&&_0x2c3750===_0x001b('0xa')||_0x37ed28===_0x001b('0x12')&&_0x2c3750===_0x001b('0x13')){return _0x2c3750;}if(_0x37ed28===_0x001b('0x14')||_0x37ed28===_0x001b('0x15')||_0x37ed28==='power'){return _0x2c3750;}return null;}},'servicelevel':{'type':Sequelize[_0x001b('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x001b('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x001b('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x001b('0x2')]},'weight':{'type':Sequelize[_0x001b('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x001b('0x3')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x001b('0x3')](_0x001b('0x17'),'no',_0x001b('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x001b('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x001b('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x001b('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x001b('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x001b('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x001b('0x3')](_0x001b('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x001b('0x3')](_0x001b('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x001b('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x001b('0x3')](_0x001b('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x001b('0x3')](_0x001b('0x17'),'no'),'defaultValue':_0x001b('0x17')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x001b('0x17'),'no',_0x001b('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x001b('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x001b('0x3')](_0x001b('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x001b('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x001b('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x001b('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x001b('0x2')]},'queue_youarenext':{'type':Sequelize[_0x001b('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x001b('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x001b('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x001b('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x001b('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x001b('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x001b('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x001b('0x2')]},'queue_quantity2':{'type':Sequelize[_0x001b('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x001b('0x2')]},'queue_less_than':{'type':Sequelize[_0x001b('0x2')]},'periodic_announce':{'type':Sequelize[_0x001b('0x1a')],'set':function(_0xbbd4e8){this['setDataValue']('periodic_announce',_0xbbd4e8?_0xbbd4e8[_0x001b('0x1b')](','):[]);},'get':function(){return this[_0x001b('0x10')](_0x001b('0x1c'))?this[_0x001b('0x10')](_0x001b('0x1c'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x001b('0x17'),'set':function(_0x3fada7){this[_0x001b('0xe')](_0x001b('0x1d'),_0x3fada7?_0x3fada7['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x001b('0x1d'))?this['getDataValue'](_0x001b('0x1d'))[_0x001b('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x1cfeec){this[_0x001b('0xe')](_0x001b('0x1f'),_0x1cfeec?_0x1cfeec[_0x001b('0x1b')](','):undefined);},'get':function(){return this[_0x001b('0x10')](_0x001b('0x1f'))?this[_0x001b('0x10')](_0x001b('0x1f'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x001b('0x3')](_0x001b('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x001b('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x001b('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x001b('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x001b('0x2')]},'description':{'type':Sequelize[_0x001b('0x2')]},'acw':{'type':Sequelize[_0x001b('0x20')],'defaultValue':0x0,'set':function(_0x81b406){this[_0x001b('0xe')]('acw',_0x81b406);if(_0x81b406){if(this['getDataValue']('wrapuptime')<0x2){this['setDataValue'](_0x001b('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x001b('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x001b('0x22')},'dialMethod':{'type':Sequelize[_0x001b('0x3')](_0x001b('0x23'),_0x001b('0x14'),_0x001b('0x24'),_0x001b('0x15'),'booked'),'defaultValue':_0x001b('0x14'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x001b('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x001b('0x25')},'dialLimitQueue':{'type':Sequelize[_0x001b('0x16')](0x4)[_0x001b('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x001b('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x001b('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x001b('0x28')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x001b('0x29')),'defaultValue':'dropRate','comment':_0x001b('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x001b('0x2b')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x001b('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x001b('0x16')](0x3)[_0x001b('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x001b('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x001b('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x001b('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x001b('0x2e')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x001b('0x2f'),'comment':_0x001b('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x001b('0x16')](0x3)[_0x001b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x001b('0x31')},'dialQueueProject':{'type':Sequelize[_0x001b('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x001b('0x16')](0x3)[_0x001b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x001b('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x001b('0x16')](0x5)[_0x001b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x001b('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x001b('0x16')](0x3)[_0x001b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x001b('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x001b('0x16')](0x5)[_0x001b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x001b('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x001b('0x16')](0x3)[_0x001b('0x26')],'defaultValue':0x3,'comment':_0x001b('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x001b('0x16')](0x5)[_0x001b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x001b('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0x001b('0x16')](0x3)[_0x001b('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x001b('0x38')},'dialTimezone':{'type':Sequelize[_0x001b('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x001b('0x2')],'defaultValue':_0x001b('0x39')},'dialPrefix':{'type':Sequelize[_0x001b('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x001b('0x3a'),'never',_0x001b('0x3b')),'defaultValue':_0x001b('0x3a')},'dialAMDActive':{'type':Sequelize[_0x001b('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x001b('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x001b('0x16')](0x9)[_0x001b('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x001b('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x001b('0x16')](0x9)[_0x001b('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x001b('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x001b('0x16')](0x9)[_0x001b('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x001b('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0x001b('0x16')](0x9)[_0x001b('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x001b('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x001b('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x001b('0x16')](0x9)[_0x001b('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x001b('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x001b('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x001b('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x001b('0x16')](0x9)[_0x001b('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x001b('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0x001b('0x16')](0x5)[_0x001b('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x001b('0x44')},'dialRecallInQueue':{'type':Sequelize[_0x001b('0x20')],'defaultValue':0x0,'comment':_0x001b('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0x001b('0x3')](_0x001b('0x46'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x001b('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x001b('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x001b('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x001b('0x16')](0x3)[_0x001b('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x001b('0x47')},'dialCutDigit':{'type':Sequelize[_0x001b('0x16')](0x3)[_0x001b('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x001b('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x001b('0x16')],'allowNull':!![],'comment':_0x001b('0x49')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x001b('0x4a'),'set':function(_0x3d133b){if(!_0x3d133b)this['setDataValue'](_0x001b('0x4b'),null);this['setDataValue'](_0x001b('0x4c'),_0x3d133b);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x001b('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x001b('0x16')](0x3)[_0x001b('0x26')],'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 64a316e..67c8cc9 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 _0xd71d=['select','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','every','includes','all','union','compact','transaction','removeTeams','isEmpty','removeAgents','addAgents','spread','isNil','isArray','userVoiceQueue:remove','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','toString','onlyIfOpen','insert','fromQuery','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','inbound','QueueCampaigns','outbound','map','value','type','find','destroy','error','stack','name','index','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoiceQueue','includeAll','include','findAll','rows','catch','params','keys','create','body','get','role','VoiceQueues','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','getHoppers','findOne','CmHopper','CmHopperHistory','nolimit','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','Agents','online','interface','forEach','penalty','sequelize','addTeams','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','format','SIP/%s','voicePause','emit','userVoiceQueue:save','ids'];(function(_0x495b9e,_0x58d03a){var _0x24185d=function(_0x3bc9e3){while(--_0x3bc9e3){_0x495b9e['push'](_0x495b9e['shift']());}};_0x24185d(++_0x58d03a);}(_0xd71d,0x1a5));var _0xdd71=function(_0x2c6120,_0x1f3e60){_0x2c6120=_0x2c6120-0x0;var _0x5fb114=_0xd71d[_0x2c6120];return _0x5fb114;};'use strict';var pdf=require(_0xdd71('0x0'));var emlformat=require(_0xdd71('0x1'));var rimraf=require(_0xdd71('0x2'));var zipdir=require(_0xdd71('0x3'));var jsonpatch=require(_0xdd71('0x4'));var rp=require('request-promise');var moment=require(_0xdd71('0x5'));var BPromise=require(_0xdd71('0x6'));var Mustache=require(_0xdd71('0x7'));var util=require('util');var path=require(_0xdd71('0x8'));var sox=require(_0xdd71('0x9'));var csv=require(_0xdd71('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdd71('0xb'));var squel=require(_0xdd71('0xc'));var crypto=require(_0xdd71('0xd'));var jsforce=require(_0xdd71('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdd71('0xa'));var querystring=require(_0xdd71('0xf'));var Papa=require(_0xdd71('0x10'));var Redis=require(_0xdd71('0x11'));var authService=require(_0xdd71('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdd71('0x13'));var hardwareService=require(_0xdd71('0x14'));var logger=require(_0xdd71('0x15'))(_0xdd71('0x16'));var utils=require('../../config/utils');var config=require(_0xdd71('0x17'));var db=require(_0xdd71('0x18'))['db'];config[_0xdd71('0x19')]=_[_0xdd71('0x1a')](config[_0xdd71('0x19')],{'host':_0xdd71('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdd71('0x19')]));require(_0xdd71('0x1c'))[_0xdd71('0x1d')](socket);function respondWithStatusCode(_0x3ede09,_0x4b1f2d){_0x4b1f2d=_0x4b1f2d||0xcc;return function(_0x41f8b1){if(_0x41f8b1){return _0x3ede09[_0xdd71('0x1e')](_0x4b1f2d);}return _0x3ede09[_0xdd71('0x1f')](_0x4b1f2d)[_0xdd71('0x20')]();};}function respondWithResult(_0x27c527,_0x42b476){_0x42b476=_0x42b476||0xc8;return function(_0x407a7b){if(_0x407a7b){return _0x27c527[_0xdd71('0x1f')](_0x42b476)[_0xdd71('0x21')](_0x407a7b);}};}function respondWithFilteredResult(_0x219b23,_0x11accc){return function(_0x58eae4){if(_0x58eae4){var _0x4c3601=_0x58eae4[_0xdd71('0x22')],_0x471df6=_0x11accc[_0xdd71('0x23')],_0x689edf=_0x11accc[_0xdd71('0x23')]+_0x11accc['limit'],_0x17a2da;if(_0x689edf>=_0x4c3601){_0x689edf=_0x4c3601;_0x17a2da=0xc8;}else{_0x17a2da=0xce;}_0x219b23[_0xdd71('0x1f')](_0x17a2da);return _0x219b23[_0xdd71('0x24')](_0xdd71('0x25'),_0x471df6+'-'+_0x689edf+'/'+_0x4c3601)[_0xdd71('0x21')](_0x58eae4);}return null;};}function patchUpdates(_0x3905d8){return function(_0x461d6a){try{jsonpatch[_0xdd71('0x26')](_0x461d6a,_0x3905d8,!![]);}catch(_0x329455){return BPromise[_0xdd71('0x27')](_0x329455);}return _0x461d6a[_0xdd71('0x28')]();};}function saveUpdates(_0x13f10e,_0x5a9960){return function(_0x548f96){if(_0x548f96){return _0x548f96[_0xdd71('0x29')](_0x13f10e)[_0xdd71('0x2a')](function(_0x50ba0a){return _0x50ba0a;});}return null;};}function removeEntity(_0x10ebb0,_0x52d386){return function(_0x2da860){if(_0x2da860){return _0x2da860['destroy']()['then'](function(){var _0x5aca61=_0x2da860['get']({'plain':!![]});var _0x168a14=[{'name':'VoiceQueues','value':_0xdd71('0x2b'),'ignore':![]},{'name':_0xdd71('0x2c'),'value':_0xdd71('0x2d'),'ignore':![]}];var _0x11850a=_(_0x168a14)['filter']('ignore')[_0xdd71('0x2e')](_0xdd71('0x2f'))[_0xdd71('0x2f')]();if(_['includes'](_0x11850a,_0x5aca61[_0xdd71('0x30')])){return;}var _0x3a57fc=_[_0xdd71('0x31')](_0x168a14,['value',_0x5aca61[_0xdd71('0x30')]])['name'];return db['UserProfileResource'][_0xdd71('0x32')]({'where':{'type':_0x3a57fc,'resourceId':_0x5aca61['id']}})[_0xdd71('0x2a')](function(){return _0x2da860;});})[_0xdd71('0x2a')](function(){_0x10ebb0[_0xdd71('0x1f')](0xcc)[_0xdd71('0x20')]();});}};}function handleEntityNotFound(_0x10da75,_0x39ef2e){return function(_0x2b6b07){if(!_0x2b6b07){_0x10da75[_0xdd71('0x1e')](0x194);}return _0x2b6b07;};}function handleError(_0x58fc27,_0x3895a9){_0x3895a9=_0x3895a9||0x1f4;return function(_0x2f3b51){logger[_0xdd71('0x33')](_0x2f3b51[_0xdd71('0x34')]);if(_0x2f3b51['name']){delete _0x2f3b51[_0xdd71('0x35')];}_0x58fc27['status'](_0x3895a9)['send'](_0x2f3b51);};}exports[_0xdd71('0x36')]=function(_0x35ebd9,_0x46e20b){var _0x4a5a7a={},_0x3be7c9={},_0x4ffe6f={'count':0x0,'rows':[]};var _0x80286d=_['map'](db['VoiceQueue'][_0xdd71('0x37')],function(_0x1852c4){return{'name':_0x1852c4[_0xdd71('0x38')],'type':_0x1852c4['type']['key']};});_0x3be7c9[_0xdd71('0x39')]=_['map'](_0x80286d,'name');_0x3be7c9[_0xdd71('0x3a')]=_['keys'](_0x35ebd9['query']);_0x3be7c9[_0xdd71('0x3b')]=_[_0xdd71('0x3c')](_0x3be7c9[_0xdd71('0x39')],_0x3be7c9[_0xdd71('0x3a')]);_0x4a5a7a[_0xdd71('0x3d')]=_[_0xdd71('0x3c')](_0x3be7c9[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x35ebd9[_0xdd71('0x3a')][_0xdd71('0x3e')]));_0x4a5a7a[_0xdd71('0x3d')]=_0x4a5a7a[_0xdd71('0x3d')][_0xdd71('0x3f')]?_0x4a5a7a[_0xdd71('0x3d')]:_0x3be7c9[_0xdd71('0x39')];if(!_0x35ebd9[_0xdd71('0x3a')][_0xdd71('0x40')]('nolimit')){_0x4a5a7a['limit']=qs[_0xdd71('0x41')](_0x35ebd9[_0xdd71('0x3a')][_0xdd71('0x41')]);_0x4a5a7a['offset']=qs['offset'](_0x35ebd9[_0xdd71('0x3a')][_0xdd71('0x23')]);}_0x4a5a7a[_0xdd71('0x42')]=qs['sort'](_0x35ebd9['query'][_0xdd71('0x43')]);_0x4a5a7a['where']=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x35ebd9[_0xdd71('0x3a')],_0x3be7c9['filters']));if(_0x35ebd9[_0xdd71('0x3a')][_0xdd71('0x45')]){_0x4a5a7a[_0xdd71('0x46')]=_[_0xdd71('0x47')](_0x4a5a7a[_0xdd71('0x46')],{'$or':_[_0xdd71('0x2e')](_0x80286d,function(_0x2d404d){if(_0x2d404d[_0xdd71('0x30')]!==_0xdd71('0x48')){var _0xd9c628={};_0xd9c628[_0x2d404d['name']]={'$like':'%'+_0x35ebd9[_0xdd71('0x3a')][_0xdd71('0x45')]+'%'};return _0xd9c628;}})});}_0x4a5a7a=_[_0xdd71('0x47')]({},_0x4a5a7a,_0x35ebd9[_0xdd71('0x49')]);var _0x33a930={'where':_0x4a5a7a[_0xdd71('0x46')]};return db[_0xdd71('0x4a')][_0xdd71('0x22')](_0x33a930)[_0xdd71('0x2a')](function(_0x24ad0f){_0x4ffe6f[_0xdd71('0x22')]=_0x24ad0f;if(_0x35ebd9[_0xdd71('0x3a')][_0xdd71('0x4b')]){_0x4a5a7a[_0xdd71('0x4c')]=[{'all':!![]}];}return db[_0xdd71('0x4a')][_0xdd71('0x4d')](_0x4a5a7a);})[_0xdd71('0x2a')](function(_0x105374){_0x4ffe6f[_0xdd71('0x4e')]=_0x105374;return _0x4ffe6f;})[_0xdd71('0x2a')](respondWithFilteredResult(_0x46e20b,_0x4a5a7a))[_0xdd71('0x4f')](handleError(_0x46e20b,null));};exports['show']=function(_0x50ac64,_0x781fb){var _0xe04928={'raw':![],'where':{'id':_0x50ac64[_0xdd71('0x50')]['id']}},_0x1c5461={};_0x1c5461[_0xdd71('0x39')]=_[_0xdd71('0x51')](db[_0xdd71('0x4a')][_0xdd71('0x37')]);_0x1c5461['query']=_['keys'](_0x50ac64[_0xdd71('0x3a')]);_0x1c5461[_0xdd71('0x3b')]=_[_0xdd71('0x3c')](_0x1c5461[_0xdd71('0x39')],_0x1c5461[_0xdd71('0x3a')]);_0xe04928[_0xdd71('0x3d')]=_['intersection'](_0x1c5461[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x50ac64[_0xdd71('0x3a')]['fields']));_0xe04928[_0xdd71('0x3d')]=_0xe04928[_0xdd71('0x3d')][_0xdd71('0x3f')]?_0xe04928[_0xdd71('0x3d')]:_0x1c5461[_0xdd71('0x39')];if(_0x50ac64[_0xdd71('0x3a')]['includeAll']){_0xe04928[_0xdd71('0x4c')]=[{'all':!![]}];}_0xe04928=_[_0xdd71('0x47')]({},_0xe04928,_0x50ac64['options']);return db[_0xdd71('0x4a')][_0xdd71('0x31')](_0xe04928)[_0xdd71('0x2a')](handleEntityNotFound(_0x781fb,null))[_0xdd71('0x2a')](respondWithResult(_0x781fb,null))[_0xdd71('0x4f')](handleError(_0x781fb,null));};exports[_0xdd71('0x52')]=function(_0x23c73a,_0x33dd72){return db[_0xdd71('0x4a')][_0xdd71('0x52')](_0x23c73a[_0xdd71('0x53')],{})[_0xdd71('0x2a')](function(_0x57b981){var _0x753184=_0x23c73a['user'][_0xdd71('0x54')]({'plain':!![]});if(!_0x753184)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x753184[_0xdd71('0x55')]==='user'){var _0x54b680=_0x57b981[_0xdd71('0x54')]({'plain':!![]});var _0x210563=[{'name':_0xdd71('0x56'),'value':_0xdd71('0x2b')},{'name':'QueueCampaigns','value':_0xdd71('0x2d')}];var _0x46b3e9=_[_0xdd71('0x31')](_0x210563,[_0xdd71('0x2f'),_0x54b680[_0xdd71('0x30')]])[_0xdd71('0x35')];return db['UserProfileSection'][_0xdd71('0x31')]({'where':{'name':_0x46b3e9,'userProfileId':_0x753184[_0xdd71('0x57')]},'raw':!![]})[_0xdd71('0x2a')](function(_0x25b8cd){if(_0x25b8cd&&_0x25b8cd[_0xdd71('0x58')]===0x0){return db[_0xdd71('0x59')][_0xdd71('0x52')]({'name':_0x54b680['name'],'resourceId':_0x54b680['id'],'type':_0x25b8cd[_0xdd71('0x35')],'sectionId':_0x25b8cd['id']},{})[_0xdd71('0x2a')](function(){return _0x57b981;});}else{return _0x57b981;}})['catch'](function(_0x9c99b1){logger[_0xdd71('0x33')](_0xdd71('0x5a'),_0x9c99b1);throw _0x9c99b1;});}return _0x57b981;})[_0xdd71('0x2a')](respondWithResult(_0x33dd72,0xc9))['catch'](handleError(_0x33dd72,null));};exports['clone']=function(_0x132c9e,_0x42d4e1){var _0x4573f8={'where':{'id':_0x132c9e[_0xdd71('0x50')]['id']}},_0x47f973={};_0x47f973[_0xdd71('0x39')]=_[_0xdd71('0x51')](db[_0xdd71('0x4a')][_0xdd71('0x37')]);_0x4573f8[_0xdd71('0x3d')]=_['intersection'](_0x47f973[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x132c9e[_0xdd71('0x3a')][_0xdd71('0x3e')]));_0x4573f8[_0xdd71('0x3d')]=_0x4573f8['attributes']['length']?_0x4573f8[_0xdd71('0x3d')]:_0x47f973[_0xdd71('0x39')];if(_0x132c9e[_0xdd71('0x3a')]['includeAll']){_0x4573f8[_0xdd71('0x4c')]=[{'all':!![]}];}_0x4573f8=_[_0xdd71('0x47')]({},_0x4573f8,_0x132c9e[_0xdd71('0x49')]);return db['VoiceQueue'][_0xdd71('0x31')](_0x4573f8)[_0xdd71('0x2a')](handleEntityNotFound(_0x42d4e1,null))[_0xdd71('0x2a')](function(_0x5363f1){if(_0x5363f1){var _0x2ec797=_0x5363f1['get']({'plain':!![]});_0x2ec797=qs[_0xdd71('0x5b')](_0x2ec797,['id','createdAt',_0xdd71('0x5c')]);_0x132c9e[_0xdd71('0x53')]=_[_0xdd71('0x5b')](_0x132c9e[_0xdd71('0x53')],['id',_0xdd71('0x5d'),_0xdd71('0x5c')]);return db['VoiceQueue'][_0xdd71('0x52')](_['merge'](_0x2ec797,_0x132c9e[_0xdd71('0x53')]),{'include':_0x132c9e[_0xdd71('0x3a')][_0xdd71('0x4b')]?[{'all':!![]}]:undefined})[_0xdd71('0x2a')](function(_0x1ceaf5){var _0x2a79da=_0x132c9e['user']['get']({'plain':!![]});if(!_0x2a79da)throw new Error(_0xdd71('0x5e'));if(_0x2a79da['role']===_0xdd71('0x5f')){var _0x269714=_0x1ceaf5[_0xdd71('0x54')]({'plain':!![]});var _0x5f3092=[{'name':_0xdd71('0x56'),'value':_0xdd71('0x2b')},{'name':'QueueCampaigns','value':_0xdd71('0x2d')}];var _0x521300=_[_0xdd71('0x31')](_0x5f3092,[_0xdd71('0x2f'),_0x269714[_0xdd71('0x30')]])[_0xdd71('0x35')];return db[_0xdd71('0x60')]['find']({'where':{'name':_0x521300,'userProfileId':_0x2a79da[_0xdd71('0x57')]},'raw':!![]})[_0xdd71('0x2a')](function(_0x5dcab7){if(_0x5dcab7&&_0x5dcab7[_0xdd71('0x58')]===0x0){return db['UserProfileResource'][_0xdd71('0x52')]({'name':_0x269714[_0xdd71('0x35')],'resourceId':_0x269714['id'],'type':_0x5dcab7[_0xdd71('0x35')],'sectionId':_0x5dcab7['id']},{})[_0xdd71('0x2a')](function(){return _0x1ceaf5;});}else{return _0x1ceaf5;}})[_0xdd71('0x4f')](function(_0xaa24d1){logger[_0xdd71('0x33')](_0xdd71('0x5a'),_0xaa24d1);throw _0xaa24d1;});}return _0x1ceaf5;});}})[_0xdd71('0x2a')](respondWithResult(_0x42d4e1,0xc9))[_0xdd71('0x4f')](handleError(_0x42d4e1,null));};exports['update']=function(_0x5dbf06,_0x8a9bea){if(_0x5dbf06['body']['id']){delete _0x5dbf06[_0xdd71('0x53')]['id'];}return db['VoiceQueue'][_0xdd71('0x31')]({'where':{'id':_0x5dbf06[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x8a9bea,null))[_0xdd71('0x2a')](saveUpdates(_0x5dbf06[_0xdd71('0x53')],null))[_0xdd71('0x2a')](respondWithResult(_0x8a9bea,null))['catch'](handleError(_0x8a9bea,null));};exports[_0xdd71('0x32')]=function(_0x2af733,_0x87488c){return db[_0xdd71('0x4a')]['find']({'where':{'id':_0x2af733[_0xdd71('0x50')]['id']}})['then'](handleEntityNotFound(_0x87488c,null))[_0xdd71('0x2a')](removeEntity(_0x87488c,null))[_0xdd71('0x4f')](handleError(_0x87488c,null));};exports[_0xdd71('0x61')]=function(_0x533733,_0xc2f7c6,_0x5964bd){var _0x19dd59={'raw':![],'where':{}};var _0x379764={};var _0x5c154a={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xdd71('0x62')]({'where':{'id':_0x533733[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0xc2f7c6,null))[_0xdd71('0x2a')](function(_0x438a6c){if(_0x438a6c){_0x379764[_0xdd71('0x39')]=_[_0xdd71('0x51')](db[_0xdd71('0x63')]['rawAttributes']);_0x379764[_0xdd71('0x3a')]=_[_0xdd71('0x51')](_0x533733[_0xdd71('0x3a')]);_0x379764[_0xdd71('0x3b')]=_[_0xdd71('0x3c')](_0x379764['model'],_0x379764[_0xdd71('0x3a')]);_0x19dd59[_0xdd71('0x3d')]=_['intersection'](_0x379764[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x533733[_0xdd71('0x3a')]['fields']));_0x19dd59['attributes']=_0x19dd59[_0xdd71('0x3d')]['length']?_0x19dd59[_0xdd71('0x3d')]:_0x379764[_0xdd71('0x39')];if(!_0x533733[_0xdd71('0x3a')]['hasOwnProperty']('nolimit')){_0x19dd59[_0xdd71('0x41')]=qs[_0xdd71('0x41')](_0x533733[_0xdd71('0x3a')]['limit']);_0x19dd59[_0xdd71('0x23')]=qs[_0xdd71('0x23')](_0x533733[_0xdd71('0x3a')][_0xdd71('0x23')]);}_0x19dd59[_0xdd71('0x42')]=qs['sort'](_0x533733[_0xdd71('0x3a')][_0xdd71('0x43')]);_0x19dd59[_0xdd71('0x46')]=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x533733['query'],_0x379764[_0xdd71('0x3b')]));_0x19dd59[_0xdd71('0x46')]['VoiceQueueId']=_0x438a6c['id'];if(_0x533733[_0xdd71('0x3a')][_0xdd71('0x45')]){_0x19dd59[_0xdd71('0x46')]=_[_0xdd71('0x47')](_0x19dd59[_0xdd71('0x46')],{'$or':_[_0xdd71('0x2e')](_0x19dd59[_0xdd71('0x3d')],function(_0x3d8d4a){var _0x5bd19a={};_0x5bd19a[_0x3d8d4a]={'$like':'%'+_0x533733[_0xdd71('0x3a')][_0xdd71('0x45')]+'%'};return _0x5bd19a;})});}_0x19dd59=_[_0xdd71('0x47')]({},_0x19dd59,_0x533733['options']);return db[_0xdd71('0x63')]['count']({'where':_0x19dd59[_0xdd71('0x46')]})[_0xdd71('0x2a')](function(_0x85a647){_0x5c154a[_0xdd71('0x22')]=_0x85a647;if(_0x533733[_0xdd71('0x3a')][_0xdd71('0x4b')]){_0x19dd59['include']=[{'all':!![]}];}return db[_0xdd71('0x63')]['findAll'](_0x19dd59);})[_0xdd71('0x2a')](function(_0x384121){_0x5c154a[_0xdd71('0x4e')]=_0x384121;return _0x5c154a;});}})['then'](respondWithFilteredResult(_0xc2f7c6,_0x19dd59))[_0xdd71('0x4f')](handleError(_0xc2f7c6,null));};exports['getHopperHistories']=function(_0x1815e7,_0x1ab2a9,_0x343570){var _0x369366={'raw':!![],'where':{}};var _0x1e884f={};var _0x25e3b7={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xdd71('0x62')]({'where':{'id':_0x1815e7[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x1ab2a9,null))[_0xdd71('0x2a')](function(_0x4e17c9){if(_0x4e17c9){_0x1e884f[_0xdd71('0x39')]=_['keys'](db[_0xdd71('0x64')][_0xdd71('0x37')]);_0x1e884f[_0xdd71('0x3a')]=_[_0xdd71('0x51')](_0x1815e7['query']);_0x1e884f[_0xdd71('0x3b')]=_[_0xdd71('0x3c')](_0x1e884f[_0xdd71('0x39')],_0x1e884f[_0xdd71('0x3a')]);_0x369366['attributes']=_[_0xdd71('0x3c')](_0x1e884f[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x1815e7['query']['fields']));_0x369366[_0xdd71('0x3d')]=_0x369366[_0xdd71('0x3d')]['length']?_0x369366[_0xdd71('0x3d')]:_0x1e884f[_0xdd71('0x39')];if(!_0x1815e7[_0xdd71('0x3a')][_0xdd71('0x40')](_0xdd71('0x65'))){_0x369366[_0xdd71('0x41')]=qs['limit'](_0x1815e7[_0xdd71('0x3a')][_0xdd71('0x41')]);_0x369366['offset']=qs[_0xdd71('0x23')](_0x1815e7[_0xdd71('0x3a')][_0xdd71('0x23')]);}_0x369366[_0xdd71('0x42')]=qs[_0xdd71('0x43')](_0x1815e7[_0xdd71('0x3a')]['sort']);_0x369366[_0xdd71('0x46')]=qs[_0xdd71('0x3b')](_['pick'](_0x1815e7[_0xdd71('0x3a')],_0x1e884f[_0xdd71('0x3b')]));_0x369366[_0xdd71('0x46')][_0xdd71('0x66')]=_0x4e17c9['id'];if(_0x1815e7['query']['filter']){_0x369366[_0xdd71('0x46')]=_[_0xdd71('0x47')](_0x369366[_0xdd71('0x46')],{'$or':_[_0xdd71('0x2e')](_0x369366[_0xdd71('0x3d')],function(_0x530376){var _0x4f6ada={};_0x4f6ada[_0x530376]={'$like':'%'+_0x1815e7['query'][_0xdd71('0x45')]+'%'};return _0x4f6ada;})});}_0x369366=_[_0xdd71('0x47')]({},_0x369366,_0x1815e7[_0xdd71('0x49')]);return db[_0xdd71('0x64')]['count']({'where':_0x369366[_0xdd71('0x46')]})[_0xdd71('0x2a')](function(_0x1475ed){_0x25e3b7[_0xdd71('0x22')]=_0x1475ed;if(_0x1815e7[_0xdd71('0x3a')]['includeAll']){_0x369366[_0xdd71('0x4c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xdd71('0x4d')](_0x369366);})[_0xdd71('0x2a')](function(_0x12fde7){_0x25e3b7['rows']=_0x12fde7;return _0x25e3b7;});}})[_0xdd71('0x2a')](respondWithFilteredResult(_0x1ab2a9,_0x369366))[_0xdd71('0x4f')](handleError(_0x1ab2a9,null));};exports[_0xdd71('0x67')]=function(_0x4d95c7,_0xe00f53,_0x46265f){var _0x23f0a8={'raw':!![],'where':{}};var _0x2a5ef4={};var _0x3b6a2c={'count':0x0,'rows':[]};return db[_0xdd71('0x4a')]['findOne']({'where':{'id':_0x4d95c7[_0xdd71('0x50')]['id']}})['then'](handleEntityNotFound(_0xe00f53,null))[_0xdd71('0x2a')](function(_0x38519f){if(_0x38519f){_0x2a5ef4['model']=_['keys'](db['CmHopperFinal'][_0xdd71('0x37')]);_0x2a5ef4[_0xdd71('0x3a')]=_[_0xdd71('0x51')](_0x4d95c7[_0xdd71('0x3a')]);_0x2a5ef4[_0xdd71('0x3b')]=_[_0xdd71('0x3c')](_0x2a5ef4[_0xdd71('0x39')],_0x2a5ef4[_0xdd71('0x3a')]);_0x23f0a8[_0xdd71('0x3d')]=_[_0xdd71('0x3c')](_0x2a5ef4[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x4d95c7[_0xdd71('0x3a')]['fields']));_0x23f0a8[_0xdd71('0x3d')]=_0x23f0a8[_0xdd71('0x3d')][_0xdd71('0x3f')]?_0x23f0a8[_0xdd71('0x3d')]:_0x2a5ef4[_0xdd71('0x39')];if(!_0x4d95c7[_0xdd71('0x3a')][_0xdd71('0x40')](_0xdd71('0x65'))){_0x23f0a8[_0xdd71('0x41')]=qs[_0xdd71('0x41')](_0x4d95c7[_0xdd71('0x3a')]['limit']);_0x23f0a8[_0xdd71('0x23')]=qs[_0xdd71('0x23')](_0x4d95c7['query'][_0xdd71('0x23')]);}_0x23f0a8[_0xdd71('0x42')]=qs[_0xdd71('0x43')](_0x4d95c7[_0xdd71('0x3a')][_0xdd71('0x43')]);_0x23f0a8['where']=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x4d95c7['query'],_0x2a5ef4['filters']));_0x23f0a8['where']['VoiceQueueId']=_0x38519f['id'];if(_0x4d95c7['query'][_0xdd71('0x45')]){_0x23f0a8[_0xdd71('0x46')]=_[_0xdd71('0x47')](_0x23f0a8[_0xdd71('0x46')],{'$or':_['map'](_0x23f0a8[_0xdd71('0x3d')],function(_0x1a4c98){var _0x3ecd00={};_0x3ecd00[_0x1a4c98]={'$like':'%'+_0x4d95c7[_0xdd71('0x3a')][_0xdd71('0x45')]+'%'};return _0x3ecd00;})});}_0x23f0a8=_['merge']({},_0x23f0a8,_0x4d95c7['options']);return db[_0xdd71('0x68')][_0xdd71('0x22')]({'where':_0x23f0a8[_0xdd71('0x46')]})[_0xdd71('0x2a')](function(_0x41a259){_0x3b6a2c[_0xdd71('0x22')]=_0x41a259;if(_0x4d95c7['query'][_0xdd71('0x4b')]){_0x23f0a8['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xdd71('0x4d')](_0x23f0a8);})[_0xdd71('0x2a')](function(_0x20d162){_0x3b6a2c['rows']=_0x20d162;return _0x3b6a2c;});}})['then'](respondWithFilteredResult(_0xe00f53,_0x23f0a8))['catch'](handleError(_0xe00f53,null));};exports[_0xdd71('0x69')]=function(_0xee6f16,_0x65e56,_0x21830d){var _0x118a17={'raw':!![],'where':{}};var _0x8b063d={};var _0x4d0c5c={'count':0x0,'rows':[]};return db[_0xdd71('0x4a')][_0xdd71('0x62')]({'where':{'id':_0xee6f16[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x65e56,null))[_0xdd71('0x2a')](function(_0x108a62){if(_0x108a62){_0x8b063d[_0xdd71('0x39')]=_['keys'](db[_0xdd71('0x6a')][_0xdd71('0x37')]);_0x8b063d['query']=_['keys'](_0xee6f16[_0xdd71('0x3a')]);_0x8b063d['filters']=_['intersection'](_0x8b063d[_0xdd71('0x39')],_0x8b063d[_0xdd71('0x3a')]);_0x118a17[_0xdd71('0x3d')]=_[_0xdd71('0x3c')](_0x8b063d['model'],qs[_0xdd71('0x3e')](_0xee6f16[_0xdd71('0x3a')][_0xdd71('0x3e')]));_0x118a17['attributes']=_0x118a17[_0xdd71('0x3d')][_0xdd71('0x3f')]?_0x118a17[_0xdd71('0x3d')]:_0x8b063d[_0xdd71('0x39')];if(!_0xee6f16['query']['hasOwnProperty'](_0xdd71('0x65'))){_0x118a17[_0xdd71('0x41')]=qs[_0xdd71('0x41')](_0xee6f16[_0xdd71('0x3a')][_0xdd71('0x41')]);_0x118a17['offset']=qs[_0xdd71('0x23')](_0xee6f16[_0xdd71('0x3a')]['offset']);}_0x118a17[_0xdd71('0x42')]=qs[_0xdd71('0x43')](_0xee6f16['query'][_0xdd71('0x43')]);_0x118a17[_0xdd71('0x46')]=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0xee6f16[_0xdd71('0x3a')],_0x8b063d['filters']));_0x118a17[_0xdd71('0x46')][_0xdd71('0x66')]=_0x108a62['id'];if(_0xee6f16['query']['filter']){_0x118a17['where']=_[_0xdd71('0x47')](_0x118a17['where'],{'$or':_[_0xdd71('0x2e')](_0x118a17['attributes'],function(_0x13941c){var _0x57021f={};_0x57021f[_0x13941c]={'$like':'%'+_0xee6f16['query']['filter']+'%'};return _0x57021f;})});}_0x118a17=_[_0xdd71('0x47')]({},_0x118a17,_0xee6f16[_0xdd71('0x49')]);return db[_0xdd71('0x6a')][_0xdd71('0x22')]({'where':_0x118a17[_0xdd71('0x46')]})[_0xdd71('0x2a')](function(_0x2e79eb){_0x4d0c5c[_0xdd71('0x22')]=_0x2e79eb;if(_0xee6f16['query'][_0xdd71('0x4b')]){_0x118a17[_0xdd71('0x4c')]=[{'all':!![]}];}return db[_0xdd71('0x6a')][_0xdd71('0x4d')](_0x118a17);})[_0xdd71('0x2a')](function(_0xbbf59f){_0x4d0c5c[_0xdd71('0x4e')]=_0xbbf59f;return _0x4d0c5c;});}})[_0xdd71('0x2a')](respondWithFilteredResult(_0x65e56,_0x118a17))[_0xdd71('0x4f')](handleError(_0x65e56,null));};exports['getTeams']=function(_0x320dd4,_0x4245f4,_0x403362){var _0x14f91d={};var _0x100992={};var _0x236194;var _0xc5e5b4;return db['VoiceQueue'][_0xdd71('0x62')]({'where':{'id':_0x320dd4[_0xdd71('0x50')]['id']}})['then'](handleEntityNotFound(_0x4245f4,null))[_0xdd71('0x2a')](function(_0x509966){if(_0x509966){_0x236194=_0x509966;_0x100992['model']=_[_0xdd71('0x51')](db[_0xdd71('0x6b')][_0xdd71('0x37')]);_0x100992[_0xdd71('0x3a')]=_[_0xdd71('0x51')](_0x320dd4[_0xdd71('0x3a')]);_0x100992[_0xdd71('0x3b')]=_['intersection'](_0x100992[_0xdd71('0x39')],_0x100992[_0xdd71('0x3a')]);_0x14f91d[_0xdd71('0x3d')]=_[_0xdd71('0x3c')](_0x100992[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x320dd4[_0xdd71('0x3a')][_0xdd71('0x3e')]));_0x14f91d[_0xdd71('0x3d')]=_0x14f91d[_0xdd71('0x3d')][_0xdd71('0x3f')]?_0x14f91d[_0xdd71('0x3d')]:_0x100992[_0xdd71('0x39')];_0x14f91d[_0xdd71('0x42')]=qs[_0xdd71('0x43')](_0x320dd4[_0xdd71('0x3a')][_0xdd71('0x43')]);_0x14f91d['where']=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x320dd4['query'],_0x100992[_0xdd71('0x3b')]));if(_0x320dd4[_0xdd71('0x3a')][_0xdd71('0x45')]){_0x14f91d[_0xdd71('0x46')]=_[_0xdd71('0x47')](_0x14f91d[_0xdd71('0x46')],{'$or':_[_0xdd71('0x2e')](_0x14f91d[_0xdd71('0x3d')],function(_0xd1d5e){var _0x6bae3c={};_0x6bae3c[_0xd1d5e]={'$like':'%'+_0x320dd4[_0xdd71('0x3a')]['filter']+'%'};return _0x6bae3c;})});}_0x14f91d=_[_0xdd71('0x47')]({},_0x14f91d,_0x320dd4[_0xdd71('0x49')]);return _0x236194[_0xdd71('0x6c')](_0x14f91d);}})[_0xdd71('0x2a')](function(_0xcc6929){if(_0xcc6929){_0xc5e5b4=_0xcc6929[_0xdd71('0x3f')];if(!_0x320dd4[_0xdd71('0x3a')][_0xdd71('0x40')]('nolimit')){_0x14f91d[_0xdd71('0x41')]=qs[_0xdd71('0x41')](_0x320dd4[_0xdd71('0x3a')]['limit']);_0x14f91d[_0xdd71('0x23')]=qs['offset'](_0x320dd4[_0xdd71('0x3a')][_0xdd71('0x23')]);}return _0x236194['getTeams'](_0x14f91d);}})['then'](function(_0x2047ed){if(_0x2047ed){return _0x2047ed?{'count':_0xc5e5b4,'rows':_0x2047ed}:null;}})[_0xdd71('0x2a')](respondWithResult(_0x4245f4,null))[_0xdd71('0x4f')](handleError(_0x4245f4,null));};exports['addTeams']=function(_0x239ae7,_0x70e9df,_0x40d65d){var _0x288ea9=_0x239ae7[_0xdd71('0x53')][_0xdd71('0x6d')];var _0x28b3e6=_['map'](_0x288ea9,'id');return db[_0xdd71('0x6b')][_0xdd71('0x4d')]({'where':{'id':_0x28b3e6},'attributes':['id'],'include':[{'model':db[_0xdd71('0x6e')],'as':_0xdd71('0x6f'),'attributes':['id',_0xdd71('0x35'),_0xdd71('0x70'),'voicePause',_0xdd71('0x71')],'raw':!![]}]})[_0xdd71('0x2a')](function(_0x404f06){if(_0x404f06){var _0xc30b0d=_['flatMap'](_0x404f06,function(_0x12451a){var _0x36b604=_0x12451a[_0xdd71('0x54')]({'plain':!![]});_0x36b604[_0xdd71('0x6f')][_0xdd71('0x72')](function(_0x5c45d9){_0x5c45d9['penalty']=_[_0xdd71('0x31')](_0x288ea9,{'id':_0x36b604['id']})[_0xdd71('0x73')];});return _0x36b604[_0xdd71('0x6f')];});return db[_0xdd71('0x4a')][_0xdd71('0x31')]({'where':{'id':_0x239ae7['params']['id']}})[_0xdd71('0x2a')](function(_0x47c8e6){return db[_0xdd71('0x74')]['transaction'](function(_0x15e2c4){return _0x47c8e6[_0xdd71('0x75')](_0x28b3e6,{'transaction':_0x15e2c4})[_0xdd71('0x2a')](function(){return BPromise[_0xdd71('0x76')](_0xc30b0d,function(_0xf88dce){return db[_0xdd71('0x77')][_0xdd71('0x78')]({'where':{'UserId':_0xf88dce['id'],'VoiceQueueId':_0x239ae7['params']['id']},'defaults':{'penalty':_0xf88dce['penalty']},'transaction':_0x15e2c4});});})[_0xdd71('0x2a')](function(){return BPromise[_0xdd71('0x76')](_['filter'](_0xc30b0d,{'online':!![]}),function(_0x494935){return db[_0xdd71('0x79')]['upsert']({'membername':_0x494935[_0xdd71('0x35')],'UserId':_0x494935['id'],'queue_name':_0x47c8e6[_0xdd71('0x35')],'VoiceQueueId':_0x47c8e6['id'],'interface':_['isNil'](_0x494935[_0xdd71('0x71')])?util[_0xdd71('0x7a')](_0xdd71('0x7b'),_0x494935[_0xdd71('0x35')]):_0x494935[_0xdd71('0x71')],'paused':_0x494935[_0xdd71('0x7c')]||![],'penalty':_0x494935[_0xdd71('0x73')]},{'transaction':_0x15e2c4});});})[_0xdd71('0x2a')](function(){_0xc30b0d[_0xdd71('0x72')](function(_0x246642){socket[_0xdd71('0x7d')](_0xdd71('0x7e'),{'UserId':_0x246642['id'],'VoiceQueueId':_0x47c8e6['id']});});});});});}})[_0xdd71('0x2a')](respondWithStatusCode(_0x70e9df,null))[_0xdd71('0x4f')](handleError(_0x70e9df,null));};exports['removeTeams']=function(_0x568284,_0x3ce721,_0x94c2fe){return db[_0xdd71('0x6b')][_0xdd71('0x4d')]({'where':{'id':_0x568284[_0xdd71('0x3a')][_0xdd71('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3ce721,null))[_0xdd71('0x2a')](function(_0x4f184c){var _0xd6f9bf=_[_0xdd71('0x2e')](_0x4f184c,'id');var _0x45fcd4=[];var _0x42f1a1=[];var _0x591267=squel[_0xdd71('0x80')]();_0x591267[_0xdd71('0x81')]('tq.TeamId')[_0xdd71('0x82')](_0xdd71('0x83'),'tq')[_0xdd71('0x84')](_0xdd71('0x85'),'ut',_0xdd71('0x86'))[_0xdd71('0x46')](_0xdd71('0x87'),_0x568284[_0xdd71('0x50')]['id']);for(var _0x20b201=0x0;_0x20b201<_0x4f184c[_0xdd71('0x3f')];_0x20b201+=0x1){let _0x1fd676=_0x4f184c[_0x20b201];for(var _0x109749=0x0;_0x109749<_0x1fd676[_0xdd71('0x6f')][_0xdd71('0x3f')];_0x109749+=0x1){let _0x25fd27=_0x1fd676['Agents'][_0x109749];var _0x2f84b8=_0x591267[_0xdd71('0x88')]();_0x2f84b8[_0xdd71('0x46')](_0xdd71('0x89'),_0x25fd27['id']);_0x42f1a1[_0xdd71('0x8a')](db['sequelize'][_0xdd71('0x3a')](_0x2f84b8['toString'](),{'type':db[_0xdd71('0x74')]['QueryTypes']['SELECT']})[_0xdd71('0x2a')](function(_0x1a2c76){if(_0x1a2c76[_0xdd71('0x3f')]===0x1){return _0x25fd27['id'];}else{var _0x5efd2e=_[_0xdd71('0x8b')](_[_0xdd71('0x2e')](_0x1a2c76,'TeamId'),function(_0xb07694){return _[_0xdd71('0x8c')](_0xd6f9bf,_0xb07694);});if(_0x5efd2e){return _0x25fd27['id'];}}}));}}return BPromise[_0xdd71('0x8d')](_0x42f1a1)[_0xdd71('0x2a')](function(_0x17e62d){_0x45fcd4=_(_0x45fcd4)[_0xdd71('0x8e')](_0x17e62d)[_0xdd71('0x8f')]()[_0xdd71('0x2f')]();return db[_0xdd71('0x4a')][_0xdd71('0x31')]({'where':{'id':_0x568284['params']['id']}})['then'](function(_0x533a4f){return db[_0xdd71('0x74')][_0xdd71('0x90')](function(_0x2d7ba1){return _0x533a4f[_0xdd71('0x91')](_0x568284[_0xdd71('0x3a')][_0xdd71('0x7f')],{'transaction':_0x2d7ba1})[_0xdd71('0x2a')](function(){if(!_[_0xdd71('0x92')](_0x45fcd4)){return _0x533a4f[_0xdd71('0x93')](_0x45fcd4,{'transaction':_0x2d7ba1})[_0xdd71('0x2a')](function(){return db[_0xdd71('0x79')][_0xdd71('0x32')]({'where':{'VoiceQueueId':_0x568284[_0xdd71('0x50')]['id'],'UserId':_0x45fcd4},'transaction':_0x2d7ba1});});}})['then'](function(){_0x45fcd4[_0xdd71('0x72')](function(_0x2c9dd1){socket[_0xdd71('0x7d')]('userVoiceQueue:remove',{'UserId':_0x2c9dd1,'VoiceQueueId':_0x533a4f['id']});});});});});});})['then'](respondWithStatusCode(_0x3ce721,null))[_0xdd71('0x4f')](handleError(_0x3ce721,null));};exports['addAgents']=function(_0x40c8e3,_0x5df2da,_0x34f95e){var _0x459111,_0x581e6d;return db[_0xdd71('0x4a')]['find']({'where':{'id':_0x40c8e3[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x5df2da,null))[_0xdd71('0x2a')](function(_0x2ee6e7){if(_0x2ee6e7){_0x581e6d=_0x2ee6e7;return _0x2ee6e7[_0xdd71('0x94')](_0x40c8e3[_0xdd71('0x53')][_0xdd71('0x7f')],_['omit'](_0x40c8e3['body'],[_0xdd71('0x7f'),'id'])||{})[_0xdd71('0x95')](function(_0x78cb7f){for(var _0x294812=0x0;_0x294812<_0x40c8e3[_0xdd71('0x53')]['ids'][_0xdd71('0x3f')];_0x294812+=0x1){socket[_0xdd71('0x7d')](_0xdd71('0x7e'),{'UserId':_0x40c8e3[_0xdd71('0x53')][_0xdd71('0x7f')][_0x294812],'VoiceQueueId':_0x40c8e3[_0xdd71('0x50')]['id']});}return _0x78cb7f;});}})[_0xdd71('0x2a')](function(_0x2ef193){_0x459111=_0x2ef193||[];if(_0x581e6d){return db[_0xdd71('0x6e')]['findAll']({'where':{'id':_0x40c8e3[_0xdd71('0x53')][_0xdd71('0x7f')]},'attributes':['id','name',_0xdd71('0x70'),_0xdd71('0x7c'),'interface'],'raw':!![]});}})[_0xdd71('0x2a')](function(_0xbc747c){if(!_['isEmpty'](_0xbc747c)){var _0x252558=[];for(var _0x3bf2eb=0x0;_0x3bf2eb<_0xbc747c[_0xdd71('0x3f')];_0x3bf2eb++){if(_0xbc747c[_0x3bf2eb][_0xdd71('0x70')]){_0x252558[_0xdd71('0x8a')](db[_0xdd71('0x79')]['upsert']({'membername':_0xbc747c[_0x3bf2eb][_0xdd71('0x35')],'UserId':_0xbc747c[_0x3bf2eb]['id'],'queue_name':_0x581e6d['name'],'VoiceQueueId':_0x581e6d['id'],'interface':_[_0xdd71('0x96')](_0xbc747c[_0x3bf2eb]['interface'])?util[_0xdd71('0x7a')](_0xdd71('0x7b'),_0xbc747c[_0x3bf2eb]['name']):_0xbc747c[_0x3bf2eb]['interface'],'paused':_0xbc747c[_0x3bf2eb][_0xdd71('0x7c')]||![],'penalty':_0x40c8e3['body'][_0xdd71('0x73')]||0x0}));}}return BPromise['all'](_0x252558);}})['then'](function(){return _0x459111;})[_0xdd71('0x2a')](respondWithResult(_0x5df2da,null))[_0xdd71('0x4f')](handleError(_0x5df2da,null));};exports['removeAgents']=function(_0xe0526,_0x12c5c8,_0x3d12e3){return db[_0xdd71('0x4a')][_0xdd71('0x31')]({'where':{'id':_0xe0526[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x12c5c8,null))[_0xdd71('0x2a')](function(_0x12c8b7){if(_0x12c8b7){return _0x12c8b7[_0xdd71('0x93')](_0xe0526[_0xdd71('0x3a')]['ids'])[_0xdd71('0x2a')](function(){if(_[_0xdd71('0x97')](_0xe0526[_0xdd71('0x3a')][_0xdd71('0x7f')])){for(var _0x22b82f=0x0;_0x22b82f<_0xe0526[_0xdd71('0x3a')][_0xdd71('0x7f')][_0xdd71('0x3f')];_0x22b82f+=0x1){socket[_0xdd71('0x7d')](_0xdd71('0x98'),{'UserId':Number(_0xe0526[_0xdd71('0x3a')][_0xdd71('0x7f')][_0x22b82f]),'VoiceQueueId':Number(_0xe0526[_0xdd71('0x50')]['id'])});}}else{socket[_0xdd71('0x7d')](_0xdd71('0x98'),{'UserId':Number(_0xe0526[_0xdd71('0x3a')][_0xdd71('0x7f')]),'VoiceQueueId':Number(_0xe0526[_0xdd71('0x50')]['id'])});}});}})['then'](function(_0x3e9978){return db['UserVoiceQueueRt'][_0xdd71('0x32')]({'where':{'VoiceQueueId':_0xe0526[_0xdd71('0x50')]['id'],'UserId':_0xe0526[_0xdd71('0x3a')]['ids']}})[_0xdd71('0x2a')](function(){return _0x3e9978;});})['then'](respondWithStatusCode(_0x12c5c8,null))['catch'](handleError(_0x12c5c8,null));};exports[_0xdd71('0x99')]=function(_0x358bd1,_0x413542,_0x3fed4c){var _0x3ec890={};var _0x415ac7={};var _0x41d55f;var _0x42a354;return db[_0xdd71('0x4a')][_0xdd71('0x62')]({'where':{'id':_0x358bd1['params']['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x413542,null))[_0xdd71('0x2a')](function(_0x4027f8){if(_0x4027f8){_0x41d55f=_0x4027f8;_0x415ac7[_0xdd71('0x39')]=_['keys'](db[_0xdd71('0x6e')][_0xdd71('0x37')]);_0x415ac7['query']=_[_0xdd71('0x51')](_0x358bd1[_0xdd71('0x3a')]);_0x415ac7[_0xdd71('0x3b')]=_['intersection'](_0x415ac7['model'],_0x415ac7[_0xdd71('0x3a')]);_0x3ec890['attributes']=_[_0xdd71('0x3c')](_0x415ac7[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x358bd1[_0xdd71('0x3a')][_0xdd71('0x3e')]));_0x3ec890[_0xdd71('0x3d')]=_0x3ec890['attributes'][_0xdd71('0x3f')]?_0x3ec890[_0xdd71('0x3d')]:_0x415ac7[_0xdd71('0x39')];_0x3ec890['order']=qs[_0xdd71('0x43')](_0x358bd1[_0xdd71('0x3a')][_0xdd71('0x43')]);_0x3ec890[_0xdd71('0x46')]=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x358bd1['query'],_0x415ac7['filters']));if(_0x358bd1[_0xdd71('0x3a')]['filter']){_0x3ec890['where']=_['merge'](_0x3ec890[_0xdd71('0x46')],{'$or':_[_0xdd71('0x2e')](_0x3ec890[_0xdd71('0x3d')],function(_0x17b178){var _0x4f53be={};_0x4f53be[_0x17b178]={'$like':'%'+_0x358bd1[_0xdd71('0x3a')][_0xdd71('0x45')]+'%'};return _0x4f53be;})});}_0x3ec890=_[_0xdd71('0x47')]({},_0x3ec890,_0x358bd1[_0xdd71('0x49')]);return _0x41d55f[_0xdd71('0x99')](_0x3ec890);}})['then'](function(_0x57d5c6){if(_0x57d5c6){_0x42a354=_0x57d5c6[_0xdd71('0x3f')];if(!_0x358bd1['query'][_0xdd71('0x40')](_0xdd71('0x65'))){_0x3ec890[_0xdd71('0x41')]=qs['limit'](_0x358bd1[_0xdd71('0x3a')]['limit']);_0x3ec890[_0xdd71('0x23')]=qs[_0xdd71('0x23')](_0x358bd1[_0xdd71('0x3a')][_0xdd71('0x23')]);}return _0x41d55f[_0xdd71('0x99')](_0x3ec890);}})[_0xdd71('0x2a')](function(_0x2f28ec){if(_0x2f28ec){return _0x2f28ec?{'count':_0x42a354,'rows':_0x2f28ec}:null;}})[_0xdd71('0x2a')](respondWithResult(_0x413542,null))[_0xdd71('0x4f')](handleError(_0x413542,null));};exports[_0xdd71('0x9a')]=function(_0x46dc99,_0x2a734f,_0x4c5c9c){var _0x2302b9={};var _0xd53810={};var _0x28ca21;var _0x3ed672;return db[_0xdd71('0x4a')][_0xdd71('0x62')]({'where':{'id':_0x46dc99[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x2a734f,null))[_0xdd71('0x2a')](function(_0x4d14ac){if(_0x4d14ac){_0x28ca21=_0x4d14ac;_0xd53810[_0xdd71('0x39')]=_[_0xdd71('0x51')](db['UserVoiceQueueRt'][_0xdd71('0x37')]);_0xd53810[_0xdd71('0x3a')]=_[_0xdd71('0x51')](_0x46dc99[_0xdd71('0x3a')]);_0xd53810['filters']=_['intersection'](_0xd53810[_0xdd71('0x39')],_0xd53810[_0xdd71('0x3a')]);_0x2302b9[_0xdd71('0x3d')]=_[_0xdd71('0x3c')](_0xd53810[_0xdd71('0x39')],qs['fields'](_0x46dc99[_0xdd71('0x3a')][_0xdd71('0x3e')]));_0x2302b9[_0xdd71('0x3d')]=_0x2302b9['attributes'][_0xdd71('0x3f')]?_0x2302b9[_0xdd71('0x3d')]:_0xd53810[_0xdd71('0x39')];_0x2302b9['order']=qs[_0xdd71('0x43')](_0x46dc99[_0xdd71('0x3a')]['sort']);_0x2302b9[_0xdd71('0x46')]=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x46dc99[_0xdd71('0x3a')],_0xd53810['filters']));if(_0x46dc99[_0xdd71('0x3a')][_0xdd71('0x45')]){_0x2302b9['where']=_[_0xdd71('0x47')](_0x2302b9['where'],{'$or':_[_0xdd71('0x2e')](_0x2302b9[_0xdd71('0x3d')],function(_0x5d0291){var _0x1a928a={};_0x1a928a[_0x5d0291]={'$like':'%'+_0x46dc99[_0xdd71('0x3a')]['filter']+'%'};return _0x1a928a;})});}_0x2302b9=_[_0xdd71('0x47')]({},_0x2302b9,_0x46dc99[_0xdd71('0x49')]);return _0x28ca21[_0xdd71('0x9a')](_0x2302b9);}})[_0xdd71('0x2a')](function(_0x23f2f5){if(_0x23f2f5){_0x3ed672=_0x23f2f5[_0xdd71('0x3f')];if(!_0x46dc99[_0xdd71('0x3a')]['hasOwnProperty']('nolimit')){_0x2302b9[_0xdd71('0x41')]=qs['limit'](_0x46dc99[_0xdd71('0x3a')][_0xdd71('0x41')]);_0x2302b9[_0xdd71('0x23')]=qs[_0xdd71('0x23')](_0x46dc99[_0xdd71('0x3a')][_0xdd71('0x23')]);}return _0x28ca21[_0xdd71('0x9a')](_0x2302b9);}})[_0xdd71('0x2a')](function(_0x29ed2d){return _0x29ed2d?{'count':_0x3ed672,'rows':_0x29ed2d}:null;})[_0xdd71('0x2a')](respondWithResult(_0x2a734f,null))['catch'](handleError(_0x2a734f,null));};exports['getLists']=function(_0x26b0ae,_0x59f43a,_0x35b3dd){var _0x29df68={};var _0x2c0c8a={};var _0x51ab13;var _0x2a2e55;return db[_0xdd71('0x4a')]['findOne']({'where':{'id':_0x26b0ae[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x59f43a,null))[_0xdd71('0x2a')](function(_0x4ae7ea){if(_0x4ae7ea){_0x51ab13=_0x4ae7ea;_0x2c0c8a[_0xdd71('0x39')]=_['keys'](db[_0xdd71('0x9b')][_0xdd71('0x37')]);_0x2c0c8a[_0xdd71('0x3a')]=_['keys'](_0x26b0ae[_0xdd71('0x3a')]);_0x2c0c8a[_0xdd71('0x3b')]=_[_0xdd71('0x3c')](_0x2c0c8a[_0xdd71('0x39')],_0x2c0c8a[_0xdd71('0x3a')]);_0x29df68[_0xdd71('0x3d')]=_[_0xdd71('0x3c')](_0x2c0c8a['model'],qs[_0xdd71('0x3e')](_0x26b0ae[_0xdd71('0x3a')]['fields']));_0x29df68[_0xdd71('0x3d')]=_0x29df68[_0xdd71('0x3d')][_0xdd71('0x3f')]?_0x29df68[_0xdd71('0x3d')]:_0x2c0c8a[_0xdd71('0x39')];_0x29df68[_0xdd71('0x42')]=qs[_0xdd71('0x43')](_0x26b0ae[_0xdd71('0x3a')][_0xdd71('0x43')]);_0x29df68['where']=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x26b0ae[_0xdd71('0x3a')],_0x2c0c8a[_0xdd71('0x3b')]));if(_0x26b0ae[_0xdd71('0x3a')]['filter']){_0x29df68['where']=_[_0xdd71('0x47')](_0x29df68[_0xdd71('0x46')],{'$or':_[_0xdd71('0x2e')](_0x29df68[_0xdd71('0x3d')],function(_0x2fb351){var _0x27e8a8={};_0x27e8a8[_0x2fb351]={'$like':'%'+_0x26b0ae[_0xdd71('0x3a')][_0xdd71('0x45')]+'%'};return _0x27e8a8;})});}_0x29df68=_[_0xdd71('0x47')]({},_0x29df68,_0x26b0ae['options']);return _0x51ab13[_0xdd71('0x9c')](_0x29df68);}})[_0xdd71('0x2a')](function(_0x90ed51){if(_0x90ed51){_0x2a2e55=_0x90ed51[_0xdd71('0x3f')];if(!_0x26b0ae[_0xdd71('0x3a')]['hasOwnProperty'](_0xdd71('0x65'))){_0x29df68[_0xdd71('0x41')]=qs[_0xdd71('0x41')](_0x26b0ae['query'][_0xdd71('0x41')]);_0x29df68[_0xdd71('0x23')]=qs['offset'](_0x26b0ae[_0xdd71('0x3a')]['offset']);}return _0x51ab13[_0xdd71('0x9c')](_0x29df68);}})[_0xdd71('0x2a')](function(_0x271c54){if(_0x271c54){return _0x271c54?{'count':_0x2a2e55,'rows':_0x271c54}:null;}})['then'](respondWithResult(_0x59f43a,null))[_0xdd71('0x4f')](handleError(_0x59f43a,null));};exports['addLists']=function(_0x180e66,_0x5d422e,_0x57777c){var _0x424b7b,_0x1153da;return db['VoiceQueue'][_0xdd71('0x31')]({'where':{'id':_0x180e66[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x5d422e,null))[_0xdd71('0x2a')](function(_0x3701b8){if(_0x3701b8){_0x1153da=_0x3701b8;return _0x3701b8[_0xdd71('0x9d')](_0x180e66[_0xdd71('0x53')][_0xdd71('0x7f')],_[_0xdd71('0x5b')](_0x180e66[_0xdd71('0x53')],['ids','id'])||{});}return null;})[_0xdd71('0x95')](function(_0x5de809){var _0x5b1a86;_0x424b7b=_0x5de809||[];var _0x3a018d=[];if(_0x5de809){for(var _0x42c14b=0x0;_0x42c14b<_0x5de809[_0xdd71('0x3f')];_0x42c14b+=0x1){var _0x22761e=_0x5de809[_0x42c14b][_0xdd71('0x54')]({'plain':!![]});_0x1153da[_0xdd71('0x9e')]=_0x180e66['body'][_0xdd71('0x9e')]?_0x180e66[_0xdd71('0x53')]['dialCheckDuplicateType']:_0x1153da[_0xdd71('0x9e')];switch(_0x1153da[_0xdd71('0x9e')]){case _0xdd71('0x9f'):_0x5b1a86=squel['insert']()[_0xdd71('0xa0')](_0xdd71('0xa1'))['fromQuery']([_0xdd71('0xa2'),_0xdd71('0xa3'),_0xdd71('0xa4'),_0xdd71('0xa5'),_0xdd71('0x66'),_0xdd71('0x5d'),_0xdd71('0x5c')],squel['select']()['field'](_0xdd71('0xa2'),_0xdd71('0xa2'))['field'](_0xdd71('0xa6'),_0xdd71('0xa3'))[_0xdd71('0x81')]('id','ContactId')[_0xdd71('0x81')](_0x22761e[_0xdd71('0xa7')]['toString'](),_0xdd71('0xa5'))['field'](_0x180e66[_0xdd71('0x50')]['id']['toString'](),'VoiceQueueId')[_0xdd71('0x81')](_0xdd71('0xa6'),_0xdd71('0x5d'))[_0xdd71('0x81')](_0xdd71('0xa6'),_0xdd71('0x5c'))[_0xdd71('0x82')](_0xdd71('0xa8'))[_0xdd71('0x46')](_0xdd71('0xa9'))['where']('ListId\x20=\x20?',_0x22761e['CmListId']['toString']())[_0xdd71('0x46')](_0xdd71('0xaa'))[_0xdd71('0x46')](_0xdd71('0xab'),squel[_0xdd71('0x80')]()[_0xdd71('0x81')]('COALESCE(calleridnum,\x27\x27)')[_0xdd71('0x82')](_0xdd71('0xac'))[_0xdd71('0x46')](_0xdd71('0x87'),_0x180e66[_0xdd71('0x50')]['id'][_0xdd71('0xad')]()))[_0xdd71('0x46')](_0xdd71('0xab'),squel[_0xdd71('0x80')]()[_0xdd71('0x81')]('COALESCE(phone,\x27\x27)')[_0xdd71('0x82')]('cm_hopper')['where'](_0xdd71('0x87'),_0x180e66[_0xdd71('0x50')]['id']['toString']())))[_0xdd71('0xad')]();break;case _0xdd71('0xae'):_0x5b1a86=squel[_0xdd71('0xaf')]()['into'](_0xdd71('0xa1'))[_0xdd71('0xb0')]([_0xdd71('0xa2'),_0xdd71('0xa3'),_0xdd71('0xa4'),_0xdd71('0xa5'),_0xdd71('0x66'),_0xdd71('0x5d'),_0xdd71('0x5c')],squel[_0xdd71('0x80')]()[_0xdd71('0x81')](_0xdd71('0xa2'),_0xdd71('0xa2'))[_0xdd71('0x81')](_0xdd71('0xa6'),'scheduledAt')[_0xdd71('0x81')]('id','ContactId')['field'](_0x22761e['CmListId'][_0xdd71('0xad')](),_0xdd71('0xa5'))['field'](_0x180e66[_0xdd71('0x50')]['id'][_0xdd71('0xad')](),_0xdd71('0x66'))[_0xdd71('0x81')](_0xdd71('0xa6'),_0xdd71('0x5d'))[_0xdd71('0x81')](_0xdd71('0xa6'),_0xdd71('0x5c'))[_0xdd71('0x82')]('cm_contacts')[_0xdd71('0x46')](_0xdd71('0xa9'))[_0xdd71('0x46')](_0xdd71('0xb1'),_0x22761e[_0xdd71('0xa7')][_0xdd71('0xad')]())[_0xdd71('0x46')]('phone\x20IS\x20NOT\x20NULL')[_0xdd71('0x46')](_0xdd71('0xab'),squel[_0xdd71('0x80')]()[_0xdd71('0x81')]('COALESCE(phone,\x27\x27)')[_0xdd71('0x82')]('cm_hopper')['where'](_0xdd71('0x87'),_0x180e66['params']['id'][_0xdd71('0xad')]())))['toString']();break;default:_0x5b1a86=squel['insert']()[_0xdd71('0xa0')](_0xdd71('0xa1'))[_0xdd71('0xb0')](['phone',_0xdd71('0xa3'),_0xdd71('0xa4'),_0xdd71('0xa5'),'VoiceQueueId',_0xdd71('0x5d'),_0xdd71('0x5c')],squel[_0xdd71('0x80')]()[_0xdd71('0x81')](_0xdd71('0xa2'),_0xdd71('0xa2'))[_0xdd71('0x81')](_0xdd71('0xa6'),'scheduledAt')[_0xdd71('0x81')]('id','ContactId')[_0xdd71('0x81')](_0x22761e[_0xdd71('0xa7')][_0xdd71('0xad')](),_0xdd71('0xa5'))['field'](_0x180e66[_0xdd71('0x50')]['id'][_0xdd71('0xad')](),_0xdd71('0x66'))[_0xdd71('0x81')](_0xdd71('0xa6'),'createdAt')[_0xdd71('0x81')](_0xdd71('0xa6'),_0xdd71('0x5c'))[_0xdd71('0x82')](_0xdd71('0xa8'))[_0xdd71('0x46')](_0xdd71('0xa9'))[_0xdd71('0x46')]('ListId\x20=\x20?',_0x22761e[_0xdd71('0xa7')]['toString']())[_0xdd71('0x46')](_0xdd71('0xaa')))['toString']();}_0x3a018d[_0xdd71('0x8a')](db['sequelize']['query'](_0x5b1a86));}return BPromise['all'](_0x3a018d);}})[_0xdd71('0x2a')](function(){return _0x424b7b;})[_0xdd71('0x2a')](respondWithResult(_0x5d422e,null))['catch'](handleError(_0x5d422e,null));};exports[_0xdd71('0xb2')]=function(_0x464f71,_0x3fc7a6,_0x36319f){return db[_0xdd71('0x4a')][_0xdd71('0x31')]({'where':{'id':_0x464f71[_0xdd71('0x50')]['id']}})['then'](handleEntityNotFound(_0x3fc7a6,null))['then'](function(_0x1c63e0){if(_0x1c63e0){return _0x1c63e0[_0xdd71('0xb2')](_0x464f71[_0xdd71('0x3a')][_0xdd71('0x7f')]);}})[_0xdd71('0x2a')](function(_0x22d2c4){if(_0x22d2c4){return db[_0xdd71('0x63')]['destroy']({'where':{'ListId':_0x464f71[_0xdd71('0x3a')]['ids'],'VoiceQueueId':_0x464f71[_0xdd71('0x50')]['id']}})['then'](function(){return _0x22d2c4;});}})[_0xdd71('0x2a')](respondWithStatusCode(_0x3fc7a6,null))[_0xdd71('0x4f')](handleError(_0x3fc7a6,null));};exports[_0xdd71('0xb3')]=function(_0x13cf25,_0x35674a,_0x199174){var _0x4b5b23={};var _0x396fa7={};var _0x3c8b06;var _0x2972fd;return db[_0xdd71('0x4a')]['findOne']({'where':{'id':_0x13cf25['params']['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x35674a,null))[_0xdd71('0x2a')](function(_0x33191f){if(_0x33191f){_0x3c8b06=_0x33191f;_0x396fa7[_0xdd71('0x39')]=_[_0xdd71('0x51')](db['CmList'][_0xdd71('0x37')]);_0x396fa7[_0xdd71('0x3a')]=_[_0xdd71('0x51')](_0x13cf25[_0xdd71('0x3a')]);_0x396fa7['filters']=_['intersection'](_0x396fa7['model'],_0x396fa7['query']);_0x4b5b23[_0xdd71('0x3d')]=_[_0xdd71('0x3c')](_0x396fa7[_0xdd71('0x39')],qs['fields'](_0x13cf25[_0xdd71('0x3a')][_0xdd71('0x3e')]));_0x4b5b23[_0xdd71('0x3d')]=_0x4b5b23['attributes'][_0xdd71('0x3f')]?_0x4b5b23['attributes']:_0x396fa7[_0xdd71('0x39')];_0x4b5b23[_0xdd71('0x42')]=qs[_0xdd71('0x43')](_0x13cf25[_0xdd71('0x3a')][_0xdd71('0x43')]);_0x4b5b23['where']=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x13cf25[_0xdd71('0x3a')],_0x396fa7[_0xdd71('0x3b')]));if(_0x13cf25[_0xdd71('0x3a')][_0xdd71('0x45')]){_0x4b5b23[_0xdd71('0x46')]=_[_0xdd71('0x47')](_0x4b5b23[_0xdd71('0x46')],{'$or':_['map'](_0x4b5b23[_0xdd71('0x3d')],function(_0x5d68aa){var _0x54f6f4={};_0x54f6f4[_0x5d68aa]={'$like':'%'+_0x13cf25['query'][_0xdd71('0x45')]+'%'};return _0x54f6f4;})});}_0x4b5b23=_[_0xdd71('0x47')]({},_0x4b5b23,_0x13cf25['options']);return _0x3c8b06[_0xdd71('0xb3')](_0x4b5b23);}})[_0xdd71('0x2a')](function(_0x214385){if(_0x214385){_0x2972fd=_0x214385[_0xdd71('0x3f')];if(!_0x13cf25[_0xdd71('0x3a')][_0xdd71('0x40')](_0xdd71('0x65'))){_0x4b5b23['limit']=qs[_0xdd71('0x41')](_0x13cf25[_0xdd71('0x3a')]['limit']);_0x4b5b23[_0xdd71('0x23')]=qs['offset'](_0x13cf25[_0xdd71('0x3a')][_0xdd71('0x23')]);}return _0x3c8b06['getBlackLists'](_0x4b5b23);}})[_0xdd71('0x2a')](function(_0x1072f9){if(_0x1072f9){return _0x1072f9?{'count':_0x2972fd,'rows':_0x1072f9}:null;}})[_0xdd71('0x2a')](respondWithResult(_0x35674a,null))['catch'](handleError(_0x35674a,null));};exports[_0xdd71('0xb4')]=function(_0x4fc19e,_0x21f115,_0x1ff91c){var _0x1fa765,_0x5c95ac;return db[_0xdd71('0x4a')][_0xdd71('0x31')]({'where':{'id':_0x4fc19e[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x21f115,null))[_0xdd71('0x2a')](function(_0x49968e){if(_0x49968e){_0x5c95ac=_0x49968e;return _0x49968e[_0xdd71('0xb4')](_0x4fc19e['body']['ids'],_[_0xdd71('0x5b')](_0x4fc19e['body'],[_0xdd71('0x7f'),'id'])||{});}return null;})[_0xdd71('0x95')](function(_0x368ebe){var _0x38c0a3;_0x1fa765=_0x368ebe||[];var _0x14737e=[];if(_0x368ebe){for(var _0x1b6592=0x0;_0x1b6592<_0x368ebe['length'];_0x1b6592+=0x1){var _0x347fae=_0x368ebe[_0x1b6592][_0xdd71('0x54')]({'plain':!![]});_0x38c0a3=squel['insert']()[_0xdd71('0xa0')](_0xdd71('0xb5'))[_0xdd71('0xb0')]([_0xdd71('0xa2'),_0xdd71('0xa4'),_0xdd71('0xa5'),_0xdd71('0x66'),_0xdd71('0x5d'),_0xdd71('0x5c')],squel[_0xdd71('0x80')]()['field'](_0xdd71('0xa2'),_0xdd71('0xa2'))[_0xdd71('0x81')]('id','ContactId')[_0xdd71('0x81')](_0x347fae[_0xdd71('0xa7')]['toString'](),'ListId')[_0xdd71('0x81')](_0x4fc19e['params']['id']['toString'](),'VoiceQueueId')['field']('NOW()','createdAt')[_0xdd71('0x81')]('NOW()','updatedAt')['from']('cm_contacts')[_0xdd71('0x46')](_0xdd71('0xa9'))['where']('ListId\x20=\x20?',_0x347fae[_0xdd71('0xa7')]['toString']())['where'](_0xdd71('0xaa')))[_0xdd71('0xad')]();_0x14737e[_0xdd71('0x8a')](db[_0xdd71('0x74')][_0xdd71('0x3a')](_0x38c0a3));}return BPromise[_0xdd71('0x8d')](_0x14737e);}})['then'](function(){return _0x1fa765;})[_0xdd71('0x2a')](respondWithResult(_0x21f115,null))['catch'](handleError(_0x21f115,null));};exports[_0xdd71('0xb6')]=function(_0x2bc7c7,_0x11ae89,_0x7b8856){return db[_0xdd71('0x4a')][_0xdd71('0x31')]({'where':{'id':_0x2bc7c7[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x11ae89,null))[_0xdd71('0x2a')](function(_0x37d25d){if(_0x37d25d){return _0x37d25d['removeBlackLists'](_0x2bc7c7[_0xdd71('0x3a')][_0xdd71('0x7f')]);}})['then'](function(_0x5d2303){if(_0x5d2303){return db[_0xdd71('0x6a')]['destroy']({'where':{'ListId':_0x2bc7c7[_0xdd71('0x3a')]['ids'],'VoiceQueueId':_0x2bc7c7[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](function(){return _0x5d2303;});}})[_0xdd71('0x2a')](respondWithStatusCode(_0x11ae89,null))[_0xdd71('0x4f')](handleError(_0x11ae89,null));}; \ No newline at end of file +var _0x21f8=['merge','VIRTUAL','options','count','includeAll','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoiceQueues','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','include','omit','createdAt','updatedAt','role','autoAssociation','UserProfileResource','findOne','CmHopper','nolimit','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','rows','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','findOrCreate','UserVoiceQueueRt','upsert','isNil','SIP/%s','userVoiceQueue:save','removeTeams','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','union','compact','ids','isEmpty','removeAgents','emit','addAgents','spread','format','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','fromQuery','phone','scheduledAt','ContactId','ListId','field','CmListId','toString','NOW()','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','insert','into','cm_contacts','COALESCE(phone,\x27\x27)','getBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','inbound','QueueCampaigns','outbound','ignore','map','value','type','find','name','error','stack','send','VoiceQueue','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where'];(function(_0x22fa2f,_0x48e7d1){var _0x3e506e=function(_0x207e2a){while(--_0x207e2a){_0x22fa2f['push'](_0x22fa2f['shift']());}};_0x3e506e(++_0x48e7d1);}(_0x21f8,0x71));var _0x821f=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0x21f8[_0x1a37e3];return _0x4db78a;};'use strict';var pdf=require(_0x821f('0x0'));var emlformat=require(_0x821f('0x1'));var rimraf=require(_0x821f('0x2'));var zipdir=require(_0x821f('0x3'));var jsonpatch=require(_0x821f('0x4'));var rp=require(_0x821f('0x5'));var moment=require(_0x821f('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x821f('0x7'));var sox=require(_0x821f('0x8'));var csv=require(_0x821f('0x9'));var ejs=require(_0x821f('0xa'));var fs=require('fs');var _=require(_0x821f('0xb'));var squel=require(_0x821f('0xc'));var crypto=require(_0x821f('0xd'));var jsforce=require(_0x821f('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x821f('0xf'));var Papa=require(_0x821f('0x10'));var Redis=require(_0x821f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x821f('0x12'));var as=require(_0x821f('0x13'));var hardwareService=require(_0x821f('0x14'));var logger=require(_0x821f('0x15'))(_0x821f('0x16'));var utils=require(_0x821f('0x17'));var config=require(_0x821f('0x18'));var db=require(_0x821f('0x19'))['db'];config[_0x821f('0x1a')]=_[_0x821f('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x821f('0x1c'))(new Redis(config[_0x821f('0x1a')]));require(_0x821f('0x1d'))[_0x821f('0x1e')](socket);function respondWithStatusCode(_0x16145e,_0x42b2fa){_0x42b2fa=_0x42b2fa||0xcc;return function(_0x42f1a4){if(_0x42f1a4){return _0x16145e[_0x821f('0x1f')](_0x42b2fa);}return _0x16145e[_0x821f('0x20')](_0x42b2fa)[_0x821f('0x21')]();};}function respondWithResult(_0x4b746c,_0x3419ab){_0x3419ab=_0x3419ab||0xc8;return function(_0x594165){if(_0x594165){return _0x4b746c[_0x821f('0x20')](_0x3419ab)['json'](_0x594165);}};}function respondWithFilteredResult(_0x46acae,_0x2b3f5c){return function(_0x2a5d72){if(_0x2a5d72){var _0x27c41c=_0x2a5d72['count'],_0x5e8c54=_0x2b3f5c[_0x821f('0x22')],_0x1c015a=_0x2b3f5c['offset']+_0x2b3f5c[_0x821f('0x23')],_0x34d89c;if(_0x1c015a>=_0x27c41c){_0x1c015a=_0x27c41c;_0x34d89c=0xc8;}else{_0x34d89c=0xce;}_0x46acae['status'](_0x34d89c);return _0x46acae[_0x821f('0x24')](_0x821f('0x25'),_0x5e8c54+'-'+_0x1c015a+'/'+_0x27c41c)['json'](_0x2a5d72);}return null;};}function patchUpdates(_0x4f3283){return function(_0x5caa12){try{jsonpatch[_0x821f('0x26')](_0x5caa12,_0x4f3283,!![]);}catch(_0x35103c){return BPromise['reject'](_0x35103c);}return _0x5caa12[_0x821f('0x27')]();};}function saveUpdates(_0xb5d07,_0x3dda74){return function(_0x5ca883){if(_0x5ca883){return _0x5ca883[_0x821f('0x28')](_0xb5d07)[_0x821f('0x29')](function(_0x4b2e35){return _0x4b2e35;});}return null;};}function removeEntity(_0x4ef246,_0x4ede29){return function(_0x59530c){if(_0x59530c){return _0x59530c[_0x821f('0x2a')]()['then'](function(){var _0x49360d=_0x59530c[_0x821f('0x2b')]({'plain':!![]});var _0x57f758=[{'name':'VoiceQueues','value':_0x821f('0x2c'),'ignore':![]},{'name':_0x821f('0x2d'),'value':_0x821f('0x2e'),'ignore':![]}];var _0x368a74=_(_0x57f758)['filter'](_0x821f('0x2f'))[_0x821f('0x30')](_0x821f('0x31'))[_0x821f('0x31')]();if(_['includes'](_0x368a74,_0x49360d[_0x821f('0x32')])){return;}var _0xac9ab1=_[_0x821f('0x33')](_0x57f758,[_0x821f('0x31'),_0x49360d['type']])[_0x821f('0x34')];return db['UserProfileResource']['destroy']({'where':{'type':_0xac9ab1,'resourceId':_0x49360d['id']}})[_0x821f('0x29')](function(){return _0x59530c;});})[_0x821f('0x29')](function(){_0x4ef246[_0x821f('0x20')](0xcc)[_0x821f('0x21')]();});}};}function handleEntityNotFound(_0x122e56,_0x5b10f6){return function(_0x12b057){if(!_0x12b057){_0x122e56[_0x821f('0x1f')](0x194);}return _0x12b057;};}function handleError(_0x17db9d,_0x12a47a){_0x12a47a=_0x12a47a||0x1f4;return function(_0x5429c0){logger[_0x821f('0x35')](_0x5429c0[_0x821f('0x36')]);if(_0x5429c0[_0x821f('0x34')]){delete _0x5429c0[_0x821f('0x34')];}_0x17db9d[_0x821f('0x20')](_0x12a47a)[_0x821f('0x37')](_0x5429c0);};}exports['index']=function(_0x3f2aff,_0x509a75){var _0x27bd34={},_0x32e02b={},_0x5c2407={'count':0x0,'rows':[]};var _0x5e1538=_[_0x821f('0x30')](db[_0x821f('0x38')][_0x821f('0x39')],function(_0x302611){return{'name':_0x302611[_0x821f('0x3a')],'type':_0x302611['type']['key']};});_0x32e02b[_0x821f('0x3b')]=_[_0x821f('0x30')](_0x5e1538,_0x821f('0x34'));_0x32e02b['query']=_[_0x821f('0x3c')](_0x3f2aff[_0x821f('0x3d')]);_0x32e02b[_0x821f('0x3e')]=_[_0x821f('0x3f')](_0x32e02b[_0x821f('0x3b')],_0x32e02b[_0x821f('0x3d')]);_0x27bd34[_0x821f('0x40')]=_['intersection'](_0x32e02b['model'],qs[_0x821f('0x41')](_0x3f2aff[_0x821f('0x3d')][_0x821f('0x41')]));_0x27bd34[_0x821f('0x40')]=_0x27bd34[_0x821f('0x40')]['length']?_0x27bd34['attributes']:_0x32e02b[_0x821f('0x3b')];if(!_0x3f2aff[_0x821f('0x3d')][_0x821f('0x42')]('nolimit')){_0x27bd34[_0x821f('0x23')]=qs[_0x821f('0x23')](_0x3f2aff[_0x821f('0x3d')]['limit']);_0x27bd34[_0x821f('0x22')]=qs[_0x821f('0x22')](_0x3f2aff[_0x821f('0x3d')][_0x821f('0x22')]);}_0x27bd34[_0x821f('0x43')]=qs[_0x821f('0x44')](_0x3f2aff['query'][_0x821f('0x44')]);_0x27bd34['where']=qs[_0x821f('0x3e')](_[_0x821f('0x45')](_0x3f2aff[_0x821f('0x3d')],_0x32e02b[_0x821f('0x3e')]));if(_0x3f2aff[_0x821f('0x3d')][_0x821f('0x46')]){_0x27bd34[_0x821f('0x47')]=_[_0x821f('0x48')](_0x27bd34['where'],{'$or':_[_0x821f('0x30')](_0x5e1538,function(_0x603245){if(_0x603245[_0x821f('0x32')]!==_0x821f('0x49')){var _0x341a4f={};_0x341a4f[_0x603245['name']]={'$like':'%'+_0x3f2aff[_0x821f('0x3d')][_0x821f('0x46')]+'%'};return _0x341a4f;}})});}_0x27bd34=_[_0x821f('0x48')]({},_0x27bd34,_0x3f2aff[_0x821f('0x4a')]);var _0xc7e754={'where':_0x27bd34[_0x821f('0x47')]};return db[_0x821f('0x38')][_0x821f('0x4b')](_0xc7e754)[_0x821f('0x29')](function(_0x4e0335){_0x5c2407[_0x821f('0x4b')]=_0x4e0335;if(_0x3f2aff['query'][_0x821f('0x4c')]){_0x27bd34['include']=[{'all':!![]}];}return db[_0x821f('0x38')]['findAll'](_0x27bd34);})[_0x821f('0x29')](function(_0x2c3996){_0x5c2407['rows']=_0x2c3996;return _0x5c2407;})[_0x821f('0x29')](respondWithFilteredResult(_0x509a75,_0x27bd34))['catch'](handleError(_0x509a75,null));};exports[_0x821f('0x4d')]=function(_0xb611e8,_0x4dadc2){var _0xf64489={'raw':![],'where':{'id':_0xb611e8['params']['id']}},_0x338da4={};_0x338da4[_0x821f('0x3b')]=_['keys'](db[_0x821f('0x38')][_0x821f('0x39')]);_0x338da4[_0x821f('0x3d')]=_['keys'](_0xb611e8[_0x821f('0x3d')]);_0x338da4[_0x821f('0x3e')]=_['intersection'](_0x338da4[_0x821f('0x3b')],_0x338da4['query']);_0xf64489[_0x821f('0x40')]=_[_0x821f('0x3f')](_0x338da4[_0x821f('0x3b')],qs[_0x821f('0x41')](_0xb611e8[_0x821f('0x3d')]['fields']));_0xf64489[_0x821f('0x40')]=_0xf64489[_0x821f('0x40')][_0x821f('0x4e')]?_0xf64489[_0x821f('0x40')]:_0x338da4['model'];if(_0xb611e8['query'][_0x821f('0x4c')]){_0xf64489['include']=[{'all':!![]}];}_0xf64489=_['merge']({},_0xf64489,_0xb611e8[_0x821f('0x4a')]);return db[_0x821f('0x38')][_0x821f('0x33')](_0xf64489)[_0x821f('0x29')](handleEntityNotFound(_0x4dadc2,null))[_0x821f('0x29')](respondWithResult(_0x4dadc2,null))['catch'](handleError(_0x4dadc2,null));};exports[_0x821f('0x4f')]=function(_0x5f0b2e,_0x1b7aca){return db['VoiceQueue'][_0x821f('0x4f')](_0x5f0b2e[_0x821f('0x50')],{})[_0x821f('0x29')](function(_0x57c3c9){var _0x5f15ba=_0x5f0b2e[_0x821f('0x51')][_0x821f('0x2b')]({'plain':!![]});if(!_0x5f15ba)throw new Error(_0x821f('0x52'));if(_0x5f15ba['role']===_0x821f('0x51')){var _0x4665e2=_0x57c3c9[_0x821f('0x2b')]({'plain':!![]});var _0x4647d2=[{'name':_0x821f('0x53'),'value':'inbound'},{'name':_0x821f('0x2d'),'value':_0x821f('0x2e')}];var _0x362946=_[_0x821f('0x33')](_0x4647d2,['value',_0x4665e2[_0x821f('0x32')]])[_0x821f('0x34')];return db[_0x821f('0x54')][_0x821f('0x33')]({'where':{'name':_0x362946,'userProfileId':_0x5f15ba[_0x821f('0x55')]},'raw':!![]})['then'](function(_0x36393f){if(_0x36393f&&_0x36393f['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4665e2['name'],'resourceId':_0x4665e2['id'],'type':_0x36393f['name'],'sectionId':_0x36393f['id']},{})[_0x821f('0x29')](function(){return _0x57c3c9;});}else{return _0x57c3c9;}})[_0x821f('0x56')](function(_0x3d219f){logger[_0x821f('0x35')](_0x821f('0x57'),_0x3d219f);throw _0x3d219f;});}return _0x57c3c9;})['then'](respondWithResult(_0x1b7aca,0xc9))[_0x821f('0x56')](handleError(_0x1b7aca,null));};exports[_0x821f('0x58')]=function(_0x481305,_0x19a103){var _0x72cdcb={'where':{'id':_0x481305[_0x821f('0x59')]['id']}},_0x27f7f5={};_0x27f7f5['model']=_[_0x821f('0x3c')](db[_0x821f('0x38')]['rawAttributes']);_0x72cdcb[_0x821f('0x40')]=_['intersection'](_0x27f7f5[_0x821f('0x3b')],qs[_0x821f('0x41')](_0x481305[_0x821f('0x3d')][_0x821f('0x41')]));_0x72cdcb[_0x821f('0x40')]=_0x72cdcb[_0x821f('0x40')][_0x821f('0x4e')]?_0x72cdcb[_0x821f('0x40')]:_0x27f7f5[_0x821f('0x3b')];if(_0x481305['query'][_0x821f('0x4c')]){_0x72cdcb[_0x821f('0x5a')]=[{'all':!![]}];}_0x72cdcb=_[_0x821f('0x48')]({},_0x72cdcb,_0x481305['options']);return db[_0x821f('0x38')][_0x821f('0x33')](_0x72cdcb)[_0x821f('0x29')](handleEntityNotFound(_0x19a103,null))[_0x821f('0x29')](function(_0x5004d9){if(_0x5004d9){var _0x342b1e=_0x5004d9['get']({'plain':!![]});_0x342b1e=qs[_0x821f('0x5b')](_0x342b1e,['id',_0x821f('0x5c'),_0x821f('0x5d')]);_0x481305[_0x821f('0x50')]=_[_0x821f('0x5b')](_0x481305[_0x821f('0x50')],['id',_0x821f('0x5c'),'updatedAt']);return db[_0x821f('0x38')][_0x821f('0x4f')](_['merge'](_0x342b1e,_0x481305[_0x821f('0x50')]),{'include':_0x481305[_0x821f('0x3d')][_0x821f('0x4c')]?[{'all':!![]}]:undefined})[_0x821f('0x29')](function(_0x58ae39){var _0x4ebce2=_0x481305[_0x821f('0x51')]['get']({'plain':!![]});if(!_0x4ebce2)throw new Error(_0x821f('0x52'));if(_0x4ebce2[_0x821f('0x5e')]===_0x821f('0x51')){var _0x283740=_0x58ae39[_0x821f('0x2b')]({'plain':!![]});var _0x31d984=[{'name':_0x821f('0x53'),'value':_0x821f('0x2c')},{'name':_0x821f('0x2d'),'value':_0x821f('0x2e')}];var _0x174b83=_[_0x821f('0x33')](_0x31d984,[_0x821f('0x31'),_0x283740[_0x821f('0x32')]])[_0x821f('0x34')];return db[_0x821f('0x54')][_0x821f('0x33')]({'where':{'name':_0x174b83,'userProfileId':_0x4ebce2[_0x821f('0x55')]},'raw':!![]})[_0x821f('0x29')](function(_0x117789){if(_0x117789&&_0x117789[_0x821f('0x5f')]===0x0){return db[_0x821f('0x60')][_0x821f('0x4f')]({'name':_0x283740[_0x821f('0x34')],'resourceId':_0x283740['id'],'type':_0x117789[_0x821f('0x34')],'sectionId':_0x117789['id']},{})[_0x821f('0x29')](function(){return _0x58ae39;});}else{return _0x58ae39;}})[_0x821f('0x56')](function(_0x29dc0c){logger[_0x821f('0x35')](_0x821f('0x57'),_0x29dc0c);throw _0x29dc0c;});}return _0x58ae39;});}})[_0x821f('0x29')](respondWithResult(_0x19a103,0xc9))[_0x821f('0x56')](handleError(_0x19a103,null));};exports[_0x821f('0x28')]=function(_0x83a2c5,_0x4b3418){if(_0x83a2c5[_0x821f('0x50')]['id']){delete _0x83a2c5[_0x821f('0x50')]['id'];}return db[_0x821f('0x38')]['find']({'where':{'id':_0x83a2c5[_0x821f('0x59')]['id']}})[_0x821f('0x29')](handleEntityNotFound(_0x4b3418,null))['then'](saveUpdates(_0x83a2c5[_0x821f('0x50')],null))[_0x821f('0x29')](respondWithResult(_0x4b3418,null))[_0x821f('0x56')](handleError(_0x4b3418,null));};exports[_0x821f('0x2a')]=function(_0x2b75d6,_0x10e4d0){return db[_0x821f('0x38')][_0x821f('0x33')]({'where':{'id':_0x2b75d6[_0x821f('0x59')]['id']}})[_0x821f('0x29')](handleEntityNotFound(_0x10e4d0,null))[_0x821f('0x29')](removeEntity(_0x10e4d0,null))[_0x821f('0x56')](handleError(_0x10e4d0,null));};exports['getHoppers']=function(_0xb3decf,_0x1610fd,_0x596bb9){var _0x3b4629={'raw':![],'where':{}};var _0x31b0b0={};var _0x58e7f2={'count':0x0,'rows':[]};return db[_0x821f('0x38')][_0x821f('0x61')]({'where':{'id':_0xb3decf[_0x821f('0x59')]['id']}})['then'](handleEntityNotFound(_0x1610fd,null))[_0x821f('0x29')](function(_0x3e22b8){if(_0x3e22b8){_0x31b0b0['model']=_[_0x821f('0x3c')](db[_0x821f('0x62')][_0x821f('0x39')]);_0x31b0b0[_0x821f('0x3d')]=_[_0x821f('0x3c')](_0xb3decf[_0x821f('0x3d')]);_0x31b0b0['filters']=_[_0x821f('0x3f')](_0x31b0b0['model'],_0x31b0b0['query']);_0x3b4629[_0x821f('0x40')]=_[_0x821f('0x3f')](_0x31b0b0['model'],qs['fields'](_0xb3decf[_0x821f('0x3d')][_0x821f('0x41')]));_0x3b4629[_0x821f('0x40')]=_0x3b4629[_0x821f('0x40')]['length']?_0x3b4629[_0x821f('0x40')]:_0x31b0b0['model'];if(!_0xb3decf['query'][_0x821f('0x42')](_0x821f('0x63'))){_0x3b4629[_0x821f('0x23')]=qs[_0x821f('0x23')](_0xb3decf[_0x821f('0x3d')][_0x821f('0x23')]);_0x3b4629[_0x821f('0x22')]=qs[_0x821f('0x22')](_0xb3decf[_0x821f('0x3d')][_0x821f('0x22')]);}_0x3b4629[_0x821f('0x43')]=qs[_0x821f('0x44')](_0xb3decf['query'][_0x821f('0x44')]);_0x3b4629[_0x821f('0x47')]=qs[_0x821f('0x3e')](_[_0x821f('0x45')](_0xb3decf[_0x821f('0x3d')],_0x31b0b0[_0x821f('0x3e')]));_0x3b4629[_0x821f('0x47')][_0x821f('0x64')]=_0x3e22b8['id'];if(_0xb3decf['query']['filter']){_0x3b4629['where']=_['merge'](_0x3b4629[_0x821f('0x47')],{'$or':_['map'](_0x3b4629[_0x821f('0x40')],function(_0x256785){var _0x195dae={};_0x195dae[_0x256785]={'$like':'%'+_0xb3decf[_0x821f('0x3d')][_0x821f('0x46')]+'%'};return _0x195dae;})});}_0x3b4629=_[_0x821f('0x48')]({},_0x3b4629,_0xb3decf[_0x821f('0x4a')]);return db[_0x821f('0x62')][_0x821f('0x4b')]({'where':_0x3b4629[_0x821f('0x47')]})[_0x821f('0x29')](function(_0x7ad8a2){_0x58e7f2[_0x821f('0x4b')]=_0x7ad8a2;if(_0xb3decf[_0x821f('0x3d')]['includeAll']){_0x3b4629['include']=[{'all':!![]}];}return db['CmHopper'][_0x821f('0x65')](_0x3b4629);})['then'](function(_0x1c637e){_0x58e7f2['rows']=_0x1c637e;return _0x58e7f2;});}})[_0x821f('0x29')](respondWithFilteredResult(_0x1610fd,_0x3b4629))[_0x821f('0x56')](handleError(_0x1610fd,null));};exports[_0x821f('0x66')]=function(_0x17feb6,_0x18a63b,_0x19a0f9){var _0x23ef06={'raw':!![],'where':{}};var _0x51c7da={};var _0x2a6f37={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x821f('0x61')]({'where':{'id':_0x17feb6[_0x821f('0x59')]['id']}})[_0x821f('0x29')](handleEntityNotFound(_0x18a63b,null))[_0x821f('0x29')](function(_0x159823){if(_0x159823){_0x51c7da[_0x821f('0x3b')]=_[_0x821f('0x3c')](db[_0x821f('0x67')][_0x821f('0x39')]);_0x51c7da['query']=_[_0x821f('0x3c')](_0x17feb6[_0x821f('0x3d')]);_0x51c7da['filters']=_[_0x821f('0x3f')](_0x51c7da[_0x821f('0x3b')],_0x51c7da['query']);_0x23ef06['attributes']=_[_0x821f('0x3f')](_0x51c7da[_0x821f('0x3b')],qs[_0x821f('0x41')](_0x17feb6[_0x821f('0x3d')][_0x821f('0x41')]));_0x23ef06[_0x821f('0x40')]=_0x23ef06['attributes']['length']?_0x23ef06[_0x821f('0x40')]:_0x51c7da['model'];if(!_0x17feb6[_0x821f('0x3d')][_0x821f('0x42')](_0x821f('0x63'))){_0x23ef06[_0x821f('0x23')]=qs[_0x821f('0x23')](_0x17feb6['query'][_0x821f('0x23')]);_0x23ef06[_0x821f('0x22')]=qs[_0x821f('0x22')](_0x17feb6['query'][_0x821f('0x22')]);}_0x23ef06['order']=qs[_0x821f('0x44')](_0x17feb6['query'][_0x821f('0x44')]);_0x23ef06['where']=qs[_0x821f('0x3e')](_[_0x821f('0x45')](_0x17feb6[_0x821f('0x3d')],_0x51c7da[_0x821f('0x3e')]));_0x23ef06[_0x821f('0x47')]['VoiceQueueId']=_0x159823['id'];if(_0x17feb6['query']['filter']){_0x23ef06[_0x821f('0x47')]=_['merge'](_0x23ef06[_0x821f('0x47')],{'$or':_[_0x821f('0x30')](_0x23ef06['attributes'],function(_0x180022){var _0x52b202={};_0x52b202[_0x180022]={'$like':'%'+_0x17feb6['query'][_0x821f('0x46')]+'%'};return _0x52b202;})});}_0x23ef06=_[_0x821f('0x48')]({},_0x23ef06,_0x17feb6[_0x821f('0x4a')]);return db[_0x821f('0x67')][_0x821f('0x4b')]({'where':_0x23ef06['where']})['then'](function(_0x3f4af8){_0x2a6f37[_0x821f('0x4b')]=_0x3f4af8;if(_0x17feb6[_0x821f('0x3d')][_0x821f('0x4c')]){_0x23ef06[_0x821f('0x5a')]=[{'all':!![]}];}return db[_0x821f('0x67')][_0x821f('0x65')](_0x23ef06);})[_0x821f('0x29')](function(_0x2bf40a){_0x2a6f37['rows']=_0x2bf40a;return _0x2a6f37;});}})[_0x821f('0x29')](respondWithFilteredResult(_0x18a63b,_0x23ef06))[_0x821f('0x56')](handleError(_0x18a63b,null));};exports[_0x821f('0x68')]=function(_0x1dbba9,_0x33a553,_0x318553){var _0x541cec={'raw':!![],'where':{}};var _0x57d8de={};var _0x1377bb={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x821f('0x61')]({'where':{'id':_0x1dbba9[_0x821f('0x59')]['id']}})[_0x821f('0x29')](handleEntityNotFound(_0x33a553,null))['then'](function(_0x1a753d){if(_0x1a753d){_0x57d8de[_0x821f('0x3b')]=_['keys'](db[_0x821f('0x69')][_0x821f('0x39')]);_0x57d8de[_0x821f('0x3d')]=_[_0x821f('0x3c')](_0x1dbba9['query']);_0x57d8de['filters']=_[_0x821f('0x3f')](_0x57d8de[_0x821f('0x3b')],_0x57d8de[_0x821f('0x3d')]);_0x541cec[_0x821f('0x40')]=_[_0x821f('0x3f')](_0x57d8de[_0x821f('0x3b')],qs[_0x821f('0x41')](_0x1dbba9['query']['fields']));_0x541cec[_0x821f('0x40')]=_0x541cec[_0x821f('0x40')][_0x821f('0x4e')]?_0x541cec[_0x821f('0x40')]:_0x57d8de[_0x821f('0x3b')];if(!_0x1dbba9[_0x821f('0x3d')][_0x821f('0x42')](_0x821f('0x63'))){_0x541cec[_0x821f('0x23')]=qs[_0x821f('0x23')](_0x1dbba9[_0x821f('0x3d')][_0x821f('0x23')]);_0x541cec[_0x821f('0x22')]=qs[_0x821f('0x22')](_0x1dbba9['query'][_0x821f('0x22')]);}_0x541cec[_0x821f('0x43')]=qs[_0x821f('0x44')](_0x1dbba9[_0x821f('0x3d')]['sort']);_0x541cec[_0x821f('0x47')]=qs[_0x821f('0x3e')](_[_0x821f('0x45')](_0x1dbba9['query'],_0x57d8de[_0x821f('0x3e')]));_0x541cec[_0x821f('0x47')][_0x821f('0x64')]=_0x1a753d['id'];if(_0x1dbba9[_0x821f('0x3d')][_0x821f('0x46')]){_0x541cec['where']=_[_0x821f('0x48')](_0x541cec['where'],{'$or':_['map'](_0x541cec['attributes'],function(_0x4a96c9){var _0x6bcd5b={};_0x6bcd5b[_0x4a96c9]={'$like':'%'+_0x1dbba9[_0x821f('0x3d')][_0x821f('0x46')]+'%'};return _0x6bcd5b;})});}_0x541cec=_[_0x821f('0x48')]({},_0x541cec,_0x1dbba9['options']);return db[_0x821f('0x69')][_0x821f('0x4b')]({'where':_0x541cec['where']})[_0x821f('0x29')](function(_0x1c68db){_0x1377bb[_0x821f('0x4b')]=_0x1c68db;if(_0x1dbba9[_0x821f('0x3d')]['includeAll']){_0x541cec[_0x821f('0x5a')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x821f('0x65')](_0x541cec);})[_0x821f('0x29')](function(_0x3ec249){_0x1377bb['rows']=_0x3ec249;return _0x1377bb;});}})[_0x821f('0x29')](respondWithFilteredResult(_0x33a553,_0x541cec))[_0x821f('0x56')](handleError(_0x33a553,null));};exports[_0x821f('0x6a')]=function(_0xbe041f,_0x3ee32a,_0x1d8014){var _0x23856a={'raw':!![],'where':{}};var _0x4d48b1={};var _0x169e84={'count':0x0,'rows':[]};return db[_0x821f('0x38')][_0x821f('0x61')]({'where':{'id':_0xbe041f['params']['id']}})['then'](handleEntityNotFound(_0x3ee32a,null))[_0x821f('0x29')](function(_0x132436){if(_0x132436){_0x4d48b1[_0x821f('0x3b')]=_[_0x821f('0x3c')](db['CmHopperBlack'][_0x821f('0x39')]);_0x4d48b1[_0x821f('0x3d')]=_[_0x821f('0x3c')](_0xbe041f[_0x821f('0x3d')]);_0x4d48b1[_0x821f('0x3e')]=_[_0x821f('0x3f')](_0x4d48b1[_0x821f('0x3b')],_0x4d48b1[_0x821f('0x3d')]);_0x23856a['attributes']=_[_0x821f('0x3f')](_0x4d48b1['model'],qs[_0x821f('0x41')](_0xbe041f[_0x821f('0x3d')][_0x821f('0x41')]));_0x23856a[_0x821f('0x40')]=_0x23856a[_0x821f('0x40')][_0x821f('0x4e')]?_0x23856a['attributes']:_0x4d48b1[_0x821f('0x3b')];if(!_0xbe041f['query'][_0x821f('0x42')]('nolimit')){_0x23856a[_0x821f('0x23')]=qs[_0x821f('0x23')](_0xbe041f[_0x821f('0x3d')][_0x821f('0x23')]);_0x23856a[_0x821f('0x22')]=qs['offset'](_0xbe041f[_0x821f('0x3d')][_0x821f('0x22')]);}_0x23856a[_0x821f('0x43')]=qs[_0x821f('0x44')](_0xbe041f[_0x821f('0x3d')][_0x821f('0x44')]);_0x23856a[_0x821f('0x47')]=qs[_0x821f('0x3e')](_[_0x821f('0x45')](_0xbe041f['query'],_0x4d48b1[_0x821f('0x3e')]));_0x23856a['where']['VoiceQueueId']=_0x132436['id'];if(_0xbe041f['query'][_0x821f('0x46')]){_0x23856a[_0x821f('0x47')]=_[_0x821f('0x48')](_0x23856a[_0x821f('0x47')],{'$or':_[_0x821f('0x30')](_0x23856a[_0x821f('0x40')],function(_0x35a2c3){var _0x5bc4b6={};_0x5bc4b6[_0x35a2c3]={'$like':'%'+_0xbe041f[_0x821f('0x3d')][_0x821f('0x46')]+'%'};return _0x5bc4b6;})});}_0x23856a=_[_0x821f('0x48')]({},_0x23856a,_0xbe041f[_0x821f('0x4a')]);return db['CmHopperBlack'][_0x821f('0x4b')]({'where':_0x23856a[_0x821f('0x47')]})[_0x821f('0x29')](function(_0x1d8e7d){_0x169e84[_0x821f('0x4b')]=_0x1d8e7d;if(_0xbe041f['query'][_0x821f('0x4c')]){_0x23856a[_0x821f('0x5a')]=[{'all':!![]}];}return db[_0x821f('0x6b')][_0x821f('0x65')](_0x23856a);})['then'](function(_0x592a48){_0x169e84[_0x821f('0x6c')]=_0x592a48;return _0x169e84;});}})['then'](respondWithFilteredResult(_0x3ee32a,_0x23856a))[_0x821f('0x56')](handleError(_0x3ee32a,null));};exports[_0x821f('0x6d')]=function(_0x9a5bac,_0x13cd84,_0x47cf5f){var _0x2f1625={};var _0x371c40={};var _0x6d2b34;var _0x372f7e;return db[_0x821f('0x38')][_0x821f('0x61')]({'where':{'id':_0x9a5bac['params']['id']}})[_0x821f('0x29')](handleEntityNotFound(_0x13cd84,null))[_0x821f('0x29')](function(_0x29380f){if(_0x29380f){_0x6d2b34=_0x29380f;_0x371c40[_0x821f('0x3b')]=_[_0x821f('0x3c')](db[_0x821f('0x6e')][_0x821f('0x39')]);_0x371c40[_0x821f('0x3d')]=_['keys'](_0x9a5bac[_0x821f('0x3d')]);_0x371c40[_0x821f('0x3e')]=_[_0x821f('0x3f')](_0x371c40[_0x821f('0x3b')],_0x371c40[_0x821f('0x3d')]);_0x2f1625[_0x821f('0x40')]=_[_0x821f('0x3f')](_0x371c40[_0x821f('0x3b')],qs[_0x821f('0x41')](_0x9a5bac[_0x821f('0x3d')][_0x821f('0x41')]));_0x2f1625[_0x821f('0x40')]=_0x2f1625['attributes'][_0x821f('0x4e')]?_0x2f1625[_0x821f('0x40')]:_0x371c40[_0x821f('0x3b')];_0x2f1625[_0x821f('0x43')]=qs[_0x821f('0x44')](_0x9a5bac['query'][_0x821f('0x44')]);_0x2f1625[_0x821f('0x47')]=qs['filters'](_[_0x821f('0x45')](_0x9a5bac[_0x821f('0x3d')],_0x371c40[_0x821f('0x3e')]));if(_0x9a5bac[_0x821f('0x3d')][_0x821f('0x46')]){_0x2f1625['where']=_['merge'](_0x2f1625['where'],{'$or':_[_0x821f('0x30')](_0x2f1625[_0x821f('0x40')],function(_0x452c2e){var _0x6698c2={};_0x6698c2[_0x452c2e]={'$like':'%'+_0x9a5bac[_0x821f('0x3d')][_0x821f('0x46')]+'%'};return _0x6698c2;})});}_0x2f1625=_[_0x821f('0x48')]({},_0x2f1625,_0x9a5bac[_0x821f('0x4a')]);return _0x6d2b34[_0x821f('0x6d')](_0x2f1625);}})[_0x821f('0x29')](function(_0x52af51){if(_0x52af51){_0x372f7e=_0x52af51[_0x821f('0x4e')];if(!_0x9a5bac['query'][_0x821f('0x42')](_0x821f('0x63'))){_0x2f1625[_0x821f('0x23')]=qs[_0x821f('0x23')](_0x9a5bac[_0x821f('0x3d')][_0x821f('0x23')]);_0x2f1625[_0x821f('0x22')]=qs[_0x821f('0x22')](_0x9a5bac['query']['offset']);}return _0x6d2b34['getTeams'](_0x2f1625);}})[_0x821f('0x29')](function(_0x215815){if(_0x215815){return _0x215815?{'count':_0x372f7e,'rows':_0x215815}:null;}})['then'](respondWithResult(_0x13cd84,null))[_0x821f('0x56')](handleError(_0x13cd84,null));};exports[_0x821f('0x6f')]=function(_0x36cf60,_0x148c7b,_0x44397e){var _0x5442ad=_0x36cf60[_0x821f('0x50')]['teams'];var _0x66a070=_['map'](_0x5442ad,'id');return db[_0x821f('0x6e')][_0x821f('0x65')]({'where':{'id':_0x66a070},'attributes':['id'],'include':[{'model':db[_0x821f('0x70')],'as':_0x821f('0x71'),'attributes':['id',_0x821f('0x34'),_0x821f('0x72'),_0x821f('0x73'),_0x821f('0x74')],'raw':!![]}]})[_0x821f('0x29')](function(_0x2b6a37){if(_0x2b6a37){var _0x141d8f=_[_0x821f('0x75')](_0x2b6a37,function(_0x452e3a){var _0x56e9a5=_0x452e3a[_0x821f('0x2b')]({'plain':!![]});_0x56e9a5[_0x821f('0x71')][_0x821f('0x76')](function(_0x51dc1e){_0x51dc1e[_0x821f('0x77')]=_['find'](_0x5442ad,{'id':_0x56e9a5['id']})[_0x821f('0x77')];});return _0x56e9a5[_0x821f('0x71')];});return db[_0x821f('0x38')][_0x821f('0x33')]({'where':{'id':_0x36cf60['params']['id']}})[_0x821f('0x29')](function(_0xbc011b){return db[_0x821f('0x78')][_0x821f('0x79')](function(_0xe4fe2){return _0xbc011b['addTeams'](_0x66a070,{'transaction':_0xe4fe2})[_0x821f('0x29')](function(){return BPromise[_0x821f('0x7a')](_0x141d8f,function(_0x379e61){return db['UserVoiceQueue'][_0x821f('0x7b')]({'where':{'UserId':_0x379e61['id'],'VoiceQueueId':_0x36cf60[_0x821f('0x59')]['id']},'defaults':{'penalty':_0x379e61['penalty']},'transaction':_0xe4fe2});});})[_0x821f('0x29')](function(){return BPromise[_0x821f('0x7a')](_[_0x821f('0x46')](_0x141d8f,{'online':!![]}),function(_0x8dc6ac){return db[_0x821f('0x7c')][_0x821f('0x7d')]({'membername':_0x8dc6ac[_0x821f('0x34')],'UserId':_0x8dc6ac['id'],'queue_name':_0xbc011b['name'],'VoiceQueueId':_0xbc011b['id'],'interface':_[_0x821f('0x7e')](_0x8dc6ac[_0x821f('0x74')])?util['format'](_0x821f('0x7f'),_0x8dc6ac[_0x821f('0x34')]):_0x8dc6ac[_0x821f('0x74')],'paused':_0x8dc6ac['voicePause']||![],'penalty':_0x8dc6ac['penalty']},{'transaction':_0xe4fe2});});})[_0x821f('0x29')](function(){_0x141d8f[_0x821f('0x76')](function(_0x1e9cae){socket['emit'](_0x821f('0x80'),{'UserId':_0x1e9cae['id'],'VoiceQueueId':_0xbc011b['id']});});});});});}})['then'](respondWithStatusCode(_0x148c7b,null))[_0x821f('0x56')](handleError(_0x148c7b,null));};exports[_0x821f('0x81')]=function(_0x4c3d2e,_0x130ec6,_0x353618){return db[_0x821f('0x6e')]['findAll']({'where':{'id':_0x4c3d2e[_0x821f('0x3d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x821f('0x70')],'as':_0x821f('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x130ec6,null))[_0x821f('0x29')](function(_0x34db65){var _0x41bbfa=_[_0x821f('0x30')](_0x34db65,'id');var _0x15464f=[];var _0x1b3240=[];var _0x5352af=squel[_0x821f('0x82')]();_0x5352af['field'](_0x821f('0x83'))[_0x821f('0x84')](_0x821f('0x85'),'tq')['join'](_0x821f('0x86'),'ut',_0x821f('0x87'))['where'](_0x821f('0x88'),_0x4c3d2e[_0x821f('0x59')]['id']);for(var _0x134a56=0x0;_0x134a56<_0x34db65['length'];_0x134a56+=0x1){let _0x2e2b5a=_0x34db65[_0x134a56];for(var _0x1bd87d=0x0;_0x1bd87d<_0x2e2b5a[_0x821f('0x71')]['length'];_0x1bd87d+=0x1){let _0x1fc028=_0x2e2b5a[_0x821f('0x71')][_0x1bd87d];var _0xaf9704=_0x5352af['clone']();_0xaf9704[_0x821f('0x47')](_0x821f('0x89'),_0x1fc028['id']);_0x1b3240[_0x821f('0x8a')](db[_0x821f('0x78')][_0x821f('0x3d')](_0xaf9704['toString'](),{'type':db[_0x821f('0x78')][_0x821f('0x8b')][_0x821f('0x8c')]})[_0x821f('0x29')](function(_0x3454c3){if(_0x3454c3[_0x821f('0x4e')]===0x1){return _0x1fc028['id'];}else{var _0x438954=_[_0x821f('0x8d')](_['map'](_0x3454c3,_0x821f('0x8e')),function(_0x1b495c){return _[_0x821f('0x8f')](_0x41bbfa,_0x1b495c);});if(_0x438954){return _0x1fc028['id'];}}}));}}return BPromise['all'](_0x1b3240)[_0x821f('0x29')](function(_0x23d11b){_0x15464f=_(_0x15464f)[_0x821f('0x90')](_0x23d11b)[_0x821f('0x91')]()[_0x821f('0x31')]();return db[_0x821f('0x38')][_0x821f('0x33')]({'where':{'id':_0x4c3d2e[_0x821f('0x59')]['id']}})[_0x821f('0x29')](function(_0x4cf0b4){return db[_0x821f('0x78')][_0x821f('0x79')](function(_0x2791b8){return _0x4cf0b4[_0x821f('0x81')](_0x4c3d2e['query'][_0x821f('0x92')],{'transaction':_0x2791b8})[_0x821f('0x29')](function(){if(!_[_0x821f('0x93')](_0x15464f)){return _0x4cf0b4[_0x821f('0x94')](_0x15464f,{'transaction':_0x2791b8})[_0x821f('0x29')](function(){return db['UserVoiceQueueRt'][_0x821f('0x2a')]({'where':{'VoiceQueueId':_0x4c3d2e['params']['id'],'UserId':_0x15464f},'transaction':_0x2791b8});});}})[_0x821f('0x29')](function(){_0x15464f[_0x821f('0x76')](function(_0x4be45d){socket[_0x821f('0x95')]('userVoiceQueue:remove',{'UserId':_0x4be45d,'VoiceQueueId':_0x4cf0b4['id']});});});});});});})[_0x821f('0x29')](respondWithStatusCode(_0x130ec6,null))[_0x821f('0x56')](handleError(_0x130ec6,null));};exports[_0x821f('0x96')]=function(_0x2eb683,_0x5e4be7,_0x152c44){var _0xee0894,_0x1c5a37;return db[_0x821f('0x38')][_0x821f('0x33')]({'where':{'id':_0x2eb683[_0x821f('0x59')]['id']}})[_0x821f('0x29')](handleEntityNotFound(_0x5e4be7,null))[_0x821f('0x29')](function(_0x47ad69){if(_0x47ad69){_0x1c5a37=_0x47ad69;return _0x47ad69['addAgents'](_0x2eb683[_0x821f('0x50')][_0x821f('0x92')],_[_0x821f('0x5b')](_0x2eb683[_0x821f('0x50')],['ids','id'])||{})[_0x821f('0x97')](function(_0x56fd81){for(var _0x46532f=0x0;_0x46532f<_0x2eb683[_0x821f('0x50')][_0x821f('0x92')][_0x821f('0x4e')];_0x46532f+=0x1){socket[_0x821f('0x95')](_0x821f('0x80'),{'UserId':_0x2eb683[_0x821f('0x50')][_0x821f('0x92')][_0x46532f],'VoiceQueueId':_0x2eb683[_0x821f('0x59')]['id']});}return _0x56fd81;});}})['then'](function(_0x48280e){_0xee0894=_0x48280e||[];if(_0x1c5a37){return db['User'][_0x821f('0x65')]({'where':{'id':_0x2eb683[_0x821f('0x50')]['ids']},'attributes':['id',_0x821f('0x34'),_0x821f('0x72'),_0x821f('0x73'),_0x821f('0x74')],'raw':!![]});}})[_0x821f('0x29')](function(_0x56b446){if(!_['isEmpty'](_0x56b446)){var _0x3ed2c5=[];for(var _0x4a40f6=0x0;_0x4a40f6<_0x56b446['length'];_0x4a40f6++){if(_0x56b446[_0x4a40f6][_0x821f('0x72')]){_0x3ed2c5[_0x821f('0x8a')](db['UserVoiceQueueRt']['upsert']({'membername':_0x56b446[_0x4a40f6][_0x821f('0x34')],'UserId':_0x56b446[_0x4a40f6]['id'],'queue_name':_0x1c5a37[_0x821f('0x34')],'VoiceQueueId':_0x1c5a37['id'],'interface':_[_0x821f('0x7e')](_0x56b446[_0x4a40f6]['interface'])?util[_0x821f('0x98')](_0x821f('0x7f'),_0x56b446[_0x4a40f6]['name']):_0x56b446[_0x4a40f6][_0x821f('0x74')],'paused':_0x56b446[_0x4a40f6][_0x821f('0x73')]||![],'penalty':_0x2eb683['body'][_0x821f('0x77')]||0x0}));}}return BPromise[_0x821f('0x99')](_0x3ed2c5);}})['then'](function(){return _0xee0894;})[_0x821f('0x29')](respondWithResult(_0x5e4be7,null))['catch'](handleError(_0x5e4be7,null));};exports[_0x821f('0x94')]=function(_0x31ea09,_0xdf8080,_0x1e6dc1){return db[_0x821f('0x38')][_0x821f('0x33')]({'where':{'id':_0x31ea09[_0x821f('0x59')]['id']}})[_0x821f('0x29')](handleEntityNotFound(_0xdf8080,null))['then'](function(_0x1a0680){if(_0x1a0680){return _0x1a0680['removeAgents'](_0x31ea09['query'][_0x821f('0x92')])['then'](function(){if(_[_0x821f('0x9a')](_0x31ea09['query'][_0x821f('0x92')])){for(var _0x7999a=0x0;_0x7999a<_0x31ea09['query'][_0x821f('0x92')]['length'];_0x7999a+=0x1){socket[_0x821f('0x95')](_0x821f('0x9b'),{'UserId':Number(_0x31ea09[_0x821f('0x3d')]['ids'][_0x7999a]),'VoiceQueueId':Number(_0x31ea09[_0x821f('0x59')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x31ea09['query'][_0x821f('0x92')]),'VoiceQueueId':Number(_0x31ea09[_0x821f('0x59')]['id'])});}});}})[_0x821f('0x29')](function(_0x12a9e6){return db[_0x821f('0x7c')][_0x821f('0x2a')]({'where':{'VoiceQueueId':_0x31ea09[_0x821f('0x59')]['id'],'UserId':_0x31ea09[_0x821f('0x3d')][_0x821f('0x92')]}})[_0x821f('0x29')](function(){return _0x12a9e6;});})[_0x821f('0x29')](respondWithStatusCode(_0xdf8080,null))[_0x821f('0x56')](handleError(_0xdf8080,null));};exports['getAgents']=function(_0x2c189a,_0xb40c8c,_0x5e656d){var _0x6d1bdd={};var _0x1eab97={};var _0x4f5eb9;var _0x409a97;return db[_0x821f('0x38')][_0x821f('0x61')]({'where':{'id':_0x2c189a[_0x821f('0x59')]['id']}})[_0x821f('0x29')](handleEntityNotFound(_0xb40c8c,null))[_0x821f('0x29')](function(_0x4e90c9){if(_0x4e90c9){_0x4f5eb9=_0x4e90c9;_0x1eab97[_0x821f('0x3b')]=_[_0x821f('0x3c')](db['User'][_0x821f('0x39')]);_0x1eab97[_0x821f('0x3d')]=_[_0x821f('0x3c')](_0x2c189a[_0x821f('0x3d')]);_0x1eab97[_0x821f('0x3e')]=_['intersection'](_0x1eab97[_0x821f('0x3b')],_0x1eab97[_0x821f('0x3d')]);_0x6d1bdd[_0x821f('0x40')]=_[_0x821f('0x3f')](_0x1eab97[_0x821f('0x3b')],qs[_0x821f('0x41')](_0x2c189a[_0x821f('0x3d')][_0x821f('0x41')]));_0x6d1bdd[_0x821f('0x40')]=_0x6d1bdd[_0x821f('0x40')][_0x821f('0x4e')]?_0x6d1bdd[_0x821f('0x40')]:_0x1eab97[_0x821f('0x3b')];_0x6d1bdd['order']=qs[_0x821f('0x44')](_0x2c189a[_0x821f('0x3d')][_0x821f('0x44')]);_0x6d1bdd[_0x821f('0x47')]=qs[_0x821f('0x3e')](_['pick'](_0x2c189a[_0x821f('0x3d')],_0x1eab97[_0x821f('0x3e')]));if(_0x2c189a['query'][_0x821f('0x46')]){_0x6d1bdd['where']=_[_0x821f('0x48')](_0x6d1bdd[_0x821f('0x47')],{'$or':_[_0x821f('0x30')](_0x6d1bdd[_0x821f('0x40')],function(_0xb1efc6){var _0x20f9b7={};_0x20f9b7[_0xb1efc6]={'$like':'%'+_0x2c189a['query']['filter']+'%'};return _0x20f9b7;})});}_0x6d1bdd=_[_0x821f('0x48')]({},_0x6d1bdd,_0x2c189a[_0x821f('0x4a')]);return _0x4f5eb9[_0x821f('0x9c')](_0x6d1bdd);}})[_0x821f('0x29')](function(_0x491458){if(_0x491458){_0x409a97=_0x491458[_0x821f('0x4e')];if(!_0x2c189a[_0x821f('0x3d')][_0x821f('0x42')](_0x821f('0x63'))){_0x6d1bdd[_0x821f('0x23')]=qs[_0x821f('0x23')](_0x2c189a['query'][_0x821f('0x23')]);_0x6d1bdd[_0x821f('0x22')]=qs['offset'](_0x2c189a[_0x821f('0x3d')]['offset']);}return _0x4f5eb9['getAgents'](_0x6d1bdd);}})[_0x821f('0x29')](function(_0x5250a8){if(_0x5250a8){return _0x5250a8?{'count':_0x409a97,'rows':_0x5250a8}:null;}})[_0x821f('0x29')](respondWithResult(_0xb40c8c,null))[_0x821f('0x56')](handleError(_0xb40c8c,null));};exports[_0x821f('0x9d')]=function(_0xa800d9,_0x55fcb0,_0xc2def8){var _0x3ea27c={};var _0x5bb28f={};var _0x25bd07;var _0x1ede1f;return db[_0x821f('0x38')][_0x821f('0x61')]({'where':{'id':_0xa800d9[_0x821f('0x59')]['id']}})[_0x821f('0x29')](handleEntityNotFound(_0x55fcb0,null))[_0x821f('0x29')](function(_0x4cba09){if(_0x4cba09){_0x25bd07=_0x4cba09;_0x5bb28f[_0x821f('0x3b')]=_[_0x821f('0x3c')](db[_0x821f('0x7c')]['rawAttributes']);_0x5bb28f[_0x821f('0x3d')]=_[_0x821f('0x3c')](_0xa800d9[_0x821f('0x3d')]);_0x5bb28f[_0x821f('0x3e')]=_[_0x821f('0x3f')](_0x5bb28f[_0x821f('0x3b')],_0x5bb28f[_0x821f('0x3d')]);_0x3ea27c['attributes']=_['intersection'](_0x5bb28f[_0x821f('0x3b')],qs[_0x821f('0x41')](_0xa800d9['query'][_0x821f('0x41')]));_0x3ea27c[_0x821f('0x40')]=_0x3ea27c[_0x821f('0x40')][_0x821f('0x4e')]?_0x3ea27c[_0x821f('0x40')]:_0x5bb28f[_0x821f('0x3b')];_0x3ea27c['order']=qs[_0x821f('0x44')](_0xa800d9[_0x821f('0x3d')][_0x821f('0x44')]);_0x3ea27c[_0x821f('0x47')]=qs['filters'](_[_0x821f('0x45')](_0xa800d9[_0x821f('0x3d')],_0x5bb28f['filters']));if(_0xa800d9[_0x821f('0x3d')][_0x821f('0x46')]){_0x3ea27c[_0x821f('0x47')]=_[_0x821f('0x48')](_0x3ea27c[_0x821f('0x47')],{'$or':_[_0x821f('0x30')](_0x3ea27c[_0x821f('0x40')],function(_0x25d56d){var _0x542d31={};_0x542d31[_0x25d56d]={'$like':'%'+_0xa800d9['query']['filter']+'%'};return _0x542d31;})});}_0x3ea27c=_[_0x821f('0x48')]({},_0x3ea27c,_0xa800d9[_0x821f('0x4a')]);return _0x25bd07[_0x821f('0x9d')](_0x3ea27c);}})[_0x821f('0x29')](function(_0x3ef5c9){if(_0x3ef5c9){_0x1ede1f=_0x3ef5c9[_0x821f('0x4e')];if(!_0xa800d9[_0x821f('0x3d')][_0x821f('0x42')](_0x821f('0x63'))){_0x3ea27c[_0x821f('0x23')]=qs[_0x821f('0x23')](_0xa800d9[_0x821f('0x3d')][_0x821f('0x23')]);_0x3ea27c['offset']=qs[_0x821f('0x22')](_0xa800d9['query']['offset']);}return _0x25bd07['getMembers'](_0x3ea27c);}})[_0x821f('0x29')](function(_0x5e50ad){return _0x5e50ad?{'count':_0x1ede1f,'rows':_0x5e50ad}:null;})['then'](respondWithResult(_0x55fcb0,null))['catch'](handleError(_0x55fcb0,null));};exports[_0x821f('0x9e')]=function(_0x2e305d,_0xd1cb3f,_0x460454){var _0x3d0672={};var _0x48e34b={};var _0x26beaa;var _0x4e666e;return db[_0x821f('0x38')][_0x821f('0x61')]({'where':{'id':_0x2e305d[_0x821f('0x59')]['id']}})[_0x821f('0x29')](handleEntityNotFound(_0xd1cb3f,null))['then'](function(_0x4e85d5){if(_0x4e85d5){_0x26beaa=_0x4e85d5;_0x48e34b[_0x821f('0x3b')]=_[_0x821f('0x3c')](db[_0x821f('0x9f')][_0x821f('0x39')]);_0x48e34b[_0x821f('0x3d')]=_['keys'](_0x2e305d[_0x821f('0x3d')]);_0x48e34b[_0x821f('0x3e')]=_[_0x821f('0x3f')](_0x48e34b['model'],_0x48e34b[_0x821f('0x3d')]);_0x3d0672['attributes']=_[_0x821f('0x3f')](_0x48e34b[_0x821f('0x3b')],qs[_0x821f('0x41')](_0x2e305d[_0x821f('0x3d')][_0x821f('0x41')]));_0x3d0672['attributes']=_0x3d0672[_0x821f('0x40')][_0x821f('0x4e')]?_0x3d0672[_0x821f('0x40')]:_0x48e34b[_0x821f('0x3b')];_0x3d0672[_0x821f('0x43')]=qs['sort'](_0x2e305d['query']['sort']);_0x3d0672['where']=qs[_0x821f('0x3e')](_[_0x821f('0x45')](_0x2e305d[_0x821f('0x3d')],_0x48e34b[_0x821f('0x3e')]));if(_0x2e305d[_0x821f('0x3d')][_0x821f('0x46')]){_0x3d0672[_0x821f('0x47')]=_[_0x821f('0x48')](_0x3d0672[_0x821f('0x47')],{'$or':_['map'](_0x3d0672[_0x821f('0x40')],function(_0x5a5a97){var _0x586118={};_0x586118[_0x5a5a97]={'$like':'%'+_0x2e305d[_0x821f('0x3d')][_0x821f('0x46')]+'%'};return _0x586118;})});}_0x3d0672=_[_0x821f('0x48')]({},_0x3d0672,_0x2e305d[_0x821f('0x4a')]);return _0x26beaa[_0x821f('0x9e')](_0x3d0672);}})[_0x821f('0x29')](function(_0x7c3a34){if(_0x7c3a34){_0x4e666e=_0x7c3a34[_0x821f('0x4e')];if(!_0x2e305d['query'][_0x821f('0x42')](_0x821f('0x63'))){_0x3d0672[_0x821f('0x23')]=qs['limit'](_0x2e305d[_0x821f('0x3d')]['limit']);_0x3d0672[_0x821f('0x22')]=qs[_0x821f('0x22')](_0x2e305d['query'][_0x821f('0x22')]);}return _0x26beaa[_0x821f('0x9e')](_0x3d0672);}})['then'](function(_0x2157ab){if(_0x2157ab){return _0x2157ab?{'count':_0x4e666e,'rows':_0x2157ab}:null;}})[_0x821f('0x29')](respondWithResult(_0xd1cb3f,null))['catch'](handleError(_0xd1cb3f,null));};exports['addLists']=function(_0x426d58,_0x28e4ff,_0x10a53e){var _0x42bec1,_0x2fd4e1;return db[_0x821f('0x38')]['find']({'where':{'id':_0x426d58['params']['id']}})[_0x821f('0x29')](handleEntityNotFound(_0x28e4ff,null))[_0x821f('0x29')](function(_0x2fb1cc){if(_0x2fb1cc){_0x2fd4e1=_0x2fb1cc;return _0x2fb1cc[_0x821f('0xa0')](_0x426d58['body'][_0x821f('0x92')],_['omit'](_0x426d58[_0x821f('0x50')],[_0x821f('0x92'),'id'])||{});}return null;})['spread'](function(_0x2be188){var _0x5a97dc;_0x42bec1=_0x2be188||[];var _0x24259c=[];if(_0x2be188){for(var _0x58740d=0x0;_0x58740d<_0x2be188[_0x821f('0x4e')];_0x58740d+=0x1){var _0x2d5149=_0x2be188[_0x58740d][_0x821f('0x2b')]({'plain':!![]});_0x2fd4e1[_0x821f('0xa1')]=_0x426d58[_0x821f('0x50')][_0x821f('0xa1')]?_0x426d58[_0x821f('0x50')][_0x821f('0xa1')]:_0x2fd4e1[_0x821f('0xa1')];switch(_0x2fd4e1[_0x821f('0xa1')]){case _0x821f('0xa2'):_0x5a97dc=squel['insert']()['into']('cm_hopper')[_0x821f('0xa3')]([_0x821f('0xa4'),_0x821f('0xa5'),_0x821f('0xa6'),_0x821f('0xa7'),_0x821f('0x64'),'createdAt',_0x821f('0x5d')],squel['select']()[_0x821f('0xa8')]('phone',_0x821f('0xa4'))['field']('NOW()',_0x821f('0xa5'))['field']('id','ContactId')[_0x821f('0xa8')](_0x2d5149[_0x821f('0xa9')][_0x821f('0xaa')](),'ListId')[_0x821f('0xa8')](_0x426d58[_0x821f('0x59')]['id'][_0x821f('0xaa')](),_0x821f('0x64'))[_0x821f('0xa8')](_0x821f('0xab'),_0x821f('0x5c'))['field'](_0x821f('0xab'),_0x821f('0x5d'))['from']('cm_contacts')[_0x821f('0x47')](_0x821f('0xac'))[_0x821f('0x47')](_0x821f('0xad'),_0x2d5149['CmListId'][_0x821f('0xaa')]())[_0x821f('0x47')](_0x821f('0xae'))[_0x821f('0x47')](_0x821f('0xaf'),squel['select']()[_0x821f('0xa8')]('COALESCE(calleridnum,\x27\x27)')[_0x821f('0x84')]('cm_hopper_final')['where']('VoiceQueueId\x20=\x20?',_0x426d58['params']['id'][_0x821f('0xaa')]()))[_0x821f('0x47')]('phone\x20NOT\x20IN\x20(?)',squel[_0x821f('0x82')]()[_0x821f('0xa8')]('COALESCE(phone,\x27\x27)')['from'](_0x821f('0xb0'))[_0x821f('0x47')](_0x821f('0x88'),_0x426d58[_0x821f('0x59')]['id']['toString']())))[_0x821f('0xaa')]();break;case _0x821f('0xb1'):_0x5a97dc=squel[_0x821f('0xb2')]()[_0x821f('0xb3')](_0x821f('0xb0'))['fromQuery']([_0x821f('0xa4'),'scheduledAt',_0x821f('0xa6'),'ListId','VoiceQueueId',_0x821f('0x5c'),'updatedAt'],squel[_0x821f('0x82')]()['field'](_0x821f('0xa4'),_0x821f('0xa4'))[_0x821f('0xa8')](_0x821f('0xab'),_0x821f('0xa5'))[_0x821f('0xa8')]('id',_0x821f('0xa6'))[_0x821f('0xa8')](_0x2d5149['CmListId']['toString'](),_0x821f('0xa7'))[_0x821f('0xa8')](_0x426d58['params']['id'][_0x821f('0xaa')](),_0x821f('0x64'))[_0x821f('0xa8')]('NOW()',_0x821f('0x5c'))[_0x821f('0xa8')](_0x821f('0xab'),_0x821f('0x5d'))[_0x821f('0x84')](_0x821f('0xb4'))['where'](_0x821f('0xac'))[_0x821f('0x47')]('ListId\x20=\x20?',_0x2d5149['CmListId'][_0x821f('0xaa')]())[_0x821f('0x47')](_0x821f('0xae'))[_0x821f('0x47')]('phone\x20NOT\x20IN\x20(?)',squel[_0x821f('0x82')]()[_0x821f('0xa8')](_0x821f('0xb5'))[_0x821f('0x84')](_0x821f('0xb0'))[_0x821f('0x47')](_0x821f('0x88'),_0x426d58[_0x821f('0x59')]['id']['toString']())))[_0x821f('0xaa')]();break;default:_0x5a97dc=squel[_0x821f('0xb2')]()[_0x821f('0xb3')]('cm_hopper')['fromQuery']([_0x821f('0xa4'),_0x821f('0xa5'),_0x821f('0xa6'),_0x821f('0xa7'),_0x821f('0x64'),'createdAt',_0x821f('0x5d')],squel[_0x821f('0x82')]()[_0x821f('0xa8')](_0x821f('0xa4'),_0x821f('0xa4'))[_0x821f('0xa8')](_0x821f('0xab'),_0x821f('0xa5'))[_0x821f('0xa8')]('id',_0x821f('0xa6'))['field'](_0x2d5149[_0x821f('0xa9')][_0x821f('0xaa')](),_0x821f('0xa7'))['field'](_0x426d58['params']['id']['toString'](),_0x821f('0x64'))[_0x821f('0xa8')](_0x821f('0xab'),'createdAt')[_0x821f('0xa8')](_0x821f('0xab'),'updatedAt')[_0x821f('0x84')](_0x821f('0xb4'))['where'](_0x821f('0xac'))[_0x821f('0x47')](_0x821f('0xad'),_0x2d5149[_0x821f('0xa9')]['toString']())['where'](_0x821f('0xae')))['toString']();}_0x24259c[_0x821f('0x8a')](db['sequelize'][_0x821f('0x3d')](_0x5a97dc));}return BPromise[_0x821f('0x99')](_0x24259c);}})[_0x821f('0x29')](function(){return _0x42bec1;})[_0x821f('0x29')](respondWithResult(_0x28e4ff,null))['catch'](handleError(_0x28e4ff,null));};exports['removeLists']=function(_0x5e5559,_0x3e05ab,_0x30a5dc){return db[_0x821f('0x38')][_0x821f('0x33')]({'where':{'id':_0x5e5559['params']['id']}})['then'](handleEntityNotFound(_0x3e05ab,null))[_0x821f('0x29')](function(_0xe8eede){if(_0xe8eede){return _0xe8eede['removeLists'](_0x5e5559[_0x821f('0x3d')]['ids']);}})[_0x821f('0x29')](function(_0x3111c1){if(_0x3111c1){return db[_0x821f('0x62')][_0x821f('0x2a')]({'where':{'ListId':_0x5e5559['query'][_0x821f('0x92')],'VoiceQueueId':_0x5e5559[_0x821f('0x59')]['id']}})[_0x821f('0x29')](function(){return _0x3111c1;});}})[_0x821f('0x29')](respondWithStatusCode(_0x3e05ab,null))[_0x821f('0x56')](handleError(_0x3e05ab,null));};exports['getBlackLists']=function(_0x1b1e8e,_0x152cfc,_0x198678){var _0x2aa7e2={};var _0x356ef9={};var _0x171e76;var _0x576226;return db['VoiceQueue'][_0x821f('0x61')]({'where':{'id':_0x1b1e8e['params']['id']}})[_0x821f('0x29')](handleEntityNotFound(_0x152cfc,null))[_0x821f('0x29')](function(_0x38992e){if(_0x38992e){_0x171e76=_0x38992e;_0x356ef9[_0x821f('0x3b')]=_[_0x821f('0x3c')](db[_0x821f('0x9f')][_0x821f('0x39')]);_0x356ef9['query']=_[_0x821f('0x3c')](_0x1b1e8e[_0x821f('0x3d')]);_0x356ef9[_0x821f('0x3e')]=_['intersection'](_0x356ef9[_0x821f('0x3b')],_0x356ef9[_0x821f('0x3d')]);_0x2aa7e2[_0x821f('0x40')]=_[_0x821f('0x3f')](_0x356ef9[_0x821f('0x3b')],qs[_0x821f('0x41')](_0x1b1e8e['query'][_0x821f('0x41')]));_0x2aa7e2[_0x821f('0x40')]=_0x2aa7e2[_0x821f('0x40')][_0x821f('0x4e')]?_0x2aa7e2[_0x821f('0x40')]:_0x356ef9['model'];_0x2aa7e2[_0x821f('0x43')]=qs[_0x821f('0x44')](_0x1b1e8e['query'][_0x821f('0x44')]);_0x2aa7e2[_0x821f('0x47')]=qs[_0x821f('0x3e')](_[_0x821f('0x45')](_0x1b1e8e[_0x821f('0x3d')],_0x356ef9['filters']));if(_0x1b1e8e[_0x821f('0x3d')][_0x821f('0x46')]){_0x2aa7e2[_0x821f('0x47')]=_[_0x821f('0x48')](_0x2aa7e2[_0x821f('0x47')],{'$or':_[_0x821f('0x30')](_0x2aa7e2['attributes'],function(_0x4949b8){var _0x4aa71e={};_0x4aa71e[_0x4949b8]={'$like':'%'+_0x1b1e8e[_0x821f('0x3d')]['filter']+'%'};return _0x4aa71e;})});}_0x2aa7e2=_['merge']({},_0x2aa7e2,_0x1b1e8e[_0x821f('0x4a')]);return _0x171e76['getBlackLists'](_0x2aa7e2);}})['then'](function(_0x36f171){if(_0x36f171){_0x576226=_0x36f171['length'];if(!_0x1b1e8e['query'][_0x821f('0x42')](_0x821f('0x63'))){_0x2aa7e2['limit']=qs[_0x821f('0x23')](_0x1b1e8e[_0x821f('0x3d')][_0x821f('0x23')]);_0x2aa7e2[_0x821f('0x22')]=qs['offset'](_0x1b1e8e[_0x821f('0x3d')][_0x821f('0x22')]);}return _0x171e76[_0x821f('0xb6')](_0x2aa7e2);}})[_0x821f('0x29')](function(_0x32988c){if(_0x32988c){return _0x32988c?{'count':_0x576226,'rows':_0x32988c}:null;}})['then'](respondWithResult(_0x152cfc,null))['catch'](handleError(_0x152cfc,null));};exports['addBlackLists']=function(_0x4de7bc,_0x211683,_0x2f51e4){var _0x555b46,_0x2de238;return db[_0x821f('0x38')][_0x821f('0x33')]({'where':{'id':_0x4de7bc[_0x821f('0x59')]['id']}})[_0x821f('0x29')](handleEntityNotFound(_0x211683,null))[_0x821f('0x29')](function(_0x33ae71){if(_0x33ae71){_0x2de238=_0x33ae71;return _0x33ae71['addBlackLists'](_0x4de7bc['body'][_0x821f('0x92')],_[_0x821f('0x5b')](_0x4de7bc[_0x821f('0x50')],['ids','id'])||{});}return null;})[_0x821f('0x97')](function(_0x2c0587){var _0x365bad;_0x555b46=_0x2c0587||[];var _0xbccf19=[];if(_0x2c0587){for(var _0x50a165=0x0;_0x50a165<_0x2c0587[_0x821f('0x4e')];_0x50a165+=0x1){var _0x1a6c52=_0x2c0587[_0x50a165][_0x821f('0x2b')]({'plain':!![]});_0x365bad=squel[_0x821f('0xb2')]()[_0x821f('0xb3')](_0x821f('0xb7'))[_0x821f('0xa3')]([_0x821f('0xa4'),_0x821f('0xa6'),'ListId',_0x821f('0x64'),_0x821f('0x5c'),'updatedAt'],squel['select']()['field'](_0x821f('0xa4'),_0x821f('0xa4'))[_0x821f('0xa8')]('id',_0x821f('0xa6'))[_0x821f('0xa8')](_0x1a6c52[_0x821f('0xa9')][_0x821f('0xaa')](),_0x821f('0xa7'))[_0x821f('0xa8')](_0x4de7bc[_0x821f('0x59')]['id'][_0x821f('0xaa')](),_0x821f('0x64'))[_0x821f('0xa8')]('NOW()','createdAt')[_0x821f('0xa8')]('NOW()',_0x821f('0x5d'))[_0x821f('0x84')](_0x821f('0xb4'))[_0x821f('0x47')](_0x821f('0xac'))['where']('ListId\x20=\x20?',_0x1a6c52[_0x821f('0xa9')][_0x821f('0xaa')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x821f('0xaa')]();_0xbccf19[_0x821f('0x8a')](db['sequelize'][_0x821f('0x3d')](_0x365bad));}return BPromise[_0x821f('0x99')](_0xbccf19);}})['then'](function(){return _0x555b46;})[_0x821f('0x29')](respondWithResult(_0x211683,null))['catch'](handleError(_0x211683,null));};exports[_0x821f('0xb8')]=function(_0x18c468,_0x48c7b7,_0x273bb2){return db[_0x821f('0x38')]['find']({'where':{'id':_0x18c468['params']['id']}})['then'](handleEntityNotFound(_0x48c7b7,null))[_0x821f('0x29')](function(_0x566cf5){if(_0x566cf5){return _0x566cf5[_0x821f('0xb8')](_0x18c468[_0x821f('0x3d')][_0x821f('0x92')]);}})[_0x821f('0x29')](function(_0x16daed){if(_0x16daed){return db[_0x821f('0x6b')][_0x821f('0x2a')]({'where':{'ListId':_0x18c468['query'][_0x821f('0x92')],'VoiceQueueId':_0x18c468[_0x821f('0x59')]['id']}})[_0x821f('0x29')](function(){return _0x16daed;});}})[_0x821f('0x29')](respondWithStatusCode(_0x48c7b7,null))['catch'](handleError(_0x48c7b7,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index b71e14d..91f1444 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 _0x5537=['save','emit','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x255fe6,_0x49d7cf){var _0x42051c=function(_0x468866){while(--_0x468866){_0x255fe6['push'](_0x255fe6['shift']());}};_0x42051c(++_0x49d7cf);}(_0x5537,0x12e));var _0x7553=function(_0x4dd1b3,_0x4ec057){_0x4dd1b3=_0x4dd1b3-0x0;var _0x3495af=_0x5537[_0x4dd1b3];return _0x3495af;};'use strict';var EventEmitter=require(_0x7553('0x0'));var VoiceQueue=require(_0x7553('0x1'))['db'][_0x7553('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x7553('0x3')](0x0);var events={'afterCreate':_0x7553('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4f96cb){return function(_0x47cd81,_0x1a47b1,_0x24f62f){VoiceQueueEvents['emit'](_0x4f96cb+':'+_0x47cd81['id'],_0x47cd81);VoiceQueueEvents[_0x7553('0x5')](_0x4f96cb,_0x47cd81);_0x24f62f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x9dfc=['VoiceQueue','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x9dfc,0xdf));var _0xc9df=function(_0x772ceb,_0x3c2dc5){_0x772ceb=_0x772ceb-0x0;var _0x14e448=_0x9dfc[_0x772ceb];return _0x14e448;};'use strict';var EventEmitter=require(_0xc9df('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xc9df('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc9df('0x2')](0x0);var events={'afterCreate':_0xc9df('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5dff5c){return function(_0x131e70,_0x334b32,_0xcc6d49){VoiceQueueEvents[_0xc9df('0x4')](_0x5dff5c+':'+_0x131e70['id'],_0x131e70);VoiceQueueEvents['emit'](_0x5dff5c,_0x131e70);_0xcc6d49(null);};}for(var e in events){if(events[_0xc9df('0x5')](e)){var event=events[e];VoiceQueue[_0xc9df('0x6')](e,emitEvent(event));}}module[_0xc9df('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 2e12f4d..cc5224d 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 _0x298c=['api','bluebird','request-promise','rimraf','../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','voice_queues','util','../../config/logger'];(function(_0x950fdd,_0x13acd2){var _0x230cfa=function(_0x34db66){while(--_0x34db66){_0x950fdd['push'](_0x950fdd['shift']());}};_0x230cfa(++_0x13acd2);}(_0x298c,0x9a));var _0xc298=function(_0x5c0bb7,_0x26c387){_0x5c0bb7=_0x5c0bb7-0x0;var _0x4b879b=_0x298c[_0x5c0bb7];return _0x4b879b;};'use strict';var _=require('lodash');var util=require(_0xc298('0x0'));var logger=require(_0xc298('0x1'))(_0xc298('0x2'));var moment=require('moment');var BPromise=require(_0xc298('0x3'));var rp=require(_0xc298('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc298('0x5'));var config=require(_0xc298('0x6'));var attributes=require(_0xc298('0x7'));module[_0xc298('0x8')]=function(_0x2fa815,_0x3db1da){return _0x2fa815[_0xc298('0x9')](_0xc298('0xa'),attributes,{'tableName':_0xc298('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5e3=['voice_queues','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','define'];(function(_0x3d6e4e,_0x5150e9){var _0x49d4eb=function(_0x328c36){while(--_0x328c36){_0x3d6e4e['push'](_0x3d6e4e['shift']());}};_0x49d4eb(++_0x5150e9);}(_0xb5e3,0xe2));var _0x3b5e=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0xb5e3[_0x1d50f2];return _0x3769b8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3b5e('0x0'))('api');var moment=require(_0x3b5e('0x1'));var BPromise=require('bluebird');var rp=require(_0x3b5e('0x2'));var fs=require('fs');var path=require(_0x3b5e('0x3'));var rimraf=require(_0x3b5e('0x4'));var config=require(_0x3b5e('0x5'));var attributes=require(_0x3b5e('0x6'));module['exports']=function(_0x267cc5,_0x149ba2){return _0x267cc5[_0x3b5e('0x7')]('VoiceQueue',attributes,{'tableName':_0x3b5e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 6652664..b0663a1 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 _0xce3b=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','include','map','model','ShowVoiceQueue','find','then','debug','stringify','lodash'];(function(_0x74d38e,_0x5851df){var _0x1e326d=function(_0x2e4841){while(--_0x2e4841){_0x74d38e['push'](_0x74d38e['shift']());}};_0x1e326d(++_0x5851df);}(_0xce3b,0x15f));var _0xbce3=function(_0x232707,_0x32633d){_0x232707=_0x232707-0x0;var _0x1d1adc=_0xce3b[_0x232707];return _0x1d1adc;};'use strict';var _=require(_0xbce3('0x0'));var util=require(_0xbce3('0x1'));var moment=require(_0xbce3('0x2'));var BPromise=require('bluebird');var rs=require(_0xbce3('0x3'));var fs=require('fs');var Redis=require(_0xbce3('0x4'));var db=require(_0xbce3('0x5'))['db'];var utils=require(_0xbce3('0x6'));var logger=require(_0xbce3('0x7'))(_0xbce3('0x8'));var config=require(_0xbce3('0x9'));var jayson=require(_0xbce3('0xa'));var client=jayson[_0xbce3('0xb')][_0xbce3('0xc')]({'port':0x232a});config['redis']=_[_0xbce3('0xd')](config[_0xbce3('0xe')],{'host':_0xbce3('0xf'),'port':0x18eb});var socket=require(_0xbce3('0x10'))(new Redis(config[_0xbce3('0xe')]));require(_0xbce3('0x11'))[_0xbce3('0x12')](socket);function respondWithRpcPromise(_0x29bc31,_0x105906,_0x4d9584){return new BPromise(function(_0x7b6c90,_0x1f2716){return client[_0xbce3('0x13')](_0x29bc31,_0x4d9584)['then'](function(_0x563518){logger[_0xbce3('0x14')](_0xbce3('0x15'),_0x105906,_0xbce3('0x16'));logger['debug'](_0xbce3('0x17'),_0x105906,_0xbce3('0x16'),JSON['stringify'](_0x563518));if(_0x563518['error']){if(_0x563518[_0xbce3('0x18')][_0xbce3('0x19')]===0x1f4){logger[_0xbce3('0x18')](_0xbce3('0x15'),_0x105906,_0x563518[_0xbce3('0x18')][_0xbce3('0x1a')]);return _0x1f2716(_0x563518[_0xbce3('0x18')][_0xbce3('0x1a')]);}logger['error'](_0xbce3('0x15'),_0x105906,_0x563518[_0xbce3('0x18')]['message']);return _0x7b6c90(_0x563518[_0xbce3('0x18')][_0xbce3('0x1a')]);}else{logger['info'](_0xbce3('0x15'),_0x105906,_0xbce3('0x16'));_0x7b6c90(_0x563518[_0xbce3('0x1b')][_0xbce3('0x1a')]);}})[_0xbce3('0x1c')](function(_0x10aed6){logger['error'](_0xbce3('0x15'),_0x105906,_0x10aed6);_0x1f2716(_0x10aed6);});});}exports[_0xbce3('0x1d')]=function(_0x37b3e0){var _0x572e03=this;return new Promise(function(_0x133a9e,_0x35405c){return db[_0xbce3('0x1e')][_0xbce3('0x1f')]({'raw':_0x37b3e0[_0xbce3('0x20')]?_0x37b3e0['options'][_0xbce3('0x21')]===undefined?!![]:![]:!![],'where':_0x37b3e0[_0xbce3('0x20')]?_0x37b3e0[_0xbce3('0x20')][_0xbce3('0x22')]||null:null,'attributes':_0x37b3e0['options']?_0x37b3e0[_0xbce3('0x20')][_0xbce3('0x23')]||null:null,'limit':_0x37b3e0[_0xbce3('0x20')]?_0x37b3e0[_0xbce3('0x20')]['limit']||null:null,'include':_0x37b3e0[_0xbce3('0x20')]?_0x37b3e0[_0xbce3('0x20')][_0xbce3('0x24')]?_[_0xbce3('0x25')](_0x37b3e0[_0xbce3('0x20')][_0xbce3('0x24')],function(_0x4d4bc2){return{'model':db[_0x4d4bc2[_0xbce3('0x26')]],'as':_0x4d4bc2['as'],'attributes':_0x4d4bc2['attributes'],'include':_0x4d4bc2['include']?_['map'](_0x4d4bc2['include'],function(_0x9b8ccf){return{'model':db[_0x9b8ccf[_0xbce3('0x26')]],'as':_0x9b8ccf['as'],'attributes':_0x9b8ccf[_0xbce3('0x23')],'include':_0x9b8ccf[_0xbce3('0x24')]?_[_0xbce3('0x25')](_0x9b8ccf[_0xbce3('0x24')],function(_0x384e08){return{'model':db[_0x384e08['model']],'as':_0x384e08['as'],'attributes':_0x384e08['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f6768){logger['info']('GetVoiceQueue',_0x37b3e0);logger['debug']('GetVoiceQueue',_0x37b3e0,JSON['stringify'](_0x4f6768));_0x133a9e(_0x4f6768);})['catch'](function(_0x54bed7){logger[_0xbce3('0x18')](_0xbce3('0x1d'),_0x54bed7[_0xbce3('0x1a')],_0x37b3e0);_0x35405c(_0x572e03['error'](0x1f4,_0x54bed7[_0xbce3('0x1a')]));});});};exports[_0xbce3('0x27')]=function(_0x4eaba0){var _0x9ad06=this;return new Promise(function(_0x26e294,_0x138c2d){return db[_0xbce3('0x1e')][_0xbce3('0x28')]({'raw':_0x4eaba0['options']?_0x4eaba0[_0xbce3('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x4eaba0[_0xbce3('0x20')]?_0x4eaba0[_0xbce3('0x20')]['where']||null:null,'attributes':_0x4eaba0[_0xbce3('0x20')]?_0x4eaba0[_0xbce3('0x20')][_0xbce3('0x23')]||null:null,'include':_0x4eaba0[_0xbce3('0x20')]?_0x4eaba0[_0xbce3('0x20')]['include']?_[_0xbce3('0x25')](_0x4eaba0[_0xbce3('0x20')][_0xbce3('0x24')],function(_0x3b017c){return{'model':db[_0x3b017c[_0xbce3('0x26')]],'as':_0x3b017c['as'],'attributes':_0x3b017c[_0xbce3('0x23')],'include':_0x3b017c[_0xbce3('0x24')]?_[_0xbce3('0x25')](_0x3b017c['include'],function(_0x251ebd){return{'model':db[_0x251ebd[_0xbce3('0x26')]],'as':_0x251ebd['as'],'attributes':_0x251ebd[_0xbce3('0x23')],'include':_0x251ebd['include']?_['map'](_0x251ebd[_0xbce3('0x24')],function(_0x370c01){return{'model':db[_0x370c01['model']],'as':_0x370c01['as'],'attributes':_0x370c01[_0xbce3('0x23')]};}):[]};}):[]};}):[]:[]})[_0xbce3('0x29')](function(_0x359b8b){logger[_0xbce3('0x14')](_0xbce3('0x27'),_0x4eaba0);logger[_0xbce3('0x2a')]('ShowVoiceQueue',_0x4eaba0,JSON[_0xbce3('0x2b')](_0x359b8b));_0x26e294(_0x359b8b);})[_0xbce3('0x1c')](function(_0x1fc9e3){logger[_0xbce3('0x18')]('ShowVoiceQueue',_0x1fc9e3['message'],_0x4eaba0);_0x138c2d(_0x9ad06[_0xbce3('0x18')](0x1f4,_0x1fc9e3[_0xbce3('0x1a')]));});});}; \ No newline at end of file +var _0x5697=['debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowVoiceQueue','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s'];(function(_0x4f8db0,_0xe915f4){var _0x54caaa=function(_0x325fde){while(--_0x325fde){_0x4f8db0['push'](_0x4f8db0['shift']());}};_0x54caaa(++_0xe915f4);}(_0x5697,0x64));var _0x7569=function(_0x4d2c26,_0x2701f9){_0x4d2c26=_0x4d2c26-0x0;var _0x5bf9b4=_0x5697[_0x4d2c26];return _0x5bf9b4;};'use strict';var _=require(_0x7569('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7569('0x1'));var rs=require(_0x7569('0x2'));var fs=require('fs');var Redis=require(_0x7569('0x3'));var db=require(_0x7569('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7569('0x5'))(_0x7569('0x6'));var config=require(_0x7569('0x7'));var jayson=require(_0x7569('0x8'));var client=jayson[_0x7569('0x9')]['http']({'port':0x232a});config[_0x7569('0xa')]=_[_0x7569('0xb')](config[_0x7569('0xa')],{'host':_0x7569('0xc'),'port':0x18eb});var socket=require(_0x7569('0xd'))(new Redis(config[_0x7569('0xa')]));require(_0x7569('0xe'))[_0x7569('0xf')](socket);function respondWithRpcPromise(_0x3b18ec,_0x52cd56,_0x59ddad){return new BPromise(function(_0x40bd95,_0x4bd48f){return client[_0x7569('0x10')](_0x3b18ec,_0x59ddad)[_0x7569('0x11')](function(_0x1b5a3e){logger[_0x7569('0x12')](_0x7569('0x13'),_0x52cd56,'request\x20sent');logger[_0x7569('0x14')](_0x7569('0x15'),_0x52cd56,_0x7569('0x16'),JSON[_0x7569('0x17')](_0x1b5a3e));if(_0x1b5a3e['error']){if(_0x1b5a3e[_0x7569('0x18')][_0x7569('0x19')]===0x1f4){logger[_0x7569('0x18')]('VoiceQueue,\x20%s,\x20%s',_0x52cd56,_0x1b5a3e['error']['message']);return _0x4bd48f(_0x1b5a3e['error'][_0x7569('0x1a')]);}logger[_0x7569('0x18')](_0x7569('0x13'),_0x52cd56,_0x1b5a3e[_0x7569('0x18')][_0x7569('0x1a')]);return _0x40bd95(_0x1b5a3e[_0x7569('0x18')][_0x7569('0x1a')]);}else{logger[_0x7569('0x12')](_0x7569('0x13'),_0x52cd56,_0x7569('0x16'));_0x40bd95(_0x1b5a3e['result'][_0x7569('0x1a')]);}})['catch'](function(_0x422423){logger[_0x7569('0x18')](_0x7569('0x13'),_0x52cd56,_0x422423);_0x4bd48f(_0x422423);});});}exports[_0x7569('0x1b')]=function(_0x27aed8){var _0x323736=this;return new Promise(function(_0x5130b8,_0x517982){return db[_0x7569('0x1c')][_0x7569('0x1d')]({'raw':_0x27aed8[_0x7569('0x1e')]?_0x27aed8[_0x7569('0x1e')][_0x7569('0x1f')]===undefined?!![]:![]:!![],'where':_0x27aed8[_0x7569('0x1e')]?_0x27aed8['options'][_0x7569('0x20')]||null:null,'attributes':_0x27aed8[_0x7569('0x1e')]?_0x27aed8[_0x7569('0x1e')][_0x7569('0x21')]||null:null,'limit':_0x27aed8[_0x7569('0x1e')]?_0x27aed8['options'][_0x7569('0x22')]||null:null,'include':_0x27aed8['options']?_0x27aed8['options']['include']?_['map'](_0x27aed8[_0x7569('0x1e')][_0x7569('0x23')],function(_0x113c6c){return{'model':db[_0x113c6c['model']],'as':_0x113c6c['as'],'attributes':_0x113c6c[_0x7569('0x21')],'include':_0x113c6c[_0x7569('0x23')]?_[_0x7569('0x24')](_0x113c6c[_0x7569('0x23')],function(_0x5b64c1){return{'model':db[_0x5b64c1['model']],'as':_0x5b64c1['as'],'attributes':_0x5b64c1['attributes'],'include':_0x5b64c1[_0x7569('0x23')]?_['map'](_0x5b64c1[_0x7569('0x23')],function(_0x5b6d17){return{'model':db[_0x5b6d17[_0x7569('0x25')]],'as':_0x5b6d17['as'],'attributes':_0x5b6d17['attributes']};}):[]};}):[]};}):[]:[]})[_0x7569('0x11')](function(_0x128f1d){logger[_0x7569('0x12')](_0x7569('0x1b'),_0x27aed8);logger[_0x7569('0x14')](_0x7569('0x1b'),_0x27aed8,JSON[_0x7569('0x17')](_0x128f1d));_0x5130b8(_0x128f1d);})[_0x7569('0x26')](function(_0x3a8c26){logger[_0x7569('0x18')](_0x7569('0x1b'),_0x3a8c26[_0x7569('0x1a')],_0x27aed8);_0x517982(_0x323736[_0x7569('0x18')](0x1f4,_0x3a8c26[_0x7569('0x1a')]));});});};exports[_0x7569('0x27')]=function(_0xcddf8f){var _0x19ceb6=this;return new Promise(function(_0x45b386,_0x18f215){return db[_0x7569('0x1c')]['find']({'raw':_0xcddf8f['options']?_0xcddf8f[_0x7569('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xcddf8f['options']?_0xcddf8f[_0x7569('0x1e')][_0x7569('0x20')]||null:null,'attributes':_0xcddf8f['options']?_0xcddf8f[_0x7569('0x1e')][_0x7569('0x21')]||null:null,'include':_0xcddf8f[_0x7569('0x1e')]?_0xcddf8f[_0x7569('0x1e')]['include']?_[_0x7569('0x24')](_0xcddf8f[_0x7569('0x1e')][_0x7569('0x23')],function(_0x4f4962){return{'model':db[_0x4f4962[_0x7569('0x25')]],'as':_0x4f4962['as'],'attributes':_0x4f4962[_0x7569('0x21')],'include':_0x4f4962['include']?_[_0x7569('0x24')](_0x4f4962[_0x7569('0x23')],function(_0x4f72e9){return{'model':db[_0x4f72e9[_0x7569('0x25')]],'as':_0x4f72e9['as'],'attributes':_0x4f72e9[_0x7569('0x21')],'include':_0x4f72e9[_0x7569('0x23')]?_[_0x7569('0x24')](_0x4f72e9['include'],function(_0x54f3f0){return{'model':db[_0x54f3f0[_0x7569('0x25')]],'as':_0x54f3f0['as'],'attributes':_0x54f3f0[_0x7569('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7569('0x11')](function(_0x52d8a2){logger[_0x7569('0x12')](_0x7569('0x27'),_0xcddf8f);logger[_0x7569('0x14')]('ShowVoiceQueue',_0xcddf8f,JSON[_0x7569('0x17')](_0x52d8a2));_0x45b386(_0x52d8a2);})[_0x7569('0x26')](function(_0x463f87){logger[_0x7569('0x18')]('ShowVoiceQueue',_0x463f87[_0x7569('0x1a')],_0xcddf8f);_0x18f215(_0x19ceb6['error'](0x1f4,_0x463f87['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index fba4681..4e7cdb6 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 _0x8ae0=['removeListener','./voiceQueue.events','save','remove','update','emit'];(function(_0x1443d5,_0x21f839){var _0x3f8e34=function(_0x5e1263){while(--_0x5e1263){_0x1443d5['push'](_0x1443d5['shift']());}};_0x3f8e34(++_0x21f839);}(_0x8ae0,0x115));var _0x08ae=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8ae0[_0x160c73];return _0xd9302;};'use strict';var VoiceQueueEvents=require(_0x08ae('0x0'));var events=[_0x08ae('0x1'),_0x08ae('0x2'),_0x08ae('0x3')];function createListener(_0x10e675,_0x4aa6cd){return function(_0xc46c4e){_0x4aa6cd[_0x08ae('0x4')](_0x10e675,_0xc46c4e);};}function removeListener(_0x3ab802,_0x3bf6fb){return function(){VoiceQueueEvents[_0x08ae('0x5')](_0x3ab802,_0x3bf6fb);};}exports['register']=function(_0x3dc64c){for(var _0x103973=0x0,_0x14ece5=events['length'];_0x103973<_0x14ece5;_0x103973++){var _0x16b61f=events[_0x103973];var _0x5880de=createListener('voiceQueue:'+_0x16b61f,_0x3dc64c);VoiceQueueEvents['on'](_0x16b61f,_0x5880de);}}; \ No newline at end of file +var _0xcd89=['update','emit','removeListener','register','voiceQueue:','save','remove'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0xcd89,0x67));var _0x9cd8=function(_0x559eb5,_0x121843){_0x559eb5=_0x559eb5-0x0;var _0x3e12ff=_0xcd89[_0x559eb5];return _0x3e12ff;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x9cd8('0x0'),_0x9cd8('0x1'),_0x9cd8('0x2')];function createListener(_0x5979c0,_0x2b510c){return function(_0x3de308){_0x2b510c[_0x9cd8('0x3')](_0x5979c0,_0x3de308);};}function removeListener(_0x4dac43,_0x2b0512){return function(){VoiceQueueEvents[_0x9cd8('0x4')](_0x4dac43,_0x2b0512);};}exports[_0x9cd8('0x5')]=function(_0x599052){for(var _0xbb4637=0x0,_0x1198a5=events['length'];_0xbb4637<_0x1198a5;_0xbb4637++){var _0x40c3b1=events[_0xbb4637];var _0x33d8c1=createListener(_0x9cd8('0x6')+_0x40c3b1,_0x599052);VoiceQueueEvents['on'](_0x40c3b1,_0x33d8c1);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index c9f9083..c346334 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 _0x9fd4=['get','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0x9fd4,0x16c));var _0x49fd=function(_0x80d21a,_0x26fc3b){_0x80d21a=_0x80d21a-0x0;var _0x239369=_0x9fd4[_0x80d21a];return _0x239369;};'use strict';var multer=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var path=require(_0x49fd('0x2'));var timeout=require(_0x49fd('0x3'));var express=require(_0x49fd('0x4'));var router=express[_0x49fd('0x5')]();var auth=require(_0x49fd('0x6'));var interaction=require(_0x49fd('0x7'));var config=require(_0x49fd('0x8'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0x49fd('0x9')](),controller[_0x49fd('0xa')]);router[_0x49fd('0xb')](_0x49fd('0xc'),auth['isAuthenticated'](),controller[_0x49fd('0xd')]);router[_0x49fd('0xb')](_0x49fd('0xe'),auth[_0x49fd('0x9')](),controller[_0x49fd('0xf')]);router['get'](_0x49fd('0x10'),auth[_0x49fd('0x9')](),controller[_0x49fd('0x11')]);router[_0x49fd('0x12')]('/',auth[_0x49fd('0x9')](),controller[_0x49fd('0x13')]);router[_0x49fd('0x14')]('/:id',auth[_0x49fd('0x9')](),controller[_0x49fd('0x15')]);router[_0x49fd('0x16')](_0x49fd('0x10'),auth[_0x49fd('0x9')](),controller[_0x49fd('0x17')]);module[_0x49fd('0x18')]=router; \ No newline at end of file +var _0x9b0d=['put','update','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','getVoiceQueuesReport','/:id','show','create'];(function(_0x508bd5,_0x43f4f1){var _0x12b5a4=function(_0xe305bb){while(--_0xe305bb){_0x508bd5['push'](_0x508bd5['shift']());}};_0x12b5a4(++_0x43f4f1);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x81ebb3,_0x1b664e){_0x81ebb3=_0x81ebb3-0x0;var _0x5e4874=_0x9b0d[_0x81ebb3];return _0x5e4874;};'use strict';var multer=require('multer');var util=require(_0xd9b0('0x0'));var path=require(_0xd9b0('0x1'));var timeout=require(_0xd9b0('0x2'));var express=require(_0xd9b0('0x3'));var router=express['Router']();var auth=require(_0xd9b0('0x4'));var interaction=require(_0xd9b0('0x5'));var config=require(_0xd9b0('0x6'));var controller=require(_0xd9b0('0x7'));router['get']('/',auth[_0xd9b0('0x8')](),controller[_0xd9b0('0x9')]);router[_0xd9b0('0xa')](_0xd9b0('0xb'),auth[_0xd9b0('0x8')](),controller[_0xd9b0('0xc')]);router[_0xd9b0('0xa')]('/index',auth[_0xd9b0('0x8')](),controller[_0xd9b0('0xd')]);router['get'](_0xd9b0('0xe'),auth['isAuthenticated'](),controller[_0xd9b0('0xf')]);router['post']('/',auth[_0xd9b0('0x8')](),controller[_0xd9b0('0x10')]);router[_0xd9b0('0x11')](_0xd9b0('0xe'),auth[_0xd9b0('0x8')](),controller[_0xd9b0('0x12')]);router['delete'](_0xd9b0('0xe'),auth[_0xd9b0('0x8')](),controller['destroy']);module[_0xd9b0('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index d5438b1..0d502a1 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 _0x1ee4=['setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds'];(function(_0x3ea16a,_0x3a37c0){var _0xb2687b=function(_0x248930){while(--_0x248930){_0x3ea16a['push'](_0x3ea16a['shift']());}};_0xb2687b(++_0x3a37c0);}(_0x1ee4,0x16c));var _0x41ee=function(_0x2777cb,_0x373c5d){_0x2777cb=_0x2777cb-0x0;var _0x48f6ed=_0x1ee4[_0x2777cb];return _0x48f6ed;};'use strict';var Sequelize=require(_0x41ee('0x0'));var moment=require(_0x41ee('0x1'));module[_0x41ee('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x41ee('0x3')]},'queue':{'type':Sequelize[_0x41ee('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x41ee('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x41ee('0x4')],'set':function(_0x289017){var _0x13dd74=moment(_0x289017);var _0x1f1186=moment(this[_0x41ee('0x5')](_0x41ee('0x6')))['format'](_0x41ee('0x7'));var _0x99eff1=_0x13dd74[_0x41ee('0x8')](_0x1f1186,_0x41ee('0x9'));this[_0x41ee('0xa')](_0x41ee('0xb'),_0x289017);this[_0x41ee('0xa')](_0x41ee('0xc'),_0x99eff1||null);}},'position':{'type':Sequelize[_0x41ee('0xd')]},'count':{'type':Sequelize[_0x41ee('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x41ee('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x41ee('0x4')]},'queuecallerexit':{'type':Sequelize[_0x41ee('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x41ee('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x41ee('0x3')],'comment':_0x41ee('0xf')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x41ee('0x3')]},'connectedlinename':{'type':Sequelize[_0x41ee('0x3')]},'accountcode':{'type':Sequelize[_0x41ee('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x41ee('0x3')]},'priority':{'type':Sequelize[_0x41ee('0x3')]},'holdtime':{'type':Sequelize[_0x41ee('0xd')]},'mohtime':{'type':Sequelize[_0x41ee('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x41ee('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x41ee('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x41ee('0x3')],'comment':_0x41ee('0x10')},'transferexten':{'type':Sequelize[_0x41ee('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x41ee('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x41ee('0xd')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6659=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','STRING','DATE','queuecallerjoinAt','format','diff','holdtime','INTEGER','BOOLEAN'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x6659,0xbd));var _0x9665=function(_0x1d856a,_0x17ab13){_0x1d856a=_0x1d856a-0x0;var _0x570b35=_0x6659[_0x1d856a];return _0x570b35;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9665('0x0'));module['exports']={'type':{'type':Sequelize[_0x9665('0x1')]},'uniqueid':{'type':Sequelize[_0x9665('0x1')]},'calleridnum':{'type':Sequelize[_0x9665('0x1')]},'calleridname':{'type':Sequelize[_0x9665('0x1')]},'queue':{'type':Sequelize[_0x9665('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0x9665('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x9665('0x2')],'set':function(_0x4b761b){var _0x4d8c2a=moment(_0x4b761b);var _0x5e1ec7=moment(this['getDataValue'](_0x9665('0x3')))[_0x9665('0x4')]('YYYY-MM-DD\x20HH:mm:ss');var _0x20d669=_0x4d8c2a[_0x9665('0x5')](_0x5e1ec7,'seconds');this['setDataValue']('queuecallerleaveAt',_0x4b761b);this['setDataValue'](_0x9665('0x6'),_0x20d669||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x9665('0x7')]},'queuecallerabandon':{'type':Sequelize[_0x9665('0x8')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x9665('0x8')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x9665('0x2')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x9665('0x9')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x9665('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9665('0x1')]},'connectedlinename':{'type':Sequelize[_0x9665('0x1')]},'accountcode':{'type':Sequelize[_0x9665('0x1')]},'context':{'type':Sequelize[_0x9665('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9665('0x1')]},'holdtime':{'type':Sequelize[_0x9665('0x7')]},'mohtime':{'type':Sequelize[_0x9665('0x7')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9665('0x8')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x9665('0x8')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9665('0x1')],'comment':_0x9665('0xa')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x9665('0x1')]},'disposition':{'type':Sequelize[_0x9665('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x9665('0x7')],'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 4e9c63d..58dea63 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 _0x1a85=['../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','then','destroy','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','update','describe','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x12d8ea,_0x82dc4d){var _0x371099=function(_0x219d86){while(--_0x219d86){_0x12d8ea['push'](_0x12d8ea['shift']());}};_0x371099(++_0x82dc4d);}(_0x1a85,0x178));var _0x51a8=function(_0x163691,_0x3d10c4){_0x163691=_0x163691-0x0;var _0x543ae5=_0x1a85[_0x163691];return _0x543ae5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x51a8('0x0'));var zipdir=require(_0x51a8('0x1'));var jsonpatch=require(_0x51a8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x51a8('0x3'));var Mustache=require(_0x51a8('0x4'));var util=require(_0x51a8('0x5'));var path=require('path');var sox=require(_0x51a8('0x6'));var csv=require('to-csv');var ejs=require(_0x51a8('0x7'));var fs=require('fs');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 db=require(_0x51a8('0x15'))['db'];config[_0x51a8('0x16')]=_[_0x51a8('0x17')](config[_0x51a8('0x16')],{'host':_0x51a8('0x18'),'port':0x18eb});var socket=require(_0x51a8('0x19'))(new Redis(config[_0x51a8('0x16')]));require('./voiceQueueReport.socket')[_0x51a8('0x1a')](socket);function respondWithStatusCode(_0x7a4c36,_0xaec066){_0xaec066=_0xaec066||0xcc;return function(_0x50d992){if(_0x50d992){return _0x7a4c36[_0x51a8('0x1b')](_0xaec066);}return _0x7a4c36['status'](_0xaec066)[_0x51a8('0x1c')]();};}function respondWithResult(_0x2b8d37,_0x39cd45){_0x39cd45=_0x39cd45||0xc8;return function(_0x2b0521){if(_0x2b0521){return _0x2b8d37[_0x51a8('0x1d')](_0x39cd45)[_0x51a8('0x1e')](_0x2b0521);}};}function respondWithFilteredResult(_0x1f49ee,_0x516abc){return function(_0x1c2f25){if(_0x1c2f25){var _0x45a433=_0x1c2f25[_0x51a8('0x1f')],_0xd52230=_0x516abc['offset'],_0x23539e=_0x516abc[_0x51a8('0x20')]+_0x516abc[_0x51a8('0x21')],_0x3bc1a2;if(_0x23539e>=_0x45a433){_0x23539e=_0x45a433;_0x3bc1a2=0xc8;}else{_0x3bc1a2=0xce;}_0x1f49ee[_0x51a8('0x1d')](_0x3bc1a2);return _0x1f49ee[_0x51a8('0x22')](_0x51a8('0x23'),_0xd52230+'-'+_0x23539e+'/'+_0x45a433)[_0x51a8('0x1e')](_0x1c2f25);}return null;};}function patchUpdates(_0x28aea0){return function(_0x3bf5b6){try{jsonpatch['apply'](_0x3bf5b6,_0x28aea0,!![]);}catch(_0xf80fa9){return BPromise['reject'](_0xf80fa9);}return _0x3bf5b6[_0x51a8('0x24')]();};}function saveUpdates(_0x12c029,_0x8bda40){return function(_0x3759d6){if(_0x3759d6){return _0x3759d6['update'](_0x12c029)[_0x51a8('0x25')](function(_0x4b9cdd){return _0x4b9cdd;});}return null;};}function removeEntity(_0x47f063,_0x23d26a){return function(_0x52e503){if(_0x52e503){return _0x52e503[_0x51a8('0x26')]()[_0x51a8('0x25')](function(){_0x47f063[_0x51a8('0x1d')](0xcc)[_0x51a8('0x1c')]();});}};}function handleEntityNotFound(_0x157554,_0x2f2f05){return function(_0x291ed6){if(!_0x291ed6){_0x157554[_0x51a8('0x1b')](0x194);}return _0x291ed6;};}function handleError(_0x5b3f49,_0x273ce2){_0x273ce2=_0x273ce2||0x1f4;return function(_0x1b7577){logger[_0x51a8('0x27')](_0x1b7577[_0x51a8('0x28')]);if(_0x1b7577[_0x51a8('0x29')]){delete _0x1b7577[_0x51a8('0x29')];}_0x5b3f49[_0x51a8('0x1d')](_0x273ce2)[_0x51a8('0x2a')](_0x1b7577);};}exports[_0x51a8('0x2b')]=function(_0x4b5cda,_0x20c6b5){var _0x347a02={},_0x4a1548={},_0x2f9d53={'count':0x0,'rows':[]};var _0x58cba0=_[_0x51a8('0x2c')](db[_0x51a8('0x2d')][_0x51a8('0x2e')],function(_0x41df56){return{'name':_0x41df56[_0x51a8('0x2f')],'type':_0x41df56['type'][_0x51a8('0x30')]};});_0x4a1548['model']=_[_0x51a8('0x2c')](_0x58cba0,_0x51a8('0x29'));_0x4a1548[_0x51a8('0x31')]=_['keys'](_0x4b5cda[_0x51a8('0x31')]);_0x4a1548['filters']=_[_0x51a8('0x32')](_0x4a1548[_0x51a8('0x33')],_0x4a1548[_0x51a8('0x31')]);_0x347a02[_0x51a8('0x34')]=_[_0x51a8('0x32')](_0x4a1548['model'],qs[_0x51a8('0x35')](_0x4b5cda['query'][_0x51a8('0x35')]));_0x347a02[_0x51a8('0x34')]=_0x347a02[_0x51a8('0x34')]['length']?_0x347a02[_0x51a8('0x34')]:_0x4a1548[_0x51a8('0x33')];if(!_0x4b5cda[_0x51a8('0x31')][_0x51a8('0x36')](_0x51a8('0x37'))){_0x347a02['limit']=qs['limit'](_0x4b5cda['query'][_0x51a8('0x21')]);_0x347a02[_0x51a8('0x20')]=qs['offset'](_0x4b5cda[_0x51a8('0x31')]['offset']);}_0x347a02[_0x51a8('0x38')]=qs[_0x51a8('0x39')](_0x4b5cda[_0x51a8('0x31')][_0x51a8('0x39')]);_0x347a02[_0x51a8('0x3a')]=qs[_0x51a8('0x3b')](_['pick'](_0x4b5cda['query'],_0x4a1548[_0x51a8('0x3b')]));if(_0x4b5cda['query']['filter']){_0x347a02['where']=_[_0x51a8('0x3c')](_0x347a02[_0x51a8('0x3a')],{'$or':_[_0x51a8('0x2c')](_0x58cba0,function(_0x5956b8){if(_0x5956b8[_0x51a8('0x3d')]!==_0x51a8('0x3e')){var _0x2e6432={};_0x2e6432[_0x5956b8[_0x51a8('0x29')]]={'$like':'%'+_0x4b5cda['query'][_0x51a8('0x3f')]+'%'};return _0x2e6432;}})});}_0x347a02=_[_0x51a8('0x3c')]({},_0x347a02,_0x4b5cda[_0x51a8('0x40')]);var _0x4dcbfb={'where':_0x347a02[_0x51a8('0x3a')]};return db['VoiceQueueReport'][_0x51a8('0x1f')](_0x4dcbfb)[_0x51a8('0x25')](function(_0x2a98bd){_0x2f9d53[_0x51a8('0x1f')]=_0x2a98bd;if(_0x4b5cda['query'][_0x51a8('0x41')]){_0x347a02[_0x51a8('0x42')]=[{'all':!![]}];}return db[_0x51a8('0x2d')][_0x51a8('0x43')](_0x347a02);})[_0x51a8('0x25')](function(_0x35c1c9){_0x2f9d53[_0x51a8('0x44')]=_0x35c1c9;return _0x2f9d53;})[_0x51a8('0x25')](respondWithFilteredResult(_0x20c6b5,_0x347a02))[_0x51a8('0x45')](handleError(_0x20c6b5,null));};exports['show']=function(_0x22e6e6,_0x2afb74){var _0x4c7c67={'raw':![],'where':{'id':_0x22e6e6[_0x51a8('0x46')]['id']}},_0x53409d={};_0x53409d[_0x51a8('0x33')]=_[_0x51a8('0x47')](db[_0x51a8('0x2d')][_0x51a8('0x2e')]);_0x53409d[_0x51a8('0x31')]=_[_0x51a8('0x47')](_0x22e6e6[_0x51a8('0x31')]);_0x53409d[_0x51a8('0x3b')]=_[_0x51a8('0x32')](_0x53409d['model'],_0x53409d[_0x51a8('0x31')]);_0x4c7c67[_0x51a8('0x34')]=_[_0x51a8('0x32')](_0x53409d[_0x51a8('0x33')],qs[_0x51a8('0x35')](_0x22e6e6[_0x51a8('0x31')]['fields']));_0x4c7c67[_0x51a8('0x34')]=_0x4c7c67['attributes'][_0x51a8('0x48')]?_0x4c7c67[_0x51a8('0x34')]:_0x53409d[_0x51a8('0x33')];if(_0x22e6e6[_0x51a8('0x31')][_0x51a8('0x41')]){_0x4c7c67['include']=[{'all':!![]}];}_0x4c7c67=_['merge']({},_0x4c7c67,_0x22e6e6[_0x51a8('0x40')]);return db[_0x51a8('0x2d')][_0x51a8('0x49')](_0x4c7c67)[_0x51a8('0x25')](handleEntityNotFound(_0x2afb74,null))[_0x51a8('0x25')](respondWithResult(_0x2afb74,null))['catch'](handleError(_0x2afb74,null));};exports['create']=function(_0xcbd998,_0x108131){return db[_0x51a8('0x2d')][_0x51a8('0x4a')](_0xcbd998[_0x51a8('0x4b')],{})[_0x51a8('0x25')](respondWithResult(_0x108131,0xc9))[_0x51a8('0x45')](handleError(_0x108131,null));};exports[_0x51a8('0x4c')]=function(_0x301578,_0x4d29ab){if(_0x301578['body']['id']){delete _0x301578['body']['id'];}return db[_0x51a8('0x2d')][_0x51a8('0x49')]({'where':{'id':_0x301578[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d29ab,null))[_0x51a8('0x25')](saveUpdates(_0x301578[_0x51a8('0x4b')],null))['then'](respondWithResult(_0x4d29ab,null))[_0x51a8('0x45')](handleError(_0x4d29ab,null));};exports['destroy']=function(_0x50a2f8,_0xbf828b){return db[_0x51a8('0x2d')][_0x51a8('0x49')]({'where':{'id':_0x50a2f8['params']['id']}})['then'](handleEntityNotFound(_0xbf828b,null))[_0x51a8('0x25')](removeEntity(_0xbf828b,null))['catch'](handleError(_0xbf828b,null));};exports[_0x51a8('0x4d')]=function(_0xc89617,_0x3623d4){return db[_0x51a8('0x2d')][_0x51a8('0x4d')]()[_0x51a8('0x25')](respondWithResult(_0x3623d4,null))[_0x51a8('0x45')](handleError(_0x3623d4,null));};exports[_0x51a8('0x4e')]=function(_0x29d31e,_0x530ad0){var _0x2eda9c={},_0xe4518d={},_0x823d14={'count':0x0,'rows':[]};_0xe4518d[_0x51a8('0x33')]=_['keys'](db[_0x51a8('0x2d')]['rawAttributes']);_0xe4518d[_0x51a8('0x31')]=_[_0x51a8('0x47')](_0x29d31e['query']);_0xe4518d['filters']=_[_0x51a8('0x32')](_0xe4518d[_0x51a8('0x33')],_0xe4518d[_0x51a8('0x31')]);_0x2eda9c[_0x51a8('0x34')]=_[_0x51a8('0x32')](_0xe4518d['model'],qs[_0x51a8('0x35')](_0x29d31e[_0x51a8('0x31')][_0x51a8('0x35')]));_0x2eda9c[_0x51a8('0x34')]=_0x2eda9c[_0x51a8('0x34')]['length']?_0x2eda9c[_0x51a8('0x34')]:_0xe4518d[_0x51a8('0x33')];if(!_0x29d31e[_0x51a8('0x31')][_0x51a8('0x36')](_0x51a8('0x37'))){_0x2eda9c[_0x51a8('0x21')]=qs['limit'](_0x29d31e['query']['limit']);_0x2eda9c['offset']=qs[_0x51a8('0x20')](_0x29d31e[_0x51a8('0x31')]['offset']);}_0x2eda9c[_0x51a8('0x38')]=qs['sort'](_0x29d31e[_0x51a8('0x31')]['sort']);_0x2eda9c[_0x51a8('0x3a')]=qs[_0x51a8('0x3b')](_['pick'](_0x29d31e['query'],_0xe4518d['filters']));if(_0x29d31e[_0x51a8('0x31')][_0x51a8('0x3f')]){_0x2eda9c[_0x51a8('0x3a')]=_[_0x51a8('0x3c')](_0x2eda9c[_0x51a8('0x3a')],{'$or':_[_0x51a8('0x2c')](_0x2eda9c[_0x51a8('0x34')],function(_0x259153){var _0x494e11={};_0x494e11[_0x259153]={'$like':'%'+_0x29d31e[_0x51a8('0x31')][_0x51a8('0x3f')]+'%'};return _0x494e11;})});}_0x2eda9c=_['merge']({},_0x2eda9c,_0x29d31e[_0x51a8('0x40')]);var _0x315231={'where':_0x2eda9c[_0x51a8('0x3a')]};return db[_0x51a8('0x2d')][_0x51a8('0x1f')](_0x315231)[_0x51a8('0x25')](function(_0x4f6d5f){_0x823d14['count']=_0x4f6d5f;if(_0x29d31e[_0x51a8('0x31')]['includeAll']){_0x2eda9c['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x2eda9c);})['then'](function(_0x426aec){_0x823d14['rows']=_0x426aec;return _0x823d14;})[_0x51a8('0x25')](respondWithFilteredResult(_0x530ad0,_0x2eda9c,_0x51a8('0x4e')))[_0x51a8('0x45')](handleError(_0x530ad0,null,_0x51a8('0x4e')));}; \ No newline at end of file +var _0x1967=['../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','json','count','offset','reject','save','update','then','destroy','name','index','VoiceQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','create','body','params','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x1967,0x173));var _0x7196=function(_0x494616,_0x5b7908){_0x494616=_0x494616-0x0;var _0x3ef866=_0x1967[_0x494616];return _0x3ef866;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7196('0x0'));var rimraf=require(_0x7196('0x1'));var zipdir=require(_0x7196('0x2'));var jsonpatch=require(_0x7196('0x3'));var rp=require(_0x7196('0x4'));var moment=require(_0x7196('0x5'));var BPromise=require(_0x7196('0x6'));var Mustache=require(_0x7196('0x7'));var util=require(_0x7196('0x8'));var path=require(_0x7196('0x9'));var sox=require('sox');var csv=require(_0x7196('0xa'));var ejs=require(_0x7196('0xb'));var fs=require('fs');var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0xa'));var querystring=require(_0x7196('0x10'));var Papa=require(_0x7196('0x11'));var Redis=require(_0x7196('0x12'));var authService=require(_0x7196('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x14'));var logger=require(_0x7196('0x15'))(_0x7196('0x16'));var utils=require(_0x7196('0x17'));var config=require(_0x7196('0x18'));var db=require(_0x7196('0x19'))['db'];config[_0x7196('0x1a')]=_[_0x7196('0x1b')](config[_0x7196('0x1a')],{'host':_0x7196('0x1c'),'port':0x18eb});var socket=require(_0x7196('0x1d'))(new Redis(config['redis']));require(_0x7196('0x1e'))[_0x7196('0x1f')](socket);function respondWithStatusCode(_0x3545aa,_0xf098c1){_0xf098c1=_0xf098c1||0xcc;return function(_0x511aa1){if(_0x511aa1){return _0x3545aa[_0x7196('0x20')](_0xf098c1);}return _0x3545aa['status'](_0xf098c1)[_0x7196('0x21')]();};}function respondWithResult(_0x2590a6,_0xf7e97){_0xf7e97=_0xf7e97||0xc8;return function(_0x3ed1ad){if(_0x3ed1ad){return _0x2590a6[_0x7196('0x22')](_0xf7e97)[_0x7196('0x23')](_0x3ed1ad);}};}function respondWithFilteredResult(_0x22bd62,_0x1ed296){return function(_0x3e4e69){if(_0x3e4e69){var _0x32fe2b=_0x3e4e69[_0x7196('0x24')],_0x385f2d=_0x1ed296[_0x7196('0x25')],_0x5b716a=_0x1ed296[_0x7196('0x25')]+_0x1ed296['limit'],_0x4c4f91;if(_0x5b716a>=_0x32fe2b){_0x5b716a=_0x32fe2b;_0x4c4f91=0xc8;}else{_0x4c4f91=0xce;}_0x22bd62[_0x7196('0x22')](_0x4c4f91);return _0x22bd62['set']('Content-Range',_0x385f2d+'-'+_0x5b716a+'/'+_0x32fe2b)[_0x7196('0x23')](_0x3e4e69);}return null;};}function patchUpdates(_0x627223){return function(_0x8dee9d){try{jsonpatch['apply'](_0x8dee9d,_0x627223,!![]);}catch(_0x57c390){return BPromise[_0x7196('0x26')](_0x57c390);}return _0x8dee9d[_0x7196('0x27')]();};}function saveUpdates(_0x598a26,_0x18649b){return function(_0x27ff84){if(_0x27ff84){return _0x27ff84[_0x7196('0x28')](_0x598a26)[_0x7196('0x29')](function(_0x38b3d6){return _0x38b3d6;});}return null;};}function removeEntity(_0x549f34,_0x3f8178){return function(_0x520d01){if(_0x520d01){return _0x520d01[_0x7196('0x2a')]()[_0x7196('0x29')](function(){_0x549f34[_0x7196('0x22')](0xcc)[_0x7196('0x21')]();});}};}function handleEntityNotFound(_0x70aa65,_0x43f6a2){return function(_0x530ab5){if(!_0x530ab5){_0x70aa65['sendStatus'](0x194);}return _0x530ab5;};}function handleError(_0x1482e5,_0x2d284f){_0x2d284f=_0x2d284f||0x1f4;return function(_0x184c09){logger['error'](_0x184c09['stack']);if(_0x184c09[_0x7196('0x2b')]){delete _0x184c09[_0x7196('0x2b')];}_0x1482e5[_0x7196('0x22')](_0x2d284f)['send'](_0x184c09);};}exports[_0x7196('0x2c')]=function(_0x4ecea1,_0x4fd339){var _0x59d79d={},_0x30151f={},_0x985727={'count':0x0,'rows':[]};var _0x1257ad=_['map'](db[_0x7196('0x2d')][_0x7196('0x2e')],function(_0x2f9583){return{'name':_0x2f9583[_0x7196('0x2f')],'type':_0x2f9583['type'][_0x7196('0x30')]};});_0x30151f[_0x7196('0x31')]=_[_0x7196('0x32')](_0x1257ad,_0x7196('0x2b'));_0x30151f[_0x7196('0x33')]=_[_0x7196('0x34')](_0x4ecea1[_0x7196('0x33')]);_0x30151f[_0x7196('0x35')]=_[_0x7196('0x36')](_0x30151f[_0x7196('0x31')],_0x30151f[_0x7196('0x33')]);_0x59d79d['attributes']=_[_0x7196('0x36')](_0x30151f['model'],qs[_0x7196('0x37')](_0x4ecea1['query'][_0x7196('0x37')]));_0x59d79d[_0x7196('0x38')]=_0x59d79d['attributes'][_0x7196('0x39')]?_0x59d79d[_0x7196('0x38')]:_0x30151f[_0x7196('0x31')];if(!_0x4ecea1[_0x7196('0x33')][_0x7196('0x3a')]('nolimit')){_0x59d79d[_0x7196('0x3b')]=qs[_0x7196('0x3b')](_0x4ecea1[_0x7196('0x33')][_0x7196('0x3b')]);_0x59d79d[_0x7196('0x25')]=qs[_0x7196('0x25')](_0x4ecea1['query'][_0x7196('0x25')]);}_0x59d79d[_0x7196('0x3c')]=qs[_0x7196('0x3d')](_0x4ecea1['query'][_0x7196('0x3d')]);_0x59d79d[_0x7196('0x3e')]=qs[_0x7196('0x35')](_[_0x7196('0x3f')](_0x4ecea1[_0x7196('0x33')],_0x30151f[_0x7196('0x35')]));if(_0x4ecea1[_0x7196('0x33')][_0x7196('0x40')]){_0x59d79d[_0x7196('0x3e')]=_[_0x7196('0x41')](_0x59d79d['where'],{'$or':_[_0x7196('0x32')](_0x1257ad,function(_0x17cefd){if(_0x17cefd['type']!==_0x7196('0x42')){var _0x54767f={};_0x54767f[_0x17cefd['name']]={'$like':'%'+_0x4ecea1[_0x7196('0x33')][_0x7196('0x40')]+'%'};return _0x54767f;}})});}_0x59d79d=_['merge']({},_0x59d79d,_0x4ecea1['options']);var _0x1bad95={'where':_0x59d79d[_0x7196('0x3e')]};return db[_0x7196('0x2d')]['count'](_0x1bad95)[_0x7196('0x29')](function(_0x2d13a5){_0x985727[_0x7196('0x24')]=_0x2d13a5;if(_0x4ecea1[_0x7196('0x33')][_0x7196('0x43')]){_0x59d79d[_0x7196('0x44')]=[{'all':!![]}];}return db[_0x7196('0x2d')][_0x7196('0x45')](_0x59d79d);})['then'](function(_0x89c8ea){_0x985727[_0x7196('0x46')]=_0x89c8ea;return _0x985727;})['then'](respondWithFilteredResult(_0x4fd339,_0x59d79d))[_0x7196('0x47')](handleError(_0x4fd339,null));};exports[_0x7196('0x48')]=function(_0x48178f,_0x471915){var _0x471bb2={'raw':![],'where':{'id':_0x48178f['params']['id']}},_0x3b78c8={};_0x3b78c8[_0x7196('0x31')]=_[_0x7196('0x34')](db['VoiceQueueReport'][_0x7196('0x2e')]);_0x3b78c8[_0x7196('0x33')]=_['keys'](_0x48178f[_0x7196('0x33')]);_0x3b78c8['filters']=_['intersection'](_0x3b78c8['model'],_0x3b78c8['query']);_0x471bb2['attributes']=_[_0x7196('0x36')](_0x3b78c8['model'],qs[_0x7196('0x37')](_0x48178f[_0x7196('0x33')][_0x7196('0x37')]));_0x471bb2[_0x7196('0x38')]=_0x471bb2['attributes'][_0x7196('0x39')]?_0x471bb2['attributes']:_0x3b78c8[_0x7196('0x31')];if(_0x48178f[_0x7196('0x33')][_0x7196('0x43')]){_0x471bb2['include']=[{'all':!![]}];}_0x471bb2=_[_0x7196('0x41')]({},_0x471bb2,_0x48178f[_0x7196('0x49')]);return db[_0x7196('0x2d')]['find'](_0x471bb2)['then'](handleEntityNotFound(_0x471915,null))[_0x7196('0x29')](respondWithResult(_0x471915,null))['catch'](handleError(_0x471915,null));};exports[_0x7196('0x4a')]=function(_0x582884,_0x53b4c7){return db[_0x7196('0x2d')]['create'](_0x582884['body'],{})['then'](respondWithResult(_0x53b4c7,0xc9))[_0x7196('0x47')](handleError(_0x53b4c7,null));};exports['update']=function(_0x48e3b5,_0x28591e){if(_0x48e3b5[_0x7196('0x4b')]['id']){delete _0x48e3b5[_0x7196('0x4b')]['id'];}return db[_0x7196('0x2d')]['find']({'where':{'id':_0x48e3b5[_0x7196('0x4c')]['id']}})['then'](handleEntityNotFound(_0x28591e,null))[_0x7196('0x29')](saveUpdates(_0x48e3b5[_0x7196('0x4b')],null))['then'](respondWithResult(_0x28591e,null))[_0x7196('0x47')](handleError(_0x28591e,null));};exports[_0x7196('0x2a')]=function(_0x3fe092,_0x4fa18f){return db[_0x7196('0x2d')]['find']({'where':{'id':_0x3fe092[_0x7196('0x4c')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x4fa18f,null))[_0x7196('0x29')](removeEntity(_0x4fa18f,null))[_0x7196('0x47')](handleError(_0x4fa18f,null));};exports[_0x7196('0x4d')]=function(_0x19733a,_0x7e0d3){return db[_0x7196('0x2d')]['describe']()['then'](respondWithResult(_0x7e0d3,null))[_0x7196('0x47')](handleError(_0x7e0d3,null));};exports[_0x7196('0x4e')]=function(_0x40f820,_0xe4b032){var _0x4ebcd7={},_0x76b189={},_0x6948a={'count':0x0,'rows':[]};_0x76b189[_0x7196('0x31')]=_[_0x7196('0x34')](db[_0x7196('0x2d')][_0x7196('0x2e')]);_0x76b189[_0x7196('0x33')]=_[_0x7196('0x34')](_0x40f820[_0x7196('0x33')]);_0x76b189[_0x7196('0x35')]=_[_0x7196('0x36')](_0x76b189['model'],_0x76b189[_0x7196('0x33')]);_0x4ebcd7[_0x7196('0x38')]=_[_0x7196('0x36')](_0x76b189['model'],qs[_0x7196('0x37')](_0x40f820['query'][_0x7196('0x37')]));_0x4ebcd7[_0x7196('0x38')]=_0x4ebcd7[_0x7196('0x38')][_0x7196('0x39')]?_0x4ebcd7[_0x7196('0x38')]:_0x76b189['model'];if(!_0x40f820[_0x7196('0x33')]['hasOwnProperty']('nolimit')){_0x4ebcd7['limit']=qs[_0x7196('0x3b')](_0x40f820[_0x7196('0x33')][_0x7196('0x3b')]);_0x4ebcd7[_0x7196('0x25')]=qs[_0x7196('0x25')](_0x40f820[_0x7196('0x33')][_0x7196('0x25')]);}_0x4ebcd7['order']=qs[_0x7196('0x3d')](_0x40f820[_0x7196('0x33')][_0x7196('0x3d')]);_0x4ebcd7[_0x7196('0x3e')]=qs[_0x7196('0x35')](_['pick'](_0x40f820['query'],_0x76b189[_0x7196('0x35')]));if(_0x40f820[_0x7196('0x33')][_0x7196('0x40')]){_0x4ebcd7[_0x7196('0x3e')]=_[_0x7196('0x41')](_0x4ebcd7[_0x7196('0x3e')],{'$or':_[_0x7196('0x32')](_0x4ebcd7[_0x7196('0x38')],function(_0x13e9d0){var _0x2caadd={};_0x2caadd[_0x13e9d0]={'$like':'%'+_0x40f820[_0x7196('0x33')]['filter']+'%'};return _0x2caadd;})});}_0x4ebcd7=_[_0x7196('0x41')]({},_0x4ebcd7,_0x40f820[_0x7196('0x49')]);var _0x27d5d7={'where':_0x4ebcd7[_0x7196('0x3e')]};return db['VoiceQueueReport'][_0x7196('0x24')](_0x27d5d7)[_0x7196('0x29')](function(_0x1f3acc){_0x6948a[_0x7196('0x24')]=_0x1f3acc;if(_0x40f820[_0x7196('0x33')][_0x7196('0x43')]){_0x4ebcd7[_0x7196('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x7196('0x45')](_0x4ebcd7);})[_0x7196('0x29')](function(_0x40df9b){_0x6948a[_0x7196('0x46')]=_0x40df9b;return _0x6948a;})['then'](respondWithFilteredResult(_0xe4b032,_0x4ebcd7,_0x7196('0x4e')))[_0x7196('0x47')](handleError(_0xe4b032,null,_0x7196('0x4e')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 927525a..e8abd1e 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 _0x25e1=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport'];(function(_0x5c0ddc,_0x410c88){var _0x38c7c1=function(_0x25649d){while(--_0x25649d){_0x5c0ddc['push'](_0x5c0ddc['shift']());}};_0x38c7c1(++_0x410c88);}(_0x25e1,0x125));var _0x125e=function(_0x9c53cf,_0x566c6f){_0x9c53cf=_0x9c53cf-0x0;var _0x97873c=_0x25e1[_0x9c53cf];return _0x97873c;};'use strict';var EventEmitter=require(_0x125e('0x0'));var VoiceQueueReport=require(_0x125e('0x1'))['db'][_0x125e('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x125e('0x3'),'afterUpdate':_0x125e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3559fb){return function(_0x1d1438,_0x2dd992,_0xb22aa6){VoiceQueueReportEvents[_0x125e('0x5')](_0x3559fb+':'+_0x1d1438['id'],_0x1d1438);VoiceQueueReportEvents[_0x125e('0x5')](_0x3559fb,_0x1d1438);_0xb22aa6(null);};}for(var e in events){if(events[_0x125e('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x125e('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x8ee8=['hook','exports','../../mysqldb','VoiceQueueReport','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x4e7e2c,_0x44ec66){var _0x160310=function(_0x1bc4a8){while(--_0x1bc4a8){_0x4e7e2c['push'](_0x4e7e2c['shift']());}};_0x160310(++_0x44ec66);}(_0x8ee8,0x173));var _0x88ee=function(_0x408758,_0x548c1f){_0x408758=_0x408758-0x0;var _0x2e25ae=_0x8ee8[_0x408758];return _0x2e25ae;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x88ee('0x0'))['db'][_0x88ee('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x88ee('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x88ee('0x3'),'afterDestroy':_0x88ee('0x4')};function emitEvent(_0x24ad47){return function(_0xa9caaf,_0x454bd0,_0x553e42){VoiceQueueReportEvents[_0x88ee('0x5')](_0x24ad47+':'+_0xa9caaf['id'],_0xa9caaf);VoiceQueueReportEvents[_0x88ee('0x5')](_0x24ad47,_0xa9caaf);_0x553e42(null);};}for(var e in events){if(events[_0x88ee('0x6')](e)){var event=events[e];VoiceQueueReport[_0x88ee('0x7')](e,emitEvent(event));}}module[_0x88ee('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 77fab50..c842a63 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(_0x2a05bf,_0x55e3a4){var _0x38a62e=function(_0x28d868){while(--_0x28d868){_0x2a05bf['push'](_0x2a05bf['shift']());}};_0x38a62e(++_0x55e3a4);}(_0xb10b,0x12a));var _0xbb10=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0xb10b[_0x45313f];return _0x402910;};'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(_0x741438,_0x51c635){var _0x4df285=function(_0x25b800){while(--_0x25b800){_0x741438['push'](_0x741438['shift']());}};_0x4df285(++_0x51c635);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'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 73a7c37..0972968 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 _0xb6ba=['stringify','code','error','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','debug','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x3a4669,_0x520cbc){var _0x540af2=function(_0x56af4c){while(--_0x56af4c){_0x3a4669['push'](_0x3a4669['shift']());}};_0x540af2(++_0x520cbc);}(_0xb6ba,0x1ce));var _0xab6b=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xb6ba[_0x31cb5f];return _0x586042;};'use strict';var _=require('lodash');var util=require(_0xab6b('0x0'));var moment=require(_0xab6b('0x1'));var BPromise=require(_0xab6b('0x2'));var rs=require(_0xab6b('0x3'));var fs=require('fs');var Redis=require(_0xab6b('0x4'));var db=require(_0xab6b('0x5'))['db'];var utils=require(_0xab6b('0x6'));var logger=require(_0xab6b('0x7'))(_0xab6b('0x8'));var config=require(_0xab6b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xab6b('0xa')][_0xab6b('0xb')]({'port':0x232a});config['redis']=_[_0xab6b('0xc')](config[_0xab6b('0xd')],{'host':_0xab6b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab6b('0xd')]));require(_0xab6b('0xf'))['register'](socket);function respondWithRpcPromise(_0x2ae104,_0x8827ae,_0x33ae3a){return new BPromise(function(_0x4132b7,_0x4d63ec){return client[_0xab6b('0x10')](_0x2ae104,_0x33ae3a)[_0xab6b('0x11')](function(_0x534744){logger[_0xab6b('0x12')](_0xab6b('0x13'),_0x8827ae,_0xab6b('0x14'));logger['debug'](_0xab6b('0x15'),_0x8827ae,_0xab6b('0x14'),JSON[_0xab6b('0x16')](_0x534744));if(_0x534744['error']){if(_0x534744['error'][_0xab6b('0x17')]===0x1f4){logger[_0xab6b('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x8827ae,_0x534744['error'][_0xab6b('0x19')]);return _0x4d63ec(_0x534744[_0xab6b('0x18')][_0xab6b('0x19')]);}logger[_0xab6b('0x18')](_0xab6b('0x13'),_0x8827ae,_0x534744[_0xab6b('0x18')][_0xab6b('0x19')]);return _0x4132b7(_0x534744['error'][_0xab6b('0x19')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x8827ae,_0xab6b('0x14'));_0x4132b7(_0x534744['result']['message']);}})[_0xab6b('0x1a')](function(_0x1f3939){logger[_0xab6b('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x8827ae,_0x1f3939);_0x4d63ec(_0x1f3939);});});}exports[_0xab6b('0x1b')]=function(_0x206d10){var _0x4f5f7e=this;return new Promise(function(_0x50bc5b,_0xd96405){return db[_0xab6b('0x1c')][_0xab6b('0x1d')]({'raw':_0x206d10['options']?_0x206d10[_0xab6b('0x1e')][_0xab6b('0x1f')]===undefined?!![]:![]:!![],'where':_0x206d10[_0xab6b('0x1e')]?_0x206d10[_0xab6b('0x1e')][_0xab6b('0x20')]||null:null,'attributes':_0x206d10['options']?_0x206d10[_0xab6b('0x1e')][_0xab6b('0x21')]||null:null,'limit':_0x206d10['options']?_0x206d10['options']['limit']||null:null,'include':_0x206d10[_0xab6b('0x1e')]?_0x206d10['options'][_0xab6b('0x22')]?_[_0xab6b('0x23')](_0x206d10[_0xab6b('0x1e')][_0xab6b('0x22')],function(_0x13b5ce){return{'model':db[_0x13b5ce[_0xab6b('0x24')]],'as':_0x13b5ce['as'],'attributes':_0x13b5ce[_0xab6b('0x21')],'include':_0x13b5ce['include']?_['map'](_0x13b5ce[_0xab6b('0x22')],function(_0x74d012){return{'model':db[_0x74d012['model']],'as':_0x74d012['as'],'attributes':_0x74d012['attributes'],'include':_0x74d012[_0xab6b('0x22')]?_[_0xab6b('0x23')](_0x74d012['include'],function(_0x421448){return{'model':db[_0x421448[_0xab6b('0x24')]],'as':_0x421448['as'],'attributes':_0x421448[_0xab6b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xab6b('0x11')](function(_0x5f4607){logger[_0xab6b('0x12')](_0xab6b('0x1b'),_0x206d10);logger[_0xab6b('0x25')](_0xab6b('0x1b'),_0x206d10,JSON[_0xab6b('0x16')](_0x5f4607));_0x50bc5b(_0x5f4607);})['catch'](function(_0x53aac8){logger[_0xab6b('0x18')](_0xab6b('0x1b'),_0x53aac8[_0xab6b('0x19')],_0x206d10);_0xd96405(_0x4f5f7e[_0xab6b('0x18')](0x1f4,_0x53aac8['message']));});});};exports[_0xab6b('0x26')]=function(_0x550eb0){var _0x5e513=this;return new Promise(function(_0x49e339,_0x466995){return db[_0xab6b('0x1c')][_0xab6b('0x27')](_0x550eb0['body'],{'raw':_0x550eb0[_0xab6b('0x1e')]?_0x550eb0[_0xab6b('0x1e')][_0xab6b('0x1f')]===undefined?!![]:![]:!![]})[_0xab6b('0x11')](function(_0xdbe3df){logger[_0xab6b('0x12')](_0xab6b('0x26'),_0x550eb0);logger[_0xab6b('0x25')](_0xab6b('0x26'),_0x550eb0,JSON['stringify'](_0xdbe3df));_0x49e339(_0xdbe3df);})[_0xab6b('0x1a')](function(_0x1c0f68){logger[_0xab6b('0x18')](_0xab6b('0x26'),_0x1c0f68['message'],_0x550eb0);_0x466995(_0x5e513[_0xab6b('0x18')](0x1f4,_0x1c0f68['message']));});});};exports[_0xab6b('0x28')]=function(_0x15fe4d){var _0xdccea7=this;return new Promise(function(_0x2752da,_0xa1768b){return db['VoiceQueueReport'][_0xab6b('0x29')](_0x15fe4d[_0xab6b('0x2a')],{'raw':_0x15fe4d[_0xab6b('0x1e')]?_0x15fe4d[_0xab6b('0x1e')][_0xab6b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15fe4d[_0xab6b('0x1e')]?_0x15fe4d[_0xab6b('0x1e')][_0xab6b('0x20')]||null:null,'attributes':_0x15fe4d[_0xab6b('0x1e')]?_0x15fe4d[_0xab6b('0x1e')][_0xab6b('0x21')]||null:null,'limit':_0x15fe4d[_0xab6b('0x1e')]?_0x15fe4d[_0xab6b('0x1e')][_0xab6b('0x2b')]||null:null})[_0xab6b('0x11')](function(_0x957571){logger[_0xab6b('0x12')](_0xab6b('0x28'),_0x15fe4d);logger[_0xab6b('0x25')](_0xab6b('0x28'),_0x15fe4d,JSON[_0xab6b('0x16')](_0x957571));_0x2752da(_0x957571);})[_0xab6b('0x1a')](function(_0x4ec0eb){logger[_0xab6b('0x18')](_0xab6b('0x28'),_0x4ec0eb[_0xab6b('0x19')],_0x15fe4d);_0xa1768b(_0xdccea7[_0xab6b('0x18')](0x1f4,_0x4ec0eb[_0xab6b('0x19')]));});});}; \ No newline at end of file +var _0x204d=['catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','include','map','model','then','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x42012f,_0x1af48f){var _0x5f418d=function(_0x34ee67){while(--_0x34ee67){_0x42012f['push'](_0x42012f['shift']());}};_0x5f418d(++_0x1af48f);}(_0x204d,0x144));var _0xd204=function(_0x3fa296,_0x2bd315){_0x3fa296=_0x3fa296-0x0;var _0x10b19f=_0x204d[_0x3fa296];return _0x10b19f;};'use strict';var _=require(_0xd204('0x0'));var util=require(_0xd204('0x1'));var moment=require(_0xd204('0x2'));var BPromise=require(_0xd204('0x3'));var rs=require(_0xd204('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd204('0x5'))['db'];var utils=require(_0xd204('0x6'));var logger=require(_0xd204('0x7'))(_0xd204('0x8'));var config=require(_0xd204('0x9'));var jayson=require(_0xd204('0xa'));var client=jayson[_0xd204('0xb')][_0xd204('0xc')]({'port':0x232a});config[_0xd204('0xd')]=_[_0xd204('0xe')](config['redis'],{'host':_0xd204('0xf'),'port':0x18eb});var socket=require(_0xd204('0x10'))(new Redis(config[_0xd204('0xd')]));require('./voiceQueueReport.socket')[_0xd204('0x11')](socket);function respondWithRpcPromise(_0x16668b,_0x12ff0e,_0x3db818){return new BPromise(function(_0x2cade4,_0x11bbd9){return client[_0xd204('0x12')](_0x16668b,_0x3db818)['then'](function(_0x4eac37){logger[_0xd204('0x13')](_0xd204('0x14'),_0x12ff0e,_0xd204('0x15'));logger[_0xd204('0x16')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x12ff0e,_0xd204('0x15'),JSON[_0xd204('0x17')](_0x4eac37));if(_0x4eac37[_0xd204('0x18')]){if(_0x4eac37[_0xd204('0x18')][_0xd204('0x19')]===0x1f4){logger['error'](_0xd204('0x14'),_0x12ff0e,_0x4eac37[_0xd204('0x18')][_0xd204('0x1a')]);return _0x11bbd9(_0x4eac37['error']['message']);}logger['error'](_0xd204('0x14'),_0x12ff0e,_0x4eac37['error']['message']);return _0x2cade4(_0x4eac37[_0xd204('0x18')][_0xd204('0x1a')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x12ff0e,_0xd204('0x15'));_0x2cade4(_0x4eac37[_0xd204('0x1b')]['message']);}})[_0xd204('0x1c')](function(_0xac3df4){logger[_0xd204('0x18')](_0xd204('0x14'),_0x12ff0e,_0xac3df4);_0x11bbd9(_0xac3df4);});});}exports[_0xd204('0x1d')]=function(_0x5f2f0f){var _0x5a6d17=this;return new Promise(function(_0x6131a4,_0x522025){return db[_0xd204('0x1e')]['findAll']({'raw':_0x5f2f0f['options']?_0x5f2f0f[_0xd204('0x1f')][_0xd204('0x20')]===undefined?!![]:![]:!![],'where':_0x5f2f0f[_0xd204('0x1f')]?_0x5f2f0f[_0xd204('0x1f')][_0xd204('0x21')]||null:null,'attributes':_0x5f2f0f[_0xd204('0x1f')]?_0x5f2f0f[_0xd204('0x1f')][_0xd204('0x22')]||null:null,'limit':_0x5f2f0f[_0xd204('0x1f')]?_0x5f2f0f[_0xd204('0x1f')][_0xd204('0x23')]||null:null,'include':_0x5f2f0f['options']?_0x5f2f0f['options'][_0xd204('0x24')]?_[_0xd204('0x25')](_0x5f2f0f[_0xd204('0x1f')][_0xd204('0x24')],function(_0x425bb1){return{'model':db[_0x425bb1[_0xd204('0x26')]],'as':_0x425bb1['as'],'attributes':_0x425bb1[_0xd204('0x22')],'include':_0x425bb1[_0xd204('0x24')]?_[_0xd204('0x25')](_0x425bb1[_0xd204('0x24')],function(_0x1fe493){return{'model':db[_0x1fe493[_0xd204('0x26')]],'as':_0x1fe493['as'],'attributes':_0x1fe493[_0xd204('0x22')],'include':_0x1fe493[_0xd204('0x24')]?_[_0xd204('0x25')](_0x1fe493['include'],function(_0x1ee796){return{'model':db[_0x1ee796[_0xd204('0x26')]],'as':_0x1ee796['as'],'attributes':_0x1ee796[_0xd204('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd204('0x27')](function(_0x4e8062){logger[_0xd204('0x13')]('GetVoiceQueueReport',_0x5f2f0f);logger[_0xd204('0x16')](_0xd204('0x1d'),_0x5f2f0f,JSON[_0xd204('0x17')](_0x4e8062));_0x6131a4(_0x4e8062);})['catch'](function(_0x4b90b4){logger['error'](_0xd204('0x1d'),_0x4b90b4[_0xd204('0x1a')],_0x5f2f0f);_0x522025(_0x5a6d17[_0xd204('0x18')](0x1f4,_0x4b90b4['message']));});});};exports[_0xd204('0x28')]=function(_0x451463){var _0x3bd050=this;return new Promise(function(_0x4307bb,_0x3bb29c){return db[_0xd204('0x1e')][_0xd204('0x29')](_0x451463[_0xd204('0x2a')],{'raw':_0x451463[_0xd204('0x1f')]?_0x451463[_0xd204('0x1f')][_0xd204('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x13eafe){logger['info'](_0xd204('0x28'),_0x451463);logger[_0xd204('0x16')]('CreateVoiceQueueReport',_0x451463,JSON[_0xd204('0x17')](_0x13eafe));_0x4307bb(_0x13eafe);})[_0xd204('0x1c')](function(_0x4b3f3b){logger['error'](_0xd204('0x28'),_0x4b3f3b[_0xd204('0x1a')],_0x451463);_0x3bb29c(_0x3bd050[_0xd204('0x18')](0x1f4,_0x4b3f3b[_0xd204('0x1a')]));});});};exports[_0xd204('0x2b')]=function(_0x2750b3){var _0xd20452=this;return new Promise(function(_0xaaec2b,_0x208a84){return db['VoiceQueueReport']['update'](_0x2750b3[_0xd204('0x2a')],{'raw':_0x2750b3[_0xd204('0x1f')]?_0x2750b3['options'][_0xd204('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2750b3['options']?_0x2750b3['options'][_0xd204('0x21')]||null:null,'attributes':_0x2750b3[_0xd204('0x1f')]?_0x2750b3[_0xd204('0x1f')]['attributes']||null:null,'limit':_0x2750b3[_0xd204('0x1f')]?_0x2750b3[_0xd204('0x1f')][_0xd204('0x23')]||null:null})[_0xd204('0x27')](function(_0x1bef0b){logger[_0xd204('0x13')](_0xd204('0x2b'),_0x2750b3);logger['debug'](_0xd204('0x2b'),_0x2750b3,JSON[_0xd204('0x17')](_0x1bef0b));_0xaaec2b(_0x1bef0b);})['catch'](function(_0x395f57){logger[_0xd204('0x18')](_0xd204('0x2b'),_0x395f57[_0xd204('0x1a')],_0x2750b3);_0x208a84(_0xd20452['error'](0x1f4,_0x395f57[_0xd204('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index e3ae897..83e8882 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 _0x28aa=['removeListener','length','./voiceQueueReport.events','remove','update','emit'];(function(_0xea6d2e,_0x44e126){var _0xdda0ba=function(_0x318d8e){while(--_0x318d8e){_0xea6d2e['push'](_0xea6d2e['shift']());}};_0xdda0ba(++_0x44e126);}(_0x28aa,0x98));var _0xa28a=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x28aa[_0x102e37];return _0x35a07c;};'use strict';var VoiceQueueReportEvents=require(_0xa28a('0x0'));var events=['save',_0xa28a('0x1'),_0xa28a('0x2')];function createListener(_0x52a205,_0x3c7ea7){return function(_0x1d3b67){_0x3c7ea7[_0xa28a('0x3')](_0x52a205,_0x1d3b67);};}function removeListener(_0x45c78a,_0x1cc102){return function(){VoiceQueueReportEvents[_0xa28a('0x4')](_0x45c78a,_0x1cc102);};}exports['register']=function(_0x2efef8){for(var _0x397d8c=0x0,_0x466e6d=events[_0xa28a('0x5')];_0x397d8c<_0x466e6d;_0x397d8c++){var _0x4b7714=events[_0x397d8c];var _0x1dc1e0=createListener('voiceQueueReport:'+_0x4b7714,_0x2efef8);VoiceQueueReportEvents['on'](_0x4b7714,_0x1dc1e0);}}; \ No newline at end of file +var _0x6a31=['register','length','voiceQueueReport:','./voiceQueueReport.events','save','update','emit','removeListener'];(function(_0x26de40,_0x5bd0ae){var _0x4bc6d8=function(_0x22aca1){while(--_0x22aca1){_0x26de40['push'](_0x26de40['shift']());}};_0x4bc6d8(++_0x5bd0ae);}(_0x6a31,0x19b));var _0x16a3=function(_0x56740a,_0x568894){_0x56740a=_0x56740a-0x0;var _0x257144=_0x6a31[_0x56740a];return _0x257144;};'use strict';var VoiceQueueReportEvents=require(_0x16a3('0x0'));var events=[_0x16a3('0x1'),'remove',_0x16a3('0x2')];function createListener(_0x82ccc1,_0x5332fb){return function(_0x1675b4){_0x5332fb[_0x16a3('0x3')](_0x82ccc1,_0x1675b4);};}function removeListener(_0x282391,_0x3272ce){return function(){VoiceQueueReportEvents[_0x16a3('0x4')](_0x282391,_0x3272ce);};}exports[_0x16a3('0x5')]=function(_0x49af03){for(var _0x3e8c83=0x0,_0x1dba59=events[_0x16a3('0x6')];_0x3e8c83<_0x1dba59;_0x3e8c83++){var _0x13994e=events[_0x3e8c83];var _0x222e1c=createListener(_0x16a3('0x7')+_0x13994e,_0x49af03);VoiceQueueReportEvents['on'](_0x13994e,_0x222e1c);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 63d3628..22cc51a 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 _0x5697=['delete','destroy','exports','multer','path','connect-timeout','express','get','/:id','isAuthenticated','show','post','create','update'];(function(_0x2d92f1,_0x410013){var _0x1b2ea9=function(_0xb76cb8){while(--_0xb76cb8){_0x2d92f1['push'](_0x2d92f1['shift']());}};_0x1b2ea9(++_0x410013);}(_0x5697,0x1b5));var _0x7569=function(_0x22df4d,_0xa4790a){_0x22df4d=_0x22df4d-0x0;var _0x6a2020=_0x5697[_0x22df4d];return _0x6a2020;};'use strict';var multer=require(_0x7569('0x0'));var util=require('util');var path=require(_0x7569('0x1'));var timeout=require(_0x7569('0x2'));var express=require(_0x7569('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router[_0x7569('0x4')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7569('0x5'),auth[_0x7569('0x6')](),controller[_0x7569('0x7')]);router[_0x7569('0x8')]('/',auth[_0x7569('0x6')](),controller[_0x7569('0x9')]);router['put'](_0x7569('0x5'),auth['isAuthenticated'](),controller[_0x7569('0xa')]);router[_0x7569('0xb')](_0x7569('0x5'),auth[_0x7569('0x6')](),controller[_0x7569('0xc')]);module[_0x7569('0xd')]=router; \ No newline at end of file +var _0xad68=['show','post','destroy','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id'];(function(_0x446542,_0x2f804f){var _0x3ed814=function(_0x148d88){while(--_0x148d88){_0x446542['push'](_0x446542['shift']());}};_0x3ed814(++_0x2f804f);}(_0xad68,0x100));var _0x8ad6=function(_0x4812c9,_0x154b76){_0x4812c9=_0x4812c9-0x0;var _0x4de61f=_0xad68[_0x4812c9];return _0x4de61f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8ad6('0x0'));var timeout=require(_0x8ad6('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x8ad6('0x2'));var interaction=require(_0x8ad6('0x3'));var config=require(_0x8ad6('0x4'));var controller=require(_0x8ad6('0x5'));router[_0x8ad6('0x6')]('/',auth[_0x8ad6('0x7')](),controller[_0x8ad6('0x8')]);router['get'](_0x8ad6('0x9'),auth[_0x8ad6('0x7')](),controller[_0x8ad6('0xa')]);router[_0x8ad6('0xb')]('/',auth[_0x8ad6('0x7')](),controller['create']);router['put'](_0x8ad6('0x9'),auth[_0x8ad6('0x7')](),controller['update']);router['delete'](_0x8ad6('0x9'),auth[_0x8ad6('0x7')](),controller[_0x8ad6('0xc')]);module[_0x8ad6('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 6eb908a..230486a 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 _0xd029=['sequelize','moment','exports','STRING','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xaac4b5,_0xf84a55){var _0x3a827b=function(_0x337e7f){while(--_0x337e7f){_0xaac4b5['push'](_0xaac4b5['shift']());}};_0x3a827b(++_0xf84a55);}(_0xd029,0x1c2));var _0x9d02=function(_0x2f6847,_0x4d8e05){_0x2f6847=_0x2f6847-0x0;var _0x59d535=_0xd029[_0x2f6847];return _0x59d535;};'use strict';var Sequelize=require(_0x9d02('0x0'));var moment=require(_0x9d02('0x1'));module[_0x9d02('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x9d02('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x9d02('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x9d02('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x9d02('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x9d02('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x9d02('0x4')](_0x9d02('0x5'))}}; \ No newline at end of file +var _0x8d68=['sequelize','exports','STRING','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1a64f3,_0x4b2b6b){var _0x37d68f=function(_0x386b3f){while(--_0x386b3f){_0x1a64f3['push'](_0x1a64f3['shift']());}};_0x37d68f(++_0x4b2b6b);}(_0x8d68,0xb4));var _0x88d6=function(_0x217920,_0x2eba1f){_0x217920=_0x217920-0x0;var _0x1b9041=_0x8d68[_0x217920];return _0x1b9041;};'use strict';var Sequelize=require(_0x88d6('0x0'));var moment=require('moment');module[_0x88d6('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x88d6('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x88d6('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x88d6('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x88d6('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x88d6('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x88d6('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x88d6('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x88d6('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x88d6('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x88d6('0x3')](_0x88d6('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 41b7416..6abba8c 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 _0xb16f=['ejs','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','then','destroy','name','index','map','VoiceQueuesLog','fieldName','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','catch','show','create','body','find','params','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x12ebb5,_0x389b02){var _0x46c15f=function(_0x27d5c8){while(--_0x27d5c8){_0x12ebb5['push'](_0x12ebb5['shift']());}};_0x46c15f(++_0x389b02);}(_0xb16f,0x135));var _0xfb16=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0xb16f[_0x15ca1a];return _0x507626;};'use strict';var pdf=require(_0xfb16('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfb16('0x1'));var jsonpatch=require(_0xfb16('0x2'));var rp=require(_0xfb16('0x3'));var moment=require(_0xfb16('0x4'));var BPromise=require(_0xfb16('0x5'));var Mustache=require(_0xfb16('0x6'));var util=require(_0xfb16('0x7'));var path=require(_0xfb16('0x8'));var sox=require(_0xfb16('0x9'));var csv=require(_0xfb16('0xa'));var ejs=require(_0xfb16('0xb'));var fs=require('fs');var _=require(_0xfb16('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfb16('0xd'));var toCsv=require(_0xfb16('0xa'));var querystring=require(_0xfb16('0xe'));var Papa=require(_0xfb16('0xf'));var Redis=require('ioredis');var authService=require(_0xfb16('0x10'));var qs=require(_0xfb16('0x11'));var as=require(_0xfb16('0x12'));var hardwareService=require(_0xfb16('0x13'));var logger=require('../../config/logger')(_0xfb16('0x14'));var utils=require(_0xfb16('0x15'));var config=require(_0xfb16('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xee0c2d,_0x3de735){_0x3de735=_0x3de735||0xcc;return function(_0x1ddb6c){if(_0x1ddb6c){return _0xee0c2d[_0xfb16('0x17')](_0x3de735);}return _0xee0c2d[_0xfb16('0x18')](_0x3de735)[_0xfb16('0x19')]();};}function respondWithResult(_0xcac77e,_0x14d55f){_0x14d55f=_0x14d55f||0xc8;return function(_0x4a1968){if(_0x4a1968){return _0xcac77e['status'](_0x14d55f)[_0xfb16('0x1a')](_0x4a1968);}};}function respondWithFilteredResult(_0x46469f,_0xea22d5){return function(_0x48cb09){if(_0x48cb09){var _0x41cacd=_0x48cb09[_0xfb16('0x1b')],_0x54bf40=_0xea22d5[_0xfb16('0x1c')],_0x2ed2bf=_0xea22d5[_0xfb16('0x1c')]+_0xea22d5[_0xfb16('0x1d')],_0x375859;if(_0x2ed2bf>=_0x41cacd){_0x2ed2bf=_0x41cacd;_0x375859=0xc8;}else{_0x375859=0xce;}_0x46469f[_0xfb16('0x18')](_0x375859);return _0x46469f['set'](_0xfb16('0x1e'),_0x54bf40+'-'+_0x2ed2bf+'/'+_0x41cacd)[_0xfb16('0x1a')](_0x48cb09);}return null;};}function patchUpdates(_0x451a26){return function(_0x549301){try{jsonpatch['apply'](_0x549301,_0x451a26,!![]);}catch(_0x34c172){return BPromise[_0xfb16('0x1f')](_0x34c172);}return _0x549301['save']();};}function saveUpdates(_0x2d7a6a,_0x7bc194){return function(_0x3b252f){if(_0x3b252f){return _0x3b252f['update'](_0x2d7a6a)[_0xfb16('0x20')](function(_0x4d52e6){return _0x4d52e6;});}return null;};}function removeEntity(_0x198e85,_0x451127){return function(_0x32cb98){if(_0x32cb98){return _0x32cb98[_0xfb16('0x21')]()[_0xfb16('0x20')](function(){_0x198e85[_0xfb16('0x18')](0xcc)[_0xfb16('0x19')]();});}};}function handleEntityNotFound(_0x7edcb6,_0x46a30c){return function(_0x8c4285){if(!_0x8c4285){_0x7edcb6[_0xfb16('0x17')](0x194);}return _0x8c4285;};}function handleError(_0x444169,_0xc0610b){_0xc0610b=_0xc0610b||0x1f4;return function(_0xcdf66d){logger['error'](_0xcdf66d['stack']);if(_0xcdf66d[_0xfb16('0x22')]){delete _0xcdf66d['name'];}_0x444169['status'](_0xc0610b)['send'](_0xcdf66d);};}exports[_0xfb16('0x23')]=function(_0x4dc5cb,_0x4a62c4){var _0x25b091={},_0x3ab0ca={},_0x2d647a={'count':0x0,'rows':[]};var _0xf0c453=_[_0xfb16('0x24')](db[_0xfb16('0x25')]['rawAttributes'],function(_0x403e73){return{'name':_0x403e73[_0xfb16('0x26')],'type':_0x403e73['type'][_0xfb16('0x27')]};});_0x3ab0ca[_0xfb16('0x28')]=_['map'](_0xf0c453,_0xfb16('0x22'));_0x3ab0ca[_0xfb16('0x29')]=_['keys'](_0x4dc5cb[_0xfb16('0x29')]);_0x3ab0ca[_0xfb16('0x2a')]=_['intersection'](_0x3ab0ca[_0xfb16('0x28')],_0x3ab0ca['query']);_0x25b091[_0xfb16('0x2b')]=_[_0xfb16('0x2c')](_0x3ab0ca[_0xfb16('0x28')],qs[_0xfb16('0x2d')](_0x4dc5cb['query'][_0xfb16('0x2d')]));_0x25b091['attributes']=_0x25b091[_0xfb16('0x2b')][_0xfb16('0x2e')]?_0x25b091['attributes']:_0x3ab0ca[_0xfb16('0x28')];if(!_0x4dc5cb['query']['hasOwnProperty'](_0xfb16('0x2f'))){_0x25b091['limit']=qs[_0xfb16('0x1d')](_0x4dc5cb['query'][_0xfb16('0x1d')]);_0x25b091['offset']=qs[_0xfb16('0x1c')](_0x4dc5cb[_0xfb16('0x29')][_0xfb16('0x1c')]);}_0x25b091[_0xfb16('0x30')]=qs[_0xfb16('0x31')](_0x4dc5cb[_0xfb16('0x29')][_0xfb16('0x31')]);_0x25b091[_0xfb16('0x32')]=qs[_0xfb16('0x2a')](_[_0xfb16('0x33')](_0x4dc5cb[_0xfb16('0x29')],_0x3ab0ca['filters']));if(_0x4dc5cb[_0xfb16('0x29')][_0xfb16('0x34')]){_0x25b091[_0xfb16('0x32')]=_[_0xfb16('0x35')](_0x25b091[_0xfb16('0x32')],{'$or':_[_0xfb16('0x24')](_0xf0c453,function(_0x20d8a0){if(_0x20d8a0[_0xfb16('0x36')]!=='VIRTUAL'){var _0x2bfc65={};_0x2bfc65[_0x20d8a0[_0xfb16('0x22')]]={'$like':'%'+_0x4dc5cb[_0xfb16('0x29')][_0xfb16('0x34')]+'%'};return _0x2bfc65;}})});}_0x25b091=_[_0xfb16('0x35')]({},_0x25b091,_0x4dc5cb[_0xfb16('0x37')]);var _0x47515b={'where':_0x25b091[_0xfb16('0x32')]};return db['VoiceQueuesLog']['count'](_0x47515b)[_0xfb16('0x20')](function(_0x2645f7){_0x2d647a['count']=_0x2645f7;if(_0x4dc5cb[_0xfb16('0x29')]['includeAll']){_0x25b091[_0xfb16('0x38')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xfb16('0x39')](_0x25b091);})[_0xfb16('0x20')](function(_0x5f286b){_0x2d647a['rows']=_0x5f286b;return _0x2d647a;})['then'](respondWithFilteredResult(_0x4a62c4,_0x25b091))[_0xfb16('0x3a')](handleError(_0x4a62c4,null));};exports[_0xfb16('0x3b')]=function(_0x5dae22,_0x289020){var _0x3754b8={'raw':!![],'where':{'id':_0x5dae22['params']['id']}},_0x4d8bd9={};_0x4d8bd9[_0xfb16('0x28')]=_['keys'](db['VoiceQueuesLog']['rawAttributes']);_0x4d8bd9[_0xfb16('0x29')]=_['keys'](_0x5dae22[_0xfb16('0x29')]);_0x4d8bd9[_0xfb16('0x2a')]=_[_0xfb16('0x2c')](_0x4d8bd9['model'],_0x4d8bd9[_0xfb16('0x29')]);_0x3754b8[_0xfb16('0x2b')]=_[_0xfb16('0x2c')](_0x4d8bd9[_0xfb16('0x28')],qs[_0xfb16('0x2d')](_0x5dae22[_0xfb16('0x29')][_0xfb16('0x2d')]));_0x3754b8[_0xfb16('0x2b')]=_0x3754b8['attributes'][_0xfb16('0x2e')]?_0x3754b8[_0xfb16('0x2b')]:_0x4d8bd9['model'];if(_0x5dae22[_0xfb16('0x29')]['includeAll']){_0x3754b8[_0xfb16('0x38')]=[{'all':!![]}];}_0x3754b8=_[_0xfb16('0x35')]({},_0x3754b8,_0x5dae22[_0xfb16('0x37')]);return db[_0xfb16('0x25')]['find'](_0x3754b8)[_0xfb16('0x20')](handleEntityNotFound(_0x289020,null))[_0xfb16('0x20')](respondWithResult(_0x289020,null))[_0xfb16('0x3a')](handleError(_0x289020,null));};exports[_0xfb16('0x3c')]=function(_0x1cf61c,_0x320228){return db[_0xfb16('0x25')][_0xfb16('0x3c')](_0x1cf61c[_0xfb16('0x3d')],{})[_0xfb16('0x20')](respondWithResult(_0x320228,0xc9))['catch'](handleError(_0x320228,null));};exports['update']=function(_0x1ec494,_0x5c97c5){if(_0x1ec494[_0xfb16('0x3d')]['id']){delete _0x1ec494[_0xfb16('0x3d')]['id'];}return db[_0xfb16('0x25')][_0xfb16('0x3e')]({'where':{'id':_0x1ec494['params']['id']}})[_0xfb16('0x20')](handleEntityNotFound(_0x5c97c5,null))[_0xfb16('0x20')](saveUpdates(_0x1ec494[_0xfb16('0x3d')],null))[_0xfb16('0x20')](respondWithResult(_0x5c97c5,null))[_0xfb16('0x3a')](handleError(_0x5c97c5,null));};exports[_0xfb16('0x21')]=function(_0x3a696c,_0x11f831){return db['VoiceQueuesLog'][_0xfb16('0x3e')]({'where':{'id':_0x3a696c[_0xfb16('0x3f')]['id']}})[_0xfb16('0x20')](handleEntityNotFound(_0x11f831,null))[_0xfb16('0x20')](removeEntity(_0x11f831,null))[_0xfb16('0x3a')](handleError(_0x11f831,null));}; \ No newline at end of file +var _0x9e0c=['length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','rows','catch','show','params','include','create','body','update','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','then','destroy','name','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x9e0c,0x1bd));var _0xc9e0=function(_0x5a6858,_0x2c0491){_0x5a6858=_0x5a6858-0x0;var _0x305289=_0x9e0c[_0x5a6858];return _0x305289;};'use strict';var pdf=require(_0xc9e0('0x0'));var emlformat=require(_0xc9e0('0x1'));var rimraf=require(_0xc9e0('0x2'));var zipdir=require(_0xc9e0('0x3'));var jsonpatch=require(_0xc9e0('0x4'));var rp=require(_0xc9e0('0x5'));var moment=require(_0xc9e0('0x6'));var BPromise=require(_0xc9e0('0x7'));var Mustache=require(_0xc9e0('0x8'));var util=require(_0xc9e0('0x9'));var path=require('path');var sox=require(_0xc9e0('0xa'));var csv=require('to-csv');var ejs=require(_0xc9e0('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc9e0('0xc'));var crypto=require(_0xc9e0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc9e0('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc9e0('0xf'));var Papa=require(_0xc9e0('0x10'));var Redis=require(_0xc9e0('0x11'));var authService=require(_0xc9e0('0x12'));var qs=require(_0xc9e0('0x13'));var as=require(_0xc9e0('0x14'));var hardwareService=require(_0xc9e0('0x15'));var logger=require(_0xc9e0('0x16'))('api');var utils=require(_0xc9e0('0x17'));var config=require('../../config/environment');var db=require(_0xc9e0('0x18'))['db'];function respondWithStatusCode(_0x49721c,_0x1ae7df){_0x1ae7df=_0x1ae7df||0xcc;return function(_0xede021){if(_0xede021){return _0x49721c[_0xc9e0('0x19')](_0x1ae7df);}return _0x49721c[_0xc9e0('0x1a')](_0x1ae7df)[_0xc9e0('0x1b')]();};}function respondWithResult(_0x1c9f56,_0x123181){_0x123181=_0x123181||0xc8;return function(_0xe80be1){if(_0xe80be1){return _0x1c9f56[_0xc9e0('0x1a')](_0x123181)[_0xc9e0('0x1c')](_0xe80be1);}};}function respondWithFilteredResult(_0x501ccc,_0x41958b){return function(_0xbdb1ea){if(_0xbdb1ea){var _0x330b61=_0xbdb1ea[_0xc9e0('0x1d')],_0x547692=_0x41958b[_0xc9e0('0x1e')],_0xf61a52=_0x41958b[_0xc9e0('0x1e')]+_0x41958b[_0xc9e0('0x1f')],_0x260183;if(_0xf61a52>=_0x330b61){_0xf61a52=_0x330b61;_0x260183=0xc8;}else{_0x260183=0xce;}_0x501ccc['status'](_0x260183);return _0x501ccc[_0xc9e0('0x20')](_0xc9e0('0x21'),_0x547692+'-'+_0xf61a52+'/'+_0x330b61)[_0xc9e0('0x1c')](_0xbdb1ea);}return null;};}function patchUpdates(_0x211f53){return function(_0xee1fef){try{jsonpatch['apply'](_0xee1fef,_0x211f53,!![]);}catch(_0xbb6909){return BPromise['reject'](_0xbb6909);}return _0xee1fef[_0xc9e0('0x22')]();};}function saveUpdates(_0x9f9ea0,_0x4786df){return function(_0x3cf5c6){if(_0x3cf5c6){return _0x3cf5c6['update'](_0x9f9ea0)[_0xc9e0('0x23')](function(_0xd784ad){return _0xd784ad;});}return null;};}function removeEntity(_0x487d20,_0x1c984d){return function(_0x5f3502){if(_0x5f3502){return _0x5f3502[_0xc9e0('0x24')]()[_0xc9e0('0x23')](function(){_0x487d20[_0xc9e0('0x1a')](0xcc)[_0xc9e0('0x1b')]();});}};}function handleEntityNotFound(_0x1af139,_0x5d61d3){return function(_0x1000e1){if(!_0x1000e1){_0x1af139['sendStatus'](0x194);}return _0x1000e1;};}function handleError(_0x5af78e,_0x11ff1e){_0x11ff1e=_0x11ff1e||0x1f4;return function(_0xade436){logger['error'](_0xade436['stack']);if(_0xade436[_0xc9e0('0x25')]){delete _0xade436['name'];}_0x5af78e[_0xc9e0('0x1a')](_0x11ff1e)['send'](_0xade436);};}exports[_0xc9e0('0x26')]=function(_0x563e33,_0x5acddd){var _0x588816={},_0x38e2be={},_0x1caa26={'count':0x0,'rows':[]};var _0x57f8c8=_[_0xc9e0('0x27')](db[_0xc9e0('0x28')][_0xc9e0('0x29')],function(_0x438e40){return{'name':_0x438e40[_0xc9e0('0x2a')],'type':_0x438e40[_0xc9e0('0x2b')][_0xc9e0('0x2c')]};});_0x38e2be[_0xc9e0('0x2d')]=_[_0xc9e0('0x27')](_0x57f8c8,_0xc9e0('0x25'));_0x38e2be['query']=_[_0xc9e0('0x2e')](_0x563e33[_0xc9e0('0x2f')]);_0x38e2be[_0xc9e0('0x30')]=_[_0xc9e0('0x31')](_0x38e2be['model'],_0x38e2be[_0xc9e0('0x2f')]);_0x588816[_0xc9e0('0x32')]=_[_0xc9e0('0x31')](_0x38e2be[_0xc9e0('0x2d')],qs[_0xc9e0('0x33')](_0x563e33['query']['fields']));_0x588816[_0xc9e0('0x32')]=_0x588816[_0xc9e0('0x32')][_0xc9e0('0x34')]?_0x588816[_0xc9e0('0x32')]:_0x38e2be['model'];if(!_0x563e33['query'][_0xc9e0('0x35')]('nolimit')){_0x588816[_0xc9e0('0x1f')]=qs[_0xc9e0('0x1f')](_0x563e33['query'][_0xc9e0('0x1f')]);_0x588816[_0xc9e0('0x1e')]=qs[_0xc9e0('0x1e')](_0x563e33['query']['offset']);}_0x588816[_0xc9e0('0x36')]=qs[_0xc9e0('0x37')](_0x563e33[_0xc9e0('0x2f')][_0xc9e0('0x37')]);_0x588816[_0xc9e0('0x38')]=qs['filters'](_[_0xc9e0('0x39')](_0x563e33[_0xc9e0('0x2f')],_0x38e2be['filters']));if(_0x563e33[_0xc9e0('0x2f')][_0xc9e0('0x3a')]){_0x588816[_0xc9e0('0x38')]=_['merge'](_0x588816[_0xc9e0('0x38')],{'$or':_[_0xc9e0('0x27')](_0x57f8c8,function(_0x323796){if(_0x323796[_0xc9e0('0x2b')]!==_0xc9e0('0x3b')){var _0x1bede9={};_0x1bede9[_0x323796[_0xc9e0('0x25')]]={'$like':'%'+_0x563e33[_0xc9e0('0x2f')]['filter']+'%'};return _0x1bede9;}})});}_0x588816=_[_0xc9e0('0x3c')]({},_0x588816,_0x563e33['options']);var _0x404237={'where':_0x588816[_0xc9e0('0x38')]};return db[_0xc9e0('0x28')][_0xc9e0('0x1d')](_0x404237)[_0xc9e0('0x23')](function(_0x58364e){_0x1caa26['count']=_0x58364e;if(_0x563e33[_0xc9e0('0x2f')][_0xc9e0('0x3d')]){_0x588816['include']=[{'all':!![]}];}return db[_0xc9e0('0x28')]['findAll'](_0x588816);})[_0xc9e0('0x23')](function(_0xf73575){_0x1caa26[_0xc9e0('0x3e')]=_0xf73575;return _0x1caa26;})['then'](respondWithFilteredResult(_0x5acddd,_0x588816))[_0xc9e0('0x3f')](handleError(_0x5acddd,null));};exports[_0xc9e0('0x40')]=function(_0x19bbc4,_0x3b9fb1){var _0x52cffb={'raw':!![],'where':{'id':_0x19bbc4[_0xc9e0('0x41')]['id']}},_0x38308c={};_0x38308c['model']=_[_0xc9e0('0x2e')](db[_0xc9e0('0x28')]['rawAttributes']);_0x38308c[_0xc9e0('0x2f')]=_[_0xc9e0('0x2e')](_0x19bbc4[_0xc9e0('0x2f')]);_0x38308c[_0xc9e0('0x30')]=_[_0xc9e0('0x31')](_0x38308c[_0xc9e0('0x2d')],_0x38308c[_0xc9e0('0x2f')]);_0x52cffb[_0xc9e0('0x32')]=_['intersection'](_0x38308c[_0xc9e0('0x2d')],qs['fields'](_0x19bbc4[_0xc9e0('0x2f')]['fields']));_0x52cffb['attributes']=_0x52cffb[_0xc9e0('0x32')][_0xc9e0('0x34')]?_0x52cffb[_0xc9e0('0x32')]:_0x38308c[_0xc9e0('0x2d')];if(_0x19bbc4['query']['includeAll']){_0x52cffb[_0xc9e0('0x42')]=[{'all':!![]}];}_0x52cffb=_[_0xc9e0('0x3c')]({},_0x52cffb,_0x19bbc4['options']);return db[_0xc9e0('0x28')]['find'](_0x52cffb)['then'](handleEntityNotFound(_0x3b9fb1,null))[_0xc9e0('0x23')](respondWithResult(_0x3b9fb1,null))[_0xc9e0('0x3f')](handleError(_0x3b9fb1,null));};exports[_0xc9e0('0x43')]=function(_0x283380,_0x2a38f5){return db[_0xc9e0('0x28')][_0xc9e0('0x43')](_0x283380[_0xc9e0('0x44')],{})[_0xc9e0('0x23')](respondWithResult(_0x2a38f5,0xc9))[_0xc9e0('0x3f')](handleError(_0x2a38f5,null));};exports[_0xc9e0('0x45')]=function(_0x44e57f,_0xffcfc8){if(_0x44e57f[_0xc9e0('0x44')]['id']){delete _0x44e57f[_0xc9e0('0x44')]['id'];}return db[_0xc9e0('0x28')]['find']({'where':{'id':_0x44e57f[_0xc9e0('0x41')]['id']}})['then'](handleEntityNotFound(_0xffcfc8,null))['then'](saveUpdates(_0x44e57f[_0xc9e0('0x44')],null))[_0xc9e0('0x23')](respondWithResult(_0xffcfc8,null))[_0xc9e0('0x3f')](handleError(_0xffcfc8,null));};exports[_0xc9e0('0x24')]=function(_0xb87b94,_0x567bc0){return db[_0xc9e0('0x28')][_0xc9e0('0x46')]({'where':{'id':_0xb87b94[_0xc9e0('0x41')]['id']}})[_0xc9e0('0x23')](handleEntityNotFound(_0x567bc0,null))['then'](removeEntity(_0x567bc0,null))[_0xc9e0('0x3f')](handleError(_0x567bc0,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index f7c9a8a..81dcdbe 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 _0x1e6b=['VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueuesLog.attributes','define'];(function(_0x570654,_0x548786){var _0x4d857a=function(_0x2db5e0){while(--_0x2db5e0){_0x570654['push'](_0x570654['shift']());}};_0x4d857a(++_0x548786);}(_0x1e6b,0x1b5));var _0xb1e6=function(_0x25ff2a,_0x2f7ac0){_0x25ff2a=_0x25ff2a-0x0;var _0x491728=_0x1e6b[_0x25ff2a];return _0x491728;};'use strict';var _=require(_0xb1e6('0x0'));var util=require(_0xb1e6('0x1'));var logger=require(_0xb1e6('0x2'))(_0xb1e6('0x3'));var moment=require(_0xb1e6('0x4'));var BPromise=require(_0xb1e6('0x5'));var rp=require(_0xb1e6('0x6'));var fs=require('fs');var path=require(_0xb1e6('0x7'));var rimraf=require(_0xb1e6('0x8'));var config=require('../../config/environment');var attributes=require(_0xb1e6('0x9'));module['exports']=function(_0xe760a1,_0x8ee2e5){return _0xe760a1[_0xb1e6('0xa')](_0xb1e6('0xb'),attributes,{'tableName':_0xb1e6('0xc'),'paranoid':![],'indexes':[{'name':_0xb1e6('0xd'),'fields':[_0xb1e6('0xe'),_0xb1e6('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x783b=['bluebird','request-promise','path','exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment'];(function(_0x4f7742,_0x15ce9a){var _0x270a53=function(_0x55f52f){while(--_0x55f52f){_0x4f7742['push'](_0x4f7742['shift']());}};_0x270a53(++_0x15ce9a);}(_0x783b,0x95));var _0xb783=function(_0xc72e3e,_0xcc80ba){_0xc72e3e=_0xc72e3e-0x0;var _0x5c2609=_0x783b[_0xc72e3e];return _0x5c2609;};'use strict';var _=require(_0xb783('0x0'));var util=require(_0xb783('0x1'));var logger=require(_0xb783('0x2'))(_0xb783('0x3'));var moment=require(_0xb783('0x4'));var BPromise=require(_0xb783('0x5'));var rp=require(_0xb783('0x6'));var fs=require('fs');var path=require(_0xb783('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module[_0xb783('0x8')]=function(_0x58594f,_0x521373){return _0x58594f['define'](_0xb783('0x9'),attributes,{'tableName':_0xb783('0xa'),'paranoid':![],'indexes':[{'name':_0xb783('0xb'),'fields':[_0xb783('0xc'),_0xb783('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index e646428..84076ca 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 _0xeb74=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x1028fb,_0x3d2737){var _0x3805cd=function(_0x19e976){while(--_0x19e976){_0x1028fb['push'](_0x1028fb['shift']());}};_0x3805cd(++_0x3d2737);}(_0xeb74,0xe3));var _0x4eb7=function(_0x25ef56,_0x2948d2){_0x25ef56=_0x25ef56-0x0;var _0x4252db=_0xeb74[_0x25ef56];return _0x4252db;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var moment=require(_0x4eb7('0x2'));var BPromise=require(_0x4eb7('0x3'));var rs=require(_0x4eb7('0x4'));var fs=require('fs');var Redis=require(_0x4eb7('0x5'));var db=require(_0x4eb7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eb7('0x7'))(_0x4eb7('0x8'));var config=require(_0x4eb7('0x9'));var jayson=require(_0x4eb7('0xa'));var client=jayson[_0x4eb7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3986cd,_0x54859c,_0xcac7c5){return new BPromise(function(_0x2cffe7,_0x588a1c){return client['request'](_0x3986cd,_0xcac7c5)[_0x4eb7('0xc')](function(_0x2f8296){logger['info'](_0x4eb7('0xd'),_0x54859c,'request\x20sent');logger[_0x4eb7('0xe')](_0x4eb7('0xf'),_0x54859c,_0x4eb7('0x10'),JSON['stringify'](_0x2f8296));if(_0x2f8296[_0x4eb7('0x11')]){if(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x12')]===0x1f4){logger[_0x4eb7('0x11')](_0x4eb7('0xd'),_0x54859c,_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);return _0x588a1c(_0x2f8296['error']['message']);}logger['error'](_0x4eb7('0xd'),_0x54859c,_0x2f8296['error'][_0x4eb7('0x13')]);return _0x2cffe7(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);}else{logger[_0x4eb7('0x14')](_0x4eb7('0xd'),_0x54859c,_0x4eb7('0x10'));_0x2cffe7(_0x2f8296[_0x4eb7('0x15')][_0x4eb7('0x13')]);}})[_0x4eb7('0x16')](function(_0x17377f){logger['error'](_0x4eb7('0xd'),_0x54859c,_0x17377f);_0x588a1c(_0x17377f);});});} \ No newline at end of file +var _0x1be1=['stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x1be1,0x192));var _0x11be=function(_0x10a5db,_0x3a3304){_0x10a5db=_0x10a5db-0x0;var _0xb2f66e=_0x1be1[_0x10a5db];return _0xb2f66e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x11be('0x0'));var BPromise=require(_0x11be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11be('0x2'));var db=require(_0x11be('0x3'))['db'];var utils=require(_0x11be('0x4'));var logger=require(_0x11be('0x5'))('rpc');var config=require(_0x11be('0x6'));var jayson=require(_0x11be('0x7'));var client=jayson[_0x11be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe8c62,_0x497730,_0x18f661){return new BPromise(function(_0x11fc15,_0x246772){return client[_0x11be('0x9')](_0xfe8c62,_0x18f661)[_0x11be('0xa')](function(_0x5f3d04){logger[_0x11be('0xb')](_0x11be('0xc'),_0x497730,'request\x20sent');logger[_0x11be('0xd')](_0x11be('0xe'),_0x497730,_0x11be('0xf'),JSON[_0x11be('0x10')](_0x5f3d04));if(_0x5f3d04['error']){if(_0x5f3d04[_0x11be('0x11')][_0x11be('0x12')]===0x1f4){logger[_0x11be('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x497730,_0x5f3d04[_0x11be('0x11')][_0x11be('0x13')]);return _0x246772(_0x5f3d04['error'][_0x11be('0x13')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x497730,_0x5f3d04['error']['message']);return _0x11fc15(_0x5f3d04['error']['message']);}else{logger['info'](_0x11be('0xc'),_0x497730,'request\x20sent');_0x11fc15(_0x5f3d04[_0x11be('0x14')][_0x11be('0x13')]);}})[_0x11be('0x15')](function(_0x216b8c){logger['error'](_0x11be('0xc'),_0x497730,_0x216b8c);_0x246772(_0x216b8c);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index ed9adc6..248d02f 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 _0x567a=['../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','show','download','downloads','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3e2708,_0x29ea9c){var _0x1ad64a=function(_0xa38717){while(--_0xa38717){_0x3e2708['push'](_0x3e2708['shift']());}};_0x1ad64a(++_0x29ea9c);}(_0x567a,0xbe));var _0xa567=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x567a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa567('0x0'));var util=require(_0xa567('0x1'));var path=require(_0xa567('0x2'));var timeout=require(_0xa567('0x3'));var express=require(_0xa567('0x4'));var router=express[_0xa567('0x5')]();var auth=require(_0xa567('0x6'));var interaction=require(_0xa567('0x7'));var config=require(_0xa567('0x8'));var controller=require(_0xa567('0x9'));router[_0xa567('0xa')]('/',auth[_0xa567('0xb')](),controller[_0xa567('0xc')]);router[_0xa567('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xa567('0xb')](),controller[_0xa567('0xd')]);router['get']('/:id/download',auth[_0xa567('0xb')](),controller[_0xa567('0xe')]);router[_0xa567('0xa')]('/:id/downloads',controller[_0xa567('0xf')]);router[_0xa567('0x10')]('/',auth[_0xa567('0xb')](),controller[_0xa567('0x11')]);router['put'](_0xa567('0x12'),auth[_0xa567('0xb')](),controller['update']);router[_0xa567('0x13')](_0xa567('0x12'),auth[_0xa567('0xb')](),controller[_0xa567('0x14')]);module[_0xa567('0x15')]=router; \ No newline at end of file +var _0xa686=['delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','/:id/downloads','downloads','create','update'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0xa686,0x15c));var _0x6a68=function(_0x2a58c8,_0x33b456){_0x2a58c8=_0x2a58c8-0x0;var _0x41b4e8=_0xa686[_0x2a58c8];return _0x41b4e8;};'use strict';var multer=require(_0x6a68('0x0'));var util=require(_0x6a68('0x1'));var path=require(_0x6a68('0x2'));var timeout=require('connect-timeout');var express=require(_0x6a68('0x3'));var router=express[_0x6a68('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6a68('0x5'));var config=require(_0x6a68('0x6'));var controller=require(_0x6a68('0x7'));router[_0x6a68('0x8')]('/',auth[_0x6a68('0x9')](),controller[_0x6a68('0xa')]);router[_0x6a68('0x8')](_0x6a68('0xb'),auth[_0x6a68('0x9')](),controller[_0x6a68('0xc')]);router['get'](_0x6a68('0xd'),auth['isAuthenticated'](),controller[_0x6a68('0xe')]);router[_0x6a68('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x6a68('0xf')]);router[_0x6a68('0x8')](_0x6a68('0x10'),controller[_0x6a68('0x11')]);router['post']('/',auth[_0x6a68('0x9')](),controller[_0x6a68('0x12')]);router['put'](_0x6a68('0xd'),auth['isAuthenticated'](),controller[_0x6a68('0x13')]);router[_0x6a68('0x14')]('/:id',auth[_0x6a68('0x9')](),controller[_0x6a68('0x15')]);module[_0x6a68('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 259ccbf..137bf48 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 _0x723b=['extname','STRING','channel','setDataValue','membername','split','DATE','format','toString','updatedAt','MM-DD-YYYY\x20HH:mm','moment','path','exports','VIRTUAL','getDataValue','value'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x723b,0x11b));var _0xb723=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x723b[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb723('0x0'));var path=require(_0xb723('0x1'));module[_0xb723('0x2')]={'format':{'type':Sequelize[_0xb723('0x3')],'get':function(){return this[_0xb723('0x4')](_0xb723('0x5'))?path[_0xb723('0x6')](this[_0xb723('0x4')](_0xb723('0x5'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb723('0x7')],'set':function(_0x1ab8de){if(_0x1ab8de){this['setDataValue'](_0xb723('0x8'),_0x1ab8de);this[_0xb723('0x9')](_0xb723('0xa'),_0x1ab8de[_0xb723('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xb723('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb723('0x7')]},'connectedlinename':{'type':Sequelize[_0xb723('0x7')]},'accountcode':{'type':Sequelize[_0xb723('0x7')]},'context':{'type':Sequelize[_0xb723('0x7')]},'exten':{'type':Sequelize[_0xb723('0x7')]},'value':{'type':Sequelize[_0xb723('0x7')]},'type':{'type':Sequelize[_0xb723('0x7')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize[_0xb723('0xc')],'get':function(){return moment(this['getDataValue']('createdAt'))[_0xb723('0xd')]('MM-DD-YYYY\x20HH:mm')[_0xb723('0xe')]();}},'updatedAt':{'type':Sequelize[_0xb723('0xc')],'get':function(){return moment(this[_0xb723('0x4')](_0xb723('0xf')))['format'](_0xb723('0x10'))['toString']();}}}; \ No newline at end of file +var _0xcd63=['INTEGER','getDataValue','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','sequelize','moment','path','exports','VIRTUAL','value','extname','STRING','channel','setDataValue','membername','split'];(function(_0x48b0a8,_0x32ced5){var _0x322218=function(_0x2fe286){while(--_0x2fe286){_0x48b0a8['push'](_0x48b0a8['shift']());}};_0x322218(++_0x32ced5);}(_0xcd63,0xe4));var _0x3cd6=function(_0x3637e0,_0x22b5f9){_0x3637e0=_0x3637e0-0x0;var _0x54d5b2=_0xcd63[_0x3637e0];return _0x54d5b2;};'use strict';var Sequelize=require(_0x3cd6('0x0'));var moment=require(_0x3cd6('0x1'));var path=require(_0x3cd6('0x2'));module[_0x3cd6('0x3')]={'format':{'type':Sequelize[_0x3cd6('0x4')],'get':function(){return this['getDataValue'](_0x3cd6('0x5'))?path[_0x3cd6('0x6')](this['getDataValue']('value')):undefined;}},'uniqueid':{'type':Sequelize[_0x3cd6('0x7')]},'channel':{'type':Sequelize[_0x3cd6('0x7')],'set':function(_0x17974e){if(_0x17974e){this['setDataValue'](_0x3cd6('0x8'),_0x17974e);this[_0x3cd6('0x9')](_0x3cd6('0xa'),_0x17974e[_0x3cd6('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3cd6('0x7')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x3cd6('0x7')]},'connectedlinename':{'type':Sequelize[_0x3cd6('0x7')]},'accountcode':{'type':Sequelize[_0x3cd6('0x7')]},'context':{'type':Sequelize[_0x3cd6('0x7')]},'exten':{'type':Sequelize[_0x3cd6('0x7')]},'value':{'type':Sequelize[_0x3cd6('0x7')]},'type':{'type':Sequelize[_0x3cd6('0x7')]},'rating':{'type':Sequelize[_0x3cd6('0xc')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x3cd6('0xd')](_0x3cd6('0xe')))[_0x3cd6('0xf')](_0x3cd6('0x10'))[_0x3cd6('0x11')]();}},'updatedAt':{'type':Sequelize[_0x3cd6('0x12')],'get':function(){return moment(this[_0x3cd6('0xd')](_0x3cd6('0x13')))[_0x3cd6('0xf')](_0x3cd6('0x10'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 0c9839c..8ae092e 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 _0x4555=['end','count','offset','limit','json','apply','reject','save','then','destroy','error','name','send','index','map','VoiceRecording','fieldName','type','model','differenceBy','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','update','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','filename','download','unlink','message','VoiceRecording\x20not\x20found','downloads','sequelize','MD5','$and','push','extname','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x3740db,_0x2e5af1){var _0x69dc10=function(_0x23b8ed){while(--_0x23b8ed){_0x3740db['push'](_0x3740db['shift']());}};_0x69dc10(++_0x2e5af1);}(_0x4555,0x189));var _0x5455=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x4555[_0x6131cd];return _0x47e916;};'use strict';var pdf=require(_0x5455('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5455('0x1'));var jsonpatch=require(_0x5455('0x2'));var rp=require(_0x5455('0x3'));var moment=require(_0x5455('0x4'));var BPromise=require(_0x5455('0x5'));var Mustache=require(_0x5455('0x6'));var util=require(_0x5455('0x7'));var path=require(_0x5455('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5455('0x9'));var crypto=require(_0x5455('0xa'));var jsforce=require(_0x5455('0xb'));var deskjs=require(_0x5455('0xc'));var toCsv=require(_0x5455('0xd'));var querystring=require(_0x5455('0xe'));var Papa=require(_0x5455('0xf'));var Redis=require(_0x5455('0x10'));var authService=require(_0x5455('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5455('0x12'));var hardwareService=require(_0x5455('0x13'));var logger=require(_0x5455('0x14'))(_0x5455('0x15'));var utils=require(_0x5455('0x16'));var config=require(_0x5455('0x17'));var db=require(_0x5455('0x18'))['db'];function respondWithStatusCode(_0x11f221,_0x9bdf41){_0x9bdf41=_0x9bdf41||0xcc;return function(_0x435a2d){if(_0x435a2d){return _0x11f221[_0x5455('0x19')](_0x9bdf41);}return _0x11f221[_0x5455('0x1a')](_0x9bdf41)[_0x5455('0x1b')]();};}function respondWithResult(_0x2e8077,_0x30692a){_0x30692a=_0x30692a||0xc8;return function(_0x3e7c1e){if(_0x3e7c1e){return _0x2e8077['status'](_0x30692a)['json'](_0x3e7c1e);}};}function respondWithFilteredResult(_0x10bb6f,_0x2a8173){return function(_0x1a46ed){if(_0x1a46ed){var _0x4af9e3=_0x1a46ed[_0x5455('0x1c')],_0x5797d0=_0x2a8173[_0x5455('0x1d')],_0x12721f=_0x2a8173[_0x5455('0x1d')]+_0x2a8173[_0x5455('0x1e')],_0x5d0485;if(_0x12721f>=_0x4af9e3){_0x12721f=_0x4af9e3;_0x5d0485=0xc8;}else{_0x5d0485=0xce;}_0x10bb6f['status'](_0x5d0485);return _0x10bb6f['set']('Content-Range',_0x5797d0+'-'+_0x12721f+'/'+_0x4af9e3)[_0x5455('0x1f')](_0x1a46ed);}return null;};}function patchUpdates(_0x1c7905){return function(_0x5037be){try{jsonpatch[_0x5455('0x20')](_0x5037be,_0x1c7905,!![]);}catch(_0x192271){return BPromise[_0x5455('0x21')](_0x192271);}return _0x5037be[_0x5455('0x22')]();};}function saveUpdates(_0x5d5735,_0x4c2962){return function(_0x1db6c4){if(_0x1db6c4){return _0x1db6c4['update'](_0x5d5735)[_0x5455('0x23')](function(_0x2c3836){return _0x2c3836;});}return null;};}function removeEntity(_0x3b4ea1,_0x596705){return function(_0x35262d){if(_0x35262d){return _0x35262d[_0x5455('0x24')]()[_0x5455('0x23')](function(){_0x3b4ea1[_0x5455('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51267e,_0x4b6160){return function(_0x5ed6a2){if(!_0x5ed6a2){_0x51267e['sendStatus'](0x194);}return _0x5ed6a2;};}function handleError(_0x323080,_0x36afed){_0x36afed=_0x36afed||0x1f4;return function(_0x1ebdd1){logger[_0x5455('0x25')](_0x1ebdd1['stack']);if(_0x1ebdd1['name']){delete _0x1ebdd1[_0x5455('0x26')];}_0x323080['status'](_0x36afed)[_0x5455('0x27')](_0x1ebdd1);};}exports[_0x5455('0x28')]=function(_0x3a2326,_0x5ebde0){var _0x88a863={},_0x2c5e07={},_0x1f1641={'count':0x0,'rows':[]};var _0x3eeb2d=_[_0x5455('0x29')](db[_0x5455('0x2a')]['rawAttributes'],function(_0x50cdb3){return{'name':_0x50cdb3[_0x5455('0x2b')],'type':_0x50cdb3[_0x5455('0x2c')]['key']};});_0x2c5e07[_0x5455('0x2d')]=_[_0x5455('0x2e')](_[_0x5455('0x29')](_0x3eeb2d,'name'),[_0x5455('0x2f')]);_0x2c5e07[_0x5455('0x30')]=_['keys'](_0x3a2326[_0x5455('0x30')]);_0x2c5e07[_0x5455('0x31')]=_[_0x5455('0x32')](_0x2c5e07[_0x5455('0x2d')],_0x2c5e07['query']);_0x88a863['attributes']=_[_0x5455('0x32')](_0x2c5e07[_0x5455('0x2d')],qs['fields'](_0x3a2326[_0x5455('0x30')][_0x5455('0x33')]));_0x88a863['attributes']=_0x88a863[_0x5455('0x34')][_0x5455('0x35')]?_0x88a863[_0x5455('0x34')]:_0x2c5e07[_0x5455('0x2d')];if(!_0x3a2326[_0x5455('0x30')][_0x5455('0x36')](_0x5455('0x37'))){_0x88a863[_0x5455('0x1e')]=qs[_0x5455('0x1e')](_0x3a2326[_0x5455('0x30')][_0x5455('0x1e')]);_0x88a863[_0x5455('0x1d')]=qs[_0x5455('0x1d')](_0x3a2326[_0x5455('0x30')][_0x5455('0x1d')]);}_0x88a863[_0x5455('0x38')]=qs[_0x5455('0x39')](_0x3a2326[_0x5455('0x30')][_0x5455('0x39')]);_0x88a863[_0x5455('0x3a')]=qs[_0x5455('0x31')](_[_0x5455('0x3b')](_0x3a2326['query'],_0x2c5e07['filters']));if(_0x3a2326[_0x5455('0x30')][_0x5455('0x3c')]){_0x88a863[_0x5455('0x3a')]=_['merge'](_0x88a863[_0x5455('0x3a')],{'$or':_[_0x5455('0x29')](_0x3eeb2d,function(_0x4395a5){if(_0x4395a5[_0x5455('0x2c')]!==_0x5455('0x3d')){var _0x2121b4={};_0x2121b4[_0x4395a5[_0x5455('0x26')]]={'$like':'%'+_0x3a2326[_0x5455('0x30')][_0x5455('0x3c')]+'%'};return _0x2121b4;}})});}_0x88a863=_[_0x5455('0x3e')]({},_0x88a863,_0x3a2326[_0x5455('0x3f')]);var _0x50bd60={'where':_0x88a863[_0x5455('0x3a')]};return db[_0x5455('0x2a')][_0x5455('0x1c')](_0x50bd60)[_0x5455('0x23')](function(_0x3f6474){_0x1f1641[_0x5455('0x1c')]=_0x3f6474;if(_0x3a2326['query'][_0x5455('0x40')]){_0x88a863['include']=[{'all':!![]}];}return db[_0x5455('0x2a')]['findAll'](_0x88a863);})[_0x5455('0x23')](function(_0x58e66e){_0x1f1641[_0x5455('0x41')]=_0x58e66e;return _0x1f1641;})['then'](respondWithFilteredResult(_0x5ebde0,_0x88a863))[_0x5455('0x42')](handleError(_0x5ebde0,null));};exports[_0x5455('0x43')]=function(_0xaaeeb1,_0xe5a912){var _0x28d044={'raw':![],'where':{'id':_0xaaeeb1[_0x5455('0x44')]['id']}},_0x3ee3b2={};_0x3ee3b2['model']=_[_0x5455('0x45')](db[_0x5455('0x2a')][_0x5455('0x46')]);_0x3ee3b2[_0x5455('0x30')]=_[_0x5455('0x45')](_0xaaeeb1[_0x5455('0x30')]);_0x3ee3b2[_0x5455('0x31')]=_[_0x5455('0x32')](_0x3ee3b2[_0x5455('0x2d')],_0x3ee3b2[_0x5455('0x30')]);_0x28d044[_0x5455('0x34')]=_[_0x5455('0x32')](_0x3ee3b2[_0x5455('0x2d')],qs[_0x5455('0x33')](_0xaaeeb1['query'][_0x5455('0x33')]));_0x28d044[_0x5455('0x34')]=_0x28d044[_0x5455('0x34')]['length']?_0x28d044[_0x5455('0x34')]:_0x3ee3b2[_0x5455('0x2d')];if(_0xaaeeb1[_0x5455('0x30')][_0x5455('0x40')]){_0x28d044[_0x5455('0x47')]=[{'all':!![]}];}_0x28d044=_['merge']({},_0x28d044,_0xaaeeb1[_0x5455('0x3f')]);return db[_0x5455('0x2a')][_0x5455('0x48')](_0x28d044)[_0x5455('0x23')](handleEntityNotFound(_0xe5a912,null))[_0x5455('0x23')](respondWithResult(_0xe5a912,null))[_0x5455('0x42')](handleError(_0xe5a912,null));};exports[_0x5455('0x49')]=function(_0x5c82ec,_0x3c1300){return db[_0x5455('0x2a')][_0x5455('0x49')](_0x5c82ec[_0x5455('0x4a')],{})[_0x5455('0x23')](respondWithResult(_0x3c1300,0xc9))[_0x5455('0x42')](handleError(_0x3c1300,null));};exports[_0x5455('0x4b')]=function(_0x44053a,_0x2a5c74){if(_0x44053a[_0x5455('0x4a')]['id']){delete _0x44053a[_0x5455('0x4a')]['id'];}return db[_0x5455('0x2a')][_0x5455('0x48')]({'where':{'id':_0x44053a[_0x5455('0x44')]['id']}})[_0x5455('0x23')](handleEntityNotFound(_0x2a5c74,null))[_0x5455('0x23')](saveUpdates(_0x44053a['body'],null))[_0x5455('0x23')](respondWithResult(_0x2a5c74,null))[_0x5455('0x42')](handleError(_0x2a5c74,null));};exports[_0x5455('0x4c')]=function(_0x260a89,_0xc4a2bc){return db[_0x5455('0x2a')][_0x5455('0x4c')]()[_0x5455('0x23')](respondWithResult(_0xc4a2bc,null))['catch'](handleError(_0xc4a2bc,null));};exports['download']=function(_0x159656,_0x1cfe06,_0x302a2e){var _0x19a8eb=require(_0x5455('0x4d'));var _0x1b107f=![];var _0x5b56d2={};if(_0x159656['query'][_0x5455('0x2c')]&&_0x159656['query'][_0x5455('0x2c')]===_0x5455('0x4e')){_0x5b56d2['uniqueid']=_0x159656[_0x5455('0x44')]['id'];}else{_0x5b56d2['id']=_0x159656[_0x5455('0x44')]['id'];}return db['VoiceRecording'][_0x5455('0x48')]({'where':_0x5b56d2,'attributes':['id',_0x5455('0x4f')],'raw':!![]})[_0x5455('0x23')](handleEntityNotFound(_0x1cfe06,null))['then'](function(_0x57e8af){if(_0x57e8af){var _0x4faecb=_0x57e8af[_0x5455('0x4f')];var _0x460f81=util[_0x5455('0x2f')](_0x5455('0x50'),_0x4faecb);if(fs[_0x5455('0x51')](_0x460f81)){_0x1b107f=!![];return _0x19a8eb[_0x5455('0x52')](_0x460f81,_0x4faecb,config[_0x5455('0x53')][_0x5455('0x54')])['then'](function(){return _0x57e8af;});}return _0x57e8af;}})[_0x5455('0x23')](function(_0x30b12e){if(_0x30b12e){var _0xeed354=_0x30b12e[_0x5455('0x4f')];if(!fs[_0x5455('0x51')](_0xeed354)){throw new db[(_0x5455('0x55'))][(_0x5455('0x56'))]('VoiceRecording\x20not\x20found');}if(_0x30b12e[_0x5455('0x57')]){return _0x1cfe06[_0x5455('0x58')](_0xeed354,_0x30b12e[_0x5455('0x57')]+path['extname'](_0xeed354),function(){if(_0x1b107f){fs[_0x5455('0x59')](_0xeed354);}});}else{return _0x1cfe06[_0x5455('0x58')](_0xeed354,function(_0xc03983){if(_0x1b107f){fs[_0x5455('0x59')](_0xeed354);}});}}})[_0x5455('0x42')](function(_0x3c0a2a){if(_0x3c0a2a[_0x5455('0x5a')]===_0x5455('0x5b')){_0x1cfe06[_0x5455('0x1a')](0x194)[_0x5455('0x27')]('Not\x20found');}else{return handleError(_0x1cfe06,null);}});};exports[_0x5455('0x5c')]=function(_0x512632,_0x13f59f,_0x41a179){var _0x637650=require(_0x5455('0x4d'));var _0x10db16=![];var _0x3e4174={'$and':[db[_0x5455('0x5d')][_0x5455('0x3a')](db['sequelize']['fn'](_0x5455('0x5e'),db['sequelize']['col']('uniqueid')),_0x512632[_0x5455('0x30')]['token'])]};if(_0x512632[_0x5455('0x30')][_0x5455('0x2c')]&&_0x512632[_0x5455('0x30')][_0x5455('0x2c')]===_0x5455('0x4e')){_0x3e4174[_0x5455('0x5f')][_0x5455('0x60')]({'uniqueid':_0x512632['params']['id']});}else{_0x3e4174[_0x5455('0x5f')]['push']({'id':_0x512632[_0x5455('0x44')]['id']});}return db[_0x5455('0x2a')][_0x5455('0x48')]({'where':_0x3e4174,'attributes':['id',_0x5455('0x4f')],'raw':!![]})[_0x5455('0x23')](handleEntityNotFound(_0x13f59f,null))[_0x5455('0x23')](function(_0x276135){if(_0x276135){var _0x11dc0f=util[_0x5455('0x2f')]('%s.cypher',_0x276135[_0x5455('0x4f')]);if(fs[_0x5455('0x51')](_0x11dc0f)){_0x10db16=!![];return _0x637650[_0x5455('0x52')](_0x11dc0f,_0x276135[_0x5455('0x4f')],config['secrets'][_0x5455('0x54')])[_0x5455('0x23')](function(){return _0x276135;});}return _0x276135;}})[_0x5455('0x23')](function(_0xc54dde){if(_0xc54dde){if(!fs['existsSync'](_0xc54dde[_0x5455('0x4f')])){throw new db['Sequelize'][(_0x5455('0x56'))](_0x5455('0x5b'));}if(_0xc54dde['filename']){return _0x13f59f['download'](_0xc54dde[_0x5455('0x4f')],_0xc54dde[_0x5455('0x57')]+path[_0x5455('0x61')](_0xc54dde[_0x5455('0x4f')]),function(){if(_0x10db16){fs[_0x5455('0x59')](_0xc54dde['value']);}});}else{return _0x13f59f[_0x5455('0x58')](_0xc54dde[_0x5455('0x4f')],function(_0x1a4fcf){if(_0x10db16){fs[_0x5455('0x59')](_0xc54dde['value']);}});}}})[_0x5455('0x42')](handleError(_0x13f59f,null));};exports['destroy']=function(_0x218a17,_0x3912e3){return db[_0x5455('0x2a')][_0x5455('0x48')]({'where':{'id':_0x218a17[_0x5455('0x44')]['id']}})[_0x5455('0x23')](function(_0x444399){if(!_0x444399)throw new ReferenceError(_0x5455('0x62'));return _0x444399;})[_0x5455('0x23')](function(_0x35832c){var _0x5b2839=_0x35832c['value'];logger[_0x5455('0x63')](_0x5455('0x64'),_0x5b2839);if(!_[_0x5455('0x65')](_0x35832c[_0x5455('0x4f')])&&fs[_0x5455('0x51')](_0x5b2839)){logger[_0x5455('0x63')](_0x5455('0x66')+_0x5b2839+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x5b2839);}_0x5b2839=_0x5b2839+'.cypher';if(!_[_0x5455('0x65')](_0x35832c[_0x5455('0x4f')])&&fs[_0x5455('0x51')](_0x5b2839)){logger[_0x5455('0x63')](_0x5455('0x66')+_0x5b2839+_0x5455('0x67'));fs[_0x5455('0x68')](_0x5b2839);}return _0x35832c;})['then'](function(_0x1c5f92){if(!_0x1c5f92)throw new InternalError();return _0x1c5f92['destroy']();})[_0x5455('0x23')](function(){_0x3912e3['status'](0xcc)[_0x5455('0x1b')]();})[_0x5455('0x42')](handleError(_0x3912e3,null));}; \ No newline at end of file +var _0xa0a9=['where','pick','filter','merge','options','count','includeAll','include','rows','catch','params','find','create','body','describe','../../components/encryptor','uniqueid','existsSync','decryptFile','secrets','recording','value','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','download','Not\x20found','downloads','sequelize','MD5','token','$and','push','%s.cypher','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','html-pdf','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','lodash','squel','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x4a101e,_0x248e9d){var _0x425a3d=function(_0x32270e){while(--_0x32270e){_0x4a101e['push'](_0x4a101e['shift']());}};_0x425a3d(++_0x248e9d);}(_0xa0a9,0xea));var _0x9a0a=function(_0x5c705f,_0xae3dfd){_0x5c705f=_0x5c705f-0x0;var _0x31d0ce=_0xa0a9[_0x5c705f];return _0x31d0ce;};'use strict';var pdf=require(_0x9a0a('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9a0a('0x1'));var jsonpatch=require(_0x9a0a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9a0a('0x3'));var Mustache=require('mustache');var util=require(_0x9a0a('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x9a0a('0x5'));var ejs=require(_0x9a0a('0x6'));var fs=require('fs');var _=require(_0x9a0a('0x7'));var squel=require(_0x9a0a('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9a0a('0x5'));var querystring=require(_0x9a0a('0x9'));var Papa=require(_0x9a0a('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9a0a('0xb'));var as=require(_0x9a0a('0xc'));var hardwareService=require(_0x9a0a('0xd'));var logger=require(_0x9a0a('0xe'))('api');var utils=require(_0x9a0a('0xf'));var config=require('../../config/environment');var db=require(_0x9a0a('0x10'))['db'];function respondWithStatusCode(_0x199416,_0xaf8359){_0xaf8359=_0xaf8359||0xcc;return function(_0x26b3c2){if(_0x26b3c2){return _0x199416['sendStatus'](_0xaf8359);}return _0x199416[_0x9a0a('0x11')](_0xaf8359)[_0x9a0a('0x12')]();};}function respondWithResult(_0x5cde3a,_0x4b5c7b){_0x4b5c7b=_0x4b5c7b||0xc8;return function(_0x4d116d){if(_0x4d116d){return _0x5cde3a[_0x9a0a('0x11')](_0x4b5c7b)[_0x9a0a('0x13')](_0x4d116d);}};}function respondWithFilteredResult(_0x1084e7,_0x6f3bf5){return function(_0x165a7a){if(_0x165a7a){var _0x3f7b51=_0x165a7a['count'],_0x138ee2=_0x6f3bf5[_0x9a0a('0x14')],_0x52d3bf=_0x6f3bf5[_0x9a0a('0x14')]+_0x6f3bf5[_0x9a0a('0x15')],_0xa0d540;if(_0x52d3bf>=_0x3f7b51){_0x52d3bf=_0x3f7b51;_0xa0d540=0xc8;}else{_0xa0d540=0xce;}_0x1084e7[_0x9a0a('0x11')](_0xa0d540);return _0x1084e7[_0x9a0a('0x16')](_0x9a0a('0x17'),_0x138ee2+'-'+_0x52d3bf+'/'+_0x3f7b51)['json'](_0x165a7a);}return null;};}function patchUpdates(_0x3641f4){return function(_0x3b16de){try{jsonpatch['apply'](_0x3b16de,_0x3641f4,!![]);}catch(_0x1b1cc4){return BPromise[_0x9a0a('0x18')](_0x1b1cc4);}return _0x3b16de[_0x9a0a('0x19')]();};}function saveUpdates(_0x5a74b1,_0x170ef3){return function(_0x11dfcc){if(_0x11dfcc){return _0x11dfcc[_0x9a0a('0x1a')](_0x5a74b1)[_0x9a0a('0x1b')](function(_0x5b14ee){return _0x5b14ee;});}return null;};}function removeEntity(_0x3dec46,_0x36d33e){return function(_0x1a8da0){if(_0x1a8da0){return _0x1a8da0[_0x9a0a('0x1c')]()[_0x9a0a('0x1b')](function(){_0x3dec46[_0x9a0a('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27e128,_0x5a29fd){return function(_0x4bdaa0){if(!_0x4bdaa0){_0x27e128['sendStatus'](0x194);}return _0x4bdaa0;};}function handleError(_0x3ce18a,_0x3fcb07){_0x3fcb07=_0x3fcb07||0x1f4;return function(_0x2619fd){logger['error'](_0x2619fd[_0x9a0a('0x1d')]);if(_0x2619fd[_0x9a0a('0x1e')]){delete _0x2619fd[_0x9a0a('0x1e')];}_0x3ce18a[_0x9a0a('0x11')](_0x3fcb07)[_0x9a0a('0x1f')](_0x2619fd);};}exports[_0x9a0a('0x20')]=function(_0x493957,_0xfd6559){var _0x151f23={},_0x23f5cb={},_0x497a14={'count':0x0,'rows':[]};var _0x4a8373=_[_0x9a0a('0x21')](db[_0x9a0a('0x22')][_0x9a0a('0x23')],function(_0x1f7203){return{'name':_0x1f7203[_0x9a0a('0x24')],'type':_0x1f7203[_0x9a0a('0x25')][_0x9a0a('0x26')]};});_0x23f5cb[_0x9a0a('0x27')]=_['differenceBy'](_[_0x9a0a('0x21')](_0x4a8373,'name'),['format']);_0x23f5cb[_0x9a0a('0x28')]=_[_0x9a0a('0x29')](_0x493957[_0x9a0a('0x28')]);_0x23f5cb[_0x9a0a('0x2a')]=_[_0x9a0a('0x2b')](_0x23f5cb[_0x9a0a('0x27')],_0x23f5cb[_0x9a0a('0x28')]);_0x151f23[_0x9a0a('0x2c')]=_[_0x9a0a('0x2b')](_0x23f5cb[_0x9a0a('0x27')],qs[_0x9a0a('0x2d')](_0x493957[_0x9a0a('0x28')][_0x9a0a('0x2d')]));_0x151f23[_0x9a0a('0x2c')]=_0x151f23['attributes'][_0x9a0a('0x2e')]?_0x151f23[_0x9a0a('0x2c')]:_0x23f5cb['model'];if(!_0x493957[_0x9a0a('0x28')][_0x9a0a('0x2f')](_0x9a0a('0x30'))){_0x151f23[_0x9a0a('0x15')]=qs[_0x9a0a('0x15')](_0x493957[_0x9a0a('0x28')][_0x9a0a('0x15')]);_0x151f23['offset']=qs[_0x9a0a('0x14')](_0x493957[_0x9a0a('0x28')][_0x9a0a('0x14')]);}_0x151f23[_0x9a0a('0x31')]=qs[_0x9a0a('0x32')](_0x493957['query']['sort']);_0x151f23[_0x9a0a('0x33')]=qs[_0x9a0a('0x2a')](_[_0x9a0a('0x34')](_0x493957[_0x9a0a('0x28')],_0x23f5cb[_0x9a0a('0x2a')]));if(_0x493957[_0x9a0a('0x28')][_0x9a0a('0x35')]){_0x151f23[_0x9a0a('0x33')]=_[_0x9a0a('0x36')](_0x151f23['where'],{'$or':_[_0x9a0a('0x21')](_0x4a8373,function(_0x59cdf1){if(_0x59cdf1[_0x9a0a('0x25')]!=='VIRTUAL'){var _0x104832={};_0x104832[_0x59cdf1[_0x9a0a('0x1e')]]={'$like':'%'+_0x493957[_0x9a0a('0x28')][_0x9a0a('0x35')]+'%'};return _0x104832;}})});}_0x151f23=_[_0x9a0a('0x36')]({},_0x151f23,_0x493957[_0x9a0a('0x37')]);var _0x250d7a={'where':_0x151f23[_0x9a0a('0x33')]};return db[_0x9a0a('0x22')][_0x9a0a('0x38')](_0x250d7a)['then'](function(_0x4020b5){_0x497a14[_0x9a0a('0x38')]=_0x4020b5;if(_0x493957[_0x9a0a('0x28')][_0x9a0a('0x39')]){_0x151f23[_0x9a0a('0x3a')]=[{'all':!![]}];}return db[_0x9a0a('0x22')]['findAll'](_0x151f23);})['then'](function(_0x8c260a){_0x497a14[_0x9a0a('0x3b')]=_0x8c260a;return _0x497a14;})['then'](respondWithFilteredResult(_0xfd6559,_0x151f23))[_0x9a0a('0x3c')](handleError(_0xfd6559,null));};exports['show']=function(_0x3b6da5,_0x50c3a5){var _0x18561e={'raw':![],'where':{'id':_0x3b6da5[_0x9a0a('0x3d')]['id']}},_0x2dc1ab={};_0x2dc1ab[_0x9a0a('0x27')]=_[_0x9a0a('0x29')](db[_0x9a0a('0x22')][_0x9a0a('0x23')]);_0x2dc1ab[_0x9a0a('0x28')]=_[_0x9a0a('0x29')](_0x3b6da5[_0x9a0a('0x28')]);_0x2dc1ab[_0x9a0a('0x2a')]=_['intersection'](_0x2dc1ab['model'],_0x2dc1ab[_0x9a0a('0x28')]);_0x18561e[_0x9a0a('0x2c')]=_[_0x9a0a('0x2b')](_0x2dc1ab[_0x9a0a('0x27')],qs[_0x9a0a('0x2d')](_0x3b6da5['query']['fields']));_0x18561e[_0x9a0a('0x2c')]=_0x18561e[_0x9a0a('0x2c')]['length']?_0x18561e[_0x9a0a('0x2c')]:_0x2dc1ab[_0x9a0a('0x27')];if(_0x3b6da5[_0x9a0a('0x28')]['includeAll']){_0x18561e[_0x9a0a('0x3a')]=[{'all':!![]}];}_0x18561e=_[_0x9a0a('0x36')]({},_0x18561e,_0x3b6da5[_0x9a0a('0x37')]);return db['VoiceRecording'][_0x9a0a('0x3e')](_0x18561e)[_0x9a0a('0x1b')](handleEntityNotFound(_0x50c3a5,null))[_0x9a0a('0x1b')](respondWithResult(_0x50c3a5,null))[_0x9a0a('0x3c')](handleError(_0x50c3a5,null));};exports[_0x9a0a('0x3f')]=function(_0x49dc7c,_0x486c08){return db[_0x9a0a('0x22')][_0x9a0a('0x3f')](_0x49dc7c[_0x9a0a('0x40')],{})[_0x9a0a('0x1b')](respondWithResult(_0x486c08,0xc9))['catch'](handleError(_0x486c08,null));};exports[_0x9a0a('0x1a')]=function(_0x546c3b,_0x47ea2f){if(_0x546c3b[_0x9a0a('0x40')]['id']){delete _0x546c3b['body']['id'];}return db['VoiceRecording'][_0x9a0a('0x3e')]({'where':{'id':_0x546c3b['params']['id']}})[_0x9a0a('0x1b')](handleEntityNotFound(_0x47ea2f,null))[_0x9a0a('0x1b')](saveUpdates(_0x546c3b[_0x9a0a('0x40')],null))[_0x9a0a('0x1b')](respondWithResult(_0x47ea2f,null))[_0x9a0a('0x3c')](handleError(_0x47ea2f,null));};exports[_0x9a0a('0x41')]=function(_0x3661d5,_0x2d34a2){return db['VoiceRecording'][_0x9a0a('0x41')]()['then'](respondWithResult(_0x2d34a2,null))['catch'](handleError(_0x2d34a2,null));};exports['download']=function(_0xb29628,_0x10f6b5,_0x3b28fd){var _0xb76e12=require(_0x9a0a('0x42'));var _0x54180e=![];var _0x1eb0fc={};if(_0xb29628[_0x9a0a('0x28')]['type']&&_0xb29628[_0x9a0a('0x28')][_0x9a0a('0x25')]===_0x9a0a('0x43')){_0x1eb0fc[_0x9a0a('0x43')]=_0xb29628[_0x9a0a('0x3d')]['id'];}else{_0x1eb0fc['id']=_0xb29628[_0x9a0a('0x3d')]['id'];}return db['VoiceRecording'][_0x9a0a('0x3e')]({'where':_0x1eb0fc,'attributes':['id','value'],'raw':!![]})[_0x9a0a('0x1b')](handleEntityNotFound(_0x10f6b5,null))['then'](function(_0x142844){if(_0x142844){var _0x311bea=_0x142844['value'];var _0x3cbdab=util['format']('%s.cypher',_0x311bea);if(fs[_0x9a0a('0x44')](_0x3cbdab)){_0x54180e=!![];return _0xb76e12[_0x9a0a('0x45')](_0x3cbdab,_0x311bea,config[_0x9a0a('0x46')][_0x9a0a('0x47')])[_0x9a0a('0x1b')](function(){return _0x142844;});}return _0x142844;}})[_0x9a0a('0x1b')](function(_0x2e460c){if(_0x2e460c){var _0x177120=_0x2e460c[_0x9a0a('0x48')];if(!fs[_0x9a0a('0x44')](_0x177120)){throw new db['Sequelize'][(_0x9a0a('0x49'))](_0x9a0a('0x4a'));}if(_0x2e460c[_0x9a0a('0x4b')]){return _0x10f6b5['download'](_0x177120,_0x2e460c[_0x9a0a('0x4b')]+path[_0x9a0a('0x4c')](_0x177120),function(){if(_0x54180e){fs[_0x9a0a('0x4d')](_0x177120);}});}else{return _0x10f6b5[_0x9a0a('0x4e')](_0x177120,function(_0x5b6659){if(_0x54180e){fs[_0x9a0a('0x4d')](_0x177120);}});}}})['catch'](function(_0x20c099){if(_0x20c099['message']===_0x9a0a('0x4a')){_0x10f6b5[_0x9a0a('0x11')](0x194)['send'](_0x9a0a('0x4f'));}else{return handleError(_0x10f6b5,null);}});};exports[_0x9a0a('0x50')]=function(_0x450329,_0x3f47f4,_0x6c6bb9){var _0x4a8ee6=require('../../components/encryptor');var _0x4507c7=![];var _0x31e920={'$and':[db[_0x9a0a('0x51')]['where'](db['sequelize']['fn'](_0x9a0a('0x52'),db[_0x9a0a('0x51')]['col'](_0x9a0a('0x43'))),_0x450329[_0x9a0a('0x28')][_0x9a0a('0x53')])]};if(_0x450329[_0x9a0a('0x28')][_0x9a0a('0x25')]&&_0x450329['query']['type']===_0x9a0a('0x43')){_0x31e920[_0x9a0a('0x54')][_0x9a0a('0x55')]({'uniqueid':_0x450329[_0x9a0a('0x3d')]['id']});}else{_0x31e920['$and'][_0x9a0a('0x55')]({'id':_0x450329[_0x9a0a('0x3d')]['id']});}return db[_0x9a0a('0x22')][_0x9a0a('0x3e')]({'where':_0x31e920,'attributes':['id',_0x9a0a('0x48')],'raw':!![]})[_0x9a0a('0x1b')](handleEntityNotFound(_0x3f47f4,null))[_0x9a0a('0x1b')](function(_0x50e473){if(_0x50e473){var _0x494009=util['format'](_0x9a0a('0x56'),_0x50e473['value']);if(fs[_0x9a0a('0x44')](_0x494009)){_0x4507c7=!![];return _0x4a8ee6['decryptFile'](_0x494009,_0x50e473[_0x9a0a('0x48')],config['secrets'][_0x9a0a('0x47')])[_0x9a0a('0x1b')](function(){return _0x50e473;});}return _0x50e473;}})['then'](function(_0x50d963){if(_0x50d963){if(!fs[_0x9a0a('0x44')](_0x50d963[_0x9a0a('0x48')])){throw new db['Sequelize'][(_0x9a0a('0x49'))](_0x9a0a('0x4a'));}if(_0x50d963['filename']){return _0x3f47f4[_0x9a0a('0x4e')](_0x50d963[_0x9a0a('0x48')],_0x50d963['filename']+path[_0x9a0a('0x4c')](_0x50d963['value']),function(){if(_0x4507c7){fs[_0x9a0a('0x4d')](_0x50d963['value']);}});}else{return _0x3f47f4['download'](_0x50d963[_0x9a0a('0x48')],function(_0x56b0de){if(_0x4507c7){fs[_0x9a0a('0x4d')](_0x50d963[_0x9a0a('0x48')]);}});}}})[_0x9a0a('0x3c')](handleError(_0x3f47f4,null));};exports['destroy']=function(_0x502951,_0x40c4be){return db[_0x9a0a('0x22')]['find']({'where':{'id':_0x502951['params']['id']}})[_0x9a0a('0x1b')](function(_0x36a392){if(!_0x36a392)throw new ReferenceError(_0x9a0a('0x57'));return _0x36a392;})[_0x9a0a('0x1b')](function(_0x1c94b5){var _0x4b18f2=_0x1c94b5[_0x9a0a('0x48')];logger[_0x9a0a('0x58')](_0x9a0a('0x59'),_0x4b18f2);if(!_[_0x9a0a('0x5a')](_0x1c94b5[_0x9a0a('0x48')])&&fs['existsSync'](_0x4b18f2)){logger[_0x9a0a('0x58')](_0x9a0a('0x5b')+_0x4b18f2+_0x9a0a('0x5c'));fs[_0x9a0a('0x5d')](_0x4b18f2);}_0x4b18f2=_0x4b18f2+_0x9a0a('0x5e');if(!_[_0x9a0a('0x5a')](_0x1c94b5[_0x9a0a('0x48')])&&fs[_0x9a0a('0x44')](_0x4b18f2)){logger['info'](_0x9a0a('0x5b')+_0x4b18f2+_0x9a0a('0x5c'));fs[_0x9a0a('0x5d')](_0x4b18f2);}return _0x1c94b5;})[_0x9a0a('0x1b')](function(_0xebd70c){if(!_0xebd70c)throw new InternalError();return _0xebd70c[_0x9a0a('0x1c')]();})[_0x9a0a('0x1b')](function(){_0x40c4be['status'](0xcc)[_0x9a0a('0x12')]();})['catch'](handleError(_0x40c4be,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index a6c018e..88ab734 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 _0xf62d=['moment','bluebird','request-promise','path','../../config/environment','./voiceRecording.attributes','define','voice_recordings','uniqueid','lodash','util','../../config/logger','api'];(function(_0x1df788,_0x2e75c3){var _0x58286e=function(_0x131db2){while(--_0x131db2){_0x1df788['push'](_0x1df788['shift']());}};_0x58286e(++_0x2e75c3);}(_0xf62d,0xe6));var _0xdf62=function(_0x377ce1,_0x597ae0){_0x377ce1=_0x377ce1-0x0;var _0x1882e6=_0xf62d[_0x377ce1];return _0x1882e6;};'use strict';var _=require(_0xdf62('0x0'));var util=require(_0xdf62('0x1'));var logger=require(_0xdf62('0x2'))(_0xdf62('0x3'));var moment=require(_0xdf62('0x4'));var BPromise=require(_0xdf62('0x5'));var rp=require(_0xdf62('0x6'));var fs=require('fs');var path=require(_0xdf62('0x7'));var rimraf=require('rimraf');var config=require(_0xdf62('0x8'));var attributes=require(_0xdf62('0x9'));module['exports']=function(_0x593586,_0x3950ca){return _0x593586[_0xdf62('0xa')]('VoiceRecording',attributes,{'tableName':_0xdf62('0xb'),'paranoid':![],'indexes':[{'name':_0xdf62('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xad20=['VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceRecording.attributes','exports','define'];(function(_0x15afbe,_0x1a492f){var _0x38d680=function(_0x324d71){while(--_0x324d71){_0x15afbe['push'](_0x15afbe['shift']());}};_0x38d680(++_0x1a492f);}(_0xad20,0x1a7));var _0x0ad2=function(_0x13c5bf,_0x336fca){_0x13c5bf=_0x13c5bf-0x0;var _0x242af1=_0xad20[_0x13c5bf];return _0x242af1;};'use strict';var _=require(_0x0ad2('0x0'));var util=require(_0x0ad2('0x1'));var logger=require(_0x0ad2('0x2'))(_0x0ad2('0x3'));var moment=require(_0x0ad2('0x4'));var BPromise=require(_0x0ad2('0x5'));var rp=require(_0x0ad2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ad2('0x7'));var config=require(_0x0ad2('0x8'));var attributes=require(_0x0ad2('0x9'));module[_0x0ad2('0xa')]=function(_0x16dc3c,_0xf7da4e){return _0x16dc3c[_0x0ad2('0xb')](_0x0ad2('0xc'),attributes,{'tableName':_0x0ad2('0xd'),'paranoid':![],'indexes':[{'name':_0x0ad2('0xe'),'fields':[_0x0ad2('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 83f094e..327b507 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(_0x463f44,_0xc071ff){var _0x304163=function(_0x1cede6){while(--_0x1cede6){_0x463f44['push'](_0x463f44['shift']());}};_0x304163(++_0xc071ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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(_0x22f963,_0x4bb343){var _0x3ef3ee=function(_0x1bbbac){while(--_0x1bbbac){_0x22f963['push'](_0x22f963['shift']());}};_0x3ef3ee(++_0x4bb343);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 4e47fb3..200ed16 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 _0xe2fe=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','/:id','post','create','put','update','exports','multer'];(function(_0x36b8b6,_0x1b1a27){var _0x345e87=function(_0x32460e){while(--_0x32460e){_0x36b8b6['push'](_0x36b8b6['shift']());}};_0x345e87(++_0x1b1a27);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var auth=require(_0xee2f('0x3'));var interaction=require(_0xee2f('0x4'));var config=require(_0xee2f('0x5'));var controller=require(_0xee2f('0x6'));router['get']('/',auth[_0xee2f('0x7')](),controller[_0xee2f('0x8')]);router['get'](_0xee2f('0x9'),auth[_0xee2f('0x7')](),controller['show']);router[_0xee2f('0xa')]('/',auth['isAuthenticated'](),controller[_0xee2f('0xb')]);router[_0xee2f('0xc')]('/:id',auth[_0xee2f('0x7')](),controller[_0xee2f('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xee2f('0xe')]=router; \ No newline at end of file +var _0xdbf5=['index','/:id','show','put','update','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated'];(function(_0x4f08e1,_0x2ffd5b){var _0x183cab=function(_0x1b2c95){while(--_0x1b2c95){_0x4f08e1['push'](_0x4f08e1['shift']());}};_0x183cab(++_0x2ffd5b);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x1b7186,_0x393de3){_0x1b7186=_0x1b7186-0x0;var _0x1437fd=_0xdbf5[_0x1b7186];return _0x1437fd;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var auth=require(_0x5dbf('0x3'));var interaction=require(_0x5dbf('0x4'));var config=require(_0x5dbf('0x5'));var controller=require(_0x5dbf('0x6'));router[_0x5dbf('0x7')]('/',auth[_0x5dbf('0x8')](),controller[_0x5dbf('0x9')]);router[_0x5dbf('0x7')](_0x5dbf('0xa'),auth[_0x5dbf('0x8')](),controller[_0x5dbf('0xb')]);router['post']('/',auth[_0x5dbf('0x8')](),controller['create']);router[_0x5dbf('0xc')](_0x5dbf('0xa'),auth[_0x5dbf('0x8')](),controller[_0x5dbf('0xd')]);router['delete'](_0x5dbf('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5dbf('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index f453ea2..43a2da7 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 _0xdcd5=['blind','STRING','sequelize','moment','exports','ENUM'];(function(_0x5db99b,_0xdee23a){var _0x4b2d0e=function(_0x4deee1){while(--_0x4deee1){_0x5db99b['push'](_0x5db99b['shift']());}};_0x4b2d0e(++_0xdee23a);}(_0xdcd5,0x14c));var _0x5dcd=function(_0xe1a3a5,_0xd3e341){_0xe1a3a5=_0xe1a3a5-0x0;var _0x362646=_0xdcd5[_0xe1a3a5];return _0x362646;};'use strict';var Sequelize=require(_0x5dcd('0x0'));var moment=require(_0x5dcd('0x1'));module[_0x5dcd('0x2')]={'type':{'type':Sequelize[_0x5dcd('0x3')](_0x5dcd('0x4'),'attended')},'result':{'type':Sequelize[_0x5dcd('0x5')]},'transfererchannel':{'type':Sequelize[_0x5dcd('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x5dcd('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x5dcd('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x5dcd('0x5')]},'transferercontext':{'type':Sequelize[_0x5dcd('0x5')]},'transfererexten':{'type':Sequelize[_0x5dcd('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x5dcd('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x5dcd('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x5dcd('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x5dcd('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x5dcd('0x5')]},'transfereecontext':{'type':Sequelize[_0x5dcd('0x5')]},'transfereeexten':{'type':Sequelize[_0x5dcd('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x5dcd('0x5')]},'isexternal':{'type':Sequelize[_0x5dcd('0x3')]('Yes','No')},'context':{'type':Sequelize[_0x5dcd('0x5')]},'extension':{'type':Sequelize[_0x5dcd('0x5')]}}; \ No newline at end of file +var _0xe054=['moment','exports','ENUM','STRING','Yes'];(function(_0x20a720,_0x2d725c){var _0x2193e1=function(_0x1eaf79){while(--_0x1eaf79){_0x20a720['push'](_0x20a720['shift']());}};_0x2193e1(++_0x2d725c);}(_0xe054,0x18b));var _0x4e05=function(_0x57ee02,_0x58b0c4){_0x57ee02=_0x57ee02-0x0;var _0x2fc9b0=_0xe054[_0x57ee02];return _0x2fc9b0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4e05('0x0'));module[_0x4e05('0x1')]={'type':{'type':Sequelize[_0x4e05('0x2')]('blind','attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x4e05('0x3')]},'transferercalleridnum':{'type':Sequelize[_0x4e05('0x3')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x4e05('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x4e05('0x3')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x4e05('0x3')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x4e05('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x4e05('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x4e05('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x4e05('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x4e05('0x3')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x4e05('0x3')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x4e05('0x3')]},'isexternal':{'type':Sequelize[_0x4e05('0x2')](_0x4e05('0x4'),'No')},'context':{'type':Sequelize[_0x4e05('0x3')]},'extension':{'type':Sequelize[_0x4e05('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index f85bd04..9dfe7f8 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 _0x4fc2=['../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','fieldName','type','key','model','keys','filters','intersection','query','fields','length','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','attributes','includeAll','create','update','body','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x201d5c,_0xed7d2b){var _0x112e91=function(_0x25ae39){while(--_0x25ae39){_0x201d5c['push'](_0x201d5c['shift']());}};_0x112e91(++_0xed7d2b);}(_0x4fc2,0x111));var _0x24fc=function(_0x21aafd,_0x1f0fa6){_0x21aafd=_0x21aafd-0x0;var _0x9f2800=_0x4fc2[_0x21aafd];return _0x9f2800;};'use strict';var pdf=require(_0x24fc('0x0'));var emlformat=require(_0x24fc('0x1'));var rimraf=require(_0x24fc('0x2'));var zipdir=require(_0x24fc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24fc('0x4'));var moment=require(_0x24fc('0x5'));var BPromise=require(_0x24fc('0x6'));var Mustache=require('mustache');var util=require(_0x24fc('0x7'));var path=require(_0x24fc('0x8'));var sox=require('sox');var csv=require(_0x24fc('0x9'));var ejs=require(_0x24fc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0x9'));var querystring=require(_0x24fc('0xf'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x10'));var authService=require(_0x24fc('0x11'));var qs=require(_0x24fc('0x12'));var as=require(_0x24fc('0x13'));var hardwareService=require(_0x24fc('0x14'));var logger=require(_0x24fc('0x15'))(_0x24fc('0x16'));var utils=require(_0x24fc('0x17'));var config=require('../../config/environment');var db=require(_0x24fc('0x18'))['db'];function respondWithStatusCode(_0x1cde5d,_0x5cc65e){_0x5cc65e=_0x5cc65e||0xcc;return function(_0x306873){if(_0x306873){return _0x1cde5d[_0x24fc('0x19')](_0x5cc65e);}return _0x1cde5d[_0x24fc('0x1a')](_0x5cc65e)[_0x24fc('0x1b')]();};}function respondWithResult(_0x30f19b,_0x326276){_0x326276=_0x326276||0xc8;return function(_0x537b5c){if(_0x537b5c){return _0x30f19b[_0x24fc('0x1a')](_0x326276)[_0x24fc('0x1c')](_0x537b5c);}};}function respondWithFilteredResult(_0x2ffed3,_0x42cbe8){return function(_0x4acd36){if(_0x4acd36){var _0x2ac989=_0x4acd36[_0x24fc('0x1d')],_0x588543=_0x42cbe8[_0x24fc('0x1e')],_0x4af098=_0x42cbe8[_0x24fc('0x1e')]+_0x42cbe8['limit'],_0x3385c7;if(_0x4af098>=_0x2ac989){_0x4af098=_0x2ac989;_0x3385c7=0xc8;}else{_0x3385c7=0xce;}_0x2ffed3[_0x24fc('0x1a')](_0x3385c7);return _0x2ffed3[_0x24fc('0x1f')](_0x24fc('0x20'),_0x588543+'-'+_0x4af098+'/'+_0x2ac989)[_0x24fc('0x1c')](_0x4acd36);}return null;};}function patchUpdates(_0x4c5a43){return function(_0x5eabee){try{jsonpatch[_0x24fc('0x21')](_0x5eabee,_0x4c5a43,!![]);}catch(_0x304881){return BPromise['reject'](_0x304881);}return _0x5eabee[_0x24fc('0x22')]();};}function saveUpdates(_0x36a771,_0xbf1d6b){return function(_0x2d0e3d){if(_0x2d0e3d){return _0x2d0e3d['update'](_0x36a771)[_0x24fc('0x23')](function(_0x545939){return _0x545939;});}return null;};}function removeEntity(_0x339b50,_0x591c8f){return function(_0x3ed464){if(_0x3ed464){return _0x3ed464[_0x24fc('0x24')]()[_0x24fc('0x23')](function(){_0x339b50['status'](0xcc)[_0x24fc('0x1b')]();});}};}function handleEntityNotFound(_0x552035,_0x35a9c7){return function(_0x2bb93a){if(!_0x2bb93a){_0x552035[_0x24fc('0x19')](0x194);}return _0x2bb93a;};}function handleError(_0x34b5b2,_0x3296fc){_0x3296fc=_0x3296fc||0x1f4;return function(_0x262e11){logger[_0x24fc('0x25')](_0x262e11[_0x24fc('0x26')]);if(_0x262e11[_0x24fc('0x27')]){delete _0x262e11[_0x24fc('0x27')];}_0x34b5b2['status'](_0x3296fc)[_0x24fc('0x28')](_0x262e11);};}exports[_0x24fc('0x29')]=function(_0x3ee302,_0x5bb4c8){var _0xf2f77d={},_0x3d1ec8={},_0x35f9f9={'count':0x0,'rows':[]};var _0x290f84=_[_0x24fc('0x2a')](db[_0x24fc('0x2b')]['rawAttributes'],function(_0x240ae7){return{'name':_0x240ae7[_0x24fc('0x2c')],'type':_0x240ae7[_0x24fc('0x2d')][_0x24fc('0x2e')]};});_0x3d1ec8[_0x24fc('0x2f')]=_['map'](_0x290f84,'name');_0x3d1ec8['query']=_[_0x24fc('0x30')](_0x3ee302['query']);_0x3d1ec8[_0x24fc('0x31')]=_[_0x24fc('0x32')](_0x3d1ec8[_0x24fc('0x2f')],_0x3d1ec8[_0x24fc('0x33')]);_0xf2f77d['attributes']=_[_0x24fc('0x32')](_0x3d1ec8[_0x24fc('0x2f')],qs['fields'](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x34')]));_0xf2f77d['attributes']=_0xf2f77d['attributes'][_0x24fc('0x35')]?_0xf2f77d['attributes']:_0x3d1ec8[_0x24fc('0x2f')];if(!_0x3ee302[_0x24fc('0x33')]['hasOwnProperty'](_0x24fc('0x36'))){_0xf2f77d[_0x24fc('0x37')]=qs[_0x24fc('0x37')](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x37')]);_0xf2f77d[_0x24fc('0x1e')]=qs[_0x24fc('0x1e')](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x1e')]);}_0xf2f77d['order']=qs[_0x24fc('0x38')](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x38')]);_0xf2f77d[_0x24fc('0x39')]=qs[_0x24fc('0x31')](_['pick'](_0x3ee302['query'],_0x3d1ec8[_0x24fc('0x31')]));if(_0x3ee302['query'][_0x24fc('0x3a')]){_0xf2f77d[_0x24fc('0x39')]=_[_0x24fc('0x3b')](_0xf2f77d[_0x24fc('0x39')],{'$or':_['map'](_0x290f84,function(_0x610638){if(_0x610638['type']!==_0x24fc('0x3c')){var _0x3b8fb6={};_0x3b8fb6[_0x610638[_0x24fc('0x27')]]={'$like':'%'+_0x3ee302[_0x24fc('0x33')][_0x24fc('0x3a')]+'%'};return _0x3b8fb6;}})});}_0xf2f77d=_['merge']({},_0xf2f77d,_0x3ee302[_0x24fc('0x3d')]);var _0x3f40cd={'where':_0xf2f77d[_0x24fc('0x39')]};return db[_0x24fc('0x2b')]['count'](_0x3f40cd)[_0x24fc('0x23')](function(_0x2f0bd9){_0x35f9f9['count']=_0x2f0bd9;if(_0x3ee302[_0x24fc('0x33')]['includeAll']){_0xf2f77d[_0x24fc('0x3e')]=[{'all':!![]}];}return db[_0x24fc('0x2b')][_0x24fc('0x3f')](_0xf2f77d);})[_0x24fc('0x23')](function(_0x431189){_0x35f9f9[_0x24fc('0x40')]=_0x431189;return _0x35f9f9;})[_0x24fc('0x23')](respondWithFilteredResult(_0x5bb4c8,_0xf2f77d))[_0x24fc('0x41')](handleError(_0x5bb4c8,null));};exports['show']=function(_0x1721ea,_0x43fb6d){var _0x32f72c={'raw':!![],'where':{'id':_0x1721ea[_0x24fc('0x42')]['id']}},_0x4fee9f={};_0x4fee9f[_0x24fc('0x2f')]=_['keys'](db[_0x24fc('0x2b')][_0x24fc('0x43')]);_0x4fee9f[_0x24fc('0x33')]=_['keys'](_0x1721ea[_0x24fc('0x33')]);_0x4fee9f[_0x24fc('0x31')]=_['intersection'](_0x4fee9f[_0x24fc('0x2f')],_0x4fee9f[_0x24fc('0x33')]);_0x32f72c[_0x24fc('0x44')]=_[_0x24fc('0x32')](_0x4fee9f['model'],qs[_0x24fc('0x34')](_0x1721ea[_0x24fc('0x33')][_0x24fc('0x34')]));_0x32f72c[_0x24fc('0x44')]=_0x32f72c[_0x24fc('0x44')]['length']?_0x32f72c[_0x24fc('0x44')]:_0x4fee9f[_0x24fc('0x2f')];if(_0x1721ea[_0x24fc('0x33')][_0x24fc('0x45')]){_0x32f72c['include']=[{'all':!![]}];}_0x32f72c=_[_0x24fc('0x3b')]({},_0x32f72c,_0x1721ea[_0x24fc('0x3d')]);return db['VoiceTransferReport']['find'](_0x32f72c)[_0x24fc('0x23')](handleEntityNotFound(_0x43fb6d,null))['then'](respondWithResult(_0x43fb6d,null))['catch'](handleError(_0x43fb6d,null));};exports[_0x24fc('0x46')]=function(_0x5879c2,_0x281194){return db[_0x24fc('0x2b')][_0x24fc('0x46')](_0x5879c2['body'],{})[_0x24fc('0x23')](respondWithResult(_0x281194,0xc9))[_0x24fc('0x41')](handleError(_0x281194,null));};exports[_0x24fc('0x47')]=function(_0x1ad8d6,_0x39873d){if(_0x1ad8d6[_0x24fc('0x48')]['id']){delete _0x1ad8d6[_0x24fc('0x48')]['id'];}return db[_0x24fc('0x2b')]['find']({'where':{'id':_0x1ad8d6['params']['id']}})[_0x24fc('0x23')](handleEntityNotFound(_0x39873d,null))[_0x24fc('0x23')](saveUpdates(_0x1ad8d6[_0x24fc('0x48')],null))['then'](respondWithResult(_0x39873d,null))['catch'](handleError(_0x39873d,null));};exports[_0x24fc('0x24')]=function(_0x213439,_0x179a60){return db[_0x24fc('0x2b')][_0x24fc('0x49')]({'where':{'id':_0x213439[_0x24fc('0x42')]['id']}})[_0x24fc('0x23')](handleEntityNotFound(_0x179a60,null))[_0x24fc('0x23')](removeEntity(_0x179a60,null))[_0x24fc('0x41')](handleError(_0x179a60,null));}; \ No newline at end of file +var _0x4fc2=['../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','fieldName','type','key','model','keys','filters','intersection','query','fields','length','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','attributes','includeAll','create','update','body','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x51bb3b,_0x5dabdd){var _0x53faef=function(_0x3f9647){while(--_0x3f9647){_0x51bb3b['push'](_0x51bb3b['shift']());}};_0x53faef(++_0x5dabdd);}(_0x4fc2,0x111));var _0x24fc=function(_0x48f7cc,_0x462000){_0x48f7cc=_0x48f7cc-0x0;var _0x162c86=_0x4fc2[_0x48f7cc];return _0x162c86;};'use strict';var pdf=require(_0x24fc('0x0'));var emlformat=require(_0x24fc('0x1'));var rimraf=require(_0x24fc('0x2'));var zipdir=require(_0x24fc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24fc('0x4'));var moment=require(_0x24fc('0x5'));var BPromise=require(_0x24fc('0x6'));var Mustache=require('mustache');var util=require(_0x24fc('0x7'));var path=require(_0x24fc('0x8'));var sox=require('sox');var csv=require(_0x24fc('0x9'));var ejs=require(_0x24fc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0x9'));var querystring=require(_0x24fc('0xf'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x10'));var authService=require(_0x24fc('0x11'));var qs=require(_0x24fc('0x12'));var as=require(_0x24fc('0x13'));var hardwareService=require(_0x24fc('0x14'));var logger=require(_0x24fc('0x15'))(_0x24fc('0x16'));var utils=require(_0x24fc('0x17'));var config=require('../../config/environment');var db=require(_0x24fc('0x18'))['db'];function respondWithStatusCode(_0x1cde5d,_0x5cc65e){_0x5cc65e=_0x5cc65e||0xcc;return function(_0x306873){if(_0x306873){return _0x1cde5d[_0x24fc('0x19')](_0x5cc65e);}return _0x1cde5d[_0x24fc('0x1a')](_0x5cc65e)[_0x24fc('0x1b')]();};}function respondWithResult(_0x30f19b,_0x326276){_0x326276=_0x326276||0xc8;return function(_0x537b5c){if(_0x537b5c){return _0x30f19b[_0x24fc('0x1a')](_0x326276)[_0x24fc('0x1c')](_0x537b5c);}};}function respondWithFilteredResult(_0x2ffed3,_0x42cbe8){return function(_0x4acd36){if(_0x4acd36){var _0x2ac989=_0x4acd36[_0x24fc('0x1d')],_0x588543=_0x42cbe8[_0x24fc('0x1e')],_0x4af098=_0x42cbe8[_0x24fc('0x1e')]+_0x42cbe8['limit'],_0x3385c7;if(_0x4af098>=_0x2ac989){_0x4af098=_0x2ac989;_0x3385c7=0xc8;}else{_0x3385c7=0xce;}_0x2ffed3[_0x24fc('0x1a')](_0x3385c7);return _0x2ffed3[_0x24fc('0x1f')](_0x24fc('0x20'),_0x588543+'-'+_0x4af098+'/'+_0x2ac989)[_0x24fc('0x1c')](_0x4acd36);}return null;};}function patchUpdates(_0x4c5a43){return function(_0x5eabee){try{jsonpatch[_0x24fc('0x21')](_0x5eabee,_0x4c5a43,!![]);}catch(_0x304881){return BPromise['reject'](_0x304881);}return _0x5eabee[_0x24fc('0x22')]();};}function saveUpdates(_0x36a771,_0xbf1d6b){return function(_0x2d0e3d){if(_0x2d0e3d){return _0x2d0e3d['update'](_0x36a771)[_0x24fc('0x23')](function(_0x545939){return _0x545939;});}return null;};}function removeEntity(_0x339b50,_0x591c8f){return function(_0x3ed464){if(_0x3ed464){return _0x3ed464[_0x24fc('0x24')]()[_0x24fc('0x23')](function(){_0x339b50['status'](0xcc)[_0x24fc('0x1b')]();});}};}function handleEntityNotFound(_0x552035,_0x35a9c7){return function(_0x2bb93a){if(!_0x2bb93a){_0x552035[_0x24fc('0x19')](0x194);}return _0x2bb93a;};}function handleError(_0x34b5b2,_0x3296fc){_0x3296fc=_0x3296fc||0x1f4;return function(_0x262e11){logger[_0x24fc('0x25')](_0x262e11[_0x24fc('0x26')]);if(_0x262e11[_0x24fc('0x27')]){delete _0x262e11[_0x24fc('0x27')];}_0x34b5b2['status'](_0x3296fc)[_0x24fc('0x28')](_0x262e11);};}exports[_0x24fc('0x29')]=function(_0x3ee302,_0x5bb4c8){var _0xf2f77d={},_0x3d1ec8={},_0x35f9f9={'count':0x0,'rows':[]};var _0x290f84=_[_0x24fc('0x2a')](db[_0x24fc('0x2b')]['rawAttributes'],function(_0x240ae7){return{'name':_0x240ae7[_0x24fc('0x2c')],'type':_0x240ae7[_0x24fc('0x2d')][_0x24fc('0x2e')]};});_0x3d1ec8[_0x24fc('0x2f')]=_['map'](_0x290f84,'name');_0x3d1ec8['query']=_[_0x24fc('0x30')](_0x3ee302['query']);_0x3d1ec8[_0x24fc('0x31')]=_[_0x24fc('0x32')](_0x3d1ec8[_0x24fc('0x2f')],_0x3d1ec8[_0x24fc('0x33')]);_0xf2f77d['attributes']=_[_0x24fc('0x32')](_0x3d1ec8[_0x24fc('0x2f')],qs['fields'](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x34')]));_0xf2f77d['attributes']=_0xf2f77d['attributes'][_0x24fc('0x35')]?_0xf2f77d['attributes']:_0x3d1ec8[_0x24fc('0x2f')];if(!_0x3ee302[_0x24fc('0x33')]['hasOwnProperty'](_0x24fc('0x36'))){_0xf2f77d[_0x24fc('0x37')]=qs[_0x24fc('0x37')](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x37')]);_0xf2f77d[_0x24fc('0x1e')]=qs[_0x24fc('0x1e')](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x1e')]);}_0xf2f77d['order']=qs[_0x24fc('0x38')](_0x3ee302[_0x24fc('0x33')][_0x24fc('0x38')]);_0xf2f77d[_0x24fc('0x39')]=qs[_0x24fc('0x31')](_['pick'](_0x3ee302['query'],_0x3d1ec8[_0x24fc('0x31')]));if(_0x3ee302['query'][_0x24fc('0x3a')]){_0xf2f77d[_0x24fc('0x39')]=_[_0x24fc('0x3b')](_0xf2f77d[_0x24fc('0x39')],{'$or':_['map'](_0x290f84,function(_0x610638){if(_0x610638['type']!==_0x24fc('0x3c')){var _0x3b8fb6={};_0x3b8fb6[_0x610638[_0x24fc('0x27')]]={'$like':'%'+_0x3ee302[_0x24fc('0x33')][_0x24fc('0x3a')]+'%'};return _0x3b8fb6;}})});}_0xf2f77d=_['merge']({},_0xf2f77d,_0x3ee302[_0x24fc('0x3d')]);var _0x3f40cd={'where':_0xf2f77d[_0x24fc('0x39')]};return db[_0x24fc('0x2b')]['count'](_0x3f40cd)[_0x24fc('0x23')](function(_0x2f0bd9){_0x35f9f9['count']=_0x2f0bd9;if(_0x3ee302[_0x24fc('0x33')]['includeAll']){_0xf2f77d[_0x24fc('0x3e')]=[{'all':!![]}];}return db[_0x24fc('0x2b')][_0x24fc('0x3f')](_0xf2f77d);})[_0x24fc('0x23')](function(_0x431189){_0x35f9f9[_0x24fc('0x40')]=_0x431189;return _0x35f9f9;})[_0x24fc('0x23')](respondWithFilteredResult(_0x5bb4c8,_0xf2f77d))[_0x24fc('0x41')](handleError(_0x5bb4c8,null));};exports['show']=function(_0x1721ea,_0x43fb6d){var _0x32f72c={'raw':!![],'where':{'id':_0x1721ea[_0x24fc('0x42')]['id']}},_0x4fee9f={};_0x4fee9f[_0x24fc('0x2f')]=_['keys'](db[_0x24fc('0x2b')][_0x24fc('0x43')]);_0x4fee9f[_0x24fc('0x33')]=_['keys'](_0x1721ea[_0x24fc('0x33')]);_0x4fee9f[_0x24fc('0x31')]=_['intersection'](_0x4fee9f[_0x24fc('0x2f')],_0x4fee9f[_0x24fc('0x33')]);_0x32f72c[_0x24fc('0x44')]=_[_0x24fc('0x32')](_0x4fee9f['model'],qs[_0x24fc('0x34')](_0x1721ea[_0x24fc('0x33')][_0x24fc('0x34')]));_0x32f72c[_0x24fc('0x44')]=_0x32f72c[_0x24fc('0x44')]['length']?_0x32f72c[_0x24fc('0x44')]:_0x4fee9f[_0x24fc('0x2f')];if(_0x1721ea[_0x24fc('0x33')][_0x24fc('0x45')]){_0x32f72c['include']=[{'all':!![]}];}_0x32f72c=_[_0x24fc('0x3b')]({},_0x32f72c,_0x1721ea[_0x24fc('0x3d')]);return db['VoiceTransferReport']['find'](_0x32f72c)[_0x24fc('0x23')](handleEntityNotFound(_0x43fb6d,null))['then'](respondWithResult(_0x43fb6d,null))['catch'](handleError(_0x43fb6d,null));};exports[_0x24fc('0x46')]=function(_0x5879c2,_0x281194){return db[_0x24fc('0x2b')][_0x24fc('0x46')](_0x5879c2['body'],{})[_0x24fc('0x23')](respondWithResult(_0x281194,0xc9))[_0x24fc('0x41')](handleError(_0x281194,null));};exports[_0x24fc('0x47')]=function(_0x1ad8d6,_0x39873d){if(_0x1ad8d6[_0x24fc('0x48')]['id']){delete _0x1ad8d6[_0x24fc('0x48')]['id'];}return db[_0x24fc('0x2b')]['find']({'where':{'id':_0x1ad8d6['params']['id']}})[_0x24fc('0x23')](handleEntityNotFound(_0x39873d,null))[_0x24fc('0x23')](saveUpdates(_0x1ad8d6[_0x24fc('0x48')],null))['then'](respondWithResult(_0x39873d,null))['catch'](handleError(_0x39873d,null));};exports[_0x24fc('0x24')]=function(_0x213439,_0x179a60){return db[_0x24fc('0x2b')][_0x24fc('0x49')]({'where':{'id':_0x213439[_0x24fc('0x42')]['id']}})[_0x24fc('0x23')](handleEntityNotFound(_0x179a60,null))[_0x24fc('0x23')](removeEntity(_0x179a60,null))[_0x24fc('0x41')](handleError(_0x179a60,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 659a169..d52bbbc 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 _0x57e4=['./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0xc61ea8,_0x56e451){var _0x22c845=function(_0x143785){while(--_0x143785){_0xc61ea8['push'](_0xc61ea8['shift']());}};_0x22c845(++_0x56e451);}(_0x57e4,0x1e5));var _0x457e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x57e4[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x457e('0x0'));var util=require('util');var logger=require(_0x457e('0x1'))(_0x457e('0x2'));var moment=require('moment');var BPromise=require(_0x457e('0x3'));var rp=require(_0x457e('0x4'));var fs=require('fs');var path=require(_0x457e('0x5'));var rimraf=require('rimraf');var config=require(_0x457e('0x6'));var attributes=require(_0x457e('0x7'));module[_0x457e('0x8')]=function(_0x3ef97e,_0x2a21f1){return _0x3ef97e[_0x457e('0x9')](_0x457e('0xa'),attributes,{'tableName':_0x457e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7d2=['./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0xe7d2,0x13c));var _0x2e7d=function(_0x509f72,_0x3f5226){_0x509f72=_0x509f72-0x0;var _0x31a3d5=_0xe7d2[_0x509f72];return _0x31a3d5;};'use strict';var _=require(_0x2e7d('0x0'));var util=require(_0x2e7d('0x1'));var logger=require(_0x2e7d('0x2'))(_0x2e7d('0x3'));var moment=require(_0x2e7d('0x4'));var BPromise=require(_0x2e7d('0x5'));var rp=require(_0x2e7d('0x6'));var fs=require('fs');var path=require(_0x2e7d('0x7'));var rimraf=require(_0x2e7d('0x8'));var config=require('../../config/environment');var attributes=require(_0x2e7d('0x9'));module[_0x2e7d('0xa')]=function(_0x5517c6,_0xf423dd){return _0x5517c6[_0x2e7d('0xb')]('VoiceTransferReport',attributes,{'tableName':_0x2e7d('0xc'),'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 2cbfb5d..bf9dbee 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 _0xf9b4=['result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x4ff1db,_0x237533){var _0x19c476=function(_0x54a0ff){while(--_0x54a0ff){_0x4ff1db['push'](_0x4ff1db['shift']());}};_0x19c476(++_0x237533);}(_0xf9b4,0x18d));var _0x4f9b=function(_0x286e63,_0x90bf8f){_0x286e63=_0x286e63-0x0;var _0x4535eb=_0xf9b4[_0x286e63];return _0x4535eb;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4f9b('0x0'));var fs=require('fs');var Redis=require(_0x4f9b('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4f9b('0x2'))(_0x4f9b('0x3'));var config=require(_0x4f9b('0x4'));var jayson=require(_0x4f9b('0x5'));var client=jayson[_0x4f9b('0x6')][_0x4f9b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5590c5,_0x21f37e,_0x36cea3){return new BPromise(function(_0x12c41d,_0x473e46){return client['request'](_0x5590c5,_0x36cea3)[_0x4f9b('0x8')](function(_0x10e49e){logger[_0x4f9b('0x9')]('VoiceTransferReport,\x20%s,\x20%s',_0x21f37e,'request\x20sent');logger[_0x4f9b('0xa')](_0x4f9b('0xb'),_0x21f37e,_0x4f9b('0xc'),JSON[_0x4f9b('0xd')](_0x10e49e));if(_0x10e49e[_0x4f9b('0xe')]){if(_0x10e49e[_0x4f9b('0xe')]['code']===0x1f4){logger[_0x4f9b('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x21f37e,_0x10e49e['error'][_0x4f9b('0xf')]);return _0x473e46(_0x10e49e[_0x4f9b('0xe')][_0x4f9b('0xf')]);}logger[_0x4f9b('0xe')](_0x4f9b('0x10'),_0x21f37e,_0x10e49e[_0x4f9b('0xe')][_0x4f9b('0xf')]);return _0x12c41d(_0x10e49e[_0x4f9b('0xe')]['message']);}else{logger[_0x4f9b('0x9')]('VoiceTransferReport,\x20%s,\x20%s',_0x21f37e,_0x4f9b('0xc'));_0x12c41d(_0x10e49e[_0x4f9b('0x11')][_0x4f9b('0xf')]);}})[_0x4f9b('0x12')](function(_0x851932){logger['error'](_0x4f9b('0x10'),_0x21f37e,_0x851932);_0x473e46(_0x851932);});});}exports[_0x4f9b('0x13')]=function(_0x4fc509){var _0x440986=this;return new Promise(function(_0x484a84,_0x4e0e53){return db[_0x4f9b('0x14')][_0x4f9b('0x15')](_0x4fc509['body'],{'raw':_0x4fc509[_0x4f9b('0x16')]?_0x4fc509[_0x4f9b('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x4f9b('0x8')](function(_0xd87f58){logger['info'](_0x4f9b('0x13'),_0x4fc509);logger[_0x4f9b('0xa')](_0x4f9b('0x13'),_0x4fc509,JSON[_0x4f9b('0xd')](_0xd87f58));_0x484a84(_0xd87f58);})['catch'](function(_0x280940){logger[_0x4f9b('0xe')](_0x4f9b('0x13'),_0x280940['message'],_0x4fc509);_0x4e0e53(_0x440986['error'](0x1f4,_0x280940['message']));});});}; \ No newline at end of file +var _0x88f3=['stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1f79a6,_0x40085e){var _0x10e9ce=function(_0x1e15de){while(--_0x1e15de){_0x1f79a6['push'](_0x1f79a6['shift']());}};_0x10e9ce(++_0x40085e);}(_0x88f3,0x1e9));var _0x388f=function(_0x1952eb,_0x3b4764){_0x1952eb=_0x1952eb-0x0;var _0x18e666=_0x88f3[_0x1952eb];return _0x18e666;};'use strict';var _=require(_0x388f('0x0'));var util=require(_0x388f('0x1'));var moment=require(_0x388f('0x2'));var BPromise=require(_0x388f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x388f('0x4'));var db=require(_0x388f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x388f('0x6'))(_0x388f('0x7'));var config=require(_0x388f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x388f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34afd3,_0x3c3601,_0x2c115c){return new BPromise(function(_0x5d95e2,_0x1267aa){return client[_0x388f('0xa')](_0x34afd3,_0x2c115c)['then'](function(_0xdae8f8){logger[_0x388f('0xb')](_0x388f('0xc'),_0x3c3601,'request\x20sent');logger['debug'](_0x388f('0xd'),_0x3c3601,_0x388f('0xe'),JSON[_0x388f('0xf')](_0xdae8f8));if(_0xdae8f8[_0x388f('0x10')]){if(_0xdae8f8[_0x388f('0x10')][_0x388f('0x11')]===0x1f4){logger[_0x388f('0x10')](_0x388f('0xc'),_0x3c3601,_0xdae8f8[_0x388f('0x10')][_0x388f('0x12')]);return _0x1267aa(_0xdae8f8[_0x388f('0x10')][_0x388f('0x12')]);}logger['error'](_0x388f('0xc'),_0x3c3601,_0xdae8f8['error'][_0x388f('0x12')]);return _0x5d95e2(_0xdae8f8['error'][_0x388f('0x12')]);}else{logger[_0x388f('0xb')](_0x388f('0xc'),_0x3c3601,'request\x20sent');_0x5d95e2(_0xdae8f8[_0x388f('0x13')][_0x388f('0x12')]);}})[_0x388f('0x14')](function(_0x1218c1){logger[_0x388f('0x10')](_0x388f('0xc'),_0x3c3601,_0x1218c1);_0x1267aa(_0x1218c1);});});}exports[_0x388f('0x15')]=function(_0x11bc08){var _0xb012cc=this;return new Promise(function(_0x3a8de0,_0x92c0fd){return db[_0x388f('0x16')][_0x388f('0x17')](_0x11bc08[_0x388f('0x18')],{'raw':_0x11bc08['options']?_0x11bc08[_0x388f('0x19')][_0x388f('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3ba2d3){logger[_0x388f('0xb')](_0x388f('0x15'),_0x11bc08);logger[_0x388f('0x1b')]('CreateVoiceTransferReport',_0x11bc08,JSON['stringify'](_0x3ba2d3));_0x3a8de0(_0x3ba2d3);})[_0x388f('0x14')](function(_0x4d02a2){logger[_0x388f('0x10')](_0x388f('0x15'),_0x4d02a2[_0x388f('0x12')],_0x11bc08);_0x92c0fd(_0xb012cc[_0x388f('0x10')](0x1f4,_0x4d02a2[_0x388f('0x12')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 1aa495f..9b5eb39 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb1a6=['./config/seedDB','default','error','exit','lodash','./mysqldb','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','listen','then','info','start','Online\x20apps:','map','filter','name','join','status','seedDB'];(function(_0x22f2d0,_0x3cb9ac){var _0x49b53f=function(_0x3a72ab){while(--_0x3a72ab){_0x22f2d0['push'](_0x22f2d0['shift']());}};_0x49b53f(++_0x3cb9ac);}(_0xb1a6,0xb3));var _0x6b1a=function(_0x31d273,_0x5c02b7){_0x31d273=_0x31d273-0x0;var _0x20f57c=_0xb1a6[_0x31d273];return _0x20f57c;};'use strict';var _=require(_0x6b1a('0x0'));var mysqldb=require(_0x6b1a('0x1'));var rpc=require('./rpc');var config=require('./config/environment');var logger=require(_0x6b1a('0x2'))(_0x6b1a('0x3'));var pm2=require(_0x6b1a('0x4'));var pm2Config=require(_0x6b1a('0x5'));var schedule=require(_0x6b1a('0x6'));var chat=require(_0x6b1a('0x7'));function main(){return mysqldb['db'][_0x6b1a('0x8')][_0x6b1a('0x9')]()['then'](function(){return rpc[_0x6b1a('0xa')]();})[_0x6b1a('0xb')](function(_0x5d4f0f){logger[_0x6b1a('0xc')](_0x5d4f0f);return chat[_0x6b1a('0xd')]();})[_0x6b1a('0xb')](function(){return schedule[_0x6b1a('0xd')]();})['then'](function(_0x27ea43){logger[_0x6b1a('0xc')](_0x27ea43);return pm2['start'](pm2Config);})['then'](function(_0xc3140c){logger['info'](_0x6b1a('0xe'),_[_0x6b1a('0xf')](_[_0x6b1a('0x10')](_0xc3140c,{'status':'online'}),_0x6b1a('0x11'))[_0x6b1a('0x12')]());logger['info']('Offline\x20apps:',_[_0x6b1a('0xf')](_['filter'](_0xc3140c,function(_0x3036ee){return _0x3036ee[_0x6b1a('0x13')]!=='online';}),_0x6b1a('0x11'))[_0x6b1a('0x12')]()||'None');config[_0x6b1a('0x14')]&&require(_0x6b1a('0x15'))[_0x6b1a('0x16')]();require('./config/license')[_0x6b1a('0x16')]();})['catch'](function(_0xe46f92){logger[_0x6b1a('0x17')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0xe46f92);process[_0x6b1a('0x18')](0x1);});}main(); \ No newline at end of file +var _0xc987=['then','listen','start','info','Online\x20apps:','map','filter','name','join','Offline\x20apps:','seedDB','./config/seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','sequelize'];(function(_0xdd8280,_0x5696b9){var _0x1f2b3b=function(_0x12d568){while(--_0x12d568){_0xdd8280['push'](_0xdd8280['shift']());}};_0x1f2b3b(++_0x5696b9);}(_0xc987,0x104));var _0x7c98=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0xc987[_0x452968];return _0xb6f9ae;};'use strict';var _=require(_0x7c98('0x0'));var mysqldb=require(_0x7c98('0x1'));var rpc=require(_0x7c98('0x2'));var config=require(_0x7c98('0x3'));var logger=require(_0x7c98('0x4'))(_0x7c98('0x5'));var pm2=require(_0x7c98('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x7c98('0x7'));var chat=require(_0x7c98('0x8'));function main(){return mysqldb['db'][_0x7c98('0x9')]['sync']()[_0x7c98('0xa')](function(){return rpc[_0x7c98('0xb')]();})[_0x7c98('0xa')](function(_0x2c6550){logger['info'](_0x2c6550);return chat[_0x7c98('0xc')]();})[_0x7c98('0xa')](function(){return schedule[_0x7c98('0xc')]();})[_0x7c98('0xa')](function(_0x786cf4){logger[_0x7c98('0xd')](_0x786cf4);return pm2[_0x7c98('0xc')](pm2Config);})[_0x7c98('0xa')](function(_0x4dca5d){logger[_0x7c98('0xd')](_0x7c98('0xe'),_[_0x7c98('0xf')](_[_0x7c98('0x10')](_0x4dca5d,{'status':'online'}),_0x7c98('0x11'))[_0x7c98('0x12')]());logger[_0x7c98('0xd')](_0x7c98('0x13'),_[_0x7c98('0xf')](_['filter'](_0x4dca5d,function(_0xb55826){return _0xb55826['status']!=='online';}),'name')[_0x7c98('0x12')]()||'None');config[_0x7c98('0x14')]&&require(_0x7c98('0x15'))['default']();require('./config/license')[_0x7c98('0x16')]();})[_0x7c98('0x17')](function(_0x27c378){logger[_0x7c98('0x18')](_0x7c98('0x19'),_0x27c378);process[_0x7c98('0x1a')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index d0e4f73..a56e747 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 _0x6657=['email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastPauseAt','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','disposition','then','closed','status','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','Basic','authenticate','json','startsWith','Bearer','apikey','getUuid','query','User','find','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','../../config/license/util','getLicense','update','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','promisify','sign','secret','payload','verify','randomBytes','toString','hex','floor','HS512','../../mysqldb','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','secrets','session','role','fullname','name'];(function(_0x365a74,_0x706fb3){var _0x3ca21e=function(_0x7e8043){while(--_0x7e8043){_0x365a74['push'](_0x365a74['shift']());}};_0x3ca21e(++_0x706fb3);}(_0x6657,0x17f));var _0x7665=function(_0x42a0f6,_0x4ee755){_0x42a0f6=_0x42a0f6-0x0;var _0x259bdb=_0x6657[_0x42a0f6];return _0x259bdb;};'use strict';var db=require(_0x7665('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x7665('0x1'));var _=require(_0x7665('0x2'));var jwt=require(_0x7665('0x3'));var expressJwt=require(_0x7665('0x4'));var compose=require('composable-middleware');var basicAuth=require(_0x7665('0x5'));var crypto=require(_0x7665('0x6'));var BPromise=require(_0x7665('0x7'));var validateJwt=expressJwt({'secret':config[_0x7665('0x8')][_0x7665('0x9')]});var userAttributes=['id',_0x7665('0xa'),_0x7665('0xb'),_0x7665('0xc'),'internal',_0x7665('0xd'),_0x7665('0xe'),_0x7665('0xf'),_0x7665('0x10'),_0x7665('0x11'),_0x7665('0x12'),_0x7665('0x13'),_0x7665('0x14'),'smsPause',_0x7665('0x15'),_0x7665('0x16'),_0x7665('0x17'),'lastLoginAt',_0x7665('0x18'),'crudPermissions',_0x7665('0x19'),_0x7665('0x1a'),'alias',_0x7665('0x1b'),_0x7665('0x1c'),'phoneBarEnableRecording',_0x7665('0x1d'),_0x7665('0x1e'),'phoneBarExpires',_0x7665('0x1f'),_0x7665('0x20'),_0x7665('0x21'),_0x7665('0x22'),_0x7665('0x23'),_0x7665('0x24')];exports[_0x7665('0x25')]=function(){return this[_0x7665('0x26')](!![])[_0x7665('0x27')](function(_0x334ee6,_0x365469,_0xf730b0){if(_0x334ee6[_0x7665('0x28')]){_0xf730b0();}else{return db[_0x7665('0x29')][_0x7665('0x2a')]({'where':{'id':_0x334ee6[_0x7665('0x2b')]['id']},'attributes':['id','closed',_0x7665('0x2c')],'raw':!![]})[_0x7665('0x2d')](function(_0x4f1f1d){if(_0x4f1f1d&&_0x4f1f1d[_0x7665('0x2e')]){return _0x365469[_0x7665('0x2f')](_0x4f1f1d[_0x7665('0x2c')]===_0x7665('0x30')?0x195:0x193)['json']({'message':_0x4f1f1d[_0x7665('0x2c')]===_0x7665('0x30')?_0x7665('0x31'):_0x7665('0x32')});}else{_0xf730b0();}})[_0x7665('0x33')](function(_0x52cc46){_0xf730b0(_0x52cc46);});}});};exports[_0x7665('0x26')]=function isAuthenticated(_0x51d577){return compose()[_0x7665('0x27')](function(_0x158062,_0x4cf4b5,_0x5652dd){if(_0x158062[_0x7665('0x34')][_0x7665('0x35')]){if(_['startsWith'](_0x158062[_0x7665('0x34')][_0x7665('0x35')],_0x7665('0x36'))){var _0x488d86=basicAuth(_0x158062);db['User']['find']({'where':{'name':_0x488d86['name']}})[_0x7665('0x2d')](function(_0x3b22f4){if(!_0x3b22f4||!_0x3b22f4[_0x7665('0x37')](_0x488d86['pass'])){return _0x4cf4b5[_0x7665('0x2f')](0x191)[_0x7665('0x38')]({'message':'Wrong\x20credentials.'});}_0x158062['user']={'id':_0x3b22f4['id']};_0x5652dd();})[_0x7665('0x33')](function(_0x45f6a4){_0x5652dd(_0x45f6a4);});}else if(_[_0x7665('0x39')](_0x158062[_0x7665('0x34')][_0x7665('0x35')],_0x7665('0x3a'))){validateJwt(_0x158062,_0x4cf4b5,_0x5652dd);}else{if(_0x51d577){_0x5652dd();}else{return _0x4cf4b5['status'](0x193)[_0x7665('0x38')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x158062['query'][_0x7665('0x3b')]){var _0x7425af={'audience':hardwareConf[_0x7665('0x3c')](),'issuer':hardwareConf[_0x7665('0x3c')]()};verifyJwt(_0x158062[_0x7665('0x3d')][_0x7665('0x3b')],_0x7425af)[_0x7665('0x2d')](function(_0x2c3686){return db[_0x7665('0x3e')][_0x7665('0x3f')]({'where':{'id':_0x2c3686[_0x7665('0x40')]}})[_0x7665('0x2d')](function(_0x44463c){if(!_0x44463c||!_[_0x7665('0x41')](_0x44463c[_0x7665('0x42')],_0x2c3686[_0x7665('0x43')])){return _0x4cf4b5[_0x7665('0x2f')](0x193)[_0x7665('0x38')]({'message':_0x7665('0x44')});}_0x158062['user']={'id':_0x44463c['id']};_0x5652dd();});})[_0x7665('0x33')](function(_0xd93b75){_0x5652dd(_0xd93b75);});}else if(_0x51d577){_0x5652dd();}else{return _0x4cf4b5[_0x7665('0x2f')](0x193)[_0x7665('0x38')]({'message':_0x7665('0x45')});}})[_0x7665('0x27')](function(_0x4da120,_0x3a7a39,_0x2d93b6){if(_0x4da120[_0x7665('0x28')]){db[_0x7665('0x3e')][_0x7665('0x3f')]({'where':{'id':_0x4da120['user']['id']},'attributes':userAttributes})[_0x7665('0x2d')](function(_0x5f2c96){if(!_0x5f2c96){return _0x3a7a39[_0x7665('0x2f')](0x194)['json']({'message':_0x7665('0x46')});}_0x4da120[_0x7665('0x28')]=_0x5f2c96;_0x2d93b6();})[_0x7665('0x33')](function(_0x2f03bb){_0x2d93b6(_0x2f03bb);});}else if(_0x51d577){_0x2d93b6();}else{return _0x3a7a39[_0x7665('0x2f')](0x194)[_0x7665('0x38')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x7665('0x47')]=function canUpdate(){return compose()[_0x7665('0x27')](function(_0x99ff2f,_0x130ee6,_0x4d195d){return require(_0x7665('0x48'))[_0x7665('0x49')]()[_0x7665('0x2d')](function(_0x2aae93){if(_0x2aae93[_0x7665('0x4a')]){_0x4d195d();}else{return _0x130ee6['status'](0x193)[_0x7665('0x38')]({'message':_0x7665('0x4b')});}})[_0x7665('0x33')](function(_0x12e605){_0x4d195d(_0x12e605);});});};exports[_0x7665('0x4c')]=function(_0x30d450,_0x301cee,_0x46ea8a){_0x30d450[_0x7665('0x4c')]=!![];return _0x46ea8a();};exports[_0x7665('0x4d')]=function signToken(_0x586755){return signJwt(_0x586755);};exports['setTokenCookie']=function(_0x28f5e6,_0x3f20d6){if(!_0x28f5e6['user']){return _0x3f20d6['status'](0x194)[_0x7665('0x38')]({'message':_0x7665('0x4e')});}var _0x4dfec7={'payload':{'id':_0x28f5e6[_0x7665('0x28')]['id'],'role':_0x28f5e6[_0x7665('0x28')][_0x7665('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4dfec7)[_0x7665('0x2d')](function(_0x3cb235){_0x3f20d6[_0x7665('0x4f')](_0x7665('0x50'),_0x3cb235);_0x3f20d6[_0x7665('0x51')](_0x7665('0x52'));})[_0x7665('0x33')](function(_0xe56900){return _0x3f20d6[_0x7665('0x2f')](0x1f4)[_0x7665('0x53')](_0xe56900);});};exports[_0x7665('0x54')]=function(_0x4ebda0){if(_[_0x7665('0x55')](_0x4ebda0['apiKeyNonce'])||_[_0x7665('0x55')](_0x4ebda0[_0x7665('0x56')])){return null;}else{return createJwt(_0x4ebda0);}};exports[_0x7665('0x57')]=function(_0x375da9){_0x375da9[_0x7665('0x42')]=generateNonce();_0x375da9['apiKeyIat']=generateIssuedAt();return createJwt(_0x375da9);};exports[_0x7665('0x58')]=function(_0x42b7d3,_0x5dc646){var _0xe2650a=_0x42b7d3['query'][_0x7665('0x3b')];if(_0xe2650a){var _0x14a4bf={'nonce':_0x5dc646[_0x7665('0x42')],'iat':_0x5dc646['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x7665('0x3c')]()};return verifyJwt(_0xe2650a,_0x14a4bf)[_0x7665('0x2d')](function(){return generateApiKey(_0x5dc646);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function signJwt(_0x2343de){var _0x456d76=BPromise[_0x7665('0x59')](jwt[_0x7665('0x5a')],{'context':jwt});var _0x2e38d1=_0x2343de[_0x7665('0x5b')]||config[_0x7665('0x8')][_0x7665('0x9')];return new BPromise(function(_0x2fe046,_0x287e73){_0x456d76(_0x2343de[_0x7665('0x5c')],_0x2e38d1,_0x2343de['options'])[_0x7665('0x2d')](function(_0x5a21ee){_0x2fe046(_0x5a21ee);})[_0x7665('0x33')](function(_0x1cf4e2){_0x287e73(_0x1cf4e2);});});}function verifyJwt(_0x7dc436,_0x192f8d,_0x543425){var _0x310782=BPromise[_0x7665('0x59')](jwt[_0x7665('0x5d')],{'context':jwt});var _0x4375a3=_0x543425||config[_0x7665('0x8')]['session'];return new BPromise(function(_0x322b43,_0x5044ac){_0x310782(_0x7dc436,_0x4375a3,_0x192f8d)[_0x7665('0x2d')](function(_0x1052af){_0x322b43(_0x1052af);})['catch'](function(_0x4ef138){_0x5044ac(_0x4ef138);});});}function generateNonce(){return crypto[_0x7665('0x5e')](0x10)[_0x7665('0x5f')](_0x7665('0x60'));}function generateIssuedAt(){return Math[_0x7665('0x61')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x141938){var _0x567c79={'payload':{'iat':_0x141938[_0x7665('0x56')],'nonce':_0x141938[_0x7665('0x42')]},'options':{'algorithm':_0x7665('0x62'),'subject':_0x141938['id']['toString'](),'issuer':hardwareConf[_0x7665('0x3c')](),'audience':hardwareConf[_0x7665('0x3c')]()}};return signJwt(_0x567c79)[_0x7665('0x2d')](function(_0x41a17e){return{'iat':_0x141938[_0x7665('0x56')],'nonce':_0x141938[_0x7665('0x42')],'token':_0x41a17e};});} \ No newline at end of file +var _0xee14=['User','User\x20not\x20found.','User\x20object\x20not\x20found.','../../config/license/util','getLicense','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','promisify','sign','secret','session','options','toString','floor','now','HS512','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','secrets','role','name','internal','email','userpic','permissions','md5secret','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','then','status','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','find','authenticate','pass','json','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0xee14,0x13a));var _0x4ee1=function(_0x3071d5,_0x1c99a3){_0x3071d5=_0x3071d5-0x0;var _0x431115=_0xee14[_0x3071d5];return _0x431115;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require(_0x4ee1('0x0'));var _=require(_0x4ee1('0x1'));var jwt=require(_0x4ee1('0x2'));var expressJwt=require(_0x4ee1('0x3'));var compose=require(_0x4ee1('0x4'));var basicAuth=require(_0x4ee1('0x5'));var crypto=require(_0x4ee1('0x6'));var BPromise=require(_0x4ee1('0x7'));var validateJwt=expressJwt({'secret':config[_0x4ee1('0x8')]['session']});var userAttributes=['id',_0x4ee1('0x9'),'fullname',_0x4ee1('0xa'),_0x4ee1('0xb'),_0x4ee1('0xc'),_0x4ee1('0xd'),_0x4ee1('0xe'),_0x4ee1('0xf'),'voicePause',_0x4ee1('0x10'),_0x4ee1('0x11'),'faxPause',_0x4ee1('0x12'),_0x4ee1('0x13'),_0x4ee1('0x14'),_0x4ee1('0x15'),'lastLoginAt',_0x4ee1('0x16'),_0x4ee1('0x17'),_0x4ee1('0x18'),_0x4ee1('0x19'),_0x4ee1('0x1a'),_0x4ee1('0x1b'),'phoneBarAutoAnswerDelay',_0x4ee1('0x1c'),_0x4ee1('0x1d'),_0x4ee1('0x1e'),_0x4ee1('0x1f'),_0x4ee1('0x20'),_0x4ee1('0x21'),_0x4ee1('0x22'),_0x4ee1('0x23'),_0x4ee1('0x24'),'userProfileId'];exports[_0x4ee1('0x25')]=function(){return this[_0x4ee1('0x26')](!![])[_0x4ee1('0x27')](function(_0x1b1e0e,_0x123c5e,_0x38fc33){if(_0x1b1e0e[_0x4ee1('0x28')]){_0x38fc33();}else{return db[_0x4ee1('0x29')][_0x4ee1('0x2a')]({'where':{'id':_0x1b1e0e[_0x4ee1('0x2b')]['id']},'attributes':['id',_0x4ee1('0x2c'),'disposition'],'raw':!![]})[_0x4ee1('0x2d')](function(_0x3db827){if(_0x3db827&&_0x3db827[_0x4ee1('0x2c')]){return _0x123c5e[_0x4ee1('0x2e')](_0x3db827[_0x4ee1('0x2f')]===_0x4ee1('0x30')?0x195:0x193)['json']({'message':_0x3db827[_0x4ee1('0x2f')]===_0x4ee1('0x30')?_0x4ee1('0x31'):_0x4ee1('0x32')});}else{_0x38fc33();}})[_0x4ee1('0x33')](function(_0x224b54){_0x38fc33(_0x224b54);});}});};exports[_0x4ee1('0x26')]=function isAuthenticated(_0x40fd98){return compose()[_0x4ee1('0x27')](function(_0x3e5038,_0x4faaf6,_0x53d43f){if(_0x3e5038[_0x4ee1('0x34')][_0x4ee1('0x35')]){if(_[_0x4ee1('0x36')](_0x3e5038[_0x4ee1('0x34')][_0x4ee1('0x35')],_0x4ee1('0x37'))){var _0x57d45d=basicAuth(_0x3e5038);db['User'][_0x4ee1('0x38')]({'where':{'name':_0x57d45d[_0x4ee1('0xa')]}})['then'](function(_0x35900d){if(!_0x35900d||!_0x35900d[_0x4ee1('0x39')](_0x57d45d[_0x4ee1('0x3a')])){return _0x4faaf6[_0x4ee1('0x2e')](0x191)[_0x4ee1('0x3b')]({'message':_0x4ee1('0x3c')});}_0x3e5038[_0x4ee1('0x28')]={'id':_0x35900d['id']};_0x53d43f();})['catch'](function(_0x1f7b74){_0x53d43f(_0x1f7b74);});}else if(_['startsWith'](_0x3e5038[_0x4ee1('0x34')]['authorization'],_0x4ee1('0x3d'))){validateJwt(_0x3e5038,_0x4faaf6,_0x53d43f);}else{if(_0x40fd98){_0x53d43f();}else{return _0x4faaf6[_0x4ee1('0x2e')](0x193)[_0x4ee1('0x3b')]({'message':_0x4ee1('0x3e')});}}}else if(_0x3e5038[_0x4ee1('0x3f')]['apikey']){var _0x1f7483={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x4ee1('0x40')]()};verifyJwt(_0x3e5038[_0x4ee1('0x3f')][_0x4ee1('0x41')],_0x1f7483)[_0x4ee1('0x2d')](function(_0xac31e9){return db['User'][_0x4ee1('0x38')]({'where':{'id':_0xac31e9[_0x4ee1('0x42')]}})[_0x4ee1('0x2d')](function(_0x2e37a3){if(!_0x2e37a3||!_[_0x4ee1('0x43')](_0x2e37a3[_0x4ee1('0x44')],_0xac31e9['nonce'])){return _0x4faaf6['status'](0x193)[_0x4ee1('0x3b')]({'message':_0x4ee1('0x45')});}_0x3e5038[_0x4ee1('0x28')]={'id':_0x2e37a3['id']};_0x53d43f();});})['catch'](function(_0x963c2b){_0x53d43f(_0x963c2b);});}else if(_0x40fd98){_0x53d43f();}else{return _0x4faaf6[_0x4ee1('0x2e')](0x193)[_0x4ee1('0x3b')]({'message':_0x4ee1('0x3e')});}})[_0x4ee1('0x27')](function(_0x115590,_0x1d3d64,_0x199e11){if(_0x115590[_0x4ee1('0x28')]){db[_0x4ee1('0x46')][_0x4ee1('0x38')]({'where':{'id':_0x115590[_0x4ee1('0x28')]['id']},'attributes':userAttributes})[_0x4ee1('0x2d')](function(_0x55ac4a){if(!_0x55ac4a){return _0x1d3d64[_0x4ee1('0x2e')](0x194)[_0x4ee1('0x3b')]({'message':_0x4ee1('0x47')});}_0x115590['user']=_0x55ac4a;_0x199e11();})['catch'](function(_0x257f67){_0x199e11(_0x257f67);});}else if(_0x40fd98){_0x199e11();}else{return _0x1d3d64[_0x4ee1('0x2e')](0x194)[_0x4ee1('0x3b')]({'message':_0x4ee1('0x48')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x4ee1('0x27')](function(_0x2ed16f,_0x11721a,_0x49fa73){return require(_0x4ee1('0x49'))[_0x4ee1('0x4a')]()[_0x4ee1('0x2d')](function(_0x325b59){if(_0x325b59['update']){_0x49fa73();}else{return _0x11721a[_0x4ee1('0x2e')](0x193)[_0x4ee1('0x3b')]({'message':_0x4ee1('0x4b')});}})[_0x4ee1('0x33')](function(_0x45bb22){_0x49fa73(_0x45bb22);});});};exports[_0x4ee1('0x4c')]=function(_0x543b2e,_0x3e2ca7,_0x37176a){_0x543b2e[_0x4ee1('0x4c')]=!![];return _0x37176a();};exports[_0x4ee1('0x4d')]=function signToken(_0x6600f5){return signJwt(_0x6600f5);};exports[_0x4ee1('0x4e')]=function(_0x3f0d8b,_0xaac883){if(!_0x3f0d8b[_0x4ee1('0x28')]){return _0xaac883[_0x4ee1('0x2e')](0x194)[_0x4ee1('0x3b')]({'message':_0x4ee1('0x4f')});}var _0x34fc7a={'payload':{'id':_0x3f0d8b['user']['id'],'role':_0x3f0d8b[_0x4ee1('0x28')][_0x4ee1('0x9')]},'options':{'expiresIn':0x15180}};return signJwt(_0x34fc7a)['then'](function(_0x3c759f){_0xaac883['cookie'](_0x4ee1('0x50'),_0x3c759f);_0xaac883['redirect'](_0x4ee1('0x51'));})[_0x4ee1('0x33')](function(_0x557126){return _0xaac883[_0x4ee1('0x2e')](0x1f4)[_0x4ee1('0x52')](_0x557126);});};exports[_0x4ee1('0x53')]=function(_0x3dfd9c){if(_['isNil'](_0x3dfd9c[_0x4ee1('0x44')])||_[_0x4ee1('0x54')](_0x3dfd9c[_0x4ee1('0x55')])){return null;}else{return createJwt(_0x3dfd9c);}};exports['generateApiKey']=function(_0x4fbe92){_0x4fbe92[_0x4ee1('0x44')]=generateNonce();_0x4fbe92[_0x4ee1('0x55')]=generateIssuedAt();return createJwt(_0x4fbe92);};exports[_0x4ee1('0x56')]=function(_0x1cc989,_0x15a48a){var _0x4ebcca=_0x1cc989['query'][_0x4ee1('0x41')];if(_0x4ebcca){var _0x266add={'nonce':_0x15a48a[_0x4ee1('0x44')],'iat':_0x15a48a[_0x4ee1('0x55')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x4ee1('0x40')]()};return verifyJwt(_0x4ebcca,_0x266add)[_0x4ee1('0x2d')](function(){return generateApiKey(_0x15a48a);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function signJwt(_0x21ebb8){var _0x16dc20=BPromise[_0x4ee1('0x57')](jwt[_0x4ee1('0x58')],{'context':jwt});var _0x38db17=_0x21ebb8[_0x4ee1('0x59')]||config[_0x4ee1('0x8')][_0x4ee1('0x5a')];return new BPromise(function(_0x390051,_0x4ebb28){_0x16dc20(_0x21ebb8['payload'],_0x38db17,_0x21ebb8[_0x4ee1('0x5b')])[_0x4ee1('0x2d')](function(_0x3bda30){_0x390051(_0x3bda30);})[_0x4ee1('0x33')](function(_0x58e963){_0x4ebb28(_0x58e963);});});}function verifyJwt(_0x35edf5,_0x3c66d1,_0x42dd8d){var _0x2bc77f=BPromise[_0x4ee1('0x57')](jwt['verify'],{'context':jwt});var _0x1c71ba=_0x42dd8d||config[_0x4ee1('0x8')][_0x4ee1('0x5a')];return new BPromise(function(_0x4bc298,_0x1a7dbd){_0x2bc77f(_0x35edf5,_0x1c71ba,_0x3c66d1)['then'](function(_0x572bbd){_0x4bc298(_0x572bbd);})['catch'](function(_0x30a1cd){_0x1a7dbd(_0x30a1cd);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x4ee1('0x5c')]('hex');}function generateIssuedAt(){return Math[_0x4ee1('0x5d')](Date[_0x4ee1('0x5e')]()/0x3e8)[_0x4ee1('0x5c')]();}function createJwt(_0x5f4f78){var _0x3368ed={'payload':{'iat':_0x5f4f78[_0x4ee1('0x55')],'nonce':_0x5f4f78[_0x4ee1('0x44')]},'options':{'algorithm':_0x4ee1('0x5f'),'subject':_0x5f4f78['id'][_0x4ee1('0x5c')](),'issuer':hardwareConf[_0x4ee1('0x40')](),'audience':hardwareConf[_0x4ee1('0x40')]()}};return signJwt(_0x3368ed)['then'](function(_0x4c4178){return{'iat':_0x5f4f78[_0x4ee1('0x55')],'nonce':_0x5f4f78[_0x4ee1('0x44')],'token':_0x4c4178};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index b7f863f..f7913c1 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 _0xd8b0=['data','binary','end','final','write','close','unlink','decryptFile','createReadStream','createDecipher','update','crypto','bluebird','hasOwnProperty','encryptFile','createWriteStream','createCipher','algorithm'];(function(_0x561b44,_0x2c8366){var _0x3cd153=function(_0x10c3ec){while(--_0x10c3ec){_0x561b44['push'](_0x561b44['shift']());}};_0x3cd153(++_0x2c8366);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var crypto=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var defaultOptions={'algorithm':'aes192'};function combineOptions(_0x585166){var _0x4b72b0={};for(var _0x3ff8df in defaultOptions){if(defaultOptions[_0x0d8b('0x2')](_0x3ff8df)){_0x4b72b0[_0x3ff8df]=defaultOptions[_0x3ff8df];}}if(_0x585166){for(var _0x43bca1 in _0x585166){if(_0x585166[_0x0d8b('0x2')](_0x43bca1)){_0x4b72b0[_0x43bca1]=_0x585166[_0x43bca1];}}}return _0x4b72b0;}exports[_0x0d8b('0x3')]=function(_0x577834,_0x5e15e6,_0x3f8b6f,_0x227c63){return new BPromise(function(_0x39f43a,_0x4a4470){_0x227c63=combineOptions(_0x227c63);var _0x413284=new Buffer(_0x3f8b6f);var _0x284169=fs['createReadStream'](_0x577834);var _0x129310=fs[_0x0d8b('0x4')](_0x5e15e6);var _0x3b027f=crypto[_0x0d8b('0x5')](_0x227c63[_0x0d8b('0x6')],_0x413284);_0x284169['on'](_0x0d8b('0x7'),function(_0x2c5e9e){var _0x28f87c=new Buffer(_0x3b027f['update'](_0x2c5e9e),_0x0d8b('0x8'));_0x129310['write'](_0x28f87c);});_0x284169['on'](_0x0d8b('0x9'),function(){try{var _0xc574a3=new Buffer(_0x3b027f[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x129310[_0x0d8b('0xb')](_0xc574a3);_0x129310[_0x0d8b('0x9')]();_0x129310['on'](_0x0d8b('0xc'),function(){return _0x39f43a(_0x5e15e6);});}catch(_0x1d4bbc){fs[_0x0d8b('0xd')](_0x5e15e6);return _0x4a4470(_0x1d4bbc);}});});};exports[_0x0d8b('0xe')]=function(_0xe65334,_0x1567ce,_0x2d4e1c,_0x4f6f21){return new BPromise(function(_0x23eb7b,_0xa86349){_0x4f6f21=combineOptions(_0x4f6f21);var _0x17f7df=new Buffer(_0x2d4e1c);var _0xe2e167=fs[_0x0d8b('0xf')](_0xe65334);var _0x5cd485=fs[_0x0d8b('0x4')](_0x1567ce);var _0x4586c2=crypto[_0x0d8b('0x10')](_0x4f6f21[_0x0d8b('0x6')],_0x17f7df);_0xe2e167['on'](_0x0d8b('0x7'),function(_0x18dd2d){var _0x264b39=new Buffer(_0x4586c2[_0x0d8b('0x11')](_0x18dd2d),'binary');_0x5cd485[_0x0d8b('0xb')](_0x264b39);});_0xe2e167['on'](_0x0d8b('0x9'),function(){try{var _0x196c0a=new Buffer(_0x4586c2[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x5cd485[_0x0d8b('0xb')](_0x196c0a);_0x5cd485[_0x0d8b('0x9')]();_0x5cd485['on']('close',function(){return _0x23eb7b(_0x1567ce);});}catch(_0x4f0a1a){fs[_0x0d8b('0xd')](_0x1567ce);return _0xa86349(_0x4f0a1a);}});});}; \ No newline at end of file +var _0xb7e7=['crypto','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','update','binary','write','end','final','createDecipher','data','close','unlink'];(function(_0x4a5c7e,_0x578d6c){var _0x3313fe=function(_0x4f3031){while(--_0x4f3031){_0x4a5c7e['push'](_0x4a5c7e['shift']());}};_0x3313fe(++_0x578d6c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xb7e7[_0x9aada2];return _0x196dff;};'use strict';var crypto=require(_0x7b7e('0x0'));var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x7b7e('0x1')};function combineOptions(_0x518dc6){var _0x1b7cc7={};for(var _0x54a37f in defaultOptions){if(defaultOptions[_0x7b7e('0x2')](_0x54a37f)){_0x1b7cc7[_0x54a37f]=defaultOptions[_0x54a37f];}}if(_0x518dc6){for(var _0x556d68 in _0x518dc6){if(_0x518dc6[_0x7b7e('0x2')](_0x556d68)){_0x1b7cc7[_0x556d68]=_0x518dc6[_0x556d68];}}}return _0x1b7cc7;}exports[_0x7b7e('0x3')]=function(_0x1d9384,_0x52047f,_0x53ed64,_0x333fa4){return new BPromise(function(_0x372bde,_0x7f87e0){_0x333fa4=combineOptions(_0x333fa4);var _0x55ce81=new Buffer(_0x53ed64);var _0x42b871=fs[_0x7b7e('0x4')](_0x1d9384);var _0x2917f9=fs[_0x7b7e('0x5')](_0x52047f);var _0x148964=crypto[_0x7b7e('0x6')](_0x333fa4[_0x7b7e('0x7')],_0x55ce81);_0x42b871['on']('data',function(_0x299519){var _0x1eef0a=new Buffer(_0x148964[_0x7b7e('0x8')](_0x299519),_0x7b7e('0x9'));_0x2917f9[_0x7b7e('0xa')](_0x1eef0a);});_0x42b871['on'](_0x7b7e('0xb'),function(){try{var _0x36d2a3=new Buffer(_0x148964[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x2917f9[_0x7b7e('0xa')](_0x36d2a3);_0x2917f9[_0x7b7e('0xb')]();_0x2917f9['on']('close',function(){return _0x372bde(_0x52047f);});}catch(_0x422d3a){fs['unlink'](_0x52047f);return _0x7f87e0(_0x422d3a);}});});};exports['decryptFile']=function(_0x2889ed,_0xd304f5,_0xf067da,_0x457ec5){return new BPromise(function(_0x3d2fb2,_0x5703fd){_0x457ec5=combineOptions(_0x457ec5);var _0x51baf6=new Buffer(_0xf067da);var _0xc7f087=fs[_0x7b7e('0x4')](_0x2889ed);var _0x27f999=fs[_0x7b7e('0x5')](_0xd304f5);var _0x2cc400=crypto[_0x7b7e('0xd')](_0x457ec5[_0x7b7e('0x7')],_0x51baf6);_0xc7f087['on'](_0x7b7e('0xe'),function(_0x2acb8c){var _0x429a0e=new Buffer(_0x2cc400[_0x7b7e('0x8')](_0x2acb8c),_0x7b7e('0x9'));_0x27f999[_0x7b7e('0xa')](_0x429a0e);});_0xc7f087['on'](_0x7b7e('0xb'),function(){try{var _0x9776c3=new Buffer(_0x2cc400[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x27f999[_0x7b7e('0xa')](_0x9776c3);_0x27f999[_0x7b7e('0xb')]();_0x27f999['on'](_0x7b7e('0xf'),function(){return _0x3d2fb2(_0xd304f5);});}catch(_0x4c0647){fs[_0x7b7e('0x10')](_0xd304f5);return _0x5703fd(_0x4c0647);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 1b2b2df..814a771 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 _0x99e9=['rimraf','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','length','num','push','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','existsSync','join','mkdirSync','each','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','path','lodash','to-csv','bluebird'];(function(_0x5d0746,_0x511b2d){var _0x19a392=function(_0x111382){while(--_0x111382){_0x5d0746['push'](_0x5d0746['shift']());}};_0x19a392(++_0x511b2d);}(_0x99e9,0xb4));var _0x999e=function(_0x54fbff,_0x53470e){_0x54fbff=_0x54fbff-0x0;var _0x5cf619=_0x99e9[_0x54fbff];return _0x5cf619;};'use strict';var util=require('util');var path=require(_0x999e('0x0'));var _=require(_0x999e('0x1'));var csv=require(_0x999e('0x2'));var fs=require('fs');var BPromise=require(_0x999e('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x999e('0x4'));var db=require(_0x999e('0x5'))['db'];var dbH=require(_0x999e('0x5'))['dbH'];var logger=require(_0x999e('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x999e('0x7')][0x2]);var QUERY=process[_0x999e('0x7')][0x3];var PATH=process[_0x999e('0x7')][0x4];function analyticExtractedReport(_0x18f337,_0x5c1c17){var _0x46aeae={'status':_0x18f337};var _0x38a692={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5c1c17){_0x46aeae[_0x999e('0x8')]=_0x5c1c17;}return db[_0x999e('0x9')][_0x999e('0xa')](_0x46aeae,_0x38a692);}function main(){var _0x175042=0x1388;var _0x3f2c24;logger[_0x999e('0xb')](util[_0x999e('0xc')](_0x999e('0xd'),EXTRACTED_REPORT_ID,_0x999e('0xe')));return db[_0x999e('0xf')][_0x999e('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x999e('0x11'),_0x999e('0x12')]})[_0x999e('0x13')](function(_0x26b55a){if(_0x26b55a){_0x3f2c24=_0x26b55a;_0x175042=_0x3f2c24['splitSizeCsv']||0x1388;}})[_0x999e('0x13')](function(){return dbH['sequelize'][_0x999e('0x14')](util[_0x999e('0xc')](_0x999e('0x15'),QUERY),{'type':dbH['sequelize'][_0x999e('0x16')]['SELECT']});})[_0x999e('0x13')](function(_0x539598){if(!_0x539598[0x0]['num']){return analyticExtractedReport(_0x999e('0x17'));}var _0x22feac=[];var _0x2dd5f4=0x0;var _0x289e0e=!![];if(_0x539598&&_0x539598[_0x999e('0x18')]){var _0x39ce36=_0x539598[0x0]['num']%(_0x2dd5f4+_0x175042);if(_0x3f2c24['split']){for(;_0x289e0e;_0x2dd5f4+=_0x175042,_0x39ce36=_0x539598[0x0]['num']%(_0x2dd5f4+_0x175042)){if(_0x39ce36==0x0||_0x39ce36==_0x539598[0x0][_0x999e('0x19')]){_0x289e0e=![];}_0x22feac[_0x999e('0x1a')](dbH[_0x999e('0x1b')][_0x999e('0x14')](util[_0x999e('0xc')](_0x999e('0x1c'),QUERY,_0x175042,_0x2dd5f4),{'type':dbH['sequelize']['QueryTypes'][_0x999e('0x1d')]}));}}else{_0x22feac[_0x999e('0x1a')](dbH[_0x999e('0x1b')]['query'](QUERY,{'type':dbH[_0x999e('0x1b')][_0x999e('0x16')][_0x999e('0x1d')]}));}}var _0x36fce4=path[_0x999e('0x1e')](PATH);var _0x3750a0=path[_0x999e('0x1f')](PATH,'.csv');var _0x54ad83=_0x3f2c24[_0x999e('0x11')]&&_0x22feac[_0x999e('0x18')]>0x1;var _0x4c5491=[];if(!fs[_0x999e('0x20')](path[_0x999e('0x21')](_0x36fce4,_0x3750a0))&&_0x54ad83){fs[_0x999e('0x22')](path[_0x999e('0x21')](_0x36fce4,_0x3750a0));}return BPromise[_0x999e('0x23')](_0x22feac,function(_0x320634){_0x4c5491['push'](_0x320634);})[_0x999e('0x13')](function(){for(var _0x4199ff=0x0;_0x4199ff<_0x4c5491[_0x999e('0x18')];_0x4199ff+=0x1){var _0x12b9ad;var _0x1b7adb=_0x4c5491[_0x4199ff];if(_0x54ad83){_0x12b9ad=path[_0x999e('0x21')](_0x36fce4,_0x3750a0,util[_0x999e('0xc')]('%s%d.%s',_0x3750a0,_0x4199ff,_0x999e('0x24')));}else{_0x12b9ad=path['join'](_0x36fce4,util['format'](_0x999e('0x25'),_0x3750a0,_0x999e('0x24')));}fs[_0x999e('0x26')](_0x12b9ad,csv(_0x1b7adb));}})['then'](function(){if(_0x54ad83){zipdir(path[_0x999e('0x21')](_0x36fce4,_0x3750a0),{'saveTo':path[_0x999e('0x21')](_0x36fce4,util[_0x999e('0xc')](_0x999e('0x25'),_0x3750a0,_0x999e('0x27')))},function(_0x327079,_0x82e067){});rimraf(path[_0x999e('0x21')](_0x36fce4,_0x3750a0),function(){});}})[_0x999e('0x13')](function(){logger[_0x999e('0xb')](util['format'](_0x999e('0x28'),EXTRACTED_REPORT_ID,_0x999e('0xe')));return analyticExtractedReport(_0x999e('0x29'),_0x54ad83?util['format'](_0x999e('0x25'),_0x3750a0,_0x54ad83?'zip':'csv'):null);});})[_0x999e('0x2a')](function(_0x332195){logger['info'](util['format'](_0x999e('0x2b'),EXTRACTED_REPORT_ID,_0x999e('0xe')),util[_0x999e('0x2c')](_0x332195,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x999e('0x2d'));});}main(); \ No newline at end of file +var _0xfd28=['%s.%s','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','path','lodash','bluebird','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','update','format','CSV','find','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','split','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','length','existsSync','join','mkdirSync','each','csv','writeFileSync'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xfd28,0x148));var _0x8fd2=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0xfd28[_0xf79bae];return _0x5d2cb7;};'use strict';var util=require('util');var path=require(_0x8fd2('0x0'));var _=require(_0x8fd2('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x8fd2('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x8fd2('0x3'));var db=require(_0x8fd2('0x4'))['db'];var dbH=require(_0x8fd2('0x4'))['dbH'];var logger=require(_0x8fd2('0x5'))(_0x8fd2('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x8fd2('0x7')][0x2]);var QUERY=process[_0x8fd2('0x7')][0x3];var PATH=process[_0x8fd2('0x7')][0x4];function analyticExtractedReport(_0x4bdc1a,_0x53d938){var _0x10fccf={'status':_0x4bdc1a};var _0x466c3d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x53d938){_0x10fccf[_0x8fd2('0x8')]=_0x53d938;}return db['AnalyticExtractedReport'][_0x8fd2('0x9')](_0x10fccf,_0x466c3d);}function main(){var _0x49ca87=0x1388;var _0x2842f3;logger['info'](util[_0x8fd2('0xa')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8fd2('0xb')));return db['Setting'][_0x8fd2('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8fd2('0xd')]})[_0x8fd2('0xe')](function(_0xfd78d){if(_0xfd78d){_0x2842f3=_0xfd78d;_0x49ca87=_0x2842f3[_0x8fd2('0xd')]||0x1388;}})[_0x8fd2('0xe')](function(){return dbH[_0x8fd2('0xf')][_0x8fd2('0x10')](util[_0x8fd2('0xa')](_0x8fd2('0x11'),QUERY),{'type':dbH[_0x8fd2('0xf')][_0x8fd2('0x12')][_0x8fd2('0x13')]});})[_0x8fd2('0xe')](function(_0x40712c){if(!_0x40712c[0x0][_0x8fd2('0x14')]){return analyticExtractedReport('Empty');}var _0x20daca=[];var _0x5ef478=0x0;var _0x4f0b17=!![];if(_0x40712c&&_0x40712c['length']){var _0x3b79f3=_0x40712c[0x0][_0x8fd2('0x14')]%(_0x5ef478+_0x49ca87);if(_0x2842f3[_0x8fd2('0x15')]){for(;_0x4f0b17;_0x5ef478+=_0x49ca87,_0x3b79f3=_0x40712c[0x0][_0x8fd2('0x14')]%(_0x5ef478+_0x49ca87)){if(_0x3b79f3==0x0||_0x3b79f3==_0x40712c[0x0]['num']){_0x4f0b17=![];}_0x20daca[_0x8fd2('0x16')](dbH[_0x8fd2('0xf')][_0x8fd2('0x10')](util[_0x8fd2('0xa')](_0x8fd2('0x17'),QUERY,_0x49ca87,_0x5ef478),{'type':dbH['sequelize']['QueryTypes'][_0x8fd2('0x13')]}));}}else{_0x20daca['push'](dbH[_0x8fd2('0xf')]['query'](QUERY,{'type':dbH[_0x8fd2('0xf')][_0x8fd2('0x12')]['SELECT']}));}}var _0x122b60=path['dirname'](PATH);var _0xd3981f=path[_0x8fd2('0x18')](PATH,'.csv');var _0x1c925c=_0x2842f3[_0x8fd2('0x15')]&&_0x20daca[_0x8fd2('0x19')]>0x1;var _0x490ea5=[];if(!fs[_0x8fd2('0x1a')](path[_0x8fd2('0x1b')](_0x122b60,_0xd3981f))&&_0x1c925c){fs[_0x8fd2('0x1c')](path[_0x8fd2('0x1b')](_0x122b60,_0xd3981f));}return BPromise[_0x8fd2('0x1d')](_0x20daca,function(_0x25db4e){_0x490ea5[_0x8fd2('0x16')](_0x25db4e);})[_0x8fd2('0xe')](function(){for(var _0x1456b4=0x0;_0x1456b4<_0x490ea5[_0x8fd2('0x19')];_0x1456b4+=0x1){var _0x3392fb;var _0x1f3237=_0x490ea5[_0x1456b4];if(_0x1c925c){_0x3392fb=path[_0x8fd2('0x1b')](_0x122b60,_0xd3981f,util['format']('%s%d.%s',_0xd3981f,_0x1456b4,_0x8fd2('0x1e')));}else{_0x3392fb=path[_0x8fd2('0x1b')](_0x122b60,util[_0x8fd2('0xa')]('%s.%s',_0xd3981f,_0x8fd2('0x1e')));}fs[_0x8fd2('0x1f')](_0x3392fb,csv(_0x1f3237));}})[_0x8fd2('0xe')](function(){if(_0x1c925c){zipdir(path[_0x8fd2('0x1b')](_0x122b60,_0xd3981f),{'saveTo':path[_0x8fd2('0x1b')](_0x122b60,util[_0x8fd2('0xa')](_0x8fd2('0x20'),_0xd3981f,'zip'))},function(_0xe76676,_0x13c9b9){});rimraf(path[_0x8fd2('0x1b')](_0x122b60,_0xd3981f),function(){});}})[_0x8fd2('0xe')](function(){logger[_0x8fd2('0x21')](util[_0x8fd2('0xa')](_0x8fd2('0x22'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x1c925c?util['format'](_0x8fd2('0x20'),_0xd3981f,_0x1c925c?_0x8fd2('0x23'):_0x8fd2('0x1e')):null);});})[_0x8fd2('0x24')](function(_0x5a0b3b){logger['info'](util[_0x8fd2('0xa')](_0x8fd2('0x25'),EXTRACTED_REPORT_ID,_0x8fd2('0xb')),util[_0x8fd2('0x26')](_0x5a0b3b,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x8fd2('0x27'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 948b470..88825a4 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 _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0x3adc10,_0x8748bb){var _0x100ef3=function(_0x2643e7){while(--_0x2643e7){_0x3adc10['push'](_0x3adc10['shift']());}};_0x100ef3(++_0x8748bb);}(_0xb10b,0x12a));var _0xbb10=function(_0x510347,_0xdf770a){_0x510347=_0x510347-0x0;var _0x5cb84f=_0xb10b[_0x510347];return _0x5cb84f;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main(); \ No newline at end of file +var _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0x559f4f,_0x2c0b2e){var _0xcccc07=function(_0x58fe8f){while(--_0x58fe8f){_0x559f4f['push'](_0x559f4f['shift']());}};_0xcccc07(++_0x2c0b2e);}(_0xb10b,0x12a));var _0xbb10=function(_0x275fbb,_0x52bdd9){_0x275fbb=_0x275fbb-0x0;var _0x1a1699=_0xb10b[_0x275fbb];return _0x1a1699;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 2b9388a..49d06ca 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 _0x20de=['util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','num','push','basename','.xlsx','length','existsSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x149a69,_0x4969b7){var _0x1e3de1=function(_0x99b61d){while(--_0x99b61d){_0x149a69['push'](_0x149a69['shift']());}};_0x1e3de1(++_0x4969b7);}(_0x20de,0x134));var _0xe20d=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x20de[_0x20589d];return _0x422de9;};'use strict';var util=require(_0xe20d('0x0'));var path=require('path');var _=require(_0xe20d('0x1'));var fs=require('fs');var json2xls=require(_0xe20d('0x2'));var BPromise=require(_0xe20d('0x3'));var zipdir=require(_0xe20d('0x4'));var rimraf=require(_0xe20d('0x5'));var db=require(_0xe20d('0x6'))['db'];var dbH=require(_0xe20d('0x6'))[_0xe20d('0x7')];var logger=require(_0xe20d('0x8'))(_0xe20d('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xe20d('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xe20d('0xa')][0x4];function analyticExtractedReport(_0x5a5ac2,_0x4e1fb9){var _0x4909c9={'status':_0x5a5ac2};var _0x110ff5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4e1fb9){_0x4909c9[_0xe20d('0xb')]=_0x4e1fb9;}return db[_0xe20d('0xc')]['update'](_0x4909c9,_0x110ff5);}function main(){var _0x288d35=0x1388;var _0x2df52b;logger['info'](util[_0xe20d('0xd')](_0xe20d('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xe20d('0xf')][_0xe20d('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe20d('0x11'),_0xe20d('0x12')]})['then'](function(_0x59a581){if(_0x59a581){_0x2df52b=_0x59a581;_0x288d35=_0x2df52b[_0xe20d('0x12')]||0x1388;}})[_0xe20d('0x13')](function(){return dbH[_0xe20d('0x14')][_0xe20d('0x15')](util[_0xe20d('0xd')](_0xe20d('0x16'),QUERY),{'type':dbH[_0xe20d('0x14')][_0xe20d('0x17')][_0xe20d('0x18')]});})['then'](function(_0x2367f7){if(!_0x2367f7[0x0]['num']){return analyticExtractedReport(_0xe20d('0x19'));}var _0x3aa19d=[];var _0x29b500=0x0;var _0x53f8c3=!![];if(_0x2df52b[_0xe20d('0x11')]){if(_0x2367f7&&_0x2367f7['length']){var _0x1738d9=_0x2367f7[0x0][_0xe20d('0x1a')]%(_0x29b500+_0x288d35);for(;_0x53f8c3;_0x29b500+=_0x288d35,_0x1738d9=_0x2367f7[0x0][_0xe20d('0x1a')]%(_0x29b500+_0x288d35)){if(_0x1738d9==0x0||_0x1738d9==_0x2367f7[0x0]['num']){_0x53f8c3=![];}_0x3aa19d[_0xe20d('0x1b')](dbH[_0xe20d('0x14')][_0xe20d('0x15')](util[_0xe20d('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x288d35,_0x29b500),{'type':dbH[_0xe20d('0x14')][_0xe20d('0x17')][_0xe20d('0x18')]}));}}}else{_0x3aa19d[_0xe20d('0x1b')](dbH['sequelize'][_0xe20d('0x15')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xe20d('0x18')]}));}var _0x4045b3=path['dirname'](PATH);var _0x5e7237=path[_0xe20d('0x1c')](PATH,_0xe20d('0x1d'));var _0x5ce547=_0x2df52b[_0xe20d('0x11')]&&_0x3aa19d[_0xe20d('0x1e')]>0x1;var _0x3f0227=[];if(!fs[_0xe20d('0x1f')](path[_0xe20d('0x20')](_0x4045b3,_0x5e7237))&&_0x5ce547){fs['mkdirSync'](path[_0xe20d('0x20')](_0x4045b3,_0x5e7237));}return BPromise[_0xe20d('0x21')](_0x3aa19d,function(_0x1a76bc){_0x3f0227[_0xe20d('0x1b')](_0x1a76bc);})[_0xe20d('0x13')](function(){for(var _0x51f395=0x0;_0x51f395<_0x3f0227['length'];_0x51f395+=0x1){var _0x27b759;var _0x497726=_0x3f0227[_0x51f395];if(_0x5ce547){_0x27b759=path[_0xe20d('0x20')](_0x4045b3,_0x5e7237,util[_0xe20d('0xd')](_0xe20d('0x22'),_0x5e7237,_0x51f395,_0xe20d('0x23')));}else{_0x27b759=path[_0xe20d('0x20')](_0x4045b3,util[_0xe20d('0xd')](_0xe20d('0x24'),_0x5e7237,'xlsx'));}fs[_0xe20d('0x25')](_0x27b759,json2xls(_0x497726),'binary');}})['then'](function(){if(_0x5ce547){zipdir(path['join'](_0x4045b3,_0x5e7237),{'saveTo':path['join'](_0x4045b3,util['format'](_0xe20d('0x24'),_0x5e7237,_0xe20d('0x26')))},function(_0x41e140,_0x4f2d27){});rimraf(path['join'](_0x4045b3,_0x5e7237),function(){});}})[_0xe20d('0x13')](function(){logger[_0xe20d('0x27')](util[_0xe20d('0xd')](_0xe20d('0x28'),EXTRACTED_REPORT_ID,_0xe20d('0x29')));return analyticExtractedReport(_0xe20d('0x2a'),_0x5ce547?util[_0xe20d('0xd')](_0xe20d('0x24'),_0x5e7237,_0x5ce547?'zip':_0xe20d('0x23')):null);});})['catch'](function(_0x54a361){logger[_0xe20d('0x27')](util['format'](_0xe20d('0x2b'),EXTRACTED_REPORT_ID,_0xe20d('0x29')),util['inspect'](_0x54a361,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0xdac3=['dirname','basename','.xlsx','split','join','each','%s%d.%s','xlsx','writeFileSync','binary','zip','%s.%s','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info','format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','QueryTypes','Empty','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT'];(function(_0x110558,_0x33bc2d){var _0x2816c8=function(_0x3fee31){while(--_0x3fee31){_0x110558['push'](_0x110558['shift']());}};_0x2816c8(++_0x33bc2d);}(_0xdac3,0x19c));var _0x3dac=function(_0x45b5bd,_0x1b2655){_0x45b5bd=_0x45b5bd-0x0;var _0x1af8bb=_0xdac3[_0x45b5bd];return _0x1af8bb;};'use strict';var util=require(_0x3dac('0x0'));var path=require(_0x3dac('0x1'));var _=require(_0x3dac('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x3dac('0x3'));var zipdir=require(_0x3dac('0x4'));var rimraf=require(_0x3dac('0x5'));var db=require(_0x3dac('0x6'))['db'];var dbH=require(_0x3dac('0x6'))[_0x3dac('0x7')];var logger=require('../../config/logger')(_0x3dac('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x3dac('0x9')][0x2]);var QUERY=process[_0x3dac('0x9')][0x3];var PATH=process[_0x3dac('0x9')][0x4];function analyticExtractedReport(_0x3b0591,_0x17d5ca){var _0x2bc422={'status':_0x3b0591};var _0x31f4df={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17d5ca){_0x2bc422[_0x3dac('0xa')]=_0x17d5ca;}return db[_0x3dac('0xb')]['update'](_0x2bc422,_0x31f4df);}function main(){var _0x2ee37d=0x1388;var _0x4cdf50;logger[_0x3dac('0xc')](util[_0x3dac('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x3dac('0xe')));return db[_0x3dac('0xf')][_0x3dac('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x3dac('0x11')]})[_0x3dac('0x12')](function(_0x54ff42){if(_0x54ff42){_0x4cdf50=_0x54ff42;_0x2ee37d=_0x4cdf50['splitSizeXlsx']||0x1388;}})[_0x3dac('0x12')](function(){return dbH[_0x3dac('0x13')][_0x3dac('0x14')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x3dac('0x13')][_0x3dac('0x15')]['SELECT']});})[_0x3dac('0x12')](function(_0x1562b4){if(!_0x1562b4[0x0]['num']){return analyticExtractedReport(_0x3dac('0x16'));}var _0x583a62=[];var _0x2093ac=0x0;var _0x1c4622=!![];if(_0x4cdf50['split']){if(_0x1562b4&&_0x1562b4[_0x3dac('0x17')]){var _0x2b1efc=_0x1562b4[0x0][_0x3dac('0x18')]%(_0x2093ac+_0x2ee37d);for(;_0x1c4622;_0x2093ac+=_0x2ee37d,_0x2b1efc=_0x1562b4[0x0]['num']%(_0x2093ac+_0x2ee37d)){if(_0x2b1efc==0x0||_0x2b1efc==_0x1562b4[0x0]['num']){_0x1c4622=![];}_0x583a62[_0x3dac('0x19')](dbH[_0x3dac('0x13')]['query'](util[_0x3dac('0xd')](_0x3dac('0x1a'),QUERY,_0x2ee37d,_0x2093ac),{'type':dbH[_0x3dac('0x13')]['QueryTypes'][_0x3dac('0x1b')]}));}}}else{_0x583a62['push'](dbH[_0x3dac('0x13')]['query'](QUERY,{'type':dbH[_0x3dac('0x13')][_0x3dac('0x15')][_0x3dac('0x1b')]}));}var _0x3cb50e=path[_0x3dac('0x1c')](PATH);var _0x38e0f0=path[_0x3dac('0x1d')](PATH,_0x3dac('0x1e'));var _0x733c8c=_0x4cdf50[_0x3dac('0x1f')]&&_0x583a62[_0x3dac('0x17')]>0x1;var _0x4231ef=[];if(!fs['existsSync'](path[_0x3dac('0x20')](_0x3cb50e,_0x38e0f0))&&_0x733c8c){fs['mkdirSync'](path[_0x3dac('0x20')](_0x3cb50e,_0x38e0f0));}return BPromise[_0x3dac('0x21')](_0x583a62,function(_0x982f8){_0x4231ef[_0x3dac('0x19')](_0x982f8);})['then'](function(){for(var _0x535afb=0x0;_0x535afb<_0x4231ef['length'];_0x535afb+=0x1){var _0x2c0299;var _0x93ff08=_0x4231ef[_0x535afb];if(_0x733c8c){_0x2c0299=path[_0x3dac('0x20')](_0x3cb50e,_0x38e0f0,util[_0x3dac('0xd')](_0x3dac('0x22'),_0x38e0f0,_0x535afb,_0x3dac('0x23')));}else{_0x2c0299=path[_0x3dac('0x20')](_0x3cb50e,util[_0x3dac('0xd')]('%s.%s',_0x38e0f0,_0x3dac('0x23')));}fs[_0x3dac('0x24')](_0x2c0299,json2xls(_0x93ff08),_0x3dac('0x25'));}})[_0x3dac('0x12')](function(){if(_0x733c8c){zipdir(path[_0x3dac('0x20')](_0x3cb50e,_0x38e0f0),{'saveTo':path[_0x3dac('0x20')](_0x3cb50e,util['format']('%s.%s',_0x38e0f0,_0x3dac('0x26')))},function(_0x424568,_0x2794da){});rimraf(path[_0x3dac('0x20')](_0x3cb50e,_0x38e0f0),function(){});}})['then'](function(){logger[_0x3dac('0xc')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x3dac('0xe')));return analyticExtractedReport('Completed',_0x733c8c?util[_0x3dac('0xd')](_0x3dac('0x27'),_0x38e0f0,_0x733c8c?_0x3dac('0x26'):'xlsx'):null);});})[_0x3dac('0x28')](function(_0x358849){logger[_0x3dac('0xc')](util[_0x3dac('0xd')](_0x3dac('0x29'),EXTRACTED_REPORT_ID,_0x3dac('0xe')),util[_0x3dac('0x2a')](_0x358849,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x3dac('0x2b'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 3402f2c..af95f5e 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 _0x5cbc=['groupBy','exten','playback','hasOwnProperty','priority','extensions','extension','push','type','Set','CDR(type)=%s','context','outbound','CDR(destination)=','${EXTEN:','cutdigits','VoiceExtensionId','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','*,*,*,*','interval','filter','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','bulkCreate','sortBy','catch','error','rewrite','lodash','models','findAll','then','IntervalId','VoiceExtension','uniq','map','CAST(priority\x20AS\x20UNSIGNED)'];(function(_0x50e970,_0x38e2e9){var _0x36bbea=function(_0x5de406){while(--_0x5de406){_0x50e970['push'](_0x50e970['shift']());}};_0x36bbea(++_0x38e2e9);}(_0x5cbc,0xfb));var _0xc5cb=function(_0x55cd8c,_0x302b88){_0x55cd8c=_0x55cd8c-0x0;var _0x1ba719=_0x5cbc[_0x55cd8c];return _0x1ba719;};'use strict';var _=require(_0xc5cb('0x0'));var util=require('util');function rewrite(_0x29b739,_0x1ec545){var _0x38586e=this;return _0x29b739[_0xc5cb('0x1')]['Interval'][_0xc5cb('0x2')]({'raw':!![]})[_0xc5cb('0x3')](function(_0x1f4383){_0x38586e['intervals']=_0x1f4383;return _0x29b739[_0xc5cb('0x1')]['VoiceExtension'][_0xc5cb('0x2')]({'where':{'IntervalId':_0x1ec545[_0xc5cb('0x4')]},'raw':!![]});})['then'](function(_0x1804f6){return _0x29b739['models'][_0xc5cb('0x5')][_0xc5cb('0x2')]({'where':{'exten':{'$in':_[_0xc5cb('0x6')](_[_0xc5cb('0x7')](_0x1804f6,'exten'))}},'order':[{'raw':_0xc5cb('0x8')}],'raw':!![]});})['then'](function(_0x46d8d3){var _0x5d8973=_['filter'](_0x46d8d3,{'priority':'1'});var _0x295b75=_['filter'](_0x46d8d3,{'isApp':0x1});var _0x3b7be4=_[_0xc5cb('0x9')](_0x295b75,_0xc5cb('0xa'));var _0x57de51=['queue',_0xc5cb('0xb')];var _0x20d71f=[];var _0x5cc765=[];for(var _0x42a792 in _0x3b7be4){if(_0x3b7be4[_0xc5cb('0xc')](_0x42a792)){_0x38586e[_0xc5cb('0xd')]=0x2;_0x38586e[_0xc5cb('0xe')]=[];_0x38586e[_0xc5cb('0xf')]=_['find'](_0x5d8973,{'exten':_0x3b7be4[_0x42a792][0x0]['exten']});_0x38586e[_0xc5cb('0xe')][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':util['format'](_0xc5cb('0x13'),_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')]),'context':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x14')],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x38586e['priority']++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0]['VoiceExtensionId']});if(_0x3b7be4[_0x42a792][0x0]['type']===_0xc5cb('0x15')){if(_0x38586e[_0xc5cb('0xf')]){_0x38586e['extensions'][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':_0xc5cb('0x16')+(_0x38586e[_0xc5cb('0xf')]['cutdigits']?_0xc5cb('0x17')+_0x38586e[_0xc5cb('0xf')][_0xc5cb('0x18')]+'}':'${EXTEN}'),'context':_0x3b7be4[_0x42a792][0x0]['context'],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x38586e['priority']++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});}_0x38586e[_0xc5cb('0xe')]['push']({'type':_0x3b7be4[_0x42a792][0x0]['type'],'app':_0xc5cb('0x12'),'appdata':'CDR(routeid)='+_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')],'context':_0x3b7be4[_0x42a792][0x0]['context'],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x38586e[_0xc5cb('0xd')]++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});var _0x567057=_0x38586e['priority']++;_0x38586e[_0xc5cb('0xe')]['push']({'type':_0x3b7be4[_0x42a792][0x0]['type'],'app':_0xc5cb('0x1a'),'appdata':_0xc5cb('0x1b')+(_0x567057+0x2)+_0xc5cb('0x1c')+(_0x567057+0x1)+')','context':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x14')],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x567057,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});if(_0x38586e[_0xc5cb('0xf')]){_0x38586e['extensions']['push']({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':'Set','appdata':_0x38586e[_0xc5cb('0xf')][_0xc5cb('0x18')]?_0xc5cb('0x1d')+_0x38586e[_0xc5cb('0xf')][_0xc5cb('0x18')]+'}':_0xc5cb('0x1e'),'context':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x14')],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x38586e[_0xc5cb('0xd')]++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0]['VoiceExtensionId']});}_0x38586e[_0xc5cb('0xe')][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':'Set','appdata':'outboundrouteid='+_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')],'context':_0x3b7be4[_0x42a792][0x0]['context'],'exten':_0x3b7be4[_0x42a792][0x0]['exten'],'priority':_0x38586e[_0xc5cb('0xd')]++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0]['VoiceExtensionId']});if(_0x38586e[_0xc5cb('0xf')]&&_0x38586e[_0xc5cb('0xf')]['hasOwnProperty']('recordingFormat')&&_0x38586e['extension'][_0xc5cb('0x1f')]!==_0xc5cb('0x20')){_0x38586e[_0xc5cb('0xe')][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x14')],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x38586e[_0xc5cb('0xd')]++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0]['VoiceExtensionId']});_0x38586e[_0xc5cb('0xe')][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':_0xc5cb('0x21')+_0x38586e[_0xc5cb('0xf')][_0xc5cb('0x1f')]||_0xc5cb('0x22'),'context':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x14')],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x38586e[_0xc5cb('0xd')]++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});}}_0x38586e['extensions'][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':_0xc5cb('0x23'),'context':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x14')],'exten':_0x3b7be4[_0x42a792][0x0]['exten'],'priority':_0x38586e[_0xc5cb('0xd')]++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});_0x38586e[_0xc5cb('0xe')][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3b7be4[_0x42a792][0x0]['context'],'exten':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0xa')],'priority':_0x38586e[_0xc5cb('0xd')]++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});_0x38586e[_0xc5cb('0xe')][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':_0xc5cb('0x24'),'context':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x14')],'exten':_0x3b7be4[_0x42a792][0x0]['exten'],'priority':_0x38586e['priority']++,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});for(var _0x5c9182=0x0,_0x33fdc3=0x0;_0x5c9182<_0x3b7be4[_0x42a792][_0xc5cb('0x25')];_0x5c9182+=0x1,_0x33fdc3=0x0){var _0x57432c=_0x3b7be4[_0x42a792][_0x5c9182];if(_0x57432c[_0xc5cb('0x11')]){_0x57432c[_0xc5cb('0x11')]=_0x57432c[_0xc5cb('0x11')][_0xc5cb('0x26')]();}var _0x3cb3cb=[];var _0x3ec035=[];delete _0x57432c['id'];delete _0x57432c[_0xc5cb('0x27')];delete _0x57432c['updatedAt'];var _0x3783bd=_0x57432c['interval']!==_0xc5cb('0x28')?[_0x57432c[_0xc5cb('0x29')]]:_0x57432c[_0xc5cb('0x4')]?_[_0xc5cb('0x7')](_[_0xc5cb('0x2a')](_0x38586e['intervals'],{'IntervalId':_0x57432c[_0xc5cb('0x4')]}),_0xc5cb('0x29')):[];if(_0x57432c[_0xc5cb('0xc')]('tag')){if(_0x57432c[_0xc5cb('0x2b')]&&_0x57432c['tag']!=='--'){_0x3cb3cb[_0xc5cb('0x10')]({'type':_0x57432c[_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':_0xc5cb('0x2c')+_0x57432c[_0xc5cb('0x2b')],'context':_0x57432c['context'],'exten':_0x57432c[_0xc5cb('0xa')],'priority':_0x3783bd[_0xc5cb('0x25')]+_0x38586e[_0xc5cb('0xd')]+_0x33fdc3++,'VoiceExtensionId':_0x57432c[_0xc5cb('0x19')]});}}if(_0x57432c[_0xc5cb('0x11')]===_0xc5cb('0x15')&&_0x57432c['hasOwnProperty'](_0xc5cb('0x2d'))){if(_0x57432c[_0xc5cb('0x2d')]){_0x3cb3cb[_0xc5cb('0x10')]({'type':_0x57432c[_0xc5cb('0x11')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x57432c[_0xc5cb('0x2d')]+')','context':_0x57432c[_0xc5cb('0x14')],'exten':_0x57432c[_0xc5cb('0xa')],'priority':_0x3783bd[_0xc5cb('0x25')]+_0x38586e['priority']+_0x33fdc3++,'VoiceExtensionId':_0x57432c[_0xc5cb('0x19')]});}else{_0x3cb3cb[_0xc5cb('0x10')]({'type':_0x57432c[_0xc5cb('0x11')],'app':_0xc5cb('0x1a'),'appdata':_0xc5cb('0x2e'),'context':_0x57432c[_0xc5cb('0x14')],'exten':_0x57432c[_0xc5cb('0xa')],'priority':_0x3783bd[_0xc5cb('0x25')]+_0x38586e['priority']+_0x33fdc3++,'VoiceExtensionId':_0x57432c['VoiceExtensionId']});}}if(_0x57432c[_0xc5cb('0xc')](_0xc5cb('0x2f'))){if(_0x57de51['indexOf'](_0x57432c[_0xc5cb('0x30')][_0xc5cb('0x26')]())>=0x0&&_0x57432c[_0xc5cb('0x31')]!==_0xc5cb('0x32')){if(_0x57432c[_0xc5cb('0x2f')]){_0x3cb3cb[_0xc5cb('0x10')]({'type':_0x57432c[_0xc5cb('0x11')],'app':_0xc5cb('0x1a'),'appdata':_0xc5cb('0x33'),'context':_0x57432c[_0xc5cb('0x14')],'exten':_0x57432c[_0xc5cb('0xa')],'priority':_0x3783bd[_0xc5cb('0x25')]+_0x38586e['priority']+_0x33fdc3++,'VoiceExtensionId':_0x57432c['VoiceExtensionId']});_0x3cb3cb[_0xc5cb('0x10')]({'type':_0x57432c[_0xc5cb('0x11')],'app':_0xc5cb('0x12'),'appdata':_0xc5cb('0x34'),'context':_0x57432c[_0xc5cb('0x14')],'exten':_0x57432c[_0xc5cb('0xa')],'priority':_0x3783bd[_0xc5cb('0x25')]+_0x38586e['priority']+_0x33fdc3++,'VoiceExtensionId':_0x57432c['VoiceExtensionId']});}else{_0x3cb3cb[_0xc5cb('0x10')]({'type':_0x57432c[_0xc5cb('0x11')],'app':_0xc5cb('0x1a'),'appdata':_0xc5cb('0x35'),'context':_0x57432c[_0xc5cb('0x14')],'exten':_0x57432c['exten'],'priority':_0x3783bd[_0xc5cb('0x25')]+_0x38586e['priority']+_0x33fdc3++,'VoiceExtensionId':_0x57432c[_0xc5cb('0x19')]});_0x3cb3cb[_0xc5cb('0x10')]({'type':_0x57432c[_0xc5cb('0x11')],'app':'Set','appdata':_0xc5cb('0x36'),'context':_0x57432c['context'],'exten':_0x57432c[_0xc5cb('0xa')],'priority':_0x3783bd[_0xc5cb('0x25')]+_0x38586e['priority']+_0x33fdc3++,'VoiceExtensionId':_0x57432c['VoiceExtensionId']});}}}for(var _0x5ba1d3=0x0;_0x5ba1d3<_0x3783bd[_0xc5cb('0x25')];_0x5ba1d3+=0x1){var _0x3fcf4f=_0x38586e[_0xc5cb('0xd')]+_0x3783bd[_0xc5cb('0x25')];var _0x157d54=_0x5ba1d3===_0x3783bd['length']-0x1?_0x38586e[_0xc5cb('0xd')]+_0x3cb3cb[_0xc5cb('0x25')]+_0x3ec035[_0xc5cb('0x25')]+0x2:_0x38586e[_0xc5cb('0xd')]+_0x5ba1d3+0x1;_0x3cb3cb[_0xc5cb('0x37')](_0x5ba1d3,0x0,{'type':_0x57432c[_0xc5cb('0x11')],'app':_0xc5cb('0x38'),'appdata':_0x3783bd[_0x5ba1d3]+'?'+_0x57432c[_0xc5cb('0x14')]+_0xc5cb('0x39')+_0x3fcf4f+':'+_0x57432c['context']+_0xc5cb('0x39')+_0x157d54,'exten':_0x57432c['exten'],'context':_0x57432c[_0xc5cb('0x14')],'priority':_0x38586e[_0xc5cb('0xd')]+_0x5ba1d3,'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});}_0x57432c[_0xc5cb('0xd')]=_0x3cb3cb[_0xc5cb('0x25')]?_[_0xc5cb('0x3a')](_0x3cb3cb)['priority']+0x1:_0x38586e[_0xc5cb('0xd')];_0x38586e[_0xc5cb('0xd')]=(_0x3ec035[_0xc5cb('0x25')]?_['last'](_0x3ec035)[_0xc5cb('0xd')]:_0x57432c[_0xc5cb('0xd')])+0x1;_0x38586e[_0xc5cb('0xe')]=_['concat'](_0x38586e[_0xc5cb('0xe')],_0x3cb3cb,[_0x57432c],_0x3ec035);}_0x38586e[_0xc5cb('0xe')][_0xc5cb('0x10')]({'type':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x11')],'app':_0xc5cb('0x3b'),'exten':_0x3b7be4[_0x42a792][0x0]['exten'],'context':_0x3b7be4[_0x42a792][0x0]['context'],'priority':_0x38586e['priority'],'VoiceExtensionId':_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]});_0x20d71f[_0xc5cb('0x10')](_0x3b7be4[_0x42a792][0x0][_0xc5cb('0x19')]);_0x5cc765=_['concat'](_0x5cc765,_0x38586e['extensions']);}}return _0x29b739['transaction'](function(_0x5970c0){return _0x29b739[_0xc5cb('0x1')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x20d71f}},'transaction':_0x5970c0})[_0xc5cb('0x3')](function(_0x21b4a4){return _0x29b739[_0xc5cb('0x1')][_0xc5cb('0x5')][_0xc5cb('0x3c')](_[_0xc5cb('0x3d')](_0x5cc765,_0xc5cb('0xd')),{'transaction':_0x5970c0});});});})[_0xc5cb('0x3e')](function(_0x31fa82){console[_0xc5cb('0x3f')](_0x31fa82);});}exports[_0xc5cb('0x40')]=rewrite; \ No newline at end of file +var _0x0aa8=['ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','map','intervals','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','last','concat','Hangup','bulkCreate','sortBy','catch','rewrite','lodash','util','models','Interval','VoiceExtension','findAll','then','uniq','filter','groupBy','exten','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','format','context','VoiceExtensionId','outbound','Set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)='];(function(_0x272cb4,_0x2f91d5){var _0x57f431=function(_0x462325){while(--_0x462325){_0x272cb4['push'](_0x272cb4['shift']());}};_0x57f431(++_0x2f91d5);}(_0x0aa8,0xae));var _0x80aa=function(_0x2e5f9c,_0x134a52){_0x2e5f9c=_0x2e5f9c-0x0;var _0x538b44=_0x0aa8[_0x2e5f9c];return _0x538b44;};'use strict';var _=require(_0x80aa('0x0'));var util=require(_0x80aa('0x1'));function rewrite(_0x2a469d,_0x7c0106){var _0x489162=this;return _0x2a469d[_0x80aa('0x2')][_0x80aa('0x3')]['findAll']({'raw':!![]})['then'](function(_0x464864){_0x489162['intervals']=_0x464864;return _0x2a469d[_0x80aa('0x2')][_0x80aa('0x4')][_0x80aa('0x5')]({'where':{'IntervalId':_0x7c0106['IntervalId']},'raw':!![]});})[_0x80aa('0x6')](function(_0x5b2f56){return _0x2a469d['models'][_0x80aa('0x4')][_0x80aa('0x5')]({'where':{'exten':{'$in':_[_0x80aa('0x7')](_['map'](_0x5b2f56,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x80aa('0x6')](function(_0x5b76b9){var _0x17e3cf=_[_0x80aa('0x8')](_0x5b76b9,{'priority':'1'});var _0x36d5c6=_[_0x80aa('0x8')](_0x5b76b9,{'isApp':0x1});var _0x16ad46=_[_0x80aa('0x9')](_0x36d5c6,_0x80aa('0xa'));var _0xdc2918=[_0x80aa('0xb'),_0x80aa('0xc')];var _0x121dea=[];var _0x2d2c4e=[];for(var _0x5f2709 in _0x16ad46){if(_0x16ad46[_0x80aa('0xd')](_0x5f2709)){_0x489162[_0x80aa('0xe')]=0x2;_0x489162[_0x80aa('0xf')]=[];_0x489162[_0x80aa('0x10')]=_[_0x80aa('0x11')](_0x17e3cf,{'exten':_0x16ad46[_0x5f2709][0x0][_0x80aa('0xa')]});_0x489162[_0x80aa('0xf')][_0x80aa('0x12')]({'type':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x13')],'app':'Set','appdata':util[_0x80aa('0x14')]('CDR(type)=%s',_0x16ad46[_0x5f2709][0x0][_0x80aa('0x13')]),'context':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x15')],'exten':_0x16ad46[_0x5f2709][0x0]['exten'],'priority':_0x489162[_0x80aa('0xe')]++,'VoiceExtensionId':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x16')]});if(_0x16ad46[_0x5f2709][0x0][_0x80aa('0x13')]===_0x80aa('0x17')){if(_0x489162[_0x80aa('0x10')]){_0x489162['extensions']['push']({'type':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x13')],'app':_0x80aa('0x18'),'appdata':_0x80aa('0x19')+(_0x489162[_0x80aa('0x10')][_0x80aa('0x1a')]?_0x80aa('0x1b')+_0x489162[_0x80aa('0x10')][_0x80aa('0x1a')]+'}':_0x80aa('0x1c')),'context':_0x16ad46[_0x5f2709][0x0]['context'],'exten':_0x16ad46[_0x5f2709][0x0][_0x80aa('0xa')],'priority':_0x489162[_0x80aa('0xe')]++,'VoiceExtensionId':_0x16ad46[_0x5f2709][0x0]['VoiceExtensionId']});}_0x489162[_0x80aa('0xf')]['push']({'type':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x13')],'app':_0x80aa('0x18'),'appdata':_0x80aa('0x1d')+_0x16ad46[_0x5f2709][0x0]['VoiceExtensionId'],'context':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x15')],'exten':_0x16ad46[_0x5f2709][0x0][_0x80aa('0xa')],'priority':_0x489162[_0x80aa('0xe')]++,'VoiceExtensionId':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x16')]});var _0x137fe3=_0x489162[_0x80aa('0xe')]++;_0x489162['extensions'][_0x80aa('0x12')]({'type':_0x16ad46[_0x5f2709][0x0]['type'],'app':_0x80aa('0x1e'),'appdata':_0x80aa('0x1f')+(_0x137fe3+0x2)+_0x80aa('0x20')+(_0x137fe3+0x1)+')','context':_0x16ad46[_0x5f2709][0x0]['context'],'exten':_0x16ad46[_0x5f2709][0x0][_0x80aa('0xa')],'priority':_0x137fe3,'VoiceExtensionId':_0x16ad46[_0x5f2709][0x0]['VoiceExtensionId']});if(_0x489162[_0x80aa('0x10')]){_0x489162[_0x80aa('0xf')][_0x80aa('0x12')]({'type':_0x16ad46[_0x5f2709][0x0]['type'],'app':'Set','appdata':_0x489162[_0x80aa('0x10')][_0x80aa('0x1a')]?_0x80aa('0x21')+_0x489162[_0x80aa('0x10')][_0x80aa('0x1a')]+'}':_0x80aa('0x22'),'context':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x15')],'exten':_0x16ad46[_0x5f2709][0x0][_0x80aa('0xa')],'priority':_0x489162['priority']++,'VoiceExtensionId':_0x16ad46[_0x5f2709][0x0]['VoiceExtensionId']});}_0x489162['extensions'][_0x80aa('0x12')]({'type':_0x16ad46[_0x5f2709][0x0]['type'],'app':_0x80aa('0x18'),'appdata':_0x80aa('0x23')+_0x16ad46[_0x5f2709][0x0][_0x80aa('0x16')],'context':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x15')],'exten':_0x16ad46[_0x5f2709][0x0][_0x80aa('0xa')],'priority':_0x489162[_0x80aa('0xe')]++,'VoiceExtensionId':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x16')]});if(_0x489162[_0x80aa('0x10')]&&_0x489162[_0x80aa('0x10')][_0x80aa('0xd')](_0x80aa('0x24'))&&_0x489162['extension'][_0x80aa('0x24')]!==_0x80aa('0x25')){_0x489162[_0x80aa('0xf')][_0x80aa('0x12')]({'type':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x13')],'app':_0x80aa('0x18'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x15')],'exten':_0x16ad46[_0x5f2709][0x0][_0x80aa('0xa')],'priority':_0x489162[_0x80aa('0xe')]++,'VoiceExtensionId':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x16')]});_0x489162['extensions']['push']({'type':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x13')],'app':_0x80aa('0x18'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x489162[_0x80aa('0x10')][_0x80aa('0x24')]||_0x80aa('0x26'),'context':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x15')],'exten':_0x16ad46[_0x5f2709][0x0][_0x80aa('0xa')],'priority':_0x489162[_0x80aa('0xe')]++,'VoiceExtensionId':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x16')]});}}_0x489162['extensions'][_0x80aa('0x12')]({'type':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x13')],'app':_0x80aa('0x18'),'appdata':_0x80aa('0x27'),'context':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x15')],'exten':_0x16ad46[_0x5f2709][0x0]['exten'],'priority':_0x489162[_0x80aa('0xe')]++,'VoiceExtensionId':_0x16ad46[_0x5f2709][0x0]['VoiceExtensionId']});_0x489162[_0x80aa('0xf')]['push']({'type':_0x16ad46[_0x5f2709][0x0]['type'],'app':_0x80aa('0x18'),'appdata':_0x80aa('0x28'),'context':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x15')],'exten':_0x16ad46[_0x5f2709][0x0]['exten'],'priority':_0x489162['priority']++,'VoiceExtensionId':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x16')]});_0x489162['extensions']['push']({'type':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x13')],'app':_0x80aa('0x18'),'appdata':_0x80aa('0x29'),'context':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x15')],'exten':_0x16ad46[_0x5f2709][0x0]['exten'],'priority':_0x489162[_0x80aa('0xe')]++,'VoiceExtensionId':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x16')]});for(var _0x3a7194=0x0,_0x1459ca=0x0;_0x3a7194<_0x16ad46[_0x5f2709][_0x80aa('0x2a')];_0x3a7194+=0x1,_0x1459ca=0x0){var _0x458ef6=_0x16ad46[_0x5f2709][_0x3a7194];if(_0x458ef6[_0x80aa('0x13')]){_0x458ef6['type']=_0x458ef6[_0x80aa('0x13')][_0x80aa('0x2b')]();}var _0x413290=[];var _0x327cd4=[];delete _0x458ef6['id'];delete _0x458ef6[_0x80aa('0x2c')];delete _0x458ef6[_0x80aa('0x2d')];var _0x56bb85=_0x458ef6[_0x80aa('0x2e')]!==_0x80aa('0x2f')?[_0x458ef6[_0x80aa('0x2e')]]:_0x458ef6[_0x80aa('0x30')]?_[_0x80aa('0x31')](_['filter'](_0x489162[_0x80aa('0x32')],{'IntervalId':_0x458ef6[_0x80aa('0x30')]}),'interval'):[];if(_0x458ef6[_0x80aa('0xd')](_0x80aa('0x33'))){if(_0x458ef6[_0x80aa('0x33')]&&_0x458ef6[_0x80aa('0x33')]!=='--'){_0x413290[_0x80aa('0x12')]({'type':_0x458ef6[_0x80aa('0x13')],'app':'Set','appdata':'CDR(tag)='+_0x458ef6[_0x80aa('0x33')],'context':_0x458ef6['context'],'exten':_0x458ef6[_0x80aa('0xa')],'priority':_0x56bb85[_0x80aa('0x2a')]+_0x489162[_0x80aa('0xe')]+_0x1459ca++,'VoiceExtensionId':_0x458ef6[_0x80aa('0x16')]});}}if(_0x458ef6[_0x80aa('0x13')]===_0x80aa('0x17')&&_0x458ef6[_0x80aa('0xd')](_0x80aa('0x34'))){if(_0x458ef6[_0x80aa('0x34')]){_0x413290[_0x80aa('0x12')]({'type':_0x458ef6[_0x80aa('0x13')],'app':_0x80aa('0x1e'),'appdata':_0x80aa('0x35')+_0x458ef6[_0x80aa('0x34')]+')','context':_0x458ef6[_0x80aa('0x15')],'exten':_0x458ef6[_0x80aa('0xa')],'priority':_0x56bb85[_0x80aa('0x2a')]+_0x489162[_0x80aa('0xe')]+_0x1459ca++,'VoiceExtensionId':_0x458ef6[_0x80aa('0x16')]});}else{_0x413290['push']({'type':_0x458ef6[_0x80aa('0x13')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x458ef6[_0x80aa('0x15')],'exten':_0x458ef6['exten'],'priority':_0x56bb85[_0x80aa('0x2a')]+_0x489162[_0x80aa('0xe')]+_0x1459ca++,'VoiceExtensionId':_0x458ef6['VoiceExtensionId']});}}if(_0x458ef6[_0x80aa('0xd')]('answer')){if(_0xdc2918[_0x80aa('0x36')](_0x458ef6[_0x80aa('0x37')][_0x80aa('0x2b')]())>=0x0&&_0x458ef6['appType']!==_0x80aa('0x38')){if(_0x458ef6['answer']){_0x413290['push']({'type':_0x458ef6[_0x80aa('0x13')],'app':_0x80aa('0x1e'),'appdata':_0x80aa('0x39'),'context':_0x458ef6[_0x80aa('0x15')],'exten':_0x458ef6[_0x80aa('0xa')],'priority':_0x56bb85[_0x80aa('0x2a')]+_0x489162['priority']+_0x1459ca++,'VoiceExtensionId':_0x458ef6[_0x80aa('0x16')]});_0x413290[_0x80aa('0x12')]({'type':_0x458ef6[_0x80aa('0x13')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x458ef6[_0x80aa('0x15')],'exten':_0x458ef6[_0x80aa('0xa')],'priority':_0x56bb85[_0x80aa('0x2a')]+_0x489162[_0x80aa('0xe')]+_0x1459ca++,'VoiceExtensionId':_0x458ef6[_0x80aa('0x16')]});}else{_0x413290[_0x80aa('0x12')]({'type':_0x458ef6[_0x80aa('0x13')],'app':'ExecIf','appdata':_0x80aa('0x3a'),'context':_0x458ef6[_0x80aa('0x15')],'exten':_0x458ef6[_0x80aa('0xa')],'priority':_0x56bb85['length']+_0x489162['priority']+_0x1459ca++,'VoiceExtensionId':_0x458ef6[_0x80aa('0x16')]});_0x413290[_0x80aa('0x12')]({'type':_0x458ef6['type'],'app':_0x80aa('0x18'),'appdata':_0x80aa('0x3b'),'context':_0x458ef6[_0x80aa('0x15')],'exten':_0x458ef6['exten'],'priority':_0x56bb85['length']+_0x489162['priority']+_0x1459ca++,'VoiceExtensionId':_0x458ef6['VoiceExtensionId']});}}}for(var _0xd0bbd8=0x0;_0xd0bbd8<_0x56bb85['length'];_0xd0bbd8+=0x1){var _0x330f07=_0x489162['priority']+_0x56bb85[_0x80aa('0x2a')];var _0x2a3d63=_0xd0bbd8===_0x56bb85[_0x80aa('0x2a')]-0x1?_0x489162[_0x80aa('0xe')]+_0x413290[_0x80aa('0x2a')]+_0x327cd4[_0x80aa('0x2a')]+0x2:_0x489162[_0x80aa('0xe')]+_0xd0bbd8+0x1;_0x413290[_0x80aa('0x3c')](_0xd0bbd8,0x0,{'type':_0x458ef6[_0x80aa('0x13')],'app':'GotoIfTime','appdata':_0x56bb85[_0xd0bbd8]+'?'+_0x458ef6[_0x80aa('0x15')]+',${EXTEN},'+_0x330f07+':'+_0x458ef6['context']+',${EXTEN},'+_0x2a3d63,'exten':_0x458ef6[_0x80aa('0xa')],'context':_0x458ef6[_0x80aa('0x15')],'priority':_0x489162[_0x80aa('0xe')]+_0xd0bbd8,'VoiceExtensionId':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x16')]});}_0x458ef6[_0x80aa('0xe')]=_0x413290[_0x80aa('0x2a')]?_['last'](_0x413290)[_0x80aa('0xe')]+0x1:_0x489162['priority'];_0x489162['priority']=(_0x327cd4['length']?_[_0x80aa('0x3d')](_0x327cd4)[_0x80aa('0xe')]:_0x458ef6[_0x80aa('0xe')])+0x1;_0x489162[_0x80aa('0xf')]=_[_0x80aa('0x3e')](_0x489162[_0x80aa('0xf')],_0x413290,[_0x458ef6],_0x327cd4);}_0x489162[_0x80aa('0xf')][_0x80aa('0x12')]({'type':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x13')],'app':_0x80aa('0x3f'),'exten':_0x16ad46[_0x5f2709][0x0][_0x80aa('0xa')],'context':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x15')],'priority':_0x489162[_0x80aa('0xe')],'VoiceExtensionId':_0x16ad46[_0x5f2709][0x0][_0x80aa('0x16')]});_0x121dea['push'](_0x16ad46[_0x5f2709][0x0][_0x80aa('0x16')]);_0x2d2c4e=_['concat'](_0x2d2c4e,_0x489162[_0x80aa('0xf')]);}}return _0x2a469d['transaction'](function(_0xb562ba){return _0x2a469d['models']['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x121dea}},'transaction':_0xb562ba})['then'](function(_0x20b0d8){return _0x2a469d[_0x80aa('0x2')][_0x80aa('0x4')][_0x80aa('0x40')](_[_0x80aa('0x41')](_0x2d2c4e,_0x80aa('0xe')),{'transaction':_0xb562ba});});});})[_0x80aa('0x42')](function(_0x3151bf){console['error'](_0x3151bf);});}exports[_0x80aa('0x43')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 45f8f2a..c72e937 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 _0xcb91=['generalCheckHopper','Error\x20processing\x20rows\x20block:','resolve','emit','contact:csv_','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','zipObject','split','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','email','ListId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','\x20=\x20?','into','fromQuery','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','get','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s'];(function(_0x4b5e12,_0x2efa26){var _0x1ba628=function(_0x497f2f){while(--_0x497f2f){_0x4b5e12['push'](_0x4b5e12['shift']());}};_0x1ba628(++_0x2efa26);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0xcb91[_0x5e6ea3];return _0x4048b5;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x1cb9('0x0'));var fs=require('fs');var squel=require(_0x1cb9('0x1'));var Papa=require(_0x1cb9('0x2'));var Redis=require(_0x1cb9('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('api');config[_0x1cb9('0x6')]=_[_0x1cb9('0x7')](config['redis'],{'host':_0x1cb9('0x8'),'port':0x18eb});var socket=require(_0x1cb9('0x9'))(new Redis(config['redis']));require(_0x1cb9('0xa'))[_0x1cb9('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x1cb9('0xc')][0x2]==='undefined'||process['argv'][0x2]===_0x1cb9('0xd')){throw new Error(_0x1cb9('0xe'));}var FILEPATH=process[_0x1cb9('0xc')][0x2];if(!process[_0x1cb9('0xc')][0x3]||process[_0x1cb9('0xc')][0x3]==='undefined'||process[_0x1cb9('0xc')][0x3]===_0x1cb9('0xd')||!process[_0x1cb9('0xc')][0x4]||process[_0x1cb9('0xc')][0x4]===_0x1cb9('0xf')||process['argv'][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x1cb9('0x10')](process[_0x1cb9('0xc')][0x3][_0x1cb9('0x11')](','),process[_0x1cb9('0xc')][0x4]['split'](','));if(!process[_0x1cb9('0xc')][0x5]||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x1cb9('0xc')][0x6]&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xf')&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x6]:null;var DUPLICATES=process[_0x1cb9('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x1cb9('0xc')][0x7]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x7]:null;if(!process[_0x1cb9('0xc')][0x8]||process[_0x1cb9('0xc')][0x8]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x1cb9('0xc')][0x8];}catch(_0x5dbfae){logger[_0x1cb9('0x12')](_0x5dbfae);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(_0x2265ea,_0x523b26,_0x599275,_0x2e3854){var _0x325637={'message':_0x523b26};_0x325637[_0x2265ea]=!![];if(_0x599275){_0x325637[_0x1cb9('0x13')]=_0x599275;}if(_0x2e3854){_0x325637[_0x1cb9('0x14')]=_0x2e3854;}return _0x325637;}function isEmail(_0x45b8d3){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))*$/[_0x1cb9('0x15')](_0x45b8d3);}function checkRow(_0x59ebea,_0x55b232,_0x6c6f61){return new BPromise(function(_0x557199,_0x10a419){if(_[_0x1cb9('0x16')](_0x59ebea)){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x1cb9('0x17'),null,_0x6c6f61));}if(_0x59ebea[_0x1cb9('0x18')]&&_0x59ebea['errors'][_0x1cb9('0x19')]){var _0x9df250=_['map'](_0x59ebea[_0x1cb9('0x18')],_0x1cb9('0x1a'))[_0x1cb9('0x1b')](';');return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x9df250,null,_0x6c6f61));}var _0x406821={};for(var _0x21d6f5 in FIELDS){if(FIELDS[_0x1cb9('0x1c')](_0x21d6f5)&&FIELDS[_0x21d6f5]){_0x406821[_0x21d6f5]=_0x59ebea[_0x1cb9('0x1d')][0x0][FIELDS[_0x21d6f5]]||_0x59ebea[_0x1cb9('0x1d')][0x0]['\ufeff'+FIELDS[_0x21d6f5]];}}if(!_0x406821[_0x1cb9('0x1e')]){return _0x10a419(handleCheckRowError('error',_0x1cb9('0x1f'),null,_0x6c6f61));}if(!_0x406821['phone']){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'phone\x20not\x20specified!',null,_0x6c6f61));}if(_0x406821[_0x1cb9('0x20')]){var _0x41011c=moment(_0x406821[_0x1cb9('0x20')],_0x1cb9('0x21'));if(!_0x41011c['isValid']()){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x6c6f61));}}if(_0x406821[_0x1cb9('0x22')]){if(!isEmail(_0x406821[_0x1cb9('0x22')])){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'email\x20format\x20is\x20not\x20valid!',null,_0x6c6f61));}}_0x406821[_0x1cb9('0x23')]=LISTID;_0x406821['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){var _0x58f4f5={};for(var _0x2164e3=0x0,_0x42a688=DUPLICATES[_0x1cb9('0x19')];_0x2164e3<_0x42a688;_0x2164e3+=0x1){_0x58f4f5[DUPLICATES[_0x2164e3]]=_0x406821[DUPLICATES[_0x2164e3]];}var _0xae910=_['find'](_0x55b232,_0x58f4f5);if(_0xae910){return _0x10a419(handleCheckRowError(_0x1cb9('0x24'),_0x1cb9('0x25'),_0xae910,_0x6c6f61));}}return db[_0x1cb9('0x26')][_0x1cb9('0x27')](_0x406821,{'raw':!![],'hooks':![],'fields':_[_0x1cb9('0x28')](_0x406821)})[_0x1cb9('0x29')](function(_0xc6d5fd){if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){_0x55b232[_0x1cb9('0x2a')](_[_0x1cb9('0x2b')](_0x406821,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xc6d5fd['id'];return _0x557199();})[_0x1cb9('0x2c')](function(_0x26b950){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x26b950['message']||JSON[_0x1cb9('0x2d')](_0x26b950)),null,_0x6c6f61));});});}function checkHopper(){function _0x30f7e4(){return function(_0x91c937){logger[_0x1cb9('0x12')](_0x1cb9('0x2e'),_0x1cb9('0x2f'),util[_0x1cb9('0x30')](_0x91c937,{'showHidden':![],'depth':null}));};}var _0x3f5637=function(_0x4d3e39,_0x2aa59b){var _0x1482c4=squel[_0x1cb9('0x31')]()['into'](_0x1cb9('0x32'))['fromQuery']([_0x1cb9('0x33'),'scheduledAt',_0x1cb9('0x34'),_0x1cb9('0x23'),_0x2aa59b,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),'phone')['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x4d3e39['id'][_0x1cb9('0x3b')](),_0x2aa59b)['field']('NOW()','createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))['where'](_0x1cb9('0x3e'))['where'](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x1cb9('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone')['from'](_0x1cb9('0x32'))[_0x1cb9('0x40')](_0x2aa59b+_0x1cb9('0x41'),_0x4d3e39['id'][_0x1cb9('0x3b')]())))[_0x1cb9('0x3b')]();return _0x1482c4;};var _0x58832e=function(_0x11d877,_0x5594fc){var _0x4c59e7=squel['insert']()[_0x1cb9('0x42')](_0x1cb9('0x32'))[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x5594fc,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone',_0x1cb9('0x33'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'scheduledAt')[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x11d877['id'][_0x1cb9('0x3b')](),_0x5594fc)['field'](_0x1cb9('0x39'),'createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')]('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x47'))[_0x1cb9('0x3c')](_0x1cb9('0x48'))[_0x1cb9('0x40')](_0x5594fc+_0x1cb9('0x41'),_0x11d877['id'][_0x1cb9('0x3b')]()))[_0x1cb9('0x40')](_0x1cb9('0x49'),squel['select']()[_0x1cb9('0x38')]('phone')[_0x1cb9('0x3c')]('cm_hopper')[_0x1cb9('0x40')](_0x5594fc+'\x20=\x20?',_0x11d877['id']['toString']())))[_0x1cb9('0x3b')]();return _0x4c59e7;};function _0x3b0c2e(_0x303da3,_0x4bce54){var _0x3c157f=squel[_0x1cb9('0x31')]()['into']('cm_hopper')[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x4bce54,_0x1cb9('0x35'),_0x1cb9('0x36')],squel['select']()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),'ListId')[_0x1cb9('0x38')](_0x303da3['id'][_0x1cb9('0x3b')](),_0x4bce54)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))[_0x1cb9('0x40')]('deletedAt\x20IS\x20NULL')[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46')))[_0x1cb9('0x3b')]();return _0x3c157f;}function _0x173db5(_0x3c2f9c,_0x75c734){var _0xc515a6=squel[_0x1cb9('0x31')]()['into']('cm_hopper_black')[_0x1cb9('0x43')](['phone','ContactId','ListId',_0x75c734,'createdAt','updatedAt'],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))['field'](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x3c2f9c['id']['toString'](),_0x75c734)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'updatedAt')['from']('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())['where'](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x1cb9('0x3b')]();return _0xc515a6;}return db['VoiceQueue'][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x4aeeff){var _0xde0d93=[];if(_0x4aeeff){var _0x15fc04;for(var _0x330fc1=0x0,_0x17c361;_0x330fc1<_0x4aeeff['length'];_0x330fc1+=0x1){_0x17c361=_0x4aeeff[_0x330fc1]['get']({'plain':!![]});switch(_0x17c361[_0x1cb9('0x4c')]){case _0x1cb9('0x4f'):_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x17c361,_0x1cb9('0x52')))['then'](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;case'onlyIfOpen':_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')]['query'](_0x3f5637(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0xde0d93['push'](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}}return _0xde0d93;})[_0x1cb9('0x53')]()['then'](function(){return db[_0x1cb9('0x54')][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x128a41){var _0x37bcd9=[];if(_0x128a41){var _0x4cd544;for(var _0x28bac2=0x0,_0x78e9c;_0x28bac2<_0x128a41['length'];_0x28bac2+=0x1){_0x78e9c=_0x128a41[_0x28bac2][_0x1cb9('0x56')]({'plain':!![]});_0x37bcd9['push'](db[_0x1cb9('0x50')]['query'](_0x173db5(_0x78e9c,'VoiceQueueId'))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x37bcd9;})['all']();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x45ca54){var _0x3d25a3=[];if(_0x45ca54){for(var _0x2a157d=0x0,_0x27cc3c;_0x2a157d<_0x45ca54[_0x1cb9('0x19')];_0x2a157d+=0x1){_0x27cc3c=_0x45ca54[_0x2a157d][_0x1cb9('0x56')]({'plain':!![]});switch(_0x27cc3c['dialCheckDuplicateType']){case _0x1cb9('0x4f'):_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));break;case _0x1cb9('0x58'):_0x3d25a3[_0x1cb9('0x2a')](db['sequelize'][_0x1cb9('0x51')](_0x3f5637(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x27cc3c,'CampaignId'))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));}}}return _0x3d25a3;})[_0x1cb9('0x53')]();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x56f23d){var _0x113367=[];if(_0x56f23d){for(var _0x39b0cb=0x0,_0x429371;_0x39b0cb<_0x56f23d['length'];_0x39b0cb+=0x1){_0x429371=_0x56f23d[_0x39b0cb][_0x1cb9('0x56')]({'plain':!![]});_0x113367[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x173db5(_0x429371,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x113367;})['all']();})[_0x1cb9('0x2c')](function(_0x4b15a4){logger[_0x1cb9('0x12')](_0x1cb9('0x59'),_0x1cb9('0x5a'),_0x4b15a4[_0x1cb9('0x1a')]);});}var processPromises=function(_0x4bdbd2){return BPromise[_0x1cb9('0x53')](promises)[_0x1cb9('0x29')](function(_0x5e68a1){})[_0x1cb9('0x2c')](function(_0x416508){logger[_0x1cb9('0x12')](_0x1cb9('0x5b'),JSON[_0x1cb9('0x2d')](_0x416508));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4bdbd2){return _0x4bdbd2['resume']();}});};var endCsv=function(){return BPromise[_0x1cb9('0x5c')]()[_0x1cb9('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0x1cb9('0x29')](function(){socket[_0x1cb9('0x5d')](_0x1cb9('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1cb9('0x5f')](FILEPATH);}catch(_0x1e6402){logger[_0x1cb9('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x1cb9('0x2d')](_0x1e6402));}finally{process[_0x1cb9('0x60')](0x0);}});};process['on'](_0x1cb9('0x61'),function(){logger['info'](_0x1cb9('0x62'));endCsv();});function main(){return BPromise[_0x1cb9('0x5c')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1cb9('0x11')](',');return db[_0x1cb9('0x26')][_0x1cb9('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1cb9('0x29')](function(_0x5cb5e5){var _0x2c0416=fs[_0x1cb9('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x2c0416,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5bd78d,_0x1f2d69){total+=0x1;var _0x3ba0a5=total;promises['push'](checkRow(_0x5bd78d,_0x5cb5e5,_0x3ba0a5)['then'](function(){success+=0x1;})[_0x1cb9('0x2c')](function(_0x3486e5){if(_0x3486e5['error']){errors+=0x1;delete _0x3486e5['error'];}else if(_0x3486e5[_0x1cb9('0x24')]){duplicates+=0x1;delete _0x3486e5['duplicate'];}rows['push'](_0x3486e5);}));if(total%0xc8===0x0){_0x1f2d69['pause']();return processPromises(_0x1f2d69);}},'complete':function(){return processPromises()[_0x1cb9('0x29')](function(){logger['info'](_0x1cb9('0x64'));endCsv();});},'error':function(_0x3c717b,_0x33ec43){logger['info'](_0x1cb9('0x65'),JSON[_0x1cb9('0x2d')](_0x3c717b));endCsv();}});})[_0x1cb9('0x2c')](function(_0x4c54b5){logger[_0x1cb9('0x12')](_0x1cb9('0x66'),JSON[_0x1cb9('0x2d')](_0x4c54b5));});}main(); \ No newline at end of file +var _0xd8b0=['find','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','ListId','toString','NOW()','from','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ListId\x20=\x20?','id\x20IN\x20?','insert','deletedAt\x20IS\x20NULL','str','cm_hopper_black','VoiceQueue','outbound','Lists','get','dialCheckDuplicateType','always','sequelize','VoiceQueueId','onlyIfOpen','query','all','CmList','Campaign','findAll','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','hasOwnProperty','data','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','email','CompanyId','length'];(function(_0x48ff70,_0x401975){var _0x20336f=function(_0x53218d){while(--_0x53218d){_0x48ff70['push'](_0x48ff70['shift']());}};_0x20336f(++_0x401975);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var socket=require(_0x0d8b('0x9'))(new Redis(config['redis']));require(_0x0d8b('0xa'))[_0x0d8b('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x0d8b('0xc')][0x2]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x2]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0xf'));}var FILEPATH=process[_0x0d8b('0xc')][0x2];if(!process[_0x0d8b('0xc')][0x3]||process[_0x0d8b('0xc')][0x3]==='undefined'||process[_0x0d8b('0xc')][0x3]==='null'||!process[_0x0d8b('0xc')][0x4]||process[_0x0d8b('0xc')][0x4]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x4]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x10'));}var FIELDS=_[_0x0d8b('0x11')](process[_0x0d8b('0xc')][0x3][_0x0d8b('0x12')](','),process[_0x0d8b('0xc')][0x4][_0x0d8b('0x12')](','));if(!process[_0x0d8b('0xc')][0x5]||process[_0x0d8b('0xc')][0x5]===_0x0d8b('0xd')||process['argv'][0x5]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x13'));}var LISTID=process[_0x0d8b('0xc')][0x5];var COMPANYID=process[_0x0d8b('0xc')][0x6]&&process[_0x0d8b('0xc')][0x6]!=='undefined'&&process[_0x0d8b('0xc')][0x6]!==_0x0d8b('0xe')?process[_0x0d8b('0xc')][0x6]:null;var DUPLICATES=process[_0x0d8b('0xc')][0x7]&&process[_0x0d8b('0xc')][0x7]!==_0x0d8b('0xd')&&process[_0x0d8b('0xc')][0x7]!==_0x0d8b('0xe')?process['argv'][0x7]:null;if(!process[_0x0d8b('0xc')][0x8]||process[_0x0d8b('0xc')][0x8]===_0x0d8b('0xd')||process[_0x0d8b('0xc')][0x8]===_0x0d8b('0xe')){throw new Error(_0x0d8b('0x14'));}var SOCKET_TIMESTAMP=process[_0x0d8b('0xc')][0x8];}catch(_0x352c17){logger['error'](_0x352c17);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(_0x4f0a1a,_0x33fb87,_0x54a9a7,_0x56c729){var _0x5527d8={'message':_0x33fb87};_0x5527d8[_0x4f0a1a]=!![];if(_0x54a9a7){_0x5527d8[_0x0d8b('0x15')]=_0x54a9a7;}if(_0x56c729){_0x5527d8[_0x0d8b('0x16')]=_0x56c729;}return _0x5527d8;}function isEmail(_0x214778){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))*$/[_0x0d8b('0x17')](_0x214778);}function checkRow(_0x221071,_0x2c64e2,_0x30980c){return new BPromise(function(_0x4562cb,_0x27b695){if(_['isNil'](_0x221071)){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),_0x0d8b('0x19'),null,_0x30980c));}if(_0x221071['errors']&&_0x221071[_0x0d8b('0x1a')]['length']){var _0x3dd149=_[_0x0d8b('0x1b')](_0x221071[_0x0d8b('0x1a')],'message')['join'](';');return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),_0x3dd149,null,_0x30980c));}var _0x3ef745={};for(var _0x4c05ee in FIELDS){if(FIELDS[_0x0d8b('0x1c')](_0x4c05ee)&&FIELDS[_0x4c05ee]){_0x3ef745[_0x4c05ee]=_0x221071['data'][0x0][FIELDS[_0x4c05ee]]||_0x221071[_0x0d8b('0x1d')][0x0]['\ufeff'+FIELDS[_0x4c05ee]];}}if(!_0x3ef745['firstName']){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'firstName\x20not\x20specified!',null,_0x30980c));}if(!_0x3ef745[_0x0d8b('0x1e')]){return _0x27b695(handleCheckRowError('error',_0x0d8b('0x1f'),null,_0x30980c));}if(_0x3ef745['birthDate']){var _0x3c8887=moment(_0x3ef745[_0x0d8b('0x20')],_0x0d8b('0x21'));if(!_0x3c8887['isValid']()){return _0x27b695(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x30980c));}}if(_0x3ef745[_0x0d8b('0x22')]){if(!isEmail(_0x3ef745['email'])){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'email\x20format\x20is\x20not\x20valid!',null,_0x30980c));}}_0x3ef745['ListId']=LISTID;_0x3ef745[_0x0d8b('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0d8b('0x24')]&&_0x2c64e2){var _0x109c14={};for(var _0xdeee5d=0x0,_0x183220=DUPLICATES[_0x0d8b('0x24')];_0xdeee5d<_0x183220;_0xdeee5d+=0x1){_0x109c14[DUPLICATES[_0xdeee5d]]=_0x3ef745[DUPLICATES[_0xdeee5d]];}var _0x4a99d3=_[_0x0d8b('0x25')](_0x2c64e2,_0x109c14);if(_0x4a99d3){return _0x27b695(handleCheckRowError('duplicate',_0x0d8b('0x26'),_0x4a99d3,_0x30980c));}}return db[_0x0d8b('0x27')]['create'](_0x3ef745,{'raw':!![],'hooks':![],'fields':_[_0x0d8b('0x28')](_0x3ef745)})[_0x0d8b('0x29')](function(_0x18a905){if(DUPLICATES&&DUPLICATES['length']&&_0x2c64e2){_0x2c64e2[_0x0d8b('0x2a')](_[_0x0d8b('0x2b')](_0x3ef745,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x18a905['id'];return _0x4562cb();})[_0x0d8b('0x2c')](function(_0x31ceba){return _0x27b695(handleCheckRowError(_0x0d8b('0x18'),'Error\x20while\x20creating\x20contact:\x20'+(_0x31ceba[_0x0d8b('0x2d')]||JSON[_0x0d8b('0x2e')](_0x31ceba)),null,_0x30980c));});});}function checkHopper(){function _0x5ad0fe(){return function(_0x1180ac){logger[_0x0d8b('0x18')](_0x0d8b('0x2f'),_0x0d8b('0x30'),util[_0x0d8b('0x31')](_0x1180ac,{'showHidden':![],'depth':null}));};}var _0x519088=function(_0x497a71,_0x41b4f9){var _0x5c2c04=squel['insert']()[_0x0d8b('0x32')](_0x0d8b('0x33'))[_0x0d8b('0x34')]([_0x0d8b('0x1e'),_0x0d8b('0x35'),_0x0d8b('0x36'),'ListId',_0x41b4f9,_0x0d8b('0x37'),_0x0d8b('0x38')],squel[_0x0d8b('0x39')]()[_0x0d8b('0x3a')](_0x0d8b('0x1e'),_0x0d8b('0x1e'))[_0x0d8b('0x3a')]('NOW()',_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID['toString'](),_0x0d8b('0x3b'))['field'](_0x497a71['id'][_0x0d8b('0x3c')](),_0x41b4f9)[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID['toString']())['where'](_0x0d8b('0x41'))[_0x0d8b('0x40')](_0x0d8b('0x42'),squel['select']()['field'](_0x0d8b('0x1e'))[_0x0d8b('0x3e')](_0x0d8b('0x33'))['where'](_0x41b4f9+_0x0d8b('0x43'),_0x497a71['id'][_0x0d8b('0x3c')]())))['toString']();return _0x5c2c04;};var _0x4d7bb0=function(_0x372740,_0x495870){var _0x1e22e5=squel['insert']()['into'](_0x0d8b('0x33'))[_0x0d8b('0x34')](['phone','scheduledAt','ContactId','ListId',_0x495870,_0x0d8b('0x37'),_0x0d8b('0x38')],squel[_0x0d8b('0x39')]()['field'](_0x0d8b('0x1e'),_0x0d8b('0x1e'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))[_0x0d8b('0x3a')](_0x372740['id'][_0x0d8b('0x3c')](),_0x495870)[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')]('cm_contacts')[_0x0d8b('0x40')]('deletedAt\x20IS\x20NULL')['where'](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel['str'](hopperContacts))[_0x0d8b('0x40')](_0x0d8b('0x41'))[_0x0d8b('0x40')](_0x0d8b('0x42'),squel[_0x0d8b('0x39')]()['field']('calleridnum')['from']('cm_hopper_final')[_0x0d8b('0x40')](_0x495870+_0x0d8b('0x43'),_0x372740['id']['toString']()))['where'](_0x0d8b('0x42'),squel[_0x0d8b('0x39')]()['field']('phone')[_0x0d8b('0x3e')](_0x0d8b('0x33'))[_0x0d8b('0x40')](_0x495870+_0x0d8b('0x43'),_0x372740['id'][_0x0d8b('0x3c')]())))['toString']();return _0x1e22e5;};function _0x2de903(_0x2afe34,_0x5481fc){var _0x580580=squel[_0x0d8b('0x46')]()[_0x0d8b('0x32')]('cm_hopper')['fromQuery']([_0x0d8b('0x1e'),_0x0d8b('0x35'),_0x0d8b('0x36'),_0x0d8b('0x3b'),_0x5481fc,'createdAt',_0x0d8b('0x38')],squel['select']()['field'](_0x0d8b('0x1e'),_0x0d8b('0x1e'))['field']('NOW()',_0x0d8b('0x35'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))[_0x0d8b('0x3a')](_0x2afe34['id'][_0x0d8b('0x3c')](),_0x5481fc)['field'](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),_0x0d8b('0x38'))[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')](_0x0d8b('0x47'))['where'](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel[_0x0d8b('0x48')](hopperContacts))['where'](_0x0d8b('0x41')))[_0x0d8b('0x3c')]();return _0x580580;}function _0x181d49(_0x17a87f,_0x1d6cd4){var _0x59ada2=squel['insert']()[_0x0d8b('0x32')](_0x0d8b('0x49'))[_0x0d8b('0x34')]([_0x0d8b('0x1e'),'ContactId',_0x0d8b('0x3b'),_0x1d6cd4,_0x0d8b('0x37'),_0x0d8b('0x38')],squel['select']()[_0x0d8b('0x3a')]('phone',_0x0d8b('0x1e'))[_0x0d8b('0x3a')]('id',_0x0d8b('0x36'))[_0x0d8b('0x3a')](LISTID[_0x0d8b('0x3c')](),_0x0d8b('0x3b'))['field'](_0x17a87f['id'][_0x0d8b('0x3c')](),_0x1d6cd4)['field'](_0x0d8b('0x3d'),_0x0d8b('0x37'))[_0x0d8b('0x3a')](_0x0d8b('0x3d'),'updatedAt')[_0x0d8b('0x3e')](_0x0d8b('0x3f'))[_0x0d8b('0x40')](_0x0d8b('0x47'))[_0x0d8b('0x40')](_0x0d8b('0x44'),LISTID[_0x0d8b('0x3c')]())[_0x0d8b('0x40')](_0x0d8b('0x45'),squel[_0x0d8b('0x48')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0d8b('0x3c')]();return _0x59ada2;}return db[_0x0d8b('0x4a')]['findAll']({'where':{'type':_0x0d8b('0x4b')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x0d8b('0x4c'),'where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x4f4b4d){var _0x587128=[];if(_0x4f4b4d){var _0x1900e3;for(var _0x1c007b=0x0,_0x70e4b2;_0x1c007b<_0x4f4b4d[_0x0d8b('0x24')];_0x1c007b+=0x1){_0x70e4b2=_0x4f4b4d[_0x1c007b][_0x0d8b('0x4d')]({'plain':!![]});switch(_0x70e4b2[_0x0d8b('0x4e')]){case _0x0d8b('0x4f'):_0x587128['push'](db[_0x0d8b('0x50')]['query'](_0x4d7bb0(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;case _0x0d8b('0x52'):_0x587128['push'](db[_0x0d8b('0x50')]['query'](_0x519088(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;default:_0x587128[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x2de903(_0x70e4b2,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}}return _0x587128;})[_0x0d8b('0x54')]()['then'](function(){return db[_0x0d8b('0x4a')]['findAll']({'where':{'type':_0x0d8b('0x4b')},'attributes':['id'],'include':[{'model':db[_0x0d8b('0x55')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x56e03c){var _0x10c318=[];if(_0x56e03c){var _0x445a00;for(var _0x24f75=0x0,_0x259ac9;_0x24f75<_0x56e03c[_0x0d8b('0x24')];_0x24f75+=0x1){_0x259ac9=_0x56e03c[_0x24f75][_0x0d8b('0x4d')]({'plain':!![]});_0x10c318[_0x0d8b('0x2a')](db[_0x0d8b('0x50')]['query'](_0x181d49(_0x259ac9,_0x0d8b('0x51')))[_0x0d8b('0x29')](function(){})['catch'](_0x5ad0fe()));}}return _0x10c318;})[_0x0d8b('0x54')]();})[_0x0d8b('0x29')](function(){return db[_0x0d8b('0x56')][_0x0d8b('0x57')]({'attributes':['id',_0x0d8b('0x4e')],'include':[{'model':db[_0x0d8b('0x55')],'as':_0x0d8b('0x4c'),'where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x466082){var _0x5007c0=[];if(_0x466082){for(var _0xe35028=0x0,_0x16df83;_0xe35028<_0x466082['length'];_0xe35028+=0x1){_0x16df83=_0x466082[_0xe35028][_0x0d8b('0x4d')]({'plain':!![]});switch(_0x16df83[_0x0d8b('0x4e')]){case _0x0d8b('0x4f'):_0x5007c0['push'](db['sequelize'][_0x0d8b('0x53')](_0x4d7bb0(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})['catch'](_0x5ad0fe()));break;case'onlyIfOpen':_0x5007c0[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x519088(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));break;default:_0x5007c0[_0x0d8b('0x2a')](db[_0x0d8b('0x50')][_0x0d8b('0x53')](_0x2de903(_0x16df83,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}}return _0x5007c0;})[_0x0d8b('0x54')]();})['then'](function(){return db[_0x0d8b('0x56')][_0x0d8b('0x57')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x0d8b('0x29')](function(_0x1dad9f){var _0x3573b4=[];if(_0x1dad9f){for(var _0x14b1b8=0x0,_0x23e2e0;_0x14b1b8<_0x1dad9f[_0x0d8b('0x24')];_0x14b1b8+=0x1){_0x23e2e0=_0x1dad9f[_0x14b1b8]['get']({'plain':!![]});_0x3573b4['push'](db['sequelize'][_0x0d8b('0x53')](_0x181d49(_0x23e2e0,_0x0d8b('0x58')))[_0x0d8b('0x29')](function(){})[_0x0d8b('0x2c')](_0x5ad0fe()));}}return _0x3573b4;})[_0x0d8b('0x54')]();})[_0x0d8b('0x2c')](function(_0x5ef461){logger[_0x0d8b('0x18')](_0x0d8b('0x59'),'generalCheckHopper',_0x5ef461[_0x0d8b('0x2d')]);});}var processPromises=function(_0x57e3c2){return BPromise[_0x0d8b('0x54')](promises)[_0x0d8b('0x29')](function(_0x9dfa5a){})[_0x0d8b('0x2c')](function(_0x10c7ab){logger[_0x0d8b('0x18')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x2e')](_0x10c7ab));})[_0x0d8b('0x5b')](function(){socket[_0x0d8b('0x5c')](_0x0d8b('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x57e3c2){return _0x57e3c2[_0x0d8b('0x5e')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x0d8b('0x29')](function(){socket[_0x0d8b('0x5c')](_0x0d8b('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0d8b('0x5f')](FILEPATH);}catch(_0xf91ecd){logger[_0x0d8b('0x18')](_0x0d8b('0x60'),JSON['stringify'](_0xf91ecd));}finally{process[_0x0d8b('0x61')](0x0);}});};process['on']('SIGINT',function(){logger[_0x0d8b('0x62')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0x0d8b('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0d8b('0x12')](',');return db[_0x0d8b('0x27')][_0x0d8b('0x57')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x0d8b('0x29')](function(_0x2eece2){var _0x3c7b9b=fs[_0x0d8b('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0d8b('0x64')](_0x3c7b9b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x20a8b6,_0x3a6014){total+=0x1;var _0x180539=total;promises['push'](checkRow(_0x20a8b6,_0x2eece2,_0x180539)[_0x0d8b('0x29')](function(){success+=0x1;})[_0x0d8b('0x2c')](function(_0x8be77c){if(_0x8be77c['error']){errors+=0x1;delete _0x8be77c['error'];}else if(_0x8be77c[_0x0d8b('0x65')]){duplicates+=0x1;delete _0x8be77c[_0x0d8b('0x65')];}rows[_0x0d8b('0x2a')](_0x8be77c);}));if(total%0xc8===0x0){_0x3a6014[_0x0d8b('0x66')]();return processPromises(_0x3a6014);}},'complete':function(){return processPromises()[_0x0d8b('0x29')](function(){logger[_0x0d8b('0x62')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x1a96ce,_0x3d6267){logger[_0x0d8b('0x62')](_0x0d8b('0x67'),JSON[_0x0d8b('0x2e')](_0x1a96ce));endCsv();}});})['catch'](function(_0x4dbcfc){logger[_0x0d8b('0x18')](_0x0d8b('0x68'),JSON[_0x0d8b('0x2e')](_0x4dbcfc));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 03adc7f..f73c2f6 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 _0x8f5a=['cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','priority','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_hopper_black','updatedAt','fields','ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','errors','push','sequelize','query','spread','catch','error','main','stringify','send','start','binding','root','header','writeFileSync','createReadStream','length','rows','data','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','emit','contact:import:','abort','SystemError','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','each','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','parse','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','path','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat'];(function(_0x116e10,_0x317c9f){var _0x34d808=function(_0x3d3af0){while(--_0x3d3af0){_0x116e10['push'](_0x116e10['shift']());}};_0x34d808(++_0x317c9f);}(_0x8f5a,0x6f));var _0xa8f5=function(_0xf95a7a,_0x30114d){_0xf95a7a=_0xf95a7a-0x0;var _0x2b07fe=_0x8f5a[_0xf95a7a];return _0x2b07fe;};'use strict';var fs=require('fs');var path=require(_0xa8f5('0x0'));var _=require('lodash');var Papa=require(_0xa8f5('0x1'));var util=require(_0xa8f5('0x2'));var BPromise=require(_0xa8f5('0x3'));var moment=require(_0xa8f5('0x4'));var squel=require(_0xa8f5('0x5'));var Redis=require(_0xa8f5('0x6'));var db=require(_0xa8f5('0x7'))['db'];var config=require(_0xa8f5('0x8'));var logger=require('../../../config/logger')(_0xa8f5('0x9'));config[_0xa8f5('0xa')]=_[_0xa8f5('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa8f5('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xa8f5('0xc')](_0xa8f5('0xd'));function isEmail(_0x133e48){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))*$/[_0xa8f5('0xe')](_0x133e48);}function selectNotIn(_0x33255c,_0x2267d3,_0x9fb19f,_0x160f51,_0x24368a){return squel[_0xa8f5('0xf')]()[_0xa8f5('0x10')](_0xa8f5('0x11'))[_0xa8f5('0x12')](_0x160f51)[_0xa8f5('0x13')](_0x2267d3,null,_0x2267d3+'.id\x20=\x20'+_0x160f51+'.'+_0x9fb19f)['where'](_0x160f51+'.'+_0x9fb19f+_0xa8f5('0x14')+_0x33255c+'.'+_0x9fb19f)[_0xa8f5('0x15')](_0x2267d3+_0xa8f5('0x16')+_0x24368a[_0xa8f5('0x13')]()+')');}function insertCmHopper(_0x465988,_0x3d3239,_0x129002,_0x3d838a,_0x557cd5){var _0x40341b=[_0xa8f5('0x17'),_0xa8f5('0x18'),_0xa8f5('0x19'),_0xa8f5('0x1a'),_0x3d3239+'.'+_0x3d838a,_0xa8f5('0x1b'),_0xa8f5('0x1c'),_0xa8f5('0x1d'),_0xa8f5('0x1e'),'\x22'+_0x557cd5+'\x22'];return squel[_0xa8f5('0x1f')]()[_0xa8f5('0x20')](_0xa8f5('0x21'))[_0xa8f5('0x22')]([_0xa8f5('0x11'),'scheduledat',_0xa8f5('0x23'),_0xa8f5('0x24'),_0x3d838a,_0xa8f5('0x25'),'updatedAt',_0xa8f5('0x26'),_0xa8f5('0x27'),_0xa8f5('0x28')],squel['select']()['fields'](_0x40341b)[_0xa8f5('0x12')](_0x3d3239)[_0xa8f5('0x13')](_0xa8f5('0x29'),null,_0xa8f5('0x2a')+_0x3d3239+_0xa8f5('0x2b'))[_0xa8f5('0x13')](_0x129002,null,_0x129002+_0xa8f5('0x2c')+_0x3d3239+'.'+_0x3d838a)[_0xa8f5('0x15')](_0x3d3239+_0xa8f5('0x2d'),_0x465988)[_0xa8f5('0x15')](_0xa8f5('0x2e'),NOW)[_0xa8f5('0x15')](_0xa8f5('0x2f'),selectNotIn(_0x3d3239,_0x129002,_0x3d838a,_0xa8f5('0x21'),['\x22always\x22',_0xa8f5('0x30')]))[_0xa8f5('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3d3239,_0x129002,_0x3d838a,_0xa8f5('0x21'),[_0xa8f5('0x31')])))[_0xa8f5('0x32')]();}function insertCmHopperBlack(_0x3fe14d,_0x503096,_0x11a812,_0xbf7d9b){var _0x564c1e=[_0xa8f5('0x17'),_0xa8f5('0x19'),_0xa8f5('0x1a'),_0x503096+'.'+_0xbf7d9b,_0xa8f5('0x1b'),'cm_contacts.updatedAt'];return squel[_0xa8f5('0x1f')]()[_0xa8f5('0x20')](_0xa8f5('0x33'))[_0xa8f5('0x22')]([_0xa8f5('0x11'),_0xa8f5('0x23'),'ListId',_0xbf7d9b,_0xa8f5('0x25'),_0xa8f5('0x34')],squel[_0xa8f5('0xf')]()[_0xa8f5('0x35')](_0x564c1e)[_0xa8f5('0x12')](_0x503096)[_0xa8f5('0x13')]('cm_contacts',null,_0xa8f5('0x2a')+_0x503096+_0xa8f5('0x2b'))[_0xa8f5('0x13')](_0x11a812,null,_0x11a812+'.id\x20=\x20'+_0x503096+'.'+_0xbf7d9b)[_0xa8f5('0x15')](_0x503096+_0xa8f5('0x2d'),_0x3fe14d)[_0xa8f5('0x15')](_0xa8f5('0x2e'),NOW)[_0xa8f5('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xa8f5('0xf')]()[_0xa8f5('0x10')]('phone')[_0xa8f5('0x12')](_0xa8f5('0x33'))[_0xa8f5('0x15')](_0xa8f5('0x36'),_0x3fe14d)['where'](_0xbf7d9b+'\x20=\x20?',_0x503096+'.'+_0xbf7d9b)))[_0xa8f5('0x32')]();}function insertCmContact(_0x20ccdf,_0x3c4dc1,_0x51914d,_0x307aa6){var _0x42344a=_[_0xa8f5('0x37')](_[_0xa8f5('0x38')](_0x307aa6),[_0xa8f5('0x24'),_0xa8f5('0x39'),_0xa8f5('0x25'),_0xa8f5('0x34')]);return squel['insert']()['into'](_0xa8f5('0x29'))[_0xa8f5('0x22')](_0x42344a,squel['select']()[_0xa8f5('0x35')](_0x42344a)[_0xa8f5('0x12')](_0x3c4dc1)['where']('('+_0x51914d[_0xa8f5('0x13')](',')+_0xa8f5('0x3a'),squel[_0xa8f5('0xf')]()['fields'](_0x51914d)[_0xa8f5('0x12')]('cm_contacts')[_0xa8f5('0x15')](_0xa8f5('0x36'),_0x20ccdf)[_0xa8f5('0x15')](_0xa8f5('0x3b')))['where'](_0xa8f5('0x3c'),squel[_0xa8f5('0xf')]()[_0xa8f5('0x10')](_0xa8f5('0x3d'),_0xa8f5('0x3e'))[_0xa8f5('0x12')](_0x3c4dc1)[_0xa8f5('0x3f')](_0x51914d[_0xa8f5('0x13')](','))))['toString']();}function handleStop(){logger[_0xa8f5('0x40')](_0xa8f5('0x41'));stopped=!![];}function handleUncaughtException(_0x3a5370){logger['error'](_0x3a5370[_0xa8f5('0x42')]);process[_0xa8f5('0x43')](0x1);}function handleError(_0x2703fb,_0x3b4b9f){stats[_0xa8f5('0x44')][_0xa8f5('0x45')]({'name':_0x3b4b9f['code'],'message':_0x3b4b9f['message'],'row':_0x2703fb});}function handleQuery(_0x4f90d7){logger[_0xa8f5('0x40')](_0x4f90d7);return db[_0xa8f5('0x46')][_0xa8f5('0x47')](_0x4f90d7)[_0xa8f5('0x48')](function(_0x57119a){results[_0xa8f5('0x45')](_0x57119a);})[_0xa8f5('0x49')](function(_0x590061){logger[_0xa8f5('0x4a')](_0x590061[_0xa8f5('0x42')]);});}function main(_0x1e29f1,_0x2684e4,_0x3f1e72,_0x41ba86){logger[_0xa8f5('0x40')](_0xa8f5('0x4b'),_0x1e29f1,JSON[_0xa8f5('0x4c')](_0x2684e4));process[_0xa8f5('0x4d')](_0xa8f5('0x4e'));var _0x3b5b9d=_0x2684e4[_0xa8f5('0x4f')];var _0x4c7655=_0x2684e4['socket_timestamp'];var _0x4cd5=path['join'](config[_0xa8f5('0x50')],'server/files/tmp',_0x4c7655+'.csv');var _0x3c6b61=_[_0xa8f5('0x38')](_0x3b5b9d)[_0xa8f5('0x13')]();logger[_0xa8f5('0x40')](_0xa8f5('0x51'),_0x3c6b61);fs[_0xa8f5('0x52')](_0x4cd5,_0x3c6b61+'\x0a');Papa['parse'](fs[_0xa8f5('0x53')](_0x1e29f1),{'header':!![],'skipEmptyLines':!![],'step':function(_0x48b4d3,_0xb8bc73){try{for(var _0x5bc81f=0x0,_0x6f5734=[];_0x5bc81f<_0x48b4d3['data'][_0xa8f5('0x54')];_0x5bc81f++){stats[_0xa8f5('0x55')]+=0x1;if(_0x48b4d3[_0xa8f5('0x44')][_0x5bc81f]){handleError(_0x48b4d3['data'][_0x5bc81f],_0x48b4d3[_0xa8f5('0x44')][_0x5bc81f]);}else{var _0x3e2473=[];for(var _0x280406 in _0x3b5b9d){if(_0x3b5b9d['hasOwnProperty'](_0x280406)){if(_0x48b4d3[_0xa8f5('0x56')][_0x5bc81f][_0x3b5b9d[_0x280406]]){var _0x69f85b=_[_0xa8f5('0x57')](_0x48b4d3['data'][_0x5bc81f][_0x3b5b9d[_0x280406]][_0xa8f5('0x58')](/"/g,'\x27'));switch(_0x280406){case _0xa8f5('0x59'):var _0x39be51=moment(_0x69f85b,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x39be51[_0xa8f5('0x5a')]()){_0x6f5734[_0xa8f5('0x45')]('\x22'+_0x69f85b+'\x22');}else{_0x3e2473[_0xa8f5('0x45')](_0xa8f5('0x5b'));}break;case _0xa8f5('0x26'):var _0x143213=parseInt(_0x69f85b);_0x69f85b=_[_0xa8f5('0x5c')](_0x143213)||_0x143213<0x0||_0x143213>0x4?_0x41ba86?0x3:0x2:_0x143213;_0x6f5734[_0xa8f5('0x45')]('\x22'+_0x69f85b+'\x22');break;case _0xa8f5('0x27'):var _0x35664b=parseInt(_0x69f85b);if(_[_0xa8f5('0x5d')](_0x35664b)&&_[_0xa8f5('0x5e')](_0x3f1e72,_0x35664b)){_0x6f5734[_0xa8f5('0x45')]('\x22'+_0x35664b+'\x22');}else{_0x3e2473[_0xa8f5('0x45')]('agent\x20not\x20exists');}break;case _0xa8f5('0x5f'):if(isEmail(_0x69f85b)){_0x6f5734[_0xa8f5('0x45')]('\x22'+_0x69f85b+'\x22');}else{_0x3e2473['push'](_0xa8f5('0x60'));}break;case _0xa8f5('0x61'):var _0x546c59=moment(_0x69f85b,'YYYY-MM-DD',!![]);if(_0x546c59[_0xa8f5('0x5a')]()){_0x6f5734['push']('\x22'+_0x69f85b+'\x22');}else{_0x3e2473[_0xa8f5('0x45')](_0xa8f5('0x62'));}break;default:_0x6f5734[_0xa8f5('0x45')]('\x22'+_0x69f85b+'\x22');}}else{switch(_0x280406){case _0xa8f5('0x63'):case _0xa8f5('0x11'):_0x3e2473[_0xa8f5('0x45')](_0x280406+'\x20not\x20specified');break;default:_0x6f5734[_0xa8f5('0x45')]('\x22\x22');}}}}if(_0x3e2473[_0xa8f5('0x54')]){handleError(_0x48b4d3['data'][_0x5bc81f],{'code':_0xa8f5('0x64'),'message':_0x3e2473['join']()});}else{fs['appendFileSync'](_0x4cd5,_0x6f5734[_0xa8f5('0x13')]()+'\x0a');}_0x6f5734=[];}if(!(stats[_0xa8f5('0x55')]%0xc8)){socket[_0xa8f5('0x65')](_0xa8f5('0x66')+_0x4c7655,stats);stats[_0xa8f5('0x44')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0xb8bc73[_0xa8f5('0x67')]();}}catch(_0x5095fb){handleError(_0x48b4d3['data'][_0x5bc81f],{'code':_0xa8f5('0x68'),'message':_0x5095fb[_0xa8f5('0x42')]});logger[_0xa8f5('0x4a')]('step',_0x5095fb[_0xa8f5('0x42')]);}},'complete':function(){try{var _0x55b612=[];var _0x3a161f=_0xa8f5('0x29');if(_0x2684e4[_0xa8f5('0x69')]&&_0x2684e4[_0xa8f5('0x69')][_0xa8f5('0x54')]){_0x3a161f=_0xa8f5('0x6a')+_0x4c7655;_0x55b612[_0xa8f5('0x45')](_0xa8f5('0x6b')+_0x3a161f+_0xa8f5('0x6c'));}var _0x31dffd=util[_0xa8f5('0xc')](_0xa8f5('0x6d'),_0x4cd5,_0x3a161f,_0x3c6b61,_0x2684e4[_0xa8f5('0x24')],_0x2684e4[_0xa8f5('0x39')]||null,NOW,NOW);if(_['isNil'](_0x3b5b9d[_0xa8f5('0x59')])){_0x31dffd+=_0xa8f5('0x6e');}_0x55b612[_0xa8f5('0x45')](_0x31dffd);if(_0x2684e4['duplicates']&&_0x2684e4['duplicates']['length']){_0x55b612['push'](insertCmContact(_0x2684e4[_0xa8f5('0x24')],_0x3a161f,_0x2684e4[_0xa8f5('0x69')],_0x3b5b9d));_0x55b612[_0xa8f5('0x45')](_0xa8f5('0x6f')+_0x3a161f+';');}_0x55b612['push'](insertCmHopper(_0x2684e4['ListId'],_0xa8f5('0x70'),_0xa8f5('0x71'),_0xa8f5('0x72'),_0x41ba86));_0x55b612[_0xa8f5('0x45')](insertCmHopperBlack(_0x2684e4[_0xa8f5('0x24')],_0xa8f5('0x73'),_0xa8f5('0x71'),_0xa8f5('0x72')));_0x55b612[_0xa8f5('0x45')](insertCmHopper(_0x2684e4[_0xa8f5('0x24')],_0xa8f5('0x74'),_0xa8f5('0x75'),_0xa8f5('0x76'),_0x41ba86));_0x55b612[_0xa8f5('0x45')](insertCmHopperBlack(_0x2684e4[_0xa8f5('0x24')],'campaigns_has_cm_blacklists',_0xa8f5('0x75'),_0xa8f5('0x76')));BPromise[_0xa8f5('0x77')](_0x55b612,handleQuery)['then'](function(_0x5b5a42){stats[_0xa8f5('0x78')]=!![];stats[_0xa8f5('0x79')]=_0x2684e4['duplicates']&&_0x2684e4[_0xa8f5('0x69')][_0xa8f5('0x54')]?results[0x2]['affectedRows']:results[0x0][_0xa8f5('0x79')];socket[_0xa8f5('0x65')](_0xa8f5('0x66')+_0x4c7655,stats);fs['unlink'](_0x1e29f1);fs[_0xa8f5('0x7a')](_0x4cd5);process[_0xa8f5('0x43')](0x0);})['catch'](function(_0x5990c6){logger[_0xa8f5('0x4a')](_0x5990c6[_0xa8f5('0x42')]);process[_0xa8f5('0x43')](0x1);});}catch(_0x68bfd9){logger[_0xa8f5('0x4a')](_0xa8f5('0x7b'),_0x68bfd9[_0xa8f5('0x42')]);process[_0xa8f5('0x43')](0x1);}},'error':function(_0xb41e82,_0x289937,_0x57a091,_0x191220){throw new Error(_0x191220);}});}function validate(){if(process[_0xa8f5('0x7c')]&&process['argv'][_0xa8f5('0x54')]<0x4){throw new Error(_0xa8f5('0x7d'));}var _0x4f4a0c=path[_0xa8f5('0x13')](config[_0xa8f5('0x50')],_0xa8f5('0x7e'),process[_0xa8f5('0x7c')][0x2]);if(!fs[_0xa8f5('0x7f')](_0x4f4a0c)){throw new Error(_0xa8f5('0x80'));}var _0x49edf3={};try{_0x49edf3=JSON[_0xa8f5('0x81')](process[_0xa8f5('0x7c')][0x3]);if(!_0x49edf3[_0xa8f5('0x4f')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x49edf3[_0xa8f5('0x4f')][_0xa8f5('0x11')]){throw new Error(_0xa8f5('0x82'));}if(!_0x49edf3[_0xa8f5('0x4f')]['firstName']){throw new Error(_0xa8f5('0x83'));}var _0x4fdea4=0x0;if(_0x49edf3['binding'][_0xa8f5('0x27')]){_0x4fdea4=0x1;}if(!_0x49edf3[_0xa8f5('0x24')]){throw new Error(_0xa8f5('0x84'));}}catch(_0x2f09b6){throw new Error(_0xa8f5('0x85'));}var _0xc584ec=[];try{_0xc584ec=_[_0xa8f5('0x86')](JSON[_0xa8f5('0x81')](process[_0xa8f5('0x7c')][0x4]),'id');}catch(_0x3da198){logger[_0xa8f5('0x40')](_0xa8f5('0x87'));}main(_0x4f4a0c,_0x49edf3,_0xc584ec,_0x4fdea4);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0xe444=['error','main','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','keys','header','writeFileSync','createReadStream','data','length','hasOwnProperty','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','SystemRow','appendFileSync','rows','contact:import:','Abort\x20parser','abort','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns','CampaignId','each','then','finish','affectedRows','emit','unlink','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.id','cm_contacts.ListId','cm_hopper_black','field','ListId\x20=\x20?','\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','message','exit','errors','push','code','catch'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe444,0x156));var _0x4e44=function(_0x992d56,_0xcb4d40){_0x992d56=_0x992d56-0x0;var _0x262a25=_0xe444[_0x992d56];return _0x262a25;};'use strict';var fs=require('fs');var path=require(_0x4e44('0x0'));var _=require(_0x4e44('0x1'));var Papa=require(_0x4e44('0x2'));var util=require(_0x4e44('0x3'));var BPromise=require(_0x4e44('0x4'));var moment=require(_0x4e44('0x5'));var squel=require(_0x4e44('0x6'));var Redis=require(_0x4e44('0x7'));var db=require('../../../mysqldb')['db'];var config=require(_0x4e44('0x8'));var logger=require(_0x4e44('0x9'))(_0x4e44('0xa'));config[_0x4e44('0xb')]=_[_0x4e44('0xc')](config[_0x4e44('0xb')],{'host':_0x4e44('0xd'),'port':0x18eb});var socket=require(_0x4e44('0xe'))(new Redis(config[_0x4e44('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x4e44('0xf')](_0x4e44('0x10'));function isEmail(_0x4f8acc){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))*$/[_0x4e44('0x11')](_0x4f8acc);}function selectNotIn(_0x149b95,_0x5b0018,_0x10889f,_0x5c2f68,_0x1bdec7){return squel[_0x4e44('0x12')]()['field'](_0x4e44('0x13'))[_0x4e44('0x14')](_0x5c2f68)['join'](_0x5b0018,null,_0x5b0018+_0x4e44('0x15')+_0x5c2f68+'.'+_0x10889f)[_0x4e44('0x16')](_0x5c2f68+'.'+_0x10889f+'\x20=\x20'+_0x149b95+'.'+_0x10889f)[_0x4e44('0x16')](_0x5b0018+_0x4e44('0x17')+_0x1bdec7[_0x4e44('0x18')]()+')');}function insertCmHopper(_0x215262,_0xf78270,_0x4941d7,_0x5720cc,_0x3272a0){var _0x548a29=[_0x4e44('0x19'),_0x4e44('0x1a'),'cm_contacts.id','cm_contacts.ListId',_0xf78270+'.'+_0x5720cc,_0x4e44('0x1b'),_0x4e44('0x1c'),_0x4e44('0x1d'),'cm_contacts.UserId','\x22'+_0x3272a0+'\x22'];return squel['insert']()[_0x4e44('0x1e')](_0x4e44('0x1f'))[_0x4e44('0x20')]([_0x4e44('0x13'),'scheduledat',_0x4e44('0x21'),_0x4e44('0x22'),_0x5720cc,_0x4e44('0x23'),_0x4e44('0x24'),_0x4e44('0x25'),'UserId',_0x4e44('0x26')],squel[_0x4e44('0x12')]()[_0x4e44('0x27')](_0x548a29)['from'](_0xf78270)['join'](_0x4e44('0x28'),null,_0x4e44('0x29')+_0xf78270+_0x4e44('0x2a'))['join'](_0x4941d7,null,_0x4941d7+'.id\x20=\x20'+_0xf78270+'.'+_0x5720cc)[_0x4e44('0x16')](_0xf78270+'.CmListId\x20=\x20?',_0x215262)[_0x4e44('0x16')](_0x4e44('0x2b'),NOW)['where'](_0x4e44('0x2c'),selectNotIn(_0xf78270,_0x4941d7,_0x5720cc,_0x4e44('0x1f'),['\x22always\x22',_0x4e44('0x2d')]))[_0x4e44('0x16')](_0x4e44('0x2c'),selectNotIn(_0xf78270,_0x4941d7,_0x5720cc,_0x4e44('0x1f'),[_0x4e44('0x2e')])))[_0x4e44('0x2f')]();}function insertCmHopperBlack(_0x2a391a,_0x48901f,_0x3537c8,_0x29d8c1){var _0x38df40=['cm_contacts.phone',_0x4e44('0x30'),_0x4e44('0x31'),_0x48901f+'.'+_0x29d8c1,'cm_contacts.createdAt',_0x4e44('0x1c')];return squel['insert']()['into'](_0x4e44('0x32'))[_0x4e44('0x20')]([_0x4e44('0x13'),_0x4e44('0x21'),_0x4e44('0x22'),_0x29d8c1,_0x4e44('0x23'),_0x4e44('0x24')],squel['select']()['fields'](_0x38df40)[_0x4e44('0x14')](_0x48901f)[_0x4e44('0x18')](_0x4e44('0x28'),null,_0x4e44('0x29')+_0x48901f+_0x4e44('0x2a'))[_0x4e44('0x18')](_0x3537c8,null,_0x3537c8+_0x4e44('0x15')+_0x48901f+'.'+_0x29d8c1)[_0x4e44('0x16')](_0x48901f+'.CmListId\x20=\x20?',_0x2a391a)['where'](_0x4e44('0x2b'),NOW)[_0x4e44('0x16')](_0x4e44('0x2c'),squel['select']()[_0x4e44('0x33')](_0x4e44('0x13'))['from'](_0x4e44('0x32'))['where'](_0x4e44('0x34'),_0x2a391a)['where'](_0x29d8c1+_0x4e44('0x35'),_0x48901f+'.'+_0x29d8c1)))[_0x4e44('0x2f')]();}function insertCmContact(_0x5273ea,_0x348cc2,_0x1009ff,_0x1f56d4){var _0x3bf03c=_[_0x4e44('0x36')](_['keys'](_0x1f56d4),['ListId',_0x4e44('0x37'),_0x4e44('0x23'),_0x4e44('0x24')]);return squel['insert']()[_0x4e44('0x1e')]('cm_contacts')[_0x4e44('0x20')](_0x3bf03c,squel[_0x4e44('0x12')]()[_0x4e44('0x27')](_0x3bf03c)['from'](_0x348cc2)[_0x4e44('0x16')]('('+_0x1009ff[_0x4e44('0x18')](',')+_0x4e44('0x38'),squel[_0x4e44('0x12')]()['fields'](_0x1009ff)[_0x4e44('0x14')](_0x4e44('0x28'))[_0x4e44('0x16')]('ListId\x20=\x20?',_0x5273ea)[_0x4e44('0x16')](_0x4e44('0x39')))[_0x4e44('0x16')](_0x4e44('0x3a'),squel['select']()[_0x4e44('0x33')](_0x4e44('0x3b'),_0x4e44('0x3c'))[_0x4e44('0x14')](_0x348cc2)['group'](_0x1009ff[_0x4e44('0x18')](','))))[_0x4e44('0x2f')]();}function handleStop(){logger[_0x4e44('0x3d')](_0x4e44('0x3e'));stopped=!![];}function handleUncaughtException(_0x17575c){logger['error'](_0x17575c[_0x4e44('0x3f')]);process[_0x4e44('0x40')](0x1);}function handleError(_0x4e84c1,_0x3c3e09){stats[_0x4e44('0x41')][_0x4e44('0x42')]({'name':_0x3c3e09[_0x4e44('0x43')],'message':_0x3c3e09[_0x4e44('0x3f')],'row':_0x4e84c1});}function handleQuery(_0x5c4efd){logger[_0x4e44('0x3d')](_0x5c4efd);return db['sequelize']['query'](_0x5c4efd)['spread'](function(_0x2b20cd){results['push'](_0x2b20cd);})[_0x4e44('0x44')](function(_0x415829){logger[_0x4e44('0x45')](_0x415829[_0x4e44('0x3f')]);});}function main(_0x33c764,_0xbd8db8,_0x3c2046,_0x2cfd80){logger[_0x4e44('0x3d')](_0x4e44('0x46'),_0x33c764,JSON['stringify'](_0xbd8db8));process[_0x4e44('0x47')](_0x4e44('0x48'));var _0x1b5931=_0xbd8db8[_0x4e44('0x49')];var _0x51f70c=_0xbd8db8[_0x4e44('0x4a')];var _0x4cbc11=path[_0x4e44('0x18')](config[_0x4e44('0x4b')],_0x4e44('0x4c'),_0x51f70c+_0x4e44('0x4d'));var _0x404c6c=_[_0x4e44('0x4e')](_0x1b5931)[_0x4e44('0x18')]();logger[_0x4e44('0x3d')](_0x4e44('0x4f'),_0x404c6c);fs[_0x4e44('0x50')](_0x4cbc11,_0x404c6c+'\x0a');Papa['parse'](fs[_0x4e44('0x51')](_0x33c764),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3c401b,_0x5b43a3){try{for(var _0x81b89f=0x0,_0x128f7c=[];_0x81b89f<_0x3c401b[_0x4e44('0x52')][_0x4e44('0x53')];_0x81b89f++){stats['rows']+=0x1;if(_0x3c401b[_0x4e44('0x41')][_0x81b89f]){handleError(_0x3c401b[_0x4e44('0x52')][_0x81b89f],_0x3c401b[_0x4e44('0x41')][_0x81b89f]);}else{var _0x43d837=[];for(var _0x5f4c30 in _0x1b5931){if(_0x1b5931[_0x4e44('0x54')](_0x5f4c30)){if(_0x3c401b['data'][_0x81b89f][_0x1b5931[_0x5f4c30]]){var _0x34c806=_[_0x4e44('0x55')](_0x3c401b[_0x4e44('0x52')][_0x81b89f][_0x1b5931[_0x5f4c30]][_0x4e44('0x56')](/"/g,'\x27'));switch(_0x5f4c30){case _0x4e44('0x57'):var _0x21e138=moment(_0x34c806,_0x4e44('0x10'),!![]);if(_0x21e138[_0x4e44('0x58')]()){_0x128f7c['push']('\x22'+_0x34c806+'\x22');}else{_0x43d837[_0x4e44('0x42')](_0x4e44('0x59'));}break;case _0x4e44('0x25'):var _0x141d8b=parseInt(_0x34c806);_0x34c806=_[_0x4e44('0x5a')](_0x141d8b)||_0x141d8b<0x0||_0x141d8b>0x4?_0x2cfd80?0x3:0x2:_0x141d8b;_0x128f7c[_0x4e44('0x42')]('\x22'+_0x34c806+'\x22');break;case _0x4e44('0x5b'):var _0x47545a=parseInt(_0x34c806);if(_[_0x4e44('0x5c')](_0x47545a)&&_['includes'](_0x3c2046,_0x47545a)){_0x128f7c[_0x4e44('0x42')]('\x22'+_0x47545a+'\x22');}else{_0x43d837[_0x4e44('0x42')](_0x4e44('0x5d'));}break;case'email':if(isEmail(_0x34c806)){_0x128f7c[_0x4e44('0x42')]('\x22'+_0x34c806+'\x22');}else{_0x43d837[_0x4e44('0x42')](_0x4e44('0x5e'));}break;case _0x4e44('0x5f'):var _0x5ab850=moment(_0x34c806,_0x4e44('0x60'),!![]);if(_0x5ab850[_0x4e44('0x58')]()){_0x128f7c[_0x4e44('0x42')]('\x22'+_0x34c806+'\x22');}else{_0x43d837[_0x4e44('0x42')](_0x4e44('0x61'));}break;default:_0x128f7c['push']('\x22'+_0x34c806+'\x22');}}else{switch(_0x5f4c30){case'firstName':case'phone':_0x43d837[_0x4e44('0x42')](_0x5f4c30+'\x20not\x20specified');break;default:_0x128f7c[_0x4e44('0x42')]('\x22\x22');}}}}if(_0x43d837['length']){handleError(_0x3c401b[_0x4e44('0x52')][_0x81b89f],{'code':_0x4e44('0x62'),'message':_0x43d837[_0x4e44('0x18')]()});}else{fs[_0x4e44('0x63')](_0x4cbc11,_0x128f7c['join']()+'\x0a');}_0x128f7c=[];}if(!(stats[_0x4e44('0x64')]%0xc8)){socket['emit'](_0x4e44('0x65')+_0x51f70c,stats);stats[_0x4e44('0x41')]=[];}}if(stopped){logger[_0x4e44('0x3d')](_0x4e44('0x66'));_0x5b43a3[_0x4e44('0x67')]();}}catch(_0x14a05d){handleError(_0x3c401b['data'][_0x81b89f],{'code':'SystemError','message':_0x14a05d['message']});logger['error'](_0x4e44('0x68'),_0x14a05d[_0x4e44('0x3f')]);}},'complete':function(){try{var _0x17caed=[];var _0xbe0b0b=_0x4e44('0x28');if(_0xbd8db8['duplicates']&&_0xbd8db8[_0x4e44('0x69')][_0x4e44('0x53')]){_0xbe0b0b='cm_contacts_'+_0x51f70c;_0x17caed['push'](_0x4e44('0x6a')+_0xbe0b0b+_0x4e44('0x6b'));}var _0x9e1ad4=util[_0x4e44('0xf')](_0x4e44('0x6c'),_0x4cbc11,_0xbe0b0b,_0x404c6c,_0xbd8db8[_0x4e44('0x22')],_0xbd8db8[_0x4e44('0x37')]||null,NOW,NOW);if(_[_0x4e44('0x6d')](_0x1b5931[_0x4e44('0x57')])){_0x9e1ad4+=_0x4e44('0x6e');}_0x17caed[_0x4e44('0x42')](_0x9e1ad4);if(_0xbd8db8['duplicates']&&_0xbd8db8['duplicates'][_0x4e44('0x53')]){_0x17caed[_0x4e44('0x42')](insertCmContact(_0xbd8db8[_0x4e44('0x22')],_0xbe0b0b,_0xbd8db8[_0x4e44('0x69')],_0x1b5931));_0x17caed['push'](_0x4e44('0x6f')+_0xbe0b0b+';');}_0x17caed[_0x4e44('0x42')](insertCmHopper(_0xbd8db8[_0x4e44('0x22')],_0x4e44('0x70'),'voice_queues',_0x4e44('0x71'),_0x2cfd80));_0x17caed[_0x4e44('0x42')](insertCmHopperBlack(_0xbd8db8[_0x4e44('0x22')],_0x4e44('0x72'),_0x4e44('0x73'),'VoiceQueueId'));_0x17caed[_0x4e44('0x42')](insertCmHopper(_0xbd8db8[_0x4e44('0x22')],_0x4e44('0x74'),_0x4e44('0x75'),_0x4e44('0x76'),_0x2cfd80));_0x17caed['push'](insertCmHopperBlack(_0xbd8db8[_0x4e44('0x22')],'campaigns_has_cm_blacklists',_0x4e44('0x75'),_0x4e44('0x76')));BPromise[_0x4e44('0x77')](_0x17caed,handleQuery)[_0x4e44('0x78')](function(_0x2dff51){stats[_0x4e44('0x79')]=!![];stats[_0x4e44('0x7a')]=_0xbd8db8[_0x4e44('0x69')]&&_0xbd8db8[_0x4e44('0x69')]['length']?results[0x2][_0x4e44('0x7a')]:results[0x0][_0x4e44('0x7a')];socket[_0x4e44('0x7b')](_0x4e44('0x65')+_0x51f70c,stats);fs[_0x4e44('0x7c')](_0x33c764);fs['unlink'](_0x4cbc11);process[_0x4e44('0x40')](0x0);})['catch'](function(_0x7bd447){logger[_0x4e44('0x45')](_0x7bd447[_0x4e44('0x3f')]);process[_0x4e44('0x40')](0x1);});}catch(_0x60679b){logger[_0x4e44('0x45')]('complete',_0x60679b[_0x4e44('0x3f')]);process[_0x4e44('0x40')](0x1);}},'error':function(_0x1c8e29,_0x9e2587,_0x4e6252,_0x159dc7){throw new Error(_0x159dc7);}});}function validate(){if(process[_0x4e44('0x7d')]&&process['argv'][_0x4e44('0x53')]<0x4){throw new Error(_0x4e44('0x7e'));}var _0x536933=path[_0x4e44('0x18')](config[_0x4e44('0x4b')],_0x4e44('0x4c'),process[_0x4e44('0x7d')][0x2]);if(!fs['existsSync'](_0x536933)){throw new Error(_0x4e44('0x7f'));}var _0x39a2e8={};try{_0x39a2e8=JSON[_0x4e44('0x80')](process[_0x4e44('0x7d')][0x3]);if(!_0x39a2e8[_0x4e44('0x49')]){throw new Error(_0x4e44('0x81'));}if(!_0x39a2e8[_0x4e44('0x49')]['phone']){throw new Error(_0x4e44('0x82'));}if(!_0x39a2e8[_0x4e44('0x49')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x5e4379=0x0;if(_0x39a2e8['binding']['UserId']){_0x5e4379=0x1;}if(!_0x39a2e8[_0x4e44('0x22')]){throw new Error(_0x4e44('0x83'));}}catch(_0x409656){throw new Error(_0x4e44('0x84'));}var _0x5accf9=[];try{_0x5accf9=_[_0x4e44('0x85')](JSON['parse'](process[_0x4e44('0x7d')][0x4]),'id');}catch(_0x1fdc79){logger[_0x4e44('0x3d')](_0x4e44('0x86'));}main(_0x536933,_0x39a2e8,_0x5accf9,_0x5e4379);}validate();process['on'](_0x4e44('0x87'),handleStop);process['on'](_0x4e44('0x88'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index e5d7234..c8f6b76 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6fa=['Call\x20To','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','starttime','answertime','Complete\x20Time','endtime','duration','getSubjects','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xb6fa[_0x68c979];return _0x4f0001;};'use strict';exports[_0xab6f('0x0')]=function(_0x5762b4,_0x4b0e89){var _0x46bd0e=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x5762b4[_0xab6f('0x1')]()){case _0xab6f('0x2'):switch(_0x4b0e89['toLowerCase']()){case _0xab6f('0x3'):_0x46bd0e[_0xab6f('0x4')]({'type':_0xab6f('0x5'),'content':'','variableName':_0xab6f('0x6')});_0x46bd0e[_0xab6f('0x4')]({'type':_0xab6f('0x5'),'content':'','variableName':_0xab6f('0x7')});break;case _0xab6f('0x8'):_0x46bd0e[_0xab6f('0x4')]({'type':_0xab6f('0x9'),'content':_0xab6f('0xa'),'variableName':null});_0x46bd0e[_0xab6f('0x4')]({'type':_0xab6f('0x5'),'content':'','variableName':_0xab6f('0xb')});break;}}return _0x46bd0e;};exports[_0xab6f('0xc')]=function(_0x17cbab,_0x4838a8){var _0x599560=[];switch(_0x17cbab[_0xab6f('0x1')]()){case _0xab6f('0x2'):switch(_0x4838a8['toLowerCase']()){case _0xab6f('0x3'):_0x599560=[{'type':_0xab6f('0x9'),'content':_0xab6f('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0xf'),'keyType':_0xab6f('0x5'),'variableName':_0xab6f('0x7')},{'type':'keyValue','content':'','key':_0xab6f('0x10'),'keyType':_0xab6f('0x5'),'variableName':_0xab6f('0x11')},{'type':'keyValue','content':'','key':_0xab6f('0x12'),'keyType':'variable','variableName':'destexten'},{'type':_0xab6f('0xe'),'content':'','key':'Queue','keyType':_0xab6f('0x5'),'variableName':_0xab6f('0x6')},{'type':_0xab6f('0xe'),'content':'','key':'UniqueId','keyType':_0xab6f('0x5'),'variableName':'uniqueid'},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x13'),'keyType':_0xab6f('0x5'),'variableName':_0xab6f('0x14')},{'type':_0xab6f('0x9'),'content':_0xab6f('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0xab6f('0xe'),'content':'','key':'Agent\x20Name','keyType':_0xab6f('0x5'),'variableName':_0xab6f('0x16')},{'type':_0xab6f('0xe'),'content':'','key':'Agent\x20Number','keyType':_0xab6f('0x5'),'variableName':_0xab6f('0xb')},{'type':_0xab6f('0x9'),'content':_0xab6f('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x18'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x19'),'keyType':_0xab6f('0x5'),'variableName':_0xab6f('0x1a')},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x1b'),'keyType':_0xab6f('0x5'),'variableName':'agentcompleteAt'},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x1c'),'keyType':'variable','variableName':_0xab6f('0x1d')},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x1e'),'keyType':_0xab6f('0x5'),'variableName':_0xab6f('0x1f')}];break;case'outbound':_0x599560=[{'type':_0xab6f('0x9'),'content':_0xab6f('0xd'),'variableName':null},{'type':'keyValue','content':'','key':_0xab6f('0x20'),'keyType':_0xab6f('0x5'),'keyContent':'','variableName':_0xab6f('0xb')},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x21'),'keyType':_0xab6f('0x5'),'keyContent':'','variableName':'membername'},{'type':_0xab6f('0xe'),'content':'','key':'UniqueId','keyType':'variable','keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':'Date','keyType':_0xab6f('0x5'),'keyContent':'','variableName':_0xab6f('0x22')},{'type':_0xab6f('0x9'),'content':_0xab6f('0x17')},{'type':_0xab6f('0xe'),'content':'','key':'Answer\x20Time','keyType':_0xab6f('0x5'),'keyContent':'','variableName':_0xab6f('0x23')},{'type':_0xab6f('0xe'),'content':'','key':_0xab6f('0x24'),'keyType':_0xab6f('0x5'),'keyContent':'','variableName':_0xab6f('0x25')},{'type':_0xab6f('0xe'),'content':'','key':'Duration','keyType':_0xab6f('0x5'),'keyContent':'','variableName':_0xab6f('0x26')},{'type':_0xab6f('0xe'),'content':'','key':'Billable\x20Time','keyType':_0xab6f('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x599560;}; \ No newline at end of file +var _0x087b=['push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Agent\x20Complete','Hold\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','answertime','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','toLowerCase','voice','inbound'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x087b,0x11a));var _0xb087=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x087b[_0x20a584];return _0x4b41a8;};'use strict';exports[_0xb087('0x0')]=function(_0x35e3d3,_0x556d8c){var _0x5f3606=[{'type':_0xb087('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x35e3d3[_0xb087('0x2')]()){case _0xb087('0x3'):switch(_0x556d8c[_0xb087('0x2')]()){case _0xb087('0x4'):_0x5f3606[_0xb087('0x5')]({'type':_0xb087('0x6'),'content':'','variableName':_0xb087('0x7')});_0x5f3606[_0xb087('0x5')]({'type':_0xb087('0x6'),'content':'','variableName':_0xb087('0x8')});break;case _0xb087('0x9'):_0x5f3606[_0xb087('0x5')]({'type':_0xb087('0x1'),'content':_0xb087('0xa'),'variableName':null});_0x5f3606[_0xb087('0x5')]({'type':_0xb087('0x6'),'content':'','variableName':_0xb087('0xb')});break;}}return _0x5f3606;};exports['getDescriptions']=function(_0x244abc,_0x108451){var _0x903a16=[];switch(_0x244abc[_0xb087('0x2')]()){case _0xb087('0x3'):switch(_0x108451[_0xb087('0x2')]()){case _0xb087('0x4'):_0x903a16=[{'type':'string','content':_0xb087('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xb087('0xd'),'content':'','key':_0xb087('0xe'),'keyType':'variable','variableName':_0xb087('0x8')},{'type':_0xb087('0xd'),'content':'','key':_0xb087('0xf'),'keyType':_0xb087('0x6'),'variableName':_0xb087('0x10')},{'type':_0xb087('0xd'),'content':'','key':_0xb087('0x11'),'keyType':_0xb087('0x6'),'variableName':_0xb087('0x12')},{'type':_0xb087('0xd'),'content':'','key':'Queue','keyType':_0xb087('0x6'),'variableName':_0xb087('0x7')},{'type':'keyValue','content':'','key':_0xb087('0x13'),'keyType':_0xb087('0x6'),'variableName':_0xb087('0x14')},{'type':'keyValue','content':'','key':_0xb087('0x15'),'keyType':_0xb087('0x6'),'variableName':_0xb087('0x16')},{'type':_0xb087('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xb087('0xd'),'content':'','key':_0xb087('0x17'),'keyType':_0xb087('0x6'),'variableName':_0xb087('0x18')},{'type':'keyValue','content':'','key':'Agent\x20Number','keyType':'variable','variableName':'destcalleridnum'},{'type':_0xb087('0x1'),'content':_0xb087('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xb087('0xd'),'content':'','key':_0xb087('0x1a'),'keyType':_0xb087('0x6'),'variableName':_0xb087('0x16')},{'type':_0xb087('0xd'),'content':'','key':'Agent\x20Connect','keyType':_0xb087('0x6'),'variableName':_0xb087('0x1b')},{'type':_0xb087('0xd'),'content':'','key':_0xb087('0x1c'),'keyType':_0xb087('0x6'),'variableName':'agentcompleteAt'},{'type':_0xb087('0xd'),'content':'','key':_0xb087('0x1d'),'keyType':'variable','variableName':'holdtime'},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0xb087('0x1e')}];break;case _0xb087('0x9'):_0x903a16=[{'type':_0xb087('0x1'),'content':_0xb087('0xc'),'variableName':null},{'type':_0xb087('0xd'),'content':'','key':_0xb087('0x1f'),'keyType':_0xb087('0x6'),'keyContent':'','variableName':_0xb087('0xb')},{'type':_0xb087('0xd'),'content':'','key':_0xb087('0x20'),'keyType':_0xb087('0x6'),'keyContent':'','variableName':_0xb087('0x21')},{'type':_0xb087('0xd'),'content':'','key':_0xb087('0x13'),'keyType':'variable','keyContent':'','variableName':_0xb087('0x14')},{'type':_0xb087('0xd'),'content':'','key':_0xb087('0x15'),'keyType':_0xb087('0x6'),'keyContent':'','variableName':_0xb087('0x22')},{'type':_0xb087('0x1'),'content':_0xb087('0x19')},{'type':_0xb087('0xd'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0xb087('0x23')},{'type':_0xb087('0xd'),'content':'','key':'Complete\x20Time','keyType':_0xb087('0x6'),'keyContent':'','variableName':_0xb087('0x24')},{'type':_0xb087('0xd'),'content':'','key':_0xb087('0x25'),'keyType':_0xb087('0x6'),'keyContent':'','variableName':_0xb087('0x26')},{'type':_0xb087('0xd'),'content':'','key':_0xb087('0x27'),'keyType':_0xb087('0x6'),'keyContent':'','variableName':_0xb087('0x28')}];break;}}return _0x903a16;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index aaaa1d6..ff6658b 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe46f=['then','info','catch','error','user','query','body','omit','html','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','Interaction','findOne'];(function(_0x40d8d7,_0x30dd5e){var _0x3454cc=function(_0x512c1b){while(--_0x512c1b){_0x40d8d7['push'](_0x40d8d7['shift']());}};_0x3454cc(++_0x30dd5e);}(_0xe46f,0x191));var _0xfe46=function(_0x102826,_0x35f7b9){_0x102826=_0x102826-0x0;var _0x57556e=_0xe46f[_0x102826];return _0x57556e;};'use strict';var _=require(_0xfe46('0x0'));var db=require(_0xfe46('0x1'))['db'];var loggers={'openchannel':require(_0xfe46('0x2'))(_0xfe46('0x3')),'mail':require('../../config/logger')(_0xfe46('0x4')),'fax':require(_0xfe46('0x2'))(_0xfe46('0x5')),'sms':require('../../config/logger')(_0xfe46('0x6')),'chat':require(_0xfe46('0x2'))(_0xfe46('0x7'))};function getInteractionId(_0x503d1f,_0x210dd1,_0x5c3b05){if(_0x503d1f&&_0x503d1f[_[_0xfe46('0x8')](_0x5c3b05)+_0xfe46('0x9')]){return _0x503d1f[_[_0xfe46('0x8')](_0x5c3b05)+'InteractionId'];}else if(_0x503d1f&&_0x503d1f['id']){return _0x503d1f['id'];}else if(_0x210dd1&&_0x210dd1['id']){return _0x210dd1['id'];}else{return _0xfe46('0xa');}}function log(_0xd06693,_0x3c87f2,_0x4f2379,_0x5b7b3f,_0x574883,_0x403fed){loggers[_0x574883[_0xfe46('0xb')]()][_0xd06693](_0xfe46('0xc'),_0x403fed[_0xfe46('0xd')](),_0x3c87f2?_0x3c87f2['id']:null,_0x3c87f2?_0x3c87f2[_0xfe46('0xe')]:null,_0x3c87f2?_0x3c87f2[_0xfe46('0xf')]:null,getInteractionId(_0x4f2379,_0x5b7b3f,_0x574883),_0x4f2379?JSON['stringify'](_0x4f2379):_0xfe46('0x10'));}function updateUser(_0x46b680,_0x3b8033,_0x40c098,_0xf29290,_0x1724b5){db[_['upperFirst'](_0xf29290)+_0xfe46('0x11')][_0xfe46('0x12')]({'where':{'id':getInteractionId(_0x3b8033,_0x40c098,_0xf29290)}})['then'](function(_0x2b94cd){if(_0x2b94cd){return _0x2b94cd['update']({'UserId':_0x46b680?_0x46b680['id']:null});}})[_0xfe46('0x13')](function(_0x235a9d){if(_0x235a9d){log(_0xfe46('0x14'),_0x46b680,_0x3b8033,_0x40c098,_0xf29290,_0x1724b5);}})[_0xfe46('0x15')](function(){log(_0xfe46('0x16'),_0x46b680,_0x3b8033,_0x40c098,_0xf29290,_0x1724b5);});}exports['tracked']=function(_0x565801,_0x1498e4){return function(_0x397349,_0x5ac047,_0x4edfa3){var _0x15e45b=_0x397349[_0xfe46('0x17')];var _0x1a772d={};var _0x2d8de6=_0x397349[_0xfe46('0x18')];if(_0x1a772d){_0x1a772d=_['clone'](_0x397349[_0xfe46('0x19')]);_0x1a772d=_[_0xfe46('0x1a')](_0x1a772d,[_0xfe46('0x19'),_0xfe46('0x1b'),'phone',_0xfe46('0x1c'),_0xfe46('0x1d')]);}updateUser(_0x15e45b,_0x1a772d,_0x2d8de6,_0x565801,_0x1498e4);_0x4edfa3(null);};}; \ No newline at end of file +var _0x9fc9=['phone','mobile','lodash','../../config/logger','openchannel-interactions','mail-interactions','chat-interactions','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','update','then','info','catch','tracked','user','query','clone','body'];(function(_0x1f194b,_0x27f748){var _0x3adb7e=function(_0x3acf84){while(--_0x3acf84){_0x1f194b['push'](_0x1f194b['shift']());}};_0x3adb7e(++_0x27f748);}(_0x9fc9,0x12e));var _0x99fc=function(_0x57474d,_0x23d835){_0x57474d=_0x57474d-0x0;var _0x12e6a5=_0x9fc9[_0x57474d];return _0x12e6a5;};'use strict';var _=require(_0x99fc('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x99fc('0x1'))(_0x99fc('0x2')),'mail':require(_0x99fc('0x1'))(_0x99fc('0x3')),'fax':require(_0x99fc('0x1'))('fax-interactions'),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0x99fc('0x1'))(_0x99fc('0x4'))};function getInteractionId(_0x1da2e5,_0x83bfbc,_0x5e9262){if(_0x1da2e5&&_0x1da2e5[_[_0x99fc('0x5')](_0x5e9262)+'InteractionId']){return _0x1da2e5[_[_0x99fc('0x5')](_0x5e9262)+'InteractionId'];}else if(_0x1da2e5&&_0x1da2e5['id']){return _0x1da2e5['id'];}else if(_0x83bfbc&&_0x83bfbc['id']){return _0x83bfbc['id'];}else{return _0x99fc('0x6');}}function log(_0x58b664,_0x855468,_0x571c91,_0x3ca2a3,_0x315aea,_0x56fbf6){loggers[_0x315aea[_0x99fc('0x7')]()][_0x58b664](_0x99fc('0x8'),_0x56fbf6[_0x99fc('0x9')](),_0x855468?_0x855468['id']:null,_0x855468?_0x855468[_0x99fc('0xa')]:null,_0x855468?_0x855468[_0x99fc('0xb')]:null,getInteractionId(_0x571c91,_0x3ca2a3,_0x315aea),_0x571c91?JSON[_0x99fc('0xc')](_0x571c91):'null');}function updateUser(_0xefe8d6,_0xc65b6a,_0x152dff,_0x5f3c11,_0x4a24b1){db[_[_0x99fc('0x5')](_0x5f3c11)+_0x99fc('0xd')]['findOne']({'where':{'id':getInteractionId(_0xc65b6a,_0x152dff,_0x5f3c11)}})['then'](function(_0x43e9b8){if(_0x43e9b8){return _0x43e9b8[_0x99fc('0xe')]({'UserId':_0xefe8d6?_0xefe8d6['id']:null});}})[_0x99fc('0xf')](function(_0x1e2e33){if(_0x1e2e33){log(_0x99fc('0x10'),_0xefe8d6,_0xc65b6a,_0x152dff,_0x5f3c11,_0x4a24b1);}})[_0x99fc('0x11')](function(){log('error',_0xefe8d6,_0xc65b6a,_0x152dff,_0x5f3c11,_0x4a24b1);});}exports[_0x99fc('0x12')]=function(_0x33c42b,_0x2afeb6){return function(_0x35664b,_0x1969c1,_0x3255f5){var _0x1c012d=_0x35664b[_0x99fc('0x13')];var _0x319272={};var _0x33dbe4=_0x35664b[_0x99fc('0x14')];if(_0x319272){_0x319272=_[_0x99fc('0x15')](_0x35664b[_0x99fc('0x16')]);_0x319272=_['omit'](_0x319272,[_0x99fc('0x16'),'html',_0x99fc('0x17'),'fax',_0x99fc('0x18')]);}updateUser(_0x1c012d,_0x319272,_0x33dbe4,_0x33c42b,_0x2afeb6);_0x3255f5(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 0011da4..9bb2595 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdb3=['findOne','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','split','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License'];(function(_0x764874,_0x3ed544){var _0x29f9d5=function(_0x152dad){while(--_0x152dad){_0x764874['push'](_0x764874['shift']());}};_0x29f9d5(++_0x3ed544);}(_0xfdb3,0x10d));var _0x3fdb=function(_0x1858f6,_0x62fdbb){_0x1858f6=_0x1858f6-0x0;var _0x1c3392=_0xfdb3[_0x1858f6];return _0x1c3392;};'use strict';var crypto=require(_0x3fdb('0x0'));var util=require(_0x3fdb('0x1'));var compose=require(_0x3fdb('0x2'));var db=require(_0x3fdb('0x3'))['db'];var config=require(_0x3fdb('0x4'));function getValueFromLicense(_0x33552e,_0x46225a){if(_0x33552e&&_0x46225a){if(_0x46225a[_0x3fdb('0x5')]&&_0x46225a['license']){var _0x4fbb71=_0x46225a[_0x3fdb('0x5')];var _0x3f1492=_0x46225a['license'];var _0x1fbdf5=_0x4fbb71['split']('-')[0x4];var _0x34c638=_0x4fbb71[_0x3fdb('0x6')]('-')[0x0];var _0x49b986=crypto['createDecipher']('aes-256-ctr',util[_0x3fdb('0x7')](_0x3fdb('0x8'),_0x1fbdf5,_0x4fbb71,_0x34c638));var _0x45a9a4=_0x49b986[_0x3fdb('0x9')](_0x3f1492,_0x3fdb('0xa'),_0x3fdb('0xb'));_0x45a9a4+=_0x49b986[_0x3fdb('0xc')](_0x3fdb('0xb'));var _0x146399=JSON[_0x3fdb('0xd')](_0x45a9a4);return _0x146399[_0x3fdb('0xe')](_0x33552e)?_0x146399[_0x33552e]:null;}}return null;}function isLimit(_0x246104,_0x28c7de,_0x2244ce,_0x284c8f){var _0x64f9d=_0x28c7de;return compose()[_0x3fdb('0xf')](function(_0x4d3902,_0x218b33,_0x5cd4e9){return db[_0x3fdb('0x10')][_0x3fdb('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x3fdb('0x12')](function(_0x44ee75){var _0x173062=getValueFromLicense(_0x246104,_0x44ee75);return _0x173062?_0x173062:_0x64f9d;})['then'](function(_0x46ac0e){_0x64f9d=_0x46ac0e;return _0x2244ce[_0x3fdb('0x13')](_0x284c8f);})['then'](function(_0x3444e7){if(_0x3444e7>=_0x64f9d){return _0x218b33['status'](0x193)[_0x3fdb('0x14')]({'message':util['format'](_0x3fdb('0x15'),_0x246104)});}_0x5cd4e9();})[_0x3fdb('0x16')](function(_0x10ef06){_0x5cd4e9(_0x10ef06);});});}function isUserLimit(){return isLimit(_0x3fdb('0x17'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x3fdb('0x18')}]}});}exports[_0x3fdb('0x19')]=isUserLimit; \ No newline at end of file +var _0x83cc=['data1','license','split','createDecipher','format','%s:%s:%s','update','base64','final','parse','hasOwnProperty','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','isUserLimit','util'];(function(_0x73e4cf,_0x2a8375){var _0x1e1bf8=function(_0xca0967){while(--_0xca0967){_0x73e4cf['push'](_0x73e4cf['shift']());}};_0x1e1bf8(++_0x2a8375);}(_0x83cc,0x18f));var _0xc83c=function(_0x5a4b16,_0x294bb1){_0x5a4b16=_0x5a4b16-0x0;var _0x5236dc=_0x83cc[_0x5a4b16];return _0x5236dc;};'use strict';var crypto=require('crypto');var util=require(_0xc83c('0x0'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x3c5d5f,_0x491eea){if(_0x3c5d5f&&_0x491eea){if(_0x491eea[_0xc83c('0x1')]&&_0x491eea['license']){var _0x975cc6=_0x491eea[_0xc83c('0x1')];var _0x704329=_0x491eea[_0xc83c('0x2')];var _0x31f40a=_0x975cc6['split']('-')[0x4];var _0x1aca76=_0x975cc6[_0xc83c('0x3')]('-')[0x0];var _0x44a043=crypto[_0xc83c('0x4')]('aes-256-ctr',util[_0xc83c('0x5')](_0xc83c('0x6'),_0x31f40a,_0x975cc6,_0x1aca76));var _0x3a4af4=_0x44a043[_0xc83c('0x7')](_0x704329,_0xc83c('0x8'),'utf8');_0x3a4af4+=_0x44a043[_0xc83c('0x9')]('utf8');var _0x551a42=JSON[_0xc83c('0xa')](_0x3a4af4);return _0x551a42[_0xc83c('0xb')](_0x3c5d5f)?_0x551a42[_0x3c5d5f]:null;}}return null;}function isLimit(_0x1bd543,_0x5859b2,_0xc1f76a,_0x3f1054){var _0x548887=_0x5859b2;return compose()['use'](function(_0x3ef3c5,_0x280bb7,_0x304202){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0xc83c('0xc')](function(_0x362fa8){var _0x347e7e=getValueFromLicense(_0x1bd543,_0x362fa8);return _0x347e7e?_0x347e7e:_0x548887;})[_0xc83c('0xc')](function(_0x8fbec7){_0x548887=_0x8fbec7;return _0xc1f76a['count'](_0x3f1054);})[_0xc83c('0xc')](function(_0x22245a){if(_0x22245a>=_0x548887){return _0x280bb7[_0xc83c('0xd')](0x193)[_0xc83c('0xe')]({'message':util['format'](_0xc83c('0xf'),_0x1bd543)});}_0x304202();})[_0xc83c('0x10')](function(_0x37da36){_0x304202(_0x37da36);});});}function isUserLimit(){return isLimit(_0xc83c('0x11'),0x1,db['User'],{'where':{'$or':[{'role':_0xc83c('0x12')},{'role':'user'}]}});}exports[_0xc83c('0x13')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 07b4d5f..775d75f 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 _0xa841=['$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','utcOffset','format','hours','minutes','seconds','lodash','moment','parseSearch','startsWith','[$or]','and','[$and]','length','split','slice','shift','forEach','filter','indexOf','map','conditions','push','buildExpression','DATE','$eq','$between','value','includes','$gt','$lte','operator','days','YYYY-MM-DD','castTo','text','CAST(','field','$notIn','\x20OR\x20','\x20IS\x20NULL)','NOT\x20IN\x20?','$startsWith'];(function(_0xdcda3,_0x4252fb){var _0x2bec82=function(_0x589fe2){while(--_0x589fe2){_0xdcda3['push'](_0xdcda3['shift']());}};_0x2bec82(++_0x4252fb);}(_0xa841,0x147));var _0x1a84=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa841[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x1a84('0x0'));var moment=require(_0x1a84('0x1'));exports[_0x1a84('0x2')]=function(_0xf7b698){var _0x20115a={'conditions':[]};_0x20115a['sqlOperator']=_[_0x1a84('0x3')](_0xf7b698,_0x1a84('0x4'))?'or':_0x1a84('0x5');var _0x4bffb3=_0xf7b698['replace'](_0x1a84('0x6'),'')['replace']('[$or]','')['split']('||');for(var _0x1df5a9=0x0;_0x1df5a9<_0x4bffb3[_0x1a84('0x7')];_0x1df5a9++){var _0x11119e=_0x4bffb3[_0x1df5a9][_0x1a84('0x8')](':=');var _0x54d6eb=_0x11119e[0x0];var _0x2bea4c=_0x11119e[_0x1a84('0x9')](0x1);_0x2bea4c['forEach'](function(_0x5b5877){var _0x54482d=_0x5b5877[_0x1a84('0x8')]('[')[_0x1a84('0xa')]();var _0x590b83=_0x5b5877['match'](/\[(.*?)\]/g);_0x590b83[_0x1a84('0xb')](function(_0x495d78){var _0x4b792a=_0x495d78[_0x1a84('0x8')]('[')[_0x1a84('0xc')](function(_0x51cf5d){return _0x51cf5d[_0x1a84('0xd')](']')>-0x1;})[_0x1a84('0xe')](function(_0x2c59ca){return _0x2c59ca[_0x1a84('0x8')](']')[0x0];})[0x0];_0x20115a[_0x1a84('0xf')][_0x1a84('0x10')]({'field':_0x54d6eb,'operator':_0x54482d,'value':_0x4b792a});});});}return _0x20115a;};exports[_0x1a84('0x11')]=function(_0x5efcd3,_0x3fbde6,_0x461f5a){var _0x30b1c1={};if(_0x3fbde6===_0x1a84('0x12')){if(_0x461f5a['operator']===_0x1a84('0x13')){_0x461f5a['operator']=_0x1a84('0x14');_0x461f5a[_0x1a84('0x15')]+=','+_0x461f5a[_0x1a84('0x15')];}else if(_[_0x1a84('0x16')]([_0x1a84('0x17'),_0x1a84('0x18')],_0x461f5a[_0x1a84('0x19')])){_0x461f5a[_0x1a84('0x15')]=moment(_0x461f5a[_0x1a84('0x15')])['add'](0x1,_0x1a84('0x1a'))['format'](_0x1a84('0x1b'));}}if(_0x461f5a[_0x1a84('0x1c')]){_0x3fbde6=_0x461f5a['castTo'];_0x30b1c1[_0x1a84('0x1d')]=_0x1a84('0x1e')+_0x5efcd3+'.'+_0x461f5a[_0x1a84('0x1f')]+'\x20AS\x20'+_0x461f5a[_0x1a84('0x1c')]+')\x20'+parseOperator(_0x461f5a[_0x1a84('0x19')]);}else{_0x30b1c1['text']=_0x5efcd3+'.'+_0x461f5a['field']+'\x20'+parseOperator(_0x461f5a[_0x1a84('0x19')]);}if(_['includes'](['$ne',_0x1a84('0x20')],_0x461f5a[_0x1a84('0x19')]))_0x30b1c1['text']='('+_0x30b1c1[_0x1a84('0x1d')]+_0x1a84('0x21')+_0x5efcd3+'.'+_0x461f5a[_0x1a84('0x1f')]+_0x1a84('0x22');_0x30b1c1['value']=parseValue(_0x3fbde6,_0x461f5a['operator'],_0x461f5a['value']);return _0x30b1c1;};function parseOperator(_0x306596){var _0x480380;switch(_0x306596){case'$in':_0x480380='IN\x20?';break;case _0x1a84('0x20'):_0x480380=_0x1a84('0x23');break;case'$eq':_0x480380='=\x20?';break;case'$ne':_0x480380='<>\x20?';break;case'$substring':case _0x1a84('0x24'):case _0x1a84('0x25'):_0x480380=_0x1a84('0x26');break;case _0x1a84('0x27'):_0x480380=_0x1a84('0x28');break;case'$gt':_0x480380=_0x1a84('0x29');break;case _0x1a84('0x18'):_0x480380=_0x1a84('0x2a');break;case'$gte':_0x480380='>=\x20?';break;case _0x1a84('0x14'):_0x480380=_0x1a84('0x2b');break;}return _0x480380;}function parseValue(_0x91e53,_0x227e96,_0x3803fb){var _0x25c953={'start':undefined,'end':undefined};switch(_0x227e96){case'$in':case'$notIn':_0x25c953[_0x1a84('0x2c')]=_0x3803fb['split'](',');break;case _0x1a84('0x2d'):_0x25c953[_0x1a84('0x2c')]='%'+_0x3803fb+'%';break;case'$startsWith':_0x25c953[_0x1a84('0x2c')]=_0x3803fb+'%';break;case _0x1a84('0x25'):_0x25c953['start']='%'+_0x3803fb;break;case'$between':var _0x44edef=_0x3803fb[_0x1a84('0x8')](',');var _0x3803fb=_0x44edef[_0x1a84('0xa')]();var _0x26d2d1=_0x44edef[_0x1a84('0x2e')]();if(_0x91e53===_0x1a84('0x12')){_0x3803fb=moment(_0x3803fb)[_0x1a84('0x2f')](0x0,!![])[_0x1a84('0x30')]();_0x26d2d1=moment(_0x26d2d1)[_0x1a84('0x2f')](0x0,!![])['add'](0x17,_0x1a84('0x31'))['add'](0x3b,_0x1a84('0x32'))['add'](0x3b,_0x1a84('0x33'))[_0x1a84('0x30')]();}_0x25c953={'start':_0x3803fb,'end':_0x26d2d1};break;default:_0x25c953[_0x1a84('0x2c')]=_0x3803fb;break;}return _0x25c953;} \ No newline at end of file +var _0xcd7a=['<\x20?','$gt','>\x20?','$lte','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','utcOffset','format','hours','minutes','lodash','parseSearch','startsWith','[$or]','and','replace','split','length','slice','forEach','shift','indexOf','map','conditions','push','buildExpression','operator','$eq','$between','value','includes','add','days','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','=\x20?','$startsWith','$endsWith'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xcd7a,0x1ec));var _0xacd7=function(_0x165c16,_0x530eb9){_0x165c16=_0x165c16-0x0;var _0x1cf2fa=_0xcd7a[_0x165c16];return _0x1cf2fa;};'use strict';var _=require(_0xacd7('0x0'));var moment=require('moment');exports[_0xacd7('0x1')]=function(_0x15d987){var _0x5b71db={'conditions':[]};_0x5b71db['sqlOperator']=_[_0xacd7('0x2')](_0x15d987,_0xacd7('0x3'))?'or':_0xacd7('0x4');var _0x3ae8f0=_0x15d987[_0xacd7('0x5')]('[$and]','')[_0xacd7('0x5')](_0xacd7('0x3'),'')[_0xacd7('0x6')]('||');for(var _0x172ff2=0x0;_0x172ff2<_0x3ae8f0[_0xacd7('0x7')];_0x172ff2++){var _0x58e021=_0x3ae8f0[_0x172ff2]['split'](':=');var _0x34dbd9=_0x58e021[0x0];var _0x292872=_0x58e021[_0xacd7('0x8')](0x1);_0x292872[_0xacd7('0x9')](function(_0x178336){var _0x5f329e=_0x178336[_0xacd7('0x6')]('[')[_0xacd7('0xa')]();var _0x30359c=_0x178336['match'](/\[(.*?)\]/g);_0x30359c[_0xacd7('0x9')](function(_0x82754a){var _0x1f7dee=_0x82754a[_0xacd7('0x6')]('[')['filter'](function(_0x3cd879){return _0x3cd879[_0xacd7('0xb')](']')>-0x1;})[_0xacd7('0xc')](function(_0xb5d8be){return _0xb5d8be[_0xacd7('0x6')](']')[0x0];})[0x0];_0x5b71db[_0xacd7('0xd')][_0xacd7('0xe')]({'field':_0x34dbd9,'operator':_0x5f329e,'value':_0x1f7dee});});});}return _0x5b71db;};exports[_0xacd7('0xf')]=function(_0x5589de,_0x19a189,_0x4f433a){var _0x40d9c3={};if(_0x19a189==='DATE'){if(_0x4f433a[_0xacd7('0x10')]===_0xacd7('0x11')){_0x4f433a[_0xacd7('0x10')]=_0xacd7('0x12');_0x4f433a[_0xacd7('0x13')]+=','+_0x4f433a[_0xacd7('0x13')];}else if(_[_0xacd7('0x14')](['$gt','$lte'],_0x4f433a[_0xacd7('0x10')])){_0x4f433a[_0xacd7('0x13')]=moment(_0x4f433a[_0xacd7('0x13')])[_0xacd7('0x15')](0x1,_0xacd7('0x16'))['format'](_0xacd7('0x17'));}}if(_0x4f433a['castTo']){_0x19a189=_0x4f433a[_0xacd7('0x18')];_0x40d9c3[_0xacd7('0x19')]=_0xacd7('0x1a')+_0x5589de+'.'+_0x4f433a[_0xacd7('0x1b')]+'\x20AS\x20'+_0x4f433a['castTo']+')\x20'+parseOperator(_0x4f433a[_0xacd7('0x10')]);}else{_0x40d9c3[_0xacd7('0x19')]=_0x5589de+'.'+_0x4f433a[_0xacd7('0x1b')]+'\x20'+parseOperator(_0x4f433a['operator']);}if(_[_0xacd7('0x14')]([_0xacd7('0x1c'),_0xacd7('0x1d')],_0x4f433a[_0xacd7('0x10')]))_0x40d9c3[_0xacd7('0x19')]='('+_0x40d9c3[_0xacd7('0x19')]+_0xacd7('0x1e')+_0x5589de+'.'+_0x4f433a[_0xacd7('0x1b')]+_0xacd7('0x1f');_0x40d9c3['value']=parseValue(_0x19a189,_0x4f433a[_0xacd7('0x10')],_0x4f433a['value']);return _0x40d9c3;};function parseOperator(_0x4976a4){var _0x4b273e;switch(_0x4976a4){case _0xacd7('0x20'):_0x4b273e='IN\x20?';break;case _0xacd7('0x1d'):_0x4b273e='NOT\x20IN\x20?';break;case _0xacd7('0x11'):_0x4b273e=_0xacd7('0x21');break;case _0xacd7('0x1c'):_0x4b273e='<>\x20?';break;case'$substring':case _0xacd7('0x22'):case _0xacd7('0x23'):_0x4b273e='LIKE\x20?';break;case'$lt':_0x4b273e=_0xacd7('0x24');break;case _0xacd7('0x25'):_0x4b273e=_0xacd7('0x26');break;case _0xacd7('0x27'):_0x4b273e='<=\x20?';break;case'$gte':_0x4b273e='>=\x20?';break;case _0xacd7('0x12'):_0x4b273e=_0xacd7('0x28');break;}return _0x4b273e;}function parseValue(_0x919ac7,_0x53f4d2,_0x274bf3){var _0x597f92={'start':undefined,'end':undefined};switch(_0x53f4d2){case _0xacd7('0x20'):case _0xacd7('0x1d'):_0x597f92[_0xacd7('0x29')]=_0x274bf3[_0xacd7('0x6')](',');break;case _0xacd7('0x2a'):_0x597f92['start']='%'+_0x274bf3+'%';break;case _0xacd7('0x22'):_0x597f92[_0xacd7('0x29')]=_0x274bf3+'%';break;case _0xacd7('0x23'):_0x597f92['start']='%'+_0x274bf3;break;case'$between':var _0x3f39b7=_0x274bf3[_0xacd7('0x6')](',');var _0x274bf3=_0x3f39b7['shift']();var _0x458f19=_0x3f39b7[_0xacd7('0x2b')]();if(_0x919ac7==='DATE'){_0x274bf3=moment(_0x274bf3)[_0xacd7('0x2c')](0x0,!![])[_0xacd7('0x2d')]();_0x458f19=moment(_0x458f19)[_0xacd7('0x2c')](0x0,!![])[_0xacd7('0x15')](0x17,_0xacd7('0x2e'))[_0xacd7('0x15')](0x3b,_0xacd7('0x2f'))[_0xacd7('0x15')](0x3b,'seconds')[_0xacd7('0x2d')]();}_0x597f92={'start':_0x274bf3,'end':_0x458f19};break;default:_0x597f92[_0xacd7('0x29')]=_0x274bf3;break;}return _0x597f92;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index bcf201d..5d501ec 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 _0xcc01=['sequelize','split','filters','isEmpty','forOwn','isArray','parse','limit','indexOf','priority','substr','DESC','cast','col','unsigned','ASC','length','isObject','isString','unset','hasOwnProperty','^[0-9]*$','isEmail','match','getFullTextValue','lodash'];(function(_0x505b26,_0x5462d7){var _0x13c115=function(_0x53dd0e){while(--_0x53dd0e){_0x505b26['push'](_0x505b26['shift']());}};_0x13c115(++_0x5462d7);}(_0xcc01,0x137));var _0x1cc0=function(_0x42b89a,_0x5842f4){_0x42b89a=_0x42b89a-0x0;var _0x33e70d=_0xcc01[_0x42b89a];return _0x33e70d;};'use strict';var _=require(_0x1cc0('0x0'));var sequelize=require(_0x1cc0('0x1'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x3705b2){var _0x204409=null;if(_0x3705b2){_0x204409=_0x3705b2[_0x1cc0('0x2')](',');}return _0x204409;};exports[_0x1cc0('0x3')]=function(_0x5b72c4){var _0x195ced={};if(!_[_0x1cc0('0x4')](_0x5b72c4)){_0x195ced={};_[_0x1cc0('0x5')](_0x5b72c4,function(_0x144cd5,_0x1815e0){try{_0x195ced[_0x1815e0]=_[_0x1cc0('0x6')](_0x144cd5)?_0x144cd5:JSON[_0x1cc0('0x7')](_0x144cd5);}catch(_0x5550ce){_0x195ced[_0x1815e0]=_0x144cd5[_0x1cc0('0x2')](',');}});}return _0x195ced;};exports[_0x1cc0('0x8')]=function(_0x15277f){_0x15277f=parseInt(_0x15277f,0xa);if(!_0x15277f||_0x15277f<0x0){_0x15277f=LIMIT_VALUE;}return _0x15277f;};exports['offset']=function(_0x59663f){_0x59663f=parseInt(_0x59663f,0xa);if(!_0x59663f||_0x59663f<0x0){_0x59663f=0x0;}return _0x59663f;};exports['sort']=function(_0x3acec6){var _0x317fb8,_0x4938cd=null;if(_0x3acec6){_0x317fb8=_0x3acec6[_0x1cc0('0x2')](',');_0x4938cd=_['map'](_0x317fb8,function(_0x3712a2){if(_0x3712a2[_0x1cc0('0x9')]('-')===0x0){return[_0x3712a2==='priority'?sequelize['cast'](sequelize['col'](_0x1cc0('0xa')),'unsigned'):_0x3712a2[_0x1cc0('0xb')](0x1),_0x1cc0('0xc')];}else{return[_0x3712a2===_0x1cc0('0xa')?sequelize[_0x1cc0('0xd')](sequelize[_0x1cc0('0xe')](_0x1cc0('0xa')),_0x1cc0('0xf')):_0x3712a2,_0x1cc0('0x10')];}});}return _0x4938cd;};exports['omit']=function(_0x2893a2,_0x167cfd){if(_[_0x1cc0('0x4')](_0x2893a2)){return _0x2893a2;}if(_[_0x1cc0('0x6')](_0x2893a2)){for(var _0x2389ed=0x0;_0x2389ed<_0x2893a2[_0x1cc0('0x11')];_0x2389ed+=0x1){_0x2893a2[_0x2389ed]=this['omit'](_0x2893a2[_0x2389ed],_0x167cfd);}return _0x2893a2;}if(!_[_0x1cc0('0x12')](_0x2893a2)){return _0x2893a2;}if(_[_0x1cc0('0x13')](_0x167cfd)){_0x167cfd=[_0x167cfd];}if(!_[_0x1cc0('0x6')](_0x167cfd)){return _0x2893a2;}for(var _0x4ec3dd=0x0;_0x4ec3dd<_0x167cfd[_0x1cc0('0x11')];_0x4ec3dd+=0x1){_[_0x1cc0('0x14')](_0x2893a2,_0x167cfd[_0x4ec3dd]);}for(var _0x1545dc in _0x2893a2){if(_0x2893a2[_0x1cc0('0x15')](_0x1545dc)){_0x2893a2[_0x1545dc]=this['omit'](_0x2893a2[_0x1545dc],_0x167cfd);}}return _0x2893a2;};exports['isNumeric']=function(_0x13bc3c){return _0x13bc3c['match'](RegExp(_0x1cc0('0x16')))?!![]:![];};exports[_0x1cc0('0x17')]=function(_0x1bf530){return _0x1bf530[_0x1cc0('0x18')](/^\S+@\S+$/)?!![]:![];};exports[_0x1cc0('0x19')]=function(_0x2d5365){var _0x582963=[];_0x2d5365[_0x1cc0('0x2')]('\x20')['forEach'](function(_0x4d2aff){_0x582963['push']('+'+_0x4d2aff['toString']()+'*');});return _0x582963['join']('\x20');}; \ No newline at end of file +var _0x4481=['toString','join','lodash','sequelize','fields','split','isEmpty','forOwn','isArray','limit','sort','map','indexOf','priority','col','unsigned','substr','DESC','cast','omit','isObject','isString','unset','hasOwnProperty','isNumeric','^[0-9]*$','isEmail','getFullTextValue','forEach','push'];(function(_0xbe7405,_0x1de012){var _0x2bcd7f=function(_0x48ceb7){while(--_0x48ceb7){_0xbe7405['push'](_0xbe7405['shift']());}};_0x2bcd7f(++_0x1de012);}(_0x4481,0x12e));var _0x1448=function(_0x55c119,_0x13a4c8){_0x55c119=_0x55c119-0x0;var _0x2e8994=_0x4481[_0x55c119];return _0x2e8994;};'use strict';var _=require(_0x1448('0x0'));var sequelize=require(_0x1448('0x1'));var LIMIT_VALUE=0xfa;exports[_0x1448('0x2')]=function(_0x8767ee){var _0x4cdd44=null;if(_0x8767ee){_0x4cdd44=_0x8767ee[_0x1448('0x3')](',');}return _0x4cdd44;};exports['filters']=function(_0x396d73){var _0x175536={};if(!_[_0x1448('0x4')](_0x396d73)){_0x175536={};_[_0x1448('0x5')](_0x396d73,function(_0xd87c85,_0x41112f){try{_0x175536[_0x41112f]=_[_0x1448('0x6')](_0xd87c85)?_0xd87c85:JSON['parse'](_0xd87c85);}catch(_0x2565ea){_0x175536[_0x41112f]=_0xd87c85[_0x1448('0x3')](',');}});}return _0x175536;};exports[_0x1448('0x7')]=function(_0x327485){_0x327485=parseInt(_0x327485,0xa);if(!_0x327485||_0x327485<0x0){_0x327485=LIMIT_VALUE;}return _0x327485;};exports['offset']=function(_0x54e0ae){_0x54e0ae=parseInt(_0x54e0ae,0xa);if(!_0x54e0ae||_0x54e0ae<0x0){_0x54e0ae=0x0;}return _0x54e0ae;};exports[_0x1448('0x8')]=function(_0x89a894){var _0x425143,_0x73fbc9=null;if(_0x89a894){_0x425143=_0x89a894[_0x1448('0x3')](',');_0x73fbc9=_[_0x1448('0x9')](_0x425143,function(_0x48815c){if(_0x48815c[_0x1448('0xa')]('-')===0x0){return[_0x48815c===_0x1448('0xb')?sequelize['cast'](sequelize[_0x1448('0xc')]('priority'),_0x1448('0xd')):_0x48815c[_0x1448('0xe')](0x1),_0x1448('0xf')];}else{return[_0x48815c===_0x1448('0xb')?sequelize[_0x1448('0x10')](sequelize[_0x1448('0xc')](_0x1448('0xb')),_0x1448('0xd')):_0x48815c,'ASC'];}});}return _0x73fbc9;};exports[_0x1448('0x11')]=function(_0x212415,_0x161e42){if(_['isEmpty'](_0x212415)){return _0x212415;}if(_[_0x1448('0x6')](_0x212415)){for(var _0x4472e9=0x0;_0x4472e9<_0x212415['length'];_0x4472e9+=0x1){_0x212415[_0x4472e9]=this[_0x1448('0x11')](_0x212415[_0x4472e9],_0x161e42);}return _0x212415;}if(!_[_0x1448('0x12')](_0x212415)){return _0x212415;}if(_[_0x1448('0x13')](_0x161e42)){_0x161e42=[_0x161e42];}if(!_['isArray'](_0x161e42)){return _0x212415;}for(var _0x29a33c=0x0;_0x29a33c<_0x161e42['length'];_0x29a33c+=0x1){_[_0x1448('0x14')](_0x212415,_0x161e42[_0x29a33c]);}for(var _0x546ff0 in _0x212415){if(_0x212415[_0x1448('0x15')](_0x546ff0)){_0x212415[_0x546ff0]=this[_0x1448('0x11')](_0x212415[_0x546ff0],_0x161e42);}}return _0x212415;};exports[_0x1448('0x16')]=function(_0x3666e1){return _0x3666e1['match'](RegExp(_0x1448('0x17')))?!![]:![];};exports[_0x1448('0x18')]=function(_0x3c2410){return _0x3c2410['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x1448('0x19')]=function(_0x24ef69){var _0x69f11c=[];_0x24ef69['split']('\x20')[_0x1448('0x1a')](function(_0x2aafa8){_0x69f11c[_0x1448('0x1b')]('+'+_0x2aafa8[_0x1448('0x1c')]()+'*');});return _0x69f11c[_0x1448('0x1d')]('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 31e9db7..0df7ef8 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a43=['set','appPath','join','client','toISOString','split','use','static','views','engine','html','ejs','renderFile','urlencoded','50mb','json','initialize','express','serve-favicon','method-override','cookie-parser','cors','moment','default','get','production','root','public','development'];(function(_0x3ba365,_0x4b62b4){var _0x1c7bc3=function(_0x12defd){while(--_0x12defd){_0x3ba365['push'](_0x3ba365['shift']());}};_0x1c7bc3(++_0x4b62b4);}(_0x8a43,0x1e1));var _0x38a4=function(_0x5b9e4a,_0x1cbcb6){_0x5b9e4a=_0x5b9e4a-0x0;var _0x213f8e=_0x8a43[_0x5b9e4a];return _0x213f8e;};'use strict';var express=require(_0x38a4('0x0'));var favicon=require(_0x38a4('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0x38a4('0x2'));var cookieParser=require(_0x38a4('0x3'));var errorHandler=require('errorhandler');var path=require('path');var passport=require('passport');var cors=require(_0x38a4('0x4'));var moment=require(_0x38a4('0x5'));var config=require('./environment');var db=require('../mysqldb')['db'];exports[_0x38a4('0x6')]=function(_0x13494f){var _0x38827d=_0x13494f[_0x38a4('0x7')]('env');if(_0x38827d===_0x38a4('0x8')){_0x13494f['set']('appPath',path['join'](config[_0x38a4('0x9')],_0x38a4('0xa')));}if(_0x38827d===_0x38a4('0xb')||_0x38827d==='test'){_0x13494f[_0x38a4('0xc')](_0x38a4('0xd'),path[_0x38a4('0xe')](config[_0x38a4('0x9')],_0x38a4('0xf')));_0x13494f['use'](errorHandler());}_0x13494f[_0x38a4('0xc')]('json\x20replacer',function(_0x4b5e70,_0x574780){if(this[_0x4b5e70]instanceof Date){_0x574780=this[_0x4b5e70][_0x38a4('0x10')]()[_0x38a4('0x11')]('.')[0x0]+'Z';}return _0x574780;});_0x13494f[_0x38a4('0x12')](express[_0x38a4('0x13')](_0x13494f[_0x38a4('0x7')](_0x38a4('0xd'))));_0x13494f[_0x38a4('0xc')](_0x38a4('0x14'),config[_0x38a4('0x9')]+'/server/views');_0x13494f[_0x38a4('0x15')](_0x38a4('0x16'),require(_0x38a4('0x17'))[_0x38a4('0x18')]);_0x13494f[_0x38a4('0xc')]('view\x20engine',_0x38a4('0x16'));_0x13494f[_0x38a4('0x12')](bodyParser[_0x38a4('0x19')]({'limit':_0x38a4('0x1a'),'extended':!![]}));_0x13494f[_0x38a4('0x12')](bodyParser[_0x38a4('0x1b')]({'limit':_0x38a4('0x1a')}));_0x13494f['use'](cors());_0x13494f[_0x38a4('0x12')](methodOverride());_0x13494f['use'](cookieParser());_0x13494f[_0x38a4('0x12')](passport[_0x38a4('0x1c')]());}; \ No newline at end of file +var _0x560b=['json','initialize','express','body-parser','method-override','errorhandler','cors','./environment','../mysqldb','default','get','join','public','development','test','set','appPath','root','client','use','split','static','views','/server/views','engine','ejs','view\x20engine','urlencoded','50mb'];(function(_0x5726f1,_0x16d724){var _0x176d6b=function(_0x338f2e){while(--_0x338f2e){_0x5726f1['push'](_0x5726f1['shift']());}};_0x176d6b(++_0x16d724);}(_0x560b,0x15e));var _0xb560=function(_0x20152f,_0xe2ef93){_0x20152f=_0x20152f-0x0;var _0x1a83d5=_0x560b[_0x20152f];return _0x1a83d5;};'use strict';var express=require(_0xb560('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0xb560('0x1'));var methodOverride=require(_0xb560('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xb560('0x3'));var path=require('path');var passport=require('passport');var cors=require(_0xb560('0x4'));var moment=require('moment');var config=require(_0xb560('0x5'));var db=require(_0xb560('0x6'))['db'];exports[_0xb560('0x7')]=function(_0x552753){var _0x348b37=_0x552753[_0xb560('0x8')]('env');if(_0x348b37==='production'){_0x552753['set']('appPath',path[_0xb560('0x9')](config['root'],_0xb560('0xa')));}if(_0x348b37===_0xb560('0xb')||_0x348b37===_0xb560('0xc')){_0x552753[_0xb560('0xd')](_0xb560('0xe'),path[_0xb560('0x9')](config[_0xb560('0xf')],_0xb560('0x10')));_0x552753[_0xb560('0x11')](errorHandler());}_0x552753[_0xb560('0xd')]('json\x20replacer',function(_0x44a7b7,_0x966252){if(this[_0x44a7b7]instanceof Date){_0x966252=this[_0x44a7b7]['toISOString']()[_0xb560('0x12')]('.')[0x0]+'Z';}return _0x966252;});_0x552753['use'](express[_0xb560('0x13')](_0x552753[_0xb560('0x8')](_0xb560('0xe'))));_0x552753['set'](_0xb560('0x14'),config[_0xb560('0xf')]+_0xb560('0x15'));_0x552753[_0xb560('0x16')]('html',require(_0xb560('0x17'))['renderFile']);_0x552753[_0xb560('0xd')](_0xb560('0x18'),'html');_0x552753['use'](bodyParser[_0xb560('0x19')]({'limit':_0xb560('0x1a'),'extended':!![]}));_0x552753[_0xb560('0x11')](bodyParser[_0xb560('0x1b')]({'limit':'50mb'}));_0x552753[_0xb560('0x11')](cors());_0x552753[_0xb560('0x11')](methodOverride());_0x552753['use'](cookieParser());_0x552753[_0xb560('0x11')](passport[_0xb560('0x1c')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index ed6e9e2..678ffc6 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 _0x975f=['address','127.0.0.1','getFirstInterface','map','join','createHash','md5','update','digest','hex','getUuid','win32','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','execSync','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00'];(function(_0x3eecf2,_0x444f6a){var _0x8c26ba=function(_0x45a25d){while(--_0x45a25d){_0x3eecf2['push'](_0x3eecf2['shift']());}};_0x8c26ba(++_0x444f6a);}(_0x975f,0x109));var _0xf975=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0x975f[_0x61b3ab];return _0x57097f;};'use strict';var _=require(_0xf975('0x0'));var os=require('os');var crypto=require(_0xf975('0x1'));var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0xf975('0x2')];function getInterfaces(){var _0x274f21=[];var _0x556f63=os[_0xf975('0x3')]();var _0x2d047c=_[_0xf975('0x4')](_[_0xf975('0x5')](_0x556f63));for(var _0x4a3199=0x0;_0x4a3199<_0x2d047c[_0xf975('0x6')];_0x4a3199++){var _0x5a9aca=_0x556f63[_0x2d047c[_0x4a3199]][_0xf975('0x7')](function(_0x2018ea){return _0x2018ea['family']===_0xf975('0x8')&&_0x2018ea[_0xf975('0x9')]===![];});_0x274f21=_0x274f21[_0xf975('0xa')](_0x5a9aca);}return _0x274f21;}function getFirstInterface(){var _0x53dc00=_[_0xf975('0xb')](getInterfaces());return{'macAddress':_0x53dc00&&_0x53dc00[_0xf975('0xc')]?_0x53dc00['mac']:_0xf975('0xd'),'ipAddress':_0x53dc00&&_0x53dc00[_0xf975('0xe')]?_0x53dc00[_0xf975('0xe')]:_0xf975('0xf')};}exports[_0xf975('0x10')]=getFirstInterface;function getCPUhash(){var _0x22f122=_[_0xf975('0x4')](os['cpus']()[_0xf975('0x11')](function(_0x34111a){return _0x34111a['model'];}))[_0xf975('0x12')](':');return crypto[_0xf975('0x13')](_0xf975('0x14'))[_0xf975('0x15')](_0x22f122)[_0xf975('0x16')](_0xf975('0x17'));}exports[_0xf975('0x18')]=function(){switch(os['platform']()){case _0xf975('0x19'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0xf975('0x1a')]('\x0d\x0a','');default:var _0x168a76=getFirstInterface();var _0x24b7dc=getCPUhash();var _0x3bcc62=_0x24b7dc+'|'+os[_0xf975('0x1b')]()+'|'+_0x168a76[_0xf975('0x1c')]+'|'+_0x168a76[_0xf975('0x1d')];var _0x4f6568=crypto['createHash'](_0xf975('0x14'))[_0xf975('0x15')](_0x3bcc62)[_0xf975('0x16')](_0xf975('0x17'));return _0x4f6568[_0xf975('0x1e')](0x0,0x8)+'-'+_0x4f6568[_0xf975('0x1e')](0x8,0xc)+'-'+_0x4f6568['substring'](0xc,0x10)+'-'+_0x4f6568[_0xf975('0x1e')](0x10,0x14)+'-'+_0x4f6568[_0xf975('0x1e')](0x14);}}; \ No newline at end of file +var _0xdb94=['createHash','md5','digest','hex','getUuid','platform','win32','utf8','replace','hostname','ipAddress','substring','crypto','bimedia-machine-uuid','execSync','networkInterfaces','keys','length','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','join'];(function(_0x2213a6,_0x1b7099){var _0x4c97cc=function(_0x5e64ea){while(--_0x5e64ea){_0x2213a6['push'](_0x2213a6['shift']());}};_0x4c97cc(++_0x1b7099);}(_0xdb94,0xe5));var _0x4db9=function(_0x56a23c,_0x316546){_0x56a23c=_0x56a23c-0x0;var _0x4b791d=_0xdb94[_0x56a23c];return _0x4b791d;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x4db9('0x0'));var machine=require(_0x4db9('0x1'));var exec=require('child_process')[_0x4db9('0x2')];function getInterfaces(){var _0x3b24a6=[];var _0x25b510=os[_0x4db9('0x3')]();var _0x1f05d4=_['orderBy'](_[_0x4db9('0x4')](_0x25b510));for(var _0x541226=0x0;_0x541226<_0x1f05d4[_0x4db9('0x5')];_0x541226++){var _0xc76bc1=_0x25b510[_0x1f05d4[_0x541226]][_0x4db9('0x6')](function(_0x3404f6){return _0x3404f6[_0x4db9('0x7')]==='IPv4'&&_0x3404f6[_0x4db9('0x8')]===![];});_0x3b24a6=_0x3b24a6[_0x4db9('0x9')](_0xc76bc1);}return _0x3b24a6;}function getFirstInterface(){var _0x2d1d38=_[_0x4db9('0xa')](getInterfaces());return{'macAddress':_0x2d1d38&&_0x2d1d38[_0x4db9('0xb')]?_0x2d1d38['mac']:_0x4db9('0xc'),'ipAddress':_0x2d1d38&&_0x2d1d38[_0x4db9('0xd')]?_0x2d1d38[_0x4db9('0xd')]:_0x4db9('0xe')};}exports[_0x4db9('0xf')]=getFirstInterface;function getCPUhash(){var _0x3d1b96=_['orderBy'](os[_0x4db9('0x10')]()[_0x4db9('0x11')](function(_0x59f01c){return _0x59f01c['model'];}))[_0x4db9('0x12')](':');return crypto[_0x4db9('0x13')](_0x4db9('0x14'))['update'](_0x3d1b96)[_0x4db9('0x15')](_0x4db9('0x16'));}exports[_0x4db9('0x17')]=function(){switch(os[_0x4db9('0x18')]()){case _0x4db9('0x19'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x4db9('0x1a')})[_0x4db9('0x1b')]('\x0d\x0a','');default:var _0x5d4d70=getFirstInterface();var _0x27b387=getCPUhash();var _0x7df575=_0x27b387+'|'+os[_0x4db9('0x1c')]()+'|'+_0x5d4d70['macAddress']+'|'+_0x5d4d70[_0x4db9('0x1d')];var _0x3b0863=crypto['createHash']('md5')['update'](_0x7df575)[_0x4db9('0x15')](_0x4db9('0x16'));return _0x3b0863['substring'](0x0,0x8)+'-'+_0x3b0863[_0x4db9('0x1e')](0x8,0xc)+'-'+_0x3b0863[_0x4db9('0x1e')](0xc,0x10)+'-'+_0x3b0863[_0x4db9('0x1e')](0x10,0x14)+'-'+_0x3b0863[_0x4db9('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index cf42cb5..80f0ceb 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 _0x6365=['moment','request-promise','pkginfo','version','../../mysqldb','../environment','./hardware','license','../../api/jira/jira.controller','https://www.xcallymotion.com','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','aes-256-ctr','secrets','update','final','base64','createDecipher','utf8','User','findOne','admin','email','|reason|','|uuid|','|name|','fullname','|email|','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','get','info','data2','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','data1','toUpperCase','YYYY-MM-DD\x20HH:mm','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','util','crypto'];(function(_0x35e447,_0x57a043){var _0x27a620=function(_0x559058){while(--_0x559058){_0x35e447['push'](_0x35e447['shift']());}};_0x27a620(++_0x57a043);}(_0x6365,0x148));var _0x5636=function(_0x56342c,_0x3488d8){_0x56342c=_0x56342c-0x0;var _0x58778f=_0x6365[_0x56342c];return _0x58778f;};'use strict';var util=require(_0x5636('0x0'));var crypto=require(_0x5636('0x1'));var moment=require(_0x5636('0x2'));var rp=require(_0x5636('0x3'));var BPromise=require('bluebird');var pkginfo=require(_0x5636('0x4'))(module,_0x5636('0x5'));var db=require(_0x5636('0x6'))['db'];var config=require(_0x5636('0x7'));var hardware=require(_0x5636('0x8'));var logger=require('../logger')(_0x5636('0x9'));var jira=require(_0x5636('0xa'));var HOST=_0x5636('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x3575b7){return new BPromise(function(_0x53d5b4,_0x17439f){var _0x10769f=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x3575b7,module[_0x5636('0xc')][_0x5636('0x5')]);if(oldToken){_0x10769f=util[_0x5636('0xd')](_0x5636('0xe'),HOST,_0x3575b7,module['exports']['version'],oldToken);}var _0x2b3a3b={'uri':_0x10769f,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x2b3a3b)[_0x5636('0xf')](function(_0x178669){_0x53d5b4(_0x178669);})[_0x5636('0x10')](function(_0x215eb0){_0x17439f(_0x215eb0);});});}function encryptDate(_0x380b3d){var _0x255a21=crypto['createCipher'](_0x5636('0x11'),config[_0x5636('0x12')]['session']);var _0x250a72=_0x255a21[_0x5636('0x13')](_0x380b3d,'utf8','base64');_0x250a72+=_0x255a21[_0x5636('0x14')](_0x5636('0x15'));return _0x250a72;}function decryptDate(_0x41ccd0){var _0x11340b=crypto[_0x5636('0x16')]('aes-256-ctr',config[_0x5636('0x12')]['session']);var _0x55de40=_0x11340b[_0x5636('0x13')](_0x41ccd0,_0x5636('0x15'),_0x5636('0x17'));_0x55de40+=_0x11340b[_0x5636('0x14')](_0x5636('0x17'));return _0x55de40;}function sendJiraAlert(_0x2e375d,_0x17cdc4,_0x16efd7){var _0x522d61='||FIELD||VALUE||\x0a';return db[_0x5636('0x18')][_0x5636('0x19')]({'where':{'role':_0x5636('0x1a')},'attributes':['fullname',_0x5636('0x1b')],'raw':!![]})[_0x5636('0xf')](function(_0x278648){ADMIN=_0x278648;_0x522d61+=_0x5636('0x1c')+_0x16efd7+'|\x0a';_0x522d61+=_0x5636('0x1d')+_0x2e375d+'|\x0a';_0x522d61+='|machineUuid|'+_0x17cdc4+'|\x0a';_0x522d61+=_0x5636('0x1e')+ADMIN[_0x5636('0x1f')]+'|\x0a';_0x522d61+=_0x5636('0x20')+ADMIN[_0x5636('0x1b')]+'|\x0a';return _0x522d61;})['then'](function(_0x4c913c){var _0x39585c=hardware['getFirstInterface']()[_0x5636('0x21')];return jira[_0x5636('0x22')]({'key':_0x5636('0x23'),'summary':_0x5636('0x24'),'description':_0x4c913c,'issuetype':'Alert','oldToken':_0x2e375d,'newToken':_0x17cdc4,'email':ADMIN[_0x5636('0x1b')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x39585c});});}function manageLicense(_0x3c6dcb,_0x5953cf){var _0x29e35c=_0x5953cf[_0x5636('0x25')]({'plain':!![]});httpRequest(_0x3c6dcb)[_0x5636('0xf')](function(_0x278316){if(oldToken){oldToken=undefined;}if(_0x278316['active']){if(!_0x29e35c[_0x5636('0x9')]&&_0x29e35c[_0x5636('0x9')]!=_0x278316[_0x5636('0x9')]||_0x29e35c[_0x5636('0x9')]&&_0x29e35c['data2']){logger[_0x5636('0x26')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x29e35c[_0x5636('0x9')]&&!_0x29e35c['data2']&&_0x29e35c[_0x5636('0x9')]!=_0x278316['license']){logger[_0x5636('0x26')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x29e35c[_0x5636('0x9')]&&!_0x29e35c['data2']&&_0x29e35c[_0x5636('0x9')]==_0x278316[_0x5636('0x9')]){return _0x5953cf;}return _0x5953cf[_0x5636('0x13')]({'data1':_0x3c6dcb,'data2':null,'license':_0x278316['license']});}else{if(_0x278316[_0x5636('0x9')]||_0x29e35c[_0x5636('0x9')]){if(!_0x29e35c[_0x5636('0x27')]){if(_0x29e35c['data1']==_0x3c6dcb){GRAY_PERIOD_REASON=_0x5636('0x28');logger[_0x5636('0x26')](_0x5636('0x29'));}else{GRAY_PERIOD_REASON=_0x5636('0x2a');oldToken=_0x29e35c[_0x5636('0x2b')];logger[_0x5636('0x26')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x29e35c['data1'],_0x3c6dcb);}sendJiraAlert(_0x29e35c[_0x5636('0x2b')],_0x278316['uuid'],GRAY_PERIOD_REASON);logger[_0x5636('0x26')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x5636('0x2c')](),moment()[_0x5636('0xd')](_0x5636('0x2d')));return _0x5953cf[_0x5636('0x13')]({'data2':encryptDate(moment()['format'](_0x5636('0x2d')))});}else{if(moment()['diff'](decryptDate(_0x29e35c[_0x5636('0x27')]),_0x5636('0x2e'))>DAYS){logger[_0x5636('0x26')]('DEMO\x20START\x20AT\x20%s',moment()['format'](_0x5636('0x2d')));return _0x5953cf[_0x5636('0x13')]({'data1':_0x3c6dcb,'data2':null,'license':null});}}}else{if(_0x29e35c[_0x5636('0x2b')]!=_0x3c6dcb){logger[_0x5636('0x26')](_0x5636('0x2f'),_0x29e35c[_0x5636('0x2b')],_0x3c6dcb);return _0x5953cf[_0x5636('0x13')]({'data1':_0x3c6dcb,'data2':null,'license':null});}}}return _0x5953cf;})['then'](function(_0x1dae0b){_0x5953cf=_0x1dae0b;})['catch'](function(_0x495786){logger[_0x5636('0x30')](_0x495786[_0x5636('0x31')]);})[_0x5636('0x32')](function(){setTimeout(function(){manageLicense(hardware[_0x5636('0x33')](),_0x5953cf);},TIME);});}function defaultLicense(){var _0x3c242c=hardware[_0x5636('0x33')]();if(_0x3c242c){return db[_0x5636('0x34')][_0x5636('0x35')]({'where':{'id':0x1},'defaults':{'data1':_0x3c242c}})[_0x5636('0x36')](function(_0xc5f28d,_0xe7c55){logger[_0x5636('0x26')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x3c242c);manageLicense(_0x3c242c,_0xc5f28d);})['catch'](function(_0x461fd1){logger[_0x5636('0x30')](_0x461fd1['message']);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0xb2ad=['diff','days','DEMO\x20START\x20AT\x20%s','catch','message','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','crypto','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','../logger','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','secrets','update','base64','createDecipher','aes-256-ctr','utf8','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','|reason|','|name|','|email|','getFirstInterface','ipAddress','openIssue','Motion\x20License\x20Alert','Alert','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm'];(function(_0x2d8ad6,_0x306d63){var _0x340cdc=function(_0x150096){while(--_0x150096){_0x2d8ad6['push'](_0x2d8ad6['shift']());}};_0x340cdc(++_0x306d63);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x4fa52d,_0x53ddae){_0x4fa52d=_0x4fa52d-0x0;var _0x423490=_0xb2ad[_0x4fa52d];return _0x423490;};'use strict';var util=require('util');var crypto=require(_0xdb2a('0x0'));var moment=require('moment');var rp=require(_0xdb2a('0x1'));var BPromise=require(_0xdb2a('0x2'));var pkginfo=require(_0xdb2a('0x3'))(module,_0xdb2a('0x4'));var db=require(_0xdb2a('0x5'))['db'];var config=require('../environment');var hardware=require(_0xdb2a('0x6'));var logger=require(_0xdb2a('0x7'))(_0xdb2a('0x8'));var jira=require(_0xdb2a('0x9'));var HOST=_0xdb2a('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x4e6649){return new BPromise(function(_0x4f8127,_0x2ed71e){var _0xc23925=util[_0xdb2a('0xb')]('%s/api/servers/%s/check?version=%s',HOST,_0x4e6649,module[_0xdb2a('0xc')][_0xdb2a('0x4')]);if(oldToken){_0xc23925=util['format'](_0xdb2a('0xd'),HOST,_0x4e6649,module[_0xdb2a('0xc')]['version'],oldToken);}var _0x591114={'uri':_0xc23925,'method':_0xdb2a('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x591114)[_0xdb2a('0xf')](function(_0x134425){_0x4f8127(_0x134425);})['catch'](function(_0x61b247){_0x2ed71e(_0x61b247);});});}function encryptDate(_0x30a731){var _0x5c6688=crypto['createCipher']('aes-256-ctr',config[_0xdb2a('0x10')]['session']);var _0x95942e=_0x5c6688[_0xdb2a('0x11')](_0x30a731,'utf8',_0xdb2a('0x12'));_0x95942e+=_0x5c6688['final']('base64');return _0x95942e;}function decryptDate(_0x5d8282){var _0x5dbbb1=crypto[_0xdb2a('0x13')](_0xdb2a('0x14'),config['secrets']['session']);var _0x21cb82=_0x5dbbb1[_0xdb2a('0x11')](_0x5d8282,_0xdb2a('0x12'),_0xdb2a('0x15'));_0x21cb82+=_0x5dbbb1['final'](_0xdb2a('0x15'));return _0x21cb82;}function sendJiraAlert(_0x2de4cf,_0x1f6111,_0x584981){var _0x566175=_0xdb2a('0x16');return db[_0xdb2a('0x17')][_0xdb2a('0x18')]({'where':{'role':_0xdb2a('0x19')},'attributes':[_0xdb2a('0x1a'),'email'],'raw':!![]})[_0xdb2a('0xf')](function(_0x5ea701){ADMIN=_0x5ea701;_0x566175+=_0xdb2a('0x1b')+_0x584981+'|\x0a';_0x566175+='|uuid|'+_0x2de4cf+'|\x0a';_0x566175+='|machineUuid|'+_0x1f6111+'|\x0a';_0x566175+=_0xdb2a('0x1c')+ADMIN[_0xdb2a('0x1a')]+'|\x0a';_0x566175+=_0xdb2a('0x1d')+ADMIN['email']+'|\x0a';return _0x566175;})[_0xdb2a('0xf')](function(_0x871b44){var _0x16035f=hardware[_0xdb2a('0x1e')]()[_0xdb2a('0x1f')];return jira[_0xdb2a('0x20')]({'key':'MOTLICENSE','summary':_0xdb2a('0x21'),'description':_0x871b44,'issuetype':_0xdb2a('0x22'),'oldToken':_0x2de4cf,'newToken':_0x1f6111,'email':ADMIN['email'],'name':ADMIN[_0xdb2a('0x1a')],'reason':GRAY_PERIOD_REASON,'ip':_0x16035f});});}function manageLicense(_0x3645e9,_0x3b05b2){var _0x28252e=_0x3b05b2['get']({'plain':!![]});httpRequest(_0x3645e9)[_0xdb2a('0xf')](function(_0x1b666a){if(oldToken){oldToken=undefined;}if(_0x1b666a[_0xdb2a('0x23')]){if(!_0x28252e[_0xdb2a('0x8')]&&_0x28252e['license']!=_0x1b666a[_0xdb2a('0x8')]||_0x28252e[_0xdb2a('0x8')]&&_0x28252e[_0xdb2a('0x24')]){logger[_0xdb2a('0x25')](_0xdb2a('0x26'));}if(_0x28252e['license']&&!_0x28252e[_0xdb2a('0x24')]&&_0x28252e[_0xdb2a('0x8')]!=_0x1b666a[_0xdb2a('0x8')]){logger[_0xdb2a('0x25')](_0xdb2a('0x27'));}if(_0x28252e[_0xdb2a('0x8')]&&!_0x28252e[_0xdb2a('0x24')]&&_0x28252e[_0xdb2a('0x8')]==_0x1b666a[_0xdb2a('0x8')]){return _0x3b05b2;}return _0x3b05b2[_0xdb2a('0x11')]({'data1':_0x3645e9,'data2':null,'license':_0x1b666a[_0xdb2a('0x8')]});}else{if(_0x1b666a[_0xdb2a('0x8')]||_0x28252e[_0xdb2a('0x8')]){if(!_0x28252e[_0xdb2a('0x24')]){if(_0x28252e[_0xdb2a('0x28')]==_0x3645e9){GRAY_PERIOD_REASON=_0xdb2a('0x29');logger[_0xdb2a('0x25')](_0xdb2a('0x2a'));}else{GRAY_PERIOD_REASON=_0xdb2a('0x2b');oldToken=_0x28252e[_0xdb2a('0x28')];logger['info'](_0xdb2a('0x2c'),_0x28252e[_0xdb2a('0x28')],_0x3645e9);}sendJiraAlert(_0x28252e[_0xdb2a('0x28')],_0x1b666a['uuid'],GRAY_PERIOD_REASON);logger[_0xdb2a('0x25')](_0xdb2a('0x2d'),GRAY_PERIOD_REASON[_0xdb2a('0x2e')](),moment()[_0xdb2a('0xb')](_0xdb2a('0x2f')));return _0x3b05b2[_0xdb2a('0x11')]({'data2':encryptDate(moment()[_0xdb2a('0xb')](_0xdb2a('0x2f')))});}else{if(moment()[_0xdb2a('0x30')](decryptDate(_0x28252e[_0xdb2a('0x24')]),_0xdb2a('0x31'))>DAYS){logger[_0xdb2a('0x25')](_0xdb2a('0x32'),moment()[_0xdb2a('0xb')](_0xdb2a('0x2f')));return _0x3b05b2['update']({'data1':_0x3645e9,'data2':null,'license':null});}}}else{if(_0x28252e[_0xdb2a('0x28')]!=_0x3645e9){logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x28252e[_0xdb2a('0x28')],_0x3645e9);return _0x3b05b2[_0xdb2a('0x11')]({'data1':_0x3645e9,'data2':null,'license':null});}}}return _0x3b05b2;})[_0xdb2a('0xf')](function(_0x345b44){_0x3b05b2=_0x345b44;})[_0xdb2a('0x33')](function(_0x5be118){logger['error'](_0x5be118[_0xdb2a('0x34')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x3b05b2);},TIME);});}function defaultLicense(){var _0x3d1930=hardware[_0xdb2a('0x35')]();if(_0x3d1930){return db[_0xdb2a('0x36')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x3d1930}})[_0xdb2a('0x37')](function(_0x91d489,_0x2fa3e3){logger['info'](_0xdb2a('0x38'),_0x3d1930);manageLicense(_0x3d1930,_0x91d489);})[_0xdb2a('0x33')](function(_0x4604af){logger[_0xdb2a('0x39')](_0x4604af[_0xdb2a('0x34')]);});}}exports[_0xdb2a('0x3a')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index d84e320..b289be8 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 _0x8835=['moment','./hardware','../environment','license','License\x20key\x20value\x20not\x20found','data1','data2','split','aes-256-ctr','format','update','base64','utf8','final','parse','demo','uuid','machineUuid','getUuid','createDecipher','secrets','session','gray','add','days','grayReason','disabled','2027-01-01T00:00:00.000Z','getLicense','License','find','then','crypto','util','lodash'];(function(_0x166d38,_0x46e636){var _0x4becf7=function(_0x167074){while(--_0x167074){_0x166d38['push'](_0x166d38['shift']());}};_0x4becf7(++_0x46e636);}(_0x8835,0x15b));var _0x5883=function(_0x344432,_0x5b990f){_0x344432=_0x344432-0x0;var _0x54f671=_0x8835[_0x344432];return _0x54f671;};'use strict';var crypto=require(_0x5883('0x0'));var util=require(_0x5883('0x1'));var _=require(_0x5883('0x2'));var moment=require(_0x5883('0x3'));var hardware=require(_0x5883('0x4'));var config=require(_0x5883('0x5'));var db=require('../../mysqldb')['db'];function checkLicense(_0x4a9a25,_0x51d888){if(_0x4a9a25){try{var _0x4da547=_0x51d888||_0x4a9a25[_0x5883('0x6')];if(_['isEmpty'](_0x4da547)){throw new Error(_0x5883('0x7'));}var _0x23a3a=_0x4a9a25[_0x5883('0x8')];var _0x2aecd1=_0x4a9a25[_0x5883('0x9')];var _0x20d4e9=_0x23a3a[_0x5883('0xa')]('-')[0x4];var _0x467f83=_0x23a3a[_0x5883('0xa')]('-')[0x0];var _0x453c8d=crypto['createDecipher'](_0x5883('0xb'),util[_0x5883('0xc')]('%s:%s:%s',_0x20d4e9,_0x23a3a,_0x467f83));var _0x259d41=_0x453c8d[_0x5883('0xd')](_0x4da547,_0x5883('0xe'),_0x5883('0xf'));_0x259d41+=_0x453c8d[_0x5883('0x10')](_0x5883('0xf'));var _0x197efd=JSON[_0x5883('0x11')](_0x259d41);_0x197efd[_0x5883('0x12')]=![];_0x197efd[_0x5883('0x13')]=_0x23a3a;_0x197efd[_0x5883('0x14')]=hardware[_0x5883('0x15')]();if(_0x2aecd1){var _0x3f641f=crypto[_0x5883('0x16')]('aes-256-ctr',config[_0x5883('0x17')][_0x5883('0x18')]);var _0x3059ba=_0x3f641f[_0x5883('0xd')](_0x2aecd1,_0x5883('0xe'),_0x5883('0xf'));_0x3059ba+=_0x3f641f[_0x5883('0x10')](_0x5883('0xf'));_0x197efd[_0x5883('0x19')]=_0x3059ba;_0x197efd['deadline']=moment(_0x3059ba)[_0x5883('0x1a')](0x7,_0x5883('0x1b'))['format']();_0x197efd[_0x5883('0x1c')]=_0x197efd[_0x5883('0x13')]!=_0x197efd['machineUuid']?'changed':_0x5883('0x1d');}return _0x197efd;}catch(_0x546556){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5883('0x1e'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x4a9a25[_0x5883('0x8')],'machineUuid':hardware['getUuid'](),'message':_0x546556['message'],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5883('0x1e'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x4a9a25[_0x5883('0x8')],'machineUuid':hardware[_0x5883('0x15')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x5883('0x1f')]=function(_0x47cf54){return db[_0x5883('0x20')][_0x5883('0x21')](_['defaults'](_0x47cf54,{'raw':!![],'where':{'id':0x1}}))[_0x5883('0x22')](function(_0x51b480){return checkLicense(_0x51b480,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file +var _0xe389=['lodash','moment','./hardware','../environment','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','format','update','parse','demo','machineUuid','getUuid','aes-256-ctr','secrets','session','utf8','final','gray','deadline','days','grayReason','uuid','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','getLicense','find','then','checkLicense','util'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xe389,0x167));var _0x9e38=function(_0x452581,_0x359cea){_0x452581=_0x452581-0x0;var _0x2c1e09=_0xe389[_0x452581];return _0x2c1e09;};'use strict';var crypto=require('crypto');var util=require(_0x9e38('0x0'));var _=require(_0x9e38('0x1'));var moment=require(_0x9e38('0x2'));var hardware=require(_0x9e38('0x3'));var config=require(_0x9e38('0x4'));var db=require('../../mysqldb')['db'];function checkLicense(_0x2610ba,_0x409e44){if(_0x2610ba){try{var _0x3a3e3e=_0x409e44||_0x2610ba['license'];if(_[_0x9e38('0x5')](_0x3a3e3e)){throw new Error(_0x9e38('0x6'));}var _0x145405=_0x2610ba[_0x9e38('0x7')];var _0x5b6afc=_0x2610ba[_0x9e38('0x8')];var _0xa13f0=_0x145405[_0x9e38('0x9')]('-')[0x4];var _0x317fad=_0x145405[_0x9e38('0x9')]('-')[0x0];var _0x3d5e3d=crypto[_0x9e38('0xa')]('aes-256-ctr',util[_0x9e38('0xb')]('%s:%s:%s',_0xa13f0,_0x145405,_0x317fad));var _0x2872d3=_0x3d5e3d[_0x9e38('0xc')](_0x3a3e3e,'base64','utf8');_0x2872d3+=_0x3d5e3d['final']('utf8');var _0x2a50a7=JSON[_0x9e38('0xd')](_0x2872d3);_0x2a50a7[_0x9e38('0xe')]=![];_0x2a50a7['uuid']=_0x145405;_0x2a50a7[_0x9e38('0xf')]=hardware[_0x9e38('0x10')]();if(_0x5b6afc){var _0x46180a=crypto['createDecipher'](_0x9e38('0x11'),config[_0x9e38('0x12')][_0x9e38('0x13')]);var _0x579e71=_0x46180a['update'](_0x5b6afc,'base64',_0x9e38('0x14'));_0x579e71+=_0x46180a[_0x9e38('0x15')](_0x9e38('0x14'));_0x2a50a7[_0x9e38('0x16')]=_0x579e71;_0x2a50a7[_0x9e38('0x17')]=moment(_0x579e71)['add'](0x7,_0x9e38('0x18'))[_0x9e38('0xb')]();_0x2a50a7[_0x9e38('0x19')]=_0x2a50a7[_0x9e38('0x1a')]!=_0x2a50a7['machineUuid']?_0x9e38('0x1b'):_0x9e38('0x1c');}return _0x2a50a7;}catch(_0x2e85b1){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9e38('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x9e38('0x1e'),'uuid':_0x2610ba[_0x9e38('0x7')],'machineUuid':hardware[_0x9e38('0x10')](),'message':_0x2e85b1[_0x9e38('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9e38('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x2610ba[_0x9e38('0x7')],'machineUuid':hardware[_0x9e38('0x10')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x9e38('0x20')]=function(_0x2da77a){return db['License'][_0x9e38('0x21')](_['defaults'](_0x2da77a,{'raw':!![],'where':{'id':0x1}}))[_0x9e38('0x22')](function(_0x323012){return checkLicense(_0x323012,null);});};exports[_0x9e38('0x23')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index ca5242e..75a7430 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 _0xf164=['myappanuglar-secret','app-id','secret','exports','http://localhost:9000'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xf164,0xcb));var _0x4f16=function(_0x2de753,_0x4a544d){_0x2de753=_0x2de753-0x0;var _0x8e70a5=_0xf164[_0x2de753];return _0x8e70a5;};'use strict';module[_0x4f16('0x0')]={'DOMAIN':_0x4f16('0x1'),'SESSION_SECRET':_0x4f16('0x2'),'GOOGLE_ID':_0x4f16('0x3'),'GOOGLE_SECRET':_0x4f16('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x8ccd=['http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8ccd,0x118));var _0xd8cc=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x8ccd[_0x2b4411];return _0x8e41ef;};'use strict';module['exports']={'DOMAIN':_0xd8cc('0x0'),'SESSION_SECRET':_0xd8cc('0x1'),'GOOGLE_ID':_0xd8cc('0x2'),'GOOGLE_SECRET':_0xd8cc('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 48d6802..72edebe 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x160f=['xcally','format','%s-%s.log','level','message','exports','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','util','path','INFO','join','/var','log'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x160f,0x6b));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xf160('0x0'));var winston=require(_0xf160('0x1'));var util=require(_0xf160('0x2'));var path=require(_0xf160('0x3'));var debugLevel=_0xf160('0x4');function filename(_0x83b1e1,_0x4241cc){return path[_0xf160('0x5')](_0xf160('0x6'),_0xf160('0x7'),_0xf160('0x8'),util[_0xf160('0x9')](_0xf160('0xa'),_0x83b1e1,_0x4241cc));}function formatter(_0x402fca,_0x10b904){return util[_0xf160('0x9')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x10b904[_0xf160('0xb')]['toUpperCase'](),_0x402fca,_0x10b904[_0xf160('0xc')]);}module[_0xf160('0xd')]=function(_0x48df25){return new winston[(_0xf160('0xe'))]({'transports':[new winston[(_0xf160('0xf'))][(_0xf160('0x10'))]({'name':util[_0xf160('0x9')](_0xf160('0x11'),_0x48df25,'error'),'filename':filename(_0x48df25,_0xf160('0x12')),'level':_0xf160('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5ef2c9){return formatter(_0x48df25,_0x5ef2c9);}}),new winston[(_0xf160('0xf'))][(_0xf160('0x10'))]({'name':util[_0xf160('0x9')](_0xf160('0x11'),_0x48df25,_0xf160('0x13')),'filename':filename(_0x48df25,_0xf160('0x13')),'level':_0xf160('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2fea4a){return formatter(_0x48df25,_0x2fea4a);}}),new winston['transports'][(_0xf160('0x14'))]({'level':process[_0xf160('0x15')][_0xf160('0x16')]||debugLevel,'json':![],'formatter':function(_0x226d10){return formatter(_0x48df25,_0x226d10);}})]});}; \ No newline at end of file +var _0xd24a=['Console','env','debugLevel','winston','util','path','INFO','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','message','exports','File','%s-%s','error','transports','info'];(function(_0x42cc1f,_0xe9eb20){var _0x175df5=function(_0x2f3e22){while(--_0x2f3e22){_0x42cc1f['push'](_0x42cc1f['shift']());}};_0x175df5(++_0xe9eb20);}(_0xd24a,0x81));var _0xad24=function(_0x1e3453,_0x4f0d74){_0x1e3453=_0x1e3453-0x0;var _0x5b3956=_0xd24a[_0x1e3453];return _0x5b3956;};'use strict';var moment=require('moment');var winston=require(_0xad24('0x0'));var util=require(_0xad24('0x1'));var path=require(_0xad24('0x2'));var debugLevel=_0xad24('0x3');function filename(_0x4ecc9b,_0x23806b){return path['join']('/var',_0xad24('0x4'),_0xad24('0x5'),util[_0xad24('0x6')](_0xad24('0x7'),_0x4ecc9b,_0x23806b));}function formatter(_0x23a772,_0x1f1085){return util['format'](_0xad24('0x8'),moment()[_0xad24('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),_0x1f1085[_0xad24('0x9')][_0xad24('0xa')](),_0x23a772,_0x1f1085[_0xad24('0xb')]);}module[_0xad24('0xc')]=function(_0x24e799){return new winston['Logger']({'transports':[new winston['transports'][(_0xad24('0xd'))]({'name':util[_0xad24('0x6')](_0xad24('0xe'),_0x24e799,'error'),'filename':filename(_0x24e799,_0xad24('0xf')),'level':_0xad24('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x17796d){return formatter(_0x24e799,_0x17796d);}}),new winston[(_0xad24('0x10'))][(_0xad24('0xd'))]({'name':util['format'](_0xad24('0xe'),_0x24e799,_0xad24('0x11')),'filename':filename(_0x24e799,_0xad24('0x11')),'level':_0xad24('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5d9302){return formatter(_0x24e799,_0x5d9302);}}),new winston[(_0xad24('0x10'))][(_0xad24('0x12'))]({'level':process[_0xad24('0x13')][_0xad24('0x14')]||debugLevel,'json':![],'formatter':function(_0x2cf8bc){return formatter(_0x24e799,_0x2cf8bc);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 32f5a8e..285ec48 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 _0xd98a=['../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join'];(function(_0x40ddc0,_0x41c082){var _0x1aebf1=function(_0x3ba1f6){while(--_0x3ba1f6){_0x40ddc0['push'](_0x40ddc0['shift']());}};_0x1aebf1(++_0x41c082);}(_0xd98a,0x156));var _0xad98=function(_0xa5ff85,_0x1cdb7e){_0xa5ff85=_0xa5ff85-0x0;var _0x42bbf1=_0xd98a[_0xa5ff85];return _0x42bbf1;};'use strict';var path=require(_0xad98('0x0'));var os=require('os');var config={'apps':[{'name':_0xad98('0x1'),'script':path[_0xad98('0x2')](__dirname,_0xad98('0x3'))},{'name':_0xad98('0x4'),'script':path['join'](__dirname,_0xad98('0x5'))},{'name':_0xad98('0x6'),'script':path['join'](__dirname,_0xad98('0x7'))},{'name':_0xad98('0x8'),'script':path[_0xad98('0x2')](__dirname,_0xad98('0x9'))},{'name':_0xad98('0xa'),'script':path[_0xad98('0x2')](__dirname,_0xad98('0xb'))},{'name':_0xad98('0xc'),'script':path['join'](__dirname,_0xad98('0xd'))}]};module[_0xad98('0xe')]=config; \ No newline at end of file +var _0x67a2=['xdr','../../services/xdr/index.js','exports','path','express','../../services/express/index.js','ami','join','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','routing'];(function(_0x54afe7,_0x5aa230){var _0x3dd50e=function(_0x27e2da){while(--_0x27e2da){_0x54afe7['push'](_0x54afe7['shift']());}};_0x3dd50e(++_0x5aa230);}(_0x67a2,0xd3));var _0x267a=function(_0x54d0c9,_0x379c87){_0x54d0c9=_0x54d0c9-0x0;var _0x586e5e=_0x67a2[_0x54d0c9];return _0x586e5e;};'use strict';var path=require(_0x267a('0x0'));var os=require('os');var config={'apps':[{'name':_0x267a('0x1'),'script':path['join'](__dirname,_0x267a('0x2'))},{'name':_0x267a('0x3'),'script':path[_0x267a('0x4')](__dirname,_0x267a('0x5'))},{'name':_0x267a('0x6'),'script':path[_0x267a('0x4')](__dirname,_0x267a('0x7'))},{'name':'email','script':path['join'](__dirname,_0x267a('0x8'))},{'name':_0x267a('0x9'),'script':path[_0x267a('0x4')](__dirname,'../../services/routing/index.js')},{'name':_0x267a('0xa'),'script':path['join'](__dirname,_0x267a('0xb'))}]};module[_0x267a('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 69c73fd..56ef8db 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 _0x444a=['describe','delete','dump','saved','pm2','./config','connect','connected','start','disconnect','then','stop','restart'];(function(_0x58346d,_0xd7736e){var _0x56d54c=function(_0x2878e6){while(--_0x2878e6){_0x58346d['push'](_0x58346d['shift']());}};_0x56d54c(++_0xd7736e);}(_0x444a,0x170));var _0xa444=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0x444a[_0x261522];return _0x98a25a;};'use strict';var pm2=require(_0xa444('0x0'));var BPromise=require('bluebird');var config=require(_0xa444('0x1'));function connect(){return new BPromise(function(_0x30df14,_0xb8db2e){return pm2[_0xa444('0x2')](function(_0xc3acef){if(_0xc3acef){return _0xb8db2e(_0xc3acef);}return _0x30df14(_0xa444('0x3'));});});};exports['start']=function(_0x30b1e8){return connect()['then'](function(){return new BPromise(function(_0x307a12,_0x5e66c2){return pm2[_0xa444('0x4')](_0x30b1e8,function(_0x1782e4,_0x16c38d){if(_0x1782e4){return _0x5e66c2(_0x1782e4);}pm2[_0xa444('0x5')]();return _0x307a12(_0x16c38d);});});});};exports['stop']=function(_0x22830f){return connect()[_0xa444('0x6')](function(){return new BPromise(function(_0x5a862f,_0x1e4332){return pm2[_0xa444('0x7')](_0x22830f,function(_0x4b3937,_0x4c1866){if(_0x4b3937){return _0x1e4332(_0x4b3937);}pm2[_0xa444('0x5')]();return _0x5a862f(_0x4c1866);});});});};exports['restart']=function(_0x746e69){return connect()[_0xa444('0x6')](function(){return new BPromise(function(_0x38d841,_0x347f10){return pm2[_0xa444('0x8')](_0x746e69,function(_0x5964d7,_0x4d2220){if(_0x5964d7){return _0x347f10(_0x5964d7);}pm2[_0xa444('0x5')]();return _0x38d841(_0x4d2220);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x50b666,_0x118995){return pm2['list'](function(_0x3cd3da,_0x3520a7){if(_0x3cd3da){return _0x118995(_0x3cd3da);}pm2[_0xa444('0x5')]();return _0x50b666(_0x3520a7);});});});};exports[_0xa444('0x9')]=function(_0x3f4760){return connect()[_0xa444('0x6')](function(){return new BPromise(function(_0x3aa724,_0x3f73f9){return pm2[_0xa444('0x9')](_0x3f4760,function(_0x2eb645,_0x21ee23){if(_0x2eb645){return _0x3f73f9(_0x2eb645);}pm2[_0xa444('0x5')]();return _0x3aa724(_0x21ee23);});});});};exports[_0xa444('0xa')]=function(_0x453be3){return connect()['then'](function(){return new BPromise(function(_0x38d5bc,_0x341341){return pm2[_0xa444('0xa')](_0x453be3,function(_0x3b5a04,_0x183724){if(_0x3b5a04){return _0x341341(_0x3b5a04);}pm2['disconnect']();return _0x38d5bc(_0x183724);});});});};exports[_0xa444('0xb')]=function(){return connect()[_0xa444('0x6')](function(){return new BPromise(function(_0x322eb8,_0x5b0eb3){return pm2[_0xa444('0xb')](function(_0x1c321f){if(_0x1c321f){return _0x5b0eb3(_0x1c321f);}return _0x322eb8(_0xa444('0xc'));});});});}; \ No newline at end of file +var _0x722c=['pm2','connect','connected','start','disconnect','then','stop','restart','list','describe','delete'];(function(_0x35c55f,_0x76201){var _0x592ac9=function(_0x31c4e9){while(--_0x31c4e9){_0x35c55f['push'](_0x35c55f['shift']());}};_0x592ac9(++_0x76201);}(_0x722c,0x1e4));var _0xc722=function(_0x40f5b7,_0xb3243e){_0x40f5b7=_0x40f5b7-0x0;var _0x3c884a=_0x722c[_0x40f5b7];return _0x3c884a;};'use strict';var pm2=require(_0xc722('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0xb7b69c,_0x11687d){return pm2[_0xc722('0x1')](function(_0x465911){if(_0x465911){return _0x11687d(_0x465911);}return _0xb7b69c(_0xc722('0x2'));});});};exports['start']=function(_0x4e4541){return connect()['then'](function(){return new BPromise(function(_0x5b7273,_0x476bee){return pm2[_0xc722('0x3')](_0x4e4541,function(_0x2976e5,_0x419b21){if(_0x2976e5){return _0x476bee(_0x2976e5);}pm2[_0xc722('0x4')]();return _0x5b7273(_0x419b21);});});});};exports['stop']=function(_0x25f79a){return connect()[_0xc722('0x5')](function(){return new BPromise(function(_0x2cdd26,_0xb55f5b){return pm2[_0xc722('0x6')](_0x25f79a,function(_0x4eb68f,_0x35b2cd){if(_0x4eb68f){return _0xb55f5b(_0x4eb68f);}pm2[_0xc722('0x4')]();return _0x2cdd26(_0x35b2cd);});});});};exports[_0xc722('0x7')]=function(_0x58f959){return connect()[_0xc722('0x5')](function(){return new BPromise(function(_0x5d8d97,_0x290c96){return pm2['restart'](_0x58f959,function(_0xe4da87,_0x20ed54){if(_0xe4da87){return _0x290c96(_0xe4da87);}pm2[_0xc722('0x4')]();return _0x5d8d97(_0x20ed54);});});});};exports[_0xc722('0x8')]=function(){return connect()[_0xc722('0x5')](function(){return new BPromise(function(_0x1e8f89,_0x46f157){return pm2[_0xc722('0x8')](function(_0x2f2792,_0x484fa4){if(_0x2f2792){return _0x46f157(_0x2f2792);}pm2[_0xc722('0x4')]();return _0x1e8f89(_0x484fa4);});});});};exports[_0xc722('0x9')]=function(_0x5ecc90){return connect()[_0xc722('0x5')](function(){return new BPromise(function(_0xd13399,_0x368220){return pm2[_0xc722('0x9')](_0x5ecc90,function(_0x2f3f14,_0x422919){if(_0x2f3f14){return _0x368220(_0x2f3f14);}pm2[_0xc722('0x4')]();return _0xd13399(_0x422919);});});});};exports[_0xc722('0xa')]=function(_0x558867){return connect()['then'](function(){return new BPromise(function(_0x519f9a,_0x1025b4){return pm2['delete'](_0x558867,function(_0x40d8df,_0x2260ff){if(_0x40d8df){return _0x1025b4(_0x40d8df);}pm2[_0xc722('0x4')]();return _0x519f9a(_0x2260ff);});});});};exports['dump']=function(){return connect()[_0xc722('0x5')](function(){return new BPromise(function(_0xbbadc6,_0x5b806d){return pm2['dump'](function(_0x5eedaf){if(_0x5eedaf){return _0x5b806d(_0x5eedaf);}return _0xbbadc6('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 67aa290..5b52eb8 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 _0xf5aa=['emit','chatInteraction:update','catch','error','start','moment','ioredis','../../mysqldb','../../config/environment','defaults','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','minutes','ChatInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length'];(function(_0x1479dc,_0xa30dfc){var _0x50abf9=function(_0x21efda){while(--_0x21efda){_0x1479dc['push'](_0x1479dc['shift']());}};_0x50abf9(++_0xa30dfc);}(_0xf5aa,0x1e1));var _0xaf5a=function(_0x127e80,_0x450054){_0x127e80=_0x127e80-0x0;var _0x2a254c=_0xf5aa[_0x127e80];return _0x2a254c;};'use strict';var _=require('lodash');var moment=require(_0xaf5a('0x0'));var Redis=require(_0xaf5a('0x1'));var db=require(_0xaf5a('0x2'))['db'];var config=require(_0xaf5a('0x3'));config['redis']=_[_0xaf5a('0x4')](config[_0xaf5a('0x5')],{'host':_0xaf5a('0x6'),'port':0x18eb});var io=require(_0xaf5a('0x7'))(new Redis(config[_0xaf5a('0x5')]));function closeInteractions(){var _0x493a09=0x0;var _0x4feaca=[];return db[_0xaf5a('0x8')][_0xaf5a('0x9')]({'raw':!![],'attributes':['id',_0xaf5a('0xa')],'where':{'id':0x1}})[_0xaf5a('0xb')](function(_0x2e519f){_0x493a09=_0x2e519f[_0xaf5a('0xa')];if(_0x493a09){return db['ChatInteraction'][_0xaf5a('0xc')]({'raw':!![],'attributes':['id',_0xaf5a('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x2e519f[_0xaf5a('0xa')],_0xaf5a('0xe'))}}});}else{return[];}})[_0xaf5a('0xb')](function(_0x1422a5){_0x4feaca=_0x1422a5;if(_0x493a09){return db[_0xaf5a('0xf')][_0xaf5a('0x10')]({'closeReason':_0xaf5a('0x11'),'disposition':_0xaf5a('0x12'),'closed':!![],'closedAt':moment()[_0xaf5a('0x13')](_0xaf5a('0x14'))},{'where':{'id':_[_0xaf5a('0x15')](_0x4feaca||[],'id')}});}})['then'](function(_0x4b5013){for(var _0x3893b4=0x0;_0x3893b4<_0x4feaca[_0xaf5a('0x16')];_0x3893b4++){io[_0xaf5a('0x17')](_0xaf5a('0x18'),{'id':_0x4feaca[_0x3893b4]['id'],'closed':!![]});}})[_0xaf5a('0x19')](function(_0x4dab53){console[_0xaf5a('0x1a')](_0x4dab53);});}exports[_0xaf5a('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb42f=['timeout','format','map','emit','chatInteraction:update','error','start','lodash','moment','ioredis','../../config/environment','redis','defaults','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','update','system'];(function(_0x4daf67,_0x1bb0b5){var _0xd4e5e3=function(_0x3ed9a1){while(--_0x3ed9a1){_0x4daf67['push'](_0x4daf67['shift']());}};_0xd4e5e3(++_0x1bb0b5);}(_0xb42f,0x10f));var _0xfb42=function(_0x10d743,_0x5061f8){_0x10d743=_0x10d743-0x0;var _0x386e9e=_0xb42f[_0x10d743];return _0x386e9e;};'use strict';var _=require(_0xfb42('0x0'));var moment=require(_0xfb42('0x1'));var Redis=require(_0xfb42('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xfb42('0x3'));config[_0xfb42('0x4')]=_[_0xfb42('0x5')](config[_0xfb42('0x4')],{'host':_0xfb42('0x6'),'port':0x18eb});var io=require(_0xfb42('0x7'))(new Redis(config[_0xfb42('0x4')]));function closeInteractions(){var _0x528a26=0x0;var _0x2c4854=[];return db[_0xfb42('0x8')]['find']({'raw':!![],'attributes':['id',_0xfb42('0x9')],'where':{'id':0x1}})[_0xfb42('0xa')](function(_0x33940d){_0x528a26=_0x33940d[_0xfb42('0x9')];if(_0x528a26){return db[_0xfb42('0xb')]['findAll']({'raw':!![],'attributes':['id',_0xfb42('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xfb42('0xd')](_0x33940d[_0xfb42('0x9')],_0xfb42('0xe'))}}});}else{return[];}})[_0xfb42('0xa')](function(_0x4d94bf){_0x2c4854=_0x4d94bf;if(_0x528a26){return db[_0xfb42('0xb')][_0xfb42('0xf')]({'closeReason':_0xfb42('0x10'),'disposition':_0xfb42('0x11'),'closed':!![],'closedAt':moment()[_0xfb42('0x12')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_[_0xfb42('0x13')](_0x2c4854||[],'id')}});}})[_0xfb42('0xa')](function(_0x2c52f5){for(var _0x562a03=0x0;_0x562a03<_0x2c4854['length'];_0x562a03++){io[_0xfb42('0x14')](_0xfb42('0x15'),{'id':_0x2c4854[_0x562a03]['id'],'closed':!![]});}})['catch'](function(_0x19f6c3){console[_0xfb42('0x16')](_0x19f6c3);});}exports[_0xfb42('0x17')]=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 5d07fc8..b036ad5 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 _0x5efb=['subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','catch','CustomReportId','runReport','no\x20report\x20id','Schedule','findAll','keys','jobs','toString','keyBy','intersection','difference','length','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','stop','stop\x20cron','endAt','update','update\x20cron','run','util','path','lodash','moment','cron-job-manager','bluebird','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','host','Smtp','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','basename','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','isNil'];(function(_0x387f36,_0x1ce70f){var _0x2e029f=function(_0x22c203){while(--_0x22c203){_0x387f36['push'](_0x387f36['shift']());}};_0x2e029f(++_0x1ce70f);}(_0x5efb,0x12a));var _0xb5ef=function(_0x564b0a,_0x4dd651){_0x564b0a=_0x564b0a-0x0;var _0x350a24=_0x5efb[_0x564b0a];return _0x350a24;};'use strict';var fs=require('fs');var util=require(_0xb5ef('0x0'));var path=require(_0xb5ef('0x1'));var _=require(_0xb5ef('0x2'));var moment=require(_0xb5ef('0x3'));var CronJobManager=require(_0xb5ef('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0xb5ef('0x5'));var logger=require('../logger')('schedule');var db=require(_0xb5ef('0x6'))['db'];var analyticCustomReportController=require(_0xb5ef('0x7'));var analyticDefaultReportController=require(_0xb5ef('0x8'));var client=jayson[_0xb5ef('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xa5d870,_0x22ea74){return function(){logger[_0xb5ef('0xa')](_0xb5ef('0xb'),_0xa5d870[_0xb5ef('0xc')]);var _0x3c6218=!![];var _0x31b5ee={'tls':{'rejectUnauthorized':![]}};if(_0xa5d870[_0xb5ef('0xd')]['Smtp'][_0xb5ef('0xe')]){_0x31b5ee[_0xb5ef('0xe')]=_0xa5d870[_0xb5ef('0xd')]['Smtp'][_0xb5ef('0xe')];}else{_0x31b5ee[_0xb5ef('0xf')]=_0xa5d870[_0xb5ef('0xd')]['Smtp']['host'];_0x31b5ee['port']=_0xa5d870[_0xb5ef('0xd')][_0xb5ef('0x10')]['port'];_0x31b5ee[_0xb5ef('0x11')]=_0xa5d870[_0xb5ef('0xd')]['Smtp']['secure'];}if(_0xa5d870[_0xb5ef('0xd')]['Smtp'][_0xb5ef('0x12')]){_0x31b5ee[_0xb5ef('0x13')]={'user':_0xa5d870['MailAccount'][_0xb5ef('0x10')][_0xb5ef('0x14')],'pass':_0xa5d870['MailAccount'][_0xb5ef('0x10')][_0xb5ef('0x15')]};}var _0x826175={'account':_0x31b5ee,'message':{'from':util[_0xb5ef('0x16')](_0xb5ef('0x17'),_0xa5d870[_0xb5ef('0xd')][_0xb5ef('0x18')],_0xa5d870[_0xb5ef('0xd')][_0xb5ef('0xc')]||_0xa5d870['MailAccount'][_0xb5ef('0x10')][_0xb5ef('0x14')]),'to':_0xa5d870[_0xb5ef('0xc')],'cc':_0xa5d870['cc'],'bcc':_0xa5d870[_0xb5ef('0x19')],'subject':util[_0xb5ef('0x16')](_0xb5ef('0x1a'),_0x22ea74[_0xb5ef('0x18')],_0xa5d870[_0xb5ef('0x1b')],_0xa5d870['subtractUnit'])}};var _0x5b933b=path[_0xb5ef('0x1c')](__dirname,_0xb5ef('0x1d'));var _0x2068da=_0x22ea74[_0xb5ef('0x1e')];var _0xbcb9c2=util[_0xb5ef('0x16')]('%s.%s',path[_0xb5ef('0x1f')](_0x22ea74['savename'],path['extname'](_0x22ea74[_0xb5ef('0x1e')])),'zip');var _0x3cd0f1=path[_0xb5ef('0x1c')](_0x5b933b,_0x2068da);var _0xfb06ce=path[_0xb5ef('0x1c')](_0x5b933b,_0xbcb9c2);if(fs['existsSync'](_0x3cd0f1)){_0x22ea74[_0xb5ef('0x20')]=_0xb5ef('0x21');_0x826175[_0xb5ef('0x22')]['attachments']=[{'filename':_0x2068da,'path':_0x3cd0f1}];_0x826175[_0xb5ef('0x22')][_0xb5ef('0x23')]=util[_0xb5ef('0x16')](_0xb5ef('0x24'),JSON['stringify'](_0x22ea74,null,0x2));}else if(fs['existsSync'](_0xfb06ce)){_0x22ea74[_0xb5ef('0x20')]=_0xb5ef('0x21');_0x826175[_0xb5ef('0x22')]['attachments']=[{'filename':_0xbcb9c2,'path':_0xfb06ce}];}else{_0x826175[_0xb5ef('0x22')][_0xb5ef('0x23')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0xa5d870[_0xb5ef('0x25')]){_0x3c6218=![];logger[_0xb5ef('0xa')](_0xb5ef('0x26'));}}if(_0x3c6218){return client[_0xb5ef('0x27')](_0xb5ef('0x28'),_0x826175)[_0xb5ef('0x29')](function(_0x27a91f){if(_0x27a91f[_0xb5ef('0x2a')]){return logger[_0xb5ef('0x2a')](_0xb5ef('0x2b'),JSON[_0xb5ef('0x2c')](_0x27a91f));}return logger[_0xb5ef('0xa')]('email\x20sent');})['catch'](function(_0x45c138){return logger[_0xb5ef('0x2a')]('error\x20mail',JSON[_0xb5ef('0x2c')](_0x45c138));});}};}function handleError(){return function(_0x4fdf43){return logger[_0xb5ef('0x2a')](JSON[_0xb5ef('0x2c')](_0x4fdf43));};}function handleResult(_0x3357bd){return function(_0x4f67a1){logger[_0xb5ef('0xa')]('data',JSON['stringify'](_0x4f67a1));if(_0x3357bd['MailAccount']&&_0x3357bd[_0xb5ef('0xd')][_0xb5ef('0x10')]&&!_[_0xb5ef('0x2d')](_0x3357bd[_0xb5ef('0xc')])){setTimeout(handleSendEmail(_0x3357bd,_0x4f67a1),0x3c*0x3e8);}};}function handleJob(_0x5839d7){return function(){try{if(_[_0xb5ef('0x2d')](_0x5839d7[_0xb5ef('0x1b')])){return logger[_0xb5ef('0xa')](_0xb5ef('0x2e'));}if(_[_0xb5ef('0x2d')](_0x5839d7[_0xb5ef('0x2f')])){return logger[_0xb5ef('0xa')]('subtractUnit\x20null\x20or\x20undefined');}var _0x18e904={'startDate':moment()[_0xb5ef('0x30')](_0x5839d7['subtractNumber'],_0x5839d7[_0xb5ef('0x2f')])[_0xb5ef('0x16')](_0xb5ef('0x31')),'endDate':moment()[_0xb5ef('0x16')](_0xb5ef('0x31')),'type':_0xb5ef('0x32'),'output':_0x5839d7[_0xb5ef('0x33')],'name':_0x5839d7[_0xb5ef('0x18')]};if(!_[_0xb5ef('0x2d')](_0x5839d7['DefaultReportId'])){logger[_0xb5ef('0xa')](_0xb5ef('0x34'),_0x5839d7[_0xb5ef('0x35')]);return analyticDefaultReportController['runReport']({'id':_0x5839d7[_0xb5ef('0x35')]},_0x18e904)[_0xb5ef('0x29')](handleResult(_0x5839d7))[_0xb5ef('0x36')](handleError());}if(!_[_0xb5ef('0x2d')](_0x5839d7[_0xb5ef('0x37')])){logger[_0xb5ef('0xa')]('exec\x20custom\x20report\x20id:%s',_0x5839d7[_0xb5ef('0x37')]);return analyticCustomReportController[_0xb5ef('0x38')]({'id':_0x5839d7[_0xb5ef('0x37')]},_0x18e904)[_0xb5ef('0x29')](handleResult(_0x5839d7))[_0xb5ef('0x36')](handleError());}}catch(_0x584e3b){logger[_0xb5ef('0x2a')](JSON[_0xb5ef('0x2c')](_0x584e3b));}return logger['info'](_0xb5ef('0x39'));};}function getJobs(_0x3fbc5c){var _0x531170={};if(_0x3fbc5c){_0x531170['id']=_0x3fbc5c;}return db[_0xb5ef('0x3a')][_0xb5ef('0x3b')]({'where':_0x531170,'include':[{'model':db[_0xb5ef('0xd')],'attributes':['id',_0xb5ef('0x18'),_0xb5ef('0xc')],'include':[{'model':db['MailServerOut'],'as':_0xb5ef('0x10')}]}]})[_0xb5ef('0x29')](function(_0x3cba68){var _0x2414fa=_[_0xb5ef('0x3c')](manager[_0xb5ef('0x3d')]);var _0x45c1ca=_['map'](_0x3cba68,function(_0xfe7f27){return _0xfe7f27['id'][_0xb5ef('0x3e')]();});var _0x413e89=_[_0xb5ef('0x3f')](_0x3cba68,function(_0x10955f){return _0x10955f['id']['toString']();});var _0x3090d3=_0x3fbc5c?_0x45c1ca:_['difference'](_0x45c1ca,_0x2414fa);var _0x219e01=_[_0xb5ef('0x40')](_0x45c1ca,_0x2414fa);var _0x27f6a2=_[_0xb5ef('0x41')](_0x2414fa,_0x45c1ca);var _0x4d03e1;var _0x532d70;for(_0x4d03e1=0x0;_0x4d03e1<_0x27f6a2[_0xb5ef('0x42')]&&!_0x3fbc5c;_0x4d03e1+=0x1){_0x532d70=_0x27f6a2[_0x4d03e1][_0xb5ef('0x3e')]();if(manager['exists'](_0x532d70)){manager['stop'](_0x532d70);manager[_0xb5ef('0x43')](_0x532d70);logger['info'](_0xb5ef('0x44'),_0x532d70);}}logger['info'](_0xb5ef('0x45'),JSON['stringify'](_0x3090d3));for(_0x4d03e1=0x0;_0x4d03e1<_0x3090d3[_0xb5ef('0x42')];_0x4d03e1+=0x1){_0x532d70=_0x3090d3[_0x4d03e1][_0xb5ef('0x3e')]();logger[_0xb5ef('0xa')](_0xb5ef('0x46'),_0x532d70);if(_0x3fbc5c){logger[_0xb5ef('0xa')](_0xb5ef('0x47'),_0x3fbc5c);logger['info'](JSON[_0xb5ef('0x2c')](_0x413e89[_0x532d70]));BPromise[_0xb5ef('0x48')]()[_0xb5ef('0x29')](handleJob(_0x413e89[_0x532d70]));logger[_0xb5ef('0xa')](_0xb5ef('0x49'),_0x413e89[_0x532d70]['name'],_0x413e89[_0x532d70][_0xb5ef('0x4a')]);}else if(_0x413e89[_0x532d70]['cron']&&_0x413e89[_0x532d70][_0xb5ef('0x4b')]&&moment()[_0xb5ef('0x4c')](_0x413e89[_0x532d70][_0xb5ef('0x4d')],_0x413e89[_0x532d70]['endAt'])){manager[_0xb5ef('0x4e')](_0x532d70,_0x413e89[_0x532d70]['cron'],handleJob(_0x413e89[_0x532d70]));manager[_0xb5ef('0x4f')](_0x532d70);logger[_0xb5ef('0xa')]('add\x20cron',_0x413e89[_0x532d70]['name'],_0x413e89[_0x532d70][_0xb5ef('0x4a')]);}else if(manager['exists'](_0x532d70)){manager[_0xb5ef('0x50')](_0x532d70);manager[_0xb5ef('0x43')](_0x532d70);logger[_0xb5ef('0xa')](_0xb5ef('0x51'),_0x413e89[_0x532d70][_0xb5ef('0x18')],_0x413e89[_0x532d70][_0xb5ef('0x4a')]);}}for(_0x4d03e1=0x0,_0x532d70;_0x4d03e1<_0x219e01[_0xb5ef('0x42')]&&!_0x3fbc5c;_0x4d03e1+=0x1){_0x532d70=_0x219e01[_0x4d03e1][_0xb5ef('0x3e')]();if(manager['exists'](_0x532d70)){if(_0x413e89[_0x532d70][_0xb5ef('0x4a')]&&_0x413e89[_0x532d70][_0xb5ef('0x4b')]&&moment()[_0xb5ef('0x4c')](_0x413e89[_0x532d70]['startAt'],_0x413e89[_0x532d70][_0xb5ef('0x52')])){manager[_0xb5ef('0x53')](_0x532d70,_0x413e89[_0x532d70]['cron'],handleJob(_0x413e89[_0x532d70]));logger[_0xb5ef('0xa')](_0xb5ef('0x54'),_0x413e89[_0x532d70][_0xb5ef('0x18')],_0x413e89[_0x532d70][_0xb5ef('0x4a')]);}else{manager['stop'](_0x532d70);manager[_0xb5ef('0x43')](_0x532d70);logger[_0xb5ef('0xa')](_0xb5ef('0x51'),_0x413e89[_0x532d70][_0xb5ef('0x18')],_0x413e89[_0x532d70][_0xb5ef('0x4a')]);}}}})[_0xb5ef('0x36')](function(_0x65119){logger[_0xb5ef('0x2a')](JSON[_0xb5ef('0x2c')](_0x65119));});}exports[_0xb5ef('0x55')]=function(_0x2436e3){return getJobs(_0x2436e3);};exports[_0xb5ef('0x4f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x9aad=['empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','toString','keyBy','intersection','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','resolve','run\x20job','cron','active','isBetween','endAt','add','start','stop\x20cron','update','run','util','path','lodash','moment','jayson/promise','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','pass','\x22%s\x22\x20<%s>','format','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip','existsSync','status','Sent','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a'];(function(_0x5801be,_0x27ac00){var _0x498d45=function(_0x2f1bf2){while(--_0x2f1bf2){_0x5801be['push'](_0x5801be['shift']());}};_0x498d45(++_0x27ac00);}(_0x9aad,0x18c));var _0xd9aa=function(_0x2ea716,_0x247e9e){_0x2ea716=_0x2ea716-0x0;var _0x5dd3b2=_0x9aad[_0x2ea716];return _0x5dd3b2;};'use strict';var fs=require('fs');var util=require(_0xd9aa('0x0'));var path=require(_0xd9aa('0x1'));var _=require(_0xd9aa('0x2'));var moment=require(_0xd9aa('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xd9aa('0x4'));var BPromise=require(_0xd9aa('0x5'));var logger=require(_0xd9aa('0x6'))(_0xd9aa('0x7'));var db=require(_0xd9aa('0x8'))['db'];var analyticCustomReportController=require(_0xd9aa('0x9'));var analyticDefaultReportController=require(_0xd9aa('0xa'));var client=jayson[_0xd9aa('0xb')][_0xd9aa('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x32ebce,_0x3278e2){return function(){logger[_0xd9aa('0xd')](_0xd9aa('0xe'),_0x32ebce[_0xd9aa('0xf')]);var _0x12b97f=!![];var _0x217e4a={'tls':{'rejectUnauthorized':![]}};if(_0x32ebce[_0xd9aa('0x10')][_0xd9aa('0x11')][_0xd9aa('0x12')]){_0x217e4a[_0xd9aa('0x12')]=_0x32ebce['MailAccount'][_0xd9aa('0x11')][_0xd9aa('0x12')];}else{_0x217e4a[_0xd9aa('0x13')]=_0x32ebce['MailAccount']['Smtp'][_0xd9aa('0x13')];_0x217e4a[_0xd9aa('0x14')]=_0x32ebce[_0xd9aa('0x10')][_0xd9aa('0x11')][_0xd9aa('0x14')];_0x217e4a[_0xd9aa('0x15')]=_0x32ebce[_0xd9aa('0x10')][_0xd9aa('0x11')][_0xd9aa('0x15')];}if(_0x32ebce['MailAccount'][_0xd9aa('0x11')][_0xd9aa('0x16')]){_0x217e4a['auth']={'user':_0x32ebce[_0xd9aa('0x10')][_0xd9aa('0x11')]['user'],'pass':_0x32ebce[_0xd9aa('0x10')][_0xd9aa('0x11')][_0xd9aa('0x17')]};}var _0x4e8f8c={'account':_0x217e4a,'message':{'from':util['format'](_0xd9aa('0x18'),_0x32ebce[_0xd9aa('0x10')]['name'],_0x32ebce[_0xd9aa('0x10')][_0xd9aa('0xf')]||_0x32ebce[_0xd9aa('0x10')]['Smtp']['user']),'to':_0x32ebce['email'],'cc':_0x32ebce['cc'],'bcc':_0x32ebce['bcc'],'subject':util[_0xd9aa('0x19')](_0xd9aa('0x1a'),_0x3278e2[_0xd9aa('0x1b')],_0x32ebce[_0xd9aa('0x1c')],_0x32ebce[_0xd9aa('0x1d')])}};var _0x124a13=path[_0xd9aa('0x1e')](__dirname,_0xd9aa('0x1f'));var _0x2fcc46=_0x3278e2[_0xd9aa('0x20')];var _0x56c8b1=util[_0xd9aa('0x19')]('%s.%s',path[_0xd9aa('0x21')](_0x3278e2[_0xd9aa('0x20')],path[_0xd9aa('0x22')](_0x3278e2[_0xd9aa('0x20')])),_0xd9aa('0x23'));var _0x150186=path[_0xd9aa('0x1e')](_0x124a13,_0x2fcc46);var _0x3a28d0=path[_0xd9aa('0x1e')](_0x124a13,_0x56c8b1);if(fs[_0xd9aa('0x24')](_0x150186)){_0x3278e2[_0xd9aa('0x25')]=_0xd9aa('0x26');_0x4e8f8c[_0xd9aa('0x27')][_0xd9aa('0x28')]=[{'filename':_0x2fcc46,'path':_0x150186}];_0x4e8f8c['message']['text']=util[_0xd9aa('0x19')](_0xd9aa('0x29'),JSON['stringify'](_0x3278e2,null,0x2));}else if(fs[_0xd9aa('0x24')](_0x3a28d0)){_0x3278e2[_0xd9aa('0x25')]='Sent';_0x4e8f8c[_0xd9aa('0x27')][_0xd9aa('0x28')]=[{'filename':_0x56c8b1,'path':_0x3a28d0}];}else{_0x4e8f8c['message'][_0xd9aa('0x2a')]=_0xd9aa('0x2b');if(!_0x32ebce['sendIfEmpty']){_0x12b97f=![];logger[_0xd9aa('0xd')](_0xd9aa('0x2c'));}}if(_0x12b97f){return client[_0xd9aa('0x2d')](_0xd9aa('0x2e'),_0x4e8f8c)[_0xd9aa('0x2f')](function(_0x5efff0){if(_0x5efff0[_0xd9aa('0x30')]){return logger[_0xd9aa('0x30')](_0xd9aa('0x31'),JSON[_0xd9aa('0x32')](_0x5efff0));}return logger['info']('email\x20sent');})[_0xd9aa('0x33')](function(_0x4b421e){return logger[_0xd9aa('0x30')](_0xd9aa('0x31'),JSON['stringify'](_0x4b421e));});}};}function handleError(){return function(_0x59d878){return logger[_0xd9aa('0x30')](JSON['stringify'](_0x59d878));};}function handleResult(_0x306a85){return function(_0x2a99a5){logger[_0xd9aa('0xd')](_0xd9aa('0x34'),JSON[_0xd9aa('0x32')](_0x2a99a5));if(_0x306a85[_0xd9aa('0x10')]&&_0x306a85[_0xd9aa('0x10')][_0xd9aa('0x11')]&&!_[_0xd9aa('0x35')](_0x306a85[_0xd9aa('0xf')])){setTimeout(handleSendEmail(_0x306a85,_0x2a99a5),0x3c*0x3e8);}};}function handleJob(_0x416418){return function(){try{if(_['isNil'](_0x416418[_0xd9aa('0x1c')])){return logger[_0xd9aa('0xd')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xd9aa('0x35')](_0x416418[_0xd9aa('0x1d')])){return logger[_0xd9aa('0xd')](_0xd9aa('0x36'));}var _0x2bdb42={'startDate':moment()[_0xd9aa('0x37')](_0x416418[_0xd9aa('0x1c')],_0x416418[_0xd9aa('0x1d')])['format'](_0xd9aa('0x38')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xd9aa('0x39'),'output':_0x416418['output'],'name':_0x416418[_0xd9aa('0x1b')]};if(!_[_0xd9aa('0x35')](_0x416418[_0xd9aa('0x3a')])){logger[_0xd9aa('0xd')]('exec\x20defaul\x20report\x20id:%s',_0x416418['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x416418[_0xd9aa('0x3a')]},_0x2bdb42)[_0xd9aa('0x2f')](handleResult(_0x416418))[_0xd9aa('0x33')](handleError());}if(!_[_0xd9aa('0x35')](_0x416418[_0xd9aa('0x3b')])){logger[_0xd9aa('0xd')](_0xd9aa('0x3c'),_0x416418[_0xd9aa('0x3b')]);return analyticCustomReportController[_0xd9aa('0x3d')]({'id':_0x416418[_0xd9aa('0x3b')]},_0x2bdb42)['then'](handleResult(_0x416418))[_0xd9aa('0x33')](handleError());}}catch(_0x4d4d6f){logger[_0xd9aa('0x30')](JSON[_0xd9aa('0x32')](_0x4d4d6f));}return logger['info'](_0xd9aa('0x3e'));};}function getJobs(_0xa1e1ec){var _0x5bdf5b={};if(_0xa1e1ec){_0x5bdf5b['id']=_0xa1e1ec;}return db[_0xd9aa('0x3f')]['findAll']({'where':_0x5bdf5b,'include':[{'model':db[_0xd9aa('0x10')],'attributes':['id',_0xd9aa('0x1b'),_0xd9aa('0xf')],'include':[{'model':db[_0xd9aa('0x40')],'as':_0xd9aa('0x11')}]}]})[_0xd9aa('0x2f')](function(_0x24a67c){var _0x46e596=_[_0xd9aa('0x41')](manager[_0xd9aa('0x42')]);var _0x560948=_['map'](_0x24a67c,function(_0x1f52e6){return _0x1f52e6['id'][_0xd9aa('0x43')]();});var _0x12eb21=_[_0xd9aa('0x44')](_0x24a67c,function(_0x2cbcbd){return _0x2cbcbd['id']['toString']();});var _0xb667ce=_0xa1e1ec?_0x560948:_['difference'](_0x560948,_0x46e596);var _0x733d02=_[_0xd9aa('0x45')](_0x560948,_0x46e596);var _0x22d3b2=_[_0xd9aa('0x46')](_0x46e596,_0x560948);var _0x3d9186;var _0x34e0b7;for(_0x3d9186=0x0;_0x3d9186<_0x22d3b2[_0xd9aa('0x47')]&&!_0xa1e1ec;_0x3d9186+=0x1){_0x34e0b7=_0x22d3b2[_0x3d9186][_0xd9aa('0x43')]();if(manager[_0xd9aa('0x48')](_0x34e0b7)){manager[_0xd9aa('0x49')](_0x34e0b7);manager[_0xd9aa('0x4a')](_0x34e0b7);logger[_0xd9aa('0xd')](_0xd9aa('0x4b'),_0x34e0b7);}}logger['info'](_0xd9aa('0x4c'),JSON[_0xd9aa('0x32')](_0xb667ce));for(_0x3d9186=0x0;_0x3d9186<_0xb667ce[_0xd9aa('0x47')];_0x3d9186+=0x1){_0x34e0b7=_0xb667ce[_0x3d9186][_0xd9aa('0x43')]();logger[_0xd9aa('0xd')]('index',_0x34e0b7);if(_0xa1e1ec){logger[_0xd9aa('0xd')]('my\x20id',_0xa1e1ec);logger[_0xd9aa('0xd')](JSON[_0xd9aa('0x32')](_0x12eb21[_0x34e0b7]));BPromise[_0xd9aa('0x4d')]()['then'](handleJob(_0x12eb21[_0x34e0b7]));logger[_0xd9aa('0xd')](_0xd9aa('0x4e'),_0x12eb21[_0x34e0b7][_0xd9aa('0x1b')],_0x12eb21[_0x34e0b7][_0xd9aa('0x4f')]);}else if(_0x12eb21[_0x34e0b7]['cron']&&_0x12eb21[_0x34e0b7][_0xd9aa('0x50')]&&moment()[_0xd9aa('0x51')](_0x12eb21[_0x34e0b7]['startAt'],_0x12eb21[_0x34e0b7][_0xd9aa('0x52')])){manager[_0xd9aa('0x53')](_0x34e0b7,_0x12eb21[_0x34e0b7]['cron'],handleJob(_0x12eb21[_0x34e0b7]));manager[_0xd9aa('0x54')](_0x34e0b7);logger[_0xd9aa('0xd')]('add\x20cron',_0x12eb21[_0x34e0b7]['name'],_0x12eb21[_0x34e0b7][_0xd9aa('0x4f')]);}else if(manager[_0xd9aa('0x48')](_0x34e0b7)){manager[_0xd9aa('0x49')](_0x34e0b7);manager[_0xd9aa('0x4a')](_0x34e0b7);logger[_0xd9aa('0xd')](_0xd9aa('0x55'),_0x12eb21[_0x34e0b7][_0xd9aa('0x1b')],_0x12eb21[_0x34e0b7]['cron']);}}for(_0x3d9186=0x0,_0x34e0b7;_0x3d9186<_0x733d02[_0xd9aa('0x47')]&&!_0xa1e1ec;_0x3d9186+=0x1){_0x34e0b7=_0x733d02[_0x3d9186]['toString']();if(manager[_0xd9aa('0x48')](_0x34e0b7)){if(_0x12eb21[_0x34e0b7][_0xd9aa('0x4f')]&&_0x12eb21[_0x34e0b7][_0xd9aa('0x50')]&&moment()[_0xd9aa('0x51')](_0x12eb21[_0x34e0b7]['startAt'],_0x12eb21[_0x34e0b7][_0xd9aa('0x52')])){manager[_0xd9aa('0x56')](_0x34e0b7,_0x12eb21[_0x34e0b7][_0xd9aa('0x4f')],handleJob(_0x12eb21[_0x34e0b7]));logger[_0xd9aa('0xd')]('update\x20cron',_0x12eb21[_0x34e0b7]['name'],_0x12eb21[_0x34e0b7][_0xd9aa('0x4f')]);}else{manager[_0xd9aa('0x49')](_0x34e0b7);manager[_0xd9aa('0x4a')](_0x34e0b7);logger[_0xd9aa('0xd')](_0xd9aa('0x55'),_0x12eb21[_0x34e0b7][_0xd9aa('0x1b')],_0x12eb21[_0x34e0b7][_0xd9aa('0x4f')]);}}}})[_0xd9aa('0x33')](function(_0x229dc4){logger[_0xd9aa('0x30')](JSON[_0xd9aa('0x32')](_0x229dc4));});}exports[_0xd9aa('0x57')]=function(_0x2cdfaa){return getJobs(_0x2cdfaa);};exports[_0xd9aa('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 225e52d..6b1b57f 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb436=['Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','destroy','CmContact','finished\x20populating','contacts1','CmHopper','then','bulkCreate','log','hopper1','contacts2','catch','push'];(function(_0x1038fe,_0xf39a26){var _0x33b526=function(_0x33d712){while(--_0x33d712){_0x1038fe['push'](_0x1038fe['shift']());}};_0x33b526(++_0xf39a26);}(_0xb436,0x1b9));var _0x6b43=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0xb436[_0x3c4062];return _0x3f5bf3;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6b43('0x0')]({'id':i,'firstName':_0x6b43('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x6b43('0x2')+i+_0x6b43('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x6b43('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6b43('0x4')](),'updatedAt':Date[_0x6b43('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6b43('0x0')]({'id':i,'firstName':_0x6b43('0x1')+i,'lastName':_0x6b43('0x5')+i,'phone':0xf879fb460+i,'email':_0x6b43('0x2')+i+_0x6b43('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6b43('0x0')]({'id':i,'active':![],'scheduledat':Date[_0x6b43('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6b43('0x4')](),'updatedAt':Date['now']()});}db['CmContact'][_0x6b43('0x6')]({'where':{}})['then'](function(){return db[_0x6b43('0x7')]['bulkCreate'](contacts);})['then'](function(){console['log'](_0x6b43('0x8'),_0x6b43('0x9'));return db[_0x6b43('0xa')][_0x6b43('0x6')]({'where':{}});})[_0x6b43('0xb')](function(){return db[_0x6b43('0xa')][_0x6b43('0xc')](hopper);})[_0x6b43('0xb')](function(){console[_0x6b43('0xd')](_0x6b43('0x8'),_0x6b43('0xe'));return db[_0x6b43('0x7')][_0x6b43('0xc')](contacts2);})[_0x6b43('0xb')](function(){console[_0x6b43('0xd')](_0x6b43('0x8'),_0x6b43('0xf'));return db[_0x6b43('0xa')][_0x6b43('0xc')](hopper2);})[_0x6b43('0xb')](function(){console[_0x6b43('0xd')](_0x6b43('0x8'),'hopper2');})[_0x6b43('0x10')](function(_0x3509f4){console[_0x6b43('0xd')](_0x3509f4);}); \ No newline at end of file +var _0x1e87=['hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','destroy','then','CmContact','bulkCreate','log','finished\x20populating','contacts1','CmHopper'];(function(_0x2e890e,_0x1a22b7){var _0x5d2b7f=function(_0x464442){while(--_0x464442){_0x2e890e['push'](_0x2e890e['shift']());}};_0x5d2b7f(++_0x1a22b7);}(_0x1e87,0x194));var _0x71e8=function(_0xff5df6,_0x514e73){_0xff5df6=_0xff5df6-0x0;var _0x2634bb=_0x1e87[_0xff5df6];return _0x2634bb;};'use strict';var util=require(_0x71e8('0x0'));var db=require(_0x71e8('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x71e8('0x2')]({'id':i,'firstName':_0x71e8('0x3')+i,'lastName':_0x71e8('0x4')+i,'phone':0xf879fb460+i,'email':_0x71e8('0x5')+i+_0x71e8('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x71e8('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x71e8('0x7')](),'updatedAt':Date[_0x71e8('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x71e8('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x71e8('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x71e8('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x71e8('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x71e8('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x71e8('0x7')](),'updatedAt':Date['now']()});}db['CmContact'][_0x71e8('0x8')]({'where':{}})[_0x71e8('0x9')](function(){return db[_0x71e8('0xa')][_0x71e8('0xb')](contacts);})[_0x71e8('0x9')](function(){console[_0x71e8('0xc')](_0x71e8('0xd'),_0x71e8('0xe'));return db[_0x71e8('0xf')]['destroy']({'where':{}});})[_0x71e8('0x9')](function(){return db['CmHopper'][_0x71e8('0xb')](hopper);})[_0x71e8('0x9')](function(){console['log'](_0x71e8('0xd'),_0x71e8('0x10'));return db[_0x71e8('0xa')][_0x71e8('0xb')](contacts2);})[_0x71e8('0x9')](function(){console[_0x71e8('0xc')](_0x71e8('0xd'),_0x71e8('0x11'));return db[_0x71e8('0xf')]['bulkCreate'](hopper2);})[_0x71e8('0x9')](function(){console[_0x71e8('0xc')](_0x71e8('0xd'),_0x71e8('0x12'));})[_0x71e8('0x13')](function(_0x1627eb){console[_0x71e8('0xc')](_0x1627eb);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 846754f..a7669f2 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2f0=['wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','then','log','add\x20user','util','../mysqldb','%s%s','agent','format','%s%s@xcally.com','password','friend','udp'];(function(_0x24ac68,_0x2fc255){var _0x1fae4a=function(_0x2e6ae0){while(--_0x2e6ae0){_0x24ac68['push'](_0x24ac68['shift']());}};_0x1fae4a(++_0x2fc255);}(_0xd2f0,0x6f));var _0x0d2f=function(_0x48ab56,_0x4f30f8){_0x48ab56=_0x48ab56-0x0;var _0x1427db=_0xd2f0[_0x48ab56];return _0x1427db;};'use strict';var util=require(_0x0d2f('0x0'));var db=require(_0x0d2f('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0x0d2f('0x2'),_0x0d2f('0x3'),i),'fullname':util[_0x0d2f('0x4')](_0x0d2f('0x2'),_0x0d2f('0x3'),i),'email':util['format'](_0x0d2f('0x5'),_0x0d2f('0x3'),i),'role':_0x0d2f('0x3'),'password':_0x0d2f('0x6'),'internal':0xfa0+i,'type':_0x0d2f('0x7'),'transport':[_0x0d2f('0x8'),'ws',_0x0d2f('0x9')],'disallow':[_0x0d2f('0xa')],'allow':[_0x0d2f('0xb')],'defaultuser':util[_0x0d2f('0x4')](_0x0d2f('0x2'),_0x0d2f('0x3'),i),'encryption':'yes','avpf':_0x0d2f('0xc'),'force_avp':'yes','icesupport':_0x0d2f('0xc'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x0d2f('0xd'),'dtlsprivatekey':_0x0d2f('0xe'),'dtlssetup':'actpass','callerid':util[_0x0d2f('0x4')](_0x0d2f('0xf'),util[_0x0d2f('0x4')](_0x0d2f('0x2'),_0x0d2f('0x3'),i),0xfa0+i)});}db[_0x0d2f('0x10')]['bulkCreate'](users)[_0x0d2f('0x11')](function(){console[_0x0d2f('0x12')](_0x0d2f('0x13'));})['catch'](function(_0x40204a){console['log'](_0x40204a);}); \ No newline at end of file +var _0x0e44=['all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log','util','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com','password','wss'];(function(_0xc6583e,_0x3e854a){var _0x11f67e=function(_0x7b32db){while(--_0x7b32db){_0xc6583e['push'](_0xc6583e['shift']());}};_0x11f67e(++_0x3e854a);}(_0x0e44,0x1bf));var _0x40e4=function(_0x88e1f5,_0x4cadc4){_0x88e1f5=_0x88e1f5-0x0;var _0xa6e625=_0x0e44[_0x88e1f5];return _0xa6e625;};'use strict';var util=require(_0x40e4('0x0'));var db=require(_0x40e4('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x40e4('0x2')]({'name':util['format'](_0x40e4('0x3'),_0x40e4('0x4'),i),'fullname':util[_0x40e4('0x5')](_0x40e4('0x3'),_0x40e4('0x4'),i),'email':util[_0x40e4('0x5')](_0x40e4('0x6'),_0x40e4('0x4'),i),'role':'agent','password':_0x40e4('0x7'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws',_0x40e4('0x8')],'disallow':[_0x40e4('0x9')],'allow':[_0x40e4('0xa')],'defaultuser':util[_0x40e4('0x5')]('%s%s',_0x40e4('0x4'),i),'encryption':_0x40e4('0xb'),'avpf':_0x40e4('0xb'),'force_avp':_0x40e4('0xb'),'icesupport':_0x40e4('0xb'),'dtlsenable':_0x40e4('0xb'),'dtlsverify':'no','dtlscertfile':_0x40e4('0xc'),'dtlsprivatekey':_0x40e4('0xd'),'dtlssetup':_0x40e4('0xe'),'callerid':util[_0x40e4('0x5')]('\x22%s\x22\x20<%s>',util[_0x40e4('0x5')](_0x40e4('0x3'),'agent',i),0xfa0+i)});}db[_0x40e4('0xf')][_0x40e4('0x10')](users)[_0x40e4('0x11')](function(){console['log']('add\x20user');})['catch'](function(_0xec1e01){console[_0x40e4('0x12')](_0xec1e01);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index dea70a0..c9b0b7c 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ae4=['SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','Campaign','user','VoiceQueue','Trunks','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','chat','fax','sms','mail','openchannel','telephone:%s','campaign:%s:%s','removeChatInteractions','user_has_chat_interactions:remove','emit','user_has_mail_interactions:remove','leave','FaxInteractions','removeFaxInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','catch','log','join','connection','address','request','remotePort','connectedAt','SocketIO\x20','nsp','DISCONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','ivr','UserProfileSection','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','then','map','resourceId','role','where','format','length','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions','FaxInteraction'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x4ae4,0x193));var _0x44ae=function(_0x4cbf9c,_0xac5c3e){_0x4cbf9c=_0x4cbf9c-0x0;var _0x344e25=_0x4ae4[_0x4cbf9c];return _0x344e25;};'use strict';var _=require(_0x44ae('0x0'));var util=require('util');var BPromise=require(_0x44ae('0x1'));var db=require(_0x44ae('0x2'))['db'];var config=require(_0x44ae('0x3'));var queryQueues={'attributes':['id',_0x44ae('0x4')],'include':[{'as':_0x44ae('0x5'),'model':db[_0x44ae('0x6')],'attributes':['id',_0x44ae('0x4'),'role'],'raw':!![],'where':{'role':_0x44ae('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x44ae('0x4')],'where':{'role':_0x44ae('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x44ae('0x4')],'where':{'role':_0x44ae('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x44ae('0x4'),_0x44ae('0x9')],'where':{'type':_0x44ae('0xa')}};function getAssociatedResources(_0x1718ac,_0x310fbd,_0x559fa8){return db[_0x44ae('0xb')]['findOne']({'where':{'name':_0x1718ac,'userProfileId':_0x310fbd},'raw':!![]})['then'](function(_0x60f2e2){if(_0x60f2e2){if(_0x60f2e2['autoAssociation']){switch(_0x1718ac){case _0x44ae('0xc'):case _0x44ae('0xd'):case _0x44ae('0xe'):case _0x44ae('0xf'):case _0x44ae('0x10'):case _0x44ae('0x11'):return db[_0x559fa8][_0x44ae('0x12')](queryQueues);case _0x44ae('0x13'):return db[_0x559fa8][_0x44ae('0x12')](queryTelephones);case'Trunks':return db[_0x559fa8][_0x44ae('0x12')](queryTrunks);case _0x44ae('0x14'):return db[_0x559fa8]['findAll'](queryCampaigns);}}else{return db[_0x44ae('0x15')][_0x44ae('0x12')]({'attributes':['resourceId'],'where':{'sectionId':_0x60f2e2['id']},'raw':!![]})[_0x44ae('0x16')](function(_0x4d098f){if(_0x4d098f){var _0x13ba9c={'where':{'id':_[_0x44ae('0x17')](_0x4d098f,_0x44ae('0x18'))},'raw':!![]};switch(_0x559fa8){case'User':_0x13ba9c['where'][_0x44ae('0x19')]=_0x44ae('0x8');break;case'Campaign':_0x13ba9c[_0x44ae('0x1a')][_0x44ae('0x9')]=_0x44ae('0xa');break;}return db[_0x559fa8][_0x44ae('0x12')](_0x13ba9c);}else{return[];}});}}else{return[];}})[_0x44ae('0x16')](function(_0x5bd21b){return _0x5bd21b;});}function joinOrLeaveQueues(_0x2ae418,_0x347516,_0x2a1fa7,_0x4ff288){_0x2ae418[_0x347516](util[_0x44ae('0x1b')]('%s:queue:%s',_0x2a1fa7,_0x4ff288[_0x44ae('0x4')]));if(_0x4ff288[_0x44ae('0x5')]){for(var _0x3393c7=0x0;_0x3393c7<_0x4ff288['Agents'][_0x44ae('0x1c')];_0x3393c7+=0x1){_0x2ae418[_0x347516](util[_0x44ae('0x1b')](_0x44ae('0x1d'),_0x4ff288[_0x44ae('0x5')][_0x3393c7][_0x44ae('0x4')]));}}}function joinOrLeave(_0x1c6a1e,_0x2cd89b,_0x309df4){var _0x3cce09;if(_0x1c6a1e[_0x44ae('0x1e')]['query']['id']){db[_0x44ae('0x6')][_0x44ae('0x1f')]({'attributes':['id',_0x44ae('0x4'),_0x44ae('0x19'),_0x44ae('0x20')],'where':{'id':_0x1c6a1e[_0x44ae('0x1e')][_0x44ae('0x21')]['id']},'include':[{'model':db[_0x44ae('0x22')],'as':_0x44ae('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x44ae('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x44ae('0x25')],'as':_0x44ae('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x44ae('0x27')],'as':_0x44ae('0x28'),'attributes':['id'],'raw':!![]}]})[_0x44ae('0x16')](function(_0x3e1f2c){if(_0x3e1f2c){_0x3cce09=_0x3e1f2c;_0x1c6a1e[_0x2cd89b](util[_0x44ae('0x1b')](_0x44ae('0x1d'),_0x3e1f2c[_0x44ae('0x4')]));var _0x24351c=[];switch(_0x3e1f2c[_0x44ae('0x19')]){case'admin':_0x1c6a1e[_0x2cd89b](_0x44ae('0x29'));_0x1c6a1e[_0x2cd89b](_0x44ae('0x2a'));if(queryQueues[_0x44ae('0x2b')](_0x44ae('0x2c'))){delete queryQueues[_0x44ae('0x2c')];}_0x24351c[_0x44ae('0x2d')](db['VoiceQueue']['findAll'](queryQueues));_0x24351c['push'](db[_0x44ae('0x2e')][_0x44ae('0x12')](queryQueues));_0x24351c['push'](db[_0x44ae('0x2f')][_0x44ae('0x12')](queryQueues));_0x24351c['push'](db[_0x44ae('0x30')]['findAll'](queryQueues));_0x24351c[_0x44ae('0x2d')](db['MailQueue'][_0x44ae('0x12')](queryQueues));_0x24351c[_0x44ae('0x2d')](db[_0x44ae('0x31')]['findAll'](queryQueues));_0x24351c[_0x44ae('0x2d')](db[_0x44ae('0x6')][_0x44ae('0x12')](queryTelephones));_0x24351c[_0x44ae('0x2d')](db['Trunk'][_0x44ae('0x12')](queryTrunks));_0x24351c['push'](db[_0x44ae('0x32')][_0x44ae('0x12')](queryCampaigns));_0x24351c['push'](db[_0x44ae('0x6')][_0x44ae('0x12')](queryAgents));break;case _0x44ae('0x33'):_0x1c6a1e[_0x2cd89b]('voice:inbound');_0x1c6a1e[_0x2cd89b](_0x44ae('0x2a'));_0x24351c[_0x44ae('0x2d')](getAssociatedResources(_0x44ae('0xc'),_0x3e1f2c[_0x44ae('0x20')],_0x44ae('0x34')));_0x24351c[_0x44ae('0x2d')](getAssociatedResources('ChatQueues',_0x3e1f2c[_0x44ae('0x20')],_0x44ae('0x2e')));_0x24351c[_0x44ae('0x2d')](getAssociatedResources('FaxQueues',_0x3e1f2c[_0x44ae('0x20')],_0x44ae('0x2f')));_0x24351c[_0x44ae('0x2d')](getAssociatedResources(_0x44ae('0xf'),_0x3e1f2c['userProfileId'],'SmsQueue'));_0x24351c[_0x44ae('0x2d')](getAssociatedResources(_0x44ae('0x10'),_0x3e1f2c['userProfileId'],'MailQueue'));_0x24351c[_0x44ae('0x2d')](getAssociatedResources(_0x44ae('0x11'),_0x3e1f2c[_0x44ae('0x20')],_0x44ae('0x31')));_0x24351c[_0x44ae('0x2d')](getAssociatedResources(_0x44ae('0x13'),_0x3e1f2c[_0x44ae('0x20')],'User'));_0x24351c[_0x44ae('0x2d')](getAssociatedResources(_0x44ae('0x35'),_0x3e1f2c[_0x44ae('0x20')],_0x44ae('0x36')));_0x24351c[_0x44ae('0x2d')](getAssociatedResources(_0x44ae('0x14'),_0x3e1f2c[_0x44ae('0x20')],_0x44ae('0x32')));_0x24351c[_0x44ae('0x2d')](db['User'][_0x44ae('0x12')](queryAgents));break;case _0x44ae('0x7'):_0x1c6a1e[_0x2cd89b](_0x44ae('0x29'));_0x1c6a1e[_0x2cd89b](_0x44ae('0x2a'));_0x24351c[_0x44ae('0x2d')](_0x3e1f2c[_0x44ae('0x37')]({'attributes':['id',_0x44ae('0x4')]}));_0x24351c[_0x44ae('0x2d')](_0x3e1f2c[_0x44ae('0x38')]({'attributes':['id','name']}));_0x24351c[_0x44ae('0x2d')](_0x3e1f2c[_0x44ae('0x39')]({'attributes':['id',_0x44ae('0x4')]}));_0x24351c[_0x44ae('0x2d')](_0x3e1f2c[_0x44ae('0x3a')]({'attributes':['id','name']}));_0x24351c[_0x44ae('0x2d')](_0x3e1f2c[_0x44ae('0x3b')]({'attributes':['id',_0x44ae('0x4')]}));_0x24351c['push'](_0x3e1f2c[_0x44ae('0x3c')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x24351c);}})[_0x44ae('0x16')](function(_0x20ae57){if(_0x20ae57&&_0x20ae57['length']){for(var _0x5453cb=0x0;_0x5453cb<_0x20ae57[_0x44ae('0x1c')];_0x5453cb+=0x1){for(var _0x1b7795=0x0;_0x1b7795<_0x20ae57[_0x5453cb]['length'];_0x1b7795+=0x1){switch(_0x5453cb){case 0x0:joinOrLeaveQueues(_0x1c6a1e,_0x2cd89b,'voice',_0x20ae57[_0x5453cb][_0x1b7795]);break;case 0x1:joinOrLeaveQueues(_0x1c6a1e,_0x2cd89b,_0x44ae('0x3d'),_0x20ae57[_0x5453cb][_0x1b7795]);break;case 0x2:joinOrLeaveQueues(_0x1c6a1e,_0x2cd89b,_0x44ae('0x3e'),_0x20ae57[_0x5453cb][_0x1b7795]);break;case 0x3:joinOrLeaveQueues(_0x1c6a1e,_0x2cd89b,_0x44ae('0x3f'),_0x20ae57[_0x5453cb][_0x1b7795]);break;case 0x4:joinOrLeaveQueues(_0x1c6a1e,_0x2cd89b,_0x44ae('0x40'),_0x20ae57[_0x5453cb][_0x1b7795]);break;case 0x5:joinOrLeaveQueues(_0x1c6a1e,_0x2cd89b,_0x44ae('0x41'),_0x20ae57[_0x5453cb][_0x1b7795]);break;case 0x6:_0x1c6a1e[_0x2cd89b](util[_0x44ae('0x1b')](_0x44ae('0x42'),_0x20ae57[_0x5453cb][_0x1b7795][_0x44ae('0x4')]));break;case 0x7:_0x1c6a1e[_0x2cd89b](util['format']('trunk:%s',_0x20ae57[_0x5453cb][_0x1b7795][_0x44ae('0x4')]));break;case 0x8:_0x1c6a1e[_0x2cd89b](util[_0x44ae('0x1b')](_0x44ae('0x43'),_0x20ae57[_0x5453cb][_0x1b7795][_0x44ae('0x9')],_0x20ae57[_0x5453cb][_0x1b7795][_0x44ae('0x4')]));break;case 0x9:_0x1c6a1e[_0x2cd89b](util[_0x44ae('0x1b')]('user:%s',_0x20ae57[_0x5453cb][_0x1b7795][_0x44ae('0x4')]));break;}}}}})[_0x44ae('0x16')](function(){if(_0x2cd89b==='leave'){var _0x2528da=_[_0x44ae('0x17')](_0x3cce09[_0x44ae('0x23')],'id');return _0x3cce09[_0x44ae('0x44')](_0x2528da)[_0x44ae('0x16')](function(){for(var _0x224c07=0x0;_0x224c07<_0x2528da[_0x44ae('0x1c')];_0x224c07+=0x1){_0x309df4['emit'](_0x44ae('0x45'),{'ChatInteractionId':Number(_0x2528da[_0x224c07]),'UserId':Number(_0x3cce09['id'])});}});}})[_0x44ae('0x16')](function(){if(_0x2cd89b==='leave'){var _0x15c01e=_['map'](_0x3cce09['MailInteractions'],'id');return _0x3cce09['removeMailInteractions'](_0x15c01e)[_0x44ae('0x16')](function(){for(var _0x2c7ea2=0x0;_0x2c7ea2<_0x15c01e[_0x44ae('0x1c')];_0x2c7ea2+=0x1){_0x309df4[_0x44ae('0x46')](_0x44ae('0x47'),{'MailInteractionId':Number(_0x15c01e[_0x2c7ea2]),'UserId':Number(_0x3cce09['id'])});}});}})[_0x44ae('0x16')](function(){if(_0x2cd89b===_0x44ae('0x48')){var _0x142007=_[_0x44ae('0x17')](_0x3cce09[_0x44ae('0x49')],'id');return _0x3cce09[_0x44ae('0x4a')](_0x142007)[_0x44ae('0x16')](function(){for(var _0x42d952=0x0;_0x42d952<_0x142007[_0x44ae('0x1c')];_0x42d952+=0x1){_0x309df4['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x142007[_0x42d952]),'UserId':Number(_0x3cce09['id'])});}});}})[_0x44ae('0x16')](function(){if(_0x2cd89b===_0x44ae('0x48')){var _0x4269ee=_[_0x44ae('0x17')](_0x3cce09[_0x44ae('0x26')],'id');return _0x3cce09['removeSmsInteractions'](_0x4269ee)[_0x44ae('0x16')](function(){for(var _0x220cd5=0x0;_0x220cd5<_0x4269ee['length'];_0x220cd5+=0x1){_0x309df4[_0x44ae('0x46')](_0x44ae('0x4b'),{'SmsInteractionId':Number(_0x4269ee[_0x220cd5]),'UserId':Number(_0x3cce09['id'])});}});}})[_0x44ae('0x16')](function(){if(_0x2cd89b===_0x44ae('0x48')){var _0x3e41ca=_[_0x44ae('0x17')](_0x3cce09['OpenchannelInteractions'],'id');return _0x3cce09['removeOpenchannelInteractions'](_0x3e41ca)[_0x44ae('0x16')](function(){for(var _0x3fd413=0x0;_0x3fd413<_0x3e41ca['length'];_0x3fd413+=0x1){_0x309df4[_0x44ae('0x46')](_0x44ae('0x4c'),{'OpenchannelInteractionId':Number(_0x3e41ca[_0x3fd413]),'UserId':Number(_0x3cce09['id'])});}});}})[_0x44ae('0x4d')](function(_0xb7b137){_0x1c6a1e[_0x44ae('0x4e')](_0xb7b137);});}}function onDisconnect(_0x285254,_0x431b29){joinOrLeave(_0x285254,'leave',_0x431b29);}function onConnect(_0x47e2d8){joinOrLeave(_0x47e2d8,_0x44ae('0x4f'));}exports['default']=function(_0x2db978){_0x2db978['on'](_0x44ae('0x50'),function(_0x2d4fa2){_0x2d4fa2['setMaxListeners'](0x0);_0x2d4fa2[_0x44ae('0x51')]=_0x2d4fa2[_0x44ae('0x52')][_0x44ae('0x50')]['remoteAddress']+':'+_0x2d4fa2[_0x44ae('0x52')][_0x44ae('0x50')][_0x44ae('0x53')];_0x2d4fa2[_0x44ae('0x54')]=new Date();_0x2d4fa2[_0x44ae('0x4e')]=function(_0x3d1d60){console['log'](_0x44ae('0x55')+_0x2d4fa2[_0x44ae('0x56')][_0x44ae('0x4')]+'['+_0x2d4fa2[_0x44ae('0x51')]+']',_0x3d1d60);};_0x2d4fa2['on']('disconnect',function(){onDisconnect(_0x2d4fa2,_0x2db978);_0x2d4fa2['log'](_0x44ae('0x57'));});onConnect(_0x2d4fa2);_0x2d4fa2[_0x44ae('0x4e')]('CONNECTED');});}; \ No newline at end of file +var _0xe8bd=['where','Campaign','format','length','user:%s','handshake','query','find','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','OpenchannelInteraction','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','user','voice:inbound','userProfileId','MailQueue','OpenchannelQueue','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','sms','mail','openchannel','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','map','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','ivr','findOne','then','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId'];(function(_0x142f78,_0x168833){var _0x338117=function(_0x1d34ab){while(--_0x1d34ab){_0x142f78['push'](_0x142f78['shift']());}};_0x338117(++_0x168833);}(_0xe8bd,0x9f));var _0xde8b=function(_0x2163d0,_0x5d3605){_0x2163d0=_0x2163d0-0x0;var _0x476c03=_0xe8bd[_0x2163d0];return _0x476c03;};'use strict';var _=require(_0xde8b('0x0'));var util=require('util');var BPromise=require(_0xde8b('0x1'));var db=require(_0xde8b('0x2'))['db'];var config=require(_0xde8b('0x3'));var queryQueues={'attributes':['id',_0xde8b('0x4')],'include':[{'as':_0xde8b('0x5'),'model':db[_0xde8b('0x6')],'attributes':['id',_0xde8b('0x4'),_0xde8b('0x7')],'raw':!![],'where':{'role':_0xde8b('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xde8b('0x4')],'where':{'role':_0xde8b('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xde8b('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xde8b('0x4')],'where':{'role':_0xde8b('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xde8b('0x4'),_0xde8b('0xa')],'where':{'type':_0xde8b('0xb')}};function getAssociatedResources(_0x373c75,_0x538768,_0x49477a){return db['UserProfileSection'][_0xde8b('0xc')]({'where':{'name':_0x373c75,'userProfileId':_0x538768},'raw':!![]})[_0xde8b('0xd')](function(_0x55c227){if(_0x55c227){if(_0x55c227['autoAssociation']){switch(_0x373c75){case'VoiceQueues':case _0xde8b('0xe'):case _0xde8b('0xf'):case _0xde8b('0x10'):case _0xde8b('0x11'):case _0xde8b('0x12'):return db[_0x49477a][_0xde8b('0x13')](queryQueues);case _0xde8b('0x14'):return db[_0x49477a]['findAll'](queryTelephones);case _0xde8b('0x15'):return db[_0x49477a][_0xde8b('0x13')](queryTrunks);case _0xde8b('0x16'):return db[_0x49477a][_0xde8b('0x13')](queryCampaigns);}}else{return db[_0xde8b('0x17')][_0xde8b('0x13')]({'attributes':[_0xde8b('0x18')],'where':{'sectionId':_0x55c227['id']},'raw':!![]})[_0xde8b('0xd')](function(_0xd25a08){if(_0xd25a08){var _0x3abf38={'where':{'id':_['map'](_0xd25a08,_0xde8b('0x18'))},'raw':!![]};switch(_0x49477a){case _0xde8b('0x6'):_0x3abf38[_0xde8b('0x19')][_0xde8b('0x7')]=_0xde8b('0x9');break;case _0xde8b('0x1a'):_0x3abf38[_0xde8b('0x19')][_0xde8b('0xa')]=_0xde8b('0xb');break;}return db[_0x49477a]['findAll'](_0x3abf38);}else{return[];}});}}else{return[];}})[_0xde8b('0xd')](function(_0x318922){return _0x318922;});}function joinOrLeaveQueues(_0x222031,_0x59bb3a,_0x1e2ceb,_0x37ebc9){_0x222031[_0x59bb3a](util[_0xde8b('0x1b')]('%s:queue:%s',_0x1e2ceb,_0x37ebc9[_0xde8b('0x4')]));if(_0x37ebc9[_0xde8b('0x5')]){for(var _0x3c157f=0x0;_0x3c157f<_0x37ebc9[_0xde8b('0x5')][_0xde8b('0x1c')];_0x3c157f+=0x1){_0x222031[_0x59bb3a](util['format'](_0xde8b('0x1d'),_0x37ebc9['Agents'][_0x3c157f][_0xde8b('0x4')]));}}}function joinOrLeave(_0x1a1369,_0x187989,_0x429cc2){var _0xe67577;if(_0x1a1369[_0xde8b('0x1e')][_0xde8b('0x1f')]['id']){db[_0xde8b('0x6')][_0xde8b('0x20')]({'attributes':['id',_0xde8b('0x4'),'role','userProfileId'],'where':{'id':_0x1a1369[_0xde8b('0x1e')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0xde8b('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0xde8b('0x22')],'as':_0xde8b('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xde8b('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xde8b('0x25')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xde8b('0x26')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})[_0xde8b('0xd')](function(_0x8ae7b7){if(_0x8ae7b7){_0xe67577=_0x8ae7b7;_0x1a1369[_0x187989](util[_0xde8b('0x1b')](_0xde8b('0x1d'),_0x8ae7b7[_0xde8b('0x4')]));var _0x44752e=[];switch(_0x8ae7b7['role']){case _0xde8b('0x27'):_0x1a1369[_0x187989]('voice:inbound');_0x1a1369[_0x187989](_0xde8b('0x28'));if(queryQueues[_0xde8b('0x29')](_0xde8b('0x2a'))){delete queryQueues[_0xde8b('0x2a')];}_0x44752e[_0xde8b('0x2b')](db[_0xde8b('0x2c')]['findAll'](queryQueues));_0x44752e[_0xde8b('0x2b')](db[_0xde8b('0x2d')][_0xde8b('0x13')](queryQueues));_0x44752e[_0xde8b('0x2b')](db[_0xde8b('0x2e')][_0xde8b('0x13')](queryQueues));_0x44752e[_0xde8b('0x2b')](db[_0xde8b('0x2f')][_0xde8b('0x13')](queryQueues));_0x44752e[_0xde8b('0x2b')](db['MailQueue'][_0xde8b('0x13')](queryQueues));_0x44752e[_0xde8b('0x2b')](db['OpenchannelQueue'][_0xde8b('0x13')](queryQueues));_0x44752e[_0xde8b('0x2b')](db[_0xde8b('0x6')][_0xde8b('0x13')](queryTelephones));_0x44752e[_0xde8b('0x2b')](db['Trunk'][_0xde8b('0x13')](queryTrunks));_0x44752e[_0xde8b('0x2b')](db['Campaign']['findAll'](queryCampaigns));_0x44752e[_0xde8b('0x2b')](db[_0xde8b('0x6')][_0xde8b('0x13')](queryAgents));break;case _0xde8b('0x30'):_0x1a1369[_0x187989](_0xde8b('0x31'));_0x1a1369[_0x187989](_0xde8b('0x28'));_0x44752e[_0xde8b('0x2b')](getAssociatedResources('VoiceQueues',_0x8ae7b7['userProfileId'],_0xde8b('0x2c')));_0x44752e[_0xde8b('0x2b')](getAssociatedResources(_0xde8b('0xe'),_0x8ae7b7[_0xde8b('0x32')],_0xde8b('0x2d')));_0x44752e[_0xde8b('0x2b')](getAssociatedResources('FaxQueues',_0x8ae7b7[_0xde8b('0x32')],_0xde8b('0x2e')));_0x44752e['push'](getAssociatedResources('SmsQueues',_0x8ae7b7['userProfileId'],'SmsQueue'));_0x44752e['push'](getAssociatedResources('MailQueues',_0x8ae7b7[_0xde8b('0x32')],_0xde8b('0x33')));_0x44752e[_0xde8b('0x2b')](getAssociatedResources('OpenchannelQueues',_0x8ae7b7[_0xde8b('0x32')],_0xde8b('0x34')));_0x44752e[_0xde8b('0x2b')](getAssociatedResources(_0xde8b('0x14'),_0x8ae7b7[_0xde8b('0x32')],_0xde8b('0x6')));_0x44752e['push'](getAssociatedResources(_0xde8b('0x15'),_0x8ae7b7[_0xde8b('0x32')],_0xde8b('0x35')));_0x44752e[_0xde8b('0x2b')](getAssociatedResources('IvrCampaigns',_0x8ae7b7[_0xde8b('0x32')],_0xde8b('0x1a')));_0x44752e['push'](db[_0xde8b('0x6')]['findAll'](queryAgents));break;case'agent':_0x1a1369[_0x187989](_0xde8b('0x31'));_0x1a1369[_0x187989](_0xde8b('0x28'));_0x44752e[_0xde8b('0x2b')](_0x8ae7b7[_0xde8b('0x36')]({'attributes':['id',_0xde8b('0x4')]}));_0x44752e['push'](_0x8ae7b7[_0xde8b('0x37')]({'attributes':['id',_0xde8b('0x4')]}));_0x44752e['push'](_0x8ae7b7[_0xde8b('0x38')]({'attributes':['id',_0xde8b('0x4')]}));_0x44752e['push'](_0x8ae7b7[_0xde8b('0x39')]({'attributes':['id',_0xde8b('0x4')]}));_0x44752e[_0xde8b('0x2b')](_0x8ae7b7[_0xde8b('0x3a')]({'attributes':['id',_0xde8b('0x4')]}));_0x44752e[_0xde8b('0x2b')](_0x8ae7b7[_0xde8b('0x3b')]({'attributes':['id',_0xde8b('0x4')]}));break;}return BPromise[_0xde8b('0x3c')](_0x44752e);}})['then'](function(_0x3b56fc){if(_0x3b56fc&&_0x3b56fc['length']){for(var _0x5a018d=0x0;_0x5a018d<_0x3b56fc[_0xde8b('0x1c')];_0x5a018d+=0x1){for(var _0x43776d=0x0;_0x43776d<_0x3b56fc[_0x5a018d]['length'];_0x43776d+=0x1){switch(_0x5a018d){case 0x0:joinOrLeaveQueues(_0x1a1369,_0x187989,'voice',_0x3b56fc[_0x5a018d][_0x43776d]);break;case 0x1:joinOrLeaveQueues(_0x1a1369,_0x187989,'chat',_0x3b56fc[_0x5a018d][_0x43776d]);break;case 0x2:joinOrLeaveQueues(_0x1a1369,_0x187989,'fax',_0x3b56fc[_0x5a018d][_0x43776d]);break;case 0x3:joinOrLeaveQueues(_0x1a1369,_0x187989,_0xde8b('0x3d'),_0x3b56fc[_0x5a018d][_0x43776d]);break;case 0x4:joinOrLeaveQueues(_0x1a1369,_0x187989,_0xde8b('0x3e'),_0x3b56fc[_0x5a018d][_0x43776d]);break;case 0x5:joinOrLeaveQueues(_0x1a1369,_0x187989,_0xde8b('0x3f'),_0x3b56fc[_0x5a018d][_0x43776d]);break;case 0x6:_0x1a1369[_0x187989](util[_0xde8b('0x1b')]('telephone:%s',_0x3b56fc[_0x5a018d][_0x43776d]['name']));break;case 0x7:_0x1a1369[_0x187989](util[_0xde8b('0x1b')](_0xde8b('0x40'),_0x3b56fc[_0x5a018d][_0x43776d]['name']));break;case 0x8:_0x1a1369[_0x187989](util['format'](_0xde8b('0x41'),_0x3b56fc[_0x5a018d][_0x43776d][_0xde8b('0xa')],_0x3b56fc[_0x5a018d][_0x43776d][_0xde8b('0x4')]));break;case 0x9:_0x1a1369[_0x187989](util['format']('user:%s',_0x3b56fc[_0x5a018d][_0x43776d][_0xde8b('0x4')]));break;}}}}})[_0xde8b('0xd')](function(){if(_0x187989===_0xde8b('0x42')){var _0x49dee6=_['map'](_0xe67577[_0xde8b('0x21')],'id');return _0xe67577[_0xde8b('0x43')](_0x49dee6)['then'](function(){for(var _0x305da1=0x0;_0x305da1<_0x49dee6[_0xde8b('0x1c')];_0x305da1+=0x1){_0x429cc2[_0xde8b('0x44')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x49dee6[_0x305da1]),'UserId':Number(_0xe67577['id'])});}});}})[_0xde8b('0xd')](function(){if(_0x187989==='leave'){var _0x2eccbf=_[_0xde8b('0x45')](_0xe67577['MailInteractions'],'id');return _0xe67577[_0xde8b('0x46')](_0x2eccbf)[_0xde8b('0xd')](function(){for(var _0x5bb42b=0x0;_0x5bb42b<_0x2eccbf[_0xde8b('0x1c')];_0x5bb42b+=0x1){_0x429cc2[_0xde8b('0x44')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x2eccbf[_0x5bb42b]),'UserId':Number(_0xe67577['id'])});}});}})[_0xde8b('0xd')](function(){if(_0x187989===_0xde8b('0x42')){var _0x807506=_['map'](_0xe67577['FaxInteractions'],'id');return _0xe67577[_0xde8b('0x47')](_0x807506)['then'](function(){for(var _0x8c5adb=0x0;_0x8c5adb<_0x807506['length'];_0x8c5adb+=0x1){_0x429cc2[_0xde8b('0x44')](_0xde8b('0x48'),{'FaxInteractionId':Number(_0x807506[_0x8c5adb]),'UserId':Number(_0xe67577['id'])});}});}})[_0xde8b('0xd')](function(){if(_0x187989===_0xde8b('0x42')){var _0x239fb1=_['map'](_0xe67577[_0xde8b('0x49')],'id');return _0xe67577['removeSmsInteractions'](_0x239fb1)['then'](function(){for(var _0x3b2678=0x0;_0x3b2678<_0x239fb1['length'];_0x3b2678+=0x1){_0x429cc2[_0xde8b('0x44')](_0xde8b('0x4a'),{'SmsInteractionId':Number(_0x239fb1[_0x3b2678]),'UserId':Number(_0xe67577['id'])});}});}})[_0xde8b('0xd')](function(){if(_0x187989===_0xde8b('0x42')){var _0x30d1f6=_['map'](_0xe67577[_0xde8b('0x4b')],'id');return _0xe67577[_0xde8b('0x4c')](_0x30d1f6)[_0xde8b('0xd')](function(){for(var _0x160a0f=0x0;_0x160a0f<_0x30d1f6[_0xde8b('0x1c')];_0x160a0f+=0x1){_0x429cc2[_0xde8b('0x44')](_0xde8b('0x4d'),{'OpenchannelInteractionId':Number(_0x30d1f6[_0x160a0f]),'UserId':Number(_0xe67577['id'])});}});}})[_0xde8b('0x4e')](function(_0x55cc91){_0x1a1369[_0xde8b('0x4f')](_0x55cc91);});}}function onDisconnect(_0x4322dc,_0xb51724){joinOrLeave(_0x4322dc,_0xde8b('0x42'),_0xb51724);}function onConnect(_0x3d590a){joinOrLeave(_0x3d590a,_0xde8b('0x50'));}exports[_0xde8b('0x51')]=function(_0x5d0462){_0x5d0462['on'](_0xde8b('0x52'),function(_0x122d1d){_0x122d1d[_0xde8b('0x53')](0x0);_0x122d1d[_0xde8b('0x54')]=_0x122d1d[_0xde8b('0x55')]['connection']['remoteAddress']+':'+_0x122d1d[_0xde8b('0x55')][_0xde8b('0x52')][_0xde8b('0x56')];_0x122d1d[_0xde8b('0x57')]=new Date();_0x122d1d[_0xde8b('0x4f')]=function(_0x56718a){console[_0xde8b('0x4f')](_0xde8b('0x58')+_0x122d1d[_0xde8b('0x59')]['name']+'['+_0x122d1d[_0xde8b('0x54')]+']',_0x56718a);};_0x122d1d['on'](_0xde8b('0x5a'),function(){onDisconnect(_0x122d1d,_0x5d0462);_0x122d1d[_0xde8b('0x4f')](_0xde8b('0x5b'));});onConnect(_0x122d1d);_0x122d1d[_0xde8b('0x4f')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 22bd9f0..e5dd83e 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 _0x74df=['afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','newinteraction','Fax','FaxInteraction','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','then','info','EventManager','error','Trigger,\x20%s','get','channel','event','UserId','User','find','name','interface','format','incomingmessage','catch','outgoingmessage','opened','closed','SIP/%s','default','length','hasOwnProperty','model','hook','condition','util','jayson/promise','triggers','client','http','Chat','ChatInteraction','afterCreate'];(function(_0x26e780,_0x5465ba){var _0x2e9594=function(_0x5212df){while(--_0x5212df){_0x26e780['push'](_0x26e780['shift']());}};_0x2e9594(++_0x5465ba);}(_0x74df,0x8b));var _0xf74d=function(_0x479022,_0x51273b){_0x479022=_0x479022-0x0;var _0x496de1=_0x74df[_0x479022];return _0x496de1;};'use strict';var util=require(_0xf74d('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf74d('0x1'));var logger=require('../logger')(_0xf74d('0x2'));var client=jayson[_0xf74d('0x3')][_0xf74d('0x4')]({'port':0x232a});var triggers=[{'channel':_0xf74d('0x5'),'model':_0xf74d('0x6'),'event':_0xf74d('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xf74d('0x5'),'model':'ChatInteraction','event':_0xf74d('0x8'),'condition':_0xf74d('0x9'),'callback':afterUpdate},{'channel':_0xf74d('0x5'),'model':_0xf74d('0xa'),'event':_0xf74d('0x7'),'condition':_0xf74d('0xb'),'callback':afterCreateMessage},{'channel':_0xf74d('0xc'),'model':_0xf74d('0xd'),'event':'afterCreate','condition':_0xf74d('0xe'),'callback':afterCreate},{'channel':_0xf74d('0xc'),'model':_0xf74d('0xd'),'event':'afterUpdate','condition':_0xf74d('0x9'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':_0xf74d('0x7'),'condition':_0xf74d('0xb'),'callback':afterCreateMessage},{'channel':_0xf74d('0xf'),'model':_0xf74d('0x10'),'event':_0xf74d('0x7'),'condition':_0xf74d('0xe'),'callback':afterCreate},{'channel':_0xf74d('0xf'),'model':_0xf74d('0x10'),'event':'afterUpdate','condition':_0xf74d('0x9'),'callback':afterUpdate},{'channel':'Fax','model':'FaxMessage','event':_0xf74d('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0xf74d('0x11'),'event':_0xf74d('0x7'),'condition':_0xf74d('0xe'),'callback':afterCreate},{'channel':'Mail','model':_0xf74d('0x11'),'event':_0xf74d('0x8'),'condition':_0xf74d('0x9'),'callback':afterUpdate},{'channel':'Mail','model':_0xf74d('0x12'),'event':_0xf74d('0x7'),'condition':_0xf74d('0xb'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0xf74d('0x13'),'event':'afterCreate','condition':_0xf74d('0xe'),'callback':afterCreate},{'channel':_0xf74d('0x14'),'model':_0xf74d('0x13'),'event':_0xf74d('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xf74d('0x14'),'model':_0xf74d('0x15'),'event':_0xf74d('0x7'),'condition':_0xf74d('0xb'),'callback':afterCreateMessage}];function request(_0x20d982){return client[_0xf74d('0x16')]('EventManager',_0x20d982)[_0xf74d('0x17')](function(_0x9dc01b){logger[_0xf74d('0x18')]('Trigger,\x20%s',_0xf74d('0x19'),_0x9dc01b);if(_0x9dc01b[_0xf74d('0x1a')]){if(_0x9dc01b[_0xf74d('0x1a')]['code']===0x1f4){logger[_0xf74d('0x1a')]('Trigger,\x20%s',_0xf74d('0x19'),_0x9dc01b['error']);}}})['catch'](function(_0x440e5d){logger['error'](_0xf74d('0x1b'),_0xf74d('0x19'),_0x440e5d);});}function afterCreateMessage(_0x11bf92,_0x1c0031){return function(_0x22f26e,_0x1c5006){_0x22f26e=_0x22f26e[_0xf74d('0x1c')]({'plain':!![]});_0x22f26e[_0xf74d('0x1d')]=_0x11bf92;_0x22f26e[_0xf74d('0x1e')]=_0x22f26e['direction'];if(_0x22f26e[_0xf74d('0x1f')]){return db[_0xf74d('0x20')][_0xf74d('0x21')]({'where':{'id':_0x22f26e[_0xf74d('0x1f')]},'attributes':['id',_0xf74d('0x22')],'raw':!![]})[_0xf74d('0x17')](function(_0x210e4e){_0x22f26e[_0xf74d('0x23')]=util[_0xf74d('0x24')]('SIP/%s',_0x210e4e[_0xf74d('0x22')]);_0x22f26e[_0xf74d('0x1d')]=_0x11bf92;return request({'event':_0xf74d('0x25'),'message':_0x22f26e});})[_0xf74d('0x26')](function(_0x2ef792){console[_0xf74d('0x1a')](_0x2ef792);});}else{return request({'event':_0xf74d('0x27'),'message':_0x22f26e});}};}function afterCreate(_0x3a3654,_0x340aae){return function(_0x38a73f,_0x51a217){_0x38a73f=_0x38a73f['get']({'plain':!![]});_0x38a73f['channel']=_0x3a3654;_0x38a73f[_0xf74d('0x1e')]=_0xf74d('0x28');return request({'event':_0x340aae,'message':_0x38a73f});};}function afterUpdate(_0x228441,_0x116f56){return function(_0xe88dd,_0x3a0732){if(_0xe88dd['changed'](_0xf74d('0x29'))&&_0xe88dd[_0xf74d('0x29')]){_0xe88dd=_0xe88dd[_0xf74d('0x1c')]({'plain':!![]});_0xe88dd[_0xf74d('0x1d')]=_0x228441;_0xe88dd['event']=_0xf74d('0x29');if(_0xe88dd[_0xf74d('0x1f')]){return db[_0xf74d('0x20')][_0xf74d('0x21')]({'where':{'id':_0xe88dd[_0xf74d('0x1f')]},'attributes':['id',_0xf74d('0x22')],'raw':!![]})[_0xf74d('0x17')](function(_0x28c82a){_0xe88dd[_0xf74d('0x23')]=util[_0xf74d('0x24')](_0xf74d('0x2a'),_0x28c82a[_0xf74d('0x22')]);return request({'event':_0x116f56,'message':_0xe88dd});})[_0xf74d('0x26')](function(_0x4cbba2){console[_0xf74d('0x1a')](_0x4cbba2);});}else{return request({'event':_0x116f56,'message':_0xe88dd});}}};}exports[_0xf74d('0x2b')]=function(){for(var _0x5eced3=0x0;_0x5eced3=_0x57274f[_0x78e7('0x10')]){throw Error(_0x78e7('0x11'));}_0xea4ee6(_0x296cfa);})[_0x78e7('0x12')](function(_0x4526cf){_0x3ea93b(_0x4526cf);});});}; \ No newline at end of file +var _0x9228=['fax','sms','openchannel','getChannels','toLowerCase','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','../mysqldb','./license/util','voice','chat'];(function(_0x4e2e78,_0x26804d){var _0x481b3e=function(_0x444b87){while(--_0x444b87){_0x4e2e78['push'](_0x4e2e78['shift']());}};_0x481b3e(++_0x26804d);}(_0x9228,0x1de));var _0x8922=function(_0x4fe823,_0x16dbde){_0x4fe823=_0x4fe823-0x0;var _0x3693c9=_0x9228[_0x4fe823];return _0x3693c9;};'use strict';var _=require(_0x8922('0x0'));var BPromise=require(_0x8922('0x1'));var db=require(_0x8922('0x2'))['db'];var util=require(_0x8922('0x3'));var channels=[_0x8922('0x4'),'mail',_0x8922('0x5'),_0x8922('0x6'),_0x8922('0x7'),_0x8922('0x8')];exports[_0x8922('0x9')]=function(){return channels;};exports['isValidChannel']=function(_0x566090){_0x566090=_0x566090[_0x8922('0xa')]();return _['includes'](channels,_0x566090);};exports[_0x8922('0xb')]=function(_0x4c8355,_0x42f895,_0x428632,_0x45a595){var _0x3532ea={'loginAttempts':_0x42f895,'blocked':_0x428632};if(!_[_0x8922('0xc')](_0x45a595)){_0x3532ea[_0x8922('0xd')]=_0x45a595;}return _0x4c8355[_0x8922('0xe')](_0x3532ea);};exports[_0x8922('0xf')]=function(_0xb6af6b){return new BPromise(function(_0x524dcb,_0xf5f2fd){var _0x12915a=0x0;if(_0xb6af6b['role']!==_0x8922('0x10')){_0x524dcb(_0xb6af6b);}db[_0x8922('0x11')][_0x8922('0x12')]({'where':{'role':_0x8922('0x10'),'online':!![],'id':{'$ne':_0xb6af6b['id']}}})[_0x8922('0x13')](function(_0x14c86c){_0x12915a=_0x14c86c;return util['getLicense']();})[_0x8922('0x13')](function(_0xe7813c){if(_0xe7813c&&_0xe7813c['agents']&&_0x12915a>=_0xe7813c[_0x8922('0x14')]){throw Error(_0x8922('0x15'));}_0x524dcb(_0xb6af6b);})['catch'](function(_0x5f3ac4){_0xf5f2fd(_0x5f3ac4);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 959a64e..6dedd65 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c59=['json','exports','status'];(function(_0x4c39f5,_0x109684){var _0x1db24f=function(_0x44879b){while(--_0x44879b){_0x4c39f5['push'](_0x4c39f5['shift']());}};_0x1db24f(++_0x109684);}(_0x8c59,0x1c3));var _0x98c5=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x8c59[_0x565c49];return _0x20ca34;};'use strict';module[_0x98c5('0x0')][0x194]=function pageNotFound(_0x3f2a54,_0x423381){var _0xd8436e='404';var _0x1bed63=0x194;var _0x38ffe9={'status':_0x1bed63};_0x423381[_0x98c5('0x1')](_0x38ffe9['status']);_0x423381['render'](_0xd8436e,{},function(_0x37fbf7,_0x35a912){if(_0x37fbf7){return _0x423381['status'](_0x38ffe9[_0x98c5('0x1')])[_0x98c5('0x2')](_0x38ffe9);}_0x423381['send'](_0x35a912);});}; \ No newline at end of file +var _0xd9df=['send','status','render'];(function(_0x38d4e1,_0x1f6b1d){var _0x4b62bb=function(_0x56b654){while(--_0x56b654){_0x38d4e1['push'](_0x38d4e1['shift']());}};_0x4b62bb(++_0x1f6b1d);}(_0xd9df,0x1ab));var _0xfd9d=function(_0x7ace34,_0x55e2f0){_0x7ace34=_0x7ace34-0x0;var _0x434e4a=_0xd9df[_0x7ace34];return _0x434e4a;};'use strict';module['exports'][0x194]=function pageNotFound(_0xf288be,_0x330cb4){var _0xe4c62='404';var _0x2640b1=0x194;var _0xe2af53={'status':_0x2640b1};_0x330cb4[_0xfd9d('0x0')](_0xe2af53[_0xfd9d('0x0')]);_0x330cb4[_0xfd9d('0x1')](_0xe4c62,{},function(_0x243a19,_0x3f5a0e){if(_0x243a19){return _0x330cb4[_0xfd9d('0x0')](_0xe2af53[_0xfd9d('0x0')])['json'](_0xe2af53);}_0x330cb4[_0xfd9d('0x2')](_0x3f5a0e);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index c7f0440..d3f33cb 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x642b=['MailInteraction','../api/mailInteraction/mailInteraction.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','ChatWebsite','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/sound/sound.model','Tag','Template','../api/template/template.model','../api/trigger/trigger.model','Integration','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileResource','../api/userProfileResource/userProfileResource.model','cascade','UserId','hasMany','VoiceRecording','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','MailInteractions','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','FaxInteraction','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','VoiceQueues','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueue','OpenchannelQueues','VoicePrefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','SquareProject','SquareProjects','SpiedAgents','ChanSpyId','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkId','IntervalId','mandatoryDispositionPause','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceCallReport','QueueCalls','AgentReports','uniqueid','Contact','MailAccountId','MailServerOut','hasOne','Imap','Smtp','Dispositions','Answers','MailMessage','Interactions','List','ListId','mandatoryDispositionPauseId','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','ContactId','Tags','mail_interaction_has_tags','ThroughTags','Users','Interaction','restrict','FaxAccountId','Exntensions','FaxMessage','TagId','FaxInteractionId','Owner','fax_interaction_has_tags','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatMessage','OpenchannelQueueReport','Agent','ChatQueue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Website','CompanyId','HopperHistories','Company','cm_contact_has_tags','CampaignId','OwnerId','Queue','All','OneAll','AutomationAllId','Any','OneAny','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','Schedule','DefaultReportId','CustomReportId','Mohs','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','Action','TriggerId','Fields','MetricId','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','AccountId','Subject','Description','Field','Variable','VariableId','int_desk_configuration_has_tags','ZohoAccount','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowField','FromId','ToId','SessionId','SmsQueueReport','ProjectId','user_has_square_projects','team_has_voice_queues','MailQueues','ChatQueues','team_has_fax_queues','TrunkBackup','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToAgent','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','Queues','user_has_voice_prefixes','UserProfileSection','Resources','sectionId','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8','sequelizeHistory','utf8mb4','utf8_general_ci','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model'];(function(_0x494012,_0x37b0f7){var _0x8d3b8d=function(_0x4ca795){while(--_0x4ca795){_0x494012['push'](_0x494012['shift']());}};_0x8d3b8d(++_0x37b0f7);}(_0x642b,0x196));var _0xb642=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x642b[_0x5608a3];return _0x1ed50a;};'use strict';var path=require('path');var config=require(_0xb642('0x0'));var Sequelize=require(_0xb642('0x1'));var _=require(_0xb642('0x2'));var jstz=require(_0xb642('0x3'));var timezone=jstz[_0xb642('0x4')]();config[_0xb642('0x1')]=_[_0xb642('0x5')](config[_0xb642('0x1')],{'database':_0xb642('0x6'),'username':_0xb642('0x7'),'password':_0xb642('0x8'),'options':{'host':_0xb642('0x9'),'port':0xcea,'dialect':_0xb642('0xa'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xb642('0xb')](),'define':{'charset':_0xb642('0xc'),'collate':'utf8_general_ci'}}});config[_0xb642('0xd')]=_[_0xb642('0x5')](config[_0xb642('0xd')],{'database':_0xb642('0x6'),'username':_0xb642('0x7'),'password':_0xb642('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xb642('0xa'),'dialectOptions':{'charset':_0xb642('0xe')},'logging':![],'timezone':timezone[_0xb642('0xb')](),'define':{'charset':'utf8','collate':_0xb642('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xb642('0x1')][_0xb642('0x10')],config[_0xb642('0x1')][_0xb642('0x11')],config[_0xb642('0x1')]['password'],config[_0xb642('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xb642('0x10')],config[_0xb642('0xd')]['username'],config['sequelizeHistory'][_0xb642('0x12')],config['sequelizeHistory'][_0xb642('0x13')])};db[_0xb642('0x14')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x16'));db[_0xb642('0x17')]=db[_0xb642('0x1')][_0xb642('0x15')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0xb642('0x18')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x19'));db[_0xb642('0x1a')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x1b'));db['VoiceMusicOnHold']=db['sequelize']['import'](_0xb642('0x1c'));db[_0xb642('0x1d')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x1e'));db['VoiceRecording']=db[_0xb642('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0xb642('0x1f')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x20'));db[_0xb642('0x21')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x22'));db[_0xb642('0x23')]=db['sequelize'][_0xb642('0x15')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x24'));db[_0xb642('0x25')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x26'));db[_0xb642('0x27')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x28'));db[_0xb642('0x29')]=db[_0xb642('0x1')][_0xb642('0x15')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xb642('0x2a')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x2b'));db[_0xb642('0x2c')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x2d'));db[_0xb642('0x2e')]=db[_0xb642('0x1')]['import'](_0xb642('0x2f'));db[_0xb642('0x30')]=db[_0xb642('0x1')][_0xb642('0x15')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db['sequelize']['import'](_0xb642('0x31'));db[_0xb642('0x32')]=db[_0xb642('0x1')]['import']('../api/userChatQueue/userChatQueue.model');db[_0xb642('0x33')]=db[_0xb642('0x1')]['import']('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0xb642('0x1')][_0xb642('0x15')]('../api/userFaxQueue/userFaxQueue.model');db[_0xb642('0x34')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x35'));db[_0xb642('0x36')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x37'));db[_0xb642('0x38')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x39'));db['MailServerOut']=db['sequelize']['import']('../api/mailServerOut/mailServerOut.model');db[_0xb642('0x3a')]=db[_0xb642('0x1')]['import'](_0xb642('0x3b'));db[_0xb642('0x3c')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x3d'));db[_0xb642('0x3e')]=db[_0xb642('0x1')]['import'](_0xb642('0x3f'));db[_0xb642('0x40')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x41'));db['MailMessage']=db[_0xb642('0x1')][_0xb642('0x15')]('../api/mailMessage/mailMessage.model');db[_0xb642('0x42')]=db[_0xb642('0x1')]['import'](_0xb642('0x43'));db[_0xb642('0x44')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x45'));db[_0xb642('0x46')]=db[_0xb642('0x1')][_0xb642('0x15')]('../api/dashboard/dashboard.model');db['DashboardItem']=db[_0xb642('0x1')][_0xb642('0x15')]('../api/dashboardItem/dashboardItem.model');db[_0xb642('0x47')]=db['sequelize'][_0xb642('0x15')]('../api/faxAccount/faxAccount.model');db[_0xb642('0x48')]=db['sequelize'][_0xb642('0x15')](_0xb642('0x49'));db['FaxInteraction']=db[_0xb642('0x1')]['import'](_0xb642('0x4a'));db['FaxMessage']=db['sequelize'][_0xb642('0x15')](_0xb642('0x4b'));db[_0xb642('0x4c')]=db[_0xb642('0x1')]['import'](_0xb642('0x4d'));db[_0xb642('0x4e')]=db[_0xb642('0x1')]['import'](_0xb642('0x4f'));db['SmsAccount']=db['sequelize'][_0xb642('0x15')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0xb642('0x1')]['import'](_0xb642('0x50'));db[_0xb642('0x51')]=db[_0xb642('0x1')]['import'](_0xb642('0x52'));db[_0xb642('0x53')]=db[_0xb642('0x1')]['import'](_0xb642('0x54'));db[_0xb642('0x55')]=db['sequelize'][_0xb642('0x15')](_0xb642('0x56'));db[_0xb642('0x57')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x58'));db[_0xb642('0x59')]=db['sequelize'][_0xb642('0x15')](_0xb642('0x5a'));db[_0xb642('0x5b')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x5c'));db[_0xb642('0x5d')]=db[_0xb642('0x1')]['import'](_0xb642('0x5e'));db['OpenchannelQueue']=db[_0xb642('0x1')]['import']('../api/openchannelQueue/openchannelQueue.model');db[_0xb642('0x5f')]=db[_0xb642('0x1')]['import']('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0xb642('0x1')][_0xb642('0x15')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xb642('0x60')]=db['sequelize'][_0xb642('0x15')](_0xb642('0x61'));db[_0xb642('0x62')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x63'));db['ChatMessage']=db['sequelize'][_0xb642('0x15')](_0xb642('0x64'));db[_0xb642('0x65')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x66'));db['ChatQueue']=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x67'));db[_0xb642('0x68')]=db[_0xb642('0x1')]['import'](_0xb642('0x69'));db[_0xb642('0x6a')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x6b'));db[_0xb642('0x6c')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x6d'));db[_0xb642('0x6e')]=db['sequelize']['import'](_0xb642('0x6f'));db[_0xb642('0x70')]=db['sequelize'][_0xb642('0x15')](_0xb642('0x71'));db['CmHopperBlack']=db[_0xb642('0x1')][_0xb642('0x15')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xb642('0x72')]=db['sequelize'][_0xb642('0x15')](_0xb642('0x73'));db['CmHopperHistory']=db[_0xb642('0x1')][_0xb642('0x15')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xb642('0x74')]=db[_0xb642('0x1')]['import']('../api/reportAgentPreview/reportAgentPreview.model');db[_0xb642('0x75')]=db['sequelize'][_0xb642('0x15')](_0xb642('0x76'));db['Action']=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x77'));db[_0xb642('0x78')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x79'));db[_0xb642('0x7a')]=db['sequelize']['import'](_0xb642('0x7b'));db[_0xb642('0x7c')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x7d'));db[_0xb642('0x7e')]=db['sequelize'][_0xb642('0x15')](_0xb642('0x7f'));db[_0xb642('0x80')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x81'));db[_0xb642('0x82')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x83'));db[_0xb642('0x84')]=db[_0xb642('0x1')]['import'](_0xb642('0x85'));db[_0xb642('0x86')]=db['sequelize']['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0xb642('0x1')][_0xb642('0x15')]('../api/schedule/schedule.model');db['Sound']=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x87'));db[_0xb642('0x88')]=db['sequelize']['import']('../api/tag/tag.model');db[_0xb642('0x89')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x8a'));db['Trigger']=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x8b'));db['Variable']=db[_0xb642('0x1')][_0xb642('0x15')]('../api/variable/variable.model');db[_0xb642('0x8c')]=db[_0xb642('0x1')]['import']('../api/integration/integration.model');db['IntegrationReport']=db['sequelize'][_0xb642('0x15')](_0xb642('0x8d'));db[_0xb642('0x8e')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x8f'));db[_0xb642('0x90')]=db['sequelize'][_0xb642('0x15')](_0xb642('0x91'));db[_0xb642('0x92')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x93'));db[_0xb642('0x94')]=db[_0xb642('0x1')]['import']('../api/analyticMetric/analyticMetric.model');db[_0xb642('0x95')]=db['sequelize'][_0xb642('0x15')](_0xb642('0x96'));db[_0xb642('0x97')]=db[_0xb642('0x1')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0xb642('0x98')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0x99'));db[_0xb642('0x9a')]=db[_0xb642('0x1')][_0xb642('0x15')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xb642('0x9b')]=db[_0xb642('0x1')]['import']('../api/intSalesforceField/intSalesforceField.model');db[_0xb642('0x9c')]=db[_0xb642('0x1')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xb642('0x9d')]=db[_0xb642('0x1')]['import'](_0xb642('0x9e'));db[_0xb642('0x9f')]=db['sequelize'][_0xb642('0x15')](_0xb642('0xa0'));db[_0xb642('0xa1')]=db[_0xb642('0x1')]['import'](_0xb642('0xa2'));db[_0xb642('0xa3')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xa4'));db[_0xb642('0xa5')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xa6'));db['ZohoAccount']=db['sequelize'][_0xb642('0x15')](_0xb642('0xa7'));db[_0xb642('0xa8')]=db[_0xb642('0x1')][_0xb642('0x15')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xb642('0xa9')]=db['sequelize'][_0xb642('0x15')](_0xb642('0xaa'));db['ZendeskAccount']=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xab'));db[_0xb642('0xac')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xad'));db[_0xb642('0xae')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xaf'));db[_0xb642('0xb0')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xb1'));db[_0xb642('0xb2')]=db[_0xb642('0x1')][_0xb642('0x15')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xb3'));db[_0xb642('0xb4')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xb5'));db[_0xb642('0xb6')]=db['sequelize'][_0xb642('0x15')](_0xb642('0xb7'));db[_0xb642('0xb8')]=db[_0xb642('0x1')][_0xb642('0x15')]('../api/intVtigerField/intVtigerField.model');db[_0xb642('0xb9')]=db[_0xb642('0x1')]['import'](_0xb642('0xba'));db[_0xb642('0xbb')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xbc'));db['ServicenowField']=db[_0xb642('0x1')][_0xb642('0x15')]('../api/intServicenowField/intServicenowField.model');db[_0xb642('0xbd')]=db['sequelize'][_0xb642('0x15')](_0xb642('0xbe'));db[_0xb642('0xbf')]=db['sequelize']['import'](_0xb642('0xc0'));db[_0xb642('0xc1')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xc2'));db[_0xb642('0xc3')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xc4'));db[_0xb642('0xc5')]=db[_0xb642('0x1')]['import']('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xb642('0xc6')]=db[_0xb642('0x1')]['import'](_0xb642('0xc7'));db[_0xb642('0x8c')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xc8'));db[_0xb642('0xc9')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xca'));db[_0xb642('0xcb')]=db[_0xb642('0x1')]['import'](_0xb642('0xcc'));db[_0xb642('0xcd')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xce'));db[_0xb642('0xcf')]=db['sequelize'][_0xb642('0x15')](_0xb642('0xd0'));db[_0xb642('0xd1')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xd2'));db[_0xb642('0xd3')]=db[_0xb642('0x1')][_0xb642('0x15')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db['sequelize'][_0xb642('0x15')](_0xb642('0xd4'));db[_0xb642('0xd5')]=db['sequelize'][_0xb642('0x15')](_0xb642('0xd6'));db[_0xb642('0xd7')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xd8'));db[_0xb642('0xd9')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xda'));db[_0xb642('0xdb')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xdc'));db[_0xb642('0xdd')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xde'));db['SquareProject']=db[_0xb642('0x1')]['import'](_0xb642('0xdf'));db[_0xb642('0xe0')]=db[_0xb642('0x1')]['import']('../api/squareRecording/squareRecording.model');db[_0xb642('0xe1')]=db[_0xb642('0x1')][_0xb642('0x15')]('../api/squareMessage/squareMessage.model');db[_0xb642('0xe2')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xe3'));db[_0xb642('0xe4')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xe5'));db[_0xb642('0xe6')]=db[_0xb642('0x1')]['import'](_0xb642('0xe7'));db[_0xb642('0xe8')]=db[_0xb642('0x1')][_0xb642('0x15')]('../api/migration/migration.model');db[_0xb642('0xe9')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xea'));db[_0xb642('0xeb')]=db[_0xb642('0x1')]['import'](_0xb642('0xec'));db[_0xb642('0xed')]=db[_0xb642('0x1')][_0xb642('0x15')]('../api/mailTransferReport/mailTransferReport.model');db[_0xb642('0xee')]=db['sequelize']['import']('../api/chatTransferReport/chatTransferReport.model');db['FaxTransferReport']=db[_0xb642('0x1')]['import']('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xef'));db['SmsTransferReport']=db[_0xb642('0x1')][_0xb642('0x15')]('../api/smsTransferReport/smsTransferReport.model');db[_0xb642('0xf0')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xf1'));db[_0xb642('0xf2')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xf3'));db[_0xb642('0xf4')]=db['sequelize'][_0xb642('0x15')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0xb642('0x1')][_0xb642('0x15')]('../api/userProfileSection/userProfileSection.model');db[_0xb642('0xf5')]=db[_0xb642('0x1')][_0xb642('0x15')](_0xb642('0xf6'));db['User']['hasOne'](db['VoiceMail'],{'as':_0xb642('0x21'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0xf8')});db[_0xb642('0x14')][_0xb642('0xf9')](db[_0xb642('0xfa')],{'as':'Recordings','foreignKey':_0xb642('0xf8')});db[_0xb642('0x14')][_0xb642('0xf9')](db[_0xb642('0x30')],{'as':_0xb642('0xfb'),'foreignKey':_0xb642('0xf8')});db[_0xb642('0x14')][_0xb642('0xf9')](db[_0xb642('0x1a')],{'as':_0xb642('0xfc'),'onDelete':_0xb642('0xf7'),'hooks':!![]});db[_0xb642('0x14')][_0xb642('0xf9')](db[_0xb642('0x72')],{'as':_0xb642('0xfd'),'foreignKey':'UserId'});db[_0xb642('0x14')][_0xb642('0xf9')](db[_0xb642('0xfe')],{'as':_0xb642('0xff'),'foreignKey':'UserId'});db[_0xb642('0x14')][_0xb642('0xf9')](db[_0xb642('0x74')],{'as':_0xb642('0x74'),'foreignKey':_0xb642('0xf8')});db[_0xb642('0x14')]['hasMany'](db[_0xb642('0x5b')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db[_0xb642('0x14')]['hasMany'](db[_0xb642('0x62')],{'as':'ChatInteractions','foreignKey':_0xb642('0xf8')});db[_0xb642('0x14')]['hasMany'](db[_0xb642('0x51')],{'as':'SmsInteractions','foreignKey':_0xb642('0xf8')});db['User'][_0xb642('0xf9')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0xb642('0xf8')});db[_0xb642('0x14')][_0xb642('0xf9')](db[_0xb642('0x40')],{'as':_0xb642('0x100'),'foreignKey':_0xb642('0xf8')});db[_0xb642('0x14')][_0xb642('0x101')](db[_0xb642('0xf4')],{'as':'UserProfile','foreignKey':_0xb642('0x102')});db[_0xb642('0x14')][_0xb642('0x103')](db['ChatGroup'],{'as':_0xb642('0x104'),'through':_0xb642('0x105')});db['User'][_0xb642('0x103')](db[_0xb642('0x6e')],{'as':_0xb642('0x106'),'through':_0xb642('0x107')});db['User'][_0xb642('0x103')](db[_0xb642('0xf0')],{'as':'Lists','through':'cm_user_has_lists'});db[_0xb642('0x14')][_0xb642('0x103')](db[_0xb642('0xe2')],{'through':_0xb642('0x108')});db[_0xb642('0x14')][_0xb642('0x103')](db[_0xb642('0x40')],{'as':_0xb642('0x100'),'through':_0xb642('0x109')});db[_0xb642('0x14')][_0xb642('0x103')](db['ChatInteraction'],{'as':_0xb642('0x10a'),'through':_0xb642('0x10b')});db[_0xb642('0x14')][_0xb642('0x103')](db[_0xb642('0x10c')],{'as':_0xb642('0x10d'),'through':_0xb642('0x10e')});db[_0xb642('0x14')][_0xb642('0x103')](db[_0xb642('0x51')],{'as':'SmsInteractions','through':_0xb642('0x10f')});db['User'][_0xb642('0x103')](db[_0xb642('0x5b')],{'as':_0xb642('0x110'),'through':_0xb642('0x111')});db[_0xb642('0x14')][_0xb642('0x103')](db[_0xb642('0x1d')],{'as':_0xb642('0x112'),'through':'UserVoiceQueue','required':![]});db[_0xb642('0x14')][_0xb642('0x103')](db['MailQueue'],{'as':'MailQueues','through':_0xb642('0x33'),'required':![]});db['User'][_0xb642('0x103')](db['ChatQueue'],{'as':'ChatQueues','through':_0xb642('0x32'),'required':![],'hooks':!![]});db[_0xb642('0x14')]['belongsToMany'](db[_0xb642('0x4c')],{'as':_0xb642('0x113'),'through':_0xb642('0x114'),'required':![]});db[_0xb642('0x14')]['belongsToMany'](db['SmsQueue'],{'as':_0xb642('0x115'),'through':'UserSmsQueue','required':![]});db[_0xb642('0x14')]['belongsToMany'](db[_0xb642('0x116')],{'as':_0xb642('0x117'),'through':_0xb642('0x36'),'required':![]});db['User']['belongsToMany'](db['CmList'],{'through':'cm_user_has_lists'});db[_0xb642('0x14')][_0xb642('0x103')](db[_0xb642('0xf2')],{'as':_0xb642('0x118'),'through':'user_has_voice_prefixes','required':![]});db[_0xb642('0x14')][_0xb642('0x103')](db[_0xb642('0x5f')],{'as':_0xb642('0x119'),'through':_0xb642('0x11a')});db['User'][_0xb642('0x103')](db[_0xb642('0x47')],{'as':_0xb642('0x11b'),'through':_0xb642('0x11c')});db[_0xb642('0x14')][_0xb642('0x103')](db[_0xb642('0x3a')],{'as':_0xb642('0x11d'),'through':'user_has_mail_accounts'});db[_0xb642('0x14')][_0xb642('0x103')](db[_0xb642('0x57')],{'as':'OpenchannelAccounts','through':_0xb642('0x11e')});db['User'][_0xb642('0x103')](db[_0xb642('0x11f')],{'as':_0xb642('0x120'),'through':_0xb642('0x121')});db[_0xb642('0x14')]['belongsToMany'](db[_0xb642('0x122')],{'as':_0xb642('0x123'),'through':'user_has_square_projects'});db[_0xb642('0x17')][_0xb642('0xf9')](db[_0xb642('0x1a')],{'as':_0xb642('0x124'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x125')});db[_0xb642('0x18')]['hasMany'](db[_0xb642('0x1a')],{'onDelete':_0xb642('0xf7')});db[_0xb642('0x1a')]['hasMany'](db[_0xb642('0x1a')],{'as':_0xb642('0x126'),'onDelete':_0xb642('0xf7')});db['VoiceMusicOnHold'][_0xb642('0x103')](db[_0xb642('0x127')],{'as':_0xb642('0x128'),'through':_0xb642('0x129')});db[_0xb642('0x1d')][_0xb642('0xf9')](db['UserVoiceQueueRt'],{'as':_0xb642('0x12a'),'foreignKey':_0xb642('0x12b')});db[_0xb642('0x1d')]['hasMany'](db[_0xb642('0x70')],{'as':_0xb642('0x12c'),'foreignKey':'VoiceQueueId'});db[_0xb642('0x1d')]['hasMany'](db['CmHopperFinal'],{'as':_0xb642('0xfd'),'foreignKey':_0xb642('0x12b')});db[_0xb642('0x1d')][_0xb642('0xf9')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xb642('0x12b')});db[_0xb642('0x1d')][_0xb642('0xf9')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xb642('0x12b')});db[_0xb642('0x1d')][_0xb642('0xf9')](db[_0xb642('0x12d')],{'as':_0xb642('0x12e'),'foreignKey':_0xb642('0x12b')});db[_0xb642('0x1d')][_0xb642('0xf9')](db[_0xb642('0xd3')],{'as':_0xb642('0x12f'),'foreignKey':_0xb642('0x12b')});db['VoiceQueue'][_0xb642('0x101')](db[_0xb642('0x2c')],{'as':_0xb642('0x2c'),'foreignKey':_0xb642('0x130')});db[_0xb642('0x1d')][_0xb642('0x101')](db[_0xb642('0x2c')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0xb642('0x1d')][_0xb642('0x101')](db[_0xb642('0x80')],{'as':'Interval','foreignKey':_0xb642('0x131')});db[_0xb642('0x1d')]['belongsTo'](db[_0xb642('0x82')],{'as':_0xb642('0x132'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0xb642('0x103')](db[_0xb642('0xf0')],{'as':_0xb642('0x133'),'through':_0xb642('0x134')});db[_0xb642('0x1d')][_0xb642('0x103')](db[_0xb642('0x14')],{'as':_0xb642('0x135'),'through':'UserVoiceQueue'});db[_0xb642('0x1d')][_0xb642('0x103')](db['Team'],{'as':_0xb642('0x136'),'through':'team_has_voice_queues'});db[_0xb642('0x1d')][_0xb642('0x103')](db[_0xb642('0xf0')],{'as':_0xb642('0x137'),'through':_0xb642('0x138')});db[_0xb642('0xfa')]['belongsTo'](db[_0xb642('0x14')],{'as':_0xb642('0x14'),'foreignKey':'UserId'});db[_0xb642('0x1f')][_0xb642('0x101')](db[_0xb642('0x14')],{'as':_0xb642('0x14'),'foreignKey':_0xb642('0xf8')});db[_0xb642('0x21')][_0xb642('0xf9')](db[_0xb642('0x23')],{'as':_0xb642('0x139'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x13a'),'sourceKey':_0xb642('0x13b')});db[_0xb642('0x23')][_0xb642('0x101')](db[_0xb642('0x21')],{'foreignKey':_0xb642('0x13a'),'targetKey':_0xb642('0x13b')});db[_0xb642('0x13c')][_0xb642('0xf9')](db[_0xb642('0x29')],{'as':_0xb642('0x13d'),'foreignKey':'uniqueid','constraints':![]});db[_0xb642('0x13c')]['hasMany'](db[_0xb642('0x27')],{'as':_0xb642('0x13e'),'foreignKey':_0xb642('0x13f'),'constraints':![]});db['VoiceCallReport'][_0xb642('0x101')](db[_0xb642('0x14')],{'as':_0xb642('0x14'),'foreignKey':'UserId'});db[_0xb642('0x13c')]['belongsTo'](db[_0xb642('0x6e')],{'as':_0xb642('0x140'),'foreignKey':'ContactId'});db['MailServerIn'][_0xb642('0x101')](db[_0xb642('0x3a')],{'as':_0xb642('0x3a'),'foreignKey':_0xb642('0x141')});db[_0xb642('0x142')][_0xb642('0x101')](db['MailAccount'],{'as':_0xb642('0x3a'),'foreignKey':_0xb642('0x141')});db[_0xb642('0x3a')][_0xb642('0x143')](db[_0xb642('0x38')],{'as':_0xb642('0x144'),'onDelete':_0xb642('0xf7')});db[_0xb642('0x3a')]['hasOne'](db[_0xb642('0x142')],{'as':_0xb642('0x145'),'onDelete':_0xb642('0xf7')});db[_0xb642('0x3a')][_0xb642('0xf9')](db[_0xb642('0x7c')],{'as':_0xb642('0x146'),'foreignKey':'MailAccountId'});db[_0xb642('0x3a')][_0xb642('0xf9')](db['CannedAnswer'],{'as':_0xb642('0x147'),'foreignKey':_0xb642('0x141')});db[_0xb642('0x3a')][_0xb642('0xf9')](db[_0xb642('0x148')],{'as':_0xb642('0x139'),'foreignKey':_0xb642('0x141')});db[_0xb642('0x3a')][_0xb642('0xf9')](db[_0xb642('0x40')],{'as':_0xb642('0x149')});db[_0xb642('0x3a')][_0xb642('0xf9')](db['MailApplication'],{'as':'Applications'});db[_0xb642('0x3a')][_0xb642('0x101')](db[_0xb642('0xf0')],{'as':_0xb642('0x14a'),'foreignKey':_0xb642('0x14b')});db[_0xb642('0x3a')][_0xb642('0x101')](db['Template'],{'as':_0xb642('0x89'),'foreignKey':'TemplateId'});db[_0xb642('0x3a')]['belongsTo'](db[_0xb642('0x82')],{'as':_0xb642('0x132'),'foreignKey':_0xb642('0x14c')});db[_0xb642('0x3a')][_0xb642('0x103')](db['User'],{'as':_0xb642('0x135'),'through':_0xb642('0x14d')});db[_0xb642('0x3c')][_0xb642('0x103')](db['User'],{'as':_0xb642('0x135'),'through':_0xb642('0x33')});db[_0xb642('0x3c')][_0xb642('0x103')](db[_0xb642('0xe2')],{'through':_0xb642('0x14e'),'as':_0xb642('0x136')});db[_0xb642('0x40')]['hasMany'](db['MailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xb642('0x14f')});db[_0xb642('0x40')][_0xb642('0x101')](db[_0xb642('0x3a')],{'as':_0xb642('0x150'),'foreignKey':_0xb642('0x141')});db[_0xb642('0x40')][_0xb642('0x101')](db[_0xb642('0x6e')],{'as':'Contact','foreignKey':_0xb642('0x151')});db[_0xb642('0x40')][_0xb642('0x101')](db[_0xb642('0x14')],{'as':'Owner','foreignKey':_0xb642('0xf8')});db[_0xb642('0x40')][_0xb642('0x103')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xb642('0x152')});db[_0xb642('0x40')][_0xb642('0x103')](db[_0xb642('0x88')],{'through':_0xb642('0x153'),'as':_0xb642('0x154')});db[_0xb642('0x40')][_0xb642('0x103')](db['User'],{'as':_0xb642('0x155'),'through':_0xb642('0x109'),'foreignKey':_0xb642('0x14f')});db[_0xb642('0x148')]['hasMany'](db[_0xb642('0xe9')],{'as':'Attachments','onDelete':'cascade'});db['MailMessage'][_0xb642('0x101')](db['User'],{'as':'User'});db['MailMessage'][_0xb642('0x101')](db[_0xb642('0x6e')],{'onDelete':_0xb642('0xf7'),'as':_0xb642('0x140')});db[_0xb642('0x148')][_0xb642('0x101')](db[_0xb642('0x40')],{'as':_0xb642('0x156'),'foreignKey':'MailInteractionId'});db[_0xb642('0x148')][_0xb642('0x101')](db[_0xb642('0x3a')],{'as':_0xb642('0x150'),'foreignKey':_0xb642('0x141')});db[_0xb642('0x42')][_0xb642('0x101')](db[_0xb642('0x14')],{'onDelete':_0xb642('0x157')});db['MailApplication'][_0xb642('0x101')](db['MailQueue'],{'onDelete':'restrict'});db[_0xb642('0x42')][_0xb642('0x101')](db[_0xb642('0x3a')],{'onDelete':'restrict'});db[_0xb642('0x42')][_0xb642('0x101')](db[_0xb642('0x80')],{'onDelete':_0xb642('0x157'),'foreignKey':'IntervalId'});db[_0xb642('0x42')][_0xb642('0x101')](db['Tag'],{'onDelete':_0xb642('0x157'),'foreignKey':'TagId'});db[_0xb642('0x44')][_0xb642('0x101')](db[_0xb642('0x3a')],{});db[_0xb642('0x44')][_0xb642('0x101')](db[_0xb642('0xf0')],{'as':_0xb642('0x14a'),'foreignKey':_0xb642('0x14b')});db['MailQueueReport'][_0xb642('0x101')](db['CmContact'],{'as':_0xb642('0x140'),'foreignKey':_0xb642('0x151')});db[_0xb642('0x44')][_0xb642('0x101')](db[_0xb642('0x40')],{});db[_0xb642('0x44')][_0xb642('0x101')](db[_0xb642('0x148')],{});db[_0xb642('0x44')][_0xb642('0x101')](db[_0xb642('0x14')],{});db[_0xb642('0x44')]['belongsTo'](db['MailQueue'],{});db[_0xb642('0x46')]['hasMany'](db['DashboardItem'],{'as':'Items','onDelete':'cascade'});db[_0xb642('0x47')]['hasMany'](db[_0xb642('0x7c')],{'as':_0xb642('0x146'),'foreignKey':_0xb642('0x158')});db[_0xb642('0x47')]['hasMany'](db['CannedAnswer'],{'as':_0xb642('0x147'),'foreignKey':_0xb642('0x158')});db[_0xb642('0x47')]['hasMany'](db['FaxInteraction'],{'as':_0xb642('0x149')});db['FaxAccount'][_0xb642('0xf9')](db[_0xb642('0x48')],{'as':'Applications'});db['FaxAccount']['hasMany'](db[_0xb642('0x1a')],{'as':_0xb642('0x159'),'onDelete':'cascade'});db[_0xb642('0x47')][_0xb642('0xf9')](db[_0xb642('0x15a')],{'as':_0xb642('0x139')});db[_0xb642('0x47')][_0xb642('0x101')](db[_0xb642('0x2c')],{'as':_0xb642('0x2c')});db[_0xb642('0x47')][_0xb642('0x101')](db['CmList'],{'as':_0xb642('0x14a'),'foreignKey':_0xb642('0x14b')});db[_0xb642('0x47')][_0xb642('0x101')](db[_0xb642('0x82')],{'as':_0xb642('0x132'),'foreignKey':_0xb642('0x14c')});db[_0xb642('0x47')][_0xb642('0x103')](db['User'],{'as':'Agents','through':'user_has_fax_accounts'});db[_0xb642('0x48')][_0xb642('0x101')](db[_0xb642('0x14')],{'onDelete':_0xb642('0x157')});db[_0xb642('0x48')][_0xb642('0x101')](db[_0xb642('0x4c')],{'onDelete':'restrict'});db['FaxApplication'][_0xb642('0x101')](db['FaxAccount'],{'onDelete':'restrict'});db[_0xb642('0x48')][_0xb642('0x101')](db[_0xb642('0x88')],{'onDelete':_0xb642('0x157'),'foreignKey':_0xb642('0x15b')});db[_0xb642('0x10c')][_0xb642('0xf9')](db['FaxMessage'],{'as':_0xb642('0x139'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x15c')});db['FaxInteraction'][_0xb642('0x101')](db[_0xb642('0x47')],{'as':_0xb642('0x150'),'foreignKey':_0xb642('0x158')});db[_0xb642('0x10c')][_0xb642('0x101')](db['CmContact'],{'as':_0xb642('0x140'),'foreignKey':'ContactId'});db['FaxInteraction']['belongsTo'](db[_0xb642('0x14')],{'as':_0xb642('0x15d'),'foreignKey':_0xb642('0xf8')});db[_0xb642('0x10c')]['belongsToMany'](db[_0xb642('0x88')],{'through':'fax_interaction_has_tags','as':_0xb642('0x152')});db[_0xb642('0x10c')][_0xb642('0x103')](db[_0xb642('0x88')],{'through':_0xb642('0x15e'),'as':_0xb642('0x154')});db['FaxInteraction'][_0xb642('0x103')](db[_0xb642('0x14')],{'as':_0xb642('0x155'),'through':'user_has_fax_interactions','foreignKey':_0xb642('0x15c')});db['FaxMessage'][_0xb642('0x101')](db['User'],{'onDelete':_0xb642('0xf7'),'as':_0xb642('0x14')});db['FaxMessage']['belongsTo'](db['FaxInteraction'],{'as':_0xb642('0x156'),'foreignKey':_0xb642('0x15c')});db[_0xb642('0x15a')]['belongsTo'](db[_0xb642('0x6e')],{'onDelete':'cascade','as':_0xb642('0x140')});db[_0xb642('0x15a')][_0xb642('0x101')](db['Attachment'],{'as':_0xb642('0xe9'),'foreignKey':'AttachmentId'});db[_0xb642('0x15a')]['belongsTo'](db['FaxAccount'],{'as':_0xb642('0x150'),'foreignKey':_0xb642('0x158')});db[_0xb642('0x4c')][_0xb642('0x103')](db[_0xb642('0x14')],{'as':'Agents','through':_0xb642('0x114')});db[_0xb642('0x4c')]['belongsToMany'](db[_0xb642('0xe2')],{'through':'team_has_fax_queues','as':_0xb642('0x136')});db[_0xb642('0x4e')][_0xb642('0x101')](db[_0xb642('0x47')],{});db['FaxQueueReport']['belongsTo'](db['CmList'],{'as':_0xb642('0x14a'),'foreignKey':_0xb642('0x14b')});db['FaxQueueReport'][_0xb642('0x101')](db[_0xb642('0x6e')],{'as':_0xb642('0x140'),'foreignKey':_0xb642('0x151')});db[_0xb642('0x4e')][_0xb642('0x101')](db['FaxInteraction'],{});db[_0xb642('0x4e')]['belongsTo'](db[_0xb642('0x15a')],{});db[_0xb642('0x4e')]['belongsTo'](db[_0xb642('0x14')],{});db[_0xb642('0x4e')][_0xb642('0x101')](db[_0xb642('0x4c')],{});db['SmsAccount']['hasMany'](db[_0xb642('0x7c')],{'as':'Dispositions','foreignKey':_0xb642('0x15f')});db['SmsAccount'][_0xb642('0xf9')](db[_0xb642('0x7a')],{'as':'Answers','foreignKey':_0xb642('0x15f')});db['SmsAccount'][_0xb642('0xf9')](db[_0xb642('0x53')],{'as':_0xb642('0x139'),'foreignKey':_0xb642('0x15f')});db[_0xb642('0x11f')][_0xb642('0xf9')](db[_0xb642('0x51')],{'as':_0xb642('0x149')});db[_0xb642('0x11f')][_0xb642('0xf9')](db['SmsApplication'],{'as':'Applications'});db['SmsAccount'][_0xb642('0x101')](db[_0xb642('0xf0')],{'as':_0xb642('0x14a'),'foreignKey':'ListId'});db[_0xb642('0x11f')][_0xb642('0x101')](db[_0xb642('0x82')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['SmsAccount'][_0xb642('0x103')](db[_0xb642('0x14')],{'as':_0xb642('0x135'),'through':_0xb642('0x121')});db['SmsApplication']['belongsTo'](db['User'],{'onDelete':'restrict'});db['SmsApplication'][_0xb642('0x101')](db[_0xb642('0x55')],{'onDelete':_0xb642('0x157')});db['SmsApplication'][_0xb642('0x101')](db['SmsAccount'],{'onDelete':'restrict'});db['SmsApplication'][_0xb642('0x101')](db[_0xb642('0x80')],{'onDelete':_0xb642('0x157'),'foreignKey':_0xb642('0x131')});db['SmsApplication'][_0xb642('0x101')](db['Tag'],{'onDelete':_0xb642('0x157'),'foreignKey':'TagId'});db[_0xb642('0x51')][_0xb642('0xf9')](db['SmsMessage'],{'as':_0xb642('0x139'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x160')});db[_0xb642('0x51')][_0xb642('0x101')](db[_0xb642('0x11f')],{'as':_0xb642('0x150'),'foreignKey':_0xb642('0x15f')});db[_0xb642('0x51')][_0xb642('0x101')](db[_0xb642('0x6e')],{'as':_0xb642('0x140'),'foreignKey':'ContactId'});db[_0xb642('0x51')][_0xb642('0x101')](db[_0xb642('0x14')],{'as':_0xb642('0x15d'),'foreignKey':_0xb642('0xf8')});db[_0xb642('0x51')][_0xb642('0x103')](db[_0xb642('0x88')],{'through':_0xb642('0x161'),'as':_0xb642('0x152')});db[_0xb642('0x51')]['belongsToMany'](db[_0xb642('0x88')],{'through':'sms_interaction_has_tags','as':_0xb642('0x154')});db['SmsInteraction']['belongsToMany'](db[_0xb642('0x14')],{'as':'Users','through':_0xb642('0x10f'),'foreignKey':'SmsInteractionId'});db[_0xb642('0x53')][_0xb642('0x101')](db[_0xb642('0x14')],{'as':_0xb642('0x14')});db[_0xb642('0x53')][_0xb642('0x101')](db[_0xb642('0x6e')],{'onDelete':_0xb642('0xf7'),'as':'Contact'});db[_0xb642('0x53')]['belongsTo'](db['SmsInteraction'],{'onDelete':'cascade','as':_0xb642('0x156'),'foreignKey':_0xb642('0x160')});db['SmsMessage'][_0xb642('0x101')](db['SmsAccount'],{'as':'Account','foreignKey':_0xb642('0x15f')});db[_0xb642('0x55')][_0xb642('0x103')](db[_0xb642('0x14')],{'as':_0xb642('0x135'),'through':_0xb642('0x34'),'foreignKey':_0xb642('0x162')});db[_0xb642('0x55')][_0xb642('0x103')](db[_0xb642('0xe2')],{'through':_0xb642('0x163'),'as':'Teams'});db['OpenchannelAccount'][_0xb642('0xf9')](db['Disposition'],{'as':_0xb642('0x146'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xb642('0xf9')](db['CannedAnswer'],{'as':_0xb642('0x147'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xb642('0xf9')](db['OpenchannelInteraction'],{'as':_0xb642('0x149'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xb642('0xf9')](db[_0xb642('0x5d')],{'as':_0xb642('0x139'),'foreignKey':_0xb642('0x164')});db[_0xb642('0x57')][_0xb642('0xf9')](db[_0xb642('0x59')],{'as':_0xb642('0x126'),'foreignKey':_0xb642('0x164')});db[_0xb642('0x57')][_0xb642('0x101')](db[_0xb642('0xf0')],{'as':_0xb642('0x14a'),'foreignKey':_0xb642('0x14b')});db[_0xb642('0x57')][_0xb642('0x101')](db[_0xb642('0x82')],{'as':_0xb642('0x132'),'foreignKey':_0xb642('0x14c')});db[_0xb642('0x57')][_0xb642('0x103')](db['User'],{'as':_0xb642('0x135'),'through':_0xb642('0x11e')});db['OpenchannelApplication'][_0xb642('0x101')](db['User'],{'onDelete':_0xb642('0x157')});db['OpenchannelApplication'][_0xb642('0x101')](db[_0xb642('0x116')],{'onDelete':_0xb642('0x157'),'foreignKey':_0xb642('0x165')});db[_0xb642('0x59')][_0xb642('0x101')](db['OpenchannelAccount'],{'onDelete':_0xb642('0x157'),'foreignKey':_0xb642('0x164')});db[_0xb642('0x59')][_0xb642('0x101')](db['Interval'],{'onDelete':_0xb642('0x157'),'foreignKey':_0xb642('0x131')});db['OpenchannelApplication'][_0xb642('0x101')](db[_0xb642('0x88')],{'onDelete':_0xb642('0x157'),'foreignKey':_0xb642('0x15b')});db[_0xb642('0x5b')][_0xb642('0xf9')](db[_0xb642('0x5d')],{'as':_0xb642('0x139'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x166')});db[_0xb642('0x5b')][_0xb642('0x101')](db[_0xb642('0x57')],{'as':'Account','foreignKey':_0xb642('0x164')});db[_0xb642('0x5b')][_0xb642('0x101')](db[_0xb642('0x6e')],{'as':'Contact','foreignKey':'ContactId'});db[_0xb642('0x5b')]['belongsTo'](db[_0xb642('0x14')],{'as':_0xb642('0x15d'),'foreignKey':'UserId'});db[_0xb642('0x5b')][_0xb642('0x103')](db[_0xb642('0x88')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db['OpenchannelInteraction'][_0xb642('0x103')](db[_0xb642('0x88')],{'through':_0xb642('0x167'),'as':_0xb642('0x154')});db[_0xb642('0x5b')][_0xb642('0x103')](db[_0xb642('0x14')],{'as':'Users','through':_0xb642('0x111'),'foreignKey':'OpenchannelInteractionId'});db[_0xb642('0x5d')][_0xb642('0x101')](db['User'],{'onDelete':_0xb642('0xf7'),'as':_0xb642('0x14')});db[_0xb642('0x5d')][_0xb642('0x101')](db['CmContact'],{'onDelete':_0xb642('0xf7'),'as':'Contact'});db[_0xb642('0x5d')][_0xb642('0x101')](db[_0xb642('0x5b')],{'onDelete':_0xb642('0xf7'),'as':_0xb642('0x156'),'foreignKey':_0xb642('0x166')});db['OpenchannelMessage'][_0xb642('0x101')](db[_0xb642('0xe9')],{'as':_0xb642('0xe9'),'foreignKey':_0xb642('0x168')});db['OpenchannelMessage'][_0xb642('0x101')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xb642('0x164')});db[_0xb642('0x116')]['belongsToMany'](db[_0xb642('0x14')],{'as':_0xb642('0x135'),'through':_0xb642('0x36'),'foreignKey':_0xb642('0x165')});db['OpenchannelQueue'][_0xb642('0x103')](db[_0xb642('0xe2')],{'through':_0xb642('0x169'),'as':_0xb642('0x136')});db['ChatWebsite'][_0xb642('0xf9')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xb642('0x16a')});db[_0xb642('0x5f')][_0xb642('0xf9')](db[_0xb642('0x7a')],{'as':_0xb642('0x147'),'foreignKey':_0xb642('0x16a')});db[_0xb642('0x5f')][_0xb642('0xf9')](db['ChatProactiveAction'],{'as':_0xb642('0x16b')});db[_0xb642('0x5f')][_0xb642('0xf9')](db[_0xb642('0x62')],{'as':_0xb642('0x149')});db[_0xb642('0x5f')][_0xb642('0xf9')](db[_0xb642('0x60')],{'as':'Applications'});db[_0xb642('0x5f')]['hasMany'](db[_0xb642('0x16c')],{'as':_0xb642('0x139')});db[_0xb642('0x5f')][_0xb642('0x101')](db['CmList'],{'as':_0xb642('0x14a'),'foreignKey':_0xb642('0x14b')});db[_0xb642('0x5f')][_0xb642('0x101')](db[_0xb642('0x80')],{'as':_0xb642('0x80'),'foreignKey':_0xb642('0x131')});db['ChatWebsite'][_0xb642('0x101')](db[_0xb642('0x82')],{'as':_0xb642('0x132'),'foreignKey':_0xb642('0x14c')});db[_0xb642('0x5f')][_0xb642('0x103')](db[_0xb642('0x14')],{'as':'Agents','through':_0xb642('0x11a')});db[_0xb642('0x16d')][_0xb642('0x101')](db['OpenchannelAccount'],{});db[_0xb642('0x16d')][_0xb642('0x101')](db[_0xb642('0xf0')],{'as':_0xb642('0x14a'),'foreignKey':_0xb642('0x14b')});db[_0xb642('0x16d')]['belongsTo'](db[_0xb642('0x6e')],{'as':_0xb642('0x140'),'foreignKey':_0xb642('0x151')});db[_0xb642('0x16d')][_0xb642('0x101')](db[_0xb642('0x5b')],{});db['OpenchannelQueueReport'][_0xb642('0x101')](db['OpenchannelMessage'],{});db[_0xb642('0x16d')][_0xb642('0x101')](db[_0xb642('0x14')],{});db[_0xb642('0x16d')][_0xb642('0x101')](db[_0xb642('0x116')],{});db[_0xb642('0x60')]['belongsTo'](db[_0xb642('0x14')],{'as':_0xb642('0x16e'),'foreignKey':_0xb642('0xf8'),'onDelete':'restrict'});db[_0xb642('0x60')][_0xb642('0x101')](db[_0xb642('0x16f')],{'as':'Queue','foreignKey':_0xb642('0x170'),'onDelete':'restrict'});db[_0xb642('0x60')][_0xb642('0x101')](db['ChatWebsite'],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0xb642('0x60')]['belongsTo'](db[_0xb642('0x88')],{'onDelete':_0xb642('0x157'),'foreignKey':_0xb642('0x15b')});db['ChatInteraction'][_0xb642('0xf9')](db[_0xb642('0x16c')],{'as':_0xb642('0x139'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x171')});db[_0xb642('0x62')][_0xb642('0x101')](db['ChatWebsite'],{'as':_0xb642('0x150'),'foreignKey':_0xb642('0x16a')});db[_0xb642('0x62')]['belongsTo'](db[_0xb642('0x6e')],{'as':_0xb642('0x140'),'foreignKey':_0xb642('0x151')});db[_0xb642('0x62')][_0xb642('0x101')](db[_0xb642('0x14')],{'as':'Owner','foreignKey':'UserId'});db[_0xb642('0x62')][_0xb642('0x103')](db['Tag'],{'through':_0xb642('0x172'),'as':_0xb642('0x152')});db['ChatInteraction'][_0xb642('0x103')](db[_0xb642('0x88')],{'through':_0xb642('0x172'),'as':_0xb642('0x154')});db['ChatInteraction'][_0xb642('0x103')](db[_0xb642('0x14')],{'as':_0xb642('0x155'),'through':_0xb642('0x10b'),'foreignKey':_0xb642('0x171')});db[_0xb642('0x16c')][_0xb642('0x101')](db[_0xb642('0x14')],{'onDelete':_0xb642('0xf7'),'as':_0xb642('0x14')});db[_0xb642('0x16c')][_0xb642('0x101')](db[_0xb642('0x6e')],{'onDelete':_0xb642('0xf7'),'as':_0xb642('0x140'),'foreignKey':'ContactId'});db['ChatMessage']['belongsTo'](db[_0xb642('0x62')],{'onDelete':_0xb642('0xf7'),'as':'Interaction','foreignKey':_0xb642('0x171')});db[_0xb642('0x16c')][_0xb642('0x101')](db[_0xb642('0xe9')],{'as':'Attachment','foreignKey':_0xb642('0x168')});db['ChatMessage'][_0xb642('0x101')](db[_0xb642('0x5f')],{'as':_0xb642('0x150'),'foreignKey':_0xb642('0x16a')});db[_0xb642('0x65')][_0xb642('0x101')](db[_0xb642('0x6e')],{'onDelete':'cascade','as':_0xb642('0x140'),'foreignKey':_0xb642('0x151')});db['ChatOfflineMessage'][_0xb642('0x101')](db[_0xb642('0x5f')],{'as':_0xb642('0x150'),'foreignKey':_0xb642('0x16a')});db['ChatQueue'][_0xb642('0x103')](db['User'],{'as':_0xb642('0x135'),'through':_0xb642('0x32'),'hooks':!![]});db[_0xb642('0x16f')]['belongsToMany'](db[_0xb642('0xe2')],{'through':_0xb642('0x173'),'as':'Teams'});db[_0xb642('0x68')][_0xb642('0xf9')](db['ChatInternalMessage'],{'as':_0xb642('0x139'),'foreignKey':_0xb642('0x174'),'onDelete':_0xb642('0xf7')});db[_0xb642('0x68')]['belongsToMany'](db[_0xb642('0x14')],{'as':_0xb642('0x12a'),'through':_0xb642('0x105')});db['ChatProactiveAction'][_0xb642('0x101')](db[_0xb642('0x5f')],{'as':_0xb642('0x175'),'foreignKey':'ChatWebsiteId'});db[_0xb642('0x6c')]['hasMany'](db[_0xb642('0x6e')],{'as':_0xb642('0x106'),'foreignKey':_0xb642('0x176')});db['CmContact'][_0xb642('0xf9')](db[_0xb642('0x70')],{'as':_0xb642('0x12c'),'foreignKey':_0xb642('0x151')});db[_0xb642('0x6e')][_0xb642('0xf9')](db[_0xb642('0x72')],{'as':'HopperFinals','foreignKey':_0xb642('0x151')});db[_0xb642('0x6e')][_0xb642('0xf9')](db[_0xb642('0xfe')],{'as':_0xb642('0x177'),'foreignKey':_0xb642('0x151')});db['CmContact']['hasMany'](db[_0xb642('0x74')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0xb642('0x6e')][_0xb642('0xf9')](db[_0xb642('0xd3')],{'as':'JscriptySessions','foreignKey':'ContactId'});db[_0xb642('0x6e')][_0xb642('0xf9')](db[_0xb642('0x5b')],{'as':_0xb642('0x110'),'foreignKey':_0xb642('0x151'),'onDelete':'restrict'});db[_0xb642('0x6e')]['hasMany'](db['ChatInteraction'],{'as':_0xb642('0x10a'),'foreignKey':_0xb642('0x151'),'onDelete':_0xb642('0x157')});db['CmContact'][_0xb642('0xf9')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xb642('0x151'),'onDelete':_0xb642('0x157')});db[_0xb642('0x6e')][_0xb642('0xf9')](db[_0xb642('0x10c')],{'as':_0xb642('0x10d'),'foreignKey':_0xb642('0x151'),'onDelete':_0xb642('0x157')});db[_0xb642('0x6e')]['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0xb642('0x151'),'onDelete':_0xb642('0x157')});db['CmContact'][_0xb642('0x101')](db['CmCompany'],{'as':_0xb642('0x178'),'foreignKey':_0xb642('0x176')});db[_0xb642('0x6e')]['belongsTo'](db['CmList'],{'as':_0xb642('0x14a'),'foreignKey':_0xb642('0x14b'),'onDelete':_0xb642('0xf7')});db[_0xb642('0x6e')][_0xb642('0x103')](db['User'],{'as':'Users','through':'cm_user_has_contacts'});db[_0xb642('0x6e')]['belongsToMany'](db['Tag'],{'as':'Tags','through':_0xb642('0x179')});db[_0xb642('0x6e')][_0xb642('0x103')](db[_0xb642('0x88')],{'through':_0xb642('0x179'),'as':_0xb642('0x154')});db[_0xb642('0x70')][_0xb642('0x101')](db[_0xb642('0x6e')],{'as':_0xb642('0x140'),'foreignKey':_0xb642('0x151'),'onDelete':_0xb642('0xf7')});db[_0xb642('0x70')]['belongsTo'](db[_0xb642('0xf0')],{'as':'List','foreignKey':_0xb642('0x14b'),'onDelete':'cascade'});db[_0xb642('0x70')][_0xb642('0x101')](db['User'],{'as':_0xb642('0x16e'),'foreignKey':_0xb642('0xf8')});db[_0xb642('0x70')][_0xb642('0x101')](db[_0xb642('0x1d')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xb642('0x70')]['belongsTo'](db[_0xb642('0xe6')],{'as':'Campaign','foreignKey':_0xb642('0x17a'),'onDelete':_0xb642('0xf7')});db[_0xb642('0x70')][_0xb642('0x101')](db[_0xb642('0x14')],{'as':'Owner','foreignKey':_0xb642('0x17b')});db[_0xb642('0x12d')][_0xb642('0x101')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId','onDelete':_0xb642('0xf7')});db['CmHopperBlack'][_0xb642('0x101')](db[_0xb642('0xf0')],{'as':_0xb642('0x14a'),'foreignKey':_0xb642('0x14b'),'onDelete':_0xb642('0xf7')});db[_0xb642('0x12d')][_0xb642('0x101')](db[_0xb642('0x1d')],{'as':_0xb642('0x17c'),'foreignKey':_0xb642('0x12b'),'onDelete':_0xb642('0xf7')});db[_0xb642('0x12d')][_0xb642('0x101')](db['Campaign'],{'as':_0xb642('0xe6'),'foreignKey':_0xb642('0x17a'),'onDelete':'cascade'});db['Automation'][_0xb642('0xf9')](db[_0xb642('0x7e')],{'as':{'plural':_0xb642('0x17d'),'singular':_0xb642('0x17e')},'foreignKey':_0xb642('0x17f'),'onDelete':_0xb642('0xf7'),'hooks':!![]});db[_0xb642('0x78')][_0xb642('0xf9')](db[_0xb642('0x7e')],{'as':{'plural':_0xb642('0x180'),'singular':_0xb642('0x181')},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0xb642('0x78')]['hasMany'](db['Action'],{'as':_0xb642('0x182'),'foreignKey':_0xb642('0x183'),'onDelete':_0xb642('0xf7'),'hooks':!![]});db[_0xb642('0x80')][_0xb642('0xf9')](db[_0xb642('0x80')],{'as':_0xb642('0x184'),'foreignKey':'IntervalId','onDelete':_0xb642('0xf7'),'hooks':!![],'required':![]});db[_0xb642('0x80')][_0xb642('0xf9')](db[_0xb642('0x1a')],{'as':'Extensions','foreignKey':_0xb642('0x131'),'onDelete':'restrict'});db['Interval'][_0xb642('0xf9')](db[_0xb642('0x42')],{'as':_0xb642('0x185'),'foreignKey':_0xb642('0x131')});db[_0xb642('0x80')][_0xb642('0xf9')](db[_0xb642('0x60')],{'as':_0xb642('0x186'),'foreignKey':_0xb642('0x131')});db[_0xb642('0x80')][_0xb642('0xf9')](db['FaxApplication'],{'as':_0xb642('0x187'),'foreignKey':_0xb642('0x131')});db['Interval']['hasMany'](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0xb642('0x131')});db[_0xb642('0x188')][_0xb642('0x101')](db[_0xb642('0x3a')],{});db[_0xb642('0x188')][_0xb642('0x101')](db['AnalyticDefaultReport'],{'foreignKey':_0xb642('0x189')});db[_0xb642('0x188')]['belongsTo'](db[_0xb642('0x8e')],{'foreignKey':_0xb642('0x18a')});db[_0xb642('0x127')][_0xb642('0x103')](db['VoiceMusicOnHold'],{'as':_0xb642('0x18b'),'through':_0xb642('0x129'),'onDelete':_0xb642('0x157')});db[_0xb642('0x88')][_0xb642('0x103')](db[_0xb642('0x6e')],{'through':_0xb642('0x179')});db[_0xb642('0x88')][_0xb642('0x103')](db['ChatInteraction'],{'through':_0xb642('0x172')});db['Tag'][_0xb642('0x103')](db[_0xb642('0x40')],{'through':_0xb642('0x153')});db[_0xb642('0x88')][_0xb642('0x103')](db[_0xb642('0x51')],{'through':_0xb642('0x161')});db[_0xb642('0x88')][_0xb642('0x103')](db[_0xb642('0x10c')],{'through':_0xb642('0x15e')});db['Tag'][_0xb642('0x103')](db[_0xb642('0x5b')],{'through':_0xb642('0x167')});db[_0xb642('0x18c')][_0xb642('0xf9')](db[_0xb642('0x7e')],{'as':{'plural':_0xb642('0x18d'),'singular':_0xb642('0x18e')},'foreignKey':_0xb642('0x18f'),'onDelete':'cascade','hooks':!![]});db[_0xb642('0x18c')][_0xb642('0xf9')](db[_0xb642('0x7e')],{'as':{'plural':_0xb642('0x190'),'singular':'AnyCondition'},'foreignKey':_0xb642('0x191'),'onDelete':_0xb642('0xf7'),'hooks':!![]});db['Trigger']['hasMany'](db[_0xb642('0x192')],{'as':_0xb642('0x182'),'foreignKey':_0xb642('0x193'),'onDelete':'cascade','hooks':!![]});db[_0xb642('0x8e')][_0xb642('0xf9')](db[_0xb642('0x95')],{'as':_0xb642('0x194'),'onDelete':_0xb642('0xf7'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xb642('0x90')][_0xb642('0xf9')](db[_0xb642('0x95')],{'as':_0xb642('0x194'),'onDelete':_0xb642('0xf7'),'foreignKey':'DefaultReportId'});db[_0xb642('0x94')]['hasMany'](db[_0xb642('0x95')],{'as':'Fields','onDelete':_0xb642('0xf7'),'foreignKey':'MetricId'});db[_0xb642('0x95')][_0xb642('0x101')](db[_0xb642('0x94')],{'foreignKey':_0xb642('0x195')});db[_0xb642('0x98')][_0xb642('0xf9')](db[_0xb642('0x9a')],{'as':_0xb642('0x196'),'onDelete':_0xb642('0xf7'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0xb642('0xf9')](db['SalesforceField'],{'as':_0xb642('0x197'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x198')});db[_0xb642('0x9a')][_0xb642('0xf9')](db[_0xb642('0x9b')],{'as':_0xb642('0x199'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x19a')});db[_0xb642('0x9a')][_0xb642('0xf9')](db[_0xb642('0x9b')],{'as':_0xb642('0x194'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x19b')});db[_0xb642('0x9a')][_0xb642('0x101')](db[_0xb642('0x98')],{'as':'Account','foreignKey':_0xb642('0x19c')});db[_0xb642('0x9b')]['hasMany'](db[_0xb642('0x9b')],{'as':_0xb642('0x19d'),'foreignKey':_0xb642('0x198')});db[_0xb642('0x9b')][_0xb642('0xf9')](db['SalesforceField'],{'as':_0xb642('0x19e'),'foreignKey':_0xb642('0x19a')});db['SalesforceField']['hasMany'](db[_0xb642('0x9b')],{'as':_0xb642('0x19f'),'foreignKey':_0xb642('0x19b')});db[_0xb642('0x9b')][_0xb642('0x101')](db['Variable'],{'as':_0xb642('0x1a0'),'foreignKey':_0xb642('0x1a1')});db[_0xb642('0x9c')][_0xb642('0xf9')](db[_0xb642('0x9d')],{'as':'Configurations','onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x19c')});db['SugarcrmConfiguration'][_0xb642('0xf9')](db['SugarcrmField'],{'as':_0xb642('0x197'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x198')});db['SugarcrmConfiguration'][_0xb642('0xf9')](db[_0xb642('0x9f')],{'as':_0xb642('0x199'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x19a')});db['SugarcrmConfiguration'][_0xb642('0xf9')](db[_0xb642('0x9f')],{'as':_0xb642('0x194'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x19b')});db[_0xb642('0x9d')][_0xb642('0x101')](db[_0xb642('0x9c')],{'as':_0xb642('0x150'),'foreignKey':_0xb642('0x19c')});db[_0xb642('0x9f')][_0xb642('0xf9')](db[_0xb642('0x9f')],{'as':_0xb642('0x19d'),'foreignKey':_0xb642('0x198')});db[_0xb642('0x9f')]['hasMany'](db[_0xb642('0x9f')],{'as':_0xb642('0x19e'),'foreignKey':_0xb642('0x19a')});db['SugarcrmField'][_0xb642('0xf9')](db[_0xb642('0x9f')],{'as':_0xb642('0x19f'),'foreignKey':'FieldId'});db[_0xb642('0x9f')][_0xb642('0x101')](db['Variable'],{'as':'Variable','foreignKey':_0xb642('0x1a1')});db[_0xb642('0xa1')]['hasMany'](db[_0xb642('0xa3')],{'as':_0xb642('0x196'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x19c')});db['DeskConfiguration'][_0xb642('0xf9')](db['DeskField'],{'as':'Subjects','onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x198')});db[_0xb642('0xa3')][_0xb642('0xf9')](db['DeskField'],{'as':_0xb642('0x199'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x19a')});db[_0xb642('0xa3')][_0xb642('0xf9')](db[_0xb642('0xa5')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xb642('0xa3')][_0xb642('0x101')](db[_0xb642('0xa1')],{'as':_0xb642('0x150'),'foreignKey':_0xb642('0x19c')});db[_0xb642('0xa3')][_0xb642('0x103')](db[_0xb642('0x88')],{'through':_0xb642('0x1a2')});db['DeskField'][_0xb642('0xf9')](db[_0xb642('0xa5')],{'as':_0xb642('0x19d'),'foreignKey':_0xb642('0x198')});db['DeskField']['hasMany'](db[_0xb642('0xa5')],{'as':_0xb642('0x19e'),'foreignKey':'DescriptionId'});db[_0xb642('0xa5')]['hasMany'](db[_0xb642('0xa5')],{'as':_0xb642('0x19f'),'foreignKey':_0xb642('0x19b')});db[_0xb642('0xa5')]['belongsTo'](db[_0xb642('0x1a0')],{'as':_0xb642('0x1a0'),'foreignKey':'VariableId'});db[_0xb642('0x1a3')]['hasMany'](db['ZohoConfiguration'],{'as':_0xb642('0x196'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x19c')});db[_0xb642('0xa8')]['hasMany'](db['ZohoField'],{'as':_0xb642('0x197'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x198')});db[_0xb642('0xa8')][_0xb642('0xf9')](db[_0xb642('0xa9')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xb642('0x19a')});db[_0xb642('0xa8')][_0xb642('0xf9')](db[_0xb642('0xa9')],{'as':_0xb642('0x194'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x19b')});db['ZohoConfiguration'][_0xb642('0x101')](db['ZohoAccount'],{'as':_0xb642('0x150'),'foreignKey':_0xb642('0x19c')});db[_0xb642('0xa9')]['hasMany'](db[_0xb642('0xa9')],{'as':_0xb642('0x19d'),'foreignKey':'SubjectId'});db['ZohoField'][_0xb642('0xf9')](db['ZohoField'],{'as':_0xb642('0x19e'),'foreignKey':_0xb642('0x19a')});db[_0xb642('0xa9')][_0xb642('0xf9')](db[_0xb642('0xa9')],{'as':_0xb642('0x19f'),'foreignKey':_0xb642('0x19b')});db[_0xb642('0xa9')]['belongsTo'](db[_0xb642('0x1a0')],{'as':_0xb642('0x1a0'),'foreignKey':'VariableId'});db[_0xb642('0x1a4')][_0xb642('0xf9')](db[_0xb642('0xac')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xb642('0x19c')});db['ZendeskConfiguration'][_0xb642('0xf9')](db[_0xb642('0xae')],{'as':_0xb642('0x197'),'foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0xb642('0xf9')](db['ZendeskField'],{'as':_0xb642('0x199'),'foreignKey':_0xb642('0x19a')});db[_0xb642('0xac')][_0xb642('0xf9')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0xb642('0xac')][_0xb642('0x101')](db[_0xb642('0x1a4')],{'as':_0xb642('0x150'),'foreignKey':_0xb642('0x19c')});db['ZendeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0xb642('0x1a5')});db['ZendeskField'][_0xb642('0xf9')](db[_0xb642('0xae')],{'as':_0xb642('0x19d'),'foreignKey':_0xb642('0x198')});db[_0xb642('0xae')][_0xb642('0xf9')](db[_0xb642('0xae')],{'as':_0xb642('0x19e'),'foreignKey':_0xb642('0x19a')});db['ZendeskField'][_0xb642('0xf9')](db[_0xb642('0xae')],{'as':'Field','foreignKey':_0xb642('0x19b')});db[_0xb642('0xae')][_0xb642('0x101')](db[_0xb642('0x1a0')],{'as':_0xb642('0x1a0'),'foreignKey':_0xb642('0x1a1')});db[_0xb642('0xb0')][_0xb642('0xf9')](db[_0xb642('0xb2')],{'as':_0xb642('0x196'),'onDelete':'cascade','foreignKey':_0xb642('0x19c')});db[_0xb642('0xb2')][_0xb642('0xf9')](db[_0xb642('0x1a6')],{'as':_0xb642('0x197'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x198')});db[_0xb642('0xb2')]['hasMany'](db[_0xb642('0x1a6')],{'as':'Descriptions','onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x19a')});db[_0xb642('0xb2')][_0xb642('0xf9')](db[_0xb642('0x1a6')],{'as':_0xb642('0x194'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x19b')});db[_0xb642('0xb2')][_0xb642('0x101')](db[_0xb642('0xb0')],{'as':_0xb642('0x150'),'foreignKey':_0xb642('0x19c')});db[_0xb642('0xb2')][_0xb642('0x103')](db[_0xb642('0x88')],{'through':_0xb642('0x1a7')});db[_0xb642('0x1a6')]['hasMany'](db[_0xb642('0x1a6')],{'as':_0xb642('0x19d'),'foreignKey':_0xb642('0x198')});db[_0xb642('0x1a6')][_0xb642('0xf9')](db[_0xb642('0x1a6')],{'as':_0xb642('0x19e'),'foreignKey':_0xb642('0x19a')});db['FreshdeskField'][_0xb642('0xf9')](db['FreshdeskField'],{'as':_0xb642('0x19f'),'foreignKey':_0xb642('0x19b')});db['FreshdeskField'][_0xb642('0x101')](db['Variable'],{'as':_0xb642('0x1a0'),'foreignKey':_0xb642('0x1a1')});db[_0xb642('0xb4')]['hasMany'](db[_0xb642('0xb6')],{'as':_0xb642('0x196'),'onDelete':_0xb642('0xf7'),'foreignKey':'AccountId'});db[_0xb642('0xb6')][_0xb642('0xf9')](db[_0xb642('0xb8')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xb642('0xb6')][_0xb642('0xf9')](db[_0xb642('0xb8')],{'as':_0xb642('0x199'),'foreignKey':_0xb642('0x19a')});db[_0xb642('0xb6')]['hasMany'](db[_0xb642('0xb8')],{'as':_0xb642('0x194'),'foreignKey':_0xb642('0x19b')});db[_0xb642('0xb6')]['belongsTo'](db[_0xb642('0xb4')],{'as':_0xb642('0x150'),'foreignKey':_0xb642('0x19c')});db[_0xb642('0xb8')]['hasMany'](db[_0xb642('0xb8')],{'as':_0xb642('0x19d'),'foreignKey':_0xb642('0x198')});db[_0xb642('0xb8')][_0xb642('0xf9')](db[_0xb642('0xb8')],{'as':'Description','foreignKey':_0xb642('0x19a')});db[_0xb642('0xb8')][_0xb642('0xf9')](db[_0xb642('0xb8')],{'as':_0xb642('0x19f'),'foreignKey':_0xb642('0x19b')});db[_0xb642('0xb8')][_0xb642('0x101')](db[_0xb642('0x1a0')],{'as':'Variable','foreignKey':_0xb642('0x1a1')});db[_0xb642('0xb9')][_0xb642('0xf9')](db[_0xb642('0xbb')],{'as':'Configurations','onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x19c')});db[_0xb642('0xbb')]['hasMany'](db['ServicenowField'],{'as':'Subjects','foreignKey':_0xb642('0x198')});db[_0xb642('0xbb')]['hasMany'](db['ServicenowField'],{'as':_0xb642('0x199'),'foreignKey':_0xb642('0x19a')});db[_0xb642('0xbb')][_0xb642('0xf9')](db[_0xb642('0x1a8')],{'as':_0xb642('0x194'),'foreignKey':_0xb642('0x19b')});db[_0xb642('0xbb')][_0xb642('0x101')](db[_0xb642('0xb9')],{'as':_0xb642('0x150'),'foreignKey':'AccountId'});db[_0xb642('0x1a8')][_0xb642('0xf9')](db[_0xb642('0x1a8')],{'as':_0xb642('0x19d'),'foreignKey':_0xb642('0x198')});db['ServicenowField'][_0xb642('0xf9')](db[_0xb642('0x1a8')],{'as':_0xb642('0x19e'),'foreignKey':'DescriptionId'});db[_0xb642('0x1a8')][_0xb642('0xf9')](db[_0xb642('0x1a8')],{'as':'Field','foreignKey':_0xb642('0x19b')});db[_0xb642('0x1a8')]['belongsTo'](db[_0xb642('0x1a0')],{'as':_0xb642('0x1a0'),'foreignKey':_0xb642('0x1a1')});db[_0xb642('0xbd')][_0xb642('0xf9')](db[_0xb642('0xbf')],{'as':_0xb642('0x196'),'onDelete':_0xb642('0xf7'),'foreignKey':'AccountId'});db[_0xb642('0xbf')][_0xb642('0xf9')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xb642('0x198')});db[_0xb642('0xbf')][_0xb642('0xf9')](db['Dynamics365Field'],{'as':_0xb642('0x199'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x19a')});db['Dynamics365Configuration'][_0xb642('0xf9')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x19b')});db[_0xb642('0xbf')][_0xb642('0x101')](db[_0xb642('0xbd')],{'as':_0xb642('0x150'),'foreignKey':'AccountId'});db[_0xb642('0xc1')][_0xb642('0xf9')](db[_0xb642('0xc1')],{'as':_0xb642('0x19d'),'foreignKey':_0xb642('0x198')});db[_0xb642('0xc1')][_0xb642('0xf9')](db[_0xb642('0xc1')],{'as':'Description','foreignKey':'DescriptionId'});db['Dynamics365Field'][_0xb642('0xf9')](db['Dynamics365Field'],{'as':_0xb642('0x19f'),'foreignKey':_0xb642('0x19b')});db[_0xb642('0xc1')][_0xb642('0x101')](db['Variable'],{'as':_0xb642('0x1a0'),'foreignKey':'VariableId'});db['FreshsalesAccount'][_0xb642('0xf9')](db[_0xb642('0xc5')],{'as':_0xb642('0x196'),'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x19c')});db[_0xb642('0xc5')][_0xb642('0xf9')](db[_0xb642('0xc6')],{'as':_0xb642('0x197'),'foreignKey':_0xb642('0x198')});db['FreshsalesConfiguration'][_0xb642('0xf9')](db['FreshsalesField'],{'as':_0xb642('0x199'),'foreignKey':_0xb642('0x19a')});db[_0xb642('0xc5')]['hasMany'](db['FreshsalesField'],{'as':_0xb642('0x194'),'foreignKey':_0xb642('0x19b')});db[_0xb642('0xc5')]['belongsTo'](db['FreshsalesAccount'],{'as':'Account','foreignKey':_0xb642('0x19c')});db[_0xb642('0xc6')]['hasMany'](db[_0xb642('0xc6')],{'as':_0xb642('0x19d'),'foreignKey':_0xb642('0x198')});db['FreshsalesField'][_0xb642('0xf9')](db[_0xb642('0xc6')],{'as':_0xb642('0x19e'),'foreignKey':'DescriptionId'});db[_0xb642('0xc6')][_0xb642('0xf9')](db['FreshsalesField'],{'as':_0xb642('0x19f'),'foreignKey':_0xb642('0x19b')});db['FreshsalesField'][_0xb642('0x101')](db[_0xb642('0x1a0')],{'as':'Variable','foreignKey':'VariableId'});db[_0xb642('0xcb')][_0xb642('0x101')](db[_0xb642('0x5f')],{});db[_0xb642('0xcb')][_0xb642('0x101')](db[_0xb642('0xf0')],{'as':_0xb642('0x14a'),'foreignKey':'ListId'});db[_0xb642('0xcb')][_0xb642('0x101')](db[_0xb642('0x6e')],{'as':_0xb642('0x140'),'foreignKey':_0xb642('0x151')});db[_0xb642('0xcb')][_0xb642('0x101')](db[_0xb642('0x62')],{});db['ChatQueueReport']['belongsTo'](db['ChatMessage'],{});db[_0xb642('0xcb')][_0xb642('0x101')](db[_0xb642('0x14')],{});db[_0xb642('0xcb')]['belongsTo'](db[_0xb642('0x16f')],{});db[_0xb642('0xcd')][_0xb642('0x101')](db[_0xb642('0x14')],{'onDelete':'cascade','foreignKey':_0xb642('0x1a9')});db['ChatInternalMessage'][_0xb642('0x101')](db[_0xb642('0x14')],{'onDelete':_0xb642('0xf7'),'foreignKey':_0xb642('0x1aa')});db[_0xb642('0xd3')][_0xb642('0xf9')](db[_0xb642('0xd1')],{'foreignKey':_0xb642('0x1ab'),'onDelete':_0xb642('0xf7')});db[_0xb642('0xd3')]['hasMany'](db[_0xb642('0xcf')],{'foreignKey':_0xb642('0x1ab'),'onDelete':_0xb642('0xf7')});db[_0xb642('0x1ac')]['belongsTo'](db[_0xb642('0x11f')],{});db[_0xb642('0x1ac')][_0xb642('0x101')](db['CmList'],{'as':_0xb642('0x14a'),'foreignKey':_0xb642('0x14b')});db[_0xb642('0x1ac')]['belongsTo'](db[_0xb642('0x6e')],{'as':_0xb642('0x140'),'foreignKey':'ContactId'});db[_0xb642('0x1ac')]['belongsTo'](db[_0xb642('0x51')],{});db['SmsQueueReport'][_0xb642('0x101')](db[_0xb642('0x53')],{});db['SmsQueueReport'][_0xb642('0x101')](db[_0xb642('0x14')],{});db[_0xb642('0x1ac')][_0xb642('0x101')](db[_0xb642('0x55')],{});db[_0xb642('0xd9')][_0xb642('0xf9')](db[_0xb642('0xd3')],{'foreignKey':'ProjectId'});db[_0xb642('0xd9')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0xb642('0xd9')]['hasMany'](db[_0xb642('0xcf')],{'foreignKey':_0xb642('0x1ad')});db[_0xb642('0x122')]['belongsToMany'](db[_0xb642('0x14')],{'as':'Users','through':_0xb642('0x1ae')});db[_0xb642('0xe2')][_0xb642('0x103')](db[_0xb642('0x14')],{'as':_0xb642('0x135'),'through':_0xb642('0x108')});db[_0xb642('0xe2')][_0xb642('0x103')](db[_0xb642('0x1d')],{'through':_0xb642('0x1af'),'as':_0xb642('0x112')});db['Team']['belongsToMany'](db[_0xb642('0x3c')],{'through':'team_has_mail_queues','as':_0xb642('0x1b0')});db[_0xb642('0xe2')][_0xb642('0x103')](db[_0xb642('0x16f')],{'through':_0xb642('0x173'),'as':_0xb642('0x1b1')});db[_0xb642('0xe2')][_0xb642('0x103')](db[_0xb642('0x4c')],{'through':_0xb642('0x1b2'),'as':_0xb642('0x113')});db[_0xb642('0xe2')][_0xb642('0x103')](db[_0xb642('0x55')],{'through':_0xb642('0x163'),'as':'SmsQueues'});db[_0xb642('0xe2')][_0xb642('0x103')](db[_0xb642('0x116')],{'through':_0xb642('0x169'),'as':_0xb642('0x117')});db['Campaign']['hasMany'](db[_0xb642('0x70')],{'as':_0xb642('0x12c'),'foreignKey':'CampaignId'});db[_0xb642('0xe6')][_0xb642('0xf9')](db[_0xb642('0x72')],{'as':_0xb642('0xfd'),'foreignKey':_0xb642('0x17a')});db[_0xb642('0xe6')][_0xb642('0xf9')](db[_0xb642('0xfe')],{'as':_0xb642('0x177'),'foreignKey':'CampaignId'});db[_0xb642('0xe6')]['hasMany'](db[_0xb642('0x12d')],{'as':_0xb642('0x12e'),'foreignKey':_0xb642('0x17a')});db[_0xb642('0xe6')]['belongsTo'](db[_0xb642('0x2c')],{'as':_0xb642('0x2c'),'foreignKey':_0xb642('0x130')});db[_0xb642('0xe6')][_0xb642('0x101')](db[_0xb642('0x2c')],{'as':_0xb642('0x1b3'),'foreignKey':_0xb642('0x1b4')});db[_0xb642('0xe6')][_0xb642('0x101')](db[_0xb642('0x80')],{'as':_0xb642('0x80'),'foreignKey':_0xb642('0x131')});db[_0xb642('0xe6')]['belongsTo'](db[_0xb642('0x122')],{'as':_0xb642('0x122'),'foreignKey':_0xb642('0x1b5')});db[_0xb642('0xe6')][_0xb642('0x103')](db[_0xb642('0xf0')],{'as':'Lists','through':_0xb642('0x1b6')});db[_0xb642('0xe6')][_0xb642('0x103')](db[_0xb642('0xf0')],{'as':_0xb642('0x137'),'through':_0xb642('0x1b7')});db[_0xb642('0xed')][_0xb642('0x101')](db[_0xb642('0x148')],{});db['MailTransferReport'][_0xb642('0x101')](db[_0xb642('0x40')],{});db['MailTransferReport'][_0xb642('0x101')](db['MailAccount'],{'foreignKey':_0xb642('0x1b8'),'as':_0xb642('0x1b9')});db[_0xb642('0xed')][_0xb642('0x101')](db[_0xb642('0x14')],{'foreignKey':_0xb642('0x1ba'),'as':_0xb642('0x1bb')});db['MailTransferReport'][_0xb642('0x101')](db[_0xb642('0x14')],{'foreignKey':_0xb642('0x1bc'),'as':'ToAgent'});db[_0xb642('0xed')]['belongsTo'](db['MailQueue'],{'foreignKey':_0xb642('0x1bd'),'as':_0xb642('0x1be')});db[_0xb642('0xed')]['belongsTo'](db[_0xb642('0x3a')],{'foreignKey':_0xb642('0x1bf'),'as':_0xb642('0x1c0')});db[_0xb642('0xee')][_0xb642('0x101')](db[_0xb642('0x16c')],{});db['ChatTransferReport'][_0xb642('0x101')](db[_0xb642('0x62')],{});db['ChatTransferReport'][_0xb642('0x101')](db['ChatWebsite'],{'foreignKey':_0xb642('0x1c1'),'as':_0xb642('0x1b9')});db[_0xb642('0xee')][_0xb642('0x101')](db[_0xb642('0x14')],{'foreignKey':_0xb642('0x1ba'),'as':_0xb642('0x1bb')});db['ChatTransferReport']['belongsTo'](db[_0xb642('0x14')],{'foreignKey':_0xb642('0x1bc'),'as':_0xb642('0x1c2')});db[_0xb642('0xee')][_0xb642('0x101')](db[_0xb642('0x16f')],{'foreignKey':_0xb642('0x1c3'),'as':'ToQueue'});db[_0xb642('0xee')][_0xb642('0x101')](db[_0xb642('0x5f')],{'foreignKey':_0xb642('0x1c4'),'as':_0xb642('0x1c0')});db['FaxTransferReport'][_0xb642('0x101')](db['FaxMessage'],{});db[_0xb642('0x1c5')]['belongsTo'](db[_0xb642('0x10c')],{});db[_0xb642('0x1c5')][_0xb642('0x101')](db['FaxAccount'],{'foreignKey':_0xb642('0x1c6'),'as':_0xb642('0x1b9')});db[_0xb642('0x1c5')][_0xb642('0x101')](db[_0xb642('0x14')],{'foreignKey':_0xb642('0x1ba'),'as':'FromAgent'});db['FaxTransferReport']['belongsTo'](db['User'],{'foreignKey':_0xb642('0x1bc'),'as':_0xb642('0x1c2')});db[_0xb642('0x1c5')][_0xb642('0x101')](db[_0xb642('0x4c')],{'foreignKey':_0xb642('0x1c7'),'as':_0xb642('0x1be')});db[_0xb642('0x1c5')][_0xb642('0x101')](db[_0xb642('0x47')],{'foreignKey':_0xb642('0x1c8'),'as':_0xb642('0x1c0')});db[_0xb642('0x1c9')]['belongsTo'](db['OpenchannelMessage'],{});db['OpenchannelTransferReport'][_0xb642('0x101')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0xb642('0x101')](db['OpenchannelAccount'],{'foreignKey':_0xb642('0x1ca'),'as':_0xb642('0x1b9')});db[_0xb642('0x1c9')][_0xb642('0x101')](db[_0xb642('0x14')],{'foreignKey':_0xb642('0x1ba'),'as':_0xb642('0x1bb')});db['OpenchannelTransferReport']['belongsTo'](db['User'],{'foreignKey':_0xb642('0x1bc'),'as':_0xb642('0x1c2')});db[_0xb642('0x1c9')][_0xb642('0x101')](db[_0xb642('0x116')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0xb642('0x1c9')][_0xb642('0x101')](db[_0xb642('0x57')],{'foreignKey':_0xb642('0x1cb'),'as':_0xb642('0x1c0')});db[_0xb642('0x1cc')][_0xb642('0x101')](db['SmsMessage'],{});db[_0xb642('0x1cc')][_0xb642('0x101')](db[_0xb642('0x51')],{});db[_0xb642('0x1cc')][_0xb642('0x101')](db['SmsAccount'],{'foreignKey':_0xb642('0x1cd'),'as':_0xb642('0x1b9')});db[_0xb642('0x1cc')][_0xb642('0x101')](db[_0xb642('0x14')],{'foreignKey':_0xb642('0x1ba'),'as':_0xb642('0x1bb')});db[_0xb642('0x1cc')][_0xb642('0x101')](db['User'],{'foreignKey':_0xb642('0x1bc'),'as':_0xb642('0x1c2')});db['SmsTransferReport'][_0xb642('0x101')](db[_0xb642('0x55')],{'foreignKey':_0xb642('0x1ce'),'as':_0xb642('0x1be')});db[_0xb642('0x1cc')][_0xb642('0x101')](db['SmsAccount'],{'foreignKey':_0xb642('0x1cf'),'as':_0xb642('0x1c0')});db[_0xb642('0xf0')]['hasMany'](db['Disposition'],{'as':_0xb642('0x146'),'foreignKey':_0xb642('0x14b')});db['CmList'][_0xb642('0xf9')](db[_0xb642('0x75')],{'as':'CustomFields','foreignKey':_0xb642('0x14b')});db['CmList'][_0xb642('0xf9')](db[_0xb642('0x6e')],{'as':_0xb642('0x106'),'onDelete':'cascade','foreignKey':_0xb642('0x14b')});db[_0xb642('0xf0')]['hasMany'](db[_0xb642('0x72')],{'as':_0xb642('0xfd'),'foreignKey':_0xb642('0x14b')});db[_0xb642('0xf0')][_0xb642('0xf9')](db[_0xb642('0xfe')],{'as':_0xb642('0xff'),'foreignKey':_0xb642('0x14b')});db[_0xb642('0xf0')][_0xb642('0xf9')](db[_0xb642('0x74')],{'as':_0xb642('0x74'),'foreignKey':_0xb642('0x14b')});db[_0xb642('0xf0')][_0xb642('0x103')](db[_0xb642('0x1d')],{'as':_0xb642('0x1d0'),'through':'voice_queues_has_cm_lists'});db[_0xb642('0xf0')]['belongsToMany'](db[_0xb642('0x14')],{'as':_0xb642('0x135'),'through':'cm_user_has_lists'});db['VoicePrefix'][_0xb642('0xf9')](db['VoiceExtension'],{'as':_0xb642('0xfc'),'onDelete':'restrict'});db[_0xb642('0xf2')][_0xb642('0x103')](db['User'],{'as':_0xb642('0x135'),'through':_0xb642('0x1d1')});db[_0xb642('0xf4')][_0xb642('0xf9')](db[_0xb642('0x14')],{'as':'Users','foreignKey':_0xb642('0x102')});db[_0xb642('0xf4')][_0xb642('0xf9')](db[_0xb642('0x1d2')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0xb642('0xf7')});db[_0xb642('0x1d2')][_0xb642('0xf9')](db[_0xb642('0xf5')],{'as':_0xb642('0x1d3'),'foreignKey':_0xb642('0x1d4'),'onDelete':_0xb642('0xf7')});module[_0xb642('0x1d5')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x741b=['FromFaxAccountId','ToAgent','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','Resources','sectionId','exports','path','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','database','options','username','password','User','import','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceQueue','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.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','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','Disposition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserId','VoiceRecording','Recordings','hasMany','VoiceQueuesRt','Extensions','cascade','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteraction','OpenchannelInteractions','ChatInteraction','ChatInteractions','MailInteractions','userProfileId','belongsToMany','chat_group_has_users','cm_user_has_contacts','CmList','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteraction','FaxInteractions','SmsInteraction','user_has_openchannel_interactions','VoiceQueues','ChatQueues','FaxQueues','UserFaxQueue','SmsQueue','SmsQueues','UserSmsQueue','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','VoiceContext','Applications','Sounds','Members','VoiceQueueId','Hoppers','HopperHistories','belongsTo','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceAgentReport','Contact','ContactId','MailAccountId','hasOne','Imap','Dispositions','CannedAnswer','Answers','MailMessage','Interactions','List','ListId','Template','TemplateId','mandatoryDispositionPauseId','Account','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','restrict','TagId','Items','FaxAccountId','FaxApplication','Exntensions','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','sms_interaction_has_tags','user_has_sms_interactions','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','Owner','openchannel_interaction_has_tags','OpenchannelInteractionId','ChatWebsiteId','ProactiveActions','Agent','ChatQueueId','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','Website','JscriptySessions','SmsInteractions','cm_contact_has_tags','Queue','Campaign','CampaignId','OwnerId','Condition','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','AutomationId','ChatApplications','FaxApplications','SmsApplications','Schedule','CustomReportId','VoiceMusicOnHold','Mohs','Trigger','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','AnalyticFieldReport','Fields','DefaultReportId','MetricId','AnalyticMetric','Configurations','AccountId','Subjects','SubjectId','SalesforceField','DescriptionId','FieldId','Description','Field','VariableId','Descriptions','DeskAccount','Subject','ZohoAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','ServicenowConfiguration','SessionId','ProjectId','MailQueues','team_has_openchannel_queues','OpenchannelQueues','HopperBlacks','TrunkBackup','Lists','FromAccount','FromAgent','ToUserId','ToMailQueueId','FromChatWebsiteId','FromUserId','ToChatQueueId','ToQueue','ToAccount'];(function(_0x4d4691,_0x5d22b4){var _0x3db5aa=function(_0x4aa654){while(--_0x4aa654){_0x4d4691['push'](_0x4d4691['shift']());}};_0x3db5aa(++_0x5d22b4);}(_0x741b,0x1d3));var _0xb741=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x741b[_0x1ac595];return _0x455fff;};'use strict';var path=require(_0xb741('0x0'));var config=require(_0xb741('0x1'));var Sequelize=require(_0xb741('0x2'));var _=require(_0xb741('0x3'));var jstz=require(_0xb741('0x4'));var timezone=jstz['determine']();config[_0xb741('0x2')]=_[_0xb741('0x5')](config[_0xb741('0x2')],{'database':_0xb741('0x6'),'username':_0xb741('0x7'),'password':_0xb741('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xb741('0x9'),'dialectOptions':{'charset':_0xb741('0xa')},'logging':![],'timezone':timezone[_0xb741('0xb')](),'define':{'charset':_0xb741('0xc'),'collate':_0xb741('0xd')}}});config['sequelizeHistory']=_[_0xb741('0x5')](config[_0xb741('0xe')],{'database':_0xb741('0x6'),'username':_0xb741('0x7'),'password':'xC@LL1234','options':{'host':_0xb741('0xf'),'port':0xcea,'dialect':_0xb741('0x9'),'dialectOptions':{'charset':_0xb741('0xa')},'logging':![],'timezone':timezone[_0xb741('0xb')](),'define':{'charset':'utf8','collate':_0xb741('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xb741('0x2')][_0xb741('0x10')],config[_0xb741('0x2')]['username'],config[_0xb741('0x2')]['password'],config['sequelize'][_0xb741('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xb741('0xe')]['database'],config[_0xb741('0xe')][_0xb741('0x12')],config[_0xb741('0xe')][_0xb741('0x13')],config[_0xb741('0xe')][_0xb741('0x11')])};db[_0xb741('0x14')]=db[_0xb741('0x2')][_0xb741('0x15')]('../api/user/user.model');db['VoiceChanSpy']=db[_0xb741('0x2')][_0xb741('0x15')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db['sequelize'][_0xb741('0x15')]('../api/voiceContext/voiceContext.model');db[_0xb741('0x16')]=db[_0xb741('0x2')]['import'](_0xb741('0x17'));db['VoiceMusicOnHold']=db[_0xb741('0x2')][_0xb741('0x15')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xb741('0x18')]=db[_0xb741('0x2')]['import']('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db['sequelize'][_0xb741('0x15')]('../api/voiceRecording/voiceRecording.model');db[_0xb741('0x19')]=db['sequelize'][_0xb741('0x15')](_0xb741('0x1a'));db[_0xb741('0x1b')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x1c'));db['VoiceMailMessage']=db[_0xb741('0x2')][_0xb741('0x15')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xb741('0x1d')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x1e'));db[_0xb741('0x1f')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x20'));db['VoiceAgentReport']=db[_0xb741('0x2')]['import'](_0xb741('0x21'));db[_0xb741('0x22')]=db[_0xb741('0x2')]['import'](_0xb741('0x23'));db[_0xb741('0x24')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x25'));db[_0xb741('0x26')]=db['sequelize'][_0xb741('0x15')](_0xb741('0x27'));db['VoiceTransferReport']=db[_0xb741('0x2')][_0xb741('0x15')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0xb741('0x28')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x29'));db[_0xb741('0x2a')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x2b'));db[_0xb741('0x2c')]=db['sequelize'][_0xb741('0x15')](_0xb741('0x2d'));db[_0xb741('0x2e')]=db['sequelize'][_0xb741('0x15')](_0xb741('0x2f'));db['UserFaxQueue']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x30'));db['UserSmsQueue']=db[_0xb741('0x2')]['import'](_0xb741('0x31'));db[_0xb741('0x32')]=db[_0xb741('0x2')]['import'](_0xb741('0x33'));db[_0xb741('0x34')]=db['sequelize'][_0xb741('0x15')]('../api/mailServerIn/mailServerIn.model');db[_0xb741('0x35')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x36'));db[_0xb741('0x37')]=db['sequelize'][_0xb741('0x15')]('../api/mailAccount/mailAccount.model');db[_0xb741('0x38')]=db['sequelize'][_0xb741('0x15')](_0xb741('0x39'));db['MailSubstatus']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x3a'));db[_0xb741('0x3b')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x3c'));db['MailMessage']=db[_0xb741('0x2')]['import'](_0xb741('0x3d'));db[_0xb741('0x3e')]=db['sequelize'][_0xb741('0x15')](_0xb741('0x3f'));db[_0xb741('0x40')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x41'));db[_0xb741('0x42')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x43'));db[_0xb741('0x44')]=db['sequelize'][_0xb741('0x15')](_0xb741('0x45'));db[_0xb741('0x46')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x47'));db['FaxApplication']=db[_0xb741('0x2')][_0xb741('0x15')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x48'));db[_0xb741('0x49')]=db['sequelize'][_0xb741('0x15')]('../api/faxMessage/faxMessage.model');db[_0xb741('0x4a')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x4b'));db[_0xb741('0x4c')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x4d'));db[_0xb741('0x4e')]=db['sequelize'][_0xb741('0x15')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0xb741('0x2')][_0xb741('0x15')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x4f'));db[_0xb741('0x50')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x51'));db['SmsQueue']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x52'));db[_0xb741('0x53')]=db[_0xb741('0x2')][_0xb741('0x15')]('../api/openchannelAccount/openchannelAccount.model');db[_0xb741('0x54')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x55'));db['OpenchannelInteraction']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x56'));db[_0xb741('0x57')]=db[_0xb741('0x2')][_0xb741('0x15')]('../api/openchannelMessage/openchannelMessage.model');db[_0xb741('0x58')]=db['sequelize'][_0xb741('0x15')](_0xb741('0x59'));db['ChatWebsite']=db[_0xb741('0x2')][_0xb741('0x15')]('../api/chatWebsite/chatWebsite.model');db[_0xb741('0x5a')]=db[_0xb741('0x2')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xb741('0x5b')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x5c'));db['ChatInteraction']=db[_0xb741('0x2')]['import'](_0xb741('0x5d'));db[_0xb741('0x5e')]=db[_0xb741('0x2')]['import'](_0xb741('0x5f'));db[_0xb741('0x60')]=db[_0xb741('0x2')]['import'](_0xb741('0x61'));db[_0xb741('0x62')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x63'));db[_0xb741('0x64')]=db[_0xb741('0x2')]['import']('../api/chatGroup/chatGroup.model');db[_0xb741('0x65')]=db['sequelize']['import'](_0xb741('0x66'));db[_0xb741('0x67')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x68'));db[_0xb741('0x69')]=db[_0xb741('0x2')]['import'](_0xb741('0x6a'));db[_0xb741('0x6b')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x6c'));db[_0xb741('0x6d')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x6e'));db[_0xb741('0x6f')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x70'));db[_0xb741('0x71')]=db[_0xb741('0x2')]['import'](_0xb741('0x72'));db['ReportAgentPreview']=db[_0xb741('0x2')]['import'](_0xb741('0x73'));db['CmCustomField']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x74'));db[_0xb741('0x75')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x76'));db[_0xb741('0x77')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x78'));db['CannedAnswer']=db['sequelize'][_0xb741('0x15')]('../api/cannedAnswer/cannedAnswer.model');db[_0xb741('0x79')]=db[_0xb741('0x2')][_0xb741('0x15')]('../api/disposition/disposition.model');db['Condition']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x7a'));db[_0xb741('0x7b')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x7c'));db[_0xb741('0x7d')]=db[_0xb741('0x2')]['import'](_0xb741('0x7e'));db['Cdr']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x7f'));db['VoiceQueuesLog']=db['sequelize']['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x80'));db[_0xb741('0x81')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x82'));db[_0xb741('0x83')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x84'));db['Template']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x85'));db['Trigger']=db[_0xb741('0x2')]['import'](_0xb741('0x86'));db[_0xb741('0x87')]=db['sequelize']['import'](_0xb741('0x88'));db[_0xb741('0x89')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x8a'));db['IntegrationReport']=db[_0xb741('0x2')]['import'](_0xb741('0x8b'));db[_0xb741('0x8c')]=db['sequelize'][_0xb741('0x15')](_0xb741('0x8d'));db[_0xb741('0x8e')]=db[_0xb741('0x2')][_0xb741('0x15')]('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db['sequelize'][_0xb741('0x15')](_0xb741('0x8f'));db['AnalyticMetric']=db['sequelize'][_0xb741('0x15')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x90'));db['AnalyticTreeReport']=db['sequelize'][_0xb741('0x15')](_0xb741('0x91'));db[_0xb741('0x92')]=db['sequelize'][_0xb741('0x15')](_0xb741('0x93'));db[_0xb741('0x94')]=db[_0xb741('0x2')][_0xb741('0x15')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0xb741('0x2')][_0xb741('0x15')]('../api/intSalesforceField/intSalesforceField.model');db[_0xb741('0x95')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x96'));db[_0xb741('0x97')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x98'));db[_0xb741('0x99')]=db[_0xb741('0x2')]['import'](_0xb741('0x9a'));db['DeskAccount']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x9b'));db[_0xb741('0x9c')]=db['sequelize']['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xb741('0x9d')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x9e'));db['ZohoAccount']=db[_0xb741('0x2')]['import']('../api/intZohoAccount/intZohoAccount.model');db[_0xb741('0x9f')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xa0'));db[_0xb741('0xa1')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xa2'));db[_0xb741('0xa3')]=db[_0xb741('0x2')]['import'](_0xb741('0xa4'));db['ZendeskConfiguration']=db['sequelize'][_0xb741('0x15')](_0xb741('0xa5'));db[_0xb741('0xa6')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xa7'));db[_0xb741('0xa8')]=db['sequelize'][_0xb741('0x15')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xb741('0xa9')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xaa'));db[_0xb741('0xab')]=db[_0xb741('0x2')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0xb741('0xac')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xad'));db[_0xb741('0xae')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xaf'));db['VtigerField']=db[_0xb741('0x2')][_0xb741('0x15')]('../api/intVtigerField/intVtigerField.model');db[_0xb741('0xb0')]=db['sequelize'][_0xb741('0x15')](_0xb741('0xb1'));db['ServicenowConfiguration']=db[_0xb741('0x2')][_0xb741('0x15')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xb741('0xb2')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xb3'));db[_0xb741('0xb4')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xb5'));db[_0xb741('0xb6')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xb7'));db[_0xb741('0xb8')]=db['sequelize'][_0xb741('0x15')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xb741('0xb9')]=db[_0xb741('0x2')]['import'](_0xb741('0xba'));db[_0xb741('0xbb')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xbc'));db[_0xb741('0xbd')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xbe'));db[_0xb741('0x89')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0x8a'));db['Network']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xbf'));db[_0xb741('0xc0')]=db[_0xb741('0x2')][_0xb741('0x15')]('../api/chatQueueReport/chatQueueReport.model');db[_0xb741('0xc1')]=db[_0xb741('0x2')]['import'](_0xb741('0xc2'));db[_0xb741('0xc3')]=db['sequelize']['import'](_0xb741('0xc4'));db[_0xb741('0xc5')]=db['sequelize'][_0xb741('0x15')](_0xb741('0xc6'));db[_0xb741('0xc7')]=db[_0xb741('0x2')][_0xb741('0x15')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xb741('0xc8')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xc9'));db['SquareReport']=db['sequelize'][_0xb741('0x15')](_0xb741('0xca'));db['SquareDetailsReport']=db[_0xb741('0x2')]['import'](_0xb741('0xcb'));db[_0xb741('0xcc')]=db['sequelize'][_0xb741('0x15')](_0xb741('0xcd'));db[_0xb741('0xce')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xcf'));db[_0xb741('0xd0')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xd1'));db[_0xb741('0xd2')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xd3'));db[_0xb741('0xd4')]=db[_0xb741('0x2')]['import'](_0xb741('0xd5'));db['SquareMessage']=db['sequelize'][_0xb741('0x15')](_0xb741('0xd6'));db[_0xb741('0xd7')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xd8'));db[_0xb741('0xd9')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xda'));db['Campaign']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xdb'));db['Migration']=db[_0xb741('0x2')]['import'](_0xb741('0xdc'));db[_0xb741('0xdd')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xde'));db[_0xb741('0xdf')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xe0'));db[_0xb741('0xe1')]=db[_0xb741('0x2')][_0xb741('0x15')]('../api/mailTransferReport/mailTransferReport.model');db[_0xb741('0xe2')]=db[_0xb741('0x2')][_0xb741('0x15')]('../api/chatTransferReport/chatTransferReport.model');db[_0xb741('0xe3')]=db[_0xb741('0x2')][_0xb741('0x15')]('../api/faxTransferReport/faxTransferReport.model');db[_0xb741('0xe4')]=db[_0xb741('0x2')][_0xb741('0x15')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xb741('0xe5')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xe6'));db['CmList']=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xe7'));db[_0xb741('0xe8')]=db[_0xb741('0x2')][_0xb741('0x15')]('../api/voicePrefix/voicePrefix.model');db[_0xb741('0xe9')]=db[_0xb741('0x2')][_0xb741('0x15')]('../api/userProfile/userProfile.model');db[_0xb741('0xea')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xeb'));db[_0xb741('0xec')]=db[_0xb741('0x2')][_0xb741('0x15')](_0xb741('0xed'));db[_0xb741('0x14')]['hasOne'](db[_0xb741('0x1b')],{'as':_0xb741('0x1b'),'onDelete':'cascade','foreignKey':_0xb741('0xee')});db[_0xb741('0x14')]['hasMany'](db[_0xb741('0xef')],{'as':_0xb741('0xf0'),'foreignKey':_0xb741('0xee')});db['User'][_0xb741('0xf1')](db[_0xb741('0x28')],{'as':_0xb741('0xf2'),'foreignKey':_0xb741('0xee')});db[_0xb741('0x14')][_0xb741('0xf1')](db[_0xb741('0x16')],{'as':_0xb741('0xf3'),'onDelete':_0xb741('0xf4'),'hooks':!![]});db['User'][_0xb741('0xf1')](db[_0xb741('0x6f')],{'as':_0xb741('0xf5'),'foreignKey':_0xb741('0xee')});db['User'][_0xb741('0xf1')](db[_0xb741('0x71')],{'as':_0xb741('0xf6'),'foreignKey':_0xb741('0xee')});db['User']['hasMany'](db[_0xb741('0xf7')],{'as':_0xb741('0xf7'),'foreignKey':_0xb741('0xee')});db[_0xb741('0x14')][_0xb741('0xf1')](db[_0xb741('0xf8')],{'as':_0xb741('0xf9'),'foreignKey':_0xb741('0xee')});db['User'][_0xb741('0xf1')](db[_0xb741('0xfa')],{'as':_0xb741('0xfb'),'foreignKey':_0xb741('0xee')});db[_0xb741('0x14')][_0xb741('0xf1')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xb741('0xee')});db[_0xb741('0x14')][_0xb741('0xf1')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0xb741('0xee')});db[_0xb741('0x14')]['hasMany'](db[_0xb741('0x3b')],{'as':_0xb741('0xfc'),'foreignKey':'UserId'});db[_0xb741('0x14')]['belongsTo'](db['UserProfile'],{'as':_0xb741('0xe9'),'foreignKey':_0xb741('0xfd')});db['User'][_0xb741('0xfe')](db[_0xb741('0x64')],{'as':'Groups','through':_0xb741('0xff')});db[_0xb741('0x14')][_0xb741('0xfe')](db[_0xb741('0x69')],{'as':'Contacts','through':_0xb741('0x100')});db[_0xb741('0x14')][_0xb741('0xfe')](db[_0xb741('0x101')],{'as':'Lists','through':_0xb741('0x102')});db[_0xb741('0x14')]['belongsToMany'](db[_0xb741('0xd7')],{'through':_0xb741('0x103')});db['User']['belongsToMany'](db['MailInteraction'],{'as':_0xb741('0xfc'),'through':_0xb741('0x104')});db[_0xb741('0x14')][_0xb741('0xfe')](db['ChatInteraction'],{'as':_0xb741('0xfb'),'through':_0xb741('0x105')});db[_0xb741('0x14')][_0xb741('0xfe')](db[_0xb741('0x106')],{'as':_0xb741('0x107'),'through':'user_has_fax_interactions'});db[_0xb741('0x14')]['belongsToMany'](db[_0xb741('0x108')],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db[_0xb741('0x14')][_0xb741('0xfe')](db[_0xb741('0xf8')],{'as':'OpenchannelInteractions','through':_0xb741('0x109')});db[_0xb741('0x14')][_0xb741('0xfe')](db[_0xb741('0x18')],{'as':_0xb741('0x10a'),'through':_0xb741('0x2a'),'required':![]});db[_0xb741('0x14')][_0xb741('0xfe')](db[_0xb741('0x38')],{'as':'MailQueues','through':_0xb741('0x2e'),'required':![]});db['User'][_0xb741('0xfe')](db[_0xb741('0x62')],{'as':_0xb741('0x10b'),'through':_0xb741('0x2c'),'required':![],'hooks':!![]});db[_0xb741('0x14')][_0xb741('0xfe')](db[_0xb741('0x4a')],{'as':_0xb741('0x10c'),'through':_0xb741('0x10d'),'required':![]});db[_0xb741('0x14')][_0xb741('0xfe')](db[_0xb741('0x10e')],{'as':_0xb741('0x10f'),'through':_0xb741('0x110'),'required':![]});db[_0xb741('0x14')][_0xb741('0xfe')](db[_0xb741('0x58')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db['User'][_0xb741('0xfe')](db['CmList'],{'through':_0xb741('0x102')});db[_0xb741('0x14')][_0xb741('0xfe')](db[_0xb741('0xe8')],{'as':_0xb741('0x111'),'through':_0xb741('0x112'),'required':![]});db[_0xb741('0x14')][_0xb741('0xfe')](db[_0xb741('0x113')],{'as':_0xb741('0x114'),'through':'user_has_chat_websites'});db[_0xb741('0x14')]['belongsToMany'](db['FaxAccount'],{'as':_0xb741('0x115'),'through':'user_has_fax_accounts'});db[_0xb741('0x14')][_0xb741('0xfe')](db['MailAccount'],{'as':_0xb741('0x116'),'through':_0xb741('0x117')});db[_0xb741('0x14')][_0xb741('0xfe')](db[_0xb741('0x53')],{'as':_0xb741('0x118'),'through':_0xb741('0x119')});db[_0xb741('0x14')]['belongsToMany'](db['SmsAccount'],{'as':_0xb741('0x11a'),'through':_0xb741('0x11b')});db['User'][_0xb741('0xfe')](db[_0xb741('0xd2')],{'as':_0xb741('0x11c'),'through':_0xb741('0x11d')});db[_0xb741('0x11e')]['hasMany'](db[_0xb741('0x16')],{'as':_0xb741('0x11f'),'onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x120')});db[_0xb741('0x121')][_0xb741('0xf1')](db[_0xb741('0x16')],{'onDelete':_0xb741('0xf4')});db['VoiceExtension'][_0xb741('0xf1')](db[_0xb741('0x16')],{'as':_0xb741('0x122'),'onDelete':_0xb741('0xf4')});db['VoiceMusicOnHold']['belongsToMany'](db[_0xb741('0x81')],{'as':_0xb741('0x123'),'through':'moh_has_sounds'});db[_0xb741('0x18')][_0xb741('0xf1')](db['UserVoiceQueueRt'],{'as':_0xb741('0x124'),'foreignKey':_0xb741('0x125')});db[_0xb741('0x18')][_0xb741('0xf1')](db[_0xb741('0x6b')],{'as':_0xb741('0x126'),'foreignKey':_0xb741('0x125')});db[_0xb741('0x18')][_0xb741('0xf1')](db[_0xb741('0x6f')],{'as':_0xb741('0xf5'),'foreignKey':'VoiceQueueId'});db[_0xb741('0x18')][_0xb741('0xf1')](db['CmHopperHistory'],{'as':_0xb741('0x127'),'foreignKey':_0xb741('0x125')});db[_0xb741('0x18')]['hasMany'](db[_0xb741('0xf7')],{'as':_0xb741('0xf7'),'foreignKey':_0xb741('0x125')});db[_0xb741('0x18')]['hasMany'](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xb741('0xf1')](db[_0xb741('0xc7')],{'as':'JscriptySessions','foreignKey':_0xb741('0x125')});db[_0xb741('0x18')][_0xb741('0x128')](db['Trunk'],{'as':'Trunk','foreignKey':_0xb741('0x129')});db[_0xb741('0x18')][_0xb741('0x128')](db['Trunk'],{'as':'TrunkBackup','foreignKey':_0xb741('0x12a')});db[_0xb741('0x18')][_0xb741('0x128')](db['Interval'],{'as':_0xb741('0x7b'),'foreignKey':_0xb741('0x12b')});db[_0xb741('0x18')]['belongsTo'](db[_0xb741('0x7d')],{'as':_0xb741('0x12c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xb741('0x18')][_0xb741('0xfe')](db[_0xb741('0x101')],{'as':'Lists','through':_0xb741('0x12d')});db[_0xb741('0x18')]['belongsToMany'](db[_0xb741('0x14')],{'as':_0xb741('0x12e'),'through':_0xb741('0x2a')});db[_0xb741('0x18')][_0xb741('0xfe')](db[_0xb741('0xd7')],{'as':_0xb741('0x12f'),'through':_0xb741('0x130')});db[_0xb741('0x18')][_0xb741('0xfe')](db[_0xb741('0x101')],{'as':_0xb741('0x131'),'through':'voice_queues_has_cm_blacklists'});db[_0xb741('0xef')][_0xb741('0x128')](db[_0xb741('0x14')],{'as':_0xb741('0x14'),'foreignKey':'UserId'});db['ScreenRecording'][_0xb741('0x128')](db['User'],{'as':_0xb741('0x14'),'foreignKey':_0xb741('0xee')});db[_0xb741('0x1b')][_0xb741('0xf1')](db[_0xb741('0x132')],{'as':_0xb741('0x133'),'onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x134'),'sourceKey':_0xb741('0x135')});db[_0xb741('0x132')][_0xb741('0x128')](db[_0xb741('0x1b')],{'foreignKey':_0xb741('0x134'),'targetKey':_0xb741('0x135')});db[_0xb741('0x1d')]['hasMany'](db[_0xb741('0x22')],{'as':_0xb741('0x136'),'foreignKey':_0xb741('0x137'),'constraints':![]});db['VoiceCallReport'][_0xb741('0xf1')](db[_0xb741('0x138')],{'as':'AgentReports','foreignKey':_0xb741('0x137'),'constraints':![]});db[_0xb741('0x1d')][_0xb741('0x128')](db[_0xb741('0x14')],{'as':_0xb741('0x14'),'foreignKey':_0xb741('0xee')});db['VoiceCallReport'][_0xb741('0x128')](db['CmContact'],{'as':_0xb741('0x139'),'foreignKey':_0xb741('0x13a')});db['MailServerIn'][_0xb741('0x128')](db[_0xb741('0x37')],{'as':_0xb741('0x37'),'foreignKey':'MailAccountId'});db[_0xb741('0x35')][_0xb741('0x128')](db[_0xb741('0x37')],{'as':'MailAccount','foreignKey':_0xb741('0x13b')});db[_0xb741('0x37')][_0xb741('0x13c')](db[_0xb741('0x34')],{'as':_0xb741('0x13d'),'onDelete':_0xb741('0xf4')});db[_0xb741('0x37')][_0xb741('0x13c')](db[_0xb741('0x35')],{'as':'Smtp','onDelete':_0xb741('0xf4')});db[_0xb741('0x37')][_0xb741('0xf1')](db['Disposition'],{'as':_0xb741('0x13e'),'foreignKey':_0xb741('0x13b')});db[_0xb741('0x37')][_0xb741('0xf1')](db[_0xb741('0x13f')],{'as':_0xb741('0x140'),'foreignKey':_0xb741('0x13b')});db[_0xb741('0x37')][_0xb741('0xf1')](db[_0xb741('0x141')],{'as':_0xb741('0x133'),'foreignKey':_0xb741('0x13b')});db[_0xb741('0x37')][_0xb741('0xf1')](db[_0xb741('0x3b')],{'as':_0xb741('0x142')});db[_0xb741('0x37')][_0xb741('0xf1')](db['MailApplication'],{'as':_0xb741('0x122')});db[_0xb741('0x37')][_0xb741('0x128')](db[_0xb741('0x101')],{'as':_0xb741('0x143'),'foreignKey':_0xb741('0x144')});db[_0xb741('0x37')][_0xb741('0x128')](db[_0xb741('0x145')],{'as':_0xb741('0x145'),'foreignKey':_0xb741('0x146')});db['MailAccount'][_0xb741('0x128')](db[_0xb741('0x7d')],{'as':_0xb741('0x12c'),'foreignKey':_0xb741('0x147')});db[_0xb741('0x37')][_0xb741('0xfe')](db['User'],{'as':_0xb741('0x12e'),'through':'user_has_mail_accounts'});db[_0xb741('0x38')][_0xb741('0xfe')](db[_0xb741('0x14')],{'as':_0xb741('0x12e'),'through':_0xb741('0x2e')});db[_0xb741('0x38')][_0xb741('0xfe')](db['Team'],{'through':'team_has_mail_queues','as':_0xb741('0x12f')});db[_0xb741('0x3b')][_0xb741('0xf1')](db[_0xb741('0x141')],{'as':'Messages','onDelete':_0xb741('0xf4'),'foreignKey':'MailInteractionId'});db[_0xb741('0x3b')][_0xb741('0x128')](db[_0xb741('0x37')],{'as':_0xb741('0x148'),'foreignKey':_0xb741('0x13b')});db['MailInteraction'][_0xb741('0x128')](db[_0xb741('0x69')],{'as':'Contact','foreignKey':_0xb741('0x13a')});db[_0xb741('0x3b')][_0xb741('0x128')](db[_0xb741('0x14')],{'as':'Owner','foreignKey':_0xb741('0xee')});db[_0xb741('0x3b')]['belongsToMany'](db[_0xb741('0x83')],{'through':_0xb741('0x149'),'as':_0xb741('0x14a')});db[_0xb741('0x3b')]['belongsToMany'](db[_0xb741('0x83')],{'through':_0xb741('0x149'),'as':_0xb741('0x14b')});db[_0xb741('0x3b')][_0xb741('0xfe')](db[_0xb741('0x14')],{'as':_0xb741('0x14c'),'through':_0xb741('0x104'),'foreignKey':_0xb741('0x14d')});db['MailMessage'][_0xb741('0xf1')](db[_0xb741('0xdd')],{'as':_0xb741('0x14e'),'onDelete':_0xb741('0xf4')});db[_0xb741('0x141')][_0xb741('0x128')](db[_0xb741('0x14')],{'as':_0xb741('0x14')});db[_0xb741('0x141')][_0xb741('0x128')](db['CmContact'],{'onDelete':_0xb741('0xf4'),'as':'Contact'});db[_0xb741('0x141')]['belongsTo'](db['MailInteraction'],{'as':_0xb741('0x14f'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0xb741('0x128')](db['MailAccount'],{'as':_0xb741('0x148'),'foreignKey':'MailAccountId'});db[_0xb741('0x3e')]['belongsTo'](db['User'],{'onDelete':_0xb741('0x150')});db[_0xb741('0x3e')][_0xb741('0x128')](db[_0xb741('0x38')],{'onDelete':_0xb741('0x150')});db[_0xb741('0x3e')][_0xb741('0x128')](db[_0xb741('0x37')],{'onDelete':_0xb741('0x150')});db[_0xb741('0x3e')]['belongsTo'](db[_0xb741('0x7b')],{'onDelete':'restrict','foreignKey':_0xb741('0x12b')});db[_0xb741('0x3e')][_0xb741('0x128')](db[_0xb741('0x83')],{'onDelete':_0xb741('0x150'),'foreignKey':_0xb741('0x151')});db['MailQueueReport']['belongsTo'](db[_0xb741('0x37')],{});db['MailQueueReport']['belongsTo'](db[_0xb741('0x101')],{'as':_0xb741('0x143'),'foreignKey':_0xb741('0x144')});db[_0xb741('0x40')][_0xb741('0x128')](db[_0xb741('0x69')],{'as':_0xb741('0x139'),'foreignKey':_0xb741('0x13a')});db['MailQueueReport']['belongsTo'](db['MailInteraction'],{});db[_0xb741('0x40')][_0xb741('0x128')](db[_0xb741('0x141')],{});db['MailQueueReport'][_0xb741('0x128')](db[_0xb741('0x14')],{});db[_0xb741('0x40')]['belongsTo'](db[_0xb741('0x38')],{});db[_0xb741('0x42')][_0xb741('0xf1')](db['DashboardItem'],{'as':_0xb741('0x152'),'onDelete':_0xb741('0xf4')});db[_0xb741('0x46')][_0xb741('0xf1')](db['Disposition'],{'as':_0xb741('0x13e'),'foreignKey':_0xb741('0x153')});db[_0xb741('0x46')][_0xb741('0xf1')](db[_0xb741('0x13f')],{'as':'Answers','foreignKey':_0xb741('0x153')});db['FaxAccount'][_0xb741('0xf1')](db[_0xb741('0x106')],{'as':_0xb741('0x142')});db[_0xb741('0x46')]['hasMany'](db[_0xb741('0x154')],{'as':_0xb741('0x122')});db['FaxAccount'][_0xb741('0xf1')](db[_0xb741('0x16')],{'as':_0xb741('0x155'),'onDelete':_0xb741('0xf4')});db[_0xb741('0x46')][_0xb741('0xf1')](db[_0xb741('0x49')],{'as':_0xb741('0x133')});db[_0xb741('0x46')][_0xb741('0x128')](db[_0xb741('0x26')],{'as':'Trunk'});db[_0xb741('0x46')][_0xb741('0x128')](db[_0xb741('0x101')],{'as':_0xb741('0x143'),'foreignKey':'ListId'});db[_0xb741('0x46')]['belongsTo'](db[_0xb741('0x7d')],{'as':_0xb741('0x12c'),'foreignKey':_0xb741('0x147')});db['FaxAccount']['belongsToMany'](db['User'],{'as':'Agents','through':_0xb741('0x156')});db[_0xb741('0x154')]['belongsTo'](db[_0xb741('0x14')],{'onDelete':_0xb741('0x150')});db['FaxApplication'][_0xb741('0x128')](db['FaxQueue'],{'onDelete':_0xb741('0x150')});db[_0xb741('0x154')][_0xb741('0x128')](db[_0xb741('0x46')],{'onDelete':_0xb741('0x150')});db[_0xb741('0x154')][_0xb741('0x128')](db[_0xb741('0x83')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xb741('0x106')]['hasMany'](db[_0xb741('0x49')],{'as':_0xb741('0x133'),'onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x157')});db['FaxInteraction']['belongsTo'](db[_0xb741('0x46')],{'as':_0xb741('0x148'),'foreignKey':_0xb741('0x153')});db[_0xb741('0x106')][_0xb741('0x128')](db[_0xb741('0x69')],{'as':'Contact','foreignKey':_0xb741('0x13a')});db['FaxInteraction'][_0xb741('0x128')](db['User'],{'as':'Owner','foreignKey':_0xb741('0xee')});db[_0xb741('0x106')][_0xb741('0xfe')](db[_0xb741('0x83')],{'through':_0xb741('0x158'),'as':_0xb741('0x14a')});db['FaxInteraction'][_0xb741('0xfe')](db[_0xb741('0x83')],{'through':_0xb741('0x158'),'as':_0xb741('0x14b')});db['FaxInteraction'][_0xb741('0xfe')](db[_0xb741('0x14')],{'as':_0xb741('0x14c'),'through':_0xb741('0x159'),'foreignKey':_0xb741('0x157')});db['FaxMessage']['belongsTo'](db[_0xb741('0x14')],{'onDelete':'cascade','as':'User'});db['FaxMessage'][_0xb741('0x128')](db['FaxInteraction'],{'as':_0xb741('0x14f'),'foreignKey':_0xb741('0x157')});db[_0xb741('0x49')][_0xb741('0x128')](db[_0xb741('0x69')],{'onDelete':_0xb741('0xf4'),'as':_0xb741('0x139')});db['FaxMessage']['belongsTo'](db[_0xb741('0xdd')],{'as':_0xb741('0xdd'),'foreignKey':_0xb741('0x15a')});db[_0xb741('0x49')][_0xb741('0x128')](db[_0xb741('0x46')],{'as':'Account','foreignKey':_0xb741('0x153')});db[_0xb741('0x4a')][_0xb741('0xfe')](db[_0xb741('0x14')],{'as':_0xb741('0x12e'),'through':_0xb741('0x10d')});db['FaxQueue'][_0xb741('0xfe')](db[_0xb741('0xd7')],{'through':_0xb741('0x15b'),'as':_0xb741('0x12f')});db[_0xb741('0x4c')][_0xb741('0x128')](db[_0xb741('0x46')],{});db[_0xb741('0x4c')]['belongsTo'](db[_0xb741('0x101')],{'as':_0xb741('0x143'),'foreignKey':_0xb741('0x144')});db[_0xb741('0x4c')][_0xb741('0x128')](db[_0xb741('0x69')],{'as':_0xb741('0x139'),'foreignKey':_0xb741('0x13a')});db[_0xb741('0x4c')][_0xb741('0x128')](db[_0xb741('0x106')],{});db[_0xb741('0x4c')][_0xb741('0x128')](db[_0xb741('0x49')],{});db[_0xb741('0x4c')][_0xb741('0x128')](db[_0xb741('0x14')],{});db['FaxQueueReport'][_0xb741('0x128')](db['FaxQueue'],{});db[_0xb741('0x4e')]['hasMany'](db[_0xb741('0x79')],{'as':_0xb741('0x13e'),'foreignKey':_0xb741('0x15c')});db['SmsAccount'][_0xb741('0xf1')](db[_0xb741('0x13f')],{'as':_0xb741('0x140'),'foreignKey':_0xb741('0x15c')});db[_0xb741('0x4e')][_0xb741('0xf1')](db[_0xb741('0x50')],{'as':_0xb741('0x133'),'foreignKey':_0xb741('0x15c')});db[_0xb741('0x4e')]['hasMany'](db[_0xb741('0x108')],{'as':_0xb741('0x142')});db[_0xb741('0x4e')][_0xb741('0xf1')](db[_0xb741('0x15d')],{'as':_0xb741('0x122')});db[_0xb741('0x4e')]['belongsTo'](db[_0xb741('0x101')],{'as':_0xb741('0x143'),'foreignKey':_0xb741('0x144')});db[_0xb741('0x4e')][_0xb741('0x128')](db[_0xb741('0x7d')],{'as':_0xb741('0x12c'),'foreignKey':_0xb741('0x147')});db[_0xb741('0x4e')]['belongsToMany'](db[_0xb741('0x14')],{'as':_0xb741('0x12e'),'through':'user_has_sms_accounts'});db[_0xb741('0x15d')]['belongsTo'](db[_0xb741('0x14')],{'onDelete':_0xb741('0x150')});db[_0xb741('0x15d')]['belongsTo'](db['SmsQueue'],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db['SmsAccount'],{'onDelete':'restrict'});db[_0xb741('0x15d')]['belongsTo'](db[_0xb741('0x7b')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xb741('0x15d')][_0xb741('0x128')](db[_0xb741('0x83')],{'onDelete':_0xb741('0x150'),'foreignKey':'TagId'});db['SmsInteraction'][_0xb741('0xf1')](db[_0xb741('0x50')],{'as':_0xb741('0x133'),'onDelete':_0xb741('0xf4'),'foreignKey':'SmsInteractionId'});db[_0xb741('0x108')][_0xb741('0x128')](db[_0xb741('0x4e')],{'as':_0xb741('0x148'),'foreignKey':_0xb741('0x15c')});db[_0xb741('0x108')][_0xb741('0x128')](db['CmContact'],{'as':_0xb741('0x139'),'foreignKey':_0xb741('0x13a')});db[_0xb741('0x108')][_0xb741('0x128')](db[_0xb741('0x14')],{'as':'Owner','foreignKey':_0xb741('0xee')});db[_0xb741('0x108')][_0xb741('0xfe')](db[_0xb741('0x83')],{'through':_0xb741('0x15e'),'as':'Tags'});db[_0xb741('0x108')][_0xb741('0xfe')](db[_0xb741('0x83')],{'through':'sms_interaction_has_tags','as':_0xb741('0x14b')});db['SmsInteraction'][_0xb741('0xfe')](db[_0xb741('0x14')],{'as':_0xb741('0x14c'),'through':_0xb741('0x15f'),'foreignKey':_0xb741('0x160')});db[_0xb741('0x50')][_0xb741('0x128')](db[_0xb741('0x14')],{'as':_0xb741('0x14')});db[_0xb741('0x50')]['belongsTo'](db[_0xb741('0x69')],{'onDelete':_0xb741('0xf4'),'as':_0xb741('0x139')});db[_0xb741('0x50')][_0xb741('0x128')](db[_0xb741('0x108')],{'onDelete':_0xb741('0xf4'),'as':'Interaction','foreignKey':_0xb741('0x160')});db[_0xb741('0x50')][_0xb741('0x128')](db[_0xb741('0x4e')],{'as':_0xb741('0x148'),'foreignKey':'SmsAccountId'});db[_0xb741('0x10e')][_0xb741('0xfe')](db[_0xb741('0x14')],{'as':_0xb741('0x12e'),'through':_0xb741('0x110'),'foreignKey':'SmsQueueId'});db[_0xb741('0x10e')][_0xb741('0xfe')](db[_0xb741('0xd7')],{'through':_0xb741('0x161'),'as':_0xb741('0x12f')});db[_0xb741('0x53')][_0xb741('0xf1')](db[_0xb741('0x79')],{'as':_0xb741('0x13e'),'foreignKey':'OpenchannelAccountId'});db[_0xb741('0x53')]['hasMany'](db[_0xb741('0x13f')],{'as':_0xb741('0x140'),'foreignKey':'OpenchannelAccountId'});db[_0xb741('0x53')][_0xb741('0xf1')](db[_0xb741('0xf8')],{'as':_0xb741('0x142'),'foreignKey':_0xb741('0x162')});db[_0xb741('0x53')][_0xb741('0xf1')](db['OpenchannelMessage'],{'as':_0xb741('0x133'),'foreignKey':_0xb741('0x162')});db[_0xb741('0x53')][_0xb741('0xf1')](db[_0xb741('0x54')],{'as':_0xb741('0x122'),'foreignKey':'OpenchannelAccountId'});db[_0xb741('0x53')][_0xb741('0x128')](db[_0xb741('0x101')],{'as':_0xb741('0x143'),'foreignKey':_0xb741('0x144')});db[_0xb741('0x53')][_0xb741('0x128')](db[_0xb741('0x7d')],{'as':_0xb741('0x12c'),'foreignKey':_0xb741('0x147')});db[_0xb741('0x53')]['belongsToMany'](db[_0xb741('0x14')],{'as':_0xb741('0x12e'),'through':_0xb741('0x119')});db['OpenchannelApplication'][_0xb741('0x128')](db[_0xb741('0x14')],{'onDelete':_0xb741('0x150')});db[_0xb741('0x54')][_0xb741('0x128')](db[_0xb741('0x58')],{'onDelete':'restrict','foreignKey':_0xb741('0x163')});db[_0xb741('0x54')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0xb741('0x54')]['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0xb741('0x12b')});db[_0xb741('0x54')][_0xb741('0x128')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xb741('0x151')});db[_0xb741('0xf8')][_0xb741('0xf1')](db[_0xb741('0x57')],{'as':_0xb741('0x133'),'onDelete':_0xb741('0xf4'),'foreignKey':'OpenchannelInteractionId'});db[_0xb741('0xf8')][_0xb741('0x128')](db[_0xb741('0x53')],{'as':_0xb741('0x148'),'foreignKey':_0xb741('0x162')});db[_0xb741('0xf8')][_0xb741('0x128')](db[_0xb741('0x69')],{'as':_0xb741('0x139'),'foreignKey':_0xb741('0x13a')});db[_0xb741('0xf8')]['belongsTo'](db['User'],{'as':_0xb741('0x164'),'foreignKey':'UserId'});db[_0xb741('0xf8')][_0xb741('0xfe')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0xb741('0x14a')});db['OpenchannelInteraction'][_0xb741('0xfe')](db[_0xb741('0x83')],{'through':_0xb741('0x165'),'as':_0xb741('0x14b')});db[_0xb741('0xf8')][_0xb741('0xfe')](db['User'],{'as':_0xb741('0x14c'),'through':_0xb741('0x109'),'foreignKey':_0xb741('0x166')});db['OpenchannelMessage'][_0xb741('0x128')](db[_0xb741('0x14')],{'onDelete':'cascade','as':_0xb741('0x14')});db[_0xb741('0x57')]['belongsTo'](db[_0xb741('0x69')],{'onDelete':'cascade','as':_0xb741('0x139')});db[_0xb741('0x57')][_0xb741('0x128')](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0xb741('0x14f'),'foreignKey':_0xb741('0x166')});db[_0xb741('0x57')][_0xb741('0x128')](db[_0xb741('0xdd')],{'as':_0xb741('0xdd'),'foreignKey':_0xb741('0x15a')});db['OpenchannelMessage'][_0xb741('0x128')](db[_0xb741('0x53')],{'as':_0xb741('0x148'),'foreignKey':_0xb741('0x162')});db[_0xb741('0x58')][_0xb741('0xfe')](db[_0xb741('0x14')],{'as':_0xb741('0x12e'),'through':_0xb741('0x32'),'foreignKey':'OpenchannelQueueId'});db[_0xb741('0x58')][_0xb741('0xfe')](db[_0xb741('0xd7')],{'through':'team_has_openchannel_queues','as':'Teams'});db[_0xb741('0x113')][_0xb741('0xf1')](db[_0xb741('0x79')],{'as':_0xb741('0x13e'),'foreignKey':_0xb741('0x167')});db[_0xb741('0x113')][_0xb741('0xf1')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xb741('0x167')});db[_0xb741('0x113')][_0xb741('0xf1')](db['ChatProactiveAction'],{'as':_0xb741('0x168')});db[_0xb741('0x113')][_0xb741('0xf1')](db[_0xb741('0xfa')],{'as':_0xb741('0x142')});db['ChatWebsite']['hasMany'](db[_0xb741('0x5b')],{'as':_0xb741('0x122')});db[_0xb741('0x113')][_0xb741('0xf1')](db[_0xb741('0x5e')],{'as':'Messages'});db[_0xb741('0x113')][_0xb741('0x128')](db['CmList'],{'as':_0xb741('0x143'),'foreignKey':_0xb741('0x144')});db[_0xb741('0x113')][_0xb741('0x128')](db[_0xb741('0x7b')],{'as':'Interval','foreignKey':'IntervalId'});db[_0xb741('0x113')][_0xb741('0x128')](db['Pause'],{'as':_0xb741('0x12c'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0xb741('0xfe')](db[_0xb741('0x14')],{'as':'Agents','through':'user_has_chat_websites'});db[_0xb741('0x5a')][_0xb741('0x128')](db[_0xb741('0x53')],{});db[_0xb741('0x5a')][_0xb741('0x128')](db[_0xb741('0x101')],{'as':_0xb741('0x143'),'foreignKey':_0xb741('0x144')});db[_0xb741('0x5a')][_0xb741('0x128')](db['CmContact'],{'as':'Contact','foreignKey':_0xb741('0x13a')});db[_0xb741('0x5a')][_0xb741('0x128')](db['OpenchannelInteraction'],{});db[_0xb741('0x5a')][_0xb741('0x128')](db[_0xb741('0x57')],{});db[_0xb741('0x5a')][_0xb741('0x128')](db[_0xb741('0x14')],{});db[_0xb741('0x5a')][_0xb741('0x128')](db[_0xb741('0x58')],{});db['ChatApplication'][_0xb741('0x128')](db[_0xb741('0x14')],{'as':_0xb741('0x169'),'foreignKey':_0xb741('0xee'),'onDelete':_0xb741('0x150')});db[_0xb741('0x5b')][_0xb741('0x128')](db[_0xb741('0x62')],{'as':'Queue','foreignKey':_0xb741('0x16a'),'onDelete':'restrict'});db['ChatApplication'][_0xb741('0x128')](db[_0xb741('0x113')],{'as':'Website','foreignKey':_0xb741('0x167'),'onDelete':_0xb741('0x150')});db[_0xb741('0x5b')][_0xb741('0x128')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xb741('0x151')});db[_0xb741('0xfa')][_0xb741('0xf1')](db['ChatMessage'],{'as':_0xb741('0x133'),'onDelete':_0xb741('0xf4'),'foreignKey':'ChatInteractionId'});db[_0xb741('0xfa')][_0xb741('0x128')](db['ChatWebsite'],{'as':_0xb741('0x148'),'foreignKey':'ChatWebsiteId'});db[_0xb741('0xfa')][_0xb741('0x128')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xb741('0xfa')]['belongsTo'](db[_0xb741('0x14')],{'as':_0xb741('0x164'),'foreignKey':'UserId'});db[_0xb741('0xfa')][_0xb741('0xfe')](db[_0xb741('0x83')],{'through':_0xb741('0x16b'),'as':'Tags'});db[_0xb741('0xfa')][_0xb741('0xfe')](db[_0xb741('0x83')],{'through':_0xb741('0x16b'),'as':_0xb741('0x14b')});db[_0xb741('0xfa')][_0xb741('0xfe')](db[_0xb741('0x14')],{'as':_0xb741('0x14c'),'through':_0xb741('0x105'),'foreignKey':_0xb741('0x16c')});db[_0xb741('0x5e')][_0xb741('0x128')](db[_0xb741('0x14')],{'onDelete':_0xb741('0xf4'),'as':_0xb741('0x14')});db[_0xb741('0x5e')][_0xb741('0x128')](db[_0xb741('0x69')],{'onDelete':_0xb741('0xf4'),'as':_0xb741('0x139'),'foreignKey':_0xb741('0x13a')});db['ChatMessage'][_0xb741('0x128')](db[_0xb741('0xfa')],{'onDelete':_0xb741('0xf4'),'as':_0xb741('0x14f'),'foreignKey':'ChatInteractionId'});db['ChatMessage']['belongsTo'](db['Attachment'],{'as':_0xb741('0xdd'),'foreignKey':_0xb741('0x15a')});db[_0xb741('0x5e')][_0xb741('0x128')](db[_0xb741('0x113')],{'as':_0xb741('0x148'),'foreignKey':_0xb741('0x167')});db[_0xb741('0x60')][_0xb741('0x128')](db[_0xb741('0x69')],{'onDelete':_0xb741('0xf4'),'as':_0xb741('0x139'),'foreignKey':'ContactId'});db['ChatOfflineMessage'][_0xb741('0x128')](db[_0xb741('0x113')],{'as':_0xb741('0x148'),'foreignKey':_0xb741('0x167')});db[_0xb741('0x62')][_0xb741('0xfe')](db[_0xb741('0x14')],{'as':_0xb741('0x12e'),'through':_0xb741('0x2c'),'hooks':!![]});db['ChatQueue'][_0xb741('0xfe')](db['Team'],{'through':_0xb741('0x16d'),'as':_0xb741('0x12f')});db[_0xb741('0x64')]['hasMany'](db[_0xb741('0xc1')],{'as':_0xb741('0x133'),'foreignKey':'ChatGroupId','onDelete':_0xb741('0xf4')});db['ChatGroup'][_0xb741('0xfe')](db[_0xb741('0x14')],{'as':_0xb741('0x124'),'through':_0xb741('0xff')});db[_0xb741('0x65')][_0xb741('0x128')](db[_0xb741('0x113')],{'as':_0xb741('0x16e'),'foreignKey':_0xb741('0x167')});db['CmCompany'][_0xb741('0xf1')](db[_0xb741('0x69')],{'as':'Contacts','foreignKey':'CompanyId'});db[_0xb741('0x69')][_0xb741('0xf1')](db['CmHopper'],{'as':_0xb741('0x126'),'foreignKey':_0xb741('0x13a')});db[_0xb741('0x69')]['hasMany'](db[_0xb741('0x6f')],{'as':'HopperFinals','foreignKey':_0xb741('0x13a')});db[_0xb741('0x69')][_0xb741('0xf1')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xb741('0x13a')});db[_0xb741('0x69')][_0xb741('0xf1')](db[_0xb741('0xf7')],{'as':_0xb741('0xf7'),'foreignKey':'ContactId'});db[_0xb741('0x69')][_0xb741('0xf1')](db[_0xb741('0xc7')],{'as':_0xb741('0x16f'),'foreignKey':_0xb741('0x13a')});db[_0xb741('0x69')][_0xb741('0xf1')](db[_0xb741('0xf8')],{'as':_0xb741('0xf9'),'foreignKey':_0xb741('0x13a'),'onDelete':_0xb741('0x150')});db[_0xb741('0x69')][_0xb741('0xf1')](db[_0xb741('0xfa')],{'as':_0xb741('0xfb'),'foreignKey':'ContactId','onDelete':_0xb741('0x150')});db[_0xb741('0x69')]['hasMany'](db[_0xb741('0x108')],{'as':_0xb741('0x170'),'foreignKey':_0xb741('0x13a'),'onDelete':'restrict'});db[_0xb741('0x69')][_0xb741('0xf1')](db[_0xb741('0x106')],{'as':_0xb741('0x107'),'foreignKey':_0xb741('0x13a'),'onDelete':'restrict'});db[_0xb741('0x69')][_0xb741('0xf1')](db[_0xb741('0x3b')],{'as':_0xb741('0xfc'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xb741('0x69')][_0xb741('0x128')](db[_0xb741('0x67')],{'as':'Company','foreignKey':'CompanyId'});db[_0xb741('0x69')][_0xb741('0x128')](db[_0xb741('0x101')],{'as':_0xb741('0x143'),'foreignKey':'ListId','onDelete':_0xb741('0xf4')});db[_0xb741('0x69')][_0xb741('0xfe')](db[_0xb741('0x14')],{'as':_0xb741('0x14c'),'through':_0xb741('0x100')});db[_0xb741('0x69')][_0xb741('0xfe')](db['Tag'],{'as':'Tags','through':_0xb741('0x171')});db[_0xb741('0x69')][_0xb741('0xfe')](db['Tag'],{'through':'cm_contact_has_tags','as':_0xb741('0x14b')});db[_0xb741('0x6b')]['belongsTo'](db[_0xb741('0x69')],{'as':'Contact','foreignKey':_0xb741('0x13a'),'onDelete':_0xb741('0xf4')});db['CmHopper'][_0xb741('0x128')](db['CmList'],{'as':_0xb741('0x143'),'foreignKey':'ListId','onDelete':_0xb741('0xf4')});db[_0xb741('0x6b')][_0xb741('0x128')](db[_0xb741('0x14')],{'as':_0xb741('0x169'),'foreignKey':_0xb741('0xee')});db[_0xb741('0x6b')][_0xb741('0x128')](db['VoiceQueue'],{'as':_0xb741('0x172'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db['CmHopper'][_0xb741('0x128')](db[_0xb741('0x173')],{'as':_0xb741('0x173'),'foreignKey':_0xb741('0x174'),'onDelete':_0xb741('0xf4')});db[_0xb741('0x6b')][_0xb741('0x128')](db[_0xb741('0x14')],{'as':_0xb741('0x164'),'foreignKey':_0xb741('0x175')});db['CmHopperBlack'][_0xb741('0x128')](db['CmContact'],{'as':_0xb741('0x139'),'foreignKey':_0xb741('0x13a'),'onDelete':_0xb741('0xf4')});db[_0xb741('0x6d')]['belongsTo'](db[_0xb741('0x101')],{'as':'List','foreignKey':_0xb741('0x144'),'onDelete':'cascade'});db[_0xb741('0x6d')][_0xb741('0x128')](db[_0xb741('0x18')],{'as':_0xb741('0x172'),'foreignKey':_0xb741('0x125'),'onDelete':'cascade'});db[_0xb741('0x6d')]['belongsTo'](db[_0xb741('0x173')],{'as':_0xb741('0x173'),'foreignKey':'CampaignId','onDelete':_0xb741('0xf4')});db[_0xb741('0x77')]['hasMany'](db[_0xb741('0x176')],{'as':{'plural':'All','singular':_0xb741('0x177')},'foreignKey':_0xb741('0x178'),'onDelete':_0xb741('0xf4'),'hooks':!![]});db[_0xb741('0x77')][_0xb741('0xf1')](db['Condition'],{'as':{'plural':_0xb741('0x179'),'singular':_0xb741('0x17a')},'foreignKey':_0xb741('0x17b'),'onDelete':_0xb741('0xf4'),'hooks':!![]});db[_0xb741('0x77')]['hasMany'](db['Action'],{'as':'Actions','foreignKey':_0xb741('0x17c'),'onDelete':_0xb741('0xf4'),'hooks':!![]});db[_0xb741('0x7b')][_0xb741('0xf1')](db[_0xb741('0x7b')],{'as':'Intervals','foreignKey':_0xb741('0x12b'),'onDelete':_0xb741('0xf4'),'hooks':!![],'required':![]});db[_0xb741('0x7b')][_0xb741('0xf1')](db[_0xb741('0x16')],{'as':_0xb741('0xf3'),'foreignKey':_0xb741('0x12b'),'onDelete':_0xb741('0x150')});db[_0xb741('0x7b')][_0xb741('0xf1')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0xb741('0x12b')});db[_0xb741('0x7b')][_0xb741('0xf1')](db[_0xb741('0x5b')],{'as':_0xb741('0x17d'),'foreignKey':_0xb741('0x12b')});db['Interval'][_0xb741('0xf1')](db['FaxApplication'],{'as':_0xb741('0x17e'),'foreignKey':_0xb741('0x12b')});db['Interval']['hasMany'](db[_0xb741('0x15d')],{'as':_0xb741('0x17f'),'foreignKey':_0xb741('0x12b')});db['Schedule'][_0xb741('0x128')](db[_0xb741('0x37')],{});db[_0xb741('0x180')][_0xb741('0x128')](db[_0xb741('0x8e')],{'foreignKey':'DefaultReportId'});db[_0xb741('0x180')][_0xb741('0x128')](db[_0xb741('0x8c')],{'foreignKey':_0xb741('0x181')});db[_0xb741('0x81')][_0xb741('0xfe')](db[_0xb741('0x182')],{'as':_0xb741('0x183'),'through':'moh_has_sounds','onDelete':_0xb741('0x150')});db[_0xb741('0x83')][_0xb741('0xfe')](db[_0xb741('0x69')],{'through':'cm_contact_has_tags'});db['Tag'][_0xb741('0xfe')](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db[_0xb741('0x83')][_0xb741('0xfe')](db[_0xb741('0x3b')],{'through':_0xb741('0x149')});db[_0xb741('0x83')]['belongsToMany'](db[_0xb741('0x108')],{'through':_0xb741('0x15e')});db['Tag']['belongsToMany'](db[_0xb741('0x106')],{'through':'fax_interaction_has_tags'});db[_0xb741('0x83')][_0xb741('0xfe')](db[_0xb741('0xf8')],{'through':_0xb741('0x165')});db[_0xb741('0x184')][_0xb741('0xf1')](db[_0xb741('0x176')],{'as':{'plural':_0xb741('0x185'),'singular':'AllCondition'},'foreignKey':_0xb741('0x186'),'onDelete':_0xb741('0xf4'),'hooks':!![]});db[_0xb741('0x184')][_0xb741('0xf1')](db[_0xb741('0x176')],{'as':{'plural':_0xb741('0x187'),'singular':_0xb741('0x188')},'foreignKey':_0xb741('0x189'),'onDelete':_0xb741('0xf4'),'hooks':!![]});db[_0xb741('0x184')][_0xb741('0xf1')](db[_0xb741('0x75')],{'as':_0xb741('0x18a'),'foreignKey':_0xb741('0x18b'),'onDelete':_0xb741('0xf4'),'hooks':!![]});db[_0xb741('0x8c')]['hasMany'](db[_0xb741('0x18c')],{'as':_0xb741('0x18d'),'onDelete':'cascade','foreignKey':_0xb741('0x181'),'hooks':!![]});db[_0xb741('0x8e')][_0xb741('0xf1')](db[_0xb741('0x18c')],{'as':'Fields','onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x18e')});db['AnalyticMetric'][_0xb741('0xf1')](db[_0xb741('0x18c')],{'as':_0xb741('0x18d'),'onDelete':'cascade','foreignKey':_0xb741('0x18f')});db[_0xb741('0x18c')][_0xb741('0x128')](db[_0xb741('0x190')],{'foreignKey':'MetricId'});db[_0xb741('0x92')][_0xb741('0xf1')](db[_0xb741('0x94')],{'as':_0xb741('0x191'),'onDelete':'cascade','foreignKey':_0xb741('0x192')});db[_0xb741('0x94')][_0xb741('0xf1')](db['SalesforceField'],{'as':_0xb741('0x193'),'onDelete':'cascade','foreignKey':_0xb741('0x194')});db[_0xb741('0x94')][_0xb741('0xf1')](db[_0xb741('0x195')],{'as':'Descriptions','onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x196')});db[_0xb741('0x94')][_0xb741('0xf1')](db[_0xb741('0x195')],{'as':'Fields','onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x197')});db[_0xb741('0x94')][_0xb741('0x128')](db[_0xb741('0x92')],{'as':_0xb741('0x148'),'foreignKey':_0xb741('0x192')});db[_0xb741('0x195')]['hasMany'](db[_0xb741('0x195')],{'as':'Subject','foreignKey':_0xb741('0x194')});db[_0xb741('0x195')][_0xb741('0xf1')](db['SalesforceField'],{'as':_0xb741('0x198'),'foreignKey':_0xb741('0x196')});db[_0xb741('0x195')][_0xb741('0xf1')](db[_0xb741('0x195')],{'as':_0xb741('0x199'),'foreignKey':'FieldId'});db[_0xb741('0x195')]['belongsTo'](db[_0xb741('0x87')],{'as':'Variable','foreignKey':_0xb741('0x19a')});db[_0xb741('0x95')][_0xb741('0xf1')](db['SugarcrmConfiguration'],{'as':_0xb741('0x191'),'onDelete':_0xb741('0xf4'),'foreignKey':'AccountId'});db[_0xb741('0x97')][_0xb741('0xf1')](db[_0xb741('0x99')],{'as':_0xb741('0x193'),'onDelete':_0xb741('0xf4'),'foreignKey':'SubjectId'});db[_0xb741('0x97')][_0xb741('0xf1')](db[_0xb741('0x99')],{'as':'Descriptions','onDelete':_0xb741('0xf4'),'foreignKey':'DescriptionId'});db[_0xb741('0x97')][_0xb741('0xf1')](db['SugarcrmField'],{'as':_0xb741('0x18d'),'onDelete':'cascade','foreignKey':_0xb741('0x197')});db['SugarcrmConfiguration'][_0xb741('0x128')](db[_0xb741('0x95')],{'as':_0xb741('0x148'),'foreignKey':'AccountId'});db[_0xb741('0x99')][_0xb741('0xf1')](db['SugarcrmField'],{'as':'Subject','foreignKey':_0xb741('0x194')});db[_0xb741('0x99')][_0xb741('0xf1')](db[_0xb741('0x99')],{'as':_0xb741('0x198'),'foreignKey':_0xb741('0x196')});db[_0xb741('0x99')][_0xb741('0xf1')](db[_0xb741('0x99')],{'as':_0xb741('0x199'),'foreignKey':'FieldId'});db['SugarcrmField'][_0xb741('0x128')](db[_0xb741('0x87')],{'as':_0xb741('0x87'),'foreignKey':_0xb741('0x19a')});db['DeskAccount'][_0xb741('0xf1')](db[_0xb741('0x9c')],{'as':_0xb741('0x191'),'onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x192')});db[_0xb741('0x9c')]['hasMany'](db[_0xb741('0x9d')],{'as':_0xb741('0x193'),'onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x194')});db[_0xb741('0x9c')]['hasMany'](db['DeskField'],{'as':_0xb741('0x19b'),'onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x196')});db[_0xb741('0x9c')]['hasMany'](db['DeskField'],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xb741('0x9c')]['belongsTo'](db[_0xb741('0x19c')],{'as':_0xb741('0x148'),'foreignKey':_0xb741('0x192')});db[_0xb741('0x9c')][_0xb741('0xfe')](db[_0xb741('0x83')],{'through':'int_desk_configuration_has_tags'});db[_0xb741('0x9d')][_0xb741('0xf1')](db['DeskField'],{'as':_0xb741('0x19d'),'foreignKey':_0xb741('0x194')});db['DeskField']['hasMany'](db[_0xb741('0x9d')],{'as':'Description','foreignKey':_0xb741('0x196')});db[_0xb741('0x9d')][_0xb741('0xf1')](db[_0xb741('0x9d')],{'as':_0xb741('0x199'),'foreignKey':_0xb741('0x197')});db['DeskField'][_0xb741('0x128')](db[_0xb741('0x87')],{'as':_0xb741('0x87'),'foreignKey':'VariableId'});db[_0xb741('0x19e')][_0xb741('0xf1')](db[_0xb741('0x9f')],{'as':_0xb741('0x191'),'onDelete':'cascade','foreignKey':_0xb741('0x192')});db[_0xb741('0x9f')][_0xb741('0xf1')](db[_0xb741('0xa1')],{'as':_0xb741('0x193'),'onDelete':'cascade','foreignKey':'SubjectId'});db['ZohoConfiguration'][_0xb741('0xf1')](db['ZohoField'],{'as':_0xb741('0x19b'),'onDelete':'cascade','foreignKey':_0xb741('0x196')});db[_0xb741('0x9f')][_0xb741('0xf1')](db[_0xb741('0xa1')],{'as':_0xb741('0x18d'),'onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x197')});db['ZohoConfiguration'][_0xb741('0x128')](db[_0xb741('0x19e')],{'as':_0xb741('0x148'),'foreignKey':_0xb741('0x192')});db['ZohoField'][_0xb741('0xf1')](db[_0xb741('0xa1')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xb741('0xa1')]['hasMany'](db['ZohoField'],{'as':_0xb741('0x198'),'foreignKey':'DescriptionId'});db['ZohoField'][_0xb741('0xf1')](db[_0xb741('0xa1')],{'as':_0xb741('0x199'),'foreignKey':_0xb741('0x197')});db['ZohoField'][_0xb741('0x128')](db[_0xb741('0x87')],{'as':_0xb741('0x87'),'foreignKey':_0xb741('0x19a')});db[_0xb741('0xa3')]['hasMany'](db[_0xb741('0x19f')],{'as':_0xb741('0x191'),'onDelete':'cascade','foreignKey':_0xb741('0x192')});db['ZendeskConfiguration'][_0xb741('0xf1')](db[_0xb741('0xa6')],{'as':_0xb741('0x193'),'foreignKey':_0xb741('0x194')});db[_0xb741('0x19f')]['hasMany'](db['ZendeskField'],{'as':_0xb741('0x19b'),'foreignKey':_0xb741('0x196')});db[_0xb741('0x19f')][_0xb741('0xf1')](db['ZendeskField'],{'as':_0xb741('0x18d'),'foreignKey':_0xb741('0x197')});db[_0xb741('0x19f')][_0xb741('0x128')](db['ZendeskAccount'],{'as':_0xb741('0x148'),'foreignKey':_0xb741('0x192')});db[_0xb741('0x19f')][_0xb741('0xfe')](db[_0xb741('0x83')],{'through':_0xb741('0x1a0')});db[_0xb741('0xa6')][_0xb741('0xf1')](db[_0xb741('0xa6')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xb741('0xa6')]['hasMany'](db[_0xb741('0xa6')],{'as':_0xb741('0x198'),'foreignKey':_0xb741('0x196')});db[_0xb741('0xa6')][_0xb741('0xf1')](db[_0xb741('0xa6')],{'as':_0xb741('0x199'),'foreignKey':_0xb741('0x197')});db[_0xb741('0xa6')][_0xb741('0x128')](db[_0xb741('0x87')],{'as':'Variable','foreignKey':_0xb741('0x19a')});db['FreshdeskAccount']['hasMany'](db['FreshdeskConfiguration'],{'as':_0xb741('0x191'),'onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x192')});db['FreshdeskConfiguration'][_0xb741('0xf1')](db[_0xb741('0xab')],{'as':'Subjects','onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x194')});db[_0xb741('0xa9')]['hasMany'](db[_0xb741('0xab')],{'as':_0xb741('0x19b'),'onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x196')});db[_0xb741('0xa9')][_0xb741('0xf1')](db[_0xb741('0xab')],{'as':_0xb741('0x18d'),'onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x197')});db[_0xb741('0xa9')][_0xb741('0x128')](db['FreshdeskAccount'],{'as':_0xb741('0x148'),'foreignKey':_0xb741('0x192')});db['FreshdeskConfiguration']['belongsToMany'](db[_0xb741('0x83')],{'through':_0xb741('0x1a1')});db[_0xb741('0xab')][_0xb741('0xf1')](db[_0xb741('0xab')],{'as':_0xb741('0x19d'),'foreignKey':'SubjectId'});db[_0xb741('0xab')][_0xb741('0xf1')](db[_0xb741('0xab')],{'as':_0xb741('0x198'),'foreignKey':_0xb741('0x196')});db[_0xb741('0xab')]['hasMany'](db[_0xb741('0xab')],{'as':_0xb741('0x199'),'foreignKey':'FieldId'});db[_0xb741('0xab')][_0xb741('0x128')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0xb741('0xac')][_0xb741('0xf1')](db[_0xb741('0xae')],{'as':'Configurations','onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x192')});db[_0xb741('0xae')][_0xb741('0xf1')](db[_0xb741('0x1a2')],{'as':_0xb741('0x193'),'foreignKey':_0xb741('0x194')});db[_0xb741('0xae')][_0xb741('0xf1')](db['VtigerField'],{'as':'Descriptions','foreignKey':_0xb741('0x196')});db[_0xb741('0xae')][_0xb741('0xf1')](db['VtigerField'],{'as':_0xb741('0x18d'),'foreignKey':_0xb741('0x197')});db['VtigerConfiguration'][_0xb741('0x128')](db['VtigerAccount'],{'as':_0xb741('0x148'),'foreignKey':'AccountId'});db[_0xb741('0x1a2')][_0xb741('0xf1')](db[_0xb741('0x1a2')],{'as':'Subject','foreignKey':_0xb741('0x194')});db[_0xb741('0x1a2')][_0xb741('0xf1')](db[_0xb741('0x1a2')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xb741('0x1a2')][_0xb741('0xf1')](db[_0xb741('0x1a2')],{'as':'Field','foreignKey':_0xb741('0x197')});db[_0xb741('0x1a2')][_0xb741('0x128')](db[_0xb741('0x87')],{'as':_0xb741('0x87'),'foreignKey':_0xb741('0x19a')});db[_0xb741('0xb0')][_0xb741('0xf1')](db[_0xb741('0x1a3')],{'as':_0xb741('0x191'),'onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x192')});db[_0xb741('0x1a3')][_0xb741('0xf1')](db[_0xb741('0xb2')],{'as':_0xb741('0x193'),'foreignKey':_0xb741('0x194')});db['ServicenowConfiguration'][_0xb741('0xf1')](db[_0xb741('0xb2')],{'as':_0xb741('0x19b'),'foreignKey':_0xb741('0x196')});db[_0xb741('0x1a3')]['hasMany'](db[_0xb741('0xb2')],{'as':_0xb741('0x18d'),'foreignKey':'FieldId'});db['ServicenowConfiguration']['belongsTo'](db[_0xb741('0xb0')],{'as':_0xb741('0x148'),'foreignKey':_0xb741('0x192')});db[_0xb741('0xb2')]['hasMany'](db[_0xb741('0xb2')],{'as':'Subject','foreignKey':_0xb741('0x194')});db[_0xb741('0xb2')][_0xb741('0xf1')](db[_0xb741('0xb2')],{'as':_0xb741('0x198'),'foreignKey':_0xb741('0x196')});db[_0xb741('0xb2')][_0xb741('0xf1')](db[_0xb741('0xb2')],{'as':'Field','foreignKey':'FieldId'});db[_0xb741('0xb2')][_0xb741('0x128')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['Dynamics365Account'][_0xb741('0xf1')](db[_0xb741('0xb6')],{'as':_0xb741('0x191'),'onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x192')});db['Dynamics365Configuration']['hasMany'](db[_0xb741('0xb8')],{'as':'Subjects','onDelete':_0xb741('0xf4'),'foreignKey':'SubjectId'});db[_0xb741('0xb6')][_0xb741('0xf1')](db[_0xb741('0xb8')],{'as':'Descriptions','onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x196')});db[_0xb741('0xb6')][_0xb741('0xf1')](db[_0xb741('0xb8')],{'as':'Fields','onDelete':_0xb741('0xf4'),'foreignKey':'FieldId'});db['Dynamics365Configuration']['belongsTo'](db[_0xb741('0xb4')],{'as':_0xb741('0x148'),'foreignKey':'AccountId'});db[_0xb741('0xb8')]['hasMany'](db['Dynamics365Field'],{'as':_0xb741('0x19d'),'foreignKey':'SubjectId'});db[_0xb741('0xb8')]['hasMany'](db['Dynamics365Field'],{'as':_0xb741('0x198'),'foreignKey':_0xb741('0x196')});db[_0xb741('0xb8')][_0xb741('0xf1')](db[_0xb741('0xb8')],{'as':_0xb741('0x199'),'foreignKey':_0xb741('0x197')});db[_0xb741('0xb8')][_0xb741('0x128')](db[_0xb741('0x87')],{'as':_0xb741('0x87'),'foreignKey':_0xb741('0x19a')});db[_0xb741('0xb9')][_0xb741('0xf1')](db[_0xb741('0xbb')],{'as':_0xb741('0x191'),'onDelete':'cascade','foreignKey':_0xb741('0x192')});db[_0xb741('0xbb')]['hasMany'](db[_0xb741('0xbd')],{'as':_0xb741('0x193'),'foreignKey':_0xb741('0x194')});db[_0xb741('0xbb')]['hasMany'](db['FreshsalesField'],{'as':_0xb741('0x19b'),'foreignKey':_0xb741('0x196')});db[_0xb741('0xbb')][_0xb741('0xf1')](db[_0xb741('0xbd')],{'as':_0xb741('0x18d'),'foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0xb741('0x128')](db[_0xb741('0xb9')],{'as':_0xb741('0x148'),'foreignKey':_0xb741('0x192')});db[_0xb741('0xbd')][_0xb741('0xf1')](db['FreshsalesField'],{'as':_0xb741('0x19d'),'foreignKey':_0xb741('0x194')});db['FreshsalesField'][_0xb741('0xf1')](db[_0xb741('0xbd')],{'as':_0xb741('0x198'),'foreignKey':_0xb741('0x196')});db['FreshsalesField']['hasMany'](db['FreshsalesField'],{'as':_0xb741('0x199'),'foreignKey':_0xb741('0x197')});db[_0xb741('0xbd')][_0xb741('0x128')](db[_0xb741('0x87')],{'as':_0xb741('0x87'),'foreignKey':_0xb741('0x19a')});db['ChatQueueReport'][_0xb741('0x128')](db[_0xb741('0x113')],{});db[_0xb741('0xc0')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xb741('0xc0')][_0xb741('0x128')](db[_0xb741('0x69')],{'as':_0xb741('0x139'),'foreignKey':_0xb741('0x13a')});db[_0xb741('0xc0')][_0xb741('0x128')](db['ChatInteraction'],{});db[_0xb741('0xc0')]['belongsTo'](db['ChatMessage'],{});db[_0xb741('0xc0')]['belongsTo'](db[_0xb741('0x14')],{});db[_0xb741('0xc0')]['belongsTo'](db['ChatQueue'],{});db[_0xb741('0xc1')][_0xb741('0x128')](db['User'],{'onDelete':'cascade','foreignKey':'FromId'});db[_0xb741('0xc1')][_0xb741('0x128')](db[_0xb741('0x14')],{'onDelete':_0xb741('0xf4'),'foreignKey':'ToId'});db['JscriptySessionReport'][_0xb741('0xf1')](db[_0xb741('0xc5')],{'foreignKey':_0xb741('0x1a4'),'onDelete':_0xb741('0xf4')});db[_0xb741('0xc7')][_0xb741('0xf1')](db['JscriptyAnswerReport'],{'foreignKey':_0xb741('0x1a4'),'onDelete':_0xb741('0xf4')});db['SmsQueueReport']['belongsTo'](db[_0xb741('0x4e')],{});db[_0xb741('0xc8')]['belongsTo'](db[_0xb741('0x101')],{'as':_0xb741('0x143'),'foreignKey':_0xb741('0x144')});db[_0xb741('0xc8')][_0xb741('0x128')](db[_0xb741('0x69')],{'as':_0xb741('0x139'),'foreignKey':_0xb741('0x13a')});db['SmsQueueReport']['belongsTo'](db['SmsInteraction'],{});db[_0xb741('0xc8')][_0xb741('0x128')](db[_0xb741('0x50')],{});db[_0xb741('0xc8')][_0xb741('0x128')](db[_0xb741('0x14')],{});db[_0xb741('0xc8')]['belongsTo'](db[_0xb741('0x10e')],{});db[_0xb741('0xcc')]['hasMany'](db[_0xb741('0xc7')],{'foreignKey':_0xb741('0x1a5')});db[_0xb741('0xcc')][_0xb741('0xf1')](db[_0xb741('0xc5')],{'foreignKey':'ProjectId'});db[_0xb741('0xcc')][_0xb741('0xf1')](db[_0xb741('0xc3')],{'foreignKey':_0xb741('0x1a5')});db[_0xb741('0xd2')][_0xb741('0xfe')](db['User'],{'as':_0xb741('0x14c'),'through':_0xb741('0x11d')});db[_0xb741('0xd7')][_0xb741('0xfe')](db[_0xb741('0x14')],{'as':_0xb741('0x12e'),'through':_0xb741('0x103')});db[_0xb741('0xd7')][_0xb741('0xfe')](db[_0xb741('0x18')],{'through':_0xb741('0x130'),'as':_0xb741('0x10a')});db['Team'][_0xb741('0xfe')](db[_0xb741('0x38')],{'through':'team_has_mail_queues','as':_0xb741('0x1a6')});db[_0xb741('0xd7')][_0xb741('0xfe')](db[_0xb741('0x62')],{'through':_0xb741('0x16d'),'as':_0xb741('0x10b')});db[_0xb741('0xd7')][_0xb741('0xfe')](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0xb741('0x10c')});db[_0xb741('0xd7')][_0xb741('0xfe')](db['SmsQueue'],{'through':_0xb741('0x161'),'as':_0xb741('0x10f')});db[_0xb741('0xd7')][_0xb741('0xfe')](db[_0xb741('0x58')],{'through':_0xb741('0x1a7'),'as':_0xb741('0x1a8')});db[_0xb741('0x173')][_0xb741('0xf1')](db[_0xb741('0x6b')],{'as':_0xb741('0x126'),'foreignKey':'CampaignId'});db[_0xb741('0x173')][_0xb741('0xf1')](db[_0xb741('0x6f')],{'as':'HopperFinals','foreignKey':_0xb741('0x174')});db[_0xb741('0x173')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xb741('0x174')});db['Campaign']['hasMany'](db['CmHopperBlack'],{'as':_0xb741('0x1a9'),'foreignKey':_0xb741('0x174')});db[_0xb741('0x173')][_0xb741('0x128')](db['Trunk'],{'as':_0xb741('0x26'),'foreignKey':_0xb741('0x129')});db['Campaign'][_0xb741('0x128')](db[_0xb741('0x26')],{'as':_0xb741('0x1aa'),'foreignKey':_0xb741('0x12a')});db[_0xb741('0x173')][_0xb741('0x128')](db[_0xb741('0x7b')],{'as':'Interval','foreignKey':_0xb741('0x12b')});db[_0xb741('0x173')][_0xb741('0x128')](db[_0xb741('0xd2')],{'as':_0xb741('0xd2'),'foreignKey':'SquareProjectId'});db[_0xb741('0x173')][_0xb741('0xfe')](db['CmList'],{'as':_0xb741('0x1ab'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0xb741('0xfe')](db[_0xb741('0x101')],{'as':_0xb741('0x131'),'through':'campaigns_has_cm_blacklists'});db[_0xb741('0xe1')][_0xb741('0x128')](db[_0xb741('0x141')],{});db[_0xb741('0xe1')][_0xb741('0x128')](db[_0xb741('0x3b')],{});db[_0xb741('0xe1')][_0xb741('0x128')](db[_0xb741('0x37')],{'foreignKey':'FromMailAccountId','as':_0xb741('0x1ac')});db[_0xb741('0xe1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0xb741('0x1ad')});db[_0xb741('0xe1')]['belongsTo'](db[_0xb741('0x14')],{'foreignKey':_0xb741('0x1ae'),'as':'ToAgent'});db[_0xb741('0xe1')][_0xb741('0x128')](db['MailQueue'],{'foreignKey':_0xb741('0x1af'),'as':'ToQueue'});db['MailTransferReport'][_0xb741('0x128')](db[_0xb741('0x37')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0xb741('0xe2')][_0xb741('0x128')](db['ChatMessage'],{});db['ChatTransferReport'][_0xb741('0x128')](db[_0xb741('0xfa')],{});db[_0xb741('0xe2')]['belongsTo'](db[_0xb741('0x113')],{'foreignKey':_0xb741('0x1b0'),'as':'FromAccount'});db[_0xb741('0xe2')]['belongsTo'](db[_0xb741('0x14')],{'foreignKey':_0xb741('0x1b1'),'as':_0xb741('0x1ad')});db[_0xb741('0xe2')][_0xb741('0x128')](db[_0xb741('0x14')],{'foreignKey':_0xb741('0x1ae'),'as':'ToAgent'});db['ChatTransferReport'][_0xb741('0x128')](db[_0xb741('0x62')],{'foreignKey':_0xb741('0x1b2'),'as':_0xb741('0x1b3')});db[_0xb741('0xe2')][_0xb741('0x128')](db[_0xb741('0x113')],{'foreignKey':'ToChatWebsiteId','as':_0xb741('0x1b4')});db[_0xb741('0xe3')][_0xb741('0x128')](db['FaxMessage'],{});db[_0xb741('0xe3')][_0xb741('0x128')](db[_0xb741('0x106')],{});db[_0xb741('0xe3')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0xb741('0x1b5'),'as':_0xb741('0x1ac')});db[_0xb741('0xe3')][_0xb741('0x128')](db['User'],{'foreignKey':_0xb741('0x1b1'),'as':_0xb741('0x1ad')});db[_0xb741('0xe3')][_0xb741('0x128')](db['User'],{'foreignKey':'ToUserId','as':_0xb741('0x1b6')});db['FaxTransferReport']['belongsTo'](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0xb741('0x1b3')});db[_0xb741('0xe3')][_0xb741('0x128')](db[_0xb741('0x46')],{'foreignKey':_0xb741('0x1b7'),'as':_0xb741('0x1b4')});db[_0xb741('0xe4')][_0xb741('0x128')](db[_0xb741('0x57')],{});db[_0xb741('0xe4')][_0xb741('0x128')](db[_0xb741('0xf8')],{});db['OpenchannelTransferReport'][_0xb741('0x128')](db['OpenchannelAccount'],{'foreignKey':_0xb741('0x1b8'),'as':_0xb741('0x1ac')});db[_0xb741('0xe4')][_0xb741('0x128')](db['User'],{'foreignKey':'FromUserId','as':_0xb741('0x1ad')});db[_0xb741('0xe4')]['belongsTo'](db['User'],{'foreignKey':_0xb741('0x1ae'),'as':_0xb741('0x1b6')});db[_0xb741('0xe4')][_0xb741('0x128')](db[_0xb741('0x58')],{'foreignKey':_0xb741('0x1b9'),'as':_0xb741('0x1b3')});db[_0xb741('0xe4')][_0xb741('0x128')](db[_0xb741('0x53')],{'foreignKey':_0xb741('0x1ba'),'as':_0xb741('0x1b4')});db[_0xb741('0xe5')][_0xb741('0x128')](db['SmsMessage'],{});db[_0xb741('0xe5')]['belongsTo'](db['SmsInteraction'],{});db['SmsTransferReport'][_0xb741('0x128')](db[_0xb741('0x4e')],{'foreignKey':_0xb741('0x1bb'),'as':'FromAccount'});db[_0xb741('0xe5')]['belongsTo'](db[_0xb741('0x14')],{'foreignKey':_0xb741('0x1b1'),'as':_0xb741('0x1ad')});db[_0xb741('0xe5')][_0xb741('0x128')](db[_0xb741('0x14')],{'foreignKey':_0xb741('0x1ae'),'as':'ToAgent'});db[_0xb741('0xe5')][_0xb741('0x128')](db[_0xb741('0x10e')],{'foreignKey':_0xb741('0x1bc'),'as':_0xb741('0x1b3')});db[_0xb741('0xe5')][_0xb741('0x128')](db[_0xb741('0x4e')],{'foreignKey':_0xb741('0x1bd'),'as':_0xb741('0x1b4')});db[_0xb741('0x101')]['hasMany'](db['Disposition'],{'as':_0xb741('0x13e'),'foreignKey':_0xb741('0x144')});db[_0xb741('0x101')][_0xb741('0xf1')](db[_0xb741('0x1be')],{'as':_0xb741('0x1bf'),'foreignKey':_0xb741('0x144')});db[_0xb741('0x101')][_0xb741('0xf1')](db[_0xb741('0x69')],{'as':'Contacts','onDelete':_0xb741('0xf4'),'foreignKey':_0xb741('0x144')});db[_0xb741('0x101')][_0xb741('0xf1')](db[_0xb741('0x6f')],{'as':_0xb741('0xf5'),'foreignKey':_0xb741('0x144')});db[_0xb741('0x101')][_0xb741('0xf1')](db[_0xb741('0x71')],{'as':_0xb741('0xf6'),'foreignKey':_0xb741('0x144')});db[_0xb741('0x101')]['hasMany'](db[_0xb741('0xf7')],{'as':'ReportAgentPreview','foreignKey':_0xb741('0x144')});db[_0xb741('0x101')][_0xb741('0xfe')](db[_0xb741('0x18')],{'as':_0xb741('0x1c0'),'through':'voice_queues_has_cm_lists'});db[_0xb741('0x101')]['belongsToMany'](db[_0xb741('0x14')],{'as':_0xb741('0x12e'),'through':_0xb741('0x102')});db['VoicePrefix'][_0xb741('0xf1')](db[_0xb741('0x16')],{'as':'Extensions','onDelete':_0xb741('0x150')});db['VoicePrefix'][_0xb741('0xfe')](db[_0xb741('0x14')],{'as':_0xb741('0x12e'),'through':_0xb741('0x112')});db[_0xb741('0xe9')][_0xb741('0xf1')](db[_0xb741('0x14')],{'as':_0xb741('0x14c'),'foreignKey':_0xb741('0xfd')});db[_0xb741('0xe9')]['hasMany'](db[_0xb741('0xea')],{'as':'UserProfileSections','foreignKey':_0xb741('0xfd'),'onDelete':_0xb741('0xf4')});db[_0xb741('0xea')][_0xb741('0xf1')](db[_0xb741('0xec')],{'as':_0xb741('0x1c1'),'foreignKey':_0xb741('0x1c2'),'onDelete':_0xb741('0xf4')});module[_0xb741('0x1c3')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index db394dd..11c9302 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x542d=['responseTime','user','name','body','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)','format','remoteAddress','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/queues','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./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/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','./api/attachment','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authGoogle','/api/jira','./api/jira','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','root','/www','join','/demo','/snippet','snippet','/plugins','route','get','resolve','appPath','path','express','express-winston','util','./config/environment','./config/logger','api','auth','default','use','logger','method','headers','x-forwarded-for','connection','url','statusCode'];(function(_0x285a44,_0xcaea92){var _0x5e7a3f=function(_0xf023a3){while(--_0xf023a3){_0x285a44['push'](_0x285a44['shift']());}};_0x5e7a3f(++_0xcaea92);}(_0x542d,0xf7));var _0xd542=function(_0x5d1b9c,_0x242953){_0x5d1b9c=_0x5d1b9c-0x0;var _0x3b95e7=_0x542d[_0x5d1b9c];return _0x3b95e7;};'use strict';var path=require(_0xd542('0x0'));var express=require(_0xd542('0x1'));var ewinston=require(_0xd542('0x2'));var util=require(_0xd542('0x3'));var errors=require('./errors');var config=require(_0xd542('0x4'));var logger=require(_0xd542('0x5'))(_0xd542('0x6'));var authLogger=require('./config/logger')(_0xd542('0x7'));exports[_0xd542('0x8')]=function(_0xa239dd){_0xa239dd[_0xd542('0x9')](ewinston[_0xd542('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x15928a,_0x314ee2){return util['format']('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x15928a[_0xd542('0xb')],_0x15928a[_0xd542('0xc')][_0xd542('0xd')]?_0x15928a[_0xd542('0xc')][_0xd542('0xd')]:_0x15928a[_0xd542('0xe')]['remoteAddress']||_0x15928a['ip'],_0x15928a[_0xd542('0xf')],_0x314ee2[_0xd542('0x10')],_0x314ee2[_0xd542('0x11')],_0x15928a['user']?_0x15928a[_0xd542('0x12')]['id']:null,_0x15928a[_0xd542('0x12')]?_0x15928a['user'][_0xd542('0x13')]:null,_0x15928a[_0xd542('0x12')]?_0x15928a[_0xd542('0x12')]['role']:null);}}));_0xa239dd[_0xd542('0x9')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2c536e,_0x9735e2){var _0x130ab4='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x2c536e['body']&&_0x2c536e[_0xd542('0x14')][_0xd542('0x15')]&&_0x2c536e[_0xd542('0x14')][_0xd542('0x16')]){_0x130ab4=_0xd542('0x17');}return util[_0xd542('0x18')](_0x130ab4,_0x2c536e[_0xd542('0xb')],_0x2c536e[_0xd542('0xc')]['x-forwarded-for']?_0x2c536e[_0xd542('0xc')][_0xd542('0xd')]:_0x2c536e[_0xd542('0xe')][_0xd542('0x19')]||_0x2c536e['ip'],_0x2c536e[_0xd542('0xf')],_0x9735e2['statusCode'],_0x9735e2[_0xd542('0x11')],_0x2c536e[_0xd542('0x12')]?_0x2c536e['user']['id']:null,_0x2c536e[_0xd542('0x12')]?_0x2c536e[_0xd542('0x12')]['name']:null,_0x2c536e['user']?_0x2c536e[_0xd542('0x12')]['role']:null,_0x2c536e[_0xd542('0x14')]&&_0x2c536e[_0xd542('0x14')]['device']?_0x2c536e[_0xd542('0x14')][_0xd542('0x15')]:_0xd542('0x1a'),_0x2c536e['body']&&_0x2c536e[_0xd542('0x14')]['agent_id']?_0x2c536e[_0xd542('0x14')][_0xd542('0x16')]:'',_0x2c536e[_0xd542('0x14')]&&_0x2c536e[_0xd542('0x14')]['agent_name']?_0x2c536e[_0xd542('0x14')][_0xd542('0x1b')]:'');},'ignoreRoute':function(_0x1a5e00){var _0x8f3cc6=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x8f3cc6[_0xd542('0x1c')](_0x1a5e00[_0xd542('0xf')]);}}));_0xa239dd[_0xd542('0x9')](_0xd542('0x1d'),require(_0xd542('0x1e')));_0xa239dd[_0xd542('0x9')](_0xd542('0x1f'),require('./api/voiceChanSpy'));_0xa239dd['use'](_0xd542('0x20'),require(_0xd542('0x21')));_0xa239dd[_0xd542('0x9')](_0xd542('0x22'),require(_0xd542('0x23')));_0xa239dd[_0xd542('0x9')](_0xd542('0x24'),require(_0xd542('0x25')));_0xa239dd['use'](_0xd542('0x26'),require(_0xd542('0x27')));_0xa239dd[_0xd542('0x9')]('/api/voice/recordings',require('./api/voiceRecording'));_0xa239dd[_0xd542('0x9')]('/api/screen/recordings',require(_0xd542('0x28')));_0xa239dd[_0xd542('0x9')](_0xd542('0x29'),require('./api/voiceMail'));_0xa239dd['use'](_0xd542('0x2a'),require(_0xd542('0x2b')));_0xa239dd['use'](_0xd542('0x2c'),require(_0xd542('0x2d')));_0xa239dd[_0xd542('0x9')](_0xd542('0x2e'),require(_0xd542('0x2f')));_0xa239dd[_0xd542('0x9')]('/api/voice/agents/reports',require(_0xd542('0x30')));_0xa239dd['use'](_0xd542('0x31'),require(_0xd542('0x32')));_0xa239dd[_0xd542('0x9')](_0xd542('0x33'),require(_0xd542('0x34')));_0xa239dd[_0xd542('0x9')](_0xd542('0x35'),require('./api/trunk'));_0xa239dd[_0xd542('0x9')](_0xd542('0x36'),require(_0xd542('0x37')));_0xa239dd['use']('/api/mail/out_servers',require(_0xd542('0x38')));_0xa239dd[_0xd542('0x9')](_0xd542('0x39'),require(_0xd542('0x3a')));_0xa239dd['use'](_0xd542('0x3b'),require('./api/mailQueue'));_0xa239dd[_0xd542('0x9')]('/api/mail/substatuses',require(_0xd542('0x3c')));_0xa239dd['use'](_0xd542('0x3d'),require('./api/mailInteraction'));_0xa239dd[_0xd542('0x9')](_0xd542('0x3e'),require(_0xd542('0x3f')));_0xa239dd[_0xd542('0x9')]('/api/mail/applications',require('./api/mailApplication'));_0xa239dd[_0xd542('0x9')](_0xd542('0x40'),require(_0xd542('0x41')));_0xa239dd['use']('/api/dashboards',require(_0xd542('0x42')));_0xa239dd['use'](_0xd542('0x43'),require(_0xd542('0x44')));_0xa239dd['use'](_0xd542('0x45'),require(_0xd542('0x46')));_0xa239dd[_0xd542('0x9')]('/api/fax/applications',require(_0xd542('0x47')));_0xa239dd[_0xd542('0x9')](_0xd542('0x48'),require(_0xd542('0x49')));_0xa239dd[_0xd542('0x9')]('/api/fax/messages',require('./api/faxMessage'));_0xa239dd[_0xd542('0x9')](_0xd542('0x4a'),require('./api/faxQueue'));_0xa239dd[_0xd542('0x9')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0xa239dd[_0xd542('0x9')](_0xd542('0x4b'),require('./api/smsAccount'));_0xa239dd[_0xd542('0x9')](_0xd542('0x4c'),require(_0xd542('0x4d')));_0xa239dd[_0xd542('0x9')](_0xd542('0x4e'),require('./api/smsInteraction'));_0xa239dd[_0xd542('0x9')](_0xd542('0x4f'),require(_0xd542('0x50')));_0xa239dd[_0xd542('0x9')](_0xd542('0x51'),require(_0xd542('0x52')));_0xa239dd[_0xd542('0x9')](_0xd542('0x53'),require(_0xd542('0x54')));_0xa239dd[_0xd542('0x9')](_0xd542('0x55'),require('./api/openchannelApplication'));_0xa239dd['use'](_0xd542('0x56'),require(_0xd542('0x57')));_0xa239dd[_0xd542('0x9')]('/api/openchannel/messages',require(_0xd542('0x58')));_0xa239dd['use'](_0xd542('0x59'),require(_0xd542('0x5a')));_0xa239dd[_0xd542('0x9')]('/api/chat/websites',require(_0xd542('0x5b')));_0xa239dd[_0xd542('0x9')](_0xd542('0x5c'),require('./api/openchannelQueueReport'));_0xa239dd[_0xd542('0x9')](_0xd542('0x5d'),require(_0xd542('0x5e')));_0xa239dd[_0xd542('0x9')]('/api/chat/interactions',require(_0xd542('0x5f')));_0xa239dd[_0xd542('0x9')](_0xd542('0x60'),require(_0xd542('0x61')));_0xa239dd[_0xd542('0x9')]('/api/chat/offline_messages',require(_0xd542('0x62')));_0xa239dd['use'](_0xd542('0x63'),require(_0xd542('0x64')));_0xa239dd[_0xd542('0x9')](_0xd542('0x65'),require('./api/chatGroup'));_0xa239dd[_0xd542('0x9')](_0xd542('0x66'),require(_0xd542('0x67')));_0xa239dd[_0xd542('0x9')](_0xd542('0x68'),require(_0xd542('0x69')));_0xa239dd[_0xd542('0x9')](_0xd542('0x6a'),require(_0xd542('0x6b')));_0xa239dd[_0xd542('0x9')]('/api/cm/hopper',require(_0xd542('0x6c')));_0xa239dd[_0xd542('0x9')](_0xd542('0x6d'),require(_0xd542('0x6e')));_0xa239dd[_0xd542('0x9')](_0xd542('0x6f'),require(_0xd542('0x70')));_0xa239dd['use']('/api/cm/hopper_history',require(_0xd542('0x71')));_0xa239dd[_0xd542('0x9')](_0xd542('0x72'),require(_0xd542('0x73')));_0xa239dd[_0xd542('0x9')]('/api/actions',require(_0xd542('0x74')));_0xa239dd['use']('/api/automations',require(_0xd542('0x75')));_0xa239dd[_0xd542('0x9')](_0xd542('0x76'),require(_0xd542('0x77')));_0xa239dd[_0xd542('0x9')](_0xd542('0x78'),require(_0xd542('0x79')));_0xa239dd[_0xd542('0x9')](_0xd542('0x7a'),require(_0xd542('0x7b')));_0xa239dd[_0xd542('0x9')](_0xd542('0x7c'),require('./api/interval'));_0xa239dd[_0xd542('0x9')](_0xd542('0x7d'),require('./api/pause'));_0xa239dd[_0xd542('0x9')](_0xd542('0x7e'),require(_0xd542('0x7f')));_0xa239dd[_0xd542('0x9')]('/api/voiceQueuesLog',require(_0xd542('0x80')));_0xa239dd['use'](_0xd542('0x81'),require(_0xd542('0x82')));_0xa239dd[_0xd542('0x9')](_0xd542('0x83'),require(_0xd542('0x84')));_0xa239dd[_0xd542('0x9')](_0xd542('0x85'),require('./api/tag'));_0xa239dd[_0xd542('0x9')](_0xd542('0x86'),require('./api/template'));_0xa239dd['use'](_0xd542('0x87'),require('./api/trigger'));_0xa239dd[_0xd542('0x9')](_0xd542('0x88'),require(_0xd542('0x89')));_0xa239dd[_0xd542('0x9')](_0xd542('0x8a'),require(_0xd542('0x8b')));_0xa239dd[_0xd542('0x9')]('/api/integrations/reports',require('./api/integrationReport'));_0xa239dd['use']('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0xa239dd[_0xd542('0x9')](_0xd542('0x8c'),require(_0xd542('0x8d')));_0xa239dd[_0xd542('0x9')](_0xd542('0x8e'),require(_0xd542('0x8f')));_0xa239dd[_0xd542('0x9')](_0xd542('0x90'),require(_0xd542('0x91')));_0xa239dd[_0xd542('0x9')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0xa239dd['use'](_0xd542('0x92'),require(_0xd542('0x93')));_0xa239dd[_0xd542('0x9')](_0xd542('0x94'),require(_0xd542('0x95')));_0xa239dd[_0xd542('0x9')](_0xd542('0x96'),require('./api/intSalesforceConfiguration'));_0xa239dd[_0xd542('0x9')](_0xd542('0x97'),require(_0xd542('0x98')));_0xa239dd['use']('/api/integrations/sugarcrm/accounts',require(_0xd542('0x99')));_0xa239dd[_0xd542('0x9')](_0xd542('0x9a'),require(_0xd542('0x9b')));_0xa239dd[_0xd542('0x9')](_0xd542('0x9c'),require(_0xd542('0x9d')));_0xa239dd['use'](_0xd542('0x9e'),require('./api/intDeskAccount'));_0xa239dd[_0xd542('0x9')](_0xd542('0x9f'),require(_0xd542('0xa0')));_0xa239dd['use'](_0xd542('0xa1'),require(_0xd542('0xa2')));_0xa239dd[_0xd542('0x9')](_0xd542('0xa3'),require(_0xd542('0xa4')));_0xa239dd[_0xd542('0x9')](_0xd542('0xa5'),require(_0xd542('0xa6')));_0xa239dd[_0xd542('0x9')](_0xd542('0xa7'),require(_0xd542('0xa8')));_0xa239dd[_0xd542('0x9')]('/api/integrations/zendesk/accounts',require(_0xd542('0xa9')));_0xa239dd[_0xd542('0x9')]('/api/integrations/zendesk/configurations',require(_0xd542('0xaa')));_0xa239dd[_0xd542('0x9')](_0xd542('0xab'),require('./api/intZendeskField'));_0xa239dd[_0xd542('0x9')]('/api/integrations/freshdesk/accounts',require(_0xd542('0xac')));_0xa239dd['use'](_0xd542('0xad'),require(_0xd542('0xae')));_0xa239dd[_0xd542('0x9')]('/api/integrations/freshdesk/fields',require(_0xd542('0xaf')));_0xa239dd[_0xd542('0x9')](_0xd542('0xb0'),require(_0xd542('0xb1')));_0xa239dd['use']('/api/integrations/vtiger/configurations',require(_0xd542('0xb2')));_0xa239dd['use'](_0xd542('0xb3'),require('./api/intVtigerField'));_0xa239dd[_0xd542('0x9')](_0xd542('0xb4'),require(_0xd542('0xb5')));_0xa239dd[_0xd542('0x9')]('/api/integrations/servicenow/configurations',require(_0xd542('0xb6')));_0xa239dd[_0xd542('0x9')](_0xd542('0xb7'),require('./api/intServicenowField'));_0xa239dd['use'](_0xd542('0xb8'),require(_0xd542('0xb9')));_0xa239dd[_0xd542('0x9')](_0xd542('0xba'),require('./api/intDynamics365Configuration'));_0xa239dd[_0xd542('0x9')](_0xd542('0xbb'),require(_0xd542('0xbc')));_0xa239dd['use'](_0xd542('0xbd'),require('./api/intFreshsalesAccount'));_0xa239dd[_0xd542('0x9')](_0xd542('0xbe'),require(_0xd542('0xbf')));_0xa239dd['use'](_0xd542('0xc0'),require('./api/intFreshsalesField'));_0xa239dd[_0xd542('0x9')](_0xd542('0xc1'),require(_0xd542('0xc2')));_0xa239dd[_0xd542('0x9')](_0xd542('0xc3'),require('./api/chatQueueReport'));_0xa239dd[_0xd542('0x9')]('/api/chat/internal/messages',require(_0xd542('0xc4')));_0xa239dd[_0xd542('0x9')](_0xd542('0xc5'),require('./api/jscriptyAnswerReport'));_0xa239dd[_0xd542('0x9')]('/api/jscripty/questions/reports',require(_0xd542('0xc6')));_0xa239dd['use'](_0xd542('0xc7'),require(_0xd542('0xc8')));_0xa239dd[_0xd542('0x9')](_0xd542('0xc9'),require(_0xd542('0xca')));_0xa239dd[_0xd542('0x9')](_0xd542('0xcb'),require(_0xd542('0xcc')));_0xa239dd[_0xd542('0x9')](_0xd542('0xcd'),require(_0xd542('0xce')));_0xa239dd[_0xd542('0x9')](_0xd542('0xcf'),require(_0xd542('0xd0')));_0xa239dd['use'](_0xd542('0xd1'),require('./api/setting'));_0xa239dd['use'](_0xd542('0xd2'),require(_0xd542('0xd3')));_0xa239dd[_0xd542('0x9')](_0xd542('0xd4'),require(_0xd542('0xd5')));_0xa239dd['use'](_0xd542('0xd6'),require(_0xd542('0xd7')));_0xa239dd[_0xd542('0x9')](_0xd542('0xd8'),require(_0xd542('0xd9')));_0xa239dd[_0xd542('0x9')](_0xd542('0xda'),require(_0xd542('0xdb')));_0xa239dd[_0xd542('0x9')](_0xd542('0xdc'),require('./api/license'));_0xa239dd[_0xd542('0x9')](_0xd542('0xdd'),require(_0xd542('0xde')));_0xa239dd[_0xd542('0x9')](_0xd542('0xdf'),require(_0xd542('0xe0')));_0xa239dd[_0xd542('0x9')]('/api/attachments',require(_0xd542('0xe1')));_0xa239dd[_0xd542('0x9')]('/api/plugins',require(_0xd542('0xe2')));_0xa239dd['use'](_0xd542('0xe3'),require('./api/mailTransferReport'));_0xa239dd[_0xd542('0x9')](_0xd542('0xe4'),require(_0xd542('0xe5')));_0xa239dd[_0xd542('0x9')](_0xd542('0xe6'),require(_0xd542('0xe7')));_0xa239dd['use'](_0xd542('0xe8'),require('./api/openchannelTransferReport'));_0xa239dd[_0xd542('0x9')](_0xd542('0xe9'),require('./api/smsTransferReport'));_0xa239dd['use'](_0xd542('0xea'),require(_0xd542('0xeb')));_0xa239dd[_0xd542('0x9')](_0xd542('0xec'),require('./api/voicePrefix'));_0xa239dd[_0xd542('0x9')]('/api/userProfiles',require(_0xd542('0xed')));_0xa239dd[_0xd542('0x9')](_0xd542('0xee'),require(_0xd542('0xef')));_0xa239dd['use'](_0xd542('0xf0'),require(_0xd542('0xf1')));_0xa239dd[_0xd542('0x9')](_0xd542('0xf2'),require('./api/authLocal'));_0xa239dd[_0xd542('0x9')]('/api/auth/google',require(_0xd542('0xf3')));_0xa239dd[_0xd542('0x9')](_0xd542('0xf4'),require(_0xd542('0xf5')));_0xa239dd[_0xd542('0x9')]('/api/rpc',require('./api/rpc'));_0xa239dd[_0xd542('0x9')]('/api/version',require(_0xd542('0xf6')));_0xa239dd[_0xd542('0x9')](_0xd542('0xf7'),require(_0xd542('0xf8')));_0xa239dd[_0xd542('0x9')](_0xd542('0xf9'),require(_0xd542('0xfa')));_0xa239dd[_0xd542('0x9')](_0xd542('0xfb'),express[_0xd542('0xfc')](path['join'](config[_0xd542('0xfd')],_0xd542('0xfb'))));_0xa239dd[_0xd542('0x9')](_0xd542('0xfe'),express[_0xd542('0xfc')](path[_0xd542('0xff')](config[_0xd542('0xfd')],_0xd542('0xfe'))));_0xa239dd[_0xd542('0x9')](_0xd542('0x100'),express[_0xd542('0xfc')](path[_0xd542('0xff')](config['root'],'/demo')));_0xa239dd[_0xd542('0x9')](_0xd542('0x101'),express[_0xd542('0xfc')](path[_0xd542('0xff')](config[_0xd542('0xfd')],_0xd542('0x102'),'1.0.16')));_0xa239dd[_0xd542('0x9')](_0xd542('0x103'),express[_0xd542('0xfc')](path['join'](config['root'],'/server/files/plugins')));_0xa239dd[_0xd542('0x104')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xd542('0x105')](errors[0x194]);_0xa239dd[_0xd542('0x104')]('/*')['get'](function(_0x201ec6,_0x4e76ce){_0x4e76ce['sendFile'](path[_0xd542('0x106')](_0xa239dd[_0xd542('0x105')](_0xd542('0x107'))+'/index.html'));});}; \ No newline at end of file +var _0xefd1=['/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','/api/chat/proactive_actions','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/pause','/api/cdr','./api/cdr','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/auth/local','./api/authLocal','/api/jira','./api/jira','./api/rpc','./api/version','/api/system','./api/pm2','/apidoc','static','join','root','/www','/demo','/snippet','snippet','1.0.16','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','resolve','/index.html','path','express-winston','util','./errors','./config/logger','api','auth','default','use','logger','format','method','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','headers','name','other','agent_id','agent_name','test','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','./api/screenRecording','./api/voiceMail','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue'];(function(_0x3bd5c1,_0x2af194){var _0xd0f143=function(_0x30f078){while(--_0x30f078){_0x3bd5c1['push'](_0x3bd5c1['shift']());}};_0xd0f143(++_0x2af194);}(_0xefd1,0xaa));var _0x1efd=function(_0x2b84f7,_0x3eeb07){_0x2b84f7=_0x2b84f7-0x0;var _0x18f7f1=_0xefd1[_0x2b84f7];return _0x18f7f1;};'use strict';var path=require(_0x1efd('0x0'));var express=require('express');var ewinston=require(_0x1efd('0x1'));var util=require(_0x1efd('0x2'));var errors=require(_0x1efd('0x3'));var config=require('./config/environment');var logger=require(_0x1efd('0x4'))(_0x1efd('0x5'));var authLogger=require(_0x1efd('0x4'))(_0x1efd('0x6'));exports[_0x1efd('0x7')]=function(_0x59ed0f){_0x59ed0f[_0x1efd('0x8')](ewinston[_0x1efd('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3416a2,_0x1c7cb3){return util[_0x1efd('0xa')]('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x3416a2[_0x1efd('0xb')],_0x3416a2['headers'][_0x1efd('0xc')]?_0x3416a2['headers'][_0x1efd('0xc')]:_0x3416a2[_0x1efd('0xd')][_0x1efd('0xe')]||_0x3416a2['ip'],_0x3416a2[_0x1efd('0xf')],_0x1c7cb3[_0x1efd('0x10')],_0x1c7cb3[_0x1efd('0x11')],_0x3416a2[_0x1efd('0x12')]?_0x3416a2[_0x1efd('0x12')]['id']:null,_0x3416a2[_0x1efd('0x12')]?_0x3416a2[_0x1efd('0x12')]['name']:null,_0x3416a2[_0x1efd('0x12')]?_0x3416a2[_0x1efd('0x12')][_0x1efd('0x13')]:null);}}));_0x59ed0f['use'](ewinston[_0x1efd('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x105616,_0x5487f7){var _0x61d2a6=_0x1efd('0x14');if(_0x105616[_0x1efd('0x15')]&&_0x105616[_0x1efd('0x15')][_0x1efd('0x16')]&&_0x105616[_0x1efd('0x15')]['agent_id']){_0x61d2a6=_0x1efd('0x17');}return util[_0x1efd('0xa')](_0x61d2a6,_0x105616[_0x1efd('0xb')],_0x105616[_0x1efd('0x18')]['x-forwarded-for']?_0x105616[_0x1efd('0x18')][_0x1efd('0xc')]:_0x105616[_0x1efd('0xd')]['remoteAddress']||_0x105616['ip'],_0x105616[_0x1efd('0xf')],_0x5487f7[_0x1efd('0x10')],_0x5487f7['responseTime'],_0x105616[_0x1efd('0x12')]?_0x105616['user']['id']:null,_0x105616[_0x1efd('0x12')]?_0x105616['user'][_0x1efd('0x19')]:null,_0x105616['user']?_0x105616[_0x1efd('0x12')][_0x1efd('0x13')]:null,_0x105616[_0x1efd('0x15')]&&_0x105616[_0x1efd('0x15')][_0x1efd('0x16')]?_0x105616[_0x1efd('0x15')]['device']:_0x1efd('0x1a'),_0x105616[_0x1efd('0x15')]&&_0x105616['body'][_0x1efd('0x1b')]?_0x105616[_0x1efd('0x15')][_0x1efd('0x1b')]:'',_0x105616[_0x1efd('0x15')]&&_0x105616[_0x1efd('0x15')][_0x1efd('0x1c')]?_0x105616[_0x1efd('0x15')]['agent_name']:'');},'ignoreRoute':function(_0x42c3de){var _0xcdb98d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xcdb98d[_0x1efd('0x1d')](_0x42c3de[_0x1efd('0xf')]);}}));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x1e'),require(_0x1efd('0x1f')));_0x59ed0f['use']('/api/voice/chanspy',require(_0x1efd('0x20')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x21'),require('./api/voiceContext'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x22'),require('./api/voiceExtension'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x23'),require(_0x1efd('0x24')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x25'),require(_0x1efd('0x26')));_0x59ed0f['use']('/api/voice/recordings',require(_0x1efd('0x27')));_0x59ed0f[_0x1efd('0x8')]('/api/screen/recordings',require(_0x1efd('0x28')));_0x59ed0f[_0x1efd('0x8')]('/api/voice/mails',require(_0x1efd('0x29')));_0x59ed0f[_0x1efd('0x8')]('/api/voice/mails/messages',require(_0x1efd('0x2a')));_0x59ed0f[_0x1efd('0x8')]('/api/voice/calls/reports',require(_0x1efd('0x2b')));_0x59ed0f['use'](_0x1efd('0x2c'),require(_0x1efd('0x2d')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x2e'),require(_0x1efd('0x2f')));_0x59ed0f['use'](_0x1efd('0x30'),require(_0x1efd('0x31')));_0x59ed0f['use'](_0x1efd('0x32'),require(_0x1efd('0x33')));_0x59ed0f['use']('/api/trunks',require('./api/trunk'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x34'),require(_0x1efd('0x35')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x36'),require(_0x1efd('0x37')));_0x59ed0f['use'](_0x1efd('0x38'),require(_0x1efd('0x39')));_0x59ed0f['use'](_0x1efd('0x3a'),require(_0x1efd('0x3b')));_0x59ed0f[_0x1efd('0x8')]('/api/mail/substatuses',require(_0x1efd('0x3c')));_0x59ed0f['use'](_0x1efd('0x3d'),require(_0x1efd('0x3e')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x3f'),require(_0x1efd('0x40')));_0x59ed0f[_0x1efd('0x8')]('/api/mail/applications',require(_0x1efd('0x41')));_0x59ed0f['use'](_0x1efd('0x42'),require(_0x1efd('0x43')));_0x59ed0f[_0x1efd('0x8')]('/api/dashboards',require(_0x1efd('0x44')));_0x59ed0f['use']('/api/dashboards/items',require(_0x1efd('0x45')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x46'),require(_0x1efd('0x47')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x48'),require(_0x1efd('0x49')));_0x59ed0f[_0x1efd('0x8')]('/api/fax/interactions',require(_0x1efd('0x4a')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x4b'),require(_0x1efd('0x4c')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x4d'),require(_0x1efd('0x4e')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x4f'),require(_0x1efd('0x50')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x51'),require(_0x1efd('0x52')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x53'),require(_0x1efd('0x54')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x55'),require(_0x1efd('0x56')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x57'),require(_0x1efd('0x58')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x59'),require(_0x1efd('0x5a')));_0x59ed0f['use'](_0x1efd('0x5b'),require('./api/openchannelAccount'));_0x59ed0f['use'](_0x1efd('0x5c'),require('./api/openchannelApplication'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x5d'),require('./api/openchannelInteraction'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x5e'),require(_0x1efd('0x5f')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x60'),require(_0x1efd('0x61')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x62'),require(_0x1efd('0x63')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x64'),require('./api/openchannelQueueReport'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x65'),require(_0x1efd('0x66')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x67'),require('./api/chatInteraction'));_0x59ed0f['use'](_0x1efd('0x68'),require(_0x1efd('0x69')));_0x59ed0f['use'](_0x1efd('0x6a'),require(_0x1efd('0x6b')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x6c'),require('./api/chatQueue'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x6d'),require('./api/chatGroup'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x6e'),require('./api/chatProactiveAction'));_0x59ed0f[_0x1efd('0x8')]('/api/cm/companies',require(_0x1efd('0x6f')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x70'),require(_0x1efd('0x71')));_0x59ed0f[_0x1efd('0x8')]('/api/cm/hopper',require(_0x1efd('0x72')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x73'),require('./api/cmHopperBlack'));_0x59ed0f['use']('/api/cm/hopper_final',require(_0x1efd('0x74')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x75'),require(_0x1efd('0x76')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x77'),require('./api/cmCustomField'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x78'),require('./api/action'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x79'),require(_0x1efd('0x7a')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x7b'),require(_0x1efd('0x7c')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x7d'),require(_0x1efd('0x7e')));_0x59ed0f['use']('/api/conditions',require(_0x1efd('0x7f')));_0x59ed0f['use'](_0x1efd('0x80'),require('./api/interval'));_0x59ed0f[_0x1efd('0x8')]('/api/pauses',require(_0x1efd('0x81')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x82'),require(_0x1efd('0x83')));_0x59ed0f[_0x1efd('0x8')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x84'),require(_0x1efd('0x85')));_0x59ed0f['use'](_0x1efd('0x86'),require(_0x1efd('0x87')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x88'),require('./api/tag'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x89'),require(_0x1efd('0x8a')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x8b'),require(_0x1efd('0x8c')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x8d'),require(_0x1efd('0x8e')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x8f'),require(_0x1efd('0x90')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x91'),require(_0x1efd('0x92')));_0x59ed0f[_0x1efd('0x8')]('/api/analytics/custom_reports',require(_0x1efd('0x93')));_0x59ed0f[_0x1efd('0x8')]('/api/analytics/default_reports',require(_0x1efd('0x94')));_0x59ed0f['use'](_0x1efd('0x95'),require(_0x1efd('0x96')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x97'),require('./api/analyticMetric'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x98'),require(_0x1efd('0x99')));_0x59ed0f['use'](_0x1efd('0x9a'),require('./api/analyticTreeReport'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x9b'),require('./api/intSalesforceAccount'));_0x59ed0f['use'](_0x1efd('0x9c'),require(_0x1efd('0x9d')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x9e'),require(_0x1efd('0x9f')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xa0'),require(_0x1efd('0xa1')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xa2'),require('./api/intSugarcrmConfiguration'));_0x59ed0f['use'](_0x1efd('0xa3'),require('./api/intSugarcrmField'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xa4'),require(_0x1efd('0xa5')));_0x59ed0f['use'](_0x1efd('0xa6'),require(_0x1efd('0xa7')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xa8'),require(_0x1efd('0xa9')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xaa'),require(_0x1efd('0xab')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xac'),require(_0x1efd('0xad')));_0x59ed0f['use'](_0x1efd('0xae'),require(_0x1efd('0xaf')));_0x59ed0f['use'](_0x1efd('0xb0'),require('./api/intZendeskAccount'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xb1'),require('./api/intZendeskConfiguration'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xb2'),require('./api/intZendeskField'));_0x59ed0f[_0x1efd('0x8')]('/api/integrations/freshdesk/accounts',require(_0x1efd('0xb3')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xb4'),require(_0x1efd('0xb5')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xb6'),require('./api/intFreshdeskField'));_0x59ed0f[_0x1efd('0x8')]('/api/integrations/vtiger/accounts',require(_0x1efd('0xb7')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xb8'),require(_0x1efd('0xb9')));_0x59ed0f[_0x1efd('0x8')]('/api/integrations/vtiger/fields',require(_0x1efd('0xba')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xbb'),require('./api/intServicenowAccount'));_0x59ed0f['use'](_0x1efd('0xbc'),require(_0x1efd('0xbd')));_0x59ed0f[_0x1efd('0x8')]('/api/integrations/servicenow/fields',require(_0x1efd('0xbe')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xbf'),require('./api/intDynamics365Account'));_0x59ed0f['use'](_0x1efd('0xc0'),require(_0x1efd('0xc1')));_0x59ed0f[_0x1efd('0x8')]('/api/integrations/dynamics365/fields',require(_0x1efd('0xc2')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xc3'),require(_0x1efd('0xc4')));_0x59ed0f[_0x1efd('0x8')]('/api/integrations/freshsales/configurations',require(_0x1efd('0xc5')));_0x59ed0f[_0x1efd('0x8')]('/api/integrations/freshsales/fields',require(_0x1efd('0xc6')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xc7'),require(_0x1efd('0xc8')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xc9'),require(_0x1efd('0xca')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xcb'),require('./api/chatInternalMessage'));_0x59ed0f['use']('/api/jscripty/answers/reports',require(_0x1efd('0xcc')));_0x59ed0f['use'](_0x1efd('0xcd'),require('./api/jscriptyQuestionReport'));_0x59ed0f['use'](_0x1efd('0xce'),require(_0x1efd('0xcf')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xd0'),require('./api/smsQueueReport'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xd1'),require('./api/squareReport'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xd2'),require('./api/squareReportDetail'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xd3'),require(_0x1efd('0xd4')));_0x59ed0f[_0x1efd('0x8')]('/api/settings',require(_0x1efd('0xd5')));_0x59ed0f[_0x1efd('0x8')]('/api/square/odbc',require('./api/squareOdbc'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xd6'),require(_0x1efd('0xd7')));_0x59ed0f['use'](_0x1efd('0xd8'),require(_0x1efd('0xd9')));_0x59ed0f['use'](_0x1efd('0xda'),require(_0x1efd('0xdb')));_0x59ed0f[_0x1efd('0x8')]('/api/teams',require('./api/team'));_0x59ed0f['use'](_0x1efd('0xdc'),require(_0x1efd('0xdd')));_0x59ed0f[_0x1efd('0x8')]('/api/campaigns',require(_0x1efd('0xde')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xdf'),require(_0x1efd('0xe0')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xe1'),require(_0x1efd('0xe2')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xe3'),require(_0x1efd('0xe4')));_0x59ed0f['use']('/api/mail/reports/transfer',require(_0x1efd('0xe5')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xe6'),require(_0x1efd('0xe7')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xe8'),require(_0x1efd('0xe9')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xea'),require(_0x1efd('0xeb')));_0x59ed0f['use'](_0x1efd('0xec'),require(_0x1efd('0xed')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xee'),require(_0x1efd('0xef')));_0x59ed0f['use'](_0x1efd('0xf0'),require(_0x1efd('0xf1')));_0x59ed0f['use'](_0x1efd('0xf2'),require(_0x1efd('0xf3')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xf4'),require(_0x1efd('0xf5')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xf6'),require('./api/userProfileResource'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xf7'),require(_0x1efd('0xf8')));_0x59ed0f[_0x1efd('0x8')]('/api/auth/google',require('./api/authGoogle'));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xf9'),require(_0x1efd('0xfa')));_0x59ed0f[_0x1efd('0x8')]('/api/rpc',require(_0x1efd('0xfb')));_0x59ed0f[_0x1efd('0x8')]('/api/version',require(_0x1efd('0xfc')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xfd'),require('./api/system'));_0x59ed0f[_0x1efd('0x8')]('/api/pm2',require(_0x1efd('0xfe')));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0xff'),express[_0x1efd('0x100')](path[_0x1efd('0x101')](config[_0x1efd('0x102')],_0x1efd('0xff'))));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x103'),express[_0x1efd('0x100')](path[_0x1efd('0x101')](config['root'],_0x1efd('0x103'))));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x104'),express[_0x1efd('0x100')](path['join'](config[_0x1efd('0x102')],_0x1efd('0x104'))));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x105'),express[_0x1efd('0x100')](path[_0x1efd('0x101')](config[_0x1efd('0x102')],_0x1efd('0x106'),_0x1efd('0x107'))));_0x59ed0f[_0x1efd('0x8')](_0x1efd('0x108'),express[_0x1efd('0x100')](path[_0x1efd('0x101')](config[_0x1efd('0x102')],_0x1efd('0x109'))));_0x59ed0f['route'](_0x1efd('0x10a'))[_0x1efd('0x10b')](errors[0x194]);_0x59ed0f[_0x1efd('0x10c')]('/*')[_0x1efd('0x10b')](function(_0x205026,_0x5e1a79){_0x5e1a79['sendFile'](path[_0x1efd('0x10d')](_0x59ed0f[_0x1efd('0x10b')]('appPath')+_0x1efd('0x10e')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 5cbf31d..76c8261 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc28=['../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/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','server','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc'];(function(_0x4dfc73,_0x5ac130){var _0x3c107f=function(_0x180c91){while(--_0x180c91){_0x4dfc73['push'](_0x4dfc73['shift']());}};_0x3c107f(++_0x5ac130);}(_0xbc28,0x136));var _0x8bc2=function(_0x3c00b3,_0x2a4ce2){_0x3c00b3=_0x3c00b3-0x0;var _0xf5da78=_0xbc28[_0x3c00b3];return _0xf5da78;};'use strict';var jayson=require(_0x8bc2('0x0'));var BPromise=require(_0x8bc2('0x1'));var _=require(_0x8bc2('0x2'));var config=require('../config/environment');exports[_0x8bc2('0x3')]=function(){return new BPromise(function(_0x5e433e,_0x49a9ae){var _0x18d676={};_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require('../api/user/user.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x5')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x6')));_0x18d676=_['merge'](_0x18d676,require(_0x8bc2('0x7')));_0x18d676=_['merge'](_0x18d676,require(_0x8bc2('0x8')));_0x18d676=_['merge'](_0x18d676,require(_0x8bc2('0x9')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0xa')));_0x18d676=_['merge'](_0x18d676,require(_0x8bc2('0xb')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0xc')));_0x18d676=_['merge'](_0x18d676,require(_0x8bc2('0xd')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0xe')));_0x18d676=_['merge'](_0x18d676,require(_0x8bc2('0xf')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x10')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x11')));_0x18d676=_['merge'](_0x18d676,require('../api/mailQueue/mailQueue.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require('../api/mailInteraction/mailInteraction.rpc'));_0x18d676=_['merge'](_0x18d676,require('../api/mailMessage/mailMessage.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x12')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x13')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x14')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x15')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x16')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x17')));_0x18d676=_['merge'](_0x18d676,require(_0x8bc2('0x18')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x19')));_0x18d676=_['merge'](_0x18d676,require('../api/smsAccount/smsAccount.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x1a')));_0x18d676=_['merge'](_0x18d676,require(_0x8bc2('0x1b')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x1c')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x1d')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x1e')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x1f')));_0x18d676=_['merge'](_0x18d676,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x20')));_0x18d676=_['merge'](_0x18d676,require('../api/chatInteraction/chatInteraction.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x21')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require('../api/chatQueue/chatQueue.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x22')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x23')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x24')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x25')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x26')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x27')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x28')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x29')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x2a')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x2b')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require('../api/variable/variable.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x18d676=_['merge'](_0x18d676,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x2c')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x2d')));_0x18d676=_['merge'](_0x18d676,require(_0x8bc2('0x2e')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x2f')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x30')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x31')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x32')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x33')));_0x18d676=_['merge'](_0x18d676,require(_0x8bc2('0x34')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require(_0x8bc2('0x35')));_0x18d676=_[_0x8bc2('0x4')](_0x18d676,require('../api/plugin/plugin.rpc'));var _0x16e027=jayson[_0x8bc2('0x36')](_0x18d676)[_0x8bc2('0x37')]();var _0x18074f=config[_0x8bc2('0x38')][_0x8bc2('0x39')]||config['port']+0x1;var _0x4b5295=config[_0x8bc2('0x38')]['ip']||_0x8bc2('0x3a');_0x16e027['on'](_0x8bc2('0x3b'),function(_0x28a14e){return _0x49a9ae(_0x28a14e);});_0x16e027[_0x8bc2('0x3')](_0x18074f,_0x4b5295,function(){console['log'](_0x8bc2('0x3c'),_0x4b5295,_0x18074f);require(_0x8bc2('0x3d'))[_0x8bc2('0x3e')]();return _0x5e433e(_0x8bc2('0x3f')+_0x4b5295+':'+_0x18074f);});});}; \ No newline at end of file +var _0x596b=['../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.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/mailMessage/mailMessage.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc'];(function(_0x5071e4,_0x3f6b7a){var _0x2df8b0=function(_0x22adc9){while(--_0x22adc9){_0x5071e4['push'](_0x5071e4['shift']());}};_0x2df8b0(++_0x3f6b7a);}(_0x596b,0x178));var _0xb596=function(_0x566966,_0x6d1752){_0x566966=_0x566966-0x0;var _0x10ae12=_0x596b[_0x566966];return _0x10ae12;};'use strict';var jayson=require(_0xb596('0x0'));var BPromise=require(_0xb596('0x1'));var _=require('lodash');var config=require(_0xb596('0x2'));exports[_0xb596('0x3')]=function(){return new BPromise(function(_0x103bf6,_0x367aa6){var _0x5fb1a0={};_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x5')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x6')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x7')));_0x5fb1a0=_['merge'](_0x5fb1a0,require(_0xb596('0x8')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x9')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0xa')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0xb')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0xc')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0xd')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0xe')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0xf')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x10')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x11')));_0x5fb1a0=_['merge'](_0x5fb1a0,require('../api/mailQueue/mailQueue.rpc'));_0x5fb1a0=_['merge'](_0x5fb1a0,require('../api/mailInteraction/mailInteraction.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x12')));_0x5fb1a0=_['merge'](_0x5fb1a0,require('../api/mailApplication/mailApplication.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x13')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x14')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x15')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x16')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x17')));_0x5fb1a0=_['merge'](_0x5fb1a0,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x18')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require('../api/smsInteraction/smsInteraction.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x19')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require('../api/smsQueue/smsQueue.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x1a')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x1b')));_0x5fb1a0=_['merge'](_0x5fb1a0,require(_0xb596('0x1c')));_0x5fb1a0=_['merge'](_0x5fb1a0,require('../api/chatInteraction/chatInteraction.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require('../api/chatMessage/chatMessage.rpc'));_0x5fb1a0=_['merge'](_0x5fb1a0,require('../api/chatQueue/chatQueue.rpc'));_0x5fb1a0=_['merge'](_0x5fb1a0,require(_0xb596('0x1d')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require('../api/cmHopper/cmHopper.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x1e')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x5fb1a0=_['merge'](_0x5fb1a0,require(_0xb596('0x1f')));_0x5fb1a0=_['merge'](_0x5fb1a0,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x20')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x21')));_0x5fb1a0=_['merge'](_0x5fb1a0,require('../api/sound/sound.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x22')));_0x5fb1a0=_['merge'](_0x5fb1a0,require(_0xb596('0x23')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x24')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x25')));_0x5fb1a0=_['merge'](_0x5fb1a0,require(_0xb596('0x26')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x27')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x28')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x29')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x2a')));_0x5fb1a0=_['merge'](_0x5fb1a0,require(_0xb596('0x2b')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x2c')));_0x5fb1a0=_['merge'](_0x5fb1a0,require(_0xb596('0x2d')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x2e')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x2f')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x30')));_0x5fb1a0=_['merge'](_0x5fb1a0,require(_0xb596('0x31')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require('../api/squareOdbc/squareOdbc.rpc'));_0x5fb1a0=_['merge'](_0x5fb1a0,require(_0xb596('0x32')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require('../api/squareRecording/squareRecording.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x33')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require('../api/campaign/campaign.rpc'));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x34')));_0x5fb1a0=_[_0xb596('0x4')](_0x5fb1a0,require(_0xb596('0x35')));var _0x4ec69b=jayson[_0xb596('0x36')](_0x5fb1a0)[_0xb596('0x37')]();var _0x30c116=config[_0xb596('0x38')][_0xb596('0x39')]||config[_0xb596('0x39')]+0x1;var _0x1cb513=config['rpc']['ip']||_0xb596('0x3a');_0x4ec69b['on']('error',function(_0x269eea){return _0x367aa6(_0x269eea);});_0x4ec69b[_0xb596('0x3')](_0x30c116,_0x1cb513,function(){console[_0xb596('0x3b')](_0xb596('0x3c'),_0x1cb513,_0x30c116);require(_0xb596('0x3d'))[_0xb596('0x3e')]();return _0x103bf6(_0xb596('0x3f')+_0x1cb513+':'+_0x30c116);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index e278526..614808d 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 _0x70e0=['format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./error','setEncoding','utf8','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','substr','indexOf','length','match','error','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','command','sync','answer','getData','sendRequest'];(function(_0x3934ec,_0x23d510){var _0x1816ab=function(_0x38f6b5){while(--_0x38f6b5){_0x3934ec['push'](_0x3934ec['shift']());}};_0x1816ab(++_0x23d510);}(_0x70e0,0x17b));var _0x070e=function(_0x5817fc,_0x23d45e){_0x5817fc=_0x5817fc-0x0;var _0x5b13a4=_0x70e0[_0x5817fc];return _0x5b13a4;};'use strict';var util=require(_0x070e('0x0'));var _=require(_0x070e('0x1'));var EventEmitter=require(_0x070e('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x070e('0x3'));function AGIChannel(_0xee173){var _0x277d32=this,_0x2593e5=new AGIReply(),_0x5c90fc=![],_0x7bce9b={};EventEmitter['call'](_0x277d32);_0xee173[_0x070e('0x4')]('utf8');_0xee173['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x2593e5['setEncoding'](_0x070e('0x5'));_0x2593e5['on'](_0x070e('0x6'),function(_0x604664){for(var _0x2611e6 in _0x604664){_0x277d32[_0x2611e6]=_0x604664[_0x2611e6];}_0x277d32[_0x070e('0x7')](_0x070e('0x8'));});_0x2593e5['on'](_0x070e('0x9'),function(_0x4e99e6){if(_0x4e99e6['toLowerCase']()==_0x070e('0xa')){_0x277d32[_0x070e('0x7')](_0x070e('0xa'));return;}if(_0x4e99e6[_0x070e('0xb')](0x0,0xb)==_0x070e('0xc')){_0x5c90fc=!![];}if(_0x5c90fc){_0x7bce9b['rx']+=_0x4e99e6+'\x0a';if(_0x4e99e6[_0x070e('0xd')](_0x070e('0xe'))!=-0x1){_0x5c90fc=![];}}else{_0x7bce9b['rx']=_0x4e99e6;}if(_0x5c90fc){return;}if(typeof _0x7bce9b['cb']==_0x070e('0xf')){var _0x39d2b9=_0x7bce9b['rx']['substring'](0x0,0x3),_0x5bf079=null,_0x2930b8=null;_0x39d2b9=parseInt(_0x39d2b9);if(isNaN(_0x39d2b9)){_0x7bce9b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x39d2b9!=0xc8){_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':-0x1,'extra':'KO'});return;}_0x5bf079=_0x7bce9b['rx'][_0x070e('0xb')](0x4)['replace']('result=','');if(_0x5bf079['indexOf']('\x20')!=-0x1){_0x5bf079=_0x5bf079[_0x070e('0x10')](0x0,_0x5bf079[_0x070e('0x11')]('\x20'));}if(_['startsWith'](_0x5bf079,'-1')){_0x5bf079=parseInt(_0x5bf079);}_0x2930b8=_0x7bce9b['rx']['split']('\x20');if(_0x2930b8[_0x070e('0x12')]==0x3){_0x2930b8=_0x2930b8[0x2][_0x070e('0xb')](0x1,_0x2930b8[0x2][_0x070e('0x12')]-0x1);}else if(_0x2930b8[_0x070e('0x12')]>0x3){var _0x5bc71e=/\((.+)\)/;var _0x49861b=_0x7bce9b['rx'][_0x070e('0x13')](_0x5bc71e);if(_0x49861b){_0x2930b8=_0x49861b[0x1];}else{_0x2930b8=null;}}else{_0x2930b8=null;}_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':_0x5bf079,'extra':_0x2930b8});}});_0xee173['on'](_0x070e('0x14'),function(_0x38f6e6){_0x277d32[_0x070e('0x7')](_0x070e('0x14'),new AGIError('E_AGI_SOCKET_ERROR',_0x38f6e6[_0x070e('0x15')]));});_0xee173['on'](_0x070e('0x16'),function(){_0x277d32[_0x070e('0x7')](_0x070e('0x16'),new AGIError(_0x070e('0x17')));});_0xee173['on']('timeout',function(){_0x277d32['emit']('timeout',new AGIError(_0x070e('0x18')));_0xee173[_0x070e('0x19')]();});_0xee173[_0x070e('0x1a')](_0x2593e5);this['command']=function(_0x5b184,_0x5dc5d2){var _0x5b184=_0x5b184||'',_0x5dc5d2=typeof _0x5dc5d2==_0x070e('0xf')?_0x5dc5d2:new Function();_0x7bce9b={'tx':_0x5b184,'rx':'','cb':_0x5dc5d2};_0xee173[_0x070e('0x1b')](_0x5b184+'\x0a');},this[_0x070e('0x16')]=function(){_0xee173[_0x070e('0x19')]();};}util[_0x070e('0x1c')](AGIChannel,EventEmitter);AGIChannel[_0x070e('0x1d')]['sendRequest']=function(_0x2f8055){return this[_0x070e('0x1e')][_0x070e('0x1f')](this,_0x2f8055);};AGIChannel['prototype'][_0x070e('0x20')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x070e('0x1d')][_0x070e('0x21')]=function(_0x41deb1,_0x1743cc,_0x4763c6){_0x41deb1=_0x41deb1===undefined?'beep':_0x41deb1;_0x1743cc=_0x1743cc===undefined?'5':_0x1743cc;_0x4763c6=_0x4763c6===undefined?'1':_0x4763c6;return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x24'),_0x41deb1,_0x1743cc*0x3e8,_0x4763c6));};AGIChannel[_0x070e('0x1d')][_0x070e('0x25')]=function(_0x28d7f2){_0x28d7f2=_0x28d7f2||_0x070e('0x26');return this[_0x070e('0x22')](util['format'](_0x070e('0x27'),_0x28d7f2));};AGIChannel[_0x070e('0x1d')][_0x070e('0x28')]=function(_0x56fc12,_0x5c5f0d){if(_[_0x070e('0x29')](_0x5c5f0d)){return this[_0x070e('0x22')](util[_0x070e('0x23')]('EXEC\x20%s\x20%s',_0x56fc12,_0x5c5f0d[_0x070e('0x2a')](',')));}return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2b'),_0x56fc12,_0x5c5f0d));};AGIChannel['prototype']['setContext']=function(_0x523b75){return this['sendRequest'](util[_0x070e('0x23')]('SET\x20CONTEXT\x20%s',_0x523b75));};AGIChannel[_0x070e('0x1d')][_0x070e('0x2c')]=function(_0x4f8130){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x2d'),_0x4f8130));};AGIChannel['prototype']['setPriority']=function(_0x41ade4){return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2e'),_0x41ade4));};AGIChannel[_0x070e('0x1d')]['hangup']=function(){return this['sendRequest'](_0x070e('0x2f'));};AGIChannel[_0x070e('0x1d')][_0x070e('0x30')]=function(_0xf57ed,_0xf11439){var _0x4deaf8=_[_0x070e('0x31')](_0xf11439)||_[_0x070e('0x32')](_0xf11439)?_0xf11439['toString']():_0xf11439;return this[_0x070e('0x22')](util[_0x070e('0x23')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0xf57ed,_0x4deaf8?_0x4deaf8['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x070e('0x1d')][_0x070e('0x33')]=function(_0x39dfaa,_0x334733){return this[_0x070e('0x22')](util['format'](_0x070e('0x34'),_0x39dfaa,_0x334733));};AGIChannel[_0x070e('0x1d')][_0x070e('0x35')]=function(_0x487276,_0x268c5d){return this[_0x070e('0x22')](util[_0x070e('0x23')]('SAY\x20DIGITS\x20%s\x20%s',_0x487276,_0x268c5d));};AGIChannel[_0x070e('0x1d')][_0x070e('0x36')]=function(_0x4800a9,_0x173602){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x37'),_0x4800a9,_0x173602));};AGIChannel[_0x070e('0x1d')][_0x070e('0x38')]=function(_0xd03404,_0x47b929,_0xd18220){_0x47b929=_0x47b929||this['extension'];_0xd18220=_0xd18220||0x1;this['setContext'](_0xd03404);this[_0x070e('0x2c')](_0x47b929);this[_0x070e('0x39')](_0xd18220);return this[_0x070e('0x25')](util['format'](_0x070e('0x3a'),_0xd03404,_0x47b929,_0xd18220));};AGIChannel[_0x070e('0x1d')][_0x070e('0x3b')]=function(_0x7dc240){return this['sendRequest'](util[_0x070e('0x23')]('GET\x20VARIABLE\x20\x22%s\x22',_0x7dc240));};AGIChannel['prototype']['recordFile']=function(_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x34f23e,_0x562aa4){_0x926533=_0x926533||_0x070e('0x3c');_0x26b3e2=_0x26b3e2||'';_0x29dccd=_0x29dccd===undefined?-0x1:_0x29dccd==='-1'?-0x1:_0x29dccd*0x3e8;_0x34f23e=_0x34f23e===undefined?'':'s='+_0x34f23e;_0x562aa4=_0x562aa4?'BEEP':'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3d'),_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x562aa4,_0x34f23e));};AGIChannel['prototype']['streamFile']=function(_0x261a27,_0x5ee4b8){_0x5ee4b8=_0x5ee4b8||'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3e'),_0x261a27,_0x5ee4b8));};AGIChannel['prototype'][_0x070e('0x3f')]=function(_0x20a1ee){return this['exec']('AGI',_0x20a1ee);};AGIChannel[_0x070e('0x1d')][_0x070e('0x40')]=function(_0x2d43ce){return this[_0x070e('0x28')](_0x070e('0x41'),_0x2d43ce);};AGIChannel['prototype'][_0x070e('0x14')]=function(_0x3f6c64,_0x427fa7){this[_0x070e('0x25')](util[_0x070e('0x23')](_0x070e('0x42'),_0x3f6c64['id'],_0x3f6c64[_0x070e('0x43')],_0x427fa7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x070e('0x44')]=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(_0x40d3e4,_0xa19beb){var _0x3f432c=function(_0x152c3c){while(--_0x152c3c){_0x40d3e4['push'](_0x40d3e4['shift']());}};_0x3f432c(++_0xa19beb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 9177ac6..8695e24 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 _0x01d3=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x2aeb58,_0x575b09){var _0x1f5acc=function(_0x31c0e1){while(--_0x31c0e1){_0x2aeb58['push'](_0x2aeb58['shift']());}};_0x1f5acc(++_0x575b09);}(_0x01d3,0xdb));var _0x301d=function(_0x35b516,_0x251c15){_0x35b516=_0x35b516-0x0;var _0x1e6efe=_0x01d3[_0x35b516];return _0x1e6efe;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x301d('0x0'),'E_AGI_SERVER_ERROR':_0x301d('0x1'),'E_AGI_SERVER_CLOSE':_0x301d('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x301d('0x3'),'E_AGI_SOCKET_ERROR':_0x301d('0x4'),'E_AGI_SOCKET_CLOSE':_0x301d('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x301d('0x6'),'E_AGI_COMMAND_EMPTY':_0x301d('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x301d('0x8')};function AGIError(_0x3b1992){var _0x3b1992=_0x3b1992||null,_0x30e89e=_0x30e89e||[],_0x12b21b=0x1,_0x49a253='';if(!error[_0x3b1992]){_0x3b1992=_0x301d('0x9');}_0x30e89e[_0x301d('0xa')](error[_0x3b1992]);while(arguments[_0x12b21b]){_0x30e89e[_0x301d('0xa')](arguments[_0x12b21b]);_0x12b21b++;}_0x49a253=util[_0x301d('0xb')][_0x301d('0xc')](util,_0x30e89e);this[_0x301d('0xd')]=_0x49a253;this[_0x301d('0xe')]=_0x3b1992;}module[_0x301d('0xf')]=AGIError; \ No newline at end of file +var _0x6aa0=['name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','message'];(function(_0x41f96e,_0x333851){var _0x48a4ac=function(_0xdad934){while(--_0xdad934){_0x41f96e['push'](_0x41f96e['shift']());}};_0x48a4ac(++_0x333851);}(_0x6aa0,0xb8));var _0x06aa=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x6aa0[_0x3430aa];return _0x2ac5c;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x06aa('0x0'),'E_AGI_ARGUMENT_PORT':_0x06aa('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x06aa('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x06aa('0x3'),'E_AGI_SOCKET_ERROR':_0x06aa('0x4'),'E_AGI_SOCKET_CLOSE':_0x06aa('0x5'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x06aa('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x06aa('0x7'),'E_AGI_IVR_ENTRY':_0x06aa('0x8')};function AGIError(_0x15ae67){var _0x15ae67=_0x15ae67||null,_0x52918d=_0x52918d||[],_0x309c1d=0x1,_0xd605f9='';if(!error[_0x15ae67]){_0x15ae67='E_AGI_UNDEFINED';}_0x52918d[_0x06aa('0x9')](error[_0x15ae67]);while(arguments[_0x309c1d]){_0x52918d[_0x06aa('0x9')](arguments[_0x309c1d]);_0x309c1d++;}_0xd605f9=util['format']['apply'](util,_0x52918d);this[_0x06aa('0xa')]=_0xd605f9;this[_0x06aa('0xb')]=_0x15ae67;}module[_0x06aa('0xc')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 87c1669..f9723ce 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 _0x4b0f=['edges','numberOfEdges','prototype','addVertex','addEdge','push','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','vswitch','target','default','agicommand','invalid','default\x20on\x20switch\x20not\x20found','exports','../../../config/logger','agi','menu','getsecretdigits','vertices'];(function(_0x6c2af5,_0x311348){var _0xf06e4d=function(_0x145384){while(--_0x145384){_0x6c2af5['push'](_0x6c2af5['shift']());}};_0xf06e4d(++_0x311348);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x346047,_0x4b6669){_0x346047=_0x346047-0x0;var _0x536fed=_0x4b0f[_0x346047];return _0x536fed;};'use strict';var _=require('lodash');var logger=require(_0xf4b0('0x0'))(_0xf4b0('0x1'));var verticesWithRetry=[_0xf4b0('0x2'),'getdigits',_0xf4b0('0x3')];var Graph=function(){this[_0xf4b0('0x4')]={};this[_0xf4b0('0x5')]={};this[_0xf4b0('0x6')]=0x0;};Graph[_0xf4b0('0x7')][_0xf4b0('0x8')]=function(_0x3c0f87){this[_0xf4b0('0x4')][_0x3c0f87['id']]=_0x3c0f87;this[_0xf4b0('0x5')][_0x3c0f87['id']]=[];};Graph[_0xf4b0('0x7')][_0xf4b0('0x9')]=function(_0x35160f,_0x3a2236,_0xd132d8){this[_0xf4b0('0x5')][_0x35160f][_0xf4b0('0xa')]({'target':_0x3a2236,'condition':_0xd132d8});this['numberOfEdges']+=0x1;};Graph[_0xf4b0('0x7')][_0xf4b0('0xb')]=function(){return _[_0xf4b0('0xb')](this[_0xf4b0('0x4')]);};Graph[_0xf4b0('0x7')][_0xf4b0('0xc')]=function(){return this[_0xf4b0('0x6')];};Graph[_0xf4b0('0x7')][_0xf4b0('0xd')]=function(_0x16bd65){return this[_0xf4b0('0x4')][_0x16bd65];};Graph[_0xf4b0('0x7')][_0xf4b0('0xe')]=function(_0x12480f,_0x86a245){if(!this[_0xf4b0('0x4')][_0x12480f]){return logger[_0xf4b0('0xf')](_0xf4b0('0x10'));}var _0x3aa005=_0x86a245(this[_0xf4b0('0x4')][_0x12480f]);if(!_0x3aa005){return logger[_0xf4b0('0xf')](_0xf4b0('0x11'));}if(this['edges'][_0x12480f][_0xf4b0('0x12')]===0x0){return logger[_0xf4b0('0xf')](_0xf4b0('0x13'));}for(var _0x54991b=0x0,_0x252835=[],_0x1f2d74=![];_0x54991b\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]','finally','./server','listening','connection','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','defaults','127.0.0.1','nextTick','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','error','format','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','calleridname','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','evtHangup','mxGraphModel','root','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','source','target','addEdge','value','getSquareProject','then','createSquareReport','catch','indexOf','agi_','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe5b3,0x133));var _0x3e5b=function(_0x3ff4a3,_0xa5bfa6){_0x3ff4a3=_0x3ff4a3-0x0;var _0x38676f=_0xe5b3[_0x3ff4a3];return _0x38676f;};'use strict';var parser=require('xml2json');var _=require(_0x3e5b('0x0'));var syncho=require(_0x3e5b('0x1'));var util=require(_0x3e5b('0x2'));var moment=require(_0x3e5b('0x3'));var config=require(_0x3e5b('0x4'));var logger=require(_0x3e5b('0x5'))(_0x3e5b('0x6'));var utilLicense=require(_0x3e5b('0x7'));var rpc=require(_0x3e5b('0x8'));var mailRpc=require(_0x3e5b('0x9'));var Graph=require(_0x3e5b('0xa'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x3e5b('0x6')]=_[_0x3e5b('0xb')](config['agi'],{'ip':_0x3e5b('0xc'),'port':0x11dd});function connectionHandler(_0x3901c2){process[_0x3e5b('0xd')](function(){syncho(function(){try{setChannelVariables(_0x3901c2);agiHandler(_0x3901c2);}catch(_0x113d38){logger['error'](_0x113d38['stack']);}});});}function listeningHandler(){console[_0x3e5b('0xe')](_0x3e5b('0xf'),config[_0x3e5b('0x6')][_0x3e5b('0x10')]);logger[_0x3e5b('0x11')](util['format'](_0x3e5b('0x12'),config['agi']['ip'],config[_0x3e5b('0x6')][_0x3e5b('0x10')]));}function errorHandler(_0x4d69dd){if(_0x4d69dd&&_0x4d69dd[_0x3e5b('0x13')]&&_0x4d69dd[_0x3e5b('0x14')]){logger[_0x3e5b('0x15')](util[_0x3e5b('0x16')]('[%s]\x20%s',_0x4d69dd[_0x3e5b('0x13')],_0x4d69dd['message']));}else{logger['error'](util['format'](_0x3e5b('0x17'),_0x4d69dd[_0x3e5b('0x18')]));}}function closeHandler(){logger[_0x3e5b('0x11')](util['format'](_0x3e5b('0x19'),this['arg_1'],this['calleridname'],this[_0x3e5b('0x1a')],this[_0x3e5b('0x1b')],this['uniqueid']));try{createSquareReport(this);}catch(_0x3d58a4){logger[_0x3e5b('0x15')](_0x3d58a4['stack']);}}function timeoutHandler(){logger[_0x3e5b('0x11')](util[_0x3e5b('0x16')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x3e5b('0x1c')],this[_0x3e5b('0x1a')],this[_0x3e5b('0x1b')],this[_0x3e5b('0x1d')]));}function hangupHandler(){logger[_0x3e5b('0x11')](util[_0x3e5b('0x16')](_0x3e5b('0x1e'),this[_0x3e5b('0x1f')],this[_0x3e5b('0x1c')],this[_0x3e5b('0x1a')],this[_0x3e5b('0x1b')],this[_0x3e5b('0x1d')]));this[_0x3e5b('0x20')]=!![];}function getRoot(_0x402873){return parser['toJson'](_0x402873,{'object':!![]})[_0x3e5b('0x21')][_0x3e5b('0x22')];}function addVertex(_0x2146d4,_0x150674,_0x50039b){_0x150674[_0x3e5b('0x23')]=_0x50039b;if(_0x150674['hasOwnProperty'](_0x3e5b('0x24'))){_0x150674[_0x3e5b('0x25')]=parseInt(_0x150674['retry'],0xa);}_0x2146d4[_0x3e5b('0x26')](_[_0x3e5b('0x27')](_0x150674,_0x3e5b('0x28')));}function initGraph(_0x3c8965,_0x3bb749){var _0x26c7f2=new Graph();for(var _0x160e87 in _0x3c8965){if(_0x3c8965[_0x3e5b('0x29')](_0x160e87)){if(_['isArray'](_0x3c8965[_0x160e87])){for(var _0x1c7278=0x0;_0x1c7278<_0x3c8965[_0x160e87]['length'];_0x1c7278+=0x1){addVertex(_0x26c7f2,_0x3c8965[_0x160e87][_0x1c7278],_0x160e87);}}else{addVertex(_0x26c7f2,_0x3c8965[_0x160e87],_0x160e87);}}}for(var _0xb70ab4=0x0;_0xb70ab4<_0x3bb749['length'];_0xb70ab4+=0x1){if(_0x3bb749[_0xb70ab4][_0x3e5b('0x2a')]&&_0x3bb749[_0xb70ab4][_0x3e5b('0x2b')]){_0x26c7f2[_0x3e5b('0x2c')](_0x3bb749[_0xb70ab4][_0x3e5b('0x2a')],_0x3bb749[_0xb70ab4][_0x3e5b('0x2b')],_0x3bb749[_0xb70ab4][_0x3e5b('0x2d')]);}}return _0x26c7f2;}function getSquareProject(_0x307091,_0x9c2123){rpc[_0x3e5b('0x2e')](_0x307091)[_0x3e5b('0x2f')](function(_0x1e1565){_0x9c2123(null,_0x1e1565);})['catch'](function(_0x21bc10){_0x9c2123(null,_0x21bc10);});}function createSquareReport(_0x1882aa,_0xa8760b){rpc[_0x3e5b('0x30')](_0x1882aa)[_0x3e5b('0x2f')](function(_0x31e9f9){if(_0xa8760b){_0xa8760b(null,_0x31e9f9);}})[_0x3e5b('0x31')](function(_0x4c4e01){if(_0xa8760b){_0xa8760b(null,_0x4c4e01);}});}function setChannelVariables(_0x33f089){for(var _0x56a527 in _0x33f089){if(_0x33f089['hasOwnProperty'](_0x56a527)){if(_0x56a527[_0x3e5b('0x32')](_0x3e5b('0x33'))===0x0){_0x33f089[_0x56a527['substring'](0x4)]=_0x33f089[_0x56a527];delete _0x33f089[_0x56a527];}}}}function getLogFromObject(_0x40e37d){return util[_0x3e5b('0x34')](_0x40e37d,{'showHidden':![],'depth':null});}function agiHandler(_0x9d01c4){var _0x33e356,_0x1f3162,_0x26f842,_0x3b3046,_0x26c9ab;logger[_0x3e5b('0x35')](_0x3e5b('0x36'),JSON[_0x3e5b('0x37')](_0x9d01c4,null,0x2));logger[_0x3e5b('0x11')](util['format'](_0x3e5b('0x38'),_0x9d01c4[_0x3e5b('0x1f')],_0x9d01c4['calleridname'],_0x9d01c4['callerid'],_0x9d01c4[_0x3e5b('0x1b')],_0x9d01c4['uniqueid']));_0x9d01c4['on'](_0x3e5b('0x15'),errorHandler);_0x9d01c4['on'](_0x3e5b('0x39'),closeHandler);_0x9d01c4['on'](_0x3e5b('0x3a'),timeoutHandler);_0x9d01c4[_0x3e5b('0x20')]=![];_0x9d01c4['on']('hangup',hangupHandler);var _0x18b07f=getSquareProject['sync'](null,_0x9d01c4[_0x3e5b('0x1f')]);if(_0x18b07f){if(_0x18b07f['production']){_0x33e356=getRoot(_0x18b07f['production']);if(_0x33e356&&_0x33e356['start']){logger[_0x3e5b('0x35')](_0x3e5b('0x22'),JSON[_0x3e5b('0x37')](_0x33e356,null,0x2));_0x9d01c4[_0x3e5b('0x3b')]=moment()[_0x3e5b('0x16')](_0x3e5b('0x3c'));_0x1f3162=initGraph(_['omit'](_0x33e356,'mxCell'),_0x33e356['mxCell']);_0x26f842=new Vertices(_0x9d01c4,rpc,mailRpc);logger['info'](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x9d01c4['arg_1'],_0x9d01c4[_0x3e5b('0x1c')],_0x9d01c4[_0x3e5b('0x1a')],_0x9d01c4[_0x3e5b('0x1b')],_0x9d01c4[_0x3e5b('0x1d')]));_0x1f3162[_0x3e5b('0x3d')](_0x33e356[_0x3e5b('0x3e')]['id'],function(_0x2c56bc){try{_0x2c56bc=_0x26f842[_0x3e5b('0x3f')](_0x2c56bc);logger[_0x3e5b('0x35')](_0x3e5b('0x40'),JSON[_0x3e5b('0x37')](_0x2c56bc,null,0x2));if(_0x2c56bc['agicommand']===_0x3e5b('0x41')){logger[_0x3e5b('0x11')](_0x3e5b('0x42'));_0x9d01c4[_0x3e5b('0x43')]=_0x2c56bc[_0x3e5b('0x43')]||_0x9d01c4[_0x3e5b('0x43')];_0x9d01c4[_0x3e5b('0x44')]=_0x2c56bc[_0x3e5b('0x44')];_0x9d01c4[_0x3e5b('0x45')]=_0x2c56bc[_0x3e5b('0x45')]?_0x2c56bc[_0x3e5b('0x45')]-0x1:0x1;return null;}else if(_0x2c56bc&&_0x26f842[_0x2c56bc['agicommand']]){_0x26c9ab=_0x26f842[_0x2c56bc['agicommand']](_0x2c56bc);logger['info']('response',JSON[_0x3e5b('0x37')](_0x26c9ab,null,0x2));if(_0x26c9ab&&_0x26c9ab[_0x3e5b('0x46')]===AGI_CODE_SUCCESS&&_0x26c9ab[_0x3e5b('0x47')]!==AGI_RESULT_ERROR&&!_0x9d01c4[_0x3e5b('0x20')]){logger[_0x3e5b('0x35')](_0x3e5b('0x48'),getLogFromObject(_0x26c9ab));return _[_0x3e5b('0x49')](_0x26c9ab[_0x3e5b('0x47')])?null:_0x26c9ab[_0x3e5b('0x47')][_0x3e5b('0x4a')]();}else{logger['error'](_0x3e5b('0x48'),getLogFromObject(_0x26c9ab));return null;}}else{logger[_0x3e5b('0x15')](_0x3e5b('0x4b'));return null;}}catch(_0x22d495){logger[_0x3e5b('0x15')](_0x22d495['stack']);return null;}});if(_0x33e356['finally']){logger['info'](util[_0x3e5b('0x16')](_0x3e5b('0x4c'),_0x9d01c4[_0x3e5b('0x1f')],_0x9d01c4['calleridname'],_0x9d01c4['callerid'],_0x9d01c4[_0x3e5b('0x1b')],_0x9d01c4[_0x3e5b('0x1d')]));_0x1f3162[_0x3e5b('0x3d')](_0x33e356['finally']['id'],function(_0x514501){try{_0x514501=_0x26f842[_0x3e5b('0x3f')](_0x514501);logger['debug'](_0x3e5b('0x40'),JSON[_0x3e5b('0x37')](_0x514501,null,0x2));if(_0x514501&&_0x26f842[_0x514501[_0x3e5b('0x23')]]){_0x26c9ab=_0x26f842[_0x514501[_0x3e5b('0x23')]](_0x514501);if(_0x26c9ab){logger[_0x3e5b('0x35')](_0x3e5b('0x48'),getLogFromObject(_0x26c9ab));return _[_0x3e5b('0x49')](_0x26c9ab[_0x3e5b('0x47')])?null:_0x26c9ab[_0x3e5b('0x47')]['toString']();}else{logger[_0x3e5b('0x15')]('response',getLogFromObject(_0x26c9ab));return null;}}else{logger[_0x3e5b('0x15')](_0x3e5b('0x4b'));return null;}}catch(_0x26e11e){logger[_0x3e5b('0x15')](_0x26e11e[_0x3e5b('0x18')]);return null;}});}logger[_0x3e5b('0x11')](util[_0x3e5b('0x16')](_0x3e5b('0x4d'),_0x9d01c4[_0x3e5b('0x1f')],_0x9d01c4[_0x3e5b('0x1c')],_0x9d01c4[_0x3e5b('0x1a')],_0x9d01c4[_0x3e5b('0x1b')],_0x9d01c4[_0x3e5b('0x1d')]));logger['info'](util[_0x3e5b('0x16')](_0x3e5b('0x4e'),_0x9d01c4[_0x3e5b('0x43')],_0x9d01c4[_0x3e5b('0x44')],parseInt(_0x9d01c4[_0x3e5b('0x45')],0xa)+0x1));_0x9d01c4[_0x3e5b('0x4f')](_0x9d01c4['context'],_0x9d01c4[_0x3e5b('0x44')],parseInt(_0x9d01c4[_0x3e5b('0x45')],0xa)+0x1);_0x9d01c4[_0x3e5b('0x39')]();}}else{logger[_0x3e5b('0x15')](util[_0x3e5b('0x16')](_0x3e5b('0x50'),_0x9d01c4[_0x3e5b('0x1f')]));_0x9d01c4[_0x3e5b('0x4f')](_0x9d01c4['context'],_0x9d01c4[_0x3e5b('0x44')],parseInt(_0x9d01c4['priority'],0xa)+0x1);_0x9d01c4['close']();}}else{logger[_0x3e5b('0x15')](util['format'](_0x3e5b('0x51'),_0x9d01c4[_0x3e5b('0x1f')]));_0x9d01c4[_0x3e5b('0x4f')](_0x9d01c4[_0x3e5b('0x43')],_0x9d01c4['extension'],parseInt(_0x9d01c4['priority'],0xa)+0x1);_0x9d01c4['close']();}}function main(){var _0x581b94;return utilLicense[_0x3e5b('0x52')]()[_0x3e5b('0x2f')](function(_0x1ea02a){if(_0x1ea02a){if(_0x1ea02a[_0x3e5b('0x53')]){if(_0x1ea02a[_0x3e5b('0x54')]&&_0x1ea02a['callysquare']>0x0){logger['info'](util[_0x3e5b('0x16')](_0x3e5b('0x55'),_0x1ea02a[_0x3e5b('0x54')]));_0x581b94=_0x1ea02a[_0x3e5b('0x54')];}else{logger[_0x3e5b('0x11')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x581b94=-0x1;}}})['catch'](function(_0x3563b0){logger[_0x3e5b('0x15')](_0x3e5b('0x56'),_0x3563b0[_0x3e5b('0x18')]);})[_0x3e5b('0x57')](function(){var _0x24087b=require(_0x3e5b('0x58'))(config[_0x3e5b('0x6')]['port'],config[_0x3e5b('0x6')]['ip'],_0x581b94);_0x24087b['on'](_0x3e5b('0x15'),errorHandler);_0x24087b['on'](_0x3e5b('0x59'),listeningHandler);_0x24087b['on'](_0x3e5b('0x5a'),connectionHandler);_0x24087b['on'](_0x3e5b('0x39'),closeHandler);});}main(); \ No newline at end of file +var _0xd58c=['./server','port','listening','connection','xml2json','lodash','syncho','moment','../../config/logger','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','agi','127.0.0.1','nextTick','stack','log','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','error','[%s]\x20%s','name','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','agicommand','hasOwnProperty','retry','maxRetry','mxCell','isArray','length','target','source','value','then','catch','agi_','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','sync','production','start','debug','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','gotoc','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','vertex','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]'];(function(_0x4b2a5c,_0x29b5eb){var _0xed6e3c=function(_0x476514){while(--_0x476514){_0x4b2a5c['push'](_0x4b2a5c['shift']());}};_0xed6e3c(++_0x29b5eb);}(_0xd58c,0xb6));var _0xcd58=function(_0x527f2a,_0x33c012){_0x527f2a=_0x527f2a-0x0;var _0x1a48a9=_0xd58c[_0x527f2a];return _0x1a48a9;};'use strict';var parser=require(_0xcd58('0x0'));var _=require(_0xcd58('0x1'));var syncho=require(_0xcd58('0x2'));var util=require('util');var moment=require(_0xcd58('0x3'));var config=require('../../config/environment');var logger=require(_0xcd58('0x4'))('agi');var utilLicense=require(_0xcd58('0x5'));var rpc=require(_0xcd58('0x6'));var mailRpc=require(_0xcd58('0x7'));var Graph=require(_0xcd58('0x8'));var Vertices=require(_0xcd58('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0xcd58('0xa')],{'ip':_0xcd58('0xb'),'port':0x11dd});function connectionHandler(_0x43a501){process[_0xcd58('0xc')](function(){syncho(function(){try{setChannelVariables(_0x43a501);agiHandler(_0x43a501);}catch(_0x37a864){logger['error'](_0x37a864[_0xcd58('0xd')]);}});});}function listeningHandler(){console[_0xcd58('0xe')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xcd58('0xa')]['port']);logger[_0xcd58('0xf')](util[_0xcd58('0x10')](_0xcd58('0x11'),config['agi']['ip'],config[_0xcd58('0xa')]['port']));}function errorHandler(_0x2a17d4){if(_0x2a17d4&&_0x2a17d4['name']&&_0x2a17d4[_0xcd58('0x12')]){logger[_0xcd58('0x13')](util[_0xcd58('0x10')](_0xcd58('0x14'),_0x2a17d4[_0xcd58('0x15')],_0x2a17d4[_0xcd58('0x12')]));}else{logger[_0xcd58('0x13')](util[_0xcd58('0x10')]('[ERROR]\x20%s',_0x2a17d4['stack']));}}function closeHandler(){logger[_0xcd58('0xf')](util[_0xcd58('0x10')](_0xcd58('0x16'),this['arg_1'],this['calleridname'],this[_0xcd58('0x17')],this[_0xcd58('0x18')],this[_0xcd58('0x19')]));try{createSquareReport(this);}catch(_0x4d6afd){logger['error'](_0x4d6afd[_0xcd58('0xd')]);}}function timeoutHandler(){logger['info'](util[_0xcd58('0x10')](_0xcd58('0x1a'),this[_0xcd58('0x1b')],this[_0xcd58('0x1c')],this['callerid'],this[_0xcd58('0x18')],this['uniqueid']));}function hangupHandler(){logger['info'](util['format'](_0xcd58('0x1d'),this[_0xcd58('0x1b')],this[_0xcd58('0x1c')],this['callerid'],this[_0xcd58('0x18')],this[_0xcd58('0x19')]));this['evtHangup']=!![];}function getRoot(_0x18f953){return parser[_0xcd58('0x1e')](_0x18f953,{'object':!![]})[_0xcd58('0x1f')]['root'];}function addVertex(_0x566d56,_0x2592a1,_0x3eae55){_0x2592a1[_0xcd58('0x20')]=_0x3eae55;if(_0x2592a1[_0xcd58('0x21')](_0xcd58('0x22'))){_0x2592a1[_0xcd58('0x23')]=parseInt(_0x2592a1[_0xcd58('0x22')],0xa);}_0x566d56['addVertex'](_['omit'](_0x2592a1,_0xcd58('0x24')));}function initGraph(_0xaa4a53,_0x481fa1){var _0x22fc56=new Graph();for(var _0x580c2b in _0xaa4a53){if(_0xaa4a53[_0xcd58('0x21')](_0x580c2b)){if(_[_0xcd58('0x25')](_0xaa4a53[_0x580c2b])){for(var _0x75bb8e=0x0;_0x75bb8e<_0xaa4a53[_0x580c2b][_0xcd58('0x26')];_0x75bb8e+=0x1){addVertex(_0x22fc56,_0xaa4a53[_0x580c2b][_0x75bb8e],_0x580c2b);}}else{addVertex(_0x22fc56,_0xaa4a53[_0x580c2b],_0x580c2b);}}}for(var _0x2b64b8=0x0;_0x2b64b8<_0x481fa1[_0xcd58('0x26')];_0x2b64b8+=0x1){if(_0x481fa1[_0x2b64b8]['source']&&_0x481fa1[_0x2b64b8][_0xcd58('0x27')]){_0x22fc56['addEdge'](_0x481fa1[_0x2b64b8][_0xcd58('0x28')],_0x481fa1[_0x2b64b8]['target'],_0x481fa1[_0x2b64b8][_0xcd58('0x29')]);}}return _0x22fc56;}function getSquareProject(_0x55c551,_0x3499c4){rpc['getSquareProject'](_0x55c551)[_0xcd58('0x2a')](function(_0x5871da){_0x3499c4(null,_0x5871da);})[_0xcd58('0x2b')](function(_0xcf21b5){_0x3499c4(null,_0xcf21b5);});}function createSquareReport(_0x554de0,_0x26badd){rpc['createSquareReport'](_0x554de0)[_0xcd58('0x2a')](function(_0x3852c8){if(_0x26badd){_0x26badd(null,_0x3852c8);}})[_0xcd58('0x2b')](function(_0x1b1c67){if(_0x26badd){_0x26badd(null,_0x1b1c67);}});}function setChannelVariables(_0x1b979d){for(var _0x184b20 in _0x1b979d){if(_0x1b979d['hasOwnProperty'](_0x184b20)){if(_0x184b20['indexOf'](_0xcd58('0x2c'))===0x0){_0x1b979d[_0x184b20['substring'](0x4)]=_0x1b979d[_0x184b20];delete _0x1b979d[_0x184b20];}}}}function getLogFromObject(_0x4baddc){return util[_0xcd58('0x2d')](_0x4baddc,{'showHidden':![],'depth':null});}function agiHandler(_0x3ef48e){var _0x2bfbec,_0x151cb6,_0xd5fc97,_0x194771,_0x536c21;logger['debug'](_0xcd58('0x2e'),JSON[_0xcd58('0x2f')](_0x3ef48e,null,0x2));logger[_0xcd58('0xf')](util['format'](_0xcd58('0x30'),_0x3ef48e[_0xcd58('0x1b')],_0x3ef48e[_0xcd58('0x1c')],_0x3ef48e['callerid'],_0x3ef48e['dnid'],_0x3ef48e[_0xcd58('0x19')]));_0x3ef48e['on'](_0xcd58('0x13'),errorHandler);_0x3ef48e['on'](_0xcd58('0x31'),closeHandler);_0x3ef48e['on'](_0xcd58('0x32'),timeoutHandler);_0x3ef48e[_0xcd58('0x33')]=![];_0x3ef48e['on'](_0xcd58('0x34'),hangupHandler);var _0x1fa80f=getSquareProject[_0xcd58('0x35')](null,_0x3ef48e[_0xcd58('0x1b')]);if(_0x1fa80f){if(_0x1fa80f[_0xcd58('0x36')]){_0x2bfbec=getRoot(_0x1fa80f[_0xcd58('0x36')]);if(_0x2bfbec&&_0x2bfbec[_0xcd58('0x37')]){logger[_0xcd58('0x38')](_0xcd58('0x39'),JSON[_0xcd58('0x2f')](_0x2bfbec,null,0x2));_0x3ef48e[_0xcd58('0x3a')]=moment()[_0xcd58('0x10')](_0xcd58('0x3b'));_0x151cb6=initGraph(_[_0xcd58('0x3c')](_0x2bfbec,_0xcd58('0x24')),_0x2bfbec[_0xcd58('0x24')]);_0xd5fc97=new Vertices(_0x3ef48e,rpc,mailRpc);logger['info'](util[_0xcd58('0x10')](_0xcd58('0x3d'),_0x3ef48e[_0xcd58('0x1b')],_0x3ef48e['calleridname'],_0x3ef48e[_0xcd58('0x17')],_0x3ef48e[_0xcd58('0x18')],_0x3ef48e['uniqueid']));_0x151cb6[_0xcd58('0x3e')](_0x2bfbec['start']['id'],function(_0x54b587){try{_0x54b587=_0xd5fc97[_0xcd58('0x3f')](_0x54b587);logger['debug']('vertex',JSON[_0xcd58('0x2f')](_0x54b587,null,0x2));if(_0x54b587[_0xcd58('0x20')]===_0xcd58('0x40')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x3ef48e[_0xcd58('0x41')]=_0x54b587['context']||_0x3ef48e[_0xcd58('0x41')];_0x3ef48e[_0xcd58('0x42')]=_0x54b587['extension'];_0x3ef48e['priority']=_0x54b587[_0xcd58('0x43')]?_0x54b587[_0xcd58('0x43')]-0x1:0x1;return null;}else if(_0x54b587&&_0xd5fc97[_0x54b587[_0xcd58('0x20')]]){_0x536c21=_0xd5fc97[_0x54b587[_0xcd58('0x20')]](_0x54b587);logger[_0xcd58('0xf')](_0xcd58('0x44'),JSON[_0xcd58('0x2f')](_0x536c21,null,0x2));if(_0x536c21&&_0x536c21[_0xcd58('0x45')]===AGI_CODE_SUCCESS&&_0x536c21[_0xcd58('0x46')]!==AGI_RESULT_ERROR&&!_0x3ef48e[_0xcd58('0x33')]){logger[_0xcd58('0x38')](_0xcd58('0x44'),getLogFromObject(_0x536c21));return _[_0xcd58('0x47')](_0x536c21['result'])?null:_0x536c21[_0xcd58('0x46')][_0xcd58('0x48')]();}else{logger[_0xcd58('0x13')]('response',getLogFromObject(_0x536c21));return null;}}else{logger[_0xcd58('0x13')](_0xcd58('0x49'));return null;}}catch(_0x7aced){logger[_0xcd58('0x13')](_0x7aced['stack']);return null;}});if(_0x2bfbec[_0xcd58('0x4a')]){logger[_0xcd58('0xf')](util[_0xcd58('0x10')](_0xcd58('0x4b'),_0x3ef48e[_0xcd58('0x1b')],_0x3ef48e[_0xcd58('0x1c')],_0x3ef48e[_0xcd58('0x17')],_0x3ef48e[_0xcd58('0x18')],_0x3ef48e[_0xcd58('0x19')]));_0x151cb6[_0xcd58('0x3e')](_0x2bfbec['finally']['id'],function(_0x3cd18c){try{_0x3cd18c=_0xd5fc97[_0xcd58('0x3f')](_0x3cd18c);logger[_0xcd58('0x38')](_0xcd58('0x4c'),JSON[_0xcd58('0x2f')](_0x3cd18c,null,0x2));if(_0x3cd18c&&_0xd5fc97[_0x3cd18c[_0xcd58('0x20')]]){_0x536c21=_0xd5fc97[_0x3cd18c[_0xcd58('0x20')]](_0x3cd18c);if(_0x536c21){logger[_0xcd58('0x38')](_0xcd58('0x44'),getLogFromObject(_0x536c21));return _[_0xcd58('0x47')](_0x536c21[_0xcd58('0x46')])?null:_0x536c21[_0xcd58('0x46')]['toString']();}else{logger[_0xcd58('0x13')](_0xcd58('0x44'),getLogFromObject(_0x536c21));return null;}}else{logger['error'](_0xcd58('0x49'));return null;}}catch(_0x2cb2e4){logger[_0xcd58('0x13')](_0x2cb2e4[_0xcd58('0xd')]);return null;}});}logger[_0xcd58('0xf')](util[_0xcd58('0x10')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3ef48e['arg_1'],_0x3ef48e[_0xcd58('0x1c')],_0x3ef48e['callerid'],_0x3ef48e[_0xcd58('0x18')],_0x3ef48e[_0xcd58('0x19')]));logger[_0xcd58('0xf')](util[_0xcd58('0x10')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x3ef48e['context'],_0x3ef48e[_0xcd58('0x42')],parseInt(_0x3ef48e['priority'],0xa)+0x1));_0x3ef48e['continueAt'](_0x3ef48e[_0xcd58('0x41')],_0x3ef48e[_0xcd58('0x42')],parseInt(_0x3ef48e[_0xcd58('0x43')],0xa)+0x1);_0x3ef48e[_0xcd58('0x31')]();}}else{logger['error'](util[_0xcd58('0x10')]('Project\x20%s\x20not\x20published',_0x3ef48e['arg_1']));_0x3ef48e[_0xcd58('0x4d')](_0x3ef48e[_0xcd58('0x41')],_0x3ef48e['extension'],parseInt(_0x3ef48e[_0xcd58('0x43')],0xa)+0x1);_0x3ef48e['close']();}}else{logger[_0xcd58('0x13')](util[_0xcd58('0x10')](_0xcd58('0x4e'),_0x3ef48e[_0xcd58('0x1b')]));_0x3ef48e[_0xcd58('0x4d')](_0x3ef48e[_0xcd58('0x41')],_0x3ef48e[_0xcd58('0x42')],parseInt(_0x3ef48e[_0xcd58('0x43')],0xa)+0x1);_0x3ef48e[_0xcd58('0x31')]();}}function main(){var _0x31826e;return utilLicense[_0xcd58('0x4f')]()[_0xcd58('0x2a')](function(_0x532af6){if(_0x532af6){if(_0x532af6[_0xcd58('0x50')]){if(_0x532af6['callysquare']&&_0x532af6[_0xcd58('0x51')]>0x0){logger[_0xcd58('0xf')](util[_0xcd58('0x10')](_0xcd58('0x52'),_0x532af6['callysquare']));_0x31826e=_0x532af6[_0xcd58('0x51')];}else{logger[_0xcd58('0xf')](_0xcd58('0x53'));}}else{logger[_0xcd58('0xf')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x31826e=-0x1;}}})['catch'](function(_0x2bd97b){logger[_0xcd58('0x13')](_0xcd58('0x54'),_0x2bd97b[_0xcd58('0xd')]);})[_0xcd58('0x4a')](function(){var _0x10cf46=require(_0xcd58('0x55'))(config['agi'][_0xcd58('0x56')],config[_0xcd58('0xa')]['ip'],_0x31826e);_0x10cf46['on'](_0xcd58('0x13'),errorHandler);_0x10cf46['on'](_0xcd58('0x57'),listeningHandler);_0x10cf46['on'](_0xcd58('0x58'),connectionHandler);_0x10cf46['on'](_0xcd58('0x31'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 12d8445..5fbdd14 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 _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x513445,_0x28d5e9){var _0x30159c=function(_0x5c3b04){while(--_0x5c3b04){_0x513445['push'](_0x513445['shift']());}};_0x30159c(++_0x28d5e9);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 +var _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x3d108a,_0x162934){var _0x5572bf=function(_0xf70152){while(--_0xf70152){_0x3d108a['push'](_0x3d108a['shift']());}};_0x5572bf(++_0x162934);}(_0x814b,0x1a2));var _0xb814=function(_0x26df48,_0x22aa50){_0x26df48=_0x26df48-0x0;var _0x209047=_0x814b[_0x26df48];return _0x209047;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 1dd25d7..c27b511 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xb10b,0x12a));var _0xbb10=function(_0x2e02ae,_0x4a4623){_0x2e02ae=_0x2e02ae-0x0;var _0x375a6b=_0xb10b[_0x2e02ae];return _0x375a6b;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file +var _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0x4f0363,_0x12a02c){var _0xa5e67=function(_0x577c65){while(--_0x577c65){_0x4f0363['push'](_0x4f0363['shift']());}};_0xa5e67(++_0x12a02c);}(_0x7a54,0x106));var _0x47a5=function(_0x560c5c,_0x34e358){_0x560c5c=_0x560c5c-0x0;var _0x5ea2cc=_0x7a54[_0x560c5c];return _0x5ea2cc;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 5d7db5f..895658f 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 _0x9458=['lodash','client','request','then','error','message','catch','getSquareProject','ShowSquareProject','production','ShowMailAccount','name','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9458,0x1b8));var _0x8945=function(_0x22e9c2,_0x2fb108){_0x22e9c2=_0x22e9c2-0x0;var _0x27c38c=_0x9458[_0x22e9c2];return _0x27c38c;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0x8945('0x0'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0x8945('0x1')]['http']({'port':0x2329});function request(_0x25d707,_0x1e8d5d){return new BPromise(function(_0x10311b,_0x31347e){return client[_0x8945('0x2')](_0x25d707,_0x1e8d5d)[_0x8945('0x3')](function(_0x69dab5){if(_0x69dab5[_0x8945('0x4')]){return _0x31347e(_0x69dab5[_0x8945('0x4')][_0x8945('0x5')]);}else{return _0x10311b(_0x69dab5['result']);}})[_0x8945('0x6')](function(_0x409ebc){return _0x31347e(_0x409ebc);});});}exports[_0x8945('0x7')]=function(_0x307b9e){return request(_0x8945('0x8'),{'options':{'raw':![],'where':{'name':_0x307b9e},'attributes':[_0x8945('0x9')]}});};exports['getMailAccountById']=function(_0xdef672){return request(_0x8945('0xa'),{'options':{'raw':![],'where':{'id':_0xdef672},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0x8945('0xb'),'email']}});};exports[_0x8945('0xc')]=function(_0x76c5c7){return request(_0x8945('0x8'),{'options':{'where':{'id':_0x76c5c7},'attributes':[_0x8945('0xb')]}});};exports[_0x8945('0xd')]=function(_0x3ba09d){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x3ba09d},'attributes':[_0x8945('0xb')]}});};exports[_0x8945('0xe')]=function(_0x57a68b){return request(_0x8945('0xf'),{'options':{'where':{'id':_0x57a68b},'attributes':[_0x8945('0xb')]}});};exports[_0x8945('0x10')]=function(_0xd6aa0){return request(_0x8945('0x11'),{'options':{'where':{'id':_0xd6aa0},'attributes':[_0x8945('0x12')]}});};exports['getUserById']=function(_0x5e49cf){return request(_0x8945('0x13'),{'options':{'where':{'id':_0x5e49cf},'attributes':['name']}});};exports['getTrunkById']=function(_0x308f54){return request('ShowTrunk',{'options':{'where':{'id':_0x308f54},'attributes':['name']}});};exports[_0x8945('0x14')]=function(_0x1fe38f){return request(_0x8945('0x15'),{'options':{'where':{'id':_0x1fe38f},'attributes':[_0x8945('0x16')]}});};exports[_0x8945('0x17')]=function(_0x32ce5e){return request(_0x8945('0x18'),{'options':{'raw':![],'where':{'id':_0x32ce5e},'include':[{'model':_0x8945('0x19'),'as':_0x8945('0x1a')}]}});};exports[_0x8945('0x1b')]=function(_0x1738e1){return request(_0x8945('0x1c'),{'options':{'where':{'id':_0x1738e1},'attributes':['id',_0x8945('0xb')]}});};exports[_0x8945('0x1d')]=function(_0x5e167d){return request('CreateSmsMessage',{'body':_0x5e167d});};exports['createSquareDetailsReport']=function(_0x5046b1){return request(_0x8945('0x1e'),{'body':_0x5046b1});};exports[_0x8945('0x1f')]=function(_0x4cdc52){return request(_0x8945('0x20'),{'body':_[_0x8945('0x21')](_0x4cdc52,{'project_name':_0x4cdc52[_0x8945('0x22')],'prev_project_name':_0x4cdc52[_0x8945('0x23')]||'','is_subproject':_0x4cdc52['arg_2']?!![]:![],'leaveAt':moment()[_0x8945('0x24')](_0x8945('0x25'))})});};exports[_0x8945('0x26')]=function(_0x2cc49b){return request(_0x8945('0x27'),{'body':_0x2cc49b});};exports[_0x8945('0x28')]=function(_0x34d8de){return request(_0x8945('0x29'),{'body':_0x34d8de});};exports[_0x8945('0x2a')]=function(_0x3084e4){return request(_0x8945('0x2b'),{'options':{'raw':![],'where':{'phone':_0x3084e4[_0x8945('0x2c')],'ListId':_0x3084e4['ListId']}}})[_0x8945('0x3')](function(_0x55cc6c){if(_0x55cc6c){return _0x55cc6c;}return request(_0x8945('0x2d'),{'body':_0x3084e4});});};exports['getPauseById']=function(_0xd5f709){return request(_0x8945('0x2e'),{'options':{'where':{'id':_0xd5f709},'attributes':[_0x8945('0xb')]}});};exports[_0x8945('0x2f')]=function(_0x4cf946,_0x3af7df){return request(_0x8945('0x30'),{'body':{'interface':_0x3af7df},'options':{'where':_0x4cf946}});};exports[_0x8945('0x31')]=function(_0x3aa963,_0x476788,_0x44d620){return request(_0x8945('0x32'),{'body':{'type':_0x476788,'uniqueid':_0x44d620},'options':{'where':_0x3aa963}});};exports[_0x8945('0x33')]=function(_0x3a094b){return request(_0x8945('0x34'),{'body':{},'options':{'where':_0x3a094b}});};exports[_0x8945('0x35')]=function(_0x11b7a6){return request(_0x8945('0x36'),{'body':{},'options':{'where':_0x11b7a6}});}; \ No newline at end of file +var _0x3080=['ShowSound','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSquareDetailsReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','agentUnpause','UnpauseUser','LogoutUser','bluebird','moment','lodash','util','client','http','then','error','message','catch','getSquareProject','ShowSquareProject','production','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getSoundById'];(function(_0x2b8a73,_0x17925a){var _0x459b53=function(_0x5d6514){while(--_0x5d6514){_0x2b8a73['push'](_0x2b8a73['shift']());}};_0x459b53(++_0x17925a);}(_0x3080,0x1e6));var _0x0308=function(_0x5870d0,_0x1b1965){_0x5870d0=_0x5870d0-0x0;var _0x3fbe4a=_0x3080[_0x5870d0];return _0x3fbe4a;};'use strict';var BPromise=require(_0x0308('0x0'));var moment=require(_0x0308('0x1'));var _=require(_0x0308('0x2'));var util=require(_0x0308('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x0308('0x4')][_0x0308('0x5')]({'port':0x2329});function request(_0x40ba2e,_0x18e242){return new BPromise(function(_0x22fe5e,_0x263aa4){return client['request'](_0x40ba2e,_0x18e242)[_0x0308('0x6')](function(_0x5eb937){if(_0x5eb937[_0x0308('0x7')]){return _0x263aa4(_0x5eb937[_0x0308('0x7')][_0x0308('0x8')]);}else{return _0x22fe5e(_0x5eb937['result']);}})[_0x0308('0x9')](function(_0x234e21){return _0x263aa4(_0x234e21);});});}exports[_0x0308('0xa')]=function(_0xd5132f){return request(_0x0308('0xb'),{'options':{'raw':![],'where':{'name':_0xd5132f},'attributes':[_0x0308('0xc')]}});};exports['getMailAccountById']=function(_0x328e73){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x328e73},'include':[{'model':_0x0308('0xd'),'as':_0x0308('0xe')}],'attributes':['id',_0x0308('0xf'),_0x0308('0x10')]}});};exports[_0x0308('0x11')]=function(_0x119737){return request('ShowSquareProject',{'options':{'where':{'id':_0x119737},'attributes':['name']}});};exports[_0x0308('0x12')]=function(_0xffc21b){return request('ShowVoiceQueue',{'options':{'where':{'id':_0xffc21b},'attributes':['name']}});};exports[_0x0308('0x13')]=function(_0x5da96e){return request(_0x0308('0x14'),{'options':{'where':{'id':_0x5da96e},'attributes':[_0x0308('0xf')]}});};exports[_0x0308('0x15')]=function(_0x34f0ec){return request(_0x0308('0x16'),{'options':{'where':{'id':_0x34f0ec},'attributes':['dsn']}});};exports['getUserById']=function(_0x5706a7){return request('ShowUser',{'options':{'where':{'id':_0x5706a7},'attributes':[_0x0308('0xf')]}});};exports['getTrunkById']=function(_0xacc60){return request('ShowTrunk',{'options':{'where':{'id':_0xacc60},'attributes':[_0x0308('0xf')]}});};exports[_0x0308('0x17')]=function(_0xc2ae04){return request(_0x0308('0x18'),{'options':{'where':{'id':_0xc2ae04},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x4de58e){return request(_0x0308('0x19'),{'options':{'raw':![],'where':{'id':_0x4de58e},'include':[{'model':_0x0308('0x1a'),'as':_0x0308('0x1b')}]}});};exports[_0x0308('0x1c')]=function(_0xa6c0c2){return request(_0x0308('0x1d'),{'options':{'where':{'id':_0xa6c0c2},'attributes':['id',_0x0308('0xf')]}});};exports[_0x0308('0x1e')]=function(_0x43fb76){return request('CreateSmsMessage',{'body':_0x43fb76});};exports['createSquareDetailsReport']=function(_0x16f736){return request(_0x0308('0x1f'),{'body':_0x16f736});};exports['createSquareReport']=function(_0x2481a0){return request('CreateSquareReport',{'body':_[_0x0308('0x20')](_0x2481a0,{'project_name':_0x2481a0[_0x0308('0x21')],'prev_project_name':_0x2481a0[_0x0308('0x22')]||'','is_subproject':_0x2481a0[_0x0308('0x22')]?!![]:![],'leaveAt':moment()[_0x0308('0x23')](_0x0308('0x24'))})});};exports[_0x0308('0x25')]=function(_0x5e92dd){return request('CreateSquareRecording',{'body':_0x5e92dd});};exports[_0x0308('0x26')]=function(_0x241d4d){return request(_0x0308('0x27'),{'body':_0x241d4d});};exports[_0x0308('0x28')]=function(_0xfa8f13){return request(_0x0308('0x29'),{'options':{'raw':![],'where':{'phone':_0xfa8f13[_0x0308('0x2a')],'ListId':_0xfa8f13[_0x0308('0x2b')]}}})[_0x0308('0x6')](function(_0x6268ff){if(_0x6268ff){return _0x6268ff;}return request(_0x0308('0x2c'),{'body':_0xfa8f13});});};exports[_0x0308('0x2d')]=function(_0x48d5d6){return request(_0x0308('0x2e'),{'options':{'where':{'id':_0x48d5d6},'attributes':['name']}});};exports[_0x0308('0x2f')]=function(_0x2f261d,_0x50ee95){return request('LoginUser',{'body':{'interface':_0x50ee95},'options':{'where':_0x2f261d}});};exports['agentPause']=function(_0x31d487,_0x365018,_0x552750){return request('PauseUser',{'body':{'type':_0x365018,'uniqueid':_0x552750},'options':{'where':_0x31d487}});};exports[_0x0308('0x30')]=function(_0x2c3745){return request(_0x0308('0x31'),{'body':{},'options':{'where':_0x2c3745}});};exports['agentLogout']=function(_0x2b2949){return request(_0x0308('0x32'),{'body':{},'options':{'where':_0x2b2949}});}; \ 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 e71dce1..c0be6ae 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 _0xca66=['./polly'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xca66,0x8b));var _0x6ca6=function(_0x4e3765,_0x415b4c){_0x4e3765=_0x4e3765-0x0;var _0x4475fa=_0xca66[_0x4e3765];return _0x4475fa;};var polly=require(_0x6ca6('0x0'));var lex=require('./lex');module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x3667=['exports','./polly','./lex'];(function(_0x659b77,_0x1eddb6){var _0x675af4=function(_0x28da5f){while(--_0x28da5f){_0x659b77['push'](_0x659b77['shift']());}};_0x675af4(++_0x1eddb6);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};var polly=require(_0x7366('0x0'));var lex=require(_0x7366('0x1'));module[_0x7366('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index e714079..7dcbdb5 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 _0x1782=['./lib/api'];(function(_0x38cec7,_0x2358b2){var _0x3e89d7=function(_0x190c21){while(--_0x190c21){_0x38cec7['push'](_0x38cec7['shift']());}};_0x3e89d7(++_0x2358b2);}(_0x1782,0x13e));var _0x2178=function(_0x394e2a,_0xdc5906){_0x394e2a=_0x394e2a-0x0;var _0x5d22ca=_0x1782[_0x394e2a];return _0x5d22ca;};'use strict';var lex=require(_0x2178('0x0'));module['exports']=function(_0x131618,_0xbbb315,_0x1df52d,_0x1c92e6,_0x17b0da,_0x4a185d){return lex(_0x131618,_0xbbb315,_0x1df52d,_0x1c92e6,_0x17b0da,_0x4a185d);}; \ No newline at end of file +var _0xa588=['exports'];(function(_0x43026b,_0x928d8c){var _0x4a96cd=function(_0x362cbd){while(--_0x362cbd){_0x43026b['push'](_0x43026b['shift']());}};_0x4a96cd(++_0x928d8c);}(_0xa588,0xe1));var _0x8a58=function(_0x51f5c8,_0x2aa90d){_0x51f5c8=_0x51f5c8-0x0;var _0x30789e=_0xa588[_0x51f5c8];return _0x30789e;};'use strict';var lex=require('./lib/api');module[_0x8a58('0x0')]=function(_0x3c5387,_0xd12c46,_0x11633d,_0x28a4e8,_0x2f8787,_0x40bfe3){return lex(_0x3c5387,_0xd12c46,_0x11633d,_0x28a4e8,_0x2f8787,_0x40bfe3);}; \ 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 64e1cde..3439929 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 _0xa963=['hasOwnProperty','slot_','exports','LexRuntime','$LATEST','bluebird','aws-sdk','postText','slots'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa963,0x164));var _0x3a96=function(_0x22e1cf,_0x44788d){_0x22e1cf=_0x22e1cf-0x0;var _0x258e78=_0xa963[_0x22e1cf];return _0x258e78;};'use strict';var BPromise=require(_0x3a96('0x0'));var AWS=require(_0x3a96('0x1'));function lexResult(_0x16d8a5,_0x2d33ec){return new BPromise(function(_0x43267f,_0x3a63d7){_0x16d8a5[_0x3a96('0x2')](_0x2d33ec,function(_0x4f0cc3,_0xe8e195){if(_0x4f0cc3){_0x3a63d7(_0x4f0cc3);}if(_0xe8e195['slots']){for(const _0x4c374f in _0xe8e195[_0x3a96('0x3')]){if(_0xe8e195[_0x3a96('0x3')][_0x3a96('0x4')](_0x4c374f)){var _0x47d6ad=_0xe8e195[_0x3a96('0x3')][_0x4c374f];_0xe8e195[_0x3a96('0x5')+_0x4c374f]=_0x47d6ad;}}}_0x43267f(_0xe8e195);});});}module[_0x3a96('0x6')]=function(_0x5b9f1f,_0x23a57c,_0x5a0025,_0x344146,_0x2abce6,_0x51793e){var _0x59212c=new AWS[(_0x3a96('0x7'))]({'accessKeyId':_0x23a57c,'secretAccessKey':_0x5a0025,'region':_0x344146});var _0x42b37b={'botAlias':_0x3a96('0x8'),'botName':_0x51793e,'inputText':_0x2abce6,'userId':_0x5b9f1f};return lexResult(_0x59212c,_0x42b37b);}; \ No newline at end of file +var _0x5d10=['LexRuntime','$LATEST','bluebird','postText','slots','hasOwnProperty','exports'];(function(_0x1b932b,_0x2c14fe){var _0x119173=function(_0x381dde){while(--_0x381dde){_0x1b932b['push'](_0x1b932b['shift']());}};_0x119173(++_0x2c14fe);}(_0x5d10,0x159));var _0x05d1=function(_0xf61c79,_0x43c6fa){_0xf61c79=_0xf61c79-0x0;var _0x127d26=_0x5d10[_0xf61c79];return _0x127d26;};'use strict';var BPromise=require(_0x05d1('0x0'));var AWS=require('aws-sdk');function lexResult(_0x386e2c,_0xa012b0){return new BPromise(function(_0x456020,_0x2c37d7){_0x386e2c[_0x05d1('0x1')](_0xa012b0,function(_0x336de3,_0x23f8e2){if(_0x336de3){_0x2c37d7(_0x336de3);}if(_0x23f8e2['slots']){for(const _0x2fbfac in _0x23f8e2['slots']){if(_0x23f8e2[_0x05d1('0x2')][_0x05d1('0x3')](_0x2fbfac)){var _0x15dad2=_0x23f8e2[_0x05d1('0x2')][_0x2fbfac];_0x23f8e2['slot_'+_0x2fbfac]=_0x15dad2;}}}_0x456020(_0x23f8e2);});});}module[_0x05d1('0x4')]=function(_0x33feeb,_0x3bb7d3,_0x2905d9,_0x55e3af,_0x492964,_0x15256f){var _0x4219e5=new AWS[(_0x05d1('0x5'))]({'accessKeyId':_0x3bb7d3,'secretAccessKey':_0x2905d9,'region':_0x55e3af});var _0x5b69df={'botAlias':_0x05d1('0x6'),'botName':_0x15256f,'inputText':_0x492964,'userId':_0x33feeb};return lexResult(_0x4219e5,_0x5b69df);}; \ 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 91d2b48..0016cf7 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 _0x171c=['exports','./lib/api'];(function(_0x13dce8,_0x22f048){var _0x2406a2=function(_0x19ad13){while(--_0x19ad13){_0x13dce8['push'](_0x13dce8['shift']());}};_0x2406a2(++_0x22f048);}(_0x171c,0xa5));var _0xc171=function(_0x3bf1a6,_0x2efa64){_0x3bf1a6=_0x3bf1a6-0x0;var _0xce3ac8=_0x171c[_0x3bf1a6];return _0xce3ac8;};'use strict';var polly=require(_0xc171('0x0'));module[_0xc171('0x1')]=function(_0x2e3cda,_0xcd9f0c,_0x1e69f9,_0x3fabd7,_0x43ae02,_0x182662,_0x448d2a){return polly(_0x2e3cda,_0xcd9f0c,_0x1e69f9,_0x3fabd7,_0x43ae02,_0x182662,_0x448d2a);}; \ No newline at end of file +var _0x193f=['exports','./lib/api'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0x193f,0x9f));var _0xf193=function(_0xfd495c,_0x4a3c1a){_0xfd495c=_0xfd495c-0x0;var _0x561dd8=_0x193f[_0xfd495c];return _0x561dd8;};'use strict';var polly=require(_0xf193('0x0'));module[_0xf193('0x1')]=function(_0x1d49e6,_0x3c740b,_0x497f09,_0x12161a,_0x25db86,_0x364f83,_0x5af626){return polly(_0x1d49e6,_0x3c740b,_0x497f09,_0x12161a,_0x25db86,_0x364f83,_0x5af626);}; \ 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 8e9dc71..88fb748 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 _0xeeb7=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','bluebird','randomstring','aws-sdk','synthesizeSpeech'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xeeb7,0x1d5));var _0x7eeb=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0xeeb7[_0x377a6e];return _0x37f751;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x7eeb('0x0'));var rs=require(_0x7eeb('0x1'));var AWS=require(_0x7eeb('0x2'));function pollyResult(_0x56c39e,_0x53e34f,_0x59ceda){return new BPromise(function(_0x16c310,_0x3cbe00){_0x56c39e[_0x7eeb('0x3')](_0x53e34f,function(_0x2bf73e,_0x108d49){if(_0x2bf73e){_0x3cbe00(_0x2bf73e);}else if(_0x108d49){if(_0x108d49[_0x7eeb('0x4')]instanceof Buffer){fs[_0x7eeb('0x5')](_0x59ceda,_0x108d49[_0x7eeb('0x4')],function(_0x366e62){if(_0x366e62){_0x3cbe00(_0x366e62);}else{_0x16c310();}});}else{_0x3cbe00(new Error(_0x7eeb('0x6')));}}else{_0x3cbe00(new Error(_0x7eeb('0x7')));}});});}module['exports']=function(_0x1f10a4,_0x5b966c,_0x30fb4a,_0x4f181c,_0xcb78b6,_0x55638f,_0x31eee0){var _0x4fc42e=new AWS[(_0x7eeb('0x8'))]({'accessKeyId':_0x1f10a4,'secretAccessKey':_0x5b966c,'region':_0x30fb4a});var _0x5c6fd0={'Text':_0xcb78b6,'TextType':_0x55638f||_0x7eeb('0x9'),'OutputFormat':_0x7eeb('0xa'),'VoiceId':_0x4f181c};return pollyResult(_0x4fc42e,_0x5c6fd0,_0x31eee0);}; \ No newline at end of file +var _0x0593=['synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','randomstring','aws-sdk'];(function(_0x752606,_0x38548d){var _0x421071=function(_0x1efd6c){while(--_0x1efd6c){_0x752606['push'](_0x752606['shift']());}};_0x421071(++_0x38548d);}(_0x0593,0x134));var _0x3059=function(_0x438c43,_0x2dda93){_0x438c43=_0x438c43-0x0;var _0x11457a=_0x0593[_0x438c43];return _0x11457a;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0x3059('0x0'));var AWS=require(_0x3059('0x1'));function pollyResult(_0x484ee6,_0x5a6ff5,_0x43ca3a){return new BPromise(function(_0x2a6476,_0x3bfbd1){_0x484ee6[_0x3059('0x2')](_0x5a6ff5,function(_0x245dc7,_0x52f09a){if(_0x245dc7){_0x3bfbd1(_0x245dc7);}else if(_0x52f09a){if(_0x52f09a['AudioStream']instanceof Buffer){fs[_0x3059('0x3')](_0x43ca3a,_0x52f09a[_0x3059('0x4')],function(_0x39dfdf){if(_0x39dfdf){_0x3bfbd1(_0x39dfdf);}else{_0x2a6476();}});}else{_0x3bfbd1(new Error(_0x3059('0x5')));}}else{_0x3bfbd1(new Error(_0x3059('0x6')));}});});}module[_0x3059('0x7')]=function(_0x331ea0,_0xa45bc5,_0x2b1bf3,_0x42700e,_0x41fb49,_0x4acd02,_0x527111){var _0x4d45da=new AWS[(_0x3059('0x8'))]({'accessKeyId':_0x331ea0,'secretAccessKey':_0xa45bc5,'region':_0x2b1bf3});var _0x30b99f={'Text':_0x41fb49,'TextType':_0x4acd02||_0x3059('0x9'),'OutputFormat':'mp3','VoiceId':_0x42700e};return pollyResult(_0x4d45da,_0x30b99f,_0x527111);}; \ 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 7b4af77..541d986 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 _0xb12f=['exports','./lib/api'];(function(_0xd213b1,_0x404188){var _0x5da26c=function(_0x93d4b8){while(--_0x93d4b8){_0xd213b1['push'](_0xd213b1['shift']());}};_0x5da26c(++_0x404188);}(_0xb12f,0x1c3));var _0xfb12=function(_0x4eaa3e,_0x24031c){_0x4eaa3e=_0x4eaa3e-0x0;var _0x18d712=_0xb12f[_0x4eaa3e];return _0x18d712;};'use strict';var asr=require(_0xfb12('0x0'));module[_0xfb12('0x1')]=function(_0x356dc0,_0x5961bc,_0x2482a2,_0x3396a5){return asr(_0x356dc0,_0x5961bc,_0x2482a2);}; \ No newline at end of file +var _0xb165=['./lib/api','exports'];(function(_0x3918c1,_0x2e25b8){var _0x5e3a23=function(_0x2df0a3){while(--_0x2df0a3){_0x3918c1['push'](_0x3918c1['shift']());}};_0x5e3a23(++_0x2e25b8);}(_0xb165,0x176));var _0x5b16=function(_0x125734,_0x13fa3f){_0x125734=_0x125734-0x0;var _0x3771f3=_0xb165[_0x125734];return _0x3771f3;};'use strict';var asr=require(_0x5b16('0x0'));module[_0x5b16('0x1')]=function(_0x569ff5,_0x2dae89,_0x1ea2c9,_0x294c13){return asr(_0x569ff5,_0x2dae89,_0x1ea2c9);}; \ 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 0be2490..fe61196 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 _0x35cf=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','toString','base64','POST','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','string','length'];(function(_0x49cea2,_0x20ccc6){var _0x14a80d=function(_0x28a6de){while(--_0x28a6de){_0x49cea2['push'](_0x49cea2['shift']());}};_0x14a80d(++_0x20ccc6);}(_0x35cf,0xcb));var _0xf35c=function(_0x4717b8,_0x331c49){_0x4717b8=_0x4717b8-0x0;var _0x42a536=_0x35cf[_0x4717b8];return _0x42a536;};'use strict';var url=require('url');var BPromise=require(_0xf35c('0x0'));var fs=require('fs');var host=_0xf35c('0x1');module[_0xf35c('0x2')]=function(_0x131fa2,_0x4f22a2,_0x26b3b6){return new BPromise(function(_0xba30df,_0x44014c){var _0x2a3358;if(typeof _0x131fa2!==_0xf35c('0x3')||_0x131fa2[_0xf35c('0x4')]===0x0){return _0x44014c(_0xf35c('0x5'));}if(typeof _0x4f22a2!=='string'||_0x4f22a2[_0xf35c('0x4')]===0x0){return _0x44014c(_0xf35c('0x6'));}if(typeof _0x26b3b6!=='undefined'&&(typeof _0x26b3b6!==_0xf35c('0x3')||_0x26b3b6[_0xf35c('0x4')]===0x0)){return _0x44014c(_0xf35c('0x7'));}try{_0x2a3358=fs['readFileSync'](_0x131fa2)[_0xf35c('0x8')](_0xf35c('0x9'));}catch(_0x38ab88){return _0x44014c(_0x38ab88);}return _0xba30df({'method':_0xf35c('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x4f22a2,'body':{'config':{'encoding':_0xf35c('0xb'),'sampleRateHertz':_0xf35c('0xc'),'languageCode':_0x26b3b6},'audio':{'content':_0x2a3358}},'json':!![]});});}; \ No newline at end of file +var _0x333a=['length','undefined','string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','LINEAR16','8000','url','https://speech.googleapis.com','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x333a,0x99));var _0xa333=function(_0x495a60,_0x30453a){_0x495a60=_0x495a60-0x0;var _0x5d2154=_0x333a[_0x495a60];return _0x5d2154;};'use strict';var url=require(_0xa333('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xa333('0x1');module[_0xa333('0x2')]=function(_0x11b8a5,_0x198c54,_0x553da9){return new BPromise(function(_0x38930d,_0x290053){var _0x3de9eb;if(typeof _0x11b8a5!=='string'||_0x11b8a5[_0xa333('0x3')]===0x0){return _0x290053('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x198c54!=='string'||_0x198c54['length']===0x0){return _0x290053('key\x20should\x20be\x20a\x20string');}if(typeof _0x553da9!==_0xa333('0x4')&&(typeof _0x553da9!==_0xa333('0x5')||_0x553da9['length']===0x0)){return _0x290053(_0xa333('0x6'));}try{_0x3de9eb=fs[_0xa333('0x7')](_0x11b8a5)['toString'](_0xa333('0x8'));}catch(_0x2f30c5){return _0x290053(_0x2f30c5);}return _0x38930d({'method':_0xa333('0x9'),'uri':host+'/v1/speech:recognize?key='+_0x198c54,'body':{'config':{'encoding':_0xa333('0xa'),'sampleRateHertz':_0xa333('0xb'),'languageCode':_0x553da9},'audio':{'content':_0x3de9eb}},'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 d4454a5..5659724 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 _0x5919=['./asr'];(function(_0x210311,_0x358013){var _0xeeeda2=function(_0x29f4fa){while(--_0x29f4fa){_0x210311['push'](_0x210311['shift']());}};_0xeeeda2(++_0x358013);}(_0x5919,0x198));var _0x9591=function(_0x2fda36,_0x3012d9){_0x2fda36=_0x2fda36-0x0;var _0x48866c=_0x5919[_0x2fda36];return _0x48866c;};var asr=require(_0x9591('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x2f2d=['exports'];(function(_0x3d3922,_0x119fce){var _0x22eb19=function(_0x2db7d9){while(--_0x2db7d9){_0x3d3922['push'](_0x3d3922['shift']());}};_0x22eb19(++_0x119fce);}(_0x2f2d,0x17f));var _0xd2f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f2d[_0x3dd15e];return _0x231fd0;};var asr=require('./asr');module[_0xd2f2('0x0')]={'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 3d267ca..9d01ff9 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 _0x79c8=['tmp','generate','writeFileSync','then','chmodSync','777','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','audioConfig','from','audioContent','writeFile','.wav','googleCloudTTS\x20path','googleTTS','.mp3','goggleTTS\x20path','split','asr','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','stringify','result','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','metadata','tildeASR','awsPolly','polly','awsLex','lex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','Data','audiofile','dirName','path','http','url','parse','randomstring','sox','request-promise','util','querystring','apiai-promise','./google','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','info','finish\x20download\x20file','unlink','download\x20error','end','get','data','wav','error\x20convert','finish\x20to\x20convert','start','resolve'];(function(_0xe94bca,_0x2927f6){var _0x39cec3=function(_0x567d13){while(--_0x567d13){_0xe94bca['push'](_0xe94bca['shift']());}};_0x39cec3(++_0x2927f6);}(_0x79c8,0x10c));var _0x879c=function(_0xe0cab6,_0x57da73){_0xe0cab6=_0xe0cab6-0x0;var _0x2bd9c2=_0x79c8[_0xe0cab6];return _0x2bd9c2;};'use strict';var fs=require('fs');var path=require(_0x879c('0x0'));var http=require(_0x879c('0x1'));var https=require('https');var urlParse=require(_0x879c('0x2'))[_0x879c('0x3')];var BPromise=require('bluebird');var rs=require(_0x879c('0x4'));var sox=require(_0x879c('0x5'));var rp=require(_0x879c('0x6'));var util=require(_0x879c('0x7'));var querystring=require(_0x879c('0x8'));var tts=require('google-tts-api');var apiai=require(_0x879c('0x9'));var md5=require('md5');var google=require(_0x879c('0xa'));var aws=require(_0x879c('0xb'));var tilde=require(_0x879c('0xc'));var sestek=require(_0x879c('0xd'));var logger=require(_0x879c('0xe'))(_0x879c('0xf'));var ISPEECH_API=_0x879c('0x10');function downloadFile(_0x405c5a,_0x4a7f9e){return new BPromise(function(_0x614e51,_0x4314f5){var _0x5c95fa=urlParse(_0x405c5a);var _0x529eb4=_0x5c95fa[_0x879c('0x11')]===_0x879c('0x12')?https:http;var _0xae434f={'host':_0x5c95fa[_0x879c('0x13')],'path':_0x5c95fa[_0x879c('0x0')],'headers':{'user-agent':_0x879c('0x14')}};_0x529eb4['get'](_0xae434f,function(_0x356dd4){if(_0x356dd4['statusCode']!==0xc8){logger[_0x879c('0x15')](_0x879c('0x16')+_0x405c5a+_0x879c('0x17')+_0x356dd4['statusCode']+'\x20('+_0x356dd4['statusMessage']+')');_0x4314f5(new Error('request\x20to\x20'+_0x405c5a+_0x879c('0x17')+_0x356dd4[_0x879c('0x18')]+'\x20('+_0x356dd4[_0x879c('0x19')]+')'));return;}var _0x3e0a83=fs['createWriteStream'](_0x4a7f9e);_0x3e0a83['on']('finish',function(){logger[_0x879c('0x1a')](_0x879c('0x1b'));_0x3e0a83['close'](_0x614e51);});_0x3e0a83['on'](_0x879c('0x15'),function(_0x10165a){fs[_0x879c('0x1c')](_0x4a7f9e);logger[_0x879c('0x15')](_0x879c('0x1d'),_0x10165a);_0x4314f5(_0x10165a);});_0x356dd4['pipe'](_0x3e0a83);})['on'](_0x879c('0x15'),function(_0x1e71f7){logger[_0x879c('0x15')](_0x1e71f7);_0x4314f5(_0x1e71f7);})[_0x879c('0x1e')]();});}function uploadFile(_0x2a31f4){return new BPromise(function(_0x379b6f,_0x20e1d5){var _0x32535c=urlParse(_0x2a31f4);var _0x133d3a=_0x32535c[_0x879c('0x11')]===_0x879c('0x12')?https:http;var _0x19bccd={'host':_0x32535c[_0x879c('0x13')],'path':_0x32535c[_0x879c('0x0')],'headers':{'user-agent':_0x879c('0x14')}};_0x133d3a[_0x879c('0x1f')](_0x19bccd,function(_0x2e5026){if(_0x2e5026[_0x879c('0x18')]!==0xc8){_0x20e1d5(new Error(_0x879c('0x16')+_0x2a31f4+_0x879c('0x17')+_0x2e5026[_0x879c('0x18')]+'\x20('+_0x2e5026[_0x879c('0x19')]+')'));return;}var _0x2616a8='';_0x2e5026['on'](_0x879c('0x20'),function(_0x590c3e){_0x2616a8+=_0x590c3e;});_0x2e5026['on']('end',function(){_0x379b6f(_0x2616a8);});})['on'](_0x879c('0x15'),function(_0x4e6743){_0x20e1d5(_0x4e6743);})[_0x879c('0x1e')]();});}function convertFile(_0x1c2025,_0x50e961){return new BPromise(function(_0x2091c7,_0x697522){var _0x3c6c87=sox['transcode'](_0x1c2025,_0x50e961,{'sampleRate':0x1f40,'format':_0x879c('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3c6c87['on'](_0x879c('0x15'),function(_0x17740e){logger['error'](_0x879c('0x22'),_0x17740e);_0x697522(_0x17740e);});_0x3c6c87['on'](_0x879c('0x1e'),function(){logger[_0x879c('0x1a')](_0x879c('0x23'));_0x2091c7();});_0x3c6c87[_0x879c('0x24')]();});}function base64Decode(_0x57013f,_0x5e5a29){var _0x1ff1d6=path[_0x879c('0x25')](__dirname,_0x879c('0x26'),rs[_0x879c('0x27')](0x4)+'.wav');fs[_0x879c('0x28')](_0x1ff1d6,_0x57013f,'base64');return convertFile(_0x1ff1d6,_0x5e5a29)[_0x879c('0x29')](function(){try{fs[_0x879c('0x1c')](_0x1ff1d6);fs[_0x879c('0x2a')](_0x5e5a29,_0x879c('0x2b'));}catch(_0x2dc98f){logger[_0x879c('0x15')](_0x2dc98f);}return _0x5e5a29['split']('.')[0x0];});}function base64Encode(_0x1b5e1b){var _0x41f582=fs[_0x879c('0x2c')](_0x1b5e1b);return new Buffer(_0x41f582)[_0x879c('0x2d')](_0x879c('0x2e'));}exports[_0x879c('0x2f')]=function(_0x278942,_0x4e2119,_0x1267b5,_0x2cb653,_0x9228a1,_0x2fec6c){var _0x19ee76,_0x4aa748;var _0x2682f5=_0x879c('0x30');var _0x2d446e='?key='+_0x278942;var _0x1206cc={};if(_0x4e2119===_0x879c('0x31')){_0x1206cc[_0x879c('0x32')]={'ssml':_0x1267b5};}else{_0x1206cc[_0x879c('0x32')]={'text':_0x1267b5};};_0x1206cc['voice']={'languageCode':_0x2cb653,'ssmlGender':_0x9228a1};_0x1206cc[_0x879c('0x33')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x2c18d3={'url':_0x2682f5+'text:synthesize'+_0x2d446e,'method':'POST','json':!![],'body':_0x1206cc};return rp(_0x2c18d3)[_0x879c('0x29')](function(_0x483ed6){return new BPromise(function(_0x5933e0,_0x52df8d){_0x19ee76=path[_0x879c('0x25')](__dirname,_0x879c('0x26'),rs['generate'](0x4)+'.mp3');var _0x3827e3=Buffer[_0x879c('0x34')](_0x483ed6[_0x879c('0x35')],_0x879c('0x2e'));return fs[_0x879c('0x36')](_0x19ee76,_0x3827e3,function(_0x2822cc){_0x52df8d(_0x2822cc);},function(_0x413810){fs[_0x879c('0x2a')](_0x19ee76,_0x879c('0x2b'));_0x5933e0(_0x413810);});});})[_0x879c('0x29')](function(_0x4abd57){_0x4aa748=path['resolve'](__dirname,_0x879c('0x26'),rs[_0x879c('0x27')](0x4)+_0x879c('0x37'));return convertFile(_0x19ee76,_0x4aa748);})['then'](function(){try{fs[_0x879c('0x1c')](_0x19ee76);fs['chmodSync'](_0x4aa748,_0x879c('0x2b'));}catch(_0x5572c7){logger[_0x879c('0x15')](_0x5572c7);}logger['info'](_0x879c('0x38'),_0x4aa748['split']('.')[0x0]);return _0x4aa748['split']('.')[0x0];});};exports[_0x879c('0x39')]=function(_0x21b355,_0x242728){var _0xa24559,_0x7c37a9;return tts(_0x21b355,_0x242728||'en',0x1)[_0x879c('0x29')](function(_0x1f3131){logger[_0x879c('0x1a')](_0x1f3131);_0xa24559=path[_0x879c('0x25')](__dirname,_0x879c('0x26'),rs[_0x879c('0x27')](0x4)+_0x879c('0x3a'));return downloadFile(_0x1f3131,_0xa24559);})['then'](function(){_0x7c37a9=path[_0x879c('0x25')](__dirname,'tmp',rs['generate'](0x4)+_0x879c('0x37'));return convertFile(_0xa24559,_0x7c37a9);})[_0x879c('0x29')](function(){try{fs[_0x879c('0x1c')](_0xa24559);fs[_0x879c('0x2a')](_0x7c37a9,_0x879c('0x2b'));}catch(_0x5e05aa){logger['error'](_0x5e05aa);}logger[_0x879c('0x1a')](_0x879c('0x3b'),_0x7c37a9[_0x879c('0x3c')]('.')[0x0]);return _0x7c37a9[_0x879c('0x3c')]('.')[0x0];});};exports['googleASR']=function(_0x394bdf,_0x3f7785,_0x1dbb8d){return google[_0x879c('0x3d')](_0x394bdf,_0x3f7785,_0x1dbb8d)[_0x879c('0x29')](function(_0x4a9882){logger[_0x879c('0x1a')](_0x4a9882['uri']);return rp(_0x4a9882);})['then'](function(_0x16d3b7){var _0x13e846='';var _0x4a2abd=0x0;try{fs[_0x879c('0x1c')](_0x394bdf);}catch(_0x48ee3d){logger['error'](_0x48ee3d);}if(_0x16d3b7&&_0x16d3b7['results']){_0x13e846=_0x16d3b7[_0x879c('0x3e')]['map'](function(_0x2dbb02){return _0x2dbb02&&_0x2dbb02[_0x879c('0x3f')][0x0]&&_0x2dbb02['alternatives'][0x0]['transcript']?_0x2dbb02[_0x879c('0x3f')][0x0][_0x879c('0x40')]:'';})[_0x879c('0x41')]('\x0a');_0x4a2abd=_0x16d3b7[_0x879c('0x3e')][_0x879c('0x42')](function(_0x3475bf){return _0x3475bf&&_0x3475bf[_0x879c('0x3f')][0x0]&&_0x3475bf[_0x879c('0x3f')][0x0][_0x879c('0x43')]?_0x3475bf[_0x879c('0x3f')][0x0][_0x879c('0x43')]:0x0;})[_0x879c('0x41')]('\x0a');}logger[_0x879c('0x1a')](_0x879c('0x44'),_0x13e846);logger[_0x879c('0x1a')](_0x879c('0x45'),_0x4a2abd);return{'transcript':_0x13e846,'confidence':_0x4a2abd};})['catch'](function(_0x1000ab){logger['error'](_0x879c('0x46'),_0x1000ab[_0x879c('0x18')],_0x1000ab[_0x879c('0x47')],_0x1000ab[_0x879c('0x48')]);});};exports[_0x879c('0x49')]=function(_0x35d7bf,_0x3a021c,_0x36a8fd,_0x2f5f23){var _0xaa48af=apiai(_0x3a021c,{'language':_0x2f5f23||'en'});return _0xaa48af['textRequest'](_0x36a8fd,{'sessionId':md5(_0x35d7bf)})[_0x879c('0x29')](function(_0x169ea9){logger[_0x879c('0x1a')](JSON[_0x879c('0x4a')](_0x169ea9));return{'source':_0x169ea9[_0x879c('0x4b')]['source'],'resolvedQuery':_0x169ea9[_0x879c('0x4b')][_0x879c('0x4c')],'action':_0x169ea9[_0x879c('0x4b')][_0x879c('0x4d')],'actionIncomplete':_0x169ea9[_0x879c('0x4b')][_0x879c('0x4e')],'speech':_0x169ea9['result'][_0x879c('0x4f')]['speech'],'score':_0x169ea9[_0x879c('0x4b')][_0x879c('0x50')],'statusCode':_0x169ea9[_0x879c('0x51')][_0x879c('0x52')],'endConversation':_0x169ea9['result'][_0x879c('0x53')]['endConversation']||![],'isFallbackIntent':_0x169ea9[_0x879c('0x4b')][_0x879c('0x53')]['isFallbackIntent']};});};exports[_0x879c('0x54')]=function(_0x4b6485,_0xf499eb,_0x525f38,_0x50a7b7){return tilde['asr'](_0x4b6485,_0xf499eb,_0x525f38,_0x50a7b7)[_0x879c('0x29')](function(_0x2868c1){try{fs[_0x879c('0x1c')](_0x4b6485);}catch(_0x34a024){logger[_0x879c('0x15')](_0x34a024);}logger[_0x879c('0x1a')]('Tilde\x20ASR\x20transcription',_0x2868c1[_0x879c('0x40')]);logger[_0x879c('0x1a')]('Tilde\x20ASR\x20confidence',_0x2868c1[_0x879c('0x43')]);return _0x2868c1;});};exports[_0x879c('0x55')]=function(_0x452bde,_0x1bce5d,_0x132a50,_0x124db9,_0x4f63ad,_0x2126c7){var _0x110d6e=path[_0x879c('0x25')](__dirname,_0x879c('0x26'),rs[_0x879c('0x27')](0x4)+_0x879c('0x3a'));var _0x4d4cf8;return aws[_0x879c('0x56')](_0x452bde,_0x1bce5d,_0x132a50,_0x124db9,_0x4f63ad,_0x2126c7,_0x110d6e)[_0x879c('0x29')](function(){_0x4d4cf8=path['resolve'](__dirname,_0x879c('0x26'),rs[_0x879c('0x27')](0x4)+_0x879c('0x37'));return convertFile(_0x110d6e,_0x4d4cf8);})['then'](function(){try{fs[_0x879c('0x1c')](_0x110d6e);fs[_0x879c('0x2a')](_0x4d4cf8,_0x879c('0x2b'));}catch(_0x5d8709){logger['error'](_0x5d8709);}return _0x4d4cf8[_0x879c('0x3c')]('.')[0x0];});};exports[_0x879c('0x57')]=function(_0x29aa73,_0x2a7fa6,_0x6b8835,_0x4fa590,_0x7ea160,_0x22578e){return aws[_0x879c('0x58')](_0x29aa73,_0x2a7fa6,_0x6b8835,_0x4fa590,_0x7ea160,_0x22578e)['then'](function(_0x1256ff){logger[_0x879c('0x1a')](JSON[_0x879c('0x4a')](_0x1256ff));return _0x1256ff;});};exports[_0x879c('0x59')]=function(_0x1dc244,_0x770f46,_0x20b68a,_0x4315b3){var _0x2775a9=util[_0x879c('0x5a')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x1dc244,encodeURIComponent(_0x770f46),_0x20b68a,_0x4315b3);var _0x24d607=path['resolve'](__dirname,_0x879c('0x26'),rs[_0x879c('0x27')](0x4)+_0x879c('0x3a'));var _0x52529d;return downloadFile(_0x2775a9,_0x24d607)['then'](function(){_0x52529d=path[_0x879c('0x25')](__dirname,_0x879c('0x26'),rs[_0x879c('0x27')](0x4)+_0x879c('0x37'));return convertFile(_0x24d607,_0x52529d);})['then'](function(){try{fs['unlink'](_0x24d607);fs['chmodSync'](_0x52529d,_0x879c('0x2b'));}catch(_0x5d7270){logger[_0x879c('0x15')](_0x5d7270);}return _0x52529d[_0x879c('0x3c')]('.')[0x0];});};exports[_0x879c('0x5b')]=function(_0xebf99d,_0x536e50,_0x1d383f,_0xd9f02e){var _0x3cdeba=util[_0x879c('0x5a')](_0x879c('0x5c'),ISPEECH_API,_0x536e50,_0x1d383f,base64Encode(_0xebf99d),_0xd9f02e?util['format']('model=%s',encodeURIComponent(_0xd9f02e)):_0x879c('0x5d'));return uploadFile(_0x3cdeba)[_0x879c('0x29')](function(_0x3de330){return querystring[_0x879c('0x3')](_0x3de330);});};exports[_0x879c('0x5e')]=function(_0x29a1f9,_0x31e897){return sestek['nda'](_0x29a1f9,_0x31e897)['then'](function(_0x4d46fc){logger['info'](JSON['stringify'](_0x4d46fc));var _0x343c2e={'speech':_0x4d46fc[_0x879c('0x5f')],'action':_0x4d46fc[_0x879c('0x60')]?_0x4d46fc['channelData'][_0x879c('0x61')]:undefined,'actiondata':_0x4d46fc['channelData']?_0x4d46fc['channelData'][_0x879c('0x62')]:undefined};if(_0x4d46fc[_0x879c('0x60')]&&_0x4d46fc[_0x879c('0x60')]['AudioFromTts']){return base64Decode(_0x4d46fc[_0x879c('0x60')]['AudioFromTts'][_0x879c('0x63')],path[_0x879c('0x25')](__dirname,_0x879c('0x26'),rs[_0x879c('0x27')](0x4)+_0x879c('0x37')))[_0x879c('0x29')](function(_0x42ebaf){_0x343c2e[_0x879c('0x64')]=_0x42ebaf;return _0x343c2e;});}return _0x343c2e;});};exports[_0x879c('0x65')]=function(){return __dirname;}; \ No newline at end of file +var _0x98d5=['Tilde\x20ASR\x20confidence','awsPolly','lex','stringify','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','text','channelData','CustomAction','AudioFromTts','audiofile','dirName','path','http','https','url','parse','bluebird','randomstring','sox','request-promise','querystring','google-tts-api','apiai-promise','md5','./google','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','WHAT_EVER','wav','finish\x20to\x20convert','tmp','generate','.wav','writeFileSync','base64','then','777','split','readFileSync','toString','googleCloudTTS','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','audioContent','writeFile','resolve','googleCloudTTS\x20path','googleTTS','chmodSync','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription'];(function(_0x24e52b,_0x1f4d1f){var _0x139f97=function(_0x4346d4){while(--_0x4346d4){_0x24e52b['push'](_0x24e52b['shift']());}};_0x139f97(++_0x1f4d1f);}(_0x98d5,0x157));var _0x598d=function(_0x4a0146,_0x2dd714){_0x4a0146=_0x4a0146-0x0;var _0x399ed1=_0x98d5[_0x4a0146];return _0x399ed1;};'use strict';var fs=require('fs');var path=require(_0x598d('0x0'));var http=require(_0x598d('0x1'));var https=require(_0x598d('0x2'));var urlParse=require(_0x598d('0x3'))[_0x598d('0x4')];var BPromise=require(_0x598d('0x5'));var rs=require(_0x598d('0x6'));var sox=require(_0x598d('0x7'));var rp=require(_0x598d('0x8'));var util=require('util');var querystring=require(_0x598d('0x9'));var tts=require(_0x598d('0xa'));var apiai=require(_0x598d('0xb'));var md5=require(_0x598d('0xc'));var google=require(_0x598d('0xd'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require('./sestek');var logger=require(_0x598d('0xe'))(_0x598d('0xf'));var ISPEECH_API=_0x598d('0x10');function downloadFile(_0x1373e4,_0x589752){return new BPromise(function(_0x1c62d7,_0x55146d){var _0xec0cb5=urlParse(_0x1373e4);var _0x18df63=_0xec0cb5[_0x598d('0x11')]===_0x598d('0x12')?https:http;var _0x5e4ae1={'host':_0xec0cb5[_0x598d('0x13')],'path':_0xec0cb5['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x18df63[_0x598d('0x14')](_0x5e4ae1,function(_0x1c3f8d){if(_0x1c3f8d[_0x598d('0x15')]!==0xc8){logger[_0x598d('0x16')](_0x598d('0x17')+_0x1373e4+_0x598d('0x18')+_0x1c3f8d[_0x598d('0x15')]+'\x20('+_0x1c3f8d['statusMessage']+')');_0x55146d(new Error('request\x20to\x20'+_0x1373e4+_0x598d('0x18')+_0x1c3f8d[_0x598d('0x15')]+'\x20('+_0x1c3f8d[_0x598d('0x19')]+')'));return;}var _0x26de43=fs[_0x598d('0x1a')](_0x589752);_0x26de43['on']('finish',function(){logger[_0x598d('0x1b')](_0x598d('0x1c'));_0x26de43[_0x598d('0x1d')](_0x1c62d7);});_0x26de43['on']('error',function(_0x3b853c){fs[_0x598d('0x1e')](_0x589752);logger['error'](_0x598d('0x1f'),_0x3b853c);_0x55146d(_0x3b853c);});_0x1c3f8d[_0x598d('0x20')](_0x26de43);})['on'](_0x598d('0x16'),function(_0x3ee609){logger[_0x598d('0x16')](_0x3ee609);_0x55146d(_0x3ee609);})[_0x598d('0x21')]();});}function uploadFile(_0x530d50){return new BPromise(function(_0x33f68e,_0x5d2d84){var _0x54b2bf=urlParse(_0x530d50);var _0x3fbe6b=_0x54b2bf[_0x598d('0x11')]===_0x598d('0x12')?https:http;var _0x29074e={'host':_0x54b2bf[_0x598d('0x13')],'path':_0x54b2bf[_0x598d('0x0')],'headers':{'user-agent':_0x598d('0x22')}};_0x3fbe6b[_0x598d('0x14')](_0x29074e,function(_0x3cd184){if(_0x3cd184['statusCode']!==0xc8){_0x5d2d84(new Error(_0x598d('0x17')+_0x530d50+_0x598d('0x18')+_0x3cd184[_0x598d('0x15')]+'\x20('+_0x3cd184['statusMessage']+')'));return;}var _0x324693='';_0x3cd184['on']('data',function(_0xf6a4f2){_0x324693+=_0xf6a4f2;});_0x3cd184['on'](_0x598d('0x21'),function(){_0x33f68e(_0x324693);});})['on'](_0x598d('0x16'),function(_0x5a8d3f){_0x5d2d84(_0x5a8d3f);})[_0x598d('0x21')]();});}function convertFile(_0x45a49a,_0x437f1b){return new BPromise(function(_0x3c59d1,_0x20ced4){var _0x5b6c5f=sox['transcode'](_0x45a49a,_0x437f1b,{'sampleRate':0x1f40,'format':_0x598d('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5b6c5f['on'](_0x598d('0x16'),function(_0x3757f4){logger['error']('error\x20convert',_0x3757f4);_0x20ced4(_0x3757f4);});_0x5b6c5f['on'](_0x598d('0x21'),function(){logger[_0x598d('0x1b')](_0x598d('0x24'));_0x3c59d1();});_0x5b6c5f['start']();});}function base64Decode(_0x592957,_0x5f086f){var _0x260cfd=path['resolve'](__dirname,_0x598d('0x25'),rs[_0x598d('0x26')](0x4)+_0x598d('0x27'));fs[_0x598d('0x28')](_0x260cfd,_0x592957,_0x598d('0x29'));return convertFile(_0x260cfd,_0x5f086f)[_0x598d('0x2a')](function(){try{fs[_0x598d('0x1e')](_0x260cfd);fs['chmodSync'](_0x5f086f,_0x598d('0x2b'));}catch(_0x6fc350){logger[_0x598d('0x16')](_0x6fc350);}return _0x5f086f[_0x598d('0x2c')]('.')[0x0];});}function base64Encode(_0x526b24){var _0x1407f2=fs[_0x598d('0x2d')](_0x526b24);return new Buffer(_0x1407f2)[_0x598d('0x2e')](_0x598d('0x29'));}exports[_0x598d('0x2f')]=function(_0x2e50be,_0x50697a,_0x51ccd5,_0x3f3c15,_0x5df665,_0x5834bd){var _0x254ebe,_0x3d65b7;var _0x2bcdd9='https://texttospeech.googleapis.com/v1/';var _0x388c8b=_0x598d('0x30')+_0x2e50be;var _0x4eb938={};if(_0x50697a===_0x598d('0x31')){_0x4eb938[_0x598d('0x32')]={'ssml':_0x51ccd5};}else{_0x4eb938[_0x598d('0x32')]={'text':_0x51ccd5};};_0x4eb938[_0x598d('0x33')]={'languageCode':_0x3f3c15,'ssmlGender':_0x5df665};_0x4eb938[_0x598d('0x34')]={'audioEncoding':_0x598d('0x35'),'sampleRateHertz':0x1f40};var _0x488a5d={'url':_0x2bcdd9+_0x598d('0x36')+_0x388c8b,'method':_0x598d('0x37'),'json':!![],'body':_0x4eb938};return rp(_0x488a5d)[_0x598d('0x2a')](function(_0xb1e10f){return new BPromise(function(_0x50895e,_0x3fb3b4){_0x254ebe=path['resolve'](__dirname,_0x598d('0x25'),rs[_0x598d('0x26')](0x4)+_0x598d('0x38'));var _0x4afbb3=Buffer['from'](_0xb1e10f[_0x598d('0x39')],_0x598d('0x29'));return fs[_0x598d('0x3a')](_0x254ebe,_0x4afbb3,function(_0x187ddf){_0x3fb3b4(_0x187ddf);},function(_0x564e94){fs['chmodSync'](_0x254ebe,'777');_0x50895e(_0x564e94);});});})[_0x598d('0x2a')](function(_0x4ffb3c){_0x3d65b7=path[_0x598d('0x3b')](__dirname,_0x598d('0x25'),rs[_0x598d('0x26')](0x4)+_0x598d('0x27'));return convertFile(_0x254ebe,_0x3d65b7);})[_0x598d('0x2a')](function(){try{fs[_0x598d('0x1e')](_0x254ebe);fs['chmodSync'](_0x3d65b7,_0x598d('0x2b'));}catch(_0x5af527){logger[_0x598d('0x16')](_0x5af527);}logger[_0x598d('0x1b')](_0x598d('0x3c'),_0x3d65b7['split']('.')[0x0]);return _0x3d65b7['split']('.')[0x0];});};exports[_0x598d('0x3d')]=function(_0x295513,_0x29fb62){var _0x2387d2,_0x3b9425;return tts(_0x295513,_0x29fb62||'en',0x1)[_0x598d('0x2a')](function(_0x3fe5aa){logger[_0x598d('0x1b')](_0x3fe5aa);_0x2387d2=path[_0x598d('0x3b')](__dirname,'tmp',rs[_0x598d('0x26')](0x4)+'.mp3');return downloadFile(_0x3fe5aa,_0x2387d2);})[_0x598d('0x2a')](function(){_0x3b9425=path[_0x598d('0x3b')](__dirname,_0x598d('0x25'),rs[_0x598d('0x26')](0x4)+_0x598d('0x27'));return convertFile(_0x2387d2,_0x3b9425);})[_0x598d('0x2a')](function(){try{fs[_0x598d('0x1e')](_0x2387d2);fs[_0x598d('0x3e')](_0x3b9425,_0x598d('0x2b'));}catch(_0x6bdf2d){logger[_0x598d('0x16')](_0x6bdf2d);}logger[_0x598d('0x1b')](_0x598d('0x3f'),_0x3b9425[_0x598d('0x2c')]('.')[0x0]);return _0x3b9425[_0x598d('0x2c')]('.')[0x0];});};exports['googleASR']=function(_0x1d84c8,_0x1d7541,_0x4b2666){return google[_0x598d('0x40')](_0x1d84c8,_0x1d7541,_0x4b2666)[_0x598d('0x2a')](function(_0x357c5d){logger['info'](_0x357c5d[_0x598d('0x41')]);return rp(_0x357c5d);})[_0x598d('0x2a')](function(_0x50bf88){var _0xaa4882='';var _0xd738f0=0x0;try{fs[_0x598d('0x1e')](_0x1d84c8);}catch(_0xe65768){logger[_0x598d('0x16')](_0xe65768);}if(_0x50bf88&&_0x50bf88[_0x598d('0x42')]){_0xaa4882=_0x50bf88[_0x598d('0x42')][_0x598d('0x43')](function(_0x2d2087){return _0x2d2087&&_0x2d2087[_0x598d('0x44')][0x0]&&_0x2d2087['alternatives'][0x0][_0x598d('0x45')]?_0x2d2087['alternatives'][0x0]['transcript']:'';})['join']('\x0a');_0xd738f0=_0x50bf88[_0x598d('0x42')]['map'](function(_0x2e4d19){return _0x2e4d19&&_0x2e4d19[_0x598d('0x44')][0x0]&&_0x2e4d19['alternatives'][0x0][_0x598d('0x46')]?_0x2e4d19[_0x598d('0x44')][0x0][_0x598d('0x46')]:0x0;})[_0x598d('0x47')]('\x0a');}logger[_0x598d('0x1b')](_0x598d('0x48'),_0xaa4882);logger[_0x598d('0x1b')]('googleASR\x20confidence',_0xd738f0);return{'transcript':_0xaa4882,'confidence':_0xd738f0};})[_0x598d('0x49')](function(_0x34f838){logger[_0x598d('0x16')](_0x598d('0x4a'),_0x34f838[_0x598d('0x15')],_0x34f838[_0x598d('0x4b')],_0x34f838[_0x598d('0x4c')]);});};exports[_0x598d('0x4d')]=function(_0x8aca83,_0x3c4246,_0x13eb14,_0x287222){var _0x32c820=apiai(_0x3c4246,{'language':_0x287222||'en'});return _0x32c820[_0x598d('0x4e')](_0x13eb14,{'sessionId':md5(_0x8aca83)})[_0x598d('0x2a')](function(_0x5de628){logger[_0x598d('0x1b')](JSON['stringify'](_0x5de628));return{'source':_0x5de628[_0x598d('0x4f')][_0x598d('0x50')],'resolvedQuery':_0x5de628[_0x598d('0x4f')][_0x598d('0x51')],'action':_0x5de628[_0x598d('0x4f')]['action'],'actionIncomplete':_0x5de628[_0x598d('0x4f')][_0x598d('0x52')],'speech':_0x5de628['result'][_0x598d('0x53')][_0x598d('0x54')],'score':_0x5de628[_0x598d('0x4f')][_0x598d('0x55')],'statusCode':_0x5de628[_0x598d('0x56')][_0x598d('0x57')],'endConversation':_0x5de628[_0x598d('0x4f')][_0x598d('0x58')][_0x598d('0x59')]||![],'isFallbackIntent':_0x5de628[_0x598d('0x4f')][_0x598d('0x58')][_0x598d('0x5a')]};});};exports[_0x598d('0x5b')]=function(_0x1db6aa,_0x489888,_0x269630,_0x50b635){return tilde[_0x598d('0x40')](_0x1db6aa,_0x489888,_0x269630,_0x50b635)[_0x598d('0x2a')](function(_0x247394){try{fs['unlink'](_0x1db6aa);}catch(_0x4b60c3){logger['error'](_0x4b60c3);}logger['info'](_0x598d('0x5c'),_0x247394[_0x598d('0x45')]);logger[_0x598d('0x1b')](_0x598d('0x5d'),_0x247394[_0x598d('0x46')]);return _0x247394;});};exports[_0x598d('0x5e')]=function(_0x2cdc58,_0x5e1b02,_0x395b34,_0x899cbe,_0x5f5cc4,_0x1e6706){var _0x58d8da=path[_0x598d('0x3b')](__dirname,_0x598d('0x25'),rs[_0x598d('0x26')](0x4)+_0x598d('0x38'));var _0x552afa;return aws['polly'](_0x2cdc58,_0x5e1b02,_0x395b34,_0x899cbe,_0x5f5cc4,_0x1e6706,_0x58d8da)['then'](function(){_0x552afa=path[_0x598d('0x3b')](__dirname,_0x598d('0x25'),rs['generate'](0x4)+_0x598d('0x27'));return convertFile(_0x58d8da,_0x552afa);})[_0x598d('0x2a')](function(){try{fs[_0x598d('0x1e')](_0x58d8da);fs[_0x598d('0x3e')](_0x552afa,_0x598d('0x2b'));}catch(_0x244280){logger[_0x598d('0x16')](_0x244280);}return _0x552afa[_0x598d('0x2c')]('.')[0x0];});};exports['awsLex']=function(_0x26381b,_0x562758,_0x3a4135,_0xc3e6c0,_0x398a93,_0x5b6e31){return aws[_0x598d('0x5f')](_0x26381b,_0x562758,_0x3a4135,_0xc3e6c0,_0x398a93,_0x5b6e31)['then'](function(_0x28980e){logger[_0x598d('0x1b')](JSON[_0x598d('0x60')](_0x28980e));return _0x28980e;});};exports['ispeechTTS']=function(_0x4b825f,_0x106a17,_0x3ff6d9,_0x42bb39){var _0x2ba877=util[_0x598d('0x61')](_0x598d('0x62'),ISPEECH_API,_0x4b825f,encodeURIComponent(_0x106a17),_0x3ff6d9,_0x42bb39);var _0x405217=path[_0x598d('0x3b')](__dirname,'tmp',rs[_0x598d('0x26')](0x4)+_0x598d('0x38'));var _0xd3b2c;return downloadFile(_0x2ba877,_0x405217)[_0x598d('0x2a')](function(){_0xd3b2c=path[_0x598d('0x3b')](__dirname,_0x598d('0x25'),rs[_0x598d('0x26')](0x4)+_0x598d('0x27'));return convertFile(_0x405217,_0xd3b2c);})[_0x598d('0x2a')](function(){try{fs[_0x598d('0x1e')](_0x405217);fs[_0x598d('0x3e')](_0xd3b2c,_0x598d('0x2b'));}catch(_0x571ad8){logger[_0x598d('0x16')](_0x571ad8);}return _0xd3b2c['split']('.')[0x0];});};exports[_0x598d('0x63')]=function(_0x54fa29,_0x49d345,_0x324f5d,_0x44bd2f){var _0x5d1db4=util[_0x598d('0x61')](_0x598d('0x64'),ISPEECH_API,_0x49d345,_0x324f5d,base64Encode(_0x54fa29),_0x44bd2f?util[_0x598d('0x61')]('model=%s',encodeURIComponent(_0x44bd2f)):_0x598d('0x65'));return uploadFile(_0x5d1db4)[_0x598d('0x2a')](function(_0x39c596){return querystring[_0x598d('0x4')](_0x39c596);});};exports[_0x598d('0x66')]=function(_0x3c2cfc,_0x464663){return sestek['nda'](_0x3c2cfc,_0x464663)[_0x598d('0x2a')](function(_0x2f0d64){logger[_0x598d('0x1b')](JSON[_0x598d('0x60')](_0x2f0d64));var _0xf76edc={'speech':_0x2f0d64[_0x598d('0x67')],'action':_0x2f0d64['channelData']?_0x2f0d64[_0x598d('0x68')][_0x598d('0x69')]:undefined,'actiondata':_0x2f0d64[_0x598d('0x68')]?_0x2f0d64['channelData']['CustomActionData']:undefined};if(_0x2f0d64['channelData']&&_0x2f0d64[_0x598d('0x68')]['AudioFromTts']){return base64Decode(_0x2f0d64[_0x598d('0x68')][_0x598d('0x6a')]['Data'],path[_0x598d('0x3b')](__dirname,_0x598d('0x25'),rs['generate'](0x4)+_0x598d('0x27')))['then'](function(_0x5e75ab){_0xf76edc[_0x598d('0x6b')]=_0x5e75ab;return _0xf76edc;});}return _0xf76edc;});};exports[_0x598d('0x6c')]=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 19f0b69..67c297b 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 _0x9485=['exports','./nda'];(function(_0x3e3064,_0x3dd6f5){var _0x4547e1=function(_0x785d07){while(--_0x785d07){_0x3e3064['push'](_0x3e3064['shift']());}};_0x4547e1(++_0x3dd6f5);}(_0x9485,0x8b));var _0x5948=function(_0x1304a1,_0x1361b9){_0x1304a1=_0x1304a1-0x0;var _0xba62c7=_0x9485[_0x1304a1];return _0xba62c7;};var nda=require(_0x5948('0x0'));module[_0x5948('0x1')]={'nda':nda}; \ No newline at end of file +var _0xf83a=['./nda','exports'];(function(_0x598ec6,_0x17113e){var _0x54de2d=function(_0x11889e){while(--_0x11889e){_0x598ec6['push'](_0x598ec6['shift']());}};_0x54de2d(++_0x17113e);}(_0xf83a,0x1b0));var _0xaf83=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0xf83a[_0x585d81];return _0x1aca0d;};var nda=require(_0xaf83('0x0'));module[_0xaf83('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 09864d3..9191132 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 _0x676d=['POST','password','username','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','access_token','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','agi','exports'];(function(_0x1c4ff8,_0x28faf8){var _0xe7bae7=function(_0x5a45f9){while(--_0x5a45f9){_0x1c4ff8['push'](_0x1c4ff8['shift']());}};_0xe7bae7(++_0x28faf8);}(_0x676d,0x97));var _0xd676=function(_0x58e3ae,_0x2a8941){_0x58e3ae=_0x58e3ae-0x0;var _0x2f93b4=_0x676d[_0x58e3ae];return _0x2f93b4;};'use strict';var rp=require(_0xd676('0x0'));var url=require('url');var logger=require(_0xd676('0x1'))(_0xd676('0x2'));module[_0xd676('0x3')]=function(_0x3cc0e2,_0x5d604a){var _0x2ef0e1={'method':_0xd676('0x4'),'uri':url['resolve'](_0x5d604a['ndauth_url'],'/token'),'form':{'grant_type':_0xd676('0x5'),'username':_0x5d604a[_0xd676('0x6')],'password':_0x5d604a['password']},'json':!![]};return rp(_0x2ef0e1)[_0xd676('0x7')](function(_0x249519){var _0x2df0d6={'method':_0xd676('0x4'),'uri':url[_0xd676('0x8')](_0x5d604a[_0xd676('0x9')],_0xd676('0xa')),'body':{'type':_0x5d604a[_0xd676('0xb')]||_0xd676('0xc'),'channelId':_0xd676('0xd'),'conversation':{'id':_0x3cc0e2[_0xd676('0xe')]},'from':{'id':_0x3cc0e2[_0xd676('0xf')],'name':_0x3cc0e2['calleridname']},'recipient':{'id':_0x3cc0e2[_0xd676('0x10')],'name':_0x3cc0e2[_0xd676('0x11')]},'text':_0x5d604a['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x249519[_0xd676('0x12')]},'json':!![]};if(_0x5d604a['project']){_0x2df0d6[_0xd676('0x13')][_0xd676('0x14')][_0xd676('0x15')]=_0x5d604a[_0xd676('0x16')];}if(_0x5d604a[_0xd676('0x17')]=='1'){_0x2df0d6[_0xd676('0x13')][_0xd676('0x14')][_0xd676('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x5d604a[_0xd676('0x19')]){_0x2df0d6[_0xd676('0x13')]['channelData'][_0xd676('0x1a')]=_0x5d604a['custom_action'];if(_0x5d604a[_0xd676('0x1b')]){_0x2df0d6[_0xd676('0x13')]['channelData'][_0xd676('0x1c')]=_0x5d604a[_0xd676('0x1b')];}}logger[_0xd676('0x1d')](JSON[_0xd676('0x1e')](_0x2df0d6));return rp(_0x2df0d6);});}; \ No newline at end of file +var _0x143d=['CustomActionData','stringify','url','../../../../../config/logger','agi','POST','resolve','ndauth_url','/token','password','username','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','text','access_token','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','CustomAction','custom_action','custom_action_data'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x143d,0x8e));var _0xd143=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x143d[_0x32b542];return _0x554d54;};'use strict';var rp=require('request-promise');var url=require(_0xd143('0x0'));var logger=require(_0xd143('0x1'))(_0xd143('0x2'));module['exports']=function(_0x250894,_0x3505cb){var _0x512819={'method':_0xd143('0x3'),'uri':url[_0xd143('0x4')](_0x3505cb[_0xd143('0x5')],_0xd143('0x6')),'form':{'grant_type':_0xd143('0x7'),'username':_0x3505cb[_0xd143('0x8')],'password':_0x3505cb[_0xd143('0x7')]},'json':!![]};return rp(_0x512819)['then'](function(_0x240b27){var _0x4f599b={'method':'POST','uri':url[_0xd143('0x4')](_0x3505cb['ndassistant_url'],_0xd143('0x9')),'body':{'type':_0x3505cb[_0xd143('0xa')]||_0xd143('0xb'),'channelId':_0xd143('0xc'),'conversation':{'id':_0x250894[_0xd143('0xd')]},'from':{'id':_0x250894[_0xd143('0xe')],'name':_0x250894[_0xd143('0xf')]},'recipient':{'id':_0x250894['dnid'],'name':_0x250894['extension']},'text':_0x3505cb[_0xd143('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x240b27[_0xd143('0x11')]},'json':!![]};if(_0x3505cb['project']){_0x4f599b[_0xd143('0x12')][_0xd143('0x13')][_0xd143('0x14')]=_0x3505cb['project'];}if(_0x3505cb[_0xd143('0x15')]=='1'){_0x4f599b['body'][_0xd143('0x13')][_0xd143('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x3505cb['custom_action']){_0x4f599b[_0xd143('0x12')][_0xd143('0x13')][_0xd143('0x17')]=_0x3505cb[_0xd143('0x18')];if(_0x3505cb[_0xd143('0x19')]){_0x4f599b[_0xd143('0x12')]['channelData'][_0xd143('0x1a')]=_0x3505cb[_0xd143('0x19')];}}logger['info'](JSON[_0xd143('0x1b')](_0x4f599b));return rp(_0x4f599b);});}; \ 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 65d2fca..91b1a10 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 _0x54e9=['./lib/api'];(function(_0x5a8411,_0x353229){var _0x235174=function(_0x877833){while(--_0x877833){_0x5a8411['push'](_0x5a8411['shift']());}};_0x235174(++_0x353229);}(_0x54e9,0x98));var _0x954e=function(_0x12ca51,_0x41d6dd){_0x12ca51=_0x12ca51-0x0;var _0x433d9b=_0x54e9[_0x12ca51];return _0x433d9b;};'use strict';var asr=require(_0x954e('0x0'));module['exports']=function(_0x93b875,_0x175740,_0x36fa9d,_0x1efca1){return asr(_0x93b875,_0x175740,_0x36fa9d,_0x1efca1);}; \ No newline at end of file +var _0x9b9a=['exports','./lib/api'];(function(_0xd1a7ac,_0x5abde7){var _0x24a7e7=function(_0x38ebfd){while(--_0x38ebfd){_0xd1a7ac['push'](_0xd1a7ac['shift']());}};_0x24a7e7(++_0x5abde7);}(_0x9b9a,0x119));var _0xa9b9=function(_0x2addfb,_0x31adfd){_0x2addfb=_0x2addfb-0x0;var _0x410f25=_0x9b9a[_0x2addfb];return _0x410f25;};'use strict';var asr=require(_0xa9b9('0x0'));module[_0xa9b9('0x1')]=function(_0x2ef18e,_0x1c4c67,_0x1bc902,_0x44d9a6){return asr(_0x2ef18e,_0x1c4c67,_0x1bc902,_0x44d9a6);}; \ 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 e71b94c..1edbf3d 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 _0xbe6e=['EOS','error','Tilde\x20ASR\x20send\x20error','result','final','transcript','hypotheses','likelihood','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','lodash','moment','crypto','../../../../../../config/logger','agi','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','stringify','data','send','close'];(function(_0x23128b,_0x2dae42){var _0x18d094=function(_0x214614){while(--_0x214614){_0x23128b['push'](_0x23128b['shift']());}};_0x18d094(++_0x2dae42);}(_0xbe6e,0x1ce));var _0xebe6=function(_0x22b0c8,_0xdf3e85){_0x22b0c8=_0x22b0c8-0x0;var _0xf7cfc0=_0xbe6e[_0x22b0c8];return _0xf7cfc0;};'use strict';var BPromise=require('bluebird');var _=require(_0xebe6('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xebe6('0x1'));var crypto=require(_0xebe6('0x2'));var logger=require(_0xebe6('0x3'))(_0xebe6('0x4'));module['exports']=function(_0x3e40c8,_0x289188,_0x2793e4,_0xbb8f00){return new BPromise(function(_0x51249d,_0x4737f4){logger[_0xebe6('0x5')](_0xebe6('0x6'),_0xbb8f00||_0xebe6('0x7'));var _0x499f5f=new WebSocket(_0xbb8f00||_0xebe6('0x7'),{'perMessageDeflate':![]});var _0x4d8966='';var _0x10216f='0';var _0x2e7784='1';var _0x160982=_0xebe6('0x8');function _0x1f8511(_0x5acf7c){var _0x321847=crypto[_0xebe6('0x9')](_0xebe6('0xa'));_0x321847[_0xebe6('0xb')](_0x5acf7c);return _0x321847[_0xebe6('0xc')](_0xebe6('0xd'));}function _0x1a1d2d(){try{logger['info'](_0xebe6('0xe'));var _0x5d44d9=moment()['unix']();var _0x3a1d14=_0x1f8511(_0x5d44d9+_0x289188+_0x2793e4);_0x499f5f['send'](JSON[_0xebe6('0xf')]({'appID':_0x289188,'timestamp':_0x5d44d9,'appKey':_0x3a1d14}));var _0x5ddb41=fs['createReadStream'](_0x3e40c8);_0x5ddb41['on'](_0xebe6('0x10'),function(_0x4121b4){_0x499f5f[_0xebe6('0x11')](_0x4121b4);});_0x5ddb41['on'](_0xebe6('0x12'),function(){_0x499f5f[_0xebe6('0x11')](_0xebe6('0x13'));});}catch(_0x4a30fd){logger[_0xebe6('0x14')](_0xebe6('0x15'),JSON['stringify'](_0x4a30fd));_0x499f5f['terminate']();}}function _0x1d1852(_0x46ab50){try{if(_0x46ab50){var _0x534d3d=JSON['parse'](_0x46ab50);switch(_0x534d3d['status']){case 0x0:if(_0x534d3d[_0xebe6('0x16')]){if(_0x534d3d[_0xebe6('0x16')][_0xebe6('0x17')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0xebe6('0xf')](_0x534d3d[_0xebe6('0x16')]['hypotheses']));_0x4d8966=_0x534d3d['result']['hypotheses'][0x0][_0xebe6('0x18')];_0x10216f=_0x534d3d[_0xebe6('0x16')][_0xebe6('0x19')][0x0][_0xebe6('0x1a')];_0x2e7784='0';_0x160982='Success.';_0x499f5f[_0xebe6('0x1b')]();}}break;case 0x1:logger[_0xebe6('0x5')](_0xebe6('0x8'));_0x2e7784='1';_0x160982=_0xebe6('0x8');break;case 0x2:logger[_0xebe6('0x5')](_0xebe6('0x1c'));_0x2e7784='2';_0x160982='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xebe6('0x5')](_0xebe6('0x1d'));_0x2e7784='9';_0x160982=_0xebe6('0x1d');break;case 0xa:logger[_0xebe6('0x5')](_0xebe6('0x1e'));_0x2e7784='10';_0x160982=_0xebe6('0x1e');break;case 0xb:logger[_0xebe6('0x5')](_0xebe6('0x1f'));_0x2e7784='11';_0x160982=_0xebe6('0x1f');}}}catch(_0x5ec372){logger[_0xebe6('0x14')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x5ec372));_0x499f5f[_0xebe6('0x1b')]();}}function _0x1ccc1(){logger[_0xebe6('0x5')](_0xebe6('0x20'));_0x51249d({'transcript':_0x4d8966,'confidence':_0x10216f,'status':_0x2e7784,'status_message':_0x160982});}function _0x246343(_0x539444){logger['error'](_0xebe6('0x21'));if(!_['isNil'](_0x539444)){logger[_0xebe6('0x14')](_[_0xebe6('0x22')](_0x539444)?JSON[_0xebe6('0xf')](_0x539444):_0x539444);}}_0x499f5f['on'](_0xebe6('0x23'),_0x1a1d2d);_0x499f5f['on'](_0xebe6('0x24'),_0x1d1852);_0x499f5f['on'](_0xebe6('0x12'),_0x1ccc1);_0x499f5f['on'](_0xebe6('0x14'),_0x246343);});}; \ No newline at end of file +var _0x5f1f=['wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info'];(function(_0x31e45c,_0xbb07fd){var _0x3d3542=function(_0x4ffda7){while(--_0x4ffda7){_0x31e45c['push'](_0x31e45c['shift']());}};_0x3d3542(++_0xbb07fd);}(_0x5f1f,0x129));var _0xf5f1=function(_0x1e3c02,_0x5c07a2){_0x1e3c02=_0x1e3c02-0x0;var _0x4d26d7=_0x5f1f[_0x1e3c02];return _0x4d26d7;};'use strict';var BPromise=require(_0xf5f1('0x0'));var _=require(_0xf5f1('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf5f1('0x2'));var crypto=require(_0xf5f1('0x3'));var logger=require(_0xf5f1('0x4'))('agi');module[_0xf5f1('0x5')]=function(_0x47b53a,_0x4f885e,_0x45da6b,_0x5d32b7){return new BPromise(function(_0x4545df,_0xa0bca4){logger[_0xf5f1('0x6')]('Tilde\x20URI',_0x5d32b7||_0xf5f1('0x7'));var _0x3cbbe1=new WebSocket(_0x5d32b7||_0xf5f1('0x7'),{'perMessageDeflate':![]});var _0x1df8e9='';var _0x5c4845='0';var _0xcfcc6b='1';var _0x2f98d5=_0xf5f1('0x8');function _0x36de8e(_0x1c9096){var _0x5e8426=crypto[_0xf5f1('0x9')](_0xf5f1('0xa'));_0x5e8426['update'](_0x1c9096);return _0x5e8426['digest'](_0xf5f1('0xb'));}function _0x1b0268(){try{logger[_0xf5f1('0x6')](_0xf5f1('0xc'));var _0x839e7e=moment()['unix']();var _0x161005=_0x36de8e(_0x839e7e+_0x4f885e+_0x45da6b);_0x3cbbe1[_0xf5f1('0xd')](JSON[_0xf5f1('0xe')]({'appID':_0x4f885e,'timestamp':_0x839e7e,'appKey':_0x161005}));var _0x34224b=fs['createReadStream'](_0x47b53a);_0x34224b['on'](_0xf5f1('0xf'),function(_0x312e8e){_0x3cbbe1[_0xf5f1('0xd')](_0x312e8e);});_0x34224b['on'](_0xf5f1('0x10'),function(){_0x3cbbe1['send'](_0xf5f1('0x11'));});}catch(_0x15d73e){logger[_0xf5f1('0x12')](_0xf5f1('0x13'),JSON['stringify'](_0x15d73e));_0x3cbbe1[_0xf5f1('0x14')]();}}function _0x10f2d9(_0x567adc){try{if(_0x567adc){var _0x58e8fa=JSON[_0xf5f1('0x15')](_0x567adc);switch(_0x58e8fa[_0xf5f1('0x16')]){case 0x0:if(_0x58e8fa[_0xf5f1('0x17')]){if(_0x58e8fa[_0xf5f1('0x17')]['final']){logger[_0xf5f1('0x6')](_0xf5f1('0x18'),JSON['stringify'](_0x58e8fa[_0xf5f1('0x17')]['hypotheses']));_0x1df8e9=_0x58e8fa[_0xf5f1('0x17')][_0xf5f1('0x19')][0x0][_0xf5f1('0x1a')];_0x5c4845=_0x58e8fa[_0xf5f1('0x17')][_0xf5f1('0x19')][0x0][_0xf5f1('0x1b')];_0xcfcc6b='0';_0x2f98d5=_0xf5f1('0x1c');_0x3cbbe1[_0xf5f1('0x14')]();}}break;case 0x1:logger[_0xf5f1('0x6')](_0xf5f1('0x8'));_0xcfcc6b='1';_0x2f98d5=_0xf5f1('0x8');break;case 0x2:logger[_0xf5f1('0x6')](_0xf5f1('0x1d'));_0xcfcc6b='2';_0x2f98d5=_0xf5f1('0x1d');break;case 0x9:logger[_0xf5f1('0x6')](_0xf5f1('0x1e'));_0xcfcc6b='9';_0x2f98d5=_0xf5f1('0x1e');break;case 0xa:logger['info'](_0xf5f1('0x1f'));_0xcfcc6b='10';_0x2f98d5=_0xf5f1('0x1f');break;case 0xb:logger[_0xf5f1('0x6')](_0xf5f1('0x20'));_0xcfcc6b='11';_0x2f98d5=_0xf5f1('0x20');}}}catch(_0x691f1a){logger['error'](_0xf5f1('0x21'),JSON[_0xf5f1('0xe')](_0x691f1a));_0x3cbbe1[_0xf5f1('0x14')]();}}function _0x5c6539(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x4545df({'transcript':_0x1df8e9,'confidence':_0x5c4845,'status':_0xcfcc6b,'status_message':_0x2f98d5});}function _0x1ffedc(_0x353d92){logger['error'](_0xf5f1('0x22'));if(!_[_0xf5f1('0x23')](_0x353d92)){logger[_0xf5f1('0x12')](_['isObject'](_0x353d92)?JSON[_0xf5f1('0xe')](_0x353d92):_0x353d92);}}_0x3cbbe1['on'](_0xf5f1('0x24'),_0x1b0268);_0x3cbbe1['on'](_0xf5f1('0x25'),_0x10f2d9);_0x3cbbe1['on'](_0xf5f1('0x10'),_0x5c6539);_0x3cbbe1['on'](_0xf5f1('0x12'),_0x1ffedc);});}; \ 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 444d6d8..836bcd9 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 _0xb6a6=['./asr','exports'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0xb6a6,0x1a0));var _0x6b6a=function(_0x546a84,_0x336f70){_0x546a84=_0x546a84-0x0;var _0x4fd4d0=_0xb6a6[_0x546a84];return _0x4fd4d0;};var asr=require(_0x6b6a('0x0'));module[_0x6b6a('0x1')]={'asr':asr}; \ No newline at end of file +var _0x5b5f=['exports','./asr'];(function(_0x465073,_0xc6d08){var _0x5d0508=function(_0x10e30c){while(--_0x10e30c){_0x465073['push'](_0x465073['shift']());}};_0x5d0508(++_0xc6d08);}(_0x5b5f,0x1a7));var _0xf5b5=function(_0x377d12,_0x37769b){_0x377d12=_0x377d12-0x0;var _0x84eda9=_0x5b5f[_0x377d12];return _0x84eda9;};var asr=require(_0xf5b5('0x0'));module[_0xf5b5('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index a3b150f..a0143e6 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 _0x87df=['E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','close','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x87df,0x167));var _0xf87d=function(_0x2ace95,_0x186b37){_0x2ace95=_0x2ace95-0x0;var _0x35ecfa=_0x87df[_0x2ace95];return _0x35ecfa;};'use strict';var util=require(_0xf87d('0x0'));var net=require(_0xf87d('0x1'));var EventEmitter=require(_0xf87d('0x2'))[_0xf87d('0x3')];var AGIError=require(_0xf87d('0x4'));var AGIChannel=require(_0xf87d('0x5'));var AGIServer=function(_0x541a39,_0xb0fb5a,_0x25290a){var _0x1d4ff6=this,_0x541a39=_0x541a39||0x11dd,_0xb0fb5a=_0xb0fb5a||'127.0.0.1',_0x38045e=null,_0x40a15b=0x0;EventEmitter[_0xf87d('0x6')](_0x1d4ff6);function _0x3870f8(){if(!_0x541a39){_0x1d4ff6[_0xf87d('0x7')](_0xf87d('0x8'),new AGIError(_0xf87d('0x9')));return![];}_0x38045e=net[_0xf87d('0xa')]();_0x38045e[_0xf87d('0xb')](_0x541a39,_0xb0fb5a);_0x38045e['on'](_0xf87d('0xc'),function(){_0x1d4ff6[_0xf87d('0x7')](_0xf87d('0xc'));});_0x38045e['on'](_0xf87d('0xd'),function(_0x390e6a){_0x38045e[_0xf87d('0xe')](function(_0x12d013,_0x23a1fe){if(_0x12d013){_0x1d4ff6['emit'](_0xf87d('0x8'),new AGIError(_0xf87d('0xf'),_0x12d013));}else if(_0x25290a&&_0x25290a<0x0){_0x1d4ff6[_0xf87d('0x7')]('error',new AGIError(_0xf87d('0x10')));_0x390e6a[_0xf87d('0x11')]();}else if(_0x25290a&&_0x25290a>0x0&&_0x25290a<_0x23a1fe){_0x40a15b+=0x1;_0x1d4ff6[_0xf87d('0x7')](_0xf87d('0x8'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x40a15b));_0x390e6a[_0xf87d('0x11')]();}else{var _0x2487f0=new AGIChannel(_0x390e6a);_0x2487f0['on']('ready',function(){_0x1d4ff6[_0xf87d('0x7')](_0xf87d('0xd'),_0x2487f0);});}});});_0x38045e['on'](_0xf87d('0x8'),function(_0x368872){_0x1d4ff6[_0xf87d('0x7')](_0xf87d('0x8'),new AGIError(_0xf87d('0xf'),_0x368872['code']));});_0x38045e['on'](_0xf87d('0x12'),function(){_0x1d4ff6[_0xf87d('0x7')](_0xf87d('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xf87d('0x13')](function(){_0x3870f8();});};util[_0xf87d('0x14')](AGIServer,EventEmitter);module[_0xf87d('0x15')]=function(_0x394d44,_0x26cd28,_0x350bee){return new AGIServer(_0x394d44,_0x26cd28,_0x350bee);}; \ No newline at end of file +var _0x5309=['exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','emit','E_AGI_ARGUMENT_PORT','createServer','listen','listening','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','code','close','E_AGI_SERVER_CLOSE','nextTick'];(function(_0x3f6b1b,_0x58d3d6){var _0x4a3d2b=function(_0x5648f0){while(--_0x5648f0){_0x3f6b1b['push'](_0x3f6b1b['shift']());}};_0x4a3d2b(++_0x58d3d6);}(_0x5309,0x1aa));var _0x9530=function(_0x4b4638,_0xe99cda){_0x4b4638=_0x4b4638-0x0;var _0x59e92b=_0x5309[_0x4b4638];return _0x59e92b;};'use strict';var util=require(_0x9530('0x0'));var net=require(_0x9530('0x1'));var EventEmitter=require(_0x9530('0x2'))[_0x9530('0x3')];var AGIError=require(_0x9530('0x4'));var AGIChannel=require(_0x9530('0x5'));var AGIServer=function(_0x322ca0,_0x13abba,_0x169a84){var _0x41a9c1=this,_0x322ca0=_0x322ca0||0x11dd,_0x13abba=_0x13abba||_0x9530('0x6'),_0x1cb512=null,_0x187678=0x0;EventEmitter['call'](_0x41a9c1);function _0x5f5c1d(){if(!_0x322ca0){_0x41a9c1[_0x9530('0x7')]('error',new AGIError(_0x9530('0x8')));return![];}_0x1cb512=net[_0x9530('0x9')]();_0x1cb512[_0x9530('0xa')](_0x322ca0,_0x13abba);_0x1cb512['on'](_0x9530('0xb'),function(){_0x41a9c1[_0x9530('0x7')](_0x9530('0xb'));});_0x1cb512['on']('connection',function(_0x5e2a4b){_0x1cb512[_0x9530('0xc')](function(_0x26b0e0,_0x46825d){if(_0x26b0e0){_0x41a9c1[_0x9530('0x7')](_0x9530('0xd'),new AGIError(_0x9530('0xe'),_0x26b0e0));}else if(_0x169a84&&_0x169a84<0x0){_0x41a9c1[_0x9530('0x7')](_0x9530('0xd'),new AGIError(_0x9530('0xf')));_0x5e2a4b[_0x9530('0x10')]();}else if(_0x169a84&&_0x169a84>0x0&&_0x169a84<_0x46825d){_0x187678+=0x1;_0x41a9c1[_0x9530('0x7')]('error',new AGIError(_0x9530('0x11'),_0x187678));_0x5e2a4b['destroy']();}else{var _0x3b1c4f=new AGIChannel(_0x5e2a4b);_0x3b1c4f['on'](_0x9530('0x12'),function(){_0x41a9c1['emit'](_0x9530('0x13'),_0x3b1c4f);});}});});_0x1cb512['on'](_0x9530('0xd'),function(_0x4e08cc){_0x41a9c1[_0x9530('0x7')](_0x9530('0xd'),new AGIError(_0x9530('0xe'),_0x4e08cc[_0x9530('0x14')]));});_0x1cb512['on'](_0x9530('0x15'),function(){_0x41a9c1['emit']('close',new AGIError(_0x9530('0x16')));});}process[_0x9530('0x17')](function(){_0x5f5c1d();});};util['inherits'](AGIServer,EventEmitter);module[_0x9530('0x18')]=function(_0x460dab,_0x3800d6,_0x4ea7a3){return new AGIServer(_0x460dab,_0x3800d6,_0x4ea7a3);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index f7a434e..09c3178 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 _0x1261=['uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','split','getAndSetVariable','isConfigured','retry','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','minutes','callback_priority','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','result','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query','createSquareDetailsReport','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','%s[%s][%s]','setVariable','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','SIP/%s','opts','Executed\x20command\x20%s','DIAL','no\x20key\x20configured','bot','DIALOGFLOW_%s','toUpperCase','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','maxRetry','file_id','no\x20file\x20audio\x20found','response','maxdigit','test','extra','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','no\x20valid\x20credentials\x20configured','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','isString','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','NOBEEP','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s/recordings/%s','beep','recordFile','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','agentLogin','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','operation','%s[%s]','no\x20file\x20audio\x20selected','getData','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','getPause','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','then','name','catch','prototype','getVoiceQueue','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','scheduledAt','callback','toString','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','timeout','number','includes','PUT','method','rawBody','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync'];(function(_0x29319b,_0x9f461){var _0x40df0f=function(_0x7121df){while(--_0x7121df){_0x29319b['push'](_0x29319b['shift']());}};_0x40df0f(++_0x9f461);}(_0x1261,0x144));var _0x1126=function(_0x2de0ab,_0x353746){_0x2de0ab=_0x2de0ab-0x0;var _0x7f8af9=_0x1261[_0x2de0ab];return _0x7f8af9;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x1126('0x0'));var _=require(_0x1126('0x1'));var sh=require(_0x1126('0x2'));var odbc=require(_0x1126('0x3'))();var rs=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var rp=require(_0x1126('0x7'));var logger=require(_0x1126('0x8'))(_0x1126('0x9'));var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH=_0x1126('0xa');var recursiveMapAttributes=[_0x1126('0xb'),'rawBody'];var verticesWithRetry=[_0x1126('0xc'),_0x1126('0xd'),_0x1126('0xe')];var AGIVertices=function(_0x3abb0b,_0x2d9033,_0x59cfa1){this[_0x1126('0xf')]=_0x3abb0b;this[_0x1126('0x10')]=_0x2d9033;this[_0x1126('0x11')]=_0x59cfa1;};AGIVertices['prototype'][_0x1126('0x12')]=function(_0x5d581b,_0x52ef15){this[_0x1126('0x10')]['getVariableById'](_0x5d581b)[_0x1126('0x13')](function(_0x1b364a){_0x52ef15(null,_0x1b364a?_0x1b364a[_0x1126('0x14')]:![]);})[_0x1126('0x15')](function(_0xca0355){_0x52ef15(_0xca0355);});};AGIVertices[_0x1126('0x16')][_0x1126('0x17')]=function(_0x2048ad,_0x43850b){this['rpc']['getVoiceQueueById'](_0x2048ad)[_0x1126('0x13')](function(_0x154e20){_0x43850b(null,_0x154e20?_0x154e20[_0x1126('0x14')]:![]);})['catch'](function(_0x45149c){_0x43850b(_0x45149c);});};AGIVertices['prototype'][_0x1126('0x18')]=function(_0x42f379,_0x257b5f){this['rpc'][_0x1126('0x19')](_0x42f379)[_0x1126('0x13')](function(_0x4a7b49){_0x257b5f(null,_0x4a7b49?_0x4a7b49['name']:![]);})[_0x1126('0x15')](function(_0x2b2487){_0x257b5f(_0x2b2487);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x4564c0,_0x58b109){this[_0x1126('0x10')][_0x1126('0x1a')](_0x4564c0)[_0x1126('0x13')](function(_0x54400a){_0x58b109(null,_0x54400a?_0x54400a[_0x1126('0x1b')]:![]);})['catch'](function(_0x56efeb){_0x58b109(_0x56efeb);});};AGIVertices[_0x1126('0x16')][_0x1126('0x1c')]=function(_0x25b24b,_0x36d254){this['rpc'][_0x1126('0x1d')](_0x25b24b)[_0x1126('0x13')](function(_0x48a08d){_0x36d254(null,_0x48a08d?_0x48a08d[_0x1126('0x14')]:![]);})['catch'](function(_0x529dd9){_0x36d254(_0x529dd9);});};AGIVertices['prototype'][_0x1126('0x1e')]=function(_0x15bcc3,_0x329914){this[_0x1126('0x10')][_0x1126('0x1f')](_0x15bcc3)[_0x1126('0x13')](function(_0xea0971){_0x329914(null,_0xea0971?_0xea0971[_0x1126('0x14')]:![]);})['catch'](function(_0x35eec3){_0x329914(_0x35eec3);});};AGIVertices[_0x1126('0x16')][_0x1126('0x20')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=this;this[_0x1126('0x10')]['getSoundById'](_0x5ddf63)[_0x1126('0x13')](function(_0x23d2bc){_0x541bc9(null,_0x23d2bc?_0xeb7d89['getSoundPath'](_0x23d2bc[_0x1126('0x21')]):![]);})['catch'](function(_0xc62460){_0x541bc9(_0xc62460);});};AGIVertices['prototype'][_0x1126('0x22')]=function(_0x583ce6,_0x378f4d){this['rpc']['getMailAccountById'](_0x583ce6)['then'](function(_0x17646e){_0x378f4d(null,_0x17646e?_0x17646e:![]);})[_0x1126('0x15')](function(_0x1cef48){_0x378f4d(_0x1cef48);});};AGIVertices['prototype'][_0x1126('0x23')]=function(_0x226afb,_0x56f7f8,_0x3dd50e){this[_0x1126('0x11')][_0x1126('0x23')](_0x226afb,_0x56f7f8)[_0x1126('0x13')](function(){_0x3dd50e(null);})['catch'](function(_0x5ecbc3){_0x3dd50e(_0x5ecbc3);});};AGIVertices[_0x1126('0x16')][_0x1126('0x24')]=function(_0x2d9bd2,_0x2c67eb){this['rpc'][_0x1126('0x25')](_0x2d9bd2)[_0x1126('0x13')](function(_0x313ebe){if(_0x313ebe){if(_0x313ebe[_0x1126('0x26')]){_0x2c67eb(null,[_0x313ebe[_0x1126('0x27')]]);}else{_0x2c67eb(null,_['map'](_0x313ebe[_0x1126('0x28')],_0x1126('0x27')));}}else{_0x2c67eb(null,![]);}})[_0x1126('0x15')](function(_0x42e773){_0x2c67eb(_0x42e773);});};AGIVertices['prototype']['getSoundPath']=function(_0x22827a){return util[_0x1126('0x29')]('%s/sounds/converted/%s',FILES_PATH,_0x22827a);};AGIVertices[_0x1126('0x16')][_0x1126('0x2a')]=function(_0x11b0f6,_0x5c08b9,_0x4b3859){odbc[_0x1126('0x2b')](_0x11b0f6,function(_0xbc0710){if(_0xbc0710){logger[_0x1126('0x2c')](_0x1126('0x2d'),_0xbc0710);_0x4b3859(_0xbc0710);}else{logger['info'](_0x1126('0x2e'));odbc['query'](_0x5c08b9,function(_0x8abfe3,_0x20e43a){if(_0x8abfe3){logger[_0x1126('0x2f')](_0x1126('0x30'),_0x5c08b9);_0x4b3859(_0x8abfe3);}else{logger[_0x1126('0x2f')]('Query\x20executed\x20correctly\x20%s',_0x5c08b9);odbc[_0x1126('0x31')](function(_0x3ea9de){if(_0x3ea9de){logger[_0x1126('0x2c')](_0x1126('0x32'),_0x3ea9de);}_0x4b3859(null,_0x20e43a);});}});}});};AGIVertices[_0x1126('0x16')][_0x1126('0x33')]=function(_0x3052f9,_0x4faaa3){this[_0x1126('0x10')][_0x1126('0x34')](_0x3052f9)[_0x1126('0x13')](function(_0xf3a0bd){_0x4faaa3(null,_0xf3a0bd?_0xf3a0bd:![]);})[_0x1126('0x15')](function(_0x518de1){_0x4faaa3(_0x518de1);});};AGIVertices['prototype'][_0x1126('0x35')]=function(_0x219bcc,_0xcee9de){this[_0x1126('0x10')][_0x1126('0x35')](_0x219bcc)[_0x1126('0x13')](function(_0x5489c0){_0xcee9de(null,_0x5489c0);})['catch'](function(_0x4cb1db){_0xcee9de(_0x4cb1db);});};AGIVertices[_0x1126('0x16')]['createSquareDetailsReport']=function(_0xf84005,_0x462da8,_0x3584a3){this[_0x1126('0x10')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x1126('0x36')],'node':_0xf84005[_0x1126('0x37')],'application':_0xf84005[_0x1126('0x38')],'data':_0x462da8||null,'project_name':this['channel'][_0x1126('0x39')],'callerid':this['channel'][_0x1126('0x3a')]})['then'](function(_0x2646d7){if(_0x3584a3){_0x3584a3(null,_0x2646d7);}})[_0x1126('0x15')](function(_0x1006fb){if(_0x3584a3){_0x3584a3(_0x1006fb);}});};AGIVertices['prototype'][_0x1126('0x3b')]=function(_0x2ffccc,_0xf8ec5f,_0x48c694,_0x58ff3a){this['rpc'][_0x1126('0x3b')]({'uniqueid':this['channel'][_0x1126('0x36')],'callerid':this['channel'][_0x1126('0x3a')],'calleridname':this[_0x1126('0xf')][_0x1126('0x3c')],'context':this[_0x1126('0xf')][_0x1126('0x3d')],'extension':this['channel'][_0x1126('0x3e')],'priority':this[_0x1126('0xf')]['priority'],'accountcode':this[_0x1126('0xf')][_0x1126('0x3f')],'dnid':this['channel'][_0x1126('0x40')],'projectName':this[_0x1126('0xf')]['arg_1'],'saveName':_0xf8ec5f,'filename':_0x2ffccc[_0x1126('0x41')]||_0xf8ec5f,'savePath':_0x48c694})[_0x1126('0x13')](function(_0x213a76){_0x58ff3a(null,_0x213a76);})['catch'](function(_0x3fe7c1){_0x58ff3a(_0x3fe7c1);});};AGIVertices[_0x1126('0x16')][_0x1126('0x42')]=function(_0x5878bb,_0x224456,_0x2081f2){this[_0x1126('0x10')][_0x1126('0x42')]({'uniqueid':this['channel'][_0x1126('0x36')],'body':_0x5878bb,'direction':_0x224456})['then'](function(_0x40168e){if(_0x2081f2){_0x2081f2(null,_0x40168e);}})[_0x1126('0x15')](function(_0x4a1831){if(_0x2081f2){_0x2081f2(_0x4a1831);}});};AGIVertices['prototype'][_0x1126('0x43')]=function(_0x3c1d16,_0x387fe1){this['rpc'][_0x1126('0x43')]({'firstName':_[_0x1126('0x44')](_0x3c1d16[_0x1126('0x14')])||_[_0x1126('0x45')](_0x3c1d16['name'])?_0x1126('0x46')+Math[_0x1126('0x47')]():_0x3c1d16['name'],'lastName':_['isEmpty'](_0x3c1d16['lastName'])||_['isNil'](_0x3c1d16[_0x1126('0x48')])?null:_0x3c1d16[_0x1126('0x48')],'phone':_0x3c1d16['phone'],'ListId':_0x3c1d16[_0x1126('0x49')],'scheduledAt':_0x3c1d16[_0x1126('0x4a')],'callbackUniqueid':this[_0x1126('0xf')][_0x1126('0x36')],'tags':_0x1126('0x4b'),'description':'Callback\x20scheduled\x20at\x20'+_0x3c1d16[_0x1126('0x4a')][_0x1126('0x4c')](),'priority':_0x3c1d16['callback_priority']})[_0x1126('0x13')](function(_0x476aca){_0x387fe1(null,_0x476aca);})[_0x1126('0x15')](function(_0x36b61){_0x387fe1(_0x36b61);});};AGIVertices[_0x1126('0x16')]['getPause']=function(_0x673c09,_0x49aeaa){this[_0x1126('0x10')][_0x1126('0x4d')](_0x673c09)[_0x1126('0x13')](function(_0x590bc2){_0x49aeaa(null,_0x590bc2?_0x590bc2[_0x1126('0x14')]:![]);})[_0x1126('0x15')](function(_0x5763b4){_0x49aeaa(_0x5763b4);});};AGIVertices[_0x1126('0x16')][_0x1126('0x4e')]=function(_0x9bad53,_0x5a5340,_0x2fe6dc){var _0x3377db={'role':_0x1126('0x4f')};_0x3377db[_0x9bad53]=this[_0x1126('0xf')][_0x1126('0x3a')];this[_0x1126('0x10')][_0x1126('0x4e')](_0x3377db,_0x5a5340,this[_0x1126('0xf')]['uniqueid'])[_0x1126('0x13')](function(_0x2db45e){_0x2fe6dc(null,_[_0x1126('0x45')](_0x2db45e)?![]:!![]);})[_0x1126('0x15')](function(_0x425193){logger['error'](_0x425193);_0x2fe6dc(null,![]);});};AGIVertices[_0x1126('0x16')][_0x1126('0x50')]=function(_0x5e0ea1,_0x3767e4){var _0x5246aa={'role':_0x1126('0x4f')};_0x5246aa[_0x5e0ea1]=this[_0x1126('0xf')]['callerid'];this[_0x1126('0x10')][_0x1126('0x50')](_0x5246aa)[_0x1126('0x13')](function(_0x592960){_0x3767e4(null,_[_0x1126('0x45')](_0x592960)?![]:!![]);})['catch'](function(_0x558b6e){logger[_0x1126('0x2c')](_0x558b6e);_0x3767e4(null,![]);});};AGIVertices[_0x1126('0x16')][_0x1126('0x51')]=function(_0x1230e9,_0x3a76ec){var _0x1b4ebf={'role':_0x1126('0x4f')};_0x1b4ebf[_0x1230e9]=this['channel'][_0x1126('0x3a')];this[_0x1126('0x10')][_0x1126('0x51')](_0x1b4ebf)[_0x1126('0x13')](function(_0x3f87aa){_0x3a76ec(null,_[_0x1126('0x45')](_0x3f87aa)?![]:!![]);})['catch'](function(_0x5b17d6){logger[_0x1126('0x2c')](_0x5b17d6);_0x3a76ec(null,![]);});};AGIVertices[_0x1126('0x16')]['agentLogin']=function(_0x5ee130,_0x5e9260){var _0x51a28d={'role':_0x1126('0x4f')};_0x51a28d[_0x5ee130]=this[_0x1126('0xf')][_0x1126('0x3a')];var _0x50f9c7=_0x5ee130!=_0x1126('0x52')?util[_0x1126('0x29')](_0x1126('0x53'),_0x1126('0x54'),this[_0x1126('0xf')][_0x1126('0x3a')]):undefined;this[_0x1126('0x10')]['agentLogin'](_0x51a28d,_0x50f9c7)[_0x1126('0x13')](function(_0x390b69){_0x5e9260(null,_[_0x1126('0x45')](_0x390b69)?![]:!![]);})[_0x1126('0x15')](function(_0x288b9b){logger['error'](_0x288b9b);_0x5e9260(null,![]);});};AGIVertices['prototype'][_0x1126('0x55')]=function(_0x2643d7,_0x4f1b61){sh[_0x1126('0x56')](_[_0x1126('0x57')](_0x2643d7),function(_0x366675,_0x6a41c0){var _0x2828d4=_0x6a41c0[_0x1126('0x58')](/(\r\n|\n|\r)/gm,'');_0x4f1b61(null,_0x2828d4);});};AGIVertices[_0x1126('0x16')][_0x1126('0x59')]=function(_0xd20fbe,_0x3d5e15){scripts[_0x1126('0x59')](_0xd20fbe[_0x1126('0x5a')],_0xd20fbe[_0x1126('0x5b')]||'text',_0xd20fbe[_0x1126('0x5c')],_0xd20fbe[_0x1126('0x5d')]||_0x1126('0x5e'),_0xd20fbe['ssmlGender']||'MALE',_0xd20fbe[_0x1126('0x5f')]||_0x1126('0x60'))[_0x1126('0x13')](function(_0x3bfeb8){_0x3d5e15(null,_0x3bfeb8);})['catch'](function(_0x590ee9){_0x3d5e15(_0x590ee9);});};AGIVertices['prototype'][_0x1126('0x61')]=function(_0x1b355f,_0x3693b9){scripts[_0x1126('0x61')](_0x1b355f['text'],_0x1b355f[_0x1126('0x62')]||'en',0x1)['then'](function(_0x30dea4){_0x3693b9(null,_0x30dea4);})[_0x1126('0x15')](function(_0x3a4e4c){_0x3693b9(_0x3a4e4c);});};AGIVertices[_0x1126('0x16')][_0x1126('0x63')]=function(_0x1e7c9a,_0x9a61b1){var _0x5f5a36={'uri':_0x1e7c9a[_0x1126('0x64')],'method':_0x1e7c9a['method'],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1e7c9a[_0x1126('0x65')])===_0x1126('0x66')&&parseInt(_0x1e7c9a['timeout'])>=0x1?parseInt(_0x1e7c9a[_0x1126('0x65')])*0x3e8:0x5*0x3e8};if(_[_0x1126('0x67')](['POST',_0x1126('0x68')],_0x5f5a36[_0x1126('0x69')]['toUpperCase']())){try{_0x5f5a36['body']=_0x1e7c9a[_0x1126('0x6a')]?JSON[_0x1126('0x6b')](_0x1e7c9a[_0x1126('0x6a')]):{};}catch(_0x5a9c5f){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5a9c5f);}}try{_0x5f5a36[_0x1126('0x6c')]=_0x1e7c9a['rawHeaders']?JSON['parse'](_0x1e7c9a[_0x1126('0xb')]):{};}catch(_0x5b1cd6){logger[_0x1126('0x2c')](_0x1126('0x6d'),_0x5b1cd6);}if(_0x1e7c9a['computedVariables']){try{var _0x133075=require(_0x1e7c9a[_0x1126('0x6e')])[_0x1126('0x6f')](this,_0x5f5a36);_0x5f5a36[_0x1126('0x70')]=Mustache[_0x1126('0x71')](_0x1e7c9a['url'],_0x133075,{},['$$','$$']);if(_0x5f5a36[_0x1126('0x6c')]){_0x5f5a36[_0x1126('0x6c')]=JSON['parse'](Mustache[_0x1126('0x71')](JSON[_0x1126('0x72')](_0x5f5a36[_0x1126('0x6c')]),_0x133075,{},['$$','$$']));}if(_0x5f5a36[_0x1126('0x73')]){_0x5f5a36[_0x1126('0x73')]=JSON[_0x1126('0x6b')](Mustache[_0x1126('0x71')](JSON[_0x1126('0x72')](_0x5f5a36[_0x1126('0x73')]),_0x133075,{},['$$','$$']));}}catch(_0x9a2af0){logger[_0x1126('0x2c')](_0x1126('0x74'),_0x9a2af0);}}rp(_0x5f5a36)[_0x1126('0x13')](function(_0x3b5384){var _0x8bfa0={'statusCode':_0x3b5384[_0x1126('0x75')]||0xc8,'statusMessage':_0x3b5384['statusMessage']||'OK','headers':_0x3b5384[_0x1126('0x6c')]||{},'body':_0x3b5384[_0x1126('0x73')]||{}};_0x9a61b1(null,_0x8bfa0);})[_0x1126('0x15')](function(_0x1483f4){var _0x3be5bf={'statusCode':_0x1483f4['statusCode']||0x1f4,'statusMessage':_0x1483f4[_0x1126('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x1483f4['options'][_0x1126('0x6c')]||{},'body':_0x1483f4[_0x1126('0x77')]['body']||{}};_0x9a61b1(null,_0x3be5bf);});};AGIVertices['prototype'][_0x1126('0x78')]=function(_0x1e70e0,_0x228552){scripts[_0x1126('0x78')](this[_0x1126('0xf')][_0x1126('0x36')],_0x1e70e0[_0x1126('0x79')],_0x1e70e0[_0x1126('0x5c')],_0x1e70e0[_0x1126('0x7a')]||'en')['then'](function(_0x13bfe4){_0x228552(null,_0x13bfe4);})[_0x1126('0x15')](function(_0x3178f5){_0x228552(_0x3178f5);});};AGIVertices[_0x1126('0x16')][_0x1126('0x7b')]=function(_0x336b4b,_0x482199){scripts[_0x1126('0x7b')](this[_0x1126('0xf')],_0x336b4b)[_0x1126('0x13')](function(_0x37c8bb){_0x482199(null,_0x37c8bb);})[_0x1126('0x15')](function(_0x1796eb){_0x482199(_0x1796eb);});};AGIVertices[_0x1126('0x16')][_0x1126('0x7c')]=function(_0x38eac6,_0xc3503b){scripts['ispeechTTS'](_0x38eac6['key'],_0x38eac6[_0x1126('0x5c')],_0x38eac6['ispeech_tts_language']||_0x1126('0x5e'),_0x38eac6['speed'])[_0x1126('0x13')](function(_0x5059d3){_0xc3503b(null,_0x5059d3);})[_0x1126('0x15')](function(_0x4fbd44){_0xc3503b(_0x4fbd44);});};AGIVertices['prototype']['ispeechASR']=function(_0x4288b9,_0x31769a,_0x53f58b){scripts['ispeechASR'](_0x31769a,_0x4288b9[_0x1126('0x79')],_0x4288b9[_0x1126('0x7d')]||_0x1126('0x5e'),this['isConfigured'](_0x4288b9['model'])?_0x4288b9[_0x1126('0x7e')]:undefined)['then'](function(_0x41679a){_0x53f58b(null,_0x41679a);})[_0x1126('0x15')](function(_0x41c7f8){_0x53f58b(_0x41c7f8);});};AGIVertices[_0x1126('0x16')][_0x1126('0x7f')]=function(_0x56163c,_0x591c75){scripts[_0x1126('0x7f')](_0x56163c[_0x1126('0x80')],_0x56163c[_0x1126('0x81')],_0x56163c[_0x1126('0x82')],_0x56163c[_0x1126('0x83')]||_0x1126('0x84'),_0x56163c[_0x1126('0x5c')],_0x56163c[_0x1126('0x85')]||_0x1126('0x5c'))[_0x1126('0x13')](function(_0x1a6641){_0x591c75(null,_0x1a6641);})['catch'](function(_0x1e0e92){_0x591c75(_0x1e0e92);});};AGIVertices['prototype'][_0x1126('0x86')]=function(_0x4ec8b9,_0x4256e6){scripts[_0x1126('0x86')](this[_0x1126('0xf')][_0x1126('0x36')],_0x4ec8b9['aws_access_key_id'],_0x4ec8b9[_0x1126('0x81')],_0x4ec8b9[_0x1126('0x87')],_0x4ec8b9['text'],_0x4ec8b9['aws_bot_name'])[_0x1126('0x13')](function(_0x71b813){_0x4256e6(null,_0x71b813);})[_0x1126('0x15')](function(_0x543e29){_0x4256e6(_0x543e29);});};AGIVertices[_0x1126('0x16')]['googleASR']=function(_0x144cb4,_0x3a40c6,_0x4d6bb2){scripts[_0x1126('0x88')](_0x3a40c6,_0x144cb4[_0x1126('0x79')],_0x144cb4[_0x1126('0x89')]||_0x1126('0x5e'))[_0x1126('0x13')](function(_0x50e1a9){_0x4d6bb2(null,_0x50e1a9);})[_0x1126('0x15')](function(_0x454a67){_0x4d6bb2(_0x454a67);});};AGIVertices[_0x1126('0x16')]['tildeASR']=function(_0x53fd91,_0x55b45e,_0x9d7607){scripts[_0x1126('0x8a')](_0x55b45e,_0x53fd91[_0x1126('0x8b')],_0x53fd91[_0x1126('0x8c')],_0x53fd91['uri'])[_0x1126('0x13')](function(_0x2e2ee0){_0x9d7607(null,_0x2e2ee0);})[_0x1126('0x15')](function(_0x37dae3){_0x9d7607(_0x37dae3);});};AGIVertices[_0x1126('0x16')]['clear']=function(_0x1d5379){var _0x21c487=_['includes'](verticesWithRetry,_0x1d5379[_0x1126('0x38')])?_0x1d5379:_['clone'](_0x1d5379);for(var _0x4787c7 in _0x21c487){if(_0x21c487[_0x1126('0x8d')](_0x4787c7)){if(_0x21c487[_0x4787c7]&&_['isString'](_0x21c487[_0x4787c7])){if(_[_0x1126('0x67')](recursiveMapAttributes,_0x4787c7)){_0x21c487[_0x4787c7]=this[_0x1126('0x8e')](_0x21c487[_0x4787c7]);}else{_0x21c487[_0x4787c7]=this[_0x1126('0x8f')](_0x21c487[_0x4787c7]);}}}}return _0x21c487;};AGIVertices[_0x1126('0x16')][_0x1126('0x90')]=function(_0x2705d5){for(var _0x2540fd in _0x2705d5){if(_0x2705d5[_0x1126('0x8d')](_0x2540fd)){if(_[_0x1126('0x91')](_0x2705d5[_0x2540fd])){this['recursiveNodeIndex'](_0x2705d5[_0x2540fd]);}else if(_[_0x1126('0x92')](_0x2705d5[_0x2540fd])){for(var _0x3e2921=0x0;_0x3e2921<_0x2705d5[_0x2540fd][_0x1126('0x93')];_0x3e2921++){this[_0x1126('0x90')](_0x2705d5[_0x2540fd][_0x3e2921]);}}else if(_['isString'](_0x2705d5[_0x2540fd])){_0x2705d5[_0x2540fd]=this[_0x1126('0x8f')](_0x2705d5[_0x2540fd]);}}}};AGIVertices[_0x1126('0x16')][_0x1126('0x94')]=function(_0x431de5,_0x5c10a2){for(var _0x574304 in _0x431de5){if(_0x431de5['hasOwnProperty'](_0x574304)){if(_[_0x1126('0x91')](_0x431de5[_0x574304])){if(!_['isEmpty'](_0x431de5[_0x574304])){this[_0x1126('0x94')](_0x431de5[_0x574304],util[_0x1126('0x29')]('%s.%s',_0x5c10a2,_0x574304));}}else if(_['isArray'](_0x431de5[_0x574304])){for(var _0x3206c7=0x0;_0x3206c7<_0x431de5[_0x574304][_0x1126('0x93')];_0x3206c7++){this['saveRestApiResult'](_0x431de5[_0x574304][_0x3206c7],util[_0x1126('0x29')](_0x1126('0x95'),_0x5c10a2,_0x574304+'['+_0x3206c7+']'));}}else{if(!_['isNil'](_0x431de5[_0x574304])){this[_0x1126('0xf')]['setVariable'](util[_0x1126('0x29')](_0x1126('0x95'),_0x5c10a2,_0x574304),_0x431de5[_0x574304]);}}}}};AGIVertices[_0x1126('0x16')]['replaceObjectAllVariables']=function(_0x1e92a2){try{var _0x369be4=JSON[_0x1126('0x6b')](_0x1e92a2);this[_0x1126('0x90')](_0x369be4);return JSON[_0x1126('0x72')](_0x369be4);}catch(_0x18d6f4){return this[_0x1126('0x8f')](_0x1e92a2);}};AGIVertices[_0x1126('0x16')][_0x1126('0x8f')]=function(_0x3ea2e7){var _0x20087f=_0x3ea2e7[_0x1126('0x96')]('{');for(var _0x106aae=0x1;_0x106aae<_0x20087f[_0x1126('0x93')];_0x106aae+=0x1){var _0x12ffa5=_0x20087f[_0x106aae][_0x1126('0x96')]('}');if(_0x12ffa5[_0x1126('0x93')]>0x1){_0x3ea2e7=_0x3ea2e7['replaceAll']('{'+_0x12ffa5[0x0]+'}',this[_0x1126('0xf')][_0x1126('0x12')](_0x12ffa5[0x0])['extra']||_0x12ffa5[0x0]);}}if(_0x20087f['length']===0x1){return _0x3ea2e7[_0x1126('0x4c')]();}return this[_0x1126('0x8f')](_0x3ea2e7);};AGIVertices[_0x1126('0x16')][_0x1126('0x97')]=function(_0x5c0215,_0x444f94){var _0x2c3c80=this['channel'][_0x1126('0x12')](_0x5c0215);if(_0x2c3c80['result']===-0x1){return _0x2c3c80;}logger[_0x1126('0x2f')](util[_0x1126('0x29')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x444f94,_0x2c3c80['extra']));return this[_0x1126('0xf')]['setVariable'](_0x444f94,_0x2c3c80['extra']);};AGIVertices[_0x1126('0x16')][_0x1126('0x98')]=function(_0xab81c8){return _0xab81c8&&_0xab81c8!=='0'&&_0xab81c8!=='-1'&&_0xab81c8!=='';};AGIVertices[_0x1126('0x16')]['maxRetry']=function(_0x4ef74b){this['createSquareDetailsReport'][_0x1126('0x6f')](this,_0x4ef74b,'-');_0x4ef74b[_0x1126('0x99')]=_0x4ef74b['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x1126('0x16')][_0x1126('0x9')]=function(_0x396cef){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x9a'),_0x396cef[_0x1126('0x37')]));return this[_0x1126('0xf')][_0x1126('0x9')]([_0x396cef[_0x1126('0x9b')],_0x396cef[_0x1126('0x9c')]]);};AGIVertices['prototype'][_0x1126('0x9d')]=function(_0x559430){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x9e'),_0x559430['label']));if(this[_0x1126('0x98')](_0x559430[_0x1126('0x65')])){logger[_0x1126('0x2f')](util['format'](_0x1126('0x9f'),_0x559430[_0x1126('0x65')]));var _0x4164a5=this[_0x1126('0xf')][_0x1126('0xa0')](_0x559430['timeout']);if(_0x4164a5['result']===-0x1){return _0x4164a5;}}return this[_0x1126('0xf')][_0x1126('0x9d')]();};AGIVertices[_0x1126('0x16')][_0x1126('0x4b')]=function(_0x2cfdd0){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0xa1'),_0x2cfdd0[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x2cfdd0[_0x1126('0x49')])){return this['channel']['error'](_0x2cfdd0,_0x1126('0xa2'));}_0x2cfdd0[_0x1126('0x4a')]=moment();if(this[_0x1126('0x98')](_0x2cfdd0['delay'])){_0x2cfdd0['scheduledAt']=moment()[_0x1126('0xa3')](_0x2cfdd0[_0x1126('0xa4')],_0x1126('0xa5'));}if(!this['isConfigured'](_0x2cfdd0[_0x1126('0xa6')])){_0x2cfdd0[_0x1126('0xa6')]=0x2;}this['createCmContact'][_0x1126('0x6f')](this,_0x2cfdd0);return this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0xa8'),_0x2cfdd0['phone'],_0x2cfdd0[_0x1126('0x49')],_0x2cfdd0[_0x1126('0x4a')]));};AGIVertices['prototype']['custom_app']=function(_0x559dae){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0xa9'),_0x559dae[_0x1126('0x37')]));var _0x474385=this['channel'][_0x1126('0x56')](_0x559dae['application'],_0x559dae[_0x1126('0x77')]);if(_0x474385[_0x1126('0xaa')]===-0x1){return _0x474385;}return this['channel']['noop'](util[_0x1126('0x29')](_0x1126('0xab'),_0x559dae['application'],_0x559dae['options']));};AGIVertices[_0x1126('0x16')][_0x1126('0xac')]=function(_0x19cd9d){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0xad'),_0x19cd9d[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x19cd9d[_0x1126('0x5c')])){return this[_0x1126('0xf')]['noop']('no\x20text\x20configured');}var _0xf36d45='\x22'+_0x19cd9d[_0x1126('0x5c')]+'\x22';if(this[_0x1126('0x98')](_0x19cd9d[_0x1126('0x77')])){_0xf36d45+=','+_0x19cd9d[_0x1126('0x77')];}var _0xff0800=this['channel']['exec'](_0x1126('0xae'),_0xf36d45);if(_0xff0800['result']===-0x1){return _0xff0800;}return this['channel'][_0x1126('0xa7')](util[_0x1126('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0xf36d45));};AGIVertices[_0x1126('0x16')][_0x1126('0xaf')]=function(_0x29c95f){logger[_0x1126('0x2f')](util['format'](_0x1126('0xb0'),_0x29c95f[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x29c95f[_0x1126('0x5c')])){return this[_0x1126('0xf')][_0x1126('0xa7')](_0x1126('0xb1'));}var _0x5725ed='\x22'+_0x29c95f[_0x1126('0x5c')]+'\x22';if(this[_0x1126('0x98')](_0x29c95f[_0x1126('0x77')])){_0x5725ed+=','+_0x29c95f[_0x1126('0x77')];}var _0x4e2111=this[_0x1126('0xf')][_0x1126('0x56')]('MRCPSynth',_0x5725ed);if(_0x4e2111[_0x1126('0xaa')]===-0x1){return _0x4e2111;}return this[_0x1126('0xf')][_0x1126('0xa7')](util['format'](_0x1126('0xb2'),_0x5725ed));};AGIVertices[_0x1126('0x16')][_0x1126('0xb3')]=function(_0xddc3e1){logger[_0x1126('0x2f')](util[_0x1126('0x29')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0xddc3e1[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0xddc3e1['grammar'])){return this[_0x1126('0xf')][_0x1126('0xa7')](_0x1126('0xb4'));}var _0xd09fb0=_0xddc3e1[_0x1126('0xb5')];if(this[_0x1126('0x98')](_0xddc3e1['options'])){_0xd09fb0+=','+_0xddc3e1['options'];}var _0x14cd75=this[_0x1126('0xf')][_0x1126('0x56')](_0x1126('0xb6'),_0xd09fb0);if(_0x14cd75[_0x1126('0xaa')]===-0x1){return _0x14cd75;}var _0x348d09=this[_0x1126('0x97')](_0x1126('0xb7'),_0x1126('0xb8'));if(_0x348d09[_0x1126('0xaa')]===-0x1){return _0x348d09;}var _0x1ceca5=this[_0x1126('0x97')](_0x1126('0xb9'),_0x1126('0xba'));if(_0x1ceca5[_0x1126('0xaa')]===-0x1){return _0x1ceca5;}var _0x2adbed=this[_0x1126('0x97')](_0x1126('0xbb'),_0x1126('0xbc'));if(_0x2adbed[_0x1126('0xaa')]===-0x1){return _0x2adbed;}return this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0xbd'),_0xd09fb0));};AGIVertices[_0x1126('0x16')]['sestekasr']=function(_0x1445ca){logger['info'](util[_0x1126('0x29')](_0x1126('0xbe'),_0x1445ca[_0x1126('0x37')]));if(!this['isConfigured'](_0x1445ca[_0x1126('0xb5')])){return this['channel'][_0x1126('0xa7')](_0x1126('0xb4'));}var _0x5cb928=_0x1445ca[_0x1126('0xb5')];if(this[_0x1126('0x98')](_0x1445ca[_0x1126('0x77')])){_0x5cb928+=','+_0x1445ca[_0x1126('0x77')];}var _0x3b0dcc=this[_0x1126('0xf')][_0x1126('0x56')](_0x1126('0xb6'),_0x5cb928);if(_0x3b0dcc[_0x1126('0xaa')]===-0x1){return _0x3b0dcc;}var _0x5144c3=this[_0x1126('0x97')](_0x1126('0xb7'),_0x1126('0xbf'));if(_0x5144c3[_0x1126('0xaa')]===-0x1){return _0x5144c3;}var _0x4d1c7f=this['getAndSetVariable']('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x4d1c7f[_0x1126('0xaa')]===-0x1){return _0x4d1c7f;}var _0x4f62a1=this[_0x1126('0x97')](_0x1126('0xbb'),_0x1126('0xc0'));if(_0x4f62a1[_0x1126('0xaa')]===-0x1){return _0x4f62a1;}return this[_0x1126('0xf')][_0x1126('0xa7')](util['format'](_0x1126('0xbd'),_0x5cb928));};AGIVertices['prototype'][_0x1126('0xc1')]=function(_0x2759f2){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0xc2'),_0x2759f2[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x2759f2[_0x1126('0xc3')])){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x2759f2,_0x1126('0xc4'));}var _0x5ca18d=this[_0x1126('0xc5')][_0x1126('0x6f')](this,_0x2759f2[_0x1126('0xc3')]);if(!_0x5ca18d){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x2759f2,_0x1126('0xc6'));}if(!this[_0x1126('0x98')](_0x2759f2['query'])){return this['channel']['error'](_0x2759f2,_0x1126('0xc7'));}var _0x2d14e7=_0x2759f2[_0x1126('0xc8')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x1126('0xf')][_0x1126('0xa7')](util['format']('query:\x20%s',_0x2d14e7));var _0x2c4e1d=this[_0x1126('0x2a')][_0x1126('0x6f')](this,_0x5ca18d,_0x2d14e7);this[_0x1126('0xc9')][_0x1126('0x6f')](this,_0x2759f2,_0x2d14e7);if(!this[_0x1126('0x98')](_0x2759f2['variable_id'])){return this[_0x1126('0xf')][_0x1126('0xa7')](_0x1126('0xca'));}var _0x382796=this[_0x1126('0x12')][_0x1126('0x6f')](this,_0x2759f2[_0x1126('0xcb')]);if(!_0x382796){return this[_0x1126('0xf')]['error'](_0x2759f2,_0x1126('0xcc'));}var _0x4215a8=this;_0x2c4e1d['forEach'](function(_0x332eae,_0x114be3){Object['keys'](_0x332eae)[_0x1126('0xcd')](function(_0x41d5de){_0x4215a8[_0x1126('0xf')]['setVariable'](util[_0x1126('0x29')](_0x1126('0xce'),_0x382796,_0x114be3,_0x41d5de),_0x332eae[_0x41d5de]);});});this[_0x1126('0xf')][_0x1126('0xcf')](util[_0x1126('0x29')](_0x1126('0xd0'),_0x382796),_0x2c4e1d[_0x1126('0x93')]);return this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0xd1'),_0x382796));};AGIVertices[_0x1126('0x16')][_0x1126('0xd2')]=function(_0x52cb0f){logger[_0x1126('0xd3')](util[_0x1126('0x29')](_0x1126('0xd4'),_0x52cb0f[_0x1126('0x37')]));if(!this['isConfigured'](_0x52cb0f[_0x1126('0xd5')])){return this[_0x1126('0xf')]['error'](_0x52cb0f,_0x1126('0xd6'));}var _0x395156=this['getUser'][_0x1126('0x6f')](this,_0x52cb0f['sip_id']);if(!_0x395156){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x52cb0f,'no\x20user\x20found');}var _0x554b4e=this[_0x1126('0xf')]['exec']('DIAL',[util[_0x1126('0x29')](_0x1126('0xd7'),_0x395156),_0x52cb0f[_0x1126('0x65')],_0x52cb0f[_0x1126('0xd8')],_0x52cb0f[_0x1126('0x64')]]);if(_0x554b4e[_0x1126('0xaa')]===-0x1){return _0x554b4e;}return this[_0x1126('0xf')]['noop'](util[_0x1126('0x29')](_0x1126('0xd9'),_0x1126('0xda')));};AGIVertices[_0x1126('0x16')]['dialogflow']=function(_0x25b058){logger['info'](util[_0x1126('0x29')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x25b058[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x25b058[_0x1126('0x79')])){return this[_0x1126('0xf')][_0x1126('0xa7')](_0x1126('0xdb'));}if(!this[_0x1126('0x98')](_0x25b058['text'])){return this[_0x1126('0xf')][_0x1126('0xa7')](_0x1126('0xb1'));}this[_0x1126('0xf')][_0x1126('0xdc')]=!![];this['createSquareDetailsReport'](_0x25b058);this[_0x1126('0x42')](_0x25b058[_0x1126('0x5c')],'in');this[_0x1126('0xf')]['noop'](util[_0x1126('0x29')]('Trying\x20Dialogflow:\x20%s',_0x25b058[_0x1126('0x5c')]));var _0x5b4140=this['googleDialogflow']['sync'](this,_0x25b058);if(_0x5b4140){for(var _0x3ff186 in _0x5b4140){if(_0x5b4140[_0x1126('0x8d')](_0x3ff186)){this[_0x1126('0xf')][_0x1126('0xcf')](util[_0x1126('0x29')](_0x1126('0xdd'),_0x3ff186[_0x1126('0xde')]()),_0x5b4140[_0x3ff186]);}}this[_0x1126('0x42')](_0x5b4140['speech'],'out');return this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0xdf'),_0x5b4140[_0x1126('0xe0')]));}return this[_0x1126('0xf')][_0x1126('0x2c')](_0x25b058,_0x1126('0xe1'));};AGIVertices['prototype']['sesteknda']=function(_0x8dd4b2){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0xe2'),_0x8dd4b2[_0x1126('0x37')]));if(!this['isConfigured'](_0x8dd4b2[_0x1126('0xe3')])){return this['channel'][_0x1126('0xa7')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x1126('0x98')](_0x8dd4b2[_0x1126('0xe4')])){return this[_0x1126('0xf')][_0x1126('0xa7')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x8dd4b2[_0x1126('0xe5')])){return this[_0x1126('0xf')][_0x1126('0xa7')]('no\x20password\x20configured');}if(!this[_0x1126('0x98')](_0x8dd4b2[_0x1126('0xe6')])){return this['channel']['noop'](_0x1126('0xb1'));}this[_0x1126('0xf')][_0x1126('0xdc')]=!![];this[_0x1126('0xc9')](_0x8dd4b2);this[_0x1126('0x42')](_0x8dd4b2[_0x1126('0x5c')],'in');this['channel'][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0xe7'),_0x8dd4b2['text']));var _0x1ea514=this[_0x1126('0x7b')][_0x1126('0x6f')](this,_0x8dd4b2);if(_0x1ea514){for(var _0x4d01f7 in _0x1ea514){if(_0x1ea514[_0x1126('0x8d')](_0x4d01f7)){this[_0x1126('0xf')][_0x1126('0xcf')](util['format']('SESTEK_NDA_%s',_0x4d01f7[_0x1126('0xde')]()),_0x1ea514[_0x4d01f7]);}}this[_0x1126('0x42')](_0x1ea514[_0x1126('0xe0')],_0x1126('0xe8'));if(_0x1ea514[_0x1126('0xe9')]){this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0xea'),_0x1ea514[_0x1126('0xe9')]));var _0x528eda=this[_0x1126('0xf')][_0x1126('0xeb')](_0x1ea514['audiofile']);try{fs[_0x1126('0xec')](_0x1ea514['audiofile']+_0x1126('0xed'));}catch(_0x44c7ff){logger['error'](_0x44c7ff);}return _0x528eda;}else{return this['channel'][_0x1126('0xa7')](util['format'](_0x1126('0xee'),_0x1ea514[_0x1126('0xe0')]));}}return this[_0x1126('0xf')]['error'](_0x8dd4b2,_0x1126('0xef'));};AGIVertices[_0x1126('0x16')][_0x1126('0xf0')]=function(_0x5b5099){logger['info'](util[_0x1126('0x29')](_0x1126('0xf1'),_0x5b5099[_0x1126('0x37')]));return this[_0x1126('0xf')][_0x1126('0xa7')]('end');};AGIVertices[_0x1126('0x16')][_0x1126('0xf2')]=function(_0x41cf05){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0xf3'),_0x41cf05[_0x1126('0x37')]));var _0xa84920='';if(_0x41cf05[_0x1126('0xf4')]){if(!this[_0x1126('0x98')](_0x41cf05[_0x1126('0xf4')])){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x41cf05,_0x1126('0xf5'));}else{var _0x568c19=parseInt(_0x41cf05[_0x1126('0xf4')],0xa);if(isNaN(_0x568c19)){_0xa84920=_0x41cf05['trunk_id'];}else{_0xa84920=this[_0x1126('0x1e')][_0x1126('0x6f')](this,_0x41cf05['trunk_id']);if(!_0xa84920){return this[_0x1126('0xf')]['error'](_0x41cf05,_0x1126('0xf6'));}}}}else if(_0x41cf05[_0x1126('0xf7')]){_0xa84920=_0x41cf05['trunk_name'];}else{return this['channel'][_0x1126('0x2c')](_0x41cf05,_0x1126('0xf5'));}var _0x5e6a3d=this['channel'][_0x1126('0x56')](_0x1126('0xda'),[util[_0x1126('0x29')](_0x1126('0xf8'),_0xa84920,_0x41cf05['phone']),_0x41cf05[_0x1126('0x65')],_0x41cf05['opts'],_0x41cf05[_0x1126('0x64')]]);if(_0x5e6a3d[_0x1126('0xaa')]===-0x1){return _0x5e6a3d;}return this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0xd9'),'DIAL'));};AGIVertices[_0x1126('0x16')][_0x1126('0xf9')]=function(_0x1760cb){logger[_0x1126('0x2f')](util[_0x1126('0x29')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x1760cb[_0x1126('0x37')]));return this[_0x1126('0xf')][_0x1126('0xa7')](_0x1126('0xf9'));};AGIVertices['prototype'][_0x1126('0xd')]=function(_0x1c51dc){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0xfa'),_0x1c51dc[_0x1126('0x37')]));if(_0x1c51dc[_0x1126('0x99')]===0x0){return this[_0x1126('0xfb')](_0x1c51dc);}_0x1c51dc[_0x1126('0x99')]-=0x1;if(!this['isConfigured'](_0x1c51dc[_0x1126('0xfc')])){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x1c51dc,'no\x20file\x20audio\x20selected');}var _0x334769=this[_0x1126('0x20')][_0x1126('0x6f')](this,_0x1c51dc[_0x1126('0xfc')]);if(!_0x334769){return this[_0x1126('0xf')]['error'](_0x1c51dc,_0x1126('0xfd'));}if(!this[_0x1126('0x98')](_0x1c51dc[_0x1126('0xcb')])){return this['channel'][_0x1126('0x2c')](_0x1126('0xca'));}var _0x4c8635=this['channel']['getData'](_0x334769,_0x1c51dc[_0x1126('0xfe')],_0x1c51dc[_0x1126('0xff')]);var _0x2d62f0=_0x4c8635['result']?_0x4c8635[_0x1126('0xaa')]['toString']():'';logger['info'](_0x1126('0x100'),JSON[_0x1126('0x72')](_0x4c8635));if(_0x4c8635[_0x1126('0xaa')]===-0x1){this[_0x1126('0xc9')]['sync'](this,_0x1c51dc,_0x2d62f0);return _0x4c8635;}else if(_0x4c8635[_0x1126('0x101')]===_0x1126('0x65')){_0x4c8635[_0x1126('0xaa')]=_0x2d62f0[_0x1126('0x93')]>=parseInt(_0x1c51dc[_0x1126('0x102')])?'x':'i';}else{_0x4c8635['result']=_0x2d62f0[_0x1126('0x93')]>=parseInt(_0x1c51dc[_0x1126('0x102')])&&_0x2d62f0['length']<=parseInt(_0x1c51dc[_0x1126('0xff')])?'x':'i';}var _0x5d7d29=this[_0x1126('0x12')]['sync'](this,_0x1c51dc['variable_id']);if(!_0x5d7d29){return this['channel'][_0x1126('0x2c')](_0x1c51dc,_0x1126('0xcc'));}this['channel'][_0x1126('0xcf')](_0x5d7d29,_0x2d62f0);if(this[_0x1126('0x98')](_0x1c51dc['hiddendigitsnum'])){var _0x205c52=parseInt(_0x1c51dc[_0x1126('0x103')],0xa);var _0x11a440=rs[_0x1126('0x104')]({'charset':'*','length':_0x205c52});var _0x48d62d=_0x2d62f0[_0x1126('0x93')];if(_0x48d62d>0x0){if(_0x48d62d>_0x205c52){this[_0x1126('0xc9')][_0x1126('0x6f')](this,_0x1c51dc,_0x1c51dc['hiddendigitspos']===_0x1126('0x105')?_0x11a440+_0x2d62f0[_0x1126('0x106')](_0x205c52):_0x2d62f0[_0x1126('0x106')](0x0,_0x48d62d-_0x205c52)+_0x11a440);}else{this[_0x1126('0xc9')][_0x1126('0x6f')](this,_0x1c51dc,rs[_0x1126('0x104')]({'charset':'*','length':_0x48d62d}));}}else{this[_0x1126('0xc9')][_0x1126('0x6f')](this,_0x1c51dc,'');}}else{this[_0x1126('0xc9')]['sync'](this,_0x1c51dc,_0x2d62f0);}return _0x4c8635;};AGIVertices[_0x1126('0x16')]['getsecretdigits']=function(_0x1506fe){logger['info'](util[_0x1126('0x29')](_0x1126('0x107'),_0x1506fe[_0x1126('0x37')]));return this[_0x1126('0xd')](_0x1506fe);};AGIVertices[_0x1126('0x16')][_0x1126('0x108')]=function(_0x4f80f3){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x109'),_0x4f80f3[_0x1126('0x37')]));this[_0x1126('0xc9')][_0x1126('0x6f')](this,_0x4f80f3,_0x4f80f3['goalname']);return this[_0x1126('0xf')][_0x1126('0xa7')](util['format']('GOAL\x20%s',_0x4f80f3[_0x1126('0x10a')]));};AGIVertices[_0x1126('0x16')][_0x1126('0x10b')]=function(_0x5deb1b){logger['info'](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x5deb1b['label']));if(!this['isConfigured'](_0x5deb1b[_0x1126('0x80')])||!this[_0x1126('0x98')](_0x5deb1b[_0x1126('0x81')])){return this[_0x1126('0xf')][_0x1126('0xa7')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x5deb1b[_0x1126('0x5c')])){return this['channel'][_0x1126('0xa7')](_0x1126('0xb1'));}this[_0x1126('0xf')][_0x1126('0xa7')](util['format'](_0x1126('0x10c'),_0x5deb1b[_0x1126('0x5c')]));var _0x15e0a3=this[_0x1126('0x7f')][_0x1126('0x6f')](this,_0x5deb1b);if(_0x15e0a3){this['channel'][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0x10d'),_0x15e0a3));var _0xb5207f=this[_0x1126('0xf')][_0x1126('0xeb')](_0x15e0a3);try{fs[_0x1126('0xec')](_0x15e0a3+_0x1126('0xed'));}catch(_0x3af933){logger[_0x1126('0x2c')](_0x3af933);}return _0xb5207f;}return this[_0x1126('0xf')][_0x1126('0x2c')](_0x5deb1b,_0x1126('0x10e'));};AGIVertices['prototype'][_0x1126('0x10f')]=function(_0x43f0c1){logger[_0x1126('0x2f')](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x43f0c1[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x43f0c1[_0x1126('0x80')])||!this[_0x1126('0x98')](_0x43f0c1[_0x1126('0x81')])){return this[_0x1126('0xf')]['noop'](_0x1126('0x110'));}if(!this[_0x1126('0x98')](_0x43f0c1[_0x1126('0x111')])){return this[_0x1126('0xf')][_0x1126('0xa7')](_0x1126('0x112'));}if(!this[_0x1126('0x98')](_0x43f0c1['text'])){return this[_0x1126('0xf')]['noop'](_0x1126('0xb1'));}this[_0x1126('0xf')][_0x1126('0xdc')]=!![];this['createSquareDetailsReport'](_0x43f0c1);this[_0x1126('0x42')](_0x43f0c1[_0x1126('0x5c')],'in');this[_0x1126('0xf')]['noop'](util[_0x1126('0x29')](_0x1126('0x113'),_0x43f0c1[_0x1126('0x5c')]));var _0x194e03=this[_0x1126('0x86')][_0x1126('0x6f')](this,_0x43f0c1);if(_0x194e03){for(var _0x25ef33 in _0x194e03){if(_0x194e03[_0x1126('0x8d')](_0x25ef33)&&_[_0x1126('0x114')](_0x194e03[_0x25ef33])){this['channel'][_0x1126('0xcf')](util[_0x1126('0x29')](_0x1126('0x115'),_0x25ef33[_0x1126('0xde')]()),_0x194e03[_0x25ef33]);}}if(_[_0x1126('0x45')](_0x194e03[_0x1126('0x76')])){return this[_0x1126('0xf')][_0x1126('0xa7')](_0x1126('0x116'));}else{this[_0x1126('0x42')](_0x194e03[_0x1126('0x76')],'out');return this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')]('Amazon\x20Lex\x20Result\x20%s',_0x194e03['message']));}}return this['channel']['error'](_0x43f0c1,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x1126('0x16')][_0x1126('0x117')]=function(_0x1a3b03){logger[_0x1126('0x2f')](util['format'](_0x1126('0x118'),_0x1a3b03[_0x1126('0x37')],_0x1a3b03[_0x1126('0x65')]));if(!this['isConfigured'](_0x1a3b03['key'])){return this[_0x1126('0xf')][_0x1126('0xa7')]('no\x20key\x20configured');}var _0x24769e=_0x1126('0x119');var _0x38b7ea=util[_0x1126('0x29')]('%s/recordings/%s',FILES_PATH,rs[_0x1126('0x104')](0x4));var _0x1ac751=util['format'](_0x1126('0x95'),_0x38b7ea,_0x24769e);var _0x334b64=!![];if(_0x1a3b03['beep']===_0x1126('0x11a')){_0x334b64=![];}var _0x310128=this[_0x1126('0xf')]['recordFile'](_0x38b7ea,_0x24769e,_0x1a3b03[_0x1126('0x11b')],_0x1a3b03[_0x1126('0x65')],undefined,_0x334b64);if(_0x310128[_0x1126('0xaa')]!==-0x1){this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0x11c'),_0x1ac751));var _0x15d56a=this['googleASR'][_0x1126('0x6f')](this,_0x1a3b03,_0x1ac751);if(_0x15d56a){for(var _0x56ede5 in _0x15d56a){if(_0x15d56a[_0x1126('0x8d')](_0x56ede5)){this['channel'][_0x1126('0xcf')](util[_0x1126('0x29')]('GOOGLE_ASR_%s',_0x56ede5[_0x1126('0xde')]()),_0x15d56a[_0x56ede5]);}}return this[_0x1126('0xf')]['noop'](util[_0x1126('0x29')](_0x1126('0x11d'),JSON[_0x1126('0x72')](_0x15d56a)));}}return _0x310128;};AGIVertices[_0x1126('0x16')][_0x1126('0x11e')]=function(_0x135228){logger[_0x1126('0x2f')](util['format'](_0x1126('0x11f'),_0x135228[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x135228[_0x1126('0x8b')])){return this[_0x1126('0xf')][_0x1126('0xa7')](_0x1126('0x120'));}if(!this[_0x1126('0x98')](_0x135228[_0x1126('0x8c')])){return this['channel'][_0x1126('0xa7')]('no\x20appsecret\x20configured');}var _0x12e2c1=_0x1126('0x119');var _0x3753d1=util[_0x1126('0x29')](_0x1126('0x121'),FILES_PATH,rs[_0x1126('0x104')](0x4));var _0x25f81d=util[_0x1126('0x29')](_0x1126('0x95'),_0x3753d1,_0x12e2c1);var _0x35e409=!![];if(_0x135228[_0x1126('0x122')]===_0x1126('0x11a')){_0x35e409=![];}var _0xfece3e=this['channel'][_0x1126('0x123')](_0x3753d1,_0x12e2c1,_0x135228[_0x1126('0x11b')],_0x135228[_0x1126('0x65')],undefined,_0x35e409);if(_0xfece3e[_0x1126('0xaa')]!==-0x1){this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')]('tilde\x20%s\x20file\x20created',_0x25f81d));var _0x4465ba=this[_0x1126('0x8a')][_0x1126('0x6f')](this,_0x135228,_0x25f81d);if(_0x4465ba){for(var _0x50d689 in _0x4465ba){if(_0x4465ba[_0x1126('0x8d')](_0x50d689)){this['channel'][_0x1126('0xcf')](util['format'](_0x1126('0x124'),_0x50d689[_0x1126('0xde')]()),_0x4465ba[_0x50d689]);}}return this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0x125'),JSON['stringify'](_0x4465ba)));}}return _0xfece3e;};AGIVertices[_0x1126('0x16')]['gotoc']=function(_0x375113){logger[_0x1126('0x2f')](util['format'](_0x1126('0x126'),_0x375113['label']));return this[_0x1126('0xf')][_0x1126('0x127')](_0x375113[_0x1126('0x3d')],_0x375113['extension'],_0x375113[_0x1126('0x128')]);};AGIVertices[_0x1126('0x16')][_0x1126('0x129')]=function(_0x3e0a0d){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x12a'),_0x3e0a0d['label']));if(!this['isConfigured'](_0x3e0a0d[_0x1126('0x12b')])){return this[_0x1126('0xf')]['error'](_0x3e0a0d,_0x1126('0x12c'));}try{var _0x20adf9=eval(_0x3e0a0d[_0x1126('0x12b')])?'true':_0x1126('0x12d');this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')]('EVAL\x20CONDITION\x20%s\x20%s',_0x3e0a0d[_0x1126('0x12b')],_0x20adf9));return{'code':0xc8,'result':_0x20adf9};}catch(_0x49e66d){return{'code':0xc8,'result':_0x1126('0x12d')};}};AGIVertices[_0x1126('0x16')][_0x1126('0x12e')]=function(_0x127dbf){logger['info'](util[_0x1126('0x29')](_0x1126('0x12f'),_0x127dbf[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x127dbf[_0x1126('0x130')])){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x127dbf,'no\x20interval\x20configured');}var _0x2ad33d=this[_0x1126('0x24')]['sync'](this,_0x127dbf[_0x1126('0x130')]);if(!_0x2ad33d){return this['channel'][_0x1126('0x2c')](_0x127dbf,_0x1126('0x131'));}for(var _0x11bc76=0x0;_0x11bc76<_0x2ad33d['length'];_0x11bc76+=0x1){var _0x4957b8=this[_0x1126('0xf')][_0x1126('0x12')](util[_0x1126('0x29')](_0x1126('0x132'),_0x2ad33d[_0x11bc76]));if(_0x4957b8[_0x1126('0xaa')]===-0x1){return _0x4957b8;}logger[_0x1126('0x2f')](util[_0x1126('0x29')]('IFTIME\x20%s\x20%s',_0x2ad33d[_0x11bc76],_0x4957b8[_0x1126('0x101')]));if(_0x4957b8[_0x1126('0x101')]===_0x1126('0x133')){logger[_0x1126('0x2f')](util['format'](_0x1126('0x134'),_0x2ad33d[_0x11bc76],_0x1126('0x133')));this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0x134'),_0x2ad33d[_0x11bc76],_0x1126('0x133')));return{'code':0xc8,'result':'true'};}else{logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x134'),_0x2ad33d[_0x11bc76],_0x1126('0x12d')));this[_0x1126('0xf')][_0x1126('0xa7')](util['format'](_0x1126('0x134'),_0x2ad33d[_0x11bc76],_0x1126('0x12d')));}}return{'code':0xc8,'result':_0x1126('0x12d')};};AGIVertices[_0x1126('0x16')]['hangup']=function(_0x1a0a3e){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x135'),_0x1a0a3e[_0x1126('0x37')]));return this[_0x1126('0xf')][_0x1126('0x136')]();};AGIVertices[_0x1126('0x16')][_0x1126('0x137')]=function(_0x20b698){logger[_0x1126('0x2f')](util[_0x1126('0x29')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x20b698['label']));if(!this[_0x1126('0x98')](_0x20b698[_0x1126('0x79')])){return this[_0x1126('0xf')][_0x1126('0xa7')]('no\x20key\x20configured');}var _0xf13f4c=_0x1126('0x119');var _0x490c2b=util[_0x1126('0x29')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x47faed=util[_0x1126('0x29')](_0x1126('0x95'),_0x490c2b,_0xf13f4c);var _0x4908c0=!![];if(_0x20b698['beep']===_0x1126('0x11a')){_0x4908c0=![];}var _0x3794dd=this[_0x1126('0xf')][_0x1126('0x123')](_0x490c2b,_0xf13f4c,_0x20b698['intKey'],_0x20b698[_0x1126('0x65')],undefined,_0x4908c0);if(_0x3794dd[_0x1126('0xaa')]!==-0x1){this['channel']['noop'](util[_0x1126('0x29')](_0x1126('0x138'),_0x47faed));var _0x519fb3=this['ispeechASR'][_0x1126('0x6f')](this,_0x20b698,_0x47faed);if(_0x519fb3){for(var _0x2db331 in _0x519fb3){if(_0x519fb3[_0x1126('0x8d')](_0x2db331)){this[_0x1126('0xf')]['setVariable'](util[_0x1126('0x29')](_0x1126('0x139'),_0x2db331[_0x1126('0xde')]()),_0x519fb3[_0x2db331]);}}return this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x519fb3)));}}return _0x3794dd;};AGIVertices[_0x1126('0x16')]['ispeechtts']=function(_0x5cf47e){logger[_0x1126('0x2f')](util['format'](_0x1126('0x13a'),_0x5cf47e[_0x1126('0x37')]));if(!this['isConfigured'](_0x5cf47e[_0x1126('0x79')])){return this['channel'][_0x1126('0xa7')](_0x1126('0xdb'));}if(!this[_0x1126('0x98')](_0x5cf47e[_0x1126('0x5c')])){return this[_0x1126('0xf')]['noop'](_0x1126('0xb1'));}this[_0x1126('0xf')][_0x1126('0xa7')](util['format'](_0x1126('0x13b'),_0x5cf47e[_0x1126('0x5c')]));var _0x553bfa=this[_0x1126('0x7c')]['sync'](this,_0x5cf47e);if(_0x553bfa){this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0x138'),_0x553bfa));var _0x13dea4=this[_0x1126('0xf')][_0x1126('0xeb')](_0x553bfa,_0x5cf47e[_0x1126('0x11b')]);try{fs['unlink'](_0x553bfa+'.wav');}catch(_0x7cefb7){logger[_0x1126('0x2c')](_0x7cefb7);}return _0x13dea4;}return this['channel'][_0x1126('0x2c')](_0x5cf47e,_0x1126('0x13c'));};AGIVertices['prototype'][_0x1126('0x13d')]=function(_0x3ac6d0){logger[_0x1126('0x2f')](util['format'](_0x1126('0x13e'),_0x3ac6d0[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x3ac6d0['findBy'])){return this[_0x1126('0xf')]['error'](_0x3ac6d0,_0x1126('0x13f'));}logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x140'),this[_0x1126('0xf')][_0x1126('0x3a')],_0x3ac6d0[_0x1126('0x141')]));var _0x30e731=this[_0x1126('0x142')][_0x1126('0x6f')](this,_0x3ac6d0[_0x1126('0x141')]);if(_0x30e731){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x143'),this[_0x1126('0xf')]['callerid'],_0x3ac6d0[_0x1126('0x141')]));this['channel'][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0x143'),this[_0x1126('0xf')][_0x1126('0x3a')],_0x3ac6d0['findBy']));return{'code':0xc8,'result':_0x1126('0x144')};}else{logger[_0x1126('0x2f')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1126('0xf')][_0x1126('0x3a')],_0x3ac6d0[_0x1126('0x141')]));this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0x145'),this[_0x1126('0xf')]['callerid'],_0x3ac6d0[_0x1126('0x141')]));return{'code':0xc8,'result':_0x1126('0x146')};}};AGIVertices[_0x1126('0x16')][_0x1126('0x147')]=function(_0x29c44e){logger[_0x1126('0x2f')](util[_0x1126('0x29')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x29c44e[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x29c44e[_0x1126('0x141')])){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x29c44e,_0x1126('0x13f'));}logger[_0x1126('0x2f')](util[_0x1126('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x1126('0xf')][_0x1126('0x3a')],_0x29c44e[_0x1126('0x141')]));var _0x383a48=this['agentLogout']['sync'](this,_0x29c44e[_0x1126('0x141')]);if(_0x383a48){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x143'),this['channel'][_0x1126('0x3a')],_0x29c44e[_0x1126('0x141')]));this['channel'][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0x143'),this['channel']['callerid'],_0x29c44e['findBy']));return{'code':0xc8,'result':_0x1126('0x144')};}else{logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x145'),this[_0x1126('0xf')][_0x1126('0x3a')],_0x29c44e[_0x1126('0x141')]));this['channel'][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0x145'),this['channel'][_0x1126('0x3a')],_0x29c44e['findBy']));return{'code':0xc8,'result':_0x1126('0x146')};}};AGIVertices['prototype'][_0x1126('0x148')]=function(_0x25ab66){logger['info'](util[_0x1126('0x29')](_0x1126('0x149'),_0x25ab66[_0x1126('0x37')]));if(!this['isConfigured'](_0x25ab66['operation'])){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x25ab66,_0x1126('0x14a'));}this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')]('math\x20%s',_0x25ab66[_0x1126('0x14b')]));var _0x37470b=eval(_0x25ab66['operation']);if(!this[_0x1126('0x98')](_0x25ab66['variable_id'])){return this[_0x1126('0xf')]['noop'](_0x1126('0xca'));}var _0x2c6385=this[_0x1126('0x12')]['sync'](this,_0x25ab66[_0x1126('0xcb')]);if(!_0x2c6385){return this['channel'][_0x1126('0x2c')](_0x25ab66,_0x1126('0xcc'));}if(_['isArray'](_0x37470b)){var _0x5f3b9c=this;_0x37470b['forEach'](function(_0x5e2cd0,_0x23bb39){_0x5f3b9c[_0x1126('0xf')][_0x1126('0xcf')](util[_0x1126('0x29')](_0x1126('0x14c'),_0x2c6385,_0x23bb39),_0x5e2cd0);});return this['channel']['noop'](util['format']('variable\x20%s[key]\x20set',_0x2c6385));}else{return this[_0x1126('0xf')][_0x1126('0xcf')](_0x2c6385,_0x37470b);}};AGIVertices['prototype'][_0x1126('0xc')]=function(_0x1ca59f){logger[_0x1126('0x2f')](util[_0x1126('0x29')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x1ca59f['label']));if(_0x1ca59f['retry']===0x0){return this[_0x1126('0xfb')](_0x1ca59f);}_0x1ca59f[_0x1126('0x99')]-=0x1;if(!this['isConfigured'](_0x1ca59f[_0x1126('0xfc')])){return this['channel'][_0x1126('0x2c')](_0x1ca59f,_0x1126('0x14d'));}var _0xd99737=this[_0x1126('0x20')][_0x1126('0x6f')](this,_0x1ca59f[_0x1126('0xfc')]);if(!_0xd99737){return this['channel'][_0x1126('0x2c')](_0x1ca59f,_0x1126('0xfd'));}var _0x2cbfb6=this['channel'][_0x1126('0x14e')](_0xd99737,_0x1ca59f['response'],_0x1ca59f['digit']);var _0x44682c=_0x2cbfb6[_0x1126('0xaa')];if(_0x2cbfb6[_0x1126('0xaa')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x1ca59f,'-1');return _0x2cbfb6;}else if(_0x2cbfb6[_0x1126('0x101')]===_0x1126('0x65')){_0x2cbfb6[_0x1126('0xaa')]=_0x2cbfb6[_0x1126('0xaa')]['length']>0x0?_0x2cbfb6['result']:'t';}else if(_[_0x1126('0x44')](_0x2cbfb6[_0x1126('0xaa')])){_0x2cbfb6[_0x1126('0xaa')]='#';_0x44682c='#';}if(!this['isConfigured'](_0x1ca59f[_0x1126('0xcb')])){this['channel'][_0x1126('0xa7')](_0x1126('0xca'));}else{var _0x41d9da=this[_0x1126('0x12')][_0x1126('0x6f')](this,_0x1ca59f[_0x1126('0xcb')]);if(!_0x41d9da){return this[_0x1126('0xf')]['error'](_0x1ca59f,_0x1126('0xcc'));}this['channel'][_0x1126('0xcf')](_0x41d9da,_0x44682c);}this[_0x1126('0xc9')][_0x1126('0x6f')](this,_0x1ca59f,_0x44682c);return _0x2cbfb6;};AGIVertices['prototype'][_0x1126('0xa7')]=function(_0x4b7cbd){logger[_0x1126('0x2f')](util['format'](_0x1126('0x14f'),_0x4b7cbd['label']));return this[_0x1126('0xf')][_0x1126('0xa7')](_0x4b7cbd[_0x1126('0x150')]||_0x4b7cbd['label']);};AGIVertices[_0x1126('0x16')][_0x1126('0x151')]=function(_0x301edd){logger['info'](util[_0x1126('0x29')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x301edd[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x301edd[_0x1126('0x141')])){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x301edd,_0x1126('0x13f'));}logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x140'),this[_0x1126('0xf')]['callerid'],_0x301edd[_0x1126('0x141')]));var _0x1c3de2=this[_0x1126('0x152')][_0x1126('0x6f')](this,_0x301edd['pause_id']);var _0x26bd83=this[_0x1126('0x4e')][_0x1126('0x6f')](this,_0x301edd[_0x1126('0x141')],_0x1c3de2);if(_0x26bd83){logger['info'](util[_0x1126('0x29')](_0x1126('0x143'),this[_0x1126('0xf')][_0x1126('0x3a')],_0x301edd['findBy']));this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1126('0xf')][_0x1126('0x3a')],_0x301edd[_0x1126('0x141')]));return{'code':0xc8,'result':_0x1126('0x144')};}else{logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x145'),this[_0x1126('0xf')]['callerid'],_0x301edd[_0x1126('0x141')]));this['channel'][_0x1126('0xa7')](util['format'](_0x1126('0x143'),this[_0x1126('0xf')][_0x1126('0x3a')],_0x301edd['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x1126('0x16')]['playback']=function(_0x4d3a86){logger[_0x1126('0x2f')](util[_0x1126('0x29')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x4d3a86[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x4d3a86[_0x1126('0xfc')])){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x4d3a86,_0x1126('0x14d'));}var _0x1e6c6d=this[_0x1126('0x20')]['sync'](this,_0x4d3a86['file_id']);if(!_0x1e6c6d){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x4d3a86,_0x1126('0xfd'));}var _0x5b5673=this[_0x1126('0xf')][_0x1126('0x56')](_0x1126('0x153'),[_0x1e6c6d,_0x4d3a86[_0x1126('0xd8')]]);if(_0x5b5673[_0x1126('0xaa')]===-0x1){return _0x5b5673;}return this['channel'][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0xab'),_0x1126('0x153'),_0x1e6c6d));};AGIVertices['prototype'][_0x1126('0x154')]=function(_0x172a39){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x155'),_0x172a39[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x172a39[_0x1126('0x156')])){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x172a39,_0x1126('0x157'));}var _0x1427c0='';var _0x391736=parseInt(_0x172a39[_0x1126('0x156')],0xa);if(isNaN(_0x391736)){_0x1427c0=_0x172a39[_0x1126('0x156')];}else{_0x1427c0=this[_0x1126('0x17')][_0x1126('0x6f')](this,_0x172a39[_0x1126('0x156')]);if(!_0x1427c0){return this[_0x1126('0xf')]['error'](_0x172a39,_0x1126('0x158'));}}var _0x1b3381='';if(this[_0x1126('0x98')](_0x172a39[_0x1126('0xfc')])){var _0x5f5c5c=this[_0x1126('0x20')][_0x1126('0x6f')](this,_0x172a39[_0x1126('0xfc')]);if(_0x5f5c5c){_0x1b3381=_0x5f5c5c;}}this[_0x1126('0xc9')][_0x1126('0x6f')](this,_0x172a39,_0x1427c0);if(_0x172a39['opts'][_0x1126('0x159')]('x')<0x0){_0x172a39[_0x1126('0xd8')]+='x';}if(_0x172a39[_0x1126('0xd8')][_0x1126('0x159')]('X')<0x0){_0x172a39['opts']+='X';}this[_0x1126('0xf')]['setVariable'](_0x1126('0x15a'),_0x1427c0?_0x1427c0[_0x1126('0x15b')]():'');var _0x22e8af=this[_0x1126('0xf')][_0x1126('0x56')](_0x1126('0x15c'),[_0x1427c0,_0x172a39[_0x1126('0xd8')],_0x172a39['url'],_0x1b3381,_0x172a39[_0x1126('0x65')],_0x172a39[_0x1126('0x9')],_0x172a39[_0x1126('0x15d')],_0x172a39[_0x1126('0x15e')],'',_0x172a39[_0x1126('0x15f')]]);if(_0x22e8af['result']===-0x1){return _0x22e8af;}return this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')]('Executed\x20command\x20%s\x20%s',_0x1126('0x15c'),_0x1427c0));};AGIVertices[_0x1126('0x16')][_0x1126('0x160')]=function(_0x452c4e){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x161'),_0x452c4e[_0x1126('0x37')]));var _0x268536=_0x452c4e[_0x1126('0x162')]||_0x1126('0x119');var _0x51074f=util[_0x1126('0x29')]('%s_%s',this[_0x1126('0xf')]['uniqueid'],rs['generate'](0x5));var _0x4252c5=util[_0x1126('0x29')]('%s/recordings/%s.%s',FILES_PATH,_0x51074f,_0x268536);var _0x531659=util[_0x1126('0x29')](_0x1126('0x121'),FILES_PATH,_0x51074f);this[_0x1126('0x3b')]['sync'](this,_0x452c4e,_0x51074f,_0x4252c5);this[_0x1126('0xf')]['setVariable'](_0x1126('0x163'),_0x51074f);logger['info'](_0x1126('0x164'),_0x531659,_0x268536,_0x452c4e[_0x1126('0x165')],_0x452c4e[_0x1126('0x65')]);return this[_0x1126('0xf')]['recordFile'](_0x531659,_0x268536,_0x452c4e[_0x1126('0x165')],_0x452c4e[_0x1126('0x65')],undefined,!![]);};AGIVertices[_0x1126('0x16')][_0x1126('0x166')]=function(_0x112827){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x167'),_0x112827[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x112827[_0x1126('0x64')])){return this[_0x1126('0xf')][_0x1126('0xa7')](_0x1126('0x168'));}var _0x11ea62=this['restAPI'][_0x1126('0x6f')](this,_0x112827);logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x169'),util[_0x1126('0x16a')](_0x11ea62,{'showHidden':![],'depth':null})));if(!this[_0x1126('0x98')](_0x112827[_0x1126('0xcb')])){return this[_0x1126('0xf')][_0x1126('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x4245c5=this[_0x1126('0x12')][_0x1126('0x6f')](this,_0x112827[_0x1126('0xcb')]);if(!_0x4245c5){return this['channel'][_0x1126('0x2c')](_0x112827,_0x1126('0xcc'));}this[_0x1126('0xf')][_0x1126('0xcf')](util[_0x1126('0x29')](_0x1126('0x16b'),_0x4245c5),_0x11ea62['statusCode']?_0x11ea62[_0x1126('0x75')]:_0x1126('0x16c'));this['channel'][_0x1126('0xcf')](util[_0x1126('0x29')](_0x1126('0x16d'),_0x4245c5),_0x11ea62[_0x1126('0x16e')]?_0x11ea62[_0x1126('0x16e')]:'OK');if(_0x11ea62[_0x1126('0x73')]){try{this[_0x1126('0x94')](_0x11ea62[_0x1126('0x73')],_0x4245c5);}catch(_0x7d2add){logger[_0x1126('0x2c')](util[_0x1126('0x29')](_0x1126('0x16f'),_0x4245c5));}}return this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0xd1'),_0x4245c5));};AGIVertices['prototype'][_0x1126('0x170')]=function(_0x22d758){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x171'),_0x22d758['label']));return this['channel'][_0x1126('0x172')](_0x22d758[_0x1126('0x173')][_0x1126('0x58')](/\s+/g,''),_0x22d758[_0x1126('0x165')]);};AGIVertices[_0x1126('0x16')]['saynumber']=function(_0x337877){logger['info'](util[_0x1126('0x29')](_0x1126('0x174'),_0x337877['label']));return this[_0x1126('0xf')]['sayNumber'](_0x337877[_0x1126('0x66')]['replace'](/\s+/g,''),_0x337877[_0x1126('0x165')]);};AGIVertices[_0x1126('0x16')][_0x1126('0x175')]=function(_0x4a2cad){logger[_0x1126('0x2f')](util['format'](_0x1126('0x176'),_0x4a2cad[_0x1126('0x37')]));return this[_0x1126('0xf')][_0x1126('0x177')](_0x4a2cad[_0x1126('0x5c')],_0x4a2cad[_0x1126('0x165')]);};AGIVertices['prototype'][_0x1126('0x178')]=function(_0x19a713){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x179'),_0x19a713[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x19a713[_0x1126('0x17a')])){return this[_0x1126('0xf')]['noop'](_0x1126('0x17b'));}var _0x5b9c2c=this[_0x1126('0x22')][_0x1126('0x6f')](this,_0x19a713[_0x1126('0x17a')]);if(!_0x5b9c2c||!_0x5b9c2c[_0x1126('0x17c')]){return this[_0x1126('0xf')]['error'](_0x19a713,_0x1126('0x17d'));}var _0x55cb2f={'from':util[_0x1126('0x29')](_0x1126('0x17e'),_0x5b9c2c[_0x1126('0x14')],_0x5b9c2c[_0x1126('0x17f')]||_0x5b9c2c[_0x1126('0x17c')][_0x1126('0x180')]),'to':_0x19a713['to']||'','cc':_0x19a713['cc']||'','bcc':_0x19a713['bcc']||'','subject':_0x19a713[_0x1126('0x181')],'html':_0x19a713[_0x1126('0x5c')],'text':_0x19a713[_0x1126('0x5c')]};var _0x51a026={'tls':{'rejectUnauthorized':![]}};if(_0x5b9c2c[_0x1126('0x17c')][_0x1126('0x182')]){_0x51a026['service']=_0x5b9c2c['Smtp']['service'];}else{_0x51a026[_0x1126('0x183')]=_0x5b9c2c[_0x1126('0x17c')][_0x1126('0x183')];_0x51a026[_0x1126('0x184')]=_0x5b9c2c[_0x1126('0x17c')][_0x1126('0x184')];_0x51a026[_0x1126('0x185')]=_0x5b9c2c['Smtp'][_0x1126('0x185')];}if(_0x5b9c2c[_0x1126('0x17c')][_0x1126('0x186')]){_0x51a026[_0x1126('0x187')]={'user':_0x5b9c2c[_0x1126('0x17c')][_0x1126('0x180')],'pass':_0x5b9c2c[_0x1126('0x17c')]['pass']};}if(this['isConfigured'](_0x19a713[_0x1126('0x188')])){}logger[_0x1126('0xd3')](_0x1126('0x189'),JSON['stringify'](_0x55cb2f));this[_0x1126('0xc9')][_0x1126('0x6f')](this,_0x19a713,_0x19a713[_0x1126('0x17a')]);this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0x18a'),_0x5b9c2c[_0x1126('0x14')]));this[_0x1126('0x23')][_0x1126('0x6f')](this,_0x51a026,_0x55cb2f);return this['channel']['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x1126('0x18b')]=function(_0xf81b15){logger[_0x1126('0x2f')](util['format'](_0x1126('0x18c'),_0xf81b15[_0x1126('0x37')]));return this['channel'][_0x1126('0xa7')](_0x1126('0x18d'));};AGIVertices[_0x1126('0x16')][_0x1126('0x18e')]=function(_0x5ac860){logger[_0x1126('0x2f')](util['format'](_0x1126('0x18f'),_0x5ac860[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x5ac860[_0x1126('0x190')])){return this[_0x1126('0xf')][_0x1126('0xa7')](_0x1126('0x191'));}var _0x273c1f=this[_0x1126('0x33')]['sync'](this,_0x5ac860[_0x1126('0x190')]);if(!_0x273c1f){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x5ac860,'no\x20sms\x20account\x20found');}var _0x1d7e01={'body':_0x5ac860[_0x1126('0x192')],'phone':_0x5ac860['to']||'','SmsAccountId':_0x273c1f['id']};logger[_0x1126('0xd3')](_0x1126('0x193'),JSON[_0x1126('0x72')](_0x1d7e01));this[_0x1126('0xc9')][_0x1126('0x6f')](this,_0x5ac860,_0x5ac860['sms_account_id']);this[_0x1126('0xf')]['noop'](util[_0x1126('0x29')](_0x1126('0x194'),_0x273c1f[_0x1126('0x14')]));this[_0x1126('0x35')][_0x1126('0x6f')](this,_0x1d7e01);return this[_0x1126('0xf')]['noop'](_0x1126('0x195'));};AGIVertices[_0x1126('0x16')][_0x1126('0x196')]=function(_0x7c6caa){logger[_0x1126('0x2f')](util[_0x1126('0x29')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x7c6caa[_0x1126('0x37')]));if(!this['isConfigured'](_0x7c6caa[_0x1126('0xcb')])){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x7c6caa,_0x1126('0x197'));}var _0x1c2ed8=this['getVariable'][_0x1126('0x6f')](this,_0x7c6caa[_0x1126('0xcb')]);if(!_0x1c2ed8){return this[_0x1126('0xf')]['error'](_0x7c6caa,_0x1126('0xcc'));}return this[_0x1126('0xf')][_0x1126('0xcf')](_0x1c2ed8,_0x7c6caa['variable_value']);};AGIVertices[_0x1126('0x16')]['start']=function(_0x35a5cb){logger['info'](util[_0x1126('0x29')](_0x1126('0x198'),_0x35a5cb[_0x1126('0x37')]));this[_0x1126('0xf')][_0x1126('0xa7')](_0x1126('0x199'));if(_0x35a5cb[_0x1126('0x9d')]==='yes'){this['channel']['noop'](_0x1126('0x19a'));return this['channel'][_0x1126('0x9d')]();}return this[_0x1126('0xf')][_0x1126('0xa7')]('Skipped\x20Answer');};AGIVertices[_0x1126('0x16')]['subproject']=function(_0x1e008b){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x19b'),_0x1e008b['label']));if(!this['isConfigured'](_0x1e008b[_0x1126('0x19c')])){return this[_0x1126('0xf')]['error'](_0x1e008b,'no\x20subproject\x20selected');}var _0xfb0c93=this[_0x1126('0x18')][_0x1126('0x6f')](this,_0x1e008b[_0x1126('0x19c')]);if(!this[_0x1126('0x98')](_0xfb0c93)){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x1e008b,util[_0x1126('0x29')](_0x1126('0x19d'),_0x1e008b[_0x1126('0x19c')]));}if(_0xfb0c93===this[_0x1126('0xf')][_0x1126('0x39')]){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x1e008b,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x1126('0xc9')][_0x1126('0x6f')](this,_0x1e008b,_0xfb0c93);var _0x17d200=this[_0x1126('0xf')][_0x1126('0x56')](_0x1126('0x19e'),util[_0x1126('0x29')](_0x1126('0x19f'),config[_0x1126('0x9')][_0x1126('0x183')]||'127.0.0.1',_0xfb0c93,this[_0x1126('0xf')][_0x1126('0x39')]));if(_0x17d200[_0x1126('0xaa')]===-0x1){return _0x17d200;}return this['channel'][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0xab'),_0x1126('0x19e'),_0xfb0c93));};AGIVertices[_0x1126('0x16')][_0x1126('0x1a0')]=function(_0x2aa255){logger['info'](util[_0x1126('0x29')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x2aa255['label']));var _0x3042f6=this['shellCommand'][_0x1126('0x6f')](this,_0x2aa255['command']);this['createSquareDetailsReport'][_0x1126('0x6f')](this,_0x2aa255,_0x2aa255[_0x1126('0x9b')]);if(this[_0x1126('0x98')](_0x2aa255[_0x1126('0xcb')])){var _0x284ecc=this['getVariable'][_0x1126('0x6f')](this,_0x2aa255[_0x1126('0xcb')]);if(_0x284ecc){this[_0x1126('0xf')][_0x1126('0xcf')](_0x284ecc,_0x3042f6);return this['channel']['noop'](util['format'](_0x1126('0x1a1'),_0x2aa255[_0x1126('0x9b')],_0x284ecc));}}return this['channel']['noop'](util[_0x1126('0x29')](_0x1126('0x1a2'),_0x2aa255['command']));};AGIVertices['prototype'][_0x1126('0x1a3')]=function(_0x32c81a){logger['info'](util[_0x1126('0x29')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x32c81a[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x32c81a[_0x1126('0x5a')])){return this[_0x1126('0xf')]['noop'](_0x1126('0x1a4'));}if(!this[_0x1126('0x98')](_0x32c81a['text'])){return this[_0x1126('0xf')][_0x1126('0xa7')](_0x1126('0xb1'));}this['channel'][_0x1126('0xa7')](util['format'](_0x1126('0x1a5'),_0x32c81a[_0x1126('0x5c')]));var _0x232b99=this[_0x1126('0x59')]['sync'](this,_0x32c81a);if(_0x232b99){this['channel'][_0x1126('0xa7')](util[_0x1126('0x29')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x232b99));var _0x499fb6=this['channel'][_0x1126('0xeb')](_0x232b99);try{fs[_0x1126('0xec')](_0x232b99+'.wav');}catch(_0x4706aa){logger[_0x1126('0x2c')](_0x4706aa);}return _0x499fb6;}return this[_0x1126('0xf')][_0x1126('0x2c')](_0x32c81a,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x1126('0x16')]['tts']=function(_0x5e3ad6){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x1a6'),_0x5e3ad6['label']));if(!this['isConfigured'](_0x5e3ad6[_0x1126('0x5c')])){return this[_0x1126('0xf')]['noop']('no\x20text\x20configured');}this[_0x1126('0xf')][_0x1126('0xa7')](util['format'](_0x1126('0x1a7'),_0x5e3ad6[_0x1126('0x5c')]));var _0x54bba1=this[_0x1126('0x61')][_0x1126('0x6f')](this,_0x5e3ad6);if(_0x54bba1){this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')](_0x1126('0x1a8'),_0x54bba1));var _0x35fb61=this[_0x1126('0xf')][_0x1126('0xeb')](_0x54bba1);try{fs[_0x1126('0xec')](_0x54bba1+_0x1126('0xed'));}catch(_0x307357){logger[_0x1126('0x2c')](_0x307357);}return _0x35fb61;}return this[_0x1126('0xf')]['error'](_0x5e3ad6,_0x1126('0x1a9'));};AGIVertices[_0x1126('0x16')][_0x1126('0x1aa')]=function(_0x513e74){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x1ab'),_0x513e74[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x513e74[_0x1126('0x141')])){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x513e74,_0x1126('0x13f'));}logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x140'),this[_0x1126('0xf')]['callerid'],_0x513e74['findBy']));var _0x2ebd38=this[_0x1126('0x50')][_0x1126('0x6f')](this,_0x513e74[_0x1126('0x141')]);if(_0x2ebd38){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x143'),this['channel'][_0x1126('0x3a')],_0x513e74['findBy']));this[_0x1126('0xf')]['noop'](util[_0x1126('0x29')](_0x1126('0x143'),this[_0x1126('0xf')]['callerid'],_0x513e74[_0x1126('0x141')]));return{'code':0xc8,'result':'success'};}else{logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x145'),this[_0x1126('0xf')]['callerid'],_0x513e74[_0x1126('0x141')]));this['channel']['noop'](util[_0x1126('0x29')](_0x1126('0x145'),this['channel'][_0x1126('0x3a')],_0x513e74['findBy']));return{'code':0xc8,'result':_0x1126('0x146')};}};AGIVertices[_0x1126('0x16')][_0x1126('0x1ac')]=function(_0x278a1c){logger[_0x1126('0x2f')](util['format'](_0x1126('0x1ad'),_0x278a1c[_0x1126('0x37')]));var _0x49edec=this['channel'][_0x1126('0x56')](_0x1126('0x1ae'),[_0x278a1c['mailbox'],_0x278a1c[_0x1126('0x77')]]);if(_0x49edec[_0x1126('0xaa')]===-0x1){return _0x49edec;}return this[_0x1126('0xf')][_0x1126('0xa7')](util[_0x1126('0x29')]('Executed\x20command\x20%s\x20%s',_0x1126('0x1ae'),_0x278a1c[_0x1126('0x1af')]));};AGIVertices[_0x1126('0x16')][_0x1126('0x1b0')]=function(_0x55631c){logger[_0x1126('0x2f')](util[_0x1126('0x29')](_0x1126('0x1b1'),_0x55631c[_0x1126('0x37')]));if(!this[_0x1126('0x98')](_0x55631c['variable_id'])){return this[_0x1126('0xf')][_0x1126('0x2c')](_0x55631c,_0x1126('0x197'));}var _0x47bd3f=this[_0x1126('0x12')]['sync'](this,_0x55631c['variable_id']);if(!_0x47bd3f){return this['channel'][_0x1126('0x2c')](_0x55631c,'no\x20variable\x20found');}var _0x5a65c6=this[_0x1126('0xf')][_0x1126('0x12')](_0x47bd3f);return{'code':0xc8,'result':_0x5a65c6['extra']?_0x5a65c6[_0x1126('0x101')]:'-'};};String[_0x1126('0x16')]['replaceAll']=function(_0x24e1b3,_0x55e867){return this[_0x1126('0x96')](_0x24e1b3)[_0x1126('0x1b2')](_0x55e867);};module[_0x1126('0x1b3')]=AGIVertices; \ No newline at end of file +var _0xabce=['Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','grammar','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query','replace','query:\x20%s','variable_id','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','response','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','intKey','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','ispeechtts','ispeech\x20%s\x20file\x20created','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','getSquareProject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','split','exports','path','util','lodash','shelljs','odbc','mustache','request-promise','../../config/logger','./scripts','rawHeaders','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','Intervals','interval','format','error','info','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','extension','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','agentLogin','internal','LOCAL','shellCommand','trim','googleCloudTTS','apiKey','text','en-US','MALE','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST','toUpperCase','parse','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','googleASR','google_asr_language','tildeASR','appsecret','uri','clear','hasOwnProperty','isString','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','replaceAllVariables','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','sync','retry','maxRetry','agi','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','noop','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','exec','application'];(function(_0x45c39b,_0x504e2d){var _0x45fdcd=function(_0x495ef3){while(--_0x495ef3){_0x45c39b['push'](_0x45c39b['shift']());}};_0x45fdcd(++_0x504e2d);}(_0xabce,0x103));var _0xeabc=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xabce[_0x5447fd];return _0x15b28a;};'use strict';var fs=require('fs');var path=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var _=require(_0xeabc('0x2'));var sh=require(_0xeabc('0x3'));var odbc=require(_0xeabc('0x4'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0xeabc('0x5'));var rp=require(_0xeabc('0x6'));var logger=require(_0xeabc('0x7'))('agi');var config=require('../../config/environment');var scripts=require(_0xeabc('0x8'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xeabc('0x9'),'rawBody'];var verticesWithRetry=[_0xeabc('0xa'),_0xeabc('0xb'),_0xeabc('0xc')];var AGIVertices=function(_0x5d59d5,_0x438ccf,_0x341f16){this[_0xeabc('0xd')]=_0x5d59d5;this[_0xeabc('0xe')]=_0x438ccf;this[_0xeabc('0xf')]=_0x341f16;};AGIVertices[_0xeabc('0x10')][_0xeabc('0x11')]=function(_0x28292c,_0xdb5022){this[_0xeabc('0xe')][_0xeabc('0x12')](_0x28292c)[_0xeabc('0x13')](function(_0x435ea7){_0xdb5022(null,_0x435ea7?_0x435ea7[_0xeabc('0x14')]:![]);})[_0xeabc('0x15')](function(_0xcfbf06){_0xdb5022(_0xcfbf06);});};AGIVertices['prototype'][_0xeabc('0x16')]=function(_0x1319f3,_0x3251c6){this['rpc']['getVoiceQueueById'](_0x1319f3)[_0xeabc('0x13')](function(_0x3ae954){_0x3251c6(null,_0x3ae954?_0x3ae954[_0xeabc('0x14')]:![]);})['catch'](function(_0xf913d7){_0x3251c6(_0xf913d7);});};AGIVertices[_0xeabc('0x10')]['getSquareProject']=function(_0x53fe28,_0x10fa8e){this['rpc'][_0xeabc('0x17')](_0x53fe28)[_0xeabc('0x13')](function(_0x58a3c0){_0x10fa8e(null,_0x58a3c0?_0x58a3c0[_0xeabc('0x14')]:![]);})[_0xeabc('0x15')](function(_0x31f52a){_0x10fa8e(_0x31f52a);});};AGIVertices[_0xeabc('0x10')][_0xeabc('0x18')]=function(_0x5d92e5,_0x1253e4){this['rpc'][_0xeabc('0x19')](_0x5d92e5)[_0xeabc('0x13')](function(_0x502947){_0x1253e4(null,_0x502947?_0x502947[_0xeabc('0x1a')]:![]);})[_0xeabc('0x15')](function(_0x254590){_0x1253e4(_0x254590);});};AGIVertices[_0xeabc('0x10')][_0xeabc('0x1b')]=function(_0x4e99a4,_0xecdbf){this[_0xeabc('0xe')][_0xeabc('0x1c')](_0x4e99a4)['then'](function(_0x457f27){_0xecdbf(null,_0x457f27?_0x457f27[_0xeabc('0x14')]:![]);})[_0xeabc('0x15')](function(_0x319119){_0xecdbf(_0x319119);});};AGIVertices['prototype'][_0xeabc('0x1d')]=function(_0x480440,_0x27dbaf){this['rpc'][_0xeabc('0x1e')](_0x480440)[_0xeabc('0x13')](function(_0x269621){_0x27dbaf(null,_0x269621?_0x269621[_0xeabc('0x14')]:![]);})[_0xeabc('0x15')](function(_0x137293){_0x27dbaf(_0x137293);});};AGIVertices[_0xeabc('0x10')]['getSound']=function(_0x5b2934,_0x459c8a){var _0x5bf8f2=this;this[_0xeabc('0xe')][_0xeabc('0x1f')](_0x5b2934)['then'](function(_0x2163e6){_0x459c8a(null,_0x2163e6?_0x5bf8f2[_0xeabc('0x20')](_0x2163e6[_0xeabc('0x21')]):![]);})[_0xeabc('0x15')](function(_0x149170){_0x459c8a(_0x149170);});};AGIVertices[_0xeabc('0x10')][_0xeabc('0x22')]=function(_0x38dc0a,_0x2915c1){this['rpc'][_0xeabc('0x23')](_0x38dc0a)['then'](function(_0x2f03e8){_0x2915c1(null,_0x2f03e8?_0x2f03e8:![]);})[_0xeabc('0x15')](function(_0x98b445){_0x2915c1(_0x98b445);});};AGIVertices[_0xeabc('0x10')][_0xeabc('0x24')]=function(_0x368b8a,_0x61c0af,_0x545d7f){this[_0xeabc('0xf')][_0xeabc('0x24')](_0x368b8a,_0x61c0af)[_0xeabc('0x13')](function(){_0x545d7f(null);})['catch'](function(_0x1e74ca){_0x545d7f(_0x1e74ca);});};AGIVertices[_0xeabc('0x10')][_0xeabc('0x25')]=function(_0x4e9e17,_0xc0a5b0){this[_0xeabc('0xe')][_0xeabc('0x26')](_0x4e9e17)['then'](function(_0xf98c7c){if(_0xf98c7c){if(_0xf98c7c[_0xeabc('0x27')]){_0xc0a5b0(null,[_0xf98c7c['interval']]);}else{_0xc0a5b0(null,_['map'](_0xf98c7c[_0xeabc('0x28')],_0xeabc('0x29')));}}else{_0xc0a5b0(null,![]);}})['catch'](function(_0x43df50){_0xc0a5b0(_0x43df50);});};AGIVertices[_0xeabc('0x10')][_0xeabc('0x20')]=function(_0x10434e){return util[_0xeabc('0x2a')]('%s/sounds/converted/%s',FILES_PATH,_0x10434e);};AGIVertices[_0xeabc('0x10')]['getQueryOdbc']=function(_0x31ee7a,_0x2bda29,_0x311291){odbc['open'](_0x31ee7a,function(_0x532999){if(_0x532999){logger[_0xeabc('0x2b')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x532999);_0x311291(_0x532999);}else{logger[_0xeabc('0x2c')]('ODBC\x20connection\x20successfully');odbc['query'](_0x2bda29,function(_0x5ee4d2,_0x5c1777){if(_0x5ee4d2){logger[_0xeabc('0x2c')]('Error\x20executing\x20query\x20%s',_0x2bda29);_0x311291(_0x5ee4d2);}else{logger[_0xeabc('0x2c')](_0xeabc('0x2d'),_0x2bda29);odbc['close'](function(_0xe8fa6e){if(_0xe8fa6e){logger['error'](_0xeabc('0x2e'),_0xe8fa6e);}_0x311291(null,_0x5c1777);});}});}});};AGIVertices['prototype'][_0xeabc('0x2f')]=function(_0xf1b7ef,_0xeeef02){this['rpc']['getSmsAccountById'](_0xf1b7ef)['then'](function(_0x46056c){_0xeeef02(null,_0x46056c?_0x46056c:![]);})[_0xeabc('0x15')](function(_0xafa59b){_0xeeef02(_0xafa59b);});};AGIVertices['prototype']['createSmsMessage']=function(_0x5cd62e,_0x1680e8){this['rpc'][_0xeabc('0x30')](_0x5cd62e)['then'](function(_0xf8a5dd){_0x1680e8(null,_0xf8a5dd);})['catch'](function(_0x5defaa){_0x1680e8(_0x5defaa);});};AGIVertices['prototype'][_0xeabc('0x31')]=function(_0x37c926,_0xd03226,_0x3eeeb5){this['rpc'][_0xeabc('0x31')]({'uniqueid':this['channel'][_0xeabc('0x32')],'node':_0x37c926[_0xeabc('0x33')],'application':_0x37c926[_0xeabc('0x34')],'data':_0xd03226||null,'project_name':this[_0xeabc('0xd')][_0xeabc('0x35')],'callerid':this['channel']['callerid']})[_0xeabc('0x13')](function(_0x56b132){if(_0x3eeeb5){_0x3eeeb5(null,_0x56b132);}})[_0xeabc('0x15')](function(_0x2cdf59){if(_0x3eeeb5){_0x3eeeb5(_0x2cdf59);}});};AGIVertices['prototype'][_0xeabc('0x36')]=function(_0x2b3c28,_0x459c98,_0x353038,_0x4360d7){this[_0xeabc('0xe')][_0xeabc('0x36')]({'uniqueid':this['channel'][_0xeabc('0x32')],'callerid':this[_0xeabc('0xd')][_0xeabc('0x37')],'calleridname':this[_0xeabc('0xd')][_0xeabc('0x38')],'context':this[_0xeabc('0xd')][_0xeabc('0x39')],'extension':this[_0xeabc('0xd')][_0xeabc('0x3a')],'priority':this[_0xeabc('0xd')]['priority'],'accountcode':this[_0xeabc('0xd')][_0xeabc('0x3b')],'dnid':this[_0xeabc('0xd')][_0xeabc('0x3c')],'projectName':this[_0xeabc('0xd')][_0xeabc('0x35')],'saveName':_0x459c98,'filename':_0x2b3c28[_0xeabc('0x3d')]||_0x459c98,'savePath':_0x353038})['then'](function(_0x766743){_0x4360d7(null,_0x766743);})[_0xeabc('0x15')](function(_0x463955){_0x4360d7(_0x463955);});};AGIVertices[_0xeabc('0x10')][_0xeabc('0x3e')]=function(_0x58e2c1,_0x305946,_0x2b2b9c){this[_0xeabc('0xe')][_0xeabc('0x3e')]({'uniqueid':this['channel'][_0xeabc('0x32')],'body':_0x58e2c1,'direction':_0x305946})[_0xeabc('0x13')](function(_0x568847){if(_0x2b2b9c){_0x2b2b9c(null,_0x568847);}})[_0xeabc('0x15')](function(_0x5a0d4d){if(_0x2b2b9c){_0x2b2b9c(_0x5a0d4d);}});};AGIVertices[_0xeabc('0x10')]['createCmContact']=function(_0x16ce77,_0x2ec94c){this[_0xeabc('0xe')][_0xeabc('0x3f')]({'firstName':_[_0xeabc('0x40')](_0x16ce77[_0xeabc('0x14')])||_[_0xeabc('0x41')](_0x16ce77[_0xeabc('0x14')])?_0xeabc('0x42')+Math[_0xeabc('0x43')]():_0x16ce77['name'],'lastName':_[_0xeabc('0x40')](_0x16ce77[_0xeabc('0x44')])||_[_0xeabc('0x41')](_0x16ce77[_0xeabc('0x44')])?null:_0x16ce77['lastName'],'phone':_0x16ce77[_0xeabc('0x45')],'ListId':_0x16ce77[_0xeabc('0x46')],'scheduledAt':_0x16ce77[_0xeabc('0x47')],'callbackUniqueid':this[_0xeabc('0xd')]['uniqueid'],'tags':_0xeabc('0x48'),'description':_0xeabc('0x49')+_0x16ce77[_0xeabc('0x47')][_0xeabc('0x4a')](),'priority':_0x16ce77[_0xeabc('0x4b')]})[_0xeabc('0x13')](function(_0x14c322){_0x2ec94c(null,_0x14c322);})[_0xeabc('0x15')](function(_0x17acf8){_0x2ec94c(_0x17acf8);});};AGIVertices['prototype'][_0xeabc('0x4c')]=function(_0x4cdb05,_0x5e09fc){this['rpc'][_0xeabc('0x4d')](_0x4cdb05)[_0xeabc('0x13')](function(_0x219ca8){_0x5e09fc(null,_0x219ca8?_0x219ca8[_0xeabc('0x14')]:![]);})[_0xeabc('0x15')](function(_0x2f78f3){_0x5e09fc(_0x2f78f3);});};AGIVertices['prototype'][_0xeabc('0x4e')]=function(_0x25fd83,_0x19f61e,_0x104c1e){var _0x2ddc53={'role':_0xeabc('0x4f')};_0x2ddc53[_0x25fd83]=this[_0xeabc('0xd')][_0xeabc('0x37')];this['rpc']['agentPause'](_0x2ddc53,_0x19f61e,this[_0xeabc('0xd')][_0xeabc('0x32')])[_0xeabc('0x13')](function(_0x4b3794){_0x104c1e(null,_[_0xeabc('0x41')](_0x4b3794)?![]:!![]);})['catch'](function(_0x5206eb){logger[_0xeabc('0x2b')](_0x5206eb);_0x104c1e(null,![]);});};AGIVertices[_0xeabc('0x10')][_0xeabc('0x50')]=function(_0x4f5451,_0x26c784){var _0xc2ef0c={'role':'agent'};_0xc2ef0c[_0x4f5451]=this[_0xeabc('0xd')][_0xeabc('0x37')];this[_0xeabc('0xe')][_0xeabc('0x50')](_0xc2ef0c)[_0xeabc('0x13')](function(_0x514787){_0x26c784(null,_['isNil'](_0x514787)?![]:!![]);})[_0xeabc('0x15')](function(_0x7b659f){logger[_0xeabc('0x2b')](_0x7b659f);_0x26c784(null,![]);});};AGIVertices[_0xeabc('0x10')][_0xeabc('0x51')]=function(_0x19faa4,_0x2d42e1){var _0x3a4c8a={'role':_0xeabc('0x4f')};_0x3a4c8a[_0x19faa4]=this['channel'][_0xeabc('0x37')];this['rpc'][_0xeabc('0x51')](_0x3a4c8a)[_0xeabc('0x13')](function(_0x3fea99){_0x2d42e1(null,_[_0xeabc('0x41')](_0x3fea99)?![]:!![]);})[_0xeabc('0x15')](function(_0x1a3ef2){logger[_0xeabc('0x2b')](_0x1a3ef2);_0x2d42e1(null,![]);});};AGIVertices[_0xeabc('0x10')][_0xeabc('0x52')]=function(_0x24d0e5,_0x5702cb){var _0x3fa31b={'role':_0xeabc('0x4f')};_0x3fa31b[_0x24d0e5]=this[_0xeabc('0xd')][_0xeabc('0x37')];var _0x5b4430=_0x24d0e5!=_0xeabc('0x53')?util['format']('%s/%s@from-sip/n',_0xeabc('0x54'),this[_0xeabc('0xd')][_0xeabc('0x37')]):undefined;this[_0xeabc('0xe')]['agentLogin'](_0x3fa31b,_0x5b4430)['then'](function(_0x2e712e){_0x5702cb(null,_['isNil'](_0x2e712e)?![]:!![]);})['catch'](function(_0x44c0a6){logger['error'](_0x44c0a6);_0x5702cb(null,![]);});};AGIVertices['prototype'][_0xeabc('0x55')]=function(_0x1c84b5,_0x5613ef){sh['exec'](_[_0xeabc('0x56')](_0x1c84b5),function(_0x5d183a,_0x238e2d){var _0x15ca17=_0x238e2d['replace'](/(\r\n|\n|\r)/gm,'');_0x5613ef(null,_0x15ca17);});};AGIVertices['prototype'][_0xeabc('0x57')]=function(_0x74f5ac,_0xd86ea7){scripts[_0xeabc('0x57')](_0x74f5ac[_0xeabc('0x58')],_0x74f5ac['google_cloud_tts_text_type']||'text',_0x74f5ac[_0xeabc('0x59')],_0x74f5ac['languageCode']||_0xeabc('0x5a'),_0x74f5ac['ssmlGender']||_0xeabc('0x5b'),_0x74f5ac['audioEncoding']||_0xeabc('0x5c'))['then'](function(_0x449c29){_0xd86ea7(null,_0x449c29);})[_0xeabc('0x15')](function(_0x41db70){_0xd86ea7(_0x41db70);});};AGIVertices[_0xeabc('0x10')]['googleTTS']=function(_0x6ee7cf,_0x4fa682){scripts[_0xeabc('0x5d')](_0x6ee7cf[_0xeabc('0x59')],_0x6ee7cf[_0xeabc('0x5e')]||'en',0x1)[_0xeabc('0x13')](function(_0x399d2e){_0x4fa682(null,_0x399d2e);})['catch'](function(_0x239350){_0x4fa682(_0x239350);});};AGIVertices[_0xeabc('0x10')][_0xeabc('0x5f')]=function(_0x2509a4,_0x5427c8){var _0x1559dc={'uri':_0x2509a4[_0xeabc('0x60')],'method':_0x2509a4[_0xeabc('0x61')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2509a4[_0xeabc('0x62')])==='number'&&parseInt(_0x2509a4[_0xeabc('0x62')])>=0x1?parseInt(_0x2509a4[_0xeabc('0x62')])*0x3e8:0x5*0x3e8};if(_[_0xeabc('0x63')]([_0xeabc('0x64'),'PUT'],_0x1559dc['method'][_0xeabc('0x65')]())){try{_0x1559dc['body']=_0x2509a4['rawBody']?JSON[_0xeabc('0x66')](_0x2509a4[_0xeabc('0x67')]):{};}catch(_0x3a567a){logger['error'](_0xeabc('0x68'),_0x3a567a);}}try{_0x1559dc[_0xeabc('0x69')]=_0x2509a4['rawHeaders']?JSON[_0xeabc('0x66')](_0x2509a4[_0xeabc('0x9')]):{};}catch(_0xa9add1){logger[_0xeabc('0x2b')](_0xeabc('0x6a'),_0xa9add1);}if(_0x2509a4['computedVariables']){try{var _0x3df657=require(_0x2509a4['computedVariables'])['sync'](this,_0x1559dc);_0x1559dc['uri']=Mustache[_0xeabc('0x6b')](_0x2509a4[_0xeabc('0x60')],_0x3df657,{},['$$','$$']);if(_0x1559dc[_0xeabc('0x69')]){_0x1559dc[_0xeabc('0x69')]=JSON[_0xeabc('0x66')](Mustache['render'](JSON[_0xeabc('0x6c')](_0x1559dc['headers']),_0x3df657,{},['$$','$$']));}if(_0x1559dc[_0xeabc('0x6d')]){_0x1559dc[_0xeabc('0x6d')]=JSON['parse'](Mustache[_0xeabc('0x6b')](JSON['stringify'](_0x1559dc['body']),_0x3df657,{},['$$','$$']));}}catch(_0x952dc7){logger[_0xeabc('0x2b')](_0xeabc('0x6e'),_0x952dc7);}}rp(_0x1559dc)[_0xeabc('0x13')](function(_0x3c6a49){var _0x4dfc4b={'statusCode':_0x3c6a49[_0xeabc('0x6f')]||0xc8,'statusMessage':_0x3c6a49[_0xeabc('0x70')]||'OK','headers':_0x3c6a49[_0xeabc('0x69')]||{},'body':_0x3c6a49[_0xeabc('0x6d')]||{}};_0x5427c8(null,_0x4dfc4b);})[_0xeabc('0x15')](function(_0x4732b8){var _0x2d05b4={'statusCode':_0x4732b8[_0xeabc('0x6f')]||0x1f4,'statusMessage':_0x4732b8[_0xeabc('0x71')]||_0xeabc('0x72'),'headers':_0x4732b8['options'][_0xeabc('0x69')]||{},'body':_0x4732b8[_0xeabc('0x73')][_0xeabc('0x6d')]||{}};_0x5427c8(null,_0x2d05b4);});};AGIVertices['prototype']['googleDialogflow']=function(_0x1506bd,_0x273ca5){scripts[_0xeabc('0x74')](this[_0xeabc('0xd')][_0xeabc('0x32')],_0x1506bd['key'],_0x1506bd[_0xeabc('0x59')],_0x1506bd['dialogflow_language']||'en')['then'](function(_0x16ff81){_0x273ca5(null,_0x16ff81);})[_0xeabc('0x15')](function(_0x4c832c){_0x273ca5(_0x4c832c);});};AGIVertices[_0xeabc('0x10')][_0xeabc('0x75')]=function(_0x49a70a,_0x5963f7){scripts[_0xeabc('0x75')](this[_0xeabc('0xd')],_0x49a70a)[_0xeabc('0x13')](function(_0x28d77a){_0x5963f7(null,_0x28d77a);})[_0xeabc('0x15')](function(_0x1b0995){_0x5963f7(_0x1b0995);});};AGIVertices[_0xeabc('0x10')]['ispeechTTS']=function(_0xb54c35,_0x5c9d6f){scripts[_0xeabc('0x76')](_0xb54c35[_0xeabc('0x77')],_0xb54c35[_0xeabc('0x59')],_0xb54c35[_0xeabc('0x78')]||_0xeabc('0x5a'),_0xb54c35[_0xeabc('0x79')])[_0xeabc('0x13')](function(_0x22d2f1){_0x5c9d6f(null,_0x22d2f1);})[_0xeabc('0x15')](function(_0x156e20){_0x5c9d6f(_0x156e20);});};AGIVertices[_0xeabc('0x10')]['ispeechASR']=function(_0x10bcef,_0x274ddc,_0x3a3967){scripts[_0xeabc('0x7a')](_0x274ddc,_0x10bcef['key'],_0x10bcef[_0xeabc('0x7b')]||_0xeabc('0x5a'),this['isConfigured'](_0x10bcef[_0xeabc('0x7c')])?_0x10bcef[_0xeabc('0x7c')]:undefined)['then'](function(_0x507ac0){_0x3a3967(null,_0x507ac0);})['catch'](function(_0x5f28dc){_0x3a3967(_0x5f28dc);});};AGIVertices[_0xeabc('0x10')][_0xeabc('0x7d')]=function(_0x186fbe,_0xe18bf1){scripts[_0xeabc('0x7d')](_0x186fbe[_0xeabc('0x7e')],_0x186fbe[_0xeabc('0x7f')],_0x186fbe[_0xeabc('0x80')],_0x186fbe[_0xeabc('0x81')]||_0xeabc('0x82'),_0x186fbe['text'],_0x186fbe[_0xeabc('0x83')]||_0xeabc('0x59'))['then'](function(_0x3987e8){_0xe18bf1(null,_0x3987e8);})[_0xeabc('0x15')](function(_0x44ae3b){_0xe18bf1(_0x44ae3b);});};AGIVertices['prototype'][_0xeabc('0x84')]=function(_0x488120,_0x425e5c){scripts[_0xeabc('0x84')](this[_0xeabc('0xd')][_0xeabc('0x32')],_0x488120[_0xeabc('0x7e')],_0x488120['aws_secret_access_key'],_0x488120['aws_lex_region'],_0x488120['text'],_0x488120['aws_bot_name'])[_0xeabc('0x13')](function(_0x3c2725){_0x425e5c(null,_0x3c2725);})[_0xeabc('0x15')](function(_0x49e534){_0x425e5c(_0x49e534);});};AGIVertices[_0xeabc('0x10')][_0xeabc('0x85')]=function(_0x342293,_0x36cc30,_0x39964d){scripts[_0xeabc('0x85')](_0x36cc30,_0x342293[_0xeabc('0x77')],_0x342293[_0xeabc('0x86')]||_0xeabc('0x5a'))[_0xeabc('0x13')](function(_0x42351c){_0x39964d(null,_0x42351c);})[_0xeabc('0x15')](function(_0x5a1422){_0x39964d(_0x5a1422);});};AGIVertices['prototype'][_0xeabc('0x87')]=function(_0x50a5d5,_0x20c4d7,_0x18ee16){scripts[_0xeabc('0x87')](_0x20c4d7,_0x50a5d5['appid'],_0x50a5d5[_0xeabc('0x88')],_0x50a5d5[_0xeabc('0x89')])[_0xeabc('0x13')](function(_0x53ef31){_0x18ee16(null,_0x53ef31);})['catch'](function(_0x3557f2){_0x18ee16(_0x3557f2);});};AGIVertices[_0xeabc('0x10')][_0xeabc('0x8a')]=function(_0xb2bdc4){var _0x2cc9b3=_[_0xeabc('0x63')](verticesWithRetry,_0xb2bdc4['agicommand'])?_0xb2bdc4:_['clone'](_0xb2bdc4);for(var _0xf3404e in _0x2cc9b3){if(_0x2cc9b3[_0xeabc('0x8b')](_0xf3404e)){if(_0x2cc9b3[_0xf3404e]&&_[_0xeabc('0x8c')](_0x2cc9b3[_0xf3404e])){if(_[_0xeabc('0x63')](recursiveMapAttributes,_0xf3404e)){_0x2cc9b3[_0xf3404e]=this['replaceObjectAllVariables'](_0x2cc9b3[_0xf3404e]);}else{_0x2cc9b3[_0xf3404e]=this['replaceAllVariables'](_0x2cc9b3[_0xf3404e]);}}}}return _0x2cc9b3;};AGIVertices['prototype'][_0xeabc('0x8d')]=function(_0x57ce9b){for(var _0x14b2dc in _0x57ce9b){if(_0x57ce9b['hasOwnProperty'](_0x14b2dc)){if(_[_0xeabc('0x8e')](_0x57ce9b[_0x14b2dc])){this['recursiveNodeIndex'](_0x57ce9b[_0x14b2dc]);}else if(_[_0xeabc('0x8f')](_0x57ce9b[_0x14b2dc])){for(var _0xaea449=0x0;_0xaea449<_0x57ce9b[_0x14b2dc][_0xeabc('0x90')];_0xaea449++){this[_0xeabc('0x8d')](_0x57ce9b[_0x14b2dc][_0xaea449]);}}else if(_[_0xeabc('0x8c')](_0x57ce9b[_0x14b2dc])){_0x57ce9b[_0x14b2dc]=this['replaceAllVariables'](_0x57ce9b[_0x14b2dc]);}}}};AGIVertices[_0xeabc('0x10')][_0xeabc('0x91')]=function(_0x43cbae,_0x52a885){for(var _0x27303c in _0x43cbae){if(_0x43cbae[_0xeabc('0x8b')](_0x27303c)){if(_[_0xeabc('0x8e')](_0x43cbae[_0x27303c])){if(!_[_0xeabc('0x40')](_0x43cbae[_0x27303c])){this[_0xeabc('0x91')](_0x43cbae[_0x27303c],util['format'](_0xeabc('0x92'),_0x52a885,_0x27303c));}}else if(_[_0xeabc('0x8f')](_0x43cbae[_0x27303c])){for(var _0x4d6267=0x0;_0x4d6267<_0x43cbae[_0x27303c][_0xeabc('0x90')];_0x4d6267++){this[_0xeabc('0x91')](_0x43cbae[_0x27303c][_0x4d6267],util['format'](_0xeabc('0x92'),_0x52a885,_0x27303c+'['+_0x4d6267+']'));}}else{if(!_[_0xeabc('0x41')](_0x43cbae[_0x27303c])){this[_0xeabc('0xd')][_0xeabc('0x93')](util[_0xeabc('0x2a')](_0xeabc('0x92'),_0x52a885,_0x27303c),_0x43cbae[_0x27303c]);}}}}};AGIVertices[_0xeabc('0x10')][_0xeabc('0x94')]=function(_0xf7d4dd){try{var _0x11a185=JSON[_0xeabc('0x66')](_0xf7d4dd);this[_0xeabc('0x8d')](_0x11a185);return JSON[_0xeabc('0x6c')](_0x11a185);}catch(_0x57a1d0){return this['replaceAllVariables'](_0xf7d4dd);}};AGIVertices[_0xeabc('0x10')][_0xeabc('0x95')]=function(_0x2006ba){var _0x2d4ca9=_0x2006ba['split']('{');for(var _0x1cc278=0x1;_0x1cc278<_0x2d4ca9['length'];_0x1cc278+=0x1){var _0x49fba2=_0x2d4ca9[_0x1cc278]['split']('}');if(_0x49fba2['length']>0x1){_0x2006ba=_0x2006ba['replaceAll']('{'+_0x49fba2[0x0]+'}',this['channel'][_0xeabc('0x11')](_0x49fba2[0x0])[_0xeabc('0x96')]||_0x49fba2[0x0]);}}if(_0x2d4ca9[_0xeabc('0x90')]===0x1){return _0x2006ba[_0xeabc('0x4a')]();}return this[_0xeabc('0x95')](_0x2006ba);};AGIVertices[_0xeabc('0x10')][_0xeabc('0x97')]=function(_0x3eaedf,_0x44dc85){var _0x550273=this[_0xeabc('0xd')][_0xeabc('0x11')](_0x3eaedf);if(_0x550273[_0xeabc('0x98')]===-0x1){return _0x550273;}logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x99'),_0x44dc85,_0x550273[_0xeabc('0x96')]));return this['channel'][_0xeabc('0x93')](_0x44dc85,_0x550273['extra']);};AGIVertices[_0xeabc('0x10')][_0xeabc('0x9a')]=function(_0x5f3e0a){return _0x5f3e0a&&_0x5f3e0a!=='0'&&_0x5f3e0a!=='-1'&&_0x5f3e0a!=='';};AGIVertices[_0xeabc('0x10')]['maxRetry']=function(_0x23529f){this[_0xeabc('0x31')][_0xeabc('0x9b')](this,_0x23529f,'-');_0x23529f[_0xeabc('0x9c')]=_0x23529f[_0xeabc('0x9d')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xeabc('0x10')][_0xeabc('0x9e')]=function(_0x23b7d8){logger[_0xeabc('0x2c')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x23b7d8[_0xeabc('0x33')]));return this[_0xeabc('0xd')]['agi']([_0x23b7d8[_0xeabc('0x9f')],_0x23b7d8['args']]);};AGIVertices[_0xeabc('0x10')][_0xeabc('0xa0')]=function(_0x442339){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0xa1'),_0x442339['label']));if(this[_0xeabc('0x9a')](_0x442339['timeout'])){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0xa2'),_0x442339[_0xeabc('0x62')]));var _0x4b1f0f=this[_0xeabc('0xd')][_0xeabc('0xa3')](_0x442339[_0xeabc('0x62')]);if(_0x4b1f0f['result']===-0x1){return _0x4b1f0f;}}return this[_0xeabc('0xd')][_0xeabc('0xa0')]();};AGIVertices[_0xeabc('0x10')]['callback']=function(_0x4d8faa){logger['info'](util['format'](_0xeabc('0xa4'),_0x4d8faa[_0xeabc('0x33')]));if(!this['isConfigured'](_0x4d8faa[_0xeabc('0x46')])){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x4d8faa,_0xeabc('0xa5'));}_0x4d8faa[_0xeabc('0x47')]=moment();if(this[_0xeabc('0x9a')](_0x4d8faa[_0xeabc('0xa6')])){_0x4d8faa[_0xeabc('0x47')]=moment()[_0xeabc('0xa7')](_0x4d8faa['delay'],_0xeabc('0xa8'));}if(!this['isConfigured'](_0x4d8faa[_0xeabc('0x4b')])){_0x4d8faa[_0xeabc('0x4b')]=0x2;}this[_0xeabc('0x3f')][_0xeabc('0x9b')](this,_0x4d8faa);return this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x4d8faa[_0xeabc('0x45')],_0x4d8faa['list_id'],_0x4d8faa[_0xeabc('0x47')]));};AGIVertices['prototype'][_0xeabc('0xaa')]=function(_0x12a042){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0xab'),_0x12a042['label']));var _0x20c305=this[_0xeabc('0xd')][_0xeabc('0xac')](_0x12a042[_0xeabc('0xad')],_0x12a042[_0xeabc('0x73')]);if(_0x20c305['result']===-0x1){return _0x20c305;}return this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0xae'),_0x12a042[_0xeabc('0xad')],_0x12a042['options']));};AGIVertices[_0xeabc('0x10')]['lumenvoxtts']=function(_0x2e25e9){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0xaf'),_0x2e25e9[_0xeabc('0x33')]));if(!this[_0xeabc('0x9a')](_0x2e25e9[_0xeabc('0x59')])){return this[_0xeabc('0xd')][_0xeabc('0xa9')](_0xeabc('0xb0'));}var _0x4a54c5='\x22'+_0x2e25e9[_0xeabc('0x59')]+'\x22';if(this[_0xeabc('0x9a')](_0x2e25e9[_0xeabc('0x73')])){_0x4a54c5+=','+_0x2e25e9[_0xeabc('0x73')];}var _0x5b78dc=this[_0xeabc('0xd')]['exec']('MRCPSynth',_0x4a54c5);if(_0x5b78dc[_0xeabc('0x98')]===-0x1){return _0x5b78dc;}return this[_0xeabc('0xd')][_0xeabc('0xa9')](util['format'](_0xeabc('0xb1'),_0x4a54c5));};AGIVertices[_0xeabc('0x10')][_0xeabc('0xb2')]=function(_0x75bfe2){logger[_0xeabc('0x2c')](util['format'](_0xeabc('0xb3'),_0x75bfe2[_0xeabc('0x33')]));if(!this['isConfigured'](_0x75bfe2['text'])){return this[_0xeabc('0xd')][_0xeabc('0xa9')](_0xeabc('0xb0'));}var _0x123050='\x22'+_0x75bfe2[_0xeabc('0x59')]+'\x22';if(this[_0xeabc('0x9a')](_0x75bfe2[_0xeabc('0x73')])){_0x123050+=','+_0x75bfe2[_0xeabc('0x73')];}var _0xfc0319=this['channel'][_0xeabc('0xac')]('MRCPSynth',_0x123050);if(_0xfc0319[_0xeabc('0x98')]===-0x1){return _0xfc0319;}return this['channel'][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0xb1'),_0x123050));};AGIVertices[_0xeabc('0x10')][_0xeabc('0xb4')]=function(_0x227f00){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0xb5'),_0x227f00[_0xeabc('0x33')]));if(!this['isConfigured'](_0x227f00['grammar'])){return this[_0xeabc('0xd')]['noop'](_0xeabc('0xb6'));}var _0x283d40=_0x227f00['grammar'];if(this['isConfigured'](_0x227f00[_0xeabc('0x73')])){_0x283d40+=','+_0x227f00['options'];}var _0x494ba0=this[_0xeabc('0xd')]['exec']('MRCPRecog',_0x283d40);if(_0x494ba0[_0xeabc('0x98')]===-0x1){return _0x494ba0;}var _0x435eb6=this['getAndSetVariable'](_0xeabc('0xb7'),_0xeabc('0xb8'));if(_0x435eb6[_0xeabc('0x98')]===-0x1){return _0x435eb6;}var _0x4b6717=this[_0xeabc('0x97')](_0xeabc('0xb9'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x4b6717[_0xeabc('0x98')]===-0x1){return _0x4b6717;}var _0x20e62f=this[_0xeabc('0x97')](_0xeabc('0xba'),'LUMENVOX_ASR_INSTANCE');if(_0x20e62f[_0xeabc('0x98')]===-0x1){return _0x20e62f;}return this['channel'][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0xbb'),_0x283d40));};AGIVertices['prototype']['sestekasr']=function(_0x6dff2a){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0xbc'),_0x6dff2a[_0xeabc('0x33')]));if(!this[_0xeabc('0x9a')](_0x6dff2a[_0xeabc('0xbd')])){return this[_0xeabc('0xd')]['noop']('no\x20grammar\x20configured');}var _0x17f992=_0x6dff2a['grammar'];if(this[_0xeabc('0x9a')](_0x6dff2a['options'])){_0x17f992+=','+_0x6dff2a[_0xeabc('0x73')];}var _0x135f53=this[_0xeabc('0xd')][_0xeabc('0xac')](_0xeabc('0xbe'),_0x17f992);if(_0x135f53[_0xeabc('0x98')]===-0x1){return _0x135f53;}var _0x347e5d=this[_0xeabc('0x97')]('RECOG_CONFIDENCE()',_0xeabc('0xbf'));if(_0x347e5d[_0xeabc('0x98')]===-0x1){return _0x347e5d;}var _0x269ca2=this[_0xeabc('0x97')](_0xeabc('0xb9'),_0xeabc('0xc0'));if(_0x269ca2[_0xeabc('0x98')]===-0x1){return _0x269ca2;}var _0x38c445=this[_0xeabc('0x97')](_0xeabc('0xba'),_0xeabc('0xc1'));if(_0x38c445[_0xeabc('0x98')]===-0x1){return _0x38c445;}return this[_0xeabc('0xd')]['noop'](util[_0xeabc('0x2a')](_0xeabc('0xbb'),_0x17f992));};AGIVertices[_0xeabc('0x10')][_0xeabc('0xc2')]=function(_0x198641){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0xc3'),_0x198641[_0xeabc('0x33')]));if(!this[_0xeabc('0x9a')](_0x198641['odbc_id'])){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x198641,'no\x20database\x20selected');}var _0x598105=this[_0xeabc('0x18')][_0xeabc('0x9b')](this,_0x198641[_0xeabc('0xc4')]);if(!_0x598105){return this['channel'][_0xeabc('0x2b')](_0x198641,_0xeabc('0xc5'));}if(!this[_0xeabc('0x9a')](_0x198641['query'])){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x198641,_0xeabc('0xc6'));}var _0x56f279=_0x198641[_0xeabc('0xc7')][_0xeabc('0xc8')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xeabc('0xa9')](util['format'](_0xeabc('0xc9'),_0x56f279));var _0x39916c=this['getQueryOdbc']['sync'](this,_0x598105,_0x56f279);this['createSquareDetailsReport'][_0xeabc('0x9b')](this,_0x198641,_0x56f279);if(!this[_0xeabc('0x9a')](_0x198641[_0xeabc('0xca')])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xf02c0e=this[_0xeabc('0x11')]['sync'](this,_0x198641[_0xeabc('0xca')]);if(!_0xf02c0e){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x198641,_0xeabc('0xcb'));}var _0x19522c=this;_0x39916c[_0xeabc('0xcc')](function(_0x827a9,_0x4a5555){Object['keys'](_0x827a9)['forEach'](function(_0x1ffff2){_0x19522c[_0xeabc('0xd')][_0xeabc('0x93')](util[_0xeabc('0x2a')](_0xeabc('0xcd'),_0xf02c0e,_0x4a5555,_0x1ffff2),_0x827a9[_0x1ffff2]);});});this['channel'][_0xeabc('0x93')](util['format'](_0xeabc('0xce'),_0xf02c0e),_0x39916c[_0xeabc('0x90')]);return this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0xcf'),_0xf02c0e));};AGIVertices[_0xeabc('0x10')][_0xeabc('0xd0')]=function(_0x4287e3){logger[_0xeabc('0xd1')](util['format'](_0xeabc('0xd2'),_0x4287e3[_0xeabc('0x33')]));if(!this['isConfigured'](_0x4287e3[_0xeabc('0xd3')])){return this['channel'][_0xeabc('0x2b')](_0x4287e3,_0xeabc('0xd4'));}var _0x236352=this[_0xeabc('0x1b')]['sync'](this,_0x4287e3[_0xeabc('0xd3')]);if(!_0x236352){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x4287e3,_0xeabc('0xd5'));}var _0xa01ba5=this['channel'][_0xeabc('0xac')](_0xeabc('0xd6'),[util['format']('SIP/%s',_0x236352),_0x4287e3[_0xeabc('0x62')],_0x4287e3[_0xeabc('0xd7')],_0x4287e3['url']]);if(_0xa01ba5[_0xeabc('0x98')]===-0x1){return _0xa01ba5;}return this[_0xeabc('0xd')]['noop'](util['format'](_0xeabc('0xd8'),'DIAL'));};AGIVertices[_0xeabc('0x10')][_0xeabc('0xd9')]=function(_0x127a4a){logger['info'](util['format'](_0xeabc('0xda'),_0x127a4a[_0xeabc('0x33')]));if(!this[_0xeabc('0x9a')](_0x127a4a[_0xeabc('0x77')])){return this[_0xeabc('0xd')][_0xeabc('0xa9')](_0xeabc('0xdb'));}if(!this[_0xeabc('0x9a')](_0x127a4a[_0xeabc('0x59')])){return this['channel']['noop'](_0xeabc('0xb0'));}this[_0xeabc('0xd')][_0xeabc('0xdc')]=!![];this['createSquareDetailsReport'](_0x127a4a);this[_0xeabc('0x3e')](_0x127a4a[_0xeabc('0x59')],'in');this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0xdd'),_0x127a4a[_0xeabc('0x59')]));var _0x800c05=this[_0xeabc('0x74')][_0xeabc('0x9b')](this,_0x127a4a);if(_0x800c05){for(var _0x374e7d in _0x800c05){if(_0x800c05[_0xeabc('0x8b')](_0x374e7d)){this['channel'][_0xeabc('0x93')](util[_0xeabc('0x2a')](_0xeabc('0xde'),_0x374e7d['toUpperCase']()),_0x800c05[_0x374e7d]);}}this[_0xeabc('0x3e')](_0x800c05[_0xeabc('0xdf')],'out');return this[_0xeabc('0xd')]['noop'](util[_0xeabc('0x2a')](_0xeabc('0xe0'),_0x800c05[_0xeabc('0xdf')]));}return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x127a4a,_0xeabc('0xe1'));};AGIVertices[_0xeabc('0x10')][_0xeabc('0xe2')]=function(_0x347e33){logger['info'](util[_0xeabc('0x2a')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x347e33['label']));if(!this[_0xeabc('0x9a')](_0x347e33[_0xeabc('0xe3')])){return this[_0xeabc('0xd')][_0xeabc('0xa9')](_0xeabc('0xe4'));}if(!this[_0xeabc('0x9a')](_0x347e33[_0xeabc('0xe5')])){return this[_0xeabc('0xd')][_0xeabc('0xa9')](_0xeabc('0xe6'));}if(!this[_0xeabc('0x9a')](_0x347e33['password'])){return this['channel'][_0xeabc('0xa9')](_0xeabc('0xe7'));}if(!this['isConfigured'](_0x347e33[_0xeabc('0xe8')])){return this[_0xeabc('0xd')]['noop']('no\x20text\x20configured');}this[_0xeabc('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x347e33);this['createSquareMessage'](_0x347e33[_0xeabc('0x59')],'in');this[_0xeabc('0xd')]['noop'](util['format'](_0xeabc('0xe9'),_0x347e33['text']));var _0x412f1d=this['sestekNDA']['sync'](this,_0x347e33);if(_0x412f1d){for(var _0x2a8803 in _0x412f1d){if(_0x412f1d[_0xeabc('0x8b')](_0x2a8803)){this[_0xeabc('0xd')][_0xeabc('0x93')](util[_0xeabc('0x2a')](_0xeabc('0xea'),_0x2a8803[_0xeabc('0x65')]()),_0x412f1d[_0x2a8803]);}}this[_0xeabc('0x3e')](_0x412f1d[_0xeabc('0xdf')],_0xeabc('0xeb'));if(_0x412f1d[_0xeabc('0xec')]){this[_0xeabc('0xd')][_0xeabc('0xa9')](util['format'](_0xeabc('0xed'),_0x412f1d['audiofile']));var _0x42ceb1=this['channel'][_0xeabc('0xee')](_0x412f1d[_0xeabc('0xec')]);try{fs[_0xeabc('0xef')](_0x412f1d['audiofile']+_0xeabc('0xf0'));}catch(_0x502c08){logger[_0xeabc('0x2b')](_0x502c08);}return _0x42ceb1;}else{return this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0xf1'),_0x412f1d['speech']));}}return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x347e33,_0xeabc('0xf2'));};AGIVertices[_0xeabc('0x10')][_0xeabc('0xf3')]=function(_0x996193){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0xf4'),_0x996193['label']));return this['channel'][_0xeabc('0xa9')](_0xeabc('0xf3'));};AGIVertices[_0xeabc('0x10')][_0xeabc('0xf5')]=function(_0x517172){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0xf6'),_0x517172[_0xeabc('0x33')]));var _0x5f40c4='';if(_0x517172[_0xeabc('0xf7')]){if(!this[_0xeabc('0x9a')](_0x517172[_0xeabc('0xf7')])){return this['channel']['error'](_0x517172,_0xeabc('0xf8'));}else{var _0x416a05=parseInt(_0x517172[_0xeabc('0xf7')],0xa);if(isNaN(_0x416a05)){_0x5f40c4=_0x517172[_0xeabc('0xf7')];}else{_0x5f40c4=this[_0xeabc('0x1d')][_0xeabc('0x9b')](this,_0x517172[_0xeabc('0xf7')]);if(!_0x5f40c4){return this[_0xeabc('0xd')]['error'](_0x517172,'no\x20trunk\x20found');}}}}else if(_0x517172[_0xeabc('0xf9')]){_0x5f40c4=_0x517172[_0xeabc('0xf9')];}else{return this[_0xeabc('0xd')]['error'](_0x517172,_0xeabc('0xf8'));}var _0x620125=this[_0xeabc('0xd')][_0xeabc('0xac')](_0xeabc('0xd6'),[util['format'](_0xeabc('0xfa'),_0x5f40c4,_0x517172[_0xeabc('0x45')]),_0x517172[_0xeabc('0x62')],_0x517172[_0xeabc('0xd7')],_0x517172[_0xeabc('0x60')]]);if(_0x620125[_0xeabc('0x98')]===-0x1){return _0x620125;}return this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0xd8'),_0xeabc('0xd6')));};AGIVertices[_0xeabc('0x10')]['finally']=function(_0x918bca){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x918bca[_0xeabc('0x33')]));return this[_0xeabc('0xd')]['noop'](_0xeabc('0xfb'));};AGIVertices[_0xeabc('0x10')]['getdigits']=function(_0x50a723){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0xfc'),_0x50a723[_0xeabc('0x33')]));if(_0x50a723[_0xeabc('0x9c')]===0x0){return this[_0xeabc('0x9d')](_0x50a723);}_0x50a723[_0xeabc('0x9c')]-=0x1;if(!this[_0xeabc('0x9a')](_0x50a723['file_id'])){return this['channel'][_0xeabc('0x2b')](_0x50a723,_0xeabc('0xfd'));}var _0x10cdd8=this[_0xeabc('0xfe')]['sync'](this,_0x50a723['file_id']);if(!_0x10cdd8){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x50a723,_0xeabc('0xff'));}if(!this[_0xeabc('0x9a')](_0x50a723[_0xeabc('0xca')])){return this[_0xeabc('0xd')][_0xeabc('0x2b')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x394cd0=this[_0xeabc('0xd')][_0xeabc('0x100')](_0x10cdd8,_0x50a723[_0xeabc('0x101')],_0x50a723['maxdigit']);var _0x4ca554=_0x394cd0[_0xeabc('0x98')]?_0x394cd0[_0xeabc('0x98')][_0xeabc('0x4a')]():'';logger[_0xeabc('0x2c')](_0xeabc('0x102'),JSON[_0xeabc('0x6c')](_0x394cd0));if(_0x394cd0[_0xeabc('0x98')]===-0x1){this[_0xeabc('0x31')][_0xeabc('0x9b')](this,_0x50a723,_0x4ca554);return _0x394cd0;}else if(_0x394cd0[_0xeabc('0x96')]===_0xeabc('0x62')){_0x394cd0[_0xeabc('0x98')]=_0x4ca554[_0xeabc('0x90')]>=parseInt(_0x50a723[_0xeabc('0x103')])?'x':'i';}else{_0x394cd0[_0xeabc('0x98')]=_0x4ca554[_0xeabc('0x90')]>=parseInt(_0x50a723[_0xeabc('0x103')])&&_0x4ca554['length']<=parseInt(_0x50a723['maxdigit'])?'x':'i';}var _0x50db65=this['getVariable']['sync'](this,_0x50a723[_0xeabc('0xca')]);if(!_0x50db65){return this[_0xeabc('0xd')]['error'](_0x50a723,_0xeabc('0xcb'));}this[_0xeabc('0xd')][_0xeabc('0x93')](_0x50db65,_0x4ca554);if(this[_0xeabc('0x9a')](_0x50a723[_0xeabc('0x104')])){var _0x366034=parseInt(_0x50a723['hiddendigitsnum'],0xa);var _0x52c973=rs[_0xeabc('0x105')]({'charset':'*','length':_0x366034});var _0x1c0703=_0x4ca554['length'];if(_0x1c0703>0x0){if(_0x1c0703>_0x366034){this[_0xeabc('0x31')]['sync'](this,_0x50a723,_0x50a723[_0xeabc('0x106')]==='first'?_0x52c973+_0x4ca554[_0xeabc('0x107')](_0x366034):_0x4ca554[_0xeabc('0x107')](0x0,_0x1c0703-_0x366034)+_0x52c973);}else{this[_0xeabc('0x31')][_0xeabc('0x9b')](this,_0x50a723,rs['generate']({'charset':'*','length':_0x1c0703}));}}else{this[_0xeabc('0x31')][_0xeabc('0x9b')](this,_0x50a723,'');}}else{this[_0xeabc('0x31')][_0xeabc('0x9b')](this,_0x50a723,_0x4ca554);}return _0x394cd0;};AGIVertices[_0xeabc('0x10')][_0xeabc('0xc')]=function(_0x9009f9){logger[_0xeabc('0x2c')](util['format'](_0xeabc('0x108'),_0x9009f9['label']));return this[_0xeabc('0xb')](_0x9009f9);};AGIVertices[_0xeabc('0x10')][_0xeabc('0x109')]=function(_0x4eb1c1){logger[_0xeabc('0x2c')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x4eb1c1[_0xeabc('0x33')]));this['createSquareDetailsReport'][_0xeabc('0x9b')](this,_0x4eb1c1,_0x4eb1c1[_0xeabc('0x10a')]);return this[_0xeabc('0xd')]['noop'](util[_0xeabc('0x2a')]('GOAL\x20%s',_0x4eb1c1['goalname']));};AGIVertices[_0xeabc('0x10')][_0xeabc('0x10b')]=function(_0x4e8e14){logger['info'](util[_0xeabc('0x2a')](_0xeabc('0x10c'),_0x4e8e14[_0xeabc('0x33')]));if(!this[_0xeabc('0x9a')](_0x4e8e14[_0xeabc('0x7e')])||!this[_0xeabc('0x9a')](_0x4e8e14[_0xeabc('0x7f')])){return this['channel'][_0xeabc('0xa9')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xeabc('0x9a')](_0x4e8e14[_0xeabc('0x59')])){return this[_0xeabc('0xd')][_0xeabc('0xa9')]('no\x20text\x20configured');}this['channel'][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0x10d'),_0x4e8e14[_0xeabc('0x59')]));var _0x33953e=this[_0xeabc('0x7d')][_0xeabc('0x9b')](this,_0x4e8e14);if(_0x33953e){this[_0xeabc('0xd')][_0xeabc('0xa9')](util['format'](_0xeabc('0x10e'),_0x33953e));var _0x39587b=this[_0xeabc('0xd')]['streamFile'](_0x33953e);try{fs[_0xeabc('0xef')](_0x33953e+_0xeabc('0xf0'));}catch(_0x5cf0e6){logger['error'](_0x5cf0e6);}return _0x39587b;}return this['channel'][_0xeabc('0x2b')](_0x4e8e14,_0xeabc('0x10f'));};AGIVertices[_0xeabc('0x10')][_0xeabc('0x110')]=function(_0xc1fb57){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0xc1fb57[_0xeabc('0x33')]));if(!this['isConfigured'](_0xc1fb57[_0xeabc('0x7e')])||!this[_0xeabc('0x9a')](_0xc1fb57[_0xeabc('0x7f')])){return this[_0xeabc('0xd')][_0xeabc('0xa9')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xeabc('0x9a')](_0xc1fb57[_0xeabc('0x111')])){return this['channel'][_0xeabc('0xa9')](_0xeabc('0x112'));}if(!this[_0xeabc('0x9a')](_0xc1fb57[_0xeabc('0x59')])){return this[_0xeabc('0xd')][_0xeabc('0xa9')](_0xeabc('0xb0'));}this[_0xeabc('0xd')]['bot']=!![];this[_0xeabc('0x31')](_0xc1fb57);this[_0xeabc('0x3e')](_0xc1fb57[_0xeabc('0x59')],'in');this['channel'][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0x113'),_0xc1fb57['text']));var _0x37dd41=this['awsLex'][_0xeabc('0x9b')](this,_0xc1fb57);if(_0x37dd41){for(var _0x26be10 in _0x37dd41){if(_0x37dd41[_0xeabc('0x8b')](_0x26be10)&&_[_0xeabc('0x8c')](_0x37dd41[_0x26be10])){this['channel'][_0xeabc('0x93')](util[_0xeabc('0x2a')]('AWS_LEX_%s',_0x26be10[_0xeabc('0x65')]()),_0x37dd41[_0x26be10]);}}if(_['isNil'](_0x37dd41[_0xeabc('0x71')])){return this[_0xeabc('0xd')][_0xeabc('0xa9')](_0xeabc('0x114'));}else{this['createSquareMessage'](_0x37dd41[_0xeabc('0x71')],_0xeabc('0xeb'));return this[_0xeabc('0xd')][_0xeabc('0xa9')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x37dd41[_0xeabc('0x71')]));}}return this['channel']['error'](_0xc1fb57,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0xeabc('0x115')]=function(_0x8b4eec){logger['info'](util[_0xeabc('0x2a')](_0xeabc('0x116'),_0x8b4eec[_0xeabc('0x33')],_0x8b4eec[_0xeabc('0x62')]));if(!this[_0xeabc('0x9a')](_0x8b4eec[_0xeabc('0x77')])){return this['channel'][_0xeabc('0xa9')](_0xeabc('0xdb'));}var _0x40765a=_0xeabc('0x117');var _0x119e9e=util[_0xeabc('0x2a')](_0xeabc('0x118'),FILES_PATH,rs[_0xeabc('0x105')](0x4));var _0x21513b=util[_0xeabc('0x2a')](_0xeabc('0x92'),_0x119e9e,_0x40765a);var _0xaabff6=!![];if(_0x8b4eec['beep']===_0xeabc('0x119')){_0xaabff6=![];}var _0x5496c5=this[_0xeabc('0xd')][_0xeabc('0x11a')](_0x119e9e,_0x40765a,_0x8b4eec['intKey'],_0x8b4eec[_0xeabc('0x62')],undefined,_0xaabff6);if(_0x5496c5[_0xeabc('0x98')]!==-0x1){this['channel']['noop'](util[_0xeabc('0x2a')](_0xeabc('0x11b'),_0x21513b));var _0x2f5a27=this[_0xeabc('0x85')][_0xeabc('0x9b')](this,_0x8b4eec,_0x21513b);if(_0x2f5a27){for(var _0x52c2bb in _0x2f5a27){if(_0x2f5a27[_0xeabc('0x8b')](_0x52c2bb)){this[_0xeabc('0xd')][_0xeabc('0x93')](util[_0xeabc('0x2a')](_0xeabc('0x11c'),_0x52c2bb[_0xeabc('0x65')]()),_0x2f5a27[_0x52c2bb]);}}return this['channel'][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0x11d'),JSON[_0xeabc('0x6c')](_0x2f5a27)));}}return _0x5496c5;};AGIVertices[_0xeabc('0x10')][_0xeabc('0x11e')]=function(_0x57cf48){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x11f'),_0x57cf48[_0xeabc('0x33')]));if(!this['isConfigured'](_0x57cf48[_0xeabc('0x120')])){return this[_0xeabc('0xd')]['noop'](_0xeabc('0x121'));}if(!this[_0xeabc('0x9a')](_0x57cf48[_0xeabc('0x88')])){return this[_0xeabc('0xd')][_0xeabc('0xa9')](_0xeabc('0x122'));}var _0x3bbfad=_0xeabc('0x117');var _0x3fc6aa=util[_0xeabc('0x2a')](_0xeabc('0x118'),FILES_PATH,rs[_0xeabc('0x105')](0x4));var _0x198937=util['format']('%s.%s',_0x3fc6aa,_0x3bbfad);var _0x5a387a=!![];if(_0x57cf48[_0xeabc('0x123')]===_0xeabc('0x119')){_0x5a387a=![];}var _0x4b4399=this[_0xeabc('0xd')][_0xeabc('0x11a')](_0x3fc6aa,_0x3bbfad,_0x57cf48[_0xeabc('0x124')],_0x57cf48['timeout'],undefined,_0x5a387a);if(_0x4b4399[_0xeabc('0x98')]!==-0x1){this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0x125'),_0x198937));var _0x111dea=this[_0xeabc('0x87')][_0xeabc('0x9b')](this,_0x57cf48,_0x198937);if(_0x111dea){for(var _0x4b8470 in _0x111dea){if(_0x111dea['hasOwnProperty'](_0x4b8470)){this['channel'][_0xeabc('0x93')](util[_0xeabc('0x2a')]('TILDE_ASR_%s',_0x4b8470['toUpperCase']()),_0x111dea[_0x4b8470]);}}return this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0x126'),JSON['stringify'](_0x111dea)));}}return _0x4b4399;};AGIVertices[_0xeabc('0x10')][_0xeabc('0x127')]=function(_0x1f514f){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x128'),_0x1f514f['label']));return this[_0xeabc('0xd')][_0xeabc('0x129')](_0x1f514f['context'],_0x1f514f['extension'],_0x1f514f[_0xeabc('0x12a')]);};AGIVertices[_0xeabc('0x10')]['gotoif']=function(_0x3c9537){logger[_0xeabc('0x2c')](util['format'](_0xeabc('0x12b'),_0x3c9537['label']));if(!this[_0xeabc('0x9a')](_0x3c9537[_0xeabc('0x12c')])){return this[_0xeabc('0xd')]['error'](_0x3c9537,_0xeabc('0x12d'));}try{var _0x87e3bb=eval(_0x3c9537['condition'])?_0xeabc('0x12e'):_0xeabc('0x12f');this[_0xeabc('0xd')][_0xeabc('0xa9')](util['format'](_0xeabc('0x130'),_0x3c9537[_0xeabc('0x12c')],_0x87e3bb));return{'code':0xc8,'result':_0x87e3bb};}catch(_0x420816){return{'code':0xc8,'result':_0xeabc('0x12f')};}};AGIVertices[_0xeabc('0x10')][_0xeabc('0x131')]=function(_0x24323c){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x24323c[_0xeabc('0x33')]));if(!this[_0xeabc('0x9a')](_0x24323c[_0xeabc('0x132')])){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x24323c,'no\x20interval\x20configured');}var _0x3e7e2d=this['getIntervals'][_0xeabc('0x9b')](this,_0x24323c[_0xeabc('0x132')]);if(!_0x3e7e2d){return this[_0xeabc('0xd')]['error'](_0x24323c,'no\x20intervals\x20found');}for(var _0x3f88e8=0x0;_0x3f88e8<_0x3e7e2d[_0xeabc('0x90')];_0x3f88e8+=0x1){var _0x43fb5d=this['channel'][_0xeabc('0x11')](util[_0xeabc('0x2a')](_0xeabc('0x133'),_0x3e7e2d[_0x3f88e8]));if(_0x43fb5d['result']===-0x1){return _0x43fb5d;}logger[_0xeabc('0x2c')](util['format'](_0xeabc('0x134'),_0x3e7e2d[_0x3f88e8],_0x43fb5d['extra']));if(_0x43fb5d[_0xeabc('0x96')]===_0xeabc('0x12e')){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x134'),_0x3e7e2d[_0x3f88e8],_0xeabc('0x12e')));this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0x134'),_0x3e7e2d[_0x3f88e8],_0xeabc('0x12e')));return{'code':0xc8,'result':'true'};}else{logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x134'),_0x3e7e2d[_0x3f88e8],_0xeabc('0x12f')));this[_0xeabc('0xd')][_0xeabc('0xa9')](util['format'](_0xeabc('0x134'),_0x3e7e2d[_0x3f88e8],_0xeabc('0x12f')));}}return{'code':0xc8,'result':_0xeabc('0x12f')};};AGIVertices[_0xeabc('0x10')][_0xeabc('0x135')]=function(_0x79afdb){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x136'),_0x79afdb['label']));return this[_0xeabc('0xd')]['hangup']();};AGIVertices[_0xeabc('0x10')][_0xeabc('0x137')]=function(_0x13be21){logger[_0xeabc('0x2c')](util['format'](_0xeabc('0x138'),_0x13be21[_0xeabc('0x33')]));if(!this['isConfigured'](_0x13be21[_0xeabc('0x77')])){return this['channel'][_0xeabc('0xa9')](_0xeabc('0xdb'));}var _0x5b0ecb=_0xeabc('0x117');var _0x59b2de=util['format']('%s/recordings/%s',FILES_PATH,rs[_0xeabc('0x105')](0x4));var _0x25178b=util[_0xeabc('0x2a')](_0xeabc('0x92'),_0x59b2de,_0x5b0ecb);var _0x28bd59=!![];if(_0x13be21[_0xeabc('0x123')]===_0xeabc('0x119')){_0x28bd59=![];}var _0x35ef3c=this[_0xeabc('0xd')][_0xeabc('0x11a')](_0x59b2de,_0x5b0ecb,_0x13be21['intKey'],_0x13be21[_0xeabc('0x62')],undefined,_0x28bd59);if(_0x35ef3c['result']!==-0x1){this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')]('ispeech\x20%s\x20file\x20created',_0x25178b));var _0x42be42=this['ispeechASR']['sync'](this,_0x13be21,_0x25178b);if(_0x42be42){for(var _0x28b4b5 in _0x42be42){if(_0x42be42['hasOwnProperty'](_0x28b4b5)){this[_0xeabc('0xd')][_0xeabc('0x93')](util['format'](_0xeabc('0x139'),_0x28b4b5['toUpperCase']()),_0x42be42[_0x28b4b5]);}}return this[_0xeabc('0xd')]['noop'](util[_0xeabc('0x2a')]('IspeechASR\x20Result\x20%s',JSON[_0xeabc('0x6c')](_0x42be42)));}}return _0x35ef3c;};AGIVertices['prototype'][_0xeabc('0x13a')]=function(_0x2524a1){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x2524a1['label']));if(!this['isConfigured'](_0x2524a1['key'])){return this[_0xeabc('0xd')][_0xeabc('0xa9')](_0xeabc('0xdb'));}if(!this['isConfigured'](_0x2524a1[_0xeabc('0x59')])){return this['channel'][_0xeabc('0xa9')](_0xeabc('0xb0'));}this[_0xeabc('0xd')][_0xeabc('0xa9')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x2524a1['text']));var _0x3def0c=this[_0xeabc('0x76')][_0xeabc('0x9b')](this,_0x2524a1);if(_0x3def0c){this[_0xeabc('0xd')]['noop'](util[_0xeabc('0x2a')](_0xeabc('0x13b'),_0x3def0c));var _0x11a8af=this[_0xeabc('0xd')][_0xeabc('0xee')](_0x3def0c,_0x2524a1[_0xeabc('0x124')]);try{fs[_0xeabc('0xef')](_0x3def0c+_0xeabc('0xf0'));}catch(_0x14a996){logger[_0xeabc('0x2b')](_0x14a996);}return _0x11a8af;}return this['channel']['error'](_0x2524a1,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xeabc('0x10')][_0xeabc('0x13c')]=function(_0x1ae8cd){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x13d'),_0x1ae8cd[_0xeabc('0x33')]));if(!this[_0xeabc('0x9a')](_0x1ae8cd[_0xeabc('0x13e')])){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x1ae8cd,_0xeabc('0x13f'));}logger[_0xeabc('0x2c')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xeabc('0xd')]['callerid'],_0x1ae8cd[_0xeabc('0x13e')]));var _0x562de8=this[_0xeabc('0x52')][_0xeabc('0x9b')](this,_0x1ae8cd['findBy']);if(_0x562de8){logger['info'](util[_0xeabc('0x2a')](_0xeabc('0x140'),this[_0xeabc('0xd')]['callerid'],_0x1ae8cd[_0xeabc('0x13e')]));this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xeabc('0xd')][_0xeabc('0x37')],_0x1ae8cd[_0xeabc('0x13e')]));return{'code':0xc8,'result':_0xeabc('0x141')};}else{logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x142'),this[_0xeabc('0xd')][_0xeabc('0x37')],_0x1ae8cd[_0xeabc('0x13e')]));this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0x142'),this[_0xeabc('0xd')][_0xeabc('0x37')],_0x1ae8cd[_0xeabc('0x13e')]));return{'code':0xc8,'result':_0xeabc('0x143')};}};AGIVertices[_0xeabc('0x10')]['logout']=function(_0x3b6563){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x144'),_0x3b6563[_0xeabc('0x33')]));if(!this[_0xeabc('0x9a')](_0x3b6563[_0xeabc('0x13e')])){return this['channel'][_0xeabc('0x2b')](_0x3b6563,_0xeabc('0x13f'));}logger[_0xeabc('0x2c')](util['format'](_0xeabc('0x145'),this[_0xeabc('0xd')][_0xeabc('0x37')],_0x3b6563[_0xeabc('0x13e')]));var _0x5cfe9a=this[_0xeabc('0x51')][_0xeabc('0x9b')](this,_0x3b6563[_0xeabc('0x13e')]);if(_0x5cfe9a){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x140'),this[_0xeabc('0xd')][_0xeabc('0x37')],_0x3b6563[_0xeabc('0x13e')]));this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0x140'),this[_0xeabc('0xd')][_0xeabc('0x37')],_0x3b6563[_0xeabc('0x13e')]));return{'code':0xc8,'result':_0xeabc('0x141')};}else{logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xeabc('0x37')],_0x3b6563[_0xeabc('0x13e')]));this['channel'][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0x142'),this[_0xeabc('0xd')][_0xeabc('0x37')],_0x3b6563[_0xeabc('0x13e')]));return{'code':0xc8,'result':_0xeabc('0x143')};}};AGIVertices[_0xeabc('0x10')][_0xeabc('0x146')]=function(_0xdfcc41){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x147'),_0xdfcc41['label']));if(!this[_0xeabc('0x9a')](_0xdfcc41[_0xeabc('0x148')])){return this['channel']['error'](_0xdfcc41,'no\x20operation\x20configured');}this[_0xeabc('0xd')]['noop'](util[_0xeabc('0x2a')](_0xeabc('0x149'),_0xdfcc41[_0xeabc('0x148')]));var _0x36385b=eval(_0xdfcc41[_0xeabc('0x148')]);if(!this['isConfigured'](_0xdfcc41[_0xeabc('0xca')])){return this['channel'][_0xeabc('0xa9')](_0xeabc('0x14a'));}var _0x335359=this[_0xeabc('0x11')][_0xeabc('0x9b')](this,_0xdfcc41[_0xeabc('0xca')]);if(!_0x335359){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0xdfcc41,_0xeabc('0xcb'));}if(_[_0xeabc('0x8f')](_0x36385b)){var _0x27ef4d=this;_0x36385b[_0xeabc('0xcc')](function(_0x51eaa5,_0xbdbc49){_0x27ef4d[_0xeabc('0xd')][_0xeabc('0x93')](util[_0xeabc('0x2a')]('%s[%s]',_0x335359,_0xbdbc49),_0x51eaa5);});return this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')]('variable\x20%s[key]\x20set',_0x335359));}else{return this[_0xeabc('0xd')][_0xeabc('0x93')](_0x335359,_0x36385b);}};AGIVertices[_0xeabc('0x10')]['menu']=function(_0x149aa2){logger['info'](util[_0xeabc('0x2a')](_0xeabc('0x14b'),_0x149aa2[_0xeabc('0x33')]));if(_0x149aa2['retry']===0x0){return this[_0xeabc('0x9d')](_0x149aa2);}_0x149aa2[_0xeabc('0x9c')]-=0x1;if(!this[_0xeabc('0x9a')](_0x149aa2['file_id'])){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x149aa2,'no\x20file\x20audio\x20selected');}var _0x1e3994=this[_0xeabc('0xfe')][_0xeabc('0x9b')](this,_0x149aa2[_0xeabc('0x14c')]);if(!_0x1e3994){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x149aa2,_0xeabc('0xff'));}var _0x38c49f=this[_0xeabc('0xd')]['getData'](_0x1e3994,_0x149aa2[_0xeabc('0x101')],_0x149aa2[_0xeabc('0x14d')]);var _0x5ab2ba=_0x38c49f['result'];if(_0x38c49f[_0xeabc('0x98')]===-0x1){this[_0xeabc('0x31')][_0xeabc('0x9b')](this,_0x149aa2,'-1');return _0x38c49f;}else if(_0x38c49f[_0xeabc('0x96')]===_0xeabc('0x62')){_0x38c49f['result']=_0x38c49f[_0xeabc('0x98')][_0xeabc('0x90')]>0x0?_0x38c49f['result']:'t';}else if(_['isEmpty'](_0x38c49f[_0xeabc('0x98')])){_0x38c49f[_0xeabc('0x98')]='#';_0x5ab2ba='#';}if(!this[_0xeabc('0x9a')](_0x149aa2['variable_id'])){this[_0xeabc('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x1f2d6e=this['getVariable'][_0xeabc('0x9b')](this,_0x149aa2['variable_id']);if(!_0x1f2d6e){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x149aa2,_0xeabc('0xcb'));}this[_0xeabc('0xd')][_0xeabc('0x93')](_0x1f2d6e,_0x5ab2ba);}this[_0xeabc('0x31')][_0xeabc('0x9b')](this,_0x149aa2,_0x5ab2ba);return _0x38c49f;};AGIVertices['prototype'][_0xeabc('0xa9')]=function(_0x3ed6c0){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x14e'),_0x3ed6c0[_0xeabc('0x33')]));return this['channel'][_0xeabc('0xa9')](_0x3ed6c0['output']||_0x3ed6c0[_0xeabc('0x33')]);};AGIVertices['prototype'][_0xeabc('0x14f')]=function(_0x547a71){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x150'),_0x547a71[_0xeabc('0x33')]));if(!this['isConfigured'](_0x547a71[_0xeabc('0x13e')])){return this[_0xeabc('0xd')]['error'](_0x547a71,_0xeabc('0x13f'));}logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x145'),this[_0xeabc('0xd')][_0xeabc('0x37')],_0x547a71[_0xeabc('0x13e')]));var _0x2df727=this[_0xeabc('0x4c')][_0xeabc('0x9b')](this,_0x547a71['pause_id']);var _0x568ada=this[_0xeabc('0x4e')]['sync'](this,_0x547a71[_0xeabc('0x13e')],_0x2df727);if(_0x568ada){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x140'),this[_0xeabc('0xd')][_0xeabc('0x37')],_0x547a71[_0xeabc('0x13e')]));this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0x140'),this[_0xeabc('0xd')]['callerid'],_0x547a71[_0xeabc('0x13e')]));return{'code':0xc8,'result':'success'};}else{logger[_0xeabc('0x2c')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xeabc('0x37')],_0x547a71[_0xeabc('0x13e')]));this[_0xeabc('0xd')]['noop'](util['format'](_0xeabc('0x140'),this[_0xeabc('0xd')][_0xeabc('0x37')],_0x547a71['findBy']));return{'code':0xc8,'result':_0xeabc('0x143')};}};AGIVertices[_0xeabc('0x10')]['playback']=function(_0x2b6734){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x2b6734[_0xeabc('0x33')]));if(!this['isConfigured'](_0x2b6734['file_id'])){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x2b6734,_0xeabc('0xfd'));}var _0x3ba8c1=this[_0xeabc('0xfe')][_0xeabc('0x9b')](this,_0x2b6734['file_id']);if(!_0x3ba8c1){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x2b6734,_0xeabc('0xff'));}var _0x41bffe=this[_0xeabc('0xd')][_0xeabc('0xac')](_0xeabc('0x151'),[_0x3ba8c1,_0x2b6734['opts']]);if(_0x41bffe[_0xeabc('0x98')]===-0x1){return _0x41bffe;}return this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0xae'),'PLAYBACK',_0x3ba8c1));};AGIVertices[_0xeabc('0x10')][_0xeabc('0x152')]=function(_0x5eeeef){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x153'),_0x5eeeef[_0xeabc('0x33')]));if(!this[_0xeabc('0x9a')](_0x5eeeef[_0xeabc('0x154')])){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x5eeeef,_0xeabc('0x155'));}var _0x371841='';var _0x1e9dd4=parseInt(_0x5eeeef[_0xeabc('0x154')],0xa);if(isNaN(_0x1e9dd4)){_0x371841=_0x5eeeef[_0xeabc('0x154')];}else{_0x371841=this[_0xeabc('0x16')][_0xeabc('0x9b')](this,_0x5eeeef[_0xeabc('0x154')]);if(!_0x371841){return this[_0xeabc('0xd')]['error'](_0x5eeeef,'no\x20queue\x20found');}}var _0x46e277='';if(this[_0xeabc('0x9a')](_0x5eeeef[_0xeabc('0x14c')])){var _0x4e94f9=this[_0xeabc('0xfe')][_0xeabc('0x9b')](this,_0x5eeeef[_0xeabc('0x14c')]);if(_0x4e94f9){_0x46e277=_0x4e94f9;}}this[_0xeabc('0x31')]['sync'](this,_0x5eeeef,_0x371841);if(_0x5eeeef[_0xeabc('0xd7')][_0xeabc('0x156')]('x')<0x0){_0x5eeeef[_0xeabc('0xd7')]+='x';}if(_0x5eeeef[_0xeabc('0xd7')][_0xeabc('0x156')]('X')<0x0){_0x5eeeef[_0xeabc('0xd7')]+='X';}this['channel'][_0xeabc('0x93')](_0xeabc('0x157'),_0x371841?_0x371841[_0xeabc('0x158')]():'');var _0x1b048c=this[_0xeabc('0xd')][_0xeabc('0xac')](_0xeabc('0x159'),[_0x371841,_0x5eeeef['opts'],_0x5eeeef[_0xeabc('0x60')],_0x46e277,_0x5eeeef['timeout'],_0x5eeeef[_0xeabc('0x9e')],_0x5eeeef['macro'],_0x5eeeef[_0xeabc('0x15a')],'',_0x5eeeef[_0xeabc('0x15b')]]);if(_0x1b048c[_0xeabc('0x98')]===-0x1){return _0x1b048c;}return this['channel']['noop'](util['format']('Executed\x20command\x20%s\x20%s','QUEUE',_0x371841));};AGIVertices[_0xeabc('0x10')]['record']=function(_0x4fcf5b){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x4fcf5b['label']));var _0x1ac736=_0x4fcf5b['recordingFormat']||_0xeabc('0x117');var _0x1f0acb=util[_0xeabc('0x2a')](_0xeabc('0x15c'),this[_0xeabc('0xd')][_0xeabc('0x32')],rs[_0xeabc('0x105')](0x5));var _0x59939e=util[_0xeabc('0x2a')](_0xeabc('0x15d'),FILES_PATH,_0x1f0acb,_0x1ac736);var _0x1e9043=util[_0xeabc('0x2a')](_0xeabc('0x118'),FILES_PATH,_0x1f0acb);this[_0xeabc('0x36')]['sync'](this,_0x4fcf5b,_0x1f0acb,_0x59939e);this[_0xeabc('0xd')]['setVariable'](_0xeabc('0x15e'),_0x1f0acb);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x1e9043,_0x1ac736,_0x4fcf5b[_0xeabc('0x15f')],_0x4fcf5b[_0xeabc('0x62')]);return this[_0xeabc('0xd')][_0xeabc('0x11a')](_0x1e9043,_0x1ac736,_0x4fcf5b['escape_digits'],_0x4fcf5b[_0xeabc('0x62')],undefined,!![]);};AGIVertices[_0xeabc('0x10')][_0xeabc('0x160')]=function(_0x31a0f8){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x161'),_0x31a0f8['label']));if(!this[_0xeabc('0x9a')](_0x31a0f8[_0xeabc('0x60')])){return this[_0xeabc('0xd')]['noop'](_0xeabc('0x162'));}var _0xf660a6=this[_0xeabc('0x5f')][_0xeabc('0x9b')](this,_0x31a0f8);logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')]('Response:',util['inspect'](_0xf660a6,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x31a0f8[_0xeabc('0xca')])){return this['channel'][_0xeabc('0xa9')](_0xeabc('0x163'));}var _0x448562=this[_0xeabc('0x11')][_0xeabc('0x9b')](this,_0x31a0f8[_0xeabc('0xca')]);if(!_0x448562){return this['channel'][_0xeabc('0x2b')](_0x31a0f8,_0xeabc('0xcb'));}this['channel']['setVariable'](util[_0xeabc('0x2a')]('%s_STATUS_CODE',_0x448562),_0xf660a6[_0xeabc('0x6f')]?_0xf660a6['statusCode']:'200');this['channel'][_0xeabc('0x93')](util[_0xeabc('0x2a')](_0xeabc('0x164'),_0x448562),_0xf660a6['statusMessage']?_0xf660a6[_0xeabc('0x70')]:'OK');if(_0xf660a6[_0xeabc('0x6d')]){try{this['saveRestApiResult'](_0xf660a6[_0xeabc('0x6d')],_0x448562);}catch(_0x2ec8e4){logger[_0xeabc('0x2b')](util[_0xeabc('0x2a')](_0xeabc('0x165'),_0x448562));}}return this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0xcf'),_0x448562));};AGIVertices['prototype']['saydigits']=function(_0x262e20){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x166'),_0x262e20['label']));return this['channel'][_0xeabc('0x167')](_0x262e20[_0xeabc('0x168')][_0xeabc('0xc8')](/\s+/g,''),_0x262e20[_0xeabc('0x15f')]);};AGIVertices[_0xeabc('0x10')][_0xeabc('0x169')]=function(_0xec1947){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x16a'),_0xec1947[_0xeabc('0x33')]));return this[_0xeabc('0xd')][_0xeabc('0x16b')](_0xec1947[_0xeabc('0x16c')][_0xeabc('0xc8')](/\s+/g,''),_0xec1947[_0xeabc('0x15f')]);};AGIVertices[_0xeabc('0x10')][_0xeabc('0x16d')]=function(_0x1cd1b0){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x16e'),_0x1cd1b0[_0xeabc('0x33')]));return this[_0xeabc('0xd')][_0xeabc('0x16f')](_0x1cd1b0[_0xeabc('0x59')],_0x1cd1b0[_0xeabc('0x15f')]);};AGIVertices[_0xeabc('0x10')]['sendMail']=function(_0x5c38a8){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x170'),_0x5c38a8[_0xeabc('0x33')]));if(!this[_0xeabc('0x9a')](_0x5c38a8['account_id'])){return this[_0xeabc('0xd')]['noop']('no\x20mail\x20account\x20configured');}var _0x1281c8=this[_0xeabc('0x22')][_0xeabc('0x9b')](this,_0x5c38a8[_0xeabc('0x171')]);if(!_0x1281c8||!_0x1281c8['Smtp']){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x5c38a8,'no\x20mail\x20account\x20found');}var _0x285a28={'from':util[_0xeabc('0x2a')](_0xeabc('0x172'),_0x1281c8['name'],_0x1281c8[_0xeabc('0x173')]||_0x1281c8[_0xeabc('0x174')][_0xeabc('0x175')]),'to':_0x5c38a8['to']||'','cc':_0x5c38a8['cc']||'','bcc':_0x5c38a8[_0xeabc('0x176')]||'','subject':_0x5c38a8[_0xeabc('0x177')],'html':_0x5c38a8[_0xeabc('0x59')],'text':_0x5c38a8[_0xeabc('0x59')]};var _0x3fcee8={'tls':{'rejectUnauthorized':![]}};if(_0x1281c8['Smtp'][_0xeabc('0x178')]){_0x3fcee8['service']=_0x1281c8[_0xeabc('0x174')][_0xeabc('0x178')];}else{_0x3fcee8[_0xeabc('0x179')]=_0x1281c8[_0xeabc('0x174')][_0xeabc('0x179')];_0x3fcee8[_0xeabc('0x17a')]=_0x1281c8[_0xeabc('0x174')][_0xeabc('0x17a')];_0x3fcee8[_0xeabc('0x17b')]=_0x1281c8['Smtp']['secure'];}if(_0x1281c8[_0xeabc('0x174')][_0xeabc('0x17c')]){_0x3fcee8[_0xeabc('0x17d')]={'user':_0x1281c8[_0xeabc('0x174')]['user'],'pass':_0x1281c8['Smtp']['pass']};}if(this[_0xeabc('0x9a')](_0x5c38a8[_0xeabc('0x17e')])){}logger[_0xeabc('0xd1')](_0xeabc('0x17f'),JSON[_0xeabc('0x6c')](_0x285a28));this[_0xeabc('0x31')]['sync'](this,_0x5c38a8,_0x5c38a8['account_id']);this['channel'][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0x180'),_0x1281c8[_0xeabc('0x14')]));this[_0xeabc('0x24')][_0xeabc('0x9b')](this,_0x3fcee8,_0x285a28);return this[_0xeabc('0xd')]['noop'](_0xeabc('0x181'));};AGIVertices[_0xeabc('0x10')][_0xeabc('0x182')]=function(_0xfb3549){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x183'),_0xfb3549[_0xeabc('0x33')]));return this[_0xeabc('0xd')][_0xeabc('0xa9')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xeabc('0x10')][_0xeabc('0x184')]=function(_0xe3e59f){logger[_0xeabc('0x2c')](util['format'](_0xeabc('0x185'),_0xe3e59f[_0xeabc('0x33')]));if(!this[_0xeabc('0x9a')](_0xe3e59f[_0xeabc('0x186')])){return this['channel'][_0xeabc('0xa9')](_0xeabc('0x187'));}var _0x576579=this['getSmsAccount'][_0xeabc('0x9b')](this,_0xe3e59f[_0xeabc('0x186')]);if(!_0x576579){return this['channel']['error'](_0xe3e59f,_0xeabc('0x188'));}var _0x51ae7b={'body':_0xe3e59f[_0xeabc('0x189')],'phone':_0xe3e59f['to']||'','SmsAccountId':_0x576579['id']};logger[_0xeabc('0xd1')](_0xeabc('0x18a'),JSON['stringify'](_0x51ae7b));this[_0xeabc('0x31')][_0xeabc('0x9b')](this,_0xe3e59f,_0xe3e59f['sms_account_id']);this[_0xeabc('0xd')]['noop'](util[_0xeabc('0x2a')](_0xeabc('0x18b'),_0x576579[_0xeabc('0x14')]));this[_0xeabc('0x30')][_0xeabc('0x9b')](this,_0x51ae7b);return this[_0xeabc('0xd')][_0xeabc('0xa9')](_0xeabc('0x18c'));};AGIVertices[_0xeabc('0x10')][_0xeabc('0x18d')]=function(_0x259611){logger[_0xeabc('0x2c')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x259611[_0xeabc('0x33')]));if(!this['isConfigured'](_0x259611['variable_id'])){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x259611,_0xeabc('0x18e'));}var _0x5e5a4b=this[_0xeabc('0x11')][_0xeabc('0x9b')](this,_0x259611['variable_id']);if(!_0x5e5a4b){return this['channel']['error'](_0x259611,_0xeabc('0xcb'));}return this[_0xeabc('0xd')]['setVariable'](_0x5e5a4b,_0x259611[_0xeabc('0x18f')]);};AGIVertices[_0xeabc('0x10')][_0xeabc('0x190')]=function(_0x26d0e8){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')]('Enter\x20in\x20START\x20(%s)\x20block',_0x26d0e8[_0xeabc('0x33')]));this[_0xeabc('0xd')][_0xeabc('0xa9')](_0xeabc('0x191'));if(_0x26d0e8[_0xeabc('0xa0')]===_0xeabc('0x192')){this[_0xeabc('0xd')][_0xeabc('0xa9')](_0xeabc('0x193'));return this['channel'][_0xeabc('0xa0')]();}return this[_0xeabc('0xd')][_0xeabc('0xa9')](_0xeabc('0x194'));};AGIVertices[_0xeabc('0x10')][_0xeabc('0x195')]=function(_0x139018){logger[_0xeabc('0x2c')](util['format'](_0xeabc('0x196'),_0x139018['label']));if(!this[_0xeabc('0x9a')](_0x139018['project_id'])){return this[_0xeabc('0xd')]['error'](_0x139018,'no\x20subproject\x20selected');}var _0x8b2e17=this[_0xeabc('0x197')][_0xeabc('0x9b')](this,_0x139018[_0xeabc('0x198')]);if(!this[_0xeabc('0x9a')](_0x8b2e17)){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x139018,util[_0xeabc('0x2a')](_0xeabc('0x199'),_0x139018['project_id']));}if(_0x8b2e17===this[_0xeabc('0xd')]['arg_1']){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x139018,_0xeabc('0x19a'));}this['createSquareDetailsReport'][_0xeabc('0x9b')](this,_0x139018,_0x8b2e17);var _0x29b246=this['channel'][_0xeabc('0xac')](_0xeabc('0x19b'),util[_0xeabc('0x2a')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xeabc('0x9e')][_0xeabc('0x179')]||'127.0.0.1',_0x8b2e17,this[_0xeabc('0xd')][_0xeabc('0x35')]));if(_0x29b246[_0xeabc('0x98')]===-0x1){return _0x29b246;}return this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0xae'),_0xeabc('0x19b'),_0x8b2e17));};AGIVertices[_0xeabc('0x10')][_0xeabc('0x19c')]=function(_0x29ef9b){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x19d'),_0x29ef9b[_0xeabc('0x33')]));var _0x301bd7=this[_0xeabc('0x55')][_0xeabc('0x9b')](this,_0x29ef9b[_0xeabc('0x9f')]);this[_0xeabc('0x31')]['sync'](this,_0x29ef9b,_0x29ef9b[_0xeabc('0x9f')]);if(this[_0xeabc('0x9a')](_0x29ef9b['variable_id'])){var _0xc51094=this['getVariable'][_0xeabc('0x9b')](this,_0x29ef9b[_0xeabc('0xca')]);if(_0xc51094){this[_0xeabc('0xd')][_0xeabc('0x93')](_0xc51094,_0x301bd7);return this['channel'][_0xeabc('0xa9')](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x29ef9b[_0xeabc('0x9f')],_0xc51094));}}return this['channel'][_0xeabc('0xa9')](util[_0xeabc('0x2a')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x29ef9b[_0xeabc('0x9f')]));};AGIVertices[_0xeabc('0x10')][_0xeabc('0x19e')]=function(_0x25b000){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x19f'),_0x25b000['label']));if(!this['isConfigured'](_0x25b000[_0xeabc('0x58')])){return this[_0xeabc('0xd')][_0xeabc('0xa9')]('no\x20apiKey\x20configured');}if(!this[_0xeabc('0x9a')](_0x25b000[_0xeabc('0x59')])){return this[_0xeabc('0xd')][_0xeabc('0xa9')](_0xeabc('0xb0'));}this[_0xeabc('0xd')][_0xeabc('0xa9')](util['format'](_0xeabc('0x1a0'),_0x25b000[_0xeabc('0x59')]));var _0x16443c=this[_0xeabc('0x57')][_0xeabc('0x9b')](this,_0x25b000);if(_0x16443c){this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0x1a1'),_0x16443c));var _0xef157=this['channel'][_0xeabc('0xee')](_0x16443c);try{fs[_0xeabc('0xef')](_0x16443c+_0xeabc('0xf0'));}catch(_0x1f5a15){logger[_0xeabc('0x2b')](_0x1f5a15);}return _0xef157;}return this['channel']['error'](_0x25b000,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xeabc('0x10')]['tts']=function(_0x532ec5){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x1a2'),_0x532ec5[_0xeabc('0x33')]));if(!this[_0xeabc('0x9a')](_0x532ec5['text'])){return this['channel']['noop'](_0xeabc('0xb0'));}this['channel']['noop'](util['format'](_0xeabc('0x1a3'),_0x532ec5['text']));var _0x26ee6c=this[_0xeabc('0x5d')]['sync'](this,_0x532ec5);if(_0x26ee6c){this[_0xeabc('0xd')][_0xeabc('0xa9')](util['format'](_0xeabc('0x1a4'),_0x26ee6c));var _0x510cf0=this['channel'][_0xeabc('0xee')](_0x26ee6c);try{fs['unlink'](_0x26ee6c+_0xeabc('0xf0'));}catch(_0x566daa){logger[_0xeabc('0x2b')](_0x566daa);}return _0x510cf0;}return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x532ec5,_0xeabc('0x1a5'));};AGIVertices[_0xeabc('0x10')][_0xeabc('0x1a6')]=function(_0x25d30c){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x1a7'),_0x25d30c[_0xeabc('0x33')]));if(!this[_0xeabc('0x9a')](_0x25d30c[_0xeabc('0x13e')])){return this[_0xeabc('0xd')]['error'](_0x25d30c,_0xeabc('0x13f'));}logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x145'),this[_0xeabc('0xd')][_0xeabc('0x37')],_0x25d30c[_0xeabc('0x13e')]));var _0x33e8e6=this[_0xeabc('0x50')]['sync'](this,_0x25d30c[_0xeabc('0x13e')]);if(_0x33e8e6){logger['info'](util['format'](_0xeabc('0x140'),this[_0xeabc('0xd')]['callerid'],_0x25d30c[_0xeabc('0x13e')]));this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xeabc('0xd')][_0xeabc('0x37')],_0x25d30c['findBy']));return{'code':0xc8,'result':_0xeabc('0x141')};}else{logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x142'),this[_0xeabc('0xd')][_0xeabc('0x37')],_0x25d30c[_0xeabc('0x13e')]));this[_0xeabc('0xd')][_0xeabc('0xa9')](util['format'](_0xeabc('0x142'),this[_0xeabc('0xd')][_0xeabc('0x37')],_0x25d30c[_0xeabc('0x13e')]));return{'code':0xc8,'result':_0xeabc('0x143')};}};AGIVertices['prototype'][_0xeabc('0x1a8')]=function(_0x54a970){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x1a9'),_0x54a970[_0xeabc('0x33')]));var _0x5a34dc=this[_0xeabc('0xd')][_0xeabc('0xac')](_0xeabc('0x1aa'),[_0x54a970[_0xeabc('0x1ab')],_0x54a970[_0xeabc('0x73')]]);if(_0x5a34dc[_0xeabc('0x98')]===-0x1){return _0x5a34dc;}return this[_0xeabc('0xd')][_0xeabc('0xa9')](util[_0xeabc('0x2a')](_0xeabc('0xae'),_0xeabc('0x1aa'),_0x54a970[_0xeabc('0x1ab')]));};AGIVertices['prototype'][_0xeabc('0x1ac')]=function(_0x4f54ae){logger[_0xeabc('0x2c')](util[_0xeabc('0x2a')](_0xeabc('0x1ad'),_0x4f54ae[_0xeabc('0x33')]));if(!this[_0xeabc('0x9a')](_0x4f54ae[_0xeabc('0xca')])){return this[_0xeabc('0xd')][_0xeabc('0x2b')](_0x4f54ae,_0xeabc('0x18e'));}var _0x2421e6=this[_0xeabc('0x11')][_0xeabc('0x9b')](this,_0x4f54ae[_0xeabc('0xca')]);if(!_0x2421e6){return this['channel'][_0xeabc('0x2b')](_0x4f54ae,_0xeabc('0xcb'));}var _0x40886a=this[_0xeabc('0xd')][_0xeabc('0x11')](_0x2421e6);return{'code':0xc8,'result':_0x40886a[_0xeabc('0x96')]?_0x40886a[_0xeabc('0x96')]:'-'};};String[_0xeabc('0x10')][_0xeabc('0x1ae')]=function(_0x21a0ad,_0x4ca8ac){return this[_0xeabc('0x1af')](_0x21a0ad)['join'](_0x4ca8ac);};module[_0xeabc('0x1b0')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index c905a27..6176452 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 _0x0a9a=['acw','../rpc/user','voiceQueues','agents','timers','agentconnect','bind','hanguprequest','syncHangupRequest','syncHangup','attendedtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','channels','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','then','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','update','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','../ami','../../../config/logger'];(function(_0x57aa63,_0x3b575f){var _0x9d258a=function(_0x3c5b1b){while(--_0x3c5b1b){_0x57aa63['push'](_0x57aa63['shift']());}};_0x9d258a(++_0x3b575f);}(_0x0a9a,0x183));var _0xa0a9=function(_0x254959,_0x32e0b0){_0x254959=_0x254959-0x0;var _0xb23270=_0x0a9a[_0x254959];return _0xb23270;};'use strict';var util=require('util');var _=require(_0xa0a9('0x0'));var moment=require('moment');var ami=require(_0xa0a9('0x1'));var logger=require(_0xa0a9('0x2'))(_0xa0a9('0x3'));var RpcUser=require(_0xa0a9('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x317a94){this[_0xa0a9('0x5')]=_0x317a94['voiceQueues'];this[_0xa0a9('0x6')]=_0x317a94[_0xa0a9('0x6')];this[_0xa0a9('0x7')]=_0x317a94[_0xa0a9('0x7')];this['channels']={};ami['on'](_0xa0a9('0x8'),this['syncAgentConnect'][_0xa0a9('0x9')](this));ami['on'](_0xa0a9('0xa'),this[_0xa0a9('0xb')][_0xa0a9('0x9')](this));ami['on']('hangup',this[_0xa0a9('0xc')][_0xa0a9('0x9')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0xa0a9('0x9')](this));ami['on'](_0xa0a9('0xd'),this['syncAttendedTransfer'][_0xa0a9('0x9')](this));ami['on']('blindtransfer',this[_0xa0a9('0xe')]['bind'](this));ami['on'](_0xa0a9('0xf'),this[_0xa0a9('0x10')][_0xa0a9('0x9')](this));}function getDiff(_0x35e7cd){var _0x13833c=moment()['milliseconds'](0x0);var _0x1f3f23=moment(_0x35e7cd)[_0xa0a9('0x11')](0x0);return _0x13833c[_0xa0a9('0x12')](_0x1f3f23,_0xa0a9('0x13'));}Acw[_0xa0a9('0x14')][_0xa0a9('0x15')]=function(_0x5a6693){try{var _0x176faa=this;var _0x48c315=this['channels'][_0x5a6693][_0xa0a9('0x16')];var _0x9f5abd=this[_0xa0a9('0x17')][_0x5a6693][_0xa0a9('0x18')];var _0x568409=this[_0xa0a9('0x5')][_0x9f5abd];var _0x126401=![];var _0x33eb8f=_0xa0a9('0x19');if(_0x568409[_0xa0a9('0x1a')]){if(_0x568409[_0xa0a9('0x1b')]['name']){_0x126401=!![];_0x33eb8f=_0x568409[_0xa0a9('0x1b')][_0xa0a9('0x1c')];}}ami['Action']({'action':'QueuePause','interface':_0x48c315,'paused':!![],'reason':_0x33eb8f})[_0xa0a9('0x1d')](function(_0x1f6955){if(_0x176faa[_0xa0a9('0x6')][_0x48c315]){return RpcUser['getAgent'](_0x176faa[_0xa0a9('0x6')][_0x48c315]['id'])['then'](function(_0x1fb36b){if(_0x1fb36b&&!_0x1fb36b['voicePause']){logger[_0xa0a9('0x1e')](_0xa0a9('0x1f'),_0x5a6693,_0x48c315,_0x9f5abd);var _0x2f0b14=_0x176faa[_0xa0a9('0x17')][_0x5a6693]['attended']&&_0x176faa[_0xa0a9('0x17')][_0x5a6693]['destlinkedid']?_0x176faa[_0xa0a9('0x17')][_0x5a6693][_0xa0a9('0x20')]:_0x5a6693;return RpcUser[_0xa0a9('0x21')](_0x176faa[_0xa0a9('0x6')][_0x48c315],_0x33eb8f,_0x2f0b14)['then'](function(_0x7c1502){if(!_0x126401){_0x176faa[_0xa0a9('0x7')][_0x48c315]={};logger[_0xa0a9('0x1e')](_0xa0a9('0x22'),_0x5a6693,_0x176faa['voiceQueues'][_0x9f5abd][_0xa0a9('0x23')],_0x48c315,_0x9f5abd);_0x176faa[_0xa0a9('0x7')][_0x48c315][_0xa0a9('0x24')]=setTimeout(_0x176faa['stopAcw']['bind'](_0x176faa,_0x48c315),_0x176faa[_0xa0a9('0x5')][_0x9f5abd][_0xa0a9('0x23')]*0x3e8);_0x176faa[_0xa0a9('0x7')][_0x48c315][_0xa0a9('0x25')]=moment()[_0xa0a9('0x26')](_0xa0a9('0x27'));_0x176faa[_0xa0a9('0x7')][_0x48c315][_0xa0a9('0x28')]=_0x5a6693;_0x176faa[_0xa0a9('0x7')][_0x48c315][_0xa0a9('0x18')]=_0x9f5abd;_0x176faa[_0xa0a9('0x7')][_0x48c315]['updateAcw']=function(){var _0x1f6178=getDiff(_0x176faa[_0xa0a9('0x7')][_0x48c315]['lastPauseAt']);clearTimeout(_0x176faa[_0xa0a9('0x7')][_0x48c315][_0xa0a9('0x24')]);_0x176faa['timers'][_0x48c315]['timer']=![];RpcVoiceAgentReport[_0xa0a9('0x29')]({'acwtime':_0x1f6178},_0x176faa['timers'][_0x48c315]['uniqueid'],_0x48c315)[_0xa0a9('0x1d')](function(_0x104936){logger[_0xa0a9('0x1e')](_0xa0a9('0x2a'),_0x5a6693,_0x1f6178,_0x104936);})[_0xa0a9('0x2b')](function(_0x12bdcc){logger[_0xa0a9('0x2c')]('[%s][UPDATE][ERRORS:%s]',_0x5a6693,_0x12bdcc);});delete _0x176faa[_0xa0a9('0x7')][_0x48c315];};}});}else{logger[_0xa0a9('0x1e')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x5a6693,_0x48c315,_0x9f5abd);}});}})[_0xa0a9('0x2b')](function(_0x2f98f6){logger[_0xa0a9('0x2c')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x5a6693,_0x176faa['voiceQueues'][_0x9f5abd][_0xa0a9('0x23')],_0x48c315,_0x9f5abd);})[_0xa0a9('0x2d')](function(){delete _0x176faa[_0xa0a9('0x17')][_0x5a6693];});}catch(_0x42fd7a){logger['error'](_0xa0a9('0x2e'),_0x42fd7a[_0xa0a9('0x2f')]);}};Acw[_0xa0a9('0x14')]['stopAcw']=function(_0x2a4587){try{var _0x3c74ea=this;if(_0x3c74ea[_0xa0a9('0x7')][_0x2a4587]){_0x3c74ea['timers'][_0x2a4587][_0xa0a9('0x24')]=![];var _0x2ed673=_0x3c74ea[_0xa0a9('0x7')][_0x2a4587][_0xa0a9('0x28')];var _0x2e11dc=_0x3c74ea[_0xa0a9('0x7')][_0x2a4587][_0xa0a9('0x18')];var _0xcf2461=_0x3c74ea[_0xa0a9('0x5')][_0x2e11dc][_0xa0a9('0x23')];logger[_0xa0a9('0x1e')](_0xa0a9('0x30'),_0x2a4587);RpcUser[_0xa0a9('0x31')](this[_0xa0a9('0x6')][_0x2a4587]);RpcVoiceAgentReport[_0xa0a9('0x29')]({'acwtime':_0xcf2461,'agentacw':!![]},_0x2ed673,_0x2a4587)[_0xa0a9('0x1d')](function(_0x868447){logger['info'](_0xa0a9('0x2a'),_0x2ed673,_0xcf2461,_0x868447);})[_0xa0a9('0x2b')](function(_0x3d3769){logger['error'](_0xa0a9('0x32'),_0x2ed673,_0x3d3769);});}else{logger[_0xa0a9('0x2c')](_0xa0a9('0x33'),_0x2a4587);if(_0x3c74ea[_0xa0a9('0x7')]){logger['info'](_0xa0a9('0x34'),JSON[_0xa0a9('0x35')](_0x3c74ea[_0xa0a9('0x7')]));}}}catch(_0x17c40b){logger[_0xa0a9('0x2c')]('[ACW][STOP]\x20%s',_0x17c40b[_0xa0a9('0x2f')]);}};Acw[_0xa0a9('0x14')][_0xa0a9('0x36')]=function(_0x32d926){try{if(this[_0xa0a9('0x5')][_0x32d926['queue']]&&(this[_0xa0a9('0x5')][_0x32d926[_0xa0a9('0x18')]][_0xa0a9('0x3')]||this[_0xa0a9('0x5')][_0x32d926[_0xa0a9('0x18')]]['mandatoryDisposition'])){if(this[_0xa0a9('0x6')][_0x32d926[_0xa0a9('0x16')]]){this['channels'][_0x32d926['uniqueid']]={'queue':_0x32d926[_0xa0a9('0x18')],'interface':_0x32d926[_0xa0a9('0x16')],'destlinkedid':_0x32d926[_0xa0a9('0x20')]};}}}catch(_0x1db92b){logger['error'](_0xa0a9('0x37'),_0x1db92b[_0xa0a9('0x2f')]);}};Acw[_0xa0a9('0x14')][_0xa0a9('0x10')]=function(_0x3e1d61){try{if(this[_0xa0a9('0x5')][_0x3e1d61[_0xa0a9('0x18')]]&&(this[_0xa0a9('0x5')][_0x3e1d61[_0xa0a9('0x18')]][_0xa0a9('0x3')]||this[_0xa0a9('0x5')][_0x3e1d61[_0xa0a9('0x18')]][_0xa0a9('0x1a')])){if(this[_0xa0a9('0x6')][_0x3e1d61[_0xa0a9('0x16')]]){this[_0xa0a9('0x17')][_0x3e1d61[_0xa0a9('0x28')]]={'queue':_0x3e1d61['queue'],'interface':_0x3e1d61[_0xa0a9('0x16')]};}}}catch(_0x4906c6){logger[_0xa0a9('0x2c')](_0xa0a9('0x38'),_0x4906c6[_0xa0a9('0x2f')]);}};Acw[_0xa0a9('0x14')][_0xa0a9('0xb')]=function(_0x1bf5c8){try{if(this[_0xa0a9('0x17')][_0x1bf5c8[_0xa0a9('0x28')]]&&_[_0xa0a9('0x39')](this['channels'][_0x1bf5c8[_0xa0a9('0x28')]][_0xa0a9('0x3a')])){logger[_0xa0a9('0x1e')]('[%s][HANGUP:UNIQUEID]',_0x1bf5c8[_0xa0a9('0x28')]);this[_0xa0a9('0x15')](_0x1bf5c8[_0xa0a9('0x28')]);}else if(this['channels'][_0x1bf5c8[_0xa0a9('0x3b')]]&&_[_0xa0a9('0x39')](this[_0xa0a9('0x17')][_0x1bf5c8[_0xa0a9('0x3b')]]['attended'])){logger[_0xa0a9('0x1e')](_0xa0a9('0x3c'),_0x1bf5c8[_0xa0a9('0x3b')]);this[_0xa0a9('0x15')](_0x1bf5c8[_0xa0a9('0x3b')]);}}catch(_0x41128b){logger[_0xa0a9('0x2c')]('[ACW][syncHangupRequest]\x20%s',_0x41128b[_0xa0a9('0x2f')]);}};Acw[_0xa0a9('0x14')]['syncHangup']=function(_0x2cbd5e){try{if(this[_0xa0a9('0x17')][_0x2cbd5e[_0xa0a9('0x28')]]&&this['channels'][_0x2cbd5e['uniqueid']][_0xa0a9('0x3a')]){logger[_0xa0a9('0x1e')](_0xa0a9('0x3d'),_0x2cbd5e[_0xa0a9('0x28')]);this['startAcw'](_0x2cbd5e['uniqueid']);}else if(this[_0xa0a9('0x17')][_0x2cbd5e[_0xa0a9('0x3b')]]&&this['channels'][_0x2cbd5e['linkedid']][_0xa0a9('0x3a')]){logger[_0xa0a9('0x1e')](_0xa0a9('0x3e'),_0x2cbd5e[_0xa0a9('0x3b')]);this[_0xa0a9('0x15')](_0x2cbd5e[_0xa0a9('0x3b')]);}}catch(_0x24af09){logger[_0xa0a9('0x2c')](_0xa0a9('0x3f'),_0x24af09[_0xa0a9('0x2f')]);}};Acw[_0xa0a9('0x14')]['syncAttendedTransfer']=function(_0x39070f){try{if(!_[_0xa0a9('0x40')](this[_0xa0a9('0x17')][_0x39070f['transfereeuniqueid']])){this[_0xa0a9('0x15')](_0x39070f[_0xa0a9('0x41')]);if(this[_0xa0a9('0x17')][_0x39070f['secondtransfereruniqueid']]){this[_0xa0a9('0x17')][_0x39070f[_0xa0a9('0x42')]][_0xa0a9('0x3a')]=!![];this[_0xa0a9('0x17')][_0x39070f[_0xa0a9('0x43')]]=this[_0xa0a9('0x17')][_0x39070f[_0xa0a9('0x42')]];delete this['channels'][_0x39070f[_0xa0a9('0x42')]];}}else if(!_[_0xa0a9('0x40')](this[_0xa0a9('0x17')][_0x39070f[_0xa0a9('0x43')]])){this[_0xa0a9('0x15')](_0x39070f[_0xa0a9('0x43')]);if(this[_0xa0a9('0x17')][_0x39070f['origtransfereruniqueid']]){this['channels'][_0x39070f['origtransfereruniqueid']][_0xa0a9('0x3a')]=!![];this['channels'][_0x39070f[_0xa0a9('0x41')]]=this['channels'][_0x39070f[_0xa0a9('0x44')]];delete this[_0xa0a9('0x17')][_0x39070f[_0xa0a9('0x44')]];}}}catch(_0x2f7ab4){logger[_0xa0a9('0x2c')](_0xa0a9('0x45'),_0x2f7ab4[_0xa0a9('0x2f')]);}};Acw[_0xa0a9('0x14')]['syncBlindTransfer']=function(_0x5968ce){try{if(this[_0xa0a9('0x17')][_0x5968ce['transfereruniqueid']]){logger[_0xa0a9('0x1e')](_0xa0a9('0x46'),JSON[_0xa0a9('0x35')](_0x5968ce['transfereruniqueid']));this[_0xa0a9('0x15')](_0x5968ce['transfereruniqueid']);}else if(this[_0xa0a9('0x17')][_0x5968ce[_0xa0a9('0x47')]]){logger[_0xa0a9('0x1e')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xa0a9('0x35')](_0x5968ce['transfererlinkedid']));this[_0xa0a9('0x15')](_0x5968ce['transfererlinkedid']);}}catch(_0x2f253d){logger['error'](_0xa0a9('0x48'),_0x2f253d[_0xa0a9('0x2f')]);}};Acw[_0xa0a9('0x14')][_0xa0a9('0x49')]=function(_0x9dba0b){try{if(this[_0xa0a9('0x5')][_0x9dba0b['queue']]&&this[_0xa0a9('0x5')][_0x9dba0b[_0xa0a9('0x18')]][_0xa0a9('0x4a')]==='all'){if(this[_0xa0a9('0x6')][_0x9dba0b[_0xa0a9('0x16')]]){logger[_0xa0a9('0x1e')](_0xa0a9('0x4b'),_0x9dba0b[_0xa0a9('0x28')],_0x9dba0b['interface'],_0x9dba0b[_0xa0a9('0x18')]);return RpcUser[_0xa0a9('0x21')](this[_0xa0a9('0x6')][_0x9dba0b[_0xa0a9('0x16')]],_0xa0a9('0x4c'),_0x9dba0b[_0xa0a9('0x28')]);}}}catch(_0x3139b3){logger[_0xa0a9('0x2c')](_0xa0a9('0x4d'),_0x3139b3[_0xa0a9('0x2f')]);}};module['exports']=Acw; \ No newline at end of file +var _0x9c44=['[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','agentringnoanswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','ACW','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','info','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x49c4('0x0'));var ami=require(_0x49c4('0x1'));var logger=require(_0x49c4('0x2'))(_0x49c4('0x3'));var RpcUser=require(_0x49c4('0x4'));var RpcVoiceAgentReport=require(_0x49c4('0x5'));function Acw(_0x4e0313){this['voiceQueues']=_0x4e0313[_0x49c4('0x6')];this['agents']=_0x4e0313[_0x49c4('0x7')];this[_0x49c4('0x8')]=_0x4e0313[_0x49c4('0x8')];this[_0x49c4('0x9')]={};ami['on'](_0x49c4('0xa'),this['syncAgentConnect'][_0x49c4('0xb')](this));ami['on'](_0x49c4('0xc'),this[_0x49c4('0xd')][_0x49c4('0xb')](this));ami['on']('hangup',this['syncHangup'][_0x49c4('0xb')](this));ami['on'](_0x49c4('0xe'),this['syncAgentRingNoAnswer'][_0x49c4('0xb')](this));ami['on'](_0x49c4('0xf'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x49c4('0x10'),this[_0x49c4('0x11')]['bind'](this));ami['on'](_0x49c4('0x12'),this[_0x49c4('0x13')]['bind'](this));}function getDiff(_0x1909fe){var _0x280996=moment()[_0x49c4('0x14')](0x0);var _0x2decee=moment(_0x1909fe)[_0x49c4('0x14')](0x0);return _0x280996[_0x49c4('0x15')](_0x2decee,_0x49c4('0x16'));}Acw[_0x49c4('0x17')]['startAcw']=function(_0x3acd06){try{var _0x141003=this;var _0x13a2db=this[_0x49c4('0x9')][_0x3acd06][_0x49c4('0x18')];var _0x53e3a2=this[_0x49c4('0x9')][_0x3acd06][_0x49c4('0x19')];var _0x4c3253=this['voiceQueues'][_0x53e3a2];var _0x3c782d=![];var _0x2f82d5=_0x49c4('0x1a');if(_0x4c3253['mandatoryDisposition']){if(_0x4c3253[_0x49c4('0x1b')]['name']){_0x3c782d=!![];_0x2f82d5=_0x4c3253[_0x49c4('0x1b')][_0x49c4('0x1c')];}}ami[_0x49c4('0x1d')]({'action':_0x49c4('0x1e'),'interface':_0x13a2db,'paused':!![],'reason':_0x2f82d5})[_0x49c4('0x1f')](function(_0x41078c){if(_0x141003[_0x49c4('0x7')][_0x13a2db]){return RpcUser[_0x49c4('0x20')](_0x141003[_0x49c4('0x7')][_0x13a2db]['id'])['then'](function(_0x527126){if(_0x527126&&!_0x527126['voicePause']){logger[_0x49c4('0x21')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x3acd06,_0x13a2db,_0x53e3a2);var _0x592bb8=_0x141003[_0x49c4('0x9')][_0x3acd06][_0x49c4('0x22')]&&_0x141003[_0x49c4('0x9')][_0x3acd06][_0x49c4('0x23')]?_0x141003['channels'][_0x3acd06]['destlinkedid']:_0x3acd06;return RpcUser[_0x49c4('0x24')](_0x141003[_0x49c4('0x7')][_0x13a2db],_0x2f82d5,_0x592bb8)['then'](function(_0x207358){if(!_0x3c782d){_0x141003[_0x49c4('0x8')][_0x13a2db]={};logger[_0x49c4('0x21')](_0x49c4('0x25'),_0x3acd06,_0x141003['voiceQueues'][_0x53e3a2]['acwTimeout'],_0x13a2db,_0x53e3a2);_0x141003[_0x49c4('0x8')][_0x13a2db]['timer']=setTimeout(_0x141003[_0x49c4('0x26')][_0x49c4('0xb')](_0x141003,_0x13a2db),_0x141003[_0x49c4('0x6')][_0x53e3a2][_0x49c4('0x27')]*0x3e8);_0x141003['timers'][_0x13a2db][_0x49c4('0x28')]=moment()[_0x49c4('0x29')](_0x49c4('0x2a'));_0x141003[_0x49c4('0x8')][_0x13a2db][_0x49c4('0x2b')]=_0x3acd06;_0x141003[_0x49c4('0x8')][_0x13a2db][_0x49c4('0x19')]=_0x53e3a2;_0x141003[_0x49c4('0x8')][_0x13a2db][_0x49c4('0x2c')]=function(){var _0x2cbd88=getDiff(_0x141003[_0x49c4('0x8')][_0x13a2db]['lastPauseAt']);clearTimeout(_0x141003['timers'][_0x13a2db]['timer']);_0x141003[_0x49c4('0x8')][_0x13a2db][_0x49c4('0x2d')]=![];RpcVoiceAgentReport[_0x49c4('0x2e')]({'acwtime':_0x2cbd88},_0x141003[_0x49c4('0x8')][_0x13a2db][_0x49c4('0x2b')],_0x13a2db)['then'](function(_0x38ad77){logger[_0x49c4('0x21')](_0x49c4('0x2f'),_0x3acd06,_0x2cbd88,_0x38ad77);})[_0x49c4('0x30')](function(_0x58e252){logger['error'](_0x49c4('0x31'),_0x3acd06,_0x58e252);});delete _0x141003[_0x49c4('0x8')][_0x13a2db];};}});}else{logger[_0x49c4('0x21')](_0x49c4('0x32'),_0x3acd06,_0x13a2db,_0x53e3a2);}});}})[_0x49c4('0x30')](function(_0x4a0c7a){logger[_0x49c4('0x33')](_0x49c4('0x25'),_0x3acd06,_0x141003[_0x49c4('0x6')][_0x53e3a2]['acwTimeout'],_0x13a2db,_0x53e3a2);})['finally'](function(){delete _0x141003[_0x49c4('0x9')][_0x3acd06];});}catch(_0x1991e9){logger[_0x49c4('0x33')](_0x49c4('0x34'),_0x1991e9[_0x49c4('0x35')]);}};Acw[_0x49c4('0x17')][_0x49c4('0x26')]=function(_0x27ef5f){try{var _0x3209cd=this;if(_0x3209cd['timers'][_0x27ef5f]){_0x3209cd[_0x49c4('0x8')][_0x27ef5f]['timer']=![];var _0xdda586=_0x3209cd[_0x49c4('0x8')][_0x27ef5f][_0x49c4('0x2b')];var _0x1c2830=_0x3209cd['timers'][_0x27ef5f][_0x49c4('0x19')];var _0x31f3ff=_0x3209cd[_0x49c4('0x6')][_0x1c2830]['acwTimeout'];logger[_0x49c4('0x21')](_0x49c4('0x36'),_0x27ef5f);RpcUser[_0x49c4('0x37')](this[_0x49c4('0x7')][_0x27ef5f]);RpcVoiceAgentReport[_0x49c4('0x2e')]({'acwtime':_0x31f3ff,'agentacw':!![]},_0xdda586,_0x27ef5f)[_0x49c4('0x1f')](function(_0x143916){logger[_0x49c4('0x21')](_0x49c4('0x2f'),_0xdda586,_0x31f3ff,_0x143916);})[_0x49c4('0x30')](function(_0x1e506a){logger['error'](_0x49c4('0x31'),_0xdda586,_0x1e506a);});}else{logger[_0x49c4('0x33')](_0x49c4('0x38'),_0x27ef5f);if(_0x3209cd[_0x49c4('0x8')]){logger[_0x49c4('0x21')](_0x49c4('0x39'),JSON[_0x49c4('0x3a')](_0x3209cd[_0x49c4('0x8')]));}}}catch(_0x248c0a){logger[_0x49c4('0x33')](_0x49c4('0x3b'),_0x248c0a[_0x49c4('0x35')]);}};Acw[_0x49c4('0x17')]['syncAgentConnect']=function(_0x212366){try{if(this['voiceQueues'][_0x212366[_0x49c4('0x19')]]&&(this[_0x49c4('0x6')][_0x212366[_0x49c4('0x19')]][_0x49c4('0x3')]||this[_0x49c4('0x6')][_0x212366[_0x49c4('0x19')]]['mandatoryDisposition'])){if(this['agents'][_0x212366[_0x49c4('0x18')]]){this[_0x49c4('0x9')][_0x212366[_0x49c4('0x2b')]]={'queue':_0x212366[_0x49c4('0x19')],'interface':_0x212366['interface'],'destlinkedid':_0x212366[_0x49c4('0x23')]};}}}catch(_0x392e59){logger[_0x49c4('0x33')](_0x49c4('0x3c'),_0x392e59[_0x49c4('0x35')]);}};Acw[_0x49c4('0x17')][_0x49c4('0x13')]=function(_0x3351c1){try{if(this[_0x49c4('0x6')][_0x3351c1['queue']]&&(this[_0x49c4('0x6')][_0x3351c1['queue']][_0x49c4('0x3')]||this[_0x49c4('0x6')][_0x3351c1[_0x49c4('0x19')]][_0x49c4('0x3d')])){if(this[_0x49c4('0x7')][_0x3351c1['interface']]){this[_0x49c4('0x9')][_0x3351c1[_0x49c4('0x2b')]]={'queue':_0x3351c1[_0x49c4('0x19')],'interface':_0x3351c1[_0x49c4('0x18')]};}}}catch(_0x1ded71){logger[_0x49c4('0x33')](_0x49c4('0x3e'),_0x1ded71['message']);}};Acw[_0x49c4('0x17')]['syncHangupRequest']=function(_0x3f7379){try{if(this[_0x49c4('0x9')][_0x3f7379[_0x49c4('0x2b')]]&&_[_0x49c4('0x3f')](this[_0x49c4('0x9')][_0x3f7379[_0x49c4('0x2b')]][_0x49c4('0x22')])){logger['info'](_0x49c4('0x40'),_0x3f7379[_0x49c4('0x2b')]);this['startAcw'](_0x3f7379[_0x49c4('0x2b')]);}else if(this[_0x49c4('0x9')][_0x3f7379[_0x49c4('0x41')]]&&_[_0x49c4('0x3f')](this['channels'][_0x3f7379['linkedid']][_0x49c4('0x22')])){logger['info'](_0x49c4('0x42'),_0x3f7379[_0x49c4('0x41')]);this[_0x49c4('0x43')](_0x3f7379[_0x49c4('0x41')]);}}catch(_0x240c20){logger[_0x49c4('0x33')](_0x49c4('0x44'),_0x240c20['message']);}};Acw[_0x49c4('0x17')][_0x49c4('0x45')]=function(_0x3936d3){try{if(this[_0x49c4('0x9')][_0x3936d3[_0x49c4('0x2b')]]&&this[_0x49c4('0x9')][_0x3936d3[_0x49c4('0x2b')]][_0x49c4('0x22')]){logger[_0x49c4('0x21')](_0x49c4('0x46'),_0x3936d3['uniqueid']);this['startAcw'](_0x3936d3[_0x49c4('0x2b')]);}else if(this[_0x49c4('0x9')][_0x3936d3['linkedid']]&&this['channels'][_0x3936d3[_0x49c4('0x41')]]['attended']){logger['info'](_0x49c4('0x47'),_0x3936d3[_0x49c4('0x41')]);this[_0x49c4('0x43')](_0x3936d3[_0x49c4('0x41')]);}}catch(_0x2884ca){logger[_0x49c4('0x33')](_0x49c4('0x48'),_0x2884ca['message']);}};Acw[_0x49c4('0x17')][_0x49c4('0x49')]=function(_0x207572){try{if(!_[_0x49c4('0x4a')](this[_0x49c4('0x9')][_0x207572[_0x49c4('0x4b')]])){this['startAcw'](_0x207572['transfereeuniqueid']);if(this[_0x49c4('0x9')][_0x207572[_0x49c4('0x4c')]]){this[_0x49c4('0x9')][_0x207572[_0x49c4('0x4c')]][_0x49c4('0x22')]=!![];this[_0x49c4('0x9')][_0x207572[_0x49c4('0x4d')]]=this['channels'][_0x207572[_0x49c4('0x4c')]];delete this[_0x49c4('0x9')][_0x207572['secondtransfereruniqueid']];}}else if(!_[_0x49c4('0x4a')](this['channels'][_0x207572[_0x49c4('0x4d')]])){this[_0x49c4('0x43')](_0x207572[_0x49c4('0x4d')]);if(this[_0x49c4('0x9')][_0x207572[_0x49c4('0x4e')]]){this[_0x49c4('0x9')][_0x207572[_0x49c4('0x4e')]][_0x49c4('0x22')]=!![];this['channels'][_0x207572[_0x49c4('0x4b')]]=this[_0x49c4('0x9')][_0x207572['origtransfereruniqueid']];delete this[_0x49c4('0x9')][_0x207572[_0x49c4('0x4e')]];}}}catch(_0x4fefbd){logger[_0x49c4('0x33')](_0x49c4('0x4f'),_0x4fefbd['message']);}};Acw['prototype']['syncBlindTransfer']=function(_0x513879){try{if(this[_0x49c4('0x9')][_0x513879['transfereruniqueid']]){logger[_0x49c4('0x21')](_0x49c4('0x50'),JSON['stringify'](_0x513879[_0x49c4('0x51')]));this[_0x49c4('0x43')](_0x513879['transfereruniqueid']);}else if(this[_0x49c4('0x9')][_0x513879[_0x49c4('0x52')]]){logger[_0x49c4('0x21')](_0x49c4('0x53'),JSON['stringify'](_0x513879[_0x49c4('0x52')]));this[_0x49c4('0x43')](_0x513879[_0x49c4('0x52')]);}}catch(_0x20e97d){logger['error'](_0x49c4('0x54'),_0x20e97d['message']);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x5d6de0){try{if(this[_0x49c4('0x6')][_0x5d6de0[_0x49c4('0x19')]]&&this[_0x49c4('0x6')][_0x5d6de0[_0x49c4('0x19')]]['autopause']==='all'){if(this[_0x49c4('0x7')][_0x5d6de0[_0x49c4('0x18')]]){logger[_0x49c4('0x21')](_0x49c4('0x55'),_0x5d6de0[_0x49c4('0x2b')],_0x5d6de0[_0x49c4('0x18')],_0x5d6de0[_0x49c4('0x19')]);return RpcUser[_0x49c4('0x24')](this['agents'][_0x5d6de0[_0x49c4('0x18')]],'Auto-Pause',_0x5d6de0[_0x49c4('0x2b')]);}}}catch(_0x264902){logger[_0x49c4('0x33')](_0x49c4('0x56'),_0x264902[_0x49c4('0x35')]);}};module[_0x49c4('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 4fd5d67..5e5d941 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 _0xa6b5=['exports','asterisk-manager','bluebird','util','lodash','../../config/logger','asterisk','port','username','password','keepConnected','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','catch','log','close'];(function(_0x1f5027,_0x10d23c){var _0xcddccd=function(_0x41baab){while(--_0x41baab){_0x1f5027['push'](_0x1f5027['shift']());}};_0xcddccd(++_0x10d23c);}(_0xa6b5,0x187));var _0x5a6b=function(_0x42987b,_0x2e573a){_0x42987b=_0x42987b-0x0;var _0x418a1d=_0xa6b5[_0x42987b];return _0x418a1d;};'use strict';var Manager=require(_0x5a6b('0x0'));var BPromise=require(_0x5a6b('0x1'));var moment=require('moment');var util=require(_0x5a6b('0x2'));var _=require(_0x5a6b('0x3'));var logger=require(_0x5a6b('0x4'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x5a6b('0x5')][_0x5a6b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x5a6b('0x7')],config[_0x5a6b('0x5')][_0x5a6b('0x8')],!![]);ami[_0x5a6b('0x9')]();ami[_0x5a6b('0xa')]=BPromise[_0x5a6b('0xb')](ami['action']);function error(_0x54ec6e){logger[_0x5a6b('0xc')](util[_0x5a6b('0xd')](_0x5a6b('0xe'),config[_0x5a6b('0x5')]['username'],config[_0x5a6b('0x5')]['ip'],config[_0x5a6b('0x5')][_0x5a6b('0x6')],util[_0x5a6b('0xf')](_0x54ec6e,![],null)));}function close(){logger['error'](util['format'](_0x5a6b('0x10'),config[_0x5a6b('0x5')][_0x5a6b('0x7')],config[_0x5a6b('0x5')]['ip'],config[_0x5a6b('0x5')][_0x5a6b('0x6')]));}ami[_0x5a6b('0x11')]=function(){return function(){return ami['Action']({'action':_0x5a6b('0x12')});};};ami[_0x5a6b('0x13')]=function(){return function(){return ami[_0x5a6b('0xa')]({'action':_0x5a6b('0x14')});};};ami[_0x5a6b('0x15')]=function(){return function(){return ami['Action']({'action':_0x5a6b('0x16')});};};ami[_0x5a6b('0x17')]=function(){return function(){return ami[_0x5a6b('0xa')]({'action':_0x5a6b('0x18')});};};ami[_0x5a6b('0x19')]=function(){return function(){return ami[_0x5a6b('0xa')]({'action':_0x5a6b('0x1a')});};};function connect(_0x193bf5){logger[_0x5a6b('0x1b')](util[_0x5a6b('0xd')](_0x5a6b('0x1c'),config['asterisk'][_0x5a6b('0x7')],config[_0x5a6b('0x5')]['ip'],config[_0x5a6b('0x5')][_0x5a6b('0x6')]));ami[_0x5a6b('0x1d')]('error',error);ami[_0x5a6b('0x1d')]('close',close);}ami['on'](_0x5a6b('0x1e'),connect);ami['on'](_0x5a6b('0x1f'),function(_0x5e0733){logger[_0x5a6b('0x1b')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x5a6b('0x5')][_0x5a6b('0x7')],config[_0x5a6b('0x5')]['ip'],config['asterisk'][_0x5a6b('0x6')],util[_0x5a6b('0xf')](_0x5e0733,![],null)));});ami['on'](_0x5a6b('0x20'),function(_0xcd06d7){logger[_0x5a6b('0x1b')](util[_0x5a6b('0xd')](_0x5a6b('0x21'),config[_0x5a6b('0x5')][_0x5a6b('0x7')],config[_0x5a6b('0x5')]['ip'],config[_0x5a6b('0x5')][_0x5a6b('0x6')]));return BPromise['resolve']()[_0x5a6b('0x22')](ami[_0x5a6b('0x11')]())[_0x5a6b('0x22')](ami[_0x5a6b('0x13')]())[_0x5a6b('0x22')](ami[_0x5a6b('0x15')]())[_0x5a6b('0x22')](ami['actionQueueSummary']())[_0x5a6b('0x22')](ami[_0x5a6b('0x19')]())[_0x5a6b('0x23')](function(_0x383051){console[_0x5a6b('0x24')](_0x383051);});});ami[_0x5a6b('0x1d')](_0x5a6b('0xc'),error);ami[_0x5a6b('0x1d')](_0x5a6b('0x25'),close);module[_0x5a6b('0x26')]=ami; \ No newline at end of file +var _0x8459=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionCoreShowChannels','catch','log','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x381526,_0x358cac){var _0x14c940=function(_0xa7606c){while(--_0xa7606c){_0x381526['push'](_0x381526['shift']());}};_0x14c940(++_0x358cac);}(_0x8459,0x17f));var _0x9845=function(_0x32a545,_0x4e0775){_0x32a545=_0x32a545-0x0;var _0x2c8dd6=_0x8459[_0x32a545];return _0x2c8dd6;};'use strict';var Manager=require(_0x9845('0x0'));var BPromise=require(_0x9845('0x1'));var moment=require('moment');var util=require(_0x9845('0x2'));var _=require('lodash');var logger=require(_0x9845('0x3'))(_0x9845('0x4'));var config=require(_0x9845('0x5'));var ami=new Manager(config[_0x9845('0x6')][_0x9845('0x7')],config[_0x9845('0x6')]['ip'],config[_0x9845('0x6')][_0x9845('0x8')],config[_0x9845('0x6')][_0x9845('0x9')],!![]);ami['keepConnected']();ami[_0x9845('0xa')]=BPromise['promisify'](ami[_0x9845('0xb')]);function error(_0x2fdf64){logger['error'](util[_0x9845('0xc')](_0x9845('0xd'),config[_0x9845('0x6')]['username'],config[_0x9845('0x6')]['ip'],config['asterisk']['port'],util[_0x9845('0xe')](_0x2fdf64,![],null)));}function close(){logger[_0x9845('0xf')](util['format'](_0x9845('0x10'),config[_0x9845('0x6')][_0x9845('0x8')],config[_0x9845('0x6')]['ip'],config[_0x9845('0x6')][_0x9845('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0x9845('0x11')});};};ami[_0x9845('0x12')]=function(){return function(){return ami[_0x9845('0xa')]({'action':_0x9845('0x13')});};};ami[_0x9845('0x14')]=function(){return function(){return ami[_0x9845('0xa')]({'action':_0x9845('0x15')});};};ami[_0x9845('0x16')]=function(){return function(){return ami[_0x9845('0xa')]({'action':_0x9845('0x17')});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':_0x9845('0x18')});};};function connect(_0x48a48b){logger[_0x9845('0x19')](util[_0x9845('0xc')](_0x9845('0x1a'),config['asterisk']['username'],config[_0x9845('0x6')]['ip'],config[_0x9845('0x6')]['port']));ami[_0x9845('0x1b')](_0x9845('0xf'),error);ami[_0x9845('0x1b')](_0x9845('0x1c'),close);}ami['on'](_0x9845('0x1d'),connect);ami['on'](_0x9845('0x1e'),function(_0x1d4805){logger['info'](util[_0x9845('0xc')](_0x9845('0x1f'),config['asterisk'][_0x9845('0x8')],config['asterisk']['ip'],config[_0x9845('0x6')][_0x9845('0x7')],util['inspect'](_0x1d4805,![],null)));});ami['on'](_0x9845('0x20'),function(_0x1e14f4){logger[_0x9845('0x19')](util[_0x9845('0xc')](_0x9845('0x21'),config[_0x9845('0x6')]['username'],config['asterisk']['ip'],config[_0x9845('0x6')][_0x9845('0x7')]));return BPromise[_0x9845('0x22')]()[_0x9845('0x23')](ami[_0x9845('0x24')]())[_0x9845('0x23')](ami[_0x9845('0x12')]())[_0x9845('0x23')](ami['actionSipPeerStatus']())[_0x9845('0x23')](ami[_0x9845('0x16')]())[_0x9845('0x23')](ami[_0x9845('0x25')]())[_0x9845('0x26')](function(_0x56721d){console[_0x9845('0x27')](_0x56721d);});});ami['once']('error',error);ami[_0x9845('0x1b')]('close',close);module[_0x9845('0x28')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 3468c74..ad978b2 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 _0x8634=['catch','bluebird','../../config/logger','ami','client','Request','request','debug','rpc','memberReport','error','message'];(function(_0x4c8c04,_0x361478){var _0x398cfe=function(_0x2525a5){while(--_0x2525a5){_0x4c8c04['push'](_0x4c8c04['shift']());}};_0x398cfe(++_0x361478);}(_0x8634,0x169));var _0x4863=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0x8634[_0x5ad771];return _0x5b5dce;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x4863('0x0'));var logger=require(_0x4863('0x1'))(_0x4863('0x2'));var client=jayson[_0x4863('0x3')]['http']({'port':0x2329});client[_0x4863('0x4')]=function(_0x564ca5,_0x44022b){return new BPromise(function(_0x4ff222,_0x8e82a6){return client[_0x4863('0x5')](_0x564ca5,_0x44022b)['then'](function(_0x5ab6a0){logger[_0x4863('0x6')](_0x4863('0x7'),_0x4863('0x8'),_0x564ca5,_0x44022b,_0x5ab6a0);if(_0x5ab6a0[_0x4863('0x9')]){logger[_0x4863('0x9')](_0x4863('0x7'),_0x4863('0x8'),_0x564ca5,_0x5ab6a0[_0x4863('0x9')][_0x4863('0xa')],_0x44022b);return _0x8e82a6(_0x5ab6a0[_0x4863('0x9')]['message']);}else{return _0x4ff222(_0x5ab6a0['result']);}})[_0x4863('0xb')](function(_0x58c44e){logger[_0x4863('0x9')]('rpc',_0x4863('0x8'),_0x564ca5,_0x58c44e,_0x44022b);return _0x8e82a6(_0x58c44e);});});};module['exports']=client; \ No newline at end of file +var _0x9077=['request','then','debug','error','rpc','memberReport','message','result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request'];(function(_0x2dc4cf,_0x50e9ca){var _0x107fc7=function(_0x3caeb5){while(--_0x3caeb5){_0x2dc4cf['push'](_0x2dc4cf['shift']());}};_0x107fc7(++_0x50e9ca);}(_0x9077,0x99));var _0x7907=function(_0x1293bb,_0x4b818d){_0x1293bb=_0x1293bb-0x0;var _0x2a05a5=_0x9077[_0x1293bb];return _0x2a05a5;};'use strict';var jayson=require(_0x7907('0x0'));var BPromise=require(_0x7907('0x1'));var logger=require(_0x7907('0x2'))(_0x7907('0x3'));var client=jayson[_0x7907('0x4')][_0x7907('0x5')]({'port':0x2329});client[_0x7907('0x6')]=function(_0x4b00bb,_0x27c45b){return new BPromise(function(_0x32f05f,_0x214f4f){return client[_0x7907('0x7')](_0x4b00bb,_0x27c45b)[_0x7907('0x8')](function(_0x5e3a3e){logger[_0x7907('0x9')]('rpc','memberReport',_0x4b00bb,_0x27c45b,_0x5e3a3e);if(_0x5e3a3e['error']){logger[_0x7907('0xa')](_0x7907('0xb'),_0x7907('0xc'),_0x4b00bb,_0x5e3a3e[_0x7907('0xa')][_0x7907('0xd')],_0x27c45b);return _0x214f4f(_0x5e3a3e[_0x7907('0xa')][_0x7907('0xd')]);}else{return _0x32f05f(_0x5e3a3e[_0x7907('0xe')]);}})[_0x7907('0xf')](function(_0x5766d8){logger[_0x7907('0xa')](_0x7907('0xb'),_0x7907('0xc'),_0x4b00bb,_0x5766d8,_0x27c45b);return _0x214f4f(_0x5766d8);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index baad690..2efad6a 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 _0x1280=['string','voiceQueue','uniqueid','name','Contact','firstName','number','phone','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','queue','exports','util','lodash','moment','isNil'];(function(_0x309df4,_0x3391db){var _0x4be8fc=function(_0x2261e4){while(--_0x2261e4){_0x309df4['push'](_0x309df4['shift']());}};_0x4be8fc(++_0x3391db);}(_0x1280,0xba));var _0x0128=function(_0x1af8d3,_0x544d86){_0x1af8d3=_0x1af8d3-0x0;var _0x3a50c5=_0x1280[_0x1af8d3];return _0x3a50c5;};'use strict';var util=require(_0x0128('0x0'));var _=require(_0x0128('0x1'));var moment=require(_0x0128('0x2'));function checkNameSurname(_0x869975,_0x259f2a,_0x3dd452){var _0x2334b5='';if(!_[_0x0128('0x3')](_0x259f2a)&&_0x0128('0x4')===typeof _0x259f2a){_0x2334b5+=_0x259f2a;}if(!_['isNil'](_0x3dd452)&&_0x0128('0x4')===typeof _0x3dd452){_0x2334b5+='\x20'+_0x3dd452;}if(_0x2334b5!==''){return _0x2334b5;}return _0x869975;}function Action(_0xcbcf67,_0x59959a,_0x589536){this[_0x0128('0x5')]=_0xcbcf67;this[_0x0128('0x6')]=_0x589536||undefined;this[_0x0128('0x7')]=checkNameSurname(_0x59959a[_0x0128('0x8')]['phone'],_0x59959a['Contact'][_0x0128('0x9')],_0x59959a[_0x0128('0x8')]['lastName']);this[_0x0128('0xa')]=_0x59959a[_0x0128('0x8')][_0x0128('0xb')];this['queue']=_0xcbcf67[_0x0128('0x7')];this[_0x0128('0xc')]=_0x59959a[_0x0128('0xc')]||![];this[_0x0128('0xd')]=_0xcbcf67[_0x0128('0xd')];this[_0x0128('0xe')]=_0xcbcf67[_0x0128('0xe')]||0x3;this[_0x0128('0xf')]=_0x59959a['scheduledat'];this[_0x0128('0x10')]=_0x59959a['countbusyretry'];this['countcongestionretry']=_0x59959a[_0x0128('0x11')];this[_0x0128('0x12')]=_0x59959a[_0x0128('0x12')];this[_0x0128('0x13')]=_0x59959a[_0x0128('0x13')];this['ListId']=_0x59959a[_0x0128('0x14')];this[_0x0128('0x15')]=_0x59959a[_0x0128('0x15')];this['VoiceQueueId']=_0x59959a['VoiceQueueId'];this['CampaignId']=_0x59959a[_0x0128('0x16')];this[_0x0128('0x17')]=_0x59959a['id'];this[_0x0128('0x18')]=_0x59959a[_0x0128('0x8')]['firstName']||'';this['starttime']=moment()[_0x0128('0x19')](_0x0128('0x1a'));this[_0x0128('0x1b')]=_0x59959a[_0x0128('0x1b')];this['callbackuniqueid']=_0x59959a['callbackuniqueid'];this[_0x0128('0x1c')]=_0x59959a[_0x0128('0x1c')];this[_0x0128('0x1d')]=_0x59959a[_0x0128('0x1d')];this[_0x0128('0x1e')]='';this['originatecalleridname']='';}Action[_0x0128('0x1f')][_0x0128('0x20')]=function(){return util[_0x0128('0x19')](_0x0128('0x21'),this[_0x0128('0x7')],this[_0x0128('0x5')][_0x0128('0x22')]>0x0?this[_0x0128('0xa')][_0x0128('0x23')](this['voiceQueue'][_0x0128('0x22')]):this['number']);};Action[_0x0128('0x1f')]['getQueue']=function(){return this[_0x0128('0x24')];};module[_0x0128('0x25')]=Action; \ No newline at end of file +var _0xc4a7=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','queue','exports','util','moment','isNil','string','voiceQueue','name','Contact','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x458140,_0x20964a){var _0x5e4ba1=function(_0x240ca4){while(--_0x240ca4){_0x458140['push'](_0x458140['shift']());}};_0x5e4ba1(++_0x20964a);}(_0xc4a7,0x1ac));var _0x7c4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4a7[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x7c4a('0x0'));var _=require('lodash');var moment=require(_0x7c4a('0x1'));function checkNameSurname(_0x3dc579,_0x4f9a90,_0x3c63c0){var _0x55e224='';if(!_[_0x7c4a('0x2')](_0x4f9a90)&&_0x7c4a('0x3')===typeof _0x4f9a90){_0x55e224+=_0x4f9a90;}if(!_[_0x7c4a('0x2')](_0x3c63c0)&&_0x7c4a('0x3')===typeof _0x3c63c0){_0x55e224+='\x20'+_0x3c63c0;}if(_0x55e224!==''){return _0x55e224;}return _0x3dc579;}function Action(_0x5bff62,_0x4d4f38,_0x11b273){this[_0x7c4a('0x4')]=_0x5bff62;this['uniqueid']=_0x11b273||undefined;this[_0x7c4a('0x5')]=checkNameSurname(_0x4d4f38['Contact']['phone'],_0x4d4f38[_0x7c4a('0x6')]['firstName'],_0x4d4f38['Contact'][_0x7c4a('0x7')]);this[_0x7c4a('0x8')]=_0x4d4f38['Contact']['phone'];this['queue']=_0x5bff62['name'];this[_0x7c4a('0x9')]=_0x4d4f38['active']||![];this[_0x7c4a('0xa')]=_0x5bff62[_0x7c4a('0xa')];this[_0x7c4a('0xb')]=_0x5bff62[_0x7c4a('0xb')]||0x3;this['scheduledat']=_0x4d4f38[_0x7c4a('0xc')];this[_0x7c4a('0xd')]=_0x4d4f38['countbusyretry'];this[_0x7c4a('0xe')]=_0x4d4f38['countcongestionretry'];this[_0x7c4a('0xf')]=_0x4d4f38[_0x7c4a('0xf')];this[_0x7c4a('0x10')]=_0x4d4f38[_0x7c4a('0x10')];this[_0x7c4a('0x11')]=_0x4d4f38[_0x7c4a('0x11')];this['UserId']=_0x4d4f38[_0x7c4a('0x12')];this[_0x7c4a('0x13')]=_0x4d4f38['VoiceQueueId'];this[_0x7c4a('0x14')]=_0x4d4f38[_0x7c4a('0x14')];this[_0x7c4a('0x15')]=_0x4d4f38['id'];this[_0x7c4a('0x16')]=_0x4d4f38[_0x7c4a('0x6')]['firstName']||'';this['starttime']=moment()[_0x7c4a('0x17')](_0x7c4a('0x18'));this[_0x7c4a('0x19')]=_0x4d4f38[_0x7c4a('0x19')];this[_0x7c4a('0x1a')]=_0x4d4f38['callbackuniqueid'];this[_0x7c4a('0x1b')]=_0x4d4f38[_0x7c4a('0x1b')];this[_0x7c4a('0x1c')]=_0x4d4f38[_0x7c4a('0x1c')];this['originatecalleridnum']='';this[_0x7c4a('0x1d')]='';}Action[_0x7c4a('0x1e')][_0x7c4a('0x1f')]=function(){return util[_0x7c4a('0x17')](_0x7c4a('0x20'),this['name'],this[_0x7c4a('0x4')][_0x7c4a('0x21')]>0x0?this[_0x7c4a('0x8')]['substring'](this['voiceQueue'][_0x7c4a('0x21')]):this[_0x7c4a('0x8')]);};Action['prototype'][_0x7c4a('0x22')]=function(){return this[_0x7c4a('0x23')];};module[_0x7c4a('0x24')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 9d1fef8..48a5641 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 _0x082a=['starttime','responsetime','endtime','format','ringtime','answertime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds','statedesc','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','name','calleridnum','number'];(function(_0x4bb01f,_0x1f86cb){var _0x654227=function(_0x24ac47){while(--_0x24ac47){_0x4bb01f['push'](_0x4bb01f['shift']());}};_0x654227(++_0x1f86cb);}(_0x082a,0x1ab));var _0xa082=function(_0x3fa8d6,_0x44c776){_0x3fa8d6=_0x3fa8d6-0x0;var _0x51469d=_0x082a[_0x3fa8d6];return _0x51469d;};'use strict';var util=require('util');var _=require(_0xa082('0x0'));var moment=require(_0xa082('0x1'));function getSeconds(_0x1807bd,_0x4cc9d8){var _0x3876f3=moment(_0x1807bd)['milliseconds'](0x0);var _0x218b57=moment(_0x4cc9d8)[_0xa082('0x2')](0x0);return _0x3876f3[_0xa082('0x3')](_0x218b57,_0xa082('0x4'));}function AgentComplete(_0x197996,_0x2958b8){this['state']=0x4;this[_0xa082('0x5')]='Answer';this[_0xa082('0x6')]=_0x197996[_0xa082('0x6')];this[_0xa082('0x7')]=_0x197996[_0xa082('0x7')];this[_0xa082('0x8')]=_0x197996[_0xa082('0x7')]==='outbound'?'queue':_0x197996[_0xa082('0x7')];this[_0xa082('0x9')]=_0x197996[_0xa082('0x9')];this[_0xa082('0xa')]=_0x197996['countcongestionretry'];this[_0xa082('0xb')]=_0x197996[_0xa082('0xb')];this[_0xa082('0xc')]=_0x197996['countbusyretry']+_0x197996[_0xa082('0xa')]+_0x197996[_0xa082('0xb')];this['uniqueid']=_0x2958b8[_0xa082('0xd')];this['calleridname']=_0x197996[_0xa082('0xe')];this[_0xa082('0xf')]=_0x197996[_0xa082('0x10')];this['starttime']=_0x197996[_0xa082('0x11')];this[_0xa082('0x12')]=_0x197996[_0xa082('0x12')];this['answertime']=_0x197996['answertime'];this[_0xa082('0x13')]=moment()[_0xa082('0x14')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa082('0x15')]=getSeconds(_0x197996[_0xa082('0x12')],_0x197996[_0xa082('0x11')]);this['holdtime']=getSeconds(_0x197996[_0xa082('0x16')],_0x197996[_0xa082('0x12')]);this[_0xa082('0x17')]=getSeconds(this[_0xa082('0x13')],_0x197996[_0xa082('0x16')]);this[_0xa082('0x18')]=_0x2958b8[_0xa082('0x18')];this[_0xa082('0x19')]=_0x2958b8[_0xa082('0x19')];this[_0xa082('0x1a')]=_0x2958b8[_0xa082('0x1a')];this[_0xa082('0x1b')]=_0x197996['callback'];this[_0xa082('0x1c')]=_0x197996[_0xa082('0x1c')];this['callbackat']=_0x197996[_0xa082('0x1d')];this[_0xa082('0x1e')]=_0x197996['recallme'];this['ContactId']=_0x197996['ContactId'];this['ListId']=_0x197996[_0xa082('0x1f')];this['UserId']=_0x197996[_0xa082('0x20')];this[_0xa082('0x21')]=_0x197996[_0xa082('0x21')];this[_0xa082('0x22')]=_0x197996[_0xa082('0x22')];this[_0xa082('0x23')]=_0x197996[_0xa082('0x23')]||'';this[_0xa082('0x24')]=_0x197996['originatecalleridname']||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x1367=['callback','callbackuniqueid','callbackat','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason'];(function(_0x3e182f,_0x380ec7){var _0x23edc9=function(_0x3ca65e){while(--_0x3ca65e){_0x3e182f['push'](_0x3e182f['shift']());}};_0x23edc9(++_0x380ec7);}(_0x1367,0x1d2));var _0x7136=function(_0x2af160,_0x765b1){_0x2af160=_0x2af160-0x0;var _0x439d67=_0x1367[_0x2af160];return _0x439d67;};'use strict';var util=require(_0x7136('0x0'));var _=require(_0x7136('0x1'));var moment=require(_0x7136('0x2'));function getSeconds(_0x41119f,_0x135c16){var _0x8cafef=moment(_0x41119f)[_0x7136('0x3')](0x0);var _0x33f677=moment(_0x135c16)['milliseconds'](0x0);return _0x8cafef[_0x7136('0x4')](_0x33f677,_0x7136('0x5'));}function AgentComplete(_0xe6f2c3,_0x2d1764){this[_0x7136('0x6')]=0x4;this['statedesc']=_0x7136('0x7');this['scheduledat']=_0xe6f2c3[_0x7136('0x8')];this[_0x7136('0x9')]=_0xe6f2c3[_0x7136('0x9')];this[_0x7136('0xa')]=_0xe6f2c3[_0x7136('0x9')]===_0x7136('0xb')?_0x7136('0xc'):_0xe6f2c3[_0x7136('0x9')];this[_0x7136('0xd')]=_0xe6f2c3[_0x7136('0xd')];this[_0x7136('0xe')]=_0xe6f2c3[_0x7136('0xe')];this[_0x7136('0xf')]=_0xe6f2c3[_0x7136('0xf')];this['countglobal']=_0xe6f2c3[_0x7136('0xd')]+_0xe6f2c3['countcongestionretry']+_0xe6f2c3['countnoanswerretry'];this[_0x7136('0x10')]=_0x2d1764['uniqueid'];this[_0x7136('0x11')]=_0xe6f2c3['name'];this['calleridnum']=_0xe6f2c3[_0x7136('0x12')];this['starttime']=_0xe6f2c3[_0x7136('0x13')];this[_0x7136('0x14')]=_0xe6f2c3['responsetime'];this[_0x7136('0x15')]=_0xe6f2c3[_0x7136('0x15')];this['endtime']=moment()[_0x7136('0x16')](_0x7136('0x17'));this[_0x7136('0x18')]=getSeconds(_0xe6f2c3['responsetime'],_0xe6f2c3[_0x7136('0x13')]);this[_0x7136('0x19')]=getSeconds(_0xe6f2c3[_0x7136('0x15')],_0xe6f2c3[_0x7136('0x14')]);this['talktime']=getSeconds(this['endtime'],_0xe6f2c3['answertime']);this['queue']=_0x2d1764['queue'];this['membername']=_0x2d1764[_0x7136('0x1a')];this[_0x7136('0x1b')]=_0x2d1764[_0x7136('0x1b')];this[_0x7136('0x1c')]=_0xe6f2c3[_0x7136('0x1c')];this[_0x7136('0x1d')]=_0xe6f2c3['callbackuniqueid'];this[_0x7136('0x1e')]=_0xe6f2c3['callbackat'];this['recallme']=_0xe6f2c3['recallme'];this[_0x7136('0x1f')]=_0xe6f2c3['ContactId'];this['ListId']=_0xe6f2c3['ListId'];this[_0x7136('0x20')]=_0xe6f2c3['UserId'];this[_0x7136('0x21')]=_0xe6f2c3[_0x7136('0x21')];this[_0x7136('0x22')]=_0xe6f2c3[_0x7136('0x22')];this[_0x7136('0x23')]=_0xe6f2c3[_0x7136('0x23')]||'';this[_0x7136('0x24')]=_0xe6f2c3[_0x7136('0x24')]||'';}module[_0x7136('0x25')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 2636352..cd81863 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 _0x225b=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime'];(function(_0x571772,_0x238a92){var _0x12f9f0=function(_0x5a44b5){while(--_0x5a44b5){_0x571772['push'](_0x571772['shift']());}};_0x12f9f0(++_0x238a92);}(_0x225b,0xb1));var _0xb225=function(_0x1ed1b0,_0x190b4c){_0x1ed1b0=_0x1ed1b0-0x0;var _0x1c1ad4=_0x225b[_0x1ed1b0];return _0x1c1ad4;};'use strict';var util=require(_0xb225('0x0'));var _=require(_0xb225('0x1'));var moment=require('moment');function getSeconds(_0x33f65f,_0x23b63e){var _0x47c446=moment(_0x33f65f)[_0xb225('0x2')](0x0);var _0x5aa828=moment(_0x23b63e)[_0xb225('0x2')](0x0);return _0x47c446['diff'](_0x5aa828,_0xb225('0x3'));}function Final(_0x8ea194){this[_0xb225('0x4')]=_0x8ea194[_0xb225('0x4')];this[_0xb225('0x5')]=_0x8ea194[_0xb225('0x5')];this[_0xb225('0x6')]=_0x8ea194['type'];this[_0xb225('0x7')]=_0x8ea194[_0xb225('0x6')]===_0xb225('0x8')?_0xb225('0x9'):_0x8ea194['type'];this[_0xb225('0xa')]=_0x8ea194[_0xb225('0xa')];this[_0xb225('0xb')]=_0x8ea194['countcongestionretry'];this[_0xb225('0xc')]=_0x8ea194[_0xb225('0xc')];this[_0xb225('0xd')]=_0x8ea194[_0xb225('0xa')]+_0x8ea194[_0xb225('0xb')]+_0x8ea194['countnoanswerretry'];this[_0xb225('0x9')]=_0x8ea194[_0xb225('0x9')];this[_0xb225('0xe')]=_0x8ea194[_0xb225('0xe')];this[_0xb225('0xf')]=_0x8ea194['calleridnum'];this['starttime']=_0x8ea194[_0xb225('0x10')];this[_0xb225('0x11')]=_0x8ea194[_0xb225('0x11')];this[_0xb225('0x12')]=_0x8ea194[_0xb225('0x11')];this[_0xb225('0x13')]=_0x8ea194[_0xb225('0x13')]||0x0;this[_0xb225('0x14')]=_0x8ea194[_0xb225('0x14')]||0x0;this[_0xb225('0x15')]=_0x8ea194[_0xb225('0x15')]||0x0;this[_0xb225('0x16')]=_0x8ea194['callback'];this[_0xb225('0x17')]=_0x8ea194[_0xb225('0x17')];this[_0xb225('0x18')]=_0x8ea194[_0xb225('0x18')];this[_0xb225('0x19')]=_0x8ea194[_0xb225('0x19')];this[_0xb225('0x1a')]=_0x8ea194[_0xb225('0x1a')];this[_0xb225('0x1b')]=_0x8ea194['ListId'];this['UserId']=_0x8ea194[_0xb225('0x1c')];this[_0xb225('0x1d')]=_0x8ea194[_0xb225('0x1d')];this['CampaignId']=_0x8ea194['CampaignId'];this[_0xb225('0x1e')]=_0x8ea194[_0xb225('0x1e')]||'';this[_0xb225('0x1f')]=_0x8ea194[_0xb225('0x1f')]||'';}module[_0xb225('0x20')]=Final; \ No newline at end of file +var _0x2542=['moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash'];(function(_0x9e552d,_0x2325a5){var _0x1cab2a=function(_0x5e8e7a){while(--_0x5e8e7a){_0x9e552d['push'](_0x9e552d['shift']());}};_0x1cab2a(++_0x2325a5);}(_0x2542,0x169));var _0x2254=function(_0x278bcb,_0x2c5b76){_0x278bcb=_0x278bcb-0x0;var _0x4f067f=_0x2542[_0x278bcb];return _0x4f067f;};'use strict';var util=require(_0x2254('0x0'));var _=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));function getSeconds(_0x20dfee,_0x578407){var _0x105910=moment(_0x20dfee)['milliseconds'](0x0);var _0x4059d1=moment(_0x578407)[_0x2254('0x3')](0x0);return _0x105910[_0x2254('0x4')](_0x4059d1,_0x2254('0x5'));}function Final(_0x76c902){this['uniqueid']=_0x76c902[_0x2254('0x6')];this[_0x2254('0x7')]=_0x76c902[_0x2254('0x7')];this[_0x2254('0x8')]=_0x76c902[_0x2254('0x8')];this[_0x2254('0x9')]=_0x76c902[_0x2254('0x8')]===_0x2254('0xa')?_0x2254('0xb'):_0x76c902[_0x2254('0x8')];this[_0x2254('0xc')]=_0x76c902['countbusyretry'];this[_0x2254('0xd')]=_0x76c902[_0x2254('0xd')];this[_0x2254('0xe')]=_0x76c902[_0x2254('0xe')];this['countglobal']=_0x76c902['countbusyretry']+_0x76c902[_0x2254('0xd')]+_0x76c902[_0x2254('0xe')];this[_0x2254('0xb')]=_0x76c902[_0x2254('0xb')];this[_0x2254('0xf')]=_0x76c902[_0x2254('0xf')];this['calleridnum']=_0x76c902[_0x2254('0x10')];this[_0x2254('0x11')]=_0x76c902['starttime'];this[_0x2254('0x12')]=_0x76c902[_0x2254('0x12')];this[_0x2254('0x13')]=_0x76c902[_0x2254('0x12')];this[_0x2254('0x14')]=_0x76c902[_0x2254('0x14')]||0x0;this['holdtime']=_0x76c902[_0x2254('0x15')]||0x0;this['talktime']=_0x76c902[_0x2254('0x16')]||0x0;this[_0x2254('0x17')]=_0x76c902[_0x2254('0x17')];this[_0x2254('0x18')]=_0x76c902[_0x2254('0x18')];this[_0x2254('0x19')]=_0x76c902['callbackat'];this['recallme']=_0x76c902['recallme'];this[_0x2254('0x1a')]=_0x76c902[_0x2254('0x1a')];this[_0x2254('0x1b')]=_0x76c902[_0x2254('0x1b')];this[_0x2254('0x1c')]=_0x76c902[_0x2254('0x1c')];this['VoiceQueueId']=_0x76c902[_0x2254('0x1d')];this[_0x2254('0x1e')]=_0x76c902[_0x2254('0x1e')];this['originatecalleridnum']=_0x76c902['originatecalleridnum']||'';this['originatecalleridname']=_0x76c902[_0x2254('0x1f')]||'';}module[_0x2254('0x20')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 3616243..e3d0a6d 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x6317d6,_0x424384){var _0x5add4d=function(_0x176118){while(--_0x176118){_0x6317d6['push'](_0x6317d6['shift']());}};_0x5add4d(++_0x424384);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file +var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x55a89d,_0x584ea7){var _0x1b0e5a=function(_0x2f9b88){while(--_0x2f9b88){_0x55a89d['push'](_0x55a89d['shift']());}};_0x1b0e5a(++_0x584ea7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index bce254e..0435f15 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 _0xbf24=['countglobal','name','calleridnum','number','starttime','responsetime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x36fceb,_0x4690b5){var _0x2f575c=function(_0x263d59){while(--_0x263d59){_0x36fceb['push'](_0x36fceb['shift']());}};_0x2f575c(++_0x4690b5);}(_0xbf24,0x102));var _0x4bf2=function(_0x78bd8e,_0x4ac14c){_0x78bd8e=_0x78bd8e-0x0;var _0x1f307d=_0xbf24[_0x78bd8e];return _0x1f307d;};'use strict';var util=require(_0x4bf2('0x0'));var _=require(_0x4bf2('0x1'));var moment=require(_0x4bf2('0x2'));function getSeconds(_0x5db3ba,_0x36a990){var _0x650af1=moment(_0x5db3ba)[_0x4bf2('0x3')](0x0);var _0x3ffcfe=moment(_0x36a990)[_0x4bf2('0x3')](0x0);return _0x650af1['diff'](_0x3ffcfe,_0x4bf2('0x4'));}function History(_0x2cfa75){this[_0x4bf2('0x5')]=_0x2cfa75[_0x4bf2('0x5')];this[_0x4bf2('0x6')]=_0x2cfa75[_0x4bf2('0x6')]||undefined;this['type']=_0x2cfa75[_0x4bf2('0x7')];this['campaigntype']=_0x2cfa75[_0x4bf2('0x7')]==='outbound'?_0x4bf2('0x8'):_0x2cfa75['type'];this['countbusyretry']=_0x2cfa75[_0x4bf2('0x9')];this[_0x4bf2('0xa')]=_0x2cfa75[_0x4bf2('0xa')];this[_0x4bf2('0xb')]=_0x2cfa75['countnoanswerretry'];this[_0x4bf2('0xc')]=_0x2cfa75['countbusyretry']+_0x2cfa75[_0x4bf2('0xa')]+_0x2cfa75[_0x4bf2('0xb')];this[_0x4bf2('0x8')]=_0x2cfa75[_0x4bf2('0x8')];this['calleridname']=_0x2cfa75[_0x4bf2('0xd')];this[_0x4bf2('0xe')]=_0x2cfa75[_0x4bf2('0xf')];this[_0x4bf2('0x10')]=_0x2cfa75['starttime'];this[_0x4bf2('0x11')]=_0x2cfa75[_0x4bf2('0x11')];this['endtime']=_0x2cfa75[_0x4bf2('0x11')];this['ringtime']=getSeconds(_0x2cfa75[_0x4bf2('0x11')],_0x2cfa75['starttime']);this['holdtime']=0x0;this['talktime']=0x0;this[_0x4bf2('0x12')]=_0x2cfa75[_0x4bf2('0x12')];this['callbackuniqueid']=_0x2cfa75[_0x4bf2('0x13')];this[_0x4bf2('0x14')]=_0x2cfa75[_0x4bf2('0x14')];this[_0x4bf2('0x15')]=_0x2cfa75[_0x4bf2('0x15')];this['ContactId']=_0x2cfa75[_0x4bf2('0x16')];this[_0x4bf2('0x17')]=_0x2cfa75[_0x4bf2('0x17')];this[_0x4bf2('0x18')]=_0x2cfa75[_0x4bf2('0x18')];this[_0x4bf2('0x19')]=_0x2cfa75['VoiceQueueId'];this[_0x4bf2('0x1a')]=_0x2cfa75[_0x4bf2('0x1a')];this['originatecalleridnum']=_0x2cfa75[_0x4bf2('0x1b')]||'';this[_0x4bf2('0x1c')]=_0x2cfa75[_0x4bf2('0x1c')]||'';}module[_0x4bf2('0x1d')]=History; \ No newline at end of file +var _0x0f84=['milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash'];(function(_0x12254f,_0x100cfe){var _0x3a4fa2=function(_0x1ce891){while(--_0x1ce891){_0x12254f['push'](_0x12254f['shift']());}};_0x3a4fa2(++_0x100cfe);}(_0x0f84,0x10e));var _0x40f8=function(_0x16d78e,_0x537ebb){_0x16d78e=_0x16d78e-0x0;var _0x1e7395=_0x0f84[_0x16d78e];return _0x1e7395;};'use strict';var util=require(_0x40f8('0x0'));var _=require(_0x40f8('0x1'));var moment=require('moment');function getSeconds(_0x2e55d9,_0x32f2bd){var _0x39cc06=moment(_0x2e55d9)[_0x40f8('0x2')](0x0);var _0x24bacf=moment(_0x32f2bd)[_0x40f8('0x2')](0x0);return _0x39cc06[_0x40f8('0x3')](_0x24bacf,_0x40f8('0x4'));}function History(_0x16cb1a){this[_0x40f8('0x5')]=_0x16cb1a[_0x40f8('0x5')];this[_0x40f8('0x6')]=_0x16cb1a[_0x40f8('0x6')]||undefined;this[_0x40f8('0x7')]=_0x16cb1a[_0x40f8('0x7')];this[_0x40f8('0x8')]=_0x16cb1a[_0x40f8('0x7')]===_0x40f8('0x9')?_0x40f8('0xa'):_0x16cb1a[_0x40f8('0x7')];this['countbusyretry']=_0x16cb1a[_0x40f8('0xb')];this['countcongestionretry']=_0x16cb1a['countcongestionretry'];this[_0x40f8('0xc')]=_0x16cb1a[_0x40f8('0xc')];this[_0x40f8('0xd')]=_0x16cb1a[_0x40f8('0xb')]+_0x16cb1a[_0x40f8('0xe')]+_0x16cb1a[_0x40f8('0xc')];this[_0x40f8('0xa')]=_0x16cb1a[_0x40f8('0xa')];this['calleridname']=_0x16cb1a['name'];this['calleridnum']=_0x16cb1a[_0x40f8('0xf')];this[_0x40f8('0x10')]=_0x16cb1a[_0x40f8('0x10')];this[_0x40f8('0x11')]=_0x16cb1a['responsetime'];this[_0x40f8('0x12')]=_0x16cb1a[_0x40f8('0x11')];this[_0x40f8('0x13')]=getSeconds(_0x16cb1a['responsetime'],_0x16cb1a[_0x40f8('0x10')]);this[_0x40f8('0x14')]=0x0;this[_0x40f8('0x15')]=0x0;this[_0x40f8('0x16')]=_0x16cb1a[_0x40f8('0x16')];this[_0x40f8('0x17')]=_0x16cb1a['callbackuniqueid'];this[_0x40f8('0x18')]=_0x16cb1a[_0x40f8('0x18')];this[_0x40f8('0x19')]=_0x16cb1a[_0x40f8('0x19')];this[_0x40f8('0x1a')]=_0x16cb1a[_0x40f8('0x1a')];this['ListId']=_0x16cb1a[_0x40f8('0x1b')];this['UserId']=_0x16cb1a[_0x40f8('0x1c')];this[_0x40f8('0x1d')]=_0x16cb1a[_0x40f8('0x1d')];this[_0x40f8('0x1e')]=_0x16cb1a[_0x40f8('0x1e')];this[_0x40f8('0x1f')]=_0x16cb1a[_0x40f8('0x1f')]||'';this[_0x40f8('0x20')]=_0x16cb1a[_0x40f8('0x20')]||'';}module[_0x40f8('0x21')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index a622bbd..81ccfff 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 _0x6c57=['Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\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','milliseconds','seconds','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','waiting','sendMessageOneNotActive','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','statedesc','endtime','starttime','[uniqueid]','clearZombieChannels','[actions]','hasOwnProperty','sequence','Action','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','then','checkIsBlackList','resolve','catch','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','merge','pick','ContactId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','reachable','SIP/%s','status','unmonitored','saveInDb','moveContactManagedDialer','isNil','variable','exten','dialAMDActive','HANGUP','uniqueid','outboundAnswerCallsDay','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','value','MACHINE','Machine','amd','[syncMachine][createHistory]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','Unknow','reason','agent','agiafterat','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','syncNewExten','actionid','strategy','locked','paused','stateinterface','rrmemory','idHopper','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','finally','[booked][RR][finaly]','[booked][unlock]','ListId','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','command','interval','content','indexOf','true','iftime\x20%s,%s','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','method\x20not\x20recognized','launchHandleIvr','dialTimezone','dialGlobalInterval','[syncCampaigns]','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialPrefix','trim','dialCutDigit','substring','xcally-motion-dialer','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','dialGlobalMaxRetry','stateGlobal','createStateFinal','reason\x200\x20no\x20such\x20number....','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','[syncAgentComplete][createHistory][?]','Global','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','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\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','loggedIn','floor','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','queueStatusComplete','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','voicePause','log','Contact\x20updated','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','limitCalls','temp','maxNumberOriginate','RUNNING','ivrTotalCallsDays','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[countReScheduled]\x20','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','dialer','../../../config/logger','booked','predictive','syncQueueSummary','redis','defaults','localhost','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','preview','voiceQueues','campaigns','agents','trunks','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','AGENTS_NOT_LOGGED','message','NOT_ACTIVE','name','\x20NOT\x20Active','\x20INTERVAL_IS_NULL','Interval','Intervals','INTERVAL_IS_NULL','Error','stringify','diff','type','outbound','answered','sumBillable','sumHoldTime','talking','total','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','format','voice:queue:%s','voice_queue:save','ivr','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'];(function(_0x5efe32,_0x3df16d){var _0x2a5852=function(_0x5acd59){while(--_0x5acd59){_0x5efe32['push'](_0x5efe32['shift']());}};_0x2a5852(++_0x3df16d);}(_0x6c57,0x18a));var _0x76c5=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x6c57[_0x513047];return _0x15b779;};'use strict';var util=require(_0x76c5('0x0'));var _=require(_0x76c5('0x1'));var BPromise=require(_0x76c5('0x2'));var uuid=require(_0x76c5('0x3'));var moment=require(_0x76c5('0x4'));var rr=require('rr');var md5=require(_0x76c5('0x5'));var Redis=require('ioredis');var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0x76c5('0x6'));var loggerBooked=require(_0x76c5('0x7'))(_0x76c5('0x8'));var loggerPredictive=require(_0x76c5('0x7'))(_0x76c5('0x9'));var loggerPredictiveCalls=require(_0x76c5('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x76c5('0x7'))(_0x76c5('0xa'));var ami=require('../ami');config[_0x76c5('0xb')]=_[_0x76c5('0xc')](config[_0x76c5('0xb')],{'host':_0x76c5('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x76c5('0xe'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x76c5('0xf'));var voiceQueueRt=require(_0x76c5('0x10'));var Action=require(_0x76c5('0x11'));var History=require(_0x76c5('0x12'));var Final=require('./final');var AgentComplete=require(_0x76c5('0x13'));var QueueCallerAbandon=require(_0x76c5('0x14'));var Hangup=require(_0x76c5('0x15'));var ipAgi=process[_0x76c5('0x16')][_0x76c5('0x17')]||_0x76c5('0x18');var strategy={'rrmemory':'rrmemory','roundrobin':_0x76c5('0x19')};var Sequence=function(){};Sequence[_0x76c5('0x1a')][_0x76c5('0x1b')]=function(_0x31d870){this[_0x76c5('0x1c')]=this['tail']?this[_0x76c5('0x1c')]['finally'](_0x31d870):_0x31d870();};function Dialer(_0x4b5c9d,_0x25285c){this['sequence']=new Sequence();this[_0x76c5('0x1d')]=_0x25285c;this[_0x76c5('0x1e')]=_0x4b5c9d[_0x76c5('0x1e')];this[_0x76c5('0x1f')]=_0x4b5c9d['campaigns'];this[_0x76c5('0x20')]=_0x4b5c9d[_0x76c5('0x20')];this[_0x76c5('0x21')]=_0x4b5c9d[_0x76c5('0x21')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x76c5('0x22')]={};this[_0x76c5('0x23')]={};this[_0x76c5('0x24')]={};this[_0x76c5('0x25')]={};this[_0x76c5('0x26')]={};this[_0x76c5('0x27')]={};this[_0x76c5('0x28')]={};this[_0x76c5('0x29')]={};this[_0x76c5('0x2a')]={};ami['on'](_0x76c5('0x2b'),this['syncAgentConnect'][_0x76c5('0x2c')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x76c5('0x2c')](this));ami['on'](_0x76c5('0x2d'),this[_0x76c5('0x2e')][_0x76c5('0x2c')](this));ami['on'](_0x76c5('0x2f'),this[_0x76c5('0x30')][_0x76c5('0x2c')](this));ami['on']('custom:queuesummary',this[_0x76c5('0xa')][_0x76c5('0x2c')](this));ami['on'](_0x76c5('0x31'),this[_0x76c5('0x32')]['bind'](this));ami['on'](_0x76c5('0x33'),this['syncNewExten'][_0x76c5('0x2c')](this));ami['on'](_0x76c5('0x34'),this[_0x76c5('0x35')][_0x76c5('0x2c')](this));ami['on'](_0x76c5('0x36'),this[_0x76c5('0x37')][_0x76c5('0x2c')](this));ami['on'](_0x76c5('0x38'),this[_0x76c5('0x39')]['bind'](this));this[_0x76c5('0x3a')]();this[_0x76c5('0x3b')]();}function isNotNull(_0x4ea3aa){return _0x4ea3aa!==null&&!_[_0x76c5('0x3c')](_0x4ea3aa);}function checkIsLoggedIn(_0x58b822,_0x32d710){return function(){if(_0x32d710<=0x0){_0x58b822['message']=_0x76c5('0x3d');throw _0x58b822['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x35b6bd){return _0x35b6bd;}function checkIsActive(_0x1308be,_0x279171){return function(){if(!isActive(_0x279171)){_0x1308be[_0x76c5('0x3e')]=_0x76c5('0x3f');throw _0x1308be[_0x76c5('0x40')]+_0x76c5('0x41');}};}function checkInterval(_0x26e7ef){return function(){if(!isNotNull(_0x26e7ef['Interval'])){_0x26e7ef[_0x76c5('0x3e')]='INTERVAL_IS_NULL';throw _0x26e7ef[_0x76c5('0x40')]+_0x76c5('0x42');}if(!isNotNull(_0x26e7ef[_0x76c5('0x43')][_0x76c5('0x44')])){_0x26e7ef[_0x76c5('0x3e')]=_0x76c5('0x45');throw _0x26e7ef[_0x76c5('0x40')]+_0x76c5('0x42');}if(!isNotNull(_['isEmpty'](_0x26e7ef[_0x76c5('0x43')]['Intervals']))){_0x26e7ef[_0x76c5('0x3e')]=_0x76c5('0x45');throw _0x26e7ef['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x395209,_0x114063,_0x2879ee){return{'action':_0x395209,'response':_0x114063,'message':_0x2879ee,'stack':_0x2879ee};}function myreject(_0x2dca80){return function(_0x469690){return _0x2dca80(msgResponse('[ifTime][Action]',_0x76c5('0x46'),JSON[_0x76c5('0x47')](_0x469690)));};}function getSeconds(_0x1e1673,_0x8796d4){var _0xa8a322=moment(_0x1e1673)['milliseconds'](0x0);var _0xcc0741=moment(_0x8796d4)['milliseconds'](0x0);return _0xa8a322[_0x76c5('0x48')](_0xcc0741,'seconds');}function emit(_0x3d9db3,_0xbcb0cc,_0x1d6782){io['to'](_0x3d9db3)['emit'](_0xbcb0cc,_0x1d6782);}function emitVoiceQueueSummary(_0x356e6e){if(_0x356e6e[_0x76c5('0x49')]===_0x76c5('0x4a')){var _0x3b84a8={'id':_0x356e6e['id'],'name':_0x356e6e[_0x76c5('0x40')],'strategy':_0x356e6e['strategy'],'answered':_0x356e6e[_0x76c5('0x4b')],'available':_0x356e6e['available'],'loggedIn':_0x356e6e['loggedIn'],'pTalking':_0x356e6e['pTalking'],'sumBillable':_0x356e6e[_0x76c5('0x4c')],'sumDuration':_0x356e6e['sumDuration'],'sumHoldTime':_0x356e6e[_0x76c5('0x4d')]||0x0,'talking':_0x356e6e[_0x76c5('0x4e')],'total':_0x356e6e[_0x76c5('0x4f')],'type':_0x356e6e[_0x76c5('0x49')],'unmanaged':_0x356e6e['unmanaged'],'abandoned':_0x356e6e[_0x76c5('0x50')],'waiting':_0x356e6e['waiting'],'loggedInDb':_0x356e6e[_0x76c5('0x51')],'dialActive':_0x356e6e[_0x76c5('0x52')],'dialMethod':_0x356e6e[_0x76c5('0x53')],'dialOriginateCallerIdName':_0x356e6e[_0x76c5('0x54')],'dialOriginateCallerIdNumber':_0x356e6e['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x356e6e[_0x76c5('0x55')],'dialPrefix':_0x356e6e['dialPrefix'],'outboundAnswerAgiCallsDay':_0x356e6e[_0x76c5('0x56')],'outboundAnswerCallsDay':_0x356e6e['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x356e6e[_0x76c5('0x57')],'outboundBusyCallsDay':_0x356e6e[_0x76c5('0x58')],'outboundCongestionCallsDay':_0x356e6e[_0x76c5('0x59')],'outboundDropCallsDayACS':_0x356e6e[_0x76c5('0x5a')],'outboundDropCallsDayCallersExit':_0x356e6e['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x356e6e['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x356e6e[_0x76c5('0x5b')],'outboundNoSuchCallsDay':_0x356e6e[_0x76c5('0x5c')],'outboundOriginateFailureCallsDay':_0x356e6e[_0x76c5('0x5d')],'outboundReCallsDay':_0x356e6e['outboundReCallsDay'],'outboundRejectCallsDay':_0x356e6e[_0x76c5('0x5e')],'outboundUnknownCallsDay':_0x356e6e[_0x76c5('0x5f')],'predictiveIntervalAnsweredCalls':_0x356e6e[_0x76c5('0x60')],'predictiveIntervalAvgHoldtime':_0x356e6e[_0x76c5('0x61')],'predictiveIntervalAvgTalktime':_0x356e6e['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x356e6e['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x356e6e[_0x76c5('0x62')],'predictiveIntervalErlangCalls':_0x356e6e[_0x76c5('0x63')],'predictiveIntervalErlangCallsDroppedCalls':_0x356e6e[_0x76c5('0x64')],'predictiveIntervalHitRate':_0x356e6e[_0x76c5('0x65')],'predictiveIntervalMultiplicativeFactor':_0x356e6e[_0x76c5('0x66')],'predictiveIntervalPauses':_0x356e6e[_0x76c5('0x67')],'predictiveIntervalAvailable':_0x356e6e[_0x76c5('0x68')],'predictiveIntervalTotalCalls':_0x356e6e[_0x76c5('0x69')],'message':_0x356e6e['message'],'originated':_0x356e6e[_0x76c5('0x6a')],'erlangCalls':_0x356e6e[_0x76c5('0x6b')],'erlangCallToSecond':_0x356e6e[_0x76c5('0x6c')],'erlangAbandonmentRate':_0x356e6e['erlangAbandonmentRate'],'erlangBusyFactor':_0x356e6e[_0x76c5('0x6d')],'startPredictive':_0x356e6e['startPredictive'],'startProgressive':_0x356e6e['startProgressive']};if(_0x356e6e[_0x76c5('0x6e')]){_0x3b84a8[_0x76c5('0x6e')]={'id':_0x356e6e['Trunk']['id'],'name':_0x356e6e['Trunk'][_0x76c5('0x40')],'active':_0x356e6e[_0x76c5('0x6e')][_0x76c5('0x6f')],'callerid':_0x356e6e['Trunk']['callerid']};}if(_0x356e6e['Interval']){_0x3b84a8['Interval']={'id':_0x356e6e[_0x76c5('0x43')]['id'],'name':_0x356e6e[_0x76c5('0x43')]['name']};}var _0x47456e=md5(JSON[_0x76c5('0x47')](_0x3b84a8));if(_0x356e6e[_0x76c5('0x5')]!==_0x47456e){_0x356e6e['md5']=_0x47456e;emit(util[_0x76c5('0x70')](_0x76c5('0x71'),_0x3b84a8[_0x76c5('0x40')]),_0x76c5('0x72'),_0x3b84a8);}}}function emitCampaignSummary(_0x450c88){if(_0x450c88['type']===_0x76c5('0x73')){emit(util[_0x76c5('0x70')]('campaign:ivr:%s',_0x450c88[_0x76c5('0x40')]),_0x76c5('0x74'),_0x450c88);}}function checkGetDataPredictive(_0x56935a){if(isNotNull(_0x56935a)){if(!_[_0x76c5('0x75')](_0x56935a)){loggerPredictive[_0x76c5('0x76')](_0x76c5('0x77'));loggerPredictive[_0x76c5('0x76')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x56935a[_0x76c5('0x69')]);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x78'),_0x56935a['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x79'),_0x56935a['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x7a'),_0x56935a[_0x76c5('0x7b')]);loggerPredictive['info'](_0x76c5('0x7c'),_0x56935a[_0x76c5('0x61')]);loggerPredictive['info'](_0x76c5('0x7d'),_0x56935a[_0x76c5('0x7e')]);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x7f'));if(_0x56935a[_0x76c5('0x69')]>0x0){if(!_['isUndefined'](_0x56935a[_0x76c5('0x7e')])&&_0x56935a[_0x76c5('0x7e')]>0x0){return!![];}else{loggerPredictive[_0x76c5('0x76')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_['isUndefined'](_0x56935a[_0x76c5('0x61')])&&_0x56935a[_0x76c5('0x61')]>0x0){return!![];}else{loggerPredictive[_0x76c5('0x76')](_0x76c5('0x80'));}}else{loggerPredictive[_0x76c5('0x76')](_0x76c5('0x81'));}}else{loggerPredictive['info'](_0x76c5('0x82'));}}else{loggerPredictive[_0x76c5('0x76')](_0x76c5('0x82'));}return![];}function mergeDataErlangB(_0x3461a8){return function(_0x3056a8){loggerPredictive[_0x76c5('0x76')](_0x76c5('0x83'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3056a8['erlangCalls']);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x84'),_0x3056a8[_0x76c5('0x6c')]);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x85'),_0x3056a8[_0x76c5('0x86')]);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x87'),_0x3056a8[_0x76c5('0x6d')]);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x85'),_0x3056a8[_0x76c5('0x86')]);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x7f'));_['merge'](_0x3461a8,_0x3056a8);};}function getDiff(_0x14e548){var _0x2ba6af=moment()[_0x76c5('0x88')](0x0);var _0x23b9f9=moment(_0x14e548)[_0x76c5('0x88')](0x0);return _0x2ba6af[_0x76c5('0x48')](_0x23b9f9,_0x76c5('0x89'));}function ifInterval(_0x230fa1,_0x2f0d5b){if(_[_0x76c5('0x3c')](_0x2f0d5b)){return![];}if(getDiff(_0x2f0d5b)<_0x230fa1*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x561f57){if(isNotNull(_0x561f57)){if(!_[_0x76c5('0x3c')](_0x561f57[_0x76c5('0x27')])){_0x561f57[_0x76c5('0x27')]=undefined;loggerPredictive[_0x76c5('0x76')](_0x561f57['name'],_0x76c5('0x8a'));}if(!_[_0x76c5('0x3c')](_0x561f57[_0x76c5('0x26')])){_0x561f57[_0x76c5('0x26')]=undefined;loggerPredictive[_0x76c5('0x76')](_0x561f57[_0x76c5('0x40')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x76c5('0x3c')](_0x561f57[_0x76c5('0x8b')])){clearInterval(_0x561f57['handlePredictive']);_0x561f57['handlePredictive']=undefined;loggerPredictive['info'](_0x561f57['name'],_0x76c5('0x8c'));}}}function erlangb(_0x328b69,_0x1a0cbd){if(_0x1a0cbd===0x0){return 0x0;}var _0xca2a0d=0x1;for(var _0x3ff76f=0x1;_0x3ff76f<=_0x1a0cbd;_0x3ff76f+=0x1){_0xca2a0d=0x1+_0xca2a0d*_0x3ff76f/_0x328b69;}return 0x1/_0xca2a0d;}function isVoiceQueueOutbound(_0x1ace0f){return _0x1ace0f===_0x76c5('0x4a');}function isNotPreview(_0x317ebb){return _0x317ebb!==_0x76c5('0x1d');}function isCampaignIvr(_0x27e748){return _0x27e748===_0x76c5('0x73');}function getCallerId(_0x22723c,_0x13e04b,_0x3ed438){if(!_[_0x76c5('0x3c')](_0x3ed438)&&_0x76c5('0x8d')===typeof _0x3ed438&&!_[_0x76c5('0x75')](_0x3ed438)){if(!_[_0x76c5('0x3c')](_0x13e04b)&&_0x76c5('0x8d')===typeof _0x13e04b&&!_['isEmpty'](_0x13e04b)){return util[_0x76c5('0x70')]('\x22%s\x22\x20<%s>',_0x13e04b,_0x3ed438);}return util[_0x76c5('0x70')](_0x76c5('0x8e'),_0x3ed438,_0x3ed438);}if(!_[_0x76c5('0x3c')](_0x22723c)&&'string'===typeof _0x22723c&&!_[_0x76c5('0x75')](_0x22723c)){return _0x22723c;}return _0x76c5('0x8f');}function loggerCatchQueueSummary(_0x716ed4,_0x5a6e54){return function(_0x13805b){freeVariablesPredictive(_0x5a6e54);emitVoiceQueueSummary(_0x5a6e54);emitCampaignSummary(_0x5a6e54);loggerSyncQueueSummary[_0x76c5('0x90')](_0x716ed4,util[_0x76c5('0x91')](_0x13805b,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1bdb36,_0x34b13d){return function(_0x9ed7f){loggerPredictive[_0x76c5('0x90')](_0x34b13d[_0x76c5('0x40')],_0x1bdb36);loggerPredictive['error'](_0x9ed7f[_0x76c5('0x92')]);freeVariablesPredictive(_0x34b13d);};}function loggerCatch(_0x12b34c){return function(_0x33f856){logger['error'](_0x12b34c,util[_0x76c5('0x91')](_0x33f856,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x344608){return _0x344608&&!_[_0x76c5('0x3c')](_0x344608)&&_0x344608['length']>0x0;}function decremetOriginate(_0x7331cf){if(!_[_0x76c5('0x3c')](_0x7331cf)&&_0x7331cf!==null){if(_0x7331cf['hasOwnProperty'](_0x76c5('0x6a'))){if(_0x7331cf[_0x76c5('0x6a')]>0x0){_0x7331cf[_0x76c5('0x6a')]-=0x1;}else{logger['error'](_0x76c5('0x93'));}}}else{logger['error'](_0x76c5('0x94'));}}function checkContactLowerLimitOriginate(_0xfc02b8,_0x122c9b,_0x4dfa69){if(_0x122c9b>_0x4dfa69){for(var _0x19ab81=0x0;_0x19ab81<_0x122c9b-_0x4dfa69;_0x19ab81+=0x1){decremetOriginate(_0xfc02b8);}}}function loggerGetContactDialer(_0x523392,_0x2b6427,_0x1bab45){return function(_0x5067db){checkContactLowerLimitOriginate(_0x2b6427,_0x1bab45,0x0);logger['error'](_0x523392,util[_0x76c5('0x91')](_0x5067db,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x197f5e){return function(_0x58b104){if(isNotNull(_0x58b104)&&isNotNull(_0x58b104[0x0])){if(_0x58b104[0x0]['contactsRescheduled']>0x0){_0x197f5e[_0x76c5('0x3e')]=_0x76c5('0x95');logger['info'](_0x76c5('0x96')+_0x197f5e[_0x76c5('0x40')],_0x58b104[0x0]['contactsRescheduled'],_0x76c5('0x97'));}else{_0x197f5e[_0x76c5('0x3e')]=_0x76c5('0x98');logger['info']('[getContactDialer2][Empty]'+_0x197f5e['name']);}}};}function notSendMessagesQueue(_0x2f096b){if(_0x2f096b['sendMessageOneNotActive']){freeVariablesPredictive(_0x2f096b);if(_0x2f096b[_0x76c5('0x6a')]===0x0&&_0x2f096b[_0x76c5('0x4e')]===0x0&&_0x2f096b[_0x76c5('0x99')]===0x0&&(_0x2f096b['pTalking']||0x0)===0x0){_0x2f096b[_0x76c5('0x9a')]=![];_0x2f096b[_0x76c5('0x9b')]=0x0;_0x2f096b[_0x76c5('0x3e')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x76c5('0x90')](_0x76c5('0x9c'),_0x2f096b[_0x76c5('0x40')],'is\x20not\x20active');}else{_0x2f096b[_0x76c5('0x3e')]=_0x76c5('0x9d');loggerSyncQueueSummary[_0x76c5('0x90')](_0x76c5('0x9c'),_0x2f096b['name'],_0x76c5('0x9e'));}emitVoiceQueueSummary(_0x2f096b);}}function notSendMessagesCampaign(_0x26ce78){if(_0x26ce78[_0x76c5('0x9a')]){if(_0x26ce78['originated']===0x0){_0x26ce78['sendMessageOneNotActive']=![];_0x26ce78[_0x76c5('0x3e')]=_0x76c5('0x3f');loggerSyncQueueSummary[_0x76c5('0x90')](_0x76c5('0x9f'),_0x26ce78[_0x76c5('0x40')],_0x76c5('0xa0'));}else{_0x26ce78[_0x76c5('0x3e')]=_0x76c5('0x9d');loggerSyncQueueSummary[_0x76c5('0x90')](_0x76c5('0x9f'),_0x26ce78['name'],_0x76c5('0x9e'));}emitCampaignSummary(_0x26ce78);}}function createObjHistory(_0x416edc,_0x2c538c,_0x45abb2,_0x3ac29a,_0x4b9cfa){_0x416edc[_0x76c5('0x3e')]=_0x45abb2;var _0x2ee1b8=new Action(_0x416edc,_0x2c538c);var _0x42b8e8=new History(_0x2ee1b8);_0x42b8e8[_0x76c5('0xa1')]=_0x3ac29a;_0x42b8e8[_0x76c5('0xa2')]=_0x4b9cfa;_0x42b8e8[_0x76c5('0xa3')]=_0x2ee1b8[_0x76c5('0xa4')];return _0x42b8e8;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x51644b=this;setInterval(function(){_0x51644b['clearZombieChannels'](_0x51644b['uniqueId'],_0x76c5('0xa5'));_0x51644b[_0x76c5('0xa6')](_0x51644b[_0x76c5('0x22')],_0x76c5('0xa7'));},0x32c8);};Dialer[_0x76c5('0x1a')][_0x76c5('0xa6')]=function(_0x3c89e2,_0x3673ee){var _0x11dafa=this;for(var _0x52cf1a in _0x3c89e2){if(_0x3c89e2[_0x76c5('0xa8')](_0x52cf1a)){this[_0x76c5('0xa9')]['enqueue'](function(){if(!_['isNil'](_0x3c89e2[_0x52cf1a])){return ami[_0x76c5('0xaa')]({'action':'status','channel':_0x3c89e2[_0x52cf1a][_0x76c5('0xab')]})['catch'](function(_0x15d12d){if(_0x15d12d['message']===_0x76c5('0xac')){setTimeout(function(){if(_0x3c89e2[_0x52cf1a]&&_0x3c89e2[_0x52cf1a][_0x76c5('0x49')]!==_0x76c5('0x73')){_0x11dafa[_0x76c5('0xad')](_0x11dafa[_0x76c5('0x1e')][_0x3c89e2[_0x52cf1a]['queue']]);logger['error']('[Dialer][checkChannel]',_0x3673ee,_0x52cf1a,_0x3c89e2[_0x52cf1a][_0x76c5('0xae')]);delete _0x3c89e2[_0x52cf1a];}if(_0x3c89e2[_0x52cf1a]&&_0x3c89e2[_0x52cf1a][_0x76c5('0x49')]===_0x76c5('0x73')){_0x11dafa['updateOriginated'](_0x11dafa[_0x76c5('0x1f')][_0x3c89e2[_0x52cf1a][_0x76c5('0xae')]]);logger['error'](_0x76c5('0xaf'),_0x3673ee,_0x52cf1a,_0x3c89e2[_0x52cf1a]['queue']);delete _0x3c89e2[_0x52cf1a];}},0x2328);}});}});}}};Dialer[_0x76c5('0x1a')][_0x76c5('0xb0')]=function(_0x5d4aa9){return BPromise['resolve']()[_0x76c5('0xb1')](cmHopper[_0x76c5('0xb0')](_0x5d4aa9))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0x76c5('0xb2')]=function(_0x4d0a36){return BPromise[_0x76c5('0xb3')]()[_0x76c5('0xb1')](cmHopperBlack[_0x76c5('0xb2')](_0x4d0a36))[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xb5')));};Dialer[_0x76c5('0x1a')][_0x76c5('0xb6')]=function(_0x5183b0){return BPromise['resolve']()[_0x76c5('0xb1')](cmHopperBlack[_0x76c5('0xb6')](_0x5183b0))[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xb7')));};Dialer[_0x76c5('0x1a')][_0x76c5('0xb8')]=function(_0x148b36){return BPromise[_0x76c5('0xb3')]()['then'](cmHopperHistory['avgHandleTime'](_0x148b36))[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xb9')));};Dialer[_0x76c5('0x1a')][_0x76c5('0xba')]=function(_0x7b12d3){return BPromise[_0x76c5('0xb3')]()[_0x76c5('0xb1')](cmHopper[_0x76c5('0xba')](_0x7b12d3))[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xbb')));};Dialer['prototype'][_0x76c5('0xbc')]=function(_0x327ef6,_0x3371ad,_0x3ed488){return BPromise['resolve']()[_0x76c5('0xb1')](cmHopper[_0x76c5('0xbc')](_0x327ef6,_0x3371ad,_0x3ed488))[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xbd')));};Dialer[_0x76c5('0x1a')][_0x76c5('0xbe')]=function(_0x5cee10,_0x3e792d,_0x278a74,_0x5a2887){return BPromise[_0x76c5('0xb3')]()[_0x76c5('0xb1')](cmHopper[_0x76c5('0xbe')](_0x5cee10,_0x3e792d,_0x278a74,_0x5a2887))[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xbf')));};Dialer[_0x76c5('0x1a')][_0x76c5('0xc0')]=function(_0x5c9b7e,_0x3e528a,_0x32ed96){return BPromise[_0x76c5('0xb3')]()[_0x76c5('0xb1')](cmHopper[_0x76c5('0xc0')](_0x5c9b7e,_0x3e528a,_0x32ed96))['catch'](loggerCatch(_0x76c5('0xbf')));};Dialer['prototype']['getVoiceQueueRtPauses']=function(_0x1e60ae){return BPromise[_0x76c5('0xb3')]()['then'](voiceQueueRt[_0x76c5('0xc1')](_0x1e60ae))['catch'](loggerCatch(_0x76c5('0xc2')));};Dialer[_0x76c5('0x1a')]['moveContactManagedDialer']=function(_0x34edf0){return BPromise[_0x76c5('0xb3')]()[_0x76c5('0xb1')](cmHopper['moveContactManagedDialer'](_0x34edf0))['catch'](loggerCatch(_0x76c5('0xc3')));};Dialer[_0x76c5('0x1a')][_0x76c5('0xc4')]=function(_0x4ea9aa){return BPromise['resolve']()[_0x76c5('0xb1')](cmHopperHistory[_0x76c5('0xc4')](_0x4ea9aa))[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xc5')));};Dialer[_0x76c5('0x1a')][_0x76c5('0xad')]=function(_0x5d8a6b){if(!_[_0x76c5('0x3c')](_0x5d8a6b)&&_0x5d8a6b!==null){if(_0x5d8a6b['hasOwnProperty'](_0x76c5('0x6a'))){if(_0x5d8a6b[_0x76c5('0x6a')]>0x0){_0x5d8a6b[_0x76c5('0x6a')]-=0x1;}else{logger[_0x76c5('0x90')](_0x76c5('0xc6'));}}}else{logger['error'](_0x76c5('0xc7'));}};Dialer[_0x76c5('0x1a')][_0x76c5('0xc8')]=function(_0x3a2850,_0x328581){var _0x3de8b2=this;return function(_0x34b4ce){_0x3de8b2[_0x76c5('0xad')](_0x328581);logger[_0x76c5('0x90')](_0x3a2850,util[_0x76c5('0x91')](_0x34b4ce,{'showHidden':![],'depth':null}));};};Dialer[_0x76c5('0x1a')][_0x76c5('0xc9')]=function(_0x57154b,_0x2693e3,_0x54e505){var _0x4f26eb={'state':0x19,'statedesc':_0x76c5('0xca')};this[_0x76c5('0xad')](_0x2693e3);this['saveInDb'](_[_0x76c5('0xcb')](_0x4f26eb,_[_0x76c5('0xcc')](_0x54e505,[_0x76c5('0xcd'),'ListId','UserId',_0x76c5('0xce'),_0x76c5('0xcf')])),_0x76c5('0xd0'),_0x76c5('0xd1'));logger[_0x76c5('0x90')](_0x57154b);};Dialer[_0x76c5('0x1a')][_0x76c5('0xd2')]=function(_0xe91e75){return _0xe91e75==='Success';};Dialer[_0x76c5('0x1a')][_0x76c5('0xd3')]=function(_0x9ad76){return!_[_0x76c5('0x3c')](_0x9ad76)&&_0x9ad76&&!_[_0x76c5('0x3c')](_0x9ad76['name'])&&!_['isUndefined'](_0x9ad76['active'])&&_0x9ad76[_0x76c5('0x6f')]&&(this['trunks'][util[_0x76c5('0x70')]('SIP/%s',_0x9ad76[_0x76c5('0x40')])]['status']===_0x76c5('0xd4')||this['trunks'][util['format'](_0x76c5('0xd5'),_0x9ad76[_0x76c5('0x40')])][_0x76c5('0xd6')]===_0x76c5('0xd7'));};Dialer[_0x76c5('0x1a')][_0x76c5('0xd8')]=function(_0x1b25fe,_0x1e9244,_0x31cb33){this[_0x76c5('0xc4')](_0x1b25fe)[_0x76c5('0xb4')](loggerCatch(_0x1e9244));this[_0x76c5('0xd9')](_0x1b25fe)[_0x76c5('0xb4')](loggerCatch(_0x31cb33));};Dialer[_0x76c5('0x1a')][_0x76c5('0x35')]=function(_0x3a00f3){var _0x598ae7=this[_0x76c5('0x24')][_0x3a00f3['uniqueid']];var _0x50e480;if(!_[_0x76c5('0xda')](_0x3a00f3)&&!_['isNil'](_0x3a00f3[_0x76c5('0xdb')])&&!_[_0x76c5('0xda')](_0x3a00f3[_0x76c5('0xdb')]['amdstatus'])&&_0x3a00f3[_0x76c5('0xdc')]==='xcally-motion-dialer'&&_0x598ae7){if(_0x598ae7[_0x76c5('0x49')]!==_0x76c5('0x73')&&this['voiceQueues'][_0x598ae7[_0x76c5('0xae')]][_0x76c5('0xdd')]&&_0x3a00f3['value']===_0x76c5('0xde')){delete this[_0x76c5('0x24')][_0x3a00f3[_0x76c5('0xdf')]];this['updateOriginated'](this[_0x76c5('0x1e')][_0x598ae7[_0x76c5('0xae')]]);this[_0x76c5('0x1e')][_0x598ae7[_0x76c5('0xae')]][_0x76c5('0xe0')]+=0x1;this[_0x76c5('0x1e')][_0x598ae7[_0x76c5('0xae')]]['outboundAnswerAgiCallsDay']+=0x1;_0x50e480=new Hangup(_0x598ae7,_0x3a00f3);_0x50e480[_0x76c5('0xa1')]=0x12;_0x50e480[_0x76c5('0xa2')]=_0x76c5('0xe1');_0x50e480[_0x76c5('0xe2')]=_0x76c5('0xe3');this[_0x76c5('0xd8')](_0x50e480,_0x76c5('0xe4'),'[syncHangupInAMD]');}if(_0x598ae7['type']!==_0x76c5('0x73')&&this[_0x76c5('0x1e')][_0x598ae7[_0x76c5('0xae')]][_0x76c5('0xdd')]&&_0x3a00f3[_0x76c5('0xe5')]===_0x76c5('0xe6')){delete this[_0x76c5('0x24')][_0x3a00f3[_0x76c5('0xdf')]];this[_0x76c5('0xad')](this[_0x76c5('0x1e')][_0x598ae7[_0x76c5('0xae')]]);this[_0x76c5('0x1e')][_0x598ae7[_0x76c5('0xae')]][_0x76c5('0xe0')]+=0x1;this[_0x76c5('0x1e')][_0x598ae7['queue']][_0x76c5('0x56')]+=0x1;_0x50e480=new Hangup(_0x598ae7,_0x3a00f3);_0x50e480[_0x76c5('0xa1')]=0x13;_0x50e480[_0x76c5('0xa2')]=_0x76c5('0xe7');_0x50e480[_0x76c5('0xe2')]=_0x76c5('0xe3');_0x50e480[_0x76c5('0xe8')]=!![];this[_0x76c5('0xd8')](_0x50e480,_0x76c5('0xe9'),'[syncMachine]');}if(_0x598ae7[_0x76c5('0x49')]===_0x76c5('0x73')&&this[_0x76c5('0x1f')][_0x598ae7[_0x76c5('0xae')]][_0x76c5('0xdd')]&&_0x3a00f3[_0x76c5('0xe5')]===_0x76c5('0xde')){delete this[_0x76c5('0x24')][_0x3a00f3[_0x76c5('0xdf')]];this['updateOriginated'](this[_0x76c5('0x1f')][_0x598ae7['queue']]);_0x50e480=new Hangup(_0x598ae7,_0x3a00f3);_0x50e480[_0x76c5('0xa1')]=0x12;_0x50e480[_0x76c5('0xa2')]=_0x76c5('0xe1');_0x50e480['membername']='AMD';this[_0x76c5('0xd8')](_0x50e480,_0x76c5('0xea'),_0x76c5('0xeb'));}if(_0x598ae7[_0x76c5('0x49')]===_0x76c5('0x73')&&this[_0x76c5('0x1f')][_0x598ae7[_0x76c5('0xae')]][_0x76c5('0xdd')]&&_0x3a00f3['value']===_0x76c5('0xe6')){delete this[_0x76c5('0x24')][_0x3a00f3[_0x76c5('0xdf')]];this[_0x76c5('0xad')](this[_0x76c5('0x1f')][_0x598ae7[_0x76c5('0xae')]]);_0x50e480=new Hangup(_0x598ae7,_0x3a00f3);_0x50e480[_0x76c5('0xa1')]=0x13;_0x50e480[_0x76c5('0xa2')]='Machine';_0x50e480[_0x76c5('0xe2')]=_0x76c5('0xe3');_0x50e480[_0x76c5('0xe8')]=!![];this[_0x76c5('0xd8')](_0x50e480,_0x76c5('0xec'),_0x76c5('0xed'));}}};Dialer[_0x76c5('0x1a')][_0x76c5('0x32')]=function(_0xf4f97c){var _0x1f08d5=this[_0x76c5('0x24')][_0xf4f97c['uniqueid']];var _0x36b6fd=this;var _0x33b93b;if(_0x1f08d5&&_0x1f08d5[_0x76c5('0x49')]===_0x76c5('0x73')){delete this['uniqueId'][_0xf4f97c['uniqueid']];this[_0x76c5('0xad')](this['campaigns'][_0x1f08d5[_0x76c5('0xae')]]);this[_0x76c5('0x1f')][_0x1f08d5[_0x76c5('0xae')]][_0x76c5('0xee')]+=0x1;_0x33b93b=new Hangup(_0x1f08d5,_0xf4f97c);this['createHistory'](_0x33b93b)[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xef')));this[_0x76c5('0xd9')](_0x33b93b)[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xf0')));}if(_0x1f08d5&&_0x1f08d5[_0x76c5('0x49')]!==_0x76c5('0x73')&&isNotNull(this[_0x76c5('0x1e')][_0x1f08d5[_0x76c5('0xae')]]['dialQueueProject'])){delete this[_0x76c5('0x24')][_0xf4f97c[_0x76c5('0xdf')]];this[_0x76c5('0xad')](this[_0x76c5('0x1e')][_0x1f08d5['queue']]);this[_0x76c5('0x1e')][_0x1f08d5[_0x76c5('0xae')]][_0x76c5('0xe0')]+=0x1;this[_0x76c5('0x1e')][_0x1f08d5['queue']][_0x76c5('0x56')]+=0x1;_0x33b93b=new Hangup(_0x1f08d5,_0xf4f97c);_0x33b93b['state']=0x10;_0x33b93b[_0x76c5('0xa2')]=_0x76c5('0xf1');_0x33b93b[_0x76c5('0xe2')]=_0x76c5('0xf2');this[_0x76c5('0xc4')](_0x33b93b)[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xef')));this[_0x76c5('0xd9')](_0x33b93b)[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xf0')));}if(_0x1f08d5&&_0x1f08d5[_0x76c5('0x49')]!=='ivr'&&!isNotNull(this[_0x76c5('0x1e')][_0x1f08d5[_0x76c5('0xae')]][_0x76c5('0xf3')])){delete this[_0x76c5('0x24')][_0xf4f97c[_0x76c5('0xdf')]];this[_0x76c5('0xad')](this[_0x76c5('0x1e')][_0x1f08d5['queue']]);this[_0x76c5('0x1e')][_0x1f08d5[_0x76c5('0xae')]]['outboundUnknownCallsDay']+=0x1;_0x33b93b=new Hangup(_0x1f08d5,_0xf4f97c);_0x33b93b[_0x76c5('0xa1')]=0xc;_0x33b93b[_0x76c5('0xa2')]=_0xf4f97c['cause-txt'];_0x33b93b[_0x76c5('0xe2')]=_0x76c5('0xf4');this[_0x76c5('0xc4')](_0x33b93b)[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xef')));this['moveContactManagedDialer'](_0x33b93b)[_0x76c5('0xb4')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x76c5('0x1a')][_0x76c5('0x30')]=function(_0x18b82b){var _0x5399e1=this[_0x76c5('0x24')][_0x18b82b[_0x76c5('0xdf')]];var _0x12ee80=this;if(this['voiceQueues'][_0x18b82b[_0x76c5('0xae')]]){if(_0x5399e1&&_0x5399e1[_0x76c5('0x49')]!==_0x76c5('0x73')){delete this['uniqueId'][_0x18b82b[_0x76c5('0xdf')]];this[_0x76c5('0x1e')][_0x18b82b[_0x76c5('0xae')]][_0x76c5('0xe0')]+=0x1;var _0x3f95e0=new AgentComplete(_0x5399e1,_0x18b82b);if(_0x18b82b[_0x76c5('0xf5')]===_0x76c5('0xf6')){_0x3f95e0[_0x76c5('0xf7')]=this[_0x76c5('0x1e')][_0x18b82b[_0x76c5('0xae')]]['dialQueueProject2']&&this[_0x76c5('0x1e')][_0x18b82b[_0x76c5('0xae')]][_0x76c5('0xf8')]?moment()[_0x76c5('0x70')](_0x76c5('0xf9')):undefined;}this['createHistory'](_0x3f95e0)[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xfa')));this['moveContactManagedDialer'](_0x3f95e0)[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xfb')));}}};Dialer[_0x76c5('0x1a')][_0x76c5('0xfc')]=function(_0x13bed2){if(this[_0x76c5('0x1e')][_0x13bed2[_0x76c5('0xae')]]){if(this[_0x76c5('0x24')][_0x13bed2[_0x76c5('0xdf')]]&&this[_0x76c5('0x24')][_0x13bed2['uniqueid']][_0x76c5('0x49')]!==_0x76c5('0x73')){this['updateOriginated'](this[_0x76c5('0x1e')][_0x13bed2[_0x76c5('0xae')]]);this[_0x76c5('0x24')][_0x13bed2[_0x76c5('0xdf')]][_0x76c5('0xfd')]=moment()['format'](_0x76c5('0xf9'));}}};Dialer['prototype'][_0x76c5('0xfe')]=function(_0x4ded2d){this[_0x76c5('0xc4')](_0x4ded2d)[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xfa')));this[_0x76c5('0xd9')](_0x4ded2d)[_0x76c5('0xb4')](loggerCatch(_0x76c5('0xff')));};Dialer['prototype'][_0x76c5('0x100')]=function(_0x5125c1){var _0x52e4ab=this[_0x76c5('0x24')][_0x5125c1[_0x76c5('0xdf')]];var _0x3c730e=this;if(this[_0x76c5('0x1e')][_0x5125c1[_0x76c5('0xae')]]){if(_0x52e4ab&&_0x52e4ab['type']!==_0x76c5('0x73')){delete this['uniqueId'][_0x5125c1[_0x76c5('0xdf')]];this[_0x76c5('0xad')](this['voiceQueues'][_0x5125c1[_0x76c5('0xae')]]);_0x52e4ab[_0x76c5('0x101')]=moment()[_0x76c5('0x70')](_0x76c5('0xf9'));var _0x9c5de2=new QueueCallerAbandon(_0x52e4ab,_0x5125c1);if(getSeconds(_0x52e4ab[_0x76c5('0x101')],_0x52e4ab['responsetime'])>=_0x52e4ab[_0x76c5('0x102')]){this[_0x76c5('0x1e')][_0x5125c1[_0x76c5('0xae')]][_0x76c5('0x62')]+=0x1;this[_0x76c5('0x1e')][_0x5125c1['queue']][_0x76c5('0x103')]+=0x1;this[_0x76c5('0x1e')][_0x5125c1['queue']][_0x76c5('0x64')]+=0x1;_0x9c5de2[_0x76c5('0xa1')]=0xa;_0x9c5de2[_0x76c5('0xa2')]=_0x76c5('0x104');_0x9c5de2[_0x76c5('0x105')]=_0x76c5('0x106');_0x9c5de2[_0x76c5('0xf7')]=this[_0x76c5('0x1e')][_0x5125c1[_0x76c5('0xae')]][_0x76c5('0x107')]?moment()[_0x76c5('0x70')](_0x76c5('0xf9')):undefined;this['queueCallerAbandonCreateState'](_0x9c5de2);}else{this[_0x76c5('0x1e')][_0x5125c1[_0x76c5('0xae')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x5125c1[_0x76c5('0xae')]][_0x76c5('0x108')]+=0x1;_0x9c5de2[_0x76c5('0xa1')]=0xb;_0x9c5de2[_0x76c5('0xa2')]=_0x76c5('0x109');_0x9c5de2[_0x76c5('0x105')]=_0x76c5('0x10a');this[_0x76c5('0xfe')](_0x9c5de2);}}}};Dialer[_0x76c5('0x1a')][_0x76c5('0x10b')]=function(_0x3fa2b3){if(this[_0x76c5('0x22')][_0x3fa2b3[_0x76c5('0xdf')]]){this['actions'][_0x3fa2b3['uniqueid']][_0x76c5('0xab')]=_0x3fa2b3[_0x76c5('0xab')];}if(this[_0x76c5('0x24')][_0x3fa2b3['uniqueid']]){this[_0x76c5('0x24')][_0x3fa2b3[_0x76c5('0xdf')]][_0x76c5('0xab')]=_0x3fa2b3[_0x76c5('0xab')];}};Dialer[_0x76c5('0x1a')][_0x76c5('0x37')]=function(_0x24626c){if(strategy[this[_0x76c5('0x1e')][this[_0x76c5('0x22')][_0x24626c[_0x76c5('0x10c')]][_0x76c5('0xae')]][_0x76c5('0x10d')]]===_0x76c5('0x19')){if(this[_0x76c5('0x22')][_0x24626c[_0x76c5('0x10c')]]&&_[_0x76c5('0xda')](this['actions'][_0x24626c[_0x76c5('0x10c')]][_0x76c5('0x10e')])&&_0x24626c[_0x76c5('0xd6')]==='1'&&_0x24626c[_0x76c5('0x10f')]==='0'){if(this[_0x76c5('0x20')][_0x24626c[_0x76c5('0x110')]]){if(!this[_0x76c5('0x20')][_0x24626c[_0x76c5('0x110')]][_0x76c5('0x10e')]){this['agents'][_0x24626c[_0x76c5('0x110')]][_0x76c5('0x10e')]=!![];this[_0x76c5('0x22')][_0x24626c[_0x76c5('0x10c')]][_0x76c5('0x10e')]=!![];this[_0x76c5('0x22')][_0x24626c['actionid']]['stateinterface']=_0x24626c[_0x76c5('0x110')];}}}}else if((strategy[this[_0x76c5('0x1e')][this[_0x76c5('0x22')][_0x24626c['actionid']][_0x76c5('0xae')]]['strategy']]||_0x76c5('0x111'))===_0x76c5('0x111')){if(this[_0x76c5('0x22')][_0x24626c[_0x76c5('0x10c')]]){if(this['agents'][_0x24626c['stateinterface']]){this[_0x76c5('0x22')][_0x24626c[_0x76c5('0x10c')]][_0x76c5('0x110')]=_0x24626c[_0x76c5('0x110')];if(_[_0x76c5('0xda')](this[_0x76c5('0x29')][this['actions'][_0x24626c[_0x76c5('0x10c')]]['queue']])){this[_0x76c5('0x29')][this[_0x76c5('0x22')][_0x24626c['actionid']][_0x76c5('0xae')]]=[];}this['queueBooked'][this[_0x76c5('0x22')][_0x24626c['actionid']][_0x76c5('0xae')]]['push'](_['merge'](_[_0x76c5('0xcc')](this[_0x76c5('0x22')][_0x24626c['actionid']],[_0x76c5('0x112'),_0x76c5('0x110')]),{'status':_0x24626c['status'],'paused':_0x24626c['paused']}));}}}};function unlockQueueStatus(_0x54c003,_0x474a1f){setTimeout(function(){if(_[_0x76c5('0x3c')](_0x54c003['queueStatusComplete'])){loggerBooked[_0x76c5('0x90')]('[unlockQueueStatus][undefined]',_0x474a1f);}_0x54c003['queueStatusComplete']=!![];loggerBooked[_0x76c5('0x76')](_0x76c5('0x113'),_0x474a1f,JSON[_0x76c5('0x47')](_[_0x76c5('0xcc')](_0x54c003,[_0x76c5('0x40'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x76c5('0x1a')][_0x76c5('0x39')]=function(_0x447471){var _0x3d27a4=this;var _0x416483=_0x3d27a4['voiceQueues'][_0x3d27a4[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]][_0x76c5('0xae')]];if(strategy[this[_0x76c5('0x1e')][this[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]][_0x76c5('0xae')]]['strategy']]===_0x76c5('0x19')){if(this[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]]&&this[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]][_0x76c5('0x110')]){this[_0x76c5('0x1d')]['run'](this[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]][_0x76c5('0x112')],this[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]][_0x76c5('0x110')])[_0x76c5('0xb4')](function(_0x147879){logger['error'](_0x76c5('0x114'),util[_0x76c5('0x91')](_0x147879,{'showHidden':![],'depth':null}));})['finally'](function(){_0x3d27a4[_0x76c5('0xad')](_0x3d27a4[_0x76c5('0x1e')][_0x3d27a4[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]][_0x76c5('0xae')]]);_0x3d27a4[_0x76c5('0x20')][_0x3d27a4['actions'][_0x447471['actionid']]['stateinterface']][_0x76c5('0x10e')]=![];delete _0x3d27a4[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]];unlockQueueStatus(_0x416483);});}else{this[_0x76c5('0xad')](this[_0x76c5('0x1e')][this[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]][_0x76c5('0xae')]]);this[_0x76c5('0xba')]({'active':![],'ContactId':this['actions'][_0x447471[_0x76c5('0x10c')]][_0x76c5('0xcd')],'ListId':this[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]]['ListId'],'VoiceQueueId':this[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]][_0x76c5('0xce')]||undefined,'CampaignId':this['actions'][_0x447471['actionid']][_0x76c5('0xcf')]||undefined})[_0x76c5('0xb4')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x447471[_0x76c5('0x10c')]];unlockQueueStatus(_0x416483);}}else if((strategy[this[_0x76c5('0x1e')][this[_0x76c5('0x22')][_0x447471['actionid']][_0x76c5('0xae')]][_0x76c5('0x10d')]]||'rrmemory')===_0x76c5('0x111')){var _0x41969c;if(this[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]]&&!_['isEmpty'](this['queueBooked'][this[_0x76c5('0x22')][_0x447471['actionid']]['queue']])){if(this['queueBookedRR'][_0x3d27a4['actions'][_0x447471['actionid']]['queue']]){this[_0x76c5('0x2a')][_0x3d27a4[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]][_0x76c5('0xae')]]=this[_0x76c5('0x2a')][this[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]][_0x76c5('0xae')]]?this[_0x76c5('0x2a')][this[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]][_0x76c5('0xae')]]:this['queueBooked'][this[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]][_0x76c5('0xae')]]?this['queueBooked'][this[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]][_0x76c5('0xae')]][_0x76c5('0x115')]||0x0:0x0;}this[_0x76c5('0x29')][this[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]][_0x76c5('0xae')]]['_rr']=this[_0x76c5('0x2a')][this[_0x76c5('0x22')][_0x447471[_0x76c5('0x10c')]][_0x76c5('0xae')]];for(var _0x4e21bb=0x0;_0x4e21bb=0x0?!![]:![];})[_0x76c5('0xb4')](myreject(_0xe323d2)));}}else{_0x50ad11[_0x76c5('0x131')](ami[_0x76c5('0xaa')]({'action':_0x76c5('0x132'),'command':util[_0x76c5('0x70')](_0x76c5('0x137'),_0x152f80,!_[_0x76c5('0x3c')](config['timezones'][_0x1a9bb7])?_0x1a9bb7:'')})[_0x76c5('0xb1')](function(_0x1d655a){return _0x1d655a[_0x76c5('0x134')]['indexOf']('true')>=0x0?!![]:![];})[_0x76c5('0xb4')](myreject(_0xe323d2)));}BPromise[_0x76c5('0x138')](_0x50ad11)[_0x76c5('0xb1')](function(_0x35df2){var _0x8193bf=_[_0x76c5('0x139')](_0x35df2);if(_0x8193bf){return _0x2429ec(_0x8193bf);}else{_0x149de8[_0x76c5('0x3e')]=_0x22a210?_0x76c5('0x13a'):'INTERVAL_IS_OVERTIME';return _0xe323d2(msgResponse(_0x76c5('0x13b'),'Failure',_0x76c5('0x13c')+_0x22a210+'\x20'+_0x38e08b+_0x76c5('0x13d')+util[_0x76c5('0x91')](_0x152f80,{'showHidden':![],'depth':null})+_0x76c5('0x13e')+_0x1a9bb7));}})[_0x76c5('0xb4')](function(_0x17f39a){return _0xe323d2(msgResponse(_0x76c5('0x128'),_0x76c5('0x129'),JSON[_0x76c5('0x47')](_0x17f39a)));});});};Dialer['prototype'][_0x76c5('0x13f')]=function(_0x3386e6){var _0x43cf0b=this;return function(){switch(_0x3386e6['dialMethod']){case _0x76c5('0x140'):freeVariablesPredictive(_0x3386e6);_0x43cf0b[_0x76c5('0x141')](_0x3386e6,0x1);break;case _0x76c5('0x142'):freeVariablesPredictive(_0x3386e6);_0x43cf0b[_0x76c5('0x141')](_0x3386e6,_0x3386e6[_0x76c5('0x143')]);break;case'predictive':_0x43cf0b[_0x76c5('0x9')](_0x3386e6);break;case _0x76c5('0x8'):freeVariablesPredictive(_0x3386e6);_0x43cf0b[_0x76c5('0x141')](_0x3386e6,0x1);break;default:freeVariablesPredictive(_0x3386e6);logger[_0x76c5('0x90')]('Queue',_0x3386e6[_0x76c5('0x40')],_0x76c5('0x144'));}};};Dialer[_0x76c5('0x1a')][_0x76c5('0x145')]=function(_0x28627a){var _0x5aefe2=this;return function(){_0x5aefe2['handleIvr'](_0x28627a);};};Dialer[_0x76c5('0x1a')][_0x76c5('0xa')]=function(_0x1d5390){var _0x718331=this;if(isNotPreview(_0x1d5390[_0x76c5('0x53')])){if(isVoiceQueueOutbound(_0x1d5390[_0x76c5('0x49')])&&isActive(_0x1d5390[_0x76c5('0x52')])){_0x1d5390[_0x76c5('0x9a')]=!![];BPromise[_0x76c5('0xb3')]()['then'](checkIsLoggedIn(_0x1d5390,_0x1d5390['loggedIn']))[_0x76c5('0xb1')](checkIsActive(_0x1d5390,_0x1d5390['dialActive']))[_0x76c5('0xb1')](checkInterval(_0x1d5390))[_0x76c5('0xb1')](_0x718331[_0x76c5('0x123')](_0x1d5390))['then'](_0x718331['checkIfTime'](_0x1d5390['dialGlobalInterval'],_0x1d5390[_0x76c5('0x146')],_0x1d5390['name'],_0x1d5390))[_0x76c5('0xb1')](_0x718331['checkIfTimeIntervals'](_0x1d5390[_0x76c5('0x43')],_0x1d5390[_0x76c5('0x146')],_0x1d5390['name'],_0x1d5390))[_0x76c5('0xb1')](_0x718331[_0x76c5('0x13f')](_0x1d5390))[_0x76c5('0xb4')](loggerCatchQueueSummary('[syncQueueSummary]',_0x1d5390));}else{notSendMessagesQueue(_0x1d5390);}}else{freeVariablesPredictive(_0x1d5390);}};Dialer[_0x76c5('0x1a')]['syncCampaigns']=function(){var _0x44fa03=this;var _0x3c9440;for(var _0x3f9732 in this['campaigns']){if(this[_0x76c5('0x1f')]['hasOwnProperty'](_0x3f9732)){_0x3c9440=this[_0x76c5('0x1f')][_0x3f9732];if(isCampaignIvr(_0x3c9440['type'])&&isActive(_0x3c9440[_0x76c5('0x6f')])){_0x3c9440[_0x76c5('0x9a')]=!![];BPromise[_0x76c5('0xb3')]()[_0x76c5('0xb1')](checkIsActive(_0x3c9440,_0x3c9440['active']))[_0x76c5('0xb1')](checkInterval(_0x3c9440))['then'](_0x44fa03[_0x76c5('0x123')](_0x3c9440))[_0x76c5('0xb1')](_0x44fa03[_0x76c5('0x127')](_0x3c9440[_0x76c5('0x147')],_0x3c9440[_0x76c5('0x146')],_0x3c9440[_0x76c5('0x40')],_0x3c9440))['then'](_0x44fa03['checkIfTimeIntervals'](_0x3c9440[_0x76c5('0x43')],_0x3c9440[_0x76c5('0x146')],_0x3c9440['name'],_0x3c9440))[_0x76c5('0xb1')](_0x44fa03['launchHandleIvr'](_0x3c9440))[_0x76c5('0xb4')](loggerCatchQueueSummary(_0x76c5('0x148'),_0x3c9440));}else{notSendMessagesCampaign(_0x3c9440);}}}};function getCallerIdRandom(_0x47c839,_0xf5c4f4){var _0x3edf3c,_0x2504fb,_0x322509;if(_0xf5c4f4<=0x0){_0xf5c4f4=0x1;}_0x3edf3c=new RegExp('\x5cw{0,'+_0xf5c4f4+'}$');_0x2504fb=Math[_0x76c5('0x149')](0xa,_0xf5c4f4-0x1);_0x322509=Math['pow'](0xa,_0xf5c4f4)-0x1;return util['format']('%s',_['replace'](_0x47c839,_0x3edf3c,_[_0x76c5('0x14a')](_0x2504fb,_0x322509)));}function extractCalleridName(_0x168182){var _0x40e6fd=_0x168182[_0x76c5('0x14b')](/"(.*?)"/);return _0x40e6fd?_0x40e6fd[0x1]:_0x168182;}function extractCalleridNumber(_0xd98b26){var _0x196ba0=_0xd98b26['match'](/<(.*?)>/);return _0x196ba0?_0x196ba0[0x1]:_0xd98b26;}Dialer[_0x76c5('0x1a')][_0x76c5('0x14c')]=function(_0x172012,_0x3409c7){var _0x5b4190=this;var _0x4b782a=uuid['v4']();this[_0x76c5('0x22')][_0x4b782a]=new Action(_0x172012,_0x3409c7,_0x4b782a);return new BPromise(function(_0x3ab4e0,_0x1014bd){if(_[_0x76c5('0x3c')](_0x172012)&&_0x76c5('0x14d')!==typeof _0x172012){return _0x1014bd(msgResponse(_0x76c5('0x14e'),_0x76c5('0x129'),_0x76c5('0x14f')));}if(_[_0x76c5('0x3c')](_0x3409c7[_0x76c5('0x150')][_0x76c5('0x151')])||_0x3409c7[_0x76c5('0x150')][_0x76c5('0x151')]===null){return _0x1014bd(msgResponse('originate',_0x76c5('0x129'),'contact\x20is\x20undefine'));}var _0x10ea1e={'XMD-CALLERID':_0x5b4190[_0x76c5('0x22')][_0x4b782a]['getCaller'](),'XMD-AGI':_0x172012['dialQueueProject']?util[_0x76c5('0x70')](_0x76c5('0x152'),ipAgi,_0x172012[_0x76c5('0xf3')]):_0x76c5('0x153'),'XMD-AGIAFTER':_0x172012['dialQueueProject2']?util['format'](_0x76c5('0x152'),ipAgi,_0x172012[_0x76c5('0x107')]):_0x76c5('0x153'),'XMD-QUEUE':_0x172012['type']===_0x76c5('0x4a')?util[_0x76c5('0x70')](_0x76c5('0x154'),_0x172012['name'],_0x172012[_0x76c5('0x155')]||'',_0x172012[_0x76c5('0xf8')]?'c':'',_0x172012['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x3409c7[_0x76c5('0xcd')],'XMD-CDRTYPE':_0x76c5('0x6'),'CALLERID(all)':_0x5b4190['actions'][_0x4b782a][_0x76c5('0x156')](),'XMD-AMD':_0x172012[_0x76c5('0xdd')]?_0x76c5('0x157'):_0x76c5('0x153'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x172012['dialAMDActive']){_0x10ea1e[_0x76c5('0x158')]=_0x172012['dialAMDInitialSilence']||0x9c4;_0x10ea1e[_0x76c5('0x159')]=_0x172012[_0x76c5('0x15a')]||0x5dc;_0x10ea1e['XMD-AMDAFTERGREETINGSILENCE']=_0x172012[_0x76c5('0x15b')]||0x320;_0x10ea1e[_0x76c5('0x15c')]=_0x172012['dialAMDTotalAnalysisTime']||0x1388;_0x10ea1e[_0x76c5('0x15d')]=_0x172012['dialAMDMinWordLength']||0x64;_0x10ea1e[_0x76c5('0x15e')]=_0x172012[_0x76c5('0x15f')]||0x32;_0x10ea1e[_0x76c5('0x160')]=_0x172012[_0x76c5('0x161')]||0x3;_0x10ea1e[_0x76c5('0x162')]=_0x172012[_0x76c5('0x163')]||0x100;_0x10ea1e['XMD-AMDMAXIMUMWORDLENGTH']=_0x172012[_0x76c5('0x164')]||0x1388;}if(_0x172012[_0x76c5('0x49')]===_0x76c5('0x4a')){_0x10ea1e[_0x76c5('0x165')]=_0x3409c7['VoiceQueueId'];}else{_0x10ea1e[_0x76c5('0x166')]=_0x3409c7[_0x76c5('0xcf')];}for(var _0x553366 in _0x3409c7[_0x76c5('0x150')]){if(_0x3409c7[_0x76c5('0x150')][_0x76c5('0xa8')](_0x553366)){if(isNotNull(_0x3409c7[_0x76c5('0x150')][_0x553366])&&_0x553366!=='id'&&_0x553366!==_0x76c5('0x167')&&_0x553366!==_0x76c5('0x168')&&_0x553366!==_0x76c5('0x169')){_0x10ea1e[util[_0x76c5('0x70')](_0x76c5('0x16a'),_0x76c5('0x16b'),_['toUpper'](_0x553366))]=_0x3409c7[_0x76c5('0x150')][_0x553366];}}}var _0x15e289=_0x5b4190[_0x76c5('0xd3')](_0x172012[_0x76c5('0x6e')])?getCallerId(_0x172012[_0x76c5('0x6e')][_0x76c5('0x16c')],_0x172012[_0x76c5('0x54')],_0x172012[_0x76c5('0x16d')]>0x0?getCallerIdRandom(_0x172012['dialOriginateCallerIdNumber'],_0x172012['dialRandomLastDigitCallerIdNumber']):_0x172012['dialOriginateCallerIdNumber']):getCallerId(_[_0x76c5('0xda')](_0x172012[_0x76c5('0x124')])?_0x172012['Trunk'][_0x76c5('0x16c')]:_0x172012[_0x76c5('0x124')][_0x76c5('0x16c')],_0x172012[_0x76c5('0x54')],_0x172012[_0x76c5('0x16d')]>0x0?getCallerIdRandom(_0x172012[_0x76c5('0x16e')],_0x172012['dialRandomLastDigitCallerIdNumber']):_0x172012['dialOriginateCallerIdNumber']);if(_0x15e289){_0x10ea1e[_0x76c5('0x16f')]=_0x5b4190[_0x76c5('0x22')][_0x4b782a][_0x76c5('0x170')]=extractCalleridName(_0x15e289);_0x10ea1e[_0x76c5('0x171')]=_0x5b4190[_0x76c5('0x22')][_0x4b782a][_0x76c5('0x172')]=extractCalleridNumber(_0x15e289);}return ami[_0x76c5('0xaa')]({'actionid':_0x4b782a,'action':'originate','channel':_0x5b4190[_0x76c5('0xd3')](_0x172012['Trunk'])?util[_0x76c5('0x70')]('SIP/%s/%s%s',_0x172012[_0x76c5('0x6e')][_0x76c5('0x40')],isNotNull(_0x172012['dialPrefix'])?_0x172012[_0x76c5('0x173')][_0x76c5('0x174')]()||'':'',_0x172012[_0x76c5('0x175')]>0x0?_0x3409c7['Contact'][_0x76c5('0x151')][_0x76c5('0x176')](_0x172012[_0x76c5('0x175')]):_0x3409c7[_0x76c5('0x150')][_0x76c5('0x151')]):util[_0x76c5('0x70')]('SIP/%s/%s%s',_[_0x76c5('0xda')](_0x172012[_0x76c5('0x124')])?_0x172012[_0x76c5('0x6e')][_0x76c5('0x40')]:_0x172012[_0x76c5('0x124')][_0x76c5('0x40')],isNotNull(_0x172012[_0x76c5('0x173')])?_0x172012[_0x76c5('0x173')][_0x76c5('0x174')]()||'':'',_0x172012[_0x76c5('0x175')]>0x0?_0x3409c7[_0x76c5('0x150')]['phone'][_0x76c5('0x176')](_0x172012[_0x76c5('0x175')]):_0x3409c7['Contact'][_0x76c5('0x151')]),'callerid':_0x15e289,'Exten':_0x76c5('0x177'),'Context':'from-sip','Priority':'1','variable':_0x10ea1e,'timeout':(_0x172012['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x4b782a})['then'](function(_0x65fc61){return _0x3ab4e0(_0x65fc61);})[_0x76c5('0xb4')](function(_0x510654){_0x172012[_0x76c5('0x5d')]+=0x1;var _0x3d72a2=new History(_0x5b4190[_0x76c5('0x22')][_0x4b782a]);logger[_0x76c5('0x90')](util[_0x76c5('0x70')](_0x76c5('0x178'),JSON[_0x76c5('0x47')](_0x510654)));_0x3d72a2['state']=0xe;_0x3d72a2[_0x76c5('0xa2')]=_0x76c5('0x179');_0x3d72a2[_0x76c5('0xa4')]=moment()[_0x76c5('0x70')](_0x76c5('0xf9'));_0x3d72a2['endtime']=_0x3d72a2[_0x76c5('0xa4')];_0x5b4190[_0x76c5('0xc4')](_0x3d72a2)[_0x76c5('0xb4')](loggerCatch(_0x76c5('0x17a')));_0x5b4190[_0x76c5('0xd9')](_0x3d72a2)[_0x76c5('0xb4')](loggerCatch(_0x76c5('0x17a')))[_0x76c5('0x11c')](function(){delete _0x5b4190[_0x76c5('0x22')][_0x4b782a];return _0x1014bd(msgResponse('originate',_0x76c5('0x46'),_0x76c5('0x17b')));});});});};Dialer['prototype'][_0x76c5('0x2e')]=function(_0x4bf455){var _0xe04006=this['actions'][_0x4bf455[_0x76c5('0x10c')]];var _0x4aa1f8=this;if(_0xe04006){delete this[_0x76c5('0x22')][_0x4bf455[_0x76c5('0x10c')]];_0xe04006[_0x76c5('0x17c')]=moment()[_0x76c5('0x70')](_0x76c5('0xf9'));var _0x240f4f=_0xe04006[_0x76c5('0x49')]==='ivr'?this[_0x76c5('0x1f')][_0xe04006['queue']]:this['voiceQueues'][_0xe04006[_0x76c5('0x17d')]()];if(!this['isSuccess'](_0x4bf455[_0x76c5('0x17e')])){this[_0x76c5('0xad')](_0x240f4f);return this[_0x76c5('0x17f')](_0xe04006,_0x240f4f,_0x4bf455)[_0x76c5('0xb1')](function(_0x438226){})[_0x76c5('0xb4')](loggerCatch(_0x76c5('0x180')));}else{this[_0x76c5('0x24')][_0x4bf455['uniqueid']]=_0xe04006;}}};Dialer[_0x76c5('0x1a')][_0x76c5('0x181')]=function(_0x1230ed,_0x427c55,_0x426b43){var _0x3c4e9e=new History(_0x427c55);if(_0x3c4e9e[_0x76c5('0x182')]+_0x3c4e9e[_0x76c5('0x183')]+_0x3c4e9e[_0x76c5('0x184')]>=_0x426b43['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x1230ed){case 0x3:if(_0x3c4e9e[_0x76c5('0x184')]>=_0x426b43[_0x76c5('0x185')]-0x1){return!![];}else{this[_0x76c5('0xba')]({'active':![],'countnoanswerretry':_0x3c4e9e['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x76c5('0x186')](_0x426b43[_0x76c5('0x187')],_0x76c5('0x188'))[_0x76c5('0x70')](_0x76c5('0xf9')),'ContactId':_0x3c4e9e[_0x76c5('0xcd')],'ListId':_0x3c4e9e[_0x76c5('0x11f')],'VoiceQueueId':_0x3c4e9e[_0x76c5('0xce')]||undefined,'CampaignId':_0x3c4e9e[_0x76c5('0xcf')]||undefined})[_0x76c5('0xb4')](loggerCatch(_0x76c5('0x189')));}break;case 0x5:if(_0x3c4e9e['countbusyretry']>=_0x426b43[_0x76c5('0x18a')]-0x1){return!![];}else{this[_0x76c5('0xba')]({'active':![],'countbusyretry':_0x3c4e9e[_0x76c5('0x182')]+=0x1,'scheduledat':moment()[_0x76c5('0x186')](_0x426b43['dialBusyRetryFrequency'],_0x76c5('0x188'))[_0x76c5('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3c4e9e[_0x76c5('0xcd')],'ListId':_0x3c4e9e['ListId'],'VoiceQueueId':_0x3c4e9e['VoiceQueueId']||undefined,'CampaignId':_0x3c4e9e['CampaignId']||undefined})['catch'](loggerCatch(_0x76c5('0x18b')));}break;case 0x8:if(_0x3c4e9e[_0x76c5('0x183')]>=_0x426b43['dialCongestionMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x3c4e9e['countcongestionretry']+=0x1,'scheduledat':moment()[_0x76c5('0x186')](_0x426b43[_0x76c5('0x18c')],_0x76c5('0x188'))[_0x76c5('0x70')](_0x76c5('0xf9')),'ContactId':_0x3c4e9e[_0x76c5('0xcd')],'ListId':_0x3c4e9e[_0x76c5('0x11f')],'VoiceQueueId':_0x3c4e9e[_0x76c5('0xce')]||undefined,'CampaignId':_0x3c4e9e[_0x76c5('0xcf')]||undefined})['catch'](loggerCatch(_0x76c5('0x18d')));}break;default:return!![];}};Dialer[_0x76c5('0x1a')]['callProgressDetecting']=function(_0x5a9108,_0x483ae3,_0x4ad96a){var _0xfa9806=this;var _0x51e62c=new History(_0x5a9108);return new BPromise(function(_0x614733,_0x96e0d4){if(_['isUndefined'](_0x483ae3)&&_0x76c5('0x14d')!==typeof _0x483ae3){return _0x96e0d4(msgResponse(_0x76c5('0x18e'),_0x76c5('0x129'),_0x76c5('0x18f')));}if(_[_0x76c5('0x3c')](_0x4ad96a)&&_0x76c5('0x14d')!==typeof _0x4ad96a){return _0x96e0d4(msgResponse(_0x76c5('0x18e'),'Failure',_0x76c5('0x190')));}switch(_0x4ad96a[_0x76c5('0xf5')]){case'0':_0x483ae3[_0x76c5('0x5c')]+=0x1;_0x51e62c[_0x76c5('0xa1')]=0x0;_0x51e62c[_0x76c5('0xa2')]=_0x76c5('0x191');_0xfa9806['createHistory'](_0x51e62c)['catch'](loggerCatch(_0x76c5('0x192')));if(_0xfa9806[_0x76c5('0x181')](0x0,_0x5a9108,_0x483ae3)){if(_0x51e62c[_0x76c5('0x182')]+_0x51e62c[_0x76c5('0x183')]+_0x51e62c[_0x76c5('0x184')]>=_0x483ae3[_0x76c5('0x193')]){_0xfa9806[_0x76c5('0x194')](_0x51e62c,_0x614733,_0x96e0d4,'reason\x200\x20no\x20such\x20number....');}else{_0xfa9806[_0x76c5('0x195')](_0x51e62c,_0x614733,_0x96e0d4,_0x76c5('0x196'));}}break;case'3':_0x483ae3[_0x76c5('0x5b')]+=0x1;_0x51e62c['state']=0x3;_0x51e62c[_0x76c5('0xa2')]='NoAnswer';_0x51e62c[_0x76c5('0x184')]+=0x1;_0x51e62c[_0x76c5('0x197')]+=0x1;_0xfa9806[_0x76c5('0xc4')](_0x51e62c)[_0x76c5('0xb4')](loggerCatch(_0x76c5('0x198')));if(_0xfa9806[_0x76c5('0x181')](0x3,_0x5a9108,_0x483ae3)){if(_0x51e62c['countnoanswerretry']>=_0x483ae3['dialNoAnswerMaxRetry']){_0xfa9806[_0x76c5('0x195')](_0x51e62c,_0x614733,_0x96e0d4,'reason\x203\x20ringing\x20no\x20answer');}else{_0xfa9806[_0x76c5('0x194')](_0x51e62c,_0x614733,_0x96e0d4,_0x76c5('0x199'));}}break;case'5':_0x483ae3[_0x76c5('0x58')]+=0x1;_0x51e62c[_0x76c5('0xa1')]=0x5;_0x51e62c[_0x76c5('0xa2')]=_0x76c5('0x19a');_0x51e62c[_0x76c5('0x182')]+=0x1;_0x51e62c[_0x76c5('0x197')]+=0x1;_0xfa9806['createHistory'](_0x51e62c)[_0x76c5('0xb4')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0xfa9806['checkRetriveMax'](0x5,_0x5a9108,_0x483ae3)){if(_0x51e62c[_0x76c5('0x182')]>=_0x483ae3['dialBusyMaxRetry']){_0xfa9806['createStateFinal'](_0x51e62c,_0x614733,_0x96e0d4,_0x76c5('0x19b'));}else{_0xfa9806[_0x76c5('0x194')](_0x51e62c,_0x614733,_0x96e0d4,'reason\x205\x20busy');}}break;case'8':_0x483ae3[_0x76c5('0x59')]+=0x1;_0x51e62c[_0x76c5('0xa1')]=0x8;_0x51e62c[_0x76c5('0xa2')]=_0x76c5('0x19c');_0x51e62c[_0x76c5('0x183')]+=0x1;_0x51e62c[_0x76c5('0x197')]+=0x1;_0xfa9806[_0x76c5('0xc4')](_0x51e62c)[_0x76c5('0xb4')](loggerCatch(_0x76c5('0x19d')));if(_0xfa9806[_0x76c5('0x181')](0x8,_0x5a9108,_0x483ae3)){if(_0x51e62c[_0x76c5('0x183')]>=_0x483ae3['dialCongestionMaxRetry']){_0xfa9806[_0x76c5('0x195')](_0x51e62c,_0x614733,_0x96e0d4,'reason\x208\x20congestion');}else{_0xfa9806[_0x76c5('0x194')](_0x51e62c,_0x614733,_0x96e0d4,'reason\x208\x20congestion');}}break;default:_0x483ae3['outboundUnknownCallsDay']+=0x1;_0x51e62c[_0x76c5('0xa1')]=0xc;_0x51e62c[_0x76c5('0xa2')]=_0x4ad96a['reason'];_0xfa9806[_0x76c5('0xc4')](_0x51e62c)['catch'](loggerCatch(_0x76c5('0x19e')));if(_0xfa9806[_0x76c5('0x181')](_0x4ad96a['reason'],_0x5a9108,_0x483ae3)){if(_0x51e62c['countbusyretry']+_0x51e62c[_0x76c5('0x183')]+_0x51e62c[_0x76c5('0x184')]>=_0x483ae3[_0x76c5('0x193')]){_0xfa9806[_0x76c5('0x194')](_0x51e62c,_0x614733,_0x96e0d4,_0x4ad96a[_0x76c5('0xf5')]);}else{_0xfa9806['createStateFinal'](_0x51e62c,_0x614733,_0x96e0d4,_0x4ad96a[_0x76c5('0xf5')]);}}}});};Dialer[_0x76c5('0x1a')][_0x76c5('0x194')]=function(_0x58b5d7,_0x95ecc,_0x73f2f3,_0x15acf1){var _0x247d28=new Final(_0x58b5d7);_0x247d28[_0x76c5('0xa1')]=0xf;_0x247d28[_0x76c5('0xa2')]=_0x76c5('0x19f');this['createStateFinal'](_0x247d28,_0x95ecc,_0x73f2f3,_0x15acf1);};Dialer[_0x76c5('0x1a')][_0x76c5('0x195')]=function(_0x262922,_0x1ac488,_0x3f92f0,_0x483f83){this[_0x76c5('0xd9')](_0x262922)['then'](function(_0x2e60d2){return _0x1ac488(msgResponse(_0x76c5('0x18e'),_0x76c5('0x1a0'),_0x483f83));})[_0x76c5('0xb4')](function(_0x30efe6){return _0x3f92f0(msgResponse('[moveContactManagedDialer][0]',_0x76c5('0x129'),_0x76c5('0x1a1')));});};Dialer[_0x76c5('0x1a')][_0x76c5('0x9')]=function(_0x31838c){var _0x107aa6=this;var _0x1064bf=_0x31838c[_0x76c5('0x1a2')]/0x64;var _0x5b10ca=_0x31838c['outboundDropCallsDayTimeout']/(_0x31838c[_0x76c5('0x103')]+_0x31838c[_0x76c5('0xe0')]);var _0x4b1d88=Math['round'](_0x31838c[_0x76c5('0x68')]*(_0x31838c[_0x76c5('0x1a3')]/0x64));var _0x128dc3=Math[_0x76c5('0x1a4')](_0x31838c[_0x76c5('0x68')]*(_0x31838c[_0x76c5('0x1a5')]/0x64));var _0x9852a8=_0x31838c['available']+_0x31838c['talking'];var _0x25b9dd=Math['floor'](_0x31838c[_0x76c5('0x6b')]*_0x31838c['erlangAbandonmentRate']*_0x31838c[_0x76c5('0x65')]*_0x31838c['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x31838c[_0x76c5('0x27')])){if(!_['isUndefined'](_0x31838c[_0x76c5('0x26')])){_0x31838c[_0x76c5('0x26')]=undefined;loggerPredictive[_0x76c5('0x90')](_0x76c5('0x1a6'),_0x76c5('0x1a7'));}if(!_[_0x76c5('0x3c')](_0x31838c[_0x76c5('0x8b')])){loggerPredictive[_0x76c5('0x90')]('[startMethodPredictive][StartProgressive]',_0x76c5('0x1a8'));clearInterval(_0x31838c[_0x76c5('0x8b')]);_0x31838c['handlePredictive']=undefined;}_0x31838c[_0x76c5('0x27')]=moment()[_0x76c5('0x70')](_0x76c5('0xf9'));loggerPredictive[_0x76c5('0x76')](_0x31838c[_0x76c5('0x40')],'collection\x20data\x20in\x20progressive\x20at',_0x31838c[_0x76c5('0x27')]);this['handlePower'](_0x31838c,0x1);}else if(ifInterval(_0x31838c[_0x76c5('0x1a9')],_0x31838c[_0x76c5('0x27')])){this[_0x76c5('0x141')](_0x31838c,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x31838c[_0x76c5('0x27')],_0x31838c[_0x76c5('0x40')]);_0x31838c[_0x76c5('0x6b')]=0x0;_0x31838c['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x1064bf<_0x5b10ca&&_0x31838c[_0x76c5('0x1aa')]===_0x76c5('0x1ab')){freeVariablesPredictive(_0x31838c);loggerPredictive[_0x76c5('0x76')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x76c5('0x1ac'),_0x5b10ca,_0x76c5('0x27'),_0x31838c['name']);}else if(_0x25b9dd<_0x31838c[_0x76c5('0x64')]&&_0x31838c[_0x76c5('0x1aa')]===_0x76c5('0x1ab')){freeVariablesPredictive(_0x31838c);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x1ad'),_0x76c5('0x1ae'),_0x25b9dd,_0x76c5('0x1af'),_0x31838c[_0x76c5('0x64')],_0x76c5('0x27'),_0x31838c['name']);}else if(!ifInterval(_0x31838c['dialPredictiveInterval'],_0x31838c[_0x76c5('0x27')])&&_['isUndefined'](_0x31838c[_0x76c5('0x26')])&&!_['isUndefined'](_0x31838c[_0x76c5('0x27')])){_0x31838c[_0x76c5('0x26')]=moment()[_0x76c5('0x70')](_0x76c5('0xf9'));loggerPredictive['info'](_0x31838c['name'],_0x76c5('0x1b0'),_0x31838c[_0x76c5('0x26')]);this[_0x76c5('0xb8')](_0x31838c['dialPredictiveInterval'])['then'](this[_0x76c5('0x1b1')](_0x31838c))[_0x76c5('0xb1')](mergeDataErlangB(_0x31838c))[_0x76c5('0xb1')](this[_0x76c5('0x1b2')](_0x31838c))[_0x76c5('0xb4')](loggerCatchPredictive(_0x76c5('0x1b3'),_0x31838c));}else if(!ifInterval(_0x31838c[_0x76c5('0x1a9')],_0x31838c[_0x76c5('0x26')])){_0x31838c[_0x76c5('0x64')]=0x0;_0x31838c[_0x76c5('0x26')]=moment()[_0x76c5('0x70')](_0x76c5('0xf9'));loggerPredictive[_0x76c5('0x76')](_0x31838c['name'],_0x76c5('0x1b4'),_0x31838c[_0x76c5('0x26')]);clearInterval(_0x31838c[_0x76c5('0x8b')]);_0x31838c[_0x76c5('0x8b')]=undefined;this[_0x76c5('0xb8')](_0x31838c['dialPredictiveInterval'])[_0x76c5('0xb1')](this[_0x76c5('0x1b1')](_0x31838c))[_0x76c5('0xb1')](mergeDataErlangB(_0x31838c))[_0x76c5('0xb1')](this[_0x76c5('0x1b2')](_0x31838c))[_0x76c5('0xb4')](loggerCatchPredictive(_0x76c5('0x1b5'),_0x31838c));}else if(_0x31838c[_0x76c5('0x68')]&&_0x9852a8<_0x31838c['predictiveIntervalAvailable']-_0x128dc3){freeVariablesPredictive(_0x31838c);loggerPredictive[_0x76c5('0x76')](_0x31838c['name'],_0x76c5('0x1b6'),_0x9852a8,')\x20are\x20less\x20than\x20threshold\x20(',_0x31838c['predictiveIntervalAvailable'],'-',_0x128dc3,'=',_0x31838c[_0x76c5('0x68')]-_0x128dc3,')');}else if(_0x31838c[_0x76c5('0x68')]&&_0x9852a8>_0x31838c['predictiveIntervalAvailable']+_0x4b1d88){freeVariablesPredictive(_0x31838c);loggerPredictive[_0x76c5('0x76')](_0x31838c[_0x76c5('0x40')],_0x76c5('0x1b6'),_0x9852a8,_0x76c5('0x1b7'),_0x31838c[_0x76c5('0x68')],'+',_0x4b1d88,'=',_0x31838c[_0x76c5('0x68')]+_0x4b1d88,')');}};Dialer[_0x76c5('0x1a')][_0x76c5('0x1b1')]=function(_0x379416){var _0x23c85d=this;return function(_0x1eb523){return new BPromise(function(_0x33bafb,_0x38a85b){_[_0x76c5('0xcb')](_0x379416,_0x1eb523[0x0]);if(checkGetDataPredictive(_0x1eb523[0x0])){var _0x3157ee=_0x379416['predictiveIntervalAvailable']=_0x379416['talking']+_0x379416[_0x76c5('0x9b')];var _0x313973=_0x379416[_0x76c5('0x1a9')]*0x3c;var _0x7c577f=_0x1eb523[0x0][_0x76c5('0x7e')]+_0x1eb523[0x0]['predictiveIntervalAvgHoldtime'];var _0x256466=(_0x1eb523[0x0]['predictiveIntervalAnsweredCalls']+_0x1eb523[0x0][_0x76c5('0x62')]+_0x1eb523[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1eb523[0x0]['predictiveIntervalTotalCalls'];_0x379416['predictiveIntervalHitRate']=_0x256466>0x0?_0x256466:0x1;switch(_0x379416[_0x76c5('0x1aa')]){case _0x76c5('0x1ab'):var _0x2f40e7=_0x379416['dialPredictiveOptimizationPercentage']/0x64;return _0x23c85d[_0x76c5('0x1b8')](_0x3157ee,_0x313973,_0x7c577f,_0x256466,_0x2f40e7)[_0x76c5('0xb1')](function(_0x1d4263){return _0x33bafb(_0x1d4263);});case _0x76c5('0x1b9'):var _0x4256c3=_0x379416[_0x76c5('0x1a2')]/0x64;return _0x23c85d[_0x76c5('0x1ba')](_0x3157ee,_0x313973,_0x7c577f,_0x256466,_0x4256c3)[_0x76c5('0xb1')](function(_0x20c49f){return _0x33bafb(_0x20c49f);});default:return _0x38a85b(msgResponse(_0x76c5('0x1bb'),_0x76c5('0x129'),_0x76c5('0x1bc')));}}else{return _0x38a85b(msgResponse(_0x76c5('0x1bb'),_0x76c5('0x129'),_0x76c5('0x1bd')));}});};};Dialer['prototype'][_0x76c5('0x1be')]=function(_0x267777){var _0x1ad908=this;return function(_0x242152){return new BPromise(function(_0x512a6a,_0x907cb1){_[_0x76c5('0xcb')](_0x267777,_0x242152[0x0]);if(checkGetDataPredictive(_0x242152[0x0])){loggerPredictive[_0x76c5('0x76')](JSON[_0x76c5('0x47')](_0x242152[0x0]));if(_0x267777[_0x76c5('0x1aa')]===_0x76c5('0x1ab')){return _0x1ad908[_0x76c5('0xc1')](_0x267777['id'])[_0x76c5('0xb1')](function(_0x5ec3d3){var _0x3184f5=_0x267777['loggedIn']-_0x5ec3d3[0x0][_0x76c5('0x1bf')];var _0x53ee64=_0x267777[_0x76c5('0x1a9')]*0x3c;var _0x52a16c=_0x242152[0x0]['predictiveIntervalAvgTalktime']+_0x242152[0x0][_0x76c5('0x61')];var _0x5d32bb=(_0x242152[0x0][_0x76c5('0x60')]+_0x242152[0x0][_0x76c5('0x62')]+_0x242152[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x242152[0x0][_0x76c5('0x69')];var _0x15607f=_0x267777['dialPredictiveOptimizationPercentage']/0x64;_0x267777['predictiveIntervalPauses']=_0x5ec3d3[0x0][_0x76c5('0x1bf')]||0x0;_0x267777[_0x76c5('0x65')]=_0x5d32bb>0x0?_0x5d32bb:0x1;return _0x1ad908['abandonmentRate'](_0x3184f5,_0x53ee64,_0x52a16c,_0x5d32bb,_0x15607f);})[_0x76c5('0xb1')](function(_0x4ee520){return _0x512a6a(_0x4ee520);})['catch'](function(_0x58f163){return _0x907cb1(msgResponse(_0x76c5('0x1c0'),_0x76c5('0x129'),JSON[_0x76c5('0x47')](_0x58f163)));});}if(_0x267777['dialPredictiveOptimization']===_0x76c5('0x1b9')){return _0x1ad908['getVoiceQueueRtPauses'](_0x267777['id'])['then'](function(_0x349fdd){var _0x577a52=_0x267777[_0x76c5('0x1c1')]-_0x349fdd[0x0][_0x76c5('0x1bf')];var _0x42f857=_0x267777['dialPredictiveInterval']*0x3c;var _0x470cdc=_0x242152[0x0]['predictiveIntervalAvgTalktime']+_0x242152[0x0][_0x76c5('0x61')];var _0xfcd268=(_0x242152[0x0][_0x76c5('0x60')]+_0x242152[0x0][_0x76c5('0x62')]+_0x242152[0x0][_0x76c5('0x7b')])/_0x242152[0x0]['predictiveIntervalTotalCalls'];var _0x2901c8=_0x267777['dialPredictiveOptimizationPercentage']/0x64;_0x267777[_0x76c5('0x67')]=_0x349fdd[0x0][_0x76c5('0x1bf')]||0x0;_0x267777['predictiveIntervalHitRate']=_0xfcd268>0x0?_0xfcd268:0x1;return _0x1ad908[_0x76c5('0x1ba')](_0x577a52,_0x42f857,_0x470cdc,_0xfcd268,_0x2901c8);})['then'](function(_0x35afd0){return _0x512a6a(_0x35afd0);})[_0x76c5('0xb4')](function(_0x24d5a6){return _0x907cb1(msgResponse(_0x76c5('0x1c0'),'Failure',JSON['stringify'](_0x24d5a6)));});}}else{return _0x907cb1(msgResponse(_0x76c5('0x1bb'),_0x76c5('0x129'),'check\x20failure'));}});};};Dialer[_0x76c5('0x1a')][_0x76c5('0x1b2')]=function(_0x432318){var _0x62d2f2=this;return function(){var _0x1fc62d=0x0;var _0x505313=Math[_0x76c5('0x1c2')](_0x432318[_0x76c5('0x6c')]*0x3e8);if(_0x505313>0x0){_0x505313=_0x505313<0x64?0x64:_0x505313;loggerPredictive[_0x76c5('0x76')](_0x432318[_0x76c5('0x40')],_0x76c5('0x1c3'),_0x505313,_0x76c5('0x88'));_0x432318[_0x76c5('0x8b')]=setInterval(function(){_0x62d2f2[_0x76c5('0x8b')](_0x432318);loggerPredictiveCalls[_0x76c5('0x76')]('[handlePredictive]',_0x1fc62d+=0x1);},_0x505313);}else{loggerPredictive['info'](_0x432318[_0x76c5('0x40')],_0x76c5('0x1c4'));}};};Dialer[_0x76c5('0x1a')][_0x76c5('0x1c5')]=function(_0x61a151,_0x2ad2a9){var _0x38d36e=this;return function(_0x2784e4){if(_['isEmpty'](_0x2784e4)){if(_[_0x76c5('0xda')](_0x2ad2a9[_0x76c5('0x1c6')])||!_0x2ad2a9[_0x76c5('0x1c7')]){if(_0x61a151[_0x76c5('0x53')]===_0x76c5('0x8')){_0x61a151[_0x76c5('0x1c8')]=_[_0x76c5('0x3c')](_0x61a151['queueStatusComplete'])?!![]:_0x61a151['queueStatusComplete'];var _0x530aeb=uuid['v4']();_0x38d36e['actions'][_0x530aeb]=new Action(_0x61a151,_0x2ad2a9,_0x530aeb);loggerBooked[_0x76c5('0x76')](_0x76c5('0x1c9'),_0x530aeb,_0x76c5('0x1ca'),JSON['stringify'](_0x61a151[_0x76c5('0x1c8')]),'Queue:\x20',_0x61a151[_0x76c5('0x40')]);if(_0x61a151[_0x76c5('0x1c8')]){_0x61a151[_0x76c5('0x1c8')]=![];_0x38d36e[_0x76c5('0x29')][_0x38d36e[_0x76c5('0x22')][_0x530aeb][_0x76c5('0xae')]]=[];ami['Action']({'actionid':_0x530aeb,'action':_0x76c5('0x1cb'),'queue':_0x61a151[_0x76c5('0x40')]})[_0x76c5('0xb4')](function(_0x1f9716){_0x38d36e['updateOriginated'](_0x61a151);_0x38d36e[_0x76c5('0xba')]({'active':![],'ContactId':_0x38d36e[_0x76c5('0x22')][_0x530aeb]['ContactId'],'ListId':_0x38d36e['actions'][_0x530aeb][_0x76c5('0x11f')],'VoiceQueueId':_0x38d36e[_0x76c5('0x22')][_0x530aeb][_0x76c5('0xce')]||undefined,'CampaignId':_0x38d36e['actions'][_0x530aeb][_0x76c5('0xcf')]||undefined})[_0x76c5('0xb4')](loggerCatch(_0x76c5('0x1cc')));delete _0x38d36e['actions'][_0x530aeb];});}else{loggerBooked[_0x76c5('0x76')](_0x76c5('0x1cd'),JSON[_0x76c5('0x47')](_0x61a151['queueStatusComplete']),_0x76c5('0x1ce'),_0x61a151[_0x76c5('0x40')]);_0x38d36e[_0x76c5('0xad')](_0x61a151);_0x38d36e[_0x76c5('0xba')]({'active':![],'ContactId':_0x38d36e[_0x76c5('0x22')][_0x530aeb][_0x76c5('0xcd')],'ListId':_0x38d36e[_0x76c5('0x22')][_0x530aeb][_0x76c5('0x11f')],'VoiceQueueId':_0x38d36e['actions'][_0x530aeb][_0x76c5('0xce')]||undefined,'CampaignId':_0x38d36e[_0x76c5('0x22')][_0x530aeb][_0x76c5('0xcf')]||undefined})[_0x76c5('0xb4')](loggerCatch(_0x76c5('0x1cc')));delete _0x38d36e[_0x76c5('0x22')][_0x530aeb];}}else{return _0x38d36e[_0x76c5('0x14c')](_0x61a151,_0x2ad2a9);}}else{if(getDiff(_0x2ad2a9[_0x76c5('0x1cf')])<_0x61a151[_0x76c5('0x1d0')]*0x3c){if(_0x2ad2a9[_0x76c5('0x1d1')]&&!_0x2ad2a9[_0x76c5('0x1d1')][_0x76c5('0x1d2')]){_0x38d36e[_0x76c5('0x1d')][_0x76c5('0x11b')](_0x2ad2a9['id'])[_0x76c5('0x11c')](function(){_0x38d36e['updateOriginated'](_0x61a151);});}else{_0x38d36e[_0x76c5('0xbc')]({'active':![]},_0x2ad2a9['id'],0x1)['finally'](function(){console[_0x76c5('0x1d3')](_0x76c5('0x1d4'));_0x38d36e[_0x76c5('0xad')](_0x61a151);});}}else{_0x61a151[_0x76c5('0x1d5')]+=0x1;_0x38d36e['updateOriginated'](_0x61a151);if(_0x61a151[_0x76c5('0x1d6')]){_0x38d36e['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2ad2a9[_0x76c5('0xcd')],'ListId':_0x2ad2a9[_0x76c5('0x11f')],'VoiceQueueId':_0x2ad2a9['VoiceQueueId']||undefined,'CampaignId':_0x2ad2a9[_0x76c5('0xcf')]||undefined})[_0x76c5('0xb4')](loggerCatch(_0x76c5('0x1d7')));_0x38d36e[_0x76c5('0xc4')](createObjHistory(_0x61a151,_0x2ad2a9,_0x76c5('0x1d8'),0x17,_0x76c5('0x1d9')))['catch'](loggerCatch(_0x76c5('0x1da')));}else{_0x38d36e[_0x76c5('0xd8')](createObjHistory(_0x61a151,_0x2ad2a9,_0x76c5('0x1db'),0x16,_0x76c5('0x1dc')),_0x76c5('0x1dd'),_0x76c5('0x1de'));}}}}else{_0x61a151[_0x76c5('0x57')]+=0x1;_0x38d36e['saveInDb'](createObjHistory(_0x61a151,_0x2ad2a9,_0x76c5('0x1df'),0xd,_0x76c5('0x1e0')),_0x76c5('0x1e1'),_0x76c5('0x1e2'));throw'inBlackList';}};};Dialer[_0x76c5('0x1a')][_0x76c5('0x1e3')]=function(_0x2afe44){var _0x1cdb21=this;var _0x1ae77f=[];var _0x3dd47d=_0x2afe44[_0x76c5('0x1e4')]-_0x2afe44['originated']-_0x2afe44[_0x76c5('0x1e5')];emitCampaignSummary(_0x2afe44);if(_0x3dd47d>0x0){if(_0x3dd47d>this[_0x76c5('0x1e6')]){_0x3dd47d=this[_0x76c5('0x1e6')];}_0x2afe44['temp']+=_0x3dd47d;this[_0x76c5('0xc0')](_0x2afe44['id'],_0x3dd47d,_0x2afe44['dialOrderByScheduledAt'])[_0x76c5('0xb1')](function(_0x3ce6b5){_0x2afe44['temp']-=_0x3dd47d;_0x2afe44['temp']=_0x2afe44['temp']>0x0?_0x2afe44[_0x76c5('0x1e5')]:0x0;if(!checkContactEmpty(_0x3ce6b5)){_0x2afe44[_0x76c5('0x3e')]=_0x76c5('0x98');logger[_0x76c5('0x76')]('[getContactCampaign2][Empty]'+_0x2afe44[_0x76c5('0x40')]);}else{_0x2afe44[_0x76c5('0x6a')]+=_0x3ce6b5[_0x76c5('0x116')];_0x2afe44[_0x76c5('0x3e')]=_0x76c5('0x1e7');for(var _0x315693=0x0;_0x315693<_0x3ce6b5[_0x76c5('0x116')];_0x315693+=0x1){_0x2afe44[_0x76c5('0x1e8')]+=0x1;if(_[_0x76c5('0xda')](_0x3ce6b5[_0x315693])||_[_0x76c5('0xda')](_0x3ce6b5[_0x315693][_0x76c5('0x150')])||_[_0x76c5('0xda')](_0x3ce6b5[_0x315693][_0x76c5('0x150')]['phone'])){_0x1cdb21['emptyContact']('[actionOriginate]\x20',_0x2afe44,_0x3ce6b5[_0x315693]);}else{_0x1cdb21[_0x76c5('0xb6')](_[_0x76c5('0xcc')](_0x3ce6b5[_0x315693],['CampaignId',_0x76c5('0x1e9')]))[_0x76c5('0xb1')](_0x1cdb21['checkContactBlack'](_0x2afe44,_0x3ce6b5[_0x315693]))[_0x76c5('0xb4')](_0x1cdb21['loggerHandler'](_0x76c5('0x1ea'),_0x2afe44));}}}})[_0x76c5('0xb4')](loggerGetContactDialer(_0x76c5('0x1eb'),_0x2afe44,_0x3dd47d));}};Dialer[_0x76c5('0x1a')][_0x76c5('0x141')]=function(_0x4ba754,_0x132aeb){var _0xa6f6b7=this;var _0x7ded02=[];var _0x47d674=_0x132aeb>=0x1?_0x132aeb:0x1;var _0x52f832=[];if(_0x4ba754[_0x76c5('0x53')]===_0x76c5('0x8')){_0x47d674=0x1;}var _0x30d101=Math[_0x76c5('0x1c2')](_0x4ba754[_0x76c5('0x9b')]*_0x47d674)-_0x4ba754['originated']-_0x4ba754[_0x76c5('0x1e5')];emitVoiceQueueSummary(_0x4ba754);if(_0x4ba754[_0x76c5('0x1ec')]>0x0){var _0x52e900=_0x4ba754[_0x76c5('0x1ec')]-_0x4ba754['originated']-_0x4ba754['talking']-_0x4ba754[_0x76c5('0x1e5')]-_0x4ba754['pTalking'];if(_0x30d101>_0x52e900){_0x30d101=_0x52e900;}}if(_0x30d101>0x0){if(_0x4ba754[_0x76c5('0x53')]==='booked'){_0x30d101=0x1;}if(_0x30d101>this['maxNumberOriginate']){_0x30d101=this[_0x76c5('0x1e6')];}_0x4ba754['temp']+=_0x30d101;for(var _0x568684 in this[_0x76c5('0x20')]){if(this['agents'][_0x76c5('0xa8')](_0x568684)){if(this['agents'][_0x568684][_0x76c5('0xa1')]==='not_inuse'&&this[_0x76c5('0x20')][_0x568684][_0x76c5('0xd6')]===_0x76c5('0xd4')){_0x7ded02[_0x76c5('0x131')](this[_0x76c5('0x20')][_0x568684]['id']);}}}this[_0x76c5('0xbe')](_0x4ba754['id'],_0x7ded02,_0x30d101,_0x4ba754['dialOrderByScheduledAt'])[_0x76c5('0xb1')](function(_0x558d70){_0x4ba754[_0x76c5('0x1e5')]-=_0x30d101;_0x4ba754['temp']=_0x4ba754[_0x76c5('0x1e5')]>0x0?_0x4ba754[_0x76c5('0x1e5')]:0x0;if(!checkContactEmpty(_0x558d70)){_0xa6f6b7['countReScheduled'](_0x4ba754)['then'](sendMessageReschedule(_0x4ba754))[_0x76c5('0xb4')](loggerCatch(_0x76c5('0x1ed')));}else{_0x4ba754['originated']+=_0x558d70[_0x76c5('0x116')];_0x4ba754[_0x76c5('0x3e')]=_0x4ba754['dialMethod']===_0x76c5('0x8')?'ACTIVE':'RUNNING';for(var _0x135b39=0x0;_0x135b39<_0x558d70[_0x76c5('0x116')];_0x135b39+=0x1){if(_[_0x76c5('0xda')](_0x558d70[_0x135b39])||_[_0x76c5('0xda')](_0x558d70[_0x135b39][_0x76c5('0x150')])||_[_0x76c5('0xda')](_0x558d70[_0x135b39][_0x76c5('0x150')][_0x76c5('0x151')])){_0xa6f6b7[_0x76c5('0xc9')]('[actionOriginate]\x20',_0x4ba754,_0x558d70[_0x135b39]);}else{_0xa6f6b7[_0x76c5('0xb2')](_[_0x76c5('0xcc')](_0x558d70[_0x135b39],[_0x76c5('0xce'),_0x76c5('0x1e9')]))[_0x76c5('0xb1')](_0xa6f6b7[_0x76c5('0x1c5')](_0x4ba754,_0x558d70[_0x135b39]))[_0x76c5('0xb4')](_0xa6f6b7[_0x76c5('0xc8')](_0x76c5('0x1ee'),_0x4ba754));}}}})[_0x76c5('0xb4')](loggerGetContactDialer(_0x76c5('0x1ef'),_0x4ba754,_0x30d101));}};Dialer[_0x76c5('0x1a')]['handlePredictive']=function(_0x3cf41b){var _0x42517a=this;if(_0x3cf41b[_0x76c5('0x1ec')]>0x0){var _0x5174b5=_0x3cf41b[_0x76c5('0x1ec')]-_0x3cf41b[_0x76c5('0x6a')]-_0x3cf41b[_0x76c5('0x4e')];if(_0x5174b5>0x0){this[_0x76c5('0x1f0')](_0x3cf41b);}else{loggerPredictiveCalls[_0x76c5('0x76')](_0x76c5('0x1f1'));}}else{this[_0x76c5('0x1f0')](_0x3cf41b);}};Dialer[_0x76c5('0x1a')][_0x76c5('0x1f0')]=function(_0x12923a){var _0x23c192=this;var _0x4d8c5b=[];_0x12923a['originated']+=0x1;for(var _0x4b0879 in this[_0x76c5('0x20')]){if(this[_0x76c5('0x20')][_0x76c5('0xa8')](_0x4b0879)){if(this['agents'][_0x4b0879][_0x76c5('0xa1')]===_0x76c5('0x1f2')&&this[_0x76c5('0x20')][_0x4b0879][_0x76c5('0xd6')]===_0x76c5('0xd4')){_0x4d8c5b[_0x76c5('0x131')](this[_0x76c5('0x20')][_0x4b0879]['id']);}}}this[_0x76c5('0xbe')](_0x12923a['id'],_0x4d8c5b,0x1,_0x12923a['dialOrderByScheduledAt'])[_0x76c5('0xb1')](function(_0x43ab20){if(!checkContactEmpty(_0x43ab20)){checkContactLowerLimitOriginate(_0x12923a,0x1,0x0);_0x23c192[_0x76c5('0xb0')](_0x12923a)[_0x76c5('0xb1')](sendMessageReschedule(_0x12923a))[_0x76c5('0xb4')](loggerCatch('[countReScheduled]\x20'));}else{_0x12923a[_0x76c5('0x3e')]='RUNNING';if(_[_0x76c5('0xda')](_0x43ab20[0x0])||_['isNil'](_0x43ab20[0x0][_0x76c5('0x150')])||_['isNil'](_0x43ab20[0x0]['Contact'][_0x76c5('0x151')])){_0x23c192[_0x76c5('0xc9')](_0x76c5('0x1ee'),_0x12923a,_0x43ab20[0x0]);}else{_0x23c192[_0x76c5('0xb2')](_[_0x76c5('0xcc')](_0x43ab20[0x0],[_0x76c5('0xce'),_0x76c5('0x1e9')]))[_0x76c5('0xb1')](_0x23c192[_0x76c5('0x1c5')](_0x12923a,_0x43ab20[0x0]))[_0x76c5('0xb4')](_0x23c192[_0x76c5('0xc8')](_0x76c5('0x1f3'),_0x12923a));}}})[_0x76c5('0xb4')](loggerGetContactDialer(_0x76c5('0x1f4'),_0x12923a,0x1));emitVoiceQueueSummary(_0x12923a);};Dialer['prototype'][_0x76c5('0x1b8')]=function(_0x362aeb,_0x4c7ce4,_0x25e972,_0x24e50e,_0x199da2,_0x3e7391){loggerPredictive['info'](_0x76c5('0x1f5'));loggerPredictive[_0x76c5('0x76')]('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',_0x362aeb);loggerPredictive['info'](_0x76c5('0x1f6'),_0x4c7ce4);loggerPredictive['info'](_0x76c5('0x1f7'),_0x25e972);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x1f8'),_0x24e50e);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x1f9'),_0x199da2);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x7f'));return new BPromise(function(_0x5409b8,_0x382733){if(_0x362aeb<=0x0||isNaN(_0x362aeb)){return _0x382733(msgResponse(_0x76c5('0x1fa'),'Error',_0x76c5('0x1fb')+_0x362aeb));}if(_0x25e972<=0x0||isNaN(_0x25e972)){return _0x382733(msgResponse(_0x76c5('0x1fa'),_0x76c5('0x46'),_0x76c5('0x1fc')+_0x25e972));}if(_0x24e50e<=0x0||isNaN(_0x24e50e)){return _0x382733(msgResponse(_0x76c5('0x1fa'),'Error',_0x76c5('0x1fd')+_0x24e50e));}if(_0x4c7ce4<=0x0||isNaN(_0x4c7ce4)){return _0x382733(msgResponse('[abandonmentRate]','Error',_0x76c5('0x1fe')+_0x4c7ce4));}if(_0x199da2<=0x0||isNaN(_0x199da2)){return _0x382733(msgResponse(_0x76c5('0x1fa'),_0x76c5('0x46'),_0x76c5('0x1ff')+_0x199da2));}_0x3e7391=_0x3e7391||0x0;var _0xdbfbb4=0x1/_0x25e972;var _0x44997d=0x0;var _0xce2e74=0x0;var _0x54394a=0x0;var _0x12c307=0x0;for(var _0x2c009e=0x0;_0x54394a<_0x199da2;_0x2c009e+=0x1){_0xce2e74=_0x2c009e/_0x4c7ce4;_0x44997d=(_0x24e50e*_0xce2e74+_0x3e7391)/_0xdbfbb4;_0x54394a=erlangb(_0x44997d,_0x362aeb);_0x12c307=_0x44997d/_0x362aeb*(0x1-erlangb(_0x44997d,_0x362aeb));}return _0x5409b8({'erlangCalls':_0x2c009e,'erlangCallToSecond':_0x4c7ce4/_0x2c009e,'erlangAbandonmentRate':_0x54394a,'erlangBusyFactor':_0x12c307});});};Dialer[_0x76c5('0x1a')]['busyFactor']=function(_0x538290,_0x9759a8,_0x4eae53,_0x313812,_0x3e6be6,_0x17aeba){loggerPredictive[_0x76c5('0x76')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x76c5('0x76')]('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',_0x538290);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x1f6'),_0x9759a8);loggerPredictive[_0x76c5('0x76')]('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',_0x4eae53);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x1f8'),_0x313812);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x200'),_0x3e6be6);loggerPredictive[_0x76c5('0x76')](_0x76c5('0x7f'));return new BPromise(function(_0x438664,_0x13bfbd){if(_0x538290<=0x0||isNaN(_0x538290)){return _0x13bfbd(msgResponse('[busyFactor]',_0x76c5('0x46'),_0x76c5('0x1fb')+_0x538290));}if(_0x4eae53<=0x0||isNaN(_0x4eae53)){return _0x13bfbd(msgResponse(_0x76c5('0x201'),_0x76c5('0x46'),_0x76c5('0x1fc')+_0x4eae53));}if(_0x313812<=0x0||isNaN(_0x313812)){return _0x13bfbd(msgResponse(_0x76c5('0x201'),'Error',_0x76c5('0x1fd')+_0x313812));}if(_0x9759a8<=0x0||isNaN(_0x9759a8)){return _0x13bfbd(msgResponse(_0x76c5('0x201'),'Error',_0x76c5('0x1fe')+_0x9759a8));}if(_0x3e6be6<=0x0||isNaN(_0x3e6be6)){return _0x13bfbd(msgResponse(_0x76c5('0x201'),_0x76c5('0x46'),_0x76c5('0x202')+_0x3e6be6));}_0x17aeba=_0x17aeba||0x0;var _0x2f1462=0x1/_0x4eae53;var _0x3d7ed1=0x0;var _0x5c2190=0x0;var _0x3dada3=0x0;var _0x4582fa=0x0;for(var _0x2223ea=0x0;_0x4582fa<_0x3e6be6;_0x2223ea+=0x1){_0x5c2190=_0x2223ea/_0x9759a8;_0x3d7ed1=(_0x313812*_0x5c2190+_0x17aeba)/_0x2f1462;_0x3dada3=erlangb(_0x3d7ed1,_0x538290);_0x4582fa=_0x3d7ed1/_0x538290*(0x1-erlangb(_0x3d7ed1,_0x538290));}return _0x438664({'erlangCalls':_0x2223ea,'erlangCallToSecond':_0x9759a8/_0x2223ea,'erlangAbandonmentRate':_0x3dada3,'erlangBusyFactor':_0x4582fa});});};module[_0x76c5('0x203')]=Dialer; \ No newline at end of file +var _0xb6ec=['erlangAbandonmentRate','erlangBusyFactor','Trunk','active','voice:queue:%s','voice_queue:save','format','campaign:ivr:%s','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\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','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','isEmpty','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','talking','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','statedesc','endtime','loopClearZombieChannels','clearZombieChannels','[actions]','sequence','enqueue','Action','catch','No\x20such\x20channel','type','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','[averageHandleTime]\x20','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','hasOwnProperty','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isTrunkReachable','status','reachable','SIP/%s','unmonitored','isNil','variable','exten','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','state','HangupInAMD','membername','[syncHangupInAMD][createHistory]','MACHINE','Machine','AMD','amd','[syncMachine][createHistory]','uniqueid','[syncHangupInAMDIvr][createHistory]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','AnswerAGI','AGI','dialQueueProject','outboundUnknownCallsDay','cause-txt','Unknow','[syncHangupIvr]','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','YYYY-MM-DD\x20HH:mm:ss','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','dropreason','Abandoned','CALLEREXIT','channel','actionid','locked','stateinterface','rrmemory','push','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','stringify','pick','run','finally','rescheduleContact','[unlock][syncQueueStatusComplete]','_rr','paused','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','Intervals','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialMethod','loggedIn','checkIsTrunkReachable','dialTimezone','checkIfTimeIntervals','checkDialMethod','[syncQueueSummary]','[syncCampaigns]','pow','random','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','callerid','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','starttime','[originate][error]','Error','originate\x20action\x20Error','responsetime','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','countbusyretry','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','checkRetriveMax','reason\x200\x20no\x20such\x20number....','countglobal','[syncAgentComplete][createHistory][3]','stateGlobal','[syncAgentComplete][createHistory][5]','createStateFinal','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','Drop\x20in\x20this\x20interval','averageHandleTime','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','dialPredictiveOptimizationPercentage','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','busyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','Contact\x20updated','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','RUNNING','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','lodash','bluebird','uuid','moment','md5','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','localhost','socket.io-emitter','redis','../rpc/cmHopperFinal','./action','./history','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','tail','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','syncNewExten','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','[ifTime][Action]','milliseconds','diff','seconds','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond'];(function(_0x88b8e6,_0x4169cf){var _0x4ecd23=function(_0x582635){while(--_0x582635){_0x88b8e6['push'](_0x88b8e6['shift']());}};_0x4ecd23(++_0x4169cf);}(_0xb6ec,0x187));var _0xcb6e=function(_0x598748,_0x4b5c6c){_0x598748=_0x598748-0x0;var _0x2e2096=_0xb6ec[_0x598748];return _0x2e2096;};'use strict';var util=require('util');var _=require(_0xcb6e('0x0'));var BPromise=require(_0xcb6e('0x1'));var uuid=require(_0xcb6e('0x2'));var moment=require(_0xcb6e('0x3'));var rr=require('rr');var md5=require(_0xcb6e('0x4'));var Redis=require('ioredis');var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0xcb6e('0x5'));var loggerBooked=require(_0xcb6e('0x6'))(_0xcb6e('0x7'));var loggerPredictive=require(_0xcb6e('0x6'))(_0xcb6e('0x8'));var loggerPredictiveCalls=require('../../../config/logger')(_0xcb6e('0x9'));var loggerSyncQueueSummary=require(_0xcb6e('0x6'))(_0xcb6e('0xa'));var ami=require(_0xcb6e('0xb'));config['redis']=_[_0xcb6e('0xc')](config['redis'],{'host':_0xcb6e('0xd'),'port':0x18eb});var io=require(_0xcb6e('0xe'))(new Redis(config[_0xcb6e('0xf')]));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xcb6e('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xcb6e('0x11'));var History=require(_0xcb6e('0x12'));var Final=require(_0xcb6e('0x13'));var AgentComplete=require(_0xcb6e('0x14'));var QueueCallerAbandon=require(_0xcb6e('0x15'));var Hangup=require('./hangup');var ipAgi=process[_0xcb6e('0x16')][_0xcb6e('0x17')]||_0xcb6e('0x18');var strategy={'rrmemory':'rrmemory','roundrobin':_0xcb6e('0x19')};var Sequence=function(){};Sequence[_0xcb6e('0x1a')]['enqueue']=function(_0x5eaf0e){this[_0xcb6e('0x1b')]=this['tail']?this[_0xcb6e('0x1b')]['finally'](_0x5eaf0e):_0x5eaf0e();};function Dialer(_0x48eeb3,_0x8b2fe3){this['sequence']=new Sequence();this['preview']=_0x8b2fe3;this['voiceQueues']=_0x48eeb3[_0xcb6e('0x1c')];this[_0xcb6e('0x1d')]=_0x48eeb3['campaigns'];this[_0xcb6e('0x1e')]=_0x48eeb3[_0xcb6e('0x1e')];this[_0xcb6e('0x1f')]=_0x48eeb3['trunks'];this['maxNumberOriginate']=config[_0xcb6e('0x20')]||0x2;this[_0xcb6e('0x21')]={};this[_0xcb6e('0x22')]={};this['contactsId']={};this[_0xcb6e('0x23')]={};this[_0xcb6e('0x24')]={};this[_0xcb6e('0x25')]={};this[_0xcb6e('0x26')]={};this[_0xcb6e('0x27')]={};this[_0xcb6e('0x28')]={};this[_0xcb6e('0x29')]={};ami['on'](_0xcb6e('0x2a'),this[_0xcb6e('0x2b')][_0xcb6e('0x2c')](this));ami['on']('queuecallerabandon',this[_0xcb6e('0x2d')][_0xcb6e('0x2c')](this));ami['on'](_0xcb6e('0x2e'),this[_0xcb6e('0x2f')][_0xcb6e('0x2c')](this));ami['on'](_0xcb6e('0x30'),this[_0xcb6e('0x31')][_0xcb6e('0x2c')](this));ami['on'](_0xcb6e('0x32'),this['syncQueueSummary'][_0xcb6e('0x2c')](this));ami['on'](_0xcb6e('0x33'),this[_0xcb6e('0x34')][_0xcb6e('0x2c')](this));ami['on']('newexten',this[_0xcb6e('0x35')][_0xcb6e('0x2c')](this));ami['on']('varset',this[_0xcb6e('0x36')]['bind'](this));ami['on'](_0xcb6e('0x37'),this[_0xcb6e('0x38')][_0xcb6e('0x2c')](this));ami['on']('queuestatuscomplete',this[_0xcb6e('0x39')][_0xcb6e('0x2c')](this));this[_0xcb6e('0x3a')]();this['loopClearZombieChannels']();}function isNotNull(_0x33f4fa){return _0x33f4fa!==null&&!_[_0xcb6e('0x3b')](_0x33f4fa);}function checkIsLoggedIn(_0x52afbe,_0x2c7c43){return function(){if(_0x2c7c43<=0x0){_0x52afbe[_0xcb6e('0x3c')]=_0xcb6e('0x3d');throw _0x52afbe[_0xcb6e('0x3e')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3789a8){return _0x3789a8;}function checkIsActive(_0x15fd9d,_0x990555){return function(){if(!isActive(_0x990555)){_0x15fd9d[_0xcb6e('0x3c')]=_0xcb6e('0x3f');throw _0x15fd9d[_0xcb6e('0x3e')]+_0xcb6e('0x40');}};}function checkInterval(_0x2f8a42){return function(){if(!isNotNull(_0x2f8a42['Interval'])){_0x2f8a42[_0xcb6e('0x3c')]=_0xcb6e('0x41');throw _0x2f8a42[_0xcb6e('0x3e')]+_0xcb6e('0x42');}if(!isNotNull(_0x2f8a42[_0xcb6e('0x43')]['Intervals'])){_0x2f8a42['message']='INTERVAL_IS_NULL';throw _0x2f8a42[_0xcb6e('0x3e')]+_0xcb6e('0x42');}if(!isNotNull(_['isEmpty'](_0x2f8a42[_0xcb6e('0x43')]['Intervals']))){_0x2f8a42[_0xcb6e('0x3c')]='INTERVAL_IS_NULL';throw _0x2f8a42[_0xcb6e('0x3e')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x7bc9c8,_0x68049,_0x255ad3){return{'action':_0x7bc9c8,'response':_0x68049,'message':_0x255ad3,'stack':_0x255ad3};}function myreject(_0x2a1993){return function(_0x38b4d5){return _0x2a1993(msgResponse(_0xcb6e('0x44'),'Error',JSON['stringify'](_0x38b4d5)));};}function getSeconds(_0x1adc94,_0x2c669a){var _0x3917ca=moment(_0x1adc94)[_0xcb6e('0x45')](0x0);var _0x40757d=moment(_0x2c669a)['milliseconds'](0x0);return _0x3917ca[_0xcb6e('0x46')](_0x40757d,_0xcb6e('0x47'));}function emit(_0x4543f9,_0x4c382c,_0x56fa26){io['to'](_0x4543f9)['emit'](_0x4c382c,_0x56fa26);}function emitVoiceQueueSummary(_0x123402){if(_0x123402['type']===_0xcb6e('0x48')){var _0x404c20={'id':_0x123402['id'],'name':_0x123402[_0xcb6e('0x3e')],'strategy':_0x123402[_0xcb6e('0x49')],'answered':_0x123402[_0xcb6e('0x4a')],'available':_0x123402[_0xcb6e('0x4b')],'loggedIn':_0x123402['loggedIn'],'pTalking':_0x123402[_0xcb6e('0x4c')],'sumBillable':_0x123402[_0xcb6e('0x4d')],'sumDuration':_0x123402[_0xcb6e('0x4e')],'sumHoldTime':_0x123402['sumHoldTime']||0x0,'talking':_0x123402['talking'],'total':_0x123402['total'],'type':_0x123402['type'],'unmanaged':_0x123402['unmanaged'],'abandoned':_0x123402[_0xcb6e('0x4f')],'waiting':_0x123402[_0xcb6e('0x50')],'loggedInDb':_0x123402[_0xcb6e('0x51')],'dialActive':_0x123402[_0xcb6e('0x52')],'dialMethod':_0x123402['dialMethod'],'dialOriginateCallerIdName':_0x123402['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x123402[_0xcb6e('0x53')],'dialOriginateTimeout':_0x123402['dialOriginateTimeout'],'dialPrefix':_0x123402[_0xcb6e('0x54')],'outboundAnswerAgiCallsDay':_0x123402[_0xcb6e('0x55')],'outboundAnswerCallsDay':_0x123402['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x123402[_0xcb6e('0x56')],'outboundBusyCallsDay':_0x123402[_0xcb6e('0x57')],'outboundCongestionCallsDay':_0x123402[_0xcb6e('0x58')],'outboundDropCallsDayACS':_0x123402[_0xcb6e('0x59')],'outboundDropCallsDayCallersExit':_0x123402[_0xcb6e('0x5a')],'outboundDropCallsDayTimeout':_0x123402[_0xcb6e('0x5b')],'outboundNoAnswerCallsDay':_0x123402[_0xcb6e('0x5c')],'outboundNoSuchCallsDay':_0x123402[_0xcb6e('0x5d')],'outboundOriginateFailureCallsDay':_0x123402['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x123402['outboundReCallsDay'],'outboundRejectCallsDay':_0x123402['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x123402['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x123402[_0xcb6e('0x5e')],'predictiveIntervalAvgHoldtime':_0x123402['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x123402[_0xcb6e('0x5f')],'predictiveIntervalDroppedCallsCallersExit':_0x123402[_0xcb6e('0x60')],'predictiveIntervalDroppedCallsTimeout':_0x123402['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x123402['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x123402[_0xcb6e('0x61')],'predictiveIntervalHitRate':_0x123402[_0xcb6e('0x62')],'predictiveIntervalMultiplicativeFactor':_0x123402[_0xcb6e('0x63')],'predictiveIntervalPauses':_0x123402['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x123402[_0xcb6e('0x64')],'predictiveIntervalTotalCalls':_0x123402[_0xcb6e('0x65')],'message':_0x123402[_0xcb6e('0x3c')],'originated':_0x123402['originated'],'erlangCalls':_0x123402[_0xcb6e('0x66')],'erlangCallToSecond':_0x123402[_0xcb6e('0x67')],'erlangAbandonmentRate':_0x123402[_0xcb6e('0x68')],'erlangBusyFactor':_0x123402[_0xcb6e('0x69')],'startPredictive':_0x123402['startPredictive'],'startProgressive':_0x123402['startProgressive']};if(_0x123402[_0xcb6e('0x6a')]){_0x404c20[_0xcb6e('0x6a')]={'id':_0x123402[_0xcb6e('0x6a')]['id'],'name':_0x123402['Trunk'][_0xcb6e('0x3e')],'active':_0x123402[_0xcb6e('0x6a')][_0xcb6e('0x6b')],'callerid':_0x123402[_0xcb6e('0x6a')]['callerid']};}if(_0x123402[_0xcb6e('0x43')]){_0x404c20[_0xcb6e('0x43')]={'id':_0x123402['Interval']['id'],'name':_0x123402['Interval'][_0xcb6e('0x3e')]};}var _0x21c656=md5(JSON['stringify'](_0x404c20));if(_0x123402[_0xcb6e('0x4')]!==_0x21c656){_0x123402[_0xcb6e('0x4')]=_0x21c656;emit(util['format'](_0xcb6e('0x6c'),_0x404c20['name']),_0xcb6e('0x6d'),_0x404c20);}}}function emitCampaignSummary(_0x454087){if(_0x454087['type']==='ivr'){emit(util[_0xcb6e('0x6e')](_0xcb6e('0x6f'),_0x454087[_0xcb6e('0x3e')]),'campaign:save',_0x454087);}}function checkGetDataPredictive(_0x43f6ad){if(isNotNull(_0x43f6ad)){if(!_['isEmpty'](_0x43f6ad)){loggerPredictive['info'](_0xcb6e('0x70'));loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x72'),_0x43f6ad[_0xcb6e('0x65')]);loggerPredictive[_0xcb6e('0x71')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x43f6ad['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x73'),_0x43f6ad['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x74'),_0x43f6ad[_0xcb6e('0x60')]);loggerPredictive['info'](_0xcb6e('0x75'),_0x43f6ad[_0xcb6e('0x76')]);loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x77'),_0x43f6ad['predictiveIntervalAvgTalktime']);loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x78'));if(_0x43f6ad[_0xcb6e('0x65')]>0x0){if(!_[_0xcb6e('0x3b')](_0x43f6ad[_0xcb6e('0x5f')])&&_0x43f6ad[_0xcb6e('0x5f')]>0x0){return!![];}else{loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x79'));}if(!_[_0xcb6e('0x3b')](_0x43f6ad[_0xcb6e('0x76')])&&_0x43f6ad[_0xcb6e('0x76')]>0x0){return!![];}else{loggerPredictive[_0xcb6e('0x71')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xcb6e('0x71')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x7a'));}}else{loggerPredictive[_0xcb6e('0x71')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xd3f3c2){return function(_0x4bf925){loggerPredictive['info'](_0xcb6e('0x7b'));loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x7c'),_0x4bf925['erlangCalls']);loggerPredictive['info'](_0xcb6e('0x7d'),_0x4bf925[_0xcb6e('0x67')]);loggerPredictive[_0xcb6e('0x71')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4bf925[_0xcb6e('0x68')]);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4bf925['erlangBusyFactor']);loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x7e'),_0x4bf925[_0xcb6e('0x68')]);loggerPredictive['info'](_0xcb6e('0x78'));_[_0xcb6e('0x7f')](_0xd3f3c2,_0x4bf925);};}function getDiff(_0x358a71){var _0x31c123=moment()[_0xcb6e('0x45')](0x0);var _0xfb5bda=moment(_0x358a71)['milliseconds'](0x0);return _0x31c123[_0xcb6e('0x46')](_0xfb5bda,_0xcb6e('0x47'));}function ifInterval(_0x3e69d3,_0x88e5cc){if(_[_0xcb6e('0x3b')](_0x88e5cc)){return![];}if(getDiff(_0x88e5cc)<_0x3e69d3*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x9a4ea3){if(isNotNull(_0x9a4ea3)){if(!_[_0xcb6e('0x3b')](_0x9a4ea3[_0xcb6e('0x26')])){_0x9a4ea3['startProgressive']=undefined;loggerPredictive[_0xcb6e('0x71')](_0x9a4ea3['name'],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xcb6e('0x3b')](_0x9a4ea3[_0xcb6e('0x25')])){_0x9a4ea3[_0xcb6e('0x25')]=undefined;loggerPredictive[_0xcb6e('0x71')](_0x9a4ea3[_0xcb6e('0x3e')],_0xcb6e('0x80'));}if(!_[_0xcb6e('0x3b')](_0x9a4ea3[_0xcb6e('0x81')])){clearInterval(_0x9a4ea3['handlePredictive']);_0x9a4ea3[_0xcb6e('0x81')]=undefined;loggerPredictive[_0xcb6e('0x71')](_0x9a4ea3[_0xcb6e('0x3e')],_0xcb6e('0x82'));}}}function erlangb(_0x16ad7f,_0x4c0a73){if(_0x4c0a73===0x0){return 0x0;}var _0x66036a=0x1;for(var _0x430d46=0x1;_0x430d46<=_0x4c0a73;_0x430d46+=0x1){_0x66036a=0x1+_0x66036a*_0x430d46/_0x16ad7f;}return 0x1/_0x66036a;}function isVoiceQueueOutbound(_0x4f64d9){return _0x4f64d9==='outbound';}function isNotPreview(_0x16bdd0){return _0x16bdd0!==_0xcb6e('0x83');}function isCampaignIvr(_0x39b19f){return _0x39b19f===_0xcb6e('0x84');}function getCallerId(_0x564e6b,_0x2de3bc,_0x384c9a){if(!_[_0xcb6e('0x3b')](_0x384c9a)&&'string'===typeof _0x384c9a&&!_[_0xcb6e('0x85')](_0x384c9a)){if(!_[_0xcb6e('0x3b')](_0x2de3bc)&&_0xcb6e('0x86')===typeof _0x2de3bc&&!_[_0xcb6e('0x85')](_0x2de3bc)){return util[_0xcb6e('0x6e')]('\x22%s\x22\x20<%s>',_0x2de3bc,_0x384c9a);}return util[_0xcb6e('0x6e')](_0xcb6e('0x87'),_0x384c9a,_0x384c9a);}if(!_[_0xcb6e('0x3b')](_0x564e6b)&&_0xcb6e('0x86')===typeof _0x564e6b&&!_[_0xcb6e('0x85')](_0x564e6b)){return _0x564e6b;}return _0xcb6e('0x88');}function loggerCatchQueueSummary(_0x29b24d,_0x2130fa){return function(_0x42a6e9){freeVariablesPredictive(_0x2130fa);emitVoiceQueueSummary(_0x2130fa);emitCampaignSummary(_0x2130fa);loggerSyncQueueSummary[_0xcb6e('0x89')](_0x29b24d,util[_0xcb6e('0x8a')](_0x42a6e9,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xa979ca,_0x501c6f){return function(_0x4e94a8){loggerPredictive['error'](_0x501c6f[_0xcb6e('0x3e')],_0xa979ca);loggerPredictive[_0xcb6e('0x89')](_0x4e94a8[_0xcb6e('0x8b')]);freeVariablesPredictive(_0x501c6f);};}function loggerCatch(_0x263a2a){return function(_0x13a3ed){logger[_0xcb6e('0x89')](_0x263a2a,util[_0xcb6e('0x8a')](_0x13a3ed,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x539433){return _0x539433&&!_[_0xcb6e('0x3b')](_0x539433)&&_0x539433[_0xcb6e('0x8c')]>0x0;}function decremetOriginate(_0x1f6e17){if(!_[_0xcb6e('0x3b')](_0x1f6e17)&&_0x1f6e17!==null){if(_0x1f6e17['hasOwnProperty'](_0xcb6e('0x8d'))){if(_0x1f6e17['originated']>0x0){_0x1f6e17['originated']-=0x1;}else{logger[_0xcb6e('0x89')](_0xcb6e('0x8e'));}}}else{logger['error'](_0xcb6e('0x8f'));}}function checkContactLowerLimitOriginate(_0x32fa75,_0x3e41ec,_0x22750b){if(_0x3e41ec>_0x22750b){for(var _0x290912=0x0;_0x290912<_0x3e41ec-_0x22750b;_0x290912+=0x1){decremetOriginate(_0x32fa75);}}}function loggerGetContactDialer(_0x3274af,_0x2abd38,_0x438b49){return function(_0x469c3b){checkContactLowerLimitOriginate(_0x2abd38,_0x438b49,0x0);logger[_0xcb6e('0x89')](_0x3274af,util[_0xcb6e('0x8a')](_0x469c3b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xfef00e){return function(_0x3a1bb3){if(isNotNull(_0x3a1bb3)&&isNotNull(_0x3a1bb3[0x0])){if(_0x3a1bb3[0x0][_0xcb6e('0x90')]>0x0){_0xfef00e['message']=_0xcb6e('0x91');logger[_0xcb6e('0x71')](_0xcb6e('0x92')+_0xfef00e[_0xcb6e('0x3e')],_0x3a1bb3[0x0][_0xcb6e('0x90')],'contacts');}else{_0xfef00e[_0xcb6e('0x3c')]=_0xcb6e('0x93');logger[_0xcb6e('0x71')](_0xcb6e('0x94')+_0xfef00e['name']);}}};}function notSendMessagesQueue(_0x4952ad){if(_0x4952ad['sendMessageOneNotActive']){freeVariablesPredictive(_0x4952ad);if(_0x4952ad[_0xcb6e('0x8d')]===0x0&&_0x4952ad[_0xcb6e('0x95')]===0x0&&_0x4952ad[_0xcb6e('0x50')]===0x0&&(_0x4952ad[_0xcb6e('0x4c')]||0x0)===0x0){_0x4952ad[_0xcb6e('0x96')]=![];_0x4952ad[_0xcb6e('0x4b')]=0x0;_0x4952ad[_0xcb6e('0x3c')]=_0xcb6e('0x3f');loggerSyncQueueSummary['error'](_0xcb6e('0x97'),_0x4952ad['name'],'is\x20not\x20active');}else{_0x4952ad[_0xcb6e('0x3c')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xcb6e('0x89')](_0xcb6e('0x97'),_0x4952ad[_0xcb6e('0x3e')],'is\x20disactive');}emitVoiceQueueSummary(_0x4952ad);}}function notSendMessagesCampaign(_0x3a66db){if(_0x3a66db[_0xcb6e('0x96')]){if(_0x3a66db[_0xcb6e('0x8d')]===0x0){_0x3a66db[_0xcb6e('0x96')]=![];_0x3a66db['message']=_0xcb6e('0x3f');loggerSyncQueueSummary[_0xcb6e('0x89')](_0xcb6e('0x98'),_0x3a66db['name'],'is\x20not\x20active');}else{_0x3a66db[_0xcb6e('0x3c')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xcb6e('0x89')](_0xcb6e('0x98'),_0x3a66db[_0xcb6e('0x3e')],_0xcb6e('0x99'));}emitCampaignSummary(_0x3a66db);}}function createObjHistory(_0x9901d7,_0x3405ac,_0x5244aa,_0x1843ed,_0x473fae){_0x9901d7['message']=_0x5244aa;var _0x2dd189=new Action(_0x9901d7,_0x3405ac);var _0x2042e9=new History(_0x2dd189);_0x2042e9['state']=_0x1843ed;_0x2042e9[_0xcb6e('0x9a')]=_0x473fae;_0x2042e9[_0xcb6e('0x9b')]=_0x2dd189['starttime'];return _0x2042e9;}Dialer[_0xcb6e('0x1a')][_0xcb6e('0x9c')]=function(){var _0x2e89b6=this;setInterval(function(){_0x2e89b6[_0xcb6e('0x9d')](_0x2e89b6['uniqueId'],'[uniqueid]');_0x2e89b6[_0xcb6e('0x9d')](_0x2e89b6[_0xcb6e('0x22')],_0xcb6e('0x9e'));},0x32c8);};Dialer[_0xcb6e('0x1a')][_0xcb6e('0x9d')]=function(_0x518b16,_0x1fbe37){var _0x7e8873=this;for(var _0x2cbdf4 in _0x518b16){if(_0x518b16['hasOwnProperty'](_0x2cbdf4)){this[_0xcb6e('0x9f')][_0xcb6e('0xa0')](function(){if(!_['isNil'](_0x518b16[_0x2cbdf4])){return ami[_0xcb6e('0xa1')]({'action':'status','channel':_0x518b16[_0x2cbdf4]['channel']})[_0xcb6e('0xa2')](function(_0x478fd7){if(_0x478fd7[_0xcb6e('0x3c')]===_0xcb6e('0xa3')){setTimeout(function(){if(_0x518b16[_0x2cbdf4]&&_0x518b16[_0x2cbdf4][_0xcb6e('0xa4')]!==_0xcb6e('0x84')){_0x7e8873[_0xcb6e('0xa5')](_0x7e8873[_0xcb6e('0x1c')][_0x518b16[_0x2cbdf4]['queue']]);logger[_0xcb6e('0x89')](_0xcb6e('0xa6'),_0x1fbe37,_0x2cbdf4,_0x518b16[_0x2cbdf4][_0xcb6e('0xa7')]);delete _0x518b16[_0x2cbdf4];}if(_0x518b16[_0x2cbdf4]&&_0x518b16[_0x2cbdf4][_0xcb6e('0xa4')]===_0xcb6e('0x84')){_0x7e8873[_0xcb6e('0xa5')](_0x7e8873[_0xcb6e('0x1d')][_0x518b16[_0x2cbdf4]['queue']]);logger[_0xcb6e('0x89')](_0xcb6e('0xa8'),_0x1fbe37,_0x2cbdf4,_0x518b16[_0x2cbdf4][_0xcb6e('0xa7')]);delete _0x518b16[_0x2cbdf4];}},0x2328);}});}});}}};Dialer['prototype'][_0xcb6e('0xa9')]=function(_0x40c463){return BPromise[_0xcb6e('0xaa')]()['then'](cmHopper[_0xcb6e('0xa9')](_0x40c463))['catch'](loggerCatch(_0xcb6e('0xab')));};Dialer[_0xcb6e('0x1a')]['checkIsBlackList']=function(_0x49ecc9){return BPromise[_0xcb6e('0xaa')]()[_0xcb6e('0xac')](cmHopperBlack[_0xcb6e('0xad')](_0x49ecc9))[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0xae')));};Dialer[_0xcb6e('0x1a')][_0xcb6e('0xaf')]=function(_0x227443){return BPromise['resolve']()[_0xcb6e('0xac')](cmHopperBlack['checkIsBlackListIvr'](_0x227443))[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0xb0')));};Dialer[_0xcb6e('0x1a')]['averageHandleTime']=function(_0x15e46c){return BPromise[_0xcb6e('0xaa')]()[_0xcb6e('0xac')](cmHopperHistory['avgHandleTime'](_0x15e46c))[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0xb1')));};Dialer[_0xcb6e('0x1a')]['rescheduleContact']=function(_0x132efa){return BPromise[_0xcb6e('0xaa')]()[_0xcb6e('0xac')](cmHopper['rescheduleContact'](_0x132efa))[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0xb2')));};Dialer[_0xcb6e('0x1a')][_0xcb6e('0xb3')]=function(_0x354caf,_0x17438f,_0x141b1d){return BPromise[_0xcb6e('0xaa')]()[_0xcb6e('0xac')](cmHopper[_0xcb6e('0xb3')](_0x354caf,_0x17438f,_0x141b1d))[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0xb4')));};Dialer[_0xcb6e('0x1a')][_0xcb6e('0xb5')]=function(_0x300b73,_0x37367c,_0xf8be74,_0x150861){return BPromise[_0xcb6e('0xaa')]()[_0xcb6e('0xac')](cmHopper[_0xcb6e('0xb5')](_0x300b73,_0x37367c,_0xf8be74,_0x150861))[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0xb6')));};Dialer['prototype']['getContactDialerIvr']=function(_0x467ca8,_0x7e1872,_0x5ceb37){return BPromise['resolve']()[_0xcb6e('0xac')](cmHopper['getContactDialerIvr'](_0x467ca8,_0x7e1872,_0x5ceb37))['catch'](loggerCatch(_0xcb6e('0xb6')));};Dialer[_0xcb6e('0x1a')][_0xcb6e('0xb7')]=function(_0x482121){return BPromise[_0xcb6e('0xaa')]()[_0xcb6e('0xac')](voiceQueueRt['getVoiceQueueRtPauses'](_0x482121))[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0xb8')));};Dialer[_0xcb6e('0x1a')][_0xcb6e('0xb9')]=function(_0x428f51){return BPromise[_0xcb6e('0xaa')]()[_0xcb6e('0xac')](cmHopper[_0xcb6e('0xb9')](_0x428f51))[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0xba')));};Dialer['prototype']['createHistory']=function(_0x9d8bc9){return BPromise[_0xcb6e('0xaa')]()[_0xcb6e('0xac')](cmHopperHistory[_0xcb6e('0xbb')](_0x9d8bc9))[_0xcb6e('0xa2')](loggerCatch('[createHistory]\x20'));};Dialer['prototype']['updateOriginated']=function(_0x2b073f){if(!_[_0xcb6e('0x3b')](_0x2b073f)&&_0x2b073f!==null){if(_0x2b073f[_0xcb6e('0xbc')](_0xcb6e('0x8d'))){if(_0x2b073f['originated']>0x0){_0x2b073f[_0xcb6e('0x8d')]-=0x1;}else{logger[_0xcb6e('0x89')](_0xcb6e('0xbd'));}}}else{logger[_0xcb6e('0x89')](_0xcb6e('0xbe'));}};Dialer[_0xcb6e('0x1a')][_0xcb6e('0xbf')]=function(_0x5338ec,_0x553405){var _0x2ffdf5=this;return function(_0x50fb3c){_0x2ffdf5['updateOriginated'](_0x553405);logger[_0xcb6e('0x89')](_0x5338ec,util[_0xcb6e('0x8a')](_0x50fb3c,{'showHidden':![],'depth':null}));};};Dialer[_0xcb6e('0x1a')][_0xcb6e('0xc0')]=function(_0x304fcd,_0x5d39e2,_0x105606){var _0x4eed20={'state':0x19,'statedesc':_0xcb6e('0xc1')};this['updateOriginated'](_0x5d39e2);this[_0xcb6e('0xc2')](_[_0xcb6e('0x7f')](_0x4eed20,_['pick'](_0x105606,[_0xcb6e('0xc3'),_0xcb6e('0xc4'),_0xcb6e('0xc5'),_0xcb6e('0xc6'),_0xcb6e('0xc7')])),'[emptyContact][createHistory]',_0xcb6e('0xc8'));logger['error'](_0x304fcd);};Dialer['prototype']['isSuccess']=function(_0x57e87c){return _0x57e87c==='Success';};Dialer[_0xcb6e('0x1a')][_0xcb6e('0xc9')]=function(_0x550c26){return!_[_0xcb6e('0x3b')](_0x550c26)&&_0x550c26&&!_[_0xcb6e('0x3b')](_0x550c26[_0xcb6e('0x3e')])&&!_[_0xcb6e('0x3b')](_0x550c26[_0xcb6e('0x6b')])&&_0x550c26[_0xcb6e('0x6b')]&&(this['trunks'][util['format']('SIP/%s',_0x550c26[_0xcb6e('0x3e')])][_0xcb6e('0xca')]===_0xcb6e('0xcb')||this['trunks'][util[_0xcb6e('0x6e')](_0xcb6e('0xcc'),_0x550c26[_0xcb6e('0x3e')])]['status']===_0xcb6e('0xcd'));};Dialer['prototype']['saveInDb']=function(_0x1bdf56,_0xdf422b,_0x180815){this[_0xcb6e('0xbb')](_0x1bdf56)[_0xcb6e('0xa2')](loggerCatch(_0xdf422b));this['moveContactManagedDialer'](_0x1bdf56)['catch'](loggerCatch(_0x180815));};Dialer[_0xcb6e('0x1a')]['syncVarSet']=function(_0x93f01f){var _0x4f01be=this[_0xcb6e('0x23')][_0x93f01f['uniqueid']];var _0x3c8dc6;if(!_[_0xcb6e('0xce')](_0x93f01f)&&!_['isNil'](_0x93f01f[_0xcb6e('0xcf')])&&!_[_0xcb6e('0xce')](_0x93f01f[_0xcb6e('0xcf')]['amdstatus'])&&_0x93f01f[_0xcb6e('0xd0')]==='xcally-motion-dialer'&&_0x4f01be){if(_0x4f01be[_0xcb6e('0xa4')]!==_0xcb6e('0x84')&&this['voiceQueues'][_0x4f01be[_0xcb6e('0xa7')]][_0xcb6e('0xd1')]&&_0x93f01f[_0xcb6e('0xd2')]===_0xcb6e('0xd3')){delete this[_0xcb6e('0x23')][_0x93f01f['uniqueid']];this[_0xcb6e('0xa5')](this[_0xcb6e('0x1c')][_0x4f01be[_0xcb6e('0xa7')]]);this[_0xcb6e('0x1c')][_0x4f01be[_0xcb6e('0xa7')]][_0xcb6e('0xd4')]+=0x1;this[_0xcb6e('0x1c')][_0x4f01be['queue']][_0xcb6e('0x55')]+=0x1;_0x3c8dc6=new Hangup(_0x4f01be,_0x93f01f);_0x3c8dc6[_0xcb6e('0xd5')]=0x12;_0x3c8dc6[_0xcb6e('0x9a')]=_0xcb6e('0xd6');_0x3c8dc6[_0xcb6e('0xd7')]='AMD';this[_0xcb6e('0xc2')](_0x3c8dc6,_0xcb6e('0xd8'),'[syncHangupInAMD]');}if(_0x4f01be[_0xcb6e('0xa4')]!==_0xcb6e('0x84')&&this[_0xcb6e('0x1c')][_0x4f01be[_0xcb6e('0xa7')]][_0xcb6e('0xd1')]&&_0x93f01f[_0xcb6e('0xd2')]===_0xcb6e('0xd9')){delete this[_0xcb6e('0x23')][_0x93f01f['uniqueid']];this['updateOriginated'](this[_0xcb6e('0x1c')][_0x4f01be[_0xcb6e('0xa7')]]);this[_0xcb6e('0x1c')][_0x4f01be[_0xcb6e('0xa7')]][_0xcb6e('0xd4')]+=0x1;this[_0xcb6e('0x1c')][_0x4f01be[_0xcb6e('0xa7')]][_0xcb6e('0x55')]+=0x1;_0x3c8dc6=new Hangup(_0x4f01be,_0x93f01f);_0x3c8dc6[_0xcb6e('0xd5')]=0x13;_0x3c8dc6[_0xcb6e('0x9a')]=_0xcb6e('0xda');_0x3c8dc6[_0xcb6e('0xd7')]=_0xcb6e('0xdb');_0x3c8dc6[_0xcb6e('0xdc')]=!![];this['saveInDb'](_0x3c8dc6,_0xcb6e('0xdd'),'[syncMachine]');}if(_0x4f01be['type']===_0xcb6e('0x84')&&this[_0xcb6e('0x1d')][_0x4f01be['queue']][_0xcb6e('0xd1')]&&_0x93f01f[_0xcb6e('0xd2')]==='HANGUP'){delete this[_0xcb6e('0x23')][_0x93f01f[_0xcb6e('0xde')]];this[_0xcb6e('0xa5')](this[_0xcb6e('0x1d')][_0x4f01be[_0xcb6e('0xa7')]]);_0x3c8dc6=new Hangup(_0x4f01be,_0x93f01f);_0x3c8dc6['state']=0x12;_0x3c8dc6['statedesc']=_0xcb6e('0xd6');_0x3c8dc6[_0xcb6e('0xd7')]=_0xcb6e('0xdb');this[_0xcb6e('0xc2')](_0x3c8dc6,_0xcb6e('0xdf'),'[syncHangupInAMDIvr]');}if(_0x4f01be['type']===_0xcb6e('0x84')&&this[_0xcb6e('0x1d')][_0x4f01be[_0xcb6e('0xa7')]][_0xcb6e('0xd1')]&&_0x93f01f[_0xcb6e('0xd2')]===_0xcb6e('0xd9')){delete this[_0xcb6e('0x23')][_0x93f01f[_0xcb6e('0xde')]];this[_0xcb6e('0xa5')](this['campaigns'][_0x4f01be[_0xcb6e('0xa7')]]);_0x3c8dc6=new Hangup(_0x4f01be,_0x93f01f);_0x3c8dc6[_0xcb6e('0xd5')]=0x13;_0x3c8dc6[_0xcb6e('0x9a')]='Machine';_0x3c8dc6[_0xcb6e('0xd7')]=_0xcb6e('0xdb');_0x3c8dc6[_0xcb6e('0xdc')]=!![];this[_0xcb6e('0xc2')](_0x3c8dc6,'[syncMachineIvr][createHistory]','[syncMachineIvr]');}}};Dialer[_0xcb6e('0x1a')][_0xcb6e('0x34')]=function(_0x11f832){var _0x3adb6c=this['uniqueId'][_0x11f832[_0xcb6e('0xde')]];var _0x32f956=this;var _0x17369e;if(_0x3adb6c&&_0x3adb6c[_0xcb6e('0xa4')]===_0xcb6e('0x84')){delete this['uniqueId'][_0x11f832[_0xcb6e('0xde')]];this[_0xcb6e('0xa5')](this[_0xcb6e('0x1d')][_0x3adb6c[_0xcb6e('0xa7')]]);this[_0xcb6e('0x1d')][_0x3adb6c[_0xcb6e('0xa7')]][_0xcb6e('0xe0')]+=0x1;_0x17369e=new Hangup(_0x3adb6c,_0x11f832);this[_0xcb6e('0xbb')](_0x17369e)['catch'](loggerCatch(_0xcb6e('0xe1')));this[_0xcb6e('0xb9')](_0x17369e)[_0xcb6e('0xa2')](loggerCatch('[syncHangupIvr]'));}if(_0x3adb6c&&_0x3adb6c[_0xcb6e('0xa4')]!==_0xcb6e('0x84')&&isNotNull(this[_0xcb6e('0x1c')][_0x3adb6c[_0xcb6e('0xa7')]]['dialQueueProject'])){delete this[_0xcb6e('0x23')][_0x11f832['uniqueid']];this[_0xcb6e('0xa5')](this[_0xcb6e('0x1c')][_0x3adb6c[_0xcb6e('0xa7')]]);this['voiceQueues'][_0x3adb6c['queue']][_0xcb6e('0xd4')]+=0x1;this[_0xcb6e('0x1c')][_0x3adb6c[_0xcb6e('0xa7')]][_0xcb6e('0x55')]+=0x1;_0x17369e=new Hangup(_0x3adb6c,_0x11f832);_0x17369e[_0xcb6e('0xd5')]=0x10;_0x17369e[_0xcb6e('0x9a')]=_0xcb6e('0xe2');_0x17369e['membername']=_0xcb6e('0xe3');this[_0xcb6e('0xbb')](_0x17369e)[_0xcb6e('0xa2')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x17369e)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x3adb6c&&_0x3adb6c['type']!==_0xcb6e('0x84')&&!isNotNull(this[_0xcb6e('0x1c')][_0x3adb6c[_0xcb6e('0xa7')]][_0xcb6e('0xe4')])){delete this[_0xcb6e('0x23')][_0x11f832['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x3adb6c[_0xcb6e('0xa7')]]);this['voiceQueues'][_0x3adb6c[_0xcb6e('0xa7')]][_0xcb6e('0xe5')]+=0x1;_0x17369e=new Hangup(_0x3adb6c,_0x11f832);_0x17369e['state']=0xc;_0x17369e[_0xcb6e('0x9a')]=_0x11f832[_0xcb6e('0xe6')];_0x17369e[_0xcb6e('0xd7')]=_0xcb6e('0xe7');this[_0xcb6e('0xbb')](_0x17369e)['catch'](loggerCatch(_0xcb6e('0xe1')));this[_0xcb6e('0xb9')](_0x17369e)[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0xe8')));}};Dialer[_0xcb6e('0x1a')][_0xcb6e('0x31')]=function(_0xb6b419){var _0x544106=this[_0xcb6e('0x23')][_0xb6b419['uniqueid']];var _0xcdd719=this;if(this[_0xcb6e('0x1c')][_0xb6b419['queue']]){if(_0x544106&&_0x544106['type']!==_0xcb6e('0x84')){delete this['uniqueId'][_0xb6b419['uniqueid']];this['voiceQueues'][_0xb6b419['queue']]['outboundAnswerCallsDay']+=0x1;var _0x40a767=new AgentComplete(_0x544106,_0xb6b419);if(_0xb6b419[_0xcb6e('0xe9')]==='agent'){_0x40a767[_0xcb6e('0xea')]=this[_0xcb6e('0x1c')][_0xb6b419[_0xcb6e('0xa7')]][_0xcb6e('0xeb')]&&this[_0xcb6e('0x1c')][_0xb6b419[_0xcb6e('0xa7')]][_0xcb6e('0xec')]?moment()[_0xcb6e('0x6e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xcb6e('0xbb')](_0x40a767)[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0xed')));this['moveContactManagedDialer'](_0x40a767)[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0xee')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x2138d1){if(this[_0xcb6e('0x1c')][_0x2138d1['queue']]){if(this[_0xcb6e('0x23')][_0x2138d1['uniqueid']]&&this[_0xcb6e('0x23')][_0x2138d1['uniqueid']][_0xcb6e('0xa4')]!==_0xcb6e('0x84')){this[_0xcb6e('0xa5')](this['voiceQueues'][_0x2138d1[_0xcb6e('0xa7')]]);this[_0xcb6e('0x23')][_0x2138d1[_0xcb6e('0xde')]][_0xcb6e('0xef')]=moment()['format'](_0xcb6e('0xf0'));}}};Dialer['prototype'][_0xcb6e('0xf1')]=function(_0x14ec1a){this[_0xcb6e('0xbb')](_0x14ec1a)[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0xed')));this[_0xcb6e('0xb9')](_0x14ec1a)[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0xf2')));};Dialer[_0xcb6e('0x1a')][_0xcb6e('0x2d')]=function(_0x2a2c7e){var _0x6f442=this[_0xcb6e('0x23')][_0x2a2c7e[_0xcb6e('0xde')]];var _0x5239f2=this;if(this[_0xcb6e('0x1c')][_0x2a2c7e['queue']]){if(_0x6f442&&_0x6f442['type']!==_0xcb6e('0x84')){delete this[_0xcb6e('0x23')][_0x2a2c7e[_0xcb6e('0xde')]];this[_0xcb6e('0xa5')](this[_0xcb6e('0x1c')][_0x2a2c7e[_0xcb6e('0xa7')]]);_0x6f442[_0xcb6e('0xf3')]=moment()[_0xcb6e('0x6e')](_0xcb6e('0xf0'));var _0x54c6f2=new QueueCallerAbandon(_0x6f442,_0x2a2c7e);if(getSeconds(_0x6f442['droptime'],_0x6f442['responsetime'])>=_0x6f442[_0xcb6e('0xf4')]){this[_0xcb6e('0x1c')][_0x2a2c7e[_0xcb6e('0xa7')]][_0xcb6e('0xf5')]+=0x1;this[_0xcb6e('0x1c')][_0x2a2c7e['queue']][_0xcb6e('0x5b')]+=0x1;this[_0xcb6e('0x1c')][_0x2a2c7e['queue']][_0xcb6e('0x61')]+=0x1;_0x54c6f2['state']=0xa;_0x54c6f2[_0xcb6e('0x9a')]='Drop';_0x54c6f2[_0xcb6e('0xf6')]='TIMEOUT';_0x54c6f2[_0xcb6e('0xea')]=this[_0xcb6e('0x1c')][_0x2a2c7e['queue']][_0xcb6e('0xeb')]?moment()[_0xcb6e('0x6e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this[_0xcb6e('0xf1')](_0x54c6f2);}else{this[_0xcb6e('0x1c')][_0x2a2c7e[_0xcb6e('0xa7')]][_0xcb6e('0x60')]+=0x1;this[_0xcb6e('0x1c')][_0x2a2c7e['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x54c6f2['state']=0xb;_0x54c6f2[_0xcb6e('0x9a')]=_0xcb6e('0xf7');_0x54c6f2['dropreason']=_0xcb6e('0xf8');this[_0xcb6e('0xf1')](_0x54c6f2);}}}};Dialer[_0xcb6e('0x1a')][_0xcb6e('0x35')]=function(_0x343a5e){if(this['actions'][_0x343a5e[_0xcb6e('0xde')]]){this[_0xcb6e('0x22')][_0x343a5e['uniqueid']]['channel']=_0x343a5e['channel'];}if(this['uniqueId'][_0x343a5e[_0xcb6e('0xde')]]){this['uniqueId'][_0x343a5e[_0xcb6e('0xde')]][_0xcb6e('0xf9')]=_0x343a5e[_0xcb6e('0xf9')];}};Dialer['prototype'][_0xcb6e('0x38')]=function(_0x2ae1bc){if(strategy[this['voiceQueues'][this[_0xcb6e('0x22')][_0x2ae1bc[_0xcb6e('0xfa')]][_0xcb6e('0xa7')]][_0xcb6e('0x49')]]==='roundrobin'){if(this[_0xcb6e('0x22')][_0x2ae1bc[_0xcb6e('0xfa')]]&&_[_0xcb6e('0xce')](this[_0xcb6e('0x22')][_0x2ae1bc[_0xcb6e('0xfa')]][_0xcb6e('0xfb')])&&_0x2ae1bc['status']==='1'&&_0x2ae1bc['paused']==='0'){if(this[_0xcb6e('0x1e')][_0x2ae1bc[_0xcb6e('0xfc')]]){if(!this['agents'][_0x2ae1bc[_0xcb6e('0xfc')]][_0xcb6e('0xfb')]){this[_0xcb6e('0x1e')][_0x2ae1bc[_0xcb6e('0xfc')]][_0xcb6e('0xfb')]=!![];this[_0xcb6e('0x22')][_0x2ae1bc[_0xcb6e('0xfa')]][_0xcb6e('0xfb')]=!![];this[_0xcb6e('0x22')][_0x2ae1bc[_0xcb6e('0xfa')]][_0xcb6e('0xfc')]=_0x2ae1bc[_0xcb6e('0xfc')];}}}}else if((strategy[this[_0xcb6e('0x1c')][this['actions'][_0x2ae1bc[_0xcb6e('0xfa')]]['queue']][_0xcb6e('0x49')]]||_0xcb6e('0xfd'))==='rrmemory'){if(this[_0xcb6e('0x22')][_0x2ae1bc['actionid']]){if(this[_0xcb6e('0x1e')][_0x2ae1bc[_0xcb6e('0xfc')]]){this['actions'][_0x2ae1bc['actionid']][_0xcb6e('0xfc')]=_0x2ae1bc['stateinterface'];if(_['isNil'](this['queueBooked'][this[_0xcb6e('0x22')][_0x2ae1bc['actionid']][_0xcb6e('0xa7')]])){this[_0xcb6e('0x28')][this[_0xcb6e('0x22')][_0x2ae1bc[_0xcb6e('0xfa')]][_0xcb6e('0xa7')]]=[];}this[_0xcb6e('0x28')][this[_0xcb6e('0x22')][_0x2ae1bc[_0xcb6e('0xfa')]][_0xcb6e('0xa7')]][_0xcb6e('0xfe')](_['merge'](_['pick'](this[_0xcb6e('0x22')][_0x2ae1bc[_0xcb6e('0xfa')]],[_0xcb6e('0xff'),_0xcb6e('0xfc')]),{'status':_0x2ae1bc[_0xcb6e('0xca')],'paused':_0x2ae1bc['paused']}));}}}};function unlockQueueStatus(_0x5d78e6,_0x65a153){setTimeout(function(){if(_['isUndefined'](_0x5d78e6['queueStatusComplete'])){loggerBooked[_0xcb6e('0x89')](_0xcb6e('0x100'),_0x65a153);}_0x5d78e6[_0xcb6e('0x101')]=!![];loggerBooked[_0xcb6e('0x71')]('[booked][unlockQueueStatus]',_0x65a153,JSON[_0xcb6e('0x102')](_[_0xcb6e('0x103')](_0x5d78e6,['name','queueStatusComplete'])));},0x1f3);}Dialer[_0xcb6e('0x1a')][_0xcb6e('0x39')]=function(_0x4f1c83){var _0x1d4e99=this;var _0x1bf745=_0x1d4e99[_0xcb6e('0x1c')][_0x1d4e99[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xa7')]];if(strategy[this[_0xcb6e('0x1c')][this['actions'][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xa7')]][_0xcb6e('0x49')]]===_0xcb6e('0x19')){if(this[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]]&&this['actions'][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xfc')]){this['preview'][_0xcb6e('0x104')](this[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xff')],this[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xfc')])[_0xcb6e('0xa2')](function(_0x4002a6){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0xcb6e('0x8a')](_0x4002a6,{'showHidden':![],'depth':null}));})[_0xcb6e('0x105')](function(){_0x1d4e99[_0xcb6e('0xa5')](_0x1d4e99[_0xcb6e('0x1c')][_0x1d4e99[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xa7')]]);_0x1d4e99['agents'][_0x1d4e99['actions'][_0x4f1c83[_0xcb6e('0xfa')]]['stateinterface']][_0xcb6e('0xfb')]=![];delete _0x1d4e99[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]];unlockQueueStatus(_0x1bf745);});}else{this['updateOriginated'](this[_0xcb6e('0x1c')][this[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xa7')]]);this[_0xcb6e('0x106')]({'active':![],'ContactId':this[_0xcb6e('0x22')][_0x4f1c83['actionid']][_0xcb6e('0xc3')],'ListId':this[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xc4')],'VoiceQueueId':this[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xc6')]||undefined,'CampaignId':this[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]]['CampaignId']||undefined})['catch'](loggerCatch(_0xcb6e('0x107')));delete this[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]];unlockQueueStatus(_0x1bf745);}}else if((strategy[this[_0xcb6e('0x1c')][this['actions'][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xa7')]][_0xcb6e('0x49')]]||_0xcb6e('0xfd'))===_0xcb6e('0xfd')){var _0x75cb5;if(this[_0xcb6e('0x22')][_0x4f1c83['actionid']]&&!_['isEmpty'](this[_0xcb6e('0x28')][this[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xa7')]])){if(this['queueBookedRR'][_0x1d4e99['actions'][_0x4f1c83[_0xcb6e('0xfa')]]['queue']]){this[_0xcb6e('0x29')][_0x1d4e99['actions'][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xa7')]]=this[_0xcb6e('0x29')][this['actions'][_0x4f1c83[_0xcb6e('0xfa')]]['queue']]?this['queueBookedRR'][this[_0xcb6e('0x22')][_0x4f1c83['actionid']][_0xcb6e('0xa7')]]:this['queueBooked'][this[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xa7')]]?this[_0xcb6e('0x28')][this[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xa7')]][_0xcb6e('0x108')]||0x0:0x0;}this['queueBooked'][this[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xa7')]][_0xcb6e('0x108')]=this[_0xcb6e('0x29')][this[_0xcb6e('0x22')][_0x4f1c83[_0xcb6e('0xfa')]][_0xcb6e('0xa7')]];for(var _0x2563e4=0x0;_0x2563e4=0x0?!![]:![];})[_0xcb6e('0xa2')](myreject(_0x5e6ede)));}}else{_0x2204cc[_0xcb6e('0xfe')](ami[_0xcb6e('0xa1')]({'action':_0xcb6e('0x120'),'command':util[_0xcb6e('0x6e')](_0xcb6e('0x121'),_0x53a11d,!_['isUndefined'](config['timezones'][_0x2696f0])?_0x2696f0:'')})[_0xcb6e('0xac')](function(_0x4c7de1){return _0x4c7de1['content']['indexOf'](_0xcb6e('0x126'))>=0x0?!![]:![];})[_0xcb6e('0xa2')](myreject(_0x5e6ede)));}BPromise[_0xcb6e('0x127')](_0x2204cc)[_0xcb6e('0xac')](function(_0x2e07bc){var _0x3c685f=_[_0xcb6e('0x128')](_0x2e07bc);if(_0x3c685f){return _0x4fdd18(_0x3c685f);}else{_0x5e0751[_0xcb6e('0x3c')]=_0x3dbf6f?_0xcb6e('0x129'):'INTERVAL_IS_OVERTIME';return _0x5e6ede(msgResponse('[ifTime][promiseAll]','Failure',_0xcb6e('0x12a')+_0x3dbf6f+'\x20'+_0x4060db+_0xcb6e('0x12b')+util[_0xcb6e('0x8a')](_0x53a11d,{'showHidden':![],'depth':null})+_0xcb6e('0x12c')+_0x2696f0));}})[_0xcb6e('0xa2')](function(_0x5ebb6f){return _0x5e6ede(msgResponse(_0xcb6e('0x118'),_0xcb6e('0x11b'),JSON[_0xcb6e('0x102')](_0x5ebb6f)));});});};Dialer[_0xcb6e('0x1a')]['checkDialMethod']=function(_0x5391e8){var _0x948d96=this;return function(){switch(_0x5391e8['dialMethod']){case'progressive':freeVariablesPredictive(_0x5391e8);_0x948d96[_0xcb6e('0x12d')](_0x5391e8,0x1);break;case _0xcb6e('0x12e'):freeVariablesPredictive(_0x5391e8);_0x948d96[_0xcb6e('0x12d')](_0x5391e8,_0x5391e8[_0xcb6e('0x12f')]);break;case'predictive':_0x948d96[_0xcb6e('0x8')](_0x5391e8);break;case _0xcb6e('0x7'):freeVariablesPredictive(_0x5391e8);_0x948d96['handlePower'](_0x5391e8,0x1);break;default:freeVariablesPredictive(_0x5391e8);logger[_0xcb6e('0x89')](_0xcb6e('0x130'),_0x5391e8[_0xcb6e('0x3e')],_0xcb6e('0x131'));}};};Dialer[_0xcb6e('0x1a')][_0xcb6e('0x132')]=function(_0x2e9f56){var _0x57a676=this;return function(){_0x57a676[_0xcb6e('0x133')](_0x2e9f56);};};Dialer[_0xcb6e('0x1a')]['syncQueueSummary']=function(_0x1584f1){var _0x41caf4=this;if(isNotPreview(_0x1584f1[_0xcb6e('0x134')])){if(isVoiceQueueOutbound(_0x1584f1[_0xcb6e('0xa4')])&&isActive(_0x1584f1['dialActive'])){_0x1584f1[_0xcb6e('0x96')]=!![];BPromise[_0xcb6e('0xaa')]()['then'](checkIsLoggedIn(_0x1584f1,_0x1584f1[_0xcb6e('0x135')]))[_0xcb6e('0xac')](checkIsActive(_0x1584f1,_0x1584f1[_0xcb6e('0x52')]))[_0xcb6e('0xac')](checkInterval(_0x1584f1))[_0xcb6e('0xac')](_0x41caf4[_0xcb6e('0x136')](_0x1584f1))['then'](_0x41caf4[_0xcb6e('0x116')](_0x1584f1['dialGlobalInterval'],_0x1584f1[_0xcb6e('0x137')],_0x1584f1[_0xcb6e('0x3e')],_0x1584f1))[_0xcb6e('0xac')](_0x41caf4[_0xcb6e('0x138')](_0x1584f1[_0xcb6e('0x43')],_0x1584f1[_0xcb6e('0x137')],_0x1584f1[_0xcb6e('0x3e')],_0x1584f1))[_0xcb6e('0xac')](_0x41caf4[_0xcb6e('0x139')](_0x1584f1))[_0xcb6e('0xa2')](loggerCatchQueueSummary(_0xcb6e('0x13a'),_0x1584f1));}else{notSendMessagesQueue(_0x1584f1);}}else{freeVariablesPredictive(_0x1584f1);}};Dialer['prototype'][_0xcb6e('0x113')]=function(){var _0x396253=this;var _0x1875bc;for(var _0x53e938 in this[_0xcb6e('0x1d')]){if(this['campaigns']['hasOwnProperty'](_0x53e938)){_0x1875bc=this[_0xcb6e('0x1d')][_0x53e938];if(isCampaignIvr(_0x1875bc[_0xcb6e('0xa4')])&&isActive(_0x1875bc[_0xcb6e('0x6b')])){_0x1875bc[_0xcb6e('0x96')]=!![];BPromise[_0xcb6e('0xaa')]()[_0xcb6e('0xac')](checkIsActive(_0x1875bc,_0x1875bc[_0xcb6e('0x6b')]))['then'](checkInterval(_0x1875bc))['then'](_0x396253[_0xcb6e('0x136')](_0x1875bc))['then'](_0x396253[_0xcb6e('0x116')](_0x1875bc['dialGlobalInterval'],_0x1875bc['dialTimezone'],_0x1875bc[_0xcb6e('0x3e')],_0x1875bc))[_0xcb6e('0xac')](_0x396253[_0xcb6e('0x138')](_0x1875bc[_0xcb6e('0x43')],_0x1875bc[_0xcb6e('0x137')],_0x1875bc[_0xcb6e('0x3e')],_0x1875bc))[_0xcb6e('0xac')](_0x396253[_0xcb6e('0x132')](_0x1875bc))[_0xcb6e('0xa2')](loggerCatchQueueSummary(_0xcb6e('0x13b'),_0x1875bc));}else{notSendMessagesCampaign(_0x1875bc);}}}};function getCallerIdRandom(_0x4815eb,_0x39c200){var _0x2cd909,_0x22d1b2,_0x7ac62;if(_0x39c200<=0x0){_0x39c200=0x1;}_0x2cd909=new RegExp('\x5cw{0,'+_0x39c200+'}$');_0x22d1b2=Math[_0xcb6e('0x13c')](0xa,_0x39c200-0x1);_0x7ac62=Math[_0xcb6e('0x13c')](0xa,_0x39c200)-0x1;return util[_0xcb6e('0x6e')]('%s',_['replace'](_0x4815eb,_0x2cd909,_[_0xcb6e('0x13d')](_0x22d1b2,_0x7ac62)));}function extractCalleridName(_0x10e1bb){var _0x5897ba=_0x10e1bb['match'](/"(.*?)"/);return _0x5897ba?_0x5897ba[0x1]:_0x10e1bb;}function extractCalleridNumber(_0x39336a){var _0x105888=_0x39336a['match'](/<(.*?)>/);return _0x105888?_0x105888[0x1]:_0x39336a;}Dialer[_0xcb6e('0x1a')][_0xcb6e('0x13e')]=function(_0x2e0d09,_0x538c06){var _0x372074=this;var _0x3e1135=uuid['v4']();this[_0xcb6e('0x22')][_0x3e1135]=new Action(_0x2e0d09,_0x538c06,_0x3e1135);return new BPromise(function(_0x661380,_0x442c44){if(_[_0xcb6e('0x3b')](_0x2e0d09)&&_0xcb6e('0x13f')!==typeof _0x2e0d09){return _0x442c44(msgResponse(_0xcb6e('0x140'),'Failure',_0xcb6e('0x141')));}if(_[_0xcb6e('0x3b')](_0x538c06[_0xcb6e('0x142')][_0xcb6e('0x143')])||_0x538c06[_0xcb6e('0x142')][_0xcb6e('0x143')]===null){return _0x442c44(msgResponse(_0xcb6e('0x140'),_0xcb6e('0x11b'),_0xcb6e('0x144')));}var _0x4966cb={'XMD-CALLERID':_0x372074[_0xcb6e('0x22')][_0x3e1135][_0xcb6e('0x145')](),'XMD-AGI':_0x2e0d09[_0xcb6e('0xe4')]?util[_0xcb6e('0x6e')](_0xcb6e('0x146'),ipAgi,_0x2e0d09['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x2e0d09[_0xcb6e('0xeb')]?util[_0xcb6e('0x6e')](_0xcb6e('0x146'),ipAgi,_0x2e0d09[_0xcb6e('0xeb')]):_0xcb6e('0x147'),'XMD-QUEUE':_0x2e0d09['type']==='outbound'?util['format'](_0xcb6e('0x148'),_0x2e0d09[_0xcb6e('0x3e')],_0x2e0d09[_0xcb6e('0x149')]||'',_0x2e0d09[_0xcb6e('0xec')]?'c':'',_0x2e0d09[_0xcb6e('0xf4')]||0x3):_0xcb6e('0x147'),'XMD-CONTACTID':_0x538c06['ContactId'],'XMD-CDRTYPE':_0xcb6e('0x5'),'CALLERID(all)':_0x372074[_0xcb6e('0x22')][_0x3e1135]['getCaller'](),'XMD-AMD':_0x2e0d09[_0xcb6e('0xd1')]?_0xcb6e('0x14a'):_0xcb6e('0x147'),'XMD-DESTINATION':_0xcb6e('0x14b')};if(_0x2e0d09['dialAMDActive']){_0x4966cb[_0xcb6e('0x14c')]=_0x2e0d09['dialAMDInitialSilence']||0x9c4;_0x4966cb[_0xcb6e('0x14d')]=_0x2e0d09['dialAMDGreeting']||0x5dc;_0x4966cb['XMD-AMDAFTERGREETINGSILENCE']=_0x2e0d09[_0xcb6e('0x14e')]||0x320;_0x4966cb['XMD-AMDTOTALANALYSISTIME']=_0x2e0d09[_0xcb6e('0x14f')]||0x1388;_0x4966cb[_0xcb6e('0x150')]=_0x2e0d09[_0xcb6e('0x151')]||0x64;_0x4966cb[_0xcb6e('0x152')]=_0x2e0d09[_0xcb6e('0x153')]||0x32;_0x4966cb[_0xcb6e('0x154')]=_0x2e0d09[_0xcb6e('0x155')]||0x3;_0x4966cb['XMD-AMDSILENCETHRESHOLD']=_0x2e0d09['dialAMDSilenceThreshold']||0x100;_0x4966cb[_0xcb6e('0x156')]=_0x2e0d09[_0xcb6e('0x157')]||0x1388;}if(_0x2e0d09[_0xcb6e('0xa4')]==='outbound'){_0x4966cb[_0xcb6e('0x158')]=_0x538c06[_0xcb6e('0xc6')];}else{_0x4966cb[_0xcb6e('0x159')]=_0x538c06[_0xcb6e('0xc7')];}for(var _0xf45e4b in _0x538c06[_0xcb6e('0x142')]){if(_0x538c06['Contact'][_0xcb6e('0xbc')](_0xf45e4b)){if(isNotNull(_0x538c06[_0xcb6e('0x142')][_0xf45e4b])&&_0xf45e4b!=='id'&&_0xf45e4b!=='tags'&&_0xf45e4b!==_0xcb6e('0x15a')&&_0xf45e4b!==_0xcb6e('0x15b')){_0x4966cb[util[_0xcb6e('0x6e')](_0xcb6e('0x15c'),_0xcb6e('0x15d'),_[_0xcb6e('0x15e')](_0xf45e4b))]=_0x538c06[_0xcb6e('0x142')][_0xf45e4b];}}}var _0x4cd9d7=_0x372074[_0xcb6e('0xc9')](_0x2e0d09[_0xcb6e('0x6a')])?getCallerId(_0x2e0d09[_0xcb6e('0x6a')]['callerid'],_0x2e0d09['dialOriginateCallerIdName'],_0x2e0d09[_0xcb6e('0x15f')]>0x0?getCallerIdRandom(_0x2e0d09['dialOriginateCallerIdNumber'],_0x2e0d09[_0xcb6e('0x15f')]):_0x2e0d09['dialOriginateCallerIdNumber']):getCallerId(_[_0xcb6e('0xce')](_0x2e0d09[_0xcb6e('0x114')])?_0x2e0d09[_0xcb6e('0x6a')]['callerid']:_0x2e0d09['TrunkBackup'][_0xcb6e('0x160')],_0x2e0d09[_0xcb6e('0x161')],_0x2e0d09[_0xcb6e('0x15f')]>0x0?getCallerIdRandom(_0x2e0d09[_0xcb6e('0x53')],_0x2e0d09[_0xcb6e('0x15f')]):_0x2e0d09[_0xcb6e('0x53')]);if(_0x4cd9d7){_0x4966cb[_0xcb6e('0x162')]=_0x372074['actions'][_0x3e1135][_0xcb6e('0x163')]=extractCalleridName(_0x4cd9d7);_0x4966cb['XMD-ORIGINATECALLERIDNUM']=_0x372074[_0xcb6e('0x22')][_0x3e1135][_0xcb6e('0x164')]=extractCalleridNumber(_0x4cd9d7);}return ami[_0xcb6e('0xa1')]({'actionid':_0x3e1135,'action':_0xcb6e('0x140'),'channel':_0x372074[_0xcb6e('0xc9')](_0x2e0d09['Trunk'])?util[_0xcb6e('0x6e')](_0xcb6e('0x165'),_0x2e0d09['Trunk'][_0xcb6e('0x3e')],isNotNull(_0x2e0d09[_0xcb6e('0x54')])?_0x2e0d09['dialPrefix'][_0xcb6e('0x166')]()||'':'',_0x2e0d09[_0xcb6e('0x167')]>0x0?_0x538c06['Contact'][_0xcb6e('0x143')][_0xcb6e('0x168')](_0x2e0d09[_0xcb6e('0x167')]):_0x538c06[_0xcb6e('0x142')][_0xcb6e('0x143')]):util[_0xcb6e('0x6e')](_0xcb6e('0x165'),_['isNil'](_0x2e0d09[_0xcb6e('0x114')])?_0x2e0d09[_0xcb6e('0x6a')]['name']:_0x2e0d09[_0xcb6e('0x114')]['name'],isNotNull(_0x2e0d09[_0xcb6e('0x54')])?_0x2e0d09[_0xcb6e('0x54')][_0xcb6e('0x166')]()||'':'',_0x2e0d09[_0xcb6e('0x167')]>0x0?_0x538c06[_0xcb6e('0x142')][_0xcb6e('0x143')][_0xcb6e('0x168')](_0x2e0d09[_0xcb6e('0x167')]):_0x538c06[_0xcb6e('0x142')]['phone']),'callerid':_0x4cd9d7,'Exten':'xcally-motion-dialer','Context':_0xcb6e('0x169'),'Priority':'1','variable':_0x4966cb,'timeout':(_0x2e0d09[_0xcb6e('0x16a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3e1135})[_0xcb6e('0xac')](function(_0x99c73b){return _0x661380(_0x99c73b);})[_0xcb6e('0xa2')](function(_0x4db541){_0x2e0d09[_0xcb6e('0x16b')]+=0x1;var _0x41f68f=new History(_0x372074['actions'][_0x3e1135]);logger['error'](util[_0xcb6e('0x6e')](_0xcb6e('0x16c'),JSON[_0xcb6e('0x102')](_0x4db541)));_0x41f68f['state']=0xe;_0x41f68f[_0xcb6e('0x9a')]=_0xcb6e('0x16d');_0x41f68f[_0xcb6e('0x16e')]=moment()['format'](_0xcb6e('0xf0'));_0x41f68f[_0xcb6e('0x9b')]=_0x41f68f[_0xcb6e('0x16e')];_0x372074[_0xcb6e('0xbb')](_0x41f68f)[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0x16f')));_0x372074[_0xcb6e('0xb9')](_0x41f68f)[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0x16f')))['finally'](function(){delete _0x372074['actions'][_0x3e1135];return _0x442c44(msgResponse(_0xcb6e('0x140'),_0xcb6e('0x170'),_0xcb6e('0x171')));});});});};Dialer[_0xcb6e('0x1a')][_0xcb6e('0x2f')]=function(_0x40f827){var _0x3a3b89=this['actions'][_0x40f827[_0xcb6e('0xfa')]];var _0x826ad1=this;if(_0x3a3b89){delete this[_0xcb6e('0x22')][_0x40f827[_0xcb6e('0xfa')]];_0x3a3b89[_0xcb6e('0x172')]=moment()[_0xcb6e('0x6e')](_0xcb6e('0xf0'));var _0x376ac7=_0x3a3b89['type']===_0xcb6e('0x84')?this[_0xcb6e('0x1d')][_0x3a3b89[_0xcb6e('0xa7')]]:this['voiceQueues'][_0x3a3b89[_0xcb6e('0x173')]()];if(!this[_0xcb6e('0x174')](_0x40f827[_0xcb6e('0x175')])){this[_0xcb6e('0xa5')](_0x376ac7);return this[_0xcb6e('0x176')](_0x3a3b89,_0x376ac7,_0x40f827)[_0xcb6e('0xac')](function(_0x3b9c7f){})[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0x177')));}else{this[_0xcb6e('0x23')][_0x40f827[_0xcb6e('0xde')]]=_0x3a3b89;}}};Dialer[_0xcb6e('0x1a')]['checkRetriveMax']=function(_0x34d227,_0x4b8ba9,_0x52f930){var _0x52f932=new History(_0x4b8ba9);if(_0x52f932[_0xcb6e('0x178')]+_0x52f932[_0xcb6e('0x179')]+_0x52f932[_0xcb6e('0x17a')]>=_0x52f930[_0xcb6e('0x17b')]-0x1){return!![];}switch(_0x34d227){case 0x3:if(_0x52f932[_0xcb6e('0x17a')]>=_0x52f930[_0xcb6e('0x17c')]-0x1){return!![];}else{this[_0xcb6e('0x106')]({'active':![],'countnoanswerretry':_0x52f932[_0xcb6e('0x17a')]+=0x1,'scheduledat':moment()[_0xcb6e('0x17d')](_0x52f930[_0xcb6e('0x17e')],_0xcb6e('0x17f'))[_0xcb6e('0x6e')](_0xcb6e('0xf0')),'ContactId':_0x52f932[_0xcb6e('0xc3')],'ListId':_0x52f932[_0xcb6e('0xc4')],'VoiceQueueId':_0x52f932[_0xcb6e('0xc6')]||undefined,'CampaignId':_0x52f932[_0xcb6e('0xc7')]||undefined})[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0x180')));}break;case 0x5:if(_0x52f932['countbusyretry']>=_0x52f930[_0xcb6e('0x181')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x52f932[_0xcb6e('0x178')]+=0x1,'scheduledat':moment()[_0xcb6e('0x17d')](_0x52f930[_0xcb6e('0x182')],_0xcb6e('0x17f'))['format'](_0xcb6e('0xf0')),'ContactId':_0x52f932[_0xcb6e('0xc3')],'ListId':_0x52f932[_0xcb6e('0xc4')],'VoiceQueueId':_0x52f932[_0xcb6e('0xc6')]||undefined,'CampaignId':_0x52f932[_0xcb6e('0xc7')]||undefined})['catch'](loggerCatch(_0xcb6e('0x183')));}break;case 0x8:if(_0x52f932[_0xcb6e('0x179')]>=_0x52f930[_0xcb6e('0x184')]-0x1){return!![];}else{this[_0xcb6e('0x106')]({'active':![],'countcongestionretry':_0x52f932['countcongestionretry']+=0x1,'scheduledat':moment()[_0xcb6e('0x17d')](_0x52f930[_0xcb6e('0x185')],_0xcb6e('0x17f'))[_0xcb6e('0x6e')](_0xcb6e('0xf0')),'ContactId':_0x52f932[_0xcb6e('0xc3')],'ListId':_0x52f932[_0xcb6e('0xc4')],'VoiceQueueId':_0x52f932[_0xcb6e('0xc6')]||undefined,'CampaignId':_0x52f932[_0xcb6e('0xc7')]||undefined})[_0xcb6e('0xa2')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;default:return!![];}};Dialer[_0xcb6e('0x1a')]['callProgressDetecting']=function(_0x2d60fa,_0x57c507,_0x541864){var _0x5ef477=this;var _0x23a8bd=new History(_0x2d60fa);return new BPromise(function(_0x526a92,_0x2be831){if(_['isUndefined'](_0x57c507)&&_0xcb6e('0x13f')!==typeof _0x57c507){return _0x2be831(msgResponse(_0xcb6e('0x186'),_0xcb6e('0x11b'),_0xcb6e('0x187')));}if(_[_0xcb6e('0x3b')](_0x541864)&&_0xcb6e('0x13f')!==typeof _0x541864){return _0x2be831(msgResponse(_0xcb6e('0x186'),_0xcb6e('0x11b'),'evt\x20is\x20undefine'));}switch(_0x541864[_0xcb6e('0xe9')]){case'0':_0x57c507[_0xcb6e('0x5d')]+=0x1;_0x23a8bd[_0xcb6e('0xd5')]=0x0;_0x23a8bd[_0xcb6e('0x9a')]=_0xcb6e('0x188');_0x5ef477[_0xcb6e('0xbb')](_0x23a8bd)[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0x189')));if(_0x5ef477[_0xcb6e('0x18a')](0x0,_0x2d60fa,_0x57c507)){if(_0x23a8bd['countbusyretry']+_0x23a8bd[_0xcb6e('0x179')]+_0x23a8bd[_0xcb6e('0x17a')]>=_0x57c507[_0xcb6e('0x17b')]){_0x5ef477['stateGlobal'](_0x23a8bd,_0x526a92,_0x2be831,_0xcb6e('0x18b'));}else{_0x5ef477['createStateFinal'](_0x23a8bd,_0x526a92,_0x2be831,_0xcb6e('0x18b'));}}break;case'3':_0x57c507['outboundNoAnswerCallsDay']+=0x1;_0x23a8bd[_0xcb6e('0xd5')]=0x3;_0x23a8bd[_0xcb6e('0x9a')]='NoAnswer';_0x23a8bd[_0xcb6e('0x17a')]+=0x1;_0x23a8bd[_0xcb6e('0x18c')]+=0x1;_0x5ef477[_0xcb6e('0xbb')](_0x23a8bd)['catch'](loggerCatch(_0xcb6e('0x18d')));if(_0x5ef477['checkRetriveMax'](0x3,_0x2d60fa,_0x57c507)){if(_0x23a8bd[_0xcb6e('0x17a')]>=_0x57c507[_0xcb6e('0x17c')]){_0x5ef477['createStateFinal'](_0x23a8bd,_0x526a92,_0x2be831,'reason\x203\x20ringing\x20no\x20answer');}else{_0x5ef477[_0xcb6e('0x18e')](_0x23a8bd,_0x526a92,_0x2be831,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x57c507[_0xcb6e('0x57')]+=0x1;_0x23a8bd[_0xcb6e('0xd5')]=0x5;_0x23a8bd[_0xcb6e('0x9a')]='Busy';_0x23a8bd['countbusyretry']+=0x1;_0x23a8bd['countglobal']+=0x1;_0x5ef477[_0xcb6e('0xbb')](_0x23a8bd)[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0x18f')));if(_0x5ef477[_0xcb6e('0x18a')](0x5,_0x2d60fa,_0x57c507)){if(_0x23a8bd['countbusyretry']>=_0x57c507[_0xcb6e('0x181')]){_0x5ef477[_0xcb6e('0x190')](_0x23a8bd,_0x526a92,_0x2be831,'reason\x205\x20busy');}else{_0x5ef477['stateGlobal'](_0x23a8bd,_0x526a92,_0x2be831,_0xcb6e('0x191'));}}break;case'8':_0x57c507[_0xcb6e('0x58')]+=0x1;_0x23a8bd[_0xcb6e('0xd5')]=0x8;_0x23a8bd[_0xcb6e('0x9a')]=_0xcb6e('0x192');_0x23a8bd[_0xcb6e('0x179')]+=0x1;_0x23a8bd[_0xcb6e('0x18c')]+=0x1;_0x5ef477[_0xcb6e('0xbb')](_0x23a8bd)[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0x193')));if(_0x5ef477[_0xcb6e('0x18a')](0x8,_0x2d60fa,_0x57c507)){if(_0x23a8bd['countcongestionretry']>=_0x57c507['dialCongestionMaxRetry']){_0x5ef477[_0xcb6e('0x190')](_0x23a8bd,_0x526a92,_0x2be831,_0xcb6e('0x194'));}else{_0x5ef477[_0xcb6e('0x18e')](_0x23a8bd,_0x526a92,_0x2be831,_0xcb6e('0x194'));}}break;default:_0x57c507['outboundUnknownCallsDay']+=0x1;_0x23a8bd['state']=0xc;_0x23a8bd['statedesc']=_0x541864[_0xcb6e('0xe9')];_0x5ef477[_0xcb6e('0xbb')](_0x23a8bd)[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0x195')));if(_0x5ef477[_0xcb6e('0x18a')](_0x541864['reason'],_0x2d60fa,_0x57c507)){if(_0x23a8bd[_0xcb6e('0x178')]+_0x23a8bd[_0xcb6e('0x179')]+_0x23a8bd[_0xcb6e('0x17a')]>=_0x57c507[_0xcb6e('0x17b')]){_0x5ef477[_0xcb6e('0x18e')](_0x23a8bd,_0x526a92,_0x2be831,_0x541864[_0xcb6e('0xe9')]);}else{_0x5ef477[_0xcb6e('0x190')](_0x23a8bd,_0x526a92,_0x2be831,_0x541864[_0xcb6e('0xe9')]);}}}});};Dialer['prototype'][_0xcb6e('0x18e')]=function(_0x3b2798,_0x260829,_0x11bac9,_0x5582e6){var _0x33cd41=new Final(_0x3b2798);_0x33cd41[_0xcb6e('0xd5')]=0xf;_0x33cd41[_0xcb6e('0x9a')]='Global';this[_0xcb6e('0x190')](_0x33cd41,_0x260829,_0x11bac9,_0x5582e6);};Dialer[_0xcb6e('0x1a')][_0xcb6e('0x190')]=function(_0x473bfc,_0x5b74ee,_0x370065,_0x9028e6){this[_0xcb6e('0xb9')](_0x473bfc)[_0xcb6e('0xac')](function(_0x4b5ac3){return _0x5b74ee(msgResponse('[callProgressDetecting]',_0xcb6e('0x196'),_0x9028e6));})['catch'](function(_0x346233){return _0x370065(msgResponse(_0xcb6e('0x197'),_0xcb6e('0x11b'),_0xcb6e('0x198')));});};Dialer['prototype'][_0xcb6e('0x8')]=function(_0x461359){var _0x33a1db=this;var _0x1407fe=_0x461359['dialPredictiveOptimizationPercentage']/0x64;var _0x17b6c7=_0x461359[_0xcb6e('0x5b')]/(_0x461359[_0xcb6e('0x5b')]+_0x461359[_0xcb6e('0xd4')]);var _0x19c587=Math[_0xcb6e('0x199')](_0x461359['predictiveIntervalAvailable']*(_0x461359[_0xcb6e('0x19a')]/0x64));var _0x1adb4c=Math[_0xcb6e('0x199')](_0x461359[_0xcb6e('0x64')]*(_0x461359[_0xcb6e('0x19b')]/0x64));var _0x260996=_0x461359[_0xcb6e('0x4b')]+_0x461359['talking'];var _0x1acc22=Math[_0xcb6e('0x19c')](_0x461359[_0xcb6e('0x66')]*_0x461359[_0xcb6e('0x68')]*_0x461359[_0xcb6e('0x62')]*_0x461359[_0xcb6e('0x63')]);if(_[_0xcb6e('0x3b')](_0x461359[_0xcb6e('0x26')])){if(!_[_0xcb6e('0x3b')](_0x461359[_0xcb6e('0x25')])){_0x461359[_0xcb6e('0x25')]=undefined;loggerPredictive[_0xcb6e('0x89')](_0xcb6e('0x19d'),_0xcb6e('0x19e'));}if(!_[_0xcb6e('0x3b')](_0x461359[_0xcb6e('0x81')])){loggerPredictive['error'](_0xcb6e('0x19d'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x461359[_0xcb6e('0x81')]);_0x461359[_0xcb6e('0x81')]=undefined;}_0x461359[_0xcb6e('0x26')]=moment()[_0xcb6e('0x6e')](_0xcb6e('0xf0'));loggerPredictive['info'](_0x461359[_0xcb6e('0x3e')],_0xcb6e('0x19f'),_0x461359[_0xcb6e('0x26')]);this['handlePower'](_0x461359,0x1);}else if(ifInterval(_0x461359[_0xcb6e('0x1a0')],_0x461359[_0xcb6e('0x26')])){this[_0xcb6e('0x12d')](_0x461359,0x1);loggerPredictiveCalls[_0xcb6e('0x71')]('[startMethodPredictive][StartProgressive][Loop]',_0x461359[_0xcb6e('0x26')],_0x461359[_0xcb6e('0x3e')]);_0x461359[_0xcb6e('0x66')]=0x0;_0x461359['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x1407fe<_0x17b6c7&&_0x461359[_0xcb6e('0x1a1')]===_0xcb6e('0x1a2')){freeVariablesPredictive(_0x461359);loggerPredictive[_0xcb6e('0x71')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xcb6e('0x1a3'),_0x17b6c7,'startProgressive',_0x461359[_0xcb6e('0x3e')]);}else if(_0x1acc22<_0x461359['predictiveIntervalErlangCallsDroppedCalls']&&_0x461359[_0xcb6e('0x1a1')]===_0xcb6e('0x1a2')){freeVariablesPredictive(_0x461359);loggerPredictive[_0xcb6e('0x71')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20',_0x1acc22,_0xcb6e('0x1a4'),_0x461359[_0xcb6e('0x61')],_0xcb6e('0x26'),_0x461359[_0xcb6e('0x3e')]);}else if(!ifInterval(_0x461359[_0xcb6e('0x1a0')],_0x461359[_0xcb6e('0x26')])&&_[_0xcb6e('0x3b')](_0x461359[_0xcb6e('0x25')])&&!_[_0xcb6e('0x3b')](_0x461359[_0xcb6e('0x26')])){_0x461359['startPredictive']=moment()[_0xcb6e('0x6e')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xcb6e('0x71')](_0x461359[_0xcb6e('0x3e')],'started\x20in\x20predictive\x20at',_0x461359['startPredictive']);this[_0xcb6e('0x1a5')](_0x461359[_0xcb6e('0x1a0')])['then'](this[_0xcb6e('0x1a6')](_0x461359))[_0xcb6e('0xac')](mergeDataErlangB(_0x461359))[_0xcb6e('0xac')](this[_0xcb6e('0x1a7')](_0x461359))[_0xcb6e('0xa2')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x461359));}else if(!ifInterval(_0x461359['dialPredictiveInterval'],_0x461359[_0xcb6e('0x25')])){_0x461359[_0xcb6e('0x61')]=0x0;_0x461359[_0xcb6e('0x25')]=moment()[_0xcb6e('0x6e')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xcb6e('0x71')](_0x461359[_0xcb6e('0x3e')],_0xcb6e('0x1a8'),_0x461359['startPredictive']);clearInterval(_0x461359[_0xcb6e('0x81')]);_0x461359[_0xcb6e('0x81')]=undefined;this[_0xcb6e('0x1a5')](_0x461359[_0xcb6e('0x1a0')])[_0xcb6e('0xac')](this[_0xcb6e('0x1a6')](_0x461359))[_0xcb6e('0xac')](mergeDataErlangB(_0x461359))[_0xcb6e('0xac')](this['startMethodPredictive'](_0x461359))[_0xcb6e('0xa2')](loggerCatchPredictive(_0xcb6e('0x1a9'),_0x461359));}else if(_0x461359[_0xcb6e('0x64')]&&_0x260996<_0x461359[_0xcb6e('0x64')]-_0x1adb4c){freeVariablesPredictive(_0x461359);loggerPredictive[_0xcb6e('0x71')](_0x461359[_0xcb6e('0x3e')],_0xcb6e('0x1aa'),_0x260996,_0xcb6e('0x1ab'),_0x461359[_0xcb6e('0x64')],'-',_0x1adb4c,'=',_0x461359['predictiveIntervalAvailable']-_0x1adb4c,')');}else if(_0x461359[_0xcb6e('0x64')]&&_0x260996>_0x461359[_0xcb6e('0x64')]+_0x19c587){freeVariablesPredictive(_0x461359);loggerPredictive[_0xcb6e('0x71')](_0x461359[_0xcb6e('0x3e')],_0xcb6e('0x1aa'),_0x260996,_0xcb6e('0x1ac'),_0x461359[_0xcb6e('0x64')],'+',_0x19c587,'=',_0x461359[_0xcb6e('0x64')]+_0x19c587,')');}};Dialer[_0xcb6e('0x1a')][_0xcb6e('0x1a6')]=function(_0x326244){var _0x490671=this;return function(_0x18144d){return new BPromise(function(_0xf20b1e,_0x20fb76){_[_0xcb6e('0x7f')](_0x326244,_0x18144d[0x0]);if(checkGetDataPredictive(_0x18144d[0x0])){var _0x4caf87=_0x326244[_0xcb6e('0x64')]=_0x326244[_0xcb6e('0x95')]+_0x326244[_0xcb6e('0x4b')];var _0x18e5b5=_0x326244['dialPredictiveInterval']*0x3c;var _0x1ee988=_0x18144d[0x0][_0xcb6e('0x5f')]+_0x18144d[0x0][_0xcb6e('0x76')];var _0x3d3990=(_0x18144d[0x0][_0xcb6e('0x5e')]+_0x18144d[0x0][_0xcb6e('0xf5')]+_0x18144d[0x0][_0xcb6e('0x60')])/_0x18144d[0x0]['predictiveIntervalTotalCalls'];_0x326244[_0xcb6e('0x62')]=_0x3d3990>0x0?_0x3d3990:0x1;switch(_0x326244[_0xcb6e('0x1a1')]){case _0xcb6e('0x1a2'):var _0x1f2670=_0x326244['dialPredictiveOptimizationPercentage']/0x64;return _0x490671[_0xcb6e('0x1ad')](_0x4caf87,_0x18e5b5,_0x1ee988,_0x3d3990,_0x1f2670)[_0xcb6e('0xac')](function(_0x3df824){return _0xf20b1e(_0x3df824);});case _0xcb6e('0x1ae'):var _0x27b058=_0x326244[_0xcb6e('0x1af')]/0x64;return _0x490671['busyFactor'](_0x4caf87,_0x18e5b5,_0x1ee988,_0x3d3990,_0x27b058)[_0xcb6e('0xac')](function(_0x204455){return _0xf20b1e(_0x204455);});default:return _0x20fb76(msgResponse('[getDataPredictive]','Failure',_0xcb6e('0x1b0')));}}else{return _0x20fb76(msgResponse(_0xcb6e('0x1b1'),_0xcb6e('0x11b'),_0xcb6e('0x1b2')));}});};};Dialer[_0xcb6e('0x1a')]['getDataPredictiveOld']=function(_0x276096){var _0x1e91cd=this;return function(_0x114568){return new BPromise(function(_0x15a9de,_0x1948e5){_[_0xcb6e('0x7f')](_0x276096,_0x114568[0x0]);if(checkGetDataPredictive(_0x114568[0x0])){loggerPredictive[_0xcb6e('0x71')](JSON[_0xcb6e('0x102')](_0x114568[0x0]));if(_0x276096['dialPredictiveOptimization']===_0xcb6e('0x1a2')){return _0x1e91cd['getVoiceQueueRtPauses'](_0x276096['id'])[_0xcb6e('0xac')](function(_0x409609){var _0xd13acd=_0x276096[_0xcb6e('0x135')]-_0x409609[0x0]['outboundQueuePauses'];var _0x101899=_0x276096[_0xcb6e('0x1a0')]*0x3c;var _0x53cda0=_0x114568[0x0][_0xcb6e('0x5f')]+_0x114568[0x0]['predictiveIntervalAvgHoldtime'];var _0x2f8c0e=(_0x114568[0x0][_0xcb6e('0x5e')]+_0x114568[0x0][_0xcb6e('0xf5')]+_0x114568[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x114568[0x0][_0xcb6e('0x65')];var _0x390270=_0x276096[_0xcb6e('0x1af')]/0x64;_0x276096[_0xcb6e('0x1b3')]=_0x409609[0x0][_0xcb6e('0x1b4')]||0x0;_0x276096['predictiveIntervalHitRate']=_0x2f8c0e>0x0?_0x2f8c0e:0x1;return _0x1e91cd[_0xcb6e('0x1ad')](_0xd13acd,_0x101899,_0x53cda0,_0x2f8c0e,_0x390270);})['then'](function(_0x48c01d){return _0x15a9de(_0x48c01d);})['catch'](function(_0x105c3c){return _0x1948e5(msgResponse(_0xcb6e('0x1b5'),'Failure',JSON[_0xcb6e('0x102')](_0x105c3c)));});}if(_0x276096[_0xcb6e('0x1a1')]==='agentBusyFactor'){return _0x1e91cd['getVoiceQueueRtPauses'](_0x276096['id'])[_0xcb6e('0xac')](function(_0x55ba67){var _0x49e817=_0x276096[_0xcb6e('0x135')]-_0x55ba67[0x0][_0xcb6e('0x1b4')];var _0x3bdbd9=_0x276096[_0xcb6e('0x1a0')]*0x3c;var _0xc0d0da=_0x114568[0x0][_0xcb6e('0x5f')]+_0x114568[0x0][_0xcb6e('0x76')];var _0x44a72f=(_0x114568[0x0][_0xcb6e('0x5e')]+_0x114568[0x0][_0xcb6e('0xf5')]+_0x114568[0x0][_0xcb6e('0x60')])/_0x114568[0x0][_0xcb6e('0x65')];var _0x2d853c=_0x276096[_0xcb6e('0x1af')]/0x64;_0x276096['predictiveIntervalPauses']=_0x55ba67[0x0][_0xcb6e('0x1b4')]||0x0;_0x276096[_0xcb6e('0x62')]=_0x44a72f>0x0?_0x44a72f:0x1;return _0x1e91cd[_0xcb6e('0x1b6')](_0x49e817,_0x3bdbd9,_0xc0d0da,_0x44a72f,_0x2d853c);})[_0xcb6e('0xac')](function(_0x21811c){return _0x15a9de(_0x21811c);})[_0xcb6e('0xa2')](function(_0xf8b29){return _0x1948e5(msgResponse(_0xcb6e('0x1b5'),_0xcb6e('0x11b'),JSON[_0xcb6e('0x102')](_0xf8b29)));});}}else{return _0x1948e5(msgResponse(_0xcb6e('0x1b1'),_0xcb6e('0x11b'),_0xcb6e('0x1b2')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0x142c1e){var _0x243460=this;return function(){var _0x488bc6=0x0;var _0xc25e71=Math['floor'](_0x142c1e[_0xcb6e('0x67')]*0x3e8);if(_0xc25e71>0x0){_0xc25e71=_0xc25e71<0x64?0x64:_0xc25e71;loggerPredictive[_0xcb6e('0x71')](_0x142c1e[_0xcb6e('0x3e')],_0xcb6e('0x1b7'),_0xc25e71,_0xcb6e('0x45'));_0x142c1e['handlePredictive']=setInterval(function(){_0x243460['handlePredictive'](_0x142c1e);loggerPredictiveCalls['info'](_0xcb6e('0x1b8'),_0x488bc6+=0x1);},_0xc25e71);}else{loggerPredictive[_0xcb6e('0x71')](_0x142c1e[_0xcb6e('0x3e')],_0xcb6e('0x1b9'));}};};Dialer[_0xcb6e('0x1a')]['checkContactBlack']=function(_0x41c5d3,_0x9d8053){var _0x2564a8=this;return function(_0x13a506){if(_['isEmpty'](_0x13a506)){if(_['isNil'](_0x9d8053[_0xcb6e('0xc5')])||!_0x9d8053['recallme']){if(_0x41c5d3[_0xcb6e('0x134')]===_0xcb6e('0x7')){_0x41c5d3['queueStatusComplete']=_[_0xcb6e('0x3b')](_0x41c5d3[_0xcb6e('0x101')])?!![]:_0x41c5d3[_0xcb6e('0x101')];var _0x469925=uuid['v4']();_0x2564a8[_0xcb6e('0x22')][_0x469925]=new Action(_0x41c5d3,_0x9d8053,_0x469925);loggerBooked[_0xcb6e('0x71')]('[booked][checkContactBlack]',_0x469925,_0xcb6e('0x1ba'),JSON[_0xcb6e('0x102')](_0x41c5d3[_0xcb6e('0x101')]),_0xcb6e('0x1bb'),_0x41c5d3[_0xcb6e('0x3e')]);if(_0x41c5d3['queueStatusComplete']){_0x41c5d3[_0xcb6e('0x101')]=![];_0x2564a8[_0xcb6e('0x28')][_0x2564a8[_0xcb6e('0x22')][_0x469925]['queue']]=[];ami[_0xcb6e('0xa1')]({'actionid':_0x469925,'action':_0xcb6e('0x1bc'),'queue':_0x41c5d3[_0xcb6e('0x3e')]})[_0xcb6e('0xa2')](function(_0x181314){_0x2564a8[_0xcb6e('0xa5')](_0x41c5d3);_0x2564a8[_0xcb6e('0x106')]({'active':![],'ContactId':_0x2564a8[_0xcb6e('0x22')][_0x469925][_0xcb6e('0xc3')],'ListId':_0x2564a8[_0xcb6e('0x22')][_0x469925][_0xcb6e('0xc4')],'VoiceQueueId':_0x2564a8[_0xcb6e('0x22')][_0x469925][_0xcb6e('0xc6')]||undefined,'CampaignId':_0x2564a8['actions'][_0x469925]['CampaignId']||undefined})[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0x1bd')));delete _0x2564a8['actions'][_0x469925];});}else{loggerBooked['info'](_0xcb6e('0x1be'),JSON[_0xcb6e('0x102')](_0x41c5d3['queueStatusComplete']),'Queue:\x20',_0x41c5d3['name']);_0x2564a8[_0xcb6e('0xa5')](_0x41c5d3);_0x2564a8[_0xcb6e('0x106')]({'active':![],'ContactId':_0x2564a8['actions'][_0x469925]['ContactId'],'ListId':_0x2564a8[_0xcb6e('0x22')][_0x469925][_0xcb6e('0xc4')],'VoiceQueueId':_0x2564a8['actions'][_0x469925][_0xcb6e('0xc6')]||undefined,'CampaignId':_0x2564a8[_0xcb6e('0x22')][_0x469925]['CampaignId']||undefined})[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0x1bd')));delete _0x2564a8[_0xcb6e('0x22')][_0x469925];}}else{return _0x2564a8[_0xcb6e('0x13e')](_0x41c5d3,_0x9d8053);}}else{if(getDiff(_0x9d8053[_0xcb6e('0x1bf')])<_0x41c5d3[_0xcb6e('0x1c0')]*0x3c){if(_0x9d8053[_0xcb6e('0x1c1')]&&!_0x9d8053[_0xcb6e('0x1c1')][_0xcb6e('0x1c2')]){_0x2564a8[_0xcb6e('0x83')][_0xcb6e('0x104')](_0x9d8053['id'])[_0xcb6e('0x105')](function(){_0x2564a8[_0xcb6e('0xa5')](_0x41c5d3);});}else{_0x2564a8[_0xcb6e('0xb3')]({'active':![]},_0x9d8053['id'],0x1)[_0xcb6e('0x105')](function(){console['log'](_0xcb6e('0x1c3'));_0x2564a8['updateOriginated'](_0x41c5d3);});}}else{_0x41c5d3[_0xcb6e('0x1c4')]+=0x1;_0x2564a8[_0xcb6e('0xa5')](_0x41c5d3);if(_0x41c5d3['dialRecallInQueue']){_0x2564a8[_0xcb6e('0x106')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x9d8053[_0xcb6e('0xc3')],'ListId':_0x9d8053[_0xcb6e('0xc4')],'VoiceQueueId':_0x9d8053[_0xcb6e('0xc6')]||undefined,'CampaignId':_0x9d8053['CampaignId']||undefined})[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0x1c5')));_0x2564a8[_0xcb6e('0xbb')](createObjHistory(_0x41c5d3,_0x9d8053,_0xcb6e('0x1c6'),0x17,_0xcb6e('0x1c7')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x2564a8[_0xcb6e('0xc2')](createObjHistory(_0x41c5d3,_0x9d8053,_0xcb6e('0x1c8'),0x16,_0xcb6e('0x1c9')),_0xcb6e('0x1ca'),_0xcb6e('0x1cb'));}}}}else{_0x41c5d3[_0xcb6e('0x56')]+=0x1;_0x2564a8[_0xcb6e('0xc2')](createObjHistory(_0x41c5d3,_0x9d8053,'BLACKLIST',0xd,_0xcb6e('0x1cc')),_0xcb6e('0x1cd'),_0xcb6e('0x1ce'));throw _0xcb6e('0x1cf');}};};Dialer['prototype'][_0xcb6e('0x133')]=function(_0x1d2b04){var _0x2643bf=this;var _0x5e9a4f=[];var _0x5731c3=_0x1d2b04[_0xcb6e('0x1d0')]-_0x1d2b04[_0xcb6e('0x8d')]-_0x1d2b04['temp'];emitCampaignSummary(_0x1d2b04);if(_0x5731c3>0x0){if(_0x5731c3>this[_0xcb6e('0x20')]){_0x5731c3=this[_0xcb6e('0x20')];}_0x1d2b04[_0xcb6e('0x1d1')]+=_0x5731c3;this['getContactDialerIvr'](_0x1d2b04['id'],_0x5731c3,_0x1d2b04[_0xcb6e('0x1d2')])[_0xcb6e('0xac')](function(_0x8e5845){_0x1d2b04[_0xcb6e('0x1d1')]-=_0x5731c3;_0x1d2b04[_0xcb6e('0x1d1')]=_0x1d2b04[_0xcb6e('0x1d1')]>0x0?_0x1d2b04[_0xcb6e('0x1d1')]:0x0;if(!checkContactEmpty(_0x8e5845)){_0x1d2b04[_0xcb6e('0x3c')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xcb6e('0x71')]('[getContactCampaign2][Empty]'+_0x1d2b04[_0xcb6e('0x3e')]);}else{_0x1d2b04[_0xcb6e('0x8d')]+=_0x8e5845['length'];_0x1d2b04[_0xcb6e('0x3c')]=_0xcb6e('0x1d3');for(var _0x159efd=0x0;_0x159efd<_0x8e5845[_0xcb6e('0x8c')];_0x159efd+=0x1){_0x1d2b04['ivrTotalCallsDays']+=0x1;if(_[_0xcb6e('0xce')](_0x8e5845[_0x159efd])||_['isNil'](_0x8e5845[_0x159efd][_0xcb6e('0x142')])||_[_0xcb6e('0xce')](_0x8e5845[_0x159efd][_0xcb6e('0x142')][_0xcb6e('0x143')])){_0x2643bf[_0xcb6e('0xc0')]('[actionOriginate]\x20',_0x1d2b04,_0x8e5845[_0x159efd]);}else{_0x2643bf[_0xcb6e('0xaf')](_['pick'](_0x8e5845[_0x159efd],[_0xcb6e('0xc7'),_0xcb6e('0x1d4')]))[_0xcb6e('0xac')](_0x2643bf[_0xcb6e('0x1d5')](_0x1d2b04,_0x8e5845[_0x159efd]))['catch'](_0x2643bf[_0xcb6e('0xbf')](_0xcb6e('0x1d6'),_0x1d2b04));}}}})['catch'](loggerGetContactDialer(_0xcb6e('0x1d7'),_0x1d2b04,_0x5731c3));}};Dialer['prototype'][_0xcb6e('0x12d')]=function(_0x325781,_0x338adf){var _0x54512a=this;var _0x376788=[];var _0x37cf53=_0x338adf>=0x1?_0x338adf:0x1;var _0x2f1098=[];if(_0x325781[_0xcb6e('0x134')]==='booked'){_0x37cf53=0x1;}var _0xc822a2=Math[_0xcb6e('0x19c')](_0x325781[_0xcb6e('0x4b')]*_0x37cf53)-_0x325781['originated']-_0x325781[_0xcb6e('0x1d1')];emitVoiceQueueSummary(_0x325781);if(_0x325781[_0xcb6e('0x1d8')]>0x0){var _0x21e7ee=_0x325781[_0xcb6e('0x1d8')]-_0x325781[_0xcb6e('0x8d')]-_0x325781[_0xcb6e('0x95')]-_0x325781[_0xcb6e('0x1d1')]-_0x325781[_0xcb6e('0x4c')];if(_0xc822a2>_0x21e7ee){_0xc822a2=_0x21e7ee;}}if(_0xc822a2>0x0){if(_0x325781[_0xcb6e('0x134')]===_0xcb6e('0x7')){_0xc822a2=0x1;}if(_0xc822a2>this[_0xcb6e('0x20')]){_0xc822a2=this['maxNumberOriginate'];}_0x325781[_0xcb6e('0x1d1')]+=_0xc822a2;for(var _0x127bbc in this[_0xcb6e('0x1e')]){if(this[_0xcb6e('0x1e')][_0xcb6e('0xbc')](_0x127bbc)){if(this[_0xcb6e('0x1e')][_0x127bbc][_0xcb6e('0xd5')]===_0xcb6e('0x1d9')&&this[_0xcb6e('0x1e')][_0x127bbc][_0xcb6e('0xca')]===_0xcb6e('0xcb')){_0x376788[_0xcb6e('0xfe')](this[_0xcb6e('0x1e')][_0x127bbc]['id']);}}}this[_0xcb6e('0xb5')](_0x325781['id'],_0x376788,_0xc822a2,_0x325781[_0xcb6e('0x1d2')])['then'](function(_0x164f0e){_0x325781[_0xcb6e('0x1d1')]-=_0xc822a2;_0x325781['temp']=_0x325781[_0xcb6e('0x1d1')]>0x0?_0x325781[_0xcb6e('0x1d1')]:0x0;if(!checkContactEmpty(_0x164f0e)){_0x54512a[_0xcb6e('0xa9')](_0x325781)[_0xcb6e('0xac')](sendMessageReschedule(_0x325781))[_0xcb6e('0xa2')](loggerCatch('[countReScheduled]\x20'));}else{_0x325781[_0xcb6e('0x8d')]+=_0x164f0e[_0xcb6e('0x8c')];_0x325781['message']=_0x325781['dialMethod']==='booked'?'ACTIVE':_0xcb6e('0x1d3');for(var _0x451724=0x0;_0x451724<_0x164f0e['length'];_0x451724+=0x1){if(_[_0xcb6e('0xce')](_0x164f0e[_0x451724])||_['isNil'](_0x164f0e[_0x451724][_0xcb6e('0x142')])||_[_0xcb6e('0xce')](_0x164f0e[_0x451724][_0xcb6e('0x142')][_0xcb6e('0x143')])){_0x54512a[_0xcb6e('0xc0')](_0xcb6e('0x1da'),_0x325781,_0x164f0e[_0x451724]);}else{_0x54512a['checkIsBlackList'](_['pick'](_0x164f0e[_0x451724],[_0xcb6e('0xc6'),_0xcb6e('0x1d4')]))[_0xcb6e('0xac')](_0x54512a[_0xcb6e('0x1d5')](_0x325781,_0x164f0e[_0x451724]))[_0xcb6e('0xa2')](_0x54512a['loggerHandler'](_0xcb6e('0x1da'),_0x325781));}}}})[_0xcb6e('0xa2')](loggerGetContactDialer(_0xcb6e('0x1db'),_0x325781,_0xc822a2));}};Dialer[_0xcb6e('0x1a')][_0xcb6e('0x81')]=function(_0x491f1b){var _0x30dcab=this;if(_0x491f1b[_0xcb6e('0x1d8')]>0x0){var _0x1d9bbd=_0x491f1b[_0xcb6e('0x1d8')]-_0x491f1b['originated']-_0x491f1b['talking'];if(_0x1d9bbd>0x0){this[_0xcb6e('0x1dc')](_0x491f1b);}else{loggerPredictiveCalls[_0xcb6e('0x71')](_0xcb6e('0x1dd'));}}else{this[_0xcb6e('0x1dc')](_0x491f1b);}};Dialer[_0xcb6e('0x1a')][_0xcb6e('0x1dc')]=function(_0x924e0f){var _0x10c9ed=this;var _0x416c72=[];_0x924e0f['originated']+=0x1;for(var _0x14540d in this[_0xcb6e('0x1e')]){if(this[_0xcb6e('0x1e')][_0xcb6e('0xbc')](_0x14540d)){if(this[_0xcb6e('0x1e')][_0x14540d][_0xcb6e('0xd5')]===_0xcb6e('0x1d9')&&this[_0xcb6e('0x1e')][_0x14540d][_0xcb6e('0xca')]===_0xcb6e('0xcb')){_0x416c72[_0xcb6e('0xfe')](this[_0xcb6e('0x1e')][_0x14540d]['id']);}}}this[_0xcb6e('0xb5')](_0x924e0f['id'],_0x416c72,0x1,_0x924e0f[_0xcb6e('0x1d2')])[_0xcb6e('0xac')](function(_0x9f13c7){if(!checkContactEmpty(_0x9f13c7)){checkContactLowerLimitOriginate(_0x924e0f,0x1,0x0);_0x10c9ed[_0xcb6e('0xa9')](_0x924e0f)[_0xcb6e('0xac')](sendMessageReschedule(_0x924e0f))[_0xcb6e('0xa2')](loggerCatch(_0xcb6e('0xab')));}else{_0x924e0f['message']=_0xcb6e('0x1d3');if(_[_0xcb6e('0xce')](_0x9f13c7[0x0])||_[_0xcb6e('0xce')](_0x9f13c7[0x0][_0xcb6e('0x142')])||_[_0xcb6e('0xce')](_0x9f13c7[0x0][_0xcb6e('0x142')][_0xcb6e('0x143')])){_0x10c9ed[_0xcb6e('0xc0')]('[actionOriginate]\x20',_0x924e0f,_0x9f13c7[0x0]);}else{_0x10c9ed['checkIsBlackList'](_['pick'](_0x9f13c7[0x0],[_0xcb6e('0xc6'),'Contact.phone']))[_0xcb6e('0xac')](_0x10c9ed['checkContactBlack'](_0x924e0f,_0x9f13c7[0x0]))[_0xcb6e('0xa2')](_0x10c9ed[_0xcb6e('0xbf')](_0xcb6e('0x1de'),_0x924e0f));}}})[_0xcb6e('0xa2')](loggerGetContactDialer('[getContactDialerPredictive]',_0x924e0f,0x1));emitVoiceQueueSummary(_0x924e0f);};Dialer['prototype'][_0xcb6e('0x1ad')]=function(_0x5cd58a,_0x404cfc,_0x2e319d,_0x46b403,_0x5e4819,_0x370c69){loggerPredictive[_0xcb6e('0x71')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x1df'),_0x5cd58a);loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x1e0'),_0x404cfc);loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x1e1'),_0x2e319d);loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x1e2'),_0x46b403);loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x1e3'),_0x5e4819);loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x78'));return new BPromise(function(_0x21dcfc,_0x19b535){if(_0x5cd58a<=0x0||isNaN(_0x5cd58a)){return _0x19b535(msgResponse(_0xcb6e('0x1e4'),_0xcb6e('0x170'),_0xcb6e('0x1e5')+_0x5cd58a));}if(_0x2e319d<=0x0||isNaN(_0x2e319d)){return _0x19b535(msgResponse('[abandonmentRate]',_0xcb6e('0x170'),_0xcb6e('0x1e6')+_0x2e319d));}if(_0x46b403<=0x0||isNaN(_0x46b403)){return _0x19b535(msgResponse('[abandonmentRate]','Error',_0xcb6e('0x1e7')+_0x46b403));}if(_0x404cfc<=0x0||isNaN(_0x404cfc)){return _0x19b535(msgResponse(_0xcb6e('0x1e4'),_0xcb6e('0x170'),'interval\x20=\x20'+_0x404cfc));}if(_0x5e4819<=0x0||isNaN(_0x5e4819)){return _0x19b535(msgResponse(_0xcb6e('0x1e4'),_0xcb6e('0x170'),_0xcb6e('0x1e8')+_0x5e4819));}_0x370c69=_0x370c69||0x0;var _0x2e4c1c=0x1/_0x2e319d;var _0x583dd4=0x0;var _0x47ae1d=0x0;var _0x586e06=0x0;var _0x5021fc=0x0;for(var _0x41aaea=0x0;_0x586e06<_0x5e4819;_0x41aaea+=0x1){_0x47ae1d=_0x41aaea/_0x404cfc;_0x583dd4=(_0x46b403*_0x47ae1d+_0x370c69)/_0x2e4c1c;_0x586e06=erlangb(_0x583dd4,_0x5cd58a);_0x5021fc=_0x583dd4/_0x5cd58a*(0x1-erlangb(_0x583dd4,_0x5cd58a));}return _0x21dcfc({'erlangCalls':_0x41aaea,'erlangCallToSecond':_0x404cfc/_0x41aaea,'erlangAbandonmentRate':_0x586e06,'erlangBusyFactor':_0x5021fc});});};Dialer['prototype'][_0xcb6e('0x1b6')]=function(_0x3ccd90,_0x541dfc,_0x176f5f,_0x49fd96,_0x45e20c,_0x1ca1b6){loggerPredictive['info'](_0xcb6e('0x1e9'));loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x1df'),_0x3ccd90);loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x1e0'),_0x541dfc);loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x1e1'),_0x176f5f);loggerPredictive[_0xcb6e('0x71')]('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',_0x49fd96);loggerPredictive[_0xcb6e('0x71')](_0xcb6e('0x1ea'),_0x45e20c);loggerPredictive['info'](_0xcb6e('0x78'));return new BPromise(function(_0x9ab39a,_0x53cf17){if(_0x3ccd90<=0x0||isNaN(_0x3ccd90)){return _0x53cf17(msgResponse(_0xcb6e('0x1eb'),_0xcb6e('0x170'),_0xcb6e('0x1e5')+_0x3ccd90));}if(_0x176f5f<=0x0||isNaN(_0x176f5f)){return _0x53cf17(msgResponse('[busyFactor]','Error',_0xcb6e('0x1e6')+_0x176f5f));}if(_0x49fd96<=0x0||isNaN(_0x49fd96)){return _0x53cf17(msgResponse('[busyFactor]',_0xcb6e('0x170'),'p\x20=\x20'+_0x49fd96));}if(_0x541dfc<=0x0||isNaN(_0x541dfc)){return _0x53cf17(msgResponse(_0xcb6e('0x1eb'),_0xcb6e('0x170'),_0xcb6e('0x1ec')+_0x541dfc));}if(_0x45e20c<=0x0||isNaN(_0x45e20c)){return _0x53cf17(msgResponse(_0xcb6e('0x1eb'),_0xcb6e('0x170'),_0xcb6e('0x1ed')+_0x45e20c));}_0x1ca1b6=_0x1ca1b6||0x0;var _0x23249a=0x1/_0x176f5f;var _0x18d19d=0x0;var _0x795ad3=0x0;var _0x482d5c=0x0;var _0x4e8564=0x0;for(var _0x2617f4=0x0;_0x4e8564<_0x45e20c;_0x2617f4+=0x1){_0x795ad3=_0x2617f4/_0x541dfc;_0x18d19d=(_0x49fd96*_0x795ad3+_0x1ca1b6)/_0x23249a;_0x482d5c=erlangb(_0x18d19d,_0x3ccd90);_0x4e8564=_0x18d19d/_0x3ccd90*(0x1-erlangb(_0x18d19d,_0x3ccd90));}return _0x9ab39a({'erlangCalls':_0x2617f4,'erlangCallToSecond':_0x541dfc/_0x2617f4,'erlangAbandonmentRate':_0x482d5c,'erlangBusyFactor':_0x4e8564});});};module[_0xcb6e('0x1ee')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 3b47080..44b55fd 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 _0xd644=['starttime','responsetime','droptime','endtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','number'];(function(_0x5b7829,_0x399e71){var _0x35bae1=function(_0x2bdea1){while(--_0x2bdea1){_0x5b7829['push'](_0x5b7829['shift']());}};_0x35bae1(++_0x399e71);}(_0xd644,0x1d0));var _0x4d64=function(_0x5c0fd7,_0x19ff7b){_0x5c0fd7=_0x5c0fd7-0x0;var _0x14eba8=_0xd644[_0x5c0fd7];return _0x14eba8;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x4d64('0x0'));function getSeconds(_0x5877b7,_0xba822e){var _0x55970a=moment(_0x5877b7)['milliseconds'](0x0);var _0x3d105a=moment(_0xba822e)[_0x4d64('0x1')](0x0);return _0x55970a[_0x4d64('0x2')](_0x3d105a,_0x4d64('0x3'));}function QueueCallerAbandon(_0x4b4af7,_0x5e27a7){this[_0x4d64('0x4')]=_0x4b4af7['scheduledat'];this['type']=_0x4b4af7[_0x4d64('0x5')];this[_0x4d64('0x6')]=_0x4b4af7[_0x4d64('0x5')]===_0x4d64('0x7')?_0x4d64('0x8'):_0x4b4af7['type'];this[_0x4d64('0x9')]=_0x4b4af7[_0x4d64('0x9')];this[_0x4d64('0xa')]=_0x4b4af7[_0x4d64('0xa')];this[_0x4d64('0xb')]=_0x4b4af7['countnoanswerretry'];this[_0x4d64('0xc')]=_0x4b4af7[_0x4d64('0x9')]+_0x4b4af7[_0x4d64('0xa')]+_0x4b4af7[_0x4d64('0xb')];this[_0x4d64('0xd')]=_0x5e27a7[_0x4d64('0xd')];this[_0x4d64('0xe')]=_0x4b4af7[_0x4d64('0xf')];this['calleridnum']=_0x4b4af7[_0x4d64('0x10')];this[_0x4d64('0x11')]=_0x4b4af7[_0x4d64('0x11')];this[_0x4d64('0x12')]=_0x4b4af7[_0x4d64('0x12')];this[_0x4d64('0x13')]=_0x4b4af7['droptime'];this[_0x4d64('0x14')]=this[_0x4d64('0x13')];this['ringtime']=getSeconds(_0x4b4af7[_0x4d64('0x12')],_0x4b4af7['starttime']);this[_0x4d64('0x15')]=getSeconds(this[_0x4d64('0x13')],_0x4b4af7[_0x4d64('0x12')]);this[_0x4d64('0x16')]=0x0;this[_0x4d64('0x8')]=_0x5e27a7['queue'];this[_0x4d64('0x17')]=_0x5e27a7[_0x4d64('0x18')];this[_0x4d64('0x19')]=_0x5e27a7[_0x4d64('0x19')];this[_0x4d64('0x1a')]=_0x4b4af7[_0x4d64('0x1a')];this[_0x4d64('0x1b')]=_0x4b4af7[_0x4d64('0x1b')];this[_0x4d64('0x1c')]=_0x4b4af7[_0x4d64('0x1c')];this['recallme']=_0x4b4af7['recallme'];this[_0x4d64('0x1d')]=_0x4b4af7[_0x4d64('0x1d')];this[_0x4d64('0x1e')]=_0x4b4af7[_0x4d64('0x1e')];this[_0x4d64('0x1f')]=_0x4b4af7[_0x4d64('0x1f')];this[_0x4d64('0x20')]=_0x4b4af7[_0x4d64('0x20')];this[_0x4d64('0x21')]=_0x4b4af7['CampaignId'];this['originatecalleridnum']=_0x4b4af7[_0x4d64('0x22')]||'';this[_0x4d64('0x23')]=_0x4b4af7[_0x4d64('0x23')]||'';}module[_0x4d64('0x24')]=QueueCallerAbandon; \ No newline at end of file +var _0x1b89=['type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','name','starttime','responsetime','ringtime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','diff','seconds','scheduledat'];(function(_0x114321,_0x1ce445){var _0x3f070f=function(_0x260dfa){while(--_0x260dfa){_0x114321['push'](_0x114321['shift']());}};_0x3f070f(++_0x1ce445);}(_0x1b89,0x187));var _0x91b8=function(_0x2286c3,_0x11775f){_0x2286c3=_0x2286c3-0x0;var _0x2f6721=_0x1b89[_0x2286c3];return _0x2f6721;};'use strict';var util=require(_0x91b8('0x0'));var _=require(_0x91b8('0x1'));var moment=require('moment');function getSeconds(_0x30f3da,_0x2b9efb){var _0x3b48e3=moment(_0x30f3da)['milliseconds'](0x0);var _0x14316e=moment(_0x2b9efb)['milliseconds'](0x0);return _0x3b48e3[_0x91b8('0x2')](_0x14316e,_0x91b8('0x3'));}function QueueCallerAbandon(_0x391371,_0x1a9686){this[_0x91b8('0x4')]=_0x391371[_0x91b8('0x4')];this[_0x91b8('0x5')]=_0x391371[_0x91b8('0x5')];this[_0x91b8('0x6')]=_0x391371[_0x91b8('0x5')]===_0x91b8('0x7')?_0x91b8('0x8'):_0x391371[_0x91b8('0x5')];this['countbusyretry']=_0x391371[_0x91b8('0x9')];this['countcongestionretry']=_0x391371[_0x91b8('0xa')];this[_0x91b8('0xb')]=_0x391371[_0x91b8('0xb')];this['countglobal']=_0x391371[_0x91b8('0x9')]+_0x391371[_0x91b8('0xa')]+_0x391371[_0x91b8('0xb')];this[_0x91b8('0xc')]=_0x1a9686['uniqueid'];this[_0x91b8('0xd')]=_0x391371[_0x91b8('0xe')];this['calleridnum']=_0x391371['number'];this[_0x91b8('0xf')]=_0x391371[_0x91b8('0xf')];this['responsetime']=_0x391371[_0x91b8('0x10')];this['droptime']=_0x391371['droptime'];this['endtime']=this['droptime'];this[_0x91b8('0x11')]=getSeconds(_0x391371[_0x91b8('0x10')],_0x391371[_0x91b8('0xf')]);this[_0x91b8('0x12')]=getSeconds(this['droptime'],_0x391371['responsetime']);this[_0x91b8('0x13')]=0x0;this[_0x91b8('0x8')]=_0x1a9686['queue'];this['membername']=_0x1a9686[_0x91b8('0x14')];this[_0x91b8('0x15')]=_0x1a9686['reason'];this[_0x91b8('0x16')]=_0x391371[_0x91b8('0x16')];this[_0x91b8('0x17')]=_0x391371['callbackuniqueid'];this['callbackat']=_0x391371[_0x91b8('0x18')];this[_0x91b8('0x19')]=_0x391371[_0x91b8('0x19')];this[_0x91b8('0x1a')]=_0x391371[_0x91b8('0x1a')];this[_0x91b8('0x1b')]=_0x391371['ListId'];this[_0x91b8('0x1c')]=_0x391371[_0x91b8('0x1c')];this[_0x91b8('0x1d')]=_0x391371['VoiceQueueId'];this[_0x91b8('0x1e')]=_0x391371[_0x91b8('0x1e')];this[_0x91b8('0x1f')]=_0x391371[_0x91b8('0x1f')]||'';this['originatecalleridname']=_0x391371[_0x91b8('0x20')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index cbb3e79..63fd25f 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 _0x36c8=['%s/%s/%s','Trunk','name','fax','localstationid','headerinfo','path','AttachmentId','exports','lodash','format'];(function(_0x4c33fc,_0x2b84e9){var _0x1c7d4d=function(_0xdb8121){while(--_0xdb8121){_0x4c33fc['push'](_0x4c33fc['shift']());}};_0x1c7d4d(++_0x2b84e9);}(_0x36c8,0x132));var _0x836c=function(_0x54c715,_0xd765a5){_0x54c715=_0x54c715-0x0;var _0x48b500=_0x36c8[_0x54c715];return _0x48b500;};'use strict';var util=require('util');var _=require(_0x836c('0x0'));var moment=require('moment');function Action(_0x127b64,_0x37c461,_0x43bc0e){this['uniqueid']=_0x127b64||undefined;this['channel']=util[_0x836c('0x1')](_0x836c('0x2'),_0x37c461['tech'],_0x37c461[_0x836c('0x3')][_0x836c('0x4')],_0x43bc0e[_0x836c('0x5')]);this[_0x836c('0x6')]=_0x37c461[_0x836c('0x6')];this[_0x836c('0x7')]=_0x37c461[_0x836c('0x7')];this[_0x836c('0x8')]=_0x43bc0e[_0x836c('0x8')];this['AttachmentId']=_0x43bc0e[_0x836c('0x9')];}module[_0x836c('0xa')]=Action; \ No newline at end of file +var _0x95c3=['lodash','channel','format','%s/%s/%s','tech','Trunk','name','fax','localstationid','headerinfo','path','AttachmentId','exports'];(function(_0xfd9239,_0x2fea4f){var _0x48f447=function(_0x49af16){while(--_0x49af16){_0xfd9239['push'](_0xfd9239['shift']());}};_0x48f447(++_0x2fea4f);}(_0x95c3,0x1ee));var _0x395c=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x95c3[_0x28669c];return _0x4a3af6;};'use strict';var util=require('util');var _=require(_0x395c('0x0'));var moment=require('moment');function Action(_0x36a983,_0x44720e,_0x32bba9){this['uniqueid']=_0x36a983||undefined;this[_0x395c('0x1')]=util[_0x395c('0x2')](_0x395c('0x3'),_0x44720e[_0x395c('0x4')],_0x44720e[_0x395c('0x5')][_0x395c('0x6')],_0x32bba9[_0x395c('0x7')]);this[_0x395c('0x8')]=_0x44720e['localstationid'];this['headerinfo']=_0x44720e[_0x395c('0x9')];this['path']=_0x32bba9[_0x395c('0xa')];this[_0x395c('0xb')]=_0x32bba9[_0x395c('0xb')];}module[_0x395c('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index dbaa2b3..6f0d6ae 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 _0x8e54=['isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','prototype','from-voip-provider','faxAccounts','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstatedesc','hasOwnProperty','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','application/pdf','then','notify','parse','.pdf','catch','error','\x20notify\x20','stringify','syncOriginateResponse','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk'];(function(_0x1fe2c4,_0x3b8c6e){var _0x3695e9=function(_0x29c81b){while(--_0x29c81b){_0x1fe2c4['push'](_0x1fe2c4['shift']());}};_0x3695e9(++_0x3b8c6e);}(_0x8e54,0x108));var _0x48e5=function(_0x206ee3,_0x2ccd5b){_0x206ee3=_0x206ee3-0x0;var _0x1fcac9=_0x8e54[_0x206ee3];return _0x1fcac9;};'use strict';var util=require(_0x48e5('0x0'));var _=require(_0x48e5('0x1'));var BPromise=require(_0x48e5('0x2'));var uuid=require(_0x48e5('0x3'));var moment=require(_0x48e5('0x4'));var path=require(_0x48e5('0x5'));var tiff2pdf=require(_0x48e5('0x6'));var gs=require(_0x48e5('0x7'));var logger=require('../../../config/logger')(_0x48e5('0x8'));var ami=require(_0x48e5('0x9'));var rpcDb=require(_0x48e5('0xa'));var Channel=require(_0x48e5('0xb'));var ut=require(_0x48e5('0xc'));var Action=require(_0x48e5('0xd'));var faxAccount=require(_0x48e5('0xe'));var attachment=require(_0x48e5('0xf'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x2cc6b0){this[_0x48e5('0x10')]={};this['faxAccounts']=_0x2cc6b0['faxAccounts'];this['trunks']=_0x2cc6b0[_0x48e5('0x11')];this[_0x48e5('0x12')]={};ami['on'](_0x48e5('0x13'),this[_0x48e5('0x14')][_0x48e5('0x15')](this));ami['on']('varset',this[_0x48e5('0x16')][_0x48e5('0x15')](this));ami['on']('newstate',this['syncNewState'][_0x48e5('0x15')](this));ami['on'](_0x48e5('0x17'),this[_0x48e5('0x18')]['bind'](this));ami['on'](_0x48e5('0x19'),this[_0x48e5('0x1a')][_0x48e5('0x15')](this));ami['on'](_0x48e5('0x1b'),this[_0x48e5('0x1c')][_0x48e5('0x15')](this));ami['on'](_0x48e5('0x1d'),this[_0x48e5('0x1e')][_0x48e5('0x15')](this));ami['on'](_0x48e5('0x1f'),this['syncOriginateResponse'][_0x48e5('0x15')](this));}Fax[_0x48e5('0x20')][_0x48e5('0x14')]=function(_0x4800ec){if(_0x4800ec['context']===_0x48e5('0x21')){for(var _0x59973f in this[_0x48e5('0x22')]){if(this[_0x48e5('0x22')]['hasOwnProperty'](_0x59973f)){if(_0x4800ec[_0x48e5('0x23')]===this[_0x48e5('0x22')][_0x59973f]['localstationid']){this[_0x48e5('0x10')][_0x4800ec[_0x48e5('0x24')]]={};this[_0x48e5('0x10')][_0x4800ec[_0x48e5('0x24')]][_0x48e5('0x25')]=_0x4800ec[_0x48e5('0x25')];this[_0x48e5('0x10')][_0x4800ec[_0x48e5('0x24')]]['id']=this[_0x48e5('0x22')][_0x59973f]['id'];this['channels'][_0x4800ec[_0x48e5('0x24')]]['name']=this['faxAccounts'][_0x59973f][_0x48e5('0x26')];logger[_0x48e5('0x27')](_0x4800ec['uniqueid'],_0x48e5('0x28'));}}}}if(this[_0x48e5('0x12')][_0x4800ec[_0x48e5('0x24')]]){this[_0x48e5('0x10')][_0x4800ec[_0x48e5('0x24')]]={};this[_0x48e5('0x10')][_0x4800ec[_0x48e5('0x24')]][_0x48e5('0x25')]=_0x4800ec[_0x48e5('0x25')];logger['info'](_0x4800ec['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x48e5('0x20')][_0x48e5('0x16')]=function(_0x3e6395){if(this[_0x48e5('0x10')][_0x3e6395[_0x48e5('0x24')]]){for(var _0x5e3246 in _0x3e6395[_0x48e5('0x29')]){if(_0x3e6395[_0x48e5('0x29')]['hasOwnProperty'](_0x5e3246)){this[_0x48e5('0x10')][_0x3e6395['uniqueid']][_0x5e3246]=_0x3e6395[_0x48e5('0x2a')];}}}};Fax[_0x48e5('0x20')][_0x48e5('0x2b')]=function(_0x4fb211){if(this[_0x48e5('0x10')][_0x4fb211[_0x48e5('0x24')]]){this[_0x48e5('0x10')][_0x4fb211['uniqueid']]['channelstate']=_0x4fb211['channelstate'];this['channels'][_0x4fb211[_0x48e5('0x24')]][_0x48e5('0x2c')]=_0x4fb211[_0x48e5('0x2c')];}};Fax['prototype']['syncNewExten']=function(_0x5ad8be){if(this[_0x48e5('0x10')][_0x5ad8be['uniqueid']]){for(var _0x4a08ea in _0x5ad8be[_0x48e5('0x29')]){if(_0x5ad8be[_0x48e5('0x29')][_0x48e5('0x2d')](_0x4a08ea)){this[_0x48e5('0x10')][_0x5ad8be[_0x48e5('0x24')]][_0x4a08ea]=_0x5ad8be[_0x48e5('0x2a')];}}}};Fax['prototype'][_0x48e5('0x1a')]=function(_0x2f18f8){if(this[_0x48e5('0x10')][_0x2f18f8[_0x48e5('0x24')]]){this[_0x48e5('0x10')][_0x2f18f8[_0x48e5('0x24')]]['operation']=_0x2f18f8['operation'];this['channels'][_0x2f18f8[_0x48e5('0x24')]][_0x48e5('0x2e')]=_0x2f18f8['status'];this[_0x48e5('0x10')][_0x2f18f8[_0x48e5('0x24')]][_0x48e5('0x2f')]=_0x2f18f8[_0x48e5('0x2f')];this[_0x48e5('0x10')][_0x2f18f8[_0x48e5('0x24')]][_0x48e5('0x30')]=_0x2f18f8[_0x48e5('0x30')];logger[_0x48e5('0x27')](_0x2f18f8['uniqueid'],_0x48e5('0x31'));}};Fax['prototype'][_0x48e5('0x1c')]=function(_0x3ff845){var _0x22fa42=this;if(this[_0x48e5('0x10')][_0x3ff845['uniqueid']]){var _0x58575f=this['channels'][_0x3ff845[_0x48e5('0x24')]]['id'];this[_0x48e5('0x10')][_0x3ff845['uniqueid']][_0x48e5('0x32')]=_0x3ff845[_0x48e5('0x32')];this[_0x48e5('0x10')][_0x3ff845[_0x48e5('0x24')]][_0x48e5('0x33')]=_0x3ff845['pagestransferred'];this[_0x48e5('0x10')][_0x3ff845[_0x48e5('0x24')]][_0x48e5('0x2f')]=_0x3ff845[_0x48e5('0x2f')];this[_0x48e5('0x10')][_0x3ff845[_0x48e5('0x24')]][_0x48e5('0x34')]=_0x3ff845[_0x48e5('0x34')];this[_0x48e5('0x10')][_0x3ff845[_0x48e5('0x24')]][_0x48e5('0x35')]=_0x3ff845['transferrate'];this[_0x48e5('0x10')][_0x3ff845[_0x48e5('0x24')]][_0x48e5('0x30')]=_0x3ff845[_0x48e5('0x30')];this[_0x48e5('0x10')][_0x3ff845[_0x48e5('0x24')]]['calleridnum']=_0x3ff845[_0x48e5('0x36')];if(this[_0x48e5('0x10')][_0x3ff845[_0x48e5('0x24')]][_0x48e5('0x33')]>0x0){tiff2pdf(_0x3ff845[_0x48e5('0x30')],_0x48e5('0x37'),function(_0x2a514e){logger[_0x48e5('0x27')](_0x3ff845[_0x48e5('0x24')],'\x20result\x20conversion\x20file\x20',_0x2a514e[_0x48e5('0x38')]);attachment[_0x48e5('0x39')]({'name':path['parse'](_0x3ff845['filename'])[_0x48e5('0x26')],'basename':path['parse'](_0x3ff845[_0x48e5('0x30')])['name']+'.pdf','type':_0x48e5('0x3a')})[_0x48e5('0x3b')](function(_0x18c527){faxAccount[_0x48e5('0x3c')](_0x58575f,{'from':_0x3ff845['calleridnum'],'mapKey':_0x48e5('0x8'),'body':path[_0x48e5('0x3d')](_0x3ff845[_0x48e5('0x30')])['name']+_0x48e5('0x3e'),'AttachmentId':_0x18c527['id']})[_0x48e5('0x3f')](function(_0x3107df){logger[_0x48e5('0x40')](_0x3ff845[_0x48e5('0x24')],_0x48e5('0x41'),JSON['stringify'](_0x3107df));});})[_0x48e5('0x3f')](function(_0x399cc3){logger[_0x48e5('0x40')](_0x3ff845[_0x48e5('0x24')],'\x20receiveFax\x20',JSON[_0x48e5('0x42')](_0x399cc3));});});}logger[_0x48e5('0x27')](_0x3ff845['uniqueid'],'\x20receiveFax\x20');}};Fax['prototype'][_0x48e5('0x43')]=function(_0x3f98c8){if(this[_0x48e5('0x12')][_0x3f98c8[_0x48e5('0x24')]]){_['merge'](this[_0x48e5('0x10')][_0x3f98c8[_0x48e5('0x24')]],_[_0x48e5('0x44')](_0x3f98c8,[_0x48e5('0x45'),_0x48e5('0x46')]));}};function updateStatus(_0x44a7c1){if(_0x44a7c1[_0x48e5('0x47')]){faxMessage[_0x48e5('0x48')](_0x44a7c1[_0x48e5('0x47')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x48e5('0x3b')](function(_0x34e42c){ut[_0x48e5('0x49')](_0x48e5('0x4a'),_0x34e42c);})[_0x48e5('0x3f')](function(_0x44dd16){ut[_0x48e5('0x49')](_0x48e5('0x4b'),_0x44dd16);});}else{ut[_0x48e5('0x49')](_0x48e5('0x4c'));}}Fax['prototype'][_0x48e5('0x4d')]=function(_0x2fccda,_0x4230b4,_0x3654e7){var _0x42865e=this;var _0xa1c0e={};if(_0x4230b4){_0xa1c0e={'read':_0x4230b4};}else{_0xa1c0e={'failMessage':_0x3654e7};}if(this[_0x48e5('0x12')][_0x2fccda][_0x48e5('0x47')]){faxMessage[_0x48e5('0x48')](this[_0x48e5('0x12')][_0x2fccda][_0x48e5('0x47')],_0xa1c0e)[_0x48e5('0x3b')](function(_0x31176a){ut[_0x48e5('0x49')]('[Fax][Message][Updated]',_0x31176a);})[_0x48e5('0x3f')](function(_0x12eab1){ut[_0x48e5('0x49')](_0x48e5('0x4e'),_0x12eab1);})['finally'](function(){delete _0x42865e[_0x48e5('0x10')][_0x2fccda];delete _0x42865e[_0x48e5('0x12')][_0x2fccda];});}else{ut[_0x48e5('0x49')]('[Fax][Message][NoUpdate2]');delete this[_0x48e5('0x10')][_0x2fccda];delete this[_0x48e5('0x12')][_0x2fccda];}};Fax[_0x48e5('0x20')]['syncHangup']=function(_0x2e59c5){var _0x4ebd3a=this;if(this['channels'][_0x2e59c5['uniqueid']]){if(this[_0x48e5('0x12')][_0x2e59c5['uniqueid']]){this[_0x48e5('0x10')][_0x2e59c5[_0x48e5('0x24')]]['id']=this[_0x48e5('0x12')][_0x2e59c5[_0x48e5('0x24')]]['id'];this[_0x48e5('0x10')][_0x2e59c5[_0x48e5('0x24')]][_0x48e5('0x26')]=this[_0x48e5('0x12')][_0x2e59c5[_0x48e5('0x24')]][_0x48e5('0x26')];}logger['info'](_0x2e59c5['uniqueid'],this[_0x48e5('0x12')][_0x2e59c5[_0x48e5('0x24')]]?'\x20hangup\x20sendFile\x20':_0x48e5('0x4f'),JSON[_0x48e5('0x42')](this[_0x48e5('0x10')][_0x2e59c5[_0x48e5('0x24')]]));if(this[_0x48e5('0x12')][_0x2e59c5[_0x48e5('0x24')]]){if(this['channels'][_0x2e59c5[_0x48e5('0x24')]][_0x48e5('0x50')]>0x0&&this[_0x48e5('0x10')][_0x2e59c5['uniqueid']]['faxstatus']===_0x48e5('0x51')){this[_0x48e5('0x4d')](_0x2e59c5['uniqueid'],!![]);}else{this[_0x48e5('0x4d')](_0x2e59c5[_0x48e5('0x24')],![],this[_0x48e5('0x10')][_0x2e59c5[_0x48e5('0x24')]][_0x48e5('0x52')]?_0x48e5('0x53')+this[_0x48e5('0x10')][_0x2e59c5[_0x48e5('0x24')]][_0x48e5('0x52')]:_0x48e5('0x54'));}}}};Fax[_0x48e5('0x20')][_0x48e5('0x55')]=function(_0x1b8da1){var _0x298113=this;return new BPromise(function(_0x1a9588,_0x21c487){_0x298113['execOriginate'](_0x1b8da1,_0x298113[_0x48e5('0x22')][_0x1b8da1[_0x48e5('0x56')]])[_0x48e5('0x3b')](function(_0x2d637b){ut['logger'](_0x48e5('0x57'),_0x2d637b);_0x1a9588(ut['message'](_0x48e5('0x58')));})[_0x48e5('0x3f')](function(_0x2cf0b5){ut[_0x48e5('0x49')](_0x48e5('0x59'),_0x2cf0b5);updateStatus(_0x1b8da1);_0x21c487(ut[_0x48e5('0x38')](_0x48e5('0x5a')));});});};Fax[_0x48e5('0x20')][_0x48e5('0x5b')]=function(_0x2fd675){var _0x27d2ae=this;return new BPromise(function(_0x4fadc2,_0x5cc581){var _0x5aca66=_0x27d2ae['checkTrunk'](_0x27d2ae[_0x48e5('0x22')][_0x2fd675[_0x48e5('0x56')]][_0x48e5('0x5c')],_0x2fd675);if(_0x5aca66[_0x48e5('0x5d')]){_0x4fadc2(ut[_0x48e5('0x38')]('Trunk\x20Reachable'));}else{_0x5cc581(ut[_0x48e5('0x38')](_0x5aca66[_0x48e5('0x38')]));}});};function originate(_0x342ebd,_0x18adf1,_0x213ffa){return new BPromise(function(_0x1fe264,_0x1ffa5b){if(_0x213ffa){var _0x1c4363=util[_0x48e5('0x5e')](_0x48e5('0x5f'),path[_0x48e5('0x3d')](_0x342ebd[_0x48e5('0x5')])[_0x48e5('0x26')],_0x342ebd[_0x48e5('0x5')]);gs[_0x48e5('0x60')](_0x1c4363)['then'](function(){_0x342ebd[_0x48e5('0x5')]=util['format'](_0x48e5('0x61'),path['parse'](_0x342ebd[_0x48e5('0x5')])[_0x48e5('0x62')],path['parse'](_0x342ebd[_0x48e5('0x5')])[_0x48e5('0x26')]);_0x18adf1[_0x48e5('0x63')]=_0x342ebd[_0x48e5('0x5')];ut[_0x48e5('0x49')](_0x48e5('0x64'),'');ami[_0x48e5('0x65')](ut['variablesAction'](_0x342ebd,_0x18adf1))['then'](function(_0x1fae34){_0x1fe264(_0x1fae34);})[_0x48e5('0x3f')](function(_0xc8111){_0x1ffa5b(_0xc8111);});})[_0x48e5('0x3f')](function(_0x4edd93){_0x1ffa5b(_0x4edd93);});}else{ami['Action'](ut['variablesAction'](_0x342ebd,_0x18adf1))[_0x48e5('0x3b')](function(_0x4a7a99){_0x1fe264(_0x4a7a99);})['catch'](function(_0x8176c5){_0x1ffa5b(_0x8176c5);});}});}Fax['prototype'][_0x48e5('0x66')]=function(_0x410cb7,_0x4c97cc){var _0x59a19e=this;return new BPromise(function(_0x2d8e55,_0x800964){var _0x2cfe20=uuid['v4']();var _0x34a80e=ut[_0x48e5('0x67')](_0x410cb7,_0x4c97cc);_0x59a19e['actions'][_0x2cfe20]=new Action(_0x2cfe20,_0x4c97cc,_0x410cb7);var _0x25d521=_0x59a19e[_0x48e5('0x12')][_0x2cfe20];if(path[_0x48e5('0x3d')](_0x410cb7[_0x48e5('0x5')])[_0x48e5('0x68')]===_0x48e5('0x3e')){originate(_0x25d521,_0x34a80e,!![])['then'](function(_0x313cb4){_0x2d8e55(_0x313cb4);})[_0x48e5('0x3f')](function(_0x16e37b){_0x800964(_0x16e37b);});}else{originate(_0x25d521,_0x34a80e,![])['then'](function(_0x2cac60){_0x2d8e55(_0x2cac60);})[_0x48e5('0x3f')](function(_0x2905d3){_0x800964(_0x2905d3);});}});};Fax[_0x48e5('0x20')][_0x48e5('0x69')]=function(_0x13901a){return!_['isNil'](_0x13901a)&&!_[_0x48e5('0x6a')](_0x13901a[_0x48e5('0x26')])&&!_['isNil'](_0x13901a['active'])&&_0x13901a[_0x48e5('0x6b')]&&!_[_0x48e5('0x6a')](this[_0x48e5('0x11')][util[_0x48e5('0x5e')]('SIP/%s',_0x13901a['name'])])&&!_['isNil'](this[_0x48e5('0x11')][util['format'](_0x48e5('0x6c'),_0x13901a[_0x48e5('0x26')])][_0x48e5('0x2e')])&&(this[_0x48e5('0x11')][util['format'](_0x48e5('0x6c'),_0x13901a[_0x48e5('0x26')])][_0x48e5('0x2e')]==='reachable'||this['trunks'][util['format']('SIP/%s',_0x13901a['name'])][_0x48e5('0x2e')]===_0x48e5('0x6d'));};Fax['prototype'][_0x48e5('0x6e')]=function(_0x19e13d,_0x53feca){if(!this[_0x48e5('0x69')](_0x19e13d)){ut[_0x48e5('0x49')](_0x48e5('0x6f'),_[_0x48e5('0x6a')](_0x19e13d)?'':_0x19e13d[_0x48e5('0x26')]+_0x48e5('0x70'));return{'isValid':![],'message':_0x48e5('0x71')};}if(_[_0x48e5('0x6a')](_0x53feca[_0x48e5('0x8')])){ut[_0x48e5('0x49')](_0x48e5('0x72'),JSON['stringify'](_0x53feca));return{'isValid':![],'message':_0x48e5('0x73')};}if(_['isNil'](_0x53feca['path'])){ut['logger'](_0x48e5('0x74'),JSON[_0x48e5('0x42')](_0x53feca));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x48e5('0x75')};};module[_0x48e5('0x76')]=Fax; \ No newline at end of file +var _0xd8a9=['execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','util','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','syncNewState','bind','newexten','syncNewExten','faxstatus','syncFaxStatus','hangup','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','updateStatus','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path'];(function(_0x4d3dda,_0x5c2781){var _0x4ba3c6=function(_0x38b4dd){while(--_0x38b4dd){_0x4d3dda['push'](_0x4d3dda['shift']());}};_0x4ba3c6(++_0x5c2781);}(_0xd8a9,0x8c));var _0x9d8a=function(_0x5ec9f7,_0x22a979){_0x5ec9f7=_0x5ec9f7-0x0;var _0x587865=_0xd8a9[_0x5ec9f7];return _0x587865;};'use strict';var util=require(_0x9d8a('0x0'));var _=require(_0x9d8a('0x1'));var BPromise=require(_0x9d8a('0x2'));var uuid=require(_0x9d8a('0x3'));var moment=require(_0x9d8a('0x4'));var path=require('path');var tiff2pdf=require(_0x9d8a('0x5'));var gs=require(_0x9d8a('0x6'));var logger=require(_0x9d8a('0x7'))(_0x9d8a('0x8'));var ami=require('../ami');var rpcDb=require(_0x9d8a('0x9'));var Channel=require(_0x9d8a('0xa'));var ut=require('./util/util');var Action=require(_0x9d8a('0xb'));var faxAccount=require(_0x9d8a('0xc'));var attachment=require(_0x9d8a('0xd'));var faxMessage=require(_0x9d8a('0xe'));function Fax(_0x2a8701){this['channels']={};this[_0x9d8a('0xf')]=_0x2a8701['faxAccounts'];this[_0x9d8a('0x10')]=_0x2a8701[_0x9d8a('0x10')];this[_0x9d8a('0x11')]={};ami['on'](_0x9d8a('0x12'),this[_0x9d8a('0x13')]['bind'](this));ami['on'](_0x9d8a('0x14'),this['syncVarSet']['bind'](this));ami['on']('newstate',this[_0x9d8a('0x15')][_0x9d8a('0x16')](this));ami['on'](_0x9d8a('0x17'),this[_0x9d8a('0x18')]['bind'](this));ami['on'](_0x9d8a('0x19'),this[_0x9d8a('0x1a')][_0x9d8a('0x16')](this));ami['on']('receivefax',this['syncReceiveFax']['bind'](this));ami['on'](_0x9d8a('0x1b'),this['syncHangup'][_0x9d8a('0x16')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x9d8a('0x16')](this));}Fax[_0x9d8a('0x1c')]['syncNewchannel']=function(_0x54ee09){if(_0x54ee09[_0x9d8a('0x1d')]===_0x9d8a('0x1e')){for(var _0xe9eb8e in this[_0x9d8a('0xf')]){if(this['faxAccounts'][_0x9d8a('0x1f')](_0xe9eb8e)){if(_0x54ee09[_0x9d8a('0x20')]===this['faxAccounts'][_0xe9eb8e][_0x9d8a('0x21')]){this[_0x9d8a('0x22')][_0x54ee09['uniqueid']]={};this[_0x9d8a('0x22')][_0x54ee09[_0x9d8a('0x23')]][_0x9d8a('0x24')]=_0x54ee09[_0x9d8a('0x24')];this[_0x9d8a('0x22')][_0x54ee09['uniqueid']]['id']=this[_0x9d8a('0xf')][_0xe9eb8e]['id'];this[_0x9d8a('0x22')][_0x54ee09[_0x9d8a('0x23')]][_0x9d8a('0x25')]=this['faxAccounts'][_0xe9eb8e][_0x9d8a('0x25')];logger[_0x9d8a('0x26')](_0x54ee09[_0x9d8a('0x23')],_0x9d8a('0x27'));}}}}if(this[_0x9d8a('0x11')][_0x54ee09[_0x9d8a('0x23')]]){this['channels'][_0x54ee09[_0x9d8a('0x23')]]={};this[_0x9d8a('0x22')][_0x54ee09[_0x9d8a('0x23')]][_0x9d8a('0x24')]=_0x54ee09[_0x9d8a('0x24')];logger[_0x9d8a('0x26')](_0x54ee09[_0x9d8a('0x23')],_0x9d8a('0x27'));}};Fax['prototype'][_0x9d8a('0x28')]=function(_0x535a6b){if(this[_0x9d8a('0x22')][_0x535a6b['uniqueid']]){for(var _0x287f01 in _0x535a6b[_0x9d8a('0x29')]){if(_0x535a6b[_0x9d8a('0x29')]['hasOwnProperty'](_0x287f01)){this['channels'][_0x535a6b['uniqueid']][_0x287f01]=_0x535a6b[_0x9d8a('0x2a')];}}}};Fax['prototype'][_0x9d8a('0x15')]=function(_0x16c9d0){if(this[_0x9d8a('0x22')][_0x16c9d0[_0x9d8a('0x23')]]){this[_0x9d8a('0x22')][_0x16c9d0[_0x9d8a('0x23')]]['channelstate']=_0x16c9d0['channelstate'];this[_0x9d8a('0x22')][_0x16c9d0[_0x9d8a('0x23')]][_0x9d8a('0x2b')]=_0x16c9d0['channelstatedesc'];}};Fax[_0x9d8a('0x1c')][_0x9d8a('0x18')]=function(_0x485eaf){if(this[_0x9d8a('0x22')][_0x485eaf[_0x9d8a('0x23')]]){for(var _0x1ce31b in _0x485eaf['variable']){if(_0x485eaf[_0x9d8a('0x29')][_0x9d8a('0x1f')](_0x1ce31b)){this[_0x9d8a('0x22')][_0x485eaf[_0x9d8a('0x23')]][_0x1ce31b]=_0x485eaf[_0x9d8a('0x2a')];}}}};Fax[_0x9d8a('0x1c')]['syncFaxStatus']=function(_0x215b05){if(this[_0x9d8a('0x22')][_0x215b05[_0x9d8a('0x23')]]){this['channels'][_0x215b05['uniqueid']]['operation']=_0x215b05[_0x9d8a('0x2c')];this[_0x9d8a('0x22')][_0x215b05[_0x9d8a('0x23')]][_0x9d8a('0x2d')]=_0x215b05[_0x9d8a('0x2d')];this[_0x9d8a('0x22')][_0x215b05[_0x9d8a('0x23')]][_0x9d8a('0x21')]=_0x215b05[_0x9d8a('0x21')];this[_0x9d8a('0x22')][_0x215b05['uniqueid']][_0x9d8a('0x2e')]=_0x215b05['filename'];logger[_0x9d8a('0x26')](_0x215b05[_0x9d8a('0x23')],_0x9d8a('0x2f'));}};Fax['prototype'][_0x9d8a('0x30')]=function(_0x5d4f58){var _0x393a79=this;if(this[_0x9d8a('0x22')][_0x5d4f58[_0x9d8a('0x23')]]){var _0x52cc34=this[_0x9d8a('0x22')][_0x5d4f58[_0x9d8a('0x23')]]['id'];this[_0x9d8a('0x22')][_0x5d4f58[_0x9d8a('0x23')]][_0x9d8a('0x31')]=_0x5d4f58['remotestationid'];this['channels'][_0x5d4f58[_0x9d8a('0x23')]][_0x9d8a('0x32')]=_0x5d4f58['pagestransferred'];this[_0x9d8a('0x22')][_0x5d4f58[_0x9d8a('0x23')]][_0x9d8a('0x21')]=_0x5d4f58['localstationid'];this[_0x9d8a('0x22')][_0x5d4f58[_0x9d8a('0x23')]]['resolution']=_0x5d4f58[_0x9d8a('0x33')];this[_0x9d8a('0x22')][_0x5d4f58[_0x9d8a('0x23')]][_0x9d8a('0x34')]=_0x5d4f58[_0x9d8a('0x34')];this[_0x9d8a('0x22')][_0x5d4f58[_0x9d8a('0x23')]][_0x9d8a('0x2e')]=_0x5d4f58[_0x9d8a('0x2e')];this[_0x9d8a('0x22')][_0x5d4f58['uniqueid']][_0x9d8a('0x35')]=_0x5d4f58[_0x9d8a('0x35')];if(this[_0x9d8a('0x22')][_0x5d4f58[_0x9d8a('0x23')]][_0x9d8a('0x32')]>0x0){tiff2pdf(_0x5d4f58['filename'],_0x9d8a('0x36'),function(_0x52f704){logger[_0x9d8a('0x26')](_0x5d4f58['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x52f704[_0x9d8a('0x37')]);attachment[_0x9d8a('0x38')]({'name':path['parse'](_0x5d4f58['filename'])[_0x9d8a('0x25')],'basename':path[_0x9d8a('0x39')](_0x5d4f58[_0x9d8a('0x2e')])[_0x9d8a('0x25')]+_0x9d8a('0x3a'),'type':_0x9d8a('0x3b')})[_0x9d8a('0x3c')](function(_0x4daf15){faxAccount[_0x9d8a('0x3d')](_0x52cc34,{'from':_0x5d4f58['calleridnum'],'mapKey':_0x9d8a('0x8'),'body':path['parse'](_0x5d4f58[_0x9d8a('0x2e')])[_0x9d8a('0x25')]+_0x9d8a('0x3a'),'AttachmentId':_0x4daf15['id']})[_0x9d8a('0x3e')](function(_0x5c8f12){logger[_0x9d8a('0x3f')](_0x5d4f58[_0x9d8a('0x23')],_0x9d8a('0x40'),JSON[_0x9d8a('0x41')](_0x5c8f12));});})['catch'](function(_0x4fcdfb){logger[_0x9d8a('0x3f')](_0x5d4f58['uniqueid'],_0x9d8a('0x42'),JSON[_0x9d8a('0x41')](_0x4fcdfb));});});}logger['info'](_0x5d4f58[_0x9d8a('0x23')],_0x9d8a('0x42'));}};Fax[_0x9d8a('0x1c')][_0x9d8a('0x43')]=function(_0x41297f){if(this[_0x9d8a('0x11')][_0x41297f[_0x9d8a('0x23')]]){_[_0x9d8a('0x44')](this[_0x9d8a('0x22')][_0x41297f['uniqueid']],_[_0x9d8a('0x45')](_0x41297f,['response',_0x9d8a('0x46')]));}};function updateStatus(_0x327574){if(_0x327574[_0x9d8a('0x47')]){faxMessage['update'](_0x327574[_0x9d8a('0x47')],{'failMessage':_0x9d8a('0x48')})[_0x9d8a('0x3c')](function(_0x2a6b38){ut[_0x9d8a('0x49')](_0x9d8a('0x4a'),_0x2a6b38);})[_0x9d8a('0x3e')](function(_0x2a1705){ut['logger'](_0x9d8a('0x4b'),_0x2a1705);});}else{ut[_0x9d8a('0x49')](_0x9d8a('0x4c'));}}Fax[_0x9d8a('0x1c')]['updateStatus']=function(_0x3d1e00,_0x50d3ab,_0x273ec0){var _0x4bb568=this;var _0x16c123={};if(_0x50d3ab){_0x16c123={'read':_0x50d3ab};}else{_0x16c123={'failMessage':_0x273ec0};}if(this['actions'][_0x3d1e00]['AttachmentId']){faxMessage[_0x9d8a('0x4d')](this[_0x9d8a('0x11')][_0x3d1e00]['AttachmentId'],_0x16c123)[_0x9d8a('0x3c')](function(_0x5c719e){ut[_0x9d8a('0x49')](_0x9d8a('0x4e'),_0x5c719e);})['catch'](function(_0x52f69a){ut[_0x9d8a('0x49')](_0x9d8a('0x4f'),_0x52f69a);})[_0x9d8a('0x50')](function(){delete _0x4bb568[_0x9d8a('0x22')][_0x3d1e00];delete _0x4bb568['actions'][_0x3d1e00];});}else{ut[_0x9d8a('0x49')](_0x9d8a('0x51'));delete this[_0x9d8a('0x22')][_0x3d1e00];delete this[_0x9d8a('0x11')][_0x3d1e00];}};Fax[_0x9d8a('0x1c')][_0x9d8a('0x52')]=function(_0x2f7ced){var _0x3d10d3=this;if(this['channels'][_0x2f7ced['uniqueid']]){if(this[_0x9d8a('0x11')][_0x2f7ced[_0x9d8a('0x23')]]){this['channels'][_0x2f7ced[_0x9d8a('0x23')]]['id']=this['actions'][_0x2f7ced[_0x9d8a('0x23')]]['id'];this[_0x9d8a('0x22')][_0x2f7ced['uniqueid']][_0x9d8a('0x25')]=this[_0x9d8a('0x11')][_0x2f7ced[_0x9d8a('0x23')]][_0x9d8a('0x25')];}logger[_0x9d8a('0x26')](_0x2f7ced[_0x9d8a('0x23')],this[_0x9d8a('0x11')][_0x2f7ced['uniqueid']]?_0x9d8a('0x53'):_0x9d8a('0x54'),JSON[_0x9d8a('0x41')](this[_0x9d8a('0x22')][_0x2f7ced['uniqueid']]));if(this[_0x9d8a('0x11')][_0x2f7ced[_0x9d8a('0x23')]]){if(this[_0x9d8a('0x22')][_0x2f7ced[_0x9d8a('0x23')]]['faxpages']>0x0&&this[_0x9d8a('0x22')][_0x2f7ced[_0x9d8a('0x23')]][_0x9d8a('0x19')]===_0x9d8a('0x55')){this['updateStatus'](_0x2f7ced[_0x9d8a('0x23')],!![]);}else{this[_0x9d8a('0x56')](_0x2f7ced['uniqueid'],![],this[_0x9d8a('0x22')][_0x2f7ced[_0x9d8a('0x23')]]['faxstatusstring']?_0x9d8a('0x57')+this[_0x9d8a('0x22')][_0x2f7ced[_0x9d8a('0x23')]]['faxstatusstring']:_0x9d8a('0x58'));}}}};Fax[_0x9d8a('0x1c')][_0x9d8a('0x59')]=function(_0xa75fab){var _0x35ad48=this;return new BPromise(function(_0x2af05a,_0x482278){_0x35ad48[_0x9d8a('0x5a')](_0xa75fab,_0x35ad48[_0x9d8a('0xf')][_0xa75fab[_0x9d8a('0x5b')]])[_0x9d8a('0x3c')](function(_0xe98fb1){ut['logger'](_0x9d8a('0x5c'),_0xe98fb1);_0x2af05a(ut[_0x9d8a('0x37')]('Fax\x20received'));})['catch'](function(_0x26d676){ut[_0x9d8a('0x49')](_0x9d8a('0x5d'),_0x26d676);updateStatus(_0xa75fab);_0x482278(ut['message'](_0x9d8a('0x5e')));});});};Fax[_0x9d8a('0x1c')][_0x9d8a('0x5f')]=function(_0x444229){var _0x466d50=this;return new BPromise(function(_0x4d3a81,_0x429463){var _0x3bdd29=_0x466d50['checkTrunk'](_0x466d50['faxAccounts'][_0x444229[_0x9d8a('0x5b')]][_0x9d8a('0x60')],_0x444229);if(_0x3bdd29[_0x9d8a('0x61')]){_0x4d3a81(ut['message'](_0x9d8a('0x62')));}else{_0x429463(ut[_0x9d8a('0x37')](_0x3bdd29['message']));}});};function originate(_0x53ba61,_0x44c730,_0x512105){return new BPromise(function(_0x325f92,_0x28ed9f){if(_0x512105){var _0x56b8c7=util[_0x9d8a('0x63')](_0x9d8a('0x64'),path[_0x9d8a('0x39')](_0x53ba61[_0x9d8a('0x65')])[_0x9d8a('0x25')],_0x53ba61[_0x9d8a('0x65')]);gs[_0x9d8a('0x66')](_0x56b8c7)[_0x9d8a('0x3c')](function(){_0x53ba61[_0x9d8a('0x65')]=util[_0x9d8a('0x63')](_0x9d8a('0x67'),path[_0x9d8a('0x39')](_0x53ba61[_0x9d8a('0x65')])[_0x9d8a('0x68')],path[_0x9d8a('0x39')](_0x53ba61[_0x9d8a('0x65')])[_0x9d8a('0x25')]);_0x44c730[_0x9d8a('0x69')]=_0x53ba61[_0x9d8a('0x65')];ut[_0x9d8a('0x49')](_0x9d8a('0x6a'),'');ami[_0x9d8a('0x6b')](ut['variablesAction'](_0x53ba61,_0x44c730))[_0x9d8a('0x3c')](function(_0x5c921a){_0x325f92(_0x5c921a);})[_0x9d8a('0x3e')](function(_0x2f8cad){_0x28ed9f(_0x2f8cad);});})[_0x9d8a('0x3e')](function(_0x2c6767){_0x28ed9f(_0x2c6767);});}else{ami[_0x9d8a('0x6b')](ut[_0x9d8a('0x6c')](_0x53ba61,_0x44c730))[_0x9d8a('0x3c')](function(_0x9e56a0){_0x325f92(_0x9e56a0);})[_0x9d8a('0x3e')](function(_0x34d1e0){_0x28ed9f(_0x34d1e0);});}});}Fax[_0x9d8a('0x1c')][_0x9d8a('0x5a')]=function(_0x5d36c1,_0x208808){var _0x92ffd2=this;return new BPromise(function(_0x48f085,_0x2b1fa0){var _0x1766a4=uuid['v4']();var _0x66be8a=ut[_0x9d8a('0x6d')](_0x5d36c1,_0x208808);_0x92ffd2['actions'][_0x1766a4]=new Action(_0x1766a4,_0x208808,_0x5d36c1);var _0x42e09c=_0x92ffd2[_0x9d8a('0x11')][_0x1766a4];if(path[_0x9d8a('0x39')](_0x5d36c1[_0x9d8a('0x65')])['ext']===_0x9d8a('0x3a')){originate(_0x42e09c,_0x66be8a,!![])['then'](function(_0x15e5bb){_0x48f085(_0x15e5bb);})[_0x9d8a('0x3e')](function(_0x178de8){_0x2b1fa0(_0x178de8);});}else{originate(_0x42e09c,_0x66be8a,![])[_0x9d8a('0x3c')](function(_0x267392){_0x48f085(_0x267392);})['catch'](function(_0x1948ca){_0x2b1fa0(_0x1948ca);});}});};Fax[_0x9d8a('0x1c')][_0x9d8a('0x6e')]=function(_0x194f9e){return!_[_0x9d8a('0x6f')](_0x194f9e)&&!_[_0x9d8a('0x6f')](_0x194f9e['name'])&&!_[_0x9d8a('0x6f')](_0x194f9e[_0x9d8a('0x70')])&&_0x194f9e[_0x9d8a('0x70')]&&!_[_0x9d8a('0x6f')](this[_0x9d8a('0x10')][util[_0x9d8a('0x63')](_0x9d8a('0x71'),_0x194f9e[_0x9d8a('0x25')])])&&!_[_0x9d8a('0x6f')](this['trunks'][util[_0x9d8a('0x63')](_0x9d8a('0x71'),_0x194f9e[_0x9d8a('0x25')])][_0x9d8a('0x2d')])&&(this['trunks'][util[_0x9d8a('0x63')](_0x9d8a('0x71'),_0x194f9e[_0x9d8a('0x25')])]['status']===_0x9d8a('0x72')||this[_0x9d8a('0x10')][util[_0x9d8a('0x63')](_0x9d8a('0x71'),_0x194f9e[_0x9d8a('0x25')])][_0x9d8a('0x2d')]==='unmonitored');};Fax[_0x9d8a('0x1c')][_0x9d8a('0x73')]=function(_0xffb24e,_0x4505b3){if(!this[_0x9d8a('0x6e')](_0xffb24e)){ut['logger'](_0x9d8a('0x74'),_[_0x9d8a('0x6f')](_0xffb24e)?'':_0xffb24e['name']+_0x9d8a('0x75'));return{'isValid':![],'message':_0x9d8a('0x76')};}if(_[_0x9d8a('0x6f')](_0x4505b3[_0x9d8a('0x8')])){ut[_0x9d8a('0x49')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x4505b3));return{'isValid':![],'message':_0x9d8a('0x77')};}if(_['isNil'](_0x4505b3[_0x9d8a('0x65')])){ut['logger'](_0x9d8a('0x78'),JSON[_0x9d8a('0x41')](_0x4505b3));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};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 74638f4..77e34dc 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 _0x9624=['bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x9624,0x12c));var _0x4962=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9624[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var BPromise=require(_0x4962('0x0'));var logger=require(_0x4962('0x1'))(_0x4962('0x2'));var _=require(_0x4962('0x3'));var faxAccount=require(_0x4962('0x4'));function loggerCatch(_0x39a0da){return function(_0x25c15c){logger[_0x4962('0x5')](_0x39a0da,util[_0x4962('0x6')](_0x25c15c,{'showHidden':![],'depth':null}));};}exports[_0x4962('0x7')]=function(_0x4d2465,_0x4ad58a){return BPromise[_0x4962('0x8')]()[_0x4962('0x9')](faxAccount['notify'](_0x4d2465,_0x4ad58a))[_0x4962('0xa')](loggerCatch(_0x4962('0xb')));}; \ No newline at end of file +var _0xde40=['../../../config/logger','lodash','../rpc/faxAccount','error','inspect','resolve','then','bluebird'];(function(_0x4a1d44,_0x1017ea){var _0x25bca4=function(_0x4b74fc){while(--_0x4b74fc){_0x4a1d44['push'](_0x4a1d44['shift']());}};_0x25bca4(++_0x1017ea);}(_0xde40,0x12f));var _0x0de4=function(_0x47a034,_0x41dba6){_0x47a034=_0x47a034-0x0;var _0xd9ff7d=_0xde40[_0x47a034];return _0xd9ff7d;};'use strict';var util=require('util');var BPromise=require(_0x0de4('0x0'));var logger=require(_0x0de4('0x1'))('preview');var _=require(_0x0de4('0x2'));var faxAccount=require(_0x0de4('0x3'));function loggerCatch(_0x3d6477){return function(_0x107a0e){logger[_0x0de4('0x4')](_0x3d6477,util[_0x0de4('0x5')](_0x107a0e,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x5323c2,_0x229fc6){return BPromise[_0x0de4('0x6')]()[_0x0de4('0x7')](faxAccount['notify'](_0x5323c2,_0x229fc6))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 13ea56c..fbe3261 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 _0x2e84=['execute','info','Exec\x20gs','util','../../../../config/logger','fax','bluebird','exec'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2e84,0x163));var _0x42e8=function(_0xfba327,_0x49b3bf){_0xfba327=_0xfba327-0x0;var _0x3c0d48=_0x2e84[_0xfba327];return _0x3c0d48;};'use strict';var util=require(_0x42e8('0x0'));var logger=require(_0x42e8('0x1'))(_0x42e8('0x2'));var BPromise=require(_0x42e8('0x3'));var exec=require('child_process')[_0x42e8('0x4')];exports[_0x42e8('0x5')]=function(_0x260151){return new BPromise(function(_0x1428c3,_0x2d0829){exec(_0x260151,function(_0x561541,_0x65b31,_0x16800c){logger[_0x42e8('0x6')](_0x42e8('0x7'),_0x65b31);if(_0x561541){logger[_0x42e8('0x6')](_0x42e8('0x7'),'\x20Error\x20:',util['inspect'](_0x561541,{'showHidden':![],'depth':null}),_0x65b31,_0x16800c);_0x2d0829(_0x561541);}_0x1428c3(_0x65b31);});});}; \ No newline at end of file +var _0xf401=['execute','Exec\x20gs','info','\x20Error\x20:','util','../../../../config/logger','bluebird','child_process','exec'];(function(_0x18ff45,_0x50943f){var _0xccd659=function(_0x13c695){while(--_0x13c695){_0x18ff45['push'](_0x18ff45['shift']());}};_0xccd659(++_0x50943f);}(_0xf401,0xc1));var _0x1f40=function(_0x298558,_0x34356c){_0x298558=_0x298558-0x0;var _0x57d194=_0xf401[_0x298558];return _0x57d194;};'use strict';var util=require(_0x1f40('0x0'));var logger=require(_0x1f40('0x1'))('fax');var BPromise=require(_0x1f40('0x2'));var exec=require(_0x1f40('0x3'))[_0x1f40('0x4')];exports[_0x1f40('0x5')]=function(_0x6aebee){return new BPromise(function(_0xb19eaa,_0x1b0c81){exec(_0x6aebee,function(_0xecbcd3,_0x59b117,_0x5a88f6){logger['info'](_0x1f40('0x6'),_0x59b117);if(_0xecbcd3){logger[_0x1f40('0x7')]('Exec\x20gs',_0x1f40('0x8'),util['inspect'](_0xecbcd3,{'showHidden':![],'depth':null}),_0x59b117,_0x5a88f6);_0x1b0c81(_0xecbcd3);}_0xb19eaa(_0x59b117);});});}; \ 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 f10a875..3562d27 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 _0xf290=['xcally-motion-fax','from-sip','lodash','../../../../config/logger','message','logger','inspect','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel'];(function(_0x484b97,_0xe18c83){var _0x465b77=function(_0x54a912){while(--_0x54a912){_0x484b97['push'](_0x484b97['shift']());}};_0x465b77(++_0xe18c83);}(_0xf290,0xde));var _0x0f29=function(_0x3a3c17,_0x5b7b7e){_0x3a3c17=_0x3a3c17-0x0;var _0xd07f21=_0xf290[_0x3a3c17];return _0xd07f21;};'use strict';var util=require('util');var _=require(_0x0f29('0x0'));var moment=require('moment');var logger=require(_0x0f29('0x1'))('fax');exports[_0x0f29('0x2')]=function(_0x1b4f85){return{'message':_0x1b4f85};};exports[_0x0f29('0x3')]=function(_0x28b644,_0xfdab92){logger['info'](_0x28b644,util[_0x0f29('0x4')](_0xfdab92,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x2d5350,_0x1c45ec){var _0x355e21={'XMF-ECM':_0x1c45ec[_0x0f29('0x5')],'XMF-HEADERINFO':_0x1c45ec[_0x0f29('0x6')],'XMF-MINRATE':_0x1c45ec[_0x0f29('0x7')],'XMF-MAXRATE':_0x1c45ec[_0x0f29('0x8')],'XMF-MODEM':util[_0x0f29('0x9')](_0x0f29('0xa'),_0x1c45ec[_0x0f29('0xb')]),'XMF-GATEWAY':_0x1c45ec[_0x0f29('0xc')],'XMF-FAXDETECT':_0x1c45ec[_0x0f29('0xd')],'XMF-T38TIMEOUT':_0x1c45ec[_0x0f29('0xe')],'XMF-LOCALSTATIONID':_0x1c45ec[_0x0f29('0xf')],'XMF-PATH':_0x2d5350[_0x0f29('0x10')]};return _0x355e21;};exports['variablesAction']=function(_0x38eb8f,_0x5f4796){return{'actionid':_0x38eb8f[_0x0f29('0x11')],'action':_0x0f29('0x12'),'channel':_0x38eb8f[_0x0f29('0x13')],'Exten':_0x0f29('0x14'),'Context':_0x0f29('0x15'),'Priority':'1','callerid':util[_0x0f29('0x9')]('\x22%s\x22\x20<%s>',_0x38eb8f[_0x0f29('0x6')]?_0x38eb8f[_0x0f29('0x6')]:'',_0x38eb8f[_0x0f29('0xf')]),'variable':_0x5f4796,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x38eb8f[_0x0f29('0x11')]};}; \ No newline at end of file +var _0x5b02=['\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','info','inspect','addVariables','headerinfo','format'];(function(_0x138d06,_0x33edf2){var _0x1a01eb=function(_0x387acb){while(--_0x387acb){_0x138d06['push'](_0x138d06['shift']());}};_0x1a01eb(++_0x33edf2);}(_0x5b02,0xe9));var _0x25b0=function(_0x4ff69c,_0x6fe1cf){_0x4ff69c=_0x4ff69c-0x0;var _0x4b611b=_0x5b02[_0x4ff69c];return _0x4b611b;};'use strict';var util=require(_0x25b0('0x0'));var _=require(_0x25b0('0x1'));var moment=require(_0x25b0('0x2'));var logger=require(_0x25b0('0x3'))('fax');exports['message']=function(_0x2b5f2d){return{'message':_0x2b5f2d};};exports['logger']=function(_0x3e1d20,_0x31c9c2){logger[_0x25b0('0x4')](_0x3e1d20,util[_0x25b0('0x5')](_0x31c9c2,{'showHidden':![],'depth':null}));};exports[_0x25b0('0x6')]=function(_0x4eea55,_0x1d82c6){var _0xd8276d={'XMF-ECM':_0x1d82c6['ecm'],'XMF-HEADERINFO':_0x1d82c6[_0x25b0('0x7')],'XMF-MINRATE':_0x1d82c6['minrate'],'XMF-MAXRATE':_0x1d82c6['maxrate'],'XMF-MODEM':util[_0x25b0('0x8')](_0x25b0('0x9'),_0x1d82c6[_0x25b0('0xa')]),'XMF-GATEWAY':_0x1d82c6['gateway'],'XMF-FAXDETECT':_0x1d82c6[_0x25b0('0xb')],'XMF-T38TIMEOUT':_0x1d82c6[_0x25b0('0xc')],'XMF-LOCALSTATIONID':_0x1d82c6[_0x25b0('0xd')],'XMF-PATH':_0x4eea55[_0x25b0('0xe')]};return _0xd8276d;};exports[_0x25b0('0xf')]=function(_0x2f57af,_0x44afbc){return{'actionid':_0x2f57af[_0x25b0('0x10')],'action':_0x25b0('0x11'),'channel':_0x2f57af[_0x25b0('0x12')],'Exten':_0x25b0('0x13'),'Context':_0x25b0('0x14'),'Priority':'1','callerid':util[_0x25b0('0x8')](_0x25b0('0x15'),_0x2f57af[_0x25b0('0x7')]?_0x2f57af[_0x25b0('0x7')]:'',_0x2f57af[_0x25b0('0xd')]),'variable':_0x44afbc,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2f57af[_0x25b0('0x10')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 8a9f861..879eaf9 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 _0x5a66=['getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','./server','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts'];(function(_0x471ad4,_0x2521ac){var _0x836460=function(_0x242665){while(--_0x242665){_0x471ad4['push'](_0x471ad4['shift']());}};_0x836460(++_0x2521ac);}(_0x5a66,0xe6));var _0x65a6=function(_0x2e1e92,_0x16e465){_0x2e1e92=_0x2e1e92-0x0;var _0x193531=_0x5a66[_0x2e1e92];return _0x193531;};'use strict';var BPromise=require(_0x65a6('0x0'));var util=require('util');var moment=require('moment');var server=require(_0x65a6('0x1'));var Realtime=require('./realtime');var Report=require('./report');var Acw=require(_0x65a6('0x2'));var Trigger=require('./trigger');var Dialer=require(_0x65a6('0x3'));var Preview=require(_0x65a6('0x4'));var Fax=require(_0x65a6('0x5'));var user=require(_0x65a6('0x6'));var voiceQueue=require(_0x65a6('0x7'));var voiceQueueReport=require(_0x65a6('0x8'));var voiceCallReport=require(_0x65a6('0x9'));var trunk=require(_0x65a6('0xa'));var trigger=require(_0x65a6('0xb'));var template=require(_0x65a6('0xc'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x65a6('0xd'));var voiceExtension=require(_0x65a6('0xe'));var faxAccount=require(_0x65a6('0xf'));var zendesk=require(_0x65a6('0x10'));var salesforce=require(_0x65a6('0x11'));var sugarcrm=require(_0x65a6('0x12'));var freshdesk=require(_0x65a6('0x13'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x65a6('0x14'));var vtiger=require(_0x65a6('0x15'));var freshsales=require(_0x65a6('0x16'));var servicenow=require(_0x65a6('0x17'));var dynamics365=require(_0x65a6('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x65a6('0x19')](_0x65a6('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x65a6('0x1b')]()[_0x65a6('0x1c')](user[_0x65a6('0x1d')]())[_0x65a6('0x1c')](realtime[_0x65a6('0x1e')]())['then'](user['getTelephones']())[_0x65a6('0x1c')](realtime['initTelephones']())[_0x65a6('0x1c')](trunk[_0x65a6('0x1f')]())['then'](realtime[_0x65a6('0x20')]())['then'](voiceQueue['getVoiceQueues']())[_0x65a6('0x1c')](realtime[_0x65a6('0x21')]())[_0x65a6('0x1c')](trigger[_0x65a6('0x22')]())[_0x65a6('0x1c')](realtime[_0x65a6('0x23')]())[_0x65a6('0x1c')](template[_0x65a6('0x24')]())[_0x65a6('0x1c')](realtime[_0x65a6('0x25')]())[_0x65a6('0x1c')](zendesk[_0x65a6('0x26')]())[_0x65a6('0x1c')](realtime['initZendeskAccounts']())[_0x65a6('0x1c')](salesforce[_0x65a6('0x27')]())[_0x65a6('0x1c')](realtime[_0x65a6('0x28')]())[_0x65a6('0x1c')](sugarcrm[_0x65a6('0x29')]())[_0x65a6('0x1c')](realtime['initSugarcrmAccounts']())[_0x65a6('0x1c')](freshdesk[_0x65a6('0x2a')]())[_0x65a6('0x1c')](realtime['initFreshdeskAccounts']())[_0x65a6('0x1c')](desk[_0x65a6('0x2b')]())[_0x65a6('0x1c')](realtime['initDeskAccounts']())[_0x65a6('0x1c')](zoho[_0x65a6('0x2c')]())[_0x65a6('0x1c')](realtime[_0x65a6('0x2d')]())[_0x65a6('0x1c')](vtiger[_0x65a6('0x2e')]())[_0x65a6('0x1c')](realtime[_0x65a6('0x2f')]())[_0x65a6('0x1c')](freshsales[_0x65a6('0x30')]())[_0x65a6('0x1c')](realtime['initFreshsalesAccounts']())[_0x65a6('0x1c')](servicenow[_0x65a6('0x31')]())['then'](realtime[_0x65a6('0x32')]())[_0x65a6('0x1c')](dynamics365[_0x65a6('0x33')]())[_0x65a6('0x1c')](realtime[_0x65a6('0x34')]())['then'](campaign[_0x65a6('0x35')]())[_0x65a6('0x1c')](realtime[_0x65a6('0x36')]())[_0x65a6('0x1c')](voiceExtension[_0x65a6('0x37')]())['then'](realtime[_0x65a6('0x38')]())['then'](faxAccount[_0x65a6('0x39')]())[_0x65a6('0x1c')](realtime[_0x65a6('0x3a')]())[_0x65a6('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x65a6('0x1b')]()['then'](voiceQueueReport['getVoiceQueueReports']())[_0x65a6('0x1c')](realtime[_0x65a6('0x3b')]())['then'](cmHopperHistory[_0x65a6('0x3c')]())[_0x65a6('0x1c')](realtime['initVoiceQueueHopperHistory']())[_0x65a6('0x1c')](cmHopperHistory[_0x65a6('0x3d')]())[_0x65a6('0x1c')](realtime[_0x65a6('0x3e')]())[_0x65a6('0x1c')](voiceCallReport[_0x65a6('0x3f')]())[_0x65a6('0x1c')](realtime[_0x65a6('0x40')]())[_0x65a6('0x1c')](function(_0x480dc4){})[_0x65a6('0x41')](function(_0x598c09){console[_0x65a6('0x42')](_0x598c09);});}function main(){return server[_0x65a6('0x43')](realtime,preview,fax)[_0x65a6('0x1c')](function(_0x37c419){return initRealtime();})[_0x65a6('0x1c')](function(){return initParams();})[_0x65a6('0x1c')](function(){report[_0x65a6('0x44')]();setInterval(initRealtime,0x1388);})[_0x65a6('0x41')](function(_0x4c4cd9){console['log'](_0x4c4cd9);});}main(); \ No newline at end of file +var _0xf857=['./realtime','./acw','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/dynamics365','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','listen','sync','log','bluebird','util','moment','./server'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf857,0x188));var _0x7f85=function(_0x432f7c,_0x404bca){_0x432f7c=_0x432f7c-0x0;var _0x40c71e=_0xf857[_0x432f7c];return _0x40c71e;};'use strict';var BPromise=require(_0x7f85('0x0'));var util=require(_0x7f85('0x1'));var moment=require(_0x7f85('0x2'));var server=require(_0x7f85('0x3'));var Realtime=require(_0x7f85('0x4'));var Report=require('./report');var Acw=require(_0x7f85('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x7f85('0x6'));var Preview=require('./preview');var Fax=require(_0x7f85('0x7'));var user=require(_0x7f85('0x8'));var voiceQueue=require(_0x7f85('0x9'));var voiceQueueReport=require(_0x7f85('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x7f85('0xb'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x7f85('0xc'));var voiceExtension=require(_0x7f85('0xd'));var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x7f85('0xe'));var freshdesk=require(_0x7f85('0xf'));var desk=require(_0x7f85('0x10'));var zoho=require(_0x7f85('0x11'));var vtiger=require(_0x7f85('0x12'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x7f85('0x13'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x7f85('0x14')](_0x7f85('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x7f85('0x14')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x7f85('0x16')](user[_0x7f85('0x17')]())[_0x7f85('0x16')](realtime[_0x7f85('0x18')]())[_0x7f85('0x16')](user[_0x7f85('0x19')]())[_0x7f85('0x16')](realtime[_0x7f85('0x1a')]())[_0x7f85('0x16')](trunk['getTrunks']())[_0x7f85('0x16')](realtime[_0x7f85('0x1b')]())[_0x7f85('0x16')](voiceQueue[_0x7f85('0x1c')]())[_0x7f85('0x16')](realtime[_0x7f85('0x1d')]())[_0x7f85('0x16')](trigger[_0x7f85('0x1e')]())[_0x7f85('0x16')](realtime[_0x7f85('0x1f')]())[_0x7f85('0x16')](template[_0x7f85('0x20')]())[_0x7f85('0x16')](realtime[_0x7f85('0x21')]())[_0x7f85('0x16')](zendesk[_0x7f85('0x22')]())[_0x7f85('0x16')](realtime[_0x7f85('0x23')]())[_0x7f85('0x16')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x7f85('0x24')]())[_0x7f85('0x16')](sugarcrm[_0x7f85('0x25')]())[_0x7f85('0x16')](realtime[_0x7f85('0x26')]())[_0x7f85('0x16')](freshdesk[_0x7f85('0x27')]())[_0x7f85('0x16')](realtime[_0x7f85('0x28')]())[_0x7f85('0x16')](desk['getDeskAccounts']())[_0x7f85('0x16')](realtime[_0x7f85('0x29')]())[_0x7f85('0x16')](zoho['getZohoAccounts']())['then'](realtime[_0x7f85('0x2a')]())['then'](vtiger[_0x7f85('0x2b')]())[_0x7f85('0x16')](realtime[_0x7f85('0x2c')]())[_0x7f85('0x16')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0x7f85('0x2d')]())[_0x7f85('0x16')](servicenow[_0x7f85('0x2e')]())[_0x7f85('0x16')](realtime[_0x7f85('0x2f')]())[_0x7f85('0x16')](dynamics365['getDynamics365Accounts']())[_0x7f85('0x16')](realtime[_0x7f85('0x30')]())[_0x7f85('0x16')](campaign['getCampaigns']())[_0x7f85('0x16')](realtime[_0x7f85('0x31')]())[_0x7f85('0x16')](voiceExtension[_0x7f85('0x32')]())[_0x7f85('0x16')](realtime[_0x7f85('0x33')]())['then'](faxAccount[_0x7f85('0x34')]())[_0x7f85('0x16')](realtime['initFaxAccounts']())[_0x7f85('0x16')](function(){return realtime;});}function initParams(){return BPromise[_0x7f85('0x35')]()[_0x7f85('0x16')](voiceQueueReport[_0x7f85('0x36')]())[_0x7f85('0x16')](realtime[_0x7f85('0x37')]())[_0x7f85('0x16')](cmHopperHistory[_0x7f85('0x38')]())['then'](realtime[_0x7f85('0x39')]())[_0x7f85('0x16')](cmHopperHistory[_0x7f85('0x3a')]())[_0x7f85('0x16')](realtime[_0x7f85('0x3b')]())[_0x7f85('0x16')](voiceCallReport[_0x7f85('0x3c')]())[_0x7f85('0x16')](realtime[_0x7f85('0x3d')]())[_0x7f85('0x16')](function(_0x3bd97d){})[_0x7f85('0x3e')](function(_0x25fda4){console['log'](_0x25fda4);});}function main(){return server[_0x7f85('0x3f')](realtime,preview,fax)[_0x7f85('0x16')](function(_0x1238b6){return initRealtime();})[_0x7f85('0x16')](function(){return initParams();})[_0x7f85('0x16')](function(){report[_0x7f85('0x40')]();setInterval(initRealtime,0x1388);})[_0x7f85('0x3e')](function(_0x1c20b7){console[_0x7f85('0x41')](_0x1c20b7);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index a306c12..0cd5b49 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 _0x0457=['voiceStatusCallerIdNumber','interface','stringify','user:%s','emit','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','format','address'];(function(_0x50261e,_0x2c859b){var _0x36925a=function(_0x1a2497){while(--_0x1a2497){_0x50261e['push'](_0x50261e['shift']());}};_0x36925a(++_0x2c859b);}(_0x0457,0x18c));var _0x7045=function(_0x2ef714,_0x49e1c4){_0x2ef714=_0x2ef714-0x0;var _0x252ab0=_0x0457[_0x2ef714];return _0x252ab0;};'use strict';var _=require(_0x7045('0x0'));var util=require(_0x7045('0x1'));var moment=require(_0x7045('0x2'));var md5=require(_0x7045('0x3'));var Redis=require(_0x7045('0x4'));var config=require(_0x7045('0x5'));config[_0x7045('0x6')]=_[_0x7045('0x7')](config['redis'],{'host':_0x7045('0x8'),'port':0x18eb});var io=require(_0x7045('0x9'))(new Redis(config[_0x7045('0x6')]));function Agent(_0x1d9e79){this['id']=_0x1d9e79['id']||0x0;this[_0x7045('0xa')]=_0x1d9e79['name']||'';this[_0x7045('0xb')]=_0x1d9e79[_0x7045('0xb')]||'';this[_0x7045('0xc')]=_0x1d9e79['accountcode']||'';this[_0x7045('0xd')]=_0x1d9e79[_0x7045('0xd')]||'';this[_0x7045('0xe')]=_0x7045('0xf');this[_0x7045('0x10')]=0x0;this[_0x7045('0x11')]=_0x7045('0xf');this['address']='';this['phone']='';this['mobile']='';this['interface']='';this[_0x7045('0x12')]=_0x1d9e79[_0x7045('0x12')]||![];this[_0x7045('0x13')]=_0x7045('0xf');this[_0x7045('0x14')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x7045('0x15')]='';this[_0x7045('0x16')]=![];this['local']=![];this[_0x7045('0x3')]='';}Agent[_0x7045('0x17')][_0x7045('0x18')]=function(_0x5b0b79){var _0x319179;if(_0x5b0b79&&_0x5b0b79[_0x7045('0xe')]){_0x319179=_0x5b0b79[_0x7045('0xe')][_0x7045('0x19')]();switch(_0x319179){case _0x7045('0x1a'):_0x319179=_0x7045('0x1b');break;case _0x7045('0x1c'):_0x319179=_0x7045('0x1d');break;}}if(_0x319179&&this['voiceStatus']!==_0x319179||_0x5b0b79[_0x7045('0x1e')]){this[_0x7045('0x14')]=_['toNumber'](moment()[_0x7045('0x1f')]('x'));}if(_0x319179){this[_0x7045('0x13')]=_0x319179;}var _0x57ea48={'id':this['id'],'name':this[_0x7045('0xa')],'email':this['email'],'accountcode':this[_0x7045('0xc')],'fullname':this[_0x7045('0xd')],'state':this[_0x7045('0xe')],'stateTime':this['stateTime'],'status':this['status'],'address':this[_0x7045('0x20')],'online':this['online'],'voiceStatus':this[_0x7045('0x13')],'voiceStatusTime':this[_0x7045('0x14')],'voiceStatusCallerIdNumber':this[_0x7045('0x21')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x7045('0x22')],'onhold':this[_0x7045('0x16')]};var _0x402582=md5(JSON[_0x7045('0x23')](_0x57ea48));if(this[_0x7045('0x3')]!==_0x402582){this['md5']=_0x402582;io['to'](util[_0x7045('0x1f')](_0x7045('0x24'),_0x57ea48[_0x7045('0xa')]))[_0x7045('0x25')]('user:save',_0x57ea48);}};module[_0x7045('0x26')]=Agent; \ No newline at end of file +var _0xa711=['voiceStatusQueue','interface','onhold','stringify','user:%s','emit','user:save','exports','lodash','util','moment','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','address','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','md5','prototype','updateStatusRealtime','toLowerCase','inuse','statePause','format','stateTime'];(function(_0x434903,_0x2bae84){var _0x31021e=function(_0x176a5f){while(--_0x176a5f){_0x434903['push'](_0x434903['shift']());}};_0x31021e(++_0x2bae84);}(_0xa711,0x77));var _0x1a71=function(_0x199c5c,_0x10edaa){_0x199c5c=_0x199c5c-0x0;var _0x3c2d8b=_0xa711[_0x199c5c];return _0x3c2d8b;};'use strict';var _=require(_0x1a71('0x0'));var util=require(_0x1a71('0x1'));var moment=require(_0x1a71('0x2'));var md5=require('md5');var Redis=require(_0x1a71('0x3'));var config=require(_0x1a71('0x4'));config[_0x1a71('0x5')]=_['defaults'](config[_0x1a71('0x5')],{'host':_0x1a71('0x6'),'port':0x18eb});var io=require(_0x1a71('0x7'))(new Redis(config['redis']));function Agent(_0x57325a){this['id']=_0x57325a['id']||0x0;this[_0x1a71('0x8')]=_0x57325a[_0x1a71('0x8')]||'';this[_0x1a71('0x9')]=_0x57325a[_0x1a71('0x9')]||'';this[_0x1a71('0xa')]=_0x57325a['accountcode']||'';this[_0x1a71('0xb')]=_0x57325a[_0x1a71('0xb')]||'';this[_0x1a71('0xc')]=_0x1a71('0xd');this['stateTime']=0x0;this['status']=_0x1a71('0xd');this[_0x1a71('0xe')]='';this['phone']='';this[_0x1a71('0xf')]='';this['interface']='';this['online']=_0x57325a[_0x1a71('0x10')]||![];this[_0x1a71('0x11')]=_0x1a71('0xd');this[_0x1a71('0x12')]=0x0;this[_0x1a71('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x1a71('0x14')]=![];this[_0x1a71('0x15')]='';}Agent[_0x1a71('0x16')][_0x1a71('0x17')]=function(_0x506604){var _0x4fb44a;if(_0x506604&&_0x506604[_0x1a71('0xc')]){_0x4fb44a=_0x506604[_0x1a71('0xc')][_0x1a71('0x18')]();switch(_0x4fb44a){case'not_inuse':_0x4fb44a='idle';break;case _0x1a71('0x19'):_0x4fb44a='talking';break;}}if(_0x4fb44a&&this[_0x1a71('0x11')]!==_0x4fb44a||_0x506604[_0x1a71('0x1a')]){this['voiceStatusTime']=_['toNumber'](moment()[_0x1a71('0x1b')]('x'));}if(_0x4fb44a){this['voiceStatus']=_0x4fb44a;}var _0x349342={'id':this['id'],'name':this[_0x1a71('0x8')],'email':this['email'],'accountcode':this[_0x1a71('0xa')],'fullname':this[_0x1a71('0xb')],'state':this[_0x1a71('0xc')],'stateTime':this[_0x1a71('0x1c')],'status':this['status'],'address':this[_0x1a71('0xe')],'online':this[_0x1a71('0x10')],'voiceStatus':this[_0x1a71('0x11')],'voiceStatusTime':this[_0x1a71('0x12')],'voiceStatusCallerIdNumber':this[_0x1a71('0x13')],'voiceStatusQueue':this[_0x1a71('0x1d')],'interface':this[_0x1a71('0x1e')],'onhold':this[_0x1a71('0x1f')]};var _0x3055d7=md5(JSON[_0x1a71('0x20')](_0x349342));if(this[_0x1a71('0x15')]!==_0x3055d7){this[_0x1a71('0x15')]=_0x3055d7;io['to'](util[_0x1a71('0x1b')](_0x1a71('0x21'),_0x349342[_0x1a71('0x8')]))[_0x1a71('0x22')](_0x1a71('0x23'),_0x349342);}};module[_0x1a71('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 7bfc546..f7ad0c4 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 _0x0b0e=['SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk'];(function(_0x237799,_0x4ca06b){var _0x34a3f9=function(_0x436da1){while(--_0x436da1){_0x237799['push'](_0x237799['shift']());}};_0x34a3f9(++_0x4ca06b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3de873,_0x174b5f){_0x3de873=_0x3de873-0x0;var _0x380b8c=_0x0b0e[_0x3de873];return _0x380b8c;};'use strict';function Campaign(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['type']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=0x0;this[_0xe0b0('0x4')]=0x0;this[_0xe0b0('0x5')]=0x0;this[_0xe0b0('0x6')]=0x0;this[_0xe0b0('0x7')]='';this[_0xe0b0('0x8')]=!![];this[_0xe0b0('0x9')]=_0x29cd1e[_0xe0b0('0x9')];this[_0xe0b0('0xa')]=_0x29cd1e['limitCalls'];this['dialTimezone']=_0x29cd1e[_0xe0b0('0xb')]||null;this[_0xe0b0('0xc')]=_0x29cd1e[_0xe0b0('0xc')]?_0x29cd1e[_0xe0b0('0xc')]:null;this['dialOriginateCallerIdName']=_0x29cd1e[_0xe0b0('0xd')];this[_0xe0b0('0xe')]=_0x29cd1e['dialOriginateCallerIdNumber'];this[_0xe0b0('0xf')]=_0x29cd1e[_0xe0b0('0xf')]||0x1e;this['dialCongestionMaxRetry']=_0x29cd1e[_0xe0b0('0x10')];this[_0xe0b0('0x11')]=_0x29cd1e[_0xe0b0('0x11')];this['dialBusyMaxRetry']=_0x29cd1e[_0xe0b0('0x12')];this[_0xe0b0('0x13')]=_0x29cd1e[_0xe0b0('0x13')];this[_0xe0b0('0x14')]=_0x29cd1e[_0xe0b0('0x14')];this['dialNoAnswerRetryFrequency']=_0x29cd1e[_0xe0b0('0x15')];this[_0xe0b0('0x16')]=_0x29cd1e[_0xe0b0('0x16')];this[_0xe0b0('0x17')]=_0x29cd1e[_0xe0b0('0x17')]||'DESC';this[_0xe0b0('0x18')]=_0x29cd1e['dialPrefix']||undefined;this[_0xe0b0('0x19')]=_0x29cd1e[_0xe0b0('0x19')]||undefined;this['dialCutDigit']=_0x29cd1e[_0xe0b0('0x1a')]||undefined;this['TrunkBackup']=_0x29cd1e[_0xe0b0('0x1b')]?_0x29cd1e[_0xe0b0('0x1b')]:undefined;this['Trunk']=_0x29cd1e['Trunk']?_0x29cd1e[_0xe0b0('0x1c')]:undefined;this['Interval']=_0x29cd1e['Interval']?_0x29cd1e['Interval']:undefined;this[_0xe0b0('0x1d')]=_0x29cd1e['SquareProject']?_0x29cd1e['SquareProject']:undefined;this[_0xe0b0('0x1e')]=_0x29cd1e['SquareProject']?_0x29cd1e[_0xe0b0('0x1d')]['name']:undefined;this[_0xe0b0('0x1f')]=_0x29cd1e[_0xe0b0('0x1f')]||![];this[_0xe0b0('0x20')]=_0x29cd1e[_0xe0b0('0x20')];this[_0xe0b0('0x21')]=_0x29cd1e['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x29cd1e[_0xe0b0('0x22')];this['dialAMDTotalAnalysisTime']=_0x29cd1e[_0xe0b0('0x23')];this[_0xe0b0('0x24')]=_0x29cd1e['dialAMDMinWordLength'];this[_0xe0b0('0x25')]=_0x29cd1e['dialAMDBetweenWordsSilence'];this[_0xe0b0('0x26')]=_0x29cd1e['dialAMDMaximumNumberOfWords'];this[_0xe0b0('0x27')]=_0x29cd1e['dialAMDSilenceThreshold'];this[_0xe0b0('0x28')]=_0x29cd1e['dialAMDMaximumWordLength'];}module[_0xe0b0('0x29')]=Campaign; \ No newline at end of file +var _0xb7e7=['dialAMDSilenceThreshold','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords'];(function(_0x3513a0,_0x3bdc88){var _0x2bdeb9=function(_0x37f06d){while(--_0x37f06d){_0x3513a0['push'](_0x3513a0['shift']());}};_0x2bdeb9(++_0x3bdc88);}(_0xb7e7,0x121));var _0x7b7e=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xb7e7[_0x42bc91];return _0x3f5507;};'use strict';function Campaign(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['type']=_0x2e5e07[_0x7b7e('0x1')]||'campaign';this[_0x7b7e('0x2')]=0x0;this['temp']=0x0;this[_0x7b7e('0x3')]=0x0;this[_0x7b7e('0x4')]=0x0;this[_0x7b7e('0x5')]='';this['sendMessageOneNotActive']=!![];this['active']=_0x2e5e07[_0x7b7e('0x6')];this[_0x7b7e('0x7')]=_0x2e5e07[_0x7b7e('0x7')];this['dialTimezone']=_0x2e5e07[_0x7b7e('0x8')]||null;this[_0x7b7e('0x9')]=_0x2e5e07[_0x7b7e('0x9')]?_0x2e5e07[_0x7b7e('0x9')]:null;this[_0x7b7e('0xa')]=_0x2e5e07[_0x7b7e('0xa')];this[_0x7b7e('0xb')]=_0x2e5e07['dialOriginateCallerIdNumber'];this[_0x7b7e('0xc')]=_0x2e5e07[_0x7b7e('0xc')]||0x1e;this[_0x7b7e('0xd')]=_0x2e5e07[_0x7b7e('0xd')];this[_0x7b7e('0xe')]=_0x2e5e07[_0x7b7e('0xe')];this[_0x7b7e('0xf')]=_0x2e5e07[_0x7b7e('0xf')];this[_0x7b7e('0x10')]=_0x2e5e07['dialBusyRetryFrequency'];this[_0x7b7e('0x11')]=_0x2e5e07[_0x7b7e('0x11')];this['dialNoAnswerRetryFrequency']=_0x2e5e07[_0x7b7e('0x12')];this['dialGlobalMaxRetry']=_0x2e5e07['dialGlobalMaxRetry'];this[_0x7b7e('0x13')]=_0x2e5e07[_0x7b7e('0x13')]||_0x7b7e('0x14');this[_0x7b7e('0x15')]=_0x2e5e07[_0x7b7e('0x15')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x2e5e07['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x7b7e('0x16')]=_0x2e5e07[_0x7b7e('0x16')]||undefined;this[_0x7b7e('0x17')]=_0x2e5e07[_0x7b7e('0x17')]?_0x2e5e07[_0x7b7e('0x17')]:undefined;this[_0x7b7e('0x18')]=_0x2e5e07[_0x7b7e('0x18')]?_0x2e5e07[_0x7b7e('0x18')]:undefined;this[_0x7b7e('0x19')]=_0x2e5e07[_0x7b7e('0x19')]?_0x2e5e07[_0x7b7e('0x19')]:undefined;this[_0x7b7e('0x1a')]=_0x2e5e07[_0x7b7e('0x1a')]?_0x2e5e07[_0x7b7e('0x1a')]:undefined;this[_0x7b7e('0x1b')]=_0x2e5e07[_0x7b7e('0x1a')]?_0x2e5e07[_0x7b7e('0x1a')]['name']:undefined;this[_0x7b7e('0x1c')]=_0x2e5e07[_0x7b7e('0x1c')]||![];this[_0x7b7e('0x1d')]=_0x2e5e07['dialAMDInitialSilence'];this[_0x7b7e('0x1e')]=_0x2e5e07[_0x7b7e('0x1e')];this[_0x7b7e('0x1f')]=_0x2e5e07[_0x7b7e('0x1f')];this[_0x7b7e('0x20')]=_0x2e5e07[_0x7b7e('0x20')];this[_0x7b7e('0x21')]=_0x2e5e07[_0x7b7e('0x21')];this['dialAMDBetweenWordsSilence']=_0x2e5e07['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x2e5e07[_0x7b7e('0x22')];this[_0x7b7e('0x23')]=_0x2e5e07[_0x7b7e('0x23')];this['dialAMDMaximumWordLength']=_0x2e5e07['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index bc55ca0..97aeb8c 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 _0xbeb6=['holdtime','type','disposition','monitor','queue','transfercalleridnum','transferconnectedlinenum','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','billableseconds'];(function(_0xb8d9cf,_0x455825){var _0x5a2d3b=function(_0x3fc1a0){while(--_0x3fc1a0){_0xb8d9cf['push'](_0xb8d9cf['shift']());}};_0x5a2d3b(++_0x455825);}(_0xbeb6,0x19e));var _0x6beb=function(_0x23b0aa,_0x5967c1){_0x23b0aa=_0x23b0aa-0x0;var _0x299166=_0xbeb6[_0x23b0aa];return _0x299166;};'use strict';function Channel(){this['starttime']=null;this[_0x6beb('0x0')]='';this[_0x6beb('0x1')]='';this[_0x6beb('0x2')]=0x0;this[_0x6beb('0x3')]='';this[_0x6beb('0x4')]=undefined;this[_0x6beb('0x5')]=undefined;this[_0x6beb('0x6')]=0x0;this[_0x6beb('0x7')]='';this[_0x6beb('0x8')]=0x0;this[_0x6beb('0x9')]=0x0;this[_0x6beb('0xa')]=0x0;this[_0x6beb('0xb')]=![];this[_0x6beb('0xc')]=null;this[_0x6beb('0xd')]=null;this['unmanaged']=![];this[_0x6beb('0xe')]=![];this[_0x6beb('0xf')]='';this[_0x6beb('0x10')]='';this['duration']=0x0;this[_0x6beb('0x11')]=0x0;this[_0x6beb('0x12')]=0x0;this[_0x6beb('0x13')]=null;this['tag']=null;this[_0x6beb('0x14')]=null;this[_0x6beb('0x15')]=![];this['monitorFilename']=null;this[_0x6beb('0x16')]=null;this['monitors']=[];this[_0x6beb('0x17')]=undefined;this[_0x6beb('0x18')]=undefined;this[_0x6beb('0x19')]=0x0;}module[_0x6beb('0x1a')]=Channel; \ No newline at end of file +var _0xd291=['starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','lastapplication','lastdata','holdtime','type','tag','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports'];(function(_0x15ea09,_0x2f30ab){var _0x3e9c78=function(_0x15f8ba){while(--_0x15f8ba){_0x15ea09['push'](_0x15ea09['shift']());}};_0x3e9c78(++_0x2f30ab);}(_0xd291,0xae));var _0x1d29=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd291[_0x14add3];return _0x4a174f;};'use strict';function Channel(){this[_0x1d29('0x0')]=null;this[_0x1d29('0x1')]='';this[_0x1d29('0x2')]='';this[_0x1d29('0x3')]=0x0;this[_0x1d29('0x4')]='';this[_0x1d29('0x5')]=undefined;this[_0x1d29('0x6')]=undefined;this[_0x1d29('0x7')]=0x0;this[_0x1d29('0x8')]='';this[_0x1d29('0x9')]=0x0;this[_0x1d29('0xa')]=0x0;this[_0x1d29('0xb')]=0x0;this[_0x1d29('0xc')]=![];this[_0x1d29('0xd')]=null;this[_0x1d29('0xe')]=null;this[_0x1d29('0xf')]=![];this['abandoned']=![];this[_0x1d29('0x10')]='';this[_0x1d29('0x11')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0x1d29('0x12')]=0x0;this[_0x1d29('0x13')]=null;this[_0x1d29('0x14')]=null;this['disposition']=null;this[_0x1d29('0x15')]=![];this[_0x1d29('0x16')]=null;this[_0x1d29('0x17')]=null;this[_0x1d29('0x18')]=[];this[_0x1d29('0x19')]=undefined;this[_0x1d29('0x1a')]=undefined;this[_0x1d29('0x1b')]=0x0;}module[_0x1d29('0x1c')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index e5c88c9..665d64b 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 _0x4a80=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x161587,_0x5c4528){var _0x293546=function(_0x40406e){while(--_0x40406e){_0x161587['push'](_0x161587['shift']());}};_0x293546(++_0x5c4528);}(_0x4a80,0xbe));var _0x04a8=function(_0x47265d,_0x22fe5e){_0x47265d=_0x47265d-0x0;var _0x4e93e8=_0x4a80[_0x47265d];return _0x4e93e8;};'use strict';function DeskAccount(_0xe497b5){this['id']=_0xe497b5['id']||0x0;this['name']=_0xe497b5[_0x04a8('0x0')]||'';this[_0x04a8('0x1')]=_0xe497b5['username']||'';this[_0x04a8('0x2')]=_0xe497b5[_0x04a8('0x2')]||'';this[_0x04a8('0x3')]=_0xe497b5[_0x04a8('0x3')]||'';this[_0x04a8('0x4')]=_0xe497b5[_0x04a8('0x4')]||'';this[_0x04a8('0x5')]=_0xe497b5[_0x04a8('0x5')]||'';this[_0x04a8('0x6')]=_0xe497b5[_0x04a8('0x6')]||'';this['token']=_0xe497b5[_0x04a8('0x7')]||'';this[_0x04a8('0x8')]=_0xe497b5[_0x04a8('0x8')]||'';this[_0x04a8('0x9')]=_0xe497b5[_0x04a8('0x9')]||'';this[_0x04a8('0xa')]=_0xe497b5[_0x04a8('0xa')]||'';this[_0x04a8('0xb')]=_0xe497b5[_0x04a8('0xb')]||{};}module[_0x04a8('0xc')]=DeskAccount; \ No newline at end of file +var _0x46fc=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','consumerKey'];(function(_0x18a0c1,_0x1eee42){var _0xd1629=function(_0x5df819){while(--_0x5df819){_0x18a0c1['push'](_0x18a0c1['shift']());}};_0xd1629(++_0x1eee42);}(_0x46fc,0x103));var _0xc46f=function(_0x29ebf4,_0x38489d){_0x29ebf4=_0x29ebf4-0x0;var _0x18f197=_0x46fc[_0x29ebf4];return _0x18f197;};'use strict';function DeskAccount(_0x397f36){this['id']=_0x397f36['id']||0x0;this[_0xc46f('0x0')]=_0x397f36[_0xc46f('0x0')]||'';this[_0xc46f('0x1')]=_0x397f36[_0xc46f('0x1')]||'';this[_0xc46f('0x2')]=_0x397f36[_0xc46f('0x2')]||'';this[_0xc46f('0x3')]=_0x397f36[_0xc46f('0x3')]||'';this['password']=_0x397f36['password']||'';this[_0xc46f('0x4')]=_0x397f36[_0xc46f('0x4')]||'';this[_0xc46f('0x5')]=_0x397f36[_0xc46f('0x5')]||'';this[_0xc46f('0x6')]=_0x397f36[_0xc46f('0x6')]||'';this[_0xc46f('0x7')]=_0x397f36[_0xc46f('0x7')]||'';this[_0xc46f('0x8')]=_0x397f36[_0xc46f('0x8')]||'';this[_0xc46f('0x9')]=_0x397f36[_0xc46f('0x9')]||'';this[_0xc46f('0xa')]=_0x397f36[_0xc46f('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 8389654..868e905 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 _0x6735=['clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x227380,_0x118e7c){var _0x8b7543=function(_0x43a2e4){while(--_0x43a2e4){_0x227380['push'](_0x227380['shift']());}};_0x8b7543(++_0x118e7c);}(_0x6735,0x73));var _0x5673=function(_0x590e5a,_0x5d556b){_0x590e5a=_0x590e5a-0x0;var _0x6a49c6=_0x6735[_0x590e5a];return _0x6a49c6;};'use strict';function Dynamics365Account(_0x35a600){this['id']=_0x35a600['id']||0x0;this[_0x5673('0x0')]=_0x35a600[_0x5673('0x0')]||'';this[_0x5673('0x1')]=_0x35a600[_0x5673('0x1')]||'';this[_0x5673('0x2')]=_0x35a600['password']||'';this[_0x5673('0x3')]=_0x35a600[_0x5673('0x3')]||'';this[_0x5673('0x4')]=_0x35a600[_0x5673('0x4')]||'';this['clientId']=_0x35a600[_0x5673('0x5')]||'';this[_0x5673('0x6')]=_0x35a600[_0x5673('0x6')]||{};this['serverUrl']=_0x35a600[_0x5673('0x7')]||'';this[_0x5673('0x8')]=_0x35a600[_0x5673('0x8')]||{};}module[_0x5673('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xf15b=['password','remoteUri','tenantId','clientId','clientSecret','Configurations','name','username'];(function(_0x380320,_0x278bb5){var _0x58e944=function(_0x49836c){while(--_0x49836c){_0x380320['push'](_0x380320['shift']());}};_0x58e944(++_0x278bb5);}(_0xf15b,0x126));var _0xbf15=function(_0xf9664c,_0x23180f){_0xf9664c=_0xf9664c-0x0;var _0x400cfb=_0xf15b[_0xf9664c];return _0x400cfb;};'use strict';function Dynamics365Account(_0xcb57f5){this['id']=_0xcb57f5['id']||0x0;this[_0xbf15('0x0')]=_0xcb57f5[_0xbf15('0x0')]||'';this[_0xbf15('0x1')]=_0xcb57f5[_0xbf15('0x1')]||'';this[_0xbf15('0x2')]=_0xcb57f5[_0xbf15('0x2')]||'';this[_0xbf15('0x3')]=_0xcb57f5[_0xbf15('0x3')]||'';this[_0xbf15('0x4')]=_0xcb57f5[_0xbf15('0x4')]||'';this[_0xbf15('0x5')]=_0xcb57f5['clientId']||'';this[_0xbf15('0x6')]=_0xcb57f5[_0xbf15('0x6')]||{};this['serverUrl']=_0xcb57f5['serverUrl']||'';this[_0xbf15('0x7')]=_0xcb57f5['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 3864c5c..f448e7f 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 _0x8323=['ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description'];(function(_0x34fa57,_0x407a94){var _0x262f1f=function(_0x5ae7ff){while(--_0x5ae7ff){_0x34fa57['push'](_0x34fa57['shift']());}};_0x262f1f(++_0x407a94);}(_0x8323,0x1d2));var _0x3832=function(_0x53e8c9,_0x2ab57d){_0x53e8c9=_0x53e8c9-0x0;var _0x5e0aa9=_0x8323[_0x53e8c9];return _0x5e0aa9;};'use strict';function FaxAccount(_0xdaa32e){this['id']=_0xdaa32e['id']||0x0;this[_0x3832('0x0')]=_0xdaa32e[_0x3832('0x0')]||'';this[_0x3832('0x1')]=_0xdaa32e[_0x3832('0x1')];this[_0x3832('0x2')]=_0xdaa32e[_0x3832('0x2')];this['headerinfo']=_0xdaa32e[_0x3832('0x3')];this[_0x3832('0x4')]=_0xdaa32e['localstationid'];this['minrate']=_0xdaa32e[_0x3832('0x5')]||0x960;this[_0x3832('0x6')]=_0xdaa32e[_0x3832('0x6')]||0x3840;this[_0x3832('0x7')]=_0xdaa32e['modem']||_0x3832('0x8');this[_0x3832('0x9')]=_0xdaa32e[_0x3832('0x9')]||'no';this[_0x3832('0xa')]=_0xdaa32e[_0x3832('0xa')]||'no';this[_0x3832('0xb')]=_0xdaa32e['t38timeout']||0x1388;this[_0x3832('0xc')]=_0xdaa32e['tech']||_0x3832('0xd');this[_0x3832('0xe')]=_0xdaa32e[_0x3832('0xe')]?_0xdaa32e[_0x3832('0xe')]:undefined;this['ListId']=_0xdaa32e[_0x3832('0xf')];this[_0x3832('0x10')]=_0xdaa32e[_0x3832('0x10')];}module[_0x3832('0x11')]=FaxAccount; \ No newline at end of file +var _0x8e77=['tech','SIP','Trunk','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x23ea7b,_0x9cde64){var _0x51be74=function(_0x134020){while(--_0x134020){_0x23ea7b['push'](_0x23ea7b['shift']());}};_0x51be74(++_0x9cde64);}(_0x8e77,0x1f2));var _0x78e7=function(_0x5411cb,_0x1cd69d){_0x5411cb=_0x5411cb-0x0;var _0x32727a=_0x8e77[_0x5411cb];return _0x32727a;};'use strict';function FaxAccount(_0x5f3780){this['id']=_0x5f3780['id']||0x0;this[_0x78e7('0x0')]=_0x5f3780[_0x78e7('0x0')]||'';this['description']=_0x5f3780[_0x78e7('0x1')];this['ecm']=_0x5f3780[_0x78e7('0x2')];this[_0x78e7('0x3')]=_0x5f3780[_0x78e7('0x3')];this[_0x78e7('0x4')]=_0x5f3780[_0x78e7('0x4')];this[_0x78e7('0x5')]=_0x5f3780[_0x78e7('0x5')]||0x960;this[_0x78e7('0x6')]=_0x5f3780[_0x78e7('0x6')]||0x3840;this[_0x78e7('0x7')]=_0x5f3780[_0x78e7('0x7')]||_0x78e7('0x8');this[_0x78e7('0x9')]=_0x5f3780[_0x78e7('0x9')]||'no';this[_0x78e7('0xa')]=_0x5f3780['faxdetect']||'no';this[_0x78e7('0xb')]=_0x5f3780[_0x78e7('0xb')]||0x1388;this[_0x78e7('0xc')]=_0x5f3780['tech']||_0x78e7('0xd');this[_0x78e7('0xe')]=_0x5f3780[_0x78e7('0xe')]?_0x5f3780[_0x78e7('0xe')]:undefined;this['ListId']=_0x5f3780['ListId'];this['key']=_0x5f3780[_0x78e7('0xf')];}module[_0x78e7('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index eee277e..9198c45 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 _0xbcb4=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x1eda88,_0x555454){var _0x2eb594=function(_0x250216){while(--_0x250216){_0x1eda88['push'](_0x1eda88['shift']());}};_0x2eb594(++_0x555454);}(_0xbcb4,0x93));var _0x4bcb=function(_0xe58d95,_0x30a8af){_0xe58d95=_0xe58d95-0x0;var _0x5db667=_0xbcb4[_0xe58d95];return _0x5db667;};'use strict';function FreshdeskAccount(_0x5db387){this['id']=_0x5db387['id']||0x0;this[_0x4bcb('0x0')]=_0x5db387[_0x4bcb('0x0')]||'';this['username']=_0x5db387[_0x4bcb('0x1')]||'';this[_0x4bcb('0x2')]=_0x5db387[_0x4bcb('0x3')]||'';this[_0x4bcb('0x4')]=_0x5db387['remoteUri']||'';this['serverUrl']=_0x5db387[_0x4bcb('0x5')]||'';this[_0x4bcb('0x6')]=_0x5db387[_0x4bcb('0x6')]||{};}module[_0x4bcb('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x862a=['username','apiKey','token','remoteUri','serverUrl','Configurations','name'];(function(_0x5df319,_0x330641){var _0x1799d5=function(_0x41a946){while(--_0x41a946){_0x5df319['push'](_0x5df319['shift']());}};_0x1799d5(++_0x330641);}(_0x862a,0x1aa));var _0xa862=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x862a[_0x29d94e];return _0x106237;};'use strict';function FreshdeskAccount(_0x4a462e){this['id']=_0x4a462e['id']||0x0;this[_0xa862('0x0')]=_0x4a462e[_0xa862('0x0')]||'';this[_0xa862('0x1')]=_0x4a462e['username']||'';this[_0xa862('0x2')]=_0x4a462e[_0xa862('0x3')]||'';this[_0xa862('0x4')]=_0x4a462e['remoteUri']||'';this[_0xa862('0x5')]=_0x4a462e['serverUrl']||'';this[_0xa862('0x6')]=_0x4a462e[_0xa862('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 51367e3..67104fa 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 _0x92c9=['name','apiKey','serverUrl','Configurations'];(function(_0x17a3a2,_0x4120e7){var _0x488f6b=function(_0x303673){while(--_0x303673){_0x17a3a2['push'](_0x17a3a2['shift']());}};_0x488f6b(++_0x4120e7);}(_0x92c9,0x1e0));var _0x992c=function(_0xa861aa,_0x2895a4){_0xa861aa=_0xa861aa-0x0;var _0x1e34de=_0x92c9[_0xa861aa];return _0x1e34de;};'use strict';function FreshsalesAccount(_0x2b9538){this['id']=_0x2b9538['id']||0x0;this[_0x992c('0x0')]=_0x2b9538[_0x992c('0x0')]||'';this['username']=_0x2b9538['username']||'';this[_0x992c('0x1')]=_0x2b9538['token']||'';this['remoteUri']=_0x2b9538['remoteUri']||'';this[_0x992c('0x2')]=_0x2b9538['serverUrl']||'';this[_0x992c('0x3')]=_0x2b9538[_0x992c('0x3')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x2a46=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0xe2468f,_0x5c1608){var _0x4922fd=function(_0x1fa7ba){while(--_0x1fa7ba){_0xe2468f['push'](_0xe2468f['shift']());}};_0x4922fd(++_0x5c1608);}(_0x2a46,0x1a4));var _0x62a4=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0x2a46[_0x597484];return _0x218e64;};'use strict';function FreshsalesAccount(_0x978913){this['id']=_0x978913['id']||0x0;this[_0x62a4('0x0')]=_0x978913[_0x62a4('0x0')]||'';this['username']=_0x978913[_0x62a4('0x1')]||'';this[_0x62a4('0x2')]=_0x978913[_0x62a4('0x3')]||'';this['remoteUri']=_0x978913[_0x62a4('0x4')]||'';this[_0x62a4('0x5')]=_0x978913[_0x62a4('0x5')]||'';this[_0x62a4('0x6')]=_0x978913['Configurations']||{};}module[_0x62a4('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 36ed748..d2b79c4 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 _0xcb2e=['queuecallerjoinAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue'];(function(_0x1beea3,_0x560569){var _0x53f354=function(_0x1b50cf){while(--_0x1b50cf){_0x1beea3['push'](_0x1beea3['shift']());}};_0x53f354(++_0x560569);}(_0xcb2e,0x1e8));var _0xecb2=function(_0x39a333,_0x43ee97){_0x39a333=_0x39a333-0x0;var _0x34f22e=_0xcb2e[_0x39a333];return _0x34f22e;};'use strict';function QueueReport(){this[_0xecb2('0x0')]=_0xecb2('0x1');this[_0xecb2('0x2')]='';this[_0xecb2('0x3')]='';this[_0xecb2('0x4')]='';this[_0xecb2('0x5')]='';this[_0xecb2('0x6')]=null;this['queuecallerleaveAt']=null;this[_0xecb2('0x7')]=0x1;this[_0xecb2('0x8')]=0x1;this['queuecallerabandon']=![];this[_0xecb2('0x9')]=null;this[_0xecb2('0xa')]=![];this[_0xecb2('0xb')]=null;this[_0xecb2('0xc')]=![];this[_0xecb2('0xd')]=null;this['originalposition']=0x1;this[_0xecb2('0xe')]='';this['connectedlinenum']='';this[_0xecb2('0xf')]='';this[_0xecb2('0x10')]='';this[_0xecb2('0x11')]='';this[_0xecb2('0x12')]='';this[_0xecb2('0x13')]='';this[_0xecb2('0x14')]=0x0;this[_0xecb2('0x15')]=![];this[_0xecb2('0x16')]='';this[_0xecb2('0x17')]=0x0;this[_0xecb2('0x18')]={};}module[_0xecb2('0x19')]=QueueReport; \ No newline at end of file +var _0xf269=['channel','connectedlinenum','accountcode','context','exten','priority','holdtime','mohtime','variables','type','calleridnum','queuecallerjoinAt','position','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition'];(function(_0x2ae2e0,_0x3b645a){var _0x550630=function(_0x4fc397){while(--_0x4fc397){_0x2ae2e0['push'](_0x2ae2e0['shift']());}};_0x550630(++_0x3b645a);}(_0xf269,0xf7));var _0x9f26=function(_0x380e53,_0x4b1203){_0x380e53=_0x380e53-0x0;var _0x4dd7bf=_0xf269[_0x380e53];return _0x4dd7bf;};'use strict';function QueueReport(){this[_0x9f26('0x0')]='inbound';this['uniqueid']='';this[_0x9f26('0x1')]='';this['calleridname']='';this['queue']='';this[_0x9f26('0x2')]=null;this['queuecallerleaveAt']=null;this[_0x9f26('0x3')]=0x1;this['count']=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0x9f26('0x4')]=![];this[_0x9f26('0x5')]=null;this[_0x9f26('0x6')]=![];this['queuecallerexitAt']=null;this[_0x9f26('0x7')]=0x1;this[_0x9f26('0x8')]='';this[_0x9f26('0x9')]='';this['connectedlinename']='';this[_0x9f26('0xa')]='';this[_0x9f26('0xb')]='';this[_0x9f26('0xc')]='';this[_0x9f26('0xd')]='';this[_0x9f26('0xe')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0x9f26('0xf')]=0x0;this[_0x9f26('0x10')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index a263e9f..9af4720 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 _0xc1af=['clientSecret','securityToken','type','integrationTab','Configurations','name','username','remoteUri','password','clientId'];(function(_0x1308ec,_0x32c99e){var _0x1a43c8=function(_0x18ff62){while(--_0x18ff62){_0x1308ec['push'](_0x1308ec['shift']());}};_0x1a43c8(++_0x32c99e);}(_0xc1af,0x1c7));var _0xfc1a=function(_0x2cf640,_0x418079){_0x2cf640=_0x2cf640-0x0;var _0x41a0dc=_0xc1af[_0x2cf640];return _0x41a0dc;};'use strict';function SalesforceAccount(_0x19fddb){this['id']=_0x19fddb['id']||0x0;this['name']=_0x19fddb[_0xfc1a('0x0')]||'';this[_0xfc1a('0x1')]=_0x19fddb[_0xfc1a('0x1')]||'';this[_0xfc1a('0x2')]=_0x19fddb['remoteUri']||'';this['password']=_0x19fddb[_0xfc1a('0x3')]||'';this[_0xfc1a('0x4')]=_0x19fddb[_0xfc1a('0x4')]||'';this[_0xfc1a('0x5')]=_0x19fddb['clientSecret']||'';this['securityToken']=_0x19fddb[_0xfc1a('0x6')]||'';this[_0xfc1a('0x7')]=_0x19fddb['type']||_0xfc1a('0x8');this['serverUrl']=_0x19fddb['serverUrl']||'';this[_0xfc1a('0x9')]=_0x19fddb[_0xfc1a('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x924c=['remoteUri','password','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0x924c,0x15e));var _0xc924=function(_0x55f3f8,_0x177bf8){_0x55f3f8=_0x55f3f8-0x0;var _0x29f0a9=_0x924c[_0x55f3f8];return _0x29f0a9;};'use strict';function SalesforceAccount(_0x491b6f){this['id']=_0x491b6f['id']||0x0;this[_0xc924('0x0')]=_0x491b6f['name']||'';this[_0xc924('0x1')]=_0x491b6f[_0xc924('0x1')]||'';this[_0xc924('0x2')]=_0x491b6f['remoteUri']||'';this[_0xc924('0x3')]=_0x491b6f[_0xc924('0x3')]||'';this['clientId']=_0x491b6f['clientId']||'';this[_0xc924('0x4')]=_0x491b6f[_0xc924('0x4')]||'';this[_0xc924('0x5')]=_0x491b6f[_0xc924('0x5')]||'';this[_0xc924('0x6')]=_0x491b6f[_0xc924('0x6')]||_0xc924('0x7');this[_0xc924('0x8')]=_0x491b6f[_0xc924('0x8')]||'';this[_0xc924('0x9')]=_0x491b6f['Configurations']||{};}module[_0xc924('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 6dd8834..417cfc8 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 _0xe6e3=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x3d4d27,_0x1762ee){var _0x54dd43=function(_0x5985fd){while(--_0x5985fd){_0x3d4d27['push'](_0x3d4d27['shift']());}};_0x54dd43(++_0x1762ee);}(_0xe6e3,0x72));var _0x3e6e=function(_0x4ea413,_0x51ff3a){_0x4ea413=_0x4ea413-0x0;var _0x51cf25=_0xe6e3[_0x4ea413];return _0x51cf25;};'use strict';function ServicenowAccount(_0x2a147d){this['id']=_0x2a147d['id']||0x0;this['name']=_0x2a147d[_0x3e6e('0x0')]||'';this[_0x3e6e('0x1')]=_0x2a147d[_0x3e6e('0x1')]||'';this[_0x3e6e('0x2')]=_0x2a147d['password']||'';this[_0x3e6e('0x3')]=_0x2a147d[_0x3e6e('0x3')]||'';this[_0x3e6e('0x4')]=_0x2a147d[_0x3e6e('0x4')]||'';this['Configurations']=_0x2a147d[_0x3e6e('0x5')]||{};}module[_0x3e6e('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x4433=['Configurations','name','username','password','remoteUri','serverUrl'];(function(_0x56b8d8,_0x37cb88){var _0x34d873=function(_0x4eaccb){while(--_0x4eaccb){_0x56b8d8['push'](_0x56b8d8['shift']());}};_0x34d873(++_0x37cb88);}(_0x4433,0xf1));var _0x3443=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4433[_0x122ef9];return _0x42fba0;};'use strict';function ServicenowAccount(_0x49fa16){this['id']=_0x49fa16['id']||0x0;this['name']=_0x49fa16[_0x3443('0x0')]||'';this[_0x3443('0x1')]=_0x49fa16[_0x3443('0x1')]||'';this[_0x3443('0x2')]=_0x49fa16['password']||'';this[_0x3443('0x3')]=_0x49fa16['remoteUri']||'';this[_0x3443('0x4')]=_0x49fa16[_0x3443('0x4')]||'';this[_0x3443('0x5')]=_0x49fa16[_0x3443('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 5aefd3d..6b7d6e3 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 _0x0e16=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x8a4bb8,_0x413138){var _0x1b5d1b=function(_0xca5422){while(--_0xca5422){_0x8a4bb8['push'](_0x8a4bb8['shift']());}};_0x1b5d1b(++_0x413138);}(_0x0e16,0xf2));var _0x60e1=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x0e16[_0xf50820];return _0x2a9b10;};'use strict';function SugarcrmAccount(_0x161ea9){this['id']=_0x161ea9['id']||0x0;this[_0x60e1('0x0')]=_0x161ea9[_0x60e1('0x0')]||'';this[_0x60e1('0x1')]=_0x161ea9[_0x60e1('0x1')]||'';this[_0x60e1('0x2')]=_0x161ea9[_0x60e1('0x2')]||'';this[_0x60e1('0x3')]=_0x161ea9[_0x60e1('0x3')]||'';this[_0x60e1('0x4')]=_0x161ea9[_0x60e1('0x4')]||'';this[_0x60e1('0x5')]=_0x161ea9[_0x60e1('0x5')]||{};}module[_0x60e1('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xcd1b=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x1a8c32,_0x372229){var _0x56b43a=function(_0x35d375){while(--_0x35d375){_0x1a8c32['push'](_0x1a8c32['shift']());}};_0x56b43a(++_0x372229);}(_0xcd1b,0xf1));var _0xbcd1=function(_0x1503e1,_0x5eae4d){_0x1503e1=_0x1503e1-0x0;var _0x20fb57=_0xcd1b[_0x1503e1];return _0x20fb57;};'use strict';function SugarcrmAccount(_0x4b1641){this['id']=_0x4b1641['id']||0x0;this[_0xbcd1('0x0')]=_0x4b1641[_0xbcd1('0x0')]||'';this[_0xbcd1('0x1')]=_0x4b1641['username']||'';this[_0xbcd1('0x2')]=_0x4b1641['password']||'';this[_0xbcd1('0x3')]=_0x4b1641[_0xbcd1('0x3')]||'';this[_0xbcd1('0x4')]=_0x4b1641[_0xbcd1('0x4')]||'';this[_0xbcd1('0x5')]=_0x4b1641[_0xbcd1('0x5')]||{};}module[_0xbcd1('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 d735cb0..c7224b8 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 _0x04f0=['address','exports','name','accountcode','stateTime','status','unknown'];(function(_0x4b90b3,_0x164fb2){var _0x45472e=function(_0x4580d3){while(--_0x4580d3){_0x4b90b3['push'](_0x4b90b3['shift']());}};_0x45472e(++_0x164fb2);}(_0x04f0,0x191));var _0x004f=function(_0x1394f0,_0x488999){_0x1394f0=_0x1394f0-0x0;var _0x1313e5=_0x04f0[_0x1394f0];return _0x1313e5;};'use strict';function Telephone(_0x150e19){this['id']=_0x150e19['id']||0x0;this[_0x004f('0x0')]=_0x150e19[_0x004f('0x0')]||'';this['accountcode']=_0x150e19[_0x004f('0x1')]||'';this['state']='unknown';this[_0x004f('0x2')]=0x0;this[_0x004f('0x3')]=_0x004f('0x4');this[_0x004f('0x5')]='';}module[_0x004f('0x6')]=Telephone; \ No newline at end of file +var _0x7655=['exports','name','accountcode','unknown','stateTime','status','address'];(function(_0x2bddf9,_0x22c873){var _0x3f3ae9=function(_0x2d91ac){while(--_0x2d91ac){_0x2bddf9['push'](_0x2bddf9['shift']());}};_0x3f3ae9(++_0x22c873);}(_0x7655,0x1dd));var _0x5765=function(_0x5b6101,_0x500317){_0x5b6101=_0x5b6101-0x0;var _0x42a465=_0x7655[_0x5b6101];return _0x42a465;};'use strict';function Telephone(_0x1789b2){this['id']=_0x1789b2['id']||0x0;this[_0x5765('0x0')]=_0x1789b2[_0x5765('0x0')]||'';this[_0x5765('0x1')]=_0x1789b2[_0x5765('0x1')]||'';this['state']=_0x5765('0x2');this[_0x5765('0x3')]=0x0;this[_0x5765('0x4')]=_0x5765('0x2');this[_0x5765('0x5')]='';}module[_0x5765('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 80ec180..f6ad3d8 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 _0x4790=['html','name'];(function(_0x541079,_0x33ef7c){var _0x20b8df=function(_0x6dbd){while(--_0x6dbd){_0x541079['push'](_0x541079['shift']());}};_0x20b8df(++_0x33ef7c);}(_0x4790,0x105));var _0x0479=function(_0x43f552,_0x42808c){_0x43f552=_0x43f552-0x0;var _0x17911b=_0x4790[_0x43f552];return _0x17911b;};'use strict';function template(_0xbdde84){this['id']=_0xbdde84['id']||0x0;this['name']=_0xbdde84[_0x0479('0x0')]||'';this[_0x0479('0x1')]=_0xbdde84[_0x0479('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xb4e5=['name','html','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb4e5,0x17a));var _0x5b4e=function(_0x516e20,_0x356c7d){_0x516e20=_0x516e20-0x0;var _0x154557=_0xb4e5[_0x516e20];return _0x154557;};'use strict';function template(_0xcbd31){this['id']=_0xcbd31['id']||0x0;this[_0x5b4e('0x0')]=_0xcbd31[_0x5b4e('0x0')]||'';this[_0x5b4e('0x1')]=_0xcbd31[_0x5b4e('0x1')]||'';}module[_0x5b4e('0x2')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index ddb5da8..a08eef9 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 _0xf3cd=['voice','status','AllConditions','AnyConditions','Actions','exports','name','channel'];(function(_0x344472,_0x3869da){var _0x2064ea=function(_0x5bb488){while(--_0x5bb488){_0x344472['push'](_0x344472['shift']());}};_0x2064ea(++_0x3869da);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x24fa1a,_0x16d9c2){_0x24fa1a=_0x24fa1a-0x0;var _0xc5621f=_0xf3cd[_0x24fa1a];return _0xc5621f;};'use strict';function Trigger(_0x13cb67){this['id']=_0x13cb67['id']||0x0;this[_0xdf3c('0x0')]=_0x13cb67[_0xdf3c('0x0')]||'';this[_0xdf3c('0x1')]=_0x13cb67[_0xdf3c('0x1')]||_0xdf3c('0x2');this['status']=_0x13cb67[_0xdf3c('0x3')]||![];this[_0xdf3c('0x4')]=_0x13cb67[_0xdf3c('0x4')]||[];this['AnyConditions']=_0x13cb67[_0xdf3c('0x5')]||[];this[_0xdf3c('0x6')]=_0x13cb67[_0xdf3c('0x6')]||[];}module[_0xdf3c('0x7')]=Trigger; \ No newline at end of file +var _0xa41a=['AnyConditions','Actions','name','channel','voice','status','AllConditions'];(function(_0x351c63,_0x166977){var _0x2f1fd8=function(_0x572a32){while(--_0x572a32){_0x351c63['push'](_0x351c63['shift']());}};_0x2f1fd8(++_0x166977);}(_0xa41a,0x6b));var _0xaa41=function(_0x168d94,_0xb6a28e){_0x168d94=_0x168d94-0x0;var _0x5ba7a5=_0xa41a[_0x168d94];return _0x5ba7a5;};'use strict';function Trigger(_0x33e667){this['id']=_0x33e667['id']||0x0;this[_0xaa41('0x0')]=_0x33e667['name']||'';this[_0xaa41('0x1')]=_0x33e667[_0xaa41('0x1')]||_0xaa41('0x2');this[_0xaa41('0x3')]=_0x33e667[_0xaa41('0x3')]||![];this[_0xaa41('0x4')]=_0x33e667[_0xaa41('0x4')]||[];this[_0xaa41('0x5')]=_0x33e667['AnyConditions']||[];this[_0xaa41('0x6')]=_0x33e667[_0xaa41('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 96f9a95..8ee634f 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 _0x103f=['registrationtime','exports','active','name','unknown','stateTime','status','registry','host','port','domain','domainport','refresh','stateRegistry'];(function(_0x5cbcba,_0x900c2){var _0x3fcc42=function(_0x91bbf9){while(--_0x91bbf9){_0x5cbcba['push'](_0x5cbcba['shift']());}};_0x3fcc42(++_0x900c2);}(_0x103f,0xe2));var _0xf103=function(_0x4343b4,_0x1a9a7d){_0x4343b4=_0x4343b4-0x0;var _0x545f64=_0x103f[_0x4343b4];return _0x545f64;};'use strict';function Trunk(_0x15719e){this['id']=_0x15719e['id']||0x0;this[_0xf103('0x0')]=_0x15719e[_0xf103('0x0')]||![];this[_0xf103('0x1')]=_0x15719e[_0xf103('0x1')]||'';this['state']=_0xf103('0x2');this[_0xf103('0x3')]=0x0;this[_0xf103('0x4')]=_0xf103('0x2');this[_0xf103('0x5')]=_0x15719e[_0xf103('0x5')]&&_0x15719e[_0xf103('0x5')]['indexOf'](':')?_0x15719e[_0xf103('0x5')]['split'](':')[0x0]:'';this[_0xf103('0x6')]='';this[_0xf103('0x7')]='';this[_0xf103('0x8')]='';this[_0xf103('0x9')]='';this[_0xf103('0xa')]='';this[_0xf103('0xb')]=_0xf103('0x2');this[_0xf103('0xc')]='';this['address']='';}module[_0xf103('0xd')]=Trunk; \ No newline at end of file +var _0x2f22=['address','exports','active','name','state','stateTime','status','unknown','registry','indexOf','split','host','port','domain','refresh','stateRegistry','registrationtime'];(function(_0x56dfe9,_0x5dad6b){var _0x49b525=function(_0x564a60){while(--_0x564a60){_0x56dfe9['push'](_0x56dfe9['shift']());}};_0x49b525(++_0x5dad6b);}(_0x2f22,0x156));var _0x22f2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2f22[_0x42cae2];return _0x5f256f;};'use strict';function Trunk(_0x5df36b){this['id']=_0x5df36b['id']||0x0;this[_0x22f2('0x0')]=_0x5df36b[_0x22f2('0x0')]||![];this['name']=_0x5df36b[_0x22f2('0x1')]||'';this[_0x22f2('0x2')]='unknown';this[_0x22f2('0x3')]=0x0;this[_0x22f2('0x4')]=_0x22f2('0x5');this[_0x22f2('0x6')]=_0x5df36b[_0x22f2('0x6')]&&_0x5df36b[_0x22f2('0x6')][_0x22f2('0x7')](':')?_0x5df36b['registry'][_0x22f2('0x8')](':')[0x0]:'';this[_0x22f2('0x9')]='';this[_0x22f2('0xa')]='';this[_0x22f2('0xb')]='';this['domainport']='';this[_0x22f2('0xc')]='';this[_0x22f2('0xd')]='unknown';this[_0x22f2('0xe')]='';this[_0x22f2('0xf')]='';}module[_0x22f2('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 8f20816..2f4ed37 100644 --- a/server/services/ami/model/voiceExtension.js +++ b/server/services/ami/model/voiceExtension.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf984=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x413bdf,_0x1834bc){var _0x229799=function(_0x570c2e){while(--_0x570c2e){_0x413bdf['push'](_0x413bdf['shift']());}};_0x229799(++_0x1834bc);}(_0xf984,0x1a6));var _0x4f98=function(_0x50d5ae,_0x22a349){_0x50d5ae=_0x50d5ae-0x0;var _0x1e8d74=_0xf984[_0x50d5ae];return _0x1e8d74;};'use strict';function voiceExtension(_0x3c5fd1){this['id']=_0x3c5fd1['id']||0x0;this[_0x4f98('0x0')]=_0x3c5fd1[_0x4f98('0x0')]||'';this['recordingFormat']=_0x3c5fd1[_0x4f98('0x1')]||_0x4f98('0x2');this[_0x4f98('0x3')]=_0x3c5fd1[_0x4f98('0x3')]||![];}module[_0x4f98('0x4')]=voiceExtension; \ No newline at end of file +var _0xdb4a=['mandatoryDisposition','exports','exten','none'];(function(_0x91fd07,_0x3d192d){var _0x31a297=function(_0x30a62a){while(--_0x30a62a){_0x91fd07['push'](_0x91fd07['shift']());}};_0x31a297(++_0x3d192d);}(_0xdb4a,0x1da));var _0xadb4=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xdb4a[_0x2112d4];return _0x434972;};'use strict';function voiceExtension(_0x4c537d){this['id']=_0x4c537d['id']||0x0;this[_0xadb4('0x0')]=_0x4c537d['exten']||'';this['recordingFormat']=_0x4c537d['recordingFormat']||_0xadb4('0x1');this[_0xadb4('0x2')]=_0x4c537d[_0xadb4('0x2')]||![];}module[_0xadb4('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 3b6b8c7..63d06c4 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 _0x418b=['name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumHoldTime','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','gsm'];(function(_0x3bff29,_0x3d5c87){var _0x42cd62=function(_0x36d317){while(--_0x36d317){_0x3bff29['push'](_0x3bff29['shift']());}};_0x42cd62(++_0x3d5c87);}(_0x418b,0x147));var _0xb418=function(_0xe329f1,_0x75c3cf){_0xe329f1=_0xe329f1-0x0;var _0x1b2474=_0x418b[_0xe329f1];return _0x1b2474;};'use strict';var statusDesc=[_0xb418('0x0'),_0xb418('0x1'),'inuse',_0xb418('0x2'),_0xb418('0x3'),_0xb418('0x4'),_0xb418('0x5'),_0xb418('0x6'),_0xb418('0x7')];var monitorFormat={'wav':'wav','wav49':'wav49','gsm':_0xb418('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x4e9672){this['id']=_0x4e9672['id']||0x0;this[_0xb418('0x9')]=_0x4e9672[_0xb418('0x9')]||'';this['monitor_format']=_0x4e9672[_0xb418('0xa')]||'';this[_0xb418('0xb')]=_0x4e9672[_0xb418('0xb')]||_0xb418('0xc');this[_0xb418('0xd')]=0x0;this[_0xb418('0xe')]=0x0;this[_0xb418('0xf')]=0x0;this['answered']=0x0;this[_0xb418('0x10')]=0x0;this[_0xb418('0x11')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0xb418('0x12')]=0x0;this[_0xb418('0x13')]=0x0;this[_0xb418('0x14')]=0x0;this[_0xb418('0x15')]=_0x4e9672[_0xb418('0x15')]||![];this[_0xb418('0x16')]=_0x4e9672[_0xb418('0x16')]||0xa;this[_0xb418('0x17')]=_0x4e9672[_0xb418('0x17')]||'no';this[_0xb418('0x18')]=!![];this['message']='';this['originated']=0x0;this['temp']=0x0;this[_0xb418('0x19')]=_0x4e9672[_0xb418('0x19')]||null;this[_0xb418('0x1a')]=_0x4e9672[_0xb418('0x1a')]?_0x4e9672[_0xb418('0x1a')]:null;this[_0xb418('0x1b')]=_0x4e9672[_0xb418('0x1b')];this[_0xb418('0x1c')]=_0x4e9672[_0xb418('0x1c')]||_0xb418('0x1d');this['dialLimitChannel']=_0x4e9672[_0xb418('0x1e')]||0x0;this[_0xb418('0x1f')]=_0x4e9672[_0xb418('0x1f')]||0x0;this[_0xb418('0x20')]=_0x4e9672['dialPowerLevel']||0x1;this[_0xb418('0x21')]=_0x4e9672[_0xb418('0x21')]||_0xb418('0x22');this[_0xb418('0x23')]=_0x4e9672[_0xb418('0x23')]||0.03;this[_0xb418('0x24')]=_0x4e9672[_0xb418('0x24')]||0x258;this[_0xb418('0x25')]=_0x4e9672[_0xb418('0x25')]||_0xb418('0x26');this[_0xb418('0x27')]=_0x4e9672[_0xb418('0x27')]||_0xb418('0x26');this['dialOriginateTimeout']=_0x4e9672[_0xb418('0x28')]||0x1e;this['dialQueueOptions']=_0x4e9672[_0xb418('0x29')]||'tTxX';this['dialQueueTimeout']=_0x4e9672[_0xb418('0x2a')]||0x3;this[_0xb418('0x2b')]=_0x4e9672[_0xb418('0x2b')]||undefined;this[_0xb418('0x2c')]=_0x4e9672['dialCongestionMaxRetry']||0x3;this[_0xb418('0x2d')]=_0x4e9672[_0xb418('0x2d')]||0x96;this[_0xb418('0x2e')]=_0x4e9672[_0xb418('0x2e')]||0x3;this[_0xb418('0x2f')]=_0x4e9672[_0xb418('0x2f')]||0x96;this[_0xb418('0x30')]=_0x4e9672[_0xb418('0x30')]||0x3;this[_0xb418('0x31')]=_0x4e9672[_0xb418('0x31')]||0x96;this[_0xb418('0x32')]=_0x4e9672[_0xb418('0x32')]||0x4;this[_0xb418('0x33')]=_0x4e9672[_0xb418('0x33')]?_0x4e9672['Trunk']:undefined;this[_0xb418('0x34')]=_0x4e9672[_0xb418('0x34')]?_0x4e9672['TrunkBackup']:undefined;this[_0xb418('0x35')]=_0x4e9672[_0xb418('0x35')]||undefined;this[_0xb418('0x36')]=_0x4e9672['Interval']?_0x4e9672[_0xb418('0x36')]:undefined;this['dialOrderByScheduledAt']=_0x4e9672[_0xb418('0x37')]||_0xb418('0x38');this[_0xb418('0x39')]=_0x4e9672[_0xb418('0x39')]||undefined;this[_0xb418('0x3a')]=_0x4e9672[_0xb418('0x3a')]||undefined;this['strategy']=strategy[_0x4e9672[_0xb418('0x3b')]]||_0xb418('0x3c');this[_0xb418('0x3d')]=!![];this[_0xb418('0x3e')]=_0x4e9672[_0xb418('0x3e')]||![];this[_0xb418('0x3f')]=_0x4e9672[_0xb418('0x3f')];this[_0xb418('0x40')]=_0x4e9672[_0xb418('0x40')];this['dialAMDAfterGreetingSilence']=_0x4e9672[_0xb418('0x41')];this['dialAMDTotalAnalysisTime']=_0x4e9672[_0xb418('0x42')];this[_0xb418('0x43')]=_0x4e9672['dialAMDMinWordLength'];this[_0xb418('0x44')]=_0x4e9672[_0xb418('0x44')];this['dialAMDMaximumNumberOfWords']=_0x4e9672[_0xb418('0x45')];this[_0xb418('0x46')]=_0x4e9672[_0xb418('0x46')];this[_0xb418('0x47')]=_0x4e9672[_0xb418('0x47')];this[_0xb418('0x48')]=0x0;this[_0xb418('0x49')]=0x0;this[_0xb418('0x4a')]=_0x4e9672[_0xb418('0x4a')];this[_0xb418('0x4b')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xb418('0x4c')]=0x0;this[_0xb418('0x4d')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xb418('0x4e')]=0x0;this[_0xb418('0x4f')]=0x0;this[_0xb418('0x50')]=0x0;this[_0xb418('0x51')]=0x0;this[_0xb418('0x52')]=0x0;this[_0xb418('0x53')]=0x0;this[_0xb418('0x54')]=0x0;this[_0xb418('0x55')]=0x0;this[_0xb418('0x56')]=undefined;this[_0xb418('0x57')]=undefined;this[_0xb418('0x58')]=undefined;this[_0xb418('0x59')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xb418('0x5a')]=0x0;this[_0xb418('0x5b')]=0x0;this[_0xb418('0x5c')]=0x0;this[_0xb418('0x5d')]=0x0;this[_0xb418('0x5e')]=0x0;this[_0xb418('0x5f')]=0x0;this[_0xb418('0x60')]=0x0;this[_0xb418('0x61')]=_0x4e9672['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xb418('0x62')]=_0x4e9672['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xb418('0x63')]=0x0;this[_0xb418('0x64')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xb418('0x65')]=0x0;this[_0xb418('0x66')]=0x0;this[_0xb418('0x67')]=0x0;this[_0xb418('0x68')]=0x0;this[_0xb418('0x69')]=_0x4e9672[_0xb418('0x69')]||0x1e;this[_0xb418('0x6a')]=_0x4e9672[_0xb418('0x6a')]||![];this[_0xb418('0x6b')]=_0x4e9672[_0xb418('0x6b')]||undefined;this[_0xb418('0x6c')]=_0x4e9672[_0xb418('0x6c')]||![];this[_0xb418('0x6d')]=_0x4e9672[_0xb418('0x6d')]||![];this[_0xb418('0xa')]=monitorFormat[_0x4e9672['monitor_format']]?monitorFormat[_0x4e9672[_0xb418('0xa')]]:undefined;this['mandatoryDisposition']=_0x4e9672[_0xb418('0x6e')]||![];this[_0xb418('0x6f')]=_0x4e9672[_0xb418('0x6f')]?_0x4e9672[_0xb418('0x6f')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x91b8=['predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDispositionPause','exports','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','type','inbound','talking','total','answered','sumDuration','unmanaged','abandoned','loggedIn','available','acwTimeout','autopause','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime'];(function(_0x455776,_0x517f60){var _0x21c0fc=function(_0x17c584){while(--_0x17c584){_0x455776['push'](_0x455776['shift']());}};_0x21c0fc(++_0x517f60);}(_0x91b8,0xfc));var _0x891b=function(_0x1a0f1f,_0x265d11){_0x1a0f1f=_0x1a0f1f-0x0;var _0x44fc63=_0x91b8[_0x1a0f1f];return _0x44fc63;};'use strict';var statusDesc=['unknown',_0x891b('0x0'),_0x891b('0x1'),_0x891b('0x2'),_0x891b('0x3'),_0x891b('0x4'),'ringing',_0x891b('0x5'),_0x891b('0x6')];var monitorFormat={'wav':_0x891b('0x7'),'wav49':_0x891b('0x8'),'gsm':_0x891b('0x9')};var strategy={'rrmemory':_0x891b('0xa'),'roundrobin':_0x891b('0xb')};function VoiceQueue(_0x42bedc){this['id']=_0x42bedc['id']||0x0;this[_0x891b('0xc')]=_0x42bedc[_0x891b('0xc')]||'';this['monitor_format']=_0x42bedc['monitor_format']||'';this[_0x891b('0xd')]=_0x42bedc[_0x891b('0xd')]||_0x891b('0xe');this['waiting']=0x0;this[_0x891b('0xf')]=0x0;this[_0x891b('0x10')]=0x0;this[_0x891b('0x11')]=0x0;this[_0x891b('0x12')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0x891b('0x13')]=0x0;this[_0x891b('0x14')]=0x0;this[_0x891b('0x15')]=0x0;this[_0x891b('0x16')]=0x0;this['acw']=_0x42bedc['acw']||![];this[_0x891b('0x17')]=_0x42bedc[_0x891b('0x17')]||0xa;this[_0x891b('0x18')]=_0x42bedc[_0x891b('0x18')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x891b('0x19')]=0x0;this[_0x891b('0x1a')]=0x0;this[_0x891b('0x1b')]=_0x42bedc[_0x891b('0x1b')]||null;this[_0x891b('0x1c')]=_0x42bedc[_0x891b('0x1c')]?_0x42bedc[_0x891b('0x1c')]:null;this[_0x891b('0x1d')]=_0x42bedc[_0x891b('0x1d')];this[_0x891b('0x1e')]=_0x42bedc['dialMethod']||_0x891b('0x1f');this[_0x891b('0x20')]=_0x42bedc[_0x891b('0x20')]||0x0;this['dialLimitQueue']=_0x42bedc[_0x891b('0x21')]||0x0;this['dialPowerLevel']=_0x42bedc[_0x891b('0x22')]||0x1;this['dialPredictiveOptimization']=_0x42bedc[_0x891b('0x23')]||_0x891b('0x24');this[_0x891b('0x25')]=_0x42bedc[_0x891b('0x25')]||0.03;this[_0x891b('0x26')]=_0x42bedc[_0x891b('0x26')]||0x258;this[_0x891b('0x27')]=_0x42bedc['dialOriginateCallerIdName']||'anonymous';this[_0x891b('0x28')]=_0x42bedc[_0x891b('0x28')]||_0x891b('0x29');this[_0x891b('0x2a')]=_0x42bedc[_0x891b('0x2a')]||0x1e;this[_0x891b('0x2b')]=_0x42bedc[_0x891b('0x2b')]||_0x891b('0x2c');this['dialQueueTimeout']=_0x42bedc[_0x891b('0x2d')]||0x3;this[_0x891b('0x2e')]=_0x42bedc[_0x891b('0x2e')]||undefined;this[_0x891b('0x2f')]=_0x42bedc[_0x891b('0x2f')]||0x3;this['dialCongestionRetryFrequency']=_0x42bedc[_0x891b('0x30')]||0x96;this[_0x891b('0x31')]=_0x42bedc[_0x891b('0x31')]||0x3;this[_0x891b('0x32')]=_0x42bedc[_0x891b('0x32')]||0x96;this[_0x891b('0x33')]=_0x42bedc[_0x891b('0x33')]||0x3;this[_0x891b('0x34')]=_0x42bedc[_0x891b('0x34')]||0x96;this[_0x891b('0x35')]=_0x42bedc[_0x891b('0x35')]||0x4;this[_0x891b('0x36')]=_0x42bedc[_0x891b('0x36')]?_0x42bedc[_0x891b('0x36')]:undefined;this[_0x891b('0x37')]=_0x42bedc['TrunkBackup']?_0x42bedc[_0x891b('0x37')]:undefined;this[_0x891b('0x38')]=_0x42bedc['dialPrefix']||undefined;this[_0x891b('0x39')]=_0x42bedc['Interval']?_0x42bedc[_0x891b('0x39')]:undefined;this[_0x891b('0x3a')]=_0x42bedc[_0x891b('0x3a')]||_0x891b('0x3b');this['dialRandomLastDigitCallerIdNumber']=_0x42bedc[_0x891b('0x3c')]||undefined;this[_0x891b('0x3d')]=_0x42bedc[_0x891b('0x3d')]||undefined;this['strategy']=strategy[_0x42bedc[_0x891b('0x3e')]]||_0x891b('0xa');this[_0x891b('0x3f')]=!![];this[_0x891b('0x40')]=_0x42bedc['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x42bedc[_0x891b('0x41')];this[_0x891b('0x42')]=_0x42bedc[_0x891b('0x42')];this['dialAMDAfterGreetingSilence']=_0x42bedc[_0x891b('0x43')];this[_0x891b('0x44')]=_0x42bedc[_0x891b('0x44')];this[_0x891b('0x45')]=_0x42bedc['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x42bedc[_0x891b('0x46')];this[_0x891b('0x47')]=_0x42bedc['dialAMDMaximumNumberOfWords'];this[_0x891b('0x48')]=_0x42bedc[_0x891b('0x48')];this[_0x891b('0x49')]=_0x42bedc['dialAMDMaximumWordLength'];this[_0x891b('0x4a')]=0x0;this[_0x891b('0x4b')]=0x0;this['timeout']=_0x42bedc[_0x891b('0x4c')];this[_0x891b('0x4d')]=0x0;this[_0x891b('0x4e')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0x891b('0x4f')]=0x0;this[_0x891b('0x50')]=0x0;this[_0x891b('0x51')]=0x0;this[_0x891b('0x52')]=0x0;this[_0x891b('0x53')]=0x0;this[_0x891b('0x54')]=0x0;this[_0x891b('0x55')]=0x0;this[_0x891b('0x56')]=0x0;this[_0x891b('0x57')]=0x0;this[_0x891b('0x58')]=undefined;this[_0x891b('0x59')]=undefined;this[_0x891b('0x5a')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x891b('0x5b')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x891b('0x5c')]=0x0;this[_0x891b('0x5d')]=0x0;this[_0x891b('0x5e')]=0x0;this[_0x891b('0x5f')]=0x0;this[_0x891b('0x60')]=0x0;this[_0x891b('0x61')]=0x0;this[_0x891b('0x62')]=_0x42bedc[_0x891b('0x63')]||0x14;this[_0x891b('0x64')]=_0x42bedc[_0x891b('0x63')]||0xa;this[_0x891b('0x65')]=0x0;this[_0x891b('0x66')]=0x0;this[_0x891b('0x67')]=0x1;this[_0x891b('0x68')]=0x0;this[_0x891b('0x69')]=0x0;this[_0x891b('0x6a')]=0x0;this[_0x891b('0x6b')]=0x0;this['dialRecallMeTimeout']=_0x42bedc[_0x891b('0x6c')]||0x1e;this[_0x891b('0x6d')]=_0x42bedc[_0x891b('0x6d')]||![];this[_0x891b('0x6e')]=_0x42bedc['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x42bedc[_0x891b('0x6f')]||![];this['dialAgiAfterHangupAgent']=_0x42bedc[_0x891b('0x70')]||![];this[_0x891b('0x71')]=monitorFormat[_0x42bedc['monitor_format']]?monitorFormat[_0x42bedc['monitor_format']]:undefined;this['mandatoryDisposition']=_0x42bedc['mandatoryDisposition']||![];this[_0x891b('0x72')]=_0x42bedc[_0x891b('0x72')]?_0x42bedc['mandatoryDispositionPause']:undefined;}module[_0x891b('0x73')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 0707c61..d1865d7 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 _0x340e=['serverUrl','Configurations','name','username','accessKey','remoteUri'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x340e,0x12e));var _0xe340=function(_0x4eb7ae,_0x4cb9f4){_0x4eb7ae=_0x4eb7ae-0x0;var _0x59da27=_0x340e[_0x4eb7ae];return _0x59da27;};'use strict';function VtigerAccount(_0x18f538){this['id']=_0x18f538['id']||0x0;this[_0xe340('0x0')]=_0x18f538[_0xe340('0x0')]||'';this[_0xe340('0x1')]=_0x18f538[_0xe340('0x1')]||'';this[_0xe340('0x2')]=_0x18f538[_0xe340('0x2')]||'';this[_0xe340('0x3')]=_0x18f538[_0xe340('0x3')]||'';this['serverUrl']=_0x18f538[_0xe340('0x4')]||'';this[_0xe340('0x5')]=_0x18f538['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x35a9=['remoteUri','serverUrl','Configurations','name','username','accessKey'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x35a9,0x105));var _0x935a=function(_0x43c77b,_0xcfbbec){_0x43c77b=_0x43c77b-0x0;var _0x8a0a44=_0x35a9[_0x43c77b];return _0x8a0a44;};'use strict';function VtigerAccount(_0x4f4975){this['id']=_0x4f4975['id']||0x0;this[_0x935a('0x0')]=_0x4f4975[_0x935a('0x0')]||'';this[_0x935a('0x1')]=_0x4f4975[_0x935a('0x1')]||'';this[_0x935a('0x2')]=_0x4f4975[_0x935a('0x2')]||'';this[_0x935a('0x3')]=_0x4f4975[_0x935a('0x3')]||'';this[_0x935a('0x4')]=_0x4f4975[_0x935a('0x4')]||'';this['Configurations']=_0x4f4975[_0x935a('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 3772dc2..a321db5 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 _0x7a54=['serverUrl','Configurations','name','username','password','token','remoteUri','authType','type','integrationTab'];(function(_0x5c768b,_0x5e88a6){var _0x335af8=function(_0x39b04f){while(--_0x39b04f){_0x5c768b['push'](_0x5c768b['shift']());}};_0x335af8(++_0x5e88a6);}(_0x7a54,0x106));var _0x47a5=function(_0x38974b,_0x234534){_0x38974b=_0x38974b-0x0;var _0x53bc96=_0x7a54[_0x38974b];return _0x53bc96;};'use strict';function ZendeskAccount(_0xe384a5){this['id']=_0xe384a5['id']||0x0;this[_0x47a5('0x0')]=_0xe384a5[_0x47a5('0x0')]||'';this['username']=_0xe384a5[_0x47a5('0x1')]||'';this[_0x47a5('0x2')]=_0xe384a5['password']||'';this[_0x47a5('0x3')]=_0xe384a5[_0x47a5('0x3')]||'';this[_0x47a5('0x4')]=_0xe384a5[_0x47a5('0x4')]||'';this[_0x47a5('0x5')]=_0xe384a5['authType']||'';this[_0x47a5('0x6')]=_0xe384a5['type']||_0x47a5('0x7');this[_0x47a5('0x8')]=_0xe384a5['serverUrl']||'';this[_0x47a5('0x9')]=_0xe384a5['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x0b0e=['exports','name','username','password','token','remoteUri','authType','type','serverUrl','Configurations'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3f9ea9,_0x19840d){_0x3f9ea9=_0x3f9ea9-0x0;var _0x291e7f=_0x0b0e[_0x3f9ea9];return _0x291e7f;};'use strict';function ZendeskAccount(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['username']=_0x29cd1e[_0xe0b0('0x1')]||'';this[_0xe0b0('0x2')]=_0x29cd1e[_0xe0b0('0x2')]||'';this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||'';this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||'';this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||'';this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||'integrationTab';this['serverUrl']=_0x29cd1e[_0xe0b0('0x7')]||'';this[_0xe0b0('0x8')]=_0x29cd1e[_0xe0b0('0x8')]||{};}module[_0xe0b0('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index dafdd75..9f5f936 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 _0x4b17=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone'];(function(_0x4c616a,_0x4cb9a6){var _0x4b46de=function(_0x3eae43){while(--_0x3eae43){_0x4c616a['push'](_0x4c616a['shift']());}};_0x4b46de(++_0x4cb9a6);}(_0x4b17,0x10f));var _0x74b1=function(_0x2bd1ec,_0x3fe65f){_0x2bd1ec=_0x2bd1ec-0x0;var _0x2f7577=_0x4b17[_0x2bd1ec];return _0x2f7577;};'use strict';function ZohoAccount(_0x48564d){this['id']=_0x48564d['id']||0x0;this['name']=_0x48564d[_0x74b1('0x0')]||'';this['description']=_0x48564d[_0x74b1('0x1')]||'';this[_0x74b1('0x2')]=_0x48564d['host']||'';this[_0x74b1('0x3')]=_0x48564d['zone']||'';this['clientId']=_0x48564d[_0x74b1('0x4')]||'';this[_0x74b1('0x5')]=_0x48564d[_0x74b1('0x5')]||'';this[_0x74b1('0x6')]=_0x48564d[_0x74b1('0x6')]||'';this[_0x74b1('0x7')]=_0x48564d[_0x74b1('0x7')]||'';this['refreshToken']=_0x48564d[_0x74b1('0x8')]||'';this[_0x74b1('0x9')]=_0x48564d[_0x74b1('0x9')]||{};}module[_0x74b1('0xa')]=ZohoAccount; \ No newline at end of file +var _0x33d2=['zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host'];(function(_0x57ba7f,_0x1602c6){var _0x534673=function(_0x272b35){while(--_0x272b35){_0x57ba7f['push'](_0x57ba7f['shift']());}};_0x534673(++_0x1602c6);}(_0x33d2,0x7f));var _0x233d=function(_0x385603,_0x1cf762){_0x385603=_0x385603-0x0;var _0x2e10ca=_0x33d2[_0x385603];return _0x2e10ca;};'use strict';function ZohoAccount(_0x328953){this['id']=_0x328953['id']||0x0;this[_0x233d('0x0')]=_0x328953[_0x233d('0x0')]||'';this['description']=_0x328953[_0x233d('0x1')]||'';this[_0x233d('0x2')]=_0x328953['host']||'';this[_0x233d('0x3')]=_0x328953[_0x233d('0x3')]||'';this[_0x233d('0x4')]=_0x328953[_0x233d('0x4')]||'';this[_0x233d('0x5')]=_0x328953[_0x233d('0x5')]||'';this[_0x233d('0x6')]=_0x328953[_0x233d('0x6')]||'';this['code']=_0x328953[_0x233d('0x7')]||'';this['refreshToken']=_0x328953[_0x233d('0x8')]||'';this[_0x233d('0x9')]=_0x328953[_0x233d('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index edb03de..f5a084f 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 _0xaef7=['recallme','ContactId','ListId','UserId','VoiceQueueId','getCaller','number','exports','util','lodash','moment','string','isNil','uniqueid','idContact','queue','type','campaigntype','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat'];(function(_0x3c3b8b,_0x84aac8){var _0x1d3296=function(_0x3e826e){while(--_0x3e826e){_0x3c3b8b['push'](_0x3c3b8b['shift']());}};_0x1d3296(++_0x84aac8);}(_0xaef7,0x130));var _0x7aef=function(_0x5d1c9d,_0x8bb82d){_0x5d1c9d=_0x5d1c9d-0x0;var _0x8edfe4=_0xaef7[_0x5d1c9d];return _0x8edfe4;};'use strict';var util=require(_0x7aef('0x0'));var _=require(_0x7aef('0x1'));var moment=require(_0x7aef('0x2'));function checkNameSurname(_0x5d233e,_0x2116ef,_0x4a61b5){var _0xb386ea='';if(!_['isNil'](_0x2116ef)&&_0x7aef('0x3')===typeof _0x2116ef){_0xb386ea+=_0x2116ef;}if(!_[_0x7aef('0x4')](_0x4a61b5)&&'string'===typeof _0x4a61b5){_0xb386ea+='\x20'+_0x4a61b5;}if(_0xb386ea!==''){return _0xb386ea;}return _0x5d233e;}function Action(_0x11d6a0,_0x447314,_0x5b0a52,_0x5e6f4f,_0x3a2942){this[_0x7aef('0x5')]=_0x5b0a52||undefined;this[_0x7aef('0x6')]=_0x11d6a0['id'];this[_0x7aef('0x7')]=_0x447314['name'];this[_0x7aef('0x8')]=_0x447314[_0x7aef('0x8')];this[_0x7aef('0x9')]=_0x7aef('0x7');this['dialAnswer']=![];this[_0x7aef('0xa')]=_[_0x7aef('0x4')](_0x11d6a0['Agent'])?undefined:_0x11d6a0[_0x7aef('0xb')]['name'];this[_0x7aef('0xc')]=this['membername']?util[_0x7aef('0xd')](_0x7aef('0xe'),this[_0x7aef('0xa')]):_0x5e6f4f||undefined;this[_0x7aef('0xf')]=checkNameSurname(_0x11d6a0[_0x7aef('0x10')][_0x7aef('0x11')],_0x11d6a0['Contact']['firstName'],_0x11d6a0[_0x7aef('0x10')][_0x7aef('0x12')]);this[_0x7aef('0x13')]=_0x11d6a0[_0x7aef('0x13')]||![];this[_0x7aef('0x14')]=_0x11d6a0[_0x7aef('0x10')][_0x7aef('0x11')];this[_0x7aef('0x15')]=_0x11d6a0[_0x7aef('0x15')];this[_0x7aef('0x16')]=_0x11d6a0[_0x7aef('0x16')]||0x0;this[_0x7aef('0x17')]=_0x11d6a0[_0x7aef('0x17')]||0x0;this[_0x7aef('0x18')]=_0x11d6a0['countnoanswerretry']||0x0;this[_0x7aef('0x19')]=(_0x11d6a0[_0x7aef('0x16')]||0x0)+(_0x11d6a0[_0x7aef('0x17')]||0x0)+(_0x11d6a0[_0x7aef('0x18')]||0x0);this[_0x7aef('0x1a')]=_0x11d6a0[_0x7aef('0x1a')];this[_0x7aef('0x1b')]=_0x11d6a0['callbackuniqueid'];this[_0x7aef('0x1c')]=_0x11d6a0['callbackat'];this[_0x7aef('0x1d')]=_0x11d6a0[_0x7aef('0x1d')];this[_0x7aef('0x1e')]=_0x11d6a0[_0x7aef('0x1e')];this[_0x7aef('0x1f')]=_0x11d6a0[_0x7aef('0x1f')];this[_0x7aef('0x20')]=_[_0x7aef('0x4')](_0x11d6a0[_0x7aef('0xb')])?_0x11d6a0[_0x7aef('0x20')]:_0x11d6a0[_0x7aef('0xb')]['id'];this[_0x7aef('0x21')]=_0x11d6a0[_0x7aef('0x21')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action['prototype'][_0x7aef('0x22')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x7aef('0xf')],this[_0x7aef('0x23')]);};module[_0x7aef('0x24')]=Action; \ No newline at end of file +var _0x5b6b=['format','calleridname','phone','Contact','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','isNil','string','uniqueid','idContact','name','type','queue','dialAnswer','Agent','membername'];(function(_0x20f1e8,_0x1c64be){var _0xba7ba8=function(_0x362d11){while(--_0x362d11){_0x20f1e8['push'](_0x20f1e8['shift']());}};_0xba7ba8(++_0x1c64be);}(_0x5b6b,0x180));var _0xb5b6=function(_0x4aae85,_0x1a0e3e){_0x4aae85=_0x4aae85-0x0;var _0x2f8d92=_0x5b6b[_0x4aae85];return _0x2f8d92;};'use strict';var util=require(_0xb5b6('0x0'));var _=require(_0xb5b6('0x1'));var moment=require('moment');function checkNameSurname(_0x509825,_0x21876a,_0xf7ce1e){var _0x56dc32='';if(!_[_0xb5b6('0x2')](_0x21876a)&&_0xb5b6('0x3')===typeof _0x21876a){_0x56dc32+=_0x21876a;}if(!_[_0xb5b6('0x2')](_0xf7ce1e)&&_0xb5b6('0x3')===typeof _0xf7ce1e){_0x56dc32+='\x20'+_0xf7ce1e;}if(_0x56dc32!==''){return _0x56dc32;}return _0x509825;}function Action(_0x25e1be,_0x2e586f,_0x4f838a,_0x2550bc,_0x3714a0){this[_0xb5b6('0x4')]=_0x4f838a||undefined;this[_0xb5b6('0x5')]=_0x25e1be['id'];this['queue']=_0x2e586f[_0xb5b6('0x6')];this[_0xb5b6('0x7')]=_0x2e586f[_0xb5b6('0x7')];this['campaigntype']=_0xb5b6('0x8');this[_0xb5b6('0x9')]=![];this['membername']=_[_0xb5b6('0x2')](_0x25e1be['Agent'])?undefined:_0x25e1be[_0xb5b6('0xa')][_0xb5b6('0x6')];this['channelAgent']=this[_0xb5b6('0xb')]?util[_0xb5b6('0xc')]('SIP/%s',this[_0xb5b6('0xb')]):_0x2550bc||undefined;this[_0xb5b6('0xd')]=checkNameSurname(_0x25e1be['Contact'][_0xb5b6('0xe')],_0x25e1be[_0xb5b6('0xf')]['firstName'],_0x25e1be[_0xb5b6('0xf')][_0xb5b6('0x10')]);this[_0xb5b6('0x11')]=_0x25e1be[_0xb5b6('0x11')]||![];this['calleridnum']=_0x25e1be['Contact'][_0xb5b6('0xe')];this[_0xb5b6('0x12')]=_0x25e1be[_0xb5b6('0x12')];this[_0xb5b6('0x13')]=_0x25e1be[_0xb5b6('0x13')]||0x0;this['countcongestionretry']=_0x25e1be[_0xb5b6('0x14')]||0x0;this[_0xb5b6('0x15')]=_0x25e1be[_0xb5b6('0x15')]||0x0;this[_0xb5b6('0x16')]=(_0x25e1be[_0xb5b6('0x13')]||0x0)+(_0x25e1be[_0xb5b6('0x14')]||0x0)+(_0x25e1be[_0xb5b6('0x15')]||0x0);this[_0xb5b6('0x17')]=_0x25e1be['callback'];this[_0xb5b6('0x18')]=_0x25e1be[_0xb5b6('0x18')];this['callbackat']=_0x25e1be[_0xb5b6('0x19')];this[_0xb5b6('0x1a')]=_0x25e1be[_0xb5b6('0x1a')];this[_0xb5b6('0x1b')]=_0x25e1be[_0xb5b6('0x1b')];this[_0xb5b6('0x1c')]=_0x25e1be[_0xb5b6('0x1c')];this['UserId']=_['isNil'](_0x25e1be[_0xb5b6('0xa')])?_0x25e1be['UserId']:_0x25e1be[_0xb5b6('0xa')]['id'];this[_0xb5b6('0x1d')]=_0x25e1be[_0xb5b6('0x1d')];this[_0xb5b6('0x1e')]='';this[_0xb5b6('0x1f')]='';}Action[_0xb5b6('0x20')][_0xb5b6('0x21')]=function(){return util[_0xb5b6('0xc')](_0xb5b6('0x22'),this[_0xb5b6('0xd')],this['number']);};module[_0xb5b6('0x23')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 8b68b90..8df5283 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 _0x09ef=['unmonitored','execRun','pick','getContactPreview','recallme','isValid','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','Is\x20Valid','trim','substring','dialCutDigit','SIP/%s/%s%s','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','extractCalleridNumber','merge','Action','[originated][increment]','OriginateError','syncOriginateResponse','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','syncDialEnd','addVariable','variables','filterKey','keys','value','error','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','moment','md5','../../../config/environment','preview','../../../config/logger','actionPreview','./rpcDb','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','bind','hangup','syncHangup','syncHangupRequest','dialend','newexten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','campaignsPreview','type','outbound','name','strategy','answered','available','sumBillable','sumDuration','sumHoldTime','total','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice_queue:save','info','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','loopCampaigns','hasOwnProperty','booked','clearZombieChannels','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','contactId','ListId','status','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[action]','size','getContactRecallMe','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','dialActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','ANSWER','responsetime','uniqueid','\x20Queue','custom:agentconnect','connect','acw','emit','custom:agentConnectPreview','buildObj','complete','outboundAnswerCallsDay','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','countbusyretry','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','Global','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','activeContact','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','unlockContact','idContact','[default]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable'];(function(_0x3b7cab,_0x573e6b){var _0x32f646=function(_0xb33f81){while(--_0xb33f81){_0x3b7cab['push'](_0x3b7cab['shift']());}};_0x32f646(++_0x573e6b);}(_0x09ef,0x16e));var _0xf09e=function(_0x562258,_0x282a2b){_0x562258=_0x562258-0x0;var _0x49175d=_0x09ef[_0x562258];return _0x49175d;};'use strict';var util=require(_0xf09e('0x0'));var _=require(_0xf09e('0x1'));var BPromise=require(_0xf09e('0x2'));var uuid=require(_0xf09e('0x3'));var moment=require(_0xf09e('0x4'));var md5=require(_0xf09e('0x5'));var Redis=require('ioredis');var config=require(_0xf09e('0x6'));var logger=require('../../../config/logger')(_0xf09e('0x7'));var loggerAction=require(_0xf09e('0x8'))(_0xf09e('0x9'));var ami=require('../ami');var rpcDb=require(_0xf09e('0xa'));var Action=require('./action');var ut=require(_0xf09e('0xb'));config[_0xf09e('0xc')]=_[_0xf09e('0xd')](config['redis'],{'host':_0xf09e('0xe'),'port':0x18eb});var io=require(_0xf09e('0xf'))(new Redis(config[_0xf09e('0xc')]));var Sequence=function(){};Sequence[_0xf09e('0x10')][_0xf09e('0x11')]=function(_0x47db42){this['tail']=this[_0xf09e('0x12')]?this[_0xf09e('0x12')][_0xf09e('0x13')](_0x47db42):_0x47db42();};function Preview(_0x394910){this[_0xf09e('0x14')]=new Sequence();this['campaignsPreview']=_0x394910[_0xf09e('0x15')];this['trunks']=_0x394910[_0xf09e('0x16')];this[_0xf09e('0x17')]={};this[_0xf09e('0x18')]=_0x394910['agents'];this[_0xf09e('0x19')]=0x0;ami['on']('originateresponse',this['syncOriginateResponse'][_0xf09e('0x1a')](this));ami['on'](_0xf09e('0x1b'),this[_0xf09e('0x1c')][_0xf09e('0x1a')](this));ami['on']('hanguprequest',this[_0xf09e('0x1d')][_0xf09e('0x1a')](this));ami['on'](_0xf09e('0x1e'),this['syncDialEnd'][_0xf09e('0x1a')](this));ami['on'](_0xf09e('0x1f'),this['syncNewExten'][_0xf09e('0x1a')](this));ami['on'](_0xf09e('0x20'),this['syncVarSet'][_0xf09e('0x1a')](this));ami['on'](_0xf09e('0x21'),this[_0xf09e('0x22')]['bind'](this));ami['on'](_0xf09e('0x23'),this[_0xf09e('0x24')][_0xf09e('0x1a')](this));this['loopCampaigns'](this[_0xf09e('0x25')]);}function emit(_0x5d7a0c,_0x1999f4,_0x47ac8a){io['to'](_0x5d7a0c)['emit'](_0x1999f4,_0x47ac8a);}function emitCampaignPreview(_0x1faef4){if(_0x1faef4[_0xf09e('0x26')]===_0xf09e('0x27')){var _0x5af4d2={'id':_0x1faef4['id'],'name':_0x1faef4[_0xf09e('0x28')],'strategy':_0x1faef4[_0xf09e('0x29')],'answered':_0x1faef4[_0xf09e('0x2a')],'available':_0x1faef4[_0xf09e('0x2b')],'loggedIn':_0x1faef4['loggedIn'],'pTalking':_0x1faef4['pTalking'],'sumBillable':_0x1faef4[_0xf09e('0x2c')],'sumDuration':_0x1faef4[_0xf09e('0x2d')],'sumHoldTime':_0x1faef4[_0xf09e('0x2e')]||0x0,'talking':_0x1faef4['talking'],'total':_0x1faef4[_0xf09e('0x2f')],'type':_0x1faef4['type'],'unmanaged':_0x1faef4['unmanaged'],'abandoned':_0x1faef4[_0xf09e('0x30')],'waiting':_0x1faef4[_0xf09e('0x31')],'loggedInDb':_0x1faef4[_0xf09e('0x32')],'dialActive':_0x1faef4['dialActive'],'dialMethod':_0x1faef4[_0xf09e('0x33')],'dialOriginateCallerIdName':_0x1faef4[_0xf09e('0x34')],'dialOriginateCallerIdNumber':_0x1faef4[_0xf09e('0x35')],'dialOriginateTimeout':_0x1faef4['dialOriginateTimeout'],'dialPrefix':_0x1faef4[_0xf09e('0x36')],'outboundAnswerAgiCallsDay':_0x1faef4['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1faef4['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1faef4[_0xf09e('0x37')],'outboundBusyCallsDay':_0x1faef4[_0xf09e('0x38')],'outboundCongestionCallsDay':_0x1faef4[_0xf09e('0x39')],'outboundDropCallsDayACS':_0x1faef4[_0xf09e('0x3a')],'outboundDropCallsDayCallersExit':_0x1faef4['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1faef4[_0xf09e('0x3b')],'outboundNoAnswerCallsDay':_0x1faef4[_0xf09e('0x3c')],'outboundNoSuchCallsDay':_0x1faef4[_0xf09e('0x3d')],'outboundOriginateFailureCallsDay':_0x1faef4[_0xf09e('0x3e')],'outboundReCallsDay':_0x1faef4['outboundReCallsDay'],'outboundRejectCallsDay':_0x1faef4[_0xf09e('0x3f')],'outboundUnknownCallsDay':_0x1faef4[_0xf09e('0x40')],'predictiveIntervalAnsweredCalls':_0x1faef4[_0xf09e('0x41')],'predictiveIntervalAvgHoldtime':_0x1faef4['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x1faef4[_0xf09e('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x1faef4[_0xf09e('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x1faef4[_0xf09e('0x44')],'predictiveIntervalErlangCalls':_0x1faef4['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1faef4[_0xf09e('0x45')],'predictiveIntervalHitRate':_0x1faef4[_0xf09e('0x46')],'predictiveIntervalMultiplicativeFactor':_0x1faef4[_0xf09e('0x47')],'predictiveIntervalPauses':_0x1faef4[_0xf09e('0x48')],'predictiveIntervalAvailable':_0x1faef4[_0xf09e('0x49')],'predictiveIntervalTotalCalls':_0x1faef4[_0xf09e('0x4a')],'message':_0x1faef4[_0xf09e('0x4b')],'originated':_0x1faef4[_0xf09e('0x4c')],'erlangCalls':_0x1faef4['erlangCalls'],'erlangCallToSecond':_0x1faef4[_0xf09e('0x4d')],'erlangAbandonmentRate':_0x1faef4[_0xf09e('0x4e')],'erlangBusyFactor':_0x1faef4[_0xf09e('0x4f')],'startPredictive':_0x1faef4[_0xf09e('0x50')],'startProgressive':_0x1faef4[_0xf09e('0x51')]};if(_0x1faef4[_0xf09e('0x52')]){_0x5af4d2[_0xf09e('0x52')]={'id':_0x1faef4[_0xf09e('0x52')]['id'],'name':_0x1faef4['Trunk'][_0xf09e('0x28')],'active':_0x1faef4[_0xf09e('0x52')][_0xf09e('0x53')],'callerid':_0x1faef4['Trunk'][_0xf09e('0x54')]};}if(_0x1faef4['Interval']){_0x5af4d2[_0xf09e('0x55')]={'id':_0x1faef4[_0xf09e('0x55')]['id'],'name':_0x1faef4[_0xf09e('0x55')][_0xf09e('0x28')]};}var _0x5dfb97=md5(JSON[_0xf09e('0x56')](_0x5af4d2));if(_0x1faef4[_0xf09e('0x5')]!==_0x5dfb97){_0x1faef4['md5']=_0x5dfb97;emit(util[_0xf09e('0x57')]('voice:queue:%s',_0x5af4d2[_0xf09e('0x28')]),_0xf09e('0x58'),_0x5af4d2);}}}function emitVoiceQueueChannelRemove(_0x62668d){logger[_0xf09e('0x59')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xf09e('0x56')](_0x62668d));emit(util[_0xf09e('0x57')](_0xf09e('0x5a'),_0x62668d['name']),_0xf09e('0x5b'),_0x62668d);}function notSendMessagesQueue(_0x1e6b9d){if(_0x1e6b9d[_0xf09e('0x5c')]){if(_0x1e6b9d[_0xf09e('0x4c')]===0x0&&_0x1e6b9d[_0xf09e('0x5d')]===0x0){_0x1e6b9d['sendMessageOneNotActive']=![];_0x1e6b9d[_0xf09e('0x2b')]=0x0;_0x1e6b9d[_0xf09e('0x5e')]=0x0;_0x1e6b9d[_0xf09e('0x4b')]=_0xf09e('0x5f');ut[_0xf09e('0x60')](_0xf09e('0x61'),_0x1e6b9d[_0xf09e('0x28')]+_0xf09e('0x62'));}else{_0x1e6b9d['message']=_0xf09e('0x63');ut[_0xf09e('0x60')](_0xf09e('0x61'),_0x1e6b9d[_0xf09e('0x28')]+_0xf09e('0x64'));}emitCampaignPreview(_0x1e6b9d);}}Preview['prototype'][_0xf09e('0x65')]=function(){var _0x24ef06=this;setInterval(function(){_0x24ef06['syncCampaigns']();},0x7cf);};Preview[_0xf09e('0x10')]['syncCampaigns']=function(){var _0x5c5e84=this['campaignsPreview'];this[_0xf09e('0x19')]+=0x1;for(var _0x2e5c97 in _0x5c5e84){if(_0x5c5e84[_0xf09e('0x66')](_0x2e5c97)&&(_0x5c5e84[_0x2e5c97][_0xf09e('0x33')]===_0xf09e('0x7')||_0x5c5e84[_0x2e5c97][_0xf09e('0x33')]===_0xf09e('0x67'))&&_0x5c5e84[_0x2e5c97][_0xf09e('0x26')]===_0xf09e('0x27')){if(this[_0xf09e('0x19')]>0x7){this[_0xf09e('0x19')]=0x0;this[_0xf09e('0x68')]();}}if(_0x5c5e84['hasOwnProperty'](_0x2e5c97)&&_0x5c5e84[_0x2e5c97][_0xf09e('0x33')]===_0xf09e('0x7')&&_0x5c5e84[_0x2e5c97][_0xf09e('0x26')]===_0xf09e('0x27')){if(_0x5c5e84[_0x2e5c97]['dialActive']){this['setMessage'](_0x5c5e84[_0x2e5c97]);this[_0xf09e('0x69')](_0x5c5e84[_0x2e5c97]);}else{notSendMessagesQueue(_0x5c5e84[_0x2e5c97]);}}}};Preview[_0xf09e('0x10')][_0xf09e('0x6a')]=function(_0x5dfaaa){var _0x415aba=this;this[_0xf09e('0x14')]['enqueue'](function(){if(!_[_0xf09e('0x6b')](_0x415aba['actions'][_0x5dfaaa])){loggerAction['info'](_0xf09e('0x6c'),_0x5dfaaa,_0xf09e('0x6d'),_0x415aba[_0xf09e('0x17')][_0x5dfaaa][_0xf09e('0x6e')],_0xf09e('0x6f'),JSON['stringify'](_0x415aba['campaignsPreview'][_0x415aba['actions'][_0x5dfaaa]['queue']][_0xf09e('0x4c')]),_0xf09e('0x70'),JSON[_0xf09e('0x56')](_0x415aba[_0xf09e('0x25')][_0x415aba[_0xf09e('0x17')][_0x5dfaaa][_0xf09e('0x6e')]][_0xf09e('0x5d')]),JSON[_0xf09e('0x56')](_0x415aba[_0xf09e('0x17')][_0x5dfaaa]['dialAnswer']),JSON[_0xf09e('0x56')](_['pick'](_0x415aba[_0xf09e('0x17')][_0x5dfaaa],[_0xf09e('0x71'),'UserId','VoiceQueueId',_0xf09e('0x72')])));return ami['Action']({'action':_0xf09e('0x73'),'channel':_0x415aba[_0xf09e('0x17')][_0x5dfaaa]['channel']})[_0xf09e('0x74')](function(_0xcc704e){if(_0xcc704e[_0xf09e('0x4b')]===_0xf09e('0x75')){setTimeout(function(){if(_0x415aba[_0xf09e('0x17')][_0x5dfaaa]){ut[_0xf09e('0x76')](_0x415aba[_0xf09e('0x25')][_0x415aba[_0xf09e('0x17')][_0x5dfaaa][_0xf09e('0x6e')]],_0xf09e('0x77'));if(_0x415aba[_0xf09e('0x17')][_0x5dfaaa][_0xf09e('0x78')]===!![]){ut[_0xf09e('0x79')](_0x415aba[_0xf09e('0x25')][_0x415aba[_0xf09e('0x17')][_0x5dfaaa]['queue']],'[clearZombieChannel]');ut[_0xf09e('0x7a')]('[Dialer][checkChannel][pTalking][Preview]'+_0x5dfaaa,_0x415aba[_0xf09e('0x17')][_0x5dfaaa]['queue']);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x5dfaaa,_0x415aba[_0xf09e('0x17')][_0x5dfaaa][_0xf09e('0x6e')]);delete _0x415aba[_0xf09e('0x17')][_0x5dfaaa];}},0x2328);}});}});};Preview[_0xf09e('0x10')]['clearZombieChannels']=function(){var _0xa76272=this;loggerAction[_0xf09e('0x59')](_0xf09e('0x7b'),_[_0xf09e('0x7c')](this[_0xf09e('0x17')]));for(var _0xcb3c49 in this[_0xf09e('0x17')]){if(_0xa76272[_0xf09e('0x17')][_0xf09e('0x66')](_0xcb3c49)){_0xa76272[_0xf09e('0x6a')](_0xcb3c49);}}};Preview['prototype'][_0xf09e('0x69')]=function(_0x283639){var _0x3f73ce=this;rpcDb[_0xf09e('0x7d')](_0x283639['id'],ut['agentReadyId'](this[_0xf09e('0x18')]))[_0xf09e('0x7e')](function(_0x55f7a8){if(!_['isNil'](_0x55f7a8)){for(var _0x27adcd=0x0;_0x27adcd<_0x55f7a8[_0xf09e('0x7f')];_0x27adcd+=0x1){if(ut[_0xf09e('0x80')](_0x55f7a8[_0x27adcd][_0xf09e('0x81')])<_0x283639[_0xf09e('0x82')]*0x3c){if(_0x55f7a8[_0x27adcd][_0xf09e('0x83')]&&!_0x55f7a8[_0x27adcd][_0xf09e('0x83')][_0xf09e('0x84')]){_0x3f73ce[_0xf09e('0x85')](_0x55f7a8[_0x27adcd]['id'])['then'](ut[_0xf09e('0x86')](_0xf09e('0x87')))[_0xf09e('0x74')](ut['logger2'](_0xf09e('0x87')));}else{rpcDb[_0xf09e('0x88')](_0x55f7a8[_0x27adcd]['id']);}}else{var _0x175a85=new Action(_0x55f7a8[_0x27adcd],_0x283639);_0x175a85['starttime']=moment()['format'](_0xf09e('0x89'));_0x283639[_0xf09e('0x8a')]+=0x1;ut[_0xf09e('0x8b')](_0x175a85,0x17,_0xf09e('0x8c'));if(_0x283639[_0xf09e('0x8d')]){rpcDb[_0xf09e('0x8e')](ut['createBody'](_0x55f7a8[_0x27adcd]));rpcDb['createCustomerHistory'](_0x175a85,_0xf09e('0x8f'));}else{ut[_0xf09e('0x8b')](_0x175a85,0x16,_0xf09e('0x90'));rpcDb[_0xf09e('0x91')](_0x175a85,'[HistoryRecallClose]');rpcDb[_0xf09e('0x92')](_0x175a85,'[HistoryRecallClose]');}}}}})['catch'](ut[_0xf09e('0x86')](_0xf09e('0x93')));};Preview[_0xf09e('0x10')][_0xf09e('0x94')]=function(_0x2d274a){_0x2d274a[_0xf09e('0x5c')]=!![];if(ut[_0xf09e('0x95')](_0x2d274a[_0xf09e('0x96')])){_0x2d274a[_0xf09e('0x4b')]=_0xf09e('0x97');}else if(!ut[_0xf09e('0x98')](_0x2d274a[_0xf09e('0x99')])){_0x2d274a[_0xf09e('0x4b')]='NOT_ACTIVE';}else if(!this[_0xf09e('0x9a')](_0x2d274a[_0xf09e('0x52')])){if(!this[_0xf09e('0x9a')](_0x2d274a[_0xf09e('0x9b')])){_0x2d274a[_0xf09e('0x4b')]=_0xf09e('0x9c');}else{_0x2d274a[_0xf09e('0x4b')]=_0xf09e('0x9d');}}else{_0x2d274a[_0xf09e('0x4b')]=_0xf09e('0x9d');}emitCampaignPreview(_0x2d274a);};Preview[_0xf09e('0x10')][_0xf09e('0x9e')]=function(_0xfd907b,_0x54898c,_0x57d782){var _0x484ae9=this;var _0x4da4e3=this['actions'][_0x54898c];var _0x156d1c=this['campaignsPreview'][_0x4da4e3[_0xf09e('0x6e')]];var _0x2546e3;if(_0x156d1c){switch(_0x57d782){case'1':_0x156d1c[_0xf09e('0x3d')]+=0x1;_0x4da4e3[_0xf09e('0x9f')]=ut[_0xf09e('0xa0')](_0x4da4e3);ut[_0xf09e('0x8b')](_0x4da4e3,0x0,_0xf09e('0xa1'));rpcDb[_0xf09e('0x91')](_0x4da4e3,_0xf09e('0xa2'));if(ut[_0xf09e('0xa0')](_0x4da4e3)>=_0x156d1c[_0xf09e('0xa3')]){_0x2546e3=ut[_0xf09e('0xa4')](_0x4da4e3,0xf,'Global');rpcDb[_0xf09e('0x92')](_0x2546e3,_0xf09e('0xa5'));}else{rpcDb[_0xf09e('0x92')](_0x4da4e3,_0xf09e('0xa5'));}delete this[_0xf09e('0x17')][_0xfd907b['linkedid']];break;case _0xf09e('0xa6'):var _0x30064b=moment()['format'](_0xf09e('0x89'));_0x4da4e3[_0xf09e('0xa7')]=_0x30064b;_0x4da4e3['answertime']=_0x30064b;_0x4da4e3[_0xf09e('0x78')]=!![];_0x156d1c[_0xf09e('0x5d')]+=0x1;logger[_0xf09e('0x59')]('[syncHangup][talking][increment]',_0x4da4e3[_0xf09e('0xa8')],_0xf09e('0xa9'),_0x156d1c['name'],_0xf09e('0x70'),_0x156d1c[_0xf09e('0x5d')]);ami['emit'](_0xf09e('0xaa'),ut['buildObj'](_0x4da4e3,_0xf09e('0xab')));if(_0x156d1c[_0xf09e('0xac')]){ami[_0xf09e('0xad')](_0xf09e('0xae'),ut['buildAcw'](_0x4da4e3));}break;case'16':ami[_0xf09e('0xad')]('custom:agentcomplete',ut[_0xf09e('0xaf')](_0x4da4e3,_0xf09e('0xb0')));emitVoiceQueueChannelRemove(ut[_0xf09e('0xaf')](_0x4da4e3,_0xf09e('0xb0')));_0x156d1c[_0xf09e('0xb1')]+=0x1;_0x156d1c[_0xf09e('0x2f')]+=0x1;_0x156d1c[_0xf09e('0x2a')]+=0x1;ut[_0xf09e('0x79')](_0x156d1c,_0xf09e('0xb2'));_0x4da4e3['countglobal']=ut['totalGlobal'](_0x4da4e3);ut[_0xf09e('0x8b')](_0x4da4e3,0x4,_0xf09e('0xb3'));rpcDb[_0xf09e('0x91')](_0x4da4e3,_0xf09e('0xb4'));rpcDb['createCustomerFinal'](_0x4da4e3,_0xf09e('0xb5'));rpcDb[_0xf09e('0xb6')](_0x4da4e3);_0x156d1c[_0xf09e('0x2d')]+=_0x4da4e3[_0xf09e('0xb7')];_0x156d1c[_0xf09e('0x2c')]+=_0x4da4e3['talktime'];logger[_0xf09e('0x59')](_0xf09e('0xb8'),_0x4da4e3[_0xf09e('0xa8')],_0xf09e('0xa9'),_0x156d1c[_0xf09e('0x28')],_0xf09e('0x70'),_0x156d1c[_0xf09e('0x5d')]);delete this[_0xf09e('0x17')][_0xfd907b[_0xf09e('0xb9')]];break;case'BUSY':_0x156d1c[_0xf09e('0x38')]+=0x1;_0x4da4e3[_0xf09e('0xba')]+=0x1;_0x4da4e3['countglobal']=ut[_0xf09e('0xa0')](_0x4da4e3);ut[_0xf09e('0x8b')](_0x4da4e3,0x5,'Busy');rpcDb['createCustomerHistory'](_0x4da4e3,_0xf09e('0xbb'));if(ut[_0xf09e('0xa0')](_0x4da4e3)>=_0x156d1c[_0xf09e('0xa3')]){_0x2546e3=ut['cloneAction'](_0x4da4e3,0xf,'Global');rpcDb[_0xf09e('0x92')](_0x2546e3,_0xf09e('0xbc'));}else{if(_0x4da4e3[_0xf09e('0xba')]>=_0x156d1c[_0xf09e('0xbd')]){rpcDb[_0xf09e('0x92')](_0x4da4e3,_0xf09e('0xbb'));}else{rpcDb[_0xf09e('0xbe')](ut[_0xf09e('0xbf')](_0x4da4e3,_0xf09e('0xba'),_0x156d1c[_0xf09e('0xc0')]),_0x4da4e3[_0xf09e('0xc1')],_0x4da4e3['activeContact']);}}break;case _0xf09e('0xc2'):_0x156d1c[_0xf09e('0x3c')]+=0x1;_0x4da4e3[_0xf09e('0xc3')]+=0x1;_0x4da4e3['countglobal']=ut[_0xf09e('0xa0')](_0x4da4e3);ut['logCustomer'](_0x4da4e3,0x3,_0xf09e('0xc4'));rpcDb[_0xf09e('0x91')](_0x4da4e3,_0xf09e('0xc5'));if(ut[_0xf09e('0xa0')](_0x4da4e3)>=_0x156d1c[_0xf09e('0xa3')]){_0x2546e3=ut[_0xf09e('0xa4')](_0x4da4e3,0xf,_0xf09e('0xc6'));rpcDb[_0xf09e('0x92')](_0x2546e3,_0xf09e('0xc7'));}else{if(_0x4da4e3[_0xf09e('0xc3')]>=_0x156d1c[_0xf09e('0xc8')]){rpcDb['createCustomerFinal'](_0x4da4e3,_0xf09e('0xc5'));}else{rpcDb[_0xf09e('0xbe')](ut['scheduledAt'](_0x4da4e3,'countnoanswerretry',_0x156d1c[_0xf09e('0xc9')]),_0x4da4e3[_0xf09e('0xc1')],_0x4da4e3[_0xf09e('0xca')]);}}break;case'CONGESTION':_0x156d1c[_0xf09e('0x39')]+=0x1;_0x4da4e3[_0xf09e('0xcb')]+=0x1;_0x4da4e3[_0xf09e('0x9f')]=ut[_0xf09e('0xa0')](_0x4da4e3);ut[_0xf09e('0x8b')](_0x4da4e3,0x8,_0xf09e('0xcc'));rpcDb[_0xf09e('0x91')](_0x4da4e3,_0xf09e('0xcd'));if(ut[_0xf09e('0xa0')](_0x4da4e3)>=_0x156d1c[_0xf09e('0xa3')]){_0x2546e3=ut[_0xf09e('0xa4')](_0x4da4e3,0xf,_0xf09e('0xc6'));rpcDb[_0xf09e('0x92')](_0x2546e3,_0xf09e('0xce'));}else{if(_0x4da4e3[_0xf09e('0xcb')]>=_0x156d1c[_0xf09e('0xcf')]){rpcDb[_0xf09e('0x92')](_0x4da4e3,_0xf09e('0xcd'));}else{rpcDb[_0xf09e('0xbe')](ut[_0xf09e('0xbf')](_0x4da4e3,_0xf09e('0xcb'),_0x156d1c[_0xf09e('0xc0')]),_0x4da4e3['unlockAgent'],_0x4da4e3[_0xf09e('0xca')]);}}break;case'CANCEL':_0x156d1c['outboundRejectCallsDay']+=0x1;_0x4da4e3[_0xf09e('0x9f')]=ut[_0xf09e('0xa0')](_0x4da4e3);ut['logCustomer'](_0x4da4e3,0x14,'AgentReject');rpcDb[_0xf09e('0x91')](_0x4da4e3,'[syncHangupRequest][logAgentReject]');if(_0x4da4e3[_0xf09e('0xc1')]){rpcDb[_0xf09e('0xd0')](_0x4da4e3['idContact']);}if(_0x4da4e3[_0xf09e('0xca')]){rpcDb[_0xf09e('0x88')](_0x4da4e3[_0xf09e('0xd1')]);}break;default:if(_0x4da4e3[_0xf09e('0x78')]){ut[_0xf09e('0x79')](_0x156d1c,_0xf09e('0xd2'));ut[_0xf09e('0x7a')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x156d1c['name'],_0xfd907b);}_0x156d1c['outboundUnknownCallsDay']+=0x1;_0x4da4e3[_0xf09e('0x9f')]=ut[_0xf09e('0xa0')](_0x4da4e3);ut[_0xf09e('0x8b')](_0x4da4e3,0xc,_0xfd907b[_0xf09e('0xd3')]||_0xfd907b[_0xf09e('0xd4')]);rpcDb[_0xf09e('0x91')](_0x4da4e3,_0xf09e('0xd5'));if(ut[_0xf09e('0xa0')](_0x4da4e3)>=_0x156d1c[_0xf09e('0xa3')]){_0x2546e3=ut[_0xf09e('0xa4')](_0x4da4e3,0xf,_0xf09e('0xc6'));rpcDb[_0xf09e('0x92')](_0x2546e3,_0xf09e('0xd6'));}else{rpcDb['createCustomerFinal'](_0x4da4e3,_0xf09e('0xd6'));}delete this[_0xf09e('0x17')][_0xfd907b[_0xf09e('0xb9')]];}if(!(_0x4da4e3[_0xf09e('0x78')]&&_0x57d782==='16')){ut[_0xf09e('0x76')](_0x156d1c,_0xf09e('0xd7'));logger[_0xf09e('0x59')]('[originated][decrement][callProgressDetectingCustomer]',_0x4da4e3[_0xf09e('0xa8')],'\x20Queue',_0x156d1c[_0xf09e('0x28')],'originated:\x20',_0x156d1c[_0xf09e('0x4c')]);}if(_0x57d782!==_0xf09e('0xa6')){delete this[_0xf09e('0x17')][_0xfd907b[_0xf09e('0xb9')]];delete this['actions'][_0xfd907b[_0xf09e('0xd8')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x4d0e4e,_0x133ed6,_0x4dd4d8){if(_['isUndefined'](_0x133ed6)&&_0xf09e('0xd9')!==typeof _0x133ed6){return;}if(_[_0xf09e('0xda')](_0x4dd4d8)&&_0xf09e('0xd9')!==typeof _0x4dd4d8){return;}switch(_0x4dd4d8[_0xf09e('0xdb')]){case'0':ut[_0xf09e('0xdc')](_0x4d0e4e,0x0,_0xf09e('0xa1'));rpcDb[_0xf09e('0xdd')](_0x4d0e4e,_0xf09e('0xde'));break;case'3':ut['logAgent'](_0x4d0e4e,0x3,_0xf09e('0xc4'));rpcDb[_0xf09e('0xdd')](_0x4d0e4e,_0xf09e('0xdf'));break;case'5':ut['logAgent'](_0x4d0e4e,0x5,'Busy');rpcDb[_0xf09e('0xdd')](_0x4d0e4e,_0xf09e('0xe0'));break;case'8':ut[_0xf09e('0xdc')](_0x4d0e4e,0x8,_0xf09e('0xcc'));rpcDb[_0xf09e('0xdd')](_0x4d0e4e,_0xf09e('0xe1'));break;case'22':ut[_0xf09e('0xdc')](_0x4d0e4e,0x16,_0xf09e('0xe2'));rpcDb['createAgentHistory'](_0x4d0e4e,_0xf09e('0xe3'));break;default:ut[_0xf09e('0xdc')](_0x4d0e4e,0xc,_0x4dd4d8[_0xf09e('0xdb')]);rpcDb['createAgentHistory'](_0x4d0e4e,'[callProgressDetectingAgent][logCongestion]');}ut[_0xf09e('0x76')](_0x133ed6,_0xf09e('0xe4'));logger[_0xf09e('0x59')](_0xf09e('0xe5'),_0x4d0e4e[_0xf09e('0xa8')],_0xf09e('0xa9'),_0x133ed6[_0xf09e('0x28')],_0xf09e('0x6f'),_0x133ed6[_0xf09e('0x4c')]);delete this[_0xf09e('0x17')][_0x4d0e4e['uniqueid']];};Preview['prototype'][_0xf09e('0xe6')]=function(_0x4ae18a,_0x2980e2,_0x43e4c3,_0x4a1dbe,_0x1ec46b){var _0x495f26=this;return new BPromise(function(_0x27a44d,_0x4669b5){if(_[_0xf09e('0x6b')](_0x2980e2)||_[_0xf09e('0x6b')](_0x2980e2[_0xf09e('0xe7')])||_[_0xf09e('0x6b')](_0x2980e2[_0xf09e('0xe7')][_0xf09e('0xe8')])||_[_0xf09e('0x6b')](_0x2980e2[_0xf09e('0xe9')])){_0x4669b5(ut['message'](_0xf09e('0xea'),_0x4a1dbe,_0x1ec46b));return;}var _0x413f00=uuid['v4']();var _0x328bab=_0x495f26[_0xf09e('0x25')][_0x2980e2['Queue']['name']];var _0x56f1b1=_0x43e4c3?_0x495f26[_0xf09e('0x18')][_0x43e4c3]['id']:undefined;_0x495f26[_0xf09e('0x17')][_0x413f00]=new Action(_0x2980e2,_0x328bab,_0x413f00,_0x43e4c3,_0x56f1b1);var _0x4ea4b3=_0x495f26[_0xf09e('0x17')][_0x413f00];_0x4ea4b3[_0xf09e('0xc1')]=_0x4a1dbe;_0x4ea4b3[_0xf09e('0xca')]=_0x1ec46b;_0x4ea4b3[_0xf09e('0xeb')]=_0x43e4c3;if(_[_0xf09e('0xec')](_0x4ae18a)){_0x495f26[_0xf09e('0xed')](_0x4ea4b3,_0x328bab,_0x2980e2,_0x43e4c3)[_0xf09e('0x7e')](function(_0x1fdc25){logger[_0xf09e('0x59')](_0xf09e('0xee'),_0xf09e('0xef')+_0x4ea4b3['queue']+_0xf09e('0xf0')+_0x4ea4b3['idContact'],JSON[_0xf09e('0x56')](_0x1fdc25));ami[_0xf09e('0xad')](_0xf09e('0xf1'),ut['buildObj'](_0x4ea4b3,'called'));_0x27a44d(ut[_0xf09e('0x4b')](_0xf09e('0xf2')));})[_0xf09e('0x74')](function(_0x450618){ut[_0xf09e('0x60')](_0xf09e('0xf3'),_0x450618);_0x4669b5(ut['message'](_0xf09e('0xf4'),_0x4a1dbe,_0x1ec46b));});}else{_0x328bab[_0xf09e('0x37')]+=0x1;ut[_0xf09e('0xf5')](_0x4ea4b3);rpcDb['createHistory'](_0x4ea4b3,_0xf09e('0xf6'));delete _0x495f26[_0xf09e('0x17')][_0x413f00];_0x4669b5(ut[_0xf09e('0x4b')](_0xf09e('0xf7'),_0x4a1dbe,_0x1ec46b));}});};Preview[_0xf09e('0x10')][_0xf09e('0x9a')]=function(_0x425631){return!_['isNil'](_0x425631)&&!_['isNil'](_0x425631[_0xf09e('0x28')])&&!_[_0xf09e('0x6b')](_0x425631[_0xf09e('0x53')])&&_0x425631[_0xf09e('0x53')]&&!_['isNil'](this[_0xf09e('0x16')][util['format'](_0xf09e('0xf8'),_0x425631['name'])])&&!_['isNil'](this[_0xf09e('0x16')][util[_0xf09e('0x57')](_0xf09e('0xf8'),_0x425631[_0xf09e('0x28')])][_0xf09e('0x73')])&&(this['trunks'][util[_0xf09e('0x57')](_0xf09e('0xf8'),_0x425631[_0xf09e('0x28')])]['status']===_0xf09e('0xf9')||this[_0xf09e('0x16')][util[_0xf09e('0x57')](_0xf09e('0xf8'),_0x425631['name'])][_0xf09e('0x73')]===_0xf09e('0xfa'));};Preview[_0xf09e('0x10')]['run']=function(_0x46ffbd,_0x1dc851){var _0x4e3727=this;return new BPromise(function(_0x62835d,_0x19a5c7){_0x4e3727[_0xf09e('0xfb')](_0x46ffbd,_0x1dc851)[_0xf09e('0x7e')](function(_0x1ed618){_0x62835d(_['pick'](_0x1ed618,[_0xf09e('0x4b')]));})[_0xf09e('0x74')](function(_0xebbada){if(_0xebbada['unlock']){rpcDb[_0xf09e('0xd0')](_0x46ffbd);}if(_0xebbada[_0xf09e('0x53')]){rpcDb[_0xf09e('0x88')](_0x46ffbd);}_0x19a5c7(_[_0xf09e('0xfc')](_0xebbada,[_0xf09e('0x4b')]));});});};Preview[_0xf09e('0x10')][_0xf09e('0xfb')]=function(_0x2d158c,_0x3f3b60){var _0xe93082=this;return new BPromise(function(_0x31e186,_0x23687b){var _0x1d7bbf,_0x130af3;rpcDb[_0xf09e('0xfd')](_0x2d158c)[_0xf09e('0x7e')](function(_0x1f393a){if(!_[_0xf09e('0x6b')](_0x1f393a[0x0])){_0x130af3=_0x1f393a[0x0][_0xf09e('0xfe')]?![]:!![];_0x1d7bbf=_0x1f393a[0x0][_0xf09e('0xfe')]?!![]:![];_0x1d7bbf=_0x3f3b60?!![]:_0x1d7bbf;}var _0x38419e=_0xe93082['validateContact'](_0x1f393a);if(_0x38419e[_0xf09e('0xff')]){rpcDb[_0xf09e('0x100')](_[_0xf09e('0xfc')](_0x1f393a[0x0],[_0xf09e('0xe9'),_0xf09e('0x101')]))[_0xf09e('0x7e')](function(_0x308d7f){_0xe93082['checkInBlack'](_0x308d7f,_0x1f393a[0x0],_0x3f3b60,_0x130af3,_0x1d7bbf)[_0xf09e('0x7e')](function(_0xd8b561){_0x31e186(_0xd8b561);})[_0xf09e('0x74')](function(_0x46ce96){_0x23687b(_0x46ce96);});})['catch'](function(_0x308789){ut[_0xf09e('0x60')]('[Preview][checkIsBlackList]',_0x308789);_0x23687b(ut[_0xf09e('0x4b')](_0xf09e('0x102'),_0x130af3,_0x1d7bbf));});}else{_0x23687b(ut[_0xf09e('0x4b')](_0x38419e[_0xf09e('0x4b')],_0x130af3,_0x1d7bbf));}})[_0xf09e('0x74')](function(_0x544567){ut[_0xf09e('0x60')](_0xf09e('0x103'),_0x544567);_0x23687b(ut[_0xf09e('0x4b')](_0xf09e('0x102'),![],!![]));});});};Preview['prototype'][_0xf09e('0x104')]=function(_0x59283f){if(_[_0xf09e('0x6b')](_0x59283f)||_[_0xf09e('0xec')](_0x59283f)||!_['isNil'](_0x59283f[0x0][_0xf09e('0x83')])&&_[_0xf09e('0x6b')](_0x59283f[0x0]['Agent'][_0xf09e('0x28')])){ut[_0xf09e('0x60')](_0xf09e('0x105'),_0x59283f);return{'isValid':![],'message':_0xf09e('0x106')};}var _0xf24706=this[_0xf09e('0x25')][_0x59283f[0x0][_0xf09e('0x6d')][_0xf09e('0x28')]];_0xf24706['message']=_0xf09e('0x9d');if(_[_0xf09e('0x6b')](_0xf24706)){ut['logger'](_0xf09e('0x107'),_0xf24706);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xf09e('0x9a')](_0xf24706[_0xf09e('0x52')])){ut[_0xf09e('0x60')]('[Preview][validateContact][Trunk\x20not\x20work]',_0xf09e('0x108')+_0xf24706[_0xf09e('0x28')]+_0xf09e('0x109'));if(!this['isTrunkReachable'](_0xf24706[_0xf09e('0x9b')])){ut['logger'](_0xf09e('0x10a'),_0xf24706['name']+_0xf09e('0x10b'));return{'isValid':![],'message':_0xf09e('0x10c')};}}if(!ut['isActive'](_0xf24706['dialActive'])){ut[_0xf09e('0x60')](_0xf09e('0x10d'),_0xf24706['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0xf09e('0x108')+_0xf24706[_0xf09e('0x28')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xf09e('0x10e')};};Preview['prototype'][_0xf09e('0xed')]=function(_0x56a97c,_0x22886a,_0x2ef15c,_0x3424d0){var _0x2162ef=this;return new BPromise(function(_0x55f02a,_0x335f2a){var _0x25679a=_0x56a97c[_0xf09e('0xa8')];var _0x1db66a=_0x2162ef['isTrunkReachable'](_0x22886a[_0xf09e('0x52')])?util['format']('SIP/%s/%s%s',_0x22886a[_0xf09e('0x52')]['name'],_[_0xf09e('0x6b')](_0x22886a[_0xf09e('0x36')])?'':_0x22886a[_0xf09e('0x36')][_0xf09e('0x10f')]()||'',_0x22886a['dialCutDigit']>0x0?_0x2ef15c['Contact']['phone'][_0xf09e('0x110')](_0x22886a[_0xf09e('0x111')]):_0x2ef15c['Contact'][_0xf09e('0xe8')]):util[_0xf09e('0x57')](_0xf09e('0x112'),_[_0xf09e('0x6b')](_0x22886a['TrunkBackup'])?_0x22886a[_0xf09e('0x52')]['name']:_0x22886a[_0xf09e('0x9b')][_0xf09e('0x28')],_[_0xf09e('0x6b')](_0x22886a[_0xf09e('0x36')])?'':_0x22886a[_0xf09e('0x36')][_0xf09e('0x10f')]()||'',_0x22886a['dialCutDigit']>0x0?_0x2ef15c['Contact'][_0xf09e('0xe8')][_0xf09e('0x110')](_0x22886a[_0xf09e('0x111')]):_0x2ef15c[_0xf09e('0xe7')]['phone']);var _0x262f01=_0x2162ef['isTrunkReachable'](_0x22886a['Trunk'])?ut['getCallerId'](_0x22886a[_0xf09e('0x52')][_0xf09e('0x54')],_0x22886a[_0xf09e('0x34')],_0x22886a[_0xf09e('0x113')]>0x0?ut[_0xf09e('0x114')](_0x22886a[_0xf09e('0x35')],_0x22886a[_0xf09e('0x113')]):_0x22886a[_0xf09e('0x35')]):ut['getCallerId'](_[_0xf09e('0x6b')](_0x22886a['TrunkBackup'])?_0x22886a[_0xf09e('0x52')]['callerid']:_0x22886a['TrunkBackup'][_0xf09e('0x54')],_0x22886a[_0xf09e('0x34')],_0x22886a[_0xf09e('0x113')]>0x0?ut[_0xf09e('0x114')](_0x22886a[_0xf09e('0x35')],_0x22886a[_0xf09e('0x113')]):_0x22886a['dialOriginateCallerIdNumber']);if(_0x262f01){_0x56a97c['originatecalleridname']=ut[_0xf09e('0x115')](_0x262f01);_0x56a97c['originatecalleridnum']=ut[_0xf09e('0x116')](_0x262f01);}var _0x3587cd=ut['addVariables'](_0x22886a,_0x2ef15c,_0x1db66a,_0x262f01,_0x25679a,_0x56a97c);_[_0xf09e('0x117')](_0x56a97c,ut['toLowerVariables'](_0x3587cd));_0x56a97c['starttime']=moment()[_0xf09e('0x57')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xf09e('0x118')](ut['variablesAction'](_0x56a97c,_0x22886a,_0x3587cd,_0x56a97c[_0xf09e('0xca')],_0x3424d0))[_0xf09e('0x7e')](function(_0x3f77de){_0x22886a[_0xf09e('0x4c')]+=0x1;logger[_0xf09e('0x59')](_0xf09e('0x119'),_0x25679a,'\x20Queue',_0x22886a[_0xf09e('0x28')],_0xf09e('0x6f'),_0x22886a[_0xf09e('0x4c')]);_0x55f02a(_0x3f77de);})[_0xf09e('0x74')](function(_0x403173){ut['logAgent'](_0x56a97c,0xe,_0xf09e('0x11a'));rpcDb['createAgentHistory'](_0x56a97c,'[originateFailure][logOriginateFailure]');_0x335f2a(_0x403173);});});};Preview[_0xf09e('0x10')]['syncNewExten']=function(_0x4c361c){if(this[_0xf09e('0x17')][_0x4c361c[_0xf09e('0xb9')]]){this[_0xf09e('0x17')][_0x4c361c[_0xf09e('0xb9')]]['channel']=_0x4c361c['channel'];}};Preview[_0xf09e('0x10')][_0xf09e('0x11b')]=function(_0x5e4f06){var _0x471168=this;var _0x57cdc4=this[_0xf09e('0x17')][_0x5e4f06[_0xf09e('0x11c')]];if(_0x57cdc4){if(_0x57cdc4[_0xf09e('0xeb')]&&this[_0xf09e('0x18')][_0x57cdc4[_0xf09e('0xeb')]]){ut[_0xf09e('0x11d')](_0x57cdc4,this['agents'][_0x57cdc4[_0xf09e('0xeb')]]['name'],this[_0xf09e('0x18')][_0x57cdc4['lookAgent']]['id']);}var _0x223b5a=_[_0xf09e('0x11e')](_0x57cdc4);_0x223b5a['responsetime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x194d0e=_0x471168[_0xf09e('0x25')][_0x57cdc4[_0xf09e('0x6e')]];if(ut[_0xf09e('0x11f')](_0x5e4f06[_0xf09e('0x120')])){if(_0x57cdc4['unlockAgent']){rpcDb[_0xf09e('0xd0')](_0x57cdc4['idContact']);}if(_0x57cdc4[_0xf09e('0xca')]){rpcDb[_0xf09e('0x88')](_0x57cdc4['idContact']);}ami[_0xf09e('0xad')](_0xf09e('0x121'),ut['buildObj'](_0x57cdc4,_0xf09e('0x122')));this[_0xf09e('0x123')](_0x223b5a,_0x194d0e,_0x5e4f06);}else{_0x57cdc4['starttime']=moment()[_0xf09e('0x57')](_0xf09e('0x89'));ut['logAgent'](_0x223b5a,0x4,'Answer');rpcDb['createAgentHistory'](_0x223b5a,_0xf09e('0x124'));}}};Preview[_0xf09e('0x10')][_0xf09e('0x1c')]=function(_0x2cc0e6){var _0x4bdfd5=this;var _0x226e25=this[_0xf09e('0x17')][_0x2cc0e6[_0xf09e('0xb9')]];var _0x5f7638;if(_0x226e25){_0x5f7638=this[_0xf09e('0x25')][_0x226e25[_0xf09e('0x6e')]];logger['info'](_0xf09e('0x125'),_0x2cc0e6[_0xf09e('0xb9')],_0xf09e('0xa9'),_0x5f7638[_0xf09e('0x28')],'pTalking:\x20',_0x5f7638[_0xf09e('0x5d')]);}if(this[_0xf09e('0x17')][_0x2cc0e6[_0xf09e('0xb9')]]&&_0x2cc0e6[_0xf09e('0xb9')]!==_0x2cc0e6[_0xf09e('0xa8')]){if(_0x2cc0e6['cause']==='16'&&this[_0xf09e('0x17')][_0x2cc0e6[_0xf09e('0xb9')]][_0xf09e('0x78')]){this['callProgressDetectingCustomer'](_0x2cc0e6,_0x2cc0e6[_0xf09e('0xb9')],_0x2cc0e6[_0xf09e('0x126')]);}else if(this[_0xf09e('0x17')][_0x2cc0e6[_0xf09e('0xb9')]][_0xf09e('0x78')]){logger[_0xf09e('0x59')](_0xf09e('0x127'),_0x2cc0e6[_0xf09e('0xb9')],_0x2cc0e6['cause'],_0xf09e('0xa9'),_0x5f7638[_0xf09e('0x28')],_0xf09e('0x70'),_0x5f7638[_0xf09e('0x5d')]);this[_0xf09e('0x9e')](_0x2cc0e6,_0x2cc0e6[_0xf09e('0xb9')],_0x2cc0e6[_0xf09e('0x126')]);}}else if(_0x226e25&&_[_0xf09e('0x6b')](_0x226e25['statedesc'])&&_0x5f7638[_0xf09e('0x128')]&&_0x2cc0e6[_0xf09e('0xb9')]===_0x2cc0e6[_0xf09e('0xa8')]&&_[_0xf09e('0x6b')](_0x2cc0e6[_0xf09e('0xdb')])&&_0x2cc0e6[_0xf09e('0x126')]==='16'&&_0x2cc0e6[_0xf09e('0x129')]==='6'&&_[_0xf09e('0xda')](_0x226e25[_0xf09e('0x12a')])){if(_0x226e25['unlockAgent']){rpcDb['unlockContact'](_0x226e25[_0xf09e('0xd1')]);}if(_0x226e25[_0xf09e('0xca')]){rpcDb['disableContact'](_0x226e25[_0xf09e('0xd1')]);}_0x2cc0e6[_0xf09e('0xdb')]='22';this[_0xf09e('0x123')](_0x226e25,_0x5f7638,_0x2cc0e6);}else if(_0x226e25&&_0x226e25[_0xf09e('0x12a')]){if(_0x2cc0e6['cause']==='16'&&this['actions'][_0x2cc0e6[_0xf09e('0xb9')]]['dialAnswer']){logger[_0xf09e('0x59')]('[syncHangup][talking][transfer]',_0x2cc0e6[_0xf09e('0xb9')],_0x2cc0e6[_0xf09e('0x126')],_0xf09e('0xa9'),_0x5f7638[_0xf09e('0x28')],_0xf09e('0x70'),_0x5f7638[_0xf09e('0x5d')]);this['callProgressDetectingCustomer'](_0x2cc0e6,_0x2cc0e6[_0xf09e('0xb9')],_0x2cc0e6['cause']);}else if(this[_0xf09e('0x17')][_0x2cc0e6[_0xf09e('0xb9')]][_0xf09e('0x78')]){logger['info'](_0xf09e('0x127'),_0x2cc0e6[_0xf09e('0xb9')],_0x2cc0e6[_0xf09e('0x126')],_0xf09e('0xa9'),_0x5f7638[_0xf09e('0x28')],_0xf09e('0x70'),_0x5f7638[_0xf09e('0x5d')]);this[_0xf09e('0x9e')](_0x2cc0e6,_0x2cc0e6[_0xf09e('0xb9')],_0x2cc0e6['cause']);}}};Preview[_0xf09e('0x10')][_0xf09e('0x12b')]=function(_0x34010a){if(this[_0xf09e('0x17')][_0x34010a[_0xf09e('0xd8')]]&&_0x34010a[_0xf09e('0xd8')]!==_0x34010a['destuniqueid']){this['callProgressDetectingCustomer'](_0x34010a,_0x34010a[_0xf09e('0xd8')],_0x34010a['dialstatus']);}};Preview[_0xf09e('0x10')][_0xf09e('0x1d')]=function(_0x89fb81){if(this[_0xf09e('0x17')][_0x89fb81[_0xf09e('0xb9')]]&&_0x89fb81[_0xf09e('0xb9')]!==_0x89fb81[_0xf09e('0xa8')]&&!this['actions'][_0x89fb81[_0xf09e('0xb9')]][_0xf09e('0x78')]){if(_0x89fb81[_0xf09e('0x126')]==='1'){this[_0xf09e('0x9e')](_0x89fb81,_0x89fb81[_0xf09e('0xb9')],_0x89fb81[_0xf09e('0x126')]);}}};Preview[_0xf09e('0x10')][_0xf09e('0x12c')]=function(_0x4a2a2c,_0x584145,_0xd81c67){if(this[_0xf09e('0x17')][_0x4a2a2c]){if(_['isNil'](this[_0xf09e('0x17')][_0x4a2a2c][_0xf09e('0x12d')])){this['actions'][_0x4a2a2c][_0xf09e('0x12d')]={};}this[_0xf09e('0x17')][_0x4a2a2c]['variables'][_0x584145]=_0xd81c67;}};Preview[_0xf09e('0x10')]['syncVarSet']=function(_0x1c3536){try{if(!_['isNil'](_0x1c3536)){if(ut[_0xf09e('0x12e')](_[_0xf09e('0x12f')](_0x1c3536['variable'])[0x0])){this['addVariable'](_0x1c3536['uniqueid'],_['keys'](_0x1c3536['variable'])[0x0],_0x1c3536[_0xf09e('0x130')]);}}}catch(_0x44e53c){logger[_0xf09e('0x131')]('[syncVarSet][Preview]',util['inspect'](_0x44e53c,{'showHidden':![],'depth':null}));}};Preview[_0xf09e('0x10')][_0xf09e('0x22')]=function(_0x22a9e0){if(_0x22a9e0){if(this[_0xf09e('0x17')][_0x22a9e0['transfertargetlinkedid']]){this[_0xf09e('0x17')][_0x22a9e0[_0xf09e('0x132')]][_0xf09e('0x12a')]=!![];}}};Preview[_0xf09e('0x10')][_0xf09e('0x24')]=function(_0x6dfac5){if(_0x6dfac5){if(this[_0xf09e('0x17')][_0x6dfac5[_0xf09e('0x133')]]){this[_0xf09e('0x17')][_0x6dfac5['transfererlinkedid']]['transfer']=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xab73=['hanguprequest','syncHangupRequest','dialend','newexten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','answered','pTalking','sumBillable','sumDuration','sumHoldTime','talking','type','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','hasOwnProperty','preview','clearZombieChannels','setMessage','recallMe','clearZombieChannel','enqueue','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','getContactRecallMe','agentReadyId','isNil','length','scheduledat','Agent','voicePause','run','then','logger2','[RecallMe]','catch','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','loggedIn','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','dialGlobalMaxRetry','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','acw','custom:agentConnectPreview','buildAcw','buildObj','complete','outboundAnswerCallsDay','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','Global','dialBusyMaxRetry','scheduledAt','unlockAgent','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','rescheduleContact','dialNoAnswerRetryFrequency','activeContact','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialBusyRetryFrequency','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','[default]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','unmonitored','execRun','unlock','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialCutDigit','phone','substring','trim','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','lookAgent','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','cause','statedesc','dialQueueProject','transfer','[syncHangup][talking][cause]','syncDialEnd','destuniqueid','addVariable','variables','filterKey','variable','keys','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','../ami','./rpcDb','./action','./util/util','redis','localhost','prototype','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup'];(function(_0x5a0c4f,_0x44b3ad){var _0x5e2d52=function(_0x37397e){while(--_0x37397e){_0x5a0c4f['push'](_0x5a0c4f['shift']());}};_0x5e2d52(++_0x44b3ad);}(_0xab73,0x11f));var _0x3ab7=function(_0x87f123,_0x75fed0){_0x87f123=_0x87f123-0x0;var _0x38d958=_0xab73[_0x87f123];return _0x38d958;};'use strict';var util=require(_0x3ab7('0x0'));var _=require(_0x3ab7('0x1'));var BPromise=require(_0x3ab7('0x2'));var uuid=require(_0x3ab7('0x3'));var moment=require(_0x3ab7('0x4'));var md5=require(_0x3ab7('0x5'));var Redis=require(_0x3ab7('0x6'));var config=require('../../../config/environment');var logger=require(_0x3ab7('0x7'))('preview');var loggerAction=require(_0x3ab7('0x7'))('actionPreview');var ami=require(_0x3ab7('0x8'));var rpcDb=require(_0x3ab7('0x9'));var Action=require(_0x3ab7('0xa'));var ut=require(_0x3ab7('0xb'));config[_0x3ab7('0xc')]=_['defaults'](config[_0x3ab7('0xc')],{'host':_0x3ab7('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3ab7('0xc')]));var Sequence=function(){};Sequence[_0x3ab7('0xe')]['enqueue']=function(_0x1e9d85){this['tail']=this[_0x3ab7('0xf')]?this[_0x3ab7('0xf')]['finally'](_0x1e9d85):_0x1e9d85();};function Preview(_0x1b2881){this[_0x3ab7('0x10')]=new Sequence();this[_0x3ab7('0x11')]=_0x1b2881[_0x3ab7('0x12')];this[_0x3ab7('0x13')]=_0x1b2881[_0x3ab7('0x13')];this[_0x3ab7('0x14')]={};this[_0x3ab7('0x15')]=_0x1b2881['agents'];this[_0x3ab7('0x16')]=0x0;ami['on'](_0x3ab7('0x17'),this[_0x3ab7('0x18')][_0x3ab7('0x19')](this));ami['on'](_0x3ab7('0x1a'),this[_0x3ab7('0x1b')][_0x3ab7('0x19')](this));ami['on'](_0x3ab7('0x1c'),this[_0x3ab7('0x1d')][_0x3ab7('0x19')](this));ami['on'](_0x3ab7('0x1e'),this['syncDialEnd'][_0x3ab7('0x19')](this));ami['on'](_0x3ab7('0x1f'),this['syncNewExten'][_0x3ab7('0x19')](this));ami['on'](_0x3ab7('0x20'),this[_0x3ab7('0x21')][_0x3ab7('0x19')](this));ami['on']('attendedtransfer',this[_0x3ab7('0x22')][_0x3ab7('0x19')](this));ami['on'](_0x3ab7('0x23'),this[_0x3ab7('0x24')][_0x3ab7('0x19')](this));this[_0x3ab7('0x25')](this['campaignsPreview']);}function emit(_0x1226b3,_0x54bf52,_0x31c83c){io['to'](_0x1226b3)[_0x3ab7('0x26')](_0x54bf52,_0x31c83c);}function emitCampaignPreview(_0x1d62b0){if(_0x1d62b0['type']===_0x3ab7('0x27')){var _0x405296={'id':_0x1d62b0['id'],'name':_0x1d62b0[_0x3ab7('0x28')],'strategy':_0x1d62b0[_0x3ab7('0x29')],'answered':_0x1d62b0[_0x3ab7('0x2a')],'available':_0x1d62b0['available'],'loggedIn':_0x1d62b0['loggedIn'],'pTalking':_0x1d62b0[_0x3ab7('0x2b')],'sumBillable':_0x1d62b0[_0x3ab7('0x2c')],'sumDuration':_0x1d62b0[_0x3ab7('0x2d')],'sumHoldTime':_0x1d62b0[_0x3ab7('0x2e')]||0x0,'talking':_0x1d62b0[_0x3ab7('0x2f')],'total':_0x1d62b0['total'],'type':_0x1d62b0[_0x3ab7('0x30')],'unmanaged':_0x1d62b0['unmanaged'],'abandoned':_0x1d62b0['abandoned'],'waiting':_0x1d62b0[_0x3ab7('0x31')],'loggedInDb':_0x1d62b0[_0x3ab7('0x32')],'dialActive':_0x1d62b0[_0x3ab7('0x33')],'dialMethod':_0x1d62b0[_0x3ab7('0x34')],'dialOriginateCallerIdName':_0x1d62b0[_0x3ab7('0x35')],'dialOriginateCallerIdNumber':_0x1d62b0[_0x3ab7('0x36')],'dialOriginateTimeout':_0x1d62b0['dialOriginateTimeout'],'dialPrefix':_0x1d62b0[_0x3ab7('0x37')],'outboundAnswerAgiCallsDay':_0x1d62b0[_0x3ab7('0x38')],'outboundAnswerCallsDay':_0x1d62b0['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1d62b0[_0x3ab7('0x39')],'outboundBusyCallsDay':_0x1d62b0[_0x3ab7('0x3a')],'outboundCongestionCallsDay':_0x1d62b0['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1d62b0['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1d62b0[_0x3ab7('0x3b')],'outboundDropCallsDayTimeout':_0x1d62b0[_0x3ab7('0x3c')],'outboundNoAnswerCallsDay':_0x1d62b0[_0x3ab7('0x3d')],'outboundNoSuchCallsDay':_0x1d62b0['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x1d62b0[_0x3ab7('0x3e')],'outboundReCallsDay':_0x1d62b0[_0x3ab7('0x3f')],'outboundRejectCallsDay':_0x1d62b0[_0x3ab7('0x40')],'outboundUnknownCallsDay':_0x1d62b0[_0x3ab7('0x41')],'predictiveIntervalAnsweredCalls':_0x1d62b0[_0x3ab7('0x42')],'predictiveIntervalAvgHoldtime':_0x1d62b0[_0x3ab7('0x43')],'predictiveIntervalAvgTalktime':_0x1d62b0[_0x3ab7('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x1d62b0[_0x3ab7('0x45')],'predictiveIntervalDroppedCallsTimeout':_0x1d62b0[_0x3ab7('0x46')],'predictiveIntervalErlangCalls':_0x1d62b0[_0x3ab7('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x1d62b0[_0x3ab7('0x48')],'predictiveIntervalHitRate':_0x1d62b0[_0x3ab7('0x49')],'predictiveIntervalMultiplicativeFactor':_0x1d62b0[_0x3ab7('0x4a')],'predictiveIntervalPauses':_0x1d62b0[_0x3ab7('0x4b')],'predictiveIntervalAvailable':_0x1d62b0[_0x3ab7('0x4c')],'predictiveIntervalTotalCalls':_0x1d62b0[_0x3ab7('0x4d')],'message':_0x1d62b0['message'],'originated':_0x1d62b0[_0x3ab7('0x4e')],'erlangCalls':_0x1d62b0[_0x3ab7('0x4f')],'erlangCallToSecond':_0x1d62b0[_0x3ab7('0x50')],'erlangAbandonmentRate':_0x1d62b0[_0x3ab7('0x51')],'erlangBusyFactor':_0x1d62b0[_0x3ab7('0x52')],'startPredictive':_0x1d62b0[_0x3ab7('0x53')],'startProgressive':_0x1d62b0[_0x3ab7('0x54')]};if(_0x1d62b0[_0x3ab7('0x55')]){_0x405296[_0x3ab7('0x55')]={'id':_0x1d62b0[_0x3ab7('0x55')]['id'],'name':_0x1d62b0[_0x3ab7('0x55')]['name'],'active':_0x1d62b0['Trunk'][_0x3ab7('0x56')],'callerid':_0x1d62b0[_0x3ab7('0x55')][_0x3ab7('0x57')]};}if(_0x1d62b0[_0x3ab7('0x58')]){_0x405296['Interval']={'id':_0x1d62b0[_0x3ab7('0x58')]['id'],'name':_0x1d62b0[_0x3ab7('0x58')][_0x3ab7('0x28')]};}var _0x4656df=md5(JSON[_0x3ab7('0x59')](_0x405296));if(_0x1d62b0['md5']!==_0x4656df){_0x1d62b0[_0x3ab7('0x5')]=_0x4656df;emit(util['format'](_0x3ab7('0x5a'),_0x405296[_0x3ab7('0x28')]),_0x3ab7('0x5b'),_0x405296);}}}function emitVoiceQueueChannelRemove(_0x142d31){logger[_0x3ab7('0x5c')](_0x3ab7('0x5d'),JSON['stringify'](_0x142d31));emit(util[_0x3ab7('0x5e')](_0x3ab7('0x5a'),_0x142d31[_0x3ab7('0x28')]),_0x3ab7('0x5f'),_0x142d31);}function notSendMessagesQueue(_0x5944c6){if(_0x5944c6[_0x3ab7('0x60')]){if(_0x5944c6[_0x3ab7('0x4e')]===0x0&&_0x5944c6[_0x3ab7('0x2b')]===0x0){_0x5944c6[_0x3ab7('0x60')]=![];_0x5944c6['available']=0x0;_0x5944c6[_0x3ab7('0x61')]=0x0;_0x5944c6[_0x3ab7('0x62')]=_0x3ab7('0x63');ut['logger'](_0x3ab7('0x64'),_0x5944c6[_0x3ab7('0x28')]+_0x3ab7('0x65'));}else{_0x5944c6[_0x3ab7('0x62')]=_0x3ab7('0x66');ut[_0x3ab7('0x67')](_0x3ab7('0x64'),_0x5944c6[_0x3ab7('0x28')]+_0x3ab7('0x68'));}emitCampaignPreview(_0x5944c6);}}Preview['prototype'][_0x3ab7('0x25')]=function(){var _0x3c0360=this;setInterval(function(){_0x3c0360[_0x3ab7('0x69')]();},0x7cf);};Preview[_0x3ab7('0xe')]['syncCampaigns']=function(){var _0x57268c=this[_0x3ab7('0x11')];this[_0x3ab7('0x16')]+=0x1;for(var _0x239b47 in _0x57268c){if(_0x57268c[_0x3ab7('0x6a')](_0x239b47)&&(_0x57268c[_0x239b47][_0x3ab7('0x34')]===_0x3ab7('0x6b')||_0x57268c[_0x239b47][_0x3ab7('0x34')]==='booked')&&_0x57268c[_0x239b47][_0x3ab7('0x30')]===_0x3ab7('0x27')){if(this[_0x3ab7('0x16')]>0x7){this[_0x3ab7('0x16')]=0x0;this[_0x3ab7('0x6c')]();}}if(_0x57268c['hasOwnProperty'](_0x239b47)&&_0x57268c[_0x239b47][_0x3ab7('0x34')]===_0x3ab7('0x6b')&&_0x57268c[_0x239b47][_0x3ab7('0x30')]===_0x3ab7('0x27')){if(_0x57268c[_0x239b47][_0x3ab7('0x33')]){this[_0x3ab7('0x6d')](_0x57268c[_0x239b47]);this[_0x3ab7('0x6e')](_0x57268c[_0x239b47]);}else{notSendMessagesQueue(_0x57268c[_0x239b47]);}}}};Preview['prototype'][_0x3ab7('0x6f')]=function(_0x5e045b){var _0xf118be=this;this['sequence'][_0x3ab7('0x70')](function(){if(!_['isNil'](_0xf118be[_0x3ab7('0x14')][_0x5e045b])){loggerAction[_0x3ab7('0x5c')]('[clearZombieChannels][talking]',_0x5e045b,_0x3ab7('0x71'),_0xf118be['actions'][_0x5e045b][_0x3ab7('0x72')],_0x3ab7('0x73'),JSON[_0x3ab7('0x59')](_0xf118be[_0x3ab7('0x11')][_0xf118be['actions'][_0x5e045b][_0x3ab7('0x72')]][_0x3ab7('0x4e')]),_0x3ab7('0x74'),JSON['stringify'](_0xf118be[_0x3ab7('0x11')][_0xf118be[_0x3ab7('0x14')][_0x5e045b][_0x3ab7('0x72')]][_0x3ab7('0x2b')]),JSON[_0x3ab7('0x59')](_0xf118be[_0x3ab7('0x14')][_0x5e045b][_0x3ab7('0x75')]),JSON['stringify'](_[_0x3ab7('0x76')](_0xf118be['actions'][_0x5e045b],[_0x3ab7('0x77'),_0x3ab7('0x78'),_0x3ab7('0x79'),_0x3ab7('0x7a')])));return ami[_0x3ab7('0x7b')]({'action':'status','channel':_0xf118be[_0x3ab7('0x14')][_0x5e045b][_0x3ab7('0x7c')]})['catch'](function(_0x508fef){if(_0x508fef[_0x3ab7('0x62')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xf118be[_0x3ab7('0x14')][_0x5e045b]){ut[_0x3ab7('0x7d')](_0xf118be['campaignsPreview'][_0xf118be[_0x3ab7('0x14')][_0x5e045b][_0x3ab7('0x72')]],_0x3ab7('0x7e'));if(_0xf118be[_0x3ab7('0x14')][_0x5e045b][_0x3ab7('0x75')]===!![]){ut[_0x3ab7('0x7f')](_0xf118be['campaignsPreview'][_0xf118be[_0x3ab7('0x14')][_0x5e045b][_0x3ab7('0x72')]],_0x3ab7('0x7e'));ut[_0x3ab7('0x80')](_0x3ab7('0x81')+_0x5e045b,_0xf118be[_0x3ab7('0x14')][_0x5e045b][_0x3ab7('0x72')]);}ut[_0x3ab7('0x80')](_0x3ab7('0x82')+_0x5e045b,_0xf118be['actions'][_0x5e045b][_0x3ab7('0x72')]);delete _0xf118be[_0x3ab7('0x14')][_0x5e045b];}},0x2328);}});}});};Preview[_0x3ab7('0xe')][_0x3ab7('0x6c')]=function(){var _0xcceaa1=this;loggerAction[_0x3ab7('0x5c')](_0x3ab7('0x83'),_['size'](this[_0x3ab7('0x14')]));for(var _0x2b477b in this[_0x3ab7('0x14')]){if(_0xcceaa1[_0x3ab7('0x14')][_0x3ab7('0x6a')](_0x2b477b)){_0xcceaa1[_0x3ab7('0x6f')](_0x2b477b);}}};Preview[_0x3ab7('0xe')][_0x3ab7('0x6e')]=function(_0x506d9f){var _0x1a0df6=this;rpcDb[_0x3ab7('0x84')](_0x506d9f['id'],ut[_0x3ab7('0x85')](this[_0x3ab7('0x15')]))['then'](function(_0x4faf00){if(!_[_0x3ab7('0x86')](_0x4faf00)){for(var _0x582515=0x0;_0x582515<_0x4faf00[_0x3ab7('0x87')];_0x582515+=0x1){if(ut['getDiff'](_0x4faf00[_0x582515][_0x3ab7('0x88')])<_0x506d9f['dialRecallMeTimeout']*0x3c){if(_0x4faf00[_0x582515]['Agent']&&!_0x4faf00[_0x582515][_0x3ab7('0x89')][_0x3ab7('0x8a')]){_0x1a0df6[_0x3ab7('0x8b')](_0x4faf00[_0x582515]['id'])[_0x3ab7('0x8c')](ut[_0x3ab7('0x8d')](_0x3ab7('0x8e')))[_0x3ab7('0x8f')](ut[_0x3ab7('0x8d')](_0x3ab7('0x8e')));}else{rpcDb[_0x3ab7('0x90')](_0x4faf00[_0x582515]['id']);}}else{var _0x27cc22=new Action(_0x4faf00[_0x582515],_0x506d9f);_0x27cc22[_0x3ab7('0x91')]=moment()[_0x3ab7('0x5e')](_0x3ab7('0x92'));_0x506d9f[_0x3ab7('0x3f')]+=0x1;ut[_0x3ab7('0x93')](_0x27cc22,0x17,_0x3ab7('0x94'));if(_0x506d9f['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0x3ab7('0x95')](_0x4faf00[_0x582515]));rpcDb[_0x3ab7('0x96')](_0x27cc22,'[HistoryDialRecallInQueue][historyCatch]');}else{ut['logCustomer'](_0x27cc22,0x16,_0x3ab7('0x97'));rpcDb[_0x3ab7('0x96')](_0x27cc22,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x27cc22,_0x3ab7('0x98'));}}}}})[_0x3ab7('0x8f')](ut[_0x3ab7('0x8d')](_0x3ab7('0x99')));};Preview[_0x3ab7('0xe')][_0x3ab7('0x6d')]=function(_0x114571){_0x114571[_0x3ab7('0x60')]=!![];if(ut[_0x3ab7('0x9a')](_0x114571[_0x3ab7('0x9b')])){_0x114571[_0x3ab7('0x62')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x114571[_0x3ab7('0x33')])){_0x114571[_0x3ab7('0x62')]=_0x3ab7('0x63');}else if(!this[_0x3ab7('0x9c')](_0x114571[_0x3ab7('0x55')])){if(!this['isTrunkReachable'](_0x114571[_0x3ab7('0x9d')])){_0x114571[_0x3ab7('0x62')]=_0x3ab7('0x9e');}else{_0x114571['message']='ACTIVE';}}else{_0x114571[_0x3ab7('0x62')]=_0x3ab7('0x9f');}emitCampaignPreview(_0x114571);};Preview[_0x3ab7('0xe')][_0x3ab7('0xa0')]=function(_0x205b12,_0xb18c72,_0x58b85f){var _0x51091a=this;var _0x278b0c=this[_0x3ab7('0x14')][_0xb18c72];var _0x99e0bb=this[_0x3ab7('0x11')][_0x278b0c[_0x3ab7('0x72')]];var _0x829812;if(_0x99e0bb){switch(_0x58b85f){case'1':_0x99e0bb[_0x3ab7('0xa1')]+=0x1;_0x278b0c[_0x3ab7('0xa2')]=ut[_0x3ab7('0xa3')](_0x278b0c);ut[_0x3ab7('0x93')](_0x278b0c,0x0,_0x3ab7('0xa4'));rpcDb[_0x3ab7('0x96')](_0x278b0c,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x3ab7('0xa3')](_0x278b0c)>=_0x99e0bb[_0x3ab7('0xa5')]){_0x829812=ut[_0x3ab7('0xa6')](_0x278b0c,0xf,'Global');rpcDb[_0x3ab7('0xa7')](_0x829812,_0x3ab7('0xa8'));}else{rpcDb[_0x3ab7('0xa7')](_0x278b0c,_0x3ab7('0xa8'));}delete this['actions'][_0x205b12[_0x3ab7('0xa9')]];break;case _0x3ab7('0xaa'):var _0x166327=moment()['format'](_0x3ab7('0x92'));_0x278b0c[_0x3ab7('0xab')]=_0x166327;_0x278b0c['answertime']=_0x166327;_0x278b0c['dialAnswer']=!![];_0x99e0bb[_0x3ab7('0x2b')]+=0x1;logger[_0x3ab7('0x5c')](_0x3ab7('0xac'),_0x278b0c[_0x3ab7('0xad')],_0x3ab7('0xae'),_0x99e0bb['name'],_0x3ab7('0x74'),_0x99e0bb[_0x3ab7('0x2b')]);ami[_0x3ab7('0x26')]('custom:agentconnect',ut['buildObj'](_0x278b0c,'connect'));if(_0x99e0bb[_0x3ab7('0xaf')]){ami[_0x3ab7('0x26')](_0x3ab7('0xb0'),ut[_0x3ab7('0xb1')](_0x278b0c));}break;case'16':ami[_0x3ab7('0x26')]('custom:agentcomplete',ut['buildObj'](_0x278b0c,'complete'));emitVoiceQueueChannelRemove(ut[_0x3ab7('0xb2')](_0x278b0c,_0x3ab7('0xb3')));_0x99e0bb[_0x3ab7('0xb4')]+=0x1;_0x99e0bb[_0x3ab7('0xb5')]+=0x1;_0x99e0bb[_0x3ab7('0x2a')]+=0x1;ut[_0x3ab7('0x7f')](_0x99e0bb,_0x3ab7('0xb6'));_0x278b0c[_0x3ab7('0xa2')]=ut['totalGlobal'](_0x278b0c);ut[_0x3ab7('0x93')](_0x278b0c,0x4,_0x3ab7('0xb7'));rpcDb['createCustomerHistory'](_0x278b0c,_0x3ab7('0xb8'));rpcDb[_0x3ab7('0xa7')](_0x278b0c,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x278b0c);_0x99e0bb[_0x3ab7('0x2d')]+=_0x278b0c[_0x3ab7('0xb9')];_0x99e0bb[_0x3ab7('0x2c')]+=_0x278b0c[_0x3ab7('0xb9')];logger[_0x3ab7('0x5c')](_0x3ab7('0xba'),_0x278b0c[_0x3ab7('0xad')],_0x3ab7('0xae'),_0x99e0bb[_0x3ab7('0x28')],'pTalking:\x20',_0x99e0bb[_0x3ab7('0x2b')]);delete this[_0x3ab7('0x14')][_0x205b12[_0x3ab7('0xa9')]];break;case _0x3ab7('0xbb'):_0x99e0bb['outboundBusyCallsDay']+=0x1;_0x278b0c[_0x3ab7('0xbc')]+=0x1;_0x278b0c[_0x3ab7('0xa2')]=ut[_0x3ab7('0xa3')](_0x278b0c);ut[_0x3ab7('0x93')](_0x278b0c,0x5,_0x3ab7('0xbd'));rpcDb[_0x3ab7('0x96')](_0x278b0c,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x278b0c)>=_0x99e0bb[_0x3ab7('0xa5')]){_0x829812=ut[_0x3ab7('0xa6')](_0x278b0c,0xf,_0x3ab7('0xbe'));rpcDb[_0x3ab7('0xa7')](_0x829812,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x278b0c[_0x3ab7('0xbc')]>=_0x99e0bb[_0x3ab7('0xbf')]){rpcDb[_0x3ab7('0xa7')](_0x278b0c,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut[_0x3ab7('0xc0')](_0x278b0c,_0x3ab7('0xbc'),_0x99e0bb['dialBusyRetryFrequency']),_0x278b0c[_0x3ab7('0xc1')],_0x278b0c['activeContact']);}}break;case'NOANSWER':_0x99e0bb[_0x3ab7('0x3d')]+=0x1;_0x278b0c['countnoanswerretry']+=0x1;_0x278b0c[_0x3ab7('0xa2')]=ut[_0x3ab7('0xa3')](_0x278b0c);ut[_0x3ab7('0x93')](_0x278b0c,0x3,'NoAnswer');rpcDb['createCustomerHistory'](_0x278b0c,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x3ab7('0xa3')](_0x278b0c)>=_0x99e0bb['dialGlobalMaxRetry']){_0x829812=ut['cloneAction'](_0x278b0c,0xf,'Global');rpcDb[_0x3ab7('0xa7')](_0x829812,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x278b0c[_0x3ab7('0xc2')]>=_0x99e0bb['dialNoAnswerMaxRetry']){rpcDb[_0x3ab7('0xa7')](_0x278b0c,_0x3ab7('0xc3'));}else{rpcDb[_0x3ab7('0xc4')](ut[_0x3ab7('0xc0')](_0x278b0c,_0x3ab7('0xc2'),_0x99e0bb[_0x3ab7('0xc5')]),_0x278b0c['unlockAgent'],_0x278b0c[_0x3ab7('0xc6')]);}}break;case _0x3ab7('0xc7'):_0x99e0bb[_0x3ab7('0xc8')]+=0x1;_0x278b0c[_0x3ab7('0xc9')]+=0x1;_0x278b0c['countglobal']=ut[_0x3ab7('0xa3')](_0x278b0c);ut[_0x3ab7('0x93')](_0x278b0c,0x8,_0x3ab7('0xca'));rpcDb['createCustomerHistory'](_0x278b0c,_0x3ab7('0xcb'));if(ut[_0x3ab7('0xa3')](_0x278b0c)>=_0x99e0bb['dialGlobalMaxRetry']){_0x829812=ut[_0x3ab7('0xa6')](_0x278b0c,0xf,_0x3ab7('0xbe'));rpcDb[_0x3ab7('0xa7')](_0x829812,_0x3ab7('0xcc'));}else{if(_0x278b0c[_0x3ab7('0xc9')]>=_0x99e0bb['dialCongestionMaxRetry']){rpcDb[_0x3ab7('0xa7')](_0x278b0c,_0x3ab7('0xcb'));}else{rpcDb['rescheduleContact'](ut[_0x3ab7('0xc0')](_0x278b0c,_0x3ab7('0xc9'),_0x99e0bb[_0x3ab7('0xcd')]),_0x278b0c[_0x3ab7('0xc1')],_0x278b0c['activeContact']);}}break;case _0x3ab7('0xce'):_0x99e0bb[_0x3ab7('0x40')]+=0x1;_0x278b0c[_0x3ab7('0xa2')]=ut[_0x3ab7('0xa3')](_0x278b0c);ut['logCustomer'](_0x278b0c,0x14,_0x3ab7('0xcf'));rpcDb[_0x3ab7('0x96')](_0x278b0c,_0x3ab7('0xd0'));if(_0x278b0c[_0x3ab7('0xc1')]){rpcDb[_0x3ab7('0xd1')](_0x278b0c[_0x3ab7('0xd2')]);}if(_0x278b0c[_0x3ab7('0xc6')]){rpcDb[_0x3ab7('0x90')](_0x278b0c[_0x3ab7('0xd2')]);}break;default:if(_0x278b0c[_0x3ab7('0x75')]){ut[_0x3ab7('0x7f')](_0x99e0bb,_0x3ab7('0xd3'));ut[_0x3ab7('0x80')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x99e0bb['name'],_0x205b12);}_0x99e0bb['outboundUnknownCallsDay']+=0x1;_0x278b0c['countglobal']=ut[_0x3ab7('0xa3')](_0x278b0c);ut[_0x3ab7('0x93')](_0x278b0c,0xc,_0x205b12['cause-txt']||_0x205b12[_0x3ab7('0xd4')]);rpcDb['createCustomerHistory'](_0x278b0c,_0x3ab7('0xd5'));if(ut['totalGlobal'](_0x278b0c)>=_0x99e0bb[_0x3ab7('0xa5')]){_0x829812=ut['cloneAction'](_0x278b0c,0xf,_0x3ab7('0xbe'));rpcDb[_0x3ab7('0xa7')](_0x829812,_0x3ab7('0xd6'));}else{rpcDb[_0x3ab7('0xa7')](_0x278b0c,_0x3ab7('0xd6'));}delete this['actions'][_0x205b12[_0x3ab7('0xa9')]];}if(!(_0x278b0c['dialAnswer']&&_0x58b85f==='16')){ut[_0x3ab7('0x7d')](_0x99e0bb,_0x3ab7('0xd7'));logger[_0x3ab7('0x5c')](_0x3ab7('0xd8'),_0x278b0c['uniqueid'],_0x3ab7('0xae'),_0x99e0bb[_0x3ab7('0x28')],'originated:\x20',_0x99e0bb['originated']);}if(_0x58b85f!=='ANSWER'){delete this['actions'][_0x205b12['linkedid']];delete this[_0x3ab7('0x14')][_0x205b12[_0x3ab7('0xd9')]];}}};Preview['prototype'][_0x3ab7('0xda')]=function(_0x10b326,_0x7f7a65,_0x5111b2){if(_[_0x3ab7('0xdb')](_0x7f7a65)&&_0x3ab7('0xdc')!==typeof _0x7f7a65){return;}if(_['isUndefined'](_0x5111b2)&&_0x3ab7('0xdc')!==typeof _0x5111b2){return;}switch(_0x5111b2['reason']){case'0':ut[_0x3ab7('0xdd')](_0x10b326,0x0,'NoSuchNumber');rpcDb[_0x3ab7('0xde')](_0x10b326,_0x3ab7('0xdf'));break;case'3':ut[_0x3ab7('0xdd')](_0x10b326,0x3,_0x3ab7('0xe0'));rpcDb['createAgentHistory'](_0x10b326,_0x3ab7('0xe1'));break;case'5':ut['logAgent'](_0x10b326,0x5,_0x3ab7('0xbd'));rpcDb['createAgentHistory'](_0x10b326,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x3ab7('0xdd')](_0x10b326,0x8,_0x3ab7('0xca'));rpcDb['createAgentHistory'](_0x10b326,_0x3ab7('0xe2'));break;case'22':ut[_0x3ab7('0xdd')](_0x10b326,0x16,_0x3ab7('0xe3'));rpcDb[_0x3ab7('0xde')](_0x10b326,_0x3ab7('0xe4'));break;default:ut[_0x3ab7('0xdd')](_0x10b326,0xc,_0x5111b2[_0x3ab7('0xe5')]);rpcDb[_0x3ab7('0xde')](_0x10b326,_0x3ab7('0xe2'));}ut['updateOriginated'](_0x7f7a65,_0x3ab7('0xe6'));logger[_0x3ab7('0x5c')](_0x3ab7('0xe7'),_0x10b326['uniqueid'],_0x3ab7('0xae'),_0x7f7a65[_0x3ab7('0x28')],_0x3ab7('0x73'),_0x7f7a65[_0x3ab7('0x4e')]);delete this[_0x3ab7('0x14')][_0x10b326['uniqueid']];};Preview[_0x3ab7('0xe')][_0x3ab7('0xe8')]=function(_0x3b91af,_0x305ab8,_0xc10190,_0xc1af7f,_0x400c5a){var _0x63127b=this;return new BPromise(function(_0x5a5044,_0xa7520d){if(_[_0x3ab7('0x86')](_0x305ab8)||_[_0x3ab7('0x86')](_0x305ab8[_0x3ab7('0xe9')])||_['isNil'](_0x305ab8[_0x3ab7('0xe9')]['phone'])||_[_0x3ab7('0x86')](_0x305ab8[_0x3ab7('0x79')])){_0xa7520d(ut['message'](_0x3ab7('0xea'),_0xc1af7f,_0x400c5a));return;}var _0x32ecf9=uuid['v4']();var _0x323641=_0x63127b[_0x3ab7('0x11')][_0x305ab8['Queue']['name']];var _0x264298=_0xc10190?_0x63127b[_0x3ab7('0x15')][_0xc10190]['id']:undefined;_0x63127b[_0x3ab7('0x14')][_0x32ecf9]=new Action(_0x305ab8,_0x323641,_0x32ecf9,_0xc10190,_0x264298);var _0x31a945=_0x63127b[_0x3ab7('0x14')][_0x32ecf9];_0x31a945[_0x3ab7('0xc1')]=_0xc1af7f;_0x31a945['activeContact']=_0x400c5a;_0x31a945['lookAgent']=_0xc10190;if(_['isEmpty'](_0x3b91af)){_0x63127b['execCall'](_0x31a945,_0x323641,_0x305ab8,_0xc10190)[_0x3ab7('0x8c')](function(_0x392d4a){logger[_0x3ab7('0x5c')]('[Preview][execCall][success]',_0x3ab7('0xeb')+_0x31a945['queue']+_0x3ab7('0xec')+_0x31a945['idContact'],JSON[_0x3ab7('0x59')](_0x392d4a));ami[_0x3ab7('0x26')](_0x3ab7('0xed'),ut['buildObj'](_0x31a945,_0x3ab7('0xee')));_0x5a5044(ut[_0x3ab7('0x62')](_0x3ab7('0xef')));})['catch'](function(_0xb1dfab){ut[_0x3ab7('0x67')](_0x3ab7('0xf0'),_0xb1dfab);_0xa7520d(ut[_0x3ab7('0x62')](_0x3ab7('0xf1'),_0xc1af7f,_0x400c5a));});}else{_0x323641[_0x3ab7('0x39')]+=0x1;ut['logBlacklist'](_0x31a945);rpcDb[_0x3ab7('0xf2')](_0x31a945,_0x3ab7('0xf3'));delete _0x63127b[_0x3ab7('0x14')][_0x32ecf9];_0xa7520d(ut[_0x3ab7('0x62')](_0x3ab7('0xf4'),_0xc1af7f,_0x400c5a));}});};Preview['prototype'][_0x3ab7('0x9c')]=function(_0x484e44){return!_[_0x3ab7('0x86')](_0x484e44)&&!_['isNil'](_0x484e44['name'])&&!_['isNil'](_0x484e44[_0x3ab7('0x56')])&&_0x484e44[_0x3ab7('0x56')]&&!_[_0x3ab7('0x86')](this[_0x3ab7('0x13')][util['format'](_0x3ab7('0xf5'),_0x484e44[_0x3ab7('0x28')])])&&!_[_0x3ab7('0x86')](this[_0x3ab7('0x13')][util[_0x3ab7('0x5e')](_0x3ab7('0xf5'),_0x484e44['name'])][_0x3ab7('0xf6')])&&(this[_0x3ab7('0x13')][util['format'](_0x3ab7('0xf5'),_0x484e44['name'])][_0x3ab7('0xf6')]==='reachable'||this[_0x3ab7('0x13')][util[_0x3ab7('0x5e')](_0x3ab7('0xf5'),_0x484e44[_0x3ab7('0x28')])][_0x3ab7('0xf6')]===_0x3ab7('0xf7'));};Preview[_0x3ab7('0xe')][_0x3ab7('0x8b')]=function(_0x232f06,_0x56df3a){var _0x3e30c4=this;return new BPromise(function(_0x4b6593,_0x15694f){_0x3e30c4[_0x3ab7('0xf8')](_0x232f06,_0x56df3a)[_0x3ab7('0x8c')](function(_0x1288aa){_0x4b6593(_[_0x3ab7('0x76')](_0x1288aa,[_0x3ab7('0x62')]));})['catch'](function(_0x2f215f){if(_0x2f215f[_0x3ab7('0xf9')]){rpcDb[_0x3ab7('0xd1')](_0x232f06);}if(_0x2f215f[_0x3ab7('0x56')]){rpcDb[_0x3ab7('0x90')](_0x232f06);}_0x15694f(_['pick'](_0x2f215f,[_0x3ab7('0x62')]));});});};Preview[_0x3ab7('0xe')][_0x3ab7('0xf8')]=function(_0x3226a5,_0x31b4ee){var _0x1e6672=this;return new BPromise(function(_0x3e4f3a,_0x13df62){var _0xf05f76,_0x90d714;rpcDb['getContactPreview'](_0x3226a5)[_0x3ab7('0x8c')](function(_0x32bf40){if(!_[_0x3ab7('0x86')](_0x32bf40[0x0])){_0x90d714=_0x32bf40[0x0][_0x3ab7('0xfa')]?![]:!![];_0xf05f76=_0x32bf40[0x0][_0x3ab7('0xfa')]?!![]:![];_0xf05f76=_0x31b4ee?!![]:_0xf05f76;}var _0x3fda86=_0x1e6672[_0x3ab7('0xfb')](_0x32bf40);if(_0x3fda86[_0x3ab7('0xfc')]){rpcDb[_0x3ab7('0xfd')](_[_0x3ab7('0x76')](_0x32bf40[0x0],[_0x3ab7('0x79'),_0x3ab7('0xfe')]))['then'](function(_0x30b141){_0x1e6672[_0x3ab7('0xe8')](_0x30b141,_0x32bf40[0x0],_0x31b4ee,_0x90d714,_0xf05f76)[_0x3ab7('0x8c')](function(_0x500041){_0x3e4f3a(_0x500041);})['catch'](function(_0x49fa2c){_0x13df62(_0x49fa2c);});})['catch'](function(_0x5f23e0){ut[_0x3ab7('0x67')](_0x3ab7('0xff'),_0x5f23e0);_0x13df62(ut[_0x3ab7('0x62')](_0x3ab7('0x100'),_0x90d714,_0xf05f76));});}else{_0x13df62(ut[_0x3ab7('0x62')](_0x3fda86[_0x3ab7('0x62')],_0x90d714,_0xf05f76));}})['catch'](function(_0x2397b8){ut[_0x3ab7('0x67')](_0x3ab7('0x101'),_0x2397b8);_0x13df62(ut[_0x3ab7('0x62')](_0x3ab7('0x100'),![],!![]));});});};Preview[_0x3ab7('0xe')][_0x3ab7('0xfb')]=function(_0x16171a){if(_[_0x3ab7('0x86')](_0x16171a)||_[_0x3ab7('0x102')](_0x16171a)||!_[_0x3ab7('0x86')](_0x16171a[0x0][_0x3ab7('0x89')])&&_[_0x3ab7('0x86')](_0x16171a[0x0][_0x3ab7('0x89')][_0x3ab7('0x28')])){ut[_0x3ab7('0x67')](_0x3ab7('0x103'),_0x16171a);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x12dcb8=this[_0x3ab7('0x11')][_0x16171a[0x0][_0x3ab7('0x71')][_0x3ab7('0x28')]];_0x12dcb8[_0x3ab7('0x62')]=_0x3ab7('0x9f');if(_[_0x3ab7('0x86')](_0x12dcb8)){ut[_0x3ab7('0x67')](_0x3ab7('0x104'),_0x12dcb8);return{'isValid':![],'message':_0x3ab7('0x105')};}if(!this[_0x3ab7('0x9c')](_0x12dcb8[_0x3ab7('0x55')])){ut[_0x3ab7('0x67')](_0x3ab7('0x106'),_0x3ab7('0x107')+_0x12dcb8[_0x3ab7('0x28')]+_0x3ab7('0x108'));if(!this[_0x3ab7('0x9c')](_0x12dcb8[_0x3ab7('0x9d')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x12dcb8[_0x3ab7('0x28')]+_0x3ab7('0x109'));return{'isValid':![],'message':_0x3ab7('0x10a')};}}if(!ut[_0x3ab7('0x10b')](_0x12dcb8[_0x3ab7('0x33')])){ut['logger'](_0x3ab7('0x10c'),_0x12dcb8['name']+_0x3ab7('0x10d'));return{'isValid':![],'message':_0x3ab7('0x107')+_0x12dcb8[_0x3ab7('0x28')]+_0x3ab7('0x10d')};}return{'isValid':!![],'message':_0x3ab7('0x10e')};};Preview[_0x3ab7('0xe')][_0x3ab7('0x10f')]=function(_0x57740d,_0x475a50,_0x17a3cd,_0x28aabb){var _0x58c727=this;return new BPromise(function(_0x3a5a2a,_0x5a3310){var _0x268c0b=_0x57740d['uniqueid'];var _0x532b5e=_0x58c727[_0x3ab7('0x9c')](_0x475a50[_0x3ab7('0x55')])?util['format'](_0x3ab7('0x110'),_0x475a50[_0x3ab7('0x55')][_0x3ab7('0x28')],_[_0x3ab7('0x86')](_0x475a50['dialPrefix'])?'':_0x475a50[_0x3ab7('0x37')]['trim']()||'',_0x475a50[_0x3ab7('0x111')]>0x0?_0x17a3cd[_0x3ab7('0xe9')][_0x3ab7('0x112')][_0x3ab7('0x113')](_0x475a50[_0x3ab7('0x111')]):_0x17a3cd[_0x3ab7('0xe9')][_0x3ab7('0x112')]):util['format'](_0x3ab7('0x110'),_['isNil'](_0x475a50[_0x3ab7('0x9d')])?_0x475a50[_0x3ab7('0x55')][_0x3ab7('0x28')]:_0x475a50[_0x3ab7('0x9d')][_0x3ab7('0x28')],_['isNil'](_0x475a50[_0x3ab7('0x37')])?'':_0x475a50[_0x3ab7('0x37')][_0x3ab7('0x114')]()||'',_0x475a50['dialCutDigit']>0x0?_0x17a3cd[_0x3ab7('0xe9')]['phone']['substring'](_0x475a50[_0x3ab7('0x111')]):_0x17a3cd[_0x3ab7('0xe9')]['phone']);var _0x2f0375=_0x58c727['isTrunkReachable'](_0x475a50[_0x3ab7('0x55')])?ut[_0x3ab7('0x115')](_0x475a50[_0x3ab7('0x55')][_0x3ab7('0x57')],_0x475a50[_0x3ab7('0x35')],_0x475a50[_0x3ab7('0x116')]>0x0?ut[_0x3ab7('0x117')](_0x475a50[_0x3ab7('0x36')],_0x475a50[_0x3ab7('0x116')]):_0x475a50[_0x3ab7('0x36')]):ut[_0x3ab7('0x115')](_[_0x3ab7('0x86')](_0x475a50[_0x3ab7('0x9d')])?_0x475a50[_0x3ab7('0x55')][_0x3ab7('0x57')]:_0x475a50[_0x3ab7('0x9d')]['callerid'],_0x475a50[_0x3ab7('0x35')],_0x475a50[_0x3ab7('0x116')]>0x0?ut[_0x3ab7('0x117')](_0x475a50[_0x3ab7('0x36')],_0x475a50[_0x3ab7('0x116')]):_0x475a50[_0x3ab7('0x36')]);if(_0x2f0375){_0x57740d['originatecalleridname']=ut[_0x3ab7('0x118')](_0x2f0375);_0x57740d['originatecalleridnum']=ut[_0x3ab7('0x119')](_0x2f0375);}var _0x90745c=ut[_0x3ab7('0x11a')](_0x475a50,_0x17a3cd,_0x532b5e,_0x2f0375,_0x268c0b,_0x57740d);_[_0x3ab7('0x11b')](_0x57740d,ut[_0x3ab7('0x11c')](_0x90745c));_0x57740d[_0x3ab7('0x91')]=moment()['format'](_0x3ab7('0x92'));ami[_0x3ab7('0x7b')](ut[_0x3ab7('0x11d')](_0x57740d,_0x475a50,_0x90745c,_0x57740d[_0x3ab7('0xc6')],_0x28aabb))['then'](function(_0x2a6bb6){_0x475a50[_0x3ab7('0x4e')]+=0x1;logger[_0x3ab7('0x5c')](_0x3ab7('0x11e'),_0x268c0b,_0x3ab7('0xae'),_0x475a50[_0x3ab7('0x28')],_0x3ab7('0x73'),_0x475a50[_0x3ab7('0x4e')]);_0x3a5a2a(_0x2a6bb6);})[_0x3ab7('0x8f')](function(_0x3627b0){ut[_0x3ab7('0xdd')](_0x57740d,0xe,_0x3ab7('0x11f'));rpcDb[_0x3ab7('0xde')](_0x57740d,_0x3ab7('0x120'));_0x5a3310(_0x3627b0);});});};Preview[_0x3ab7('0xe')][_0x3ab7('0x121')]=function(_0x3811fb){if(this['actions'][_0x3811fb[_0x3ab7('0xa9')]]){this['actions'][_0x3811fb[_0x3ab7('0xa9')]][_0x3ab7('0x7c')]=_0x3811fb[_0x3ab7('0x7c')];}};Preview[_0x3ab7('0xe')][_0x3ab7('0x18')]=function(_0x479793){var _0x408480=this;var _0x500919=this[_0x3ab7('0x14')][_0x479793['actionid']];if(_0x500919){if(_0x500919[_0x3ab7('0x122')]&&this['agents'][_0x500919[_0x3ab7('0x122')]]){ut[_0x3ab7('0x123')](_0x500919,this[_0x3ab7('0x15')][_0x500919['lookAgent']][_0x3ab7('0x28')],this[_0x3ab7('0x15')][_0x500919[_0x3ab7('0x122')]]['id']);}var _0x1b4a64=_[_0x3ab7('0x124')](_0x500919);_0x1b4a64[_0x3ab7('0xab')]=moment()[_0x3ab7('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x59b5f3=_0x408480[_0x3ab7('0x11')][_0x500919[_0x3ab7('0x72')]];if(ut[_0x3ab7('0x125')](_0x479793[_0x3ab7('0x126')])){if(_0x500919[_0x3ab7('0xc1')]){rpcDb[_0x3ab7('0xd1')](_0x500919['idContact']);}if(_0x500919['activeContact']){rpcDb[_0x3ab7('0x90')](_0x500919[_0x3ab7('0xd2')]);}ami[_0x3ab7('0x26')](_0x3ab7('0x127'),ut[_0x3ab7('0xb2')](_0x500919,'rejected'));this['callProgressDetectingAgent'](_0x1b4a64,_0x59b5f3,_0x479793);}else{_0x500919[_0x3ab7('0x91')]=moment()[_0x3ab7('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x3ab7('0xdd')](_0x1b4a64,0x4,_0x3ab7('0xb7'));rpcDb[_0x3ab7('0xde')](_0x1b4a64,_0x3ab7('0x128'));}}};Preview[_0x3ab7('0xe')][_0x3ab7('0x1b')]=function(_0x5897d5){var _0x22a783=this;var _0x18cca2=this['actions'][_0x5897d5[_0x3ab7('0xa9')]];var _0x58cdda;if(_0x18cca2){_0x58cdda=this[_0x3ab7('0x11')][_0x18cca2[_0x3ab7('0x72')]];logger[_0x3ab7('0x5c')]('[syncHangup][talking]',_0x5897d5['linkedid'],'\x20Queue',_0x58cdda[_0x3ab7('0x28')],_0x3ab7('0x74'),_0x58cdda[_0x3ab7('0x2b')]);}if(this[_0x3ab7('0x14')][_0x5897d5['linkedid']]&&_0x5897d5['linkedid']!==_0x5897d5[_0x3ab7('0xad')]){if(_0x5897d5[_0x3ab7('0x129')]==='16'&&this[_0x3ab7('0x14')][_0x5897d5[_0x3ab7('0xa9')]][_0x3ab7('0x75')]){this[_0x3ab7('0xa0')](_0x5897d5,_0x5897d5[_0x3ab7('0xa9')],_0x5897d5[_0x3ab7('0x129')]);}else if(this[_0x3ab7('0x14')][_0x5897d5[_0x3ab7('0xa9')]][_0x3ab7('0x75')]){logger[_0x3ab7('0x5c')]('[syncHangup][talking][cause]',_0x5897d5[_0x3ab7('0xa9')],_0x5897d5['cause'],'\x20Queue',_0x58cdda['name'],_0x3ab7('0x74'),_0x58cdda[_0x3ab7('0x2b')]);this[_0x3ab7('0xa0')](_0x5897d5,_0x5897d5[_0x3ab7('0xa9')],_0x5897d5['cause']);}}else if(_0x18cca2&&_[_0x3ab7('0x86')](_0x18cca2[_0x3ab7('0x12a')])&&_0x58cdda[_0x3ab7('0x12b')]&&_0x5897d5[_0x3ab7('0xa9')]===_0x5897d5['uniqueid']&&_[_0x3ab7('0x86')](_0x5897d5[_0x3ab7('0xe5')])&&_0x5897d5[_0x3ab7('0x129')]==='16'&&_0x5897d5['channelstate']==='6'&&_[_0x3ab7('0xdb')](_0x18cca2[_0x3ab7('0x12c')])){if(_0x18cca2['unlockAgent']){rpcDb[_0x3ab7('0xd1')](_0x18cca2[_0x3ab7('0xd2')]);}if(_0x18cca2[_0x3ab7('0xc6')]){rpcDb[_0x3ab7('0x90')](_0x18cca2[_0x3ab7('0xd2')]);}_0x5897d5[_0x3ab7('0xe5')]='22';this['callProgressDetectingAgent'](_0x18cca2,_0x58cdda,_0x5897d5);}else if(_0x18cca2&&_0x18cca2[_0x3ab7('0x12c')]){if(_0x5897d5[_0x3ab7('0x129')]==='16'&&this[_0x3ab7('0x14')][_0x5897d5[_0x3ab7('0xa9')]][_0x3ab7('0x75')]){logger[_0x3ab7('0x5c')]('[syncHangup][talking][transfer]',_0x5897d5[_0x3ab7('0xa9')],_0x5897d5[_0x3ab7('0x129')],'\x20Queue',_0x58cdda[_0x3ab7('0x28')],_0x3ab7('0x74'),_0x58cdda[_0x3ab7('0x2b')]);this[_0x3ab7('0xa0')](_0x5897d5,_0x5897d5['linkedid'],_0x5897d5[_0x3ab7('0x129')]);}else if(this['actions'][_0x5897d5[_0x3ab7('0xa9')]][_0x3ab7('0x75')]){logger[_0x3ab7('0x5c')](_0x3ab7('0x12d'),_0x5897d5[_0x3ab7('0xa9')],_0x5897d5['cause'],_0x3ab7('0xae'),_0x58cdda[_0x3ab7('0x28')],'pTalking:\x20',_0x58cdda[_0x3ab7('0x2b')]);this[_0x3ab7('0xa0')](_0x5897d5,_0x5897d5[_0x3ab7('0xa9')],_0x5897d5['cause']);}}};Preview[_0x3ab7('0xe')][_0x3ab7('0x12e')]=function(_0x525345){if(this[_0x3ab7('0x14')][_0x525345[_0x3ab7('0xd9')]]&&_0x525345[_0x3ab7('0xd9')]!==_0x525345[_0x3ab7('0x12f')]){this[_0x3ab7('0xa0')](_0x525345,_0x525345[_0x3ab7('0xd9')],_0x525345[_0x3ab7('0xd4')]);}};Preview[_0x3ab7('0xe')][_0x3ab7('0x1d')]=function(_0x434a18){if(this[_0x3ab7('0x14')][_0x434a18[_0x3ab7('0xa9')]]&&_0x434a18[_0x3ab7('0xa9')]!==_0x434a18[_0x3ab7('0xad')]&&!this['actions'][_0x434a18[_0x3ab7('0xa9')]][_0x3ab7('0x75')]){if(_0x434a18[_0x3ab7('0x129')]==='1'){this[_0x3ab7('0xa0')](_0x434a18,_0x434a18[_0x3ab7('0xa9')],_0x434a18[_0x3ab7('0x129')]);}}};Preview['prototype'][_0x3ab7('0x130')]=function(_0x4f5951,_0x447b81,_0x54da3f){if(this[_0x3ab7('0x14')][_0x4f5951]){if(_[_0x3ab7('0x86')](this[_0x3ab7('0x14')][_0x4f5951]['variables'])){this[_0x3ab7('0x14')][_0x4f5951][_0x3ab7('0x131')]={};}this[_0x3ab7('0x14')][_0x4f5951][_0x3ab7('0x131')][_0x447b81]=_0x54da3f;}};Preview[_0x3ab7('0xe')][_0x3ab7('0x21')]=function(_0x484c00){try{if(!_[_0x3ab7('0x86')](_0x484c00)){if(ut[_0x3ab7('0x132')](_['keys'](_0x484c00[_0x3ab7('0x133')])[0x0])){this[_0x3ab7('0x130')](_0x484c00[_0x3ab7('0xad')],_[_0x3ab7('0x134')](_0x484c00[_0x3ab7('0x133')])[0x0],_0x484c00[_0x3ab7('0x135')]);}}}catch(_0x292d68){logger['error'](_0x3ab7('0x136'),util[_0x3ab7('0x137')](_0x292d68,{'showHidden':![],'depth':null}));}};Preview[_0x3ab7('0xe')][_0x3ab7('0x22')]=function(_0x456dff){if(_0x456dff){if(this[_0x3ab7('0x14')][_0x456dff[_0x3ab7('0x138')]]){this[_0x3ab7('0x14')][_0x456dff[_0x3ab7('0x138')]][_0x3ab7('0x12c')]=!![];}}};Preview[_0x3ab7('0xe')]['syncBlindTransfer']=function(_0x433786){if(_0x433786){if(this[_0x3ab7('0x14')][_0x433786['transfererlinkedid']]){this[_0x3ab7('0x14')][_0x433786[_0x3ab7('0x139')]]['transfer']=!![];}}};module[_0x3ab7('0x13a')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 9421eb3..5f8fdcc 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 _0x5292=['queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','holdtime','lastAssignedTo','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','then','createHistory','[createHistory]\x20','resolve','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x5292,0xf7));var _0x2529=function(_0x1cee55,_0xe75188){_0x1cee55=_0x1cee55-0x0;var _0x4f640a=_0x5292[_0x1cee55];return _0x4f640a;};'use strict';var util=require(_0x2529('0x0'));var BPromise=require(_0x2529('0x1'));var logger=require('../../../config/logger')(_0x2529('0x2'));var _=require('lodash');var cmHopper=require(_0x2529('0x3'));var cmHopperFinal=require(_0x2529('0x4'));var cmHopperHistory=require(_0x2529('0x5'));var cmHopperBlack=require(_0x2529('0x6'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x2529('0x7'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x4c9b4c){return function(_0x4e7a9e){logger[_0x2529('0x8')](_0x4c9b4c,util[_0x2529('0x9')](_0x4e7a9e,{'showHidden':![],'depth':null}));};}function create(_0x5bb8a1){return BPromise['resolve']()[_0x2529('0xa')](cmHopperHistory[_0x2529('0xb')](_0x5bb8a1))['catch'](loggerCatch(_0x2529('0xc')));}function createAgent(_0x44c8da){return BPromise[_0x2529('0xd')]()[_0x2529('0xa')](agentReportPreview[_0x2529('0xb')](_0x44c8da))[_0x2529('0xe')](loggerCatch(_0x2529('0xc')));}function moveContact(_0x1e38b8){return BPromise['resolve']()[_0x2529('0xa')](cmHopper[_0x2529('0xf')](_0x1e38b8,!![]))['catch'](loggerCatch(_0x2529('0x10')));}exports[_0x2529('0x11')]=function(_0x149692){return BPromise[_0x2529('0xd')]()[_0x2529('0xa')](cmHopperBlack[_0x2529('0x11')](_0x149692))[_0x2529('0xe')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x2529('0x12')]=function(_0x164dd7){return BPromise[_0x2529('0xd')]()[_0x2529('0xa')](cmHopper[_0x2529('0x12')](_0x164dd7))[_0x2529('0xe')](loggerCatch(_0x2529('0x13')));};exports[_0x2529('0xb')]=function(_0x574975,_0x163bf4){create(_0x574975)['catch'](loggerCatch(_0x163bf4));moveContact(_0x574975)[_0x2529('0xe')](loggerCatch(_0x163bf4));};exports[_0x2529('0x14')]=function(_0x89be58,_0x49aa27){createAgent(_0x89be58)['catch'](loggerCatch(_0x49aa27));};exports[_0x2529('0x15')]=function(_0x3e0be5,_0x41e530){create(_0x3e0be5)[_0x2529('0xe')](loggerCatch(_0x41e530));};exports[_0x2529('0x16')]=function(_0x556ec1,_0x428727){moveContact(_0x556ec1)[_0x2529('0xe')](loggerCatch(_0x428727));};exports[_0x2529('0x17')]=function(_0xeff5a6,_0x51a021,_0x1fa873){if(_0x51a021){_0xeff5a6[_0x2529('0x18')]=null;}if(_0x1fa873){_0xeff5a6[_0x2529('0x19')]=![];}return BPromise['resolve']()[_0x2529('0xa')](cmHopper[_0x2529('0x17')](_0xeff5a6))[_0x2529('0xe')](loggerCatch(_0x2529('0x1a')));};exports['countReScheduled']=function(_0x2736f6){return BPromise[_0x2529('0xd')]()[_0x2529('0xa')](cmHopper[_0x2529('0x1b')](_0x2736f6))[_0x2529('0xe')](loggerCatch(_0x2529('0x1c')));};exports['unlockContact']=function(_0x5539ef){return BPromise[_0x2529('0xd')]()[_0x2529('0xa')](cmHopper[_0x2529('0x1d')]({'UserId':null},_0x5539ef,0x1))[_0x2529('0xe')](loggerCatch(_0x2529('0x1e')));};exports[_0x2529('0x1f')]=function(_0x22ceec){return BPromise[_0x2529('0xd')]()[_0x2529('0xa')](cmHopper[_0x2529('0x1d')]({'active':![]},_0x22ceec,0x1))['catch'](loggerCatch(_0x2529('0x20')));};exports[_0x2529('0x21')]=function(_0x4dd0fb){var _0x1822ce={};_0x1822ce[_0x2529('0x22')]=_0x4dd0fb['type'];_0x1822ce[_0x2529('0x23')]=_0x4dd0fb[_0x2529('0x23')];_0x1822ce['calleridnum']=_0x4dd0fb[_0x2529('0x24')];_0x1822ce[_0x2529('0x25')]=_0x4dd0fb['calleridname'];_0x1822ce[_0x2529('0x26')]=_0x4dd0fb[_0x2529('0x26')];_0x1822ce[_0x2529('0x27')]=_0x4dd0fb[_0x2529('0x28')];_0x1822ce[_0x2529('0x29')]=_0x4dd0fb['answertime'];_0x1822ce[_0x2529('0x2a')]=0x1;_0x1822ce[_0x2529('0x2b')]=_0x4dd0fb[_0x2529('0x2c')];_0x1822ce[_0x2529('0x2d')]=_0x4dd0fb[_0x2529('0x2e')];_0x1822ce[_0x2529('0x2f')]=_0x2529('0x30');_0x1822ce['exten']='xcally-motion-preview';_0x1822ce[_0x2529('0x31')]=0x0;_0x1822ce['assigned']=0x1;_0x1822ce[_0x2529('0x32')]=_0x4dd0fb['membername'];_0x1822ce['queuecallerexitreason']='COMPLETED';return BPromise[_0x2529('0xd')]()[_0x2529('0xa')](voiceQueueReport[_0x2529('0x33')](_0x1822ce))['catch'](loggerCatch(_0x2529('0x34')));};exports['getContactRecallMe']=function(_0x585ab5,_0x4b3c15){return BPromise[_0x2529('0xd')]()[_0x2529('0xa')](cmHopper[_0x2529('0x35')](_0x585ab5,_0x4b3c15))[_0x2529('0xe')](loggerCatch(_0x2529('0x36')));};exports[_0x2529('0x37')]=function(_0x56d2d4){return BPromise[_0x2529('0xd')]()[_0x2529('0xa')](cmHopper[_0x2529('0x17')](_0x56d2d4,!![],!![]))[_0x2529('0xe')](loggerCatch(_0x2529('0x38')));}; \ No newline at end of file +var _0x032e=['disableContact','[activeContact]\x20','type','uniqueid','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','xcally-motion-preview','assigned','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20'];(function(_0x36436d,_0x20292c){var _0x34615d=function(_0x5447af){while(--_0x5447af){_0x36436d['push'](_0x36436d['shift']());}};_0x34615d(++_0x20292c);}(_0x032e,0x124));var _0xe032=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x032e[_0xae7c2f];return _0x5d7001;};'use strict';var util=require(_0xe032('0x0'));var BPromise=require('bluebird');var logger=require(_0xe032('0x1'))(_0xe032('0x2'));var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xe032('0x3'));var cmHopperHistory=require(_0xe032('0x4'));var cmHopperBlack=require(_0xe032('0x5'));var voiceQueueRt=require(_0xe032('0x6'));var agentReportPreview=require(_0xe032('0x7'));var voiceQueueReport=require(_0xe032('0x8'));function loggerCatch(_0x2ba8a0){return function(_0x33ad0b){logger[_0xe032('0x9')](_0x2ba8a0,util[_0xe032('0xa')](_0x33ad0b,{'showHidden':![],'depth':null}));};}function create(_0x3289b0){return BPromise[_0xe032('0xb')]()[_0xe032('0xc')](cmHopperHistory[_0xe032('0xd')](_0x3289b0))[_0xe032('0xe')](loggerCatch(_0xe032('0xf')));}function createAgent(_0x2dc9e5){return BPromise[_0xe032('0xb')]()['then'](agentReportPreview[_0xe032('0xd')](_0x2dc9e5))[_0xe032('0xe')](loggerCatch(_0xe032('0xf')));}function moveContact(_0x42e2ba){return BPromise[_0xe032('0xb')]()[_0xe032('0xc')](cmHopper[_0xe032('0x10')](_0x42e2ba,!![]))['catch'](loggerCatch(_0xe032('0x11')));}exports[_0xe032('0x12')]=function(_0x28c2b6){return BPromise[_0xe032('0xb')]()['then'](cmHopperBlack[_0xe032('0x12')](_0x28c2b6))[_0xe032('0xe')](loggerCatch(_0xe032('0x13')));};exports[_0xe032('0x14')]=function(_0x17b3aa){return BPromise[_0xe032('0xb')]()[_0xe032('0xc')](cmHopper['getContactPreview'](_0x17b3aa))[_0xe032('0xe')](loggerCatch(_0xe032('0x15')));};exports[_0xe032('0xd')]=function(_0x3b57d3,_0x1938c4){create(_0x3b57d3)[_0xe032('0xe')](loggerCatch(_0x1938c4));moveContact(_0x3b57d3)['catch'](loggerCatch(_0x1938c4));};exports[_0xe032('0x16')]=function(_0x25cedb,_0x1f9298){createAgent(_0x25cedb)[_0xe032('0xe')](loggerCatch(_0x1f9298));};exports[_0xe032('0x17')]=function(_0x5721ce,_0x4b644b){create(_0x5721ce)['catch'](loggerCatch(_0x4b644b));};exports[_0xe032('0x18')]=function(_0x505d8c,_0x46dc27){moveContact(_0x505d8c)[_0xe032('0xe')](loggerCatch(_0x46dc27));};exports[_0xe032('0x19')]=function(_0x2aa342,_0x288d91,_0x256f71){if(_0x288d91){_0x2aa342[_0xe032('0x1a')]=null;}if(_0x256f71){_0x2aa342['active']=![];}return BPromise[_0xe032('0xb')]()[_0xe032('0xc')](cmHopper[_0xe032('0x19')](_0x2aa342))[_0xe032('0xe')](loggerCatch(_0xe032('0x1b')));};exports[_0xe032('0x1c')]=function(_0x22831a){return BPromise[_0xe032('0xb')]()['then'](cmHopper['countReScheduled'](_0x22831a))['catch'](loggerCatch(_0xe032('0x1d')));};exports[_0xe032('0x1e')]=function(_0x302559){return BPromise[_0xe032('0xb')]()[_0xe032('0xc')](cmHopper[_0xe032('0x1e')]({'UserId':null},_0x302559,0x1))[_0xe032('0xe')](loggerCatch(_0xe032('0x1f')));};exports[_0xe032('0x20')]=function(_0x1ac20b){return BPromise['resolve']()[_0xe032('0xc')](cmHopper[_0xe032('0x1e')]({'active':![]},_0x1ac20b,0x1))[_0xe032('0xe')](loggerCatch(_0xe032('0x21')));};exports['crateCustomerReportQueue']=function(_0x5573e4){var _0x3e2575={};_0x3e2575[_0xe032('0x22')]=_0x5573e4[_0xe032('0x22')];_0x3e2575[_0xe032('0x23')]=_0x5573e4['uniqueid'];_0x3e2575['calleridnum']=_0x5573e4['calleridnum'];_0x3e2575[_0xe032('0x24')]=_0x5573e4[_0xe032('0x24')];_0x3e2575[_0xe032('0x25')]=_0x5573e4[_0xe032('0x25')];_0x3e2575['queuecallerjoinAt']=_0x5573e4[_0xe032('0x26')];_0x3e2575[_0xe032('0x27')]=_0x5573e4[_0xe032('0x26')];_0x3e2575[_0xe032('0x28')]=0x1;_0x3e2575[_0xe032('0x29')]=_0x5573e4['endtime'];_0x3e2575[_0xe032('0x2a')]=_0x5573e4[_0xe032('0x2b')];_0x3e2575[_0xe032('0x2c')]=_0xe032('0x2d');_0x3e2575['exten']=_0xe032('0x2e');_0x3e2575['holdtime']=0x0;_0x3e2575[_0xe032('0x2f')]=0x1;_0x3e2575['lastAssignedTo']=_0x5573e4[_0xe032('0x2b')];_0x3e2575['queuecallerexitreason']=_0xe032('0x30');return BPromise['resolve']()[_0xe032('0xc')](voiceQueueReport[_0xe032('0x31')](_0x3e2575))['catch'](loggerCatch(_0xe032('0x32')));};exports[_0xe032('0x33')]=function(_0x253558,_0x2620d2){return BPromise['resolve']()[_0xe032('0xc')](cmHopper['getContactRecallMe'](_0x253558,_0x2620d2))[_0xe032('0xe')](loggerCatch(_0xe032('0x34')));};exports['rescheduleContactInQueue']=function(_0x450ba4){return BPromise[_0xe032('0xb')]()['then'](cmHopper[_0xe032('0x19')](_0x450ba4,!![],!![]))[_0xe032('0xe')](loggerCatch(_0xe032('0x35')));}; \ 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 7b18ec7..ad00186 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 _0x6d34=['calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','ringtime','logLookAgent','UserId','talktime','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','channelAgent','from-sip','timeout','totalGlobal','cloneAction','clone','scheduledAt','active','scheduledat','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','not_inuse','reachable','getDiff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','membername','countbusyretry','countnoanswerretry','countglobal','callback','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-dialurl','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','match','util','lodash','moment','../../../../config/logger','env','127.0.0.1','milliseconds','diff','seconds','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname'];(function(_0x13cf27,_0x38a69d){var _0x547dab=function(_0x4aca88){while(--_0x4aca88){_0x13cf27['push'](_0x13cf27['shift']());}};_0x547dab(++_0x38a69d);}(_0x6d34,0xf7));var _0x46d3=function(_0xe50e23,_0x3106d8){_0xe50e23=_0xe50e23-0x0;var _0x29c617=_0x6d34[_0xe50e23];return _0x29c617;};'use strict';var util=require(_0x46d3('0x0'));var _=require(_0x46d3('0x1'));var moment=require(_0x46d3('0x2'));var logger=require(_0x46d3('0x3'))('preview');var ipAgi=process[_0x46d3('0x4')]['XCALLY_IP_AGI']||_0x46d3('0x5');function getSeconds(_0x194970,_0x3cf80a){var _0x4b4f65=moment(_0x194970)['milliseconds'](0x0);var _0x57dcc8=moment(_0x3cf80a)[_0x46d3('0x6')](0x0);return _0x4b4f65[_0x46d3('0x7')](_0x57dcc8,_0x46d3('0x8'));}exports['loggerCatch']=function(_0x735a93){return function(_0x30780a){logger[_0x46d3('0x9')](_0x735a93,util[_0x46d3('0xa')](_0x30780a,{'showHidden':![],'depth':null}));};};exports[_0x46d3('0xb')]=function(_0x16a192,_0x4abd6e){logger[_0x46d3('0xc')](_0x16a192,util['inspect'](_0x4abd6e,{'showHidden':![],'depth':null}));};exports[_0x46d3('0xd')]=function(_0x433acc,_0xce6013){logger[_0x46d3('0x9')](_0x433acc,util[_0x46d3('0xa')](_0xce6013,{'showHidden':![],'depth':null}));};exports[_0x46d3('0xe')]=function(_0x2fae06){return function(_0x55127b){logger['info'](_0x2fae06,util[_0x46d3('0xa')](_0x55127b,{'showHidden':![],'depth':null}));};};exports[_0x46d3('0xf')]=function(_0xb88399,_0x24de99,_0x214b5b){return{'message':_0xb88399,'unlock':_0x24de99,'active':_0x214b5b};};exports[_0x46d3('0x10')]=function(_0x2bd66d,_0xbbe4a7,_0x495fce){if(!_[_0x46d3('0x11')](_0x495fce)&&_0x46d3('0x12')===typeof _0x495fce&&!_[_0x46d3('0x13')](_0x495fce)){if(!_[_0x46d3('0x11')](_0xbbe4a7)&&_0x46d3('0x12')===typeof _0xbbe4a7&&!_['isEmpty'](_0xbbe4a7)){return util[_0x46d3('0x14')](_0x46d3('0x15'),_0xbbe4a7,_0x495fce);}return util['format']('\x22%s\x22\x20<%s>',_0x495fce,_0x495fce);}if(!_['isUndefined'](_0x2bd66d)&&_0x46d3('0x12')===typeof _0x2bd66d&&!_[_0x46d3('0x13')](_0x2bd66d)){return _0x2bd66d;}return _0x46d3('0x16');};exports[_0x46d3('0x17')]=function(_0xfc8cda){if(_[_0x46d3('0x18')](_0xfc8cda)){return![];}return _0xfc8cda;};exports[_0x46d3('0x19')]=function(_0xcdeb76,_0xea927,_0x16683b,_0x3b5d9d,_0x21edfb,_0x33aed4){var _0x567bbd={'XMD-QUEUE':_0xea927[_0x46d3('0x1a')]?_0xea927['Queue'][_0x46d3('0x1b')]:'','XMD-CALLERID':_0x3b5d9d,'XMD-CALLERID-PREVIEW':_0x33aed4?util[_0x46d3('0x14')](_0x46d3('0x15'),_0x33aed4[_0x46d3('0x1c')],_0x33aed4[_0x46d3('0x1d')]):_0x3b5d9d,'XMD-DIALID':_0x21edfb,'XMD-CONTACTID':_0xea927['ContactId'],'XMD-CDRTYPE':_0x46d3('0x1e'),'CALLERID(all)':_0x3b5d9d,'XMD-VOICEQUEUEID':_0xea927[_0x46d3('0x1f')],'XMD-DIALCHANNEL':_0x16683b,'XMD-DIALTIMEOUT':_0xcdeb76[_0x46d3('0x20')]||0x1e,'XMD-DIALOPTIONS':util[_0x46d3('0x14')](_0x46d3('0x21'),_0xcdeb76[_0x46d3('0x22')]?'g':'',_[_0x46d3('0x13')](_0xcdeb76['monitor_format'])?'':_0x46d3('0x23')),'XMD-DIALURL':_0xcdeb76[_0x46d3('0x24')]||'','XMD-AGI':_0xcdeb76['dialQueueProject']?util[_0x46d3('0x14')](_0x46d3('0x25'),ipAgi,_0xcdeb76[_0x46d3('0x26')]):_0x46d3('0x27'),'XMD-AGIAFTER':_0xcdeb76[_0x46d3('0x22')]?util[_0x46d3('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0xcdeb76[_0x46d3('0x22')]):_0x46d3('0x27'),'XMD-ORIGINATECALLERIDNUM':_0x33aed4?_0x33aed4[_0x46d3('0x28')]:'','XMD-ORIGINATECALLERIDNAME':_0x33aed4?_0x33aed4[_0x46d3('0x29')]:'','XMD-DESTINATION':_0x46d3('0x2a')};if(!_[_0x46d3('0x13')](_0xcdeb76[_0x46d3('0x2b')])){_0x567bbd[util[_0x46d3('0x14')]('%s',_0x46d3('0x2c'))]=_0xcdeb76[_0x46d3('0x2b')];_0x567bbd[util[_0x46d3('0x14')]('%s',_0x46d3('0x2d'))]=_0x21edfb;}if(_0xea927&&_0xea927[_0x46d3('0x2e')]){for(var _0x1c4e93 in _0xea927[_0x46d3('0x2e')]){if(_0xea927[_0x46d3('0x2e')][_0x46d3('0x2f')](_0x1c4e93)){if(!_['isNil'](_0xea927['Contact'][_0x1c4e93])&&_0x1c4e93!=='id'&&_0x1c4e93!==_0x46d3('0x30')&&_0x1c4e93!==_0x46d3('0x31')&&_0x1c4e93!==_0x46d3('0x32')){_0x567bbd[util['format'](_0x46d3('0x33'),_0x46d3('0x34'),_[_0x46d3('0x35')](_0x1c4e93))]=_0xea927[_0x46d3('0x2e')][_0x1c4e93];}}}}return _0x567bbd;};exports[_0x46d3('0x36')]=function(_0x5f5916){var _0x282192={};for(var _0x1b4ab6 in _0x5f5916){if(_0x5f5916[_0x46d3('0x2f')](_0x1b4ab6)){_0x282192[util['format']('%s',_[_0x46d3('0x37')](_0x1b4ab6))]=_0x5f5916[_0x1b4ab6];}}return{'variables':_0x282192};};exports[_0x46d3('0x38')]=function(_0x25c163,_0x3be4ca){if(!_['isNil'](_0x25c163)){if(_0x25c163[_0x46d3('0x2f')](_0x46d3('0x39'))){if(_0x25c163[_0x46d3('0x39')]>0x0){_0x25c163[_0x46d3('0x39')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x3be4ca);}}}else{logger[_0x46d3('0x9')](_0x46d3('0x3a'),_0x3be4ca);}};exports[_0x46d3('0x3b')]=function(_0x3cb1ab){var _0x554531=moment()[_0x46d3('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x3cb1ab['state']=0xd;_0x3cb1ab['statedesc']=_0x46d3('0x3c');_0x3cb1ab[_0x46d3('0x3d')]=_0x554531;_0x3cb1ab[_0x46d3('0x3e')]=_0x554531;_0x3cb1ab[_0x46d3('0x3f')]=_0x554531;};exports[_0x46d3('0x40')]=function(_0x55f302,_0x56bb7e,_0x3e99a3){var _0x17ba36=moment()[_0x46d3('0x14')](_0x46d3('0x41'));_0x55f302[_0x46d3('0x42')]=_0x56bb7e;_0x55f302[_0x46d3('0x43')]=_0x3e99a3;_0x55f302['responsetime']=_0x17ba36;_0x55f302[_0x46d3('0x44')]=getSeconds(_0x55f302[_0x46d3('0x3e')],_0x55f302['starttime']);};exports[_0x46d3('0x45')]=function(_0x1904fa,_0x273b1d,_0xb37db7){_0x1904fa['membername']=_0x273b1d;_0x1904fa[_0x46d3('0x46')]=_0xb37db7;};exports['logCustomer']=function(_0x206151,_0x24658f,_0x1bcb20){var _0x4508e5=moment()[_0x46d3('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x206151[_0x46d3('0x42')]=_0x24658f;_0x206151[_0x46d3('0x43')]=_0x1bcb20;_0x206151[_0x46d3('0x3e')]=_0x206151[_0x46d3('0x3e')]?_0x206151[_0x46d3('0x3e')]:_0x4508e5;_0x206151[_0x46d3('0x3f')]=_0x206151[_0x46d3('0x3f')]?_0x206151['endtime']:_0x4508e5;_0x206151[_0x46d3('0x44')]=getSeconds(_0x206151['responsetime']||0x0,_0x206151[_0x46d3('0x3d')]||0x0);_0x206151[_0x46d3('0x47')]=_0x206151[_0x46d3('0x48')]?getSeconds(_0x206151[_0x46d3('0x3f')],_0x206151['answertime']):0x0;};exports[_0x46d3('0x49')]=function(_0x51ec4c){return _0x51ec4c===_0x46d3('0x4a');};exports['variablesAction']=function(_0x167145,_0x186507,_0x1560ad,_0x25c79f,_0x2d9de3){var _0x585b24=_0x25c79f?_0x46d3('0x4b'):_0x167145[_0x46d3('0x1c')];_0x585b24=_0x2d9de3?_0x46d3('0x4c'):_0x585b24;return{'actionid':_0x167145[_0x46d3('0x4d')],'action':'originate','channel':_0x167145[_0x46d3('0x4e')],'callerid':util['format'](_0x46d3('0x15'),_0x585b24,_0x167145[_0x46d3('0x1d')]),'Exten':'xcally-motion-preview','Context':_0x46d3('0x4f'),'Priority':'1','variable':_0x1560ad,'timeout':(_0x186507[_0x46d3('0x50')]||0x1e)*0x3e8,'async':!![],'channelid':_0x167145[_0x46d3('0x4d')]};};exports[_0x46d3('0x51')]=function(_0x4c9678){return _0x4c9678['countbusyretry']+_0x4c9678['countcongestionretry']+_0x4c9678['countnoanswerretry'];};exports[_0x46d3('0x52')]=function(_0x1a59f4){var _0x54caf7=_[_0x46d3('0x53')](_0x1a59f4);_0x54caf7[_0x46d3('0x42')]=0xf;_0x54caf7[_0x46d3('0x43')]='Global';return _0x54caf7;};exports[_0x46d3('0x54')]=function(_0x111eb5,_0x5d14ee,_0x50dafd){var _0xb8046f={};_0xb8046f[_0x5d14ee]=_0x111eb5[_0x5d14ee];_0xb8046f[_0x46d3('0x55')]=![];_0xb8046f[_0x46d3('0x56')]=moment()['add'](_0x50dafd,_0x46d3('0x57'))['format'](_0x46d3('0x41'));_0xb8046f[_0x46d3('0x58')]=_0x111eb5['ContactId'];_0xb8046f['ListId']=_0x111eb5[_0x46d3('0x59')];_0xb8046f[_0x46d3('0x1f')]=_0x111eb5['VoiceQueueId']||undefined;return _0xb8046f;};exports[_0x46d3('0x5a')]=function(_0x5b0e01,_0x1f5e7f){if(!_['isNil'](_0x5b0e01)){if(_0x5b0e01[_0x46d3('0x5b')]>0x0){_0x5b0e01[_0x46d3('0x5b')]-=0x1;}else{logger[_0x46d3('0x9')](_0x1f5e7f,_0x46d3('0x5c'));}}else{logger[_0x46d3('0x9')](_0x1f5e7f,_0x46d3('0x5d'));}};exports['IsNotLoggedIn']=function(_0x2fd21b){if(_0x2fd21b<=0x0){return!![];}return![];};exports[_0x46d3('0x5e')]=function(_0x19b204,_0x2bce37){_0x19b204[_0x46d3('0x5f')]=_0x2bce37;_0x19b204[_0x46d3('0x1b')]=_0x19b204[_0x46d3('0x60')];_0x19b204['interface']=_0x19b204[_0x46d3('0x4e')];return _0x19b204;};exports['buildAcw']=function(_0xac77dd){var _0x2c1b5b={};_0x2c1b5b[_0x46d3('0x60')]=_0xac77dd['queue'];_0x2c1b5b[_0x46d3('0x61')]=_0xac77dd[_0x46d3('0x4e')];_0x2c1b5b['uniqueid']=_0xac77dd['uniqueid'];return _0x2c1b5b;};exports['agentReadyId']=function(_0x223997){var _0x1eee37=[];for(var _0x3ed5f1 in _0x223997){if(_0x223997['hasOwnProperty'](_0x3ed5f1)){if(!_[_0x46d3('0x18')](_0x223997[_0x3ed5f1])&&_0x223997[_0x3ed5f1][_0x46d3('0x42')]===_0x46d3('0x62')&&_0x223997[_0x3ed5f1]['status']===_0x46d3('0x63')){_0x1eee37['push'](_0x223997[_0x3ed5f1]['id']);}}}return _0x1eee37;};exports[_0x46d3('0x64')]=function(_0x441fbe){var _0x54ce31=moment()[_0x46d3('0x6')](0x0);var _0x12a7c5=moment(_0x441fbe)[_0x46d3('0x6')](0x0);return _0x54ce31[_0x46d3('0x7')](_0x12a7c5,_0x46d3('0x8'));};exports[_0x46d3('0x65')]=function(_0x1eb124){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1eb124[_0x46d3('0x58')],'ListId':_0x1eb124[_0x46d3('0x59')],'VoiceQueueId':_0x1eb124[_0x46d3('0x1f')]||undefined,'CampaignId':_0x1eb124[_0x46d3('0x66')]||undefined};};exports[_0x46d3('0x67')]=function(_0x488e12){if(_0x488e12==='uniqueid'||_0x488e12===_0x46d3('0x68')||_0x488e12===_0x46d3('0x60')||_0x488e12==='type'||_0x488e12===_0x46d3('0x69')||_0x488e12===_0x46d3('0x6a')||_0x488e12===_0x46d3('0x6b')||_0x488e12===_0x46d3('0x4e')||_0x488e12===_0x46d3('0x1c')||_0x488e12===_0x46d3('0x55')||_0x488e12===_0x46d3('0x1d')||_0x488e12===_0x46d3('0x56')||_0x488e12===_0x46d3('0x6c')||_0x488e12==='countcongestionretry'||_0x488e12===_0x46d3('0x6d')||_0x488e12===_0x46d3('0x6e')||_0x488e12===_0x46d3('0x6f')||_0x488e12==='callbackuniqueid'||_0x488e12==='callbackat'||_0x488e12===_0x46d3('0x70')||_0x488e12===_0x46d3('0x58')||_0x488e12==='ListId'||_0x488e12===_0x46d3('0x46')||_0x488e12===_0x46d3('0x1f')||_0x488e12===_0x46d3('0x71')||_0x488e12===_0x46d3('0x72')||_0x488e12==='xmd-queue'||_0x488e12===_0x46d3('0x73')||_0x488e12==='xmd-listid'||_0x488e12===_0x46d3('0x74')||_0x488e12==='xmd-dialtimeout'||_0x488e12==='xmd-dialoptions'||_0x488e12===_0x46d3('0x75')||_0x488e12===_0x46d3('0x76')||_0x488e12===_0x46d3('0x77')||_0x488e12===_0x46d3('0x78')||_0x488e12===_0x46d3('0x79')||_0x488e12===_0x46d3('0x7a')||_0x488e12==='xmd-agi'||_0x488e12==='rtpaudioqos'||_0x488e12===_0x46d3('0x7b')||_0x488e12==='rtpaudioqosjitter'||_0x488e12==='rtpaudioqosjitterbridged'||_0x488e12===_0x46d3('0x7c')||_0x488e12===_0x46d3('0x7d')||_0x488e12==='rtpaudioqosrtt'||_0x488e12===_0x46d3('0x7e')||_0x488e12===_0x46d3('0x7f')||_0x488e12===_0x46d3('0x7b')||_0x488e12===_0x46d3('0x80')||_0x488e12===_0x46d3('0x81')||_0x488e12===_0x46d3('0x7c')||_0x488e12===_0x46d3('0x7d')||_0x488e12===_0x46d3('0x82')||_0x488e12===_0x46d3('0x7e')||_0x488e12===_0x46d3('0x83')||_0x488e12===_0x46d3('0x84')||_0x488e12===_0x46d3('0x42')||_0x488e12===_0x46d3('0x43')){return![];}return!![];};exports[_0x46d3('0x85')]=function(_0x38fc6e,_0x2d2e06){var _0x1a87cb,_0x52bee6,_0x3c3b76;if(_0x2d2e06<=0x0){_0x2d2e06=0x1;}_0x1a87cb=new RegExp('\x5cw{0,'+_0x2d2e06+'}$');_0x52bee6=Math[_0x46d3('0x86')](0xa,_0x2d2e06-0x1);_0x3c3b76=Math[_0x46d3('0x86')](0xa,_0x2d2e06)-0x1;return util[_0x46d3('0x14')]('%s',_[_0x46d3('0x87')](_0x38fc6e,_0x1a87cb,_[_0x46d3('0x88')](_0x52bee6,_0x3c3b76)));};exports['extractCalleridName']=function(_0x1639be){var _0x3e792b=_0x1639be[_0x46d3('0x89')](/"(.*?)"/);return _0x3e792b?_0x3e792b[0x1]:_0x1639be;};exports['extractCalleridNumber']=function(_0x341ae1){var _0x1f975a=_0x341ae1['match'](/<(.*?)>/);return _0x1f975a?_0x1f975a[0x1]:_0x341ae1;}; \ No newline at end of file +var _0xa2ab=['membername','scheduledat','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','replace','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','error','logger','info','inspect','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','format','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','UserId','ringtime','talktime','answertime','isFailure','variablesAction','BOOKED','from-sip','timeout','totalGlobal','countbusyretry','countnoanswerretry','clone','Global','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','name','queue','channelAgent','interface','uniqueid','agentReadyId','status','reachable','push','createBody','CampaignId','filterKey','type','campaigntype'];(function(_0x4c2bfb,_0x4eb60d){var _0xa0931c=function(_0xf062e0){while(--_0xf062e0){_0x4c2bfb['push'](_0x4c2bfb['shift']());}};_0xa0931c(++_0x4eb60d);}(_0xa2ab,0xa7));var _0xba2a=function(_0x308c6a,_0xe04d64){_0x308c6a=_0x308c6a-0x0;var _0x257b4d=_0xa2ab[_0x308c6a];return _0x257b4d;};'use strict';var util=require(_0xba2a('0x0'));var _=require(_0xba2a('0x1'));var moment=require(_0xba2a('0x2'));var logger=require('../../../../config/logger')(_0xba2a('0x3'));var ipAgi=process[_0xba2a('0x4')][_0xba2a('0x5')]||_0xba2a('0x6');function getSeconds(_0x24423b,_0x1b27f8){var _0x7206ca=moment(_0x24423b)['milliseconds'](0x0);var _0x12f994=moment(_0x1b27f8)[_0xba2a('0x7')](0x0);return _0x7206ca[_0xba2a('0x8')](_0x12f994,'seconds');}exports[_0xba2a('0x9')]=function(_0xf818d1){return function(_0x2a40c6){logger[_0xba2a('0xa')](_0xf818d1,util['inspect'](_0x2a40c6,{'showHidden':![],'depth':null}));};};exports[_0xba2a('0xb')]=function(_0x43fa56,_0x2f4d3d){logger[_0xba2a('0xc')](_0x43fa56,util[_0xba2a('0xd')](_0x2f4d3d,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x463cb9,_0x114fb5){logger[_0xba2a('0xa')](_0x463cb9,util[_0xba2a('0xd')](_0x114fb5,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x93f663){return function(_0x10bf76){logger[_0xba2a('0xc')](_0x93f663,util[_0xba2a('0xd')](_0x10bf76,{'showHidden':![],'depth':null}));};};exports[_0xba2a('0xe')]=function(_0x4d4448,_0x8c98d,_0x44759c){return{'message':_0x4d4448,'unlock':_0x8c98d,'active':_0x44759c};};exports[_0xba2a('0xf')]=function(_0x127c42,_0x5352fa,_0x26ea93){if(!_[_0xba2a('0x10')](_0x26ea93)&&_0xba2a('0x11')===typeof _0x26ea93&&!_[_0xba2a('0x12')](_0x26ea93)){if(!_['isUndefined'](_0x5352fa)&&_0xba2a('0x11')===typeof _0x5352fa&&!_[_0xba2a('0x12')](_0x5352fa)){return util['format'](_0xba2a('0x13'),_0x5352fa,_0x26ea93);}return util['format']('\x22%s\x22\x20<%s>',_0x26ea93,_0x26ea93);}if(!_[_0xba2a('0x10')](_0x127c42)&&_0xba2a('0x11')===typeof _0x127c42&&!_[_0xba2a('0x12')](_0x127c42)){return _0x127c42;}return _0xba2a('0x14');};exports[_0xba2a('0x15')]=function(_0x5b4aa5){if(_[_0xba2a('0x16')](_0x5b4aa5)){return![];}return _0x5b4aa5;};exports[_0xba2a('0x17')]=function(_0x4d572d,_0x200e32,_0x5c9fb4,_0x3b3924,_0x2ad68,_0x3e7afa){var _0x1d4ba9={'XMD-QUEUE':_0x200e32[_0xba2a('0x18')]?_0x200e32[_0xba2a('0x18')]['name']:'','XMD-CALLERID':_0x3b3924,'XMD-CALLERID-PREVIEW':_0x3e7afa?util[_0xba2a('0x19')](_0xba2a('0x13'),_0x3e7afa[_0xba2a('0x1a')],_0x3e7afa[_0xba2a('0x1b')]):_0x3b3924,'XMD-DIALID':_0x2ad68,'XMD-CONTACTID':_0x200e32[_0xba2a('0x1c')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x3b3924,'XMD-VOICEQUEUEID':_0x200e32[_0xba2a('0x1d')],'XMD-DIALCHANNEL':_0x5c9fb4,'XMD-DIALTIMEOUT':_0x4d572d[_0xba2a('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0xba2a('0x19')](_0xba2a('0x1f'),_0x4d572d[_0xba2a('0x20')]?'g':'',_[_0xba2a('0x12')](_0x4d572d[_0xba2a('0x21')])?'':_0xba2a('0x22')),'XMD-DIALURL':_0x4d572d['dialPreviewUrl']||'','XMD-AGI':_0x4d572d[_0xba2a('0x23')]?util[_0xba2a('0x19')](_0xba2a('0x24'),ipAgi,_0x4d572d[_0xba2a('0x23')]):'NONE','XMD-AGIAFTER':_0x4d572d[_0xba2a('0x20')]?util[_0xba2a('0x19')](_0xba2a('0x24'),ipAgi,_0x4d572d['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x3e7afa?_0x3e7afa[_0xba2a('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x3e7afa?_0x3e7afa[_0xba2a('0x26')]:'','XMD-DESTINATION':_0xba2a('0x27')};if(!_[_0xba2a('0x12')](_0x4d572d[_0xba2a('0x21')])){_0x1d4ba9[util[_0xba2a('0x19')]('%s',_0xba2a('0x28'))]=_0x4d572d[_0xba2a('0x21')];_0x1d4ba9[util[_0xba2a('0x19')]('%s',_0xba2a('0x29'))]=_0x2ad68;}if(_0x200e32&&_0x200e32['Contact']){for(var _0x1bf866 in _0x200e32[_0xba2a('0x2a')]){if(_0x200e32[_0xba2a('0x2a')][_0xba2a('0x2b')](_0x1bf866)){if(!_['isNil'](_0x200e32[_0xba2a('0x2a')][_0x1bf866])&&_0x1bf866!=='id'&&_0x1bf866!==_0xba2a('0x2c')&&_0x1bf866!==_0xba2a('0x2d')&&_0x1bf866!=='updatedAt'){_0x1d4ba9[util[_0xba2a('0x19')](_0xba2a('0x2e'),_0xba2a('0x2f'),_[_0xba2a('0x30')](_0x1bf866))]=_0x200e32[_0xba2a('0x2a')][_0x1bf866];}}}}return _0x1d4ba9;};exports[_0xba2a('0x31')]=function(_0x1f4cb3){var _0x35f5d8={};for(var _0x52e0ef in _0x1f4cb3){if(_0x1f4cb3[_0xba2a('0x2b')](_0x52e0ef)){_0x35f5d8[util[_0xba2a('0x19')]('%s',_[_0xba2a('0x32')](_0x52e0ef))]=_0x1f4cb3[_0x52e0ef];}}return{'variables':_0x35f5d8};};exports[_0xba2a('0x33')]=function(_0x43b42c,_0x5afca4){if(!_[_0xba2a('0x16')](_0x43b42c)){if(_0x43b42c[_0xba2a('0x2b')](_0xba2a('0x34'))){if(_0x43b42c[_0xba2a('0x34')]>0x0){_0x43b42c['originated']-=0x1;}else{logger[_0xba2a('0xa')](_0xba2a('0x35'),_0x5afca4);}}}else{logger[_0xba2a('0xa')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x5afca4);}};exports[_0xba2a('0x36')]=function(_0x100d83){var _0x1c59e3=moment()['format'](_0xba2a('0x37'));_0x100d83[_0xba2a('0x38')]=0xd;_0x100d83[_0xba2a('0x39')]=_0xba2a('0x3a');_0x100d83[_0xba2a('0x3b')]=_0x1c59e3;_0x100d83[_0xba2a('0x3c')]=_0x1c59e3;_0x100d83[_0xba2a('0x3d')]=_0x1c59e3;};exports['logAgent']=function(_0x37e9fe,_0x4a5e29,_0x1c4c2a){var _0x380f30=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x37e9fe['state']=_0x4a5e29;_0x37e9fe['statedesc']=_0x1c4c2a;_0x37e9fe[_0xba2a('0x3c')]=_0x380f30;_0x37e9fe['ringtime']=getSeconds(_0x37e9fe[_0xba2a('0x3c')],_0x37e9fe[_0xba2a('0x3b')]);};exports['logLookAgent']=function(_0x3f0fb7,_0x35a9c1,_0x17e3b8){_0x3f0fb7['membername']=_0x35a9c1;_0x3f0fb7[_0xba2a('0x3e')]=_0x17e3b8;};exports['logCustomer']=function(_0x34fbfb,_0x34f7bb,_0x111fd5){var _0x5092c1=moment()[_0xba2a('0x19')](_0xba2a('0x37'));_0x34fbfb[_0xba2a('0x38')]=_0x34f7bb;_0x34fbfb['statedesc']=_0x111fd5;_0x34fbfb[_0xba2a('0x3c')]=_0x34fbfb[_0xba2a('0x3c')]?_0x34fbfb['responsetime']:_0x5092c1;_0x34fbfb[_0xba2a('0x3d')]=_0x34fbfb[_0xba2a('0x3d')]?_0x34fbfb[_0xba2a('0x3d')]:_0x5092c1;_0x34fbfb[_0xba2a('0x3f')]=getSeconds(_0x34fbfb[_0xba2a('0x3c')]||0x0,_0x34fbfb[_0xba2a('0x3b')]||0x0);_0x34fbfb[_0xba2a('0x40')]=_0x34fbfb[_0xba2a('0x41')]?getSeconds(_0x34fbfb[_0xba2a('0x3d')],_0x34fbfb['answertime']):0x0;};exports[_0xba2a('0x42')]=function(_0x2f1f82){return _0x2f1f82==='Failure';};exports[_0xba2a('0x43')]=function(_0x2ef089,_0x168b20,_0x403c1c,_0x51ff70,_0x5339f6){var _0x569ba6=_0x51ff70?'RECALL':_0x2ef089[_0xba2a('0x1a')];_0x569ba6=_0x5339f6?_0xba2a('0x44'):_0x569ba6;return{'actionid':_0x2ef089['uniqueid'],'action':'originate','channel':_0x2ef089['channelAgent'],'callerid':util[_0xba2a('0x19')](_0xba2a('0x13'),_0x569ba6,_0x2ef089['calleridnum']),'Exten':'xcally-motion-preview','Context':_0xba2a('0x45'),'Priority':'1','variable':_0x403c1c,'timeout':(_0x168b20[_0xba2a('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2ef089['uniqueid']};};exports[_0xba2a('0x47')]=function(_0x18879d){return _0x18879d[_0xba2a('0x48')]+_0x18879d['countcongestionretry']+_0x18879d[_0xba2a('0x49')];};exports['cloneAction']=function(_0x13ce56){var _0x574075=_[_0xba2a('0x4a')](_0x13ce56);_0x574075[_0xba2a('0x38')]=0xf;_0x574075[_0xba2a('0x39')]=_0xba2a('0x4b');return _0x574075;};exports[_0xba2a('0x4c')]=function(_0x1c06df,_0x5805a0,_0x46d4f8){var _0x5e7dbc={};_0x5e7dbc[_0x5805a0]=_0x1c06df[_0x5805a0];_0x5e7dbc[_0xba2a('0x4d')]=![];_0x5e7dbc['scheduledat']=moment()[_0xba2a('0x4e')](_0x46d4f8,_0xba2a('0x4f'))[_0xba2a('0x19')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e7dbc[_0xba2a('0x1c')]=_0x1c06df['ContactId'];_0x5e7dbc['ListId']=_0x1c06df[_0xba2a('0x50')];_0x5e7dbc['VoiceQueueId']=_0x1c06df['VoiceQueueId']||undefined;return _0x5e7dbc;};exports[_0xba2a('0x51')]=function(_0x4260a3,_0x4ed0a6){if(!_[_0xba2a('0x16')](_0x4260a3)){if(_0x4260a3[_0xba2a('0x52')]>0x0){_0x4260a3[_0xba2a('0x52')]-=0x1;}else{logger['error'](_0x4ed0a6,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xba2a('0xa')](_0x4ed0a6,_0xba2a('0x53'));}};exports[_0xba2a('0x54')]=function(_0x2e38a3){if(_0x2e38a3<=0x0){return!![];}return![];};exports[_0xba2a('0x55')]=function(_0x2c51d1,_0x88c057){_0x2c51d1[_0xba2a('0x56')]=_0x88c057;_0x2c51d1[_0xba2a('0x57')]=_0x2c51d1[_0xba2a('0x58')];_0x2c51d1['interface']=_0x2c51d1[_0xba2a('0x59')];return _0x2c51d1;};exports['buildAcw']=function(_0x3101fd){var _0x2f6f70={};_0x2f6f70['queue']=_0x3101fd[_0xba2a('0x58')];_0x2f6f70[_0xba2a('0x5a')]=_0x3101fd[_0xba2a('0x59')];_0x2f6f70[_0xba2a('0x5b')]=_0x3101fd[_0xba2a('0x5b')];return _0x2f6f70;};exports[_0xba2a('0x5c')]=function(_0x58a823){var _0x367c38=[];for(var _0x50afed in _0x58a823){if(_0x58a823[_0xba2a('0x2b')](_0x50afed)){if(!_[_0xba2a('0x16')](_0x58a823[_0x50afed])&&_0x58a823[_0x50afed][_0xba2a('0x38')]==='not_inuse'&&_0x58a823[_0x50afed][_0xba2a('0x5d')]===_0xba2a('0x5e')){_0x367c38[_0xba2a('0x5f')](_0x58a823[_0x50afed]['id']);}}}return _0x367c38;};exports['getDiff']=function(_0x5b9e4a){var _0x347d81=moment()[_0xba2a('0x7')](0x0);var _0x20c1ce=moment(_0x5b9e4a)[_0xba2a('0x7')](0x0);return _0x347d81[_0xba2a('0x8')](_0x20c1ce,'seconds');};exports[_0xba2a('0x60')]=function(_0x34324f){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x34324f[_0xba2a('0x1c')],'ListId':_0x34324f[_0xba2a('0x50')],'VoiceQueueId':_0x34324f['VoiceQueueId']||undefined,'CampaignId':_0x34324f[_0xba2a('0x61')]||undefined};};exports[_0xba2a('0x62')]=function(_0xabccb9){if(_0xabccb9===_0xba2a('0x5b')||_0xabccb9==='idContact'||_0xabccb9===_0xba2a('0x58')||_0xabccb9===_0xba2a('0x63')||_0xabccb9===_0xba2a('0x64')||_0xabccb9==='dialAnswer'||_0xabccb9===_0xba2a('0x65')||_0xabccb9===_0xba2a('0x59')||_0xabccb9===_0xba2a('0x1a')||_0xabccb9==='active'||_0xabccb9==='calleridnum'||_0xabccb9===_0xba2a('0x66')||_0xabccb9===_0xba2a('0x48')||_0xabccb9==='countcongestionretry'||_0xabccb9==='countnoanswerretry'||_0xabccb9===_0xba2a('0x67')||_0xabccb9===_0xba2a('0x68')||_0xabccb9===_0xba2a('0x69')||_0xabccb9==='callbackat'||_0xabccb9===_0xba2a('0x6a')||_0xabccb9===_0xba2a('0x1c')||_0xabccb9==='ListId'||_0xabccb9===_0xba2a('0x3e')||_0xabccb9==='VoiceQueueId'||_0xabccb9===_0xba2a('0x6b')||_0xabccb9===_0xba2a('0x6c')||_0xabccb9==='xmd-queue'||_0xabccb9===_0xba2a('0x6d')||_0xabccb9===_0xba2a('0x6e')||_0xabccb9===_0xba2a('0x6f')||_0xabccb9===_0xba2a('0x70')||_0xabccb9===_0xba2a('0x71')||_0xabccb9===_0xba2a('0x72')||_0xabccb9==='xmd-dialchannel'||_0xabccb9===_0xba2a('0x73')||_0xabccb9===_0xba2a('0x74')||_0xabccb9===_0xba2a('0x75')||_0xabccb9===_0xba2a('0x76')||_0xabccb9===_0xba2a('0x77')||_0xabccb9===_0xba2a('0x78')||_0xabccb9==='rtpaudioqosbridged'||_0xabccb9===_0xba2a('0x79')||_0xabccb9===_0xba2a('0x7a')||_0xabccb9===_0xba2a('0x7b')||_0xabccb9==='rtpaudioqoslossbridged'||_0xabccb9==='rtpaudioqosrtt'||_0xabccb9===_0xba2a('0x7c')||_0xabccb9===_0xba2a('0x78')||_0xabccb9==='rtpaudioqosbridged'||_0xabccb9===_0xba2a('0x79')||_0xabccb9===_0xba2a('0x7a')||_0xabccb9==='rtpaudioqosloss'||_0xabccb9===_0xba2a('0x7d')||_0xabccb9==='rtpaudioqosrtt'||_0xabccb9==='rtpaudioqosrttbridged'||_0xabccb9===_0xba2a('0x7e')||_0xabccb9===_0xba2a('0x7f')||_0xabccb9===_0xba2a('0x38')||_0xabccb9===_0xba2a('0x39')){return![];}return!![];};exports[_0xba2a('0x80')]=function(_0xd5d70b,_0xb6ae48){var _0x5e4617,_0x49384b,_0x346189;if(_0xb6ae48<=0x0){_0xb6ae48=0x1;}_0x5e4617=new RegExp(_0xba2a('0x81')+_0xb6ae48+'}$');_0x49384b=Math['pow'](0xa,_0xb6ae48-0x1);_0x346189=Math['pow'](0xa,_0xb6ae48)-0x1;return util['format']('%s',_[_0xba2a('0x82')](_0xd5d70b,_0x5e4617,_['random'](_0x49384b,_0x346189)));};exports[_0xba2a('0x83')]=function(_0x1e9a7f){var _0x2c2b21=_0x1e9a7f[_0xba2a('0x84')](/"(.*?)"/);return _0x2c2b21?_0x2c2b21[0x1]:_0x1e9a7f;};exports[_0xba2a('0x85')]=function(_0x42f43b){var _0x3de4c1=_0x42f43b['match'](/<(.*?)>/);return _0x3de4c1?_0x3de4c1[0x1]:_0x42f43b;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index cb82a0a..f70778c 100644 --- a/server/services/ami/properties.js +++ b/server/services/ami/properties.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x47e012,_0x1b5254){var _0x425974=function(_0x1d0b95){while(--_0x1d0b95){_0x47e012['push'](_0x47e012['shift']());}};_0x425974(++_0x1b5254);}(_0x5f2f,0x73));var _0xf5f2=function(_0x21c31a,_0x3aca6e){_0x21c31a=_0x21c31a-0x0;var _0x582df4=_0x5f2f[_0x21c31a];return _0x582df4;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x33963f,_0xbd6136){var _0xcbd5cf=function(_0xb02d5){while(--_0xb02d5){_0x33963f['push'](_0x33963f['shift']());}};_0xcbd5cf(++_0xbd6136);}(_0x5f2f,0x73));var _0xf5f2=function(_0xceac9f,_0x34b3f5){_0xceac9f=_0xceac9f-0x0;var _0x355aae=_0x5f2f[_0xceac9f];return _0x355aae;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 53cbe2e..5ed3e4e 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 _0xd501=['hasOwnProperty','format','isNil','interface','SIP/%s','name','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','outboundNoAnswerCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','unmanaged','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','seconds','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','initVoiceExtensions','initCampaignHopperHistory','exports','bluebird','util','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/salesforceAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','queueChannels','outboundChannels','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys'];(function(_0x1e86f4,_0x1e2df8){var _0x4da23d=function(_0x2d7881){while(--_0x2d7881){_0x1e86f4['push'](_0x1e86f4['shift']());}};_0x4da23d(++_0x1e2df8);}(_0xd501,0x180));var _0x1d50=function(_0x2cbc22,_0x5c5444){_0x2cbc22=_0x2cbc22-0x0;var _0x33c426=_0xd501[_0x2cbc22];return _0x33c426;};'use strict';var BPromise=require(_0x1d50('0x0'));var util=require(_0x1d50('0x1'));var _=require(_0x1d50('0x2'));var moment=require(_0x1d50('0x3'));var Agent=require(_0x1d50('0x4'));var Telephone=require('../model/telephone');var Trunk=require(_0x1d50('0x5'));var VoiceQueue=require(_0x1d50('0x6'));var Trigger=require(_0x1d50('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x1d50('0x8'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x1d50('0x9'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x1d50('0xa'));var VtigerAccount=require(_0x1d50('0xb'));var ServicenowAccount=require(_0x1d50('0xc'));var Dynamics365Account=require(_0x1d50('0xd'));var FreshsalesAccount=require(_0x1d50('0xe'));var FaxAccount=require(_0x1d50('0xf'));var Realtime=function(){this[_0x1d50('0x10')]={};this[_0x1d50('0x11')]={};this['trunks']={};this[_0x1d50('0x12')]={};this[_0x1d50('0x13')]={};this['campaigns']={};this[_0x1d50('0x14')]={};this[_0x1d50('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x1d50('0x16')]={};this['channels']={};this[_0x1d50('0x17')]={};this[_0x1d50('0x18')]={};this['timers']={};this['zendeskAccounts']={};this[_0x1d50('0x19')]={};this[_0x1d50('0x1a')]={};this[_0x1d50('0x1b')]={};this[_0x1d50('0x1c')]={};this[_0x1d50('0x1d')]={};this[_0x1d50('0x1e')]={};this[_0x1d50('0x1f')]={};this[_0x1d50('0x20')]={};this[_0x1d50('0x21')]={};this[_0x1d50('0x22')]={};};function freeIsNotKey(_0x4834b7,_0x27b230,_0xae9ef2){var _0x4dc0c9=_[_0x1d50('0x23')](_0x4834b7,function(_0x3b4479,_0x7fe16){return _0x3b4479[_0xae9ef2];});for(var _0x5e863c in _0x27b230){if(_0x27b230[_0x1d50('0x24')](_0x5e863c)){if(!_0x4dc0c9[_0x5e863c]){delete _0x27b230[_0x5e863c];}}}}function freeIsNotKeySip(_0x142475,_0x20c11e){var _0x52278d=_[_0x1d50('0x23')](_0x142475,function(_0x1dcf5d,_0x4b4d10){return util[_0x1d50('0x25')]('SIP/%s',_0x1dcf5d['name']);});for(var _0x3c4e4c in _0x20c11e){if(_0x20c11e[_0x1d50('0x24')](_0x3c4e4c)){if(!_0x52278d[_0x3c4e4c]){delete _0x20c11e[_0x3c4e4c];}}}}function freeIsNotKeyAgent(_0x1f8ecf,_0x1a3601){var _0x392750=_[_0x1d50('0x23')](_0x1f8ecf,function(_0x3fd9db,_0x14fccc){var _0x332d64=_[_0x1d50('0x26')](_0x3fd9db[_0x1d50('0x27')])?util[_0x1d50('0x25')](_0x1d50('0x28'),_0x3fd9db[_0x1d50('0x29')]):_0x3fd9db[_0x1d50('0x27')];return _0x332d64;});for(var _0x33f243 in _0x1a3601){if(_0x1a3601['hasOwnProperty'](_0x33f243)){if(!_0x392750[_0x33f243]){delete _0x1a3601[_0x33f243];}}}}function clearVoiceCallReports(_0x4cc74e){_0x4cc74e[_0x1d50('0x2a')]=0x0;_0x4cc74e[_0x1d50('0x2b')]=0x0;_0x4cc74e[_0x1d50('0x2c')]=0x0;_0x4cc74e[_0x1d50('0x2d')]=0x0;_0x4cc74e[_0x1d50('0x2e')]=0x0;}function clearCampaigns(_0xaaab4){if(!_[_0x1d50('0x2f')](_0xaaab4)){for(var _0x2138d2 in _0xaaab4){if(_0xaaab4[_0x1d50('0x24')](_0x2138d2)){_0xaaab4[_0x2138d2][_0x1d50('0x30')]=0x0;_0xaaab4[_0x2138d2][_0x1d50('0x31')]=0x0;}}}}function clearVoiceQueues(_0x1e1355){if(!_['isEmpty'](_0x1e1355)){for(var _0x4b4409 in _0x1e1355){if(_0x1e1355['hasOwnProperty'](_0x4b4409)){_0x1e1355[_0x4b4409][_0x1d50('0x2a')]=0x0;_0x1e1355[_0x4b4409][_0x1d50('0x2b')]=0x0;_0x1e1355[_0x4b4409]['unmanaged']=0x0;_0x1e1355[_0x4b4409][_0x1d50('0x32')]=0x0;_0x1e1355[_0x4b4409][_0x1d50('0x2c')]=0x0;_0x1e1355[_0x4b4409]['sumDuration']=0x0;_0x1e1355[_0x4b4409][_0x1d50('0x2e')]=0x0;_0x1e1355[_0x4b4409]['outboundAnswerAgiCallsDay']=0x0;_0x1e1355[_0x4b4409][_0x1d50('0x33')]=0x0;_0x1e1355[_0x4b4409]['outboundBusyCallsDay']=0x0;_0x1e1355[_0x4b4409]['outboundCongestionCallsDay']=0x0;_0x1e1355[_0x4b4409]['outboundNoSuchCallsDay']=0x0;_0x1e1355[_0x4b4409][_0x1d50('0x34')]=0x0;_0x1e1355[_0x4b4409]['outboundDropCallsDayTimeout']=0x0;_0x1e1355[_0x4b4409][_0x1d50('0x35')]=0x0;_0x1e1355[_0x4b4409][_0x1d50('0x36')]=0x0;_0x1e1355[_0x4b4409][_0x1d50('0x37')]=0x0;_0x1e1355[_0x4b4409][_0x1d50('0x38')]=0x0;_0x1e1355[_0x4b4409][_0x1d50('0x39')]=0x0;_0x1e1355[_0x4b4409][_0x1d50('0x3a')]=0x0;_0x1e1355[_0x4b4409][_0x1d50('0x3b')]=0x0;_0x1e1355[_0x4b4409][_0x1d50('0x3c')]=!![];}}}}Realtime[_0x1d50('0x3d')][_0x1d50('0x3e')]=function(_0x1df75f,_0x1e85b7){for(var _0xab88df in _0x1e85b7){if(_0x1df75f[_0x1d50('0x24')](_0xab88df)){_0x1df75f[_0xab88df]=_0x1e85b7[_0xab88df];}}};Realtime[_0x1d50('0x3d')][_0x1d50('0x3f')]=function(){var _0x2021a2=this;return function(_0x26da51){if(_0x26da51){freeIsNotKeyAgent(_0x26da51,_0x2021a2[_0x1d50('0x10')]);for(var _0x24f3c5=0x0,_0x486426={},_0x5558fe={};_0x24f3c5<_0x26da51[_0x1d50('0x40')];_0x24f3c5+=0x1){_0x486426=_0x26da51[_0x24f3c5];var _0x39bf3d=_['isNil'](_0x486426['interface'])?util[_0x1d50('0x25')]('SIP/%s',_0x486426['name']):_0x486426[_0x1d50('0x27')];if(_['isUndefined'](_0x2021a2['agents'][_0x39bf3d])){_0x2021a2['agents'][_0x39bf3d]=new Agent(_0x486426);}else{_0x2021a2[_0x1d50('0x3e')](_0x2021a2['agents'][_0x39bf3d],_0x486426);}}}return _0x2021a2[_0x1d50('0x10')];};};Realtime['prototype']['initTelephones']=function(){var _0x1b6742=this;return function(_0x4f6621){if(_0x4f6621){freeIsNotKeySip(_0x4f6621,_0x1b6742[_0x1d50('0x11')]);for(var _0x429c06=0x0,_0x44e71f={},_0x7f57={};_0x429c06<_0x4f6621['length'];_0x429c06+=0x1){_0x44e71f=_0x4f6621[_0x429c06];if(_[_0x1d50('0x41')](_0x1b6742[_0x1d50('0x11')][util[_0x1d50('0x25')](_0x1d50('0x28'),_0x44e71f[_0x1d50('0x29')])])){_0x1b6742[_0x1d50('0x11')][util['format'](_0x1d50('0x28'),_0x44e71f[_0x1d50('0x29')])]=new Telephone(_0x44e71f);}else{_0x1b6742['mergeFromDatabase'](_0x1b6742[_0x1d50('0x11')][util[_0x1d50('0x25')]('SIP/%s',_0x44e71f['name'])],_0x44e71f);}}}return _0x1b6742[_0x1d50('0x11')];};};Realtime[_0x1d50('0x3d')][_0x1d50('0x42')]=function(){var _0x18904e=this;return function(_0x30ba91){if(_0x30ba91){freeIsNotKeySip(_0x30ba91,_0x18904e['trunks']);for(var _0x2edb66=0x0,_0x23b052={},_0x222dcb={};_0x2edb66<_0x30ba91['length'];_0x2edb66+=0x1){_0x23b052=_0x30ba91[_0x2edb66];if(_['isUndefined'](_0x18904e[_0x1d50('0x43')][util[_0x1d50('0x25')]('SIP/%s',_0x23b052[_0x1d50('0x29')])])){_0x18904e[_0x1d50('0x43')][util[_0x1d50('0x25')](_0x1d50('0x28'),_0x23b052[_0x1d50('0x29')])]=new Trunk(_0x23b052);}else{_0x18904e[_0x1d50('0x3e')](_0x18904e[_0x1d50('0x43')][util[_0x1d50('0x25')](_0x1d50('0x28'),_0x23b052[_0x1d50('0x29')])],_0x23b052);}}}return _0x18904e['trunks'];};};Realtime['prototype'][_0x1d50('0x44')]=function(){var _0x46590a=this;return function(_0x52bdd7){if(_0x52bdd7){freeIsNotKey(_0x52bdd7,_0x46590a['voiceQueues'],_0x1d50('0x29'));for(var _0x724a6f=0x0,_0x672015={},_0x1a5009={};_0x724a6f<_0x52bdd7['length'];_0x724a6f+=0x1){_0x672015=_0x52bdd7[_0x724a6f];if(_[_0x1d50('0x41')](_0x46590a[_0x1d50('0x12')][_0x672015['name']])){_0x46590a[_0x1d50('0x12')][_0x672015['name']]=new VoiceQueue(_0x672015);}else{_0x46590a[_0x1d50('0x3e')](_0x46590a[_0x1d50('0x12')][_0x672015[_0x1d50('0x29')]],_0x672015);}}}return _0x46590a['voiceQueues'];};};Realtime['prototype'][_0x1d50('0x45')]=function(){var _0x11835a=this;return function(_0xcd5e02){if(_0xcd5e02){freeIsNotKey(_0xcd5e02,_0x11835a['triggers'],'id');for(var _0x75e84e=0x0,_0x2b1c75={},_0x1b7bd7={};_0x75e84e<_0xcd5e02['length'];_0x75e84e+=0x1){_0x2b1c75=_0xcd5e02[_0x75e84e];if(_[_0x1d50('0x41')](_0x11835a[_0x1d50('0x13')][_0x2b1c75['id']])){_0x11835a['triggers'][_0x2b1c75['id']]=new Trigger(_0x2b1c75);}else{_0x11835a[_0x1d50('0x3e')](_0x11835a[_0x1d50('0x13')][_0x2b1c75['id']],_0x2b1c75);}}}return _0x11835a[_0x1d50('0x13')];};};Realtime[_0x1d50('0x3d')][_0x1d50('0x46')]=function(){var _0x27391a=this;return function(_0x362dd7){if(_0x362dd7){freeIsNotKey(_0x362dd7,_0x27391a['templates'],'id');for(var _0x2c90e3=0x0,_0x264018={},_0x392591={};_0x2c90e3<_0x362dd7['length'];_0x2c90e3+=0x1){_0x264018=_0x362dd7[_0x2c90e3];if(_[_0x1d50('0x41')](_0x27391a[_0x1d50('0x14')][_0x264018['id']])){_0x27391a[_0x1d50('0x14')][_0x264018['id']]=new Template(_0x264018);}else{_0x27391a[_0x1d50('0x3e')](_0x27391a[_0x1d50('0x14')][_0x264018['id']],_0x264018);}}}return _0x27391a[_0x1d50('0x14')];};};Realtime[_0x1d50('0x3d')][_0x1d50('0x47')]=function(){var _0x4b6359=this;return function(_0x56d60c){if(_0x56d60c){freeIsNotKey(_0x56d60c,_0x4b6359[_0x1d50('0x48')],'id');for(var _0xb93bef=0x0,_0x57038b={},_0x3f201e={};_0xb93bef<_0x56d60c[_0x1d50('0x40')];_0xb93bef+=0x1){_0x57038b=_0x56d60c[_0xb93bef];if(_[_0x1d50('0x41')](_0x4b6359[_0x1d50('0x48')][_0x57038b['id']])){_0x4b6359['zendeskAccounts'][_0x57038b['id']]=new ZendeskAccount(_0x57038b);}else{_0x4b6359[_0x1d50('0x3e')](_0x4b6359[_0x1d50('0x48')][_0x57038b['id']],_0x57038b);}}}return _0x4b6359[_0x1d50('0x48')];};};Realtime['prototype'][_0x1d50('0x49')]=function(){var _0x269c08=this;return function(_0x41c80f){if(_0x41c80f){freeIsNotKey(_0x41c80f,_0x269c08[_0x1d50('0x19')],'id');for(var _0x12e3d2=0x0,_0x30f8c8={},_0x27ea3f={};_0x12e3d2<_0x41c80f[_0x1d50('0x40')];_0x12e3d2+=0x1){_0x30f8c8=_0x41c80f[_0x12e3d2];if(_[_0x1d50('0x41')](_0x269c08[_0x1d50('0x19')][_0x30f8c8['id']])){_0x269c08['salesforceAccounts'][_0x30f8c8['id']]=new SalesforceAccount(_0x30f8c8);}else{_0x269c08[_0x1d50('0x3e')](_0x269c08[_0x1d50('0x19')][_0x30f8c8['id']],_0x30f8c8);}}}return _0x269c08[_0x1d50('0x19')];};};Realtime[_0x1d50('0x3d')][_0x1d50('0x4a')]=function(){var _0x11a55f=this;return function(_0x3e44d2){if(_0x3e44d2){freeIsNotKey(_0x3e44d2,_0x11a55f[_0x1d50('0x1b')],'id');for(var _0x537772=0x0,_0x9e2423={},_0x320f90={};_0x537772<_0x3e44d2[_0x1d50('0x40')];_0x537772+=0x1){_0x9e2423=_0x3e44d2[_0x537772];if(_['isUndefined'](_0x11a55f[_0x1d50('0x1b')][_0x9e2423['id']])){_0x11a55f[_0x1d50('0x1b')][_0x9e2423['id']]=new FreshdeskAccount(_0x9e2423);}else{_0x11a55f[_0x1d50('0x3e')](_0x11a55f[_0x1d50('0x1b')][_0x9e2423['id']],_0x9e2423);}}}return _0x11a55f[_0x1d50('0x1b')];};};Realtime['prototype'][_0x1d50('0x4b')]=function(){var _0x51d495=this;return function(_0x524c81){if(_0x524c81){freeIsNotKey(_0x524c81,_0x51d495[_0x1d50('0x1c')],'id');for(var _0x82ae5c=0x0,_0x25d478={},_0x375306={};_0x82ae5c<_0x524c81[_0x1d50('0x40')];_0x82ae5c+=0x1){_0x25d478=_0x524c81[_0x82ae5c];if(_['isUndefined'](_0x51d495[_0x1d50('0x1c')][_0x25d478['id']])){_0x51d495['zohoAccounts'][_0x25d478['id']]=new ZohoAccount(_0x25d478);}else{_0x51d495[_0x1d50('0x3e')](_0x51d495[_0x1d50('0x1c')][_0x25d478['id']],_0x25d478);}}}return _0x51d495[_0x1d50('0x1c')];};};Realtime[_0x1d50('0x3d')][_0x1d50('0x4c')]=function(){var _0x52da49=this;return function(_0x4aa551){if(_0x4aa551){freeIsNotKey(_0x4aa551,_0x52da49['deskAccounts'],'id');for(var _0x53041b=0x0,_0x3ff8a7={},_0x495db2={};_0x53041b<_0x4aa551[_0x1d50('0x40')];_0x53041b+=0x1){_0x3ff8a7=_0x4aa551[_0x53041b];if(_['isUndefined'](_0x52da49[_0x1d50('0x1d')][_0x3ff8a7['id']])){_0x52da49[_0x1d50('0x1d')][_0x3ff8a7['id']]=new DeskAccount(_0x3ff8a7);}else{_0x52da49[_0x1d50('0x3e')](_0x52da49['deskAccounts'][_0x3ff8a7['id']],_0x3ff8a7);}}}return _0x52da49[_0x1d50('0x1d')];};};Realtime[_0x1d50('0x3d')]['initSugarcrmAccounts']=function(){var _0x579b71=this;return function(_0x322050){if(_0x322050){freeIsNotKey(_0x322050,_0x579b71[_0x1d50('0x1a')],'id');for(var _0x4a0454=0x0,_0x4c7f8a={},_0x5c4959={};_0x4a0454<_0x322050['length'];_0x4a0454+=0x1){_0x4c7f8a=_0x322050[_0x4a0454];if(_[_0x1d50('0x41')](_0x579b71[_0x1d50('0x1a')][_0x4c7f8a['id']])){_0x579b71['sugarcrmAccounts'][_0x4c7f8a['id']]=new SugarcrmAccount(_0x4c7f8a);}else{_0x579b71[_0x1d50('0x3e')](_0x579b71['sugarcrmAccounts'][_0x4c7f8a['id']],_0x4c7f8a);}}}return _0x579b71[_0x1d50('0x1a')];};};Realtime[_0x1d50('0x3d')][_0x1d50('0x4d')]=function(){var _0x453ec8=this;return function(_0x5076df){if(_0x5076df){freeIsNotKey(_0x5076df,_0x453ec8[_0x1d50('0x1e')],'id');for(var _0x6749f6=0x0,_0x204ee4={},_0x1062e5={};_0x6749f6<_0x5076df['length'];_0x6749f6+=0x1){_0x204ee4=_0x5076df[_0x6749f6];if(_[_0x1d50('0x41')](_0x453ec8['vtigerAccounts'][_0x204ee4['id']])){_0x453ec8['vtigerAccounts'][_0x204ee4['id']]=new VtigerAccount(_0x204ee4);}else{_0x453ec8[_0x1d50('0x3e')](_0x453ec8[_0x1d50('0x1e')][_0x204ee4['id']],_0x204ee4);}}}return _0x453ec8[_0x1d50('0x1e')];};};Realtime[_0x1d50('0x3d')][_0x1d50('0x4e')]=function(){var _0x4d07bf=this;return function(_0x61a5c3){if(_0x61a5c3){freeIsNotKey(_0x61a5c3,_0x4d07bf[_0x1d50('0x1f')],'id');for(var _0x4934d4=0x0,_0x44bfb6={},_0x2d5bf6={};_0x4934d4<_0x61a5c3[_0x1d50('0x40')];_0x4934d4+=0x1){_0x44bfb6=_0x61a5c3[_0x4934d4];if(_[_0x1d50('0x41')](_0x4d07bf[_0x1d50('0x1f')][_0x44bfb6['id']])){_0x4d07bf[_0x1d50('0x1f')][_0x44bfb6['id']]=new ServicenowAccount(_0x44bfb6);}else{_0x4d07bf['mergeFromDatabase'](_0x4d07bf['servicenowAccounts'][_0x44bfb6['id']],_0x44bfb6);}}}return _0x4d07bf[_0x1d50('0x1f')];};};Realtime[_0x1d50('0x3d')][_0x1d50('0x4f')]=function(){var _0x7a0a91=this;return function(_0xf51e5){if(_0xf51e5){freeIsNotKey(_0xf51e5,_0x7a0a91[_0x1d50('0x20')],'id');for(var _0x9b4760=0x0,_0x496aaf={},_0x13cd25={};_0x9b4760<_0xf51e5[_0x1d50('0x40')];_0x9b4760+=0x1){_0x496aaf=_0xf51e5[_0x9b4760];if(_[_0x1d50('0x41')](_0x7a0a91[_0x1d50('0x20')][_0x496aaf['id']])){_0x7a0a91['dynamics365Accounts'][_0x496aaf['id']]=new Dynamics365Account(_0x496aaf);}else{_0x7a0a91['mergeFromDatabase'](_0x7a0a91[_0x1d50('0x20')][_0x496aaf['id']],_0x496aaf);}}}return _0x7a0a91[_0x1d50('0x20')];};};Realtime[_0x1d50('0x3d')][_0x1d50('0x50')]=function(){var _0x249432=this;return function(_0x166204){if(_0x166204){freeIsNotKey(_0x166204,_0x249432['freshsalesAccounts'],'id');for(var _0x583187=0x0,_0x4612ff={},_0x3cfbc7={};_0x583187<_0x166204[_0x1d50('0x40')];_0x583187+=0x1){_0x4612ff=_0x166204[_0x583187];if(_[_0x1d50('0x41')](_0x249432[_0x1d50('0x21')][_0x4612ff['id']])){_0x249432[_0x1d50('0x21')][_0x4612ff['id']]=new FreshsalesAccount(_0x4612ff);}else{_0x249432['mergeFromDatabase'](_0x249432[_0x1d50('0x21')][_0x4612ff['id']],_0x4612ff);}}}return _0x249432[_0x1d50('0x21')];};};Realtime[_0x1d50('0x3d')][_0x1d50('0x51')]=function(){var _0x5d29d9=this;return function(_0x82b508){for(var _0x47e6b9=0x0;_0x47e6b9<_0x82b508[_0x1d50('0x40')];_0x47e6b9+=0x1){_[_0x1d50('0x52')](_0x5d29d9[_0x1d50('0x12')][_0x82b508[_0x47e6b9][_0x1d50('0x29')]],_0x82b508[_0x47e6b9]);}return _0x5d29d9[_0x1d50('0x12')];};};Realtime[_0x1d50('0x3d')][_0x1d50('0x53')]=function(){var _0x165703=this;return function(_0x506d07){clearVoiceQueues(_0x165703[_0x1d50('0x12')]);if(_0x506d07){_0x506d07=_[_0x1d50('0x54')](_0x506d07,_0x1d50('0x55'));for(var _0x394e45 in _0x506d07){if(_0x506d07[_0x1d50('0x24')](_0x394e45)){var _0x275060={};for(var _0x3831dd=0x0;_0x3831dd<_0x506d07[_0x394e45][_0x1d50('0x40')];_0x3831dd+=0x1){var _0x597688=_0x506d07[_0x394e45][_0x3831dd][_0x1d50('0x56')];if(_0x165703[_0x1d50('0x12')][_0x597688]){if(_0x506d07[_0x394e45][_0x3831dd]['queuecallerexit']){_0x165703['voiceQueues'][_0x597688][_0x1d50('0x57')]+=0x1;}if(_0x506d07[_0x394e45][_0x3831dd]['queuecallerabandon']){_0x165703[_0x1d50('0x12')][_0x597688]['abandoned']+=0x1;}_0x165703[_0x1d50('0x12')][_0x597688][_0x1d50('0x2c')]+=moment(_0x506d07[_0x394e45][_0x3831dd][_0x1d50('0x58')])[_0x1d50('0x59')](moment(_0x506d07[_0x394e45][_0x3831dd][_0x1d50('0x5a')]),'seconds')||0x0;if(_0x3831dd===_0x506d07[_0x394e45][_0x1d50('0x40')]-0x1){_0x165703[_0x1d50('0x12')][_0x597688][_0x1d50('0x2d')]+=moment(_0x506d07[_0x394e45][_0x3831dd][_0x1d50('0x5b')]||_0x506d07[_0x394e45][_0x3831dd][_0x1d50('0x5c')]||_0x506d07[_0x394e45][_0x3831dd][_0x1d50('0x5d')])['diff'](moment(_0x506d07[_0x394e45][_0x3831dd][_0x1d50('0x5a')]),'seconds')||0x0;_0x165703['voiceQueues'][_0x597688][_0x1d50('0x2a')]+=0x1;if(_0x506d07[_0x394e45][_0x3831dd][_0x1d50('0x5e')]){_0x165703[_0x1d50('0x12')][_0x597688]['answered']+=0x1;_0x165703['voiceQueues'][_0x597688][_0x1d50('0x2e')]+=moment(_0x506d07[_0x394e45][_0x3831dd][_0x1d50('0x5b')])[_0x1d50('0x59')](moment(_0x506d07[_0x394e45][_0x3831dd][_0x1d50('0x58')]),_0x1d50('0x5f'))||0x0;}}else{_0x165703['voiceQueues'][_0x597688][_0x1d50('0x2d')]+=_0x165703[_0x1d50('0x12')][_0x597688][_0x1d50('0x2c')]||0x0;}}}}}}return _0x165703[_0x1d50('0x12')];};};Realtime[_0x1d50('0x3d')]['initVoiceCallReports']=function(){var _0x39d513=this;return function(_0x3ecd5c){clearVoiceCallReports(_0x39d513[_0x1d50('0x15')]);if(_0x3ecd5c){for(var _0x4ed106=0x0;_0x4ed106<_0x3ecd5c[_0x1d50('0x40')];_0x4ed106+=0x1){_0x39d513[_0x1d50('0x15')][_0x1d50('0x2a')]+=0x1;_0x39d513['outbound'][_0x1d50('0x2d')]+=_0x3ecd5c[_0x4ed106][_0x1d50('0x60')];if(_0x3ecd5c[_0x4ed106][_0x1d50('0x61')]===_0x1d50('0x62')){_0x39d513[_0x1d50('0x15')]['answered']+=0x1;_0x39d513[_0x1d50('0x15')][_0x1d50('0x2c')]+=_0x3ecd5c[_0x4ed106][_0x1d50('0x60')]-_0x3ecd5c[_0x4ed106]['billableseconds']||0x0;_0x39d513[_0x1d50('0x15')][_0x1d50('0x2e')]+=_0x3ecd5c[_0x4ed106][_0x1d50('0x63')];}}}return _0x39d513[_0x1d50('0x15')];};};Realtime[_0x1d50('0x3d')][_0x1d50('0x64')]=function(){var _0x2b6adc=this;return function(_0x50622e){if(_0x50622e){freeIsNotKey(_0x50622e,_0x2b6adc['campaigns'],'name');for(var _0x109bb8=0x0,_0x5e210f={};_0x109bb8<_0x50622e[_0x1d50('0x40')];_0x109bb8+=0x1){_0x5e210f=_0x50622e[_0x109bb8];if(_[_0x1d50('0x41')](_0x2b6adc[_0x1d50('0x65')][_0x5e210f[_0x1d50('0x29')]])){_0x2b6adc[_0x1d50('0x65')][_0x5e210f[_0x1d50('0x29')]]=new Campaign(_0x5e210f);}else{_0x2b6adc[_0x1d50('0x3e')](_0x2b6adc[_0x1d50('0x65')][_0x5e210f[_0x1d50('0x29')]],_0x5e210f);}}}return _0x2b6adc[_0x1d50('0x65')];};};Realtime['prototype'][_0x1d50('0x66')]=function(){var _0x292256=this;return function(_0x1bdd45){if(_0x1bdd45){freeIsNotKey(_0x1bdd45,_0x292256[_0x1d50('0x16')],'id');for(var _0x22531=0x0,_0x2f42fb={};_0x22531<_0x1bdd45['length'];_0x22531+=0x1){_0x2f42fb=_0x1bdd45[_0x22531];if(_[_0x1d50('0x41')](_0x292256[_0x1d50('0x16')][_0x2f42fb['id']])){_0x292256[_0x1d50('0x16')][_0x2f42fb['id']]=new VoiceExtension(_0x2f42fb);}else{_0x292256[_0x1d50('0x3e')](_0x292256[_0x1d50('0x16')][_0x2f42fb['id']],_0x2f42fb);}}}return _0x292256['voiceExtensions'];};};Realtime[_0x1d50('0x3d')][_0x1d50('0x67')]=function(){var _0x321890=this;return function(_0x475a16){clearCampaigns(_0x321890[_0x1d50('0x65')]);for(var _0x4ebc14=0x0;_0x4ebc14<_0x475a16[_0x1d50('0x40')];_0x4ebc14+=0x1){_[_0x1d50('0x52')](_0x321890[_0x1d50('0x65')][_0x475a16[_0x4ebc14][_0x1d50('0x29')]],_0x475a16[_0x4ebc14]);}return _0x321890[_0x1d50('0x65')];};};Realtime[_0x1d50('0x3d')]['initFaxAccounts']=function(){var _0x3e7d4e=this;return function(_0x37d35f){if(_0x37d35f){freeIsNotKey(_0x37d35f,_0x3e7d4e[_0x1d50('0x22')],'id');for(var _0x3fb855=0x0,_0x39f1e8={},_0x30433d={};_0x3fb855<_0x37d35f[_0x1d50('0x40')];_0x3fb855+=0x1){_0x39f1e8=_0x37d35f[_0x3fb855];if(_[_0x1d50('0x41')](_0x3e7d4e[_0x1d50('0x22')][_0x39f1e8['id']])){_0x3e7d4e[_0x1d50('0x22')][_0x39f1e8['id']]=new FaxAccount(_0x39f1e8);}else{_0x3e7d4e['mergeFromDatabase'](_0x3e7d4e['faxAccounts'][_0x39f1e8['id']],_0x39f1e8);}}}return _0x3e7d4e[_0x1d50('0x22')];};};module[_0x1d50('0x68')]=Realtime; \ No newline at end of file +var _0x54f8=['dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','abandoned','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','mergeFromDatabase','initTelephones','initTrunks','initVoiceQueues','initTriggers','templates','initZendeskAccounts','initSalesforceAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','freshsalesAccounts','merge','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','unmanaged','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','outbound','total','duration','disposition','billableseconds','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','lodash','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','voiceExtensions','queueChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','servicenowAccounts'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x54f8,0x1d4));var _0x854f=function(_0x549f5d,_0xdfab81){_0x549f5d=_0x549f5d-0x0;var _0xd55639=_0x54f8[_0x549f5d];return _0xd55639;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x854f('0x0'));var moment=require('moment');var Agent=require(_0x854f('0x1'));var Telephone=require(_0x854f('0x2'));var Trunk=require(_0x854f('0x3'));var VoiceQueue=require(_0x854f('0x4'));var Trigger=require(_0x854f('0x5'));var Template=require(_0x854f('0x6'));var Campaign=require(_0x854f('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x854f('0x8'));var SalesforceAccount=require(_0x854f('0x9'));var FreshdeskAccount=require(_0x854f('0xa'));var SugarcrmAccount=require(_0x854f('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x854f('0xc'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x854f('0xd'));var Dynamics365Account=require(_0x854f('0xe'));var FreshsalesAccount=require(_0x854f('0xf'));var FaxAccount=require(_0x854f('0x10'));var Realtime=function(){this[_0x854f('0x11')]={};this[_0x854f('0x12')]={};this[_0x854f('0x13')]={};this[_0x854f('0x14')]={};this[_0x854f('0x15')]={};this[_0x854f('0x16')]={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x854f('0x17')]={};this['channels']={};this[_0x854f('0x18')]={};this['outboundChannels']={};this[_0x854f('0x19')]={};this[_0x854f('0x1a')]={};this[_0x854f('0x1b')]={};this[_0x854f('0x1c')]={};this[_0x854f('0x1d')]={};this['zohoAccounts']={};this[_0x854f('0x1e')]={};this['vtigerAccounts']={};this[_0x854f('0x1f')]={};this[_0x854f('0x20')]={};this['freshsalesAccounts']={};this[_0x854f('0x21')]={};};function freeIsNotKey(_0x41e905,_0x2c3bf0,_0x36a0fb){var _0x1cad9e=_[_0x854f('0x22')](_0x41e905,function(_0x5bd6e6,_0x4fc2f1){return _0x5bd6e6[_0x36a0fb];});for(var _0x336330 in _0x2c3bf0){if(_0x2c3bf0[_0x854f('0x23')](_0x336330)){if(!_0x1cad9e[_0x336330]){delete _0x2c3bf0[_0x336330];}}}}function freeIsNotKeySip(_0x5179c9,_0x2dc751){var _0x13a1ac=_['mapKeys'](_0x5179c9,function(_0x3cec79,_0x3170fe){return util[_0x854f('0x24')](_0x854f('0x25'),_0x3cec79[_0x854f('0x26')]);});for(var _0x4c2e1e in _0x2dc751){if(_0x2dc751[_0x854f('0x23')](_0x4c2e1e)){if(!_0x13a1ac[_0x4c2e1e]){delete _0x2dc751[_0x4c2e1e];}}}}function freeIsNotKeyAgent(_0x36be51,_0x2ced07){var _0x4f41f0=_[_0x854f('0x22')](_0x36be51,function(_0xae17c3,_0x4512c4){var _0x214d76=_['isNil'](_0xae17c3['interface'])?util[_0x854f('0x24')]('SIP/%s',_0xae17c3['name']):_0xae17c3[_0x854f('0x27')];return _0x214d76;});for(var _0x201d61 in _0x2ced07){if(_0x2ced07[_0x854f('0x23')](_0x201d61)){if(!_0x4f41f0[_0x201d61]){delete _0x2ced07[_0x201d61];}}}}function clearVoiceCallReports(_0x26b7d2){_0x26b7d2['total']=0x0;_0x26b7d2[_0x854f('0x28')]=0x0;_0x26b7d2[_0x854f('0x29')]=0x0;_0x26b7d2[_0x854f('0x2a')]=0x0;_0x26b7d2[_0x854f('0x2b')]=0x0;}function clearCampaigns(_0x43a405){if(!_[_0x854f('0x2c')](_0x43a405)){for(var _0x1afeda in _0x43a405){if(_0x43a405[_0x854f('0x23')](_0x1afeda)){_0x43a405[_0x1afeda][_0x854f('0x2d')]=0x0;_0x43a405[_0x1afeda]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x497642){if(!_[_0x854f('0x2c')](_0x497642)){for(var _0xe0fd3a in _0x497642){if(_0x497642[_0x854f('0x23')](_0xe0fd3a)){_0x497642[_0xe0fd3a]['total']=0x0;_0x497642[_0xe0fd3a][_0x854f('0x28')]=0x0;_0x497642[_0xe0fd3a]['unmanaged']=0x0;_0x497642[_0xe0fd3a][_0x854f('0x2e')]=0x0;_0x497642[_0xe0fd3a][_0x854f('0x29')]=0x0;_0x497642[_0xe0fd3a][_0x854f('0x2a')]=0x0;_0x497642[_0xe0fd3a][_0x854f('0x2b')]=0x0;_0x497642[_0xe0fd3a]['outboundAnswerAgiCallsDay']=0x0;_0x497642[_0xe0fd3a]['outboundNoAnswerCallsDay']=0x0;_0x497642[_0xe0fd3a][_0x854f('0x2f')]=0x0;_0x497642[_0xe0fd3a][_0x854f('0x30')]=0x0;_0x497642[_0xe0fd3a]['outboundNoSuchCallsDay']=0x0;_0x497642[_0xe0fd3a]['outboundUnknownCallsDay']=0x0;_0x497642[_0xe0fd3a][_0x854f('0x31')]=0x0;_0x497642[_0xe0fd3a]['outboundDropCallsDayCallersExit']=0x0;_0x497642[_0xe0fd3a][_0x854f('0x32')]=0x0;_0x497642[_0xe0fd3a][_0x854f('0x33')]=0x0;_0x497642[_0xe0fd3a][_0x854f('0x34')]=0x0;_0x497642[_0xe0fd3a]['outboundReCallsDay']=0x0;_0x497642[_0xe0fd3a][_0x854f('0x35')]=0x0;_0x497642[_0xe0fd3a]['outboundAnswerCallsDay']=0x0;_0x497642[_0xe0fd3a][_0x854f('0x36')]=!![];}}}}Realtime[_0x854f('0x37')]['mergeFromDatabase']=function(_0x55efc4,_0x18bb1e){for(var _0x4b2261 in _0x18bb1e){if(_0x55efc4[_0x854f('0x23')](_0x4b2261)){_0x55efc4[_0x4b2261]=_0x18bb1e[_0x4b2261];}}};Realtime[_0x854f('0x37')]['initAgents']=function(){var _0x2012b5=this;return function(_0x9dca23){if(_0x9dca23){freeIsNotKeyAgent(_0x9dca23,_0x2012b5[_0x854f('0x11')]);for(var _0x47b9ea=0x0,_0x234529={},_0x4c15d8={};_0x47b9ea<_0x9dca23[_0x854f('0x38')];_0x47b9ea+=0x1){_0x234529=_0x9dca23[_0x47b9ea];var _0x558412=_[_0x854f('0x39')](_0x234529[_0x854f('0x27')])?util['format'](_0x854f('0x25'),_0x234529[_0x854f('0x26')]):_0x234529['interface'];if(_[_0x854f('0x3a')](_0x2012b5[_0x854f('0x11')][_0x558412])){_0x2012b5[_0x854f('0x11')][_0x558412]=new Agent(_0x234529);}else{_0x2012b5[_0x854f('0x3b')](_0x2012b5['agents'][_0x558412],_0x234529);}}}return _0x2012b5[_0x854f('0x11')];};};Realtime[_0x854f('0x37')][_0x854f('0x3c')]=function(){var _0x3be7dd=this;return function(_0x57e0b4){if(_0x57e0b4){freeIsNotKeySip(_0x57e0b4,_0x3be7dd[_0x854f('0x12')]);for(var _0x1bde81=0x0,_0xa7800d={},_0x4c6d03={};_0x1bde81<_0x57e0b4[_0x854f('0x38')];_0x1bde81+=0x1){_0xa7800d=_0x57e0b4[_0x1bde81];if(_[_0x854f('0x3a')](_0x3be7dd[_0x854f('0x12')][util['format']('SIP/%s',_0xa7800d['name'])])){_0x3be7dd['telephones'][util[_0x854f('0x24')](_0x854f('0x25'),_0xa7800d['name'])]=new Telephone(_0xa7800d);}else{_0x3be7dd[_0x854f('0x3b')](_0x3be7dd[_0x854f('0x12')][util[_0x854f('0x24')](_0x854f('0x25'),_0xa7800d[_0x854f('0x26')])],_0xa7800d);}}}return _0x3be7dd[_0x854f('0x12')];};};Realtime[_0x854f('0x37')][_0x854f('0x3d')]=function(){var _0x5d27ef=this;return function(_0x5b03b9){if(_0x5b03b9){freeIsNotKeySip(_0x5b03b9,_0x5d27ef[_0x854f('0x13')]);for(var _0x526149=0x0,_0x50dbfa={},_0x12e644={};_0x526149<_0x5b03b9[_0x854f('0x38')];_0x526149+=0x1){_0x50dbfa=_0x5b03b9[_0x526149];if(_[_0x854f('0x3a')](_0x5d27ef[_0x854f('0x13')][util[_0x854f('0x24')](_0x854f('0x25'),_0x50dbfa[_0x854f('0x26')])])){_0x5d27ef[_0x854f('0x13')][util['format'](_0x854f('0x25'),_0x50dbfa[_0x854f('0x26')])]=new Trunk(_0x50dbfa);}else{_0x5d27ef[_0x854f('0x3b')](_0x5d27ef[_0x854f('0x13')][util[_0x854f('0x24')]('SIP/%s',_0x50dbfa['name'])],_0x50dbfa);}}}return _0x5d27ef[_0x854f('0x13')];};};Realtime[_0x854f('0x37')][_0x854f('0x3e')]=function(){var _0x488ff2=this;return function(_0x25298f){if(_0x25298f){freeIsNotKey(_0x25298f,_0x488ff2[_0x854f('0x14')],_0x854f('0x26'));for(var _0x437878=0x0,_0x1b325a={},_0x29492b={};_0x437878<_0x25298f[_0x854f('0x38')];_0x437878+=0x1){_0x1b325a=_0x25298f[_0x437878];if(_[_0x854f('0x3a')](_0x488ff2[_0x854f('0x14')][_0x1b325a[_0x854f('0x26')]])){_0x488ff2[_0x854f('0x14')][_0x1b325a['name']]=new VoiceQueue(_0x1b325a);}else{_0x488ff2['mergeFromDatabase'](_0x488ff2[_0x854f('0x14')][_0x1b325a[_0x854f('0x26')]],_0x1b325a);}}}return _0x488ff2[_0x854f('0x14')];};};Realtime[_0x854f('0x37')][_0x854f('0x3f')]=function(){var _0x464da4=this;return function(_0x1c91ef){if(_0x1c91ef){freeIsNotKey(_0x1c91ef,_0x464da4['triggers'],'id');for(var _0x50bdd7=0x0,_0x4f42f9={},_0x509574={};_0x50bdd7<_0x1c91ef['length'];_0x50bdd7+=0x1){_0x4f42f9=_0x1c91ef[_0x50bdd7];if(_[_0x854f('0x3a')](_0x464da4[_0x854f('0x15')][_0x4f42f9['id']])){_0x464da4[_0x854f('0x15')][_0x4f42f9['id']]=new Trigger(_0x4f42f9);}else{_0x464da4[_0x854f('0x3b')](_0x464da4['triggers'][_0x4f42f9['id']],_0x4f42f9);}}}return _0x464da4[_0x854f('0x15')];};};Realtime[_0x854f('0x37')]['initTemplates']=function(){var _0x25af77=this;return function(_0x3f9cc5){if(_0x3f9cc5){freeIsNotKey(_0x3f9cc5,_0x25af77[_0x854f('0x40')],'id');for(var _0x51909d=0x0,_0x1b3165={},_0x306a77={};_0x51909d<_0x3f9cc5['length'];_0x51909d+=0x1){_0x1b3165=_0x3f9cc5[_0x51909d];if(_[_0x854f('0x3a')](_0x25af77[_0x854f('0x40')][_0x1b3165['id']])){_0x25af77[_0x854f('0x40')][_0x1b3165['id']]=new Template(_0x1b3165);}else{_0x25af77['mergeFromDatabase'](_0x25af77[_0x854f('0x40')][_0x1b3165['id']],_0x1b3165);}}}return _0x25af77['templates'];};};Realtime['prototype'][_0x854f('0x41')]=function(){var _0x5dea97=this;return function(_0x4d2a19){if(_0x4d2a19){freeIsNotKey(_0x4d2a19,_0x5dea97[_0x854f('0x1a')],'id');for(var _0x4672bd=0x0,_0x3a2ec1={},_0x4bb3ee={};_0x4672bd<_0x4d2a19[_0x854f('0x38')];_0x4672bd+=0x1){_0x3a2ec1=_0x4d2a19[_0x4672bd];if(_[_0x854f('0x3a')](_0x5dea97[_0x854f('0x1a')][_0x3a2ec1['id']])){_0x5dea97[_0x854f('0x1a')][_0x3a2ec1['id']]=new ZendeskAccount(_0x3a2ec1);}else{_0x5dea97[_0x854f('0x3b')](_0x5dea97[_0x854f('0x1a')][_0x3a2ec1['id']],_0x3a2ec1);}}}return _0x5dea97[_0x854f('0x1a')];};};Realtime[_0x854f('0x37')][_0x854f('0x42')]=function(){var _0x2f9cbe=this;return function(_0x4b8e6a){if(_0x4b8e6a){freeIsNotKey(_0x4b8e6a,_0x2f9cbe[_0x854f('0x1b')],'id');for(var _0x367de6=0x0,_0x44d824={},_0x3a56dc={};_0x367de6<_0x4b8e6a['length'];_0x367de6+=0x1){_0x44d824=_0x4b8e6a[_0x367de6];if(_[_0x854f('0x3a')](_0x2f9cbe['salesforceAccounts'][_0x44d824['id']])){_0x2f9cbe[_0x854f('0x1b')][_0x44d824['id']]=new SalesforceAccount(_0x44d824);}else{_0x2f9cbe[_0x854f('0x3b')](_0x2f9cbe['salesforceAccounts'][_0x44d824['id']],_0x44d824);}}}return _0x2f9cbe[_0x854f('0x1b')];};};Realtime[_0x854f('0x37')]['initFreshdeskAccounts']=function(){var _0x26e4f2=this;return function(_0x20ad72){if(_0x20ad72){freeIsNotKey(_0x20ad72,_0x26e4f2['freshdeskAccounts'],'id');for(var _0x4ebb59=0x0,_0x2b5146={},_0x17b8bd={};_0x4ebb59<_0x20ad72[_0x854f('0x38')];_0x4ebb59+=0x1){_0x2b5146=_0x20ad72[_0x4ebb59];if(_['isUndefined'](_0x26e4f2[_0x854f('0x1d')][_0x2b5146['id']])){_0x26e4f2[_0x854f('0x1d')][_0x2b5146['id']]=new FreshdeskAccount(_0x2b5146);}else{_0x26e4f2[_0x854f('0x3b')](_0x26e4f2[_0x854f('0x1d')][_0x2b5146['id']],_0x2b5146);}}}return _0x26e4f2[_0x854f('0x1d')];};};Realtime[_0x854f('0x37')]['initZohoAccounts']=function(){var _0x1fe379=this;return function(_0x44df96){if(_0x44df96){freeIsNotKey(_0x44df96,_0x1fe379[_0x854f('0x43')],'id');for(var _0x42a97d=0x0,_0x5a994b={},_0x42d60c={};_0x42a97d<_0x44df96[_0x854f('0x38')];_0x42a97d+=0x1){_0x5a994b=_0x44df96[_0x42a97d];if(_['isUndefined'](_0x1fe379[_0x854f('0x43')][_0x5a994b['id']])){_0x1fe379['zohoAccounts'][_0x5a994b['id']]=new ZohoAccount(_0x5a994b);}else{_0x1fe379['mergeFromDatabase'](_0x1fe379['zohoAccounts'][_0x5a994b['id']],_0x5a994b);}}}return _0x1fe379[_0x854f('0x43')];};};Realtime[_0x854f('0x37')][_0x854f('0x44')]=function(){var _0x54011f=this;return function(_0x970fb4){if(_0x970fb4){freeIsNotKey(_0x970fb4,_0x54011f[_0x854f('0x1e')],'id');for(var _0x487f8a=0x0,_0x173ac8={},_0x4a0e25={};_0x487f8a<_0x970fb4[_0x854f('0x38')];_0x487f8a+=0x1){_0x173ac8=_0x970fb4[_0x487f8a];if(_[_0x854f('0x3a')](_0x54011f[_0x854f('0x1e')][_0x173ac8['id']])){_0x54011f[_0x854f('0x1e')][_0x173ac8['id']]=new DeskAccount(_0x173ac8);}else{_0x54011f[_0x854f('0x3b')](_0x54011f['deskAccounts'][_0x173ac8['id']],_0x173ac8);}}}return _0x54011f[_0x854f('0x1e')];};};Realtime['prototype'][_0x854f('0x45')]=function(){var _0x485ef9=this;return function(_0x4c526d){if(_0x4c526d){freeIsNotKey(_0x4c526d,_0x485ef9['sugarcrmAccounts'],'id');for(var _0x4e3794=0x0,_0x7fdc37={},_0x5fa93f={};_0x4e3794<_0x4c526d[_0x854f('0x38')];_0x4e3794+=0x1){_0x7fdc37=_0x4c526d[_0x4e3794];if(_['isUndefined'](_0x485ef9[_0x854f('0x1c')][_0x7fdc37['id']])){_0x485ef9['sugarcrmAccounts'][_0x7fdc37['id']]=new SugarcrmAccount(_0x7fdc37);}else{_0x485ef9['mergeFromDatabase'](_0x485ef9[_0x854f('0x1c')][_0x7fdc37['id']],_0x7fdc37);}}}return _0x485ef9[_0x854f('0x1c')];};};Realtime[_0x854f('0x37')][_0x854f('0x46')]=function(){var _0x525884=this;return function(_0x1e9c72){if(_0x1e9c72){freeIsNotKey(_0x1e9c72,_0x525884[_0x854f('0x47')],'id');for(var _0x56e04d=0x0,_0x1da4be={},_0x36adb3={};_0x56e04d<_0x1e9c72[_0x854f('0x38')];_0x56e04d+=0x1){_0x1da4be=_0x1e9c72[_0x56e04d];if(_[_0x854f('0x3a')](_0x525884[_0x854f('0x47')][_0x1da4be['id']])){_0x525884[_0x854f('0x47')][_0x1da4be['id']]=new VtigerAccount(_0x1da4be);}else{_0x525884[_0x854f('0x3b')](_0x525884[_0x854f('0x47')][_0x1da4be['id']],_0x1da4be);}}}return _0x525884['vtigerAccounts'];};};Realtime[_0x854f('0x37')][_0x854f('0x48')]=function(){var _0xc8fd84=this;return function(_0x1b9c7e){if(_0x1b9c7e){freeIsNotKey(_0x1b9c7e,_0xc8fd84[_0x854f('0x1f')],'id');for(var _0x1c479d=0x0,_0xfe6bf3={},_0x579952={};_0x1c479d<_0x1b9c7e['length'];_0x1c479d+=0x1){_0xfe6bf3=_0x1b9c7e[_0x1c479d];if(_[_0x854f('0x3a')](_0xc8fd84[_0x854f('0x1f')][_0xfe6bf3['id']])){_0xc8fd84[_0x854f('0x1f')][_0xfe6bf3['id']]=new ServicenowAccount(_0xfe6bf3);}else{_0xc8fd84[_0x854f('0x3b')](_0xc8fd84[_0x854f('0x1f')][_0xfe6bf3['id']],_0xfe6bf3);}}}return _0xc8fd84[_0x854f('0x1f')];};};Realtime[_0x854f('0x37')][_0x854f('0x49')]=function(){var _0x4e9fe3=this;return function(_0x30d805){if(_0x30d805){freeIsNotKey(_0x30d805,_0x4e9fe3[_0x854f('0x20')],'id');for(var _0x228d58=0x0,_0x31328a={},_0x2b6b84={};_0x228d58<_0x30d805['length'];_0x228d58+=0x1){_0x31328a=_0x30d805[_0x228d58];if(_[_0x854f('0x3a')](_0x4e9fe3[_0x854f('0x20')][_0x31328a['id']])){_0x4e9fe3[_0x854f('0x20')][_0x31328a['id']]=new Dynamics365Account(_0x31328a);}else{_0x4e9fe3[_0x854f('0x3b')](_0x4e9fe3[_0x854f('0x20')][_0x31328a['id']],_0x31328a);}}}return _0x4e9fe3[_0x854f('0x20')];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x58f846=this;return function(_0x218c7a){if(_0x218c7a){freeIsNotKey(_0x218c7a,_0x58f846['freshsalesAccounts'],'id');for(var _0x4e15d4=0x0,_0x2a1823={},_0x362728={};_0x4e15d4<_0x218c7a[_0x854f('0x38')];_0x4e15d4+=0x1){_0x2a1823=_0x218c7a[_0x4e15d4];if(_[_0x854f('0x3a')](_0x58f846[_0x854f('0x4a')][_0x2a1823['id']])){_0x58f846[_0x854f('0x4a')][_0x2a1823['id']]=new FreshsalesAccount(_0x2a1823);}else{_0x58f846['mergeFromDatabase'](_0x58f846[_0x854f('0x4a')][_0x2a1823['id']],_0x2a1823);}}}return _0x58f846[_0x854f('0x4a')];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0xbb6042=this;return function(_0x5b6411){for(var _0x5117fa=0x0;_0x5117fa<_0x5b6411[_0x854f('0x38')];_0x5117fa+=0x1){_[_0x854f('0x4b')](_0xbb6042[_0x854f('0x14')][_0x5b6411[_0x5117fa][_0x854f('0x26')]],_0x5b6411[_0x5117fa]);}return _0xbb6042[_0x854f('0x14')];};};Realtime[_0x854f('0x37')][_0x854f('0x4c')]=function(){var _0x516ce3=this;return function(_0x2ae0bf){clearVoiceQueues(_0x516ce3[_0x854f('0x14')]);if(_0x2ae0bf){_0x2ae0bf=_[_0x854f('0x4d')](_0x2ae0bf,_0x854f('0x4e'));for(var _0x2cbc3a in _0x2ae0bf){if(_0x2ae0bf[_0x854f('0x23')](_0x2cbc3a)){var _0x1e106c={};for(var _0x15a442=0x0;_0x15a442<_0x2ae0bf[_0x2cbc3a][_0x854f('0x38')];_0x15a442+=0x1){var _0x2eaccb=_0x2ae0bf[_0x2cbc3a][_0x15a442]['queue'];if(_0x516ce3[_0x854f('0x14')][_0x2eaccb]){if(_0x2ae0bf[_0x2cbc3a][_0x15a442][_0x854f('0x4f')]){_0x516ce3[_0x854f('0x14')][_0x2eaccb][_0x854f('0x50')]+=0x1;}if(_0x2ae0bf[_0x2cbc3a][_0x15a442]['queuecallerabandon']){_0x516ce3[_0x854f('0x14')][_0x2eaccb][_0x854f('0x2e')]+=0x1;}_0x516ce3[_0x854f('0x14')][_0x2eaccb][_0x854f('0x29')]+=moment(_0x2ae0bf[_0x2cbc3a][_0x15a442][_0x854f('0x51')])[_0x854f('0x52')](moment(_0x2ae0bf[_0x2cbc3a][_0x15a442][_0x854f('0x53')]),_0x854f('0x54'))||0x0;if(_0x15a442===_0x2ae0bf[_0x2cbc3a][_0x854f('0x38')]-0x1){_0x516ce3[_0x854f('0x14')][_0x2eaccb][_0x854f('0x2a')]+=moment(_0x2ae0bf[_0x2cbc3a][_0x15a442]['queuecallercompleteAt']||_0x2ae0bf[_0x2cbc3a][_0x15a442][_0x854f('0x55')]||_0x2ae0bf[_0x2cbc3a][_0x15a442][_0x854f('0x56')])['diff'](moment(_0x2ae0bf[_0x2cbc3a][_0x15a442]['queuecallerjoinAt']),_0x854f('0x54'))||0x0;_0x516ce3[_0x854f('0x14')][_0x2eaccb]['total']+=0x1;if(_0x2ae0bf[_0x2cbc3a][_0x15a442][_0x854f('0x57')]){_0x516ce3[_0x854f('0x14')][_0x2eaccb][_0x854f('0x28')]+=0x1;_0x516ce3['voiceQueues'][_0x2eaccb][_0x854f('0x2b')]+=moment(_0x2ae0bf[_0x2cbc3a][_0x15a442][_0x854f('0x58')])[_0x854f('0x52')](moment(_0x2ae0bf[_0x2cbc3a][_0x15a442][_0x854f('0x51')]),'seconds')||0x0;}}else{_0x516ce3[_0x854f('0x14')][_0x2eaccb]['sumDuration']+=_0x516ce3[_0x854f('0x14')][_0x2eaccb][_0x854f('0x29')]||0x0;}}}}}}return _0x516ce3[_0x854f('0x14')];};};Realtime[_0x854f('0x37')][_0x854f('0x59')]=function(){var _0x3c0f6c=this;return function(_0x323f43){clearVoiceCallReports(_0x3c0f6c[_0x854f('0x5a')]);if(_0x323f43){for(var _0x46d692=0x0;_0x46d692<_0x323f43[_0x854f('0x38')];_0x46d692+=0x1){_0x3c0f6c[_0x854f('0x5a')][_0x854f('0x5b')]+=0x1;_0x3c0f6c[_0x854f('0x5a')]['sumDuration']+=_0x323f43[_0x46d692][_0x854f('0x5c')];if(_0x323f43[_0x46d692][_0x854f('0x5d')]==='ANSWERED'){_0x3c0f6c[_0x854f('0x5a')]['answered']+=0x1;_0x3c0f6c[_0x854f('0x5a')]['sumHoldTime']+=_0x323f43[_0x46d692]['duration']-_0x323f43[_0x46d692][_0x854f('0x5e')]||0x0;_0x3c0f6c[_0x854f('0x5a')]['sumBillable']+=_0x323f43[_0x46d692][_0x854f('0x5e')];}}}return _0x3c0f6c[_0x854f('0x5a')];};};Realtime[_0x854f('0x37')][_0x854f('0x5f')]=function(){var _0xa936d3=this;return function(_0x347124){if(_0x347124){freeIsNotKey(_0x347124,_0xa936d3[_0x854f('0x16')],_0x854f('0x26'));for(var _0x5216e5=0x0,_0x217c75={};_0x5216e5<_0x347124[_0x854f('0x38')];_0x5216e5+=0x1){_0x217c75=_0x347124[_0x5216e5];if(_['isUndefined'](_0xa936d3[_0x854f('0x16')][_0x217c75[_0x854f('0x26')]])){_0xa936d3[_0x854f('0x16')][_0x217c75[_0x854f('0x26')]]=new Campaign(_0x217c75);}else{_0xa936d3['mergeFromDatabase'](_0xa936d3['campaigns'][_0x217c75[_0x854f('0x26')]],_0x217c75);}}}return _0xa936d3[_0x854f('0x16')];};};Realtime['prototype'][_0x854f('0x60')]=function(){var _0x48c443=this;return function(_0x68dbdb){if(_0x68dbdb){freeIsNotKey(_0x68dbdb,_0x48c443[_0x854f('0x17')],'id');for(var _0x2058ef=0x0,_0x4646ab={};_0x2058ef<_0x68dbdb['length'];_0x2058ef+=0x1){_0x4646ab=_0x68dbdb[_0x2058ef];if(_[_0x854f('0x3a')](_0x48c443[_0x854f('0x17')][_0x4646ab['id']])){_0x48c443[_0x854f('0x17')][_0x4646ab['id']]=new VoiceExtension(_0x4646ab);}else{_0x48c443[_0x854f('0x3b')](_0x48c443['voiceExtensions'][_0x4646ab['id']],_0x4646ab);}}}return _0x48c443['voiceExtensions'];};};Realtime['prototype'][_0x854f('0x61')]=function(){var _0x1504e1=this;return function(_0x6ff29c){clearCampaigns(_0x1504e1[_0x854f('0x16')]);for(var _0x3940df=0x0;_0x3940df<_0x6ff29c[_0x854f('0x38')];_0x3940df+=0x1){_[_0x854f('0x4b')](_0x1504e1[_0x854f('0x16')][_0x6ff29c[_0x3940df][_0x854f('0x26')]],_0x6ff29c[_0x3940df]);}return _0x1504e1[_0x854f('0x16')];};};Realtime['prototype'][_0x854f('0x62')]=function(){var _0x509516=this;return function(_0x16808e){if(_0x16808e){freeIsNotKey(_0x16808e,_0x509516['faxAccounts'],'id');for(var _0x3d0e46=0x0,_0x2eed3f={},_0x192535={};_0x3d0e46<_0x16808e[_0x854f('0x38')];_0x3d0e46+=0x1){_0x2eed3f=_0x16808e[_0x3d0e46];if(_['isUndefined'](_0x509516[_0x854f('0x21')][_0x2eed3f['id']])){_0x509516[_0x854f('0x21')][_0x2eed3f['id']]=new FaxAccount(_0x2eed3f);}else{_0x509516['mergeFromDatabase'](_0x509516[_0x854f('0x21')][_0x2eed3f['id']],_0x2eed3f);}}}return _0x509516[_0x854f('0x21')];};};module[_0x854f('0x63')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 8099a1f..4ed6e04 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 _0xbf74=['telephones','prototype','xdr','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','find','name','isNil','accountcode','interface','format','voiceQueueReport','length','findAgent','connectedlinenum','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','queuecallerexit','YYYY-MM-DD\x20HH:mm:ss','create','match','destination','exten','dialer','lastapplication','queue','lastdata','context','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','callerid','calleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitorFilename','monitors','createdAt','connectedlinename','xcally-motion-dialer','forEach','startsWith','Local','substring','indexOf','mobile','phone','exports','lodash','util','../../../config/environment','ami','../ami','../rpc/voiceCallReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf74,0x94));var _0x4bf7=function(_0xb06b9f,_0x15e74c){_0xb06b9f=_0xb06b9f-0x0;var _0x30d142=_0xbf74[_0xb06b9f];return _0x30d142;};'use strict';var BPromise=require('bluebird');var _=require(_0x4bf7('0x0'));var moment=require('moment');var util=require(_0x4bf7('0x1'));var config=require(_0x4bf7('0x2'));var logger=require('../../../config/logger')(_0x4bf7('0x3'));var ami=require(_0x4bf7('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x4bf7('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x4bf7('0x6'));var RpcVoiceRecording=require(_0x4bf7('0x7'));var RpcVoiceTransferReport=require(_0x4bf7('0x8'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x4bf7('0x9'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x4bf7('0xa'));var UserReport=require(_0x4bf7('0xb'));function Report(_0x545119){this[_0x4bf7('0xc')]=_0x545119;this[_0x4bf7('0xd')]=_0x545119['agents'];this['telephones']=_0x545119[_0x4bf7('0xe')];}Report[_0x4bf7('0xf')]['sync']=function(_0x4c16ed){var _0x34d233=new VoiceQueueReport(this[_0x4bf7('0xc')]);var _0x523e46=new VoiceAgentReport(this[_0x4bf7('0xc')]);var _0x58bcbd=new VoiceDialReport(this[_0x4bf7('0xc')]);var _0x57d7c9=new VoiceCallReport(this[_0x4bf7('0xc')]);var _0x5dbc22=new UserReport(this[_0x4bf7('0xc')]);if(config[_0x4bf7('0x10')]&&config[_0x4bf7('0x10')]['disabled']){ami['on'](_0x4bf7('0x11'),this['voiceQueueReport'][_0x4bf7('0x12')](this));ami['on'](_0x4bf7('0x13'),this[_0x4bf7('0x14')][_0x4bf7('0x12')](this));ami['on'](_0x4bf7('0x15'),this[_0x4bf7('0x16')][_0x4bf7('0x12')](this));ami['on'](_0x4bf7('0x17'),this[_0x4bf7('0x18')][_0x4bf7('0x12')](this));ami['on'](_0x4bf7('0x19'),this[_0x4bf7('0x1a')][_0x4bf7('0x12')](this));ami['on'](_0x4bf7('0x1b'),this[_0x4bf7('0x1c')][_0x4bf7('0x12')](this));}};Report[_0x4bf7('0xf')]['findAgent']=function(_0x2006c7){var _0x4a1f00=undefined;_0x4a1f00=_[_0x4bf7('0x1d')](this[_0x4bf7('0xd')],function(_0x471cee){return _0x471cee['accountcode']==_0x2006c7||_0x471cee[_0x4bf7('0x1e')]==_0x2006c7;});if(_[_0x4bf7('0x1f')](_0x4a1f00)){var _0x3d6051=_[_0x4bf7('0x1d')](this[_0x4bf7('0xe')],function(_0x4a7c32){return _0x4a7c32[_0x4bf7('0x20')]==_0x2006c7||_0x4a7c32['name']==_0x2006c7;});if(_0x3d6051){_0x4a1f00=_[_0x4bf7('0x1d')](this[_0x4bf7('0xd')],function(_0x22d50d){return _0x22d50d[_0x4bf7('0x21')]==util[_0x4bf7('0x22')]('SIP/%s',_0x3d6051[_0x4bf7('0x1e')]);});}}return _0x4a1f00;};Report[_0x4bf7('0xf')][_0x4bf7('0x23')]=function(_0x23101a){for(var _0x25d28c=0x0;_0x25d28c<_0x23101a[_0x4bf7('0x24')];_0x25d28c+=0x1){var _0x2497ad=this[_0x4bf7('0x25')](_0x23101a[_0x25d28c][_0x4bf7('0x26')]);if(_0x2497ad){_0x23101a[_0x25d28c][_0x4bf7('0x20')]=_0x2497ad[_0x4bf7('0x20')];_0x23101a[_0x25d28c][_0x4bf7('0x27')]=!![];_0x23101a[_0x25d28c][_0x4bf7('0x28')]=_0x2497ad[_0x4bf7('0x1e')];_0x23101a[_0x25d28c][_0x4bf7('0x21')]=_['isNil'](_0x2497ad[_0x4bf7('0x21')])?util['format'](_0x4bf7('0x29'),_0x2497ad[_0x4bf7('0x1e')]):_0x2497ad[_0x4bf7('0x21')];if(_0x23101a[_0x25d28c][_0x4bf7('0x2a')]){_0x23101a[_0x25d28c][_0x4bf7('0x2b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x23101a[_0x25d28c][_0x4bf7('0x2c')]){_0x23101a[_0x25d28c]['queuecallerexitAt']=moment()[_0x4bf7('0x22')](_0x4bf7('0x2d'));}RpcMemberReport['voiceQueueReport'](_0x23101a[_0x25d28c]);}RpcVoiceQueueReport[_0x4bf7('0x2e')](_0x23101a[_0x25d28c]);}};function extractCalleridNumber(_0x28d78b){var _0x50ea0b=_0x28d78b[_0x4bf7('0x2f')](/<(.*?)>/);return _0x50ea0b?_0x50ea0b[0x1]:_0x28d78b;}Report['prototype']['voiceCallReport']=function(_0xbbb50d){_0xbbb50d['destination']=_0xbbb50d[_0x4bf7('0x30')]||_0xbbb50d[_0x4bf7('0x31')];if(_0xbbb50d['type']==_0x4bf7('0x32')){_0xbbb50d[_0x4bf7('0x33')]=_0x4bf7('0x34');_0xbbb50d[_0x4bf7('0x35')]=_0xbbb50d['queue'];if(_0xbbb50d['context']=='from-voip-provider'){_0xbbb50d[_0x4bf7('0x20')]='';_0xbbb50d['destination']=extractCalleridNumber(_0xbbb50d['callerid']);}else if(_0xbbb50d[_0x4bf7('0x36')]==_0x4bf7('0x37')){if(_0xbbb50d[_0x4bf7('0x30')]==_0x4bf7('0x38')){_0xbbb50d['destination']=extractCalleridNumber(_0xbbb50d[_0x4bf7('0x39')]);_0xbbb50d['calleridnum']=_0xbbb50d[_0x4bf7('0x3a')];_0xbbb50d[_0x4bf7('0x3b')]=[_0xbbb50d[_0x4bf7('0x3c')],_0xbbb50d[_0x4bf7('0x3c')]=_0xbbb50d['destinationchannel']][0x0];_0xbbb50d[_0x4bf7('0x3d')]=_0xbbb50d[_0x4bf7('0x39')];}else{_0xbbb50d['destination']=_0xbbb50d[_0x4bf7('0x3e')];_0xbbb50d[_0x4bf7('0x3e')]=_0xbbb50d[_0x4bf7('0x3a')];if(_0xbbb50d[_0x4bf7('0x3f')]==_0x4bf7('0x40')){_0xbbb50d[_0x4bf7('0x20')]=_0xbbb50d['connectedlinenum'];}else{_0xbbb50d[_0x4bf7('0x20')]='';}}}}else{_0xbbb50d['callerid']=util[_0x4bf7('0x22')](_0x4bf7('0x41'),_0xbbb50d[_0x4bf7('0x42')],_0xbbb50d[_0x4bf7('0x3e')]);}RpcVoiceCallReport[_0x4bf7('0x2e')](_0xbbb50d);if(_0xbbb50d[_0x4bf7('0x43')]){for(var _0x1d4631=0x0;_0x1d4631<_0xbbb50d['monitors'][_0x4bf7('0x24')];_0x1d4631+=0x1){_0xbbb50d[_0x4bf7('0x44')]=_0xbbb50d[_0x4bf7('0x45')][_0x1d4631]['filename'];_0xbbb50d[_0x4bf7('0x46')]=_0xbbb50d['monitors'][_0x1d4631][_0x4bf7('0x46')];if(_0xbbb50d[_0x4bf7('0x31')]==_0x4bf7('0x38')){_0xbbb50d['calleridnum']=_0xbbb50d[_0x4bf7('0x26')];_0xbbb50d['calleridname']=_0xbbb50d[_0x4bf7('0x47')];_0xbbb50d[_0x4bf7('0x26')]=_0xbbb50d[_0x4bf7('0x20')];_0xbbb50d[_0x4bf7('0x47')]=_0xbbb50d['membername'];_0xbbb50d[_0x4bf7('0x31')]=_0xbbb50d[_0x4bf7('0x3a')];}else if(_0xbbb50d[_0x4bf7('0x31')]==_0x4bf7('0x48')){_0xbbb50d['calleridnum']=_0xbbb50d[_0x4bf7('0x30')];_0xbbb50d[_0x4bf7('0x31')]=_0xbbb50d[_0x4bf7('0x3a')];}RpcVoiceRecording[_0x4bf7('0x2e')](_0xbbb50d);}}};Report[_0x4bf7('0xf')][_0x4bf7('0x16')]=function(_0x5afebf){if(_['isArray'](_0x5afebf)){_0x5afebf[_0x4bf7('0x49')](function(_0x114c16){RpcVoiceAgentReport['create'](_0x114c16);});}else{RpcVoiceAgentReport['create'](_0x5afebf);}};Report[_0x4bf7('0xf')][_0x4bf7('0x18')]=function(_0x689a80){RpcVoiceDialReport['create'](_0x689a80);var _0x4381e6=undefined;var _0x3eb9b2=_0x689a80[_0x4bf7('0x3c')];if(_[_0x4bf7('0x4a')](_0x3eb9b2,_0x4bf7('0x4b'))){var _0x2c0297=_0x3eb9b2[_0x4bf7('0x4c')](_0x3eb9b2[_0x4bf7('0x4d')]('/')+0x1,_0x3eb9b2[_0x4bf7('0x4d')]('@'));_0x4381e6=_[_0x4bf7('0x1d')](this['agents'],function(_0x43852f){return _0x43852f[_0x4bf7('0x4e')]==_0x2c0297||_0x43852f[_0x4bf7('0x4f')]==_0x2c0297||_0x43852f[_0x4bf7('0x20')]==_0x2c0297;});}else{var _0x2c0297=_0x3eb9b2['substring'](_0x3eb9b2[_0x4bf7('0x4d')]('/')+0x1,_0x3eb9b2['lastIndexOf']('-'));_0x4381e6=this[_0x4bf7('0x25')](_0x2c0297);}if(_0x4381e6){_0x689a80[_0x4bf7('0x21')]=_[_0x4bf7('0x1f')](_0x4381e6[_0x4bf7('0x21')])?util[_0x4bf7('0x22')](_0x4bf7('0x29'),_0x4381e6['name']):_0x4381e6[_0x4bf7('0x21')];_0x689a80['membername']=_0x4381e6['name'];_0x689a80[_0x4bf7('0x20')]=_0x4381e6[_0x4bf7('0x20')];RpcMemberReport[_0x4bf7('0x18')](_0x689a80);}};Report[_0x4bf7('0xf')][_0x4bf7('0x1a')]=function(_0x1e32d2){RpcVoiceTransferReport[_0x4bf7('0x1a')](_0x1e32d2);};Report['prototype']['attendedTransfer']=function(_0x2966c1){RpcVoiceTransferReport['attendedTransfer'](_0x2966c1);};module[_0x4bf7('0x50')]=Report; \ No newline at end of file +var _0x1a76=['./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','xdr','disabled','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','blindtransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','voiceQueueReport','connectedlinenum','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','destination','exten','dialer','lastapplication','queue','context','from-voip-provider','callerid','from-sip','calleridpreview','calleridnum','originatecalleridnum','channel','destinationchannel','disposition','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','length','monitorFilename','createdAt','xcally-motion-preview','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','voiceDialReport','Local','substring','indexOf','mobile','phone','lastIndexOf','blindTransfer','exports','lodash','util','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x1a76,0x139));var _0x61a7=function(_0x1dbbce,_0x48410a){_0x1dbbce=_0x1dbbce-0x0;var _0x30b20d=_0x1a76[_0x1dbbce];return _0x30b20d;};'use strict';var BPromise=require('bluebird');var _=require(_0x61a7('0x0'));var moment=require('moment');var util=require(_0x61a7('0x1'));var config=require('../../../config/environment');var logger=require(_0x61a7('0x2'))(_0x61a7('0x3'));var ami=require(_0x61a7('0x4'));var RpcVoiceAgentReport=require(_0x61a7('0x5'));var RpcVoiceCallReport=require(_0x61a7('0x6'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x61a7('0x7'));var RpcVoiceQueueReport=require(_0x61a7('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x61a7('0x9'));var VoiceQueueReport=require(_0x61a7('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x61a7('0xb'));var VoiceDialReport=require(_0x61a7('0xc'));var UserReport=require('./userReport');function Report(_0x4bbd5a){this[_0x61a7('0xd')]=_0x4bbd5a;this[_0x61a7('0xe')]=_0x4bbd5a[_0x61a7('0xe')];this[_0x61a7('0xf')]=_0x4bbd5a[_0x61a7('0xf')];}Report['prototype']['sync']=function(_0x361f7b){var _0x5b9335=new VoiceQueueReport(this[_0x61a7('0xd')]);var _0x820425=new VoiceAgentReport(this['realtime']);var _0xabe7b=new VoiceDialReport(this['realtime']);var _0x3e1fe9=new VoiceCallReport(this[_0x61a7('0xd')]);var _0x347f21=new UserReport(this[_0x61a7('0xd')]);if(config[_0x61a7('0x10')]&&config[_0x61a7('0x10')][_0x61a7('0x11')]){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0x61a7('0x12')](this));ami['on'](_0x61a7('0x13'),this[_0x61a7('0x14')][_0x61a7('0x12')](this));ami['on'](_0x61a7('0x15'),this[_0x61a7('0x16')][_0x61a7('0x12')](this));ami['on']('custom:voiceDialReport',this['voiceDialReport'][_0x61a7('0x12')](this));ami['on'](_0x61a7('0x17'),this['blindTransfer'][_0x61a7('0x12')](this));ami['on'](_0x61a7('0x18'),this[_0x61a7('0x19')][_0x61a7('0x12')](this));}};Report[_0x61a7('0x1a')][_0x61a7('0x1b')]=function(_0x1bfc81){var _0x108d83=undefined;_0x108d83=_[_0x61a7('0x1c')](this[_0x61a7('0xe')],function(_0x23cfb4){return _0x23cfb4[_0x61a7('0x1d')]==_0x1bfc81||_0x23cfb4[_0x61a7('0x1e')]==_0x1bfc81;});if(_[_0x61a7('0x1f')](_0x108d83)){var _0x595dcf=_[_0x61a7('0x1c')](this[_0x61a7('0xf')],function(_0x10fe23){return _0x10fe23['accountcode']==_0x1bfc81||_0x10fe23[_0x61a7('0x1e')]==_0x1bfc81;});if(_0x595dcf){_0x108d83=_[_0x61a7('0x1c')](this[_0x61a7('0xe')],function(_0x1eaa11){return _0x1eaa11[_0x61a7('0x20')]==util[_0x61a7('0x21')](_0x61a7('0x22'),_0x595dcf[_0x61a7('0x1e')]);});}}return _0x108d83;};Report['prototype'][_0x61a7('0x23')]=function(_0x1ee09b){for(var _0x2c1a8f=0x0;_0x2c1a8f<_0x1ee09b['length'];_0x2c1a8f+=0x1){var _0x3e6b48=this['findAgent'](_0x1ee09b[_0x2c1a8f][_0x61a7('0x24')]);if(_0x3e6b48){_0x1ee09b[_0x2c1a8f][_0x61a7('0x1d')]=_0x3e6b48[_0x61a7('0x1d')];_0x1ee09b[_0x2c1a8f]['assigned']=!![];_0x1ee09b[_0x2c1a8f][_0x61a7('0x25')]=_0x3e6b48[_0x61a7('0x1e')];_0x1ee09b[_0x2c1a8f][_0x61a7('0x20')]=_[_0x61a7('0x1f')](_0x3e6b48['interface'])?util[_0x61a7('0x21')]('SIP/%s',_0x3e6b48['name']):_0x3e6b48[_0x61a7('0x20')];if(_0x1ee09b[_0x2c1a8f][_0x61a7('0x26')]){_0x1ee09b[_0x2c1a8f][_0x61a7('0x27')]=moment()[_0x61a7('0x21')](_0x61a7('0x28'));}if(_0x1ee09b[_0x2c1a8f][_0x61a7('0x29')]){_0x1ee09b[_0x2c1a8f]['queuecallerexitAt']=moment()[_0x61a7('0x21')](_0x61a7('0x28'));}RpcMemberReport[_0x61a7('0x23')](_0x1ee09b[_0x2c1a8f]);}RpcVoiceQueueReport[_0x61a7('0x2a')](_0x1ee09b[_0x2c1a8f]);}};function extractCalleridNumber(_0x2c173a){var _0x3db392=_0x2c173a[_0x61a7('0x2b')](/<(.*?)>/);return _0x3db392?_0x3db392[0x1]:_0x2c173a;}Report['prototype'][_0x61a7('0x14')]=function(_0x2aedaf){_0x2aedaf[_0x61a7('0x2c')]=_0x2aedaf[_0x61a7('0x2c')]||_0x2aedaf[_0x61a7('0x2d')];if(_0x2aedaf['type']==_0x61a7('0x2e')){_0x2aedaf[_0x61a7('0x2f')]=_0x61a7('0x30');_0x2aedaf['lastdata']=_0x2aedaf[_0x61a7('0x30')];if(_0x2aedaf[_0x61a7('0x31')]==_0x61a7('0x32')){_0x2aedaf[_0x61a7('0x1d')]='';_0x2aedaf['destination']=extractCalleridNumber(_0x2aedaf[_0x61a7('0x33')]);}else if(_0x2aedaf['context']==_0x61a7('0x34')){if(_0x2aedaf[_0x61a7('0x2c')]=='xcally-motion-preview'){_0x2aedaf[_0x61a7('0x2c')]=extractCalleridNumber(_0x2aedaf[_0x61a7('0x35')]);_0x2aedaf[_0x61a7('0x36')]=_0x2aedaf[_0x61a7('0x37')];_0x2aedaf['destinationchannel']=[_0x2aedaf[_0x61a7('0x38')],_0x2aedaf[_0x61a7('0x38')]=_0x2aedaf[_0x61a7('0x39')]][0x0];_0x2aedaf[_0x61a7('0x33')]=_0x2aedaf[_0x61a7('0x35')];}else{_0x2aedaf[_0x61a7('0x2c')]=_0x2aedaf['calleridnum'];_0x2aedaf[_0x61a7('0x36')]=_0x2aedaf[_0x61a7('0x37')];if(_0x2aedaf[_0x61a7('0x3a')]=='ANSWERED'){_0x2aedaf[_0x61a7('0x1d')]=_0x2aedaf[_0x61a7('0x24')];}else{_0x2aedaf[_0x61a7('0x1d')]='';}}}}else{_0x2aedaf[_0x61a7('0x33')]=util['format'](_0x61a7('0x3b'),_0x2aedaf[_0x61a7('0x3c')],_0x2aedaf[_0x61a7('0x36')]);}RpcVoiceCallReport[_0x61a7('0x2a')](_0x2aedaf);if(_0x2aedaf[_0x61a7('0x3d')]){for(var _0x5c0211=0x0;_0x5c0211<_0x2aedaf[_0x61a7('0x3e')][_0x61a7('0x3f')];_0x5c0211+=0x1){_0x2aedaf[_0x61a7('0x40')]=_0x2aedaf[_0x61a7('0x3e')][_0x5c0211]['filename'];_0x2aedaf[_0x61a7('0x41')]=_0x2aedaf['monitors'][_0x5c0211][_0x61a7('0x41')];if(_0x2aedaf[_0x61a7('0x2d')]==_0x61a7('0x42')){_0x2aedaf['calleridnum']=_0x2aedaf[_0x61a7('0x24')];_0x2aedaf['calleridname']=_0x2aedaf['connectedlinename'];_0x2aedaf[_0x61a7('0x24')]=_0x2aedaf[_0x61a7('0x1d')];_0x2aedaf[_0x61a7('0x43')]=_0x2aedaf[_0x61a7('0x44')];_0x2aedaf['exten']=_0x2aedaf[_0x61a7('0x37')];}else if(_0x2aedaf['exten']==_0x61a7('0x45')){_0x2aedaf[_0x61a7('0x36')]=_0x2aedaf[_0x61a7('0x2c')];_0x2aedaf[_0x61a7('0x2d')]=_0x2aedaf[_0x61a7('0x37')];}RpcVoiceRecording[_0x61a7('0x2a')](_0x2aedaf);}}};Report['prototype'][_0x61a7('0x16')]=function(_0x27946b){if(_[_0x61a7('0x46')](_0x27946b)){_0x27946b[_0x61a7('0x47')](function(_0x204d34){RpcVoiceAgentReport[_0x61a7('0x2a')](_0x204d34);});}else{RpcVoiceAgentReport[_0x61a7('0x2a')](_0x27946b);}};Report[_0x61a7('0x1a')][_0x61a7('0x48')]=function(_0x45fe3c){RpcVoiceDialReport[_0x61a7('0x2a')](_0x45fe3c);var _0x420eca=undefined;var _0x70a391=_0x45fe3c[_0x61a7('0x38')];if(_['startsWith'](_0x70a391,_0x61a7('0x49'))){var _0x3f15e1=_0x70a391[_0x61a7('0x4a')](_0x70a391['indexOf']('/')+0x1,_0x70a391[_0x61a7('0x4b')]('@'));_0x420eca=_[_0x61a7('0x1c')](this['agents'],function(_0xb3627a){return _0xb3627a[_0x61a7('0x4c')]==_0x3f15e1||_0xb3627a[_0x61a7('0x4d')]==_0x3f15e1||_0xb3627a[_0x61a7('0x1d')]==_0x3f15e1;});}else{var _0x3f15e1=_0x70a391[_0x61a7('0x4a')](_0x70a391[_0x61a7('0x4b')]('/')+0x1,_0x70a391[_0x61a7('0x4e')]('-'));_0x420eca=this['findAgent'](_0x3f15e1);}if(_0x420eca){_0x45fe3c[_0x61a7('0x20')]=_[_0x61a7('0x1f')](_0x420eca[_0x61a7('0x20')])?util['format'](_0x61a7('0x22'),_0x420eca[_0x61a7('0x1e')]):_0x420eca[_0x61a7('0x20')];_0x45fe3c[_0x61a7('0x44')]=_0x420eca['name'];_0x45fe3c[_0x61a7('0x1d')]=_0x420eca['accountcode'];RpcMemberReport[_0x61a7('0x48')](_0x45fe3c);}};Report[_0x61a7('0x1a')][_0x61a7('0x4f')]=function(_0x411ec7){RpcVoiceTransferReport[_0x61a7('0x4f')](_0x411ec7);};Report['prototype'][_0x61a7('0x19')]=function(_0x747552){RpcVoiceTransferReport['attendedTransfer'](_0x747552);};module[_0x61a7('0x50')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 97c1137..092924e 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 _0xce0f=['telephone:save','trunk:save','startsWith','Local','substring','indexOf','find','phone','[syncDeviceState][UserReport]','peer','registered','status','address','telephone:%s','exports','lodash','moment','util','ioredis','ami','../ami','defaults','redis','localhost','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','isUndefined','emit','isNotNull','state','merge','omit','actionid','username','format','trunk:%s','name','[syncRegistry][UserReport]','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime'];(function(_0x56acbd,_0x3dc5b0){var _0x5a0e26=function(_0x4e5121){while(--_0x4e5121){_0x56acbd['push'](_0x56acbd['shift']());}};_0x5a0e26(++_0x3dc5b0);}(_0xce0f,0xd2));var _0xfce0=function(_0x10f359,_0x188403){_0x10f359=_0x10f359-0x0;var _0x40a757=_0xce0f[_0x10f359];return _0x40a757;};'use strict';var _=require(_0xfce0('0x0'));var moment=require(_0xfce0('0x1'));var BPromise=require('bluebird');var util=require(_0xfce0('0x2'));var Redis=require(_0xfce0('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xfce0('0x4'));var ami=require(_0xfce0('0x5'));config['redis']=_[_0xfce0('0x6')](config[_0xfce0('0x7')],{'host':_0xfce0('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfce0('0x7')]));function UserReport(_0x405ac1){this['trunks']=_0x405ac1[_0xfce0('0x9')];this[_0xfce0('0xa')]=_0x405ac1[_0xfce0('0xa')];this[_0xfce0('0xb')]=_0x405ac1[_0xfce0('0xb')];ami['on'](_0xfce0('0xc'),this[_0xfce0('0xd')][_0xfce0('0xe')](this));ami['on'](_0xfce0('0xf'),this['syncRegistry'][_0xfce0('0xe')](this));ami['on'](_0xfce0('0x10'),this[_0xfce0('0x11')][_0xfce0('0xe')](this));ami['on'](_0xfce0('0x12'),this[_0xfce0('0x13')][_0xfce0('0xe')](this));this[_0xfce0('0x14')]();return BPromise[_0xfce0('0x15')]()[_0xfce0('0x16')](ami[_0xfce0('0x17')]())[_0xfce0('0x16')](ami[_0xfce0('0x18')]())['then'](ami[_0xfce0('0x19')]())[_0xfce0('0x1a')](loggerCatch(_0xfce0('0x1b')));}function loggerCatch(_0x8d9c18){return function(_0x1a8bf9){logger[_0xfce0('0x1c')](_0x8d9c18,util[_0xfce0('0x1d')](_0x1a8bf9,{'showHidden':![],'depth':null}));};}UserReport[_0xfce0('0x1e')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0xfce0('0x16')](ami[_0xfce0('0x17')]())['then'](ami[_0xfce0('0x18')]())[_0xfce0('0x16')](ami[_0xfce0('0x19')]())[_0xfce0('0x1a')](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0xfce0('0x1e')]['isNotNull']=function(_0x20159c){return _0x20159c!==null&&!_[_0xfce0('0x1f')](_0x20159c);};UserReport[_0xfce0('0x1e')][_0xfce0('0x20')]=function(_0x50dabd,_0x3ac03e,_0x3ed302){io['to'](_0x50dabd)['emit'](_0x3ac03e,_0x3ed302);};UserReport[_0xfce0('0x1e')]['syncRegistry']=function(_0x242455){try{if(this[_0xfce0('0x21')](_0x242455)){var _0x543e96=_['find'](this[_0xfce0('0x9')],{'registry':_0x242455['username']});if(_0x543e96){_0x242455['stateRegistry']=_0x242455[_0xfce0('0x22')];_[_0xfce0('0x23')](_0x543e96,_[_0xfce0('0x24')](_0x242455,['event',_0xfce0('0x25'),_0xfce0('0x26'),_0xfce0('0x22')]));this[_0xfce0('0x20')](util[_0xfce0('0x27')](_0xfce0('0x28'),_0x543e96[_0xfce0('0x29')]),'trunk:save',_0x543e96);}}}catch(_0xbb3978){logger['error'](_0xfce0('0x2a'),util[_0xfce0('0x1d')](_0xbb3978,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0xb275c7){try{if(this[_0xfce0('0x21')](_0xb275c7)){if(this['agents'][_0xb275c7[_0xfce0('0x2b')]]){if(!this[_0xfce0('0xa')][_0xb275c7[_0xfce0('0x2b')]][_0xfce0('0x2c')]||_0xb275c7[_0xfce0('0x22')][_0xfce0('0x2d')]()==_0xfce0('0x2e')){this['agents'][_0xb275c7[_0xfce0('0x2b')]][_0xfce0('0x2c')]=![];if(this['agents'][_0xb275c7[_0xfce0('0x2b')]][_0xfce0('0x22')]!==_0xb275c7[_0xfce0('0x22')][_0xfce0('0x2d')]()){this['agents'][_0xb275c7[_0xfce0('0x2b')]][_0xfce0('0x2f')]=_[_0xfce0('0x30')](moment()[_0xfce0('0x27')]('x'));}this[_0xfce0('0xa')][_0xb275c7[_0xfce0('0x2b')]][_0xfce0('0x22')]=_0xb275c7[_0xfce0('0x22')][_0xfce0('0x2d')]();this['agents'][_0xb275c7[_0xfce0('0x2b')]][_0xfce0('0x31')](_0xb275c7);}}else if(this[_0xfce0('0xb')][_0xb275c7[_0xfce0('0x2b')]]){if(this['telephones'][_0xb275c7['device']][_0xfce0('0x22')]!==_0xb275c7[_0xfce0('0x22')][_0xfce0('0x2d')]()){this[_0xfce0('0xb')][_0xb275c7[_0xfce0('0x2b')]][_0xfce0('0x2f')]=_[_0xfce0('0x30')](moment()[_0xfce0('0x27')]('x'));}this[_0xfce0('0xb')][_0xb275c7['device']]['state']=_0xb275c7['state']['toLowerCase']();this[_0xfce0('0x20')](util[_0xfce0('0x27')]('telephone:%s',this['telephones'][_0xb275c7[_0xfce0('0x2b')]][_0xfce0('0x29')]),_0xfce0('0x32'),this[_0xfce0('0xb')][_0xb275c7[_0xfce0('0x2b')]]);}else if(this[_0xfce0('0x9')][_0xb275c7[_0xfce0('0x2b')]]){if(this['trunks'][_0xb275c7['device']][_0xfce0('0x22')]!==_0xb275c7[_0xfce0('0x22')][_0xfce0('0x2d')]()){this[_0xfce0('0x9')][_0xb275c7[_0xfce0('0x2b')]][_0xfce0('0x2f')]=_[_0xfce0('0x30')](moment()[_0xfce0('0x27')]('x'));}this[_0xfce0('0x9')][_0xb275c7[_0xfce0('0x2b')]]['state']=_0xb275c7[_0xfce0('0x22')][_0xfce0('0x2d')]();this['emit'](util[_0xfce0('0x27')](_0xfce0('0x28'),this['trunks'][_0xb275c7['device']][_0xfce0('0x29')]),_0xfce0('0x33'),this[_0xfce0('0x9')][_0xb275c7[_0xfce0('0x2b')]]);}else if(_[_0xfce0('0x34')](_0xb275c7['device'],'Queue')){}else if(_[_0xfce0('0x34')](_0xb275c7[_0xfce0('0x2b')],_0xfce0('0x35'))){var _0x3a5586=_0xb275c7['device'];var _0x46d91e=_0x3a5586[_0xfce0('0x36')](_0x3a5586[_0xfce0('0x37')]('/')+0x1,_0x3a5586[_0xfce0('0x37')]('@'));var _0x4996eb=_[_0xfce0('0x38')](this['agents'],function(_0x18b438){return _0x18b438['mobile']==_0x46d91e||_0x18b438[_0xfce0('0x39')]==_0x46d91e||_0x18b438['accountcode']==_0x46d91e;});if(_0x4996eb){if(_0x4996eb[_0xfce0('0x22')]!==_0xb275c7[_0xfce0('0x22')][_0xfce0('0x2d')]()){_0x4996eb['stateTime']=_[_0xfce0('0x30')](moment()['format']('x'));}_0x4996eb[_0xfce0('0x22')]=_0xb275c7['state'][_0xfce0('0x2d')]();_0x4996eb[_0xfce0('0x2c')]=!![];_0x4996eb[_0xfce0('0x31')](_0xb275c7);}}else{}}}catch(_0x18cab6){logger[_0xfce0('0x1c')](_0xfce0('0x3a'),util[_0xfce0('0x1d')](_0x18cab6,{'showHidden':![],'depth':null}));}};UserReport[_0xfce0('0x1e')][_0xfce0('0x13')]=function(_0x4bd242){try{if(this[_0xfce0('0x21')](_0x4bd242)&&this[_0xfce0('0x21')](_0x4bd242[_0xfce0('0x12')])){if(this[_0xfce0('0xa')][_0x4bd242[_0xfce0('0x3b')]]){if(!this[_0xfce0('0xa')][_0x4bd242['peer']][_0xfce0('0x2c')]||_0x4bd242[_0xfce0('0x12')][_0xfce0('0x2d')]()==_0xfce0('0x3c')){this[_0xfce0('0xa')][_0x4bd242[_0xfce0('0x3b')]]['local']=![];this[_0xfce0('0xa')][_0x4bd242[_0xfce0('0x3b')]][_0xfce0('0x3d')]=_0x4bd242[_0xfce0('0x12')]['toLowerCase']();this[_0xfce0('0xa')][_0x4bd242[_0xfce0('0x3b')]][_0xfce0('0x3e')]=_0x4bd242[_0xfce0('0x3e')];this[_0xfce0('0xa')][_0x4bd242[_0xfce0('0x3b')]][_0xfce0('0x31')](_0x4bd242);}}else if(this[_0xfce0('0xb')][_0x4bd242[_0xfce0('0x3b')]]){this['telephones'][_0x4bd242[_0xfce0('0x3b')]][_0xfce0('0x3d')]=_0x4bd242[_0xfce0('0x12')][_0xfce0('0x2d')]();this['telephones'][_0x4bd242[_0xfce0('0x3b')]][_0xfce0('0x3e')]=_0x4bd242[_0xfce0('0x3e')];this['emit'](util['format'](_0xfce0('0x3f'),this[_0xfce0('0xb')][_0x4bd242[_0xfce0('0x3b')]][_0xfce0('0x29')]),'telephone:save',this['telephones'][_0x4bd242[_0xfce0('0x3b')]]);}else if(this[_0xfce0('0x9')][_0x4bd242[_0xfce0('0x3b')]]){this[_0xfce0('0x9')][_0x4bd242['peer']][_0xfce0('0x3d')]=_0x4bd242['peerstatus'][_0xfce0('0x2d')]();this[_0xfce0('0x9')][_0x4bd242['peer']]['address']=_0x4bd242[_0xfce0('0x3e')];this[_0xfce0('0x20')](util[_0xfce0('0x27')](_0xfce0('0x28'),this[_0xfce0('0x9')][_0x4bd242[_0xfce0('0x3b')]][_0xfce0('0x29')]),_0xfce0('0x33'),this[_0xfce0('0x9')][_0x4bd242[_0xfce0('0x3b')]]);}else{}}}catch(_0x4376cb){logger[_0xfce0('0x1c')]('[syncPeerStatus][UserReport]',util[_0xfce0('0x1d')](_0x4376cb,{'showHidden':![],'depth':null}));}};module[_0xfce0('0x40')]=UserReport; \ No newline at end of file +var _0x944d=['ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','peerstatus','syncPeerStatus','loopSyncRealTimeShow','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','resolve','isNotNull','isUndefined','emit','stateRegistry','state','merge','omit','event','username','format','trunk:%s','trunk:save','[syncRegistry][UserReport]','syncDeviceState','device','toLowerCase','inuse','local','updateStatusRealtime','stateTime','toNumber','telephone:%s','telephone:save','name','startsWith','Local','indexOf','find','mobile','phone','accountcode','[syncDeviceState][UserReport]','peer','registered','status','address','[syncPeerStatus][UserReport]','lodash','moment','bluebird','util'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0x944d,0x1e6));var _0xd944=function(_0x456576,_0x1f5ccb){_0x456576=_0x456576-0x0;var _0x2b5d65=_0x944d[_0x456576];return _0x2b5d65;};'use strict';var _=require(_0xd944('0x0'));var moment=require(_0xd944('0x1'));var BPromise=require(_0xd944('0x2'));var util=require(_0xd944('0x3'));var Redis=require(_0xd944('0x4'));var config=require(_0xd944('0x5'));var logger=require(_0xd944('0x6'))(_0xd944('0x7'));var ami=require(_0xd944('0x8'));config['redis']=_[_0xd944('0x9')](config[_0xd944('0xa')],{'host':_0xd944('0xb'),'port':0x18eb});var io=require(_0xd944('0xc'))(new Redis(config[_0xd944('0xa')]));function UserReport(_0x48468e){this[_0xd944('0xd')]=_0x48468e[_0xd944('0xd')];this[_0xd944('0xe')]=_0x48468e[_0xd944('0xe')];this[_0xd944('0xf')]=_0x48468e[_0xd944('0xf')];ami['on'](_0xd944('0x10'),this[_0xd944('0x11')]['bind'](this));ami['on'](_0xd944('0x12'),this[_0xd944('0x11')][_0xd944('0x13')](this));ami['on']('devicestatechange',this['syncDeviceState'][_0xd944('0x13')](this));ami['on'](_0xd944('0x14'),this[_0xd944('0x15')][_0xd944('0x13')](this));this[_0xd944('0x16')]();return BPromise['resolve']()[_0xd944('0x17')](ami[_0xd944('0x18')]())[_0xd944('0x17')](ami[_0xd944('0x19')]())[_0xd944('0x17')](ami[_0xd944('0x1a')]())[_0xd944('0x1b')](loggerCatch(_0xd944('0x1c')));}function loggerCatch(_0x3a8a69){return function(_0x44f40d){logger[_0xd944('0x1d')](_0x3a8a69,util[_0xd944('0x1e')](_0x44f40d,{'showHidden':![],'depth':null}));};}UserReport[_0xd944('0x1f')][_0xd944('0x16')]=function(){setInterval(function(){BPromise[_0xd944('0x20')]()[_0xd944('0x17')](ami[_0xd944('0x18')]())[_0xd944('0x17')](ami[_0xd944('0x19')]())[_0xd944('0x17')](ami[_0xd944('0x1a')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0xd944('0x1f')][_0xd944('0x21')]=function(_0x14ff07){return _0x14ff07!==null&&!_[_0xd944('0x22')](_0x14ff07);};UserReport[_0xd944('0x1f')][_0xd944('0x23')]=function(_0x1188b8,_0x5529dc,_0x193552){io['to'](_0x1188b8)[_0xd944('0x23')](_0x5529dc,_0x193552);};UserReport[_0xd944('0x1f')][_0xd944('0x11')]=function(_0x495c21){try{if(this[_0xd944('0x21')](_0x495c21)){var _0x43b536=_['find'](this['trunks'],{'registry':_0x495c21['username']});if(_0x43b536){_0x495c21[_0xd944('0x24')]=_0x495c21[_0xd944('0x25')];_[_0xd944('0x26')](_0x43b536,_[_0xd944('0x27')](_0x495c21,[_0xd944('0x28'),'actionid',_0xd944('0x29'),'state']));this['emit'](util[_0xd944('0x2a')](_0xd944('0x2b'),_0x43b536['name']),_0xd944('0x2c'),_0x43b536);}}}catch(_0x515761){logger[_0xd944('0x1d')](_0xd944('0x2d'),util['inspect'](_0x515761,{'showHidden':![],'depth':null}));}};UserReport[_0xd944('0x1f')][_0xd944('0x2e')]=function(_0x214242){try{if(this[_0xd944('0x21')](_0x214242)){if(this['agents'][_0x214242[_0xd944('0x2f')]]){if(!this[_0xd944('0xe')][_0x214242[_0xd944('0x2f')]]['local']||_0x214242[_0xd944('0x25')][_0xd944('0x30')]()==_0xd944('0x31')){this[_0xd944('0xe')][_0x214242[_0xd944('0x2f')]][_0xd944('0x32')]=![];if(this[_0xd944('0xe')][_0x214242[_0xd944('0x2f')]][_0xd944('0x25')]!==_0x214242[_0xd944('0x25')][_0xd944('0x30')]()){this['agents'][_0x214242[_0xd944('0x2f')]]['stateTime']=_['toNumber'](moment()['format']('x'));}this[_0xd944('0xe')][_0x214242[_0xd944('0x2f')]][_0xd944('0x25')]=_0x214242[_0xd944('0x25')][_0xd944('0x30')]();this['agents'][_0x214242[_0xd944('0x2f')]][_0xd944('0x33')](_0x214242);}}else if(this[_0xd944('0xf')][_0x214242['device']]){if(this[_0xd944('0xf')][_0x214242[_0xd944('0x2f')]][_0xd944('0x25')]!==_0x214242[_0xd944('0x25')][_0xd944('0x30')]()){this['telephones'][_0x214242['device']][_0xd944('0x34')]=_[_0xd944('0x35')](moment()['format']('x'));}this[_0xd944('0xf')][_0x214242[_0xd944('0x2f')]][_0xd944('0x25')]=_0x214242[_0xd944('0x25')]['toLowerCase']();this[_0xd944('0x23')](util[_0xd944('0x2a')](_0xd944('0x36'),this[_0xd944('0xf')][_0x214242[_0xd944('0x2f')]]['name']),_0xd944('0x37'),this[_0xd944('0xf')][_0x214242[_0xd944('0x2f')]]);}else if(this[_0xd944('0xd')][_0x214242[_0xd944('0x2f')]]){if(this[_0xd944('0xd')][_0x214242[_0xd944('0x2f')]]['state']!==_0x214242[_0xd944('0x25')][_0xd944('0x30')]()){this[_0xd944('0xd')][_0x214242[_0xd944('0x2f')]][_0xd944('0x34')]=_[_0xd944('0x35')](moment()['format']('x'));}this[_0xd944('0xd')][_0x214242[_0xd944('0x2f')]][_0xd944('0x25')]=_0x214242[_0xd944('0x25')][_0xd944('0x30')]();this[_0xd944('0x23')](util[_0xd944('0x2a')](_0xd944('0x2b'),this[_0xd944('0xd')][_0x214242[_0xd944('0x2f')]][_0xd944('0x38')]),_0xd944('0x2c'),this[_0xd944('0xd')][_0x214242[_0xd944('0x2f')]]);}else if(_[_0xd944('0x39')](_0x214242['device'],'Queue')){}else if(_[_0xd944('0x39')](_0x214242[_0xd944('0x2f')],_0xd944('0x3a'))){var _0x1aa001=_0x214242[_0xd944('0x2f')];var _0x3453a0=_0x1aa001['substring'](_0x1aa001[_0xd944('0x3b')]('/')+0x1,_0x1aa001['indexOf']('@'));var _0x18612a=_[_0xd944('0x3c')](this[_0xd944('0xe')],function(_0x2ef1e9){return _0x2ef1e9[_0xd944('0x3d')]==_0x3453a0||_0x2ef1e9[_0xd944('0x3e')]==_0x3453a0||_0x2ef1e9[_0xd944('0x3f')]==_0x3453a0;});if(_0x18612a){if(_0x18612a[_0xd944('0x25')]!==_0x214242['state'][_0xd944('0x30')]()){_0x18612a[_0xd944('0x34')]=_[_0xd944('0x35')](moment()[_0xd944('0x2a')]('x'));}_0x18612a[_0xd944('0x25')]=_0x214242['state'][_0xd944('0x30')]();_0x18612a[_0xd944('0x32')]=!![];_0x18612a[_0xd944('0x33')](_0x214242);}}else{}}}catch(_0x30e9c3){logger[_0xd944('0x1d')](_0xd944('0x40'),util[_0xd944('0x1e')](_0x30e9c3,{'showHidden':![],'depth':null}));}};UserReport[_0xd944('0x1f')][_0xd944('0x15')]=function(_0x10bcec){try{if(this[_0xd944('0x21')](_0x10bcec)&&this[_0xd944('0x21')](_0x10bcec[_0xd944('0x14')])){if(this[_0xd944('0xe')][_0x10bcec[_0xd944('0x41')]]){if(!this[_0xd944('0xe')][_0x10bcec[_0xd944('0x41')]][_0xd944('0x32')]||_0x10bcec[_0xd944('0x14')]['toLowerCase']()==_0xd944('0x42')){this['agents'][_0x10bcec['peer']][_0xd944('0x32')]=![];this['agents'][_0x10bcec[_0xd944('0x41')]][_0xd944('0x43')]=_0x10bcec[_0xd944('0x14')]['toLowerCase']();this[_0xd944('0xe')][_0x10bcec[_0xd944('0x41')]][_0xd944('0x44')]=_0x10bcec['address'];this['agents'][_0x10bcec['peer']][_0xd944('0x33')](_0x10bcec);}}else if(this[_0xd944('0xf')][_0x10bcec[_0xd944('0x41')]]){this[_0xd944('0xf')][_0x10bcec[_0xd944('0x41')]][_0xd944('0x43')]=_0x10bcec[_0xd944('0x14')][_0xd944('0x30')]();this[_0xd944('0xf')][_0x10bcec[_0xd944('0x41')]][_0xd944('0x44')]=_0x10bcec['address'];this[_0xd944('0x23')](util[_0xd944('0x2a')](_0xd944('0x36'),this[_0xd944('0xf')][_0x10bcec[_0xd944('0x41')]]['name']),'telephone:save',this['telephones'][_0x10bcec['peer']]);}else if(this[_0xd944('0xd')][_0x10bcec[_0xd944('0x41')]]){this[_0xd944('0xd')][_0x10bcec[_0xd944('0x41')]][_0xd944('0x43')]=_0x10bcec[_0xd944('0x14')]['toLowerCase']();this['trunks'][_0x10bcec[_0xd944('0x41')]][_0xd944('0x44')]=_0x10bcec[_0xd944('0x44')];this[_0xd944('0x23')](util[_0xd944('0x2a')]('trunk:%s',this[_0xd944('0xd')][_0x10bcec[_0xd944('0x41')]][_0xd944('0x38')]),_0xd944('0x2c'),this[_0xd944('0xd')][_0x10bcec[_0xd944('0x41')]]);}else{}}}catch(_0xe58ebe){logger[_0xd944('0x1d')](_0xd944('0x45'),util[_0xd944('0x1e')](_0xe58ebe,{'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 e859576..8a99e2d 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 _0x123d=['substring','lastIndexOf','[syncMusicOnHoldStop][VoiceAgentReport]','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','syncAgentCalled','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','inbound','omit','privilege','custom:agentcalled','error','[syncAgentCalled][VoiceAgentReport]','inspect','agentconnectAt','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','interface','pick','destconnectedlinenum','user:%s','membername','user:agentconnect','agentringnoanswerAt','reason','lastevent','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','syncAgentRingNoAnswer','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','hasOwnProperty','abandoned','custom:agentqueuecallerabandon','agentcompleteAt','talktime','transfer','agentacw','acwTimeout','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[syncHangup][VoiceAgentReport]','syncAttendedTransfer','transfereeuniqueid','complete','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','seconds','syncMusicOnHoldStart','channel','onhold','[syncMusicOnHoldStart][VoiceAgentReport]'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x123d,0xf7));var _0xd123=function(_0x2cfd00,_0x24efa5){_0x2cfd00=_0x2cfd00-0x0;var _0x85b08f=_0x123d[_0x2cfd00];return _0x85b08f;};'use strict';var _=require(_0xd123('0x0'));var moment=require(_0xd123('0x1'));var util=require(_0xd123('0x2'));var Redis=require(_0xd123('0x3'));var config=require(_0xd123('0x4'));var logger=require(_0xd123('0x5'))(_0xd123('0x6'));var ami=require(_0xd123('0x7'));config[_0xd123('0x8')]=_['defaults'](config[_0xd123('0x8')],{'host':_0xd123('0x9'),'port':0x18eb});var io=require(_0xd123('0xa'))(new Redis(config[_0xd123('0x8')]));function VoiceAgentReport(_0x56ce62){this[_0xd123('0xb')]={};this[_0xd123('0xc')]=_0x56ce62[_0xd123('0xc')];this[_0xd123('0xd')]=_0x56ce62[_0xd123('0xd')];this[_0xd123('0xe')]={};ami['on'](_0xd123('0xf'),this['syncAgentCalled'][_0xd123('0x10')](this));ami['on'](_0xd123('0x11'),this[_0xd123('0x12')][_0xd123('0x10')](this));ami['on'](_0xd123('0x13'),this['syncAgentRingNoAnswer'][_0xd123('0x10')](this));ami['on'](_0xd123('0x14'),this[_0xd123('0x15')]['bind'](this));ami['on'](_0xd123('0x16'),this[_0xd123('0x17')][_0xd123('0x10')](this));ami['on'](_0xd123('0x18'),this[_0xd123('0x19')][_0xd123('0x10')](this));ami['on'](_0xd123('0x1a'),this[_0xd123('0x1b')][_0xd123('0x10')](this));ami['on'](_0xd123('0x1c'),this['syncMusicOnHoldStart']['bind'](this));ami['on']('musiconholdstop',this[_0xd123('0x1d')][_0xd123('0x10')](this));ami['on'](_0xd123('0x1e'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0xd123('0x1f'),this[_0xd123('0x20')][_0xd123('0x10')](this));}VoiceAgentReport[_0xd123('0x21')][_0xd123('0x22')]=function(_0x1afe05,_0x249992,_0x12adf7){io['to'](_0x1afe05)[_0xd123('0x22')](_0x249992,_0x12adf7);};VoiceAgentReport[_0xd123('0x21')][_0xd123('0x23')]=function(_0x158691){return _0x158691!==null&&!_['isUndefined'](_0x158691);};VoiceAgentReport[_0xd123('0x21')][_0xd123('0x24')]=function(_0x1a3017){try{if(this['isNotNull'](_0x1a3017)){if(_[_0xd123('0x25')](this[_0xd123('0xb')][_0x1a3017[_0xd123('0x26')]])){this['channels'][_0x1a3017[_0xd123('0x26')]]={};}if(_[_0xd123('0x25')](this[_0xd123('0xb')][_0x1a3017['uniqueid']][_0x1a3017[_0xd123('0x27')]])){this[_0xd123('0xb')][_0x1a3017['uniqueid']][_0x1a3017[_0xd123('0x27')]]={'agentcalledAt':moment()[_0xd123('0x28')](_0xd123('0x29')),'lastevent':_0xd123('0x2a'),'variables':this[_0xd123('0xe')][_0x1a3017[_0xd123('0x26')]],'type':this['voiceQueues'][_0x1a3017['queue']]?this[_0xd123('0xc')][_0x1a3017[_0xd123('0x2b')]]['type']||'inbound':_0xd123('0x2c')};}_['merge'](this[_0xd123('0xb')][_0x1a3017[_0xd123('0x26')]][_0x1a3017[_0xd123('0x27')]],_[_0xd123('0x2d')](_0x1a3017,['event',_0xd123('0x2e')]));ami[_0xd123('0x22')](_0xd123('0x2f'),this[_0xd123('0xb')][_0x1a3017[_0xd123('0x26')]][_0x1a3017[_0xd123('0x27')]]);this[_0xd123('0x22')](util[_0xd123('0x28')]('user:%s',_0x1a3017['membername']),'user:called',this[_0xd123('0xb')][_0x1a3017['uniqueid']][_0x1a3017[_0xd123('0x27')]]);}}catch(_0x212038){logger[_0xd123('0x30')](_0xd123('0x31'),util[_0xd123('0x32')](_0x212038,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd123('0x21')][_0xd123('0x12')]=function(_0x2b37){try{if(this['isNotNull'](_0x2b37)){if(this[_0xd123('0xb')][_0x2b37['uniqueid']]){for(var _0x15d9ff in this[_0xd123('0xb')][_0x2b37[_0xd123('0x26')]]){if(this[_0xd123('0xb')][_0x2b37['uniqueid']]['hasOwnProperty'](_0x15d9ff)){if(_0x2b37[_0xd123('0x27')]===_0x15d9ff){this['channels'][_0x2b37[_0xd123('0x26')]][_0x15d9ff][_0xd123('0x33')]=moment()[_0xd123('0x28')](_0xd123('0x29'));this[_0xd123('0xb')][_0x2b37['uniqueid']][_0x15d9ff]['lastevent']=_0xd123('0x34');this['channels'][_0x2b37[_0xd123('0x26')]][_0x15d9ff]['holdtime']=_0x2b37[_0xd123('0x35')];this[_0xd123('0xb')][_0x2b37[_0xd123('0x26')]][_0x15d9ff]['connectedlinenum']=_0x2b37[_0xd123('0x36')];this[_0xd123('0xb')][_0x2b37[_0xd123('0x26')]][_0x15d9ff][_0xd123('0x37')]=_0x2b37[_0xd123('0x37')];this[_0xd123('0xb')][_0x2b37[_0xd123('0x26')]][_0x15d9ff][_0xd123('0x38')]=_0x2b37[_0xd123('0x38')];this['channels'][_0x2b37[_0xd123('0x26')]][_0x15d9ff][_0xd123('0x39')]=_0x2b37['destchannelstatedesc'];_[_0xd123('0x3a')](this[_0xd123('0xd')][_0x2b37[_0xd123('0x3b')]],_[_0xd123('0x3c')](_0x2b37,['queue',_0xd123('0x3d')]));this[_0xd123('0x22')](util[_0xd123('0x28')](_0xd123('0x3e'),_0x2b37[_0xd123('0x3f')]),_0xd123('0x40'),this[_0xd123('0xb')][_0x2b37[_0xd123('0x26')]][_0x2b37[_0xd123('0x27')]]);ami[_0xd123('0x22')]('custom:agentconnect',this[_0xd123('0xb')][_0x2b37[_0xd123('0x26')]][_0x15d9ff]);}else if(!this['channels'][_0x2b37[_0xd123('0x26')]][_0x15d9ff]['agentringnoanswer']&&!this[_0xd123('0xb')][_0x2b37[_0xd123('0x26')]][_0x15d9ff][_0xd123('0x16')]){this[_0xd123('0xb')][_0x2b37[_0xd123('0x26')]][_0x15d9ff][_0xd123('0x13')]=!![];this['channels'][_0x2b37['uniqueid']][_0x15d9ff][_0xd123('0x41')]=moment()[_0xd123('0x28')](_0xd123('0x29'));this[_0xd123('0xb')][_0x2b37['uniqueid']][_0x15d9ff][_0xd123('0x42')]='answered_elsewhere';this[_0xd123('0xb')][_0x2b37[_0xd123('0x26')]][_0x15d9ff][_0xd123('0x43')]=_0xd123('0x44');this[_0xd123('0xb')][_0x2b37['uniqueid']][_0x15d9ff][_0xd123('0x45')]=_0x2b37[_0xd123('0x27')];this[_0xd123('0xb')][_0x2b37[_0xd123('0x26')]][_0x15d9ff][_0xd123('0x46')]=_0x2b37[_0xd123('0x3f')];ami['emit'](_0xd123('0x47'),this['channels'][_0x2b37[_0xd123('0x26')]][_0x15d9ff]);}}}}}}catch(_0x3f6787){logger[_0xd123('0x30')](_0xd123('0x48'),util[_0xd123('0x32')](_0x3f6787,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd123('0x21')][_0xd123('0x49')]=function(_0x5351b2){try{if(this['isNotNull'](_0x5351b2)){if(this['channels'][_0x5351b2[_0xd123('0x26')]]&&this[_0xd123('0xb')][_0x5351b2['uniqueid']][_0x5351b2[_0xd123('0x27')]]){this[_0xd123('0xb')][_0x5351b2['uniqueid']][_0x5351b2[_0xd123('0x27')]][_0xd123('0x13')]=!![];this[_0xd123('0xb')][_0x5351b2[_0xd123('0x26')]][_0x5351b2[_0xd123('0x27')]][_0xd123('0x41')]=moment()[_0xd123('0x28')](_0xd123('0x29'));this['channels'][_0x5351b2['uniqueid']][_0x5351b2[_0xd123('0x27')]][_0xd123('0x42')]=_0xd123('0x4a');this[_0xd123('0xb')][_0x5351b2[_0xd123('0x26')]][_0x5351b2[_0xd123('0x27')]][_0xd123('0x43')]=_0xd123('0x4a');ami[_0xd123('0x22')](_0xd123('0x4b'),this[_0xd123('0xb')][_0x5351b2[_0xd123('0x26')]][_0x5351b2['destuniqueid']]);}}}catch(_0x85b535){logger['error'](_0xd123('0x4c'),util[_0xd123('0x32')](_0x85b535,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xd123('0x15')]=function(_0x20a32f){try{if(this[_0xd123('0x23')](_0x20a32f)){if(this[_0xd123('0xb')][_0x20a32f[_0xd123('0x26')]]){for(var _0xf8ada5 in this[_0xd123('0xb')][_0x20a32f[_0xd123('0x26')]]){if(this[_0xd123('0xb')][_0x20a32f[_0xd123('0x26')]][_0xd123('0x4d')](_0xf8ada5)&&!this[_0xd123('0xb')][_0x20a32f[_0xd123('0x26')]][_0xf8ada5][_0xd123('0x13')]&&!this[_0xd123('0xb')][_0x20a32f[_0xd123('0x26')]][_0xf8ada5][_0xd123('0x16')]){this[_0xd123('0xb')][_0x20a32f[_0xd123('0x26')]][_0xf8ada5][_0xd123('0x13')]=!![];this[_0xd123('0xb')][_0x20a32f[_0xd123('0x26')]][_0xf8ada5]['agentringnoanswerAt']=moment()[_0xd123('0x28')](_0xd123('0x29'));this[_0xd123('0xb')][_0x20a32f[_0xd123('0x26')]][_0xf8ada5][_0xd123('0x42')]=_0xd123('0x4e');this[_0xd123('0xb')][_0x20a32f[_0xd123('0x26')]][_0xf8ada5][_0xd123('0x43')]=_0xd123('0x4e');ami[_0xd123('0x22')](_0xd123('0x4f'),this[_0xd123('0xb')][_0x20a32f[_0xd123('0x26')]][_0xf8ada5]);}}}}}catch(_0x33ccc9){logger[_0xd123('0x30')]('[syncQueueCallerAbandon][VoiceAgentReport]',util[_0xd123('0x32')](_0x33ccc9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd123('0x21')][_0xd123('0x17')]=function(_0x25c7a4){try{if(this[_0xd123('0x23')](_0x25c7a4)){if(this['channels'][_0x25c7a4[_0xd123('0x26')]]){for(var _0x337ba2 in this[_0xd123('0xb')][_0x25c7a4[_0xd123('0x26')]]){if(this['channels'][_0x25c7a4['uniqueid']][_0xd123('0x4d')](_0x337ba2)){if(this[_0xd123('0xb')][_0x25c7a4[_0xd123('0x26')]][_0x337ba2][_0xd123('0x33')]&&!this[_0xd123('0xb')][_0x25c7a4[_0xd123('0x26')]][_0x337ba2][_0xd123('0x16')]){this[_0xd123('0xb')][_0x25c7a4[_0xd123('0x26')]][_0x337ba2][_0xd123('0x16')]=!![];this[_0xd123('0xb')][_0x25c7a4[_0xd123('0x26')]][_0x337ba2][_0xd123('0x50')]=moment()[_0xd123('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x25c7a4[_0xd123('0x26')]][_0x337ba2]['lastevent']='complete';this['channels'][_0x25c7a4[_0xd123('0x26')]][_0x337ba2][_0xd123('0x51')]=_0x25c7a4[_0xd123('0x51')];this[_0xd123('0xb')][_0x25c7a4[_0xd123('0x26')]][_0x337ba2][_0xd123('0x42')]=_0x25c7a4['reason']==_0xd123('0x52')?'agent':_0x25c7a4['reason'];if(this['voiceQueues'][_0x25c7a4[_0xd123('0x2b')]]&&this['voiceQueues'][_0x25c7a4[_0xd123('0x2b')]]['acw']){this[_0xd123('0xb')][_0x25c7a4[_0xd123('0x26')]][_0x337ba2][_0xd123('0x53')]=!![];this[_0xd123('0xb')][_0x25c7a4['uniqueid']][_0x337ba2]['acwtime']=this[_0xd123('0xc')][_0x25c7a4[_0xd123('0x2b')]][_0xd123('0x54')];}this[_0xd123('0xd')][_0x25c7a4[_0xd123('0x3b')]]=_[_0xd123('0x2d')](this[_0xd123('0xd')][_0x25c7a4[_0xd123('0x3b')]],[_0xd123('0x2b'),'destconnectedlinenum']);this[_0xd123('0x22')](util[_0xd123('0x28')](_0xd123('0x3e'),_0x25c7a4[_0xd123('0x3f')]),'user:agentcomplete',this[_0xd123('0xb')][_0x25c7a4[_0xd123('0x26')]][_0x337ba2]);ami[_0xd123('0x22')](_0xd123('0x55'),this['channels'][_0x25c7a4[_0xd123('0x26')]][_0x337ba2]);}}}}}}catch(_0x3ab75c){logger[_0xd123('0x30')](_0xd123('0x56'),util[_0xd123('0x32')](_0x3ab75c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd123('0x21')][_0xd123('0x19')]=function(_0x14250e){try{if(this[_0xd123('0x23')](_0x14250e)){this[_0xd123('0x57')](_0x14250e[_0xd123('0x26')],_[_0xd123('0x58')](_0x14250e[_0xd123('0x59')])[0x0],_0x14250e[_0xd123('0x5a')]);if(this[_0xd123('0xb')][_0x14250e[_0xd123('0x26')]]){for(var _0x149947 in this[_0xd123('0xb')][_0x14250e[_0xd123('0x26')]]){if(this['channels'][_0x14250e[_0xd123('0x26')]][_0xd123('0x4d')](_0x149947)){if(_['isUndefined'](this[_0xd123('0xb')][_0x14250e[_0xd123('0x26')]][_0x149947][_0xd123('0xe')])){this[_0xd123('0xb')][_0x14250e[_0xd123('0x26')]][_0x149947][_0xd123('0xe')]={};}this['channels'][_0x14250e['uniqueid']][_0x149947][_0xd123('0xe')]=this['variables'][_0x14250e[_0xd123('0x26')]];}}}}}catch(_0x23c2e0){logger[_0xd123('0x30')]('[syncVarSet][VoiceAgentReport]',util['inspect'](_0x23c2e0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd123('0x21')][_0xd123('0x57')]=function(_0x33a43a,_0xca05ce,_0x2a452a){var _0x4db1e2=[_0xd123('0x5b'),'rtpaudioqosbridged',_0xd123('0x5c'),'rtpaudioqosjitterbridged',_0xd123('0x5d'),_0xd123('0x5e'),_0xd123('0x5f'),_0xd123('0x60'),_0xd123('0x61'),_0xd123('0x62'),_0xd123('0x63'),'bridgepvtcallid',_0xd123('0x64'),_0xd123('0x65'),_0xd123('0x66'),_0xd123('0x67'),_0xd123('0x3f'),_0xd123('0x68'),_0xd123('0x69')];if(!_[_0xd123('0x6a')](_0xca05ce)&&!_[_0xd123('0x6b')](_0x4db1e2,_0xca05ce)){if(_[_0xd123('0x25')](this[_0xd123('0xe')][_0x33a43a])){this[_0xd123('0xe')][_0x33a43a]={};}this[_0xd123('0xe')][_0x33a43a][_0xca05ce]=_0x2a452a;}};VoiceAgentReport[_0xd123('0x21')][_0xd123('0x1b')]=function(_0x2db257){try{if(this[_0xd123('0x23')](_0x2db257)){if(this[_0xd123('0xb')][_0x2db257[_0xd123('0x26')]]){for(var _0x2e0294 in this[_0xd123('0xb')][_0x2db257[_0xd123('0x26')]]){if(this[_0xd123('0xb')][_0x2db257[_0xd123('0x26')]][_0xd123('0x4d')](_0x2e0294)){if(this[_0xd123('0xb')][_0x2db257['uniqueid']][_0x2e0294][_0xd123('0x42')]=='transfer'&&this[_0xd123('0xb')][_0x2db257['uniqueid']][_0x2e0294][_0xd123('0x16')]){this[_0xd123('0xb')][_0x2db257[_0xd123('0x26')]][_0x2e0294][_0xd123('0x50')]=moment()[_0xd123('0x28')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0xd123('0x22')]('custom:voiceAgentReport',_['values'](this[_0xd123('0xb')][_0x2db257[_0xd123('0x26')]]));delete this[_0xd123('0xb')][_0x2db257['uniqueid']];}if(this['variables'][_0x2db257[_0xd123('0x26')]]){delete this[_0xd123('0xe')][_0x2db257[_0xd123('0x26')]];}}}catch(_0x4a3e1d){logger[_0xd123('0x30')](_0xd123('0x6c'),util['inspect'](_0x4a3e1d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd123('0x21')][_0xd123('0x6d')]=function(_0x24a4c3){try{if(this['isNotNull'](_0x24a4c3)){if(this['channels'][_0x24a4c3['transfereeuniqueid']]){for(var _0x4deff4 in this['channels'][_0x24a4c3['transfereeuniqueid']]){if(this[_0xd123('0xb')][_0x24a4c3[_0xd123('0x6e')]][_0xd123('0x4d')](_0x4deff4)){if(_0x24a4c3['origtransfereruniqueid']===_0x4deff4){var _0xc06e58=moment();this[_0xd123('0xb')][_0x24a4c3[_0xd123('0x6e')]][_0x4deff4]['agentcomplete']=!![];this['channels'][_0x24a4c3[_0xd123('0x6e')]][_0x4deff4][_0xd123('0x50')]=moment()[_0xd123('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x24a4c3[_0xd123('0x6e')]][_0x4deff4][_0xd123('0x42')]='transfer';this[_0xd123('0xb')][_0x24a4c3[_0xd123('0x6e')]][_0x4deff4][_0xd123('0x43')]=_0xd123('0x6f');this[_0xd123('0xb')][_0x24a4c3[_0xd123('0x6e')]][_0x4deff4][_0xd123('0x51')]=_0xc06e58['diff'](this[_0xd123('0xb')][_0x24a4c3['transfereeuniqueid']][_0x4deff4][_0xd123('0x33')],'seconds');}}}}if(this['channels'][_0x24a4c3[_0xd123('0x70')]]){var _0x326df9=this[_0xd123('0xb')][_0x24a4c3[_0xd123('0x70')]];this[_0xd123('0xb')][_0x24a4c3[_0xd123('0x70')]]=this[_0xd123('0xb')][_0x24a4c3[_0xd123('0x6e')]];this['channels'][_0x24a4c3[_0xd123('0x6e')]]=_0x326df9;}}}catch(_0x2664d1){logger[_0xd123('0x30')](_0xd123('0x71'),util[_0xd123('0x32')](_0x2664d1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd123('0x21')]['syncBlindTransfer']=function(_0x2dc173){try{if(this[_0xd123('0x23')](_0x2dc173)){if(this['channels'][_0x2dc173[_0xd123('0x6e')]]){for(var _0x4671e9 in this[_0xd123('0xb')][_0x2dc173['transfereeuniqueid']]){if(this[_0xd123('0xb')][_0x2dc173[_0xd123('0x6e')]]['hasOwnProperty'](_0x4671e9)){if(_0x2dc173['transfereruniqueid']===_0x4671e9){var _0x35c339=moment();this['channels'][_0x2dc173[_0xd123('0x6e')]][_0x4671e9][_0xd123('0x16')]=!![];this[_0xd123('0xb')][_0x2dc173[_0xd123('0x6e')]][_0x4671e9][_0xd123('0x50')]=_0x35c339;this[_0xd123('0xb')][_0x2dc173['transfereeuniqueid']][_0x4671e9][_0xd123('0x42')]=_0xd123('0x52');this[_0xd123('0xb')][_0x2dc173[_0xd123('0x6e')]][_0x4671e9][_0xd123('0x43')]=_0xd123('0x6f');this[_0xd123('0xb')][_0x2dc173[_0xd123('0x6e')]][_0x4671e9]['talktime']=_0x35c339['diff'](this[_0xd123('0xb')][_0x2dc173[_0xd123('0x6e')]][_0x4671e9][_0xd123('0x33')],_0xd123('0x72'));}}}}}}catch(_0x7823a8){logger[_0xd123('0x30')]('[syncBlindTransfer][VoiceAgentReport]',util[_0xd123('0x32')](_0x7823a8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xd123('0x21')][_0xd123('0x73')]=function(_0x1218b2){var _0x5e3cb0='';try{if(this[_0xd123('0x23')](_0x1218b2)){if(_0x1218b2['channel']){_0x5e3cb0=_0x1218b2[_0xd123('0x74')]['substring'](0x0,_0x1218b2[_0xd123('0x74')]['lastIndexOf']('-'));if(this[_0xd123('0xd')][_0x5e3cb0]){this['agents'][_0x5e3cb0][_0xd123('0x75')]=!![];}}}}catch(_0x34b4bd){logger[_0xd123('0x30')](_0xd123('0x76'),util[_0xd123('0x32')](_0x34b4bd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xd123('0x1d')]=function(_0x15f857){var _0x4330f3='';try{if(this[_0xd123('0x23')](_0x15f857)){if(_0x15f857[_0xd123('0x74')]){_0x4330f3=_0x15f857[_0xd123('0x74')][_0xd123('0x77')](0x0,_0x15f857[_0xd123('0x74')][_0xd123('0x78')]('-'));if(this[_0xd123('0xd')][_0x4330f3]){this['agents'][_0x4330f3][_0xd123('0x75')]=![];}}}}catch(_0x2b9726){logger['error'](_0xd123('0x79'),util[_0xd123('0x32')](_0x2b9726,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xd864=['queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','destuniqueid','called','uniqueid','queue','type','inbound','merge','omit','event','privilege','custom:agentcalled','format','user:%s','membername','user:called','error','inspect','syncAgentConnect','hasOwnProperty','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','user:agentconnect','custom:agentconnect','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','[syncAgentConnect][VoiceAgentReport]','syncAgentRingNoAnswer','rejected','custom:agentringnoanswer','reason','abandoned','agentcompleteAt','complete','talktime','transfer','agent','acw','agentacw','acwtime','acwTimeout','destconnectedlinenum','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberinterface','memberlastcall','memberrealtime','isNil','includes','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','[syncMusicOnHoldStart][VoiceAgentReport]','onhold','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','bind','agentringnoanswer'];(function(_0x112e7b,_0x158695){var _0x1bbda0=function(_0x187738){while(--_0x187738){_0x112e7b['push'](_0x112e7b['shift']());}};_0x1bbda0(++_0x158695);}(_0xd864,0x6a));var _0x4d86=function(_0x3810b5,_0x83a788){_0x3810b5=_0x3810b5-0x0;var _0x33ef32=_0xd864[_0x3810b5];return _0x33ef32;};'use strict';var _=require(_0x4d86('0x0'));var moment=require(_0x4d86('0x1'));var util=require(_0x4d86('0x2'));var Redis=require(_0x4d86('0x3'));var config=require(_0x4d86('0x4'));var logger=require(_0x4d86('0x5'))(_0x4d86('0x6'));var ami=require(_0x4d86('0x7'));config[_0x4d86('0x8')]=_['defaults'](config[_0x4d86('0x8')],{'host':_0x4d86('0x9'),'port':0x18eb});var io=require(_0x4d86('0xa'))(new Redis(config[_0x4d86('0x8')]));function VoiceAgentReport(_0x418ff7){this[_0x4d86('0xb')]={};this[_0x4d86('0xc')]=_0x418ff7[_0x4d86('0xc')];this[_0x4d86('0xd')]=_0x418ff7[_0x4d86('0xd')];this[_0x4d86('0xe')]={};ami['on']('agentcalled',this['syncAgentCalled'][_0x4d86('0xf')](this));ami['on']('agentconnect',this['syncAgentConnect'][_0x4d86('0xf')](this));ami['on'](_0x4d86('0x10'),this['syncAgentRingNoAnswer'][_0x4d86('0xf')](this));ami['on'](_0x4d86('0x11'),this[_0x4d86('0x12')][_0x4d86('0xf')](this));ami['on'](_0x4d86('0x13'),this[_0x4d86('0x14')]['bind'](this));ami['on'](_0x4d86('0x15'),this[_0x4d86('0x16')][_0x4d86('0xf')](this));ami['on'](_0x4d86('0x17'),this[_0x4d86('0x18')]['bind'](this));ami['on'](_0x4d86('0x19'),this[_0x4d86('0x1a')][_0x4d86('0xf')](this));ami['on'](_0x4d86('0x1b'),this[_0x4d86('0x1c')][_0x4d86('0xf')](this));ami['on'](_0x4d86('0x1d'),this[_0x4d86('0x1e')][_0x4d86('0xf')](this));ami['on'](_0x4d86('0x1f'),this[_0x4d86('0x20')]['bind'](this));}VoiceAgentReport[_0x4d86('0x21')][_0x4d86('0x22')]=function(_0x16ca2c,_0x584482,_0x4c0293){io['to'](_0x16ca2c)[_0x4d86('0x22')](_0x584482,_0x4c0293);};VoiceAgentReport[_0x4d86('0x21')][_0x4d86('0x23')]=function(_0x3749d0){return _0x3749d0!==null&&!_[_0x4d86('0x24')](_0x3749d0);};VoiceAgentReport[_0x4d86('0x21')][_0x4d86('0x25')]=function(_0x31e4cc){try{if(this[_0x4d86('0x23')](_0x31e4cc)){if(_[_0x4d86('0x24')](this[_0x4d86('0xb')][_0x31e4cc['uniqueid']])){this[_0x4d86('0xb')][_0x31e4cc['uniqueid']]={};}if(_[_0x4d86('0x24')](this[_0x4d86('0xb')][_0x31e4cc['uniqueid']][_0x31e4cc[_0x4d86('0x26')]])){this[_0x4d86('0xb')][_0x31e4cc['uniqueid']][_0x31e4cc[_0x4d86('0x26')]]={'agentcalledAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x4d86('0x27'),'variables':this[_0x4d86('0xe')][_0x31e4cc[_0x4d86('0x28')]],'type':this['voiceQueues'][_0x31e4cc[_0x4d86('0x29')]]?this[_0x4d86('0xc')][_0x31e4cc['queue']][_0x4d86('0x2a')]||_0x4d86('0x2b'):_0x4d86('0x2b')};}_[_0x4d86('0x2c')](this[_0x4d86('0xb')][_0x31e4cc[_0x4d86('0x28')]][_0x31e4cc['destuniqueid']],_[_0x4d86('0x2d')](_0x31e4cc,[_0x4d86('0x2e'),_0x4d86('0x2f')]));ami[_0x4d86('0x22')](_0x4d86('0x30'),this[_0x4d86('0xb')][_0x31e4cc[_0x4d86('0x28')]][_0x31e4cc['destuniqueid']]);this[_0x4d86('0x22')](util[_0x4d86('0x31')](_0x4d86('0x32'),_0x31e4cc[_0x4d86('0x33')]),_0x4d86('0x34'),this['channels'][_0x31e4cc[_0x4d86('0x28')]][_0x31e4cc[_0x4d86('0x26')]]);}}catch(_0x428f39){logger[_0x4d86('0x35')]('[syncAgentCalled][VoiceAgentReport]',util[_0x4d86('0x36')](_0x428f39,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4d86('0x21')][_0x4d86('0x37')]=function(_0x582921){try{if(this[_0x4d86('0x23')](_0x582921)){if(this['channels'][_0x582921[_0x4d86('0x28')]]){for(var _0x7512fe in this[_0x4d86('0xb')][_0x582921[_0x4d86('0x28')]]){if(this[_0x4d86('0xb')][_0x582921['uniqueid']][_0x4d86('0x38')](_0x7512fe)){if(_0x582921[_0x4d86('0x26')]===_0x7512fe){this['channels'][_0x582921[_0x4d86('0x28')]][_0x7512fe][_0x4d86('0x39')]=moment()[_0x4d86('0x31')](_0x4d86('0x3a'));this[_0x4d86('0xb')][_0x582921[_0x4d86('0x28')]][_0x7512fe][_0x4d86('0x3b')]=_0x4d86('0x3c');this[_0x4d86('0xb')][_0x582921['uniqueid']][_0x7512fe][_0x4d86('0x3d')]=_0x582921['holdtime'];this[_0x4d86('0xb')][_0x582921[_0x4d86('0x28')]][_0x7512fe][_0x4d86('0x3e')]=_0x582921[_0x4d86('0x3e')];this[_0x4d86('0xb')][_0x582921[_0x4d86('0x28')]][_0x7512fe]['connectedlinename']=_0x582921[_0x4d86('0x3f')];this[_0x4d86('0xb')][_0x582921['uniqueid']][_0x7512fe][_0x4d86('0x40')]=_0x582921[_0x4d86('0x40')];this[_0x4d86('0xb')][_0x582921['uniqueid']][_0x7512fe]['destchannelstatedesc']=_0x582921[_0x4d86('0x41')];_[_0x4d86('0x2c')](this['agents'][_0x582921[_0x4d86('0x42')]],_['pick'](_0x582921,[_0x4d86('0x29'),'destconnectedlinenum']));this[_0x4d86('0x22')](util[_0x4d86('0x31')]('user:%s',_0x582921[_0x4d86('0x33')]),_0x4d86('0x43'),this['channels'][_0x582921[_0x4d86('0x28')]][_0x582921[_0x4d86('0x26')]]);ami[_0x4d86('0x22')](_0x4d86('0x44'),this['channels'][_0x582921[_0x4d86('0x28')]][_0x7512fe]);}else if(!this[_0x4d86('0xb')][_0x582921[_0x4d86('0x28')]][_0x7512fe][_0x4d86('0x10')]&&!this[_0x4d86('0xb')][_0x582921['uniqueid']][_0x7512fe][_0x4d86('0x13')]){this[_0x4d86('0xb')][_0x582921['uniqueid']][_0x7512fe][_0x4d86('0x10')]=!![];this[_0x4d86('0xb')][_0x582921[_0x4d86('0x28')]][_0x7512fe][_0x4d86('0x45')]=moment()[_0x4d86('0x31')](_0x4d86('0x3a'));this['channels'][_0x582921[_0x4d86('0x28')]][_0x7512fe]['reason']='answered_elsewhere';this[_0x4d86('0xb')][_0x582921[_0x4d86('0x28')]][_0x7512fe][_0x4d86('0x3b')]=_0x4d86('0x46');this[_0x4d86('0xb')][_0x582921[_0x4d86('0x28')]][_0x7512fe][_0x4d86('0x47')]=_0x582921[_0x4d86('0x26')];this[_0x4d86('0xb')][_0x582921[_0x4d86('0x28')]][_0x7512fe]['answeredelsewheremembername']=_0x582921[_0x4d86('0x33')];ami[_0x4d86('0x22')]('custom:agentansweredelsewhere',this[_0x4d86('0xb')][_0x582921[_0x4d86('0x28')]][_0x7512fe]);}}}}}}catch(_0x1c079a){logger['error'](_0x4d86('0x48'),util['inspect'](_0x1c079a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4d86('0x21')][_0x4d86('0x49')]=function(_0x3ab6eb){try{if(this[_0x4d86('0x23')](_0x3ab6eb)){if(this[_0x4d86('0xb')][_0x3ab6eb[_0x4d86('0x28')]]&&this[_0x4d86('0xb')][_0x3ab6eb[_0x4d86('0x28')]][_0x3ab6eb['destuniqueid']]){this[_0x4d86('0xb')][_0x3ab6eb['uniqueid']][_0x3ab6eb[_0x4d86('0x26')]][_0x4d86('0x10')]=!![];this[_0x4d86('0xb')][_0x3ab6eb['uniqueid']][_0x3ab6eb[_0x4d86('0x26')]][_0x4d86('0x45')]=moment()[_0x4d86('0x31')](_0x4d86('0x3a'));this[_0x4d86('0xb')][_0x3ab6eb['uniqueid']][_0x3ab6eb[_0x4d86('0x26')]]['reason']='rejected';this[_0x4d86('0xb')][_0x3ab6eb[_0x4d86('0x28')]][_0x3ab6eb['destuniqueid']][_0x4d86('0x3b')]=_0x4d86('0x4a');ami['emit'](_0x4d86('0x4b'),this['channels'][_0x3ab6eb[_0x4d86('0x28')]][_0x3ab6eb['destuniqueid']]);}}}catch(_0x5c213c){logger[_0x4d86('0x35')]('[syncAgentRingNoAnswer][VoiceAgentReport]',util[_0x4d86('0x36')](_0x5c213c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x4d86('0x12')]=function(_0x53ddec){try{if(this['isNotNull'](_0x53ddec)){if(this[_0x4d86('0xb')][_0x53ddec[_0x4d86('0x28')]]){for(var _0x3ff9e3 in this['channels'][_0x53ddec['uniqueid']]){if(this[_0x4d86('0xb')][_0x53ddec[_0x4d86('0x28')]][_0x4d86('0x38')](_0x3ff9e3)&&!this[_0x4d86('0xb')][_0x53ddec[_0x4d86('0x28')]][_0x3ff9e3]['agentringnoanswer']&&!this[_0x4d86('0xb')][_0x53ddec[_0x4d86('0x28')]][_0x3ff9e3]['agentcomplete']){this[_0x4d86('0xb')][_0x53ddec[_0x4d86('0x28')]][_0x3ff9e3][_0x4d86('0x10')]=!![];this['channels'][_0x53ddec[_0x4d86('0x28')]][_0x3ff9e3][_0x4d86('0x45')]=moment()[_0x4d86('0x31')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4d86('0xb')][_0x53ddec[_0x4d86('0x28')]][_0x3ff9e3][_0x4d86('0x4c')]='abandoned';this[_0x4d86('0xb')][_0x53ddec['uniqueid']][_0x3ff9e3]['lastevent']=_0x4d86('0x4d');ami[_0x4d86('0x22')]('custom:agentqueuecallerabandon',this[_0x4d86('0xb')][_0x53ddec[_0x4d86('0x28')]][_0x3ff9e3]);}}}}}catch(_0x484627){logger[_0x4d86('0x35')]('[syncQueueCallerAbandon][VoiceAgentReport]',util[_0x4d86('0x36')](_0x484627,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4d86('0x21')][_0x4d86('0x14')]=function(_0x398e14){try{if(this[_0x4d86('0x23')](_0x398e14)){if(this['channels'][_0x398e14['uniqueid']]){for(var _0x36039c in this['channels'][_0x398e14[_0x4d86('0x28')]]){if(this[_0x4d86('0xb')][_0x398e14[_0x4d86('0x28')]]['hasOwnProperty'](_0x36039c)){if(this[_0x4d86('0xb')][_0x398e14[_0x4d86('0x28')]][_0x36039c][_0x4d86('0x39')]&&!this[_0x4d86('0xb')][_0x398e14[_0x4d86('0x28')]][_0x36039c][_0x4d86('0x13')]){this[_0x4d86('0xb')][_0x398e14[_0x4d86('0x28')]][_0x36039c]['agentcomplete']=!![];this[_0x4d86('0xb')][_0x398e14[_0x4d86('0x28')]][_0x36039c][_0x4d86('0x4e')]=moment()[_0x4d86('0x31')](_0x4d86('0x3a'));this['channels'][_0x398e14[_0x4d86('0x28')]][_0x36039c][_0x4d86('0x3b')]=_0x4d86('0x4f');this[_0x4d86('0xb')][_0x398e14[_0x4d86('0x28')]][_0x36039c][_0x4d86('0x50')]=_0x398e14[_0x4d86('0x50')];this[_0x4d86('0xb')][_0x398e14[_0x4d86('0x28')]][_0x36039c][_0x4d86('0x4c')]=_0x398e14[_0x4d86('0x4c')]==_0x4d86('0x51')?_0x4d86('0x52'):_0x398e14[_0x4d86('0x4c')];if(this[_0x4d86('0xc')][_0x398e14[_0x4d86('0x29')]]&&this[_0x4d86('0xc')][_0x398e14[_0x4d86('0x29')]][_0x4d86('0x53')]){this[_0x4d86('0xb')][_0x398e14[_0x4d86('0x28')]][_0x36039c][_0x4d86('0x54')]=!![];this['channels'][_0x398e14['uniqueid']][_0x36039c][_0x4d86('0x55')]=this['voiceQueues'][_0x398e14['queue']][_0x4d86('0x56')];}this[_0x4d86('0xd')][_0x398e14[_0x4d86('0x42')]]=_[_0x4d86('0x2d')](this[_0x4d86('0xd')][_0x398e14['interface']],[_0x4d86('0x29'),_0x4d86('0x57')]);this['emit'](util[_0x4d86('0x31')](_0x4d86('0x32'),_0x398e14[_0x4d86('0x33')]),_0x4d86('0x58'),this[_0x4d86('0xb')][_0x398e14[_0x4d86('0x28')]][_0x36039c]);ami[_0x4d86('0x22')](_0x4d86('0x59'),this[_0x4d86('0xb')][_0x398e14[_0x4d86('0x28')]][_0x36039c]);}}}}}}catch(_0x5d36ef){logger[_0x4d86('0x35')](_0x4d86('0x5a'),util[_0x4d86('0x36')](_0x5d36ef,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4d86('0x21')][_0x4d86('0x16')]=function(_0x3b81bc){try{if(this[_0x4d86('0x23')](_0x3b81bc)){this[_0x4d86('0x5b')](_0x3b81bc[_0x4d86('0x28')],_[_0x4d86('0x5c')](_0x3b81bc[_0x4d86('0x5d')])[0x0],_0x3b81bc[_0x4d86('0x5e')]);if(this[_0x4d86('0xb')][_0x3b81bc[_0x4d86('0x28')]]){for(var _0x24bbf2 in this[_0x4d86('0xb')][_0x3b81bc[_0x4d86('0x28')]]){if(this[_0x4d86('0xb')][_0x3b81bc[_0x4d86('0x28')]][_0x4d86('0x38')](_0x24bbf2)){if(_[_0x4d86('0x24')](this['channels'][_0x3b81bc[_0x4d86('0x28')]][_0x24bbf2][_0x4d86('0xe')])){this[_0x4d86('0xb')][_0x3b81bc[_0x4d86('0x28')]][_0x24bbf2][_0x4d86('0xe')]={};}this['channels'][_0x3b81bc[_0x4d86('0x28')]][_0x24bbf2][_0x4d86('0xe')]=this[_0x4d86('0xe')][_0x3b81bc[_0x4d86('0x28')]];}}}}}catch(_0x5530ad){logger[_0x4d86('0x35')]('[syncVarSet][VoiceAgentReport]',util['inspect'](_0x5530ad,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4d86('0x21')][_0x4d86('0x5b')]=function(_0x26bd19,_0x3be4ed,_0x40f681){var _0x49f147=[_0x4d86('0x5f'),_0x4d86('0x60'),'rtpaudioqosjitter',_0x4d86('0x61'),_0x4d86('0x62'),_0x4d86('0x63'),_0x4d86('0x64'),_0x4d86('0x65'),_0x4d86('0x66'),_0x4d86('0x67'),'bridgepeer',_0x4d86('0x68'),'membercalls','memberdynamic',_0x4d86('0x69'),_0x4d86('0x6a'),_0x4d86('0x33'),'memberpenalty',_0x4d86('0x6b')];if(!_[_0x4d86('0x6c')](_0x3be4ed)&&!_[_0x4d86('0x6d')](_0x49f147,_0x3be4ed)){if(_[_0x4d86('0x24')](this[_0x4d86('0xe')][_0x26bd19])){this[_0x4d86('0xe')][_0x26bd19]={};}this[_0x4d86('0xe')][_0x26bd19][_0x3be4ed]=_0x40f681;}};VoiceAgentReport[_0x4d86('0x21')][_0x4d86('0x18')]=function(_0x1caf8c){try{if(this[_0x4d86('0x23')](_0x1caf8c)){if(this[_0x4d86('0xb')][_0x1caf8c['uniqueid']]){for(var _0x23a24a in this[_0x4d86('0xb')][_0x1caf8c['uniqueid']]){if(this['channels'][_0x1caf8c[_0x4d86('0x28')]][_0x4d86('0x38')](_0x23a24a)){if(this[_0x4d86('0xb')][_0x1caf8c[_0x4d86('0x28')]][_0x23a24a][_0x4d86('0x4c')]==_0x4d86('0x51')&&this[_0x4d86('0xb')][_0x1caf8c[_0x4d86('0x28')]][_0x23a24a][_0x4d86('0x13')]){this[_0x4d86('0xb')][_0x1caf8c['uniqueid']][_0x23a24a]['agentcompleteAt']=moment()[_0x4d86('0x31')](_0x4d86('0x3a'));}}}ami['emit']('custom:voiceAgentReport',_[_0x4d86('0x6e')](this[_0x4d86('0xb')][_0x1caf8c['uniqueid']]));delete this[_0x4d86('0xb')][_0x1caf8c['uniqueid']];}if(this[_0x4d86('0xe')][_0x1caf8c[_0x4d86('0x28')]]){delete this[_0x4d86('0xe')][_0x1caf8c[_0x4d86('0x28')]];}}}catch(_0x41d22e){logger[_0x4d86('0x35')](_0x4d86('0x6f'),util[_0x4d86('0x36')](_0x41d22e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4d86('0x21')][_0x4d86('0x1e')]=function(_0x23ec1f){try{if(this['isNotNull'](_0x23ec1f)){if(this[_0x4d86('0xb')][_0x23ec1f[_0x4d86('0x70')]]){for(var _0x21b811 in this[_0x4d86('0xb')][_0x23ec1f[_0x4d86('0x70')]]){if(this[_0x4d86('0xb')][_0x23ec1f[_0x4d86('0x70')]][_0x4d86('0x38')](_0x21b811)){if(_0x23ec1f[_0x4d86('0x71')]===_0x21b811){var _0x3bf34d=moment();this[_0x4d86('0xb')][_0x23ec1f[_0x4d86('0x70')]][_0x21b811][_0x4d86('0x13')]=!![];this[_0x4d86('0xb')][_0x23ec1f[_0x4d86('0x70')]][_0x21b811]['agentcompleteAt']=moment()['format'](_0x4d86('0x3a'));this[_0x4d86('0xb')][_0x23ec1f[_0x4d86('0x70')]][_0x21b811][_0x4d86('0x4c')]=_0x4d86('0x51');this[_0x4d86('0xb')][_0x23ec1f[_0x4d86('0x70')]][_0x21b811][_0x4d86('0x3b')]='complete';this['channels'][_0x23ec1f['transfereeuniqueid']][_0x21b811][_0x4d86('0x50')]=_0x3bf34d[_0x4d86('0x72')](this[_0x4d86('0xb')][_0x23ec1f['transfereeuniqueid']][_0x21b811]['agentconnectAt'],_0x4d86('0x73'));}}}}if(this[_0x4d86('0xb')][_0x23ec1f[_0x4d86('0x74')]]){var _0x4bf497=this[_0x4d86('0xb')][_0x23ec1f[_0x4d86('0x74')]];this[_0x4d86('0xb')][_0x23ec1f[_0x4d86('0x74')]]=this[_0x4d86('0xb')][_0x23ec1f[_0x4d86('0x70')]];this[_0x4d86('0xb')][_0x23ec1f[_0x4d86('0x70')]]=_0x4bf497;}}}catch(_0x3dcf9b){logger[_0x4d86('0x35')](_0x4d86('0x75'),util[_0x4d86('0x36')](_0x3dcf9b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4d86('0x21')][_0x4d86('0x20')]=function(_0x294909){try{if(this[_0x4d86('0x23')](_0x294909)){if(this[_0x4d86('0xb')][_0x294909['transfereeuniqueid']]){for(var _0x46f420 in this[_0x4d86('0xb')][_0x294909['transfereeuniqueid']]){if(this['channels'][_0x294909[_0x4d86('0x70')]][_0x4d86('0x38')](_0x46f420)){if(_0x294909['transfereruniqueid']===_0x46f420){var _0x2dcd95=moment();this[_0x4d86('0xb')][_0x294909[_0x4d86('0x70')]][_0x46f420]['agentcomplete']=!![];this[_0x4d86('0xb')][_0x294909[_0x4d86('0x70')]][_0x46f420][_0x4d86('0x4e')]=_0x2dcd95;this[_0x4d86('0xb')][_0x294909['transfereeuniqueid']][_0x46f420][_0x4d86('0x4c')]='transfer';this[_0x4d86('0xb')][_0x294909[_0x4d86('0x70')]][_0x46f420][_0x4d86('0x3b')]=_0x4d86('0x4f');this['channels'][_0x294909[_0x4d86('0x70')]][_0x46f420]['talktime']=_0x2dcd95[_0x4d86('0x72')](this[_0x4d86('0xb')][_0x294909[_0x4d86('0x70')]][_0x46f420][_0x4d86('0x39')],_0x4d86('0x73'));}}}}}}catch(_0xb315ce){logger[_0x4d86('0x35')]('[syncBlindTransfer][VoiceAgentReport]',util[_0x4d86('0x36')](_0xb315ce,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4d86('0x21')][_0x4d86('0x1a')]=function(_0x1c1857){var _0x953995='';try{if(this[_0x4d86('0x23')](_0x1c1857)){if(_0x1c1857[_0x4d86('0x76')]){_0x953995=_0x1c1857[_0x4d86('0x76')][_0x4d86('0x77')](0x0,_0x1c1857[_0x4d86('0x76')][_0x4d86('0x78')]('-'));if(this['agents'][_0x953995]){this[_0x4d86('0xd')][_0x953995]['onhold']=!![];}}}}catch(_0x1719da){logger[_0x4d86('0x35')](_0x4d86('0x79'),util['inspect'](_0x1719da,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x4d86('0x1c')]=function(_0x583169){var _0x20b88d='';try{if(this['isNotNull'](_0x583169)){if(_0x583169[_0x4d86('0x76')]){_0x20b88d=_0x583169['channel'][_0x4d86('0x77')](0x0,_0x583169['channel'][_0x4d86('0x78')]('-'));if(this[_0x4d86('0xd')][_0x20b88d]){this[_0x4d86('0xd')][_0x20b88d][_0x4d86('0x7a')]=![];}}}}catch(_0x448289){logger['error']('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0x4d86('0x36')](_0x448289,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 89781f5..a29e8aa 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 _0xe105=['format','disposition','toNumber','channelstate','context','destconnectedlinenum','user:%s','split','name','accountcode','exten','[syncNewChannel][VoiceCallReport]','application','toLowerCase','applicationdata','appdata','starttime','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','pick','lastdata','startsWith','cdr(','match','answered','answertime','holdtime','diff','xcally-motion-preview','connectedlinenum','calleridnum','connectedlinename','calleridname','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','replace','.WAV','monitorFilename','find','monitors','isNil','push','syncVarSet','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','parse','error','[syncVarSet][VoiceCallReport]','endtime','billableseconds','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','transfertargetcalleridnum','origtransfereruniqueid','syncBlindTransfer','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','bluebird','ioredis','../../../config/environment','../../../config/logger','ami','../model/channel','unknown','inuse','unavailable','ringing','set','queue','agi','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','redis','defaults','localhost','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewState','varset','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','catch','log','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','merge','keys','[syncNewCallerId][VoiceCallReport]','inspect','syncNewChannel','channel','OutgoingSpoolFailed'];(function(_0x3746a8,_0x46b6f7){var _0x2eb07f=function(_0x451d33){while(--_0x451d33){_0x3746a8['push'](_0x3746a8['shift']());}};_0x2eb07f(++_0x46b6f7);}(_0xe105,0xef));var _0x5e10=function(_0x5cc1b4,_0x8ae0ce){_0x5cc1b4=_0x5cc1b4-0x0;var _0x161174=_0xe105[_0x5cc1b4];return _0x161174;};'use strict';var BPromise=require(_0x5e10('0x0'));var _=require('lodash');var moment=require('moment');var util=require('util');var path=require('path');var Redis=require(_0x5e10('0x1'));var config=require(_0x5e10('0x2'));var logger=require(_0x5e10('0x3'))(_0x5e10('0x4'));var ami=require('../ami');var Channel=require(_0x5e10('0x5'));var statusDesc=[_0x5e10('0x6'),'not_inuse',_0x5e10('0x7'),'busy','invalid',_0x5e10('0x8'),_0x5e10('0x9'),'ringinuse','onhold'];var applications=[_0x5e10('0xa'),_0x5e10('0xb'),_0x5e10('0xc'),'dial',_0x5e10('0xd'),_0x5e10('0xe')];var dispositions=['NO\x20ANSWER',_0x5e10('0xf'),_0x5e10('0xf'),_0x5e10('0x10'),_0x5e10('0x10'),'NO\x20ANSWER',_0x5e10('0x11'),'BUSY',_0x5e10('0xf'),_0x5e10('0xf'),_0x5e10('0xf')];var actions={};config[_0x5e10('0x12')]=_[_0x5e10('0x13')](config[_0x5e10('0x12')],{'host':_0x5e10('0x14'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5e10('0x12')]));function VoiceCallReport(_0xdcd3c){this[_0x5e10('0x15')]=_0xdcd3c[_0x5e10('0x15')];this[_0x5e10('0x16')]=_0xdcd3c['agents'];ami['on'](_0x5e10('0x17'),this[_0x5e10('0x18')][_0x5e10('0x19')](this));ami['on'](_0x5e10('0x1a'),this[_0x5e10('0x18')][_0x5e10('0x19')](this));ami['on'](_0x5e10('0x1b'),this['syncNewChannel'][_0x5e10('0x19')](this));ami['on']('newstate',this[_0x5e10('0x1c')][_0x5e10('0x19')](this));ami['on'](_0x5e10('0x1d'),this['syncVarSet'][_0x5e10('0x19')](this));ami['on'](_0x5e10('0x1e'),this[_0x5e10('0x1f')][_0x5e10('0x19')](this));ami['on'](_0x5e10('0x20'),this[_0x5e10('0x21')][_0x5e10('0x19')](this));ami['on'](_0x5e10('0x22'),this[_0x5e10('0x23')][_0x5e10('0x19')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x5e10('0x19')](this));ami['on']('musiconholdstart',this[_0x5e10('0x24')][_0x5e10('0x19')](this));ami['on'](_0x5e10('0x25'),this[_0x5e10('0x26')][_0x5e10('0x19')](this));return BPromise[_0x5e10('0x27')]()['then'](ami['actionCoreShowChannels']())[_0x5e10('0x28')](function(_0x5161a6){console[_0x5e10('0x29')](_0x5161a6);});}VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x2b')]=function(_0x1a69b8){return _0x1a69b8!==null&&!_[_0x5e10('0x2c')](_0x1a69b8);};VoiceCallReport['prototype']['emit']=function(_0x3f7f85,_0xb14be0,_0x4f0b2){io['to'](_0x3f7f85)[_0x5e10('0x2d')](_0xb14be0,_0x4f0b2);};VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x21')]=function(_0x4281c1){try{if(this[_0x5e10('0x2b')](_0x4281c1)){if(_0x4281c1[_0x5e10('0x2e')]===_0x4281c1[_0x5e10('0x2f')]){if(!_[_0x5e10('0x2c')](this[_0x5e10('0x15')][_0x4281c1[_0x5e10('0x2e')]])){_[_0x5e10('0x30')](this[_0x5e10('0x15')][_0x4281c1[_0x5e10('0x2e')]],_['pick'](_0x4281c1,_[_0x5e10('0x31')](this[_0x5e10('0x15')][_0x4281c1[_0x5e10('0x2e')]])));}}}}catch(_0x35536c){logger['error'](_0x5e10('0x32'),util[_0x5e10('0x33')](_0x35536c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5e10('0x34')]=function(_0x5d76e9){try{if(this['isNotNull'](_0x5d76e9)){if(_0x5d76e9['uniqueid']===_0x5d76e9[_0x5e10('0x2f')]&&_0x5d76e9[_0x5e10('0x35')]!=_0x5e10('0x36')){if(_[_0x5e10('0x2c')](this[_0x5e10('0x15')][_0x5d76e9[_0x5e10('0x2e')]])){this[_0x5e10('0x15')][_0x5d76e9['uniqueid']]=new Channel();this[_0x5e10('0x15')][_0x5d76e9[_0x5e10('0x2e')]]['starttime']=moment()[_0x5e10('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5e10('0x15')][_0x5d76e9[_0x5e10('0x2e')]][_0x5e10('0x38')]=dispositions[_[_0x5e10('0x39')](_0x5d76e9[_0x5e10('0x3a')])];_[_0x5e10('0x30')](this['channels'][_0x5d76e9['uniqueid']],_['pick'](_0x5d76e9,_[_0x5e10('0x31')](this['channels'][_0x5d76e9[_0x5e10('0x2e')]])));if(_0x5d76e9[_0x5e10('0x3b')]==='from-sip'){if(this[_0x5e10('0x16')][_0x5d76e9[_0x5e10('0x35')]['split']('-')[0x0]]){this[_0x5e10('0x16')][_0x5d76e9[_0x5e10('0x35')]['split']('-')[0x0]][_0x5e10('0x3c')]=_0x5d76e9['exten'];this[_0x5e10('0x2d')](util[_0x5e10('0x37')](_0x5e10('0x3d'),this[_0x5e10('0x16')][_0x5d76e9[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]][_0x5e10('0x3f')]),'user:agentconnect',{'destaccountcode':this[_0x5e10('0x16')][_0x5d76e9[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]][_0x5e10('0x40')],'destconnectedlinenum':_0x5d76e9[_0x5e10('0x41')]});}}}}}}catch(_0x1f94ae){logger['error'](_0x5e10('0x42'),util[_0x5e10('0x33')](_0x1f94ae,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5e10('0x18')]=function(_0x147e98){try{if(this[_0x5e10('0x2b')](_0x147e98)){if(_0x147e98[_0x5e10('0x2e')]===_0x147e98[_0x5e10('0x2f')]&&_0x147e98['exten']!='h'&&_0x147e98[_0x5e10('0x35')]!=_0x5e10('0x36')){_0x147e98[_0x5e10('0x43')]=_0x147e98['application'][_0x5e10('0x44')]();_0x147e98[_0x5e10('0x45')]=(_0x147e98[_0x5e10('0x46')]||_0x147e98[_0x5e10('0x45')])[_0x5e10('0x44')]();if(_[_0x5e10('0x2c')](this[_0x5e10('0x15')][_0x147e98['uniqueid']])){this[_0x5e10('0x15')][_0x147e98['uniqueid']]=new Channel();this['channels'][_0x147e98['uniqueid']][_0x5e10('0x47')]=_0x147e98[_0x5e10('0x48')]?moment()['subtract'](moment[_0x5e10('0x48')](_0x147e98[_0x5e10('0x48')])[_0x5e10('0x49')](),_0x5e10('0x49'))[_0x5e10('0x37')](_0x5e10('0x4a')):moment()[_0x5e10('0x37')](_0x5e10('0x4a'));this['channels'][_0x147e98['uniqueid']][_0x5e10('0x38')]=_0x5e10('0x10');}_[_0x5e10('0x30')](this['channels'][_0x147e98[_0x5e10('0x2e')]],_[_0x5e10('0x4b')](_0x147e98,_[_0x5e10('0x31')](this[_0x5e10('0x15')][_0x147e98[_0x5e10('0x2e')]])));if(_['includes'](applications,_0x147e98[_0x5e10('0x43')])){this[_0x5e10('0x15')][_0x147e98['uniqueid']]['lastapplication']=_0x147e98[_0x5e10('0x43')];this[_0x5e10('0x15')][_0x147e98[_0x5e10('0x2e')]][_0x5e10('0x4c')]=_0x147e98[_0x5e10('0x45')];if(_0x147e98[_0x5e10('0x43')]==='set'&&_[_0x5e10('0x4d')](_0x147e98['applicationdata'],_0x5e10('0x4e'))){var _0x5290d1=_0x147e98[_0x5e10('0x45')][_0x5e10('0x3e')]('=');var _0x3b47d4=_0x5290d1[0x0][_0x5e10('0x4f')](/cdr\((.*)\)/);if(_0x3b47d4){this['channels'][_0x147e98[_0x5e10('0x2e')]][_0x3b47d4[0x1]]=_0x5290d1[0x1];}}else if(_0x147e98[_0x5e10('0x43')]===_0x5e10('0xb')){this[_0x5e10('0x15')][_0x147e98[_0x5e10('0x2e')]][_0x5e10('0xb')]=_0x147e98[_0x5e10('0x45')][_0x5e10('0x3e')](',')[0x0];}}}}}catch(_0xd3f1e6){logger['error']('[syncNewExten][VoiceCallReport]',util[_0x5e10('0x33')](_0xd3f1e6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5e10('0x1c')]=function(_0x2c6288){try{if(this[_0x5e10('0x2b')](_0x2c6288)){if(_0x2c6288[_0x5e10('0x2e')]!==_0x2c6288[_0x5e10('0x2f')]){if(this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]]){if(_0x2c6288[_0x5e10('0x3a')]==='6'){if(!this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]]['answered']){var _0x4eb84f=moment();this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]][_0x5e10('0x50')]=!![];this['channels'][_0x2c6288['linkedid']][_0x5e10('0x51')]=_0x4eb84f[_0x5e10('0x37')](_0x5e10('0x4a'));if(this[_0x5e10('0x15')][_0x2c6288['linkedid']][_0x5e10('0x47')]){this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]][_0x5e10('0x52')]=_0x4eb84f[_0x5e10('0x53')](this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]][_0x5e10('0x47')],'seconds');}}this[_0x5e10('0x15')][_0x2c6288['linkedid']][_0x5e10('0x2f')]=_0x2c6288[_0x5e10('0x2e')];if(_0x2c6288['calleridnum']!==_0x5e10('0x54')){this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]][_0x5e10('0x55')]=_0x2c6288[_0x5e10('0x56')];}this[_0x5e10('0x15')][_0x2c6288['linkedid']][_0x5e10('0x57')]=_0x2c6288[_0x5e10('0x58')];this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]][_0x5e10('0x59')]=_0x2c6288[_0x5e10('0x35')];this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]][_0x5e10('0x38')]=dispositions[_['toNumber'](_0x2c6288[_0x5e10('0x3a')])];if(this[_0x5e10('0x16')][_0x2c6288[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]]){this[_0x5e10('0x15')][_0x2c6288['linkedid']][_0x5e10('0x5a')]=this[_0x5e10('0x16')][_0x2c6288[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]]['id'];this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2f')]][_0x5e10('0x5b')]=this['agents'][_0x2c6288[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]][_0x5e10('0x3f')];}}}}else{if(this['channels'][_0x2c6288[_0x5e10('0x2e')]]){if(_0x2c6288[_0x5e10('0x3a')]==='6'){if(this['agents'][_0x2c6288['channel'][_0x5e10('0x3e')]('-')[0x0]]){this[_0x5e10('0x15')][_0x2c6288[_0x5e10('0x2e')]][_0x5e10('0x5a')]=this[_0x5e10('0x16')][_0x2c6288[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]]['id'];this['channels'][_0x2c6288[_0x5e10('0x2e')]][_0x5e10('0x5b')]=this[_0x5e10('0x16')][_0x2c6288['channel'][_0x5e10('0x3e')]('-')[0x0]]['name'];}}}}}}catch(_0x5257b3){logger['error'](_0x5e10('0x5c'),util[_0x5e10('0x33')](_0x5257b3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x5d')]=function(_0xa964be,_0x5a303a){if(this[_0x5e10('0x15')][_0xa964be]){this[_0x5e10('0x15')][_0xa964be][_0x5e10('0x5e')]=!![];if(_[_0x5e10('0x5f')](_0x5a303a,'.wav49')){_0x5a303a=_0x5a303a[_0x5e10('0x60')]('.wav49',_0x5e10('0x61'));}this[_0x5e10('0x15')][_0xa964be][_0x5e10('0x62')]=_0x5a303a;var _0x2c15e2=_[_0x5e10('0x63')](this['channels'][_0xa964be][_0x5e10('0x64')],{'filename':_0x5a303a});if(_[_0x5e10('0x65')](_0x2c15e2)){this[_0x5e10('0x15')][_0xa964be][_0x5e10('0x64')][_0x5e10('0x66')]({'filename':_0x5a303a,'createdAt':moment()[_0x5e10('0x37')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x67')]=function(_0x1913b3){try{if(this['isNotNull'](_0x1913b3)){if(this['channels'][_0x1913b3[_0x5e10('0x2e')]]&&_0x1913b3[_0x5e10('0x35')]!='OutgoingSpoolFailed'){if(this[_0x5e10('0x2b')](_0x1913b3['variable'])){if(this[_0x5e10('0x2b')](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x69')])){this[_0x5e10('0x5d')](_0x1913b3[_0x5e10('0x2e')],_0x1913b3[_0x5e10('0x6a')]);}else if(this[_0x5e10('0x2b')](_0x1913b3['variable'][_0x5e10('0x6b')])){this[_0x5e10('0x15')][_0x1913b3[_0x5e10('0x2e')]][_0x5e10('0x56')]=_0x1913b3['value'];}else if(this[_0x5e10('0x2b')](_0x1913b3['variable'][_0x5e10('0x6c')])){this[_0x5e10('0x15')][_0x1913b3[_0x5e10('0x2e')]][_0x5e10('0x6d')]=_0x1913b3[_0x5e10('0x6a')];}else if(this[_0x5e10('0x2b')](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x6e')])){this[_0x5e10('0x15')][_0x1913b3[_0x5e10('0x2e')]][_0x5e10('0x6f')]=_0x1913b3[_0x5e10('0x6a')];}else if(this['isNotNull'](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x70')])){this['channels'][_0x1913b3[_0x5e10('0x2e')]][_0x5e10('0xb')]=_0x1913b3[_0x5e10('0x6a')]['split'](',')[0x0];}else if(this[_0x5e10('0x2b')](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x71')])){this[_0x5e10('0x15')][_0x1913b3[_0x5e10('0x2e')]][_0x5e10('0x72')]=_0x1913b3[_0x5e10('0x6a')];}else if(this[_0x5e10('0x2b')](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x73')])){this['channels'][_0x1913b3['uniqueid']][_0x5e10('0x74')]=_0x1913b3['value'];}else if(this[_0x5e10('0x2b')](_0x1913b3['variable'][_0x5e10('0x75')])){this['channels'][_0x1913b3['uniqueid']][_0x5e10('0x76')]=_0x1913b3[_0x5e10('0x6a')];}else if(this[_0x5e10('0x2b')](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x77')])){this[_0x5e10('0x15')][_0x1913b3[_0x5e10('0x2e')]][_0x5e10('0xb')]=_0x1913b3[_0x5e10('0x6a')];}else if(this[_0x5e10('0x2b')](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x78')])){this[_0x5e10('0x15')][_0x1913b3[_0x5e10('0x2e')]][_0x5e10('0x79')]=_0x1913b3['value'];}}}else if(this[_0x5e10('0x2b')](_0x1913b3['variable'][_0x5e10('0x69')])){if(_0x1913b3[_0x5e10('0x6a')]){var _0x5e4a1a=path[_0x5e10('0x7a')](_0x1913b3[_0x5e10('0x6a')])[_0x5e10('0x3f')];this[_0x5e10('0x5d')](_0x5e4a1a,_0x1913b3[_0x5e10('0x6a')]);}}else if(this[_0x5e10('0x15')][_0x1913b3[_0x5e10('0x2f')]]){if(this['isNotNull'](_0x1913b3[_0x5e10('0x68')])){if(this[_0x5e10('0x2b')](_0x1913b3[_0x5e10('0x68')][_0x5e10('0x78')])){this[_0x5e10('0x15')][_0x1913b3['linkedid']]['sipcalllinkedid']=_0x1913b3[_0x5e10('0x6a')];}}}}}catch(_0x3a2d29){logger[_0x5e10('0x7b')](_0x5e10('0x7c'),util[_0x5e10('0x33')](_0x3a2d29,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e10('0x2a')]['syncHangup']=function(_0x5382c2){try{if(this[_0x5e10('0x2b')](_0x5382c2)){if(this[_0x5e10('0x15')][_0x5382c2['uniqueid']]){var _0x5d7f9e=moment();this[_0x5e10('0x15')][_0x5382c2[_0x5e10('0x2e')]][_0x5e10('0x7d')]=_0x5d7f9e[_0x5e10('0x37')](_0x5e10('0x4a'));this[_0x5e10('0x15')][_0x5382c2[_0x5e10('0x2e')]]['duration']=_0x5d7f9e[_0x5e10('0x53')](this['channels'][_0x5382c2['uniqueid']]['starttime'],_0x5e10('0x49'));if(this['channels'][_0x5382c2[_0x5e10('0x2e')]][_0x5e10('0x50')]){this[_0x5e10('0x15')][_0x5382c2[_0x5e10('0x2e')]][_0x5e10('0x7e')]=_0x5d7f9e[_0x5e10('0x53')](this[_0x5e10('0x15')][_0x5382c2['uniqueid']][_0x5e10('0x51')],_0x5e10('0x49'));this[_0x5e10('0x15')][_0x5382c2[_0x5e10('0x2e')]]['holdtime']=this[_0x5e10('0x15')][_0x5382c2['uniqueid']][_0x5e10('0x48')]-this[_0x5e10('0x15')][_0x5382c2[_0x5e10('0x2e')]][_0x5e10('0x7e')];}if(_0x5382c2[_0x5e10('0x3b')]==='from-sip'){if(this[_0x5e10('0x16')][_0x5382c2[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]]){this[_0x5e10('0x16')][_0x5382c2[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]]=_[_0x5e10('0x7f')](this[_0x5e10('0x16')][_0x5382c2['channel']['split']('-')[0x0]],['destconnectedlinenum']);this[_0x5e10('0x2d')](util[_0x5e10('0x37')](_0x5e10('0x3d'),this[_0x5e10('0x16')][_0x5382c2['channel']['split']('-')[0x0]][_0x5e10('0x3f')]),_0x5e10('0x80'),{'destaccountcode':this[_0x5e10('0x16')][_0x5382c2[_0x5e10('0x35')][_0x5e10('0x3e')]('-')[0x0]][_0x5e10('0x40')]});}}ami[_0x5e10('0x2d')](_0x5e10('0x81'),this[_0x5e10('0x15')][_0x5382c2[_0x5e10('0x2e')]]);delete this[_0x5e10('0x15')][_0x5382c2[_0x5e10('0x2e')]];}}}catch(_0x3b158b){logger[_0x5e10('0x7b')](_0x5e10('0x82'),util[_0x5e10('0x33')](_0x3b158b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x23')]=function(_0xc9b8){try{if(this[_0x5e10('0x2b')](_0xc9b8)){if(this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x83')]]){this[_0x5e10('0x15')][_0xc9b8['transfereeuniqueid']]['transfercalleridnum']=_0xc9b8[_0x5e10('0x84')];this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x83')]][_0x5e10('0x85')]=_0xc9b8['transfertargetcalleridnum'];if(this['channels'][_0xc9b8[_0x5e10('0x86')]]){var _0x54c406=this[_0x5e10('0x15')][_0xc9b8['secondtransfereruniqueid']];this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x86')]]=this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x83')]];this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x83')]]=_0x54c406;}}else if(this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x87')]]){this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x87')]][_0x5e10('0x88')]=_0xc9b8[_0x5e10('0x84')];this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x87')]][_0x5e10('0x85')]=_0xc9b8[_0x5e10('0x89')];if(this['channels'][_0xc9b8[_0x5e10('0x8a')]]){var _0x54c406=this['channels'][_0xc9b8[_0x5e10('0x8a')]];this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x8a')]]=this[_0x5e10('0x15')][_0xc9b8['transfertargetuniqueid']];this[_0x5e10('0x15')][_0xc9b8[_0x5e10('0x87')]]=_0x54c406;}}}}catch(_0x1019b8){logger[_0x5e10('0x7b')]('[syncAttendedTransfer][VoiceCallReport]',util['inspect'](_0x1019b8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x8b')]=function(_0xe0be7){try{if(this[_0x5e10('0x2b')](_0xe0be7)){if(this[_0x5e10('0x15')][_0xe0be7[_0x5e10('0x83')]]){this[_0x5e10('0x15')][_0xe0be7[_0x5e10('0x83')]]['transfercalleridnum']=_0xe0be7['transfereecalleridnum'];this[_0x5e10('0x15')][_0xe0be7[_0x5e10('0x83')]][_0x5e10('0x85')]=_0xe0be7[_0x5e10('0x8c')];this[_0x5e10('0x1f')]({'event':_0x5e10('0x8d'),'uniqueid':_0xe0be7[_0x5e10('0x83')],'context':_0xe0be7[_0x5e10('0x3b')],'channel':_0xe0be7[_0x5e10('0x8e')]});}}}catch(_0x31c33e){logger[_0x5e10('0x7b')](_0x5e10('0x8f'),util[_0x5e10('0x33')](_0x31c33e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x24')]=function(_0x499979){try{if(this[_0x5e10('0x2b')](_0x499979)){if(this['channels'][_0x499979[_0x5e10('0x2e')]]){if(!_['isNil'](this[_0x5e10('0x15')][_0x499979[_0x5e10('0x2e')]][_0x5e10('0x51')])){this[_0x5e10('0x15')][_0x499979[_0x5e10('0x2e')]][_0x5e10('0x90')]=moment()['format'](_0x5e10('0x4a'));}}}}catch(_0x484fd5){logger['error'](_0x5e10('0x91'),util[_0x5e10('0x33')](_0x484fd5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5e10('0x2a')][_0x5e10('0x26')]=function(_0x42cd7c){try{if(this['isNotNull'](_0x42cd7c)){if(this[_0x5e10('0x15')][_0x42cd7c[_0x5e10('0x2e')]]){if(!_['isNil'](this[_0x5e10('0x15')][_0x42cd7c['uniqueid']][_0x5e10('0x90')])){this[_0x5e10('0x15')][_0x42cd7c['uniqueid']][_0x5e10('0x92')]+=moment()['milliseconds'](0x0)[_0x5e10('0x53')](this[_0x5e10('0x15')][_0x42cd7c[_0x5e10('0x2e')]][_0x5e10('0x90')],_0x5e10('0x49'));delete this[_0x5e10('0x15')][_0x42cd7c[_0x5e10('0x2e')]][_0x5e10('0x90')];}}}}catch(_0x216e44){logger['error']('[syncMusicOnHoldStop][VoiceCallReport]',util['inspect'](_0x216e44,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0x074a=['lodash','moment','util','ioredis','../../../config/logger','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','newexten','bind','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstop','resolve','actionCoreShowChannels','catch','log','prototype','isNotNull','emit','linkedid','merge','uniqueid','keys','error','inspect','channel','OutgoingSpoolFailed','isUndefined','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','pick','split','destconnectedlinenum','exten','user:%s','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','application','toLowerCase','applicationdata','duration','subtract','seconds','lastapplication','lastdata','startsWith','match','[syncNewExten][VoiceCallReport]','answered','holdtime','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','toNumber','UserId','membername','syncMixMonitorFilename','endsWith','.WAV','find','isNil','monitors','push','rec','variable','mixmonitor_filename','xmd-phone','xmd-callerid','xmd-cdrtype','value','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','destination','xmd-callerid-preview','xmcs-queue','sipcallid','sipcalluniqueid','sipcalllinkedid','diff','billableseconds','answertime','context','from-sip','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','transfererchannel','[syncBlindTransfer][VoiceCallReport]','syncMusicOnHoldStart','mohstarttime','syncMusicOnHoldStop','mohtime','milliseconds','bluebird'];(function(_0x3b27d1,_0x30fe89){var _0x30e16c=function(_0x220223){while(--_0x220223){_0x3b27d1['push'](_0x3b27d1['shift']());}};_0x30e16c(++_0x30fe89);}(_0x074a,0x97));var _0xa074=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x074a[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0xa074('0x0'));var _=require(_0xa074('0x1'));var moment=require(_0xa074('0x2'));var util=require(_0xa074('0x3'));var path=require('path');var Redis=require(_0xa074('0x4'));var config=require('../../../config/environment');var logger=require(_0xa074('0x5'))('ami');var ami=require('../ami');var Channel=require(_0xa074('0x6'));var statusDesc=[_0xa074('0x7'),_0xa074('0x8'),_0xa074('0x9'),_0xa074('0xa'),_0xa074('0xb'),_0xa074('0xc'),_0xa074('0xd'),_0xa074('0xe'),_0xa074('0xf')];var applications=[_0xa074('0x10'),_0xa074('0x11'),_0xa074('0x12'),_0xa074('0x13'),_0xa074('0x14'),_0xa074('0x15')];var dispositions=[_0xa074('0x16'),_0xa074('0x17'),_0xa074('0x17'),_0xa074('0x16'),_0xa074('0x16'),_0xa074('0x16'),_0xa074('0x18'),_0xa074('0x19'),_0xa074('0x17'),_0xa074('0x17'),_0xa074('0x17')];var actions={};config[_0xa074('0x1a')]=_[_0xa074('0x1b')](config[_0xa074('0x1a')],{'host':_0xa074('0x1c'),'port':0x18eb});var io=require(_0xa074('0x1d'))(new Redis(config['redis']));function VoiceCallReport(_0x6a23b8){this[_0xa074('0x1e')]=_0x6a23b8[_0xa074('0x1e')];this[_0xa074('0x1f')]=_0x6a23b8[_0xa074('0x1f')];ami['on'](_0xa074('0x20'),this[_0xa074('0x21')]['bind'](this));ami['on'](_0xa074('0x22'),this['syncNewExten'][_0xa074('0x23')](this));ami['on']('newchannel',this[_0xa074('0x24')][_0xa074('0x23')](this));ami['on'](_0xa074('0x25'),this[_0xa074('0x26')][_0xa074('0x23')](this));ami['on'](_0xa074('0x27'),this[_0xa074('0x28')][_0xa074('0x23')](this));ami['on'](_0xa074('0x29'),this[_0xa074('0x2a')]['bind'](this));ami['on'](_0xa074('0x2b'),this[_0xa074('0x2c')][_0xa074('0x23')](this));ami['on'](_0xa074('0x2d'),this[_0xa074('0x2e')]['bind'](this));ami['on'](_0xa074('0x2f'),this[_0xa074('0x30')][_0xa074('0x23')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0xa074('0x23')](this));ami['on'](_0xa074('0x31'),this['syncMusicOnHoldStop']['bind'](this));return BPromise[_0xa074('0x32')]()['then'](ami[_0xa074('0x33')]())[_0xa074('0x34')](function(_0xcdf3c){console[_0xa074('0x35')](_0xcdf3c);});}VoiceCallReport[_0xa074('0x36')][_0xa074('0x37')]=function(_0x5aa091){return _0x5aa091!==null&&!_['isUndefined'](_0x5aa091);};VoiceCallReport[_0xa074('0x36')][_0xa074('0x38')]=function(_0x13a58a,_0x354a03,_0x404eb8){io['to'](_0x13a58a)[_0xa074('0x38')](_0x354a03,_0x404eb8);};VoiceCallReport[_0xa074('0x36')][_0xa074('0x2c')]=function(_0xfc9241){try{if(this[_0xa074('0x37')](_0xfc9241)){if(_0xfc9241['uniqueid']===_0xfc9241[_0xa074('0x39')]){if(!_['isUndefined'](this[_0xa074('0x1e')][_0xfc9241['uniqueid']])){_[_0xa074('0x3a')](this[_0xa074('0x1e')][_0xfc9241[_0xa074('0x3b')]],_['pick'](_0xfc9241,_[_0xa074('0x3c')](this[_0xa074('0x1e')][_0xfc9241['uniqueid']])));}}}}catch(_0x15527b){logger[_0xa074('0x3d')]('[syncNewCallerId][VoiceCallReport]',util[_0xa074('0x3e')](_0x15527b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewChannel']=function(_0x238096){try{if(this[_0xa074('0x37')](_0x238096)){if(_0x238096['uniqueid']===_0x238096[_0xa074('0x39')]&&_0x238096[_0xa074('0x3f')]!=_0xa074('0x40')){if(_[_0xa074('0x41')](this[_0xa074('0x1e')][_0x238096[_0xa074('0x3b')]])){this[_0xa074('0x1e')][_0x238096[_0xa074('0x3b')]]=new Channel();this[_0xa074('0x1e')][_0x238096['uniqueid']][_0xa074('0x42')]=moment()[_0xa074('0x43')](_0xa074('0x44'));this[_0xa074('0x1e')][_0x238096[_0xa074('0x3b')]][_0xa074('0x45')]=dispositions[_['toNumber'](_0x238096[_0xa074('0x46')])];_['merge'](this[_0xa074('0x1e')][_0x238096[_0xa074('0x3b')]],_[_0xa074('0x47')](_0x238096,_['keys'](this['channels'][_0x238096['uniqueid']])));if(_0x238096['context']==='from-sip'){if(this[_0xa074('0x1f')][_0x238096[_0xa074('0x3f')][_0xa074('0x48')]('-')[0x0]]){this[_0xa074('0x1f')][_0x238096[_0xa074('0x3f')][_0xa074('0x48')]('-')[0x0]][_0xa074('0x49')]=_0x238096[_0xa074('0x4a')];this[_0xa074('0x38')](util['format'](_0xa074('0x4b'),this[_0xa074('0x1f')][_0x238096[_0xa074('0x3f')]['split']('-')[0x0]][_0xa074('0x4c')]),_0xa074('0x4d'),{'destaccountcode':this[_0xa074('0x1f')][_0x238096[_0xa074('0x3f')]['split']('-')[0x0]][_0xa074('0x4e')],'destconnectedlinenum':_0x238096['exten']});}}}}}}catch(_0x5708d5){logger['error'](_0xa074('0x4f'),util[_0xa074('0x3e')](_0x5708d5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa074('0x36')]['syncNewExten']=function(_0x288820){try{if(this['isNotNull'](_0x288820)){if(_0x288820['uniqueid']===_0x288820[_0xa074('0x39')]&&_0x288820[_0xa074('0x4a')]!='h'&&_0x288820[_0xa074('0x3f')]!=_0xa074('0x40')){_0x288820[_0xa074('0x50')]=_0x288820[_0xa074('0x50')][_0xa074('0x51')]();_0x288820[_0xa074('0x52')]=(_0x288820['appdata']||_0x288820[_0xa074('0x52')])[_0xa074('0x51')]();if(_[_0xa074('0x41')](this[_0xa074('0x1e')][_0x288820[_0xa074('0x3b')]])){this[_0xa074('0x1e')][_0x288820[_0xa074('0x3b')]]=new Channel();this[_0xa074('0x1e')][_0x288820[_0xa074('0x3b')]][_0xa074('0x42')]=_0x288820[_0xa074('0x53')]?moment()[_0xa074('0x54')](moment[_0xa074('0x53')](_0x288820[_0xa074('0x53')])['seconds'](),_0xa074('0x55'))['format'](_0xa074('0x44')):moment()[_0xa074('0x43')](_0xa074('0x44'));this[_0xa074('0x1e')][_0x288820[_0xa074('0x3b')]][_0xa074('0x45')]=_0xa074('0x16');}_[_0xa074('0x3a')](this['channels'][_0x288820[_0xa074('0x3b')]],_['pick'](_0x288820,_['keys'](this[_0xa074('0x1e')][_0x288820[_0xa074('0x3b')]])));if(_['includes'](applications,_0x288820[_0xa074('0x50')])){this[_0xa074('0x1e')][_0x288820[_0xa074('0x3b')]][_0xa074('0x56')]=_0x288820['application'];this[_0xa074('0x1e')][_0x288820[_0xa074('0x3b')]][_0xa074('0x57')]=_0x288820[_0xa074('0x52')];if(_0x288820['application']==='set'&&_[_0xa074('0x58')](_0x288820['applicationdata'],'cdr(')){var _0x50ced6=_0x288820[_0xa074('0x52')][_0xa074('0x48')]('=');var _0x32c053=_0x50ced6[0x0][_0xa074('0x59')](/cdr\((.*)\)/);if(_0x32c053){this['channels'][_0x288820[_0xa074('0x3b')]][_0x32c053[0x1]]=_0x50ced6[0x1];}}else if(_0x288820[_0xa074('0x50')]===_0xa074('0x11')){this[_0xa074('0x1e')][_0x288820[_0xa074('0x3b')]][_0xa074('0x11')]=_0x288820[_0xa074('0x52')][_0xa074('0x48')](',')[0x0];}}}}}catch(_0x419e29){logger[_0xa074('0x3d')](_0xa074('0x5a'),util[_0xa074('0x3e')](_0x419e29,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa074('0x36')][_0xa074('0x26')]=function(_0x239d40){try{if(this[_0xa074('0x37')](_0x239d40)){if(_0x239d40[_0xa074('0x3b')]!==_0x239d40[_0xa074('0x39')]){if(this['channels'][_0x239d40[_0xa074('0x39')]]){if(_0x239d40[_0xa074('0x46')]==='6'){if(!this[_0xa074('0x1e')][_0x239d40[_0xa074('0x39')]][_0xa074('0x5b')]){var _0x53cee7=moment();this[_0xa074('0x1e')][_0x239d40[_0xa074('0x39')]][_0xa074('0x5b')]=!![];this[_0xa074('0x1e')][_0x239d40[_0xa074('0x39')]]['answertime']=_0x53cee7['format'](_0xa074('0x44'));if(this[_0xa074('0x1e')][_0x239d40[_0xa074('0x39')]][_0xa074('0x42')]){this['channels'][_0x239d40[_0xa074('0x39')]][_0xa074('0x5c')]=_0x53cee7['diff'](this[_0xa074('0x1e')][_0x239d40[_0xa074('0x39')]][_0xa074('0x42')],_0xa074('0x55'));}}this[_0xa074('0x1e')][_0x239d40[_0xa074('0x39')]][_0xa074('0x39')]=_0x239d40['uniqueid'];if(_0x239d40[_0xa074('0x5d')]!==_0xa074('0x5e')){this[_0xa074('0x1e')][_0x239d40[_0xa074('0x39')]][_0xa074('0x5f')]=_0x239d40[_0xa074('0x5d')];}this[_0xa074('0x1e')][_0x239d40[_0xa074('0x39')]][_0xa074('0x60')]=_0x239d40[_0xa074('0x61')];this[_0xa074('0x1e')][_0x239d40['linkedid']][_0xa074('0x62')]=_0x239d40[_0xa074('0x3f')];this[_0xa074('0x1e')][_0x239d40[_0xa074('0x39')]][_0xa074('0x45')]=dispositions[_[_0xa074('0x63')](_0x239d40[_0xa074('0x46')])];if(this[_0xa074('0x1f')][_0x239d40[_0xa074('0x3f')][_0xa074('0x48')]('-')[0x0]]){this[_0xa074('0x1e')][_0x239d40['linkedid']][_0xa074('0x64')]=this[_0xa074('0x1f')][_0x239d40['channel'][_0xa074('0x48')]('-')[0x0]]['id'];this['channels'][_0x239d40[_0xa074('0x39')]][_0xa074('0x65')]=this[_0xa074('0x1f')][_0x239d40['channel'][_0xa074('0x48')]('-')[0x0]][_0xa074('0x4c')];}}}}else{if(this[_0xa074('0x1e')][_0x239d40[_0xa074('0x3b')]]){if(_0x239d40[_0xa074('0x46')]==='6'){if(this[_0xa074('0x1f')][_0x239d40[_0xa074('0x3f')][_0xa074('0x48')]('-')[0x0]]){this[_0xa074('0x1e')][_0x239d40[_0xa074('0x3b')]][_0xa074('0x64')]=this[_0xa074('0x1f')][_0x239d40[_0xa074('0x3f')][_0xa074('0x48')]('-')[0x0]]['id'];this['channels'][_0x239d40['uniqueid']][_0xa074('0x65')]=this[_0xa074('0x1f')][_0x239d40[_0xa074('0x3f')][_0xa074('0x48')]('-')[0x0]][_0xa074('0x4c')];}}}}}}catch(_0x57f392){logger[_0xa074('0x3d')]('[syncNewState][VoiceCallReport]',util['inspect'](_0x57f392,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa074('0x36')][_0xa074('0x66')]=function(_0x1f87d2,_0x184129){if(this[_0xa074('0x1e')][_0x1f87d2]){this[_0xa074('0x1e')][_0x1f87d2]['monitor']=!![];if(_[_0xa074('0x67')](_0x184129,'.wav49')){_0x184129=_0x184129['replace']('.wav49',_0xa074('0x68'));}this['channels'][_0x1f87d2]['monitorFilename']=_0x184129;var _0x3278e0=_[_0xa074('0x69')](this[_0xa074('0x1e')][_0x1f87d2]['monitors'],{'filename':_0x184129});if(_[_0xa074('0x6a')](_0x3278e0)){this[_0xa074('0x1e')][_0x1f87d2][_0xa074('0x6b')][_0xa074('0x6c')]({'filename':_0x184129,'createdAt':moment()[_0xa074('0x43')](_0xa074('0x44')),'mixmonitorid':'','status':_0xa074('0x6d')});}}};VoiceCallReport[_0xa074('0x36')][_0xa074('0x28')]=function(_0x2c2f37){try{if(this['isNotNull'](_0x2c2f37)){if(this[_0xa074('0x1e')][_0x2c2f37['uniqueid']]&&_0x2c2f37[_0xa074('0x3f')]!=_0xa074('0x40')){if(this[_0xa074('0x37')](_0x2c2f37[_0xa074('0x6e')])){if(this[_0xa074('0x37')](_0x2c2f37[_0xa074('0x6e')][_0xa074('0x6f')])){this[_0xa074('0x66')](_0x2c2f37[_0xa074('0x3b')],_0x2c2f37['value']);}else if(this[_0xa074('0x37')](_0x2c2f37['variable'][_0xa074('0x70')])){this[_0xa074('0x1e')][_0x2c2f37[_0xa074('0x3b')]][_0xa074('0x5d')]=_0x2c2f37['value'];}else if(this['isNotNull'](_0x2c2f37['variable'][_0xa074('0x71')])){this[_0xa074('0x1e')][_0x2c2f37[_0xa074('0x3b')]]['callerid']=_0x2c2f37['value'];}else if(this['isNotNull'](_0x2c2f37[_0xa074('0x6e')][_0xa074('0x72')])){this[_0xa074('0x1e')][_0x2c2f37[_0xa074('0x3b')]]['type']=_0x2c2f37[_0xa074('0x73')];}else if(this[_0xa074('0x37')](_0x2c2f37[_0xa074('0x6e')][_0xa074('0x74')])){this[_0xa074('0x1e')][_0x2c2f37[_0xa074('0x3b')]][_0xa074('0x11')]=_0x2c2f37['value'][_0xa074('0x48')](',')[0x0];}else if(this[_0xa074('0x37')](_0x2c2f37[_0xa074('0x6e')][_0xa074('0x75')])){this[_0xa074('0x1e')][_0x2c2f37[_0xa074('0x3b')]][_0xa074('0x76')]=_0x2c2f37['value'];}else if(this['isNotNull'](_0x2c2f37[_0xa074('0x6e')]['xmd-destination'])){this[_0xa074('0x1e')][_0x2c2f37[_0xa074('0x3b')]][_0xa074('0x77')]=_0x2c2f37[_0xa074('0x73')];}else if(this['isNotNull'](_0x2c2f37[_0xa074('0x6e')][_0xa074('0x78')])){this['channels'][_0x2c2f37['uniqueid']]['calleridpreview']=_0x2c2f37[_0xa074('0x73')];}else if(this[_0xa074('0x37')](_0x2c2f37[_0xa074('0x6e')][_0xa074('0x79')])){this[_0xa074('0x1e')][_0x2c2f37['uniqueid']]['queue']=_0x2c2f37[_0xa074('0x73')];}else if(this[_0xa074('0x37')](_0x2c2f37[_0xa074('0x6e')][_0xa074('0x7a')])){this[_0xa074('0x1e')][_0x2c2f37[_0xa074('0x3b')]][_0xa074('0x7b')]=_0x2c2f37[_0xa074('0x73')];}}}else if(this[_0xa074('0x37')](_0x2c2f37['variable'][_0xa074('0x6f')])){if(_0x2c2f37[_0xa074('0x73')]){var _0x383ce8=path['parse'](_0x2c2f37[_0xa074('0x73')])['name'];this['syncMixMonitorFilename'](_0x383ce8,_0x2c2f37[_0xa074('0x73')]);}}else if(this[_0xa074('0x1e')][_0x2c2f37[_0xa074('0x39')]]){if(this[_0xa074('0x37')](_0x2c2f37[_0xa074('0x6e')])){if(this[_0xa074('0x37')](_0x2c2f37[_0xa074('0x6e')]['sipcallid'])){this[_0xa074('0x1e')][_0x2c2f37[_0xa074('0x39')]][_0xa074('0x7c')]=_0x2c2f37[_0xa074('0x73')];}}}}}catch(_0x2bef5f){logger['error']('[syncVarSet][VoiceCallReport]',util[_0xa074('0x3e')](_0x2bef5f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa074('0x2a')]=function(_0x30a63d){try{if(this[_0xa074('0x37')](_0x30a63d)){if(this[_0xa074('0x1e')][_0x30a63d[_0xa074('0x3b')]]){var _0xfd446a=moment();this[_0xa074('0x1e')][_0x30a63d[_0xa074('0x3b')]]['endtime']=_0xfd446a['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x30a63d['uniqueid']][_0xa074('0x53')]=_0xfd446a[_0xa074('0x7d')](this[_0xa074('0x1e')][_0x30a63d[_0xa074('0x3b')]][_0xa074('0x42')],'seconds');if(this[_0xa074('0x1e')][_0x30a63d[_0xa074('0x3b')]][_0xa074('0x5b')]){this[_0xa074('0x1e')][_0x30a63d[_0xa074('0x3b')]][_0xa074('0x7e')]=_0xfd446a[_0xa074('0x7d')](this[_0xa074('0x1e')][_0x30a63d[_0xa074('0x3b')]][_0xa074('0x7f')],_0xa074('0x55'));this[_0xa074('0x1e')][_0x30a63d[_0xa074('0x3b')]][_0xa074('0x5c')]=this[_0xa074('0x1e')][_0x30a63d[_0xa074('0x3b')]][_0xa074('0x53')]-this[_0xa074('0x1e')][_0x30a63d[_0xa074('0x3b')]][_0xa074('0x7e')];}if(_0x30a63d[_0xa074('0x80')]===_0xa074('0x81')){if(this[_0xa074('0x1f')][_0x30a63d['channel'][_0xa074('0x48')]('-')[0x0]]){this[_0xa074('0x1f')][_0x30a63d[_0xa074('0x3f')][_0xa074('0x48')]('-')[0x0]]=_[_0xa074('0x82')](this[_0xa074('0x1f')][_0x30a63d[_0xa074('0x3f')][_0xa074('0x48')]('-')[0x0]],[_0xa074('0x49')]);this[_0xa074('0x38')](util[_0xa074('0x43')]('user:%s',this[_0xa074('0x1f')][_0x30a63d['channel']['split']('-')[0x0]]['name']),_0xa074('0x83'),{'destaccountcode':this['agents'][_0x30a63d['channel'][_0xa074('0x48')]('-')[0x0]][_0xa074('0x4e')]});}}ami[_0xa074('0x38')](_0xa074('0x84'),this[_0xa074('0x1e')][_0x30a63d['uniqueid']]);delete this[_0xa074('0x1e')][_0x30a63d[_0xa074('0x3b')]];}}}catch(_0x25b3bb){logger[_0xa074('0x3d')](_0xa074('0x85'),util['inspect'](_0x25b3bb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa074('0x36')][_0xa074('0x2e')]=function(_0x251051){try{if(this[_0xa074('0x37')](_0x251051)){if(this[_0xa074('0x1e')][_0x251051['transfereeuniqueid']]){this[_0xa074('0x1e')][_0x251051[_0xa074('0x86')]][_0xa074('0x87')]=_0x251051[_0xa074('0x88')];this[_0xa074('0x1e')][_0x251051[_0xa074('0x86')]][_0xa074('0x89')]=_0x251051[_0xa074('0x8a')];if(this[_0xa074('0x1e')][_0x251051[_0xa074('0x8b')]]){var _0x26f9cc=this[_0xa074('0x1e')][_0x251051['secondtransfereruniqueid']];this[_0xa074('0x1e')][_0x251051['secondtransfereruniqueid']]=this[_0xa074('0x1e')][_0x251051['transfereeuniqueid']];this[_0xa074('0x1e')][_0x251051['transfereeuniqueid']]=_0x26f9cc;}}else if(this[_0xa074('0x1e')][_0x251051[_0xa074('0x8c')]]){this[_0xa074('0x1e')][_0x251051[_0xa074('0x8c')]][_0xa074('0x87')]=_0x251051[_0xa074('0x88')];this[_0xa074('0x1e')][_0x251051[_0xa074('0x8c')]][_0xa074('0x89')]=_0x251051['transfertargetcalleridnum'];if(this[_0xa074('0x1e')][_0x251051[_0xa074('0x8d')]]){var _0x26f9cc=this['channels'][_0x251051['origtransfereruniqueid']];this['channels'][_0x251051[_0xa074('0x8d')]]=this[_0xa074('0x1e')][_0x251051['transfertargetuniqueid']];this[_0xa074('0x1e')][_0x251051[_0xa074('0x8c')]]=_0x26f9cc;}}}}catch(_0xbdc51e){logger[_0xa074('0x3d')](_0xa074('0x8e'),util[_0xa074('0x3e')](_0xbdc51e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa074('0x36')][_0xa074('0x30')]=function(_0x168c44){try{if(this[_0xa074('0x37')](_0x168c44)){if(this[_0xa074('0x1e')][_0x168c44[_0xa074('0x86')]]){this[_0xa074('0x1e')][_0x168c44[_0xa074('0x86')]][_0xa074('0x87')]=_0x168c44[_0xa074('0x8f')];this[_0xa074('0x1e')][_0x168c44[_0xa074('0x86')]][_0xa074('0x89')]=_0x168c44[_0xa074('0x90')];this[_0xa074('0x2a')]({'event':'BlindTransfer','uniqueid':_0x168c44[_0xa074('0x86')],'context':_0x168c44['context'],'channel':_0x168c44[_0xa074('0x91')]});}}}catch(_0x5c8a1a){logger['error'](_0xa074('0x92'),util[_0xa074('0x3e')](_0x5c8a1a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa074('0x36')][_0xa074('0x93')]=function(_0x5a780a){try{if(this[_0xa074('0x37')](_0x5a780a)){if(this['channels'][_0x5a780a[_0xa074('0x3b')]]){if(!_[_0xa074('0x6a')](this[_0xa074('0x1e')][_0x5a780a[_0xa074('0x3b')]]['answertime'])){this['channels'][_0x5a780a[_0xa074('0x3b')]][_0xa074('0x94')]=moment()[_0xa074('0x43')](_0xa074('0x44'));}}}}catch(_0x3dedb5){logger[_0xa074('0x3d')]('[syncMusicOnHoldStart][VoiceCallReport]',util['inspect'](_0x3dedb5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa074('0x95')]=function(_0x108596){try{if(this[_0xa074('0x37')](_0x108596)){if(this[_0xa074('0x1e')][_0x108596[_0xa074('0x3b')]]){if(!_['isNil'](this[_0xa074('0x1e')][_0x108596['uniqueid']][_0xa074('0x94')])){this[_0xa074('0x1e')][_0x108596[_0xa074('0x3b')]][_0xa074('0x96')]+=moment()[_0xa074('0x97')](0x0)[_0xa074('0x7d')](this[_0xa074('0x1e')][_0x108596[_0xa074('0x3b')]][_0xa074('0x94')],_0xa074('0x55'));delete this[_0xa074('0x1e')][_0x108596['uniqueid']][_0xa074('0x94')];}}}}catch(_0x5c9041){logger[_0xa074('0x3d')]('[syncMusicOnHoldStop][VoiceCallReport]',util['inspect'](_0x5c9041,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index c158a8e..4bcc7cd 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 _0x78e4=['format','lastevent','voice_outbound_channel:save','[syncDialEnd][VoiceDialReport]','addVariable','variable','value','outboundrouteid','voice:outbound','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','duration','diff','starttime','seconds','total','answered','billableseconds','endtime','sumHoldTime','holdtime','sumDuration','custom:dialend','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','localhost','socket.io-emitter','redis','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','isNotNull','isUndefined','prototype','emit','channels','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','privilege','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x78e4,0x194));var _0x478e=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x78e4[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0x478e('0x0'));var moment=require(_0x478e('0x1'));var util=require(_0x478e('0x2'));var Redis=require(_0x478e('0x3'));var config=require(_0x478e('0x4'));var logger=require(_0x478e('0x5'))(_0x478e('0x6'));var ami=require(_0x478e('0x7'));config['redis']=_[_0x478e('0x8')](config['redis'],{'host':_0x478e('0x9'),'port':0x18eb});var io=require(_0x478e('0xa'))(new Redis(config[_0x478e('0xb')]));function VoiceDialReport(_0xbcbddb){this['channels']=_0xbcbddb[_0x478e('0xc')];this[_0x478e('0xd')]=_0xbcbddb[_0x478e('0xd')];this[_0x478e('0xe')]={};ami['on'](_0x478e('0xf'),this[_0x478e('0x10')][_0x478e('0x11')](this));ami['on'](_0x478e('0x12'),this[_0x478e('0x13')][_0x478e('0x11')](this));ami['on'](_0x478e('0x14'),this[_0x478e('0x15')][_0x478e('0x11')](this));ami['on']('hangup',this['syncHangup'][_0x478e('0x11')](this));}VoiceDialReport['prototype'][_0x478e('0x16')]=function(_0x2aa6c8){return _0x2aa6c8!==null&&!_[_0x478e('0x17')](_0x2aa6c8);};VoiceDialReport[_0x478e('0x18')][_0x478e('0x19')]=function(_0x1d323a,_0x4551d2,_0x4a9af7){io['to'](_0x1d323a)[_0x478e('0x19')](_0x4551d2,_0x4a9af7);};VoiceDialReport[_0x478e('0x18')][_0x478e('0x10')]=function(_0xfc0402){try{if(this[_0x478e('0x16')](_0xfc0402)){if(this[_0x478e('0x1a')][_0xfc0402[_0x478e('0x1b')]]){_[_0x478e('0x1c')](this[_0x478e('0x1a')][_0xfc0402['uniqueid']],{'starttime':moment()['format'](_0x478e('0x1d')),'lastevent':_0x478e('0x1e'),'interface':_0xfc0402[_0x478e('0x1f')][_0x478e('0x20')](0x0,_0xfc0402[_0x478e('0x1f')][_0x478e('0x21')]('-')),'membername':_0xfc0402[_0x478e('0x1f')]['substring'](_0xfc0402[_0x478e('0x1f')][_0x478e('0x21')]('/')+0x1,_0xfc0402[_0x478e('0x1f')]['lastIndexOf']('-'))},_[_0x478e('0x22')](_0xfc0402,[_0x478e('0x23'),_0x478e('0x24')]));this[_0x478e('0x19')]('voice:outbound','voice_outbound_channel:save',this['channels'][_0xfc0402[_0x478e('0x1b')]]);ami[_0x478e('0x19')](_0x478e('0x25'),this[_0x478e('0x1a')][_0xfc0402[_0x478e('0x1b')]]);}}}catch(_0x42d287){logger[_0x478e('0x26')](_0x478e('0x27'),util[_0x478e('0x28')](_0x42d287,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x478e('0x13')]=function(_0x226bd7){try{if(this[_0x478e('0x16')](_0x226bd7)){if(this[_0x478e('0x1a')][_0x226bd7[_0x478e('0x1b')]]){this[_0x478e('0x1a')][_0x226bd7[_0x478e('0x1b')]][_0x478e('0x29')]=_0x226bd7[_0x478e('0x29')];if(_0x226bd7[_0x478e('0x29')]===_0x478e('0x2a')){this[_0x478e('0x1a')][_0x226bd7['uniqueid']][_0x478e('0x2b')]=_0x226bd7[_0x478e('0x2b')];this[_0x478e('0x1a')][_0x226bd7[_0x478e('0x1b')]][_0x478e('0x2c')]=_0x226bd7[_0x478e('0x2c')];this['channels'][_0x226bd7[_0x478e('0x1b')]][_0x478e('0x2d')]=moment()[_0x478e('0x2e')](_0x478e('0x1d'));this[_0x478e('0x1a')][_0x226bd7[_0x478e('0x1b')]][_0x478e('0x2f')]='connect';ami[_0x478e('0x19')]('custom:dialconnect',this['channels'][_0x226bd7['uniqueid']]);}this[_0x478e('0x19')]('voice:outbound',_0x478e('0x30'),this[_0x478e('0x1a')][_0x226bd7[_0x478e('0x1b')]]);}}}catch(_0xa0a42e){logger[_0x478e('0x26')](_0x478e('0x31'),util[_0x478e('0x28')](_0xa0a42e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x478e('0x18')][_0x478e('0x15')]=function(_0x40a4a1){try{if(this['isNotNull'](_0x40a4a1)){this[_0x478e('0x32')](_0x40a4a1['uniqueid'],_['keys'](_0x40a4a1[_0x478e('0x33')])[0x0],_0x40a4a1[_0x478e('0x34')]);if(this['isNotNull'](_0x40a4a1[_0x478e('0x33')])&&this[_0x478e('0x16')](_0x40a4a1[_0x478e('0x33')][_0x478e('0x35')])){if(_[_0x478e('0x17')](this[_0x478e('0x1a')][_0x40a4a1[_0x478e('0x1b')]])){this['channels'][_0x40a4a1[_0x478e('0x1b')]]={'routeId':_0x40a4a1['value'],'variables':this['variables'][_0x40a4a1[_0x478e('0x1b')]]};this[_0x478e('0x19')](_0x478e('0x36'),'voice_outbound_channel:save',this[_0x478e('0x1a')][_0x40a4a1[_0x478e('0x1b')]]);}}}}catch(_0x48678e){logger['error']('[syncVarSet][VoiceDialReport]',util['inspect'](_0x48678e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x478e('0x18')][_0x478e('0x32')]=function(_0x5c63d3,_0x3d07f7,_0x4f22f9){var _0x1fb9c4=[_0x478e('0x37'),_0x478e('0x38'),_0x478e('0x39'),_0x478e('0x3a'),_0x478e('0x3b'),_0x478e('0x3c'),_0x478e('0x3d'),'rtpaudioqosrttbridged',_0x478e('0x3e'),'sipuri',_0x478e('0x3f'),_0x478e('0x40'),_0x478e('0x41'),_0x478e('0x42'),_0x478e('0x43'),_0x478e('0x44'),'membername',_0x478e('0x45'),_0x478e('0x46')];if(!_[_0x478e('0x47')](_0x3d07f7)&&!_[_0x478e('0x48')](_0x1fb9c4,_0x3d07f7)){if(_[_0x478e('0x17')](this[_0x478e('0xe')][_0x5c63d3])){this[_0x478e('0xe')][_0x5c63d3]={};}this['variables'][_0x5c63d3][_0x3d07f7]=_0x4f22f9;}};VoiceDialReport[_0x478e('0x18')]['syncHangup']=function(_0x4b1354){try{if(this[_0x478e('0x16')](_0x4b1354)){if(this[_0x478e('0x1a')][_0x4b1354[_0x478e('0x1b')]]){this[_0x478e('0x1a')][_0x4b1354[_0x478e('0x1b')]]['endtime']=moment()[_0x478e('0x2e')](_0x478e('0x1d'));this['channels'][_0x4b1354['uniqueid']][_0x478e('0x49')]=moment(this[_0x478e('0x1a')][_0x4b1354[_0x478e('0x1b')]]['endtime'])[_0x478e('0x4a')](this['channels'][_0x4b1354[_0x478e('0x1b')]][_0x478e('0x4b')],_0x478e('0x4c'));this[_0x478e('0x1a')][_0x4b1354['uniqueid']]['lastevent']='complete';this[_0x478e('0xd')][_0x478e('0x4d')]+=0x1;if(this[_0x478e('0x1a')][_0x4b1354[_0x478e('0x1b')]]['answertime']){this[_0x478e('0xd')][_0x478e('0x4e')]+=0x1;this[_0x478e('0x1a')][_0x4b1354[_0x478e('0x1b')]]['holdtime']=moment(this[_0x478e('0x1a')][_0x4b1354[_0x478e('0x1b')]][_0x478e('0x2d')])['diff'](this[_0x478e('0x1a')][_0x4b1354[_0x478e('0x1b')]][_0x478e('0x4b')],'seconds');this[_0x478e('0x1a')][_0x4b1354['uniqueid']][_0x478e('0x4f')]=moment(this[_0x478e('0x1a')][_0x4b1354[_0x478e('0x1b')]][_0x478e('0x50')])[_0x478e('0x4a')](this[_0x478e('0x1a')][_0x4b1354[_0x478e('0x1b')]][_0x478e('0x2d')],'seconds');this[_0x478e('0xd')][_0x478e('0x51')]+=this[_0x478e('0x1a')][_0x4b1354['uniqueid']][_0x478e('0x52')]||0x0;this[_0x478e('0xd')]['sumBillable']+=this[_0x478e('0x1a')][_0x4b1354[_0x478e('0x1b')]][_0x478e('0x4f')];}this[_0x478e('0xd')][_0x478e('0x53')]+=this['channels'][_0x4b1354[_0x478e('0x1b')]][_0x478e('0x49')];ami[_0x478e('0x19')]('custom:voiceDialReport',this[_0x478e('0x1a')][_0x4b1354[_0x478e('0x1b')]]);ami[_0x478e('0x19')](_0x478e('0x54'),this[_0x478e('0x1a')][_0x4b1354[_0x478e('0x1b')]]);this[_0x478e('0x19')]('voice:outbound',_0x478e('0x55'),this[_0x478e('0xd')]);logger['info'](_0x478e('0x56'),JSON[_0x478e('0x57')](this[_0x478e('0x1a')][_0x4b1354[_0x478e('0x1b')]]));this['emit'](_0x478e('0x36'),_0x478e('0x58'),this[_0x478e('0x1a')][_0x4b1354[_0x478e('0x1b')]]);delete this[_0x478e('0x1a')][_0x4b1354[_0x478e('0x1b')]];}if(this[_0x478e('0xe')][_0x4b1354[_0x478e('0x1b')]]){delete this[_0x478e('0xe')][_0x4b1354[_0x478e('0x1b')]];}}}catch(_0x1f7730){logger[_0x478e('0x26')]('[syncHangup][VoiceDialReport]',util[_0x478e('0x28')](_0x1f7730,{'showHidden':![],'depth':null}));}};module[_0x478e('0x59')]=VoiceDialReport; \ No newline at end of file +var _0xbf65=['seconds','complete','total','answered','holdtime','billableseconds','sumBillable','custom:voiceDialReport','voice_outbound:save','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','exports','lodash','moment','ioredis','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','syncHangup','prototype','isNotNull','isUndefined','emit','uniqueid','merge','channel','substring','lastIndexOf','omit','event','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','connectedlinenum','connectedlinename','answertime','format','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','error','value','variable','variables','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','isNil','endtime','duration','diff','starttime'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xbf65,0x158));var _0x5bf6=function(_0x2e846d,_0x370cd6){_0x2e846d=_0x2e846d-0x0;var _0x10a6ab=_0xbf65[_0x2e846d];return _0x10a6ab;};'use strict';var _=require(_0x5bf6('0x0'));var moment=require(_0x5bf6('0x1'));var util=require('util');var Redis=require(_0x5bf6('0x2'));var config=require('../../../config/environment');var logger=require(_0x5bf6('0x3'))(_0x5bf6('0x4'));var ami=require('../ami');config[_0x5bf6('0x5')]=_[_0x5bf6('0x6')](config[_0x5bf6('0x5')],{'host':_0x5bf6('0x7'),'port':0x18eb});var io=require(_0x5bf6('0x8'))(new Redis(config[_0x5bf6('0x5')]));function VoiceDialReport(_0x196305){this[_0x5bf6('0x9')]=_0x196305[_0x5bf6('0xa')];this['outbound']=_0x196305[_0x5bf6('0xb')];this['variables']={};ami['on'](_0x5bf6('0xc'),this[_0x5bf6('0xd')][_0x5bf6('0xe')](this));ami['on'](_0x5bf6('0xf'),this[_0x5bf6('0x10')][_0x5bf6('0xe')](this));ami['on'](_0x5bf6('0x11'),this[_0x5bf6('0x12')][_0x5bf6('0xe')](this));ami['on']('hangup',this[_0x5bf6('0x13')]['bind'](this));}VoiceDialReport[_0x5bf6('0x14')][_0x5bf6('0x15')]=function(_0x45692b){return _0x45692b!==null&&!_[_0x5bf6('0x16')](_0x45692b);};VoiceDialReport[_0x5bf6('0x14')]['emit']=function(_0x147890,_0x1da9ac,_0x80dac6){io['to'](_0x147890)[_0x5bf6('0x17')](_0x1da9ac,_0x80dac6);};VoiceDialReport[_0x5bf6('0x14')][_0x5bf6('0xd')]=function(_0x843c4e){try{if(this[_0x5bf6('0x15')](_0x843c4e)){if(this[_0x5bf6('0x9')][_0x843c4e[_0x5bf6('0x18')]]){_[_0x5bf6('0x19')](this[_0x5bf6('0x9')][_0x843c4e[_0x5bf6('0x18')]],{'starttime':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','interface':_0x843c4e[_0x5bf6('0x1a')][_0x5bf6('0x1b')](0x0,_0x843c4e[_0x5bf6('0x1a')][_0x5bf6('0x1c')]('-')),'membername':_0x843c4e[_0x5bf6('0x1a')][_0x5bf6('0x1b')](_0x843c4e[_0x5bf6('0x1a')]['lastIndexOf']('/')+0x1,_0x843c4e['channel'][_0x5bf6('0x1c')]('-'))},_[_0x5bf6('0x1d')](_0x843c4e,[_0x5bf6('0x1e'),_0x5bf6('0x1f')]));this[_0x5bf6('0x17')](_0x5bf6('0x20'),_0x5bf6('0x21'),this['channels'][_0x843c4e[_0x5bf6('0x18')]]);ami[_0x5bf6('0x17')](_0x5bf6('0x22'),this[_0x5bf6('0x9')][_0x843c4e[_0x5bf6('0x18')]]);}}}catch(_0x284ec9){logger['error'](_0x5bf6('0x23'),util[_0x5bf6('0x24')](_0x284ec9,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5bf6('0x14')]['syncDialEnd']=function(_0xb7d751){try{if(this[_0x5bf6('0x15')](_0xb7d751)){if(this[_0x5bf6('0x9')][_0xb7d751[_0x5bf6('0x18')]]){this[_0x5bf6('0x9')][_0xb7d751[_0x5bf6('0x18')]][_0x5bf6('0x25')]=_0xb7d751[_0x5bf6('0x25')];if(_0xb7d751[_0x5bf6('0x25')]==='ANSWER'){this[_0x5bf6('0x9')][_0xb7d751['uniqueid']][_0x5bf6('0x26')]=_0xb7d751[_0x5bf6('0x26')];this[_0x5bf6('0x9')][_0xb7d751[_0x5bf6('0x18')]][_0x5bf6('0x27')]=_0xb7d751[_0x5bf6('0x27')];this[_0x5bf6('0x9')][_0xb7d751['uniqueid']][_0x5bf6('0x28')]=moment()[_0x5bf6('0x29')](_0x5bf6('0x2a'));this[_0x5bf6('0x9')][_0xb7d751[_0x5bf6('0x18')]][_0x5bf6('0x2b')]=_0x5bf6('0x2c');ami[_0x5bf6('0x17')]('custom:dialconnect',this[_0x5bf6('0x9')][_0xb7d751[_0x5bf6('0x18')]]);}this[_0x5bf6('0x17')](_0x5bf6('0x20'),_0x5bf6('0x21'),this['channels'][_0xb7d751[_0x5bf6('0x18')]]);}}}catch(_0x15b63d){logger[_0x5bf6('0x2d')]('[syncDialEnd][VoiceDialReport]',util['inspect'](_0x15b63d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5bf6('0x14')][_0x5bf6('0x12')]=function(_0x2a44e7){try{if(this[_0x5bf6('0x15')](_0x2a44e7)){this['addVariable'](_0x2a44e7['uniqueid'],_['keys'](_0x2a44e7['variable'])[0x0],_0x2a44e7[_0x5bf6('0x2e')]);if(this['isNotNull'](_0x2a44e7[_0x5bf6('0x2f')])&&this[_0x5bf6('0x15')](_0x2a44e7['variable']['outboundrouteid'])){if(_[_0x5bf6('0x16')](this[_0x5bf6('0x9')][_0x2a44e7[_0x5bf6('0x18')]])){this[_0x5bf6('0x9')][_0x2a44e7[_0x5bf6('0x18')]]={'routeId':_0x2a44e7[_0x5bf6('0x2e')],'variables':this[_0x5bf6('0x30')][_0x2a44e7[_0x5bf6('0x18')]]};this[_0x5bf6('0x17')](_0x5bf6('0x20'),'voice_outbound_channel:save',this[_0x5bf6('0x9')][_0x2a44e7[_0x5bf6('0x18')]]);}}}}catch(_0x32e910){logger[_0x5bf6('0x2d')]('[syncVarSet][VoiceDialReport]',util['inspect'](_0x32e910,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x5bf6('0x31')]=function(_0x24da1,_0x3eecd7,_0x16947c){var _0x4e7d57=[_0x5bf6('0x32'),_0x5bf6('0x33'),'rtpaudioqosjitter',_0x5bf6('0x34'),_0x5bf6('0x35'),_0x5bf6('0x36'),_0x5bf6('0x37'),_0x5bf6('0x38'),_0x5bf6('0x39'),_0x5bf6('0x3a'),_0x5bf6('0x3b'),'bridgepvtcallid',_0x5bf6('0x3c'),_0x5bf6('0x3d'),_0x5bf6('0x3e'),_0x5bf6('0x3f'),_0x5bf6('0x40'),_0x5bf6('0x41'),'memberrealtime'];if(!_[_0x5bf6('0x42')](_0x3eecd7)&&!_['includes'](_0x4e7d57,_0x3eecd7)){if(_['isUndefined'](this[_0x5bf6('0x30')][_0x24da1])){this[_0x5bf6('0x30')][_0x24da1]={};}this[_0x5bf6('0x30')][_0x24da1][_0x3eecd7]=_0x16947c;}};VoiceDialReport[_0x5bf6('0x14')][_0x5bf6('0x13')]=function(_0x1b61ac){try{if(this[_0x5bf6('0x15')](_0x1b61ac)){if(this['channels'][_0x1b61ac[_0x5bf6('0x18')]]){this[_0x5bf6('0x9')][_0x1b61ac[_0x5bf6('0x18')]][_0x5bf6('0x43')]=moment()[_0x5bf6('0x29')](_0x5bf6('0x2a'));this[_0x5bf6('0x9')][_0x1b61ac[_0x5bf6('0x18')]][_0x5bf6('0x44')]=moment(this['channels'][_0x1b61ac[_0x5bf6('0x18')]]['endtime'])[_0x5bf6('0x45')](this[_0x5bf6('0x9')][_0x1b61ac[_0x5bf6('0x18')]][_0x5bf6('0x46')],_0x5bf6('0x47'));this['channels'][_0x1b61ac[_0x5bf6('0x18')]][_0x5bf6('0x2b')]=_0x5bf6('0x48');this[_0x5bf6('0xb')][_0x5bf6('0x49')]+=0x1;if(this[_0x5bf6('0x9')][_0x1b61ac['uniqueid']][_0x5bf6('0x28')]){this['outbound'][_0x5bf6('0x4a')]+=0x1;this['channels'][_0x1b61ac['uniqueid']][_0x5bf6('0x4b')]=moment(this[_0x5bf6('0x9')][_0x1b61ac[_0x5bf6('0x18')]][_0x5bf6('0x28')])[_0x5bf6('0x45')](this[_0x5bf6('0x9')][_0x1b61ac[_0x5bf6('0x18')]][_0x5bf6('0x46')],_0x5bf6('0x47'));this[_0x5bf6('0x9')][_0x1b61ac[_0x5bf6('0x18')]][_0x5bf6('0x4c')]=moment(this[_0x5bf6('0x9')][_0x1b61ac[_0x5bf6('0x18')]][_0x5bf6('0x43')])[_0x5bf6('0x45')](this['channels'][_0x1b61ac['uniqueid']]['answertime'],_0x5bf6('0x47'));this[_0x5bf6('0xb')]['sumHoldTime']+=this[_0x5bf6('0x9')][_0x1b61ac[_0x5bf6('0x18')]][_0x5bf6('0x4b')]||0x0;this[_0x5bf6('0xb')][_0x5bf6('0x4d')]+=this[_0x5bf6('0x9')][_0x1b61ac['uniqueid']]['billableseconds'];}this[_0x5bf6('0xb')]['sumDuration']+=this['channels'][_0x1b61ac[_0x5bf6('0x18')]][_0x5bf6('0x44')];ami[_0x5bf6('0x17')](_0x5bf6('0x4e'),this[_0x5bf6('0x9')][_0x1b61ac[_0x5bf6('0x18')]]);ami['emit']('custom:dialend',this['channels'][_0x1b61ac[_0x5bf6('0x18')]]);this['emit'](_0x5bf6('0x20'),_0x5bf6('0x4f'),this[_0x5bf6('0xb')]);logger[_0x5bf6('0x50')](_0x5bf6('0x51'),JSON['stringify'](this['channels'][_0x1b61ac[_0x5bf6('0x18')]]));this['emit'](_0x5bf6('0x20'),'voice_outbound_channel:remove',this[_0x5bf6('0x9')][_0x1b61ac[_0x5bf6('0x18')]]);delete this[_0x5bf6('0x9')][_0x1b61ac[_0x5bf6('0x18')]];}if(this[_0x5bf6('0x30')][_0x1b61ac[_0x5bf6('0x18')]]){delete this[_0x5bf6('0x30')][_0x1b61ac[_0x5bf6('0x18')]];}}}catch(_0x488fe1){logger[_0x5bf6('0x2d')]('[syncHangup][VoiceDialReport]',util[_0x5bf6('0x24')](_0x488fe1,{'showHidden':![],'depth':null}));}};module[_0x5bf6('0x52')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 9fb305f..a88dbc6 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 _0xb5e7=['clearQueueReport','agents','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','info','stringify','voice_queue_channel:remove','type','strategy','answered','available','loggedIn','sumBillable','sumDuration','total','waiting','Trunk','active','callerid','Interval','voice_queue:save','isNotNull','clearZombieChannels','queues','catch','Action','then','[queuesummary]','syncQueueSummary','queue','countBy','callers','toNumber','loggedin','emitVoiceQueueSummary','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','inspect','syncNewExten','uniqueid','inbound','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerexitreason','ABANDONED','lastAssignedTo','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','last','queuecallerabandonAt','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','startsWith','toLowerCase','local/','linkedid','add','seconds','transfertype','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','value','variable','queuecallerleaveAt','queueposition','EXITWITHKEY','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','length','unmanaged','sumHoldTime','diff','milliseconds','lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','custom:voiceQueueReport','transfereeuniqueid','ATTENDEDTRANSFER','ATTENDED','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','syncBlindTransfer','BLINDTRANSFER','BLIND','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','mohstarttime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','bluebird','md5','../../../config/environment','../ami','../model/queueReport','redis','defaults','localhost','prototype','tail','sequence','queueReports','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','queuesummarycomplete','syncQueueSummaryComplete','syncQueueCallerJoin','bind','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','loopQueueSummary','loopQueueShow','isUndefined','hasOwnProperty','originated','isEmpty','talking','pTalking','switch','enqueue','isNil','status','channel','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','variables','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime'];(function(_0x2b78e5,_0x3126f8){var _0xa8d52d=function(_0x51fd7f){while(--_0x51fd7f){_0x2b78e5['push'](_0x2b78e5['shift']());}};_0xa8d52d(++_0x3126f8);}(_0xb5e7,0x14d));var _0x7b5e=function(_0x4fd714,_0x388a59){_0x4fd714=_0x4fd714-0x0;var _0x2fc0fd=_0xb5e7[_0x4fd714];return _0x2fc0fd;};'use strict';var _=require(_0x7b5e('0x0'));var moment=require(_0x7b5e('0x1'));var BPromise=require(_0x7b5e('0x2'));var util=require('util');var md5=require(_0x7b5e('0x3'));var Redis=require('ioredis');var config=require(_0x7b5e('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0x7b5e('0x5'));var QueueReport=require(_0x7b5e('0x6'));config[_0x7b5e('0x7')]=_[_0x7b5e('0x8')](config['redis'],{'host':_0x7b5e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7b5e('0x7')]));var Sequence=function(){};Sequence[_0x7b5e('0xa')]['enqueue']=function(_0x555d9a){this['tail']=this['tail']?this[_0x7b5e('0xb')]['finally'](_0x555d9a):_0x555d9a();};function VoiceQueueReport(_0x2ea4e4){this[_0x7b5e('0xc')]=new Sequence();this[_0x7b5e('0xd')]={};this['agents']=_0x2ea4e4['agents'];this[_0x7b5e('0xe')]=_0x2ea4e4[_0x7b5e('0xf')];this[_0x7b5e('0x10')]=_0x2ea4e4['voiceQueues'];this[_0x7b5e('0x11')]=!![];this[_0x7b5e('0x12')]=_0x2ea4e4['campaigns'];this['variables']={};ami['on'](_0x7b5e('0x13'),this['syncQueueSummary']['bind'](this));ami['on'](_0x7b5e('0x14'),this[_0x7b5e('0x15')]['bind'](this));ami['on']('queuecallerjoin',this[_0x7b5e('0x16')][_0x7b5e('0x17')](this));ami['on'](_0x7b5e('0x18'),this[_0x7b5e('0x19')][_0x7b5e('0x17')](this));ami['on'](_0x7b5e('0x1a'),this[_0x7b5e('0x1b')][_0x7b5e('0x17')](this));ami['on'](_0x7b5e('0x1c'),this['syncAgentComplete'][_0x7b5e('0x17')](this));ami['on'](_0x7b5e('0x1d'),this[_0x7b5e('0x1e')][_0x7b5e('0x17')](this));ami['on']('varset',this[_0x7b5e('0x1f')][_0x7b5e('0x17')](this));ami['on'](_0x7b5e('0x20'),this[_0x7b5e('0x21')][_0x7b5e('0x17')](this));ami['on'](_0x7b5e('0x22'),this[_0x7b5e('0x23')]['bind'](this));ami['on'](_0x7b5e('0x24'),this[_0x7b5e('0x25')][_0x7b5e('0x17')](this));ami['on'](_0x7b5e('0x26'),this[_0x7b5e('0x27')][_0x7b5e('0x17')](this));ami['on'](_0x7b5e('0x28'),this[_0x7b5e('0x29')][_0x7b5e('0x17')](this));ami['on'](_0x7b5e('0x2a'),this['syncBlindTransfer'][_0x7b5e('0x17')](this));this[_0x7b5e('0x2b')]();this[_0x7b5e('0x2c')]();}function isNotNull(_0x3632b6){return _0x3632b6!==null&&!_[_0x7b5e('0x2d')](_0x3632b6);}function clearChannels(_0xd15ac1){if(!_['isEmpty'](_0xd15ac1)){for(var _0x23e85f in _0xd15ac1){if(_0xd15ac1[_0x7b5e('0x2e')](_0x23e85f)){delete _0xd15ac1[_0x23e85f];}}}}function clearCampaigns(_0x10a188){if(!_['isEmpty'](_0x10a188)){for(var _0x5370e4 in _0x10a188){if(_0x10a188[_0x7b5e('0x2e')](_0x5370e4)){_0x10a188[_0x5370e4][_0x7b5e('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x58ee55){if(!_[_0x7b5e('0x30')](_0x58ee55)){for(var _0x231d46 in _0x58ee55){if(_0x58ee55['hasOwnProperty'](_0x231d46)){_0x58ee55[_0x231d46][_0x7b5e('0x2f')]=0x0;_0x58ee55[_0x231d46][_0x7b5e('0x31')]=0x0;_0x58ee55[_0x231d46][_0x7b5e('0x32')]=0x0;_0x58ee55[_0x231d46]['waiting']=0x0;_0x58ee55[_0x231d46]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x146fc4){if(!_[_0x7b5e('0x30')](_0x146fc4)){for(var _0x53b89a in _0x146fc4){if(_0x146fc4[_0x7b5e('0x2e')](_0x53b89a)){_0x146fc4[_0x53b89a]['unlockRR']=!![];}}}}VoiceQueueReport['prototype']['clearZombieChannels']=function(){var _0x106c56=this;for(var _0xdbd3f1 in this[_0x7b5e('0xe')]){if(this[_0x7b5e('0xe')]['hasOwnProperty'](_0xdbd3f1)&&!this['channels'][_0xdbd3f1][_0x7b5e('0x33')]){this['sequence'][_0x7b5e('0x34')](function(){if(!_[_0x7b5e('0x35')](_0x106c56['channels'][_0xdbd3f1])){return ami['Action']({'action':_0x7b5e('0x36'),'channel':_0x106c56['channels'][_0xdbd3f1][_0x7b5e('0x37')]})['catch'](function(_0x4dc9b9){if(_0x4dc9b9[_0x7b5e('0x38')]===_0x7b5e('0x39')){setTimeout(function(){if(_0x106c56['channels'][_0xdbd3f1]){delete _0x106c56[_0x7b5e('0xe')][_0xdbd3f1];logger[_0x7b5e('0x3a')](_0x7b5e('0x3b'),_0xdbd3f1);}if(_0x106c56[_0x7b5e('0xd')][_0xdbd3f1]){delete _0x106c56['queueReports'][_0xdbd3f1];logger[_0x7b5e('0x3a')]('[voiceQueueReport][checkQueueReport]',_0xdbd3f1);}if(_0x106c56[_0x7b5e('0x3c')][_0xdbd3f1]){delete _0x106c56[_0x7b5e('0x3c')][_0xdbd3f1];logger['error'](_0x7b5e('0x3d'),_0xdbd3f1);}},0x1f40);}});}});}}};VoiceQueueReport[_0x7b5e('0xa')][_0x7b5e('0x23')]=function(){logger['error'](_0x7b5e('0x3e'));clearChannels(this[_0x7b5e('0xe')]);this[_0x7b5e('0x3f')](this[_0x7b5e('0xd')]);clearAgentBooked(this[_0x7b5e('0x40')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x7b5e('0x12')]);};VoiceQueueReport['prototype']['clearQueueReport']=function(_0xaa8e03){var _0x488b40=this;if(!_['isEmpty'](_0xaa8e03)){for(var _0x205f56 in _0xaa8e03){if(_0xaa8e03[_0x7b5e('0x2e')](_0x205f56)){_0x488b40[_0x7b5e('0x41')](_0xaa8e03[_0x205f56]);delete _0xaa8e03[_0x205f56];}}}};function loggerCatch(_0x31b3ab){return function(_0x2109a7){logger['error'](_0x31b3ab,util['inspect'](_0x2109a7,{'showHidden':![],'depth':null}));};}VoiceQueueReport['prototype'][_0x7b5e('0x42')]=function(_0x41ca49,_0x3af1af,_0x40e9a7){io['to'](_0x41ca49)['emit'](_0x3af1af,_0x40e9a7);};VoiceQueueReport[_0x7b5e('0xa')][_0x7b5e('0x43')]=function(_0xffc42d){this[_0x7b5e('0x42')](util[_0x7b5e('0x44')](_0x7b5e('0x45'),_0xffc42d[_0x7b5e('0x46')]),'voice_queue_channel:save',_0xffc42d);};VoiceQueueReport['prototype']['emitVoiceQueueChannelRemove']=function(_0x5c7b14){logger[_0x7b5e('0x47')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x7b5e('0x48')](_0x5c7b14));this[_0x7b5e('0x42')](util[_0x7b5e('0x44')](_0x7b5e('0x45'),_0x5c7b14[_0x7b5e('0x46')]),_0x7b5e('0x49'),_0x5c7b14);};VoiceQueueReport['prototype']['emitVoiceQueueSummary']=function(_0x2f5b3c){if(_0x2f5b3c[_0x7b5e('0x4a')]==='inbound'){var _0x2ba05e={'id':_0x2f5b3c['id'],'name':_0x2f5b3c[_0x7b5e('0x46')],'strategy':_0x2f5b3c[_0x7b5e('0x4b')],'answered':_0x2f5b3c[_0x7b5e('0x4c')],'available':_0x2f5b3c[_0x7b5e('0x4d')],'loggedIn':_0x2f5b3c[_0x7b5e('0x4e')],'pTalking':_0x2f5b3c[_0x7b5e('0x32')],'sumBillable':_0x2f5b3c[_0x7b5e('0x4f')],'sumDuration':_0x2f5b3c[_0x7b5e('0x50')],'sumHoldTime':_0x2f5b3c['sumHoldTime']||0x0,'talking':_0x2f5b3c['talking'],'total':_0x2f5b3c[_0x7b5e('0x51')],'type':_0x2f5b3c[_0x7b5e('0x4a')],'unmanaged':_0x2f5b3c['unmanaged'],'abandoned':_0x2f5b3c['abandoned'],'waiting':_0x2f5b3c[_0x7b5e('0x52')]};if(_0x2f5b3c[_0x7b5e('0x53')]){_0x2ba05e[_0x7b5e('0x53')]={'id':_0x2f5b3c[_0x7b5e('0x53')]['id'],'name':_0x2f5b3c[_0x7b5e('0x53')][_0x7b5e('0x46')],'active':_0x2f5b3c[_0x7b5e('0x53')][_0x7b5e('0x54')],'callerid':_0x2f5b3c['Trunk'][_0x7b5e('0x55')]};}if(_0x2f5b3c[_0x7b5e('0x56')]){_0x2ba05e[_0x7b5e('0x56')]={'id':_0x2f5b3c[_0x7b5e('0x56')]['id'],'name':_0x2f5b3c[_0x7b5e('0x56')][_0x7b5e('0x46')]};}var _0x2c1025=md5(JSON[_0x7b5e('0x48')](_0x2ba05e));if(_0x2f5b3c[_0x7b5e('0x3')]!==_0x2c1025){_0x2f5b3c[_0x7b5e('0x3')]=_0x2c1025;this[_0x7b5e('0x42')](util['format'](_0x7b5e('0x45'),_0x2ba05e[_0x7b5e('0x46')]),_0x7b5e('0x57'),_0x2ba05e);}}};VoiceQueueReport[_0x7b5e('0xa')][_0x7b5e('0x58')]=function(_0x352641){return _0x352641!==null&&!_['isUndefined'](_0x352641);};VoiceQueueReport['prototype'][_0x7b5e('0x2c')]=function(){var _0xba8126=this;setInterval(function(){_0xba8126[_0x7b5e('0x59')]();ami['Action']({'action':_0x7b5e('0x5a')})[_0x7b5e('0x5b')](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport['prototype'][_0x7b5e('0x2b')]=function(){var _0x3a61da=this;setInterval(function(){if(_0x3a61da[_0x7b5e('0x11')]){return ami[_0x7b5e('0x5c')]({'action':'queuesummary'})[_0x7b5e('0x5d')](function(_0x4dfaee){_0x3a61da[_0x7b5e('0x11')]=![];})[_0x7b5e('0x5b')](loggerCatch(_0x7b5e('0x5e')));}},0x3e8);};VoiceQueueReport['prototype'][_0x7b5e('0x5f')]=function(_0x2578fe){try{if(this[_0x7b5e('0x58')](_0x2578fe)&&this[_0x7b5e('0x58')](_0x2578fe['queue'])){if(this[_0x7b5e('0x10')][_0x2578fe[_0x7b5e('0x60')]]){var _0x45401b=_[_0x7b5e('0x61')](this[_0x7b5e('0xe')],_0x7b5e('0x60'))[_0x2578fe['queue']]||0x0;var _0x4d5877=_0x45401b-_0x2578fe['callers'];if(this[_0x7b5e('0x10')][_0x2578fe[_0x7b5e('0x60')]][_0x7b5e('0x52')]!==_['toNumber'](_0x2578fe[_0x7b5e('0x62')])||this[_0x7b5e('0x10')][_0x2578fe['queue']]['loggedIn']!==_[_0x7b5e('0x63')](_0x2578fe['loggedin'])||this[_0x7b5e('0x10')][_0x2578fe[_0x7b5e('0x60')]][_0x7b5e('0x4d')]!==_['toNumber'](_0x2578fe[_0x7b5e('0x4d')])||this[_0x7b5e('0x10')][_0x2578fe[_0x7b5e('0x60')]]['talking']!==_0x4d5877){this[_0x7b5e('0x10')][_0x2578fe[_0x7b5e('0x60')]][_0x7b5e('0x52')]=_[_0x7b5e('0x63')](_0x2578fe[_0x7b5e('0x62')]);this[_0x7b5e('0x10')][_0x2578fe[_0x7b5e('0x60')]][_0x7b5e('0x4e')]=_['toNumber'](_0x2578fe['loggedin']);this[_0x7b5e('0x10')][_0x2578fe['queue']][_0x7b5e('0x4d')]=_['toNumber'](_0x2578fe[_0x7b5e('0x4d')]);this['voiceQueues'][_0x2578fe[_0x7b5e('0x60')]][_0x7b5e('0x31')]=_0x4d5877>0x0?_0x4d5877:0x0;this[_0x7b5e('0x10')][_0x2578fe[_0x7b5e('0x60')]][_0x7b5e('0x31')]=this['voiceQueues'][_0x2578fe[_0x7b5e('0x60')]][_0x7b5e('0x31')]>_[_0x7b5e('0x63')](_0x2578fe[_0x7b5e('0x64')])?_[_0x7b5e('0x63')](_0x2578fe[_0x7b5e('0x64')]):this[_0x7b5e('0x10')][_0x2578fe['queue']][_0x7b5e('0x31')];this[_0x7b5e('0x65')](this[_0x7b5e('0x10')][_0x2578fe['queue']]);}ami['emit'](_0x7b5e('0x66'),this[_0x7b5e('0x10')][_0x2578fe['queue']]);}}}catch(_0x11e57a){logger[_0x7b5e('0x3a')](_0x7b5e('0x67'),util[_0x7b5e('0x68')](_0x11e57a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7b5e('0xa')][_0x7b5e('0x15')]=function(_0x2a66f9){this[_0x7b5e('0x11')]=!![];};VoiceQueueReport['prototype'][_0x7b5e('0x69')]=function(_0x35173d){};VoiceQueueReport[_0x7b5e('0xa')]['syncQueueCallerJoin']=function(_0x1c88bd){try{if(this[_0x7b5e('0x58')](_0x1c88bd)){if(_['isUndefined'](this[_0x7b5e('0xd')][_0x1c88bd[_0x7b5e('0x6a')]])){this[_0x7b5e('0xd')][_0x1c88bd['uniqueid']]=[];this['channels'][_0x1c88bd['uniqueid']]={};}var _0x3b2c45=new QueueReport();_0x3b2c45['name']=_0x1c88bd['queue'];_0x3b2c45[_0x7b5e('0x4a')]=this[_0x7b5e('0x10')][_0x3b2c45[_0x7b5e('0x46')]]&&this[_0x7b5e('0x10')][_0x3b2c45['name']][_0x7b5e('0x4a')]?this[_0x7b5e('0x10')][_0x3b2c45[_0x7b5e('0x46')]][_0x7b5e('0x4a')]||_0x7b5e('0x6b'):'inbound';_0x3b2c45[_0x7b5e('0x60')]=_0x1c88bd[_0x7b5e('0x60')];_0x3b2c45[_0x7b5e('0x6c')]=moment()[_0x7b5e('0x44')](_0x7b5e('0x6d'));_0x3b2c45[_0x7b5e('0x6e')]=_0x1c88bd[_0x7b5e('0x6e')];_0x3b2c45[_0x7b5e('0x6f')]=_0x1c88bd[_0x7b5e('0x6f')];_[_0x7b5e('0x70')](_0x3b2c45,_['pick'](_0x1c88bd,_[_0x7b5e('0x71')](_0x3b2c45)));this[_0x7b5e('0xd')][_0x1c88bd[_0x7b5e('0x6a')]][_0x7b5e('0x72')](_0x3b2c45);this[_0x7b5e('0xe')][_0x1c88bd[_0x7b5e('0x6a')]]=_0x3b2c45;this['emitVoiceQueueChannelSave'](_0x3b2c45);}}catch(_0x1bcbd6){logger[_0x7b5e('0x3a')](_0x7b5e('0x73'),util[_0x7b5e('0x68')](_0x1bcbd6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7b5e('0x19')]=function(_0x102f01){try{if(this[_0x7b5e('0x58')](_0x102f01)){if(this[_0x7b5e('0xd')][_0x102f01[_0x7b5e('0x6a')]]){var _0x33bc0c=_['last'](this[_0x7b5e('0xd')][_0x102f01['uniqueid']]);_0x33bc0c[_0x7b5e('0x74')]=![];_0x33bc0c[_0x7b5e('0x75')]=null;_0x33bc0c[_0x7b5e('0x76')]=_0x102f01[_0x7b5e('0x76')];_0x33bc0c[_0x7b5e('0x77')]=_0x102f01[_0x7b5e('0x77')];_0x33bc0c[_0x7b5e('0x18')]=!![];_0x33bc0c['queuecallerabandonAt']=moment()[_0x7b5e('0x44')](_0x7b5e('0x6d'));_0x33bc0c[_0x7b5e('0x78')]=_0x7b5e('0x79');_0x33bc0c[_0x7b5e('0x7a')]=null;this[_0x7b5e('0xe')][_0x102f01[_0x7b5e('0x6a')]]=_0x33bc0c;this[_0x7b5e('0x41')](_0x33bc0c);}}}catch(_0x3c5092){logger[_0x7b5e('0x3a')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0x7b5e('0x68')](_0x3c5092,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7b5e('0x1b')]=function(_0x4f2a03){try{if(this[_0x7b5e('0x58')](_0x4f2a03)){if(this[_0x7b5e('0xd')][_0x4f2a03[_0x7b5e('0x6a')]]){var _0x12fce7=_['last'](this[_0x7b5e('0xd')][_0x4f2a03[_0x7b5e('0x6a')]]);_0x12fce7['queuecallerleaveAt']=moment()[_0x7b5e('0x44')](_0x7b5e('0x6d'));_0x12fce7[_0x7b5e('0x7b')]=_0x4f2a03[_0x7b5e('0x7b')];_0x12fce7['connectedlinename']=_0x4f2a03[_0x7b5e('0x7c')];this[_0x7b5e('0xe')][_0x4f2a03[_0x7b5e('0x6a')]]=_0x12fce7;this[_0x7b5e('0x43')](_0x12fce7);}}}catch(_0x315810){logger['error'](_0x7b5e('0x7d'),util[_0x7b5e('0x68')](_0x315810,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7b5e('0xa')]['syncAgentConnect']=function(_0x5a599a){try{if(this[_0x7b5e('0x58')](_0x5a599a)){if(this['queueReports'][_0x5a599a[_0x7b5e('0x6a')]]){var _0x4d7eea=_['last'](this[_0x7b5e('0xd')][_0x5a599a[_0x7b5e('0x6a')]]);_0x4d7eea[_0x7b5e('0x74')]=!![];_0x4d7eea['queuecallerexitreason']=_0x7b5e('0x7e');}}}catch(_0x4e9de6){logger[_0x7b5e('0x3a')](_0x7b5e('0x7f'),util[_0x7b5e('0x68')](_0x4e9de6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7b5e('0xa')]['syncAgentComplete']=function(_0x453331){try{if(this[_0x7b5e('0x58')](_0x453331)){if(this[_0x7b5e('0xd')][_0x453331['uniqueid']]){var _0x57e322=_[_0x7b5e('0x80')](this[_0x7b5e('0xd')][_0x453331[_0x7b5e('0x6a')]]);_0x57e322['queuecallerabandon']=![];_0x57e322[_0x7b5e('0x81')]=null;_0x57e322[_0x7b5e('0x82')]=!![];_0x57e322[_0x7b5e('0x7a')]=_0x453331[_0x7b5e('0x83')];_0x57e322[_0x7b5e('0x76')]=_0x453331[_0x7b5e('0x76')];_0x57e322[_0x7b5e('0x74')]=!![];_0x57e322[_0x7b5e('0x84')]=![];_0x57e322[_0x7b5e('0x85')]=null;if(!_0x57e322[_0x7b5e('0x86')]){if(_0x453331[_0x7b5e('0x87')]==_0x7b5e('0x86')){_0x57e322[_0x7b5e('0x78')]='COMPLETED';}else{if(_[_0x7b5e('0x88')](_0x453331['channel'][_0x7b5e('0x89')](),_0x7b5e('0x8a'))){if(this['queueReports'][_0x453331[_0x7b5e('0x8b')]]){var _0x5bf7ca=_['last'](this['queueReports'][_0x453331[_0x7b5e('0x8b')]]);_0x5bf7ca[_0x7b5e('0x74')]=![];_0x5bf7ca['queuecallerexit']=!![];_0x5bf7ca[_0x7b5e('0x85')]=moment(_0x57e322[_0x7b5e('0x6c')])[_0x7b5e('0x8c')](_0x453331[_0x7b5e('0x76')],_0x7b5e('0x8d'))[_0x7b5e('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x5bf7ca[_0x7b5e('0x78')]='FORWARDTRANSFER';_0x5bf7ca[_0x7b5e('0x86')]=!![];_0x5bf7ca[_0x7b5e('0x8e')]=_0x7b5e('0x8f');_0x5bf7ca[_0x7b5e('0x90')]=_0x453331[_0x7b5e('0x91')];_0x5bf7ca[_0x7b5e('0x92')]=_0x453331['uniqueid'];var _0x4443ae=this[_0x7b5e('0xd')][_0x453331[_0x7b5e('0x8b')]];this[_0x7b5e('0xd')][_0x453331[_0x7b5e('0x8b')]]=this[_0x7b5e('0xd')][_0x453331['uniqueid']];this[_0x7b5e('0xd')][_0x453331[_0x7b5e('0x6a')]]=_0x4443ae;}}else{_0x57e322[_0x7b5e('0x78')]=_0x7b5e('0x93')+_0x453331[_0x7b5e('0x87')][_0x7b5e('0x94')]();}}}this[_0x7b5e('0xe')][_0x453331[_0x7b5e('0x6a')]]=_0x57e322;this[_0x7b5e('0x41')](_0x57e322);}}}catch(_0x45315b){logger['error'](_0x7b5e('0x95'),util[_0x7b5e('0x68')](_0x45315b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7b5e('0xa')][_0x7b5e('0x1f')]=function(_0x38a4db){try{if(this[_0x7b5e('0x58')](_0x38a4db)){this['addVariable'](_0x38a4db['uniqueid'],_[_0x7b5e('0x71')](_0x38a4db['variable'])[0x0],_0x38a4db[_0x7b5e('0x96')]);if(this[_0x7b5e('0xd')][_0x38a4db[_0x7b5e('0x6a')]]){var _0x50f6e2=_[_0x7b5e('0x80')](this['queueReports'][_0x38a4db[_0x7b5e('0x6a')]]);if(_0x50f6e2){if(this[_0x7b5e('0x58')](_0x38a4db[_0x7b5e('0x97')])&&this[_0x7b5e('0x58')](_0x38a4db[_0x7b5e('0x97')]['queuestatus'])){switch(_0x38a4db[_0x7b5e('0x96')]){case'CONTINUE':_0x50f6e2['queuecallerexit']=![];_0x50f6e2['queuecallerexitAt']=null;break;default:_0x50f6e2[_0x7b5e('0x84')]=!![];_0x50f6e2[_0x7b5e('0x85')]=moment()[_0x7b5e('0x44')](_0x7b5e('0x6d'));_0x50f6e2[_0x7b5e('0x98')]=moment()[_0x7b5e('0x44')](_0x7b5e('0x6d'));}_0x50f6e2['queuecallerabandon']=![];_0x50f6e2[_0x7b5e('0x81')]=null;_0x50f6e2[_0x7b5e('0x78')]=_0x38a4db[_0x7b5e('0x96')];this[_0x7b5e('0xe')][_0x38a4db[_0x7b5e('0x6a')]]=_0x50f6e2;this['emitVoiceQueueChannelRemove'](_0x50f6e2);}else if(this[_0x7b5e('0x58')](_0x38a4db[_0x7b5e('0x97')])&&this['isNotNull'](_0x38a4db[_0x7b5e('0x97')][_0x7b5e('0x99')])){if(!_0x50f6e2[_0x7b5e('0x18')]){_0x50f6e2[_0x7b5e('0x84')]=!![];_0x50f6e2['queuecallerexitAt']=moment()[_0x7b5e('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x50f6e2[_0x7b5e('0x78')]=_0x7b5e('0x9a');_0x50f6e2[_0x7b5e('0x98')]=moment()[_0x7b5e('0x44')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7b5e('0xe')][_0x38a4db[_0x7b5e('0x6a')]]=_0x50f6e2;}}_0x50f6e2['variables']=this[_0x7b5e('0x3c')][_0x38a4db['uniqueid']];}}}}catch(_0x30abb6){logger['error']('[syncVarSet][VoiceQueueReport]',util[_0x7b5e('0x68')](_0x30abb6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7b5e('0xa')]['addVariable']=function(_0x123f97,_0x435656,_0x2eb601){var _0x10b89d=[_0x7b5e('0x9b'),_0x7b5e('0x9c'),'rtpaudioqosjitter',_0x7b5e('0x9d'),_0x7b5e('0x9e'),_0x7b5e('0x9f'),_0x7b5e('0xa0'),_0x7b5e('0xa1'),'sipcallid',_0x7b5e('0xa2'),_0x7b5e('0xa3'),_0x7b5e('0xa4'),_0x7b5e('0xa5'),_0x7b5e('0xa6'),_0x7b5e('0xa7'),_0x7b5e('0xa8'),'membername','memberpenalty',_0x7b5e('0xa9')];if(!_[_0x7b5e('0x35')](_0x435656)&&!_['includes'](_0x10b89d,_0x435656)){if(_[_0x7b5e('0x2d')](this[_0x7b5e('0x3c')][_0x123f97])){this[_0x7b5e('0x3c')][_0x123f97]={};}this[_0x7b5e('0x3c')][_0x123f97][_0x435656]=_0x2eb601;}};VoiceQueueReport['prototype'][_0x7b5e('0x21')]=function(_0x1fdb01){try{if(this[_0x7b5e('0x58')](_0x1fdb01)){if(this[_0x7b5e('0xd')][_0x1fdb01[_0x7b5e('0x6a')]]){for(var _0x355cbd=0x0,_0x118bf2={};_0x355cbd0x0?_0x1a8aaa:0x0;this['voiceQueues'][_0x2d2644[_0x2659('0x63')]][_0x2659('0x34')]=this[_0x2659('0x12')][_0x2d2644[_0x2659('0x63')]][_0x2659('0x34')]>_[_0x2659('0x66')](_0x2d2644['loggedin'])?_[_0x2659('0x66')](_0x2d2644[_0x2659('0x67')]):this[_0x2659('0x12')][_0x2d2644[_0x2659('0x63')]][_0x2659('0x34')];this[_0x2659('0x4e')](this[_0x2659('0x12')][_0x2d2644[_0x2659('0x63')]]);}ami[_0x2659('0x45')](_0x2659('0x68'),this['voiceQueues'][_0x2d2644[_0x2659('0x63')]]);}}}catch(_0x17b114){logger[_0x2659('0x3d')](_0x2659('0x69'),util[_0x2659('0x44')](_0x17b114,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2659('0x38')][_0x2659('0x16')]=function(_0x5629ad){this[_0x2659('0x60')]=!![];};VoiceQueueReport[_0x2659('0x38')]['syncNewExten']=function(_0x2ba279){};VoiceQueueReport[_0x2659('0x38')][_0x2659('0x19')]=function(_0x4eb17b){try{if(this[_0x2659('0x5b')](_0x4eb17b)){if(_[_0x2659('0x30')](this[_0x2659('0x3e')][_0x4eb17b[_0x2659('0x6a')]])){this[_0x2659('0x3e')][_0x4eb17b['uniqueid']]=[];this['channels'][_0x4eb17b[_0x2659('0x6a')]]={};}var _0x4ff273=new QueueReport();_0x4ff273[_0x2659('0x48')]=_0x4eb17b[_0x2659('0x63')];_0x4ff273[_0x2659('0x4f')]=this[_0x2659('0x12')][_0x4ff273[_0x2659('0x48')]]&&this[_0x2659('0x12')][_0x4ff273['name']][_0x2659('0x4f')]?this[_0x2659('0x12')][_0x4ff273[_0x2659('0x48')]][_0x2659('0x4f')]||_0x2659('0x6b'):_0x2659('0x6b');_0x4ff273[_0x2659('0x63')]=_0x4eb17b[_0x2659('0x63')];_0x4ff273[_0x2659('0x6c')]=moment()[_0x2659('0x47')](_0x2659('0x6d'));_0x4ff273[_0x2659('0x6e')]=_0x4eb17b[_0x2659('0x6e')];_0x4ff273[_0x2659('0x6f')]=_0x4eb17b[_0x2659('0x6f')];_[_0x2659('0x70')](_0x4ff273,_[_0x2659('0x71')](_0x4eb17b,_[_0x2659('0x72')](_0x4ff273)));this[_0x2659('0x3e')][_0x4eb17b[_0x2659('0x6a')]][_0x2659('0x73')](_0x4ff273);this[_0x2659('0x10')][_0x4eb17b[_0x2659('0x6a')]]=_0x4ff273;this[_0x2659('0x46')](_0x4ff273);}}catch(_0x399c11){logger['error'](_0x2659('0x74'),util['inspect'](_0x399c11,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2659('0x38')][_0x2659('0x1b')]=function(_0xeecbf7){try{if(this[_0x2659('0x5b')](_0xeecbf7)){if(this[_0x2659('0x3e')][_0xeecbf7[_0x2659('0x6a')]]){var _0x422d6b=_[_0x2659('0x75')](this[_0x2659('0x3e')][_0xeecbf7[_0x2659('0x6a')]]);_0x422d6b['queuecallercomplete']=![];_0x422d6b[_0x2659('0x76')]=null;_0x422d6b['holdtime']=_0xeecbf7[_0x2659('0x77')];_0x422d6b[_0x2659('0x78')]=_0xeecbf7['originalposition'];_0x422d6b[_0x2659('0x1a')]=!![];_0x422d6b[_0x2659('0x79')]=moment()[_0x2659('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x422d6b[_0x2659('0x7a')]=_0x2659('0x7b');_0x422d6b[_0x2659('0x7c')]=null;this[_0x2659('0x10')][_0xeecbf7[_0x2659('0x6a')]]=_0x422d6b;this[_0x2659('0x43')](_0x422d6b);}}}catch(_0x474911){logger[_0x2659('0x3d')](_0x2659('0x7d'),util['inspect'](_0x474911,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2659('0x1d')]=function(_0x707b98){try{if(this[_0x2659('0x5b')](_0x707b98)){if(this['queueReports'][_0x707b98[_0x2659('0x6a')]]){var _0x4a531a=_[_0x2659('0x75')](this[_0x2659('0x3e')][_0x707b98[_0x2659('0x6a')]]);_0x4a531a['queuecallerleaveAt']=moment()[_0x2659('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a531a[_0x2659('0x7e')]=_0x707b98[_0x2659('0x7e')];_0x4a531a['connectedlinename']=_0x707b98['connectedlinename'];this['channels'][_0x707b98[_0x2659('0x6a')]]=_0x4a531a;this[_0x2659('0x46')](_0x4a531a);}}}catch(_0x2f3b50){logger[_0x2659('0x3d')](_0x2659('0x7f'),util['inspect'](_0x2f3b50,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2659('0x38')]['syncAgentConnect']=function(_0x413489){try{if(this[_0x2659('0x5b')](_0x413489)){if(this[_0x2659('0x3e')][_0x413489[_0x2659('0x6a')]]){var _0x41a331=_[_0x2659('0x75')](this['queueReports'][_0x413489['uniqueid']]);_0x41a331[_0x2659('0x80')]=!![];_0x41a331['queuecallerexitreason']=_0x2659('0x81');}}}catch(_0x437917){logger[_0x2659('0x3d')](_0x2659('0x82'),util[_0x2659('0x44')](_0x437917,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2659('0x38')][_0x2659('0x1f')]=function(_0x58e394){try{if(this['isNotNull'](_0x58e394)){if(this['queueReports'][_0x58e394['uniqueid']]){var _0x35849c=_[_0x2659('0x75')](this[_0x2659('0x3e')][_0x58e394[_0x2659('0x6a')]]);_0x35849c[_0x2659('0x1a')]=![];_0x35849c['queuecallerabandonAt']=null;_0x35849c[_0x2659('0x83')]=!![];_0x35849c[_0x2659('0x7c')]=_0x58e394[_0x2659('0x84')];_0x35849c[_0x2659('0x77')]=_0x58e394['holdtime'];_0x35849c[_0x2659('0x80')]=!![];_0x35849c[_0x2659('0x85')]=![];_0x35849c['queuecallerexitAt']=null;if(!_0x35849c[_0x2659('0x86')]){if(_0x58e394[_0x2659('0x87')]==_0x2659('0x86')){_0x35849c[_0x2659('0x7a')]=_0x2659('0x88');}else{if(_[_0x2659('0x89')](_0x58e394[_0x2659('0x3b')][_0x2659('0x8a')](),_0x2659('0x8b'))){if(this['queueReports'][_0x58e394[_0x2659('0x8c')]]){var _0x2c5da8=_[_0x2659('0x75')](this[_0x2659('0x3e')][_0x58e394[_0x2659('0x8c')]]);_0x2c5da8[_0x2659('0x80')]=![];_0x2c5da8[_0x2659('0x85')]=!![];_0x2c5da8[_0x2659('0x8d')]=moment(_0x35849c[_0x2659('0x6c')])[_0x2659('0x8e')](_0x58e394['holdtime'],_0x2659('0x8f'))[_0x2659('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c5da8['queuecallerexitreason']=_0x2659('0x90');_0x2c5da8['transfer']=!![];_0x2c5da8[_0x2659('0x91')]=_0x2659('0x92');_0x2c5da8[_0x2659('0x93')]=_0x58e394[_0x2659('0x94')];_0x2c5da8[_0x2659('0x95')]=_0x58e394[_0x2659('0x6a')];var _0x197f88=this['queueReports'][_0x58e394[_0x2659('0x8c')]];this['queueReports'][_0x58e394['linkedid']]=this[_0x2659('0x3e')][_0x58e394['uniqueid']];this[_0x2659('0x3e')][_0x58e394[_0x2659('0x6a')]]=_0x197f88;}}else{_0x35849c[_0x2659('0x7a')]=_0x2659('0x96')+_0x58e394[_0x2659('0x87')][_0x2659('0x97')]();}}}this[_0x2659('0x10')][_0x58e394[_0x2659('0x6a')]]=_0x35849c;this[_0x2659('0x43')](_0x35849c);}}}catch(_0x495e3f){logger[_0x2659('0x3d')](_0x2659('0x98'),util[_0x2659('0x44')](_0x495e3f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2659('0x38')]['syncVarSet']=function(_0x2b554b){try{if(this[_0x2659('0x5b')](_0x2b554b)){this[_0x2659('0x99')](_0x2b554b['uniqueid'],_[_0x2659('0x72')](_0x2b554b['variable'])[0x0],_0x2b554b[_0x2659('0x9a')]);if(this[_0x2659('0x3e')][_0x2b554b[_0x2659('0x6a')]]){var _0x11b371=_[_0x2659('0x75')](this[_0x2659('0x3e')][_0x2b554b[_0x2659('0x6a')]]);if(_0x11b371){if(this[_0x2659('0x5b')](_0x2b554b[_0x2659('0x9b')])&&this[_0x2659('0x5b')](_0x2b554b[_0x2659('0x9b')][_0x2659('0x9c')])){switch(_0x2b554b[_0x2659('0x9a')]){case _0x2659('0x9d'):_0x11b371[_0x2659('0x85')]=![];_0x11b371[_0x2659('0x8d')]=null;break;default:_0x11b371['queuecallerexit']=!![];_0x11b371[_0x2659('0x8d')]=moment()['format'](_0x2659('0x6d'));_0x11b371[_0x2659('0x9e')]=moment()[_0x2659('0x47')](_0x2659('0x6d'));}_0x11b371[_0x2659('0x1a')]=![];_0x11b371[_0x2659('0x79')]=null;_0x11b371[_0x2659('0x7a')]=_0x2b554b['value'];this[_0x2659('0x10')][_0x2b554b[_0x2659('0x6a')]]=_0x11b371;this['emitVoiceQueueChannelRemove'](_0x11b371);}else if(this[_0x2659('0x5b')](_0x2b554b['variable'])&&this[_0x2659('0x5b')](_0x2b554b[_0x2659('0x9b')][_0x2659('0x9f')])){if(!_0x11b371['queuecallerabandon']){_0x11b371[_0x2659('0x85')]=!![];_0x11b371[_0x2659('0x8d')]=moment()['format'](_0x2659('0x6d'));_0x11b371['queuecallerexitreason']=_0x2659('0xa0');_0x11b371[_0x2659('0x9e')]=moment()[_0x2659('0x47')](_0x2659('0x6d'));this['channels'][_0x2b554b[_0x2659('0x6a')]]=_0x11b371;}}_0x11b371[_0x2659('0x40')]=this[_0x2659('0x40')][_0x2b554b[_0x2659('0x6a')]];}}}}catch(_0x2b300a){logger['error']('[syncVarSet][VoiceQueueReport]',util['inspect'](_0x2b300a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2659('0x38')][_0x2659('0x99')]=function(_0x2bd565,_0x217df6,_0xa98883){var _0x23cfca=[_0x2659('0xa1'),_0x2659('0xa2'),_0x2659('0xa3'),_0x2659('0xa4'),_0x2659('0xa5'),_0x2659('0xa6'),_0x2659('0xa7'),_0x2659('0xa8'),_0x2659('0xa9'),'sipuri',_0x2659('0xaa'),'bridgepvtcallid','membercalls',_0x2659('0xab'),_0x2659('0xac'),_0x2659('0xad'),_0x2659('0x84'),_0x2659('0xae'),'memberrealtime'];if(!_[_0x2659('0x39')](_0x217df6)&&!_[_0x2659('0xaf')](_0x23cfca,_0x217df6)){if(_[_0x2659('0x30')](this['variables'][_0x2bd565])){this[_0x2659('0x40')][_0x2bd565]={};}this[_0x2659('0x40')][_0x2bd565][_0x217df6]=_0xa98883;}};VoiceQueueReport['prototype']['syncHangup']=function(_0x3cc65b){try{if(this['isNotNull'](_0x3cc65b)){if(this[_0x2659('0x3e')][_0x3cc65b[_0x2659('0x6a')]]){for(var _0x2d1666=0x0,_0x3d4e77={};_0x2d1666=0x0?moment(_0x26187b[_0xa62a('0x15')])[_0xa62a('0xa')](_0x26187b[_0xa62a('0x16')],_0xa62a('0xb')):null,'data1':'outbound','data2':_0x26187b[_0xa62a('0x10')],'data3':_0x26187b['exten'],'data4':_0x26187b[_0xa62a('0x17')]||null,'role':'agent','internal':_0x26187b[_0xa62a('0x10')]?_[_0xa62a('0x11')](_0x26187b[_0xa62a('0x10')]):undefined,'uniqueid':_0x26187b[_0xa62a('0x18')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x28a9=['voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','isNil','format','lastAssignedTo','interface','TALKING','diff','seconds','inbound','calleridnum','exten','accountcode','uniqueid','membername','starttime','endtime','outbound','dialstring','agent','toNumber','moment','lodash','util'];(function(_0x547272,_0x1322cd){var _0x9ef09f=function(_0x5a2df0){while(--_0x5a2df0){_0x547272['push'](_0x547272['shift']());}};_0x9ef09f(++_0x1322cd);}(_0x28a9,0x1c8));var _0x928a=function(_0x141486,_0x58ed56){_0x141486=_0x141486-0x0;var _0x1b5fb9=_0x28a9[_0x141486];return _0x1b5fb9;};'use strict';var moment=require(_0x928a('0x0'));var _=require(_0x928a('0x1'));var util=require(_0x928a('0x2'));var client=require('../client');exports[_0x928a('0x3')]=function(_0x29f41b){var _0x4e77e9=_0x29f41b['queuecallercompleteAt']||_0x29f41b[_0x928a('0x4')];return client[_0x928a('0x5')](_0x928a('0x6'),{'body':{'channel':_0x928a('0x7'),'membername':_0x29f41b['lastAssignedTo'],'interface':_[_0x928a('0x8')](_0x29f41b['interface'])?util[_0x928a('0x9')]('SIP/%s',_0x29f41b[_0x928a('0xa')]):_0x29f41b[_0x928a('0xb')],'type':_0x928a('0xc'),'enterAt':_0x29f41b['queuecallerleaveAt'],'exitAt':_0x4e77e9,'duration':moment(_0x4e77e9)[_0x928a('0xd')](_0x29f41b['queuecallerleaveAt'],_0x928a('0xe')),'data1':_0x928a('0xf'),'data2':_0x29f41b[_0x928a('0x10')],'data3':_0x29f41b[_0x928a('0x11')],'data4':null,'data5':_0x29f41b['queue'],'role':'agent','internal':_0x29f41b[_0x928a('0x12')]?_['toNumber'](_0x29f41b['accountcode']):undefined,'uniqueid':_0x29f41b[_0x928a('0x13')]},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0x2f01bc){return client[_0x928a('0x5')]('CreateMemberReport',{'body':{'channel':_0x928a('0x7'),'membername':_0x2f01bc[_0x928a('0x14')],'interface':_0x2f01bc['interface'],'type':_0x928a('0xc'),'enterAt':_0x2f01bc[_0x928a('0x15')],'exitAt':_0x2f01bc[_0x928a('0x16')],'duration':moment(_0x2f01bc[_0x928a('0x16')])[_0x928a('0xd')](_0x2f01bc['starttime'],_0x928a('0xe'))>=0x0?moment(_0x2f01bc[_0x928a('0x16')])[_0x928a('0xd')](_0x2f01bc[_0x928a('0x15')],_0x928a('0xe')):null,'data1':_0x928a('0x17'),'data2':_0x2f01bc[_0x928a('0x12')],'data3':_0x2f01bc['exten'],'data4':_0x2f01bc[_0x928a('0x18')]||null,'role':_0x928a('0x19'),'internal':_0x2f01bc[_0x928a('0x12')]?_[_0x928a('0x1a')](_0x2f01bc[_0x928a('0x12')]):undefined,'uniqueid':_0x2f01bc['uniqueid']},'log':_0x928a('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 17fc9b2..a0c1ae8 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 _0xa25c=['Request','GetTemplate','name','html','getTemplates'];(function(_0x221176,_0x1c9af3){var _0xeab4f2=function(_0x22010a){while(--_0x22010a){_0x221176['push'](_0x221176['shift']());}};_0xeab4f2(++_0x1c9af3);}(_0xa25c,0x13f));var _0xca25=function(_0x3364f7,_0x3ee4b0){_0x3364f7=_0x3364f7-0x0;var _0x3d2089=_0xa25c[_0x3364f7];return _0x3d2089;};'use strict';var client=require('../client');exports[_0xca25('0x0')]=function(_0x3c0ed9){return function(_0x2a8b77){return client[_0xca25('0x1')](_0xca25('0x2'),{'options':{'raw':!![],'attributes':['id',_0xca25('0x3'),_0xca25('0x4')]},'log':_0xca25('0x2')});};}; \ No newline at end of file +var _0x180f=['name','html','GetTemplate','../client','getTemplates','Request'];(function(_0x5c6cff,_0xc126cd){var _0x2d7544=function(_0x30a1f8){while(--_0x30a1f8){_0x5c6cff['push'](_0x5c6cff['shift']());}};_0x2d7544(++_0xc126cd);}(_0x180f,0xf3));var _0xf180=function(_0x4ac424,_0x554b5d){_0x4ac424=_0x4ac424-0x0;var _0xe1b890=_0x180f[_0x4ac424];return _0xe1b890;};'use strict';var client=require(_0xf180('0x0'));exports[_0xf180('0x1')]=function(_0x49bb6e){return function(_0x43cae2){return client[_0xf180('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xf180('0x3'),_0xf180('0x4')]},'log':_0xf180('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 897561b..c66bd96 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 _0x8963=['data1','data2','data4','data5','data6','data7','getTriggers','Request','GetTrigger','channel','status','Condition','AllConditions','field','AnyConditions','operator','Action','Actions'];(function(_0x313105,_0x448a5d){var _0x3c2d10=function(_0x237ce1){while(--_0x237ce1){_0x313105['push'](_0x313105['shift']());}};_0x3c2d10(++_0x448a5d);}(_0x8963,0x14a));var _0x3896=function(_0x1bf9a3,_0x2fc887){_0x1bf9a3=_0x1bf9a3-0x0;var _0x14c065=_0x8963[_0x1bf9a3];return _0x14c065;};'use strict';var client=require('../client');exports[_0x3896('0x0')]=function(_0x243de6){return function(_0x428a61){return client[_0x3896('0x1')](_0x3896('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x3896('0x3'),_0x3896('0x4')],'include':[{'model':_0x3896('0x5'),'as':_0x3896('0x6'),'attributes':['id',_0x3896('0x7'),'operator','value']},{'model':'Condition','as':_0x3896('0x8'),'attributes':['id',_0x3896('0x7'),_0x3896('0x9'),'value']},{'model':_0x3896('0xa'),'as':_0x3896('0xb'),'attributes':['id','action',_0x3896('0xc'),_0x3896('0xd'),'data3',_0x3896('0xe'),_0x3896('0xf'),_0x3896('0x10'),_0x3896('0x11')]}]},'log':_0x3896('0x2')});};}; \ No newline at end of file +var _0xf8de=['data4','data5','data6','data7','../client','getTriggers','GetTrigger','channel','Condition','AllConditions','field','operator','AnyConditions','Action','action','data1','data2','data3'];(function(_0x307b9e,_0x428f96){var _0x196ea1=function(_0x280bae){while(--_0x280bae){_0x307b9e['push'](_0x307b9e['shift']());}};_0x196ea1(++_0x428f96);}(_0xf8de,0x94));var _0xef8d=function(_0x93ed01,_0x94be01){_0x93ed01=_0x93ed01-0x0;var _0x2cdc6c=_0xf8de[_0x93ed01];return _0x2cdc6c;};'use strict';var client=require(_0xef8d('0x0'));exports[_0xef8d('0x1')]=function(_0x42a8c8){return function(_0x148d10){return client['Request'](_0xef8d('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xef8d('0x3'),'status'],'include':[{'model':_0xef8d('0x4'),'as':_0xef8d('0x5'),'attributes':['id',_0xef8d('0x6'),_0xef8d('0x7'),'value']},{'model':_0xef8d('0x4'),'as':_0xef8d('0x8'),'attributes':['id',_0xef8d('0x6'),_0xef8d('0x7'),'value']},{'model':_0xef8d('0x9'),'as':'Actions','attributes':['id',_0xef8d('0xa'),_0xef8d('0xb'),_0xef8d('0xc'),_0xef8d('0xd'),_0xef8d('0xe'),_0xef8d('0xf'),_0xef8d('0x10'),_0xef8d('0x11')]}]},'log':_0xef8d('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 14d4996..b74474c 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 _0x1b80=['registry','GetTrunk','../client','getTrunks','Request','name'];(function(_0x3d4ef1,_0x5a957c){var _0x409423=function(_0x1ab129){while(--_0x1ab129){_0x3d4ef1['push'](_0x3d4ef1['shift']());}};_0x409423(++_0x5a957c);}(_0x1b80,0x1be));var _0x01b8=function(_0x42e4d8,_0x3c2f58){_0x42e4d8=_0x42e4d8-0x0;var _0x26289e=_0x1b80[_0x42e4d8];return _0x26289e;};'use strict';var client=require(_0x01b8('0x0'));exports[_0x01b8('0x1')]=function(_0x36a2ba){return function(_0x27d009){return client[_0x01b8('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x01b8('0x3'),_0x01b8('0x4')]},'log':_0x01b8('0x5')});};}; \ No newline at end of file +var _0x89b8=['getTrunks','Request','GetTrunk','name','registry','../client'];(function(_0x371c58,_0xb9fc7){var _0x18852e=function(_0x319afc){while(--_0x319afc){_0x371c58['push'](_0x371c58['shift']());}};_0x18852e(++_0xb9fc7);}(_0x89b8,0xa7));var _0x889b=function(_0x146586,_0x5c0834){_0x146586=_0x146586-0x0;var _0x59f36f=_0x89b8[_0x146586];return _0x59f36f;};'use strict';var client=require(_0x889b('0x0'));exports[_0x889b('0x1')]=function(_0x2d3ebd){return function(_0x445e36){return client[_0x889b('0x2')](_0x889b('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x889b('0x4'),_0x889b('0x5')]},'log':_0x889b('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index f774b4d..1865129 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 _0x9c15=['UnpauseUser','getAgent','online','voicePause','interface','../client','Request','GetUser','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','phone','mobile','getAgents','getTelephones','telephone','internal','savePause','saveUnpause'];(function(_0x5bd613,_0x151a02){var _0x62f674=function(_0x548b15){while(--_0x548b15){_0x5bd613['push'](_0x5bd613['shift']());}};_0x62f674(++_0x151a02);}(_0x9c15,0xf7));var _0x59c1=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9c15[_0x4cf98e];return _0x1623ac;};'use strict';var client=require(_0x59c1('0x0'));exports['getAgents']=function(){return function(){return client[_0x59c1('0x1')](_0x59c1('0x2'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x59c1('0x3'),_0x59c1('0x4'),_0x59c1('0x5'),_0x59c1('0x6'),'online',_0x59c1('0x7'),'pauseType',_0x59c1('0x8'),'voicePause',_0x59c1('0x9'),_0x59c1('0xa'),'interface']},'log':_0x59c1('0xb')});};};exports[_0x59c1('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x59c1('0xd')},'attributes':['id',_0x59c1('0x3'),_0x59c1('0x5'),_0x59c1('0xe')]},'log':_0x59c1('0xc')});};};exports[_0x59c1('0xf')]=function(_0x1628d3,_0x2f40ab,_0x45ff35){return client[_0x59c1('0x1')]('PauseUser',{'body':{'type':_0x2f40ab,'uniqueid':_0x45ff35},'options':{'where':{'id':_0x1628d3['id']}},'log':_0x59c1('0xf')});};exports[_0x59c1('0x10')]=function(_0x12df75){return client[_0x59c1('0x1')](_0x59c1('0x11'),{'body':{},'options':{'where':{'id':_0x12df75['id']}},'log':_0x59c1('0xf')});};exports[_0x59c1('0x12')]=function(_0x1dd951){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':'agent','id':_0x1dd951},'attributes':['id',_0x59c1('0x3'),_0x59c1('0x4'),_0x59c1('0x5'),_0x59c1('0x6'),_0x59c1('0x13'),_0x59c1('0x7'),'pauseType',_0x59c1('0x8'),_0x59c1('0x14'),_0x59c1('0x15')]},'log':'getAgent'});}; \ No newline at end of file +var _0x79cb=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','../client','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','interface','getAgents','getTelephones','GetUser','telephone'];(function(_0x564b4e,_0x179e9f){var _0x40a5da=function(_0x36f936){while(--_0x36f936){_0x564b4e['push'](_0x564b4e['shift']());}};_0x40a5da(++_0x179e9f);}(_0x79cb,0x9d));var _0xb79c=function(_0x4d8d02,_0x177167){_0x4d8d02=_0x4d8d02-0x0;var _0x1bc86e=_0x79cb[_0x4d8d02];return _0x1bc86e;};'use strict';var client=require(_0xb79c('0x0'));exports['getAgents']=function(){return function(){return client[_0xb79c('0x1')]('GetUser',{'options':{'raw':![],'where':{'role':_0xb79c('0x2')},'attributes':['id',_0xb79c('0x3'),_0xb79c('0x4'),_0xb79c('0x5'),_0xb79c('0x6'),_0xb79c('0x7'),_0xb79c('0x8'),_0xb79c('0x9'),_0xb79c('0xa'),_0xb79c('0xb'),_0xb79c('0xc'),'mobile',_0xb79c('0xd')]},'log':_0xb79c('0xe')});};};exports[_0xb79c('0xf')]=function(){return function(){return client[_0xb79c('0x1')](_0xb79c('0x10'),{'options':{'raw':!![],'where':{'role':_0xb79c('0x11')},'attributes':['id',_0xb79c('0x3'),_0xb79c('0x5'),_0xb79c('0x12')]},'log':_0xb79c('0xf')});};};exports[_0xb79c('0x13')]=function(_0x3ad5ca,_0x1a3137,_0xb18e14){return client['Request'](_0xb79c('0x14'),{'body':{'type':_0x1a3137,'uniqueid':_0xb18e14},'options':{'where':{'id':_0x3ad5ca['id']}},'log':'savePause'});};exports[_0xb79c('0x15')]=function(_0x5bbe18){return client[_0xb79c('0x1')](_0xb79c('0x16'),{'body':{},'options':{'where':{'id':_0x5bbe18['id']}},'log':_0xb79c('0x13')});};exports[_0xb79c('0x17')]=function(_0x43fbd4){return client[_0xb79c('0x1')](_0xb79c('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x43fbd4},'attributes':['id','name','email',_0xb79c('0x5'),'fullname',_0xb79c('0x7'),'lastLoginAt','pauseType',_0xb79c('0xa'),_0xb79c('0xb'),'interface']},'log':_0xb79c('0x17')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 5430d66..1b57f76 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 _0xac25=['../client','create','Request','CreateVoiceAgentReport','update'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xac25,0x1e5));var _0x5ac2=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0xac25[_0x368bba];return _0x409f8f;};'use strict';var client=require(_0x5ac2('0x0'));exports[_0x5ac2('0x1')]=function(_0xa6a61c){return client[_0x5ac2('0x2')](_0x5ac2('0x3'),{'body':_0xa6a61c,'log':_0x5ac2('0x3')});};exports[_0x5ac2('0x4')]=function(_0x5209cc,_0x1d9f79,_0xb4b8ba){return client['Request']('UpdateVoiceAgentReport',{'body':_0x5209cc,'options':{'where':{'uniqueid':_0x1d9f79,'interface':_0xb4b8ba,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xda79=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x33a539,_0x565697){var _0x29c1ce=function(_0x586b58){while(--_0x586b58){_0x33a539['push'](_0x33a539['shift']());}};_0x29c1ce(++_0x565697);}(_0xda79,0x82));var _0x9da7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xda79[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0x9da7('0x0'));exports[_0x9da7('0x1')]=function(_0x56b3e9){return client[_0x9da7('0x2')]('CreateVoiceAgentReport',{'body':_0x56b3e9,'log':_0x9da7('0x3')});};exports[_0x9da7('0x4')]=function(_0x5eae53,_0x4797ba,_0x3b9006){return client[_0x9da7('0x2')](_0x9da7('0x5'),{'body':_0x5eae53,'options':{'where':{'uniqueid':_0x4797ba,'interface':_0x3b9006,'agentcomplete':!![]}},'log':_0x9da7('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 8a54b7f..a58e21e 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 _0xb814=['context','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum'];(function(_0x14e27a,_0x3b4136){var _0x288688=function(_0x3d7ab1){while(--_0x3d7ab1){_0x14e27a['push'](_0x14e27a['shift']());}};_0x288688(++_0x3b4136);}(_0xb814,0x1f1));var _0x4b81=function(_0x2b1596,_0x449150){_0x2b1596=_0x2b1596-0x0;var _0x530eed=_0xb814[_0x2b1596];return _0x530eed;};'use strict';var moment=require(_0x4b81('0x0'));var util=require(_0x4b81('0x1'));var _=require(_0x4b81('0x2'));var client=require(_0x4b81('0x3'));exports[_0x4b81('0x4')]=function(_0x252505){return client[_0x4b81('0x5')](_0x4b81('0x6'),{'body':_[_0x4b81('0x7')](_0x252505,{'source':_0x252505[_0x4b81('0x8')],'destinationcontext':_0x252505[_0x4b81('0x9')],'callerid':_0x252505['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x4b81('0x6')});};exports[_0x4b81('0xa')]=function(){return function(){return client['Request'](_0x4b81('0xb'),{'options':{'where':{'type':[_0x4b81('0xc')],'createdAt':{'$between':[moment()[_0x4b81('0xd')](_0x4b81('0xe'))[_0x4b81('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x4b81('0x10')](_0x4b81('0xe'))[_0x4b81('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x4b81('0x11'),_0x4b81('0x12'),_0x4b81('0x13'),_0x4b81('0x14')]},'log':_0x4b81('0x15')});};}; \ No newline at end of file +var _0x0ceb=['YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','moment','../client','Request','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','GetVoiceCallReport','outbound','startOf','day','format'];(function(_0x156e37,_0x4679df){var _0x29de05=function(_0x2355f8){while(--_0x2355f8){_0x156e37['push'](_0x156e37['shift']());}};_0x29de05(++_0x4679df);}(_0x0ceb,0xfd));var _0xb0ce=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0ceb[_0x42cae2];return _0x5f256f;};'use strict';var moment=require(_0xb0ce('0x0'));var util=require('util');var _=require('lodash');var client=require(_0xb0ce('0x1'));exports['create']=function(_0x2b0eb5){return client[_0xb0ce('0x2')](_0xb0ce('0x3'),{'body':_[_0xb0ce('0x4')](_0x2b0eb5,{'source':_0x2b0eb5['calleridnum'],'destinationcontext':_0x2b0eb5[_0xb0ce('0x5')],'callerid':_0x2b0eb5[_0xb0ce('0x6')],'amaflags':_0xb0ce('0x7')}),'log':_0xb0ce('0x3')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0xb0ce('0x8'),{'options':{'where':{'type':[_0xb0ce('0x9')],'createdAt':{'$between':[moment()[_0xb0ce('0xa')](_0xb0ce('0xb'))[_0xb0ce('0xc')](_0xb0ce('0xd')),moment()[_0xb0ce('0xe')](_0xb0ce('0xb'))[_0xb0ce('0xc')](_0xb0ce('0xd'))]}},'attributes':[_0xb0ce('0xf'),_0xb0ce('0x10'),_0xb0ce('0x11'),_0xb0ce('0x12')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index c5f249f..075235d 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 _0xafc4=['CreateVoiceDialReport','../client','create','Request'];(function(_0xfb0281,_0x3ff38b){var _0x408dd3=function(_0x5d8017){while(--_0x5d8017){_0xfb0281['push'](_0xfb0281['shift']());}};_0x408dd3(++_0x3ff38b);}(_0xafc4,0x115));var _0x4afc=function(_0x420cae,_0x3139cd){_0x420cae=_0x420cae-0x0;var _0x5740c3=_0xafc4[_0x420cae];return _0x5740c3;};'use strict';var client=require(_0x4afc('0x0'));exports[_0x4afc('0x1')]=function(_0x3b1425){return client[_0x4afc('0x2')]('CreateVoiceDialReport',{'body':_0x3b1425,'log':_0x4afc('0x3')});}; \ No newline at end of file +var _0xc7ed=['../client'];(function(_0x5e7e92,_0xdb0f1){var _0x412746=function(_0x1872fa){while(--_0x1872fa){_0x5e7e92['push'](_0x5e7e92['shift']());}};_0x412746(++_0xdb0f1);}(_0xc7ed,0x72));var _0xdc7e=function(_0xf1bf12,_0x4558e4){_0xf1bf12=_0xf1bf12-0x0;var _0x340ce8=_0xc7ed[_0xf1bf12];return _0x340ce8;};'use strict';var client=require(_0xdc7e('0x0'));exports['create']=function(_0x384e89){return client['Request']('CreateVoiceDialReport',{'body':_0x384e89,'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 b9570ab..0ca68d7 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 _0x98b7=['GetVoiceExtension','../client','getVoiceExtensions','Request'];(function(_0x4c6cf0,_0x826f70){var _0x108145=function(_0x299f69){while(--_0x299f69){_0x4c6cf0['push'](_0x4c6cf0['shift']());}};_0x108145(++_0x826f70);}(_0x98b7,0xc1));var _0x798b=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x98b7[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0x798b('0x0'));exports[_0x798b('0x1')]=function(){return function(){return client[_0x798b('0x2')](_0x798b('0x3'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x3750=['GetVoiceExtension','exten','../client','getVoiceExtensions','Request'];(function(_0x25d1d6,_0x347797){var _0x4a14f5=function(_0x481357){while(--_0x481357){_0x25d1d6['push'](_0x25d1d6['shift']());}};_0x4a14f5(++_0x347797);}(_0x3750,0xbb));var _0x0375=function(_0x3b20c2,_0x888661){_0x3b20c2=_0x3b20c2-0x0;var _0x5b4482=_0x3750[_0x3b20c2];return _0x5b4482;};'use strict';var client=require(_0x0375('0x0'));exports[_0x0375('0x1')]=function(){return function(){return client[_0x0375('0x2')](_0x0375('0x3'),{'options':{'raw':!![],'attributes':['id',_0x0375('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x0375('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index bd866cd..a9e86e5 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 _0x022d=['Request','name','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','../client','getVoiceQueues'];(function(_0x6d8524,_0x592afd){var _0xf2d0ea=function(_0x265be5){while(--_0x265be5){_0x6d8524['push'](_0x6d8524['shift']());}};_0xf2d0ea(++_0x592afd);}(_0x022d,0xd2));var _0xd022=function(_0x31fe86,_0x2bfff4){_0x31fe86=_0x31fe86-0x0;var _0x4bb739=_0x022d[_0x31fe86];return _0x4bb739;};'use strict';var client=require(_0xd022('0x0'));exports[_0xd022('0x1')]=function(){return function(){return client[_0xd022('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xd022('0x3'),'acw',_0xd022('0x4'),_0xd022('0x5'),_0xd022('0x6'),_0xd022('0x7'),_0xd022('0x8'),'dialMethod','dialLimitChannel',_0xd022('0x9'),_0xd022('0xa'),_0xd022('0xb'),_0xd022('0xc'),_0xd022('0xd'),_0xd022('0xe'),_0xd022('0xf'),_0xd022('0x10'),'dialQueueOptions',_0xd022('0x11'),_0xd022('0x12'),_0xd022('0x13'),_0xd022('0x14'),_0xd022('0x15'),_0xd022('0x16'),_0xd022('0x17'),'dialNoAnswerRetryFrequency',_0xd022('0x18'),'dialTimezone',_0xd022('0x19'),_0xd022('0x1a'),_0xd022('0x1b'),'dialAMDActive',_0xd022('0x1c'),_0xd022('0x1d'),_0xd022('0x1e'),_0xd022('0x1f'),_0xd022('0x20'),_0xd022('0x21'),_0xd022('0x22'),'dialAMDSilenceThreshold',_0xd022('0x23'),_0xd022('0x24'),_0xd022('0x25'),_0xd022('0x26'),_0xd022('0x27'),_0xd022('0x28'),'dialAgiAfterHangupClient',_0xd022('0x29'),_0xd022('0x6'),'strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit',_0xd022('0x2a'),_0xd022('0x2b'),_0xd022('0x2c')],'include':[{'model':'Trunk','as':_0xd022('0x2d'),'attributes':['id',_0xd022('0x3'),'callerid',_0xd022('0x2e')]},{'model':_0xd022('0x2f'),'as':_0xd022('0x30'),'attributes':['id',_0xd022('0x3')]},{'model':'Trunk','as':_0xd022('0x31'),'attributes':['id',_0xd022('0x3'),_0xd022('0x32'),'active']},{'model':'Interval','as':'Interval','attributes':['id',_0xd022('0x3')],'include':[{'model':_0xd022('0x33'),'as':_0xd022('0x34'),'attributes':['id',_0xd022('0x3'),'interval']}]}]},'log':_0xd022('0x1')});};}; \ No newline at end of file +var _0xa3b0=['getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','../client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa3b0,0xe7));var _0x0a3b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa3b0[_0x2641f9];return _0x585741;};'use strict';var client=require(_0x0a3b('0x0'));exports[_0x0a3b('0x1')]=function(){return function(){return client[_0x0a3b('0x2')](_0x0a3b('0x3'),{'options':{'raw':![],'attributes':['id',_0x0a3b('0x4'),_0x0a3b('0x5'),_0x0a3b('0x6'),_0x0a3b('0x7'),_0x0a3b('0x8'),_0x0a3b('0x9'),_0x0a3b('0xa'),_0x0a3b('0xb'),_0x0a3b('0xc'),_0x0a3b('0xd'),_0x0a3b('0xe'),_0x0a3b('0xf'),'dialPredictiveOptimizationPercentage',_0x0a3b('0x10'),_0x0a3b('0x11'),_0x0a3b('0x12'),_0x0a3b('0x13'),_0x0a3b('0x14'),'dialQueueTimeout',_0x0a3b('0x15'),_0x0a3b('0x16'),_0x0a3b('0x17'),_0x0a3b('0x18'),_0x0a3b('0x19'),_0x0a3b('0x1a'),_0x0a3b('0x1b'),_0x0a3b('0x1c'),_0x0a3b('0x1d'),'dialGlobalInterval',_0x0a3b('0x1e'),_0x0a3b('0x1f'),_0x0a3b('0x20'),_0x0a3b('0x21'),_0x0a3b('0x22'),_0x0a3b('0x23'),_0x0a3b('0x24'),_0x0a3b('0x25'),_0x0a3b('0x26'),_0x0a3b('0x27'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout',_0x0a3b('0x28'),_0x0a3b('0x29'),_0x0a3b('0x2a'),_0x0a3b('0x2b'),_0x0a3b('0x2c'),_0x0a3b('0x2d'),_0x0a3b('0x8'),_0x0a3b('0x2e'),_0x0a3b('0x2f'),'dialCutDigit',_0x0a3b('0x30'),'dialPredictiveIntervalMaxThreshold',_0x0a3b('0x31')],'include':[{'model':_0x0a3b('0x32'),'as':_0x0a3b('0x32'),'attributes':['id',_0x0a3b('0x4'),'callerid',_0x0a3b('0x33')]},{'model':_0x0a3b('0x34'),'as':_0x0a3b('0x35'),'attributes':['id','name']},{'model':_0x0a3b('0x32'),'as':_0x0a3b('0x36'),'attributes':['id',_0x0a3b('0x4'),_0x0a3b('0x37'),_0x0a3b('0x33')]},{'model':_0x0a3b('0x38'),'as':'Interval','attributes':['id',_0x0a3b('0x4')],'include':[{'model':'Interval','as':_0x0a3b('0x39'),'attributes':['id',_0x0a3b('0x4'),'interval']}]}]},'log':_0x0a3b('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index f7f4183..56e58a6 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 _0x260d=['day','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','create','CreateVoiceQueueReport','Request','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf'];(function(_0x388a98,_0x38c40c){var _0x24352b=function(_0x1a4c7c){while(--_0x1a4c7c){_0x388a98['push'](_0x388a98['shift']());}};_0x24352b(++_0x38c40c);}(_0x260d,0xc4));var _0xd260=function(_0x59b953,_0xb13703){_0x59b953=_0x59b953-0x0;var _0x58cbd0=_0x260d[_0x59b953];return _0x58cbd0;};'use strict';var moment=require('moment');var _=require('lodash');var client=require('../client');exports[_0xd260('0x0')]=function(_0x59338d){return client['Request'](_0xd260('0x1'),{'body':_0x59338d,'log':_0xd260('0x1')});};exports['getVoiceQueueReports']=function(){return function(){return client[_0xd260('0x2')](_0xd260('0x3'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xd260('0x4')]('day')[_0xd260('0x5')](_0xd260('0x6')),moment()[_0xd260('0x7')](_0xd260('0x8'))['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['uniqueid',_0xd260('0x9'),_0xd260('0xa'),_0xd260('0xb'),_0xd260('0xc'),_0xd260('0xd'),_0xd260('0xe'),_0xd260('0xf'),_0xd260('0x10'),'queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0x47cb=['YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','queuecallerabandon','GetVoiceQueueReports','moment','lodash','../client','create','Request','CreateVoiceQueueReport','GetVoiceQueueReport','startOf','day','format'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x47cb,0x74));var _0xb47c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47cb[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xb47c('0x0'));var _=require(_0xb47c('0x1'));var client=require(_0xb47c('0x2'));exports[_0xb47c('0x3')]=function(_0x2d354c){return client[_0xb47c('0x4')](_0xb47c('0x5'),{'body':_0x2d354c,'log':_0xb47c('0x5')});};exports['getVoiceQueueReports']=function(){return function(){return client[_0xb47c('0x4')](_0xb47c('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xb47c('0x7')](_0xb47c('0x8'))[_0xb47c('0x9')](_0xb47c('0xa')),moment()[_0xb47c('0xb')](_0xb47c('0x8'))[_0xb47c('0x9')](_0xb47c('0xa'))]}},'attributes':[_0xb47c('0xc'),_0xb47c('0xd'),_0xb47c('0xe'),_0xb47c('0xf'),_0xb47c('0x10'),'queuecallercompleteAt',_0xb47c('0x11'),_0xb47c('0x12'),_0xb47c('0x13'),'queuecallerabandonAt']},'log':_0xb47c('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 9c17769..218afb1 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 _0x4858=['../client','getVoiceQueueRtPauses'];(function(_0xa4928c,_0x16b89c){var _0x27cc29=function(_0x14b819){while(--_0x14b819){_0xa4928c['push'](_0xa4928c['shift']());}};_0x27cc29(++_0x16b89c);}(_0x4858,0x102));var _0x8485=function(_0x26e3a0,_0x418608){_0x26e3a0=_0x26e3a0-0x0;var _0x1214d3=_0x4858[_0x26e3a0];return _0x1214d3;};'use strict';var client=require(_0x8485('0x0'));exports[_0x8485('0x1')]=function(_0x48c8d0){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x48c8d0,'paused':!![]},'raw':!![]},'log':_0x8485('0x1')});};}; \ No newline at end of file +var _0xc26c=['getVoiceQueueRtPauses','../client'];(function(_0x1b8e60,_0x21b885){var _0x363363=function(_0x5987c7){while(--_0x5987c7){_0x1b8e60['push'](_0x1b8e60['shift']());}};_0x363363(++_0x21b885);}(_0xc26c,0x11d));var _0xcc26=function(_0x12033d,_0x35361e){_0x12033d=_0x12033d-0x0;var _0x3cbbf0=_0xc26c[_0x12033d];return _0x3cbbf0;};'use strict';var client=require(_0xcc26('0x0'));exports[_0xcc26('0x1')]=function(_0x5e74e7){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x5e74e7,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 2e85f50..d430bcd 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 _0xa3e1=['merge','monitorFilename','../client','Request','CreateVoiceRecording'];(function(_0x2dadc7,_0x2470c1){var _0xb80a53=function(_0x3596e9){while(--_0x3596e9){_0x2dadc7['push'](_0x2dadc7['shift']());}};_0xb80a53(++_0x2470c1);}(_0xa3e1,0x16a));var _0x1a3e=function(_0x2c8972,_0x1aff63){_0x2c8972=_0x2c8972-0x0;var _0x5d1e22=_0xa3e1[_0x2c8972];return _0x5d1e22;};'use strict';var _=require('lodash');var client=require(_0x1a3e('0x0'));exports['create']=function(_0x303204){return client[_0x1a3e('0x1')](_0x1a3e('0x2'),{'body':_[_0x1a3e('0x3')](_0x303204,{'value':_0x303204[_0x1a3e('0x4')]}),'log':_0x1a3e('0x2')});}; \ No newline at end of file +var _0xe71c=['create','Request','CreateVoiceRecording','monitorFilename','../client'];(function(_0x49b14d,_0x578d07){var _0x3d2488=function(_0x5a8668){while(--_0x5a8668){_0x49b14d['push'](_0x49b14d['shift']());}};_0x3d2488(++_0x578d07);}(_0xe71c,0x1bc));var _0xce71=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0xe71c[_0x95942];return _0x6d7f81;};'use strict';var _=require('lodash');var client=require(_0xce71('0x0'));exports[_0xce71('0x1')]=function(_0xc68a8a){return client[_0xce71('0x2')](_0xce71('0x3'),{'body':_['merge'](_0xc68a8a,{'value':_0xc68a8a[_0xce71('0x4')]}),'log':_0xce71('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 469b22c..48035ff 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 _0xcf8d=['transfererconnectedlinename','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','blind','CreateVoiceTransferReport','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','blindTransfer','Request','transferercalleridnum','transferercalleridname','transfererconnectedlinenum'];(function(_0x484c80,_0x2bb3e){var _0x6d8d93=function(_0x32e6ab){while(--_0x32e6ab){_0x484c80['push'](_0x484c80['shift']());}};_0x6d8d93(++_0x2bb3e);}(_0xcf8d,0x13a));var _0xdcf8=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xcf8d[_0x1b2ff7];return _0x31656a;};'use strict';var client=require(_0xdcf8('0x0'));exports[_0xdcf8('0x1')]=function(_0x6a1b2e){return client[_0xdcf8('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x6a1b2e['result'],'transfererchannel':_0x6a1b2e['transfererchannel'],'transferercalleridnum':_0x6a1b2e[_0xdcf8('0x3')],'transferercalleridname':_0x6a1b2e[_0xdcf8('0x4')],'transfererconnectedlinenum':_0x6a1b2e[_0xdcf8('0x5')],'transfererconnectedlinename':_0x6a1b2e[_0xdcf8('0x6')],'transfereraccountcode':_0x6a1b2e['transfereraccountcode'],'transferercontext':_0x6a1b2e[_0xdcf8('0x7')],'transfererexten':_0x6a1b2e[_0xdcf8('0x8')],'transfererlinkedid':_0x6a1b2e['transfererlinkedid'],'transfereechannel':_0x6a1b2e[_0xdcf8('0x9')],'transfereecalleridnum':_0x6a1b2e[_0xdcf8('0xa')],'transfereecalleridname':_0x6a1b2e[_0xdcf8('0xb')],'transfereeconnectedlinenum':_0x6a1b2e[_0xdcf8('0xc')],'transfereeconnectedlinename':_0x6a1b2e[_0xdcf8('0xd')],'transfereeaccountcode':_0x6a1b2e[_0xdcf8('0xe')],'transfereecontext':_0x6a1b2e[_0xdcf8('0xf')],'transfereeexten':_0x6a1b2e[_0xdcf8('0x10')],'transfereelinkedid':_0x6a1b2e[_0xdcf8('0x11')],'isexternal':_0x6a1b2e[_0xdcf8('0x12')],'context':_0x6a1b2e['context'],'extension':_0x6a1b2e[_0xdcf8('0x13')],'type':_0xdcf8('0x14')},'log':_0xdcf8('0x15')});};exports[_0xdcf8('0x16')]=function(_0xa6141d){return client[_0xdcf8('0x2')](_0xdcf8('0x15'),{'body':{'result':_0xa6141d[_0xdcf8('0x17')],'transfererchannel':_0xa6141d[_0xdcf8('0x18')],'transferercalleridnum':_0xa6141d[_0xdcf8('0x19')],'transferercalleridname':_0xa6141d[_0xdcf8('0x1a')],'transfererconnectedlinenum':_0xa6141d[_0xdcf8('0x1b')],'transfererconnectedlinename':_0xa6141d[_0xdcf8('0x1c')],'transfereraccountcode':_0xa6141d['origtransfereraccountcode'],'transferercontext':_0xa6141d['secondtransferercontext'],'transfererexten':_0xa6141d[_0xdcf8('0x1d')],'transfererlinkedid':_0xa6141d['origtransfererlinkedid'],'transfereechannel':_0xa6141d[_0xdcf8('0x1e')],'transfereecalleridnum':_0xa6141d[_0xdcf8('0x1f')],'transfereecalleridname':_0xa6141d['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xa6141d[_0xdcf8('0x20')],'transfereeconnectedlinename':_0xa6141d[_0xdcf8('0x21')],'transfereeaccountcode':_0xa6141d[_0xdcf8('0x22')],'transfereecontext':_0xa6141d[_0xdcf8('0x23')],'transfereeexten':_0xa6141d[_0xdcf8('0x24')],'transfereelinkedid':_0xa6141d[_0xdcf8('0x25')],'isexternal':_0xa6141d[_0xdcf8('0x12')],'context':_0xa6141d[_0xdcf8('0x26')],'extension':_0xa6141d[_0xdcf8('0x27')],'type':'attended'},'log':_0xdcf8('0x15')});}; \ No newline at end of file +var _0xae7f=['../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','isexternal','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetcontext','transfertargetexten','transfertargetlinkedid','attended'];(function(_0x44c780,_0x5316d5){var _0xdd8a60=function(_0x28f987){while(--_0x28f987){_0x44c780['push'](_0x44c780['shift']());}};_0xdd8a60(++_0x5316d5);}(_0xae7f,0x1e1));var _0xfae7=function(_0x5b95bb,_0x4757a6){_0x5b95bb=_0x5b95bb-0x0;var _0x4b8136=_0xae7f[_0x5b95bb];return _0x4b8136;};'use strict';var client=require(_0xfae7('0x0'));exports[_0xfae7('0x1')]=function(_0xb7bac5){return client[_0xfae7('0x2')](_0xfae7('0x3'),{'body':{'result':_0xb7bac5[_0xfae7('0x4')],'transfererchannel':_0xb7bac5[_0xfae7('0x5')],'transferercalleridnum':_0xb7bac5[_0xfae7('0x6')],'transferercalleridname':_0xb7bac5[_0xfae7('0x7')],'transfererconnectedlinenum':_0xb7bac5[_0xfae7('0x8')],'transfererconnectedlinename':_0xb7bac5[_0xfae7('0x9')],'transfereraccountcode':_0xb7bac5[_0xfae7('0xa')],'transferercontext':_0xb7bac5[_0xfae7('0xb')],'transfererexten':_0xb7bac5[_0xfae7('0xc')],'transfererlinkedid':_0xb7bac5[_0xfae7('0xd')],'transfereechannel':_0xb7bac5['transfereechannel'],'transfereecalleridnum':_0xb7bac5[_0xfae7('0xe')],'transfereecalleridname':_0xb7bac5[_0xfae7('0xf')],'transfereeconnectedlinenum':_0xb7bac5[_0xfae7('0x10')],'transfereeconnectedlinename':_0xb7bac5[_0xfae7('0x11')],'transfereeaccountcode':_0xb7bac5['transfereeaccountcode'],'transfereecontext':_0xb7bac5[_0xfae7('0x12')],'transfereeexten':_0xb7bac5['transfereeexten'],'transfereelinkedid':_0xb7bac5['transfereelinkedid'],'isexternal':_0xb7bac5[_0xfae7('0x13')],'context':_0xb7bac5['context'],'extension':_0xb7bac5[_0xfae7('0x14')],'type':_0xfae7('0x15')},'log':_0xfae7('0x3')});};exports[_0xfae7('0x16')]=function(_0x58266f){return client[_0xfae7('0x2')](_0xfae7('0x3'),{'body':{'result':_0x58266f[_0xfae7('0x4')],'transfererchannel':_0x58266f[_0xfae7('0x17')],'transferercalleridnum':_0x58266f[_0xfae7('0x18')],'transferercalleridname':_0x58266f[_0xfae7('0x19')],'transfererconnectedlinenum':_0x58266f['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x58266f['secondtransfererconnectedlinename'],'transfereraccountcode':_0x58266f[_0xfae7('0x1a')],'transferercontext':_0x58266f[_0xfae7('0x1b')],'transfererexten':_0x58266f[_0xfae7('0x1c')],'transfererlinkedid':_0x58266f[_0xfae7('0x1d')],'transfereechannel':_0x58266f[_0xfae7('0x1e')],'transfereecalleridnum':_0x58266f[_0xfae7('0x1f')],'transfereecalleridname':_0x58266f[_0xfae7('0x20')],'transfereeconnectedlinenum':_0x58266f['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x58266f['transfertargetconnectedlinename'],'transfereeaccountcode':_0x58266f['transfertargetaccountcode'],'transfereecontext':_0x58266f[_0xfae7('0x21')],'transfereeexten':_0x58266f[_0xfae7('0x22')],'transfereelinkedid':_0x58266f[_0xfae7('0x23')],'isexternal':_0x58266f['isexternal'],'context':_0x58266f['origtransferercontext'],'extension':_0x58266f['origtransfererexten'],'type':_0xfae7('0x24')},'log':_0xfae7('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 0fb7152..904cd8e 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 _0xecbe=['outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','callerid','Interval','length','values','channels','voicechannel','find','uniqueid','%s.%s','filename','wav','MixMonitor','channel','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','emit','custom:','event','faxAccounts','send','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','pick','keys','module','action','Reload','Action','then','message','catch','join','Command','content','voiceQueues','hasOwnProperty','strategy','answered','sumBillable','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay'];(function(_0x598b8e,_0x1bd807){var _0x5502cc=function(_0x2e1611){while(--_0x2e1611){_0x598b8e['push'](_0x598b8e['shift']());}};_0x5502cc(++_0x1bd807);}(_0xecbe,0x1da));var _0xeecb=function(_0x17ee38,_0x5bdff4){_0x17ee38=_0x17ee38-0x0;var _0x439a4e=_0xecbe[_0x17ee38];return _0x439a4e;};'use strict';var _=require('lodash');var util=require(_0xeecb('0x0'));var jayson=require(_0xeecb('0x1'));var schema=require(_0xeecb('0x2'));var BPromise=require(_0xeecb('0x3'));var moment=require(_0xeecb('0x4'));var config=require(_0xeecb('0x5'));var properties=require(_0xeecb('0x6'));var ami=require('../ami');exports[_0xeecb('0x7')]=function(_0xe0c46f,_0x16b829,_0x35203c){return new BPromise(function(_0x41be34,_0x177f8b){var _0x13fd92={'QueuePause':function(_0x542c3d){return new Promise(function(_0x36ce62,_0x383480){var _0x5b3e53=util[_0xeecb('0x8')](_0xeecb('0x9'),_0xeecb('0xa'),_0x542c3d[_0xeecb('0xb')]);if(_0xe0c46f[_0xeecb('0xc')]&&_0xe0c46f[_0xeecb('0xc')][_0x5b3e53]&&_0xe0c46f[_0xeecb('0xc')][_0x5b3e53][_0xeecb('0xd')]){_0xe0c46f['timers'][_0x5b3e53][_0xeecb('0xe')]();}if(_0xe0c46f[_0xeecb('0xf')][_0x5b3e53]){_0xe0c46f[_0xeecb('0xf')][_0x5b3e53]['updateStatusRealtime']({'statePause':_0x542c3d[_0xeecb('0x10')]?!![]:![]});}_0x36ce62({'code':0xc8,'message':_0xeecb('0x11')});});},'Reload':function(_0x12fdce){var _0x17eb6e=this;return new Promise(function(_0x4f9edb,_0x2fb275){if(ami[_0xeecb('0x12')]()==![]){return _0x2fb275(_0x17eb6e[_0xeecb('0x13')](0x1f4,[config[_0xeecb('0x14')]['ip'],config[_0xeecb('0x14')][_0xeecb('0x15')],_0xeecb('0x16')]['join']('\x20')));}_0x12fdce=_[_0xeecb('0x17')](_0x12fdce,_[_0xeecb('0x18')](properties[_0xeecb('0x19')]));_0x12fdce[_0xeecb('0x1a')]=_0xeecb('0x1b');return ami[_0xeecb('0x1c')](_0x12fdce)[_0xeecb('0x1d')](function(_0x4f3967){_0x4f9edb({'code':0xc8,'message':_0x4f3967[_0xeecb('0x1e')]});})[_0xeecb('0x1f')](function(_0x25b46c){_0x2fb275(_0x17eb6e[_0xeecb('0x13')](0x1f5,_0x25b46c[_0xeecb('0x1e')]));});});},'Command':function(_0x4d5d17){var _0x587cf0=this;return new Promise(function(_0x4af213,_0x653180){if(ami[_0xeecb('0x12')]()==![]){return _0x653180(_0x587cf0[_0xeecb('0x13')](0x1f4,[config[_0xeecb('0x14')]['ip'],config[_0xeecb('0x14')][_0xeecb('0x15')],_0xeecb('0x16')][_0xeecb('0x20')]('\x20')));}_0x4d5d17=_[_0xeecb('0x17')](_0x4d5d17,'command');_0x4d5d17[_0xeecb('0x1a')]=_0xeecb('0x21');return ami[_0xeecb('0x1c')](_0x4d5d17)[_0xeecb('0x1d')](function(_0x5e70a1){_0x4af213({'code':0xc8,'message':_0x5e70a1[_0xeecb('0x22')]});})['catch'](function(_0x1cc187){_0x653180(_0x587cf0[_0xeecb('0x13')](0x1f5,_0x1cc187[_0xeecb('0x1e')]));});});},'VoiceQueues':function(_0x5343d5){return new Promise(function(_0x4b58b3,_0x56bc7d){var _0x238ffc=[];for(var _0x5beeab in _0xe0c46f[_0xeecb('0x23')]){if(_0xe0c46f['voiceQueues'][_0xeecb('0x24')](_0x5beeab)){var _0x12d17e=_0xe0c46f['voiceQueues'][_0x5beeab];var _0x534af0={'id':_0x12d17e['id'],'name':_0x12d17e[_0xeecb('0xb')],'strategy':_0x12d17e[_0xeecb('0x25')],'answered':_0x12d17e[_0xeecb('0x26')],'available':_0x12d17e['available'],'loggedIn':_0x12d17e['loggedIn'],'pTalking':_0x12d17e['pTalking'],'sumBillable':_0x12d17e[_0xeecb('0x27')],'sumDuration':_0x12d17e['sumDuration'],'sumHoldTime':_0x12d17e['sumHoldTime']||0x0,'talking':_0x12d17e[_0xeecb('0x28')],'total':_0x12d17e[_0xeecb('0x29')],'type':_0x12d17e[_0xeecb('0x2a')],'unmanaged':_0x12d17e[_0xeecb('0x2b')],'abandoned':_0x12d17e[_0xeecb('0x2c')],'waiting':_0x12d17e[_0xeecb('0x2d')],'loggedInDb':_0x12d17e[_0xeecb('0x2e')]};if(_0x12d17e['type']===_0xeecb('0x2f')){_0x534af0[_0xeecb('0x30')]=_0x12d17e['dialActive'];_0x534af0['dialMethod']=_0x12d17e['dialMethod'];_0x534af0[_0xeecb('0x31')]=_0x12d17e[_0xeecb('0x31')];_0x534af0[_0xeecb('0x32')]=_0x12d17e[_0xeecb('0x32')];_0x534af0[_0xeecb('0x33')]=_0x12d17e['dialOriginateTimeout'];_0x534af0[_0xeecb('0x34')]=_0x12d17e['dialPrefix'];_0x534af0[_0xeecb('0x35')]=_0x12d17e[_0xeecb('0x35')];_0x534af0['outboundAnswerCallsDay']=_0x12d17e[_0xeecb('0x36')];_0x534af0[_0xeecb('0x37')]=_0x12d17e['outboundBlacklistCallsDay'];_0x534af0[_0xeecb('0x38')]=_0x12d17e[_0xeecb('0x38')];_0x534af0[_0xeecb('0x39')]=_0x12d17e['outboundCongestionCallsDay'];_0x534af0[_0xeecb('0x3a')]=_0x12d17e[_0xeecb('0x3a')];_0x534af0[_0xeecb('0x3b')]=_0x12d17e[_0xeecb('0x3b')];_0x534af0[_0xeecb('0x3c')]=_0x12d17e[_0xeecb('0x3c')];_0x534af0['outboundNoAnswerCallsDay']=_0x12d17e[_0xeecb('0x3d')];_0x534af0['outboundNoSuchCallsDay']=_0x12d17e['outboundNoSuchCallsDay'];_0x534af0[_0xeecb('0x3e')]=_0x12d17e[_0xeecb('0x3e')];_0x534af0[_0xeecb('0x3f')]=_0x12d17e['outboundReCallsDay'];_0x534af0[_0xeecb('0x40')]=_0x12d17e[_0xeecb('0x40')];_0x534af0[_0xeecb('0x41')]=_0x12d17e['outboundUnknownCallsDay'];_0x534af0[_0xeecb('0x42')]=_0x12d17e[_0xeecb('0x42')];_0x534af0['predictiveIntervalAvgHoldtime']=_0x12d17e[_0xeecb('0x43')];_0x534af0[_0xeecb('0x44')]=_0x12d17e[_0xeecb('0x44')];_0x534af0[_0xeecb('0x45')]=_0x12d17e[_0xeecb('0x45')];_0x534af0[_0xeecb('0x46')]=_0x12d17e['predictiveIntervalDroppedCallsTimeout'];_0x534af0[_0xeecb('0x47')]=_0x12d17e[_0xeecb('0x47')];_0x534af0[_0xeecb('0x48')]=_0x12d17e[_0xeecb('0x48')];_0x534af0[_0xeecb('0x49')]=_0x12d17e['predictiveIntervalHitRate'];_0x534af0[_0xeecb('0x4a')]=_0x12d17e[_0xeecb('0x4a')];_0x534af0[_0xeecb('0x4b')]=_0x12d17e['predictiveIntervalPauses'];_0x534af0[_0xeecb('0x4c')]=_0x12d17e[_0xeecb('0x4c')];_0x534af0[_0xeecb('0x4d')]=_0x12d17e[_0xeecb('0x4d')];_0x534af0[_0xeecb('0x1e')]=_0x12d17e[_0xeecb('0x1e')];_0x534af0[_0xeecb('0x4e')]=_0x12d17e['originated'];_0x534af0[_0xeecb('0x4f')]=_0x12d17e[_0xeecb('0x4f')];_0x534af0[_0xeecb('0x50')]=_0x12d17e[_0xeecb('0x50')];_0x534af0[_0xeecb('0x51')]=_0x12d17e['erlangAbandonmentRate'];_0x534af0[_0xeecb('0x52')]=_0x12d17e[_0xeecb('0x52')];_0x534af0[_0xeecb('0x53')]=_0x12d17e[_0xeecb('0x53')];_0x534af0['startProgressive']=_0x12d17e['startProgressive'];}if(_0x12d17e[_0xeecb('0x54')]){_0x534af0[_0xeecb('0x54')]={'id':_0x12d17e[_0xeecb('0x54')]['id'],'name':_0x12d17e[_0xeecb('0x54')][_0xeecb('0xb')],'active':_0x12d17e[_0xeecb('0x54')]['active'],'callerid':_0x12d17e[_0xeecb('0x54')][_0xeecb('0x55')]};}if(_0x12d17e[_0xeecb('0x56')]){_0x534af0['Interval']={'id':_0x12d17e[_0xeecb('0x56')]['id'],'name':_0x12d17e[_0xeecb('0x56')]['name']};}_0x238ffc['push'](_0x534af0);}}_0x4b58b3({'count':_0x238ffc[_0xeecb('0x57')],'rows':_0x238ffc});});},'VoiceChannels':function(_0x15ac3b){return new Promise(function(_0x3ae4df,_0x4ee32c){var _0x3029c5=_[_0xeecb('0x58')](_0xe0c46f[_0xeecb('0x59')]);_0x3ae4df({'count':_0x3029c5[_0xeecb('0x57')],'rows':_0x3029c5});});},'VoiceChannelMixMonitor':function(_0x3b53fb){var _0x16195c=this;return new Promise(function(_0x2f6dc0,_0x9d688a){if(ami['isConnected']()==![]){return _0x9d688a(_0x16195c[_0xeecb('0x13')](0x1f4,[config[_0xeecb('0x14')]['ip'],config[_0xeecb('0x14')][_0xeecb('0x15')],_0xeecb('0x16')][_0xeecb('0x20')]('\x20')));}var _0x4ffeb8=schema(properties[_0xeecb('0x5a')])[_0xeecb('0x2')](_0x3b53fb);if(_0x4ffeb8[_0xeecb('0x57')]>0x0){return _0x9d688a(_0x16195c[_0xeecb('0x13')](0x1f4,_['map'](_0x4ffeb8,_0xeecb('0x1e'))[_0xeecb('0x20')](',\x20')));}var _0x8b3bf3=_[_0xeecb('0x5b')](_0xe0c46f[_0xeecb('0x59')],{'uniqueid':_0x3b53fb[_0xeecb('0x5c')]});if(_0x8b3bf3&&_0x8b3bf3['channel']){var _0x501d12=util[_0xeecb('0x8')](_0xeecb('0x5d'),_0x3b53fb[_0xeecb('0x5e')]||_0x3b53fb[_0xeecb('0x5c')],_0x3b53fb[_0xeecb('0x8')]||_0xeecb('0x5f'));return ami[_0xeecb('0x1c')]({'action':_0xeecb('0x60'),'channel':_0x8b3bf3[_0xeecb('0x61')],'file':_0x501d12,'options':'ai(mixmonitorid)'})['then'](function(_0x1cee60){var _0x111cdd=_[_0xeecb('0x5b')](_0x8b3bf3[_0xeecb('0x62')],{'filename':_0xeecb('0x63')+_0x501d12[_0xeecb('0x64')]()});if(_[_0xeecb('0x65')](_0x111cdd)){_0x8b3bf3['monitors'][_0xeecb('0x66')]({'filename':_0xeecb('0x63')+_0x501d12[_0xeecb('0x64')](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x1cee60['mixmonitorid'],'status':_0xeecb('0x67')});}else{_0x111cdd['mixmonitorid']=_0x1cee60[_0xeecb('0x68')];_0x111cdd[_0xeecb('0x69')]=_0xeecb('0x67');}_0x2f6dc0({'code':0xc8,'message':[_0x3b53fb[_0xeecb('0x5c')],_0xeecb('0x6a'),_0x1cee60[_0xeecb('0x68')]][_0xeecb('0x20')]('\x20'),'mixmonitorid':_0x1cee60[_0xeecb('0x68')]});})[_0xeecb('0x1f')](function(_0x477e54){_0x9d688a(_0x16195c[_0xeecb('0x13')](0x1f5,[_0x3b53fb[_0xeecb('0x5c')],_0x477e54['message'][_0xeecb('0x64')]()][_0xeecb('0x20')]('\x20')));});}else{return _0x9d688a(_0x16195c[_0xeecb('0x13')](0x1f5,_0xeecb('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0xedd8ca){var _0x405f62=this;return new Promise(function(_0x132639,_0xa51ec4){if(ami['isConnected']()==![]){return _0xa51ec4(_0x405f62[_0xeecb('0x13')](0x1f4,[config[_0xeecb('0x14')]['ip'],config[_0xeecb('0x14')][_0xeecb('0x15')],_0xeecb('0x16')][_0xeecb('0x20')]('\x20')));}var _0x477dd6=schema(properties[_0xeecb('0x5a')])[_0xeecb('0x2')](_0xedd8ca);if(_0x477dd6['length']>0x0){return _0xa51ec4(_0x405f62[_0xeecb('0x13')](0x1f4,_[_0xeecb('0x6c')](_0x477dd6,'message')['join'](',\x20')));}var _0x25216b=_[_0xeecb('0x5b')](_0xe0c46f[_0xeecb('0x59')],{'uniqueid':_0xedd8ca[_0xeecb('0x5c')]});if(_0x25216b){return BPromise['resolve']()['then'](function(){if(_0x25216b[_0xeecb('0x61')]){return ami['Action']({'action':_0xeecb('0x6d'),'channel':_0x25216b[_0xeecb('0x61')],'mixmonitorid':_0xedd8ca[_0xeecb('0x68')]})[_0xeecb('0x1f')](function(_0x53fb7f){});}})[_0xeecb('0x1d')](function(){if(_0x25216b[_0xeecb('0x6e')]){return ami[_0xeecb('0x1c')]({'action':_0xeecb('0x6d'),'channel':_0x25216b[_0xeecb('0x6e')],'mixmonitorid':_0xedd8ca[_0xeecb('0x68')]})[_0xeecb('0x1f')](function(_0x282022){});}})[_0xeecb('0x1d')](function(_0x3a084b){var _0x3b39cd=_['find'](_0x25216b[_0xeecb('0x62')],{'mixmonitorid':_0xedd8ca[_0xeecb('0x68')]});if(_0x3b39cd){_0x3b39cd['status']=_0xeecb('0x6f');}})[_0xeecb('0x1d')](function(){var _0x42ffa3=util[_0xeecb('0x8')](_0xeecb('0x5d'),_0xedd8ca['filename']||_0xedd8ca['uniqueid'],_0xedd8ca[_0xeecb('0x8')]||_0xeecb('0x5f'));var _0x378da1=_[_0xeecb('0x5b')](_0x25216b[_0xeecb('0x62')],{'filename':'/var/spool/asterisk/monitor/'+_0x42ffa3[_0xeecb('0x64')]()});if(_0x378da1){_0x378da1[_0xeecb('0x69')]='stop';}})[_0xeecb('0x1d')](function(){_0x132639({'code':0xc8,'message':[_0xedd8ca[_0xeecb('0x5c')],_0xeecb('0x70')][_0xeecb('0x20')]('\x20')});})['catch'](function(_0x50d39e){_0xa51ec4(_0x405f62[_0xeecb('0x13')](0x1f5,[_0xedd8ca['uniqueid'],_0x50d39e['message'][_0xeecb('0x64')]()]['join']('\x20')));});}else{return _0xa51ec4(_0x405f62[_0xeecb('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x3cbb53){return new Promise(function(_0x39a6d8,_0x290578){var _0x4805d7=_[_0xeecb('0x58')](_0xe0c46f[_0xeecb('0x71')]);_0x39a6d8({'count':_0x4805d7['length'],'rows':_0x4805d7});});},'VoiceQueuesChannel':function(_0x5ca753){var _0x25cd9e=this;return new Promise(function(_0x323e7e,_0x128180){var _0x31d5c3=schema(properties[_0xeecb('0x72')])[_0xeecb('0x2')](_0x5ca753);if(_0x31d5c3['length']>0x0){return _0x128180(_0x25cd9e['error'](0x1f4,_[_0xeecb('0x6c')](_0x31d5c3,'message')[_0xeecb('0x20')](',\x20')));}var _0x2114e9=_[_0xeecb('0x5b')](_0xe0c46f[_0xeecb('0x71')],{'uniqueid':_0x5ca753[_0xeecb('0x5c')]});if(_0x2114e9){_0x323e7e(_0x2114e9);}else{return _0x128180(_0x25cd9e[_0xeecb('0x13')](0x1f5,_0xeecb('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x20bc04){var _0x24d191=this;return new Promise(function(_0x2b1b0a,_0x17bb86){if(ami[_0xeecb('0x12')]()==![]){return _0x17bb86(_0x24d191[_0xeecb('0x13')](0x1f4,[config[_0xeecb('0x14')]['ip'],config['asterisk'][_0xeecb('0x15')],'ami\x20disconnected']['join']('\x20')));}var _0x1e4cb3=schema(properties[_0xeecb('0x73')])[_0xeecb('0x2')](_0x20bc04);if(_0x1e4cb3['length']>0x0){return _0x17bb86(_0x24d191[_0xeecb('0x13')](0x1f4,_[_0xeecb('0x6c')](_0x1e4cb3,_0xeecb('0x1e'))[_0xeecb('0x20')](',\x20')));}var _0x4af4e3=_['find'](_0xe0c46f[_0xeecb('0x71')],{'uniqueid':_0x20bc04['uniqueid']});if(_0x4af4e3&&_0x4af4e3[_0xeecb('0x61')]){return ami[_0xeecb('0x1c')]({'action':_0xeecb('0x74'),'channel':_0x4af4e3[_0xeecb('0x61')]})['then'](function(_0xe75be1){_0x2b1b0a({'code':0xc8,'message':[_0x20bc04[_0xeecb('0x5c')],_0xe75be1[_0xeecb('0x1e')][_0xeecb('0x64')]()][_0xeecb('0x20')]('\x20')});})[_0xeecb('0x1f')](function(_0x3d59c3){_0x17bb86(_0x24d191['error'](0x1f5,[_0x20bc04[_0xeecb('0x5c')],_0x3d59c3[_0xeecb('0x1e')][_0xeecb('0x64')]()][_0xeecb('0x20')]('\x20')));});}else{return _0x17bb86(_0x24d191[_0xeecb('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x24cbed){var _0x26ce8b=this;return new Promise(function(_0x2d47de,_0x552d05){if(ami[_0xeecb('0x12')]()==![]){return _0x552d05(_0x26ce8b[_0xeecb('0x13')](0x1f4,[config[_0xeecb('0x14')]['ip'],config['asterisk'][_0xeecb('0x15')],'ami\x20disconnected']['join']('\x20')));}var _0x534d4c=schema(properties[_0xeecb('0x75')])[_0xeecb('0x2')](_0x24cbed);if(_0x534d4c[_0xeecb('0x57')]>0x0){return _0x552d05(_0x26ce8b[_0xeecb('0x13')](0x1f4,_[_0xeecb('0x6c')](_0x534d4c,_0xeecb('0x1e'))['join'](',\x20')));}var _0x2d612b=_[_0xeecb('0x5b')](_0xe0c46f[_0xeecb('0x71')],{'uniqueid':_0x24cbed['uniqueid']});if(_0x2d612b&&_0x2d612b['channel']){return ami[_0xeecb('0x1c')]({'action':_0xeecb('0x76'),'channel':_0x2d612b[_0xeecb('0x61')],'exten':_0x24cbed[_0xeecb('0x77')],'context':_0x24cbed[_0xeecb('0x78')]||_0x2d612b['context'],'priority':0x1})[_0xeecb('0x1d')](function(_0x339e4f){_0x2d47de({'code':0xc8,'message':[_0x24cbed[_0xeecb('0x5c')],_0x339e4f[_0xeecb('0x1e')]['toLowerCase']()]['join']('\x20')});})[_0xeecb('0x1f')](function(_0x17358d){_0x552d05(_0x26ce8b[_0xeecb('0x13')](0x1f5,[_0x24cbed[_0xeecb('0x5c')],_0x17358d[_0xeecb('0x1e')][_0xeecb('0x64')]()][_0xeecb('0x20')]('\x20')));});}else{return _0x552d05(_0x26ce8b['error'](0x1f5,_0xeecb('0x6b')));}});},'Agents':function(_0x2a7a66){return new Promise(function(_0x20fae8,_0x15588d){var _0x2467d5=_[_0xeecb('0x58')](_0xe0c46f[_0xeecb('0xf')]);_0x20fae8({'count':_0x2467d5['length'],'rows':_0x2467d5});});},'Telephones':function(_0x19a9dd){return new Promise(function(_0x28e147,_0x415e0c){var _0x7f0a3f=_[_0xeecb('0x58')](_0xe0c46f[_0xeecb('0x79')]);_0x28e147({'count':_0x7f0a3f[_0xeecb('0x57')],'rows':_0x7f0a3f});});},'Trunks':function(_0x3e9799){return new Promise(function(_0x69cfea,_0x243e14){var _0x44d60d=_[_0xeecb('0x58')](_0xe0c46f[_0xeecb('0x7a')]);_0x69cfea({'count':_0x44d60d[_0xeecb('0x57')],'rows':_0x44d60d});});},'OutboundChannels':function(_0xfc15fb){return new Promise(function(_0x1464a0,_0x16d123){var _0x44db63=_[_0xeecb('0x58')](_0xe0c46f[_0xeecb('0x7b')]);_0x1464a0({'count':_0x44db63[_0xeecb('0x57')],'rows':_0x44db63});});},'Outbound':function(_0x5a1ea3){return new Promise(function(_0x4d0cc5,_0x504a09){_0x4d0cc5(_0xe0c46f[_0xeecb('0x2f')]);});},'Campaigns':function(_0x9b64c){return new Promise(function(_0x26fe71,_0x263be5){var _0x5cd62d=_['values'](_0xe0c46f[_0xeecb('0x7c')]);_0x26fe71({'count':_0x5cd62d['length'],'rows':_0x5cd62d});});},'VoiceQueuesPreview':function(_0x3e3b02){var _0x2534d8=this;return new Promise(function(_0x3b8fed,_0x1adc96){_0x16b829['run'](_0x3e3b02['id'])[_0xeecb('0x1d')](function(_0x1c6006){_0x3b8fed({'code':0xc8,'message':_0x1c6006[_0xeecb('0x1e')]});})[_0xeecb('0x1f')](function(_0x4227c3){_0x1adc96(_0x2534d8[_0xeecb('0x13')](0x1f4,_0x4227c3[_0xeecb('0x1e')]));});});},'EventManager':function(_0x2bfa85){var _0xf88960=this;return new Promise(function(_0x1abfbd,_0x219d02){if(!_0x2bfa85['event']){return _0x219d02(_0xf88960[_0xeecb('0x13')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xeecb('0x7d')](_0xeecb('0x7e')+_0x2bfa85[_0xeecb('0x7f')],_0x2bfa85[_0xeecb('0x1e')]);_0x1abfbd({'code':0xc8,'message':_0x2bfa85});});},'FaxAccounts':function(_0xd9b4fa){return new Promise(function(_0x2a425a,_0x150a2a){var _0x105950=_[_0xeecb('0x58')](_0xe0c46f[_0xeecb('0x80')]);_0x2a425a({'count':_0x105950[_0xeecb('0x57')],'rows':_0x105950});});},'SendFax':function(_0x780b9b){var _0x2df269=this;return new Promise(function(_0x4d6ee3,_0x3a9f31){_0x35203c[_0xeecb('0x81')](_0x780b9b)[_0xeecb('0x1d')](function(_0x1aa17b){_0x4d6ee3({'code':0xc8,'message':_0x1aa17b['message']});})[_0xeecb('0x1f')](function(_0x2f64c6){_0x3a9f31(_0x2df269[_0xeecb('0x13')](0x1f4,_0x2f64c6[_0xeecb('0x1e')]));});});},'CheckAfterSend':function(_0x223ef9){var _0x2c70c8=this;return new Promise(function(_0xa96df2,_0x3df080){_0x35203c['checkAfterSend'](_0x223ef9)[_0xeecb('0x1d')](function(_0x4e0310){_0xa96df2({'code':0xc8,'message':_0x4e0310[_0xeecb('0x1e')]});})['catch'](function(_0x1ae24b){_0x3df080(_0x2c70c8[_0xeecb('0x13')](0x1f4,_0x1ae24b[_0xeecb('0x1e')]));});});}};var _0x16ad90=jayson['server'](_0x13fd92)[_0xeecb('0x82')]();_0x16ad90['on'](_0xeecb('0x13'),function(_0x20dd93){return _0x177f8b(_0x20dd93);});_0x16ad90[_0xeecb('0x7')](0x232a,_0xeecb('0x83'),function(){console['log'](_0xeecb('0x84'),0x232a);return _0x41be34('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0xc2b4=['stop','filename','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','context','trunks','campaigns','run','event','custom:','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../ami','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','catch','message','command','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','sumBillable','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','Interval','push','length','values','channels','voicechannel','map','find','uniqueid','channel','%s.%s','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel'];(function(_0x3ced38,_0x3d6096){var _0x4c8ac4=function(_0x146787){while(--_0x146787){_0x3ced38['push'](_0x3ced38['shift']());}};_0x4c8ac4(++_0x3d6096);}(_0xc2b4,0x9c));var _0x4c2b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc2b4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c2b('0x0'));var util=require(_0x4c2b('0x1'));var jayson=require(_0x4c2b('0x2'));var schema=require(_0x4c2b('0x3'));var BPromise=require(_0x4c2b('0x4'));var moment=require(_0x4c2b('0x5'));var config=require(_0x4c2b('0x6'));var properties=require('../properties');var ami=require(_0x4c2b('0x7'));exports['listen']=function(_0x468220,_0x2710f0,_0x4c0cfc){return new BPromise(function(_0x166ad7,_0x19c1f5){var _0x3844eb={'QueuePause':function(_0x24cb16){return new Promise(function(_0x10e5d5,_0x458c62){var _0x49701a=util[_0x4c2b('0x8')](_0x4c2b('0x9'),'SIP',_0x24cb16[_0x4c2b('0xa')]);if(_0x468220[_0x4c2b('0xb')]&&_0x468220[_0x4c2b('0xb')][_0x49701a]&&_0x468220[_0x4c2b('0xb')][_0x49701a][_0x4c2b('0xc')]){_0x468220[_0x4c2b('0xb')][_0x49701a][_0x4c2b('0xd')]();}if(_0x468220[_0x4c2b('0xe')][_0x49701a]){_0x468220['agents'][_0x49701a][_0x4c2b('0xf')]({'statePause':_0x24cb16[_0x4c2b('0x10')]?!![]:![]});}_0x10e5d5({'code':0xc8,'message':_0x4c2b('0x11')});});},'Reload':function(_0xfe30fa){var _0x2d4ba1=this;return new Promise(function(_0x1150d0,_0x41f62b){if(ami[_0x4c2b('0x12')]()==![]){return _0x41f62b(_0x2d4ba1[_0x4c2b('0x13')](0x1f4,[config[_0x4c2b('0x14')]['ip'],config[_0x4c2b('0x14')][_0x4c2b('0x15')],_0x4c2b('0x16')][_0x4c2b('0x17')]('\x20')));}_0xfe30fa=_[_0x4c2b('0x18')](_0xfe30fa,_[_0x4c2b('0x19')](properties[_0x4c2b('0x1a')]));_0xfe30fa[_0x4c2b('0x1b')]=_0x4c2b('0x1c');return ami[_0x4c2b('0x1d')](_0xfe30fa)[_0x4c2b('0x1e')](function(_0x130c14){_0x1150d0({'code':0xc8,'message':_0x130c14['message']});})[_0x4c2b('0x1f')](function(_0x406525){_0x41f62b(_0x2d4ba1[_0x4c2b('0x13')](0x1f5,_0x406525[_0x4c2b('0x20')]));});});},'Command':function(_0x132b84){var _0x382cb3=this;return new Promise(function(_0x4397b4,_0x59f68d){if(ami[_0x4c2b('0x12')]()==![]){return _0x59f68d(_0x382cb3[_0x4c2b('0x13')](0x1f4,[config[_0x4c2b('0x14')]['ip'],config[_0x4c2b('0x14')][_0x4c2b('0x15')],_0x4c2b('0x16')]['join']('\x20')));}_0x132b84=_[_0x4c2b('0x18')](_0x132b84,_0x4c2b('0x21'));_0x132b84[_0x4c2b('0x1b')]=_0x4c2b('0x22');return ami[_0x4c2b('0x1d')](_0x132b84)['then'](function(_0x3f50b4){_0x4397b4({'code':0xc8,'message':_0x3f50b4[_0x4c2b('0x23')]});})['catch'](function(_0x418f2f){_0x59f68d(_0x382cb3['error'](0x1f5,_0x418f2f[_0x4c2b('0x20')]));});});},'VoiceQueues':function(_0xa95b13){return new Promise(function(_0x31dae5,_0x1ee487){var _0x467cf9=[];for(var _0x2f39fc in _0x468220['voiceQueues']){if(_0x468220[_0x4c2b('0x24')][_0x4c2b('0x25')](_0x2f39fc)){var _0x5dcc38=_0x468220[_0x4c2b('0x24')][_0x2f39fc];var _0x49567f={'id':_0x5dcc38['id'],'name':_0x5dcc38['name'],'strategy':_0x5dcc38[_0x4c2b('0x26')],'answered':_0x5dcc38[_0x4c2b('0x27')],'available':_0x5dcc38[_0x4c2b('0x28')],'loggedIn':_0x5dcc38[_0x4c2b('0x29')],'pTalking':_0x5dcc38['pTalking'],'sumBillable':_0x5dcc38[_0x4c2b('0x2a')],'sumDuration':_0x5dcc38['sumDuration'],'sumHoldTime':_0x5dcc38['sumHoldTime']||0x0,'talking':_0x5dcc38[_0x4c2b('0x2b')],'total':_0x5dcc38[_0x4c2b('0x2c')],'type':_0x5dcc38[_0x4c2b('0x2d')],'unmanaged':_0x5dcc38[_0x4c2b('0x2e')],'abandoned':_0x5dcc38[_0x4c2b('0x2f')],'waiting':_0x5dcc38[_0x4c2b('0x30')],'loggedInDb':_0x5dcc38[_0x4c2b('0x31')]};if(_0x5dcc38['type']===_0x4c2b('0x32')){_0x49567f[_0x4c2b('0x33')]=_0x5dcc38[_0x4c2b('0x33')];_0x49567f[_0x4c2b('0x34')]=_0x5dcc38[_0x4c2b('0x34')];_0x49567f[_0x4c2b('0x35')]=_0x5dcc38[_0x4c2b('0x35')];_0x49567f['dialOriginateCallerIdNumber']=_0x5dcc38[_0x4c2b('0x36')];_0x49567f[_0x4c2b('0x37')]=_0x5dcc38[_0x4c2b('0x37')];_0x49567f[_0x4c2b('0x38')]=_0x5dcc38[_0x4c2b('0x38')];_0x49567f['outboundAnswerAgiCallsDay']=_0x5dcc38[_0x4c2b('0x39')];_0x49567f[_0x4c2b('0x3a')]=_0x5dcc38[_0x4c2b('0x3a')];_0x49567f[_0x4c2b('0x3b')]=_0x5dcc38[_0x4c2b('0x3b')];_0x49567f[_0x4c2b('0x3c')]=_0x5dcc38[_0x4c2b('0x3c')];_0x49567f['outboundCongestionCallsDay']=_0x5dcc38['outboundCongestionCallsDay'];_0x49567f[_0x4c2b('0x3d')]=_0x5dcc38[_0x4c2b('0x3d')];_0x49567f[_0x4c2b('0x3e')]=_0x5dcc38[_0x4c2b('0x3e')];_0x49567f['outboundDropCallsDayTimeout']=_0x5dcc38['outboundDropCallsDayTimeout'];_0x49567f[_0x4c2b('0x3f')]=_0x5dcc38['outboundNoAnswerCallsDay'];_0x49567f[_0x4c2b('0x40')]=_0x5dcc38[_0x4c2b('0x40')];_0x49567f[_0x4c2b('0x41')]=_0x5dcc38[_0x4c2b('0x41')];_0x49567f[_0x4c2b('0x42')]=_0x5dcc38[_0x4c2b('0x42')];_0x49567f['outboundRejectCallsDay']=_0x5dcc38[_0x4c2b('0x43')];_0x49567f[_0x4c2b('0x44')]=_0x5dcc38[_0x4c2b('0x44')];_0x49567f[_0x4c2b('0x45')]=_0x5dcc38[_0x4c2b('0x45')];_0x49567f[_0x4c2b('0x46')]=_0x5dcc38[_0x4c2b('0x46')];_0x49567f[_0x4c2b('0x47')]=_0x5dcc38[_0x4c2b('0x47')];_0x49567f['predictiveIntervalDroppedCallsCallersExit']=_0x5dcc38['predictiveIntervalDroppedCallsCallersExit'];_0x49567f['predictiveIntervalDroppedCallsTimeout']=_0x5dcc38[_0x4c2b('0x48')];_0x49567f['predictiveIntervalErlangCalls']=_0x5dcc38[_0x4c2b('0x49')];_0x49567f[_0x4c2b('0x4a')]=_0x5dcc38[_0x4c2b('0x4a')];_0x49567f['predictiveIntervalHitRate']=_0x5dcc38['predictiveIntervalHitRate'];_0x49567f[_0x4c2b('0x4b')]=_0x5dcc38['predictiveIntervalMultiplicativeFactor'];_0x49567f['predictiveIntervalPauses']=_0x5dcc38[_0x4c2b('0x4c')];_0x49567f[_0x4c2b('0x4d')]=_0x5dcc38[_0x4c2b('0x4d')];_0x49567f[_0x4c2b('0x4e')]=_0x5dcc38[_0x4c2b('0x4e')];_0x49567f[_0x4c2b('0x20')]=_0x5dcc38['message'];_0x49567f[_0x4c2b('0x4f')]=_0x5dcc38['originated'];_0x49567f['erlangCalls']=_0x5dcc38[_0x4c2b('0x50')];_0x49567f[_0x4c2b('0x51')]=_0x5dcc38['erlangCallToSecond'];_0x49567f[_0x4c2b('0x52')]=_0x5dcc38['erlangAbandonmentRate'];_0x49567f['erlangBusyFactor']=_0x5dcc38['erlangBusyFactor'];_0x49567f[_0x4c2b('0x53')]=_0x5dcc38[_0x4c2b('0x53')];_0x49567f[_0x4c2b('0x54')]=_0x5dcc38[_0x4c2b('0x54')];}if(_0x5dcc38[_0x4c2b('0x55')]){_0x49567f[_0x4c2b('0x55')]={'id':_0x5dcc38['Trunk']['id'],'name':_0x5dcc38[_0x4c2b('0x55')][_0x4c2b('0xa')],'active':_0x5dcc38[_0x4c2b('0x55')]['active'],'callerid':_0x5dcc38[_0x4c2b('0x55')]['callerid']};}if(_0x5dcc38['Interval']){_0x49567f[_0x4c2b('0x56')]={'id':_0x5dcc38[_0x4c2b('0x56')]['id'],'name':_0x5dcc38['Interval'][_0x4c2b('0xa')]};}_0x467cf9[_0x4c2b('0x57')](_0x49567f);}}_0x31dae5({'count':_0x467cf9[_0x4c2b('0x58')],'rows':_0x467cf9});});},'VoiceChannels':function(_0x3077cd){return new Promise(function(_0x339d70,_0x4ae6d4){var _0x1d3b59=_[_0x4c2b('0x59')](_0x468220[_0x4c2b('0x5a')]);_0x339d70({'count':_0x1d3b59[_0x4c2b('0x58')],'rows':_0x1d3b59});});},'VoiceChannelMixMonitor':function(_0x150b9a){var _0x133cf4=this;return new Promise(function(_0x1e433a,_0x54cd10){if(ami['isConnected']()==![]){return _0x54cd10(_0x133cf4[_0x4c2b('0x13')](0x1f4,[config[_0x4c2b('0x14')]['ip'],config['asterisk'][_0x4c2b('0x15')],_0x4c2b('0x16')][_0x4c2b('0x17')]('\x20')));}var _0x461582=schema(properties[_0x4c2b('0x5b')])[_0x4c2b('0x3')](_0x150b9a);if(_0x461582[_0x4c2b('0x58')]>0x0){return _0x54cd10(_0x133cf4[_0x4c2b('0x13')](0x1f4,_[_0x4c2b('0x5c')](_0x461582,'message')[_0x4c2b('0x17')](',\x20')));}var _0x551d19=_[_0x4c2b('0x5d')](_0x468220[_0x4c2b('0x5a')],{'uniqueid':_0x150b9a[_0x4c2b('0x5e')]});if(_0x551d19&&_0x551d19[_0x4c2b('0x5f')]){var _0x4c66ed=util[_0x4c2b('0x8')](_0x4c2b('0x60'),_0x150b9a['filename']||_0x150b9a[_0x4c2b('0x5e')],_0x150b9a[_0x4c2b('0x8')]||_0x4c2b('0x61'));return ami[_0x4c2b('0x1d')]({'action':_0x4c2b('0x62'),'channel':_0x551d19[_0x4c2b('0x5f')],'file':_0x4c66ed,'options':_0x4c2b('0x63')})['then'](function(_0x56e670){var _0x5c194d=_['find'](_0x551d19[_0x4c2b('0x64')],{'filename':_0x4c2b('0x65')+_0x4c66ed[_0x4c2b('0x66')]()});if(_['isNil'](_0x5c194d)){_0x551d19[_0x4c2b('0x64')]['push']({'filename':_0x4c2b('0x65')+_0x4c66ed[_0x4c2b('0x66')](),'createdAt':moment()[_0x4c2b('0x8')](_0x4c2b('0x67')),'mixmonitorid':_0x56e670[_0x4c2b('0x68')],'status':_0x4c2b('0x69')});}else{_0x5c194d[_0x4c2b('0x68')]=_0x56e670[_0x4c2b('0x68')];_0x5c194d[_0x4c2b('0x6a')]='rec';}_0x1e433a({'code':0xc8,'message':[_0x150b9a['uniqueid'],_0x4c2b('0x6b'),_0x56e670['mixmonitorid']][_0x4c2b('0x17')]('\x20'),'mixmonitorid':_0x56e670[_0x4c2b('0x68')]});})[_0x4c2b('0x1f')](function(_0x575c1d){_0x54cd10(_0x133cf4['error'](0x1f5,[_0x150b9a[_0x4c2b('0x5e')],_0x575c1d[_0x4c2b('0x20')]['toLowerCase']()][_0x4c2b('0x17')]('\x20')));});}else{return _0x54cd10(_0x133cf4['error'](0x1f5,_0x4c2b('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x576d77){var _0x60671d=this;return new Promise(function(_0x1b3c84,_0x429cec){if(ami[_0x4c2b('0x12')]()==![]){return _0x429cec(_0x60671d[_0x4c2b('0x13')](0x1f4,[config[_0x4c2b('0x14')]['ip'],config[_0x4c2b('0x14')][_0x4c2b('0x15')],'ami\x20disconnected'][_0x4c2b('0x17')]('\x20')));}var _0x3d7bc7=schema(properties[_0x4c2b('0x5b')])[_0x4c2b('0x3')](_0x576d77);if(_0x3d7bc7[_0x4c2b('0x58')]>0x0){return _0x429cec(_0x60671d[_0x4c2b('0x13')](0x1f4,_[_0x4c2b('0x5c')](_0x3d7bc7,_0x4c2b('0x20'))['join'](',\x20')));}var _0x4d1316=_[_0x4c2b('0x5d')](_0x468220[_0x4c2b('0x5a')],{'uniqueid':_0x576d77[_0x4c2b('0x5e')]});if(_0x4d1316){return BPromise[_0x4c2b('0x6d')]()[_0x4c2b('0x1e')](function(){if(_0x4d1316[_0x4c2b('0x5f')]){return ami['Action']({'action':_0x4c2b('0x6e'),'channel':_0x4d1316['channel'],'mixmonitorid':_0x576d77[_0x4c2b('0x68')]})[_0x4c2b('0x1f')](function(_0x5181db){});}})[_0x4c2b('0x1e')](function(){if(_0x4d1316['destinationchannel']){return ami[_0x4c2b('0x1d')]({'action':_0x4c2b('0x6e'),'channel':_0x4d1316[_0x4c2b('0x6f')],'mixmonitorid':_0x576d77[_0x4c2b('0x68')]})[_0x4c2b('0x1f')](function(_0x54b8b5){});}})[_0x4c2b('0x1e')](function(_0x54e901){var _0x17816c=_[_0x4c2b('0x5d')](_0x4d1316[_0x4c2b('0x64')],{'mixmonitorid':_0x576d77['mixmonitorid']});if(_0x17816c){_0x17816c['status']=_0x4c2b('0x70');}})[_0x4c2b('0x1e')](function(){var _0x1e6709=util[_0x4c2b('0x8')](_0x4c2b('0x60'),_0x576d77[_0x4c2b('0x71')]||_0x576d77[_0x4c2b('0x5e')],_0x576d77[_0x4c2b('0x8')]||'wav');var _0x1d9eb5=_[_0x4c2b('0x5d')](_0x4d1316[_0x4c2b('0x64')],{'filename':'/var/spool/asterisk/monitor/'+_0x1e6709[_0x4c2b('0x66')]()});if(_0x1d9eb5){_0x1d9eb5['status']='stop';}})['then'](function(){_0x1b3c84({'code':0xc8,'message':[_0x576d77[_0x4c2b('0x5e')],_0x4c2b('0x72')][_0x4c2b('0x17')]('\x20')});})['catch'](function(_0x313447){_0x429cec(_0x60671d[_0x4c2b('0x13')](0x1f5,[_0x576d77[_0x4c2b('0x5e')],_0x313447['message'][_0x4c2b('0x66')]()][_0x4c2b('0x17')]('\x20')));});}else{return _0x429cec(_0x60671d[_0x4c2b('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x9933f5){return new Promise(function(_0x2d3ae0,_0x494810){var _0x37b9a5=_[_0x4c2b('0x59')](_0x468220[_0x4c2b('0x73')]);_0x2d3ae0({'count':_0x37b9a5[_0x4c2b('0x58')],'rows':_0x37b9a5});});},'VoiceQueuesChannel':function(_0x2f3612){var _0xf07ff=this;return new Promise(function(_0x437f1f,_0x1d79c4){var _0x170da1=schema(properties['voicequeuechannel'])[_0x4c2b('0x3')](_0x2f3612);if(_0x170da1['length']>0x0){return _0x1d79c4(_0xf07ff['error'](0x1f4,_['map'](_0x170da1,_0x4c2b('0x20'))[_0x4c2b('0x17')](',\x20')));}var _0x4c5722=_[_0x4c2b('0x5d')](_0x468220[_0x4c2b('0x73')],{'uniqueid':_0x2f3612['uniqueid']});if(_0x4c5722){_0x437f1f(_0x4c5722);}else{return _0x1d79c4(_0xf07ff[_0x4c2b('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0xebb21a){var _0x190b4f=this;return new Promise(function(_0x3f6b9a,_0x24566c){if(ami[_0x4c2b('0x12')]()==![]){return _0x24566c(_0x190b4f[_0x4c2b('0x13')](0x1f4,[config[_0x4c2b('0x14')]['ip'],config[_0x4c2b('0x14')][_0x4c2b('0x15')],'ami\x20disconnected']['join']('\x20')));}var _0x69c73c=schema(properties[_0x4c2b('0x74')])[_0x4c2b('0x3')](_0xebb21a);if(_0x69c73c[_0x4c2b('0x58')]>0x0){return _0x24566c(_0x190b4f['error'](0x1f4,_[_0x4c2b('0x5c')](_0x69c73c,_0x4c2b('0x20'))[_0x4c2b('0x17')](',\x20')));}var _0x5f0c8f=_[_0x4c2b('0x5d')](_0x468220[_0x4c2b('0x73')],{'uniqueid':_0xebb21a[_0x4c2b('0x5e')]});if(_0x5f0c8f&&_0x5f0c8f[_0x4c2b('0x5f')]){return ami[_0x4c2b('0x1d')]({'action':'Hangup','channel':_0x5f0c8f['channel']})['then'](function(_0x385af3){_0x3f6b9a({'code':0xc8,'message':[_0xebb21a[_0x4c2b('0x5e')],_0x385af3[_0x4c2b('0x20')][_0x4c2b('0x66')]()][_0x4c2b('0x17')]('\x20')});})['catch'](function(_0x52935c){_0x24566c(_0x190b4f['error'](0x1f5,[_0xebb21a[_0x4c2b('0x5e')],_0x52935c[_0x4c2b('0x20')][_0x4c2b('0x66')]()]['join']('\x20')));});}else{return _0x24566c(_0x190b4f[_0x4c2b('0x13')](0x1f5,_0x4c2b('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x3799e2){var _0x23f165=this;return new Promise(function(_0x334cf1,_0x3d544d){if(ami['isConnected']()==![]){return _0x3d544d(_0x23f165[_0x4c2b('0x13')](0x1f4,[config[_0x4c2b('0x14')]['ip'],config[_0x4c2b('0x14')][_0x4c2b('0x15')],_0x4c2b('0x16')][_0x4c2b('0x17')]('\x20')));}var _0x57f9cc=schema(properties[_0x4c2b('0x75')])['validate'](_0x3799e2);if(_0x57f9cc['length']>0x0){return _0x3d544d(_0x23f165[_0x4c2b('0x13')](0x1f4,_['map'](_0x57f9cc,_0x4c2b('0x20'))['join'](',\x20')));}var _0x43facd=_['find'](_0x468220['queueChannels'],{'uniqueid':_0x3799e2[_0x4c2b('0x5e')]});if(_0x43facd&&_0x43facd[_0x4c2b('0x5f')]){return ami[_0x4c2b('0x1d')]({'action':_0x4c2b('0x76'),'channel':_0x43facd[_0x4c2b('0x5f')],'exten':_0x3799e2['exten'],'context':_0x3799e2[_0x4c2b('0x77')]||_0x43facd[_0x4c2b('0x77')],'priority':0x1})[_0x4c2b('0x1e')](function(_0x8305d2){_0x334cf1({'code':0xc8,'message':[_0x3799e2['uniqueid'],_0x8305d2[_0x4c2b('0x20')]['toLowerCase']()][_0x4c2b('0x17')]('\x20')});})['catch'](function(_0x3c61d9){_0x3d544d(_0x23f165[_0x4c2b('0x13')](0x1f5,[_0x3799e2['uniqueid'],_0x3c61d9[_0x4c2b('0x20')]['toLowerCase']()][_0x4c2b('0x17')]('\x20')));});}else{return _0x3d544d(_0x23f165[_0x4c2b('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x5b1f5c){return new Promise(function(_0x6b4df3,_0x216324){var _0x392bf1=_['values'](_0x468220[_0x4c2b('0xe')]);_0x6b4df3({'count':_0x392bf1[_0x4c2b('0x58')],'rows':_0x392bf1});});},'Telephones':function(_0x1be0fe){return new Promise(function(_0x22260e,_0x4e44b4){var _0x2991f5=_['values'](_0x468220['telephones']);_0x22260e({'count':_0x2991f5[_0x4c2b('0x58')],'rows':_0x2991f5});});},'Trunks':function(_0x9494e){return new Promise(function(_0x426853,_0x736155){var _0x167c2a=_[_0x4c2b('0x59')](_0x468220[_0x4c2b('0x78')]);_0x426853({'count':_0x167c2a[_0x4c2b('0x58')],'rows':_0x167c2a});});},'OutboundChannels':function(_0x361b34){return new Promise(function(_0x29395f,_0x523ddf){var _0x370ee9=_[_0x4c2b('0x59')](_0x468220['outboundChannels']);_0x29395f({'count':_0x370ee9['length'],'rows':_0x370ee9});});},'Outbound':function(_0x475b0){return new Promise(function(_0x2571d2,_0x3bea45){_0x2571d2(_0x468220[_0x4c2b('0x32')]);});},'Campaigns':function(_0x2b7420){return new Promise(function(_0x4cd910,_0xef0dc8){var _0xa12a2f=_[_0x4c2b('0x59')](_0x468220[_0x4c2b('0x79')]);_0x4cd910({'count':_0xa12a2f['length'],'rows':_0xa12a2f});});},'VoiceQueuesPreview':function(_0x13e1e5){var _0x166621=this;return new Promise(function(_0x19b043,_0x5a0ce4){_0x2710f0[_0x4c2b('0x7a')](_0x13e1e5['id'])[_0x4c2b('0x1e')](function(_0xa162da){_0x19b043({'code':0xc8,'message':_0xa162da[_0x4c2b('0x20')]});})['catch'](function(_0x77ae0a){_0x5a0ce4(_0x166621[_0x4c2b('0x13')](0x1f4,_0x77ae0a[_0x4c2b('0x20')]));});});},'EventManager':function(_0x3a54ba){var _0x32f9c3=this;return new Promise(function(_0x10ba52,_0x32dca4){if(!_0x3a54ba[_0x4c2b('0x7b')]){return _0x32dca4(_0x32f9c3[_0x4c2b('0x13')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x4c2b('0x7c')+_0x3a54ba['event'],_0x3a54ba[_0x4c2b('0x20')]);_0x10ba52({'code':0xc8,'message':_0x3a54ba});});},'FaxAccounts':function(_0x1d0e89){return new Promise(function(_0x43a52a,_0x20768a){var _0x4687ab=_[_0x4c2b('0x59')](_0x468220[_0x4c2b('0x7d')]);_0x43a52a({'count':_0x4687ab['length'],'rows':_0x4687ab});});},'SendFax':function(_0x37a591){var _0x354ea7=this;return new Promise(function(_0x21a31c,_0x44b962){_0x4c0cfc[_0x4c2b('0x7e')](_0x37a591)[_0x4c2b('0x1e')](function(_0x3e46a4){_0x21a31c({'code':0xc8,'message':_0x3e46a4[_0x4c2b('0x20')]});})[_0x4c2b('0x1f')](function(_0x42c0c8){_0x44b962(_0x354ea7[_0x4c2b('0x13')](0x1f4,_0x42c0c8[_0x4c2b('0x20')]));});});},'CheckAfterSend':function(_0x445f78){var _0x2f9afc=this;return new Promise(function(_0x235e01,_0x4622e1){_0x4c0cfc[_0x4c2b('0x7f')](_0x445f78)[_0x4c2b('0x1e')](function(_0xf23ebf){_0x235e01({'code':0xc8,'message':_0xf23ebf['message']});})[_0x4c2b('0x1f')](function(_0x3bd7d1){_0x4622e1(_0x2f9afc['error'](0x1f4,_0x3bd7d1[_0x4c2b('0x20')]));});});}};var _0x55ed20=jayson[_0x4c2b('0x80')](_0x3844eb)[_0x4c2b('0x81')]();_0x55ed20['on'](_0x4c2b('0x13'),function(_0x439ef5){return _0x19c1f5(_0x439ef5);});_0x55ed20[_0x4c2b('0x82')](0x232a,_0x4c2b('0x83'),function(){console[_0x4c2b('0x84')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x166ad7(_0x4c2b('0x85')+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 7b27336..1a97106 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 _0x1867=['uniqueid','resolve','showContact','omit','then','xmd-contactid2','name','trigger:%s','data1','format','user:%s','action','toLowerCase','merge','catch','error','Error\x20creating\x20contact','bluebird','util','ioredis','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','stringify','emit','exec','autoCreate','data2','calleridnum','isNil','routeId','firstName','calleridname','','destcalleridname','destcalleridnum','phone'];(function(_0x32706c,_0x5698b0){var _0x1e7cdb=function(_0x4ad492){while(--_0x4ad492){_0x32706c['push'](_0x32706c['shift']());}};_0x1e7cdb(++_0x5698b0);}(_0x1867,0xb5));var _0x7186=function(_0x4ca2f7,_0x5c083f){_0x4ca2f7=_0x4ca2f7-0x0;var _0x56ab6a=_0x1867[_0x4ca2f7];return _0x56ab6a;};'use strict';var BPromise=require(_0x7186('0x0'));var util=require(_0x7186('0x1'));var _=require('lodash');var Redis=require(_0x7186('0x2'));var config=require('../../../../config/environment');var logger=require(_0x7186('0x3'))(_0x7186('0x4'));var cmContactRpc=require(_0x7186('0x5'));config[_0x7186('0x6')]=_[_0x7186('0x7')](config[_0x7186('0x6')],{'host':_0x7186('0x8'),'port':0x18eb});var io=require(_0x7186('0x9'))(new Redis(config[_0x7186('0x6')]));function emit(_0x4bea9f,_0x45938b,_0x18c4b9){logger['info'](_0x4bea9f,_0x45938b,JSON[_0x7186('0xa')](_0x18c4b9));io['to'](_0x4bea9f)[_0x7186('0xb')](_0x45938b,_0x18c4b9);}exports[_0x7186('0xc')]=function(_0xb49c4b,_0x551c34,_0x41739d){_0x41739d[_0x7186('0xd')]=0x0;if(_0x551c34[_0x7186('0xe')]&&parseInt(_0x551c34[_0x7186('0xe')],0xa)){var _0x7d44ae={'ListId':parseInt(_0x551c34['data1'],0xa),'phone':_0x41739d[_0x7186('0xf')]};if(_[_0x7186('0x10')](_0x41739d[_0x7186('0x11')])){_0x7d44ae[_0x7186('0x12')]=_0x41739d['calleridname']&&_0x41739d[_0x7186('0x13')]!==_0x7186('0x14')?_0x41739d[_0x7186('0x13')]:_0x41739d[_0x7186('0xf')]||_0x41739d['uniqueid'];}else{_0x7d44ae['firstName']=_0x41739d['destcalleridname']&&_0x41739d[_0x7186('0x15')]!==_0x7186('0x14')?_0x41739d[_0x7186('0x15')]:_0x41739d[_0x7186('0x16')]||_0x41739d['uniqueid'];_0x7d44ae[_0x7186('0x17')]=_0x41739d[_0x7186('0x15')]&&_0x41739d[_0x7186('0x15')]!==_0x7186('0x14')?_0x41739d[_0x7186('0x15')]:_0x41739d[_0x7186('0x16')]||_0x41739d[_0x7186('0x18')];}BPromise[_0x7186('0x19')]()['then'](cmContactRpc[_0x7186('0x1a')]({'where':_[_0x7186('0x1b')](_0x7d44ae,['firstName'])}))[_0x7186('0x1c')](function(_0x40b42f){if(_0x40b42f){_0x41739d[_0x7186('0x1d')]=_0x40b42f['id'];emit(util['format']('user:%s',_0xb49c4b[_0x7186('0x1e')]),util['format'](_0x7186('0x1f'),_0x551c34['action']['toLowerCase']()),_['merge'](_0x41739d,{'ListId':parseInt(_0x551c34[_0x7186('0x20')],0xa)}));return;}else{return BPromise[_0x7186('0x19')]()['then'](cmContactRpc['createContact'](_0x7d44ae));}})['then'](function(_0x562403){if(_0x562403){_0x41739d[_0x7186('0x1d')]=_0x562403['id'];emit(util[_0x7186('0x21')](_0x7186('0x22'),_0xb49c4b['name']),util[_0x7186('0x21')](_0x7186('0x1f'),_0x551c34[_0x7186('0x23')][_0x7186('0x24')]()),_[_0x7186('0x25')](_0x41739d,{'ListId':parseInt(_0x551c34['data1'],0xa)}));}})[_0x7186('0x26')](function(_0x207b9e){logger[_0x7186('0x27')](_0x7186('0x28'),JSON[_0x7186('0xa')](_0x207b9e));});}else{if(_0xb49c4b){emit(util[_0x7186('0x21')](_0x7186('0x22'),_0xb49c4b[_0x7186('0x1e')]),util['format'](_0x7186('0x1f'),_0x551c34[_0x7186('0x23')]['toLowerCase']()),_[_0x7186('0x25')]({'ListId':parseInt(_0x551c34['data1'],0xa)},_0x41739d));}}}; \ No newline at end of file +var _0xf846=['omit','xmd-contactid2','format','user:%s','name','toLowerCase','createContact','action','merge','catch','error','Error\x20creating\x20contact','trigger:%s','bluebird','util','lodash','ioredis','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','stringify','emit','autoCreate','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','uniqueid','destcalleridname','','destcalleridnum','resolve','then'];(function(_0x58b3cd,_0x40ee27){var _0x18ee70=function(_0x2a38ab){while(--_0x2a38ab){_0x58b3cd['push'](_0x58b3cd['shift']());}};_0x18ee70(++_0x40ee27);}(_0xf846,0x85));var _0x6f84=function(_0x936cbd,_0x65ffc1){_0x936cbd=_0x936cbd-0x0;var _0x30c886=_0xf846[_0x936cbd];return _0x30c886;};'use strict';var BPromise=require(_0x6f84('0x0'));var util=require(_0x6f84('0x1'));var _=require(_0x6f84('0x2'));var Redis=require(_0x6f84('0x3'));var config=require('../../../../config/environment');var logger=require(_0x6f84('0x4'))(_0x6f84('0x5'));var cmContactRpc=require(_0x6f84('0x6'));config[_0x6f84('0x7')]=_['defaults'](config[_0x6f84('0x7')],{'host':_0x6f84('0x8'),'port':0x18eb});var io=require(_0x6f84('0x9'))(new Redis(config[_0x6f84('0x7')]));function emit(_0x162a59,_0x45dd2b,_0x4dcf04){logger[_0x6f84('0xa')](_0x162a59,_0x45dd2b,JSON[_0x6f84('0xb')](_0x4dcf04));io['to'](_0x162a59)[_0x6f84('0xc')](_0x45dd2b,_0x4dcf04);}exports['exec']=function(_0x156032,_0x4144b7,_0x4d4362){_0x4d4362[_0x6f84('0xd')]=0x0;if(_0x4144b7[_0x6f84('0xe')]&&parseInt(_0x4144b7[_0x6f84('0xe')],0xa)){var _0x43ea55={'ListId':parseInt(_0x4144b7[_0x6f84('0xf')],0xa),'phone':_0x4d4362[_0x6f84('0x10')]};if(_[_0x6f84('0x11')](_0x4d4362[_0x6f84('0x12')])){_0x43ea55[_0x6f84('0x13')]=_0x4d4362[_0x6f84('0x14')]&&_0x4d4362[_0x6f84('0x14')]!==''?_0x4d4362[_0x6f84('0x14')]:_0x4d4362['calleridnum']||_0x4d4362[_0x6f84('0x15')];}else{_0x43ea55[_0x6f84('0x13')]=_0x4d4362['destcalleridname']&&_0x4d4362[_0x6f84('0x16')]!==''?_0x4d4362[_0x6f84('0x16')]:_0x4d4362['destcalleridnum']||_0x4d4362[_0x6f84('0x15')];_0x43ea55['phone']=_0x4d4362[_0x6f84('0x16')]&&_0x4d4362['destcalleridname']!==_0x6f84('0x17')?_0x4d4362[_0x6f84('0x16')]:_0x4d4362[_0x6f84('0x18')]||_0x4d4362[_0x6f84('0x15')];}BPromise[_0x6f84('0x19')]()[_0x6f84('0x1a')](cmContactRpc['showContact']({'where':_[_0x6f84('0x1b')](_0x43ea55,['firstName'])}))[_0x6f84('0x1a')](function(_0x44a530){if(_0x44a530){_0x4d4362[_0x6f84('0x1c')]=_0x44a530['id'];emit(util[_0x6f84('0x1d')](_0x6f84('0x1e'),_0x156032[_0x6f84('0x1f')]),util[_0x6f84('0x1d')]('trigger:%s',_0x4144b7['action'][_0x6f84('0x20')]()),_['merge'](_0x4d4362,{'ListId':parseInt(_0x4144b7[_0x6f84('0xf')],0xa)}));return;}else{return BPromise[_0x6f84('0x19')]()[_0x6f84('0x1a')](cmContactRpc[_0x6f84('0x21')](_0x43ea55));}})[_0x6f84('0x1a')](function(_0x1d51c8){if(_0x1d51c8){_0x4d4362[_0x6f84('0x1c')]=_0x1d51c8['id'];emit(util[_0x6f84('0x1d')](_0x6f84('0x1e'),_0x156032['name']),util[_0x6f84('0x1d')]('trigger:%s',_0x4144b7[_0x6f84('0x22')][_0x6f84('0x20')]()),_[_0x6f84('0x23')](_0x4d4362,{'ListId':parseInt(_0x4144b7[_0x6f84('0xf')],0xa)}));}})[_0x6f84('0x24')](function(_0x30014e){logger[_0x6f84('0x25')](_0x6f84('0x26'),JSON[_0x6f84('0xb')](_0x30014e));});}else{if(_0x156032){emit(util[_0x6f84('0x1d')](_0x6f84('0x1e'),_0x156032[_0x6f84('0x1f')]),util[_0x6f84('0x1d')](_0x6f84('0x27'),_0x4144b7[_0x6f84('0x22')][_0x6f84('0x20')]()),_[_0x6f84('0x23')]({'ListId':parseInt(_0x4144b7['data1'],0xa)},_0x4d4362));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 9bd92a6..46a659e 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 _0xc393=['name','format','trigger:%s:%s','action','data1','jscripty','user:%s','trigger:%s','integration','routeId','urlforward','exec','parse','query','search','every','AllConditions','checkConditions','channel','AnyConditions','account','chat','ChatWebsiteId','operator','upperFirst','AccountId','value','interaction','event','queue','lastevent','util','url','mustache','ioredis','./urlforward','./integration','./cmContact','../rpc/cmContact','../../../config/environment','../../../config/logger','trigger','../ami','defaults','localhost','socket.io-emitter','redis','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentcomplete','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','checkTriggers','interface','checkTrigger','merge','Actions','length','toLowerCase','contactmanager','motionbar','browser','data2','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','data5','800','windowHeight','data6','winApplication','winArguments'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc393,0xfd));var _0x3c39=function(_0x2d2416,_0x32d65d){_0x2d2416=_0x2d2416-0x0;var _0x46aba2=_0xc393[_0x2d2416];return _0x46aba2;};'use strict';var util=require(_0x3c39('0x0'));var _=require('lodash');var url=require(_0x3c39('0x1'));var Mustache=require(_0x3c39('0x2'));var Redis=require(_0x3c39('0x3'));var urlforward=require(_0x3c39('0x4'));var integration=require(_0x3c39('0x5'));var cmContact=require(_0x3c39('0x6'));var script=require('./script');var cmContactRpc=require(_0x3c39('0x7'));var config=require(_0x3c39('0x8'));var logger=require(_0x3c39('0x9'))(_0x3c39('0xa'));var ami=require(_0x3c39('0xb'));config['redis']=_[_0x3c39('0xc')](config['redis'],{'host':_0x3c39('0xd'),'port':0x18eb});var io=require(_0x3c39('0xe'))(new Redis(config[_0x3c39('0xf')]));var operators={'equals':function(_0x1b040a,_0x5d796a){return _0x1b040a==_0x5d796a;},'not_equals':function(_0x3ef37d,_0x58ec80){return _0x3ef37d!=_0x58ec80;}};var barAndWebActions=[_0x3c39('0x10'),_0x3c39('0x1'),_0x3c39('0x11')];function Trigger(_0x467801){this[_0x3c39('0x12')]=_0x467801['triggers'];this[_0x3c39('0x13')]=_0x467801[_0x3c39('0x13')];this[_0x3c39('0x14')]=_0x467801[_0x3c39('0x14')];this['templates']=_0x467801[_0x3c39('0x15')];this['voiceExtensions']=_0x467801[_0x3c39('0x16')];this[_0x3c39('0x17')]=_0x467801[_0x3c39('0x17')];this[_0x3c39('0x18')]=_0x467801[_0x3c39('0x18')];this['salesforceAccounts']=_0x467801[_0x3c39('0x19')];this[_0x3c39('0x1a')]=_0x467801[_0x3c39('0x1a')];this[_0x3c39('0x1b')]=_0x467801[_0x3c39('0x1b')];this[_0x3c39('0x1c')]=_0x467801[_0x3c39('0x1c')];this[_0x3c39('0x1d')]=_0x467801[_0x3c39('0x1d')];this['servicenowAccounts']=_0x467801[_0x3c39('0x1e')];this[_0x3c39('0x1f')]=_0x467801['dynamics365Accounts'];this['freshsalesAccounts']=_0x467801[_0x3c39('0x20')];this[_0x3c39('0x21')]={'zendesk':this[_0x3c39('0x17')],'salesforce':this[_0x3c39('0x19')],'freshdesk':this[_0x3c39('0x18')],'sugarcrm':this[_0x3c39('0x1a')],'zoho':this[_0x3c39('0x1b')],'desk':this[_0x3c39('0x1c')],'vtiger':this[_0x3c39('0x1d')],'dynamics365':this[_0x3c39('0x1f')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x3c39('0x1e')]};ami['on'](_0x3c39('0x22'),this[_0x3c39('0x23')][_0x3c39('0x24')](this));ami['on'](_0x3c39('0x25'),this[_0x3c39('0x23')][_0x3c39('0x24')](this));ami['on']('custom:agentringnoanswer',this[_0x3c39('0x23')]['bind'](this));ami['on'](_0x3c39('0x26'),this[_0x3c39('0x23')]['bind'](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent']['bind'](this));ami['on'](_0x3c39('0x27'),this[_0x3c39('0x28')][_0x3c39('0x24')](this));ami['on'](_0x3c39('0x29'),this[_0x3c39('0x28')][_0x3c39('0x24')](this));ami['on'](_0x3c39('0x2a'),this[_0x3c39('0x28')][_0x3c39('0x24')](this));ami['on'](_0x3c39('0x2b'),this[_0x3c39('0x23')][_0x3c39('0x24')](this));ami['on'](_0x3c39('0x2c'),this[_0x3c39('0x23')][_0x3c39('0x24')](this));ami['on'](_0x3c39('0x2d'),this[_0x3c39('0x23')][_0x3c39('0x24')](this));ami['on'](_0x3c39('0x2e'),this[_0x3c39('0x23')][_0x3c39('0x24')](this));ami['on'](_0x3c39('0x2f'),this[_0x3c39('0x23')][_0x3c39('0x24')](this));ami['on'](_0x3c39('0x30'),this[_0x3c39('0x23')][_0x3c39('0x24')](this));}Trigger[_0x3c39('0x31')][_0x3c39('0x32')]=function(_0x535ac0,_0x3a98b0,_0x292d4a){logger[_0x3c39('0x33')](_0x535ac0,_0x3a98b0,JSON[_0x3c39('0x34')](_0x292d4a));io['to'](_0x535ac0)[_0x3c39('0x32')](_0x3a98b0,_0x292d4a);};Trigger['prototype'][_0x3c39('0x23')]=function(_0x117f21){var _0x487569=_[_0x3c39('0x35')](_0x117f21);this[_0x3c39('0x36')](_0x487569);};Trigger[_0x3c39('0x31')][_0x3c39('0x28')]=function(_0x235c02){if(this[_0x3c39('0x13')][_0x235c02[_0x3c39('0x37')]]){this['syncCustomEvent'](_0x235c02);}};Trigger[_0x3c39('0x31')][_0x3c39('0x36')]=function(_0x452e15){var _0x4a46e0;for(var _0x31e162 in this[_0x3c39('0x12')]){if(this['triggers']['hasOwnProperty'](_0x31e162)){if(this[_0x3c39('0x12')][_0x31e162]['status']){_0x4a46e0=this[_0x3c39('0x38')](this[_0x3c39('0x12')][_0x31e162],_0x452e15);if(_0x4a46e0){_[_0x3c39('0x39')](_0x452e15,_0x452e15['variables']);for(var _0x119e9a=0x0,_0x2e732e,_0x47332d,_0x56cd00;_0x119e9a0x0){_0x41b23d=_[_0x458a('0x2d')](_0x5f3ac0,_0x5df150);}return _0x41b23d;}function getCustomFields(_0x29f9b5,_0x223f73){var _0x4a49e4=[];var _0xa6fdf={'custom_fields':{}};if(_0x29f9b5[_0x458a('0x2e')]>0x0){_[_0x458a('0x2f')](_0x29f9b5,function(_0x562c36){if(_0x562c36['type']===_0x458a('0x30')&&_0x562c36['nameField']&&!_0x562c36[_0x458a('0x31')]){_0xa6fdf[_0x562c36['nameField'][_0x458a('0x32')]()]=_0x562c36[_0x458a('0x33')]['toString']();}else if(_0x562c36[_0x458a('0x34')]===_0x458a('0x30')&&_0x562c36[_0x458a('0x35')]&&_0x562c36['customField']){_0xa6fdf[_0x458a('0x36')][_0x562c36[_0x458a('0x35')]]=_0x562c36[_0x458a('0x33')][_0x458a('0x25')]();}else if(_0x562c36[_0x458a('0x34')]==='variable'&&_0x562c36[_0x458a('0x37')]&&_0x562c36[_0x458a('0x35')]&&_0x562c36[_0x458a('0x31')]){_0x223f73[_0x562c36[_0x458a('0x37')]]&&(_0xa6fdf[_0x458a('0x36')][_0x562c36[_0x458a('0x35')]]=_0x223f73[_0x562c36['variableName']][_0x458a('0x25')]());}else if(_0x562c36[_0x458a('0x34')]===_0x458a('0x38')&&_0x562c36[_0x458a('0x39')]&&_0x562c36[_0x458a('0x39')][_0x458a('0x3a')]&&_0x562c36[_0x458a('0x35')]&&_0x562c36[_0x458a('0x31')]){_0x223f73[_0x562c36[_0x458a('0x39')]['name'][_0x458a('0x32')]()]&&(_0xa6fdf[_0x458a('0x36')][_0x562c36[_0x458a('0x35')]]=_0x223f73[_0x562c36[_0x458a('0x39')][_0x458a('0x3a')][_0x458a('0x32')]()][_0x458a('0x25')]());}});}if(_0xa6fdf[_0x458a('0x3b')]){_0xa6fdf[_0x458a('0x3b')]=Number(_0xa6fdf[_0x458a('0x3b')]);}return _0xa6fdf;}function getTicket(_0x1a4011,_0x1aa28e,_0x40c6cb,_0x73e060,_0x5d79cb){logger['info'](_0x458a('0x3c'));var _0x397a41=_[_0x458a('0x3d')]({'subject':intUtil[_0x458a('0x3e')](_0x73e060[_0x458a('0x3f')],_0x5d79cb,'\x20'),'type':_0x458a('0x40'),'status':_0x458a('0x41'),'labels':[_0x458a('0x42'),_0x458a('0x43'),_0x458a('0x44')][_0x458a('0x45')](getTags(_0x73e060['Tags'],_0x458a('0x3a'))),'description':intUtil[_0x458a('0x3e')](_0x73e060['Descriptions'],_0x5d79cb,'\x0a'),'_links':{'assigned_user':{'href':util[_0x458a('0x11')](_0x458a('0x46'),_0x1aa28e['id']),'class':_0x458a('0x47')}},'message':{'direction':'in','body':intUtil['getString'](_0x73e060[_0x458a('0x48')],_0x5d79cb,'\x0a')}},getCustomFields(_0x73e060[_0x458a('0x49')],_0x5d79cb));return request({'uri':util[_0x458a('0x11')](_0x458a('0x4a'),_0x1a4011[_0x458a('0x12')],_0x40c6cb['id']),'method':_0x458a('0x2b'),'body':_0x397a41});}exports[_0x458a('0x4b')]=function(_0x667255,_0x5883ab,_0x296385,_0x145e3c,_0x2b9030,_0x5180ae){var _0x3d3d0e,_0x369d4b;_0x5180ae['remoteUri']=intUtil[_0x458a('0x4c')](_0x5180ae[_0x458a('0x12')]);_0x5180ae[_0x458a('0x4d')]=intUtil[_0x458a('0x4c')](_0x5180ae[_0x458a('0x4d')]);if(_0x2b9030&&_0x2b9030['monitor_format']){logger['info'](_0x458a('0x4e'),_0x458a('0x4f'));_0x5883ab[_0x458a('0x50')]=util[_0x458a('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5180ae[_0x458a('0x4d')],_0x5883ab[_0x458a('0x51')],md5(_0x5883ab['uniqueid']));}else{_0x5883ab[_0x458a('0x50')]='';}headers['Authorization']=getAuth(_0x5180ae);return getUser(_0x5180ae,_0x145e3c[_0x458a('0x52')])[_0x458a('0x13')](function(_0x30d9d9){_0x3d3d0e=_0x30d9d9;logger['info'](_0x458a('0x53'),_0x3d3d0e['id']);return getEndUser(_0x5180ae,_0x5883ab[_0x458a('0x54')],_0x5883ab[_0x458a('0x55')]);})['then'](function(_0x5edbc9){_0x369d4b=_0x5edbc9;logger[_0x458a('0xf')](_0x458a('0x56'),_0x369d4b['id']);return getTicket(_0x5180ae,_0x3d3d0e,_0x369d4b,_0x296385,_0x5883ab);})[_0x458a('0x13')](function(_0x4dea55){if(_0x4dea55){logger['info'](_0x458a('0x57'));logger[_0x458a('0xf')](_0x458a('0x58'),_0x4dea55['id']);switch(_0x5180ae[_0x458a('0x34')]){case _0x458a('0x59'):logger[_0x458a('0xf')](_0x458a('0x4e'),_0x458a('0x5a'));emit(util[_0x458a('0x11')](_0x458a('0x5b'),_0x145e3c[_0x458a('0x3a')]),_0x458a('0x5c'),{'recordId':_0x4dea55['id']});break;case _0x458a('0x5d'):logger[_0x458a('0xf')](_0x458a('0x4e'),_0x458a('0x5e'));emit(util['format'](_0x458a('0x5b'),_0x145e3c[_0x458a('0x3a')]),_0x458a('0x5f'),{'uri':util[_0x458a('0x11')](_0x458a('0x60'),_0x4dea55['id'])});break;default:logger['error']('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})[_0x458a('0x61')](function(_0x5b47e0){console[_0x458a('0x62')](_0x5b47e0);logger[_0x458a('0x62')](_0x458a('0x4e'),JSON[_0x458a('0x63')](_0x5b47e0));});};exports[_0x458a('0x64')]=function(_0x5f0151,_0x48f68e,_0x3d7616,_0x2d8b77,_0x2587a1,_0x8ff0dd,_0x2d67b1){var _0x5a6650,_0x21c01a;_0x8ff0dd['remoteUri']=intUtil[_0x458a('0x4c')](_0x8ff0dd['remoteUri']);_0x8ff0dd[_0x458a('0x4d')]=intUtil['stripTrailingSlash'](_0x8ff0dd['serverUrl']);if(_0x2d67b1&&_0x2d67b1['recordingFormat']&&_0x2d67b1[_0x458a('0x65')]!==_0x458a('0x66')){logger['info'](_0x458a('0x67'),_0x458a('0x4f'));_0x48f68e[_0x458a('0x50')]=util['format'](_0x458a('0x68'),_0x8ff0dd[_0x458a('0x4d')],_0x48f68e[_0x458a('0x51')],md5(_0x48f68e[_0x458a('0x51')]));}headers[_0x458a('0x69')]=getAuth(_0x8ff0dd);return getUser(_0x8ff0dd,_0x2d8b77[_0x458a('0x52')])['then'](function(_0x15200c){_0x5a6650=_0x15200c;logger[_0x458a('0xf')](_0x458a('0x53'),_0x5a6650['id']);return getEndUser(_0x8ff0dd,_0x48f68e[_0x458a('0x6a')],_0x48f68e[_0x458a('0x6b')]);})[_0x458a('0x13')](function(_0x1181c2){_0x21c01a=_0x1181c2;logger[_0x458a('0xf')]('The\x20Enduser\x20ID\x20is:',_0x21c01a['id']);return getTicket(_0x8ff0dd,_0x5a6650,_0x21c01a,_0x3d7616,_0x48f68e);})[_0x458a('0x13')](function(_0x4abe93){if(_0x4abe93){logger[_0x458a('0xf')](_0x458a('0x57'));logger[_0x458a('0xf')](_0x458a('0x58'),_0x4abe93['id']);switch(_0x8ff0dd['type']){case'integrationTab':logger[_0x458a('0xf')](_0x458a('0x4e'),_0x458a('0x5a'));emit(util[_0x458a('0x11')](_0x458a('0x5b'),_0x2d8b77[_0x458a('0x3a')]),'trigger:desk:display',{'recordId':_0x4abe93['id']});break;case _0x458a('0x5d'):logger[_0x458a('0xf')]('[QUEUE]',_0x458a('0x5e'));emit(util['format'](_0x458a('0x5b'),_0x2d8b77[_0x458a('0x3a')]),_0x458a('0x5f'),{'uri':util[_0x458a('0x11')](_0x458a('0x6c'),_0x8ff0dd[_0x458a('0x12')],_0x4abe93['id'])});break;default:logger[_0x458a('0x62')](_0x458a('0x67'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x458a('0x61')](function(_0x3ed05d){logger['error'](_0x458a('0x67'),JSON[_0x458a('0x63')](_0x3ed05d));});};exports['abandoned']=function(_0xaf7b50,_0x14b483,_0x47cbcf,_0x17b611,_0x180df0,_0x582ff7){var _0x16f82f,_0x1f95d4;_0x582ff7[_0x458a('0x12')]=intUtil[_0x458a('0x4c')](_0x582ff7[_0x458a('0x12')]);_0x582ff7[_0x458a('0x4d')]=intUtil[_0x458a('0x4c')](_0x582ff7[_0x458a('0x4d')]);if(_0x180df0&&_0x180df0['monitor_format']){logger[_0x458a('0xf')](_0x458a('0x6d'),_0x458a('0x4f'));_0x14b483[_0x458a('0x50')]=util[_0x458a('0x11')](_0x458a('0x68'),_0x582ff7[_0x458a('0x4d')],_0x14b483[_0x458a('0x51')],md5(_0x14b483[_0x458a('0x51')]));}else{_0x14b483[_0x458a('0x50')]='';}headers['Authorization']=getAuth(_0x582ff7);return getUser(_0x582ff7)[_0x458a('0x13')](function(_0x527c09){_0x16f82f=_0x527c09;logger[_0x458a('0xf')](_0x458a('0x53'),_0x16f82f['id']);return getEndUser(_0x582ff7,_0x14b483[_0x458a('0x54')],_0x14b483[_0x458a('0x55')]);})[_0x458a('0x13')](function(_0x3d1d37){_0x1f95d4=_0x3d1d37;logger[_0x458a('0xf')](_0x458a('0x56'),_0x1f95d4['id']);return getTicket(_0x582ff7,_0x16f82f,_0x1f95d4,_0x47cbcf,_0x14b483);})[_0x458a('0x13')](function(_0x413d7c){if(_0x413d7c){logger[_0x458a('0xf')](_0x458a('0x57'));logger[_0x458a('0xf')](_0x458a('0x58'),_0x413d7c['id']);}})[_0x458a('0x61')](function(_0x2c131b){logger['error'](_0x458a('0x6d'),JSON['stringify'](_0x2c131b));});}; \ No newline at end of file +var _0x58a4=['[HTTP]','GET','authType','%s:%s','password','username','token','Basic\x20%s','toString','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','forEach','string','customField','toLowerCase','content','type','idField','custom_fields','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY','Motion','CTI','concat','/api/v2/users/%d','user','Descriptions','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','destcalleridnum','%s/agent/tickets/%s','[ABANDONED]','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug'];(function(_0x214bad,_0x5cdf94){var _0x54ab23=function(_0x1770b1){while(--_0x1770b1){_0x214bad['push'](_0x214bad['shift']());}};_0x54ab23(++_0x5cdf94);}(_0x58a4,0xbf));var _0x458a=function(_0x1c37a5,_0x59ee51){_0x1c37a5=_0x1c37a5-0x0;var _0x389d03=_0x58a4[_0x1c37a5];return _0x389d03;};'use strict';var _=require(_0x458a('0x0'));var rp=require(_0x458a('0x1'));var md5=require(_0x458a('0x2'));var util=require(_0x458a('0x3'));var Redis=require(_0x458a('0x4'));var intUtil=require(_0x458a('0x5'));var config=require(_0x458a('0x6'));var logger=require(_0x458a('0x7'))(_0x458a('0x8'));config[_0x458a('0x9')]=_[_0x458a('0xa')](config[_0x458a('0x9')],{'host':_0x458a('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x30b095,_0x11fcaa,_0x2029bc){io['to'](_0x30b095)[_0x458a('0xc')](_0x11fcaa,_0x2029bc);}var headers={'Content-Type':_0x458a('0xd'),'Accept':'application/json'};function getUser(_0x4bedce,_0x185c5f){if(intUtil[_0x458a('0xe')](_0x185c5f)===!![]){logger[_0x458a('0xf')](_0x458a('0x10'),_0x185c5f);return request({'uri':util[_0x458a('0x11')]('%s/users',_0x4bedce[_0x458a('0x12')])})[_0x458a('0x13')](function(_0x5a3874){if(_0x5a3874[_0x458a('0x14')]){return _[_0x458a('0x15')](_0x5a3874[_0x458a('0x16')][_0x458a('0x17')],{'email':_0x185c5f});}})[_0x458a('0x13')](function(_0x5bd09e){if(_0x5bd09e){logger['info'](_0x458a('0x18'));return _0x5bd09e;}else{logger['info'](_0x458a('0x19'));return request({'uri':util[_0x458a('0x11')](_0x458a('0x1a'),_0x4bedce[_0x458a('0x12')])});}});}else{logger[_0x458a('0xf')](_0x458a('0x1b'));return request({'uri':util['format']('%s/users/me',_0x4bedce['remoteUri'])});}}function request(_0x2faf6a){logger[_0x458a('0x1c')](_0x458a('0x1d'),JSON['stringify'](_0x2faf6a));return rp(_[_0x458a('0xa')](_0x2faf6a,{'method':_0x458a('0x1e'),'headers':headers,'json':!![]}));}function getAuth(_0x18504d){var _0x392986;if(_0x18504d[_0x458a('0x1f')]==='basic'){_0x392986=util['format'](_0x458a('0x20'),_0x18504d['username'],_0x18504d[_0x458a('0x21')]);}else if(_0x18504d[_0x458a('0x1f')]==='token'){_0x392986=util[_0x458a('0x11')]('%s/token:%s',_0x18504d[_0x458a('0x22')],_0x18504d[_0x458a('0x23')]);}return util['format'](_0x458a('0x24'),new Buffer(_0x392986)[_0x458a('0x25')]('base64'));}function getEndUser(_0xa6b8ff,_0x5ad95a,_0x370959){logger['info'](_0x458a('0x26'),_0x370959);return request({'uri':util['format'](_0x458a('0x27'),_0xa6b8ff[_0x458a('0x12')]),'qs':{'phone':_0x370959}})[_0x458a('0x13')](function(_0xcda8cc){if(_0xcda8cc[_0x458a('0x14')]){logger[_0x458a('0xf')](_0x458a('0x28'));return _0xcda8cc[_0x458a('0x16')][_0x458a('0x17')][0x0];}else{logger[_0x458a('0xf')](_0x458a('0x29'));return request({'uri':util[_0x458a('0x11')](_0x458a('0x2a'),_0xa6b8ff['remoteUri']),'method':_0x458a('0x2b'),'body':{'first_name':_0x5ad95a,'title':_0x5ad95a,'phone_numbers':[{'type':_0x458a('0x2c'),'value':_0x370959}]}});}});}function getTags(_0x5f3ac0,_0x5df150){var _0x41b23d=[];if(_0x5f3ac0&&_0x5f3ac0['length']>0x0){_0x41b23d=_[_0x458a('0x2d')](_0x5f3ac0,_0x5df150);}return _0x41b23d;}function getCustomFields(_0x29f9b5,_0x223f73){var _0x4a49e4=[];var _0xa6fdf={'custom_fields':{}};if(_0x29f9b5[_0x458a('0x2e')]>0x0){_[_0x458a('0x2f')](_0x29f9b5,function(_0x562c36){if(_0x562c36['type']===_0x458a('0x30')&&_0x562c36['nameField']&&!_0x562c36[_0x458a('0x31')]){_0xa6fdf[_0x562c36['nameField'][_0x458a('0x32')]()]=_0x562c36[_0x458a('0x33')]['toString']();}else if(_0x562c36[_0x458a('0x34')]===_0x458a('0x30')&&_0x562c36[_0x458a('0x35')]&&_0x562c36['customField']){_0xa6fdf[_0x458a('0x36')][_0x562c36[_0x458a('0x35')]]=_0x562c36[_0x458a('0x33')][_0x458a('0x25')]();}else if(_0x562c36[_0x458a('0x34')]==='variable'&&_0x562c36[_0x458a('0x37')]&&_0x562c36[_0x458a('0x35')]&&_0x562c36[_0x458a('0x31')]){_0x223f73[_0x562c36[_0x458a('0x37')]]&&(_0xa6fdf[_0x458a('0x36')][_0x562c36[_0x458a('0x35')]]=_0x223f73[_0x562c36['variableName']][_0x458a('0x25')]());}else if(_0x562c36[_0x458a('0x34')]===_0x458a('0x38')&&_0x562c36[_0x458a('0x39')]&&_0x562c36[_0x458a('0x39')][_0x458a('0x3a')]&&_0x562c36[_0x458a('0x35')]&&_0x562c36[_0x458a('0x31')]){_0x223f73[_0x562c36[_0x458a('0x39')]['name'][_0x458a('0x32')]()]&&(_0xa6fdf[_0x458a('0x36')][_0x562c36[_0x458a('0x35')]]=_0x223f73[_0x562c36[_0x458a('0x39')][_0x458a('0x3a')][_0x458a('0x32')]()][_0x458a('0x25')]());}});}if(_0xa6fdf[_0x458a('0x3b')]){_0xa6fdf[_0x458a('0x3b')]=Number(_0xa6fdf[_0x458a('0x3b')]);}return _0xa6fdf;}function getTicket(_0x1a4011,_0x1aa28e,_0x40c6cb,_0x73e060,_0x5d79cb){logger['info'](_0x458a('0x3c'));var _0x397a41=_[_0x458a('0x3d')]({'subject':intUtil[_0x458a('0x3e')](_0x73e060[_0x458a('0x3f')],_0x5d79cb,'\x20'),'type':_0x458a('0x40'),'status':_0x458a('0x41'),'labels':[_0x458a('0x42'),_0x458a('0x43'),_0x458a('0x44')][_0x458a('0x45')](getTags(_0x73e060['Tags'],_0x458a('0x3a'))),'description':intUtil[_0x458a('0x3e')](_0x73e060['Descriptions'],_0x5d79cb,'\x0a'),'_links':{'assigned_user':{'href':util[_0x458a('0x11')](_0x458a('0x46'),_0x1aa28e['id']),'class':_0x458a('0x47')}},'message':{'direction':'in','body':intUtil['getString'](_0x73e060[_0x458a('0x48')],_0x5d79cb,'\x0a')}},getCustomFields(_0x73e060[_0x458a('0x49')],_0x5d79cb));return request({'uri':util[_0x458a('0x11')](_0x458a('0x4a'),_0x1a4011[_0x458a('0x12')],_0x40c6cb['id']),'method':_0x458a('0x2b'),'body':_0x397a41});}exports[_0x458a('0x4b')]=function(_0x667255,_0x5883ab,_0x296385,_0x145e3c,_0x2b9030,_0x5180ae){var _0x3d3d0e,_0x369d4b;_0x5180ae['remoteUri']=intUtil[_0x458a('0x4c')](_0x5180ae[_0x458a('0x12')]);_0x5180ae[_0x458a('0x4d')]=intUtil[_0x458a('0x4c')](_0x5180ae[_0x458a('0x4d')]);if(_0x2b9030&&_0x2b9030['monitor_format']){logger['info'](_0x458a('0x4e'),_0x458a('0x4f'));_0x5883ab[_0x458a('0x50')]=util[_0x458a('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5180ae[_0x458a('0x4d')],_0x5883ab[_0x458a('0x51')],md5(_0x5883ab['uniqueid']));}else{_0x5883ab[_0x458a('0x50')]='';}headers['Authorization']=getAuth(_0x5180ae);return getUser(_0x5180ae,_0x145e3c[_0x458a('0x52')])[_0x458a('0x13')](function(_0x30d9d9){_0x3d3d0e=_0x30d9d9;logger['info'](_0x458a('0x53'),_0x3d3d0e['id']);return getEndUser(_0x5180ae,_0x5883ab[_0x458a('0x54')],_0x5883ab[_0x458a('0x55')]);})['then'](function(_0x5edbc9){_0x369d4b=_0x5edbc9;logger[_0x458a('0xf')](_0x458a('0x56'),_0x369d4b['id']);return getTicket(_0x5180ae,_0x3d3d0e,_0x369d4b,_0x296385,_0x5883ab);})[_0x458a('0x13')](function(_0x4dea55){if(_0x4dea55){logger['info'](_0x458a('0x57'));logger[_0x458a('0xf')](_0x458a('0x58'),_0x4dea55['id']);switch(_0x5180ae[_0x458a('0x34')]){case _0x458a('0x59'):logger[_0x458a('0xf')](_0x458a('0x4e'),_0x458a('0x5a'));emit(util[_0x458a('0x11')](_0x458a('0x5b'),_0x145e3c[_0x458a('0x3a')]),_0x458a('0x5c'),{'recordId':_0x4dea55['id']});break;case _0x458a('0x5d'):logger[_0x458a('0xf')](_0x458a('0x4e'),_0x458a('0x5e'));emit(util['format'](_0x458a('0x5b'),_0x145e3c[_0x458a('0x3a')]),_0x458a('0x5f'),{'uri':util[_0x458a('0x11')](_0x458a('0x60'),_0x4dea55['id'])});break;default:logger['error']('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})[_0x458a('0x61')](function(_0x5b47e0){console[_0x458a('0x62')](_0x5b47e0);logger[_0x458a('0x62')](_0x458a('0x4e'),JSON[_0x458a('0x63')](_0x5b47e0));});};exports[_0x458a('0x64')]=function(_0x5f0151,_0x48f68e,_0x3d7616,_0x2d8b77,_0x2587a1,_0x8ff0dd,_0x2d67b1){var _0x5a6650,_0x21c01a;_0x8ff0dd['remoteUri']=intUtil[_0x458a('0x4c')](_0x8ff0dd['remoteUri']);_0x8ff0dd[_0x458a('0x4d')]=intUtil['stripTrailingSlash'](_0x8ff0dd['serverUrl']);if(_0x2d67b1&&_0x2d67b1['recordingFormat']&&_0x2d67b1[_0x458a('0x65')]!==_0x458a('0x66')){logger['info'](_0x458a('0x67'),_0x458a('0x4f'));_0x48f68e[_0x458a('0x50')]=util['format'](_0x458a('0x68'),_0x8ff0dd[_0x458a('0x4d')],_0x48f68e[_0x458a('0x51')],md5(_0x48f68e[_0x458a('0x51')]));}headers[_0x458a('0x69')]=getAuth(_0x8ff0dd);return getUser(_0x8ff0dd,_0x2d8b77[_0x458a('0x52')])['then'](function(_0x15200c){_0x5a6650=_0x15200c;logger[_0x458a('0xf')](_0x458a('0x53'),_0x5a6650['id']);return getEndUser(_0x8ff0dd,_0x48f68e[_0x458a('0x6a')],_0x48f68e[_0x458a('0x6b')]);})[_0x458a('0x13')](function(_0x1181c2){_0x21c01a=_0x1181c2;logger[_0x458a('0xf')]('The\x20Enduser\x20ID\x20is:',_0x21c01a['id']);return getTicket(_0x8ff0dd,_0x5a6650,_0x21c01a,_0x3d7616,_0x48f68e);})[_0x458a('0x13')](function(_0x4abe93){if(_0x4abe93){logger[_0x458a('0xf')](_0x458a('0x57'));logger[_0x458a('0xf')](_0x458a('0x58'),_0x4abe93['id']);switch(_0x8ff0dd['type']){case'integrationTab':logger[_0x458a('0xf')](_0x458a('0x4e'),_0x458a('0x5a'));emit(util[_0x458a('0x11')](_0x458a('0x5b'),_0x2d8b77[_0x458a('0x3a')]),'trigger:desk:display',{'recordId':_0x4abe93['id']});break;case _0x458a('0x5d'):logger[_0x458a('0xf')]('[QUEUE]',_0x458a('0x5e'));emit(util['format'](_0x458a('0x5b'),_0x2d8b77[_0x458a('0x3a')]),_0x458a('0x5f'),{'uri':util[_0x458a('0x11')](_0x458a('0x6c'),_0x8ff0dd[_0x458a('0x12')],_0x4abe93['id'])});break;default:logger[_0x458a('0x62')](_0x458a('0x67'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x458a('0x61')](function(_0x3ed05d){logger['error'](_0x458a('0x67'),JSON[_0x458a('0x63')](_0x3ed05d));});};exports['abandoned']=function(_0xaf7b50,_0x14b483,_0x47cbcf,_0x17b611,_0x180df0,_0x582ff7){var _0x16f82f,_0x1f95d4;_0x582ff7[_0x458a('0x12')]=intUtil[_0x458a('0x4c')](_0x582ff7[_0x458a('0x12')]);_0x582ff7[_0x458a('0x4d')]=intUtil[_0x458a('0x4c')](_0x582ff7[_0x458a('0x4d')]);if(_0x180df0&&_0x180df0['monitor_format']){logger[_0x458a('0xf')](_0x458a('0x6d'),_0x458a('0x4f'));_0x14b483[_0x458a('0x50')]=util[_0x458a('0x11')](_0x458a('0x68'),_0x582ff7[_0x458a('0x4d')],_0x14b483[_0x458a('0x51')],md5(_0x14b483[_0x458a('0x51')]));}else{_0x14b483[_0x458a('0x50')]='';}headers['Authorization']=getAuth(_0x582ff7);return getUser(_0x582ff7)[_0x458a('0x13')](function(_0x527c09){_0x16f82f=_0x527c09;logger[_0x458a('0xf')](_0x458a('0x53'),_0x16f82f['id']);return getEndUser(_0x582ff7,_0x14b483[_0x458a('0x54')],_0x14b483[_0x458a('0x55')]);})[_0x458a('0x13')](function(_0x3d1d37){_0x1f95d4=_0x3d1d37;logger[_0x458a('0xf')](_0x458a('0x56'),_0x1f95d4['id']);return getTicket(_0x582ff7,_0x16f82f,_0x1f95d4,_0x47cbcf,_0x14b483);})[_0x458a('0x13')](function(_0x413d7c){if(_0x413d7c){logger[_0x458a('0xf')](_0x458a('0x57'));logger[_0x458a('0xf')](_0x458a('0x58'),_0x413d7c['id']);}})[_0x458a('0x61')](function(_0x2c131b){logger['error'](_0x458a('0x6d'),JSON['stringify'](_0x2c131b));});}; \ 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 cbfe6c5..0811af1 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 _0xa5e6=['contacts','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','message','value','telephone1','enduserId',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','string','nameField','idField','indexOf','ticketType','incident','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name','inspect','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','catch','error','toUpperCase','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','userEmail','email','length','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5e6,0x148));var _0x6a5e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa5e6[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var BPromise=require(_0x6a5e('0x0'));var rp=require(_0x6a5e('0x1'));var util=require(_0x6a5e('0x2'));var intUtil=require(_0x6a5e('0x3'));var md5=require(_0x6a5e('0x4'));var Redis=require(_0x6a5e('0x5'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x6a5e('0x6'));config[_0x6a5e('0x7')]=_[_0x6a5e('0x8')](config[_0x6a5e('0x7')],{'host':_0x6a5e('0x9'),'port':0x18eb});var io=require(_0x6a5e('0xa'))(new Redis(config[_0x6a5e('0x7')]));function getAuthToken(_0x22ff89,_0xf1f320,_0x16897a){var _0x1ca2f3={'method':_0x6a5e('0xb'),'uri':_0xf1f320,'form':{'client_id':_0x22ff89[_0x6a5e('0xc')],'resource':_0x22ff89[_0x6a5e('0xd')],'username':_0x22ff89[_0x6a5e('0xe')],'password':_0x22ff89[_0x6a5e('0xf')],'grant_type':_0x6a5e('0xf'),'client_secret':_0x22ff89[_0x6a5e('0x10')]},'json':!![]};return rp(_0x1ca2f3)['then'](function(_0x1181cd){return _0x1181cd['access_token'];})[_0x6a5e('0x11')](function(_0x34fadd){logger[_0x6a5e('0x12')]('['+[_0x16897a[_0x6a5e('0x13')]()]+']\x20Wrong\x20credentials!');return _0x34fadd['message'];});}function getUser(_0xc92c4f,_0x10c196,_0x14cc51,_0x4acea5,_0xe7f32e,_0x4ea781){return new BPromise(function(_0x53a34c,_0x22e7a7){return getAuthToken(_0x10c196,_0x4acea5,_0x4ea781)[_0x6a5e('0x14')](function(_0x4c3d0f){var _0x25d80c={'method':_0x6a5e('0x15'),'uri':_0xe7f32e+_0x6a5e('0x16'),'headers':{'Authorization':'Bearer\x20'+_0x4c3d0f,'OData-Version':_0x6a5e('0x17')},'json':!![]};return rp(_0x25d80c);})[_0x6a5e('0x14')](function(_0x42f387){var _0x1656ba=_0x42f387['value'];var _0x379e1c=![];var _0xb72504=null;if(!_['isNil'](_0x14cc51)){if(intUtil['validateEmail'](_0x14cc51['email'])){_0xc92c4f[_0x6a5e('0x18')]=_0x14cc51[_0x6a5e('0x19')];for(_0xb72504=0x0;_0xb72504<_0x1656ba[_0x6a5e('0x1a')];_0xb72504++){if(_0x1656ba[_0xb72504]['internalemailaddress']===_0x14cc51['email']&&!_0x1656ba[_0xb72504]['isdisabled']){_0x379e1c=!![];logger[_0x6a5e('0x1b')]('['+[_0x4ea781[_0x6a5e('0x13')]()]+_0x6a5e('0x1c')+_0x1656ba[_0xb72504][_0x6a5e('0x1d')]+'!');_0xc92c4f[_0x6a5e('0x1e')]=_0x1656ba[_0xb72504][_0x6a5e('0x1d')];}}}}if(!_0x379e1c){logger[_0x6a5e('0x1b')]('['+[_0x4ea781[_0x6a5e('0x13')]()]+_0x6a5e('0x1f'));_0xc92c4f['userEmail']=_0x10c196[_0x6a5e('0xe')];for(_0xb72504=0x0;_0xb72504<_0x1656ba['length'];_0xb72504++){if(_0x1656ba[_0xb72504]['internalemailaddress']===_0x10c196['username']){_0xc92c4f[_0x6a5e('0x1e')]=_0x1656ba[_0xb72504][_0x6a5e('0x1d')];}}}_0x53a34c(_0xc92c4f);})[_0x6a5e('0x11')](function(_0x217a7e){_0x22e7a7(_0x217a7e['message']);});});}function createEndUser(_0x52ab36,_0x144a5e,_0x487784,_0x1e63cd,_0x3ae5c9,_0x212bd4){return new BPromise(function(_0x5791c3,_0x2bbb91){return getAuthToken(_0x144a5e,_0x487784,_0x212bd4)[_0x6a5e('0x14')](function(_0x461048){var _0x7f052=_0x212bd4[_0x6a5e('0x20')]()===_0x6a5e('0x21')?_0x3ae5c9[_0x6a5e('0x22')]:_0x3ae5c9[_0x6a5e('0x23')];var _0xf20107={'method':_0x6a5e('0xb'),'uri':_0x1e63cd+_0x6a5e('0x24'),'body':{'telephone1':_0x7f052,'fullname':_0x7f052,'firstname':_0x7f052,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x6a5e('0x25')+_0x52ab36[_0x6a5e('0x1e')]+')'},'headers':{'Authorization':_0x6a5e('0x26')+_0x461048,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xf20107);})['then'](function(_0x5e9dca){var _0x3037d9=_0x5e9dca[_0x6a5e('0x27')][_0x6a5e('0x28')];var _0x4e5a23=_0x3037d9[_0x6a5e('0x29')](_0x3037d9[_0x6a5e('0x2a')]('(')+0x1,_0x3037d9[_0x6a5e('0x2a')](')'));_0x52ab36['enduserId']=_0x4e5a23;_0x5791c3(_0x52ab36);})[_0x6a5e('0x11')](function(_0x5f32be){_0x2bbb91(_0x5f32be[_0x6a5e('0x2b')]);});});}function getEndUser(_0x2fc326,_0x57f14e,_0x1f8f22,_0x842c6a,_0x25e10e,_0x4a0cce){return new BPromise(function(_0x59b5ed,_0x403fb6){return getAuthToken(_0x57f14e,_0x1f8f22,_0x4a0cce)[_0x6a5e('0x14')](function(_0x400a42){var _0x381ae6={'method':'GET','uri':_0x842c6a+'contacts?$select=telephone1','headers':{'Authorization':_0x6a5e('0x26')+_0x400a42,'If-None-Match':null,'OData-Version':_0x6a5e('0x17')},'json':!![]};return rp(_0x381ae6);})[_0x6a5e('0x14')](function(_0x20440c){var _0x16992b=null;if(_0x20440c){var _0x33a55f=_0x20440c[_0x6a5e('0x2c')];var _0x39416=![];for(_0x16992b=0x0;_0x16992b<_0x33a55f[_0x6a5e('0x1a')];_0x16992b++){var _0x1a77d6=_0x4a0cce[_0x6a5e('0x20')]()===_0x6a5e('0x21')?_0x25e10e[_0x6a5e('0x22')]:_0x25e10e[_0x6a5e('0x23')];if(_0x33a55f[_0x16992b][_0x6a5e('0x2d')]===_0x1a77d6){_0x39416=!![];_0x2fc326[_0x6a5e('0x2e')]=_0x33a55f[_0x16992b]['contactid'];}}if(_0x39416){_0x59b5ed(_0x2fc326);}else{return createEndUser(_0x2fc326,_0x57f14e,_0x1f8f22,_0x842c6a,_0x25e10e,_0x4a0cce)[_0x6a5e('0x14')](function(_0x1a2099){logger[_0x6a5e('0x1b')]('['+[_0x4a0cce[_0x6a5e('0x13')]()]+_0x6a5e('0x2f'),_0x1a2099[_0x6a5e('0x2e')]);_0x59b5ed(_0x1a2099);});}}else{return createEndUser(_0x2fc326,_0x57f14e,_0x1f8f22,_0x842c6a,_0x25e10e,_0x4a0cce)[_0x6a5e('0x14')](function(_0x83223e){logger[_0x6a5e('0x1b')]('['+[_0x4a0cce[_0x6a5e('0x13')]()]+_0x6a5e('0x30'),_0x83223e[_0x6a5e('0x2e')]);_0x59b5ed(_0x83223e);});}});});}function getCustomFields(_0x22fd77,_0x1561af,_0x33ab6d){var _0x550ca5={};if(_0x22fd77['length']>0x0){_[_0x6a5e('0x31')](_0x22fd77,function(_0xb68fbf){if(_0xb68fbf[_0x6a5e('0x32')]===_0x6a5e('0x33')&&_0xb68fbf[_0x6a5e('0x34')]&&!_0xb68fbf['customField']){var _0x3fb105=_0xb68fbf[_0x6a5e('0x35')][_0x6a5e('0x20')]();var _0x2671a7=_0x3fb105[_0x6a5e('0x29')](0x0,_0x3fb105[_0x6a5e('0x36')]('_'));var _0x45c55b=_0x3fb105[_0x6a5e('0x29')](_0x3fb105[_0x6a5e('0x36')]('_')+0x1);if(_0x2671a7===_0x33ab6d){_0x550ca5[_0x45c55b]=_0xb68fbf['content'];}}});}return _0x550ca5;}function getTicket(_0x107944,_0x48a8c8,_0x2964a2,_0x5d7a98,_0x1b2f55,_0x5a6c49,_0x163e8d){return new BPromise(function(_0x244220,_0x440628){var _0x18b23a;return getAuthToken(_0x48a8c8,_0x2964a2,_0x163e8d)['then'](function(_0x39c654){if(_0x5a6c49[_0x6a5e('0x37')]===_0x6a5e('0x38')){_0x18b23a={'method':_0x6a5e('0xb'),'uri':_0x5d7a98+'incidents','body':Object[_0x6a5e('0x39')]({},{'title':intUtil[_0x6a5e('0x3a')](_0x5a6c49[_0x6a5e('0x3b')],_0x1b2f55,'\x20'),'description':intUtil[_0x6a5e('0x3a')](_0x5a6c49[_0x6a5e('0x3c')],_0x1b2f55,'\x0a'),'customerid_contact@odata.bind':_0x6a5e('0x3d')+_0x107944[_0x6a5e('0x2e')]+')','ownerid@odata.bind':_0x6a5e('0x25')+_0x107944[_0x6a5e('0x1e')]+')','caseorigincode':'1'},getCustomFields(_0x5a6c49[_0x6a5e('0x3e')],_0x1b2f55,_0x5a6c49[_0x6a5e('0x37')])),'headers':{'Authorization':_0x6a5e('0x26')+_0x39c654,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5a6c49['ticketType']===_0x6a5e('0x3f')){_0x18b23a={'method':_0x6a5e('0xb'),'uri':_0x5d7a98+'phonecalls','body':Object[_0x6a5e('0x39')]({},{'subject':intUtil['getString'](_0x5a6c49['Subjects'],_0x1b2f55,'\x20'),'phonenumber':String(_0x1b2f55[_0x6a5e('0x23')]),'description':intUtil[_0x6a5e('0x3a')](_0x5a6c49[_0x6a5e('0x3c')],_0x1b2f55,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x107944[_0x6a5e('0x2e')]+')','ownerid@odata.bind':_0x6a5e('0x25')+_0x107944['userId']+')','directioncode':_0x107944[_0x6a5e('0x40')]===_0x6a5e('0x41')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x6a5e('0x25')+_0x107944['userId']+')','participationtypemask':_0x107944[_0x6a5e('0x40')]===_0x6a5e('0x41')?0x2:0x1},{'partyid_contact@odata.bind':_0x6a5e('0x3d')+_0x107944[_0x6a5e('0x2e')]+')','participationtypemask':_0x107944[_0x6a5e('0x40')]==='queue'?0x1:0x2}]},getCustomFields(_0x5a6c49[_0x6a5e('0x3e')],_0x1b2f55,_0x5a6c49[_0x6a5e('0x37')])),'headers':{'Authorization':_0x6a5e('0x26')+_0x39c654,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x18b23a);})[_0x6a5e('0x14')](function(_0x1b2a71){var _0x51a3d7=_0x1b2a71[_0x6a5e('0x27')]['odata-entityid'];var _0x1c4a91=_0x51a3d7['substring'](_0x51a3d7[_0x6a5e('0x2a')]('(')+0x1,_0x51a3d7[_0x6a5e('0x2a')](')'));_0x107944[_0x6a5e('0x42')]=_0x1c4a91;_0x244220(_0x107944);})[_0x6a5e('0x11')](function(_0xe2bbbf){_0x440628(_0xe2bbbf[_0x6a5e('0x2b')]);});});}function emit(_0x3f441a,_0x5a5c8f,_0x27c144,_0x599020){var _0x468c34={'uri':util[_0x6a5e('0x43')](_0x6a5e('0x44'),_0x3f441a,_0x27c144,_0x599020)};io['to'](util[_0x6a5e('0x43')](_0x6a5e('0x45'),_0x5a5c8f))[_0x6a5e('0x46')](_0x6a5e('0x47'),_0x468c34);}exports['cs']=function(_0xa8a4b7,_0x5c795f,_0x5f448d,_0x301134,_0x21ea57,_0x441d41,_0x504de8,_0x428235){var _0x3cff6c={};_0x441d41['remoteUri']=intUtil[_0x6a5e('0x48')](_0x441d41[_0x6a5e('0xd')]);_0x441d41[_0x6a5e('0x49')]=intUtil[_0x6a5e('0x48')](_0x441d41['serverUrl']);_0x3cff6c[_0x6a5e('0x40')]=_0x428235===_0x6a5e('0x41')||_0x428235===_0x6a5e('0x4a')?_0x6a5e('0x41'):_0x6a5e('0x21');var _0x23f4f6=util[_0x6a5e('0x43')]('%s/api/data/v9.0/',_0x441d41[_0x6a5e('0xd')]);var _0x4e0f89=util[_0x6a5e('0x43')](_0x6a5e('0x4b'),_0x441d41[_0x6a5e('0x4c')]);var _0x21f90c=util[_0x6a5e('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x441d41[_0x6a5e('0x49')],_0x5c795f[_0x6a5e('0x4d')],md5(_0x5c795f[_0x6a5e('0x4d')]));if(_0x21ea57&&_0x21ea57[_0x6a5e('0x4e')]){logger[_0x6a5e('0x1b')](_0x6a5e('0x4f'),_0x6a5e('0x50'));_0x5c795f['recordingURL']=_0x21f90c;}else if(_0x504de8&&_0x504de8[_0x6a5e('0x51')]&&_0x504de8[_0x6a5e('0x51')]!==_0x6a5e('0x52')){logger[_0x6a5e('0x1b')](_0x6a5e('0x53'),_0x6a5e('0x50'));_0x5c795f[_0x6a5e('0x54')]=_0x21f90c;}else{_0x5c795f[_0x6a5e('0x54')]='';}return getUser(_0x3cff6c,_0x441d41,_0x301134,_0x4e0f89,_0x23f4f6,_0x428235)['then'](function(_0x2e2c3e){logger[_0x6a5e('0x1b')]('['+_0x428235[_0x6a5e('0x13')]()+']\x20The\x20User\x20ID\x20is:',_0x2e2c3e['userId']);logger[_0x6a5e('0x1b')]('['+_0x428235[_0x6a5e('0x13')]()+_0x6a5e('0x55'),_0x2e2c3e[_0x6a5e('0x18')]);return getEndUser(_0x2e2c3e,_0x441d41,_0x4e0f89,_0x23f4f6,_0x5c795f,_0x428235);})['then'](function(_0x84f8c8){logger[_0x6a5e('0x1b')]('['+_0x428235['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x84f8c8[_0x6a5e('0x2e')]);logger[_0x6a5e('0x1b')]('['+_0x428235[_0x6a5e('0x13')]()+_0x6a5e('0x56'),_0x5c795f[_0x6a5e('0x23')]);return getTicket(_0x84f8c8,_0x441d41,_0x4e0f89,_0x23f4f6,_0x5c795f,_0x5f448d,_0x428235);})[_0x6a5e('0x14')](function(_0x2f9b55){logger[_0x6a5e('0x1b')](util['format']('['+_0x428235['toUpperCase']()+_0x6a5e('0x57'),_0x5f448d[_0x6a5e('0x37')],_0x2f9b55['ticketId']));logger['info'](util['format']('['+_0x428235[_0x6a5e('0x13')]()+_0x6a5e('0x58'),_0x428235));if(_0x428235!==_0x6a5e('0x4a')){logger[_0x6a5e('0x1b')]('['+_0x428235[_0x6a5e('0x13')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x441d41[_0x6a5e('0xd')],_0x301134[_0x6a5e('0x59')],_0x5f448d[_0x6a5e('0x37')],_0x2f9b55['ticketId']);}})['catch'](function(_0x58afd4){logger[_0x6a5e('0x12')]('['+_0x428235[_0x6a5e('0x13')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x6a5e('0x5a')](_0x58afd4,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf1e2=['phonecall','callDirection','queue','Fields','ticketId','format','user:%s','trigger:browser:url','serverUrl','stripTrailingSlash','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','recordingFormat','none','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','POST','clientId','remoteUri','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','4.0','value','email','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','internalemailaddress','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1','Bearer\x20','toLowerCase','telephone1',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField','idField','indexOf','content','incident','assign','getString','Subjects','/contacts(','ticketType'];(function(_0x209f9c,_0x4ea385){var _0x13c1ef=function(_0x455599){while(--_0x455599){_0x209f9c['push'](_0x209f9c['shift']());}};_0x13c1ef(++_0x4ea385);}(_0xf1e2,0x13a));var _0x2f1e=function(_0x4f7155,_0x27ab1b){_0x4f7155=_0x4f7155-0x0;var _0x95d703=_0xf1e2[_0x4f7155];return _0x95d703;};'use strict';var _=require('lodash');var BPromise=require(_0x2f1e('0x0'));var rp=require(_0x2f1e('0x1'));var util=require(_0x2f1e('0x2'));var intUtil=require(_0x2f1e('0x3'));var md5=require(_0x2f1e('0x4'));var Redis=require(_0x2f1e('0x5'));var logger=require(_0x2f1e('0x6'))(_0x2f1e('0x7'));var config=require(_0x2f1e('0x8'));config[_0x2f1e('0x9')]=_[_0x2f1e('0xa')](config[_0x2f1e('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x2f1e('0xb'))(new Redis(config[_0x2f1e('0x9')]));function getAuthToken(_0x436e04,_0x4fdae5,_0x17b88a){var _0x57e208={'method':_0x2f1e('0xc'),'uri':_0x4fdae5,'form':{'client_id':_0x436e04[_0x2f1e('0xd')],'resource':_0x436e04[_0x2f1e('0xe')],'username':_0x436e04['username'],'password':_0x436e04[_0x2f1e('0xf')],'grant_type':_0x2f1e('0xf'),'client_secret':_0x436e04[_0x2f1e('0x10')]},'json':!![]};return rp(_0x57e208)['then'](function(_0x1cfd22){return _0x1cfd22[_0x2f1e('0x11')];})[_0x2f1e('0x12')](function(_0x3bcbe2){logger[_0x2f1e('0x13')]('['+[_0x17b88a[_0x2f1e('0x14')]()]+_0x2f1e('0x15'));return _0x3bcbe2[_0x2f1e('0x16')];});}function getUser(_0x660b6,_0x2a7730,_0x24d743,_0xda2d02,_0x2dbffe,_0x109b3a){return new BPromise(function(_0xf240f5,_0x3c1aff){return getAuthToken(_0x2a7730,_0xda2d02,_0x109b3a)[_0x2f1e('0x17')](function(_0x2c2b43){var _0xd32eec={'method':_0x2f1e('0x18'),'uri':_0x2dbffe+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x2c2b43,'OData-Version':_0x2f1e('0x19')},'json':!![]};return rp(_0xd32eec);})[_0x2f1e('0x17')](function(_0x1ac68f){var _0x2cf510=_0x1ac68f[_0x2f1e('0x1a')];var _0xe0b008=![];var _0xdedb0a=null;if(!_['isNil'](_0x24d743)){if(intUtil['validateEmail'](_0x24d743[_0x2f1e('0x1b')])){_0x660b6['userEmail']=_0x24d743[_0x2f1e('0x1b')];for(_0xdedb0a=0x0;_0xdedb0a<_0x2cf510['length'];_0xdedb0a++){if(_0x2cf510[_0xdedb0a]['internalemailaddress']===_0x24d743['email']&&!_0x2cf510[_0xdedb0a][_0x2f1e('0x1c')]){_0xe0b008=!![];logger[_0x2f1e('0x1d')]('['+[_0x109b3a[_0x2f1e('0x14')]()]+_0x2f1e('0x1e')+_0x2cf510[_0xdedb0a][_0x2f1e('0x1f')]+'!');_0x660b6[_0x2f1e('0x20')]=_0x2cf510[_0xdedb0a][_0x2f1e('0x1f')];}}}}if(!_0xe0b008){logger[_0x2f1e('0x1d')]('['+[_0x109b3a[_0x2f1e('0x14')]()]+_0x2f1e('0x21'));_0x660b6[_0x2f1e('0x22')]=_0x2a7730[_0x2f1e('0x23')];for(_0xdedb0a=0x0;_0xdedb0a<_0x2cf510['length'];_0xdedb0a++){if(_0x2cf510[_0xdedb0a][_0x2f1e('0x24')]===_0x2a7730['username']){_0x660b6[_0x2f1e('0x20')]=_0x2cf510[_0xdedb0a][_0x2f1e('0x1f')];}}}_0xf240f5(_0x660b6);})[_0x2f1e('0x12')](function(_0x544759){_0x3c1aff(_0x544759[_0x2f1e('0x16')]);});});}function createEndUser(_0x3aa14e,_0x1a70be,_0x5c005b,_0x4dac4f,_0x51dccf,_0x249aa7){return new BPromise(function(_0x2a679a,_0x2dfc22){return getAuthToken(_0x1a70be,_0x5c005b,_0x249aa7)['then'](function(_0x12471e){var _0x14a92f=_0x249aa7['toLowerCase']()===_0x2f1e('0x25')?_0x51dccf[_0x2f1e('0x26')]:_0x51dccf[_0x2f1e('0x27')];var _0x5dfbb4={'method':'POST','uri':_0x4dac4f+_0x2f1e('0x28'),'body':{'telephone1':_0x14a92f,'fullname':_0x14a92f,'firstname':_0x14a92f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2f1e('0x29')+_0x3aa14e[_0x2f1e('0x20')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x12471e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5dfbb4);})[_0x2f1e('0x17')](function(_0x2e6d4b){var _0x498bbe=_0x2e6d4b[_0x2f1e('0x2a')][_0x2f1e('0x2b')];var _0x1eaa80=_0x498bbe[_0x2f1e('0x2c')](_0x498bbe[_0x2f1e('0x2d')]('(')+0x1,_0x498bbe[_0x2f1e('0x2d')](')'));_0x3aa14e[_0x2f1e('0x2e')]=_0x1eaa80;_0x2a679a(_0x3aa14e);})[_0x2f1e('0x12')](function(_0x14b632){_0x2dfc22(_0x14b632[_0x2f1e('0x16')]);});});}function getEndUser(_0x1eaec8,_0x4dde15,_0x189993,_0x56fe12,_0x2aeb35,_0x19a038){return new BPromise(function(_0x415d1c,_0x57f033){return getAuthToken(_0x4dde15,_0x189993,_0x19a038)[_0x2f1e('0x17')](function(_0x815bd0){var _0xac76ea={'method':_0x2f1e('0x18'),'uri':_0x56fe12+_0x2f1e('0x2f'),'headers':{'Authorization':_0x2f1e('0x30')+_0x815bd0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xac76ea);})[_0x2f1e('0x17')](function(_0x4e39bd){var _0x6bab59=null;if(_0x4e39bd){var _0x572999=_0x4e39bd[_0x2f1e('0x1a')];var _0x2d8363=![];for(_0x6bab59=0x0;_0x6bab59<_0x572999['length'];_0x6bab59++){var _0x336db5=_0x19a038[_0x2f1e('0x31')]()===_0x2f1e('0x25')?_0x2aeb35['destcalleridnum']:_0x2aeb35[_0x2f1e('0x27')];if(_0x572999[_0x6bab59][_0x2f1e('0x32')]===_0x336db5){_0x2d8363=!![];_0x1eaec8[_0x2f1e('0x2e')]=_0x572999[_0x6bab59]['contactid'];}}if(_0x2d8363){_0x415d1c(_0x1eaec8);}else{return createEndUser(_0x1eaec8,_0x4dde15,_0x189993,_0x56fe12,_0x2aeb35,_0x19a038)[_0x2f1e('0x17')](function(_0x894627){logger[_0x2f1e('0x1d')]('['+[_0x19a038[_0x2f1e('0x14')]()]+']\x20Enduser\x20created!',_0x894627[_0x2f1e('0x2e')]);_0x415d1c(_0x894627);});}}else{return createEndUser(_0x1eaec8,_0x4dde15,_0x189993,_0x56fe12,_0x2aeb35,_0x19a038)[_0x2f1e('0x17')](function(_0x4d00f1){logger[_0x2f1e('0x1d')]('['+[_0x19a038[_0x2f1e('0x14')]()]+_0x2f1e('0x33'),_0x4d00f1['enduserId']);_0x415d1c(_0x4d00f1);});}});});}function getCustomFields(_0x25ef93,_0x419447,_0x46b4f9){var _0x2d8da4={};if(_0x25ef93['length']>0x0){_[_0x2f1e('0x34')](_0x25ef93,function(_0x450ca0){if(_0x450ca0[_0x2f1e('0x35')]===_0x2f1e('0x36')&&_0x450ca0[_0x2f1e('0x37')]&&!_0x450ca0[_0x2f1e('0x38')]){var _0x50be38=_0x450ca0[_0x2f1e('0x39')][_0x2f1e('0x31')]();var _0x30478e=_0x50be38[_0x2f1e('0x2c')](0x0,_0x50be38[_0x2f1e('0x3a')]('_'));var _0x482de9=_0x50be38[_0x2f1e('0x2c')](_0x50be38[_0x2f1e('0x3a')]('_')+0x1);if(_0x30478e===_0x46b4f9){_0x2d8da4[_0x482de9]=_0x450ca0[_0x2f1e('0x3b')];}}});}return _0x2d8da4;}function getTicket(_0x3c4752,_0x5ce25f,_0x290c42,_0x24959e,_0x198e0a,_0x3c7a63,_0x12d447){return new BPromise(function(_0x34a13c,_0x382ffd){var _0x45d853;return getAuthToken(_0x5ce25f,_0x290c42,_0x12d447)[_0x2f1e('0x17')](function(_0x1186f7){if(_0x3c7a63['ticketType']===_0x2f1e('0x3c')){_0x45d853={'method':'POST','uri':_0x24959e+'incidents','body':Object[_0x2f1e('0x3d')]({},{'title':intUtil[_0x2f1e('0x3e')](_0x3c7a63[_0x2f1e('0x3f')],_0x198e0a,'\x20'),'description':intUtil[_0x2f1e('0x3e')](_0x3c7a63['Descriptions'],_0x198e0a,'\x0a'),'customerid_contact@odata.bind':_0x2f1e('0x40')+_0x3c4752[_0x2f1e('0x2e')]+')','ownerid@odata.bind':_0x2f1e('0x29')+_0x3c4752[_0x2f1e('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x3c7a63['Fields'],_0x198e0a,_0x3c7a63['ticketType'])),'headers':{'Authorization':_0x2f1e('0x30')+_0x1186f7,'OData-Version':_0x2f1e('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3c7a63[_0x2f1e('0x41')]===_0x2f1e('0x42')){_0x45d853={'method':_0x2f1e('0xc'),'uri':_0x24959e+'phonecalls','body':Object[_0x2f1e('0x3d')]({},{'subject':intUtil[_0x2f1e('0x3e')](_0x3c7a63[_0x2f1e('0x3f')],_0x198e0a,'\x20'),'phonenumber':String(_0x198e0a[_0x2f1e('0x27')]),'description':intUtil[_0x2f1e('0x3e')](_0x3c7a63['Descriptions'],_0x198e0a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2f1e('0x40')+_0x3c4752[_0x2f1e('0x2e')]+')','ownerid@odata.bind':_0x2f1e('0x29')+_0x3c4752['userId']+')','directioncode':_0x3c4752[_0x2f1e('0x43')]===_0x2f1e('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x2f1e('0x29')+_0x3c4752[_0x2f1e('0x20')]+')','participationtypemask':_0x3c4752[_0x2f1e('0x43')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x2f1e('0x40')+_0x3c4752[_0x2f1e('0x2e')]+')','participationtypemask':_0x3c4752['callDirection']==='queue'?0x1:0x2}]},getCustomFields(_0x3c7a63[_0x2f1e('0x45')],_0x198e0a,_0x3c7a63[_0x2f1e('0x41')])),'headers':{'Authorization':_0x2f1e('0x30')+_0x1186f7,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x45d853);})['then'](function(_0x3014cc){var _0x2908ba=_0x3014cc['headers'][_0x2f1e('0x2b')];var _0x278658=_0x2908ba[_0x2f1e('0x2c')](_0x2908ba[_0x2f1e('0x2d')]('(')+0x1,_0x2908ba[_0x2f1e('0x2d')](')'));_0x3c4752[_0x2f1e('0x46')]=_0x278658;_0x34a13c(_0x3c4752);})['catch'](function(_0x1714a2){_0x382ffd(_0x1714a2[_0x2f1e('0x16')]);});});}function emit(_0x395545,_0x57a5d3,_0x4e5aaf,_0xcee6b5){var _0x54b4bf={'uri':util[_0x2f1e('0x47')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x395545,_0x4e5aaf,_0xcee6b5)};io['to'](util[_0x2f1e('0x47')](_0x2f1e('0x48'),_0x57a5d3))['emit'](_0x2f1e('0x49'),_0x54b4bf);}exports['cs']=function(_0x2799ec,_0x35947a,_0x4eb399,_0x4f4932,_0x3dfa36,_0x11564c,_0x1473f6,_0xe72abe){var _0x27748f={};_0x11564c['remoteUri']=intUtil['stripTrailingSlash'](_0x11564c[_0x2f1e('0xe')]);_0x11564c[_0x2f1e('0x4a')]=intUtil[_0x2f1e('0x4b')](_0x11564c[_0x2f1e('0x4a')]);_0x27748f['callDirection']=_0xe72abe==='queue'||_0xe72abe===_0x2f1e('0x4c')?_0x2f1e('0x44'):_0x2f1e('0x25');var _0x512102=util[_0x2f1e('0x47')](_0x2f1e('0x4d'),_0x11564c[_0x2f1e('0xe')]);var _0xc6963d=util[_0x2f1e('0x47')](_0x2f1e('0x4e'),_0x11564c[_0x2f1e('0x4f')]);var _0x188d47=util[_0x2f1e('0x47')](_0x2f1e('0x50'),_0x11564c[_0x2f1e('0x4a')],_0x35947a['uniqueid'],md5(_0x35947a['uniqueid']));if(_0x3dfa36&&_0x3dfa36[_0x2f1e('0x51')]){logger[_0x2f1e('0x1d')](_0x2f1e('0x52'),'Recording\x20is\x20enabled!');_0x35947a['recordingURL']=_0x188d47;}else if(_0x1473f6&&_0x1473f6[_0x2f1e('0x53')]&&_0x1473f6[_0x2f1e('0x53')]!==_0x2f1e('0x54')){logger[_0x2f1e('0x1d')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x35947a[_0x2f1e('0x55')]=_0x188d47;}else{_0x35947a[_0x2f1e('0x55')]='';}return getUser(_0x27748f,_0x11564c,_0x4f4932,_0xc6963d,_0x512102,_0xe72abe)[_0x2f1e('0x17')](function(_0xc39e2b){logger[_0x2f1e('0x1d')]('['+_0xe72abe[_0x2f1e('0x14')]()+_0x2f1e('0x56'),_0xc39e2b['userId']);logger['info']('['+_0xe72abe[_0x2f1e('0x14')]()+_0x2f1e('0x57'),_0xc39e2b[_0x2f1e('0x22')]);return getEndUser(_0xc39e2b,_0x11564c,_0xc6963d,_0x512102,_0x35947a,_0xe72abe);})[_0x2f1e('0x17')](function(_0x47f9ec){logger['info']('['+_0xe72abe[_0x2f1e('0x14')]()+_0x2f1e('0x58'),_0x47f9ec[_0x2f1e('0x2e')]);logger[_0x2f1e('0x1d')]('['+_0xe72abe[_0x2f1e('0x14')]()+_0x2f1e('0x59'),_0x35947a['calleridnum']);return getTicket(_0x47f9ec,_0x11564c,_0xc6963d,_0x512102,_0x35947a,_0x4eb399,_0xe72abe);})[_0x2f1e('0x17')](function(_0x217f3f){logger[_0x2f1e('0x1d')](util[_0x2f1e('0x47')]('['+_0xe72abe[_0x2f1e('0x14')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x4eb399[_0x2f1e('0x41')],_0x217f3f[_0x2f1e('0x46')]));logger[_0x2f1e('0x1d')](util[_0x2f1e('0x47')]('['+_0xe72abe[_0x2f1e('0x14')]()+_0x2f1e('0x5a'),_0xe72abe));if(_0xe72abe!=='abandoned'){logger[_0x2f1e('0x1d')]('['+_0xe72abe[_0x2f1e('0x14')]()+']',_0x2f1e('0x5b'));emit(_0x11564c['remoteUri'],_0x4f4932[_0x2f1e('0x5c')],_0x4eb399['ticketType'],_0x217f3f[_0x2f1e('0x46')]);}})[_0x2f1e('0x12')](function(_0x3ab340){logger[_0x2f1e('0x13')]('['+_0xe72abe[_0x2f1e('0x14')]()+_0x2f1e('0x5d'),util[_0x2f1e('0x5e')](_0x3ab340,{'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 5c09c21..4da1121 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 _0x5824=['abandoned','[ABANDONED]','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','socket.io-emitter','application/json','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','remoteUri','POST','info','Ticket\x20created!','%s/api/v2/agents','then','length','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','base64','debug','[HTTP]','GET','map','forEach','type','nameField','customField','toLowerCase','content','toString','string','idField','push','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','trigger:browser:url','catch','stringify','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','error'];(function(_0x3f9a1f,_0x1d895c){var _0x5b5fcd=function(_0x12e9b){while(--_0x12e9b){_0x3f9a1f['push'](_0x3f9a1f['shift']());}};_0x5b5fcd(++_0x1d895c);}(_0x5824,0xb8));var _0x4582=function(_0x10d7de,_0x421b9b){_0x10d7de=_0x10d7de-0x0;var _0x23aac5=_0x5824[_0x10d7de];return _0x23aac5;};'use strict';var _=require('lodash');var rp=require(_0x4582('0x0'));var md5=require(_0x4582('0x1'));var util=require(_0x4582('0x2'));var Redis=require(_0x4582('0x3'));var intUtil=require(_0x4582('0x4'));var config=require(_0x4582('0x5'));var logger=require('../../../../config/logger')(_0x4582('0x6'));config[_0x4582('0x7')]=_[_0x4582('0x8')](config[_0x4582('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x4582('0x9'))(new Redis(config[_0x4582('0x7')]));var headers={'Content-Type':'application/json','Accept':_0x4582('0xa')};function emit(_0xd971b5,_0x346004,_0x568b8a){io['to'](_0xd971b5)['emit'](_0x346004,_0x568b8a);}function getTicket(_0x5e58cb,_0x565b80,_0x5ed8a4,_0x370248,_0x25dda3){logger['info'](_0x4582('0xb'));var _0x5c79be=_[_0x4582('0xc')]({'responder_id':_0x565b80['id'],'requester_id':_0x5ed8a4['id'],'name':util[_0x4582('0xd')](_0x4582('0xe'),_0x25dda3[_0x4582('0xf')]),'phone':_0x25dda3[_0x4582('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x370248['Subjects'],_0x25dda3,'\x20'),'description':intUtil[_0x4582('0x11')](_0x370248[_0x4582('0x12')],_0x25dda3,_0x4582('0x13')),'tags':getTags(_0x370248[_0x4582('0x14')],_0x4582('0x15'))},getCustomFields(_0x370248[_0x4582('0x16')],_0x25dda3));_0x5c79be[_0x4582('0x17')]=_[_0x4582('0x18')](_[_0x4582('0x19')](_0x5c79be[_0x4582('0x17')],'id'),_0x4582('0x1a'));return request({'uri':util['format']('%s/api/v2/tickets',_0x5e58cb[_0x4582('0x1b')]),'method':_0x4582('0x1c'),'body':_0x5c79be})['then'](function(_0x5dd2aa){logger[_0x4582('0x1d')](_0x4582('0x1e'));return _0x5dd2aa;});}function getUser(_0x22bde2,_0x2fa37c){if(intUtil['validateEmail'](_0x2fa37c)){return request({'uri':util[_0x4582('0xd')](_0x4582('0x1f'),_0x22bde2[_0x4582('0x1b')]),'qs':{'email':_0x2fa37c}})[_0x4582('0x20')](function(_0x1ee2ff){if(_0x1ee2ff[_0x4582('0x21')]){logger[_0x4582('0x1d')]('Agent\x20found!');return _[_0x4582('0x22')](_0x1ee2ff,function(_0x122d2e){return _0x122d2e[_0x4582('0x23')][_0x4582('0x24')]===_0x2fa37c;});}else{logger['info'](_0x4582('0x25'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x22bde2[_0x4582('0x1b')])})[_0x4582('0x20')](function(_0x20ce4c){logger[_0x4582('0x1d')](_0x4582('0x26'));return _0x20ce4c;});}});}else{logger[_0x4582('0x1d')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x4582('0xd')](_0x4582('0x27'),_0x22bde2[_0x4582('0x1b')])})['then'](function(_0x3936d5){logger['info']('Admin\x20account\x20selected.');return _0x3936d5;});}}function getEndUser(_0x1c22bb,_0x59a79d,_0x1760b6){logger[_0x4582('0x1d')](_0x4582('0x28'),_0x1760b6);return request({'uri':util[_0x4582('0xd')](_0x4582('0x29'),_0x1c22bb[_0x4582('0x1b')]),'qs':{'phone':_0x1760b6}})[_0x4582('0x20')](function(_0x12f32b){if(_0x12f32b[_0x4582('0x21')]){logger[_0x4582('0x1d')](_0x4582('0x2a'));return _[_0x4582('0x22')](_0x12f32b,{'phone':_0x1760b6});}else{logger[_0x4582('0x1d')](_0x4582('0x2b'));return request({'uri':util['format'](_0x4582('0x29'),_0x1c22bb[_0x4582('0x1b')]),'method':_0x4582('0x1c'),'body':{'name':_0x59a79d,'phone':_0x1760b6}})[_0x4582('0x20')](function(_0x1145b7){logger[_0x4582('0x1d')](_0x4582('0x2c'));return _0x1145b7;});}});}function getAuth(_0x75aa83){return util['format'](_0x4582('0x2d'),new Buffer(_0x75aa83[_0x4582('0x2e')]+':X')['toString'](_0x4582('0x2f')));}function request(_0x6964ff){logger[_0x4582('0x30')](_0x4582('0x31'),JSON['stringify'](_0x6964ff));return rp(_[_0x4582('0x8')](_0x6964ff,{'method':_0x4582('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x2d1ca4,_0x211eee){var _0x686f8b=[];if(_0x2d1ca4&&_0x2d1ca4[_0x4582('0x21')]>0x0){_0x686f8b=_[_0x4582('0x33')](_0x2d1ca4,_0x211eee);}return _0x686f8b;}function getCustomFields(_0x1e503d,_0x29c1a8){var _0x26a0de=[];var _0x22491b={'custom_fields':[]};if(_0x1e503d[_0x4582('0x21')]>0x0){_[_0x4582('0x34')](_0x1e503d,function(_0x371616){if(_0x371616[_0x4582('0x35')]==='string'&&_0x371616[_0x4582('0x36')]&&!_0x371616[_0x4582('0x37')]){_0x22491b[_0x371616[_0x4582('0x36')][_0x4582('0x38')]()]=_0x371616[_0x4582('0x39')][_0x4582('0x3a')]();}else if(_0x371616[_0x4582('0x35')]===_0x4582('0x3b')&&_0x371616[_0x4582('0x3c')]&&_0x371616[_0x4582('0x37')]){_0x22491b[_0x4582('0x17')][_0x4582('0x3d')]({'id':_0x371616[_0x4582('0x3c')],'value':_0x371616[_0x4582('0x39')][_0x4582('0x3a')]()});}else if(_0x371616[_0x4582('0x35')]===_0x4582('0x3e')&&_0x371616['variableName']&&_0x371616[_0x4582('0x3c')]&&_0x371616[_0x4582('0x37')]){_0x29c1a8[_0x371616[_0x4582('0x3f')]]&&_0x22491b[_0x4582('0x17')][_0x4582('0x3d')]({'id':_0x371616[_0x4582('0x3c')],'value':_0x29c1a8[_0x371616[_0x4582('0x3f')]]['toString']()});}else if(_0x371616[_0x4582('0x35')]===_0x4582('0x40')&&_0x371616['Variable']&&_0x371616['Variable']['name']&&_0x371616[_0x4582('0x3c')]&&_0x371616[_0x4582('0x37')]){_0x29c1a8[_0x371616[_0x4582('0x41')][_0x4582('0x15')][_0x4582('0x38')]()]&&_0x22491b[_0x4582('0x17')]['push']({'id':_0x371616[_0x4582('0x3c')],'value':_0x29c1a8[_0x371616['Variable']['name']['toLowerCase']()][_0x4582('0x3a')]()});}});}return _0x22491b;}exports[_0x4582('0x42')]=function(_0x2d8ed1,_0x1af168,_0x23bfae,_0x1f247d,_0x1f4831,_0x4f0aa7){var _0x4b723f,_0x113f7c;_0x4f0aa7['remoteUri']=intUtil['stripTrailingSlash'](_0x4f0aa7['remoteUri']);_0x4f0aa7[_0x4582('0x43')]=intUtil[_0x4582('0x44')](_0x4f0aa7[_0x4582('0x43')]);if(_0x1f4831&&_0x1f4831[_0x4582('0x45')]){logger[_0x4582('0x1d')](_0x4582('0x46'),'Recording\x20is\x20enabled!');_0x1af168['recordingURL']=util[_0x4582('0xd')](_0x4582('0x47'),_0x4f0aa7[_0x4582('0x43')],_0x1af168['uniqueid'],md5(_0x1af168[_0x4582('0x48')]));}else{_0x1af168[_0x4582('0x49')]='';}headers[_0x4582('0x4a')]=getAuth(_0x4f0aa7);return getUser(_0x4f0aa7,_0x1f247d[_0x4582('0x24')])[_0x4582('0x20')](function(_0x269c34){_0x4b723f=_0x269c34;logger[_0x4582('0x1d')]('The\x20User\x20ID\x20is:',_0x4b723f['id']);return getEndUser(_0x4f0aa7,_0x1af168['calleridname'],_0x1af168[_0x4582('0x10')]);})[_0x4582('0x20')](function(_0x3c84ea){_0x113f7c=_0x3c84ea;logger[_0x4582('0x1d')](_0x4582('0x4b'),_0x113f7c['id']);return getTicket(_0x4f0aa7,_0x4b723f,_0x113f7c,_0x23bfae,_0x1af168);})['then'](function(_0x102a8e){if(_0x102a8e&&_0x102a8e['id']){logger[_0x4582('0x1d')](_0x4582('0x1e'));logger[_0x4582('0x1d')](_0x4582('0x4c'),_0x102a8e['id']);logger[_0x4582('0x1d')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4582('0xd')]('user:%s',_0x1f247d[_0x4582('0x15')]),_0x4582('0x4d'),{'uri':util[_0x4582('0xd')]('%s/helpdesk/tickets/%d',_0x4f0aa7[_0x4582('0x1b')],_0x102a8e['id'])});}})[_0x4582('0x4e')](function(_0xe50347){logger['error']('[QUEUE]',JSON[_0x4582('0x4f')](_0xe50347));});};exports[_0x4582('0x50')]=function(_0x4637b0,_0x4c5295,_0x2be0fa,_0x3d3cd2,_0x3c48c9,_0x508fad,_0x239fa3){var _0x1b7463,_0x4f516f;_0x508fad[_0x4582('0x1b')]=intUtil['stripTrailingSlash'](_0x508fad[_0x4582('0x1b')]);_0x508fad['serverUrl']=intUtil[_0x4582('0x44')](_0x508fad[_0x4582('0x43')]);if(_0x239fa3&&_0x239fa3[_0x4582('0x51')]&&_0x239fa3[_0x4582('0x51')]!=='none'){logger[_0x4582('0x1d')](_0x4582('0x52'),_0x4582('0x53'));_0x4c5295[_0x4582('0x49')]=util[_0x4582('0xd')](_0x4582('0x47'),_0x508fad['serverUrl'],_0x4c5295['uniqueid'],md5(_0x4c5295['uniqueid']));}headers[_0x4582('0x4a')]=getAuth(_0x508fad);return getUser(_0x508fad,_0x3d3cd2[_0x4582('0x24')])[_0x4582('0x20')](function(_0x20922b){_0x1b7463=_0x20922b;logger[_0x4582('0x1d')](_0x4582('0x54'),_0x1b7463['id']);return getEndUser(_0x508fad,_0x4c5295[_0x4582('0x55')],_0x4c5295['destcalleridnum']);})['then'](function(_0x16125f){_0x4f516f=_0x16125f;logger[_0x4582('0x1d')](_0x4582('0x4b'),_0x4f516f['id']);return getTicket(_0x508fad,_0x1b7463,_0x4f516f,_0x2be0fa,_0x4c5295);})[_0x4582('0x20')](function(_0x1b5159){if(_0x1b5159&&_0x1b5159['id']){logger[_0x4582('0x1d')]('Ticket\x20created!');logger[_0x4582('0x1d')]('The\x20Ticket\x20ID\x20is:',_0x1b5159['id']);logger[_0x4582('0x1d')](_0x4582('0x52'),_0x4582('0x56'));emit(util[_0x4582('0xd')]('user:%s',_0x3d3cd2[_0x4582('0x15')]),_0x4582('0x4d'),{'uri':util['format'](_0x4582('0x57'),_0x508fad[_0x4582('0x1b')],_0x1b5159['id'])});}})['catch'](function(_0x1f068a){logger[_0x4582('0x58')]('[OUTBOUND]',JSON[_0x4582('0x4f')](_0x1f068a));});};exports[_0x4582('0x59')]=function(_0x263c8f,_0x53cb0f,_0x4927b6,_0xf6556e,_0x41ce99,_0xfa6eca){var _0x23db7a,_0x1da58e;_0xfa6eca['remoteUri']=intUtil['stripTrailingSlash'](_0xfa6eca[_0x4582('0x1b')]);_0xfa6eca[_0x4582('0x43')]=intUtil[_0x4582('0x44')](_0xfa6eca['serverUrl']);if(_0x41ce99&&_0x41ce99['monitor_format']){logger[_0x4582('0x1d')](_0x4582('0x5a'),_0x4582('0x53'));_0x53cb0f[_0x4582('0x49')]=util[_0x4582('0xd')](_0x4582('0x47'),_0xfa6eca[_0x4582('0x43')],_0x53cb0f[_0x4582('0x48')],md5(_0x53cb0f[_0x4582('0x48')]));}else{_0x53cb0f['recordingURL']='';}headers[_0x4582('0x4a')]=getAuth(_0xfa6eca);return getUser(_0xfa6eca,'')[_0x4582('0x20')](function(_0x29b7ba){_0x23db7a=_0x29b7ba;logger[_0x4582('0x1d')](_0x4582('0x54'),_0x23db7a['id']);return getEndUser(_0xfa6eca,_0x53cb0f[_0x4582('0xf')],_0x53cb0f[_0x4582('0x10')]);})[_0x4582('0x20')](function(_0x207506){_0x1da58e=_0x207506;logger['info'](_0x4582('0x4b'),_0x1da58e['id']);return getTicket(_0xfa6eca,_0x23db7a,_0x1da58e,_0x4927b6,_0x53cb0f);})[_0x4582('0x20')](function(_0x5b3853){if(_0x5b3853){logger[_0x4582('0x1d')](_0x4582('0x1e'));logger['info'](_0x4582('0x4c'),_0x5b3853['id']);}})['catch'](function(_0x229d9e){logger[_0x4582('0x58')](_0x4582('0x5a'),JSON[_0x4582('0x4f')](_0x229d9e));});}; \ No newline at end of file +var _0xff7c=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Authorization','The\x20User\x20ID\x20is:','destcalleridname','The\x20Enduser\x20ID\x20is:','trigger:browser:url','[ABANDONED]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','request-promise','md5','util','ioredis','./util','../../../../config/logger','localhost','socket.io-emitter','redis','application/json','emit','merge','format','Caller\x20-\x20%s','getString','Subjects','Descriptions','
','Fields','custom_fields','mapValues','keyBy','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','find','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','defaults','GET','map','forEach','type','string','customField','toLowerCase','content','idField','push','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format'];(function(_0x47f7da,_0x4f3ff8){var _0x9fd378=function(_0x502f74){while(--_0x502f74){_0x47f7da['push'](_0x47f7da['shift']());}};_0x9fd378(++_0x4f3ff8);}(_0xff7c,0x11b));var _0xcff7=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xff7c[_0x32b542];return _0x554d54;};'use strict';var _=require('lodash');var rp=require(_0xcff7('0x0'));var md5=require(_0xcff7('0x1'));var util=require(_0xcff7('0x2'));var Redis=require(_0xcff7('0x3'));var intUtil=require(_0xcff7('0x4'));var config=require('../../../../config/environment');var logger=require(_0xcff7('0x5'))('freshdesk');config['redis']=_['defaults'](config['redis'],{'host':_0xcff7('0x6'),'port':0x18eb});var io=require(_0xcff7('0x7'))(new Redis(config[_0xcff7('0x8')]));var headers={'Content-Type':_0xcff7('0x9'),'Accept':'application/json'};function emit(_0x372247,_0x4c87fc,_0x138887){io['to'](_0x372247)[_0xcff7('0xa')](_0x4c87fc,_0x138887);}function getTicket(_0x465ac3,_0x21ae2c,_0x3c1bbd,_0x1f59be,_0x1d5816){logger['info']('Creating\x20new\x20ticket...');var _0x2990e7=_[_0xcff7('0xb')]({'responder_id':_0x21ae2c['id'],'requester_id':_0x3c1bbd['id'],'name':util[_0xcff7('0xc')](_0xcff7('0xd'),_0x1d5816['calleridname']),'phone':_0x1d5816['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xcff7('0xe')](_0x1f59be[_0xcff7('0xf')],_0x1d5816,'\x20'),'description':intUtil[_0xcff7('0xe')](_0x1f59be[_0xcff7('0x10')],_0x1d5816,_0xcff7('0x11')),'tags':getTags(_0x1f59be['Tags'],'name')},getCustomFields(_0x1f59be[_0xcff7('0x12')],_0x1d5816));_0x2990e7[_0xcff7('0x13')]=_[_0xcff7('0x14')](_[_0xcff7('0x15')](_0x2990e7['custom_fields'],'id'),'value');return request({'uri':util[_0xcff7('0xc')]('%s/api/v2/tickets',_0x465ac3[_0xcff7('0x16')]),'method':_0xcff7('0x17'),'body':_0x2990e7})[_0xcff7('0x18')](function(_0x32afd6){logger[_0xcff7('0x19')](_0xcff7('0x1a'));return _0x32afd6;});}function getUser(_0x524ac6,_0x49e6ed){if(intUtil[_0xcff7('0x1b')](_0x49e6ed)){return request({'uri':util[_0xcff7('0xc')]('%s/api/v2/agents',_0x524ac6['remoteUri']),'qs':{'email':_0x49e6ed}})[_0xcff7('0x18')](function(_0x403650){if(_0x403650[_0xcff7('0x1c')]){logger[_0xcff7('0x19')](_0xcff7('0x1d'));return _['find'](_0x403650,function(_0x105a33){return _0x105a33[_0xcff7('0x1e')][_0xcff7('0x1f')]===_0x49e6ed;});}else{logger[_0xcff7('0x19')](_0xcff7('0x20'));return request({'uri':util[_0xcff7('0xc')](_0xcff7('0x21'),_0x524ac6[_0xcff7('0x16')])})['then'](function(_0x3024f2){logger[_0xcff7('0x19')]('Admin\x20account\x20selected.');return _0x3024f2;});}});}else{logger[_0xcff7('0x19')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xcff7('0x21'),_0x524ac6[_0xcff7('0x16')])})[_0xcff7('0x18')](function(_0x35039d){logger[_0xcff7('0x19')](_0xcff7('0x22'));return _0x35039d;});}}function getEndUser(_0x3b569a,_0x13da2d,_0x202898){logger[_0xcff7('0x19')](_0xcff7('0x23'),_0x202898);return request({'uri':util[_0xcff7('0xc')](_0xcff7('0x24'),_0x3b569a['remoteUri']),'qs':{'phone':_0x202898}})['then'](function(_0x10167a){if(_0x10167a['length']){logger['info']('Enduser\x20found!');return _[_0xcff7('0x25')](_0x10167a,{'phone':_0x202898});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format']('%s/api/v2/contacts',_0x3b569a[_0xcff7('0x16')]),'method':_0xcff7('0x17'),'body':{'name':_0x13da2d,'phone':_0x202898}})[_0xcff7('0x18')](function(_0x4f7fde){logger[_0xcff7('0x19')](_0xcff7('0x26'));return _0x4f7fde;});}});}function getAuth(_0x4f8e88){return util[_0xcff7('0xc')](_0xcff7('0x27'),new Buffer(_0x4f8e88[_0xcff7('0x28')]+':X')[_0xcff7('0x29')](_0xcff7('0x2a')));}function request(_0x55dadb){logger['debug'](_0xcff7('0x2b'),JSON[_0xcff7('0x2c')](_0x55dadb));return rp(_[_0xcff7('0x2d')](_0x55dadb,{'method':_0xcff7('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x1461f7,_0x3afd85){var _0x3b64d8=[];if(_0x1461f7&&_0x1461f7[_0xcff7('0x1c')]>0x0){_0x3b64d8=_[_0xcff7('0x2f')](_0x1461f7,_0x3afd85);}return _0x3b64d8;}function getCustomFields(_0x6e354b,_0x5598ec){var _0x5bce70=[];var _0x49a361={'custom_fields':[]};if(_0x6e354b[_0xcff7('0x1c')]>0x0){_[_0xcff7('0x30')](_0x6e354b,function(_0x3d3acf){if(_0x3d3acf[_0xcff7('0x31')]===_0xcff7('0x32')&&_0x3d3acf['nameField']&&!_0x3d3acf[_0xcff7('0x33')]){_0x49a361[_0x3d3acf['nameField'][_0xcff7('0x34')]()]=_0x3d3acf[_0xcff7('0x35')][_0xcff7('0x29')]();}else if(_0x3d3acf[_0xcff7('0x31')]===_0xcff7('0x32')&&_0x3d3acf[_0xcff7('0x36')]&&_0x3d3acf[_0xcff7('0x33')]){_0x49a361[_0xcff7('0x13')][_0xcff7('0x37')]({'id':_0x3d3acf[_0xcff7('0x36')],'value':_0x3d3acf['content'][_0xcff7('0x29')]()});}else if(_0x3d3acf['type']===_0xcff7('0x38')&&_0x3d3acf['variableName']&&_0x3d3acf[_0xcff7('0x36')]&&_0x3d3acf[_0xcff7('0x33')]){_0x5598ec[_0x3d3acf[_0xcff7('0x39')]]&&_0x49a361[_0xcff7('0x13')]['push']({'id':_0x3d3acf['idField'],'value':_0x5598ec[_0x3d3acf[_0xcff7('0x39')]]['toString']()});}else if(_0x3d3acf[_0xcff7('0x31')]===_0xcff7('0x3a')&&_0x3d3acf[_0xcff7('0x3b')]&&_0x3d3acf[_0xcff7('0x3b')][_0xcff7('0x3c')]&&_0x3d3acf[_0xcff7('0x36')]&&_0x3d3acf[_0xcff7('0x33')]){_0x5598ec[_0x3d3acf['Variable'][_0xcff7('0x3c')][_0xcff7('0x34')]()]&&_0x49a361[_0xcff7('0x13')][_0xcff7('0x37')]({'id':_0x3d3acf[_0xcff7('0x36')],'value':_0x5598ec[_0x3d3acf['Variable'][_0xcff7('0x3c')][_0xcff7('0x34')]()][_0xcff7('0x29')]()});}});}return _0x49a361;}exports[_0xcff7('0x3d')]=function(_0x4431eb,_0x4dd565,_0x48e34d,_0x1c31b6,_0x957698,_0xffa99e){var _0x3dcc27,_0x3994f0;_0xffa99e['remoteUri']=intUtil[_0xcff7('0x3e')](_0xffa99e[_0xcff7('0x16')]);_0xffa99e[_0xcff7('0x3f')]=intUtil['stripTrailingSlash'](_0xffa99e[_0xcff7('0x3f')]);if(_0x957698&&_0x957698[_0xcff7('0x40')]){logger[_0xcff7('0x19')](_0xcff7('0x41'),_0xcff7('0x42'));_0x4dd565[_0xcff7('0x43')]=util[_0xcff7('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xffa99e[_0xcff7('0x3f')],_0x4dd565[_0xcff7('0x44')],md5(_0x4dd565[_0xcff7('0x44')]));}else{_0x4dd565[_0xcff7('0x43')]='';}headers['Authorization']=getAuth(_0xffa99e);return getUser(_0xffa99e,_0x1c31b6[_0xcff7('0x1f')])[_0xcff7('0x18')](function(_0x461d4c){_0x3dcc27=_0x461d4c;logger['info']('The\x20User\x20ID\x20is:',_0x3dcc27['id']);return getEndUser(_0xffa99e,_0x4dd565[_0xcff7('0x45')],_0x4dd565[_0xcff7('0x46')]);})[_0xcff7('0x18')](function(_0x488214){_0x3994f0=_0x488214;logger[_0xcff7('0x19')]('The\x20Enduser\x20ID\x20is:',_0x3994f0['id']);return getTicket(_0xffa99e,_0x3dcc27,_0x3994f0,_0x48e34d,_0x4dd565);})[_0xcff7('0x18')](function(_0x3bb35f){if(_0x3bb35f&&_0x3bb35f['id']){logger[_0xcff7('0x19')]('Ticket\x20created!');logger[_0xcff7('0x19')](_0xcff7('0x47'),_0x3bb35f['id']);logger['info'](_0xcff7('0x41'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcff7('0xc')](_0xcff7('0x48'),_0x1c31b6[_0xcff7('0x3c')]),'trigger:browser:url',{'uri':util['format'](_0xcff7('0x49'),_0xffa99e[_0xcff7('0x16')],_0x3bb35f['id'])});}})[_0xcff7('0x4a')](function(_0x36dda4){logger[_0xcff7('0x4b')](_0xcff7('0x41'),JSON[_0xcff7('0x2c')](_0x36dda4));});};exports[_0xcff7('0x4c')]=function(_0x57d366,_0x4a0998,_0x70f6f6,_0x17dd44,_0x1ce828,_0xa09449,_0x4dc4b0){var _0x570f10,_0x534384;_0xa09449[_0xcff7('0x16')]=intUtil[_0xcff7('0x3e')](_0xa09449[_0xcff7('0x16')]);_0xa09449[_0xcff7('0x3f')]=intUtil[_0xcff7('0x3e')](_0xa09449[_0xcff7('0x3f')]);if(_0x4dc4b0&&_0x4dc4b0[_0xcff7('0x4d')]&&_0x4dc4b0['recordingFormat']!==_0xcff7('0x4e')){logger['info'](_0xcff7('0x4f'),_0xcff7('0x42'));_0x4a0998['recordingURL']=util[_0xcff7('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xa09449[_0xcff7('0x3f')],_0x4a0998[_0xcff7('0x44')],md5(_0x4a0998[_0xcff7('0x44')]));}headers[_0xcff7('0x50')]=getAuth(_0xa09449);return getUser(_0xa09449,_0x17dd44['email'])[_0xcff7('0x18')](function(_0x5f1dfa){_0x570f10=_0x5f1dfa;logger[_0xcff7('0x19')](_0xcff7('0x51'),_0x570f10['id']);return getEndUser(_0xa09449,_0x4a0998[_0xcff7('0x52')],_0x4a0998['destcalleridnum']);})['then'](function(_0x4f4528){_0x534384=_0x4f4528;logger[_0xcff7('0x19')](_0xcff7('0x53'),_0x534384['id']);return getTicket(_0xa09449,_0x570f10,_0x534384,_0x70f6f6,_0x4a0998);})[_0xcff7('0x18')](function(_0x474d4a){if(_0x474d4a&&_0x474d4a['id']){logger[_0xcff7('0x19')](_0xcff7('0x1a'));logger[_0xcff7('0x19')]('The\x20Ticket\x20ID\x20is:',_0x474d4a['id']);logger['info'](_0xcff7('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcff7('0xc')](_0xcff7('0x48'),_0x17dd44[_0xcff7('0x3c')]),_0xcff7('0x54'),{'uri':util['format'](_0xcff7('0x49'),_0xa09449[_0xcff7('0x16')],_0x474d4a['id'])});}})['catch'](function(_0x223d0a){logger[_0xcff7('0x4b')](_0xcff7('0x4f'),JSON[_0xcff7('0x2c')](_0x223d0a));});};exports['abandoned']=function(_0x4a675b,_0xa9e583,_0x267efa,_0x4fc784,_0x4a3b74,_0x474aa7){var _0x230a75,_0x572326;_0x474aa7[_0xcff7('0x16')]=intUtil['stripTrailingSlash'](_0x474aa7[_0xcff7('0x16')]);_0x474aa7[_0xcff7('0x3f')]=intUtil['stripTrailingSlash'](_0x474aa7[_0xcff7('0x3f')]);if(_0x4a3b74&&_0x4a3b74[_0xcff7('0x40')]){logger[_0xcff7('0x19')](_0xcff7('0x55'),_0xcff7('0x42'));_0xa9e583[_0xcff7('0x43')]=util['format'](_0xcff7('0x56'),_0x474aa7[_0xcff7('0x3f')],_0xa9e583[_0xcff7('0x44')],md5(_0xa9e583[_0xcff7('0x44')]));}else{_0xa9e583[_0xcff7('0x43')]='';}headers[_0xcff7('0x50')]=getAuth(_0x474aa7);return getUser(_0x474aa7,'')[_0xcff7('0x18')](function(_0x2d6773){_0x230a75=_0x2d6773;logger['info'](_0xcff7('0x51'),_0x230a75['id']);return getEndUser(_0x474aa7,_0xa9e583[_0xcff7('0x45')],_0xa9e583['calleridnum']);})[_0xcff7('0x18')](function(_0x20330f){_0x572326=_0x20330f;logger['info'](_0xcff7('0x53'),_0x572326['id']);return getTicket(_0x474aa7,_0x230a75,_0x572326,_0x267efa,_0xa9e583);})[_0xcff7('0x18')](function(_0x1758f2){if(_0x1758f2){logger[_0xcff7('0x19')](_0xcff7('0x1a'));logger[_0xcff7('0x19')](_0xcff7('0x47'),_0x1758f2['id']);}})[_0xcff7('0x4a')](function(_0x4d55e3){logger['error'](_0xcff7('0x55'),JSON[_0xcff7('0x2c')](_0x4d55e3));});}; \ 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 cd48d05..2309860 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 _0x7bc2=['getString','Subjects','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','serverUrl','remoteUri','outbound','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','email','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','adminEmail','toUpperCase','/api/contacts/filters','then','filters','forEach','All\x20Contacts','Getting\x20contact\x20list','/api/contacts/view/','contactNumber','find','mobile_number','endUserId','Contact\x20found:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks'];(function(_0x1fb5a6,_0x2b1312){var _0x39d126=function(_0x5b7a7c){while(--_0x5b7a7c){_0x1fb5a6['push'](_0x1fb5a6['shift']());}};_0x39d126(++_0x2b1312);}(_0x7bc2,0xc0));var _0x27bc=function(_0x19e8e5,_0x4c2348){_0x19e8e5=_0x19e8e5-0x0;var _0x121fad=_0x7bc2[_0x19e8e5];return _0x121fad;};'use strict';var _=require(_0x27bc('0x0'));var rp=require(_0x27bc('0x1'));var md5=require('md5');var util=require(_0x27bc('0x2'));var moment=require(_0x27bc('0x3'));var Promise=require(_0x27bc('0x4'));var Redis=require('ioredis');var intUtil=require(_0x27bc('0x5'));var config=require(_0x27bc('0x6'));var logger=require('../../../../config/logger')('freshsales');config[_0x27bc('0x7')]=_[_0x27bc('0x8')](config['redis'],{'host':_0x27bc('0x9'),'port':0x18eb});var io=require(_0x27bc('0xa'))(new Redis(config[_0x27bc('0x7')]));function getAdminId(_0x40fc9b,_0x28fe44,_0x3ed1cd,_0x336983){return new Promise(function(_0x38ee27,_0x4a6657){var _0x26a011=![];var _0x576ef1={'method':_0x27bc('0xb'),'uri':_0x336983+_0x27bc('0xc'),'json':!![]};_0x576ef1[_0x27bc('0xd')]=_0x3ed1cd;logger[_0x27bc('0xe')](_0x27bc('0xf'));return rp(_0x576ef1)['then'](function(_0x1d80fd){if(_0x1d80fd){var _0xaff94=_0x1d80fd[_0x27bc('0x10')];var _0x7aa1fc=null;for(_0x7aa1fc=0x0;_0x7aa1fc<_0xaff94['length'];_0x7aa1fc++){if(_0xaff94[_0x7aa1fc][_0x27bc('0x11')]===_0x40fc9b['adminEmail']){_0x40fc9b[_0x27bc('0x12')]=_0xaff94[_0x7aa1fc]['id'];_0x26a011=!![];}}if(_0x26a011){logger[_0x27bc('0xe')]('Admin\x20found:',_0x40fc9b[_0x27bc('0x12')]);_0x38ee27(_0x40fc9b);}else{_0x4a6657({'statusCode':0x194,'message':_0x27bc('0x13')});}}else{_0x4a6657({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x27bc('0x14')](function(_0x14d60f){logger[_0x27bc('0x15')]('['+[_0x28fe44['toUpperCase']()]+']',_0x14d60f[_0x27bc('0x16')]);_0x4a6657(_0x14d60f);});});}function getUser(_0x30c012,_0x42b390,_0x371bbe){return function(_0x437a8b){return new Promise(function(_0x29fdcd,_0x3a55e3){var _0x2cde28={'method':_0x27bc('0xb'),'uri':_0x371bbe+'/api/selector/owners','json':!![]};_0x2cde28[_0x27bc('0xd')]=_0x42b390;logger[_0x27bc('0xe')](_0x27bc('0x17'));return rp(_0x2cde28)['then'](function(_0x41b8ab){if(_0x41b8ab){var _0x14b530=_0x41b8ab[_0x27bc('0x10')];var _0x456cf0=![];var _0x2d7ba8=null;if(_0x437a8b[_0x27bc('0x18')]!==null){logger[_0x27bc('0xe')](_0x27bc('0x19'),_0x437a8b[_0x27bc('0x18')]);_0x437a8b[_0x27bc('0x1a')]=_0x437a8b['agentEmail'];for(_0x2d7ba8=0x0;_0x2d7ba8<_0x14b530[_0x27bc('0x1b')];_0x2d7ba8++){if(_0x14b530[_0x2d7ba8][_0x27bc('0x11')]===_0x437a8b[_0x27bc('0x18')]){_0x456cf0=!![];_0x437a8b[_0x27bc('0x1c')]=_0x14b530[_0x2d7ba8]['id'];logger[_0x27bc('0xe')](_0x27bc('0x1d'),_0x437a8b['userId']);}}}if(!_0x456cf0){logger[_0x27bc('0xe')](_0x27bc('0x1e'));_0x437a8b[_0x27bc('0x1a')]=_0x437a8b[_0x27bc('0x1f')];_0x437a8b['userId']=_0x437a8b['adminId'];_0x456cf0=!![];}if(_0x456cf0){_0x29fdcd(_0x437a8b);}else{_0x3a55e3({'statusCode':0x194,'message':_0x27bc('0x13')});}}else{_0x3a55e3({'statusCode':0x194,'message':_0x27bc('0x13')});}})[_0x27bc('0x14')](function(_0x578c4c){logger['error']('['+[_0x30c012[_0x27bc('0x20')]()]+']',_0x578c4c[_0x27bc('0x16')]);_0x3a55e3(_0x578c4c);});});};}function getEndUser(_0x50710d,_0x8caf1b,_0x28e88a){return function(_0x10de64){return new Promise(function(_0x13f8bf,_0x303bc7){var _0x47671e=0x0;var _0x339bc9={'method':'GET','uri':_0x28e88a+_0x27bc('0x21'),'json':!![]};_0x339bc9[_0x27bc('0xd')]=_0x8caf1b;logger[_0x27bc('0xe')]('Getting\x20contacts\x20filter');return rp(_0x339bc9)[_0x27bc('0x22')](function(_0x20043b){_0x20043b[_0x27bc('0x23')][_0x27bc('0x24')](function(_0x3a0e85){if(_0x3a0e85['name']===_0x27bc('0x25')){_0x47671e=_0x3a0e85['id'];}});})[_0x27bc('0x22')](function(){logger[_0x27bc('0xe')](_0x27bc('0x26'));var _0x338cc5={'method':'GET','uri':_0x28e88a+_0x27bc('0x27')+_0x47671e,'json':!![]};_0x338cc5['headers']=_0x8caf1b;return rp(_0x338cc5);})['then'](function(_0x264abc){logger[_0x27bc('0xe')]('Searching\x20contact\x20with\x20phone',_0x10de64[_0x27bc('0x28')]);if(_0x264abc['contacts'][_0x27bc('0x1b')]>0x0){var _0x19a219=_[_0x27bc('0x29')](_0x264abc['contacts'],function(_0x5f25d6){if(_0x5f25d6['work_number']===_0x10de64[_0x27bc('0x28')]||_0x5f25d6[_0x27bc('0x2a')]===_0x10de64[_0x27bc('0x28')]){return _0x5f25d6;}});if(_0x19a219){_0x10de64[_0x27bc('0x2b')]=_0x19a219['id'];logger['info'](_0x27bc('0x2c'),_0x10de64[_0x27bc('0x2b')]);_0x13f8bf(_0x10de64);}else{return createEndUser(_0x10de64,_0x50710d,_0x8caf1b,_0x28e88a)[_0x27bc('0x22')](function(_0x13774b){logger[_0x27bc('0xe')](_0x27bc('0x2d'),_0x10de64['endUserId']);_0x13f8bf(_0x13774b);});}}else{return createEndUser(_0x10de64,_0x50710d,_0x8caf1b,_0x28e88a)[_0x27bc('0x22')](function(_0x3aa8ce){logger[_0x27bc('0xe')]('Contact\x20created:',_0x10de64[_0x27bc('0x2b')]);_0x13f8bf(_0x3aa8ce);});}})[_0x27bc('0x14')](function(_0x4aeb16){throw new Error(_0x4aeb16[_0x27bc('0x16')]);});});};}function createEndUser(_0x53d155,_0x9a82c,_0x355d3a,_0x45d278){return new Promise(function(_0x5908af,_0x3110d1){var _0x2285d3=moment();var _0x5a1568={'method':_0x27bc('0x2e'),'uri':_0x45d278+_0x27bc('0x2f'),'body':{'contact':{'last_name':_0x53d155[_0x27bc('0x28')],'work_number':_0x53d155[_0x27bc('0x28')],'mobile_number':_0x53d155[_0x27bc('0x28')],'owner_id':_0x53d155[_0x27bc('0x1c')],'created_at':_0x2285d3[_0x27bc('0x30')](_0x27bc('0x31'))}},'json':!![]};_0x5a1568[_0x27bc('0xd')]=_0x355d3a;logger[_0x27bc('0xe')](_0x27bc('0x32'));return rp(_0x5a1568)[_0x27bc('0x22')](function(_0x4f8c31){_0x53d155['endUserId']=_0x4f8c31[_0x27bc('0x33')]['id'];_0x5908af(_0x53d155);})[_0x27bc('0x14')](function(_0x528e2f){logger[_0x27bc('0x15')]('['+[_0x9a82c['toUpperCase']()]+']',_0x528e2f[_0x27bc('0x16')]);_0x3110d1(_0x528e2f[_0x27bc('0x16')]);});});}function getTicket(_0xe526ab,_0x1e5f77,_0x36524e,_0x1e03b1,_0x58129b){return function(_0x1c8007){logger[_0x27bc('0xe')](_0x27bc('0x34'));return new Promise(function(_0x380ea4,_0x2de323){var _0x3c13b4=moment();var _0x36a92b={'method':_0x27bc('0x2e'),'uri':_0x36524e+_0x27bc('0x35'),'body':{'title':intUtil[_0x27bc('0x36')](_0x1e03b1[_0x27bc('0x37')],_0x58129b,'\x20'),'description':intUtil['getString'](_0x1e03b1['Descriptions'],_0x58129b,'\x0a'),'owner_id':_0x1c8007[_0x27bc('0x1c')],'creater_id':_0x1c8007['adminId'],'targetable_id':_0x1c8007[_0x27bc('0x2b')],'targetable_type':_0x27bc('0x38'),'created_at':_0x3c13b4[_0x27bc('0x30')](_0x27bc('0x31')),'due_date':_0x3c13b4[_0x27bc('0x39')](0x1e,'m')[_0x27bc('0x30')](_0x27bc('0x31'))},'json':!![]};_0x36a92b['headers']=_0x1e5f77;return rp(_0x36a92b)[_0x27bc('0x22')](function(_0xa64dfd){_0x1c8007[_0x27bc('0x3a')]=_0xa64dfd[_0x27bc('0x3b')]['id'];logger[_0x27bc('0xe')](_0x27bc('0x3c'),_0x1c8007[_0x27bc('0x3a')]);_0x380ea4(_0x1c8007);})[_0x27bc('0x14')](function(_0x269fa1){logger['error']('['+[_0xe526ab[_0x27bc('0x20')]()]+']',_0x269fa1['message']);_0x2de323(_0x269fa1['message']);});});};}function emit(_0x389905,_0x25f2ab,_0x531de7){var _0x14767c={'uri':_0x389905+_0x27bc('0x3d')+_0x531de7};io['to'](util['format'](_0x27bc('0x3e'),_0x25f2ab))['emit'](_0x27bc('0x3f'),_0x14767c);}exports['cs']=function(_0x3f77ac,_0x439589,_0x5ae728,_0x4c4956,_0x54ea87,_0x1b0404,_0x3780f6,_0x46164a){var _0x494d97={};var _0x273b5c={'Authorization':_0x27bc('0x40')+_0x1b0404[_0x27bc('0x41')]};_0x1b0404['remoteUri']=intUtil['stripTrailingSlash'](_0x1b0404['remoteUri']);_0x1b0404['serverUrl']=intUtil[_0x27bc('0x42')](_0x1b0404[_0x27bc('0x43')]);var _0x1acfab=_0x1b0404[_0x27bc('0x44')];_0x494d97['adminEmail']=_0x1b0404['username'];_0x494d97[_0x27bc('0x28')]=_0x46164a['toLowerCase']()===_0x27bc('0x45')?_0x439589['destcalleridnum']:_0x439589['calleridnum'];_0x494d97[_0x27bc('0x46')]=_0x46164a===_0x27bc('0x47')||_0x46164a==='abandoned'?_0x27bc('0x47'):_0x27bc('0x45');if(_0x4c4956){_0x494d97[_0x27bc('0x18')]=_0x4c4956['email'];}var _0x27b751=util['format'](_0x27bc('0x48'),_0x1b0404['serverUrl'],_0x439589[_0x27bc('0x49')],md5(_0x439589[_0x27bc('0x49')]));if(_0x54ea87&&_0x54ea87['monitor_format']){logger[_0x27bc('0xe')]('[QUEUE]',_0x27bc('0x4a'));_0x439589['recordingURL']=_0x27b751;}else if(_0x3780f6&&_0x3780f6[_0x27bc('0x4b')]&&_0x3780f6['recordingFormat']!==_0x27bc('0x4c')){logger[_0x27bc('0xe')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x439589[_0x27bc('0x4d')]=_0x27b751;}else{_0x439589[_0x27bc('0x4d')]='';}return getAdminId(_0x494d97,_0x46164a,_0x273b5c,_0x1acfab)[_0x27bc('0x22')](getUser(_0x46164a,_0x273b5c,_0x1acfab))['then'](getEndUser(_0x46164a,_0x273b5c,_0x1acfab))[_0x27bc('0x22')](getTicket(_0x46164a,_0x273b5c,_0x1acfab,_0x5ae728,_0x439589))['then'](function(_0x22a4a9){logger[_0x27bc('0xe')](util[_0x27bc('0x30')](_0x27bc('0x4e'),_0x22a4a9[_0x27bc('0x3a')]));if(_0x46164a!=='abandoned'){logger['info']('['+[_0x46164a[_0x27bc('0x20')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x1acfab,_0x4c4956[_0x27bc('0x4f')],_0x22a4a9[_0x27bc('0x2b')]);}})['catch'](function(_0x4117ba){logger[_0x27bc('0x15')]('['+[_0x46164a[_0x27bc('0x20')]()]+_0x27bc('0x50'),util[_0x27bc('0x51')](_0x4117ba,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x220c=['none','The\x20ticket\x20ID\x20is:\x20%s','ticketId','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','../../../../config/environment','freshsales','redis','defaults','localhost','GET','/api/selector/owners','headers','info','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','catch','/api/contacts/filters','then','filters','forEach','name','All\x20Contacts','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber','contacts','find','mobile_number','Contact\x20found:','Contact\x20created:','endUserId','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','add','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','queue','abandoned','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat'];(function(_0x3e50f0,_0x486447){var _0x15c1cf=function(_0x189103){while(--_0x189103){_0x3e50f0['push'](_0x3e50f0['shift']());}};_0x15c1cf(++_0x486447);}(_0x220c,0xbd));var _0xc220=function(_0x4f00c8,_0x5f0455){_0x4f00c8=_0x4f00c8-0x0;var _0x1e9153=_0x220c[_0x4f00c8];return _0x1e9153;};'use strict';var _=require(_0xc220('0x0'));var rp=require(_0xc220('0x1'));var md5=require(_0xc220('0x2'));var util=require(_0xc220('0x3'));var moment=require(_0xc220('0x4'));var Promise=require(_0xc220('0x5'));var Redis=require(_0xc220('0x6'));var intUtil=require('./util');var config=require(_0xc220('0x7'));var logger=require('../../../../config/logger')(_0xc220('0x8'));config[_0xc220('0x9')]=_[_0xc220('0xa')](config[_0xc220('0x9')],{'host':_0xc220('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x2e1a32,_0x52120f,_0x2b6ae6,_0x19293c){return new Promise(function(_0x2486a3,_0x1f8702){var _0x92e985=![];var _0x49e40e={'method':_0xc220('0xc'),'uri':_0x19293c+_0xc220('0xd'),'json':!![]};_0x49e40e[_0xc220('0xe')]=_0x2b6ae6;logger[_0xc220('0xf')]('Getting\x20admin\x20information');return rp(_0x49e40e)['then'](function(_0x375538){if(_0x375538){var _0x262452=_0x375538[_0xc220('0x10')];var _0x887f9f=null;for(_0x887f9f=0x0;_0x887f9f<_0x262452[_0xc220('0x11')];_0x887f9f++){if(_0x262452[_0x887f9f][_0xc220('0x12')]===_0x2e1a32[_0xc220('0x13')]){_0x2e1a32[_0xc220('0x14')]=_0x262452[_0x887f9f]['id'];_0x92e985=!![];}}if(_0x92e985){logger['info'](_0xc220('0x15'),_0x2e1a32['adminId']);_0x2486a3(_0x2e1a32);}else{_0x1f8702({'statusCode':0x194,'message':_0xc220('0x16')});}}else{_0x1f8702({'statusCode':0x194,'message':_0xc220('0x16')});}})['catch'](function(_0x349ffd){logger[_0xc220('0x17')]('['+[_0x52120f[_0xc220('0x18')]()]+']',_0x349ffd[_0xc220('0x19')]);_0x1f8702(_0x349ffd);});});}function getUser(_0x43a8a9,_0x590663,_0x23b19f){return function(_0x5d3d5d){return new Promise(function(_0xb37e5e,_0x492d26){var _0x40fa47={'method':_0xc220('0xc'),'uri':_0x23b19f+_0xc220('0xd'),'json':!![]};_0x40fa47[_0xc220('0xe')]=_0x590663;logger[_0xc220('0xf')](_0xc220('0x1a'));return rp(_0x40fa47)['then'](function(_0x28240c){if(_0x28240c){var _0x53144e=_0x28240c[_0xc220('0x10')];var _0x35f6cc=![];var _0x18f6cc=null;if(_0x5d3d5d[_0xc220('0x1b')]!==null){logger[_0xc220('0xf')](_0xc220('0x1c'),_0x5d3d5d[_0xc220('0x1b')]);_0x5d3d5d[_0xc220('0x1d')]=_0x5d3d5d['agentEmail'];for(_0x18f6cc=0x0;_0x18f6cc<_0x53144e[_0xc220('0x11')];_0x18f6cc++){if(_0x53144e[_0x18f6cc][_0xc220('0x12')]===_0x5d3d5d[_0xc220('0x1b')]){_0x35f6cc=!![];_0x5d3d5d[_0xc220('0x1e')]=_0x53144e[_0x18f6cc]['id'];logger[_0xc220('0xf')](_0xc220('0x1f'),_0x5d3d5d['userId']);}}}if(!_0x35f6cc){logger[_0xc220('0xf')](_0xc220('0x20'));_0x5d3d5d[_0xc220('0x1d')]=_0x5d3d5d['adminEmail'];_0x5d3d5d[_0xc220('0x1e')]=_0x5d3d5d[_0xc220('0x14')];_0x35f6cc=!![];}if(_0x35f6cc){_0xb37e5e(_0x5d3d5d);}else{_0x492d26({'statusCode':0x194,'message':_0xc220('0x16')});}}else{_0x492d26({'statusCode':0x194,'message':_0xc220('0x16')});}})[_0xc220('0x21')](function(_0x258cdb){logger[_0xc220('0x17')]('['+[_0x43a8a9['toUpperCase']()]+']',_0x258cdb['message']);_0x492d26(_0x258cdb);});});};}function getEndUser(_0x278987,_0x148fc9,_0x3e4d56){return function(_0x557a47){return new Promise(function(_0x12a3f9,_0x36c558){var _0x3709b4=0x0;var _0x1ebf32={'method':_0xc220('0xc'),'uri':_0x3e4d56+_0xc220('0x22'),'json':!![]};_0x1ebf32['headers']=_0x148fc9;logger[_0xc220('0xf')]('Getting\x20contacts\x20filter');return rp(_0x1ebf32)[_0xc220('0x23')](function(_0x35d117){_0x35d117[_0xc220('0x24')][_0xc220('0x25')](function(_0x217cc4){if(_0x217cc4[_0xc220('0x26')]===_0xc220('0x27')){_0x3709b4=_0x217cc4['id'];}});})[_0xc220('0x23')](function(){logger[_0xc220('0xf')](_0xc220('0x28'));var _0x24fbe1={'method':_0xc220('0xc'),'uri':_0x3e4d56+_0xc220('0x29')+_0x3709b4,'json':!![]};_0x24fbe1['headers']=_0x148fc9;return rp(_0x24fbe1);})[_0xc220('0x23')](function(_0x48b625){logger['info'](_0xc220('0x2a'),_0x557a47[_0xc220('0x2b')]);if(_0x48b625[_0xc220('0x2c')][_0xc220('0x11')]>0x0){var _0x1ae8ed=_[_0xc220('0x2d')](_0x48b625[_0xc220('0x2c')],function(_0x3dc352){if(_0x3dc352['work_number']===_0x557a47[_0xc220('0x2b')]||_0x3dc352[_0xc220('0x2e')]===_0x557a47[_0xc220('0x2b')]){return _0x3dc352;}});if(_0x1ae8ed){_0x557a47['endUserId']=_0x1ae8ed['id'];logger['info'](_0xc220('0x2f'),_0x557a47['endUserId']);_0x12a3f9(_0x557a47);}else{return createEndUser(_0x557a47,_0x278987,_0x148fc9,_0x3e4d56)['then'](function(_0x1a8287){logger[_0xc220('0xf')](_0xc220('0x30'),_0x557a47['endUserId']);_0x12a3f9(_0x1a8287);});}}else{return createEndUser(_0x557a47,_0x278987,_0x148fc9,_0x3e4d56)[_0xc220('0x23')](function(_0x5011cf){logger['info'](_0xc220('0x30'),_0x557a47[_0xc220('0x31')]);_0x12a3f9(_0x5011cf);});}})['catch'](function(_0x10a866){throw new Error(_0x10a866[_0xc220('0x19')]);});});};}function createEndUser(_0x5cb6fe,_0x165d5a,_0x599c5b,_0x56fab0){return new Promise(function(_0xaa96e3,_0x437477){var _0x2d8a7a=moment();var _0x382792={'method':_0xc220('0x32'),'uri':_0x56fab0+_0xc220('0x33'),'body':{'contact':{'last_name':_0x5cb6fe['contactNumber'],'work_number':_0x5cb6fe[_0xc220('0x2b')],'mobile_number':_0x5cb6fe[_0xc220('0x2b')],'owner_id':_0x5cb6fe[_0xc220('0x1e')],'created_at':_0x2d8a7a[_0xc220('0x34')](_0xc220('0x35'))}},'json':!![]};_0x382792[_0xc220('0xe')]=_0x599c5b;logger[_0xc220('0xf')](_0xc220('0x36'));return rp(_0x382792)[_0xc220('0x23')](function(_0x610ed2){_0x5cb6fe[_0xc220('0x31')]=_0x610ed2[_0xc220('0x37')]['id'];_0xaa96e3(_0x5cb6fe);})[_0xc220('0x21')](function(_0x180d76){logger['error']('['+[_0x165d5a['toUpperCase']()]+']',_0x180d76['message']);_0x437477(_0x180d76[_0xc220('0x19')]);});});}function getTicket(_0x5818a5,_0x2fa3ab,_0x49f791,_0x1739b9,_0x178049){return function(_0x3287ed){logger[_0xc220('0xf')](_0xc220('0x38'));return new Promise(function(_0x42f8b1,_0x3865e4){var _0x4d848f=moment();var _0x5a121d={'method':_0xc220('0x32'),'uri':_0x49f791+_0xc220('0x39'),'body':{'title':intUtil['getString'](_0x1739b9['Subjects'],_0x178049,'\x20'),'description':intUtil[_0xc220('0x3a')](_0x1739b9[_0xc220('0x3b')],_0x178049,'\x0a'),'owner_id':_0x3287ed[_0xc220('0x1e')],'creater_id':_0x3287ed[_0xc220('0x14')],'targetable_id':_0x3287ed[_0xc220('0x31')],'targetable_type':_0xc220('0x3c'),'created_at':_0x4d848f[_0xc220('0x34')](_0xc220('0x35')),'due_date':_0x4d848f[_0xc220('0x3d')](0x1e,'m')[_0xc220('0x34')](_0xc220('0x35'))},'json':!![]};_0x5a121d[_0xc220('0xe')]=_0x2fa3ab;return rp(_0x5a121d)[_0xc220('0x23')](function(_0x5f0dc0){_0x3287ed['ticketId']=_0x5f0dc0[_0xc220('0x3e')]['id'];logger['info'](_0xc220('0x3f'),_0x3287ed['ticketId']);_0x42f8b1(_0x3287ed);})[_0xc220('0x21')](function(_0x44e361){logger[_0xc220('0x17')]('['+[_0x5818a5['toUpperCase']()]+']',_0x44e361[_0xc220('0x19')]);_0x3865e4(_0x44e361[_0xc220('0x19')]);});});};}function emit(_0x83999a,_0x5a90f9,_0x432229){var _0x2b8bae={'uri':_0x83999a+_0xc220('0x40')+_0x432229};io['to'](util[_0xc220('0x34')](_0xc220('0x41'),_0x5a90f9))[_0xc220('0x42')](_0xc220('0x43'),_0x2b8bae);}exports['cs']=function(_0x3261ea,_0x480412,_0x4b8097,_0x54ff09,_0x3b4b13,_0x3eceba,_0x184ba1,_0x186944){var _0x395822={};var _0x28ae56={'Authorization':_0xc220('0x44')+_0x3eceba[_0xc220('0x45')]};_0x3eceba[_0xc220('0x46')]=intUtil[_0xc220('0x47')](_0x3eceba['remoteUri']);_0x3eceba[_0xc220('0x48')]=intUtil[_0xc220('0x47')](_0x3eceba[_0xc220('0x48')]);var _0x160e1b=_0x3eceba[_0xc220('0x46')];_0x395822[_0xc220('0x13')]=_0x3eceba[_0xc220('0x49')];_0x395822[_0xc220('0x2b')]=_0x186944[_0xc220('0x4a')]()==='outbound'?_0x480412[_0xc220('0x4b')]:_0x480412[_0xc220('0x4c')];_0x395822['callDirection']=_0x186944===_0xc220('0x4d')||_0x186944===_0xc220('0x4e')?_0xc220('0x4d'):_0xc220('0x4f');if(_0x54ff09){_0x395822[_0xc220('0x1b')]=_0x54ff09[_0xc220('0x12')];}var _0x253f8c=util[_0xc220('0x34')](_0xc220('0x50'),_0x3eceba[_0xc220('0x48')],_0x480412['uniqueid'],md5(_0x480412[_0xc220('0x51')]));if(_0x3b4b13&&_0x3b4b13[_0xc220('0x52')]){logger[_0xc220('0xf')](_0xc220('0x53'),_0xc220('0x54'));_0x480412[_0xc220('0x55')]=_0x253f8c;}else if(_0x184ba1&&_0x184ba1[_0xc220('0x56')]&&_0x184ba1['recordingFormat']!==_0xc220('0x57')){logger['info']('[OUTBOUND]',_0xc220('0x54'));_0x480412[_0xc220('0x55')]=_0x253f8c;}else{_0x480412[_0xc220('0x55')]='';}return getAdminId(_0x395822,_0x186944,_0x28ae56,_0x160e1b)['then'](getUser(_0x186944,_0x28ae56,_0x160e1b))[_0xc220('0x23')](getEndUser(_0x186944,_0x28ae56,_0x160e1b))[_0xc220('0x23')](getTicket(_0x186944,_0x28ae56,_0x160e1b,_0x4b8097,_0x480412))[_0xc220('0x23')](function(_0x4ef2e3){logger[_0xc220('0xf')](util['format'](_0xc220('0x58'),_0x4ef2e3[_0xc220('0x59')]));if(_0x186944!=='abandoned'){logger[_0xc220('0xf')]('['+[_0x186944[_0xc220('0x18')]()]+']',_0xc220('0x5a'));emit(_0x160e1b,_0x54ff09['name'],_0x4ef2e3[_0xc220('0x31')]);}})[_0xc220('0x21')](function(_0x56d4ae){logger['error']('['+[_0x186944['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xc220('0x5b')](_0x56d4ae,{'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 1f9bbe1..bf8353b 100644 --- a/server/services/ami/trigger/integration/index.js +++ b/server/services/ami/trigger/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x4e465c,_0x3a04fe){var _0x35d4d2=function(_0x439241){while(--_0x439241){_0x4e465c['push'](_0x4e465c['shift']());}};_0x35d4d2(++_0x3a04fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ No newline at end of file +var _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x58e58b,_0x30e814){var _0xbc30ae=function(_0x1c738a){while(--_0x1c738a){_0x58e58b['push'](_0x58e58b['shift']());}};_0xbc30ae(++_0x30e814);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js index 9c73ae6..bf2079d 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 _0xfb2a=['moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','lead','Company','No\x20Company','forEach','idField','content','toString','variableName','type','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','uniqueid','recordingURL','email','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','stringify','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','error','Salesforce\x20account\x20type\x20not\x20recognized','catch','abandoned','calleridname','calleridnum','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','[ABANDONED]','lodash','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','ticketType','Task','assign','getString','Subjects','Descriptions','WhoId','ContactId','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','Lead','contact','Case','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s'];(function(_0x21bfab,_0x2fee48){var _0x4db318=function(_0x10396d){while(--_0x10396d){_0x21bfab['push'](_0x21bfab['shift']());}};_0x4db318(++_0x2fee48);}(_0xfb2a,0x11f));var _0xafb2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfb2a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xafb2('0x0'));var rp=require('request-promise');var moment=require(_0xafb2('0x1'));var BPromise=require(_0xafb2('0x2'));var md5=require(_0xafb2('0x3'));var jsforce=require(_0xafb2('0x4'));var util=require('util');var Redis=require(_0xafb2('0x5'));var intUtil=require(_0xafb2('0x6'));var config=require(_0xafb2('0x7'));var logger=require(_0xafb2('0x8'))('salesforce');config[_0xafb2('0x9')]=_['defaults'](config[_0xafb2('0x9')],{'host':_0xafb2('0xa'),'port':0x18eb});var io=require(_0xafb2('0xb'))(new Redis(config[_0xafb2('0x9')]));function emit(_0x10d57c,_0xc8dfb6,_0xa9889){io['to'](_0x10d57c)[_0xafb2('0xc')](_0xc8dfb6,_0xa9889);}function getTicket(_0x20e618,_0x581489,_0x5f2889,_0x42d5be,_0x2e6c4e,_0x1ee7ca,_0x264665,_0x283400){var _0x14d1e8={};if(_0x42d5be[_0xafb2('0xd')]===_0xafb2('0xe')){_0x14d1e8=Object[_0xafb2('0xf')]({},{'OwnerId':_0x581489['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xafb2('0x10')](_0x42d5be[_0xafb2('0x11')],_0x2e6c4e,'\x20'),'Description':intUtil[_0xafb2('0x10')](_0x42d5be[_0xafb2('0x12')],_0x2e6c4e,'\x0a')},getCustomFields(_0x1ee7ca,_0x2e6c4e));if(_0x5f2889){_0x14d1e8[_0xafb2('0x13')]=_0x5f2889['id'];}}else if(_0x42d5be[_0xafb2('0xd')]==='Case'){_0x14d1e8=Object[_0xafb2('0xf')]({},{'OwnerId':_0x581489['id'],'Subject':intUtil[_0xafb2('0x10')](_0x42d5be['Subjects'],_0x2e6c4e,'\x20'),'Description':intUtil[_0xafb2('0x10')](_0x42d5be[_0xafb2('0x12')],_0x2e6c4e,'\x0a')},getCustomFields(_0x1ee7ca,_0x2e6c4e));if(_0x5f2889){_0x14d1e8[_0xafb2('0x14')]=_0x5f2889['id'];}}return _0x264665[_0xafb2('0x15')](_0x42d5be['ticketType'])[_0xafb2('0x16')](_0x14d1e8);}function getUser(_0x57dd9a,_0x348111,_0x4a8f51){if(!_[_0xafb2('0x17')](_0x348111)&&intUtil[_0xafb2('0x18')](_0x348111)){var _0x9ac771={'Email':_0x348111};var _0x37f922={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4a8f51[_0xafb2('0x15')](_0xafb2('0x19'))[_0xafb2('0x1a')](_0x9ac771,_0x37f922)[_0xafb2('0x1b')]()[_0xafb2('0x1c')](function(_0x20bc9f){if(_0x20bc9f[_0xafb2('0x1d')]){var _0x49db8b=_[_0xafb2('0x1a')](_0x20bc9f,function(_0x2666f0){return _0x2666f0[_0xafb2('0x1e')]===_0x348111;});if(_0x49db8b){logger[_0xafb2('0x1f')](_0xafb2('0x20'),_0x348111);return BPromise['resolve']({'id':_0x49db8b['Id'],'name':_0x49db8b[_0xafb2('0x21')]});}}else{logger[_0xafb2('0x1f')](_0xafb2('0x22'),_0x348111);return _0x4a8f51[_0xafb2('0x23')]()[_0xafb2('0x1c')](function(_0x46d473){return BPromise[_0xafb2('0x24')]({'id':_0x46d473[_0xafb2('0x25')],'name':_0x46d473[_0xafb2('0x26')]});});}});}else{logger['info'](_0xafb2('0x22'),_0x348111);return _0x4a8f51['identity']()[_0xafb2('0x1c')](function(_0x2d127f){return BPromise[_0xafb2('0x24')]({'id':_0x2d127f[_0xafb2('0x25')],'name':_0x2d127f['display_name']});});}}function getEndUser(_0x408a86,_0xda2bc2,_0x2ec556,_0x44c87d,_0x174cdc){var _0xbc8e10={'Phone':_0x44c87d};var _0x1bb43b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xafb2('0x24')]()[_0xafb2('0x1c')](function(){if(_0xda2bc2[_0xafb2('0xd')]==='Task'){logger[_0xafb2('0x1f')](_0xafb2('0x27'),_0x44c87d,_0xda2bc2[_0xafb2('0x28')]);switch(_0xda2bc2[_0xafb2('0x28')]){case _0xafb2('0x29'):return _0x174cdc[_0xafb2('0x15')](_0xafb2('0x2a'))[_0xafb2('0x1a')](_0xbc8e10,_0x1bb43b)[_0xafb2('0x1b')]()[_0xafb2('0x1c')](function(_0x1d6c0a){if(_0x1d6c0a&&_0x1d6c0a[_0xafb2('0x1d')]){return _0x1d6c0a;}else{return _0x174cdc[_0xafb2('0x15')](_0xafb2('0x2b'))[_0xafb2('0x1a')](_0xbc8e10,_0x1bb43b);}});case _0xafb2('0x2c'):return _0x174cdc[_0xafb2('0x15')](_0xafb2('0x2a'))['find'](_0xbc8e10,_0x1bb43b)[_0xafb2('0x1b')]();case'lead':return _0x174cdc[_0xafb2('0x15')](_0xafb2('0x2b'))[_0xafb2('0x1a')](_0xbc8e10,_0x1bb43b);default:return null;}}else if(_0xda2bc2[_0xafb2('0xd')]===_0xafb2('0x2d')){logger[_0xafb2('0x1f')](_0xafb2('0x27'),_0x44c87d,_0xafb2('0x2c'));return _0x174cdc['sobject'](_0xafb2('0x2a'))[_0xafb2('0x1a')](_0xbc8e10,_0x1bb43b)[_0xafb2('0x1b')]();}})['then'](function(_0x25be45){if(_0x25be45&&_0x25be45[_0xafb2('0x1d')]){var _0x4f8c55=_[_0xafb2('0x1a')](_0x25be45,function(_0x23216e){return _0x23216e['Phone']===_0x44c87d;});if(_0x4f8c55){return BPromise[_0xafb2('0x24')]({'id':_0x4f8c55['Id'],'name':_0x4f8c55[_0xafb2('0x21')],'phone':_0x4f8c55[_0xafb2('0x2e')]});}}})[_0xafb2('0x1c')](function(_0x288e97){if(_0x288e97){logger[_0xafb2('0x1f')](_0xafb2('0x2f'),_0x44c87d);return BPromise[_0xafb2('0x24')](_0x288e97);}else{logger[_0xafb2('0x1f')](_0xafb2('0x30'),_0x44c87d);var _0x35efdd={'LastName':_0x2ec556!==_0xafb2('0x31')?_0x2ec556:util[_0xafb2('0x32')](_0xafb2('0x33'),_0x44c87d),'Phone':_0x44c87d};if(_0xda2bc2[_0xafb2('0x34')]){if(_0xda2bc2[_0xafb2('0x34')]===_0xafb2('0x2c')){logger[_0xafb2('0x1f')](_0xafb2('0x35'),_0x44c87d,_0xda2bc2['moduleCreate']);}else if(_0xda2bc2[_0xafb2('0x34')]===_0xafb2('0x36')&&_0xda2bc2['ticketType']===_0xafb2('0xe')){logger['info'](_0xafb2('0x35'),_0x44c87d,_0xda2bc2[_0xafb2('0x34')]);_0x35efdd[_0xafb2('0x37')]=_0xafb2('0x38');}else{return null;}}return _0x174cdc[_0xafb2('0x15')](_['upperFirst'](_0xda2bc2[_0xafb2('0x34')]))['create'](_0x35efdd);}});}function getCustomFields(_0x75d0c0,_0x44db31){var _0x203704={};if(_0x75d0c0['length']>0x0){_[_0xafb2('0x39')](_0x75d0c0,function(_0x3af010){if(_0x3af010['type']==='string'&&_0x3af010[_0xafb2('0x3a')]){_0x203704[_0x3af010[_0xafb2('0x3a')]]=_0x3af010[_0xafb2('0x3b')][_0xafb2('0x3c')]();}else if(_0x3af010['type']==='variable'&&_0x3af010[_0xafb2('0x3d')]&&_0x3af010[_0xafb2('0x3a')]){_0x44db31[_0x3af010[_0xafb2('0x3d')]]&&(_0x203704[_0x3af010[_0xafb2('0x3a')]]=_0x44db31[_0x3af010[_0xafb2('0x3d')]][_0xafb2('0x3c')]());}else if(_0x3af010[_0xafb2('0x3e')]===_0xafb2('0x3f')&&_0x3af010[_0xafb2('0x40')]&&_0x3af010['Variable']['name']&&_0x3af010[_0xafb2('0x3a')]){_0x44db31[_0x3af010['Variable'][_0xafb2('0x41')]['toLowerCase']()]&&(_0x203704[_0x3af010[_0xafb2('0x3a')]]=_0x44db31[_0x3af010['Variable']['name'][_0xafb2('0x42')]()][_0xafb2('0x3c')]());}});}return _0x203704;}function getConnection(_0x329c97){var _0x3e6ac3=_0x329c97[_0xafb2('0x43')][_0xafb2('0x44')](_0x329c97[_0xafb2('0x45')]);var _0x898f63=new jsforce[(_0xafb2('0x46'))]({'oauth2':{'loginUrl':_0x329c97[_0xafb2('0x47')]||_0xafb2('0x48'),'clientId':_0x329c97[_0xafb2('0x49')],'clientSecret':_0x329c97['clientSecret']}});return _0x898f63[_0xafb2('0x4a')](_0x329c97['username'],_0x3e6ac3)[_0xafb2('0x1c')](function(){logger[_0xafb2('0x1f')]('Connection\x20established.');return _0x898f63;});}exports['queue']=function(_0x291e8f,_0x27615f,_0x303916,_0x4b2cbd,_0x5a1899,_0x2488cc){var _0x293d02,_0x435f9f,_0x5e3c7c,_0x4bc9ff;_0x2488cc['serverUrl']=intUtil[_0xafb2('0x4b')](_0x2488cc[_0xafb2('0x4c')]);_0x2488cc[_0xafb2('0x47')]=intUtil[_0xafb2('0x4b')](_0x2488cc[_0xafb2('0x47')]);if(_0x5a1899&&_0x5a1899[_0xafb2('0x4d')]){logger[_0xafb2('0x1f')](_0xafb2('0x4e'),'Recording\x20is\x20enabled!');_0x27615f['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2488cc[_0xafb2('0x4c')],_0x27615f[_0xafb2('0x4f')],md5(_0x27615f['uniqueid']));}else{_0x27615f[_0xafb2('0x50')]='';}return getConnection(_0x2488cc)[_0xafb2('0x1c')](function(_0x2ee9bc){_0x4bc9ff=_0x2ee9bc;return getUser(_0x2488cc,_0x4b2cbd[_0xafb2('0x51')],_0x4bc9ff);})[_0xafb2('0x1c')](function(_0x4778f4){_0x293d02=_0x4778f4;return getEndUser(_0x2488cc,_0x303916,_0x27615f['calleridname'],_0x27615f['calleridnum'],_0x4bc9ff);})[_0xafb2('0x1c')](function(_0x17cc27){_0x435f9f=_0x17cc27;return getTicket(_0x2488cc,_0x293d02,_0x435f9f,_0x303916,_0x27615f,_0x303916['Fields'],_0x4bc9ff,_0xafb2('0x52'));})[_0xafb2('0x1c')](function(_0x4c2297){_0x5e3c7c=_0x4c2297;logger[_0xafb2('0x1f')](_0xafb2('0x53'),_0x5e3c7c['id']);logger['info'](_0xafb2('0x54'),_0x5e3c7c['id'],_0x4b2cbd[_0xafb2('0x41')],_0x2488cc['type']);switch(_0x2488cc[_0xafb2('0x3e')]){case _0xafb2('0x55'):emit(util[_0xafb2('0x32')](_0xafb2('0x56'),_0x4b2cbd[_0xafb2('0x41')]),_0xafb2('0x57'),{'recordId':_0x5e3c7c['id']});break;case _0xafb2('0x58'):emit(util[_0xafb2('0x32')](_0xafb2('0x56'),_0x4b2cbd[_0xafb2('0x41')]),_0xafb2('0x59'),{'uri':util[_0xafb2('0x32')]('%s/%s/e',_0x4bc9ff[_0xafb2('0x5a')],_0x5e3c7c['id'])});break;default:logger['error'](_0xafb2('0x5b'));}})['catch'](function(_0x3ec5dc){logger['error']('[QUEUE]',JSON[_0xafb2('0x5c')](_0x3ec5dc));});};exports[_0xafb2('0x5d')]=function(_0x43f7ed,_0x2933ba,_0x47b8ef,_0x421f01,_0x49e3e5,_0x6bc34e,_0x25ca49){var _0x20c1f5,_0x58875f,_0x5d77a7,_0x3e9ece;_0x6bc34e[_0xafb2('0x4c')]=intUtil[_0xafb2('0x4b')](_0x6bc34e[_0xafb2('0x4c')]);_0x6bc34e[_0xafb2('0x47')]=intUtil[_0xafb2('0x4b')](_0x6bc34e['remoteUri']);if(_0x25ca49&&_0x25ca49[_0xafb2('0x5e')]&&_0x25ca49[_0xafb2('0x5e')]!==_0xafb2('0x5f')){logger[_0xafb2('0x1f')](_0xafb2('0x60'),_0xafb2('0x61'));_0x2933ba['recordingURL']=util[_0xafb2('0x32')](_0xafb2('0x62'),_0x6bc34e[_0xafb2('0x4c')],_0x2933ba['uniqueid'],md5(_0x2933ba[_0xafb2('0x4f')]));}return getConnection(_0x6bc34e)['then'](function(_0x2abe28){_0x3e9ece=_0x2abe28;return getUser(_0x6bc34e,_0x421f01['email'],_0x3e9ece);})[_0xafb2('0x1c')](function(_0x557720){_0x20c1f5=_0x557720;return getEndUser(_0x6bc34e,_0x47b8ef,_0x2933ba['destcalleridname'],_0x2933ba[_0xafb2('0x63')],_0x3e9ece);})[_0xafb2('0x1c')](function(_0x29e7d5){_0x58875f=_0x29e7d5;return getTicket(_0x6bc34e,_0x20c1f5,_0x58875f,_0x47b8ef,_0x2933ba,_0x47b8ef[_0xafb2('0x64')],_0x3e9ece,'outbound');})[_0xafb2('0x1c')](function(_0x4cf81c){_0x5d77a7=_0x4cf81c;logger[_0xafb2('0x1f')](_0xafb2('0x65'),_0x5d77a7['id']);logger['info'](_0xafb2('0x66'),_0x5d77a7['id'],_0x421f01[_0xafb2('0x41')],_0x6bc34e[_0xafb2('0x3e')]);switch(_0x6bc34e[_0xafb2('0x3e')]){case _0xafb2('0x55'):emit(util[_0xafb2('0x32')](_0xafb2('0x56'),_0x421f01[_0xafb2('0x41')]),'trigger:salesforce:display',{'recordId':_0x5d77a7['id']});break;case'newTab':emit(util[_0xafb2('0x32')](_0xafb2('0x56'),_0x421f01['name']),_0xafb2('0x59'),{'uri':util[_0xafb2('0x32')](_0xafb2('0x67'),_0x3e9ece['instanceUrl'],_0x5d77a7['id'])});break;default:logger[_0xafb2('0x68')](_0xafb2('0x60'),_0xafb2('0x69'));}})[_0xafb2('0x6a')](function(_0x32b8c6){logger[_0xafb2('0x68')](_0xafb2('0x60'),JSON[_0xafb2('0x5c')](_0x32b8c6));});};exports[_0xafb2('0x6b')]=function(_0x52b590,_0x1a8ec7,_0x1fbf0d,_0x58f1bb,_0x2156c5,_0x2506f5){var _0x25b498,_0x52fdc8,_0x20a0a7,_0x12b0a9;_0x2506f5['serverUrl']=intUtil[_0xafb2('0x4b')](_0x2506f5['serverUrl']);_0x2506f5[_0xafb2('0x47')]=intUtil['stripTrailingSlash'](_0x2506f5[_0xafb2('0x47')]);if(_0x2156c5&&_0x2156c5['monitor_format']){logger[_0xafb2('0x1f')]('[ABANDONED]',_0xafb2('0x61'));_0x1a8ec7[_0xafb2('0x50')]=util[_0xafb2('0x32')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2506f5[_0xafb2('0x4c')],_0x1a8ec7['uniqueid'],md5(_0x1a8ec7['uniqueid']));}else{_0x1a8ec7[_0xafb2('0x50')]='';}return getConnection(_0x2506f5)[_0xafb2('0x1c')](function(_0x2dc1f7){_0x12b0a9=_0x2dc1f7;if(!_[_0xafb2('0x17')](_0x58f1bb)){return getUser(_0x2506f5,_0x58f1bb[_0xafb2('0x41')],_0x12b0a9);}else{return getUser(_0x2506f5,null,_0x12b0a9);}})[_0xafb2('0x1c')](function(_0x54bb3a){_0x25b498=_0x54bb3a;return getEndUser(_0x2506f5,_0x1fbf0d,_0x1a8ec7[_0xafb2('0x6c')],_0x1a8ec7[_0xafb2('0x6d')],_0x12b0a9);})[_0xafb2('0x1c')](function(_0x4727ff){_0x52fdc8=_0x4727ff;return getTicket(_0x2506f5,_0x25b498,_0x52fdc8,_0x1fbf0d,_0x1a8ec7,_0x1fbf0d[_0xafb2('0x64')],_0x12b0a9);})[_0xafb2('0x1c')](function(_0x3d5de9){_0x20a0a7=_0x3d5de9;logger[_0xafb2('0x1f')](_0xafb2('0x6e'),_0x20a0a7['id']);logger[_0xafb2('0x1f')](_0xafb2('0x6f'),_0x2506f5[_0xafb2('0x3e')]);})[_0xafb2('0x6a')](function(_0x202ba2){logger[_0xafb2('0x68')](_0xafb2('0x70'),JSON[_0xafb2('0x5c')](_0x202ba2));});}; \ No newline at end of file +var _0xdeb0=['jsforce','ioredis','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','emit','Task','assign','utc','getString','Subjects','Descriptions','WhoId','ticketType','ContactId','sobject','isNil','validateEmail','find','then','Email','info','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','moduleSearch','contact_lead','Contact','length','contact','execute','lead','Lead','Case','Name','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','create','forEach','type','string','idField','content','toString','variable','variableName','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','stringify','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','[ABANDONED]','calleridnum','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5'];(function(_0x20713e,_0x44f710){var _0x7d998b=function(_0x5d98ab){while(--_0x5d98ab){_0x20713e['push'](_0x20713e['shift']());}};_0x7d998b(++_0x44f710);}(_0xdeb0,0xdc));var _0x0deb=function(_0x11f226,_0x491e30){_0x11f226=_0x11f226-0x0;var _0x30be77=_0xdeb0[_0x11f226];return _0x30be77;};'use strict';var _=require('lodash');var rp=require(_0x0deb('0x0'));var moment=require(_0x0deb('0x1'));var BPromise=require(_0x0deb('0x2'));var md5=require(_0x0deb('0x3'));var jsforce=require(_0x0deb('0x4'));var util=require('util');var Redis=require(_0x0deb('0x5'));var intUtil=require('./util');var config=require(_0x0deb('0x6'));var logger=require(_0x0deb('0x7'))(_0x0deb('0x8'));config[_0x0deb('0x9')]=_[_0x0deb('0xa')](config[_0x0deb('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x0deb('0xb'))(new Redis(config[_0x0deb('0x9')]));function emit(_0x67fb83,_0x47217b,_0x2af2c0){io['to'](_0x67fb83)[_0x0deb('0xc')](_0x47217b,_0x2af2c0);}function getTicket(_0x116fe0,_0x4f1b28,_0x2de16f,_0x1058a7,_0x294891,_0x552901,_0x7af4dc,_0x1e9b72){var _0x585b5c={};if(_0x1058a7['ticketType']===_0x0deb('0xd')){_0x585b5c=Object[_0x0deb('0xe')]({},{'OwnerId':_0x4f1b28['id'],'ActivityDate':moment[_0x0deb('0xf')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x0deb('0x10')](_0x1058a7[_0x0deb('0x11')],_0x294891,'\x20'),'Description':intUtil[_0x0deb('0x10')](_0x1058a7[_0x0deb('0x12')],_0x294891,'\x0a')},getCustomFields(_0x552901,_0x294891));if(_0x2de16f){_0x585b5c[_0x0deb('0x13')]=_0x2de16f['id'];}}else if(_0x1058a7[_0x0deb('0x14')]==='Case'){_0x585b5c=Object[_0x0deb('0xe')]({},{'OwnerId':_0x4f1b28['id'],'Subject':intUtil[_0x0deb('0x10')](_0x1058a7[_0x0deb('0x11')],_0x294891,'\x20'),'Description':intUtil[_0x0deb('0x10')](_0x1058a7[_0x0deb('0x12')],_0x294891,'\x0a')},getCustomFields(_0x552901,_0x294891));if(_0x2de16f){_0x585b5c[_0x0deb('0x15')]=_0x2de16f['id'];}}return _0x7af4dc[_0x0deb('0x16')](_0x1058a7[_0x0deb('0x14')])['create'](_0x585b5c);}function getUser(_0x5e4b97,_0x1301a2,_0x321bbd){if(!_[_0x0deb('0x17')](_0x1301a2)&&intUtil[_0x0deb('0x18')](_0x1301a2)){var _0x54e08d={'Email':_0x1301a2};var _0x351842={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x321bbd[_0x0deb('0x16')]('User')[_0x0deb('0x19')](_0x54e08d,_0x351842)['execute']()[_0x0deb('0x1a')](function(_0x47bfca){if(_0x47bfca['length']){var _0x507995=_[_0x0deb('0x19')](_0x47bfca,function(_0xee4a0a){return _0xee4a0a[_0x0deb('0x1b')]===_0x1301a2;});if(_0x507995){logger[_0x0deb('0x1c')](_0x0deb('0x1d'),_0x1301a2);return BPromise[_0x0deb('0x1e')]({'id':_0x507995['Id'],'name':_0x507995['Name']});}}else{logger[_0x0deb('0x1c')](_0x0deb('0x1f'),_0x1301a2);return _0x321bbd[_0x0deb('0x20')]()['then'](function(_0x469e82){return BPromise[_0x0deb('0x1e')]({'id':_0x469e82[_0x0deb('0x21')],'name':_0x469e82['display_name']});});}});}else{logger[_0x0deb('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x1301a2);return _0x321bbd[_0x0deb('0x20')]()['then'](function(_0x3ec9de){return BPromise[_0x0deb('0x1e')]({'id':_0x3ec9de[_0x0deb('0x21')],'name':_0x3ec9de['display_name']});});}}function getEndUser(_0x510bd1,_0x4d6fe8,_0xf8c3e7,_0x155691,_0x3e41fb){var _0x2d1e11={'Phone':_0x155691};var _0xef039f={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x0deb('0x1e')]()[_0x0deb('0x1a')](function(){if(_0x4d6fe8['ticketType']==='Task'){logger[_0x0deb('0x1c')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x155691,_0x4d6fe8['moduleSearch']);switch(_0x4d6fe8[_0x0deb('0x22')]){case _0x0deb('0x23'):return _0x3e41fb[_0x0deb('0x16')](_0x0deb('0x24'))[_0x0deb('0x19')](_0x2d1e11,_0xef039f)['execute']()[_0x0deb('0x1a')](function(_0x3e125a){if(_0x3e125a&&_0x3e125a[_0x0deb('0x25')]){return _0x3e125a;}else{return _0x3e41fb['sobject']('Lead')[_0x0deb('0x19')](_0x2d1e11,_0xef039f);}});case _0x0deb('0x26'):return _0x3e41fb[_0x0deb('0x16')]('Contact')['find'](_0x2d1e11,_0xef039f)[_0x0deb('0x27')]();case _0x0deb('0x28'):return _0x3e41fb['sobject'](_0x0deb('0x29'))['find'](_0x2d1e11,_0xef039f);default:return null;}}else if(_0x4d6fe8['ticketType']===_0x0deb('0x2a')){logger[_0x0deb('0x1c')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x155691,_0x0deb('0x26'));return _0x3e41fb['sobject'](_0x0deb('0x24'))[_0x0deb('0x19')](_0x2d1e11,_0xef039f)['execute']();}})[_0x0deb('0x1a')](function(_0x396122){if(_0x396122&&_0x396122['length']){var _0x3a414f=_[_0x0deb('0x19')](_0x396122,function(_0xbcbcbc){return _0xbcbcbc['Phone']===_0x155691;});if(_0x3a414f){return BPromise[_0x0deb('0x1e')]({'id':_0x3a414f['Id'],'name':_0x3a414f[_0x0deb('0x2b')],'phone':_0x3a414f[_0x0deb('0x2c')]});}}})[_0x0deb('0x1a')](function(_0xa4ae47){if(_0xa4ae47){logger['info'](_0x0deb('0x2d'),_0x155691);return BPromise[_0x0deb('0x1e')](_0xa4ae47);}else{logger[_0x0deb('0x1c')](_0x0deb('0x2e'),_0x155691);var _0x54ca51={'LastName':_0xf8c3e7!==_0x0deb('0x2f')?_0xf8c3e7:util[_0x0deb('0x30')](_0x0deb('0x31'),_0x155691),'Phone':_0x155691};if(_0x4d6fe8['moduleCreate']){if(_0x4d6fe8[_0x0deb('0x32')]===_0x0deb('0x26')){logger['info'](_0x0deb('0x33'),_0x155691,_0x4d6fe8['moduleCreate']);}else if(_0x4d6fe8[_0x0deb('0x32')]===_0x0deb('0x28')&&_0x4d6fe8['ticketType']===_0x0deb('0xd')){logger[_0x0deb('0x1c')](_0x0deb('0x33'),_0x155691,_0x4d6fe8['moduleCreate']);_0x54ca51[_0x0deb('0x34')]='No\x20Company';}else{return null;}}return _0x3e41fb[_0x0deb('0x16')](_[_0x0deb('0x35')](_0x4d6fe8['moduleCreate']))[_0x0deb('0x36')](_0x54ca51);}});}function getCustomFields(_0x5256ea,_0x4d4454){var _0x10dc5d={};if(_0x5256ea['length']>0x0){_[_0x0deb('0x37')](_0x5256ea,function(_0xa8ea28){if(_0xa8ea28[_0x0deb('0x38')]===_0x0deb('0x39')&&_0xa8ea28[_0x0deb('0x3a')]){_0x10dc5d[_0xa8ea28[_0x0deb('0x3a')]]=_0xa8ea28[_0x0deb('0x3b')][_0x0deb('0x3c')]();}else if(_0xa8ea28[_0x0deb('0x38')]===_0x0deb('0x3d')&&_0xa8ea28[_0x0deb('0x3e')]&&_0xa8ea28[_0x0deb('0x3a')]){_0x4d4454[_0xa8ea28['variableName']]&&(_0x10dc5d[_0xa8ea28[_0x0deb('0x3a')]]=_0x4d4454[_0xa8ea28[_0x0deb('0x3e')]][_0x0deb('0x3c')]());}else if(_0xa8ea28[_0x0deb('0x38')]==='customVariable'&&_0xa8ea28[_0x0deb('0x3f')]&&_0xa8ea28[_0x0deb('0x3f')][_0x0deb('0x40')]&&_0xa8ea28[_0x0deb('0x3a')]){_0x4d4454[_0xa8ea28[_0x0deb('0x3f')]['name'][_0x0deb('0x41')]()]&&(_0x10dc5d[_0xa8ea28[_0x0deb('0x3a')]]=_0x4d4454[_0xa8ea28[_0x0deb('0x3f')][_0x0deb('0x40')][_0x0deb('0x41')]()][_0x0deb('0x3c')]());}});}return _0x10dc5d;}function getConnection(_0x408b0b){var _0x1fb724=_0x408b0b[_0x0deb('0x42')][_0x0deb('0x43')](_0x408b0b[_0x0deb('0x44')]);var _0x5a820a=new jsforce[(_0x0deb('0x45'))]({'oauth2':{'loginUrl':_0x408b0b[_0x0deb('0x46')]||_0x0deb('0x47'),'clientId':_0x408b0b['clientId'],'clientSecret':_0x408b0b['clientSecret']}});return _0x5a820a[_0x0deb('0x48')](_0x408b0b[_0x0deb('0x49')],_0x1fb724)['then'](function(){logger['info'](_0x0deb('0x4a'));return _0x5a820a;});}exports['queue']=function(_0x5a5cd4,_0x241d49,_0x187681,_0x187844,_0x4d3463,_0x13b703){var _0x4f5488,_0x4b2d30,_0x1fe562,_0x26f467;_0x13b703[_0x0deb('0x4b')]=intUtil[_0x0deb('0x4c')](_0x13b703[_0x0deb('0x4b')]);_0x13b703[_0x0deb('0x46')]=intUtil['stripTrailingSlash'](_0x13b703[_0x0deb('0x46')]);if(_0x4d3463&&_0x4d3463[_0x0deb('0x4d')]){logger[_0x0deb('0x1c')]('[QUEUE]','Recording\x20is\x20enabled!');_0x241d49[_0x0deb('0x4e')]=util[_0x0deb('0x30')](_0x0deb('0x4f'),_0x13b703[_0x0deb('0x4b')],_0x241d49[_0x0deb('0x50')],md5(_0x241d49[_0x0deb('0x50')]));}else{_0x241d49[_0x0deb('0x4e')]='';}return getConnection(_0x13b703)[_0x0deb('0x1a')](function(_0x44594f){_0x26f467=_0x44594f;return getUser(_0x13b703,_0x187844[_0x0deb('0x51')],_0x26f467);})[_0x0deb('0x1a')](function(_0x3e31fa){_0x4f5488=_0x3e31fa;return getEndUser(_0x13b703,_0x187681,_0x241d49[_0x0deb('0x52')],_0x241d49['calleridnum'],_0x26f467);})[_0x0deb('0x1a')](function(_0x967bd8){_0x4b2d30=_0x967bd8;return getTicket(_0x13b703,_0x4f5488,_0x4b2d30,_0x187681,_0x241d49,_0x187681[_0x0deb('0x53')],_0x26f467,_0x0deb('0x54'));})[_0x0deb('0x1a')](function(_0x123eda){_0x1fe562=_0x123eda;logger[_0x0deb('0x1c')](_0x0deb('0x55'),_0x1fe562['id']);logger[_0x0deb('0x1c')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1fe562['id'],_0x187844[_0x0deb('0x40')],_0x13b703[_0x0deb('0x38')]);switch(_0x13b703[_0x0deb('0x38')]){case _0x0deb('0x56'):emit(util[_0x0deb('0x30')]('user:%s',_0x187844[_0x0deb('0x40')]),'trigger:salesforce:display',{'recordId':_0x1fe562['id']});break;case _0x0deb('0x57'):emit(util['format'](_0x0deb('0x58'),_0x187844[_0x0deb('0x40')]),_0x0deb('0x59'),{'uri':util['format'](_0x0deb('0x5a'),_0x26f467[_0x0deb('0x5b')],_0x1fe562['id'])});break;default:logger[_0x0deb('0x5c')](_0x0deb('0x5d'));}})[_0x0deb('0x5e')](function(_0x115c9c){logger[_0x0deb('0x5c')](_0x0deb('0x5f'),JSON[_0x0deb('0x60')](_0x115c9c));});};exports[_0x0deb('0x61')]=function(_0x481beb,_0xce65cb,_0x582803,_0x2aa278,_0x3daa2b,_0x62dfdd,_0x41315d){var _0x302424,_0x4a2438,_0x16b9e1,_0x1cfc56;_0x62dfdd[_0x0deb('0x4b')]=intUtil[_0x0deb('0x4c')](_0x62dfdd[_0x0deb('0x4b')]);_0x62dfdd[_0x0deb('0x46')]=intUtil['stripTrailingSlash'](_0x62dfdd[_0x0deb('0x46')]);if(_0x41315d&&_0x41315d[_0x0deb('0x62')]&&_0x41315d['recordingFormat']!==_0x0deb('0x63')){logger[_0x0deb('0x1c')](_0x0deb('0x64'),_0x0deb('0x65'));_0xce65cb[_0x0deb('0x4e')]=util[_0x0deb('0x30')](_0x0deb('0x4f'),_0x62dfdd[_0x0deb('0x4b')],_0xce65cb[_0x0deb('0x50')],md5(_0xce65cb[_0x0deb('0x50')]));}return getConnection(_0x62dfdd)['then'](function(_0xb219d8){_0x1cfc56=_0xb219d8;return getUser(_0x62dfdd,_0x2aa278[_0x0deb('0x51')],_0x1cfc56);})[_0x0deb('0x1a')](function(_0x64cd11){_0x302424=_0x64cd11;return getEndUser(_0x62dfdd,_0x582803,_0xce65cb[_0x0deb('0x66')],_0xce65cb[_0x0deb('0x67')],_0x1cfc56);})[_0x0deb('0x1a')](function(_0x2a9038){_0x4a2438=_0x2a9038;return getTicket(_0x62dfdd,_0x302424,_0x4a2438,_0x582803,_0xce65cb,_0x582803[_0x0deb('0x53')],_0x1cfc56,_0x0deb('0x61'));})['then'](function(_0x4979f8){_0x16b9e1=_0x4979f8;logger['info'](_0x0deb('0x68'),_0x16b9e1['id']);logger[_0x0deb('0x1c')](_0x0deb('0x69'),_0x16b9e1['id'],_0x2aa278[_0x0deb('0x40')],_0x62dfdd['type']);switch(_0x62dfdd['type']){case _0x0deb('0x56'):emit(util[_0x0deb('0x30')](_0x0deb('0x58'),_0x2aa278[_0x0deb('0x40')]),_0x0deb('0x6a'),{'recordId':_0x16b9e1['id']});break;case _0x0deb('0x57'):emit(util[_0x0deb('0x30')](_0x0deb('0x58'),_0x2aa278[_0x0deb('0x40')]),_0x0deb('0x59'),{'uri':util[_0x0deb('0x30')](_0x0deb('0x5a'),_0x1cfc56[_0x0deb('0x5b')],_0x16b9e1['id'])});break;default:logger[_0x0deb('0x5c')](_0x0deb('0x64'),_0x0deb('0x6b'));}})[_0x0deb('0x5e')](function(_0x7e111e){logger[_0x0deb('0x5c')](_0x0deb('0x64'),JSON[_0x0deb('0x60')](_0x7e111e));});};exports['abandoned']=function(_0x505ce1,_0x5b82b5,_0xe9145b,_0x5674c9,_0x25a7ad,_0x5a5d60){var _0x3012a0,_0x21b0e1,_0x1b6cd6,_0x32bb91;_0x5a5d60[_0x0deb('0x4b')]=intUtil[_0x0deb('0x4c')](_0x5a5d60[_0x0deb('0x4b')]);_0x5a5d60[_0x0deb('0x46')]=intUtil[_0x0deb('0x4c')](_0x5a5d60[_0x0deb('0x46')]);if(_0x25a7ad&&_0x25a7ad['monitor_format']){logger[_0x0deb('0x1c')](_0x0deb('0x6c'),_0x0deb('0x65'));_0x5b82b5[_0x0deb('0x4e')]=util[_0x0deb('0x30')](_0x0deb('0x4f'),_0x5a5d60['serverUrl'],_0x5b82b5[_0x0deb('0x50')],md5(_0x5b82b5[_0x0deb('0x50')]));}else{_0x5b82b5[_0x0deb('0x4e')]='';}return getConnection(_0x5a5d60)[_0x0deb('0x1a')](function(_0x537244){_0x32bb91=_0x537244;if(!_[_0x0deb('0x17')](_0x5674c9)){return getUser(_0x5a5d60,_0x5674c9[_0x0deb('0x40')],_0x32bb91);}else{return getUser(_0x5a5d60,null,_0x32bb91);}})[_0x0deb('0x1a')](function(_0x3467ac){_0x3012a0=_0x3467ac;return getEndUser(_0x5a5d60,_0xe9145b,_0x5b82b5[_0x0deb('0x52')],_0x5b82b5[_0x0deb('0x6d')],_0x32bb91);})['then'](function(_0x4b07aa){_0x21b0e1=_0x4b07aa;return getTicket(_0x5a5d60,_0x3012a0,_0x21b0e1,_0xe9145b,_0x5b82b5,_0xe9145b['Fields'],_0x32bb91);})[_0x0deb('0x1a')](function(_0x48fc17){_0x1b6cd6=_0x48fc17;logger[_0x0deb('0x1c')](_0x0deb('0x6e'),_0x1b6cd6['id']);logger['info'](_0x0deb('0x6f'),_0x5a5d60[_0x0deb('0x38')]);})['catch'](function(_0x7bbc12){logger['error'](_0x0deb('0x6c'),JSON[_0x0deb('0x60')](_0x7bbc12));});}; \ 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 2ff8e57..acf9a4f 100644 --- a/server/services/ami/trigger/integration/servicenow.js +++ b/server/services/ami/trigger/integration/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index 0ce2c0e..72c3027 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 _0x59b5=['length','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','type','customField','content','variable','custom_fields','customVariable','Variable','toLowerCase','username','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Outbound','contacts','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','error','abandoned','monitor_format','[ABANDONED]','calleridnum','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','description','Descriptions','date_start','toISOString','slice','parent_id','parent_type','Contacts','parent_name','direction','forEach','variableName','push','idField','JSON','Calls','format','apiKey','toString','base64','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','then','entry_list','name_value_list','user_name','value','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0x59b5,0x123));var _0x559b=function(_0x21eeb3,_0x47e1ee){_0x21eeb3=_0x21eeb3-0x0;var _0x55433b=_0x59b5[_0x21eeb3];return _0x55433b;};'use strict';var _=require('lodash');var rp=require(_0x559b('0x0'));var BPromise=require('bluebird');var md5=require(_0x559b('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x559b('0x2'));var config=require(_0x559b('0x3'));var logger=require(_0x559b('0x4'))(_0x559b('0x5'));config[_0x559b('0x6')]=_[_0x559b('0x7')](config[_0x559b('0x6')],{'host':_0x559b('0x8'),'port':0x18eb});var io=require(_0x559b('0x9'))(new Redis(config[_0x559b('0x6')]));var def={'method':_0x559b('0xa'),'json':!![]};function emit(_0x16c10,_0x1226c9,_0x184aa1){io['to'](_0x16c10)[_0x559b('0xb')](_0x1226c9,_0x184aa1);}function getTicket(_0x5d49e9,_0x41100d,_0x24471f,_0x13d2f5,_0x75f9d,_0x5da0da,_0x2bb8a7,_0x4b23c0){logger[_0x559b('0xc')](_0x559b('0xd'));var _0xccdf0=new Date();var _0x150837=[{'name':_0x559b('0xe'),'value':intUtil[_0x559b('0xf')](_0x13d2f5['Subjects'],_0x75f9d,'\x20')},{'name':_0x559b('0x10'),'value':_0x41100d['id']},{'name':'created_by','value':_0x41100d['id']},{'name':_0x559b('0x11'),'value':intUtil[_0x559b('0xf')](_0x13d2f5[_0x559b('0x12')],_0x75f9d,'\x0a')},{'name':_0x559b('0x13'),'value':_0xccdf0[_0x559b('0x14')]()[_0x559b('0x15')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x559b('0x16'),'value':_0x24471f['id']},{'name':_0x559b('0x17'),'value':_0x559b('0x18')},{'name':_0x559b('0x19'),'value':_0x24471f[_0x559b('0xe')]},{'name':_0x559b('0x1a'),'value':_0x4b23c0}];if(_0x5da0da['length']){_[_0x559b('0x1b')](_0x5da0da,function(_0x654e1e){if(_0x75f9d[_0x654e1e[_0x559b('0x1c')]]){_0x150837[_0x559b('0x1d')]({'name':_0x654e1e[_0x559b('0x1e')],'value':_0x75f9d[_0x654e1e[_0x559b('0x1c')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x559b('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2bb8a7['id'],'module_name':_0x559b('0x20'),'name_value_list':_0x150837})}});}function getAuth(_0x46a603){return util[_0x559b('0x21')]('Basic\x20%s',new Buffer(_0x46a603[_0x559b('0x22')]+':X')[_0x559b('0x23')](_0x559b('0x24')));}function getServerInfo(_0x3740ea){return request({'form':{'method':'get_server_info','input_type':_0x559b('0x1f'),'response_type':_0x559b('0x1f'),'rest_data':JSON[_0x559b('0x25')]({'session':_0x3740ea['id']})}});}function getUser(_0x396395,_0x168258,_0x40a4b6){if(!_[_0x559b('0x26')](_0x168258)){logger['info'](_0x559b('0x27'),_0x168258);return request({'form':{'method':_0x559b('0x28'),'input_type':_0x559b('0x1f'),'response_type':'JSON','rest_data':JSON[_0x559b('0x25')]({'session':_0x40a4b6['id'],'module_name':_0x559b('0x29'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x168258),'order_by':'','offset':'0','select_fields':['id',_0x559b('0xe'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x559b('0x2a')](function(_0x192ca1){if(_0x192ca1[_0x559b('0x2b')]['length']){var _0x53e8ec=_['find'](_0x192ca1[_0x559b('0x2b')],function(_0x5c8ffa){return _0x5c8ffa[_0x559b('0x2c')][_0x559b('0x2d')][_0x559b('0x2e')]===_0x168258;});if(_0x53e8ec){logger['info'](_0x559b('0x2f'));return BPromise['resolve']({'id':_0x53e8ec['name_value_list']['id'][_0x559b('0x2e')],'name':_0x53e8ec[_0x559b('0x2c')][_0x559b('0xe')][_0x559b('0x2e')]});}}logger['info'](_0x559b('0x30'));return BPromise[_0x559b('0x31')]({'id':_0x40a4b6[_0x559b('0x2c')][_0x559b('0x32')]['value'],'name':_0x40a4b6[_0x559b('0x2c')][_0x559b('0x2d')][_0x559b('0x2e')]});});}else{logger[_0x559b('0xc')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x40a4b6[_0x559b('0x2c')][_0x559b('0x32')]['value'],'name':_0x40a4b6[_0x559b('0x2c')]['user_name'][_0x559b('0x2e')]});}}function getEndUser(_0x2ac6e4,_0x4bef5a,_0x42db95,_0x43cd2c){logger['info'](_0x559b('0x33'),_0x42db95);return request({'form':{'method':'get_entry_list','input_type':_0x559b('0x1f'),'response_type':_0x559b('0x1f'),'rest_data':JSON[_0x559b('0x25')]({'session':_0x43cd2c['id'],'module_name':_0x559b('0x18'),'query':util[_0x559b('0x21')](_0x559b('0x34'),_0x42db95),'order_by':'','offset':'0','select_fields':['id','name',_0x559b('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x559b('0x2a')](function(_0x46a9f8){if(_0x46a9f8['entry_list'][_0x559b('0x36')]){var _0x293c6d=_[_0x559b('0x37')](_0x46a9f8[_0x559b('0x2b')],function(_0x169d66){return _0x169d66[_0x559b('0x2c')][_0x559b('0x35')]['value']===_0x42db95;});if(_0x293c6d){logger['info'](_0x559b('0x38'));return BPromise[_0x559b('0x31')]({'id':_0x293c6d[_0x559b('0x2c')]['id']['value'],'name':_0x293c6d[_0x559b('0x2c')][_0x559b('0xe')][_0x559b('0x2e')],'phone':_0x293c6d[_0x559b('0x2c')][_0x559b('0x35')][_0x559b('0x2e')]});}}else{logger[_0x559b('0xc')](_0x559b('0x39'));return request({'form':{'method':_0x559b('0x3a'),'input_type':_0x559b('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x43cd2c['id'],'module_name':'Contacts','name_value_list':[{'name':_0x559b('0x3b'),'value':_0x4bef5a!==_0x559b('0x3c')?_0x4bef5a:util[_0x559b('0x21')](_0x559b('0x3d'),_0x42db95)},{'name':_0x559b('0x35'),'value':_0x42db95}]})}})[_0x559b('0x2a')](function(_0x141dce){logger['info'](_0x559b('0x3e'));return BPromise[_0x559b('0x31')]({'id':_0x141dce['id'],'name':_0x141dce[_0x559b('0x2b')][_0x559b('0x3b')][_0x559b('0x2e')],'phone':_0x141dce[_0x559b('0x2b')][_0x559b('0x35')]['value']});});}});}function request(_0x223b37){logger[_0x559b('0x3f')](_0x559b('0x40'),JSON[_0x559b('0x25')](_0x223b37));return rp(_['merge'](def,_0x223b37));}function getTags(_0x4142d7,_0x2d2085){var _0x437584=[];if(_0x4142d7&&_0x4142d7[_0x559b('0x36')]>0x0){_0x437584=_['map'](_0x4142d7,_0x2d2085);}return _0x437584;}function getCustomFields(_0x195f0c,_0x1c32a7){var _0x43b304=[];var _0x25164a={'custom_fields':[]};if(_0x195f0c[_0x559b('0x36')]>0x0){_[_0x559b('0x1b')](_0x195f0c,function(_0x41b6e5){if(_0x41b6e5[_0x559b('0x41')]==='string'&&_0x41b6e5['nameField']&&!_0x41b6e5[_0x559b('0x42')]){_0x25164a[_0x41b6e5['nameField']['toLowerCase']()]=_0x41b6e5[_0x559b('0x43')]['toString']();}else if(_0x41b6e5[_0x559b('0x41')]==='string'&&_0x41b6e5[_0x559b('0x1e')]&&_0x41b6e5[_0x559b('0x42')]){_0x25164a['custom_fields'][_0x559b('0x1d')]({'id':_0x41b6e5[_0x559b('0x1e')],'value':_0x41b6e5[_0x559b('0x43')]['toString']()});}else if(_0x41b6e5[_0x559b('0x41')]===_0x559b('0x44')&&_0x41b6e5[_0x559b('0x1c')]&&_0x41b6e5[_0x559b('0x1e')]&&_0x41b6e5[_0x559b('0x42')]){_0x1c32a7[_0x41b6e5[_0x559b('0x1c')]]&&_0x25164a[_0x559b('0x45')][_0x559b('0x1d')]({'id':_0x41b6e5[_0x559b('0x1e')],'value':_0x1c32a7[_0x41b6e5[_0x559b('0x1c')]][_0x559b('0x23')]()});}else if(_0x41b6e5[_0x559b('0x41')]===_0x559b('0x46')&&_0x41b6e5[_0x559b('0x47')]&&_0x41b6e5[_0x559b('0x47')][_0x559b('0xe')]&&_0x41b6e5[_0x559b('0x1e')]&&_0x41b6e5['customField']){_0x1c32a7[_0x41b6e5[_0x559b('0x47')][_0x559b('0xe')][_0x559b('0x48')]()]&&_0x25164a['custom_fields']['push']({'id':_0x41b6e5[_0x559b('0x1e')],'value':_0x1c32a7[_0x41b6e5[_0x559b('0x47')]['name'][_0x559b('0x48')]()][_0x559b('0x23')]()});}});}return _0x25164a;}function getConnection(_0xd69b8){return request({'method':_0x559b('0xa'),'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x559b('0x25')]({'user_auth':{'user_name':_0xd69b8[_0x559b('0x49')],'password':_0xd69b8['password'],'encryption':'PLAIN'},'application':_0x559b('0x4a')})}})[_0x559b('0x2a')](function(_0xc6a2cf){var _0x13436a=_0xc6a2cf;if(_0x13436a['id']){def[_0x559b('0x4b')]=_0x13436a['id'];return BPromise[_0x559b('0x31')](_0x13436a);}else{throw new Error(util['format'](_0x559b('0x4c'),_0xd69b8['id']));}});}function setRelationship(_0x5d0b47,_0x38780f,_0x39ade2,_0x596b28){return request({'form':{'method':_0x559b('0x4d'),'input_type':_0x559b('0x1f'),'response_type':_0x559b('0x1f'),'rest_data':JSON[_0x559b('0x25')]({'session':_0x5d0b47['id'],'module_name':_0x559b('0x20'),'module_id':_0x39ade2['id'],'link_field_name':_0x596b28,'related_ids':[_0x38780f['id']]})}});}exports[_0x559b('0x4e')]=function(_0x35c819,_0x39116e,_0x1a2ae7,_0x45a371,_0x1fc02b,_0x12385f){var _0x38e92d,_0x3ba7b6,_0x4834e9,_0x578b92;_0x12385f[_0x559b('0x4f')]=intUtil[_0x559b('0x50')](_0x12385f[_0x559b('0x4f')]);_0x12385f[_0x559b('0x51')]=intUtil['stripTrailingSlash'](_0x12385f[_0x559b('0x51')]);def[_0x559b('0x52')]=util[_0x559b('0x21')](_0x559b('0x53'),_0x12385f[_0x559b('0x4f')]);if(_0x1fc02b&&_0x1fc02b['monitor_format']){logger[_0x559b('0xc')](_0x559b('0x54'),_0x559b('0x55'));_0x39116e[_0x559b('0x56')]=util['format'](_0x559b('0x57'),_0x12385f[_0x559b('0x51')],_0x39116e[_0x559b('0x58')],md5(_0x39116e[_0x559b('0x58')]));}else{_0x39116e[_0x559b('0x56')]='';}return getConnection(_0x12385f)[_0x559b('0x2a')](function(_0x43ce19){_0x578b92=_0x43ce19;return getUser(_0x12385f,_0x45a371[_0x559b('0xe')],_0x578b92);})[_0x559b('0x2a')](function(_0x20a30f){_0x38e92d=_0x20a30f;logger[_0x559b('0xc')](_0x559b('0x59'),_0x38e92d['id']);return getEndUser(_0x12385f,_0x39116e['calleridname'],_0x39116e['calleridnum'],_0x578b92);})[_0x559b('0x2a')](function(_0x17d720){_0x3ba7b6=_0x17d720;logger[_0x559b('0xc')]('The\x20Enduser\x20ID\x20is:',_0x3ba7b6['id']);return getTicket(_0x12385f,_0x38e92d,_0x3ba7b6,_0x1a2ae7,_0x39116e,_0x1a2ae7[_0x559b('0x5a')],_0x578b92,_0x559b('0x5b'));})['then'](function(_0x42db5f){_0x4834e9=_0x42db5f;logger[_0x559b('0xc')](_0x559b('0x5c'));logger['info'](_0x559b('0x5d'),_0x4834e9['id']);return setRelationship(_0x578b92,_0x38e92d,_0x4834e9,_0x559b('0x5e'));})[_0x559b('0x2a')](function(){return setRelationship(_0x578b92,_0x3ba7b6,_0x4834e9,'contacts');})[_0x559b('0x2a')](function(){return getServerInfo(_0x578b92);})[_0x559b('0x2a')](function(_0x1a3d78){var _0x3534ba=parseInt(_0x1a3d78[_0x559b('0x5f')]['charAt'](0x0));var _0x36ebef=util['format'](_0x559b('0x60'),_0x12385f[_0x559b('0x4f')],_0x4834e9['id']);if(_0x3534ba>0x6){_0x36ebef=util[_0x559b('0x21')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x12385f['remoteUri'],_0x4834e9['id']);}logger['info']('[QUEUE]',_0x559b('0x61'));emit(util['format'](_0x559b('0x62'),_0x45a371[_0x559b('0xe')]),_0x559b('0x63'),{'uri':_0x36ebef});})[_0x559b('0x64')](function(_0x2aae0a){logger['error'](_0x559b('0x54'),JSON[_0x559b('0x25')](_0x2aae0a));});};exports[_0x559b('0x65')]=function(_0x4a8152,_0x2add65,_0x1d4171,_0x3e6e4c,_0x3e030a,_0x568431,_0x3a499e){var _0x98fefb,_0x2fc859,_0xd8b0e7,_0x3a6ddb;_0x568431[_0x559b('0x4f')]=intUtil[_0x559b('0x50')](_0x568431[_0x559b('0x4f')]);_0x568431[_0x559b('0x51')]=intUtil[_0x559b('0x50')](_0x568431[_0x559b('0x51')]);def['uri']=util[_0x559b('0x21')](_0x559b('0x53'),_0x568431['remoteUri']);if(_0x3a499e&&_0x3a499e['recordingFormat']&&_0x3a499e[_0x559b('0x66')]!==_0x559b('0x67')){logger[_0x559b('0xc')](_0x559b('0x68'),_0x559b('0x55'));_0x2add65[_0x559b('0x56')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x568431[_0x559b('0x51')],_0x2add65[_0x559b('0x58')],md5(_0x2add65['uniqueid']));}return getConnection(_0x568431)[_0x559b('0x2a')](function(_0x4b04fe){_0x3a6ddb=_0x4b04fe;return getUser(_0x568431,_0x3e6e4c[_0x559b('0xe')],_0x3a6ddb);})[_0x559b('0x2a')](function(_0x53ca51){_0x98fefb=_0x53ca51;logger[_0x559b('0xc')](_0x559b('0x59'),_0x98fefb['id']);return getEndUser(_0x568431,_0x2add65[_0x559b('0x69')],_0x2add65['destcalleridnum'],_0x3a6ddb);})[_0x559b('0x2a')](function(_0x527588){_0x2fc859=_0x527588;logger['info'](_0x559b('0x6a'),_0x2fc859['id']);return getTicket(_0x568431,_0x98fefb,_0x2fc859,_0x1d4171,_0x2add65,_0x1d4171['Fields'],_0x3a6ddb,_0x559b('0x6b'));})[_0x559b('0x2a')](function(_0x58cb60){_0xd8b0e7=_0x58cb60;logger[_0x559b('0xc')](_0x559b('0x5c'));logger[_0x559b('0xc')]('The\x20Ticket\x20ID\x20is:',_0xd8b0e7['id']);return setRelationship(_0x3a6ddb,_0x98fefb,_0xd8b0e7,'users');})['then'](function(){return setRelationship(_0x3a6ddb,_0x2fc859,_0xd8b0e7,_0x559b('0x6c'));})['then'](function(){return getServerInfo(_0x3a6ddb);})[_0x559b('0x2a')](function(_0x3c2647){var _0x5c2ef6=parseInt(_0x3c2647['version']['charAt'](0x0));var _0x14f5ec=util[_0x559b('0x21')](_0x559b('0x60'),_0x568431[_0x559b('0x4f')],_0xd8b0e7['id']);if(_0x5c2ef6>0x6){_0x14f5ec=util[_0x559b('0x21')](_0x559b('0x6d'),_0x568431[_0x559b('0x4f')],_0xd8b0e7['id']);}logger[_0x559b('0xc')](_0x559b('0x68'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x559b('0x21')](_0x559b('0x62'),_0x3e6e4c[_0x559b('0xe')]),'trigger:browser:url',{'uri':_0x14f5ec});})[_0x559b('0x64')](function(_0x5476d8){logger[_0x559b('0x6e')]('[OUTBOUND]',JSON['stringify'](_0x5476d8));});};exports[_0x559b('0x6f')]=function(_0xe4292d,_0x5c1adb,_0xf35b47,_0x598cd0,_0x2091aa,_0x389526){var _0x59bac0,_0x289b41,_0x34eadb,_0x4d3e36;_0x389526[_0x559b('0x4f')]=intUtil[_0x559b('0x50')](_0x389526[_0x559b('0x4f')]);_0x389526['serverUrl']=intUtil[_0x559b('0x50')](_0x389526[_0x559b('0x51')]);def[_0x559b('0x52')]=util['format'](_0x559b('0x53'),_0x389526['remoteUri']);if(_0x2091aa&&_0x2091aa[_0x559b('0x70')]){logger[_0x559b('0xc')](_0x559b('0x71'),_0x559b('0x55'));_0x5c1adb[_0x559b('0x56')]=util[_0x559b('0x21')](_0x559b('0x57'),_0x389526[_0x559b('0x51')],_0x5c1adb[_0x559b('0x58')],md5(_0x5c1adb[_0x559b('0x58')]));}else{_0x5c1adb[_0x559b('0x56')]='';}return getConnection(_0x389526)[_0x559b('0x2a')](function(_0x28871c){_0x4d3e36=_0x28871c;if(!_['isNil'](_0x598cd0)){return getUser(_0x389526,_0x598cd0[_0x559b('0xe')],_0x4d3e36);}else{return getUser(_0x389526,null,_0x4d3e36);}})['then'](function(_0x3727b5){_0x59bac0=_0x3727b5;logger[_0x559b('0xc')]('The\x20User\x20ID\x20is:',_0x59bac0['id']);return getEndUser(_0x389526,_0x5c1adb['calleridname'],_0x5c1adb[_0x559b('0x72')],_0x4d3e36);})['then'](function(_0x4eb7ce){_0x289b41=_0x4eb7ce;logger[_0x559b('0xc')](_0x559b('0x6a'),_0x289b41['id']);return getTicket(_0x389526,_0x59bac0,_0x289b41,_0xf35b47,_0x5c1adb,_0xf35b47[_0x559b('0x5a')],_0x4d3e36,'Inbound');})[_0x559b('0x2a')](function(_0x29a216){_0x34eadb=_0x29a216;logger[_0x559b('0xc')](_0x559b('0x5c'));logger[_0x559b('0xc')](_0x559b('0x5d'),_0x34eadb['id']);return setRelationship(_0x4d3e36,_0x59bac0,_0x34eadb,_0x559b('0x5e'));})[_0x559b('0x2a')](function(){return setRelationship(_0x4d3e36,_0x289b41,_0x34eadb,'contacts');})['then'](function(){return getServerInfo(_0x4d3e36);})[_0x559b('0x64')](function(_0x1cf19d){logger['error']('[ABANDONED]',JSON[_0x559b('0x25')](_0x1cf19d));});}; \ No newline at end of file +var _0xee93=['redis','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','duration_hours','duration_minutes','parent_id','Contacts','parent_name','direction','length','variableName','push','idField','set_entry','JSON','stringify','Calls','format','apiKey','toString','base64','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','value','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','type','customField','toLowerCase','content','string','custom_fields','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','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...','trigger:browser:url','catch','error','outbound','[OUTBOUND]','Recording\x20is\x20enabled!','Outbound','contacts','user:%s','abandoned','[ABANDONED]','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm'];(function(_0x443d8e,_0x57fe3e){var _0x402ae6=function(_0x2d20d7){while(--_0x2d20d7){_0x443d8e['push'](_0x443d8e['shift']());}};_0x402ae6(++_0x57fe3e);}(_0xee93,0x1d3));var _0x3ee9=function(_0xda92d6,_0x43f405){_0xda92d6=_0xda92d6-0x0;var _0x2b6198=_0xee93[_0xda92d6];return _0x2b6198;};'use strict';var _=require('lodash');var rp=require(_0x3ee9('0x0'));var BPromise=require(_0x3ee9('0x1'));var md5=require(_0x3ee9('0x2'));var util=require(_0x3ee9('0x3'));var Redis=require(_0x3ee9('0x4'));var intUtil=require(_0x3ee9('0x5'));var config=require(_0x3ee9('0x6'));var logger=require(_0x3ee9('0x7'))(_0x3ee9('0x8'));config[_0x3ee9('0x9')]=_['defaults'](config[_0x3ee9('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x3ee9('0xa'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x55123b,_0x55748f,_0x5805a4){io['to'](_0x55123b)[_0x3ee9('0xb')](_0x55748f,_0x5805a4);}function getTicket(_0x537641,_0x2f3791,_0x2ca302,_0xd7d99c,_0x1cdf87,_0x9bb39,_0x33f449,_0x3e6d6c){logger[_0x3ee9('0xc')](_0x3ee9('0xd'));var _0x1b2f09=new Date();var _0x55b934=[{'name':_0x3ee9('0xe'),'value':intUtil[_0x3ee9('0xf')](_0xd7d99c[_0x3ee9('0x10')],_0x1cdf87,'\x20')},{'name':_0x3ee9('0x11'),'value':_0x2f3791['id']},{'name':_0x3ee9('0x12'),'value':_0x2f3791['id']},{'name':_0x3ee9('0x13'),'value':intUtil[_0x3ee9('0xf')](_0xd7d99c[_0x3ee9('0x14')],_0x1cdf87,'\x0a')},{'name':_0x3ee9('0x15'),'value':_0x1b2f09[_0x3ee9('0x16')]()[_0x3ee9('0x17')](0x0,0x13)['replace']('T','\x20')},{'name':_0x3ee9('0x18'),'value':'0'},{'name':_0x3ee9('0x19'),'value':'15'},{'name':_0x3ee9('0x1a'),'value':_0x2ca302['id']},{'name':'parent_type','value':_0x3ee9('0x1b')},{'name':_0x3ee9('0x1c'),'value':_0x2ca302['name']},{'name':_0x3ee9('0x1d'),'value':_0x3e6d6c}];if(_0x9bb39[_0x3ee9('0x1e')]){_['forEach'](_0x9bb39,function(_0x3de4e9){if(_0x1cdf87[_0x3de4e9[_0x3ee9('0x1f')]]){_0x55b934[_0x3ee9('0x20')]({'name':_0x3de4e9[_0x3ee9('0x21')],'value':_0x1cdf87[_0x3de4e9['variableName']]});}});}return request({'form':{'method':_0x3ee9('0x22'),'input_type':_0x3ee9('0x23'),'response_type':'JSON','rest_data':JSON[_0x3ee9('0x24')]({'session':_0x33f449['id'],'module_name':_0x3ee9('0x25'),'name_value_list':_0x55b934})}});}function getAuth(_0x1617f4){return util[_0x3ee9('0x26')]('Basic\x20%s',new Buffer(_0x1617f4[_0x3ee9('0x27')]+':X')[_0x3ee9('0x28')](_0x3ee9('0x29')));}function getServerInfo(_0x4e932f){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x3ee9('0x23'),'rest_data':JSON['stringify']({'session':_0x4e932f['id']})}});}function getUser(_0x1094b7,_0x4b33cc,_0x471d33){if(!_[_0x3ee9('0x2a')](_0x4b33cc)){logger[_0x3ee9('0xc')]('Getting\x20agent\x20with\x20name',_0x4b33cc);return request({'form':{'method':_0x3ee9('0x2b'),'input_type':_0x3ee9('0x23'),'response_type':_0x3ee9('0x23'),'rest_data':JSON[_0x3ee9('0x24')]({'session':_0x471d33['id'],'module_name':_0x3ee9('0x2c'),'query':util['format'](_0x3ee9('0x2d'),_0x4b33cc),'order_by':'','offset':'0','select_fields':['id','name',_0x3ee9('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3ee9('0x2f')](function(_0x50c3c0){if(_0x50c3c0[_0x3ee9('0x30')][_0x3ee9('0x1e')]){var _0x19f19f=_[_0x3ee9('0x31')](_0x50c3c0['entry_list'],function(_0x59a569){return _0x59a569['name_value_list'][_0x3ee9('0x2e')][_0x3ee9('0x32')]===_0x4b33cc;});if(_0x19f19f){logger[_0x3ee9('0xc')]('Agent\x20found!');return BPromise[_0x3ee9('0x33')]({'id':_0x19f19f[_0x3ee9('0x34')]['id'][_0x3ee9('0x32')],'name':_0x19f19f['name_value_list']['name'][_0x3ee9('0x32')]});}}logger['info'](_0x3ee9('0x35'));return BPromise[_0x3ee9('0x33')]({'id':_0x471d33[_0x3ee9('0x34')][_0x3ee9('0x36')][_0x3ee9('0x32')],'name':_0x471d33[_0x3ee9('0x34')][_0x3ee9('0x2e')][_0x3ee9('0x32')]});});}else{logger[_0x3ee9('0xc')](_0x3ee9('0x37'));return BPromise[_0x3ee9('0x33')]({'id':_0x471d33['name_value_list'][_0x3ee9('0x36')]['value'],'name':_0x471d33[_0x3ee9('0x34')]['user_name']['value']});}}function getEndUser(_0x4385b9,_0x18fe98,_0x419639,_0x5a2bbf){logger[_0x3ee9('0xc')]('Searching\x20enduser\x20with\x20phone',_0x419639);return request({'form':{'method':_0x3ee9('0x2b'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x5a2bbf['id'],'module_name':_0x3ee9('0x1b'),'query':util['format'](_0x3ee9('0x38'),_0x419639),'order_by':'','offset':'0','select_fields':['id',_0x3ee9('0xe'),_0x3ee9('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3ee9('0x2f')](function(_0x5831d5){if(_0x5831d5[_0x3ee9('0x30')][_0x3ee9('0x1e')]){var _0x546ddf=_[_0x3ee9('0x31')](_0x5831d5[_0x3ee9('0x30')],function(_0x405583){return _0x405583[_0x3ee9('0x34')][_0x3ee9('0x39')][_0x3ee9('0x32')]===_0x419639;});if(_0x546ddf){logger[_0x3ee9('0xc')](_0x3ee9('0x3a'));return BPromise['resolve']({'id':_0x546ddf[_0x3ee9('0x34')]['id']['value'],'name':_0x546ddf[_0x3ee9('0x34')][_0x3ee9('0xe')][_0x3ee9('0x32')],'phone':_0x546ddf[_0x3ee9('0x34')][_0x3ee9('0x39')][_0x3ee9('0x32')]});}}else{logger[_0x3ee9('0xc')](_0x3ee9('0x3b'));return request({'form':{'method':_0x3ee9('0x22'),'input_type':_0x3ee9('0x23'),'response_type':_0x3ee9('0x23'),'rest_data':JSON['stringify']({'session':_0x5a2bbf['id'],'module_name':_0x3ee9('0x1b'),'name_value_list':[{'name':_0x3ee9('0x3c'),'value':_0x18fe98!==_0x3ee9('0x3d')?_0x18fe98:util[_0x3ee9('0x26')](_0x3ee9('0x3e'),_0x419639)},{'name':_0x3ee9('0x39'),'value':_0x419639}]})}})[_0x3ee9('0x2f')](function(_0x575569){logger['info'](_0x3ee9('0x3f'));return BPromise[_0x3ee9('0x33')]({'id':_0x575569['id'],'name':_0x575569[_0x3ee9('0x30')][_0x3ee9('0x3c')]['value'],'phone':_0x575569[_0x3ee9('0x30')][_0x3ee9('0x39')]['value']});});}});}function request(_0x58dd09){logger[_0x3ee9('0x40')](_0x3ee9('0x41'),JSON['stringify'](_0x58dd09));return rp(_[_0x3ee9('0x42')](def,_0x58dd09));}function getTags(_0x55a7d0,_0x2dbf17){var _0x35d906=[];if(_0x55a7d0&&_0x55a7d0[_0x3ee9('0x1e')]>0x0){_0x35d906=_[_0x3ee9('0x43')](_0x55a7d0,_0x2dbf17);}return _0x35d906;}function getCustomFields(_0x3aaefd,_0x2ad1a0){var _0x144911=[];var _0x1f6581={'custom_fields':[]};if(_0x3aaefd[_0x3ee9('0x1e')]>0x0){_[_0x3ee9('0x44')](_0x3aaefd,function(_0x530193){if(_0x530193[_0x3ee9('0x45')]==='string'&&_0x530193['nameField']&&!_0x530193[_0x3ee9('0x46')]){_0x1f6581[_0x530193['nameField'][_0x3ee9('0x47')]()]=_0x530193[_0x3ee9('0x48')][_0x3ee9('0x28')]();}else if(_0x530193['type']===_0x3ee9('0x49')&&_0x530193[_0x3ee9('0x21')]&&_0x530193['customField']){_0x1f6581[_0x3ee9('0x4a')][_0x3ee9('0x20')]({'id':_0x530193[_0x3ee9('0x21')],'value':_0x530193[_0x3ee9('0x48')][_0x3ee9('0x28')]()});}else if(_0x530193[_0x3ee9('0x45')]==='variable'&&_0x530193[_0x3ee9('0x1f')]&&_0x530193['idField']&&_0x530193[_0x3ee9('0x46')]){_0x2ad1a0[_0x530193[_0x3ee9('0x1f')]]&&_0x1f6581[_0x3ee9('0x4a')][_0x3ee9('0x20')]({'id':_0x530193['idField'],'value':_0x2ad1a0[_0x530193[_0x3ee9('0x1f')]][_0x3ee9('0x28')]()});}else if(_0x530193['type']==='customVariable'&&_0x530193[_0x3ee9('0x4b')]&&_0x530193[_0x3ee9('0x4b')][_0x3ee9('0xe')]&&_0x530193[_0x3ee9('0x21')]&&_0x530193[_0x3ee9('0x46')]){_0x2ad1a0[_0x530193[_0x3ee9('0x4b')][_0x3ee9('0xe')][_0x3ee9('0x47')]()]&&_0x1f6581['custom_fields']['push']({'id':_0x530193['idField'],'value':_0x2ad1a0[_0x530193[_0x3ee9('0x4b')]['name'][_0x3ee9('0x47')]()][_0x3ee9('0x28')]()});}});}return _0x1f6581;}function getConnection(_0x187e3e){return request({'method':'POST','form':{'method':_0x3ee9('0x4c'),'input_type':_0x3ee9('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x187e3e[_0x3ee9('0x4d')],'password':_0x187e3e[_0x3ee9('0x4e')],'encryption':_0x3ee9('0x4f')},'application':_0x3ee9('0x50')})}})[_0x3ee9('0x2f')](function(_0x214414){var _0x1ee7b1=_0x214414;if(_0x1ee7b1['id']){def['sessionID']=_0x1ee7b1['id'];return BPromise[_0x3ee9('0x33')](_0x1ee7b1);}else{throw new Error(util[_0x3ee9('0x26')](_0x3ee9('0x51'),_0x187e3e['id']));}});}function setRelationship(_0x288269,_0x2f3fad,_0x53371f,_0x16afc0){return request({'form':{'method':_0x3ee9('0x52'),'input_type':_0x3ee9('0x23'),'response_type':_0x3ee9('0x23'),'rest_data':JSON[_0x3ee9('0x24')]({'session':_0x288269['id'],'module_name':_0x3ee9('0x25'),'module_id':_0x53371f['id'],'link_field_name':_0x16afc0,'related_ids':[_0x2f3fad['id']]})}});}exports[_0x3ee9('0x53')]=function(_0x43add1,_0x1004e8,_0x3adf8e,_0x1e2ed9,_0xa1172,_0x57a6f5){var _0xe8c4f6,_0x1c9c07,_0x49fa2a,_0x53df47;_0x57a6f5[_0x3ee9('0x54')]=intUtil['stripTrailingSlash'](_0x57a6f5[_0x3ee9('0x54')]);_0x57a6f5[_0x3ee9('0x55')]=intUtil[_0x3ee9('0x56')](_0x57a6f5[_0x3ee9('0x55')]);def[_0x3ee9('0x57')]=util['format'](_0x3ee9('0x58'),_0x57a6f5[_0x3ee9('0x54')]);if(_0xa1172&&_0xa1172[_0x3ee9('0x59')]){logger[_0x3ee9('0xc')](_0x3ee9('0x5a'),'Recording\x20is\x20enabled!');_0x1004e8[_0x3ee9('0x5b')]=util['format'](_0x3ee9('0x5c'),_0x57a6f5[_0x3ee9('0x55')],_0x1004e8[_0x3ee9('0x5d')],md5(_0x1004e8[_0x3ee9('0x5d')]));}else{_0x1004e8[_0x3ee9('0x5b')]='';}return getConnection(_0x57a6f5)[_0x3ee9('0x2f')](function(_0x5697c8){_0x53df47=_0x5697c8;return getUser(_0x57a6f5,_0x1e2ed9[_0x3ee9('0xe')],_0x53df47);})[_0x3ee9('0x2f')](function(_0x26d478){_0xe8c4f6=_0x26d478;logger[_0x3ee9('0xc')](_0x3ee9('0x5e'),_0xe8c4f6['id']);return getEndUser(_0x57a6f5,_0x1004e8[_0x3ee9('0x5f')],_0x1004e8[_0x3ee9('0x60')],_0x53df47);})[_0x3ee9('0x2f')](function(_0x233eae){_0x1c9c07=_0x233eae;logger['info'](_0x3ee9('0x61'),_0x1c9c07['id']);return getTicket(_0x57a6f5,_0xe8c4f6,_0x1c9c07,_0x3adf8e,_0x1004e8,_0x3adf8e[_0x3ee9('0x62')],_0x53df47,_0x3ee9('0x63'));})['then'](function(_0x5bfe9a){_0x49fa2a=_0x5bfe9a;logger[_0x3ee9('0xc')](_0x3ee9('0x64'));logger[_0x3ee9('0xc')](_0x3ee9('0x65'),_0x49fa2a['id']);return setRelationship(_0x53df47,_0xe8c4f6,_0x49fa2a,_0x3ee9('0x66'));})[_0x3ee9('0x2f')](function(){return setRelationship(_0x53df47,_0x1c9c07,_0x49fa2a,'contacts');})['then'](function(){return getServerInfo(_0x53df47);})[_0x3ee9('0x2f')](function(_0x552f9d){var _0x55613a=parseInt(_0x552f9d[_0x3ee9('0x67')][_0x3ee9('0x68')](0x0));var _0x57642d=util[_0x3ee9('0x26')](_0x3ee9('0x69'),_0x57a6f5['remoteUri'],_0x49fa2a['id']);if(_0x55613a>0x6){_0x57642d=util[_0x3ee9('0x26')](_0x3ee9('0x6a'),_0x57a6f5['remoteUri'],_0x49fa2a['id']);}logger['info'](_0x3ee9('0x5a'),_0x3ee9('0x6b'));emit(util[_0x3ee9('0x26')]('user:%s',_0x1e2ed9[_0x3ee9('0xe')]),_0x3ee9('0x6c'),{'uri':_0x57642d});})[_0x3ee9('0x6d')](function(_0x107312){logger[_0x3ee9('0x6e')](_0x3ee9('0x5a'),JSON[_0x3ee9('0x24')](_0x107312));});};exports[_0x3ee9('0x6f')]=function(_0x3e787c,_0x2df5d3,_0x5a9f8a,_0x496ce1,_0x2c644d,_0x3cb854,_0x4fe430){var _0x514a24,_0x502fd6,_0x342828,_0x1b0364;_0x3cb854[_0x3ee9('0x54')]=intUtil[_0x3ee9('0x56')](_0x3cb854[_0x3ee9('0x54')]);_0x3cb854['serverUrl']=intUtil['stripTrailingSlash'](_0x3cb854[_0x3ee9('0x55')]);def[_0x3ee9('0x57')]=util['format'](_0x3ee9('0x58'),_0x3cb854['remoteUri']);if(_0x4fe430&&_0x4fe430['recordingFormat']&&_0x4fe430['recordingFormat']!=='none'){logger[_0x3ee9('0xc')](_0x3ee9('0x70'),_0x3ee9('0x71'));_0x2df5d3[_0x3ee9('0x5b')]=util[_0x3ee9('0x26')](_0x3ee9('0x5c'),_0x3cb854['serverUrl'],_0x2df5d3[_0x3ee9('0x5d')],md5(_0x2df5d3[_0x3ee9('0x5d')]));}return getConnection(_0x3cb854)['then'](function(_0x29c4f6){_0x1b0364=_0x29c4f6;return getUser(_0x3cb854,_0x496ce1[_0x3ee9('0xe')],_0x1b0364);})['then'](function(_0x24caaa){_0x514a24=_0x24caaa;logger[_0x3ee9('0xc')]('The\x20User\x20ID\x20is:',_0x514a24['id']);return getEndUser(_0x3cb854,_0x2df5d3['destcalleridname'],_0x2df5d3['destcalleridnum'],_0x1b0364);})[_0x3ee9('0x2f')](function(_0x1a1491){_0x502fd6=_0x1a1491;logger[_0x3ee9('0xc')](_0x3ee9('0x61'),_0x502fd6['id']);return getTicket(_0x3cb854,_0x514a24,_0x502fd6,_0x5a9f8a,_0x2df5d3,_0x5a9f8a[_0x3ee9('0x62')],_0x1b0364,_0x3ee9('0x72'));})['then'](function(_0x1c3758){_0x342828=_0x1c3758;logger[_0x3ee9('0xc')]('Ticket\x20created!');logger[_0x3ee9('0xc')](_0x3ee9('0x65'),_0x342828['id']);return setRelationship(_0x1b0364,_0x514a24,_0x342828,'users');})['then'](function(){return setRelationship(_0x1b0364,_0x502fd6,_0x342828,_0x3ee9('0x73'));})[_0x3ee9('0x2f')](function(){return getServerInfo(_0x1b0364);})[_0x3ee9('0x2f')](function(_0x3dab4f){var _0x991ee1=parseInt(_0x3dab4f[_0x3ee9('0x67')][_0x3ee9('0x68')](0x0));var _0x540e00=util[_0x3ee9('0x26')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3cb854['remoteUri'],_0x342828['id']);if(_0x991ee1>0x6){_0x540e00=util[_0x3ee9('0x26')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x3cb854[_0x3ee9('0x54')],_0x342828['id']);}logger[_0x3ee9('0xc')](_0x3ee9('0x70'),_0x3ee9('0x6b'));emit(util[_0x3ee9('0x26')](_0x3ee9('0x74'),_0x496ce1[_0x3ee9('0xe')]),_0x3ee9('0x6c'),{'uri':_0x540e00});})[_0x3ee9('0x6d')](function(_0x46e081){logger[_0x3ee9('0x6e')](_0x3ee9('0x70'),JSON[_0x3ee9('0x24')](_0x46e081));});};exports[_0x3ee9('0x75')]=function(_0x27d300,_0x545ee5,_0x3c325d,_0x30b76f,_0x1a8d3a,_0x5c658e){var _0x288f92,_0x19e830,_0xb410aa,_0x4f00d9;_0x5c658e[_0x3ee9('0x54')]=intUtil['stripTrailingSlash'](_0x5c658e[_0x3ee9('0x54')]);_0x5c658e[_0x3ee9('0x55')]=intUtil[_0x3ee9('0x56')](_0x5c658e[_0x3ee9('0x55')]);def[_0x3ee9('0x57')]=util[_0x3ee9('0x26')](_0x3ee9('0x58'),_0x5c658e[_0x3ee9('0x54')]);if(_0x1a8d3a&&_0x1a8d3a[_0x3ee9('0x59')]){logger['info']('[ABANDONED]','Recording\x20is\x20enabled!');_0x545ee5[_0x3ee9('0x5b')]=util[_0x3ee9('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5c658e[_0x3ee9('0x55')],_0x545ee5[_0x3ee9('0x5d')],md5(_0x545ee5[_0x3ee9('0x5d')]));}else{_0x545ee5[_0x3ee9('0x5b')]='';}return getConnection(_0x5c658e)['then'](function(_0x1fb279){_0x4f00d9=_0x1fb279;if(!_[_0x3ee9('0x2a')](_0x30b76f)){return getUser(_0x5c658e,_0x30b76f['name'],_0x4f00d9);}else{return getUser(_0x5c658e,null,_0x4f00d9);}})['then'](function(_0x47ac33){_0x288f92=_0x47ac33;logger['info']('The\x20User\x20ID\x20is:',_0x288f92['id']);return getEndUser(_0x5c658e,_0x545ee5[_0x3ee9('0x5f')],_0x545ee5[_0x3ee9('0x60')],_0x4f00d9);})['then'](function(_0x27d0f7){_0x19e830=_0x27d0f7;logger[_0x3ee9('0xc')]('The\x20Enduser\x20ID\x20is:',_0x19e830['id']);return getTicket(_0x5c658e,_0x288f92,_0x19e830,_0x3c325d,_0x545ee5,_0x3c325d[_0x3ee9('0x62')],_0x4f00d9,_0x3ee9('0x63'));})[_0x3ee9('0x2f')](function(_0x17b704){_0xb410aa=_0x17b704;logger['info'](_0x3ee9('0x64'));logger['info'](_0x3ee9('0x65'),_0xb410aa['id']);return setRelationship(_0x4f00d9,_0x288f92,_0xb410aa,_0x3ee9('0x66'));})['then'](function(){return setRelationship(_0x4f00d9,_0x19e830,_0xb410aa,'contacts');})['then'](function(){return getServerInfo(_0x4f00d9);})[_0x3ee9('0x6d')](function(_0x3bd396){logger[_0x3ee9('0x6e')](_0x3ee9('0x76'),JSON[_0x3ee9('0x24')](_0x3bd396));});}; \ 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 202268d..fcf7b0f 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 _0xf50c=['name','toString','keyType','string','key','format','%s:\x20%s','variable','toLowerCase','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','push','variableName','customVariable','Variable'];(function(_0xc11f5b,_0x2aa01a){var _0x2465dd=function(_0xda097b){while(--_0xda097b){_0xc11f5b['push'](_0xc11f5b['shift']());}};_0x2465dd(++_0x2aa01a);}(_0xf50c,0x155));var _0xcf50=function(_0x276573,_0x4795ed){_0x276573=_0x276573-0x0;var _0x21c8e4=_0xf50c[_0x276573];return _0x21c8e4;};'use strict';var _=require(_0xcf50('0x0'));var util=require(_0xcf50('0x1'));exports[_0xcf50('0x2')]=function(_0x35406a,_0x3f6e41,_0x517c02){var _0x402bf1=[];if(_0x35406a[_0xcf50('0x3')]>0x0){var _0x2541ce=_[_0xcf50('0x4')](_0x35406a,['id']);for(var _0x5eabe5=0x0;_0x5eabe5<_0x2541ce['length'];_0x5eabe5++){var _0x5773de=_0x2541ce[_0x5eabe5];if(_0x5773de[_0xcf50('0x5')]==='string'){_0x402bf1[_0xcf50('0x6')](_0x5773de['content']);}else if(_0x5773de[_0xcf50('0x5')]==='variable'&&_0x5773de[_0xcf50('0x7')]){_0x3f6e41[_0x5773de[_0xcf50('0x7')]]&&_0x402bf1[_0xcf50('0x6')](_0x3f6e41[_0x5773de[_0xcf50('0x7')]]['toString']());}else if(_0x5773de[_0xcf50('0x5')]===_0xcf50('0x8')&&_0x5773de['Variable']&&_0x5773de[_0xcf50('0x9')][_0xcf50('0xa')]){_0x3f6e41[_0x5773de[_0xcf50('0x9')]['name']['toLowerCase']()]&&_0x402bf1[_0xcf50('0x6')](_0x3f6e41[_0x5773de[_0xcf50('0x9')][_0xcf50('0xa')]['toLowerCase']()][_0xcf50('0xb')]());}else if(_0x5773de[_0xcf50('0x5')]==='keyValue'){if(_0x5773de[_0xcf50('0xc')]===_0xcf50('0xd')&&_0x5773de[_0xcf50('0xe')]){_0x402bf1[_0xcf50('0x6')](util[_0xcf50('0xf')](_0xcf50('0x10'),_0x5773de[_0xcf50('0xe')],_0x5773de['keyContent']));}else if(_0x5773de[_0xcf50('0xc')]===_0xcf50('0x11')&&_0x5773de[_0xcf50('0x7')]&&_0x5773de['key']){_0x3f6e41[_0x5773de[_0xcf50('0x7')]]&&_0x402bf1[_0xcf50('0x6')](util[_0xcf50('0xf')](_0xcf50('0x10'),_0x5773de[_0xcf50('0xe')],_0x3f6e41[_0x5773de[_0xcf50('0x7')]]));}else if(_0x5773de[_0xcf50('0xc')]==='customVariable'&&_0x5773de['Variable']&&_0x5773de['Variable'][_0xcf50('0xa')]&&_0x5773de['key']){_0x3f6e41[_0x5773de[_0xcf50('0x9')][_0xcf50('0xa')][_0xcf50('0x12')]()]&&_0x402bf1['push'](util[_0xcf50('0xf')](_0xcf50('0x10'),_0x5773de['key'],_0x3f6e41[_0x5773de[_0xcf50('0x9')][_0xcf50('0xa')]['toLowerCase']()]));}}}}return _0x402bf1[_0xcf50('0x13')](_0x517c02);};exports[_0xcf50('0x14')]=function(_0xea702e){var _0x4c8855=_0xea702e[_0xcf50('0x15')](-0x1);if(_0x4c8855==='/'){_0xea702e=_0xea702e[_0xcf50('0x16')](0x0,_0xea702e[_0xcf50('0x17')](_0x4c8855));}return _0xea702e;};exports[_0xcf50('0x18')]=function(_0x8341d5){if(!_[_0xcf50('0x19')](_0x8341d5)&&_0x8341d5!==''){var _0x23756f=/^(([^<>()\[\]\\.,;:\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 _0x23756f[_0xcf50('0x1a')](String(_0x8341d5)[_0xcf50('0x12')]());}else{return![];}}; \ No newline at end of file +var _0xe73c=['toString','format','%s:\x20%s','key','keyContent','keyType','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','test','lodash','util','getString','length','sortBy','string','push','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x4fbfe7,_0x4e610f){var _0x1733da=function(_0x5a1079){while(--_0x5a1079){_0x4fbfe7['push'](_0x4fbfe7['shift']());}};_0x1733da(++_0x4e610f);}(_0xe73c,0x1d8));var _0xce73=function(_0x4458fa,_0x2ecd2b){_0x4458fa=_0x4458fa-0x0;var _0x916984=_0xe73c[_0x4458fa];return _0x916984;};'use strict';var _=require(_0xce73('0x0'));var util=require(_0xce73('0x1'));exports[_0xce73('0x2')]=function(_0x16d797,_0x284c85,_0x591347){var _0x40ffc4=[];if(_0x16d797[_0xce73('0x3')]>0x0){var _0x540c78=_[_0xce73('0x4')](_0x16d797,['id']);for(var _0x2baa7f=0x0;_0x2baa7f<_0x540c78[_0xce73('0x3')];_0x2baa7f++){var _0xc28170=_0x540c78[_0x2baa7f];if(_0xc28170['type']===_0xce73('0x5')){_0x40ffc4[_0xce73('0x6')](_0xc28170['content']);}else if(_0xc28170[_0xce73('0x7')]===_0xce73('0x8')&&_0xc28170[_0xce73('0x9')]){_0x284c85[_0xc28170[_0xce73('0x9')]]&&_0x40ffc4[_0xce73('0x6')](_0x284c85[_0xc28170[_0xce73('0x9')]]['toString']());}else if(_0xc28170[_0xce73('0x7')]===_0xce73('0xa')&&_0xc28170[_0xce73('0xb')]&&_0xc28170[_0xce73('0xb')][_0xce73('0xc')]){_0x284c85[_0xc28170[_0xce73('0xb')][_0xce73('0xc')][_0xce73('0xd')]()]&&_0x40ffc4[_0xce73('0x6')](_0x284c85[_0xc28170[_0xce73('0xb')][_0xce73('0xc')]['toLowerCase']()][_0xce73('0xe')]());}else if(_0xc28170[_0xce73('0x7')]==='keyValue'){if(_0xc28170['keyType']===_0xce73('0x5')&&_0xc28170['key']){_0x40ffc4[_0xce73('0x6')](util[_0xce73('0xf')](_0xce73('0x10'),_0xc28170[_0xce73('0x11')],_0xc28170[_0xce73('0x12')]));}else if(_0xc28170['keyType']==='variable'&&_0xc28170[_0xce73('0x9')]&&_0xc28170['key']){_0x284c85[_0xc28170[_0xce73('0x9')]]&&_0x40ffc4[_0xce73('0x6')](util['format']('%s:\x20%s',_0xc28170[_0xce73('0x11')],_0x284c85[_0xc28170[_0xce73('0x9')]]));}else if(_0xc28170[_0xce73('0x13')]===_0xce73('0xa')&&_0xc28170[_0xce73('0xb')]&&_0xc28170['Variable']['name']&&_0xc28170[_0xce73('0x11')]){_0x284c85[_0xc28170['Variable']['name'][_0xce73('0xd')]()]&&_0x40ffc4[_0xce73('0x6')](util[_0xce73('0xf')](_0xce73('0x10'),_0xc28170[_0xce73('0x11')],_0x284c85[_0xc28170[_0xce73('0xb')][_0xce73('0xc')][_0xce73('0xd')]()]));}}}}return _0x40ffc4[_0xce73('0x14')](_0x591347);};exports[_0xce73('0x15')]=function(_0x459bd7){var _0xd87593=_0x459bd7[_0xce73('0x16')](-0x1);if(_0xd87593==='/'){_0x459bd7=_0x459bd7[_0xce73('0x17')](0x0,_0x459bd7[_0xce73('0x18')](_0xd87593));}return _0x459bd7;};exports[_0xce73('0x19')]=function(_0x5ec0dc){if(!_['isNil'](_0x5ec0dc)&&_0x5ec0dc!==''){var _0x240c2f=/^(([^<>()\[\]\\.,;:\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 _0x240c2f[_0xce73('0x1a')](String(_0x5ec0dc)[_0xce73('0xd')]());}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 3052750..4d261b8 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 _0x7217=['The\x20User\x20ID\x20is:','calleridname','calleridnum','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','outbound','serverUrl','recordingFormat','none','destcalleridname','destcalleridnum','Fields','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','abandoned','[ABANDONED]','Ticket\x20created!','lodash','bluebird','md5','util','ioredis','./util','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','type','string','idField','content','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','Descriptions','POST','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','then','Agent\x20found!','email1','first_name','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email'];(function(_0x28a80e,_0x2c69a8){var _0x3761ce=function(_0xb827c6){while(--_0xb827c6){_0x28a80e['push'](_0x28a80e['shift']());}};_0x3761ce(++_0x2c69a8);}(_0x7217,0x19e));var _0x7721=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x7217[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var BPromise=require(_0x7721('0x1'));var md5=require(_0x7721('0x2'));var util=require(_0x7721('0x3'));var Redis=require(_0x7721('0x4'));var intUtil=require(_0x7721('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x7721('0x6'));config[_0x7721('0x7')]=_[_0x7721('0x8')](config[_0x7721('0x7')],{'host':_0x7721('0x9'),'port':0x18eb});var io=require(_0x7721('0xa'))(new Redis(config[_0x7721('0x7')]));function emit(_0x21f680,_0x225610,_0x2f99ed){io['to'](_0x21f680)[_0x7721('0xb')](_0x225610,_0x2f99ed);}function getCustomFields(_0x2a66cb,_0xfa8835){var _0x138740={};if(_0x2a66cb[_0x7721('0xc')]>0x0){_['forEach'](_0x2a66cb,function(_0x461d1a){if(_0x461d1a[_0x7721('0xd')]===_0x7721('0xe')&&_0x461d1a[_0x7721('0xf')]){_0x138740[_0x461d1a[_0x7721('0xf')]]=_0x461d1a[_0x7721('0x10')][_0x7721('0x11')]();}else if(_0x461d1a[_0x7721('0xd')]==='variable'&&_0x461d1a[_0x7721('0x12')]&&_0x461d1a[_0x7721('0xf')]&&_0xfa8835[_0x461d1a['variableName']]){_0x138740[_0x461d1a[_0x7721('0xf')]]=_0xfa8835[_0x461d1a[_0x7721('0x12')]][_0x7721('0x11')]();}else if(_0x461d1a[_0x7721('0xd')]==='customVariable'&&_0x461d1a[_0x7721('0x13')]&&_0x461d1a[_0x7721('0x13')]['name']&&_0x461d1a['idField']&&_0xfa8835[_0x461d1a['Variable'][_0x7721('0x14')][_0x7721('0x15')]()]){_0x138740[_0x461d1a[_0x7721('0xf')]]=_0xfa8835[_0x461d1a[_0x7721('0x13')]['name'][_0x7721('0x15')]()]['toString']();}});}return _0x138740;}function createTicket(_0x3fc09e,_0x5cb0e6,_0xfec626,_0x4e96fb,_0x3ab5a5,_0x3e140d,_0x2286e5){logger[_0x7721('0x16')](_0x7721('0x17'));var _0x413263=_[_0x7721('0x18')]({'parent_id':'','assigned_user_id':_0x5cb0e6['id'],'ticketpriorities':_0x7721('0x19'),'ticketstatus':'Open','ticket_title':intUtil[_0x7721('0x1a')](_0x4e96fb[_0x7721('0x1b')],_0x3ab5a5,'\x20'),'description':intUtil[_0x7721('0x1a')](_0x4e96fb[_0x7721('0x1c')],_0x3ab5a5,'\x0a'),'contact_id':_0xfec626['id']},getCustomFields(_0x3e140d,_0x3ab5a5));var _0x57140c={'method':_0x7721('0x1d'),'uri':util['format'](_0x7721('0x1e'),_0x3fc09e[_0x7721('0x1f')]),'form':{'operation':_0x7721('0x20'),'username':_0x3fc09e[_0x7721('0x21')],'sessionName':_0x2286e5[_0x7721('0x22')],'elementType':_0x7721('0x23'),'element':JSON[_0x7721('0x24')](_0x413263)},'json':!![]};return request(_0x57140c)['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x25')]){return BPromise[_0x7721('0x26')]({'id':_0x216f20[_0x7721('0x27')]['id']});}else{throw new Error(util[_0x7721('0x28')](_0x7721('0x29'),JSON[_0x7721('0x24')](_0x216f20[_0x7721('0x2a')])));}})[_0x7721('0x2b')](function(_0x52316e){var _0x258ddf=_0x52316e['statusCode']||0x1f4;logger['error'](_0x7721('0x2c'),_0x7721('0x2d'),_0x258ddf,JSON[_0x7721('0x24')](_0x52316e));});}function getUser(_0x158d98,_0x1ea4d,_0x37b9f0){if(intUtil[_0x7721('0x2e')](_0x1ea4d)){logger[_0x7721('0x16')]('Getting\x20agent\x20with\x20email',_0x1ea4d);return request({'method':_0x7721('0x2f'),'uri':util[_0x7721('0x28')]('%s/webservice.php',_0x158d98['remoteUri']),'qs':{'operation':_0x7721('0x30'),'username':_0x158d98[_0x7721('0x21')],'sessionName':_0x37b9f0['sessionName'],'query':util[_0x7721('0x28')](_0x7721('0x31'),_0x1ea4d)},'json':!![]})[_0x7721('0x32')](function(_0x58d54b){if(_0x58d54b[_0x7721('0x25')]&&_0x58d54b[_0x7721('0x27')][_0x7721('0xc')]){logger[_0x7721('0x16')](_0x7721('0x33'));return BPromise['resolve']({'id':_0x58d54b[_0x7721('0x27')][0x0]['id'],'email':_0x58d54b[_0x7721('0x27')][0x0][_0x7721('0x34')],'name':_0x58d54b['result'][0x0][_0x7721('0x35')]+'\x20'+_0x58d54b[_0x7721('0x27')]['last_name']});}else{logger[_0x7721('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7721('0x26')]({'id':_0x37b9f0[_0x7721('0x36')],'email':_0x158d98[_0x7721('0x21')],'name':_0x7721('0x37')});}})[_0x7721('0x2b')](function(_0x13c635){var _0x2f1fe0=_0x13c635[_0x7721('0x38')]||0x1f4;logger[_0x7721('0x2a')](_0x7721('0x2c'),_0x7721('0x39'),_0x2f1fe0,JSON['stringify'](_0x13c635));});}else{logger[_0x7721('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7721('0x26')]({'id':_0x37b9f0[_0x7721('0x36')],'email':_0x158d98[_0x7721('0x21')],'name':_0x7721('0x37')})[_0x7721('0x2b')](function(_0x378ba5){var _0x482b70=_0x378ba5['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0x7721('0x39'),_0x482b70,JSON[_0x7721('0x24')](_0x378ba5));});}}function getEndUser(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa){logger['info'](_0x7721('0x3a'),_0x4a90ce);return request({'method':_0x7721('0x2f'),'uri':util['format'](_0x7721('0x1e'),_0x1acc72[_0x7721('0x1f')]),'qs':{'operation':'query','username':_0x1acc72['username'],'sessionName':_0xa389fa[_0x7721('0x22')],'query':util[_0x7721('0x28')](_0x7721('0x3b'),_0x4a90ce,_0x4a90ce,_0x4a90ce,_0x4a90ce,_0x4a90ce)},'json':!![]})[_0x7721('0x32')](function(_0x577af9){if(_0x577af9[_0x7721('0x25')]&&_0x577af9[_0x7721('0x27')][_0x7721('0xc')]){logger[_0x7721('0x16')](_0x7721('0x3c'));return BPromise['resolve']({'id':_0x577af9[_0x7721('0x27')][0x0]['id'],'name':_0x577af9['result'][0x0][_0x7721('0x3d')]+'\x20'+_0x577af9['result'][0x0][_0x7721('0x3e')],'phone':_0x4a90ce});}else{logger[_0x7721('0x16')](_0x7721('0x3f'));return request({'method':'POST','uri':util[_0x7721('0x28')](_0x7721('0x1e'),_0x1acc72[_0x7721('0x1f')]),'form':{'operation':'create','sessionName':_0xa389fa[_0x7721('0x22')],'elementType':_0x7721('0x40'),'element':JSON[_0x7721('0x24')]({'lastname':_0x22ef35,'phone':_0x4a90ce,'assigned_user_id':'\x20'})},'json':!![]})[_0x7721('0x32')](function(_0x135dbc){logger[_0x7721('0x16')](_0x7721('0x41'));return BPromise['resolve']({'id':_0x135dbc['result']['id'],'name':_0x135dbc[_0x7721('0x27')][_0x7721('0x3e')],'phone':_0x135dbc[_0x7721('0x27')][_0x7721('0x42')]});})[_0x7721('0x2b')](function(_0x15181b){var _0x1d2ea5=_0x15181b[_0x7721('0x38')]||0x1f4;logger[_0x7721('0x2a')](_0x7721('0x2c'),'getEndUser',_0x1d2ea5,JSON['stringify'](_0x15181b));});}});}function getConnection(_0x5ed70d){var _0x6a4664=_0x5ed70d[_0x7721('0x21')];var _0x219c9f=_0x5ed70d['accessKey'];return request({'method':_0x7721('0x2f'),'uri':util[_0x7721('0x28')]('%s/webservice.php',_0x5ed70d[_0x7721('0x1f')]),'qs':{'operation':'getchallenge','username':_0x6a4664},'json':!![]})[_0x7721('0x32')](function(_0x5c6922){if(_0x5c6922[_0x7721('0x25')]){return request({'method':_0x7721('0x1d'),'uri':util[_0x7721('0x28')]('%s/webservice.php',_0x5ed70d[_0x7721('0x1f')]),'form':{'operation':_0x7721('0x43'),'username':_0x6a4664,'accessKey':md5(_0x5c6922['result'][_0x7721('0x44')]+_0x219c9f)},'json':!![]});}})[_0x7721('0x32')](function(_0xf88e8c){if(_0xf88e8c['success']){return BPromise[_0x7721('0x26')](_0xf88e8c['result']);}else{throw new Error(util[_0x7721('0x28')](_0x7721('0x45'),_0x5ed70d['id']));}})[_0x7721('0x2b')](function(_0x443503){var _0x1c95d8=_0x443503[_0x7721('0x38')]||0x1f4;logger[_0x7721('0x2a')](_0x7721('0x2c'),_0x7721('0x46'),_0x1c95d8,JSON[_0x7721('0x24')](_0x443503));});}function request(_0x31770e){logger[_0x7721('0x16')](_0x7721('0x47'),JSON[_0x7721('0x24')](_0x31770e));return rp(_0x31770e);}exports[_0x7721('0x48')]=function(_0x5b741d,_0x474f32,_0x2f6f30,_0x8e1214,_0x2c1119,_0x1f1ac7){var _0x315127,_0x267f5e,_0x57484c,_0x234bee;_0x1f1ac7[_0x7721('0x1f')]=intUtil[_0x7721('0x49')](_0x1f1ac7[_0x7721('0x1f')]);if(_0x2c1119&&_0x2c1119[_0x7721('0x4a')]){logger[_0x7721('0x16')](_0x7721('0x4b'),_0x7721('0x4c'));_0x474f32[_0x7721('0x4d')]=util[_0x7721('0x28')](_0x7721('0x4e'),_0x1f1ac7['serverUrl'],_0x474f32[_0x7721('0x4f')],md5(_0x474f32[_0x7721('0x4f')]));}else{_0x474f32[_0x7721('0x4d')]='';}return getConnection(_0x1f1ac7)[_0x7721('0x32')](function(_0x15ed3b){_0x234bee=_0x15ed3b;return getUser(_0x1f1ac7,_0x8e1214[_0x7721('0x50')],_0x234bee);})[_0x7721('0x32')](function(_0x36fe6f){_0x315127=_0x36fe6f;logger[_0x7721('0x16')](_0x7721('0x51'),_0x315127['id']);return getEndUser(_0x1f1ac7,_0x474f32[_0x7721('0x52')],_0x474f32[_0x7721('0x53')],_0x234bee);})[_0x7721('0x32')](function(_0x18f7f6){_0x267f5e=_0x18f7f6;logger[_0x7721('0x16')]('The\x20Enduser\x20ID\x20is:',_0x267f5e['id']);return createTicket(_0x1f1ac7,_0x315127,_0x267f5e,_0x2f6f30,_0x474f32,_0x2f6f30['Fields'],_0x234bee);})['then'](function(_0x885a3a){_0x57484c=_0x885a3a;logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x57484c['id']);var _0x47925a=util[_0x7721('0x28')](_0x7721('0x54'),_0x1f1ac7['remoteUri'],_[_0x7721('0x55')](_0x57484c['id'],'x')[0x1]);logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7721('0x28')]('user:%s',_0x8e1214['name']),'trigger:browser:url',{'uri':_0x47925a});})[_0x7721('0x2b')](function(_0x2e9155){logger[_0x7721('0x2a')]('[QUEUE]',JSON[_0x7721('0x24')](_0x2e9155));});};exports[_0x7721('0x56')]=function(_0x2c95d0,_0x168343,_0x6b7c1e,_0x16e80b,_0xad43ce,_0x3e3301,_0x127f46){var _0x197b73,_0x3b03cf,_0x10666e,_0x148562;_0x3e3301[_0x7721('0x1f')]=intUtil[_0x7721('0x49')](_0x3e3301['remoteUri']);_0x3e3301[_0x7721('0x57')]=intUtil[_0x7721('0x49')](_0x3e3301[_0x7721('0x57')]);if(_0x127f46&&_0x127f46[_0x7721('0x58')]&&_0x127f46['recordingFormat']!==_0x7721('0x59')){logger[_0x7721('0x16')]('[OUTBOUND]',_0x7721('0x4c'));_0x168343['recordingURL']=util[_0x7721('0x28')](_0x7721('0x4e'),_0x3e3301[_0x7721('0x57')],_0x168343[_0x7721('0x4f')],md5(_0x168343[_0x7721('0x4f')]));}return getConnection(_0x3e3301)[_0x7721('0x32')](function(_0x3121e0){_0x148562=_0x3121e0;return getUser(_0x3e3301,_0x16e80b[_0x7721('0x50')],_0x148562);})[_0x7721('0x32')](function(_0x57759a){_0x197b73=_0x57759a;logger[_0x7721('0x16')](_0x7721('0x51'),_0x197b73['id']);return getEndUser(_0x3e3301,_0x168343[_0x7721('0x5a')],_0x168343[_0x7721('0x5b')],_0x148562);})[_0x7721('0x32')](function(_0x3ed425){_0x3b03cf=_0x3ed425;logger[_0x7721('0x16')]('The\x20Enduser\x20ID\x20is:',_0x3b03cf['id']);return createTicket(_0x3e3301,_0x197b73,_0x3b03cf,_0x6b7c1e,_0x168343,_0x6b7c1e[_0x7721('0x5c')],_0x148562);})[_0x7721('0x32')](function(_0x53c918){_0x10666e=_0x53c918;logger[_0x7721('0x16')]('Ticket\x20created!');logger[_0x7721('0x16')](_0x7721('0x5d'),_0x10666e['id']);var _0x4282ba=util[_0x7721('0x28')](_0x7721('0x54'),_0x3e3301[_0x7721('0x1f')],_[_0x7721('0x55')](_0x10666e['id'],'x')[0x1]);logger['info'](_0x7721('0x5e'),_0x7721('0x5f'));emit(util[_0x7721('0x28')]('user:%s',_0x16e80b['name']),'trigger:browser:url',{'uri':_0x4282ba});})['catch'](function(_0x5e966f){logger[_0x7721('0x2a')](_0x7721('0x5e'),JSON['stringify'](_0x5e966f));});};exports[_0x7721('0x60')]=function(_0x42f6e9,_0xbbc86f,_0x4593e1,_0x53ebb1,_0x275b25,_0xfe9fb8){var _0x322afc,_0x1bea13,_0x3cf3fd,_0x53adb1;_0xfe9fb8[_0x7721('0x1f')]=intUtil[_0x7721('0x49')](_0xfe9fb8[_0x7721('0x1f')]);_0xfe9fb8['serverUrl']=intUtil['stripTrailingSlash'](_0xfe9fb8[_0x7721('0x57')]);if(_0x275b25&&_0x275b25[_0x7721('0x4a')]){logger[_0x7721('0x16')](_0x7721('0x61'),_0x7721('0x4c'));_0xbbc86f['recordingURL']=util['format'](_0x7721('0x4e'),_0xfe9fb8[_0x7721('0x57')],_0xbbc86f[_0x7721('0x4f')],md5(_0xbbc86f[_0x7721('0x4f')]));}else{_0xbbc86f[_0x7721('0x4d')]='';}return getConnection(_0xfe9fb8)[_0x7721('0x32')](function(_0x34187f){_0x53adb1=_0x34187f;return getUser(_0xfe9fb8,'',_0x53adb1);})['then'](function(_0xdfae41){_0x322afc=_0xdfae41;logger[_0x7721('0x16')](_0x7721('0x51'),_0x322afc['id']);return getEndUser(_0xfe9fb8,_0xbbc86f['calleridname'],_0xbbc86f[_0x7721('0x53')],_0x53adb1);})[_0x7721('0x32')](function(_0xdcd3e0){_0x1bea13=_0xdcd3e0;logger[_0x7721('0x16')]('The\x20Enduser\x20ID\x20is:',_0x1bea13['id']);return createTicket(_0xfe9fb8,_0x322afc,_0x1bea13,_0x4593e1,_0xbbc86f,_0x4593e1['Fields'],_0x53adb1);})[_0x7721('0x32')](function(_0x2cac50){_0x3cf3fd=_0x2cac50;logger[_0x7721('0x16')](_0x7721('0x62'));logger[_0x7721('0x16')](_0x7721('0x5d'),_0x3cf3fd['id']);})['catch'](function(_0x3855d5){logger[_0x7721('0x2a')](_0x7721('0x61'),JSON['stringify'](_0x3855d5));});}; \ No newline at end of file +var _0x9957=['query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','Agent\x20found!','email1','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','catch','GET','%s/webservice.php','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','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','lastname','getEndUser','accessKey','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','The\x20Enduser\x20ID\x20is:','user:%s','abandoned','[ABANDONED]','Ticket\x20created!','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','length','forEach','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','Creating\x20new\x20ticket...','Normal','Subjects','getString','Descriptions','POST','format','remoteUri','create','username','sessionName','HelpDesk','stringify','then','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','info','Getting\x20agent\x20with\x20email'];(function(_0x2a2493,_0x21526d){var _0x2cfa05=function(_0x4379e7){while(--_0x4379e7){_0x2a2493['push'](_0x2a2493['shift']());}};_0x2cfa05(++_0x21526d);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var BPromise=require(_0x7995('0x2'));var md5=require(_0x7995('0x3'));var util=require('util');var Redis=require(_0x7995('0x4'));var intUtil=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('vTiger');config[_0x7995('0x8')]=_[_0x7995('0x9')](config[_0x7995('0x8')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x8')]));function emit(_0x4996ca,_0x465276,_0x1cad37){io['to'](_0x4996ca)['emit'](_0x465276,_0x1cad37);}function getCustomFields(_0xa2e5f0,_0x3116fb){var _0x18c8a3={};if(_0xa2e5f0[_0x7995('0xc')]>0x0){_[_0x7995('0xd')](_0xa2e5f0,function(_0x1e400a){if(_0x1e400a[_0x7995('0xe')]==='string'&&_0x1e400a[_0x7995('0xf')]){_0x18c8a3[_0x1e400a[_0x7995('0xf')]]=_0x1e400a['content'][_0x7995('0x10')]();}else if(_0x1e400a[_0x7995('0xe')]===_0x7995('0x11')&&_0x1e400a[_0x7995('0x12')]&&_0x1e400a[_0x7995('0xf')]&&_0x3116fb[_0x1e400a[_0x7995('0x12')]]){_0x18c8a3[_0x1e400a[_0x7995('0xf')]]=_0x3116fb[_0x1e400a['variableName']]['toString']();}else if(_0x1e400a[_0x7995('0xe')]===_0x7995('0x13')&&_0x1e400a[_0x7995('0x14')]&&_0x1e400a[_0x7995('0x14')][_0x7995('0x15')]&&_0x1e400a[_0x7995('0xf')]&&_0x3116fb[_0x1e400a[_0x7995('0x14')][_0x7995('0x15')]['toLowerCase']()]){_0x18c8a3[_0x1e400a[_0x7995('0xf')]]=_0x3116fb[_0x1e400a['Variable'][_0x7995('0x15')][_0x7995('0x16')]()][_0x7995('0x10')]();}});}return _0x18c8a3;}function createTicket(_0x291317,_0x1e1415,_0x37a7d4,_0x4faa60,_0x54c9ae,_0x2536c8,_0x5e6f90){logger['info'](_0x7995('0x17'));var _0x3d463e=_['merge']({'parent_id':'','assigned_user_id':_0x1e1415['id'],'ticketpriorities':_0x7995('0x18'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4faa60[_0x7995('0x19')],_0x54c9ae,'\x20'),'description':intUtil[_0x7995('0x1a')](_0x4faa60[_0x7995('0x1b')],_0x54c9ae,'\x0a'),'contact_id':_0x37a7d4['id']},getCustomFields(_0x2536c8,_0x54c9ae));var _0x1a8568={'method':_0x7995('0x1c'),'uri':util[_0x7995('0x1d')]('%s/webservice.php',_0x291317[_0x7995('0x1e')]),'form':{'operation':_0x7995('0x1f'),'username':_0x291317[_0x7995('0x20')],'sessionName':_0x5e6f90[_0x7995('0x21')],'elementType':_0x7995('0x22'),'element':JSON[_0x7995('0x23')](_0x3d463e)},'json':!![]};return request(_0x1a8568)[_0x7995('0x24')](function(_0x472195){if(_0x472195['success']){return BPromise[_0x7995('0x25')]({'id':_0x472195[_0x7995('0x26')]['id']});}else{throw new Error(util[_0x7995('0x1d')](_0x7995('0x27'),JSON[_0x7995('0x23')](_0x472195[_0x7995('0x28')])));}})['catch'](function(_0x47625f){var _0x5911c3=_0x47625f[_0x7995('0x29')]||0x1f4;logger[_0x7995('0x28')](_0x7995('0x2a'),_0x7995('0x2b'),_0x5911c3,JSON[_0x7995('0x23')](_0x47625f));});}function getUser(_0x4b6f99,_0x9b2a15,_0x514445){if(intUtil[_0x7995('0x2c')](_0x9b2a15)){logger[_0x7995('0x2d')](_0x7995('0x2e'),_0x9b2a15);return request({'method':'GET','uri':util['format']('%s/webservice.php',_0x4b6f99[_0x7995('0x1e')]),'qs':{'operation':_0x7995('0x2f'),'username':_0x4b6f99[_0x7995('0x20')],'sessionName':_0x514445[_0x7995('0x21')],'query':util[_0x7995('0x1d')](_0x7995('0x30'),_0x9b2a15)},'json':!![]})['then'](function(_0x481c74){if(_0x481c74[_0x7995('0x31')]&&_0x481c74['result'][_0x7995('0xc')]){logger[_0x7995('0x2d')](_0x7995('0x32'));return BPromise[_0x7995('0x25')]({'id':_0x481c74[_0x7995('0x26')][0x0]['id'],'email':_0x481c74['result'][0x0][_0x7995('0x33')],'name':_0x481c74[_0x7995('0x26')][0x0]['first_name']+'\x20'+_0x481c74['result']['last_name']});}else{logger[_0x7995('0x2d')](_0x7995('0x34'));return BPromise['resolve']({'id':_0x514445[_0x7995('0x35')],'email':_0x4b6f99['username'],'name':_0x7995('0x36')});}})[_0x7995('0x37')](function(_0x177cb4){var _0x5014d2=_0x177cb4['statusCode']||0x1f4;logger[_0x7995('0x28')]('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x5014d2,JSON[_0x7995('0x23')](_0x177cb4));});}else{logger[_0x7995('0x2d')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7995('0x25')]({'id':_0x514445[_0x7995('0x35')],'email':_0x4b6f99[_0x7995('0x20')],'name':_0x7995('0x36')})[_0x7995('0x37')](function(_0x53002a){var _0x2d4285=_0x53002a[_0x7995('0x29')]||0x1f4;logger[_0x7995('0x28')](_0x7995('0x2a'),'getUser',_0x2d4285,JSON[_0x7995('0x23')](_0x53002a));});}}function getEndUser(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee){logger[_0x7995('0x2d')]('Searching\x20end\x20user\x20with\x20phone',_0xe5ea43);return request({'method':_0x7995('0x38'),'uri':util[_0x7995('0x1d')](_0x7995('0x39'),_0x235df7[_0x7995('0x1e')]),'qs':{'operation':_0x7995('0x2f'),'username':_0x235df7[_0x7995('0x20')],'sessionName':_0x1f5bee[_0x7995('0x21')],'query':util[_0x7995('0x1d')](_0x7995('0x3a'),_0xe5ea43,_0xe5ea43,_0xe5ea43,_0xe5ea43,_0xe5ea43)},'json':!![]})[_0x7995('0x24')](function(_0x6fe77b){if(_0x6fe77b[_0x7995('0x31')]&&_0x6fe77b[_0x7995('0x26')]['length']){logger['info'](_0x7995('0x3b'));return BPromise[_0x7995('0x25')]({'id':_0x6fe77b['result'][0x0]['id'],'name':_0x6fe77b['result'][0x0][_0x7995('0x3c')]+'\x20'+_0x6fe77b['result'][0x0]['lastname'],'phone':_0xe5ea43});}else{logger[_0x7995('0x2d')](_0x7995('0x3d'));return request({'method':_0x7995('0x1c'),'uri':util['format'](_0x7995('0x39'),_0x235df7['remoteUri']),'form':{'operation':_0x7995('0x1f'),'sessionName':_0x1f5bee['sessionName'],'elementType':'Contacts','element':JSON[_0x7995('0x23')]({'lastname':_0x3eb04f,'phone':_0xe5ea43,'assigned_user_id':'\x20'})},'json':!![]})[_0x7995('0x24')](function(_0xc04e5){logger[_0x7995('0x2d')]('Enduser\x20created.');return BPromise[_0x7995('0x25')]({'id':_0xc04e5[_0x7995('0x26')]['id'],'name':_0xc04e5[_0x7995('0x26')][_0x7995('0x3e')],'phone':_0xc04e5['result']['phone']});})[_0x7995('0x37')](function(_0x55791b){var _0x23c41d=_0x55791b['statusCode']||0x1f4;logger[_0x7995('0x28')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x7995('0x3f'),_0x23c41d,JSON[_0x7995('0x23')](_0x55791b));});}});}function getConnection(_0x4d9245){var _0x3e9e62=_0x4d9245[_0x7995('0x20')];var _0x314145=_0x4d9245[_0x7995('0x40')];return request({'method':'GET','uri':util[_0x7995('0x1d')](_0x7995('0x39'),_0x4d9245[_0x7995('0x1e')]),'qs':{'operation':'getchallenge','username':_0x3e9e62},'json':!![]})[_0x7995('0x24')](function(_0x44f516){if(_0x44f516[_0x7995('0x31')]){return request({'method':_0x7995('0x1c'),'uri':util[_0x7995('0x1d')]('%s/webservice.php',_0x4d9245[_0x7995('0x1e')]),'form':{'operation':_0x7995('0x41'),'username':_0x3e9e62,'accessKey':md5(_0x44f516['result'][_0x7995('0x42')]+_0x314145)},'json':!![]});}})['then'](function(_0x1d87f9){if(_0x1d87f9[_0x7995('0x31')]){return BPromise[_0x7995('0x25')](_0x1d87f9[_0x7995('0x26')]);}else{throw new Error(util[_0x7995('0x1d')](_0x7995('0x43'),_0x4d9245['id']));}})[_0x7995('0x37')](function(_0x4d46bc){var _0x427dcf=_0x4d46bc[_0x7995('0x29')]||0x1f4;logger[_0x7995('0x28')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x7995('0x44'),_0x427dcf,JSON[_0x7995('0x23')](_0x4d46bc));});}function request(_0x12d4b8){logger['info']('[HTTP]',JSON['stringify'](_0x12d4b8));return rp(_0x12d4b8);}exports[_0x7995('0x45')]=function(_0x1fd1ca,_0x4cf5db,_0x1cd85,_0x29f300,_0x31f27c,_0x1a9bd7){var _0xc04004,_0x528c8e,_0x29ee32,_0x4ab09f;_0x1a9bd7[_0x7995('0x1e')]=intUtil[_0x7995('0x46')](_0x1a9bd7[_0x7995('0x1e')]);if(_0x31f27c&&_0x31f27c['monitor_format']){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x4cf5db[_0x7995('0x47')]=util[_0x7995('0x1d')](_0x7995('0x48'),_0x1a9bd7[_0x7995('0x49')],_0x4cf5db[_0x7995('0x4a')],md5(_0x4cf5db[_0x7995('0x4a')]));}else{_0x4cf5db[_0x7995('0x47')]='';}return getConnection(_0x1a9bd7)[_0x7995('0x24')](function(_0x328671){_0x4ab09f=_0x328671;return getUser(_0x1a9bd7,_0x29f300[_0x7995('0x4b')],_0x4ab09f);})[_0x7995('0x24')](function(_0x133c63){_0xc04004=_0x133c63;logger[_0x7995('0x2d')](_0x7995('0x4c'),_0xc04004['id']);return getEndUser(_0x1a9bd7,_0x4cf5db[_0x7995('0x4d')],_0x4cf5db[_0x7995('0x4e')],_0x4ab09f);})[_0x7995('0x24')](function(_0x223e08){_0x528c8e=_0x223e08;logger[_0x7995('0x2d')]('The\x20Enduser\x20ID\x20is:',_0x528c8e['id']);return createTicket(_0x1a9bd7,_0xc04004,_0x528c8e,_0x1cd85,_0x4cf5db,_0x1cd85[_0x7995('0x4f')],_0x4ab09f);})[_0x7995('0x24')](function(_0x3b8a54){_0x29ee32=_0x3b8a54;logger[_0x7995('0x2d')]('Ticket\x20created!');logger['info'](_0x7995('0x50'),_0x29ee32['id']);var _0x197b52=util[_0x7995('0x1d')](_0x7995('0x51'),_0x1a9bd7['remoteUri'],_[_0x7995('0x52')](_0x29ee32['id'],'x')[0x1]);logger[_0x7995('0x2d')](_0x7995('0x53'),_0x7995('0x54'));emit(util['format']('user:%s',_0x29f300[_0x7995('0x15')]),_0x7995('0x55'),{'uri':_0x197b52});})[_0x7995('0x37')](function(_0x1d69ce){logger[_0x7995('0x28')](_0x7995('0x53'),JSON[_0x7995('0x23')](_0x1d69ce));});};exports[_0x7995('0x56')]=function(_0x984c23,_0x50caf5,_0x18f230,_0x3ec5a8,_0xdf9e38,_0x1ecfdb,_0x59c5aa){var _0x51bf6a,_0x3053fd,_0xebb5c8,_0x47d5d7;_0x1ecfdb[_0x7995('0x1e')]=intUtil[_0x7995('0x46')](_0x1ecfdb[_0x7995('0x1e')]);_0x1ecfdb[_0x7995('0x49')]=intUtil[_0x7995('0x46')](_0x1ecfdb['serverUrl']);if(_0x59c5aa&&_0x59c5aa[_0x7995('0x57')]&&_0x59c5aa['recordingFormat']!==_0x7995('0x58')){logger[_0x7995('0x2d')](_0x7995('0x59'),_0x7995('0x5a'));_0x50caf5[_0x7995('0x47')]=util[_0x7995('0x1d')](_0x7995('0x48'),_0x1ecfdb[_0x7995('0x49')],_0x50caf5[_0x7995('0x4a')],md5(_0x50caf5[_0x7995('0x4a')]));}return getConnection(_0x1ecfdb)[_0x7995('0x24')](function(_0x234d8d){_0x47d5d7=_0x234d8d;return getUser(_0x1ecfdb,_0x3ec5a8['email'],_0x47d5d7);})[_0x7995('0x24')](function(_0x23bbc1){_0x51bf6a=_0x23bbc1;logger[_0x7995('0x2d')](_0x7995('0x4c'),_0x51bf6a['id']);return getEndUser(_0x1ecfdb,_0x50caf5[_0x7995('0x5b')],_0x50caf5['destcalleridnum'],_0x47d5d7);})['then'](function(_0x268fde){_0x3053fd=_0x268fde;logger[_0x7995('0x2d')](_0x7995('0x5c'),_0x3053fd['id']);return createTicket(_0x1ecfdb,_0x51bf6a,_0x3053fd,_0x18f230,_0x50caf5,_0x18f230[_0x7995('0x4f')],_0x47d5d7);})['then'](function(_0x22d317){_0xebb5c8=_0x22d317;logger['info']('Ticket\x20created!');logger[_0x7995('0x2d')](_0x7995('0x50'),_0xebb5c8['id']);var _0x3f0a71=util[_0x7995('0x1d')](_0x7995('0x51'),_0x1ecfdb[_0x7995('0x1e')],_[_0x7995('0x52')](_0xebb5c8['id'],'x')[0x1]);logger[_0x7995('0x2d')](_0x7995('0x59'),_0x7995('0x54'));emit(util['format'](_0x7995('0x5d'),_0x3ec5a8[_0x7995('0x15')]),_0x7995('0x55'),{'uri':_0x3f0a71});})['catch'](function(_0x1fe1cb){logger[_0x7995('0x28')](_0x7995('0x59'),JSON[_0x7995('0x23')](_0x1fe1cb));});};exports[_0x7995('0x5e')]=function(_0x51ab1e,_0x550a10,_0x3adfd2,_0x2f94c4,_0x1fdff6,_0x435a1b){var _0x535131,_0x5e8b4c,_0xd07c1c,_0xfe1105;_0x435a1b[_0x7995('0x1e')]=intUtil[_0x7995('0x46')](_0x435a1b['remoteUri']);_0x435a1b[_0x7995('0x49')]=intUtil[_0x7995('0x46')](_0x435a1b['serverUrl']);if(_0x1fdff6&&_0x1fdff6['monitor_format']){logger[_0x7995('0x2d')](_0x7995('0x5f'),'Recording\x20is\x20enabled!');_0x550a10[_0x7995('0x47')]=util['format'](_0x7995('0x48'),_0x435a1b[_0x7995('0x49')],_0x550a10['uniqueid'],md5(_0x550a10['uniqueid']));}else{_0x550a10[_0x7995('0x47')]='';}return getConnection(_0x435a1b)['then'](function(_0x31b9e6){_0xfe1105=_0x31b9e6;return getUser(_0x435a1b,'',_0xfe1105);})[_0x7995('0x24')](function(_0x3dd197){_0x535131=_0x3dd197;logger[_0x7995('0x2d')](_0x7995('0x4c'),_0x535131['id']);return getEndUser(_0x435a1b,_0x550a10[_0x7995('0x4d')],_0x550a10[_0x7995('0x4e')],_0xfe1105);})[_0x7995('0x24')](function(_0x29e0ee){_0x5e8b4c=_0x29e0ee;logger[_0x7995('0x2d')](_0x7995('0x5c'),_0x5e8b4c['id']);return createTicket(_0x435a1b,_0x535131,_0x5e8b4c,_0x3adfd2,_0x550a10,_0x3adfd2[_0x7995('0x4f')],_0xfe1105);})[_0x7995('0x24')](function(_0x1ff436){_0xd07c1c=_0x1ff436;logger[_0x7995('0x2d')](_0x7995('0x60'));logger[_0x7995('0x2d')](_0x7995('0x50'),_0xd07c1c['id']);})[_0x7995('0x37')](function(_0xa2fc8e){logger[_0x7995('0x28')](_0x7995('0x5f'),JSON[_0x7995('0x23')](_0xa2fc8e));});}; \ 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 e446753..ab7b4c9 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 _0xdcf0=['Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20found!','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','token','Basic\x20%s','base64','debug','[HTTP]','stringify','GET','forEach','nameField','customField','toLowerCase','content','toString','string','idField','custom_fields','push','type','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','lodash','request-promise','util','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','merge','getString','Subjects','Descriptions','Fields','then','validateEmail','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xdcf0,0xb8));var _0x0dcf=function(_0x5c897c,_0x317783){_0x5c897c=_0x5c897c-0x0;var _0x5b44f8=_0xdcf0[_0x5c897c];return _0x5b44f8;};'use strict';var _=require(_0x0dcf('0x0'));var rp=require(_0x0dcf('0x1'));var md5=require('md5');var util=require(_0x0dcf('0x2'));var Redis=require(_0x0dcf('0x3'));var intUtil=require('./util');var config=require(_0x0dcf('0x4'));var logger=require('../../../../config/logger')('zendesk');config[_0x0dcf('0x5')]=_[_0x0dcf('0x6')](config[_0x0dcf('0x5')],{'host':_0x0dcf('0x7'),'port':0x18eb});var io=require(_0x0dcf('0x8'))(new Redis(config['redis']));function emit(_0x9809c2,_0x4ea8e2,_0x37871c){io['to'](_0x9809c2)[_0x0dcf('0x9')](_0x4ea8e2,_0x37871c);}var headers={'Content-Type':_0x0dcf('0xa'),'Accept':_0x0dcf('0xa')};function getTicket(_0x17e8d6,_0x382d34,_0xdf6576,_0x54cf11,_0x1f346b){logger[_0x0dcf('0xb')](_0x0dcf('0xc'));return request({'uri':util[_0x0dcf('0xd')](_0x0dcf('0xe'),_0x17e8d6['remoteUri']),'method':'POST','body':{'ticket':_[_0x0dcf('0xf')]({'requester_id':_0xdf6576['id'],'submitter_id':_0x382d34?_0x382d34['id']:undefined,'assignee_id':_0x382d34?_0x382d34['id']:undefined,'tags':getTags(_0x54cf11['Tags'],'name'),'subject':intUtil[_0x0dcf('0x10')](_0x54cf11[_0x0dcf('0x11')],_0x1f346b,'\x20'),'description':intUtil[_0x0dcf('0x10')](_0x54cf11[_0x0dcf('0x12')],_0x1f346b,'\x0a'),'comment':{'public':![],'body':intUtil[_0x0dcf('0x10')](_0x54cf11[_0x0dcf('0x12')],_0x1f346b,'\x0a')}},getCustomFields(_0x54cf11[_0x0dcf('0x13')],_0x1f346b))}})[_0x0dcf('0x14')](function(_0x5e35b6){logger[_0x0dcf('0xb')]('Ticket\x20created!');return _0x5e35b6['ticket'];});}function getUser(_0x27df28,_0x23dc2a){if(intUtil[_0x0dcf('0x15')](_0x23dc2a)){logger[_0x0dcf('0xb')]('Getting\x20agent\x20with\x20email',_0x23dc2a);return request({'uri':util[_0x0dcf('0xd')](_0x0dcf('0x16'),_0x27df28[_0x0dcf('0x17')]),'qs':{'query':util[_0x0dcf('0xd')](_0x0dcf('0x18'),_0x23dc2a)}})[_0x0dcf('0x14')](function(_0x20fda2){if(_0x20fda2[_0x0dcf('0x19')]){logger[_0x0dcf('0xb')](_0x0dcf('0x1a'));return _['find'](_0x20fda2[_0x0dcf('0x1b')],{'email':_0x23dc2a,'role':_0x0dcf('0x1c')});}else{logger['info'](_0x0dcf('0x1d'));return request({'uri':util[_0x0dcf('0xd')](_0x0dcf('0x1e'),_0x27df28[_0x0dcf('0x17')])})['then'](function(_0x4bd0e9){logger[_0x0dcf('0xb')](_0x0dcf('0x1f'));return _0x4bd0e9[_0x0dcf('0x20')];});}});}else{logger['info'](_0x0dcf('0x1d'));return request({'uri':util[_0x0dcf('0xd')](_0x0dcf('0x1e'),_0x27df28['remoteUri'])})[_0x0dcf('0x14')](function(_0x44e061){logger['info'](_0x0dcf('0x1f'));return _0x44e061[_0x0dcf('0x20')];});}}function getEndUser(_0x43d8d5,_0x113418,_0x41a89e){logger[_0x0dcf('0xb')]('Searching\x20enduser\x20with\x20phone',_0x41a89e);return request({'uri':util[_0x0dcf('0xd')](_0x0dcf('0x16'),_0x43d8d5[_0x0dcf('0x17')]),'qs':{'query':util[_0x0dcf('0xd')](_0x0dcf('0x21'),_0x41a89e)}})[_0x0dcf('0x14')](function(_0x125f1a){var _0x16c94f;if(_0x125f1a[_0x0dcf('0x1b')][_0x0dcf('0x22')]){_0x125f1a[_0x0dcf('0x1b')]=_[_0x0dcf('0x23')](_0x125f1a[_0x0dcf('0x1b')],{'suspended':![],'role':_0x0dcf('0x24')});if(_0x125f1a[_0x0dcf('0x1b')][_0x0dcf('0x22')]){_0x16c94f=_['first'](_0x125f1a[_0x0dcf('0x1b')]);}}if(_0x16c94f){logger[_0x0dcf('0xb')](_0x0dcf('0x25'));return _0x16c94f;}else{logger[_0x0dcf('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format']('%s/users.json',_0x43d8d5[_0x0dcf('0x17')]),'method':_0x0dcf('0x26'),'body':{'user':{'role':'end-user','name':util[_0x0dcf('0xd')](_0x0dcf('0x27'),_0x113418||_0x41a89e),'phone':_0x41a89e}}})['then'](function(_0x5de922){logger['info'](_0x0dcf('0x28'));return _0x5de922[_0x0dcf('0x20')];});}});}function getAuth(_0x4c4d09){var _0x49224d;if(_0x4c4d09[_0x0dcf('0x29')]===_0x0dcf('0x2a')){_0x49224d=util[_0x0dcf('0xd')](_0x0dcf('0x2b'),_0x4c4d09[_0x0dcf('0x2c')],_0x4c4d09[_0x0dcf('0x2a')]);}else if(_0x4c4d09[_0x0dcf('0x29')]==='token'){_0x49224d=util[_0x0dcf('0xd')](_0x0dcf('0x2d'),_0x4c4d09[_0x0dcf('0x2c')],_0x4c4d09[_0x0dcf('0x2e')]);}return util[_0x0dcf('0xd')](_0x0dcf('0x2f'),new Buffer(_0x49224d)['toString'](_0x0dcf('0x30')));}function request(_0x23ad91){logger[_0x0dcf('0x31')](_0x0dcf('0x32'),JSON[_0x0dcf('0x33')](_0x23ad91));return rp(_[_0x0dcf('0x6')](_0x23ad91,{'method':_0x0dcf('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x18695b,_0x39107d){var _0x26bc43=[];if(_0x18695b&&_0x18695b['length']>0x0){_0x26bc43=_['map'](_0x18695b,_0x39107d);}return _0x26bc43;}function getCustomFields(_0x277f22,_0x2125cd){var _0x2c7f8f=[];var _0x1229ad={'custom_fields':[]};if(_0x277f22[_0x0dcf('0x22')]>0x0){_[_0x0dcf('0x35')](_0x277f22,function(_0x216da9){if(_0x216da9['type']==='string'&&_0x216da9[_0x0dcf('0x36')]&&!_0x216da9[_0x0dcf('0x37')]){_0x1229ad[_0x216da9[_0x0dcf('0x36')][_0x0dcf('0x38')]()]=_0x216da9[_0x0dcf('0x39')][_0x0dcf('0x3a')]();}else if(_0x216da9['type']===_0x0dcf('0x3b')&&_0x216da9[_0x0dcf('0x3c')]&&_0x216da9[_0x0dcf('0x37')]){_0x1229ad[_0x0dcf('0x3d')][_0x0dcf('0x3e')]({'id':_0x216da9[_0x0dcf('0x3c')],'value':_0x216da9[_0x0dcf('0x39')][_0x0dcf('0x3a')]()});}else if(_0x216da9[_0x0dcf('0x3f')]==='variable'&&_0x216da9['variableName']&&_0x216da9[_0x0dcf('0x3c')]&&_0x216da9[_0x0dcf('0x37')]){_0x2125cd[_0x216da9[_0x0dcf('0x40')]]&&_0x1229ad[_0x0dcf('0x3d')][_0x0dcf('0x3e')]({'id':_0x216da9[_0x0dcf('0x3c')],'value':_0x2125cd[_0x216da9['variableName']][_0x0dcf('0x3a')]()});}else if(_0x216da9[_0x0dcf('0x3f')]===_0x0dcf('0x41')&&_0x216da9[_0x0dcf('0x42')]&&_0x216da9[_0x0dcf('0x42')][_0x0dcf('0x43')]&&_0x216da9[_0x0dcf('0x3c')]&&_0x216da9[_0x0dcf('0x37')]){_0x2125cd[_0x216da9['Variable'][_0x0dcf('0x43')][_0x0dcf('0x38')]()]&&_0x1229ad['custom_fields'][_0x0dcf('0x3e')]({'id':_0x216da9[_0x0dcf('0x3c')],'value':_0x2125cd[_0x216da9['Variable'][_0x0dcf('0x43')][_0x0dcf('0x38')]()]['toString']()});}});}return _0x1229ad;}exports[_0x0dcf('0x44')]=function(_0xaa1a79,_0x49ff0e,_0x2e58b3,_0x4874ba,_0x50e1e3,_0x55f90f){var _0x24f692,_0x3451b7;_0x55f90f[_0x0dcf('0x17')]=intUtil[_0x0dcf('0x45')](_0x55f90f[_0x0dcf('0x17')]);_0x55f90f[_0x0dcf('0x46')]=intUtil['stripTrailingSlash'](_0x55f90f[_0x0dcf('0x46')]);if(_0x50e1e3&&_0x50e1e3[_0x0dcf('0x47')]){logger[_0x0dcf('0xb')]('[QUEUE]',_0x0dcf('0x48'));_0x49ff0e[_0x0dcf('0x49')]=util[_0x0dcf('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x55f90f[_0x0dcf('0x46')],_0x49ff0e[_0x0dcf('0x4a')],md5(_0x49ff0e[_0x0dcf('0x4a')]));}else{_0x49ff0e['recordingURL']='';}headers[_0x0dcf('0x4b')]=getAuth(_0x55f90f);return getUser(_0x55f90f,_0x4874ba[_0x0dcf('0x4c')])['then'](function(_0x55e308){_0x24f692=_0x55e308;logger[_0x0dcf('0xb')](_0x0dcf('0x4d'),_0x24f692['id']);return getEndUser(_0x55f90f,_0x49ff0e[_0x0dcf('0x4e')],_0x49ff0e[_0x0dcf('0x4f')]);})[_0x0dcf('0x14')](function(_0x13a7ee){_0x3451b7=_0x13a7ee;logger['info'](_0x0dcf('0x50'),_0x3451b7['id']);return getTicket(_0x55f90f,_0x24f692,_0x3451b7,_0x2e58b3,_0x49ff0e);})[_0x0dcf('0x14')](function(_0x40b912){if(_0x40b912){logger[_0x0dcf('0xb')](_0x0dcf('0x51'),_0x40b912['id']);switch(_0x55f90f['type']){case'integrationTab':logger['info'](_0x0dcf('0x52'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x0dcf('0xd')](_0x0dcf('0x53'),_0x55f90f[_0x0dcf('0x17')],_0x24f692['id'],_0x40b912['id']),'method':'POST'});case'newTab':logger[_0x0dcf('0xb')](_0x0dcf('0x52'),_0x0dcf('0x54'));emit(util[_0x0dcf('0xd')](_0x0dcf('0x55'),_0x4874ba[_0x0dcf('0x43')]),_0x0dcf('0x56'),{'uri':util[_0x0dcf('0xd')](_0x0dcf('0x57'),_0x55f90f[_0x0dcf('0x17')],_0x40b912['id'])});break;default:logger[_0x0dcf('0x58')](_0x0dcf('0x52'),_0x0dcf('0x59'));}}})['catch'](function(_0x2c5c1d){logger[_0x0dcf('0x58')](_0x0dcf('0x5a'),util[_0x0dcf('0x5b')](_0x2c5c1d,{'showHidden':!![],'depth':null}));});};exports[_0x0dcf('0x5c')]=function(_0x2df879,_0x53032f,_0x570577,_0x5ea399,_0x5a18b4,_0x2e07ab,_0x1e064b){var _0x2127e4,_0x189c1a;_0x2e07ab[_0x0dcf('0x17')]=intUtil[_0x0dcf('0x45')](_0x2e07ab[_0x0dcf('0x17')]);_0x2e07ab['serverUrl']=intUtil['stripTrailingSlash'](_0x2e07ab[_0x0dcf('0x46')]);if(_0x1e064b&&_0x1e064b['recordingFormat']&&_0x1e064b[_0x0dcf('0x5d')]!==_0x0dcf('0x5e')){logger['info'](_0x0dcf('0x5f'),'Recording\x20is\x20enabled!');_0x53032f['recordingURL']=util[_0x0dcf('0xd')](_0x0dcf('0x60'),_0x2e07ab[_0x0dcf('0x46')],_0x53032f[_0x0dcf('0x4a')],md5(_0x53032f['uniqueid']));}headers[_0x0dcf('0x4b')]=getAuth(_0x2e07ab);return getUser(_0x2e07ab,_0x5ea399[_0x0dcf('0x4c')])['then'](function(_0xdb5ad5){_0x2127e4=_0xdb5ad5;logger[_0x0dcf('0xb')](_0x0dcf('0x4d'),_0x2127e4['id']);return getEndUser(_0x2e07ab,_0x53032f[_0x0dcf('0x61')],_0x53032f[_0x0dcf('0x62')]);})[_0x0dcf('0x14')](function(_0x3ea0ae){_0x189c1a=_0x3ea0ae;logger[_0x0dcf('0xb')]('The\x20Enduser\x20ID\x20is:',_0x189c1a['id']);return getTicket(_0x2e07ab,_0x2127e4,_0x189c1a,_0x570577,_0x53032f);})[_0x0dcf('0x14')](function(_0x2323f6){if(_0x2323f6){logger[_0x0dcf('0xb')]('The\x20Ticket\x20ID\x20is:',_0x2323f6['id']);switch(_0x2e07ab[_0x0dcf('0x3f')]){case _0x0dcf('0x63'):logger[_0x0dcf('0xb')]('[OUTBOUND]',_0x0dcf('0x64'));return request({'uri':util['format'](_0x0dcf('0x53'),_0x2e07ab[_0x0dcf('0x17')],_0x2127e4['id'],_0x2323f6['id']),'method':_0x0dcf('0x26')});case'newTab':logger[_0x0dcf('0xb')]('[OUTBOUND]',_0x0dcf('0x54'));emit(util[_0x0dcf('0xd')](_0x0dcf('0x55'),_0x5ea399['name']),_0x0dcf('0x56'),{'uri':util['format'](_0x0dcf('0x57'),_0x2e07ab[_0x0dcf('0x17')],_0x2323f6['id'])});break;default:logger['error'](_0x0dcf('0x5f'),_0x0dcf('0x59'));}}})[_0x0dcf('0x65')](function(_0xbd8c87){logger[_0x0dcf('0x58')](_0x0dcf('0x66'),util[_0x0dcf('0x5b')](_0xbd8c87,{'showHidden':!![],'depth':null}));});};exports[_0x0dcf('0x67')]=function(_0x291b77,_0x43f497,_0x44ab6b,_0x2ea1ba,_0x322801,_0x4f3fcb){var _0x4b3dda,_0x4edd30;_0x4f3fcb[_0x0dcf('0x17')]=intUtil[_0x0dcf('0x45')](_0x4f3fcb[_0x0dcf('0x17')]);_0x4f3fcb[_0x0dcf('0x46')]=intUtil[_0x0dcf('0x45')](_0x4f3fcb['serverUrl']);if(_0x322801&&_0x322801[_0x0dcf('0x47')]){logger['info'](_0x0dcf('0x68'),'Recording\x20is\x20enabled!');_0x43f497[_0x0dcf('0x49')]=util[_0x0dcf('0xd')](_0x0dcf('0x60'),_0x4f3fcb[_0x0dcf('0x46')],_0x43f497[_0x0dcf('0x4a')],md5(_0x43f497[_0x0dcf('0x4a')]));}else{_0x43f497[_0x0dcf('0x49')]='';}headers[_0x0dcf('0x4b')]=getAuth(_0x4f3fcb);return getUser(_0x4f3fcb)[_0x0dcf('0x14')](function(_0x36d625){_0x4b3dda=_0x36d625;logger[_0x0dcf('0xb')](_0x0dcf('0x4d'),_0x4b3dda['id']);return getEndUser(_0x4f3fcb,_0x43f497['calleridname'],_0x43f497['calleridnum']);})['then'](function(_0x339b26){_0x4edd30=_0x339b26;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4edd30['id']);return getTicket(_0x4f3fcb,_0x4b3dda,_0x4edd30,_0x44ab6b,_0x43f497);})[_0x0dcf('0x14')](function(_0x2d83ab){if(_0x2d83ab){logger['info'](_0x0dcf('0x51'),_0x2d83ab['id']);}})[_0x0dcf('0x65')](function(_0x5a8fc3){logger[_0x0dcf('0x58')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util[_0x0dcf('0x5b')](_0x5a8fc3,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0d4e=['content','toString','type','idField','custom_fields','push','variableName','customVariable','Variable','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','stripTrailingSlash','recordingFormat','[OUTBOUND]','recordingURL','destcalleridname','Displaying\x20ticket\x20to\x20agent...','error','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','monitor_format','[ABANDONED]','The\x20Ticket\x20ID\x20is:','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','ticket','Getting\x20agent\x20with\x20email','%s/search.json','count','Agent\x20found!','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','base64','[HTTP]','stringify','GET','forEach','nameField','customField'];(function(_0x484fba,_0x91a148){var _0x2ab031=function(_0x1f96da){while(--_0x1f96da){_0x484fba['push'](_0x484fba['shift']());}};_0x2ab031(++_0x91a148);}(_0x0d4e,0x1ca));var _0xe0d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0d4e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe0d4('0x0'));var rp=require(_0xe0d4('0x1'));var md5=require(_0xe0d4('0x2'));var util=require(_0xe0d4('0x3'));var Redis=require(_0xe0d4('0x4'));var intUtil=require(_0xe0d4('0x5'));var config=require(_0xe0d4('0x6'));var logger=require(_0xe0d4('0x7'))(_0xe0d4('0x8'));config['redis']=_[_0xe0d4('0x9')](config[_0xe0d4('0xa')],{'host':_0xe0d4('0xb'),'port':0x18eb});var io=require(_0xe0d4('0xc'))(new Redis(config['redis']));function emit(_0x4a2a87,_0x312e09,_0x1ba14d){io['to'](_0x4a2a87)[_0xe0d4('0xd')](_0x312e09,_0x1ba14d);}var headers={'Content-Type':_0xe0d4('0xe'),'Accept':_0xe0d4('0xe')};function getTicket(_0x11aa34,_0x43ae3a,_0xb36d72,_0x1dd35d,_0x215d49){logger[_0xe0d4('0xf')](_0xe0d4('0x10'));return request({'uri':util[_0xe0d4('0x11')]('%s/tickets.json',_0x11aa34[_0xe0d4('0x12')]),'method':_0xe0d4('0x13'),'body':{'ticket':_[_0xe0d4('0x14')]({'requester_id':_0xb36d72['id'],'submitter_id':_0x43ae3a?_0x43ae3a['id']:undefined,'assignee_id':_0x43ae3a?_0x43ae3a['id']:undefined,'tags':getTags(_0x1dd35d[_0xe0d4('0x15')],_0xe0d4('0x16')),'subject':intUtil[_0xe0d4('0x17')](_0x1dd35d[_0xe0d4('0x18')],_0x215d49,'\x20'),'description':intUtil[_0xe0d4('0x17')](_0x1dd35d[_0xe0d4('0x19')],_0x215d49,'\x0a'),'comment':{'public':![],'body':intUtil[_0xe0d4('0x17')](_0x1dd35d[_0xe0d4('0x19')],_0x215d49,'\x0a')}},getCustomFields(_0x1dd35d[_0xe0d4('0x1a')],_0x215d49))}})[_0xe0d4('0x1b')](function(_0x344d85){logger[_0xe0d4('0xf')]('Ticket\x20created!');return _0x344d85[_0xe0d4('0x1c')];});}function getUser(_0x3c0986,_0xe0d15b){if(intUtil['validateEmail'](_0xe0d15b)){logger['info'](_0xe0d4('0x1d'),_0xe0d15b);return request({'uri':util[_0xe0d4('0x11')](_0xe0d4('0x1e'),_0x3c0986[_0xe0d4('0x12')]),'qs':{'query':util[_0xe0d4('0x11')]('type:user\x20role:agent\x20email:%s',_0xe0d15b)}})[_0xe0d4('0x1b')](function(_0x13192c){if(_0x13192c[_0xe0d4('0x1f')]){logger[_0xe0d4('0xf')](_0xe0d4('0x20'));return _['find'](_0x13192c[_0xe0d4('0x21')],{'email':_0xe0d15b,'role':'agent'});}else{logger['info'](_0xe0d4('0x22'));return request({'uri':util[_0xe0d4('0x11')](_0xe0d4('0x23'),_0x3c0986['remoteUri'])})[_0xe0d4('0x1b')](function(_0x4527e9){logger[_0xe0d4('0xf')](_0xe0d4('0x24'));return _0x4527e9[_0xe0d4('0x25')];});}});}else{logger[_0xe0d4('0xf')](_0xe0d4('0x22'));return request({'uri':util[_0xe0d4('0x11')](_0xe0d4('0x23'),_0x3c0986['remoteUri'])})[_0xe0d4('0x1b')](function(_0x24ef5e){logger['info'](_0xe0d4('0x24'));return _0x24ef5e['user'];});}}function getEndUser(_0x13c108,_0x9fc63d,_0x2229d0){logger['info'](_0xe0d4('0x26'),_0x2229d0);return request({'uri':util['format']('%s/search.json',_0x13c108[_0xe0d4('0x12')]),'qs':{'query':util[_0xe0d4('0x11')](_0xe0d4('0x27'),_0x2229d0)}})[_0xe0d4('0x1b')](function(_0x136ecd){var _0x207c71;if(_0x136ecd[_0xe0d4('0x21')][_0xe0d4('0x28')]){_0x136ecd[_0xe0d4('0x21')]=_[_0xe0d4('0x29')](_0x136ecd[_0xe0d4('0x21')],{'suspended':![],'role':_0xe0d4('0x2a')});if(_0x136ecd[_0xe0d4('0x21')][_0xe0d4('0x28')]){_0x207c71=_['first'](_0x136ecd[_0xe0d4('0x21')]);}}if(_0x207c71){logger['info'](_0xe0d4('0x2b'));return _0x207c71;}else{logger[_0xe0d4('0xf')](_0xe0d4('0x2c'));return request({'uri':util[_0xe0d4('0x11')](_0xe0d4('0x2d'),_0x13c108[_0xe0d4('0x12')]),'method':_0xe0d4('0x13'),'body':{'user':{'role':_0xe0d4('0x2a'),'name':util[_0xe0d4('0x11')](_0xe0d4('0x2e'),_0x9fc63d||_0x2229d0),'phone':_0x2229d0}}})[_0xe0d4('0x1b')](function(_0x7b9296){logger['info'](_0xe0d4('0x2f'));return _0x7b9296['user'];});}});}function getAuth(_0x3ce010){var _0x4f11f9;if(_0x3ce010[_0xe0d4('0x30')]===_0xe0d4('0x31')){_0x4f11f9=util[_0xe0d4('0x11')](_0xe0d4('0x32'),_0x3ce010['username'],_0x3ce010[_0xe0d4('0x31')]);}else if(_0x3ce010[_0xe0d4('0x30')]===_0xe0d4('0x33')){_0x4f11f9=util[_0xe0d4('0x11')](_0xe0d4('0x34'),_0x3ce010[_0xe0d4('0x35')],_0x3ce010[_0xe0d4('0x33')]);}return util[_0xe0d4('0x11')](_0xe0d4('0x36'),new Buffer(_0x4f11f9)['toString'](_0xe0d4('0x37')));}function request(_0x619eb2){logger['debug'](_0xe0d4('0x38'),JSON[_0xe0d4('0x39')](_0x619eb2));return rp(_[_0xe0d4('0x9')](_0x619eb2,{'method':_0xe0d4('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x354753,_0x1da547){var _0x48a29d=[];if(_0x354753&&_0x354753[_0xe0d4('0x28')]>0x0){_0x48a29d=_['map'](_0x354753,_0x1da547);}return _0x48a29d;}function getCustomFields(_0x5cbdb2,_0x5493de){var _0xc86f0e=[];var _0x349034={'custom_fields':[]};if(_0x5cbdb2[_0xe0d4('0x28')]>0x0){_[_0xe0d4('0x3b')](_0x5cbdb2,function(_0x190540){if(_0x190540['type']==='string'&&_0x190540[_0xe0d4('0x3c')]&&!_0x190540[_0xe0d4('0x3d')]){_0x349034[_0x190540[_0xe0d4('0x3c')]['toLowerCase']()]=_0x190540[_0xe0d4('0x3e')][_0xe0d4('0x3f')]();}else if(_0x190540[_0xe0d4('0x40')]==='string'&&_0x190540[_0xe0d4('0x41')]&&_0x190540[_0xe0d4('0x3d')]){_0x349034[_0xe0d4('0x42')][_0xe0d4('0x43')]({'id':_0x190540[_0xe0d4('0x41')],'value':_0x190540[_0xe0d4('0x3e')][_0xe0d4('0x3f')]()});}else if(_0x190540[_0xe0d4('0x40')]==='variable'&&_0x190540[_0xe0d4('0x44')]&&_0x190540[_0xe0d4('0x41')]&&_0x190540[_0xe0d4('0x3d')]){_0x5493de[_0x190540[_0xe0d4('0x44')]]&&_0x349034[_0xe0d4('0x42')][_0xe0d4('0x43')]({'id':_0x190540['idField'],'value':_0x5493de[_0x190540[_0xe0d4('0x44')]]['toString']()});}else if(_0x190540[_0xe0d4('0x40')]===_0xe0d4('0x45')&&_0x190540['Variable']&&_0x190540['Variable'][_0xe0d4('0x16')]&&_0x190540[_0xe0d4('0x41')]&&_0x190540[_0xe0d4('0x3d')]){_0x5493de[_0x190540[_0xe0d4('0x46')][_0xe0d4('0x16')]['toLowerCase']()]&&_0x349034[_0xe0d4('0x42')][_0xe0d4('0x43')]({'id':_0x190540[_0xe0d4('0x41')],'value':_0x5493de[_0x190540[_0xe0d4('0x46')][_0xe0d4('0x16')]['toLowerCase']()][_0xe0d4('0x3f')]()});}});}return _0x349034;}exports['queue']=function(_0x1e5c62,_0x26ef5d,_0xf109c8,_0x792655,_0x277f56,_0x43e27d){var _0x53b91f,_0x5d69af;_0x43e27d[_0xe0d4('0x12')]=intUtil['stripTrailingSlash'](_0x43e27d[_0xe0d4('0x12')]);_0x43e27d[_0xe0d4('0x47')]=intUtil['stripTrailingSlash'](_0x43e27d['serverUrl']);if(_0x277f56&&_0x277f56['monitor_format']){logger[_0xe0d4('0xf')](_0xe0d4('0x48'),_0xe0d4('0x49'));_0x26ef5d['recordingURL']=util[_0xe0d4('0x11')](_0xe0d4('0x4a'),_0x43e27d[_0xe0d4('0x47')],_0x26ef5d[_0xe0d4('0x4b')],md5(_0x26ef5d[_0xe0d4('0x4b')]));}else{_0x26ef5d['recordingURL']='';}headers[_0xe0d4('0x4c')]=getAuth(_0x43e27d);return getUser(_0x43e27d,_0x792655[_0xe0d4('0x4d')])[_0xe0d4('0x1b')](function(_0x4f822c){_0x53b91f=_0x4f822c;logger['info'](_0xe0d4('0x4e'),_0x53b91f['id']);return getEndUser(_0x43e27d,_0x26ef5d[_0xe0d4('0x4f')],_0x26ef5d[_0xe0d4('0x50')]);})[_0xe0d4('0x1b')](function(_0x16ca40){_0x5d69af=_0x16ca40;logger['info'](_0xe0d4('0x51'),_0x5d69af['id']);return getTicket(_0x43e27d,_0x53b91f,_0x5d69af,_0xf109c8,_0x26ef5d);})[_0xe0d4('0x1b')](function(_0x27c02f){if(_0x27c02f){logger['info']('The\x20Ticket\x20ID\x20is:',_0x27c02f['id']);switch(_0x43e27d[_0xe0d4('0x40')]){case'integrationTab':logger[_0xe0d4('0xf')](_0xe0d4('0x48'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xe0d4('0x11')](_0xe0d4('0x52'),_0x43e27d['remoteUri'],_0x53b91f['id'],_0x27c02f['id']),'method':_0xe0d4('0x13')});case _0xe0d4('0x53'):logger[_0xe0d4('0xf')](_0xe0d4('0x48'),_0xe0d4('0x54'));emit(util[_0xe0d4('0x11')](_0xe0d4('0x55'),_0x792655[_0xe0d4('0x16')]),_0xe0d4('0x56'),{'uri':util[_0xe0d4('0x11')](_0xe0d4('0x57'),_0x43e27d[_0xe0d4('0x12')],_0x27c02f['id'])});break;default:logger['error'](_0xe0d4('0x48'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xe0d4('0x58')](function(_0x538dad){logger['error'](_0xe0d4('0x59'),util[_0xe0d4('0x5a')](_0x538dad,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x953ffd,_0xdefc74,_0x16017f,_0x5bbbe2,_0x53f1d2,_0x1523ba,_0xd72f6e){var _0x46e805,_0x4b5243;_0x1523ba[_0xe0d4('0x12')]=intUtil[_0xe0d4('0x5b')](_0x1523ba[_0xe0d4('0x12')]);_0x1523ba[_0xe0d4('0x47')]=intUtil[_0xe0d4('0x5b')](_0x1523ba['serverUrl']);if(_0xd72f6e&&_0xd72f6e[_0xe0d4('0x5c')]&&_0xd72f6e[_0xe0d4('0x5c')]!=='none'){logger[_0xe0d4('0xf')](_0xe0d4('0x5d'),_0xe0d4('0x49'));_0xdefc74[_0xe0d4('0x5e')]=util[_0xe0d4('0x11')](_0xe0d4('0x4a'),_0x1523ba[_0xe0d4('0x47')],_0xdefc74['uniqueid'],md5(_0xdefc74[_0xe0d4('0x4b')]));}headers[_0xe0d4('0x4c')]=getAuth(_0x1523ba);return getUser(_0x1523ba,_0x5bbbe2[_0xe0d4('0x4d')])[_0xe0d4('0x1b')](function(_0x52ce56){_0x46e805=_0x52ce56;logger[_0xe0d4('0xf')]('The\x20User\x20ID\x20is:',_0x46e805['id']);return getEndUser(_0x1523ba,_0xdefc74[_0xe0d4('0x5f')],_0xdefc74['destcalleridnum']);})[_0xe0d4('0x1b')](function(_0x48f1dc){_0x4b5243=_0x48f1dc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4b5243['id']);return getTicket(_0x1523ba,_0x46e805,_0x4b5243,_0x16017f,_0xdefc74);})[_0xe0d4('0x1b')](function(_0x5beaa6){if(_0x5beaa6){logger[_0xe0d4('0xf')]('The\x20Ticket\x20ID\x20is:',_0x5beaa6['id']);switch(_0x1523ba[_0xe0d4('0x40')]){case'integrationTab':logger[_0xe0d4('0xf')](_0xe0d4('0x5d'),_0xe0d4('0x60'));return request({'uri':util[_0xe0d4('0x11')](_0xe0d4('0x52'),_0x1523ba['remoteUri'],_0x46e805['id'],_0x5beaa6['id']),'method':_0xe0d4('0x13')});case _0xe0d4('0x53'):logger['info'](_0xe0d4('0x5d'),_0xe0d4('0x54'));emit(util[_0xe0d4('0x11')](_0xe0d4('0x55'),_0x5bbbe2[_0xe0d4('0x16')]),_0xe0d4('0x56'),{'uri':util[_0xe0d4('0x11')](_0xe0d4('0x57'),_0x1523ba[_0xe0d4('0x12')],_0x5beaa6['id'])});break;default:logger[_0xe0d4('0x61')](_0xe0d4('0x5d'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xe0d4('0x58')](function(_0x1b7993){logger[_0xe0d4('0x61')](_0xe0d4('0x62'),util[_0xe0d4('0x5a')](_0x1b7993,{'showHidden':!![],'depth':null}));});};exports[_0xe0d4('0x63')]=function(_0x3811f5,_0x4a7dc6,_0x384923,_0xb90b9b,_0x19bd35,_0x41e231){var _0x58bb5d,_0x949f43;_0x41e231[_0xe0d4('0x12')]=intUtil[_0xe0d4('0x5b')](_0x41e231[_0xe0d4('0x12')]);_0x41e231[_0xe0d4('0x47')]=intUtil[_0xe0d4('0x5b')](_0x41e231['serverUrl']);if(_0x19bd35&&_0x19bd35[_0xe0d4('0x64')]){logger[_0xe0d4('0xf')](_0xe0d4('0x65'),'Recording\x20is\x20enabled!');_0x4a7dc6[_0xe0d4('0x5e')]=util['format'](_0xe0d4('0x4a'),_0x41e231['serverUrl'],_0x4a7dc6[_0xe0d4('0x4b')],md5(_0x4a7dc6[_0xe0d4('0x4b')]));}else{_0x4a7dc6[_0xe0d4('0x5e')]='';}headers['Authorization']=getAuth(_0x41e231);return getUser(_0x41e231)[_0xe0d4('0x1b')](function(_0x569326){_0x58bb5d=_0x569326;logger['info'](_0xe0d4('0x4e'),_0x58bb5d['id']);return getEndUser(_0x41e231,_0x4a7dc6[_0xe0d4('0x4f')],_0x4a7dc6['calleridnum']);})[_0xe0d4('0x1b')](function(_0x2454bf){_0x949f43=_0x2454bf;logger['info'](_0xe0d4('0x51'),_0x949f43['id']);return getTicket(_0x41e231,_0x58bb5d,_0x949f43,_0x384923,_0x4a7dc6);})[_0xe0d4('0x1b')](function(_0x5ab440){if(_0x5ab440){logger[_0xe0d4('0xf')](_0xe0d4('0x66'),_0x5ab440['id']);}})[_0xe0d4('0x58')](function(_0x241b48){logger['error'](_0xe0d4('0x67'),util[_0xe0d4('0x5a')](_0x241b48,{'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 b1e46a5..764c7b7 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 _0xea5b=['starttime','agentcalledAt','Call_Type','Inbound','Fields','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','com','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','/crm/EntityInfo.do?module=Calls&id=','[ABANDONED]','The\x20Enduser\x20ID\x20is:','lodash','request-promise','md5','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','type','string','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Search\x20end\x20user','https://www.zohoapis.','data','Contacts','End\x20user\x20found\x20(Contact)','Leads','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','/crm/v2/','moduleCreate','first_name','code','SUCCESS','details','enduserType','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','Owner','administrator','role','last_name','Subject','getString','Subjects','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Answered','Rejected','abandoned','Abandoned','Call_Start_Time','outbound'];(function(_0x211209,_0xbb9c64){var _0x218ba0=function(_0x368c6f){while(--_0x368c6f){_0x211209['push'](_0x211209['shift']());}};_0x218ba0(++_0xbb9c64);}(_0xea5b,0x152));var _0xbea5=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xea5b[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xbea5('0x0'));var rp=require(_0xbea5('0x1'));var md5=require(_0xbea5('0x2'));var util=require('util');var intUtil=require('./util');var moment=require(_0xbea5('0x3'));var Redis=require(_0xbea5('0x4'));var config=require(_0xbea5('0x5'));var logger=require(_0xbea5('0x6'))('zoho');config[_0xbea5('0x7')]=_['defaults'](config[_0xbea5('0x7')],{'host':_0xbea5('0x8'),'port':0x18eb});var io=require(_0xbea5('0x9'))(new Redis(config[_0xbea5('0x7')]));function emit(_0x19e362,_0x126aae,_0x36692a){io['to'](_0x19e362)[_0xbea5('0xa')](_0x126aae,_0x36692a);}function request(_0x41cb99){logger[_0xbea5('0xb')](_0xbea5('0xc'),JSON[_0xbea5('0xd')](_0x41cb99));return rp(_0x41cb99);}function getCustomFields(_0x58253c,_0x5a9b2a){var _0x201686={};if(_0x58253c[_0xbea5('0xe')]>0x0){_[_0xbea5('0xf')](_0x58253c,function(_0x4c2c85){if(_0x4c2c85[_0xbea5('0x10')]===_0xbea5('0x11')&&_0x4c2c85['idField']){_0x201686[_0x4c2c85[_0xbea5('0x12')]]=_0x4c2c85[_0xbea5('0x13')][_0xbea5('0x14')]();}else if(_0x4c2c85[_0xbea5('0x10')]==='variable'&&_0x4c2c85['variableName']&&_0x4c2c85[_0xbea5('0x12')]&&_0x5a9b2a[_0x4c2c85['variableName']]){_0x201686[_0x4c2c85['idField']]=_0x5a9b2a[_0x4c2c85[_0xbea5('0x15')]][_0xbea5('0x14')]();}else if(_0x4c2c85['type']===_0xbea5('0x16')&&_0x4c2c85[_0xbea5('0x17')]&&_0x4c2c85[_0xbea5('0x17')][_0xbea5('0x18')]&&_0x4c2c85[_0xbea5('0x12')]&&_0x5a9b2a[_0x4c2c85[_0xbea5('0x17')]['name'][_0xbea5('0x19')]()]){_0x201686[_0x4c2c85[_0xbea5('0x12')]]=_0x5a9b2a[_0x4c2c85[_0xbea5('0x17')]['name'][_0xbea5('0x19')]()][_0xbea5('0x14')]();}});}return _0x201686;}function getName(_0x35b709){if(_0x35b709[_0xbea5('0x1a')]('\x20')>0x0){var _0x2955cd=_0x35b709['split'](/ (.+)/);if(_0x2955cd[0x1]){return _0x2955cd;}}return[_0x35b709,_0x35b709];}var accountsTokens={};function getAccessToken(_0x76d83e){return new Promise(function(_0x3555c2,_0x56c43f){if(!_[_0xbea5('0x1b')](accountsTokens[_0x76d83e['id']])&&!_[_0xbea5('0x1b')](accountsTokens[_0x76d83e['id']][_0xbea5('0x1c')])){if(moment()[_0xbea5('0x1d')](accountsTokens[_0x76d83e['id']][_0xbea5('0x1e')])){_0x3555c2(accountsTokens[_0x76d83e['id']][_0xbea5('0x1c')]);}}var _0x33a68e;switch(_0x76d83e[_0xbea5('0x1f')]){case'US':_0x33a68e='https://accounts.zoho.com';break;case'AU':_0x33a68e=_0xbea5('0x20');break;case'EU':_0x33a68e=_0xbea5('0x21');break;case'IN':_0x33a68e=_0xbea5('0x22');break;case'CN':_0x33a68e=_0xbea5('0x23');break;default:_0x33a68e=_0xbea5('0x21');break;}var _0x6fb47f={'method':_0xbea5('0x24'),'uri':_0x33a68e+_0xbea5('0x25'),'qs':{'refresh_token':_0x76d83e[_0xbea5('0x26')],'client_id':_0x76d83e[_0xbea5('0x27')],'client_secret':_0x76d83e[_0xbea5('0x28')],'grant_type':_0xbea5('0x29')},'json':!![]};return rp(_0x6fb47f)['then'](function(_0x5aa682){accountsTokens[_0x76d83e['id']]={'access_token':_0x5aa682[_0xbea5('0x1c')],'expires_in':moment()[_0xbea5('0x2a')](_0x5aa682[_0xbea5('0x1e')],_0xbea5('0x2b'))};_0x3555c2(_0x5aa682[_0xbea5('0x1c')]);})[_0xbea5('0x2c')](function(_0x4476eb){logger[_0xbea5('0x2d')](_0xbea5('0x2e'),_0x4476eb[_0xbea5('0x2f')]);_0x56c43f(_0x4476eb);});});}function getUser(_0x1f1918,_0x60bfd6,_0x48b122,_0x368e22){logger[_0xbea5('0x30')](_0xbea5('0x31'));return request({'method':_0xbea5('0x32'),'uri':util[_0xbea5('0x33')](_0xbea5('0x34'),_0x60bfd6),'qs':{'type':_0xbea5('0x35')},'headers':{'Authorization':_0xbea5('0x36')+_0x1f1918},'json':!![]})[_0xbea5('0x37')](function(_0x28c1){if(_0x28c1[_0xbea5('0x38')]){var _0x1e5b30=-0x1;if(_[_0xbea5('0x39')](_0x28c1[_0xbea5('0x38')])){if(!_['isNil'](_0x368e22)){_0x1e5b30=_[_0xbea5('0x3a')](_0x28c1[_0xbea5('0x38')],function(_0x4da3be){return _0x4da3be[_0xbea5('0x3b')]===_0x368e22;});}if(_0x1e5b30>=0x0){logger['info'](_0xbea5('0x3c'));}else{logger[_0xbea5('0x30')](_0xbea5('0x3d'));_0x1e5b30=_[_0xbea5('0x3a')](_0x28c1['users'],function(_0x11a1d4){return _0x11a1d4[_0xbea5('0x3e')]['name']===_0xbea5('0x3f');});}return _0x28c1['users'][_0x1e5b30];}else{if(_0x28c1[_0xbea5('0x40')][_0xbea5('0x3e')][_0xbea5('0x18')]===_0xbea5('0x3f')){logger[_0xbea5('0x30')](_0xbea5('0x3d'));user=_0x28c1[_0xbea5('0x40')];return user;}else{logger[_0xbea5('0x2d')](_0xbea5('0x41'),JSON[_0xbea5('0xd')](_0x28c1));throw new Error(_0xbea5('0x42')+JSON[_0xbea5('0xd')](_0x28c1));}}}else{logger[_0xbea5('0x2d')](_0xbea5('0x41'),JSON[_0xbea5('0xd')](_0x28c1));throw new Error(_0xbea5('0x42')+JSON[_0xbea5('0xd')](_0x28c1));}})[_0xbea5('0x2c')](function(_0x41b8e7){console[_0xbea5('0x2d')](_0x41b8e7);});}function getEndUser(_0x512459,_0x532867,_0x5e62b7,_0x374ccd,_0x3c5e0d,_0xb15099,_0x22d3a6){logger[_0xbea5('0x30')](_0xbea5('0x43'));return request({'method':'GET','uri':_0xbea5('0x44')+_0x532867+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3c5e0d+'))','headers':{'Authorization':_0xbea5('0x36')+_0x512459},'json':!![]})[_0xbea5('0x37')](function(_0x238a62){if(_0x238a62){var _0x2c0efe=_0x238a62[_0xbea5('0x45')][0x0];_0x2c0efe['enduserType']=_0xbea5('0x46');logger['info'](_0xbea5('0x47'));return _0x2c0efe;}else{return request({'method':'GET','uri':'https://www.zohoapis.'+_0x532867+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3c5e0d+'))','headers':{'Authorization':_0xbea5('0x36')+_0x512459},'json':!![]})[_0xbea5('0x37')](function(_0x2b66c4){if(_0x2b66c4){var _0x1d430c=_0x2b66c4[_0xbea5('0x45')][0x0];_0x1d430c['enduserType']=_0xbea5('0x48');logger[_0xbea5('0x30')]('End\x20user\x20found\x20(Lead)');return _0x1d430c;}else{logger[_0xbea5('0x30')](_0xbea5('0x49'));_0x374ccd=getName(_0x374ccd);return request({'method':_0xbea5('0x24'),'uri':'https://www.zohoapis.'+_0x532867+_0xbea5('0x4a')+_0x22d3a6[_0xbea5('0x4b')],'body':{'data':[{'Last_Name':_0x374ccd[0x1],'First_Name':_0x374ccd[0x0],'Phone':_0x3c5e0d,'Owner':{'name':!_[_0xbea5('0x1b')](_0xb15099['role'][_0xbea5('0x18')])?_0xb15099['role']['name']:!_[_0xbea5('0x1b')](_0xb15099[_0xbea5('0x4c')])?_0xb15099[_0xbea5('0x4c')]+'\x20'+_0xb15099['last_name']:_0xb15099['last_name'],'id':_0xb15099['id']}}]},'headers':{'Authorization':_0xbea5('0x36')+_0x512459},'json':!![]})[_0xbea5('0x37')](function(_0x59dda1){if(_0x59dda1&&_0x59dda1[_0xbea5('0x45')][0x0][_0xbea5('0x4d')]===_0xbea5('0x4e')){var _0x47f9e5=_0x59dda1[_0xbea5('0x45')][0x0][_0xbea5('0x4f')];_0x47f9e5[_0xbea5('0x50')]=_0x22d3a6[_0xbea5('0x4b')];return _0x47f9e5;}logger[_0xbea5('0x2d')](_0xbea5('0x41'),JSON[_0xbea5('0xd')](_0x59dda1));throw new Error(_0xbea5('0x51')+JSON[_0xbea5('0xd')](_0x59dda1));});}});}});}function getCall(_0x2806f5,_0x286a3b,_0x4ca3ef,_0x5d7d54,_0x35c106,_0x44f3b7,_0x752b66,_0x5ec809){logger[_0xbea5('0x30')](_0xbea5('0x52'));var _0x333065={};_0x333065[_0xbea5('0x53')]={'name':!_[_0xbea5('0x1b')](_0x5d7d54['role'][_0xbea5('0x18')])&&!_[_0xbea5('0x1b')](_0x5d7d54[_0xbea5('0x3e')]['name'])&&_0x5d7d54[_0xbea5('0x3e')][_0xbea5('0x18')]===_0xbea5('0x54')?_0x5d7d54[_0xbea5('0x55')]['name']:!_[_0xbea5('0x1b')](_0x5d7d54[_0xbea5('0x4c')])?_0x5d7d54[_0xbea5('0x4c')]+'\x20'+_0x5d7d54['last_name']:_0x5d7d54[_0xbea5('0x56')],'id':_0x5d7d54['id']};_0x333065[_0xbea5('0x57')]=intUtil[_0xbea5('0x58')](_0x44f3b7[_0xbea5('0x59')],_0x752b66,'\x20');_0x333065['Description']=intUtil[_0xbea5('0x58')](_0x44f3b7[_0xbea5('0x5a')],_0x752b66,'\x0a');if(_0x35c106[_0xbea5('0x50')]===_0xbea5('0x46')){_0x333065['Who_Id']={'name':!_[_0xbea5('0x1b')](_0x35c106[_0xbea5('0x5b')])?_0x35c106[_0xbea5('0x5b')]:!_[_0xbea5('0x1b')](_0x35c106[_0xbea5('0x5c')])?_0x35c106['First_Name']+'\x20'+_0x35c106[_0xbea5('0x5d')]:_0x35c106['Last_Name'],'id':_0x35c106['id']};}if(_0x35c106['enduserType']===_0xbea5('0x48')){_0x333065[_0xbea5('0x5e')]={'name':!_[_0xbea5('0x1b')](_0x35c106['Full_Name'])?_0x35c106[_0xbea5('0x5b')]:!_[_0xbea5('0x1b')](_0x35c106['First_Name'])?_0x35c106[_0xbea5('0x5c')]+'\x20'+_0x35c106[_0xbea5('0x5d')]:_0x35c106['Last_Name'],'id':_0x35c106['id']};_0x333065[_0xbea5('0x5f')]=_0x35c106[_0xbea5('0x50')];}if(_0x752b66[_0xbea5('0x60')]){_0x333065[_0xbea5('0x61')]=moment[_0xbea5('0x62')](parseInt(_0x752b66['talktime'])*0x3e8)[_0xbea5('0x33')](_0xbea5('0x63'));}else if(_0x752b66[_0xbea5('0x64')]&&_0x752b66[_0xbea5('0x65')]){_0x333065['Call_Duration']=moment['utc'](moment(_0x752b66['endtime'],_0xbea5('0x66'))['diff'](moment(_0x752b66['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0xbea5('0x33')](_0xbea5('0x63'));}switch(_0x752b66[_0xbea5('0x67')]){case _0xbea5('0x68'):_0x333065[_0xbea5('0x69')]='Called';break;case'complete':case'connect':_0x333065[_0xbea5('0x69')]=_0xbea5('0x6a');break;case'rejected':_0x333065[_0xbea5('0x69')]=_0xbea5('0x6b');break;case _0xbea5('0x6c'):_0x333065[_0xbea5('0x69')]=_0xbea5('0x6d');break;default:}_0x333065[_0xbea5('0x6e')]=(_0x5ec809===_0xbea5('0x6f')?moment(_0x752b66[_0xbea5('0x70')])[_0xbea5('0x33')](_0xbea5('0x66')):moment(_0x752b66[_0xbea5('0x71')])[_0xbea5('0x33')](_0xbea5('0x66')))||moment()[_0xbea5('0x33')]('YYYY-MM-DDTHH:mm:ss');_0x333065[_0xbea5('0x72')]=_0x5ec809||_0xbea5('0x73');_0x333065=_['merge'](_0x333065,getCustomFields(_0x44f3b7[_0xbea5('0x74')],_0x752b66));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x286a3b+'/crm/v2/Calls','headers':{'Authorization':_0xbea5('0x36')+_0x2806f5},'body':{'data':[_0x333065]},'json':!![]})[_0xbea5('0x37')](function(_0x59b7ea){if(_0x59b7ea&&_0x59b7ea['data'][0x0][_0xbea5('0x4d')]===_0xbea5('0x4e')){logger['info'](_0xbea5('0x75'));return{'id':_0x59b7ea[_0xbea5('0x45')][0x0][_0xbea5('0x4f')]['id']};}})[_0xbea5('0x2c')](function(_0x39949b){logger[_0xbea5('0x30')](_0xbea5('0x76'),_0x39949b[_0xbea5('0x2f')]);console[_0xbea5('0x77')]('err',_0x39949b);});}exports[_0xbea5('0x78')]=function(_0x5b0a96,_0x489a71,_0x4d9440,_0x10e78c,_0x393328,_0x5ac891){var _0x457f65,_0xef6596,_0x3b444c;_0x5ac891[_0xbea5('0x79')]=intUtil[_0xbea5('0x7a')](_0x5ac891[_0xbea5('0x79')]);_0x5ac891[_0xbea5('0x7b')]=intUtil[_0xbea5('0x7a')](_0x5ac891[_0xbea5('0x7b')]);if(_0x393328&&_0x393328[_0xbea5('0x7c')]){logger[_0xbea5('0x30')](_0xbea5('0x7d'),_0xbea5('0x7e'));_0x489a71[_0xbea5('0x7f')]=_0x5ac891[_0xbea5('0x7b')]+_0xbea5('0x80')+_0x489a71['uniqueid']+_0xbea5('0x81')+md5(_0x489a71[_0xbea5('0x82')]);}else{_0x489a71[_0xbea5('0x7f')]='';}var _0x509280=_0x5ac891['host']===_0xbea5('0x83')?'eu':'com';return getAccessToken(_0x5ac891)[_0xbea5('0x37')](function(_0x7b697){_0x3b444c=_0x7b697;return getUser(_0x3b444c,_0x509280,_0x5ac891,_0x10e78c[_0xbea5('0x3b')]);})[_0xbea5('0x37')](function(_0x273fb8){_0x457f65=_0x273fb8;logger[_0xbea5('0x30')]('The\x20User\x20ID\x20is:',_0x457f65['id']);return getEndUser(_0x3b444c,_0x509280,_0x5ac891,_0x489a71[_0xbea5('0x84')],_0x489a71[_0xbea5('0x85')],_0x457f65,_0x4d9440);})[_0xbea5('0x37')](function(_0x506550){_0xef6596=_0x506550;logger[_0xbea5('0x30')]('The\x20Enduser\x20ID\x20is:',_0xef6596['id']);return getCall(_0x3b444c,_0x509280,_0x5ac891,_0x457f65,_0xef6596,_0x4d9440,_0x489a71,_0xbea5('0x73'));})['then'](function(_0x7e9d87){if(_0x7e9d87){logger['info'](_0xbea5('0x86'),_0x7e9d87['id']);logger[_0xbea5('0x30')](_0xbea5('0x7d'),_0xbea5('0x87'));emit(util[_0xbea5('0x33')](_0xbea5('0x88'),_0x10e78c[_0xbea5('0x18')]),_0xbea5('0x89'),{'uri':_0xbea5('0x8a')+_0x5ac891[_0xbea5('0x79')]+'/crm/EntityInfo.do?module=Calls&id='+_0x7e9d87['id']});}})[_0xbea5('0x2c')](function(_0x54e4f8){logger[_0xbea5('0x2d')](_0xbea5('0x7d'),JSON[_0xbea5('0xd')](_0x54e4f8));});};exports[_0xbea5('0x6f')]=function(_0x2edd98,_0x320819,_0x51b211,_0x90c5f3,_0x2d3a14,_0x3bce21,_0x1b5a12){var _0x54dfc4,_0x44cf19,_0x116817;_0x3bce21[_0xbea5('0x79')]=intUtil['stripTrailingSlash'](_0x3bce21['host']);_0x3bce21[_0xbea5('0x7b')]=intUtil[_0xbea5('0x7a')](_0x3bce21['serverUrl']);if(_0x1b5a12&&_0x1b5a12[_0xbea5('0x8b')]&&_0x1b5a12[_0xbea5('0x8b')]!==_0xbea5('0x8c')){logger['info'](_0xbea5('0x8d'),_0xbea5('0x7e'));_0x320819['recordingURL']=_0x3bce21[_0xbea5('0x7b')]+_0xbea5('0x80')+_0x320819[_0xbea5('0x82')]+_0xbea5('0x81')+md5(_0x320819[_0xbea5('0x82')]);}var _0xe362bd=_0x3bce21[_0xbea5('0x79')]===_0xbea5('0x83')?'eu':_0xbea5('0x8e');return getAccessToken(_0x3bce21)['then'](function(_0x4fb2d9){_0x116817=_0x4fb2d9;return getUser(_0x116817,_0xe362bd,_0x3bce21,_0x90c5f3[_0xbea5('0x3b')]);})[_0xbea5('0x37')](function(_0x2a6713){_0x54dfc4=_0x2a6713;logger[_0xbea5('0x30')](_0xbea5('0x8f'),_0x54dfc4['id']);return getEndUser(_0x116817,_0xe362bd,_0x3bce21,_0x320819[_0xbea5('0x90')],_0x320819[_0xbea5('0x91')],_0x54dfc4,_0x51b211);})[_0xbea5('0x37')](function(_0x2e45cc){_0x44cf19=_0x2e45cc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x44cf19['id']);return getCall(_0x116817,_0xe362bd,_0x3bce21,_0x54dfc4,_0x44cf19,_0x51b211,_0x320819,_0xbea5('0x92'));})[_0xbea5('0x37')](function(_0x34b8ff){if(_0x34b8ff){logger[_0xbea5('0x30')](_0xbea5('0x86'),_0x34b8ff['id']);logger[_0xbea5('0x30')]('[OUTBOUND]',_0xbea5('0x87'));emit(util['format'](_0xbea5('0x88'),_0x90c5f3[_0xbea5('0x18')]),_0xbea5('0x89'),{'uri':'https://crm.'+_0x3bce21['host']+_0xbea5('0x93')+_0x34b8ff['id']});}})[_0xbea5('0x2c')](function(_0x4b71a2){logger['error'](_0xbea5('0x8d'),JSON['stringify'](_0x4b71a2));});};exports['abandoned']=function(_0x36c2c0,_0x470e2c,_0x565ab5,_0x2e0718,_0xb2407c,_0x7fe28f){var _0x49cab3,_0xa7e444,_0x528b69;_0x7fe28f[_0xbea5('0x79')]=intUtil[_0xbea5('0x7a')](_0x7fe28f[_0xbea5('0x79')]);_0x7fe28f[_0xbea5('0x7b')]=intUtil['stripTrailingSlash'](_0x7fe28f['serverUrl']);if(_0xb2407c&&_0xb2407c[_0xbea5('0x7c')]){logger[_0xbea5('0x30')](_0xbea5('0x94'),_0xbea5('0x7e'));_0x470e2c[_0xbea5('0x7f')]=_0x7fe28f[_0xbea5('0x7b')]+'/api/voice/recordings/'+_0x470e2c[_0xbea5('0x82')]+_0xbea5('0x81')+md5(_0x470e2c[_0xbea5('0x82')]);}else{_0x470e2c[_0xbea5('0x7f')]='';}var _0x5b16e8=_0x7fe28f[_0xbea5('0x79')]===_0xbea5('0x83')?'eu':'com';return getAccessToken(_0x7fe28f)[_0xbea5('0x37')](function(_0x1c7a1b){_0x528b69=_0x1c7a1b;return getUser(_0x528b69,_0x5b16e8,_0x7fe28f);})[_0xbea5('0x37')](function(_0x33b982){_0x49cab3=_0x33b982;logger[_0xbea5('0x30')](_0xbea5('0x8f'),_0x49cab3['id']);return getEndUser(_0x528b69,_0x5b16e8,_0x7fe28f,_0x470e2c[_0xbea5('0x84')],_0x470e2c[_0xbea5('0x85')],_0x49cab3,_0x565ab5);})[_0xbea5('0x37')](function(_0x50aaa5){_0xa7e444=_0x50aaa5;logger[_0xbea5('0x30')](_0xbea5('0x95'),_0xa7e444['id']);return getCall(_0x528b69,_0x5b16e8,_0x7fe28f,_0x49cab3,_0xa7e444,_0x565ab5,_0x470e2c,_0xbea5('0x73'));})[_0xbea5('0x37')](function(_0x4e4b1f){if(_0x4e4b1f){logger['info'](_0xbea5('0x86'),_0x4e4b1f['id']);}})[_0xbea5('0x2c')](function(_0x3afe26){logger['error'](_0xbea5('0x94'),JSON[_0xbea5('0xd')](_0x3afe26));});}; \ No newline at end of file +var _0x99d1=['access_token','isBefore','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','add','expires_in','seconds','catch','stack','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','isNil','findIndex','email','Agent\x20found!','profile','Administrator','Using\x20the\x20admin\x20account!','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Search\x20end\x20user','https://www.zohoapis.','End\x20user\x20found\x20(Contact)','GET','/crm/v2/Leads/search?criteria=((Phone:equals:','data','enduserType','Leads','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','role','first_name','last_name','code','SUCCESS','details','moduleCreate','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Description','Contacts','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','mm:ss','lastevent','called','Called','Call_Result','Rejected','abandoned','Abandoned','Call_Start_Time','outbound','starttime','Call_Type','Inbound','Fields','/crm/v2/Calls','Call\x20created!','log','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','/downloads?type=uniqueid&token=','recordingURL','com','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','none','[OUTBOUND]','zoho.eu','Outbound','user:%s','/api/voice/recordings/','calleridnum','lodash','md5','util','./util','moment','ioredis','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','stringify','length','forEach','type','string','content','toString','variable','variableName','idField','customVariable','Variable','name','toLowerCase','indexOf','split'];(function(_0xeade2b,_0x28fa4c){var _0x15a8e1=function(_0x4ed562){while(--_0x4ed562){_0xeade2b['push'](_0xeade2b['shift']());}};_0x15a8e1(++_0x28fa4c);}(_0x99d1,0x104));var _0x199d=function(_0x3b4e2e,_0xe12bb3){_0x3b4e2e=_0x3b4e2e-0x0;var _0x4859b7=_0x99d1[_0x3b4e2e];return _0x4859b7;};'use strict';var _=require(_0x199d('0x0'));var rp=require('request-promise');var md5=require(_0x199d('0x1'));var util=require(_0x199d('0x2'));var intUtil=require(_0x199d('0x3'));var moment=require(_0x199d('0x4'));var Redis=require(_0x199d('0x5'));var config=require('../../../../config/environment');var logger=require(_0x199d('0x6'))(_0x199d('0x7'));config[_0x199d('0x8')]=_[_0x199d('0x9')](config[_0x199d('0x8')],{'host':_0x199d('0xa'),'port':0x18eb});var io=require(_0x199d('0xb'))(new Redis(config[_0x199d('0x8')]));function emit(_0x1dd7e4,_0x407e36,_0x277bf9){io['to'](_0x1dd7e4)[_0x199d('0xc')](_0x407e36,_0x277bf9);}function request(_0x2b3ab5){logger[_0x199d('0xd')]('[HTTP]',JSON[_0x199d('0xe')](_0x2b3ab5));return rp(_0x2b3ab5);}function getCustomFields(_0x25f1a2,_0x59e283){var _0x2f46c8={};if(_0x25f1a2[_0x199d('0xf')]>0x0){_[_0x199d('0x10')](_0x25f1a2,function(_0x4a4275){if(_0x4a4275[_0x199d('0x11')]===_0x199d('0x12')&&_0x4a4275['idField']){_0x2f46c8[_0x4a4275['idField']]=_0x4a4275[_0x199d('0x13')][_0x199d('0x14')]();}else if(_0x4a4275[_0x199d('0x11')]===_0x199d('0x15')&&_0x4a4275[_0x199d('0x16')]&&_0x4a4275[_0x199d('0x17')]&&_0x59e283[_0x4a4275['variableName']]){_0x2f46c8[_0x4a4275[_0x199d('0x17')]]=_0x59e283[_0x4a4275[_0x199d('0x16')]]['toString']();}else if(_0x4a4275[_0x199d('0x11')]===_0x199d('0x18')&&_0x4a4275[_0x199d('0x19')]&&_0x4a4275[_0x199d('0x19')][_0x199d('0x1a')]&&_0x4a4275[_0x199d('0x17')]&&_0x59e283[_0x4a4275[_0x199d('0x19')][_0x199d('0x1a')][_0x199d('0x1b')]()]){_0x2f46c8[_0x4a4275[_0x199d('0x17')]]=_0x59e283[_0x4a4275[_0x199d('0x19')][_0x199d('0x1a')][_0x199d('0x1b')]()][_0x199d('0x14')]();}});}return _0x2f46c8;}function getName(_0x26e653){if(_0x26e653[_0x199d('0x1c')]('\x20')>0x0){var _0x37158d=_0x26e653[_0x199d('0x1d')](/ (.+)/);if(_0x37158d[0x1]){return _0x37158d;}}return[_0x26e653,_0x26e653];}var accountsTokens={};function getAccessToken(_0x13f3d7){return new Promise(function(_0x4a4007,_0x4d878d){if(!_['isNil'](accountsTokens[_0x13f3d7['id']])&&!_['isNil'](accountsTokens[_0x13f3d7['id']][_0x199d('0x1e')])){if(moment()[_0x199d('0x1f')](accountsTokens[_0x13f3d7['id']]['expires_in'])){_0x4a4007(accountsTokens[_0x13f3d7['id']][_0x199d('0x1e')]);}}var _0x30e2b9;switch(_0x13f3d7[_0x199d('0x20')]){case'US':_0x30e2b9='https://accounts.zoho.com';break;case'AU':_0x30e2b9=_0x199d('0x21');break;case'EU':_0x30e2b9=_0x199d('0x22');break;case'IN':_0x30e2b9=_0x199d('0x23');break;case'CN':_0x30e2b9=_0x199d('0x24');break;default:_0x30e2b9='https://accounts.zoho.eu';break;}var _0x14fa60={'method':_0x199d('0x25'),'uri':_0x30e2b9+_0x199d('0x26'),'qs':{'refresh_token':_0x13f3d7['refreshToken'],'client_id':_0x13f3d7[_0x199d('0x27')],'client_secret':_0x13f3d7[_0x199d('0x28')],'grant_type':_0x199d('0x29')},'json':!![]};return rp(_0x14fa60)[_0x199d('0x2a')](function(_0x40832c){accountsTokens[_0x13f3d7['id']]={'access_token':_0x40832c[_0x199d('0x1e')],'expires_in':moment()[_0x199d('0x2b')](_0x40832c[_0x199d('0x2c')],_0x199d('0x2d'))};_0x4a4007(_0x40832c[_0x199d('0x1e')]);})[_0x199d('0x2e')](function(_0x241ce0){logger['error']('Failing\x20creating\x20the\x20access_token',_0x241ce0[_0x199d('0x2f')]);_0x4d878d(_0x241ce0);});});}function getUser(_0x17a289,_0x4bdbda,_0x565829,_0x24110c){logger[_0x199d('0x30')](_0x199d('0x31'));return request({'method':'GET','uri':util[_0x199d('0x32')](_0x199d('0x33'),_0x4bdbda),'qs':{'type':_0x199d('0x34')},'headers':{'Authorization':_0x199d('0x35')+_0x17a289},'json':!![]})['then'](function(_0x1e5d5c){if(_0x1e5d5c[_0x199d('0x36')]){var _0x1f7e4d=-0x1;if(_[_0x199d('0x37')](_0x1e5d5c[_0x199d('0x36')])){if(!_[_0x199d('0x38')](_0x24110c)){_0x1f7e4d=_[_0x199d('0x39')](_0x1e5d5c[_0x199d('0x36')],function(_0x3405f8){return _0x3405f8[_0x199d('0x3a')]===_0x24110c;});}if(_0x1f7e4d>=0x0){logger['info'](_0x199d('0x3b'));}else{logger[_0x199d('0x30')]('Using\x20the\x20admin\x20account!');_0x1f7e4d=_['findIndex'](_0x1e5d5c[_0x199d('0x36')],function(_0x4ea43e){return _0x4ea43e[_0x199d('0x3c')]['name']===_0x199d('0x3d');});}return _0x1e5d5c['users'][_0x1f7e4d];}else{if(_0x1e5d5c['user'][_0x199d('0x3c')]['name']==='Administrator'){logger['info'](_0x199d('0x3e'));user=_0x1e5d5c[_0x199d('0x3f')];return user;}else{logger[_0x199d('0x40')](_0x199d('0x41'),JSON['stringify'](_0x1e5d5c));throw new Error(_0x199d('0x42')+JSON[_0x199d('0xe')](_0x1e5d5c));}}}else{logger[_0x199d('0x40')](_0x199d('0x41'),JSON[_0x199d('0xe')](_0x1e5d5c));throw new Error(_0x199d('0x42')+JSON[_0x199d('0xe')](_0x1e5d5c));}})[_0x199d('0x2e')](function(_0x32563a){console[_0x199d('0x40')](_0x32563a);});}function getEndUser(_0x167f17,_0x159e56,_0x33b47b,_0x396413,_0x42f685,_0x221f81,_0x1f865b){logger[_0x199d('0x30')](_0x199d('0x43'));return request({'method':'GET','uri':_0x199d('0x44')+_0x159e56+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x42f685+'))','headers':{'Authorization':_0x199d('0x35')+_0x167f17},'json':!![]})[_0x199d('0x2a')](function(_0x322cfa){if(_0x322cfa){var _0x56cc27=_0x322cfa['data'][0x0];_0x56cc27['enduserType']='Contacts';logger[_0x199d('0x30')](_0x199d('0x45'));return _0x56cc27;}else{return request({'method':_0x199d('0x46'),'uri':_0x199d('0x44')+_0x159e56+_0x199d('0x47')+_0x42f685+'))','headers':{'Authorization':_0x199d('0x35')+_0x167f17},'json':!![]})['then'](function(_0x4f02d3){if(_0x4f02d3){var _0x2a0952=_0x4f02d3[_0x199d('0x48')][0x0];_0x2a0952[_0x199d('0x49')]=_0x199d('0x4a');logger[_0x199d('0x30')]('End\x20user\x20found\x20(Lead)');return _0x2a0952;}else{logger['info'](_0x199d('0x4b'));_0x396413=getName(_0x396413);return request({'method':'POST','uri':_0x199d('0x44')+_0x159e56+'/crm/v2/'+_0x1f865b['moduleCreate'],'body':{'data':[{'Last_Name':_0x396413[0x1],'First_Name':_0x396413[0x0],'Phone':_0x42f685,'Owner':{'name':!_[_0x199d('0x38')](_0x221f81[_0x199d('0x4c')]['name'])?_0x221f81[_0x199d('0x4c')]['name']:!_[_0x199d('0x38')](_0x221f81[_0x199d('0x4d')])?_0x221f81[_0x199d('0x4d')]+'\x20'+_0x221f81[_0x199d('0x4e')]:_0x221f81['last_name'],'id':_0x221f81['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x167f17},'json':!![]})[_0x199d('0x2a')](function(_0x5d364b){if(_0x5d364b&&_0x5d364b[_0x199d('0x48')][0x0][_0x199d('0x4f')]===_0x199d('0x50')){var _0x5bcebe=_0x5d364b[_0x199d('0x48')][0x0][_0x199d('0x51')];_0x5bcebe[_0x199d('0x49')]=_0x1f865b[_0x199d('0x52')];return _0x5bcebe;}logger[_0x199d('0x40')](_0x199d('0x41'),JSON[_0x199d('0xe')](_0x5d364b));throw new Error('Error\x20on\x20Lead\x20retrieve:\x20'+JSON[_0x199d('0xe')](_0x5d364b));});}});}});}function getCall(_0x54cd60,_0x57b034,_0x1b6d3a,_0x1bad2c,_0x5ed44d,_0x48aacf,_0x1e0751,_0x58bb9d){logger['info'](_0x199d('0x53'));var _0x349426={};_0x349426[_0x199d('0x54')]={'name':!_['isNil'](_0x1bad2c[_0x199d('0x4c')][_0x199d('0x1a')])&&!_[_0x199d('0x38')](_0x1bad2c[_0x199d('0x3c')][_0x199d('0x1a')])&&_0x1bad2c[_0x199d('0x3c')][_0x199d('0x1a')]===_0x199d('0x55')?_0x1bad2c[_0x199d('0x4c')][_0x199d('0x1a')]:!_[_0x199d('0x38')](_0x1bad2c[_0x199d('0x4d')])?_0x1bad2c[_0x199d('0x4d')]+'\x20'+_0x1bad2c[_0x199d('0x4e')]:_0x1bad2c[_0x199d('0x4e')],'id':_0x1bad2c['id']};_0x349426['Subject']=intUtil[_0x199d('0x56')](_0x48aacf[_0x199d('0x57')],_0x1e0751,'\x20');_0x349426[_0x199d('0x58')]=intUtil[_0x199d('0x56')](_0x48aacf['Descriptions'],_0x1e0751,'\x0a');if(_0x5ed44d[_0x199d('0x49')]===_0x199d('0x59')){_0x349426[_0x199d('0x5a')]={'name':!_['isNil'](_0x5ed44d[_0x199d('0x5b')])?_0x5ed44d['Full_Name']:!_[_0x199d('0x38')](_0x5ed44d[_0x199d('0x5c')])?_0x5ed44d[_0x199d('0x5c')]+'\x20'+_0x5ed44d['Last_Name']:_0x5ed44d[_0x199d('0x5d')],'id':_0x5ed44d['id']};}if(_0x5ed44d[_0x199d('0x49')]==='Leads'){_0x349426[_0x199d('0x5e')]={'name':!_[_0x199d('0x38')](_0x5ed44d[_0x199d('0x5b')])?_0x5ed44d[_0x199d('0x5b')]:!_[_0x199d('0x38')](_0x5ed44d['First_Name'])?_0x5ed44d[_0x199d('0x5c')]+'\x20'+_0x5ed44d['Last_Name']:_0x5ed44d['Last_Name'],'id':_0x5ed44d['id']};_0x349426[_0x199d('0x5f')]=_0x5ed44d[_0x199d('0x49')];}if(_0x1e0751[_0x199d('0x60')]){_0x349426[_0x199d('0x61')]=moment[_0x199d('0x62')](parseInt(_0x1e0751[_0x199d('0x60')])*0x3e8)[_0x199d('0x32')]('mm:ss');}else if(_0x1e0751[_0x199d('0x63')]&&_0x1e0751[_0x199d('0x64')]){_0x349426[_0x199d('0x61')]=moment[_0x199d('0x62')](moment(_0x1e0751['endtime'],_0x199d('0x65'))['diff'](moment(_0x1e0751['starttime'],_0x199d('0x65'))))[_0x199d('0x32')](_0x199d('0x66'));}switch(_0x1e0751[_0x199d('0x67')]){case _0x199d('0x68'):_0x349426['Call_Result']=_0x199d('0x69');break;case'complete':case'connect':_0x349426[_0x199d('0x6a')]='Answered';break;case'rejected':_0x349426[_0x199d('0x6a')]=_0x199d('0x6b');break;case _0x199d('0x6c'):_0x349426[_0x199d('0x6a')]=_0x199d('0x6d');break;default:}_0x349426[_0x199d('0x6e')]=(_0x58bb9d===_0x199d('0x6f')?moment(_0x1e0751[_0x199d('0x70')])[_0x199d('0x32')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x1e0751['agentcalledAt'])['format'](_0x199d('0x65')))||moment()[_0x199d('0x32')]('YYYY-MM-DDTHH:mm:ss');_0x349426[_0x199d('0x71')]=_0x58bb9d||_0x199d('0x72');_0x349426=_['merge'](_0x349426,getCustomFields(_0x48aacf[_0x199d('0x73')],_0x1e0751));return request({'method':_0x199d('0x25'),'uri':'https://www.zohoapis.'+_0x57b034+_0x199d('0x74'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x54cd60},'body':{'data':[_0x349426]},'json':!![]})[_0x199d('0x2a')](function(_0x13c192){if(_0x13c192&&_0x13c192[_0x199d('0x48')][0x0][_0x199d('0x4f')]===_0x199d('0x50')){logger['info'](_0x199d('0x75'));return{'id':_0x13c192[_0x199d('0x48')][0x0][_0x199d('0x51')]['id']};}})['catch'](function(_0x23543b){logger['info']('err',_0x23543b[_0x199d('0x2f')]);console[_0x199d('0x76')](_0x199d('0x77'),_0x23543b);});}exports['queue']=function(_0x534cfc,_0x1b21c7,_0x31171f,_0x24b1a7,_0xa11671,_0x239613){var _0xbc2e94,_0x51b727,_0x4fb947;_0x239613[_0x199d('0x78')]=intUtil[_0x199d('0x79')](_0x239613[_0x199d('0x78')]);_0x239613[_0x199d('0x7a')]=intUtil[_0x199d('0x79')](_0x239613['serverUrl']);if(_0xa11671&&_0xa11671[_0x199d('0x7b')]){logger[_0x199d('0x30')](_0x199d('0x7c'),_0x199d('0x7d'));_0x1b21c7['recordingURL']=_0x239613[_0x199d('0x7a')]+'/api/voice/recordings/'+_0x1b21c7[_0x199d('0x7e')]+_0x199d('0x7f')+md5(_0x1b21c7[_0x199d('0x7e')]);}else{_0x1b21c7[_0x199d('0x80')]='';}var _0x6bf07b=_0x239613[_0x199d('0x78')]==='zoho.eu'?'eu':_0x199d('0x81');return getAccessToken(_0x239613)[_0x199d('0x2a')](function(_0x2a03dc){_0x4fb947=_0x2a03dc;return getUser(_0x4fb947,_0x6bf07b,_0x239613,_0x24b1a7[_0x199d('0x3a')]);})['then'](function(_0x338407){_0xbc2e94=_0x338407;logger['info'](_0x199d('0x82'),_0xbc2e94['id']);return getEndUser(_0x4fb947,_0x6bf07b,_0x239613,_0x1b21c7[_0x199d('0x83')],_0x1b21c7['calleridnum'],_0xbc2e94,_0x31171f);})[_0x199d('0x2a')](function(_0x12864b){_0x51b727=_0x12864b;logger['info'](_0x199d('0x84'),_0x51b727['id']);return getCall(_0x4fb947,_0x6bf07b,_0x239613,_0xbc2e94,_0x51b727,_0x31171f,_0x1b21c7,_0x199d('0x72'));})[_0x199d('0x2a')](function(_0x521b4b){if(_0x521b4b){logger[_0x199d('0x30')](_0x199d('0x85'),_0x521b4b['id']);logger['info'](_0x199d('0x7c'),_0x199d('0x86'));emit(util['format']('user:%s',_0x24b1a7[_0x199d('0x1a')]),_0x199d('0x87'),{'uri':_0x199d('0x88')+_0x239613[_0x199d('0x78')]+_0x199d('0x89')+_0x521b4b['id']});}})['catch'](function(_0x3ea4fd){logger['error'](_0x199d('0x7c'),JSON[_0x199d('0xe')](_0x3ea4fd));});};exports[_0x199d('0x6f')]=function(_0x5d018b,_0x48b37a,_0x502369,_0x4556a0,_0x26f0a0,_0x341a10,_0x4d9e34){var _0x59e8c2,_0x3fae53,_0x5dca3b;_0x341a10[_0x199d('0x78')]=intUtil[_0x199d('0x79')](_0x341a10['host']);_0x341a10['serverUrl']=intUtil['stripTrailingSlash'](_0x341a10[_0x199d('0x7a')]);if(_0x4d9e34&&_0x4d9e34['recordingFormat']&&_0x4d9e34['recordingFormat']!==_0x199d('0x8a')){logger[_0x199d('0x30')](_0x199d('0x8b'),'Recording\x20is\x20enabled!');_0x48b37a['recordingURL']=_0x341a10[_0x199d('0x7a')]+'/api/voice/recordings/'+_0x48b37a['uniqueid']+_0x199d('0x7f')+md5(_0x48b37a[_0x199d('0x7e')]);}var _0xd87f7b=_0x341a10[_0x199d('0x78')]===_0x199d('0x8c')?'eu':_0x199d('0x81');return getAccessToken(_0x341a10)[_0x199d('0x2a')](function(_0x521aa2){_0x5dca3b=_0x521aa2;return getUser(_0x5dca3b,_0xd87f7b,_0x341a10,_0x4556a0['email']);})['then'](function(_0x1aceaf){_0x59e8c2=_0x1aceaf;logger[_0x199d('0x30')]('The\x20User\x20ID\x20is:',_0x59e8c2['id']);return getEndUser(_0x5dca3b,_0xd87f7b,_0x341a10,_0x48b37a['destcalleridname'],_0x48b37a['destcalleridnum'],_0x59e8c2,_0x502369);})[_0x199d('0x2a')](function(_0x6cdb50){_0x3fae53=_0x6cdb50;logger[_0x199d('0x30')](_0x199d('0x84'),_0x3fae53['id']);return getCall(_0x5dca3b,_0xd87f7b,_0x341a10,_0x59e8c2,_0x3fae53,_0x502369,_0x48b37a,_0x199d('0x8d'));})['then'](function(_0x16508f){if(_0x16508f){logger[_0x199d('0x30')](_0x199d('0x85'),_0x16508f['id']);logger['info']('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x199d('0x32')](_0x199d('0x8e'),_0x4556a0[_0x199d('0x1a')]),'trigger:browser:url',{'uri':_0x199d('0x88')+_0x341a10[_0x199d('0x78')]+'/crm/EntityInfo.do?module=Calls&id='+_0x16508f['id']});}})[_0x199d('0x2e')](function(_0x3b8486){logger[_0x199d('0x40')]('[OUTBOUND]',JSON[_0x199d('0xe')](_0x3b8486));});};exports['abandoned']=function(_0x1ce510,_0x49b804,_0xbac7c2,_0x1a57ae,_0x383b0a,_0x2b292a){var _0x46cabe,_0x1655b0,_0x14c086;_0x2b292a[_0x199d('0x78')]=intUtil[_0x199d('0x79')](_0x2b292a[_0x199d('0x78')]);_0x2b292a[_0x199d('0x7a')]=intUtil[_0x199d('0x79')](_0x2b292a[_0x199d('0x7a')]);if(_0x383b0a&&_0x383b0a[_0x199d('0x7b')]){logger['info']('[ABANDONED]',_0x199d('0x7d'));_0x49b804['recordingURL']=_0x2b292a['serverUrl']+_0x199d('0x8f')+_0x49b804[_0x199d('0x7e')]+_0x199d('0x7f')+md5(_0x49b804[_0x199d('0x7e')]);}else{_0x49b804['recordingURL']='';}var _0x5ca391=_0x2b292a[_0x199d('0x78')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x2b292a)[_0x199d('0x2a')](function(_0x299458){_0x14c086=_0x299458;return getUser(_0x14c086,_0x5ca391,_0x2b292a);})['then'](function(_0x2f5e46){_0x46cabe=_0x2f5e46;logger[_0x199d('0x30')](_0x199d('0x82'),_0x46cabe['id']);return getEndUser(_0x14c086,_0x5ca391,_0x2b292a,_0x49b804[_0x199d('0x83')],_0x49b804[_0x199d('0x90')],_0x46cabe,_0xbac7c2);})[_0x199d('0x2a')](function(_0x5939da){_0x1655b0=_0x5939da;logger[_0x199d('0x30')](_0x199d('0x84'),_0x1655b0['id']);return getCall(_0x14c086,_0x5ca391,_0x2b292a,_0x46cabe,_0x1655b0,_0xbac7c2,_0x49b804,_0x199d('0x72'));})[_0x199d('0x2a')](function(_0x3f1aa1){if(_0x3f1aa1){logger[_0x199d('0x30')]('The\x20Call\x20ID\x20is:',_0x3f1aa1['id']);}})[_0x199d('0x2e')](function(_0xdcdee9){logger[_0x199d('0x40')]('[ABANDONED]',JSON[_0x199d('0xe')](_0xdcdee9));});}; \ 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 a824758..dab8d55 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(_0x5665eb,_0x519f17){var _0x7bb413=function(_0x1d0d87){while(--_0x1d0d87){_0x5665eb['push'](_0x5665eb['shift']());}};_0x7bb413(++_0x519f17);}(_0x7a54,0x106));var _0x47a5=function(_0x352ddd,_0x3548cc){_0x352ddd=_0x352ddd-0x0;var _0x56d63f=_0x7a54[_0x352ddd];return _0x56d63f;};'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(_0x3cda16,_0x41f73a){var _0x25604a=function(_0x536647){while(--_0x536647){_0x3cda16['push'](_0x3cda16['shift']());}};_0x25604a(++_0x41f73a);}(_0x7a54,0x106));var _0x47a5=function(_0x3c0cc1,_0xc8ad41){_0x3c0cc1=_0x3c0cc1-0x0;var _0x5da3cf=_0x7a54[_0x3c0cc1];return _0x5da3cf;};'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 60c29df..07fc9ce 100644 --- a/server/services/ami/trigger/urlforward/index.js +++ b/server/services/ami/trigger/urlforward/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util'];(function(_0x333eae,_0x172c50){var _0x471a03=function(_0x1310d4){while(--_0x1310d4){_0x333eae['push'](_0x333eae['shift']());}};_0x471a03(++_0x172c50);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2c7cb0,_0x1e70dc){_0x2c7cb0=_0x2c7cb0-0x0;var _0x2bcd08=_0x5f2f[_0x2c7cb0];return _0x2bcd08;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file +var _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(_0x4710be,_0x3d37bc){var _0x4e2505=function(_0x22469f){while(--_0x22469f){_0x4710be['push'](_0x4710be['shift']());}};_0x4e2505(++_0x3d37bc);}(_0x7a54,0x106));var _0x47a5=function(_0xae6736,_0x525fc1){_0xae6736=_0xae6736-0x0;var _0x33f50c=_0x7a54[_0xae6736];return _0x33f50c;};'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 3f94e29..7965735 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 _0xe79f=['rpc','message','result','exports','jayson/promise','../../config/logger','client','debug','routing','error'];(function(_0x3d64b8,_0x1b54ed){var _0x1d330d=function(_0x2fe769){while(--_0x2fe769){_0x3d64b8['push'](_0x3d64b8['shift']());}};_0x1d330d(++_0x1b54ed);}(_0xe79f,0x13a));var _0xfe79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe79f[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0xfe79('0x0'));var BPromise=require('bluebird');var logger=require(_0xfe79('0x1'))('routing');var client=jayson[_0xfe79('0x2')]['http']({'port':0x2329});client['Request']=function(_0x5901ba,_0x243f35){return new BPromise(function(_0x3cfd2b,_0xa04861){return client['request'](_0x5901ba,_0x243f35)['then'](function(_0x26ea00){logger[_0xfe79('0x3')]('rpc',_0xfe79('0x4'),_0x5901ba,_0x243f35,_0x26ea00);if(_0x26ea00[_0xfe79('0x5')]){logger['error'](_0xfe79('0x6'),_0xfe79('0x4'),_0x5901ba,_0x26ea00['error']['message'],_0x243f35);return _0xa04861(_0x26ea00[_0xfe79('0x5')][_0xfe79('0x7')]);}else{return _0x3cfd2b(_0x26ea00[_0xfe79('0x8')]);}})['catch'](function(_0x564a2f){logger['error'](_0xfe79('0x6'),'routing',_0x5901ba,_0x564a2f,_0x243f35);return _0xa04861(_0x564a2f);});});};module[_0xfe79('0x9')]=client; \ No newline at end of file +var _0x6aa7=['../../config/logger','routing','client','http','then','debug','rpc','error','message','result','catch','exports','jayson/promise'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x6aa7,0x178));var _0x76aa=function(_0x4897a0,_0xcfc03a){_0x4897a0=_0x4897a0-0x0;var _0x38f914=_0x6aa7[_0x4897a0];return _0x38f914;};'use strict';var jayson=require(_0x76aa('0x0'));var BPromise=require('bluebird');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var client=jayson[_0x76aa('0x3')][_0x76aa('0x4')]({'port':0x2329});client['Request']=function(_0x13f62b,_0xef15ef){return new BPromise(function(_0x1d6e04,_0x511588){return client['request'](_0x13f62b,_0xef15ef)[_0x76aa('0x5')](function(_0x4d53f6){logger[_0x76aa('0x6')](_0x76aa('0x7'),_0x76aa('0x2'),_0x13f62b,_0xef15ef,_0x4d53f6);if(_0x4d53f6['error']){logger[_0x76aa('0x8')](_0x76aa('0x7'),_0x76aa('0x2'),_0x13f62b,_0x4d53f6['error'][_0x76aa('0x9')],_0xef15ef);return _0x511588(_0x4d53f6[_0x76aa('0x8')][_0x76aa('0x9')]);}else{return _0x1d6e04(_0x4d53f6[_0x76aa('0xa')]);}})[_0x76aa('0xb')](function(_0x128435){logger[_0x76aa('0x8')](_0x76aa('0x7'),_0x76aa('0x2'),_0x13f62b,_0x128435,_0xef15ef);return _0x511588(_0x128435);});});};module[_0x76aa('0xc')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index f4405aa..e0dd769 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 _0x00e0=['loginMailFrequency','catch','log','bluebird','./server','./realtime','./rpc/mailAccount','resolve','then','refresh','listen','Setting'];(function(_0x325b13,_0x378e3e){var _0x1697fe=function(_0x16441c){while(--_0x16441c){_0x325b13['push'](_0x325b13['shift']());}};_0x1697fe(++_0x378e3e);}(_0x00e0,0x1e3));var _0x000e=function(_0x5ef75e,_0x51c47c){_0x5ef75e=_0x5ef75e-0x0;var _0x25ff08=_0x00e0[_0x5ef75e];return _0x25ff08;};'use strict';var BPromise=require(_0x000e('0x0'));var server=require(_0x000e('0x1'));var Realtime=require(_0x000e('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x000e('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require('../../mysqldb')['db'];function initRealtime(){return BPromise[_0x000e('0x4')]()['then'](mailAccount['getMailAccounts']())['then'](realtime['initMailAccounts']())[_0x000e('0x5')](function(){email[_0x000e('0x6')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x000e('0x7')](realtime,email)[_0x000e('0x5')](function(_0x3a2025){return initRealtime();})[_0x000e('0x5')](function(_0x4974e1){return db[_0x000e('0x8')]['findOne']({'attributes':['id',_0x000e('0x9')],'raw':!![]});})[_0x000e('0x5')](function(_0x2612d1){return setInterval(initRealtime,_0x2612d1[_0x000e('0x9')]*0x3e8);})[_0x000e('0xa')](function(_0x22cbee){console[_0x000e('0xb')](_0x22cbee);});}main(); \ No newline at end of file +var _0xe181=['./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','resolve','then','getMailAccounts','initMailAccounts','mailAccounts','listen','findOne','loginMailFrequency','catch','log','bluebird'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xe181,0x68));var _0x1e18=function(_0x5be7aa,_0x511ed0){_0x5be7aa=_0x5be7aa-0x0;var _0xcb1d4c=_0xe181[_0x5be7aa];return _0xcb1d4c;};'use strict';var BPromise=require(_0x1e18('0x0'));var server=require('./server');var Realtime=require(_0x1e18('0x1'));var EmailChannel=require(_0x1e18('0x2'));var mailAccount=require(_0x1e18('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x1e18('0x4'))['db'];function initRealtime(){return BPromise[_0x1e18('0x5')]()[_0x1e18('0x6')](mailAccount[_0x1e18('0x7')]())['then'](realtime[_0x1e18('0x8')]())['then'](function(){email['refresh'](realtime[_0x1e18('0x9')]);return realtime;});}function main(){return server[_0x1e18('0xa')](realtime,email)[_0x1e18('0x6')](function(_0x25b786){return initRealtime();})[_0x1e18('0x6')](function(_0x398f77){return db['Setting'][_0x1e18('0xb')]({'attributes':['id',_0x1e18('0xc')],'raw':!![]});})[_0x1e18('0x6')](function(_0x363da4){return setInterval(initRealtime,_0x363da4[_0x1e18('0xc')]*0x3e8);})[_0x1e18('0xd')](function(_0x56f13a){console[_0x1e18('0xe')](_0x56f13a);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 4a36f1a..17290d8 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 _0xc80a=['verify','exports','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','active','status','Imap','isNil','stringify','emit','refresh','hasOwnProperty','handleImapBox','bind','handleImapEmail','end','error','handleImapError','disabled','messageStatus','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','sendMail','verifySmtp','Smtp','lastSync'];(function(_0x3c8d6c,_0x51ae3a){var _0x146521=function(_0x4cd1ed){while(--_0x4cd1ed){_0x3c8d6c['push'](_0x3c8d6c['shift']());}};_0x146521(++_0x51ae3a);}(_0xc80a,0x110));var _0xac80=function(_0x1bfa72,_0x6668c8){_0x1bfa72=_0x1bfa72-0x0;var _0x57bfd5=_0xc80a[_0x1bfa72];return _0x57bfd5;};'use strict';var _=require('lodash');var moment=require(_0xac80('0x0'));var BPromise=require(_0xac80('0x1'));var md5=require(_0xac80('0x2'));var Redis=require(_0xac80('0x3'));var config=require('../../../config/environment');var logger=require(_0xac80('0x4'))(_0xac80('0x5'));config[_0xac80('0x6')]=_[_0xac80('0x7')](config[_0xac80('0x6')],{'host':_0xac80('0x8'),'port':0x18eb});var io=require(_0xac80('0x9'))(new Redis(config[_0xac80('0x6')]));var EmailImap=require(_0xac80('0xa'));var EmailSmtp=require(_0xac80('0xb'));var mailAccount=require(_0xac80('0xc'));var md5Accounts={};function EmailChannel(_0x3ec0ff){logger[_0xac80('0xd')](_0xac80('0xe'));this['mailAccounts']=_0x3ec0ff[_0xac80('0xf')];this[_0xac80('0x10')]={};this[_0xac80('0x11')]=new EmailSmtp();}EmailChannel[_0xac80('0x12')]['emit']=function(_0x2fd32a){var _0x3a2720=this[_0xac80('0xf')][_0x2fd32a];var _0x2f3951={'id':_0x3a2720['id'],'name':_0x3a2720['name'],'key':_0x3a2720['key'],'active':_0x3a2720[_0xac80('0x13')],'Imap':{'status':_0x3a2720['Imap'][_0xac80('0x14')],'messageStatus':_0x3a2720[_0xac80('0x15')]['messageStatus'],'total':_0x3a2720['Imap']['total']}};if(_[_0xac80('0x16')](md5Accounts[_0x2fd32a])){md5Accounts[_0x2fd32a]={};}var _0x4c9d74=md5(JSON[_0xac80('0x17')](_0x2f3951));if(md5Accounts[_0x2fd32a][_0xac80('0x2')]!==_0x4c9d74){md5Accounts[_0x2fd32a][_0xac80('0x2')]=_0x4c9d74;io[_0xac80('0x18')]('mailAccount:update',_0x2f3951);}};EmailChannel['prototype'][_0xac80('0x19')]=function(_0x3f6b7f){for(var _0x19b4bf in _0x3f6b7f){if(_0x3f6b7f[_0xac80('0x1a')](_0x19b4bf)){if(_0x3f6b7f[_0x19b4bf][_0xac80('0x15')]&&_0x3f6b7f[_0x19b4bf][_0xac80('0x13')]){var _0xdd32cd=_0x3f6b7f[_0x19b4bf][_0xac80('0x15')];if(!this[_0xac80('0x10')][_0xac80('0x1a')](_0xdd32cd['id'])){this['imapAccounts'][_0xdd32cd['id']]=new EmailImap(_0xdd32cd,_0x3f6b7f[_0x19b4bf][_0xac80('0x5')]);this['imapAccounts'][_0xdd32cd['id']]['on']('box',this[_0xac80('0x1b')][_0xac80('0x1c')](this,_0x19b4bf));this['imapAccounts'][_0xdd32cd['id']]['on']('email',this[_0xac80('0x1d')][_0xac80('0x1c')](this,_0x19b4bf));this[_0xac80('0x10')][_0xdd32cd['id']]['on'](_0xac80('0x1e'),this['handleImapEnd'][_0xac80('0x1c')](this,_0x19b4bf));this[_0xac80('0x10')][_0xdd32cd['id']]['on'](_0xac80('0x1f'),this[_0xac80('0x20')][_0xac80('0x1c')](this,_0x19b4bf));}}else{if(_['isNil'](this['mailAccounts'][_0x19b4bf][_0xac80('0x15')])){this[_0xac80('0xf')][_0x19b4bf]['Imap']={};}this[_0xac80('0xf')][_0x19b4bf][_0xac80('0x15')][_0xac80('0x14')]=_0xac80('0x21');this['mailAccounts'][_0x19b4bf][_0xac80('0x15')][_0xac80('0x22')]='';this[_0xac80('0x18')](_0x19b4bf);}}}};EmailChannel[_0xac80('0x12')][_0xac80('0x1b')]=function(_0xaceea1,_0x405dcf){if(this[_0xac80('0xf')][_0xaceea1]){this['mailAccounts'][_0xaceea1]['Imap'][_0xac80('0x14')]=_0xac80('0x23');this[_0xac80('0xf')][_0xaceea1][_0xac80('0x15')]['messageStatus']=_0x405dcf[_0xac80('0x24')];if(_0x405dcf[_0xac80('0x25')]){this[_0xac80('0xf')][_0xaceea1][_0xac80('0x15')]['total']=_0x405dcf[_0xac80('0x25')]['total'];}return this[_0xac80('0x18')](_0xaceea1);}};EmailChannel[_0xac80('0x12')][_0xac80('0x1d')]=function(_0x2e241b,_0x20c0ef){logger[_0xac80('0xd')](_0xac80('0x26'),_0x20c0ef[_0xac80('0x27')],_0x20c0ef[_0xac80('0x28')],_0x20c0ef[_0xac80('0x29')],_0x2e241b);if(this['mailAccounts'][_0x2e241b]){return mailAccount[_0xac80('0x2a')](_0x2e241b,_0x20c0ef)[_0xac80('0x2b')](function(_0x4a17d2){if(_0x4a17d2){logger[_0xac80('0xd')](_0xac80('0x2c'));}})[_0xac80('0x2d')](function(_0x5b583e){logger[_0xac80('0x1f')](_0xac80('0x2e'),JSON[_0xac80('0x17')](_0x5b583e));});}};EmailChannel['prototype'][_0xac80('0x2f')]=function(_0x3ff0ba){if(this['mailAccounts'][_0x3ff0ba]&&this[_0xac80('0xf')][_0x3ff0ba][_0xac80('0x15')]){if(this['imapAccounts'][this[_0xac80('0xf')][_0x3ff0ba][_0xac80('0x15')]['id']]){delete this[_0xac80('0x10')][this['mailAccounts'][_0x3ff0ba][_0xac80('0x15')]['id']];}this['mailAccounts'][_0x3ff0ba][_0xac80('0x15')]['lastSync']=moment();this[_0xac80('0x18')](_0x3ff0ba);}};EmailChannel[_0xac80('0x12')][_0xac80('0x20')]=function(_0x1d7efa,_0x54edcc){if(this[_0xac80('0xf')][_0x1d7efa]){this[_0xac80('0xf')][_0x1d7efa][_0xac80('0x15')]['status']=_0xac80('0x1f');this['mailAccounts'][_0x1d7efa][_0xac80('0x15')]['messageStatus']=_0x54edcc;return this[_0xac80('0x18')](_0x1d7efa);}};EmailChannel[_0xac80('0x12')][_0xac80('0x30')]=function(_0x218b9f,_0x32a52f){return this[_0xac80('0x11')]['send'](_0x218b9f,_0x32a52f);};EmailChannel[_0xac80('0x12')][_0xac80('0x31')]=function(_0x6b6116){var _0x53d28e=this;if(this[_0xac80('0xf')][_0x6b6116['id']]){if(_[_0xac80('0x16')](this[_0xac80('0xf')][_0x6b6116['id']]['Smtp'])){this[_0xac80('0xf')][_0x6b6116['id']][_0xac80('0x32')]={};}this['mailAccounts'][_0x6b6116['id']][_0xac80('0x32')][_0xac80('0x33')]=moment();return new BPromise(function(_0x57ff41,_0x27d375){return _0x53d28e[_0xac80('0x11')][_0xac80('0x34')](_0x6b6116)[_0xac80('0x2b')](function(_0x830f81){_0x53d28e['mailAccounts'][_0x6b6116['id']][_0xac80('0x32')][_0xac80('0x14')]='verified';_0x53d28e[_0xac80('0xf')][_0x6b6116['id']][_0xac80('0x32')][_0xac80('0x22')]='';_0x53d28e[_0xac80('0x18')](_0x6b6116['id']);_0x57ff41(_0x830f81);})['catch'](function(_0x20e03a){_0x53d28e[_0xac80('0xf')][_0x6b6116['id']][_0xac80('0x32')][_0xac80('0x14')]=_0xac80('0x1f');_0x53d28e[_0xac80('0xf')][_0x6b6116['id']][_0xac80('0x32')][_0xac80('0x22')]=_0x20e03a;_0x53d28e[_0xac80('0x18')](_0x6b6116['id']);_0x27d375(_0x20e03a);});});}return this[_0xac80('0x11')]['verify'](_0x6b6116);};module[_0xac80('0x35')]=EmailChannel; \ No newline at end of file +var _0xeddd=['name','key','active','Imap','status','messageStatus','total','isNil','stringify','emit','refresh','hasOwnProperty','box','bind','handleImapEnd','error','handleImapError','handleImapBox','connected','messages','handleImapEmail','info','firstName','lastName','notify','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','verifySmtp','Smtp','verify','then','lodash','moment','md5','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','mailAccounts','imapAccounts','smtp','prototype'];(function(_0x558497,_0x167334){var _0x3964b4=function(_0x4a2184){while(--_0x4a2184){_0x558497['push'](_0x558497['shift']());}};_0x3964b4(++_0x167334);}(_0xeddd,0x1da));var _0xdedd=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xeddd[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0xdedd('0x0'));var moment=require(_0xdedd('0x1'));var BPromise=require('bluebird');var md5=require(_0xdedd('0x2'));var Redis=require('ioredis');var config=require(_0xdedd('0x3'));var logger=require(_0xdedd('0x4'))(_0xdedd('0x5'));config[_0xdedd('0x6')]=_[_0xdedd('0x7')](config[_0xdedd('0x6')],{'host':_0xdedd('0x8'),'port':0x18eb});var io=require(_0xdedd('0x9'))(new Redis(config[_0xdedd('0x6')]));var EmailImap=require(_0xdedd('0xa'));var EmailSmtp=require(_0xdedd('0xb'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x45c259){logger['info']('start\x20email\x20channel');this[_0xdedd('0xc')]=_0x45c259['mailAccounts'];this[_0xdedd('0xd')]={};this[_0xdedd('0xe')]=new EmailSmtp();}EmailChannel[_0xdedd('0xf')]['emit']=function(_0x48af40){var _0x4ed465=this[_0xdedd('0xc')][_0x48af40];var _0x431ead={'id':_0x4ed465['id'],'name':_0x4ed465[_0xdedd('0x10')],'key':_0x4ed465[_0xdedd('0x11')],'active':_0x4ed465[_0xdedd('0x12')],'Imap':{'status':_0x4ed465[_0xdedd('0x13')][_0xdedd('0x14')],'messageStatus':_0x4ed465[_0xdedd('0x13')][_0xdedd('0x15')],'total':_0x4ed465[_0xdedd('0x13')][_0xdedd('0x16')]}};if(_[_0xdedd('0x17')](md5Accounts[_0x48af40])){md5Accounts[_0x48af40]={};}var _0x1d7fb6=md5(JSON[_0xdedd('0x18')](_0x431ead));if(md5Accounts[_0x48af40]['md5']!==_0x1d7fb6){md5Accounts[_0x48af40]['md5']=_0x1d7fb6;io[_0xdedd('0x19')]('mailAccount:update',_0x431ead);}};EmailChannel[_0xdedd('0xf')][_0xdedd('0x1a')]=function(_0x5c206f){for(var _0x4da7ca in _0x5c206f){if(_0x5c206f['hasOwnProperty'](_0x4da7ca)){if(_0x5c206f[_0x4da7ca][_0xdedd('0x13')]&&_0x5c206f[_0x4da7ca][_0xdedd('0x12')]){var _0x2b5b80=_0x5c206f[_0x4da7ca]['Imap'];if(!this[_0xdedd('0xd')][_0xdedd('0x1b')](_0x2b5b80['id'])){this['imapAccounts'][_0x2b5b80['id']]=new EmailImap(_0x2b5b80,_0x5c206f[_0x4da7ca][_0xdedd('0x5')]);this[_0xdedd('0xd')][_0x2b5b80['id']]['on'](_0xdedd('0x1c'),this['handleImapBox']['bind'](this,_0x4da7ca));this[_0xdedd('0xd')][_0x2b5b80['id']]['on']('email',this['handleImapEmail'][_0xdedd('0x1d')](this,_0x4da7ca));this[_0xdedd('0xd')][_0x2b5b80['id']]['on']('end',this[_0xdedd('0x1e')][_0xdedd('0x1d')](this,_0x4da7ca));this[_0xdedd('0xd')][_0x2b5b80['id']]['on'](_0xdedd('0x1f'),this[_0xdedd('0x20')][_0xdedd('0x1d')](this,_0x4da7ca));}}else{if(_[_0xdedd('0x17')](this['mailAccounts'][_0x4da7ca]['Imap'])){this[_0xdedd('0xc')][_0x4da7ca][_0xdedd('0x13')]={};}this[_0xdedd('0xc')][_0x4da7ca][_0xdedd('0x13')][_0xdedd('0x14')]='disabled';this['mailAccounts'][_0x4da7ca][_0xdedd('0x13')][_0xdedd('0x15')]='';this[_0xdedd('0x19')](_0x4da7ca);}}}};EmailChannel[_0xdedd('0xf')][_0xdedd('0x21')]=function(_0x30cc7f,_0x5d1bcd){if(this[_0xdedd('0xc')][_0x30cc7f]){this[_0xdedd('0xc')][_0x30cc7f][_0xdedd('0x13')][_0xdedd('0x14')]=_0xdedd('0x22');this['mailAccounts'][_0x30cc7f][_0xdedd('0x13')][_0xdedd('0x15')]=_0x5d1bcd[_0xdedd('0x10')];if(_0x5d1bcd[_0xdedd('0x23')]){this[_0xdedd('0xc')][_0x30cc7f]['Imap'][_0xdedd('0x16')]=_0x5d1bcd[_0xdedd('0x23')][_0xdedd('0x16')];}return this[_0xdedd('0x19')](_0x30cc7f);}};EmailChannel[_0xdedd('0xf')][_0xdedd('0x24')]=function(_0xed35c3,_0x1b1431){logger[_0xdedd('0x25')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x1b1431[_0xdedd('0x26')],_0x1b1431[_0xdedd('0x27')],_0x1b1431['from'],_0xed35c3);if(this[_0xdedd('0xc')][_0xed35c3]){return mailAccount[_0xdedd('0x28')](_0xed35c3,_0x1b1431)['then'](function(_0x2190a7){if(_0x2190a7){logger[_0xdedd('0x25')]('Mail\x20accepted\x20from\x20routing');}})[_0xdedd('0x29')](function(_0x9cb659){logger[_0xdedd('0x1f')](_0xdedd('0x2a'),JSON[_0xdedd('0x18')](_0x9cb659));});}};EmailChannel[_0xdedd('0xf')][_0xdedd('0x1e')]=function(_0x4b22e8){if(this[_0xdedd('0xc')][_0x4b22e8]&&this[_0xdedd('0xc')][_0x4b22e8]['Imap']){if(this[_0xdedd('0xd')][this[_0xdedd('0xc')][_0x4b22e8][_0xdedd('0x13')]['id']]){delete this['imapAccounts'][this[_0xdedd('0xc')][_0x4b22e8][_0xdedd('0x13')]['id']];}this[_0xdedd('0xc')][_0x4b22e8]['Imap'][_0xdedd('0x2b')]=moment();this[_0xdedd('0x19')](_0x4b22e8);}};EmailChannel[_0xdedd('0xf')][_0xdedd('0x20')]=function(_0x408dc3,_0x4e123a){if(this[_0xdedd('0xc')][_0x408dc3]){this[_0xdedd('0xc')][_0x408dc3][_0xdedd('0x13')][_0xdedd('0x14')]=_0xdedd('0x1f');this['mailAccounts'][_0x408dc3][_0xdedd('0x13')][_0xdedd('0x15')]=_0x4e123a;return this[_0xdedd('0x19')](_0x408dc3);}};EmailChannel[_0xdedd('0xf')]['sendMail']=function(_0x17ed6e,_0x296d07){return this['smtp'][_0xdedd('0x2c')](_0x17ed6e,_0x296d07);};EmailChannel[_0xdedd('0xf')][_0xdedd('0x2d')]=function(_0x39b734){var _0x3a9d1f=this;if(this[_0xdedd('0xc')][_0x39b734['id']]){if(_[_0xdedd('0x17')](this[_0xdedd('0xc')][_0x39b734['id']]['Smtp'])){this[_0xdedd('0xc')][_0x39b734['id']][_0xdedd('0x2e')]={};}this['mailAccounts'][_0x39b734['id']]['Smtp'][_0xdedd('0x2b')]=moment();return new BPromise(function(_0x41dfad,_0x2971b8){return _0x3a9d1f[_0xdedd('0xe')][_0xdedd('0x2f')](_0x39b734)[_0xdedd('0x30')](function(_0x37402e){_0x3a9d1f[_0xdedd('0xc')][_0x39b734['id']]['Smtp'][_0xdedd('0x14')]='verified';_0x3a9d1f[_0xdedd('0xc')][_0x39b734['id']][_0xdedd('0x2e')][_0xdedd('0x15')]='';_0x3a9d1f[_0xdedd('0x19')](_0x39b734['id']);_0x41dfad(_0x37402e);})[_0xdedd('0x29')](function(_0xc08427){_0x3a9d1f[_0xdedd('0xc')][_0x39b734['id']][_0xdedd('0x2e')][_0xdedd('0x14')]=_0xdedd('0x1f');_0x3a9d1f[_0xdedd('0xc')][_0x39b734['id']]['Smtp']['messageStatus']=_0xc08427;_0x3a9d1f[_0xdedd('0x19')](_0x39b734['id']);_0x2971b8(_0xc08427);});});}return this[_0xdedd('0xe')]['verify'](_0x39b734);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 7fd6885..379cc14 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 _0x6c4d=['bind','end','error','handleError','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','search','handleReadUnseen','length','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','email','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','path','imap','lodash','randomstring','mailparser','simpleParser','iconv','events','./utils','mailbox','INBOX','account','getAccount','once','ready'];(function(_0x12769c,_0x1a275b){var _0x4c4376=function(_0x5d9861){while(--_0x5d9861){_0x12769c['push'](_0x12769c['shift']());}};_0x4c4376(++_0x1a275b);}(_0x6c4d,0x1a3));var _0xd6c4=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x6c4d[_0x2bf141];return _0x48277b;};'use strict';var fs=require('fs');var path=require(_0xd6c4('0x0'));var util=require('util');var Imap=require(_0xd6c4('0x1'));var _=require(_0xd6c4('0x2'));var rs=require(_0xd6c4('0x3'));var simpleParser=require(_0xd6c4('0x4'))[_0xd6c4('0x5')];var Iconv=require(_0xd6c4('0x6'))['Iconv'];var EventEmitter=require(_0xd6c4('0x7'))['EventEmitter'];var utils=require(_0xd6c4('0x8'));var logger=require('../../../config/logger')('email');function EmailImap(_0x211181,_0x16c92f){this[_0xd6c4('0x9')]=_0xd6c4('0xa');this[_0xd6c4('0xb')]=this[_0xd6c4('0xc')](_0x211181,_0x16c92f);this[_0xd6c4('0x1')]=new Imap(this[_0xd6c4('0xb')]);this[_0xd6c4('0x1')][_0xd6c4('0xd')](_0xd6c4('0xe'),this['handleReady'][_0xd6c4('0xf')](this));this[_0xd6c4('0x1')][_0xd6c4('0xd')](_0xd6c4('0x10'),this['handleEnd'][_0xd6c4('0xf')](this));this[_0xd6c4('0x1')]['on'](_0xd6c4('0x11'),this[_0xd6c4('0x12')][_0xd6c4('0xf')](this));this[_0xd6c4('0x1')]['connect']();}util[_0xd6c4('0x13')](EmailImap,EventEmitter);EmailImap[_0xd6c4('0x14')][_0xd6c4('0xc')]=function(_0x1bb550,_0x4cd8fa){var _0x5d4fe1={'connTimeout':_0x1bb550['connTimeout']?_0x1bb550[_0xd6c4('0x15')]*0x3e8:0x2710,'authTimeout':_0x1bb550['authTimeout']?_0x1bb550[_0xd6c4('0x16')]*0x3e8:0x1388};if(_[_0xd6c4('0x17')](_0x1bb550[_0xd6c4('0x18')])){if(_0x1bb550[_0xd6c4('0x19')]){_0x5d4fe1[_0xd6c4('0x1a')]=_0x1bb550['user'];_0x5d4fe1[_0xd6c4('0x1b')]=_0x1bb550[_0xd6c4('0x1b')];}_0x5d4fe1[_0xd6c4('0x1c')]=_0x1bb550[_0xd6c4('0x1c')];_0x5d4fe1[_0xd6c4('0x1d')]=_0x1bb550['port']||0x3e1;if(_0x1bb550[_0xd6c4('0x1e')]){_0x5d4fe1[_0xd6c4('0x1e')]=!![];}else{_0x5d4fe1[_0xd6c4('0x1e')]=![];_0x5d4fe1[_0xd6c4('0x1f')]=_0xd6c4('0x20');}}else{_0x5d4fe1[_0xd6c4('0x1a')]=_0x1bb550[_0xd6c4('0x1a')];_0x5d4fe1['password']=_0x1bb550[_0xd6c4('0x1b')];_0x5d4fe1['host']=utils[_0xd6c4('0x21')](_0x1bb550['service']);_0x5d4fe1[_0xd6c4('0x1d')]=0x3e1;_0x5d4fe1[_0xd6c4('0x1e')]=!![];}_0x5d4fe1['email']=_0x4cd8fa||_0x1bb550[_0xd6c4('0x1a')]||_0xd6c4('0x22');return _0x5d4fe1;};EmailImap[_0xd6c4('0x14')]['handleReady']=function(){this[_0xd6c4('0x1')][_0xd6c4('0x23')](this[_0xd6c4('0x9')],![],this['handleOpenBox']['bind'](this));};EmailImap[_0xd6c4('0x14')][_0xd6c4('0x24')]=function(_0x115b5a,_0x86a815){if(_0x115b5a){this['handleError'](_0x115b5a,!![]);}else{this[_0xd6c4('0x25')](_0xd6c4('0x26'),_0x86a815);this[_0xd6c4('0x27')]();}};EmailImap[_0xd6c4('0x14')]['handleCloseBox']=function(_0x5e88d0){if(_0x5e88d0){this['handleError'](_0x5e88d0,!![]);}else{this['imap'][_0xd6c4('0x10')]();}};EmailImap[_0xd6c4('0x14')][_0xd6c4('0x27')]=function(){this['imap'][_0xd6c4('0x28')](['UNSEEN'],this[_0xd6c4('0x29')][_0xd6c4('0xf')](this));};EmailImap[_0xd6c4('0x14')]['handleReadUnseen']=function(_0x146784,_0x4b748e){if(_0x146784){this[_0xd6c4('0x12')](_0x146784,!![]);}else{if(_0x4b748e[_0xd6c4('0x2a')]){try{var _0x2f060d=this[_0xd6c4('0x1')][_0xd6c4('0x2b')](_0x4b748e,{'bodies':'','markSeen':!![]});_0x2f060d['on'](_0xd6c4('0x2c'),this['handleFetchMessage'][_0xd6c4('0xf')](this));_0x2f060d[_0xd6c4('0xd')](_0xd6c4('0x11'),this[_0xd6c4('0x2d')]['bind'](this));_0x2f060d['once']('end',this[_0xd6c4('0x2e')][_0xd6c4('0xf')](this));}catch(_0x1ff228){logger[_0xd6c4('0x11')](_0x1ff228);}}else{this[_0xd6c4('0x1')][_0xd6c4('0x2f')](!![],this[_0xd6c4('0x30')][_0xd6c4('0xf')](this));}}};EmailImap[_0xd6c4('0x14')][_0xd6c4('0x31')]=function(_0x44fa8e,_0xe24a92){_0x44fa8e['on'](_0xd6c4('0x32'),this[_0xd6c4('0x33')][_0xd6c4('0xf')](this));_0x44fa8e[_0xd6c4('0xd')](_0xd6c4('0x34'),this[_0xd6c4('0x35')][_0xd6c4('0xf')](this));_0x44fa8e[_0xd6c4('0xd')]('end',this[_0xd6c4('0x36')]['bind'](this));};EmailImap['prototype'][_0xd6c4('0x33')]=function(_0x5853f8,_0x1e78eb){simpleParser(_0x5853f8,{'Iconv':Iconv},this[_0xd6c4('0x37')][_0xd6c4('0xf')](this));};EmailImap[_0xd6c4('0x14')][_0xd6c4('0x35')]=function(_0x1e020a){};EmailImap[_0xd6c4('0x14')]['handleMessageEnd']=function(){};EmailImap[_0xd6c4('0x14')][_0xd6c4('0x37')]=function(_0x25da97,_0x252801){if(_0x25da97){logger[_0xd6c4('0x11')](_0x25da97);}else{var _0x345ed9=this;utils['parser'](this['account'],_0x252801,function(_0x2e4133){_0x345ed9['emit'](_0xd6c4('0x38'),_0x2e4133);});}};EmailImap['prototype'][_0xd6c4('0x2e')]=function(){this[_0xd6c4('0x1')][_0xd6c4('0x2f')](!![],this[_0xd6c4('0x30')][_0xd6c4('0xf')](this));};EmailImap[_0xd6c4('0x14')][_0xd6c4('0x2d')]=function(_0x595cee){this[_0xd6c4('0x12')](_0x595cee);this[_0xd6c4('0x1')]['closeBox'](!![],this['handleCloseBox'][_0xd6c4('0xf')](this));};EmailImap[_0xd6c4('0x14')][_0xd6c4('0x39')]=function(){this[_0xd6c4('0x25')](_0xd6c4('0x10'));};EmailImap['prototype'][_0xd6c4('0x12')]=function(_0x1c1c74,_0x136fb9){logger[_0xd6c4('0x11')](_0xd6c4('0x12'),this[_0xd6c4('0xb')][_0xd6c4('0x38')],JSON[_0xd6c4('0x3a')](_0x1c1c74));var _0x5d2293='';if(_0x1c1c74){if(_0x1c1c74['textCode']){_0x5d2293=_0x1c1c74[_0xd6c4('0x3b')];}else{for(var _0x6d87cc in _0x1c1c74){if(_0x1c1c74[_0xd6c4('0x3c')](_0x6d87cc)){_0x5d2293+=_[_0xd6c4('0x3d')](_0x6d87cc)+':\x20'+_0x1c1c74[_0x6d87cc]+'\x0a';}}}}if(_0x136fb9){this[_0xd6c4('0x1')]['end']();}else{this[_0xd6c4('0x25')]('error',_0x5d2293);this['emit'](_0xd6c4('0x10'));}};module['exports']=EmailImap; \ No newline at end of file +var _0xe8b1=['prototype','handleReady','openBox','box','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','stringify','textCode','hasOwnProperty','upperFirst','path','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','once','bind','end','handleEnd','error','handleError','connect','inherits','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com'];(function(_0x1012f5,_0x20a3a7){var _0x283bd9=function(_0x30bc9d){while(--_0x30bc9d){_0x1012f5['push'](_0x1012f5['shift']());}};_0x283bd9(++_0x20a3a7);}(_0xe8b1,0xa0));var _0x1e8b=function(_0x13405d,_0xe260e2){_0x13405d=_0x13405d-0x0;var _0x486569=_0xe8b1[_0x13405d];return _0x486569;};'use strict';var fs=require('fs');var path=require(_0x1e8b('0x0'));var util=require(_0x1e8b('0x1'));var Imap=require(_0x1e8b('0x2'));var _=require(_0x1e8b('0x3'));var rs=require(_0x1e8b('0x4'));var simpleParser=require(_0x1e8b('0x5'))[_0x1e8b('0x6')];var Iconv=require(_0x1e8b('0x7'))['Iconv'];var EventEmitter=require(_0x1e8b('0x8'))[_0x1e8b('0x9')];var utils=require(_0x1e8b('0xa'));var logger=require(_0x1e8b('0xb'))(_0x1e8b('0xc'));function EmailImap(_0x82c5c1,_0x2aec6b){this[_0x1e8b('0xd')]='INBOX';this[_0x1e8b('0xe')]=this[_0x1e8b('0xf')](_0x82c5c1,_0x2aec6b);this[_0x1e8b('0x2')]=new Imap(this[_0x1e8b('0xe')]);this[_0x1e8b('0x2')][_0x1e8b('0x10')]('ready',this['handleReady'][_0x1e8b('0x11')](this));this[_0x1e8b('0x2')][_0x1e8b('0x10')](_0x1e8b('0x12'),this[_0x1e8b('0x13')][_0x1e8b('0x11')](this));this[_0x1e8b('0x2')]['on'](_0x1e8b('0x14'),this[_0x1e8b('0x15')][_0x1e8b('0x11')](this));this[_0x1e8b('0x2')][_0x1e8b('0x16')]();}util[_0x1e8b('0x17')](EmailImap,EventEmitter);EmailImap['prototype'][_0x1e8b('0xf')]=function(_0x3e15a9,_0x37095a){var _0x5e297c={'connTimeout':_0x3e15a9[_0x1e8b('0x18')]?_0x3e15a9['connTimeout']*0x3e8:0x2710,'authTimeout':_0x3e15a9[_0x1e8b('0x19')]?_0x3e15a9[_0x1e8b('0x19')]*0x3e8:0x1388};if(_[_0x1e8b('0x1a')](_0x3e15a9[_0x1e8b('0x1b')])){if(_0x3e15a9[_0x1e8b('0x1c')]){_0x5e297c[_0x1e8b('0x1d')]=_0x3e15a9['user'];_0x5e297c[_0x1e8b('0x1e')]=_0x3e15a9[_0x1e8b('0x1e')];}_0x5e297c[_0x1e8b('0x1f')]=_0x3e15a9[_0x1e8b('0x1f')];_0x5e297c[_0x1e8b('0x20')]=_0x3e15a9[_0x1e8b('0x20')]||0x3e1;if(_0x3e15a9[_0x1e8b('0x21')]){_0x5e297c[_0x1e8b('0x21')]=!![];}else{_0x5e297c[_0x1e8b('0x21')]=![];_0x5e297c[_0x1e8b('0x22')]=_0x1e8b('0x23');}}else{_0x5e297c['user']=_0x3e15a9[_0x1e8b('0x1d')];_0x5e297c[_0x1e8b('0x1e')]=_0x3e15a9[_0x1e8b('0x1e')];_0x5e297c[_0x1e8b('0x1f')]=utils[_0x1e8b('0x24')](_0x3e15a9['service']);_0x5e297c[_0x1e8b('0x20')]=0x3e1;_0x5e297c[_0x1e8b('0x21')]=!![];}_0x5e297c[_0x1e8b('0xc')]=_0x37095a||_0x3e15a9['user']||_0x1e8b('0x25');return _0x5e297c;};EmailImap[_0x1e8b('0x26')][_0x1e8b('0x27')]=function(){this[_0x1e8b('0x2')][_0x1e8b('0x28')](this['mailbox'],![],this['handleOpenBox'][_0x1e8b('0x11')](this));};EmailImap[_0x1e8b('0x26')]['handleOpenBox']=function(_0x45e1f1,_0x1f31ad){if(_0x45e1f1){this[_0x1e8b('0x15')](_0x45e1f1,!![]);}else{this['emit'](_0x1e8b('0x29'),_0x1f31ad);this['readUnseen']();}};EmailImap['prototype'][_0x1e8b('0x2a')]=function(_0x5cfc53){if(_0x5cfc53){this[_0x1e8b('0x15')](_0x5cfc53,!![]);}else{this['imap'][_0x1e8b('0x12')]();}};EmailImap[_0x1e8b('0x26')][_0x1e8b('0x2b')]=function(){this['imap'][_0x1e8b('0x2c')]([_0x1e8b('0x2d')],this[_0x1e8b('0x2e')][_0x1e8b('0x11')](this));};EmailImap[_0x1e8b('0x26')][_0x1e8b('0x2e')]=function(_0x3b8f33,_0x320a17){if(_0x3b8f33){this['handleError'](_0x3b8f33,!![]);}else{if(_0x320a17[_0x1e8b('0x2f')]){try{var _0x53e500=this[_0x1e8b('0x2')][_0x1e8b('0x30')](_0x320a17,{'bodies':'','markSeen':!![]});_0x53e500['on'](_0x1e8b('0x31'),this[_0x1e8b('0x32')][_0x1e8b('0x11')](this));_0x53e500['once']('error',this[_0x1e8b('0x33')][_0x1e8b('0x11')](this));_0x53e500[_0x1e8b('0x10')](_0x1e8b('0x12'),this[_0x1e8b('0x34')]['bind'](this));}catch(_0x5ad980){logger[_0x1e8b('0x14')](_0x5ad980);}}else{this[_0x1e8b('0x2')][_0x1e8b('0x35')](!![],this[_0x1e8b('0x2a')]['bind'](this));}}};EmailImap[_0x1e8b('0x26')]['handleFetchMessage']=function(_0x52c2d0,_0x5a378c){_0x52c2d0['on'](_0x1e8b('0x36'),this[_0x1e8b('0x37')][_0x1e8b('0x11')](this));_0x52c2d0[_0x1e8b('0x10')](_0x1e8b('0x38'),this[_0x1e8b('0x39')][_0x1e8b('0x11')](this));_0x52c2d0[_0x1e8b('0x10')]('end',this[_0x1e8b('0x3a')][_0x1e8b('0x11')](this));};EmailImap[_0x1e8b('0x26')]['handleMessageBody']=function(_0x3f1e94,_0x24dc89){simpleParser(_0x3f1e94,{'Iconv':Iconv},this[_0x1e8b('0x3b')][_0x1e8b('0x11')](this));};EmailImap['prototype'][_0x1e8b('0x39')]=function(_0x293d00){};EmailImap[_0x1e8b('0x26')][_0x1e8b('0x3a')]=function(){};EmailImap[_0x1e8b('0x26')][_0x1e8b('0x3b')]=function(_0x3b4965,_0x575d6e){if(_0x3b4965){logger[_0x1e8b('0x14')](_0x3b4965);}else{var _0x7f91cb=this;utils[_0x1e8b('0x3c')](this[_0x1e8b('0xe')],_0x575d6e,function(_0x399b2f){_0x7f91cb[_0x1e8b('0x3d')](_0x1e8b('0xc'),_0x399b2f);});}};EmailImap[_0x1e8b('0x26')][_0x1e8b('0x34')]=function(){this['imap'][_0x1e8b('0x35')](!![],this[_0x1e8b('0x2a')][_0x1e8b('0x11')](this));};EmailImap[_0x1e8b('0x26')][_0x1e8b('0x33')]=function(_0x23a84e){this[_0x1e8b('0x15')](_0x23a84e);this[_0x1e8b('0x2')]['closeBox'](!![],this[_0x1e8b('0x2a')][_0x1e8b('0x11')](this));};EmailImap['prototype'][_0x1e8b('0x13')]=function(){this[_0x1e8b('0x3d')](_0x1e8b('0x12'));};EmailImap[_0x1e8b('0x26')][_0x1e8b('0x15')]=function(_0x24b6b2,_0x16b0c6){logger[_0x1e8b('0x14')]('handleError',this[_0x1e8b('0xe')][_0x1e8b('0xc')],JSON[_0x1e8b('0x3e')](_0x24b6b2));var _0x1e4553='';if(_0x24b6b2){if(_0x24b6b2['textCode']){_0x1e4553=_0x24b6b2[_0x1e8b('0x3f')];}else{for(var _0x315ed8 in _0x24b6b2){if(_0x24b6b2[_0x1e8b('0x40')](_0x315ed8)){_0x1e4553+=_[_0x1e8b('0x41')](_0x315ed8)+':\x20'+_0x24b6b2[_0x315ed8]+'\x0a';}}}}if(_0x16b0c6){this['imap'][_0x1e8b('0x12')]();}else{this[_0x1e8b('0x3d')](_0x1e8b('0x14'),_0x1e4553);this['emit'](_0x1e8b('0x12'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 987a249..7213533 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 _0x8a5b=['createTransport','use','compile','toString','Not\x20verifired','nodemailer','bluebird','prototype','send'];(function(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0x8a5b,0x1f4));var _0xb8a5=function(_0x3cf070,_0x4c430e){_0x3cf070=_0x3cf070-0x0;var _0x3d835c=_0x8a5b[_0x3cf070];return _0x3d835c;};'use strict';var nodemailer=require(_0xb8a5('0x0'));var BPromise=require(_0xb8a5('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xb8a5('0x2')][_0xb8a5('0x3')]=function(_0x27148e,_0xc49dde){return new BPromise(function(_0x2a3ace,_0x286d13){var _0x3c8887=nodemailer[_0xb8a5('0x4')](_0x27148e);_0x3c8887[_0xb8a5('0x5')](_0xb8a5('0x6'),inlineBase64());_0x3c8887['sendMail'](_0xc49dde,function(_0x1e88d0,_0x214c9c){if(_0x1e88d0){_0x286d13(_0x1e88d0[_0xb8a5('0x7')]());}else{_0x2a3ace(_0x214c9c);}});});};EmailSmtp['prototype']['verify']=function(_0x464af3){return new BPromise(function(_0x170a46,_0x2b27ea){var _0x289727=nodemailer['createTransport'](_0x464af3);_0x289727['verify'](function(_0x2e63d4,_0xde7e97){if(_0x2e63d4){_0x2b27ea(_0x2e63d4[_0xb8a5('0x7')]());}else{if(_0xde7e97){_0x170a46(_0xde7e97);}else{_0x2b27ea(_0xb8a5('0x8'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xad5d=['createTransport','use','compile','sendMail','verify','toString','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype'];(function(_0xfcfd92,_0x238aba){var _0x45fb99=function(_0x82232a){while(--_0x82232a){_0xfcfd92['push'](_0xfcfd92['shift']());}};_0x45fb99(++_0x238aba);}(_0xad5d,0x1e8));var _0xdad5=function(_0xb0a3c4,_0x472476){_0xb0a3c4=_0xb0a3c4-0x0;var _0x2c19f7=_0xad5d[_0xb0a3c4];return _0x2c19f7;};'use strict';var nodemailer=require(_0xdad5('0x0'));var BPromise=require(_0xdad5('0x1'));var inlineBase64=require(_0xdad5('0x2'));function EmailSmtp(){}EmailSmtp[_0xdad5('0x3')]['send']=function(_0x20993b,_0xe0f4c0){return new BPromise(function(_0x439060,_0x2a9a27){var _0x1ae5c9=nodemailer[_0xdad5('0x4')](_0x20993b);_0x1ae5c9[_0xdad5('0x5')](_0xdad5('0x6'),inlineBase64());_0x1ae5c9[_0xdad5('0x7')](_0xe0f4c0,function(_0x20c549,_0xdfb2cf){if(_0x20c549){_0x2a9a27(_0x20c549['toString']());}else{_0x439060(_0xdfb2cf);}});});};EmailSmtp[_0xdad5('0x3')][_0xdad5('0x8')]=function(_0x5e1beb){return new BPromise(function(_0x551395,_0x3ad61f){var _0xea9c19=nodemailer[_0xdad5('0x4')](_0x5e1beb);_0xea9c19['verify'](function(_0x2c3a1c,_0x8619d6){if(_0x2c3a1c){_0x3ad61f(_0x2c3a1c[_0xdad5('0x9')]());}else{if(_0x8619d6){_0x551395(_0x8619d6);}else{_0x3ad61f(_0xdad5('0xa'));}}});});};module[_0xdad5('0xb')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 0a01704..424bb57 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 _0x4db5=['Attachments','Title','Data','gmail','yahoo','hotmail','outlook365','127.0.0.1','lodash','moment','randomstring','path','node-tnef','../../../config/logger','email','head','value','anonymous','@xcally.com','name','slice','join','Anonymous','split','length','pop','address','generate','html','test','replace','body','Empty\x20message

'];(function(_0xc0d362,_0x5f3a6f){var _0x3e433e=function(_0x1b0c9e){while(--_0x1b0c9e){_0xc0d362['push'](_0xc0d362['shift']());}};_0x3e433e(++_0x5f3a6f);}(_0x4db5,0xbc));var _0x54db=function(_0x29412f,_0x541395){_0x29412f=_0x29412f-0x0;var _0x3f0e2e=_0x4db5[_0x29412f];return _0x3f0e2e;};'use strict';var _=require(_0x54db('0x0'));var moment=require(_0x54db('0x1'));var random=require(_0x54db('0x2'));var fs=require('fs');var path=require(_0x54db('0x3'));var util=require('util');var tnef=require(_0x54db('0x4'));var logger=require(_0x54db('0x5'))(_0x54db('0x6'));var config=require('../../../config/environment');function getAddress(_0xa0837b){var _0x1a7bc6=_[_0x54db('0x7')](_0xa0837b[_0x54db('0x8')]);return _0x1a7bc6&&_0x1a7bc6['address']?_0x1a7bc6['address']:_0x54db('0x9')+random['generate'](0x6)+_0x54db('0xa');}function getFirstName(_0x18e3ce){var _0x58f93b=_[_0x54db('0x7')](_0x18e3ce[_0x54db('0x8')]);if(_0x58f93b&&_0x58f93b['name']){var _0x5dcb93=_0x58f93b[_0x54db('0xb')]['split'](/\s+/);return _0x5dcb93['length']?_0x5dcb93[_0x54db('0xc')](0x0,-0x1)[_0x54db('0xd')]('\x20'):_0x58f93b[_0x54db('0xb')];}return _0x54db('0xe');}function getLastName(_0x49bcc4){var _0x1411c8=_[_0x54db('0x7')](_0x49bcc4[_0x54db('0x8')]);if(_0x1411c8&&_0x1411c8[_0x54db('0xb')]){var _0x5b6fb9=_0x1411c8[_0x54db('0xb')][_0x54db('0xf')](/\s+/);return _0x5b6fb9[_0x54db('0x10')]>0x1?_0x5b6fb9[_0x54db('0x11')]():'';}return'';}function getMails(_0x35fbe7,_0x1ac960){var _0x1dbdf9='';for(var _0xb76917=0x0;_0xb76917<_0x1ac960['value'][_0x54db('0x10')];_0xb76917+=0x1){if(_0x1ac960[_0x54db('0x8')][_0xb76917][_0x54db('0x12')]!==_0x35fbe7){if(!_['isEmpty'](_0x1dbdf9)){_0x1dbdf9+=',';}_0x1dbdf9+=_0x1ac960[_0x54db('0x8')][_0xb76917][_0x54db('0xb')]||_0x1ac960[_0x54db('0x8')][_0xb76917][_0x54db('0x12')]||'';_0x1dbdf9+='\x20<';_0x1dbdf9+=_0x1ac960[_0x54db('0x8')][_0xb76917][_0x54db('0x12')]?_0x1ac960[_0x54db('0x8')][_0xb76917][_0x54db('0x12')]:_0x54db('0x9')+random[_0x54db('0x13')](0x6)+_0x54db('0xa');_0x1dbdf9+='>';}}return _0x1dbdf9;}function parseEmail(_0x356f8a,_0x2a9d24,_0x25b71e){if(_0x2a9d24[_0x54db('0x14')]){var _0x1f37a6=/)<[^<]*)*<\/script>/gi;while(_0x1f37a6[_0x54db('0x15')](_0x2a9d24[_0x54db('0x14')])){_0x2a9d24[_0x54db('0x14')]=_0x2a9d24[_0x54db('0x14')][_0x54db('0x16')](_0x1f37a6,'');}_0x25b71e[_0x54db('0x17')]=_0x2a9d24['html'];}else{_0x25b71e['body']=_0x2a9d24['textAsHtml'];}if(_0x25b71e[_0x54db('0x17')]){_0x25b71e['body']=_0x25b71e['body']['replace'](/Empty\x20message

','getHost','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','join','pop','isEmpty','test','html','replace','body','0x1?_0x539388[_0xcc66('0x14')]():'';}return'';}function getMails(_0x5b35f3,_0x332991){var _0x59d6ee='';for(var _0x562d85=0x0;_0x562d85<_0x332991[_0xcc66('0xa')][_0xcc66('0x11')];_0x562d85+=0x1){if(_0x332991[_0xcc66('0xa')][_0x562d85]['address']!==_0x5b35f3){if(!_[_0xcc66('0x15')](_0x59d6ee)){_0x59d6ee+=',';}_0x59d6ee+=_0x332991[_0xcc66('0xa')][_0x562d85][_0xcc66('0xf')]||_0x332991['value'][_0x562d85][_0xcc66('0xb')]||'';_0x59d6ee+='\x20<';_0x59d6ee+=_0x332991[_0xcc66('0xa')][_0x562d85]['address']?_0x332991['value'][_0x562d85]['address']:_0xcc66('0xc')+random[_0xcc66('0xd')](0x6)+_0xcc66('0xe');_0x59d6ee+='>';}}return _0x59d6ee;}function parseEmail(_0x28958f,_0x5e88e0,_0x44b596){if(_0x5e88e0['html']){var _0x29713b=/)<[^<]*)*<\/script>/gi;while(_0x29713b[_0xcc66('0x16')](_0x5e88e0['html'])){_0x5e88e0[_0xcc66('0x17')]=_0x5e88e0['html'][_0xcc66('0x18')](_0x29713b,'');}_0x44b596[_0xcc66('0x19')]=_0x5e88e0[_0xcc66('0x17')];}else{_0x44b596['body']=_0x5e88e0['textAsHtml'];}if(_0x44b596[_0xcc66('0x19')]){_0x44b596[_0xcc66('0x19')]=_0x44b596[_0xcc66('0x19')][_0xcc66('0x18')](/Empty\x20message

';if(_0x59da0[_0xcc66('0x37')]){for(var _0x38c001=0x0;_0x38c001<_0x59da0[_0xcc66('0x37')][_0xcc66('0x11')];_0x38c001++){var _0x2bada6=_0x59da0[_0xcc66('0x37')][_0x38c001];_0x2abee4[_0xcc66('0x1c')][_0xcc66('0x1f')]['push']({'filename':_0x2bada6[_0xcc66('0x38')],'content':new Buffer(_0x2bada6['Data'])});}}}_0x1bb3af(parseEmail(_0x5cd855,_0xddfa3f,_0x2abee4));});}else{_0xddfa3f[_0xcc66('0x17')]=_0xcc66('0x39');_0x1bb3af(parseEmail(_0x5cd855,_0xddfa3f,_0x2abee4));}}else{_0x1bb3af(parseEmail(_0x5cd855,_0xddfa3f,_0x2abee4));}};exports[_0xcc66('0x3a')]=function(_0x46bc71){switch(_0x46bc71){case'gmail':return _0xcc66('0x3b');case _0xcc66('0x3c'):return'imap.mail.yahoo.com';case _0xcc66('0x3d'):return _0xcc66('0x3e');case _0xcc66('0x3f'):return _0xcc66('0x40');}return _0xcc66('0x41');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 56785c3..03ee173 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x912e=['Smtp','exports','lodash','name','Service','key','active','Imap'];(function(_0x431b62,_0x3ac658){var _0x37d04b=function(_0x5cfda4){while(--_0x5cfda4){_0x431b62['push'](_0x431b62['shift']());}};_0x37d04b(++_0x3ac658);}(_0x912e,0x1da));var _0xe912=function(_0x18f9f2,_0x55dab1){_0x18f9f2=_0x18f9f2-0x0;var _0xd5d36d=_0x912e[_0x18f9f2];return _0xd5d36d;};'use strict';var _=require(_0xe912('0x0'));function MailAccount(_0x35d0c5){this['id']=_0x35d0c5['id']||0x0;this['name']=_0x35d0c5[_0xe912('0x1')]||_0xe912('0x2');this[_0xe912('0x3')]=_0x35d0c5['key']||'SERV';this[_0xe912('0x4')]=_0x35d0c5['active']||![];this['Imap']=_0x35d0c5[_0xe912('0x5')]||[];this['Smtp']=_0x35d0c5[_0xe912('0x6')]||[];}module[_0xe912('0x7')]=MailAccount; \ No newline at end of file +var _0xc91a=['lodash','name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x384b67,_0x37caa2){var _0x53bc50=function(_0x114781){while(--_0x114781){_0x384b67['push'](_0x384b67['shift']());}};_0x53bc50(++_0x37caa2);}(_0xc91a,0x144));var _0xac91=function(_0x158bc2,_0x6de58){_0x158bc2=_0x158bc2-0x0;var _0x5b1267=_0xc91a[_0x158bc2];return _0x5b1267;};'use strict';var _=require(_0xac91('0x0'));function MailAccount(_0x553dfe){this['id']=_0x553dfe['id']||0x0;this['name']=_0x553dfe[_0xac91('0x1')]||_0xac91('0x2');this[_0xac91('0x3')]=_0x553dfe[_0xac91('0x3')]||_0xac91('0x4');this[_0xac91('0x5')]=_0x553dfe[_0xac91('0x5')]||![];this[_0xac91('0x6')]=_0x553dfe[_0xac91('0x6')]||[];this[_0xac91('0x7')]=_0x553dfe[_0xac91('0x7')]||[];}module[_0xac91('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 3a17850..b8fc197 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3c8=['../model/mailAccount','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','mailAccounts','merge'];(function(_0x1c55f1,_0x3669ca){var _0x44dd27=function(_0x531d3e){while(--_0x531d3e){_0x1c55f1['push'](_0x1c55f1['shift']());}};_0x44dd27(++_0x3669ca);}(_0xc3c8,0x180));var _0x8c3c=function(_0x3c2947,_0x473f08){_0x3c2947=_0x3c2947-0x0;var _0x360ab3=_0xc3c8[_0x3c2947];return _0x360ab3;};'use strict';var _=require('lodash');var MailAccount=require(_0x8c3c('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x2ba29c,_0x3675eb,_0x59ff8a){var _0x404ce5=_[_0x8c3c('0x1')](_0x2ba29c,function(_0x2c1875,_0x5b1365){return _0x2c1875[_0x59ff8a];});for(var _0x3c1a53 in _0x3675eb){if(_0x3675eb[_0x8c3c('0x2')](_0x3c1a53)){if(!_0x404ce5[_0x3c1a53]){delete _0x3675eb[_0x3c1a53];}}}}Realtime[_0x8c3c('0x3')][_0x8c3c('0x4')]=function(_0x552106,_0xd031e){for(var _0x5c7703 in _0xd031e){if(_0x552106[_0x8c3c('0x2')](_0x5c7703)){_0x552106[_0x5c7703]=_0xd031e[_0x5c7703];}}};Realtime[_0x8c3c('0x3')][_0x8c3c('0x5')]=function(){var _0x3111ab=this;return function(_0x3d5d66){if(_0x3d5d66){freeIsNotKey(_0x3d5d66,_0x3111ab[_0x8c3c('0x6')],'id');for(var _0x84c78a=0x0,_0x52fc2c={},_0x1a77d3={};_0x84c78a<_0x3d5d66['length'];_0x84c78a+=0x1){_0x52fc2c=_0x3d5d66[_0x84c78a];if(_['isUndefined'](_0x3111ab['mailAccounts'][_0x52fc2c['id']])){_0x3111ab[_0x8c3c('0x6')][_0x52fc2c['id']]=new MailAccount(_0x52fc2c);}else{_[_0x8c3c('0x7')](_0x3111ab[_0x8c3c('0x6')][_0x52fc2c['id']],_0x52fc2c);}}}return _0x3111ab[_0x8c3c('0x6')];};};module['exports']=Realtime; \ No newline at end of file +var _0x2e50=['isUndefined','merge','exports','mailAccounts','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','length'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x2e50,0x1bb));var _0x02e5=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x2e50[_0x5c2c7c];return _0xea7ffe;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x02e5('0x0')]={};};function freeIsNotKey(_0x22cbc5,_0x8aad3b,_0xecfeb1){var _0x43ef59=_[_0x02e5('0x1')](_0x22cbc5,function(_0x3b1c48,_0x46df15){return _0x3b1c48[_0xecfeb1];});for(var _0x24eb90 in _0x8aad3b){if(_0x8aad3b['hasOwnProperty'](_0x24eb90)){if(!_0x43ef59[_0x24eb90]){delete _0x8aad3b[_0x24eb90];}}}}Realtime[_0x02e5('0x2')][_0x02e5('0x3')]=function(_0xc19a10,_0x3d9618){for(var _0x190216 in _0x3d9618){if(_0xc19a10[_0x02e5('0x4')](_0x190216)){_0xc19a10[_0x190216]=_0x3d9618[_0x190216];}}};Realtime['prototype'][_0x02e5('0x5')]=function(){var _0x2aca89=this;return function(_0x5e088d){if(_0x5e088d){freeIsNotKey(_0x5e088d,_0x2aca89['mailAccounts'],'id');for(var _0x30d46f=0x0,_0x1adc08={},_0x63708={};_0x30d46f<_0x5e088d[_0x02e5('0x6')];_0x30d46f+=0x1){_0x1adc08=_0x5e088d[_0x30d46f];if(_[_0x02e5('0x7')](_0x2aca89[_0x02e5('0x0')][_0x1adc08['id']])){_0x2aca89['mailAccounts'][_0x1adc08['id']]=new MailAccount(_0x1adc08);}else{_[_0x02e5('0x8')](_0x2aca89[_0x02e5('0x0')][_0x1adc08['id']],_0x1adc08);}}}return _0x2aca89[_0x02e5('0x0')];};};module[_0x02e5('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 1a41ec7..aa41dc2 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2087=['service','email','active','key','MailServerIn','MailServerOut','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0x2087,0xf3));var _0x7208=function(_0x3d8e0b,_0x2ec330){_0x3d8e0b=_0x3d8e0b-0x0;var _0x5f533c=_0x2087[_0x3d8e0b];return _0x5f533c;};'use strict';var client=require(_0x7208('0x0'));exports[_0x7208('0x1')]=function(){return function(){return client[_0x7208('0x2')](_0x7208('0x3'),{'options':{'attributes':['id','name',_0x7208('0x4'),_0x7208('0x5'),_0x7208('0x6'),_0x7208('0x7'),'ListId','TemplateId'],'raw':![],'include':[{'model':_0x7208('0x8'),'as':'Imap'},{'model':_0x7208('0x9'),'as':'Smtp'}]},'log':_0x7208('0xa')});};};exports[_0x7208('0xb')]=function(_0x2bf5f4,_0x94a960){return client[_0x7208('0x2')](_0x7208('0xc'),{'account':{'id':_0x2bf5f4},'body':_0x94a960,'log':_0x7208('0xc')});}; \ No newline at end of file +var _0x744c=['Imap','MailServerOut','Smtp','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','service','email','active','key','MailServerIn'];(function(_0x3bbde7,_0x344127){var _0x117992=function(_0x1d0170){while(--_0x1d0170){_0x3bbde7['push'](_0x3bbde7['shift']());}};_0x117992(++_0x344127);}(_0x744c,0xa0));var _0xc744=function(_0x1bd146,_0x1e60c0){_0x1bd146=_0x1bd146-0x0;var _0x433dc0=_0x744c[_0x1bd146];return _0x433dc0;};'use strict';var client=require(_0xc744('0x0'));exports[_0xc744('0x1')]=function(){return function(){return client[_0xc744('0x2')](_0xc744('0x3'),{'options':{'attributes':['id','name',_0xc744('0x4'),_0xc744('0x5'),_0xc744('0x6'),_0xc744('0x7'),'ListId','TemplateId'],'raw':![],'include':[{'model':_0xc744('0x8'),'as':_0xc744('0x9')},{'model':_0xc744('0xa'),'as':_0xc744('0xb')}]},'log':'getMailAccount'});};};exports['notify']=function(_0x2bb565,_0xf1fc2f){return client['Request'](_0xc744('0xc'),{'account':{'id':_0x2bb565},'body':_0xf1fc2f,'log':_0xc744('0xc')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 0485db7..e5c3e68 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc04=['log','RPC\x20listening\x20on\x20port:','jayson/promise','lodash','../../../config/logger','sendMail','account','message','then','catch','error','verifySmtp','Verified','values','mailAccounts','Imap','password','Smtp','length','server','stringify','listen','127.0.0.1'];(function(_0x1bf611,_0x5a169b){var _0x46c450=function(_0x3528e0){while(--_0x3528e0){_0x1bf611['push'](_0x1bf611['shift']());}};_0x46c450(++_0x5a169b);}(_0xcc04,0xba));var _0x4cc0=function(_0x8665ac,_0x513169){_0x8665ac=_0x8665ac-0x0;var _0x37814f=_0xcc04[_0x8665ac];return _0x37814f;};'use strict';var jayson=require(_0x4cc0('0x0'));var BPromise=require('bluebird');var _=require(_0x4cc0('0x1'));var logger=require(_0x4cc0('0x2'))('email');exports['listen']=function(_0x2d7824,_0x339a1f){return new BPromise(function(_0x16ddcf,_0x5b7489){var _0x30f24d={'SendMail':function(_0x2abfd9){var _0x3aed9e=this;return new Promise(function(_0x3ead46,_0x5a18be){_0x339a1f[_0x4cc0('0x3')](_0x2abfd9[_0x4cc0('0x4')],_0x2abfd9[_0x4cc0('0x5')])[_0x4cc0('0x6')](function(_0x2b25bf){_0x3ead46({'code':0xc8,'message':_0x2b25bf});})[_0x4cc0('0x7')](function(_0x10a556){_0x5a18be(_0x3aed9e[_0x4cc0('0x8')](0x1f4,_0x10a556));});});},'VerifySmtp':function(_0x1d7eb0){var _0x5186ca=this;return new Promise(function(_0x57f42f,_0x110038){_0x339a1f[_0x4cc0('0x9')](_0x1d7eb0['account'])[_0x4cc0('0x6')](function(_0x20836e){_0x57f42f({'code':0xc8,'message':_0x4cc0('0xa')});})[_0x4cc0('0x7')](function(_0x103430){_0x110038(_0x5186ca['error'](0x1f4,_0x103430));});});},'MailAccounts':function(_0x1f7926){return new Promise(function(_0x2b60bc,_0x4184c1){var _0x5805a7=_[_0x4cc0('0xb')](_0x2d7824[_0x4cc0('0xc')]);for(var _0x2625bb=0x0;_0x2625bb<_0x5805a7['length'];_0x2625bb+=0x1){if(_0x5805a7[_0x2625bb][_0x4cc0('0xd')]&&_0x5805a7[_0x2625bb][_0x4cc0('0xd')]['password']){delete _0x5805a7[_0x2625bb][_0x4cc0('0xd')][_0x4cc0('0xe')];}if(_0x5805a7[_0x2625bb][_0x4cc0('0xf')]&&_0x5805a7[_0x2625bb][_0x4cc0('0xf')]['pass']){delete _0x5805a7[_0x2625bb][_0x4cc0('0xf')]['pass'];}}_0x2b60bc({'count':_0x5805a7[_0x4cc0('0x10')],'rows':_0x5805a7});});}};var _0x3db3b3=jayson[_0x4cc0('0x11')](_0x30f24d)['http']();_0x3db3b3['on']('error',function(_0x38a84b){logger[_0x4cc0('0x8')](JSON[_0x4cc0('0x12')](_0x38a84b));return _0x5b7489(_0x38a84b);});_0x3db3b3[_0x4cc0('0x13')](0x232b,_0x4cc0('0x14'),function(){console[_0x4cc0('0x15')]('Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232b);return _0x16ddcf(_0x4cc0('0x16')+0x232b);});});}; \ No newline at end of file +var _0x70a1=['stringify','127.0.0.1','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','../../../config/logger','email','listen','sendMail','account','then','catch','error','verifySmtp','mailAccounts','Imap','password','pass','Smtp','length','server'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0x70a1,0xea));var _0x170a=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0x70a1[_0x4c7935];return _0x30651d;};'use strict';var jayson=require(_0x170a('0x0'));var BPromise=require(_0x170a('0x1'));var _=require(_0x170a('0x2'));var logger=require(_0x170a('0x3'))(_0x170a('0x4'));exports[_0x170a('0x5')]=function(_0x50655f,_0x3ac075){return new BPromise(function(_0x31c3c6,_0x98e90){var _0x1e9580={'SendMail':function(_0xe99051){var _0x3bef34=this;return new Promise(function(_0x44d37b,_0x13ee5f){_0x3ac075[_0x170a('0x6')](_0xe99051[_0x170a('0x7')],_0xe99051['message'])[_0x170a('0x8')](function(_0x4f4309){_0x44d37b({'code':0xc8,'message':_0x4f4309});})[_0x170a('0x9')](function(_0x4b23fc){_0x13ee5f(_0x3bef34[_0x170a('0xa')](0x1f4,_0x4b23fc));});});},'VerifySmtp':function(_0x2f4648){var _0x2c17d4=this;return new Promise(function(_0xf621a8,_0x36830e){_0x3ac075[_0x170a('0xb')](_0x2f4648[_0x170a('0x7')])['then'](function(_0x429130){_0xf621a8({'code':0xc8,'message':'Verified'});})[_0x170a('0x9')](function(_0xd9ee89){_0x36830e(_0x2c17d4['error'](0x1f4,_0xd9ee89));});});},'MailAccounts':function(_0x565c13){return new Promise(function(_0x56e483,_0x3ff074){var _0x18b10d=_['values'](_0x50655f[_0x170a('0xc')]);for(var _0x10f3e6=0x0;_0x10f3e6<_0x18b10d['length'];_0x10f3e6+=0x1){if(_0x18b10d[_0x10f3e6][_0x170a('0xd')]&&_0x18b10d[_0x10f3e6][_0x170a('0xd')][_0x170a('0xe')]){delete _0x18b10d[_0x10f3e6][_0x170a('0xd')]['password'];}if(_0x18b10d[_0x10f3e6]['Smtp']&&_0x18b10d[_0x10f3e6]['Smtp'][_0x170a('0xf')]){delete _0x18b10d[_0x10f3e6][_0x170a('0x10')][_0x170a('0xf')];}}_0x56e483({'count':_0x18b10d[_0x170a('0x11')],'rows':_0x18b10d});});}};var _0x14dc54=jayson[_0x170a('0x12')](_0x1e9580)['http']();_0x14dc54['on'](_0x170a('0xa'),function(_0x5c668b){logger['error'](JSON[_0x170a('0x13')](_0x5c668b));return _0x98e90(_0x5c668b);});_0x14dc54[_0x170a('0x5')](0x232b,_0x170a('0x14'),function(){console['log'](_0x170a('0x15'),0x232b);return _0x31c3c6(_0x170a('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 460db16..0ee06e9 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf807=['port','socket.io','websocket','polling','redis','defaults','localhost','adapter','../../config/triggers','../../config/socketio','default','../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session','timeout','listen'];(function(_0x39cc75,_0x3cc940){var _0x30743a=function(_0x3a07b2){while(--_0x3a07b2){_0x39cc75['push'](_0x39cc75['shift']());}};_0x30743a(++_0x3cc940);}(_0xf807,0x171));var _0x7f80=function(_0x1fd437,_0x2c0b47){_0x1fd437=_0x1fd437-0x0;var _0x40d9e6=_0xf807[_0x1fd437];return _0x40d9e6;};'use strict';var _=require(_0x7f80('0x0'));var http=require(_0x7f80('0x1'));var express=require('express');var sticky=require(_0x7f80('0x2'));var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server[_0x7f80('0x3')]=0xdbba0;if(sticky[_0x7f80('0x4')](server,config[_0x7f80('0x5')])){var socketio=require(_0x7f80('0x6'))(server,{'transports':[_0x7f80('0x7'),_0x7f80('0x8')]});config[_0x7f80('0x9')]=_[_0x7f80('0xa')](config['redis'],{'host':_0x7f80('0xb'),'port':0x18eb});socketio[_0x7f80('0xc')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0x7f80('0xd'))['default']();require(_0x7f80('0xe'))[_0x7f80('0xf')](socketio);require(_0x7f80('0x10'))[_0x7f80('0xf')](app);require('../../routes')[_0x7f80('0xf')](app);}else{server[_0x7f80('0x11')](_0x7f80('0x12'),function(){console[_0x7f80('0x13')](_0x7f80('0x14'),config[_0x7f80('0x5')]);});}exports=module[_0x7f80('0x15')]=app; \ No newline at end of file +var _0xdbe8=['default','../../config/express','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','socket.io','polling','redis','localhost','adapter'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdbe8,0x196));var _0x8dbe=function(_0x2b4cdb,_0x56eb1b){_0x2b4cdb=_0x2b4cdb-0x0;var _0x11f3c3=_0xdbe8[_0x2b4cdb];return _0x11f3c3;};'use strict';var _=require('lodash');var http=require(_0x8dbe('0x0'));var express=require('express');var sticky=require(_0x8dbe('0x1'));var Redis=require(_0x8dbe('0x2'));var config=require(_0x8dbe('0x3'));var app=express();var server=http[_0x8dbe('0x4')](app);server[_0x8dbe('0x5')]=0xdbba0;if(sticky[_0x8dbe('0x6')](server,config['port'])){var socketio=require(_0x8dbe('0x7'))(server,{'transports':['websocket',_0x8dbe('0x8')]});config[_0x8dbe('0x9')]=_['defaults'](config['redis'],{'host':_0x8dbe('0xa'),'port':0x18eb});socketio[_0x8dbe('0xb')](require('socket.io-redis')({'pubClient':new Redis(config[_0x8dbe('0x9')]),'subClient':new Redis(config[_0x8dbe('0x9')])}));require('../../config/triggers')[_0x8dbe('0xc')]();require('../../config/socketio')['default'](socketio);require(_0x8dbe('0xd'))[_0x8dbe('0xc')](app);require(_0x8dbe('0xe'))[_0x8dbe('0xc')](app);}else{server[_0x8dbe('0xf')](_0x8dbe('0x10'),function(){console['log'](_0x8dbe('0x11'),config['port']);});}exports=module[_0x8dbe('0x12')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 72edd5a..6a9b1ce 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa4ba=['error','message','result','catch','exports','bluebird','../../config/logger','routing','client','Request','request','then','debug','rpc'];(function(_0x595919,_0x4ed5d7){var _0x28080c=function(_0x4d9b53){while(--_0x4d9b53){_0x595919['push'](_0x595919['shift']());}};_0x28080c(++_0x4ed5d7);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xa4ba[_0x36884e];return _0x1cc367;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xaa4b('0x0'));var logger=require(_0xaa4b('0x1'))(_0xaa4b('0x2'));var client=jayson[_0xaa4b('0x3')]['http']({'port':0x2329});client[_0xaa4b('0x4')]=function(_0x5e7bce,_0x54f0ce){return new BPromise(function(_0xeb83b1,_0x1b2ee8){return client[_0xaa4b('0x5')](_0x5e7bce,_0x54f0ce)[_0xaa4b('0x6')](function(_0x4809a9){logger[_0xaa4b('0x7')]('rpc',_0xaa4b('0x2'),_0x5e7bce,_0x54f0ce,_0x4809a9);if(_0x4809a9['error']){logger['error'](_0xaa4b('0x8'),_0xaa4b('0x2'),_0x5e7bce,_0x4809a9[_0xaa4b('0x9')][_0xaa4b('0xa')],_0x54f0ce);return _0x1b2ee8(_0x4809a9[_0xaa4b('0x9')][_0xaa4b('0xa')]);}else{return _0xeb83b1(_0x4809a9[_0xaa4b('0xb')]);}})[_0xaa4b('0xc')](function(_0xfb7353){logger[_0xaa4b('0x9')](_0xaa4b('0x8'),_0xaa4b('0x2'),_0x5e7bce,_0xfb7353,_0x54f0ce);return _0x1b2ee8(_0xfb7353);});});};module[_0xaa4b('0xd')]=client; \ No newline at end of file +var _0xc30d=['routing','client','http','Request','request','then','debug','rpc','error','message','result','exports','jayson/promise','../../config/logger'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xc30d,0x6e));var _0xdc30=function(_0xa3ff70,_0x4a8609){_0xa3ff70=_0xa3ff70-0x0;var _0x538dbb=_0xc30d[_0xa3ff70];return _0x538dbb;};'use strict';var jayson=require(_0xdc30('0x0'));var BPromise=require('bluebird');var logger=require(_0xdc30('0x1'))(_0xdc30('0x2'));var client=jayson[_0xdc30('0x3')][_0xdc30('0x4')]({'port':0x2329});client[_0xdc30('0x5')]=function(_0x50c802,_0x1cc1bc){return new BPromise(function(_0x53cb76,_0x46593f){return client[_0xdc30('0x6')](_0x50c802,_0x1cc1bc)[_0xdc30('0x7')](function(_0x3e480e){logger[_0xdc30('0x8')](_0xdc30('0x9'),'routing',_0x50c802,_0x1cc1bc,_0x3e480e);if(_0x3e480e[_0xdc30('0xa')]){logger[_0xdc30('0xa')](_0xdc30('0x9'),_0xdc30('0x2'),_0x50c802,_0x3e480e[_0xdc30('0xa')][_0xdc30('0xb')],_0x1cc1bc);return _0x46593f(_0x3e480e[_0xdc30('0xa')][_0xdc30('0xb')]);}else{return _0x53cb76(_0x3e480e[_0xdc30('0xc')]);}})['catch'](function(_0x518d8e){logger['error'](_0xdc30('0x9'),_0xdc30('0x2'),_0x50c802,_0x518d8e,_0x1cc1bc);return _0x46593f(_0x518d8e);});});};module[_0xdc30('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index df66283..e8df864 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34c8=['initChatQueues','getSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues'];(function(_0x564760,_0x3207f8){var _0x1cb18d=function(_0x3d517b){while(--_0x3d517b){_0x564760['push'](_0x564760['shift']());}};_0x1cb18d(++_0x3207f8);}(_0x34c8,0x1bd));var _0x834c=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x34c8[_0x5f309e];return _0x487b5e;};'use strict';var BPromise=require(_0x834c('0x0'));var server=require('./server');var Realtime=require(_0x834c('0x1'));var user=require(_0x834c('0x2'));var interval=require(_0x834c('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x834c('0x4'));var smsQueue=require(_0x834c('0x5'));var mailQueue=require(_0x834c('0x6'));var faxQueue=require('./rpc/faxQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x834c('0x7')]()[_0x834c('0x8')](user[_0x834c('0x9')]())['then'](realtime[_0x834c('0xa')]())[_0x834c('0x8')](interval[_0x834c('0xb')]())[_0x834c('0x8')](realtime[_0x834c('0xc')]())[_0x834c('0x8')](openchannelQueue[_0x834c('0xd')]())['then'](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x834c('0xe')]())[_0x834c('0x8')](realtime[_0x834c('0xf')]())[_0x834c('0x8')](smsQueue[_0x834c('0x10')]())[_0x834c('0x8')](realtime['initSmsQueues']())[_0x834c('0x8')](mailQueue['getMailQueues']())[_0x834c('0x8')](realtime[_0x834c('0x11')]())[_0x834c('0x8')](faxQueue[_0x834c('0x12')]())['then'](realtime[_0x834c('0x13')]())[_0x834c('0x8')](function(){return realtime;});}function main(){return server[_0x834c('0x14')](realtime)[_0x834c('0x8')](function(_0x2ecddb){return initRealtime();})[_0x834c('0x8')](function(_0x26a60b){return setInterval(initRealtime,0x1388);})[_0x834c('0x15')](function(_0x853a87){console[_0x834c('0x16')](_0x853a87);});}main(); \ No newline at end of file +var _0xe040=['initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','resolve','getAgents','initAgents','then','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xe040,0xb6));var _0x0e04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe040[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x0e04('0x0'));var server=require(_0x0e04('0x1'));var Realtime=require(_0x0e04('0x2'));var user=require(_0x0e04('0x3'));var interval=require(_0x0e04('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x0e04('0x5'));var smsQueue=require(_0x0e04('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x0e04('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x0e04('0x8')]()['then'](user[_0x0e04('0x9')]())['then'](realtime[_0x0e04('0xa')]())[_0x0e04('0xb')](interval[_0x0e04('0xc')]())[_0x0e04('0xb')](realtime[_0x0e04('0xd')]())[_0x0e04('0xb')](openchannelQueue[_0x0e04('0xe')]())[_0x0e04('0xb')](realtime[_0x0e04('0xf')]())[_0x0e04('0xb')](chatQueue[_0x0e04('0x10')]())[_0x0e04('0xb')](realtime['initChatQueues']())['then'](smsQueue[_0x0e04('0x11')]())['then'](realtime[_0x0e04('0x12')]())[_0x0e04('0xb')](mailQueue[_0x0e04('0x13')]())[_0x0e04('0xb')](realtime[_0x0e04('0x14')]())[_0x0e04('0xb')](faxQueue[_0x0e04('0x15')]())['then'](realtime['initFaxQueues']())['then'](function(){return realtime;});}function main(){return server[_0x0e04('0x16')](realtime)[_0x0e04('0xb')](function(_0x224c18){return initRealtime();})['then'](function(_0x55b04f){return setInterval(initRealtime,0x1388);})[_0x0e04('0x17')](function(_0x36d502){console[_0x0e04('0x18')](_0x36d502);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index 4b68d69..51027dc 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa185=['noop','findRules','turn','priority','toJSON','map','condition','toString','consequence','fromJSON','isString','exports','lodash','events','init','isNil','register','ignoreFactChanges','prototype','rules','activeRules','isArray','concat','isObject','push','sync','filter','asc','execute','result','clone','ruleRef','name','index_','next','isEqual','nextTick','restart','length','call'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa185,0xfc));var _0x5a18=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa185[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x5a18('0x0'));var util=require('util');var EventEmitter=require(_0x5a18('0x1'))['EventEmitter'];function RuleEngine(_0x23fdbb,_0x108ffb){this[_0x5a18('0x2')]();if(!_[_0x5a18('0x3')](_0x23fdbb)){this[_0x5a18('0x4')](_0x23fdbb);}if(_0x108ffb){this[_0x5a18('0x5')]=_0x108ffb[_0x5a18('0x5')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine[_0x5a18('0x6')]['init']=function(_0x686f12){this[_0x5a18('0x7')]=[];this[_0x5a18('0x8')]=[];};RuleEngine[_0x5a18('0x6')][_0x5a18('0x4')]=function(_0x3f927f){if(Array[_0x5a18('0x9')](_0x3f927f)){this['rules']=this[_0x5a18('0x7')][_0x5a18('0xa')](_0x3f927f);}else if(_0x3f927f!==null&&_[_0x5a18('0xb')](_0x3f927f)){this[_0x5a18('0x7')][_0x5a18('0xc')](_0x3f927f);}this['sync']();};RuleEngine[_0x5a18('0x6')][_0x5a18('0xd')]=function(){this[_0x5a18('0x8')]=this['rules'][_0x5a18('0xe')](function(_0x5e716a){if(_[_0x5a18('0x3')](_0x5e716a['on'])){_0x5e716a['on']=!![];}if(_0x5e716a['on']===!![]){return _0x5e716a;}});this['activeRules']=_['orderBy'](this[_0x5a18('0x8')],['p'],[_0x5a18('0xf')]);};RuleEngine[_0x5a18('0x6')][_0x5a18('0x10')]=function(_0x5d9951,_0xa1ed2b){var _0x328d28=![];_0x5d9951[_0x5a18('0x11')]=!![];var _0x2cb947=_['clone'](_0x5d9951);var _0x3dca22=_[_0x5a18('0x12')](_0x5d9951);var _0x4512a8=this['activeRules'];var _0x343690=[];var _0x1fc412=this[_0x5a18('0x5')];(function FnRuleLoop(_0x1e5d36){var _0x129f10={'rules':function(){return _0x4512a8;},'rule':function(){return _0x4512a8[_0x1e5d36];},'when':function(_0x34fae1){if(_0x34fae1){var _0x5045af=_0x4512a8[_0x1e5d36]['consequence'];_0x5045af[_0x5a18('0x13')]=_0x4512a8[_0x1e5d36]['id']||_0x4512a8[_0x1e5d36][_0x5a18('0x14')]||_0x5a18('0x15')+_0x1e5d36;process['nextTick'](function(){_0x343690[_0x5a18('0xc')](_0x5045af['ruleRef']);_0x5045af['call'](_0x2cb947,_0x129f10);});}else{process['nextTick'](function(){_0x129f10[_0x5a18('0x16')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x328d28=!![];return FnRuleLoop(0x0);},'next':function(_0x2ae966){if(!_0x1fc412&&!_[_0x5a18('0x17')](_0x3dca22,_0x2cb947)){_0x3dca22=_[_0x5a18('0x12')](_0x2cb947);process[_0x5a18('0x18')](function(){_0x129f10[_0x5a18('0x19')]();});}else{process[_0x5a18('0x18')](function(){if(_['isNil'](_0x2ae966)){return FnRuleLoop(_0x1e5d36+0x1);}else{return FnRuleLoop(_0x2ae966);}});}}};if(_0x1e5d36<_0x4512a8[_0x5a18('0x1a')]&&_0x328d28===![]){var _0x476e61=_0x4512a8[_0x1e5d36]['condition'];_0x476e61[_0x5a18('0x1b')](_0x2cb947,_0x129f10);}else{process[_0x5a18('0x18')](function(){_0x2cb947['matchPath']=_0x343690;return _0xa1ed2b?_0xa1ed2b(_0x2cb947):_[_0x5a18('0x1c')]();});}}(0x0));};RuleEngine[_0x5a18('0x6')][_0x5a18('0x1d')]=function(_0x4a238b){if(_['isNil'](_0x4a238b)){return this[_0x5a18('0x7')];}else{var _0x266a86=_['matches'](_0x4a238b);return _[_0x5a18('0xe')](this[_0x5a18('0x7')],_0x266a86);}};RuleEngine['prototype'][_0x5a18('0x1e')]=function(_0x38ca86,_0x294d2f){var _0x5acbc6=_0x38ca86==='on'||_0x38ca86==='ON'?!![]:![];var _0x528de5=this['findRules'](_0x294d2f);for(var _0x28af1d=0x0,_0xbe554d=_0x528de5['length'];_0x28af1d<_0xbe554d;_0x28af1d+=0x1){_0x528de5[_0x28af1d]['on']=_0x5acbc6;}this['sync']();};RuleEngine['prototype']['prioritize']=function(_0x5abc44,_0x4595a0){_0x5abc44=parseInt(_0x5abc44,0xa);var _0x10d158=this[_0x5a18('0x1d')](_0x4595a0);for(var _0xb48143=0x0,_0x3b2327=_0x10d158[_0x5a18('0x1a')];_0xb48143<_0x3b2327;_0xb48143+=0x1){_0x10d158[_0xb48143][_0x5a18('0x1f')]=_0x5abc44;}this[_0x5a18('0xd')]();};RuleEngine['prototype'][_0x5a18('0x20')]=function(){var _0x375694=this['rules'];if(_0x375694 instanceof Array){_0x375694=_0x375694[_0x5a18('0x21')](function(_0x18ab3c){_0x18ab3c[_0x5a18('0x22')]=_0x18ab3c[_0x5a18('0x22')][_0x5a18('0x23')]();_0x18ab3c[_0x5a18('0x24')]=_0x18ab3c[_0x5a18('0x24')][_0x5a18('0x23')]();return _0x18ab3c;});}else if(!_[_0x5a18('0x3')](_0x375694)){_0x375694[_0x5a18('0x22')]=_0x375694['condition'][_0x5a18('0x23')]();_0x375694[_0x5a18('0x24')]=_0x375694[_0x5a18('0x24')][_0x5a18('0x23')]();}return _0x375694;};RuleEngine[_0x5a18('0x6')][_0x5a18('0x25')]=function(_0x12e11a){this[_0x5a18('0x2')]();if(_[_0x5a18('0x26')](_0x12e11a)){_0x12e11a=JSON['parse'](_0x12e11a);}if(_0x12e11a instanceof Array){_0x12e11a=_0x12e11a[_0x5a18('0x21')](function(_0x5ca7c2){_0x5ca7c2['condition']=eval('('+_0x5ca7c2['condition']+')');_0x5ca7c2['consequence']=eval('('+_0x5ca7c2[_0x5a18('0x24')]+')');return _0x5ca7c2;});}else if(_0x12e11a!==null&&typeof _0x12e11a=='object'){_0x12e11a[_0x5a18('0x22')]=eval('('+_0x12e11a[_0x5a18('0x22')]+')');_0x12e11a[_0x5a18('0x24')]=eval('('+_0x12e11a[_0x5a18('0x24')]+')');}this[_0x5a18('0x4')](_0x12e11a);};module[_0x5a18('0x27')]=RuleEngine; \ No newline at end of file +var _0x4275=['consequence','fromJSON','isString','parse','exports','lodash','util','events','EventEmitter','init','ignoreFactChanges','inherits','prototype','activeRules','register','isArray','rules','concat','isObject','push','sync','isNil','asc','execute','clone','ruleRef','name','nextTick','call','next','isEqual','restart','length','condition','matches','turn','findRules','prioritize','priority','toJSON','map','toString'];(function(_0x5cafc5,_0x3e14fa){var _0x50f573=function(_0x5a468e){while(--_0x5a468e){_0x5cafc5['push'](_0x5cafc5['shift']());}};_0x50f573(++_0x3e14fa);}(_0x4275,0x1d3));var _0x5427=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4275[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5427('0x0'));var util=require(_0x5427('0x1'));var EventEmitter=require(_0x5427('0x2'))[_0x5427('0x3')];function RuleEngine(_0x1860b0,_0x1cee20){this[_0x5427('0x4')]();if(!_['isNil'](_0x1860b0)){this['register'](_0x1860b0);}if(_0x1cee20){this[_0x5427('0x5')]=_0x1cee20[_0x5427('0x5')];}return this;}util[_0x5427('0x6')](RuleEngine,EventEmitter);RuleEngine[_0x5427('0x7')]['init']=function(_0x29ef71){this['rules']=[];this[_0x5427('0x8')]=[];};RuleEngine['prototype'][_0x5427('0x9')]=function(_0xc6a87){if(Array[_0x5427('0xa')](_0xc6a87)){this[_0x5427('0xb')]=this[_0x5427('0xb')][_0x5427('0xc')](_0xc6a87);}else if(_0xc6a87!==null&&_[_0x5427('0xd')](_0xc6a87)){this['rules'][_0x5427('0xe')](_0xc6a87);}this[_0x5427('0xf')]();};RuleEngine['prototype']['sync']=function(){this[_0x5427('0x8')]=this[_0x5427('0xb')]['filter'](function(_0x5490bf){if(_[_0x5427('0x10')](_0x5490bf['on'])){_0x5490bf['on']=!![];}if(_0x5490bf['on']===!![]){return _0x5490bf;}});this[_0x5427('0x8')]=_['orderBy'](this[_0x5427('0x8')],['p'],[_0x5427('0x11')]);};RuleEngine['prototype'][_0x5427('0x12')]=function(_0x86ea7a,_0x2e9cea){var _0x21e653=![];_0x86ea7a['result']=!![];var _0x53cbdb=_[_0x5427('0x13')](_0x86ea7a);var _0x50fecb=_[_0x5427('0x13')](_0x86ea7a);var _0x506389=this[_0x5427('0x8')];var _0x79dafc=[];var _0x148305=this['ignoreFactChanges'];(function FnRuleLoop(_0x544e6c){var _0x436d93={'rules':function(){return _0x506389;},'rule':function(){return _0x506389[_0x544e6c];},'when':function(_0x46cd2e){if(_0x46cd2e){var _0x57816f=_0x506389[_0x544e6c]['consequence'];_0x57816f[_0x5427('0x14')]=_0x506389[_0x544e6c]['id']||_0x506389[_0x544e6c][_0x5427('0x15')]||'index_'+_0x544e6c;process[_0x5427('0x16')](function(){_0x79dafc[_0x5427('0xe')](_0x57816f[_0x5427('0x14')]);_0x57816f[_0x5427('0x17')](_0x53cbdb,_0x436d93);});}else{process[_0x5427('0x16')](function(){_0x436d93[_0x5427('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x21e653=!![];return FnRuleLoop(0x0);},'next':function(_0xe21549){if(!_0x148305&&!_[_0x5427('0x19')](_0x50fecb,_0x53cbdb)){_0x50fecb=_['clone'](_0x53cbdb);process['nextTick'](function(){_0x436d93[_0x5427('0x1a')]();});}else{process[_0x5427('0x16')](function(){if(_['isNil'](_0xe21549)){return FnRuleLoop(_0x544e6c+0x1);}else{return FnRuleLoop(_0xe21549);}});}}};if(_0x544e6c<_0x506389[_0x5427('0x1b')]&&_0x21e653===![]){var _0x5e55ae=_0x506389[_0x544e6c][_0x5427('0x1c')];_0x5e55ae['call'](_0x53cbdb,_0x436d93);}else{process['nextTick'](function(){_0x53cbdb['matchPath']=_0x79dafc;return _0x2e9cea?_0x2e9cea(_0x53cbdb):_['noop']();});}}(0x0));};RuleEngine[_0x5427('0x7')]['findRules']=function(_0x1684b8){if(_[_0x5427('0x10')](_0x1684b8)){return this[_0x5427('0xb')];}else{var _0x34cf58=_[_0x5427('0x1d')](_0x1684b8);return _['filter'](this[_0x5427('0xb')],_0x34cf58);}};RuleEngine[_0x5427('0x7')][_0x5427('0x1e')]=function(_0x490751,_0x1367fe){var _0x3ab1b2=_0x490751==='on'||_0x490751==='ON'?!![]:![];var _0x1e2709=this[_0x5427('0x1f')](_0x1367fe);for(var _0x2d197c=0x0,_0x1b9534=_0x1e2709['length'];_0x2d197c<_0x1b9534;_0x2d197c+=0x1){_0x1e2709[_0x2d197c]['on']=_0x3ab1b2;}this[_0x5427('0xf')]();};RuleEngine['prototype'][_0x5427('0x20')]=function(_0x14b42f,_0x7c9dbc){_0x14b42f=parseInt(_0x14b42f,0xa);var _0x5cbf0d=this['findRules'](_0x7c9dbc);for(var _0x15cba0=0x0,_0xebe0f9=_0x5cbf0d[_0x5427('0x1b')];_0x15cba0<_0xebe0f9;_0x15cba0+=0x1){_0x5cbf0d[_0x15cba0][_0x5427('0x21')]=_0x14b42f;}this[_0x5427('0xf')]();};RuleEngine[_0x5427('0x7')][_0x5427('0x22')]=function(){var _0xcff7c6=this[_0x5427('0xb')];if(_0xcff7c6 instanceof Array){_0xcff7c6=_0xcff7c6[_0x5427('0x23')](function(_0x5b3fbd){_0x5b3fbd[_0x5427('0x1c')]=_0x5b3fbd[_0x5427('0x1c')][_0x5427('0x24')]();_0x5b3fbd[_0x5427('0x25')]=_0x5b3fbd[_0x5427('0x25')]['toString']();return _0x5b3fbd;});}else if(!_[_0x5427('0x10')](_0xcff7c6)){_0xcff7c6[_0x5427('0x1c')]=_0xcff7c6[_0x5427('0x1c')][_0x5427('0x24')]();_0xcff7c6[_0x5427('0x25')]=_0xcff7c6[_0x5427('0x25')][_0x5427('0x24')]();}return _0xcff7c6;};RuleEngine[_0x5427('0x7')][_0x5427('0x26')]=function(_0x5437ab){this[_0x5427('0x4')]();if(_[_0x5427('0x27')](_0x5437ab)){_0x5437ab=JSON[_0x5427('0x28')](_0x5437ab);}if(_0x5437ab instanceof Array){_0x5437ab=_0x5437ab[_0x5427('0x23')](function(_0x365b03){_0x365b03[_0x5427('0x1c')]=eval('('+_0x365b03[_0x5427('0x1c')]+')');_0x365b03[_0x5427('0x25')]=eval('('+_0x365b03[_0x5427('0x25')]+')');return _0x365b03;});}else if(_0x5437ab!==null&&typeof _0x5437ab=='object'){_0x5437ab[_0x5427('0x1c')]=eval('('+_0x5437ab[_0x5427('0x1c')]+')');_0x5437ab[_0x5427('0x25')]=eval('('+_0x5437ab[_0x5427('0x25')]+')');}this['register'](_0x5437ab);};module[_0x5427('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 5b9299b..3739d59 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x386e4c,_0x4faef5){var _0x23063c=function(_0x59e8fb){while(--_0x59e8fb){_0x386e4c['push'](_0x386e4c['shift']());}};_0x23063c(++_0x4faef5);}(_0x814b,0x1a2));var _0xb814=function(_0x2abc3d,_0x48edca){_0x2abc3d=_0x2abc3d-0x0;var _0x252745=_0x814b[_0x2abc3d];return _0x252745;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x1e446d,_0x5f26c5){var _0x2a41cf=function(_0x30ce73){while(--_0x30ce73){_0x1e446d['push'](_0x1e446d['shift']());}};_0x2a41cf(++_0x5f26c5);}(_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/routing/model/agent.js b/server/services/routing/model/agent.js index faee0c2..c2711e3 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['Status','StatusTime','toNumber','chatCurrentCapacity','mailStatus','mailCurrentCapacity','stringify','emit','user:save','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','getChannelStatus','Capacity','maxcapacity','working','idle','updateRealtime','mail','fax','sms','length'];(function(_0x1aa289,_0x47d758){var _0xb7f13f=function(_0x8a8db3){while(--_0x8a8db3){_0x1aa289['push'](_0x1aa289['shift']());}};_0xb7f13f(++_0x47d758);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0x3071('0x0'));var Redis=require(_0x3071('0x1'));var config=require(_0x3071('0x2'));config[_0x3071('0x3')]=_[_0x3071('0x4')](config['redis'],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x3')]));function Agent(_0x3137c8){this['id']=_0x3137c8['id']||0x0;this[_0x3071('0x7')]=_0x3137c8[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0x3137c8[_0x3071('0x8')]||!![];this[_0x3071('0x9')]=_0x3137c8[_0x3071('0x9')]||![];this[_0x3071('0xa')]=_0x3137c8[_0x3071('0xa')]||![];this[_0x3071('0xb')]=_0x3137c8['mailPause']||![];this[_0x3071('0xc')]=_0x3137c8[_0x3071('0xc')]||![];this[_0x3071('0xd')]=_0x3137c8[_0x3071('0xd')]||![];this[_0x3071('0xe')]=_0x3137c8['openchannelPause']||![];this[_0x3071('0xf')]=_0x3071('0x10');this[_0x3071('0x11')]=0x0;this[_0x3071('0x12')]=_0x3137c8[_0x3071('0x12')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x3071('0x10');this['mailStatusTime']=0x0;this[_0x3071('0x13')]=_0x3137c8[_0x3071('0x13')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x3071('0x14')]='unknown';this[_0x3071('0x15')]=0x0;this[_0x3071('0x16')]=_0x3137c8[_0x3071('0x16')]||0x0;this[_0x3071('0x17')]=0x0;this[_0x3071('0x18')]=_0x3071('0x10');this[_0x3071('0x19')]=0x0;this[_0x3071('0x1a')]=_0x3137c8[_0x3071('0x1a')]||0x0;this[_0x3071('0x1b')]=0x0;this['openchannelStatus']=_0x3071('0x10');this[_0x3071('0x1c')]=0x0;this[_0x3071('0x1d')]=_0x3137c8[_0x3071('0x1d')]||0x0;this[_0x3071('0x1e')]=0x0;this[_0x3071('0x1f')]=![];this[_0x3071('0x20')]=undefined;this[_0x3071('0x0')]='';this['updateRealtime']();}Agent[_0x3071('0x21')][_0x3071('0x22')]=function(_0xd3e23d){if(this[_0xd3e23d+'CurrentCapacity']>0x0){if(this[_0xd3e23d+_0x3071('0x23')]>0x0&&this[_0xd3e23d+'CurrentCapacity']>=this[_0xd3e23d+_0x3071('0x23')]){return _0x3071('0x24');}else{return _0x3071('0x25');}}else{return _0x3071('0x26');}};Agent[_0x3071('0x21')][_0x3071('0x27')]=function(){var _0x3c5cef=[_0x3071('0x28'),'chat','openchannel',_0x3071('0x29'),_0x3071('0x2a')];for(var _0x412652=0x0;_0x412652<_0x3c5cef[_0x3071('0x2b')];_0x412652+=0x1){var _0x2793ef=this[_0x3071('0x22')](_0x3c5cef[_0x412652]);if(this[_0x3c5cef[_0x412652]+_0x3071('0x2c')]!==_0x2793ef){this[_0x3c5cef[_0x412652]+_0x3071('0x2d')]=_[_0x3071('0x2e')](moment()['format']('x'));}this[_0x3c5cef[_0x412652]+_0x3071('0x2c')]=_0x2793ef;}var _0x3f1e6e={'id':this['id'],'name':this[_0x3071('0x7')],'online':this['online'],'voicePause':this[_0x3071('0x9')],'chatPause':this[_0x3071('0xa')],'mailPause':this[_0x3071('0xb')],'smsPause':this[_0x3071('0xd')],'faxPause':this[_0x3071('0xc')],'openchannelPause':this[_0x3071('0xe')],'chatStatus':this[_0x3071('0xf')],'chatStatusTime':this[_0x3071('0x11')],'chatCapacity':this[_0x3071('0x12')],'chatCurrentCapacity':this[_0x3071('0x2f')],'mailStatus':this[_0x3071('0x30')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x3071('0x31')],'faxStatus':this[_0x3071('0x14')],'faxStatusTime':this[_0x3071('0x15')],'faxCapacity':this[_0x3071('0x16')],'faxCurrentCapacity':this[_0x3071('0x17')],'smsStatus':this[_0x3071('0x18')],'smsStatusTime':this[_0x3071('0x19')],'smsCapacity':this[_0x3071('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x3071('0x1d')],'openchannelCurrentCapacity':this[_0x3071('0x1e')],'busy':this['busy'],'busyQueue':this[_0x3071('0x20')]};var _0x28747d=md5(JSON[_0x3071('0x32')](_0x3f1e6e));if(this[_0x3071('0x0')]!==_0x28747d){this['md5']=_0x28747d;io[_0x3071('0x33')](_0x3071('0x34'),_0x3f1e6e);}};module[_0x3071('0x35')]=Agent; \ No newline at end of file +var _0xa9e0=['openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','mail','chat','fax','sms','length','Status','format','voicePause','chatStatus','chatStatusTime','smsStatus','smsStatusTime','smsCurrentCapacity','emit','user:save','exports','lodash','moment','md5','redis','localhost','socket.io-emitter','name','online','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsCapacity','openchannelStatus','openchannelStatusTime'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var md5=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 Agent(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||!![];this['voicePause']=_0x981158['voicePause']||![];this[_0x0a9e('0x8')]=_0x981158['chatPause']||![];this['mailPause']=_0x981158[_0x0a9e('0x9')]||![];this[_0x0a9e('0xa')]=_0x981158[_0x0a9e('0xa')]||![];this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')]||![];this[_0x0a9e('0xc')]=_0x981158['openchannelPause']||![];this['chatStatus']='unknown';this['chatStatusTime']=0x0;this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xd')]||0x0;this[_0x0a9e('0xe')]=0x0;this[_0x0a9e('0xf')]=_0x0a9e('0x10');this[_0x0a9e('0x11')]=0x0;this['mailCapacity']=_0x981158[_0x0a9e('0x12')]||0x0;this[_0x0a9e('0x13')]=0x0;this[_0x0a9e('0x14')]=_0x0a9e('0x10');this[_0x0a9e('0x15')]=0x0;this[_0x0a9e('0x16')]=_0x981158['faxCapacity']||0x0;this[_0x0a9e('0x17')]=0x0;this['smsStatus']=_0x0a9e('0x10');this['smsStatusTime']=0x0;this[_0x0a9e('0x18')]=_0x981158[_0x0a9e('0x18')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x0a9e('0x19')]='unknown';this[_0x0a9e('0x1a')]=0x0;this[_0x0a9e('0x1b')]=_0x981158[_0x0a9e('0x1b')]||0x0;this[_0x0a9e('0x1c')]=0x0;this[_0x0a9e('0x1d')]=![];this[_0x0a9e('0x1e')]=undefined;this[_0x0a9e('0x2')]='';this[_0x0a9e('0x1f')]();}Agent[_0x0a9e('0x20')][_0x0a9e('0x21')]=function(_0x1c696a){if(this[_0x1c696a+_0x0a9e('0x22')]>0x0){if(this[_0x1c696a+'Capacity']>0x0&&this[_0x1c696a+_0x0a9e('0x22')]>=this[_0x1c696a+_0x0a9e('0x23')]){return'maxcapacity';}else{return _0x0a9e('0x24');}}else{return'idle';}};Agent['prototype'][_0x0a9e('0x1f')]=function(){var _0x432e56=[_0x0a9e('0x25'),_0x0a9e('0x26'),'openchannel',_0x0a9e('0x27'),_0x0a9e('0x28')];for(var _0x3b45bc=0x0;_0x3b45bc<_0x432e56[_0x0a9e('0x29')];_0x3b45bc+=0x1){var _0x370d86=this[_0x0a9e('0x21')](_0x432e56[_0x3b45bc]);if(this[_0x432e56[_0x3b45bc]+_0x0a9e('0x2a')]!==_0x370d86){this[_0x432e56[_0x3b45bc]+'StatusTime']=_['toNumber'](moment()[_0x0a9e('0x2b')]('x'));}this[_0x432e56[_0x3b45bc]+_0x0a9e('0x2a')]=_0x370d86;}var _0x40c424={'id':this['id'],'name':this[_0x0a9e('0x6')],'online':this['online'],'voicePause':this[_0x0a9e('0x2c')],'chatPause':this['chatPause'],'mailPause':this[_0x0a9e('0x9')],'smsPause':this['smsPause'],'faxPause':this[_0x0a9e('0xa')],'openchannelPause':this[_0x0a9e('0xc')],'chatStatus':this[_0x0a9e('0x2d')],'chatStatusTime':this[_0x0a9e('0x2e')],'chatCapacity':this[_0x0a9e('0xd')],'chatCurrentCapacity':this[_0x0a9e('0xe')],'mailStatus':this[_0x0a9e('0xf')],'mailStatusTime':this[_0x0a9e('0x11')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x0a9e('0x13')],'faxStatus':this[_0x0a9e('0x14')],'faxStatusTime':this[_0x0a9e('0x15')],'faxCapacity':this[_0x0a9e('0x16')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x0a9e('0x2f')],'smsStatusTime':this[_0x0a9e('0x30')],'smsCapacity':this[_0x0a9e('0x18')],'smsCurrentCapacity':this[_0x0a9e('0x31')],'openchannelStatus':this[_0x0a9e('0x19')],'openchannelStatusTime':this[_0x0a9e('0x1a')],'openchannelCapacity':this[_0x0a9e('0x1b')],'openchannelCurrentCapacity':this[_0x0a9e('0x1c')],'busy':this[_0x0a9e('0x1d')],'busyQueue':this['busyQueue']};var _0x426950=md5(JSON['stringify'](_0x40c424));if(this[_0x0a9e('0x2')]!==_0x426950){this[_0x0a9e('0x2')]=_0x426950;io[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x40c424);}};module[_0x0a9e('0x34')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index f4e0132..0ab7211 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 _0x3b1a=['chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','length','online','available','stringify'];(function(_0x49e99b,_0x214e52){var _0x15c95e=function(_0x3180c7){while(--_0x3180c7){_0x49e99b['push'](_0x49e99b['shift']());}};_0x15c95e(++_0x214e52);}(_0x3b1a,0x199));var _0xa3b1=function(_0x3b9859,_0x52b534){_0x3b9859=_0x3b9859-0x0;var _0x3bc080=_0x3b1a[_0x3b9859];return _0x3bc080;};'use strict';var _=require(_0xa3b1('0x0'));var md5=require(_0xa3b1('0x1'));var util=require(_0xa3b1('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xa3b1('0x3')]=_[_0xa3b1('0x4')](config[_0xa3b1('0x3')],{'host':_0xa3b1('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa3b1('0x3')]));function ChatQueue(_0x23bc56){this['id']=_0x23bc56['id']||0x0;this[_0xa3b1('0x6')]=_0x23bc56[_0xa3b1('0x6')]||'';this['timeout']=_0x23bc56[_0xa3b1('0x7')]||0xa;this['strategy']=_0x23bc56[_0xa3b1('0x8')]||_0xa3b1('0x9');this[_0xa3b1('0xa')]=_0x23bc56[_0xa3b1('0xa')];this[_0xa3b1('0xb')]={};this[_0xa3b1('0xc')]=0x0;this[_0xa3b1('0x1')]='';this[_0xa3b1('0xd')]();this['updateRealtime']();}ChatQueue[_0xa3b1('0xe')][_0xa3b1('0xd')]=function(){var _0x4e8a1c=this[_0xa3b1('0xb')][_0xa3b1('0xf')];this[_0xa3b1('0xb')]=_['map'](this[_0xa3b1('0xa')],'id');this['mapAgentsId']['_rr']=_0x4e8a1c;};ChatQueue['prototype'][_0xa3b1('0x10')]=function(){this[_0xa3b1('0x11')]=0x0;this[_0xa3b1('0x12')]=0x0;for(var _0x14d67b=0x0;_0x14d67b=0x0?this[_0xa3b1('0x15')]:0x0;var _0x460c77={'id':this['id'],'available':this[_0xa3b1('0x15')],'loggedIn':this[_0xa3b1('0x11')],'name':this[_0xa3b1('0x6')],'paused':this[_0xa3b1('0x12')],'waiting':this[_0xa3b1('0xc')]};var _0x41e963=md5(JSON[_0xa3b1('0x16')](_0x460c77));if(this[_0xa3b1('0x1')]!==_0x41e963){this['md5']=_0x41e963;io['to'](util['format'](_0xa3b1('0x17'),_0x460c77[_0xa3b1('0x6')]))[_0xa3b1('0x18')](_0xa3b1('0x19'),_0x460c77);}};module[_0xa3b1('0x1a')]=ChatQueue; \ No newline at end of file +var _0x7bb8=['available','paused','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','length','online','chatPause'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x7bb8,0x12a));var _0x87bb=function(_0x2d8d64,_0x4c4da7){_0x2d8d64=_0x2d8d64-0x0;var _0x47b482=_0x7bb8[_0x2d8d64];return _0x47b482;};'use strict';var _=require(_0x87bb('0x0'));var md5=require(_0x87bb('0x1'));var util=require(_0x87bb('0x2'));var Redis=require(_0x87bb('0x3'));var config=require(_0x87bb('0x4'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x234ec9){this['id']=_0x234ec9['id']||0x0;this['name']=_0x234ec9[_0x87bb('0x5')]||'';this[_0x87bb('0x6')]=_0x234ec9['timeout']||0xa;this[_0x87bb('0x7')]=_0x234ec9[_0x87bb('0x7')]||_0x87bb('0x8');this[_0x87bb('0x9')]=_0x234ec9[_0x87bb('0x9')];this[_0x87bb('0xa')]={};this[_0x87bb('0xb')]=0x0;this['md5']='';this[_0x87bb('0xc')]();this[_0x87bb('0xd')]();}ChatQueue['prototype'][_0x87bb('0xc')]=function(){var _0x1a9dd8=this[_0x87bb('0xa')]['_rr'];this[_0x87bb('0xa')]=_[_0x87bb('0xe')](this[_0x87bb('0x9')],'id');this[_0x87bb('0xa')][_0x87bb('0xf')]=_0x1a9dd8;};ChatQueue[_0x87bb('0x10')]['updateRealtime']=function(){this[_0x87bb('0x11')]=0x0;this['paused']=0x0;for(var _0x19362b=0x0;_0x19362b=0x0?this[_0x87bb('0x15')]:0x0;var _0x4468d3={'id':this['id'],'available':this[_0x87bb('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x87bb('0x5')],'paused':this[_0x87bb('0x16')],'waiting':this[_0x87bb('0xb')]};var _0x572463=md5(JSON[_0x87bb('0x17')](_0x4468d3));if(this[_0x87bb('0x1')]!==_0x572463){this[_0x87bb('0x1')]=_0x572463;io['to'](util[_0x87bb('0x18')](_0x87bb('0x19'),_0x4468d3[_0x87bb('0x5')]))[_0x87bb('0x1a')](_0x87bb('0x1b'),_0x4468d3);}};module[_0x87bb('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 94f75ae..d909c37 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(_0x3b3fcb,_0x171351){var _0x31da1f=function(_0x4f455e){while(--_0x4f455e){_0x3b3fcb['push'](_0x3b3fcb['shift']());}};_0x31da1f(++_0x171351);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x29a9fe,_0xaef9a7){var _0x253b7b=function(_0x1bf2b7){while(--_0x1bf2b7){_0x29a9fe['push'](_0x29a9fe['shift']());}};_0x253b7b(++_0xaef9a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 fca95c9..a7d1e1b 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 _0x2186=['Intervals','exports'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0x2186,0x1ca));var _0x6218=function(_0x2540cf,_0x5c4da5){_0x2540cf=_0x2540cf-0x0;var _0x56749e=_0x2186[_0x2540cf];return _0x56749e;};'use strict';function Interval(_0x4a7ac4){this['id']=_0x4a7ac4['id']||0x0;this['name']=_0x4a7ac4['name']||'';this['Intervals']=_0x4a7ac4[_0x6218('0x0')]||{};}module[_0x6218('0x1')]=Interval; \ No newline at end of file +var _0x855d=['Intervals','exports'];(function(_0x854c9,_0x208d14){var _0x49ee42=function(_0x284853){while(--_0x284853){_0x854c9['push'](_0x854c9['shift']());}};_0x49ee42(++_0x208d14);}(_0x855d,0x8c));var _0xd855=function(_0x1129b3,_0x3bcbea){_0x1129b3=_0x1129b3-0x0;var _0x40246c=_0x855d[_0x1129b3];return _0x40246c;};'use strict';function Interval(_0x811d72){this['id']=_0x811d72['id']||0x0;this['name']=_0x811d72['name']||'';this[_0xd855('0x0')]=_0x811d72[_0xd855('0x0')]||{};}module[_0xd855('0x1')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 8ac5d52..2b9fbf8 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 _0x4075=['defaults','localhost','socket.io-emitter','name','timeout','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','paused','length','loggedIn','mailPause','available','stringify','format','mail:queue:%s','emit','exports','lodash','md5','../../../config/environment','redis'];(function(_0x3c9a99,_0x277cf0){var _0x39e144=function(_0x2ede7b){while(--_0x2ede7b){_0x3c9a99['push'](_0x3c9a99['shift']());}};_0x39e144(++_0x277cf0);}(_0x4075,0xcc));var _0x5407=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0x4075[_0x5a60ce];return _0x393e5e;};'use strict';var _=require(_0x5407('0x0'));var md5=require(_0x5407('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x5407('0x2'));config[_0x5407('0x3')]=_[_0x5407('0x4')](config[_0x5407('0x3')],{'host':_0x5407('0x5'),'port':0x18eb});var io=require(_0x5407('0x6'))(new Redis(config[_0x5407('0x3')]));function MailQueue(_0x3ebc84){this['id']=_0x3ebc84['id']||0x0;this[_0x5407('0x7')]=_0x3ebc84['name']||'';this[_0x5407('0x8')]=_0x3ebc84[_0x5407('0x8')]||0xa;this['strategy']=_0x3ebc84['strategy']||'beepall';this[_0x5407('0x9')]=_0x3ebc84['Agents'];this['mapAgentsId']={};this[_0x5407('0xa')]=0x0;this[_0x5407('0x1')]='';this[_0x5407('0xb')]();this[_0x5407('0xc')]();}MailQueue[_0x5407('0xd')]['updateRouting']=function(){var _0x3d51b7=this[_0x5407('0xe')][_0x5407('0xf')];this[_0x5407('0xe')]=_['map'](this[_0x5407('0x9')],'id');this[_0x5407('0xe')][_0x5407('0xf')]=_0x3d51b7;};MailQueue[_0x5407('0xd')][_0x5407('0xc')]=function(){this['loggedIn']=0x0;this[_0x5407('0x10')]=0x0;for(var _0x4b6767=0x0;_0x4b6767=0x0?this[_0x5407('0x14')]:0x0;var _0x1a1849={'id':this['id'],'available':this[_0x5407('0x14')],'loggedIn':this[_0x5407('0x12')],'name':this[_0x5407('0x7')],'paused':this[_0x5407('0x10')],'waiting':this[_0x5407('0xa')]};var _0xf1219b=md5(JSON[_0x5407('0x15')](_0x1a1849));if(this[_0x5407('0x1')]!==_0xf1219b){this[_0x5407('0x1')]=_0xf1219b;io['to'](util[_0x5407('0x16')](_0x5407('0x17'),_0x1a1849[_0x5407('0x7')]))[_0x5407('0x18')]('mail_queue:save',_0x1a1849);}};module[_0x5407('0x19')]=MailQueue; \ No newline at end of file +var _0xd4a2=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','online','paused','available','stringify','emit','mail_queue:save','exports','lodash','ioredis','redis','socket.io-emitter'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0xd4a2,0x173));var _0x2d4a=function(_0x65a0a3,_0x8a7981){_0x65a0a3=_0x65a0a3-0x0;var _0x407512=_0xd4a2[_0x65a0a3];return _0x407512;};'use strict';var _=require(_0x2d4a('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x2d4a('0x1'));var config=require('../../../config/environment');config[_0x2d4a('0x2')]=_['defaults'](config[_0x2d4a('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x2d4a('0x3'))(new Redis(config[_0x2d4a('0x2')]));function MailQueue(_0x2624b5){this['id']=_0x2624b5['id']||0x0;this[_0x2d4a('0x4')]=_0x2624b5[_0x2d4a('0x4')]||'';this['timeout']=_0x2624b5[_0x2d4a('0x5')]||0xa;this[_0x2d4a('0x6')]=_0x2624b5[_0x2d4a('0x6')]||_0x2d4a('0x7');this[_0x2d4a('0x8')]=_0x2624b5[_0x2d4a('0x8')];this[_0x2d4a('0x9')]={};this[_0x2d4a('0xa')]=0x0;this[_0x2d4a('0xb')]='';this[_0x2d4a('0xc')]();this[_0x2d4a('0xd')]();}MailQueue[_0x2d4a('0xe')]['updateRouting']=function(){var _0x5f3c52=this[_0x2d4a('0x9')]['_rr'];this[_0x2d4a('0x9')]=_[_0x2d4a('0xf')](this[_0x2d4a('0x8')],'id');this[_0x2d4a('0x9')][_0x2d4a('0x10')]=_0x5f3c52;};MailQueue[_0x2d4a('0xe')][_0x2d4a('0xd')]=function(){this[_0x2d4a('0x11')]=0x0;this['paused']=0x0;for(var _0x4be8b4=0x0;_0x4be8b4=0x0?this[_0x2d4a('0x14')]:0x0;var _0x388371={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x2d4a('0x13')],'waiting':this[_0x2d4a('0xa')]};var _0x321a33=md5(JSON[_0x2d4a('0x15')](_0x388371));if(this[_0x2d4a('0xb')]!==_0x321a33){this[_0x2d4a('0xb')]=_0x321a33;io['to'](util['format']('mail:queue:%s',_0x388371[_0x2d4a('0x4')]))[_0x2d4a('0x16')](_0x2d4a('0x17'),_0x388371);}};module[_0x2d4a('0x18')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 048e302..2320c4b 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 _0x7f6b=['defaults','localhost','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','openchannel:queue:%s','openchannel_queue:save','lodash','util','../../../config/environment'];(function(_0x160178,_0x17b211){var _0x9d42b6=function(_0x173fe0){while(--_0x173fe0){_0x160178['push'](_0x160178['shift']());}};_0x9d42b6(++_0x17b211);}(_0x7f6b,0x69));var _0xb7f6=function(_0x1f6f9a,_0x41179d){_0x1f6f9a=_0x1f6f9a-0x0;var _0x55a021=_0x7f6b[_0x1f6f9a];return _0x55a021;};'use strict';var _=require(_0xb7f6('0x0'));var md5=require('md5');var util=require(_0xb7f6('0x1'));var Redis=require('ioredis');var config=require(_0xb7f6('0x2'));config['redis']=_[_0xb7f6('0x3')](config['redis'],{'host':_0xb7f6('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb7f6('0x5')]));function OpenchannelQueue(_0x305bbc){this['id']=_0x305bbc['id']||0x0;this[_0xb7f6('0x6')]=_0x305bbc['name']||'';this[_0xb7f6('0x7')]=_0x305bbc[_0xb7f6('0x7')]||0xa;this[_0xb7f6('0x8')]=_0x305bbc[_0xb7f6('0x8')]||_0xb7f6('0x9');this[_0xb7f6('0xa')]=_0x305bbc[_0xb7f6('0xa')];this[_0xb7f6('0xb')]={};this[_0xb7f6('0xc')]=0x0;this[_0xb7f6('0xd')]='';this[_0xb7f6('0xe')]();this[_0xb7f6('0xf')]();}OpenchannelQueue[_0xb7f6('0x10')]['updateRouting']=function(){var _0x33951a=this['mapAgentsId'][_0xb7f6('0x11')];this[_0xb7f6('0xb')]=_[_0xb7f6('0x12')](this[_0xb7f6('0xa')],'id');this[_0xb7f6('0xb')][_0xb7f6('0x11')]=_0x33951a;};OpenchannelQueue[_0xb7f6('0x10')][_0xb7f6('0xf')]=function(){this[_0xb7f6('0x13')]=0x0;this[_0xb7f6('0x14')]=0x0;for(var _0x29654b=0x0;_0x29654b=0x0?this[_0xb7f6('0x17')]:0x0;var _0x37131b={'id':this['id'],'available':this[_0xb7f6('0x17')],'loggedIn':this[_0xb7f6('0x13')],'name':this[_0xb7f6('0x6')],'paused':this[_0xb7f6('0x14')],'waiting':this['waiting']};var _0x23dc83=md5(JSON[_0xb7f6('0x18')](_0x37131b));if(this['md5']!==_0x23dc83){this[_0xb7f6('0xd')]=_0x23dc83;io['to'](util['format'](_0xb7f6('0x19'),_0x37131b[_0xb7f6('0x6')]))['emit'](_0xb7f6('0x1a'),_0x37131b);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x7fe8=['localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','updateRouting','prototype','_rr','map','loggedIn','length','online','openchannelPause','paused','available','name','format','emit','openchannel_queue:save','exports','md5','util','ioredis','redis','defaults'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x7fe8,0xe5));var _0x87fe=function(_0x5f1cf8,_0x5e0923){_0x5f1cf8=_0x5f1cf8-0x0;var _0x27d0fa=_0x7fe8[_0x5f1cf8];return _0x27d0fa;};'use strict';var _=require('lodash');var md5=require(_0x87fe('0x0'));var util=require(_0x87fe('0x1'));var Redis=require(_0x87fe('0x2'));var config=require('../../../config/environment');config[_0x87fe('0x3')]=_[_0x87fe('0x4')](config[_0x87fe('0x3')],{'host':_0x87fe('0x5'),'port':0x18eb});var io=require(_0x87fe('0x6'))(new Redis(config[_0x87fe('0x3')]));function OpenchannelQueue(_0x17612c){this['id']=_0x17612c['id']||0x0;this['name']=_0x17612c['name']||'';this[_0x87fe('0x7')]=_0x17612c[_0x87fe('0x7')]||0xa;this[_0x87fe('0x8')]=_0x17612c[_0x87fe('0x8')]||'beepall';this[_0x87fe('0x9')]=_0x17612c[_0x87fe('0x9')];this[_0x87fe('0xa')]={};this['waiting']=0x0;this[_0x87fe('0x0')]='';this[_0x87fe('0xb')]();this['updateRealtime']();}OpenchannelQueue[_0x87fe('0xc')][_0x87fe('0xb')]=function(){var _0x1d7fa8=this['mapAgentsId'][_0x87fe('0xd')];this[_0x87fe('0xa')]=_[_0x87fe('0xe')](this[_0x87fe('0x9')],'id');this[_0x87fe('0xa')][_0x87fe('0xd')]=_0x1d7fa8;};OpenchannelQueue['prototype']['updateRealtime']=function(){this[_0x87fe('0xf')]=0x0;this['paused']=0x0;for(var _0x408a36=0x0;_0x408a36=0x0?this['available']:0x0;var _0x29fc76={'id':this['id'],'available':this[_0x87fe('0x14')],'loggedIn':this[_0x87fe('0xf')],'name':this[_0x87fe('0x15')],'paused':this[_0x87fe('0x13')],'waiting':this['waiting']};var _0x471f1b=md5(JSON['stringify'](_0x29fc76));if(this[_0x87fe('0x0')]!==_0x471f1b){this[_0x87fe('0x0')]=_0x471f1b;io['to'](util[_0x87fe('0x16')]('openchannel:queue:%s',_0x29fc76[_0x87fe('0x15')]))[_0x87fe('0x17')](_0x87fe('0x18'),_0x29fc76);}};module[_0x87fe('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 7b5673c..348435b 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(_0xd6fe7c,_0x58ea08){var _0x3e6c30=function(_0x54f7ac){while(--_0x54f7ac){_0xd6fe7c['push'](_0xd6fe7c['shift']());}};_0x3e6c30(++_0x58ea08);}(_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 _0xb7e7=['util','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','length','online','paused','available','stringify','sms:queue:%s','emit','exports','lodash'];(function(_0x3c056e,_0x4a82ad){var _0x24e848=function(_0x176a73){while(--_0x176a73){_0x3c056e['push'](_0x3c056e['shift']());}};_0x24e848(++_0x4a82ad);}(_0xb7e7,0x121));var _0x7b7e=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xb7e7[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x7b7e('0x0'));var md5=require('md5');var util=require(_0x7b7e('0x1'));var Redis=require('ioredis');var config=require(_0x7b7e('0x2'));config['redis']=_[_0x7b7e('0x3')](config['redis'],{'host':_0x7b7e('0x4'),'port':0x18eb});var io=require(_0x7b7e('0x5'))(new Redis(config[_0x7b7e('0x6')]));function SmsQueue(_0x52047f){this['id']=_0x52047f['id']||0x0;this['name']=_0x52047f[_0x7b7e('0x7')]||'';this[_0x7b7e('0x8')]=_0x52047f[_0x7b7e('0x8')]||0xa;this['strategy']=_0x52047f[_0x7b7e('0x9')]||_0x7b7e('0xa');this[_0x7b7e('0xb')]=_0x52047f[_0x7b7e('0xb')];this[_0x7b7e('0xc')]={};this[_0x7b7e('0xd')]=0x0;this[_0x7b7e('0xe')]='';this['updateRouting']();this[_0x7b7e('0xf')]();}SmsQueue[_0x7b7e('0x10')][_0x7b7e('0x11')]=function(){var _0x29b622=this[_0x7b7e('0xc')][_0x7b7e('0x12')];this[_0x7b7e('0xc')]=_[_0x7b7e('0x13')](this[_0x7b7e('0xb')],'id');this['mapAgentsId'][_0x7b7e('0x12')]=_0x29b622;};SmsQueue[_0x7b7e('0x10')]['updateRealtime']=function(){this[_0x7b7e('0x14')]=0x0;this['paused']=0x0;for(var _0x4c6011=0x0;_0x4c6011=0x0?this[_0x7b7e('0x18')]:0x0;var _0x200ef7={'id':this['id'],'available':this[_0x7b7e('0x18')],'loggedIn':this[_0x7b7e('0x14')],'name':this[_0x7b7e('0x7')],'paused':this[_0x7b7e('0x17')],'waiting':this[_0x7b7e('0xd')]};var _0x3bec7d=md5(JSON[_0x7b7e('0x19')](_0x200ef7));if(this[_0x7b7e('0xe')]!==_0x3bec7d){this[_0x7b7e('0xe')]=_0x3bec7d;io['to'](util['format'](_0x7b7e('0x1a'),_0x200ef7[_0x7b7e('0x7')]))[_0x7b7e('0x1b')]('sms_queue:save',_0x200ef7);}};module[_0x7b7e('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 773df18..cea6975 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 _0x560c=['initOpenchannelQueues','updateRealtime','initChatQueues','updateRouting','smsQueues','initMailQueues','initFaxQueues','faxQueues','exports','util','lodash','../model/interval','../model/openchannelQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','openchannelQueues','chatQueues','mailQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','length','isUndefined','initIntervals'];(function(_0x36ed2e,_0x174f27){var _0xdda4e=function(_0x2d366f){while(--_0x2d366f){_0x36ed2e['push'](_0x36ed2e['shift']());}};_0xdda4e(++_0x174f27);}(_0x560c,0xf0));var _0xc560=function(_0x4136ee,_0x6c5917){_0x4136ee=_0x4136ee-0x0;var _0x4e6077=_0x560c[_0x4136ee];return _0x4e6077;};'use strict';var BPromise=require('bluebird');var util=require(_0xc560('0x0'));var _=require(_0xc560('0x1'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0xc560('0x2'));var OpenchannelQueue=require(_0xc560('0x3'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0xc560('0x4'));var MailQueue=require(_0xc560('0x5'));var FaxQueue=require(_0xc560('0x6'));var Realtime=function(){this[_0xc560('0x7')]={};this[_0xc560('0x8')]={};this[_0xc560('0x9')]={};this[_0xc560('0xa')]={};this['smsQueues']={};this[_0xc560('0xb')]={};this['faxQueues']={};this[_0xc560('0xc')]={};this[_0xc560('0xd')]={};this[_0xc560('0xe')]={};this[_0xc560('0xf')]={};this[_0xc560('0x10')]={};};function freeIsNotKey(_0x38877a,_0x6f4be5,_0x3cda6d){var _0x3eb174=_['mapKeys'](_0x38877a,function(_0x41d294,_0x100c0b){return _0x41d294[_0x3cda6d];});for(var _0x151372 in _0x6f4be5){if(_0x6f4be5[_0xc560('0x11')](_0x151372)){if(!_0x3eb174[_0x151372]){delete _0x6f4be5[_0x151372];}}}}Realtime[_0xc560('0x12')][_0xc560('0x13')]=function(_0x5019d0,_0x21d60a){for(var _0x153e56 in _0x21d60a){if(_0x5019d0['hasOwnProperty'](_0x153e56)){_0x5019d0[_0x153e56]=_0x21d60a[_0x153e56];}}};Realtime[_0xc560('0x12')][_0xc560('0x14')]=function(){var _0x39cb2c=this;return function(_0x4e35fa){if(_0x4e35fa){freeIsNotKey(_0x4e35fa,_0x39cb2c[_0xc560('0x7')],'id');for(var _0x354d78=0x0,_0x357d17={},_0x95f8f8={};_0x354d78<_0x4e35fa[_0xc560('0x15')];_0x354d78+=0x1){_0x357d17=_0x4e35fa[_0x354d78];if(_[_0xc560('0x16')](_0x39cb2c[_0xc560('0x7')][_0x357d17['id']])){_0x39cb2c['agents'][_0x357d17['id']]=new Agent(_0x357d17);}else{_0x39cb2c['mergeFromDatabase'](_0x39cb2c['agents'][_0x357d17['id']],_0x357d17);}}}return _0x39cb2c[_0xc560('0x7')];};};Realtime['prototype'][_0xc560('0x17')]=function(){var _0x5f2aea=this;return function(_0x12faf5){if(_0x12faf5){freeIsNotKey(_0x12faf5,_0x5f2aea[_0xc560('0x8')],'id');for(var _0x186c02=0x0,_0x324ab6={},_0x2231c7={};_0x186c02<_0x12faf5[_0xc560('0x15')];_0x186c02+=0x1){_0x324ab6=_0x12faf5[_0x186c02];if(_[_0xc560('0x16')](_0x5f2aea[_0xc560('0x8')][_0x324ab6['id']])){_0x5f2aea[_0xc560('0x8')][_0x324ab6['id']]=new Interval(_0x324ab6);}else{_0x5f2aea[_0xc560('0x13')](_0x5f2aea[_0xc560('0x8')][_0x324ab6['id']],_0x324ab6);}}}return _0x5f2aea[_0xc560('0x8')];};};Realtime['prototype'][_0xc560('0x18')]=function(){var _0x5b91f3=this;return function(_0x2ada68){if(_0x2ada68){freeIsNotKey(_0x2ada68,_0x5b91f3['openchannelQueues'],'id');for(var _0x2d6cf5=0x0,_0x5e85b5={},_0x1fafea={};_0x2d6cf5<_0x2ada68[_0xc560('0x15')];_0x2d6cf5+=0x1){_0x5e85b5=_0x2ada68[_0x2d6cf5];if(_[_0xc560('0x16')](_0x5b91f3[_0xc560('0x9')][_0x5e85b5['id']])){_0x5b91f3[_0xc560('0x9')][_0x5e85b5['id']]=new OpenchannelQueue(_0x5e85b5);}else{_0x5b91f3[_0xc560('0x13')](_0x5b91f3[_0xc560('0x9')][_0x5e85b5['id']],_0x5e85b5);}_0x5b91f3[_0xc560('0x9')][_0x5e85b5['id']]['updateRouting']();_0x5b91f3[_0xc560('0x9')][_0x5e85b5['id']][_0xc560('0x19')]();}}return _0x5b91f3[_0xc560('0x9')];};};Realtime[_0xc560('0x12')][_0xc560('0x1a')]=function(){var _0x1e6c0d=this;return function(_0x49ba67){if(_0x49ba67){freeIsNotKey(_0x49ba67,_0x1e6c0d[_0xc560('0xa')],'id');for(var _0x397192=0x0,_0x412d95={},_0x1a4599={};_0x397192<_0x49ba67[_0xc560('0x15')];_0x397192+=0x1){_0x412d95=_0x49ba67[_0x397192];if(_['isUndefined'](_0x1e6c0d[_0xc560('0xa')][_0x412d95['id']])){_0x1e6c0d[_0xc560('0xa')][_0x412d95['id']]=new ChatQueue(_0x412d95);}else{_0x1e6c0d[_0xc560('0x13')](_0x1e6c0d[_0xc560('0xa')][_0x412d95['id']],_0x412d95);}_0x1e6c0d[_0xc560('0xa')][_0x412d95['id']][_0xc560('0x1b')]();_0x1e6c0d[_0xc560('0xa')][_0x412d95['id']][_0xc560('0x19')]();}}return _0x1e6c0d[_0xc560('0xa')];};};Realtime[_0xc560('0x12')]['initSmsQueues']=function(){var _0x5bdc9f=this;return function(_0x30ab9b){if(_0x30ab9b){freeIsNotKey(_0x30ab9b,_0x5bdc9f[_0xc560('0x1c')],'id');for(var _0x481128=0x0,_0x166ad4={},_0x100e07={};_0x481128<_0x30ab9b[_0xc560('0x15')];_0x481128+=0x1){_0x166ad4=_0x30ab9b[_0x481128];if(_[_0xc560('0x16')](_0x5bdc9f['smsQueues'][_0x166ad4['id']])){_0x5bdc9f[_0xc560('0x1c')][_0x166ad4['id']]=new SmsQueue(_0x166ad4);}else{_0x5bdc9f['mergeFromDatabase'](_0x5bdc9f[_0xc560('0x1c')][_0x166ad4['id']],_0x166ad4);}_0x5bdc9f[_0xc560('0x1c')][_0x166ad4['id']][_0xc560('0x1b')]();_0x5bdc9f[_0xc560('0x1c')][_0x166ad4['id']][_0xc560('0x19')]();}}return _0x5bdc9f[_0xc560('0x1c')];};};Realtime[_0xc560('0x12')][_0xc560('0x1d')]=function(){var _0x370e3e=this;return function(_0x2238dc){if(_0x2238dc){freeIsNotKey(_0x2238dc,_0x370e3e[_0xc560('0xb')],'id');for(var _0x22814b=0x0,_0x5704fa={},_0x2a7cab={};_0x22814b<_0x2238dc['length'];_0x22814b+=0x1){_0x5704fa=_0x2238dc[_0x22814b];if(_[_0xc560('0x16')](_0x370e3e[_0xc560('0xb')][_0x5704fa['id']])){_0x370e3e[_0xc560('0xb')][_0x5704fa['id']]=new MailQueue(_0x5704fa);}else{_0x370e3e['mergeFromDatabase'](_0x370e3e[_0xc560('0xb')][_0x5704fa['id']],_0x5704fa);}_0x370e3e[_0xc560('0xb')][_0x5704fa['id']][_0xc560('0x1b')]();_0x370e3e[_0xc560('0xb')][_0x5704fa['id']][_0xc560('0x19')]();}}return _0x370e3e[_0xc560('0xb')];};};Realtime[_0xc560('0x12')][_0xc560('0x1e')]=function(){var _0x3d943c=this;return function(_0x43866b){if(_0x43866b){freeIsNotKey(_0x43866b,_0x3d943c[_0xc560('0x1f')],'id');for(var _0x36597f=0x0,_0x32c1ac={},_0x3fc2df={};_0x36597f<_0x43866b['length'];_0x36597f+=0x1){_0x32c1ac=_0x43866b[_0x36597f];if(_['isUndefined'](_0x3d943c['faxQueues'][_0x32c1ac['id']])){_0x3d943c[_0xc560('0x1f')][_0x32c1ac['id']]=new FaxQueue(_0x32c1ac);}else{_0x3d943c[_0xc560('0x13')](_0x3d943c['faxQueues'][_0x32c1ac['id']],_0x32c1ac);}_0x3d943c[_0xc560('0x1f')][_0x32c1ac['id']][_0xc560('0x1b')]();_0x3d943c[_0xc560('0x1f')][_0x32c1ac['id']][_0xc560('0x19')]();}}return _0x3d943c[_0xc560('0x1f')];};};module[_0xc560('0x20')]=Realtime; \ No newline at end of file +var _0x6088=['exports','bluebird','util','moment','../model/agent','../model/interval','../model/chatQueue','agents','intervals','chatQueues','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','hasOwnProperty','mergeFromDatabase','prototype','initAgents','isUndefined','initIntervals','length','initOpenchannelQueues','openchannelQueues','updateRouting','updateRealtime','initMailQueues','initFaxQueues'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x6088,0x1a5));var _0x8608=function(_0x1dd8e2,_0x494742){_0x1dd8e2=_0x1dd8e2-0x0;var _0x403b93=_0x6088[_0x1dd8e2];return _0x403b93;};'use strict';var BPromise=require(_0x8608('0x0'));var util=require(_0x8608('0x1'));var _=require('lodash');var moment=require(_0x8608('0x2'));var Agent=require(_0x8608('0x3'));var Interval=require(_0x8608('0x4'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x8608('0x5'));var SmsQueue=require('../model/smsQueue');var MailQueue=require('../model/mailQueue');var FaxQueue=require('../model/faxQueue');var Realtime=function(){this[_0x8608('0x6')]={};this[_0x8608('0x7')]={};this['openchannelQueues']={};this[_0x8608('0x8')]={};this[_0x8608('0x9')]={};this[_0x8608('0xa')]={};this[_0x8608('0xb')]={};this[_0x8608('0xc')]={};this[_0x8608('0xd')]={};this[_0x8608('0xe')]={};this[_0x8608('0xf')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x33e43c,_0xad5a60,_0x5755fa){var _0x2685d9=_['mapKeys'](_0x33e43c,function(_0x239085,_0x5ac1cd){return _0x239085[_0x5755fa];});for(var _0x584da5 in _0xad5a60){if(_0xad5a60[_0x8608('0x10')](_0x584da5)){if(!_0x2685d9[_0x584da5]){delete _0xad5a60[_0x584da5];}}}}Realtime['prototype'][_0x8608('0x11')]=function(_0x402581,_0x57305e){for(var _0x3168ab in _0x57305e){if(_0x402581[_0x8608('0x10')](_0x3168ab)){_0x402581[_0x3168ab]=_0x57305e[_0x3168ab];}}};Realtime[_0x8608('0x12')][_0x8608('0x13')]=function(){var _0x1b5516=this;return function(_0x103c79){if(_0x103c79){freeIsNotKey(_0x103c79,_0x1b5516[_0x8608('0x6')],'id');for(var _0x889f12=0x0,_0x47aba9={},_0x3f67a4={};_0x889f12<_0x103c79['length'];_0x889f12+=0x1){_0x47aba9=_0x103c79[_0x889f12];if(_[_0x8608('0x14')](_0x1b5516[_0x8608('0x6')][_0x47aba9['id']])){_0x1b5516[_0x8608('0x6')][_0x47aba9['id']]=new Agent(_0x47aba9);}else{_0x1b5516[_0x8608('0x11')](_0x1b5516[_0x8608('0x6')][_0x47aba9['id']],_0x47aba9);}}}return _0x1b5516[_0x8608('0x6')];};};Realtime[_0x8608('0x12')][_0x8608('0x15')]=function(){var _0x137292=this;return function(_0x350e99){if(_0x350e99){freeIsNotKey(_0x350e99,_0x137292['intervals'],'id');for(var _0x565e5c=0x0,_0x56019b={},_0x4ffd67={};_0x565e5c<_0x350e99[_0x8608('0x16')];_0x565e5c+=0x1){_0x56019b=_0x350e99[_0x565e5c];if(_['isUndefined'](_0x137292['intervals'][_0x56019b['id']])){_0x137292['intervals'][_0x56019b['id']]=new Interval(_0x56019b);}else{_0x137292['mergeFromDatabase'](_0x137292[_0x8608('0x7')][_0x56019b['id']],_0x56019b);}}}return _0x137292[_0x8608('0x7')];};};Realtime['prototype'][_0x8608('0x17')]=function(){var _0x5bfd18=this;return function(_0x2b6660){if(_0x2b6660){freeIsNotKey(_0x2b6660,_0x5bfd18['openchannelQueues'],'id');for(var _0x54e365=0x0,_0x1a533d={},_0x11104f={};_0x54e365<_0x2b6660[_0x8608('0x16')];_0x54e365+=0x1){_0x1a533d=_0x2b6660[_0x54e365];if(_[_0x8608('0x14')](_0x5bfd18[_0x8608('0x18')][_0x1a533d['id']])){_0x5bfd18[_0x8608('0x18')][_0x1a533d['id']]=new OpenchannelQueue(_0x1a533d);}else{_0x5bfd18['mergeFromDatabase'](_0x5bfd18[_0x8608('0x18')][_0x1a533d['id']],_0x1a533d);}_0x5bfd18[_0x8608('0x18')][_0x1a533d['id']][_0x8608('0x19')]();_0x5bfd18['openchannelQueues'][_0x1a533d['id']]['updateRealtime']();}}return _0x5bfd18[_0x8608('0x18')];};};Realtime[_0x8608('0x12')]['initChatQueues']=function(){var _0x14e9e2=this;return function(_0x1f5f7f){if(_0x1f5f7f){freeIsNotKey(_0x1f5f7f,_0x14e9e2['chatQueues'],'id');for(var _0x5f52f0=0x0,_0x1ca201={},_0x1bbe36={};_0x5f52f0<_0x1f5f7f['length'];_0x5f52f0+=0x1){_0x1ca201=_0x1f5f7f[_0x5f52f0];if(_[_0x8608('0x14')](_0x14e9e2['chatQueues'][_0x1ca201['id']])){_0x14e9e2['chatQueues'][_0x1ca201['id']]=new ChatQueue(_0x1ca201);}else{_0x14e9e2['mergeFromDatabase'](_0x14e9e2['chatQueues'][_0x1ca201['id']],_0x1ca201);}_0x14e9e2[_0x8608('0x8')][_0x1ca201['id']]['updateRouting']();_0x14e9e2[_0x8608('0x8')][_0x1ca201['id']][_0x8608('0x1a')]();}}return _0x14e9e2[_0x8608('0x8')];};};Realtime['prototype']['initSmsQueues']=function(){var _0x50f013=this;return function(_0x1a1b01){if(_0x1a1b01){freeIsNotKey(_0x1a1b01,_0x50f013[_0x8608('0x9')],'id');for(var _0x3c1b37=0x0,_0x5ab659={},_0x4163b2={};_0x3c1b37<_0x1a1b01[_0x8608('0x16')];_0x3c1b37+=0x1){_0x5ab659=_0x1a1b01[_0x3c1b37];if(_[_0x8608('0x14')](_0x50f013[_0x8608('0x9')][_0x5ab659['id']])){_0x50f013[_0x8608('0x9')][_0x5ab659['id']]=new SmsQueue(_0x5ab659);}else{_0x50f013[_0x8608('0x11')](_0x50f013[_0x8608('0x9')][_0x5ab659['id']],_0x5ab659);}_0x50f013['smsQueues'][_0x5ab659['id']]['updateRouting']();_0x50f013['smsQueues'][_0x5ab659['id']][_0x8608('0x1a')]();}}return _0x50f013[_0x8608('0x9')];};};Realtime[_0x8608('0x12')][_0x8608('0x1b')]=function(){var _0x4a6c87=this;return function(_0x304bf2){if(_0x304bf2){freeIsNotKey(_0x304bf2,_0x4a6c87[_0x8608('0xa')],'id');for(var _0x543350=0x0,_0x2bdd51={},_0x204de7={};_0x543350<_0x304bf2['length'];_0x543350+=0x1){_0x2bdd51=_0x304bf2[_0x543350];if(_['isUndefined'](_0x4a6c87[_0x8608('0xa')][_0x2bdd51['id']])){_0x4a6c87[_0x8608('0xa')][_0x2bdd51['id']]=new MailQueue(_0x2bdd51);}else{_0x4a6c87[_0x8608('0x11')](_0x4a6c87[_0x8608('0xa')][_0x2bdd51['id']],_0x2bdd51);}_0x4a6c87['mailQueues'][_0x2bdd51['id']][_0x8608('0x19')]();_0x4a6c87[_0x8608('0xa')][_0x2bdd51['id']]['updateRealtime']();}}return _0x4a6c87['mailQueues'];};};Realtime[_0x8608('0x12')][_0x8608('0x1c')]=function(){var _0x4c9587=this;return function(_0x1b013e){if(_0x1b013e){freeIsNotKey(_0x1b013e,_0x4c9587[_0x8608('0xb')],'id');for(var _0x5bb9ef=0x0,_0x700f39={},_0x1e5f59={};_0x5bb9ef<_0x1b013e[_0x8608('0x16')];_0x5bb9ef+=0x1){_0x700f39=_0x1b013e[_0x5bb9ef];if(_['isUndefined'](_0x4c9587['faxQueues'][_0x700f39['id']])){_0x4c9587[_0x8608('0xb')][_0x700f39['id']]=new FaxQueue(_0x700f39);}else{_0x4c9587[_0x8608('0x11')](_0x4c9587['faxQueues'][_0x700f39['id']],_0x700f39);}_0x4c9587[_0x8608('0xb')][_0x700f39['id']][_0x8608('0x19')]();_0x4c9587[_0x8608('0xb')][_0x700f39['id']][_0x8608('0x1a')]();}}return _0x4c9587['faxQueues'];};};module[_0x8608('0x1d')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index accab18..d05602d 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 _0xce43=['Request','addTagsToChatInteraction','../client','update','updateChatInteraction','addTags'];(function(_0x1a1b37,_0xb89a58){var _0x54d402=function(_0x1fb39b){while(--_0x1fb39b){_0x1a1b37['push'](_0x1a1b37['shift']());}};_0x54d402(++_0xb89a58);}(_0xce43,0x1f4));var _0x3ce4=function(_0x2bf1fb,_0x210d1f){_0x2bf1fb=_0x2bf1fb-0x0;var _0x267401=_0xce43[_0x2bf1fb];return _0x267401;};'use strict';var client=require(_0x3ce4('0x0'));exports[_0x3ce4('0x1')]=function(_0x3d3378,_0x456a95){return client['Request']('UpdateChatInteraction',{'body':_0x456a95,'options':{'where':{'id':_0x3d3378}},'log':_0x3ce4('0x2')});};exports[_0x3ce4('0x3')]=function(_0x5bb7f2,_0x5e6b65){return client[_0x3ce4('0x4')]('AddTagsToChatInteraction',{'body':_0x5e6b65,'options':{'where':{'id':_0x5bb7f2}},'log':_0x3ce4('0x5')});}; \ No newline at end of file +var _0xdb13=['AddTagsToChatInteraction','UpdateChatInteraction','updateChatInteraction','addTags','Request'];(function(_0x43342e,_0x146c95){var _0x3dae94=function(_0xd2e96d){while(--_0xd2e96d){_0x43342e['push'](_0x43342e['shift']());}};_0x3dae94(++_0x146c95);}(_0xdb13,0xfb));var _0x3db1=function(_0x337489,_0x457fba){_0x337489=_0x337489-0x0;var _0x3a16dd=_0xdb13[_0x337489];return _0x3a16dd;};'use strict';var client=require('../client');exports['update']=function(_0x33fd47,_0x3b7b70){return client['Request'](_0x3db1('0x0'),{'body':_0x3b7b70,'options':{'where':{'id':_0x33fd47}},'log':_0x3db1('0x1')});};exports[_0x3db1('0x2')]=function(_0x5e06bf,_0x397fa3){return client[_0x3db1('0x3')](_0x3db1('0x4'),{'body':_0x397fa3,'options':{'where':{'id':_0x5e06bf}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 1bb401e..47c2c08 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 _0x7518=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x4eb217,_0x42c9c3){var _0x313838=function(_0xe3c21b){while(--_0xe3c21b){_0x4eb217['push'](_0x4eb217['shift']());}};_0x313838(++_0x42c9c3);}(_0x7518,0x19b));var _0x8751=function(_0x37a0ab,_0x34b900){_0x37a0ab=_0x37a0ab-0x0;var _0x13ca1d=_0x7518[_0x37a0ab];return _0x13ca1d;};'use strict';var client=require(_0x8751('0x0'));exports[_0x8751('0x1')]=function(_0x3ea107){return client[_0x8751('0x2')](_0x8751('0x3'),{'body':_0x3ea107,'log':_0x8751('0x4')});}; \ No newline at end of file +var _0x1d47=['createChatMessage','create','Request','CreateChatMessage'];(function(_0xcd0a5b,_0xc3abcd){var _0x91d9ea=function(_0x376014){while(--_0x376014){_0xcd0a5b['push'](_0xcd0a5b['shift']());}};_0x91d9ea(++_0xc3abcd);}(_0x1d47,0x7d));var _0x71d4=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x1d47[_0x50007c];return _0x5c1ec7;};'use strict';var client=require('../client');exports[_0x71d4('0x0')]=function(_0x395352){return client[_0x71d4('0x1')](_0x71d4('0x2'),{'body':_0x395352,'log':_0x71d4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 9cba9aa..83afd29 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 _0x5d60=['chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy'];(function(_0x5df780,_0x3460c8){var _0x535f5b=function(_0x505237){while(--_0x505237){_0x5df780['push'](_0x5df780['shift']());}};_0x535f5b(++_0x3460c8);}(_0x5d60,0xc9));var _0x05d6=function(_0x5f49c9,_0x447c8d){_0x5f49c9=_0x5f49c9-0x0;var _0x263adc=_0x5d60[_0x5f49c9];return _0x263adc;};'use strict';var client=require(_0x05d6('0x0'));exports[_0x05d6('0x1')]=function(){return function(){return client[_0x05d6('0x2')](_0x05d6('0x3'),{'options':{'raw':![],'attributes':['id',_0x05d6('0x4'),_0x05d6('0x5'),_0x05d6('0x6')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x05d6('0x4'),'online',_0x05d6('0x7')]}]},'log':_0x05d6('0x1')});};}; \ No newline at end of file +var _0x32dd=['strategy','User','Agents','online','../client','getChatQueues','Request','name'];(function(_0x831d52,_0xc99b03){var _0x31a899=function(_0x39f4cb){while(--_0x39f4cb){_0x831d52['push'](_0x831d52['shift']());}};_0x31a899(++_0xc99b03);}(_0x32dd,0xf4));var _0xd32d=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x32dd[_0x138f59];return _0x3d114d;};'use strict';var client=require(_0xd32d('0x0'));exports[_0xd32d('0x1')]=function(){return function(){return client[_0xd32d('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xd32d('0x3'),'timeout',_0xd32d('0x4')],'include':[{'model':_0xd32d('0x5'),'as':_0xd32d('0x6'),'attributes':['id',_0xd32d('0x3'),_0xd32d('0x7'),'chatPause']}]},'log':_0xd32d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 339a320..50a691d 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 _0x12c9=['UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport','update'];(function(_0xb785a,_0x35d03d){var _0x1a1783=function(_0x29106e){while(--_0x29106e){_0xb785a['push'](_0xb785a['shift']());}};_0x1a1783(++_0x35d03d);}(_0x12c9,0x1c9));var _0x912c=function(_0x17b5be,_0x3f7952){_0x17b5be=_0x17b5be-0x0;var _0x517bad=_0x12c9[_0x17b5be];return _0x517bad;};'use strict';var client=require(_0x912c('0x0'));exports[_0x912c('0x1')]=function(_0x7a27c0){return client[_0x912c('0x2')](_0x912c('0x3'),{'body':_0x7a27c0,'log':'CreateChatQueueReport'});};exports[_0x912c('0x4')]=function(_0xcb7adc,_0x2c8059){return client[_0x912c('0x2')](_0x912c('0x5'),{'body':_0x2c8059,'options':{'where':{'uniqueid':_0xcb7adc},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x3645=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','create','Request'];(function(_0x214a25,_0x15071d){var _0x405988=function(_0x5c6fc1){while(--_0x5c6fc1){_0x214a25['push'](_0x214a25['shift']());}};_0x405988(++_0x15071d);}(_0x3645,0x154));var _0x5364=function(_0xec034,_0x16c358){_0xec034=_0xec034-0x0;var _0x2c5a19=_0x3645[_0xec034];return _0x2c5a19;};'use strict';var client=require('../client');exports[_0x5364('0x0')]=function(_0x12217b){return client[_0x5364('0x1')](_0x5364('0x2'),{'body':_0x12217b,'log':_0x5364('0x2')});};exports[_0x5364('0x3')]=function(_0x3c0f77,_0x5a63bf){return client[_0x5364('0x1')](_0x5364('0x4'),{'body':_0x5a63bf,'options':{'where':{'uniqueid':_0x3c0f77},'order':[['id',_0x5364('0x5')]],'limit':0x1},'log':_0x5364('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 5d2b4e2..f8e57c5 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 _0x958a=['addTagsToFaxInteraction','../client','update','Request','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x1ef818,_0x557851){var _0x2b42ba=function(_0x13be63){while(--_0x13be63){_0x1ef818['push'](_0x1ef818['shift']());}};_0x2b42ba(++_0x557851);}(_0x958a,0x1eb));var _0xa958=function(_0x4769b5,_0x536d6f){_0x4769b5=_0x4769b5-0x0;var _0x14afed=_0x958a[_0x4769b5];return _0x14afed;};'use strict';var client=require(_0xa958('0x0'));exports[_0xa958('0x1')]=function(_0x1f5a5e,_0x79af94){return client[_0xa958('0x2')](_0xa958('0x3'),{'body':_0x79af94,'options':{'where':{'id':_0x1f5a5e}},'log':_0xa958('0x4')});};exports[_0xa958('0x5')]=function(_0x13f9fd,_0x5e135a){return client[_0xa958('0x2')]('AddTagsToFaxInteraction',{'body':_0x5e135a,'options':{'where':{'id':_0x13f9fd}},'log':_0xa958('0x6')});}; \ No newline at end of file +var _0xf1b2=['addTags','AddTagsToFaxInteraction','../client','Request','UpdateFaxInteraction','updateFaxInteraction'];(function(_0x793d46,_0x197e26){var _0x444b21=function(_0x5243c8){while(--_0x5243c8){_0x793d46['push'](_0x793d46['shift']());}};_0x444b21(++_0x197e26);}(_0xf1b2,0x1b8));var _0x2f1b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1b2[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x2f1b('0x0'));exports['update']=function(_0xf930a0,_0x5120a1){return client[_0x2f1b('0x1')](_0x2f1b('0x2'),{'body':_0x5120a1,'options':{'where':{'id':_0xf930a0}},'log':_0x2f1b('0x3')});};exports[_0x2f1b('0x4')]=function(_0x1d2f03,_0x364cf8){return client[_0x2f1b('0x1')](_0x2f1b('0x5'),{'body':_0x364cf8,'options':{'where':{'id':_0x1d2f03}},'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 38e159e..4b69209 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 _0x1a3c=['CreateFaxMessage','createFaxMessage','Request'];(function(_0x3975f7,_0x21cee0){var _0x25738e=function(_0x1023c3){while(--_0x1023c3){_0x3975f7['push'](_0x3975f7['shift']());}};_0x25738e(++_0x21cee0);}(_0x1a3c,0xce));var _0xc1a3=function(_0x2e4de7,_0x39cdb8){_0x2e4de7=_0x2e4de7-0x0;var _0x1733c6=_0x1a3c[_0x2e4de7];return _0x1733c6;};'use strict';var client=require('../client');exports['create']=function(_0x33942e){return client[_0xc1a3('0x0')](_0xc1a3('0x1'),{'body':_0x33942e,'log':_0xc1a3('0x2')});}; \ No newline at end of file +var _0x2287=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x88fc75,_0x21a2d9){var _0x31fb64=function(_0x4eaa5a){while(--_0x4eaa5a){_0x88fc75['push'](_0x88fc75['shift']());}};_0x31fb64(++_0x21a2d9);}(_0x2287,0x11e));var _0x7228=function(_0x1123bc,_0x59d257){_0x1123bc=_0x1123bc-0x0;var _0x1f2c27=_0x2287[_0x1123bc];return _0x1f2c27;};'use strict';var client=require(_0x7228('0x0'));exports[_0x7228('0x1')]=function(_0x4bc90c){return client[_0x7228('0x2')](_0x7228('0x3'),{'body':_0x4bc90c,'log':_0x7228('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 9fefaf6..87fcc18 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 _0x9884=['faxPause','../client','Request','GetFaxQueue','name','timeout','strategy','User','Agents','online'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x9884,0x17d));var _0x4988=function(_0x20c64b,_0x40c572){_0x20c64b=_0x20c64b-0x0;var _0x5068ab=_0x9884[_0x20c64b];return _0x5068ab;};'use strict';var client=require(_0x4988('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x4988('0x1')](_0x4988('0x2'),{'options':{'raw':![],'attributes':['id',_0x4988('0x3'),_0x4988('0x4'),_0x4988('0x5')],'include':[{'model':_0x4988('0x6'),'as':_0x4988('0x7'),'attributes':['id',_0x4988('0x3'),_0x4988('0x8'),_0x4988('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x2866=['strategy','User','Agents','../client','getFaxQueues','Request','GetFaxQueue','name','timeout'];(function(_0x1fb6e2,_0x3a22ce){var _0x354690=function(_0x51f968){while(--_0x51f968){_0x1fb6e2['push'](_0x1fb6e2['shift']());}};_0x354690(++_0x3a22ce);}(_0x2866,0xc9));var _0x6286=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x2866[_0x126558];return _0x1f6d14;};'use strict';var client=require(_0x6286('0x0'));exports[_0x6286('0x1')]=function(){return function(){return client[_0x6286('0x2')](_0x6286('0x3'),{'options':{'raw':![],'attributes':['id',_0x6286('0x4'),_0x6286('0x5'),_0x6286('0x6')],'include':[{'model':_0x6286('0x7'),'as':_0x6286('0x8'),'attributes':['id',_0x6286('0x4'),'online','faxPause']}]},'log':_0x6286('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index fcd6423..20413fc 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 _0x5d58=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x1a426e,_0x86f545){var _0x4a1837=function(_0x5a1a19){while(--_0x5a1a19){_0x1a426e['push'](_0x1a426e['shift']());}};_0x4a1837(++_0x86f545);}(_0x5d58,0x173));var _0x85d5=function(_0x156a28,_0x310f87){_0x156a28=_0x156a28-0x0;var _0x509024=_0x5d58[_0x156a28];return _0x509024;};'use strict';var client=require(_0x85d5('0x0'));exports[_0x85d5('0x1')]=function(_0x59e8db){return client[_0x85d5('0x2')]('CreateFaxQueueReport',{'body':_0x59e8db,'log':_0x85d5('0x3')});};exports[_0x85d5('0x4')]=function(_0x2d02aa,_0xf7aefd){return client[_0x85d5('0x2')](_0x85d5('0x5'),{'body':_0xf7aefd,'options':{'where':{'uniqueid':_0x2d02aa},'order':[['id',_0x85d5('0x6')]],'limit':0x1},'log':_0x85d5('0x5')});}; \ No newline at end of file +var _0x3e9d=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x3e9d,0x1ba));var _0xd3e9=function(_0x45c26b,_0x1b5e13){_0x45c26b=_0x45c26b-0x0;var _0x480b37=_0x3e9d[_0x45c26b];return _0x480b37;};'use strict';var client=require(_0xd3e9('0x0'));exports[_0xd3e9('0x1')]=function(_0x506361){return client[_0xd3e9('0x2')](_0xd3e9('0x3'),{'body':_0x506361,'log':_0xd3e9('0x3')});};exports[_0xd3e9('0x4')]=function(_0x5428ef,_0x4887ba){return client[_0xd3e9('0x2')](_0xd3e9('0x5'),{'body':_0x4887ba,'options':{'where':{'uniqueid':_0x5428ef},'order':[['id',_0xd3e9('0x6')]],'limit':0x1},'log':_0xd3e9('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index a394839..ec93766 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 _0x0647=['GetInterval','name','Interval','Intervals','getIntervals','../client','Request'];(function(_0x45e4f8,_0x3551b8){var _0x23cd67=function(_0x5d616a){while(--_0x5d616a){_0x45e4f8['push'](_0x45e4f8['shift']());}};_0x23cd67(++_0x3551b8);}(_0x0647,0xd0));var _0x7064=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0x0647[_0x1d6a82];return _0x5834ac;};'use strict';var client=require(_0x7064('0x0'));exports['getIntervals']=function(){return function(){return client[_0x7064('0x1')](_0x7064('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x7064('0x3')],'include':[{'model':_0x7064('0x4'),'as':_0x7064('0x5'),'attributes':['id','name','interval']}]},'log':_0x7064('0x6')});};}; \ No newline at end of file +var _0x4849=['Intervals','name','interval','../client','getIntervals','Request','Interval'];(function(_0x1b1604,_0x368535){var _0x57918d=function(_0x176c51){while(--_0x176c51){_0x1b1604['push'](_0x1b1604['shift']());}};_0x57918d(++_0x368535);}(_0x4849,0xf8));var _0x9484=function(_0x5769a2,_0x49bf4c){_0x5769a2=_0x5769a2-0x0;var _0x26b713=_0x4849[_0x5769a2];return _0x26b713;};'use strict';var client=require(_0x9484('0x0'));exports[_0x9484('0x1')]=function(){return function(){return client[_0x9484('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x9484('0x3'),'as':_0x9484('0x4'),'attributes':['id',_0x9484('0x5'),_0x9484('0x6')]}]},'log':_0x9484('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index d3ff51c..cd7296a 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 _0x2ad9=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0x2ad9,0x15a));var _0x92ad=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2ad9[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0x92ad('0x0'));exports[_0x92ad('0x1')]=function(_0x1e3bda,_0x25cf73){return client[_0x92ad('0x2')](_0x92ad('0x3'),{'body':_0x25cf73,'options':{'where':{'id':_0x1e3bda}},'log':_0x92ad('0x4')});};exports[_0x92ad('0x5')]=function(_0x8a0edc,_0x48525f){return client['Request'](_0x92ad('0x6'),{'body':_0x48525f,'options':{'where':{'id':_0x8a0edc}},'log':_0x92ad('0x7')});}; \ No newline at end of file +var _0x6374=['../client','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x4ed933,_0x427a88){var _0x3eed3e=function(_0x596939){while(--_0x596939){_0x4ed933['push'](_0x4ed933['shift']());}};_0x3eed3e(++_0x427a88);}(_0x6374,0x173));var _0x4637=function(_0x4b9571,_0x1d3754){_0x4b9571=_0x4b9571-0x0;var _0x430a7a=_0x6374[_0x4b9571];return _0x430a7a;};'use strict';var client=require(_0x4637('0x0'));exports['update']=function(_0x2ee307,_0x53a5d3){return client[_0x4637('0x1')](_0x4637('0x2'),{'body':_0x53a5d3,'options':{'where':{'id':_0x2ee307}},'log':_0x4637('0x3')});};exports[_0x4637('0x4')]=function(_0x48d916,_0x34f26f){return client[_0x4637('0x1')](_0x4637('0x5'),{'body':_0x34f26f,'options':{'where':{'id':_0x48d916}},'log':_0x4637('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 514b982..153089c 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 _0x3002=['create','Request','createMailMessage'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x3002,0x75));var _0x2300=function(_0x7d0fc0,_0x58aa2b){_0x7d0fc0=_0x7d0fc0-0x0;var _0x33407e=_0x3002[_0x7d0fc0];return _0x33407e;};'use strict';var client=require('../client');exports[_0x2300('0x0')]=function(_0x9a4c86){return client[_0x2300('0x1')]('CreateMailMessage',{'body':_0x9a4c86,'log':_0x2300('0x2')});}; \ No newline at end of file +var _0x3dc7=['../client','create','Request','createMailMessage'];(function(_0x3c59fc,_0x10dbd2){var _0x2b78d4=function(_0x5f161a){while(--_0x5f161a){_0x3c59fc['push'](_0x3c59fc['shift']());}};_0x2b78d4(++_0x10dbd2);}(_0x3dc7,0x1ec));var _0x73dc=function(_0x5a7413,_0x152b0a){_0x5a7413=_0x5a7413-0x0;var _0x2bd37a=_0x3dc7[_0x5a7413];return _0x2bd37a;};'use strict';var client=require(_0x73dc('0x0'));exports[_0x73dc('0x1')]=function(_0x194212){return client[_0x73dc('0x2')]('CreateMailMessage',{'body':_0x194212,'log':_0x73dc('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index c8dfb1c..cff5576 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 _0x98a6=['online','mailPause','../client','Request','name','timeout','strategy','User','Agents'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x98a6,0x1d6));var _0x698a=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x98a6[_0x494d1f];return _0x457b6e;};'use strict';var client=require(_0x698a('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x698a('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x698a('0x2'),_0x698a('0x3'),_0x698a('0x4')],'include':[{'model':_0x698a('0x5'),'as':_0x698a('0x6'),'attributes':['id',_0x698a('0x2'),_0x698a('0x7'),_0x698a('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x54d4=['GetMailQueue','timeout','strategy','User','name','mailPause','getMailQueues','Request'];(function(_0x494f4d,_0x2807fa){var _0x3e7dfc=function(_0x14f2d2){while(--_0x14f2d2){_0x494f4d['push'](_0x494f4d['shift']());}};_0x3e7dfc(++_0x2807fa);}(_0x54d4,0x1ee));var _0x454d=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x54d4[_0x31ced5];return _0x10d9e5;};'use strict';var client=require('../client');exports[_0x454d('0x0')]=function(){return function(){return client[_0x454d('0x1')](_0x454d('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x454d('0x3'),_0x454d('0x4')],'include':[{'model':_0x454d('0x5'),'as':'Agents','attributes':['id',_0x454d('0x6'),'online',_0x454d('0x7')]}]},'log':_0x454d('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 705de63..6ca1401 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 _0x1fd9=['CreateMailQueueReport','update','UpdateMailQueueReport','../client','create','Request'];(function(_0x4c0e1b,_0x24ba2b){var _0x4b3df2=function(_0x570335){while(--_0x570335){_0x4c0e1b['push'](_0x4c0e1b['shift']());}};_0x4b3df2(++_0x24ba2b);}(_0x1fd9,0x135));var _0x91fd=function(_0x4b46aa,_0x2bda74){_0x4b46aa=_0x4b46aa-0x0;var _0x273b36=_0x1fd9[_0x4b46aa];return _0x273b36;};'use strict';var client=require(_0x91fd('0x0'));exports[_0x91fd('0x1')]=function(_0x4f3612){return client[_0x91fd('0x2')](_0x91fd('0x3'),{'body':_0x4f3612,'log':_0x91fd('0x3')});};exports[_0x91fd('0x4')]=function(_0x1fb5a8,_0x2bf90b){return client[_0x91fd('0x2')](_0x91fd('0x5'),{'body':_0x2bf90b,'options':{'where':{'uniqueid':_0x1fb5a8},'order':[['id','DESC']],'limit':0x1},'log':_0x91fd('0x5')});}; \ No newline at end of file +var _0x57ae=['create','CreateMailQueueReport','update','Request','UpdateMailQueueReport','DESC','../client'];(function(_0x10fef7,_0x455ae8){var _0x5a4572=function(_0x59f531){while(--_0x59f531){_0x10fef7['push'](_0x10fef7['shift']());}};_0x5a4572(++_0x455ae8);}(_0x57ae,0xb5));var _0xe57a=function(_0x33c53b,_0x4b576f){_0x33c53b=_0x33c53b-0x0;var _0x9f46a0=_0x57ae[_0x33c53b];return _0x9f46a0;};'use strict';var client=require(_0xe57a('0x0'));exports[_0xe57a('0x1')]=function(_0xc322f8){return client['Request'](_0xe57a('0x2'),{'body':_0xc322f8,'log':_0xe57a('0x2')});};exports[_0xe57a('0x3')]=function(_0x326d77,_0x5c1fdb){return client[_0xe57a('0x4')](_0xe57a('0x5'),{'body':_0x5c1fdb,'options':{'where':{'uniqueid':_0x326d77},'order':[['id',_0xe57a('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 26efd20..4f05495 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 _0x13bd=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x3ddec9,_0x209b10){var _0x37e44d=function(_0x2ac034){while(--_0x2ac034){_0x3ddec9['push'](_0x3ddec9['shift']());}};_0x37e44d(++_0x209b10);}(_0x13bd,0x10d));var _0xd13b=function(_0x1c8491,_0x335e02){_0x1c8491=_0x1c8491-0x0;var _0x2a9aae=_0x13bd[_0x1c8491];return _0x2a9aae;};'use strict';var client=require(_0xd13b('0x0'));exports[_0xd13b('0x1')]=function(_0x54558b,_0x1c647f){return client['Request'](_0xd13b('0x2'),{'body':_0x1c647f,'options':{'where':{'id':_0x54558b}},'log':_0xd13b('0x3')});};exports[_0xd13b('0x4')]=function(_0x15c91f,_0x2ef4e1){return client['Request'](_0xd13b('0x5'),{'body':_0x2ef4e1,'options':{'where':{'id':_0x15c91f}},'log':_0xd13b('0x6')});}; \ No newline at end of file +var _0x95e2=['UpdateOpenchannelInteraction','addTags','addTagsToChatInteraction','../client','update'];(function(_0x59bcb1,_0x5a4b6c){var _0x4a737f=function(_0x546a49){while(--_0x546a49){_0x59bcb1['push'](_0x59bcb1['shift']());}};_0x4a737f(++_0x5a4b6c);}(_0x95e2,0xe9));var _0x295e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x95e2[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x295e('0x0'));exports[_0x295e('0x1')]=function(_0x5f3a5c,_0xd9e96f){return client['Request'](_0x295e('0x2'),{'body':_0xd9e96f,'options':{'where':{'id':_0x5f3a5c}},'log':'updateOpenchannelInteraction'});};exports[_0x295e('0x3')]=function(_0x30aacd,_0x1f5cb0){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x1f5cb0,'options':{'where':{'id':_0x30aacd}},'log':_0x295e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 7c9e8b3..3dbf06a 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 _0x153f=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create','Request'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0x153f,0x15b));var _0xf153=function(_0x2a663a,_0x47620c){_0x2a663a=_0x2a663a-0x0;var _0x52572a=_0x153f[_0x2a663a];return _0x52572a;};'use strict';var client=require(_0xf153('0x0'));exports[_0xf153('0x1')]=function(_0xde7eae){return client[_0xf153('0x2')](_0xf153('0x3'),{'body':_0xde7eae,'log':_0xf153('0x4')});}; \ No newline at end of file +var _0xb43b=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x5c46ce,_0x2b21a7){_0x5c46ce=_0x5c46ce-0x0;var _0x43a6f9=_0xb43b[_0x5c46ce];return _0x43a6f9;};'use strict';var client=require(_0xbb43('0x0'));exports[_0xbb43('0x1')]=function(_0x5c45dd){return client[_0xbb43('0x2')](_0xbb43('0x3'),{'body':_0x5c45dd,'log':_0xbb43('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 7bc3576..c937a9c 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 _0xde85=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','User','online','openchannelPause','../client'];(function(_0xfade2d,_0x19816f){var _0x38f8c9=function(_0x265b81){while(--_0x265b81){_0xfade2d['push'](_0xfade2d['shift']());}};_0x38f8c9(++_0x19816f);}(_0xde85,0xcf));var _0x5de8=function(_0x5eb92f,_0x2d108d){_0x5eb92f=_0x5eb92f-0x0;var _0x4352cc=_0xde85[_0x5eb92f];return _0x4352cc;};'use strict';var client=require(_0x5de8('0x0'));exports[_0x5de8('0x1')]=function(){return function(){return client[_0x5de8('0x2')](_0x5de8('0x3'),{'options':{'raw':![],'attributes':['id',_0x5de8('0x4'),'timeout','strategy'],'include':[{'model':_0x5de8('0x5'),'as':'Agents','attributes':['id',_0x5de8('0x4'),_0x5de8('0x6'),_0x5de8('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x76ae=['name','timeout','strategy','User','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0x381662,_0x89ea11){var _0x2f77fb=function(_0x1ab0ac){while(--_0x1ab0ac){_0x381662['push'](_0x381662['shift']());}};_0x2f77fb(++_0x89ea11);}(_0x76ae,0x146));var _0xe76a=function(_0x12d91a,_0xee4df0){_0x12d91a=_0x12d91a-0x0;var _0x2b3eca=_0x76ae[_0x12d91a];return _0x2b3eca;};'use strict';var client=require(_0xe76a('0x0'));exports[_0xe76a('0x1')]=function(){return function(){return client[_0xe76a('0x2')](_0xe76a('0x3'),{'options':{'raw':![],'attributes':['id',_0xe76a('0x4'),_0xe76a('0x5'),_0xe76a('0x6')],'include':[{'model':_0xe76a('0x7'),'as':_0xe76a('0x8'),'attributes':['id',_0xe76a('0x4'),_0xe76a('0x9'),_0xe76a('0xa')]}]},'log':_0xe76a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 0facaf8..28050d4 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 _0x9a62=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','../client'];(function(_0x378202,_0x43fc34){var _0x1235d1=function(_0x12d492){while(--_0x12d492){_0x378202['push'](_0x378202['shift']());}};_0x1235d1(++_0x43fc34);}(_0x9a62,0xdd));var _0x29a6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9a62[_0x42cae2];return _0x5f256f;};'use strict';var client=require(_0x29a6('0x0'));exports[_0x29a6('0x1')]=function(_0x20974a){return client[_0x29a6('0x2')](_0x29a6('0x3'),{'body':_0x20974a,'log':_0x29a6('0x3')});};exports[_0x29a6('0x4')]=function(_0x586bbf,_0x2e1bdf){return client[_0x29a6('0x2')](_0x29a6('0x5'),{'body':_0x2e1bdf,'options':{'where':{'uniqueid':_0x586bbf},'order':[['id','DESC']],'limit':0x1},'log':_0x29a6('0x5')});}; \ No newline at end of file +var _0x4706=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','create','Request'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4706,0x67));var _0x6470=function(_0x4739a4,_0x2fcf34){_0x4739a4=_0x4739a4-0x0;var _0xc64369=_0x4706[_0x4739a4];return _0xc64369;};'use strict';var client=require('../client');exports[_0x6470('0x0')]=function(_0x23c221){return client[_0x6470('0x1')](_0x6470('0x2'),{'body':_0x23c221,'log':_0x6470('0x2')});};exports[_0x6470('0x3')]=function(_0x55434a,_0x3a16a7){return client[_0x6470('0x1')](_0x6470('0x4'),{'body':_0x3a16a7,'options':{'where':{'uniqueid':_0x55434a},'order':[['id','DESC']],'limit':0x1},'log':_0x6470('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index ddc31c4..86e25f7 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 _0xa99d=['Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa99d,0xb3));var _0xda99=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0xa99d[_0x285800];return _0x4b809e;};'use strict';var client=require(_0xda99('0x0'));exports[_0xda99('0x1')]=function(_0x117396,_0x1759df){return client['Request'](_0xda99('0x2'),{'body':_0x1759df,'options':{'where':{'id':_0x117396}},'log':_0xda99('0x3')});};exports[_0xda99('0x4')]=function(_0x1c69e4,_0x41516f){return client[_0xda99('0x5')](_0xda99('0x6'),{'body':_0x41516f,'options':{'where':{'id':_0x1c69e4}},'log':_0xda99('0x7')});}; \ No newline at end of file +var _0xc613=['Request','addTagsToSmsInteraction','../client','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x4f6400,_0x379b1b){var _0x4e447=function(_0x5766a2){while(--_0x5766a2){_0x4f6400['push'](_0x4f6400['shift']());}};_0x4e447(++_0x379b1b);}(_0xc613,0x115));var _0x3c61=function(_0x1aaa99,_0x4701f1){_0x1aaa99=_0x1aaa99-0x0;var _0x1d5c3f=_0xc613[_0x1aaa99];return _0x1d5c3f;};'use strict';var client=require(_0x3c61('0x0'));exports['update']=function(_0x55808c,_0x5cb0b3){return client['Request'](_0x3c61('0x1'),{'body':_0x5cb0b3,'options':{'where':{'id':_0x55808c}},'log':_0x3c61('0x2')});};exports['addTags']=function(_0x197158,_0x55a22a){return client[_0x3c61('0x3')]('AddTagsToSmsInteraction',{'body':_0x55a22a,'options':{'where':{'id':_0x197158}},'log':_0x3c61('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index dfa5df3..0c08936 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 _0xe524=['create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xe524,0x1d8));var _0x4e52=function(_0x589ded,_0x335fd5){_0x589ded=_0x589ded-0x0;var _0x33833d=_0xe524[_0x589ded];return _0x33833d;};'use strict';var client=require('../client');exports[_0x4e52('0x0')]=function(_0x446397){return client[_0x4e52('0x1')](_0x4e52('0x2'),{'body':_0x446397,'log':_0x4e52('0x3')});}; \ No newline at end of file +var _0x97a6=['Request','CreateSmsMessage','createSmsMessage','create'];(function(_0x1de816,_0x16c137){var _0xc2830b=function(_0x57a5cd){while(--_0x57a5cd){_0x1de816['push'](_0x1de816['shift']());}};_0xc2830b(++_0x16c137);}(_0x97a6,0x1b3));var _0x697a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x97a6[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x697a('0x0')]=function(_0x4353ea){return client[_0x697a('0x1')](_0x697a('0x2'),{'body':_0x4353ea,'log':_0x697a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 51f10c6..c8af1b6 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 _0x8323=['strategy','Agents','../client','getSmsQueues','Request','GetSmsQueue','name','timeout'];(function(_0x2f4084,_0x1072ce){var _0x23d1c2=function(_0x4a8742){while(--_0x4a8742){_0x2f4084['push'](_0x2f4084['shift']());}};_0x23d1c2(++_0x1072ce);}(_0x8323,0x1d2));var _0x3832=function(_0x5cdf24,_0x577ca9){_0x5cdf24=_0x5cdf24-0x0;var _0x110428=_0x8323[_0x5cdf24];return _0x110428;};'use strict';var client=require(_0x3832('0x0'));exports[_0x3832('0x1')]=function(){return function(){return client[_0x3832('0x2')](_0x3832('0x3'),{'options':{'raw':![],'attributes':['id',_0x3832('0x4'),_0x3832('0x5'),_0x3832('0x6')],'include':[{'model':'User','as':_0x3832('0x7'),'attributes':['id',_0x3832('0x4'),'online','smsPause']}]},'log':_0x3832('0x1')});};}; \ No newline at end of file +var _0x3912=['../client','Request','GetSmsQueue','name','timeout','strategy','User','Agents','online','smsPause','getSmsQueues'];(function(_0x561816,_0x44ba67){var _0x2d0ab5=function(_0x386ba5){while(--_0x386ba5){_0x561816['push'](_0x561816['shift']());}};_0x2d0ab5(++_0x44ba67);}(_0x3912,0xdc));var _0x2391=function(_0x119f6a,_0x100351){_0x119f6a=_0x119f6a-0x0;var _0x2bdf46=_0x3912[_0x119f6a];return _0x2bdf46;};'use strict';var client=require(_0x2391('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x2391('0x1')](_0x2391('0x2'),{'options':{'raw':![],'attributes':['id',_0x2391('0x3'),_0x2391('0x4'),_0x2391('0x5')],'include':[{'model':_0x2391('0x6'),'as':_0x2391('0x7'),'attributes':['id','name',_0x2391('0x8'),_0x2391('0x9')]}]},'log':_0x2391('0xa')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 1e65b50..2b3a71c 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 _0x78e7=['Request','DESC','UpdateSmsQueueReport','create','CreateSmsQueueReport','update'];(function(_0x635e28,_0x4eecc1){var _0x5bb9dc=function(_0x4e4486){while(--_0x4e4486){_0x635e28['push'](_0x635e28['shift']());}};_0x5bb9dc(++_0x4eecc1);}(_0x78e7,0x17d));var _0x778e=function(_0x1ded57,_0x3ebf55){_0x1ded57=_0x1ded57-0x0;var _0x574cb2=_0x78e7[_0x1ded57];return _0x574cb2;};'use strict';var client=require('../client');exports[_0x778e('0x0')]=function(_0x672756){return client['Request'](_0x778e('0x1'),{'body':_0x672756,'log':'CreateSmsQueueReport'});};exports[_0x778e('0x2')]=function(_0x4894ea,_0x45d4ff){return client[_0x778e('0x3')]('UpdateSmsQueueReport',{'body':_0x45d4ff,'options':{'where':{'uniqueid':_0x4894ea},'order':[['id',_0x778e('0x4')]],'limit':0x1},'log':_0x778e('0x5')});}; \ No newline at end of file +var _0xf188=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x44216d,_0x4938a7){var _0xeca523=function(_0x11faf1){while(--_0x11faf1){_0x44216d['push'](_0x44216d['shift']());}};_0xeca523(++_0x4938a7);}(_0xf188,0x1f1));var _0x8f18=function(_0x5edffd,_0x44096a){_0x5edffd=_0x5edffd-0x0;var _0x42d43a=_0xf188[_0x5edffd];return _0x42d43a;};'use strict';var client=require(_0x8f18('0x0'));exports[_0x8f18('0x1')]=function(_0x4a1ee7){return client['Request'](_0x8f18('0x2'),{'body':_0x4a1ee7,'log':'CreateSmsQueueReport'});};exports[_0x8f18('0x3')]=function(_0x114891,_0x59270e){return client[_0x8f18('0x4')](_0x8f18('0x5'),{'body':_0x59270e,'options':{'where':{'uniqueid':_0x114891},'order':[['id',_0x8f18('0x6')]],'limit':0x1},'log':_0x8f18('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 5e9ae05..64bdf56 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 _0xde33=['name','online','pauseType','lastPauseAt','faxPause','smsPause','openchannelPause','mailCapacity','faxCapacity','smsCapacity','getAgents','Request','GetUser','agent'];(function(_0x2bb3f6,_0x25fde0){var _0x62b339=function(_0x53e014){while(--_0x53e014){_0x2bb3f6['push'](_0x2bb3f6['shift']());}};_0x62b339(++_0x25fde0);}(_0xde33,0xce));var _0x3de3=function(_0x4b3f43,_0x3072af){_0x4b3f43=_0x4b3f43-0x0;var _0x4c1dc3=_0xde33[_0x4b3f43];return _0x4c1dc3;};'use strict';var client=require('../client');exports[_0x3de3('0x0')]=function(){return function(){return client[_0x3de3('0x1')](_0x3de3('0x2'),{'options':{'raw':!![],'where':{'role':_0x3de3('0x3')},'attributes':['id',_0x3de3('0x4'),_0x3de3('0x5'),_0x3de3('0x6'),_0x3de3('0x7'),'voicePause','chatPause','mailPause',_0x3de3('0x8'),_0x3de3('0x9'),_0x3de3('0xa'),'chatCapacity',_0x3de3('0xb'),_0x3de3('0xc'),_0x3de3('0xd'),'openchannelCapacity']},'log':'getAgents'});};}; \ No newline at end of file +var _0x15a8=['name','online','pauseType','lastPauseAt','voicePause','mailPause','faxPause','openchannelPause','chatCapacity','mailCapacity','smsCapacity','openchannelCapacity','../client','getAgents','Request','agent'];(function(_0x169cf7,_0xba0095){var _0x4f1709=function(_0x4c5b63){while(--_0x4c5b63){_0x169cf7['push'](_0x169cf7['shift']());}};_0x4f1709(++_0xba0095);}(_0x15a8,0xbc));var _0x815a=function(_0x90cfe8,_0x2dc132){_0x90cfe8=_0x90cfe8-0x0;var _0x9a0c73=_0x15a8[_0x90cfe8];return _0x9a0c73;};'use strict';var client=require(_0x815a('0x0'));exports[_0x815a('0x1')]=function(){return function(){return client[_0x815a('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x815a('0x3')},'attributes':['id',_0x815a('0x4'),_0x815a('0x5'),_0x815a('0x6'),_0x815a('0x7'),_0x815a('0x8'),'chatPause',_0x815a('0x9'),_0x815a('0xa'),'smsPause',_0x815a('0xb'),_0x815a('0xc'),_0x815a('0xd'),'faxCapacity',_0x815a('0xe'),_0x815a('0xf')]},'log':_0x815a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index c62c65d..f49d8ba 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 _0xa785=['end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','info','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','channel','format','START:%s','rules'];(function(_0x515277,_0xfdb205){var _0x1666ef=function(_0x271cf0){while(--_0x271cf0){_0x515277['push'](_0x515277['shift']());}};_0x1666ef(++_0xfdb205);}(_0xa785,0xea));var _0x5a78=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa785[_0x3054be];return _0x3df150;};'use strict';var schema=require(_0x5a78('0x0'));var _=require(_0x5a78('0x1'));var util=require(_0x5a78('0x2'));var seqqueue=require(_0x5a78('0x3'));var logger=require(_0x5a78('0x4'))(_0x5a78('0x5'));var strategy=require(_0x5a78('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x5a78('0x7')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x45badc,_0x1dca68,_0x78668b){return logger['info'](util['format'](_0x5a78('0x8'),_0x45badc,_0x1dca68[_0x5a78('0x9')],_0x78668b));}function handleFindAgent(_0x25f58b){return function(_0x5c48a2){return _0x5c48a2[_0x5a78('0x9')][_0x5a78('0xa')]()===_0x25f58b['toLowerCase']();};}exports[_0x5a78('0xb')]=function(_0x3be05e,_0x5da4ef,_0x17de3e,_0x51f559){return function(_0x2868d7){try{var _0x2304a4={'name':_0x5da4ef[0x0],'timeout':_0x5da4ef[0x1]};var _0x467271=queue[_0x5a78('0x0')](_0x2304a4,{'typecast':!![]});if(_0x467271['length']){logger['error'](_0x5a78('0xc'),_0x3be05e,_[_0x5a78('0xd')](_0x467271,_0x5a78('0xe'))[_0x5a78('0xf')](',\x20'));_0x2868d7[_0x5a78('0x10')]();}else{var _0x23f8de=_[_0x5a78('0x11')](_0x17de3e[_0x5a78('0x12')],handleFindAgent(_0x2304a4['name']));if(_0x23f8de){var _0x555069=(_0x2304a4[_0x5a78('0x13')]||0xa)*0x3e8;var _0x349bcf,_0x56377c;var _0x210901=seqqueue[_0x5a78('0x14')](_0x555069);_0x210901['id']=_0x3be05e;_0x210901['atimeout']=_0x555069;_0x210901[_0x5a78('0x15')]=_0x51f559[_0x5a78('0x15')];writeLog(_0x3be05e,_0x23f8de,util[_0x5a78('0x16')](_0x5a78('0x17'),_0x555069));_0x17de3e[_0x5a78('0x18')][_0x3be05e]['on'](_0x5a78('0x19'),function(){logger['info'](_0x5a78('0x1a'),_0x3be05e);clearTimeout(_0x56377c);_0x56377c=undefined;_0x210901[_0x5a78('0x1b')]();if(_0x17de3e[_0x5a78('0x18')][_0x3be05e]){delete _0x17de3e[_0x5a78('0x18')][_0x3be05e];}_0x2868d7[_0x5a78('0x10')]();});_0x17de3e[_0x5a78('0x18')][_0x3be05e]['on']('complete',function(){if(_0x17de3e[_0x5a78('0x18')][_0x3be05e]){delete _0x17de3e[_0x5a78('0x18')][_0x3be05e];}});_0x56377c=setTimeout(function(){logger[_0x5a78('0x1c')](_0x5a78('0x1d'),_0x3be05e);clearTimeout(_0x56377c);_0x210901[_0x5a78('0x1b')]();_0x2868d7[_0x5a78('0x1e')]();},_0x555069);strategy[_0x5a78('0x1f')](_0x210901,_0x23f8de,_0x17de3e,_0x51f559);}else{logger[_0x5a78('0x20')](_0x5a78('0x21'),_0x3be05e,_0x2304a4[_0x5a78('0x9')]);_0x2868d7[_0x5a78('0x10')]();}}}catch(_0x303051){console[_0x5a78('0x22')](_0x303051);logger[_0x5a78('0x20')](_0x5a78('0x23'),_0x3be05e,_0x303051[_0x5a78('0x24')]);_0x2868d7['stop']();}};}; \ No newline at end of file +var _0x1182=['stop','find','agents','atimeout','channel','rules','end','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','validate','error','[%s][AGENT]\x20%s','map'];(function(_0x503074,_0x36497f){var _0x1a292c=function(_0x1a8fd3){while(--_0x1a8fd3){_0x503074['push'](_0x503074['shift']());}};_0x1a292c(++_0x36497f);}(_0x1182,0x180));var _0x2118=function(_0x28203e,_0x723dff){_0x28203e=_0x28203e-0x0;var _0x51db1e=_0x1182[_0x28203e];return _0x51db1e;};'use strict';var schema=require('validate');var _=require(_0x2118('0x0'));var util=require(_0x2118('0x1'));var seqqueue=require(_0x2118('0x2'));var logger=require(_0x2118('0x3'))(_0x2118('0x4'));var strategy=require(_0x2118('0x5'));var queue=schema({'name':{'type':_0x2118('0x6'),'required':!![],'message':_0x2118('0x7')},'timeout':{'type':_0x2118('0x8'),'message':_0x2118('0x9')}});function writeLog(_0x511cd9,_0x310362,_0x369110){return logger[_0x2118('0xa')](util[_0x2118('0xb')](_0x2118('0xc'),_0x511cd9,_0x310362[_0x2118('0xd')],_0x369110));}function handleFindAgent(_0x36fd30){return function(_0x4d095f){return _0x4d095f[_0x2118('0xd')][_0x2118('0xe')]()===_0x36fd30[_0x2118('0xe')]();};}exports['consequence']=function(_0x363f57,_0x3e6755,_0x394531,_0x3f3098){return function(_0x4bc69d){try{var _0x2dd072={'name':_0x3e6755[0x0],'timeout':_0x3e6755[0x1]};var _0xb241c7=queue[_0x2118('0xf')](_0x2dd072,{'typecast':!![]});if(_0xb241c7['length']){logger[_0x2118('0x10')](_0x2118('0x11'),_0x363f57,_[_0x2118('0x12')](_0xb241c7,'message')['join'](',\x20'));_0x4bc69d[_0x2118('0x13')]();}else{var _0x381568=_[_0x2118('0x14')](_0x394531[_0x2118('0x15')],handleFindAgent(_0x2dd072[_0x2118('0xd')]));if(_0x381568){var _0x16c81a=(_0x2dd072['timeout']||0xa)*0x3e8;var _0x3a5b0f,_0x581dba;var _0x2dfb62=seqqueue['createQueue'](_0x16c81a);_0x2dfb62['id']=_0x363f57;_0x2dfb62[_0x2118('0x16')]=_0x16c81a;_0x2dfb62[_0x2118('0x17')]=_0x3f3098[_0x2118('0x17')];writeLog(_0x363f57,_0x381568,util['format']('START:%s',_0x16c81a));_0x394531[_0x2118('0x18')][_0x363f57]['on'](_0x2118('0x19'),function(){logger[_0x2118('0xa')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x363f57);clearTimeout(_0x581dba);_0x581dba=undefined;_0x2dfb62['close']();if(_0x394531[_0x2118('0x18')][_0x363f57]){delete _0x394531['rules'][_0x363f57];}_0x4bc69d[_0x2118('0x13')]();});_0x394531[_0x2118('0x18')][_0x363f57]['on'](_0x2118('0x1a'),function(){if(_0x394531[_0x2118('0x18')][_0x363f57]){delete _0x394531[_0x2118('0x18')][_0x363f57];}});_0x581dba=setTimeout(function(){logger[_0x2118('0xa')](_0x2118('0x1b'),_0x363f57);clearTimeout(_0x581dba);_0x2dfb62[_0x2118('0x1c')]();_0x4bc69d[_0x2118('0x1d')]();},_0x16c81a);strategy['agent'](_0x2dfb62,_0x381568,_0x394531,_0x3f3098);}else{logger[_0x2118('0x10')](_0x2118('0x1e'),_0x363f57,_0x2dd072[_0x2118('0xd')]);_0x4bc69d['stop']();}}}catch(_0x11f64d){console['log'](_0x11f64d);logger[_0x2118('0x10')]('[%s][QUEUE]\x20%s',_0x363f57,_0x11f64d['stack']);_0x4bc69d['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 1c86154..686a8bd 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 _0xdd16=['consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','ChatWebsiteId','upperFirst','account','created','body','getMustacheRender','create','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','then','dialogState','Failed','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x4cdf4b,_0x15d9cd){var _0x30d4bc=function(_0x4be368){while(--_0x4be368){_0x4cdf4b['push'](_0x4cdf4b['shift']());}};_0x30d4bc(++_0x15d9cd);}(_0xdd16,0x1e4));var _0x6dd1=function(_0x343f4b,_0x5c67b3){_0x343f4b=_0x343f4b-0x0;var _0x5326f0=_0xdd16[_0x343f4b];return _0x5326f0;};'use strict';var _=require(_0x6dd1('0x0'));var moment=require(_0x6dd1('0x1'));var AWS=require('aws-sdk');var utils=require(_0x6dd1('0x2'));var logger=require(_0x6dd1('0x3'))(_0x6dd1('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6dd1('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6dd1('0x6')),'faxMessage':require(_0x6dd1('0x7'))};exports[_0x6dd1('0x8')]=function(_0x27c812,_0x1ad096){return function(_0x363a8f){try{if(!_[_0x6dd1('0x9')](this[_0x6dd1('0xa')][_0x6dd1('0xb')])){logger[_0x6dd1('0xc')](_0x6dd1('0xd'),_0x27c812,_0x6dd1('0xe'));return _0x363a8f[_0x6dd1('0xf')]();}var _0x53671e={'ContactId':this[_0x6dd1('0x10')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x6dd1('0x11')};var _0x1473e7=this[_0x6dd1('0x12')];if(_0x1473e7==='chat'){_0x53671e[_0x6dd1('0x13')]=this['account']['id'];}else{_0x53671e[_[_0x6dd1('0x14')](_0x1473e7)+'AccountId']=this[_0x6dd1('0x15')]['id'];}_0x53671e[_[_0x6dd1('0x14')](_0x1473e7)+'InteractionId']=this[_0x6dd1('0xa')]['id'];if(this[_0x6dd1('0xa')][_0x6dd1('0x16')]){var _0x1f1765=_0x1ad096[0x4];if(!_['isEmpty'](_0x1f1765)){_0x53671e[_0x6dd1('0x17')]=utils[_0x6dd1('0x18')](_0x1f1765,this);return rpc[_0x1473e7+'Message'][_0x6dd1('0x19')](_0x53671e)['then'](function(_0x2f1592){logger[_0x6dd1('0xc')]('[%s][AMAZONLEX]\x20%s',_0x27c812,_0x53671e[_0x6dd1('0x17')]);})[_0x6dd1('0x1a')](function(_0x2aaf18){logger[_0x6dd1('0x1b')]('[%s][AMAZONLEX]\x20%s',_0x27c812,JSON[_0x6dd1('0x1c')](_0x2aaf18));})['finally'](function(){logger[_0x6dd1('0xc')](_0x6dd1('0x1d'),_0x27c812);_0x363a8f[_0x6dd1('0x1e')]();});}else{logger['info'](_0x6dd1('0x1f'),_0x27c812);_0x363a8f[_0x6dd1('0x1e')]();}}else{var _0x138c73=this;var _0x57242d=new AWS[(_0x6dd1('0x20'))]({'accessKeyId':_0x1ad096[0x0],'secretAccessKey':_0x1ad096[0x1],'region':_0x1ad096[0x2]});var _0x5582b2={'botAlias':_0x6dd1('0x21'),'botName':_0x1ad096[0x3],'inputText':this[_0x6dd1('0x22')][_0x6dd1('0x17')],'userId':this[_0x6dd1('0xa')]['id'][_0x6dd1('0x23')]()};_0x57242d[_0x6dd1('0x24')](_0x5582b2,function(_0x338dff,_0x4d55e8){if(_0x338dff){logger[_0x6dd1('0x1b')](_0x6dd1('0xd'),_0x27c812,_0x338dff[_0x6dd1('0x22')]);_0x363a8f[_0x6dd1('0xf')]();}else if(_0x4d55e8&&_0x4d55e8[_0x6dd1('0x22')]){_0x138c73[_0x6dd1('0x17')][_0x6dd1('0x25')]=_0x4d55e8;_0x53671e['body']=_0x4d55e8['message'];return rpc[_0x1473e7+'Message'][_0x6dd1('0x19')](_0x53671e)[_0x6dd1('0x26')](function(_0x3cdba9){logger[_0x6dd1('0xc')](_0x6dd1('0xd'),_0x27c812,_0x53671e[_0x6dd1('0x17')]);if(_0x4d55e8[_0x6dd1('0x27')]==_0x6dd1('0x28')){_0x363a8f[_0x6dd1('0xf')]();}else{_0x363a8f[_0x6dd1('0x1e')]();}})[_0x6dd1('0x1a')](function(_0x34e37b){logger[_0x6dd1('0x1b')](_0x6dd1('0xd'),_0x27c812,JSON['stringify'](_0x34e37b));_0x363a8f['next']();});}else{_0x363a8f[_0x6dd1('0xf')]();}});}}catch(_0x4a50b8){logger[_0x6dd1('0x1b')]('[%s][AMAZONLEX]\x20%s',_0x27c812,JSON['stringify'](_0x4a50b8));_0x363a8f[_0x6dd1('0x1e')]();}};}; \ No newline at end of file +var _0xf110=['contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','Message','create','then','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','postText','error','amazonlex','body','dialogState','Failed','lodash','moment','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next'];(function(_0x3f8639,_0xc7e25c){var _0x4ac80c=function(_0x4766ed){while(--_0x4766ed){_0x3f8639['push'](_0x3f8639['shift']());}};_0x4ac80c(++_0xc7e25c);}(_0xf110,0x1d6));var _0x0f11=function(_0x5f2327,_0x123bcd){_0x5f2327=_0x5f2327-0x0;var _0x304698=_0xf110[_0x5f2327];return _0x304698;};'use strict';var _=require(_0x0f11('0x0'));var moment=require(_0x0f11('0x1'));var AWS=require('aws-sdk');var utils=require(_0x0f11('0x2'));var logger=require(_0x0f11('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x0f11('0x4')),'mailMessage':require(_0x0f11('0x5')),'smsMessage':require(_0x0f11('0x6')),'faxMessage':require(_0x0f11('0x7'))};exports['consequence']=function(_0x5b0312,_0x46d685){return function(_0x4415cf){try{if(!_['isNil'](this[_0x0f11('0x8')][_0x0f11('0x9')])){logger[_0x0f11('0xa')](_0x0f11('0xb'),_0x5b0312,_0x0f11('0xc'));return _0x4415cf[_0x0f11('0xd')]();}var _0x4b21f3={'ContactId':this[_0x0f11('0xe')]['id'],'sentAt':moment()[_0x0f11('0xf')](_0x0f11('0x10')),'direction':'out'};var _0x32f612=this[_0x0f11('0x11')];if(_0x32f612===_0x0f11('0x12')){_0x4b21f3[_0x0f11('0x13')]=this[_0x0f11('0x14')]['id'];}else{_0x4b21f3[_[_0x0f11('0x15')](_0x32f612)+_0x0f11('0x16')]=this['account']['id'];}_0x4b21f3[_[_0x0f11('0x15')](_0x32f612)+_0x0f11('0x17')]=this['interaction']['id'];if(this[_0x0f11('0x8')][_0x0f11('0x18')]){var _0x389291=_0x46d685[0x4];if(!_[_0x0f11('0x19')](_0x389291)){_0x4b21f3['body']=utils['getMustacheRender'](_0x389291,this);return rpc[_0x32f612+_0x0f11('0x1a')][_0x0f11('0x1b')](_0x4b21f3)[_0x0f11('0x1c')](function(_0x1e6f45){logger[_0x0f11('0xa')](_0x0f11('0xb'),_0x5b0312,_0x4b21f3['body']);})[_0x0f11('0x1d')](function(_0x115875){logger['error'](_0x0f11('0xb'),_0x5b0312,JSON[_0x0f11('0x1e')](_0x115875));})[_0x0f11('0x1f')](function(){logger[_0x0f11('0xa')](_0x0f11('0x20'),_0x5b0312);_0x4415cf[_0x0f11('0x21')]();});}else{logger[_0x0f11('0xa')](_0x0f11('0x22'),_0x5b0312);_0x4415cf[_0x0f11('0x21')]();}}else{var _0x38a400=this;var _0x26a7d1=new AWS[(_0x0f11('0x23'))]({'accessKeyId':_0x46d685[0x0],'secretAccessKey':_0x46d685[0x1],'region':_0x46d685[0x2]});var _0x510981={'botAlias':_0x0f11('0x24'),'botName':_0x46d685[0x3],'inputText':this[_0x0f11('0x25')]['body'],'userId':this[_0x0f11('0x8')]['id']['toString']()};_0x26a7d1[_0x0f11('0x26')](_0x510981,function(_0x858d5a,_0x4dc97d){if(_0x858d5a){logger[_0x0f11('0x27')](_0x0f11('0xb'),_0x5b0312,_0x858d5a['message']);_0x4415cf[_0x0f11('0xd')]();}else if(_0x4dc97d&&_0x4dc97d[_0x0f11('0x25')]){_0x38a400['body'][_0x0f11('0x28')]=_0x4dc97d;_0x4b21f3[_0x0f11('0x29')]=_0x4dc97d['message'];return rpc[_0x32f612+'Message'][_0x0f11('0x1b')](_0x4b21f3)[_0x0f11('0x1c')](function(_0x4f7009){logger[_0x0f11('0xa')]('[%s][AMAZONLEX]\x20%s',_0x5b0312,_0x4b21f3[_0x0f11('0x29')]);if(_0x4dc97d[_0x0f11('0x2a')]==_0x0f11('0x2b')){_0x4415cf[_0x0f11('0xd')]();}else{_0x4415cf[_0x0f11('0x21')]();}})[_0x0f11('0x1d')](function(_0x125b15){logger[_0x0f11('0x27')](_0x0f11('0xb'),_0x5b0312,JSON[_0x0f11('0x1e')](_0x125b15));_0x4415cf[_0x0f11('0xd')]();});}else{_0x4415cf[_0x0f11('0xd')]();}});}}catch(_0x3b0ea5){logger['error']('[%s][AMAZONLEX]\x20%s',_0x5b0312,JSON[_0x0f11('0x1e')](_0x3b0ea5));_0x4415cf['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 b96381f..3d0de02 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 _0xa9e0=['messageId','html','replace','body',''+_[_0x0a9e('0x29')](_0xbd1168[_0x0a9e('0x2a')],_0x0a9e('0x2b'),_0x0a9e('0x2c'))+'';return mailRpc[_0x0a9e('0x2d')](_0x20f109,_0xbd1168)[_0x0a9e('0x2e')](function(_0x1843b2){logger[_0x0a9e('0x2f')](_0x0a9e('0x30'),_0x57b080);_0xbd1168[_0x0a9e('0x27')]=_0x1843b2[_0x0a9e('0x10')][_0x0a9e('0x27')];return rpc[_0x3ab53f+_0x0a9e('0x1d')]['create'](_0xbd1168);})[_0x0a9e('0x2e')](function(_0x5d1e0e){logger[_0x0a9e('0x2f')](_0x0a9e('0xb'),_0x57b080,JSON[_0x0a9e('0x31')](_0x5d1e0e));})[_0x0a9e('0x32')](function(_0x25ce3a){logger['error'](_0x0a9e('0x33'),_0x57b080,JSON[_0x0a9e('0x31')](_0x25ce3a));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}else{return rpc[this[_0x0a9e('0xe')]+_0x0a9e('0x1d')][_0x0a9e('0x35')](_0xbd1168)[_0x0a9e('0x2e')](function(_0x5583a4){logger[_0x0a9e('0x2f')]('[%s][AUTOREPLY]\x20%s',_0x57b080,_0xbd1168[_0x0a9e('0x2a')]);})[_0x0a9e('0x32')](function(_0x2b7e7f){logger[_0x0a9e('0x36')]('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x2b7e7f));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}}}catch(_0x15de0e){logger['error']('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x15de0e));_0x441e3a['stop']();}};}; \ No newline at end of file +var _0xcb91=['consequence','interaction','created','Autoreply\x20already\x20sent','next','channel','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','Re:','Re:\x20','account','upperFirst','AccountId','mail','Smtp','service','port','secure','authentication','auth','user','pass','inReplyTo','messageId','','body','','then','info','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','[%s][AUTOREPLY]\x20%s','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','Message','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc'];(function(_0x1679cc,_0x242c53){var _0x4aaec8=function(_0x303c5f){while(--_0x303c5f){_0x1679cc['push'](_0x1679cc['shift']());}};_0x4aaec8(++_0x242c53);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3dea7d,_0x2cd4ea){_0x3dea7d=_0x3dea7d-0x0;var _0x53919a=_0xcb91[_0x3dea7d];return _0x53919a;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x1cb9('0x0'));var logger=require(_0x1cb9('0x1'))(_0x1cb9('0x2'));var rpc={'chatMessage':require(_0x1cb9('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1cb9('0x4')),'smsMessage':require(_0x1cb9('0x5')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x1cb9('0x6'));exports[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return function(_0x3f7deb){try{if(_0x226b69[0x0]==='1'&&(_['isNil'](this[_0x1cb9('0x8')][_0x1cb9('0x9')])||!this['interaction'][_0x1cb9('0x9')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x53ffbd,_0x1cb9('0xa'));return _0x3f7deb[_0x1cb9('0xb')]();}var _0x74ce19=this[_0x1cb9('0xc')];var _0x2fc627={'body':utils['getMustacheRender'](_0x226b69[0x1],this),'ContactId':this[_0x1cb9('0xd')]['id'],'sentAt':moment()[_0x1cb9('0xe')](_0x1cb9('0xf')),'direction':_0x1cb9('0x10')};if(this[_0x1cb9('0x11')]){_0x2fc627['to']=this['message']['from']||'';_0x2fc627['cc']=this['message']['cc']||'';_0x2fc627[_0x1cb9('0x12')]=this[_0x1cb9('0x11')]['to']||'';_0x2fc627[_0x1cb9('0x13')]=this[_0x1cb9('0x11')]['phone']||'';_0x2fc627[_0x1cb9('0x14')]=!![];if(this[_0x1cb9('0x11')][_0x1cb9('0x15')]){_0x2fc627[_0x1cb9('0x15')]='';_0x2fc627[_0x1cb9('0x15')]+=_['startsWith'](this['message'][_0x1cb9('0x15')],_0x1cb9('0x16'))?'':_0x1cb9('0x17');_0x2fc627[_0x1cb9('0x15')]+=this[_0x1cb9('0x11')][_0x1cb9('0x15')];}}if(this[_0x1cb9('0xc')]==='chat'){_0x2fc627['ChatWebsiteId']=this[_0x1cb9('0x18')]['id'];}else{_0x2fc627[_[_0x1cb9('0x19')](this[_0x1cb9('0xc')])+_0x1cb9('0x1a')]=this[_0x1cb9('0x18')]['id'];}_0x2fc627[_[_0x1cb9('0x19')](this[_0x1cb9('0xc')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x1cb9('0xc')]+'Message']){if(this[_0x1cb9('0xc')]===_0x1cb9('0x1b')){var _0x523b26={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x1cb9('0x1c')][_0x1cb9('0x1d')]){_0x523b26[_0x1cb9('0x1d')]=this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x1d')];}else{_0x523b26['host']=this['account'][_0x1cb9('0x1c')]['host'];_0x523b26[_0x1cb9('0x1e')]=this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x1e')];_0x523b26[_0x1cb9('0x1f')]=this['account'][_0x1cb9('0x1c')][_0x1cb9('0x1f')];}if(this['account'][_0x1cb9('0x1c')][_0x1cb9('0x20')]){_0x523b26[_0x1cb9('0x21')]={'user':this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x22')],'pass':this[_0x1cb9('0x18')][_0x1cb9('0x1c')][_0x1cb9('0x23')]};}_0x2fc627[_0x1cb9('0x24')]=this['message'][_0x1cb9('0x25')];_0x2fc627['html']=_0x1cb9('0x26')+_['replace'](_0x2fc627[_0x1cb9('0x27')],_0x1cb9('0x28'),_0x1cb9('0x29'))+_0x1cb9('0x2a');return mailRpc['sendMailMessage'](_0x523b26,_0x2fc627)[_0x1cb9('0x2b')](function(_0x4eba82){logger[_0x1cb9('0x2c')](_0x1cb9('0x2d'),_0x53ffbd);_0x2fc627[_0x1cb9('0x25')]=_0x4eba82['message'][_0x1cb9('0x25')];return rpc[_0x74ce19+'Message'][_0x1cb9('0x2e')](_0x2fc627);})['then'](function(_0x2164e3){logger[_0x1cb9('0x2c')](_0x1cb9('0x2f'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x2164e3));})['catch'](function(_0x2114a4){logger[_0x1cb9('0x31')](_0x1cb9('0x32'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x2114a4));})[_0x1cb9('0x33')](function(){_0x3f7deb[_0x1cb9('0xb')]();});}else{return rpc[this[_0x1cb9('0xc')]+_0x1cb9('0x34')][_0x1cb9('0x2e')](_0x2fc627)[_0x1cb9('0x2b')](function(_0x294eec){logger[_0x1cb9('0x2c')](_0x1cb9('0x2f'),_0x53ffbd,_0x2fc627['body']);})['catch'](function(_0x299ff8){logger[_0x1cb9('0x31')](_0x1cb9('0x2f'),_0x53ffbd,JSON[_0x1cb9('0x30')](_0x299ff8));})[_0x1cb9('0x33')](function(){_0x3f7deb[_0x1cb9('0xb')]();});}}}catch(_0x35f5e8){logger[_0x1cb9('0x31')]('[%s][AUTOREPLY]\x20%s',_0x53ffbd,JSON[_0x1cb9('0x30')](_0x35f5e8));_0x3f7deb[_0x1cb9('0x35')]();}};}; \ 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 d2d7047..bcc071c 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 _0xb6da=['[%s][CLOSE]\x20%s','stringify','finally','stop','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xb6da,0x8e));var _0xab6d=function(_0x5ec63f,_0x3bb111){_0x5ec63f=_0x5ec63f-0x0;var _0x1864a8=_0xb6da[_0x5ec63f];return _0x1864a8;};'use strict';var moment=require(_0xab6d('0x0'));var logger=require('../../../../config/logger')(_0xab6d('0x1'));var rpc={'chatInteraction':require(_0xab6d('0x2')),'openchannelInteraction':require(_0xab6d('0x3')),'smsInteraction':require(_0xab6d('0x4')),'mailInteraction':require(_0xab6d('0x5')),'faxInteraction':require(_0xab6d('0x6'))};exports[_0xab6d('0x7')]=function(_0x5a8924,_0x51e548,_0x8aa817,_0x3a2120){return function(_0xdd37b4){try{logger[_0xab6d('0x8')](_0xab6d('0x9'),_0x5a8924,_0x51e548[0x0]);var _0x44d5fa={'closed':0x1,'closedAt':moment()['format'](_0xab6d('0xa')),'closeReason':'system','disposition':_0x51e548[0x0]};if(rpc[_0x3a2120[_0xab6d('0xb')]+'Interaction']){rpc[_0x3a2120['channel']+_0xab6d('0xc')][_0xab6d('0xd')](_0x3a2120['interaction']['id'],_0x44d5fa)[_0xab6d('0xe')](function(_0x4c1292){logger['info'](_0xab6d('0xf'),_0x5a8924,_0x3a2120[_0xab6d('0x10')]['id']);})[_0xab6d('0x11')](function(_0x35dca1){logger[_0xab6d('0x12')](_0xab6d('0x13'),_0x5a8924,JSON[_0xab6d('0x14')](_0x35dca1));})[_0xab6d('0x15')](function(){_0xdd37b4['stop']();});}}catch(_0x288a8a){logger[_0xab6d('0x12')](_0xab6d('0x13'),_0x5a8924,JSON[_0xab6d('0x14')](_0x288a8a));_0xdd37b4[_0xab6d('0x16')]();}};}; \ No newline at end of file +var _0x0fd9=['consequence','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','channel','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/faxInteraction'];(function(_0x3074e4,_0x2959ed){var _0xc005be=function(_0x282bac){while(--_0x282bac){_0x3074e4['push'](_0x3074e4['shift']());}};_0xc005be(++_0x2959ed);}(_0x0fd9,0xa3));var _0x90fd=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0x0fd9[_0x277721];return _0x286051;};'use strict';var moment=require('moment');var logger=require(_0x90fd('0x0'))(_0x90fd('0x1'));var rpc={'chatInteraction':require(_0x90fd('0x2')),'openchannelInteraction':require(_0x90fd('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x90fd('0x4'))};exports[_0x90fd('0x5')]=function(_0xb7cf6,_0x37a8be,_0x254547,_0x23e11b){return function(_0x5e2107){try{logger['info'](_0x90fd('0x6'),_0xb7cf6,_0x37a8be[0x0]);var _0x50c778={'closed':0x1,'closedAt':moment()['format'](_0x90fd('0x7')),'closeReason':_0x90fd('0x8'),'disposition':_0x37a8be[0x0]};if(rpc[_0x23e11b['channel']+_0x90fd('0x9')]){rpc[_0x23e11b[_0x90fd('0xa')]+_0x90fd('0x9')][_0x90fd('0xb')](_0x23e11b[_0x90fd('0xc')]['id'],_0x50c778)[_0x90fd('0xd')](function(_0x2aae77){logger[_0x90fd('0xe')](_0x90fd('0xf'),_0xb7cf6,_0x23e11b['interaction']['id']);})[_0x90fd('0x10')](function(_0x328c1b){logger['error'](_0x90fd('0x11'),_0xb7cf6,JSON[_0x90fd('0x12')](_0x328c1b));})[_0x90fd('0x13')](function(){_0x5e2107['stop']();});}}catch(_0x268396){logger['error'](_0x90fd('0x11'),_0xb7cf6,JSON[_0x90fd('0x12')](_0x268396));_0x5e2107[_0x90fd('0x14')]();}};}; \ 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 0320c67..084c2eb 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 _0x7cb2=['created','isEmpty','Message','create','then','body','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','message','fulfillment','speech','result','metadata','endConversation','next','lodash','moment','apiai-promise','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','YYYY-MM-DD\x20HH:mm:ss','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId'];(function(_0x486895,_0x16f598){var _0x41e0c9=function(_0x15e9d2){while(--_0x15e9d2){_0x486895['push'](_0x486895['shift']());}};_0x41e0c9(++_0x16f598);}(_0x7cb2,0x141));var _0x27cb=function(_0x5cb8ff,_0x71dda0){_0x5cb8ff=_0x5cb8ff-0x0;var _0x399fe4=_0x7cb2[_0x5cb8ff];return _0x399fe4;};'use strict';var _=require(_0x27cb('0x0'));var moment=require(_0x27cb('0x1'));var apiai=require(_0x27cb('0x2'));var md5=require('md5');var utils=require(_0x27cb('0x3'));var logger=require(_0x27cb('0x4'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x27cb('0x5')),'mailMessage':require(_0x27cb('0x6')),'smsMessage':require(_0x27cb('0x7')),'faxMessage':require(_0x27cb('0x8'))};exports[_0x27cb('0x9')]=function(_0x1027a0,_0x455b5d){return function(_0x13f232){try{if(!_[_0x27cb('0xa')](this[_0x27cb('0xb')][_0x27cb('0xc')])){logger[_0x27cb('0xd')](_0x27cb('0xe'),_0x1027a0,_0x27cb('0xf'));return _0x13f232['next']();}var _0x5522fd={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x27cb('0x10')),'direction':'out'};var _0x528d09=this[_0x27cb('0x11')];if(_0x528d09==='chat'){_0x5522fd[_0x27cb('0x12')]=this[_0x27cb('0x13')]['id'];}else{_0x5522fd[_[_0x27cb('0x14')](_0x528d09)+_0x27cb('0x15')]=this[_0x27cb('0x13')]['id'];}_0x5522fd[_[_0x27cb('0x14')](_0x528d09)+_0x27cb('0x16')]=this['interaction']['id'];if(this[_0x27cb('0xb')][_0x27cb('0x17')]){var _0xee42fa=_0x455b5d[0x2];if(!_[_0x27cb('0x18')](_0xee42fa)){_0x5522fd['body']=utils['getMustacheRender'](_0xee42fa,this);return rpc[_0x528d09+_0x27cb('0x19')][_0x27cb('0x1a')](_0x5522fd)[_0x27cb('0x1b')](function(_0x9a1b94){logger['info'](_0x27cb('0xe'),_0x1027a0,_0x5522fd[_0x27cb('0x1c')]);})[_0x27cb('0x1d')](function(_0xfee823){logger[_0x27cb('0x1e')](_0x27cb('0xe'),_0x1027a0,JSON[_0x27cb('0x1f')](_0xfee823));})[_0x27cb('0x20')](function(){logger[_0x27cb('0xd')](_0x27cb('0x21'),_0x1027a0);_0x13f232['stop']();});}else{logger[_0x27cb('0xd')](_0x27cb('0x22'),_0x1027a0);_0x13f232[_0x27cb('0x23')]();}}else{var _0x2fc4fc=this;var _0xca0dc9=apiai(_0x455b5d[0x0],{'language':_0x455b5d[0x1]||'en'});return _0xca0dc9['textRequest'](this[_0x27cb('0x24')][_0x27cb('0x1c')],{'sessionId':md5(this[_0x27cb('0xb')]['id'])})[_0x27cb('0x1b')](function(_0x481e6e){_0x2fc4fc[_0x27cb('0x1c')]['dialogflow']=_0x481e6e;_0x5522fd['body']=_0x481e6e['result'][_0x27cb('0x25')][_0x27cb('0x26')];return rpc[_0x528d09+_0x27cb('0x19')][_0x27cb('0x1a')](_0x5522fd)[_0x27cb('0x1b')](function(_0x5c7714){logger[_0x27cb('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x1027a0,_0x5522fd[_0x27cb('0x1c')]);if(_0x481e6e[_0x27cb('0x27')][_0x27cb('0x28')][_0x27cb('0x29')]){_0x13f232[_0x27cb('0x2a')]();}else{_0x13f232[_0x27cb('0x23')]();}})[_0x27cb('0x1d')](function(_0x59c7e0){logger[_0x27cb('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x1027a0,JSON[_0x27cb('0x1f')](_0x59c7e0));_0x13f232[_0x27cb('0x2a')]();});})[_0x27cb('0x1d')](function(_0x554952){logger['error'](_0x27cb('0xe'),_0x1027a0,_0x554952['message']);_0x13f232['next']();});}}catch(_0x4f9ee1){logger[_0x27cb('0x1e')](_0x27cb('0xe'),_0x1027a0,JSON[_0x27cb('0x1f')](_0x4f9ee1));_0x13f232[_0x27cb('0x23')]();}};}; \ No newline at end of file +var _0xca9d=['moment','md5','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','upperFirst','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','catch','error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','then','dialogflow','result','fulfillment','speech','metadata','endConversation','lodash'];(function(_0x3f3bad,_0x193f06){var _0x4f0801=function(_0x5cfd32){while(--_0x5cfd32){_0x3f3bad['push'](_0x3f3bad['shift']());}};_0x4f0801(++_0x193f06);}(_0xca9d,0x1c1));var _0xdca9=function(_0x56f497,_0x16e588){_0x56f497=_0x56f497-0x0;var _0x4cab92=_0xca9d[_0x56f497];return _0x4cab92;};'use strict';var _=require(_0xdca9('0x0'));var moment=require(_0xdca9('0x1'));var apiai=require('apiai-promise');var md5=require(_0xdca9('0x2'));var utils=require('./utils');var logger=require(_0xdca9('0x3'))(_0xdca9('0x4'));var rpc={'chatMessage':require(_0xdca9('0x5')),'openchannelMessage':require(_0xdca9('0x6')),'mailMessage':require(_0xdca9('0x7')),'smsMessage':require(_0xdca9('0x8')),'faxMessage':require(_0xdca9('0x9'))};exports[_0xdca9('0xa')]=function(_0x2e5513,_0x4770d2){return function(_0x304ea1){try{if(!_[_0xdca9('0xb')](this[_0xdca9('0xc')][_0xdca9('0xd')])){logger[_0xdca9('0xe')](_0xdca9('0xf'),_0x2e5513,_0xdca9('0x10'));return _0x304ea1[_0xdca9('0x11')]();}var _0x4599c1={'ContactId':this[_0xdca9('0x12')]['id'],'sentAt':moment()[_0xdca9('0x13')](_0xdca9('0x14')),'direction':_0xdca9('0x15')};var _0x1c8d61=this[_0xdca9('0x16')];if(_0x1c8d61==='chat'){_0x4599c1['ChatWebsiteId']=this['account']['id'];}else{_0x4599c1[_[_0xdca9('0x17')](_0x1c8d61)+'AccountId']=this[_0xdca9('0x18')]['id'];}_0x4599c1[_[_0xdca9('0x17')](_0x1c8d61)+_0xdca9('0x19')]=this[_0xdca9('0xc')]['id'];if(this[_0xdca9('0xc')][_0xdca9('0x1a')]){var _0x6edca6=_0x4770d2[0x2];if(!_[_0xdca9('0x1b')](_0x6edca6)){_0x4599c1[_0xdca9('0x1c')]=utils[_0xdca9('0x1d')](_0x6edca6,this);return rpc[_0x1c8d61+_0xdca9('0x1e')][_0xdca9('0x1f')](_0x4599c1)['then'](function(_0x13d60d){logger[_0xdca9('0xe')](_0xdca9('0xf'),_0x2e5513,_0x4599c1['body']);})[_0xdca9('0x20')](function(_0x4ee5e2){logger[_0xdca9('0x21')](_0xdca9('0xf'),_0x2e5513,JSON[_0xdca9('0x22')](_0x4ee5e2));})['finally'](function(){logger['info'](_0xdca9('0x23'),_0x2e5513);_0x304ea1[_0xdca9('0x24')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2e5513);_0x304ea1[_0xdca9('0x24')]();}}else{var _0xd38804=this;var _0x2e8e63=apiai(_0x4770d2[0x0],{'language':_0x4770d2[0x1]||'en'});return _0x2e8e63['textRequest'](this[_0xdca9('0x25')][_0xdca9('0x1c')],{'sessionId':md5(this['interaction']['id'])})[_0xdca9('0x26')](function(_0x431726){_0xd38804[_0xdca9('0x1c')][_0xdca9('0x27')]=_0x431726;_0x4599c1['body']=_0x431726[_0xdca9('0x28')][_0xdca9('0x29')][_0xdca9('0x2a')];return rpc[_0x1c8d61+'Message']['create'](_0x4599c1)[_0xdca9('0x26')](function(_0x17cd79){logger[_0xdca9('0xe')](_0xdca9('0xf'),_0x2e5513,_0x4599c1[_0xdca9('0x1c')]);if(_0x431726[_0xdca9('0x28')][_0xdca9('0x2b')][_0xdca9('0x2c')]){_0x304ea1[_0xdca9('0x11')]();}else{_0x304ea1[_0xdca9('0x24')]();}})['catch'](function(_0x3df88f){logger[_0xdca9('0x21')](_0xdca9('0xf'),_0x2e5513,JSON['stringify'](_0x3df88f));_0x304ea1[_0xdca9('0x11')]();});})['catch'](function(_0x29f463){logger['error'](_0xdca9('0xf'),_0x2e5513,_0x29f463[_0xdca9('0x25')]);_0x304ea1['next']();});}}catch(_0x77ae6e){logger['error'](_0xdca9('0xf'),_0x2e5513,JSON[_0xdca9('0x22')](_0x77ae6e));_0x304ea1['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 8e36fde..b2b483d 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 _0x7cc5=['priorityTrue','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','message','[%s][GOTOIF]\x20%s','stringify','validate','lodash','./utils','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','map','join','stop','condition'];(function(_0x4c8e4a,_0xa800c9){var _0x3033ce=function(_0x4d0b12){while(--_0x4d0b12){_0x4c8e4a['push'](_0x4c8e4a['shift']());}};_0x3033ce(++_0xa800c9);}(_0x7cc5,0x82));var _0x57cc=function(_0x3a87e8,_0x1d8633){_0x3a87e8=_0x3a87e8-0x0;var _0x591e80=_0x7cc5[_0x3a87e8];return _0x591e80;};'use strict';var schema=require(_0x57cc('0x0'));var _=require(_0x57cc('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x57cc('0x2'));var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x57cc('0x3')},'priorityTrue':{'type':_0x57cc('0x4'),'message':_0x57cc('0x5')},'priorityFalse':{'type':_0x57cc('0x4'),'message':_0x57cc('0x6')}});exports[_0x57cc('0x7')]=function(_0x555c20,_0x2c3da4){return function(_0x26082b){try{var _0xc4382b={'condition':htmlToText[_0x57cc('0x8')](utils[_0x57cc('0x9')](_0x2c3da4[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2c3da4[0x1],'priorityFalse':_0x2c3da4[0x2]};var _0x399994=gotoif[_0x57cc('0x0')](_0xc4382b,{'typecast':!![]});if(_0x399994['length']){logger['error']('[%s][GOTOIF]\x20%s',_0x555c20,_[_0x57cc('0xa')](_0x399994,'message')[_0x57cc('0xb')](',\x20'));_0x26082b[_0x57cc('0xc')]();}else{try{var _0x2769ca=eval('('+_0xc4382b[_0x57cc('0xd')]+')');var _0x3a5a20=_0x2769ca?_0xc4382b[_0x57cc('0xe')]:_0xc4382b['priorityFalse'];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x555c20,_0xc4382b['condition'],_0x2769ca,_0x3a5a20||'next');if(_0x3a5a20){var _0x42a0fa=_[_0x57cc('0xf')](_0x26082b['rules'](),{'p':_0x3a5a20});if(_0x42a0fa>=0x0){logger['info'](_0x57cc('0x10'),_0x555c20,_0x3a5a20||_0x57cc('0x11'),_0x42a0fa);_0x26082b[_0x57cc('0x11')](_0x42a0fa);}else{logger[_0x57cc('0x12')](_0x57cc('0x13'),_0x555c20,_0x3a5a20||_0x57cc('0x11'));_0x26082b['stop']();}}else{_0x26082b['next']();}}catch(_0x1bb758){logger[_0x57cc('0x14')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x555c20,_0x1bb758[_0x57cc('0x15')]);_0x26082b[_0x57cc('0xc')]();}}}catch(_0x20b2aa){logger['error'](_0x57cc('0x16'),_0x555c20,JSON[_0x57cc('0x17')](_0x20b2aa));_0x26082b[_0x57cc('0xc')]();}};}; \ No newline at end of file +var _0x3410=['findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','next','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','consequence','fromString','replace','error','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s'];(function(_0x2b1b11,_0x16333f){var _0x44830f=function(_0x65f889){while(--_0x65f889){_0x2b1b11['push'](_0x2b1b11['shift']());}};_0x44830f(++_0x16333f);}(_0x3410,0x13f));var _0x0341=function(_0x4b8ae2,_0x1763db){_0x4b8ae2=_0x4b8ae2-0x0;var _0x2d7c5c=_0x3410[_0x4b8ae2];return _0x2d7c5c;};'use strict';var schema=require(_0x0341('0x0'));var _=require(_0x0341('0x1'));var htmlToText=require(_0x0341('0x2'));var utils=require('./utils');var logger=require(_0x0341('0x3'))(_0x0341('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x0341('0x5')},'priorityTrue':{'type':_0x0341('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x0341('0x7')]=function(_0x82a795,_0x284e39){return function(_0xa7a859){try{var _0x59a756={'condition':htmlToText[_0x0341('0x8')](utils['getMustacheRender'](_0x284e39[0x0],this),{'wordwrap':![]})[_0x0341('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x284e39[0x1],'priorityFalse':_0x284e39[0x2]};var _0x1785ab=gotoif[_0x0341('0x0')](_0x59a756,{'typecast':!![]});if(_0x1785ab['length']){logger[_0x0341('0xa')](_0x0341('0xb'),_0x82a795,_[_0x0341('0xc')](_0x1785ab,_0x0341('0xd'))['join'](',\x20'));_0xa7a859[_0x0341('0xe')]();}else{try{var _0x597c02=eval('('+_0x59a756[_0x0341('0xf')]+')');var _0x235946=_0x597c02?_0x59a756[_0x0341('0x10')]:_0x59a756['priorityFalse'];logger[_0x0341('0x11')](_0x0341('0x12'),_0x82a795,_0x59a756['condition'],_0x597c02,_0x235946||'next');if(_0x235946){var _0x5a9c8d=_[_0x0341('0x13')](_0xa7a859[_0x0341('0x14')](),{'p':_0x235946});if(_0x5a9c8d>=0x0){logger[_0x0341('0x11')](_0x0341('0x15'),_0x82a795,_0x235946||'next',_0x5a9c8d);_0xa7a859['next'](_0x5a9c8d);}else{logger[_0x0341('0x11')](_0x0341('0x16'),_0x82a795,_0x235946||'next');_0xa7a859[_0x0341('0xe')]();}}else{_0xa7a859[_0x0341('0x17')]();}}catch(_0x39f0a3){logger[_0x0341('0xa')](_0x0341('0x18'),_0x82a795,_0x39f0a3[_0x0341('0xd')]);_0xa7a859['stop']();}}}catch(_0x2c1dd7){logger[_0x0341('0xa')](_0x0341('0xb'),_0x82a795,JSON[_0x0341('0x19')](_0x2c1dd7));_0xa7a859[_0x0341('0xe')]();}};}; \ 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 959ef7e..957e841 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 _0x0db3=['lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','message','join','priority','findIndex','info','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify'];(function(_0x43ada2,_0x3cc073){var _0x2b0da4=function(_0x16c59d){while(--_0x16c59d){_0x43ada2['push'](_0x43ada2['shift']());}};_0x2b0da4(++_0x3cc073);}(_0x0db3,0x6c));var _0x30db=function(_0x49bb89,_0x1bae7d){_0x49bb89=_0x49bb89-0x0;var _0x361c65=_0x0db3[_0x49bb89];return _0x361c65;};'use strict';var schema=require('validate');var _=require(_0x30db('0x0'));var logger=require(_0x30db('0x1'))(_0x30db('0x2'));var gotop=schema({'priority':{'type':_0x30db('0x3'),'required':!![],'message':_0x30db('0x4')}});exports[_0x30db('0x5')]=function(_0x42d164,_0x10cd9e){return function(_0x48de99){try{var _0x4c342f={'priority':_0x10cd9e[0x0]};var _0x20540a=gotop[_0x30db('0x6')](_0x4c342f,{'typecast':!![]});if(_0x20540a[_0x30db('0x7')]){logger[_0x30db('0x8')]('[%s][GOTOP]\x20%s',_0x42d164,_['map'](_0x20540a,_0x30db('0x9'))[_0x30db('0xa')](',\x20'));_0x48de99['stop']();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x42d164,_0x4c342f[_0x30db('0xb')]);if(_0x4c342f[_0x30db('0xb')]){var _0x1a9c9e=_[_0x30db('0xc')](_0x48de99['rules'](),{'p':_0x4c342f[_0x30db('0xb')]});if(_0x1a9c9e>=0x0){logger[_0x30db('0xd')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x42d164,_0x4c342f[_0x30db('0xb')]||_0x30db('0xe'),_0x1a9c9e);_0x48de99['next'](_0x1a9c9e);}else{logger[_0x30db('0xd')](_0x30db('0xf'),_0x42d164,_0x4c342f[_0x30db('0xb')]||'next');_0x48de99['stop']();}}else{_0x48de99[_0x30db('0xe')]();}}}catch(_0x5c1b14){logger[_0x30db('0x8')](_0x30db('0x10'),_0x42d164,JSON[_0x30db('0x11')](_0x5c1b14));_0x48de99['stop']();}};}; \ No newline at end of file +var _0x5976=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','message','stop','info','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','validate','lodash','../../../../config/logger','routing'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x5976,0x1dc));var _0x6597=function(_0x5c35fd,_0xd30db3){_0x5c35fd=_0x5c35fd-0x0;var _0x40e33e=_0x5976[_0x5c35fd];return _0x40e33e;};'use strict';var schema=require(_0x6597('0x0'));var _=require(_0x6597('0x1'));var logger=require(_0x6597('0x2'))(_0x6597('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x6597('0x4')}});exports[_0x6597('0x5')]=function(_0x44eb03,_0x565447){return function(_0x1abca7){try{var _0x4b8d29={'priority':_0x565447[0x0]};var _0xda27af=gotop[_0x6597('0x0')](_0x4b8d29,{'typecast':!![]});if(_0xda27af['length']){logger[_0x6597('0x6')](_0x6597('0x7'),_0x44eb03,_[_0x6597('0x8')](_0xda27af,_0x6597('0x9'))['join'](',\x20'));_0x1abca7[_0x6597('0xa')]();}else{logger[_0x6597('0xb')]('[%s][GOTOP]\x20priority\x20%s',_0x44eb03,_0x4b8d29[_0x6597('0xc')]);if(_0x4b8d29['priority']){var _0xeafa42=_['findIndex'](_0x1abca7[_0x6597('0xd')](),{'p':_0x4b8d29[_0x6597('0xc')]});if(_0xeafa42>=0x0){logger[_0x6597('0xb')](_0x6597('0xe'),_0x44eb03,_0x4b8d29[_0x6597('0xc')]||_0x6597('0xf'),_0xeafa42);_0x1abca7[_0x6597('0xf')](_0xeafa42);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x44eb03,_0x4b8d29[_0x6597('0xc')]||_0x6597('0xf'));_0x1abca7['stop']();}}else{_0x1abca7[_0x6597('0xf')]();}}}catch(_0x2fc9a6){logger['error']('[%s][GOTOP]\x20%s',_0x44eb03,JSON['stringify'](_0x2fc9a6));_0x1abca7[_0x6597('0xa')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index ac67623..b5c84fd 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 _0x6cca=['getMustacheRender','contact','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x361f02,_0x433e3f){var _0x4f515e=function(_0x5d2429){while(--_0x5d2429){_0x361f02['push'](_0x361f02['shift']());}};_0x4f515e(++_0x433e3f);}(_0x6cca,0xb4));var _0xa6cc=function(_0x4259ff,_0xac17a3){_0x4259ff=_0x4259ff-0x0;var _0x1ad8bf=_0x6cca[_0x4259ff];return _0x1ad8bf;};'use strict';var _=require(_0xa6cc('0x0'));var utils=require(_0xa6cc('0x1'));var logger=require(_0xa6cc('0x2'))(_0xa6cc('0x3'));var rpc={'chatMessage':require(_0xa6cc('0x4')),'openchannelMessage':require(_0xa6cc('0x5')),'mailMessage':require(_0xa6cc('0x6')),'smsMessage':require(_0xa6cc('0x7')),'faxMessage':require(_0xa6cc('0x8'))};exports['consequence']=function(_0x314205,_0xecce1f){return function(_0x2450de){try{var _0x3bf3db={'body':utils[_0xa6cc('0x9')](_0xecce1f[0x0],this),'ContactId':this[_0xa6cc('0xa')]['id']};if(this[_0xa6cc('0xb')]===_0xa6cc('0xc')){_0x3bf3db[_0xa6cc('0xd')]=this['account']['id'];}else{_0x3bf3db[_[_0xa6cc('0xe')](this[_0xa6cc('0xb')])+_0xa6cc('0xf')]=this[_0xa6cc('0x10')]['id'];}_0x3bf3db[_['upperFirst'](this[_0xa6cc('0xb')])+'InteractionId']=this[_0xa6cc('0x11')]['id'];if(rpc[this[_0xa6cc('0xb')]+_0xa6cc('0x12')]){return rpc[this['channel']+_0xa6cc('0x12')][_0xa6cc('0x13')](_0x3bf3db)[_0xa6cc('0x14')](function(_0x2ed20e){logger['info'](_0xa6cc('0x15'),_0x314205,_0x3bf3db[_0xa6cc('0x16')]);_0x2450de['next']();})[_0xa6cc('0x17')](function(_0x32133a){logger[_0xa6cc('0x18')](_0xa6cc('0x15'),_0x314205,JSON[_0xa6cc('0x19')](_0x32133a));_0x2450de[_0xa6cc('0x1a')]();});}}catch(_0x15ee2e){logger['error'](_0xa6cc('0x15'),_0x314205,JSON[_0xa6cc('0x19')](_0x15ee2e));_0x2450de['stop']();}};}; \ No newline at end of file +var _0x42d8=['upperFirst','InteractionId','interaction','create','info','next','catch','error','stringify','stop','[%s][MESSAGE]\x20%s','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','getMustacheRender','channel','AccountId','account'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x42d8,0xfb));var _0x842d=function(_0x56ada5,_0x19d0e5){_0x56ada5=_0x56ada5-0x0;var _0x4c21b6=_0x42d8[_0x56ada5];return _0x4c21b6;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x842d('0x0'))(_0x842d('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x842d('0x2')),'mailMessage':require(_0x842d('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x842d('0x4'))};exports['consequence']=function(_0x422b0a,_0x1c3437){return function(_0x4225cf){try{var _0x18bc5e={'body':utils[_0x842d('0x5')](_0x1c3437[0x0],this),'ContactId':this['contact']['id']};if(this[_0x842d('0x6')]==='chat'){_0x18bc5e['ChatWebsiteId']=this['account']['id'];}else{_0x18bc5e[_['upperFirst'](this[_0x842d('0x6')])+_0x842d('0x7')]=this[_0x842d('0x8')]['id'];}_0x18bc5e[_[_0x842d('0x9')](this['channel'])+_0x842d('0xa')]=this[_0x842d('0xb')]['id'];if(rpc[this[_0x842d('0x6')]+'Message']){return rpc[this[_0x842d('0x6')]+'Message'][_0x842d('0xc')](_0x18bc5e)['then'](function(_0x55e159){logger[_0x842d('0xd')]('[%s][MESSAGE]\x20%s',_0x422b0a,_0x18bc5e['body']);_0x4225cf[_0x842d('0xe')]();})[_0x842d('0xf')](function(_0xb4ad18){logger[_0x842d('0x10')]('[%s][MESSAGE]\x20%s',_0x422b0a,JSON[_0x842d('0x11')](_0xb4ad18));_0x4225cf[_0x842d('0x12')]();});}}catch(_0xcfd788){logger[_0x842d('0x10')](_0x842d('0x13'),_0x422b0a,JSON['stringify'](_0xcfd788));_0x4225cf[_0x842d('0x12')]();}};}; \ 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 da43b2b..6b5e5a3 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 _0x6268=['[%s][NOOP]\x20%s','next','error','stringify','./utils','routing','info'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x6268,0x193));var _0x8626=function(_0x2a416a,_0x3c9f12){_0x2a416a=_0x2a416a-0x0;var _0x7e8547=_0x6268[_0x2a416a];return _0x7e8547;};'use strict';var utils=require(_0x8626('0x0'));var logger=require('../../../../config/logger')(_0x8626('0x1'));exports['consequence']=function(_0x2f48fe,_0x6c52c9){return function(_0xa638c4){try{logger[_0x8626('0x2')](_0x8626('0x3'),_0x2f48fe,utils['getMustacheRender'](_0x6c52c9[0x0],this));_0xa638c4[_0x8626('0x4')]();}catch(_0x393b8a){logger[_0x8626('0x5')](_0x8626('0x3'),_0x2f48fe,JSON[_0x8626('0x6')](_0x393b8a));_0xa638c4['stop']();}};}; \ No newline at end of file +var _0x4c54=['error','[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger','routing','info','getMustacheRender','next'];(function(_0x57474e,_0x4178b8){var _0xfaae8c=function(_0x2e34d1){while(--_0x2e34d1){_0x57474e['push'](_0x57474e['shift']());}};_0xfaae8c(++_0x4178b8);}(_0x4c54,0x13a));var _0x44c5=function(_0x161399,_0x50b0a9){_0x161399=_0x161399-0x0;var _0x2cea7e=_0x4c54[_0x161399];return _0x2cea7e;};'use strict';var utils=require(_0x44c5('0x0'));var logger=require(_0x44c5('0x1'))(_0x44c5('0x2'));exports['consequence']=function(_0x439610,_0x367e53){return function(_0x5c6c76){try{logger[_0x44c5('0x3')]('[%s][NOOP]\x20%s',_0x439610,utils[_0x44c5('0x4')](_0x367e53[0x0],this));_0x5c6c76[_0x44c5('0x5')]();}catch(_0x115de3){logger[_0x44c5('0x6')](_0x44c5('0x7'),_0x439610,JSON[_0x44c5('0x8')](_0x115de3));_0x5c6c76[_0x44c5('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 f07007c..cf9e31a 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 _0x4483=['pick','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','body','from','YYYY-MM-DD\x20HH:mm:ss','list','upperFirst','channel','InteractionId','interaction','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','accepted','[%s][STOP:QUEUE][NAME:%s]','error','update\x20queue\x20report','waiting','timeout','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','find','Queues','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','log','stack','validate','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','joinAt','emit','clone','queue','format'];(function(_0x3f560d,_0x465d67){var _0x3efddc=function(_0x183737){while(--_0x183737){_0x3f560d['push'](_0x3f560d['shift']());}};_0x3efddc(++_0x465d67);}(_0x4483,0x1a3));var _0x3448=function(_0x118625,_0x22fc6b){_0x118625=_0x118625-0x0;var _0x25037c=_0x4483[_0x118625];return _0x25037c;};'use strict';var schema=require(_0x3448('0x0'));var _=require(_0x3448('0x1'));var util=require(_0x3448('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x3448('0x3'));var Redis=require(_0x3448('0x4'));var config=require(_0x3448('0x5'));var logger=require(_0x3448('0x6'))(_0x3448('0x7'));var strategy=require('./strategy');config[_0x3448('0x8')]=_[_0x3448('0x9')](config[_0x3448('0x8')],{'host':_0x3448('0xa'),'port':0x18eb});var io=require(_0x3448('0xb'))(new Redis(config[_0x3448('0x8')]));var attributes=['id',_0x3448('0xc'),_0x3448('0xd'),'queue','from',_0x3448('0xe')];function emit(_0x25c152,_0xc36409,_0x6f82ca){io['to'](_0x25c152)[_0x3448('0xf')](_0xc36409,_0x6f82ca);}function emitChannelQueueInteraction(_0x1e645a,_0x2bdf02,_0x32cd61,_0x39bd9e,_0x35bb7b,_0x2a6048,_0x481a6f,_0x5bf09e){var _0x298ae6=_[_0x3448('0x10')](_0x32cd61);_0x298ae6['queue_id']=_0x5bf09e;_0x298ae6[_0x3448('0x11')]=_0x2bdf02;_0x298ae6[_0x3448('0xd')]=_0x39bd9e;_0x298ae6['id']=_0x35bb7b;if(_0x2a6048){_0x481a6f[util[_0x3448('0x12')]('%sQueuesWaitingInteractions',_0x1e645a)][_0x35bb7b]=_[_0x3448('0x13')](_0x298ae6,attributes);}else{delete _0x481a6f[util[_0x3448('0x12')]('%sQueuesWaitingInteractions',_0x1e645a)][_0x35bb7b];}emit(util[_0x3448('0x12')](_0x3448('0x14'),_0x1e645a,_0x2bdf02),util[_0x3448('0x12')]('%s_queue_waiting_interaction:%s',_0x1e645a,_0x2a6048?_0x3448('0x15'):_0x3448('0x16')),_[_0x3448('0x13')](_0x298ae6,attributes));}var rpc={'openchannelQueueReport':require(_0x3448('0x17')),'mailQueueReport':require(_0x3448('0x18')),'chatQueueReport':require(_0x3448('0x19')),'smsQueueReport':require(_0x3448('0x1a')),'faxQueueReport':require(_0x3448('0x1b'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x3448('0x1c')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x53f8e7,_0x1e9774,_0x278736,_0xda4040){if(_0x53f8e7&&_0x1e9774&&_0x278736){_0x1e9774['waiting']+=0x1;var _0x3df082={'uniqueid':_0x53f8e7,'from':_0x278736[_0x3448('0x1d')]?_0x278736[_0x3448('0x1d')][_0x3448('0x1e')]:'','joinAt':moment()[_0x3448('0x12')](_0x3448('0x1f')),'ContactId':_0x278736['contact']?_0x278736['contact']['id']:null,'ListId':_0x278736['list']?_0x278736[_0x3448('0x20')]['id']:null};_0x3df082[_[_0x3448('0x21')](_0x278736['channel'])+'QueueId']=_0x1e9774['id']||null;_0x3df082[_[_0x3448('0x21')](_0x278736[_0x3448('0x22')])+_0x3448('0x23')]=_0x278736[_0x3448('0x24')]?_0x278736[_0x3448('0x24')]['id']:null;_0x3df082[_['upperFirst'](_0x278736[_0x3448('0x22')])+_0x3448('0x25')]=_0x278736[_0x3448('0x26')]?_0x278736[_0x3448('0x26')]['id']:null;_0x3df082[_[_0x3448('0x21')](_0x278736['channel'])+(_0x278736[_0x3448('0x22')]!==_0x3448('0x27')?'AccountId':_0x3448('0x28'))]=_0x278736[_0x3448('0xd')]?_0x278736[_0x3448('0xd')]['id']:null;logger[_0x3448('0x29')](util[_0x3448('0x12')](_0x3448('0x2a'),_0x53f8e7,_0x1e9774[_0x3448('0x2b')]));emitChannelQueueInteraction(_0x278736[_0x3448('0x22')],_0x1e9774['name'],_0x3df082,_0x278736[_0x3448('0xd')][_0x3448('0x2b')],_0x278736[_0x3448('0x26')]['id'],!![],_0xda4040,_0x1e9774['id']);if(rpc[_0x278736['channel']+_0x3448('0x2c')]){return rpc[_0x278736['channel']+'QueueReport']['create'](_0x3df082)[_0x3448('0x2d')](function(_0xff6513){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x3d2a83,_0x37ceac,_0x32121c,_0x1e99ff){if(_0x3d2a83&&_0x37ceac){_0x37ceac['waiting']-=0x1;var _0x2df6fc={'leaveAt':moment()[_0x3448('0x12')](_0x3448('0x1f')),'acceptAt':moment()['format'](_0x3448('0x1f')),'reason':_0x3448('0x2e')};logger['info'](util['format'](_0x3448('0x2f'),_0x3d2a83,_0x37ceac[_0x3448('0x2b')]));emitChannelQueueInteraction(_0x32121c[_0x3448('0x22')],_0x37ceac[_0x3448('0x2b')],_0x32121c['body'],_0x32121c[_0x3448('0xd')][_0x3448('0x2b')],_0x32121c[_0x3448('0x26')]['id'],![],_0x1e99ff,_0x37ceac['id']);if(rpc[_0x32121c[_0x3448('0x22')]+'QueueReport']){return rpc[_0x32121c[_0x3448('0x22')]+_0x3448('0x2c')]['update'](_0x3d2a83,_0x2df6fc)[_0x3448('0x2d')](function(_0x25d3df){logger[_0x3448('0x30')](_0x3448('0x31'));});}}}function endRouting(_0x14a830,_0x31586a,_0x32592f,_0xd91216){if(_0x14a830&&_0x31586a){_0x31586a[_0x3448('0x32')]-=0x1;var _0x49c469={'leaveAt':moment()['format'](_0x3448('0x1f')),'exitAt':moment()['format'](_0x3448('0x1f')),'reason':_0x3448('0x33')};logger[_0x3448('0x29')](util[_0x3448('0x12')]('[%s][END:QUEUE][NAME:%s]',_0x14a830,_0x31586a[_0x3448('0x2b')]));emitChannelQueueInteraction(_0x32592f[_0x3448('0x22')],_0x31586a[_0x3448('0x2b')],_0x32592f[_0x3448('0x1d')],_0x32592f[_0x3448('0xd')][_0x3448('0x2b')],_0x32592f[_0x3448('0x26')]['id'],![],_0xd91216);if(rpc[_0x32592f[_0x3448('0x22')]+_0x3448('0x2c')]){return rpc[_0x32592f['channel']+_0x3448('0x2c')][_0x3448('0x34')](_0x14a830,_0x49c469)[_0x3448('0x2d')](function(_0x2bc2e7){logger[_0x3448('0x30')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x18b297){return function(_0x1b7284){return _0x1b7284[_0x3448('0x2b')][_0x3448('0x35')]()===_0x18b297[_0x3448('0x35')]();};}exports[_0x3448('0x36')]=function(_0x415985,_0x3db5f1,_0x4a8f80,_0x399246){return function(_0x3d96be){try{var _0x32468a={'name':_0x3db5f1[0x0],'timeout':_0x3db5f1[0x1]};var _0x4a04d0=queue[_0x3448('0x0')](_0x32468a,{'typecast':!![]});if(_0x4a04d0[_0x3448('0x37')]){logger[_0x3448('0x30')](_0x3448('0x38'),_0x415985,_[_0x3448('0x39')](_0x4a04d0,_0x3448('0x26'))[_0x3448('0x3a')](',\x20'));_0x3d96be['stop']();}else{var _0x2165c7=_[_0x3448('0x3b')](_0x4a8f80[_0x399246[_0x3448('0x22')]+_0x3448('0x3c')],handleFindQueue(_0x32468a[_0x3448('0x2b')]));if(_0x2165c7){startRouting(_0x415985,_0x2165c7,_0x399246,_0x4a8f80);var _0x33aa31=(_0x2165c7['timeout']||0xa)*0x3e8;var _0xcd75af=(_0x32468a['timeout']||0x14)*0x3e8;var _0x4be942,_0x164b37;if(_0x33aa31>_0xcd75af){_0xcd75af=_0x33aa31;}var _0x297343=seqqueue['createQueue'](_0x33aa31);_0x297343['id']=_0x415985;_0x297343[_0x3448('0x3d')]=_0x33aa31;_0x297343[_0x3448('0x3e')]=_0xcd75af;_0x297343['channel']=_0x399246[_0x3448('0x22')];_0x4a8f80[_0x3448('0x3f')][_0x415985]['on']('end',function(){logger[_0x3448('0x29')](_0x3448('0x40'),_0x415985);stopRouting(_0x415985,_0x2165c7,_0x399246,_0x4a8f80);clearTimeout(_0x4be942);_0x4be942=undefined;_0x297343[_0x3448('0x41')](!![]);if(_0x4a8f80[_0x3448('0x3f')][_0x415985]){delete _0x4a8f80[_0x3448('0x3f')][_0x415985];}_0x3d96be[_0x3448('0x42')]();});_0x4a8f80[_0x3448('0x3f')][_0x415985]['on']('complete',function(){if(_0x4a8f80['rules'][_0x415985]){delete _0x4a8f80[_0x3448('0x3f')][_0x415985];}});_0x4be942=setTimeout(function(){logger[_0x3448('0x29')](_0x3448('0x43'),_0x415985);endRouting(_0x415985,_0x2165c7,_0x399246,_0x4a8f80);clearTimeout(_0x4be942);_0x297343[_0x3448('0x41')](!![]);_0x3d96be['next']();},_0xcd75af);switch(_0x2165c7[_0x3448('0x44')]){case _0x3448('0x45'):strategy[_0x3448('0x45')](_0x297343,_0x2165c7,_0x4a8f80,_0x399246);break;default:strategy[_0x3448('0x46')](_0x297343,_0x2165c7,_0x4a8f80,_0x399246);}}else{logger[_0x3448('0x30')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x415985,_0x32468a[_0x3448('0x2b')]);_0x3d96be['stop']();}}}catch(_0xb5e250){console[_0x3448('0x47')](_0xb5e250);logger['error'](_0x3448('0x38'),_0x415985,_0xb5e250[_0x3448('0x48')]);_0x3d96be[_0x3448('0x42')]();}};}; \ No newline at end of file +var _0x5b02=['[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','validate','lodash','util','seq-queue','../../../../config/environment','routing','./strategy','redis','defaults','socket.io-emitter','account','joinAt','emit','clone','queue_id','queue','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','MessageId','message','chat','AccountId','name','QueueReport','create','catch','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end'];(function(_0x49bb0e,_0x195f6c){var _0x5c2d4a=function(_0x4abb15){while(--_0x4abb15){_0x49bb0e['push'](_0x49bb0e['shift']());}};_0x5c2d4a(++_0x195f6c);}(_0x5b02,0xe9));var _0x25b0=function(_0x4fbbc8,_0x2313a0){_0x4fbbc8=_0x4fbbc8-0x0;var _0xd4b586=_0x5b02[_0x4fbbc8];return _0xd4b586;};'use strict';var schema=require(_0x25b0('0x0'));var _=require(_0x25b0('0x1'));var util=require(_0x25b0('0x2'));var seqqueue=require(_0x25b0('0x3'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x25b0('0x4'));var logger=require('../../../../config/logger')(_0x25b0('0x5'));var strategy=require(_0x25b0('0x6'));config[_0x25b0('0x7')]=_[_0x25b0('0x8')](config[_0x25b0('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x25b0('0x9'))(new Redis(config[_0x25b0('0x7')]));var attributes=['id','queue_id',_0x25b0('0xa'),'queue','from',_0x25b0('0xb')];function emit(_0x45429b,_0x358af0,_0x575918){io['to'](_0x45429b)[_0x25b0('0xc')](_0x358af0,_0x575918);}function emitChannelQueueInteraction(_0x466612,_0x135afb,_0x250d31,_0x2c72f3,_0x2f57af,_0x44afbc,_0x10c3fb,_0x193c2b){var _0x1d3178=_[_0x25b0('0xd')](_0x250d31);_0x1d3178[_0x25b0('0xe')]=_0x193c2b;_0x1d3178[_0x25b0('0xf')]=_0x135afb;_0x1d3178[_0x25b0('0xa')]=_0x2c72f3;_0x1d3178['id']=_0x2f57af;if(_0x44afbc){_0x10c3fb[util[_0x25b0('0x10')](_0x25b0('0x11'),_0x466612)][_0x2f57af]=_[_0x25b0('0x12')](_0x1d3178,attributes);}else{delete _0x10c3fb[util[_0x25b0('0x10')](_0x25b0('0x11'),_0x466612)][_0x2f57af];}emit(util[_0x25b0('0x10')](_0x25b0('0x13'),_0x466612,_0x135afb),util['format']('%s_queue_waiting_interaction:%s',_0x466612,_0x44afbc?_0x25b0('0x14'):'remove'),_[_0x25b0('0x12')](_0x1d3178,attributes));}var rpc={'openchannelQueueReport':require(_0x25b0('0x15')),'mailQueueReport':require(_0x25b0('0x16')),'chatQueueReport':require(_0x25b0('0x17')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x25b0('0x18'))};var queue=schema({'name':{'type':_0x25b0('0x19'),'required':!![],'message':_0x25b0('0x1a')},'timeout':{'type':_0x25b0('0x1b'),'message':_0x25b0('0x1c')}});function startRouting(_0x25872d,_0x54f458,_0x348d36,_0x27aa20){if(_0x25872d&&_0x54f458&&_0x348d36){_0x54f458[_0x25b0('0x1d')]+=0x1;var _0x1507b5={'uniqueid':_0x25872d,'from':_0x348d36[_0x25b0('0x1e')]?_0x348d36[_0x25b0('0x1e')][_0x25b0('0x1f')]:'','joinAt':moment()[_0x25b0('0x10')](_0x25b0('0x20')),'ContactId':_0x348d36[_0x25b0('0x21')]?_0x348d36[_0x25b0('0x21')]['id']:null,'ListId':_0x348d36[_0x25b0('0x22')]?_0x348d36['list']['id']:null};_0x1507b5[_[_0x25b0('0x23')](_0x348d36[_0x25b0('0x24')])+'QueueId']=_0x54f458['id']||null;_0x1507b5[_[_0x25b0('0x23')](_0x348d36[_0x25b0('0x24')])+_0x25b0('0x25')]=_0x348d36['interaction']?_0x348d36['interaction']['id']:null;_0x1507b5[_['upperFirst'](_0x348d36[_0x25b0('0x24')])+_0x25b0('0x26')]=_0x348d36[_0x25b0('0x27')]?_0x348d36[_0x25b0('0x27')]['id']:null;_0x1507b5[_[_0x25b0('0x23')](_0x348d36[_0x25b0('0x24')])+(_0x348d36[_0x25b0('0x24')]!==_0x25b0('0x28')?_0x25b0('0x29'):'WebsiteId')]=_0x348d36[_0x25b0('0xa')]?_0x348d36[_0x25b0('0xa')]['id']:null;logger['info'](util['format']('[%s][START:QUEUE][NAME:%s]',_0x25872d,_0x54f458[_0x25b0('0x2a')]));emitChannelQueueInteraction(_0x348d36[_0x25b0('0x24')],_0x54f458[_0x25b0('0x2a')],_0x1507b5,_0x348d36[_0x25b0('0xa')][_0x25b0('0x2a')],_0x348d36[_0x25b0('0x27')]['id'],!![],_0x27aa20,_0x54f458['id']);if(rpc[_0x348d36[_0x25b0('0x24')]+_0x25b0('0x2b')]){return rpc[_0x348d36[_0x25b0('0x24')]+_0x25b0('0x2b')][_0x25b0('0x2c')](_0x1507b5)[_0x25b0('0x2d')](function(_0x1ea374){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x7ce48f,_0x52eec1,_0x4dfeea,_0x3317fc){if(_0x7ce48f&&_0x52eec1){_0x52eec1[_0x25b0('0x1d')]-=0x1;var _0x46c5e8={'leaveAt':moment()[_0x25b0('0x10')](_0x25b0('0x20')),'acceptAt':moment()['format'](_0x25b0('0x20')),'reason':_0x25b0('0x2e')};logger['info'](util[_0x25b0('0x10')](_0x25b0('0x2f'),_0x7ce48f,_0x52eec1['name']));emitChannelQueueInteraction(_0x4dfeea[_0x25b0('0x24')],_0x52eec1['name'],_0x4dfeea[_0x25b0('0x1e')],_0x4dfeea[_0x25b0('0xa')][_0x25b0('0x2a')],_0x4dfeea[_0x25b0('0x27')]['id'],![],_0x3317fc,_0x52eec1['id']);if(rpc[_0x4dfeea[_0x25b0('0x24')]+_0x25b0('0x2b')]){return rpc[_0x4dfeea[_0x25b0('0x24')]+_0x25b0('0x2b')][_0x25b0('0x30')](_0x7ce48f,_0x46c5e8)['catch'](function(_0x461a06){logger[_0x25b0('0x31')](_0x25b0('0x32'));});}}}function endRouting(_0x42be5f,_0xc6180,_0x289416,_0x1eee05){if(_0x42be5f&&_0xc6180){_0xc6180[_0x25b0('0x1d')]-=0x1;var _0x29e810={'leaveAt':moment()[_0x25b0('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x25b0('0x10')](_0x25b0('0x20')),'reason':_0x25b0('0x33')};logger['info'](util[_0x25b0('0x10')](_0x25b0('0x34'),_0x42be5f,_0xc6180[_0x25b0('0x2a')]));emitChannelQueueInteraction(_0x289416[_0x25b0('0x24')],_0xc6180[_0x25b0('0x2a')],_0x289416[_0x25b0('0x1e')],_0x289416[_0x25b0('0xa')][_0x25b0('0x2a')],_0x289416['message']['id'],![],_0x1eee05);if(rpc[_0x289416['channel']+_0x25b0('0x2b')]){return rpc[_0x289416[_0x25b0('0x24')]+_0x25b0('0x2b')]['update'](_0x42be5f,_0x29e810)[_0x25b0('0x2d')](function(_0x48aeb6){logger[_0x25b0('0x31')](_0x25b0('0x32'));});}}}function handleFindQueue(_0xbd0db5){return function(_0x255e31){return _0x255e31[_0x25b0('0x2a')]['toLowerCase']()===_0xbd0db5[_0x25b0('0x35')]();};}exports[_0x25b0('0x36')]=function(_0x133d9a,_0x376d8a,_0x428799,_0x5a9e86){return function(_0x327659){try{var _0x1e39ca={'name':_0x376d8a[0x0],'timeout':_0x376d8a[0x1]};var _0x3d1262=queue[_0x25b0('0x0')](_0x1e39ca,{'typecast':!![]});if(_0x3d1262[_0x25b0('0x37')]){logger[_0x25b0('0x31')](_0x25b0('0x38'),_0x133d9a,_[_0x25b0('0x39')](_0x3d1262,_0x25b0('0x27'))[_0x25b0('0x3a')](',\x20'));_0x327659[_0x25b0('0x3b')]();}else{var _0x5186cc=_[_0x25b0('0x3c')](_0x428799[_0x5a9e86['channel']+_0x25b0('0x3d')],handleFindQueue(_0x1e39ca[_0x25b0('0x2a')]));if(_0x5186cc){startRouting(_0x133d9a,_0x5186cc,_0x5a9e86,_0x428799);var _0x1e865a=(_0x5186cc[_0x25b0('0x33')]||0xa)*0x3e8;var _0x5d3af9=(_0x1e39ca[_0x25b0('0x33')]||0x14)*0x3e8;var _0x4b5bf4,_0x2d40c6;if(_0x1e865a>_0x5d3af9){_0x5d3af9=_0x1e865a;}var _0x5cf035=seqqueue[_0x25b0('0x3e')](_0x1e865a);_0x5cf035['id']=_0x133d9a;_0x5cf035[_0x25b0('0x3f')]=_0x1e865a;_0x5cf035[_0x25b0('0x40')]=_0x5d3af9;_0x5cf035[_0x25b0('0x24')]=_0x5a9e86[_0x25b0('0x24')];_0x428799[_0x25b0('0x41')][_0x133d9a]['on'](_0x25b0('0x42'),function(){logger['info'](_0x25b0('0x43'),_0x133d9a);stopRouting(_0x133d9a,_0x5186cc,_0x5a9e86,_0x428799);clearTimeout(_0x4b5bf4);_0x4b5bf4=undefined;_0x5cf035[_0x25b0('0x44')](!![]);if(_0x428799[_0x25b0('0x41')][_0x133d9a]){delete _0x428799['rules'][_0x133d9a];}_0x327659[_0x25b0('0x3b')]();});_0x428799[_0x25b0('0x41')][_0x133d9a]['on'](_0x25b0('0x45'),function(){if(_0x428799[_0x25b0('0x41')][_0x133d9a]){delete _0x428799[_0x25b0('0x41')][_0x133d9a];}});_0x4b5bf4=setTimeout(function(){logger['info'](_0x25b0('0x46'),_0x133d9a);endRouting(_0x133d9a,_0x5186cc,_0x5a9e86,_0x428799);clearTimeout(_0x4b5bf4);_0x5cf035[_0x25b0('0x44')](!![]);_0x327659[_0x25b0('0x47')]();},_0x5d3af9);switch(_0x5186cc['strategy']){case _0x25b0('0x48'):strategy[_0x25b0('0x48')](_0x5cf035,_0x5186cc,_0x428799,_0x5a9e86);break;default:strategy[_0x25b0('0x49')](_0x5cf035,_0x5186cc,_0x428799,_0x5a9e86);}}else{logger[_0x25b0('0x31')](_0x25b0('0x4a'),_0x133d9a,_0x1e39ca[_0x25b0('0x2a')]);_0x327659['stop']();}}}catch(_0x4b004d){console['log'](_0x4b004d);logger[_0x25b0('0x31')]('[%s][QUEUE]\x20%s',_0x133d9a,_0x4b004d['stack']);_0x327659[_0x25b0('0x3b')]();}};}; \ 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 e18ad8c..e9c8bf5 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 _0xfd0c=['notificationId','squeue','agent','bind','handleTimeout','drained','handleDrained','prototype','push','handleRun','info','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','forcedOwnership','isAgentAvailable','busyQueue','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','busy','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger'];(function(_0x2f5957,_0x46b526){var _0x1f4776=function(_0x49d2b5){while(--_0x49d2b5){_0x2f5957['push'](_0x2f5957['shift']());}};_0x1f4776(++_0x46b526);}(_0xfd0c,0x14c));var _0xcfd0=function(_0x267c52,_0x3c0df3){_0x267c52=_0x267c52-0x0;var _0x46c47b=_0xfd0c[_0x267c52];return _0x46c47b;};'use strict';var _=require(_0xcfd0('0x0'));var uuid=require(_0xcfd0('0x1'));var util=require(_0xcfd0('0x2'));var logger=require(_0xcfd0('0x3'))('routing');var Agent=function(_0x367e23,_0x2bcde0,_0x4c223b,_0x229b43){this[_0xcfd0('0x4')]=uuid['v4']();this[_0xcfd0('0x5')]=_0x367e23;this[_0xcfd0('0x6')]=_0x2bcde0;this['realtime']=_0x4c223b;this['routing']=_0x229b43;this[_0xcfd0('0x5')]['push'](this['handleRun'][_0xcfd0('0x7')](this),this[_0xcfd0('0x8')][_0xcfd0('0x7')](this));this['squeue']['on']('timeout',this[_0xcfd0('0x8')][_0xcfd0('0x7')](this));this['squeue']['on'](_0xcfd0('0x9'),this[_0xcfd0('0xa')][_0xcfd0('0x7')](this));};Agent[_0xcfd0('0xb')][_0xcfd0('0xc')]=function(){this[_0xcfd0('0x5')][_0xcfd0('0xc')](this['handleRun'][_0xcfd0('0x7')](this),this['handleTimeout'][_0xcfd0('0x7')](this));};Agent[_0xcfd0('0xb')][_0xcfd0('0xa')]=function(){this[_0xcfd0('0x8')](!![]);};Agent[_0xcfd0('0xb')][_0xcfd0('0xd')]=function(_0x7b16a2){logger[_0xcfd0('0xe')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xcfd0('0x5')]['id'],this[_0xcfd0('0x6')]['id']);if(_['isNil'](this[_0xcfd0('0xf')][_0xcfd0('0x10')][this[_0xcfd0('0x6')]['id']])){logger['info'](_0xcfd0('0x11'),this[_0xcfd0('0x5')]['id'],this[_0xcfd0('0x6')]['id']);setTimeout(this['push'][_0xcfd0('0x7')](this),0x3e8);}else{if(this[_0xcfd0('0x12')][_0xcfd0('0x13')]||util[_0xcfd0('0x14')](this['squeue']['id'],this[_0xcfd0('0xf')][_0xcfd0('0x10')][this['agent']['id']],this[_0xcfd0('0x5')]['channel'],![])){this[_0xcfd0('0xf')][_0xcfd0('0x10')][this[_0xcfd0('0x6')]['id']]['busy']=!![];this[_0xcfd0('0xf')][_0xcfd0('0x10')][this[_0xcfd0('0x6')]['id']][_0xcfd0('0x15')]=undefined;util['showNotification'](this[_0xcfd0('0x4')],this[_0xcfd0('0x5')]['id'],this['realtime'][_0xcfd0('0x10')][this[_0xcfd0('0x6')]['id']],null,this['routing']);util[_0xcfd0('0x16')](this[_0xcfd0('0x5')]['id'],this[_0xcfd0('0xf')][_0xcfd0('0x10')][this[_0xcfd0('0x6')]['id']],_0xcfd0('0x17')+(this['routing']['forcedOwnership']?':FORCED':''));}else{logger['info'](_0xcfd0('0x18'),this[_0xcfd0('0x5')]['id'],this[_0xcfd0('0x6')]['id']);setTimeout(this[_0xcfd0('0xc')][_0xcfd0('0x7')](this),0x3e8);}}};Agent[_0xcfd0('0xb')][_0xcfd0('0x8')]=function(_0x325844){if(_['isNil'](this[_0xcfd0('0xf')][_0xcfd0('0x10')][this[_0xcfd0('0x6')]['id']])){return logger[_0xcfd0('0xe')](_0xcfd0('0x11'),this['squeue']['id'],this[_0xcfd0('0x6')]['id']);}else{logger['info']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xcfd0('0x5')]['id'],this[_0xcfd0('0x6')]['id']);util['hideNotification'](this['notificationId'],this[_0xcfd0('0x5')]['id'],this[_0xcfd0('0xf')][_0xcfd0('0x10')][this[_0xcfd0('0x6')]['id']],null,this[_0xcfd0('0x12')]);this[_0xcfd0('0xf')][_0xcfd0('0x10')][this[_0xcfd0('0x6')]['id']][_0xcfd0('0x19')]=![];this[_0xcfd0('0xf')][_0xcfd0('0x10')][this[_0xcfd0('0x6')]['id']][_0xcfd0('0x15')]=undefined;util[_0xcfd0('0x16')](this[_0xcfd0('0x5')]['id'],this[_0xcfd0('0xf')]['agents'][this[_0xcfd0('0x6')]['id']],_0x325844?'STOP':_0xcfd0('0x1a'));}if(!_0x325844){setTimeout(this['push'][_0xcfd0('0x7')](this),0x3e8);}};function agent(_0x303a9a,_0x1637c7,_0x55a35a,_0x152934){return new Agent(_0x303a9a,_0x1637c7,_0x55a35a,_0x152934);}module[_0xcfd0('0x1b')]=agent; \ No newline at end of file +var _0x4e37=['handleTimeout','handleDrained','prototype','info','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','push','forcedOwnership','isAgentAvailable','busy','busyQueue','showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','lodash','routing','notificationId','squeue','agent','realtime','handleRun','bind'];(function(_0x1d6267,_0x1e8b7f){var _0x1ed05c=function(_0x2ab514){while(--_0x2ab514){_0x1d6267['push'](_0x1d6267['shift']());}};_0x1ed05c(++_0x1e8b7f);}(_0x4e37,0xd8));var _0x74e3=function(_0x59ed12,_0xf96ab6){_0x59ed12=_0x59ed12-0x0;var _0x3b6f60=_0x4e37[_0x59ed12];return _0x3b6f60;};'use strict';var _=require(_0x74e3('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require('../../../../../config/logger')(_0x74e3('0x1'));var Agent=function(_0x116887,_0x19c26e,_0x53aa12,_0x7f223e){this[_0x74e3('0x2')]=uuid['v4']();this[_0x74e3('0x3')]=_0x116887;this[_0x74e3('0x4')]=_0x19c26e;this[_0x74e3('0x5')]=_0x53aa12;this[_0x74e3('0x1')]=_0x7f223e;this['squeue']['push'](this[_0x74e3('0x6')][_0x74e3('0x7')](this),this['handleTimeout']['bind'](this));this[_0x74e3('0x3')]['on']('timeout',this[_0x74e3('0x8')][_0x74e3('0x7')](this));this['squeue']['on']('drained',this[_0x74e3('0x9')][_0x74e3('0x7')](this));};Agent[_0x74e3('0xa')]['push']=function(){this['squeue']['push'](this['handleRun'][_0x74e3('0x7')](this),this[_0x74e3('0x8')][_0x74e3('0x7')](this));};Agent[_0x74e3('0xa')][_0x74e3('0x9')]=function(){this['handleTimeout'](!![]);};Agent[_0x74e3('0xa')][_0x74e3('0x6')]=function(_0x3e614c){logger[_0x74e3('0xb')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x74e3('0x3')]['id'],this['agent']['id']);if(_[_0x74e3('0xc')](this[_0x74e3('0x5')][_0x74e3('0xd')][this['agent']['id']])){logger[_0x74e3('0xb')](_0x74e3('0xe'),this[_0x74e3('0x3')]['id'],this['agent']['id']);setTimeout(this[_0x74e3('0xf')][_0x74e3('0x7')](this),0x3e8);}else{if(this[_0x74e3('0x1')][_0x74e3('0x10')]||util[_0x74e3('0x11')](this[_0x74e3('0x3')]['id'],this[_0x74e3('0x5')]['agents'][this[_0x74e3('0x4')]['id']],this[_0x74e3('0x3')]['channel'],![])){this['realtime'][_0x74e3('0xd')][this[_0x74e3('0x4')]['id']][_0x74e3('0x12')]=!![];this[_0x74e3('0x5')]['agents'][this[_0x74e3('0x4')]['id']][_0x74e3('0x13')]=undefined;util[_0x74e3('0x14')](this[_0x74e3('0x2')],this[_0x74e3('0x3')]['id'],this[_0x74e3('0x5')]['agents'][this[_0x74e3('0x4')]['id']],null,this[_0x74e3('0x1')]);util[_0x74e3('0x15')](this[_0x74e3('0x3')]['id'],this[_0x74e3('0x5')]['agents'][this[_0x74e3('0x4')]['id']],_0x74e3('0x16')+(this[_0x74e3('0x1')][_0x74e3('0x10')]?':FORCED':''));}else{logger[_0x74e3('0xb')](_0x74e3('0x17'),this[_0x74e3('0x3')]['id'],this['agent']['id']);setTimeout(this['push'][_0x74e3('0x7')](this),0x3e8);}}};Agent['prototype'][_0x74e3('0x8')]=function(_0x424787){if(_['isNil'](this[_0x74e3('0x5')][_0x74e3('0xd')][this[_0x74e3('0x4')]['id']])){return logger['info'](_0x74e3('0xe'),this[_0x74e3('0x3')]['id'],this[_0x74e3('0x4')]['id']);}else{logger['info'](_0x74e3('0x18'),this[_0x74e3('0x3')]['id'],this[_0x74e3('0x4')]['id']);util[_0x74e3('0x19')](this['notificationId'],this[_0x74e3('0x3')]['id'],this[_0x74e3('0x5')][_0x74e3('0xd')][this[_0x74e3('0x4')]['id']],null,this['routing']);this[_0x74e3('0x5')][_0x74e3('0xd')][this[_0x74e3('0x4')]['id']][_0x74e3('0x12')]=![];this[_0x74e3('0x5')][_0x74e3('0xd')][this[_0x74e3('0x4')]['id']][_0x74e3('0x13')]=undefined;util[_0x74e3('0x15')](this['squeue']['id'],this[_0x74e3('0x5')][_0x74e3('0xd')][this[_0x74e3('0x4')]['id']],_0x424787?_0x74e3('0x1a'):_0x74e3('0x1b'));}if(!_0x424787){setTimeout(this['push'][_0x74e3('0x7')](this),0x3e8);}};function agent(_0x50ddff,_0x20aec3,_0x479437,_0x545087){return new Agent(_0x50ddff,_0x20aec3,_0x479437,_0x545087);}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 2dd2cdb..4dd8a94 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 _0x6dac=['busy','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','busyQueue','lodash','./util','../../../../../config/logger','notificationId','routing','push','handleRun','bind','timeout','squeue','drained','prototype','handleDrained','handleTimeout','queue','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','realtime','channel','writeLog','RINGING'];(function(_0x314acb,_0x296f21){var _0x448b99=function(_0x20cfb1){while(--_0x20cfb1){_0x314acb['push'](_0x314acb['shift']());}};_0x448b99(++_0x296f21);}(_0x6dac,0x17e));var _0xc6da=function(_0x3617dd,_0x57c3e9){_0x3617dd=_0x3617dd-0x0;var _0x13154b=_0x6dac[_0x3617dd];return _0x13154b;};'use strict';var _=require(_0xc6da('0x0'));var uuid=require('uuid');var util=require(_0xc6da('0x1'));var logger=require(_0xc6da('0x2'))('routing');var Beepall=function(_0x39ba76,_0x467de1,_0x2010a8,_0x4aceac){this[_0xc6da('0x3')]=uuid['v4']();this['squeue']=_0x39ba76;this['queue']=_0x467de1;this['realtime']=_0x2010a8;this[_0xc6da('0x4')]=_0x4aceac;this['squeue'][_0xc6da('0x5')](this[_0xc6da('0x6')][_0xc6da('0x7')](this),this['handleTimeout'][_0xc6da('0x7')](this));this['squeue']['on'](_0xc6da('0x8'),this['handleTimeout']['bind'](this));this[_0xc6da('0x9')]['on'](_0xc6da('0xa'),this['handleDrained'][_0xc6da('0x7')](this));};Beepall[_0xc6da('0xb')][_0xc6da('0x5')]=function(){this[_0xc6da('0x9')][_0xc6da('0x5')](this['handleRun']['bind'](this),this['handleTimeout'][_0xc6da('0x7')](this));};Beepall['prototype'][_0xc6da('0xc')]=function(_0x467052){this[_0xc6da('0xd')](!![]);};Beepall[_0xc6da('0xb')]['handleRun']=function(_0x5937d6){var _0x1b4b8d=!![];if(!_['isNil'](this[_0xc6da('0xe')])&&!_[_0xc6da('0xf')](this[_0xc6da('0xe')][_0xc6da('0x10')])&&this[_0xc6da('0xe')][_0xc6da('0x10')][_0xc6da('0x11')]>0x0){for(var _0x34e151=0x0,_0x10909;_0x34e1510x0){for(var _0x1c42f9=0x0,_0x11daa4;_0x1c42f90x0&&_0x3b8019[_0x1ef257+'CurrentCapacity']>=_0x3b8019[_0x1ef257+'Capacity']){writeLog(_0x4da1e3,_0x3b8019,_0x1ef257[_0xfbd5('0x25')]()+_0xfbd5('0x26'));return![];}}return!![];};exports[_0xfbd5('0x27')]=function(_0x353f43,_0x127197,_0x416cce,_0x4534be,_0x24ec67){return sendNotification(!![],_0x353f43,_0x127197,_0x416cce,_0x4534be,_0x24ec67);};exports['hideNotification']=function(_0x284301,_0x903794,_0x195f41,_0x3a18d8,_0x4c1d97){return sendNotification(![],_0x284301,_0x903794,_0x195f41,_0x3a18d8,_0x4c1d97);};exports[_0xfbd5('0x28')]=writeLog; \ No newline at end of file +var _0xc36d=['online','Pause','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','routing','redis','localhost','socket.io-emitter','emit','format','user:%s','name','user:save','\x20interaction','account','notificationShake','body','queue','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','isAgentAvailable','busy','BUSY'];(function(_0x1dccba,_0x56ff10){var _0x588695=function(_0x224a52){while(--_0x224a52){_0x1dccba['push'](_0x1dccba['shift']());}};_0x588695(++_0x56ff10);}(_0xc36d,0x7d));var _0xdc36=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0xc36d[_0x3c6ae2];return _0x4edda;};'use strict';var _=require(_0xdc36('0x0'));var util=require(_0xdc36('0x1'));var utils=require(_0xdc36('0x2'));var Mustache=require(_0xdc36('0x3'));var Redis=require(_0xdc36('0x4'));var config=require(_0xdc36('0x5'));var logger=require('../../../../../config/logger')(_0xdc36('0x6'));config[_0xdc36('0x7')]=_['defaults'](config[_0xdc36('0x7')],{'host':_0xdc36('0x8'),'port':0x18eb});var io=require(_0xdc36('0x9'))(new Redis(config[_0xdc36('0x7')]));function emit(_0x6e4753,_0x571311,_0x20ba02){io['to'](_0x6e4753)[_0xdc36('0xa')](_0x571311,_0x20ba02);}function sendNotification(_0x2a0087,_0xdca7f7,_0x4f82be,_0x20d00a,_0x23956b,_0x573f8e){io['to'](util[_0xdc36('0xb')](_0xdc36('0xc'),_0x20d00a[_0xdc36('0xd')]))['emit'](_0xdc36('0xe'),_0x20d00a);var _0x18707d=_0x573f8e||{};var _0x4fda43=_0x4f82be['split']('.');var _0x3107bc={'uniqueid':_0xdca7f7,'channel':_0x4fda43[0x0],'id':_0x4fda43[0x1],'title':_0x4fda43[0x0]+_0xdc36('0xf'),'interactionId':_0x4fda43[0x2],'queue':_0x23956b?_0x23956b[_0xdc36('0xd')]:null,'sound':_0x18707d[_0xdc36('0x10')]['notificationSound'],'shake':_0x18707d[_0xdc36('0x10')][_0xdc36('0x11')]};try{if(!_0x18707d[_0xdc36('0x12')]){_0x18707d[_0xdc36('0x12')]={};}if(_0x23956b){_0x18707d[_0xdc36('0x12')][_0xdc36('0x13')]=_0x23956b;}else if(_0x18707d[_0xdc36('0x12')][_0xdc36('0x13')]){delete _0x18707d['body'][_0xdc36('0x13')];}_0x3107bc['msg']=utils['getMustacheRender'](_0x18707d['account'][_0xdc36('0x14')],_0x18707d);}catch(_0x25b960){_0x3107bc['msg']=_0xdc36('0x15');logger[_0xdc36('0x16')](util[_0xdc36('0xb')](_0xdc36('0x17'),_0xdca7f7,_0x25b960[_0xdc36('0x18')]));}io['to'](util[_0xdc36('0xb')]('user:%s',_0x20d00a[_0xdc36('0xd')]))[_0xdc36('0xa')](util['format'](_0xdc36('0x19'),_0x2a0087?_0xdc36('0x1a'):_0xdc36('0x1b')),_0x3107bc);}function writeLog(_0x5f15ef,_0x10aafb,_0x235a39){return logger['info'](util[_0xdc36('0xb')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x5f15ef,_0x10aafb['name'],_0x235a39));}exports[_0xdc36('0x1c')]=function(_0x2b39a2,_0x42c0d7,_0xda916b,_0x2d83c0){if(_0x42c0d7[_0xdc36('0x1d')]){writeLog(_0x2b39a2,_0x42c0d7,_0xdc36('0x1e'));return![];}if(!_0x42c0d7[_0xdc36('0x1f')]){writeLog(_0x2b39a2,_0x42c0d7,'OFFLINE');return![];}if(_0x42c0d7[_0xda916b+_0xdc36('0x20')]){writeLog(_0x2b39a2,_0x42c0d7,'PAUSE');return![];}if(_0x2d83c0&&_0x42c0d7[_0xdc36('0x21')](_0xda916b+_0xdc36('0x22'))&&_0x42c0d7[_0xdc36('0x21')](_0xda916b+'CurrentCapacity')){if(_0x42c0d7[_0xda916b+_0xdc36('0x22')]>0x0&&_0x42c0d7[_0xda916b+_0xdc36('0x23')]>=_0x42c0d7[_0xda916b+_0xdc36('0x22')]){writeLog(_0x2b39a2,_0x42c0d7,_0xda916b['toUpperCase']()+_0xdc36('0x24'));return![];}}return!![];};exports[_0xdc36('0x25')]=function(_0x2a596d,_0x5f3b20,_0x3c39e3,_0x2dcef7,_0x4b15b4){return sendNotification(!![],_0x2a596d,_0x5f3b20,_0x3c39e3,_0x2dcef7,_0x4b15b4);};exports[_0xdc36('0x26')]=function(_0x12fed2,_0x4ea2ad,_0x21151b,_0x5bba0b,_0x49bbf2){return sendNotification(![],_0x12fed2,_0x4ea2ad,_0x21151b,_0x5bba0b,_0x49bbf2);};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 e8565b3..6896cea 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 _0x9caf=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','./utils','../../../../config/logger','string'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x9caf,0x1ab));var _0xf9ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9caf[_0x14add3];return _0x4a174f;};'use strict';var schema=require(_0xf9ca('0x0'));var sh=require(_0xf9ca('0x1'));var _=require('lodash');var utils=require(_0xf9ca('0x2'));var logger=require(_0xf9ca('0x3'))('routing');var system=schema({'command':{'type':_0xf9ca('0x4'),'required':!![],'message':_0xf9ca('0x5')}});exports['consequence']=function(_0x5e2fb5,_0x47b038){return function(_0x22c2d9){try{var _0x4e0443={'command':_0x47b038[0x0]};var _0x499ff8=system[_0xf9ca('0x0')](_0x4e0443,{'typecast':!![]});if(_0x499ff8['length']){logger['error']('[%s][SYSTEM]\x20%s',_0x5e2fb5,_[_0xf9ca('0x6')](_0x499ff8,_0xf9ca('0x7'))['join'](',\x20'));logger[_0xf9ca('0x8')](_0xf9ca('0x9'),_0x5e2fb5);_0x22c2d9[_0xf9ca('0xa')]();}else{var _0x5af07d=this;var _0x420ea9=utils[_0xf9ca('0xb')](_0x47b038[0x0],this);logger[_0xf9ca('0x8')](_0xf9ca('0xc'),_0x5e2fb5,_0x420ea9);sh[_0xf9ca('0xd')](_[_0xf9ca('0xe')](_0x420ea9),function(_0x5978ef,_0x42954c){logger[_0xf9ca('0x8')](_0xf9ca('0xf'),_0x5e2fb5,_0x5978ef);if(_0x5978ef==0x0){var _0x70b16e=_0x42954c[_0xf9ca('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0xf9ca('0x11')](_0x47b038[0x1])||_[_0xf9ca('0x12')](_0x47b038[0x1])){logger[_0xf9ca('0x8')]('[%s][SYSTEM]\x20no\x20variable',_0x5e2fb5);_0x5af07d[_0xf9ca('0x13')][_0x47b038[0x1]]=_0x70b16e;}else{logger[_0xf9ca('0x8')](_0xf9ca('0x14'),_0x5e2fb5,_0x47b038[0x1],_0x70b16e);_0x5af07d['body'][_0x47b038[0x1]]=_0x70b16e;}}_0x22c2d9[_0xf9ca('0xa')]();});}}catch(_0x3e9752){logger['error'](_0xf9ca('0x15'),_0x5e2fb5,_[_0xf9ca('0x16')](_0x3e9752)?JSON[_0xf9ca('0x17')](_0x3e9752):_0x3e9752);logger[_0xf9ca('0x8')](_0xf9ca('0x9'),_0x5e2fb5);_0x22c2d9['next']();}};}; \ No newline at end of file +var _0x7b45=['exec','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next'];(function(_0x52d1d4,_0x55083b){var _0x3d1ca0=function(_0x2f84c7){while(--_0x2f84c7){_0x52d1d4['push'](_0x52d1d4['shift']());}};_0x3d1ca0(++_0x55083b);}(_0x7b45,0x105));var _0x57b4=function(_0x25ebc2,_0x134562){_0x25ebc2=_0x25ebc2-0x0;var _0x5b193e=_0x7b45[_0x25ebc2];return _0x5b193e;};'use strict';var schema=require(_0x57b4('0x0'));var sh=require(_0x57b4('0x1'));var _=require(_0x57b4('0x2'));var utils=require(_0x57b4('0x3'));var logger=require(_0x57b4('0x4'))(_0x57b4('0x5'));var system=schema({'command':{'type':_0x57b4('0x6'),'required':!![],'message':_0x57b4('0x7')}});exports[_0x57b4('0x8')]=function(_0x35327c,_0x19e243){return function(_0x5b892b){try{var _0x7d6a59={'command':_0x19e243[0x0]};var _0x1b9cee=system[_0x57b4('0x0')](_0x7d6a59,{'typecast':!![]});if(_0x1b9cee[_0x57b4('0x9')]){logger[_0x57b4('0xa')](_0x57b4('0xb'),_0x35327c,_['map'](_0x1b9cee,'message')['join'](',\x20'));logger[_0x57b4('0xc')](_0x57b4('0xd'),_0x35327c);_0x5b892b[_0x57b4('0xe')]();}else{var _0x545d7f=this;var _0x542813=utils['getMustacheRender'](_0x19e243[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x35327c,_0x542813);sh[_0x57b4('0xf')](_['trim'](_0x542813),function(_0x17eea6,_0x583402){logger[_0x57b4('0xc')](_0x57b4('0x10'),_0x35327c,_0x17eea6);if(_0x17eea6==0x0){var _0x4901e7=_0x583402['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x57b4('0x11')](_0x19e243[0x1])||_[_0x57b4('0x12')](_0x19e243[0x1])){logger[_0x57b4('0xc')](_0x57b4('0x13'),_0x35327c);_0x545d7f[_0x57b4('0x14')][_0x19e243[0x1]]=_0x4901e7;}else{logger[_0x57b4('0xc')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x35327c,_0x19e243[0x1],_0x4901e7);_0x545d7f[_0x57b4('0x14')][_0x19e243[0x1]]=_0x4901e7;}}_0x5b892b['next']();});}}catch(_0x42636e){logger[_0x57b4('0xa')](_0x57b4('0xb'),_0x35327c,_[_0x57b4('0x15')](_0x42636e)?JSON[_0x57b4('0x16')](_0x42636e):_0x42636e);logger['info'](_0x57b4('0xd'),_0x35327c);_0x5b892b[_0x57b4('0xe')]();}};}; \ 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 f751cf5..435ae66 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x4cc863,_0x18a649){var _0x3ac6a5=function(_0x45feb0){while(--_0x45feb0){_0x4cc863['push'](_0x4cc863['shift']());}};_0x3ac6a5(++_0x18a649);}(_0x7a54,0x106));var _0x47a5=function(_0x15c2b6,_0x15ed1a){_0x15c2b6=_0x15c2b6-0x0;var _0xfab424=_0x7a54[_0x15c2b6];return _0xfab424;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file +var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x5c67eb,_0x41de7d){var _0x1b2881=function(_0x596b1f){while(--_0x596b1f){_0x5c67eb['push'](_0x5c67eb['shift']());}};_0x1b2881(++_0x41de7d);}(_0x7a54,0x106));var _0x47a5=function(_0x5776af,_0x3800dd){_0x5776af=_0x5776af-0x0;var _0x3db0fd=_0x7a54[_0x5776af];return _0x3db0fd;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index f77d077..75b2bb9 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 _0x3fec=['interaction','list','mustache','merge','message'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fec[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0xc3fe('0x0'));var _=require('lodash');module['exports']={'getMustacheRender':function(_0x3096c1,_0x1cd663){return Mustache['render'](_0x3096c1,_[_0xc3fe('0x1')](_0x1cd663['body'],{'contact':_0x1cd663['contact'],'message':_0x1cd663[_0xc3fe('0x2')],'account':_0x1cd663['account'],'interaction':_0x1cd663[_0xc3fe('0x3')],'list':_0x1cd663[_0xc3fe('0x4')]}))||'';}}; \ No newline at end of file +var _0x0434=['body','contact','message','account','interaction','list','mustache','lodash','exports'];(function(_0x475191,_0x5bce86){var _0x189e96=function(_0x46d6a2){while(--_0x46d6a2){_0x475191['push'](_0x475191['shift']());}};_0x189e96(++_0x5bce86);}(_0x0434,0x1ad));var _0x4043=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x0434[_0x11005e];return _0x29338f;};'use strict';var Mustache=require(_0x4043('0x0'));var _=require(_0x4043('0x1'));module[_0x4043('0x2')]={'getMustacheRender':function(_0x7e1828,_0x425361){return Mustache['render'](_0x7e1828,_['merge'](_0x425361[_0x4043('0x3')],{'contact':_0x425361[_0x4043('0x4')],'message':_0x425361[_0x4043('0x5')],'account':_0x425361[_0x4043('0x6')],'interaction':_0x425361[_0x4043('0x7')],'list':_0x425361[_0x4043('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 9a34d97..f081085 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 _0x8820=['./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','stringify','matchPath','complete','No\x20applications\x20to\x20execute','error','stack','emit','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','tag','%s:%s:%s'];(function(_0x3ae109,_0x14af4a){var _0x6cf6fe=function(_0x55208b){while(--_0x55208b){_0x3ae109['push'](_0x3ae109['shift']());}};_0x6cf6fe(++_0x14af4a);}(_0x8820,0x93));var _0x0882=function(_0x331dd8,_0x15e211){_0x331dd8=_0x331dd8-0x0;var _0x56408f=_0x8820[_0x331dd8];return _0x56408f;};'use strict';var _=require(_0x0882('0x0'));var util=require(_0x0882('0x1'));var path=require(_0x0882('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var uuid=require(_0x0882('0x3'));var config=require(_0x0882('0x4'));var logger=require(_0x0882('0x5'))(_0x0882('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport')};var rpc={'openchannelQueueReport':require(_0x0882('0x7')),'mailQueueReport':require(_0x0882('0x8')),'chatQueueReport':require(_0x0882('0x9')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x376279,_0x4f3666,_0x325db6){return util[_0x0882('0xa')](_0x0882('0xb'),_0x376279,_0x4f3666||0x0,_0x325db6||0x0);}function getIntervals(_0x478d9d,_0x2d31bf){var _0x46c0d4=[];if(!_[_0x0882('0xc')](_0x2d31bf[_0x0882('0xd')])&&!_[_0x0882('0xc')](_0x478d9d[_0x2d31bf[_0x0882('0xd')]])&&!_[_0x0882('0xc')](_0x478d9d[_0x2d31bf[_0x0882('0xd')]][_0x0882('0xe')])){_0x46c0d4=_[_0x0882('0xf')](_0x478d9d[_0x2d31bf[_0x0882('0xd')]]['Intervals'],_0x0882('0x10'));}else if(!_['isNil'](_0x2d31bf['interval'])){_0x46c0d4=[_0x2d31bf[_0x0882('0x10')]];}return _0x46c0d4;}exports[_0x0882('0x11')]=function(_0x3a8541){_0x3a8541[_0x0882('0x12')]={};return new BPromise(function(_0x304d3d,_0x2f5985){var _0x2cf006={'Start':function(_0x5ee1ea){var _0x39d283=this;return new Promise(function(_0x3838d2,_0x163a96){if(_0x5ee1ea){try{var _0x277d59=[];var _0x34b0c2=getId(_0x5ee1ea[_0x0882('0x13')],_0x5ee1ea['message']?_0x5ee1ea[_0x0882('0x14')]['id']:0x0,_0x5ee1ea[_0x0882('0x15')]?_0x5ee1ea['interaction']['id']:0x0);if(_0x5ee1ea[_0x0882('0x16')]&&_[_0x0882('0x17')](_0x5ee1ea[_0x0882('0x16')])&&_0x5ee1ea[_0x0882('0x16')]['length']){for(var _0x4c6cb6=0x0;_0x4c6cb6<_0x5ee1ea[_0x0882('0x16')][_0x0882('0x18')];_0x4c6cb6+=0x1){var _0x5f55ad=_0x5ee1ea[_0x0882('0x16')][_0x4c6cb6];if(fs[_0x0882('0x19')](path[_0x0882('0x1a')](__dirname,_0x0882('0x16'),_0x5f55ad[_0x0882('0x1b')]+'.js'))){var _0x147950=[];switch(_0x5f55ad[_0x0882('0x1b')][_0x0882('0x1c')]()){case _0x0882('0x1d'):var _0x30038e=_0x5f55ad[_0x0882('0x1e')][_0x0882('0x1f')](',');_0x147950[_0x0882('0x20')](_0x30038e[0x0]);_0x147950['push'](_0x30038e[_0x0882('0x21')](0x1,_0x30038e['length'])[_0x0882('0x1a')](','));break;case _0x0882('0x22'):var _0xdf6a25=_0x5f55ad[_0x0882('0x1e')][_0x0882('0x1f')](',');_0x147950[_0x0882('0x20')](_0xdf6a25[0x0]);_0x147950['push'](_0xdf6a25[0x1]);_0x147950[_0x0882('0x20')](_0xdf6a25[_0x0882('0x21')](0x2,_0xdf6a25[_0x0882('0x18')])[_0x0882('0x1a')](','));break;case'amazonlex':var _0x182369=_0x5f55ad['appdata'][_0x0882('0x1f')](',');_0x147950['push'](_0x182369[0x0]);_0x147950[_0x0882('0x20')](_0x182369[0x1]);_0x147950[_0x0882('0x20')](_0x182369[0x2]);_0x147950[_0x0882('0x20')](_0x182369[0x3]);_0x147950['push'](_0x182369[_0x0882('0x21')](0x4,_0x182369['length'])[_0x0882('0x1a')](','));break;case _0x0882('0x14'):_0x147950[_0x0882('0x20')](_0x5f55ad[_0x0882('0x1e')]);break;case _0x0882('0x23'):_0x147950[_0x0882('0x20')](_0x5f55ad['TagId']);_0x147950[_0x0882('0x20')](_0x5f55ad[_0x0882('0x1e')]);break;default:_0x147950=_[_0x0882('0xc')](_0x5f55ad[_0x0882('0x1e')])?[]:_0x5f55ad['appdata'][_0x0882('0x1f')](',');}var _0x3b9c24={'id':util['format'](_0x0882('0x24'),_0x34b0c2,_0x5f55ad['id'],_0x5f55ad[_0x0882('0x1b')]),'condition':require(_0x0882('0x25'))[_0x0882('0x26')](_0x34b0c2,getIntervals(_0x3a8541[_0x0882('0x27')],_0x5f55ad),_0x3a8541),'consequence':require(_0x0882('0x28')+_0x5f55ad[_0x0882('0x1b')])[_0x0882('0x29')](_0x34b0c2,_0x147950,_0x3a8541,_0x5ee1ea),'p':_0x5f55ad[_0x0882('0x2a')]||0x0};logger[_0x0882('0x2b')](_0x0882('0x2c'),_0x3b9c24['id'],_0x0882('0x2d'),getIntervals(_0x3a8541['intervals'],_0x5f55ad)['join']('\x20|\x20'));_0x277d59['push'](_0x3b9c24);}else{logger['error'](_0x0882('0x2e'),path['join'](__dirname,_0x0882('0x16'),_0x5f55ad[_0x0882('0x1b')]+_0x0882('0x2f')));}}_0x3a8541[_0x0882('0x12')][_0x34b0c2]=new RuleEngine(_0x277d59);_0x3a8541[_0x0882('0x12')][_0x34b0c2][_0x0882('0x30')](_0x5ee1ea,function(_0x190eaa){logger['info'](_0x0882('0x31'),JSON[_0x0882('0x32')](_0x190eaa[_0x0882('0x33')]));if(_0x3a8541[_0x0882('0x12')][_0x34b0c2]){_0x3a8541['rules'][_0x34b0c2]['emit'](_0x0882('0x34'));}});return _0x3838d2({'code':0xc8,'message':_0x5ee1ea});}else{logger[_0x0882('0x2b')](_0x0882('0x35'));return _0x3838d2({'code':0xc8,'message':_0x5ee1ea});}}catch(_0x3bb847){logger[_0x0882('0x36')](_0x3bb847[_0x0882('0x37')]);return _0x163a96(_0x39d283[_0x0882('0x36')](0x1f4,_0x3bb847));}}return _0x163a96('routing\x20is\x20empty');});},'AcceptMessage':function(_0x322c10){var _0x1a52a5=this;return new Promise(function(_0x42dfcf,_0x3b1978){if(_0x322c10['message']&&_0x322c10[_0x0882('0x14')]['id']){try{var _0x289b04=getId(_0x322c10[_0x0882('0x13')],_0x322c10['message']?_0x322c10['message']['id']:0x0,_0x322c10['interaction']?_0x322c10[_0x0882('0x15')]['id']:0x0);if(_0x3a8541[_0x0882('0x12')][_0x289b04]){_0x3a8541[_0x0882('0x12')][_0x289b04][_0x0882('0x38')](_0x0882('0x39'));if(rpc[_0x322c10[_0x0882('0x13')]+_0x0882('0x3a')]){rpc[_0x322c10[_0x0882('0x13')]+_0x0882('0x3a')][_0x0882('0x3b')](_0x289b04,{'UserId':_0x322c10[_0x0882('0x14')][_0x0882('0x3c')]})[_0x0882('0x3d')](function(_0x3c1f1a){logger[_0x0882('0x36')](_0x0882('0x3e'));});}}return _0x42dfcf({'code':0xc8,'message':_0x322c10});}catch(_0x3df6c5){logger[_0x0882('0x36')](_0x3df6c5[_0x0882('0x37')]);return _0x3b1978(_0x1a52a5[_0x0882('0x36')](0x1f4,_0x3df6c5));}}logger[_0x0882('0x36')](_0x0882('0x3f'));return _0x3b1978(_0x1a52a5[_0x0882('0x36')](0x1f4,_0x0882('0x3f')));});},'RejectMessage':function(_0x420210){var _0x6fd3df=this;return new Promise(function(_0x148117,_0x45799a){if(_0x420210['agent']&&_0x420210[_0x0882('0x40')]['id']){try{if(_0x3a8541[_0x0882('0x41')][_0x420210[_0x0882('0x40')]['id']]){_0x3a8541[_0x0882('0x41')][_0x420210[_0x0882('0x40')]['id']][_0x0882('0x42')]=![];_0x3a8541['agents'][_0x420210['agent']['id']]['busyQueue']=undefined;}return _0x148117({'code':0xc8,'message':_0x420210});}catch(_0x5d9f39){logger['error'](_0x5d9f39['stack']);return _0x45799a(_0x6fd3df['error'](0x1f4,_0x5d9f39));}}logger[_0x0882('0x36')]('message\x20is\x20empty');return _0x45799a(_0x6fd3df[_0x0882('0x36')](0x1f4,_0x0882('0x3f')));});},'AbandonInteraction':function(_0x36aa3d){var _0x487c7c=this;return new Promise(function(_0x46f458,_0x2497d4){if(_0x36aa3d['channel']&&_0x36aa3d[_0x0882('0x15')]&&_0x36aa3d[_0x0882('0x15')]['id']){try{var _0x2eddd4=getId(_0x36aa3d['channel'],_0x36aa3d['message']?_0x36aa3d[_0x0882('0x14')]['id']:0x0,_0x36aa3d[_0x0882('0x15')]?_0x36aa3d[_0x0882('0x15')]['id']:0x0);if(_0x3a8541[_0x0882('0x12')][_0x2eddd4]){_0x3a8541[_0x0882('0x12')][_0x2eddd4]['emit'](_0x0882('0x39'));}return _0x46f458({'code':0xc8,'message':_0x36aa3d});}catch(_0x244876){logger[_0x0882('0x36')](_0x244876[_0x0882('0x37')]);return _0x2497d4(_0x487c7c[_0x0882('0x36')](0x1f4,_0x244876));}}logger['error'](_0x0882('0x3f'));return _0x2497d4(_0x487c7c[_0x0882('0x36')](0x1f4,_0x0882('0x3f')));});},'AgentCapacity':function(_0x9acd50){var _0x37ff00=this;return new Promise(function(_0x19c955,_0x1d868b){if(_0x3a8541[_0x0882('0x41')][_0x0882('0x43')](_0x9acd50['id'])){for(var _0x4a2b92 in _0x9acd50[_0x0882('0x44')]){if(_0x9acd50[_0x0882('0x44')][_0x0882('0x43')](_0x4a2b92)){if(_0x3a8541[_0x0882('0x41')][_0x9acd50['id']][_0x0882('0x43')](_0x4a2b92+_0x0882('0x45'))){_0x3a8541['agents'][_0x9acd50['id']][_0x4a2b92+_0x0882('0x45')]=parseInt(_0x9acd50[_0x0882('0x44')][_0x4a2b92],0xa);}}}_0x3a8541[_0x0882('0x41')][_0x9acd50['id']][_0x0882('0x46')]();return _0x19c955({'code':0xc8,'message':_0x3a8541['agents'][_0x9acd50['id']]});}else{return _0x1d868b(_0x37ff00[_0x0882('0x36')](0x1f4,_0x0882('0x47')));}});},'Agents':function(_0x337abf){return new Promise(function(_0x138c59,_0x31dae4){var _0x3a4b84=_[_0x0882('0x48')](_0x3a8541['agents']);_0x138c59({'count':_0x3a4b84[_0x0882('0x18')],'rows':_0x3a4b84});});},'ChatQueues':function(_0x507064){return new Promise(function(_0x25ee36,_0xb81bb5){var _0x37bdce=[];for(var _0x4bdf25 in _0x3a8541['chatQueues']){if(_0x3a8541[_0x0882('0x49')][_0x0882('0x43')](_0x4bdf25)){var _0x804536=_0x3a8541[_0x0882('0x49')][_0x4bdf25];var _0x329c0e={'id':_0x804536['id'],'available':_0x804536[_0x0882('0x4a')],'loggedIn':_0x804536[_0x0882('0x4b')],'name':_0x804536['name'],'paused':_0x804536[_0x0882('0x4c')],'waiting':_0x804536[_0x0882('0x4d')]};_0x37bdce['push'](_0x329c0e);}}_0x25ee36({'count':_0x37bdce['length'],'rows':_0x37bdce});});},'MailQueues':function(_0x10794f){return new Promise(function(_0x5c1b06,_0x32ce75){var _0x2a63f3=[];for(var _0x492679 in _0x3a8541['mailQueues']){if(_0x3a8541[_0x0882('0x4e')][_0x0882('0x43')](_0x492679)){var _0x39eaa0=_0x3a8541[_0x0882('0x4e')][_0x492679];var _0x49bcbe={'id':_0x39eaa0['id'],'available':_0x39eaa0['available'],'loggedIn':_0x39eaa0[_0x0882('0x4b')],'name':_0x39eaa0[_0x0882('0x4f')],'paused':_0x39eaa0[_0x0882('0x4c')],'waiting':_0x39eaa0['waiting']};_0x2a63f3['push'](_0x49bcbe);}}_0x5c1b06({'count':_0x2a63f3[_0x0882('0x18')],'rows':_0x2a63f3});});},'OpenchannelQueues':function(_0x2e6dbf){return new Promise(function(_0x198283,_0x489eb3){var _0x33e201=[];for(var _0x1d962f in _0x3a8541[_0x0882('0x50')]){if(_0x3a8541[_0x0882('0x50')]['hasOwnProperty'](_0x1d962f)){var _0x20aab2=_0x3a8541[_0x0882('0x50')][_0x1d962f];var _0x3d4a80={'id':_0x20aab2['id'],'available':_0x20aab2[_0x0882('0x4a')],'loggedIn':_0x20aab2[_0x0882('0x4b')],'name':_0x20aab2['name'],'paused':_0x20aab2[_0x0882('0x4c')],'waiting':_0x20aab2[_0x0882('0x4d')]};_0x33e201[_0x0882('0x20')](_0x3d4a80);}}_0x198283({'count':_0x33e201[_0x0882('0x18')],'rows':_0x33e201});});},'SmsQueues':function(_0x28132d){return new Promise(function(_0x1809f8,_0xbf5c0f){var _0x3d50e8=[];for(var _0x4307df in _0x3a8541['smsQueues']){if(_0x3a8541[_0x0882('0x51')][_0x0882('0x43')](_0x4307df)){var _0x1d0c34=_0x3a8541[_0x0882('0x51')][_0x4307df];var _0x104458={'id':_0x1d0c34['id'],'available':_0x1d0c34[_0x0882('0x4a')],'loggedIn':_0x1d0c34['loggedIn'],'name':_0x1d0c34[_0x0882('0x4f')],'paused':_0x1d0c34[_0x0882('0x4c')],'waiting':_0x1d0c34[_0x0882('0x4d')]};_0x3d50e8[_0x0882('0x20')](_0x104458);}}_0x1809f8({'count':_0x3d50e8[_0x0882('0x18')],'rows':_0x3d50e8});});},'FaxQueues':function(_0x5bab35){return new Promise(function(_0x5f3dfb,_0xbd199b){var _0x5cb9b3=[];for(var _0x49dfc6 in _0x3a8541[_0x0882('0x52')]){if(_0x3a8541['faxQueues'][_0x0882('0x43')](_0x49dfc6)){var _0x17d604=_0x3a8541['faxQueues'][_0x49dfc6];var _0x485bda={'id':_0x17d604['id'],'available':_0x17d604[_0x0882('0x4a')],'loggedIn':_0x17d604[_0x0882('0x4b')],'name':_0x17d604[_0x0882('0x4f')],'paused':_0x17d604[_0x0882('0x4c')],'waiting':_0x17d604['waiting']};_0x5cb9b3[_0x0882('0x20')](_0x485bda);}}_0x5f3dfb({'count':_0x5cb9b3['length'],'rows':_0x5cb9b3});});},'ChatQueuesWaitingInteractions':function(_0x9bbeed){return new Promise(function(_0x28d49c,_0x38c7c4){var _0x138c85=_[_0x0882('0x48')](_0x3a8541[_0x0882('0x53')]);_0x28d49c({'count':_0x138c85['length'],'rows':_0x138c85});});},'MailQueuesWaitingInteractions':function(_0x5670e3){return new Promise(function(_0x476105,_0x18a99e){var _0x576ac2=_[_0x0882('0x48')](_0x3a8541[_0x0882('0x54')]);_0x476105({'count':_0x576ac2[_0x0882('0x18')],'rows':_0x576ac2});});},'OpenchannelQueuesWaitingInteractions':function(_0x222033){return new Promise(function(_0x22220c,_0x4e82c5){var _0x38c62e=_[_0x0882('0x48')](_0x3a8541[_0x0882('0x55')]);_0x22220c({'count':_0x38c62e[_0x0882('0x18')],'rows':_0x38c62e});});},'SmsQueuesWaitingInteractions':function(_0x1a130c){return new Promise(function(_0x200a19,_0x2cf9b2){var _0x5d1e52=_[_0x0882('0x48')](_0x3a8541[_0x0882('0x56')]);_0x200a19({'count':_0x5d1e52[_0x0882('0x18')],'rows':_0x5d1e52});});},'FaxQueuesWaitingInteractions':function(_0x105d80){return new Promise(function(_0x5bf32e,_0x5cf7c0){var _0x32a4a9=_[_0x0882('0x48')](_0x3a8541[_0x0882('0x57')]);_0x5bf32e({'count':_0x32a4a9[_0x0882('0x18')],'rows':_0x32a4a9});});}};var _0x299aa7=jayson[_0x0882('0x58')](_0x2cf006)['http']();_0x299aa7['on'](_0x0882('0x36'),function(_0x150740){logger['error'](JSON[_0x0882('0x32')](_0x150740));return _0x2f5985(_0x150740);});_0x299aa7['listen'](0x232c,_0x0882('0x59'),function(){console[_0x0882('0x5a')](_0x0882('0x5b'),0x232c);return _0x304d3d('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0x1e6f=['faxQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','listen','rules','interaction','applications','length','join','app','.js','toLowerCase','autoreply','appdata','split','push','amazonlex','message','tag','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','channel','end','QueueReport','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','values','chatQueues','loggedIn','paused','waiting','mailQueues','available','name','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions'];(function(_0xa485a3,_0x4bc610){var _0x355506=function(_0x33f113){while(--_0x33f113){_0xa485a3['push'](_0xa485a3['shift']());}};_0x355506(++_0x4bc610);}(_0x1e6f,0x16a));var _0xf1e6=function(_0xa9faf7,_0x3dcbde){_0xa9faf7=_0xa9faf7-0x0;var _0x48cfa2=_0x1e6f[_0xa9faf7];return _0x48cfa2;};'use strict';var _=require(_0xf1e6('0x0'));var util=require('util');var path=require(_0xf1e6('0x1'));var fs=require('fs');var jayson=require(_0xf1e6('0x2'));var BPromise=require(_0xf1e6('0x3'));var uuid=require('uuid');var config=require(_0xf1e6('0x4'));var logger=require('../../../config/logger')(_0xf1e6('0x5'));var rpc={'openchannelQueueReport':require(_0xf1e6('0x6'))};var rpc={'openchannelQueueReport':require(_0xf1e6('0x6')),'mailQueueReport':require(_0xf1e6('0x7')),'chatQueueReport':require(_0xf1e6('0x8')),'smsQueueReport':require(_0xf1e6('0x9')),'faxQueueReport':require(_0xf1e6('0xa'))};var RuleEngine=require(_0xf1e6('0xb'));function getId(_0x40fd0a,_0x34a2b9,_0x2cde5a){return util[_0xf1e6('0xc')]('%s.%s.%s',_0x40fd0a,_0x34a2b9||0x0,_0x2cde5a||0x0);}function getIntervals(_0x1b8ca4,_0xe1708f){var _0x4b56f7=[];if(!_[_0xf1e6('0xd')](_0xe1708f[_0xf1e6('0xe')])&&!_['isNil'](_0x1b8ca4[_0xe1708f[_0xf1e6('0xe')]])&&!_[_0xf1e6('0xd')](_0x1b8ca4[_0xe1708f[_0xf1e6('0xe')]][_0xf1e6('0xf')])){_0x4b56f7=_[_0xf1e6('0x10')](_0x1b8ca4[_0xe1708f[_0xf1e6('0xe')]][_0xf1e6('0xf')],'interval');}else if(!_['isNil'](_0xe1708f[_0xf1e6('0x11')])){_0x4b56f7=[_0xe1708f[_0xf1e6('0x11')]];}return _0x4b56f7;}exports[_0xf1e6('0x12')]=function(_0x4ac472){_0x4ac472[_0xf1e6('0x13')]={};return new BPromise(function(_0x18477c,_0x217853){var _0x33b7be={'Start':function(_0x12e3e2){var _0x15ebee=this;return new Promise(function(_0x41e05c,_0x109ac4){if(_0x12e3e2){try{var _0x564788=[];var _0x60cede=getId(_0x12e3e2['channel'],_0x12e3e2['message']?_0x12e3e2['message']['id']:0x0,_0x12e3e2[_0xf1e6('0x14')]?_0x12e3e2['interaction']['id']:0x0);if(_0x12e3e2['applications']&&_['isArray'](_0x12e3e2[_0xf1e6('0x15')])&&_0x12e3e2['applications'][_0xf1e6('0x16')]){for(var _0x123f24=0x0;_0x123f24<_0x12e3e2[_0xf1e6('0x15')][_0xf1e6('0x16')];_0x123f24+=0x1){var _0x4b6a35=_0x12e3e2[_0xf1e6('0x15')][_0x123f24];if(fs['existsSync'](path[_0xf1e6('0x17')](__dirname,_0xf1e6('0x15'),_0x4b6a35[_0xf1e6('0x18')]+_0xf1e6('0x19')))){var _0x3e4e79=[];switch(_0x4b6a35[_0xf1e6('0x18')][_0xf1e6('0x1a')]()){case _0xf1e6('0x1b'):var _0x1c8438=_0x4b6a35[_0xf1e6('0x1c')][_0xf1e6('0x1d')](',');_0x3e4e79[_0xf1e6('0x1e')](_0x1c8438[0x0]);_0x3e4e79[_0xf1e6('0x1e')](_0x1c8438['slice'](0x1,_0x1c8438['length'])[_0xf1e6('0x17')](','));break;case'dialogflow':var _0x3ff392=_0x4b6a35[_0xf1e6('0x1c')][_0xf1e6('0x1d')](',');_0x3e4e79[_0xf1e6('0x1e')](_0x3ff392[0x0]);_0x3e4e79[_0xf1e6('0x1e')](_0x3ff392[0x1]);_0x3e4e79[_0xf1e6('0x1e')](_0x3ff392['slice'](0x2,_0x3ff392[_0xf1e6('0x16')])[_0xf1e6('0x17')](','));break;case _0xf1e6('0x1f'):var _0x8b2cba=_0x4b6a35['appdata'][_0xf1e6('0x1d')](',');_0x3e4e79['push'](_0x8b2cba[0x0]);_0x3e4e79[_0xf1e6('0x1e')](_0x8b2cba[0x1]);_0x3e4e79['push'](_0x8b2cba[0x2]);_0x3e4e79[_0xf1e6('0x1e')](_0x8b2cba[0x3]);_0x3e4e79[_0xf1e6('0x1e')](_0x8b2cba['slice'](0x4,_0x8b2cba['length'])[_0xf1e6('0x17')](','));break;case _0xf1e6('0x20'):_0x3e4e79[_0xf1e6('0x1e')](_0x4b6a35[_0xf1e6('0x1c')]);break;case _0xf1e6('0x21'):_0x3e4e79['push'](_0x4b6a35['TagId']);_0x3e4e79[_0xf1e6('0x1e')](_0x4b6a35[_0xf1e6('0x1c')]);break;default:_0x3e4e79=_[_0xf1e6('0xd')](_0x4b6a35[_0xf1e6('0x1c')])?[]:_0x4b6a35[_0xf1e6('0x1c')][_0xf1e6('0x1d')](',');}var _0x16477a={'id':util[_0xf1e6('0xc')](_0xf1e6('0x22'),_0x60cede,_0x4b6a35['id'],_0x4b6a35[_0xf1e6('0x18')]),'condition':require(_0xf1e6('0x23'))[_0xf1e6('0x24')](_0x60cede,getIntervals(_0x4ac472[_0xf1e6('0x25')],_0x4b6a35),_0x4ac472),'consequence':require(_0xf1e6('0x26')+_0x4b6a35[_0xf1e6('0x18')])[_0xf1e6('0x27')](_0x60cede,_0x3e4e79,_0x4ac472,_0x12e3e2),'p':_0x4b6a35[_0xf1e6('0x28')]||0x0};logger[_0xf1e6('0x29')](_0xf1e6('0x2a'),_0x16477a['id'],_0xf1e6('0x2b'),getIntervals(_0x4ac472[_0xf1e6('0x25')],_0x4b6a35)['join'](_0xf1e6('0x2c')));_0x564788['push'](_0x16477a);}else{logger[_0xf1e6('0x2d')](_0xf1e6('0x2e'),path[_0xf1e6('0x17')](__dirname,_0xf1e6('0x15'),_0x4b6a35[_0xf1e6('0x18')]+_0xf1e6('0x19')));}}_0x4ac472[_0xf1e6('0x13')][_0x60cede]=new RuleEngine(_0x564788);_0x4ac472[_0xf1e6('0x13')][_0x60cede][_0xf1e6('0x2f')](_0x12e3e2,function(_0x5f173c){logger[_0xf1e6('0x29')]('Applications\x20executed',JSON['stringify'](_0x5f173c[_0xf1e6('0x30')]));if(_0x4ac472[_0xf1e6('0x13')][_0x60cede]){_0x4ac472[_0xf1e6('0x13')][_0x60cede][_0xf1e6('0x31')](_0xf1e6('0x32'));}});return _0x41e05c({'code':0xc8,'message':_0x12e3e2});}else{logger['info'](_0xf1e6('0x33'));return _0x41e05c({'code':0xc8,'message':_0x12e3e2});}}catch(_0x5452aa){logger[_0xf1e6('0x2d')](_0x5452aa[_0xf1e6('0x34')]);return _0x109ac4(_0x15ebee[_0xf1e6('0x2d')](0x1f4,_0x5452aa));}}return _0x109ac4(_0xf1e6('0x35'));});},'AcceptMessage':function(_0x3276d1){var _0xe46222=this;return new Promise(function(_0x363015,_0x5c7157){if(_0x3276d1[_0xf1e6('0x20')]&&_0x3276d1[_0xf1e6('0x20')]['id']){try{var _0x2fdef8=getId(_0x3276d1[_0xf1e6('0x36')],_0x3276d1['message']?_0x3276d1['message']['id']:0x0,_0x3276d1[_0xf1e6('0x14')]?_0x3276d1[_0xf1e6('0x14')]['id']:0x0);if(_0x4ac472[_0xf1e6('0x13')][_0x2fdef8]){_0x4ac472['rules'][_0x2fdef8][_0xf1e6('0x31')](_0xf1e6('0x37'));if(rpc[_0x3276d1[_0xf1e6('0x36')]+_0xf1e6('0x38')]){rpc[_0x3276d1[_0xf1e6('0x36')]+_0xf1e6('0x38')]['update'](_0x2fdef8,{'UserId':_0x3276d1[_0xf1e6('0x20')]['UserId']})[_0xf1e6('0x39')](function(_0x42ad1b){logger[_0xf1e6('0x2d')](_0xf1e6('0x3a'));});}}return _0x363015({'code':0xc8,'message':_0x3276d1});}catch(_0x5ed7a5){logger[_0xf1e6('0x2d')](_0x5ed7a5['stack']);return _0x5c7157(_0xe46222['error'](0x1f4,_0x5ed7a5));}}logger[_0xf1e6('0x2d')]('message\x20is\x20empty');return _0x5c7157(_0xe46222[_0xf1e6('0x2d')](0x1f4,_0xf1e6('0x3b')));});},'RejectMessage':function(_0xccffb9){var _0x477d22=this;return new Promise(function(_0x418835,_0x45a902){if(_0xccffb9['agent']&&_0xccffb9[_0xf1e6('0x3c')]['id']){try{if(_0x4ac472[_0xf1e6('0x3d')][_0xccffb9[_0xf1e6('0x3c')]['id']]){_0x4ac472[_0xf1e6('0x3d')][_0xccffb9['agent']['id']][_0xf1e6('0x3e')]=![];_0x4ac472[_0xf1e6('0x3d')][_0xccffb9[_0xf1e6('0x3c')]['id']][_0xf1e6('0x3f')]=undefined;}return _0x418835({'code':0xc8,'message':_0xccffb9});}catch(_0x5a555f){logger['error'](_0x5a555f['stack']);return _0x45a902(_0x477d22['error'](0x1f4,_0x5a555f));}}logger[_0xf1e6('0x2d')](_0xf1e6('0x3b'));return _0x45a902(_0x477d22['error'](0x1f4,_0xf1e6('0x3b')));});},'AbandonInteraction':function(_0xf84aba){var _0x57c17b=this;return new Promise(function(_0x4b30fe,_0x501224){if(_0xf84aba[_0xf1e6('0x36')]&&_0xf84aba[_0xf1e6('0x14')]&&_0xf84aba[_0xf1e6('0x14')]['id']){try{var _0x3e7692=getId(_0xf84aba[_0xf1e6('0x36')],_0xf84aba[_0xf1e6('0x20')]?_0xf84aba['message']['id']:0x0,_0xf84aba['interaction']?_0xf84aba['interaction']['id']:0x0);if(_0x4ac472['rules'][_0x3e7692]){_0x4ac472[_0xf1e6('0x13')][_0x3e7692]['emit']('end');}return _0x4b30fe({'code':0xc8,'message':_0xf84aba});}catch(_0x5ea765){logger[_0xf1e6('0x2d')](_0x5ea765[_0xf1e6('0x34')]);return _0x501224(_0x57c17b[_0xf1e6('0x2d')](0x1f4,_0x5ea765));}}logger['error'](_0xf1e6('0x3b'));return _0x501224(_0x57c17b[_0xf1e6('0x2d')](0x1f4,_0xf1e6('0x3b')));});},'AgentCapacity':function(_0x3b31f4){var _0x183c37=this;return new Promise(function(_0x46f680,_0x47ca08){if(_0x4ac472[_0xf1e6('0x3d')]['hasOwnProperty'](_0x3b31f4['id'])){for(var _0x224709 in _0x3b31f4['capacity']){if(_0x3b31f4[_0xf1e6('0x40')][_0xf1e6('0x41')](_0x224709)){if(_0x4ac472[_0xf1e6('0x3d')][_0x3b31f4['id']][_0xf1e6('0x41')](_0x224709+_0xf1e6('0x42'))){_0x4ac472[_0xf1e6('0x3d')][_0x3b31f4['id']][_0x224709+_0xf1e6('0x42')]=parseInt(_0x3b31f4[_0xf1e6('0x40')][_0x224709],0xa);}}}_0x4ac472[_0xf1e6('0x3d')][_0x3b31f4['id']][_0xf1e6('0x43')]();return _0x46f680({'code':0xc8,'message':_0x4ac472[_0xf1e6('0x3d')][_0x3b31f4['id']]});}else{return _0x47ca08(_0x183c37[_0xf1e6('0x2d')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x3b4ab0){return new Promise(function(_0x23513e,_0x46ef1d){var _0x36666c=_[_0xf1e6('0x44')](_0x4ac472[_0xf1e6('0x3d')]);_0x23513e({'count':_0x36666c[_0xf1e6('0x16')],'rows':_0x36666c});});},'ChatQueues':function(_0x4f2a5a){return new Promise(function(_0x83bdde,_0x38fbaa){var _0x58c598=[];for(var _0xacfd35 in _0x4ac472[_0xf1e6('0x45')]){if(_0x4ac472[_0xf1e6('0x45')][_0xf1e6('0x41')](_0xacfd35)){var _0x58db0b=_0x4ac472['chatQueues'][_0xacfd35];var _0x5494bf={'id':_0x58db0b['id'],'available':_0x58db0b['available'],'loggedIn':_0x58db0b[_0xf1e6('0x46')],'name':_0x58db0b['name'],'paused':_0x58db0b[_0xf1e6('0x47')],'waiting':_0x58db0b[_0xf1e6('0x48')]};_0x58c598[_0xf1e6('0x1e')](_0x5494bf);}}_0x83bdde({'count':_0x58c598[_0xf1e6('0x16')],'rows':_0x58c598});});},'MailQueues':function(_0x9eaac3){return new Promise(function(_0x1026e4,_0x544fd7){var _0x57a78f=[];for(var _0x30bcb0 in _0x4ac472[_0xf1e6('0x49')]){if(_0x4ac472['mailQueues']['hasOwnProperty'](_0x30bcb0)){var _0x22cc64=_0x4ac472['mailQueues'][_0x30bcb0];var _0x60d9c1={'id':_0x22cc64['id'],'available':_0x22cc64[_0xf1e6('0x4a')],'loggedIn':_0x22cc64[_0xf1e6('0x46')],'name':_0x22cc64[_0xf1e6('0x4b')],'paused':_0x22cc64[_0xf1e6('0x47')],'waiting':_0x22cc64[_0xf1e6('0x48')]};_0x57a78f[_0xf1e6('0x1e')](_0x60d9c1);}}_0x1026e4({'count':_0x57a78f['length'],'rows':_0x57a78f});});},'OpenchannelQueues':function(_0x2c638a){return new Promise(function(_0x38ae3a,_0x15a18b){var _0x540da5=[];for(var _0x4bddc1 in _0x4ac472['openchannelQueues']){if(_0x4ac472['openchannelQueues'][_0xf1e6('0x41')](_0x4bddc1)){var _0x2f3e6e=_0x4ac472[_0xf1e6('0x4c')][_0x4bddc1];var _0x21a9b2={'id':_0x2f3e6e['id'],'available':_0x2f3e6e[_0xf1e6('0x4a')],'loggedIn':_0x2f3e6e['loggedIn'],'name':_0x2f3e6e['name'],'paused':_0x2f3e6e[_0xf1e6('0x47')],'waiting':_0x2f3e6e['waiting']};_0x540da5['push'](_0x21a9b2);}}_0x38ae3a({'count':_0x540da5['length'],'rows':_0x540da5});});},'SmsQueues':function(_0x4e3e56){return new Promise(function(_0x44fe73,_0x1212c1){var _0x467b23=[];for(var _0x5e2eb0 in _0x4ac472['smsQueues']){if(_0x4ac472[_0xf1e6('0x4d')][_0xf1e6('0x41')](_0x5e2eb0)){var _0x166f1c=_0x4ac472['smsQueues'][_0x5e2eb0];var _0xc8d716={'id':_0x166f1c['id'],'available':_0x166f1c[_0xf1e6('0x4a')],'loggedIn':_0x166f1c['loggedIn'],'name':_0x166f1c[_0xf1e6('0x4b')],'paused':_0x166f1c[_0xf1e6('0x47')],'waiting':_0x166f1c[_0xf1e6('0x48')]};_0x467b23[_0xf1e6('0x1e')](_0xc8d716);}}_0x44fe73({'count':_0x467b23['length'],'rows':_0x467b23});});},'FaxQueues':function(_0x2ea4c3){return new Promise(function(_0x32a692,_0x4b8d1c){var _0x2d05c1=[];for(var _0x2f5df6 in _0x4ac472[_0xf1e6('0x4e')]){if(_0x4ac472['faxQueues'][_0xf1e6('0x41')](_0x2f5df6)){var _0x59fb5e=_0x4ac472['faxQueues'][_0x2f5df6];var _0x543fba={'id':_0x59fb5e['id'],'available':_0x59fb5e['available'],'loggedIn':_0x59fb5e[_0xf1e6('0x46')],'name':_0x59fb5e[_0xf1e6('0x4b')],'paused':_0x59fb5e[_0xf1e6('0x47')],'waiting':_0x59fb5e[_0xf1e6('0x48')]};_0x2d05c1[_0xf1e6('0x1e')](_0x543fba);}}_0x32a692({'count':_0x2d05c1['length'],'rows':_0x2d05c1});});},'ChatQueuesWaitingInteractions':function(_0x3d9031){return new Promise(function(_0x24205b,_0x15ec80){var _0x49e7eb=_[_0xf1e6('0x44')](_0x4ac472[_0xf1e6('0x4f')]);_0x24205b({'count':_0x49e7eb[_0xf1e6('0x16')],'rows':_0x49e7eb});});},'MailQueuesWaitingInteractions':function(_0xb22bca){return new Promise(function(_0x7c5600,_0x57417a){var _0x4e9961=_[_0xf1e6('0x44')](_0x4ac472[_0xf1e6('0x50')]);_0x7c5600({'count':_0x4e9961['length'],'rows':_0x4e9961});});},'OpenchannelQueuesWaitingInteractions':function(_0x324882){return new Promise(function(_0x1c33d8,_0x408f66){var _0x253c7d=_[_0xf1e6('0x44')](_0x4ac472[_0xf1e6('0x51')]);_0x1c33d8({'count':_0x253c7d[_0xf1e6('0x16')],'rows':_0x253c7d});});},'SmsQueuesWaitingInteractions':function(_0x1584a5){return new Promise(function(_0x51740b,_0x5355af){var _0x2cba97=_[_0xf1e6('0x44')](_0x4ac472[_0xf1e6('0x52')]);_0x51740b({'count':_0x2cba97[_0xf1e6('0x16')],'rows':_0x2cba97});});},'FaxQueuesWaitingInteractions':function(_0x55e1cf){return new Promise(function(_0x43f3bc,_0x4a01e0){var _0x43e17e=_['values'](_0x4ac472[_0xf1e6('0x53')]);_0x43f3bc({'count':_0x43e17e[_0xf1e6('0x16')],'rows':_0x43e17e});});}};var _0x25dabe=jayson[_0xf1e6('0x54')](_0x33b7be)[_0xf1e6('0x55')]();_0x25dabe['on'](_0xf1e6('0x2d'),function(_0x5cca50){logger[_0xf1e6('0x2d')](JSON['stringify'](_0x5cca50));return _0x217853(_0x5cca50);});_0x25dabe[_0xf1e6('0x12')](0x232c,'127.0.0.1',function(){console[_0xf1e6('0x56')](_0xf1e6('0x57'),0x232c);return _0x18477c(_0xf1e6('0x58')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index af084ea..afdc002 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 _0x137d=['condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','then','indexOf','catch','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','error','message'];(function(_0x36dbd0,_0x5ebaa6){var _0x19398c=function(_0x31244c){while(--_0x31244c){_0x36dbd0['push'](_0x36dbd0['shift']());}};_0x19398c(++_0x5ebaa6);}(_0x137d,0x8c));var _0xd137=function(_0x152136,_0x4f14f1){_0x152136=_0x152136-0x0;var _0x20df44=_0x137d[_0x152136];return _0x20df44;};'use strict';var util=require('util');var BPromise=require(_0xd137('0x0'));var jayson=require(_0xd137('0x1'));var _=require(_0xd137('0x2'));var logger=require(_0xd137('0x3'))(_0xd137('0x4'));var client=jayson[_0xd137('0x5')][_0xd137('0x6')]({'port':0x232a});function request(_0x3c3b1e,_0x1b491b){return new BPromise(function(_0x364141,_0x48b1fa){return client[_0xd137('0x7')](_0x3c3b1e,_0x1b491b)['then'](function(_0x47a113){if(_0x47a113[_0xd137('0x8')]){return _0x48b1fa(_0x47a113['error'][_0xd137('0x9')]);}else{return _0x364141(_0x47a113['result']);}})['catch'](function(_0x5cd0c7){return _0x48b1fa(_0x5cd0c7);});});}exports[_0xd137('0xa')]=function(_0x2866a9,_0x19b4a6,_0x1d2dcb){return function(_0x5bbded){if(_0x1d2dcb[_0xd137('0xb')]&&!_0x1d2dcb[_0xd137('0xb')][_0x2866a9]){logger['info'](_0xd137('0xc'),_0x2866a9);return _0x5bbded[_0xd137('0xd')]();}var _0xe2616=[];for(var _0x4e4f33=0x0;_0x4e4f33<_0x19b4a6[_0xd137('0xe')];_0x4e4f33+=0x1){_0xe2616[_0xd137('0xf')](request(_0xd137('0x10'),{'command':util[_0xd137('0x11')](_0xd137('0x12'),_0x19b4a6[_0x4e4f33])})[_0xd137('0x13')](function(_0x3d490b){return _0x3d490b&&_0x3d490b[_0xd137('0x9')]&&_0x3d490b[_0xd137('0x9')][_0xd137('0x14')]('true')>=0x0?!![]:![];})[_0xd137('0x15')](function(_0x2fc3af){logger[_0xd137('0x8')]('[%s][INTERVAL]\x20%s',_0x2866a9,_0x19b4a6[_0x4e4f33]);}));}BPromise[_0xd137('0x16')](_0xe2616)[_0xd137('0x13')](function(_0x15e3a8){var _0x43837b=_[_0xd137('0x17')](_0x15e3a8);logger[_0xd137('0x18')](_0xd137('0x19'),_0x2866a9,_0x19b4a6[_0xd137('0x1a')](_0xd137('0x1b')),_0x43837b);_0x5bbded[_0xd137('0x1c')](_0x43837b);})[_0xd137('0x15')](function(_0x27b61e){console['log'](_0x27b61e);logger[_0xd137('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x2866a9,_0x19b4a6[_0xd137('0x1a')](_0xd137('0x1b')),_0x27b61e[_0xd137('0x1d')]);_0x5bbded[_0xd137('0xd')]();});};}; \ No newline at end of file +var _0x4f56=['stack','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','error','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','format','iftime\x20%s','then','message','indexOf','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0x4f56,0x1b4));var _0x64f5=function(_0x3cd712,_0x53a450){_0x3cd712=_0x3cd712-0x0;var _0x5f1787=_0x4f56[_0x3cd712];return _0x5f1787;};'use strict';var util=require('util');var BPromise=require(_0x64f5('0x0'));var jayson=require(_0x64f5('0x1'));var _=require(_0x64f5('0x2'));var logger=require(_0x64f5('0x3'))(_0x64f5('0x4'));var client=jayson[_0x64f5('0x5')][_0x64f5('0x6')]({'port':0x232a});function request(_0x2e4a3e,_0x188547){return new BPromise(function(_0x251086,_0x91b5f6){return client[_0x64f5('0x7')](_0x2e4a3e,_0x188547)['then'](function(_0x387b67){if(_0x387b67['error']){return _0x91b5f6(_0x387b67[_0x64f5('0x8')]['message']);}else{return _0x251086(_0x387b67[_0x64f5('0x9')]);}})[_0x64f5('0xa')](function(_0x39dbb3){return _0x91b5f6(_0x39dbb3);});});}exports['condition']=function(_0x4da3a3,_0x3b5c13,_0x5cd57f){return function(_0x10b1f7){if(_0x5cd57f[_0x64f5('0xb')]&&!_0x5cd57f[_0x64f5('0xb')][_0x4da3a3]){logger[_0x64f5('0xc')](_0x64f5('0xd'),_0x4da3a3);return _0x10b1f7[_0x64f5('0xe')]();}var _0x16b45d=[];for(var _0x3fe9c2=0x0;_0x3fe9c2<_0x3b5c13['length'];_0x3fe9c2+=0x1){_0x16b45d[_0x64f5('0xf')](request(_0x64f5('0x10'),{'command':util[_0x64f5('0x11')](_0x64f5('0x12'),_0x3b5c13[_0x3fe9c2])})[_0x64f5('0x13')](function(_0x7b6170){return _0x7b6170&&_0x7b6170[_0x64f5('0x14')]&&_0x7b6170[_0x64f5('0x14')][_0x64f5('0x15')]('true')>=0x0?!![]:![];})[_0x64f5('0xa')](function(_0x3bcba9){logger[_0x64f5('0x8')]('[%s][INTERVAL]\x20%s',_0x4da3a3,_0x3b5c13[_0x3fe9c2]);}));}BPromise['all'](_0x16b45d)[_0x64f5('0x13')](function(_0x2e4473){var _0x19ed1e=_[_0x64f5('0x16')](_0x2e4473);logger[_0x64f5('0xc')](_0x64f5('0x17'),_0x4da3a3,_0x3b5c13[_0x64f5('0x18')](_0x64f5('0x19')),_0x19ed1e);_0x10b1f7[_0x64f5('0x1a')](_0x19ed1e);})['catch'](function(_0x29e214){console[_0x64f5('0x1b')](_0x29e214);logger[_0x64f5('0x8')](_0x64f5('0x17'),_0x4da3a3,_0x3b5c13[_0x64f5('0x18')](_0x64f5('0x19')),_0x29e214[_0x64f5('0x1c')]);_0x10b1f7['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index e5f46f5..f2cdff5 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 _0xf604=['agentcompleteAt','diffTime','blindtransfer','transfereruniqueid','transfer','blind','extension','transferuniqueid','attendedtransfer','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transferexten','origtransfereruniqueid','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','transfertype','secondtransfererexten','transfertargetuniqueid','hangup','agent','complete','lodash','util','./utils','info','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','type','agentcomplete','acw','acwtime','agentacw','request','CreateVoiceAgentReport','destuniqueid','agentcalledAt','now','called','connectedlinename','error','agentringnoanswer','isNil','agentringnoanswerAt','lastevent','reason','timeout','ringtime','talktime','stack','queuecallerabandon','forIn','abandoned','holdtime','agentconnect','agentconnectAt','answered_elsewhere','answeredelsewheremembername'];(function(_0x223a4c,_0x6198c4){var _0x37c89d=function(_0x362cf1){while(--_0x362cf1){_0x223a4c['push'](_0x223a4c['shift']());}};_0x37c89d(++_0x6198c4);}(_0xf604,0x1a4));var _0x4f60=function(_0x575228,_0x3f9bc1){_0x575228=_0x575228-0x0;var _0x4cb11e=_0xf604[_0x575228];return _0x4cb11e;};'use strict';var _=require(_0x4f60('0x0'));var util=require(_0x4f60('0x1'));var utils=require(_0x4f60('0x2'));var agents={};var transfers={};function writeDB(_0x425727,_0xf9173e){utils[_0x4f60('0x3')](util['format']('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x425727[_0x4f60('0x4')],_0x425727[_0x4f60('0x5')],_0x425727[_0x4f60('0x6')],_0x425727[_0x4f60('0x7')],_0x425727[_0x4f60('0x8')],_0x425727[_0x4f60('0x9')],_0x425727[_0x4f60('0xa')],_0x425727['lastevent']));if(_0x425727[_0x4f60('0x6')]){utils[_0x4f60('0xb')](_0x425727[_0x4f60('0x6')])['then'](function(_0x483cc7){if(_0x483cc7){_0x425727['type']=_0x483cc7[_0x4f60('0xc')];_0x425727['agentacw']=_0x425727[_0x4f60('0xd')]?_0x483cc7[_0x4f60('0xe')]:![];_0x425727[_0x4f60('0xf')]=_0x425727[_0x4f60('0x10')]?_0x483cc7['acwTimeout']:0x0;}utils['request']('CreateVoiceAgentReport',_0x425727);});}else{utils[_0x4f60('0x11')](_0x4f60('0x12'),_0x425727);}if(_0xf9173e){delete transfers[_0x425727[_0x4f60('0x4')]];}else{delete agents[_0x425727[_0x4f60('0x13')]];}}exports['agentcalled']=function(_0x2de1b4){try{agents[_0x2de1b4[_0x4f60('0x13')]]=_0x2de1b4;agents[_0x2de1b4['destuniqueid']][_0x4f60('0x14')]=utils[_0x4f60('0x15')]();agents[_0x2de1b4[_0x4f60('0x13')]]['lastevent']=_0x4f60('0x16');agents[_0x2de1b4[_0x4f60('0x13')]]['connectedlinenum']=null;agents[_0x2de1b4[_0x4f60('0x13')]][_0x4f60('0x17')]=null;}catch(_0x10a431){utils[_0x4f60('0x18')](_0x10a431['stack']);}};exports[_0x4f60('0x19')]=function(_0x47d38d){try{if(!_[_0x4f60('0x1a')](agents[_0x47d38d[_0x4f60('0x13')]])){agents[_0x47d38d['destuniqueid']][_0x4f60('0x19')]=!![];agents[_0x47d38d[_0x4f60('0x13')]][_0x4f60('0x1b')]=utils['now']();agents[_0x47d38d['destuniqueid']][_0x4f60('0x1c')]='timeout';agents[_0x47d38d['destuniqueid']][_0x4f60('0x1d')]=_0x4f60('0x1e');agents[_0x47d38d['destuniqueid']]['holdtime']=_0x47d38d['ringtime']?parseInt(_0x47d38d[_0x4f60('0x1f')])/0x3e8:0x0;agents[_0x47d38d[_0x4f60('0x13')]][_0x4f60('0x20')]=0x0;writeDB(agents[_0x47d38d['destuniqueid']]);}}catch(_0x430c73){utils[_0x4f60('0x18')](_0x430c73[_0x4f60('0x21')]);}};exports[_0x4f60('0x22')]=function(_0x2d3579){try{_[_0x4f60('0x23')](agents,function(_0x15f7a9,_0x34c6d7){if(_0x15f7a9[_0x4f60('0x4')]==_0x2d3579['uniqueid']){_0x15f7a9[_0x4f60('0x19')]=!![];_0x15f7a9['agentringnoanswerAt']=utils[_0x4f60('0x15')]();_0x15f7a9[_0x4f60('0x1c')]='abandoned';_0x15f7a9[_0x4f60('0x1d')]=_0x4f60('0x24');_0x15f7a9[_0x4f60('0x25')]=_0x2d3579[_0x4f60('0x25')];_0x15f7a9[_0x4f60('0x20')]=0x0;writeDB(_0x15f7a9);}});}catch(_0x3b24b8){utils[_0x4f60('0x18')](_0x3b24b8[_0x4f60('0x21')]);}};exports[_0x4f60('0x26')]=function(_0x48f41b){try{if(agents[_0x48f41b[_0x4f60('0x13')]]){agents[_0x48f41b[_0x4f60('0x13')]][_0x4f60('0x27')]=utils[_0x4f60('0x15')]();agents[_0x48f41b[_0x4f60('0x13')]][_0x4f60('0xa')]=_0x48f41b[_0x4f60('0xa')];agents[_0x48f41b[_0x4f60('0x13')]][_0x4f60('0x17')]=_0x48f41b[_0x4f60('0x17')];agents[_0x48f41b[_0x4f60('0x13')]][_0x4f60('0x25')]=_0x48f41b[_0x4f60('0x1f')];agents[_0x48f41b[_0x4f60('0x13')]][_0x4f60('0x1c')]='connect';_['forIn'](agents,function(_0x5b6343,_0x176fa0){if(_0x5b6343['destuniqueid']!=_0x48f41b[_0x4f60('0x13')]&&_0x5b6343[_0x4f60('0x4')]==_0x48f41b[_0x4f60('0x4')]){_0x5b6343[_0x4f60('0x20')]=0x0;_0x5b6343[_0x4f60('0x25')]=_0x48f41b[_0x4f60('0x1f')];_0x5b6343[_0x4f60('0x19')]=!![];_0x5b6343[_0x4f60('0x1b')]=utils['now']();_0x5b6343['lastevent']=_0x4f60('0x28');_0x5b6343[_0x4f60('0x1d')]=_0x4f60('0x28');_0x5b6343['answeredelsewheredestinationuniqueid']=_0x48f41b[_0x4f60('0x13')];_0x5b6343[_0x4f60('0x29')]=_0x48f41b[_0x4f60('0x7')];writeDB(_0x5b6343);}});}}catch(_0x5365b6){utils[_0x4f60('0x18')](_0x5365b6[_0x4f60('0x21')]);}};exports[_0x4f60('0xd')]=function(_0x4073f4){try{if(!_[_0x4f60('0x1a')](agents[_0x4073f4[_0x4f60('0x13')]])){agents[_0x4073f4['destuniqueid']][_0x4f60('0xd')]=!![];agents[_0x4073f4[_0x4f60('0x13')]][_0x4f60('0x2a')]=utils[_0x4f60('0x15')]();agents[_0x4073f4['destuniqueid']]['talktime']=utils[_0x4f60('0x2b')](agents[_0x4073f4[_0x4f60('0x13')]][_0x4f60('0x2a')],agents[_0x4073f4[_0x4f60('0x13')]][_0x4f60('0x27')]);agents[_0x4073f4[_0x4f60('0x13')]][_0x4f60('0x1d')]=_0x4073f4[_0x4f60('0x1d')];agents[_0x4073f4[_0x4f60('0x13')]][_0x4f60('0x1c')]='complete';writeDB(agents[_0x4073f4[_0x4f60('0x13')]]);}}catch(_0x4a4fa0){utils[_0x4f60('0x18')](_0x4a4fa0['stack']);}};exports[_0x4f60('0x2c')]=function(_0x40be17){try{if(!_[_0x4f60('0x1a')](agents[_0x40be17[_0x4f60('0x2d')]])){agents[_0x40be17[_0x4f60('0x2d')]][_0x4f60('0x2e')]=!![];agents[_0x40be17[_0x4f60('0x2d')]]['transfertype']=_0x4f60('0x2f');agents[_0x40be17[_0x4f60('0x2d')]]['transferexten']=_0x40be17[_0x4f60('0x30')];agents[_0x40be17[_0x4f60('0x2d')]][_0x4f60('0x31')]=agents[_0x40be17[_0x4f60('0x2d')]][_0x4f60('0x4')];}}catch(_0x3779f2){utils[_0x4f60('0x18')](_0x3779f2[_0x4f60('0x21')]);}};exports[_0x4f60('0x32')]=function(_0x5120dc){try{if(_0x5120dc['origtransfereruniqueid']==_0x5120dc[_0x4f60('0x33')]){if(!_[_0x4f60('0x1a')](agents[_0x5120dc[_0x4f60('0x34')]])){agents[_0x5120dc[_0x4f60('0x34')]][_0x4f60('0x2e')]=!![];agents[_0x5120dc[_0x4f60('0x34')]]['transfertype']=_0x4f60('0x35');agents[_0x5120dc[_0x4f60('0x34')]][_0x4f60('0x36')]=_0x5120dc['origtransfererexten'];agents[_0x5120dc[_0x4f60('0x34')]]['transferuniqueid']=_0x5120dc[_0x4f60('0x37')];}if(_0x5120dc['transfereeuniqueid']&&agents[_0x5120dc[_0x4f60('0x38')]]){agents[_0x5120dc[_0x4f60('0x38')]][_0x4f60('0x39')]=0x1;transfers[_0x5120dc[_0x4f60('0x38')]]=_['clone'](agents[_0x5120dc[_0x4f60('0x38')]]);transfers[_0x5120dc[_0x4f60('0x38')]][_0x4f60('0x9')]=agents[_0x5120dc[_0x4f60('0x34')]][_0x4f60('0x9')];transfers[_0x5120dc[_0x4f60('0x38')]][_0x4f60('0x3a')]=agents[_0x5120dc[_0x4f60('0x34')]]['calleridname'];transfers[_0x5120dc[_0x4f60('0x38')]][_0x4f60('0x14')]=utils['now']();transfers[_0x5120dc['transfereeuniqueid']][_0x4f60('0x27')]=utils[_0x4f60('0x15')]();transfers[_0x5120dc[_0x4f60('0x38')]][_0x4f60('0x25')]=0x0;transfers[_0x5120dc[_0x4f60('0x38')]][_0x4f60('0x39')]=0x2;}}else if(_0x5120dc[_0x4f60('0x34')]==_0x5120dc[_0x4f60('0x3b')]){if(!_[_0x4f60('0x1a')](agents[_0x5120dc[_0x4f60('0x37')]])){agents[_0x5120dc[_0x4f60('0x37')]][_0x4f60('0x2e')]=!![];agents[_0x5120dc[_0x4f60('0x37')]][_0x4f60('0x3c')]=_0x4f60('0x35');agents[_0x5120dc['origtransfereruniqueid']]['transferexten']=_0x5120dc[_0x4f60('0x3d')];agents[_0x5120dc[_0x4f60('0x37')]]['transferuniqueid']=_0x5120dc['secondtransfereruniqueid'];}if(_0x5120dc['transfertargetuniqueid']&&agents[_0x5120dc[_0x4f60('0x3e')]]){agents[_0x5120dc['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x5120dc[_0x4f60('0x3e')]]=_['clone'](agents[_0x5120dc[_0x4f60('0x3e')]]);transfers[_0x5120dc[_0x4f60('0x3e')]][_0x4f60('0x9')]=agents[_0x5120dc[_0x4f60('0x37')]][_0x4f60('0x9')];transfers[_0x5120dc['transfertargetuniqueid']][_0x4f60('0x3a')]=agents[_0x5120dc[_0x4f60('0x37')]][_0x4f60('0x3a')];transfers[_0x5120dc[_0x4f60('0x3e')]][_0x4f60('0x14')]=utils[_0x4f60('0x15')]();transfers[_0x5120dc[_0x4f60('0x3e')]][_0x4f60('0x27')]=utils['now']();transfers[_0x5120dc[_0x4f60('0x3e')]][_0x4f60('0x25')]=0x0;transfers[_0x5120dc[_0x4f60('0x3e')]]['agententerreason']=0x2;}}}catch(_0x108803){utils['error'](_0x108803[_0x4f60('0x21')]);}};exports[_0x4f60('0x3f')]=function(_0x1d9260){try{if(transfers[_0x1d9260[_0x4f60('0x4')]]){transfers[_0x1d9260[_0x4f60('0x4')]][_0x4f60('0xd')]=!![];transfers[_0x1d9260[_0x4f60('0x4')]]['agentcompleteAt']=utils[_0x4f60('0x15')]();transfers[_0x1d9260['uniqueid']][_0x4f60('0x20')]=utils['diffTime'](transfers[_0x1d9260[_0x4f60('0x4')]][_0x4f60('0x2a')],transfers[_0x1d9260[_0x4f60('0x4')]]['agentconnectAt']);transfers[_0x1d9260['uniqueid']][_0x4f60('0x1d')]=_0x4f60('0x40');transfers[_0x1d9260['uniqueid']][_0x4f60('0x1c')]=_0x4f60('0x41');writeDB(transfers[_0x1d9260[_0x4f60('0x4')]],!![]);}if(agents[_0x1d9260[_0x4f60('0x4')]]&&agents[_0x1d9260[_0x4f60('0x4')]][_0x4f60('0x27')]){agents[_0x1d9260['uniqueid']][_0x4f60('0xd')]=!![];agents[_0x1d9260[_0x4f60('0x4')]][_0x4f60('0x2a')]=utils[_0x4f60('0x15')]();agents[_0x1d9260[_0x4f60('0x4')]][_0x4f60('0x20')]=utils[_0x4f60('0x2b')](agents[_0x1d9260[_0x4f60('0x4')]]['agentcompleteAt'],agents[_0x1d9260[_0x4f60('0x4')]][_0x4f60('0x27')]);agents[_0x1d9260[_0x4f60('0x4')]][_0x4f60('0x1d')]=agents[_0x1d9260['uniqueid']][_0x4f60('0x2e')]?_0x4f60('0x2e'):_0x4f60('0x40');agents[_0x1d9260[_0x4f60('0x4')]][_0x4f60('0x1c')]=_0x4f60('0x41');writeDB(agents[_0x1d9260[_0x4f60('0x4')]]);}}catch(_0x404933){utils['error'](_0x404933[_0x4f60('0x21')]);}}; \ No newline at end of file +var _0x97e7=['CreateVoiceAgentReport','request','uniqueid','destuniqueid','now','called','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','abandoned','agentconnect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheremembername','membername','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfer','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','agentcalledAt','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','agent','lodash','util','info','format','channel','queue','interface','connectedlinenum','lastevent','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout'];(function(_0x436c29,_0x4d858d){var _0x5d21ba=function(_0x7d161a){while(--_0x7d161a){_0x436c29['push'](_0x436c29['shift']());}};_0x5d21ba(++_0x4d858d);}(_0x97e7,0x7a));var _0x797e=function(_0x10a532,_0x43857f){_0x10a532=_0x10a532-0x0;var _0x581ab1=_0x97e7[_0x10a532];return _0x581ab1;};'use strict';var _=require(_0x797e('0x0'));var util=require(_0x797e('0x1'));var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x6d250a,_0x4762f3){utils[_0x797e('0x2')](util[_0x797e('0x3')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x6d250a['uniqueid'],_0x6d250a[_0x797e('0x4')],_0x6d250a[_0x797e('0x5')],_0x6d250a['membername'],_0x6d250a[_0x797e('0x6')],_0x6d250a['calleridnum'],_0x6d250a[_0x797e('0x7')],_0x6d250a[_0x797e('0x8')]));if(_0x6d250a[_0x797e('0x5')]){utils['getVoiceQueueByName'](_0x6d250a[_0x797e('0x5')])[_0x797e('0x9')](function(_0x559d02){if(_0x559d02){_0x6d250a[_0x797e('0xa')]=_0x559d02[_0x797e('0xa')];_0x6d250a[_0x797e('0xb')]=_0x6d250a[_0x797e('0xc')]?_0x559d02[_0x797e('0xd')]:![];_0x6d250a[_0x797e('0xe')]=_0x6d250a['agentacw']?_0x559d02[_0x797e('0xf')]:0x0;}utils['request'](_0x797e('0x10'),_0x6d250a);});}else{utils[_0x797e('0x11')](_0x797e('0x10'),_0x6d250a);}if(_0x4762f3){delete transfers[_0x6d250a[_0x797e('0x12')]];}else{delete agents[_0x6d250a['destuniqueid']];}}exports['agentcalled']=function(_0x4ede69){try{agents[_0x4ede69['destuniqueid']]=_0x4ede69;agents[_0x4ede69[_0x797e('0x13')]]['agentcalledAt']=utils[_0x797e('0x14')]();agents[_0x4ede69[_0x797e('0x13')]][_0x797e('0x8')]=_0x797e('0x15');agents[_0x4ede69[_0x797e('0x13')]]['connectedlinenum']=null;agents[_0x4ede69[_0x797e('0x13')]]['connectedlinename']=null;}catch(_0x3f2039){utils[_0x797e('0x16')](_0x3f2039[_0x797e('0x17')]);}};exports[_0x797e('0x18')]=function(_0x2c7922){try{if(!_[_0x797e('0x19')](agents[_0x2c7922[_0x797e('0x13')]])){agents[_0x2c7922['destuniqueid']]['agentringnoanswer']=!![];agents[_0x2c7922[_0x797e('0x13')]][_0x797e('0x1a')]=utils[_0x797e('0x14')]();agents[_0x2c7922['destuniqueid']][_0x797e('0x8')]=_0x797e('0x1b');agents[_0x2c7922[_0x797e('0x13')]][_0x797e('0x1c')]=_0x797e('0x1b');agents[_0x2c7922[_0x797e('0x13')]][_0x797e('0x1d')]=_0x2c7922['ringtime']?parseInt(_0x2c7922[_0x797e('0x1e')])/0x3e8:0x0;agents[_0x2c7922[_0x797e('0x13')]][_0x797e('0x1f')]=0x0;writeDB(agents[_0x2c7922[_0x797e('0x13')]]);}}catch(_0x51b40f){utils[_0x797e('0x16')](_0x51b40f[_0x797e('0x17')]);}};exports[_0x797e('0x20')]=function(_0x341dc6){try{_[_0x797e('0x21')](agents,function(_0x529caf,_0x340ca9){if(_0x529caf[_0x797e('0x12')]==_0x341dc6[_0x797e('0x12')]){_0x529caf['agentringnoanswer']=!![];_0x529caf[_0x797e('0x1a')]=utils[_0x797e('0x14')]();_0x529caf['lastevent']=_0x797e('0x22');_0x529caf[_0x797e('0x1c')]='abandoned';_0x529caf['holdtime']=_0x341dc6[_0x797e('0x1d')];_0x529caf[_0x797e('0x1f')]=0x0;writeDB(_0x529caf);}});}catch(_0x280803){utils[_0x797e('0x16')](_0x280803[_0x797e('0x17')]);}};exports[_0x797e('0x23')]=function(_0x320888){try{if(agents[_0x320888[_0x797e('0x13')]]){agents[_0x320888[_0x797e('0x13')]][_0x797e('0x24')]=utils['now']();agents[_0x320888['destuniqueid']]['connectedlinenum']=_0x320888[_0x797e('0x7')];agents[_0x320888[_0x797e('0x13')]][_0x797e('0x25')]=_0x320888[_0x797e('0x25')];agents[_0x320888[_0x797e('0x13')]]['holdtime']=_0x320888[_0x797e('0x1e')];agents[_0x320888[_0x797e('0x13')]]['lastevent']='connect';_[_0x797e('0x21')](agents,function(_0x3f9b9e,_0x30361b){if(_0x3f9b9e['destuniqueid']!=_0x320888[_0x797e('0x13')]&&_0x3f9b9e[_0x797e('0x12')]==_0x320888[_0x797e('0x12')]){_0x3f9b9e[_0x797e('0x1f')]=0x0;_0x3f9b9e[_0x797e('0x1d')]=_0x320888[_0x797e('0x1e')];_0x3f9b9e[_0x797e('0x18')]=!![];_0x3f9b9e[_0x797e('0x1a')]=utils['now']();_0x3f9b9e[_0x797e('0x8')]=_0x797e('0x26');_0x3f9b9e[_0x797e('0x1c')]=_0x797e('0x26');_0x3f9b9e['answeredelsewheredestinationuniqueid']=_0x320888[_0x797e('0x13')];_0x3f9b9e[_0x797e('0x27')]=_0x320888[_0x797e('0x28')];writeDB(_0x3f9b9e);}});}}catch(_0x277173){utils[_0x797e('0x16')](_0x277173[_0x797e('0x17')]);}};exports[_0x797e('0xc')]=function(_0x2c8334){try{if(!_[_0x797e('0x19')](agents[_0x2c8334[_0x797e('0x13')]])){agents[_0x2c8334[_0x797e('0x13')]][_0x797e('0xc')]=!![];agents[_0x2c8334['destuniqueid']][_0x797e('0x29')]=utils[_0x797e('0x14')]();agents[_0x2c8334[_0x797e('0x13')]]['talktime']=utils[_0x797e('0x2a')](agents[_0x2c8334[_0x797e('0x13')]][_0x797e('0x29')],agents[_0x2c8334['destuniqueid']][_0x797e('0x24')]);agents[_0x2c8334[_0x797e('0x13')]][_0x797e('0x1c')]=_0x2c8334[_0x797e('0x1c')];agents[_0x2c8334[_0x797e('0x13')]][_0x797e('0x8')]=_0x797e('0x2b');writeDB(agents[_0x2c8334['destuniqueid']]);}}catch(_0x24625b){utils[_0x797e('0x16')](_0x24625b[_0x797e('0x17')]);}};exports[_0x797e('0x2c')]=function(_0x265567){try{if(!_[_0x797e('0x19')](agents[_0x265567[_0x797e('0x2d')]])){agents[_0x265567[_0x797e('0x2d')]][_0x797e('0x2e')]=!![];agents[_0x265567[_0x797e('0x2d')]]['transfertype']=_0x797e('0x2f');agents[_0x265567[_0x797e('0x2d')]][_0x797e('0x30')]=_0x265567[_0x797e('0x31')];agents[_0x265567[_0x797e('0x2d')]][_0x797e('0x32')]=agents[_0x265567[_0x797e('0x2d')]][_0x797e('0x12')];}}catch(_0x249850){utils[_0x797e('0x16')](_0x249850[_0x797e('0x17')]);}};exports[_0x797e('0x33')]=function(_0x51ccdc){try{if(_0x51ccdc[_0x797e('0x34')]==_0x51ccdc[_0x797e('0x35')]){if(!_[_0x797e('0x19')](agents[_0x51ccdc['secondtransfereruniqueid']])){agents[_0x51ccdc['secondtransfereruniqueid']]['transfer']=!![];agents[_0x51ccdc[_0x797e('0x36')]][_0x797e('0x37')]=_0x797e('0x38');agents[_0x51ccdc[_0x797e('0x36')]]['transferexten']=_0x51ccdc[_0x797e('0x39')];agents[_0x51ccdc[_0x797e('0x36')]][_0x797e('0x32')]=_0x51ccdc[_0x797e('0x34')];}if(_0x51ccdc[_0x797e('0x3a')]&&agents[_0x51ccdc[_0x797e('0x3a')]]){agents[_0x51ccdc[_0x797e('0x3a')]][_0x797e('0x3b')]=0x1;transfers[_0x51ccdc[_0x797e('0x3a')]]=_[_0x797e('0x3c')](agents[_0x51ccdc[_0x797e('0x3a')]]);transfers[_0x51ccdc[_0x797e('0x3a')]][_0x797e('0x3d')]=agents[_0x51ccdc[_0x797e('0x36')]]['calleridnum'];transfers[_0x51ccdc['transfereeuniqueid']]['calleridname']=agents[_0x51ccdc[_0x797e('0x36')]][_0x797e('0x3e')];transfers[_0x51ccdc[_0x797e('0x3a')]][_0x797e('0x3f')]=utils['now']();transfers[_0x51ccdc[_0x797e('0x3a')]]['agentconnectAt']=utils['now']();transfers[_0x51ccdc['transfereeuniqueid']][_0x797e('0x1d')]=0x0;transfers[_0x51ccdc[_0x797e('0x3a')]][_0x797e('0x3b')]=0x2;}}else if(_0x51ccdc[_0x797e('0x36')]==_0x51ccdc[_0x797e('0x40')]){if(!_['isNil'](agents[_0x51ccdc['origtransfereruniqueid']])){agents[_0x51ccdc[_0x797e('0x34')]][_0x797e('0x2e')]=!![];agents[_0x51ccdc[_0x797e('0x34')]][_0x797e('0x37')]='ATTENDED';agents[_0x51ccdc[_0x797e('0x34')]]['transferexten']=_0x51ccdc[_0x797e('0x41')];agents[_0x51ccdc[_0x797e('0x34')]][_0x797e('0x32')]=_0x51ccdc[_0x797e('0x36')];}if(_0x51ccdc[_0x797e('0x42')]&&agents[_0x51ccdc[_0x797e('0x42')]]){agents[_0x51ccdc[_0x797e('0x42')]][_0x797e('0x3b')]=0x1;transfers[_0x51ccdc[_0x797e('0x42')]]=_[_0x797e('0x3c')](agents[_0x51ccdc[_0x797e('0x42')]]);transfers[_0x51ccdc['transfertargetuniqueid']][_0x797e('0x3d')]=agents[_0x51ccdc[_0x797e('0x34')]][_0x797e('0x3d')];transfers[_0x51ccdc[_0x797e('0x42')]][_0x797e('0x3e')]=agents[_0x51ccdc[_0x797e('0x34')]][_0x797e('0x3e')];transfers[_0x51ccdc['transfertargetuniqueid']][_0x797e('0x3f')]=utils[_0x797e('0x14')]();transfers[_0x51ccdc[_0x797e('0x42')]][_0x797e('0x24')]=utils['now']();transfers[_0x51ccdc[_0x797e('0x42')]][_0x797e('0x1d')]=0x0;transfers[_0x51ccdc[_0x797e('0x42')]]['agententerreason']=0x2;}}}catch(_0x5413b8){utils[_0x797e('0x16')](_0x5413b8[_0x797e('0x17')]);}};exports[_0x797e('0x43')]=function(_0x120ae7){try{if(transfers[_0x120ae7[_0x797e('0x12')]]){transfers[_0x120ae7[_0x797e('0x12')]]['agentcomplete']=!![];transfers[_0x120ae7[_0x797e('0x12')]][_0x797e('0x29')]=utils[_0x797e('0x14')]();transfers[_0x120ae7[_0x797e('0x12')]][_0x797e('0x1f')]=utils[_0x797e('0x2a')](transfers[_0x120ae7['uniqueid']][_0x797e('0x29')],transfers[_0x120ae7[_0x797e('0x12')]]['agentconnectAt']);transfers[_0x120ae7['uniqueid']][_0x797e('0x1c')]=_0x797e('0x44');transfers[_0x120ae7[_0x797e('0x12')]][_0x797e('0x8')]=_0x797e('0x2b');writeDB(transfers[_0x120ae7[_0x797e('0x12')]],!![]);}if(agents[_0x120ae7[_0x797e('0x12')]]&&agents[_0x120ae7[_0x797e('0x12')]][_0x797e('0x24')]){agents[_0x120ae7[_0x797e('0x12')]][_0x797e('0xc')]=!![];agents[_0x120ae7[_0x797e('0x12')]][_0x797e('0x29')]=utils[_0x797e('0x14')]();agents[_0x120ae7['uniqueid']]['talktime']=utils['diffTime'](agents[_0x120ae7[_0x797e('0x12')]][_0x797e('0x29')],agents[_0x120ae7[_0x797e('0x12')]][_0x797e('0x24')]);agents[_0x120ae7['uniqueid']]['reason']=agents[_0x120ae7[_0x797e('0x12')]][_0x797e('0x2e')]?_0x797e('0x2e'):_0x797e('0x44');agents[_0x120ae7['uniqueid']][_0x797e('0x8')]=_0x797e('0x2b');writeDB(agents[_0x120ae7[_0x797e('0x12')]]);}}catch(_0x37c0a9){utils['error'](_0x37c0a9[_0x797e('0x17')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index df88c92..f18b835 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 _0x6c9f=['source','callerid','disposition','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','now','DOCUMENTATION','error','newstate','isNil','systemanswertime','channelstate','context','transfer','answertime','stack','hangup','calleridname','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','destinationchannel','secondtransfererchannel','userfield','origtransfererchannel','_attended','musiconholdstartAt','musiconholdstop','varset','xmd-originatecalleridnum','value','variable','xmd-phone','destination','\x22\x20<','xmd-callerid','xmd-queue','lastapplication','Queue','lastdata','xmd-contactid','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','accountcode'];(function(_0x4fe9c3,_0x3597cb){var _0x478894=function(_0x66f75d){while(--_0x66f75d){_0x4fe9c3['push'](_0x4fe9c3['shift']());}};_0x478894(++_0x3597cb);}(_0x6c9f,0xe3));var _0xf6c9=function(_0x4b2b07,_0x11f034){_0x4b2b07=_0x4b2b07-0x0;var _0x2a840a=_0x6c9f[_0x4b2b07];return _0x2a840a;};'use strict';var _=require(_0xf6c9('0x0'));var util=require(_0xf6c9('0x1'));var utils=require(_0xf6c9('0x2'));var dispositions=[_0xf6c9('0x3'),_0xf6c9('0x4'),'FAILED',_0xf6c9('0x3'),_0xf6c9('0x3'),_0xf6c9('0x3'),_0xf6c9('0x5'),'BUSY','FAILED','FAILED',_0xf6c9('0x4')];var channels={};function writeDB(_0x4b5fe1){utils[_0xf6c9('0x6')](util[_0xf6c9('0x7')](_0xf6c9('0x8'),_0x4b5fe1[_0xf6c9('0x9')],_0x4b5fe1[_0xf6c9('0xa')],_0x4b5fe1[_0xf6c9('0xb')],_0x4b5fe1[_0xf6c9('0xc')],_0x4b5fe1[_0xf6c9('0xd')],_0x4b5fe1['destination'],_0x4b5fe1[_0xf6c9('0xe')],_0x4b5fe1[_0xf6c9('0xf')]));if(_0x4b5fe1['accountcode']){utils[_0xf6c9('0x10')](_0x4b5fe1['accountcode'])[_0xf6c9('0x11')](function(_0x194750){if(_0x194750){_0x4b5fe1[_0xf6c9('0x12')]=_0x194750['id'];}utils[_0xf6c9('0x13')](_0xf6c9('0x14'),_0x4b5fe1);});}else{utils['request'](_0xf6c9('0x14'),_0x4b5fe1);}if(channels[_0x4b5fe1[_0xf6c9('0x9')]]){delete channels[_0x4b5fe1[_0xf6c9('0x9')]];}}exports[_0xf6c9('0x15')]=function(_0x1df6a8){try{if(_0x1df6a8[_0xf6c9('0x9')]==_0x1df6a8[_0xf6c9('0x16')]&&_0x1df6a8[_0xf6c9('0xa')]!=_0xf6c9('0x17')){channels[_0x1df6a8[_0xf6c9('0x9')]]={'uniqueid':_0x1df6a8[_0xf6c9('0x9')],'accountcode':_0x1df6a8['accountcode'],'source':_0x1df6a8[_0xf6c9('0x18')],'destination':_0x1df6a8['exten'],'destinationcontext':_0x1df6a8['context'],'channel':_0x1df6a8[_0xf6c9('0xa')],'starttime':utils[_0xf6c9('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xf6c9('0x3'),'amaflags':_0xf6c9('0x1a')};}}catch(_0x350671){utils[_0xf6c9('0x1b')](_0x350671['stack']);}};exports[_0xf6c9('0x1c')]=function(_0x23eef8){try{if(!_['isNil'](channels[_0x23eef8['uniqueid']])&&_0x23eef8['channelstate']==0x6){if(_[_0xf6c9('0x1d')](channels[_0x23eef8[_0xf6c9('0x9')]][_0xf6c9('0x1e')])){channels[_0x23eef8[_0xf6c9('0x9')]]['systemanswertime']=utils[_0xf6c9('0x19')]();}}else if(!_[_0xf6c9('0x1d')](channels[_0x23eef8[_0xf6c9('0x16')]])&&_0x23eef8[_0xf6c9('0x1f')]==0x6&&_0x23eef8[_0xf6c9('0x20')]!=_0xf6c9('0x21')){channels[_0x23eef8[_0xf6c9('0x16')]]['accountcode']=_0x23eef8[_0xf6c9('0xc')];channels[_0x23eef8[_0xf6c9('0x16')]]['destinationchannel']=_0x23eef8[_0xf6c9('0xa')];if(_['isNil'](channels[_0x23eef8[_0xf6c9('0x16')]][_0xf6c9('0x22')])){channels[_0x23eef8['linkedid']][_0xf6c9('0x22')]=utils[_0xf6c9('0x19')]();}channels[_0x23eef8[_0xf6c9('0x16')]]['disposition']=dispositions[_['toNumber'](_0x23eef8[_0xf6c9('0x1f')])]||_0xf6c9('0x5');}}catch(_0x13df19){utils[_0xf6c9('0x1b')](_0x13df19[_0xf6c9('0x23')]);}};exports[_0xf6c9('0x24')]=function(_0x2f2f68){try{if(!_[_0xf6c9('0x1d')](channels[_0x2f2f68[_0xf6c9('0x9')]])){if(_[_0xf6c9('0x1d')](channels[_0x2f2f68[_0xf6c9('0x9')]]['callerid'])){channels[_0x2f2f68[_0xf6c9('0x9')]][_0xf6c9('0xe')]=_0x2f2f68[_0xf6c9('0x25')]+'\x20<'+_0x2f2f68[_0xf6c9('0x18')]+'>';}channels[_0x2f2f68['uniqueid']][_0xf6c9('0x26')]=utils[_0xf6c9('0x19')]();channels[_0x2f2f68['uniqueid']][_0xf6c9('0x27')]=utils[_0xf6c9('0x28')](channels[_0x2f2f68[_0xf6c9('0x9')]][_0xf6c9('0x26')],channels[_0x2f2f68[_0xf6c9('0x9')]][_0xf6c9('0x29')]);channels[_0x2f2f68[_0xf6c9('0x9')]][_0xf6c9('0x2a')]=channels[_0x2f2f68[_0xf6c9('0x9')]]['answertime']?utils['diffTime'](channels[_0x2f2f68[_0xf6c9('0x9')]][_0xf6c9('0x26')],channels[_0x2f2f68[_0xf6c9('0x9')]][_0xf6c9('0x22')]):0x0;writeDB(channels[_0x2f2f68[_0xf6c9('0x9')]]);}}catch(_0x269543){utils[_0xf6c9('0x1b')](_0x269543[_0xf6c9('0x23')]);}};exports[_0xf6c9('0x2b')]=function(_0x23f598){try{if(!_['isNil'](channels[_0x23f598[_0xf6c9('0x2c')]])){if(channels[_0x23f598[_0xf6c9('0x2c')]]['channel']==_0x23f598['transfereechannel']){channels[_0x23f598[_0xf6c9('0x2c')]][_0xf6c9('0x2d')]=_0x23f598[_0xf6c9('0x2e')];channels[_0x23f598[_0xf6c9('0x2c')]][_0xf6c9('0x2f')]='_attended';}else if(channels[_0x23f598[_0xf6c9('0x2c')]][_0xf6c9('0xa')]=_0x23f598['transfertargetchannel']){channels[_0x23f598[_0xf6c9('0x2c')]]['destinationchannel']=_0x23f598[_0xf6c9('0x30')];channels[_0x23f598[_0xf6c9('0x2c')]][_0xf6c9('0x2f')]=_0xf6c9('0x31');}}}catch(_0x2cbf92){utils[_0xf6c9('0x1b')](_0x2cbf92['stack']);}};exports['musiconholdstart']=function(_0x3c7e7a){try{if(!_[_0xf6c9('0x1d')](channels[_0x3c7e7a[_0xf6c9('0x9')]])){channels[_0x3c7e7a[_0xf6c9('0x9')]][_0xf6c9('0x32')]=utils['now']();}}catch(_0x13e6a0){utils['error'](_0x13e6a0[_0xf6c9('0x23')]);}};exports[_0xf6c9('0x33')]=function(_0x55f32c){try{if(!_[_0xf6c9('0x1d')](channels[_0x55f32c[_0xf6c9('0x9')]])){if(!_[_0xf6c9('0x1d')](channels[_0x55f32c[_0xf6c9('0x9')]]['musiconholdstartAt'])){channels[_0x55f32c[_0xf6c9('0x9')]]['mohtime']+=utils[_0xf6c9('0x28')](utils[_0xf6c9('0x19')](),channels[_0x55f32c[_0xf6c9('0x9')]]['musiconholdstartAt']);delete channels[_0x55f32c[_0xf6c9('0x9')]][_0xf6c9('0x32')];}}}catch(_0x54562f){utils[_0xf6c9('0x1b')](_0x54562f[_0xf6c9('0x23')]);}};exports[_0xf6c9('0x34')]=function(_0x4f00d7){try{if(!_[_0xf6c9('0x1d')](channels[_0x4f00d7[_0xf6c9('0x9')]])){if(!_[_0xf6c9('0x1d')](_0x4f00d7['variable'][_0xf6c9('0x35')])){channels[_0x4f00d7['uniqueid']]['source']=_0x4f00d7[_0xf6c9('0x36')];}if(!_[_0xf6c9('0x1d')](_0x4f00d7[_0xf6c9('0x37')][_0xf6c9('0x38')])){channels[_0x4f00d7[_0xf6c9('0x9')]][_0xf6c9('0x39')]=_0x4f00d7['value'];channels[_0x4f00d7['uniqueid']][_0xf6c9('0xe')]='\x22'+_0x4f00d7[_0xf6c9('0x36')]+_0xf6c9('0x3a')+_0x4f00d7[_0xf6c9('0x36')]+'>';}if(!_[_0xf6c9('0x1d')](_0x4f00d7[_0xf6c9('0x37')]['xmd-callerid-preview'])||!_['isNil'](_0x4f00d7[_0xf6c9('0x37')][_0xf6c9('0x3b')])){channels[_0x4f00d7['uniqueid']][_0xf6c9('0xe')]=_0x4f00d7[_0xf6c9('0x36')];}if(!_['isNil'](_0x4f00d7[_0xf6c9('0x37')][_0xf6c9('0x3c')])||!_[_0xf6c9('0x1d')](_0x4f00d7['variable']['xmcs-queue'])){channels[_0x4f00d7[_0xf6c9('0x9')]][_0xf6c9('0x3d')]=_0xf6c9('0x3e');channels[_0x4f00d7[_0xf6c9('0x9')]][_0xf6c9('0x3f')]=_0x4f00d7[_0xf6c9('0x36')];channels[_0x4f00d7[_0xf6c9('0x9')]]['queue']=!![];}if(!_[_0xf6c9('0x1d')](_0x4f00d7['variable'][_0xf6c9('0x40')])){channels[_0x4f00d7['uniqueid']]['ContactId']=_0x4f00d7['value'];}if(!_[_0xf6c9('0x1d')](_0x4f00d7[_0xf6c9('0x37')]['xmd-cdrtype'])){channels[_0x4f00d7['uniqueid']][_0xf6c9('0xb')]=_0x4f00d7[_0xf6c9('0x36')];}if(!_['isNil'](_0x4f00d7[_0xf6c9('0x37')][_0xf6c9('0x41')])){channels[_0x4f00d7[_0xf6c9('0x9')]][_0xf6c9('0x42')]=_0x4f00d7['value'];}if(!_[_0xf6c9('0x1d')](_0x4f00d7[_0xf6c9('0x37')][_0xf6c9('0x43')])){channels[_0x4f00d7[_0xf6c9('0x9')]][_0xf6c9('0x43')]=_0x4f00d7[_0xf6c9('0x36')];}}}catch(_0x4ae6d8){utils[_0xf6c9('0x1b')](_0x4ae6d8[_0xf6c9('0x23')]);}};exports[_0xf6c9('0x44')]=function(_0x1dfa51){try{if(!_['isNil'](channels[_0x1dfa51[_0xf6c9('0x9')]])){if(_0x1dfa51[_0xf6c9('0x45')][_0xf6c9('0x46')]()==_0xf6c9('0x47')&&_[_0xf6c9('0x48')](_0x1dfa51[_0xf6c9('0x49')][_0xf6c9('0x46')](),_0xf6c9('0x4a'))){var _0x28eac3=_0x1dfa51['appdata'][_0xf6c9('0x4b')]('=');var _0x4a8ef8=_0x28eac3[0x0][_0xf6c9('0x4c')](_0x28eac3[0x0][_0xf6c9('0x4d')]('(')+0x1,_0x28eac3[0x0][_0xf6c9('0x4d')](')'));var _0x12e414=_0x28eac3[0x1];channels[_0x1dfa51[_0xf6c9('0x9')]][_0x4a8ef8]=_0x12e414;}if(!_['includes']([_0xf6c9('0x24'),'noop',_0xf6c9('0x4e'),_0xf6c9('0x47'),_0xf6c9('0x4f')],_0x1dfa51[_0xf6c9('0x45')][_0xf6c9('0x46')]())){channels[_0x1dfa51['uniqueid']]['lastapplication']=_0x1dfa51['application'];channels[_0x1dfa51[_0xf6c9('0x9')]][_0xf6c9('0x3f')]=_0x1dfa51['appdata'];}}}catch(_0x10870a){utils[_0xf6c9('0x1b')](_0x10870a[_0xf6c9('0x23')]);}}; \ No newline at end of file +var _0x915b=['DOCUMENTATION','error','isNil','channelstate','systemanswertime','context','transfer','destinationchannel','channel','answertime','toNumber','hangup','callerid','calleridname','calleridnum','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','transfereechannel','localtwolinkedid','secondtransfererchannel','userfield','stack','musiconholdstart','musiconholdstop','musiconholdstartAt','varset','variable','xmd-originatecalleridnum','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','lastdata','queue','ContactId','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','set','appdata','cdr','split','substring','lastIndexOf','includes','noop','gotoif','lodash','./utils','NO\x20ANSWER','FAILED','ANSWERED','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','type','accountcode','source','destination','disposition','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','linkedid','OutgoingSpoolFailed','exten','now'];(function(_0x309498,_0x32805b){var _0x3694ad=function(_0x41c40b){while(--_0x41c40b){_0x309498['push'](_0x309498['shift']());}};_0x3694ad(++_0x32805b);}(_0x915b,0xdc));var _0xb915=function(_0x314308,_0x47377a){_0x314308=_0x314308-0x0;var _0x24f3e8=_0x915b[_0x314308];return _0x24f3e8;};'use strict';var _=require(_0xb915('0x0'));var util=require('util');var utils=require(_0xb915('0x1'));var dispositions=[_0xb915('0x2'),_0xb915('0x3'),_0xb915('0x3'),_0xb915('0x2'),_0xb915('0x2'),_0xb915('0x2'),_0xb915('0x4'),'BUSY',_0xb915('0x3'),'FAILED',_0xb915('0x3')];var channels={};function writeDB(_0x2ffe07){utils['info'](util[_0xb915('0x5')](_0xb915('0x6'),_0x2ffe07[_0xb915('0x7')],_0x2ffe07['channel'],_0x2ffe07[_0xb915('0x8')],_0x2ffe07[_0xb915('0x9')],_0x2ffe07[_0xb915('0xa')],_0x2ffe07[_0xb915('0xb')],_0x2ffe07['callerid'],_0x2ffe07[_0xb915('0xc')]));if(_0x2ffe07[_0xb915('0x9')]){utils[_0xb915('0xd')](_0x2ffe07['accountcode'])[_0xb915('0xe')](function(_0x168f5){if(_0x168f5){_0x2ffe07[_0xb915('0xf')]=_0x168f5['id'];}utils[_0xb915('0x10')](_0xb915('0x11'),_0x2ffe07);});}else{utils[_0xb915('0x10')]('CreateVoiceCallReport',_0x2ffe07);}if(channels[_0x2ffe07[_0xb915('0x7')]]){delete channels[_0x2ffe07[_0xb915('0x7')]];}}exports[_0xb915('0x12')]=function(_0xf664e8){try{if(_0xf664e8['uniqueid']==_0xf664e8[_0xb915('0x13')]&&_0xf664e8['channel']!=_0xb915('0x14')){channels[_0xf664e8['uniqueid']]={'uniqueid':_0xf664e8[_0xb915('0x7')],'accountcode':_0xf664e8[_0xb915('0x9')],'source':_0xf664e8['calleridnum'],'destination':_0xf664e8[_0xb915('0x15')],'destinationcontext':_0xf664e8['context'],'channel':_0xf664e8['channel'],'starttime':utils[_0xb915('0x16')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xb915('0x17')};}}catch(_0x43d07f){utils[_0xb915('0x18')](_0x43d07f['stack']);}};exports['newstate']=function(_0x59463e){try{if(!_[_0xb915('0x19')](channels[_0x59463e[_0xb915('0x7')]])&&_0x59463e[_0xb915('0x1a')]==0x6){if(_[_0xb915('0x19')](channels[_0x59463e['uniqueid']][_0xb915('0x1b')])){channels[_0x59463e[_0xb915('0x7')]][_0xb915('0x1b')]=utils[_0xb915('0x16')]();}}else if(!_[_0xb915('0x19')](channels[_0x59463e[_0xb915('0x13')]])&&_0x59463e[_0xb915('0x1a')]==0x6&&_0x59463e[_0xb915('0x1c')]!=_0xb915('0x1d')){channels[_0x59463e[_0xb915('0x13')]][_0xb915('0x9')]=_0x59463e['accountcode'];channels[_0x59463e['linkedid']][_0xb915('0x1e')]=_0x59463e[_0xb915('0x1f')];if(_[_0xb915('0x19')](channels[_0x59463e[_0xb915('0x13')]][_0xb915('0x20')])){channels[_0x59463e['linkedid']]['answertime']=utils['now']();}channels[_0x59463e[_0xb915('0x13')]][_0xb915('0xc')]=dispositions[_[_0xb915('0x21')](_0x59463e[_0xb915('0x1a')])]||'ANSWERED';}}catch(_0x4e1eff){utils[_0xb915('0x18')](_0x4e1eff['stack']);}};exports[_0xb915('0x22')]=function(_0x33224c){try{if(!_[_0xb915('0x19')](channels[_0x33224c[_0xb915('0x7')]])){if(_[_0xb915('0x19')](channels[_0x33224c['uniqueid']][_0xb915('0x23')])){channels[_0x33224c[_0xb915('0x7')]][_0xb915('0x23')]=_0x33224c[_0xb915('0x24')]+'\x20<'+_0x33224c[_0xb915('0x25')]+'>';}channels[_0x33224c['uniqueid']][_0xb915('0x26')]=utils[_0xb915('0x16')]();channels[_0x33224c['uniqueid']][_0xb915('0x27')]=utils[_0xb915('0x28')](channels[_0x33224c[_0xb915('0x7')]][_0xb915('0x26')],channels[_0x33224c[_0xb915('0x7')]][_0xb915('0x29')]);channels[_0x33224c['uniqueid']][_0xb915('0x2a')]=channels[_0x33224c[_0xb915('0x7')]]['answertime']?utils[_0xb915('0x28')](channels[_0x33224c[_0xb915('0x7')]]['endtime'],channels[_0x33224c[_0xb915('0x7')]][_0xb915('0x20')]):0x0;writeDB(channels[_0x33224c['uniqueid']]);}}catch(_0x154a7d){utils['error'](_0x154a7d['stack']);}};exports[_0xb915('0x2b')]=function(_0x1e3ce6){try{if(!_[_0xb915('0x19')](channels[_0x1e3ce6['localtwolinkedid']])){if(channels[_0x1e3ce6['localtwolinkedid']][_0xb915('0x1f')]==_0x1e3ce6[_0xb915('0x2c')]){channels[_0x1e3ce6[_0xb915('0x2d')]]['destinationchannel']=_0x1e3ce6[_0xb915('0x2e')];channels[_0x1e3ce6[_0xb915('0x2d')]][_0xb915('0x2f')]='_attended';}else if(channels[_0x1e3ce6[_0xb915('0x2d')]][_0xb915('0x1f')]=_0x1e3ce6['transfertargetchannel']){channels[_0x1e3ce6[_0xb915('0x2d')]][_0xb915('0x1e')]=_0x1e3ce6['origtransfererchannel'];channels[_0x1e3ce6[_0xb915('0x2d')]]['userfield']='_attended';}}}catch(_0x3e7c9a){utils[_0xb915('0x18')](_0x3e7c9a[_0xb915('0x30')]);}};exports[_0xb915('0x31')]=function(_0x5ba417){try{if(!_[_0xb915('0x19')](channels[_0x5ba417[_0xb915('0x7')]])){channels[_0x5ba417['uniqueid']]['musiconholdstartAt']=utils[_0xb915('0x16')]();}}catch(_0x25496e){utils['error'](_0x25496e[_0xb915('0x30')]);}};exports[_0xb915('0x32')]=function(_0x50e150){try{if(!_[_0xb915('0x19')](channels[_0x50e150[_0xb915('0x7')]])){if(!_[_0xb915('0x19')](channels[_0x50e150[_0xb915('0x7')]]['musiconholdstartAt'])){channels[_0x50e150['uniqueid']]['mohtime']+=utils[_0xb915('0x28')](utils['now'](),channels[_0x50e150[_0xb915('0x7')]][_0xb915('0x33')]);delete channels[_0x50e150[_0xb915('0x7')]]['musiconholdstartAt'];}}}catch(_0x3521ce){utils[_0xb915('0x18')](_0x3521ce[_0xb915('0x30')]);}};exports[_0xb915('0x34')]=function(_0xf485be){try{if(!_[_0xb915('0x19')](channels[_0xf485be[_0xb915('0x7')]])){if(!_[_0xb915('0x19')](_0xf485be[_0xb915('0x35')][_0xb915('0x36')])){channels[_0xf485be[_0xb915('0x7')]][_0xb915('0xa')]=_0xf485be[_0xb915('0x37')];}if(!_['isNil'](_0xf485be[_0xb915('0x35')][_0xb915('0x38')])){channels[_0xf485be[_0xb915('0x7')]][_0xb915('0xb')]=_0xf485be[_0xb915('0x37')];channels[_0xf485be[_0xb915('0x7')]][_0xb915('0x23')]='\x22'+_0xf485be['value']+_0xb915('0x39')+_0xf485be['value']+'>';}if(!_[_0xb915('0x19')](_0xf485be[_0xb915('0x35')][_0xb915('0x3a')])||!_[_0xb915('0x19')](_0xf485be['variable'][_0xb915('0x3b')])){channels[_0xf485be[_0xb915('0x7')]][_0xb915('0x23')]=_0xf485be[_0xb915('0x37')];}if(!_[_0xb915('0x19')](_0xf485be['variable'][_0xb915('0x3c')])||!_['isNil'](_0xf485be[_0xb915('0x35')][_0xb915('0x3d')])){channels[_0xf485be[_0xb915('0x7')]][_0xb915('0x3e')]='Queue';channels[_0xf485be[_0xb915('0x7')]][_0xb915('0x3f')]=_0xf485be['value'];channels[_0xf485be[_0xb915('0x7')]][_0xb915('0x40')]=!![];}if(!_['isNil'](_0xf485be[_0xb915('0x35')]['xmd-contactid'])){channels[_0xf485be['uniqueid']][_0xb915('0x41')]=_0xf485be[_0xb915('0x37')];}if(!_[_0xb915('0x19')](_0xf485be[_0xb915('0x35')]['xmd-cdrtype'])){channels[_0xf485be[_0xb915('0x7')]]['type']=_0xf485be[_0xb915('0x37')];}if(!_[_0xb915('0x19')](_0xf485be[_0xb915('0x35')][_0xb915('0x42')])){channels[_0xf485be[_0xb915('0x7')]][_0xb915('0x43')]=_0xf485be[_0xb915('0x37')];}if(!_[_0xb915('0x19')](_0xf485be[_0xb915('0x35')][_0xb915('0x44')])){channels[_0xf485be[_0xb915('0x7')]][_0xb915('0x44')]=_0xf485be[_0xb915('0x37')];}}}catch(_0x208238){utils[_0xb915('0x18')](_0x208238['stack']);}};exports[_0xb915('0x45')]=function(_0xd86fd){try{if(!_[_0xb915('0x19')](channels[_0xd86fd[_0xb915('0x7')]])){if(_0xd86fd[_0xb915('0x46')][_0xb915('0x47')]()==_0xb915('0x48')&&_['startsWith'](_0xd86fd[_0xb915('0x49')][_0xb915('0x47')](),_0xb915('0x4a'))){var _0x431bf9=_0xd86fd[_0xb915('0x49')][_0xb915('0x4b')]('=');var _0x2a3c51=_0x431bf9[0x0][_0xb915('0x4c')](_0x431bf9[0x0][_0xb915('0x4d')]('(')+0x1,_0x431bf9[0x0][_0xb915('0x4d')](')'));var _0x4ca9b0=_0x431bf9[0x1];channels[_0xd86fd[_0xb915('0x7')]][_0x2a3c51]=_0x4ca9b0;}if(!_[_0xb915('0x4e')]([_0xb915('0x22'),_0xb915('0x4f'),'execif',_0xb915('0x48'),_0xb915('0x50')],_0xd86fd[_0xb915('0x46')][_0xb915('0x47')]())){channels[_0xd86fd[_0xb915('0x7')]][_0xb915('0x3e')]=_0xd86fd['application'];channels[_0xd86fd[_0xb915('0x7')]][_0xb915('0x3f')]=_0xd86fd[_0xb915('0x49')];}}}catch(_0x2f275e){utils[_0xb915('0x18')](_0x2f275e['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 295b569..87e6fd2 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 _0xe0ae=['info','shutdown','SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','connect'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xe0ae,0xa1));var _0xee0a=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0xe0ae[_0xe45118];return _0x15e15d;};'use strict';var utils=require('./utils');var _=require('lodash');exports[_0xee0a('0x0')]=function(){utils[_0xee0a('0x1')]('CONNECTED');};exports[_0xee0a('0x2')]=function(){utils['info'](_0xee0a('0x3'));};exports[_0xee0a('0x4')]=function(){utils['info'](_0xee0a('0x5'));};exports['error']=function(_0x5bef07){utils[_0xee0a('0x6')](_0x5bef07);};exports[_0xee0a('0x7')]=function(){utils[_0xee0a('0x1')](_0xee0a('0x8'));};exports['managerevent']=function(_0x2296b9){}; \ No newline at end of file +var _0xdbf5=['SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','lodash','CONNECTED','shutdown','info'];(function(_0x35ebf0,_0x173204){var _0x4d73f6=function(_0x4591d1){while(--_0x4591d1){_0x35ebf0['push'](_0x35ebf0['shift']());}};_0x4d73f6(++_0x173204);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x1c0ea1,_0x121f57){_0x1c0ea1=_0x1c0ea1-0x0;var _0x3ccac8=_0xdbf5[_0x1c0ea1];return _0x3ccac8;};'use strict';var utils=require('./utils');var _=require(_0x5dbf('0x0'));exports['connect']=function(){utils['info'](_0x5dbf('0x1'));};exports[_0x5dbf('0x2')]=function(){utils[_0x5dbf('0x3')](_0x5dbf('0x4'));};exports[_0x5dbf('0x5')]=function(){utils[_0x5dbf('0x3')](_0x5dbf('0x6'));};exports[_0x5dbf('0x7')]=function(_0x3f8628){utils[_0x5dbf('0x7')](_0x3f8628);};exports[_0x5dbf('0x8')]=function(){utils[_0x5dbf('0x3')](_0x5dbf('0x9'));};exports['managerevent']=function(_0x134810){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 30120c5..663f8ef 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 _0xd802=['duration','diffTime','holdtime','endtime','answertime','util','./utils','info','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring','dialstatus','request','CreateVoiceDialReport','newexten','startsWith','appdata','toLowerCase','cdr(routeid)','split','error','stack','varset','isNil','variable','outboundrouteid','value','dialbegin','assign','starttime','now','lastevent','called','dialend','ANSWER','connect','hangup','complete'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0xd802,0x7a));var _0x2d80=function(_0x250f95,_0x5a5728){_0x250f95=_0x250f95-0x0;var _0x4ada97=_0xd802[_0x250f95];return _0x4ada97;};'use strict';var _=require('lodash');var util=require(_0x2d80('0x0'));var utils=require(_0x2d80('0x1'));var dials={};function writeDB(_0x48309d){utils[_0x2d80('0x2')](util['format'](_0x2d80('0x3'),_0x48309d[_0x2d80('0x4')],_0x48309d[_0x2d80('0x5')],_0x48309d[_0x2d80('0x6')],_0x48309d['calleridnum'],_0x48309d['connectedlinenum'],_0x48309d[_0x2d80('0x7')]));utils[_0x2d80('0x8')](_0x2d80('0x9'),_0x48309d);delete dials[_0x48309d['uniqueid']];}exports[_0x2d80('0xa')]=function(_0xc9b900){try{if(_0xc9b900['application']['toLowerCase']()=='set'&&_[_0x2d80('0xb')](_0xc9b900[_0x2d80('0xc')][_0x2d80('0xd')](),_0x2d80('0xe'))){var _0x20d7a6=_0xc9b900[_0x2d80('0xc')][_0x2d80('0xf')]('=');dials[_0xc9b900[_0x2d80('0x4')]]={'routeId':_0x20d7a6[0x1]};}}catch(_0x512a6b){utils[_0x2d80('0x10')](_0x512a6b[_0x2d80('0x11')]);}};exports[_0x2d80('0x12')]=function(_0x54c2f3){try{if(!_[_0x2d80('0x13')](_0x54c2f3[_0x2d80('0x14')][_0x2d80('0x15')])){dials[_0x54c2f3[_0x2d80('0x4')]]={'routeId':_0x54c2f3[_0x2d80('0x16')]};}}catch(_0x5ba4cf){utils['error'](_0x5ba4cf[_0x2d80('0x11')]);}};exports[_0x2d80('0x17')]=function(_0x3c30d4){try{if(!_['isNil'](dials[_0x3c30d4[_0x2d80('0x4')]])){dials[_0x3c30d4['uniqueid']]=_[_0x2d80('0x18')](dials[_0x3c30d4[_0x2d80('0x4')]],_0x3c30d4);dials[_0x3c30d4[_0x2d80('0x4')]][_0x2d80('0x19')]=utils[_0x2d80('0x1a')]();dials[_0x3c30d4[_0x2d80('0x4')]][_0x2d80('0x1b')]=_0x2d80('0x1c');}}catch(_0x26dc83){utils[_0x2d80('0x10')](_0x26dc83[_0x2d80('0x11')]);}};exports[_0x2d80('0x1d')]=function(_0x2cfcd5){try{if(!_[_0x2d80('0x13')](dials[_0x2cfcd5[_0x2d80('0x4')]])){dials[_0x2cfcd5['uniqueid']][_0x2d80('0x7')]=_0x2cfcd5['dialstatus'];if(_0x2cfcd5[_0x2d80('0x7')]==_0x2d80('0x1e')){dials[_0x2cfcd5[_0x2d80('0x4')]]=_[_0x2d80('0x18')](dials[_0x2cfcd5[_0x2d80('0x4')]],_0x2cfcd5);dials[_0x2cfcd5[_0x2d80('0x4')]]['answertime']=utils[_0x2d80('0x1a')]();dials[_0x2cfcd5[_0x2d80('0x4')]][_0x2d80('0x1b')]=_0x2d80('0x1f');}}}catch(_0x5d16f4){utils[_0x2d80('0x10')](_0x5d16f4[_0x2d80('0x11')]);}};exports[_0x2d80('0x20')]=function(_0x80c4f7){try{if(!_[_0x2d80('0x13')](dials[_0x80c4f7[_0x2d80('0x4')]])){dials[_0x80c4f7[_0x2d80('0x4')]]=_[_0x2d80('0x18')](dials[_0x80c4f7['uniqueid']],{'endtime':utils[_0x2d80('0x1a')](),'lastevent':_0x2d80('0x21')});dials[_0x80c4f7['uniqueid']][_0x2d80('0x22')]=utils[_0x2d80('0x23')](dials[_0x80c4f7[_0x2d80('0x4')]]['endtime'],dials[_0x80c4f7['uniqueid']][_0x2d80('0x19')]);dials[_0x80c4f7[_0x2d80('0x4')]][_0x2d80('0x24')]=utils[_0x2d80('0x23')](dials[_0x80c4f7[_0x2d80('0x4')]]['answertime']||dials[_0x80c4f7[_0x2d80('0x4')]][_0x2d80('0x25')],dials[_0x80c4f7['uniqueid']]['starttime']);dials[_0x80c4f7[_0x2d80('0x4')]]['billableseconds']=dials[_0x80c4f7[_0x2d80('0x4')]]['answertime']?utils[_0x2d80('0x23')](dials[_0x80c4f7[_0x2d80('0x4')]][_0x2d80('0x25')],dials[_0x80c4f7[_0x2d80('0x4')]][_0x2d80('0x26')]):0x0;writeDB(dials[_0x80c4f7[_0x2d80('0x4')]]);}}catch(_0x523ec6){utils[_0x2d80('0x10')](_0x523ec6[_0x2d80('0x11')]);}}; \ No newline at end of file +var _0xe55f=['channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','error','stack','varset','isNil','variable','outboundrouteid','value','dialbegin','assign','starttime','lastevent','called','dialend','ANSWER','answertime','now','connect','hangup','complete','diffTime','holdtime','endtime','lodash','info','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid'];(function(_0x4122d5,_0x1a53b8){var _0x4be5cb=function(_0x3b0d72){while(--_0x3b0d72){_0x4122d5['push'](_0x4122d5['shift']());}};_0x4be5cb(++_0x1a53b8);}(_0xe55f,0x1f3));var _0xfe55=function(_0x137cd7,_0x28f679){_0x137cd7=_0x137cd7-0x0;var _0x9ca7cd=_0xe55f[_0x137cd7];return _0x9ca7cd;};'use strict';var _=require(_0xfe55('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0xa71b34){utils[_0xfe55('0x1')](util[_0xfe55('0x2')](_0xfe55('0x3'),_0xa71b34[_0xfe55('0x4')],_0xa71b34[_0xfe55('0x5')],_0xa71b34[_0xfe55('0x6')],_0xa71b34[_0xfe55('0x7')],_0xa71b34[_0xfe55('0x8')],_0xa71b34[_0xfe55('0x9')]));utils[_0xfe55('0xa')](_0xfe55('0xb'),_0xa71b34);delete dials[_0xa71b34['uniqueid']];}exports[_0xfe55('0xc')]=function(_0x578f63){try{if(_0x578f63[_0xfe55('0xd')][_0xfe55('0xe')]()==_0xfe55('0xf')&&_[_0xfe55('0x10')](_0x578f63[_0xfe55('0x11')][_0xfe55('0xe')](),_0xfe55('0x12'))){var _0x559465=_0x578f63[_0xfe55('0x11')][_0xfe55('0x13')]('=');dials[_0x578f63['uniqueid']]={'routeId':_0x559465[0x1]};}}catch(_0x5e6eda){utils[_0xfe55('0x14')](_0x5e6eda[_0xfe55('0x15')]);}};exports[_0xfe55('0x16')]=function(_0x4935f4){try{if(!_[_0xfe55('0x17')](_0x4935f4[_0xfe55('0x18')][_0xfe55('0x19')])){dials[_0x4935f4['uniqueid']]={'routeId':_0x4935f4[_0xfe55('0x1a')]};}}catch(_0x1ac32c){utils[_0xfe55('0x14')](_0x1ac32c[_0xfe55('0x15')]);}};exports[_0xfe55('0x1b')]=function(_0x905e0b){try{if(!_[_0xfe55('0x17')](dials[_0x905e0b['uniqueid']])){dials[_0x905e0b[_0xfe55('0x4')]]=_[_0xfe55('0x1c')](dials[_0x905e0b[_0xfe55('0x4')]],_0x905e0b);dials[_0x905e0b['uniqueid']][_0xfe55('0x1d')]=utils['now']();dials[_0x905e0b['uniqueid']][_0xfe55('0x1e')]=_0xfe55('0x1f');}}catch(_0x263d83){utils['error'](_0x263d83['stack']);}};exports[_0xfe55('0x20')]=function(_0x3ed5b9){try{if(!_[_0xfe55('0x17')](dials[_0x3ed5b9[_0xfe55('0x4')]])){dials[_0x3ed5b9[_0xfe55('0x4')]][_0xfe55('0x9')]=_0x3ed5b9[_0xfe55('0x9')];if(_0x3ed5b9[_0xfe55('0x9')]==_0xfe55('0x21')){dials[_0x3ed5b9[_0xfe55('0x4')]]=_['assign'](dials[_0x3ed5b9[_0xfe55('0x4')]],_0x3ed5b9);dials[_0x3ed5b9[_0xfe55('0x4')]][_0xfe55('0x22')]=utils[_0xfe55('0x23')]();dials[_0x3ed5b9['uniqueid']][_0xfe55('0x1e')]=_0xfe55('0x24');}}}catch(_0x49c7cf){utils[_0xfe55('0x14')](_0x49c7cf[_0xfe55('0x15')]);}};exports[_0xfe55('0x25')]=function(_0x470044){try{if(!_[_0xfe55('0x17')](dials[_0x470044[_0xfe55('0x4')]])){dials[_0x470044['uniqueid']]=_['assign'](dials[_0x470044[_0xfe55('0x4')]],{'endtime':utils[_0xfe55('0x23')](),'lastevent':_0xfe55('0x26')});dials[_0x470044[_0xfe55('0x4')]]['duration']=utils[_0xfe55('0x27')](dials[_0x470044[_0xfe55('0x4')]]['endtime'],dials[_0x470044[_0xfe55('0x4')]][_0xfe55('0x1d')]);dials[_0x470044[_0xfe55('0x4')]][_0xfe55('0x28')]=utils[_0xfe55('0x27')](dials[_0x470044[_0xfe55('0x4')]][_0xfe55('0x22')]||dials[_0x470044[_0xfe55('0x4')]][_0xfe55('0x29')],dials[_0x470044[_0xfe55('0x4')]][_0xfe55('0x1d')]);dials[_0x470044['uniqueid']]['billableseconds']=dials[_0x470044[_0xfe55('0x4')]]['answertime']?utils[_0xfe55('0x27')](dials[_0x470044[_0xfe55('0x4')]][_0xfe55('0x29')],dials[_0x470044['uniqueid']][_0xfe55('0x22')]):0x0;writeDB(dials[_0x470044['uniqueid']]);}}catch(_0x34e9e0){utils['error'](_0x34e9e0['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 40a3653..b0a0c7e 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 _0x6fed=['dialbegin','dialend','asterisk-manager','port','asterisk','username','password','keepConnected','xdr','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./dials.controller','./transfers.controller','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel'];(function(_0x396ea1,_0xc3ab80){var _0x4e1d73=function(_0x55e36e){while(--_0x55e36e){_0x396ea1['push'](_0x396ea1['shift']());}};_0x4e1d73(++_0xc3ab80);}(_0x6fed,0x9e));var _0xd6fe=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6fed[_0x3ab51d];return _0x29a04e;};var AsteriskManager=require(_0xd6fe('0x0'));var config=require('../../config/environment');var utils=require('./utils');var ami=new AsteriskManager(config['asterisk'][_0xd6fe('0x1')],config[_0xd6fe('0x2')]['ip'],config[_0xd6fe('0x2')][_0xd6fe('0x3')],config['asterisk'][_0xd6fe('0x4')],!![]);ami[_0xd6fe('0x5')]();if(config[_0xd6fe('0x6')]&&config[_0xd6fe('0x6')]['disabled']){utils[_0xd6fe('0x7')](_0xd6fe('0x8'));}else{var agents=require(_0xd6fe('0x9'));var calls=require(_0xd6fe('0xa'));var queues=require(_0xd6fe('0xb'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0xd6fe('0xc'));var transfers=require(_0xd6fe('0xd'));var core=require('./core.controller');ami['on']('connect',core['connect']);ami['on'](_0xd6fe('0xe'),core[_0xd6fe('0xe')]);ami['on'](_0xd6fe('0xf'),core[_0xd6fe('0xf')]);ami['on'](_0xd6fe('0x10'),core[_0xd6fe('0x10')]);ami['on']('close',core[_0xd6fe('0x11')]);ami['on'](_0xd6fe('0x12'),core[_0xd6fe('0x12')]);ami['on'](_0xd6fe('0x13'),function(_0x9c58b7){try{members[_0xd6fe('0x13')](_0x9c58b7);}catch(_0x39783a){utils[_0xd6fe('0x10')](_0x39783a);}});ami['on'](_0xd6fe('0x14'),function(_0x407337){try{agents['agentcalled'](_0x407337);}catch(_0x3b9d23){utils[_0xd6fe('0x10')](_0x3b9d23);}});ami['on']('agentringnoanswer',function(_0x215fc3){try{agents[_0xd6fe('0x15')](_0x215fc3);}catch(_0x1c74a4){utils['error'](_0x1c74a4);}});ami['on'](_0xd6fe('0x16'),function(_0x493b57){try{agents[_0xd6fe('0x16')](_0x493b57);queues[_0xd6fe('0x16')](_0x493b57);}catch(_0x40a11b){utils['error'](_0x40a11b);}});ami['on'](_0xd6fe('0x17'),function(_0x365de2){try{agents['agentcomplete'](_0x365de2);queues['agentcomplete'](_0x365de2);members[_0xd6fe('0x17')](_0x365de2);}catch(_0x58d129){utils[_0xd6fe('0x10')](_0x58d129);}});ami['on'](_0xd6fe('0x18'),function(_0x36307e){try{agents['queuecallerabandon'](_0x36307e);queues[_0xd6fe('0x18')](_0x36307e);}catch(_0x4cec13){utils[_0xd6fe('0x10')](_0x4cec13);}});ami['on'](_0xd6fe('0x19'),function(_0x4530a6){try{queues[_0xd6fe('0x19')](_0x4530a6);recordings[_0xd6fe('0x19')](_0x4530a6);}catch(_0x2b44ae){utils[_0xd6fe('0x10')](_0x2b44ae);}});ami['on'](_0xd6fe('0x1a'),function(_0x178bb2){try{queues[_0xd6fe('0x1a')](_0x178bb2);}catch(_0x4e9813){utils[_0xd6fe('0x10')](_0x4e9813);}});ami['on'](_0xd6fe('0x1b'),function(_0x3c2d25){try{queues[_0xd6fe('0x1b')](_0x3c2d25);calls['musiconholdstart'](_0x3c2d25);}catch(_0x20fc52){utils[_0xd6fe('0x10')](_0x20fc52);}});ami['on']('musiconholdstop',function(_0xfdc17a){try{queues['musiconholdstop'](_0xfdc17a);calls[_0xd6fe('0x1c')](_0xfdc17a);}catch(_0x28d0c8){utils[_0xd6fe('0x10')](_0x28d0c8);}});ami['on'](_0xd6fe('0x1d'),function(_0x37d3d4){try{calls[_0xd6fe('0x1d')](_0x37d3d4);recordings[_0xd6fe('0x1d')](_0x37d3d4);}catch(_0x218739){utils[_0xd6fe('0x10')](_0x218739);}});ami['on'](_0xd6fe('0x1e'),function(_0x87f329){try{calls[_0xd6fe('0x1e')](_0x87f329);recordings['hangup'](_0x87f329);dials[_0xd6fe('0x1e')](_0x87f329);agents[_0xd6fe('0x1e')](_0x87f329);queues['hangup'](_0x87f329);}catch(_0x4211ef){utils['error'](_0x4211ef);}});ami['on'](_0xd6fe('0x1f'),function(_0x5e4a27){try{members[_0xd6fe('0x1f')](_0x5e4a27);}catch(_0x2dd690){utils[_0xd6fe('0x10')](_0x2dd690);}});ami['on'](_0xd6fe('0x20'),function(_0x202e41){try{queues['blindtransfer'](_0x202e41);agents[_0xd6fe('0x20')](_0x202e41);transfers[_0xd6fe('0x20')](_0x202e41);}catch(_0xe01b93){utils[_0xd6fe('0x10')](_0xe01b93);}});ami['on']('attendedtransfer',function(_0x5243a9){try{queues['attendedtransfer'](_0x5243a9);transfers[_0xd6fe('0x21')](_0x5243a9);agents[_0xd6fe('0x21')](_0x5243a9);calls[_0xd6fe('0x21')](_0x5243a9);}catch(_0x24dccc){utils[_0xd6fe('0x10')](_0x24dccc);}});ami['on'](_0xd6fe('0x22'),function(_0x2c92cf){try{queues[_0xd6fe('0x22')](_0x2c92cf);recordings['varset'](_0x2c92cf);calls[_0xd6fe('0x22')](_0x2c92cf);dials['varset'](_0x2c92cf);}catch(_0x561ef2){utils[_0xd6fe('0x10')](_0x561ef2);}});ami['on'](_0xd6fe('0x23'),function(_0x26ede7){try{calls['newexten'](_0x26ede7);recordings[_0xd6fe('0x23')](_0x26ede7);dials[_0xd6fe('0x23')](_0x26ede7);}catch(_0x403bb4){utils[_0xd6fe('0x10')](_0x403bb4);}});ami['on'](_0xd6fe('0x24'),function(_0x2301c1){try{calls['newchannel'](_0x2301c1);recordings[_0xd6fe('0x24')](_0x2301c1);}catch(_0x22674f){utils[_0xd6fe('0x10')](_0x22674f);}});ami['on'](_0xd6fe('0x25'),function(_0x27eab6){try{dials[_0xd6fe('0x25')](_0x27eab6);}catch(_0x596a20){utils[_0xd6fe('0x10')](_0x596a20);}});ami['on'](_0xd6fe('0x26'),function(_0xf9e53c){try{dials[_0xd6fe('0x26')](_0xf9e53c);}catch(_0x9edea0){utils[_0xd6fe('0x10')](_0x9edea0);}});} \ No newline at end of file +var _0x32e6=['attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','./utils','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer'];(function(_0x5ebacc,_0x24d8fe){var _0xf55b4e=function(_0x419259){while(--_0x419259){_0x5ebacc['push'](_0x5ebacc['shift']());}};_0xf55b4e(++_0x24d8fe);}(_0x32e6,0x180));var _0x632e=function(_0xbb3920,_0x5716d1){_0xbb3920=_0xbb3920-0x0;var _0x356544=_0x32e6[_0xbb3920];return _0x356544;};var AsteriskManager=require(_0x632e('0x0'));var config=require('../../config/environment');var utils=require(_0x632e('0x1'));var ami=new AsteriskManager(config[_0x632e('0x2')][_0x632e('0x3')],config[_0x632e('0x2')]['ip'],config[_0x632e('0x2')][_0x632e('0x4')],config['asterisk'][_0x632e('0x5')],!![]);ami[_0x632e('0x6')]();if(config[_0x632e('0x7')]&&config[_0x632e('0x7')][_0x632e('0x8')]){utils[_0x632e('0x9')](_0x632e('0xa'));}else{var agents=require(_0x632e('0xb'));var calls=require(_0x632e('0xc'));var queues=require('./queues.controller');var recordings=require(_0x632e('0xd'));var members=require('./members.controller');var dials=require(_0x632e('0xe'));var transfers=require('./transfers.controller');var core=require(_0x632e('0xf'));ami['on'](_0x632e('0x10'),core['connect']);ami['on'](_0x632e('0x11'),core[_0x632e('0x11')]);ami['on'](_0x632e('0x12'),core['fullybooted']);ami['on'](_0x632e('0x13'),core['error']);ami['on']('close',core[_0x632e('0x14')]);ami['on'](_0x632e('0x15'),core[_0x632e('0x15')]);ami['on'](_0x632e('0x16'),function(_0x24a2c6){try{members[_0x632e('0x16')](_0x24a2c6);}catch(_0x414fec){utils[_0x632e('0x13')](_0x414fec);}});ami['on']('agentcalled',function(_0x2f885d){try{agents[_0x632e('0x17')](_0x2f885d);}catch(_0x4c491b){utils['error'](_0x4c491b);}});ami['on']('agentringnoanswer',function(_0x16f986){try{agents[_0x632e('0x18')](_0x16f986);}catch(_0x57613a){utils['error'](_0x57613a);}});ami['on']('agentconnect',function(_0x30d7d9){try{agents[_0x632e('0x19')](_0x30d7d9);queues['agentconnect'](_0x30d7d9);}catch(_0x3087f3){utils['error'](_0x3087f3);}});ami['on'](_0x632e('0x1a'),function(_0x3875ab){try{agents['agentcomplete'](_0x3875ab);queues[_0x632e('0x1a')](_0x3875ab);members[_0x632e('0x1a')](_0x3875ab);}catch(_0x429992){utils[_0x632e('0x13')](_0x429992);}});ami['on'](_0x632e('0x1b'),function(_0x4ec671){try{agents[_0x632e('0x1b')](_0x4ec671);queues[_0x632e('0x1b')](_0x4ec671);}catch(_0x5c7344){utils[_0x632e('0x13')](_0x5c7344);}});ami['on'](_0x632e('0x1c'),function(_0x40fd21){try{queues['queuecallerjoin'](_0x40fd21);recordings[_0x632e('0x1c')](_0x40fd21);}catch(_0x48d180){utils[_0x632e('0x13')](_0x48d180);}});ami['on'](_0x632e('0x1d'),function(_0x2d8558){try{queues[_0x632e('0x1d')](_0x2d8558);}catch(_0xc70891){utils['error'](_0xc70891);}});ami['on'](_0x632e('0x1e'),function(_0x3a68a2){try{queues['musiconholdstart'](_0x3a68a2);calls[_0x632e('0x1e')](_0x3a68a2);}catch(_0x354948){utils['error'](_0x354948);}});ami['on'](_0x632e('0x1f'),function(_0xdb24de){try{queues[_0x632e('0x1f')](_0xdb24de);calls[_0x632e('0x1f')](_0xdb24de);}catch(_0x27ba7f){utils['error'](_0x27ba7f);}});ami['on'](_0x632e('0x20'),function(_0x4bba83){try{calls[_0x632e('0x20')](_0x4bba83);recordings[_0x632e('0x20')](_0x4bba83);}catch(_0x1e8b01){utils[_0x632e('0x13')](_0x1e8b01);}});ami['on']('hangup',function(_0x49dd37){try{calls[_0x632e('0x21')](_0x49dd37);recordings[_0x632e('0x21')](_0x49dd37);dials['hangup'](_0x49dd37);agents[_0x632e('0x21')](_0x49dd37);queues[_0x632e('0x21')](_0x49dd37);}catch(_0x73d261){utils['error'](_0x73d261);}});ami['on'](_0x632e('0x22'),function(_0x1f3ecd){try{members[_0x632e('0x22')](_0x1f3ecd);}catch(_0x57310e){utils[_0x632e('0x13')](_0x57310e);}});ami['on'](_0x632e('0x23'),function(_0x287a87){try{queues[_0x632e('0x23')](_0x287a87);agents[_0x632e('0x23')](_0x287a87);transfers[_0x632e('0x23')](_0x287a87);}catch(_0x15abfb){utils[_0x632e('0x13')](_0x15abfb);}});ami['on'](_0x632e('0x24'),function(_0x130e9a){try{queues[_0x632e('0x24')](_0x130e9a);transfers['attendedtransfer'](_0x130e9a);agents[_0x632e('0x24')](_0x130e9a);calls[_0x632e('0x24')](_0x130e9a);}catch(_0x12e190){utils['error'](_0x12e190);}});ami['on'](_0x632e('0x25'),function(_0x3dc39d){try{queues['varset'](_0x3dc39d);recordings[_0x632e('0x25')](_0x3dc39d);calls[_0x632e('0x25')](_0x3dc39d);dials[_0x632e('0x25')](_0x3dc39d);}catch(_0x3c2eeb){utils[_0x632e('0x13')](_0x3c2eeb);}});ami['on'](_0x632e('0x26'),function(_0x18931d){try{calls[_0x632e('0x26')](_0x18931d);recordings[_0x632e('0x26')](_0x18931d);dials[_0x632e('0x26')](_0x18931d);}catch(_0x5ab25c){utils['error'](_0x5ab25c);}});ami['on'](_0x632e('0x27'),function(_0x3acbff){try{calls[_0x632e('0x27')](_0x3acbff);recordings[_0x632e('0x27')](_0x3acbff);}catch(_0x430bd7){utils[_0x632e('0x13')](_0x430bd7);}});ami['on']('dialbegin',function(_0x19bf5e){try{dials[_0x632e('0x28')](_0x19bf5e);}catch(_0x5f3114){utils[_0x632e('0x13')](_0x5f3114);}});ami['on']('dialend',function(_0x558538){try{dials[_0x632e('0x29')](_0x558538);}catch(_0x1c35e3){utils['error'](_0x1c35e3);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 6cca4df..5c4ce7d 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 _0xc946=['devicestatechange','state','INUSE','device','voice','TALKING','now','NOT_INUSE','isNil','duration','diffTime','exitAt','enterAt','agentcomplete','assign','queue','cdr','data1','data3','destination','source','lodash','./utils','Local/_attended@transfer','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','data2','membername','type','then','internal','request','CreateMemberReport','getUserByName','split','catch','error','some','startsWith'];(function(_0x3b6494,_0x13c7f7){var _0x15d0ad=function(_0xe10717){while(--_0xe10717){_0x3b6494['push'](_0x3b6494['shift']());}};_0x15d0ad(++_0x13c7f7);}(_0xc946,0x96));var _0x6c94=function(_0x2afdde,_0x54cc2a){_0x2afdde=_0x2afdde-0x0;var _0x106f84=_0xc946[_0x2afdde];return _0x106f84;};'use strict';var _=require(_0x6c94('0x0'));var util=require('util');var utils=require(_0x6c94('0x1'));var members={};var exclude=[_0x6c94('0x2'),'Queue:'];function writeDB(_0x297540){utils[_0x6c94('0x3')](util[_0x6c94('0x4')](_0x6c94('0x5'),_0x297540[_0x6c94('0x6')],_0x297540[_0x6c94('0x7')],_0x297540[_0x6c94('0x8')],_0x297540[_0x6c94('0x9')],_0x297540[_0x6c94('0xa')],_0x297540[_0x6c94('0xb')]));if(_0x297540[_0x6c94('0x7')]){utils['getUserByInterface'](_0x297540[_0x6c94('0x7')])[_0x6c94('0xc')](function(_0x38f8d9){if(_0x38f8d9){_0x297540[_0x6c94('0xa')]=_0x38f8d9['name'];_0x297540[_0x6c94('0xd')]=_0x38f8d9[_0x6c94('0xd')];utils[_0x6c94('0xe')](_0x6c94('0xf'),_0x297540);}else{utils[_0x6c94('0x10')](_0x297540[_0x6c94('0x7')][_0x6c94('0x11')]('/')[0x1])[_0x6c94('0xc')](function(_0x5223c8){if(_0x5223c8){_0x297540[_0x6c94('0xa')]=_0x5223c8['name'];_0x297540['internal']=_0x5223c8[_0x6c94('0xd')];utils['request']('CreateMemberReport',_0x297540);}});}})[_0x6c94('0x12')](function(_0x19d399){utils[_0x6c94('0x13')](_0x19d399);});}delete members[_0x297540[_0x6c94('0x7')]];}function startsWith(_0x1de6f1,_0x3c0a10){return _[_0x6c94('0x14')](_0x1de6f1,function(_0x3e7a20){return _[_0x6c94('0x15')](_0x3c0a10,_0x3e7a20);});}exports[_0x6c94('0x16')]=function(_0x30f344){switch(_0x30f344[_0x6c94('0x17')]){case _0x6c94('0x18'):case'BUSY':if(!startsWith(exclude,_0x30f344[_0x6c94('0x19')])){members[_0x30f344[_0x6c94('0x19')]]={'channel':_0x6c94('0x1a'),'interface':_0x30f344[_0x6c94('0x19')],'type':_0x6c94('0x1b'),'enterAt':utils[_0x6c94('0x1c')](),'role':'agent'};}break;case _0x6c94('0x1d'):if(!_[_0x6c94('0x1e')](members[_0x30f344[_0x6c94('0x19')]])){members[_0x30f344[_0x6c94('0x19')]]['exitAt']=utils[_0x6c94('0x1c')]();members[_0x30f344[_0x6c94('0x19')]][_0x6c94('0x1f')]=utils[_0x6c94('0x20')](members[_0x30f344['device']][_0x6c94('0x21')],members[_0x30f344[_0x6c94('0x19')]][_0x6c94('0x22')]);if(members[_0x30f344[_0x6c94('0x19')]][_0x6c94('0x6')]){writeDB(members[_0x30f344[_0x6c94('0x19')]]);}}default:break;}};exports[_0x6c94('0x23')]=function(_0x394f5e){if(!_['isNil'](members[_0x394f5e['interface']])){members[_0x394f5e['interface']]=_[_0x6c94('0x24')](members[_0x394f5e['interface']],{'data4':_0x394f5e[_0x6c94('0x25')],'uniqueid':_0x394f5e['uniqueid']});}};exports[_0x6c94('0x26')]=function(_0x21e8d3){if(_0x21e8d3[_0x6c94('0x8')]){var _0x4c5150=_0x21e8d3[_0x6c94('0x8')][_0x6c94('0x11')]('-')[0x0];if(!_[_0x6c94('0x1e')](members[_0x4c5150])){members[_0x4c5150]=_[_0x6c94('0x24')](members[_0x4c5150],{'data1':members[_0x4c5150][_0x6c94('0x27')]||_0x21e8d3[_0x6c94('0xb')],'data2':members[_0x4c5150][_0x6c94('0x9')]||_0x21e8d3['source'],'data3':members[_0x4c5150][_0x6c94('0x28')]||_0x21e8d3[_0x6c94('0x29')],'uniqueid':members[_0x4c5150]['uniqueid']||_0x21e8d3['uniqueid']});if(members[_0x4c5150]['exitAt']){writeDB(members[_0x4c5150]);}}}if(_0x21e8d3['destinationchannel']){var _0x38c477=_0x21e8d3['destinationchannel'][_0x6c94('0x11')]('-')[0x0];if(!_['isNil'](members[_0x38c477])){members[_0x38c477]=_[_0x6c94('0x24')](members[_0x38c477],{'data1':members[_0x38c477][_0x6c94('0x27')]||_0x21e8d3['type'],'data2':members[_0x38c477][_0x6c94('0x9')]||_0x21e8d3[_0x6c94('0x2a')],'data3':members[_0x38c477]['data3']||_0x21e8d3[_0x6c94('0x29')],'uniqueid':members[_0x38c477]['uniqueid']||_0x21e8d3[_0x6c94('0x6')]});if(members[_0x38c477]['exitAt']){writeDB(members[_0x38c477]);}}}}; \ No newline at end of file +var _0xca5d=['destination','destinationchannel','lodash','util','./utils','Local/_attended@transfer','info','uniqueid','interface','channel','data2','membername','type','then','name','internal','request','split','CreateMemberReport','catch','some','startsWith','devicestatechange','state','BUSY','device','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','assign','queue','data1','source','data3'];(function(_0x53782a,_0x21000f){var _0x860ad5=function(_0x46af1b){while(--_0x46af1b){_0x53782a['push'](_0x53782a['shift']());}};_0x860ad5(++_0x21000f);}(_0xca5d,0x1ee));var _0xdca5=function(_0x30b931,_0x4403f2){_0x30b931=_0x30b931-0x0;var _0x44b4af=_0xca5d[_0x30b931];return _0x44b4af;};'use strict';var _=require(_0xdca5('0x0'));var util=require(_0xdca5('0x1'));var utils=require(_0xdca5('0x2'));var members={};var exclude=[_0xdca5('0x3'),'Queue:'];function writeDB(_0x55980f){utils[_0xdca5('0x4')](util['format']('MEMBER|%s|%s|%s|%s|%s|%s',_0x55980f[_0xdca5('0x5')],_0x55980f[_0xdca5('0x6')],_0x55980f[_0xdca5('0x7')],_0x55980f[_0xdca5('0x8')],_0x55980f[_0xdca5('0x9')],_0x55980f[_0xdca5('0xa')]));if(_0x55980f[_0xdca5('0x6')]){utils['getUserByInterface'](_0x55980f['interface'])[_0xdca5('0xb')](function(_0x451100){if(_0x451100){_0x55980f[_0xdca5('0x9')]=_0x451100[_0xdca5('0xc')];_0x55980f[_0xdca5('0xd')]=_0x451100[_0xdca5('0xd')];utils[_0xdca5('0xe')]('CreateMemberReport',_0x55980f);}else{utils['getUserByName'](_0x55980f[_0xdca5('0x6')][_0xdca5('0xf')]('/')[0x1])['then'](function(_0x5692e7){if(_0x5692e7){_0x55980f[_0xdca5('0x9')]=_0x5692e7[_0xdca5('0xc')];_0x55980f[_0xdca5('0xd')]=_0x5692e7[_0xdca5('0xd')];utils[_0xdca5('0xe')](_0xdca5('0x10'),_0x55980f);}});}})[_0xdca5('0x11')](function(_0x3006fa){utils['error'](_0x3006fa);});}delete members[_0x55980f[_0xdca5('0x6')]];}function startsWith(_0x317993,_0x69123d){return _[_0xdca5('0x12')](_0x317993,function(_0x212867){return _[_0xdca5('0x13')](_0x69123d,_0x212867);});}exports[_0xdca5('0x14')]=function(_0x218ea7){switch(_0x218ea7[_0xdca5('0x15')]){case'INUSE':case _0xdca5('0x16'):if(!startsWith(exclude,_0x218ea7['device'])){members[_0x218ea7[_0xdca5('0x17')]]={'channel':_0xdca5('0x18'),'interface':_0x218ea7[_0xdca5('0x17')],'type':_0xdca5('0x19'),'enterAt':utils[_0xdca5('0x1a')](),'role':_0xdca5('0x1b')};}break;case _0xdca5('0x1c'):if(!_[_0xdca5('0x1d')](members[_0x218ea7[_0xdca5('0x17')]])){members[_0x218ea7[_0xdca5('0x17')]][_0xdca5('0x1e')]=utils[_0xdca5('0x1a')]();members[_0x218ea7[_0xdca5('0x17')]]['duration']=utils[_0xdca5('0x1f')](members[_0x218ea7[_0xdca5('0x17')]][_0xdca5('0x1e')],members[_0x218ea7[_0xdca5('0x17')]][_0xdca5('0x20')]);if(members[_0x218ea7[_0xdca5('0x17')]][_0xdca5('0x5')]){writeDB(members[_0x218ea7[_0xdca5('0x17')]]);}}default:break;}};exports[_0xdca5('0x21')]=function(_0xeeca4f){if(!_[_0xdca5('0x1d')](members[_0xeeca4f[_0xdca5('0x6')]])){members[_0xeeca4f['interface']]=_[_0xdca5('0x22')](members[_0xeeca4f[_0xdca5('0x6')]],{'data4':_0xeeca4f[_0xdca5('0x23')],'uniqueid':_0xeeca4f[_0xdca5('0x5')]});}};exports['cdr']=function(_0x31e570){if(_0x31e570['channel']){var _0x118fe8=_0x31e570[_0xdca5('0x7')][_0xdca5('0xf')]('-')[0x0];if(!_['isNil'](members[_0x118fe8])){members[_0x118fe8]=_['assign'](members[_0x118fe8],{'data1':members[_0x118fe8][_0xdca5('0x24')]||_0x31e570[_0xdca5('0xa')],'data2':members[_0x118fe8][_0xdca5('0x8')]||_0x31e570[_0xdca5('0x25')],'data3':members[_0x118fe8][_0xdca5('0x26')]||_0x31e570[_0xdca5('0x27')],'uniqueid':members[_0x118fe8]['uniqueid']||_0x31e570[_0xdca5('0x5')]});if(members[_0x118fe8][_0xdca5('0x1e')]){writeDB(members[_0x118fe8]);}}}if(_0x31e570['destinationchannel']){var _0x183085=_0x31e570[_0xdca5('0x28')][_0xdca5('0xf')]('-')[0x0];if(!_['isNil'](members[_0x183085])){members[_0x183085]=_[_0xdca5('0x22')](members[_0x183085],{'data1':members[_0x183085][_0xdca5('0x24')]||_0x31e570[_0xdca5('0xa')],'data2':members[_0x183085]['data2']||_0x31e570['source'],'data3':members[_0x183085]['data3']||_0x31e570[_0xdca5('0x27')],'uniqueid':members[_0x183085][_0xdca5('0x5')]||_0x31e570['uniqueid']});if(members[_0x183085]['exitAt']){writeDB(members[_0x183085]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index bb979f3..2f4b192 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 _0x4ee1=['getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','position','now','hangup','isNil','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','queueposition','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','queuecallerleaveAt','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','membername','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','calleridnum','calleridname','queuecallerjoinAt','mohtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','clone','error','stack','musiconholdstartAt','musiconholdstop','diffTime','util','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','lastAssignedTo','accountcode','queuecallerexitreason','queue'];(function(_0x53d4c6,_0x2872c4){var _0x3a18ea=function(_0x2158be){while(--_0x2158be){_0x53d4c6['push'](_0x53d4c6['shift']());}};_0x3a18ea(++_0x2872c4);}(_0x4ee1,0x13b));var _0x14ee=function(_0x50e6ab,_0x156358){_0x50e6ab=_0x50e6ab-0x0;var _0xb7db28=_0x4ee1[_0x50e6ab];return _0xb7db28;};'use strict';var _=require('lodash');var util=require(_0x14ee('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x339cb8){utils['info'](util[_0x14ee('0x1')](_0x14ee('0x2'),_0x339cb8[_0x14ee('0x3')],_0x339cb8[_0x14ee('0x4')],_0x339cb8['queue'],_0x339cb8[_0x14ee('0x5')],_0x339cb8['calleridnum'],_0x339cb8[_0x14ee('0x6')],_0x339cb8[_0x14ee('0x7')]));if(_0x339cb8[_0x14ee('0x8')]){utils[_0x14ee('0x9')](_0x339cb8[_0x14ee('0x8')])[_0x14ee('0xa')](function(_0x2e98de){if(_0x2e98de){_0x339cb8[_0x14ee('0xb')]=_0x2e98de[_0x14ee('0xb')];}utils[_0x14ee('0xc')](_0x14ee('0xd'),_0x339cb8);});}else{utils[_0x14ee('0xc')]('CreateVoiceQueueReport',_0x339cb8);}if(_0x339cb8[_0x14ee('0xe')]){delete queues[_0x339cb8[_0x14ee('0xe')]];}else{delete queues[_0x339cb8[_0x14ee('0x3')]];}}exports[_0x14ee('0xf')]=function(_0x3a1f6b){queues[_0x3a1f6b[_0x14ee('0x3')]]=_['assign'](_0x3a1f6b,{'originalposition':_0x3a1f6b[_0x14ee('0x10')],'queuecallerjoinAt':utils[_0x14ee('0x11')](),'mohtime':0x0});};exports[_0x14ee('0x12')]=function(_0x55df2e){if(!_[_0x14ee('0x13')](queues[_0x55df2e[_0x14ee('0x3')]])){if(queues[_0x55df2e[_0x14ee('0x3')]]['queuecallerleaveAt']){if(!queues[_0x55df2e[_0x14ee('0x3')]]['queuecallerabandon']&&!queues[_0x55df2e['uniqueid']][_0x14ee('0x14')]){queues[_0x55df2e[_0x14ee('0x3')]][_0x14ee('0x15')]=!![];queues[_0x55df2e[_0x14ee('0x3')]][_0x14ee('0x16')]=utils['now']();queues[_0x55df2e[_0x14ee('0x3')]][_0x14ee('0x7')]=_0x14ee('0x17');}writeDB(queues[_0x55df2e[_0x14ee('0x3')]]);}else{if(queues[_0x55df2e[_0x14ee('0x3')]][_0x14ee('0xe')]){queues[queues[_0x55df2e[_0x14ee('0x3')]][_0x14ee('0xe')]]=queues[_0x55df2e[_0x14ee('0x3')]];queues[queues[_0x55df2e[_0x14ee('0x3')]][_0x14ee('0xe')]][_0x14ee('0x18')]=0x2;delete queues[_0x55df2e['uniqueid']];}}}};exports['varset']=function(_0x1ffd2f){if(!_[_0x14ee('0x13')](_0x1ffd2f[_0x14ee('0x19')][_0x14ee('0x1a')])&&_0x1ffd2f[_0x14ee('0x1b')][_0x14ee('0x1c')]()!==_0x14ee('0x1d')){if(!_['isNil'](queues[_0x1ffd2f['uniqueid']])){queues[_0x1ffd2f[_0x14ee('0x3')]][_0x14ee('0x1e')]=![];queues[_0x1ffd2f[_0x14ee('0x3')]][_0x14ee('0x1f')]=null;queues[_0x1ffd2f[_0x14ee('0x3')]]['queuecallerexit']=!![];queues[_0x1ffd2f[_0x14ee('0x3')]][_0x14ee('0x20')]=utils[_0x14ee('0x11')]();queues[_0x1ffd2f['uniqueid']][_0x14ee('0x7')]=_0x1ffd2f[_0x14ee('0x1b')][_0x14ee('0x1c')]();writeDB(queues[_0x1ffd2f[_0x14ee('0x3')]]);}}else if(!_[_0x14ee('0x13')](_0x1ffd2f[_0x14ee('0x19')][_0x14ee('0x21')])){if(!_[_0x14ee('0x13')](queues[_0x1ffd2f[_0x14ee('0x3')]])&&!queues[_0x1ffd2f[_0x14ee('0x3')]][_0x14ee('0x1e')]){queues[_0x1ffd2f[_0x14ee('0x3')]][_0x14ee('0x1e')]=![];queues[_0x1ffd2f[_0x14ee('0x3')]][_0x14ee('0x1f')]=null;queues[_0x1ffd2f[_0x14ee('0x3')]]['queuecallerexit']=!![];queues[_0x1ffd2f[_0x14ee('0x3')]][_0x14ee('0x20')]=utils[_0x14ee('0x11')]();queues[_0x1ffd2f[_0x14ee('0x3')]][_0x14ee('0x7')]=_0x14ee('0x22');}}};exports['queuecallerabandon']=function(_0x10b75e){if(!_[_0x14ee('0x13')](queues[_0x10b75e[_0x14ee('0x3')]])){queues[_0x10b75e['uniqueid']]['queuecallerexit']=![];queues[_0x10b75e[_0x14ee('0x3')]][_0x14ee('0x20')]=null;queues[_0x10b75e[_0x14ee('0x3')]][_0x14ee('0x1e')]=!![];queues[_0x10b75e[_0x14ee('0x3')]][_0x14ee('0x1f')]=utils['now']();queues[_0x10b75e[_0x14ee('0x3')]][_0x14ee('0x7')]=_0x14ee('0x23');}};exports[_0x14ee('0x24')]=function(_0x32b2){if(!_[_0x14ee('0x13')](queues[_0x32b2['uniqueid']])){queues[_0x32b2['uniqueid']][_0x14ee('0x24')]=!![];queues[_0x32b2[_0x14ee('0x3')]]['queuecallerleaveAt']=utils[_0x14ee('0x11')]();queues[_0x32b2[_0x14ee('0x3')]][_0x14ee('0x25')]=utils['diffTime'](queues[_0x32b2[_0x14ee('0x3')]][_0x14ee('0x26')],queues[_0x32b2[_0x14ee('0x3')]]['queuecallerjoinAt']);queues[_0x32b2['uniqueid']]['position']=_0x32b2[_0x14ee('0x10')];queues[_0x32b2[_0x14ee('0x3')]][_0x14ee('0x27')]=_0x32b2['count'];queues[_0x32b2['uniqueid']][_0x14ee('0x28')]=_0x32b2[_0x14ee('0x28')];queues[_0x32b2[_0x14ee('0x3')]]['connectedlinename']=_0x32b2[_0x14ee('0x29')];}};exports[_0x14ee('0x2a')]=function(_0x577f10){if(!_[_0x14ee('0x13')](queues[_0x577f10[_0x14ee('0x3')]])){queues[_0x577f10[_0x14ee('0x3')]][_0x14ee('0x1e')]=![];queues[_0x577f10[_0x14ee('0x3')]][_0x14ee('0x1e')]=![];queues[_0x577f10[_0x14ee('0x3')]]['queuecallerabandonAt']=null;queues[_0x577f10['uniqueid']][_0x14ee('0x14')]=![];queues[_0x577f10[_0x14ee('0x3')]][_0x14ee('0x7')]=null;queues[_0x577f10[_0x14ee('0x3')]][_0x14ee('0x20')]=null;queues[_0x577f10[_0x14ee('0x3')]][_0x14ee('0x2b')]=!![];queues[_0x577f10[_0x14ee('0x3')]][_0x14ee('0x6')]=_0x577f10[_0x14ee('0x2c')];queues[_0x577f10[_0x14ee('0x3')]][_0x14ee('0x5')]=_0x577f10[_0x14ee('0x2d')];}};exports[_0x14ee('0x2e')]=function(_0x336623){if(!_[_0x14ee('0x13')](queues[_0x336623[_0x14ee('0x3')]])){if(queues[_0x336623[_0x14ee('0x3')]][_0x14ee('0x26')]){queues[_0x336623[_0x14ee('0x3')]][_0x14ee('0x1e')]=![];queues[_0x336623['uniqueid']][_0x14ee('0x1e')]=![];queues[_0x336623['uniqueid']][_0x14ee('0x1f')]=null;queues[_0x336623[_0x14ee('0x3')]][_0x14ee('0x14')]=![];queues[_0x336623[_0x14ee('0x3')]][_0x14ee('0x20')]=null;queues[_0x336623['uniqueid']][_0x14ee('0x2b')]=!![];queues[_0x336623['uniqueid']][_0x14ee('0x5')]=_0x336623[_0x14ee('0x2d')];queues[_0x336623[_0x14ee('0x3')]][_0x14ee('0x15')]=!![];queues[_0x336623[_0x14ee('0x3')]][_0x14ee('0x16')]=utils[_0x14ee('0x11')]();if(_0x336623[_0x14ee('0x2f')]==_0x14ee('0x30')){if(!queues[_0x336623[_0x14ee('0x3')]][_0x14ee('0x30')]){queues[_0x336623[_0x14ee('0x3')]][_0x14ee('0x7')]=_0x14ee('0x31');}}else{queues[_0x336623[_0x14ee('0x3')]][_0x14ee('0x7')]=_0x14ee('0x32')+_0x336623['reason'][_0x14ee('0x1c')]();}writeDB(queues[_0x336623[_0x14ee('0x3')]]);}}};exports[_0x14ee('0x33')]=function(_0x33474d){if(!_[_0x14ee('0x13')](queues[_0x33474d[_0x14ee('0x34')]])){queues[_0x33474d[_0x14ee('0x34')]][_0x14ee('0x30')]=!![];queues[_0x33474d['transfereeuniqueid']][_0x14ee('0x35')]=_0x14ee('0x36');queues[_0x33474d[_0x14ee('0x34')]][_0x14ee('0x37')]=_0x33474d[_0x14ee('0x38')];queues[_0x33474d[_0x14ee('0x34')]][_0x14ee('0x39')]=_0x33474d['transfereeuniqueid'];queues[_0x33474d[_0x14ee('0x34')]][_0x14ee('0x7')]=_0x14ee('0x3a');}};exports[_0x14ee('0x3b')]=function(_0x286d87){try{if(_0x286d87[_0x14ee('0x3c')]==_0x286d87[_0x14ee('0x3d')]){if(!_[_0x14ee('0x13')](queues[_0x286d87[_0x14ee('0x3e')]])){queues[_0x286d87['secondtransfererlinkedid']]['transfer']=!![];queues[_0x286d87[_0x14ee('0x3e')]][_0x14ee('0x35')]=_0x14ee('0x3f');queues[_0x286d87['secondtransfererlinkedid']][_0x14ee('0x37')]=_0x286d87[_0x14ee('0x40')];queues[_0x286d87['secondtransfererlinkedid']][_0x14ee('0x39')]=_0x286d87[_0x14ee('0x3c')];queues[_0x286d87[_0x14ee('0x3e')]][_0x14ee('0x7')]=_0x14ee('0x41');}if(!_[_0x14ee('0x13')](queues[_0x286d87['origtransfererlinkedid']])){if(_0x286d87['transfereelinkedid']&&queues[_0x286d87['transfereelinkedid']]){queues[_0x286d87[_0x14ee('0x42')]][_0x14ee('0x18')]=0x1;queues[_0x286d87[_0x14ee('0x34')]]=_['clone'](queues[_0x286d87[_0x14ee('0x42')]]);queues[_0x286d87[_0x14ee('0x34')]][_0x14ee('0xe')]=_0x286d87['transfertargetuniqueid'];queues[_0x286d87[_0x14ee('0x34')]]['queuecallerenterreason']=0x2;queues[_0x286d87[_0x14ee('0x34')]][_0x14ee('0x43')]=queues[_0x286d87[_0x14ee('0x3e')]][_0x14ee('0x43')];queues[_0x286d87[_0x14ee('0x34')]]['calleridname']=queues[_0x286d87[_0x14ee('0x3e')]][_0x14ee('0x44')];queues[_0x286d87[_0x14ee('0x34')]][_0x14ee('0x45')]=utils['now']();queues[_0x286d87['transfereeuniqueid']][_0x14ee('0x26')]=utils['now']();queues[_0x286d87[_0x14ee('0x34')]][_0x14ee('0x25')]=0x0;queues[_0x286d87[_0x14ee('0x34')]][_0x14ee('0x46')]=0x0;}else{queues[_0x286d87[_0x14ee('0x3d')]][_0x14ee('0xe')]=_0x286d87['secondtransfererlinkedid'];}}}else if(_0x286d87[_0x14ee('0x47')]==_0x286d87[_0x14ee('0x3e')]){if(!_['isNil'](queues[_0x286d87[_0x14ee('0x3d')]])){queues[_0x286d87[_0x14ee('0x3d')]][_0x14ee('0x30')]=!![];queues[_0x286d87[_0x14ee('0x3d')]][_0x14ee('0x35')]=_0x14ee('0x3f');queues[_0x286d87[_0x14ee('0x3d')]][_0x14ee('0x37')]=_0x286d87[_0x14ee('0x48')];queues[_0x286d87[_0x14ee('0x3d')]][_0x14ee('0x39')]=_0x286d87[_0x14ee('0x47')];queues[_0x286d87['origtransfererlinkedid']][_0x14ee('0x7')]='ATTENDEDTRANSFER';}if(!_[_0x14ee('0x13')](queues[_0x286d87[_0x14ee('0x3e')]])){if(_0x286d87['transfertargetlinkedid']&&queues[_0x286d87[_0x14ee('0x49')]]){queues[_0x286d87['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x286d87[_0x14ee('0x4a')]]=_[_0x14ee('0x4b')](queues[_0x286d87[_0x14ee('0x49')]]);queues[_0x286d87[_0x14ee('0x4a')]][_0x14ee('0xe')]=_0x286d87[_0x14ee('0x4a')];queues[_0x286d87[_0x14ee('0x4a')]]['queuecallerenterreason']=0x2;queues[_0x286d87[_0x14ee('0x4a')]]['calleridnum']=queues[_0x286d87[_0x14ee('0x3d')]][_0x14ee('0x43')];queues[_0x286d87[_0x14ee('0x4a')]][_0x14ee('0x44')]=queues[_0x286d87[_0x14ee('0x3d')]][_0x14ee('0x44')];queues[_0x286d87[_0x14ee('0x4a')]][_0x14ee('0x45')]=utils['now']();queues[_0x286d87[_0x14ee('0x4a')]]['queuecallerleaveAt']=utils[_0x14ee('0x11')]();queues[_0x286d87[_0x14ee('0x4a')]][_0x14ee('0x25')]=0x0;queues[_0x286d87[_0x14ee('0x4a')]][_0x14ee('0x46')]=0x0;}else{queues[_0x286d87[_0x14ee('0x3e')]]['transfereduniqueid']=_0x286d87['origtransfererlinkedid'];}}}}catch(_0x25126e){utils[_0x14ee('0x4c')](_0x25126e[_0x14ee('0x4d')]);}};exports['musiconholdstart']=function(_0x1d25d8){if(!_['isNil'](queues[_0x1d25d8[_0x14ee('0x3')]])){queues[_0x1d25d8[_0x14ee('0x3')]][_0x14ee('0x4e')]=utils[_0x14ee('0x11')]();}};exports[_0x14ee('0x4f')]=function(_0x36c9d8){if(!_[_0x14ee('0x13')](queues[_0x36c9d8[_0x14ee('0x3')]])){if(!_['isNil'](queues[_0x36c9d8[_0x14ee('0x3')]]['musiconholdstartAt'])){queues[_0x36c9d8[_0x14ee('0x3')]][_0x14ee('0x46')]+=utils[_0x14ee('0x50')](utils[_0x14ee('0x11')](),queues[_0x36c9d8[_0x14ee('0x3')]][_0x14ee('0x4e')]);delete queues[_0x36c9d8[_0x14ee('0x3')]]['musiconholdstartAt'];}}}; \ No newline at end of file +var _0x3c90=['queueposition','queuecallerabandonAt','EXITWITHKEY','queuecallerexitAt','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','agentconnect','assigned','accountcode','destaccountcode','lastAssignedTo','membername','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','toUpperCase','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','secondtransfereruniqueid','ATTENDED','secondtransfererexten','transfertargetlinkedid','mohtime','error','stack','musiconholdstart','musiconholdstartAt','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','assign','position','now','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','varset','variable','value','CONTINUE','queuecallerexitreason'];(function(_0x1cb1ed,_0xb6e89d){var _0x237b11=function(_0x342c86){while(--_0x342c86){_0x1cb1ed['push'](_0x1cb1ed['shift']());}};_0x237b11(++_0xb6e89d);}(_0x3c90,0x15c));var _0x03c9=function(_0x20648e,_0x403f2c){_0x20648e=_0x20648e-0x0;var _0x3d5658=_0x3c90[_0x20648e];return _0x3d5658;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x2d8a09){utils['info'](util[_0x03c9('0x0')](_0x03c9('0x1'),_0x2d8a09[_0x03c9('0x2')],_0x2d8a09[_0x03c9('0x3')],_0x2d8a09[_0x03c9('0x4')],_0x2d8a09['lastAssignedTo'],_0x2d8a09['calleridnum'],_0x2d8a09['accountcode'],_0x2d8a09['queuecallerexitreason']));if(_0x2d8a09[_0x03c9('0x4')]){utils[_0x03c9('0x5')](_0x2d8a09[_0x03c9('0x4')])[_0x03c9('0x6')](function(_0x5c0639){if(_0x5c0639){_0x2d8a09[_0x03c9('0x7')]=_0x5c0639[_0x03c9('0x7')];}utils[_0x03c9('0x8')]('CreateVoiceQueueReport',_0x2d8a09);});}else{utils['request'](_0x03c9('0x9'),_0x2d8a09);}if(_0x2d8a09[_0x03c9('0xa')]){delete queues[_0x2d8a09[_0x03c9('0xa')]];}else{delete queues[_0x2d8a09['uniqueid']];}}exports['queuecallerjoin']=function(_0x58d034){queues[_0x58d034['uniqueid']]=_[_0x03c9('0xb')](_0x58d034,{'originalposition':_0x58d034[_0x03c9('0xc')],'queuecallerjoinAt':utils[_0x03c9('0xd')](),'mohtime':0x0});};exports['hangup']=function(_0x1bc1e5){if(!_[_0x03c9('0xe')](queues[_0x1bc1e5[_0x03c9('0x2')]])){if(queues[_0x1bc1e5[_0x03c9('0x2')]][_0x03c9('0xf')]){if(!queues[_0x1bc1e5[_0x03c9('0x2')]][_0x03c9('0x10')]&&!queues[_0x1bc1e5[_0x03c9('0x2')]][_0x03c9('0x11')]){queues[_0x1bc1e5[_0x03c9('0x2')]][_0x03c9('0x12')]=!![];queues[_0x1bc1e5[_0x03c9('0x2')]][_0x03c9('0x13')]=utils[_0x03c9('0xd')]();queues[_0x1bc1e5['uniqueid']]['queuecallerexitreason']=_0x03c9('0x14');}writeDB(queues[_0x1bc1e5[_0x03c9('0x2')]]);}else{if(queues[_0x1bc1e5[_0x03c9('0x2')]]['transfereduniqueid']){queues[queues[_0x1bc1e5[_0x03c9('0x2')]][_0x03c9('0xa')]]=queues[_0x1bc1e5[_0x03c9('0x2')]];queues[queues[_0x1bc1e5[_0x03c9('0x2')]][_0x03c9('0xa')]][_0x03c9('0x15')]=0x2;delete queues[_0x1bc1e5[_0x03c9('0x2')]];}}}};exports[_0x03c9('0x16')]=function(_0x4d2835){if(!_[_0x03c9('0xe')](_0x4d2835[_0x03c9('0x17')]['queuestatus'])&&_0x4d2835[_0x03c9('0x18')]['toUpperCase']()!==_0x03c9('0x19')){if(!_[_0x03c9('0xe')](queues[_0x4d2835[_0x03c9('0x2')]])){queues[_0x4d2835['uniqueid']][_0x03c9('0x10')]=![];queues[_0x4d2835[_0x03c9('0x2')]]['queuecallerabandonAt']=null;queues[_0x4d2835[_0x03c9('0x2')]]['queuecallerexit']=!![];queues[_0x4d2835[_0x03c9('0x2')]]['queuecallerexitAt']=utils[_0x03c9('0xd')]();queues[_0x4d2835[_0x03c9('0x2')]][_0x03c9('0x1a')]=_0x4d2835['value']['toUpperCase']();writeDB(queues[_0x4d2835[_0x03c9('0x2')]]);}}else if(!_[_0x03c9('0xe')](_0x4d2835[_0x03c9('0x17')][_0x03c9('0x1b')])){if(!_[_0x03c9('0xe')](queues[_0x4d2835[_0x03c9('0x2')]])&&!queues[_0x4d2835[_0x03c9('0x2')]][_0x03c9('0x10')]){queues[_0x4d2835[_0x03c9('0x2')]][_0x03c9('0x10')]=![];queues[_0x4d2835[_0x03c9('0x2')]][_0x03c9('0x1c')]=null;queues[_0x4d2835[_0x03c9('0x2')]][_0x03c9('0x11')]=!![];queues[_0x4d2835['uniqueid']]['queuecallerexitAt']=utils[_0x03c9('0xd')]();queues[_0x4d2835['uniqueid']][_0x03c9('0x1a')]=_0x03c9('0x1d');}}};exports[_0x03c9('0x10')]=function(_0x458f9a){if(!_[_0x03c9('0xe')](queues[_0x458f9a[_0x03c9('0x2')]])){queues[_0x458f9a[_0x03c9('0x2')]][_0x03c9('0x11')]=![];queues[_0x458f9a[_0x03c9('0x2')]][_0x03c9('0x1e')]=null;queues[_0x458f9a[_0x03c9('0x2')]][_0x03c9('0x10')]=!![];queues[_0x458f9a['uniqueid']][_0x03c9('0x1c')]=utils['now']();queues[_0x458f9a[_0x03c9('0x2')]][_0x03c9('0x1a')]='ABANDONED';}};exports[_0x03c9('0x1f')]=function(_0x10d231){if(!_[_0x03c9('0xe')](queues[_0x10d231[_0x03c9('0x2')]])){queues[_0x10d231[_0x03c9('0x2')]][_0x03c9('0x1f')]=!![];queues[_0x10d231['uniqueid']][_0x03c9('0xf')]=utils[_0x03c9('0xd')]();queues[_0x10d231['uniqueid']][_0x03c9('0x20')]=utils[_0x03c9('0x21')](queues[_0x10d231['uniqueid']][_0x03c9('0xf')],queues[_0x10d231['uniqueid']][_0x03c9('0x22')]);queues[_0x10d231[_0x03c9('0x2')]]['position']=_0x10d231[_0x03c9('0xc')];queues[_0x10d231['uniqueid']][_0x03c9('0x23')]=_0x10d231[_0x03c9('0x23')];queues[_0x10d231[_0x03c9('0x2')]][_0x03c9('0x24')]=_0x10d231[_0x03c9('0x24')];queues[_0x10d231[_0x03c9('0x2')]]['connectedlinename']=_0x10d231['connectedlinename'];}};exports[_0x03c9('0x25')]=function(_0x86ee14){if(!_[_0x03c9('0xe')](queues[_0x86ee14['uniqueid']])){queues[_0x86ee14[_0x03c9('0x2')]]['queuecallerabandon']=![];queues[_0x86ee14[_0x03c9('0x2')]][_0x03c9('0x10')]=![];queues[_0x86ee14[_0x03c9('0x2')]]['queuecallerabandonAt']=null;queues[_0x86ee14[_0x03c9('0x2')]][_0x03c9('0x11')]=![];queues[_0x86ee14[_0x03c9('0x2')]][_0x03c9('0x1a')]=null;queues[_0x86ee14[_0x03c9('0x2')]][_0x03c9('0x1e')]=null;queues[_0x86ee14[_0x03c9('0x2')]][_0x03c9('0x26')]=!![];queues[_0x86ee14[_0x03c9('0x2')]][_0x03c9('0x27')]=_0x86ee14[_0x03c9('0x28')];queues[_0x86ee14[_0x03c9('0x2')]][_0x03c9('0x29')]=_0x86ee14[_0x03c9('0x2a')];}};exports[_0x03c9('0x2b')]=function(_0x1352d1){if(!_[_0x03c9('0xe')](queues[_0x1352d1[_0x03c9('0x2')]])){if(queues[_0x1352d1[_0x03c9('0x2')]][_0x03c9('0xf')]){queues[_0x1352d1[_0x03c9('0x2')]][_0x03c9('0x10')]=![];queues[_0x1352d1[_0x03c9('0x2')]][_0x03c9('0x10')]=![];queues[_0x1352d1[_0x03c9('0x2')]][_0x03c9('0x1c')]=null;queues[_0x1352d1[_0x03c9('0x2')]][_0x03c9('0x11')]=![];queues[_0x1352d1[_0x03c9('0x2')]][_0x03c9('0x1e')]=null;queues[_0x1352d1[_0x03c9('0x2')]][_0x03c9('0x26')]=!![];queues[_0x1352d1['uniqueid']][_0x03c9('0x29')]=_0x1352d1[_0x03c9('0x2a')];queues[_0x1352d1[_0x03c9('0x2')]]['queuecallercomplete']=!![];queues[_0x1352d1[_0x03c9('0x2')]][_0x03c9('0x13')]=utils[_0x03c9('0xd')]();if(_0x1352d1[_0x03c9('0x2c')]==_0x03c9('0x2d')){if(!queues[_0x1352d1['uniqueid']][_0x03c9('0x2d')]){queues[_0x1352d1['uniqueid']][_0x03c9('0x1a')]=_0x03c9('0x2e');}}else{queues[_0x1352d1['uniqueid']][_0x03c9('0x1a')]=_0x03c9('0x2f')+_0x1352d1[_0x03c9('0x2c')][_0x03c9('0x30')]();}writeDB(queues[_0x1352d1['uniqueid']]);}}};exports[_0x03c9('0x31')]=function(_0x2f5dca){if(!_[_0x03c9('0xe')](queues[_0x2f5dca[_0x03c9('0x32')]])){queues[_0x2f5dca[_0x03c9('0x32')]][_0x03c9('0x2d')]=!![];queues[_0x2f5dca[_0x03c9('0x32')]][_0x03c9('0x33')]=_0x03c9('0x34');queues[_0x2f5dca[_0x03c9('0x32')]][_0x03c9('0x35')]=_0x2f5dca['extension'];queues[_0x2f5dca['transfereeuniqueid']][_0x03c9('0x36')]=_0x2f5dca[_0x03c9('0x32')];queues[_0x2f5dca[_0x03c9('0x32')]][_0x03c9('0x1a')]='BLINDTRANSFER';}};exports[_0x03c9('0x37')]=function(_0xac5694){try{if(_0xac5694[_0x03c9('0x38')]==_0xac5694[_0x03c9('0x39')]){if(!_['isNil'](queues[_0xac5694['secondtransfererlinkedid']])){queues[_0xac5694[_0x03c9('0x3a')]][_0x03c9('0x2d')]=!![];queues[_0xac5694[_0x03c9('0x3a')]][_0x03c9('0x33')]='ATTENDED';queues[_0xac5694[_0x03c9('0x3a')]][_0x03c9('0x35')]=_0xac5694[_0x03c9('0x3b')];queues[_0xac5694['secondtransfererlinkedid']][_0x03c9('0x36')]=_0xac5694[_0x03c9('0x38')];queues[_0xac5694['secondtransfererlinkedid']][_0x03c9('0x1a')]=_0x03c9('0x3c');}if(!_[_0x03c9('0xe')](queues[_0xac5694['origtransfererlinkedid']])){if(_0xac5694[_0x03c9('0x3d')]&&queues[_0xac5694[_0x03c9('0x3d')]]){queues[_0xac5694[_0x03c9('0x3d')]]['queuecallerenterreason']=0x1;queues[_0xac5694[_0x03c9('0x32')]]=_[_0x03c9('0x3e')](queues[_0xac5694[_0x03c9('0x3d')]]);queues[_0xac5694['transfereeuniqueid']]['transfereduniqueid']=_0xac5694[_0x03c9('0x3f')];queues[_0xac5694[_0x03c9('0x32')]][_0x03c9('0x15')]=0x2;queues[_0xac5694[_0x03c9('0x32')]][_0x03c9('0x40')]=queues[_0xac5694['secondtransfererlinkedid']][_0x03c9('0x40')];queues[_0xac5694['transfereeuniqueid']][_0x03c9('0x41')]=queues[_0xac5694[_0x03c9('0x3a')]][_0x03c9('0x41')];queues[_0xac5694[_0x03c9('0x32')]][_0x03c9('0x22')]=utils[_0x03c9('0xd')]();queues[_0xac5694[_0x03c9('0x32')]][_0x03c9('0xf')]=utils[_0x03c9('0xd')]();queues[_0xac5694[_0x03c9('0x32')]][_0x03c9('0x20')]=0x0;queues[_0xac5694[_0x03c9('0x32')]]['mohtime']=0x0;}else{queues[_0xac5694[_0x03c9('0x39')]]['transfereduniqueid']=_0xac5694['secondtransfererlinkedid'];}}}else if(_0xac5694[_0x03c9('0x42')]==_0xac5694[_0x03c9('0x3a')]){if(!_[_0x03c9('0xe')](queues[_0xac5694[_0x03c9('0x39')]])){queues[_0xac5694[_0x03c9('0x39')]]['transfer']=!![];queues[_0xac5694['origtransfererlinkedid']][_0x03c9('0x33')]=_0x03c9('0x43');queues[_0xac5694[_0x03c9('0x39')]][_0x03c9('0x35')]=_0xac5694[_0x03c9('0x44')];queues[_0xac5694['origtransfererlinkedid']][_0x03c9('0x36')]=_0xac5694['secondtransfereruniqueid'];queues[_0xac5694[_0x03c9('0x39')]][_0x03c9('0x1a')]=_0x03c9('0x3c');}if(!_[_0x03c9('0xe')](queues[_0xac5694['secondtransfererlinkedid']])){if(_0xac5694[_0x03c9('0x45')]&&queues[_0xac5694[_0x03c9('0x45')]]){queues[_0xac5694[_0x03c9('0x45')]][_0x03c9('0x15')]=0x1;queues[_0xac5694[_0x03c9('0x3f')]]=_[_0x03c9('0x3e')](queues[_0xac5694[_0x03c9('0x45')]]);queues[_0xac5694[_0x03c9('0x3f')]][_0x03c9('0xa')]=_0xac5694[_0x03c9('0x3f')];queues[_0xac5694[_0x03c9('0x3f')]][_0x03c9('0x15')]=0x2;queues[_0xac5694[_0x03c9('0x3f')]][_0x03c9('0x40')]=queues[_0xac5694['origtransfererlinkedid']][_0x03c9('0x40')];queues[_0xac5694['transfertargetuniqueid']]['calleridname']=queues[_0xac5694['origtransfererlinkedid']][_0x03c9('0x41')];queues[_0xac5694[_0x03c9('0x3f')]][_0x03c9('0x22')]=utils[_0x03c9('0xd')]();queues[_0xac5694[_0x03c9('0x3f')]][_0x03c9('0xf')]=utils[_0x03c9('0xd')]();queues[_0xac5694[_0x03c9('0x3f')]][_0x03c9('0x20')]=0x0;queues[_0xac5694[_0x03c9('0x3f')]][_0x03c9('0x46')]=0x0;}else{queues[_0xac5694[_0x03c9('0x3a')]][_0x03c9('0xa')]=_0xac5694[_0x03c9('0x39')];}}}}catch(_0xfe3bea){utils[_0x03c9('0x47')](_0xfe3bea[_0x03c9('0x48')]);}};exports[_0x03c9('0x49')]=function(_0x43e1b2){if(!_[_0x03c9('0xe')](queues[_0x43e1b2[_0x03c9('0x2')]])){queues[_0x43e1b2['uniqueid']][_0x03c9('0x4a')]=utils['now']();}};exports['musiconholdstop']=function(_0x586933){if(!_['isNil'](queues[_0x586933['uniqueid']])){if(!_[_0x03c9('0xe')](queues[_0x586933[_0x03c9('0x2')]][_0x03c9('0x4a')])){queues[_0x586933[_0x03c9('0x2')]]['mohtime']+=utils[_0x03c9('0x21')](utils['now'](),queues[_0x586933['uniqueid']][_0x03c9('0x4a')]);delete queues[_0x586933[_0x03c9('0x2')]]['musiconholdstartAt'];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 12d5da8..8f78ac7 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 _0xa9e0=['application','set','appdata','toLowerCase','cdr','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','request','uniqueid','accountcode','exten','context','channel','isNil','channelstate','linkedid','transfer','error','varset','variable','endsWith','.wav49','value','replace','.WAV','find','monitors','stack','hangup','calleridnum','calleridname','connectedlinename','outbound','connectedlinenum','forEach','clone','newexten'];(function(_0x404cde,_0x27b51c){var _0x139882=function(_0x1f31d1){while(--_0x1f31d1){_0x404cde['push'](_0x404cde['shift']());}};_0x139882(++_0x27b51c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x0a9e('0x0'));var utils=require(_0x0a9e('0x1'));var recordings={};function writeDB(_0x29929c){utils['debug'](_0x29929c);if(_0x29929c['accountcode']){utils[_0x0a9e('0x2')](_0x29929c['accountcode'])[_0x0a9e('0x3')](function(_0x432180){if(_0x432180){_0x29929c[_0x0a9e('0x4')]=_0x432180[_0x0a9e('0x5')];_0x29929c[_0x0a9e('0x6')]=_0x432180['id'];}utils['request'](_0x0a9e('0x7'),_0x29929c);});}else{utils[_0x0a9e('0x8')](_0x0a9e('0x7'),_0x29929c);}}exports['newchannel']=function(_0x503809){try{if(_0x503809[_0x0a9e('0x9')]==_0x503809['linkedid']){recordings[_0x503809['uniqueid']]={'uniqueid':_0x503809[_0x0a9e('0x9')],'accountcode':_0x503809[_0x0a9e('0xa')],'exten':_0x503809[_0x0a9e('0xb')],'context':_0x503809[_0x0a9e('0xc')],'channel':_0x503809[_0x0a9e('0xd')],'monitors':[]};}}catch(_0xbd1168){utils['error'](_0xbd1168['stack']);}};exports['newstate']=function(_0x4cfe67){try{if(!_[_0x0a9e('0xe')](recordings[_0x4cfe67[_0x0a9e('0x9')]])&&_0x4cfe67[_0x0a9e('0xf')]==0x6){}else if(!_[_0x0a9e('0xe')](recordings[_0x4cfe67[_0x0a9e('0x10')]])&&_0x4cfe67[_0x0a9e('0xf')]==0x6&&_0x4cfe67['context']!=_0x0a9e('0x11')){recordings[_0x4cfe67[_0x0a9e('0x10')]][_0x0a9e('0xa')]=_0x4cfe67[_0x0a9e('0xa')];}}catch(_0x44dcfd){utils[_0x0a9e('0x12')](_0x44dcfd['stack']);}};exports[_0x0a9e('0x13')]=function(_0x5d0880){try{if(!_[_0x0a9e('0xe')](_0x5d0880['variable'])&&!_[_0x0a9e('0xe')](_0x5d0880[_0x0a9e('0x14')]['mixmonitor_filename'])){if(_[_0x0a9e('0x15')](_0x5d0880['value'],_0x0a9e('0x16'))){_0x5d0880[_0x0a9e('0x17')]=_0x5d0880[_0x0a9e('0x17')][_0x0a9e('0x18')](_0x0a9e('0x16'),_0x0a9e('0x19'));}if(recordings[_0x5d0880[_0x0a9e('0x10')]]){var _0x20559e=_[_0x0a9e('0x1a')](recordings[_0x5d0880[_0x0a9e('0x10')]][_0x0a9e('0x1b')],{'value':_0x5d0880[_0x0a9e('0x17')]});if(_['isNil'](_0x20559e)){recordings[_0x5d0880[_0x0a9e('0x10')]][_0x0a9e('0x1b')]['push']({'value':_0x5d0880[_0x0a9e('0x17')]});}}}}catch(_0x5a09ef){utils['error'](_0x5a09ef[_0x0a9e('0x1c')]);}};exports[_0x0a9e('0x1d')]=function(_0x38e7c4){try{if(!_[_0x0a9e('0xe')](recordings[_0x38e7c4['uniqueid']])){recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1e')]=_0x38e7c4[_0x0a9e('0x1e')];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1f')]=_0x38e7c4[_0x0a9e('0x1f')];recordings[_0x38e7c4[_0x0a9e('0x9')]]['connectedlinenum']=_0x38e7c4['connectedlinenum'];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x20')]=_0x38e7c4[_0x0a9e('0x20')];if(recordings[_0x38e7c4[_0x0a9e('0x9')]]['type']==_0x0a9e('0x21')&&recordings[_0x38e7c4['uniqueid']][_0x0a9e('0xa')]){recordings[_0x38e7c4['uniqueid']][_0x0a9e('0x22')]=recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0xa')];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x20')]='';}recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1b')][_0x0a9e('0x23')](_0x5a101a=>{var _0x3652a7=_[_0x0a9e('0x24')](recordings[_0x38e7c4[_0x0a9e('0x9')]]);_0x3652a7[_0x0a9e('0x17')]=_0x5a101a['value'];writeDB(_0x3652a7);});delete recordings[_0x38e7c4[_0x0a9e('0x9')]];}}catch(_0x40e7a3){utils[_0x0a9e('0x12')](_0x40e7a3[_0x0a9e('0x1c')]);}};exports[_0x0a9e('0x25')]=function(_0x563b45){try{if(!_[_0x0a9e('0xe')](recordings[_0x563b45[_0x0a9e('0x9')]])){if(_0x563b45[_0x0a9e('0x26')]['toLowerCase']()==_0x0a9e('0x27')&&_['startsWith'](_0x563b45[_0x0a9e('0x28')][_0x0a9e('0x29')](),_0x0a9e('0x2a'))){var _0x33bdb7=_0x563b45[_0x0a9e('0x28')]['split']('=');var _0x66c1d2=_0x33bdb7[0x0][_0x0a9e('0x2b')](_0x33bdb7[0x0][_0x0a9e('0x2c')]('(')+0x1,_0x33bdb7[0x0][_0x0a9e('0x2c')](')'));var _0x2b45ea=_0x33bdb7[0x1];recordings[_0x563b45[_0x0a9e('0x9')]][_0x66c1d2]=_0x2b45ea;}}}catch(_0x332d35){utils[_0x0a9e('0x12')](_0x332d35['stack']);}};exports[_0x0a9e('0x2d')]=function(_0x5e7238){try{if(!_[_0x0a9e('0xe')](recordings[_0x5e7238[_0x0a9e('0x9')]])){recordings[_0x5e7238[_0x0a9e('0x9')]][_0x0a9e('0x2e')]=_0x5e7238['queue'];}}catch(_0x191e91){utils[_0x0a9e('0x12')](_0x191e91[_0x0a9e('0x1c')]);}}; \ No newline at end of file +var _0xe706=['CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','isNil','channelstate','stack','varset','variable','value','.WAV','find','monitors','hangup','calleridname','connectedlinenum','connectedlinename','forEach','clone','newexten','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','accountcode','getUserByInternal','then','membername','name','UserId','request'];(function(_0x446bcc,_0x105464){var _0xe976c2=function(_0x48397e){while(--_0x48397e){_0x446bcc['push'](_0x446bcc['shift']());}};_0xe976c2(++_0x105464);}(_0xe706,0xa3));var _0x6e70=function(_0x157ce5,_0xfa6b87){_0x157ce5=_0x157ce5-0x0;var _0x359c0c=_0xe706[_0x157ce5];return _0x359c0c;};'use strict';var _=require(_0x6e70('0x0'));var utils=require(_0x6e70('0x1'));var recordings={};function writeDB(_0x311951){utils['debug'](_0x311951);if(_0x311951[_0x6e70('0x2')]){utils[_0x6e70('0x3')](_0x311951[_0x6e70('0x2')])[_0x6e70('0x4')](function(_0x142c27){if(_0x142c27){_0x311951[_0x6e70('0x5')]=_0x142c27[_0x6e70('0x6')];_0x311951[_0x6e70('0x7')]=_0x142c27['id'];}utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);});}else{utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);}}exports[_0x6e70('0xa')]=function(_0x188ed3){try{if(_0x188ed3[_0x6e70('0xb')]==_0x188ed3[_0x6e70('0xc')]){recordings[_0x188ed3[_0x6e70('0xb')]]={'uniqueid':_0x188ed3[_0x6e70('0xb')],'accountcode':_0x188ed3[_0x6e70('0x2')],'exten':_0x188ed3[_0x6e70('0xd')],'context':_0x188ed3[_0x6e70('0xe')],'channel':_0x188ed3[_0x6e70('0xf')],'monitors':[]};}}catch(_0x37b3e0){utils[_0x6e70('0x10')](_0x37b3e0['stack']);}};exports['newstate']=function(_0x3594c1){try{if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xb')]])&&_0x3594c1[_0x6e70('0x12')]==0x6){}else if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xc')]])&&_0x3594c1[_0x6e70('0x12')]==0x6&&_0x3594c1[_0x6e70('0xe')]!='transfer'){recordings[_0x3594c1['linkedid']]['accountcode']=_0x3594c1[_0x6e70('0x2')];}}catch(_0x5a37a6){utils['error'](_0x5a37a6[_0x6e70('0x13')]);}};exports[_0x6e70('0x14')]=function(_0x5d9263){try{if(!_[_0x6e70('0x11')](_0x5d9263['variable'])&&!_[_0x6e70('0x11')](_0x5d9263[_0x6e70('0x15')]['mixmonitor_filename'])){if(_['endsWith'](_0x5d9263[_0x6e70('0x16')],'.wav49')){_0x5d9263[_0x6e70('0x16')]=_0x5d9263[_0x6e70('0x16')]['replace']('.wav49',_0x6e70('0x17'));}if(recordings[_0x5d9263[_0x6e70('0xc')]]){var _0x2368eb=_[_0x6e70('0x18')](recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')],{'value':_0x5d9263[_0x6e70('0x16')]});if(_[_0x6e70('0x11')](_0x2368eb)){recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')]['push']({'value':_0x5d9263[_0x6e70('0x16')]});}}}}catch(_0x344b65){utils[_0x6e70('0x10')](_0x344b65['stack']);}};exports[_0x6e70('0x1a')]=function(_0xa5d49){try{if(!_[_0x6e70('0x11')](recordings[_0xa5d49['uniqueid']])){recordings[_0xa5d49[_0x6e70('0xb')]]['calleridnum']=_0xa5d49['calleridnum'];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1b')]=_0xa5d49[_0x6e70('0x1b')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1c')]=_0xa5d49[_0x6e70('0x1c')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1d')]=_0xa5d49[_0x6e70('0x1d')];if(recordings[_0xa5d49[_0x6e70('0xb')]]['type']=='outbound'&&recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x2')]){recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1c')]=recordings[_0xa5d49[_0x6e70('0xb')]]['accountcode'];recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1d')]='';}recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x19')][_0x6e70('0x1e')](_0x20a225=>{var _0x3f78d2=_[_0x6e70('0x1f')](recordings[_0xa5d49[_0x6e70('0xb')]]);_0x3f78d2[_0x6e70('0x16')]=_0x20a225['value'];writeDB(_0x3f78d2);});delete recordings[_0xa5d49[_0x6e70('0xb')]];}}catch(_0x50d60b){utils[_0x6e70('0x10')](_0x50d60b['stack']);}};exports[_0x6e70('0x20')]=function(_0x2722e8){try{if(!_[_0x6e70('0x11')](recordings[_0x2722e8['uniqueid']])){if(_0x2722e8[_0x6e70('0x21')][_0x6e70('0x22')]()=='set'&&_[_0x6e70('0x23')](_0x2722e8[_0x6e70('0x24')]['toLowerCase'](),_0x6e70('0x25'))){var _0x3665a1=_0x2722e8[_0x6e70('0x24')][_0x6e70('0x26')]('=');var _0x3b4a13=_0x3665a1[0x0][_0x6e70('0x27')](_0x3665a1[0x0][_0x6e70('0x28')]('(')+0x1,_0x3665a1[0x0][_0x6e70('0x28')](')'));var _0xf146fd=_0x3665a1[0x1];recordings[_0x2722e8[_0x6e70('0xb')]][_0x3b4a13]=_0xf146fd;}}}catch(_0x4d32d8){utils[_0x6e70('0x10')](_0x4d32d8['stack']);}};exports[_0x6e70('0x29')]=function(_0x3222a2){try{if(!_[_0x6e70('0x11')](recordings[_0x3222a2[_0x6e70('0xb')]])){recordings[_0x3222a2[_0x6e70('0xb')]][_0x6e70('0x2a')]=_0x3222a2[_0x6e70('0x2a')];}}catch(_0xdd0bee){utils[_0x6e70('0x10')](_0xdd0bee[_0x6e70('0x13')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 47e67f6..43e69b0 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 _0xbf63=['TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','blind','error','stack','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','attended','isNil','assign','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','lodash','./utils','format'];(function(_0x293b8b,_0x20f129){var _0x2eccfd=function(_0x42712a){while(--_0x42712a){_0x293b8b['push'](_0x293b8b['shift']());}};_0x2eccfd(++_0x20f129);}(_0xbf63,0x1eb));var _0x3bf6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xbf63[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x3bf6('0x0'));var util=require('util');var utils=require(_0x3bf6('0x1'));function writeDB(_0x58a62f){utils['info'](util[_0x3bf6('0x2')](_0x3bf6('0x3'),_0x58a62f[_0x3bf6('0x4')]));utils[_0x3bf6('0x5')](_0x3bf6('0x6'),_0x58a62f);}exports[_0x3bf6('0x7')]=function(_0x2a5895){try{_0x2a5895[_0x3bf6('0x4')]=_0x3bf6('0x8');writeDB(_0x2a5895);}catch(_0x260724){utils[_0x3bf6('0x9')](_0x260724[_0x3bf6('0xa')]);}};exports['attendedtransfer']=function(_0x36ff95){try{_0x36ff95=_['assign'](_0x36ff95,{'transfererchannel':_0x36ff95['origtransfererchannel'],'transferercalleridnum':_0x36ff95[_0x3bf6('0xb')],'transferercalleridname':_0x36ff95[_0x3bf6('0xc')],'transfererconnectedlinenum':_0x36ff95[_0x3bf6('0xd')],'transfererconnectedlinename':_0x36ff95['secondtransfererconnectedlinename'],'transfereraccountcode':_0x36ff95[_0x3bf6('0xe')],'transferercontext':_0x36ff95[_0x3bf6('0xf')],'transfererexten':_0x36ff95[_0x3bf6('0x10')],'transfererlinkedid':_0x36ff95[_0x3bf6('0x11')],'context':_0x36ff95['origtransferercontext'],'extension':_0x36ff95[_0x3bf6('0x12')],'type':_0x3bf6('0x13')});if(_[_0x3bf6('0x14')](_0x36ff95['transfereechannel'])){_0x36ff95=_[_0x3bf6('0x15')](_0x36ff95,{'transfereechannel':_0x36ff95['transfertargetchannel'],'transfereecalleridnum':_0x36ff95[_0x3bf6('0x16')],'transfereecalleridname':_0x36ff95[_0x3bf6('0x17')],'transfereeconnectedlinenum':_0x36ff95[_0x3bf6('0x18')],'transfereeconnectedlinename':_0x36ff95[_0x3bf6('0x19')],'transfereeaccountcode':_0x36ff95['transfertargetaccountcode'],'transfereecontext':_0x36ff95['transfertargetcontext'],'transfereeexten':_0x36ff95['transfertargetexten'],'transfereelinkedid':_0x36ff95['transfertargetlinkedid']});}writeDB(_0x36ff95);}catch(_0xa5818d){utils[_0x3bf6('0x9')](_0xa5818d[_0x3bf6('0xa')]);}}; \ No newline at end of file +var _0xfaba=['lodash','util','./utils','format','request','blindtransfer','type','error','attendedtransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','attended','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','stack'];(function(_0x3ef273,_0x2a7ca8){var _0x1eea65=function(_0x380cac){while(--_0x380cac){_0x3ef273['push'](_0x3ef273['shift']());}};_0x1eea65(++_0x2a7ca8);}(_0xfaba,0xa2));var _0xafab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaba[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xafab('0x0'));var util=require(_0xafab('0x1'));var utils=require(_0xafab('0x2'));function writeDB(_0x8e785f){utils['info'](util[_0xafab('0x3')]('TRANSFER|%s',_0x8e785f['type']));utils[_0xafab('0x4')]('CreateVoiceTransferReport',_0x8e785f);}exports[_0xafab('0x5')]=function(_0x490fe1){try{_0x490fe1[_0xafab('0x6')]='blind';writeDB(_0x490fe1);}catch(_0x10fac3){utils[_0xafab('0x7')](_0x10fac3['stack']);}};exports[_0xafab('0x8')]=function(_0x26ce9f){try{_0x26ce9f=_['assign'](_0x26ce9f,{'transfererchannel':_0x26ce9f[_0xafab('0x9')],'transferercalleridnum':_0x26ce9f[_0xafab('0xa')],'transferercalleridname':_0x26ce9f['origtransferercalleridname'],'transfererconnectedlinenum':_0x26ce9f['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x26ce9f[_0xafab('0xb')],'transfereraccountcode':_0x26ce9f[_0xafab('0xc')],'transferercontext':_0x26ce9f[_0xafab('0xd')],'transfererexten':_0x26ce9f['secondtransfererexten'],'transfererlinkedid':_0x26ce9f[_0xafab('0xe')],'context':_0x26ce9f['origtransferercontext'],'extension':_0x26ce9f['origtransfererexten'],'type':_0xafab('0xf')});if(_[_0xafab('0x10')](_0x26ce9f[_0xafab('0x11')])){_0x26ce9f=_[_0xafab('0x12')](_0x26ce9f,{'transfereechannel':_0x26ce9f[_0xafab('0x13')],'transfereecalleridnum':_0x26ce9f[_0xafab('0x14')],'transfereecalleridname':_0x26ce9f[_0xafab('0x15')],'transfereeconnectedlinenum':_0x26ce9f['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x26ce9f[_0xafab('0x16')],'transfereeaccountcode':_0x26ce9f[_0xafab('0x17')],'transfereecontext':_0x26ce9f['transfertargetcontext'],'transfereeexten':_0x26ce9f[_0xafab('0x18')],'transfereelinkedid':_0x26ce9f[_0xafab('0x19')]});}writeDB(_0x26ce9f);}catch(_0x599f2f){utils[_0xafab('0x7')](_0x599f2f[_0xafab('0x1a')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index fdfc216..86c10f0 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 _0xdd5d=['getUserByInterface','catch','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','addTime','seconds','format','subtractTime','subtract','diffTime','diff','YYYY-MM-DD\x20HH:mm:ss','isAfter','isBefore','jayson/promise','bluebird','client','http','../../config/logger','info','debug','stringify','error','stack','request','then','internal','name','interface','GETUSER|','result','FOUND','NOTFOUND','length','getUserByInternal'];(function(_0xcb9bf1,_0x59f92b){var _0x4eb5a5=function(_0x395362){while(--_0x395362){_0xcb9bf1['push'](_0xcb9bf1['shift']());}};_0x4eb5a5(++_0x59f92b);}(_0xdd5d,0x198));var _0xddd5=function(_0x40bc02,_0x38fd88){_0x40bc02=_0x40bc02-0x0;var _0x1a40df=_0xdd5d[_0x40bc02];return _0x1a40df;};'use strict';var jayson=require(_0xddd5('0x0'));var moment=require('moment');var BPromise=require(_0xddd5('0x1'));var client=jayson[_0xddd5('0x2')][_0xddd5('0x3')]({'port':0x2329});var logger=require(_0xddd5('0x4'))('xdr');exports[_0xddd5('0x5')]=function(_0x3a2134){logger[_0xddd5('0x5')](_0x3a2134);};exports[_0xddd5('0x6')]=function(_0x35d300){logger[_0xddd5('0x6')](JSON[_0xddd5('0x7')](_0x35d300));};exports['error']=function(_0x5e4ee0){logger[_0xddd5('0x8')](_0x5e4ee0[_0xddd5('0x9')]);};exports['request']=function(_0x52db8f,_0x23b9c5){return client[_0xddd5('0xa')](_0x52db8f,{'body':_0x23b9c5})[_0xddd5('0xb')](function(_0x4354d7){logger[_0xddd5('0x6')](JSON[_0xddd5('0x7')](_0x4354d7));})['catch'](function(_0x92167b){logger[_0xddd5('0x8')](_0x92167b[_0xddd5('0x9')]);});};function getUser(_0x3067d9){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id',_0xddd5('0xc'),_0xddd5('0xd'),_0xddd5('0xe')],'where':_0x3067d9,'limit':0x1}})[_0xddd5('0xb')](function(_0x2c643b){logger[_0xddd5('0x5')](_0xddd5('0xf')+JSON[_0xddd5('0x7')](_0x3067d9)+'|'+(_0x2c643b[_0xddd5('0x10')]['length']?_0xddd5('0x11'):_0xddd5('0x12')));return _0x2c643b[_0xddd5('0x10')][_0xddd5('0x13')]?_0x2c643b['result'][0x0]:null;});}exports[_0xddd5('0x14')]=function(_0x4a47ee){return new BPromise(function(_0x1a2699,_0x5946b9){if(_0x4a47ee){return getUser({'internal':_0x4a47ee})[_0xddd5('0xb')](function(_0x4e408d){return _0x1a2699(_0x4e408d);})['catch'](function(_0x1dcd49){logger[_0xddd5('0x8')](_0x1dcd49['stack']);return _0x1a2699(null);});}else{return _0x1a2699(null);}});};exports[_0xddd5('0x15')]=function(_0x134194){return new BPromise(function(_0x32f708,_0x4d5188){if(_0x134194){return getUser({'interface':_0x134194})['then'](function(_0x1e9059){return _0x32f708(_0x1e9059);})[_0xddd5('0x16')](function(_0x1fb883){logger['error'](_0x1fb883[_0xddd5('0x9')]);return _0x32f708(null);});}else{return _0x32f708(null);}});};exports[_0xddd5('0x17')]=function(_0x200400){return new BPromise(function(_0x1e4a33,_0x2fe0ac){if(_0x200400){return getUser({'name':_0x200400})[_0xddd5('0xb')](function(_0x4d372a){return _0x1e4a33(_0x4d372a);})['catch'](function(_0x1725e1){logger[_0xddd5('0x8')](_0x1725e1[_0xddd5('0x9')]);return _0x1e4a33(null);});}else{return _0x1e4a33(null);}});};exports[_0xddd5('0x18')]=function(_0x3d0e97){return new BPromise(function(_0x246ce4,_0x1601dd){if(_0x3d0e97){return client[_0xddd5('0xa')](_0xddd5('0x19'),{'options':{'raw':!![],'attributes':['id',_0xddd5('0xd'),_0xddd5('0x1a'),_0xddd5('0x1b'),_0xddd5('0x1c')],'where':{'name':_0x3d0e97},'limit':0x1}})[_0xddd5('0xb')](function(_0x265218){logger[_0xddd5('0x5')]('GETVOICEQUEUEBYNAME|'+_0x3d0e97+'|'+(_0x265218['result'][_0xddd5('0x13')]?_0xddd5('0x11'):_0xddd5('0x12')));return _0x246ce4(_0x265218[_0xddd5('0x10')][_0xddd5('0x13')]?_0x265218['result'][0x0]:null);})[_0xddd5('0x16')](function(_0x4df262){logger[_0xddd5('0x8')](_0x4df262['stack']);return _0x246ce4(null);});}else{return _0x246ce4(null);}});};exports[_0xddd5('0x1d')]=function(_0x757c3e,_0x4c7879){return moment(_0x757c3e)['add'](_0x4c7879,_0xddd5('0x1e'))[_0xddd5('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xddd5('0x20')]=function(_0x5e63c5,_0x51ba70){return moment(_0x5e63c5)[_0xddd5('0x21')](_0x51ba70,_0xddd5('0x1e'))[_0xddd5('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xddd5('0x22')]=function(_0xd8a7fb,_0x5840b6){return moment(_0xd8a7fb)[_0xddd5('0x23')](moment(_0x5840b6),'seconds');};exports['sumTime']=function(_0x3e1e6d,_0x2e3512){return parseInt(_0x3e1e6d,0xa)+parseInt(_0x2e3512,0xa);};exports['now']=function(){return moment()[_0xddd5('0x1f')](_0xddd5('0x24'));};exports['isAfter']=function(_0x2f013e,_0x26a83c){if(_0x26a83c){return moment(_0x2f013e)[_0xddd5('0x25')](_0x26a83c);}else{return!![];}};exports[_0xddd5('0x26')]=function(_0x1b09d7,_0x7cfdc6){if(_0x7cfdc6){return moment(_0x1b09d7)[_0xddd5('0x26')](_0x7cfdc6);}else if(_0x1b09d7){return!![];}else{return![];}}; \ No newline at end of file +var _0xe879=['../../config/logger','xdr','info','debug','stringify','error','request','catch','GetUser','name','interface','then','result','length','FOUND','NOTFOUND','getUserByInternal','stack','getUserByInterface','getUserByName','getVoiceQueueByName','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime','diff','now','isAfter','isBefore','jayson/promise','moment','bluebird','client'];(function(_0xe89c4b,_0x34d241){var _0x390e4e=function(_0x40c4b7){while(--_0x40c4b7){_0xe89c4b['push'](_0xe89c4b['shift']());}};_0x390e4e(++_0x34d241);}(_0xe879,0x114));var _0x9e87=function(_0x2e5981,_0xe4e846){_0x2e5981=_0x2e5981-0x0;var _0x6e4fef=_0xe879[_0x2e5981];return _0x6e4fef;};'use strict';var jayson=require(_0x9e87('0x0'));var moment=require(_0x9e87('0x1'));var BPromise=require(_0x9e87('0x2'));var client=jayson[_0x9e87('0x3')]['http']({'port':0x2329});var logger=require(_0x9e87('0x4'))(_0x9e87('0x5'));exports['info']=function(_0x3bb347){logger[_0x9e87('0x6')](_0x3bb347);};exports[_0x9e87('0x7')]=function(_0x29f279){logger[_0x9e87('0x7')](JSON[_0x9e87('0x8')](_0x29f279));};exports['error']=function(_0x1912d5){logger[_0x9e87('0x9')](_0x1912d5['stack']);};exports[_0x9e87('0xa')]=function(_0x23cc18,_0x317e1c){return client[_0x9e87('0xa')](_0x23cc18,{'body':_0x317e1c})['then'](function(_0x32f910){logger[_0x9e87('0x7')](JSON[_0x9e87('0x8')](_0x32f910));})[_0x9e87('0xb')](function(_0x14ffb5){logger[_0x9e87('0x9')](_0x14ffb5['stack']);});};function getUser(_0x48fb82){return client[_0x9e87('0xa')](_0x9e87('0xc'),{'options':{'raw':!![],'attributes':['id','internal',_0x9e87('0xd'),_0x9e87('0xe')],'where':_0x48fb82,'limit':0x1}})[_0x9e87('0xf')](function(_0x1cd865){logger['info']('GETUSER|'+JSON[_0x9e87('0x8')](_0x48fb82)+'|'+(_0x1cd865[_0x9e87('0x10')][_0x9e87('0x11')]?_0x9e87('0x12'):_0x9e87('0x13')));return _0x1cd865[_0x9e87('0x10')][_0x9e87('0x11')]?_0x1cd865[_0x9e87('0x10')][0x0]:null;});}exports[_0x9e87('0x14')]=function(_0x5d9158){return new BPromise(function(_0x2c815d,_0x4038fd){if(_0x5d9158){return getUser({'internal':_0x5d9158})[_0x9e87('0xf')](function(_0x2e316e){return _0x2c815d(_0x2e316e);})[_0x9e87('0xb')](function(_0x3700ca){logger[_0x9e87('0x9')](_0x3700ca[_0x9e87('0x15')]);return _0x2c815d(null);});}else{return _0x2c815d(null);}});};exports[_0x9e87('0x16')]=function(_0x300b8e){return new BPromise(function(_0x1c5e21,_0x270ac6){if(_0x300b8e){return getUser({'interface':_0x300b8e})[_0x9e87('0xf')](function(_0x16eb87){return _0x1c5e21(_0x16eb87);})[_0x9e87('0xb')](function(_0x2d619a){logger[_0x9e87('0x9')](_0x2d619a['stack']);return _0x1c5e21(null);});}else{return _0x1c5e21(null);}});};exports[_0x9e87('0x17')]=function(_0x18115a){return new BPromise(function(_0x48608d,_0x25efcf){if(_0x18115a){return getUser({'name':_0x18115a})[_0x9e87('0xf')](function(_0x1f8f1d){return _0x48608d(_0x1f8f1d);})[_0x9e87('0xb')](function(_0x1e2be1){logger[_0x9e87('0x9')](_0x1e2be1['stack']);return _0x48608d(null);});}else{return _0x48608d(null);}});};exports[_0x9e87('0x18')]=function(_0x4af674){return new BPromise(function(_0x4ea798,_0x3efa2e){if(_0x4af674){return client[_0x9e87('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x9e87('0xd'),_0x9e87('0x19'),_0x9e87('0x1a'),_0x9e87('0x1b')],'where':{'name':_0x4af674},'limit':0x1}})[_0x9e87('0xf')](function(_0xe0553d){logger['info'](_0x9e87('0x1c')+_0x4af674+'|'+(_0xe0553d[_0x9e87('0x10')][_0x9e87('0x11')]?_0x9e87('0x12'):_0x9e87('0x13')));return _0x4ea798(_0xe0553d['result'][_0x9e87('0x11')]?_0xe0553d[_0x9e87('0x10')][0x0]:null);})['catch'](function(_0x1bc325){logger[_0x9e87('0x9')](_0x1bc325[_0x9e87('0x15')]);return _0x4ea798(null);});}else{return _0x4ea798(null);}});};exports[_0x9e87('0x1d')]=function(_0x5b8d59,_0x1fca08){return moment(_0x5b8d59)[_0x9e87('0x1e')](_0x1fca08,_0x9e87('0x1f'))[_0x9e87('0x20')](_0x9e87('0x21'));};exports[_0x9e87('0x22')]=function(_0x4310c2,_0xc62ed5){return moment(_0x4310c2)['subtract'](_0xc62ed5,_0x9e87('0x1f'))[_0x9e87('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x9e87('0x23')]=function(_0xb87a01,_0x22f303){return moment(_0xb87a01)[_0x9e87('0x24')](moment(_0x22f303),_0x9e87('0x1f'));};exports['sumTime']=function(_0x4f7b39,_0x4a2a9a){return parseInt(_0x4f7b39,0xa)+parseInt(_0x4a2a9a,0xa);};exports[_0x9e87('0x25')]=function(){return moment()[_0x9e87('0x20')](_0x9e87('0x21'));};exports[_0x9e87('0x26')]=function(_0x168c5f,_0x1c226e){if(_0x1c226e){return moment(_0x168c5f)['isAfter'](_0x1c226e);}else{return!![];}};exports[_0x9e87('0x27')]=function(_0x560afa,_0x2f503e){if(_0x2f503e){return moment(_0x560afa)[_0x9e87('0x27')](_0x2f503e);}else if(_0x560afa){return!![];}else{return![];}}; \ No newline at end of file